From d6c87fa0dbed24a4e935e3a68178da7c33e7a783 Mon Sep 17 00:00:00 2001 From: polytan02 Date: Sat, 7 Mar 2015 13:50:13 +0000 Subject: [PATCH] Add sources of phpBB --- sources/phpBB/.htaccess | 75 + sources/phpBB/adm/images/alert_close.png | Bin 0 -> 2097 bytes sources/phpBB/adm/images/arrow_down.gif | Bin 0 -> 51 bytes sources/phpBB/adm/images/arrow_left.gif | Bin 0 -> 49 bytes sources/phpBB/adm/images/arrow_right.gif | Bin 0 -> 49 bytes sources/phpBB/adm/images/arrow_up.gif | Bin 0 -> 51 bytes sources/phpBB/adm/images/bg_button.gif | Bin 0 -> 182 bytes sources/phpBB/adm/images/bg_hash1.gif | Bin 0 -> 48 bytes sources/phpBB/adm/images/bg_hash2.gif | Bin 0 -> 48 bytes sources/phpBB/adm/images/bg_hash3.gif | Bin 0 -> 48 bytes sources/phpBB/adm/images/bg_hash4.gif | Bin 0 -> 48 bytes sources/phpBB/adm/images/bg_header.gif | Bin 0 -> 416 bytes sources/phpBB/adm/images/bg_header.jpg | Bin 0 -> 385 bytes sources/phpBB/adm/images/bg_tabs_alt1.gif | Bin 0 -> 1520 bytes sources/phpBB/adm/images/bg_tabs_alt2.gif | Bin 0 -> 420 bytes sources/phpBB/adm/images/cellpic3.gif | Bin 0 -> 826 bytes sources/phpBB/adm/images/file_conflict.gif | Bin 0 -> 344 bytes sources/phpBB/adm/images/file_modified.gif | Bin 0 -> 358 bytes sources/phpBB/adm/images/file_new.gif | Bin 0 -> 229 bytes .../phpBB/adm/images/file_new_conflict.gif | Bin 0 -> 357 bytes .../phpBB/adm/images/file_not_modified.gif | Bin 0 -> 570 bytes sources/phpBB/adm/images/file_up_to_date.gif | Bin 0 -> 357 bytes sources/phpBB/adm/images/gradient2b.gif | Bin 0 -> 192 bytes sources/phpBB/adm/images/icon_delete.gif | Bin 0 -> 255 bytes .../phpBB/adm/images/icon_delete_disabled.gif | Bin 0 -> 249 bytes sources/phpBB/adm/images/icon_down.gif | Bin 0 -> 239 bytes .../phpBB/adm/images/icon_down_disabled.gif | Bin 0 -> 166 bytes sources/phpBB/adm/images/icon_edit.gif | Bin 0 -> 242 bytes .../phpBB/adm/images/icon_edit_disabled.gif | Bin 0 -> 239 bytes sources/phpBB/adm/images/icon_folder.gif | Bin 0 -> 662 bytes sources/phpBB/adm/images/icon_folder_link.gif | Bin 0 -> 708 bytes sources/phpBB/adm/images/icon_folder_lock.gif | Bin 0 -> 681 bytes sources/phpBB/adm/images/icon_subfolder.gif | Bin 0 -> 725 bytes sources/phpBB/adm/images/icon_sync.gif | Bin 0 -> 251 bytes .../phpBB/adm/images/icon_sync_disabled.gif | Bin 0 -> 246 bytes sources/phpBB/adm/images/icon_trace.gif | Bin 0 -> 307 bytes sources/phpBB/adm/images/icon_up.gif | Bin 0 -> 240 bytes sources/phpBB/adm/images/icon_up_disabled.gif | Bin 0 -> 168 bytes sources/phpBB/adm/images/innerbox_bg.gif | Bin 0 -> 1980 bytes sources/phpBB/adm/images/loading.gif | Bin 0 -> 1320 bytes sources/phpBB/adm/images/no_avatar.gif | Bin 0 -> 930 bytes sources/phpBB/adm/images/no_image.png | Bin 0 -> 401 bytes sources/phpBB/adm/images/phpbb_logo.png | Bin 0 -> 6662 bytes sources/phpBB/adm/images/progress_bar.gif | Bin 0 -> 1353 bytes sources/phpBB/adm/images/spacer.gif | Bin 0 -> 807 bytes sources/phpBB/adm/index.php | 90 + sources/phpBB/adm/style/acp_attachments.html | 464 + .../style/acp_avatar_options_gravatar.html | 11 + .../adm/style/acp_avatar_options_local.html | 20 + .../adm/style/acp_avatar_options_remote.html | 11 + .../adm/style/acp_avatar_options_upload.html | 11 + sources/phpBB/adm/style/acp_ban.html | 131 + sources/phpBB/adm/style/acp_bbcodes.html | 126 + sources/phpBB/adm/style/acp_board.html | 52 + sources/phpBB/adm/style/acp_bots.html | 102 + sources/phpBB/adm/style/acp_captcha.html | 72 + sources/phpBB/adm/style/acp_contact.html | 76 + sources/phpBB/adm/style/acp_database.html | 98 + sources/phpBB/adm/style/acp_disallow.html | 45 + sources/phpBB/adm/style/acp_email.html | 60 + .../phpBB/adm/style/acp_ext_delete_data.html | 40 + sources/phpBB/adm/style/acp_ext_details.html | 139 + sources/phpBB/adm/style/acp_ext_disable.html | 34 + sources/phpBB/adm/style/acp_ext_enable.html | 40 + sources/phpBB/adm/style/acp_ext_list.html | 115 + sources/phpBB/adm/style/acp_forums.html | 517 + .../phpBB/adm/style/acp_forums_copy_perm.html | 22 + sources/phpBB/adm/style/acp_groups.html | 328 + .../phpBB/adm/style/acp_groups_position.html | 171 + sources/phpBB/adm/style/acp_icons.html | 276 + sources/phpBB/adm/style/acp_inactive.html | 74 + sources/phpBB/adm/style/acp_jabber.html | 65 + sources/phpBB/adm/style/acp_language.html | 112 + sources/phpBB/adm/style/acp_logs.html | 90 + sources/phpBB/adm/style/acp_main.html | 291 + sources/phpBB/adm/style/acp_modules.html | 203 + .../phpBB/adm/style/acp_permission_roles.html | 191 + sources/phpBB/adm/style/acp_permissions.html | 357 + sources/phpBB/adm/style/acp_php_info.html | 13 + .../phpBB/adm/style/acp_posting_buttons.html | 70 + sources/phpBB/adm/style/acp_profile.html | 247 + sources/phpBB/adm/style/acp_prune_forums.html | 108 + sources/phpBB/adm/style/acp_prune_users.html | 80 + sources/phpBB/adm/style/acp_ranks.html | 107 + sources/phpBB/adm/style/acp_reasons.html | 121 + sources/phpBB/adm/style/acp_search.html | 159 + .../phpBB/adm/style/acp_send_statistics.html | 64 + sources/phpBB/adm/style/acp_styles.html | 165 + sources/phpBB/adm/style/acp_update.html | 46 + sources/phpBB/adm/style/acp_users.html | 234 + sources/phpBB/adm/style/acp_users_avatar.html | 36 + .../phpBB/adm/style/acp_users_feedback.html | 75 + .../phpBB/adm/style/acp_users_overview.html | 169 + sources/phpBB/adm/style/acp_users_prefs.html | 151 + .../phpBB/adm/style/acp_users_profile.html | 34 + .../phpBB/adm/style/acp_users_signature.html | 52 + .../phpBB/adm/style/acp_users_warnings.html | 36 + sources/phpBB/adm/style/acp_words.html | 77 + sources/phpBB/adm/style/admin.css | 2485 + sources/phpBB/adm/style/admin.js | 250 + sources/phpBB/adm/style/ajax.js | 89 + .../phpBB/adm/style/auth_provider_ldap.html | 35 + .../phpBB/adm/style/auth_provider_oauth.html | 18 + .../adm/style/captcha_default_acp_demo.html | 4 + sources/phpBB/adm/style/captcha_gd_acp.html | 74 + sources/phpBB/adm/style/captcha_qa_acp.html | 90 + .../phpBB/adm/style/captcha_qa_acp_demo.html | 7 + .../phpBB/adm/style/captcha_recaptcha.html | 34 + .../adm/style/captcha_recaptcha_acp.html | 50 + sources/phpBB/adm/style/confirm_bbcode.html | 22 + sources/phpBB/adm/style/confirm_body.html | 32 + .../phpBB/adm/style/confirm_body_prune.html | 36 + sources/phpBB/adm/style/install_convert.html | 134 + sources/phpBB/adm/style/install_error.html | 8 + sources/phpBB/adm/style/install_footer.html | 21 + sources/phpBB/adm/style/install_header.html | 53 + sources/phpBB/adm/style/install_install.html | 77 + sources/phpBB/adm/style/install_main.html | 6 + sources/phpBB/adm/style/install_update.html | 491 + .../phpBB/adm/style/install_update_diff.html | 254 + sources/phpBB/adm/style/message_body.html | 8 + sources/phpBB/adm/style/overall_footer.html | 46 + sources/phpBB/adm/style/overall_header.html | 148 + sources/phpBB/adm/style/pagination.html | 12 + .../adm/style/permission_forum_copy.html | 40 + sources/phpBB/adm/style/permission_mask.html | 137 + .../adm/style/permission_roles_mask.html | 38 + sources/phpBB/adm/style/permission_trace.html | 58 + sources/phpBB/adm/style/permissions.js | 300 + .../phpBB/adm/style/profilefields/bool.html | 7 + .../phpBB/adm/style/profilefields/date.html | 5 + .../adm/style/profilefields/dropdown.html | 5 + .../phpBB/adm/style/profilefields/int.html | 3 + .../phpBB/adm/style/profilefields/string.html | 3 + .../phpBB/adm/style/profilefields/text.html | 3 + .../phpBB/adm/style/profilefields/url.html | 3 + sources/phpBB/adm/style/progress_bar.html | 40 + sources/phpBB/adm/style/simple_body.html | 8 + sources/phpBB/adm/style/simple_footer.html | 27 + sources/phpBB/adm/style/simple_header.html | 94 + sources/phpBB/adm/style/timezone.js | 13 + sources/phpBB/adm/style/timezone_option.html | 27 + sources/phpBB/adm/style/tooltip.js | 215 + sources/phpBB/app.php | 35 + sources/phpBB/assets/javascript/core.js | 1617 + sources/phpBB/assets/javascript/editor.js | 360 + sources/phpBB/assets/javascript/jquery.min.js | 4 + sources/phpBB/assets/javascript/plupload.js | 695 + .../assets/plupload/plupload.full.min.js | 28 + sources/phpBB/bin/phpbbcli.php | 67 + sources/phpBB/cache/.htaccess | 4 + sources/phpBB/cache/index.htm | 10 + sources/phpBB/common.php | 128 + sources/phpBB/composer.json | 55 + sources/phpBB/composer.lock | 2252 + sources/phpBB/config.php | 0 sources/phpBB/config/.htaccess | 4 + sources/phpBB/config/auth.yml | 100 + sources/phpBB/config/avatar.yml | 67 + sources/phpBB/config/captcha.yml | 59 + sources/phpBB/config/console.yml | 141 + sources/phpBB/config/content.yml | 72 + sources/phpBB/config/cron.yml | 147 + sources/phpBB/config/db.yml | 78 + sources/phpBB/config/event.yml | 34 + sources/phpBB/config/feed.yml | 106 + sources/phpBB/config/mimetype_guesser.yml | 36 + sources/phpBB/config/notification.yml | 390 + sources/phpBB/config/parameters.yml | 20 + sources/phpBB/config/password.yml | 124 + sources/phpBB/config/profilefield.yml | 102 + sources/phpBB/config/routing.yml | 9 + sources/phpBB/config/services.yml | 188 + sources/phpBB/config/tables.yml | 23 + sources/phpBB/config/user.yml | 19 + sources/phpBB/cron.php | 70 + sources/phpBB/docs/CHANGELOG.html | 4749 ++ sources/phpBB/docs/CREDITS.txt | 99 + sources/phpBB/docs/FAQ.html | 345 + sources/phpBB/docs/INSTALL.html | 508 + sources/phpBB/docs/LICENSE.txt | 281 + sources/phpBB/docs/README.html | 369 + sources/phpBB/docs/auth_api.html | 292 + sources/phpBB/docs/bg_header.gif | Bin 0 -> 690 bytes sources/phpBB/docs/coding-guidelines.html | 2574 + sources/phpBB/docs/corners_left.gif | Bin 0 -> 55 bytes sources/phpBB/docs/corners_left.png | Bin 0 -> 195 bytes sources/phpBB/docs/corners_right.gif | Bin 0 -> 56 bytes sources/phpBB/docs/corners_right.png | Bin 0 -> 201 bytes sources/phpBB/docs/events.md | 1586 + sources/phpBB/docs/lighttpd.sample.conf | 70 + sources/phpBB/docs/nginx.sample.conf | 97 + sources/phpBB/docs/site_logo.gif | Bin 0 -> 3430 bytes sources/phpBB/docs/sphinx.sample.conf | 100 + sources/phpBB/docs/stylesheet.css | 352 + sources/phpBB/download/file.php | 289 + sources/phpBB/download/index.htm | 10 + sources/phpBB/ext/index.htm | 10 + sources/phpBB/faq.php | 91 + sources/phpBB/feed.php | 242 + sources/phpBB/files/.htaccess | 4 + sources/phpBB/files/index.htm | 10 + .../phpBB/images/avatars/gallery/index.htm | 10 + sources/phpBB/images/avatars/index.htm | 10 + sources/phpBB/images/avatars/upload/.htaccess | 4 + sources/phpBB/images/avatars/upload/index.htm | 10 + sources/phpBB/images/icons/index.htm | 10 + sources/phpBB/images/icons/misc/fire.gif | Bin 0 -> 278 bytes sources/phpBB/images/icons/misc/heart.gif | Bin 0 -> 284 bytes sources/phpBB/images/icons/misc/index.htm | 10 + .../phpBB/images/icons/misc/radioactive.gif | Bin 0 -> 300 bytes sources/phpBB/images/icons/misc/star.gif | Bin 0 -> 267 bytes sources/phpBB/images/icons/misc/thinking.gif | Bin 0 -> 284 bytes sources/phpBB/images/icons/smile/alert.gif | Bin 0 -> 271 bytes sources/phpBB/images/icons/smile/index.htm | 10 + sources/phpBB/images/icons/smile/info.gif | Bin 0 -> 294 bytes sources/phpBB/images/icons/smile/mrgreen.gif | Bin 0 -> 297 bytes sources/phpBB/images/icons/smile/question.gif | Bin 0 -> 296 bytes sources/phpBB/images/icons/smile/redface.gif | Bin 0 -> 2463 bytes sources/phpBB/images/index.htm | 10 + sources/phpBB/images/ranks/index.htm | 10 + sources/phpBB/images/smilies/icon_arrow.gif | Bin 0 -> 407 bytes sources/phpBB/images/smilies/icon_cool.gif | Bin 0 -> 408 bytes sources/phpBB/images/smilies/icon_cry.gif | Bin 0 -> 1664 bytes .../phpBB/images/smilies/icon_e_biggrin.gif | Bin 0 -> 627 bytes .../phpBB/images/smilies/icon_e_confused.gif | Bin 0 -> 628 bytes sources/phpBB/images/smilies/icon_e_geek.gif | Bin 0 -> 623 bytes sources/phpBB/images/smilies/icon_e_sad.gif | Bin 0 -> 628 bytes sources/phpBB/images/smilies/icon_e_smile.gif | Bin 0 -> 630 bytes .../phpBB/images/smilies/icon_e_surprised.gif | Bin 0 -> 415 bytes sources/phpBB/images/smilies/icon_e_ugeek.gif | Bin 0 -> 631 bytes sources/phpBB/images/smilies/icon_e_wink.gif | Bin 0 -> 630 bytes sources/phpBB/images/smilies/icon_eek.gif | Bin 0 -> 619 bytes sources/phpBB/images/smilies/icon_evil.gif | Bin 0 -> 648 bytes sources/phpBB/images/smilies/icon_exclaim.gif | Bin 0 -> 632 bytes sources/phpBB/images/smilies/icon_idea.gif | Bin 0 -> 411 bytes sources/phpBB/images/smilies/icon_lol.gif | Bin 0 -> 707 bytes sources/phpBB/images/smilies/icon_mad.gif | Bin 0 -> 646 bytes sources/phpBB/images/smilies/icon_mrgreen.gif | Bin 0 -> 608 bytes sources/phpBB/images/smilies/icon_neutral.gif | Bin 0 -> 621 bytes .../phpBB/images/smilies/icon_question.gif | Bin 0 -> 643 bytes sources/phpBB/images/smilies/icon_razz.gif | Bin 0 -> 645 bytes sources/phpBB/images/smilies/icon_redface.gif | Bin 0 -> 2990 bytes .../phpBB/images/smilies/icon_rolleyes.gif | Bin 0 -> 1153 bytes sources/phpBB/images/smilies/icon_twisted.gif | Bin 0 -> 636 bytes sources/phpBB/images/spacer.gif | Bin 0 -> 807 bytes sources/phpBB/images/upload_icons/avi.gif | Bin 0 -> 271 bytes sources/phpBB/images/upload_icons/bmp.gif | Bin 0 -> 279 bytes sources/phpBB/images/upload_icons/doc.gif | Bin 0 -> 940 bytes sources/phpBB/images/upload_icons/exe.gif | Bin 0 -> 1096 bytes sources/phpBB/images/upload_icons/flash.gif | Bin 0 -> 254 bytes sources/phpBB/images/upload_icons/gif.gif | Bin 0 -> 189 bytes sources/phpBB/images/upload_icons/html.gif | Bin 0 -> 183 bytes sources/phpBB/images/upload_icons/jpg.gif | Bin 0 -> 188 bytes sources/phpBB/images/upload_icons/mid.gif | Bin 0 -> 141 bytes sources/phpBB/images/upload_icons/mov.gif | Bin 0 -> 271 bytes sources/phpBB/images/upload_icons/mp3.gif | Bin 0 -> 253 bytes sources/phpBB/images/upload_icons/mpg.gif | Bin 0 -> 271 bytes .../phpBB/images/upload_icons/netscape.gif | Bin 0 -> 214 bytes sources/phpBB/images/upload_icons/pdf.gif | Bin 0 -> 370 bytes sources/phpBB/images/upload_icons/ppt.gif | Bin 0 -> 867 bytes sources/phpBB/images/upload_icons/rar.gif | Bin 0 -> 976 bytes sources/phpBB/images/upload_icons/txt.gif | Bin 0 -> 138 bytes sources/phpBB/images/upload_icons/wav.gif | Bin 0 -> 162 bytes sources/phpBB/images/upload_icons/xls.gif | Bin 0 -> 941 bytes sources/phpBB/images/upload_icons/zip.gif | Bin 0 -> 155 bytes sources/phpBB/includes/.htaccess | 4 + .../phpBB/includes/acp/acp_attachments.php | 1749 + sources/phpBB/includes/acp/acp_ban.php | 298 + sources/phpBB/includes/acp/acp_bbcodes.php | 569 + sources/phpBB/includes/acp/acp_board.php | 1121 + sources/phpBB/includes/acp/acp_bots.php | 423 + sources/phpBB/includes/acp/acp_captcha.php | 148 + sources/phpBB/includes/acp/acp_contact.php | 134 + sources/phpBB/includes/acp/acp_database.php | 2268 + sources/phpBB/includes/acp/acp_disallow.php | 118 + sources/phpBB/includes/acp/acp_email.php | 330 + sources/phpBB/includes/acp/acp_extensions.php | 555 + sources/phpBB/includes/acp/acp_forums.php | 2119 + sources/phpBB/includes/acp/acp_groups.php | 1189 + sources/phpBB/includes/acp/acp_icons.php | 963 + sources/phpBB/includes/acp/acp_inactive.php | 307 + sources/phpBB/includes/acp/acp_jabber.php | 132 + sources/phpBB/includes/acp/acp_language.php | 458 + sources/phpBB/includes/acp/acp_logs.php | 174 + sources/phpBB/includes/acp/acp_main.php | 672 + sources/phpBB/includes/acp/acp_modules.php | 1089 + .../includes/acp/acp_permission_roles.php | 582 + .../phpBB/includes/acp/acp_permissions.php | 1319 + sources/phpBB/includes/acp/acp_php_info.php | 90 + sources/phpBB/includes/acp/acp_profile.php | 1139 + sources/phpBB/includes/acp/acp_prune.php | 557 + sources/phpBB/includes/acp/acp_ranks.php | 285 + sources/phpBB/includes/acp/acp_reasons.php | 392 + sources/phpBB/includes/acp/acp_search.php | 615 + .../includes/acp/acp_send_statistics.php | 88 + sources/phpBB/includes/acp/acp_styles.php | 1334 + sources/phpBB/includes/acp/acp_update.php | 66 + sources/phpBB/includes/acp/acp_users.php | 2494 + sources/phpBB/includes/acp/acp_words.php | 189 + sources/phpBB/includes/acp/auth.php | 1284 + .../includes/acp/info/acp_attachments.php | 39 + sources/phpBB/includes/acp/info/acp_ban.php | 37 + .../phpBB/includes/acp/info/acp_bbcodes.php | 35 + sources/phpBB/includes/acp/info/acp_board.php | 50 + sources/phpBB/includes/acp/info/acp_bots.php | 35 + .../phpBB/includes/acp/info/acp_captcha.php | 36 + .../phpBB/includes/acp/info/acp_contact.php | 30 + .../phpBB/includes/acp/info/acp_database.php | 36 + .../phpBB/includes/acp/info/acp_disallow.php | 35 + sources/phpBB/includes/acp/info/acp_email.php | 35 + .../includes/acp/info/acp_extensions.php | 35 + .../phpBB/includes/acp/info/acp_forums.php | 35 + .../phpBB/includes/acp/info/acp_groups.php | 36 + sources/phpBB/includes/acp/info/acp_icons.php | 36 + .../phpBB/includes/acp/info/acp_inactive.php | 35 + .../phpBB/includes/acp/info/acp_jabber.php | 35 + .../phpBB/includes/acp/info/acp_language.php | 35 + sources/phpBB/includes/acp/info/acp_logs.php | 38 + sources/phpBB/includes/acp/info/acp_main.php | 35 + .../phpBB/includes/acp/info/acp_modules.php | 37 + .../acp/info/acp_permission_roles.php | 38 + .../includes/acp/info/acp_permissions.php | 52 + .../phpBB/includes/acp/info/acp_php_info.php | 35 + .../phpBB/includes/acp/info/acp_profile.php | 35 + sources/phpBB/includes/acp/info/acp_prune.php | 36 + sources/phpBB/includes/acp/info/acp_ranks.php | 35 + .../phpBB/includes/acp/info/acp_reasons.php | 35 + .../phpBB/includes/acp/info/acp_search.php | 36 + .../includes/acp/info/acp_send_statistics.php | 35 + .../phpBB/includes/acp/info/acp_styles.php | 36 + .../phpBB/includes/acp/info/acp_update.php | 35 + sources/phpBB/includes/acp/info/acp_users.php | 45 + sources/phpBB/includes/acp/info/acp_words.php | 35 + sources/phpBB/includes/bbcode.php | 616 + .../phpBB/includes/compatibility_globals.php | 47 + sources/phpBB/includes/constants.php | 297 + sources/phpBB/includes/diff/diff.php | 1152 + sources/phpBB/includes/diff/engine.php | 555 + sources/phpBB/includes/diff/renderer.php | 861 + sources/phpBB/includes/functions.php | 5464 ++ sources/phpBB/includes/functions_acp.php | 702 + sources/phpBB/includes/functions_admin.php | 3144 ++ .../includes/functions_compatibility.php | 197 + sources/phpBB/includes/functions_compress.php | 774 + sources/phpBB/includes/functions_content.php | 1621 + sources/phpBB/includes/functions_convert.php | 2513 + .../includes/functions_database_helper.php | 210 + sources/phpBB/includes/functions_display.php | 1651 + sources/phpBB/includes/functions_download.php | 739 + sources/phpBB/includes/functions_install.php | 545 + sources/phpBB/includes/functions_jabber.php | 872 + sources/phpBB/includes/functions_mcp.php | 675 + .../phpBB/includes/functions_messenger.php | 1731 + sources/phpBB/includes/functions_module.php | 1145 + sources/phpBB/includes/functions_posting.php | 2671 + sources/phpBB/includes/functions_privmsgs.php | 2238 + sources/phpBB/includes/functions_transfer.php | 902 + sources/phpBB/includes/functions_upload.php | 1107 + .../phpBB/includes/functions_url_matcher.php | 112 + sources/phpBB/includes/functions_user.php | 3616 ++ sources/phpBB/includes/hooks/index.php | 250 + sources/phpBB/includes/index.htm | 10 + sources/phpBB/includes/mcp/info/mcp_ban.php | 37 + sources/phpBB/includes/mcp/info/mcp_logs.php | 37 + sources/phpBB/includes/mcp/info/mcp_main.php | 38 + sources/phpBB/includes/mcp/info/mcp_notes.php | 36 + .../includes/mcp/info/mcp_pm_reports.php | 37 + sources/phpBB/includes/mcp/info/mcp_queue.php | 39 + .../phpBB/includes/mcp/info/mcp_reports.php | 37 + sources/phpBB/includes/mcp/info/mcp_warn.php | 38 + sources/phpBB/includes/mcp/mcp_ban.php | 295 + sources/phpBB/includes/mcp/mcp_forum.php | 498 + sources/phpBB/includes/mcp/mcp_front.php | 360 + sources/phpBB/includes/mcp/mcp_logs.php | 227 + sources/phpBB/includes/mcp/mcp_main.php | 1515 + sources/phpBB/includes/mcp/mcp_notes.php | 249 + sources/phpBB/includes/mcp/mcp_pm_reports.php | 324 + sources/phpBB/includes/mcp/mcp_post.php | 523 + sources/phpBB/includes/mcp/mcp_queue.php | 1343 + sources/phpBB/includes/mcp/mcp_reports.php | 741 + sources/phpBB/includes/mcp/mcp_topic.php | 695 + sources/phpBB/includes/mcp/mcp_warn.php | 586 + sources/phpBB/includes/message_parser.php | 1865 + .../includes/questionnaire/questionnaire.php | 503 + sources/phpBB/includes/sphinxapi.php | 1712 + sources/phpBB/includes/startup.php | 172 + .../includes/ucp/info/ucp_attachments.php | 35 + .../phpBB/includes/ucp/info/ucp_auth_link.php | 35 + .../phpBB/includes/ucp/info/ucp_groups.php | 36 + sources/phpBB/includes/ucp/info/ucp_main.php | 38 + .../includes/ucp/info/ucp_notifications.php | 36 + sources/phpBB/includes/ucp/info/ucp_pm.php | 38 + sources/phpBB/includes/ucp/info/ucp_prefs.php | 37 + .../phpBB/includes/ucp/info/ucp_profile.php | 39 + sources/phpBB/includes/ucp/info/ucp_zebra.php | 36 + sources/phpBB/includes/ucp/ucp_activate.php | 149 + .../phpBB/includes/ucp/ucp_attachments.php | 207 + sources/phpBB/includes/ucp/ucp_auth_link.php | 147 + sources/phpBB/includes/ucp/ucp_confirm.php | 48 + sources/phpBB/includes/ucp/ucp_groups.php | 1097 + sources/phpBB/includes/ucp/ucp_login_link.php | 246 + sources/phpBB/includes/ucp/ucp_main.php | 846 + .../phpBB/includes/ucp/ucp_notifications.php | 239 + sources/phpBB/includes/ucp/ucp_pm.php | 411 + sources/phpBB/includes/ucp/ucp_pm_compose.php | 1433 + sources/phpBB/includes/ucp/ucp_pm_options.php | 871 + .../phpBB/includes/ucp/ucp_pm_viewfolder.php | 557 + .../phpBB/includes/ucp/ucp_pm_viewmessage.php | 423 + sources/phpBB/includes/ucp/ucp_prefs.php | 492 + sources/phpBB/includes/ucp/ucp_profile.php | 713 + sources/phpBB/includes/ucp/ucp_register.php | 535 + sources/phpBB/includes/ucp/ucp_remind.php | 135 + sources/phpBB/includes/ucp/ucp_resend.php | 163 + sources/phpBB/includes/ucp/ucp_zebra.php | 296 + .../phpBB/includes/utf/data/case_fold_c.php | 1 + .../phpBB/includes/utf/data/case_fold_f.php | 1 + .../phpBB/includes/utf/data/case_fold_s.php | 1 + .../phpBB/includes/utf/data/confusables.php | 1 + .../phpBB/includes/utf/data/recode_basic.php | 1541 + .../phpBB/includes/utf/data/recode_cjk.php | 45177 ++++++++++++++++ .../includes/utf/data/search_indexer_0.php | 1 + .../includes/utf/data/search_indexer_1.php | 1 + .../includes/utf/data/search_indexer_19.php | 1 + .../includes/utf/data/search_indexer_2.php | 1 + .../includes/utf/data/search_indexer_20.php | 1 + .../includes/utf/data/search_indexer_21.php | 1 + .../includes/utf/data/search_indexer_26.php | 1 + .../includes/utf/data/search_indexer_3.php | 1 + .../includes/utf/data/search_indexer_31.php | 1 + .../includes/utf/data/search_indexer_32.php | 1 + .../includes/utf/data/search_indexer_33.php | 1 + .../includes/utf/data/search_indexer_36.php | 1 + .../includes/utf/data/search_indexer_4.php | 1 + .../includes/utf/data/search_indexer_448.php | 1 + .../includes/utf/data/search_indexer_5.php | 1 + .../includes/utf/data/search_indexer_58.php | 1 + .../includes/utf/data/search_indexer_6.php | 1 + .../includes/utf/data/search_indexer_64.php | 1 + .../includes/utf/data/search_indexer_84.php | 1 + .../includes/utf/data/search_indexer_9.php | 1 + .../includes/utf/data/search_indexer_95.php | 1 + .../includes/utf/data/utf_canonical_comp.php | 2 + .../utf/data/utf_canonical_decomp.php | 2 + .../utf/data/utf_compatibility_decomp.php | 2 + .../phpBB/includes/utf/data/utf_nfc_qc.php | 2 + .../phpBB/includes/utf/data/utf_nfkc_qc.php | 2 + .../utf/data/utf_normalizer_common.php | 4 + sources/phpBB/includes/utf/utf_normalizer.php | 1509 + sources/phpBB/includes/utf/utf_tools.php | 2008 + sources/phpBB/index.php | 207 + .../install/convertors/convert_phpbb20.php | 975 + .../install/convertors/functions_phpbb20.php | 1981 + sources/phpBB/install/database_update.php | 252 + sources/phpBB/install/index.php | 833 + sources/phpBB/install/install_convert.php | 2150 + sources/phpBB/install/install_install.php | 2333 + sources/phpBB/install/install_main.php | 78 + sources/phpBB/install/phpinfo.php | 14 + sources/phpBB/install/schemas/index.htm | 10 + .../phpBB/install/schemas/oracle_schema.sql | 37 + .../phpBB/install/schemas/postgres_schema.sql | 80 + sources/phpBB/install/schemas/schema_data.sql | 821 + sources/phpBB/language/en/acp/attachments.php | 179 + sources/phpBB/language/en/acp/ban.php | 84 + sources/phpBB/language/en/acp/board.php | 600 + sources/phpBB/language/en/acp/bots.php | 72 + sources/phpBB/language/en/acp/common.php | 796 + sources/phpBB/language/en/acp/database.php | 76 + sources/phpBB/language/en/acp/email.php | 68 + sources/phpBB/language/en/acp/extensions.php | 124 + sources/phpBB/language/en/acp/forums.php | 165 + sources/phpBB/language/en/acp/groups.php | 155 + sources/phpBB/language/en/acp/index.htm | 10 + sources/phpBB/language/en/acp/language.php | 76 + sources/phpBB/language/en/acp/modules.php | 83 + sources/phpBB/language/en/acp/permissions.php | 287 + .../language/en/acp/permissions_phpbb.php | 211 + sources/phpBB/language/en/acp/posting.php | 291 + sources/phpBB/language/en/acp/profile.php | 176 + sources/phpBB/language/en/acp/prune.php | 95 + sources/phpBB/language/en/acp/search.php | 138 + sources/phpBB/language/en/acp/styles.php | 86 + sources/phpBB/language/en/acp/users.php | 143 + sources/phpBB/language/en/app.php | 48 + sources/phpBB/language/en/captcha_qa.php | 64 + .../phpBB/language/en/captcha_recaptcha.php | 52 + sources/phpBB/language/en/cli.php | 81 + sources/phpBB/language/en/common.php | 1415 + .../language/en/email/admin_activate.txt | 13 + .../language/en/email/admin_send_email.txt | 13 + .../en/email/admin_welcome_activated.txt | 9 + .../en/email/admin_welcome_inactive.txt | 19 + sources/phpBB/language/en/email/bookmark.txt | 20 + .../phpBB/language/en/email/contact_admin.txt | 23 + .../en/email/coppa_resend_inactive.txt | 42 + .../en/email/coppa_welcome_inactive.txt | 42 + .../phpBB/language/en/email/email_notify.txt | 17 + .../phpBB/language/en/email/forum_notify.txt | 19 + .../phpBB/language/en/email/group_added.txt | 11 + .../phpBB/language/en/email/group_request.txt | 10 + sources/phpBB/language/en/email/index.htm | 10 + sources/phpBB/language/en/email/installed.txt | 19 + .../language/en/email/newtopic_notify.txt | 13 + .../language/en/email/pm_report_closed.txt | 7 + .../language/en/email/pm_report_deleted.txt | 7 + .../phpBB/language/en/email/post_approved.txt | 13 + .../language/en/email/post_disapproved.txt | 11 + .../phpBB/language/en/email/post_in_queue.txt | 13 + .../language/en/email/privmsg_notify.txt | 15 + .../language/en/email/profile_send_email.txt | 13 + .../language/en/email/profile_send_im.txt | 13 + sources/phpBB/language/en/email/quote.txt | 20 + .../phpBB/language/en/email/report_closed.txt | 7 + .../language/en/email/report_deleted.txt | 7 + sources/phpBB/language/en/email/report_pm.txt | 10 + .../phpBB/language/en/email/report_post.txt | 13 + .../language/en/email/short/bookmark.txt | 20 + .../en/email/short/newtopic_notify.txt | 13 + .../language/en/email/short/post_approved.txt | 13 + .../en/email/short/post_disapproved.txt | 11 + .../language/en/email/short/post_in_queue.txt | 13 + .../en/email/short/privmsg_notify.txt | 15 + .../phpBB/language/en/email/short/quote.txt | 20 + .../language/en/email/short/report_pm.txt | 10 + .../language/en/email/short/report_post.txt | 13 + .../en/email/short/topic_approved.txt | 10 + .../en/email/short/topic_disapproved.txt | 11 + .../en/email/short/topic_in_queue.txt | 13 + .../language/en/email/short/topic_notify.txt | 20 + .../language/en/email/topic_approved.txt | 10 + .../language/en/email/topic_disapproved.txt | 11 + .../language/en/email/topic_in_queue.txt | 13 + .../phpBB/language/en/email/topic_notify.txt | 19 + .../phpBB/language/en/email/user_activate.txt | 9 + .../en/email/user_activate_inactive.txt | 7 + .../en/email/user_activate_passwd.txt | 17 + .../en/email/user_reactivate_account.txt | 18 + .../en/email/user_remind_inactive.txt | 11 + .../en/email/user_resend_inactive.txt | 19 + .../phpBB/language/en/email/user_welcome.txt | 17 + .../en/email/user_welcome_inactive.txt | 21 + sources/phpBB/language/en/groups.php | 95 + sources/phpBB/language/en/help_bbcode.php | 115 + sources/phpBB/language/en/help_faq.php | 355 + sources/phpBB/language/en/index.htm | 10 + sources/phpBB/language/en/install.php | 632 + sources/phpBB/language/en/iso.txt | 3 + sources/phpBB/language/en/mcp.php | 433 + sources/phpBB/language/en/memberlist.php | 153 + sources/phpBB/language/en/migrator.php | 62 + sources/phpBB/language/en/plupload.php | 79 + sources/phpBB/language/en/posting.php | 278 + sources/phpBB/language/en/search.php | 124 + .../phpBB/language/en/search_ignore_words.php | 271 + sources/phpBB/language/en/search_synonyms.php | 191 + sources/phpBB/language/en/ucp.php | 657 + sources/phpBB/language/en/viewforum.php | 72 + sources/phpBB/language/en/viewtopic.php | 126 + sources/phpBB/language/index.htm | 10 + sources/phpBB/mcp.php | 324 + sources/phpBB/memberlist.php | 1532 + sources/phpBB/phpbb/auth/auth.php | 1092 + sources/phpBB/phpbb/auth/index.htm | 10 + sources/phpBB/phpbb/auth/provider/apache.php | 264 + sources/phpBB/phpbb/auth/provider/base.php | 108 + sources/phpBB/phpbb/auth/provider/db.php | 239 + sources/phpBB/phpbb/auth/provider/index.htm | 10 + sources/phpBB/phpbb/auth/provider/ldap.php | 349 + .../phpBB/phpbb/auth/provider/oauth/oauth.php | 630 + .../auth/provider/oauth/service/base.php | 51 + .../auth/provider/oauth/service/bitly.php | 94 + .../auth/provider/oauth/service/exception.php | 21 + .../auth/provider/oauth/service/facebook.php | 94 + .../auth/provider/oauth/service/google.php | 105 + .../oauth/service/service_interface.php | 73 + .../auth/provider/oauth/token_storage.php | 363 + .../auth/provider/provider_interface.php | 193 + .../phpBB/phpbb/auth/provider_collection.php | 67 + sources/phpBB/phpbb/avatar/driver/driver.php | 131 + .../phpbb/avatar/driver/driver_interface.php | 113 + .../phpBB/phpbb/avatar/driver/gravatar.php | 185 + sources/phpBB/phpbb/avatar/driver/local.php | 201 + sources/phpBB/phpbb/avatar/driver/remote.php | 221 + sources/phpBB/phpbb/avatar/driver/upload.php | 214 + sources/phpBB/phpbb/avatar/manager.php | 366 + sources/phpBB/phpbb/cache/driver/apc.php | 70 + sources/phpBB/phpbb/cache/driver/base.php | 231 + .../phpbb/cache/driver/driver_interface.php | 167 + .../phpBB/phpbb/cache/driver/eaccelerator.php | 105 + sources/phpBB/phpbb/cache/driver/file.php | 587 + sources/phpBB/phpbb/cache/driver/memcache.php | 122 + sources/phpBB/phpbb/cache/driver/memory.php | 281 + sources/phpBB/phpbb/cache/driver/null.php | 151 + sources/phpBB/phpbb/cache/driver/redis.php | 158 + sources/phpBB/phpbb/cache/driver/wincache.php | 73 + sources/phpBB/phpbb/cache/driver/xcache.php | 107 + sources/phpBB/phpbb/cache/service.php | 390 + sources/phpBB/phpbb/captcha/char_cube3d.php | 277 + .../phpBB/phpbb/captcha/colour_manager.php | 527 + sources/phpBB/phpbb/captcha/factory.php | 88 + sources/phpBB/phpbb/captcha/gd.php | 1847 + sources/phpBB/phpbb/captcha/gd_wave.php | 845 + sources/phpBB/phpbb/captcha/non_gd.php | 386 + .../captcha/plugins/captcha_abstract.php | 390 + sources/phpBB/phpbb/captcha/plugins/gd.php | 130 + .../phpBB/phpbb/captcha/plugins/gd_wave.php | 42 + sources/phpBB/phpbb/captcha/plugins/nogd.php | 42 + sources/phpBB/phpbb/captcha/plugins/qa.php | 1009 + .../phpBB/phpbb/captcha/plugins/recaptcha.php | 332 + sources/phpBB/phpbb/class_loader.php | 164 + sources/phpBB/phpbb/composer.json | 27 + sources/phpBB/phpbb/config/config.php | 167 + sources/phpBB/phpbb/config/db.php | 204 + sources/phpBB/phpbb/config/db_text.php | 159 + sources/phpBB/phpbb/config_php_file.php | 160 + sources/phpBB/phpbb/console/application.php | 120 + .../phpbb/console/command/cache/purge.php | 89 + .../phpBB/phpbb/console/command/command.php | 31 + .../phpbb/console/command/config/command.php | 26 + .../phpbb/console/command/config/delete.php | 63 + .../phpbb/console/command/config/get.php | 72 + .../console/command/config/increment.php | 70 + .../phpbb/console/command/config/set.php | 70 + .../console/command/config/set_atomic.php | 84 + .../phpbb/console/command/cron/cron_list.php | 111 + .../phpBB/phpbb/console/command/cron/run.php | 171 + .../db/console_migrator_output_handler.php | 69 + .../phpbb/console/command/db/migrate.php | 107 + .../console/command/dev/migration_tips.php | 64 + .../console/command/extension/command.php | 30 + .../console/command/extension/disable.php | 52 + .../console/command/extension/enable.php | 52 + .../phpbb/console/command/extension/purge.php | 52 + .../phpbb/console/command/extension/show.php | 62 + .../command/fixup/recalculate_email_hash.php | 75 + sources/phpBB/phpbb/content_visibility.php | 718 + sources/phpBB/phpbb/controller/exception.php | 21 + sources/phpBB/phpbb/controller/helper.php | 226 + sources/phpBB/phpbb/controller/provider.php | 92 + sources/phpBB/phpbb/controller/resolver.php | 175 + sources/phpBB/phpbb/cron/manager.php | 147 + sources/phpBB/phpbb/cron/task/base.php | 72 + .../phpbb/cron/task/core/prune_all_forums.php | 89 + .../phpbb/cron/task/core/prune_forum.php | 159 + .../cron/task/core/prune_notifications.php | 61 + .../cron/task/core/prune_shadow_topics.php | 200 + sources/phpBB/phpbb/cron/task/core/queue.php | 78 + .../phpBB/phpbb/cron/task/core/tidy_cache.php | 72 + .../phpbb/cron/task/core/tidy_database.php | 66 + .../phpbb/cron/task/core/tidy_plupload.php | 118 + .../phpbb/cron/task/core/tidy_search.php | 96 + .../phpbb/cron/task/core/tidy_sessions.php | 59 + .../phpbb/cron/task/core/tidy_warnings.php | 80 + .../phpBB/phpbb/cron/task/parametrized.php | 48 + sources/phpBB/phpbb/cron/task/task.php | 52 + sources/phpBB/phpbb/cron/task/wrapper.php | 106 + sources/phpBB/phpbb/datetime.php | 168 + sources/phpBB/phpbb/db/driver/driver.php | 1077 + .../phpbb/db/driver/driver_interface.php | 453 + sources/phpBB/phpbb/db/driver/factory.php | 443 + sources/phpBB/phpbb/db/driver/mssql.php | 476 + sources/phpBB/phpbb/db/driver/mssql_base.php | 71 + sources/phpBB/phpbb/db/driver/mssql_odbc.php | 377 + sources/phpBB/phpbb/db/driver/mssqlnative.php | 442 + sources/phpBB/phpbb/db/driver/mysql.php | 485 + sources/phpBB/phpbb/db/driver/mysql_base.php | 138 + sources/phpBB/phpbb/db/driver/mysqli.php | 476 + sources/phpBB/phpbb/db/driver/oracle.php | 807 + sources/phpBB/phpbb/db/driver/postgres.php | 490 + sources/phpBB/phpbb/db/driver/sqlite.php | 378 + sources/phpBB/phpbb/db/driver/sqlite3.php | 404 + .../phpbb/db/html_migrator_output_handler.php | 48 + .../log_wrapper_migrator_output_handler.php | 95 + .../migration/container_aware_migration.php | 36 + .../migration/data/v30x/local_url_bbcode.php | 70 + .../db/migration/data/v30x/release_3_0_0.php | 1181 + .../db/migration/data/v30x/release_3_0_1.php | 34 + .../db/migration/data/v30x/release_3_0_10.php | 34 + .../data/v30x/release_3_0_10_rc1.php | 36 + .../data/v30x/release_3_0_10_rc2.php | 34 + .../data/v30x/release_3_0_10_rc3.php | 34 + .../db/migration/data/v30x/release_3_0_11.php | 34 + .../data/v30x/release_3_0_11_rc1.php | 101 + .../data/v30x/release_3_0_11_rc2.php | 56 + .../db/migration/data/v30x/release_3_0_12.php | 37 + .../data/v30x/release_3_0_12_rc1.php | 72 + .../data/v30x/release_3_0_12_rc2.php | 37 + .../data/v30x/release_3_0_12_rc3.php | 37 + .../db/migration/data/v30x/release_3_0_13.php | 37 + .../data/v30x/release_3_0_13_pl1.php | 37 + .../data/v30x/release_3_0_13_rc1.php | 37 + .../migration/data/v30x/release_3_0_1_rc1.php | 119 + .../db/migration/data/v30x/release_3_0_2.php | 34 + .../migration/data/v30x/release_3_0_2_rc1.php | 38 + .../migration/data/v30x/release_3_0_2_rc2.php | 86 + .../db/migration/data/v30x/release_3_0_3.php | 34 + .../migration/data/v30x/release_3_0_3_rc1.php | 89 + .../db/migration/data/v30x/release_3_0_4.php | 55 + .../migration/data/v30x/release_3_0_4_rc1.php | 129 + .../db/migration/data/v30x/release_3_0_5.php | 34 + .../migration/data/v30x/release_3_0_5_rc1.php | 133 + .../data/v30x/release_3_0_5_rc1part2.php | 48 + .../db/migration/data/v30x/release_3_0_6.php | 34 + .../migration/data/v30x/release_3_0_6_rc1.php | 330 + .../migration/data/v30x/release_3_0_6_rc2.php | 34 + .../migration/data/v30x/release_3_0_6_rc3.php | 46 + .../migration/data/v30x/release_3_0_6_rc4.php | 34 + .../db/migration/data/v30x/release_3_0_7.php | 34 + .../migration/data/v30x/release_3_0_7_pl1.php | 34 + .../migration/data/v30x/release_3_0_7_rc1.php | 82 + .../migration/data/v30x/release_3_0_7_rc2.php | 79 + .../db/migration/data/v30x/release_3_0_8.php | 34 + .../migration/data/v30x/release_3_0_8_rc1.php | 162 + .../db/migration/data/v30x/release_3_0_9.php | 34 + .../migration/data/v30x/release_3_0_9_rc1.php | 130 + .../migration/data/v30x/release_3_0_9_rc2.php | 34 + .../migration/data/v30x/release_3_0_9_rc3.php | 34 + .../migration/data/v30x/release_3_0_9_rc4.php | 34 + .../data/v310/acp_prune_users_module.php | 81 + .../data/v310/acp_style_components_module.php | 46 + .../db/migration/data/v310/allow_cdn.php | 37 + .../phpbb/db/migration/data/v310/alpha1.php | 48 + .../phpbb/db/migration/data/v310/alpha2.php | 32 + .../phpbb/db/migration/data/v310/alpha3.php | 34 + .../data/v310/auth_provider_oauth.php | 77 + .../data/v310/auth_provider_oauth2.php | 44 + .../db/migration/data/v310/avatar_types.php | 64 + .../phpbb/db/migration/data/v310/avatars.php | 73 + .../phpbb/db/migration/data/v310/beta1.php | 37 + .../phpbb/db/migration/data/v310/beta2.php | 33 + .../phpbb/db/migration/data/v310/beta3.php | 36 + .../phpbb/db/migration/data/v310/beta4.php | 33 + .../data/v310/board_contact_name.php | 34 + .../db/migration/data/v310/boardindex.php | 29 + .../db/migration/data/v310/bot_update.php | 150 + .../migration/data/v310/captcha_plugins.php | 48 + .../db/migration/data/v310/config_db_text.php | 51 + .../data/v310/contact_admin_acp_module.php | 31 + .../data/v310/contact_admin_form.php | 46 + .../phpbb/db/migration/data/v310/dev.php | 415 + .../db/migration/data/v310/extensions.php | 75 + ...xtensions_version_check_force_unstable.php | 29 + .../migration/data/v310/forgot_password.php | 34 + .../phpbb/db/migration/data/v310/gold.php | 32 + .../db/migration/data/v310/jquery_update.php | 37 + .../db/migration/data/v310/jquery_update2.php | 37 + .../data/v310/live_searches_config.php | 29 + .../migration/data/v310/migrations_table.php | 51 + .../db/migration/data/v310/mod_rewrite.php | 31 + .../data/v310/mysql_fulltext_drop.php | 80 + .../db/migration/data/v310/namespaces.php | 34 + .../v310/notification_options_reconvert.php | 141 + .../db/migration/data/v310/notifications.php | 102 + .../data/v310/notifications_cron.php | 31 + .../data/v310/notifications_cron_p2.php | 31 + .../data/v310/notifications_schema_fix.php | 98 + .../data/v310/notifications_use_full_name.php | 184 + .../db/migration/data/v310/passwords.php | 50 + .../data/v310/passwords_convert_p1.php | 84 + .../data/v310/passwords_convert_p2.php | 49 + .../db/migration/data/v310/passwords_p2.php | 44 + .../phpbb/db/migration/data/v310/plupload.php | 36 + .../data/v310/postgres_fulltext_drop.php | 80 + .../migration/data/v310/profilefield_aol.php | 55 + .../data/v310/profilefield_aol_cleanup.php | 51 + .../profilefield_change_load_settings.php | 34 + .../data/v310/profilefield_cleanup.php | 55 + .../data/v310/profilefield_contact_field.php | 55 + .../data/v310/profilefield_facebook.php | 61 + .../profilefield_field_validation_length.php | 90 + .../data/v310/profilefield_googleplus.php | 61 + .../migration/data/v310/profilefield_icq.php | 54 + .../data/v310/profilefield_icq_cleanup.php | 51 + .../data/v310/profilefield_interests.php | 52 + .../data/v310/profilefield_location.php | 52 + .../v310/profilefield_location_cleanup.php | 51 + .../data/v310/profilefield_occupation.php | 51 + .../data/v310/profilefield_on_memberlist.php | 51 + .../data/v310/profilefield_show_novalue.php | 49 + .../data/v310/profilefield_skype.php | 61 + .../data/v310/profilefield_twitter.php | 61 + .../data/v310/profilefield_types.php | 110 + .../data/v310/profilefield_website.php | 56 + .../v310/profilefield_website_cleanup.php | 51 + .../migration/data/v310/profilefield_wlm.php | 55 + .../data/v310/profilefield_wlm_cleanup.php | 51 + .../data/v310/profilefield_yahoo.php | 55 + .../data/v310/profilefield_yahoo_cleanup.php | 51 + .../data/v310/profilefield_youtube.php | 61 + .../data/v310/prune_shadow_topics.php | 50 + .../phpbb/db/migration/data/v310/rc1.php | 39 + .../phpbb/db/migration/data/v310/rc2.php | 31 + .../phpbb/db/migration/data/v310/rc3.php | 35 + .../phpbb/db/migration/data/v310/rc4.php | 32 + .../phpbb/db/migration/data/v310/rc5.php | 33 + .../phpbb/db/migration/data/v310/rc6.php | 31 + .../data/v310/remove_acp_styles_cache.php | 51 + .../data/v310/rename_too_long_indexes.php | 38 + .../data/v310/reported_posts_display.php | 53 + .../v310/reset_missing_captcha_plugin.php | 38 + .../db/migration/data/v310/search_type.php | 34 + .../data/v310/signature_module_auth.php | 57 + .../data/v310/soft_delete_mod_convert.php | 127 + .../data/v310/soft_delete_mod_convert2.php | 66 + .../data/v310/softdelete_mcp_modules.php | 61 + .../db/migration/data/v310/softdelete_p1.php | 211 + .../db/migration/data/v310/softdelete_p2.php | 78 + .../migration/data/v310/style_update_p1.php | 191 + .../migration/data/v310/style_update_p2.php | 151 + .../phpbb/db/migration/data/v310/teampage.php | 110 + .../phpbb/db/migration/data/v310/timezone.php | 194 + .../db/migration/data/v310/timezone_p2.php | 49 + .../data/v310/topic_sort_username.php | 44 + .../data/v310/ucp_popuppm_module.php | 46 + .../data/v31x/m_softdelete_global.php | 31 + .../data/v31x/plupload_last_gc_dynamic.php | 31 + ...filefield_remove_underscore_from_alpha.php | 47 + .../v31x/profilefield_yahoo_update_url.php | 38 + .../db/migration/data/v31x/style_update.php | 136 + .../v31x/update_custom_bbcodes_with_idn.php | 70 + .../phpbb/db/migration/data/v31x/v311.php | 32 + .../phpbb/db/migration/data/v31x/v312.php | 31 + .../phpbb/db/migration/data/v31x/v312rc1.php | 32 + .../phpbb/db/migration/data/v31x/v313.php | 31 + .../phpbb/db/migration/data/v31x/v313rc1.php | 35 + .../phpbb/db/migration/data/v31x/v313rc2.php | 32 + .../phpBB/phpbb/db/migration/exception.php | 75 + sources/phpBB/phpbb/db/migration/helper.php | 84 + .../phpBB/phpbb/db/migration/migration.php | 186 + .../migration/profilefield_base_migration.php | 246 + .../phpbb/db/migration/schema_generator.php | 235 + .../phpBB/phpbb/db/migration/tool/config.php | 160 + .../phpbb/db/migration/tool/config_text.php | 125 + .../phpBB/phpbb/db/migration/tool/module.php | 490 + .../phpbb/db/migration/tool/permission.php | 633 + .../db/migration/tool/tool_interface.php | 37 + sources/phpBB/phpbb/db/migrator.php | 839 + .../db/migrator_output_handler_interface.php | 31 + .../phpbb/db/null_migrator_output_handler.php | 24 + sources/phpBB/phpbb/db/sql_insert_buffer.php | 146 + sources/phpBB/phpbb/db/tools.php | 2835 + sources/phpBB/phpbb/di/container_builder.php | 405 + sources/phpBB/phpbb/di/extension/config.php | 89 + sources/phpBB/phpbb/di/extension/core.php | 67 + sources/phpBB/phpbb/di/extension/ext.php | 67 + .../phpBB/phpbb/di/pass/collection_pass.php | 44 + sources/phpBB/phpbb/di/service_collection.php | 79 + .../phpbb/di/service_collection_iterator.php | 46 + sources/phpBB/phpbb/error_collector.php | 73 + sources/phpBB/phpbb/event/data.php | 66 + sources/phpBB/phpbb/event/dispatcher.php | 78 + .../phpbb/event/dispatcher_interface.php | 50 + .../event/kernel_exception_subscriber.php | 115 + .../phpbb/event/kernel_request_subscriber.php | 82 + .../event/kernel_terminate_subscriber.php | 41 + sources/phpBB/phpbb/event/md_exporter.php | 440 + sources/phpBB/phpbb/event/php_exporter.php | 610 + .../event/recursive_event_filter_iterator.php | 71 + .../phpbb/exception/exception_interface.php | 29 + .../phpBB/phpbb/exception/http_exception.php | 70 + .../phpbb/exception/runtime_exception.php | 52 + sources/phpBB/phpbb/extension/base.php | 142 + sources/phpBB/phpbb/extension/exception.php | 25 + .../phpbb/extension/extension_interface.php | 70 + sources/phpBB/phpbb/extension/manager.php | 598 + .../phpbb/extension/metadata_manager.php | 379 + sources/phpBB/phpbb/extension/provider.php | 72 + sources/phpBB/phpbb/feed/attachments_base.php | 85 + sources/phpBB/phpbb/feed/base.php | 262 + sources/phpBB/phpbb/feed/factory.php | 127 + sources/phpBB/phpbb/feed/forum.php | 144 + sources/phpBB/phpbb/feed/forums.php | 68 + sources/phpBB/phpbb/feed/helper.php | 181 + sources/phpBB/phpbb/feed/news.php | 107 + sources/phpBB/phpbb/feed/overall.php | 86 + sources/phpBB/phpbb/feed/post_base.php | 55 + sources/phpBB/phpbb/feed/topic.php | 121 + sources/phpBB/phpbb/feed/topic_base.php | 70 + sources/phpBB/phpbb/feed/topics.php | 86 + sources/phpBB/phpbb/feed/topics_active.php | 131 + sources/phpBB/phpbb/file_downloader.php | 120 + sources/phpBB/phpbb/filesystem.php | 50 + sources/phpBB/phpbb/finder.php | 547 + .../phpBB/phpbb/groupposition/exception.php | 18 + .../groupposition/groupposition_interface.php | 80 + sources/phpBB/phpbb/groupposition/legend.php | 243 + .../phpBB/phpbb/groupposition/teampage.php | 597 + sources/phpBB/phpbb/hook/finder.php | 80 + sources/phpBB/phpbb/json_response.php | 38 + sources/phpBB/phpbb/lock/db.php | 146 + sources/phpBB/phpbb/lock/flock.php | 141 + sources/phpBB/phpbb/log/log.php | 907 + sources/phpBB/phpbb/log/log_interface.php | 114 + sources/phpBB/phpbb/log/null.php | 81 + sources/phpBB/phpbb/message/admin_form.php | 192 + sources/phpBB/phpbb/message/form.php | 175 + sources/phpBB/phpbb/message/message.php | 282 + sources/phpBB/phpbb/message/topic_form.php | 158 + sources/phpBB/phpbb/message/user_form.php | 136 + .../phpBB/phpbb/mimetype/content_guesser.php | 33 + .../phpbb/mimetype/extension_guesser.php | 509 + sources/phpBB/phpbb/mimetype/guesser.php | 156 + sources/phpBB/phpbb/mimetype/guesser_base.php | 38 + .../phpbb/mimetype/guesser_interface.php | 50 + .../phpBB/phpbb/notification/exception.php | 26 + sources/phpBB/phpbb/notification/manager.php | 980 + .../phpBB/phpbb/notification/method/base.php | 113 + .../phpBB/phpbb/notification/method/email.php | 49 + .../phpbb/notification/method/jabber.php | 66 + .../notification/method/messenger_base.php | 96 + .../notification/method/method_interface.php | 45 + .../notification/type/admin_activate_user.php | 169 + .../phpbb/notification/type/approve_post.php | 146 + .../phpbb/notification/type/approve_topic.php | 136 + .../phpBB/phpbb/notification/type/base.php | 569 + .../phpbb/notification/type/bookmark.php | 132 + .../notification/type/disapprove_post.php | 156 + .../notification/type/disapprove_topic.php | 156 + .../phpbb/notification/type/group_request.php | 161 + .../type/group_request_approved.php | 116 + sources/phpBB/phpbb/notification/type/pm.php | 195 + .../phpBB/phpbb/notification/type/post.php | 451 + .../phpbb/notification/type/post_in_queue.php | 160 + .../phpBB/phpbb/notification/type/quote.php | 190 + .../phpbb/notification/type/report_pm.php | 257 + .../notification/type/report_pm_closed.php | 165 + .../phpbb/notification/type/report_post.php | 230 + .../notification/type/report_post_closed.php | 172 + .../phpBB/phpbb/notification/type/topic.php | 294 + .../notification/type/topic_in_queue.php | 152 + .../notification/type/type_interface.php | 214 + sources/phpBB/phpbb/pagination.php | 357 + sources/phpBB/phpbb/passwords/driver/base.php | 62 + .../phpBB/phpbb/passwords/driver/bcrypt.php | 105 + .../phpbb/passwords/driver/bcrypt_2y.php | 35 + .../phpbb/passwords/driver/bcrypt_wcf2.php | 84 + .../passwords/driver/convert_password.php | 43 + .../passwords/driver/driver_interface.php | 69 + .../phpBB/phpbb/passwords/driver/helper.php | 165 + .../phpBB/phpbb/passwords/driver/md5_mybb.php | 60 + .../phpbb/passwords/driver/md5_phpbb2.php | 123 + .../phpBB/phpbb/passwords/driver/md5_vb.php | 60 + .../phpBB/phpbb/passwords/driver/phpass.php | 27 + .../phpbb/passwords/driver/salted_md5.php | 169 + sources/phpBB/phpbb/passwords/driver/sha1.php | 52 + .../phpBB/phpbb/passwords/driver/sha1_smf.php | 51 + .../phpbb/passwords/driver/sha1_wcf1.php | 60 + .../phpBB/phpbb/passwords/driver/sha_xf1.php | 68 + sources/phpBB/phpbb/passwords/helper.php | 104 + sources/phpBB/phpbb/passwords/manager.php | 366 + sources/phpBB/phpbb/path_helper.php | 492 + sources/phpBB/phpbb/permissions.php | 338 + sources/phpBB/phpbb/php/ini.php | 171 + sources/phpBB/phpbb/plupload/plupload.php | 402 + .../phpBB/phpbb/profilefields/lang_helper.php | 140 + sources/phpBB/phpbb/profilefields/manager.php | 482 + .../phpbb/profilefields/type/type_base.php | 206 + .../phpbb/profilefields/type/type_bool.php | 415 + .../phpbb/profilefields/type/type_date.php | 374 + .../profilefields/type/type_dropdown.php | 325 + .../profilefields/type/type_googleplus.php | 66 + .../phpbb/profilefields/type/type_int.php | 249 + .../profilefields/type/type_interface.php | 218 + .../phpbb/profilefields/type/type_string.php | 159 + .../profilefields/type/type_string_common.php | 147 + .../phpbb/profilefields/type/type_text.php | 204 + .../phpbb/profilefields/type/type_url.php | 74 + .../recursive_dot_prefix_filter_iterator.php | 30 + .../request/deactivated_super_global.php | 116 + sources/phpBB/phpbb/request/request.php | 442 + .../phpBB/phpbb/request/request_interface.php | 155 + .../phpBB/phpbb/request/type_cast_helper.php | 190 + .../request/type_cast_helper_interface.php | 59 + sources/phpBB/phpbb/search/base.php | 338 + sources/phpBB/phpbb/search/fulltext_mysql.php | 937 + .../phpBB/phpbb/search/fulltext_native.php | 1810 + .../phpBB/phpbb/search/fulltext_postgres.php | 936 + .../phpBB/phpbb/search/fulltext_sphinx.php | 913 + sources/phpBB/phpbb/search/index.htm | 10 + sources/phpBB/phpbb/search/sphinx/config.php | 284 + .../phpbb/search/sphinx/config_comment.php | 47 + .../phpbb/search/sphinx/config_section.php | 160 + .../phpbb/search/sphinx/config_variable.php | 78 + sources/phpBB/phpbb/session.php | 1548 + sources/phpBB/phpbb/symfony_request.php | 39 + sources/phpBB/phpbb/template/asset.php | 186 + sources/phpBB/phpbb/template/base.php | 156 + sources/phpBB/phpbb/template/context.php | 446 + sources/phpBB/phpbb/template/template.php | 182 + .../phpBB/phpbb/template/twig/definition.php | 69 + .../phpBB/phpbb/template/twig/environment.php | 205 + .../phpBB/phpbb/template/twig/extension.php | 185 + sources/phpBB/phpbb/template/twig/lexer.php | 354 + sources/phpBB/phpbb/template/twig/loader.php | 147 + .../phpbb/template/twig/node/definenode.php | 57 + .../phpBB/phpbb/template/twig/node/event.php | 83 + .../node/expression/binary/equalequal.php | 23 + .../node/expression/binary/notequalequal.php | 23 + .../phpbb/template/twig/node/includeasset.php | 81 + .../phpbb/template/twig/node/includecss.php | 37 + .../phpbb/template/twig/node/includejs.php | 39 + .../phpbb/template/twig/node/includenode.php | 54 + .../phpbb/template/twig/node/includephp.php | 90 + .../phpBB/phpbb/template/twig/node/php.php | 53 + .../twig/tokenparser/defineparser.php | 74 + .../phpbb/template/twig/tokenparser/event.php | 45 + .../template/twig/tokenparser/includecss.php | 44 + .../template/twig/tokenparser/includejs.php | 45 + .../twig/tokenparser/includeparser.php | 45 + .../template/twig/tokenparser/includephp.php | 55 + .../phpbb/template/twig/tokenparser/php.php | 53 + sources/phpBB/phpbb/template/twig/twig.php | 389 + sources/phpBB/phpbb/tree/nestedset.php | 875 + sources/phpBB/phpbb/tree/nestedset_forum.php | 44 + sources/phpBB/phpbb/tree/tree_interface.php | 120 + sources/phpBB/phpbb/user.php | 928 + sources/phpBB/phpbb/user_loader.php | 233 + sources/phpBB/phpbb/version_helper.php | 299 + sources/phpBB/phpbb/viewonline_helper.php | 54 + sources/phpBB/posting.php | 1906 + sources/phpBB/report.php | 338 + sources/phpBB/search.php | 1383 + sources/phpBB/store/.htaccess | 4 + sources/phpBB/store/index.htm | 10 + sources/phpBB/styles/prosilver/style.cfg | 32 + .../phpBB/styles/prosilver/template/ajax.js | 385 + .../styles/prosilver/template/attachment.html | 122 + .../styles/prosilver/template/bbcode.html | 40 + .../prosilver/template/captcha_default.html | 24 + .../styles/prosilver/template/captcha_qa.html | 21 + .../prosilver/template/captcha_recaptcha.html | 43 + .../prosilver/template/confirm_body.html | 35 + .../template/confirm_delete_body.html | 70 + .../styles/prosilver/template/drafts.html | 49 + .../styles/prosilver/template/faq_body.html | 48 + .../styles/prosilver/template/forum_fn.js | 936 + .../prosilver/template/forumlist_body.html | 106 + .../phpBB/styles/prosilver/template/index.htm | 0 .../styles/prosilver/template/index_body.html | 74 + .../styles/prosilver/template/jumpbox.html | 32 + .../styles/prosilver/template/login_body.html | 68 + .../prosilver/template/login_body_oauth.html | 8 + .../prosilver/template/login_forum.html | 41 + .../prosilver/template/mcp_approve.html | 81 + .../styles/prosilver/template/mcp_ban.html | 139 + .../styles/prosilver/template/mcp_footer.html | 8 + .../styles/prosilver/template/mcp_forum.html | 146 + .../styles/prosilver/template/mcp_front.html | 193 + .../styles/prosilver/template/mcp_header.html | 49 + .../styles/prosilver/template/mcp_logs.html | 95 + .../prosilver/template/mcp_message.html | 8 + .../styles/prosilver/template/mcp_move.html | 69 + .../prosilver/template/mcp_notes_front.html | 28 + .../prosilver/template/mcp_notes_user.html | 129 + .../styles/prosilver/template/mcp_post.html | 326 + .../styles/prosilver/template/mcp_queue.html | 129 + .../prosilver/template/mcp_reports.html | 118 + .../styles/prosilver/template/mcp_topic.html | 186 + .../prosilver/template/mcp_warn_front.html | 97 + .../prosilver/template/mcp_warn_list.html | 76 + .../prosilver/template/mcp_warn_post.html | 78 + .../prosilver/template/mcp_warn_user.html | 62 + .../styles/prosilver/template/mcp_whois.html | 16 + .../prosilver/template/memberlist_body.html | 160 + .../prosilver/template/memberlist_email.html | 105 + .../prosilver/template/memberlist_im.html | 46 + .../prosilver/template/memberlist_search.html | 87 + .../prosilver/template/memberlist_team.html | 47 + .../prosilver/template/memberlist_view.html | 132 + .../prosilver/template/message_body.html | 19 + .../prosilver/template/navbar_footer.html | 27 + .../prosilver/template/navbar_header.html | 114 + .../template/notification_dropdown.html | 45 + .../prosilver/template/overall_footer.html | 54 + .../prosilver/template/overall_header.html | 103 + .../styles/prosilver/template/pagination.html | 30 + .../styles/prosilver/template/plupload.html | 69 + .../template/posting_attach_body.html | 85 + .../prosilver/template/posting_body.html | 6 + .../prosilver/template/posting_buttons.html | 103 + .../prosilver/template/posting_editor.html | 188 + .../prosilver/template/posting_layout.html | 84 + .../prosilver/template/posting_pm_header.html | 83 + .../prosilver/template/posting_pm_layout.html | 41 + .../prosilver/template/posting_poll_body.html | 56 + .../prosilver/template/posting_preview.html | 47 + .../prosilver/template/posting_review.html | 35 + .../prosilver/template/posting_smilies.html | 27 + .../template/posting_topic_review.html | 73 + .../template/profilefields/bool.html | 7 + .../template/profilefields/date.html | 5 + .../template/profilefields/dropdown.html | 5 + .../prosilver/template/profilefields/int.html | 3 + .../template/profilefields/string.html | 3 + .../template/profilefields/text.html | 3 + .../prosilver/template/profilefields/url.html | 3 + .../prosilver/template/quickreply_editor.html | 26 + .../prosilver/template/report_body.html | 55 + .../prosilver/template/search_body.html | 122 + .../prosilver/template/search_results.html | 192 + .../prosilver/template/simple_footer.html | 34 + .../prosilver/template/simple_header.html | 39 + .../styles/prosilver/template/timezone.js | 20 + .../prosilver/template/timezone_option.html | 28 + .../prosilver/template/ucp_agreement.html | 76 + .../prosilver/template/ucp_attachments.html | 89 + .../prosilver/template/ucp_auth_link.html | 15 + .../template/ucp_auth_link_oauth.html | 29 + .../template/ucp_avatar_options.html | 47 + .../template/ucp_avatar_options_gravatar.html | 11 + .../template/ucp_avatar_options_local.html | 19 + .../template/ucp_avatar_options_remote.html | 11 + .../template/ucp_avatar_options_upload.html | 11 + .../styles/prosilver/template/ucp_footer.html | 14 + .../prosilver/template/ucp_groups_manage.html | 247 + .../template/ucp_groups_membership.html | 174 + .../styles/prosilver/template/ucp_header.html | 101 + .../prosilver/template/ucp_login_link.html | 58 + .../template/ucp_main_bookmarks.html | 108 + .../prosilver/template/ucp_main_drafts.html | 79 + .../prosilver/template/ucp_main_front.html | 68 + .../template/ucp_main_subscribed.html | 147 + .../prosilver/template/ucp_notifications.html | 122 + .../prosilver/template/ucp_pm_history.html | 42 + .../template/ucp_pm_message_footer.html | 2 + .../template/ucp_pm_message_header.html | 61 + .../prosilver/template/ucp_pm_options.html | 131 + .../prosilver/template/ucp_pm_viewfolder.html | 134 + .../template/ucp_pm_viewmessage.html | 161 + .../template/ucp_pm_viewmessage_print.html | 48 + .../template/ucp_prefs_personal.html | 124 + .../prosilver/template/ucp_prefs_post.html | 53 + .../prosilver/template/ucp_prefs_view.html | 98 + .../template/ucp_profile_autologin_keys.html | 45 + .../template/ucp_profile_avatar.html | 13 + .../template/ucp_profile_profile_info.html | 49 + .../template/ucp_profile_reg_details.html | 57 + .../template/ucp_profile_signature.html | 51 + .../prosilver/template/ucp_register.html | 108 + .../styles/prosilver/template/ucp_remind.html | 32 + .../styles/prosilver/template/ucp_resend.html | 32 + .../prosilver/template/ucp_zebra_foes.html | 41 + .../prosilver/template/ucp_zebra_friends.html | 43 + .../prosilver/template/viewforum_body.html | 272 + .../prosilver/template/viewonline_body.html | 63 + .../prosilver/template/viewonline_whois.html | 12 + .../prosilver/template/viewtopic_body.html | 398 + .../prosilver/template/viewtopic_print.html | 44 + .../template/viewtopic_topic_tools.html | 25 + sources/phpBB/styles/prosilver/theme/bidi.css | 1140 + .../phpBB/styles/prosilver/theme/buttons.css | 253 + .../phpBB/styles/prosilver/theme/colours.css | 1154 + .../phpBB/styles/prosilver/theme/common.css | 1298 + .../phpBB/styles/prosilver/theme/content.css | 847 + sources/phpBB/styles/prosilver/theme/cp.css | 376 + .../prosilver/theme/en/icon_user_online.gif | Bin 0 -> 423 bytes .../styles/prosilver/theme/en/stylesheet.css | 8 + .../phpBB/styles/prosilver/theme/forms.css | 431 + .../prosilver/theme/images/alert_close.png | Bin 0 -> 2097 bytes .../prosilver/theme/images/announce_read.gif | Bin 0 -> 728 bytes .../theme/images/announce_read_locked.gif | Bin 0 -> 738 bytes .../images/announce_read_locked_mine.gif | Bin 0 -> 753 bytes .../theme/images/announce_read_mine.gif | Bin 0 -> 724 bytes .../theme/images/announce_unread.gif | Bin 0 -> 730 bytes .../theme/images/announce_unread_locked.gif | Bin 0 -> 745 bytes .../images/announce_unread_locked_mine.gif | Bin 0 -> 755 bytes .../theme/images/announce_unread_mine.gif | Bin 0 -> 765 bytes .../prosilver/theme/images/arrow_down.gif | Bin 0 -> 51 bytes .../prosilver/theme/images/arrow_left.gif | Bin 0 -> 49 bytes .../prosilver/theme/images/arrow_right.gif | Bin 0 -> 49 bytes .../prosilver/theme/images/arrow_up.gif | Bin 0 -> 51 bytes .../prosilver/theme/images/bg_button.gif | Bin 0 -> 182 bytes .../prosilver/theme/images/bg_header.gif | Bin 0 -> 690 bytes .../styles/prosilver/theme/images/bg_list.gif | Bin 0 -> 664 bytes .../styles/prosilver/theme/images/feed.gif | Bin 0 -> 1089 bytes .../prosilver/theme/images/forum_link.gif | Bin 0 -> 708 bytes .../prosilver/theme/images/forum_read.gif | Bin 0 -> 662 bytes .../theme/images/forum_read_locked.gif | Bin 0 -> 681 bytes .../theme/images/forum_read_subforum.gif | Bin 0 -> 725 bytes .../prosilver/theme/images/forum_unread.gif | Bin 0 -> 667 bytes .../theme/images/forum_unread_locked.gif | Bin 0 -> 677 bytes .../theme/images/forum_unread_subforum.gif | Bin 0 -> 725 bytes .../prosilver/theme/images/gradient.gif | Bin 0 -> 549 bytes .../prosilver/theme/images/icon_acp.gif | Bin 0 -> 389 bytes .../prosilver/theme/images/icon_back_top.gif | Bin 0 -> 204 bytes .../prosilver/theme/images/icon_bookmark.gif | Bin 0 -> 218 bytes .../prosilver/theme/images/icon_bump.gif | Bin 0 -> 148 bytes .../prosilver/theme/images/icon_contact.png | Bin 0 -> 340 bytes .../theme/images/icon_delete_cookies.gif | Bin 0 -> 108 bytes .../prosilver/theme/images/icon_download.gif | Bin 0 -> 198 bytes .../prosilver/theme/images/icon_faq.gif | Bin 0 -> 255 bytes .../prosilver/theme/images/icon_home.gif | Bin 0 -> 306 bytes .../prosilver/theme/images/icon_logout.gif | Bin 0 -> 219 bytes .../prosilver/theme/images/icon_mark.gif | Bin 0 -> 360 bytes .../prosilver/theme/images/icon_mcp.gif | Bin 0 -> 342 bytes .../prosilver/theme/images/icon_members.gif | Bin 0 -> 264 bytes .../theme/images/icon_notification.gif | Bin 0 -> 551 bytes .../prosilver/theme/images/icon_offline.gif | Bin 0 -> 322 bytes .../prosilver/theme/images/icon_online.gif | Bin 0 -> 331 bytes .../prosilver/theme/images/icon_pages.gif | Bin 0 -> 105 bytes .../styles/prosilver/theme/images/icon_pm.gif | Bin 0 -> 576 bytes .../theme/images/icon_post_target.gif | Bin 0 -> 124 bytes .../theme/images/icon_post_target_unread.gif | Bin 0 -> 89 bytes .../prosilver/theme/images/icon_print.gif | Bin 0 -> 204 bytes .../prosilver/theme/images/icon_profile.gif | Bin 0 -> 538 bytes .../prosilver/theme/images/icon_rate_bad.gif | Bin 0 -> 465 bytes .../prosilver/theme/images/icon_rate_good.gif | Bin 0 -> 462 bytes .../prosilver/theme/images/icon_register.gif | Bin 0 -> 231 bytes .../prosilver/theme/images/icon_search.gif | Bin 0 -> 334 bytes .../prosilver/theme/images/icon_sendemail.gif | Bin 0 -> 303 bytes .../prosilver/theme/images/icon_subscribe.gif | Bin 0 -> 216 bytes .../prosilver/theme/images/icon_team.gif | Bin 0 -> 1009 bytes .../theme/images/icon_textbox_search.gif | Bin 0 -> 335 bytes .../theme/images/icon_topic_attach.gif | Bin 0 -> 82 bytes .../theme/images/icon_topic_deleted.png | Bin 0 -> 1205 bytes .../theme/images/icon_topic_latest.gif | Bin 0 -> 124 bytes .../theme/images/icon_topic_newest.gif | Bin 0 -> 93 bytes .../theme/images/icon_topic_poll.gif | Bin 0 -> 120 bytes .../theme/images/icon_topic_reported.gif | Bin 0 -> 246 bytes .../theme/images/icon_topic_unapproved.gif | Bin 0 -> 253 bytes .../prosilver/theme/images/icon_ucp.gif | Bin 0 -> 254 bytes .../theme/images/icon_unsubscribe.gif | Bin 0 -> 214 bytes .../prosilver/theme/images/icons_button.png | Bin 0 -> 8037 bytes .../prosilver/theme/images/icons_contact.png | Bin 0 -> 8507 bytes .../theme/images/icons_pagination.png | Bin 0 -> 1043 bytes .../styles/prosilver/theme/images/index.htm | 0 .../styles/prosilver/theme/images/loading.gif | Bin 0 -> 1320 bytes .../prosilver/theme/images/no_avatar.gif | Bin 0 -> 930 bytes .../prosilver/theme/images/plupload/done.gif | Bin 0 -> 1024 bytes .../prosilver/theme/images/plupload/error.gif | Bin 0 -> 994 bytes .../theme/images/plupload/throbber.gif | Bin 0 -> 1922 bytes .../styles/prosilver/theme/images/quote.gif | Bin 0 -> 153 bytes .../prosilver/theme/images/quote_rtl.gif | Bin 0 -> 154 bytes .../prosilver/theme/images/site_logo.gif | Bin 0 -> 5070 bytes .../prosilver/theme/images/sticky_read.gif | Bin 0 -> 625 bytes .../theme/images/sticky_read_locked.gif | Bin 0 -> 646 bytes .../theme/images/sticky_read_locked_mine.gif | Bin 0 -> 662 bytes .../theme/images/sticky_read_mine.gif | Bin 0 -> 633 bytes .../prosilver/theme/images/sticky_unread.gif | Bin 0 -> 622 bytes .../theme/images/sticky_unread_locked.gif | Bin 0 -> 626 bytes .../images/sticky_unread_locked_mine.gif | Bin 0 -> 682 bytes .../theme/images/sticky_unread_mine.gif | Bin 0 -> 643 bytes .../prosilver/theme/images/subforum_read.gif | Bin 0 -> 124 bytes .../theme/images/subforum_unread.gif | Bin 0 -> 124 bytes .../prosilver/theme/images/topic_moved.gif | Bin 0 -> 667 bytes .../prosilver/theme/images/topic_read.gif | Bin 0 -> 653 bytes .../prosilver/theme/images/topic_read_hot.gif | Bin 0 -> 1469 bytes .../theme/images/topic_read_hot_mine.gif | Bin 0 -> 1519 bytes .../theme/images/topic_read_locked.gif | Bin 0 -> 722 bytes .../theme/images/topic_read_locked_mine.gif | Bin 0 -> 723 bytes .../theme/images/topic_read_mine.gif | Bin 0 -> 669 bytes .../prosilver/theme/images/topic_unread.gif | Bin 0 -> 652 bytes .../theme/images/topic_unread_hot.gif | Bin 0 -> 1431 bytes .../theme/images/topic_unread_hot_mine.gif | Bin 0 -> 1364 bytes .../theme/images/topic_unread_locked.gif | Bin 0 -> 719 bytes .../theme/images/topic_unread_locked_mine.gif | Bin 0 -> 738 bytes .../theme/images/topic_unread_mine.gif | Bin 0 -> 678 bytes .../phpBB/styles/prosilver/theme/imageset.css | 376 + .../phpBB/styles/prosilver/theme/index.htm | 0 .../phpBB/styles/prosilver/theme/links.css | 212 + .../phpBB/styles/prosilver/theme/plupload.css | 81 + .../phpBB/styles/prosilver/theme/print.css | 139 + .../styles/prosilver/theme/responsive.css | 574 + .../styles/prosilver/theme/stylesheet.css | 17 + .../phpBB/styles/prosilver/theme/tweaks.css | 29 + sources/phpBB/ucp.php | 375 + sources/phpBB/vendor/autoload.php | 7 + sources/phpBB/vendor/composer/ClassLoader.php | 354 + .../vendor/composer/autoload_classmap.php | 677 + .../vendor/composer/autoload_namespaces.php | 23 + .../phpBB/vendor/composer/autoload_psr4.php | 9 + .../phpBB/vendor/composer/autoload_real.php | 48 + sources/phpBB/vendor/composer/installed.json | 722 + sources/phpBB/vendor/lusitanian/oauth/LICENSE | 20 + .../vendor/lusitanian/oauth/composer.json | 39 + .../oauth/src/OAuth/Common/AutoLoader.php | 77 + .../src/OAuth/Common/Consumer/Credentials.php | 60 + .../src/OAuth/Common/Exception/Exception.php | 10 + .../Common/Http/Client/AbstractClient.php | 47 + .../Common/Http/Client/ClientInterface.php | 25 + .../OAuth/Common/Http/Client/CurlClient.php | 111 + .../OAuth/Common/Http/Client/StreamClient.php | 75 + .../Http/Exception/TokenResponseException.php | 12 + .../oauth/src/OAuth/Common/Http/Uri/Uri.php | 373 + .../src/OAuth/Common/Http/Uri/UriFactory.php | 154 + .../Common/Http/Uri/UriFactoryInterface.php | 41 + .../OAuth/Common/Http/Uri/UriInterface.php | 148 + .../OAuth/Common/Service/AbstractService.php | 83 + .../OAuth/Common/Service/ServiceInterface.php | 48 + .../Storage/Exception/StorageException.php | 12 + .../Exception/TokenNotFoundException.php | 10 + .../oauth/src/OAuth/Common/Storage/Memory.php | 80 + .../oauth/src/OAuth/Common/Storage/Redis.php | 144 + .../src/OAuth/Common/Storage/Session.php | 106 + .../OAuth/Common/Storage/SymfonySession.php | 117 + .../Common/Storage/TokenStorageInterface.php | 44 + .../src/OAuth/Common/Token/AbstractToken.php | 120 + .../Token/Exception/ExpiredTokenException.php | 12 + .../src/OAuth/Common/Token/TokenInterface.php | 74 + .../OAuth/OAuth1/Service/AbstractService.php | 299 + .../src/OAuth/OAuth1/Service/BitBucket.php | 97 + .../oauth/src/OAuth/OAuth1/Service/Etsy.php | 97 + .../oauth/src/OAuth/OAuth1/Service/FitBit.php | 96 + .../OAuth/OAuth1/Service/ServiceInterface.php | 54 + .../oauth/src/OAuth/OAuth1/Service/Tumblr.php | 98 + .../src/OAuth/OAuth1/Service/Twitter.php | 98 + .../UnsupportedHashAlgorithmException.php | 12 + .../src/OAuth/OAuth1/Signature/Signature.php | 127 + .../OAuth1/Signature/SignatureInterface.php | 34 + .../src/OAuth/OAuth1/Token/StdOAuth1Token.php | 74 + .../src/OAuth/OAuth1/Token/TokenInterface.php | 40 + .../OAuth/OAuth2/Service/AbstractService.php | 235 + .../oauth/src/OAuth/OAuth2/Service/Amazon.php | 96 + .../oauth/src/OAuth/OAuth2/Service/Bitly.php | 102 + .../oauth/src/OAuth/OAuth2/Service/Box.php | 86 + .../src/OAuth/OAuth2/Service/Dropbox.php | 111 + .../Exception/InvalidScopeException.php | 15 + .../MissingRefreshTokenException.php | 15 + .../src/OAuth/OAuth2/Service/Facebook.php | 70 + .../src/OAuth/OAuth2/Service/Foursquare.php | 74 + .../oauth/src/OAuth/OAuth2/Service/GitHub.php | 101 + .../oauth/src/OAuth/OAuth2/Service/Google.php | 92 + .../src/OAuth/OAuth2/Service/Instagram.php | 83 + .../src/OAuth/OAuth2/Service/Linkedin.php | 99 + .../src/OAuth/OAuth2/Service/Microsoft.php | 101 + .../oauth/src/OAuth/OAuth2/Service/Paypal.php | 101 + .../OAuth/OAuth2/Service/ServiceInterface.php | 44 + .../src/OAuth/OAuth2/Service/SoundCloud.php | 72 + .../src/OAuth/OAuth2/Service/Vkontakte.php | 69 + .../oauth/src/OAuth/OAuth2/Service/Yammer.php | 77 + .../src/OAuth/OAuth2/Token/StdOAuth2Token.php | 12 + .../src/OAuth/OAuth2/Token/TokenInterface.php | 8 + .../oauth/src/OAuth/ServiceFactory.php | 81 + .../lusitanian/oauth/src/OAuth/bootstrap.php | 11 + sources/phpBB/vendor/psr/log/LICENSE | 19 + .../vendor/psr/log/Psr/Log/AbstractLogger.php | 120 + .../log/Psr/Log/InvalidArgumentException.php | 7 + .../phpBB/vendor/psr/log/Psr/Log/LogLevel.php | 18 + .../psr/log/Psr/Log/LoggerAwareInterface.php | 17 + .../psr/log/Psr/Log/LoggerAwareTrait.php | 22 + .../psr/log/Psr/Log/LoggerInterface.php | 114 + .../vendor/psr/log/Psr/Log/LoggerTrait.php | 131 + .../vendor/psr/log/Psr/Log/NullLogger.php | 27 + sources/phpBB/vendor/psr/log/composer.json | 17 + .../Symfony/Component/Config/ConfigCache.php | 126 + .../Component/Config/Definition/ArrayNode.php | 400 + .../Component/Config/Definition/BaseNode.php | 354 + .../Config/Definition/BooleanNode.php | 39 + .../Builder/ArrayNodeDefinition.php | 496 + .../Builder/BooleanNodeDefinition.php | 42 + .../Definition/Builder/EnumNodeDefinition.php | 53 + .../Config/Definition/Builder/ExprBuilder.php | 236 + .../Builder/FloatNodeDefinition.php | 32 + .../Builder/IntegerNodeDefinition.php | 32 + .../Definition/Builder/MergeBuilder.php | 74 + .../Config/Definition/Builder/NodeBuilder.php | 246 + .../Definition/Builder/NodeDefinition.php | 346 + .../Builder/NodeParentInterface.php | 21 + .../Builder/NormalizationBuilder.php | 70 + .../Builder/NumericNodeDefinition.php | 61 + .../Builder/ParentNodeDefinitionInterface.php | 26 + .../Builder/ScalarNodeDefinition.php | 32 + .../Config/Definition/Builder/TreeBuilder.php | 63 + .../Definition/Builder/ValidationBuilder.php | 53 + .../Builder/VariableNodeDefinition.php | 67 + .../Definition/ConfigurationInterface.php | 27 + .../Component/Config/Definition/EnumNode.php | 58 + .../Exception/DuplicateKeyException.php | 22 + .../Config/Definition/Exception/Exception.php | 21 + .../Exception/ForbiddenOverwriteException.php | 22 + .../InvalidConfigurationException.php | 33 + .../Exception/InvalidDefinitionException.php | 21 + .../Exception/InvalidTypeException.php | 21 + .../Exception/UnsetKeyException.php | 22 + .../Component/Config/Definition/FloatNode.php | 40 + .../Config/Definition/IntegerNode.php | 35 + .../Config/Definition/NodeInterface.php | 87 + .../Config/Definition/NumericNode.php | 55 + .../Component/Config/Definition/Processor.php | 97 + .../Definition/PrototypeNodeInterface.php | 27 + .../Config/Definition/PrototypedArrayNode.php | 345 + .../Config/Definition/ReferenceDumper.php | 193 + .../Config/Definition/ScalarNode.php | 46 + .../Config/Definition/VariableNode.php | 114 + ...LoaderImportCircularReferenceException.php | 27 + .../Exception/FileLoaderLoadException.php | 81 + .../Symfony/Component/Config/FileLocator.php | 99 + .../Component/Config/FileLocatorInterface.php | 31 + .../config/Symfony/Component/Config/LICENSE | 19 + .../Config/Loader/DelegatingLoader.php | 62 + .../Component/Config/Loader/FileLoader.php | 108 + .../Component/Config/Loader/Loader.php | 82 + .../Config/Loader/LoaderInterface.php | 52 + .../Config/Loader/LoaderResolver.php | 81 + .../Config/Loader/LoaderResolverInterface.php | 30 + .../Config/Resource/DirectoryResource.php | 102 + .../Config/Resource/FileResource.php | 80 + .../Config/Resource/ResourceInterface.php | 43 + .../Component/Config/Util/XmlUtils.php | 229 + .../Symfony/Component/Config/composer.json | 32 + .../Symfony/Component/Console/Application.php | 1172 + .../Component/Console/Command/Command.php | 609 + .../Component/Console/Command/HelpCommand.php | 87 + .../Component/Console/Command/ListCommand.php | 91 + .../Component/Console/ConsoleEvents.php | 55 + .../Descriptor/ApplicationDescription.php | 153 + .../Console/Descriptor/Descriptor.php | 92 + .../Descriptor/DescriptorInterface.php | 30 + .../Console/Descriptor/JsonDescriptor.php | 129 + .../Console/Descriptor/MarkdownDescriptor.php | 129 + .../Console/Descriptor/TextDescriptor.php | 210 + .../Console/Descriptor/XmlDescriptor.php | 212 + .../Console/Event/ConsoleCommandEvent.php | 21 + .../Component/Console/Event/ConsoleEvent.php | 67 + .../Console/Event/ConsoleExceptionEvent.php | 67 + .../Console/Event/ConsoleTerminateEvent.php | 58 + .../Console/Formatter/OutputFormatter.php | 240 + .../Formatter/OutputFormatterInterface.php | 83 + .../Formatter/OutputFormatterStyle.php | 222 + .../OutputFormatterStyleInterface.php | 72 + .../Formatter/OutputFormatterStyleStack.php | 121 + .../Console/Helper/DescriptorHelper.php | 93 + .../Component/Console/Helper/DialogHelper.php | 470 + .../Console/Helper/FormatterHelper.php | 80 + .../Component/Console/Helper/Helper.php | 62 + .../Console/Helper/HelperInterface.php | 49 + .../Component/Console/Helper/HelperSet.php | 104 + .../Console/Helper/ProgressHelper.php | 455 + .../Component/Console/Helper/TableHelper.php | 490 + .../Component/Console/Input/ArgvInput.php | 351 + .../Component/Console/Input/ArrayInput.php | 209 + .../Symfony/Component/Console/Input/Input.php | 225 + .../Component/Console/Input/InputArgument.php | 132 + .../Console/Input/InputDefinition.php | 448 + .../Console/Input/InputInterface.php | 152 + .../Component/Console/Input/InputOption.php | 212 + .../Component/Console/Input/StringInput.php | 85 + .../console/Symfony/Component/Console/LICENSE | 19 + .../Console/Output/ConsoleOutput.php | 113 + .../Console/Output/ConsoleOutputInterface.php | 35 + .../Component/Console/Output/NullOutput.php | 93 + .../Component/Console/Output/Output.php | 145 + .../Console/Output/OutputInterface.php | 113 + .../Component/Console/Output/StreamOutput.php | 107 + .../Console/Resources/bin/hiddeninput.exe | Bin 0 -> 9216 bytes .../Symfony/Component/Console/Shell.php | 229 + .../Console/Tester/ApplicationTester.php | 117 + .../Console/Tester/CommandTester.php | 112 + .../Symfony/Component/Console/composer.json | 37 + .../debug/Symfony/Component/Debug/Debug.php | 58 + .../Symfony/Component/Debug/ErrorHandler.php | 206 + .../Debug/Exception/ContextErrorException.php | 36 + .../Debug/Exception/DummyException.php | 21 + .../Debug/Exception/FatalErrorException.php | 21 + .../Debug/Exception/FlattenException.php | 277 + .../Component/Debug/ExceptionHandler.php | 318 + .../debug/Symfony/Component/Debug/LICENSE | 19 + .../Symfony/Component/Debug/composer.json | 40 + .../Component/DependencyInjection/Alias.php | 71 + .../Compiler/AnalyzeServiceReferencesPass.php | 144 + .../Compiler/CheckCircularReferencesPass.php | 79 + .../Compiler/CheckDefinitionValidityPass.php | 79 + ...xceptionOnInvalidReferenceBehaviorPass.php | 64 + .../Compiler/CheckReferenceValidityPass.php | 167 + .../DependencyInjection/Compiler/Compiler.php | 121 + .../Compiler/CompilerPassInterface.php | 33 + .../Compiler/InlineServiceDefinitionsPass.php | 143 + .../Compiler/LoggingFormatter.php | 45 + .../MergeExtensionConfigurationPass.php | 59 + .../Compiler/PassConfig.php | 259 + .../RemoveAbstractDefinitionsPass.php | 39 + .../Compiler/RemovePrivateAliasesPass.php | 44 + .../Compiler/RemoveUnusedDefinitionsPass.php | 84 + .../Compiler/RepeatablePassInterface.php | 28 + .../Compiler/RepeatedPass.php | 88 + .../ReplaceAliasByActualDefinitionPass.php | 125 + .../ResolveDefinitionTemplatesPass.php | 154 + .../Compiler/ResolveInvalidReferencesPass.php | 105 + .../ResolveParameterPlaceHoldersPass.php | 63 + .../ResolveReferencesToAliasesPass.php | 93 + .../Compiler/ServiceReferenceGraph.php | 122 + .../Compiler/ServiceReferenceGraphEdge.php | 70 + .../Compiler/ServiceReferenceGraphNode.php | 124 + .../DependencyInjection/Container.php | 568 + .../DependencyInjection/ContainerAware.php | 41 + .../ContainerAwareInterface.php | 31 + .../DependencyInjection/ContainerBuilder.php | 1158 + .../ContainerInterface.php | 158 + .../DependencyInjection/Definition.php | 715 + .../DefinitionDecorator.php | 219 + .../DependencyInjection/Dumper/Dumper.php | 38 + .../Dumper/DumperInterface.php | 33 + .../Dumper/GraphvizDumper.php | 295 + .../DependencyInjection/Dumper/PhpDumper.php | 1326 + .../DependencyInjection/Dumper/XmlDumper.php | 325 + .../DependencyInjection/Dumper/YamlDumper.php | 320 + .../Exception/BadMethodCallException.php | 19 + .../Exception/ExceptionInterface.php | 22 + .../Exception/InactiveScopeException.php | 41 + .../Exception/InvalidArgumentException.php | 21 + .../Exception/LogicException.php | 19 + .../Exception/OutOfBoundsException.php | 19 + .../ParameterCircularReferenceException.php | 34 + .../Exception/ParameterNotFoundException.php | 95 + .../Exception/RuntimeException.php | 21 + .../ScopeCrossingInjectionException.php | 65 + .../ScopeWideningInjectionException.php | 64 + .../ServiceCircularReferenceException.php | 41 + .../Exception/ServiceNotFoundException.php | 56 + .../ConfigurationExtensionInterface.php | 33 + .../Extension/Extension.php | 124 + .../Extension/ExtensionInterface.php | 65 + .../Extension/PrependExtensionInterface.php | 24 + .../IntrospectableContainerInterface.php | 32 + .../Component/DependencyInjection/LICENSE | 19 + .../Instantiator/InstantiatorInterface.php | 37 + .../Instantiator/RealServiceInstantiator.php | 33 + .../LazyProxy/PhpDumper/DumperInterface.php | 50 + .../LazyProxy/PhpDumper/NullDumper.php | 46 + .../Loader/ClosureLoader.php | 61 + .../DependencyInjection/Loader/FileLoader.php | 39 + .../Loader/IniFileLoader.php | 62 + .../Loader/PhpFileLoader.php | 57 + .../Loader/XmlFileLoader.php | 422 + .../Loader/YamlFileLoader.php | 392 + .../schema/dic/services/services-1.0.xsd | 186 + .../DependencyInjection/Parameter.php | 44 + .../ParameterBag/FrozenParameterBag.php | 72 + .../ParameterBag/ParameterBag.php | 306 + .../ParameterBag/ParameterBagInterface.php | 115 + .../DependencyInjection/Reference.php | 72 + .../Component/DependencyInjection/Scope.php | 50 + .../DependencyInjection/ScopeInterface.php | 32 + .../DependencyInjection/SimpleXMLElement.php | 108 + .../TaggedContainerInterface.php | 33 + .../DependencyInjection/Variable.php | 50 + .../DependencyInjection/composer.json | 40 + .../ContainerAwareEventDispatcher.php | 202 + .../TraceableEventDispatcherInterface.php | 32 + .../Component/EventDispatcher/Event.php | 121 + .../EventDispatcher/EventDispatcher.php | 185 + .../EventDispatcherInterface.php | 96 + .../EventSubscriberInterface.php | 50 + .../EventDispatcher/GenericEvent.php | 186 + .../ImmutableEventDispatcher.php | 92 + .../Symfony/Component/EventDispatcher/LICENSE | 19 + .../Component/EventDispatcher/composer.json | 38 + .../Exception/ExceptionInterface.php | 23 + .../Filesystem/Exception/IOException.php | 23 + .../Component/Filesystem/Filesystem.php | 482 + .../Symfony/Component/Filesystem/LICENSE | 19 + .../Component/Filesystem/composer.json | 31 + .../Component/HttpFoundation/AcceptHeader.php | 172 + .../HttpFoundation/AcceptHeaderItem.php | 226 + .../HttpFoundation/ApacheRequest.php | 43 + .../HttpFoundation/BinaryFileResponse.php | 298 + .../Component/HttpFoundation/Cookie.php | 210 + .../File/Exception/AccessDeniedException.php | 30 + .../File/Exception/FileException.php | 21 + .../File/Exception/FileNotFoundException.php | 30 + .../Exception/UnexpectedTypeException.php | 20 + .../File/Exception/UploadException.php | 21 + .../Component/HttpFoundation/File/File.php | 160 + .../File/MimeType/ExtensionGuesser.php | 96 + .../MimeType/ExtensionGuesserInterface.php | 26 + .../MimeType/FileBinaryMimeTypeGuesser.php | 87 + .../File/MimeType/FileinfoMimeTypeGuesser.php | 71 + .../MimeType/MimeTypeExtensionGuesser.php | 807 + .../File/MimeType/MimeTypeGuesser.php | 132 + .../MimeType/MimeTypeGuesserInterface.php | 35 + .../HttpFoundation/File/UploadedFile.php | 310 + .../Component/HttpFoundation/FileBag.php | 155 + .../Component/HttpFoundation/HeaderBag.php | 350 + .../Component/HttpFoundation/IpUtils.php | 123 + .../Component/HttpFoundation/JsonResponse.php | 152 + .../Symfony/Component/HttpFoundation/LICENSE | 19 + .../Component/HttpFoundation/ParameterBag.php | 305 + .../HttpFoundation/RedirectResponse.php | 106 + .../Component/HttpFoundation/Request.php | 1822 + .../HttpFoundation/RequestMatcher.php | 160 + .../RequestMatcherInterface.php | 33 + .../Resources/stubs/FakeFile.php | 45 + .../stubs/SessionHandlerInterface.php | 90 + .../Component/HttpFoundation/Response.php | 1203 + .../HttpFoundation/ResponseHeaderBag.php | 319 + .../Component/HttpFoundation/ServerBag.php | 91 + .../Session/Attribute/AttributeBag.php | 157 + .../Attribute/AttributeBagInterface.php | 72 + .../Attribute/NamespacedAttributeBag.php | 158 + .../Session/Flash/AutoExpireFlashBag.php | 176 + .../HttpFoundation/Session/Flash/FlashBag.php | 176 + .../Session/Flash/FlashBagInterface.php | 93 + .../HttpFoundation/Session/Session.php | 251 + .../Session/SessionBagInterface.php | 48 + .../Session/SessionInterface.php | 208 + .../Handler/MemcacheSessionHandler.php | 109 + .../Handler/MemcachedSessionHandler.php | 115 + .../Storage/Handler/MongoDbSessionHandler.php | 163 + .../Handler/NativeFileSessionHandler.php | 58 + .../Storage/Handler/NativeSessionHandler.php | 28 + .../Storage/Handler/NullSessionHandler.php | 72 + .../Storage/Handler/PdoSessionHandler.php | 255 + .../Session/Storage/MetadataBag.php | 160 + .../Storage/MockArraySessionStorage.php | 268 + .../Storage/MockFileSessionStorage.php | 138 + .../Session/Storage/NativeSessionStorage.php | 433 + .../Storage/PhpBridgeSessionStorage.php | 68 + .../Session/Storage/Proxy/AbstractProxy.php | 154 + .../Session/Storage/Proxy/NativeProxy.php | 41 + .../Storage/Proxy/SessionHandlerProxy.php | 95 + .../Storage/SessionStorageInterface.php | 145 + .../HttpFoundation/StreamedResponse.php | 127 + .../Component/HttpFoundation/composer.json | 32 + .../Component/HttpKernel/Bundle/Bundle.php | 196 + .../HttpKernel/Bundle/BundleInterface.php | 102 + .../CacheClearer/CacheClearerInterface.php | 27 + .../CacheClearer/ChainCacheClearer.php | 55 + .../HttpKernel/CacheWarmer/CacheWarmer.php | 32 + .../CacheWarmer/CacheWarmerAggregate.php | 73 + .../CacheWarmer/CacheWarmerInterface.php | 32 + .../CacheWarmer/WarmableInterface.php | 27 + .../Symfony/Component/HttpKernel/Client.php | 225 + .../HttpKernel/Config/FileLocator.php | 56 + .../Controller/ControllerReference.php | 45 + .../Controller/ControllerResolver.php | 172 + .../ControllerResolverInterface.php | 63 + .../TraceableControllerResolver.php | 66 + .../DataCollector/ConfigDataCollector.php | 245 + .../DataCollector/DataCollector.php | 75 + .../DataCollector/DataCollectorInterface.php | 45 + .../DataCollector/EventDataCollector.php | 91 + .../DataCollector/ExceptionDataCollector.php | 104 + .../DataCollector/LoggerDataCollector.php | 125 + .../DataCollector/MemoryDataCollector.php | 101 + .../DataCollector/RequestDataCollector.php | 327 + .../DataCollector/RouterDataCollector.php | 102 + .../DataCollector/TimeDataCollector.php | 122 + .../HttpKernel/Debug/ErrorHandler.php | 25 + .../HttpKernel/Debug/ExceptionHandler.php | 25 + .../Debug/TraceableEventDispatcher.php | 487 + .../AddClassesToCachePass.php | 46 + .../ConfigurableExtension.php | 45 + .../ContainerAwareHttpKernel.php | 75 + .../DependencyInjection/Extension.php | 44 + .../MergeExtensionConfigurationPass.php | 41 + .../RegisterListenersPass.php | 106 + .../Event/FilterControllerEvent.php | 109 + .../HttpKernel/Event/FilterResponseEvent.php | 67 + .../HttpKernel/Event/GetResponseEvent.php | 72 + .../GetResponseForControllerResultEvent.php | 67 + .../Event/GetResponseForExceptionEvent.php | 72 + .../HttpKernel/Event/KernelEvent.php | 89 + .../HttpKernel/Event/PostResponseEvent.php | 72 + .../EventListener/ErrorsLoggerListener.php | 48 + .../HttpKernel/EventListener/EsiListener.php | 59 + .../EventListener/ExceptionListener.php | 112 + .../EventListener/FragmentListener.php | 107 + .../EventListener/LocaleListener.php | 66 + .../EventListener/ProfilerListener.php | 166 + .../EventListener/ResponseListener.php | 59 + .../EventListener/RouterListener.php | 140 + .../StreamedResponseListener.php | 52 + .../Exception/AccessDeniedHttpException.php | 33 + .../Exception/BadRequestHttpException.php | 32 + .../Exception/ConflictHttpException.php | 32 + .../Exception/FatalErrorException.php | 25 + .../HttpKernel/Exception/FlattenException.php | 27 + .../Exception/GoneHttpException.php | 32 + .../HttpKernel/Exception/HttpException.php | 41 + .../Exception/HttpExceptionInterface.php | 34 + .../Exception/LengthRequiredHttpException.php | 32 + .../MethodNotAllowedHttpException.php | 35 + .../Exception/NotAcceptableHttpException.php | 32 + .../Exception/NotFoundHttpException.php | 32 + .../PreconditionFailedHttpException.php | 32 + .../PreconditionRequiredHttpException.php | 33 + .../ServiceUnavailableHttpException.php | 38 + .../TooManyRequestsHttpException.php | 39 + .../Exception/UnauthorizedHttpException.php | 35 + .../UnsupportedMediaTypeHttpException.php | 32 + .../Fragment/EsiFragmentRenderer.php | 100 + .../HttpKernel/Fragment/FragmentHandler.php | 128 + .../Fragment/FragmentRendererInterface.php | 44 + .../Fragment/HIncludeFragmentRenderer.php | 163 + .../Fragment/InlineFragmentRenderer.php | 153 + .../Fragment/RoutableFragmentRenderer.php | 74 + .../Component/HttpKernel/HttpCache/Esi.php | 245 + .../HttpCache/EsiResponseCacheStrategy.php | 85 + .../EsiResponseCacheStrategyInterface.php | 41 + .../HttpKernel/HttpCache/HttpCache.php | 690 + .../Component/HttpKernel/HttpCache/Store.php | 430 + .../HttpKernel/HttpCache/StoreInterface.php | 96 + .../Component/HttpKernel/HttpKernel.php | 243 + .../HttpKernel/HttpKernelInterface.php | 47 + .../Symfony/Component/HttpKernel/Kernel.php | 809 + .../Component/HttpKernel/KernelEvents.php | 105 + .../Component/HttpKernel/KernelInterface.php | 207 + .../Symfony/Component/HttpKernel/LICENSE | 19 + .../HttpKernel/Log/DebugLoggerInterface.php | 38 + .../HttpKernel/Log/LoggerInterface.php | 49 + .../Component/HttpKernel/Log/NullLogger.php | 56 + .../Profiler/BaseMemcacheProfilerStorage.php | 305 + .../Profiler/FileProfilerStorage.php | 277 + .../Profiler/MemcacheProfilerStorage.php | 107 + .../Profiler/MemcachedProfilerStorage.php | 103 + .../Profiler/MongoDbProfilerStorage.php | 257 + .../Profiler/MysqlProfilerStorage.php | 79 + .../Profiler/PdoProfilerStorage.php | 262 + .../Component/HttpKernel/Profiler/Profile.php | 275 + .../HttpKernel/Profiler/Profiler.php | 287 + .../Profiler/ProfilerStorageInterface.php | 59 + .../Profiler/RedisProfilerStorage.php | 390 + .../Profiler/SqliteProfilerStorage.php | 139 + .../HttpKernel/TerminableInterface.php | 39 + .../Component/HttpKernel/UriSigner.php | 72 + .../Component/HttpKernel/composer.json | 55 + .../Component/Routing/Annotation/Route.php | 157 + .../Component/Routing/CompiledRoute.php | 133 + .../Routing/Exception/ExceptionInterface.php | 23 + .../Exception/InvalidParameterException.php | 23 + .../Exception/MethodNotAllowedException.php | 46 + .../MissingMandatoryParametersException.php | 24 + .../Exception/ResourceNotFoundException.php | 25 + .../Exception/RouteNotFoundException.php | 23 + .../ConfigurableRequirementsInterface.php | 55 + .../Generator/Dumper/GeneratorDumper.php | 45 + .../Dumper/GeneratorDumperInterface.php | 41 + .../Generator/Dumper/PhpGeneratorDumper.php | 123 + .../Routing/Generator/UrlGenerator.php | 322 + .../Generator/UrlGeneratorInterface.php | 87 + .../routing/Symfony/Component/Routing/LICENSE | 19 + .../Routing/Loader/AnnotationClassLoader.php | 246 + .../Loader/AnnotationDirectoryLoader.php | 77 + .../Routing/Loader/AnnotationFileLoader.php | 121 + .../Routing/Loader/ClosureLoader.php | 52 + .../Routing/Loader/PhpFileLoader.php | 62 + .../Routing/Loader/XmlFileLoader.php | 249 + .../Routing/Loader/YamlFileLoader.php | 212 + .../Loader/schema/routing/routing-1.0.xsd | 64 + .../Routing/Matcher/ApacheUrlMatcher.php | 118 + .../Matcher/Dumper/ApacheMatcherDumper.php | 273 + .../Matcher/Dumper/DumperCollection.php | 159 + .../Matcher/Dumper/DumperPrefixCollection.php | 105 + .../Routing/Matcher/Dumper/DumperRoute.php | 64 + .../Routing/Matcher/Dumper/MatcherDumper.php | 45 + .../Matcher/Dumper/MatcherDumperInterface.php | 39 + .../Matcher/Dumper/PhpMatcherDumper.php | 377 + .../Matcher/RedirectableUrlMatcher.php | 61 + .../RedirectableUrlMatcherInterface.php | 35 + .../Matcher/RequestMatcherInterface.php | 39 + .../Routing/Matcher/TraceableUrlMatcher.php | 120 + .../Component/Routing/Matcher/UrlMatcher.php | 208 + .../Routing/Matcher/UrlMatcherInterface.php | 43 + .../Component/Routing/RequestContext.php | 322 + .../Routing/RequestContextAwareInterface.php | 36 + .../Symfony/Component/Routing/Route.php | 594 + .../Component/Routing/RouteCollection.php | 271 + .../Component/Routing/RouteCompiler.php | 229 + .../Routing/RouteCompilerInterface.php | 32 + .../Symfony/Component/Routing/Router.php | 289 + .../Component/Routing/RouterInterface.php | 32 + .../Symfony/Component/Routing/composer.json | 43 + .../yaml/Symfony/Component/Yaml/Dumper.php | 73 + .../yaml/Symfony/Component/Yaml/Escaper.php | 89 + .../Yaml/Exception/DumpException.php | 23 + .../Yaml/Exception/ExceptionInterface.php | 23 + .../Yaml/Exception/ParseException.php | 148 + .../Yaml/Exception/RuntimeException.php | 23 + .../yaml/Symfony/Component/Yaml/Inline.php | 498 + .../yaml/Symfony/Component/Yaml/LICENSE | 19 + .../yaml/Symfony/Component/Yaml/Parser.php | 650 + .../yaml/Symfony/Component/Yaml/Unescaper.php | 141 + .../yaml/Symfony/Component/Yaml/Yaml.php | 100 + .../yaml/Symfony/Component/Yaml/composer.json | 31 + sources/phpBB/vendor/twig/twig/LICENSE | 31 + sources/phpBB/vendor/twig/twig/composer.json | 31 + .../vendor/twig/twig/lib/Twig/Autoloader.php | 48 + .../vendor/twig/twig/lib/Twig/Compiler.php | 267 + .../twig/twig/lib/Twig/CompilerInterface.php | 35 + .../vendor/twig/twig/lib/Twig/Environment.php | 1224 + .../phpBB/vendor/twig/twig/lib/Twig/Error.php | 243 + .../twig/twig/lib/Twig/Error/Loader.php | 31 + .../twig/twig/lib/Twig/Error/Runtime.php | 20 + .../twig/twig/lib/Twig/Error/Syntax.php | 20 + .../twig/lib/Twig/ExistsLoaderInterface.php | 28 + .../twig/twig/lib/Twig/ExpressionParser.php | 600 + .../vendor/twig/twig/lib/Twig/Extension.php | 93 + .../twig/twig/lib/Twig/Extension/Core.php | 1355 + .../twig/twig/lib/Twig/Extension/Debug.php | 71 + .../twig/twig/lib/Twig/Extension/Escaper.php | 107 + .../twig/lib/Twig/Extension/Optimizer.php | 35 + .../twig/twig/lib/Twig/Extension/Sandbox.php | 112 + .../twig/twig/lib/Twig/Extension/Staging.php | 113 + .../twig/lib/Twig/Extension/StringLoader.php | 64 + .../twig/twig/lib/Twig/ExtensionInterface.php | 83 + .../vendor/twig/twig/lib/Twig/Filter.php | 81 + .../twig/twig/lib/Twig/Filter/Function.php | 37 + .../twig/twig/lib/Twig/Filter/Method.php | 39 + .../vendor/twig/twig/lib/Twig/Filter/Node.php | 39 + .../twig/lib/Twig/FilterCallableInterface.php | 23 + .../twig/twig/lib/Twig/FilterInterface.php | 42 + .../vendor/twig/twig/lib/Twig/Function.php | 71 + .../twig/twig/lib/Twig/Function/Function.php | 38 + .../twig/twig/lib/Twig/Function/Method.php | 40 + .../twig/twig/lib/Twig/Function/Node.php | 39 + .../lib/Twig/FunctionCallableInterface.php | 23 + .../twig/twig/lib/Twig/FunctionInterface.php | 39 + .../phpBB/vendor/twig/twig/lib/Twig/Lexer.php | 408 + .../twig/twig/lib/Twig/LexerInterface.php | 29 + .../twig/twig/lib/Twig/Loader/Array.php | 98 + .../twig/twig/lib/Twig/Loader/Chain.php | 139 + .../twig/twig/lib/Twig/Loader/Filesystem.php | 226 + .../twig/twig/lib/Twig/Loader/String.php | 59 + .../twig/twig/lib/Twig/LoaderInterface.php | 52 + .../vendor/twig/twig/lib/Twig/Markup.php | 37 + .../phpBB/vendor/twig/twig/lib/Twig/Node.php | 226 + .../twig/twig/lib/Twig/Node/AutoEscape.php | 39 + .../vendor/twig/twig/lib/Twig/Node/Block.php | 44 + .../twig/lib/Twig/Node/BlockReference.php | 37 + .../vendor/twig/twig/lib/Twig/Node/Body.php | 19 + .../vendor/twig/twig/lib/Twig/Node/Do.php | 38 + .../vendor/twig/twig/lib/Twig/Node/Embed.php | 38 + .../twig/twig/lib/Twig/Node/Expression.php | 20 + .../twig/lib/Twig/Node/Expression/Array.php | 86 + .../lib/Twig/Node/Expression/AssignName.php | 28 + .../twig/lib/Twig/Node/Expression/Binary.php | 40 + .../lib/Twig/Node/Expression/Binary/Add.php | 18 + .../lib/Twig/Node/Expression/Binary/And.php | 18 + .../Node/Expression/Binary/BitwiseAnd.php | 18 + .../Twig/Node/Expression/Binary/BitwiseOr.php | 18 + .../Node/Expression/Binary/BitwiseXor.php | 18 + .../Twig/Node/Expression/Binary/Concat.php | 18 + .../lib/Twig/Node/Expression/Binary/Div.php | 18 + .../lib/Twig/Node/Expression/Binary/Equal.php | 17 + .../Twig/Node/Expression/Binary/FloorDiv.php | 29 + .../Twig/Node/Expression/Binary/Greater.php | 17 + .../Node/Expression/Binary/GreaterEqual.php | 17 + .../lib/Twig/Node/Expression/Binary/In.php | 33 + .../lib/Twig/Node/Expression/Binary/Less.php | 17 + .../Twig/Node/Expression/Binary/LessEqual.php | 17 + .../lib/Twig/Node/Expression/Binary/Mod.php | 18 + .../lib/Twig/Node/Expression/Binary/Mul.php | 18 + .../Twig/Node/Expression/Binary/NotEqual.php | 17 + .../lib/Twig/Node/Expression/Binary/NotIn.php | 33 + .../lib/Twig/Node/Expression/Binary/Or.php | 18 + .../lib/Twig/Node/Expression/Binary/Power.php | 33 + .../lib/Twig/Node/Expression/Binary/Range.php | 33 + .../lib/Twig/Node/Expression/Binary/Sub.php | 18 + .../Twig/Node/Expression/BlockReference.php | 51 + .../twig/lib/Twig/Node/Expression/Call.php | 178 + .../lib/Twig/Node/Expression/Conditional.php | 31 + .../lib/Twig/Node/Expression/Constant.php | 23 + .../Node/Expression/ExtensionReference.php | 33 + .../twig/lib/Twig/Node/Expression/Filter.php | 36 + .../Twig/Node/Expression/Filter/Default.php | 43 + .../lib/Twig/Node/Expression/Function.php | 35 + .../twig/lib/Twig/Node/Expression/GetAttr.php | 53 + .../lib/Twig/Node/Expression/MethodCall.php | 41 + .../twig/lib/Twig/Node/Expression/Name.php | 88 + .../twig/lib/Twig/Node/Expression/Parent.php | 47 + .../lib/Twig/Node/Expression/TempName.php | 26 + .../twig/lib/Twig/Node/Expression/Test.php | 32 + .../Twig/Node/Expression/Test/Constant.php | 46 + .../lib/Twig/Node/Expression/Test/Defined.php | 54 + .../Twig/Node/Expression/Test/Divisibleby.php | 33 + .../lib/Twig/Node/Expression/Test/Even.php | 32 + .../lib/Twig/Node/Expression/Test/Null.php | 31 + .../lib/Twig/Node/Expression/Test/Odd.php | 32 + .../lib/Twig/Node/Expression/Test/Sameas.php | 29 + .../twig/lib/Twig/Node/Expression/Unary.php | 30 + .../lib/Twig/Node/Expression/Unary/Neg.php | 18 + .../lib/Twig/Node/Expression/Unary/Not.php | 18 + .../lib/Twig/Node/Expression/Unary/Pos.php | 18 + .../vendor/twig/twig/lib/Twig/Node/Flush.php | 36 + .../vendor/twig/twig/lib/Twig/Node/For.php | 112 + .../twig/twig/lib/Twig/Node/ForLoop.php | 55 + .../vendor/twig/twig/lib/Twig/Node/If.php | 66 + .../vendor/twig/twig/lib/Twig/Node/Import.php | 50 + .../twig/twig/lib/Twig/Node/Include.php | 99 + .../vendor/twig/twig/lib/Twig/Node/Macro.php | 96 + .../vendor/twig/twig/lib/Twig/Node/Module.php | 371 + .../vendor/twig/twig/lib/Twig/Node/Print.php | 39 + .../twig/twig/lib/Twig/Node/Sandbox.php | 47 + .../twig/lib/Twig/Node/SandboxedModule.php | 60 + .../twig/lib/Twig/Node/SandboxedPrint.php | 59 + .../vendor/twig/twig/lib/Twig/Node/Set.php | 101 + .../twig/twig/lib/Twig/Node/SetTemp.php | 35 + .../twig/twig/lib/Twig/Node/Spaceless.php | 40 + .../vendor/twig/twig/lib/Twig/Node/Text.php | 39 + .../twig/twig/lib/Twig/NodeInterface.php | 30 + .../twig/lib/Twig/NodeOutputInterface.php | 19 + .../twig/twig/lib/Twig/NodeTraverser.php | 88 + .../twig/lib/Twig/NodeVisitor/Escaper.php | 167 + .../twig/lib/Twig/NodeVisitor/Optimizer.php | 246 + .../lib/Twig/NodeVisitor/SafeAnalysis.php | 131 + .../twig/lib/Twig/NodeVisitor/Sandbox.php | 92 + .../twig/lib/Twig/NodeVisitorInterface.php | 47 + .../vendor/twig/twig/lib/Twig/Parser.php | 394 + .../twig/twig/lib/Twig/ParserInterface.php | 28 + .../twig/lib/Twig/Sandbox/SecurityError.php | 19 + .../twig/lib/Twig/Sandbox/SecurityPolicy.php | 119 + .../Twig/Sandbox/SecurityPolicyInterface.php | 24 + .../twig/twig/lib/Twig/SimpleFilter.php | 94 + .../twig/twig/lib/Twig/SimpleFunction.php | 84 + .../vendor/twig/twig/lib/Twig/SimpleTest.php | 46 + .../vendor/twig/twig/lib/Twig/Template.php | 455 + .../twig/twig/lib/Twig/TemplateInterface.php | 47 + .../phpBB/vendor/twig/twig/lib/Twig/Test.php | 34 + .../twig/twig/lib/Twig/Test/Function.php | 35 + .../lib/Twig/Test/IntegrationTestCase.php | 154 + .../vendor/twig/twig/lib/Twig/Test/Method.php | 37 + .../vendor/twig/twig/lib/Twig/Test/Node.php | 37 + .../twig/twig/lib/Twig/Test/NodeTestCase.php | 58 + .../twig/lib/Twig/TestCallableInterface.php | 21 + .../twig/twig/lib/Twig/TestInterface.php | 26 + .../phpBB/vendor/twig/twig/lib/Twig/Token.php | 218 + .../vendor/twig/twig/lib/Twig/TokenParser.php | 33 + .../twig/lib/Twig/TokenParser/AutoEscape.php | 89 + .../twig/twig/lib/Twig/TokenParser/Block.php | 83 + .../twig/twig/lib/Twig/TokenParser/Do.php | 42 + .../twig/twig/lib/Twig/TokenParser/Embed.php | 66 + .../twig/lib/Twig/TokenParser/Extends.php | 52 + .../twig/twig/lib/Twig/TokenParser/Filter.php | 61 + .../twig/twig/lib/Twig/TokenParser/Flush.php | 42 + .../twig/twig/lib/Twig/TokenParser/For.php | 136 + .../twig/twig/lib/Twig/TokenParser/From.php | 74 + .../twig/twig/lib/Twig/TokenParser/If.php | 94 + .../twig/twig/lib/Twig/TokenParser/Import.php | 49 + .../twig/lib/Twig/TokenParser/Include.php | 80 + .../twig/twig/lib/Twig/TokenParser/Macro.php | 68 + .../twig/lib/Twig/TokenParser/Sandbox.php | 68 + .../twig/twig/lib/Twig/TokenParser/Set.php | 84 + .../twig/lib/Twig/TokenParser/Spaceless.php | 59 + .../twig/twig/lib/Twig/TokenParser/Use.php | 82 + .../twig/twig/lib/Twig/TokenParserBroker.php | 136 + .../lib/Twig/TokenParserBrokerInterface.php | 45 + .../twig/lib/Twig/TokenParserInterface.php | 41 + .../vendor/twig/twig/lib/Twig/TokenStream.php | 144 + sources/phpBB/viewforum.php | 930 + sources/phpBB/viewonline.php | 485 + sources/phpBB/viewtopic.php | 2177 + sources/phpBB/web.config | 27 + 1943 files changed, 370165 insertions(+) create mode 100644 sources/phpBB/.htaccess create mode 100644 sources/phpBB/adm/images/alert_close.png create mode 100644 sources/phpBB/adm/images/arrow_down.gif create mode 100644 sources/phpBB/adm/images/arrow_left.gif create mode 100644 sources/phpBB/adm/images/arrow_right.gif create mode 100644 sources/phpBB/adm/images/arrow_up.gif create mode 100644 sources/phpBB/adm/images/bg_button.gif create mode 100644 sources/phpBB/adm/images/bg_hash1.gif create mode 100644 sources/phpBB/adm/images/bg_hash2.gif create mode 100644 sources/phpBB/adm/images/bg_hash3.gif create mode 100644 sources/phpBB/adm/images/bg_hash4.gif create mode 100644 sources/phpBB/adm/images/bg_header.gif create mode 100644 sources/phpBB/adm/images/bg_header.jpg create mode 100644 sources/phpBB/adm/images/bg_tabs_alt1.gif create mode 100644 sources/phpBB/adm/images/bg_tabs_alt2.gif create mode 100644 sources/phpBB/adm/images/cellpic3.gif create mode 100644 sources/phpBB/adm/images/file_conflict.gif create mode 100644 sources/phpBB/adm/images/file_modified.gif create mode 100644 sources/phpBB/adm/images/file_new.gif create mode 100644 sources/phpBB/adm/images/file_new_conflict.gif create mode 100644 sources/phpBB/adm/images/file_not_modified.gif create mode 100644 sources/phpBB/adm/images/file_up_to_date.gif create mode 100644 sources/phpBB/adm/images/gradient2b.gif create mode 100644 sources/phpBB/adm/images/icon_delete.gif create mode 100644 sources/phpBB/adm/images/icon_delete_disabled.gif create mode 100644 sources/phpBB/adm/images/icon_down.gif create mode 100644 sources/phpBB/adm/images/icon_down_disabled.gif create mode 100644 sources/phpBB/adm/images/icon_edit.gif create mode 100644 sources/phpBB/adm/images/icon_edit_disabled.gif create mode 100644 sources/phpBB/adm/images/icon_folder.gif create mode 100644 sources/phpBB/adm/images/icon_folder_link.gif create mode 100644 sources/phpBB/adm/images/icon_folder_lock.gif create mode 100644 sources/phpBB/adm/images/icon_subfolder.gif create mode 100644 sources/phpBB/adm/images/icon_sync.gif create mode 100644 sources/phpBB/adm/images/icon_sync_disabled.gif create mode 100644 sources/phpBB/adm/images/icon_trace.gif create mode 100644 sources/phpBB/adm/images/icon_up.gif create mode 100644 sources/phpBB/adm/images/icon_up_disabled.gif create mode 100644 sources/phpBB/adm/images/innerbox_bg.gif create mode 100644 sources/phpBB/adm/images/loading.gif create mode 100644 sources/phpBB/adm/images/no_avatar.gif create mode 100644 sources/phpBB/adm/images/no_image.png create mode 100644 sources/phpBB/adm/images/phpbb_logo.png create mode 100644 sources/phpBB/adm/images/progress_bar.gif create mode 100644 sources/phpBB/adm/images/spacer.gif create mode 100644 sources/phpBB/adm/index.php create mode 100644 sources/phpBB/adm/style/acp_attachments.html create mode 100644 sources/phpBB/adm/style/acp_avatar_options_gravatar.html create mode 100644 sources/phpBB/adm/style/acp_avatar_options_local.html create mode 100644 sources/phpBB/adm/style/acp_avatar_options_remote.html create mode 100644 sources/phpBB/adm/style/acp_avatar_options_upload.html create mode 100644 sources/phpBB/adm/style/acp_ban.html create mode 100644 sources/phpBB/adm/style/acp_bbcodes.html create mode 100644 sources/phpBB/adm/style/acp_board.html create mode 100644 sources/phpBB/adm/style/acp_bots.html create mode 100644 sources/phpBB/adm/style/acp_captcha.html create mode 100644 sources/phpBB/adm/style/acp_contact.html create mode 100644 sources/phpBB/adm/style/acp_database.html create mode 100644 sources/phpBB/adm/style/acp_disallow.html create mode 100644 sources/phpBB/adm/style/acp_email.html create mode 100644 sources/phpBB/adm/style/acp_ext_delete_data.html create mode 100644 sources/phpBB/adm/style/acp_ext_details.html create mode 100644 sources/phpBB/adm/style/acp_ext_disable.html create mode 100644 sources/phpBB/adm/style/acp_ext_enable.html create mode 100644 sources/phpBB/adm/style/acp_ext_list.html create mode 100644 sources/phpBB/adm/style/acp_forums.html create mode 100644 sources/phpBB/adm/style/acp_forums_copy_perm.html create mode 100644 sources/phpBB/adm/style/acp_groups.html create mode 100644 sources/phpBB/adm/style/acp_groups_position.html create mode 100644 sources/phpBB/adm/style/acp_icons.html create mode 100644 sources/phpBB/adm/style/acp_inactive.html create mode 100644 sources/phpBB/adm/style/acp_jabber.html create mode 100644 sources/phpBB/adm/style/acp_language.html create mode 100644 sources/phpBB/adm/style/acp_logs.html create mode 100644 sources/phpBB/adm/style/acp_main.html create mode 100644 sources/phpBB/adm/style/acp_modules.html create mode 100644 sources/phpBB/adm/style/acp_permission_roles.html create mode 100644 sources/phpBB/adm/style/acp_permissions.html create mode 100644 sources/phpBB/adm/style/acp_php_info.html create mode 100644 sources/phpBB/adm/style/acp_posting_buttons.html create mode 100644 sources/phpBB/adm/style/acp_profile.html create mode 100644 sources/phpBB/adm/style/acp_prune_forums.html create mode 100644 sources/phpBB/adm/style/acp_prune_users.html create mode 100644 sources/phpBB/adm/style/acp_ranks.html create mode 100644 sources/phpBB/adm/style/acp_reasons.html create mode 100644 sources/phpBB/adm/style/acp_search.html create mode 100644 sources/phpBB/adm/style/acp_send_statistics.html create mode 100644 sources/phpBB/adm/style/acp_styles.html create mode 100644 sources/phpBB/adm/style/acp_update.html create mode 100644 sources/phpBB/adm/style/acp_users.html create mode 100644 sources/phpBB/adm/style/acp_users_avatar.html create mode 100644 sources/phpBB/adm/style/acp_users_feedback.html create mode 100644 sources/phpBB/adm/style/acp_users_overview.html create mode 100644 sources/phpBB/adm/style/acp_users_prefs.html create mode 100644 sources/phpBB/adm/style/acp_users_profile.html create mode 100644 sources/phpBB/adm/style/acp_users_signature.html create mode 100644 sources/phpBB/adm/style/acp_users_warnings.html create mode 100644 sources/phpBB/adm/style/acp_words.html create mode 100644 sources/phpBB/adm/style/admin.css create mode 100644 sources/phpBB/adm/style/admin.js create mode 100644 sources/phpBB/adm/style/ajax.js create mode 100644 sources/phpBB/adm/style/auth_provider_ldap.html create mode 100644 sources/phpBB/adm/style/auth_provider_oauth.html create mode 100644 sources/phpBB/adm/style/captcha_default_acp_demo.html create mode 100644 sources/phpBB/adm/style/captcha_gd_acp.html create mode 100644 sources/phpBB/adm/style/captcha_qa_acp.html create mode 100644 sources/phpBB/adm/style/captcha_qa_acp_demo.html create mode 100644 sources/phpBB/adm/style/captcha_recaptcha.html create mode 100644 sources/phpBB/adm/style/captcha_recaptcha_acp.html create mode 100644 sources/phpBB/adm/style/confirm_bbcode.html create mode 100644 sources/phpBB/adm/style/confirm_body.html create mode 100644 sources/phpBB/adm/style/confirm_body_prune.html create mode 100644 sources/phpBB/adm/style/install_convert.html create mode 100644 sources/phpBB/adm/style/install_error.html create mode 100644 sources/phpBB/adm/style/install_footer.html create mode 100644 sources/phpBB/adm/style/install_header.html create mode 100644 sources/phpBB/adm/style/install_install.html create mode 100644 sources/phpBB/adm/style/install_main.html create mode 100644 sources/phpBB/adm/style/install_update.html create mode 100644 sources/phpBB/adm/style/install_update_diff.html create mode 100644 sources/phpBB/adm/style/message_body.html create mode 100644 sources/phpBB/adm/style/overall_footer.html create mode 100644 sources/phpBB/adm/style/overall_header.html create mode 100644 sources/phpBB/adm/style/pagination.html create mode 100644 sources/phpBB/adm/style/permission_forum_copy.html create mode 100644 sources/phpBB/adm/style/permission_mask.html create mode 100644 sources/phpBB/adm/style/permission_roles_mask.html create mode 100644 sources/phpBB/adm/style/permission_trace.html create mode 100644 sources/phpBB/adm/style/permissions.js create mode 100644 sources/phpBB/adm/style/profilefields/bool.html create mode 100644 sources/phpBB/adm/style/profilefields/date.html create mode 100644 sources/phpBB/adm/style/profilefields/dropdown.html create mode 100644 sources/phpBB/adm/style/profilefields/int.html create mode 100644 sources/phpBB/adm/style/profilefields/string.html create mode 100644 sources/phpBB/adm/style/profilefields/text.html create mode 100644 sources/phpBB/adm/style/profilefields/url.html create mode 100644 sources/phpBB/adm/style/progress_bar.html create mode 100644 sources/phpBB/adm/style/simple_body.html create mode 100644 sources/phpBB/adm/style/simple_footer.html create mode 100644 sources/phpBB/adm/style/simple_header.html create mode 100644 sources/phpBB/adm/style/timezone.js create mode 100644 sources/phpBB/adm/style/timezone_option.html create mode 100644 sources/phpBB/adm/style/tooltip.js create mode 100644 sources/phpBB/app.php create mode 100644 sources/phpBB/assets/javascript/core.js create mode 100644 sources/phpBB/assets/javascript/editor.js create mode 100644 sources/phpBB/assets/javascript/jquery.min.js create mode 100644 sources/phpBB/assets/javascript/plupload.js create mode 100644 sources/phpBB/assets/plupload/plupload.full.min.js create mode 100644 sources/phpBB/bin/phpbbcli.php create mode 100644 sources/phpBB/cache/.htaccess create mode 100644 sources/phpBB/cache/index.htm create mode 100644 sources/phpBB/common.php create mode 100644 sources/phpBB/composer.json create mode 100644 sources/phpBB/composer.lock create mode 100644 sources/phpBB/config.php create mode 100644 sources/phpBB/config/.htaccess create mode 100644 sources/phpBB/config/auth.yml create mode 100644 sources/phpBB/config/avatar.yml create mode 100644 sources/phpBB/config/captcha.yml create mode 100644 sources/phpBB/config/console.yml create mode 100644 sources/phpBB/config/content.yml create mode 100644 sources/phpBB/config/cron.yml create mode 100644 sources/phpBB/config/db.yml create mode 100644 sources/phpBB/config/event.yml create mode 100644 sources/phpBB/config/feed.yml create mode 100644 sources/phpBB/config/mimetype_guesser.yml create mode 100644 sources/phpBB/config/notification.yml create mode 100644 sources/phpBB/config/parameters.yml create mode 100644 sources/phpBB/config/password.yml create mode 100644 sources/phpBB/config/profilefield.yml create mode 100644 sources/phpBB/config/routing.yml create mode 100644 sources/phpBB/config/services.yml create mode 100644 sources/phpBB/config/tables.yml create mode 100644 sources/phpBB/config/user.yml create mode 100644 sources/phpBB/cron.php create mode 100644 sources/phpBB/docs/CHANGELOG.html create mode 100644 sources/phpBB/docs/CREDITS.txt create mode 100644 sources/phpBB/docs/FAQ.html create mode 100644 sources/phpBB/docs/INSTALL.html create mode 100644 sources/phpBB/docs/LICENSE.txt create mode 100644 sources/phpBB/docs/README.html create mode 100644 sources/phpBB/docs/auth_api.html create mode 100644 sources/phpBB/docs/bg_header.gif create mode 100644 sources/phpBB/docs/coding-guidelines.html create mode 100644 sources/phpBB/docs/corners_left.gif create mode 100644 sources/phpBB/docs/corners_left.png create mode 100644 sources/phpBB/docs/corners_right.gif create mode 100644 sources/phpBB/docs/corners_right.png create mode 100644 sources/phpBB/docs/events.md create mode 100644 sources/phpBB/docs/lighttpd.sample.conf create mode 100644 sources/phpBB/docs/nginx.sample.conf create mode 100644 sources/phpBB/docs/site_logo.gif create mode 100644 sources/phpBB/docs/sphinx.sample.conf create mode 100644 sources/phpBB/docs/stylesheet.css create mode 100644 sources/phpBB/download/file.php create mode 100644 sources/phpBB/download/index.htm create mode 100644 sources/phpBB/ext/index.htm create mode 100644 sources/phpBB/faq.php create mode 100644 sources/phpBB/feed.php create mode 100644 sources/phpBB/files/.htaccess create mode 100644 sources/phpBB/files/index.htm create mode 100644 sources/phpBB/images/avatars/gallery/index.htm create mode 100644 sources/phpBB/images/avatars/index.htm create mode 100644 sources/phpBB/images/avatars/upload/.htaccess create mode 100644 sources/phpBB/images/avatars/upload/index.htm create mode 100644 sources/phpBB/images/icons/index.htm create mode 100644 sources/phpBB/images/icons/misc/fire.gif create mode 100644 sources/phpBB/images/icons/misc/heart.gif create mode 100644 sources/phpBB/images/icons/misc/index.htm create mode 100644 sources/phpBB/images/icons/misc/radioactive.gif create mode 100644 sources/phpBB/images/icons/misc/star.gif create mode 100644 sources/phpBB/images/icons/misc/thinking.gif create mode 100644 sources/phpBB/images/icons/smile/alert.gif create mode 100644 sources/phpBB/images/icons/smile/index.htm create mode 100644 sources/phpBB/images/icons/smile/info.gif create mode 100644 sources/phpBB/images/icons/smile/mrgreen.gif create mode 100644 sources/phpBB/images/icons/smile/question.gif create mode 100644 sources/phpBB/images/icons/smile/redface.gif create mode 100644 sources/phpBB/images/index.htm create mode 100644 sources/phpBB/images/ranks/index.htm create mode 100644 sources/phpBB/images/smilies/icon_arrow.gif create mode 100644 sources/phpBB/images/smilies/icon_cool.gif create mode 100644 sources/phpBB/images/smilies/icon_cry.gif create mode 100644 sources/phpBB/images/smilies/icon_e_biggrin.gif create mode 100644 sources/phpBB/images/smilies/icon_e_confused.gif create mode 100644 sources/phpBB/images/smilies/icon_e_geek.gif create mode 100644 sources/phpBB/images/smilies/icon_e_sad.gif create mode 100644 sources/phpBB/images/smilies/icon_e_smile.gif create mode 100644 sources/phpBB/images/smilies/icon_e_surprised.gif create mode 100644 sources/phpBB/images/smilies/icon_e_ugeek.gif create mode 100644 sources/phpBB/images/smilies/icon_e_wink.gif create mode 100644 sources/phpBB/images/smilies/icon_eek.gif create mode 100644 sources/phpBB/images/smilies/icon_evil.gif create mode 100644 sources/phpBB/images/smilies/icon_exclaim.gif create mode 100644 sources/phpBB/images/smilies/icon_idea.gif create mode 100644 sources/phpBB/images/smilies/icon_lol.gif create mode 100644 sources/phpBB/images/smilies/icon_mad.gif create mode 100644 sources/phpBB/images/smilies/icon_mrgreen.gif create mode 100644 sources/phpBB/images/smilies/icon_neutral.gif create mode 100644 sources/phpBB/images/smilies/icon_question.gif create mode 100644 sources/phpBB/images/smilies/icon_razz.gif create mode 100644 sources/phpBB/images/smilies/icon_redface.gif create mode 100644 sources/phpBB/images/smilies/icon_rolleyes.gif create mode 100644 sources/phpBB/images/smilies/icon_twisted.gif create mode 100644 sources/phpBB/images/spacer.gif create mode 100644 sources/phpBB/images/upload_icons/avi.gif create mode 100644 sources/phpBB/images/upload_icons/bmp.gif create mode 100644 sources/phpBB/images/upload_icons/doc.gif create mode 100644 sources/phpBB/images/upload_icons/exe.gif create mode 100644 sources/phpBB/images/upload_icons/flash.gif create mode 100644 sources/phpBB/images/upload_icons/gif.gif create mode 100644 sources/phpBB/images/upload_icons/html.gif create mode 100644 sources/phpBB/images/upload_icons/jpg.gif create mode 100644 sources/phpBB/images/upload_icons/mid.gif create mode 100644 sources/phpBB/images/upload_icons/mov.gif create mode 100644 sources/phpBB/images/upload_icons/mp3.gif create mode 100644 sources/phpBB/images/upload_icons/mpg.gif create mode 100644 sources/phpBB/images/upload_icons/netscape.gif create mode 100644 sources/phpBB/images/upload_icons/pdf.gif create mode 100644 sources/phpBB/images/upload_icons/ppt.gif create mode 100644 sources/phpBB/images/upload_icons/rar.gif create mode 100644 sources/phpBB/images/upload_icons/txt.gif create mode 100644 sources/phpBB/images/upload_icons/wav.gif create mode 100644 sources/phpBB/images/upload_icons/xls.gif create mode 100644 sources/phpBB/images/upload_icons/zip.gif create mode 100644 sources/phpBB/includes/.htaccess create mode 100644 sources/phpBB/includes/acp/acp_attachments.php create mode 100644 sources/phpBB/includes/acp/acp_ban.php create mode 100644 sources/phpBB/includes/acp/acp_bbcodes.php create mode 100644 sources/phpBB/includes/acp/acp_board.php create mode 100644 sources/phpBB/includes/acp/acp_bots.php create mode 100644 sources/phpBB/includes/acp/acp_captcha.php create mode 100644 sources/phpBB/includes/acp/acp_contact.php create mode 100644 sources/phpBB/includes/acp/acp_database.php create mode 100644 sources/phpBB/includes/acp/acp_disallow.php create mode 100644 sources/phpBB/includes/acp/acp_email.php create mode 100644 sources/phpBB/includes/acp/acp_extensions.php create mode 100644 sources/phpBB/includes/acp/acp_forums.php create mode 100644 sources/phpBB/includes/acp/acp_groups.php create mode 100644 sources/phpBB/includes/acp/acp_icons.php create mode 100644 sources/phpBB/includes/acp/acp_inactive.php create mode 100644 sources/phpBB/includes/acp/acp_jabber.php create mode 100644 sources/phpBB/includes/acp/acp_language.php create mode 100644 sources/phpBB/includes/acp/acp_logs.php create mode 100644 sources/phpBB/includes/acp/acp_main.php create mode 100644 sources/phpBB/includes/acp/acp_modules.php create mode 100644 sources/phpBB/includes/acp/acp_permission_roles.php create mode 100644 sources/phpBB/includes/acp/acp_permissions.php create mode 100644 sources/phpBB/includes/acp/acp_php_info.php create mode 100644 sources/phpBB/includes/acp/acp_profile.php create mode 100644 sources/phpBB/includes/acp/acp_prune.php create mode 100644 sources/phpBB/includes/acp/acp_ranks.php create mode 100644 sources/phpBB/includes/acp/acp_reasons.php create mode 100644 sources/phpBB/includes/acp/acp_search.php create mode 100644 sources/phpBB/includes/acp/acp_send_statistics.php create mode 100644 sources/phpBB/includes/acp/acp_styles.php create mode 100644 sources/phpBB/includes/acp/acp_update.php create mode 100644 sources/phpBB/includes/acp/acp_users.php create mode 100644 sources/phpBB/includes/acp/acp_words.php create mode 100644 sources/phpBB/includes/acp/auth.php create mode 100644 sources/phpBB/includes/acp/info/acp_attachments.php create mode 100644 sources/phpBB/includes/acp/info/acp_ban.php create mode 100644 sources/phpBB/includes/acp/info/acp_bbcodes.php create mode 100644 sources/phpBB/includes/acp/info/acp_board.php create mode 100644 sources/phpBB/includes/acp/info/acp_bots.php create mode 100644 sources/phpBB/includes/acp/info/acp_captcha.php create mode 100644 sources/phpBB/includes/acp/info/acp_contact.php create mode 100644 sources/phpBB/includes/acp/info/acp_database.php create mode 100644 sources/phpBB/includes/acp/info/acp_disallow.php create mode 100644 sources/phpBB/includes/acp/info/acp_email.php create mode 100644 sources/phpBB/includes/acp/info/acp_extensions.php create mode 100644 sources/phpBB/includes/acp/info/acp_forums.php create mode 100644 sources/phpBB/includes/acp/info/acp_groups.php create mode 100644 sources/phpBB/includes/acp/info/acp_icons.php create mode 100644 sources/phpBB/includes/acp/info/acp_inactive.php create mode 100644 sources/phpBB/includes/acp/info/acp_jabber.php create mode 100644 sources/phpBB/includes/acp/info/acp_language.php create mode 100644 sources/phpBB/includes/acp/info/acp_logs.php create mode 100644 sources/phpBB/includes/acp/info/acp_main.php create mode 100644 sources/phpBB/includes/acp/info/acp_modules.php create mode 100644 sources/phpBB/includes/acp/info/acp_permission_roles.php create mode 100644 sources/phpBB/includes/acp/info/acp_permissions.php create mode 100644 sources/phpBB/includes/acp/info/acp_php_info.php create mode 100644 sources/phpBB/includes/acp/info/acp_profile.php create mode 100644 sources/phpBB/includes/acp/info/acp_prune.php create mode 100644 sources/phpBB/includes/acp/info/acp_ranks.php create mode 100644 sources/phpBB/includes/acp/info/acp_reasons.php create mode 100644 sources/phpBB/includes/acp/info/acp_search.php create mode 100644 sources/phpBB/includes/acp/info/acp_send_statistics.php create mode 100644 sources/phpBB/includes/acp/info/acp_styles.php create mode 100644 sources/phpBB/includes/acp/info/acp_update.php create mode 100644 sources/phpBB/includes/acp/info/acp_users.php create mode 100644 sources/phpBB/includes/acp/info/acp_words.php create mode 100644 sources/phpBB/includes/bbcode.php create mode 100644 sources/phpBB/includes/compatibility_globals.php create mode 100644 sources/phpBB/includes/constants.php create mode 100644 sources/phpBB/includes/diff/diff.php create mode 100644 sources/phpBB/includes/diff/engine.php create mode 100644 sources/phpBB/includes/diff/renderer.php create mode 100644 sources/phpBB/includes/functions.php create mode 100644 sources/phpBB/includes/functions_acp.php create mode 100644 sources/phpBB/includes/functions_admin.php create mode 100644 sources/phpBB/includes/functions_compatibility.php create mode 100644 sources/phpBB/includes/functions_compress.php create mode 100644 sources/phpBB/includes/functions_content.php create mode 100644 sources/phpBB/includes/functions_convert.php create mode 100644 sources/phpBB/includes/functions_database_helper.php create mode 100644 sources/phpBB/includes/functions_display.php create mode 100644 sources/phpBB/includes/functions_download.php create mode 100644 sources/phpBB/includes/functions_install.php create mode 100644 sources/phpBB/includes/functions_jabber.php create mode 100644 sources/phpBB/includes/functions_mcp.php create mode 100644 sources/phpBB/includes/functions_messenger.php create mode 100644 sources/phpBB/includes/functions_module.php create mode 100644 sources/phpBB/includes/functions_posting.php create mode 100644 sources/phpBB/includes/functions_privmsgs.php create mode 100644 sources/phpBB/includes/functions_transfer.php create mode 100644 sources/phpBB/includes/functions_upload.php create mode 100644 sources/phpBB/includes/functions_url_matcher.php create mode 100644 sources/phpBB/includes/functions_user.php create mode 100644 sources/phpBB/includes/hooks/index.php create mode 100644 sources/phpBB/includes/index.htm create mode 100644 sources/phpBB/includes/mcp/info/mcp_ban.php create mode 100644 sources/phpBB/includes/mcp/info/mcp_logs.php create mode 100644 sources/phpBB/includes/mcp/info/mcp_main.php create mode 100644 sources/phpBB/includes/mcp/info/mcp_notes.php create mode 100644 sources/phpBB/includes/mcp/info/mcp_pm_reports.php create mode 100644 sources/phpBB/includes/mcp/info/mcp_queue.php create mode 100644 sources/phpBB/includes/mcp/info/mcp_reports.php create mode 100644 sources/phpBB/includes/mcp/info/mcp_warn.php create mode 100644 sources/phpBB/includes/mcp/mcp_ban.php create mode 100644 sources/phpBB/includes/mcp/mcp_forum.php create mode 100644 sources/phpBB/includes/mcp/mcp_front.php create mode 100644 sources/phpBB/includes/mcp/mcp_logs.php create mode 100644 sources/phpBB/includes/mcp/mcp_main.php create mode 100644 sources/phpBB/includes/mcp/mcp_notes.php create mode 100644 sources/phpBB/includes/mcp/mcp_pm_reports.php create mode 100644 sources/phpBB/includes/mcp/mcp_post.php create mode 100644 sources/phpBB/includes/mcp/mcp_queue.php create mode 100644 sources/phpBB/includes/mcp/mcp_reports.php create mode 100644 sources/phpBB/includes/mcp/mcp_topic.php create mode 100644 sources/phpBB/includes/mcp/mcp_warn.php create mode 100644 sources/phpBB/includes/message_parser.php create mode 100644 sources/phpBB/includes/questionnaire/questionnaire.php create mode 100644 sources/phpBB/includes/sphinxapi.php create mode 100644 sources/phpBB/includes/startup.php create mode 100644 sources/phpBB/includes/ucp/info/ucp_attachments.php create mode 100644 sources/phpBB/includes/ucp/info/ucp_auth_link.php create mode 100644 sources/phpBB/includes/ucp/info/ucp_groups.php create mode 100644 sources/phpBB/includes/ucp/info/ucp_main.php create mode 100644 sources/phpBB/includes/ucp/info/ucp_notifications.php create mode 100644 sources/phpBB/includes/ucp/info/ucp_pm.php create mode 100644 sources/phpBB/includes/ucp/info/ucp_prefs.php create mode 100644 sources/phpBB/includes/ucp/info/ucp_profile.php create mode 100644 sources/phpBB/includes/ucp/info/ucp_zebra.php create mode 100644 sources/phpBB/includes/ucp/ucp_activate.php create mode 100644 sources/phpBB/includes/ucp/ucp_attachments.php create mode 100644 sources/phpBB/includes/ucp/ucp_auth_link.php create mode 100644 sources/phpBB/includes/ucp/ucp_confirm.php create mode 100644 sources/phpBB/includes/ucp/ucp_groups.php create mode 100644 sources/phpBB/includes/ucp/ucp_login_link.php create mode 100644 sources/phpBB/includes/ucp/ucp_main.php create mode 100644 sources/phpBB/includes/ucp/ucp_notifications.php create mode 100644 sources/phpBB/includes/ucp/ucp_pm.php create mode 100644 sources/phpBB/includes/ucp/ucp_pm_compose.php create mode 100644 sources/phpBB/includes/ucp/ucp_pm_options.php create mode 100644 sources/phpBB/includes/ucp/ucp_pm_viewfolder.php create mode 100644 sources/phpBB/includes/ucp/ucp_pm_viewmessage.php create mode 100644 sources/phpBB/includes/ucp/ucp_prefs.php create mode 100644 sources/phpBB/includes/ucp/ucp_profile.php create mode 100644 sources/phpBB/includes/ucp/ucp_register.php create mode 100644 sources/phpBB/includes/ucp/ucp_remind.php create mode 100644 sources/phpBB/includes/ucp/ucp_resend.php create mode 100644 sources/phpBB/includes/ucp/ucp_zebra.php create mode 100644 sources/phpBB/includes/utf/data/case_fold_c.php create mode 100644 sources/phpBB/includes/utf/data/case_fold_f.php create mode 100644 sources/phpBB/includes/utf/data/case_fold_s.php create mode 100644 sources/phpBB/includes/utf/data/confusables.php create mode 100644 sources/phpBB/includes/utf/data/recode_basic.php create mode 100644 sources/phpBB/includes/utf/data/recode_cjk.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_0.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_1.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_19.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_2.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_20.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_21.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_26.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_3.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_31.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_32.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_33.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_36.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_4.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_448.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_5.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_58.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_6.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_64.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_84.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_9.php create mode 100644 sources/phpBB/includes/utf/data/search_indexer_95.php create mode 100644 sources/phpBB/includes/utf/data/utf_canonical_comp.php create mode 100644 sources/phpBB/includes/utf/data/utf_canonical_decomp.php create mode 100644 sources/phpBB/includes/utf/data/utf_compatibility_decomp.php create mode 100644 sources/phpBB/includes/utf/data/utf_nfc_qc.php create mode 100644 sources/phpBB/includes/utf/data/utf_nfkc_qc.php create mode 100644 sources/phpBB/includes/utf/data/utf_normalizer_common.php create mode 100644 sources/phpBB/includes/utf/utf_normalizer.php create mode 100644 sources/phpBB/includes/utf/utf_tools.php create mode 100644 sources/phpBB/index.php create mode 100644 sources/phpBB/install/convertors/convert_phpbb20.php create mode 100644 sources/phpBB/install/convertors/functions_phpbb20.php create mode 100644 sources/phpBB/install/database_update.php create mode 100644 sources/phpBB/install/index.php create mode 100644 sources/phpBB/install/install_convert.php create mode 100644 sources/phpBB/install/install_install.php create mode 100644 sources/phpBB/install/install_main.php create mode 100644 sources/phpBB/install/phpinfo.php create mode 100644 sources/phpBB/install/schemas/index.htm create mode 100644 sources/phpBB/install/schemas/oracle_schema.sql create mode 100644 sources/phpBB/install/schemas/postgres_schema.sql create mode 100644 sources/phpBB/install/schemas/schema_data.sql create mode 100644 sources/phpBB/language/en/acp/attachments.php create mode 100644 sources/phpBB/language/en/acp/ban.php create mode 100644 sources/phpBB/language/en/acp/board.php create mode 100644 sources/phpBB/language/en/acp/bots.php create mode 100644 sources/phpBB/language/en/acp/common.php create mode 100644 sources/phpBB/language/en/acp/database.php create mode 100644 sources/phpBB/language/en/acp/email.php create mode 100644 sources/phpBB/language/en/acp/extensions.php create mode 100644 sources/phpBB/language/en/acp/forums.php create mode 100644 sources/phpBB/language/en/acp/groups.php create mode 100644 sources/phpBB/language/en/acp/index.htm create mode 100644 sources/phpBB/language/en/acp/language.php create mode 100644 sources/phpBB/language/en/acp/modules.php create mode 100644 sources/phpBB/language/en/acp/permissions.php create mode 100644 sources/phpBB/language/en/acp/permissions_phpbb.php create mode 100644 sources/phpBB/language/en/acp/posting.php create mode 100644 sources/phpBB/language/en/acp/profile.php create mode 100644 sources/phpBB/language/en/acp/prune.php create mode 100644 sources/phpBB/language/en/acp/search.php create mode 100644 sources/phpBB/language/en/acp/styles.php create mode 100644 sources/phpBB/language/en/acp/users.php create mode 100644 sources/phpBB/language/en/app.php create mode 100644 sources/phpBB/language/en/captcha_qa.php create mode 100644 sources/phpBB/language/en/captcha_recaptcha.php create mode 100644 sources/phpBB/language/en/cli.php create mode 100644 sources/phpBB/language/en/common.php create mode 100644 sources/phpBB/language/en/email/admin_activate.txt create mode 100644 sources/phpBB/language/en/email/admin_send_email.txt create mode 100644 sources/phpBB/language/en/email/admin_welcome_activated.txt create mode 100644 sources/phpBB/language/en/email/admin_welcome_inactive.txt create mode 100644 sources/phpBB/language/en/email/bookmark.txt create mode 100644 sources/phpBB/language/en/email/contact_admin.txt create mode 100644 sources/phpBB/language/en/email/coppa_resend_inactive.txt create mode 100644 sources/phpBB/language/en/email/coppa_welcome_inactive.txt create mode 100644 sources/phpBB/language/en/email/email_notify.txt create mode 100644 sources/phpBB/language/en/email/forum_notify.txt create mode 100644 sources/phpBB/language/en/email/group_added.txt create mode 100644 sources/phpBB/language/en/email/group_request.txt create mode 100644 sources/phpBB/language/en/email/index.htm create mode 100644 sources/phpBB/language/en/email/installed.txt create mode 100644 sources/phpBB/language/en/email/newtopic_notify.txt create mode 100644 sources/phpBB/language/en/email/pm_report_closed.txt create mode 100644 sources/phpBB/language/en/email/pm_report_deleted.txt create mode 100644 sources/phpBB/language/en/email/post_approved.txt create mode 100644 sources/phpBB/language/en/email/post_disapproved.txt create mode 100644 sources/phpBB/language/en/email/post_in_queue.txt create mode 100644 sources/phpBB/language/en/email/privmsg_notify.txt create mode 100644 sources/phpBB/language/en/email/profile_send_email.txt create mode 100644 sources/phpBB/language/en/email/profile_send_im.txt create mode 100644 sources/phpBB/language/en/email/quote.txt create mode 100644 sources/phpBB/language/en/email/report_closed.txt create mode 100644 sources/phpBB/language/en/email/report_deleted.txt create mode 100644 sources/phpBB/language/en/email/report_pm.txt create mode 100644 sources/phpBB/language/en/email/report_post.txt create mode 100644 sources/phpBB/language/en/email/short/bookmark.txt create mode 100644 sources/phpBB/language/en/email/short/newtopic_notify.txt create mode 100644 sources/phpBB/language/en/email/short/post_approved.txt create mode 100644 sources/phpBB/language/en/email/short/post_disapproved.txt create mode 100644 sources/phpBB/language/en/email/short/post_in_queue.txt create mode 100644 sources/phpBB/language/en/email/short/privmsg_notify.txt create mode 100644 sources/phpBB/language/en/email/short/quote.txt create mode 100644 sources/phpBB/language/en/email/short/report_pm.txt create mode 100644 sources/phpBB/language/en/email/short/report_post.txt create mode 100644 sources/phpBB/language/en/email/short/topic_approved.txt create mode 100644 sources/phpBB/language/en/email/short/topic_disapproved.txt create mode 100644 sources/phpBB/language/en/email/short/topic_in_queue.txt create mode 100644 sources/phpBB/language/en/email/short/topic_notify.txt create mode 100644 sources/phpBB/language/en/email/topic_approved.txt create mode 100644 sources/phpBB/language/en/email/topic_disapproved.txt create mode 100644 sources/phpBB/language/en/email/topic_in_queue.txt create mode 100644 sources/phpBB/language/en/email/topic_notify.txt create mode 100644 sources/phpBB/language/en/email/user_activate.txt create mode 100644 sources/phpBB/language/en/email/user_activate_inactive.txt create mode 100644 sources/phpBB/language/en/email/user_activate_passwd.txt create mode 100644 sources/phpBB/language/en/email/user_reactivate_account.txt create mode 100644 sources/phpBB/language/en/email/user_remind_inactive.txt create mode 100644 sources/phpBB/language/en/email/user_resend_inactive.txt create mode 100644 sources/phpBB/language/en/email/user_welcome.txt create mode 100644 sources/phpBB/language/en/email/user_welcome_inactive.txt create mode 100644 sources/phpBB/language/en/groups.php create mode 100644 sources/phpBB/language/en/help_bbcode.php create mode 100644 sources/phpBB/language/en/help_faq.php create mode 100644 sources/phpBB/language/en/index.htm create mode 100644 sources/phpBB/language/en/install.php create mode 100644 sources/phpBB/language/en/iso.txt create mode 100644 sources/phpBB/language/en/mcp.php create mode 100644 sources/phpBB/language/en/memberlist.php create mode 100644 sources/phpBB/language/en/migrator.php create mode 100644 sources/phpBB/language/en/plupload.php create mode 100644 sources/phpBB/language/en/posting.php create mode 100644 sources/phpBB/language/en/search.php create mode 100644 sources/phpBB/language/en/search_ignore_words.php create mode 100644 sources/phpBB/language/en/search_synonyms.php create mode 100644 sources/phpBB/language/en/ucp.php create mode 100644 sources/phpBB/language/en/viewforum.php create mode 100644 sources/phpBB/language/en/viewtopic.php create mode 100644 sources/phpBB/language/index.htm create mode 100644 sources/phpBB/mcp.php create mode 100644 sources/phpBB/memberlist.php create mode 100644 sources/phpBB/phpbb/auth/auth.php create mode 100644 sources/phpBB/phpbb/auth/index.htm create mode 100644 sources/phpBB/phpbb/auth/provider/apache.php create mode 100644 sources/phpBB/phpbb/auth/provider/base.php create mode 100644 sources/phpBB/phpbb/auth/provider/db.php create mode 100644 sources/phpBB/phpbb/auth/provider/index.htm create mode 100644 sources/phpBB/phpbb/auth/provider/ldap.php create mode 100644 sources/phpBB/phpbb/auth/provider/oauth/oauth.php create mode 100644 sources/phpBB/phpbb/auth/provider/oauth/service/base.php create mode 100644 sources/phpBB/phpbb/auth/provider/oauth/service/bitly.php create mode 100644 sources/phpBB/phpbb/auth/provider/oauth/service/exception.php create mode 100644 sources/phpBB/phpbb/auth/provider/oauth/service/facebook.php create mode 100644 sources/phpBB/phpbb/auth/provider/oauth/service/google.php create mode 100644 sources/phpBB/phpbb/auth/provider/oauth/service/service_interface.php create mode 100644 sources/phpBB/phpbb/auth/provider/oauth/token_storage.php create mode 100644 sources/phpBB/phpbb/auth/provider/provider_interface.php create mode 100644 sources/phpBB/phpbb/auth/provider_collection.php create mode 100644 sources/phpBB/phpbb/avatar/driver/driver.php create mode 100644 sources/phpBB/phpbb/avatar/driver/driver_interface.php create mode 100644 sources/phpBB/phpbb/avatar/driver/gravatar.php create mode 100644 sources/phpBB/phpbb/avatar/driver/local.php create mode 100644 sources/phpBB/phpbb/avatar/driver/remote.php create mode 100644 sources/phpBB/phpbb/avatar/driver/upload.php create mode 100644 sources/phpBB/phpbb/avatar/manager.php create mode 100644 sources/phpBB/phpbb/cache/driver/apc.php create mode 100644 sources/phpBB/phpbb/cache/driver/base.php create mode 100644 sources/phpBB/phpbb/cache/driver/driver_interface.php create mode 100644 sources/phpBB/phpbb/cache/driver/eaccelerator.php create mode 100644 sources/phpBB/phpbb/cache/driver/file.php create mode 100644 sources/phpBB/phpbb/cache/driver/memcache.php create mode 100644 sources/phpBB/phpbb/cache/driver/memory.php create mode 100644 sources/phpBB/phpbb/cache/driver/null.php create mode 100644 sources/phpBB/phpbb/cache/driver/redis.php create mode 100644 sources/phpBB/phpbb/cache/driver/wincache.php create mode 100644 sources/phpBB/phpbb/cache/driver/xcache.php create mode 100644 sources/phpBB/phpbb/cache/service.php create mode 100644 sources/phpBB/phpbb/captcha/char_cube3d.php create mode 100644 sources/phpBB/phpbb/captcha/colour_manager.php create mode 100644 sources/phpBB/phpbb/captcha/factory.php create mode 100644 sources/phpBB/phpbb/captcha/gd.php create mode 100644 sources/phpBB/phpbb/captcha/gd_wave.php create mode 100644 sources/phpBB/phpbb/captcha/non_gd.php create mode 100644 sources/phpBB/phpbb/captcha/plugins/captcha_abstract.php create mode 100644 sources/phpBB/phpbb/captcha/plugins/gd.php create mode 100644 sources/phpBB/phpbb/captcha/plugins/gd_wave.php create mode 100644 sources/phpBB/phpbb/captcha/plugins/nogd.php create mode 100644 sources/phpBB/phpbb/captcha/plugins/qa.php create mode 100644 sources/phpBB/phpbb/captcha/plugins/recaptcha.php create mode 100644 sources/phpBB/phpbb/class_loader.php create mode 100644 sources/phpBB/phpbb/composer.json create mode 100644 sources/phpBB/phpbb/config/config.php create mode 100644 sources/phpBB/phpbb/config/db.php create mode 100644 sources/phpBB/phpbb/config/db_text.php create mode 100644 sources/phpBB/phpbb/config_php_file.php create mode 100644 sources/phpBB/phpbb/console/application.php create mode 100644 sources/phpBB/phpbb/console/command/cache/purge.php create mode 100644 sources/phpBB/phpbb/console/command/command.php create mode 100644 sources/phpBB/phpbb/console/command/config/command.php create mode 100644 sources/phpBB/phpbb/console/command/config/delete.php create mode 100644 sources/phpBB/phpbb/console/command/config/get.php create mode 100644 sources/phpBB/phpbb/console/command/config/increment.php create mode 100644 sources/phpBB/phpbb/console/command/config/set.php create mode 100644 sources/phpBB/phpbb/console/command/config/set_atomic.php create mode 100644 sources/phpBB/phpbb/console/command/cron/cron_list.php create mode 100644 sources/phpBB/phpbb/console/command/cron/run.php create mode 100644 sources/phpBB/phpbb/console/command/db/console_migrator_output_handler.php create mode 100644 sources/phpBB/phpbb/console/command/db/migrate.php create mode 100644 sources/phpBB/phpbb/console/command/dev/migration_tips.php create mode 100644 sources/phpBB/phpbb/console/command/extension/command.php create mode 100644 sources/phpBB/phpbb/console/command/extension/disable.php create mode 100644 sources/phpBB/phpbb/console/command/extension/enable.php create mode 100644 sources/phpBB/phpbb/console/command/extension/purge.php create mode 100644 sources/phpBB/phpbb/console/command/extension/show.php create mode 100644 sources/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php create mode 100644 sources/phpBB/phpbb/content_visibility.php create mode 100644 sources/phpBB/phpbb/controller/exception.php create mode 100644 sources/phpBB/phpbb/controller/helper.php create mode 100644 sources/phpBB/phpbb/controller/provider.php create mode 100644 sources/phpBB/phpbb/controller/resolver.php create mode 100644 sources/phpBB/phpbb/cron/manager.php create mode 100644 sources/phpBB/phpbb/cron/task/base.php create mode 100644 sources/phpBB/phpbb/cron/task/core/prune_all_forums.php create mode 100644 sources/phpBB/phpbb/cron/task/core/prune_forum.php create mode 100644 sources/phpBB/phpbb/cron/task/core/prune_notifications.php create mode 100644 sources/phpBB/phpbb/cron/task/core/prune_shadow_topics.php create mode 100644 sources/phpBB/phpbb/cron/task/core/queue.php create mode 100644 sources/phpBB/phpbb/cron/task/core/tidy_cache.php create mode 100644 sources/phpBB/phpbb/cron/task/core/tidy_database.php create mode 100644 sources/phpBB/phpbb/cron/task/core/tidy_plupload.php create mode 100644 sources/phpBB/phpbb/cron/task/core/tidy_search.php create mode 100644 sources/phpBB/phpbb/cron/task/core/tidy_sessions.php create mode 100644 sources/phpBB/phpbb/cron/task/core/tidy_warnings.php create mode 100644 sources/phpBB/phpbb/cron/task/parametrized.php create mode 100644 sources/phpBB/phpbb/cron/task/task.php create mode 100644 sources/phpBB/phpbb/cron/task/wrapper.php create mode 100644 sources/phpBB/phpbb/datetime.php create mode 100644 sources/phpBB/phpbb/db/driver/driver.php create mode 100644 sources/phpBB/phpbb/db/driver/driver_interface.php create mode 100644 sources/phpBB/phpbb/db/driver/factory.php create mode 100644 sources/phpBB/phpbb/db/driver/mssql.php create mode 100644 sources/phpBB/phpbb/db/driver/mssql_base.php create mode 100644 sources/phpBB/phpbb/db/driver/mssql_odbc.php create mode 100644 sources/phpBB/phpbb/db/driver/mssqlnative.php create mode 100644 sources/phpBB/phpbb/db/driver/mysql.php create mode 100644 sources/phpBB/phpbb/db/driver/mysql_base.php create mode 100644 sources/phpBB/phpbb/db/driver/mysqli.php create mode 100644 sources/phpBB/phpbb/db/driver/oracle.php create mode 100644 sources/phpBB/phpbb/db/driver/postgres.php create mode 100644 sources/phpBB/phpbb/db/driver/sqlite.php create mode 100644 sources/phpBB/phpbb/db/driver/sqlite3.php create mode 100644 sources/phpBB/phpbb/db/html_migrator_output_handler.php create mode 100644 sources/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php create mode 100644 sources/phpBB/phpbb/db/migration/container_aware_migration.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_0.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc3.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/acp_style_components_module.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/allow_cdn.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/alpha1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/alpha2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/alpha3.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/avatar_types.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/avatars.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/beta1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/beta2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/beta3.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/beta4.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/board_contact_name.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/boardindex.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/bot_update.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/config_db_text.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/contact_admin_form.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/dev.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/extensions.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/extensions_version_check_force_unstable.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/forgot_password.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/gold.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/jquery_update.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/jquery_update2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/live_searches_config.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/migrations_table.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/namespaces.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/notifications.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/notifications_cron.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/passwords.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/passwords_convert_p2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/passwords_p2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/plupload.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_aol.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_aol_cleanup.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_change_load_settings.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_cleanup.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_contact_field.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_facebook.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_field_validation_length.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_icq.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_icq_cleanup.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_interests.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_location.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_location_cleanup.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_occupation.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_on_memberlist.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_show_novalue.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_skype.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_twitter.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_types.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_website.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_website_cleanup.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_wlm.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_wlm_cleanup.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo_cleanup.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/profilefield_youtube.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/rc2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/rc3.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/rc4.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/rc5.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/rc6.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/remove_acp_styles_cache.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/rename_too_long_indexes.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/reported_posts_display.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/search_type.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/style_update_p1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/style_update_p2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/teampage.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/timezone.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/timezone_p2.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/topic_sort_username.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v31x/m_softdelete_global.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v31x/style_update.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v31x/v311.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v31x/v312.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v31x/v312rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v31x/v313.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v31x/v313rc1.php create mode 100644 sources/phpBB/phpbb/db/migration/data/v31x/v313rc2.php create mode 100644 sources/phpBB/phpbb/db/migration/exception.php create mode 100644 sources/phpBB/phpbb/db/migration/helper.php create mode 100644 sources/phpBB/phpbb/db/migration/migration.php create mode 100644 sources/phpBB/phpbb/db/migration/profilefield_base_migration.php create mode 100644 sources/phpBB/phpbb/db/migration/schema_generator.php create mode 100644 sources/phpBB/phpbb/db/migration/tool/config.php create mode 100644 sources/phpBB/phpbb/db/migration/tool/config_text.php create mode 100644 sources/phpBB/phpbb/db/migration/tool/module.php create mode 100644 sources/phpBB/phpbb/db/migration/tool/permission.php create mode 100644 sources/phpBB/phpbb/db/migration/tool/tool_interface.php create mode 100644 sources/phpBB/phpbb/db/migrator.php create mode 100644 sources/phpBB/phpbb/db/migrator_output_handler_interface.php create mode 100644 sources/phpBB/phpbb/db/null_migrator_output_handler.php create mode 100644 sources/phpBB/phpbb/db/sql_insert_buffer.php create mode 100644 sources/phpBB/phpbb/db/tools.php create mode 100644 sources/phpBB/phpbb/di/container_builder.php create mode 100644 sources/phpBB/phpbb/di/extension/config.php create mode 100644 sources/phpBB/phpbb/di/extension/core.php create mode 100644 sources/phpBB/phpbb/di/extension/ext.php create mode 100644 sources/phpBB/phpbb/di/pass/collection_pass.php create mode 100644 sources/phpBB/phpbb/di/service_collection.php create mode 100644 sources/phpBB/phpbb/di/service_collection_iterator.php create mode 100644 sources/phpBB/phpbb/error_collector.php create mode 100644 sources/phpBB/phpbb/event/data.php create mode 100644 sources/phpBB/phpbb/event/dispatcher.php create mode 100644 sources/phpBB/phpbb/event/dispatcher_interface.php create mode 100644 sources/phpBB/phpbb/event/kernel_exception_subscriber.php create mode 100644 sources/phpBB/phpbb/event/kernel_request_subscriber.php create mode 100644 sources/phpBB/phpbb/event/kernel_terminate_subscriber.php create mode 100644 sources/phpBB/phpbb/event/md_exporter.php create mode 100644 sources/phpBB/phpbb/event/php_exporter.php create mode 100644 sources/phpBB/phpbb/event/recursive_event_filter_iterator.php create mode 100644 sources/phpBB/phpbb/exception/exception_interface.php create mode 100644 sources/phpBB/phpbb/exception/http_exception.php create mode 100644 sources/phpBB/phpbb/exception/runtime_exception.php create mode 100644 sources/phpBB/phpbb/extension/base.php create mode 100644 sources/phpBB/phpbb/extension/exception.php create mode 100644 sources/phpBB/phpbb/extension/extension_interface.php create mode 100644 sources/phpBB/phpbb/extension/manager.php create mode 100644 sources/phpBB/phpbb/extension/metadata_manager.php create mode 100644 sources/phpBB/phpbb/extension/provider.php create mode 100644 sources/phpBB/phpbb/feed/attachments_base.php create mode 100644 sources/phpBB/phpbb/feed/base.php create mode 100644 sources/phpBB/phpbb/feed/factory.php create mode 100644 sources/phpBB/phpbb/feed/forum.php create mode 100644 sources/phpBB/phpbb/feed/forums.php create mode 100644 sources/phpBB/phpbb/feed/helper.php create mode 100644 sources/phpBB/phpbb/feed/news.php create mode 100644 sources/phpBB/phpbb/feed/overall.php create mode 100644 sources/phpBB/phpbb/feed/post_base.php create mode 100644 sources/phpBB/phpbb/feed/topic.php create mode 100644 sources/phpBB/phpbb/feed/topic_base.php create mode 100644 sources/phpBB/phpbb/feed/topics.php create mode 100644 sources/phpBB/phpbb/feed/topics_active.php create mode 100644 sources/phpBB/phpbb/file_downloader.php create mode 100644 sources/phpBB/phpbb/filesystem.php create mode 100644 sources/phpBB/phpbb/finder.php create mode 100644 sources/phpBB/phpbb/groupposition/exception.php create mode 100644 sources/phpBB/phpbb/groupposition/groupposition_interface.php create mode 100644 sources/phpBB/phpbb/groupposition/legend.php create mode 100644 sources/phpBB/phpbb/groupposition/teampage.php create mode 100644 sources/phpBB/phpbb/hook/finder.php create mode 100644 sources/phpBB/phpbb/json_response.php create mode 100644 sources/phpBB/phpbb/lock/db.php create mode 100644 sources/phpBB/phpbb/lock/flock.php create mode 100644 sources/phpBB/phpbb/log/log.php create mode 100644 sources/phpBB/phpbb/log/log_interface.php create mode 100644 sources/phpBB/phpbb/log/null.php create mode 100644 sources/phpBB/phpbb/message/admin_form.php create mode 100644 sources/phpBB/phpbb/message/form.php create mode 100644 sources/phpBB/phpbb/message/message.php create mode 100644 sources/phpBB/phpbb/message/topic_form.php create mode 100644 sources/phpBB/phpbb/message/user_form.php create mode 100644 sources/phpBB/phpbb/mimetype/content_guesser.php create mode 100644 sources/phpBB/phpbb/mimetype/extension_guesser.php create mode 100644 sources/phpBB/phpbb/mimetype/guesser.php create mode 100644 sources/phpBB/phpbb/mimetype/guesser_base.php create mode 100644 sources/phpBB/phpbb/mimetype/guesser_interface.php create mode 100644 sources/phpBB/phpbb/notification/exception.php create mode 100644 sources/phpBB/phpbb/notification/manager.php create mode 100644 sources/phpBB/phpbb/notification/method/base.php create mode 100644 sources/phpBB/phpbb/notification/method/email.php create mode 100644 sources/phpBB/phpbb/notification/method/jabber.php create mode 100644 sources/phpBB/phpbb/notification/method/messenger_base.php create mode 100644 sources/phpBB/phpbb/notification/method/method_interface.php create mode 100644 sources/phpBB/phpbb/notification/type/admin_activate_user.php create mode 100644 sources/phpBB/phpbb/notification/type/approve_post.php create mode 100644 sources/phpBB/phpbb/notification/type/approve_topic.php create mode 100644 sources/phpBB/phpbb/notification/type/base.php create mode 100644 sources/phpBB/phpbb/notification/type/bookmark.php create mode 100644 sources/phpBB/phpbb/notification/type/disapprove_post.php create mode 100644 sources/phpBB/phpbb/notification/type/disapprove_topic.php create mode 100644 sources/phpBB/phpbb/notification/type/group_request.php create mode 100644 sources/phpBB/phpbb/notification/type/group_request_approved.php create mode 100644 sources/phpBB/phpbb/notification/type/pm.php create mode 100644 sources/phpBB/phpbb/notification/type/post.php create mode 100644 sources/phpBB/phpbb/notification/type/post_in_queue.php create mode 100644 sources/phpBB/phpbb/notification/type/quote.php create mode 100644 sources/phpBB/phpbb/notification/type/report_pm.php create mode 100644 sources/phpBB/phpbb/notification/type/report_pm_closed.php create mode 100644 sources/phpBB/phpbb/notification/type/report_post.php create mode 100644 sources/phpBB/phpbb/notification/type/report_post_closed.php create mode 100644 sources/phpBB/phpbb/notification/type/topic.php create mode 100644 sources/phpBB/phpbb/notification/type/topic_in_queue.php create mode 100644 sources/phpBB/phpbb/notification/type/type_interface.php create mode 100644 sources/phpBB/phpbb/pagination.php create mode 100644 sources/phpBB/phpbb/passwords/driver/base.php create mode 100644 sources/phpBB/phpbb/passwords/driver/bcrypt.php create mode 100644 sources/phpBB/phpbb/passwords/driver/bcrypt_2y.php create mode 100644 sources/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php create mode 100644 sources/phpBB/phpbb/passwords/driver/convert_password.php create mode 100644 sources/phpBB/phpbb/passwords/driver/driver_interface.php create mode 100644 sources/phpBB/phpbb/passwords/driver/helper.php create mode 100644 sources/phpBB/phpbb/passwords/driver/md5_mybb.php create mode 100644 sources/phpBB/phpbb/passwords/driver/md5_phpbb2.php create mode 100644 sources/phpBB/phpbb/passwords/driver/md5_vb.php create mode 100644 sources/phpBB/phpbb/passwords/driver/phpass.php create mode 100644 sources/phpBB/phpbb/passwords/driver/salted_md5.php create mode 100644 sources/phpBB/phpbb/passwords/driver/sha1.php create mode 100644 sources/phpBB/phpbb/passwords/driver/sha1_smf.php create mode 100644 sources/phpBB/phpbb/passwords/driver/sha1_wcf1.php create mode 100644 sources/phpBB/phpbb/passwords/driver/sha_xf1.php create mode 100644 sources/phpBB/phpbb/passwords/helper.php create mode 100644 sources/phpBB/phpbb/passwords/manager.php create mode 100644 sources/phpBB/phpbb/path_helper.php create mode 100644 sources/phpBB/phpbb/permissions.php create mode 100644 sources/phpBB/phpbb/php/ini.php create mode 100644 sources/phpBB/phpbb/plupload/plupload.php create mode 100644 sources/phpBB/phpbb/profilefields/lang_helper.php create mode 100644 sources/phpBB/phpbb/profilefields/manager.php create mode 100644 sources/phpBB/phpbb/profilefields/type/type_base.php create mode 100644 sources/phpBB/phpbb/profilefields/type/type_bool.php create mode 100644 sources/phpBB/phpbb/profilefields/type/type_date.php create mode 100644 sources/phpBB/phpbb/profilefields/type/type_dropdown.php create mode 100644 sources/phpBB/phpbb/profilefields/type/type_googleplus.php create mode 100644 sources/phpBB/phpbb/profilefields/type/type_int.php create mode 100644 sources/phpBB/phpbb/profilefields/type/type_interface.php create mode 100644 sources/phpBB/phpbb/profilefields/type/type_string.php create mode 100644 sources/phpBB/phpbb/profilefields/type/type_string_common.php create mode 100644 sources/phpBB/phpbb/profilefields/type/type_text.php create mode 100644 sources/phpBB/phpbb/profilefields/type/type_url.php create mode 100644 sources/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php create mode 100644 sources/phpBB/phpbb/request/deactivated_super_global.php create mode 100644 sources/phpBB/phpbb/request/request.php create mode 100644 sources/phpBB/phpbb/request/request_interface.php create mode 100644 sources/phpBB/phpbb/request/type_cast_helper.php create mode 100644 sources/phpBB/phpbb/request/type_cast_helper_interface.php create mode 100644 sources/phpBB/phpbb/search/base.php create mode 100644 sources/phpBB/phpbb/search/fulltext_mysql.php create mode 100644 sources/phpBB/phpbb/search/fulltext_native.php create mode 100644 sources/phpBB/phpbb/search/fulltext_postgres.php create mode 100644 sources/phpBB/phpbb/search/fulltext_sphinx.php create mode 100644 sources/phpBB/phpbb/search/index.htm create mode 100644 sources/phpBB/phpbb/search/sphinx/config.php create mode 100644 sources/phpBB/phpbb/search/sphinx/config_comment.php create mode 100644 sources/phpBB/phpbb/search/sphinx/config_section.php create mode 100644 sources/phpBB/phpbb/search/sphinx/config_variable.php create mode 100644 sources/phpBB/phpbb/session.php create mode 100644 sources/phpBB/phpbb/symfony_request.php create mode 100644 sources/phpBB/phpbb/template/asset.php create mode 100644 sources/phpBB/phpbb/template/base.php create mode 100644 sources/phpBB/phpbb/template/context.php create mode 100644 sources/phpBB/phpbb/template/template.php create mode 100644 sources/phpBB/phpbb/template/twig/definition.php create mode 100644 sources/phpBB/phpbb/template/twig/environment.php create mode 100644 sources/phpBB/phpbb/template/twig/extension.php create mode 100644 sources/phpBB/phpbb/template/twig/lexer.php create mode 100644 sources/phpBB/phpbb/template/twig/loader.php create mode 100644 sources/phpBB/phpbb/template/twig/node/definenode.php create mode 100644 sources/phpBB/phpbb/template/twig/node/event.php create mode 100644 sources/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php create mode 100644 sources/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php create mode 100644 sources/phpBB/phpbb/template/twig/node/includeasset.php create mode 100644 sources/phpBB/phpbb/template/twig/node/includecss.php create mode 100644 sources/phpBB/phpbb/template/twig/node/includejs.php create mode 100644 sources/phpBB/phpbb/template/twig/node/includenode.php create mode 100644 sources/phpBB/phpbb/template/twig/node/includephp.php create mode 100644 sources/phpBB/phpbb/template/twig/node/php.php create mode 100644 sources/phpBB/phpbb/template/twig/tokenparser/defineparser.php create mode 100644 sources/phpBB/phpbb/template/twig/tokenparser/event.php create mode 100644 sources/phpBB/phpbb/template/twig/tokenparser/includecss.php create mode 100644 sources/phpBB/phpbb/template/twig/tokenparser/includejs.php create mode 100644 sources/phpBB/phpbb/template/twig/tokenparser/includeparser.php create mode 100644 sources/phpBB/phpbb/template/twig/tokenparser/includephp.php create mode 100644 sources/phpBB/phpbb/template/twig/tokenparser/php.php create mode 100644 sources/phpBB/phpbb/template/twig/twig.php create mode 100644 sources/phpBB/phpbb/tree/nestedset.php create mode 100644 sources/phpBB/phpbb/tree/nestedset_forum.php create mode 100644 sources/phpBB/phpbb/tree/tree_interface.php create mode 100644 sources/phpBB/phpbb/user.php create mode 100644 sources/phpBB/phpbb/user_loader.php create mode 100644 sources/phpBB/phpbb/version_helper.php create mode 100644 sources/phpBB/phpbb/viewonline_helper.php create mode 100644 sources/phpBB/posting.php create mode 100644 sources/phpBB/report.php create mode 100644 sources/phpBB/search.php create mode 100644 sources/phpBB/store/.htaccess create mode 100644 sources/phpBB/store/index.htm create mode 100644 sources/phpBB/styles/prosilver/style.cfg create mode 100644 sources/phpBB/styles/prosilver/template/ajax.js create mode 100644 sources/phpBB/styles/prosilver/template/attachment.html create mode 100644 sources/phpBB/styles/prosilver/template/bbcode.html create mode 100644 sources/phpBB/styles/prosilver/template/captcha_default.html create mode 100644 sources/phpBB/styles/prosilver/template/captcha_qa.html create mode 100644 sources/phpBB/styles/prosilver/template/captcha_recaptcha.html create mode 100644 sources/phpBB/styles/prosilver/template/confirm_body.html create mode 100644 sources/phpBB/styles/prosilver/template/confirm_delete_body.html create mode 100644 sources/phpBB/styles/prosilver/template/drafts.html create mode 100644 sources/phpBB/styles/prosilver/template/faq_body.html create mode 100644 sources/phpBB/styles/prosilver/template/forum_fn.js create mode 100644 sources/phpBB/styles/prosilver/template/forumlist_body.html create mode 100644 sources/phpBB/styles/prosilver/template/index.htm create mode 100644 sources/phpBB/styles/prosilver/template/index_body.html create mode 100644 sources/phpBB/styles/prosilver/template/jumpbox.html create mode 100644 sources/phpBB/styles/prosilver/template/login_body.html create mode 100644 sources/phpBB/styles/prosilver/template/login_body_oauth.html create mode 100644 sources/phpBB/styles/prosilver/template/login_forum.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_approve.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_ban.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_footer.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_forum.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_front.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_header.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_logs.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_message.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_move.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_notes_front.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_notes_user.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_post.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_queue.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_reports.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_topic.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_warn_front.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_warn_list.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_warn_post.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_warn_user.html create mode 100644 sources/phpBB/styles/prosilver/template/mcp_whois.html create mode 100644 sources/phpBB/styles/prosilver/template/memberlist_body.html create mode 100644 sources/phpBB/styles/prosilver/template/memberlist_email.html create mode 100644 sources/phpBB/styles/prosilver/template/memberlist_im.html create mode 100644 sources/phpBB/styles/prosilver/template/memberlist_search.html create mode 100644 sources/phpBB/styles/prosilver/template/memberlist_team.html create mode 100644 sources/phpBB/styles/prosilver/template/memberlist_view.html create mode 100644 sources/phpBB/styles/prosilver/template/message_body.html create mode 100644 sources/phpBB/styles/prosilver/template/navbar_footer.html create mode 100644 sources/phpBB/styles/prosilver/template/navbar_header.html create mode 100644 sources/phpBB/styles/prosilver/template/notification_dropdown.html create mode 100644 sources/phpBB/styles/prosilver/template/overall_footer.html create mode 100644 sources/phpBB/styles/prosilver/template/overall_header.html create mode 100644 sources/phpBB/styles/prosilver/template/pagination.html create mode 100644 sources/phpBB/styles/prosilver/template/plupload.html create mode 100644 sources/phpBB/styles/prosilver/template/posting_attach_body.html create mode 100644 sources/phpBB/styles/prosilver/template/posting_body.html create mode 100644 sources/phpBB/styles/prosilver/template/posting_buttons.html create mode 100644 sources/phpBB/styles/prosilver/template/posting_editor.html create mode 100644 sources/phpBB/styles/prosilver/template/posting_layout.html create mode 100644 sources/phpBB/styles/prosilver/template/posting_pm_header.html create mode 100644 sources/phpBB/styles/prosilver/template/posting_pm_layout.html create mode 100644 sources/phpBB/styles/prosilver/template/posting_poll_body.html create mode 100644 sources/phpBB/styles/prosilver/template/posting_preview.html create mode 100644 sources/phpBB/styles/prosilver/template/posting_review.html create mode 100644 sources/phpBB/styles/prosilver/template/posting_smilies.html create mode 100644 sources/phpBB/styles/prosilver/template/posting_topic_review.html create mode 100644 sources/phpBB/styles/prosilver/template/profilefields/bool.html create mode 100644 sources/phpBB/styles/prosilver/template/profilefields/date.html create mode 100644 sources/phpBB/styles/prosilver/template/profilefields/dropdown.html create mode 100644 sources/phpBB/styles/prosilver/template/profilefields/int.html create mode 100644 sources/phpBB/styles/prosilver/template/profilefields/string.html create mode 100644 sources/phpBB/styles/prosilver/template/profilefields/text.html create mode 100644 sources/phpBB/styles/prosilver/template/profilefields/url.html create mode 100644 sources/phpBB/styles/prosilver/template/quickreply_editor.html create mode 100644 sources/phpBB/styles/prosilver/template/report_body.html create mode 100644 sources/phpBB/styles/prosilver/template/search_body.html create mode 100644 sources/phpBB/styles/prosilver/template/search_results.html create mode 100644 sources/phpBB/styles/prosilver/template/simple_footer.html create mode 100644 sources/phpBB/styles/prosilver/template/simple_header.html create mode 100644 sources/phpBB/styles/prosilver/template/timezone.js create mode 100644 sources/phpBB/styles/prosilver/template/timezone_option.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_agreement.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_attachments.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_auth_link.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_auth_link_oauth.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_avatar_options.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_avatar_options_local.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_avatar_options_upload.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_footer.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_groups_manage.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_groups_membership.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_header.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_login_link.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_main_bookmarks.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_main_drafts.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_main_front.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_main_subscribed.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_notifications.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_pm_history.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_pm_message_footer.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_pm_message_header.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_pm_options.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_prefs_personal.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_prefs_post.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_prefs_view.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_profile_avatar.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_profile_profile_info.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_profile_reg_details.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_profile_signature.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_register.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_remind.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_resend.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_zebra_foes.html create mode 100644 sources/phpBB/styles/prosilver/template/ucp_zebra_friends.html create mode 100644 sources/phpBB/styles/prosilver/template/viewforum_body.html create mode 100644 sources/phpBB/styles/prosilver/template/viewonline_body.html create mode 100644 sources/phpBB/styles/prosilver/template/viewonline_whois.html create mode 100644 sources/phpBB/styles/prosilver/template/viewtopic_body.html create mode 100644 sources/phpBB/styles/prosilver/template/viewtopic_print.html create mode 100644 sources/phpBB/styles/prosilver/template/viewtopic_topic_tools.html create mode 100644 sources/phpBB/styles/prosilver/theme/bidi.css create mode 100644 sources/phpBB/styles/prosilver/theme/buttons.css create mode 100644 sources/phpBB/styles/prosilver/theme/colours.css create mode 100644 sources/phpBB/styles/prosilver/theme/common.css create mode 100644 sources/phpBB/styles/prosilver/theme/content.css create mode 100644 sources/phpBB/styles/prosilver/theme/cp.css create mode 100644 sources/phpBB/styles/prosilver/theme/en/icon_user_online.gif create mode 100644 sources/phpBB/styles/prosilver/theme/en/stylesheet.css create mode 100644 sources/phpBB/styles/prosilver/theme/forms.css create mode 100644 sources/phpBB/styles/prosilver/theme/images/alert_close.png create mode 100644 sources/phpBB/styles/prosilver/theme/images/announce_read.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/announce_read_locked.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/announce_read_locked_mine.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/announce_read_mine.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/announce_unread.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/announce_unread_locked.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/announce_unread_locked_mine.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/announce_unread_mine.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/arrow_down.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/arrow_left.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/arrow_right.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/arrow_up.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/bg_button.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/bg_header.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/bg_list.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/feed.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/forum_link.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/forum_read.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/forum_read_locked.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/forum_read_subforum.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/forum_unread.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/forum_unread_locked.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/forum_unread_subforum.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/gradient.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_acp.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_back_top.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_bookmark.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_bump.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_contact.png create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_delete_cookies.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_download.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_faq.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_home.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_logout.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_mark.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_mcp.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_members.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_notification.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_offline.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_online.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_pages.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_pm.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_post_target.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_post_target_unread.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_print.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_profile.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_rate_bad.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_rate_good.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_register.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_search.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_sendemail.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_subscribe.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_team.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_textbox_search.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_topic_attach.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_topic_deleted.png create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_topic_latest.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_topic_newest.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_topic_poll.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_topic_reported.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_topic_unapproved.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_ucp.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icon_unsubscribe.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/icons_button.png create mode 100644 sources/phpBB/styles/prosilver/theme/images/icons_contact.png create mode 100644 sources/phpBB/styles/prosilver/theme/images/icons_pagination.png create mode 100644 sources/phpBB/styles/prosilver/theme/images/index.htm create mode 100644 sources/phpBB/styles/prosilver/theme/images/loading.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/no_avatar.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/plupload/done.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/plupload/error.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/plupload/throbber.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/quote.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/quote_rtl.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/site_logo.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/sticky_read.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/sticky_read_locked.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/sticky_read_locked_mine.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/sticky_read_mine.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/sticky_unread.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/sticky_unread_locked.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/sticky_unread_locked_mine.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/sticky_unread_mine.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/subforum_read.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/subforum_unread.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/topic_moved.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/topic_read.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/topic_read_hot.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/topic_read_hot_mine.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/topic_read_locked.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/topic_read_locked_mine.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/topic_read_mine.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/topic_unread.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/topic_unread_hot.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/topic_unread_hot_mine.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/topic_unread_locked.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/topic_unread_locked_mine.gif create mode 100644 sources/phpBB/styles/prosilver/theme/images/topic_unread_mine.gif create mode 100644 sources/phpBB/styles/prosilver/theme/imageset.css create mode 100644 sources/phpBB/styles/prosilver/theme/index.htm create mode 100644 sources/phpBB/styles/prosilver/theme/links.css create mode 100644 sources/phpBB/styles/prosilver/theme/plupload.css create mode 100644 sources/phpBB/styles/prosilver/theme/print.css create mode 100644 sources/phpBB/styles/prosilver/theme/responsive.css create mode 100644 sources/phpBB/styles/prosilver/theme/stylesheet.css create mode 100644 sources/phpBB/styles/prosilver/theme/tweaks.css create mode 100644 sources/phpBB/ucp.php create mode 100644 sources/phpBB/vendor/autoload.php create mode 100644 sources/phpBB/vendor/composer/ClassLoader.php create mode 100644 sources/phpBB/vendor/composer/autoload_classmap.php create mode 100644 sources/phpBB/vendor/composer/autoload_namespaces.php create mode 100644 sources/phpBB/vendor/composer/autoload_psr4.php create mode 100644 sources/phpBB/vendor/composer/autoload_real.php create mode 100644 sources/phpBB/vendor/composer/installed.json create mode 100644 sources/phpBB/vendor/lusitanian/oauth/LICENSE create mode 100644 sources/phpBB/vendor/lusitanian/oauth/composer.json create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/AutoLoader.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Consumer/Credentials.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Exception/Exception.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Client/AbstractClient.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Client/ClientInterface.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Client/CurlClient.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Client/StreamClient.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Exception/TokenResponseException.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Uri/Uri.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Uri/UriFactory.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Uri/UriFactoryInterface.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Uri/UriInterface.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Service/AbstractService.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Service/ServiceInterface.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/Exception/StorageException.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/Exception/TokenNotFoundException.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/Memory.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/Redis.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/Session.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/SymfonySession.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/TokenStorageInterface.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Token/AbstractToken.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Token/Exception/ExpiredTokenException.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Token/TokenInterface.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/AbstractService.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/BitBucket.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/Etsy.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/FitBit.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/ServiceInterface.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/Tumblr.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/Twitter.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Signature/Exception/UnsupportedHashAlgorithmException.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Signature/Signature.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Signature/SignatureInterface.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Token/StdOAuth1Token.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Token/TokenInterface.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/AbstractService.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Amazon.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Bitly.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Box.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Dropbox.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Exception/InvalidScopeException.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Exception/MissingRefreshTokenException.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Facebook.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Foursquare.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/GitHub.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Google.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Instagram.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Linkedin.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Microsoft.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Paypal.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/ServiceInterface.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/SoundCloud.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Vkontakte.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Yammer.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Token/StdOAuth2Token.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Token/TokenInterface.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/ServiceFactory.php create mode 100644 sources/phpBB/vendor/lusitanian/oauth/src/OAuth/bootstrap.php create mode 100644 sources/phpBB/vendor/psr/log/LICENSE create mode 100644 sources/phpBB/vendor/psr/log/Psr/Log/AbstractLogger.php create mode 100644 sources/phpBB/vendor/psr/log/Psr/Log/InvalidArgumentException.php create mode 100644 sources/phpBB/vendor/psr/log/Psr/Log/LogLevel.php create mode 100644 sources/phpBB/vendor/psr/log/Psr/Log/LoggerAwareInterface.php create mode 100644 sources/phpBB/vendor/psr/log/Psr/Log/LoggerAwareTrait.php create mode 100644 sources/phpBB/vendor/psr/log/Psr/Log/LoggerInterface.php create mode 100644 sources/phpBB/vendor/psr/log/Psr/Log/LoggerTrait.php create mode 100644 sources/phpBB/vendor/psr/log/Psr/Log/NullLogger.php create mode 100644 sources/phpBB/vendor/psr/log/composer.json create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/ConfigCache.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/BooleanNode.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ExprBuilder.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/FloatNodeDefinition.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/IntegerNodeDefinition.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/MergeBuilder.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeBuilder.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeDefinition.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ScalarNodeDefinition.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/TreeBuilder.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ConfigurationInterface.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/EnumNode.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/DuplicateKeyException.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/Exception.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/ForbiddenOverwriteException.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidConfigurationException.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidDefinitionException.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidTypeException.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/UnsetKeyException.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/FloatNode.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/IntegerNode.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/NodeInterface.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/NumericNode.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/PrototypeNodeInterface.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/PrototypedArrayNode.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ReferenceDumper.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ScalarNode.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/VariableNode.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Exception/FileLoaderLoadException.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/FileLocator.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/FileLocatorInterface.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/LICENSE create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/DelegatingLoader.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/FileLoader.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/Loader.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderInterface.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderResolver.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderResolverInterface.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Resource/DirectoryResource.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Resource/FileResource.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Resource/ResourceInterface.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Util/XmlUtils.php create mode 100644 sources/phpBB/vendor/symfony/config/Symfony/Component/Config/composer.json create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Application.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Command/Command.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Command/ListCommand.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/ConsoleEvents.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/ApplicationDescription.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/Descriptor.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/DescriptorInterface.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/JsonDescriptor.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/TextDescriptor.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/XmlDescriptor.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleCommandEvent.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleEvent.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleExceptionEvent.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleTerminateEvent.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatter.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterInterface.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyle.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/DescriptorHelper.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/FormatterHelper.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/Helper.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/HelperInterface.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/HelperSet.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/ArrayInput.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/Input.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputArgument.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputDefinition.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputInterface.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputOption.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/StringInput.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/LICENSE create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutput.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutputInterface.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/NullOutput.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/Output.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/OutputInterface.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Resources/bin/hiddeninput.exe create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Shell.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Tester/CommandTester.php create mode 100644 sources/phpBB/vendor/symfony/console/Symfony/Component/Console/composer.json create mode 100644 sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Debug.php create mode 100644 sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/ErrorHandler.php create mode 100644 sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/ContextErrorException.php create mode 100644 sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/DummyException.php create mode 100644 sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/FatalErrorException.php create mode 100644 sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/FlattenException.php create mode 100644 sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/ExceptionHandler.php create mode 100644 sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/LICENSE create mode 100644 sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/composer.json create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Alias.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAware.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAwareInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/Dumper.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/LogicException.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/RuntimeException.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/Extension.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/PrependExtensionInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LICENSE create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/InstantiatorInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/RealServiceInstantiator.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/NullDumper.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/FileLoader.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Parameter.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Reference.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Scope.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ScopeInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/SimpleXMLElement.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/TaggedContainerInterface.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Variable.php create mode 100644 sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/composer.json create mode 100644 sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php create mode 100644 sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php create mode 100644 sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php create mode 100644 sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php create mode 100644 sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php create mode 100644 sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventSubscriberInterface.php create mode 100644 sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php create mode 100644 sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php create mode 100644 sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/LICENSE create mode 100644 sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json create mode 100644 sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/Exception/ExceptionInterface.php create mode 100644 sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/Exception/IOException.php create mode 100644 sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/Filesystem.php create mode 100644 sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/LICENSE create mode 100644 sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/composer.json create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeader.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeaderItem.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ApacheRequest.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/BinaryFileResponse.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Cookie.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileException.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UnexpectedTypeException.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UploadException.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/IpUtils.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/LICENSE create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RedirectResponse.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcher.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcherInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/FakeFile.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ResponseHeaderBag.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/StreamedResponse.php create mode 100644 sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/BundleInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/CacheClearerInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/WarmableInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Config/FileLocator.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerReference.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/TraceableControllerResolver.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollector.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/Extension.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseEvent.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/PostResponseEvent.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ErrorsLoggerListener.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/EsiListener.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/FragmentListener.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ResponseListener.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/AccessDeniedHttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/BadRequestHttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/ConflictHttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FatalErrorException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FlattenException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/GoneHttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpExceptionInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/LengthRequiredHttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/NotAcceptableHttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/NotFoundHttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/PreconditionFailedHttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/PreconditionRequiredHttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/ServiceUnavailableHttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/TooManyRequestsHttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/UnauthorizedHttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/UnsupportedMediaTypeHttpException.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/EsiFragmentRenderer.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentRendererInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Esi.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategyInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernelInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/LICENSE create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/LoggerInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/NullLogger.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MysqlProfilerStorage.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profile.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/TerminableInterface.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/UriSigner.php create mode 100644 sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Annotation/Route.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/CompiledRoute.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/ExceptionInterface.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/InvalidParameterException.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/MethodNotAllowedException.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/MissingMandatoryParametersException.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/ResourceNotFoundException.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/RouteNotFoundException.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/ConfigurableRequirementsInterface.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumper.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumperInterface.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/LICENSE create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationClassLoader.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationFileLoader.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/ClosureLoader.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/PhpFileLoader.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/XmlFileLoader.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/YamlFileLoader.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumper.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcherInterface.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RequestMatcherInterface.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcherInterface.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RequestContext.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RequestContextAwareInterface.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Route.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouteCompiler.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouteCompilerInterface.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Router.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouterInterface.php create mode 100644 sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/composer.json create mode 100644 sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php create mode 100644 sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php create mode 100644 sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/DumpException.php create mode 100644 sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ExceptionInterface.php create mode 100644 sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php create mode 100644 sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/RuntimeException.php create mode 100644 sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php create mode 100644 sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE create mode 100644 sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php create mode 100644 sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php create mode 100644 sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.php create mode 100644 sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json create mode 100644 sources/phpBB/vendor/twig/twig/LICENSE create mode 100644 sources/phpBB/vendor/twig/twig/composer.json create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Autoloader.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Compiler.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/CompilerInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Environment.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Error.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Error/Loader.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Error/Runtime.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Error/Syntax.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/ExpressionParser.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Extension.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Core.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Debug.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Escaper.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Optimizer.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Sandbox.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Staging.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Extension/StringLoader.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/ExtensionInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Filter.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Filter/Function.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Filter/Method.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Filter/Node.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/FilterCallableInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/FilterInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Function.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Function/Function.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Function/Method.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Function/Node.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/FunctionCallableInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/FunctionInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Lexer.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/LexerInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Loader/Array.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Loader/Chain.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Loader/Filesystem.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Loader/String.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/LoaderInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Markup.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/AutoEscape.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Block.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/BlockReference.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Body.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Do.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Embed.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Array.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Call.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Constant.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Function.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Name.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/TempName.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Flush.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/For.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/ForLoop.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/If.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Import.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Include.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Macro.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Module.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Print.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Sandbox.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Set.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/SetTemp.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Spaceless.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Node/Text.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/NodeInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/NodeOutputInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/NodeTraverser.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Parser.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/ParserInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/SimpleFilter.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/SimpleFunction.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/SimpleTest.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Template.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TemplateInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Test.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Test/Function.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Test/Method.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Test/Node.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TestCallableInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TestInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/Token.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Block.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Do.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Embed.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Extends.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Filter.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Flush.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/For.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/From.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/If.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Import.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Include.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Macro.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Set.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Use.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParserBroker.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenParserInterface.php create mode 100644 sources/phpBB/vendor/twig/twig/lib/Twig/TokenStream.php create mode 100644 sources/phpBB/viewforum.php create mode 100644 sources/phpBB/viewonline.php create mode 100644 sources/phpBB/viewtopic.php create mode 100644 sources/phpBB/web.config diff --git a/sources/phpBB/.htaccess b/sources/phpBB/.htaccess new file mode 100644 index 0000000..1ae74ed --- /dev/null +++ b/sources/phpBB/.htaccess @@ -0,0 +1,75 @@ + +RewriteEngine on + +# +# Uncomment the statement below if you want to make use of +# HTTP authentication and it does not already work. +# This could be required if you are for example using PHP via Apache CGI. +# +#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] + +# +# The following 3 lines will rewrite URLs passed through the front controller +# to not require app.php in the actual URL. In other words, a controller is +# by default accessed at /app.php/my/controller, but can also be accessed at +# /my/controller +# +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^(.*)$ app.php [QSA,L] + +# +# If symbolic links are not already being followed, +# uncomment the line below. +# http://anothersysadmin.wordpress.com/2008/06/10/mod_rewrite-forbidden-403-with-apache-228/ +# +#Options +FollowSymLinks + + +# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from +# module mod_authz_host to a new module called mod_access_compat (which may be +# disabled) and a new "Require" syntax has been introduced to mod_authz_host. +# We could just conditionally provide both versions, but unfortunately Apache +# does not explicitly tell us its version if the module mod_version is not +# available. In this case, we check for the availability of module +# mod_authz_core (which should be on 2.4 or higher only) as a best guess. + + + + Order Allow,Deny + Deny from All + + + Order Allow,Deny + Deny from All + + + = 2.4> + + Require all denied + + + Require all denied + + + + + + + Order Allow,Deny + Deny from All + + + Order Allow,Deny + Deny from All + + + + + Require all denied + + + Require all denied + + + diff --git a/sources/phpBB/adm/images/alert_close.png b/sources/phpBB/adm/images/alert_close.png new file mode 100644 index 0000000000000000000000000000000000000000..79750a013c5db627a14bf3d57edc8f8e3a477046 GIT binary patch literal 2097 zcmaJ?YgAKL7LJ0*E65`_OVRcktP$(m;m=}RWa0BUlnFI$KFgT?|u4kiA3~!|za!^XLV766|9vif#KejaL{7)!6A}_|31pm15rZevXf%TciR7k7xWS211XQ|7 zVaFu}76kJZVmTs~Ndbc*7%e-9FtPed|G0ug{y|m>zi*SiVR$7d#}jb`!`M;+DD?ERrEISR|7J zeqkN}7vzhjhWH(x%cXOqFak>X5QoLY>J@Nev4GC@B#`|*{mC94R5FpsCi<{wRDTMY z!ydg(~-9>ey7ZS}zi<3m!t+ZB3SKgt9WQ7Gdw4$Ft9d~}4j zFW?e{Nv?m9pHdj_97b)G@1|0l9`^7s(F1|DU%OVV^zp?&GlP5Zhxvso<-*BtV`j90+^+Kq+rZ^rVgVBNYDp_VD1tDjYM!MYi*vF#7t(PL0l z)DyZYi6cAnqoAfJ+sj$iJv7vitlLk2akMevXSk}Y?AyJOkta(^u++rfgKD3$rw7cKB`MuM-owP8{DYdB?iOn(y5+F}JX2vgz#XG`}8n#b{t^MpOj~ zg+kWF*_X97H56K5&}Lh+f9sl>d^#RHFta*$?i_(mKY8nxM|XGkwh+v4o5;OgTKnnc z(t&~Y_IBgXf1jGN&Iw?#NDM}n-5HHWV`FJ@v3LC2uj}dxI1;{9<)g_%Ez!i`;!Br| znM`Ij^a@jO_Uv(;ZhyqJ-C%Rg;?5DqCY$?$XqHO_x$=jU7ObcxOv{#IgZ&VT-z={VJW37mK0GC+~Yb-~OSGgC|l zZr!!dj?z>Fuz&h~MEzxs&zgQg<3&zW3AgzLh1+4IKqzYtm@Vp3jR!(7oD}PFIVLjH zzWr@oYYbJz;Z3@9K1=N#x1V{!$2%>0ev*Z*jE<<-YCWq=PgvMqn?3dB6pvt;H{Up{ zd7_DioBR6uGJWm)QpUF(*kVuz0!+ph1Beywao>^UFx1wac`1|_6gs6iqg>D5F;_n_sqUFU+rFJp-wFwhQkVD7JgIw13D@SeKaZ>)ZJd4< z+yAO-gF4Z=JHFzfN8W7Hfby#=Ocj}k59M^l>lQ38kK?L8?&YOrwf8gR`5pnzrJk07 z9h>HqX7}&L$Wx~68AZB`wWs)RGd{E4H?(8tzjDos27za(tedB`w-v2!Ti0L7i8%Kg z{pab)fVr32!GH^D*`%P6vmxhA_uiJxkAp>NlObLf(dO&-mrdKxoIaINP)J#o)3)m4 zP&-o_>eMz2#Z3YgxgTUO}hquind8 z6ZFON6Q7E3^pnjtJ7$l0Z`TYmj0WTG-oDUjK}#HF0P-Ihb32c&Kw&oWB|A*ZcNl)+ N9Ci?^(l_eZe*jUwWY7Qr literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/arrow_down.gif b/sources/phpBB/adm/images/arrow_down.gif new file mode 100644 index 0000000000000000000000000000000000000000..b7fbf7e2764e1f1c58ed0a166ec0d02eec927970 GIT binary patch literal 51 zcmZ?wbhEHbWMg1sXkcJ4Ha2EpU{L(Y!pOkD$e;sc1I5`G7?`+v_!DNXzIefUIRk?= E0LkGAF8}}l literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/arrow_left.gif b/sources/phpBB/adm/images/arrow_left.gif new file mode 100644 index 0000000000000000000000000000000000000000..ac92cb49719f40ae82a284f16e3b9bca63feeded GIT binary patch literal 49 zcmZ?wbhEHbWMN=qXkcJ4Ha2EpU{L(Y!pOkD$e;scGk|0mm^geG+E!#f4`5`l1^}?* B2Z8_q literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/arrow_right.gif b/sources/phpBB/adm/images/arrow_right.gif new file mode 100644 index 0000000000000000000000000000000000000000..3a080ffdfe21b646239778d71fa09e843351a63f GIT binary patch literal 49 zcmZ?wbhEHbWMN=qXkcJ4Ha2EpU{L(Y!pOkD$e;scGk|0mm^fI3+E!#f4`5`l1^}+L B2TT9} literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/arrow_up.gif b/sources/phpBB/adm/images/arrow_up.gif new file mode 100644 index 0000000000000000000000000000000000000000..0ff587218205e6ad32bde7ba0e65d7d4eeff98b8 GIT binary patch literal 51 zcmZ?wbhEHbWMg1sXkcJ4Ha2EpU{L(Y!pOkD$e;sc1I5`G7?`+v@)=g_Tqsquf`P#r E0LJYIr~m)} literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/bg_button.gif b/sources/phpBB/adm/images/bg_button.gif new file mode 100644 index 0000000000000000000000000000000000000000..03172ff5c674ae95000d265bff3e5068cab73af0 GIT binary patch literal 182 zcmV;n07?HxNk%w1VFUme0K@ln-?Cj_0=;r6<;o#x!?(XE| z<gwv++S>pB|L^bbA^8LV00000EC2ui00aOS000FupeK4-sVxFUNfH2ba934PwB4Iy kAy$z63IYUzDIOk-hJnN66fV%gBr*9|uh^`1%MAelJFawYMF0Q* literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/bg_hash1.gif b/sources/phpBB/adm/images/bg_hash1.gif new file mode 100644 index 0000000000000000000000000000000000000000..61163679a80e2c6074658193458280c8713489a4 GIT binary patch literal 48 zcmZ?wbhEHbWMyDwXkcV;IBLtlz@Ye(g^_`QkwFK@28y#XFfg(AFi+pMLY#}i8UVn0 B2ekkI literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/bg_hash2.gif b/sources/phpBB/adm/images/bg_hash2.gif new file mode 100644 index 0000000000000000000000000000000000000000..d31840361c1e83c8e4828c1641d1b7d629c2068d GIT binary patch literal 48 zcmZ?wbhEHbWMyDwXkcV0*zksdfkE*n3nK#qBZCf*4HRc(U|?eJVV=Hig*X?3H2~Vr B2!8+o literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/bg_hash3.gif b/sources/phpBB/adm/images/bg_hash3.gif new file mode 100644 index 0000000000000000000000000000000000000000..40bc7e1b5c67192a6299730460b88e46ce9b4c1f GIT binary patch literal 48 zcmZ?wbhEHbWMyDwXkcV`Q`pGBz@Ye(g^_`QkwFK@28y#XFfg(AFi+pMLY#}i8UWRr B2vGn4 literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/bg_hash4.gif b/sources/phpBB/adm/images/bg_hash4.gif new file mode 100644 index 0000000000000000000000000000000000000000..54e7f0019f7bca1fef37bee315e6b44380505ae0 GIT binary patch literal 48 zcmZ?wbhEHbWMyDwXkcVWOG{&5U{L(Y!pOkD$e;sc1I1Yx7?{|5n5S=BAAMU((ec}GodoSPI zdiMJ6%QqJvJUe~&(VZ7>9=?A6;PtyZ&tG4D`0W16x0fG1KYi!XxqD9@zJ7P+?&JHf z-adNs{`T|NR~|jT^zhl^H}B8ifAZw*2L@7r;!hT^avcx}@)HBw-UE{gJao$X+}nyy zx>(M?up-H8t<<_3Yf^TbR_=fBA=^i9_SqRFvkv6#=Kio_j`Q;E?|$rwJMujEU%g6G zlTK?}dxv0G7ejAfzwpF~98;!F=^sWQ>T^Bp4Gf?@zQ19tJkh8+`OrN=kC4x@(&;K rKY60{{Kd;xdT-vodoT9!Bh#0!-wb~I{Pp|K-+%uZm|t--F<1it4*>Fk literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/bg_header.jpg b/sources/phpBB/adm/images/bg_header.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5ecec5360b11992492807a8fa1353ad25392d55f GIT binary patch literal 385 zcmex=uI=H%w(=K}(Mey}1a#RK7?>VxzCA7BvVV6b6eVrCR%U=n0x7G(T?gdvlGk&zMT zNCaTz;A8|TLWlraj7&gR3INrz0wobZn9(qiIZf~)lhLGLkq|KrK}H5f7G{Jz1B1{9 zM!`TP71jT@7G0w2`|tAh z!qVN!)7{6=+uY{v&DP)P^ZfVw{_XVpfq|}%G~S!|Npwo z+1>5?A^8LV00000EC2ui0A2xU000L6z+P`-Voi?7q;kn@I-k&}bV{vSuh^`1%k6rz zJsfB?qL|O41ejE#(BSV%Upt9x5m@{kM%(=7Y&!9t#9!C>oFt6t4|HHrYRW6PdRySDAy zxO3~?&AYen-@t~;D7`cXyAbeCaBNG7S|l1w(~WRp4|Amx-)R%zvxSZ1l^mRxq}<(FWFDdw1D zmTBghXr_tg3=6dB=9_TFDd(JY)@kRRc;>0+o_zM{=bwNED(Iku4*G!sh$gD&qKr1` z=%bKED(R$@R%+>`m}aW!rkr-_>8GB4aKNafmTKy$sHUpws;su^>Z`EED(kGY)@tjm zxaO*Bt{Cv(>#x8DE9|hu7HjOW$R?}ovdlK??6c5DEA6z@R!eOL)@G~iw%m5>?YH2D zD=x9vj%)6@=%%ax?z-$!yF!3Za; z@WTHx?C`@7Lws<=6jyAqy%S%o@x~m7n{me=hb*$QACGME$td$6#L6tU?DESn$1L;A zG}mnN%{b?*^Ugf??DNk+2QBmv7jWRi(MTt)^wLZ>?ex=7M=kZ#R99{F)mUe(_10W> z?X}iD82$CwWS4FB*=VP&_S$SOeL>rB$1V5Vbk}XS*D&0z_uhQ>?f2h+2QK*Fgcol3 z;fN=$_~MK=?)c-7M=tr~lvi%~<(Ox#`R1H=?)m4Shc5c)q?c~`>8Pi!`s%E=?)vMn z$1eNqwAXI``|Y^ruKVu1_wM`ezy~k<@WdBy{PD;qul(}NH}CxO&_^%*^wd{x{q@*q zul@Gickli8;D;~%_~e&w_|WL5um1Y%x9|S@@WU@c2pTM8|NZ#qumAr1_wWDz_UJ+V z07$?B8t{M!OrQc05`qOf@PQDFpaduAj}}nyf*8!81~TiOrsjt$i_Ch@r`hdqa5c* W$2!^#@s4=RqaOFj$3EUL2mm{Rf3^$& literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/bg_tabs_alt2.gif b/sources/phpBB/adm/images/bg_tabs_alt2.gif new file mode 100644 index 0000000000000000000000000000000000000000..a2142d5432be00a2e6395bed8b503a0eb053de5b GIT binary patch literal 420 zcmV;V0bBk@Nk%w1VFv(d0M!5h-R=9j%-PD^>;M1%;p_6)>G#^|_}1t3)8z8r?)=T( z?a<=z%--$P<@43%^v>Vz%iZkH;qcq+`O@R@&fxFM-Rt1+{o(Qc#?RT|@B7^5?%(eF z$I#ot(%s+b@Y>|;@ACHY`Tyeb|LODm%G2Gz$<_D!{?gv&)7s+H-sjQVBe^A^8LV00000EC2ui00#hR000KTz)}f=0u2VC5byV*4MZZCP8OS8uGd`8!sRA7 ziLe+0D4Q{ow3=gRyGez(oOGz$Z;rfv)#&?i2!Vnu6NQE<3yF$85si*16p@lU50#cR z3YnTU44s}I5TT+P6{V&c0;#Gws;VBXsjsjuumS|Nx3IabyQ;mZzqYtX#769z?d||0@&Ft4`1$(#{Qds_ O00RmfNU$KlAOJh7n-8b} literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/cellpic3.gif b/sources/phpBB/adm/images/cellpic3.gif new file mode 100644 index 0000000000000000000000000000000000000000..be46fc6fcc29f3b2e58196de077fd154c541ed06 GIT binary patch literal 826 zcmZ?wbhEHbWMq(J_|CwUjYc5;%JdWJ?TzLz5@)z+IF6J*Cz2jpx}USQym mXV8t{P)J~CWMbn}@YvAc$jr{K;4;BrAyX?m7Xu3mgEas{NhJ&b literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/file_conflict.gif b/sources/phpBB/adm/images/file_conflict.gif new file mode 100644 index 0000000000000000000000000000000000000000..4458c4ff230b69b2c5d0cb5e15527c07c67ea968 GIT binary patch literal 344 zcmZ?wbhEHb6krfwxT?bNyrbipug~9)AD=kbJ+iWR5+3@zr{~qVvrl58KD>PK`pT83 z-d-OjO?;Z2^?B`@XSFrYT3cRaroX;%Vn|&9BNzzMnYpV%4e_ z(UCu|U3+Y2{Ukp2Nud8@7sp4YCjbBce`I6;BpIj;6o0ZXGBBtx=zt6c`H6w8)M3(u zk_Hj2g-i~HIYAtYS4=U;RI|CXX3InYyDfqfRk;K7on3oP(i!qOu5kOQ4vNbd;iyia<~sQ#qRxC-0;{311cAfGAn1 S)lOV&917eVY;&C*8LR<45pCE2 literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/file_modified.gif b/sources/phpBB/adm/images/file_modified.gif new file mode 100644 index 0000000000000000000000000000000000000000..17e8f976c3745c971ca0d8bb4c36b6d1569471cf GIT binary patch literal 358 zcmZ?wbhEHb6krfwxN5-g>3ra;m$&{rU;6C+o?nNVex8v2c}n5=-Ax}ahX4Qj?elr( zKS$XAyxIO^FT=OJoWG9?e!d*{J4@oVNM%Y|)=%tltkx z{5;0>_w%KnR}=nzJo)RC*uS68f1dOBeo*wsS=T?WHvTwc|L5ua@26DWUT^q*MDg$2 zy+1F8{Jm=RYcIq9|Np=329XS;0L7myj0_A03_2i9AU`p%H9O1@D4QT6wU#NtAjgSg z{fa3DnQVTS)?5)1(AuK(mfImG#aXQ|`@_^eA*PQ%6m?Z&XE|6Eg>!G(Q{1YG+3VYXA(QmgfKf literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/file_new.gif b/sources/phpBB/adm/images/file_new.gif new file mode 100644 index 0000000000000000000000000000000000000000..d0ec75876d8889d1ec98c16d430c3c7546c3c9d0 GIT binary patch literal 229 zcmZ?wbhEHb6krfwI3msP>3rbFi{a1i@A-L3;pYkIUx%4qy}b4O?xsIS*njM0_7IE0OUeru>b%7 literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/file_new_conflict.gif b/sources/phpBB/adm/images/file_new_conflict.gif new file mode 100644 index 0000000000000000000000000000000000000000..84efde4faa94e7b0c95a2793e4f355a6a5c2a56e GIT binary patch literal 357 zcmZ?wbhEHb6krfwxT?%BZ{D0WYgXO4b7$+;EkAzzxPJZmix)2zFJ8EG>Ei9%x6PV0 z)J{3qZ&;Tg@WMO1rP-f5pnGNz216$L9 zi3K4UG79q#Cm800i7Z+XVwfpqc4^I*M1i<12^SkUI+-jY+rDi6;l`@yB_a~!&Mv5V zAZU5>CU*JAYDLBRNTH_45=Gf4A&G89CKeXPNDk(pIwi)b(*s3WyF}XO$}t4WGb!^X iMsYf^@vje*@>LcNh~ksn;l$0!!6(SUxyIR%!5RR?SbJyy literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/file_not_modified.gif b/sources/phpBB/adm/images/file_not_modified.gif new file mode 100644 index 0000000000000000000000000000000000000000..8f9b3d383916ce09c6bf67a1f8788c6c96ffa794 GIT binary patch literal 570 zcmZ?wbhEHb6krfwc;?D*;Q&>CNV|uNEGB zI(f&#N!uT;IQIO;(=WXnuIK0HXJuutJodb0`Pr&j`$~J3Cg#@{mz1cgswycfRaI5b z-T%bG!ot$VVban)MMXuHmX_%m8U1rsR8?1-Svy+U*hfS}I66Az7ZhY?=U7|Y^)J~| zQdU;kI(h%qx8)TT;Smvbwsy9*c6D?1wywGq79JiD7&vvw*5s_BiK~vMq@+xpI?deN zqI1Ko+RkY;J@ez@;yTt|TXW(?-_{4+oA3Ys|DRz<0mYvzj0_B}3_2iJgW`mNeR_jy zlPiN0E4wqR6LWJfr?bn%NzNR-jM9^4PU2#0;+?g?#i@mTqNA9Cx{avqWajx3jm70G zl@x_%IcQ2 zNYlYo%|LY~C&R^s6P@{7pM9Rh*2Kv5(?v*1)KNiSh*_M8mDfO_fsv7s?F}y%3xhQP D5Zj>E literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/file_up_to_date.gif b/sources/phpBB/adm/images/file_up_to_date.gif new file mode 100644 index 0000000000000000000000000000000000000000..c37234264629d4f5a4378c07f0b5be38a5b34f66 GIT binary patch literal 357 zcmZ?wbhEHb6krfwxN5{O?|DbuBa6$g&Xzt2t$Y&o^23XT&wFmZzLNaJuK!I*$`kvX zryjXaz0Q3*bm#SrDbH%|{k)d<%sc9l(S{cbmOY;|>sia&KQG&!W)(d1EqWHv{W?G4 zvGwae&r6;M{r&&9^L6gNFYCYl{ruq9joKG+DUTfsp7w^@rJh1xpy(BAGXPu&@8Hh_!g;B96)+ zPC-Ln0|D+J4%I-eb_L}Qu1FS!AbE8;CB@cA5vC?X2{8lhD1AO7(MUuasVh8^NkePx>nFP$W%Nzf-YH-5I`n?DLqf7ejYMy2O3{H7xq1E_Az3TJWFyuj U>|R>2x1(T&qnhx!=K>7Y0JXDBD*ylh literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/icon_delete.gif b/sources/phpBB/adm/images/icon_delete.gif new file mode 100644 index 0000000000000000000000000000000000000000..57962d51728640b66636143a9f4fc91ca9afc1fe GIT binary patch literal 255 zcmVHCpIecJdn*Ws<-1jU*u44=Z&EK@$}?BVfohG z?t_~D|Nr7KR_yHTA^8LW0018VEC2ui01yBW000Gi;3s|*fFuQ?9AoP&UMw$A`w((2 z505Cwfm|@AASGgqj3K7kFk*$nFV^WOn^l=&=;2f|n<__!DCE4=&RC`~vmf6j`@#;V zl`@G!X6K+YG7c1OVQXF+Pz@gdOc6N|8Zj6m4+AXky F06RBtaaI5T literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/icon_delete_disabled.gif b/sources/phpBB/adm/images/icon_delete_disabled.gif new file mode 100644 index 0000000000000000000000000000000000000000..da55bbbe445dfc0e71a24ca92c901ba292bbb6d1 GIT binary patch literal 249 zcmZ?wbhEHb6krfwI3mPw^XAPfmo8nudiBYZCs(grxp(j0{rmTC-@JL}&Yc_AuRnV9 z=-IPp*RNl{a^=e7$B*yazWws$%S#t8{{R1-9ER$0FlKT^%7{*#G>%ZZ7 zY_8Lxjc)437J@)Vr7jC;UULk zPKV?r0ujVSED}2-htUW~afk*0WkYO;IvtJ4pb%XOrU%v-Nl})?@(5tWE=+{(=Nra~ s4p0ODY_g7gXeJ0FLxD#kH68#MZyr2KKqCSbE+!}+9WyGGFe)JcJIK{-EdT%j literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/icon_edit_disabled.gif b/sources/phpBB/adm/images/icon_edit_disabled.gif new file mode 100644 index 0000000000000000000000000000000000000000..ac96b0e6dca874183e3165c98062c1f8008dabfa GIT binary patch literal 239 zcmZ?wbhEHb6krfwI3msP^5x49A3i*I@Zj|6(}xcqzJLGz?c29MefsqATOVxbgn|`%|Y*ojrT@s%|-I1Y`h$lb@bFUq$Q2DCK+fcGFSrudTw>% literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/icon_folder.gif b/sources/phpBB/adm/images/icon_folder.gif new file mode 100644 index 0000000000000000000000000000000000000000..845618c1a266a23aa575c2f12db1d75830e2c1f9 GIT binary patch literal 662 zcmV;H0%`q6Nk%w1VH*G&0M!5h>hboKy4$_d@kWTj>Fe%RlgH%d z>NI`4$<*Isn#!cY-TM0b_V)Pn_4hl0zWDk1#M$et#oM60*yri&^7Hj=p2^(g?EC!u zEO@$5jl;0Y;qdYE`TF`Pce%^n?RBTp;pFJ#>+!eE;IYl+CUm&=`1!Wb<{@&o;Ns`s z;pTO9b>ZXa;OFj%u+*o(*FS~8@9^^D<>}_=>-6>Z?CtRG@A2yF@A2~V0001)nVDv0 zX4~H5A^8LW002J#EC2ui02=@s000L6z@Kn9tYkV1&Z3hc5TDRrAv7BWR1{U9G2;}X zPsSoa0SwOQ0YH#gFu+od$~@TE@0&B=g!)1YGa_{l4i z6CjHyZ$k?w8xIo@5Ij6Cs4k?d6NM)WLj?%{533M9J-NBIs}BGPekc^RH^s)s$i)y3 z0vtaU2LKZ{7}Xf2KH1tl))+Sv00%M|BNGuj=;`X~>JTXn88Z$k7&P|wJlgs__x2bm z0S?H4up@`Tg9sBM+yTMEf)D~A(7-{lqQ#3AX+RJVf`bVNIdq5|NwOr#91Ry72mlg+ zOPAQRy_|_4M}&YG8eqtAp=VFCT)KMr99k0tJZL3$Ah5x-sne%S5$q@-?gt717?!2k^n w7FMJVv&4f20||9#@X$d5W;g{nNN5nlfd>mQ8c6U0CklZh(HmiNW;s_vYy9{r>*;_xR1$;P3GAcB9LUvC>+V z$&2-B=_WAqx`1$AQ?A+<|z0u?;ce?EE@ygWS9B;PK-Raol?$g@g z!q@2~bh!Ha`{n2B*X8l>^7Q!m`d5<1Uzf;IkHlr3&O?X5Xq?Dqn#g0B$KmAY?CtRG z@AB^N@$>ZdAaS?*{QU6o^WWj-0001)nVIqO^!fVw>g@0G^Y!HB>Ly^5Hj2{e>+WV| zX4~H5A^8LW002J#EC2ui02=@s000L6z@Km^G$cwDOtMl+7>H1)fz(kfI3Nayvru$M z&nOWAGfg0bbSzDPOiVC@SeQBi*0FrdqhEUfCn#blBNGIBH;Iahd;}mPf@3Ejh$134 z9+{dRiF_a@azYyz03IR{1qC7vJFTue4FwS*e;6A=DkKm$1p>YztvtfRBEAJT5F{!; z1|1-=zQz&L5yLzY(FF}49R>&_0tGKQGU=NA`1Z> z93t2_K#*V#0l|Fj;31&k0UHrGbbz6ufD9KHF}?`)!p24(FEYB2Q9uKX3K|5oV8N25 zj2t|2$Y7CUhs>5NS_sfkfuaE63pj!beRv=!QK3OC?1a&QLIDdsqDq}gb*fSd72v(F zAfanl8Z;h=ec-jM1Pd?xAy7b2!hp8}eAJjb7p`3i1Qj5-P$5H(9y$UG9!xlJj~p2) zT=~B0RTJRokGz7 literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/icon_folder_lock.gif b/sources/phpBB/adm/images/icon_folder_lock.gif new file mode 100644 index 0000000000000000000000000000000000000000..7afb092a8f1db6878d8ac80c4cf6840edce929e7 GIT binary patch literal 681 zcmV;a0#^M;Nk%w1VH*G&0M!5h$_dg%Ixj%$H>gP(dBh@b#*(t3legF1G1aU_W0Y~;q>+Q&(YP>)!0mixcK?`>g@0D@bdEW_51w%UteE>f`U+u!$U+w>+<;6 z+ur&5`tb4dT0g1-0o`MbTrqP*1e^!7i6z>bcOz{14z_4e`d^zQHRnVFepW@Z2Y z0NdW`2Bij}s4|2L6GI0Z92y<79X&j^x3sz%92;Lh3=W_<#Kp$P#Hs}h zKQtFCGBqaCCZj#q*gn)IH8LC*3IYcsA3Eme=;`PmG6Gx*GA1SS^FG-3JoNJ>G7uMX zGIZ=1NU)&6f;wcd0$5^z!-o(_ka$p`;sc2#IxJ(bpu-M{AVX3Nkimn=3;`Yt$ieCY zjSo8>$dtKa1rG$bJcIx-s^@^l5B}Vlh&l5?g9J#Cf*^1W*EJpPoWamRv7*(A0a_5i zVQVIj9x%WGD`0{|g#c)4HfV68Edn1ry!zlHY_e8TMxO@ZpP-f)YE> zW>~SdaRVNsaE)p}1c00u14w4rtdjuXuh&qZNa5qjffxk_p5+|kFWj3q8l)f%Wr~6b zh$&_WvDF6x(H4RmC=Er7iUkn{#N185$J*JZi2Gp>LjVK_6d+(g(X;ysI6{mdQ6d5Z P4G`!-glOSGNDu%!s{lm(^`qKhKY^J)Ze_({r&#i-O} z_V)Pt`uoh?>-F{b>G1aW`S~n)x|*`c#o6oZ^Z5Jx{LatQDR;T~`ug|y`Q_~M@A30c zj>IByw7 z&jMvb0x`~L6R6gT6~I!_qjWae@1}F8(@qWkzoPxdmdy!!E|64(S{2)EU-WfE>Pe?3;-xF HL=XTw3P?}z literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/icon_sync.gif b/sources/phpBB/adm/images/icon_sync.gif new file mode 100644 index 0000000000000000000000000000000000000000..16223dfd9a4b92754df7790c789cec24b7d67976 GIT binary patch literal 251 zcmVNk%w1VGsZi0K^{v^}>7e%aZrDTJh7W`L09zq$~BncK((G@7=-h*t7Vu zPVDRH?&8q=ofi19OY_N&_^?RsKR{g?>#zjFGgGW?$$ z?CR$InhySz0PO7SA^8LW0018VEC2ui01yBW000Ge;3tY!U{udFe#?juUMy?L#|dJ9 z$$ShbozFnl$VeoB0pPt9S0)IePTylP6CeKYo1s_U%WH9vwMy zEY^ fg@u@HtQiE9{Ka{=`$Tz_bHq6X1T_-06&b7n>9J!# literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/icon_trace.gif b/sources/phpBB/adm/images/icon_trace.gif new file mode 100644 index 0000000000000000000000000000000000000000..5c622e9a9dc22036b560f2ef5bbc6b910abf6903 GIT binary patch literal 307 zcmZ?wbhEHb6`11UtW9k z;`8^PKY#!E@$0uy`3&QVna1TaOe$vDH_UZxobT8$^~f9KNB-W3_MHl~Ri z_51JNfB*mg{{8#s&!1nve*N_6)5nh=-@kwV`t|FlPoF-1{21s$uuHKJia%Kx85qnN zbU<<-KQXWc9Eg6TJh3KZ`;s8nhYS4VPQP-KvdmNTQ~uD!>#)7s^+<(6%!Zk%XSb!u tX-clWme$Q7-I#lyFLP=RK(7o6YFx>g+usN=oj_T%#VQnKdw{Qf+s6F2#8aMmmBX8~`79gE9mnrY0tpZxK!g+{1QH)w9u^HmM3^W}(kM>Ogi$&Y4T$$SE(~K3f`=fCW}-qo9${FPjfD}M zjd8&+N|1CI7DbF8#0e@wMHpTXLJ-QvVi-It0@ZMl^z8 zL?DbnD9&-5zzaA*F${}hB#aRx#gKF)5JZ9y7KudTf`H*9M$lnVLy9(I2uiRl7mM-J zK_nVwVHA(Y1zNPovJ@TR1s*4<83>IF@i2smmJytc#$sY(ju#?PR)`B!BsvokL7^lW z3Bf3g;3z>s2o{No5F!wap%^9bJdBbd7#B$eVN4KshKX`K2O~rfLU=(?Rop4=J>a_1(y7#zr)o*k?CGDN{4NG!9wbmBx|J@HMtx)fX`I!<~W;=Dv zIla8}=thuyG0C2@2T(lw1DxbB0nOvCEvmfYb>_2$j-pD}{N0tuzo|CLNwewROWD=7 z@0$5_ULtLQjwczDO$5!pGg|NBs}W?@hhb z)uC0_=F2N)pShj3dX1@Dsl9FVr|mYFq`9lBdUQuJ>k9m7`CsY$OR~OdvV#YhCi@$C zx$X<#>i*pq)I|fYwy4U>oAoXeK6@)Ck(_e4)}cU+%7p7IX_htnK9C*MaMf9LuNRE= z)|bBa;n`p92giEfsBIcOv-3H?ajvBf80%|sy==)bjx>+?ucjo5A7- z*9_Nnr#HT}kXw|xsLI-XscqI~Nx1m^vFe1z$xE$;*Bi{O2}^aChdy2E+3Ne##6_DW z_2-_gmC1L`p6VK&EZyqMytD24cwSlG>8{7hb{vmN%Ql2rDZXc}^g6reyiXN}=j|B&BXLJtE{q0HrTXh5{X@P~&7gNx;@Zi>-Cq|WC)&T&ysBE0xbaYvY${JtGMr)6e>5yV zrm=KR<=L9XrnW!*?q?Y~+hkdS+9r`Gp6y7z`s4G5p0X_Yb=KrR(sd5rA7~v(l}yVV zpag84UoZpUCI^2%(2=ue7V4<6cvCuVdY$?m^WVsj`l^g-tp1mf3EZyZd?^D@f14nw z*V(Go10BK73B@pbkSNfp6p|~~^Q_FyJM8*s!HIBH>~nqimgsEnoMNYDlZ3w+3U+0c za8q;fJ9BwABqb}{HzfL6-;=z)DgWU=f0ACXCr-cr-M_Pl_D@E$$X5HtG?VvDf4(sO zvrTgyci;3s*f6+Dnm7pli+6)^v{RDNBTXom$a6h@VELpysZk}DYTdFD(`fRGr@C}Q z?)+sQz}Uz+48>+?vawTA>~*Fz0)_KHqUNl}x$>1}utDY5bV1IFVtd-#pSb;6mP=lF zxLXC9s|v4qFEtVwc)|Uw%5%{d%$3@OiVPi^`7}ysQ@be1ES4-g#Z8m literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/loading.gif b/sources/phpBB/adm/images/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..e1ed0883e07c63f3a36f9ee38318ffabdfe44147 GIT binary patch literal 1320 zcmd6l{c9U_9LGOt)7<6K<~f(UB$vxmAJ&H~TlbKzUA3ESll8uJwt_Hp&><)jMP);L zm|QM*NnEn6Bh6&Z3@cmf9>f+l?VPUcL23mN9Qag_IhEqWZ^A%@so#rp-u?p*?x%ad zzMt3k{kg&9K)h=#1R+>KaPya6%@&KPzTRfHJ6*KX>2lzgb~l*K1W6hU1|vlojg(%m zKUg}tW9P2-u6%Ui@?vHBjGqs_oKg})!y7mCpzWiFN|TqDKGo@Tk*4M^Zmck@Cm4>n z8TPTU#~Id3yII!b<@kWd>q}+xucQ=@kMnUn=MU_C>D2?p*S(y7`G=p!kCb=p9P8=r zYmct}`1)7H$;u1+Qti=LynFMd#ZN9?UFuvP=luMh7xxV&1+R|_g(K0}nx~)J+tj?O ztEYD$IduMmtNFvF-OoJVxglPjn(+sMU*7zYb~EsQeS&|PhWj5L-P*Uke{D2YtHYkb z-}Q9>2-;O=bxlC5h)7DysG**$ts{uKTC%=DDNaa6onDwMAJglMr4pq(Ha#Qgs43ZG zcyqRFFrD?(%*~f;Jf(LpEYwVx7On~BWa{k&jtkBk&ZJLX^I6Rn$DA&0{7`@!VBb7< z99^H`L(^WD)7H7+>&(&F@N8nsygvKQZ6WvP#YQS2*shG_&427VX?^5GX5QB)-+J=9 zw!~cTw{7f3p z0QNq$f_xwjC9u0uf3+wnjEhTi8rTR<46BN*BI3J|qVQV>{28>Z3mCc(V8P~ec@?)E zDv)tl%vN6^)2P8ojjRv6NRqJ)GJ_LYz(zalz#uoPl_i0Kx~eRPD_P4+Zgw!F<~meB zB_(`7-q zS`7*zS?2gnS&45iNNwXqZIlGZo!%MI4C@6&u?*dxQCj`Ic_lnvoG9fr0&2^()g@8? d2uOVTp3nbwY83?`yc#5-wJ)159KZv+{{|9CDcS%4 literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/no_avatar.gif b/sources/phpBB/adm/images/no_avatar.gif new file mode 100644 index 0000000000000000000000000000000000000000..ad73330e713ec9a21f97366b326a8c66afe5e9bb GIT binary patch literal 930 zcmV;T16}+_Nk%w1VPpVg0M!5h!_3s-=IPqth19I^!oe!#m?2-;pXx4 z_2lU6!_Cz8_xS1U@6p)a$I#d1>FxCP_uJv+;pOS&>FnoQ6%sUqgoT9?6&QSdUl0ifhLMtk1_=<1 zTL1zIlbw)hY95S;PU3YWDB_uL7! z03h|FX24w^3i*en7j3nYtKz;q!c zu?v_ExZHIB)3%wg2-w6KOD7}$nLJU|WYjX~DVU5<8uhf2(a5EpOfvEaby7%18LLX- zxJIH@Ll#Fh{7MMoD1>AOEsQAeYr%bK|IxEoHD5A#TIT^&x3nELaZAmCo1rbJx4}ZD z@w|q3#xk7G8VeET@|ffyw{9lv1?}<>R}N=+K2mC+s?kU^(X9sRB5ERz+7hdz?==z@ zEdscJQ4EHQ04-S9E`q>A0S)&w6!3uTb%+2XG>!-m!t;XyKuI1b@Bnd!0xN>9D3BqV z2?`>rilAVk775u^4UoVD0!4|mgG!(PvF5=C{Dyqc9U2>?0AM63Y;eX2DjX<@3MY`! z0S69x!a)aNbU;Ccr%-^u;TIHgcnSw!oFF1B5puCXgD0M%f`VE+U|@@=q%hzWApA!o zEFbW91qwUrg2ELf+!rJ)CCo>K3Gf~1i2?0Rv7wW?P%uRX=}{Sr2<1glfR?)y5XA%G zff>sRH#YI5nYxJSL$AcLo<$N*>&8ITG~mqx^(Dk?D`f$6J~Y#Iar EJ3isPuK)l5 literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/no_image.png b/sources/phpBB/adm/images/no_image.png new file mode 100644 index 0000000000000000000000000000000000000000..1061ee3b8fffaaef55c7a819438d50c02ddc33db GIT binary patch literal 401 zcmeAS@N?(olHy`uVBq!ia0vp^0YEIr!2~2t6#1S3DbW(wh!W?b)Wnj^{5*w_%-mE4 z_RAc6jJ#4J_r5I#Dqt`1^mPRb@pG1koAm>QI14-?iy0WWg+Q3`(%rg03=E9?o-U3d z6}O(=wB|cxz{3#GyocfYeokv`ai*{dN~Hytk9}P4ccP(1qf>sHH^=hdk2x8(zh+I7 zU;q92_m0-6c|MxzCMxGXeUf>ziuI(cuu6@6#hQKXDm5II#vym+r*;Ir@8Y!-cRUp| zo%Jy5cMKl-ZB1rVJJ@;n>pQ{Z4H0r>`X89` zPhOw*AitvAV50uan0h6{$1*!3+61RRtk-<`?5;+|k{lux@&w1z7LGPK%w(HtCXXk#N`@WxNae6wc6lAx^APAyRS5qO2$BM`FnGSU>QaHA zn~Ca54~zn){yq*hG8(VFn$4<*b=-py@WrW7hqLi_2XXIk&U3Gl-_kBCAAr=#cF73yU>cN6zDQp*1UOBsBB_uNSvl|u7bGrKzTb~iH4e*1(vwi)+aK@wtO+) zbSTx=3d?Io1Xt8#*82`z<}?j7pZ%>FxX%y|)>$FGC2&27{VvUaj!-sU;pHHAhbEo! zK{*K@TiAoa3 zDQ=r_hYS7O}Wtcj^uBdO*2`AJiGw5taZSZd^(7UJkyN(E!KoLd65&~c<-_k4FD z-x~eW7iXNFnVFe8dRqK&W7_0mAyrqd^=fQzaL`?Z5h3o>|CX7JEl=>~5TwWT4cq#~ z{LU~AcLQ3Oqa8@2f>@J@9cylahXOllm}QtC;w!+hjPuVKKY7I1cST{Z-d-Ah)TjN(iQDz^$5@p-;g_n}2E?v1QARSsI98q9vj~$)=XBOF{G$1z>KSEYG}u+tcaEM zMgM$HzT#BY-}kZ`8ym~7tlYE?36Zh2vtuxzbC~;N(;>aFv5_=6Ihp+I>C-!6w~}TD zKUcecy9@O+x&SiwpZKlqsnkEcWRcPkhkH>~TM$_a0bPo`;+J@wLH4tDfb( z*+oC8f(m2Tk!lBwBZ%4o004THGeu3rt{e7uvSzu6keuF)JMuW1cJF-*t3Z5mvQ=H+ z-qQHt)ekXJ)fb9~kBo1^-xb9Fg+CU2=6ku0rG<`rI2IV+o+ z(c{6m<01q8+nk*5jRa_zn8-_w-gFVZYa!TvfRbf&vT%Tm%q!?Y!t$h&LhKnBjuf?X zQOvzQ-S$3Oiu$*0_A*b`MwWSXbL}HWF<7iNb(|8e<$PE3&*{N>$umE{&Xb$h`W(f- zH8d1iysl}G&uo7u&&$he-*#+0VFREl?K8$;mNXVZ#{6J`?Ns zq;~3&I2o!4FKl`v8a%peU#Jwctqc{2I`%OtDJxg}iO%8~q)d4!f6Z@|J|wH3Q29O1FoWsFPex7xptmNBZi`D>kovl9!Y;VY_*= zUP&n9`$;ez1Wx273%u|5@83GmnXiw}X=h)5|I+jcMVM!}ob{y--j9`)6$MvU!9GXd z!7x!hQAXGkXXh6>C4cNnu=7N%7PBMeCROd$B9W1StHazYeo}gLwUyP?J{o)%k`_Lc zezyyZ%gZ}$KdbVj9{f_&r;}k#o@iksjyJQgU?y`^GI^0jK-%4 z?D|1|QxglFGKY|mkZ#pDik5-lNcjV6-xEZ;V@=zt-_Q0fa@?vPSd?8(PHst6{#0L1 zSwDf4qu=s+N(YY~BC9l_UM^EB-bG4-bdZ;!Z$Nmr<#a&CN_Q zh2}Qv)+8oL_LO}X_7)Qplc0dW)Zy0LoY3{SMiA_uS65ee#2x!G`2bO$Z*8rtK-#$2 zq@)X+Q(oxd!SAjF3E5We*I_Ix2SFf8-r-g&Gt$#7WxRfcsle%jbAvbQ7yA18;zUJ7 zdoG{Oct}b~OQ*bgwLOQ)5JpicD1NGQy|)Ok>FYPfn}7pS5XvZ54W0&LeSKXU`Wq3Y zPC`ohFW$*8t-H{NL=`)#gfz_J#J8vG;|=~BWyx`Iq9C!K;t(74&o90emX`9bv0WX1 zFRgVQcT8fHeY4}_A(lnW!osrGNvqqaqCcX6jFr?&q>VLy^oYs$qp7!6snMm(ekEsvrf_gjlyM^0Ft zaz|v3F5#(-t{=$CxNB*_#y*<)g0OGkH)=YJ23sc=|H$#0y1KBuoZPbN=xg^7BB?+% zId`%t_}OD5vfU;M>8(>?jNYkX1}XTB#xvv?p6!Qj#na8=DnR>svLPUw3yBQ_}i)l?gSH=bHH@04RruohYnd zH?Bj-NtjAstpNrjBG?bQa1SXo;P>B{dKmb-Gfp72$B%nrfs3wBfm0175-k1+7N2hb zqC7b|PU*IZJgELxt11zR(J_*>q!(jgPfUx!S!0d)#0-XCp(~S0%;n7r~9jU z1jiqQl?M??Yinx>w^Kfx{z&0O?RB_a8_dkfkv-~76I=%3$UEWob$YGALTC_?!;^V; zZkLRc!-@T-HV^H88V-XxfTli8Zvdw9YM4du0Is61H4pVa+MHd+`;QvQ{GM^b+V+&Y z{S5I5UVM^kjeabE-X7G3K1VN{qM0>fk6JT9y z{x9h4;`41uI37235or`%PfJUqkdTlF4xitcsozu6(CD27lHRw3qenK@)zy(gw=ZbR z{z>q2Pu#4m}_mf2f9R> z`6VlPPKfIG=x8Vl(t3r!>wI?+vurPBMrA3KLGDv86QN0R_-%sa#*HZ1;KLA#)*13b zbVWrHi-e1j!pGRySUwchT>~G=?tJmN{(ooQ9C~(`*LZolz6eH1`=pWx&V8Ap8wRCch=tM96mN)c@O@KW)H5ASfqLk34>Gz1zds4Un^Gh};RRRH8i+nFaSO&0G zVoi=QE;T9u8NFi-z(ll(QIK%xl^O{of8V>QjT0x~*lhL_%glrvA+MOX#oIwmXu{}} zloUNaI*qGqmTWt5l9G}P2BnCFPD_-|7g*$XwI4TESnDk)fvAYxxl{3;;jMiJ=IK^6 z1(Uh_`L<%ckw6Z+MO6_W86Y>DkX7@!YkdA)>IZHj%$b5<8*J4tP98N5EJy4vy}kSK z&S=Oc-yrSC=%~Z)KnJXZn2G;>MD5mak>=dk`1nz}TSYGxo3tO)l$o7tjQ(B!f%RgL>T>`x1ri4XMfs|i=x+kD2-H*u^?VI zxa3Qz>65<`#3_mOqWtAZf+z^Z{Rqer$_D{5bz9A6xv*C>R2uXNi!^fmH1xpwGD&(o zxgh9}ds!IsH|_uDicUnGV61-Q?{Gx6uKG!x^Xhg)-WMV8t+xQ!>3$epBjwmN=vmxl zz+ZgRX)F2?FmxL#ZeB;^)BE(AjKe6I&;Qg&nO!DD?OKwGFF_cuQVxt~sWn;+1Zdts zjB)~f1yzbkt{PXof4zllfLVpHuey2<`m(1_+9sCS1%NOx?{&^aXV;CzCI;%1)DY*z z#*zS>YEPK@6+}om1dwWcnH*KhM4@XrI=~oCqI{5-lx@i$m+?%$dsf}prHxa%=d+;J zgmrY?)pdO7_ey@m=T=fTt82PUu93inc$jltAW}WEPHPb+ctcXxu=K4CuZ56F@*xh9 z^!oK{7YOb1Xx`RmGU?Jf+QYgnHz)%`_}MfO?Ba4|g19a)KiWi%((2zg9tK!`oo#rQ z=LrU*TD%S4FrDI^665kwE*_qjf1JwO6XntH^l_7Hu+d|Q5!S%OvNFvQ-Mq@EU;hny z+34g*J^jU+=v&SnsUVP6=CvnFC>twJ_kd(|$7pLBy%nOZjrG2EPe4MC%CXk`fKIuK zA{x!)cAr1~H2|V2H8s_V)H2RX@M_8HUTYPcMEW%~K9VFv&PoCP;%~Zy>)6{b(;Fqn zT9;n7l=prdQAJi53t9+eY+ul92gm?sN8j4C(k;QQ{sii(fu4Rm-}1KY=J&Ahkc2MV zUsSjEC4aCX@Ar&VJQDPinq9OG@Iar9$-$fNF;m{l(W#r=eCK|664F0fZo)RSe!yF4 z*%V~Ph)jYUufju8)FKlYgvZD#W;gshJkT93wLhig`9f|-DueYHge@C&;q<6kkOgbw zL${Mua9k;Brz{JGbjpu`iD)#1v+BK)H}biTY^01S*x5kO{dB&YEluP~o&*ked2ul< zS2j4kcG9gOa=IvnoHp!PD=Yl=ZTxcM3Mt&skT>^?J8MNn#az>FuizOo<@fp;r-A1; zo;>*p3Kx&Ofn~-p;?$7CNv9YJqK;<-JJyQ)PJw}esg_k$XIRhYd&=(a8)$+_DLb(& z_@l3G_Yd}Qy1;3z)P2z7y9@%QN9BC?$EvC=GS}-WBpjCwNIV6eR1R6$i;QQpPscMI zFzK>)J%2X#HCq}ld)>1Db;XH4u2}maSyVn=YsvRyHZ;+$+};xQ(K{mnw$O`%@#UhT zBJQrvPQCz(_Ni#LDF_RrG;x@Gcz-4 zc>_nW(;K-SHIw$n5$kk+%ZRB)(_+y!EE#i%JZPAlVPRO*8fizOjBe~ zDk~t+%ahvkEk8fMS-*Vr;d=qRRurVRMDKQ@;t3li^pz>b&m>`g&%nybQ}V7t14^y) z*SKFFkrJ1kVo5mI%_2vdO%&eKq`}S}{=!du1k51Yv^)RBZ>C7$^FGRTO+-!7)>Tlj)M{+HR#p5rTne(5Bxc>%YnFV5&t zCo_M(>5Ktx*{v@2#wV4M_gkEv8!aKq%wZ#6!H{aTzbr51uGSr94#ZkqPiB^l+Lp!eJm^h?6R3y# z9xtCPkxyyIaF$s0P;c`@zIqxyH%3}%;(N5~gCJi^JLyU19?a0Aa%nqq)Y*i$NHwzJ z&l{bM_N*(Gys+2vF6z7bhJvN1rbbxq6Cp{IvhTVJ0Ii*w)T4OqFlhv3C&b53F-Dgj zFUwy!?+3^*?Nl9QIo_bBzuR&!_J|S?md~$Nyf-$P@$K!%%PSfO(~7Yx2}T(0&FIpA zJ*=d#mym3NO(wZ{#hCZX;Csqw8=<%Nyukd3iv2K*!>B&0YVU%$HtEilm0Aw*z?LlYAL=;;k1ys)LE zr8xhF(3zS6x!|}|>GkdT4pA`clUnnb9((hSz40fA9`K%7%I^b#LVvM#b{}Y(NI(X) z<{Ox^!;Neb=-leP1s02?#Vc$+oN~Qmkpr{I0X4~Gon#LF51_l4>Y5r?R@C_p?p6}d z5alpQE@)EuWtYs}?9c@CX{3YpSMH`epl*C<182il1J5qSt-^t^u!L^X z(9p!iP_mTSnBDc=n5tzXimjTN@9ohi(#EOFYyo{W0q|He7Hbv^H4aWqO+7X+*cHH3 zXAx5}e<*U6BAt1Dk)BSksi@c?D3InN2w5}+dhfd_01yQY0z5peSWHb!#-D;dWl`JOez9Sa${tclNofRl6tP|m#_1)Kq|ndhJ*-uY zV-gUgAi0x;)c-)%pMvWv2qCMM@Q`{7OA3XD=H@Q^ckaw?EfeW3E-n3Bq6dZe7K^we z%*WUF2vmghaLjYqFT2a!%*;%ebO%i^7`%yw^b8F08y-6zj;j=S8!0Pyb?)x&9?GB3 zQ;~E;co0BuigPThOf1aJ-!yv7Beim6PGCo8%?byHo3oE{va^}=`mM`}fI8%z{@_d| z31lOD)pJwJ&Cl;kL__!7p1rfPvrkZv6lfAvz%iC{XwN)W==hHJwbbHk=pCoY3pMWbOEY{lE_a%&c9?}@ z9IN4vepLVMfMfjef7E%+hr6y07p(#AK7=&L15q-`;-Dk-9eO8eQfXYSm`)3&3tL(8 zE?_B=uPGS2ySuN0_Rw!{-#kWE(5cLGsWtyDz18SzBVuRYWa)_)28_WO#4alvs)9Pc zHtejaiFx)<-AvO%85DRh)hTd{26&z8Fc~;r`S|R-D8q7U6vR>mZk6ZAHI^O9!(#e$xbRRBMKYvuLxbuVpg#1U1qBlLM{pLMg*A5>7G*Cv#A~hl! zxVumU#g4i>jKpwe>X=kooS=JqHCV#L(jDSd3e=y^M=>A(Uvz)__N@~AGssl}Q_VJr z*f<7;WME%VqSMJ6Q2pKho0mAdYJAYe*Y)iu4weYvN(%u(8&H$wx?z2@qEky zTj>5!`^Gf-YBkF#_hgY>>x7`U^`aY{mSHE0sitWE>U|)8ZCg-BwS7+KcwLD-ZyP;_ zZ_3x2)miOU{3_!U<+Fhpi(rk2)&CqO*I^wWm;5k$mOTfnE;HvSHMD)Uhz(LPjQHz7 zQNGs=xwmm+gVmo;P9B2pUG8-n8je4_x3-#&ev;33i(kE@)5))u50$khXi!|i+l>1Y olkDCe_niuHZ-kBDtOXBJ@m3#ng!Y%fe>jl3vW`+E(mMSA0ItRG6aWAK literal 0 HcmV?d00001 diff --git a/sources/phpBB/adm/images/progress_bar.gif b/sources/phpBB/adm/images/progress_bar.gif new file mode 100644 index 0000000000000000000000000000000000000000..1ae265152cad03d45dd8bd834adde294ee644c8b GIT binary patch literal 1353 zcmZ?wbhEHblwcHK*v!bVWXY1JPoIAN{Q26oYy0-?TeD`((xppp=tUelbm(b8?`1*9 znKNhp|NsBnw{Hw!p!lEL&ow02*)hP?NY8+o5h$qmlZDlYfssK6qyS_r1IvE{j}5E# zTD(5H`+tH)UrOe@j4Y-}Av{dV=Sy<$SFC$q^Zx&V1qB{DQteHSjz$(%^DnF@@md=t z+03BOW)PAhzQOfRYRlQ=lAmY%wqJi|QL|6s`ql5{ar>6v{$J5h)l}0`*VxhA+1ky< z!NVkC6xZH0t!Mhw8M9~2t)1VtpnKlJrHdEMTrp=AH(S!Ol^a%XTC#l0njPDBZQHYP z@8T0aGadPwW^Ya~=x&EGX za$*68p9m=Ym>HNExPXv>Mbbcasnddzpzi9u_t@HEe#~4RnRa89N0K-rLNz~JwMc-c z=%GDVk|NEoM?ddW?3lQ`a-kqXp)|1y)rnPTOsqnCVikH5t1z5cg~`M!%qLc1HL(iY ziB&k6ScUV6Rk)g1h1-c$c$ip)=ZRH#n^=XdqfQtYvn%VZ`yDQgw4er)UO?E4 zG}?&ude0I+aCWBTh&{G)+1Z^EH2%S&yR*F@2^#-k(M{6WB}?Lfl40@y3ddLk8ZD?9 zg$ociBaL=%^s=MQ51jIZB#U7`y9^j^TNb@FZ#UFVO{XJzi2OxCoPcgy&uO1 reI`&k%nR$;Tn^vIGfg}7`&j +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +/** +*/ +define('IN_PHPBB', true); +define('ADMIN_START', true); +define('NEED_SID', true); + +// Include files +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +require($phpbb_root_path . 'common.' . $phpEx); +require($phpbb_root_path . 'includes/functions_acp.' . $phpEx); +require($phpbb_root_path . 'includes/functions_admin.' . $phpEx); +require($phpbb_root_path . 'includes/functions_module.' . $phpEx); + +// Start session management +$user->session_begin(); +$auth->acl($user->data); +$user->setup('acp/common'); +// End session management + +// Have they authenticated (again) as an admin for this session? +if (!isset($user->data['session_admin']) || !$user->data['session_admin']) +{ + login_box('', $user->lang['LOGIN_ADMIN_CONFIRM'], $user->lang['LOGIN_ADMIN_SUCCESS'], true, false); +} + +// Is user any type of admin? No, then stop here, each script needs to +// check specific permissions but this is a catchall +if (!$auth->acl_get('a_')) +{ + trigger_error('NO_ADMIN'); +} + +// We define the admin variables now, because the user is now able to use the admin related features... +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', ''); + +// Set custom style for admin area +$template->set_custom_style(array( + array( + 'name' => 'adm', + 'ext_path' => 'adm/style/', + ), +), $phpbb_admin_path . 'style'); + +$template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets'); +$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style'); + +// Instantiate new module +$module = new p_master(); + +// Instantiate module system and generate list of available modules +$module->list_modules('acp'); + +// Select the active module +$module->set_active($module_id, $mode); + +// Assign data to the template engine for the list of modules +// We do this before loading the active module for correct menu display in trigger_error +$module->assign_tpl_vars(append_sid("{$phpbb_admin_path}index.$phpEx")); + +// Load and execute the relevant module +$module->load_active(); + +// Generate the page +adm_page_header($module->get_page_title()); + +$template->set_filenames(array( + 'body' => $module->get_tpl_name(), +)); + +adm_page_footer(); diff --git a/sources/phpBB/adm/style/acp_attachments.html b/sources/phpBB/adm/style/acp_attachments.html new file mode 100644 index 0000000..da8a009 --- /dev/null +++ b/sources/phpBB/adm/style/acp_attachments.html @@ -0,0 +1,464 @@ + + + + + + « {L_BACK} + + +

{L_TITLE}

+ +

{L_TITLE_EXPLAIN}

+ + +
+

{L_WARNING}

+

{WARNING_MSG}

+
+ + + +
+

{L_NOTIFY}

+

{NOTIFY_MSG}

+
+ + + +

{L_UPLOADING_FILES}

+ + + :: {upload.FILE_INFO}
+ {upload.DENIED}{upload.ERROR_MSG}{L_SUCCESSFULLY_UPLOADED} +

+ + + + + + + +
+

{L_NO_THUMBNAIL_SUPPORT}

+
+ + +
+ + + + + +
+ {options.LEGEND} + + +
+

{options.TITLE_EXPLAIN}
+
{options.CONTENT}
+
+ + + +
+ +
+ {L_SUBMIT} +   + +
+ + +
+

{L_SECURE_DOWNLOAD_NOTICE}

+
+ + +
+ {L_SECURE_TITLE} +

{L_DOWNLOAD_ADD_IPS_EXPLAIN}

+
+
+
+
+
+

{L_EXCLUDE_ENTERED_IP}
+
+
+
+ +

+ +

+
+ +
+ {L_REMOVE_IPS} + +

{L_DOWNLOAD_REMOVE_IPS_EXPLAIN}

+
+
+
+
+ +

+ +

+
+ + +

{L_NO_IPS_DEFINED}

+ + {S_FORM_TOKEN} + +
+ + + + + + +
+
+ + + + {L_LEGEND} +
+
+
+
+
+

{L_SPECIAL_CATEGORY_EXPLAIN}
+
{S_CATEGORY_SELECT}
+
+
+
+
checked="checked" />
+
+
+
+
checked="checked" />
+
+
+
+
+
 src="{ROOT_PATH}images/spacer.gif"src="{UPLOAD_ICON_SRC}" id="image_upload_icon" alt="" title="" /> 
+
+
+
+
+
+
+
+
{ASSIGNED_EXTENSIONS}
[{L_GO_TO_EXTENSIONS} ]
+
+
+
+

{L_ALLOWED_FORUMS_EXPLAIN}
+
+
+
+
+ +

+   + +

+ {S_FORM_TOKEN} +
+ +
+ + +
+
+ {L_TITLE} + + + + + + + + + + + + + + + + + + + + + + + + +
{L_EXTENSION_GROUP}{L_SPECIAL_CATEGORY}{L_OPTIONS}
 
{groups.GROUP_NAME} +
» {L_NOT_ALLOWED_IN_PM} +
» {L_ONLY_ALLOWED_IN_PM} +
» {L_NOT_ALLOWED_IN_PM_POST} +
» {L_ALLOWED_IN_PM_POST} +
{groups.CATEGORY} {ICON_EDIT}  {ICON_DELETE} 
+

+ {L_CREATE_GROUP}{L_COLON} + +

+ {S_FORM_TOKEN} +
+
+ + + + + +
+
+ {L_ADD_EXTENSION} +
+
+
+
+
+
+
{GROUP_SELECT_OPTIONS}
+
+ +

+ +

+ {S_FORM_TOKEN} +
+
+ +
+ +
+ {L_TITLE} + + + + + + + + + + + + + + + + + + + + + + + + +
{L_EXTENSION}{L_EXTENSION_GROUP}{L_DELETE}
 
{extensions.EXTENSION}{extensions.GROUP_OPTIONS}
+ +

+   + +

+ {S_FORM_TOKEN} +
+
+ + + +
+ +
+ {L_TITLE} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_FILENAME}{L_FILEDATE}{L_FILESIZE}{L_ATTACH_POST_ID}{L_ATTACH_TO_POST}{L_DELETE}
{orphan.REAL_FILENAME}{orphan.FILETIME}{orphan.FILESIZE}{L_ATTACH_ID}{L_COLON}
 {L_MARK_ALL} :: {L_UNMARK_ALL}{L_MARK_ALL} :: {L_UNMARK_ALL}
+ +
+ +

+   + +

+ {S_FORM_TOKEN} +
+
+ + + +
+ +
+ {L_TITLE} + + + + + + + + + + + + + + + + + + + + + + + +
{L_FILENAME}{L_POSTED}{L_FILESIZE}{L_MARK}
+ {L_EXTENSION_GROUP}{L_COLON} {attachments.EXT_GROUP_NAME}{L_NO_EXT_GROUP}
{attachments.L_DOWNLOAD_COUNT}
{L_IN} {L_PRIVATE_MESSAGE} + {attachments.REAL_FILENAME}
{attachments.COMMENT}
{attachments.L_DOWNLOAD_COUNT}
{L_TOPIC}{L_COLON} {attachments.TOPIC_TITLE} +
{attachments.FILETIME}
{L_POST_BY_AUTHOR} {attachments.ATTACHMENT_POSTER}
{attachments.FILESIZE}
+ +
+

{L_NO_ATTACHMENTS}

+
+ + + + + + +
+ {L_DISPLAY_LOG}{L_COLON}  {S_LIMIT_DAYS} {L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR} + +
+ +
+ + +
+
+

+ {L_MARK_ALL} • + {L_UNMARK_ALL} +

+
+ + {S_FORM_TOKEN} +
+
+ + +
+ {L_RESYNC_STATS} +
+
+

{L_RESYNC_FILES_STATS_EXPLAIN}
+
+
+
+
+ + + + diff --git a/sources/phpBB/adm/style/acp_avatar_options_gravatar.html b/sources/phpBB/adm/style/acp_avatar_options_gravatar.html new file mode 100644 index 0000000..0c2e8cc --- /dev/null +++ b/sources/phpBB/adm/style/acp_avatar_options_gravatar.html @@ -0,0 +1,11 @@ +
+

{L_GRAVATAR_AVATAR_EMAIL_EXPLAIN}
+
+
+
+

{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}
+
+ {L_PIXEL} ×  + {L_PIXEL} +
+
diff --git a/sources/phpBB/adm/style/acp_avatar_options_local.html b/sources/phpBB/adm/style/acp_avatar_options_local.html new file mode 100644 index 0000000..8adafa1 --- /dev/null +++ b/sources/phpBB/adm/style/acp_avatar_options_local.html @@ -0,0 +1,20 @@ +
+
+
 
+
+ + + diff --git a/sources/phpBB/adm/style/acp_avatar_options_remote.html b/sources/phpBB/adm/style/acp_avatar_options_remote.html new file mode 100644 index 0000000..1c0e3db --- /dev/null +++ b/sources/phpBB/adm/style/acp_avatar_options_remote.html @@ -0,0 +1,11 @@ +
+

{L_LINK_REMOTE_AVATAR_EXPLAIN}
+
+
+
+

{L_LINK_REMOTE_SIZE_EXPLAIN}
+
+ {L_PIXEL} ×  + {L_PIXEL} +
+
diff --git a/sources/phpBB/adm/style/acp_avatar_options_upload.html b/sources/phpBB/adm/style/acp_avatar_options_upload.html new file mode 100644 index 0000000..63a734e --- /dev/null +++ b/sources/phpBB/adm/style/acp_avatar_options_upload.html @@ -0,0 +1,11 @@ +
+
+
+
+ + +
+

{L_UPLOAD_AVATAR_URL_EXPLAIN}
+
+
+ diff --git a/sources/phpBB/adm/style/acp_ban.html b/sources/phpBB/adm/style/acp_ban.html new file mode 100644 index 0000000..9e9f051 --- /dev/null +++ b/sources/phpBB/adm/style/acp_ban.html @@ -0,0 +1,131 @@ + + + + +

{L_ACP_BAN_EXPLAIN}

+ +

{L_TITLE}

+ +

{L_EXPLAIN}

+ + + +
+ +
+ {L_TITLE} +
+
+
+
[ {L_FIND_USERNAME} ]
+
+
+
+
+ +
+
+

{L_BAN_EXCLUDE_EXPLAIN}
+
+
+
+
+
+
+
+
+
+
+
+ +

+   + +

+{S_FORM_TOKEN} +
+
+ +

+ +

{L_UNBAN_TITLE}

+ +

{L_UNBAN_EXPLAIN}

+ +
+ +
+ {L_UNBAN_TITLE} + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +

+   + +

+ {S_FORM_TOKEN} +
+ + + +

{L_NO_BAN_CELL}

+ {S_FORM_TOKEN} + + + + +
+ + diff --git a/sources/phpBB/adm/style/acp_bbcodes.html b/sources/phpBB/adm/style/acp_bbcodes.html new file mode 100644 index 0000000..8c8b805 --- /dev/null +++ b/sources/phpBB/adm/style/acp_bbcodes.html @@ -0,0 +1,126 @@ + + + + + + + « {L_BACK} + +

{L_ACP_BBCODES}

+ +

{L_ACP_BBCODES_EXPLAIN}

+ +
+ +
+ {L_BBCODE_USAGE} +

{L_BBCODE_USAGE_EXPLAIN}

+
+


{L_BBCODE_USAGE_EXAMPLE}
+
+
+
+ +
+ {L_HTML_REPLACEMENT} +

{L_HTML_REPLACEMENT_EXPLAIN}

+
+


{L_HTML_REPLACEMENT_EXAMPLE}
+
+
+
+ +
+ {L_BBCODE_HELPLINE} +

{L_BBCODE_HELPLINE_EXPLAIN}

+
+
+
+
+
+ +
+ {L_SETTINGS} +
+
+
checked="checked" />
+
+
+ + + +
+ {L_SUBMIT} +   + + {S_FORM_TOKEN} +
+ +
+ + + + + + + + + + + + + + + + + + + + + + +
{L_TOKENS}
{L_TOKENS_EXPLAIN}
{L_TOKEN}{L_TOKEN_DEFINITION}
{token.TOKEN}{token.EXPLAIN}
+
+ + + +

{L_ACP_BBCODES}

+ +

{L_ACP_BBCODES_EXPLAIN}

+ +
+
+ {L_ACP_BBCODES} + + + + + + + + + + + + + + + + + + + + +
{L_BBCODE_TAG}{L_ACTION}
{bbcodes.BBCODE_TAG} {ICON_EDIT} {ICON_DELETE}
{L_ACP_NO_ITEMS}
+ +

+ +

+ {S_FORM_TOKEN} +
+ +
+ + + + diff --git a/sources/phpBB/adm/style/acp_board.html b/sources/phpBB/adm/style/acp_board.html new file mode 100644 index 0000000..64592a5 --- /dev/null +++ b/sources/phpBB/adm/style/acp_board.html @@ -0,0 +1,52 @@ + + + + +

{L_TITLE}

+ +

{L_TITLE_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ + + + + + +
+ {options.LEGEND} + + +
+

{options.TITLE_EXPLAIN}
+
{options.CONTENT}
+
+ + + + + +
+ + + +
+ {L_ACP_SUBMIT_CHANGES} + + +

+   + +

+ {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/adm/style/acp_bots.html b/sources/phpBB/adm/style/acp_bots.html new file mode 100644 index 0000000..b0e6101 --- /dev/null +++ b/sources/phpBB/adm/style/acp_bots.html @@ -0,0 +1,102 @@ + + + + + + + « {L_BACK} + +

{L_TITLE}

+ +

{L_BOT_EDIT_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ +
+ {L_TITLE} +
+

{L_BOT_NAME_EXPLAIN}
+
+
+
+

{L_BOT_STYLE_EXPLAIN}
+
+
+
+

{L_BOT_LANG_EXPLAIN}
+
+
+
+
+
+
+
+

{L_BOT_AGENT_EXPLAIN}
+
+
+
+

{L_BOT_IP_EXPLAIN}
+
+
+ +

+   + + {S_FORM_TOKEN} +

+
+
+ + + +

{L_BOTS}

+ +

{L_BOTS_EXPLAIN}

+ +
+ + + + + + + + + + + + + + + + + + + + + + +
{L_BOT_NAME}{L_BOT_LAST_VISIT}{L_OPTIONS}{L_MARK}
{bots.BOT_NAME} {bots.LAST_VISIT}  {bots.L_ACTIVATE_DEACTIVATE}  {L_EDIT}  {L_DELETE} 
+ +
+ +
+ +
+ + +

{L_MARK_ALL}{L_UNMARK_ALL}

+ {S_FORM_TOKEN} +
+
+ + + + diff --git a/sources/phpBB/adm/style/acp_captcha.html b/sources/phpBB/adm/style/acp_captcha.html new file mode 100644 index 0000000..f486665 --- /dev/null +++ b/sources/phpBB/adm/style/acp_captcha.html @@ -0,0 +1,72 @@ + + + + +

{L_ACP_VC_SETTINGS}

+ +

{L_ACP_VC_SETTINGS_EXPLAIN}

+ +

{L_ACP_VC_EXT_GET_MORE}

+ +
+ +
+{L_GENERAL_OPTIONS} + +
+

{L_VISUAL_CONFIRM_REG_EXPLAIN}
+
+
+
+
+

{L_REG_LIMIT_EXPLAIN}
+
+
+
+

{L_MAX_LOGIN_ATTEMPTS_EXPLAIN}
+
+
+
+

{L_VISUAL_CONFIRM_POST_EXPLAIN}
+
+
+
+
+

{L_VISUAL_CONFIRM_REFRESH_EXPLAIN}
+
+
+
+
+ +
+{L_AVAILABLE_CAPTCHAS} +
+

{L_CAPTCHA_SELECT_EXPLAIN}
+
+
+ +
+

{L_CAPTCHA_CONFIGURE_EXPLAIN}
+
+
+ +
+ + +
+ {L_PREVIEW} + +
+ + +
+ {L_ACP_SUBMIT_CHANGES} +

+   +   +

+ {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/adm/style/acp_contact.html b/sources/phpBB/adm/style/acp_contact.html new file mode 100644 index 0000000..828fd4b --- /dev/null +++ b/sources/phpBB/adm/style/acp_contact.html @@ -0,0 +1,76 @@ + + + + + + +

{L_ACP_CONTACT_SETTINGS}

+ +

{L_ACP_CONTACT_SETTINGS_EXPLAIN}

+ +
+
+ {L_GENERAL_OPTIONS} +
+

{L_CONTACT_US_ENABLE_EXPLAIN}
+
+ + +
+
+
+ + +
+ {L_CONTACT_US_INFO_PREVIEW} +

{CONTACT_US_INFO_PREVIEW}

+
+ + +
+ {L_CONTACT_US_INFO} +

{L_CONTACT_US_INFO_EXPLAIN}

+ + + +
+
+
+ +
+ +
+ +
+ + + + + + + + + +
+
{L_OPTIONS}{L_COLON} {BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}
+
+
+ +
+   + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/adm/style/acp_database.html b/sources/phpBB/adm/style/acp_database.html new file mode 100644 index 0000000..bf0c80b --- /dev/null +++ b/sources/phpBB/adm/style/acp_database.html @@ -0,0 +1,98 @@ + + + + + +

{L_ACP_RESTORE}

+ +

{L_ACP_RESTORE_EXPLAIN}

+ + +
+ +
+ {L_RESTORE_OPTIONS} +
+
+
+
+ +

+   +   + +

+ {S_FORM_TOKEN} +
+
+ +
+

{L_ACP_NO_ITEMS}

+
+ + + +

{L_ACP_BACKUP}

+ +

{L_ACP_BACKUP_EXPLAIN}

+ + + +
+ +
+ {L_BACKUP_OPTIONS} +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ + +
+
+
+
+
+
{L_SELECT_ALL} :: {L_DESELECT_ALL}
+
+ +

+   + +

+ {S_FORM_TOKEN} +
+
+ + + + diff --git a/sources/phpBB/adm/style/acp_disallow.html b/sources/phpBB/adm/style/acp_disallow.html new file mode 100644 index 0000000..0608f29 --- /dev/null +++ b/sources/phpBB/adm/style/acp_disallow.html @@ -0,0 +1,45 @@ + + + + +

{L_ACP_DISALLOW_USERNAMES}

+ +

{L_ACP_DISALLOW_EXPLAIN}

+ +
+ +
+ {L_ADD_DISALLOW_TITLE} +
+

{L_ADD_DISALLOW_EXPLAIN}
+
+
+ +

+ +

+
+ +

{L_DELETE_DISALLOW_TITLE}

+ +

{L_DELETE_DISALLOW_EXPLAIN}

+ +
+ {L_DELETE_DISALLOW_TITLE} + +
+
+
+
+ +

+ +

+ +

{L_NO_DISALLOWED}

+ + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/adm/style/acp_email.html b/sources/phpBB/adm/style/acp_email.html new file mode 100644 index 0000000..63acd7f --- /dev/null +++ b/sources/phpBB/adm/style/acp_email.html @@ -0,0 +1,60 @@ + + + + +

{L_ACP_MASS_EMAIL}

+ +

{L_ACP_MASS_EMAIL_EXPLAIN}

+ + +
+

{L_WARNING}

+

{WARNING_MSG}

+
+ + +
+ +
+ {L_COMPOSE} +
+
+
+
+
+

{L_SEND_TO_USERS_EXPLAIN}
+
+
[ {L_FIND_USERNAME} ]
+
+
+
+
+
+
+

{L_MASS_MESSAGE_EXPLAIN}
+
+
+
+
+
+
+
+

{L_MAIL_BANNED_EXPLAIN}
+
+
+
+
+
+
+ + + +

+   + +

+{S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/adm/style/acp_ext_delete_data.html b/sources/phpBB/adm/style/acp_ext_delete_data.html new file mode 100644 index 0000000..0f3adb7 --- /dev/null +++ b/sources/phpBB/adm/style/acp_ext_delete_data.html @@ -0,0 +1,40 @@ + + + + +

{L_EXTENSIONS_ADMIN}

+ +

{L_EXTENSIONS_EXPLAIN}

+

{L_EXTENSION_DELETE_DATA_EXPLAIN}

+ + +
+

{L_MIGRATION_EXCEPTION_ERROR}

+

{MIGRATOR_ERROR}

+

{L_RETURN_TO_EXTENSION_LIST}

+
+ +
+

{L_CONFIRM_MESSAGE}

+
+ +
+
+ {L_EXTENSION_DELETE_DATA} + + +
+
+ +
+

{L_EXTENSION_DELETE_DATA_IN_PROGRESS}

+
+ +
+

{L_EXTENSION_DELETE_DATA_SUCCESS}

+
+

{L_RETURN_TO_EXTENSION_LIST}

+
+ + + diff --git a/sources/phpBB/adm/style/acp_ext_details.html b/sources/phpBB/adm/style/acp_ext_details.html new file mode 100644 index 0000000..830c2e3 --- /dev/null +++ b/sources/phpBB/adm/style/acp_ext_details.html @@ -0,0 +1,139 @@ + + + + + « {L_BACK} + +

{L_EXTENSIONS_ADMIN}

+ + +
+

{UP_TO_DATE_MSG} - {L_VERSIONCHECK_FORCE_UPDATE}

+
+ +
+

{L_VERSIONCHECK_FAIL}

+

{VERSIONCHECK_FAIL_REASON}

+

{L_VERSIONCHECK_FORCE_UPDATE}

+
+ +
+

{VERSIONCHECK_FAIL_REASON}

+
+ + +
+ {L_EXT_DETAILS} + +
+
+
{META_DISPLAY_NAME}
+
+ +
+
+
{META_NAME}
+
+ +
+
+
{META_DESCRIPTION}
+
+ +
+
+
{META_VERSION}
+
+ +
+
+
{META_HOMEPAGE}
+
+ + +
+
+
{META_TIME}
+
+ +
+
+
{META_LICENSE}
+
+
+ + +
+ {L_LATEST_VERSION} + +
+
+
+
{updates_available.current}
+
+ +
+
+
{L_DOWNLOAD} {META_NAME} {LATEST_VERSION}
+
+ + +
+
+
{L_RELEASE_ANNOUNCEMENT}
+
+ +
+ +
+ + + +
+ {L_REQUIREMENTS} + + class="requirements_not_met"> +
+
{META_REQUIRE_PHPBB}
+ + + + class="requirements_not_met"> +
+
{META_REQUIRE_PHP}
+ + +
+ + +
+ {L_AUTHOR_INFORMATION} + +
+
+
+
{meta_authors.AUTHOR_NAME}
+
+ +
+
+
{meta_authors.AUTHOR_EMAIL}
+
+ + +
+
+
{meta_authors.AUTHOR_HOMEPAGE}
+
+ + +
+
+
{meta_authors.AUTHOR_ROLE}
+
+ +
+ +
+ + diff --git a/sources/phpBB/adm/style/acp_ext_disable.html b/sources/phpBB/adm/style/acp_ext_disable.html new file mode 100644 index 0000000..d2b5c46 --- /dev/null +++ b/sources/phpBB/adm/style/acp_ext_disable.html @@ -0,0 +1,34 @@ + + + + +

{L_EXTENSIONS_ADMIN}

+ +

{L_EXTENSIONS_EXPLAIN}

+

{L_EXTENSION_DISABLE_EXPLAIN}

+ + +
+

{L_CONFIRM}

+

{L_CONFIRM_MESSAGE}

+
+ +
+
+ + +
+
+ +
+

{L_EXTENSION_DISABLE_IN_PROGRESS}

+
+ +
+

{L_EXTENSION_DISABLE_SUCCESS}

+
+

{L_RETURN_TO_EXTENSION_LIST}

+
+ + + diff --git a/sources/phpBB/adm/style/acp_ext_enable.html b/sources/phpBB/adm/style/acp_ext_enable.html new file mode 100644 index 0000000..8a4a353 --- /dev/null +++ b/sources/phpBB/adm/style/acp_ext_enable.html @@ -0,0 +1,40 @@ + + + + +

{L_EXTENSIONS_ADMIN}

+ +

{L_EXTENSIONS_EXPLAIN}

+

{L_EXTENSION_ENABLE_EXPLAIN}

+ + +
+

{L_MIGRATION_EXCEPTION_ERROR}

+

{MIGRATOR_ERROR}

+

{L_RETURN_TO_EXTENSION_LIST}

+
+ +
+

{L_CONFIRM}

+

{L_CONFIRM_MESSAGE}

+
+ +
+
+ + +
+
+ +
+

{L_EXTENSION_ENABLE_IN_PROGRESS}

+
+ +
+

{L_EXTENSION_ENABLE_SUCCESS}

+
+

{L_RETURN_TO_EXTENSION_LIST}

+
+ + + diff --git a/sources/phpBB/adm/style/acp_ext_list.html b/sources/phpBB/adm/style/acp_ext_list.html new file mode 100644 index 0000000..f96da7e --- /dev/null +++ b/sources/phpBB/adm/style/acp_ext_list.html @@ -0,0 +1,115 @@ + + + + +

{L_EXTENSIONS_ADMIN}

+ +

{L_EXTENSIONS_EXPLAIN}

+ +
+ {L_VERSIONCHECK_FORCE_UPDATE_ALL}{L_SETTINGS} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_EXTENSION_NAME}{L_CURRENT_VERSION}{L_EXTENSION_OPTIONS}{L_EXTENSION_ACTIONS}
{L_EXTENSIONS_ENABLED}
{enabled.META_DISPLAY_NAME} + + style="color: #228822;"style="color: #BC2A4D;">{enabled.META_VERSION} + + {enabled.META_VERSION} + + {L_DETAILS} + + title="{enabled.actions.L_ACTION_EXPLAIN}">{enabled.actions.L_ACTION} +  |  + +
{L_EXTENSIONS_DISABLED}
{disabled.META_DISPLAY_NAME} + + style="color: #228822;"style="color: #BC2A4D;">{disabled.META_VERSION} + + {disabled.META_VERSION} + + + {L_DETAILS} + + + title="{disabled.actions.L_ACTION_EXPLAIN}">{disabled.actions.L_ACTION} +  |  + +
+ + + + + + + + + + + + + + + +
{L_EXTENSION_UPDATE_HEADLINE}
{L_EXTENSION_UPDATE_EXPLAIN}
{L_EXTENSION_REMOVE_HEADLINE}
{L_EXTENSION_REMOVE_EXPLAIN}
+ + diff --git a/sources/phpBB/adm/style/acp_forums.html b/sources/phpBB/adm/style/acp_forums.html new file mode 100644 index 0000000..756092a --- /dev/null +++ b/sources/phpBB/adm/style/acp_forums.html @@ -0,0 +1,517 @@ + + + + + + + + + « {L_BACK} + +

{L_TITLE} :: {FORUM_NAME}

+ +

{L_FORUM_EDIT_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ +
+ {L_FORUM_SETTINGS} + +
+
+
+
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+ +
+

{L_COPY_PERMISSIONS_EXPLAIN}
+
+
+ +
+
+
+
+
+

{L_FORUM_DESC_EXPLAIN}
+
+
+ +
+
+
+

{L_FORUM_IMAGE_EXPLAIN}
+
+ +
{L_FORUM_IMAGE}
+ +
+
+

{L_FORUM_PASSWORD_EXPLAIN}
+
+
+
+

{L_FORUM_PASSWORD_CONFIRM_EXPLAIN}
+
+
+ +
+

{L_FORUM_PASSWORD_UNSET_EXPLAIN}
+
+
+ +
+
+
+
+ +
+ +
+
+ {L_GENERAL_FORUM_SETTINGS} +
+

{L_DISPLAY_ACTIVE_TOPICS_EXPLAIN}
+
+
+
+
+
+ +
+
+ {L_GENERAL_FORUM_SETTINGS} + +
+
+
+
+
+

{L_LIST_SUBFORUMS_EXPLAIN}
+
+
+
+
+

{L_LIST_INDEX_EXPLAIN}
+
+
+
+
+

{L_ENABLE_POST_REVIEW_EXPLAIN}
+
+
+
+
+

{L_ENABLE_QUICK_REPLY_EXPLAIN}
+
+
+
+
+

{L_ENABLE_INDEXING_EXPLAIN}
+
+
+
+
+
+
+
+
+
+

{L_ENABLE_RECENT_EXPLAIN}
+
+
+
+
+

{L_FORUM_TOPICS_PAGE_EXPLAIN}
+
+
+ +
+ +
+ {L_FORUM_PRUNE_SETTINGS} + +
+

{L_FORUM_AUTO_PRUNE_EXPLAIN}
+
+
+
+
+

{L_AUTO_PRUNE_FREQ_EXPLAIN}
+
{L_DAYS}
+
+
+

{L_AUTO_PRUNE_DAYS_EXPLAIN}
+
{L_DAYS}
+
+
+

{L_AUTO_PRUNE_VIEWED_EXPLAIN}
+
{L_DAYS}
+
+
+

{L_PRUNE_OLD_POLLS_EXPLAIN}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

{L_FORUM_PRUNE_SHADOW_EXPLAIN}
+
+
+
+
+

{L_AUTO_PRUNE_SHADOW_FREQ_EXPLAIN}
+
{L_DAYS}
+
+
+

{L_AUTO_PRUNE_SHADOW_DAYS_EXPLAIN}
+
{L_DAYS}
+
+ +
+
+ + + +
+
+ {L_FORUM_RULES} + +
+

{L_FORUM_RULES_LINK_EXPLAIN}
+
+
+ +
+
+
{FORUM_RULES_PREVIEW}
+
+ +
+

{L_FORUM_RULES_EXPLAIN}
+
+
+ +
+
+ +
+
+ +
+ {L_SUBMIT} +   + + {S_FORM_TOKEN} +
+
+ + + + « {L_BACK} + +

{L_FORUM_DELETE}

+ +

{L_FORUM_DELETE_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ +
+ {L_FORUM_DELETE} +
+
+
{FORUM_NAME}
+
+ +
+
+
+ +
+ +
+ + +
+
+
+ +
+ +
+ + +

+ +

+ {S_FORM_TOKEN} +
+
+ + + + + +

{L_FORUM_ADMIN}

+ +

{L_FORUM_ADMIN_EXPLAIN}

+ +

{L_PROGRESS_EXPLAIN}

+ + + + + +

{L_FORUM_ADMIN}

+ +

{L_FORUM_ADMIN_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + + + + +
+

{L_NOTIFY}

+

{L_FORUM_RESYNCED}

+
+ + +

{NAVIGATION} [{L_EDIT} | {L_DELETE} | {L_RESYNC}]

+ + + + + + + + + + + + + +
{forums.FOLDER_IMAGE} +
{forums.FORUM_IMAGE}
+ {forums.FORUM_NAME}{forums.FORUM_NAME} +
{forums.FORUM_DESCRIPTION} +

{L_TOPICS}{L_COLON} {forums.FORUM_TOPICS} / {L_POSTS}{L_COLON} {forums.FORUM_POSTS} +
+ + {ICON_MOVE_UP} + + {ICON_MOVE_DOWN} + {ICON_EDIT} + + {ICON_SYNC} + + {ICON_SYNC_DISABLED} + + {ICON_DELETE} +
+ + +
+ +
+ {L_SELECT_FORUM}{L_COLON} + + + {S_FORM_TOKEN} +
+
+ +
+ +
+ + + + + {S_FORM_TOKEN} +
+
+ + + + diff --git a/sources/phpBB/adm/style/acp_forums_copy_perm.html b/sources/phpBB/adm/style/acp_forums_copy_perm.html new file mode 100644 index 0000000..1fcf2f6 --- /dev/null +++ b/sources/phpBB/adm/style/acp_forums_copy_perm.html @@ -0,0 +1,22 @@ + + +

{L_COPY_PERMISSIONS}

+ +

{L_COPY_PERMISSIONS_EXPLAIN}

+

{L_ACL_LINK}

+ +
+ +
+
+

{L_COPY_PERMISSIONS_EXPLAIN}
+
+
+
{S_FORM_TOKEN}{S_HIDDEN_FIELDS} +   +
+
+ +
+ + diff --git a/sources/phpBB/adm/style/acp_groups.html b/sources/phpBB/adm/style/acp_groups.html new file mode 100644 index 0000000..d24d624 --- /dev/null +++ b/sources/phpBB/adm/style/acp_groups.html @@ -0,0 +1,328 @@ + + + + + + + « {L_BACK} + +

{L_ACP_GROUPS_MANAGE}

+ +

{L_GROUP_EDIT_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ +
+ {L_GROUP_DETAILS} +
+
for="group_name">{L_GROUP_NAME}{L_COLON}
+
{GROUP_NAME}
+
+
+
+
+
+ +
+
+ +
+

{L_GROUP_TYPE_EXPLAIN}
+
+ + + + +
+
+ + + + + +
+

{L_COPY_PERMISSIONS_EXPLAIN}
+
+
+ +
+ +
+ {L_GROUP_OPTIONS_SAVE} + + +
+

{L_GROUP_FOUNDER_MANAGE_EXPLAIN}
+
+
+ +
+

{L_GROUP_SKIP_AUTH_EXPLAIN}
+
+
+
+
+
+
+
+
+
+
+
+

{L_GROUP_RECEIVE_PM_EXPLAIN}
+
+
+ +
+ +
+ {L_GROUP_SETTINGS_SAVE} +
+

{L_GROUP_MESSAGE_LIMIT_EXPLAIN}
+
+
+
+

{L_GROUP_MAX_RECIPIENTS_EXPLAIN}
+
+
+
+

{L_GROUP_COLOR_EXPLAIN}
+
+ +        + [ {L_COLOUR_SWATCH} ] + +
+
+
+
+
+
+
+ +
+ {L_GROUP_AVATAR} +
+

{L_AVATAR_EXPLAIN}
+
{AVATAR}
+
+
+
+
+
+
+
+ +
+

{avatar_drivers.L_EXPLAIN}

+ {avatar_drivers.OUTPUT} +
+ +
+
+ +
+ {L_SUBMIT} +   + + {S_FORM_TOKEN} +
+
+ + + + « {L_BACK} + +

{L_GROUP_MEMBERS} :: {GROUP_NAME}

+ +

{L_GROUP_MEMBERS_EXPLAIN}

+ +
+ +
+ » {L_MAKE_DEFAULT_FOR_ALL} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_USERNAME}{L_GROUP_DEFAULT}{L_JOINED}{L_POSTS}{L_MARK}
{L_GROUP_LEAD}
{leader.USERNAME}{leader.USERNAME}{L_YES}{L_NO}{leader.JOINED}{leader.USER_POSTS}
{L_GROUPS_NO_MODS}
{L_GROUP_APPROVED}
{L_GROUP_PENDING}
{member.USERNAME}{member.USERNAME}{L_YES}{L_NO}{member.JOINED}{member.USER_POSTS}
{L_GROUPS_NO_MEMBERS}
+ + +
+ + +

{L_MARK_ALL}{L_UNMARK_ALL}

+
+ +

{L_ADD_USERS}

+ +

{L_ADD_USERS_EXPLAIN}

+ +
+ {L_ADD_USERS} +
+
+
+
+
+
+

{L_USER_GROUP_DEFAULT_EXPLAIN}
+
+
+
+
+

{L_USERNAMES_EXPLAIN}
+
+
[ {L_FIND_USERNAME} ]
+
+ +

+ +

+ {S_FORM_TOKEN} +
+
+ + + +

{L_ACP_GROUPS_MANAGE}

+ +

{L_ACP_GROUPS_MANAGE_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +

{L_USER_DEF_GROUPS}

+ +

{L_USER_DEF_GROUPS_EXPLAIN}

+ +
+ + + + + + + + + + + + + + + + + + + + +
{L_GROUP}{L_TOTAL_MEMBERS}{L_OPTIONS}{L_ACTION}
{L_NO_GROUPS_CREATED}
+ +
+ + {L_CREATE_GROUP}{L_COLON} + + + {S_FORM_TOKEN} +
+
+ +

{L_SPECIAL_GROUPS}

+ +

{L_SPECIAL_GROUPS_EXPLAIN}

+ + + + + + + + + + + + + + + + + + + + + + + +
{L_GROUP}{L_TOTAL_MEMBERS}{L_OPTIONS}{L_ACTION}
{groups.GROUP_NAME}{groups.TOTAL_MEMBERS}{L_SETTINGS}{L_MEMBERS}{L_DELETE}{L_DELETE}
+ + + + diff --git a/sources/phpBB/adm/style/acp_groups_position.html b/sources/phpBB/adm/style/acp_groups_position.html new file mode 100644 index 0000000..c01f7ae --- /dev/null +++ b/sources/phpBB/adm/style/acp_groups_position.html @@ -0,0 +1,171 @@ + + + + +

{L_MANAGE_LEGEND}

+ +
enctype="multipart/form-data"> + +
+ {L_LEGEND_SETTINGS} +
+

{L_LEGEND_SORT_GROUPNAME_EXPLAIN}
+
+ + +
+
+ +

+   + + + {S_FORM_TOKEN} +

+
+
+ +

{L_LEGEND_EXPLAIN}

+ + + + + + + + + + + + + + + + + + + + + + + +
{L_GROUP}{L_GROUP_TYPE}{L_ACTION}
style="color: {legend.GROUP_COLOUR}">{legend.GROUP_NAME}{legend.GROUP_TYPE} + + {ICON_MOVE_UP} + + {ICON_MOVE_DOWN} + {ICON_DELETE} +
{L_NO_GROUPS_ADDED}
+ +
+
+ + + + {S_FORM_TOKEN} +
+
+ +

{L_MANAGE_TEAMPAGE}

+ +
enctype="multipart/form-data"> + +
+ {L_TEAMPAGE_SETTINGS} +
+
+
+
+
+ +
+
+
+

{L_TEAMPAGE_FORUMS_EXPLAIN}
+
+ + +
+
+ +

+   + + + {S_FORM_TOKEN} +

+
+
+ +

{L_TEAMPAGE_EXPLAIN}

+ +

{L_TEAMPAGE} » {CURRENT_CATEGORY_NAME}

+ + + + + + + + + + + + + + + + + + + + + + + +
{L_GROUP}{L_GROUP_TYPE}{L_ACTION}
+ + {teampage.GROUP_NAME} + + style="color: {teampage.GROUP_COLOUR}">{teampage.GROUP_NAME} + + {teampage.GROUP_TYPE}- + + + {ICON_MOVE_UP} + + {ICON_MOVE_DOWN} + {ICON_DELETE} +
{L_NO_GROUPS_ADDED}
+ + +
+
+ + + + {S_FORM_TOKEN} +
+
+ + +
+
+ + + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/adm/style/acp_icons.html b/sources/phpBB/adm/style/acp_icons.html new file mode 100644 index 0000000..f18dad0 --- /dev/null +++ b/sources/phpBB/adm/style/acp_icons.html @@ -0,0 +1,276 @@ + + + + + + + + + « {L_BACK} + +

{L_TITLE}

+ +

{L_EXPLAIN}

+ +
+ +
+ {L_TITLE} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_CONFIG}
{L_URL}{L_LOCATION}{L_SMILIES_CODE}{L_SMILIES_EMOTION}{L_WIDTH}{L_HEIGHT}{L_DISPLAY_ON_POSTING}{L_ORDER}{L_ADD} ({L_MARK_ALL})
[{items.IMG}] + + + + +
{L_ADD_SMILEY_CODE}
{L_NO_ICONS}
+ +

+   + +

+ {S_FORM_TOKEN} +
+
+ + + + « {L_BACK} + +

{L_TITLE}

+ +

{L_EXPLAIN}

+ +
+ +
+ {L_IMPORT} + + +

{L_NO_PAK_OPTIONS}

+ + +
+
+
+
+

{L_CURRENT_EXPLAIN}
+
+ +
+ + +

+ +

+ + {S_FORM_TOKEN} +
+
+ + + +

{L_TITLE}

+ +

{L_EXPLAIN}

+ + +
+

{L_NOTIFY}

+

{NOTICE}

+
+ + +
+ + + +
+ + {L_TITLE} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_TITLE}{L_CODE}{L_EMOTION}{L_OPTIONS}
{L_NOT_DISPLAYED}
{items.ALT_TEXT}{items.CODE}{items.EMOTION} + + {ICON_MOVE_UP} + + {ICON_MOVE_DOWN} + {ICON_EDIT} {ICON_DELETE} +
{L_ACP_NO_ITEMS}
+ +

+     +

+ {S_FORM_TOKEN} +
+
+ + + + diff --git a/sources/phpBB/adm/style/acp_inactive.html b/sources/phpBB/adm/style/acp_inactive.html new file mode 100644 index 0000000..409ea46 --- /dev/null +++ b/sources/phpBB/adm/style/acp_inactive.html @@ -0,0 +1,74 @@ + + + + +

{L_INACTIVE_USERS}

+ +

{L_INACTIVE_USERS_EXPLAIN}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_USERNAME}{L_JOINED}{L_INACTIVE_DATE}{L_LAST_VISIT}{L_INACTIVE_REASON}{L_MARK}
+ {inactive.USERNAME_FULL} +
{L_POSTS}{L_COLON} {inactive.POSTS} [{L_SEARCH_USER_POSTS}] +
{inactive.JOINED}{inactive.INACTIVE_DATE}{inactive.LAST_VISIT} + {inactive.REASON} +
{inactive.REMINDED_EXPLAIN} +
  
{L_NO_INACTIVE_USERS}
+ +
+ {L_DISPLAY_LOG}{L_COLON}  {S_LIMIT_DAYS} {L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR} {L_USERS_PER_PAGE}{L_COLON} + +
+ +
+ + + + + +
+ + +

{L_MARK_ALL}{L_UNMARK_ALL}

+ {S_FORM_TOKEN} +
+ +
+ + diff --git a/sources/phpBB/adm/style/acp_jabber.html b/sources/phpBB/adm/style/acp_jabber.html new file mode 100644 index 0000000..4d0b1b0 --- /dev/null +++ b/sources/phpBB/adm/style/acp_jabber.html @@ -0,0 +1,65 @@ + + + + +

{L_ACP_JABBER_SETTINGS}

+ +

{L_ACP_JABBER_SETTINGS_EXPLAIN}

+ + +
+

{L_WARNING}

+

{WARNING_MSG}

+
+ + +
+ +
+ {L_ACP_JABBER_SETTINGS} + +

{L_JAB_GTALK_NOTE}

+ +
+

{L_JAB_ENABLE_EXPLAIN}
+
+
+
+
+

{L_JAB_SERVER_EXPLAIN}
+
+
+
+

{L_JAB_PORT_EXPLAIN}
+
+
+
+

{L_JAB_USERNAME_EXPLAIN}
+
+
+
+

{L_JAB_PASSWORD_EXPLAIN}
+
+
+ +
+

{L_JAB_USE_SSL_EXPLAIN}
+
+
+
+ +
+

{L_JAB_PACKAGE_SIZE_EXPLAIN}
+
+
+ +
+ +
+   + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/adm/style/acp_language.html b/sources/phpBB/adm/style/acp_language.html new file mode 100644 index 0000000..4439f51 --- /dev/null +++ b/sources/phpBB/adm/style/acp_language.html @@ -0,0 +1,112 @@ + + + + + + + « {L_BACK} + +

{L_LANGUAGE_PACK_DETAILS}

+ +
+ +
+ {LANG_LOCAL_NAME} +
+
+
+
+
+
+
+
+
+
+
{LANG_ISO}
+
+
+
+
+
+ +

+ +

+ {S_FORM_TOKEN} +
+
+ + +

{L_MISSING_FILES}

+ +
+ {L_MISSING_LANG_FILES} + + » {missing_files.FILE_NAME}
+ +
+ + + +

{L_MISSING_VARS_EXPLAIN}

+ +
+ {L_MISSING_LANG_VARIABLES} + +
+
+ +
{missing_varfile.variable.VAR_NAME}
+ +
+ +
+ + + +

{L_ACP_LANGUAGE_PACKS}

+ +

{L_ACP_LANGUAGE_PACKS_EXPLAIN}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_LANGUAGE_PACK_NAME}{L_LANGUAGE_PACK_LOCALNAME}{L_LANGUAGE_PACK_ISO}{L_LANGUAGE_PACK_USED_BY}{L_OPTIONS}
{L_INSTALLED_LANGUAGE_PACKS}
{lang.ENGLISH_NAME} {lang.TAG}{lang.LOCAL_NAME}{lang.ISO}{lang.USED_BY}{L_DELETE}
{L_UNINSTALLED_LANGUAGE_PACKS}
{notinst.NAME}{notinst.LOCAL_NAME}{notinst.ISO}{L_INSTALL}
+ + + + diff --git a/sources/phpBB/adm/style/acp_logs.html b/sources/phpBB/adm/style/acp_logs.html new file mode 100644 index 0000000..76ea801 --- /dev/null +++ b/sources/phpBB/adm/style/acp_logs.html @@ -0,0 +1,90 @@ + + + + +

{L_TITLE}

+ +

{L_EXPLAIN}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_USERNAME}{L_IP}{L_TIME}{L_ACTION}{L_MARK}
+ {log.USERNAME} + +
» {log.REPORTEE_USERNAME} + +
{log.IP}{log.DATE}{log.ACTION}
{log.DATA}
+ + + + + + +
+

{L_NO_ENTRIES}

+
+ + +
+ {L_DISPLAY_LOG}{L_COLON}  {S_LIMIT_DAYS} {L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR} + + {S_FORM_TOKEN} +
+
+ + +
+ {L_SELECT_FORUM}{L_COLON} + +
+ + + +
+   +
+

{L_MARK_ALL}{L_UNMARK_ALL}

+
+ + +
+ + diff --git a/sources/phpBB/adm/style/acp_main.html b/sources/phpBB/adm/style/acp_main.html new file mode 100644 index 0000000..065dd7a --- /dev/null +++ b/sources/phpBB/adm/style/acp_main.html @@ -0,0 +1,291 @@ + + + + + + +

{L_PERMISSIONS_TRANSFERRED}

+ +

{L_PERMISSIONS_TRANSFERRED_EXPLAIN}

+ + + +

{L_WELCOME_PHPBB}

+ +

{L_ADMIN_INTRO}

+ + +
+

{L_VERSIONCHECK_FAIL}

+

{VERSIONCHECK_FAIL_REASON}

+

{L_VERSIONCHECK_FORCE_UPDATE} · {L_MORE_INFORMATION}

+
+ +
+

{L_VERSION_NOT_UP_TO_DATE_TITLE}

+

{L_VERSIONCHECK_FORCE_UPDATE} · {L_MORE_INFORMATION}

+
+ + + +
+

{L_WARNING}

+

{L_NO_SEARCH_INDEX}

+
+ + + +
+

{L_WARNING}

+

{L_REMOVE_INSTALL}

+
+ + + + +
+

{L_ERROR_MBSTRING_FUNC_OVERLOAD}

+

{L_ERROR_MBSTRING_FUNC_OVERLOAD_EXPLAIN}

+
+ + + +
+

{L_ERROR_MBSTRING_ENCODING_TRANSLATION}

+

{L_ERROR_MBSTRING_ENCODING_TRANSLATION_EXPLAIN}

+
+ + + +
+

{L_ERROR_MBSTRING_HTTP_INPUT}

+

{L_ERROR_MBSTRING_HTTP_INPUT_EXPLAIN}

+
+ + + +
+

{L_ERROR_MBSTRING_HTTP_OUTPUT}

+

{L_ERROR_MBSTRING_HTTP_OUTPUT_EXPLAIN}

+
+ + + + +
+

{L_WRITABLE_CONFIG}

+
+ + + +
+

{L_PHP_VERSION_OLD}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_FORUM_STATS}
{L_STATISTIC}{L_VALUE}{L_STATISTIC}{L_VALUE}
{L_NUMBER_POSTS}{L_COLON} {TOTAL_POSTS}{L_POSTS_PER_DAY}{L_COLON} {POSTS_PER_DAY}
{L_NUMBER_TOPICS}{L_COLON} {TOTAL_TOPICS}{L_TOPICS_PER_DAY}{L_COLON} {TOPICS_PER_DAY}
{L_NUMBER_USERS}{L_COLON} {TOTAL_USERS}{L_USERS_PER_DAY}{L_COLON} {USERS_PER_DAY}
{L_NUMBER_FILES}{L_COLON} {TOTAL_FILES}{L_FILES_PER_DAY}{L_COLON} {FILES_PER_DAY}
{L_BOARD_STARTED}{L_COLON} {START_DATE}{L_AVATAR_DIR_SIZE}{L_COLON} {AVATAR_DIR_SIZE}
{L_DATABASE_SIZE}{L_COLON} {DBSIZE}{L_UPLOAD_DIR_SIZE}{L_COLON} {UPLOAD_DIR_SIZE}
{L_DATABASE_SERVER_INFO}{L_COLON} {DATABASE_INFO}{L_GZIP_COMPRESSION}{L_COLON} {GZIP_COMPRESSION}
{L_BOARD_VERSION}{L_COLON} + style="color: #228822;"style="color: #BC2A4D;" title="{L_MORE_INFORMATION}">{BOARD_VERSION}{L_VERSIONCHECK_FORCE_UPDATE} ] + {L_NUMBER_ORPHAN}{L_COLON} {TOTAL_ORPHAN}  
+ + +
+ {L_STATISTIC_RESYNC_OPTIONS} + +
+
+

 
+
+
+
+ +
+
+

 
+
+
+
+ +
+
+

{L_RESYNC_STATS_EXPLAIN}
+
+
+
+ +
+
+

{L_RESYNC_POSTCOUNTS_EXPLAIN}
+
+
+
+ +
+
+

{L_RESYNC_POST_MARKING_EXPLAIN}
+
+
+
+ + +
+
+

{L_PURGE_SESSIONS_EXPLAIN}
+
+
+
+ + +
+
+

{L_PURGE_CACHE_EXPLAIN}
+
+
+
+ + +
+ + + +

{L_ADMIN_LOG}

+ +

{L_ADMIN_LOG_INDEX_EXPLAIN}

+ + + + + + + + + + + + + + + + + + + + + + +
{L_USERNAME}{L_IP}{L_TIME}{L_ACTION}
{log.USERNAME}{log.IP}{log.DATE}{log.ACTION}
+ + + +

{L_INACTIVE_USERS}

+ +

{L_INACTIVE_USERS_EXPLAIN_INDEX}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_USERNAME}{L_JOINED}{L_INACTIVE_DATE}{L_LAST_VISIT}{L_INACTIVE_REASON}
+ {inactive.USERNAME_FULL} +
{L_POSTS}{L_COLON} {inactive.POSTS} [{L_SEARCH_USER_POSTS}] +
{inactive.JOINED}{inactive.INACTIVE_DATE}{inactive.LAST_VISIT} + {inactive.REASON} +
{inactive.REMINDED_EXPLAIN} +
{L_NO_INACTIVE_USERS}
+ + + + + diff --git a/sources/phpBB/adm/style/acp_modules.html b/sources/phpBB/adm/style/acp_modules.html new file mode 100644 index 0000000..3c97706 --- /dev/null +++ b/sources/phpBB/adm/style/acp_modules.html @@ -0,0 +1,203 @@ + + + + + + + + + « {L_BACK} + +

{L_TITLE} :: {MODULENAME}

+ +

{L_EDIT_MODULE_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ +
+ {L_GENERAL_OPTIONS} +
+

+ {L_MODULE_LANGNAME_EXPLAIN}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
style="display: none;"> +
+

{L_MODULE_DISPLAYED_EXPLAIN}
+
+
+
+
+

+ {L_CHOOSE_MODULE_EXPLAIN}
+
+
+
+

+ {L_CHOOSE_MODE_EXPLAIN}
+
+
+
+ +

+ + + +   + +

+ {S_FORM_TOKEN} +
+
+ + + +

{L_ACP_MODULE_MANAGEMENT}

+ +

{L_ACP_MODULE_MANAGEMENT_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + + + + + + + +
{NAVIGATION} [{L_EDIT} | {L_DELETE} | {L_DISABLE}{L_ENABLE}]
+ + + + + + + + + + + + + + +
{modules.MODULE_IMAGE}{modules.MODULE_TITLE} [{L_HIDDEN_MODULE}] {L_DISABLE}{L_ENABLE}  + + {ICON_MOVE_UP} + + {ICON_MOVE_DOWN} + {ICON_EDIT} + {ICON_DELETE} +
+ + +
 
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + + + +
+ +
+ +
 

+ +
+
+ {L_SELECT_MODULE}{L_COLON} + + +
+
+ + + + diff --git a/sources/phpBB/adm/style/acp_permission_roles.html b/sources/phpBB/adm/style/acp_permission_roles.html new file mode 100644 index 0000000..b3137f1 --- /dev/null +++ b/sources/phpBB/adm/style/acp_permission_roles.html @@ -0,0 +1,191 @@ + + + + + + + + + + + « {L_BACK} + +

{L_TITLE}

+ +

{L_EXPLAIN}

+ +
+ » {L_SET_ROLE_PERMISSIONS} + +
+ +
+ {L_ROLE_DETAILS} +
+
+
+
+
+

{L_ROLE_DESCRIPTION_EXPLAIN}
+
+
+ +

+ + {S_FORM_TOKEN} +

+
+ + + +

{L_ROLE_ASSIGNED_TO}

+ + + + + +

+ + + + » {L_BACK_TO_TOP}
+

+ +

+ +

{L_ACL_TYPE}

+ +
+ +
+
+ +
+ +
style="display: none;"> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_ACL_SETTING}{L_ACL_YES}{L_ACL_NO}{L_ACL_NEVER}
{auth.mask.PERMISSION}
+
+
+ +
+ +
+ +
+ + {S_FORM_TOKEN} +
+
+ + » {L_BACK_TO_TOP}
+
+ + + +

{L_TITLE}

+ +

{L_EXPLAIN}

+ +
+ + + + + + + + + + + + + + + + + + +
{L_ROLE_NAME}{L_OPTIONS}
{roles.ROLE_NAME} +
{roles.ROLE_DESCRIPTION} +
{L_VIEW_ASSIGNED_ITEMS}{L_VIEW_ASSIGNED_ITEMS} + + {ICON_MOVE_UP} + + {ICON_MOVE_DOWN} + {ICON_EDIT} + {ICON_DELETE} +
+ +
+ {L_CREATE_ROLE}{L_COLON}
+ {S_FORM_TOKEN} +
+
+ + + + + +

{L_ROLE_ASSIGNED_TO}

+ + + + + + + + diff --git a/sources/phpBB/adm/style/acp_permissions.html b/sources/phpBB/adm/style/acp_permissions.html new file mode 100644 index 0000000..6dc9dca --- /dev/null +++ b/sources/phpBB/adm/style/acp_permissions.html @@ -0,0 +1,357 @@ + + + + + + +

{L_ACP_PERMISSIONS}

+ + {L_ACP_PERMISSIONS_EXPLAIN} + + + + + + « {L_BACK} + +

{L_TITLE}

+ +

{L_EXPLAIN}

+ + +

{L_FORUMS}{L_COLON} {FORUM_NAMES}

+ + + + +
+ +
+ {L_LOOK_UP_FORUM} +

{L_LOOK_UP_FORUMS_EXPLAIN}

+
+
+
+
+
+ +

+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} + +

+ +
+
+ + + +
+ +
+ {L_LOOK_UP_FORUM} +

{L_SELECT_FORUM_SUBFORUM_EXPLAIN}

+
+
+
+
+ +

+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} + +

+ +
+
+ + + + + +
+ +
+ {L_LOOK_UP_USER} +
+
+
+
[ {L_FIND_USERNAME} ]
+
+
+ +

+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} + +

+
+
+ + + +
+ +
+ {L_LOOK_UP_GROUP} +
+
+
+
+ +

+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} + +

+ +
+
+ + + +
+ + + +

{L_USERS}

+ +
+ +
+ {L_MANAGE_USERS} +
+
+
+
+
+ +
+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} +   +
+
+ +
+ +
+ {L_ADD_USERS} +

{L_USERNAMES_EXPLAIN}

+
+
+
+
+
+ +
+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} + +
+
+ + + +
+ +
+ + + +

{L_USERGROUPS}

+ +
+ +
+ {L_MANAGE_GROUPS} +
+
+
+
+
+ +
+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} +   +
+
+ +
+ +
+ {L_ADD_GROUPS} +
+
+
+
+ +
+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} + +
+
+ + + +
+ + + +
+ +

{L_USERS}

+ +
+ +
+ {L_MANAGE_USERS} +
+
+
+
+ +
+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} + +
+
+ +
+ +
+ {L_LOOK_UP_USER} +
+
+
+
[ {L_FIND_USERNAME} ]
+
+
+
+ +
+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} + +
+
+ +
+ +
+ +

{L_USERGROUPS}

+ +
+ +
+ {L_MANAGE_GROUPS} +
+
+
+
+ +
+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} + +
+
+ +
+ +
+ {L_LOOK_UP_GROUP} +
+
+
+
 
+
+
+ +
+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} + +
+
+ +
+ + + + + + + +

{L_ACL_VIEW}

+ +

{L_ACL_VIEW_EXPLAIN}

+ +
+ » {L_PERMISSION_TYPE} +
+ + + + + + + +

{L_ACL_SET}

+ +

{L_ACL_SET_EXPLAIN}

+ +
+ +
+ » {L_PERMISSION_TYPE} +
+ + +
+ +
+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} + {L_SELECT_TYPE}{L_COLON} + + +
+
+ + +

+ + + + + +
+ + {S_HIDDEN_FIELDS} + + + +

+ +
+ + + {S_FORM_TOKEN} +
+ +

+ +
+ + + + diff --git a/sources/phpBB/adm/style/acp_php_info.html b/sources/phpBB/adm/style/acp_php_info.html new file mode 100644 index 0000000..760cd0e --- /dev/null +++ b/sources/phpBB/adm/style/acp_php_info.html @@ -0,0 +1,13 @@ + + + + +

{L_ACP_PHP_INFO}

+ +

{L_ACP_PHP_INFO_EXPLAIN}

+ +
+ {PHPINFO} +
+ + diff --git a/sources/phpBB/adm/style/acp_posting_buttons.html b/sources/phpBB/adm/style/acp_posting_buttons.html new file mode 100644 index 0000000..70b6259 --- /dev/null +++ b/sources/phpBB/adm/style/acp_posting_buttons.html @@ -0,0 +1,70 @@ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ diff --git a/sources/phpBB/adm/style/acp_profile.html b/sources/phpBB/adm/style/acp_profile.html new file mode 100644 index 0000000..64bc3df --- /dev/null +++ b/sources/phpBB/adm/style/acp_profile.html @@ -0,0 +1,247 @@ + + + + + + + « {L_BACK} + +

{L_TITLE}

+ +

{L_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ + + +
+ {L_TITLE} +
+

{L_FIELD_TYPE_EXPLAIN}
+
{FIELD_TYPE}
+
+ +
+

{L_FIELD_IDENT_EXPLAIN}
+
{FIELD_IDENT}
+
+ +
+

{L_FIELD_IDENT_EXPLAIN}
+
+
+ +
+

{L_DISPLAY_PROFILE_FIELD_EXPLAIN}
+
+
+
+
+ +
+ {L_VISIBILITY_OPTION} +
+

{L_DISPLAY_AT_PROFILE_EXPLAIN}
+
checked="checked" />
+
+
+

{L_DISPLAY_AT_REGISTER_EXPLAIN}
+
checked="checked" />
+
+
+

{L_DISPLAY_ON_PM_EXPLAIN}
+
checked="checked" />
+
+
+

{L_DISPLAY_ON_VT_EXPLAIN}
+
checked="checked" />
+
+
+

{L_DISPLAY_ON_MEMBERLIST_EXPLAIN}
+
checked="checked" />
+
+
+

{L_REQUIRED_FIELD_EXPLAIN}
+
checked="checked" />
+
+
+

{L_SHOW_NOVALUE_FIELD_EXPLAIN}
+
checked="checked" />
+
+
+

{L_HIDE_PROFILE_FIELD_EXPLAIN}
+
checked="checked" />
+
+
+

{L_FIELD_IS_CONTACT_EXPLAIN}
+
checked="checked" />
+
+
+
+
+ + +
+ +
+ + +
+ {L_LANG_SPECIFIC} +
+
+
+
+
+

{L_FIELD_DESCRIPTION_EXPLAIN}
+
+
+ +
+

{L_DEFAULT_VALUE_EXPLAIN}
+
+
+ + +
+
+ +
{L_EDIT_DROPDOWN_LANG_EXPLAIN} + +
{L_LANG_OPTIONS_EXPLAIN} + +
+ +
+ +
{L_FIRST_OPTION}
+
{L_SECOND_OPTION}
+ +
+ +
+ +
+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} + +
+ + + +
+ {L_TITLE} + +
+

{option.EXPLAIN}
+
{option.FIELD}
+
+ +
+ +
+ +
+ +
+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} + +
+ + + + +
+ {options.LANGUAGE} + +
+

{options.field.L_EXPLAIN}
+ {options.field.FIELD} +
+ +
+ + +
+ +
+ +
+ {S_HIDDEN_FIELDS} + + {S_FORM_TOKEN} +
+ + + +
+ + + +

{L_ACP_CUSTOM_PROFILE_FIELDS}

+ + +
+

{L_WARNING}

+

{L_CUSTOM_FIELDS_NOT_TRANSLATED}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_FIELD_IDENT}{L_FIELD_TYPE}{L_OPTIONS}
{fields.FIELD_IDENT}{fields.FIELD_TYPE}{fields.L_ACTIVATE_DEACTIVATE} | {L_TRANSLATE} + + {ICON_MOVE_UP} + + {ICON_MOVE_DOWN} + + {ICON_EDIT} + + {ICON_EDIT_DISABLED} + + {ICON_DELETE} +
{L_ACP_NO_ITEMS}
+ +
+ +
+ + + + {S_FORM_TOKEN} +
+
+ + + + diff --git a/sources/phpBB/adm/style/acp_prune_forums.html b/sources/phpBB/adm/style/acp_prune_forums.html new file mode 100644 index 0000000..4d748f1 --- /dev/null +++ b/sources/phpBB/adm/style/acp_prune_forums.html @@ -0,0 +1,108 @@ + + + + + + +

{L_FORUM_PRUNE}

+ +

{L_PRUNE_SUCCESS}

+ + + + + + + + + + + + + + + + + + + + + + +
{L_FORUM}{L_TOPICS_PRUNED}{L_POSTS_PRUNED}
{pruned.FORUM_NAME}{pruned.NUM_TOPICS}{pruned.NUM_POSTS}
{L_NO_PRUNE}
+ + + +

{L_ACP_PRUNE_FORUMS}

+ +

{L_ACP_PRUNE_FORUMS_EXPLAIN}

+ +
+ +
+ {L_SELECT_FORUM} +

{L_LOOK_UP_FORUMS_EXPLAIN}

+
+
+
+
+
+ +

+ +

+
+ +
+ + + + « {L_BACK} + +

{L_ACP_PRUNE_FORUMS}

+ +

{L_ACP_PRUNE_FORUMS_EXPLAIN}

+ +

{L_FORUM}

+ +

{L_SELECTED_FORUMS}{L_COLON} {FORUM_LIST}

+ +
+ +
+ {L_FORUM_PRUNE} +
+
+
+
+
+
+
+
+
+

{L_PRUNE_OLD_POLLS_EXPLAIN}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +

+ {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} + +

+
+
+ + + + diff --git a/sources/phpBB/adm/style/acp_prune_users.html b/sources/phpBB/adm/style/acp_prune_users.html new file mode 100644 index 0000000..b8c2713 --- /dev/null +++ b/sources/phpBB/adm/style/acp_prune_users.html @@ -0,0 +1,80 @@ + + + + +

{L_ACP_PRUNE_USERS}

+ +

{L_ACP_PRUNE_USERS_EXPLAIN}

+ +
+ +
+ {L_CRITERIA} +
+
+
+
+
+
+
+
+
+

{L_JOINED_EXPLAIN}
+
+ {L_AFTER} +

{L_BEFORE} +
+
+
+

{L_LAST_ACTIVE_EXPLAIN}
+
+
+
+
+
+
+
+
+
+
+ +
+

{L_PRUNE_USERS_GROUP_EXPLAIN}
+
+
+ +
+ +
+ {L_USERNAMES} +
+

{L_SELECT_USERS_EXPLAIN}
+
+
[ {L_FIND_USERNAME} ]
+
+
+ +
+ {L_OPTIONS} +
+

{L_DELETE_USER_POSTS_EXPLAIN}
+
+
+
+
+

{L_DEACTIVATE_DELETE_EXPLAIN}
+
+
+
+ +

+ + +   + + {S_FORM_TOKEN} +

+
+
+ + diff --git a/sources/phpBB/adm/style/acp_ranks.html b/sources/phpBB/adm/style/acp_ranks.html new file mode 100644 index 0000000..fa06513 --- /dev/null +++ b/sources/phpBB/adm/style/acp_ranks.html @@ -0,0 +1,107 @@ + + + + + + + « {L_BACK} + + + +

{L_ACP_MANAGE_RANKS}

+ +

{L_ACP_RANKS_EXPLAIN}

+ +
+ +
+ {L_ACP_RANKS} + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
style="display: none;"> +
+
+
+
+
+ + + +

+ + +   + + {S_FORM_TOKEN} +

+
+
+ + + +

{L_ACP_MANAGE_RANKS}

+ +

{L_ACP_RANKS_EXPLAIN}

+ +
+
+ {L_ACP_MANAGE_RANKS} + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK_IMAGE}{L_RANK_TITLE}{L_RANK_MINIMUM}{L_ACTION}
{ranks.RANK_TITLE}  -  {ranks.RANK_TITLE}  -  {ranks.MIN_POSTS}{ICON_EDIT} {ICON_DELETE}
+ +

+ + {S_FORM_TOKEN} +

+
+
+ + + + diff --git a/sources/phpBB/adm/style/acp_reasons.html b/sources/phpBB/adm/style/acp_reasons.html new file mode 100644 index 0000000..d629a95 --- /dev/null +++ b/sources/phpBB/adm/style/acp_reasons.html @@ -0,0 +1,121 @@ + + + + + + + « {L_BACK} + +

{L_TITLE}

+ +

{L_REASON_EDIT_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + + +

{L_AVAILABLE_TITLES}

+ +

{S_AVAILABLE_TITLES}

+ + +
+ +
+ {L_TITLE} +

{L_IS_TRANSLATED_EXPLAIN}{L_IS_NOT_TRANSLATED_EXPLAIN}

+
+
+
+
+ +
+
{L_REASON_TITLE_TRANSLATED}
+
{TRANSLATED_TITLE}
+
+ +
+
+
+
+ +
+
{L_REASON_DESC_TRANSLATED}
+
{TRANSLATED_DESCRIPTION}
+
+ + +

+   + + {S_FORM_TOKEN} +

+
+
+ + + +

{L_ACP_REASONS}

+ +

{L_ACP_REASONS_EXPLAIN}

+ +
+
+ {L_ACP_REASONS} + + + + + + + + + + + + + + + + + + + + +
{L_REASON}{L_USED_IN_REPORTS}{L_OPTIONS}
+ {L_IS_TRANSLATED}{L_IS_NOT_TRANSLATED} + {reasons.REASON_TITLE} * +
{reasons.REASON_DESCRIPTION} +
{reasons.REASON_COUNT} + + {ICON_MOVE_UP} + + {ICON_MOVE_DOWN} + {ICON_EDIT} + + {ICON_DELETE} + + {ICON_DELETE_DISABLED} + +
+ + + +

+ + + + + {S_FORM_TOKEN} +

+
+ +
+ + + + diff --git a/sources/phpBB/adm/style/acp_search.html b/sources/phpBB/adm/style/acp_search.html new file mode 100644 index 0000000..1cde52a --- /dev/null +++ b/sources/phpBB/adm/style/acp_search.html @@ -0,0 +1,159 @@ + + + + + +

{L_ACP_SEARCH_SETTINGS}

+ +

{L_ACP_SEARCH_SETTINGS_EXPLAIN}

+ + + + + + + +

{L_ACP_SEARCH_INDEX}

+ + +

{L_CONTINUE_EXPLAIN}

+ +
+
+ {L_SUBMIT} +   + + {S_FORM_TOKEN} +
+
+ + +

{L_ACP_SEARCH_INDEX_EXPLAIN}

+ + + + + +
+ +
+ + {backend.S_HIDDEN_FIELDS} + + {L_INDEX_STATS}{L_COLON} {backend.L_NAME} ({L_ACTIVE}) + + + + + + + + + + + + + + + + + + + + + + +
{backend.L_NAME} ({L_ACTIVE})
{L_STATISTIC}{L_VALUE}{L_STATISTIC}{L_VALUE}
{backend.data.STATISTIC_1}{L_COLON}{backend.data.VALUE_1}{backend.data.STATISTIC_2}{L_COLON}{backend.data.VALUE_2}
+ + + +

+ + + + + + + +

+ {S_FORM_TOKEN} +
+ +
+ + + + + + + diff --git a/sources/phpBB/adm/style/acp_send_statistics.html b/sources/phpBB/adm/style/acp_send_statistics.html new file mode 100644 index 0000000..480e438 --- /dev/null +++ b/sources/phpBB/adm/style/acp_send_statistics.html @@ -0,0 +1,64 @@ + + + + +

{L_SEND_STATISTICS}

+ +

{L_EXPLAIN_SEND_STATISTICS}

+ + + + + +
+ +

{L_DONT_SEND_STATISTICS}

+ +

{L_EXPLAIN_SHOW_STATISTICS}

+ +

+ +
+ +

+ +

+ + +
+ {providers.NAME} + +
+
{providers.values.KEY}
+
{providers.values.VALUE}
+
+ +
+ +
+

+ + +

+
+ +
+

{L_THANKS_SEND_STATISTICS}

« {L_GO_ACP_MAIN}

+
+ + diff --git a/sources/phpBB/adm/style/acp_styles.html b/sources/phpBB/adm/style/acp_styles.html new file mode 100644 index 0000000..86e666c --- /dev/null +++ b/sources/phpBB/adm/style/acp_styles.html @@ -0,0 +1,165 @@ + + + + + + « {L_BACK} + + + +
+ +
+

{MESSAGE_TITLE}

+

{MESSAGE_TEXT}

+ + + + + {S_HIDDEN_FIELDS} + +
+   + +
+ +
+ +
+ + +

{L_TITLE}

+ +

{L_EXPLAIN}

+ +
+{S_HIDDEN_FIELDS} +{S_FORM_TOKEN} + + + +
+
+
+
+
+
+
+
{STYLE_PATH}
+
+
+
+
{STYLE_COPYRIGHT}
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+ +
+ +
+ {L_SUBMIT} +   + + {S_FORM_TOKEN} +
+ + + + + + + + + + {STYLES_LIST_EXTRA} + + + + + + class="row-inactive"> + + + + + + + + + + + {styles_list.EXTRA} + + + + +
{L_STYLE_NAME}{L_STYLE_USED_BY}{L_ACTIONS} 
+ + + + + {styles_list.STYLE_NAME} +
{styles_list.STYLE_COPYRIGHT}
+ + {styles_list.STYLE_NAME} + + +
{styles_list.COMMENT}
+ + +
{L_STYLE_PATH}{L_COLON} {styles_list.STYLE_PATH_FULL}
+ +
{styles_list.USERS} + + | + + {styles_list.actions.L_ACTION} + + {styles_list.actions.HTML} + + + + + + +   + + + + +
+ + + +
+ + + +
+ + +
+ + + + diff --git a/sources/phpBB/adm/style/acp_update.html b/sources/phpBB/adm/style/acp_update.html new file mode 100644 index 0000000..0cc9959 --- /dev/null +++ b/sources/phpBB/adm/style/acp_update.html @@ -0,0 +1,46 @@ + + + + +

{L_VERSION_CHECK}

+ +

{L_VERSION_CHECK_EXPLAIN}

+ + +
+

{L_VERSION_UP_TO_DATE_ACP} - {L_VERSIONCHECK_FORCE_UPDATE}

+
+ +
+

{L_VERSION_NOT_UP_TO_DATE_ACP} - {L_VERSIONCHECK_FORCE_UPDATE}

+
+ + +
+ +
+
+
{CURRENT_VERSION}
+
+
+ + +
+ +
+
+
{updates_available.current}
+
+
+
+
{updates_available.announcement}
+
+
+ + + + {UPDATE_INSTRUCTIONS} +

+ + + diff --git a/sources/phpBB/adm/style/acp_users.html b/sources/phpBB/adm/style/acp_users.html new file mode 100644 index 0000000..25064c6 --- /dev/null +++ b/sources/phpBB/adm/style/acp_users.html @@ -0,0 +1,234 @@ + + + + + + +

{L_USER_ADMIN}

+ +

{L_USER_ADMIN_EXPLAIN}

+ +
+ +
+ {L_SELECT_USER} +
+
+
+
[ {L_FIND_USERNAME} ]
+
+
+ +

+ +

+
+ +
+ + + + « {L_BACK} + +

{L_USER_ADMIN}

+ +

{L_USER_ADMIN_EXPLAIN}

+ +
+ +
+ {L_USER_ADMIN_MOVE_POSTS} +
+

{L_MOVE_POSTS_EXPLAIN}
+
+
+
+ +
+ + {S_FORM_TOKEN} +
+
+ + + + « {L_BACK} + +

{L_USER_ADMIN} :: {MANAGED_USERNAME}

+ +

{L_USER_ADMIN_EXPLAIN}

+ + +
+

{L_WARNING}

+

{ERROR_MSG}

+
+ + +
+ +
+ {L_SELECT_FORM}{L_COLON} + {S_FORM_TOKEN} +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ {L_ACP_USER_RANK} +
+
+
+
+
+ +
+ + {S_FORM_TOKEN} +
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + +
{group.GROUP_TYPE}
{group.GROUP_NAME}{L_GROUP_DEFAULT}{L_GROUP_DEFAULT}{L_GROUP_APPROVE} {group.L_DEMOTE_PROMOTE} {L_GROUP_DELETE}
+ + +
+ {L_USER_GROUP_ADD}{L_COLON} + {S_FORM_TOKEN} +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_FILENAME}{L_POST_TIME}{L_FILESIZE}{L_DOWNLOADS}{L_MARK}
{attach.REAL_FILENAME}
{L_PM}{L_COLON} {L_POST}{L_COLON} {attach.TOPIC_TITLE}
{attach.POST_TIME}{attach.SIZE}{attach.DOWNLOAD_COUNT}
+ +
+

{L_USER_NO_ATTACHMENTS}

+
+ +
+ {L_SORT_BY}{L_COLON} + +
+
+ + +
+ +

{L_MARK_ALL}{L_UNMARK_ALL}

+ {S_FORM_TOKEN} +
+
+ + + + + +
+ +
+ {L_SELECT_FORUM}{L_COLON} + + {S_FORM_TOKEN} +
+
+ +
 
+ + + + + + diff --git a/sources/phpBB/adm/style/acp_users_avatar.html b/sources/phpBB/adm/style/acp_users_avatar.html new file mode 100644 index 0000000..8466985 --- /dev/null +++ b/sources/phpBB/adm/style/acp_users_avatar.html @@ -0,0 +1,36 @@ +
+ +
+ {L_ACP_USER_AVATAR} +

{ERROR}

+
+

{L_AVATAR_EXPLAIN}
+
{AVATAR}
+
+
+
+
+ {L_AVATAR_SELECT} +
+
+
+
+
+ +
+

{avatar_drivers.L_EXPLAIN}

+ {avatar_drivers.OUTPUT} +
+ +
+
+ +
+ + {S_FORM_TOKEN} +
+
diff --git a/sources/phpBB/adm/style/acp_users_feedback.html b/sources/phpBB/adm/style/acp_users_feedback.html new file mode 100644 index 0000000..f251724 --- /dev/null +++ b/sources/phpBB/adm/style/acp_users_feedback.html @@ -0,0 +1,75 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_REPORT_BY}{L_IP}{L_TIME}{L_FEEDBACK}{L_MARK}
{log.USERNAME}{log.IP}{log.DATE} + {log.ACTION} +
» [ {log.DATA} ] +
+ +
+

{L_NO_ENTRIES}

+
+ + +
+ {L_DISPLAY_LOG}{L_COLON}  {S_LIMIT_DAYS} {L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR} + +
+
+ + + +
+   + +

{L_MARK_ALL}{L_UNMARK_ALL}

+
+ + +

{L_ADD_FEEDBACK}

+ +

{L_ADD_FEEDBACK_EXPLAIN}

+ +
+ {L_ACP_USER_FEEDBACK} +
+
+
+
+ +
+ +
+ {S_FORM_TOKEN} +
diff --git a/sources/phpBB/adm/style/acp_users_overview.html b/sources/phpBB/adm/style/acp_users_overview.html new file mode 100644 index 0000000..506101c --- /dev/null +++ b/sources/phpBB/adm/style/acp_users_overview.html @@ -0,0 +1,169 @@ +
+ +
+ {L_ACP_USER_OVERVIEW} +
+

{L_NAME_CHARS_EXPLAIN}
+
+
[ {L_USE_PERMISSIONS} ]
+
+ +
+
+
{USER_INACTIVE_REASON}
+
+ +
+
+
{USER_REGISTERED}
+
+ +
+
+
{REGISTERED_IP}
+
[ {L_WHOIS} ]
+
+ +
+
+
{USER_LASTACTIVE}
+
+
+
+
+ + + {USER_POSTS} + + {USER_POSTS} + + + + ({L_POSTS_IN_QUEUE}) + + ({L_POSTS_IN_QUEUE}) + +
+
+
+
+
{USER_WARNINGS}
+
+
+

{L_FOUNDER_EXPLAIN}
+
+
+
+
+
+
+
+
+

{L_CHANGE_PASSWORD_EXPLAIN}
+
+
+
+

{L_CONFIRM_PASSWORD_EXPLAIN}
+
+
+ + +

+ + + {S_FORM_TOKEN} +

+ +
+
+ + + + + +
+ +
+ {L_USER_TOOLS} +
+
+
+
+ + +

+ + {S_FORM_TOKEN} +

+ +
+ +
+ + +
+
+ {L_DELETE_USER} +
+

{L_DELETE_USER_EXPLAIN}
+
+ + + + {L_USER_NO_POSTS_TO_DELETE} + +
+
+

+ + + {S_FORM_TOKEN} +

+
+
+ + diff --git a/sources/phpBB/adm/style/acp_users_prefs.html b/sources/phpBB/adm/style/acp_users_prefs.html new file mode 100644 index 0000000..14715f5 --- /dev/null +++ b/sources/phpBB/adm/style/acp_users_prefs.html @@ -0,0 +1,151 @@ + + +
+ +
+ {L_UCP_PREFS_PERSONAL} + +
+
+
+
+
+
+
+
+
+
+
+

{L_ALLOW_PM_EXPLAIN}
+
+
+
+
+
+
+
+
+
+

{L_NOTIFY_METHOD_EXPLAIN}
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+

{L_BOARD_DATE_FORMAT_EXPLAIN}
+
+
style="display:none;">
+
+ +
+ +
+ {L_UCP_PREFS_POST} + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ +
+ {L_UCP_PREFS_VIEW} + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{S_TOPIC_SORT_DAYS}
+
+
+
+
{S_TOPIC_SORT_KEY}
+
+
+
+
{S_TOPIC_SORT_DIR}
+
+
+
+
{S_POST_SORT_DAYS}
+
+
+
+
{S_POST_SORT_KEY}
+
+
+
+
{S_POST_SORT_DIR}
+
+ +
+ +
+ + {S_FORM_TOKEN} +
+ +
diff --git a/sources/phpBB/adm/style/acp_users_profile.html b/sources/phpBB/adm/style/acp_users_profile.html new file mode 100644 index 0000000..d32348f --- /dev/null +++ b/sources/phpBB/adm/style/acp_users_profile.html @@ -0,0 +1,34 @@ +
+ +
+ {L_USER_PROFILE} +
+
+
+
+
+

{L_BIRTHDAY_EXPLAIN}
+
{L_DAY}{L_COLON} {L_MONTH}{L_COLON} {L_YEAR}{L_COLON}
+
+
+ + +
+ {L_USER_CUSTOM_PROFILE_FIELDS} + +
+
for="{profile_fields.FIELD_ID}">{profile_fields.LANG_NAME}{L_COLON}
{profile_fields.LANG_EXPLAIN}
+
{profile_fields.FIELD}
+ +
{profile_fields.ERROR}
+ +
+ +
+ + +
+ + {S_FORM_TOKEN} +
+
diff --git a/sources/phpBB/adm/style/acp_users_signature.html b/sources/phpBB/adm/style/acp_users_signature.html new file mode 100644 index 0000000..c7ec5cc --- /dev/null +++ b/sources/phpBB/adm/style/acp_users_signature.html @@ -0,0 +1,52 @@ + + +
+ + +
+ {L_ADMIN_SIG_PREVIEW} +

{SIGNATURE_PREVIEW}

+
+ + +
+ {L_SIGNATURE} +

{L_SIGNATURE_EXPLAIN}

+ + + +
+
+
+
+
+ + + + + + + + + +
+
{L_OPTIONS}{L_COLON} {BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}
+
+
+ +
+   + + {S_FORM_TOKEN} +
+
diff --git a/sources/phpBB/adm/style/acp_users_warnings.html b/sources/phpBB/adm/style/acp_users_warnings.html new file mode 100644 index 0000000..6e7f521 --- /dev/null +++ b/sources/phpBB/adm/style/acp_users_warnings.html @@ -0,0 +1,36 @@ +
+ + + + + + + + + + + + + + + + + + + + + +
{L_REPORT_BY}{L_TIME}{L_FEEDBACK}{L_MARK}
{warn.USERNAME}{warn.DATE}{warn.ACTION}
+ +
+

{L_NO_WARNINGS}

+
+ + +
+   + +

{L_MARK_ALL}{L_UNMARK_ALL}

+
+ {S_FORM_TOKEN} +
diff --git a/sources/phpBB/adm/style/acp_words.html b/sources/phpBB/adm/style/acp_words.html new file mode 100644 index 0000000..6038fc6 --- /dev/null +++ b/sources/phpBB/adm/style/acp_words.html @@ -0,0 +1,77 @@ + + + + + + + « {L_BACK} + +

{L_ACP_WORDS}

+ +

{L_ACP_WORDS_EXPLAIN}

+ +
+ +
+ {L_EDIT_WORD} +
+
+
+
+
+
+
+
+ {S_HIDDEN_FIELDS} + +

+   + + {S_FORM_TOKEN} +

+
+
+ + + +

{L_ACP_WORDS}

+ +

{L_ACP_WORDS_EXPLAIN}

+ +
+ +
+ {L_ACP_WORDS} +

+ {S_HIDDEN_FIELDS} + +

+ + + + + + + + + + + + + + + + + + + + + + +
{L_WORD}{L_REPLACEMENT}{L_ACTION}
{words.WORD}{words.REPLACEMENT} {ICON_EDIT}  {ICON_DELETE} 
{L_ACP_NO_ITEMS}
+ {S_FORM_TOKEN} +
+
+ + + diff --git a/sources/phpBB/adm/style/admin.css b/sources/phpBB/adm/style/admin.css new file mode 100644 index 0000000..b03cb0b --- /dev/null +++ b/sources/phpBB/adm/style/admin.css @@ -0,0 +1,2485 @@ +/* phpBB 3.1 Admin Style Sheet + ------------------------------------------------------------------------ + Original author: subBlue ( http://www.subblue.com/ ) + Copyright (c) phpBB Limited + + For full copyright and license information, please see + the docs/CREDITS.txt file. + ------------------------------------------------------------------------ +*/ + +/* General markup styles +---------------------------------------- */ +* { + /* Reset browsers default margin, padding and font sizes */ + margin: 0; + padding: 0; + font-size: 100%; +} + +body, div, p, th, td, li, dd { + font-size: x-small; + voice-family: "\"}\""; + voice-family: inherit; + font-size: small; +} + +html>body, html>div, html>p, html>th, html>td, html>li, html>dd { + font-size: small; +} + +html { + color: #536482; + background: #DBD7D1; + /* Always show a scrollbar for short pages - stops the jump when the scrollbar appears. non-ie browsers */ + height: 100%; + margin-bottom: 1px; + word-wrap: break-word; +} + +body { + /* Text-Sizing with ems: http://www.clagnut.com/blog/348/ */ + font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; + color: #536482; + background: #DBD7D1; + font-size: 62.5%; /* This sets the default font size to be equivalent to 10px */ + margin: 10px 15px; +} + +code, samp { + font-size: 1.2em; +} + +img { + border: 0; +} + +h1 { + font-family: "Trebuchet MS", Helvetica, sans-serif; + font-size: 1.70em; + font-weight: normal; + color: #333333; +} + +h2, caption { + font-family: "Trebuchet MS", Helvetica, sans-serif; + font-size: 1.40em; + font-weight: normal; + color: #115098; + text-align: left; + margin-top: 25px; +} + +.rtl h2, .rtl caption { + text-align: right; +} + +h3, h4 { + font-family: "Trebuchet MS", Helvetica, sans-serif; + font-size: 1.20em; + text-decoration: none; + line-height: 1.20em; + margin-top: 25px; +} + +p { + margin-bottom: 0.7em; + line-height: 1.40em; + font-size: 0.90em; +} + +ul { + list-style: disc; + margin: 0 0 1em 2em; +} + +.rtl ul { + margin: 0 2em 1em 0; +} + +hr { + border: 0 none; + border-top: 1px dashed #999999; + margin-bottom: 5px; + padding-bottom: 5px; + height: 1px; +} + +.centered-text { + text-align: center; +} + +.search-box { + float: left; +} + +.rtl .search-box { + float: right; +} + +.small { + font-size: 0.85em; +} + +.hidden { + display: none; +} + +@media only screen and (max-width: 800px), only screen and (max-device-width: 800px) +{ + body { + margin: 5px 5px 0; + } +} + +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + html, body { + height: auto; + margin: 0; + padding: 0; + } +} + + +/* General links */ +a:link, a:visited { + color: #105289; + text-decoration: none; +} + +a:hover { + color: #BC2A4D; + text-decoration: underline; +} + +a:active { + color: #368AD2; + text-decoration: none; +} + +.install-body p a { + font-weight: bold; +} + +a#maincontent, a#acl, a#assigned_to { + display: block; +} + +/* List items */ +ul, ol { + list-style-position: inside; + margin-left: 1em; +} + +li { + display: list-item; + list-style-type: inherit; +} + + +/* Main blocks +---------------------------------------- */ +#wrap { + padding: 0 0 15px 0; + min-width: 615px; +} + +#page-header { + text-align: right; + background: url("../images/phpbb_logo.png") top left no-repeat; + height: 54px; + font-size: 0.85em; + margin-bottom: 10px; +} + +.rtl #page-header { + text-align: left; + background: url("../images/phpbb_logo.png") top right no-repeat; +} + +#page-header h1 { + color: #767676; + font-family: "Trebuchet MS",Helvetica,sans-serif; + font-size: 1.70em; + padding-top: 10px; +} + +#page-header p { + font-size: 1.00em; +} + +#page-header p#skip { + display: none; +} + +#page-body { + min-width: 650px; +} + +.copyright { + font-size: 0.75em; + text-align: center; +} + +#content { + padding: 30px 10px 10px; + position: relative; +} + +#content h1 { + color: #115098; + line-height: 1.2em; + margin-bottom: 0; +} + +#main { + float: right; + width: 100%; + margin: 0 0 0 -210px; +} + +.rtl #main { + float: left; + margin: 0 -210px 0 0; +} + +.main { + margin-left: 210px; +} + +.rtl .main { + margin-left: 0; + margin-right: 210px; +} + +#page-body.simple-page-body { + padding: 0; + padding-right: 10px; + min-width: 0; +} + +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + #wrap, #page-body, #page-body.simple-page-body { + padding: 0; + min-width: 300px; + } + + #page-header { + margin: 5px; + padding-left: 160px; + height: auto; + min-height: 54px; + overflow: hidden; + } + + .rtl #page-header { + padding-right: 160px; + padding-left: 0; + } + + #page-header h1 { + font-size: 1.2em; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + #page-header fieldset { + margin-top: 5px; + } + + #main, .rtl #main, .main, .rtl .main { + float: none; + width: auto; + margin: 0; + } + + #content { + background: #F3F3F3 url("../images/innerbox_bg.gif") repeat-x top; + padding: 5px; + } + + #page-footer { + padding: 0 5px 5px; + } +} + +@media only screen and (max-width: 400px), only screen and (max-device-width: 400px) +{ + #page-header { + background-size: 76px 26.5px; + padding-left: 80px; + min-height: 30px; + } + + .rtl #page-header { + padding-right: 80px; + } + + #page-header h1 { + padding-top: 0; + font-size: 1.1em; + } +} + + +/* Tabbed menu +----------------------------------------*/ +#tabs { + font-family: Arial, Helvetica, sans-serif; + line-height: normal; + margin: 0 7px; + position: relative; + z-index: 2; +} + +#tabs > ul { + list-style: none; + margin: 0; + padding: 0; +} + +#tabs .tab { + display: inline-block; + float: left; + font-size: 0.85em; + font-weight: bold; + line-height: 14px; +} + +.rtl #tabs .tab { + float: right; +} + +#tabs .tab > a { + background: #D4D6DA; + background: -moz-linear-gradient(top, #CACBCF 0%, #D4D6DA 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #CACBCF), color-stop(100%, #D4D6DA)); + background: -webkit-linear-gradient(top, #CACBCF 0%, #D4D6DA 100%); + background: -o-linear-gradient(top, #CACBCF 0%, #D4D6DA 100%); + background: -ms-linear-gradient(top, #CACBCF 0%, #D4D6DA 100%); + background: linear-gradient(to bottom, #CACBCF 0%, #D4D6DA 100%); + border: 1px solid #BBB; + border-bottom-width: 0; + border-radius: 5px 5px 0 0; + color: #767676; + display: block; + font-weight: bold; + margin: 1px 1px 2px 0; + padding: 6px 9px 4px; + position: relative; + text-decoration: none; + text-transform: uppercase; + white-space: nowrap; + cursor: pointer; +} + +#tabs .tab > a:hover { + background: #F1F1EE; + border-color: #C0BFBB; + color: #BC2A4D; +} + +#tabs .activetab > a, +#tabs .activetab > a:hover { + background: #DCDEE2; + background: -moz-linear-gradient(top, #F2F2F2 0%, #DCDEE2 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #F2F2F2), color-stop(100%, #DCDEE2)); + background: -webkit-linear-gradient(top, #F2F2F2 0%, #DCDEE2 100%); + background: -o-linear-gradient(top, #F2F2F2 0%, #DCDEE2 100%); + background: -ms-linear-gradient(top, #F2F2F2 0%, #DCDEE2 100%); + background: linear-gradient(to bottom, #F2F2F2 0%, #DCDEE2 100%); + border-color: #999; + border-bottom: 2px solid #DCDEE2; + box-shadow: 0 1px 1px #FFF inset; + color: #23649F; + margin: 0 1px 0 0; + padding: 7px 10px 4px; +} + +#tabs .activetab > a:hover { + color: #115098; +} + +/* Responsive tabs +----------------------------------------*/ +.responsive-tab { + position: relative; +} + +.responsive-tab > a.responsive-tab-link { + display: block; + font-size: 16px; + position: relative; + width: 16px; + line-height: 14px; + text-decoration: none; + padding-left: 9px !important; + padding-right: 9px !important; +} + +.responsive-tab .responsive-tab-link:before { + content: ''; + position: absolute; + left: 10px; + top: 7px; + height: .125em; + width: 14px; + border-bottom: 0.125em solid #767676; + border-top: 0.375em double #767676; +} + +.responsive-tab .responsive-tab-link:hover:before { + border-color: #BC2A4D; +} + +.responsive-tab.activetab .responsive-tab-link:before { + border-color: #23649F; +} + +.responsive-tab.activetab .responsive-tab-link:hover:before { + border-color: #115098; +} + +#tabs .dropdown, #minitabs .dropdown { + top: 20px; + margin-right: -2px; + font-weight: normal; +} + +#tabs .dropdown-right .dropdown { + margin-left: -2px; +} + +#tabs .dropdown-contents { + list-style: none; + margin: 0; +} + +#tabs .dropdown li { + border-bottom: 1px dotted #DCDCDC; +} + +#tabs .dropdown li:last-child { + border-bottom: none; +} + +#tabs .dropdown a { + display: block; + padding: 4px 8px; + text-align: right; +} + +/* Main Panel +---------------------------------------- */ +#acp { + position: relative; + top: -2px; + margin: 0 0 2px; + padding: 3px 1px; + min-width: 550px; + background: #F3F3F3 url("../images/innerbox_bg.gif") repeat-x top; + border: 1px #999999 solid; + border-radius: 5px; + box-shadow: #FFF 0 0 0 1px inset; +} + +#acp:first-child { + top: 0; +} + +.panel { + background: #F3F3F3 url("../images/innerbox_bg.gif") repeat-x top; + padding: 5px 0; + border-radius: 5px; + overflow: hidden; +} + +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + #acp { + min-width: 0; + min-height: 0; + border-radius: 0; + border-width: 1px 0; + background: #fff; + padding: 1px 0; + box-shadow: none; + } +} + +/* Sub-navigation Menu +---------------------------------------- */ + +/* Menu */ +#menu { + float: left; + width: 200px; + font-size: 1.00em; + padding: 0; + border-right: 1px solid #CCCFD3; + position: relative; + z-index: 1; +} + +.rtl #menu { + float: right; + border: none; + border-left: 1px solid #CCCFD3; +} + +#menu p { + font-size: 0.85em; +} + +#menu ul { + list-style: none; + margin: 0; + padding: 0; + word-wrap: normal; +} + +/* Default list state */ +#menu li, #menu .header { + padding: 0; + margin: 0; + font-size: 0.85em; + font-weight: bold; + display: block; +} + +/* Link styles for the sub-section links */ +#menu li span { + display: block; + padding: 3px 3px 3px 8px; + margin: 1px 0; + text-decoration: none; + font-weight: normal; + color: #138ECB; +} + +.rtl #menu li span { + padding: 3px 8px 3px 3px; +} + +#menu li a:hover, #menu li a:hover span { + text-decoration: none; + background-color: #FFFFFF; + color: #BC2A4D; +} + +#menu li a:active, #menu li a:active span { + color: #F632A0; +} + +#menu li#activemenu a span { + text-decoration: none; + font-weight: bold; + color: #1180B7; + background: transparent url("../images/arrow_right.gif") 0% 50% no-repeat; +} + +.rtl #menu li#activemenu a span { + background: transparent url("../images/arrow_left.gif") 100% 50% no-repeat; +} + +#menu li#activemenu a:hover span, #menu li#activemenu span { + text-decoration: none; + font-weight: bold; + color: #BC2A4D; + background: #FFFFFF url("../images/arrow_right.gif") 1% 50% no-repeat; +} + +.rtl #menu li#activemenu a:hover span, .rtl #menu li#activemenu span { + background: #FFFFFF url("../images/arrow_left.gif") 99% 50% no-repeat; +} + +#menu li a:active, #menu li a:active span, #menu li#activemenu a:active span { + color: #F632A0; +} + +#menu li span.completed { + text-decoration: none; + padding: 3px 3px 3px 12px; + background: url("../images/arrow_down.gif") 1% 50% no-repeat; +} + +.rtl #menu li span.completed { + text-decoration: none; + padding: 3px 12px 3px 3px; + background: url("../images/arrow_down.gif") 99% 50% no-repeat; +} + +#menu .header { + font-family: Tahoma, Helvetica, sans-serif; + display: block; + font-weight: bold; + color: #115098; + border-bottom: 1px solid #327AA5; + padding: 4px 0 2px; + margin-top: 15px; + text-transform: uppercase; + font-size: 0.75em; + text-decoration: none; + cursor: inherit; + outline-style: none; +} + +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + #menu, .rtl #menu { + float: none; + width: auto; + border-width: 0; + max-width: 200px; + margin: 0 auto 10px; + } + + #menu p { + text-align: center; + } + + #menu .menu-block.active { + margin: 0 -5px; + padding: 0 5px 3px; + background: rgba(255, 255, 255, .5); + border-radius: 5px; + } + + #menu .menu-block.no-header.active { + padding-top: 3px; + } + + #menu .menu-block .header { + margin-top: 5px; + cursor: pointer; + border-bottom-width: 0; + position: relative; + text-decoration: underline; + } + + #menu .menu-block .header:focus, #menu .menu-block.active .header { + color: #D31141; + text-decoration: none; + } + + #menu .menu-block ul { + display: none; + } + + .nojs #menu .menu-block:hover ul, #menu .menu-block.active ul, #menu .menu-block.no-header ul { + display: block; + } + + #menu .menu-block li:last-child { + border-bottom: 1px solid #327AA5; + } + + #menu .menu-block:last-child li:last-child, #menu .menu-block.active li:last-child { + border-bottom-width: 0; + } + + #menu .menu-block li a span { + border-radius: 2px; + } +} + + +/* Table styles +---------------------------------------- */ + +table { + width: 100%; + border: 1px solid #CCCFD3; + background-color: #FFFFFF; + padding: 1px; +} + +th { + padding: 3px 4px; + color: #FFFFFF; + background: #70AED3 url("../images/gradient2b.gif") bottom left repeat-x; + border-top: 1px solid #6DACD2; + border-bottom: 1px solid #327AA5; + text-align: left; + font-size: 0.75em; + text-transform: uppercase; +} + +td { + text-align: left; + font-size: 0.85em; + padding: 4px; + line-height: 1.20em; +} + +.rtl th, .rtl td { + text-align: right; +} + +.table1 { + border-collapse: separate; + border-spacing: 1px; + clear: both; +} + +dt#color_palette_placeholder table { + margin-right: 5px; + width: 80px; +} + +#color_palette_placeholder td { + padding: 0; +} + +table.type2 { + border: none; + background: none; + padding: 0; +} + +table.type2 th { + background: none; + border-top: none; + text-align: center; + color: #115098; + padding: 2px 0; +} + +table.type2 td { + padding: 0; + font-size: 1em; +} + +table.type2 td.name { + padding: 2px; + vertical-align: middle; +} + +table.type3 { + float: right; + width: 300px; + border: none; + background-color: transparent; + padding: 0; +} + +.rtl table.type3 { + float: left; +} + +table.type3 thead th { + background-color: transparent; + border-top: none; + text-align: center; + color: #115098; + padding: 0 3px; + font-size: 0.85em; + font-weight: normal; + text-transform: none; +} + +table.type3 tbody th { + border-top: none; + text-align: left; + text-transform: none; + padding: 0; + border: none; + font-size: 0.90em; + font-weight: normal; + width: 100%; +} + +.rtl table.type3 tbody th { + text-align: right; +} + +table.type3 td { + text-align: center; + padding: 1px; +} + +th.name { + text-align: left; + width: auto; +} + +.rtl th.name { + text-align: right; +} + +td.name { + text-align: left; + font-weight: bold; +} + +.rtl td.name { + text-align: right; +} + +.entry { + text-align: left; + font-weight: normal; +} + +.rtl .entry { + text-align: right; +} + +.row1 { + background-color: #F9F9F9; +} + +table.zebra-table tbody tr:nth-child(odd) { + background-color: #F9F9F9; +} + +.row2 { + background-color: #DCEBFE; +} + +table.zebra-table tbody tr:nth-child(even) { + background-color: #DCEBFE; +} + +.row3 { background-color: #DBDFE2; } +.row4 { background-color: #E4E8EB; } +.col1 { background-color: #DCEBFE; } +.col2 { background-color: #F9F9F9; } + +/* 4 row background colours for trees */ +.row1a { background-color: #F9F9F9; } +.row1b { background-color: #F6F6F6; } +.row2a { background-color: #E7EEF4; } +.row2b { background-color: #E3EBF2; } + +.spacer { + background-color: #DBDFE2; + height: 1px; + line-height: 1px; +} + +/* Deactivated row */ +.row-inactive { + color: #999; +} +.row-inactive a, .row-inactive strong { + color: #888; +} +.row-inactive a:hover { + color: #BC2A4D; +} + +/* Specific tables */ +table.forums td.folder { + width: 27px; + text-align: center; +} + +table td.actions { + vertical-align: middle; + width: 100px; + text-align: center; + white-space: nowrap; +} + +table tr:first-child td.actions .up, table tr:last-child td.actions .down { + display: none; +} + +table tr:first-child td.actions .up-disabled, table tr:last-child td.actions .down-disabled { + display: inline !important; +} + +table.styles td.users, table td.mark { + text-align: center; +} + +table.fixed-width-table { + table-layout: fixed; + word-break: break-word; +} + +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { + display: block; + } + + table.responsive thead, table.responsive th, table.responsive colgroup { + display: none; + } + + table.responsive.show-header thead, table.responsive.show-header th:first-child, table.responsive caption { + display: block; + width: auto !important; + text-align: left !important; + margin: 0; + } + + table.responsive { + background: transparent none; + border-width: 0; + padding: 0; + } + + table.responsive caption { + padding: 3px 4px; + color: #FFFFFF; + background: #70AED3 url("../images/gradient2b.gif") bottom left repeat-x; + border-top: 1px solid #6DACD2; + border-bottom: 1px solid #327AA5; + text-align: left; + font-size: 0.75em; + font-weight: bold; + text-transform: uppercase; + } + + table.responsive.show-header th:first-child span.rank-img, table.responsive.no-caption caption, table.responsive.no-header thead { + display: none; + } + + table.responsive tr { + margin: 2px 0; + border: 1px solid #CCCFD3; + background-color: #FFFFFF; + padding: 1px 1px 0; + overflow: hidden; + } + + table.responsive tr.row1 td { background-color: #F9F9F9; } + table.responsive tr.row2 td { background-color: #DCEBFE; } + table.responsive tr.row3 td { background-color: #DBDFE2; } + table.responsive tr.row4 td { background-color: #E4E8EB; } + table.responsive tr.col1 td { background-color: #DCEBFE; } + table.responsive tr.col2 td { background-color: #F9F9F9; } + table.responsive tr.row1a td { background-color: #F9F9F9; } + table.responsive tr.row1b td { background-color: #F6F6F6; } + table.responsive tr.row2a td { background-color: #E7EEF4; } + table.responsive tr.row2b td { background-color: #E3EBF2; } + + table.responsive td { + width: auto !important; + text-align: left !important; + padding: 4px; + margin-bottom: 1px; + } + + .rtl table.responsive td { + text-align: right !important; + } + + table.responsive td.empty { + display: none !important; + } + + table.responsive td > dfn { + display: inline-block !important; + } + + table.responsive td > dfn:after { + content: ':'; + padding-right: 5px; + } + + table.responsive.two-columns td { + width: 50% !important; + float: left; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + + .rtl table.responsive.two-columns td { + float: right; + } + + table.responsive.two-columns td:nth-child(2n+1) { + clear: left; + } + + table.responsive span.rank-img { + float: none; + padding-right: 5px; + } + + table.responsive#memberlist td:first-child input[type="checkbox"] { + float: right; + } + + /* Specific tables */ + table.responsive.forums td.folder { + float: left; + width: 27px; + background: transparent; + } + .rtl table.responsive.forums td.folder { + float: right; + } + + table.responsive.forums td.forum-desc { + margin-left: 35px; + min-height: 27px; + background: transparent; + } + + .rtl table.responsive.forums td.forum-desc { + margin-left: 0; + margin-right: 35px; + } + + table.responsive td.actions { + clear: both; + text-align: right !important; + } + + .rtl table.responsive td.actions { + text-align: left !important; + } + + table.responsive.styles tr.responsive-style-row td:first-child { + padding-left: 4px !important; + padding-right: 4px !important; + } + + table.responsive.styles td:first-child > dfn, table.responsive td.actions > dfn { + display: none !important; + } + + .horizontal-palette td:nth-child(2n), .vertical-palette tr:nth-child(2n) { + display: none; + } + + .colour-palette a { + display: inline-block !important; + } +} + +/* General form styles +----------------------------------------*/ +fieldset { + margin: 15px 0; + padding: 10px; + border-top: 1px solid #D7D7D7; + border-right: 1px solid #CCCCCC; + border-bottom: 1px solid #CCCCCC; + border-left: 1px solid #D7D7D7; + background-color: #FFFFFF; + position: relative; + border-radius: 3px; +} + +fieldset h2 { + margin-top: 0; +} + +.rtl fieldset { + border-top: 1px solid #D7D7D7; + border-right: 1px solid #D7D7D7; + border-bottom: 1px solid #CCCCCC; + border-left: 1px solid #CCCCCC; +} + +fieldset p { + font-size: 0.85em; +} + +legend { + padding: 1px 0; + font-family: Tahoma,arial,Verdana,Sans-serif; + font-size: .9em; + font-weight: bold; + color: #115098; + margin-top: -.4em; + position: relative; + text-transform: none; + line-height: 1.2em; + top: -.2em; + vertical-align: middle; +} + +input, textarea { + font-family: Verdana, Helvetica, Arial, sans-serif; + font-size: 0.90em; + font-weight: normal; + vertical-align: middle; + padding: 2px; + color: #111111; + border-left: 1px solid #AFAEAA; + border-top: 1px solid #AFAEAA; + border-right: 1px solid #D5D5C8; + border-bottom: 1px solid #D5D5C8; + background-color: #E3DFD8; +} + +.rtl input, .rtl textarea { + border-left: 1px solid #D5D5C8; + border-top: 1px solid #AFAEAA; + border-right: 1px solid #AFAEAA; + border-bottom: 1px solid #D5D5C8; +} + +input:hover, textarea:hover { + border-left: 1px solid #AFAEAA; + border-top: 1px solid #AFAEAA; + border-right: 1px solid #AFAEAA; + border-bottom: 1px solid #AFAEAA; + background-color: #E9E9E2; +} + +input.langvalue, textarea.langvalue { + width: 90%; +} + +input[type="number"] { + width: 60px; + -moz-padding-end: 0; +} + +optgroup, select { + background-color: #FAFAFA; + border: 1px solid #666666; + font-family: Verdana, Helvetica, Arial, sans-serif; + font-size: 0.85em; + font-weight: normal; + font-style: normal; + cursor: pointer; + padding: 1px; + vertical-align: middle; + width: auto; + color: #000; +} + +select:focus { + outline-style: none; +} + +optgroup { + font-size: 1.00em; + font-weight: bold; +} + +optgroup.disabled-options { + display: none; + background-color: gray; +} + +option { + padding: 0 1em 0 0; + color: #000; +} + +option.disabled-option { + color: graytext; +} + +.rtl option { + padding: 0 0 0 1em; +} + +.sep { + font-weight: bold; +} + +.username-coloured { + font-weight: bold; +} + +textarea { + font-family: Verdana, Helvetica, Arial, sans-serif; + font-size: 0.85em; + width: 60%; + padding: 2px; +} + +label { + cursor: pointer; + font-size: 0.85em; + padding: 0 5px 0 0; +} + +.rtl label { + padding: 0 0 0 5px; +} + +label input { + font-size: 1.00em; + vertical-align: middle; +} + +label img { + vertical-align: middle; +} + +fieldset.quick, p.quick { + margin: 0 0 5px; + padding: 5px 0 0; + border: none; + background-color: transparent; + text-align: right; +} + +.rtl fieldset.quick, .rtl p.quick { + text-align: left; +} + +fieldset.quick legend { + display: none; +} + +fieldset.tabulated { + background: none; + margin: 0; + margin-top: 5px; + padding: 0; + border: 0; +} + +fieldset.tabulated legend { + display: none; +} + +fieldset.nobg { + margin: 15px 0 0 0; + padding: 0; + border: none; + background-color: transparent; +} + +fieldset.display-options { + margin: 15px 0 2px 0; + padding: 0 0 4px 0; + border: none; + background-color: transparent; + text-align: center; + font-size: 0.85em; +} + +fieldset.display-options select, fieldset.display-options input, fieldset.display-options label { + font-size: 1.00em; + vertical-align: middle; +} + +select option.disabled { + background-color: #bbb; + color: #fff; +} + +/* Special case inputs */ +select#board_timezone, +select#full_folder_action { + width: 95%; +} + +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + fieldset { + padding: 5px; + } + + fieldset.quick, p.quick { + float: none !important; + text-align: center; + } + + fieldset.display-options { + clear: both; + } +} + +/* Definition list layout for forms + Other general def. list properties defined in prosilver_main.css +---------------------------------------- */ +dl { + font-family: Verdana, Helvetica, Arial, sans-serif; + font-size: 1.00em; +} + +dt { + float: left; + width: auto; +} + +.rtl dt { + float: right; +} + +dd { color: #666666;} +dd + dd { padding-top: 5px;} +dt span { padding: 0 5px 0 0;} +.rtl dt span { padding: 0 0 0 5px;} + +dt .explain { font-style: italic;} + +dt label { + font-size: 1.00em; + text-align: left; + font-weight: bold; + color: #4A5A73; +} + +.rtl dt label { + text-align: right; +} + +dd label { + font-size: 1.00em; + white-space: nowrap; + margin: 0 10px 0 0; + color: #4A5A73; +} + +.rtl dd label { + margin: 0 0 0 10px; +} + +html>body dd label input { vertical-align: text-bottom;} /* Tweak for Moz to align checkboxes/radio buttons nicely */ + +dd input { + font-size: 1.00em; + max-width: 100%; + margin: 2px 0; +} + +dd select { + font-size: 100%; + font-size: 1em; + width: auto; + max-width: 100%; + margin: 2px 0; +} + +dd textarea { + font-size: 0.90em; + width: 90%; +} + +fieldset dl { + margin-bottom: 10px; + font-size: 0.85em; +} + +fieldset dt { + width: 45%; + text-align: left; + border: none; + border-right: 1px solid #CCCCCC; + padding-top: 3px; +} + +.rtl fieldset dt { + text-align: right; + border: none; + border-left: 1px solid #CCCCCC; +} + +fieldset #color_palette_placeholder { + padding-top: 0; +} + +fieldset dd { + margin: 0 0 0 45%; + padding: 0 0 0 5px; + border: none; + border-left: 1px solid #CCCCCC; + vertical-align: top; + font-size: 1.00em; +} + +.rtl fieldset dd { + margin: 0 45% 0 0; + padding: 0 5px 0 0; + border: none; + border-right: 1px solid #CCCCCC; +} + +dd.full, .rtl dd.full { + margin: 0; + border: 0; + padding: 0; + padding-top: 3px; + text-align: center; + width: 95%; +} + +/* Hover highlights for form rows */ +fieldset dl:hover dt, fieldset dl:hover dd { + border-color: #666666; +} + +fieldset dl:hover dt label { + color: #000000; +} + +fieldset dl dd label:hover { + color: #BC2A4D; +} + +input:focus, textarea:focus { + border: 1px solid #BC2A4D; + background-color: #E9E9E2; + color: #BC2A4D; + outline-style: none; +} + +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + fieldset dl { + margin-bottom: 5px; + padding-bottom: 5px; + border-bottom: 1px solid #e8e8e8; + } + + fieldset > dl:last-child, fieldset > form:last-child > dl:last-child { + border-bottom-width: 0; + margin-bottom: 0; + } + + fieldset dt, .rtl fieldset dt, fieldset dd, .rtl fieldset dd { + border-width: 0; + margin-left: 0; + margin-right: 0; + float: none; + width: auto; + } + + fieldset .responsive-columns dt { + float: left; + } + + .ltr fieldset dd { + padding-left: 20px; + } + + .rtl fieldset dd { + padding-right: 20px; + } + + select, dd select, dd input { + max-width: 300px; + } + + input[type="number"], dd input[type="number"] { + max-width: 70px; + } +} + +@media only screen and (max-width: 400px), only screen and (max-device-width: 400px) +{ + select, dd select, dd input { + max-width: 240px; + } +} + +/* Submit button fieldset or paragraph +---------------------------------------- */ +fieldset.submit-buttons { + text-align: center; + border: none; + background-color: transparent; + margin: 0; + padding: 4px; + margin-top: -1px; +} + +p.submit-buttons { + text-align: center; + margin: 0; + padding: 4px; + margin-top: 10px; +} + +fieldset.submit-buttons input, p.submit-buttons input { + padding: 3px 2px; +} + +fieldset.submit-buttons legend { + display: none; +} + +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + p.submit-buttons { + margin-top: 0; + } +} + +/* Input field styles +---------------------------------------- */ + +input.radio, input.checkbox, input.permissions-checkbox { + width: auto !important; + background-color: transparent; + border: none; + cursor: pointer; +} + +input.full, +textarea.full { + width: 99%; +} + +input.medium { width: 50%;} +input.narrow { width: 25%;} +input.tiny { width: 10%;} +input.autowidth { width: auto !important;} +.box2 .inputbox { background-color: #E9E9E9;} + +/* Form button styles +---------------------------------------- */ +a.button1, input.button1, +a.button2, input.button2 { + width: auto !important; + padding: 1px 3px 0 3px; + font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; + color: #000; + font-size: 0.85em; + background: #EFEFEF url("../images/bg_button.gif") repeat-x top; + cursor: pointer; +} + +a.button1, input.button1 { + font-weight: bold; + border: 1px solid #666666; +} + +/* Alternative button */ +a.button2, input.button2 { + border: 1px solid #666666; +} + +/* button in the style of the form buttons */ +a.button1, a.button1:link, a.button1:visited, a.button1:active, +a.button2, a.button2:link, a.button2:visited, a.button2:active { + text-decoration: none; + color: #000000; + padding: 4px 8px; +} + +/* Hover states */ +a.button1:hover, input.button1:hover, +a.button2:hover, input.button2:hover { + border: 1px solid #BC2A4D; + background: #EFEFEF url("../images/bg_button.gif") repeat bottom; + color: #BC2A4D; +} + +input.disabled { + font-weight: normal; + color: #666666; +} + +/* Focus states */ +input.button1:focus, input.button2:focus { + outline-style: none; +} + +/* jQuery popups +---------------------------------------- */ +.phpbb_alert { + background-color: #FFFFFF; + border: 1px solid #999999; + position: fixed; + display: none; + top: 150px; + left: 0; + right: 0; + width: 620px; + margin: 0 auto; + z-index: 50; + padding: 25px; + padding: 0 25px 20px 25px; +} + +.phpbb_alert .alert_close { + display: block; + float: right; + width: 16px; + height: 16px; + overflow: hidden; + text-decoration: none !important; + background: transparent url("../images/alert_close.png") 0 0 no-repeat; + margin-top: -7px; + margin-right: -31px; +} +.phpbb_alert .alert_close:hover { + background-position: 0 -16px; +} + + +.phpbb_alert p { + margin: 8px 0; + padding-bottom: 8px; +} + +.phpbb_alert label { + display: block; + margin: 8px 0; + padding-bottom: 8px; +} + +.phpbb_alert div.alert_text > p, +.phpbb_alert div.alert_text > label, +.phpbb_alert div.alert_text > select, +.phpbb_alert div.alert_text > textarea, +.phpbb_alert div.alert_text > input { + font-size: 0.9em; +} + +#darkenwrapper { + display: none; + position: relative; + z-index: 44; +} + +#darken { + position: fixed; + left: 0; + top: 0; + width: 100%; + height: 100%; + background-color: #000000; + opacity: 0.5; + z-index: 45; +} + +@media only screen and (max-height: 500px), only screen and (max-device-width: 500px) +{ + .phpbb_alert { + top: 25px; + } +} + +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + .phpbb_alert { + width: auto; + margin: 0 25px; + } +} + +#loading_indicator { + background: #000000 url("../images/loading.gif") center center no-repeat; + border-radius: 5px; + display: none; + opacity: 0.8; + margin-top: -50px; + margin-left: -50px; + height: 50px; + width: 50px; + position: fixed; + left: 50%; + top: 50%; + z-index: 51; +} + +/* Pagination +---------------------------------------- */ +.pagination { + font-size: .85em; + height: 1%; /* IE tweak (holly hack) */ + width: auto; + text-align: right; + margin: 5px 0; +} + +.top-pagination { + float: right; + margin: 15px 0 5px 0; +} + +.rtl .pagination { + text-align: left; + float: left; +} + +li.pagination { + margin-top: 0; +} + +.pagination img { + vertical-align: middle; +} + +.pagination ul { + display: inline-block; + *display: inline; /* IE7 inline-block hack */ + *zoom: 1; + margin-left: 0; + margin-bottom: 0; +} + +li.pagination ul { + margin-top: -2px; + vertical-align: middle; +} + +.pagination ul li, dl .pagination ul li, dl.icon .pagination ul li { + display: inline; + padding: 0; + font-size: 100%; + line-height: normal; +} + +.pagination li a, .pagnation li span, li .pagination li a, li .pagnation li span, .pagination li.active span, .pagination li.ellipsis span { + font-weight: normal; + text-decoration: none; + padding: 0 2px; + border: 1px solid transparent; + font-size: 0.9em; + line-height: 1.5em; +} + +.pagination li a, .pagination li a:link, .pagination li a:visited { + color: #5C758C; + background-color: #ECEDEE; + border-color: #B4BAC0; +} + +.pagination li.ellipsis span { + background-color: transparent; + color: #000000; +} + +.pagination li.active span { + color: #FFFFFF; + background-color: #4692BF; + border-color: #4692BF; +} + +.pagination li a:hover, .pagination .active a:hover { + color: #FFFFFF; + background-color: #368AD2; + border-color: #368AD2; +} + +.pagination li a:active, .pagination li.active a:active { + color: #5C758C; + background-color: #ECEDEE; + border-color: #B4BAC0; +} + +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + .pagination, .rtl .pagination { + float: none; + text-align: center; + margin: 5px 0; + } + + .pagination li a, .pagination li span { + display: inline-block; + min-width: 10px; + } +} + +/* Action Highlighting +---------------------------------------- */ +.successbox, .errorbox { + padding: 8px; + margin: 10px 0; + color: #FFFFFF; + text-align: center; + clear: both; +} + +.success { + color: #228822; +} + +.error { + color: #BC2A4D; +} + +.successbox { + background-color: #228822; +} + +.errorbox { + background-color: #BC2A4D; +} + +.successbox h3, .errorbox h3 { + color: #FFFFFF; + margin: 0 0 0.5em; + font-size: 1.10em; + font-family: "Lucida Grande",Verdana,Helvetica,Arial,sans-serif; +} + +.successbox p, .errorbox p { + color: #FFFFFF; + font-size: 0.85em; + margin-bottom: 0; +} + +.errorbox a:link, .errorbox a:active, .errorbox a:visited, +.successbox a:link, .successbox a:active, .successbox a:visited { + color: #DBD7D1; + text-decoration: underline; + font-weight: bold; +} + +.errorbox a:hover, .successbox a:hover { + color: #FFFFFF; + text-decoration: none; + font-weight: bold; +} + +.notice { + background-color: #62A5CC; +} + +/* Special cases for the error page */ +#errorpage #page-header a { + font-weight: bold; + line-height: 6em; +} + +#errorpage #content { + padding-top: 10px; +} + +#errorpage #content h1 { + color: #DF075C; +} + +#errorpage #content h2 { + margin-top: 20px; + margin-bottom: 5px; + border-bottom: 1px solid #CCCCCC; + padding-bottom: 5px; + color: #333333; +} + +/* Tooltip for permission roles */ +.tooltip { + width: 200px; + color: #000; + text-align: center; + border: 1px solid #AAA; +} + +.tooltip span.top { + background: #EFEFEF; + font-weight: bold; + padding: 2px; +} + +.tooltip span.bottom { + padding: 5px; + color: #000000; + background: #FFFFFF; +} + +/* + Format Buttons for signature editor +*/ +#format-buttons { + margin: 15px 0 2px 0; +} + +#format-buttons input, #format-buttons select { + vertical-align: middle; +} + +.row, fieldset dl { + overflow: hidden; +} + +/* Syntax Highlighting +---------------------------------------- */ +.sourcenum { + color: gray; + font-family: Monaco, 'Courier New', monospace; + font-size: 1.25em; + font-weight: bold; + line-height: 1.20em; + text-align: right; + padding: 0; +} + +.rtl .sourcenum { + text-align: left; +} + +.source { + font-family: Monaco, 'Courier New', monospace; + font-size: 1.25em; + line-height: 1.20em; + padding: 0; +} + +.syntaxbg { + color: #FFFFFF; +} + +.syntaxcomment { + color: #FF8000; +} + +.syntaxdefault { + color: #0000BB; +} + +.syntaxhtml { + color: #000000; +} + +.syntaxkeyword { + color: #007700; +} + +.syntaxstring { + color: #DD0000; +} + +/* Permission interface +---------------------------------------- */ + +.column1, .column2 { + width: 48%; + float: left; +} + +.ltr .column2, .rtl .column1 { + float: right; +} + +fieldset.permissions legend { + text-transform: none; +} + +fieldset.permissions legend input{ + height: 1.1em; +} + +/* Permission sections */ +fieldset.permissions .permissions-simple { + text-align: left; + padding-top: 3px; +} + +.rtl fieldset.permissions .permissions-simple { + text-align: right; +} + +fieldset.permissions .permissions-advanced { + padding: 10px 0 0 5px; + vertical-align: top; + clear: right; +} + +.rtl fieldset.permissions .permissions-advanced { + padding: 10px 5px 0 0; + clear: left; +} + +fieldset.permissions .permissions-switch { + float: right; +} + +.rtl fieldset.permissions .permissions-switch { + float: left; +} + +fieldset.permissions .padding { +} + +.permissions-switch { + margin-top: -6px; + font-size: .9em; +} + +.permissions-switch a { + text-decoration: underline; +} + +.permissions-reset { + padding-bottom: 10px; +} + +.permissions-reset a { + font-size: .85em; +} + +/* Tabbed menu */ +.permissions-category { + line-height: normal; + margin: 0 0 -1px 7px; + min-width: 570px; + font-size: 0.85em; +} + +.rtl .permissions-category { + margin: 0 7px -1px 0; +} + +.permissions-category ul { + margin: 0; + padding: 0; + list-style: none; +} + +.permissions-category li { + display: inline; + margin: 0; + padding: 0; + font-size: 1em; + font-weight: bold; +} + +.permissions-category a { + float: left; + background: url("../images/bg_tabs_alt1.gif") no-repeat 0% -35px; + margin: 0 1px 0 0; + padding: 0 0 0 6px; + text-decoration: none; + position: relative; +} + +.rtl .permissions-category a { + float: right; +} + +.permissions-category a span.tabbg { + float: left; + display: block; + background: url("../images/bg_tabs_alt2.gif") no-repeat 100% -35px; + padding: 7px 12px 6px 6px; + color: #536482; + white-space: nowrap; +} + +.rtl .permissions-category a span.tabbg { + float: right; +} + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +.permissions-category a span.tabbg, .rtl .permissions-category a span.tabbg { float: none;} +/* End hack */ + +.permissions-category a:hover span.tabbg { + color: #DD6900; +} + +.permissions-category .activetab a { + background-position: 0 0; +} + +.permissions-category .activetab a span.tabbg { + background-position: 100% 0; + padding-bottom: 7px; + color: #333333; +} + +.permissions-category a:hover { + background-position: 0 -70px; +} + +.permissions-category a:hover span.tabbg { + background-position: 100% -70px; +} + +.permissions-category .activetab a:hover span.tabbg { + color: #333333; + background-position: 100% 0; +} + +.permissions-category .activetab a:hover { + background-position: 0 0; +} + +.permissions-category a span.colour { + border: 1px solid #536482; + display: block; + float: left; + width: 10px; + height: 10px; + margin: 0 5px 0 0; +} + +/* Most browsers will have to live with a left aligned icon in RTL mode, as (currently) only Firefox 3.0 Alpha 3 renders it correctly without destroying it +.rtl .permissions-category a span.colour { + float: right; + margin: 0 0 0 5px; +} +*/ + +.permissions-category .activetab span.colour { + border-color: #333333; +} + +.permissions-category a:hover span.colour { + border-color: #DD6900; +} + +.permissions-category .activetab a:hover span.colour { + border-color: #333333; +} + +/* Permission preset colours */ +.permissions-preset-yes span.colour, +.yes { + background-color: #86F786; +} + +.permissions-preset-custom span.colour { + background-color: #B2BBDD; +} + +.permissions-preset-never span.colour { + background-color: #DD0000; +} + +.permissions-preset-no span.colour, +.never { + background-color: #EFB0B2; +} + +/* Permission panel +---------------------------------------- */ +.permissions-panel { + float: left; + background-color: #CADCEB; + width: 100%; + border-radius: 5px; + overflow: hidden; + padding: 5px 0; +} + +.rtl .permissions-panel { + float: right; +} + +/* Permission table +---------------------------------------- */ +.permissions-panel .tablewrap { + margin: 0 10px; +} + +.permissions-panel table { + width: 100%; +} + +.permissions-panel th { + text-transform: none; +} + +.permissions-panel th.value { + text-align: center; +} + +.permissions-panel th.name { + text-align: left; + width: auto; + text-transform: none; +} + +.rtl .permissions-panel th.name { + text-align: right; +} + +.permissions-panel th.permissions-name { + border: none; + color: #536482; + font-weight: normal; +} + +.permissions-panel th.permissions-name a.trace { + display: inline; +} + +.permissions-panel th.row3 { + background-image: none; + background-color: #D1D7DC; + color: #536482; + border: none; +} + +.permissions-panel th.row4 { + background-image: none; + background-color: #E4E8EB; + color: #536482; + border: none; +} + +.permissions-panel th a:link, .permissions-panel th a:hover, .permissions-panel th a:visited { + display: block; + color: #FFFFFF; + text-decoration: underline; +} + +.permissions-panel td.permissions-yes label:hover { + background-color: #86F786; +} + +.permissions-panel td.permissions-no label:hover { + background-color: #EFB0B2; +} + +.permissions-panel td.permissions-never label:hover { + background-color: #DD0000; +} + +.permissions-panel td { + padding: 0; + text-align: center; + width: 10%; +} + +.permissions-panel td label { + display: block; + margin: 0; + padding: 0; +} + +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + .column1, .column2 { + float: none !important; + width: auto; + } + + .permissions-simple { + clear: both; + } + + .permissions-simple td, .permissions-simple dd { + width: auto !important; + margin-left: 0 !important; + margin-right: 0 !important; + } + + .permissions-simple dd { + margin-top: 5px; + } + + .permissions-panel .tablewrap { + margin: 0 5px; + } + + .permissions-category { + min-width: 0; + margin: 0 !important; + } + + .permissions-category a, .permissions-category a span.tabbg { + display: block; + float: none !important; + background: transparent none; + } + + .permissions-category a { + background: #d9e5ee; + margin: 5px 0; + padding: 0 !important; + border-radius: 3px; + text-decoration: underline; + } + + .permissions-category .activetab a { + background-color: #dd6900; + color: #fff; + } + + .permissions-category a span.tabbg { + color: inherit !important; + padding-top: 6px !important; + padding-bottom: 6px !important; + } + + .permissions-category .activetab span.colour { + border-color: #fff; + } +} + +/* Avatars gallery +---------------------------------------- */ +#gallery { + display: block; + margin: 0 -5px; + padding: 0; + overflow: hidden; +} + +#gallery li { + display: block; + float: left; + border: 1px solid #ccc; + border-radius: 2px; + background: #fff; + padding: 5px; + margin: 5px; +} + +#gallery li:hover { + background-color: #eee; +} + +#gallery li label { + display: block; + text-align: center; + padding: 0; +} + +/* Dropdown menu +----------------------------------------*/ +.dropdown { + position: absolute; + left: 0; + top: 22px; + z-index: 2; + border: 1px solid transparent; + border-radius: 5px; + padding: 9px 0 0; +} + +.dropdown-up .dropdown { + top: auto; + bottom: 18px; + padding: 0 0 9px; +} + +.dropdown-left .dropdown { + left: auto; + right: 0; +} + +.dropdown .pointer, .dropdown .pointer-inner { + position: absolute; + width: 0; + height: 0; + border-top-width: 0; + border-bottom: 10px solid transparent; + border-left: 10px dashed transparent; + border-right: 10px dashed transparent; + -webkit-transform: rotate(360deg); /* better anti-aliasing in webkit */ + display: block; +} + +.dropdown-up .pointer, .dropdown-up .pointer-inner { + border-bottom-width: 0; + border-top: 10px solid transparent; +} + +.dropdown .pointer { + right: auto; + left: 10px; + top: 0; + z-index: 3; +} + +.dropdown-up .pointer { + bottom: 0; + top: auto; +} + +.dropdown-left .dropdown .pointer { + left: auto; + right: 10px; +} + +.dropdown .pointer-inner { + top: auto; + bottom: -11px; + left: -10px; +} + +.dropdown-up .pointer-inner { + bottom: auto; + top: -11px; +} + +.dropdown .pointer { + border-color: #B9B9B9 transparent; +} + +.dropdown .pointer-inner { + border-color: #FFF transparent; +} + +.dropdown .dropdown-contents { + z-index: 2; + overflow: hidden; + overflow-y: auto; + background: #fff; + border: 1px solid #b9b9b9; + border-radius: 5px; + padding: 5px; + position: relative; + min-width: 40px; + max-height: 200px; + box-shadow: 1px 3px 5px rgba(0, 0, 0, 0.2); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.dropdown-up .dropdown-contents { + box-shadow: 1px 0 5px rgba(0, 0, 0, 0.2); +} + +.dropdown li { + float: none; + margin: 0; + white-space: nowrap; + text-align: left; +} + +.wrap .dropdown li, .dropdown.wrap li { + white-space: normal; +} + +.dropdown li:before, .dropdown li:after { + display: none !important; +} + + +/* Classes for additional tasks +---------------------------------------- */ + +.phpinfo { + overflow: auto; + width: 99%; + direction: ltr; +} + +.phpinfo td, .phpinfo th, .phpinfo h2, .phpinfo h1 { + text-align: left; +} + +.requirements_not_met { + padding: 5px; + background-color: #BC2A4D; +} + +.requirements_not_met dt label, .requirements_not_met dd p { + color: #FFFFFF; + font-size: 1.4em; +} + +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + .responsive-hide { display: none !important; } + .responsive-show { display: block !important; } + .responsive-show-inline { display: inline !important; } + .responsive-show-inline-block { display: inline-block !important; } +} + +.clearfix { + overflow: hidden; +} + +.pagination:after, +#page-header:after, +#page-body:after, +#tabs:after, +#tabs > ul:after, +#tabs li:after, +#acp:after, +#content:after { + content: ''; + clear: both; + display: block; +} diff --git a/sources/phpBB/adm/style/admin.js b/sources/phpBB/adm/style/admin.js new file mode 100644 index 0000000..253fd46 --- /dev/null +++ b/sources/phpBB/adm/style/admin.js @@ -0,0 +1,250 @@ +/** +* phpBB3 ACP functions +*/ + +/** +* Parse document block +*/ +function parse_document(container) +{ + var test = document.createElement('div'), + oldBrowser = (typeof test.style.borderRadius == 'undefined'); + + delete test; + + /** + * Navigation + */ + container.find('#menu').each(function() { + var menu = $(this), + blocks = menu.children('.menu-block'); + + if (!blocks.length) { + return; + } + + // Set onclick event + blocks.children('a.header').click(function() { + var parent = $(this).parent(); + if (!parent.hasClass('active')) { + parent.siblings().removeClass('active'); + } + parent.toggleClass('active'); + }); + + // Set active menu + menu.find('#activemenu').parents('.menu-block').addClass('active'); + + // Check if there is active menu + if (!blocks.filter('.active').length) { + blocks.filter(':first').addClass('active'); + } + }); + + /** + * Responsive tables + */ + container.find('table').not('.not-responsive').each(function() { + var $this = $(this), + th = $this.find('thead > tr > th'), + columns = th.length, + headers = [], + totalHeaders = 0, + i, headersLength; + + // Find columns + $this.find('colgroup:first').children().each(function(i) { + var column = $(this); + $this.find('td:nth-child(' + (i + 1) + ')').addClass(column.prop('className')); + }); + + // Styles table + if ($this.hasClass('styles')) { + $this.find('td:first-child[style]').each(function() { + var style = $(this).attr('style'); + if (style.length) { + $(this).parent('tr').attr('style', style.toLowerCase().replace('padding', 'margin')).addClass('responsive-style-row'); + } + }); + } + + // Find each header + if (!$this.data('no-responsive-header')) + { + th.each(function(column) { + var cell = $(this), + colspan = parseInt(cell.attr('colspan')), + dfn = cell.attr('data-dfn'), + text = dfn ? dfn : $.trim(cell.text()); + + if (text == ' ') text = ''; + colspan = isNaN(colspan) || colspan < 1 ? 1 : colspan; + + for (i=0; i + $this.addClass('responsive'); + + if (totalHeaders < 2) { + $this.addClass('show-header'); + return; + } + + $this.find('tbody > tr').each(function() { + var row = $(this), + cells = row.children('td'), + column = 0; + + if (cells.length == 1) { + row.addClass('big-column'); + return; + } + + cells.each(function() { + var cell = $(this), + colspan = parseInt(cell.attr('colspan')), + text = $.trim(cell.text()); + + if (headersLength <= column) { + return; + } + + if ((text.length && text !== '-') || cell.children().length) { + if (headers[column] != '') { + cell.prepend('' + headers[column] + ''); + } + } + else { + cell.addClass('empty'); + } + + colspan = isNaN(colspan) || colspan < 1 ? 1 : colspan; + column += colspan; + }); + }); + + // Remove in disabled extensions list + $this.find('tr.ext_disabled > .empty:nth-child(2) + .empty').siblings(':first-child').children('dfn').remove(); + }); + + /** + * Hide empty responsive tables + */ + container.find('table.responsive > tbody').each(function() { + var items = $(this).children('tr'); + if (items.length == 0) + { + $(this).parent('table:first').addClass('responsive-hide'); + } + }); + + /** + * Fieldsets with empty + */ + container.find('fieldset dt > span:last-child').each(function() { + var $this = $(this); + if ($this.html() == ' ') { + $this.addClass('responsive-hide'); + } + + }); + + /** + * Responsive tabs + */ + container.find('#tabs').not('[data-skip-responsive]').each(function() { + var $this = $(this), + $body = $('body'), + ul = $this.children(), + tabs = ul.children().not('[data-skip-responsive]'), + links = tabs.children('a'), + item = ul.append('').find('li.responsive-tab'), + menu = item.find('.dropdown-contents'), + maxHeight = 0, + lastWidth = false, + responsive = false; + + links.each(function() { + var link = $(this); + maxHeight = Math.max(maxHeight, Math.max(link.outerHeight(true), link.parent().outerHeight(true))); + }) + + function check() { + var width = $body.width(), + height = $this.height(); + + if (arguments.length == 0 && (!responsive || width <= lastWidth) && height <= maxHeight) { + return; + } + + tabs.show(); + item.hide(); + + lastWidth = width; + height = $this.height(); + if (height <= maxHeight) { + responsive = false; + if (item.hasClass('dropdown-visible')) { + phpbb.toggleDropdown.call(item.find('a.responsive-tab-link').get(0)); + } + return; + } + + responsive = true; + item.show(); + menu.html(''); + + var availableTabs = tabs.filter(':not(.activetab, .responsive-tab)'), + total = availableTabs.length, + i, tab; + + for (i = total - 1; i >= 0; i --) { + tab = availableTabs.eq(i); + menu.prepend(tab.clone(true).removeClass('tab')); + tab.hide(); + if ($this.height() <= maxHeight) { + menu.find('a').click(function() { check(true); }); + return; + } + } + menu.find('a').click(function() { check(true); }); + } + + phpbb.registerDropdown(item.find('a.responsive-tab-link'), item.find('.dropdown'), {visibleClass: 'activetab', verticalDirection: 'down'}); + + check(true); + $(window).resize(check); + }); +} + +/** +* Run onload functions +*/ +(function($) { + $(document).ready(function() { + // Swap .nojs and .hasjs + $('body.nojs').toggleClass('nojs hasjs'); + + // Focus forms + $('form[data-focus]:first').each(function() { + $('#' + this.getAttribute('data-focus')).focus(); + }); + + parse_document($('body')); + + // Hide configlist and success message in send statistics page + phpbb.toggleDisplay('configlist', -1); + phpbb.toggleDisplay('questionnaire-thanks', -1); + }); +})(jQuery); diff --git a/sources/phpBB/adm/style/ajax.js b/sources/phpBB/adm/style/ajax.js new file mode 100644 index 0000000..4ad6b6a --- /dev/null +++ b/sources/phpBB/adm/style/ajax.js @@ -0,0 +1,89 @@ +/* global phpbb */ + +(function($) { // Avoid conflicts with other libraries + +'use strict'; + +/** + * The following callbacks are for reording items. row_down + * is triggered when an item is moved down, and row_up is triggered when + * an item is moved up. It moves the row up or down, and deactivates / + * activates any up / down icons that require it (the ones at the top or bottom). + */ +phpbb.addAjaxCallback('row_down', function(res) { + if (typeof res.success === 'undefined' || !res.success) { + return; + } + + var $firstTr = $(this).parents('tr'), + $secondTr = $firstTr.next(); + + $firstTr.insertAfter($secondTr); +}); + +phpbb.addAjaxCallback('row_up', function(res) { + if (typeof res.success === 'undefined' || !res.success) { + return; + } + + var $secondTr = $(this).parents('tr'), + $firstTr = $secondTr.prev(); + + $secondTr.insertBefore($firstTr); +}); + +/** + * This callback replaces activate links with deactivate links and vice versa. + * It does this by replacing the text, and replacing all instances of "activate" + * in the href with "deactivate", and vice versa. + */ +phpbb.addAjaxCallback('activate_deactivate', function(res) { + var $this = $(this), + newHref = $this.attr('href'); + + $this.text(res.text); + + if (newHref.indexOf('deactivate') !== -1) { + newHref = newHref.replace('deactivate', 'activate'); + } else { + newHref = newHref.replace('activate', 'deactivate'); + } + + $this.attr('href', newHref); +}); + +/** + * The removes the parent row of the link or form that triggered the callback, + * and is good for stuff like the removal of forums. + */ +phpbb.addAjaxCallback('row_delete', function(res) { + if (res.SUCCESS !== false) { + $(this).parents('tr').remove(); + } +}); + + + +$('[data-ajax]').each(function() { + var $this = $(this), + ajax = $this.attr('data-ajax'); + + if (ajax !== 'false') { + var fn = (ajax !== 'true') ? ajax : null; + phpbb.ajaxify({ + selector: this, + refresh: $this.attr('data-refresh') !== undefined, + callback: fn + }); + } +}); + +/** +* Automatically resize textarea +*/ +$(function() { + phpbb.resizeTextArea($('textarea:not(.no-auto-resize)'), {minHeight: 75}); +}); + + +})(jQuery); // Avoid conflicts with other libraries diff --git a/sources/phpBB/adm/style/auth_provider_ldap.html b/sources/phpBB/adm/style/auth_provider_ldap.html new file mode 100644 index 0000000..97684db --- /dev/null +++ b/sources/phpBB/adm/style/auth_provider_ldap.html @@ -0,0 +1,35 @@ +
+ {L_LDAP} +
+

{L_LDAP_SERVER_EXPLAIN}
+
+
+
+

{L_LDAP_PORT_EXPLAIN}
+
+
+
+

{L_LDAP_DN_EXPLAIN}
+
+
+
+

{L_LDAP_UID_EXPLAIN}
+
+
+
+

{L_LDAP_USER_FILTER_EXPLAIN}
+
+
+
+

{L_LDAP_EMAIL_EXPLAIN}
+
+
+
+

{L_LDAP_USER_EXPLAIN}
+
+
+
+

{L_LDAP_PASSWORD_EXPLAIN}
+
+
+
diff --git a/sources/phpBB/adm/style/auth_provider_oauth.html b/sources/phpBB/adm/style/auth_provider_oauth.html new file mode 100644 index 0000000..4c8ff4d --- /dev/null +++ b/sources/phpBB/adm/style/auth_provider_oauth.html @@ -0,0 +1,18 @@ + +
+

{L_AUTH_PROVIDER_OAUTH_EXPLAIN}

+ + +
+ {oauth_services.ACTUAL_NAME} +
+
+
+
+
+
+
+
+
+ +
diff --git a/sources/phpBB/adm/style/captcha_default_acp_demo.html b/sources/phpBB/adm/style/captcha_default_acp_demo.html new file mode 100644 index 0000000..0f137f2 --- /dev/null +++ b/sources/phpBB/adm/style/captcha_default_acp_demo.html @@ -0,0 +1,4 @@ +
+

{L_CAPTCHA_PREVIEW_EXPLAIN}
+
{L_PREVIEW}
+
diff --git a/sources/phpBB/adm/style/captcha_gd_acp.html b/sources/phpBB/adm/style/captcha_gd_acp.html new file mode 100644 index 0000000..43d54ad --- /dev/null +++ b/sources/phpBB/adm/style/captcha_gd_acp.html @@ -0,0 +1,74 @@ + + + + « {L_BACK} + +

{L_ACP_VC_SETTINGS}

+ +

{L_ACP_VC_SETTINGS_EXPLAIN}

+ + +
+ +
+{L_GENERAL_OPTIONS} + +
+

{L_CAPTCHA_GD_FOREGROUND_NOISE_EXPLAIN}
+
+
+
+
+

{L_CAPTCHA_GD_X_GRID_EXPLAIN}
+
+
+
+

{L_CAPTCHA_GD_Y_GRID_EXPLAIN}
+
+
+
+

{L_CAPTCHA_GD_WAVE_EXPLAIN}
+
+ +
+
+
+

{L_CAPTCHA_GD_3D_NOISE_EXPLAIN}
+
+ +
+
+
+

{L_CAPTCHA_GD_FONTS_EXPLAIN}
+
+ + + +
+
+ +
+
+ {L_PREVIEW} + + + + +
+ +
+ {L_ACP_SUBMIT_CHANGES} +

+   +   +   +

+ + + + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/adm/style/captcha_qa_acp.html b/sources/phpBB/adm/style/captcha_qa_acp.html new file mode 100644 index 0000000..6235f9a --- /dev/null +++ b/sources/phpBB/adm/style/captcha_qa_acp.html @@ -0,0 +1,90 @@ + + + + + + « {L_BACK} + +

{L_QUESTIONS}

+ +

{L_QUESTIONS_EXPLAIN}

+ +
+ +
+ {L_QUESTIONS} + + + + + + + + + + + + + + + + + + + + + +
{L_QUESTIONS}
{L_QUESTION_TEXT}{L_QUESTION_LANG}{L_ACTION}
{questions.QUESTION_TEXT}{questions.QUESTION_LANG}{ICON_EDIT} {ICON_DELETE}
+
+ + + + + + {S_FORM_TOKEN} +
+ {S_FORM_TOKEN} +
+
+ + +
+

{L_WARNING}

+

{L_QA_ERROR_MSG}

+
+ +
+
+ {L_EDIT_QUESTION} +
+

{L_QUESTION_STRICT_EXPLAIN}
+
+
+
+ +
+

{L_QUESTION_LANG_EXPLAIN}
+
+
+
+

{L_QUESTION_TEXT_EXPLAIN}
+
+
+
+

{L_ANSWERS_EXPLAIN}
+
+
+
+
+ + + + + + + {S_FORM_TOKEN} +
+
+ + + diff --git a/sources/phpBB/adm/style/captcha_qa_acp_demo.html b/sources/phpBB/adm/style/captcha_qa_acp_demo.html new file mode 100644 index 0000000..79170e2 --- /dev/null +++ b/sources/phpBB/adm/style/captcha_qa_acp_demo.html @@ -0,0 +1,7 @@ +
+

{L_CONFIRM_QUESTION_EXPLAIN}
+ +
+ +
+
diff --git a/sources/phpBB/adm/style/captcha_recaptcha.html b/sources/phpBB/adm/style/captcha_recaptcha.html new file mode 100644 index 0000000..d3038fd --- /dev/null +++ b/sources/phpBB/adm/style/captcha_recaptcha.html @@ -0,0 +1,34 @@ + +
+
+ + + + + + + +
+
+ +{L_RECAPTCHA_NOT_AVAILABLE} + diff --git a/sources/phpBB/adm/style/captcha_recaptcha_acp.html b/sources/phpBB/adm/style/captcha_recaptcha_acp.html new file mode 100644 index 0000000..67176eb --- /dev/null +++ b/sources/phpBB/adm/style/captcha_recaptcha_acp.html @@ -0,0 +1,50 @@ + + + + +

{L_ACP_VC_SETTINGS}

+ +

{L_ACP_VC_SETTINGS_EXPLAIN}

+ + +
+ +
+{L_GENERAL_OPTIONS} + +
+

{L_RECAPTCHA_PUBLIC_EXPLAIN}
+
+
+
+

{L_RECAPTCHA_PRIVATE_EXPLAIN}
+
+
+ + +
+
+ {L_PREVIEW} + +
+

{L_WARNING}

+

{L_CAPTCHA_PREVIEW_MSG}

+
+ + +
+ +
+ {L_ACP_SUBMIT_CHANGES} +

+   +   +

+ + + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/adm/style/confirm_bbcode.html b/sources/phpBB/adm/style/confirm_bbcode.html new file mode 100644 index 0000000..52a6523 --- /dev/null +++ b/sources/phpBB/adm/style/confirm_bbcode.html @@ -0,0 +1,22 @@ + + +
+
+

{L_WARNING}

+

{MESSAGE_TEXT}

+
+
+ + + {S_HIDDEN_FIELDS} + +
+   + +
+ +
+ +
+ + diff --git a/sources/phpBB/adm/style/confirm_body.html b/sources/phpBB/adm/style/confirm_body.html new file mode 100644 index 0000000..d0360d1 --- /dev/null +++ b/sources/phpBB/adm/style/confirm_body.html @@ -0,0 +1,32 @@ + + +

{MESSAGE_TITLE}

+

{MESSAGE_TEXT}

+ +
+   + +
+ + + + + +
+ +
+

{MESSAGE_TITLE}

+

{MESSAGE_TEXT}

+ + {S_HIDDEN_FIELDS} + +
+   + +
+ +
+
+ + + diff --git a/sources/phpBB/adm/style/confirm_body_prune.html b/sources/phpBB/adm/style/confirm_body_prune.html new file mode 100644 index 0000000..4c00ac2 --- /dev/null +++ b/sources/phpBB/adm/style/confirm_body_prune.html @@ -0,0 +1,36 @@ + + +
+ +
+

{L_PRUNE_USERS_LIST}

+

{L_PRUNE_USERS_LIST_DEACTIVATE}

{L_PRUNE_USERS_LIST_DELETE}

+ +
+ + » + {users.USERNAME} + [ {L_USER_ADMIN} ]
+ +
+ + {L_MARK_ALL} • + {L_UNMARK_ALL} + +
+ +
+

{MESSAGE_TITLE}

+

{MESSAGE_TEXT}

+ + {S_HIDDEN_FIELDS} + +
+   + +
+
+ +
+ + diff --git a/sources/phpBB/adm/style/install_convert.html b/sources/phpBB/adm/style/install_convert.html new file mode 100644 index 0000000..7e22404 --- /dev/null +++ b/sources/phpBB/adm/style/install_convert.html @@ -0,0 +1,134 @@ + + + + +

{TITLE}

+ +

{BODY}

+ + + +
+ +

{TITLE}

+ +

{BODY}

+ + +
+

{ERROR_TITLE}

+

{ERROR_MSG}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_AVAILABLE_CONVERTORS}
{L_SOFTWARE}{L_VERSION}{L_AUTHOR}{L_OPTIONS}
{convertors.SOFTWARE}{convertors.VERSION}{convertors.AUTHOR}{L_CONVERT}
{L_NO_CONVERTORS}---
+ + + +
+ +
+
+ +
+
+
+ +
+
+ +
+ + + +
+ + + + +
+ +
+ + {checks.LEGEND} +

{checks.LEGEND_EXPLAIN}

+ + +
+

{checks.TITLE_EXPLAIN}
+
{checks.RESULT}
+
+ + + +
+ + + +
+ + + + +
+ +
+ + {options.LEGEND} + + +
+

{options.TITLE_EXPLAIN}
+
{options.CONTENT}
+
+ + + + +
+ + + +

{L_MESSAGE}

+ +
+ {S_HIDDEN} + disabled="disabled" onclick="this.className = 'button1 disabled';" onsubmit="this.disabled = 'disabled';" name="submit" value="{L_SUBMIT}" /> +
+ + +
+ + + diff --git a/sources/phpBB/adm/style/install_error.html b/sources/phpBB/adm/style/install_error.html new file mode 100644 index 0000000..3f7c8b9 --- /dev/null +++ b/sources/phpBB/adm/style/install_error.html @@ -0,0 +1,8 @@ + + +
+

{MESSAGE_TITLE}

+

{MESSAGE_TEXT}

+
+ + diff --git a/sources/phpBB/adm/style/install_footer.html b/sources/phpBB/adm/style/install_footer.html new file mode 100644 index 0000000..a29fce6 --- /dev/null +++ b/sources/phpBB/adm/style/install_footer.html @@ -0,0 +1,21 @@ + + + + + + + + + + + + + +{$SCRIPTS} + + + diff --git a/sources/phpBB/adm/style/install_header.html b/sources/phpBB/adm/style/install_header.html new file mode 100644 index 0000000..c818a4f --- /dev/null +++ b/sources/phpBB/adm/style/install_header.html @@ -0,0 +1,53 @@ + + + + + +{META} +{PAGE_TITLE} + + + + + +
+ + +
+
+ +
+ +
+
+ + +
+
diff --git a/sources/phpBB/adm/style/install_install.html b/sources/phpBB/adm/style/install_install.html new file mode 100644 index 0000000..1a809a3 --- /dev/null +++ b/sources/phpBB/adm/style/install_install.html @@ -0,0 +1,77 @@ + + +
+ +

{TITLE}

+

{BODY}

+ + +
+ + + + +
+ +
+ + {checks.LEGEND} +

{checks.LEGEND_EXPLAIN}

+ + +
+
{checks.TITLE}{L_COLON}
{checks.TITLE_EXPLAIN}
+
{checks.RESULT}
+
+ + + +
+ + + +
+ + + + +
+ +
+ + {options.LEGEND} + + +
+

{options.TITLE_EXPLAIN}
+
{options.CONTENT}
+
+ + + + +
+ + + +

{L_DL_CONFIG}

+

{L_DL_CONFIG_EXPLAIN}

+ +
+ {L_DL_CONFIG} + {S_HIDDEN} +   +
+ + + +
+ {L_SUBMIT} + {S_HIDDEN} + +
+ + +
+ + diff --git a/sources/phpBB/adm/style/install_main.html b/sources/phpBB/adm/style/install_main.html new file mode 100644 index 0000000..73e73ad --- /dev/null +++ b/sources/phpBB/adm/style/install_main.html @@ -0,0 +1,6 @@ + + +

{TITLE}

+

{BODY}

+ + diff --git a/sources/phpBB/adm/style/install_update.html b/sources/phpBB/adm/style/install_update.html new file mode 100644 index 0000000..898233f --- /dev/null +++ b/sources/phpBB/adm/style/install_update.html @@ -0,0 +1,491 @@ + + + + + +
+

{L_NOTICE}

+

{ERROR_MSG}

+
+ + + + +
+

{L_IN_PROGRESS}

+

{L_IN_PROGRESS_EXPLAIN}

+
+ + + + +
+

{L_NOTICE}

+

{WARNING_MSG}

+
+ + +
+

{L_NOTICE}

+

{L_BACKUP_NOTICE}

+
+ +
+ +

{L_UPDATE_INSTALLATION}

+

{L_UPDATE_INSTALLATION_EXPLAIN}

+ +
+ +
+ +
+ + + +
+ +

{L_UPDATE_SUCCESS}

+

{L_UPDATE_SUCCESS_EXPLAIN}

+ +
+ +
+ +
+ + + + + +

{L_VERSION_CHECK}

+ +

{L_VERSION_CHECK_EXPLAIN}

+ + +
+

{L_VERSION_UP_TO_DATE}

+
+ +
+

{L_VERSION_NOT_UP_TO_DATE}

+
+ + +
+ +
+
+
{CURRENT_VERSION}
+
+
+
+
{LATEST_VERSION}
+
+ +
+
+
{PACKAGE_VERSION}
+
+ +
+ +
+ +
+

{L_CHECK_FILES_EXPLAIN}

+ +
+ +
+ + + + + +

{L_PERFORM_DATABASE_UPDATE}

+ +

+ {L_PERFORM_DATABASE_UPDATE_EXPLAIN}
+

+ +

+ +
+ +
+ {L_RUN_DATABASE_SCRIPT} + + +
+ +
+ + + +
+

{L_UPDATE_SUCCESS}

+

{L_EVERYTHING_UP_TO_DATE}

+
+ + + + + + + +

{L_UPDATE_FILE_SUCCESS}

+

{L_ALL_FILES_UP_TO_DATE}

+ +

{L_UPDATE_DATABASE_EXPLAIN}

+ +
+ +
+ +
+ +
+ + +

{L_COLLECTED_INFORMATION}

+ +

{L_COLLECTED_INFORMATION_EXPLAIN}

+ + +
+

{L_NO_UPDATE_FILES}

+ +

{L_NO_UPDATE_FILES_EXPLAIN}


+ + {NO_UPDATE_FILES} + +
+ + +
+ + +

{L_FILES_DELETED}

+ +

{L_FILES_DELETED_EXPLAIN}

+ +
+ {L_STATUS_DELETED} + +
+
{deleted.DIR_PART}
{deleted.FILE_PART}
+
+ [{deleted.L_SHOW_DIFF}]{L_BINARY_FILE} +
+
+ +
+ + + + +

{L_FILES_CONFLICT}

+ +

{L_FILES_CONFLICT_EXPLAIN}

+ + +
+ {L_STATUS_CONFLICT} +
+
{conflict.DIR_PART}
{conflict.FILE_PART}
+
{L_FILE_USED}{L_COLON} {conflict.CUSTOM_ORIGINAL} +
{L_NUM_CONFLICTS}{L_COLON} {conflict.NUM_CONFLICTS} +
+
+ [{L_DOWNLOAD_CONFLICTS}]
{L_DOWNLOAD_CONFLICTS_EXPLAIN} + {L_BINARY_FILE} +
+ +
+ +
+ +
+
+
 
+
+ +
+
+
[{L_SHOW_DIFF_MODIFIED}]
+
+
+
+
[{L_SHOW_DIFF_MODIFIED}]
+
+
+
+
[{L_SHOW_DIFF_FINAL}]
+
+
+
+
[{L_SHOW_DIFF_FINAL}]
+
+ +
+ + + + + +

{L_FILES_NEW_CONFLICT}

+ +

{L_FILES_NEW_CONFLICT_EXPLAIN}

+ +
+ {L_STATUS_NEW_CONFLICT} + +
+
{new_conflict.DIR_PART}
{new_conflict.FILE_PART}
+
{L_FILE_USED}{L_COLON} {new_conflict.CUSTOM_ORIGINAL} +
+
+ [{new_conflict.L_SHOW_DIFF}]{L_BINARY_FILE} +
+ +
+ +
+ +
+ + + + +

{L_FILES_MODIFIED}

+ +

{L_FILES_MODIFIED_EXPLAIN}

+ + +
+ {L_STATUS_MODIFIED} +
+
{modified.DIR_PART}
{modified.FILE_PART}
+
{L_FILE_USED}{L_COLON} {modified.CUSTOM_ORIGINAL} +
+
 
+ +
+ +
+
+
+
[{modified.L_SHOW_DIFF}]{L_BINARY_FILE}
+
+
+
+
[{L_SHOW_DIFF_FINAL}] 
+
+
+
+
[{L_SHOW_DIFF_FINAL}] 
+
+
+ + + + + +

{L_FILES_NEW}

+ +

{L_FILES_NEW_EXPLAIN}

+ + + + + + +

{L_FILES_NOT_MODIFIED}

+ +

{L_FILES_NOT_MODIFIED_EXPLAIN}

+ + + + + + +

{L_FILES_UP_TO_DATE}

+ +

{L_FILES_UP_TO_DATE_EXPLAIN}

+ + + + + +
+ +
+ +
+ +
+ +

{L_UPDATE_METHOD}

+ +

{L_UPDATE_METHOD_EXPLAIN}

+ +
+     +
+ +
+ + + + + +

{L_DOWNLOAD_UPDATE_METHOD}

+ +

{L_DOWNLOAD_UPDATE_METHOD_EXPLAIN}

+ +
+ +
+ {L_SELECT_DOWNLOAD_FORMAT} +
+
+
{RADIO_BUTTONS}
+
+
+ +
+ {S_HIDDEN_FIELDS} +     +
+ +
+ +

+ +

{L_MAPPING_FILE_STRUCTURE}

+ + + + + + + + + + + + + + + + + + + +
{L_ARCHIVE_FILE} {L_DESTINATION}
{location.SOURCE}»{location.DESTINATION}
+ + + +

{L_SELECT_FTP_SETTINGS}

+ +
+ + +
+

{L_CONNECTION_SUCCESS}

+
+ +
+

{L_TRY_DOWNLOAD_METHOD}

+ +
+ +
+
+ +
+

{L_CONNECTION_FAILED}
{ERROR_MSG}

+
+ + +
+ {L_FTP_SETTINGS} +
+
+
{UPLOAD_METHOD}
+
+ +
+

{data.EXPLAIN}
+
+
+ +
+ +
+ {S_HIDDEN_FIELDS} + + + +
+ +
+ + + + diff --git a/sources/phpBB/adm/style/install_update_diff.html b/sources/phpBB/adm/style/install_update_diff.html new file mode 100644 index 0000000..150ef37 --- /dev/null +++ b/sources/phpBB/adm/style/install_update_diff.html @@ -0,0 +1,254 @@ + + + + + +{META} +{PAGE_TITLE} + + + + + + + + + + + + + + + +
+ + +
+
+
+
+
+ {DIFF_CONTENT} +
+
+
+
+
+ + + diff --git a/sources/phpBB/adm/style/message_body.html b/sources/phpBB/adm/style/message_body.html new file mode 100644 index 0000000..3ea9e5b --- /dev/null +++ b/sources/phpBB/adm/style/message_body.html @@ -0,0 +1,8 @@ + + +
class="successbox"class="errorbox"> +

{MESSAGE_TITLE}

+

{MESSAGE_TEXT}

+
+ + diff --git a/sources/phpBB/adm/style/overall_footer.html b/sources/phpBB/adm/style/overall_footer.html new file mode 100644 index 0000000..deb38c8 --- /dev/null +++ b/sources/phpBB/adm/style/overall_footer.html @@ -0,0 +1,46 @@ +
+
+
+
+
+ + +
+ + + + + + + + +{$SCRIPTS} + + + diff --git a/sources/phpBB/adm/style/overall_header.html b/sources/phpBB/adm/style/overall_header.html new file mode 100644 index 0000000..f1f7eee --- /dev/null +++ b/sources/phpBB/adm/style/overall_header.html @@ -0,0 +1,148 @@ + + + + + +{META} +{PAGE_TITLE} + + + + + + + +{$STYLESHEETS} + + + + + + + + + +
+ + +
+
+ +
+ +
+
+ + + +
+ +
+
diff --git a/sources/phpBB/adm/style/pagination.html b/sources/phpBB/adm/style/pagination.html new file mode 100644 index 0000000..5e75572 --- /dev/null +++ b/sources/phpBB/adm/style/pagination.html @@ -0,0 +1,12 @@ + + {PAGE_NUMBER} • + diff --git a/sources/phpBB/adm/style/permission_forum_copy.html b/sources/phpBB/adm/style/permission_forum_copy.html new file mode 100644 index 0000000..1e012a9 --- /dev/null +++ b/sources/phpBB/adm/style/permission_forum_copy.html @@ -0,0 +1,40 @@ + + + + +

{L_ACP_FORUM_PERMISSIONS_COPY}

+ + {L_ACP_FORUM_PERMISSIONS_COPY_EXPLAIN} + +
+ +
+ {L_LOOK_UP_FORUM} + +
+

{L_COPY_PERMISSIONS_FORUM_FROM_EXPLAIN}
+
+
+
+ +
+ {L_LOOK_UP_FORUM} +

{L_LOOK_UP_FORUMS_EXPLAIN}

+ +
+

{L_COPY_PERMISSIONS_FORUM_TO_EXPLAIN}
+
+
+
+ +
+ {L_SUBMIT} +   + + {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} +
+ +
+ + diff --git a/sources/phpBB/adm/style/permission_mask.html b/sources/phpBB/adm/style/permission_mask.html new file mode 100644 index 0000000..7b5c071 --- /dev/null +++ b/sources/phpBB/adm/style/permission_mask.html @@ -0,0 +1,137 @@ + + + + + +
+

{p_mask.NAME} [{p_mask.L_ACL_TYPE}]

+ + +
+
+ + + + + + {p_mask.f_mask.PADDING}{p_mask.f_mask.PADDING}{p_mask.f_mask.NAME} + + + +
+
+ +
+ +
{L_NO_ROLE_AVAILABLE}
+ +
+ + + + + +
+ + + diff --git a/sources/phpBB/adm/style/permission_roles_mask.html b/sources/phpBB/adm/style/permission_roles_mask.html new file mode 100644 index 0000000..3a14e65 --- /dev/null +++ b/sources/phpBB/adm/style/permission_roles_mask.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + +
{L_FORUM}{L_COLON} {role_mask.NAME}
{L_USERS}
+ + {role_mask.users.USERNAME} :: + + {L_USERS_NOT_ASSIGNED} + +
{L_GROUPS}
+ + {role_mask.groups.GROUP_NAME} :: + + {L_GROUPS_NOT_ASSIGNED} + +
+ + + +

{L_ROLE_NOT_ASSIGNED}

+ + diff --git a/sources/phpBB/adm/style/permission_trace.html b/sources/phpBB/adm/style/permission_trace.html new file mode 100644 index 0000000..7330ffe --- /dev/null +++ b/sources/phpBB/adm/style/permission_trace.html @@ -0,0 +1,58 @@ + + +
+ + « {L_BACK} + +

{L_TRACE_FOR}{L_COLON} {PERMISSION_USERNAME} / {FORUM_NAME} / {PERMISSION}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_TRACE_WHO}{L_ACL_SETTING}{L_TRACE_TOTAL}{L_INFORMATION}
{trace.WHO}{L_ACL_NEVER}{L_ACL_YES}{L_ACL_NO}{L_ACL_NEVER}{L_ACL_YES}{L_ACL_NO}{trace.INFORMATION}
{L_TRACE_RESULT} + {L_ACL_NEVER}{L_ACL_YES}{L_ACL_NO} + {L_RESULTING_PERMISSION}
+ +
+ +
+ + diff --git a/sources/phpBB/adm/style/permissions.js b/sources/phpBB/adm/style/permissions.js new file mode 100644 index 0000000..9178ada --- /dev/null +++ b/sources/phpBB/adm/style/permissions.js @@ -0,0 +1,300 @@ +/** +* Hide and show all checkboxes +* status = true (show boxes), false (hide boxes) +*/ +function display_checkboxes(status) { + var form = document.getElementById('set-permissions'); + var cb = document.getElementsByTagName('input'); + var display; + + //show + if (status) { + display = 'inline'; + } + //hide + else { + display = 'none'; + } + + for (var i = 0; i < cb.length; i++ ) { + if (cb[i].className === 'permissions-checkbox') { + cb[i].style.display = display; + } + } +} + +/** +* Change opacity of element +* e = element +* value = 0 (hidden) till 10 (fully visible) +*/ +function set_opacity(e, value) { + e.style.opacity = value/10; + + //IE opacity currently turned off, because of its astronomical stupidity + //e.style.filter = 'alpha(opacity=' + value*10 + ')'; +} + +/** +* Reset the opacity and checkboxes +* block_id = id of the element that needs to be toggled +*/ +function toggle_opacity(block_id) { + var cb = document.getElementById('checkbox' + block_id); + var fs = document.getElementById('perm' + block_id); + + if (cb.checked) { + set_opacity(fs, 5); + } else { + set_opacity(fs, 10); + } +} + +/** +* Reset the opacity and checkboxes +* value = 0 (checked) and 1 (unchecked) +* except_id = id of the element not to hide +*/ +function reset_opacity(status, except_id) { + var perm = document.getElementById('set-permissions'); + var fs = perm.getElementsByTagName('fieldset'); + var opacity = 5; + + if (status) { + opacity = 10; + } + + for (var i = 0; i < fs.length; i++ ) { + if (fs[i].className !== 'quick') { + set_opacity(fs[i], opacity); + } + } + + if (typeof(except_id) !== 'undefined') { + set_opacity(document.getElementById('perm' + except_id), 10); + } + + //reset checkboxes too + marklist('set-permissions', 'inherit', !status); +} + +/** +* Check whether we have a full radiobutton row of true +* index = offset for the row of inputs (0 == first row, 1 == second, 2 == third), +* rb = array of radiobuttons +*/ +function get_radio_status(index, rb) { + for (var i = index; i < rb.length; i = i + 3 ) { + if (rb[i].checked !== true) { + if (i > index) { + //at least one is true, but not all (custom) + return 2; + } + //first one is not true + return 0; + } + } + + // all radiobuttons true + return 1; +} + +/** +* Set tab colours +* id = panel the tab needs to be set for, +* init = initialising on open, +* quick = If no calculation needed, this contains the colour +*/ +function set_colours(id, init, quick) { + var table = document.getElementById('table' + id); + var tab = document.getElementById('tab' + id); + + if (typeof(quick) !== 'undefined') { + tab.className = 'permissions-preset-' + quick + ' activetab'; + return; + } + + var rb = table.getElementsByTagName('input'); + var colour = 'custom'; + + var status = get_radio_status(0, rb); + + if (status === 1) { + colour = 'yes'; + } else if (status === 0) { + // We move on to No + status = get_radio_status(1, rb); + + if (status === 1) { + colour = 'no'; + } else if (status === 0) { + // We move on to Never + status = get_radio_status(2, rb); + + if (status === 1) { + colour = 'never'; + } + } + } + + if (init) { + tab.className = 'permissions-preset-' + colour; + } else { + tab.className = 'permissions-preset-' + colour + ' activetab'; + } +} + +/** +* Initialise advanced tab colours on first load +* block_id = block that is opened +*/ +function init_colours(block_id) { + var block = document.getElementById('advanced' + block_id); + var panels = block.getElementsByTagName('div'); + var tab = document.getElementById('tab' + id); + + for (var i = 0; i < panels.length; i++) { + if (panels[i].className === 'permissions-panel') { + set_colours(panels[i].id.replace(/options/, ''), true); + } + } + + tab.className = tab.className + ' activetab'; +} + +/** +* Show/hide option panels +* value = suffix for ID to show +* adv = we are opening advanced permissions +* view = called from view permissions +*/ +function swap_options(pmask, fmask, cat, adv, view) { + id = pmask + fmask + cat; + active_option = active_pmask + active_fmask + active_cat; + + var old_tab = document.getElementById('tab' + active_option); + var new_tab = document.getElementById('tab' + id); + var adv_block = document.getElementById('advanced' + pmask + fmask); + + if (adv_block.style.display === 'block' && adv === true) { + phpbb.toggleDisplay('advanced' + pmask + fmask, -1); + reset_opacity(1); + display_checkboxes(false); + return; + } + + // no need to set anything if we are clicking on the same tab again + if (new_tab === old_tab && !adv) { + return; + } + + // init colours + if (adv && (pmask + fmask) !== (active_pmask + active_fmask)) { + init_colours(pmask + fmask); + display_checkboxes(true); + reset_opacity(1); + } else if (adv) { + //Checkbox might have been clicked, but we need full visibility + display_checkboxes(true); + reset_opacity(1); + } + + // set active tab + old_tab.className = old_tab.className.replace(/\ activetab/g, ''); + new_tab.className = new_tab.className + ' activetab'; + + if (id === active_option && adv !== true) { + return; + } + + phpbb.toggleDisplay('options' + active_option, -1); + + //hiding and showing the checkbox + if (document.getElementById('checkbox' + active_pmask + active_fmask)) { + phpbb.toggleDisplay('checkbox' + pmask + fmask, -1); + + if ((pmask + fmask) !== (active_pmask + active_fmask)) { + document.getElementById('checkbox' + active_pmask + active_fmask).style.display = 'inline'; + } + } + + if (!view) { + phpbb.toggleDisplay('advanced' + active_pmask + active_fmask, -1); + } + + if (!view) { + phpbb.toggleDisplay('advanced' + pmask + fmask, 1); + } + phpbb.toggleDisplay('options' + id, 1); + + active_pmask = pmask; + active_fmask = fmask; + active_cat = cat; +} + +/** +* Mark all radio buttons in one panel +* id = table ID container, s = status ['y'/'u'/'n'] +*/ +function mark_options(id, s) { + var t = document.getElementById(id); + + if (!t) { + return; + } + + var rb = t.getElementsByTagName('input'); + + for (var r = 0; r < rb.length; r++) { + if (rb[r].id.substr(rb[r].id.length-1) === s) { + rb[r].checked = true; + } + } +} + +function mark_one_option(id, field_name, s) { + var t = document.getElementById(id); + + if (!t) { + return; + } + + var rb = t.getElementsByTagName('input'); + + for (var r = 0; r < rb.length; r++) { + if (rb[r].id.substr(rb[r].id.length-field_name.length-3, field_name.length) === field_name && rb[r].id.substr(rb[r].id.length-1) === s) { + rb[r].checked = true; + } + } +} + +/** +* Reset role dropdown field to Select role... if an option gets changed +*/ +function reset_role(id) { + var t = document.getElementById(id); + + if (!t) { + return; + } + + t.options[0].selected = true; +} + +/** +* Load role and set options accordingly +*/ +function set_role_settings(role_id, target_id) { + settings = role_options[role_id]; + + if (!settings) { + return; + } + + // Mark all options to no (unset) first... + mark_options(target_id, 'u'); + + for (var r in settings) { + mark_one_option(target_id, r, (settings[r] === 1) ? 'y' : 'n'); + } +} diff --git a/sources/phpBB/adm/style/profilefields/bool.html b/sources/phpBB/adm/style/profilefields/bool.html new file mode 100644 index 0000000..f1d7ba7 --- /dev/null +++ b/sources/phpBB/adm/style/profilefields/bool.html @@ -0,0 +1,7 @@ + + + + + checked="checked" /> + + diff --git a/sources/phpBB/adm/style/profilefields/date.html b/sources/phpBB/adm/style/profilefields/date.html new file mode 100644 index 0000000..5d5bc04 --- /dev/null +++ b/sources/phpBB/adm/style/profilefields/date.html @@ -0,0 +1,5 @@ + + + + + diff --git a/sources/phpBB/adm/style/profilefields/dropdown.html b/sources/phpBB/adm/style/profilefields/dropdown.html new file mode 100644 index 0000000..243b703 --- /dev/null +++ b/sources/phpBB/adm/style/profilefields/dropdown.html @@ -0,0 +1,5 @@ + + + diff --git a/sources/phpBB/adm/style/profilefields/int.html b/sources/phpBB/adm/style/profilefields/int.html new file mode 100644 index 0000000..d047c25 --- /dev/null +++ b/sources/phpBB/adm/style/profilefields/int.html @@ -0,0 +1,3 @@ + + + diff --git a/sources/phpBB/adm/style/profilefields/string.html b/sources/phpBB/adm/style/profilefields/string.html new file mode 100644 index 0000000..a8855f5 --- /dev/null +++ b/sources/phpBB/adm/style/profilefields/string.html @@ -0,0 +1,3 @@ + + + diff --git a/sources/phpBB/adm/style/profilefields/text.html b/sources/phpBB/adm/style/profilefields/text.html new file mode 100644 index 0000000..6334b61 --- /dev/null +++ b/sources/phpBB/adm/style/profilefields/text.html @@ -0,0 +1,3 @@ + + + diff --git a/sources/phpBB/adm/style/profilefields/url.html b/sources/phpBB/adm/style/profilefields/url.html new file mode 100644 index 0000000..8dd3a90 --- /dev/null +++ b/sources/phpBB/adm/style/profilefields/url.html @@ -0,0 +1,3 @@ + + + diff --git a/sources/phpBB/adm/style/progress_bar.html b/sources/phpBB/adm/style/progress_bar.html new file mode 100644 index 0000000..1822675 --- /dev/null +++ b/sources/phpBB/adm/style/progress_bar.html @@ -0,0 +1,40 @@ + + + + +
+

{L_PROGRESS}

+ {L_PROGRESS} +

{L_PROGRESS_EXPLAIN}

+
+ + + + diff --git a/sources/phpBB/adm/style/simple_body.html b/sources/phpBB/adm/style/simple_body.html new file mode 100644 index 0000000..ca06bc4 --- /dev/null +++ b/sources/phpBB/adm/style/simple_body.html @@ -0,0 +1,8 @@ + + +
+

{MESSAGE_TITLE}

+

{MESSAGE_TEXT}

+
+ + diff --git a/sources/phpBB/adm/style/simple_footer.html b/sources/phpBB/adm/style/simple_footer.html new file mode 100644 index 0000000..c08fd93 --- /dev/null +++ b/sources/phpBB/adm/style/simple_footer.html @@ -0,0 +1,27 @@ + +

+
+ + + + + + + + +{$SCRIPTS} + + + diff --git a/sources/phpBB/adm/style/simple_header.html b/sources/phpBB/adm/style/simple_header.html new file mode 100644 index 0000000..d0b9bf6 --- /dev/null +++ b/sources/phpBB/adm/style/simple_header.html @@ -0,0 +1,94 @@ + + + + +{META} +{PAGE_TITLE} + + + + + +{$STYLESHEETS} + + + + + + + +
diff --git a/sources/phpBB/adm/style/timezone.js b/sources/phpBB/adm/style/timezone.js new file mode 100644 index 0000000..b5e27c9 --- /dev/null +++ b/sources/phpBB/adm/style/timezone.js @@ -0,0 +1,13 @@ +(function($) { // Avoid conflicts with other libraries + +"use strict"; + +$('#tz_date').change(function() { + phpbb.timezoneSwitchDate(false); +}); + +$(document).ready( + phpbb.timezoneEnableDateSelection +); + +})(jQuery); // Avoid conflicts with other libraries diff --git a/sources/phpBB/adm/style/timezone_option.html b/sources/phpBB/adm/style/timezone_option.html new file mode 100644 index 0000000..acfff30 --- /dev/null +++ b/sources/phpBB/adm/style/timezone_option.html @@ -0,0 +1,27 @@ +
+
+ + + +
+ + + +
+
diff --git a/sources/phpBB/adm/style/tooltip.js b/sources/phpBB/adm/style/tooltip.js new file mode 100644 index 0000000..3a89008 --- /dev/null +++ b/sources/phpBB/adm/style/tooltip.js @@ -0,0 +1,215 @@ +/* +javascript for Bubble Tooltips by Alessandro Fulciniti +- http://pro.html.it - http://web-graphics.com +obtained from: http://web-graphics.com/mtarchive/001717.php + +phpBB Development Team: + - modified to adhere to our coding guidelines + - integration into our design + - added ability to perform tooltips on select elements + - further adjustements +*/ + +var head_text, tooltip_mode; + +/** +* 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'; + + 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'; +} + +/** +* Enable tooltip replacements for selects +*/ +function enable_tooltips_select(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'; + + document.getElementsByTagName('body')[0].appendChild(hold); + + if (id === null) { + links = document.getElementsByTagName('option'); + } else { + links = document.getElementById(id).getElementsByTagName('option'); + } + + 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]); + } + } else { + prepare(links[i]); + } + } + + tooltip_mode = 'select'; +} + +/** +* Prepare elements to replace +*/ +function prepare(element) { + var tooltip, text, desc, title; + + text = element.getAttribute('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); + + element.tooltip = tooltip; + element.onmouseover = show_tooltip; + element.onmouseout = hide_tooltip; + + if (tooltip_mode === 'link') { + element.onmousemove = locate; + } +} + +/** +* Show tooltip +*/ +function show_tooltip(e) { + document.getElementById('_tooltip_container').appendChild(this.tooltip); + locate(this); +} + +/** +* Hide tooltip +*/ +function hide_tooltip(e) { + var d = document.getElementById('_tooltip_container'); + if (d.childNodes.length > 0) { + d.removeChild(d.firstChild); + } +} + +/** +* Set opacity on tooltip element +*/ +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'; +} + +/** +* 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; + + e = e.parentNode; + + if (e.offsetParent) { + for (posx = 0, posy = 0; e.offsetParent; e = e.offsetParent) { + posx += e.offsetLeft; + posy += e.offsetTop; + } + } 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'; + } + +/* + if (e == null) + { + e = window.event; + } + + 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; + } + } +*/ +} diff --git a/sources/phpBB/app.php b/sources/phpBB/app.php new file mode 100644 index 0000000..d9250ad --- /dev/null +++ b/sources/phpBB/app.php @@ -0,0 +1,35 @@ + +* @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); +$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'); + +$http_kernel = $phpbb_container->get('http_kernel'); +$symfony_request = $phpbb_container->get('symfony_request'); +$response = $http_kernel->handle($symfony_request); +$response->send(); +$http_kernel->terminate($symfony_request, $response); diff --git a/sources/phpBB/assets/javascript/core.js b/sources/phpBB/assets/javascript/core.js new file mode 100644 index 0000000..6481a2e --- /dev/null +++ b/sources/phpBB/assets/javascript/core.js @@ -0,0 +1,1617 @@ +var phpbb = {}; +phpbb.alertTime = 100; + +(function($) { // Avoid conflicts with other libraries + +'use strict'; + +// define a couple constants for keydown functions. +var keymap = { + TAB: 9, + ENTER: 13, + ESC: 27 +}; + +var $dark = $('#darkenwrapper'); +var $loadingIndicator = $('#loading_indicator'); +var phpbbAlertTimer = null; + +phpbb.isTouch = (window && typeof window.ontouchstart !== 'undefined'); + +/** + * Display a loading screen + * + * @returns object Returns loadingIndicator. + */ +phpbb.loadingIndicator = function() { + if (!$loadingIndicator.is(':visible')) { + $loadingIndicator.fadeIn(phpbb.alertTime); + // Wait fifteen seconds and display an error if nothing has been returned by then. + phpbb.clearLoadingTimeout(); + phpbbAlertTimer = setTimeout(function() { + var $alert = $('#phpbb_alert'); + + if ($loadingIndicator.is(':visible')) { + phpbb.alert($alert.attr('data-l-err'), $alert.attr('data-l-timeout-processing-req')); + } + }, 15000); + } + + return $loadingIndicator; +}; + +/** + * Clear loading alert timeout +*/ +phpbb.clearLoadingTimeout = function() { + if (phpbbAlertTimer !== null) { + clearTimeout(phpbbAlertTimer); + phpbbAlertTimer = null; + } +}; + + +/** +* Close popup alert after a specified delay +* +* @param int Delay in ms until darkenwrapper's click event is triggered +*/ +phpbb.closeDarkenWrapper = function(delay) { + phpbbAlertTimer = setTimeout(function() { + $('#darkenwrapper').trigger('click'); + }, delay); +}; + +/** + * Display a simple alert similar to JSs native alert(). + * + * You can only call one alert or confirm box at any one time. + * + * @param string title Title of the message, eg "Information" (HTML). + * @param string msg Message to display (HTML). + * @param bool fadedark Remove the dark background when done? Defaults + * to yes. + * + * @returns object Returns the div created. + */ +phpbb.alert = function(title, msg, fadedark) { + var $alert = $('#phpbb_alert'); + $alert.find('.alert_title').html(title); + $alert.find('.alert_text').html(msg); + + $(document).on('keydown.phpbb.alert', function(e) { + if (e.keyCode === keymap.ENTER || e.keyCode === keymap.ESC) { + phpbb.alert.close($alert, true); + e.preventDefault(); + e.stopPropagation(); + } + }); + phpbb.alert.open($alert); + + return $alert; +}; + +/** +* Handler for opening an alert box. +* +* @param jQuery $alert jQuery object. +*/ +phpbb.alert.open = function($alert) { + if (!$dark.is(':visible')) { + $dark.fadeIn(phpbb.alertTime); + } + + if ($loadingIndicator.is(':visible')) { + $loadingIndicator.fadeOut(phpbb.alertTime, function() { + $dark.append($alert); + $alert.fadeIn(phpbb.alertTime); + }); + } else if ($dark.is(':visible')) { + $dark.append($alert); + $alert.fadeIn(phpbb.alertTime); + } else { + $dark.append($alert); + $alert.show(); + $dark.fadeIn(phpbb.alertTime); + } + + $alert.on('click', function(e) { + e.stopPropagation(); + }); + + $dark.one('click', function(e) { + phpbb.alert.close($alert, true); + e.preventDefault(); + e.stopPropagation(); + }); + + $alert.find('.alert_close').one('click', function(e) { + phpbb.alert.close($alert, true); + e.preventDefault(); + }); +}; + +/** +* Handler for closing an alert box. +* +* @param jQuery $alert jQuery object. +* @param bool fadedark Whether to remove dark background. +*/ +phpbb.alert.close = function($alert, fadedark) { + var $fade = (fadedark) ? $dark : $alert; + + $fade.fadeOut(phpbb.alertTime, function() { + $alert.hide(); + }); + + $alert.find('.alert_close').off('click'); + $(document).off('keydown.phpbb.alert'); +}; + +/** + * Display a simple yes / no box to the user. + * + * You can only call one alert or confirm box at any one time. + * + * @param string msg Message to display (HTML). + * @param function callback Callback. Bool param, whether the user pressed + * yes or no (or whatever their language is). + * @param bool fadedark Remove the dark background when done? Defaults + * to yes. + * + * @returns object Returns the div created. + */ +phpbb.confirm = function(msg, callback, fadedark) { + var $confirmDiv = $('#phpbb_confirm'); + $confirmDiv.find('.alert_text').html(msg); + fadedark = fadedark || true; + + $(document).on('keydown.phpbb.alert', function(e) { + if (e.keyCode === keymap.ENTER || e.keyCode === keymap.ESC) { + var name = (e.keyCode === keymap.ENTER) ? 'confirm' : 'cancel'; + + $('input[name="' + name + '"]').trigger('click'); + e.preventDefault(); + e.stopPropagation(); + } + }); + + $confirmDiv.find('input[type="button"]').one('click.phpbb.confirmbox', function(e) { + var confirmed = this.name === 'confirm'; + + if (confirmed) { + callback(true); + } + $confirmDiv.find('input[type="button"]').off('click.phpbb.confirmbox'); + phpbb.alert.close($confirmDiv, fadedark || !confirmed); + + e.preventDefault(); + e.stopPropagation(); + }); + + phpbb.alert.open($confirmDiv); + + return $confirmDiv; +}; + +/** + * Turn a querystring into an array. + * + * @argument string string The querystring to parse. + * @returns object The object created. + */ +phpbb.parseQuerystring = function(string) { + var params = {}, i, split; + + string = string.split('&'); + for (i = 0; i < string.length; i++) { + split = string[i].split('='); + params[split[0]] = decodeURIComponent(split[1]); + } + return params; +}; + + +/** + * Makes a link use AJAX instead of loading an entire page. + * + * This function will work for links (both standard links and links which + * invoke confirm_box) and forms. It will be called automatically for links + * and forms with the data-ajax attribute set, and will call the necessary + * callback. + * + * For more info, view the following page on the phpBB wiki: + * http://wiki.phpbb.com/JavaScript_Function.phpbb.ajaxify + * + * @param object options Options. + * @param bool/function refresh If we are sent back a refresh, should it be + * acted upon? This can either be true / false / a function. + * @param function callback Callback to call on completion of event. Has + * three parameters: the element that the event was evoked from, the JSON + * that was returned and (if it is a form) the form action. + */ +phpbb.ajaxify = function(options) { + var $elements = $(options.selector), + refresh = options.refresh, + callback = options.callback, + overlay = (typeof options.overlay !== 'undefined') ? options.overlay : true, + isForm = $elements.is('form'), + isText = $elements.is('input[type="text"], textarea'), + eventName; + + if (isForm) { + eventName = 'submit'; + } else if (isText) { + eventName = 'keyup'; + } else { + eventName = 'click'; + } + + $elements.on(eventName, function(event) { + var action, method, data, submit, that = this, $this = $(this); + + if ($this.find('input[type="submit"][data-clicked]').attr('data-ajax') === 'false') { + return; + } + + /** + * Handler for AJAX errors + */ + function errorHandler(jqXHR, textStatus, errorThrown) { + if (typeof console !== 'undefined' && console.log) { + console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown); + } + phpbb.clearLoadingTimeout(); + var errorText = false; + if (typeof errorThrown === 'string' && errorThrown.length > 0) { + errorText = errorThrown; + } + else { + errorText = $dark.attr('data-ajax-error-text-' + textStatus); + if (typeof errorText !== 'string' || !errorText.length) { + errorText = $dark.attr('data-ajax-error-text'); + } + } + phpbb.alert($dark.attr('data-ajax-error-title'), errorText); + } + + /** + * This is a private function used to handle the callbacks, refreshes + * and alert. It calls the callback, refreshes the page if necessary, and + * displays an alert to the user and removes it after an amount of time. + * + * It cannot be called from outside this function, and is purely here to + * avoid repetition of code. + * + * @param object res The object sent back by the server. + */ + function returnHandler(res) { + var alert; + + phpbb.clearLoadingTimeout(); + + // Is a confirmation required? + if (typeof res.S_CONFIRM_ACTION === 'undefined') { + // If a confirmation is not required, display an alert and call the + // callbacks. + if (typeof res.MESSAGE_TITLE !== 'undefined') { + alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT); + } else { + $dark.fadeOut(phpbb.alertTime); + } + + if (typeof phpbb.ajaxCallbacks[callback] === 'function') { + phpbb.ajaxCallbacks[callback].call(that, res); + } + + // If the server says to refresh the page, check whether the page should + // be refreshed and refresh page after specified time if required. + if (res.REFRESH_DATA) { + if (typeof refresh === 'function') { + refresh = refresh(res.REFRESH_DATA.url); + } else if (typeof refresh !== 'boolean') { + refresh = false; + } + + phpbbAlertTimer = setTimeout(function() { + if (refresh) { + window.location = res.REFRESH_DATA.url; + } + + // Hide the alert even if we refresh the page, in case the user + // presses the back button. + $dark.fadeOut(phpbb.alertTime, function() { + if (typeof alert !== 'undefined') { + alert.hide(); + } + }); + }, res.REFRESH_DATA.time * 1000); // Server specifies time in seconds + } + } else { + // If confirmation is required, display a dialog to the user. + phpbb.confirm(res.MESSAGE_BODY, function(del) { + if (!del) { + return; + } + + phpbb.loadingIndicator(); + data = $('
' + res.S_HIDDEN_FIELDS + '
').serialize(); + $.ajax({ + url: res.S_CONFIRM_ACTION, + type: 'POST', + data: data + '&confirm=' + res.YES_VALUE + '&' + $('form', '#phpbb_confirm').serialize(), + success: returnHandler, + error: errorHandler + }); + }, false); + } + } + + // If the element is a form, POST must be used and some extra data must + // be taken from the form. + var runFilter = (typeof options.filter === 'function'); + data = {}; + + if (isForm) { + action = $this.attr('action').replace('&', '&'); + data = $this.serializeArray(); + method = $this.attr('method') || 'GET'; + + if ($this.find('input[type="submit"][data-clicked]')) { + submit = $this.find('input[type="submit"][data-clicked]'); + data.push({ + name: submit.attr('name'), + value: submit.val() + }); + } + } else if (isText) { + var name = $this.attr('data-name') || this.name; + action = $this.attr('data-url').replace('&', '&'); + data[name] = this.value; + method = 'POST'; + } else { + action = this.href; + data = null; + method = 'GET'; + } + + var sendRequest = function() { + var dataOverlay = $this.attr('data-overlay'); + if (overlay && (typeof dataOverlay === 'undefined' || dataOverlay === 'true')) { + phpbb.loadingIndicator(); + } + + var request = $.ajax({ + url: action, + type: method, + data: data, + success: returnHandler, + error: errorHandler, + cache: false + }); + request.always(function() { + $loadingIndicator.fadeOut(phpbb.alertTime); + }); + }; + + // If filter function returns false, cancel the AJAX functionality, + // and return true (meaning that the HTTP request will be sent normally). + if (runFilter && !options.filter.call(this, data, event, sendRequest)) { + return; + } + + sendRequest(); + event.preventDefault(); + }); + + if (isForm) { + $elements.find('input:submit').click(function () { + var $this = $(this); + + $this.siblings('[data-clicked]').removeAttr('data-clicked'); + $this.attr('data-clicked', 'true'); + }); + } + + return this; +}; + +phpbb.search = { + cache: { + data: [] + }, + tpl: [], + container: [] +}; + +/** + * Get cached search data. + * + * @param string id Search ID. + * @return bool|object. Cached data object. Returns false if no data exists. + */ +phpbb.search.cache.get = function(id) { + if (this.data[id]) { + return this.data[id]; + } + return false; +}; + +/** + * Set search cache data value. + * + * @param string id Search ID. + * @param string key Data key. + * @param string value Data value. + * + * @return undefined + */ +phpbb.search.cache.set = function(id, key, value) { + if (!this.data[id]) { + this.data[id] = {results: []}; + } + this.data[id][key] = value; +}; + +/** + * Cache search result. + * + * @param string id Search ID. + * @param string keyword Keyword. + * @param array results Search results. + * + * @return undefined + */ +phpbb.search.cache.setResults = function(id, keyword, value) { + this.data[id].results[keyword] = value; +}; + +/** + * Trim spaces from keyword and lower its case. + * + * @param string keyword Search keyword to clean. + * @return string Cleaned string. + */ +phpbb.search.cleanKeyword = function(keyword) { + return $.trim(keyword).toLowerCase(); +}; + +/** + * Get clean version of search keyword. If textarea supports several keywords + * (one per line), it fetches the current keyword based on the caret position. + * + * @param jQuery $input Search input|textarea. + * @param string keyword Input|textarea value. + * @param bool multiline Whether textarea supports multiple search keywords. + * + * @return string Clean string. + */ +phpbb.search.getKeyword = function($input, keyword, multiline) { + if (multiline) { + var line = phpbb.search.getKeywordLine($input); + keyword = keyword.split('\n').splice(line, 1); + } + return phpbb.search.cleanKeyword(keyword); +}; + +/** + * Get the textarea line number on which the keyword resides - for textareas + * that support multiple keywords (one per line). + * + * @param jQuery $textarea Search textarea. + * @return int + */ +phpbb.search.getKeywordLine = function ($textarea) { + var selectionStart = $textarea.get(0).selectionStart; + return $textarea.val().substr(0, selectionStart).split('\n').length - 1; +}; + +/** + * Set the value on the input|textarea. If textarea supports multiple + * keywords, only the active keyword is replaced. + * + * @param jQuery $input Search input|textarea. + * @param string value Value to set. + * @param bool multiline Whether textarea supports multiple search keywords. + * + * @return undefined + */ +phpbb.search.setValue = function($input, value, multiline) { + if (multiline) { + var line = phpbb.search.getKeywordLine($input), + lines = $input.val().split('\n'); + lines[line] = value; + value = lines.join('\n'); + } + $input.val(value); +}; + +/** + * Sets the onclick event to set the value on the input|textarea to the selected search result. + * + * @param jQuery $input Search input|textarea. + * @param object value Result object. + * @param jQuery $row Result element. + * @param jQuery $container jQuery object for the search container. + * + * @return undefined + */ +phpbb.search.setValueOnClick = function($input, value, $row, $container) { + $row.click(function() { + phpbb.search.setValue($input, value.result, $input.attr('data-multiline')); + $container.hide(); + }); +}; + +/** + * Runs before the AJAX search request is sent and determines whether + * there is a need to contact the server. If there are cached results + * already, those are displayed instead. Executes the AJAX request function + * itself due to the need to use a timeout to limit the number of requests. + * + * @param array data Data to be sent to the server. + * @param object event Onkeyup event object. + * @param function sendRequest Function to execute AJAX request. + * + * @return bool Returns false. + */ +phpbb.search.filter = function(data, event, sendRequest) { + var $this = $(this), + dataName = ($this.attr('data-name') !== undefined) ? $this.attr('data-name') : $this.attr('name'), + minLength = parseInt($this.attr('data-min-length')), + searchID = $this.attr('data-results'), + keyword = phpbb.search.getKeyword($this, data[dataName], $this.attr('data-multiline')), + cache = phpbb.search.cache.get(searchID), + proceed = true; + data[dataName] = keyword; + + if (cache.timeout) { + clearTimeout(cache.timeout); + } + + var timeout = setTimeout(function() { + // Check min length and existence of cache. + if (minLength > keyword.length) { + proceed = false; + } else if (cache.lastSearch) { + // Has the keyword actually changed? + if (cache.lastSearch === keyword) { + proceed = false; + } else { + // Do we already have results for this? + if (cache.results[keyword]) { + var response = {keyword: keyword, results: cache.results[keyword]}; + phpbb.search.handleResponse(response, $this, true); + proceed = false; + } + + // If the previous search didn't yield results and the string only had characters added to it, + // then we won't bother sending a request. + if (keyword.indexOf(cache.lastSearch) === 0 && cache.results[cache.lastSearch].length === 0) { + phpbb.search.cache.set(searchID, 'lastSearch', keyword); + phpbb.search.cache.setResults(searchID, keyword, []); + proceed = false; + } + } + } + + if (proceed) { + sendRequest.call(this); + } + }, 350); + phpbb.search.cache.set(searchID, 'timeout', timeout); + + return false; +}; + +/** + * Handle search result response. + * + * @param object res Data received from server. + * @param jQuery $input Search input|textarea. + * @param bool fromCache Whether the results are from the cache. + * @param function callback Optional callback to run when assigning each search result. + * + * @return undefined + */ +phpbb.search.handleResponse = function(res, $input, fromCache, callback) { + if (typeof res !== 'object') { + return; + } + + var searchID = $input.attr('data-results'), + $container = $(searchID); + + if (this.cache.get(searchID).callback) { + callback = this.cache.get(searchID).callback; + } else if (typeof callback === 'function') { + this.cache.set(searchID, 'callback', callback); + } + + if (!fromCache) { + this.cache.setResults(searchID, res.keyword, res.results); + } + + this.cache.set(searchID, 'lastSearch', res.keyword); + this.showResults(res.results, $input, $container, callback); +}; + +/** + * Show search results. + * + * @param array results Search results. + * @param jQuery $input Search input|textarea. + * @param jQuery $container Search results container element. + * @param function callback Optional callback to run when assigning each search result. + * + * @return undefined + */ +phpbb.search.showResults = function(results, $input, $container, callback) { + var $resultContainer = $('.search-results', $container); + this.clearResults($resultContainer); + + if (!results.length) { + $container.hide(); + return; + } + + var searchID = $container.attr('id'), + tpl, + row; + + if (!this.tpl[searchID]) { + tpl = $('.search-result-tpl', $container); + this.tpl[searchID] = tpl.clone().removeClass('search-result-tpl'); + tpl.remove(); + } + tpl = this.tpl[searchID]; + + $.each(results, function(i, item) { + row = tpl.clone(); + row.find('.search-result').html(item.display); + + if (typeof callback === 'function') { + callback.call(this, $input, item, row, $container); + } + row.appendTo($resultContainer).show(); + }); + $container.show(); +}; + +/** + * Clear search results. + * + * @param jQuery $container Search results container. + * @return undefined + */ +phpbb.search.clearResults = function($container) { + $container.children(':not(.search-result-tpl)').remove(); +}; + +$('#phpbb').click(function() { + var $this = $(this); + + if (!$this.is('.live-search') && !$this.parents().is('.live-search')) { + $('.live-search').hide(); + } +}); + +phpbb.history = {}; + +/** +* Check whether a method in the native history object is supported. +* +* @param string fn Method name. +* @return bool Returns true if the method is supported. +*/ +phpbb.history.isSupported = function(fn) { + return !(typeof history === 'undefined' || typeof history[fn] === 'undefined'); +}; + +/** +* Wrapper for the pushState and replaceState methods of the +* native history object. +* +* @param string mode Mode. Either push or replace. +* @param string url New URL. +* @param string title Optional page title. +* @patam object obj Optional state object. +* +* @return undefined +*/ +phpbb.history.alterUrl = function(mode, url, title, obj) { + var fn = mode + 'State'; + + if (!url || !phpbb.history.isSupported(fn)) { + return; + } + if (!title) { + title = document.title; + } + if (!obj) { + obj = null; + } + + history[fn](obj, title, url); +}; + +/** +* Wrapper for the native history.replaceState method. +* +* @param string url New URL. +* @param string title Optional page title. +* @patam object obj Optional state object. +* +* @return undefined +*/ +phpbb.history.replaceUrl = function(url, title, obj) { + phpbb.history.alterUrl('replace', url, title, obj); +}; + +/** +* Wrapper for the native history.pushState method. +* +* @param string url New URL. +* @param string title Optional page title. +* @patam object obj Optional state object. +* +* @return undefined +*/ +phpbb.history.pushUrl = function(url, title, obj) { + phpbb.history.alterUrl('push', url, title, obj); +}; + +/** +* Hide the optgroups that are not the selected timezone +* +* @param bool keepSelection Shall we keep the value selected, or shall the user be forced to repick one. +*/ +phpbb.timezoneSwitchDate = function(keepSelection) { + var $timezoneCopy = $('#timezone_copy'); + var $timezone = $('#timezone'); + var $tzDate = $('#tz_date'); + var $tzSelectDateSuggest = $('#tz_select_date_suggest'); + + if ($timezoneCopy.length === 0) { + // We make a backup of the original dropdown, so we can remove optgroups + // instead of setting display to none, because IE and chrome will not + // hide options inside of optgroups and selects via css + $timezone.clone() + .attr('id', 'timezone_copy') + .css('display', 'none') + .attr('name', 'tz_copy') + .insertAfter('#timezone'); + } else { + // Copy the content of our backup, so we can remove all unneeded options + $timezone.html($timezoneCopy.html()); + } + + if ($tzDate.val() !== '') { + $timezone.children('optgroup').remove(':not([data-tz-value="' + $('#tz_date').val() + '"])'); + } + + if ($tzDate.val() === $tzSelectDateSuggest.attr('data-suggested-tz')) { + $tzSelectDateSuggest.css('display', 'none'); + } else { + $tzSelectDateSuggest.css('display', 'inline'); + } + + var $tzOptions = $timezone.children('optgroup[data-tz-value="' + $tzDate.val() + '"]').children('option'); + + if ($tzOptions.length === 1) { + // If there is only one timezone for the selected date, we just select that automatically. + $tzOptions.prop('selected', true); + keepSelection = true; + } + + if (typeof keepSelection !== 'undefined' && !keepSelection) { + var $timezoneOptions = $timezone.find('optgroup option'); + if ($timezoneOptions.filter(':selected').length <= 0) { + $timezoneOptions.filter(':first').prop('selected', true); + } + } +}; + +/** +* Display the date/time select +*/ +phpbb.timezoneEnableDateSelection = function() { + $('#tz_select_date').css('display', 'block'); +}; + +/** +* Preselect a date/time or suggest one, if it is not picked. +* +* @param bool forceSelector Shall we select the suggestion? +*/ +phpbb.timezonePreselectSelect = function(forceSelector) { + + // The offset returned here is in minutes and negated. + var offset = (new Date()).getTimezoneOffset(); + var sign = '-'; + + if (offset < 0) { + sign = '+'; + offset = -offset; + } + + var minutes = offset % 60; + var hours = (offset - minutes) / 60; + + if (hours < 10) { + hours = '0' + hours.toString(); + } else { + hours = hours.toString(); + } + + if (minutes < 10) { + minutes = '0' + minutes.toString(); + } else { + minutes = minutes.toString(); + } + + var prefix = 'UTC' + sign + hours + ':' + minutes; + var prefixLength = prefix.length; + var selectorOptions = $('option', '#tz_date'); + var i; + + var $tzSelectDateSuggest = $('#tz_select_date_suggest'); + + for (i = 0; i < selectorOptions.length; ++i) { + var option = selectorOptions[i]; + + if (option.value.substring(0, prefixLength) === prefix) { + if ($('#tz_date').val() !== option.value && !forceSelector) { + // We do not select the option for the user, but notify him, + // that we would suggest a different setting. + phpbb.timezoneSwitchDate(true); + $tzSelectDateSuggest.css('display', 'inline'); + } else { + option.selected = true; + phpbb.timezoneSwitchDate(!forceSelector); + $tzSelectDateSuggest.css('display', 'none'); + } + + var suggestion = $tzSelectDateSuggest.attr('data-l-suggestion'); + + $tzSelectDateSuggest.attr('title', suggestion.replace('%s', option.innerHTML)); + $tzSelectDateSuggest.attr('value', suggestion.replace('%s', option.innerHTML.substring(0, 9))); + $tzSelectDateSuggest.attr('data-suggested-tz', option.innerHTML); + + // Found the suggestion, there cannot be more, so return from here. + return; + } + } +}; + +phpbb.ajaxCallbacks = {}; + +/** + * Adds an AJAX callback to be used by phpbb.ajaxify. + * + * See the phpbb.ajaxify comments for information on stuff like parameters. + * + * @param string id The name of the callback. + * @param function callback The callback to be called. + */ +phpbb.addAjaxCallback = function(id, callback) { + if (typeof callback === 'function') { + phpbb.ajaxCallbacks[id] = callback; + } + return this; +}; + +/** + * This callback handles live member searches. + */ +phpbb.addAjaxCallback('member_search', function(res) { + phpbb.search.handleResponse(res, $(this), false, phpbb.getFunctionByName('phpbb.search.setValueOnClick')); +}); + +/** + * This callback alternates text - it replaces the current text with the text in + * the alt-text data attribute, and replaces the text in the attribute with the + * current text so that the process can be repeated. + */ +phpbb.addAjaxCallback('alt_text', function() { + var $anchor, + updateAll = $(this).data('update-all'), + altText; + + if (updateAll !== undefined && updateAll.length) { + $anchor = $(updateAll); + } else { + $anchor = $(this); + } + + $anchor.each(function() { + var $this = $(this); + altText = $this.attr('data-alt-text'); + $this.attr('data-alt-text', $this.text()); + $this.attr('title', $.trim(altText)); + $this.text(altText); + }); +}); + +/** + * This callback is based on the alt_text callback. + * + * It replaces the current text with the text in the alt-text data attribute, + * and replaces the text in the attribute with the current text so that the + * process can be repeated. + * Additionally it replaces the class of the link's parent + * and changes the link itself. + */ +phpbb.addAjaxCallback('toggle_link', function() { + var $anchor, + updateAll = $(this).data('update-all') , + toggleText, + toggleUrl, + toggleClass; + + if (updateAll !== undefined && updateAll.length) { + $anchor = $(updateAll); + } else { + $anchor = $(this); + } + + $anchor.each(function() { + var $this = $(this); + + // Toggle link text + toggleText = $this.attr('data-toggle-text'); + $this.attr('data-toggle-text', $this.text()); + $this.attr('title', $.trim(toggleText)); + $this.text(toggleText); + + // Toggle link url + toggleUrl = $this.attr('data-toggle-url'); + $this.attr('data-toggle-url', $this.attr('href')); + $this.attr('href', toggleUrl); + + // Toggle class of link parent + toggleClass = $this.attr('data-toggle-class'); + $this.attr('data-toggle-class', $this.parent().attr('class')); + $this.parent().attr('class', toggleClass); + }); +}); + +/** +* Automatically resize textarea +* +* This function automatically resizes textarea elements when user +* types text. +* +* @param {jQuery} $items jQuery object(s) to resize +* @param {object} options Optional parameter that adjusts default +* configuration. See configuration variable +* +* Optional parameters: +* minWindowHeight {number} Minimum browser window height when textareas are resized. Default = 500 +* minHeight {number} Minimum height of textarea. Default = 200 +* maxHeight {number} Maximum height of textarea. Default = 500 +* heightDiff {number} Minimum difference between window and textarea height. Default = 200 +* resizeCallback {function} Function to call after resizing textarea +* resetCallback {function} Function to call when resize has been canceled + +* Callback function format: function(item) {} +* this points to DOM object +* item is a jQuery object, same as this +*/ +phpbb.resizeTextArea = function($items, options) { + // Configuration + var configuration = { + minWindowHeight: 500, + minHeight: 200, + maxHeight: 500, + heightDiff: 200, + resizeCallback: function() {}, + resetCallback: function() {} + }; + + if (phpbb.isTouch) { + return; + } + + if (arguments.length > 1) { + configuration = $.extend(configuration, options); + } + + function resetAutoResize(item) { + var $item = $(item); + if ($item.hasClass('auto-resized')) { + $(item).css({height: '', resize: ''}).removeClass('auto-resized'); + configuration.resetCallback.call(item, $item); + } + } + + function autoResize(item) { + function setHeight(height) { + height += parseInt($item.css('height')) - $item.height(); + $item.css({height: height + 'px', resize: 'none'}).addClass('auto-resized'); + configuration.resizeCallback.call(item, $item); + } + + var windowHeight = $(window).height(); + + if (windowHeight < configuration.minWindowHeight) { + resetAutoResize(item); + return; + } + + var maxHeight = Math.min( + Math.max(windowHeight - configuration.heightDiff, configuration.minHeight), + configuration.maxHeight + ), + $item = $(item), + height = parseInt($item.height()), + scrollHeight = (item.scrollHeight) ? item.scrollHeight : 0; + + if (height < 0) { + return; + } + + if (height > maxHeight) { + setHeight(maxHeight); + } + else if (scrollHeight > (height + 5)) { + setHeight(Math.min(maxHeight, scrollHeight)); + } + } + + $items.on('focus change keyup', function() { + $(this).each(function() { + autoResize(this); + }); + }).change(); + + $(window).resize(function() { + $items.each(function() { + if ($(this).hasClass('auto-resized')) { + autoResize(this); + } + }); + }); +}; + +/** +* Check if cursor in textarea is currently inside a bbcode tag +* +* @param {object} textarea Textarea DOM object +* @param {Array} startTags List of start tags to look for +* For example, Array('[code]', '[code=') +* @param {Array} endTags List of end tags to look for +* For example, Array('[/code]') +* +* @return {boolean} True if cursor is in bbcode tag +*/ +phpbb.inBBCodeTag = function(textarea, startTags, endTags) { + var start = textarea.selectionStart, + lastEnd = -1, + lastStart = -1, + i, index, value; + + if (typeof start !== 'number') { + return false; + } + + value = textarea.value.toLowerCase(); + + for (i = 0; i < startTags.length; i++) { + var tagLength = startTags[i].length; + if (start >= tagLength) { + index = value.lastIndexOf(startTags[i], start - tagLength); + lastStart = Math.max(lastStart, index); + } + } + if (lastStart === -1) { + return false; + } + + if (start > 0) { + for (i = 0; i < endTags.length; i++) { + index = value.lastIndexOf(endTags[i], start - 1); + lastEnd = Math.max(lastEnd, index); + } + } + + return (lastEnd < lastStart); +}; + + +/** +* Adjust textarea to manage code bbcode +* +* This function allows to use tab characters when typing code +* and keeps indentation of previous line of code when adding new +* line while typing code. +* +* Editor's functionality is changed only when cursor is between +* [code] and [/code] bbcode tags. +* +* @param {object} textarea Textarea DOM object to apply editor to +*/ +phpbb.applyCodeEditor = function(textarea) { + // list of allowed start and end bbcode code tags, in lower case + var startTags = ['[code]', '[code='], + startTagsEnd = ']', + endTags = ['[/code]']; + + if (!textarea || typeof textarea.selectionStart !== 'number') { + return; + } + + if ($(textarea).data('code-editor') === true) { + return; + } + + function inTag() { + return phpbb.inBBCodeTag(textarea, startTags, endTags); + } + + /** + * Get line of text before cursor + * + * @param {boolean} stripCodeStart If true, only part of line + * after [code] tag will be returned. + * + * @return {string} Line of text + */ + function getLastLine(stripCodeStart) { + var start = textarea.selectionStart, + value = textarea.value, + index = value.lastIndexOf('\n', start - 1); + + value = value.substring(index + 1, start); + + if (stripCodeStart) { + for (var i = 0; i < startTags.length; i++) { + index = value.lastIndexOf(startTags[i]); + if (index >= 0) { + var tagLength = startTags[i].length; + + value = value.substring(index + tagLength); + if (startTags[i].lastIndexOf(startTagsEnd) != tagLength) { + index = value.indexOf(startTagsEnd); + + if (index >= 0) { + value = value.substr(index + 1); + } + } + } + } + } + + return value; + } + + /** + * Append text at cursor position + * + * @param {string} Text Text to append + */ + function appendText(text) { + var start = textarea.selectionStart, + end = textarea.selectionEnd, + value = textarea.value; + + textarea.value = value.substr(0, start) + text + value.substr(end); + textarea.selectionStart = textarea.selectionEnd = start + text.length; + } + + $(textarea).data('code-editor', true).on('keydown', function(event) { + var key = event.keyCode || event.which; + + // intercept tabs + if (key === keymap.TAB && + !event.ctrlKey && + !event.shiftKey && + !event.altKey && + !event.metaKey) { + if (inTag()) { + appendText('\t'); + event.preventDefault(); + return; + } + } + + // intercept new line characters + if (key === keymap.ENTER) { + if (inTag()) { + var lastLine = getLastLine(true), + code = '' + /^\s*/g.exec(lastLine); + + if (code.length > 0) { + appendText('\n' + code); + event.preventDefault(); + } + } + } + }); +}; + +/** +* List of classes that toggle dropdown menu, +* list of classes that contain visible dropdown menu +* +* Add your own classes to strings with comma (probably you +* will never need to do that) +*/ +phpbb.dropdownHandles = '.dropdown-container.dropdown-visible .dropdown-toggle'; +phpbb.dropdownVisibleContainers = '.dropdown-container.dropdown-visible'; + +/** +* Dropdown toggle event handler +* This handler is used by phpBB.registerDropdown() and other functions +*/ +phpbb.toggleDropdown = function() { + var $this = $(this), + options = $this.data('dropdown-options'), + parent = options.parent, + visible = parent.hasClass('dropdown-visible'), + direction; + + if (!visible) { + // Hide other dropdown menus + $(phpbb.dropdownHandles).each(phpbb.toggleDropdown); + + // Figure out direction of dropdown + direction = options.direction; + var verticalDirection = options.verticalDirection, + offset = $this.offset(); + + if (direction === 'auto') { + if (($(window).width() - $this.outerWidth(true)) / 2 > offset.left) { + direction = 'right'; + } else { + direction = 'left'; + } + } + parent.toggleClass(options.leftClass, direction === 'left') + .toggleClass(options.rightClass, direction === 'right'); + + if (verticalDirection === 'auto') { + var height = $(window).height(), + top = offset.top - $(window).scrollTop(); + + verticalDirection = (top < height * 0.7) ? 'down' : 'up'; + } + parent.toggleClass(options.upClass, verticalDirection === 'up') + .toggleClass(options.downClass, verticalDirection === 'down'); + } + + options.dropdown.toggle(); + parent.toggleClass(options.visibleClass, !visible) + .toggleClass('dropdown-visible', !visible); + + // Check dimensions when showing dropdown + // !visible because variable shows state of dropdown before it was toggled + if (!visible) { + var windowWidth = $(window).width(); + + options.dropdown.find('.dropdown-contents').each(function() { + var $this = $(this); + + $this.css({ + marginLeft: 0, + left: 0, + maxWidth: (windowWidth - 4) + 'px' + }); + + var offset = $this.offset().left, + width = $this.outerWidth(true); + + if (offset < 2) { + $this.css('left', (2 - offset) + 'px'); + } else if ((offset + width + 2) > windowWidth) { + $this.css('margin-left', (windowWidth - offset - width - 2) + 'px'); + } + + // Check whether the vertical scrollbar is present. + $this.toggleClass('dropdown-nonscroll', this.scrollHeight === $this.innerHeight()); + + }); + var freeSpace = parent.offset().left - 4; + + if (direction === 'left') { + options.dropdown.css('margin-left', '-' + freeSpace + 'px'); + + // Try to position the notification dropdown correctly in RTL-responsive mode + if (options.dropdown.hasClass('dropdown-extended')) { + var contentWidth, + fullFreeSpace = freeSpace + parent.outerWidth(); + + options.dropdown.find('.dropdown-contents').each(function() { + contentWidth = parseInt($(this).outerWidth()); + $(this).css({marginLeft: 0, left: 0}); + }); + + var maxOffset = Math.min(contentWidth, fullFreeSpace) + 'px'; + options.dropdown.css({'width': maxOffset, 'margin-left': '-' + maxOffset}); + } + } else { + options.dropdown.css('margin-right', '-' + (windowWidth + freeSpace) + 'px'); + } + } + + // Prevent event propagation + if (arguments.length > 0) { + try { + var e = arguments[0]; + e.preventDefault(); + e.stopPropagation(); + } catch (error) { } + } + return false; +}; + +/** +* Toggle dropdown submenu +*/ +phpbb.toggleSubmenu = function(e) { + $(this).siblings('.dropdown-submenu').toggle(); + e.preventDefault(); +}; + +/** +* Register dropdown menu +* Shows/hides dropdown, decides which side to open to +* +* @param {jQuery} toggle Link that toggles dropdown. +* @param {jQuery} dropdown Dropdown menu. +* @param {Object} options List of options. Optional. +*/ +phpbb.registerDropdown = function(toggle, dropdown, options) { + var ops = { + parent: toggle.parent(), // Parent item to add classes to + direction: 'auto', // Direction of dropdown menu. Possible values: auto, left, right + verticalDirection: 'auto', // Vertical direction. Possible values: auto, up, down + visibleClass: 'visible', // Class to add to parent item when dropdown is visible + leftClass: 'dropdown-left', // Class to add to parent item when dropdown opens to left side + rightClass: 'dropdown-right', // Class to add to parent item when dropdown opens to right side + upClass: 'dropdown-up', // Class to add to parent item when dropdown opens above menu item + downClass: 'dropdown-down' // Class to add to parent item when dropdown opens below menu item + }; + if (options) { + ops = $.extend(ops, options); + } + ops.dropdown = dropdown; + + ops.parent.addClass('dropdown-container'); + toggle.addClass('dropdown-toggle'); + + toggle.data('dropdown-options', ops); + + toggle.click(phpbb.toggleDropdown); + $('.dropdown-toggle-submenu', ops.parent).click(phpbb.toggleSubmenu); +}; + +/** +* Get the HTML for a color palette table. +* +* @param string dir Palette direction - either v or h +* @param int width Palette cell width. +* @param int height Palette cell height. +*/ +phpbb.colorPalette = function(dir, width, height) { + var r = 0, + g = 0, + b = 0, + numberList = new Array(6), + color = '', + html = ''; + + numberList[0] = '00'; + numberList[1] = '40'; + numberList[2] = '80'; + numberList[3] = 'BF'; + numberList[4] = 'FF'; + + var tableClass = (dir == 'h') ? 'horizontal-palette' : 'vertical-palette'; + html += ''; + + for (r = 0; r < 5; r++) { + if (dir == 'h') { + html += ''; + } + + for (g = 0; g < 5; g++) { + if (dir == 'v') { + html += ''; + } + + for (b = 0; b < 5; b++) { + color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]); + html += ''; + } + + if (dir == 'v') { + html += ''; + } + } + + if (dir == 'h') { + html += ''; + } + } + html += '
'; + html += ''; + html += '
'; + return html; +}; + +/** +* Register a color palette. +* +* @param object el jQuery object for the palette container. +*/ +phpbb.registerPalette = function(el) { + var orientation = el.attr('data-orientation'), + height = el.attr('data-height'), + width = el.attr('data-width'), + target = el.attr('data-target'), + bbcode = el.attr('data-bbcode'); + + // Insert the palette HTML into the container. + el.html(phpbb.colorPalette(orientation, width, height)); + + // Add toggle control. + $('#color_palette_toggle').click(function(e) { + el.toggle(); + e.preventDefault(); + }); + + // Attach event handler when a palette cell is clicked. + $(el).on('click', 'a', function(e) { + var color = $(this).attr('data-color'); + + if (bbcode) { + bbfontstyle('[color=#' + color + ']', '[/color]'); + } else { + $(target).val(color); + } + e.preventDefault(); + }); +} + +/** +* Set display of page element +* +* @param string id The ID of the element to change +* @param int action Set to 0 if element display should be toggled, -1 for +* hiding the element, and 1 for showing it. +* @param string type Display type that should be used, e.g. inline, block or +* other CSS "display" types +*/ +phpbb.toggleDisplay = function(id, action, type) { + if (!type) { + type = 'block'; + } + + var $element = $('#' + id); + + var display = $element.css('display'); + if (!action) { + action = (display === '' || display === type) ? -1 : 1; + } + $element.css('display', ((action === 1) ? type : 'none')); +}; + +/** +* Toggle additional settings based on the selected +* option of select element. +* +* @param jQuery el jQuery select element object. +* @return undefined +*/ +phpbb.toggleSelectSettings = function(el) { + el.children().each(function() { + var $this = $(this), + $setting = $($this.data('toggle-setting')); + $setting.toggle($this.is(':selected')); + }); +}; + +/** +* Get function from name. +* Based on http://stackoverflow.com/a/359910 +* +* @param string functionName Function to get. +* @return function +*/ +phpbb.getFunctionByName = function (functionName) { + var namespaces = functionName.split('.'), + func = namespaces.pop(), + context = window; + + for (var i = 0; i < namespaces.length; i++) { + context = context[namespaces[i]]; + } + return context[func]; +}; + +/** +* Register page dropdowns. +*/ +phpbb.registerPageDropdowns = function() { + var $body = $('body'); + + $body.find('.dropdown-container').each(function() { + var $this = $(this), + $trigger = $this.find('.dropdown-trigger:first'), + $contents = $this.find('.dropdown'), + options = { + direction: 'auto', + verticalDirection: 'auto' + }, + data; + + if (!$trigger.length) { + data = $this.attr('data-dropdown-trigger'); + $trigger = data ? $this.children(data) : $this.children('a:first'); + } + + if (!$contents.length) { + data = $this.attr('data-dropdown-contents'); + $contents = data ? $this.children(data) : $this.children('div:first'); + } + + if (!$trigger.length || !$contents.length) { + return; + } + + if ($this.hasClass('dropdown-up')) { + options.verticalDirection = 'up'; + } + if ($this.hasClass('dropdown-down')) { + options.verticalDirection = 'down'; + } + if ($this.hasClass('dropdown-left')) { + options.direction = 'left'; + } + if ($this.hasClass('dropdown-right')) { + options.direction = 'right'; + } + + phpbb.registerDropdown($trigger, $contents, options); + }); + + // Hide active dropdowns when click event happens outside + $body.click(function(e) { + var $parents = $(e.target).parents(); + if (!$parents.is(phpbb.dropdownVisibleContainers)) { + $(phpbb.dropdownHandles).each(phpbb.toggleDropdown); + } + }); +}; + +/** +* Apply code editor to all textarea elements with data-bbcode attribute +*/ +$(function() { + $('textarea[data-bbcode]').each(function() { + phpbb.applyCodeEditor(this); + }); + + phpbb.registerPageDropdowns(); + + $('#color_palette_placeholder').each(function() { + phpbb.registerPalette($(this)); + }); + + // Update browser history URL to point to specific post in viewtopic.php + // when using view=unread#unread link. + phpbb.history.replaceUrl($('#unread[data-url]').data('url')); + + // Hide settings that are not selected via select element. + $('select[data-togglable-settings]').each(function() { + var $this = $(this); + + $this.change(function() { + phpbb.toggleSelectSettings($this); + }); + phpbb.toggleSelectSettings($this); + }); +}); + +})(jQuery); // Avoid conflicts with other libraries diff --git a/sources/phpBB/assets/javascript/editor.js b/sources/phpBB/assets/javascript/editor.js new file mode 100644 index 0000000..5fd4f7e --- /dev/null +++ b/sources/phpBB/assets/javascript/editor.js @@ -0,0 +1,360 @@ +/** +* bbCode control by subBlue design [ www.subBlue.com ] +* Includes unixsafe colour palette selector by SHS` +*/ + +// Startup variables +var imageTag = false; +var theSelection = false; +var bbcodeEnabled = true; + +// Check for Browser & Platform for PC & IE specific bits +// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html +var clientPC = navigator.userAgent.toLowerCase(); // Get client info +var clientVer = parseInt(navigator.appVersion, 10); // Get browser version + +var is_ie = ((clientPC.indexOf('msie') !== -1) && (clientPC.indexOf('opera') === -1)); +var is_win = ((clientPC.indexOf('win') !== -1) || (clientPC.indexOf('16bit') !== -1)); +var baseHeight; + +/** +* Shows the help messages in the helpline window +*/ +function helpline(help) { + document.forms[form_name].helpbox.value = help_line[help]; +} + +/** +* Fix a bug involving the TextRange object. From +* http://www.frostjedi.com/terra/scripts/demo/caretBug.html +*/ +function initInsertions() { + var doc; + + if (document.forms[form_name]) { + doc = document; + } else { + doc = opener.document; + } + + var textarea = doc.forms[form_name].elements[text_name]; + + if (is_ie && typeof(baseHeight) !== 'number') { + textarea.focus(); + baseHeight = doc.selection.createRange().duplicate().boundingHeight; + + if (!document.forms[form_name]) { + document.body.focus(); + } + } +} + +/** +* bbstyle +*/ +function bbstyle(bbnumber) { + if (bbnumber !== -1) { + bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1]); + } else { + insert_text('[*]'); + document.forms[form_name].elements[text_name].focus(); + } +} + +/** +* Apply bbcodes +*/ +function bbfontstyle(bbopen, bbclose) { + theSelection = false; + + var textarea = document.forms[form_name].elements[text_name]; + + textarea.focus(); + + if ((clientVer >= 4) && is_ie && is_win) { + // Get text selection + theSelection = document.selection.createRange().text; + + if (theSelection) { + // Add tags around selection + document.selection.createRange().text = bbopen + theSelection + bbclose; + textarea.focus(); + theSelection = ''; + return; + } + } else if (textarea.selectionEnd && (textarea.selectionEnd - textarea.selectionStart > 0)) { + mozWrap(textarea, bbopen, bbclose); + textarea.focus(); + theSelection = ''; + return; + } + + //The new position for the cursor after adding the bbcode + var caret_pos = getCaretPosition(textarea).start; + var new_pos = caret_pos + bbopen.length; + + // Open tag + insert_text(bbopen + bbclose); + + // Center the cursor when we don't have a selection + // Gecko and proper browsers + if (!isNaN(textarea.selectionStart)) { + textarea.selectionStart = new_pos; + textarea.selectionEnd = new_pos; + } + // IE + else if (document.selection) { + var range = textarea.createTextRange(); + range.move("character", new_pos); + range.select(); + storeCaret(textarea); + } + + textarea.focus(); + return; +} + +/** +* Insert text at position +*/ +function insert_text(text, spaces, popup) { + var textarea; + + if (!popup) { + textarea = document.forms[form_name].elements[text_name]; + } else { + textarea = opener.document.forms[form_name].elements[text_name]; + } + + if (spaces) { + text = ' ' + text + ' '; + } + + // Since IE9, IE also has textarea.selectionStart, but it still needs to be treated the old way. + // Therefore we simply add a !is_ie here until IE fixes the text-selection completely. + if (!isNaN(textarea.selectionStart) && !is_ie) { + var sel_start = textarea.selectionStart; + var sel_end = textarea.selectionEnd; + + mozWrap(textarea, text, ''); + textarea.selectionStart = sel_start + text.length; + textarea.selectionEnd = sel_end + text.length; + } else if (textarea.createTextRange && textarea.caretPos) { + if (baseHeight !== textarea.caretPos.boundingHeight) { + textarea.focus(); + storeCaret(textarea); + } + + var caret_pos = textarea.caretPos; + caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) === ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text; + } else { + textarea.value = textarea.value + text; + } + + if (!popup) { + textarea.focus(); + } +} + +/** +* Add inline attachment at position +*/ +function attach_inline(index, filename) { + insert_text('[attachment=' + index + ']' + filename + '[/attachment]'); + document.forms[form_name].elements[text_name].focus(); +} + +/** +* Add quote text to message +*/ +function addquote(post_id, username, l_wrote) { + var message_name = 'message_' + post_id; + var theSelection = ''; + var divarea = false; + var i; + + if (l_wrote === undefined) { + // Backwards compatibility + l_wrote = 'wrote'; + } + + if (document.all) { + divarea = document.all[message_name]; + } else { + divarea = document.getElementById(message_name); + } + + // Get text selection - not only the post content :( + // IE9 must use the document.selection method but has the *.getSelection so we just force no IE + if (window.getSelection && !is_ie && !window.opera) { + theSelection = window.getSelection().toString(); + } else if (document.getSelection && !is_ie) { + theSelection = document.getSelection(); + } else if (document.selection) { + theSelection = document.selection.createRange().text; + } + + if (theSelection === '' || typeof theSelection === 'undefined' || theSelection === null) { + if (divarea.innerHTML) { + theSelection = divarea.innerHTML.replace(/
/ig, '\n'); + theSelection = theSelection.replace(//ig, '\n'); + theSelection = theSelection.replace(/<\;/ig, '<'); + theSelection = theSelection.replace(/>\;/ig, '>'); + theSelection = theSelection.replace(/&\;/ig, '&'); + theSelection = theSelection.replace(/ \;/ig, ' '); + } else if (document.all) { + theSelection = divarea.innerText; + } else if (divarea.textContent) { + theSelection = divarea.textContent; + } else if (divarea.firstChild.nodeValue) { + theSelection = divarea.firstChild.nodeValue; + } + } + + if (theSelection) { + if (bbcodeEnabled) { + insert_text('[quote="' + username + '"]' + theSelection + '[/quote]'); + } else { + insert_text(username + ' ' + l_wrote + ':' + '\n'); + var lines = split_lines(theSelection); + for (i = 0; i < lines.length; i++) { + insert_text('> ' + lines[i] + '\n'); + } + } + } + + return; +} + +function split_lines(text) { + var lines = text.split('\n'); + var splitLines = new Array(); + var j = 0; + var i; + + for(i = 0; i < lines.length; i++) { + if (lines[i].length <= 80) { + splitLines[j] = lines[i]; + j++; + } else { + var line = lines[i]; + var splitAt; + do { + splitAt = line.indexOf(' ', 80); + + if (splitAt === -1) { + splitLines[j] = line; + j++; + } else { + splitLines[j] = line.substring(0, splitAt); + line = line.substring(splitAt); + j++; + } + } + while(splitAt !== -1); + } + } + return splitLines; +} + +/** +* From http://www.massless.org/mozedit/ +*/ +function mozWrap(txtarea, open, close) { + var selLength = (typeof(txtarea.textLength) === 'undefined') ? txtarea.value.length : txtarea.textLength; + var selStart = txtarea.selectionStart; + var selEnd = txtarea.selectionEnd; + var scrollTop = txtarea.scrollTop; + + var s1 = (txtarea.value).substring(0,selStart); + var s2 = (txtarea.value).substring(selStart, selEnd); + var s3 = (txtarea.value).substring(selEnd, selLength); + + txtarea.value = s1 + open + s2 + close + s3; + txtarea.selectionStart = selStart + open.length; + txtarea.selectionEnd = selEnd + open.length; + txtarea.focus(); + txtarea.scrollTop = scrollTop; + + return; +} + +/** +* Insert at Caret position. Code from +* http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130 +*/ +function storeCaret(textEl) { + if (textEl.createTextRange && document.selection) { + textEl.caretPos = document.selection.createRange().duplicate(); + } +} + +/** +* Caret Position object +*/ +function caretPosition() { + var start = null; + var end = null; +} + +/** +* Get the caret position in an textarea +*/ +function getCaretPosition(txtarea) { + var caretPos = new caretPosition(); + + // simple Gecko/Opera way + if (txtarea.selectionStart || txtarea.selectionStart === 0) { + caretPos.start = txtarea.selectionStart; + caretPos.end = txtarea.selectionEnd; + } + // dirty and slow IE way + else if (document.selection) { + // get current selection + var range = document.selection.createRange(); + + // a new selection of the whole textarea + var range_all = document.body.createTextRange(); + range_all.moveToElementText(txtarea); + + // calculate selection start point by moving beginning of range_all to beginning of range + var sel_start; + for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++) { + range_all.moveStart('character', 1); + } + + txtarea.sel_start = sel_start; + + // we ignore the end value for IE, this is already dirty enough and we don't need it + caretPos.start = txtarea.sel_start; + caretPos.end = txtarea.sel_start; + } + + return caretPos; +} + +/** +* Allow to use tab character when typing code +* Keep indentation of last line of code when typing code +*/ +(function($) { + $(document).ready(function() { + var doc, textarea; + + // find textarea, make sure browser supports necessary functions + if (document.forms[form_name]) { + doc = document; + } else { + doc = opener.document; + } + + if (!doc.forms[form_name]) { + return; + } + + textarea = doc.forms[form_name].elements[text_name]; + + phpbb.applyCodeEditor(textarea); + }); +})(jQuery); + diff --git a/sources/phpBB/assets/javascript/jquery.min.js b/sources/phpBB/assets/javascript/jquery.min.js new file mode 100644 index 0000000..73f33fb --- /dev/null +++ b/sources/phpBB/assets/javascript/jquery.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f +}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML="
a",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/\s*$/g,sb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:l.htmlSerialize?[0,"",""]:[1,"X
","
"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?""!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("',l=r.firstChild,n.appendChild(l),o.addEvent(l,"load",function(){var n;try{n=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(n.title)?u=n.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(n.body.innerHTML),p.trigger({type:"progress",loaded:c.length,total:c.length}),w&&p.trigger({type:"uploadprogress",loaded:w.size||1025,total:w.size||1025}))}catch(r){if(!i.hasSameOrigin(d.url))return void e.call(p,function(){p.trigger("error")});u=404}e.call(p,function(){p.trigger("load")})},p.uid)}var p=this,m=p.getRuntime(),g,v,y,w;if(u=c=null,f instanceof s&&f.hasBlob()){if(w=f.getBlob(),g=w.uid,y=n.get(g),v=n.get(g+"_form"),!v)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else g=t.guid("uid_"),v=document.createElement("form"),v.setAttribute("id",g+"_form"),v.setAttribute("method",d.method),v.setAttribute("enctype","multipart/form-data"),v.setAttribute("encoding","multipart/form-data"),v.setAttribute("target",g+"_iframe"),m.getShimContainer().appendChild(v);f instanceof s&&f.each(function(e,n){if(e instanceof a)y&&y.setAttribute("name",n);else{var i=document.createElement("input");t.extend(i,{type:"hidden",name:n,value:e}),y?v.insertBefore(i,y):v.appendChild(i)}}),v.setAttribute("action",d.url),h(),v.submit(),p.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(n){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})}})}return e.XMLHttpRequest=u}),i(ft,[ut,X],function(e,t){return e.Image=t}),a([u,c,l,d,f,h,p,m,g,v,y,w,E,_,x,b,R,T,A,S,O,I,L])}(this);;(function(e){"use strict";var t={},n=e.moxie.core.utils.Basic.inArray;return function r(e){var i,s;for(i in e)s=typeof e[i],s==="object"&&!~n(i,["Exceptions","Env","Mime"])?r(e[i]):s==="function"&&(t[i]=e[i])}(e.moxie),t.Env=e.moxie.core.utils.Env,t.Mime=e.moxie.core.utils.Mime,t.Exceptions=e.moxie.core.Exceptions,e.mOxie=t,e.o||(e.o=t),t})(this); +/** + * Plupload - multi-runtime File Uploader + * v2.1.2 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2014-05-14 + */ +;(function(e,t,n){function s(e){function r(e,t,r){var i={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};i[e]?n[i[e]]=t:r||(n[e]=t)}var t=e.required_features,n={};if(typeof t=="string")o.each(t.split(/\s*,\s*/),function(e){r(e,!0)});else if(typeof t=="object")o.each(t,function(e,t){r(t,e)});else if(t===!0){e.chunk_size>0&&(n.slice_blob=!0);if(e.resize.enabled||!e.multipart)n.send_binary_string=!0;o.each(e,function(e,t){r(t,!!e,!0)})}return n}var r=e.setTimeout,i={},o={VERSION:"2.1.2",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:t.mimes,ua:t.ua,typeOf:t.typeOf,extend:t.extend,guid:t.guid,get:function(n){var r=[],i;t.typeOf(n)!=="array"&&(n=[n]);var s=n.length;while(s--)i=t.get(n[s]),i&&r.push(i);return r.length?r:null},each:t.each,getPos:t.getPos,getSize:t.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},n=/[<>&\"\']/g;return e?(""+e).replace(n,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:t.toArray,inArray:t.inArray,addI18n:t.addI18n,translate:t.translate,isEmptyObj:t.isEmptyObj,hasClass:t.hasClass,addClass:t.addClass,removeClass:t.removeClass,getStyle:t.getStyle,addEvent:t.addEvent,removeEvent:t.removeEvent,removeAllEvents:t.removeAllEvents,cleanName:function(e){var t,n;n=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(t=0;t0?"&":"?")+n),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===n||/\D/.test(e))return o.translate("N/A");var r=Math.pow(1024,4);return e>r?t(e/r,1)+" "+o.translate("tb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("gb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("mb"):e>1024?Math.round(e/1024)+" "+o.translate("kb"):e+" "+o.translate("b")},parseSize:t.parseSizeStr,predictRuntime:function(e,n){var r,i;return r=new o.Uploader(e),i=t.Runtime.thatCan(r.getOption().required_features,n||e.runtimes),r.destroy(),i},addFileFilter:function(e,t){i[e]=t}};o.addFileFilter("mime_types",function(e,t,n){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:o.FILE_EXTENSION_ERROR,message:o.translate("File extension error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("max_file_size",function(e,t,n){var r;e=o.parseSize(e),t.size!==r&&e&&t.size>e?(this.trigger("Error",{code:o.FILE_SIZE_ERROR,message:o.translate("File size error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("prevent_duplicates",function(e,t,n){if(e){var r=this.files.length;while(r--)if(t.name===this.files[r].name&&t.size===this.files[r].size){this.trigger("Error",{code:o.FILE_DUPLICATE_ERROR,message:o.translate("Duplicate file error."),file:t}),n(!1);return}}n(!0)}),o.Uploader=function(e){function g(){var e,t=0,n;if(this.state==o.STARTED){for(n=0;n0?Math.ceil(e.loaded/e.size*100):100,b()}function b(){var e,t;d.reset();for(e=0;e0?Math.ceil(d.uploaded/f.length*100):0:(d.bytesPerSec=Math.ceil(d.loaded/((+(new Date)-p||1)/1e3)),d.percent=d.size>0?Math.ceil(d.loaded/d.size*100):0)}function w(){var e=c[0]||h[0];return e?e.getRuntime().uid:!1}function E(e,n){if(e.ruid){var r=t.Runtime.getInfo(e.ruid);if(r)return r.can(n)}return!1}function S(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",O),this.bind("BeforeUpload",C),this.bind("UploadFile",k),this.bind("UploadProgress",L),this.bind("StateChanged",A),this.bind("QueueChanged",b),this.bind("Error",_),this.bind("FileUploaded",M),this.bind("Destroy",D)}function x(e,n){var r=this,i=0,s=[],u={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:l,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};o.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(u[t]=e[t])}),e.browse_button&&o.each(e.browse_button,function(n){s.push(function(s){var a=new t.FileInput(o.extend({},u,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:n}));a.onready=function(){var e=t.Runtime.getInfo(this.ruid);t.extend(r.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),i++,c.push(this),s()},a.onchange=function(){r.addFile(this.files)},a.bind("mouseenter mouseleave mousedown mouseup",function(r){v||(e.browse_button_hover&&("mouseenter"===r.type?t.addClass(n,e.browse_button_hover):"mouseleave"===r.type&&t.removeClass(n,e.browse_button_hover)),e.browse_button_active&&("mousedown"===r.type?t.addClass(n,e.browse_button_active):"mouseup"===r.type&&t.removeClass(n,e.browse_button_active)))}),a.bind("mousedown",function(){r.trigger("Browse")}),a.bind("error runtimeerror",function(){a=null,s()}),a.init()})}),e.drop_element&&o.each(e.drop_element,function(e){s.push(function(n){var s=new t.FileDrop(o.extend({},u,{drop_zone:e}));s.onready=function(){var e=t.Runtime.getInfo(this.ruid);r.features.dragdrop=e.can("drag_and_drop"),i++,h.push(this),n()},s.ondrop=function(){r.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,n()}),s.init()})}),t.inSeries(s,function(){typeof n=="function"&&n(i)})}function T(e,r,i){var s=new t.Image;try{s.onload=function(){if(r.width>this.width&&r.height>this.height&&r.quality===n&&r.preserve_headers&&!r.crop)return this.destroy(),i(e);s.downsize(r.width,r.height,r.crop,r.preserve_headers)},s.onresize=function(){i(this.getAsBlob(e.type,r.quality)),this.destroy()},s.onerror=function(){i(e)},s.load(e)}catch(o){i(e)}}function N(e,n,r){function f(e,t,n){var r=a[e];switch(e){case"max_file_size":e==="max_file_size"&&(a.max_file_size=a.filters.max_file_size=t);break;case"chunk_size":if(t=o.parseSize(t))a[e]=t,a.send_file_name=!0;break;case"multipart":a[e]=t,t||(a.send_file_name=!0);break;case"unique_names":a[e]=t,t&&(a.send_file_name=!0);break;case"filters":o.typeOf(t)==="array"&&(t={mime_types:t}),n?o.extend(a.filters,t):a.filters=t,t.mime_types&&(a.filters.mime_types.regexp=function(e){var t=[];return o.each(e,function(e){o.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(a.filters.mime_types));break;case"resize":n?o.extend(a.resize,t,{enabled:!0}):a.resize=t;break;case"prevent_duplicates":a.prevent_duplicates=a.filters.prevent_duplicates=!!t;break;case"browse_button":case"drop_element":t=o.get(t);case"container":case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":a[e]=t,n||(u=!0);break;default:a[e]=t}n||i.trigger("OptionChanged",e,t,r)}var i=this,u=!1;typeof e=="object"?o.each(e,function(e,t){f(t,e,r)}):f(e,n,r),r?(a.required_features=s(o.extend({},a)),l=s(o.extend({},a,{required_features:!0}))):u&&(i.trigger("Destroy"),x.call(i,a,function(e){e?(i.runtime=t.Runtime.getInfo(w()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})}))}function C(e,t){if(e.settings.unique_names){var n=t.name.match(/\.([^.]+)$/),r="part";n&&(r=n[1]),t.target_name=t.id+"."+r}}function k(e,n){function h(){u-->0?r(p,1e3):(n.loaded=f,e.trigger("Error",{code:o.HTTP_ERROR,message:o.translate("HTTP Error."),file:n,response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()}))}function p(){var d,v,g={},y;if(n.status!==o.UPLOADING||e.state===o.STOPPED)return;e.settings.send_file_name&&(g.name=n.target_name||n.name),s&&a.chunks&&c.size>s?(y=Math.min(s,c.size-f),d=c.slice(f,f+y)):(y=c.size,d=c),s&&a.chunks&&(e.settings.send_chunk_number?(g.chunk=Math.ceil(f/s),g.chunks=Math.ceil(c.size/s)):(g.offset=f,g.total=c.size)),m=new t.XMLHttpRequest,m.upload&&(m.upload.onprogress=function(t){n.loaded=Math.min(n.size,f+t.loaded),e.trigger("UploadProgress",n)}),m.onload=function(){if(m.status>=400){h();return}u=e.settings.max_retries,y=c.size?(n.size!=n.origSize&&(c.destroy(),c=null),e.trigger("UploadProgress",n),n.status=o.DONE,e.trigger("FileUploaded",n,{response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()})):r(p,1)},m.onerror=function(){h()},m.onloadend=function(){this.destroy(),m=null},e.settings.multipart&&a.multipart?(m.open("post",i,!0),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),v=new t.FormData,o.each(o.extend(g,e.settings.multipart_params),function(e,t){v.append(t,e)}),v.append(e.settings.file_data_name,d),m.send(v,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(i=o.buildUrl(e.settings.url,o.extend(g,e.settings.multipart_params)),m.open("post",i,!0),m.setRequestHeader("Content-Type","application/octet-stream"),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),m.send(d,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url}))}var i=e.settings.url,s=e.settings.chunk_size,u=e.settings.max_retries,a=e.features,f=0,c;n.loaded&&(f=n.loaded=s?s*Math.floor(n.loaded/s):0),c=n.getSource(),e.settings.resize.enabled&&E(c,"send_binary_string")&&!!~t.inArray(c.type,["image/jpeg","image/png"])?T.call(this,c,e.settings.resize,function(e){c=e,n.size=e.size,p()}):p()}function L(e,t){y(t)}function A(e){if(e.state==o.STARTED)p=+(new Date);else if(e.state==o.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==o.UPLOADING&&(e.files[t].status=o.QUEUED,b())}function O(){m&&m.abort()}function M(e){b(),r(function(){g.call(e)},1)}function _(e,t){t.code===o.INIT_ERROR?e.destroy():t.file&&(t.file.status=o.FAILED,y(t.file),e.state==o.STARTED&&(e.trigger("CancelUpload"),r(function(){g.call(e)},1)))}function D(e){e.stop(),o.each(f,function(e){e.destroy()}),f=[],c.length&&(o.each(c,function(e){e.destroy()}),c=[]),h.length&&(o.each(h,function(e){e.destroy()}),h=[]),l={},v=!1,p=m=null,d.reset()}var u=o.guid(),a,f=[],l={},c=[],h=[],p,d,v=!1,m;a={runtimes:t.Runtime.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",flash_swf_url:"js/Moxie.swf",silverlight_xap_url:"js/Moxie.xap",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:{enabled:!1,preserve_headers:!0,crop:!1},send_file_name:!0,send_chunk_number:!0},N.call(this,e,null,!0),d=new o.QueueProgress,o.extend(this,{id:u,uid:u,state:o.STOPPED,features:{},runtime:null,files:f,settings:a,total:d,init:function(){var e=this;typeof a.preinit=="function"?a.preinit(e):o.each(a.preinit,function(t,n){e.bind(n,t)}),S.call(this);if(!a.browse_button||!a.url){this.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")});return}x.call(this,a,function(n){typeof a.init=="function"?a.init(e):o.each(a.init,function(t,n){e.bind(n,t)}),n?(e.runtime=t.Runtime.getInfo(w()).type,e.trigger("Init",{runtime:e.runtime}),e.trigger("PostInit")):e.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})})},setOption:function(e,t){N.call(this,e,t,!this.runtime)},getOption:function(e){return e?a[e]:a},refresh:function(){c.length&&o.each(c,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=o.STARTED&&(this.state=o.STARTED,this.trigger("StateChanged"),g.call(this))},stop:function(){this.state!=o.STOPPED&&(this.state=o.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){v=arguments[0]!==n?arguments[0]:!0,c.length&&o.each(c,function(e){e.disable(v)}),this.trigger("DisableBrowse",v)},getFile:function(e){var t;for(t=f.length-1;t>=0;t--)if(f[t].id===e)return f[t]},addFile:function(e,n){function c(e,n){var r=[];t.each(s.settings.filters,function(t,n){i[n]&&r.push(function(r){i[n].call(s,t,e,function(e){r(!e)})})}),t.inSeries(r,n)}function h(e){var i=t.typeOf(e);if(e instanceof t.File){if(!e.ruid&&!e.isDetached()){if(!l)return!1;e.ruid=l,e.connectRuntime(l)}h(new o.File(e))}else e instanceof t.Blob?(h(e.getSource()),e.destroy()):e instanceof o.File?(n&&(e.name=n),u.push(function(t){c(e,function(n){n||(f.push(e),a.push(e),s.trigger("FileFiltered",e)),r(t,1)})})):t.inArray(i,["file","blob"])!==-1?h(new t.File(null,e)):i==="node"&&t.typeOf(e.files)==="filelist"?t.each(e.files,h):i==="array"&&(n=null,t.each(e,h))}var s=this,u=[],a=[],l;l=w(),h(e),u.length&&t.inSeries(u,function(){a.length&&s.trigger("FilesAdded",a)})},removeFile:function(e){var t=typeof e=="string"?e:e.id;for(var n=f.length-1;n>=0;n--)if(f[n].id===t)return this.splice(n,1)[0]},splice:function(e,t){var r=f.splice(e===n?0:e,t===n?f.length:t),i=!1;return this.state==o.STARTED&&(o.each(r,function(e){if(e.status===o.UPLOADING)return i=!0,!1}),i&&this.stop()),this.trigger("FilesRemoved",r),o.each(r,function(e){e.destroy()}),i&&this.start(),r},bind:function(e,t,n){var r=this;o.Uploader.prototype.bind.call(this,e,function(){var e=[].slice.call(arguments);return e.splice(0,1,r),t.apply(this,e)},0,n)},destroy:function(){this.trigger("Destroy"),a=d=null,this.unbindAll()}})},o.Uploader.prototype=t.EventTarget.instance,o.File=function(){function n(n){o.extend(this,{id:o.guid(),name:n.name||n.fileName,type:n.type||"",size:n.size||n.fileSize,origSize:n.size||n.fileSize,loaded:0,percent:0,status:o.QUEUED,lastModifiedDate:n.lastModifiedDate||(new Date).toLocaleString(),getNative:function(){var e=this.getSource().getSource();return t.inArray(t.typeOf(e),["blob","file"])!==-1?e:null},getSource:function(){return e[this.id]?e[this.id]:null},destroy:function(){var t=this.getSource();t&&(t.destroy(),delete e[this.id])}}),e[this.id]=n}var e={};return n}(),o.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},e.plupload=o})(window,mOxie); \ No newline at end of file diff --git a/sources/phpBB/bin/phpbbcli.php b/sources/phpBB/bin/phpbbcli.php new file mode 100644 index 0000000..ca425ad --- /dev/null +++ b/sources/phpBB/bin/phpbbcli.php @@ -0,0 +1,67 @@ +#!/usr/bin/env php + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +use Symfony\Component\Console\Input\ArgvInput; + +if (php_sapi_name() != 'cli') +{ + echo 'This program must be run from the command line.' . PHP_EOL; + exit(1); +} + +define('IN_PHPBB', true); +$phpbb_root_path = __DIR__ . '/../'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +require($phpbb_root_path . 'includes/startup.' . $phpEx); +require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx); + +$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx); +$phpbb_class_loader->register(); + +$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx); +extract($phpbb_config_php_file->get_all()); + +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); + +$input = new ArgvInput(); + +if ($input->hasParameterOption(array('--safe-mode'))) +{ + $phpbb_container_builder->set_use_extensions(false); + $phpbb_container_builder->set_dump_container(false); +} +else +{ + $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx); + $phpbb_class_loader_ext->register(); + phpbb_load_extensions_autoloaders($phpbb_root_path); +} + +$phpbb_container = $phpbb_container_builder->get_container(); +$phpbb_container->get('request')->enable_super_globals(); +require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx); + +$user = $phpbb_container->get('user'); +$user->add_lang('acp/common'); +$user->add_lang('cli'); + +$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $user); +$application->register_container_commands($phpbb_container->get('console.command_collection')); +$application->run($input); diff --git a/sources/phpBB/cache/.htaccess b/sources/phpBB/cache/.htaccess new file mode 100644 index 0000000..aa5afc1 --- /dev/null +++ b/sources/phpBB/cache/.htaccess @@ -0,0 +1,4 @@ + + Order Allow,Deny + Deny from All + \ No newline at end of file diff --git a/sources/phpBB/cache/index.htm b/sources/phpBB/cache/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/cache/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/common.php b/sources/phpBB/common.php new file mode 100644 index 0000000..0782bd7 --- /dev/null +++ b/sources/phpBB/common.php @@ -0,0 +1,128 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +/** +* Minimum Requirement: PHP 5.3.3 +*/ + +if (!defined('IN_PHPBB')) +{ + exit; +} + +require($phpbb_root_path . 'includes/startup.' . $phpEx); +require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx); + +$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx); +$phpbb_class_loader->register(); + +$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx); +extract($phpbb_config_php_file->get_all()); + +if (!defined('PHPBB_INSTALLED')) +{ + // Redirect the user to the installer + require($phpbb_root_path . 'includes/functions.' . $phpEx); + + // We have to generate a full HTTP/1.1 header here since we can't guarantee to have any of the information + // available as used by the redirect function + $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); + $server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT'); + $secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0; + + $script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF'); + if (!$script_name) + { + $script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI'); + } + + // $phpbb_root_path accounts for redirects from e.g. /adm + $script_path = trim(dirname($script_name)) . '/' . $phpbb_root_path . 'install/index.' . $phpEx; + // Replace any number of consecutive backslashes and/or slashes with a single slash + // (could happen on some proxy setups and/or Windows servers) + $script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path); + + // Eliminate . and .. from the path + require($phpbb_root_path . 'phpbb/filesystem.' . $phpEx); + $phpbb_filesystem = new phpbb\filesystem(); + $script_path = $phpbb_filesystem->clean_path($script_path); + + $url = (($secure) ? 'https://' : 'http://') . $server_name; + + if ($server_port && (($secure && $server_port <> 443) || (!$secure && $server_port <> 80))) + { + // HTTP HOST can carry a port number... + if (strpos($server_name, ':') === false) + { + $url .= ':' . $server_port; + } + } + + $url .= $script_path; + header('Location: ' . $url); + exit; +} + +// 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/constants.' . $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_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_class_loader->set_cache($phpbb_container->get('cache.driver')); +$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver')); + +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'))); +$phpbb_hook_finder = $phpbb_container->get('hook_finder'); + +foreach ($phpbb_hook_finder->find() as $hook) +{ + @include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx); +} + +/** +* Main event which is triggered on every page +* +* You can use this event to load function files and initiate objects +* +* NOTE: At this point the global session ($user) and permissions ($auth) +* do NOT exist yet. If you need to use the user object +* (f.e. to include language files) or need to check permissions, +* please use the core.user_setup event instead! +* +* @event core.common +* @since 3.1.0-a1 +*/ +$phpbb_dispatcher->dispatch('core.common'); diff --git a/sources/phpBB/composer.json b/sources/phpBB/composer.json new file mode 100644 index 0000000..69f0de8 --- /dev/null +++ b/sources/phpBB/composer.json @@ -0,0 +1,55 @@ +{ + "name": "phpbb/phpbb", + "description": "phpBB Forum Software application", + "type": "project", + "keywords": ["phpbb", "forum"], + "homepage": "https://www.phpbb.com", + "license": "GPL-2.0", + "authors": [ + { + "name": "phpBB Limited", + "email": "operations@phpbb.com", + "homepage": "https://www.phpbb.com/go/authors" + } + ], + "support": { + "issues": "https://tracker.phpbb.com", + "forum": "https://www.phpbb.com/community/", + "wiki": "https://wiki.phpbb.com", + "irc": "irc://irc.freenode.org/phpbb" + }, + "scripts": { + "post-update-cmd": "echo 'You MUST manually modify the clean-vendor-dir target in build/build.xml when adding or upgrading dependencies.'" + }, + "replace": { + "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.*", + "twig/twig": "1.13.*" + }, + "require-dev": { + "fabpot/goutte": "1.0.*", + "phpunit/dbunit": "1.3.*", + "phpunit/phpunit": "4.1.*", + "phing/phing": "2.4.*", + "sami/sami": "1.*", + "squizlabs/php_codesniffer": "1.*", + "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.*" + } +} diff --git a/sources/phpBB/composer.lock b/sources/phpBB/composer.lock new file mode 100644 index 0000000..07ae59f --- /dev/null +++ b/sources/phpBB/composer.lock @@ -0,0 +1,2252 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" + ], + "hash": "d93446768ea0665b7c55c01890153a67", + "packages": [ + { + "name": "lusitanian/oauth", + "version": "v0.2.1", + "source": { + "type": "git", + "url": "https://github.com/Lusitanian/PHPoAuthLib.git", + "reference": "00c667d93058e983fc1b7d3d1cebdb1bc03fb043" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Lusitanian/PHPoAuthLib/zipball/00c667d93058e983fc1b7d3d1cebdb1bc03fb043", + "reference": "00c667d93058e983fc1b7d3d1cebdb1bc03fb043", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*", + "predis/predis": "0.8.*@dev", + "symfony/http-foundation": "~2.1" + }, + "suggest": { + "predis/predis": "Allows using the Redis storage backend.", + "symfony/http-foundation": "Allows using the Symfony Session storage backend." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.1-dev" + } + }, + "autoload": { + "psr-0": { + "OAuth": "src", + "OAuth\\Unit": "tests" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "David Desberg", + "email": "david@daviddesberg.com" + }, + { + "name": "Pieter Hordijk", + "email": "info@pieterhordijk.com", + "homepage": "https://pieterhordijk.com", + "role": "developer" + } + ], + "description": "PHP 5.3+ oAuth 1/2 Library", + "keywords": [ + "Authentication", + "authorization", + "oauth", + "security" + ], + "time": "2013-08-29 21:40:04" + }, + { + "name": "psr/log", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Psr\\Log\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2012-12-21 11:40:51" + }, + { + "name": "symfony/config", + "version": "v2.3.21", + "target-dir": "Symfony/Component/Config", + "source": { + "type": "git", + "url": "https://github.com/symfony/Config.git", + "reference": "f9fac999dbc2c6aabd749c034d938b5f9aa5fb7d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Config/zipball/f9fac999dbc2c6aabd749c034d938b5f9aa5fb7d", + "reference": "f9fac999dbc2c6aabd749c034d938b5f9aa5fb7d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/filesystem": "~2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Config\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Config Component", + "homepage": "http://symfony.com", + "time": "2014-09-23 05:15:05" + }, + { + "name": "symfony/console", + "version": "v2.3.21", + "target-dir": "Symfony/Component/Console", + "source": { + "type": "git", + "url": "https://github.com/symfony/Console.git", + "reference": "aa12ac573c583a74c2cb26ad9be478e119f04ad1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Console/zipball/aa12ac573c583a74c2cb26ad9be478e119f04ad1", + "reference": "aa12ac573c583a74c2cb26ad9be478e119f04ad1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/event-dispatcher": "~2.1" + }, + "suggest": { + "symfony/event-dispatcher": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Console\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Console Component", + "homepage": "http://symfony.com", + "time": "2014-10-05 13:45:10" + }, + { + "name": "symfony/debug", + "version": "v2.3.21", + "target-dir": "Symfony/Component/Debug", + "source": { + "type": "git", + "url": "https://github.com/symfony/Debug.git", + "reference": "883f847ad179e92549a8cea372b08e5ef47ffe40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Debug/zipball/883f847ad179e92549a8cea372b08e5ef47ffe40", + "reference": "883f847ad179e92549a8cea372b08e5ef47ffe40", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/http-foundation": "~2.1", + "symfony/http-kernel": "~2.1" + }, + "suggest": { + "symfony/class-loader": "", + "symfony/http-foundation": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Debug\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Debug Component", + "homepage": "http://symfony.com", + "time": "2014-10-09 16:42:17" + }, + { + "name": "symfony/dependency-injection", + "version": "v2.3.21", + "target-dir": "Symfony/Component/DependencyInjection", + "source": { + "type": "git", + "url": "https://github.com/symfony/DependencyInjection.git", + "reference": "e2324e1c8c39faa5f27e6170b278d7f631574141" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/e2324e1c8c39faa5f27e6170b278d7f631574141", + "reference": "e2324e1c8c39faa5f27e6170b278d7f631574141", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/config": "~2.2", + "symfony/yaml": "~2.0" + }, + "suggest": { + "symfony/config": "", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\DependencyInjection\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "http://symfony.com", + "time": "2014-10-01 05:38:33" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.3.21", + "target-dir": "Symfony/Component/EventDispatcher", + "source": { + "type": "git", + "url": "https://github.com/symfony/EventDispatcher.git", + "reference": "3e0b837811fadd73c833c7c06a92201d953df59d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/3e0b837811fadd73c833c7c06a92201d953df59d", + "reference": "3e0b837811fadd73c833c7c06a92201d953df59d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/dependency-injection": "~2.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "http://symfony.com", + "time": "2014-10-01 05:39:06" + }, + { + "name": "symfony/filesystem", + "version": "v2.3.21", + "target-dir": "Symfony/Component/Filesystem", + "source": { + "type": "git", + "url": "https://github.com/symfony/Filesystem.git", + "reference": "1c3a5fab445d1d4a5d57f8fbf1379696c9785942" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/1c3a5fab445d1d4a5d57f8fbf1379696c9785942", + "reference": "1c3a5fab445d1d4a5d57f8fbf1379696c9785942", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "http://symfony.com", + "time": "2014-09-22 08:32:35" + }, + { + "name": "symfony/http-foundation", + "version": "v2.3.21", + "target-dir": "Symfony/Component/HttpFoundation", + "source": { + "type": "git", + "url": "https://github.com/symfony/HttpFoundation.git", + "reference": "30c90f08f948dd43e7310beae7a85c02ad2b655d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/30c90f08f948dd43e7310beae7a85c02ad2b655d", + "reference": "30c90f08f948dd43e7310beae7a85c02ad2b655d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "classmap": [ + "Symfony/Component/HttpFoundation/Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "http://symfony.com", + "time": "2014-10-23 13:11:04" + }, + { + "name": "symfony/http-kernel", + "version": "v2.3.21", + "target-dir": "Symfony/Component/HttpKernel", + "source": { + "type": "git", + "url": "https://github.com/symfony/HttpKernel.git", + "reference": "0154ff659004d4148e8da0f2bdb672efe55e6ee5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/0154ff659004d4148e8da0f2bdb672efe55e6ee5", + "reference": "0154ff659004d4148e8da0f2bdb672efe55e6ee5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "psr/log": "~1.0", + "symfony/debug": "~2.3", + "symfony/event-dispatcher": "~2.1", + "symfony/http-foundation": "~2.2" + }, + "require-dev": { + "symfony/browser-kit": "~2.2", + "symfony/class-loader": "~2.1", + "symfony/config": "~2.0", + "symfony/console": "~2.2", + "symfony/dependency-injection": "~2.0", + "symfony/finder": "~2.0", + "symfony/process": "~2.0", + "symfony/routing": "~2.2", + "symfony/stopwatch": "~2.2", + "symfony/templating": "~2.2" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/class-loader": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "", + "symfony/finder": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\HttpKernel\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony HttpKernel Component", + "homepage": "http://symfony.com", + "time": "2014-10-24 05:54:08" + }, + { + "name": "symfony/routing", + "version": "v2.3.21", + "target-dir": "Symfony/Component/Routing", + "source": { + "type": "git", + "url": "https://github.com/symfony/Routing.git", + "reference": "f7f8ebf9c99e5ebfdb908c3558a818c2883eab1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Routing/zipball/f7f8ebf9c99e5ebfdb908c3558a818c2883eab1f", + "reference": "f7f8ebf9c99e5ebfdb908c3558a818c2883eab1f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "doctrine/common": "~2.2", + "psr/log": "~1.0", + "symfony/config": "~2.2", + "symfony/http-foundation": "~2.3", + "symfony/yaml": "~2.0" + }, + "suggest": { + "doctrine/common": "", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Routing\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Routing Component", + "homepage": "http://symfony.com", + "time": "2014-10-13 12:38:27" + }, + { + "name": "symfony/yaml", + "version": "v2.3.21", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "34687c6236f1dfcebc874fbebd8da74d90f9f64f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/34687c6236f1dfcebc874fbebd8da74d90f9f64f", + "reference": "34687c6236f1dfcebc874fbebd8da74d90f9f64f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com", + "time": "2014-10-01 05:38:33" + }, + { + "name": "twig/twig", + "version": "v1.13.2", + "source": { + "type": "git", + "url": "https://github.com/fabpot/Twig.git", + "reference": "6d6a1009427d1f398c9d40904147bf9f723d5755" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fabpot/Twig/zipball/6d6a1009427d1f398c9d40904147bf9f723d5755", + "reference": "6d6a1009427d1f398c9d40904147bf9f723d5755", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.13-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ], + "time": "2013-08-03 15:35:31" + } + ], + "packages-dev": [ + { + "name": "fabpot/goutte", + "version": "v1.0.7", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/Goutte.git", + "reference": "794b196e76bdd37b5155cdecbad311f0a3b07625" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/794b196e76bdd37b5155cdecbad311f0a3b07625", + "reference": "794b196e76bdd37b5155cdecbad311f0a3b07625", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "guzzle/http": "~3.1", + "php": ">=5.3.0", + "symfony/browser-kit": "~2.1", + "symfony/css-selector": "~2.1", + "symfony/dom-crawler": "~2.1", + "symfony/finder": "~2.1", + "symfony/process": "~2.1" + }, + "require-dev": { + "guzzle/plugin-history": "~3.1", + "guzzle/plugin-mock": "~3.1" + }, + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Goutte": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A simple PHP Web Scraper", + "homepage": "https://github.com/fabpot/Goutte", + "keywords": [ + "scraper" + ], + "time": "2014-10-09 15:52:51" + }, + { + "name": "guzzle/common", + "version": "v3.7.3", + "target-dir": "Guzzle/Common", + "source": { + "type": "git", + "url": "https://github.com/guzzle/common.git", + "reference": "bf73c87375f60861f8c7ccc7b95878023ade5306" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/common/zipball/bf73c87375f60861f8c7ccc7b95878023ade5306", + "reference": "bf73c87375f60861f8c7ccc7b95878023ade5306", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "symfony/event-dispatcher": ">=2.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle\\Common": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Common libraries used by Guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "collection", + "common", + "event", + "exception" + ], + "time": "2013-09-08 21:09:18" + }, + { + "name": "guzzle/http", + "version": "v3.7.3", + "target-dir": "Guzzle/Http", + "source": { + "type": "git", + "url": "https://github.com/guzzle/http.git", + "reference": "1034125dfd906b73119e535f03153a62fccb1989" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/http/zipball/1034125dfd906b73119e535f03153a62fccb1989", + "reference": "1034125dfd906b73119e535f03153a62fccb1989", + "shasum": "" + }, + "require": { + "guzzle/common": "self.version", + "guzzle/parser": "self.version", + "guzzle/stream": "self.version", + "php": ">=5.3.2" + }, + "suggest": { + "ext-curl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle\\Http": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "HTTP libraries used by Guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "client", + "curl", + "http", + "http client" + ], + "time": "2013-09-06 11:34:26" + }, + { + "name": "guzzle/parser", + "version": "v3.7.3", + "target-dir": "Guzzle/Parser", + "source": { + "type": "git", + "url": "https://github.com/guzzle/parser.git", + "reference": "a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/parser/zipball/a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2", + "reference": "a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle\\Parser": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Interchangeable parsers used by Guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "URI Template", + "cookie", + "http", + "message", + "url" + ], + "time": "2013-07-11 22:46:03" + }, + { + "name": "guzzle/stream", + "version": "v3.7.3", + "target-dir": "Guzzle/Stream", + "source": { + "type": "git", + "url": "https://github.com/guzzle/stream.git", + "reference": "a86111d9ac7db31d65a053c825869409fe8fc83f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/stream/zipball/a86111d9ac7db31d65a053c825869409fe8fc83f", + "reference": "a86111d9ac7db31d65a053c825869409fe8fc83f", + "shasum": "" + }, + "require": { + "guzzle/common": "self.version", + "php": ">=5.3.2" + }, + "suggest": { + "guzzle/http": "To convert Guzzle request objects to PHP streams" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle\\Stream": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle stream wrapper component", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "component", + "stream" + ], + "time": "2013-07-30 22:07:23" + }, + { + "name": "michelf/php-markdown", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/michelf/php-markdown.git", + "reference": "de9a19c7bf352d41cc99ed86c3c0ef17e87394b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/michelf/php-markdown/zipball/de9a19c7bf352d41cc99ed86c3c0ef17e87394b6", + "reference": "de9a19c7bf352d41cc99ed86c3c0ef17e87394b6", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-lib": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Michelf": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Michel Fortin", + "email": "michel.fortin@michelf.ca", + "homepage": "http://michelf.ca/", + "role": "Developer" + }, + { + "name": "John Gruber", + "homepage": "http://daringfireball.net/" + } + ], + "description": "PHP Markdown", + "homepage": "http://michelf.ca/projects/php-markdown/", + "keywords": [ + "markdown" + ], + "time": "2014-05-05 02:43:50" + }, + { + "name": "nikic/php-parser", + "version": "v0.9.4", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "1e5e280ae88a27effa2ae4aa2bd088494ed8594f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1e5e280ae88a27effa2ae4aa2bd088494ed8594f", + "reference": "1e5e280ae88a27effa2ae4aa2bd088494ed8594f", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.9-dev" + } + }, + "autoload": { + "psr-0": { + "PHPParser": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2013-08-25 17:11:40" + }, + { + "name": "phing/phing", + "version": "2.4.14", + "source": { + "type": "git", + "url": "https://github.com/phingofficial/phing.git", + "reference": "41075d93ca254f1c90c79ec7ce81be2b2629e138" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phingofficial/phing/zipball/41075d93ca254f1c90c79ec7ce81be2b2629e138", + "reference": "41075d93ca254f1c90c79ec7ce81be2b2629e138", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "bin": [ + "bin/phing" + ], + "type": "library", + "autoload": { + "classmap": [ + "classes/phing/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "classes" + ], + "license": [ + "LGPL3" + ], + "authors": [ + { + "name": "Michiel Rook", + "email": "mrook@php.net" + }, + { + "name": "Phing Community", + "homepage": "http://www.phing.info/trac/wiki/Development/Contributors" + } + ], + "description": "PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.", + "homepage": "http://www.phing.info/", + "keywords": [ + "build", + "task", + "tool" + ], + "time": "2012-11-29 21:23:47" + }, + { + "name": "phpunit/dbunit", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/dbunit.git", + "reference": "a5891b7a9c4f21587a51f9bc4e8f7042b741b480" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/a5891b7a9c4f21587a51f9bc4e8f7042b741b480", + "reference": "a5891b7a9c4f21587a51f9bc4e8f7042b741b480", + "shasum": "" + }, + "require": { + "ext-pdo": "*", + "ext-simplexml": "*", + "php": ">=5.3.3", + "phpunit/phpunit": ">=3.7.0@stable", + "symfony/yaml": ">=2.1.0" + }, + "bin": [ + "composer/bin/dbunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "", + "../../symfony/yaml/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "DbUnit port for PHP/PHPUnit to support database interaction testing.", + "homepage": "https://github.com/sebastianbergmann/dbunit/", + "keywords": [ + "database", + "testing", + "xunit" + ], + "time": "2014-03-26 11:25:06" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "bccecf50645068b44f49a84009e2a0499a500b99" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/bccecf50645068b44f49a84009e2a0499a500b99", + "reference": "bccecf50645068b44f49a84009e2a0499a500b99", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3.1", + "phpunit/php-text-template": "~1.2.0", + "phpunit/php-token-stream": "~1.2.2", + "sebastian/environment": "~1.0.0", + "sebastian/version": "~1.0.3" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4.0.14" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2014-04-30 09:01:21" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "File/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2013-10-10 15:34:57" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "Text/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2014-01-30 17:20:04" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2013-08-02 07:42:54" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2014-03-03 05:10:30" + }, + { + "name": "phpunit/phpunit", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "efb1b1334605594417a3bd466477772d06d460a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/efb1b1334605594417a3bd466477772d06d460a8", + "reference": "efb1b1334605594417a3bd466477772d06d460a8", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpunit/php-code-coverage": "~2.0", + "phpunit/php-file-iterator": "~1.3.1", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "~1.0.2", + "phpunit/phpunit-mock-objects": "~2.1", + "sebastian/comparator": "~1.0", + "sebastian/diff": "~1.1", + "sebastian/environment": "~1.0", + "sebastian/exporter": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "", + "../../symfony/yaml/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "http://www.phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2014-05-02 07:13:40" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "da0eb04d8ee95ec2898187e407e519c118d3d27c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/da0eb04d8ee95ec2898187e407e519c118d3d27c", + "reference": "da0eb04d8ee95ec2898187e407e519c118d3d27c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.1" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2014-05-02 07:04:11" + }, + { + "name": "pimple/pimple", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/fabpot/Pimple.git", + "reference": "ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fabpot/Pimple/zipball/ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94", + "reference": "ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Pimple": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + } + ], + "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", + "homepage": "http://pimple.sensiolabs.org", + "keywords": [ + "container", + "dependency injection" + ], + "time": "2013-03-08 08:21:40" + }, + { + "name": "sami/sami", + "version": "v1.4", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/Sami.git", + "reference": "70f29c781f7bef30181c814b9471b2ceac694454" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/Sami/zipball/70f29c781f7bef30181c814b9471b2ceac694454", + "reference": "70f29c781f7bef30181c814b9471b2ceac694454", + "shasum": "" + }, + "require": { + "michelf/php-markdown": "~1.3", + "nikic/php-parser": "0.9.*", + "php": ">=5.3.0", + "pimple/pimple": "1.0.*", + "symfony/console": "~2.1", + "symfony/filesystem": "~2.1", + "symfony/finder": "~2.1", + "symfony/process": "~2.1", + "symfony/yaml": "~2.1", + "twig/twig": "1.*" + }, + "bin": [ + "sami.php" + ], + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-0": { + "Sami": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Sami, an API documentation generator", + "homepage": "http://sami.sensiolabs.org", + "keywords": [ + "phpdoc" + ], + "time": "2014-06-25 11:24:03" + }, + { + "name": "sebastian/comparator", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2", + "reference": "f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.1", + "sebastian/exporter": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2014-05-02 07:05:58" + }, + { + "name": "sebastian/diff", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d", + "reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "http://www.github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2013-08-03 16:46:33" + }, + { + "name": "sebastian/environment", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/79517609ec01139cd7e9fded0dd7ce08c952ef6a", + "reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "4.0.*@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2014-02-18 16:17:19" + }, + { + "name": "sebastian/exporter", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529", + "reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "4.0.*@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2014-02-16 08:26:31" + }, + { + "name": "sebastian/version", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", + "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2014-03-07 15:35:33" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "a76a39b317ce8106abe6264daa505e24e1731860" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/a76a39b317ce8106abe6264daa505e24e1731860", + "reference": "a76a39b317ce8106abe6264daa505e24e1731860", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.1.2" + }, + "suggest": { + "phpunit/php-timer": "dev-master" + }, + "bin": [ + "scripts/phpcs" + ], + "type": "library", + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/CommentParser/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2014-02-04 23:49:58" + }, + { + "name": "symfony/browser-kit", + "version": "v2.3.21", + "target-dir": "Symfony/Component/BrowserKit", + "source": { + "type": "git", + "url": "https://github.com/symfony/BrowserKit.git", + "reference": "6a403eedacb56d32dc2cc657cfeac09d640ae6bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/6a403eedacb56d32dc2cc657cfeac09d640ae6bc", + "reference": "6a403eedacb56d32dc2cc657cfeac09d640ae6bc", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/dom-crawler": "~2.0" + }, + "require-dev": { + "symfony/css-selector": "~2.0", + "symfony/process": "~2.0" + }, + "suggest": { + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\BrowserKit\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony BrowserKit Component", + "homepage": "http://symfony.com", + "time": "2014-09-22 08:32:35" + }, + { + "name": "symfony/css-selector", + "version": "v2.3.21", + "target-dir": "Symfony/Component/CssSelector", + "source": { + "type": "git", + "url": "https://github.com/symfony/CssSelector.git", + "reference": "d9943386b648d21746bed25cc24f61fab1387943" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/CssSelector/zipball/d9943386b648d21746bed25cc24f61fab1387943", + "reference": "d9943386b648d21746bed25cc24f61fab1387943", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\CssSelector\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "http://symfony.com", + "time": "2014-10-09 12:30:02" + }, + { + "name": "symfony/dom-crawler", + "version": "v2.3.21", + "target-dir": "Symfony/Component/DomCrawler", + "source": { + "type": "git", + "url": "https://github.com/symfony/DomCrawler.git", + "reference": "64b90870ee3a4e88c9a7a12861683864de029d31" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/64b90870ee3a4e88c9a7a12861683864de029d31", + "reference": "64b90870ee3a4e88c9a7a12861683864de029d31", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/css-selector": "~2.0" + }, + "suggest": { + "symfony/css-selector": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\DomCrawler\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "http://symfony.com", + "time": "2014-10-01 05:38:33" + }, + { + "name": "symfony/finder", + "version": "v2.3.21", + "target-dir": "Symfony/Component/Finder", + "source": { + "type": "git", + "url": "https://github.com/symfony/Finder.git", + "reference": "fc25dab213d14468c39f12d47e5b79a72b898d4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Finder/zipball/fc25dab213d14468c39f12d47e5b79a72b898d4d", + "reference": "fc25dab213d14468c39f12d47e5b79a72b898d4d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "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": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Finder Component", + "homepage": "http://symfony.com", + "time": "2014-10-01 05:39:06" + }, + { + "name": "symfony/process", + "version": "v2.3.21", + "target-dir": "Symfony/Component/Process", + "source": { + "type": "git", + "url": "https://github.com/symfony/Process.git", + "reference": "0434822691030547f2439d30ff68758c5576a0ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Process/zipball/0434822691030547f2439d30ff68758c5576a0ce", + "reference": "0434822691030547f2439d30ff68758c5576a0ce", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Process\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Process Component", + "homepage": "http://symfony.com", + "time": "2014-10-01 05:38:33" + } + ], + "aliases": [ + + ], + "minimum-stability": "stable", + "stability-flags": [ + + ], + "platform": { + "php": ">=5.3.3" + }, + "platform-dev": [ + + ] +} diff --git a/sources/phpBB/config.php b/sources/phpBB/config.php new file mode 100644 index 0000000..e69de29 diff --git a/sources/phpBB/config/.htaccess b/sources/phpBB/config/.htaccess new file mode 100644 index 0000000..4128d34 --- /dev/null +++ b/sources/phpBB/config/.htaccess @@ -0,0 +1,4 @@ + + Order Allow,Deny + Deny from All + diff --git a/sources/phpBB/config/auth.yml b/sources/phpBB/config/auth.yml new file mode 100644 index 0000000..88a90ca --- /dev/null +++ b/sources/phpBB/config/auth.yml @@ -0,0 +1,100 @@ +services: +# ----- Auth management ----- + auth: + class: phpbb\auth\auth + +# ----- Auth providers ----- + auth.provider_collection: + class: phpbb\auth\provider_collection + arguments: + - @service_container + - @config + tags: + - { name: service_collection, tag: auth.provider } + + auth.provider.db: + class: phpbb\auth\provider\db + arguments: + - @dbal.conn + - @config + - @passwords.manager + - @request + - @user + - @service_container + - %core.root_path% + - %core.php_ext% + tags: + - { name: auth.provider } + + auth.provider.apache: + class: phpbb\auth\provider\apache + arguments: + - @dbal.conn + - @config + - @passwords.manager + - @request + - @user + - %core.root_path% + - %core.php_ext% + tags: + - { name: auth.provider } + + auth.provider.ldap: + class: phpbb\auth\provider\ldap + arguments: + - @dbal.conn + - @config + - @passwords.manager + - @user + tags: + - { name: auth.provider } + + auth.provider.oauth: + class: phpbb\auth\provider\oauth\oauth + arguments: + - @dbal.conn + - @config + - @passwords.manager + - @request + - @user + - %tables.auth_provider_oauth_token_storage% + - %tables.auth_provider_oauth_account_assoc% + - @auth.provider.oauth.service_collection + - %tables.users% + - @service_container + - %core.root_path% + - %core.php_ext% + tags: + - { name: auth.provider } + +# ----- OAuth services providers ----- + auth.provider.oauth.service_collection: + class: phpbb\di\service_collection + arguments: + - @service_container + tags: + - { name: service_collection, tag: auth.provider.oauth.service } + + auth.provider.oauth.service.bitly: + class: phpbb\auth\provider\oauth\service\bitly + arguments: + - @config + - @request + tags: + - { name: auth.provider.oauth.service } + + auth.provider.oauth.service.facebook: + class: phpbb\auth\provider\oauth\service\facebook + arguments: + - @config + - @request + tags: + - { name: auth.provider.oauth.service } + + auth.provider.oauth.service.google: + class: phpbb\auth\provider\oauth\service\google + arguments: + - @config + - @request + tags: + - { name: auth.provider.oauth.service } diff --git a/sources/phpBB/config/avatar.yml b/sources/phpBB/config/avatar.yml new file mode 100644 index 0000000..5292489 --- /dev/null +++ b/sources/phpBB/config/avatar.yml @@ -0,0 +1,67 @@ +services: + avatar.manager: + class: phpbb\avatar\manager + arguments: + - @config + - @avatar.driver_collection + +# ----- Avatar drivers ----- + avatar.driver_collection: + class: phpbb\di\service_collection + arguments: + - @service_container + tags: + - { name: service_collection, tag: avatar.driver } + + avatar.driver.gravatar: + class: phpbb\avatar\driver\gravatar + arguments: + - @config + - %core.root_path% + - %core.php_ext% + - @path_helper + - @cache.driver + calls: + - [set_name, [avatar.driver.gravatar]] + tags: + - { name: avatar.driver } + + avatar.driver.local: + class: phpbb\avatar\driver\local + arguments: + - @config + - %core.root_path% + - %core.php_ext% + - @path_helper + - @cache.driver + calls: + - [set_name, [avatar.driver.local]] + tags: + - { name: avatar.driver } + + avatar.driver.remote: + class: phpbb\avatar\driver\remote + arguments: + - @config + - %core.root_path% + - %core.php_ext% + - @path_helper + - @cache.driver + calls: + - [set_name, [avatar.driver.remote]] + tags: + - { name: avatar.driver } + + avatar.driver.upload: + class: phpbb\avatar\driver\upload + arguments: + - @config + - %core.root_path% + - %core.php_ext% + - @path_helper + - @mimetype.guesser + - @cache.driver + calls: + - [set_name, [avatar.driver.upload]] + tags: + - { name: avatar.driver } diff --git a/sources/phpBB/config/captcha.yml b/sources/phpBB/config/captcha.yml new file mode 100644 index 0000000..e3f617e --- /dev/null +++ b/sources/phpBB/config/captcha.yml @@ -0,0 +1,59 @@ +services: + captcha.factory: + class: phpbb\captcha\factory + arguments: + - @service_container + - @captcha.plugins.service_collection + +# ----- Captcha plugins ----- +# Scope MUST be prototype for all the plugins to work. + captcha.plugins.service_collection: + class: phpbb\di\service_collection + arguments: + - @service_container + tags: + - { name: service_collection, tag: captcha.plugins } + + core.captcha.plugins.gd: + class: phpbb\captcha\plugins\gd + scope: prototype + calls: + - [set_name, [core.captcha.plugins.gd]] + tags: + - { name: captcha.plugins } + + core.captcha.plugins.gd_wave: + class: phpbb\captcha\plugins\gd_wave + scope: prototype + calls: + - [set_name, [core.captcha.plugins.gd_wave]] + tags: + - { name: captcha.plugins } + + core.captcha.plugins.nogd: + class: phpbb\captcha\plugins\nogd + scope: prototype + calls: + - [set_name, [core.captcha.plugins.nogd]] + tags: + - { name: captcha.plugins } + + core.captcha.plugins.qa: + class: phpbb\captcha\plugins\qa + scope: prototype + arguments: + - %tables.captcha_qa_questions% + - %tables.captcha_qa_answers% + - %tables.captcha_qa_confirm% + calls: + - [set_name, [core.captcha.plugins.qa]] + tags: + - { name: captcha.plugins } + + core.captcha.plugins.recaptcha: + class: phpbb\captcha\plugins\recaptcha + scope: prototype + calls: + - [set_name, [core.captcha.plugins.recaptcha]] + tags: + - { name: captcha.plugins } diff --git a/sources/phpBB/config/console.yml b/sources/phpBB/config/console.yml new file mode 100644 index 0000000..1e18a7d --- /dev/null +++ b/sources/phpBB/config/console.yml @@ -0,0 +1,141 @@ +services: + console.command_collection: + class: phpbb\di\service_collection + arguments: + - @service_container + tags: + - { name: service_collection, tag: console.command } + + console.command.cache.purge: + class: phpbb\console\command\cache\purge + arguments: + - @user + - @cache.driver + - @dbal.conn + - @auth + - @log + - @config + tags: + - { name: console.command } + + console.command.config.delete: + class: phpbb\console\command\config\delete + arguments: + - @user + - @config + tags: + - { name: console.command } + + console.command.config.increment: + class: phpbb\console\command\config\increment + arguments: + - @user + - @config + tags: + - { name: console.command } + + console.command.config.get: + class: phpbb\console\command\config\get + arguments: + - @user + - @config + tags: + - { name: console.command } + + console.command.config.set: + class: phpbb\console\command\config\set + arguments: + - @user + - @config + tags: + - { name: console.command } + + console.command.config.set_atomic: + class: phpbb\console\command\config\set_atomic + arguments: + - @user + - @config + tags: + - { name: console.command } + + console.command.cron.list: + class: phpbb\console\command\cron\cron_list + arguments: + - @user + - @cron.manager + tags: + - { name: console.command } + + console.command.cron.run: + class: phpbb\console\command\cron\run + arguments: + - @user + - @cron.manager + - @cron.lock_db + tags: + - { name: console.command } + + console.command.db.migrate: + class: phpbb\console\command\db\migrate + arguments: + - @user + - @migrator + - @ext.manager + - @config + - @cache + - @log + - %core.root_path% + tags: + - { name: console.command } + + console.command.dev.migration_tips: + class: phpbb\console\command\dev\migration_tips + arguments: + - @user + - @ext.manager + tags: + - { name: console.command } + + console.command.extension.disable: + class: phpbb\console\command\extension\disable + arguments: + - @user + - @ext.manager + - @log + tags: + - { name: console.command } + + console.command.extension.enable: + class: phpbb\console\command\extension\enable + arguments: + - @user + - @ext.manager + - @log + tags: + - { name: console.command } + + console.command.extension.purge: + class: phpbb\console\command\extension\purge + arguments: + - @user + - @ext.manager + - @log + tags: + - { name: console.command } + + console.command.extension.show: + class: phpbb\console\command\extension\show + arguments: + - @user + - @ext.manager + - @log + tags: + - { name: console.command } + + console.command.fixup.recalculate_email_hash: + class: phpbb\console\command\fixup\recalculate_email_hash + arguments: + - @user + - @dbal.conn + tags: + - { name: console.command } diff --git a/sources/phpBB/config/content.yml b/sources/phpBB/config/content.yml new file mode 100644 index 0000000..4d9ee31 --- /dev/null +++ b/sources/phpBB/config/content.yml @@ -0,0 +1,72 @@ +services: + content.visibility: + class: phpbb\content_visibility + arguments: + - @auth + - @config + - @dispatcher + - @dbal.conn + - @user + - %core.root_path% + - %core.php_ext% + - %tables.forums% + - %tables.posts% + - %tables.topics% + - %tables.users% + + groupposition.legend: + class: phpbb\groupposition\legend + arguments: + - @dbal.conn + - @user + + groupposition.teampage: + class: phpbb\groupposition\teampage + arguments: + - @dbal.conn + - @user + - @cache.driver + + message.form.admin: + class: phpbb\message\admin_form + arguments: + - @auth + - @config + - @config_text + - @dbal.conn + - @user + - %core.root_path% + - %core.php_ext% + + message.form.topic: + class: phpbb\message\topic_form + arguments: + - @auth + - @config + - @dbal.conn + - @user + - %core.root_path% + - %core.php_ext% + + message.form.user: + class: phpbb\message\user_form + arguments: + - @auth + - @config + - @dbal.conn + - @user + - %core.root_path% + - %core.php_ext% + + pagination: + class: phpbb\pagination + arguments: + - @template + - @user + - @controller.helper + - @dispatcher + + viewonline_helper: + class: phpbb\viewonline_helper + arguments: + - @filesystem diff --git a/sources/phpBB/config/cron.yml b/sources/phpBB/config/cron.yml new file mode 100644 index 0000000..7a90c39 --- /dev/null +++ b/sources/phpBB/config/cron.yml @@ -0,0 +1,147 @@ +services: + cron.manager: + class: phpbb\cron\manager + arguments: + - @cron.task_collection + - %core.root_path% + - %core.php_ext% + + cron.lock_db: + class: phpbb\lock\db + arguments: + - cron_lock + - @config + - @dbal.conn + +# ----- Cron tasks ----- + cron.task_collection: + class: phpbb\di\service_collection + arguments: + - @service_container + tags: + - { name: service_collection, tag: cron.task } + + cron.task.core.prune_all_forums: + class: phpbb\cron\task\core\prune_all_forums + arguments: + - %core.root_path% + - %core.php_ext% + - @config + - @dbal.conn + calls: + - [set_name, [cron.task.core.prune_all_forums]] + tags: + - { name: cron.task } + + cron.task.core.prune_forum: + class: phpbb\cron\task\core\prune_forum + arguments: + - %core.root_path% + - %core.php_ext% + - @config + - @dbal.conn + calls: + - [set_name, [cron.task.core.prune_forum]] + tags: + - { name: cron.task } + + cron.task.core.prune_shadow_topics: + class: phpbb\cron\task\core\prune_shadow_topics + arguments: + - %core.root_path% + - %core.php_ext% + - @config + - @dbal.conn + - @log + - @user + calls: + - [set_name, [cron.task.core.prune_shadow_topics]] + tags: + - { name: cron.task } + + cron.task.core.prune_notifications: + class: phpbb\cron\task\core\prune_notifications + arguments: + - @config + - @notification_manager + calls: + - [set_name, [cron.task.core.prune_notifications]] + tags: + - { name: cron.task } + + cron.task.core.queue: + class: phpbb\cron\task\core\queue + arguments: + - %core.root_path% + - %core.php_ext% + - @config + calls: + - [set_name, [cron.task.core.queue]] + tags: + - { name: cron.task } + + cron.task.core.tidy_cache: + class: phpbb\cron\task\core\tidy_cache + arguments: + - @config + - @cache.driver + calls: + - [set_name, [cron.task.core.tidy_cache]] + tags: + - { name: cron.task } + + cron.task.core.tidy_database: + class: phpbb\cron\task\core\tidy_database + arguments: + - %core.root_path% + - %core.php_ext% + - @config + calls: + - [set_name, [cron.task.core.tidy_database]] + tags: + - { name: cron.task } + + cron.task.core.tidy_plupload: + class: phpbb\cron\task\core\tidy_plupload + arguments: + - %core.root_path% + - @config + calls: + - [set_name, [cron.task.core.tidy_plupload]] + tags: + - { name: cron.task } + + cron.task.core.tidy_search: + class: phpbb\cron\task\core\tidy_search + arguments: + - %core.root_path% + - %core.php_ext% + - @auth + - @config + - @dbal.conn + - @user + calls: + - [set_name, [cron.task.core.tidy_search]] + tags: + - { name: cron.task } + + cron.task.core.tidy_sessions: + class: phpbb\cron\task\core\tidy_sessions + arguments: + - @config + - @user + calls: + - [set_name, [cron.task.core.tidy_sessions]] + tags: + - { name: cron.task } + + cron.task.core.tidy_warnings: + class: phpbb\cron\task\core\tidy_warnings + arguments: + - %core.root_path% + - %core.php_ext% + - @config + calls: + - [set_name, [cron.task.core.tidy_warnings]] + tags: + - { name: cron.task } diff --git a/sources/phpBB/config/db.yml b/sources/phpBB/config/db.yml new file mode 100644 index 0000000..d11669d --- /dev/null +++ b/sources/phpBB/config/db.yml @@ -0,0 +1,78 @@ +services: + dbal.conn: + class: phpbb\db\driver\factory + arguments: + - @service_container + + dbal.conn.driver: + class: %dbal.driver.class% + calls: + - [sql_connect, [%dbal.dbhost%, %dbal.dbuser%, %dbal.dbpasswd%, %dbal.dbname%, %dbal.dbport%, false, %dbal.new_link%]] + + dbal.tools: + class: phpbb\db\tools + arguments: + - @dbal.conn + +# ----- Migrator ----- + migrator: + class: phpbb\db\migrator + arguments: + - @service_container + - @config + - @dbal.conn + - @dbal.tools + - %tables.migrations% + - %core.root_path% + - %core.php_ext% + - %core.table_prefix% + - @migrator.tool_collection + - @migrator.helper + + migrator.helper: + class: phpbb\db\migration\helper + +# ----- Migrator's tools ----- + migrator.tool_collection: + class: phpbb\di\service_collection + arguments: + - @service_container + tags: + - { name: service_collection, tag: migrator.tool } + + migrator.tool.config: + class: phpbb\db\migration\tool\config + arguments: + - @config + tags: + - { name: migrator.tool } + + migrator.tool.config_text: + class: phpbb\db\migration\tool\config_text + arguments: + - @config_text + tags: + - { name: migrator.tool } + + migrator.tool.module: + class: phpbb\db\migration\tool\module + arguments: + - @dbal.conn + - @cache + - @user + - %core.root_path% + - %core.php_ext% + - %tables.modules% + tags: + - { name: migrator.tool } + + migrator.tool.permission: + class: phpbb\db\migration\tool\permission + arguments: + - @dbal.conn + - @cache + - @auth + - %core.root_path% + - %core.php_ext% + tags: + - { name: migrator.tool } diff --git a/sources/phpBB/config/event.yml b/sources/phpBB/config/event.yml new file mode 100644 index 0000000..599b3cb --- /dev/null +++ b/sources/phpBB/config/event.yml @@ -0,0 +1,34 @@ +services: + dispatcher: + class: phpbb\event\dispatcher + arguments: + - @service_container + + hook_finder: + class: phpbb\hook\finder + arguments: + - %core.root_path% + - %core.php_ext% + - @cache.driver + + kernel_request_subscriber: + class: phpbb\event\kernel_request_subscriber + arguments: + - @ext.manager + - %core.root_path% + - %core.php_ext% + tags: + - { name: kernel.event_subscriber } + + kernel_exception_subscriber: + class: phpbb\event\kernel_exception_subscriber + arguments: + - @template + - @user + tags: + - { name: kernel.event_subscriber } + + kernel_terminate_subscriber: + class: phpbb\event\kernel_terminate_subscriber + tags: + - { name: kernel.event_subscriber } diff --git a/sources/phpBB/config/feed.yml b/sources/phpBB/config/feed.yml new file mode 100644 index 0000000..48bd9fe --- /dev/null +++ b/sources/phpBB/config/feed.yml @@ -0,0 +1,106 @@ +services: + feed.helper: + class: phpbb\feed\helper + arguments: + - @config + - @user + - %core.root_path% + - %core.php_ext% + + feed.factory: + class: phpbb\feed\factory + arguments: + - @service_container + - @config + - @dbal.conn + + feed.forum: + class: phpbb\feed\forum + scope: prototype + arguments: + - @feed.helper + - @config + - @dbal.conn + - @cache.driver + - @user + - @auth + - @content.visibility + - %core.php_ext% + + feed.forums: + class: phpbb\feed\forums + scope: prototype + arguments: + - @feed.helper + - @config + - @dbal.conn + - @cache.driver + - @user + - @auth + - @content.visibility + - %core.php_ext% + + feed.news: + class: phpbb\feed\news + scope: prototype + arguments: + - @feed.helper + - @config + - @dbal.conn + - @cache.driver + - @user + - @auth + - @content.visibility + - %core.php_ext% + + feed.overall: + class: phpbb\feed\overall + scope: prototype + arguments: + - @feed.helper + - @config + - @dbal.conn + - @cache.driver + - @user + - @auth + - @content.visibility + - %core.php_ext% + + feed.topic: + class: phpbb\feed\topic + scope: prototype + arguments: + - @feed.helper + - @config + - @dbal.conn + - @cache.driver + - @user + - @auth + - @content.visibility + - %core.php_ext% + + feed.topics: + class: phpbb\feed\topics + scope: prototype + arguments: + - @feed.helper + - @config + - @dbal.conn + - @cache.driver + - @user + - @auth + - @content.visibility + - %core.php_ext% + + feed.topics_active: + class: phpbb\feed\topics_active + scope: prototype + arguments: + - @feed.helper + - @config + - @dbal.conn + - @cache.driver + - @user + - @auth + - @content.visibility + - %core.php_ext% diff --git a/sources/phpBB/config/mimetype_guesser.yml b/sources/phpBB/config/mimetype_guesser.yml new file mode 100644 index 0000000..2e89ed3 --- /dev/null +++ b/sources/phpBB/config/mimetype_guesser.yml @@ -0,0 +1,36 @@ +services: + mimetype.guesser_collection: + class: phpbb\di\service_collection + arguments: + - @service_container + tags: + - { name: service_collection, tag: mimetype.guessers } + + mimetype.fileinfo_mimetype_guesser: + class: Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser + tags: + - { name: mimetype.guessers } + + mimetype.filebinary_mimetype_guesser: + class: Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser + tags: + - { name: mimetype.guessers } + + mimetype.content_guesser: + class: phpbb\mimetype\content_guesser + calls: + - [set_priority, [%mimetype.guesser.priority.low%]] + tags: + - { name: mimetype.guessers } + + mimetype.extension_guesser: + class: phpbb\mimetype\extension_guesser + calls: + - [set_priority, [%mimetype.guesser.priority.lowest%]] + tags: + - { name: mimetype.guessers } + + mimetype.guesser: + class: phpbb\mimetype\guesser + arguments: + - @mimetype.guesser_collection diff --git a/sources/phpBB/config/notification.yml b/sources/phpBB/config/notification.yml new file mode 100644 index 0000000..b17a172 --- /dev/null +++ b/sources/phpBB/config/notification.yml @@ -0,0 +1,390 @@ +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/sources/phpBB/config/parameters.yml b/sources/phpBB/config/parameters.yml new file mode 100644 index 0000000..8ecc142 --- /dev/null +++ b/sources/phpBB/config/parameters.yml @@ -0,0 +1,20 @@ +parameters: + # Disable the usage of the super globals (_GET, _POST, _SERVER...) + core.disable_super_globals: true + + # Datetime class to use + datetime.class: \phpbb\datetime + + # Mimetype guesser priorities + mimetype.guesser.priority.lowest: -2 + mimetype.guesser.priority.low: -1 + mimetype.guesser.priority.default: 0 + mimetype.guesser.priority.high: 1 + mimetype.guesser.priority.highest: 2 + + # List of default password driver types + passwords.algorithms: + - passwords.driver.bcrypt_2y + - passwords.driver.bcrypt + - passwords.driver.salted_md5 + - passwords.driver.phpass diff --git a/sources/phpBB/config/password.yml b/sources/phpBB/config/password.yml new file mode 100644 index 0000000..cb45ec3 --- /dev/null +++ b/sources/phpBB/config/password.yml @@ -0,0 +1,124 @@ +services: +# ----- Password management ----- + passwords.manager: + class: phpbb\passwords\manager + arguments: + - @config + - @passwords.driver_collection + - @passwords.helper + - %passwords.algorithms% + + passwords.helper: + class: phpbb\passwords\helper + + passwords.driver_helper: + class: phpbb\passwords\driver\helper + arguments: + - @config + +# ----- Password's drivers ----- + passwords.driver_collection: + class: phpbb\di\service_collection + arguments: + - @service_container + tags: + - { name: service_collection, tag: passwords.driver } + + passwords.driver.bcrypt: + class: phpbb\passwords\driver\bcrypt + arguments: + - @config + - @passwords.driver_helper + tags: + - { name: passwords.driver } + + passwords.driver.bcrypt_2y: + class: phpbb\passwords\driver\bcrypt_2y + arguments: + - @config + - @passwords.driver_helper + tags: + - { name: passwords.driver } + + passwords.driver.bcrypt_wcf2: + class: phpbb\passwords\driver\bcrypt_wcf2 + arguments: + - @passwords.driver.bcrypt + - @passwords.driver_helper + tags: + - { name: passwords.driver } + + passwords.driver.salted_md5: + class: phpbb\passwords\driver\salted_md5 + arguments: + - @config + - @passwords.driver_helper + tags: + - { name: passwords.driver } + + passwords.driver.phpass: + class: phpbb\passwords\driver\phpass + arguments: + - @config + - @passwords.driver_helper + tags: + - { name: passwords.driver } + + passwords.driver.convert_password: + class: phpbb\passwords\driver\convert_password + arguments: + - @config + - @passwords.driver_helper + tags: + - { name: passwords.driver } + + passwords.driver.sha1_smf: + class: phpbb\passwords\driver\sha1_smf + arguments: + - @config + - @passwords.driver_helper + tags: + - { name: passwords.driver } + + passwords.driver.sha1_wcf1: + class: phpbb\passwords\driver\sha1_wcf1 + arguments: + - @config + - @passwords.driver_helper + tags: + - { name: passwords.driver } + + passwords.driver.sha1: + class: phpbb\passwords\driver\sha1 + arguments: + - @config + - @passwords.driver_helper + tags: + - { name: passwords.driver } + + passwords.driver.md5_phpbb2: + class: phpbb\passwords\driver\md5_phpbb2 + arguments: + - @request + - @passwords.driver.salted_md5 + - @passwords.driver_helper + - %core.root_path% + - %core.php_ext% + tags: + - { name: passwords.driver } + + passwords.driver.md5_mybb: + class: phpbb\passwords\driver\md5_mybb + arguments: + - @config + - @passwords.driver_helper + tags: + - { name: passwords.driver } + + passwords.driver.md5_vb: + class: phpbb\passwords\driver\md5_vb + arguments: + - @config + - @passwords.driver_helper + tags: + - { name: passwords.driver } diff --git a/sources/phpBB/config/profilefield.yml b/sources/phpBB/config/profilefield.yml new file mode 100644 index 0000000..5ccfef9 --- /dev/null +++ b/sources/phpBB/config/profilefield.yml @@ -0,0 +1,102 @@ +services: + profilefields.manager: + class: phpbb\profilefields\manager + arguments: + - @auth + - @dbal.conn + - @dispatcher + - @request + - @template + - @profilefields.type_collection + - @user + - %tables.profile_fields% + - %tables.profile_fields_language% + - %tables.profile_fields_data% + + profilefields.lang_helper: + class: phpbb\profilefields\lang_helper + arguments: + - @dbal.conn + - %tables.profile_fields_options_language% + +# ----- Profile fields types ----- + profilefields.type_collection: + class: phpbb\di\service_collection + arguments: + - @service_container + tags: + - { name: service_collection, tag: profilefield.type } + + profilefields.type.bool: + class: phpbb\profilefields\type\type_bool + arguments: + - @profilefields.lang_helper + - @request + - @template + - @user + tags: + - { name: profilefield.type } + + profilefields.type.date: + class: phpbb\profilefields\type\type_date + arguments: + - @request + - @template + - @user + tags: + - { name: profilefield.type } + + profilefields.type.dropdown: + class: phpbb\profilefields\type\type_dropdown + arguments: + - @profilefields.lang_helper + - @request + - @template + - @user + tags: + - { name: profilefield.type } + + profilefields.type.googleplus: + class: phpbb\profilefields\type\type_googleplus + arguments: + - @request + - @template + - @user + tags: + - { name: profilefield.type } + + profilefields.type.int: + class: phpbb\profilefields\type\type_int + arguments: + - @request + - @template + - @user + tags: + - { name: profilefield.type } + + profilefields.type.string: + class: phpbb\profilefields\type\type_string + arguments: + - @request + - @template + - @user + tags: + - { name: profilefield.type } + + profilefields.type.text: + class: phpbb\profilefields\type\type_text + arguments: + - @request + - @template + - @user + tags: + - { name: profilefield.type } + + profilefields.type.url: + class: phpbb\profilefields\type\type_url + arguments: + - @request + - @template + - @user + tags: + - { name: profilefield.type } diff --git a/sources/phpBB/config/routing.yml b/sources/phpBB/config/routing.yml new file mode 100644 index 0000000..94146e1 --- /dev/null +++ b/sources/phpBB/config/routing.yml @@ -0,0 +1,9 @@ +# 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/sources/phpBB/config/services.yml b/sources/phpBB/config/services.yml new file mode 100644 index 0000000..8667cbb --- /dev/null +++ b/sources/phpBB/config/services.yml @@ -0,0 +1,188 @@ +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: tables.yml } + - { resource: parameters.yml } + +services: + cache: + class: phpbb\cache\service + arguments: + - @cache.driver + - @config + - @dbal.conn + - %core.root_path% + - %core.php_ext% + + cache.driver: + class: %cache.driver.class% + + class_loader: + class: phpbb\class_loader + arguments: + - phpbb\ + - %core.root_path%includes/ + - %core.php_ext% + calls: + - [register, []] + - [set_cache, [@cache.driver]] + + class_loader.ext: + class: phpbb\class_loader + arguments: + - \ + - %core.root_path%ext/ + - %core.php_ext% + calls: + - [register, []] + - [set_cache, [@cache.driver]] + + config: + class: phpbb\config\db + arguments: + - @dbal.conn + - @cache.driver + - %tables.config% + + config.php: + synthetic: true + + config_text: + class: phpbb\config\db_text + arguments: + - @dbal.conn + - %tables.config_text% + + controller.helper: + class: phpbb\controller\helper + arguments: + - @template + - @user + - @config + - @controller.provider + - @ext.manager + - @symfony_request + - @request + - @filesystem + - %core.root_path% + - %core.php_ext% + + 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: + - @service_container + - @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 + arguments: + - @dispatcher + - @controller.resolver + + log: + class: phpbb\log\log + arguments: + - @dbal.conn + - @user + - @auth + - @dispatcher + - %core.root_path% + - %core.adm_relative_path% + - %core.php_ext% + - %tables.log% + + path_helper: + class: phpbb\path_helper + arguments: + - @symfony_request + - @filesystem + - @request + - %core.root_path% + - %core.php_ext% + - %core.adm_relative_path% + + php_ini: + class: phpbb\php\ini + + plupload: + class: phpbb\plupload\plupload + arguments: + - %core.root_path% + - @config + - @request + - @user + - @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 + + version_helper: + class: phpbb\version_helper + scope: prototype + arguments: + - @cache + - @config + - @file_downloader + - @user diff --git a/sources/phpBB/config/tables.yml b/sources/phpBB/config/tables.yml new file mode 100644 index 0000000..2fe2a33 --- /dev/null +++ b/sources/phpBB/config/tables.yml @@ -0,0 +1,23 @@ +parameters: + tables.auth_provider_oauth_token_storage: %core.table_prefix%oauth_tokens + tables.auth_provider_oauth_account_assoc: %core.table_prefix%oauth_accounts + tables.captcha_qa_questions: %core.table_prefix%captcha_questions + tables.captcha_qa_answers: %core.table_prefix%captcha_answers + tables.captcha_qa_confirm: %core.table_prefix%qa_confirm + tables.config: %core.table_prefix%config + tables.config_text: %core.table_prefix%config_text + tables.ext: %core.table_prefix%ext + tables.forums: %core.table_prefix%forums + tables.log: %core.table_prefix%log + tables.migrations: %core.table_prefix%migrations + tables.modules: %core.table_prefix%modules + tables.notification_types: %core.table_prefix%notification_types + tables.notifications: %core.table_prefix%notifications + tables.profile_fields: %core.table_prefix%profile_fields + tables.profile_fields_data: %core.table_prefix%profile_fields_data + 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.topics: %core.table_prefix%topics + tables.user_notifications: %core.table_prefix%user_notifications + tables.users: %core.table_prefix%users diff --git a/sources/phpBB/config/user.yml b/sources/phpBB/config/user.yml new file mode 100644 index 0000000..1ca853e --- /dev/null +++ b/sources/phpBB/config/user.yml @@ -0,0 +1,19 @@ +services: + acl.permissions: + class: phpbb\permissions + arguments: + - @dispatcher + - @user + + user: + class: phpbb\user + arguments: + - %datetime.class% + + user_loader: + class: phpbb\user_loader + arguments: + - @dbal.conn + - %core.root_path% + - %core.php_ext% + - %tables.users% diff --git a/sources/phpBB/cron.php b/sources/phpBB/cron.php new file mode 100644 index 0000000..3f022b1 --- /dev/null +++ b/sources/phpBB/cron.php @@ -0,0 +1,70 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +/** +*/ +define('IN_PHPBB', true); +define('IN_CRON', true); +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +include($phpbb_root_path . 'common.' . $phpEx); + +// Do not update users last page entry +$user->session_begin(false); +$auth->acl($user->data); + +function output_image() +{ + // Output transparent gif + header('Cache-Control: no-cache'); + header('Content-type: image/gif'); + header('Content-length: 43'); + + echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='); + + // Flush here to prevent browser from showing the page as loading while + // running cron. + flush(); +} + +// Thanks to various fatal errors and lack of try/finally, it is quite easy to leave +// the cron lock locked, especially when working on cron-related code. +// +// Attempt to alleviate the problem by doing setup outside of the lock as much as possible. + +$cron_type = request_var('cron_type', ''); + +// Comment this line out for debugging so the page does not return an image. +output_image(); + +$cron_lock = $phpbb_container->get('cron.lock_db'); +if ($cron_lock->acquire()) +{ + $cron = $phpbb_container->get('cron.manager'); + + $task = $cron->find_task($cron_type); + if ($task) + { + if ($task->is_parametrized()) + { + $task->parse_parameters($request); + } + if ($task->is_ready()) + { + $task->run(); + } + } + $cron_lock->release(); +} + +garbage_collection(); diff --git a/sources/phpBB/docs/CHANGELOG.html b/sources/phpBB/docs/CHANGELOG.html new file mode 100644 index 0000000..acf5a31 --- /dev/null +++ b/sources/phpBB/docs/CHANGELOG.html @@ -0,0 +1,4749 @@ + + + + + + +phpBB • Changelog + + + + + + + +
+ + + + + +
+ + + +

This is a non-exhaustive (but still near complete) changelog for phpBB 3.1.x including release candidate versions. Our thanks to all those people who've contributed bug reports and code fixes.

+ +

Changelog

+ + + +
+ +

1. Changelog

+ +
+
+ +
+ +

Changes since 3.1.3-RC1

+ +

Bug

+
    +
  • [PHPBB3-12933] - The search operator for partial matches does not work
  • +
  • [PHPBB3-13544] - Migrations' "permission.permission_unset" deletes all permissions instead of just the one stated
  • +
  • [PHPBB3-13556] - Translated exceptions from file_downloader are handled incorrectly
  • +
  • [PHPBB3-13557] - Migrations for 3.0.13 and PL1 are missing
  • +
+

Task

+
    +
  • [PHPBB3-13553] - Controller helper needs a message handler to replace error handler
  • +
+ +

Changes since 3.1.2

+ +

Security

+
    +
  • [PHPBB3-13519] - Correctly validate imagick path as path and not string
  • +
+

Bug

+
    +
  • [PHPBB3-9100] - Inline attachments are not being inserted at the cursor
  • +
  • [PHPBB3-11613] - Cookies do not work for netbios domain
  • +
  • [PHPBB3-12089] - Make HTTP status code error messages more informative
  • +
  • [PHPBB3-12642] - Custom profile field isn't displayed
  • +
  • [PHPBB3-12698] - Replace all instances of magic numbers with constants in javascript
  • +
  • [PHPBB3-12866] - Wrong profile field validation options
  • +
  • [PHPBB3-13098] - Repair Yahoo contact field
  • +
  • [PHPBB3-13192] - confirm_box() action contains app.php when enable_mod_rewrite is set
  • +
  • [PHPBB3-13238] - \phpbb\db\migration\data\v310\mysql_fulltext_drop tries to drop non existent indexes
  • +
  • [PHPBB3-13272] - Changed Files packages do not include vendor directory
  • +
  • [PHPBB3-13282] - PostgreSQL error when creating boolean/dropdown custom profile fields
  • +
  • [PHPBB3-13302] - ACP links to docs need to be updated to 3.1 URLs
  • +
  • [PHPBB3-13307] - develop/mysql_upgrader.php does not work anymore
  • +
  • [PHPBB3-13319] - Icons/smilies table improperly formed when no images present
  • +
  • [PHPBB3-13346] - Missing space in posting_editor.html
  • +
  • [PHPBB3-13357] - LOG_MOVED_TOPIC Language var missing
  • +
  • [PHPBB3-13358] - Add class for retrieving remote file data
  • +
  • [PHPBB3-13362] - The whole cache dir (excluding the .htaccess and index.html files) should be ignored by git
  • +
  • [PHPBB3-13366] - Dynamic config for "plupload_last_gc" is static
  • +
  • [PHPBB3-13381] - Code Sniffer complains about 3.1.2 migration
  • +
  • [PHPBB3-13385] - Add free result after running update query in $config->set_atomic()
  • +
  • [PHPBB3-13391] - subsilver2 poll options must have a setting of 1 when editing a post
  • +
  • [PHPBB3-13393] - Invalid parameters passed to call_user_func_array in version_helper.php
  • +
  • [PHPBB3-13396] - Multibyte chars cause attachment upload to fail
  • +
  • [PHPBB3-13400] - Add a new message for high server loads during search
  • +
  • [PHPBB3-13405] - A typo in style_update_p1.php migration may prevent updating in some circumstances
  • +
  • [PHPBB3-13406] - ADD INDEX syntax may cause an error in earlier MySQL versions
  • +
  • [PHPBB3-13420] - Prune users bug - filter all with 0 posts
  • +
  • [PHPBB3-13427] - Add template events to MCP front before/after each list
  • +
  • [PHPBB3-13431] - Wrong margin-left for RTL sites in Internet Explorer mobile view
  • +
  • [PHPBB3-13432] - Migrator module tool does not add the needed module language file
  • +
  • [PHPBB3-13441] - functions_convert fails to set global moderators default group
  • +
  • [PHPBB3-13442] - UTF-8 symbols for database host
  • +
  • [PHPBB3-13448] - \phpbb\messenger->template can't find email templates in extensions
  • +
  • [PHPBB3-13453] - Sort params in Canonical URL
  • +
  • [PHPBB3-13470] - Mass email says "user doesn't exist" when all users is selected
  • +
  • [PHPBB3-13486] - Call to undefined method phpbb\db\driver\factory::sql_escpape() on database update
  • +
  • [PHPBB3-13489] - Allow the migrations to use the DI container
  • +
  • [PHPBB3-13490] - Unicode chars are broken in edit message after preview
  • +
  • [PHPBB3-13492] - Custom BBCode URL tokens do not support IDN
  • +
  • [PHPBB3-13504] - "Array" is displayed when searching, or when unanswered posts or active topics are selected
  • +
  • [PHPBB3-13507] - Large images in posts can cause horizontal scrollbars
  • +
  • [PHPBB3-13511] - The "Unused Use" Sniff is broken
  • +
  • [PHPBB3-13530] - Fix undefined variables in migrations and tests
  • +
  • [PHPBB3-13534] - Non-existent path in attachment settings causes travis failure
  • +
  • [PHPBB3-13543] - Slow tests fail on 3.1 and 3.2
  • +
+

Improvement

+
    +
  • [PHPBB3-11033] - FULLTEXT_SPHINX_NO_CONFIG_DATA references unrequired field
  • +
  • [PHPBB3-12567] - [proSilver] - viewtopic_body.html: Change 'back2top' anchor in to '#top'
  • +
  • [PHPBB3-12926] - Support for IDN (IRI)
  • +
  • [PHPBB3-13266] - Enabling twig dump function if DEBUG is defined
  • +
  • [PHPBB3-13306] - Add error level to the error collector
  • +
  • [PHPBB3-13312] - [event] - Add core event to the mass email form
  • +
  • [PHPBB3-13368] - Add the forum_data var to the core.viewforum_get_topic_ids_data event
  • +
  • [PHPBB3-13370] - Add ability to call class methods more easily in the convertor framework
  • +
  • [PHPBB3-13389] - Replace pattern with path in routing.yml
  • +
  • [PHPBB3-13402] - Code Sniffer, unused use, check the function doc blocks
  • +
  • [PHPBB3-13409] - Add event to modify search parameters before searching
  • +
  • [PHPBB3-13419] - Add template event at the end of the file
  • +
  • [PHPBB3-13422] - Add new events in save custom cookies and set custom ban type
  • +
  • [PHPBB3-13428] - Add core events to memberlist.php for teampage
  • +
  • [PHPBB3-13430] - Add event for modifying prune SQL
  • +
  • [PHPBB3-13435] - Add core event to modify submit_post() sql data
  • +
  • [PHPBB3-13437] - [Template] - viewtopic_body_post_author_before/after
  • +
  • [PHPBB3-13439] - [event] - Add event to run code at beginning of ACP users overview
  • +
  • [PHPBB3-13440] - [event] - Add event to process when a user fails a login attempt
  • +
  • [PHPBB3-13449] - Add viewforum.php core event after the topic data has been assigned to template
  • +
  • [PHPBB3-13466] - Add bbcode_uid and bitfield to event core.message_parser_check_message
  • +
  • [PHPBB3-13478] - Add core event core.bbcode_cache_init_end
  • +
+

Sub-task

+
    +
  • [PHPBB3-13141] - Add an event to allow applying additional permissions to MCP access besides f_read
  • +
  • [PHPBB3-13146] - Add an event to allow changing the result of calling get_forums_visibility_sql()
  • +
  • [PHPBB3-13147] - Add an event to change get_global_visibility_sql()'s results
  • +
  • [PHPBB3-13148] - Add an event to creating a final way to modify edit logs output
  • +
  • [PHPBB3-13154] - Add an event to edit user list for notifications
  • +
  • [PHPBB3-13158] - Add an event to allow adding extra auth checks when the user is posting
  • +
  • [PHPBB3-13159] - Add an event to allow extra auth checks when reporting posts
  • +
  • [PHPBB3-13160] - Add an event to viewtopic before viewing permissions
  • +
+

Task

+
    +
  • [PHPBB3-12924] - Meta tags should be self-closing
  • +
  • [PHPBB3-13528] - Boolean checkbox profile fields display "1" instead of selected value
  • +
+ + +

Changes since 3.1.1

+ +

Security

+
    +
  • [SECURITY-171] - Version helper does not properly escape version info
  • +
  • [SECURITY-169] - AJAX request with unexpected referrer causes infinite loop
  • +
+ +

Bug

+
    +
  • [PHPBB3-10442] - XHTML is invalid when a forum link without redirect counter is present
  • +
  • [PHPBB3-10744] - Prevent user from installing styles with reserved directory names
  • +
  • [PHPBB3-11863] - User registration settings show incorrectly as disabled when board-wide emails are disabled
  • +
  • [PHPBB3-12703] - Notification System sends exact same SQL query multiple times
  • +
  • [PHPBB3-13083] - Language correction in NO_ENTRIES in acp_logs
  • +
  • [PHPBB3-13100] - Don't display "delete reason" dialog for shadow-topics
  • +
  • [PHPBB3-13193] - Post counts in Private Messages should link to the user's posts
  • +
  • [PHPBB3-13197] - Group Avatar not deleted from users
  • +
  • [PHPBB3-13204] - Login flood control error supresses incorrect credential error
  • +
  • [PHPBB3-13209] - Boolean (Yes/No) custom profile field doesn't show given name
  • +
  • [PHPBB3-13216] - Datetime tests fail randomly
  • +
  • [PHPBB3-13228] - "Code: Select all" font-size too big in Private Messages
  • +
  • [PHPBB3-13239] - Can´t upload Attachments on iOS
  • +
  • [PHPBB3-13241] - Topics are being duplicated in multipage forums
  • +
  • [PHPBB3-13242] - Validation error in Contact a Board Administrator
  • +
  • [PHPBB3-13243] - Debug error when clicking Re-check all versions on ACP manage extensions page
  • +
  • [PHPBB3-13251] - Database password containing special characters no longer accepted after upgrade to 3.1.0
  • +
  • [PHPBB3-13253] - MCP queue link in active topics search is missing
  • +
  • [PHPBB3-13265] - "Edit profile" link on view-own-profile page should only show if user has permission to edit
  • +
  • [PHPBB3-13270] - Upgrading from 3.0.12 to 3.1.1 does not display moderator soft delete permissions
  • +
  • [PHPBB3-13277] - Move Up & Down does not take work in Internet Explorer
  • +
  • [PHPBB3-13280] - $user->page['page'] - is invalid resulting in confirm_box() not working correctly
  • +
  • [PHPBB3-13284] - Message body not included in email topic message
  • +
  • [PHPBB3-13298] - Use mysql_free_result to free result sets which were requested using mysql_query()
  • +
  • [PHPBB3-13300] - Jabber field still shown in profile when feature is disabled
  • +
  • [PHPBB3-13301] - Apache Authentication is probably broken
  • +
  • [PHPBB3-13303] - Migrator caught in loop calculating dependencies
  • +
  • [PHPBB3-13315] - Upgrade from 3.0.12 to 3.1.1 resets CAPTCHA selection
  • +
  • [PHPBB3-13316] - reCAPTCHA does not work on secured connection
  • +
  • [PHPBB3-13318] - login_username doesn't have multibyte parameter set to true
  • +
  • [PHPBB3-13323] - posting.php can pass invalid auth option to acl_get()
  • +
  • [PHPBB3-13332] - Insufficient information passed to password drivers for converted boards
  • +
  • [PHPBB3-13337] - Mark subforums read triggers error if subforums contain no topics
  • +
  • [PHPBB3-13338] - Some tests fail when run on their own
  • +
  • [PHPBB3-13342] - 310/captcha_plugins migration changes recaptcha to nogd
  • +
  • [PHPBB3-13349] - Incorrect entities used for breadcrumb separator in CSS
  • +
  • [PHPBB3-13354] - Unknown column 'topic_logs' in 'where clause' when deleting topic log in MCP
  • +
  • [PHPBB3-13376] - deregister_globals() does not work correctly when $_COOKIE['GLOBALS'] is specified
  • +
+ +

Improvement

+
    +
  • [PHPBB3-12681] - Cache the compiled routes and dump the url_generator
  • +
  • [PHPBB3-12885] - Wrong index page title when using Board Index text
  • +
  • [PHPBB3-13023] - [event] - Add Event posting_editor_buttons_custom_tags_before
  • +
  • [PHPBB3-13133] - Allow @vendor_extname in INCLUDECSS
  • +
  • [PHPBB3-13182] - [event] - Add posting.php core event to allow modifying the message before parsing
  • +
  • [PHPBB3-13220] - [event] - Add template events to memberlist_search.html
  • +
  • [PHPBB3-13290] - [event] - Add template event index_body_forumlist_body_after
  • +
  • [PHPBB3-13294] - [event] - Add message_parser.php core event for additional message handling before parsing
  • +
  • [PHPBB3-13297] - Add unicode modifier to url/email regular expression patterns
  • +
  • [PHPBB3-13309] - [event] - Add ACP template event acp_email_options_after
  • +
  • [PHPBB3-13310] - [event] - Add core event core.acp_email_modify_sql
  • +
  • [PHPBB3-13326] - Add viewtopic_url variable to a viewtopic event
  • +
  • [PHPBB3-13328] - [event] - Add event core.mcp_view_forum_modify_sql
  • +
  • [PHPBB3-13347] - [event] - Add new template events to acp_forums.html
  • +
+ +

New Feature

+
    +
  • [PHPBB3-12962] - Use phantomjs and webdriver for UI testing
  • +
+ +

Task

+
    +
  • [PHPBB3-13324] - Composer no longer downloads sami/sami and fabpot/goutte
  • +
  • [PHPBB3-13325] - Make installing dependencies for tests more user friendly or optional
  • +
  • [PHPBB3-13331] - Sami run as part of phing MUST NOT switch branches
  • +
+ + +

Changes since 3.1.0

+ +

Security

+
    +
  • [SECURITY-164] - Cross Site Scripting via PATH_INFO in page_name variable
  • +
+

Bug

+
    +
  • [PHPBB3-13248] - Login functions need to use provider collection for retrieving provider
  • +
  • [PHPBB3-13267] - Automatic Update instructions indicate that only the install folder is necessary
  • +
  • [PHPBB3-13268] - MSSQL's get_existing_indexes() function improperly appends ternary result
  • +
  • [PHPBB3-13271] - Anonymous users can CC themselves on emails sent to admin via contact form
  • +
+

Task

+
    +
  • [PHPBB3-13262] - Add note to docs about htaccess file when upgrading 3.0 to 3.1
  • +
+ +

Changes since 3.1.0-RC6

+ +

Bug

+
    +
  • [PHPBB3-13126] - More detailed output for migrations needed
  • +
  • [PHPBB3-13208] - Security issues are not pulled into the changelog
  • +
  • [PHPBB3-13210] - Queue Cron Job checks for wrong config variable queue_interval_config
  • +
  • [PHPBB3-13211] - Add possibility to save migrations output to log
  • +
  • [PHPBB3-13221] - Can't upgrade to 3.1 from 3.0.11 and older
  • +
  • [PHPBB3-13223] - Using get_username_string() for email template variables causes HTML markup in emails
  • +
  • [PHPBB3-13225] - phpbb_hash() undefined in phpbb\db\migration\data\v30x\release_3_0_5_rc1.php
  • +
  • [PHPBB3-13226] - Stray $rank_img in memberlist.php
  • +
  • [PHPBB3-13227] - Remote avatars do not work with cURL wrapper
  • +
  • [PHPBB3-13229] - Memberlist is getting overloaded with redundant SQL queries
  • +
  • [PHPBB3-13230] - Deprecated phpbb_clean_path() does not work anymore
  • +
  • [PHPBB3-13231] - The migration contact_admin_form must depends on config_db_text
  • +
  • [PHPBB3-13232] - Email queue does not get run
  • +
  • [PHPBB3-13234] - Remember me cookie gets unset by admin reauthentication
  • +
+

Improvement

+
    +
  • [PHPBB3-13207] - Default subscription notification setting for new users does not include email
  • +
+

Task

+ + +

Changes since 3.1.0-RC5

+ +

Bug

+
    +
  • [PHPBB3-12530] - Visual confirmation is breaking layout in prosilver's mobile mode
  • +
  • [PHPBB3-12568] - docs/README.html references MODs instead of extensions
  • +
  • [PHPBB3-13124] - PHP event extractor too strict on doc blocks
  • +
  • [PHPBB3-13138] - Banned users cause infinite recursion
  • +
  • [PHPBB3-13140] - Header links don't re-appear on window size increase
  • +
  • [PHPBB3-13161] - PHP Warnings issued from phpbb database test case
  • +
  • [PHPBB3-13163] - Header Navbar Responsiveness Broken
  • +
  • [PHPBB3-13164] - Data sent to core.submit_post_end event does not include fresh post_visibility
  • +
  • [PHPBB3-13168] - Warning displayed in PHP 5.6 for mbstring.http_input
  • +
  • [PHPBB3-13169] - Responsive forms not displaying correctly in RTL
  • +
  • [PHPBB3-13171] - Can not delete posts and soft delete topics in MCP topic view
  • +
  • [PHPBB3-13174] - Minor HTML error in ucp_pm_viewmessage.html (needs closing </div>)
  • +
  • [PHPBB3-13177] - Post count-based ranks do not display in viewtopic
  • +
  • [PHPBB3-13181] - Sphinx config template should use place holders for database credentials
  • +
  • [PHPBB3-13186] - Do not link post count to author search if search disabled
  • +
  • [PHPBB3-13187] - INSTALL.html is not valid HTML
  • +
  • [PHPBB3-13188] - Sphinx index() function triggers slow queries that time out replies
  • +
  • [PHPBB3-13190] - phpbb_session_login_keys_test::test_reset_keys fails on develop-ascraeus
  • +
  • [PHPBB3-13194] - BBCode isn't parsed when issuing a warning for a post
  • +
  • [PHPBB3-13203] - Use constant time comparison method for comparing password hashes
  • +
  • [PHPBB3-13217] - Remember me cookie leak
  • +
  • [PHPBB3-13218] - Missing token check in acp_styles
  • +
  • [PHPBB3-13221] - Can't upgrade to 3.1 from 3.0.11 and older
  • +
  • [PHPBB3-13223] - Using get_username_string() for email template variables causes HTML markup in emails
  • +
+

Improvement

+
    +
  • [PHPBB3-12796] - View own Profile should have an edit button
  • +
  • [PHPBB3-12799] - Place the events for f_brunoais_read_other
  • +
  • [PHPBB3-13041] - help_faq.php language file needs to be revised
  • +
+

New Feature

+ + + +

Changes since 3.1.0-RC4

+ +

Bug

+
    +
  • [PHPBB3-10729] - Post editor information is not updated when user being deleted with posts
  • +
  • [PHPBB3-11224] - SQL cache destroy does not destroy queries to tables joined
  • +
  • [PHPBB3-12368] - Updating database fails in upgrade from 3.0 when trying twice without purging the cache
  • +
  • [PHPBB3-12489] - Description for Contact link in custom profile fields
  • +
  • [PHPBB3-12657] - Add a test file for cli command cache:purge
  • +
  • [PHPBB3-12858] - 'GMT' is hard coded and not pulled from language files
  • +
  • [PHPBB3-12889] - multi-select element in unban email-adresses not limited in width
  • +
  • [PHPBB3-13011] - Javascript bug when selecting first one or two characters of a post
  • +
  • [PHPBB3-13027] - PM folder full percentage could be a bit more accurate
  • +
  • [PHPBB3-13033] - Duplicate entry SQL error thrown when running notifications_use_full_name migration
  • +
  • [PHPBB3-13045] - Pragma header not specified as response header by RFC2616
  • +
  • [PHPBB3-13048] - AJAX requests are being stored to session_page
  • +
  • [PHPBB3-13055] - String profile fields validation limits content to latin chars only
  • +
  • [PHPBB3-13070] - Wrong hook name is registered for array(template, display)
  • +
  • [PHPBB3-13071] - total_match_count is used before core.search_get_posts_data event
  • +
  • [PHPBB3-13080] - Responsive design - language variable to long
  • +
  • [PHPBB3-13082] - Search box does not displayed proper in admin cp when no logs listed
  • +
  • [PHPBB3-13085] - Fix typo in oauth.php
  • +
  • [PHPBB3-13086] - Update ACP_MASS_EMAIL_EXPLAIN language key
  • +
  • [PHPBB3-13087] - WLM link is empty in viewtopic
  • +
  • [PHPBB3-13097] - Fix missing unit type in forms.css
  • +
  • [PHPBB3-13104] - Responsive tabs display bug in IE11
  • +
  • [PHPBB3-13105] - Future dates are displayed as "Tomorrow" with relative date format
  • +
  • [PHPBB3-13111] - Debug output when editing DropDown Custom Fields with multiple languages
  • +
  • [PHPBB3-13113] - The routes are not always generated for the good app.php file
  • +
  • [PHPBB3-13116] - Topic and post approval notifications got interchanged
  • +
  • [PHPBB3-13117] - Installation fails on MySQL 5.7 because auto_increment columns can be NULL
  • +
  • [PHPBB3-13118] - datetime.class parameter not used in user class
  • +
  • [PHPBB3-13120] - phpbb_load_extensions_autoloaders() doesn't work very well with the extensions behind a symlink
  • +
  • [PHPBB3-13121] - Customise Purge Cache always returns user to Styles page
  • +
  • [PHPBB3-13125] - Uploaded avatars are not displayed in IE <= 7
  • +
+

Improvement

+
    +
  • [PHPBB3-12408] - Add quick setting for "default guest style" to ACP board settings
  • +
  • [PHPBB3-12985] - Add event to modify the redirect after a successful login
  • +
  • [PHPBB3-12993] - Add event to get_user_rank() function
  • +
  • [PHPBB3-13025] - Add template events for buttons on viewforum and viewtopic
  • +
  • [PHPBB3-13059] - Add core event to generate_page_link() to allow modifying pagination URLs
  • +
  • [PHPBB3-13072] - Add total_match_count to core.search_get_topic_data event
  • +
  • [PHPBB3-13077] - Change module order in Customise tab for better usability
  • +
  • [PHPBB3-13094] - Remove the search box if there are no new posts to search for
  • +
  • [PHPBB3-13107] - Add template events to forum row in forumlist_body.html
  • +
  • [PHPBB3-13108] - Add core event to the parse_attachments() function to allow modifying files info
  • +
  • [PHPBB3-13110] - Add core event to the page_footer() function to allow handling overall output
  • +
  • [PHPBB3-13122] - phpbb_wrapper_gmgetdate_test intermittently fails
  • +
  • [PHPBB3-13134] - Add core event to the root of the function display_forums()
  • +
  • [PHPBB3-13137] - Remove schema.json from repository
  • +
+

Sub-task

+
    +
  • [PHPBB3-12929] - Add an event when getting the information for PM composal
  • +
  • [PHPBB3-12930] - Add an event to the query getting the post for quoting in a PM
  • +
+

Task

+
    +
  • [PHPBB3-10794] - Make schema available at runtime
  • +
  • [PHPBB3-12987] - Cleanup the services.yml file
  • +
  • [PHPBB3-13106] - Remove the \phpbb\di\pass\kernel_pass class
  • +
  • [PHPBB3-13119] - Add events to mcp and acp ban modules
  • +
  • [PHPBB3-13123] - Add events to allow post blocking and post pre/past processing
  • +
+ +

Changes since 3.1.0-RC3

+ +

Bug

+
    +
  • [PHPBB3-10472] - ACP "add multiple smilies" page is unusable on 1024x768 resolution
  • +
  • [PHPBB3-11909] - phpbb/db/migrator::load_migrations is never called
  • +
  • [PHPBB3-12258] - Add attachment: error alert popup on "empty.png" does not show up
  • +
  • [PHPBB3-12506] - Long post titles bump the username down an extra row beneath the edit/quote/delete buttons
  • +
  • [PHPBB3-12658] - Add tests for config:* cli commands
  • +
  • [PHPBB3-12661] - Extensions templates not loaded from "all" by helper/render()
  • +
  • [PHPBB3-12734] - Custom profile manager should not suppress errors when inserting user rows
  • +
  • [PHPBB3-12765] - acp_profile.php should use db/tools
  • +
  • [PHPBB3-12852] - \phpbb\path_helper get_url_parts does not handle get variable with no value
  • +
  • [PHPBB3-12856] - plupload images are not integrated into style-path
  • +
  • [PHPBB3-12862] - Smiley and Whos Onlike pop-up boxes are making styling difficult
  • +
  • [PHPBB3-12949] - Undefined function mime_content_type()
  • +
  • [PHPBB3-12966] - Undefined sorting of posts with same post_time on postgres
  • +
  • [PHPBB3-12975] - Catchable fatal error after update to RC3
  • +
  • [PHPBB3-12976] - Pagination of UCP manage attachments page in prosilver does not support plural forms
  • +
  • [PHPBB3-12983] - UCP preferences, Display posts ordering by: input is not properly validated
  • +
  • [PHPBB3-12984] - Index page: blank line when no forum description shown
  • +
  • [PHPBB3-12986] - Wrong functions call order breaks detection of common words in search
  • +
  • [PHPBB3-12990] - The prefix for the notification's services is harcoded
  • +
  • [PHPBB3-12996] - tests/lock/flock_test.php should use microtime() instead of time()
  • +
  • [PHPBB3-12998] - Undefined $lang in mcp_warn.php::add_warning()
  • +
  • [PHPBB3-13004] - Topic tools button is displayed even if dropdown is empty
  • +
  • [PHPBB3-13008] - Importing a resource in routing.yml breaks download/file.php and ACP
  • +
  • [PHPBB3-13009] - Cleanup Tweaks CSS, Remove outdated browser support
  • +
  • [PHPBB3-13018] - Key binding on AJAX popups are not unbound upon close/cancel
  • +
  • [PHPBB3-13019] - Don't display "Soft delete reason" dialog when moderator cannot soft-delete
  • +
  • [PHPBB3-13022] - "Return to advanced search" wrong assumption
  • +
  • [PHPBB3-13031] - Impossible to properly upload image if no proper mimetype guessers enabled
  • +
  • [PHPBB3-13035] - Empty meta tags in header
  • +
  • [PHPBB3-13040] - W3C validator warning in overral_footer.html
  • +
  • [PHPBB3-13042] - Unused var in login_box()
  • +
  • [PHPBB3-13044] - Expires header violates RFC 2616
  • +
  • [PHPBB3-13046] - In download/avatar we don't load the vendors added by the extensions
  • +
  • [PHPBB3-13050] - Allow topic/forum subscription when email and jabber are off
  • +
  • [PHPBB3-13051] - Fix broken viewonline core event
  • +
  • [PHPBB3-13052] - Remove additional parameters from check_form_key()
  • +
  • [PHPBB3-13057] - Fatal error on previous page link after closing a report
  • +
  • [PHPBB3-13065] - Unknown column 'user_pass_convert' in 'field list' [code] - => 1054
  • +
  • [PHPBB3-13068] - Language correction in FIELD_IS_CONTACT_EXPLAIN
  • +
  • [PHPBB3-13069] - Timezone selector does not filter locations on change
  • +
+

Improvement

+
    +
  • [PHPBB3-12416] - WhoIs Pop Up Page Details
  • +
  • [PHPBB3-12598] - Improve action-bar search box styling
  • +
  • [PHPBB3-12653] - Caches the informations about the listeners to be able to not load them everytime
  • +
  • [PHPBB3-12900] - 3.1.0 avatar scaling
  • +
  • [PHPBB3-12943] - Add core.phpbb_generate_debug_output core event
  • +
  • [PHPBB3-12961] - Add link in anti-spam ACP page which links directly to captchas in titania
  • +
  • [PHPBB3-12969] - Add template event around the find username link on composing pm
  • +
  • [PHPBB3-12982] - JS in 3.1 is nasty
  • +
  • [PHPBB3-12989] - Remove unused "created_by.jpg" from prosilver
  • +
  • [PHPBB3-12991] - Have events after/before "add warning" field - user and post
  • +
  • [PHPBB3-12994] - Add core event to viewtopic.php before sending vars to template
  • +
  • [PHPBB3-13003] - Missing language keys in command "extension:show"
  • +
  • [PHPBB3-13005] - Add core event to display_forums() to modify category template data
  • +
  • [PHPBB3-13006] - Add variables to the 'core.modify_quickmod_actions' event
  • +
  • [PHPBB3-13010] - phpbb_get_avatar() incorrectly refers to \phpbb\avatar\driver\driver::clean_row()
  • +
  • [PHPBB3-13020] - Add var to core.viewforum_get_topic_data event to allow modifying forum template data
  • +
  • [PHPBB3-13024] - Template event viewtopic_body_postrow_post_content_footer
  • +
  • [PHPBB3-13026] - Add template vars array to core.viewonline_overwrite_location to allow modifying/adding template vars
  • +
  • [PHPBB3-13034] - Add ability to access extensions outside the phpBB root
  • +
  • [PHPBB3-13036] - Controller helper route method should be able to generate absolute URL's
  • +
  • [PHPBB3-13038] - Link user post tally to their posts
  • +
  • [PHPBB3-13047] - Add $post_list array to core.viewtopic_modify_page_title core event
  • +
  • [PHPBB3-13056] - Move the arguments of the request class to the DI
  • +
  • [PHPBB3-13058] - The "jump to page" input does not have a min attribute.
  • +
  • [PHPBB3-13061] - Use a compiler pass to replace the service event.subscriber_loader
  • +
  • [PHPBB3-13062] - Add viewforum.php core event to allow modifying sql query to select topic ids
  • +
  • [PHPBB3-13066] - Add common search results core event to modify search title
  • +
+

New Feature

+ +

Sub-task

+
    +
  • [PHPBB3-12928] - [Event] - core.mcp_reports_gather_query_before
  • +
+

Task

+ + + +

Changes since 3.1.0-RC2

+ +

Bug

+
    +
  • [PHPBB3-11148] - Fix uploading attachments from Android 4 powered devices
  • +
  • [PHPBB3-11480] - Prevent Private Message system from returning "Unknown folder" when inbox folder is full
  • +
  • [PHPBB3-11520] - Post count not incremented when you fork a topic
  • +
  • [PHPBB3-11854] - Captcha code is still in includes/
  • +
  • [PHPBB3-12232] - MCP Banning: Max execution time exceeded
  • +
  • [PHPBB3-12448] - Migration tools don't allow adding columns with default == NULL
  • +
  • [PHPBB3-12492] - DB_TEST: Special chars are not supported.
  • +
  • [PHPBB3-12535] - The profile link should be better adjusted to the avatar image it surrounds in viewtopic.php
  • +
  • [PHPBB3-12685] - CLI doesn't load extension commands
  • +
  • [PHPBB3-12710] - phpBB 3.0.12 on Oracle fails to upgrade to 3.1.0
  • +
  • [PHPBB3-12718] - Hard Deleting Post does not Decrease Post Count
  • +
  • [PHPBB3-12742] - Notifications duplicate code that requires an event
  • +
  • [PHPBB3-12744] - RTL board header is one line higher than LTR
  • +
  • [PHPBB3-12748] - UCP Terms of Use Typo
  • +
  • [PHPBB3-12770] - search_wordmatch unique key name is too long
  • +
  • [PHPBB3-12776] - docs/INSTALL.html is missing 3.0 to 3.1 update instructions
  • +
  • [PHPBB3-12789] - Cached directories are not deleted when the cache is purged (with ACM memory enabled).
  • +
  • [PHPBB3-12791] - String profile fields do not use links, smilies and line breaks in memberlist
  • +
  • [PHPBB3-12792] - Profile field type strings function get_profile_contact_value duplicates raw()
  • +
  • [PHPBB3-12793] - String '0' does not display for string profile fields
  • +
  • [PHPBB3-12794] - Google+ profile field validation is too strict
  • +
  • [PHPBB3-12809] - RTL styling issues with new jump-box dropdown
  • +
  • [PHPBB3-12814] - Error while trying to setup LDAP Authentication in ACP
  • +
  • [PHPBB3-12822] - Preselect avatar type if only 1 type is enabled
  • +
  • [PHPBB3-12837] - Viewing contact form displays "VIEWING_MEMBERS" on viewonline
  • +
  • [PHPBB3-12842] - Out of memory issue in code sniffer call for extensions
  • +
  • [PHPBB3-12843] - When you click on "Mark forums read" in the browser, a console error occurs
  • +
  • [PHPBB3-12844] - $dbpasswd is cleared too early in connection manager
  • +
  • [PHPBB3-12845] - HTML5 Invalid using role="navigation"
  • +
  • [PHPBB3-12846] - SQLite3 bug in profilefield_base_migration.php
  • +
  • [PHPBB3-12849] - ReferenceError in core.js
  • +
  • [PHPBB3-12851] - Font colour button title is not consistent with other buttons
  • +
  • [PHPBB3-12853] - Problems with ACP/MCP links in mobile design with other translations
  • +
  • [PHPBB3-12854] - Admin contact page should not be used when board emails are disabled
  • +
  • [PHPBB3-12855] - Container is being recompiled on every page request although DEBUG_CONTAINER is not set
  • +
  • [PHPBB3-12859] - Missing post button events from view pm template
  • +
  • [PHPBB3-12870] - Console database migrate function can not update from 3.0.12 to 3.1
  • +
  • [PHPBB3-12873] - Wrong identifier tested in \db\tools\sql_create_(unique_)index()
  • +
  • [PHPBB3-12875] - Extension's info_acp_lang files don't fallback correctly when the user's language is not included in the extension
  • +
  • [PHPBB3-12881] - Debug error - Undefined index: mark_time
  • +
  • [PHPBB3-12882] - $config['search_type'] - is not correctly updated when updating from 3.0 to 3.1
  • +
  • [PHPBB3-12883] - Do not use basename() to get the search class in phpbb\cron\task\core\tidy_search
  • +
  • [PHPBB3-12886] - Redundant lock and unlock expressions for QuickMod in viewtopic.php
  • +
  • [PHPBB3-12887] - Typo in timezone handling code: 'offest' should be 'offset'
  • +
  • [PHPBB3-12891] - Long page generation time when banlist is long
  • +
  • [PHPBB3-12895] - ?style=1 appended to url after using the UCP
  • +
  • [PHPBB3-12898] - In cron.php we try to release the lock after the call to garbage_collection()
  • +
  • [PHPBB3-12901] - Wrong type hint in show_available_child_styles() doc block
  • +
  • [PHPBB3-12902] - Remove duplicate entry in build_cfg_template() switch statement
  • +
  • [PHPBB3-12903] - Remove unused method in phpBB/phpbb/extension/metadata_manager.php
  • +
  • [PHPBB3-12908] - Fix broken operator assignment in increment.php
  • +
  • [PHPBB3-12909] - Use correct lang vars in cli extension enable
  • +
  • [PHPBB3-12910] - Profile fields: Two "simple text field" in dropdown menu
  • +
  • [PHPBB3-12912] - Undefined index when adding logs from extensions
  • +
  • [PHPBB3-12918] - Functional Tests Suite does not run on its own
  • +
  • [PHPBB3-12919] - Allow using class names as module identifier for extensions
  • +
  • [PHPBB3-12922] - Posts per page in MCP should have a minimum value of zero
  • +
  • [PHPBB3-12931] - General error on user registration when domain name is not set
  • +
  • [PHPBB3-12932] - Easy support of non-gregorian calendars
  • +
  • [PHPBB3-12937] - Without config file, extract($phpbb_config_php_file->get_all()); breaks
  • +
  • [PHPBB3-12938] - Board floods "store"-directory with packed attachments
  • +
  • [PHPBB3-12940] - Unused 'use' statements in download/file.php
  • +
  • [PHPBB3-12950] - Functional tests can not be run anymore if another language is present
  • +
  • [PHPBB3-12954] - Nginx setup on travis returns wrong SCRIPT_NAME info
  • +
  • [PHPBB3-12956] - Unknown column 'field_is_contact' in 'field list'
  • +
  • [PHPBB3-12964] - Undefined $row in download/file.php
  • +
  • [PHPBB3-12967] - Undefined variable: phpbb_dispatcher in mcp_queue.php
  • +
  • [PHPBB3-12970] - chema.json is not up to date with migration files
  • +
+

Improvement

+
    +
  • [PHPBB3-9165] - Extend template loop to allow iteration step modification
  • +
  • [PHPBB3-10073] - Contact page
  • +
  • [PHPBB3-12051] - Optimise Composer Autoloader on Build
  • +
  • [PHPBB3-12560] - Add methods to set upload and temp paths in Plupload class
  • +
  • [PHPBB3-12656] - Translate existing CLI commands
  • +
  • [PHPBB3-12663] - Extract Command Line Interface language strings into their own file.
  • +
  • [PHPBB3-12671] - Possibility to use NOT LIKE expression
  • +
  • [PHPBB3-12693] - Add a travis test that checks file permissions
  • +
  • [PHPBB3-12738] - Move related code from functions_posting into remove_post_from_statistic()
  • +
  • [PHPBB3-12778] - The automatic updater should have an option to automatically delete removed files during update
  • +
  • [PHPBB3-12828] - Add includes/ucp/ucp_prefs.php common core event to allow additional actions before the page load
  • +
  • [PHPBB3-12832] - Add footer links to the Quick Links menu
  • +
  • [PHPBB3-12836] - [Event] - core.functions.redirect
  • +
  • [PHPBB3-12841] - Allow extensions to position new config vars in an array
  • +
  • [PHPBB3-12847] - Allow extensions to define if they can be enabled
  • +
  • [PHPBB3-12857] - Add template events overall_header_breadcrumbs_before/after
  • +
  • [PHPBB3-12864] - Have an EVENT tag after STYLESHEETS in overall_header
  • +
  • [PHPBB3-12871] - Add PHPBB_DISPLAY_LOAD_TIME constant to config.php on installation
  • +
  • [PHPBB3-12872] - Add poster_id to viewtopic_modify_post_row
  • +
  • [PHPBB3-12884] - Add core event to the function upload_attachment()
  • +
  • [PHPBB3-12892] - S_NUM_ROWS does not scale
  • +
  • [PHPBB3-12896] - Add event in acp_main to allow php checks for admin notices
  • +
  • [PHPBB3-12906] - Add rel="help" to FAQ link
  • +
  • [PHPBB3-12913] - Add more parameters to core.submit_post_end event
  • +
  • [PHPBB3-12942] - Add core.add_form_key core event
  • +
  • [PHPBB3-12944] - Add core.login_forum_box core event
  • +
  • [PHPBB3-12953] - Page title not updated when notifications are marked as read
  • +
+

Sub-task

+
    +
  • [PHPBB3-12800] - [Event] - Create core.functions_display.display_user_activity.actives_after
  • +
  • [PHPBB3-12801] - [Event] - core.functions_posting.load_drafts_draft_list_results
  • +
  • [PHPBB3-12876] - [Event] - core.mcp_mcp_front.mcp_front_view_queue_postid_list_after
  • +
  • [PHPBB3-12880] - [Event] - core.mcp_queue_!is_topics_query_before
  • +
  • [PHPBB3-12927] - [Event] - core.mcp_queue_get_posts2_query_before
  • +
+

Task

+
    +
  • [PHPBB3-10404] - Remove create_function from includes/acp/auth.php
  • +
  • [PHPBB3-12557] - Fix doc block errors found by Sami
  • +
  • [PHPBB3-12826] - Investigate "catch (Exception"
  • +
  • [PHPBB3-12860] - Add template events to mcp_ban.html
  • +
  • [PHPBB3-12861] - Add event before assigning the posts to the template
  • +
  • [PHPBB3-12917] - Move commit check and file executable checks to 5.3.3 build on travis
  • +
  • [PHPBB3-12920] - Create composer installable app and core packages with subtree split
  • +
  • [PHPBB3-12941] - Check for Sami documentation errors on Travis CI
  • +
  • [PHPBB3-12948] - Remove Travis CI "broken opcache on PHP 5.5.7 and 5.5.8" workaround.
  • +
+ +

Changes since 3.1.0-RC1

+ +

Bug

+
    +
  • [PHPBB3-9801] - Users on custom pages outside the board directory are being displayed on Index page
  • +
  • [PHPBB3-11392] - "Make normal" in quickmod tool does not ajaxify correctly
  • +
  • [PHPBB3-12325] - Automatic update should notify about outdated files
  • +
  • [PHPBB3-12420] - Reduce config.php inclusions in DIC code
  • +
  • [PHPBB3-12446] - Unnecessary db connect - function phpbb_bootstrap_enabled_exts
  • +
  • [PHPBB3-12462] - Do not use string "None" for different avatar options
  • +
  • [PHPBB3-12515] - FULLTEXT_POSTGRES_TS_NOT_USABLE and FULLTEXT_POSTGRES_VERSION_CHECK_EXPLAIN redundant
  • +
  • [PHPBB3-12605] - Make dropdowns uniform
  • +
  • [PHPBB3-12674] - Last edited by in PMs doesn't show user colour
  • +
  • [PHPBB3-12680] - Contact icons in viewtopic are missing alternative text
  • +
  • [PHPBB3-12695] - Undefined index: MISSING_INLINE_ATTACHMENT notice given when viewing post details
  • +
  • [PHPBB3-12716] - Wrong method call in phpbb\auth\provider\oauth\token_storage
  • +
  • [PHPBB3-12759] - Profile fields lang value db queries can cause query flood
  • +
  • [PHPBB3-12760] - Post approval icon for wrong topics in Last Post column
  • +
  • [PHPBB3-12764] - Wrong error message on install if mysqli is selected and the credentials are wrong
  • +
  • [PHPBB3-12766] - Event exporter does not like RCx as version
  • +
  • [PHPBB3-12768] - 'NOTIFICATION_REPORT_CLOSED' entry has wrong indentation
  • +
  • [PHPBB3-12771] - Bug in \phpbb\db\migration\profilefield_base_migration when used in extensions
  • +
  • [PHPBB3-12772] - Fatal error when "Email topic" is used in topic tools
  • +
  • [PHPBB3-12773] - Fix language variable name in cli extension enable command
  • +
  • [PHPBB3-12774] - Undefined variable $phpbb_adm_relative_path in phpbb_create_install_container()
  • +
  • [PHPBB3-12781] - Template regex for DEFINE has problems when enclosed by other template conditionals
  • +
  • [PHPBB3-12783] - Remove require: phpbb/phpbb from Extensions composer.json files
  • +
  • [PHPBB3-12787] - Incorrect generated url when using ajax and routing
  • +
  • [PHPBB3-12788] - Update Symfony suite from 2.3.12 to 2.3.16
  • +
  • [PHPBB3-12790] - Always use the interface when available (and not directly the class)
  • +
  • [PHPBB3-12802] - Properly handle connection errors in SQLite3
  • +
  • [PHPBB3-12808] - Small gap between username and drop-down arrow
  • +
  • [PHPBB3-12810] - In acp_forums the displayed value for prune_shadow_freq is the value of prune_freq
  • +
  • [PHPBB3-12811] - Margin Bottom not taking effect in Safari with 101% height on same element
  • +
  • [PHPBB3-12815] - Members list link hidden from guests who have permission to view members list page
  • +
  • [PHPBB3-12816] - Fix comment about logs in user_ban function
  • +
  • [PHPBB3-12818] - Deleting a log entry in MCP produces a General error
  • +
  • [PHPBB3-12819] - Wrong text on hover over "Jump to page" field
  • +
  • [PHPBB3-12825] - Allow the extensions to be tested with the sniffer and skip the vendors
  • +
  • [PHPBB3-12830] - .postlink is in colours.css doubled, one should be deleted
  • +
  • [PHPBB3-12834] - Viewonline only matches routes
  • +
  • [PHPBB3-12839] - Missing stylesheet when it is not updated
  • +
+

Improvement

+
    +
  • [PHPBB3-12013] - Quickmod tools and jumpbox should use new dropdown
  • +
  • [PHPBB3-12099] - path_helper returns wrong web root path for ajax requests
  • +
  • [PHPBB3-12196] - Referer vs Referrer in language files
  • +
  • [PHPBB3-12197] - Fix misleading FAQ entries
  • +
  • [PHPBB3-12334] - Add raw values of profile fields to template
  • +
  • [PHPBB3-12562] - Prosilver has no max-width
  • +
  • [PHPBB3-12645] - Update support links to 3.1 forums
  • +
  • [PHPBB3-12662] - Reorganize and modernize the header navbar
  • +
  • [PHPBB3-12735] - Remove all :link, :visited, :active link states
  • +
  • [PHPBB3-12777] - Rename extension status functions and add is_configured()
  • +
  • [PHPBB3-12779] - Change order of file lists on automatic update
  • +
  • [PHPBB3-12782] - Use an interface for the phpbb event_dispatcher
  • +
  • [PHPBB3-12784] - Allow the extensions to add a custom auto loader
  • +
  • [PHPBB3-12786] - Extend profilefield_base_migration.php class
  • +
  • [PHPBB3-12812] - Add a migrator tool for config_text database changes
  • +
  • [PHPBB3-12813] - Improve responsive pagination location and fix page-jump title
  • +
  • [PHPBB3-12823] - Remove trailing whitespace from CSS files
  • +
  • [PHPBB3-12824] - Move ACP & MCP links in the header to the end of the link list
  • +
  • [PHPBB3-12827] - Reorder quick-links
  • +
+

Task

+
    +
  • [PHPBB3-12775] - Refactor functions_container into class container_builder
  • +
  • [PHPBB3-12829] - Remove check for pgsql 8.3/8.2
  • +
+ +

Changes since 3.1.0-b4

+ +

Bug

+
    +
  • [PHPBB3-8610] - Splitting and merging topics does not handle subscriptions and bookmarks correctly
  • +
  • [PHPBB3-10899] - Using Delete All in log viewer with keyword search
  • +
  • [PHPBB3-11331] - Inform admin of incorrect avatar path instead of stripping unexpected parts from destination path
  • +
  • [PHPBB3-11445] - Suboptimal number of query complexity in phpbb_notification_manager::get_global_subscriptions()
  • +
  • [PHPBB3-11467] - phpbb_extension_metadata_manager uses hard coded language for exceptions
  • +
  • [PHPBB3-11659] - Information about file_upload is missing from the requirement page
  • +
  • [PHPBB3-11942] - Delete post/topic reason should be added to the generated log entry
  • +
  • [PHPBB3-12109] - Bug when setting users forum permissions with "Select all users" checkbox
  • +
  • [PHPBB3-12209] - OAuth Authentication in ACP does not explain that it allows regular login too
  • +
  • [PHPBB3-12332] - Attachments with long file names break the Uploader layout
  • +
  • [PHPBB3-12352] - The service definition "auth.provider.smf" does not exist.
  • +
  • [PHPBB3-12443] - Responsive tabs broken in IE
  • +
  • [PHPBB3-12457] - Gallery avatar category "Main" is empty
  • +
  • [PHPBB3-12508] - phpbb\finder (currently phpbb\extension\finder) should not depend on extension manager
  • +
  • [PHPBB3-12521] - When selecting the target to merge two topics, the last column is pushed on a new line
  • +
  • [PHPBB3-12552] - [RTL] - Forum list content forced into single char column when responsive
  • +
  • [PHPBB3-12553] - Right-to-left language bugs in prosilver
  • +
  • [PHPBB3-12566] - "Private messages" in viewtopic.php should be "Send pivate message"
  • +
  • [PHPBB3-12589] - The finder should search directly in $directory if it's an absolute sub-path
  • +
  • [PHPBB3-12612] - Front-facing files should not contain functions
  • +
  • [PHPBB3-12615] - Improper clearing of .topic-actions leads to float problems
  • +
  • [PHPBB3-12637] - coding-guidelines.html contains invalid HTML
  • +
  • [PHPBB3-12638] - Call to undefined function phpbb\db\migration\data\v30x\phpbb_require_updated() when not using autoupdate package
  • +
  • [PHPBB3-12639] - Delete entry in admin-log leads to mysql-error
  • +
  • [PHPBB3-12640] - Posting editor tab "attachments" is unclicked in IE8
  • +
  • [PHPBB3-12641] - With IE8 logged in to ACP error message appears in the browser
  • +
  • [PHPBB3-12643] - Cannot convert SQLite DB from 3.0.12 to 3.1.0
  • +
  • [PHPBB3-12652] - Deleting marked log entries leads to MySQL Error
  • +
  • [PHPBB3-12660] - Undefined offset error when phpinfo() disabled and debug enabled
  • +
  • [PHPBB3-12665] - develop/migration_tips.php should not find extension tips
  • +
  • [PHPBB3-12667] - New posts in a topic cause undesirable results when clicking topic title or page button
  • +
  • [PHPBB3-12672] - Make <Tab> inside [code] - more user friendly
  • +
  • [PHPBB3-12673] - PLUPLOAD fails due missing constant IMAGETYPE_SWC
  • +
  • [PHPBB3-12675] - Fix code sniffer complaints in 3.1.0-b5-dev code
  • +
  • [PHPBB3-12682] - Code Sniffer does not work correctly on Travis CI.
  • +
  • [PHPBB3-12688] - Rank images do not work on routes
  • +
  • [PHPBB3-12694] - Remove whitespace at end of line from acp_groups
  • +
  • [PHPBB3-12697] - Database Test Case Must Purge Extension Schema When Done
  • +
  • [PHPBB3-12705] - make_clickable is using static variables incorrectly
  • +
  • [PHPBB3-12707] - \phpbb\db\driver\phpbb\db\driver\mysql is tried being loaded
  • +
  • [PHPBB3-12708] - [ROOT] -/install/install_main.php still uses docs/COPYING
  • +
  • [PHPBB3-12709] - Duplicate entries in the posting attachments tab
  • +
  • [PHPBB3-12711] - Contact form migration fails on MSSQL
  • +
  • [PHPBB3-12712] - Password conversion migration fails on MSSQL
  • +
  • [PHPBB3-12715] - Mistakes in the doc blocks
  • +
  • [PHPBB3-12720] - Git commit hook should not require commit message to start with a capital letter
  • +
  • [PHPBB3-12728] - Enforce box-model for image attachments
  • +
  • [PHPBB3-12741] - Functional tests on Travis fail since php update last night
  • +
  • [PHPBB3-12746] - Failing test: tests/content_visibility/delete_post_test.php
  • +
  • [PHPBB3-12747] - Drop Firebird support
  • +
  • [PHPBB3-12750] - Install/Update footer is not centered anymore
  • +
  • [PHPBB3-12752] - Cron list tests fail on windows with ansi support
  • +
  • [PHPBB3-12753] - FIELD_INVALID_CHARS_ALPHA_PUNCTUATION is not localized
  • +
  • [PHPBB3-12755] - Remote upload stuck in infinite loop if server sends keep-alive
  • +
  • [PHPBB3-12756] - Fatal error with mysqli_fetch_assoc on hhvm
  • +
  • [PHPBB3-12761] - Remove the execute bit from functions_user.php
  • +
  • [PHPBB3-12762] - Make ext.php optional for extensions
  • +
  • [PHPBB3-12763] - Do not unnecessarily rewrite install/schemas/*_schema.sql when updating schema.json file
  • +
+

Improvement

+
    +
  • [PHPBB3-11266] - Use our own error message when composer is not set up
  • +
  • [PHPBB3-12532] - Add header_navbar_username_prepend/append template events.
  • +
  • [PHPBB3-12541] - Activate attachments tab when files are dropped into textarea
  • +
  • [PHPBB3-12563] - Language key names in ACP styles are misleading
  • +
  • [PHPBB3-12606] - PHP events in /includes/acp/acp_groups.php
  • +
  • [PHPBB3-12608] - Improve notifications drop-down menu styling in header
  • +
  • [PHPBB3-12613] - Improve pagination styling and jump-to-page dialog
  • +
  • [PHPBB3-12646] - Add data attribute to breadcrumb links
  • +
  • [PHPBB3-12648] - Improve UCP/MCP/Posting tabs styling & problems
  • +
  • [PHPBB3-12655] - Allow the CLI to be used as a shell
  • +
  • [PHPBB3-12664] - Refactor develop/migration_tips.php into a console command
  • +
  • [PHPBB3-12666] - Use "None" for images in gallery avatar path root and rename lang key
  • +
  • [PHPBB3-12668] - Add ability to modify subforums template data for core.display_forums_modify_template_vars event
  • +
  • [PHPBB3-12669] - Add core event to the function display_forums() for additional template data
  • +
  • [PHPBB3-12677] - Remove comment about ‘threading’
  • +
  • [PHPBB3-12687] - Add a constant to dissociate the displaying of the load time from DEBUG
  • +
  • [PHPBB3-12690] - Add core.submit_pm_after event
  • +
  • [PHPBB3-12691] - Add core.delete_pm to funtion delete_pm.
  • +
  • [PHPBB3-12704] - Improve the load time information in the footer when enabled
  • +
  • [PHPBB3-12706] - Ignore additional languages and styles from git
  • +
  • [PHPBB3-12714] - Better align the description of radio buttons to avoid confusion with the forum list in attachments settings
  • +
  • [PHPBB3-12740] - Stop Using IDs as CSS selectors
  • +
  • [PHPBB3-12758] - Add 'show_results' mode var to event core.search_modify_rowset
  • +
+

New Feature

+
    +
  • [PHPBB3-12597] - Command for executing all available cron tasks
  • +
  • [PHPBB3-12602] - Add command to print the cron list
  • +
  • [PHPBB3-12607] - CLI command for running a specific cron task
  • +
+

Sub-task

+ +

Task

+
    +
  • [PHPBB3-11528] - Use mink for acceptance tests involving javascript execution
  • +
  • [PHPBB3-12514] - Add additional tests for custom profile fields type
  • +
  • [PHPBB3-12696] - Add events to ucp_register.html
  • +
  • [PHPBB3-12701] - Add events to user_add function
  • +
  • [PHPBB3-12723] - Add Code Sniffer sniff ensuring PHP files use the correct file header
  • +
  • [PHPBB3-12726] - Add Code Sniffer sniff ensuring PHP files do not contain any unused use statements
  • +
  • [PHPBB3-12757] - Add a Code Sniffer ruleset for PHP files of phpBB extensions
  • +
+ + +

Changes since 3.1.0-b3

+ +

Bug

+
    +
  • [PHPBB3-10176] - Imageset Appearance Problem with Google Chrome Browser.
  • +
  • [PHPBB3-11226] - filespec::move_file() from functions_upload.php does not error correctly
  • +
  • [PHPBB3-11232] - prosilver ajax.js does not respect PHPBB_USE_BOARD_URL_PATH
  • +
  • [PHPBB3-11366] - Add "MOD Version Check" for extensions to the core
  • +
  • [PHPBB3-11497] - The extension finder keeps state, so should be instantiated on each container request, not reset manually
  • +
  • [PHPBB3-12025] - Post Preview no longer shows UNAUTHORISED_BBCODE warning for disallowed BBcodes
  • +
  • [PHPBB3-12074] - Enabling/Disabling/Data deleting of an extension should generate a log entry
  • +
  • [PHPBB3-12174] - "Download all attachments" link displayed when the topic has attachments in hidden posts only
  • +
  • [PHPBB3-12185] - Topic header in viewforum too small for translation
  • +
  • [PHPBB3-12270] - Approving a topic triggers wrong notification
  • +
  • [PHPBB3-12275] - core.modify_username_string is not triggered everytime
  • +
  • [PHPBB3-12332] - Attachments with long file names break the Uploader layout
  • +
  • [PHPBB3-12357] - generate_smilies() does not work for routes
  • +
  • [PHPBB3-12402] - CAPTCHA plugin migration fails to detect missing plugins
  • +
  • [PHPBB3-12415] - Use private message instead of "pm" accronym in cpf visibility options
  • +
  • [PHPBB3-12421] - We try to display attachments in feed even for users who don't have the right to see them
  • +
  • [PHPBB3-12428] - Incorrect from version in database update log entry
  • +
  • [PHPBB3-12434] - No error message with Plupload except for files without extension
  • +
  • [PHPBB3-12435] - purge_notifications() fails for disabled extensions
  • +
  • [PHPBB3-12440] - Change URL in browsers addressbar when a view=unread#unread link was used
  • +
  • [PHPBB3-12451] - posting.php TOO_FEW_CHARS_LIMIT should be split for plurals
  • +
  • [PHPBB3-12459] - Unapproved posts/topics are not correctly handled in feeds
  • +
  • [PHPBB3-12460] - Soft deleted posts/topics are not correctly handled in feeds
  • +
  • [PHPBB3-12461] - Statistics are wrong for topic's based feeds
  • +
  • [PHPBB3-12476] - purge_cache should increase asset version
  • +
  • [PHPBB3-12486] - "Risky" tests from phpunit 4.1
  • +
  • [PHPBB3-12491] - Conflict between USERNAME_FULL in functions.php and mcp_notes.php
  • +
  • [PHPBB3-12493] - User can not send PMs to users with PMs disabled, but PM button is visible on posts
  • +
  • [PHPBB3-12498] - IE8 displays avatar in header with wrong width
  • +
  • [PHPBB3-12499] - Incorrect call to phpbb\log\log::add() in db:migrate console command
  • +
  • [PHPBB3-12500] - user.img does not set a title attribute for resulting span
  • +
  • [PHPBB3-12501] - Weird post attachment behavior in MCP report details
  • +
  • [PHPBB3-12503] - All test cases should extend phpbb_test_case instead of PHPUnit_Framework_TestCase
  • +
  • [PHPBB3-12504] - Avatar manager test is using undefined variables
  • +
  • [PHPBB3-12509] - Extentions can't send email with new notification system
  • +
  • [PHPBB3-12510] - build_url() is not encoding url entities
  • +
  • [PHPBB3-12511] - Missing language strings in memberlist group view for mobile prosilver
  • +
  • [PHPBB3-12513] - simple_headers do not support extension loaded CSS stylesheets
  • +
  • [PHPBB3-12517] - Missing argument in call to log.add() in prune_shadow_topics.php
  • +
  • [PHPBB3-12519] - m_approve language update from soft delete patch got nucked by a merge conflict
  • +
  • [PHPBB3-12520] - Can not move text with the mouse anymore in post-box when attachments are allowed
  • +
  • [PHPBB3-12522] - Add parameter description in guesser_interface
  • +
  • [PHPBB3-12525] - CONTACT_USER used with username
  • +
  • [PHPBB3-12526] - "Undefined index: filesize" error thrown when editing a PM with attachments
  • +
  • [PHPBB3-12527] - Remove translation editor from ACP
  • +
  • [PHPBB3-12529] - phpbb\controller\resolver::getController doesn't use $phpbb_root_path to check if the template dir exist
  • +
  • [PHPBB3-12533] - The notification link should fill the parent li-container in the notifications dialog
  • +
  • [PHPBB3-12534] - Enabling and disabling extensions should not abuse the red errorbox
  • +
  • [PHPBB3-12536] - Get Versions Should Not Require Both Stable and Unstable Branches
  • +
  • [PHPBB3-12540] - WRONG_FILESIZE contains broken placeholders
  • +
  • [PHPBB3-12543] - Enter key no longer works in posting when attachment error is triggered
  • +
  • [PHPBB3-12547] - Rename jquery.js to jquery.min.js in assets directory
  • +
  • [PHPBB3-12548] - [RTL] - Posting button icons should display on left side of text
  • +
  • [PHPBB3-12549] - [RTL] - Forumlist/topiclist <dfn> tags should not be visible
  • +
  • [PHPBB3-12550] - [RTL] - Last post column breaks into second line
  • +
  • [PHPBB3-12551] - [RTL] - Breadcrumb separator does not display correctly
  • +
  • [PHPBB3-12561] - Create_schema_files.php should process colum "after" instead of adding it to the JSON
  • +
  • [PHPBB3-12570] - db_text throws an error, when set() is called with the current value
  • +
  • [PHPBB3-12572] - JavaScript console throws error when alert message title is not defined (core.js bug)
  • +
  • [PHPBB3-12580] - :link Pseudo causing over specificity issues in the theme
  • +
  • [PHPBB3-12586] - \phpbb\extension\manager::all_available() should only locate ext files two levels deep and ignore dot-files/folders
  • +
  • [PHPBB3-12594] - File headers, credit lines, etc. should reflect updated legal info
  • +
  • [PHPBB3-12600] - The cli command extension:show is broken
  • +
  • [PHPBB3-12604] - Notifications Dropdown Padding Broken When Empty
  • +
  • [PHPBB3-12611] - phpBB Group copyright notice should be removed from all images
  • +
  • [PHPBB3-12614] - Do not hide post buttons before hovering over post
  • +
  • [PHPBB3-12621] - schema.json is not up to date with migration files
  • +
+

Improvement

+
    +
  • [PHPBB3-9388] - use DOM scripting to hide unnecessary input fields
  • +
  • [PHPBB3-11163] - Include ext/ directory in installation and update packages
  • +
  • [PHPBB3-12155] - Use CSS instead of translated images for the mini post buttons
  • +
  • [PHPBB3-12407] - Allow changing of post_data and other variables with core.posting_modify_template_vars
  • +
  • [PHPBB3-12431] - Add has_poll icon to topiclists
  • +
  • [PHPBB3-12433] - QUOTE_DEPTH_EXCEEDED needs a different string for '1'
  • +
  • [PHPBB3-12488] - Add user warning indication to viewtopic posts
  • +
  • [PHPBB3-12507] - Add console command to purge the cache
  • +
  • [PHPBB3-12518] - Allow extensions to overwrite CANNOT_EDIT_* checks in posting.php and viewtopic.php
  • +
  • [PHPBB3-12523] - Add search_results.html template events search_results_topic_(before/after)
  • +
  • [PHPBB3-12524] - Add search.php core event to modify search results rowset
  • +
  • [PHPBB3-12531] - Restore default topic title links in subsilver2
  • +
  • [PHPBB3-12555] - Make use of canonical urls to avoid duplicate content
  • +
  • [PHPBB3-12583] - Add event core.mcp_warn_post_before/after
  • +
  • [PHPBB3-12584] - Add event core.mcp_warn_user_before/after
  • +
+

Sub-task

+ +

Task

+
    +
  • [PHPBB3-10839] - Remove phpunit.xml.functional and always include functional tests
  • +
  • [PHPBB3-12384] - Run Travis CI HHVM tests against MySQLi instead of MySQL
  • +
  • [PHPBB3-12495] - Add Sami to composer dependencies and build script
  • +
  • [PHPBB3-12544] - Update Plupload to 2.1.2
  • +
  • [PHPBB3-12582] - Strip away copyrighted ICC profile from images
  • +
  • [PHPBB3-12592] - Run mysql driver on Travis CI
  • +
  • [PHPBB3-12603] - Remove hook_system.html from docs
  • +
+ + +

Changes since 3.1.0-b2

+ +

Bug

+
    +
  • [PHPBB3-7707] - Missing occurrences of get_username_string
  • +
  • [PHPBB3-8323] - Banned User (PMs and Mails)
  • +
  • [PHPBB3-8558] - Board Emails not setting a correct email header
  • +
  • [PHPBB3-8700] - Language file "acp/styles.php" contains many unused language entries
  • +
  • [PHPBB3-8960] - Allow changing allow_avatar_remote when images/avatars/upload is not writable
  • +
  • [PHPBB3-10423] - Searching for the term "test *" will highlight nearly every word and displays htmlspecialchars as htmlentities.
  • +
  • [PHPBB3-10687] - UNABLE_GET_IMAGE_SIZE text misleading for remote avatars
  • +
  • [PHPBB3-10851] - HTML files containing certain tags being rejected as possible attack vectors with "Check attachment file" set to "No"
  • +
  • [PHPBB3-11098] - New persistent login keys list should have (un)select all and order options.
  • +
  • [PHPBB3-11339] - Using AJAX calls one after another
  • +
  • [PHPBB3-11352] - Disapproving topic takes you to quick reply for that topic
  • +
  • [PHPBB3-11431] - All topic notifications are deleted if one reply is edited and needs to be approved
  • +
  • [PHPBB3-11508] - General error "not allowed as quickmod" when changing the forum while merging two topics
  • +
  • [PHPBB3-11772] - New topic notification triggered when editing an existing post with post-approval enabled
  • +
  • [PHPBB3-11860] - .htaccess not working for Apache 2.4
  • +
  • [PHPBB3-11881] - Timezone migration can take a long time
  • +
  • [PHPBB3-11917] - "Manage external account" shows when not activated
  • +
  • [PHPBB3-11978] - Text field for topic-search
  • +
  • [PHPBB3-12004] - Support empty routes to app.php/ in path_helper
  • +
  • [PHPBB3-12012] - DB Tools should correctly remove columns that are part of indexes
  • +
  • [PHPBB3-12043] - Sort Extensions by Name in ACP Ext Mgr
  • +
  • [PHPBB3-12052] - Post edited by user on moderation queue is not marked as unapproved.
  • +
  • [PHPBB3-12083] - "Select all" selects nothing in Webkit Browsers with only one character in [code] -
  • +
  • [PHPBB3-12097] - The validate_data() function doesn't work with class method
  • +
  • [PHPBB3-12113] - Deleting warnings does not use plurals correctly
  • +
  • [PHPBB3-12121] - Update process doesn't preserve total redirects for links
  • +
  • [PHPBB3-12130] - Bullet character disappears on mouse-over in IE8
  • +
  • [PHPBB3-12186] - MCP should open "Reported posts" instead of PM Reports
  • +
  • [PHPBB3-12191] - UCP should open with global settings instead of notification settings
  • +
  • [PHPBB3-12193] - Broken HTML when an SQL error occurs during migration
  • +
  • [PHPBB3-12211] - Attachment file names are run through htmlspecialchars twice
  • +
  • [PHPBB3-12254] - Language switching on Registration page doesn't work for Extensions
  • +
  • [PHPBB3-12265] - Contact profile fields icons should be hidden in a dropdown
  • +
  • [PHPBB3-12286] - Fix coding guidelines
  • +
  • [PHPBB3-12331] - Fix DB error in update_profile_field_data() with disabled fields
  • +
  • [PHPBB3-12342] - Javascript Bugs and Fixes
  • +
  • [PHPBB3-12348] - Make create_schema_files.php runnable when phpBB is not installed yet
  • +
  • [PHPBB3-12350] - tests/extension/modules_test.php can not be run alone
  • +
  • [PHPBB3-12351] - Ajax "Mark topics read" does not give feedback
  • +
  • [PHPBB3-12353] - User attachments in ACP are not displaying every attachment
  • +
  • [PHPBB3-12354] - passwords_manager_test::test_unique_id fails from time to time
  • +
  • [PHPBB3-12355] - Topic Tools not updated fully updated when subscribing/bookmarking
  • +
  • [PHPBB3-12356] - Plupload does not load in PM editor
  • +
  • [PHPBB3-12358] - data-refresh not working as expected for routes
  • +
  • [PHPBB3-12359] - Day and Month of Birthday Misaligned When Editing
  • +
  • [PHPBB3-12360] - User is displayed twice in online list after second login
  • +
  • [PHPBB3-12362] - Infinite loop in schema generator if dependency can't be resolved
  • +
  • [PHPBB3-12367] - Travis fails in phpbb_wrapper_gmgetdate_test::test_gmgetdate()
  • +
  • [PHPBB3-12372] - dE() function does not toggle in ACP
  • +
  • [PHPBB3-12373] - Add to/from forum ids to LOG_MOVE entries
  • +
  • [PHPBB3-12375] - Attachment deletion broken after jQuery update
  • +
  • [PHPBB3-12378] - Prosilver common.css has duplicate entries
  • +
  • [PHPBB3-12379] - Plupload labels duplicated when responsive
  • +
  • [PHPBB3-12380] - “Remember Me†login keys are not sorted in UCP
  • +
  • [PHPBB3-12381] - Broken error message when selecting invalid DB driver
  • +
  • [PHPBB3-12382] - Template event listners can not access subloops when loop is defined in the original file
  • +
  • [PHPBB3-12386] - Add DEBUG_EXTRA again and use it for container creation
  • +
  • [PHPBB3-12388] - Log entries without log_data display language key instead of translated string
  • +
  • [PHPBB3-12391] - core.posting_modify_template_vars pass some variables to listeners
  • +
  • [PHPBB3-12395] - Pagination tests fail on travis with postgresql
  • +
  • [PHPBB3-12397] - db_tools::sql_unique_index_exists() has wrong doc block
  • +
  • [PHPBB3-12398] - Prune shadow topics tests fail due to wrong forum_last_post_id
  • +
  • [PHPBB3-12405] - create_user() in functional tests uses invalid timezone and no dateformat
  • +
  • [PHPBB3-12406] - Fix description of page_title var in core.viewtopic_modify_page_title
  • +
  • [PHPBB3-12412] - Styling issue with pagination numbering for smilies and icons
  • +
  • [PHPBB3-12413] - Fatal error "Call to undefined method phpbb\feed\*::fetch_attachments()" for topic based feeds
  • +
  • [PHPBB3-12418] - Notice displayed for feed.php
  • +
  • [PHPBB3-12422] - Log searches error due to plural arrays in language files
  • +
  • [PHPBB3-12429] - Update phpunit to 3.8+
  • +
  • [PHPBB3-12432] - Migrator should not automatically revert custom functions defined in update_data()
  • +
  • [PHPBB3-12436] - Functional test framework's add_style() should not use sql_multi_insert()
  • +
  • [PHPBB3-12444] - The logs message aren't filled correctly when some values are missing.
  • +
  • [PHPBB3-12455] - Remove unused strings EXTENSION_CONTROLLER_MISSING and EXTENSION_CLASS_WRONG_TYPE from common.php
  • +
  • [PHPBB3-12456] - Missing new lines at the end of file in language files
  • +
  • [PHPBB3-12467] - Add config_*.php and tests_config_*.php to .gitignore
  • +
  • [PHPBB3-12469] - Convert Timezone test fails because of outdated schema
  • +
  • [PHPBB3-12470] - Move commands from .travis.yml to separate files to allow reuse
  • +
  • [PHPBB3-12472] - Set fast finish for .travis.yml
  • +
  • [PHPBB3-12474] - The console command for updating/migrating the db should display the error with the <error> tag
  • +
  • [PHPBB3-12475] - Undefined variable $log in db:migrate console command
  • +
  • [PHPBB3-12477] - PM link no longer displays in viewtopic
  • +
  • [PHPBB3-12478] - ucp_pm_viewmessage_contact_fields_before/after missing in PM page
  • +
  • [PHPBB3-12480] - \phpbb\extension\finder is finding too many routing files
  • +
  • [PHPBB3-12482] - Undefined variable: data in viewtopic when not logged in
  • +
  • [PHPBB3-12485] - Broken tests due to absolute exclude
  • +
  • [PHPBB3-12494] - Undefined index: user_type on viewtopic.php
  • +
+

Improvement

+
    +
  • [PHPBB3-9758] - Make users avatar available to the template
  • +
  • [PHPBB3-10521] - Override Board Language via URL
  • +
  • [PHPBB3-11962] - Resize images to 100% with in viewtopic
  • +
  • [PHPBB3-12150] - Automatically prune shadow topics
  • +
  • [PHPBB3-12201] - Clean up ACP attachment management page
  • +
  • [PHPBB3-12273] - Add a test to run the event exporter on travis
  • +
  • [PHPBB3-12282] - Add an interface for dbal driver to ensure that functions are there
  • +
  • [PHPBB3-12283] - Online status on posting review page.
  • +
  • [PHPBB3-12322] - Add CSS classes for post-profile <dd> elements
  • +
  • [PHPBB3-12323] - Add Template Event search_results_author_prepend
  • +
  • [PHPBB3-12327] - Changing poll result-bars width from absolute % to relative
  • +
  • [PHPBB3-12328] - Add Template Event index_body_stat_blocks_after
  • +
  • [PHPBB3-12329] - Add <div> container to index blocks (online-list, birthday-list, statistics)
  • +
  • [PHPBB3-12333] - Add Template Event overall_header_page_body_before
  • +
  • [PHPBB3-12335] - Add Events to phpbb\profilefields\manager (grab & show)
  • +
  • [PHPBB3-12336] - Add functions_module.php core events to allow adjusting parameters for custom ACP, MCP, UCP modules
  • +
  • [PHPBB3-12337] - Update jQuery to version 1.11.0
  • +
  • [PHPBB3-12338] - Add Template Event overall_footer_page_body_after
  • +
  • [PHPBB3-12339] - Add Event core.page_header_after
  • +
  • [PHPBB3-12344] - Add event to submit_pm()
  • +
  • [PHPBB3-12345] - Improve search flood interval message
  • +
  • [PHPBB3-12346] - Add Template Event overall_header_navlink_append/prepend
  • +
  • [PHPBB3-12347] - Move breadcrumb seperator from template to CSS
  • +
  • [PHPBB3-12361] - Replace the Google logo with the phpBB logo in the BBCode FAQ
  • +
  • [PHPBB3-12364] - Add template identifier var to all missing pages
  • +
  • [PHPBB3-12365] - Do not crop image attachment heights at 350px
  • +
  • [PHPBB3-12366] - Add Event core.search_get_posts_data
  • +
  • [PHPBB3-12369] - Add template variable for extensions to add classes to <body> element without JS
  • +
  • [PHPBB3-12374] - Add Template events index_body_block_<blockname>_append
  • +
  • [PHPBB3-12376] - Add template events viewtopic_body_polls
  • +
  • [PHPBB3-12377] - Move navbars to separate template files
  • +
  • [PHPBB3-12389] - Move "print topic" & "email topic" icons (and PM versions) to topic tools
  • +
  • [PHPBB3-12392] - Include $profile_fields in core.memberlist_view_profile event
  • +
  • [PHPBB3-12396] - Add Template events viewforum_forum_name_append/prepend
  • +
  • [PHPBB3-12400] - Add viewforum.php core event to allow modifying topics data before display the page
  • +
  • [PHPBB3-12401] - Add $topic_data array to core.viewtopic_modify_post_row event in viewtopic.php
  • +
  • [PHPBB3-12403] - Add template events to acp_users_prefs.html
  • +
  • [PHPBB3-12409] - Add acp_users.php core events to modify users preferences data
  • +
  • [PHPBB3-12410] - Add Template events search_results_post_before/after
  • +
  • [PHPBB3-12411] - Expand dispatch vars of event: core.search_modify_tpl_ary
  • +
  • [PHPBB3-12419] - Improve font size in notifications drop-down
  • +
  • [PHPBB3-12437] - Clean up redundant "clear" elements & "corners"
  • +
  • [PHPBB3-12438] - Add Template event memberlist_view_content_prepend
  • +
  • [PHPBB3-12442] - Add CSS classes to heading elements
  • +
  • [PHPBB3-12473] - Add console command for updating/migrating database
  • +
  • [PHPBB3-12484] - Template event ucp_agreement_terms_before/after
  • +
+

New Feature

+ +

Sub-task

+
    +
  • [PHPBB3-12349] - License in migrations header not linking to version 2 of GNU GPL
  • +
  • [PHPBB3-12370] - Editing a post removes topic notifications
  • +
  • [PHPBB3-12371] - Notifications are incorrectly updated when a post is deleted or moved to ModerationQueue
  • +
+

Task

+
    +
  • [PHPBB3-12071] - Test suite fails if Fileinfo isn't installed
  • +
  • [PHPBB3-12199] - Move deprecated functions to functions_compatibility.php
  • +
  • [PHPBB3-12318] - Correctly setup HHVM functional tests on Travis CI
  • +
  • [PHPBB3-12320] - No longer allow Travis CI HHVM environment to fail
  • +
  • [PHPBB3-12341] - Add tests for get_username_string()
  • +
  • [PHPBB3-12390] - Released packages MUST NOT contain vendor tests or other non-library code
  • +
  • [PHPBB3-12417] - hhvm-nightly 2014.04.16~precise breaks tests
  • +
  • [PHPBB3-12423] - Increase composer minimum-stability from beta to stable
  • +
  • [PHPBB3-12424] - Update Symfony Dependencies to latest 2.3 releaes
  • +
  • [PHPBB3-12458] - Apply Squiz.WhiteSpace.SuperfluousWhitespace.* sniffs to legacy codebase
  • +
+ + +

Changes since 3.1.0-b1

+ +

Bug

+
    +
  • [PHPBB3-8309] - Rename "Last visited" to "Last activity" on memberlist/viewprofile
  • +
  • [PHPBB3-9040] - Count HTML entities as single characters in Custom Profile fields
  • +
  • [PHPBB3-9725] - MSSQL Schema is not azure compatible
  • +
  • [PHPBB3-10769] - "ACP Access Denied" view includes ajax parts
  • +
  • [PHPBB3-11071] - User selection of an invalid style causes a general error
  • +
  • [PHPBB3-11357] - Invalid markup in installer
  • +
  • [PHPBB3-11959] - List of users in notifications should be trimmed
  • +
  • [PHPBB3-12031] - Bug language Notification list should trim users
  • +
  • [PHPBB3-12127] - Possible NOTIFICATION_QUOTE_TRIMMED miswording
  • +
  • [PHPBB3-12160] - Convert Page throws "invalid dbms driver" when no phpBB installation is present
  • +
  • [PHPBB3-12257] - MySQL Fulltext Tests are not run on Travis CI
  • +
  • [PHPBB3-12281] - Disable redis in travis setup on develop until redis fixes it
  • +
  • [PHPBB3-12292] - Buttons are mis-matched, unaligned in ACP Style Details
  • +
  • [PHPBB3-12293] - Core event listeners not working in log.php
  • +
  • [PHPBB3-12294] - phpbb_ in profile fields column names is incorrectly replaced with the table prefix
  • +
  • [PHPBB3-12297] - user_from column not deleted on update to b1
  • +
  • [PHPBB3-12310] - SMTP username and password should not autocomplete during install
  • +
  • [PHPBB3-12311] - Metadata Manager should require license instead of licence
  • +
  • [PHPBB3-12314] - HHVM SPL autoloader sometimes passes class name with leading backslash
  • +
  • [PHPBB3-12315] - NO_SEARCH_INDEX in language/en/acp/common.php uses invalid HTML
  • +
  • [PHPBB3-12316] - develop-ascraeus build status missing from "Automated Testing" section in README.md
  • +
  • [PHPBB3-12317] - Some notification tests fail on DBMS drivers using appropriate integer typing (MSSQL, Sqlite3, also MySQL on HHVM)
  • +
  • [PHPBB3-12321] - Remove execute bit from file ucp_main_subscribed.html and buttons.png in prosilver
  • +
  • [PHPBB3-12324] - Can not update from b1 to b2 because of missing install/update/new/config/ folder
  • +
  • [PHPBB3-12326] - Error while updating from b1 to b2 because of incomplete update files
  • +
  • [PHPBB3-12330] - Installation fails on MSSQL
  • +
+

Improvement

+
    +
  • [PHPBB3-10174] - Rename "Ban usernames" to "Ban users" in ACP
  • +
  • [PHPBB3-10590] - Skip confirmation page after successful posting of an approved post
  • +
  • [PHPBB3-11169] - Move prune users from security to users category
  • +
  • [PHPBB3-11230] - Use @inheritdoc in docblocks in cache drivers
  • +
  • [PHPBB3-11239] - Include username before the Overview title.
  • +
  • [PHPBB3-11336] - Rename mode parameter from "leaders" to something more accurate for the "The team" page
  • +
  • [PHPBB3-11360] - page_header() argument "display_online_list" should be FALSE by default
  • +
  • [PHPBB3-11666] - POST_DELETED should refer to posts instead of messages
  • +
  • [PHPBB3-12035] - Add a link to user's posts in the ACP user overview page
  • +
  • [PHPBB3-12198] - Unused ERR_TEMPLATE_EVENT_* language strings in en/common.php
  • +
  • [PHPBB3-12268] - Extension finder should not crawl through .git/ of extensions
  • +
  • [PHPBB3-12269] - Delete "mods" folder from the language folder
  • +
  • [PHPBB3-12274] - Updater is using old version of adm/style/admin.css
  • +
  • [PHPBB3-12276] - Expand core.memberlist_view_profile event to include Zebra state
  • +
  • [PHPBB3-12278] - Add mcp.php core event to allow setting display options for custom MCP modules
  • +
  • [PHPBB3-12284] - Make Extension Details page more readable
  • +
  • [PHPBB3-12289] - Add viewtopic_body.html template event to allow custom post notices
  • +
  • [PHPBB3-12300] - Revert and Reimagine Link to last read posts
  • +
  • [PHPBB3-12304] - Add CSS class to rules-link container
  • +
  • [PHPBB3-12308] - Add Template Event forumlist_body_last_row_after
  • +
  • [PHPBB3-12309] - Add Template Event quickreply_editor_panel_before/after
  • +
+

New Feature

+
    +
  • [PHPBB3-7580] - Allow isset() check in IF template syntax
  • +
  • [PHPBB3-12298] - Template Event memberlist_view_contact_before/after
  • +
  • [PHPBB3-12301] - Template Event overall_header_body_before
  • +
+

Task

+ + +

Changes since 3.1.0-a3

+ +

Bug

+
    +
  • [PHPBB3-8041] - Do not concatenate the destination to L_RETURN_TO to allow better translations
  • +
  • [PHPBB3-8122] - Reviewing topics/posts - not correctly displayed
  • +
  • [PHPBB3-8785] - PM recipients/bcc list looks bad
  • +
  • [PHPBB3-8919] - Localisation imageset being refreshed too frequently causing broken images
  • +
  • [PHPBB3-9106] - Upload fails to complete for large files.
  • +
  • [PHPBB3-9420] - BBCode - Unable to use a proper URI token
  • +
  • [PHPBB3-9459] - Visiting ACP with screen resolution 800x600px
  • +
  • [PHPBB3-10175] - Class loader cannot find a/b_foo.php when a/b/bar.php exists
  • +
  • [PHPBB3-10338] - Attachments list is displayed incorrectly
  • +
  • [PHPBB3-10722] - Code Coverage generation fails
  • +
  • [PHPBB3-11038] - Does not correctly find module info classes using new naming conventions
  • +
  • [PHPBB3-11146] - MCP topic/post approval error
  • +
  • [PHPBB3-11151] - Can use negative start for memberlist.php
  • +
  • [PHPBB3-11218] - File upload functional test fails
  • +
  • [PHPBB3-11255] - Some tests do not run standalone due to dbal dependency on global $cache
  • +
  • [PHPBB3-11271] - Images in ATOM feed display, but attached inline images do not.
  • +
  • [PHPBB3-11288] - "Fulltext native" search fooled by hyphens
  • +
  • [PHPBB3-11364] - Add an easy-to-switch system for app.php?controller= vs mod-rewrite usage in append_sid
  • +
  • [PHPBB3-11429] - Extensions should increment assets number on enable
  • +
  • [PHPBB3-11581] - General Error in UCP if PMs are disabled in ACP
  • +
  • [PHPBB3-11625] - General Error accessing MCP from Global Announcement
  • +
  • [PHPBB3-11648] - Test suite creates files in phpBB directory
  • +
  • [PHPBB3-11787] - Permission language strings use samp for highlight instead of strong
  • +
  • [PHPBB3-11880] - Schema changes can take too long and cause a timeout
  • +
  • [PHPBB3-11938] - Use of deprecated sql_attr_str2ordinal in sphinx.conf
  • +
  • [PHPBB3-12003] - ACP broken when error thrown
  • +
  • [PHPBB3-12072] - Missing word "send" in comment in schema_data.sql
  • +
  • [PHPBB3-12078] - "Can permanently delete own posts" permission has no effect
  • +
  • [PHPBB3-12080] - Responsive design in ACP / User Administration / Signature needs fixing
  • +
  • [PHPBB3-12093] - IE 11 javascript selection is no longer supported
  • +
  • [PHPBB3-12126] - Alert box is aligned to the left instead of center in IE
  • +
  • [PHPBB3-12132] - viewtopic_print_head_append template event is missing in subsilver2
  • +
  • [PHPBB3-12134] - ucp_pm_viewmessage_print_head_append template event is missing in subsilver2
  • +
  • [PHPBB3-12136] - Call to undefined function generate_pagination() in functions_posting.php
  • +
  • [PHPBB3-12138] - Information and pagination of filtered attachments
  • +
  • [PHPBB3-12139] - Spaces missing after $show_guests in viewonline.php
  • +
  • [PHPBB3-12141] - Travis tests fail on 5.5
  • +
  • [PHPBB3-12149] - Division by zero in [ROOT] -/phpbb/pagination.php
  • +
  • [PHPBB3-12153] - PAGE_NUMBER should be assigned by pagination.generate_template_pagination()
  • +
  • [PHPBB3-12158] - pagination.validate_start() returns negative value when $num_items = 0
  • +
  • [PHPBB3-12168] - Nav Header Links Alignment Issues without small-icon
  • +
  • [PHPBB3-12170] - Migration helper replaces table name with 0 when creating tables
  • +
  • [PHPBB3-12171] - Attachments from soft-deleted posts are still downloadable
  • +
  • [PHPBB3-12172] - "Download all attachments" feature leaks post/pm attachments when being able to download one of them
  • +
  • [PHPBB3-12175] - Fix and run functional upload tests
  • +
  • [PHPBB3-12176] - No error shown when attempting to delete a founder
  • +
  • [PHPBB3-12183] - Update user_newpasswd column in users table for passwords manager
  • +
  • [PHPBB3-12184] - Undefined variable tpl_fields in profile field manager on memberlist
  • +
  • [PHPBB3-12188] - Add php 5.6 to travis tests
  • +
  • [PHPBB3-12192] - Avatars in PM report closed notifications are broken
  • +
  • [PHPBB3-12194] - Unknown column 'field_show_novalue' in 'field list' [1054] -
  • +
  • [PHPBB3-12200] - Profile field template files missing in adm/style
  • +
  • [PHPBB3-12202] - Variables read from style.cfg etc. should be htmlspecialchared
  • +
  • [PHPBB3-12203] - user_occ does not have a default value when registering
  • +
  • [PHPBB3-12205] - Custom Profile Field display bug
  • +
  • [PHPBB3-12206] - Errors in plupload doesn't pull lang vars right
  • +
  • [PHPBB3-12207] - prosilver layout breaks when error outputted before <html>
  • +
  • [PHPBB3-12208] - Plupload uploads files even if they were deleted from queue
  • +
  • [PHPBB3-12210] - dbtools::sql_create_table incorrectly throws error related to auto-increment length on non auto-increment fields
  • +
  • [PHPBB3-12212] - HTML in attachment file name rendered before upload
  • +
  • [PHPBB3-12216] - Undefined index: lang_options when creating date profile field
  • +
  • [PHPBB3-12220] - Debug message if no unread messages are present
  • +
  • [PHPBB3-12222] - Replace hardoded comma with translatable separator in forumlist_body.html
  • +
  • [PHPBB3-12223] - Pagination displayes additional &bull; when PAGE_NUMBER is empty
  • +
  • [PHPBB3-12226] - Incorrectly used plurals in ucp.php MOVE_PM_ERROR and FOLDER_MESSAGE_STATUS
  • +
  • [PHPBB3-12227] - "X from Y messages" should be "X out of Y messages"
  • +
  • [PHPBB3-12243] - subsilver2 is missing profile field files
  • +
  • [PHPBB3-12245] - "Invalid id refernce" for label "joined" and "group_id" in acp_prune_users.html
  • +
  • [PHPBB3-12249] - Undefined variable: row when editing profile
  • +
  • [PHPBB3-12250] - Remove deprecated phpbb_clean_path function
  • +
  • [PHPBB3-12251] - Clean up and Enhancement of Custom Profile Fields
  • +
  • [PHPBB3-12256] - phpbb\notification\type\admin_activate_user uses $sql as fetchrow parameter
  • +
  • [PHPBB3-12261] - Login redirect from extension front controllers broken
  • +
  • [PHPBB3-12263] - \phpbb\db\migration\tool\module.php contains several errors
  • +
  • [PHPBB3-12267] - Functional testcase method get_extension_manager() uses undefined variable php_ext
  • +
  • [PHPBB3-12271] - Decouple dropdown header/footer from #notification_list
  • +
  • [PHPBB3-12272] - Hardcoded colon in subforums list
  • +
+

Improvement

+
    +
  • [PHPBB3-9255] - Friends Sidebar has scability issues..
  • +
  • [PHPBB3-9479] - Empty paragraphs for vertical spacing are rather old-fashioned
  • +
  • [PHPBB3-9709] - Missing language files for MCP could be substituted by default / english ones
  • +
  • [PHPBB3-9871] - Update version check file to use json format
  • +
  • [PHPBB3-10288] - Templates including other templates in loop can't access variables
  • +
  • [PHPBB3-10549] - Languages variables should be used, not hardcoded
  • +
  • [PHPBB3-10555] - Copyright notice in overall_header.html is not translatable
  • +
  • [PHPBB3-10945] - Show entered search query in the search box when no results are found.
  • +
  • [PHPBB3-11019] - Ability to store array of data in a log
  • +
  • [PHPBB3-11022] - Add "Tahoma" to used font families in css files
  • +
  • [PHPBB3-11040] - PostgreSQL fulltext search improvement
  • +
  • [PHPBB3-11111] - Allow only vertical resize on the textarea.
  • +
  • [PHPBB3-11179] - change the start parameter in search when out of bounds to display last(or first) page
  • +
  • [PHPBB3-11201] - MSNM / WLM closing - redundant profile field
  • +
  • [PHPBB3-11254] - Check CRLF line endings in the test suite
  • +
  • [PHPBB3-11297] - Running tests doc should mention dbunit dependency
  • +
  • [PHPBB3-11610] - Use a more secure hashing method like bcrypt
  • +
  • [PHPBB3-11645] - Rename ".MODs" tab in the ACP
  • +
  • [PHPBB3-11693] - Change phpbb_db_driver::sql_build_array() to support DELETE
  • +
  • [PHPBB3-11716] - Migration to convert soft delete/trash bin mods to 3.1 soft delete
  • +
  • [PHPBB3-12029] - Module names in the ACP should not be truncated when they are too long
  • +
  • [PHPBB3-12073] - Small text size in ACP between <samp></samp> and <code></code> tags
  • +
  • [PHPBB3-12106] - Document exceptions to "Disable Board" in ACP.
  • +
  • [PHPBB3-12114] - Convert current profile fields to custom-profile-field system
  • +
  • [PHPBB3-12117] - Nested Set Tree Classes Should be able to get all roots
  • +
  • [PHPBB3-12166] - Add template event "quickreply_editor_message_box_before"
  • +
  • [PHPBB3-12167] - Allow users to change style via style parameter by default
  • +
  • [PHPBB3-12190] - Add core event "core.modify_submit_post_data"
  • +
  • [PHPBB3-12217] - Add template events to viewtopic_body.html
  • +
  • [PHPBB3-12224] - Add template method to assign block arrays
  • +
  • [PHPBB3-12231] - Add template events to forumlist_body.html
  • +
  • [PHPBB3-12238] - There is no cancel input type.
  • +
  • [PHPBB3-12239] - Move deprecated password functions to compatibility file
  • +
  • [PHPBB3-12240] - Adding specific class names to buttons in posting_buttons.html
  • +
  • [PHPBB3-12241] - Event to add and/or modify acp_board configurations
  • +
  • [PHPBB3-12244] - Remove ambiguity between Extension Tab and Extensions Management links
  • +
  • [PHPBB3-12248] - Extension Details Homepage should be a clickable link
  • +
  • [PHPBB3-12259] - Too many redundant tests are run on Travis
  • +
  • [PHPBB3-12260] - Add core event to delete_posts() function
  • +
  • [PHPBB3-12262] - Adjust a script to export the events in wiki format
  • +
+

Sub-task

+
    +
  • [PHPBB3-12115] - Convert occupation/interests profile field to custom field
  • +
  • [PHPBB3-12169] - Convert location user field to profile field
  • +
  • [PHPBB3-12187] - Convert website user field to profile field
  • +
  • [PHPBB3-12233] - Allowing CPF to be have an icon on viewtopic and be listed in the contact section of the profile
  • +
  • [PHPBB3-12234] - Convert ICQ user field to profile field
  • +
  • [PHPBB3-12235] - Convert MSN/WLM user field to profile field
  • +
  • [PHPBB3-12236] - Convert AOL user field to profile field
  • +
  • [PHPBB3-12237] - Convert Yahoo user field to profile field
  • +
+

Task

+
    +
  • [PHPBB3-10763] - Audit code for non-static functions called statically
  • +
  • [PHPBB3-10793] - Use db_tools in create_schema_files
  • +
  • [PHPBB3-11509] - Travis should check commit message format
  • +
  • [PHPBB3-11764] - Remove Subsilver2 from installation packages
  • +
  • [PHPBB3-12177] - Add event ucp_zebra_friend_list_before/after
  • +
  • [PHPBB3-12180] - CodeSniffer: Ensure each file ends with a single newline
  • +
+ + +

Changes since 3.1.0-a2

+ +

Bug

+
    +
  • [PHPBB3-10810] - Manage group in ucp requires access to adm/
  • +
  • [PHPBB3-11246] - Misleading Message in New User Pruning Feature
  • +
  • [PHPBB3-11484] - Topic Reply Notification email links not requiring user to log in
  • +
  • [PHPBB3-11507] - Impossible to prune users by group only
  • +
  • [PHPBB3-11672] - AJAX alerts contain unnecessary messages/links
  • +
  • [PHPBB3-11709] - Bulletin points in navigation menu are misaligned in RTL languages
  • +
  • [PHPBB3-11842] - Avatar driver error thrown when creating group
  • +
  • [PHPBB3-11856] - Require composer.json for extensions
  • +
  • [PHPBB3-11859] - Avatar drivers should return template filename
  • +
  • [PHPBB3-11869] - Strict debug message when registering with profile fields displayed
  • +
  • [PHPBB3-11911] - ACP should warn if there is no search index created for the selected search engine
  • +
  • [PHPBB3-11912] - "Unable to guess the mime type as no guessers are available" when uploading files
  • +
  • [PHPBB3-11914] - plupload should be updated to 2.0.x
  • +
  • [PHPBB3-11915] - plupload should be restyled to match the design of prosilver better
  • +
  • [PHPBB3-11959] - List of users in notifications should be trimmed
  • +
  • [PHPBB3-11963] - Stale MCP notifications get left behind
  • +
  • [PHPBB3-11984] - Ticket for more bugs/improvements for responsive design for both prosilver and ACP
  • +
  • [PHPBB3-11988] - Active tab in ACP should not have hover effect
  • +
  • [PHPBB3-11997] - redirect() does not work for app.php/xyz pages
  • +
  • [PHPBB3-12001] - User input is ignored in AJAX confirmation forms
  • +
  • [PHPBB3-12006] - Disabled Extensions with Modules can break the ACP/UCP/MCP
  • +
  • [PHPBB3-12009] - Incorrectly installed extensions should be ignored
  • +
  • [PHPBB3-12011] - RTL languages have style bugs in prosilver/ACP
  • +
  • [PHPBB3-12015] - Enhance events in viewtopic to increase their usability
  • +
  • [PHPBB3-12026] - Unable to find template - in MCP/UCP, which are added via extensions
  • +
  • [PHPBB3-12027] - Redis tests failing
  • +
  • [PHPBB3-12028] - Don't use L_COLON in a JavaScript context
  • +
  • [PHPBB3-12030] - Include config directory completely in update packages when one file is being updated
  • +
  • [PHPBB3-12032] - Certain notifications incorrectly inherit read status from post/topic
  • +
  • [PHPBB3-12036] - Module Management items have 2 move down buttons and no up
  • +
  • [PHPBB3-12038] - Move up/down buttons are not AJAXified in various ACP pages.
  • +
  • [PHPBB3-12040] - ACP tabs flicker when AJAX background appears
  • +
  • [PHPBB3-12042] - Several strings of plupload are not being translated
  • +
  • [PHPBB3-12045] - Several HTML markup issues in adm/style/acp_prune_users.html
  • +
  • [PHPBB3-12049] - PLUPLOAD_ERR_UPLOAD_LIMIT should be using plurals
  • +
  • [PHPBB3-12050] - phpbb_notification_submit_post_base should be abstract
  • +
  • [PHPBB3-12055] - ACP BBCodes/Smilies Row Color Changes Needed After AJAX operations
  • +
  • [PHPBB3-12058] - Updating database fails in migration v310/avatar_types.php
  • +
  • [PHPBB3-12059] - ACP INCLUDECSS not working, missing {$STYLESHEETS}
  • +
  • [PHPBB3-12062] - INCLUDEJS broken for extension events in the ACP
  • +
  • [PHPBB3-12063] - <tr> tags use invalid valign attribute
  • +
  • [PHPBB3-12077] - General Error thrown when submitting ACP language pack editor
  • +
  • [PHPBB3-12079] - request.untrimmed_variable() $multibyte param does not have default value
  • +
  • [PHPBB3-12091] - Plupload - File upload does not work in Internet Explorer 11
  • +
  • [PHPBB3-12092] - Plupload - File info missing for several uploaded files
  • +
  • [PHPBB3-12095] - IE11 JavaScript plupload error
  • +
  • [PHPBB3-12096] - Not using plurals correctly in search.php MAX_NUM_SEARCH_KEYWORDS_REFINE
  • +
  • [PHPBB3-12100] - ACP Template files not purged during Extension Enable/Disable
  • +
  • [PHPBB3-12107] - Log table name is hard-coded in log.get_logs()
  • +
  • [PHPBB3-12110] - Update Plupload to 2.1.1
  • +
  • [PHPBB3-12123] - No category specified for soft-delete permission
  • +
  • [PHPBB3-12124] - Plupload broken on IE8
  • +
  • [PHPBB3-12125] - Topic rows are missing background in IE8
  • +
  • [PHPBB3-12131] - prosilver viewtopic print view has invalid imageset var
  • +
  • [PHPBB3-12140] - Avoid endless loop in build script
  • +
  • [PHPBB3-12141] - Travis tests fail on 5.5
  • +
  • [PHPBB3-12151] - Class 'phpbb\profilefields\profilefields' not found
  • +
  • [PHPBB3-12154] - DB Schema not built with develop script
  • +
  • [PHPBB3-12156] - Passwords Manager ~ Bug with OAuth
  • +
  • [PHPBB3-12159] - Fix code sniffer complaints after profilefields and passwords merge
  • +
  • [PHPBB3-12161] - build/save directories are no longer created
  • +
  • [PHPBB3-12162] - Binary files missing from update packages
  • +
  • [PHPBB3-12163] - Page number in viewtopic page title is incorrect
  • +
+

Improvement

+
    +
  • [PHPBB3-10910] - function build_cfg_template() allow $size for $tpl_type = select
  • +
  • [PHPBB3-11346] - Do not show "Mark topics as read" when there are no topics
  • +
  • [PHPBB3-11849] - Move pagination from functions.php into class
  • +
  • [PHPBB3-11950] - Add 'I forgot my password' link to index page login form
  • +
  • [PHPBB3-11961] - Plupload is not updating uploaded files panel
  • +
  • [PHPBB3-11966] - Add Template Event overall_header_navigation_prepend/append to Subsilver2
  • +
  • [PHPBB3-11969] - Link topic title to unread post instead of first post
  • +
  • [PHPBB3-11979] - Add basic dropdown menu framework to prosilver
  • +
  • [PHPBB3-12005] - Remove code responsible for PM popup completely
  • +
  • [PHPBB3-12010] - Navbar icons should be clickable
  • +
  • [PHPBB3-12014] - Add template event "index_body_forumlist_before"
  • +
  • [PHPBB3-12024] - Add Template Event overall_header_content_before and overall_footer_content_after
  • +
  • [PHPBB3-12034] - AJAXify notifications popup
  • +
  • [PHPBB3-12054] - Improve Index Body Template Events
  • +
  • [PHPBB3-12060] - Add BBCode system core and template events
  • +
  • [PHPBB3-12069] - Add PHP event core.submit_post_modify_return_url in submit_post()
  • +
  • [PHPBB3-12104] - Shadowtopics SQL used in core event should use the SQL builder
  • +
  • [PHPBB3-12135] - editor.js function bbfontstyle()
  • +
  • [PHPBB3-12146] - Add color demo when editing a group from the UCP
  • +
+

New Feature

+ +

Sub-task

+
    +
  • [PHPBB3-11241] - Improve user interface for mass attachment downloader (all posts, all topics)
  • +
  • [PHPBB3-12111] - Extract profile field types to individual classes
  • +
+

Task

+
    +
  • [PHPBB3-11432] - Travis should complain when CRLF files are added.
  • +
  • [PHPBB3-11509] - Travis should check commit message format
  • +
  • [PHPBB3-11985] - Enable APC module on Travis to run APC Cache tests
  • +
  • [PHPBB3-12064] - Remove obsolete viewsource.html from adm/style folder
  • +
  • [PHPBB3-12147] - Remove Travis CI notification configuration
  • +
+ +

Changes since 3.1.0-a1

+ +

Bug

+
    +
  • [PHPBB3-4776] - Long post gets hidden behind posting profile
  • +
  • [PHPBB3-10449] - Lines spilling in subscriptions view
  • +
  • [PHPBB3-10948] - Color swatch in 3.1 does not display properly
  • +
  • [PHPBB3-11030] - I beam cursor in prosilver when hovering on browse button for uploading attachments
  • +
  • [PHPBB3-11073] - Reported/Unapproved moderator information in viewtopic is striked through instead of underlined
  • +
  • [PHPBB3-11138] - Resync features in ACP should not use AJAX
  • +
  • [PHPBB3-11280] - Double clicking "mark topics read" produces an error the second time
  • +
  • [PHPBB3-11525] - phpbb_avatar_manager::clean_row collapses user_id and group_id
  • +
  • [PHPBB3-11534] - Remote avatar does not properly check if remote file is an image
  • +
  • [PHPBB3-11626] - Auth ACP options should be moved to separate html file
  • +
  • [PHPBB3-11663] - In generate_text_for_storage the function does not check for errors of parse_message:parse() and act accordingly
  • +
  • [PHPBB3-11691] - Soft delete migration conversion should be staggered
  • +
  • [PHPBB3-11739] - Wrong name for UCP Module "Edit "Remember Me" login keys"
  • +
  • [PHPBB3-11842] - Create a new group Error with avatar driver
  • +
  • [PHPBB3-11857] - Avatar manager must not depend on entire container
  • +
  • [PHPBB3-11872] - MCP: Users with most warnings list is invalid
  • +
  • [PHPBB3-11896] - "Mark all notifications read" does not work
  • +
  • [PHPBB3-11899] - New ajax poll vote should give feedback while waiting for servers response
  • +
  • [PHPBB3-11916] - Remove files from hidden attach list after deletion
  • +
  • [PHPBB3-11922] - Migrator fails to remove columns on MSSQL when they have/had an index
  • +
  • [PHPBB3-11923] - UCP avatar error when user has no permissions to change his/her avatar
  • +
  • [PHPBB3-11924] - Add a script to export the events in wiki format
  • +
  • [PHPBB3-11926] - Plupload Migration has a broken dependency.
  • +
  • [PHPBB3-11927] - Missing Files after 3.1.0-A1 Automatic Updater
  • +
  • [PHPBB3-11930] - Avatar paths are incorrect when using app.php
  • +
  • [PHPBB3-11935] - Invalid HTML in "Sort By" form elements in Prosilver
  • +
  • [PHPBB3-11936] - Fixes to Notifications Window
  • +
  • [PHPBB3-11939] - Quick reply editor has unnecessary data-ajax attribute
  • +
  • [PHPBB3-11943] - $VAR = false has unexpected result
  • +
  • [PHPBB3-11945] - Focused buttons are hard to notice
  • +
  • [PHPBB3-11947] - Notification popup does not appear when clicking number in text
  • +
  • [PHPBB3-11948] - Extensions should be allowed to have more then 1 routing file
  • +
  • [PHPBB3-11949] - cannot upgrade to 3.1
  • +
  • [PHPBB3-11960] - Responsive design removed teampage names
  • +
  • [PHPBB3-11972] - Add template event posting_editor_subject_after
  • +
  • [PHPBB3-11977] - Ajax delete should disable moving options
  • +
  • [PHPBB3-11982] - Navigation is shown above AJAX background in ACP
  • +
  • [PHPBB3-11983] - Subscriptions argument missing from docblock in ucp_notifications
  • +
  • [PHPBB3-11986] - Undefined index: poster_id in file.php
  • +
  • [PHPBB3-11987] - {ROOT_PATH} in ACP leads to adm/
  • +
  • [PHPBB3-11990] - Remove result_mssqlnative from acp_database
  • +
  • [PHPBB3-11991] - PHP notices when closing reported posts entries in MCP
  • +
  • [PHPBB3-11992] - Wrong variable to close "Users with most warnings" block at MCP
  • +
  • [PHPBB3-11994] - Admin options for extensions are bad/misleading
  • +
  • [PHPBB3-11995] - Reverting a config.remove fails
  • +
  • [PHPBB3-12002] - Extension management page should use generate/check link hash
  • +
  • [PHPBB3-12007] - Default last_result of callable steps must be integer instead of false
  • +
  • [PHPBB3-12008] - "Prune notifications" cron task always ran, blocking others
  • +
  • [PHPBB3-12016] - Event listeners should be services
  • +
  • [PHPBB3-12017] - Extension tests are broken on current develop
  • +
  • [PHPBB3-12018] - Use path_helper for admin style CSS in sql report
  • +
  • [PHPBB3-12023] - New css files missing after update
  • +
+

Improvement

+
    +
  • [PHPBB3-11552] - Responsive design for prosilver
  • +
  • [PHPBB3-11746] - Add "account activation required" notification for Administrators
  • +
  • [PHPBB3-11921] - Improve Notifications and PMs in the header
  • +
  • [PHPBB3-11928] - Replace AJAX loading info pop up with animation
  • +
  • [PHPBB3-11957] - Responsive design for admin control panel
  • +
  • [PHPBB3-11973] - Remove logic from language files where possible
  • +
  • [PHPBB3-11974] - All timezones should be translatable
  • +
  • [PHPBB3-11975] - Add ACP link next to MCP
  • +
+

Task

+ + +

Changes since 3.0.x

+ +

Bug

+
    +
  • [PHPBB3-4412] - MCP and viewtopic messed up when long profile fields used
  • +
  • [PHPBB3-6109] - MSN is now called Windows Live Messenger (WLM)
  • +
  • [PHPBB3-6855] - The word separator has been misspelled in the code
  • +
  • [PHPBB3-7070] - Making Font Type & Size Easy To modify
  • +
  • [PHPBB3-7252] - Use IMAGETYPE_ constants in get_supported_image_types()
  • +
  • [PHPBB3-7448] - Module management calling non-static method p_master::module_auth()
  • +
  • [PHPBB3-8212] - Comment spelling mistake in includes/acp/acp_board.php
  • +
  • [PHPBB3-8228] - Coding BBcode has whitespace before the code.
  • +
  • [PHPBB3-8542] - No custom profile fields in private messages
  • +
  • [PHPBB3-8641] - Extra and missing comma in acp_board.php
  • +
  • [PHPBB3-8713] - trimming login inputs isn't sensible
  • +
  • [PHPBB3-8841] - Unexpected results when using "PHPBB_USE_BOARD_URL_PATH"
  • +
  • [PHPBB3-8912] - phpbb_styles_template_data contans more than 4k records
  • +
  • [PHPBB3-9022] - Poll Deletion Problem on Global change
  • +
  • [PHPBB3-9163] - style.php cannot be properly cached
  • +
  • [PHPBB3-9341] - Incorrectly named template vars
  • +
  • [PHPBB3-9394] - wrong comment in functions_upload.php
  • +
  • [PHPBB3-9474] - Unnecessary mcp_viewlogs.html included
  • +
  • [PHPBB3-9492] - Group avatar overwrites currently defined user avatars
  • +
  • [PHPBB3-9766] - phpbb_default_captcha::delete_code() takes no argument but uses $confirm_id
  • +
  • [PHPBB3-9918] - $redirect variable set, but not used, in mcp functions
  • +
  • [PHPBB3-10006] - phpbb_config::delete is missing
  • +
  • [PHPBB3-10013] - Cache test writes to a temporary location deep in the source tree
  • +
  • [PHPBB3-10045] - Database updater version for changes between 3.0.x and 3.1.0 should be 3.1.0-dev
  • +
  • [PHPBB3-10070] - CRLF in develop
  • +
  • [PHPBB3-10080] - request_var tests fail when other tests using request_var are executed first
  • +
  • [PHPBB3-10103] - Fix remaining usage of flock() by converting it to use the lock class
  • +
  • [PHPBB3-10136] - Missing $request globalizations in includes/functions.php
  • +
  • [PHPBB3-10139] - Use of $cache for two different things in includes/config/db.php
  • +
  • [PHPBB3-10151] - Version number needs to be updated in installer
  • +
  • [PHPBB3-10152] - Installer places ?> in config.php
  • +
  • [PHPBB3-10156] - Cron tests fail on windows
  • +
  • [PHPBB3-10290] - Who's online broken due to malformed SQL
  • +
  • [PHPBB3-10300] - Groups teampage legends settings
  • +
  • [PHPBB3-10316] - Inconsistency between prosilver and subsilver when locking a topic while moving
  • +
  • [PHPBB3-10322] - No longer possible to include templates via variables, captcha broken
  • +
  • [PHPBB3-10329] - Function pcre_utf8_support() needs the "phpbb_" prefix
  • +
  • [PHPBB3-10350] - class phpbb_template_renderer_eval does not work
  • +
  • [PHPBB3-10355] - Template tests do not correctly end output buffering
  • +
  • [PHPBB3-10359] - Fix phpbb_request regression in download/file.php and style.php
  • +
  • [PHPBB3-10360] - search_results.html gone haywire!
  • +
  • [PHPBB3-10364] - ACP Permissions Roles Tabs Broken
  • +
  • [PHPBB3-10371] - $user->theme['imageset_path'] - doesn't exist anymore
  • +
  • [PHPBB3-10374] - Template cache viewer broken
  • +
  • [PHPBB3-10375] - Template Cache keeps regenerating cache files
  • +
  • [PHPBB3-10378] - Errors in imageset -> theme conversion
  • +
  • [PHPBB3-10380] - Imageset removal: bidi padding change
  • +
  • [PHPBB3-10384] - 1_DAY language variables are not working in templates anymore
  • +
  • [PHPBB3-10392] - Alternate nested block loop syntax broken for auto variables
  • +
  • [PHPBB3-10393] - Syntax error in cached template code
  • +
  • [PHPBB3-10409] - Running database_update.php multiple times breaks the update
  • +
  • [PHPBB3-10417] - phpbb_test_case_helpers::get_test_config() uses array_merge() on undefined $config
  • +
  • [PHPBB3-10444] - Edit reason remains if a post gets edited by a moderator for the second time
  • +
  • [PHPBB3-10457] - Undefined variable $request, when print-viewing PMs
  • +
  • [PHPBB3-10458] - Invalid html when print-viewing a PM
  • +
  • [PHPBB3-10459] - Make "Reply to all"on PMs as a button
  • +
  • [PHPBB3-10463] - Inherit template causes SQL error
  • +
  • [PHPBB3-10464] - Debug error in search settings/search index
  • +
  • [PHPBB3-10477] - Registration, forgot password broken
  • +
  • [PHPBB3-10481] - Test suite does not run on php 5.3
  • +
  • [PHPBB3-10495] - Tests have version checks against php 6.0.0
  • +
  • [PHPBB3-10500] - Miscellaneous issues in the new template engine
  • +
  • [PHPBB3-10541] - Empty "Select form:" dropdown when editing user
  • +
  • [PHPBB3-10547] - Log out instead of acp statistics page at the end of fresh install
  • +
  • [PHPBB3-10560] - Post count not updated to include unapproved posts (though topic count is) for moderators
  • +
  • [PHPBB3-10575] - UCP Register: Non-static method phpbb_captcha_factory::get_instance() should not be called statically
  • +
  • [PHPBB3-10579] - New license block has v2 duplicated
  • +
  • [PHPBB3-10602] - A bug in mail queue processing
  • +
  • [PHPBB3-10618] - Hardcoded phpBB 3.0 language in installer
  • +
  • [PHPBB3-10634] - cp modules: function loaded() only checks current module type
  • +
  • [PHPBB3-10636] - cache_moderators() generates invalid query
  • +
  • [PHPBB3-10637] - Extension manager: missed code changes in search
  • +
  • [PHPBB3-10641] - MCP still uses old plurality forms of language variables
  • +
  • [PHPBB3-10645] - Invalid CSS for checkboxes and radio buttons in ACP css
  • +
  • [PHPBB3-10652] - Template inheritance doesn't work
  • +
  • [PHPBB3-10655] - Bug in test case: phpbb_template_template_inheritance_test
  • +
  • [PHPBB3-10663] - Extension manager: finder class adds directories that should not match the query
  • +
  • [PHPBB3-10667] - Fix extensions and group positions tests under MySQL 5.5 strict mode
  • +
  • [PHPBB3-10671] - Integrity tests failing
  • +
  • [PHPBB3-10672] - Statistics .. Total posts
  • +
  • [PHPBB3-10678] - Provide Firebird, Oracle, and increased MSSQL support in unit tests
  • +
  • [PHPBB3-10685] - Template inheritance test produces a notice on php 5.4 due to an incompatible override of setup_engine
  • +
  • [PHPBB3-10690] - Undefined language string in MCP
  • +
  • [PHPBB3-10703] - extensions.php script dies miserably when ext directory is missing
  • +
  • [PHPBB3-10704] - Typo in a comment
  • +
  • [PHPBB3-10735] - Incorrect styles search order, locator's inability to use template inheritance for extensions
  • +
  • [PHPBB3-10736] - Composer is making tests fail
  • +
  • [PHPBB3-10742] - Tables in users list have incorrect width
  • +
  • [PHPBB3-10752] - acp_styles errors
  • +
  • [PHPBB3-10754] - $style should be renamed to $phpbb_style
  • +
  • [PHPBB3-10756] - Template classes don't belong in style directory
  • +
  • [PHPBB3-10759] - Database updater doesn't reset default style
  • +
  • [PHPBB3-10777] - Typo in viewtopic.php comment line 1632
  • +
  • [PHPBB3-10778] - Extra space on the link "Close Window" in prosilver/template/posting_smilies.html
  • +
  • [PHPBB3-10779] - "Serve jQuery using Google's CDN" Should be on ACP Load Settings, not Board Features
  • +
  • [PHPBB3-10781] - Quick Mod tools don't work
  • +
  • [PHPBB3-10784] - Do not show ajax overlay unless needed
  • +
  • [PHPBB3-10785] - Illegal use of $_REQUEST in develop/fill.php
  • +
  • [PHPBB3-10801] - Move topic in quickmod tools not functional
  • +
  • [PHPBB3-10802] - Splitting topics in quickmod tools not functional
  • +
  • [PHPBB3-10803] - When ajax requests fail, the failure message should remain visible until the user dismisses it
  • +
  • [PHPBB3-10805] - "Request timed out" ui appears over function ui in ajax
  • +
  • [PHPBB3-10807] - Deleting topics via quickmod provides no feedback
  • +
  • [PHPBB3-10808] - Locking topics via quickmod provides no feedback
  • +
  • [PHPBB3-10811] - AJAX callback "alt_text" insufficiently changes links
  • +
  • [PHPBB3-10813] - Installer does not check that php json extension is present
  • +
  • [PHPBB3-10818] - Global Announcements Update Dialog does not terminate with exit_handler()
  • +
  • [PHPBB3-10826] - 3.1-dev Database Updater keeps running group_legend query
  • +
  • [PHPBB3-10837] - Undefined index in extension tests
  • +
  • [PHPBB3-10844] - Extensions are not located when front-end file has a diffferent phpbb_root_path
  • +
  • [PHPBB3-10845] - Reported post text does not get bbcode-parsed when viewing a post report
  • +
  • [PHPBB3-10847] - Dependent is misspelled a number of times
  • +
  • [PHPBB3-10871] - In "Posts awaiting approval" if there's more than one post it shows no posts
  • +
  • [PHPBB3-10875] - SQL Cache is not used
  • +
  • [PHPBB3-10876] - Xampp crashes on Develop when template has too many ORs in an IF statement
  • +
  • [PHPBB3-10885] - UCP Main Error if no forums exist
  • +
  • [PHPBB3-10888] - cachepath in template class is set externally
  • +
  • [PHPBB3-10905] - Last topic title missing in subsilver
  • +
  • [PHPBB3-10906] - Last post title does not work for new installs of 3.1-dev due to missing change to schema_data.sql
  • +
  • [PHPBB3-10912] - Undefined variable: last_post_subject_truncated
  • +
  • [PHPBB3-10915] - Sort not installed styles list in admin control panel - styles
  • +
  • [PHPBB3-10943] - Search Box should display keywords entered by the user
  • +
  • [PHPBB3-10954] - Mark topics as read AJAX
  • +
  • [PHPBB3-10976] - Running tests using phpunit.xml.all fails
  • +
  • [PHPBB3-10982] - Allow setting dimming control overlay also as data-overlay
  • +
  • [PHPBB3-10998] - No border-radius for forum rules block
  • +
  • [PHPBB3-10999] - Asset version not defined in adm/
  • +
  • [PHPBB3-11002] - Etc/GMT timezones return wrong offset
  • +
  • [PHPBB3-11003] - Ability to show full list of timezones with JavaScript enabled
  • +
  • [PHPBB3-11004] - The timezone suggestion button is not a real button
  • +
  • [PHPBB3-11007] - Timezone selector shows all timezones
  • +
  • [PHPBB3-11014] - Previous/next links are no longer displayed.
  • +
  • [PHPBB3-11018] - Pagination in memberlist
  • +
  • [PHPBB3-11023] - Fix excess tabbing and spacing in functions.php
  • +
  • [PHPBB3-11029] - Cannot break/continue 1 level in includes\cache\service.php:340
  • +
  • [PHPBB3-11041] - global $php_ext instead of global $phpEx
  • +
  • [PHPBB3-11043] - Update template hook name
  • +
  • [PHPBB3-11046] - No border-radius for UCP message colours block
  • +
  • [PHPBB3-11047] - Unclosed variable shows incorrect language key
  • +
  • [PHPBB3-11052] - Search class changes not reflected in installer or convertor
  • +
  • [PHPBB3-11065] - li tag on topic display options at MCP is unclosed
  • +
  • [PHPBB3-11067] - Pagination in ACP is missing CSS code from pagination change
  • +
  • [PHPBB3-11077] - Feed still has fallback code for global announcement with forum_id = 0
  • +
  • [PHPBB3-11086] - Database Updater still relies on cache factory - needs to be updated to use DIC
  • +
  • [PHPBB3-11089] - Database type mysql sets unusable board
  • +
  • [PHPBB3-11092] - phpbb_gen_download_links strict standards errors
  • +
  • [PHPBB3-11095] - Jumpbox should use "get" method
  • +
  • [PHPBB3-11099] - Clicking Banning tab in MCP causes all tabs to collapse down
  • +
  • [PHPBB3-11100] - jabber::can_use_ssl() should not be called statically in includes/acp/acp_jabber.php on line 124
  • +
  • [PHPBB3-11101] - Container processors are executed before globals exist
  • +
  • [PHPBB3-11106] - Undefined index: EDITED_TIME_TOTAL
  • +
  • [PHPBB3-11139] - Colour swatch window with Fatal error
  • +
  • [PHPBB3-11140] - MCP Front errors on reported posts
  • +
  • [PHPBB3-11154] - Unable to upgrade 3.0 QI-installed board to 3.1
  • +
  • [PHPBB3-11157] - Strict spam renders spambot countermeasures page unusable
  • +
  • [PHPBB3-11159] - Coding guidelines: static public
  • +
  • [PHPBB3-11166] - AJAX confirm box is not using custom templates given
  • +
  • [PHPBB3-11171] - Copy bbcode fields, etc. for reported posts
  • +
  • [PHPBB3-11176] - Functional tests do not run
  • +
  • [PHPBB3-11177] - Postgres search when query has only negation
  • +
  • [PHPBB3-11187] - Functional tests broken by new config class
  • +
  • [PHPBB3-11188] - postgres search result count does not get the total count
  • +
  • [PHPBB3-11190] - Functional tests do not clear the cache between each test
  • +
  • [PHPBB3-11194] - PHP Notice: Undefined index "tag"
  • +
  • [PHPBB3-11198] - AJAX move up/down links not replaced correctly
  • +
  • [PHPBB3-11199] - Cache purge should remove dumped container
  • +
  • [PHPBB3-11200] - Container construction fails with non-MySQLi drivers
  • +
  • [PHPBB3-11204] - Wrong indentation in functional test case base class
  • +
  • [PHPBB3-11205] - Merge conflict in readme.html
  • +
  • [PHPBB3-11206] - Avatars are broken, includes non-existent files
  • +
  • [PHPBB3-11208] - Functional tests are broken
  • +
  • [PHPBB3-11209] - Always clone Ajax disable images to avoid problems if they are used multiple times on the same page
  • +
  • [PHPBB3-11211] - Call to undefined function phpbb_real_path() in /phpBB/includes/di/extension/ext.php on line 52
  • +
  • [PHPBB3-11212] - Catch non-existent globals if error occurs during container construction
  • +
  • [PHPBB3-11213] - Missing global in install_update.php
  • +
  • [PHPBB3-11227] - @return void -> @return null
  • +
  • [PHPBB3-11236] - Prune users requires group selection if any groups are defined
  • +
  • [PHPBB3-11237] - php spam when pruning users
  • +
  • [PHPBB3-11247] - php spam in flock class
  • +
  • [PHPBB3-11248] - CRLF line endings
  • +
  • [PHPBB3-11253] - Signature module acl is not going to be added to 3.1 boards
  • +
  • [PHPBB3-11256] - Unused service controller.route_collection
  • +
  • [PHPBB3-11257] - Using Service Collection requires set_name() method to exist
  • +
  • [PHPBB3-11263] - PHP Notice: in file functions_messenger.php on line 213: Undefined variable: extension_manager
  • +
  • [PHPBB3-11273] - Missing space after Sphinx "Indexer memory limit" input box
  • +
  • [PHPBB3-11277] - User DST column is not removed on update, and therefor user_timezone is updated everytime the update file is run
  • +
  • [PHPBB3-11279] - "Something went wrong when processing your request." is not acceptable language
  • +
  • [PHPBB3-11291] - "Could not open input file: ../composer.phar" error during phing's create-package
  • +
  • [PHPBB3-11298] - ACP_EXTENSIONS_MANAGEMENT missing string
  • +
  • [PHPBB3-11302] - No timezone is selected by default in registration form
  • +
  • [PHPBB3-11303] - Timezone selection is not preserved in registration form
  • +
  • [PHPBB3-11305] - Installer is broken on develop
  • +
  • [PHPBB3-11309] - phpbb_extension_interface::disable_step correct docblock
  • +
  • [PHPBB3-11310] - CSRF in style installation in acp
  • +
  • [PHPBB3-11311] - Include javascript core.js file in subsilver2 overall_footer.html
  • +
  • [PHPBB3-11313] - Typo in alt_text callback breaks replacement of text
  • +
  • [PHPBB3-11320] - Database test cases fail if functions file is not included and config file exists
  • +
  • [PHPBB3-11321] - Recreate schema files with develop/create_schema_files.php
  • +
  • [PHPBB3-11323] - Not possible to define template variable with other variables
  • +
  • [PHPBB3-11329] - Color values should be in colours.css, not buttons.css
  • +
  • [PHPBB3-11334] - Controller helper url() method still generates URLs like app.php/route/to/page instead of app.php?controller=route/to/page
  • +
  • [PHPBB3-11335] - Hook finder fails to load hooks
  • +
  • [PHPBB3-11342] - Marking subforums as read does not change the unread icons of active topics
  • +
  • [PHPBB3-11344] - ACP_STYLE_COMPONENTS
  • +
  • [PHPBB3-11345] - Font size on new buttons is too thin
  • +
  • [PHPBB3-11350] - $db should not be passed by reference to db_tools
  • +
  • [PHPBB3-11362] - Resource locator does not find admin template files from extensions
  • +
  • [PHPBB3-11363] - Migrations module tool does not load info files from extensions
  • +
  • [PHPBB3-11367] - Migrator throws error if migrations table does not exist
  • +
  • [PHPBB3-11369] - Reverting migration throws error (attempt to unserialize string)
  • +
  • [PHPBB3-11370] - Effectively installed migrations not inserted into migrations table
  • +
  • [PHPBB3-11372] - Migrator should only check if effectively installed if the migration is not installed at all
  • +
  • [PHPBB3-11381] - Finder cannot find items for non-enabled extensions (required during installation)
  • +
  • [PHPBB3-11383] - Uninstalling an extension that adds a module causes an error upon purge
  • +
  • [PHPBB3-11385] - get_module_infos from migrator does not return module info
  • +
  • [PHPBB3-11386] - Migrator can include files multiple times
  • +
  • [PHPBB3-11387] - Module add tool logs module as added even if it fails due to error (migrations)
  • +
  • [PHPBB3-11388] - Extension CSS files are not being auto-loaded
  • +
  • [PHPBB3-11394] - Migration Tools are too strict
  • +
  • [PHPBB3-11395] - acp_modules::get_module_infos can include files multiple times
  • +
  • [PHPBB3-11396] - insert_migration also updates migration (should rename function)
  • +
  • [PHPBB3-11398] - Migrations permission tool's method permission_set causes fatal error
  • +
  • [PHPBB3-11400] - Notification system assumes email is always available
  • +
  • [PHPBB3-11402] - Undefined offset 0 post/topic_in_queue (notifications)
  • +
  • [PHPBB3-11403] - Multiinsert for notifications should use batches
  • +
  • [PHPBB3-11404] - Can not access ACP "manage group" page while creating new groups
  • +
  • [PHPBB3-11405] - Users that are subscribed to a forum, don't receive notifications for new replies
  • +
  • [PHPBB3-11407] - UI notifications have wrong <dfn> info next to checkbox
  • +
  • [PHPBB3-11408] - Undefined index jabber (should be user_jabber)
  • +
  • [PHPBB3-11411] - Broken primary key on phpbb_notification_types table
  • +
  • [PHPBB3-11413] - phpbb_notification_types table should have an integer primary key
  • +
  • [PHPBB3-11415] - Accessing phpbb_migrations table from index page (or other pages)
  • +
  • [PHPBB3-11416] - Primary key on phpbb_notifications table too small
  • +
  • [PHPBB3-11417] - Notification Options page in User Control Panel has "Mark read" as submit button.
  • +
  • [PHPBB3-11420] - Notification methods are not (correctly) imported
  • +
  • [PHPBB3-11421] - Submit button missing from UCP notifications module
  • +
  • [PHPBB3-11422] - Assets should be incremented on database update
  • +
  • [PHPBB3-11423] - Email has HTML from username
  • +
  • [PHPBB3-11433] - Loading alert message is shown beneath overlay
  • +
  • [PHPBB3-11435] - Extension template files curly braces bug
  • +
  • [PHPBB3-11437] - Sphinx debug assert failed when no search results are found
  • +
  • [PHPBB3-11438] - Sphinx default config does not work properly
  • +
  • [PHPBB3-11439] - Notification tests are not run via phpunit.xml.dist
  • +
  • [PHPBB3-11440] - Mixed type (string vs integer) in SQL query against phpbb_users
  • +
  • [PHPBB3-11442] - AJAX in the ACP Does not work wherever Confirm Box modals are used
  • +
  • [PHPBB3-11443] - Two migration tests are not run via phpunit.xml.dist
  • +
  • [PHPBB3-11448] - phpbb_notification_manager::mark_notifications_read takes $user_id as a parameter but isn't using it
  • +
  • [PHPBB3-11450] - phpbb_extension_metadata_manager has wrong docs and too many arguments
  • +
  • [PHPBB3-11451] - class phpbb_notification_method_jabber extends phpbb_notification_method_email
  • +
  • [PHPBB3-11452] - phpbb_notification_method_email::is_available() should return false when user doesn't have an email address
  • +
  • [PHPBB3-11454] - Jabber notifications are not working at all
  • +
  • [PHPBB3-11455] - Sort phpBB/config/tables.yml in alphabetic order
  • +
  • [PHPBB3-11457] - class phpbb_notification_test should not require/use the global set_var() function
  • +
  • [PHPBB3-11460] - New installs have wrong data in phpbb_user_notifications table.
  • +
  • [PHPBB3-11464] - Config table load_cpf_pm is missing on new install
  • +
  • [PHPBB3-11466] - phpunit configs excludes non-existant files
  • +
  • [PHPBB3-11471] - Some email templates contain unrelated text
  • +
  • [PHPBB3-11474] - "Post in queue" notification send to too many moderators
  • +
  • [PHPBB3-11478] - Daylight Savingtime changes old posts in time, too.
  • +
  • [PHPBB3-11479] - Can not access install/index.php?mode=update
  • +
  • [PHPBB3-11485] - migration doesn't add necessary columns to phpbb_styles table when updating schemas.
  • +
  • [PHPBB3-11488] - Notification email error
  • +
  • [PHPBB3-11489] - Change forum list layout to work at any resolution
  • +
  • [PHPBB3-11491] - Functional test for extensions has wrong class name and is in the wrong directory
  • +
  • [PHPBB3-11492] - memberlist user_ids array uninitalized can lead to error
  • +
  • [PHPBB3-11494] - Fix memberlist leaders functional tests
  • +
  • [PHPBB3-11501] - Fix "This test did not perform any assertions" message on some tests
  • +
  • [PHPBB3-11503] - Implementation of DB drivers vary too much
  • +
  • [PHPBB3-11516] - .live() deprecated in new version of jquery
  • +
  • [PHPBB3-11535] - ACP und UCP avatar groups settings do not display an error upon submitting incorrect data
  • +
  • [PHPBB3-11549] - Resource locator does not find admin template files from extensions
  • +
  • [PHPBB3-11550] - Functional extension controller test should use $helpers to copy and remove files
  • +
  • [PHPBB3-11551] - ACP System tab errors: [phpBB Debug] - PHP Notice: in file [ROOT] -/includes/acp/acp_update.php on line 49: Undefined offset: 1
  • +
  • [PHPBB3-11553] - Links list errors
  • +
  • [PHPBB3-11554] - forum_fn.js should be moved to footer
  • +
  • [PHPBB3-11555] - Pagination page selection JS is broken
  • +
  • [PHPBB3-11556] - Remove non-jquery fallback code from forum_fn.js
  • +
  • [PHPBB3-11560] - Missing T_JQUERY_LINK template variable in installer
  • +
  • [PHPBB3-11561] - Notification functional tests fail using phpunit.xml.all
  • +
  • [PHPBB3-11562] - forum_fn.js cleanup
  • +
  • [PHPBB3-11563] - Move subPanels() code from html templates to forum_fn.js
  • +
  • [PHPBB3-11564] - Notifications list errors
  • +
  • [PHPBB3-11567] - Fatal error at database update
  • +
  • [PHPBB3-11569] - Database update fails at continuing on some environments
  • +
  • [PHPBB3-11570] - No way to get back to update routine when in database updater
  • +
  • [PHPBB3-11573] - Test Suite does not work with MySQL STRICT_TRANS_TABLES (MySQL 5.6)
  • +
  • [PHPBB3-11574] - Unable to "auto update" from 3.0 to 3.1
  • +
  • [PHPBB3-11585] - Strict Standars error when editing the role
  • +
  • [PHPBB3-11586] - Fix/cleanup some of upload_attachment()'s code
  • +
  • [PHPBB3-11587] - Group gets removed from legend when editing one in UCP
  • +
  • [PHPBB3-11593] - filter->compile_var_tags uses undefined variable
  • +
  • [PHPBB3-11594] - Template filter not aware of extension context
  • +
  • [PHPBB3-11599] - Tree tests are very slow
  • +
  • [PHPBB3-11602] - Do not call avatar_manager's localize_errors() if avatars are disabled
  • +
  • [PHPBB3-11605] - Order of files and directories given to phpbb_test_case_helpers->remove_files() matters.
  • +
  • [PHPBB3-11622] - Template events are loaded incorrectly
  • +
  • [PHPBB3-11647] - URLs are incorrectly handled by INCLUDEJS
  • +
  • [PHPBB3-11660] - Bootstrap container from config.php bugs
  • +
  • [PHPBB3-11664] - Creating php.html file in root path in tests
  • +
  • [PHPBB3-11665] - Can't change file names already sent to set_filenames
  • +
  • [PHPBB3-11675] - Uncaught exception 'Twig_Error_Syntax' -Permissions User roles-
  • +
  • [PHPBB3-11687] - assets_version is missing in phpbb_config
  • +
  • [PHPBB3-11688] - Cache purge does not purge the twig directory
  • +
  • [PHPBB3-11691] - Soft delete migration conversion should be staggered
  • +
  • [PHPBB3-11692] - Don't update search_type in dev migration if already appended with phpbb_search_
  • +
  • [PHPBB3-11694] - Twig Error on ACP Login page
  • +
  • [PHPBB3-11695] - Cannot edit first post in a topic more than once without manually changing "Options Per User" to 1 on second edit.
  • +
  • [PHPBB3-11696] - phpbb_db_tools does not autoload
  • +
  • [PHPBB3-11697] - fulltext_mysql.php - author_search() uses incorrect $m_approve_fid_ary parameter
  • +
  • [PHPBB3-11701] - TWIG breaks template events for events inside of looped template code
  • +
  • [PHPBB3-11702] - Forumlink gives general error
  • +
  • [PHPBB3-11706] - getimagesize() should be called with @ to prevent PHP warning in remote avatar
  • +
  • [PHPBB3-11707] - Twig DEFINE not working as expected
  • +
  • [PHPBB3-11708] - Invalid bulletin point in notifications
  • +
  • [PHPBB3-11712] - Typo in editor.js
  • +
  • [PHPBB3-11713] - Module gets removed by ajax even if removal was not successful
  • +
  • [PHPBB3-11717] - View unanswered posts = General error
  • +
  • [PHPBB3-11718] - Twig lexer only correcting statements in IF, not ELSEIF
  • +
  • [PHPBB3-11723] - Can not agree to Terms of Service if more than one language is installed
  • +
  • [PHPBB3-11725] - No Avatar image -upload avatar-
  • +
  • [PHPBB3-11727] - INCLUDECSS and INCLUDEJS incorrectly default to /template/ folder
  • +
  • [PHPBB3-11728] - Fix last occurance of topic_approved index
  • +
  • [PHPBB3-11729] - memberlist.php is empty white page
  • +
  • [PHPBB3-11731] - Make calls for captcha garbage collections non-static
  • +
  • [PHPBB3-11733] - Illegal offset type Warning in [ROOT] -/includes/auth/auth.php via [ROOT] -/feed.php
  • +
  • [PHPBB3-11734] - Missing permession in language file
  • +
  • [PHPBB3-11735] - Missing checkbox in User Control Panel / Manage notifications
  • +
  • [PHPBB3-11739] - Wrong name for UCP Module "Edit "Remember Me" login keys"
  • +
  • [PHPBB3-11741] - Brackets exist even without any text
  • +
  • [PHPBB3-11751] - MCP Softdelete Modules missing when updating board
  • +
  • [PHPBB3-11754] - Remove leftovers of style switcher
  • +
  • [PHPBB3-11755] - MySQL Upgrader out of date for 3.1
  • +
  • [PHPBB3-11757] - Typo in signature_module_auth migration
  • +
  • [PHPBB3-11759] - Migrations update to the wrong 3.0.x version numbers.
  • +
  • [PHPBB3-11761] - Example.org no longer serves blank responses, failing functional tests
  • +
  • [PHPBB3-11763] - Debug and SQL Error when reporting a PM
  • +
  • [PHPBB3-11767] - Unable to update DB from 3.0.X to 3.1.X because of post_visibility
  • +
  • [PHPBB3-11770] - Invalid class for pm list in outbox/sentbox
  • +
  • [PHPBB3-11774] - PHP errors on viewing reported post details
  • +
  • [PHPBB3-11777] - Extension template events are not loaded from subdirectories
  • +
  • [PHPBB3-11779] - Invalid class for unapproved posts in mcp index
  • +
  • [PHPBB3-11780] - Remove unused images from prosilver
  • +
  • [PHPBB3-11781] - update_post_information() is not defined in phpbb_content_visibility->set_post_visibility
  • +
  • [PHPBB3-11782] - Notices inside posts look messy
  • +
  • [PHPBB3-11791] - Template events are not loaded in ACP
  • +
  • [PHPBB3-11792] - core.user_setup event doesn't support loading language files from extensions
  • +
  • [PHPBB3-11796] - Duplicate code for pagination
  • +
  • [PHPBB3-11800] - Incorrect inclusion of scripts in popup window
  • +
  • [PHPBB3-11804] - </li> tag at overall_header.html (prosilver) which was not open
  • +
  • [PHPBB3-11805] - pagination does not support controller_helper urls
  • +
  • [PHPBB3-11809] - core.js should be loaded directly after jQuery and after every other JS file
  • +
  • [PHPBB3-11811] - Chrome 30 adds outline to focused elements
  • +
  • [PHPBB3-11812] - No longer able to define empty template variable using DEFINE
  • +
  • [PHPBB3-11816] - Twig regression: parentheses in IF statements stop DEFINE variables and loop lengths from working
  • +
  • [PHPBB3-11822] - Template include asset doesn't follow namespace lookup order
  • +
  • [PHPBB3-11824] - Controller URLs do not work anymore
  • +
  • [PHPBB3-11825] - phpBB/phpbb/ should only contain classes
  • +
  • [PHPBB3-11828] - Twig DEFINE is causing errors
  • +
  • [PHPBB3-11832] - URLs in tests aren't shortened, triggering errors in Composer files
  • +
  • [PHPBB3-11833] - Twig error while viewing user notes
  • +
  • [PHPBB3-11835] - phpbb_db_migration_data_310_auth_provider_oauth: A required module does not exist: UCP_AUTH_LINK
  • +
  • [PHPBB3-11836] - Manage external account associations error
  • +
  • [PHPBB3-11837] - UCP_AUTH_LINK_NOT_SUPPORTED (untranslated)
  • +
  • [PHPBB3-11843] - Regression: using underscores in template DEFINE variables yields unexpected behavior
  • +
  • [PHPBB3-11846] - Empty paragraph elements in jumpbox.html
  • +
  • [PHPBB3-11850] - $user->page contains bogus data on controller (app.php) pages
  • +
  • [PHPBB3-11852] - filesystem class must not depend on a web request
  • +
  • [PHPBB3-11862] - Events core.delete_user_before and core.delete_user_after compact the wrong vars
  • +
  • [PHPBB3-11865] - includes/bbcode.php is missing namespace change
  • +
  • [PHPBB3-11866] - "You have specified an invalid dbms driver" Error with config sample
  • +
  • [PHPBB3-11867] - Schema files are not created by create_schema_files.php
  • +
  • [PHPBB3-11868] - Class 'phpbb_request_interface' not found
  • +
  • [PHPBB3-11871] - Extension modules are not working with namespaces anymore
  • +
  • [PHPBB3-11874] - RSS Feed -Bug Url-
  • +
  • [PHPBB3-11878] - Missing leading \ in dependencies in soft_delete_mcp_modules
  • +
  • [PHPBB3-11882] - Incorrect dependency in signature module auth migration
  • +
  • [PHPBB3-11888] - On New installation the default search backend is not shown correctly.
  • +
  • [PHPBB3-11890] - Language key used when soft-deleting in MCP.
  • +
  • [PHPBB3-11892] - Undefined variable: to_forum_id after cancelling merge topic/move posts
  • +
  • [PHPBB3-11893] - Font size in "Edit 'Remember Me' login keys" is large
  • +
  • [PHPBB3-11895] - Forum feed stopped working
  • +
  • [PHPBB3-11898] - Unable to login to ACP on AREA51
  • +
  • [PHPBB3-11901] - Undefined offset: 3 in file [ROOT] -/includes/functions_content.php on line 776
  • +
  • [PHPBB3-11905] - Alpha 1 Migration
  • +
  • [PHPBB3-11906] - Missing database entries "read_notification"
  • +
  • [PHPBB3-11908] - class phpbb_auth_provider_oauth_service_exception not using namespaces
  • +
  • [PHPBB3-11918] - Can not update from 3.0.x to 3.1.x with MSSQL
  • +
  • [PHPBB3-11919] - Improper argument order for sql_fetchfield() in notification manager
  • +
+

Improvement

+
    +
  • [PHPBB3-7598] - Reminding inactive users
  • +
  • [PHPBB3-7938] - Display information about unread and new PMs in the header.
  • +
  • [PHPBB3-8065] - Add an option to lock topics while moving them.
  • +
  • [PHPBB3-8270] - Automatically loaded language-files for mods
  • +
  • [PHPBB3-8796] - Mark forum(s) read (or mark topics read) marks some topics you haven't read
  • +
  • [PHPBB3-9346] - Use different message template for jabber notification
  • +
  • [PHPBB3-9532] - Optimized Page Titles
  • +
  • [PHPBB3-9549] - Enhance teampage functionality
  • +
  • [PHPBB3-9596] - Modular cron and allowing cron tasks to be run from system cron
  • +
  • [PHPBB3-9608] - Cleanse object references from codebase for 3.1
  • +
  • [PHPBB3-9649] - Moderator queue does not display icon if the new post is made in old thread
  • +
  • [PHPBB3-9668] - Automatic UTF-8 normalization
  • +
  • [PHPBB3-9669] - Native UTF-8 normalization
  • +
  • [PHPBB3-9684] - Link global announcements to forums
  • +
  • [PHPBB3-9693] - generate_smilies clean up
  • +
  • [PHPBB3-9716] - Handle user input through a request class providing a more complete mechanism than request_var
  • +
  • [PHPBB3-9741] - Do not store any themes or templates in the database
  • +
  • [PHPBB3-9746] - Normalise internet protocol version 6 addresses
  • +
  • [PHPBB3-9792] - Move function definitions out of download/file.php
  • +
  • [PHPBB3-9823] - Move functions definitions out of adm/index.php
  • +
  • [PHPBB3-9979] - Autoloading for test suite
  • +
  • [PHPBB3-10001] - Class Based Forum/Topic Image
  • +
  • [PHPBB3-10076] - STARTTLS for emails
  • +
  • [PHPBB3-10143] - Delete-write-read test for config classes
  • +
  • [PHPBB3-10148] - Turn TEMPLATE_BITFIELD into an instance variable in acp_styles.php
  • +
  • [PHPBB3-10155] - Inclusion of jQuery
  • +
  • [PHPBB3-10161] - Use one of "email" or "e-mail"
  • +
  • [PHPBB3-10172] - Display empty birthday box in prosilver when birthdays are enabled but there are none today
  • +
  • [PHPBB3-10258] - Use HTML5 doctype
  • +
  • [PHPBB3-10271] - confirm_box operations should use AJAX
  • +
  • [PHPBB3-10272] - Simple operations should use AJAX
  • +
  • [PHPBB3-10273] - Accepting / denying posts should use AJAX
  • +
  • [PHPBB3-10281] - Reordering forums in the ACP should use AJAX
  • +
  • [PHPBB3-10312] - Un-check "Leave shadow topic in place" checkbox when moving topics
  • +
  • [PHPBB3-10325] - Ability to disable the "I forgot my password" feature
  • +
  • [PHPBB3-10336] - Removing imagesets in 3.1
  • +
  • [PHPBB3-10344] - Add attachment icons to list of reports and queue
  • +
  • [PHPBB3-10362] - HTML5 Fix - "name" attribute is deprecated in anchors. Use "id" attribute instead.
  • +
  • [PHPBB3-10383] - Polls should use AJAX
  • +
  • [PHPBB3-10387] - generate_pagination() should export the current page number as a template variable
  • +
  • [PHPBB3-10390] - Add an ACP option to use jQuery via local copy or remote CDN
  • +
  • [PHPBB3-10410] - Add option to display users in their first teampage group
  • +
  • [PHPBB3-10412] - Use memory_get_peak_usage for debug output instead of memory_get_usage
  • +
  • [PHPBB3-10431] - Remove language from the button-graphics and use text strings instead
  • +
  • [PHPBB3-10438] - Alligning the Smileys on the same line as the text.
  • +
  • [PHPBB3-10484] - Use variables for sql_build_query() calls, so mods/extensions can extend the arrays
  • +
  • [PHPBB3-10510] - Quick-mod markup should be in the template
  • +
  • [PHPBB3-10524] - Wrong version code name in Ascraeus coding guidelines document.
  • +
  • [PHPBB3-10535] - Remove "Confirm Email Address" field from registration form
  • +
  • [PHPBB3-10557] - Missing IN_PHPBB check in phpBB/includes/functions_acp.php
  • +
  • [PHPBB3-10601] - Move inbox to top module in UCP Private Messages Tab
  • +
  • [PHPBB3-10614] - Script to manage extensions
  • +
  • [PHPBB3-10617] - prosilver clean up: adding proper css reset
  • +
  • [PHPBB3-10619] - prosilver clean up: removing duplicate colors
  • +
  • [PHPBB3-10632] - Merging style components
  • +
  • [PHPBB3-10640] - Bigger Topic Title Length
  • +
  • [PHPBB3-10650] - Last Topic Title on Forum list
  • +
  • [PHPBB3-10659] - Allow all administrators to purge cache
  • +
  • [PHPBB3-10665] - INCLUDEJS template tag
  • +
  • [PHPBB3-10679] - Add new permission for changing profile field information
  • +
  • [PHPBB3-10705] - Replace WARNINGS_ZERO_TOTAL with NO_WARNINGS for consistency
  • +
  • [PHPBB3-10714] - Create a class for add_log() and unit tests
  • +
  • [PHPBB3-10726] - Preview from Quick Reply
  • +
  • [PHPBB3-10727] - Don't hide quickreply with javascript
  • +
  • [PHPBB3-10733] - Adding file locator function to style class
  • +
  • [PHPBB3-10734] - CSS3 rounded corners
  • +
  • [PHPBB3-10741] - Automatically resize textarea
  • +
  • [PHPBB3-10743] - Change theme to style in php code
  • +
  • [PHPBB3-10762] - Separate style and phpBB version numbers in style.cfg
  • +
  • [PHPBB3-10771] - Using Remember Me instead of autologin or persistent keys in the UI.
  • +
  • [PHPBB3-10780] - Move colons from template files to language files
  • +
  • [PHPBB3-10783] - assets_version config var appended to assets (css/js) URLs to prevent caching
  • +
  • [PHPBB3-10786] - Render search options by default on memberlist.php
  • +
  • [PHPBB3-10799] - includejs should not put phpbb root path in generated template code
  • +
  • [PHPBB3-10800] - includejs test confusingly includes an html file
  • +
  • [PHPBB3-10864] - Allow extensions to be accessed via controller with shorter access name than "vendor/extname"
  • +
  • [PHPBB3-10933] - Make style code more understandable
  • +
  • [PHPBB3-10936] - MySQL fulltext search improvement - removing check for PCRE UTF support
  • +
  • [PHPBB3-10938] - Display subforum listing on forumlist via template loop instead of PHP implode()
  • +
  • [PHPBB3-10947] - Quickmod tools have stopped autosubmitting
  • +
  • [PHPBB3-10955] - ajaxify should take options as the only argument
  • +
  • [PHPBB3-10966] - Remove code duplication from mysql* and mssql* dbal
  • +
  • [PHPBB3-10968] - Render pagination fully within the template
  • +
  • [PHPBB3-10970] - Allow INCLUDE template macros to accept paths of the form {FOO}/a/{BAR}/c
  • +
  • [PHPBB3-10972] - Add a new method to phpbb_functional_test_case to allow a new user to be created
  • +
  • [PHPBB3-10973] - Allow mocks to be autoloaded in tests
  • +
  • [PHPBB3-10975] - Memberlist functional tests
  • +
  • [PHPBB3-10990] - $user->lang['COMMA_SEPARATOR'] - is not uniformly used
  • +
  • [PHPBB3-11001] - html5 Placeholder for search box.
  • +
  • [PHPBB3-11008] - Get rid of eval in javascript
  • +
  • [PHPBB3-11010] - HTML5 input types for form fields
  • +
  • [PHPBB3-11011] - Using dependency injection for global variables in all search backends.
  • +
  • [PHPBB3-11012] - Member variable phpEx vs php_ext naming inconstistency
  • +
  • [PHPBB3-11013] - Allow arrays to be assigned and retrieved in templates
  • +
  • [PHPBB3-11015] - Make DBAL classes autoloadable
  • +
  • [PHPBB3-11021] - Link back to main site config setting
  • +
  • [PHPBB3-11025] - Make Last topic title in forum list Bold
  • +
  • [PHPBB3-11032] - Better error reporting for sphinx
  • +
  • [PHPBB3-11037] - Cache drivers require globals
  • +
  • [PHPBB3-11044] - Compress class should keep track of files added and deal with conflicts
  • +
  • [PHPBB3-11048] - Use access specifiers in search backends
  • +
  • [PHPBB3-11050] - Add docblocks missing in properties and methods in all search backends.
  • +
  • [PHPBB3-11051] - Add retrieval functions for all public properties in search backends
  • +
  • [PHPBB3-11068] - Hiding foes posts should use JS to display them, rather then reloading the whole page
  • +
  • [PHPBB3-11070] - Redundant background-position property in Prosilver button CSS?
  • +
  • [PHPBB3-11082] - Redis cache driver should not have executable permission
  • +
  • [PHPBB3-11083] - Abstract cache drivers should use abstract keyword
  • +
  • [PHPBB3-11088] - Combine Style and Extension Management into one Customisations tab in the ACP
  • +
  • [PHPBB3-11116] - Adjust Display of Warning/Error Messages in Extensions Controller
  • +
  • [PHPBB3-11129] - Misleading subscription state messages
  • +
  • [PHPBB3-11152] - Create cached, compiled container class rather than compiling it on every page load
  • +
  • [PHPBB3-11156] - Delete "Misc" tab of forum based permissions + move items
  • +
  • [PHPBB3-11174] - Unit tests for search backends
  • +
  • [PHPBB3-11181] - Bump PHP requirement to 5.3.3
  • +
  • [PHPBB3-11183] - Remove $load_extensions and weird dl() calls
  • +
  • [PHPBB3-11189] - Merge DEBUG and DEBUG_EXTRA
  • +
  • [PHPBB3-11193] - Generalize phpbb_di_pass_collection_pass to handle all collections using service tags
  • +
  • [PHPBB3-11197] - Prefix the css classes for the small arrow with "arrow".
  • +
  • [PHPBB3-11202] - Add response status checks to functional tests
  • +
  • [PHPBB3-11215] - Separate root path for filesystem and urls/assets
  • +
  • [PHPBB3-11217] - Prefix for template values to give back value URL encoded
  • +
  • [PHPBB3-11238] - Specify goutte version
  • +
  • [PHPBB3-11250] - Remake the unit tests for the BBCode parser.
  • +
  • [PHPBB3-11259] - Make $phpbb_admin_path available everywhere
  • +
  • [PHPBB3-11268] - Delete phpbb_db_driver_mysql4 case
  • +
  • [PHPBB3-11275] - editor.js::colorPalette() breaks page with document.write > add proper target
  • +
  • [PHPBB3-11283] - Extensions as symlinks
  • +
  • [PHPBB3-11294] - Update extension list in running tests doc
  • +
  • [PHPBB3-11306] - Container should be created by a phpbb_create_default_container() function
  • +
  • [PHPBB3-11314] - Improve readability and code cleanup in new JavaScript files
  • +
  • [PHPBB3-11328] - New language variables for buttons
  • +
  • [PHPBB3-11373] - Notifications - Purge old with cron
  • +
  • [PHPBB3-11390] - Remove pagination from ucp_notifications.html when list is empty.
  • +
  • [PHPBB3-11393] - Give more information on database_updater about what exactly happened
  • +
  • [PHPBB3-11409] - No feedback provided when updating group position settings in ACP
  • +
  • [PHPBB3-11458] - Automatically add extension permission language files
  • +
  • [PHPBB3-11461] - [Template Event] - viewtopic_body_footer
  • +
  • [PHPBB3-11463] - Add topic title attribute in search results
  • +
  • [PHPBB3-11477] - Allow customisation of "Board index"
  • +
  • [PHPBB3-11482] - Extend syntax for DEFINE tag
  • +
  • [PHPBB3-11495] - Add nested sets implementation to phpBB core
  • +
  • [PHPBB3-11519] - Rename test event template file
  • +
  • [PHPBB3-11533] - Notification settings page is using topiclist class incorrectly
  • +
  • [PHPBB3-11557] - Allow to use tab when typing code and keep indentation
  • +
  • [PHPBB3-11558] - Notifications link in header should not include [ and ] -
  • +
  • [PHPBB3-11577] - Topiclist/Forumlist Needs tweaking after PR 1331
  • +
  • [PHPBB3-11582] - Split permission logic from translations
  • +
  • [PHPBB3-11600] - Increase code test coverage of avatar manager
  • +
  • [PHPBB3-11606] - make_clickable() in includes/functions_content.php uses deprecated preg_replace() /e modifier (PREG_REPLACE_EVAL)
  • +
  • [PHPBB3-11615] - Partial refactoring of session tests
  • +
  • [PHPBB3-11620] - Improve session test coverage
  • +
  • [PHPBB3-11621] - Improve MySQL fulltext search indexes
  • +
  • [PHPBB3-11651] - Bootstrap container from config.php
  • +
  • [PHPBB3-11667] - phpbb_template_twig_node_includeasset should be abstract
  • +
  • [PHPBB3-11669] - Fix PHP bug #55124 (/./ in recursive mkdirs)
  • +
  • [PHPBB3-11684] - No utility to time-wasting user login confirmation message/screen
  • +
  • [PHPBB3-11685] - No utility to time-wasting user logout confirmation message/screen
  • +
  • [PHPBB3-11700] - Use namespaces rather than prefixes for class names
  • +
  • [PHPBB3-11703] - Make "Serve jQuery using Google’s CDN" generic
  • +
  • [PHPBB3-11724] - Support "ELSE IF" and "ELSEIF" in the same way
  • +
  • [PHPBB3-11744] - Group join request notification
  • +
  • [PHPBB3-11745] - Group join approved notification
  • +
  • [PHPBB3-11747] - UCP Prefs Core and Template Events
  • +
  • [PHPBB3-11749] - PHP and Template Event Requests for Topic Preview Extension
  • +
  • [PHPBB3-11784] - Remove naming redundancy for event listeners
  • +
  • [PHPBB3-11786] - Fix various defects in PHPDoc in-code documentation
  • +
  • [PHPBB3-11795] - Move all JavaScript from HTML code to external files
  • +
  • [PHPBB3-11813] - Mock authentication provider should implement base provider class
  • +
  • [PHPBB3-11831] - Update fabpot/goutte to 1.0.*
  • +
+

New Feature

+ +

Sub-task

+
    +
  • [PHPBB3-9556] - Drop php closing tags
  • +
  • [PHPBB3-9574] - Drop fallback implementations
  • +
  • [PHPBB3-9688] - update_session API
  • +
  • [PHPBB3-9738] - Make installer and updater use migrations
  • +
  • [PHPBB3-9797] - Adjust existing access to superglobals
  • +
  • [PHPBB3-10817] - Use valid composer.json instead of non-standard extension.json
  • +
  • [PHPBB3-10992] - Use updated Goutte in Fileupload tests
  • +
  • [PHPBB3-11109] - Create a separate set of compress tests for the develop branch
  • +
  • [PHPBB3-11243] - Topics with attachments only show "download all attachments" links on pages containing attachments.
  • +
  • [PHPBB3-11318] - Extensions use migrations
  • +
  • [PHPBB3-11351] - Add appropriate language strings for errors
  • +
  • [PHPBB3-11531] - Add functional tests for new avatar system
  • +
  • [PHPBB3-11637] - generate_text_for_display on search.php
  • +
  • [PHPBB3-11638] - generate_text_for_display on viewtopic.php
  • +
  • [PHPBB3-11639] - generate_text_for_display on includes/functions_posting.php
  • +
  • [PHPBB3-11640] - generate_text_for_display on includes/functions_privmsgs.php
  • +
  • [PHPBB3-11641] - generate_text_for_display on includes/mcp/mcp_pm_reports.php
  • +
  • [PHPBB3-11642] - generate_text_for_display on includes/mcp/mcp_post.php
  • +
  • [PHPBB3-11643] - generate_text_for_display on includes/mcp/mcp_queue.php
  • +
  • [PHPBB3-11653] - generate_text_for_display on includes/mcp/mcp_topic.php
  • +
  • [PHPBB3-11654] - generate_text_for_display on includes/mcp/mcp_warn.php
  • +
  • [PHPBB3-11655] - generate_text_for_display on includes/ucp/ucp_pm_viewmessage.php
  • +
  • [PHPBB3-11656] - generate_text_for_display on memberlist.php
  • +
+

Task

+
    +
  • [PHPBB3-7090] - Update minimum PHP version to 5.2
  • +
  • [PHPBB3-9557] - Update coding guidelines for 3.1 and PHP >= 5.2
  • +
  • [PHPBB3-9682] - Add a class loader for auto loading and define naming rules for new phpbb classes
  • +
  • [PHPBB3-9783] - Restore subsilver2
  • +
  • [PHPBB3-9867] - Adjust the implementation of error messages localization
  • +
  • [PHPBB3-9983] - Restructure ACM classes
  • +
  • [PHPBB3-9988] - Replace config with an instance of a class implementing ArrayAccess
  • +
  • [PHPBB3-10091] - Bump minimum required postgresql version for 3.1
  • +
  • [PHPBB3-10173] - Move birthday list logic into templates
  • +
  • [PHPBB3-10202] - Provide a mechanism to manually retrieve long configuration options from a TEXT column
  • +
  • [PHPBB3-10260] - Remove prosilver styleswitcher
  • +
  • [PHPBB3-10314] - Whitelist all files in includes for code coverage reports
  • +
  • [PHPBB3-10389] - JSON extension should be checked in the installer
  • +
  • [PHPBB3-10414] - Functional testing
  • +
  • [PHPBB3-10467] - Check extensions diff for classes/constants not existing in php 5.2
  • +
  • [PHPBB3-10609] - Prefix phpBB functions with phpbb_ to prevent compatibility issues with other software
  • +
  • [PHPBB3-10670] - Require PHP 5.3 at minimum for phpBB 3.1
  • +
  • [PHPBB3-10680] - Add ext/ to .gitignore
  • +
  • [PHPBB3-10688] - Change 3.0 language to 3.1
  • +
  • [PHPBB3-10693] - Change minimum PHP version for Ascraeus to 5.3.2
  • +
  • [PHPBB3-10719] - Remove second 5.2 test suite on ascreaus
  • +
  • [PHPBB3-10732] - Add config_dev.php and config_test.php to .gitignore
  • +
  • [PHPBB3-10855] - Coding guideline change - have curly brackets on same line in JS
  • +
  • [PHPBB3-10869] - Remove PHP 5.2 check from .travis.yml
  • +
  • [PHPBB3-10877] - Have bamboo generate and publish a phpBB package for every build.
  • +
  • [PHPBB3-10882] - Expand test coverage for template engine - add tests for invalid constructs
  • +
  • [PHPBB3-10893] - Update the Usage of Composer
  • +
  • [PHPBB3-10909] - Update Travis Test Configuration: Travis no longer supports PHP 5.3.2
  • +
  • [PHPBB3-10932] - Store composer.phar in the phpBB repository to make sure a working version is always available
  • +
  • [PHPBB3-10939] - Modify the phpbb_request class to handle the $_FILES superglobal as well
  • +
  • [PHPBB3-10941] - Write tests for includes/functions_upload.php
  • +
  • [PHPBB3-10944] - Allow INCLUDEJS to include javascript from the assets directory
  • +
  • [PHPBB3-10949] - 3.1 AJAX code should use new coding guidelines
  • +
  • [PHPBB3-10963] - Use fileinfo in filespec::is_image() instead of trusting the mimetype sent by the browser
  • +
  • [PHPBB3-10969] - Remove remove_comments() and remove_remarks()
  • +
  • [PHPBB3-10993] - Update README to use composer.phar from the repository
  • +
  • [PHPBB3-10994] - Revert changes in PHPBB3-10963
  • +
  • [PHPBB3-11054] - Improper @var documentation syntax in includes/extension/controller.php
  • +
  • [PHPBB3-11061] - Fix README composer instructions
  • +
  • [PHPBB3-11195] - Put conditional opening brace on its own line, as per guidelines
  • +
  • [PHPBB3-11225] - Delete subsilver2 mcp_jumpbox.html
  • +
  • [PHPBB3-11287] - Add Template Event naming guidelines to docs/coding-guidelines.html
  • +
  • [PHPBB3-11338] - Enable Redis tests on Travis
  • +
  • [PHPBB3-11441] - Refactor phpbb_user_loader tests
  • +
  • [PHPBB3-11476] - Remove pass-by-reference from phpbb_db_driver::sql_multi_insert
  • +
  • [PHPBB3-11481] - Feed classes are currently all in feed.php
  • +
  • [PHPBB3-11698] - Move all autoloadable files to phpbb/ rather than includes/
  • +
  • [PHPBB3-11722] - Remove reference assignment for $captcha in report.php
  • +
  • [PHPBB3-11760] - 3.0.x Migration should use the phpbb_version_compare() wrapper.
  • +
  • [PHPBB3-11818] - Upgrade Symfony to 2.3 LTS
  • +
  • [PHPBB3-11870] - No longer exclude ./phpBB/phpbb/search/fulltext_*.php from code coverage
  • +
  • [PHPBB3-11885] - Add migrations for 3.0.12-RCx and 3.0.12
  • +
  • [PHPBB3-11913] - Apply reorganisation of download.phpbb.com to build_announcement.php
  • +
+ +

Changes since 3.0.13

+ +

Bug

+
    +
  • [PHPBB3-12933] - The search operator for partial matches does not work
  • +
  • [PHPBB3-13549] - Compare ORIG_PATH_INFO with SCRIPT_NAME for checking trailing paths
  • +
  • [PHPBB3-13554] - Advertisement of feature release in red indicates a problem
  • +
+ +

Changes since 3.0.12

+ +

Security

+
    +
  • [PHPBB3-13531] - Disallow trailing paths (e.g. using the PATH_INFO feature) to prevent path-relative CSS injection
  • +
  • [PHPBB3-13526] - Correctly validate ucp_pm_options form key
  • +
+

Bug

+
    +
  • [PHPBB3-6703] - Problem with russian letter while converting from 2.0.x
  • +
  • [PHPBB3-8960] - Allow changing allow_avatar_remote when images/avatars/upload is not writable
  • +
  • [PHPBB3-9420] - BBCode - Unable to use a proper URI token
  • +
  • [PHPBB3-9724] - Wrong return "Return to ACP"
  • +
  • [PHPBB3-9725] - MSSQL Schema is not azure compatible
  • +
  • [PHPBB3-10023] - Password change requirement notification in UCP is not noticable
  • +
  • [PHPBB3-10423] - Searching for the term "test *" will highlight nearly every word and displays htmlspecialchars as htmlentities.
  • +
  • [PHPBB3-10442] - XHTML is invalid when a forum link without redirect counter is present
  • +
  • [PHPBB3-10687] - UNABLE_GET_IMAGE_SIZE text misleading for remote avatars
  • +
  • [PHPBB3-10729] - Post editor information is not updated when user being deleted with posts
  • +
  • [PHPBB3-10776] - Grammar errors in docs/README.html
  • +
  • [PHPBB3-10796] - SQL Azure does not allow SELECT FROM sysfiles
  • +
  • [PHPBB3-10851] - HTML files containing certain tags being rejected as possible attack vectors with "Check attachment file" set to "No"
  • +
  • [PHPBB3-10863] - Permission mask does not accurately show some forum permissions if user has MOD parmissions
  • +
  • [PHPBB3-10917] - Updater notice "Update files are out of date..." when updating to unreleased version
  • +
  • [PHPBB3-10985] - Error bbcode.html not found when updating with custom style inheriting from prosilver
  • +
  • [PHPBB3-11062] - In Automatic Update, new language strings from install.php are only loaded from English
  • +
  • [PHPBB3-11224] - SQL cache destroy does not destroy queries to tables joined
  • +
  • [PHPBB3-11288] - "Fulltext native" search fooled by hyphens
  • +
  • [PHPBB3-11480] - Prevent Private Message system from returning "Unknown folder" when inbox folder is full
  • +
  • [PHPBB3-11613] - Cookies do not work for netbios domain
  • +
  • [PHPBB3-11686] - Not checking for phpBB Debug errors on functional tests
  • +
  • [PHPBB3-11699] - PHP Lint Test should exclude selected subdirectories of the build directory.
  • +
  • [PHPBB3-11726] - Don't run lint tests on Travis on postgres
  • +
  • [PHPBB3-11762] - generate_text_for_display() treats "0" as an empty string
  • +
  • [PHPBB3-11789] - Inline css with color value in subsilver2
  • +
  • [PHPBB3-11794] - Coding Guidelines document says to place a comma after every array element, but fails to do so itself
  • +
  • [PHPBB3-11799] - Anti Abuse Headers missing for sendpassword
  • +
  • [PHPBB3-11811] - Chrome 30 adds outline to focused elements
  • +
  • [PHPBB3-11821] - Wrong comma usage "You are receiving this notification"
  • +
  • [PHPBB3-11823] - Travis-CI webserver not matching PHP files with anything after the .php
  • +
  • [PHPBB3-11829] - Closed reports may seem open in detailed view
  • +
  • [PHPBB3-11860] - .htaccess not working for Apache 2.4
  • +
  • [PHPBB3-11864] - Do not call exit after display_progress_bar in acp_forums
  • +
  • [PHPBB3-11879] - Compatibility error in forum_fn.js: .live should be replaced with .on
  • +
  • [PHPBB3-11968] - Travis Image are broken due to repository rename
  • +
  • [PHPBB3-12037] - acp_inactive.html has hard-coded text
  • +
  • [PHPBB3-12048] - Custom BBCodes Fail to Render Language Strings with a Number
  • +
  • [PHPBB3-12061] - Keyboard shortcut alt+h doesn't work properly in firefox
  • +
  • [PHPBB3-12072] - Missing word "send" in comment in schema_data.sql
  • +
  • [PHPBB3-12093] - IE 11 javascript selection is no longer supported
  • +
  • [PHPBB3-12118] - Add noindex meta tag to subsilver2 pm/topic view-print template
  • +
  • [PHPBB3-12119] - Remove keywords and description meta tags from prosilver view-print templates
  • +
  • [PHPBB3-12120] - Update docs/AUTHORS for 3.0.13-RC1
  • +
  • [PHPBB3-12140] - Avoid endless loop in build script
  • +
  • [PHPBB3-12161] - build/save directories are no longer created
  • +
  • [PHPBB3-12162] - Binary files missing from update packages
  • +
  • [PHPBB3-12176] - No error shown when attempting to delete a founder
  • +
  • [PHPBB3-12186] - MCP should open "Reported posts" instead of PM Reports
  • +
  • [PHPBB3-12188] - Add php 5.6 to travis tests
  • +
  • [PHPBB3-12202] - Variables read from style.cfg etc. should be htmlspecialchared
  • +
  • [PHPBB3-12205] - Custom Profile Field display bug
  • +
  • [PHPBB3-12210] - dbtools::sql_create_table incorrectly throws error related to auto-increment length on non auto-increment fields
  • +
  • [PHPBB3-12310] - SMTP username and password should not autocomplete during install
  • +
  • [PHPBB3-12316] - develop-ascraeus build status missing from "Automated Testing" section in README.md
  • +
  • [PHPBB3-12353] - User attachments in ACP are not displaying every attachment
  • +
  • [PHPBB3-12359] - Day and Month of Birthday Misaligned When Editing
  • +
  • [PHPBB3-12381] - Broken error message when selecting invalid DB driver
  • +
  • [PHPBB3-12397] - db_tools::sql_unique_index_exists() has wrong doc block
  • +
  • [PHPBB3-12429] - Update phpunit to 3.8+
  • +
  • [PHPBB3-12467] - Add config_*.php and tests_config_*.php to .gitignore
  • +
  • [PHPBB3-12472] - Set fast finish for .travis.yml
  • +
  • [PHPBB3-12485] - Broken tests due to absolute exclude
  • +
  • [PHPBB3-12492] - DB_TEST: Special chars are not supported.
  • +
  • [PHPBB3-12540] - WRONG_FILESIZE contains broken placeholders
  • +
  • [PHPBB3-12660] - Undefined offset error when phpinfo() disabled and debug enabled
  • +
  • [PHPBB3-12695] - Undefined index: MISSING_INLINE_ATTACHMENT notice given when viewing post details
  • +
  • [PHPBB3-12720] - Git commit hook should not require commit message to start with a capital letter
  • +
  • [PHPBB3-12741] - Functional tests on Travis fail since php update last night
  • +
  • [PHPBB3-12755] - Remote upload stuck in infinite loop if server sends keep-alive
  • +
  • [PHPBB3-13086] - Update ACP_MASS_EMAIL_EXPLAIN language key
  • +
  • [PHPBB3-13096] - ldap_escape() added to PHP 5.6.0
  • +
  • [PHPBB3-13138] - Banned users cause infinite recursion
  • +
  • [PHPBB3-13168] - Warning displayed in PHP 5.6 for mbstring.http_input
  • +
  • [PHPBB3-13234] - Remember me cookie gets unset by admin reauthentication
  • +
  • [PHPBB3-13341] - Tests fail when generating coverage report
  • +
  • [PHPBB3-13376] - deregister_globals() does not work correctly when $_COOKIE['GLOBALS'] - is specified
  • +
  • [PHPBB3-13519] - Correctly validate imagick path as path and not string
  • +
  • [PHPBB3-13523] - PHP 5.2 Unit Tests no longer work due to deprecated PHPUnit PEAR channel
  • +
  • [PHPBB3-13527] - Escape information received from version server
  • +
+

Improvement

+
    +
  • [PHPBB3-10037] - Add Smiley Buttons in Signature Editor
  • +
  • [PHPBB3-10174] - Rename "Ban usernames" to "Ban users" in ACP
  • +
  • [PHPBB3-10549] - Languages variables should be used, not hardcoded
  • +
  • [PHPBB3-10555] - Copyright notice in overall_header.html is not translatable
  • +
  • [PHPBB3-10945] - Show entered search query in the search box when no results are found.
  • +
  • [PHPBB3-11254] - Check CRLF line endings in the test suite
  • +
  • [PHPBB3-11295] - Drop tables for postgres in the test suite
  • +
  • [PHPBB3-11297] - Running tests doc should mention dbunit dependency
  • +
  • [PHPBB3-11704] - phing build script does not include vendor folder, even if there are dependencies
  • +
  • [PHPBB3-11766] - Remove Quote and Edit button when topic is lock
  • +
  • [PHPBB3-11801] - missing semi colons in css
  • +
  • [PHPBB3-11814] - Topic reply notification email text change
  • +
  • [PHPBB3-12035] - Add a link to user's posts in the ACP user overview page
  • +
  • [PHPBB3-12106] - Document exceptions to "Disable Board" in ACP.
  • +
  • [PHPBB3-12146] - Add color demo when editing a group from the UCP
  • +
  • [PHPBB3-12247] - include poster's username in email notifications of posts that get approved by moderators
  • +
  • [PHPBB3-12259] - Too many redundant tests are run on Travis
  • +
  • [PHPBB3-12468] - Allow mbstring.http_input='' besides 'pass' for PHP 5.6 compatibility
  • +
+

Task

+
    +
  • [PHPBB3-10839] - Remove phpunit.xml.functional and always include functional tests
  • +
  • [PHPBB3-11509] - Travis should check commit message format
  • +
  • [PHPBB3-11876] - Upgrade package checksums from MD5 to SHA256
  • +
  • [PHPBB3-11877] - Create package download links and checksums for announcement via script
  • +
  • [PHPBB3-11920] - Add MariaDB tests to Travis-CI
  • +
  • [PHPBB3-11951] - Add MariaDB to supported RDBMS list
  • +
  • [PHPBB3-11970] - Use 'set -x' in Travis CI setup scripts
  • +
  • [PHPBB3-12046] - Use PHP_BINARY environment variable in lint unit test
  • +
  • [PHPBB3-12056] - Make sure each unit test runs on its own
  • +
  • [PHPBB3-12147] - Remove Travis CI notification configuration
  • +
  • [PHPBB3-12302] - Upgrade composer.phar to 1.0.0-alpha8
  • +
  • [PHPBB3-12318] - Correctly setup HHVM functional tests on Travis CI
  • +
  • [PHPBB3-12319] - Backport Travis CI HHVM environment enabling to develop-olympus.
  • +
  • [PHPBB3-12320] - No longer allow Travis CI HHVM environment to fail
  • +
  • [PHPBB3-12341] - Add tests for get_username_string()
  • +
  • [PHPBB3-12384] - Run Travis CI HHVM tests against MySQLi instead of MySQL
  • +
  • [PHPBB3-12417] - hhvm-nightly 2014.04.16~precise breaks tests
  • +
  • [PHPBB3-12495] - Add Sami to composer dependencies and build script
  • +
  • [PHPBB3-12582] - Strip away copyrighted ICC profile from images
  • +
  • [PHPBB3-12917] - Move commit check and file executable checks to 5.3.3 build on travis
  • +
  • [PHPBB3-13324] - Composer no longer downloads sami/sami and fabpot/goutte
  • +
+ +

Changes since 3.0.11

+ +

Bug

+
    +
  • [PHPBB3-6723] - Empty message in deleted messages in PM history
  • +
  • [PHPBB3-7262] - Clarify docs about is_dynamic not being updated by set_config()
  • +
  • [PHPBB3-8319] - LOCAL_URL not enforced in bbcodes
  • +
  • [PHPBB3-9551] - Mysql fulltext index creation fails due to partial collation change
  • +
  • [PHPBB3-9975] - Hard coded language in sessions.php
  • +
  • [PHPBB3-10184] - Bots can be sent private messages
  • +
  • [PHPBB3-10491] - Fatal error in functional tests when server returns 404
  • +
  • [PHPBB3-10568] - Modify the trigger language when you edit a PM
  • +
  • [PHPBB3-10602] - A bug in mail queue processing
  • +
  • [PHPBB3-10661] - UCP > PM > Compose > enumerated recipients > BCC group misses a &nbsp; (prosilver)
  • +
  • [PHPBB3-10678] - Provide Firebird, Oracle, and increased MSSQL support in unit tests
  • +
  • [PHPBB3-10772] - trigger_error is using the default style
  • +
  • [PHPBB3-10789] - PM print template (prosilver) with unnecessary variables
  • +
  • [PHPBB3-10820] - Display images directly in IE9 and 10 instead of download
  • +
  • [PHPBB3-10828] - PostgreSQL dbal tests try to connect to the database named as user specified in configuration
  • +
  • [PHPBB3-10838] - Functional tests are not mentioned in RUNNING_TESTS.txt
  • +
  • [PHPBB3-10840] - If you add a member to a group, the form_token can be set to 0 if the creation_time is 0 too. Maybe even if creation_time is unchanged.
  • +
  • [PHPBB3-10848] - Wrong redirect to installer from acp
  • +
  • [PHPBB3-10850] - create_schema_files.php is not creating the oracle or postgres' schema file properly
  • +
  • [PHPBB3-10879] - prosilver: attachment-link will be displayed wrong, when filename is too long
  • +
  • [PHPBB3-10880] - m_approve should not imply f_noapprove
  • +
  • [PHPBB3-10896] - board_email & board_contact are not validated as email addresses in ACP
  • +
  • [PHPBB3-10897] - Bot Definitions are outdated
  • +
  • [PHPBB3-10918] - docs/INSTALL.html claims there are tar.gz packages
  • +
  • [PHPBB3-10943] - Search Box should display keywords entered by the user
  • +
  • [PHPBB3-10967] - PHPBB_USE_BOARD_URL_PATH not implemented in posting_gen_topic_icons
  • +
  • [PHPBB3-10986] - Invalid email message ids because config variable server_name is used even when force server URL settings is disabled
  • +
  • [PHPBB3-10995] - Return value of $db->sql_fetchrow() on empty tables is not consistent on mssqlnative
  • +
  • [PHPBB3-10996] - Travis tests fail on Postgres because database does not exist
  • +
  • [PHPBB3-11034] - The functional test case framework does not install a full board each time
  • +
  • [PHPBB3-11066] - MSSQLnative driver contains debug code error_reporting(E_ALL)
  • +
  • [PHPBB3-11069] - missing closing span in subsilver2 simple_footer.html
  • +
  • [PHPBB3-11081] - Duplicated /TD in styles/subsilver2/template/catpcha_qa.html
  • +
  • [PHPBB3-11093] - acp_users_overview.html has a wrongly placed </dd>
  • +
  • [PHPBB3-11094] - prosilver: searching for users: no textbox for Jabber
  • +
  • [PHPBB3-11105] - Missing mandatory space in meta http-equiv=refresh
  • +
  • [PHPBB3-11112] - phpBB Footer Link should be SSL
  • +
  • [PHPBB3-11122] - Update docs/AUTHORS for 3.0.12-RC1
  • +
  • [PHPBB3-11144] - {FORUM_NAME} is not filled in login mask when logging into a password protected forum
  • +
  • [PHPBB3-11145] - ATTACHED_IMAGE_NOT_IMAGE thrown because of file limit in php.ini
  • +
  • [PHPBB3-11158] - modules table lacks acl_u_sig for signature module
  • +
  • [PHPBB3-11159] - Coding guidelines: static public
  • +
  • [PHPBB3-11164] - Composer not finding symfony/config in PHP 5.3.3
  • +
  • [PHPBB3-11178] - database_update.php should not set error_reporting to E_ALL
  • +
  • [PHPBB3-11186] - Database unit tests fail on windows using sqlite2
  • +
  • [PHPBB3-11190] - Functional tests do not clear the cache between each test
  • +
  • [PHPBB3-11196] - /includes/session.php sends 401 HTTP status with "Not authorized" instead of "Unauthorized"
  • +
  • [PHPBB3-11219] - Database sequences are not updated for tests using fixtures with auto_incremented columns
  • +
  • [PHPBB3-11227] - @return void -> @return null
  • +
  • [PHPBB3-11233] - Anonymous can be selected as a PM recipient
  • +
  • [PHPBB3-11248] - CRLF line endings
  • +
  • [PHPBB3-11262] - .lock files are not in .gitignore
  • +
  • [PHPBB3-11265] - Functional tests do not assert that board installation succeeded
  • +
  • [PHPBB3-11269] - Travis functional test case errors
  • +
  • [PHPBB3-11278] - Firebird tables are not removed correctly on 3.0.9-rc1 update
  • +
  • [PHPBB3-11291] - "Could not open input file: ../composer.phar" error during phing's create-package
  • +
  • [PHPBB3-11292] - Newlines removed in display of PM reports, no clickable links in PM reports
  • +
  • [PHPBB3-11301] - "String offset cast occured" error on PHP 5.4
  • +
  • [PHPBB3-11304] - check_form_key breaks in tests when form is submitted in the same second it is retrieved
  • +
  • [PHPBB3-11343] - Loose string comparison during new password activation
  • +
  • [PHPBB3-11355] - Incorrect error message when no user selected for action on group membership management page
  • +
  • [PHPBB3-11358] - Success message even withot selecting a user and performing a group operation
  • +
  • [PHPBB3-11361] - "Array to string conversion" error in $user->format_date()
  • +
  • [PHPBB3-11493] - Functional tests should fail if any debug output is made
  • +
  • [PHPBB3-11517] - Numbering is wrong in coding guidelines
  • +
  • [PHPBB3-11536] - Installer incorrectly removes /install from script_path
  • +
  • [PHPBB3-11537] - UCP group manage page's error box differs heavily from the rest of the UCP
  • +
  • [PHPBB3-11538] - SQL error on UCP groups manage page caused by setting color to 7 characters long string
  • +
  • [PHPBB3-11544] - Add admin_login() to 3.0 functional test case
  • +
  • [PHPBB3-11545] - is_absolute() should not depend on DIRECTORY_SEPARATOR
  • +
  • [PHPBB3-11546] - is_absolute() throws E_NOTICE for empty string
  • +
  • [PHPBB3-11547] - Test fixtures do not support utf8 characters
  • +
  • [PHPBB3-11548] - Untranslated TOO_SHORT in UCP "Manage Groups"
  • +
  • [PHPBB3-11566] - Reporting a post should require a captcha to be solved by guests
  • +
  • [PHPBB3-11568] - Functional tests fail with retrieving install pages using file_get_contents
  • +
  • [PHPBB3-11575] - phpbb_dbal_order_lower_test::test_cross_join should be called test_order_lower
  • +
  • [PHPBB3-11578] - Missing underscore after function prefix in validate_data()
  • +
  • [PHPBB3-11579] - Add unit tests for validate_data()
  • +
  • [PHPBB3-11580] - Avoid API Limit from composer downloads on github
  • +
  • [PHPBB3-11588] - install/install_update.php should use version.phpbb.com instead of www
  • +
  • [PHPBB3-11590] - Close database connections from tests whenever possible
  • +
  • [PHPBB3-11601] - Allow manual resync of database columns in unit tests not only on fixture load
  • +
  • [PHPBB3-11603] - git-tools use invalid api urls
  • +
  • [PHPBB3-11604] - Functional tests fail when phpBB can not create the config file
  • +
  • [PHPBB3-11617] - Missing U_ACTION in acp_captcha.php
  • +
  • [PHPBB3-11618] - Template tests fail on some systems due to a PHP error in glob()
  • +
  • [PHPBB3-11619] - get_remote_file() should use HTTP 1.0
  • +
  • [PHPBB3-11630] - Improvements to the PHP lint pre-commit hook
  • +
  • [PHPBB3-11644] - Skip phpbb_dbal_order_lower_test on MySQL 5.6
  • +
  • [PHPBB3-11662] - "occured" should be "occurred"
  • +
  • [PHPBB3-11670] - Replace trademark â„¢ with ® on "Welcome to phpBB" install page
  • +
  • [PHPBB3-11674] - Do not include vendor folder if there are no dependencies.
  • +
  • [PHPBB3-11524] - MySQL Upgrader throws warnings on PHP 5.4
  • +
  • [PHPBB3-11720] - Reporting posts leads to white page error
  • +
  • [PHPBB3-11769] - Wrong poster in subscription email when poster is using the Quote button
  • +
  • [PHPBB3-11775] - Error while moving posts to a new topic
  • +
  • [PHPBB3-11802] - Undefined variable $browser in /download/file.php
  • +
+

Improvement

+
    +
  • [PHPBB3-8743] - New topic / reply notifications do not contain author's name.
  • +
  • [PHPBB3-10050] - subsilver2: Do not show "Mark topics as read" when there are no topics
  • +
  • [PHPBB3-10205] - More informative reporting of errors when database connection fails (MySQL and others)
  • +
  • [PHPBB3-10716] - PHP-parse all php files as part of the test suite
  • +
  • [PHPBB3-10841] - Disable style and language selectors if there's only one installed.
  • +
  • [PHPBB3-10854] - sql server drop default constraint when dropping column
  • +
  • [PHPBB3-10865] - Updated and Added to docs/INSTALL.html
  • +
  • [PHPBB3-10873] - Change language entry for deleted PMs
  • +
  • [PHPBB3-10981] - Upgrade Goutte and use Composer for Installation
  • +
  • [PHPBB3-11131] - Phrasing & semantics of Board settings
  • +
  • [PHPBB3-11162] - Get rid of $db->sql_return_on_error(true) trickery when splitting/merging topics
  • +
  • [PHPBB3-11192] - Add Tebibyte to get_formatted_filesize()
  • +
  • [PHPBB3-11202] - Add response status checks to functional tests
  • +
  • [PHPBB3-11220] - Improve tooltip explaining the [list=] - BBcode
  • +
  • [PHPBB3-11238] - Specify goutte version
  • +
  • [PHPBB3-11285] - Use more granularity in dependency checks in compress test
  • +
  • [PHPBB3-11293] - Prefer mysqli over mysql due to php 5.5 alpha 2 deprecating mysql
  • +
  • [PHPBB3-11294] - Update extension list in running tests doc
  • +
  • [PHPBB3-11368] - Latest pm reports row count
  • +
  • [PHPBB3-11583] - InnoDB supports FULLTEXT index since MySQL 5.6.4.
  • +
  • [PHPBB3-11740] - Update link in FAQ to Ideas Centre
  • +
  • [PHPBB3-11873] - Prevent expensive hash computation in phpbb_check_hash() by rejecting very long passwords
  • +
+

Sub-task

+
    +
  • [PHPBB3-10974] - Move tests/mock_user.php to tests/mock/user.php
  • +
  • [PHPBB3-11009] - Backport phing build.xml from develop to develop-olympus so it uses composer.
  • +
  • [PHPBB3-11540] - Add unit tests for (phpbb_)is_absolute()
  • +
  • [PHPBB3-11541] - Add unit tests for style_select() in functions.php
  • +
  • [PHPBB3-11542] - Add unit tests for language_select() in functions.php
  • +
  • [PHPBB3-11543] - Add unit tests for obtain online functions in functions.php
  • +
+

Task

+
    +
  • [PHPBB3-10877] - Have bamboo generate and publish a phpBB package for every build.
  • +
  • [PHPBB3-11045] - Add unit tests for the compress class
  • +
  • [PHPBB3-11059] - Fix README logo
  • +
  • [PHPBB3-11060] - Fix travis.yml pyrus config
  • +
  • [PHPBB3-11240] - Turn on PHPUnit's verbose mode on Travis
  • +
  • [PHPBB3-11324] - Add PHP 5.5 environment on Travis-CI
  • +
  • [PHPBB3-11337] - Run functional tests on Travis CI
  • +
  • [PHPBB3-11513] - Install PHPUnit via Composer's require-dev to simplify test running (no need for pear)
  • +
  • [PHPBB3-11526] - Increase composer minimum-stability from beta to stable
  • +
  • [PHPBB3-11527] - Upgrade composer.phar to 1.0.0-alpha7
  • +
  • [PHPBB3-11529] - Rename RUNNING_TESTS file to .md file to render it on GitHub
  • +
  • [PHPBB3-11576] - Make phpBB Test Suite MySQL behave at least as strict as phpBB MySQL driver
  • +
  • [PHPBB3-11671] - Add phing/phing to composer.json
  • +
  • [PHPBB3-11752] - Update phpBB.com URLs to https in email templates
  • +
  • [PHPBB3-11753] - Upgrade mysql_upgrader.php schema data.
  • +
+ +

Changes since 3.0.10

+ +

Bug

+
    +
  • [PHPBB3-7432] - Unclear language for Inactive Users on ACP main page
  • +
  • [PHPBB3-8652] - Duplicate Emails Sent When Subscribed to Forum and Topic
  • +
  • [PHPBB3-9079] - Display backtrace on all E_USER_ERROR errors, not only SQL errors (when DEBUG_EXTRA is enabled)
  • +
  • [PHPBB3-9084] - Unable to display 'option equal to non entered value' if dropdown CPF is not required
  • +
  • [PHPBB3-9089] - PM message title box not accessible via Tab key
  • +
  • [PHPBB3-9220] - Blue border width when table in a div
  • +
  • [PHPBB3-9681] - Password length not in security settings
  • +
  • [PHPBB3-9813] - fulltext_native.php on innodb loading deadly slow for big indexes
  • +
  • [PHPBB3-9831] - Cannot change default of Boolean checkbox custom profile field
  • +
  • [PHPBB3-10094] - Clear cache before phpBB installation
  • +
  • [PHPBB3-10129] - Missing apostrophes in ACP user management -> permissions
  • +
  • [PHPBB3-10349] - Unit tests do not remove comments from schemas
  • +
  • [PHPBB3-10399] - Special characters aren't parsed in style component variables
  • +
  • [PHPBB3-10401] - auth_ldap has an incorrect return value in login_ldap()
  • +
  • [PHPBB3-10407] - Incorrect check for empty image file paths during conversion
  • +
  • [PHPBB3-10428] - optionget/optionset functions in session.php and acp_users.php incorrectly check whether $data is at its default value
  • +
  • [PHPBB3-10456] - Subsilver2 does not define $CAPTCHA_TAB_INDEX
  • +
  • [PHPBB3-10508] - Marking forums as read displays misleading language
  • +
  • [PHPBB3-10511] - Grammar defect in permissions language
  • +
  • [PHPBB3-10512] - Test failure when no default timezone is set in php
  • +
  • [PHPBB3-10532] - Out of range $start causes a page with no search results but with pagination
  • +
  • [PHPBB3-10538] - Special character are not correctly parsed for SMTP protocol
  • +
  • [PHPBB3-10542] - Incorrect class="postlink" in styles/subsilver2/template/faq_body.html
  • +
  • [PHPBB3-10546] - Argument missing for adm_back_link() in acp_captcha.php
  • +
  • [PHPBB3-10561] - All users can choose deactivated styles.
  • +
  • [PHPBB3-10569] - template/ucp_main_front.html does not correctly handle active topic with the name "0"
  • +
  • [PHPBB3-10580] - Default tz in registration dropdown not the same as the board default tz
  • +
  • [PHPBB3-10589] - user_birthday does not use table alias in $leap_year_birthdays variable definition
  • +
  • [PHPBB3-10605] - Orpahned privmsgs are left in the prvmsgs table, with no ties in privmsgs_to table
  • +
  • [PHPBB3-10606] - $s_hidden_fields -> incorrect array name (3 files affected)
  • +
  • [PHPBB3-10611] - Add a check for selected tables existence for ACP database backup tool
  • +
  • [PHPBB3-10615] - Static calls in utf normalizer yield E_STRICT spam on php 5.4
  • +
  • [PHPBB3-10630] - Prune Users produced unnecessarily long query; Got a packet bigger than 'max_allowed_packet' bytes
  • +
  • [PHPBB3-10633] - Users are able to get the real filename of attachment
  • +
  • [PHPBB3-10639] - negative value of ranks message
  • +
  • [PHPBB3-10658] - Rank-item is not shown on team-list
  • +
  • [PHPBB3-10675] - Use more descriptive message when disk is out of space
  • +
  • [PHPBB3-10684] - Function user_notification() prevents notifications for users with stale bans
  • +
  • [PHPBB3-10689] - Bug in the popup " Find a member" when select by letter.
  • +
  • [PHPBB3-10691] - Search index creation CLI script incorrectly calculates indexing speed
  • +
  • [PHPBB3-10699] - Long h2 title breaks div.minitabs in MCP
  • +
  • [PHPBB3-10708] - After a conversion, passwords with UTF8 characters do not work when user_pass_convert is set.
  • +
  • [PHPBB3-10717] - memberlist_view.html: including admin defined profile fields doesnt work
  • +
  • [PHPBB3-10723] - Do not use SQLite on PHP 5.4 in Tests on Travis
  • +
  • [PHPBB3-10731] - JS function addquote() works incorrectly in Opera
  • +
  • [PHPBB3-10751] - MS SQL Error when searching Admin Log
  • +
  • [PHPBB3-10760] - In pre-commit git hook, syntax error is thrown, but is not specifically described
  • +
  • [PHPBB3-10767] - Git hooks do not work properly with git GUIs
  • +
  • [PHPBB3-10774] - db_tools::create_unique_index does not use specified index names on MySQL
  • +
  • [PHPBB3-10790] - Strict comparison on user_id for sending pms
  • +
  • [PHPBB3-10797] - Template var for user rank not filled
  • +
  • [PHPBB3-10835] - Misleading message in UCP when no permission to change password
  • +
  • [PHPBB3-10846] - Missing alias for MAX(post_id) in SQL query in acp_main.php
  • +
  • [PHPBB3-10849] - Missing BBCode Help Text in subsilver2
  • +
  • [PHPBB3-10858] - $db->sql_fetchfield returns false with mssqlnative
  • +
  • [PHPBB3-10860] - Side-by-side diff styling javascript bug
  • +
  • [PHPBB3-10881] - Some files use 0xA9 as the copyright symbol which is neither ASCII nor the UTF8 copyright symbol.
  • +
  • [PHPBB3-10887] - Auto increment tests depend on varbinary handling
  • +
  • [PHPBB3-10889] - Default value for c_char_size in database unit tests is an empty string instead of a char(4)
  • +
  • [PHPBB3-10890] - test_sql_fetchrow_returns_false_when_empty() fails on MSSQL and Oracle
  • +
  • [PHPBB3-10908] - No remote avatar size limit results in files limited only by PHP memory limit
  • +
  • [PHPBB3-10913] - Admin is logged out when accessing any url under adm/ without session id
  • +
  • [PHPBB3-10441] - Update to docs/README.html
  • +
  • [PHPBB3-10773] - ACP phpBB logo needs registered trademark symbol
  • +
  • [PHPBB3-10935] - Limit number of PM rules per user
  • +
  • [PHPBB3-10937] - Comment removal functions: Backward compatibility broken
  • +
  • [PHPBB3-10950] - Deleting user with undelivered PMs causes SQL error
  • +
  • [PHPBB3-10952] - includes/constants.php version number incorrect
  • +
  • [PHPBB3-10965] - Dropdown CPF now shows in profile when no value is selected
  • +
  • [PHPBB3-10978] - Typo in prosilvers ucp_groups_membership.html
  • +
+

Improvement

+
    +
  • [PHPBB3-8599] - Add "Select All" to "Add multiple smilies" screen
  • +
  • [PHPBB3-8636] - Add resync option to topic_view moderation page
  • +
  • [PHPBB3-9876] - Names and descriptions for roles "Newly registered User" in "User roles" and "Forum roles" must be different
  • +
  • [PHPBB3-9914] - Add backup warning to Automatic DB Updater
  • +
  • [PHPBB3-9916] - License in header not linking to version 2 of GNU GPL
  • +
  • [PHPBB3-10093] - Make commit-msg hook always not fatal
  • +
  • [PHPBB3-10162] - Allow TLDs over 6 characters in email addresses
  • +
  • [PHPBB3-10280] - Change the ACP user activation display
  • +
  • [PHPBB3-10308] - Disable Retain/Delete Posts selection if the user has no posts.
  • +
  • [PHPBB3-10453] - PM viewmessage page is misplacing the online icon
  • +
  • [PHPBB3-10492] - Port functional tests to develop-olympus
  • +
  • [PHPBB3-10507] - Sort installed styles list in admin control panel - styles
  • +
  • [PHPBB3-10550] - Sort not installed styles list in admin control panel - styles
  • +
  • [PHPBB3-10563] - ACP usability improvement: show deactivated styles below active styles in styles list
  • +
  • [PHPBB3-10565] - Performance: Unneeded GROUP BY in update_forum_tracking_info
  • +
  • [PHPBB3-10607] - phpBB Credit Line Hardcoded
  • +
  • [PHPBB3-10653] - Add ability to count table rows to database abstraction layer
  • +
  • [PHPBB3-10730] - Add label tags around "select" text in post splitting UI in MCP
  • +
  • [PHPBB3-10764] - FAQ mentions SourceForge
  • +
  • [PHPBB3-10812] - Installer should not display register globals UI for php 5.4+
  • +
  • [PHPBB3-10815] - Enable Feeds by default
  • +
  • [PHPBB3-10819] - Improve side-by-side diff styling
  • +
  • [PHPBB3-10834] - Backport general development language changes in readme files
  • +
  • [PHPBB3-10836] - Enable Avatars by default
  • +
  • [PHPBB3-10891] - Allow specifying test config file name via environment variable
  • +
  • [PHPBB3-10892] - Cosmetic improvements to RUNNING_TESTS.txt
  • +
  • [PHPBB3-10898] - Do not write ?> into config.php to avoid whitespace output
  • +
  • [PHPBB3-10925] - Clarify that SQLite3 is not supported for phpBB 3.0.x
  • +
+

New Feature

+ +

Sub-task

+
    +
  • [PHPBB3-10907] - Mark (var)binary tests as incomplete on non-MySQL DBMSes
  • +
+

Task

+
    +
  • [PHPBB3-9896] - Update links in docs/readme.html
  • +
  • [PHPBB3-10434] - Add a script that allows creating a search index from CLI
  • +
  • [PHPBB3-10455] - Remove NOTE from header files
  • +
  • [PHPBB3-10694] - Update notification in ACP (Olympus) for increase of minimum PHP version to 5.3.2
  • +
  • [PHPBB3-10718] - Add Travis CI
  • +
  • [PHPBB3-10788] - Update docs/AUTHORS for 3.0.11-RC1
  • +
  • [PHPBB3-10909] - Update Travis Test Configuration: Travis no longer supports PHP 5.3.2
  • +
+ +

Changes since 3.0.9

+ +

Bug

+
    +
  • [PHPBB3-5506] - Deleting all items from last page results in empty list display
  • +
  • [PHPBB3-6458] - Width of Topics and Posts columns in Board Index is causing problems with language packs
  • +
  • [PHPBB3-7138] - Cannot display simple header/footer with trigger_error()
  • +
  • [PHPBB3-7291] - Broken links of char selection in memberlist
  • +
  • [PHPBB3-7932] - Fix font size in select boxes
  • +
  • [PHPBB3-8094] - Text in the forums.php and install.php not matching
  • +
  • [PHPBB3-8173] - Redundant BBCode helpline in JS
  • +
  • [PHPBB3-8177] - February 29th birthdays not shown in non-leap year
  • +
  • [PHPBB3-8571] - Users can make their age a negative number on memberlist
  • +
  • [PHPBB3-8691] - Error creating log_time index
  • +
  • [PHPBB3-8937] - Code tags - single space indent
  • +
  • [PHPBB3-9008] - Incorrect unread topic tracking for unapproved topics
  • +
  • [PHPBB3-9066] - Invalid Prefix Names Allowed
  • +
  • [PHPBB3-9416] - HTML entities in poll titles and options incorrectly re-encoded
  • +
  • [PHPBB3-9525] - Minimum characters per post/message should never be '0'
  • +
  • [PHPBB3-9645] - XHTML error on phpinfo page in ACP
  • +
  • [PHPBB3-9776] - When deleting and recreating a poll, old options aren't deleted and reappear with the new ones
  • +
  • [PHPBB3-9956] - No error message displayed when disapprove reason is invalid or empty
  • +
  • [PHPBB3-9976] - Direct post links open the wrong page of viewtopic when multiple posts are posted in the same second
  • +
  • [PHPBB3-9978] - Missing semicolons in // <![CDATA[ part of overall_header.html
  • +
  • [PHPBB3-10087] - Limited browser support for ban exclusion emphasis
  • +
  • [PHPBB3-10157] - Missing error handling when a custom profile field is not defined for current language
  • +
  • [PHPBB3-10166] - Post-admin activation email confusingly refers to username
  • +
  • [PHPBB3-10187] - XHTML error in ucp_groups_manage.html
  • +
  • [PHPBB3-10190] - Misleading information about permissions displayed after editing forum settings
  • +
  • [PHPBB3-10212] - Captcha not displayed when username not exists
  • +
  • [PHPBB3-10216] - Updater's failed query language grammatically incorrect
  • +
  • [PHPBB3-10226] - Mysqli dbal extension does not allow connection via pipes
  • +
  • [PHPBB3-10227] - Mysqli dbal extension does not allow persistent connection for PHP >= 5.3.0
  • +
  • [PHPBB3-10237] - Unwatching a forum/topic does not check for correct hash parameter
  • +
  • [PHPBB3-10240] - Word filter evasion
  • +
  • [PHPBB3-10253] - IE9 Quote problem
  • +
  • [PHPBB3-10255] - gitignore ignores too much
  • +
  • [PHPBB3-10257] - AAAA record parsing fails on older versions of Windows
  • +
  • [PHPBB3-10259] - Incorrect email on joining Open group
  • +
  • [PHPBB3-10265] - Unit test tests/random/mt_rand.php is not run because of missing _test suffix.
  • +
  • [PHPBB3-10266] - Poor navigation links after reporting a post
  • +
  • [PHPBB3-10267] - Missing strlen() on $table_prefix in db tools index name length check
  • +
  • [PHPBB3-10274] - Hardcoded module ID in "Re-check version" link on ACP front page
  • +
  • [PHPBB3-10275] - Wrong information about sent passwords in FAQ
  • +
  • [PHPBB3-10292] - Whitespace inconsistency in acp_ranks
  • +
  • [PHPBB3-10293] - Jumpbox allows jumping to invalid forums in prosilver
  • +
  • [PHPBB3-10294] - sqlsrv_rows_affected non-functional in MSSQLNative.php
  • +
  • [PHPBB3-10296] - incorrect cross join in SQL Server
  • +
  • [PHPBB3-10298] - EMBED Tag Not Closed Properly In subSilver2 attachment.html
  • +
  • [PHPBB3-10299] - Typo in comment about $max_store_length in truncate_string() (in functions_content.php)
  • +
  • [PHPBB3-10303] - send_status_line() doesn't validate user input
  • +
  • [PHPBB3-10304] - Bad url in U_ICQ on /ucp_mp_viewmessage.php
  • +
  • [PHPBB3-10307] - Return value of $db->sql_fetchrow() on empty tables is not consistent
  • +
  • [PHPBB3-10309] - Utf tests download data into temporary locations deep in source tree
  • +
  • [PHPBB3-10320] - "Most active topic" can leak topic title of topics in password-protected forums
  • +
  • [PHPBB3-10321] - Link to page 1 of the Memberlist has a useless question mark at the end
  • +
  • [PHPBB3-10324] - XHTML error in Prosilver - MCP - User Notes
  • +
  • [PHPBB3-10339] - Typo in prosilver's mcp_front.html
  • +
  • [PHPBB3-10341] - Topic title of "0" does not show as "Most active topic"
  • +
  • [PHPBB3-10351] - Invalid syntax for Oracle's sql_column_remove()
  • +
  • [PHPBB3-10352] - Missing break for Oracle's sql_table_drop()
  • +
  • [PHPBB3-10365] - Moderators can view forbidden information
  • +
  • [PHPBB3-10377] - All moderators can change topic type
  • +
  • [PHPBB3-10394] - Tests use call-time pass by reference which results in Fatal error on PHP 5.4
  • +
  • [PHPBB3-10397] - Pagination code inconsistency
  • +
  • [PHPBB3-10400] - '0' (zero) not allowed as forum name
  • +
  • [PHPBB3-10413] - Make create_schema_files usable
  • +
  • [PHPBB3-10416] - Use dbport in phpbb_database_test_connection_manager::connect()
  • +
  • [PHPBB3-10420] - Update startup to account for PHP 5.4
  • +
  • [PHPBB3-10421] - Interchanged parameters in includes/acp/acp_users.php
  • +
  • [PHPBB3-10422] - Unnecessary <!-- IF --> statement in viewtopic_body.html
  • +
  • [PHPBB3-10435] - Topic count mismatch on viewforum
  • +
  • [PHPBB3-10437] - Announcements on moderation queue are not hidden
  • +
  • [PHPBB3-10446] - Unencoded 8bit characters in email headers
  • +
  • [PHPBB3-10452] - XHTML error when printing a PM
  • +
  • [PHPBB3-10461] - MCP's recent actions list is empty
  • +
  • [PHPBB3-10479] - Remove PostgreSQL version numbers from driver's language string
  • +
  • [PHPBB3-10485] - XHTML error in Prosilver - index and viewforum
  • +
  • [PHPBB3-10488] - Database updater for 3.0.10-RC1 overwrites config variable email_max_chunk_size without checking for custom value
  • +
  • [PHPBB3-10497] - SQL error when guest visits forum with unread topic
  • +
  • [PHPBB3-10319] - Missing hidden fields in search form
  • +
  • [PHPBB3-10501] - Description of table prefix is wrong
  • +
  • [PHPBB3-10502] - CHANGELOG.html has a typo: 'red' should be 'read'.
  • +
  • [PHPBB3-10503] - Debug error when previewing edits
  • +
  • [PHPBB3-10504] - MCP Layout STILL broken in ProSilver when screen is resized to less 1200 pixels
  • +
  • [PHPBB3-10531] - Last remaining style can be uninstalled
  • +
+

Improvement

+
    +
  • [PHPBB3-8616] - Add direct link to PM to notification message
  • +
  • [PHPBB3-9036] - Forums that can be listed but not read expose forum information
  • +
  • [PHPBB3-9297] - Add support for Extended Passive Mode (EPSV) in class ftp_fsock to better support IPv6 connections.
  • +
  • [PHPBB3-9307] - Mass email $max_chunk_size
  • +
  • [PHPBB3-9361] - Edit account settings - Improved clarification needed
  • +
  • [PHPBB3-9778] - Member Search from the Admin Control Panel is not Intuitive
  • +
  • [PHPBB3-9898] - Readme needs updating to reflect more opening for patches
  • +
  • [PHPBB3-9995] - Unnecessary coding in display_forums() in functions_display.php
  • +
  • [PHPBB3-10032] - BBCode Add List Item Control Name Contains Typo
  • +
  • [PHPBB3-10074] - Change default value of 'Set as special rank' to No for Add new rank
  • +
  • [PHPBB3-10185] - Board startdate not being set
  • +
  • [PHPBB3-10189] - Add "automatically generated" comment into schema-files.
  • +
  • [PHPBB3-10199] - Performance: viewtopic has a useless join
  • +
  • [PHPBB3-10222] - Also build language and styles changes in diff/patch format
  • +
  • [PHPBB3-10239] - Add "Are you sure" confirmation to backup restore in ACP
  • +
  • [PHPBB3-10243] - Add gmgetdate() wrapper for getdate() which returns dates in UTC.
  • +
  • [PHPBB3-10245] - Messenger uses output buffering for error collection, should use error collector instead
  • +
  • [PHPBB3-10246] - Remove VCS section from docs/coding-guidelines.html
  • +
  • [PHPBB3-10254] - Remove style names from themes and fix some information on it
  • +
  • [PHPBB3-10263] - Add phpbb_version_compare() wrapper for version_compare()
  • +
  • [PHPBB3-10278] - Improve timeout handling in get_remote_file()
  • +
  • [PHPBB3-10315] - Radio Buttons in ACP are clipped in Safari - Fix suggested
  • +
  • [PHPBB3-10327] - Use "ALTER TABLE ... ADD INDEX" instead of "CREATE INDEX"
  • +
  • [PHPBB3-10334] - Birthday List display not dependent on user privileges
  • +
  • [PHPBB3-10335] - Responses to bots should have extra header to be used by reverse proxies
  • +
  • [PHPBB3-10346] - Add drop_tables key for database updater
  • +
  • [PHPBB3-10354] - When template tests are skipped because cache is not writable, print cache directory path
  • +
  • [PHPBB3-10369] - Change error collector to always report errfile and errline
  • +
  • [PHPBB3-10370] - Various improvements for get_backtrace()
  • +
  • [PHPBB3-10402] - Displaying report texts with linebreaks and clickable links
  • +
  • [PHPBB3-10419] - Add mbstring PHP ini parameters checks to ACP
  • +
  • [PHPBB3-10430] - Some typos and the like in docs/coding-guidelines.html
  • +
+

New Feature

+
    +
  • [PHPBB3-8240] - Request: db_tools to have two additional functions, table list and column list
  • +
+

Task

+ + +

Changes since 3.0.8

+ +

Bug +

+
    +
  • [PHPBB3-217] - Multiline [url] not Converted +
  • +
  • [PHPBB3-6712] - Topic bumping does not create new topic icon on index +
  • +
  • [PHPBB3-7057] - Quicksearch uses POST, thus the page expires! +
  • +
  • [PHPBB3-7778] - Increase limit of custom BBcodes +
  • +
  • [PHPBB3-7834] - Correctly update topic_time when deleting first post in topic +
  • +
  • [PHPBB3-7888] - URL of search results page does not always contain all keywords of the search query +
  • +
  • [PHPBB3-7941] - mistake in description of function generate_board_url +
  • +
  • [PHPBB3-8138] - Browser autocompleton fills wrong fields in ACP +
  • +
  • [PHPBB3-8736] - Honour ACP settings for min/max username length when posting as a guest. +
  • +
  • [PHPBB3-8802] - Wrong confirmation text when clicking "mark forums read" in a category +
  • +
  • [PHPBB3-8904] - Show numeric CPF default value when editing +
  • +
  • [PHPBB3-9166] - Subsilver and prosilver CSS elements out of order. +
  • +
  • [PHPBB3-9348] - Correctly encode default_dateformat when converting from phpBB2 +
  • +
  • [PHPBB3-9575] - The word "administrate" is not correct. +
  • +
  • [PHPBB3-9630] - Naming inconsistency of Merging Posts / Topics in MCP +
  • +
  • [PHPBB3-9675] - Add option to delete template/theme/imageset when deleting style. +
  • +
  • [PHPBB3-9685] - Unable to create "Fulltext native" search index using the mssqlnative DBAL +
  • +
  • [PHPBB3-9751] - Password requirement "Must contain letters and numbers" is not working properly +
  • +
  • [PHPBB3-9764] - Empty value for CONFIG_TABLE config_name= 'mime_triggers' causes functions_fileupload.php->fileupload->check_content() to be too restrictive +
  • +
  • [PHPBB3-9851] - "Search new posts" should require login +
  • +
  • [PHPBB3-9872] - Total topics isn't correct after I deleted a user +
  • +
  • [PHPBB3-9874] - view_log() performs unneeded count query over all log entries. +
  • +
  • [PHPBB3-9892] - Firebird index name length limit is not taken into account +
  • +
  • [PHPBB3-9905] - DSN field should include SQLite +
  • +
  • [PHPBB3-9908] - Send "Moved Permanently" before stripping off session ids for Bots. +
  • +
  • [PHPBB3-9910] - Javascript bug in Subsilver2 PMs +
  • +
  • [PHPBB3-9911] - Incorrect open/close field in Manage ranks ACP +
  • +
  • [PHPBB3-9913] - currunt should be current +
  • +
  • [PHPBB3-9915] - "Length of ban:" is not displayed in ACP +
  • +
  • [PHPBB3-9924] - $template->display hook does not pass $template instance +
  • +
  • [PHPBB3-9925] - prosilver logo margin bug in IE 6-7-8 +
  • +
  • [PHPBB3-9928] - Do not link "login to your board" to the "send statistics" page after completed update. +
  • +
  • [PHPBB3-9930] - Redirect fails with open_basedir enabled +
  • +
  • [PHPBB3-9932] - The Bing bot is not added when converting. +
  • +
  • [PHPBB3-9933] - Wrong handling of consecutive multiple asterisks in word censor +
  • +
  • [PHPBB3-9934] - Mass Mail missing under the system tab on a fresh install +
  • +
  • [PHPBB3-9939] - JavaScript error in recaptcha ACP template +
  • +
  • [PHPBB3-9944] - Extension groups naming don't use users' language in ACP +
  • +
  • [PHPBB3-9946] - $inserts empty in sql_query() for oracle +
  • +
  • [PHPBB3-9948] - Inline quicktime files won't display +
  • +
  • [PHPBB3-9949] - $user->lang() is not handling arguments as per documentation +
  • +
  • [PHPBB3-9950] - Problem with localized button images after uprading from 3.0.7-PL1 to 3.0.8 +
  • +
  • [PHPBB3-9953] - Set focus to password on re-authentication +
  • +
  • [PHPBB3-9954] - u_masspm* permissions are forced to never for certain groups +
  • +
  • [PHPBB3-9961] - Inconsistent activation logs +
  • +
  • [PHPBB3-9966] - Language download in ACP creates index.html and misses captcha_* +
  • +
  • [PHPBB3-9970] - user_lang input not checked during registration +
  • +
  • [PHPBB3-9981] - Fix unit test dependencies on phpBB files +
  • +
  • [PHPBB3-9985] - 3D Wave CAPTCHA mt_rand() does not check order of min/max values +
  • +
  • [PHPBB3-9997] - Inconsistent approve/disapprove button order in modcp +
  • +
  • [PHPBB3-9999] - {forumrow.L_FORUM_FOLDER_ALT} and {SEARCH_IMG} only return a language key. +
  • +
  • [PHPBB3-10005] - users can register without custom profile field correctly entered +
  • +
  • [PHPBB3-10011] - __DIR__ in test suite renders it unusable on php < 5.3 +
  • +
  • [PHPBB3-10016] - set_config_count() fails on PostreSQL 7 +
  • +
  • [PHPBB3-10020] - ACP function validate_range() fails partially on non-32-bit systems +
  • +
  • [PHPBB3-10021] - "Find a member" generates SQL error when large dates are entered +
  • +
  • [PHPBB3-10029] - No such thing as $_SERVER['HTTP_VERSION'] +
  • +
  • [PHPBB3-10033] - "Disallow usernames" does not check already disallowed names +
  • +
  • [PHPBB3-10035] - ACP template edit feature allows to read any files on webserver and to upload/execute any script on it +
  • +
  • [PHPBB3-10036] - Use image from configuration file for displaying online-status. +
  • +
  • [PHPBB3-10038] - download/file.php uses $_GET value instead of function request_var() +
  • +
  • [PHPBB3-10039] - 2.x to 3.x conversion fails when using mssqlnative to connect to destination database +
  • +
  • [PHPBB3-10042] - GD captcha has invalid mt_rand calls +
  • +
  • [PHPBB3-10047] - Session ID always included in URL on posting.php +
  • +
  • [PHPBB3-10049] - Session test files are misnamed, session tests are not run +
  • +
  • [PHPBB3-10052] - Session tests are broken +
  • +
  • [PHPBB3-10056] - Firebird misspelled in database updater +
  • +
  • [PHPBB3-10058] - Root path is undefined in MySQL upgrader +
  • +
  • [PHPBB3-10059] - Consistent is misspelled twice +
  • +
  • [PHPBB3-10060] - Typo in tests database connection manager +
  • +
  • [PHPBB3-10068] - Firefox4 restrictions to :visited +
  • +
  • [PHPBB3-10078] - commit-msg hook prints \n on freebsd +
  • +
  • [PHPBB3-10081] - Cleanup Template Tests +
  • +
  • [PHPBB3-10084] - Add smilie errors out when image is missing +
  • +
  • [PHPBB3-10088] - Cache mock does not unset database versions other than mysqli +
  • +
  • [PHPBB3-10090] - cache/queue.php.lock isn't covered by .gitignore +
  • +
  • [PHPBB3-10092] - commit-msg hook aborts on overlength comment lines +
  • +
  • [PHPBB3-10096] - Wrong whitespace in functions.php +
  • +
  • [PHPBB3-10100] - Race condition in unique_id() on heavily busy database. +
  • +
  • [PHPBB3-10102] - member.S_PENDING_SET in styles/prosilver/template/ucp_groups_manage.html +
  • +
  • [PHPBB3-10104] - missing one intval() along with others already being there +
  • +
  • [PHPBB3-10109] - Errors while copying a topic +
  • +
  • [PHPBB3-10112] - Use of count() in captcha_gd.php and mssqlnative.php +
  • +
  • [PHPBB3-10115] - BBcodes not working if post contains about or more 55000 non-english symbols +
  • +
  • [PHPBB3-10117] - Big posts becomes empty if they have smilies on specified places. +
  • +
  • [PHPBB3-10121] - ICQ profile link leads to a webservice that is no longer active +
  • +
  • [PHPBB3-10123] - Inconsistent use of smilie/smiley +
  • +
  • [PHPBB3-10128] - Error message is on green background when trying to ban a nonexistent user +
  • +
  • [PHPBB3-10137] - Deleting an unintended space at the end of PHP_URL_FOPEN_SUPPORT_EXPLAIN +
  • +
  • [PHPBB3-10146] - Firebird cannot handle DECIMAL(255, 0) +
  • +
  • [PHPBB3-10147] - Typo in code comment in functions_template.php +
  • +
  • [PHPBB3-10149] - deregister_globals causes error when cookie called GLOBALS is set to scalar value +
  • +
  • [PHPBB3-10170] - reCAPTCHA address has changed +
  • +
  • [PHPBB3-10171] - Firefox4 displays grey pixels at PM message rows when message is neither marked nor replied +
  • +
  • [PHPBB3-10177] - phpBB package cannot be built with bsdtar +
  • +
  • [PHPBB3-10178] - build.xml does not specify path to find - breaks on FreeBSD +
  • +
  • [PHPBB3-10188] - Broken compressed output when errors/warnings are handled by phpbb and output_buffering is set to 4096 and phpbb gzip is enabled +
  • +
  • [PHPBB3-10191] - Duplicate output when output_handler is set in php.ini +
  • +
  • [PHPBB3-10192] - Missing semicolon in MySQL Upgrader +
  • +
  • [PHPBB3-10195] - Do not check DNS Blacklists if IPv6 address is passed to session::check_dnsbl(). +
  • +
  • [PHPBB3-10198] - Function validate_config_vars() improperly validates multibyte strings +
  • +
  • [PHPBB3-10203] - Fix quotations and hyphen in language strings for PHPBB3-10067 +
  • +
  • [PHPBB3-10204] - Package build tool does not detect binary file changes +
  • +
  • [PHPBB3-10206] - Normalization tests fail when unicode.org is not reachable +
  • +
  • [PHPBB3-10211] - Missing space on the recent PHPBB3-9992 changes +
  • +
  • [PHPBB3-10213] - IP limit index name too long on Oracle +
  • +
  • [PHPBB3-10214] - Cannot configure Q&A on Oracle +
  • +
  • [PHPBB3-10218] - STRIP is not defined in style.php causing a notice to be thrown +
  • +
  • [PHPBB3-10219] - Inappropriate character in web.config file +
  • +
  • [PHPBB3-10220] - Logging in with Mobile Device triggers SQL error on *_login_attempts. +
  • +
  • [PHPBB3-10221] - Inconsistent usage of "Seconds" in ACP Settings +
  • +
  • [PHPBB3-7729] - Prevent date/time functions from throwing E_WARNING on PHP 5.3 by setting a default timezone +
  • +
  • [PHPBB3-10188] - Broken compressed output when errors/warnings are handled by phpbb and output_buffering is set to 4096 and phpbb gzip is enabled +
  • +
  • [PHPBB3-10223] - Updater references startup.php from board path +
  • +
  • [PHPBB3-10228] - Typo in 3.0.9-RC1 user registration settings +
  • +
  • [PHPBB3-10229] - On languge/acp/styles.php "%s" should be "%s" +
  • +
  • [PHPBB3-10232] - Search within topic/forum searches all posts +
  • +
  • [PHPBB3-10233] - IE Emulation fix breaks posting layout when PMing +
  • +
  • [PHPBB3-10234] - msg_handler() reports E_WARNING as "PHP Notice: " +
  • +
  • [PHPBB3-10247] - mediumint(8) too small for phpbb_login_attempts.attempt_id +
  • +
  • [PHPBB3-10250] - phpBB Logo needs the Registered Trademark Symbol +
  • +
+ +

Improvement +

+
    +
  • [PHPBB3-9581] - Banned users get mass emails. +
  • +
  • [PHPBB3-9802] - Optimize session_begin REMOTE_ADDR validation +
  • +
  • [PHPBB3-9878] - Get rid of Internet Explorer 7 emulation +
  • +
  • [PHPBB3-9897] - Language typos in language/en/acp/board.php +
  • +
  • [PHPBB3-9922] - Posting URL in subsilver 2 +
  • +
  • [PHPBB3-9937] - Feed Icon displays on Forum links +
  • +
  • [PHPBB3-9980] - URLs to javascript should be T_SUPER_TEMPLATE_PATH instead of T_TEMPLATE_PATH +
  • +
  • [PHPBB3-9989] - Skip PM popup in overall_header.html, if there are no new PMs. +
  • +
  • [PHPBB3-10007] - Add directive 'internal' to blocked folders in nginx example configuration. +
  • +
  • [PHPBB3-10009] - Differentiate published/updated dates in Atom feed +
  • +
  • [PHPBB3-10014] - Make the error message when cache is not writable clearer +
  • +
  • [PHPBB3-10024] - Allow a Style to present Unread PM in different way than read PM +
  • +
  • [PHPBB3-10040] - Continuous integration on PHP 5.2 +
  • +
  • [PHPBB3-10041] - download/file.php needs more use of send_status_line +
  • +
  • [PHPBB3-10044] - Setup github network improvements +
  • +
  • [PHPBB3-10057] - More informative reporting of errors when database connection fails for Firebird and PostgreSQL. +
  • +
  • [PHPBB3-10067] - ACP options for account activation are confusing when emails are turned off board-wide +
  • +
  • [PHPBB3-10069] - Improvements in sample nginx config file +
  • +
  • [PHPBB3-10072] - Send the post number to the template as it relates to it's position in the topic +
  • +
  • [PHPBB3-10101] - Compatibility with native phpass hashes +
  • +
  • [PHPBB3-10126] - Replace ^ with &~ in error_reporting calls +
  • +
  • [PHPBB3-10141] - Performance improvement for $auth->_fill_acl() +
  • +
  • [PHPBB3-10145] - Ability to force recompilation of all templates on every page load +
  • +
  • [PHPBB3-10154] - Move "copy permissions from" to below "parent" in forum creation form +
  • +
  • [PHPBB3-10158] - Return link not really useful after sending a Private Message +
  • +
  • [PHPBB3-10186] - UCP signature panel displays when not authed for signatures +
  • +
+ +

New Feature +

+ + +

Task +

+
    +
  • [PHPBB3-9788] - Add README for GitHub +
  • +
  • [PHPBB3-9805] - Add a script for setting up git remotes for a github network +
  • +
  • [PHPBB3-9806] - Script for easy merging +
  • +
  • [PHPBB3-9824] - Git hook quirks +
  • +
  • [PHPBB3-9859] - Remove the years from visible copyright in the footer. +
  • +
  • [PHPBB3-9921] - Add sample configuration for lighttpd webserver +
  • +
  • [PHPBB3-9943] - Setup phpDocumentor API documentation generation +
  • +
  • [PHPBB3-9967] - Use phpunit.xml for test suite +
  • +
  • [PHPBB3-9987] - Enforce _test.php suffix for test files +
  • +
  • [PHPBB3-9990] - Integrate utf normalizer tests into test suite +
  • +
  • [PHPBB3-10043] - Refactor phpbb_database_test_case +
  • +
  • [PHPBB3-10046] - Getting rid of register_shutdown_function() in cron.php to prevent path disclosure (reported by lacton) +
  • +
  • [PHPBB3-10075] - Update docs/AUTHORS for 3.0.9-RC1 release +
  • +
  • [PHPBB3-10079] - Add gallery avatars to .gitignore. +
  • +
  • [PHPBB3-10082] - Fix Session Test Issues with CHAR vs. VARCHAR. +
  • +
  • [PHPBB3-10105] - Update AIM express link and "Download Application" links +
  • +
  • [PHPBB3-10107] - Improve docs for non-apache webserver configuration +
  • +
+ +

Sub-task +

+
    +
  • [PHPBB3-9732] - Cover session code extensively in tests +
  • +
  • [PHPBB3-9968] - Create unit test for word censor regular expression +
  • +
  • [PHPBB3-9969] - Move word censor regular expression creation into separate function definition in functions.php +
  • +
+ +

Changes since 3.0.7-PL1

+ +

Security +

+
    +
  • [PHPBB3-9903] - Execute javascript in [flash=] BBCode +
  • +
+ +

Bug +

+
    +
  • [PHPBB3-4923] - compress_tar incorrectly determines type +
  • +
  • [PHPBB3-5164] - Honor minimum and maximum password length in generated passwords as much as possible. +
  • +
  • [PHPBB3-6726] - Connecting to PostgreSQL using 'localhost' doesn't try to use a TCP connection +
  • +
  • [PHPBB3-6747] - word censoring * does not handle space for two or more words +
  • +
  • [PHPBB3-7260] - Do not delete polls if one exists and editing user lacks permissions +
  • +
  • [PHPBB3-7296] - Style export to tar(.*) does not work +
  • +
  • [PHPBB3-7369] - Custom Profile dates display incorrectly +
  • +
  • [PHPBB3-7417] - Search keywords field does not initially get focus +
  • +
  • [PHPBB3-7538] - Query exceeds maximum value for user_login_attempts +
  • +
  • [PHPBB3-7716] - Data too long for column 'message_subject' +
  • +
  • [PHPBB3-7720] - Fix alternative image-description for unread posts. +
  • +
  • [PHPBB3-7782] - Send HTTP 404 if topic, forum or user do not exist +
  • +
  • [PHPBB3-7972] - Copied topics are not indexed +
  • +
  • [PHPBB3-8169] - Parse CSS Regex accepts invalid code +
  • +
  • [PHPBB3-8792] - Misleading error message in auth_ldap.php, function init_ldap() +
  • +
  • [PHPBB3-8894] - JavaScript error and visible quote button on topic review if BBCodes disallowed +
  • +
  • [PHPBB3-8924] - spelling in admin_welcome_inactive.txt +
  • +
  • [PHPBB3-8929] - MS SQL error on view all smilies after 3.0.6 upgrade +
  • +
  • [PHPBB3-8935] - able to set minimal avatar size larger than maximum +
  • +
  • [PHPBB3-8944] - Error on database update (must specify size of index on MySQL4) +
  • +
  • [PHPBB3-9012] - Retain original topic title in shadow topic when moving a topic and editing the title. +
  • +
  • [PHPBB3-9034] - Redirect() fails with directory traversal +
  • +
  • [PHPBB3-9047] - Active topics and reported posts +
  • +
  • [PHPBB3-9049] - Password reminder system generates confusable passwords +
  • +
  • [PHPBB3-9053] - Correctly sort database backup file list by date on database restore page +
  • +
  • [PHPBB3-9061] - Race condition in queue locking +
  • +
  • [PHPBB3-9068] - Grammatical Error under Load Settings +
  • +
  • [PHPBB3-9075] - Missing / bad default values of CPFs result in SQL errors on registration of new users +
  • +
  • [PHPBB3-9091] - Wrong IP checking for IPv4 addresses mapped into IPv6 +
  • +
  • [PHPBB3-9094] - Hide "Copy permissions" message, when permissions were copied. +
  • +
  • [PHPBB3-9095] - Misleading setting text for CAPTCHA +
  • +
  • [PHPBB3-9099] - Missing comma in PASSWORD_EXPLAIN acp language strings +
  • +
  • [PHPBB3-9101] - Bad text placement for reCAPTCHA description +
  • +
  • [PHPBB3-9104] - Safari does not display box headers correctly in the ACP. +
  • +
  • [PHPBB3-9107] - Can't Set Parent Forum +
  • +
  • [PHPBB3-9108] - RSS feeds does not work on Postgres +
  • +
  • [PHPBB3-9112] - Most active forum post count does not respect m_approve permission +
  • +
  • [PHPBB3-9114] - Recent bug fix for smilies causing problems on older MySQL versions +
  • +
  • [PHPBB3-9117] - Wrong redirection after login +
  • +
  • [PHPBB3-9119] - Language selection is disregarded in automatic update +
  • +
  • [PHPBB3-9120] - Typo fix in a comment in functions.php +
  • +
  • [PHPBB3-9121] - Forum feed shows posts that are currently on the moderation queue +
  • +
  • [PHPBB3-9125] - ACP User Overview: Unmatched </form> tag when viewing own user +
  • +
  • [PHPBB3-9126] - Invalid redirection after login to forum not in web root +
  • +
  • [PHPBB3-9132] - Oracle CLOB support is broken, preventing storage of long strings +
  • +
  • [PHPBB3-9135] - Fix report-icon for moderators in PM folders. +
  • +
  • [PHPBB3-9140] - Check current board version in incremental update packages +
  • +
  • [PHPBB3-9145] - Fix open_basedir issues when accessing styles- and language-management +
  • +
  • [PHPBB3-9146] - Quick-Reply tabindex="6" set twice +
  • +
  • [PHPBB3-9147] - "Change topic type"-option "Normal" always selected. +
  • +
  • [PHPBB3-9154] - Correctly check for double inclusion in captcha garbage collection +
  • +
  • [PHPBB3-9158] - viewforum/viewtopic pages unnecessarily duplicated with start=0 +
  • +
  • [PHPBB3-9162] - BBCode in poll options is broken, when posting without question. +
  • +
  • [PHPBB3-9167] - Remove shadow topics from remaining forums when deleting a forum including posts +
  • +
  • [PHPBB3-9170] - Unable to get image size in img bbcode when URL has multiple parameters. +
  • +
  • [PHPBB3-9173] - sql_config_count() artificially limits number scope to 4byte-integer on PostgreSQL and Firebird +
  • +
  • [PHPBB3-9176] - When setting the board's date format the board's timezone settings aren't taken into account +
  • +
  • [PHPBB3-9451] - Unnecessary overhead in avatar_process_user function +
  • +
  • [PHPBB3-9478] - Validate maximum number of allowed recipients per PM value +
  • +
  • [PHPBB3-9495] - Loginbox <input /> redirect breaks xHTML +
  • +
  • [PHPBB3-9499] - Javascript function dE does not correctly detect element visibility +
  • +
  • [PHPBB3-9504] - Allow gallery avatars with whitespaces in the filename +
  • +
  • [PHPBB3-9509] - phpBB Coding Guidelines state subversion as the version control system for phpBB +
  • +
  • [PHPBB3-9510] - Unable to copy permissions from and to forums you cannot see +
  • +
  • [PHPBB3-9512] - Fix dead link in MCP on reports for global announcements in prosilver. +
  • +
  • [PHPBB3-9514] - Correctly delete big datasets when deleting a forum including topics/posts on non-MySQL databases +
  • +
  • [PHPBB3-9518] - Postgres DBAL does not correctly create a new database connection when passing $new_link as true +
  • +
  • [PHPBB3-9519] - Replace remaining is_writable() calls with phpbb_is_writable(). +
  • +
  • [PHPBB3-9521] - MSSQL error reporting returns String instead of an error +
  • +
  • [PHPBB3-9524] - IPv6 regular expression does not match addresses starting in :: +
  • +
  • [PHPBB3-9526] - User Preference to hide online status does not work for bots +
  • +
  • [PHPBB3-9528] - Quoting in a PM does not fall back to bbcode-less quotes using "> " when bbcodes are disabled +
  • +
  • [PHPBB3-9529] - Topic review does not display all selected posts +
  • +
  • [PHPBB3-9530] - subsilver2 missing fallback option on quoting when bbcodes are disabled +
  • +
  • [PHPBB3-9531] - BBCode-less fall back option for quotes is missing "Author wrote:" line when quoting from topic-review. +
  • +
  • [PHPBB3-9535] - Incorrect margins in RTL languages: signatures, permission ACP & updater +
  • +
  • [PHPBB3-9545] - 'Your first forum' should have 'Display active topics:' set to 'Yes' +
  • +
  • [PHPBB3-9546] - Moving all posts from one topic to another does not delete bookmarks +
  • +
  • [PHPBB3-9547] - Changing forum type applies FORUM_FLAG_ACTIVE_TOPICS to new forum type. +
  • +
  • [PHPBB3-9548] - Delete user quicktool drop down should have an empty or invalid selection as the default +
  • +
  • [PHPBB3-9559] - Messenger Queue Batch Size configuration option is overridden +
  • +
  • [PHPBB3-9567] - Newly registered users group ACP wording +
  • +
  • [PHPBB3-9582] - Missing MSSQL native driver case statements +
  • +
  • [PHPBB3-9587] - Prosilver overrides reCaptcha class. +
  • +
  • [PHPBB3-9592] - Test suite does not run on SQLite +
  • +
  • [PHPBB3-9593] - Missing documentation for running unit tests +
  • +
  • [PHPBB3-9599] - Windows workaround for checkdnsrr() returns wrong results +
  • +
  • [PHPBB3-9605] - Wrong class added to topiclist, when there's no announcement topic. +
  • +
  • [PHPBB3-9615] - When attaching a file whose name contains quotes, filename before last quote is cut off in display +
  • +
  • [PHPBB3-9623] - Strings not properly normalized - acp_prune.php +
  • +
  • [PHPBB3-9626] - Regular expressions from get_preg_expression() are untested. +
  • +
  • [PHPBB3-9628] - Add module function does not correctly insert a module after the specified one +
  • +
  • [PHPBB3-9633] - Newly registered users group color is not used in Our Newest Member +
  • +
  • [PHPBB3-9635] - Useless parameter $data['post_time'] in function submit_post. +
  • +
  • [PHPBB3-9637] - SET NAMES 'BINARY' error in convertor +
  • +
  • [PHPBB3-9643] - DB connection error when $dbhost is an IPv6 address +
  • +
  • [PHPBB3-9644] - submit_post shows support for options that cause a trigger_error in the call to user_notification +
  • +
  • [PHPBB3-9646] - Cant hide/outcomment @import in stylesheet.css +
  • +
  • [PHPBB3-9650] - It should not be possible to ban Anonymous +
  • +
  • [PHPBB3-9653] - xhtml errors in subsilver2 when using the bbcodes code and quote in signatures +
  • +
  • [PHPBB3-9655] - Selecting an unavailable captcha plugin looks like a successful action +
  • +
  • [PHPBB3-9656] - PHP Information in ACP always lists error_reporting as 0 +
  • +
  • [PHPBB3-9658] - Optimize topic splitting +
  • +
  • [PHPBB3-9662] - Search interval applied inconsistently +
  • +
  • [PHPBB3-9664] - Another duplicate accesskey: t = top and list item +
  • +
  • [PHPBB3-9665] - Signature "0" cannot be previewed +
  • +
  • [PHPBB3-9677] - Subsilver2 is missing the bbcode-helpline for inline-attachments. +
  • +
  • [PHPBB3-9678] - Flash attachments are not displayed in subsilver2. +
  • +
  • [PHPBB3-9679] - "Notify User" checkbox appears in MCP Queue even if no notification methods are enabled +
  • +
  • [PHPBB3-9686] - Unable to create data backup using the mssqlnative DBAL +
  • +
  • [PHPBB3-9694] - Calling download/file.php with empty avatar parameter can throw an E_NOTICE message +
  • +
  • [PHPBB3-9695] - Bad Display of User Input - mcp_ban +
  • +
  • [PHPBB3-9696] - Installation of phpBB with SQLite fails +
  • +
  • [PHPBB3-9697] - Backlink broken when the select parent forum does not exist. +
  • +
  • [PHPBB3-9698] - Returning result of new by reference is deprecated in php 5.3 +
  • +
  • [PHPBB3-9702] - "Ban until (date)" appears to be based on UTC time instead of local time +
  • +
  • [PHPBB3-9703] - Removing a user does not remove their private message folders or rules +
  • +
  • [PHPBB3-9704] - Coding guidelines typo +
  • +
  • [PHPBB3-9712] - Future dates display as "less than one minute ago" +
  • +
  • [PHPBB3-9714] - "Undefined variable: email" in email regular expression unit tests +
  • +
  • [PHPBB3-9715] - Fix email address regular expression or adjust email regular expression unit tests +
  • +
  • [PHPBB3-9722] - "New Topic" button title attribute mismatch in prosilver's viewforum +
  • +
  • [PHPBB3-9727] - Feed replaces ./ with board URL +
  • +
  • [PHPBB3-9743] - Fix background-position of top2-class in prosilver for RTL-languages. +
  • +
  • [PHPBB3-9744] - Mistyped word 'then' in FAQ. It should be 'than'. +
  • +
  • [PHPBB3-9748] - <br /> not being replaced in prepare_message +
  • +
  • [PHPBB3-9749] - fulltext_mysql.php overreacts on + and - characters in search words +
  • +
  • [PHPBB3-9752] - Misleading text when using Q&A CAPTCHA +
  • +
  • [PHPBB3-9754] - Template variable S_USER_POSTED always set to false in search.php +
  • +
  • [PHPBB3-9757] - Empty template variable HISTORY_TITLE in ucp_pm_history +
  • +
  • [PHPBB3-9760] - Fulltext native search, wildcard * does not get escaped leading to long execution time +
  • +
  • [PHPBB3-9761] - Quote nesting depth explanation is misleading +
  • +
  • [PHPBB3-9771] - build_url() doesn't ignore empty parameters +
  • +
  • [PHPBB3-9772] - Under some circumstances, email addresses are shown to undesired users +
  • +
  • [PHPBB3-9780] - gen_rand_string() not respecting $num_chars parameter anymore. +
  • +
  • [PHPBB3-9782] - Board disable radio in Board-Settings set on when server load high +
  • +
  • [PHPBB3-9793] - Undefined function send_status_line() in download/file.php when in avatar mode. +
  • +
  • [PHPBB3-9807] - Avatar tab displays when avatars are disabled +
  • +
  • [PHPBB3-9810] - Clicking on "Select All" of code tag on print page results in a javascript error when using prosilver +
  • +
  • [PHPBB3-9820] - Fix undefined indexes when trying to post a new topic +
  • +
  • [PHPBB3-9822] - Can not delete style-components from the file-system as per explanation. +
  • +
  • [PHPBB3-9829] - Recaptcha plugin result interpretation fault +
  • +
  • [PHPBB3-9835] - Login Confirm Explain Not Working +
  • +
  • [PHPBB3-9840] - Display view unread posts link for guests +
  • +
  • [PHPBB3-9841] - Change "Save" button to "Save draft" +
  • +
  • [PHPBB3-9847] - Language typo and written form (British/American) +
  • +
  • [PHPBB3-9854] - Auth API documentation is incomplete +
  • +
  • [PHPBB3-9855] - Tests don't run on PHPUnit 3.5 +
  • +
  • [PHPBB3-9879] - captcha_qa.php spelling, punctuation and grammar errors +
  • +
  • [PHPBB3-9883] - CAPTCHA uses american english +
  • +
  • [PHPBB3-9884] - Massive email delays +
  • +
  • [PHPBB3-9885] - Default file extension groups not properly updated by database updater. +
  • +
  • [PHPBB3-9886] - Database updater does not run on PostgreSQL because of an error in _add_module() +
  • +
  • [PHPBB3-9888] - Update fails when Bing [Bot] was already added to the users table +
  • +
  • [PHPBB3-9891] - Updater drops language-selection after database-update +
  • +
  • [PHPBB3-9509] - phpBB Coding Guidelines state subversion as the version control system for phpBB +
  • +
+ +

Improvement +

+
    +
  • [PHPBB3-7332] - MCP post details usability +
  • +
  • [PHPBB3-7717] - Use user's language for standard-extensions-group name +
  • +
  • [PHPBB3-8709] - Multibyte keys in request_var not possible +
  • +
  • [PHPBB3-8936] - subsilver2 missing reply-to-all feature +
  • +
  • [PHPBB3-9088] - Add missing semicolons in js files +
  • +
  • [PHPBB3-9179] - improve quasi-documentation of notify_status values +
  • +
  • [PHPBB3-9503] - Posts with empty titles in moderation queue are not easily approved +
  • +
  • [PHPBB3-9534] - user_ipwhois() does not support IPv6 addresses +
  • +
  • [PHPBB3-9536] - Small improvement for query against sessions table in acp_users.php +
  • +
  • [PHPBB3-9553] - Make git hooks run with /bin/sh instead of bash +
  • +
  • [PHPBB3-9570] - Change "system timezone" to "guest timezone" in acp, add explanation +
  • +
  • [PHPBB3-9578] - ACP Posting tab is missing "Post settings" module. +
  • +
  • [PHPBB3-9589] - Sample nginx configuration file +
  • +
  • [PHPBB3-9595] - Search settings in ACP: Add information on minimum word size indexed when using Fulltext MySQL backend +
  • +
  • [PHPBB3-9598] - Call checkdnsrr() on Windows with PHP 5.3 +
  • +
  • [PHPBB3-9609] - Use send_status_line instead of calling header +
  • +
  • [PHPBB3-9611] - Increase entropy in activation keys +
  • +
  • [PHPBB3-9612] - Split gen_rand_string() into gen_rand_string() and gen_rand_string_friendly() +
  • +
  • [PHPBB3-9629] - sid parameter forced for style.php makes caching difficult +
  • +
  • [PHPBB3-9659] - Default phpBB signature user_options need to be set for convertors +
  • +
  • [PHPBB3-9690] - MSN Bot will become Bing Bot +
  • +
  • [PHPBB3-9777] - Print useful error message in pre-commit hook when php is not installed. +
  • +
  • [PHPBB3-9785] - Not able to recover a password when board disabled +
  • +
  • [PHPBB3-9825] - Run tests on sqlite if available and no test db configured +
  • +
  • [PHPBB3-9827] - IE9 Beta fixes IE8 textarea bug +
  • +
  • [PHPBB3-9830] - Awkward message when config.php is missing +
  • +
  • [PHPBB3-9850] - Allow version checker to display information on multiple releases +
  • +
  • [PHPBB3-9853] - Change default reCAPTCHA theme in Prosilver & Subsilver2 to better coordinate with style color scheme +
  • +
  • [PHPBB3-9880] - Rename all mentions of CAPTCHA or visual confirmation to anti-bot +
  • +
  • [PHPBB3-9899] - Change the style in the ACP for the recaptcha to match that displayed on prosilver +
  • +
+ +

New Feature +

+
    +
  • [PHPBB3-9039] - Native SQL Server Support mssqlnative.php +
  • +
  • [PHPBB3-9511] - View note for moderators on unapproved posts/topics with unapproved posts in ATOM Feed. +
  • +
+ +

Task +

+
    +
  • [PHPBB3-9520] - Add web.config files for IIS +
  • +
  • [PHPBB3-9625] - Update database UNIT-test +
  • +
  • [PHPBB3-9701] - Enable notices in unit tests +
  • +
  • [PHPBB3-9768] - Create git commit-msg hook that verifies the commit message conforms to our standards +
  • +
  • [PHPBB3-9769] - Add install and uninstall scripts for the git hooks +
  • +
  • [PHPBB3-9770] - Git commit message should be prefilled with branch and ticket information +
  • +
  • [PHPBB3-9800] - Update tracker URL in docs/README.html +
  • +
  • [PHPBB3-9804] - Update docs/AUTHORS (DavidMJ & igorw) +
  • +
  • [PHPBB3-9808] - Git commit message hook depends on GNU wc +
  • +
  • [PHPBB3-9816] - Remove config.php from git repository +
  • +
  • [PHPBB3-9848] - Add phpBB data files to .gitignore. +
  • +
  • [PHPBB3-9849] - Create build script using phing +
  • +
  • [PHPBB3-9857] - Remove visible $Id$ from docs files. +
  • +
  • [PHPBB3-9868] - Make the test suite run and pass using the mssqlnative driver +
  • +
  • [PHPBB3-9904] - Update WebPI Parameters.xml +
  • +
+ +

Sub-task +

+
    +
  • [PHPBB3-9517] - Remote avatar upload does not check the filesize before and during transfer. +
  • +
  • [PHPBB3-9562] - Advanced Search is inaccessible using the mssqlnative DBAL +
  • +
  • [PHPBB3-9564] - Reported messages are not assigned the default report reason when a reason is removed from the ACP using the mssqlnative DBAL +
  • +
  • [PHPBB3-9565] - It is impossible to create a custom profile field using the mssqlnative DBAL +
  • +
  • [PHPBB3-9566] - Two debug notices are displayed when setting a custom profile field though the UCP using the mssqlnative DBAL +
  • +
  • [PHPBB3-9583] - MSSQL native backups cannot be restored +
  • +
  • [PHPBB3-9606] - Drop redundant SQL query for unreads fetching +
  • +
  • [PHPBB3-9613] - Implement a load switch for unreads search feature. +
  • +
  • [PHPBB3-9817] - Make build script create blank config.php +
  • +
+ +

Changes since 3.0.7

+ +
    +
  • [Sec] Do not expose forum content of forums with ACL entries but no actual permission in ATOM Feeds. (Bug #58595)
  • +
+ +

Changes since 3.0.6

+ +
    +
  • [Fix] Allow ban reason and length to be selected and copied in ACP and subsilver2 MCP. (Bug #51095)
  • +
  • [Fix] Force full date for board online record date.
  • +
  • [Fix] Correctly reset login keys if passed value is the current user. (Bug #54125)
  • +
  • [Fix] Correctly set last modified headers. (Bug #54245, thanks Paul.J.Murphy)
  • +
  • [Fix] Show correct HTML title when reporting private messages. (Bug #54375)
  • +
  • [Fix] Correctly exclude subforums from ATOM Feeds. (Bug #54285)
  • +
  • [Fix] Do not link to user profile in ATOM feed entry if post has been made by the guest user. (Bug #54275)
  • +
  • [Fix] Make word censoring case insensitive. (Bug #54265)
  • +
  • [Fix] Fulltext-MySQL search for keywords and username at the same time. (Bug #54325)
  • +
  • [Fix] Various XHTML and CSS mistakes in prosilver and subsilver2. (Bugs #54705, #55895, #57505, #57875 - Patch by HardStyle)
  • +
  • [Fix] Correctly show topic ATOM feed link when only post id is specified. (Bug #53025)
  • +
  • [Fix] Cleanly handle forum/topic not found in ATOM Feeds. (Bug #54295)
  • +
  • [Fix] PHP 5.3 compatibility: Check if function dl() exists before calling it. (Bug #54665)
  • +
  • [Fix] PHP 5.3 compatibility: Disable E_DEPRECATED on startup to keep set_magic_quotes_runtime(0) quiet. (Bug #54495)
  • +
  • [Fix] Correctly replace table prefix before inserting schema data into the database. (Bug #54815)
  • +
  • [Fix] Correctly take post time instead of topic time for the overall forum feed statistics row. (Bug #55005)
  • +
  • [Fix] Posting errors with CAPTCHAs using user::add_lang(). (Bug #55245)
  • +
  • [Fix] Use memcache::replace() instead of memcache::set() for existing keys to prevent problems.
  • +
  • [Fix] Check for required functions in eAccelerator. (Bug #54465)
  • +
  • [Fix] Use correct RFC 3339 date format in ATOM feed. (Bug #55005)
  • +
  • [Fix] Do not deliver topics from unreadable or passworded forums in the news feed. (Bug #54345)
  • +
  • [Fix] Restore user language choice to compiled stylesheets. (Bug #54035)
  • +
  • [Fix] Add missing language entries. (Bug #55095)
  • +
  • [Fix] Do not permit unauthorised users to delete private messages from folder listing. (Bug #54355)
  • +
  • [Fix] Correctly check for empty strings in custom profile fields. (Bug #55335)
  • +
  • [Fix] Use correct options to parse BBCodes in signatures when previewing PMs.
  • +
  • [Fix] Correct rendering of prosilver quick reply under IE6. (Bug #54115 - Patch by Raimon)
  • +
  • [Fix] Correct wording for "How do I show an image below my username" question answer in FAQ. (Bug #23935)
  • +
  • [Fix] Handle export of private messages where all recipients were deleted. (Bug #50985)
  • +
  • [Fix] Correctly get unread status information for global announcements in search results.
  • +
  • [Fix] Correctly handle global announcements in ATOM feeds.
  • +
  • [Fix] Use correct limit config parameter in the News feed.
  • +
  • [Fix] Restrict search for styles/../style.cfg to folders. (Bug #55665)
  • +
  • [Fix] Add ability to disable overall (aka board-wide) feed.
  • +
  • [Fix] Do not pass new_link parameter when creating a persistent connection with mysql. (Bug #55785)
  • +
  • [Fix] Improved search query performance through sorting words by their occurance. (Bug #21555)
  • +
  • [Fix] Correctly move sql_row_pointer forward when calling sql_fetchfield() on cached queries. (Bug #55865)
  • +
  • [Fix] Remove item limit from "All forums" feed.
  • +
  • [Fix] Do not use group colours for usernames on print view. (Bug #30315 - Patch by Pasqualle)
  • +
  • [Fix] Pagination of User Notes in MCP uses two different config values. (Bug #56025)
  • +
  • [Fix] List hidden groups on viewprofile where the viewing user is also a member. (Bug #31845)
  • +
  • [Fix] Sort viewprofile group list by group name.
  • +
  • [Fix] Strictly check whether a moderator can post in the destination forum when moving topic. (Bug #56255)
  • +
  • [Fix] Added some error handling to the compress class.
  • +
  • [Fix] Correctly determine permissions to show quick reply button. (Bug #56555)
  • +
  • [Fix] Do not unsubscribe users from topics replying with quickreply. (Bug #56235)
  • +
  • [Fix] Don't submit when pressing enter on preview button. (Bug #54395)
  • +
  • [Fix] Load reCAPTCHA over https when using a secure connection to the board. (Bug #55755)
  • +
  • [Fix] Clarify explanation of bump feature setting. (Bug #56075)
  • +
  • [Fix] Properly paginate unapproved posts in the MCP. (Bug #56285)
  • +
  • [Fix] Do not duplicate previous/next links in pagination text of moderator logs and user notes in MCP for subsilver2. (Bug #55045)
  • +
  • [Fix] Do not automatically unsubscribe users from topics, when email and jabber is disabled.
  • +
  • [Fix] Don't send activation email when user tries to change email without permission. (Bug #56335 - Fix by nrohler)
  • +
  • [Fix] Replace hard coded "px" with translated language-string. (Bug #52495)
  • +
  • [Fix] Correctly hover list menu in UCP and MCP for RTL languages. (Bug #49945)
  • +
  • [Fix] Correctly orientate quoted text image on RTL languages. (Bug #33745)
  • +
  • [Fix] Deprecate $allow_reply parameter to truncate_string() (Bug #56675)
  • +
  • [Fix] Fall back to default language email template if specified file does not exist. (Bug #35595)
  • +
  • [Fix] Update users last visit field correctly when changing activation status. (Bug #56185)
  • +
  • [Fix] Database updater now separates ADD COLUMN from SET NOT NULL and SET DEFAULT, when using PostgreSQL <= 7.4 (Bug #54435)
  • +
  • [Fix] Styles adjustment to correctly display an order of rtl/ltr mixed content. (Bugs #55485, #55545)
  • +
  • [Fix] Fix language string for PM-Reports refering to post-data. (Bug #54745)
  • +
  • [Fix] Do not store email templates in database. (Bug #54505)
  • +
  • [Fix] Fix javascript bug in the smilies ACP. (Bug #55725)
  • +
  • [Fix] Unify BBCode Selection across browsers. (Bug #38765)
  • +
  • [Fix] Allow convertors to read in configuration from files. (Bug #57265 - Patch by Dicky)
  • +
  • [Fix] Fix problems with firebird by no longer using 'count' as a column alias. (Bug #57455)
  • +
  • [Fix] Small language correction for the FAQ page. (Bug #57825)
  • +
  • [Fix] Restrict search for language/../iso.txt to folders. (Bug #57795)
  • +
  • [Fix] Make user_email_hash() function independent from system's architecture. (Bug #57755)
  • +
  • [Fix] Correct behavior of "force_approved_state" when value is false. (Bug #57715)
  • +
  • [Fix] Global announcements could not be accessed on a board using Firebird as the database server. (Bug #57525)
  • +
  • [Fix] BBCode parser now uses the user object for all settings rather than taking some from the template object (Bug #57365)
  • +
  • [Fix] Ensure a database connection is available before logging general errors. (Bug #57975)
  • +
  • [Fix] Do not delete unrelated attachments when deleting empty forums. (Bug #57375)
  • +
  • [Fix] Update: Store expected resulting file contents in cache and do not suggest further merges if the contents match, also fixes infinite merge loop (Bug #54075)
  • +
  • [Change] Move redirect into a hidden field to avoid issues with mod_security. (Bug #54145)
  • +
  • [Change] Log activation through inactive users ACP. (Bug #30145)
  • +
  • [Change] Send time of last item instead of current time in ATOM Feeds. (Bug #53305)
  • +
  • [Change] Use em dash instead of hyphen/minus as separator in ATOM Feeds item statistics. (Bug #53565)
  • +
  • [Change] Alter ACP user quick tools interface to reduce confusion with the delete operation.
  • +
  • [Change] Send statistics now check for IPv6 and send private network status as a boolean.
  • +
  • [Change] Split "All topics" feed into "New Topics" and "Active Topics" feeds.
  • +
  • [Change] Forum feed no longer includes posts of subforums.
  • +
  • [Change] Show login attempt CAPTCHA option in the captcha plugin module.
  • +
  • [Change] It is no longer possible to persist a solution for the login CAPTCHA.
  • +
  • [Change] SQLite is no longer autoloaded by the installer. (Bug #56105)
  • +
  • [Change] Friends and foes will not show up as private message rule options if their respective UCP modules are disabled. (Bug #51155)
  • +
  • [Change] Offer for guests to log in for egosearch and unreadposts search before the search permissions check. (Bug #51585)
  • +
  • [Change] Show warning box for users of PHP < 5.2.0 about phpBB ending support.
  • +
  • [Change] Disallow deleting the last question of the Q&A CAPTCHA.
  • +
  • [Change] Tweak Q&A CAPTCHA garbage collection.
  • +
  • [Change] Show a proper preview for the Q&A CAPTCHA. (Bug #56365)
  • +
  • [Change] Speed up topic move operation by adding an index for topic_id on the topics track table. (Bug #56545)
  • +
  • [Change] Warn users about potentially dangerous BBcodes.
  • +
  • [Feature] Ability to use HTTP authentication in ATOM feeds by passing the GET parameter "auth=http".
  • +
  • [Feature] Add INTTEXT token type to custom bbcodes to allow non-ASCII letters in html attributes.
  • +
  • [Feature] Add ability to enable quick reply in all forums.
  • + +
+ +

Changes since 3.0.5

+ +
    +
  • [Fix] Allow whitespaces in avatar gallery names. (Bug #44955)
  • +
  • [Fix] Sorting by author or subject on viewtopic now preserves the order. (Bug #44875)
  • +
  • [Fix] Correctly determine writable status of files on Windows operating systems. (Bug #39035)
  • +
  • [Fix] Show report button in prosilver for guests who are allowed to report posts. (Bug #45695)
  • +
  • [Fix] Correctly show private message history. (Bug #46065)
  • +
  • [Fix] Various XHTML mistakes in prosilver, subsilver2 and the ACP. (Bugs #25545, #26315, #38555, #45505 - Patch by Raimon, #45785, #45865, #47085 - Patch by Raimon)
  • +
  • [Fix] Fix some ACP style issues. (Bug #16109 - Patch by prototech)
  • +
  • [Fix] Move post bump information markup to the template. (Bug #34295)
  • +
  • [Fix] Show error in the ACP when template folder is not readable. (Bug #45705)
  • +
  • [Fix] Adjust viewonline filename regular expression to be less strict. (Bug #46215)
  • +
  • [Fix] Correctly apply the "can change vote" permission again. Regression introduced in r9470. (Bug #45895)
  • +
  • [Fix] Remove data from friend/foe table when deleting user. (Bug #45345)
  • +
  • [Fix] Correctly hide skiplink in prosilver right-to-left mode. (Bug #45765 - Patch by prototech and bantu)
  • +
  • [Fix] Fix dynamic config update routine error if firebird is used. (Bug #46315)
  • +
  • [Fix] Allow friends/foes to be added and removed at the same time. (Bug #46255)
  • +
  • [Fix] Only change topic/post icon on edit if icons are enabled and user is allowed to use icons. (Bug #46355)
  • +
  • [Fix] Fix saving custom profile fields in ACP if Oracle is used. (Bug #46015)
  • +
  • [Fix] Make view_log() more resilient to corrupt serialized data. (Bug #46545)
  • +
  • [Fix] Show error if hostname lookup doesn't return a valid IP address when banning. (Bug #45585)
  • +
  • [Fix] Fix incorrect layout when loading private message draft. (Bug #38435 - Patch by nickvergessen)
  • +
  • [Fix] Show proper error message when trying to add bots to friends/foes list. (Bug #40205)
  • +
  • [Fix] Fixed database backup and restore with Oracle DBMS. (Bug #46715)
  • +
  • [Fix] Update attachments table when deleting user and retaining his posts. (Bug #40245)
  • +
  • [Fix] Correctly detect files in subfolders when viewing cached template files. (Bug #46145)
  • +
  • [Fix] Display user's jabber address in popup if jabber functionality is disabled. (Bug #20775)
  • +
  • [Fix] Correctly exclude forums from active topics list. (Bug #19135)
  • +
  • [Fix] Do not display banned users in birthday list. (Bug #20625)
  • +
  • [Fix] Fix function to recalculate nested sets. (Bug #41555 - Patch by EXreaction)
  • +
  • [Fix] Display but also highlight already used rank images while assigning new ranks. (Bug #22665)
  • +
  • [Fix] Correctly orientate quoted text image on RTL languages. (Bug #33745)
  • +
  • [Fix] Do not display "View user notes" and "Warn user" links in user profile if corresponding MCP modules are disabled. (Bug #10519)
  • +
  • [Fix] Show proper error message when trying to create a private messages folder with an empty name. (Bug #39875)
  • +
  • [Fix] No longer state that it is possible to manage group leaders from the UCP. (Bug #19945)
  • +
  • [Fix] Do not throw an error when PDO is a shared module and not loaded preventing SQLite from being loaded.
  • +
  • [Fix] Fix censoring of unicode words. (Bug #16555)
  • +
  • [Fix] Display coloured usernames in ACP groups management screens.
  • +
  • [Fix] Correctly describe founder permissions on trace-information. (Bug #37235)
  • +
  • [Fix] Correct the width value for poll_center.gif omitted in imageset.cfg for subsilver2. (Bug #43005)
  • +
  • [Fix] Correctly load complex language variable using acp_language. (Bug #45735 - Patch by leviatan21)
  • +
  • [Fix] Fix reapply_sid() to correctly strip session id in certain circumstances. (Bug #43125 - Patch by leviatan21)
  • +
  • [Fix] Correctly state why one language pack is marked with an asterisk in the ACP. (Bug #37565)
  • +
  • [Fix] Correctly check if install directory is still present. (Bug #46965)
  • +
  • [Fix] Correct banned user behaviour when "force password change" is enabled. (Bug #47145 - Patch by nickvergessen and leviatan21)
  • +
  • [Fix] Correctly display ACP logs options, without permission to clear logs. (Bug #24155 - Patch by leviatan21)
  • +
  • [Fix] Display topic icons in MCP forum view again (only prosilver).
  • +
  • [Fix] Properly display post status messages in topic when post is reported and unapproved (Bug #44455 - Patch by leviatan21)
  • +
  • [Fix] Do not remove recipients when loading private message draft. (Bug #38395)
  • +
  • [Fix] Add author name to moderator log when deleting post/topic. (Bug #46225)
  • +
  • [Fix] Fix broken "Report details" link in the MCP. (Bug #46975)
  • +
  • [Fix] Resolve accesskey conflicts in prosilver. (Bug #44685)
  • +
  • [Fix] Check if template file is empty before trying to read from it. (Bug #47345)
  • +
  • [Fix] More descriptive descriptions for permissions to use BBCode, smilies, images and flash. (Bug #36065)
  • +
  • [Fix] Fix style issues in print mode. (Bug #26375 - Patch by leviatan21)
  • +
  • [Fix] Fix minor issue with L_QUOTE language string missing in several PM composing modes. (Bug #39625)
  • +
  • [Fix] Also fetch posts of guests and deleted or deactivated users while searching for author names. (Bug #36565, #47765)
  • +
  • [Fix] Show end of ban in MCP and ACP when user is banned by duration. (Bug #47815 - Patch by Pyramide)
  • +
  • [Fix] Correctly count posts awaiting approval in the MCP. (Bug #47685)
  • +
  • [Fix] Display user's posts count in private message when it is equal to 0 (prosilver). (Bug #40155)
  • +
  • [Fix] Only allow users to disable word censor if globally allowed. (Bug #47575 - Patch by 00mohgta7)
  • +
  • [Fix] Fix database updater and db tools to support multiple column changes/additions/removals with SQLite.
  • +
  • [Fix] Correctly detect GZIP status in debug mode. (Bug #24075)
  • +
  • [Fix] Posting smilies in view more smilies screen now works again in IE. (Bug #46025 - Patch by leviatan21)
  • +
  • [Fix] Properly convert and show filesize information. (Bug #47775)
  • +
  • [Fix] Add ability to prune users who never logged in. (Bug #44295)
  • +
  • [Fix] Show smilies and images in topic print view. (Bug #47265)
  • +
  • [Fix] Force full date in private message print view.
  • +
  • [Fix] Fix "Always show a scrollbar for short pages" for IE8 and Firefox 3.5. (Bug #47865 - Patch by stokerpiller)
  • +
  • [Fix] Do not allow setting group as default group for pending users. (Bug #45675)
  • +
  • [Fix] Fail gracefully if store folder is not writable during update. (Bugs #46615, #46945)
  • +
  • [Fix] Hide profile-icon from viewtopic page if user has no permissions (subsilver2 only). (Bug #37635 - Patch by leviatan21)
  • +
  • [Fix] Correct escaping/unescaping in the LDAP authentication plugin. (Bug #48175)
  • +
  • [Fix] Add hard limit for smilies.
  • +
  • [Fix] Remove redundant SQL query from ucp.php. (Bug #40305)
  • +
  • [Fix] Reorder frame order of animated subsilver2 topic icons to be useful when animations are disabled. (Bug #29385 - Patch by prototech)
  • +
  • [Fix] Ensure user errors are displayed regardless of PHP settings. (Bug #47505)
  • +
  • [Fix] Permit null values for non-required integer custom profile fields and ensure zero complies with the range limits. (Bug #40925)
  • +
  • [Fix] Allow changing forum from select box under certain circumstances. (Bug #37525)
  • +
  • [Fix] Display required fields notice on registration above the custom profile fields. (Bug #39665)
  • +
  • [Fix] Copy poll options properly when copying topic. (Bug #39065)
  • +
  • [Fix] Fix error with disapproval of topics having several queued posts only. (Bug #47705)
  • +
  • [Fix] Preserve newlines in template files (one newline had been always dropped after a template variable due to PHP's handling of closing tags).
  • +
  • [Fix] Be less strict with FTP daemons for getting directory filelists. (Bug #46295)
  • +
  • [Fix] Fix set_custom_template for database-stored styles. (Bug #40515)
  • +
  • [Fix] Banning an already banned user states to be successful, but has no effect. (Bug #47825 - Patch by Pyramide)
  • +
  • [Fix] Do not add style parameter again to URL after admin re-authentification. (Bug #18005 - Patch by leviatan21)
  • +
  • [Fix] Do not cut post-message in between HTML-Entities on search.php. (Bug #31505 - Patch by leviatan21)
  • +
  • [Fix] Correctly set attachment flag for topics, posts and pms after deleting attachments. (Bug #48265 - Patch by MarcoDM and nickvergessen)
  • +
  • [Fix] Display "Locked" button instead of "Reply" one for locked forum in viewtopic (prosilver). (Bug #38055 - Patch by Raimon)
  • +
  • [Fix] Correctly propagate umlauts over search result pages. (Bug #33755)
  • +
  • [Fix] Preserve post options when refusing to save the post as a draft. (Bug #39115)
  • +
  • [Fix] Do not send private message back to sender if sender is in the same group the private message was sent to.
  • +
  • [Fix] Correctly add user to a group making it a default one. (Bug #48345)
  • +
  • [Fix] Add log entry when copying forum permissions.
  • +
  • [Fix] Min/max characters per posts no longer affects poll options. (Bug #47295)
  • +
  • [Fix] Correctly log action when users request to join a group. (Bug #37585)
  • +
  • [Fix] Do not try to create thumbnails for images we cannot open properly. (Bug #48695)
  • +
  • [Fix] Apply locale-independent basename() to attachment filenames. New function added: utf8_basename(). (Bug #43335 - Patch by ocean=Yohsuke)
  • +
  • [Fix] Adjust build_url() to not prepend $phpbb_root_path if path returned from redirect() is an URL. This fixes redirect issues with some installations and bridges. (Bug #47535)
  • +
  • [Fix] Do not mark global announcements as read if all topics in a forum become read (Bug #15729).
  • +
  • [Fix] Fix general error in registration, caused by an undefined $config variable in validate_referer(). (Bug #49035 - Patch by wjvriend)
  • +
  • [Fix] Correctly extract column default value when exporting PostgreSQL tables. (Bug #48955)
  • +
  • [Fix] Allow updater to work correctly with PHP filename extensions other than ".php". (Bugs #15809, #49215)
  • +
  • [Fix] Update search index if only post subject changed. (Bug #49435)
  • +
  • [Fix] Fix who is online displaying incorrect data. (Bug #49485, thanks Brainy)
  • +
  • [Fix] Fixed incorrect "topic does not exist" if unapproved posts were visited without global moderator permissions. (Bug #47795)
  • +
  • [Fix] Prevent style switcher from blocking the tab key. (Bug #49335)
  • +
  • [Fix] Correctly redirect back to MCP main page after posts approval/disapproval from it. (Bug #49625)
  • +
  • [Fix] Do not display topic approval status image for shadow topic if a user is not a moderator in the forum the topic has been moved to. (Bug #43295)
  • +
  • [Fix] Fix email problems on servers with PHP installations not accepting RFC-compliant subject string passed to the mail()-function. (Bug #46725)
  • +
  • [Fix] Correctly orientate control panel navigation background-image on RTL languages. (Bug #49945)
  • +
  • [Fix] Sort private messages by message time and not message id. (Bug #50015)
  • +
  • [Fix] Make sure only logs for existing users are displayed and user-specific logs removed on user deletion. (Bug #49855)
  • +
  • [Fix] Only show "Add friend" and "Add foe" links if the specific module is enabled. (Bug #50475)
  • +
  • [Fix] Correctly display list items in forum description in prosilver and administration. (Bug #48055 - Patch by leviatan21)
  • +
  • [Fix] Only embed cron.php if there is no cron lock present to reduce overhead. (Bug #45725 - Patch by TerryE)
  • +
  • [Fix] Add header gradient back into subsilver2 but keep site logo easily replaceable with smaller and bigger ones. (Bug #11142 - Patch by dark/Rain and Raimon)
  • +
  • [Fix] Send activation email when activating user from user settings. (Bug #43145)
  • +
  • [Fix] Do not show resend activation email link when using admin activation. (Bug #44375 - Patch by bbrunnrman)
  • +
  • [Fix] Do not display links to user/post search if search is disabled. (Bug #50685 - Patch by HardStyle)
  • +
  • [Fix] Fix icon alignment for forums with large descriptions in subsilver2. (Bug #50445)
  • +
  • [Fix] Correctly display underlined links placed in last line in viewtopic. (Bug #14811 - Patch by primehalo)
  • +
  • [Fix] Only check whether forum image exists if forum image is specified. (Bug #51905)
  • +
  • [Fix] Fixed database updater for changes to columns having default value in MSSQL (adding/dropping constraints).
  • +
  • [Fix] Jabber SASL PLAIN authentication failures. (Bug #52995)
  • +
  • [Fix] Check sort options on memberlist to avoid a general error. (Bug #53655)
  • +
  • [Fix] Fix sql error in cache_moderators() if using postgresql. (Bug #53765)
  • +
  • [Change] Database updater now supports checking for existing/missing indexes.
  • +
  • [Change] submit_post() now accepts force_approved_state key passed to $data to indicate new posts being approved (true) or unapproved (false).
  • +
  • [Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.
  • +
  • [Change] Template engine now permits variable includes to a limited extent.
  • +
  • [Change] Quote BBCode no longer requires the f_reply permission. (Bug #16079)
  • +
  • [Change] Banning/unbanning users now generates an entry in their user notes. (Bug #21825)
  • +
  • [Change] Smilies no longer require the f_bbcode permission. (Bug #26545)
  • +
  • [Change] Ability to define column split in FAQ/BBCode help. (Bug #31405)
  • +
  • [Change] Changed behaviour of group_create() function to support specifying additional group columns.
  • +
  • [Change] Hide avatar when avatar-type is not allowed. (Bug #46785 - Patch by cYbercOsmOnauT and nickvergessen)
  • +
  • [Change] INCLUDEPHP paths are now relative to $phpbb_root_path. (Bug #45805)
  • +
  • [Change] Ability to fetch moderators with get_moderators() even if load_moderators setting is off. (Bug #35955)
  • +
  • [Change] "Post details" links with image in MCP. (Bug #39845 - Patch by leviatan21)
  • +
  • [Change] PM history now only shows PMs of users you currently reply to. (Bug #39505)
  • +
  • [Change] Show quote button for own PMs in PM history. (Bug #37285)
  • +
  • [Change] Fetch requested cookie variables directly from cookie super global. (Bug #47785)
  • +
  • [Change] Add confirmation for deactivating styles. (Bug #14304 - Patch by leviatan21)
  • +
  • [Change] Add confirmation for deactivating language packs. (Patch by leviatan21)
  • +
  • [Change] Add confirmation for deleting permissions. (Bug #13673)
  • +
  • [Change] Add pagination for icons and smilies in the ACP and smilies in the smiley popup.
  • +
  • [Change] Cache get_username_string() function calls on viewtopic.
  • +
  • [Change] Cache version check.
  • +
  • [Change] When creating a new forum without copying permissions, ask again.
  • +
  • [Change] Introduce new parameter to page_header() for forum specific who is online listings.
  • +
  • [Change] Changed minimum requirement for Firebird DBMS from 2.0+ to 2.1+.
  • +
  • [Change] Unapproved topics can no longer be replied to. (Bug #44005, #47675, #23605)
  • +
  • [Change] Require user to be registered and logged in to search for unread posts if topic read tracking is disabled for guests. (Bug #49525)
  • +
  • [Change] Allow three-digit hex notation in color BBcode. (Bug #39965 - Patch by m0rpha)
  • +
  • [Change] Simplified login_box() and redirection after login. S_LOGIN_ACTION can now be used on every page. (Bug #50285)
  • +
  • [Change] Do not take edit post time into account for determining permission to delete last post in topic. (Bug #48615)
  • +
  • [Change] Resize oversized topic icons. (Bug #44415)
  • +
  • [Change] Banned IPs are now sorted. (Bug #43045 - Patch by DavidIQ)
  • +
  • [Change] phpBB updater now skips sole whitespace/tab changes while computing differences. This reduces the chance of conflicts tremendously.
  • +
  • [Change] phpBB updater now solves common conflicts on its own. This further reduces the chance of conflicts.
  • +
  • [Feature] Add language selection to the registration terms page. (Bug #15085 - Patch by leviatan21)
  • +
  • [Feature] Backported 3.2 captcha plugins: +
      +
    • Classic and GD CAPTCHA
    • +
    • reCaptcha (based on API from recaptcha.net by Mike Crawford and Ben Maurer)
    • +
    • Q&A CAPTCHA
    • +
    • 3D Wave (by Robert "Xore" Hetzler)
    • +
    +
  • +
  • [Feature] Introduced new ACM (Cache) plugins: + +
  • +
  • [Feature] ATOM Feeds (Idea from RSS Feed 2.0 MOD (Version 1.0.8/9) by leviatan21)
  • +
  • [Feature] New groups option to excempt group leaders from group permissions.
  • +
  • [Feature] New "Newly Registered Users" group for assigning permissions to newly registered users. They will be removed from this group once they reach a defineable amount of posts.
  • +
  • [Feature] Ability to define if the "Newly Registered Users" group will be assigned as the default group to newly registered users.
  • +
  • [Feature] Add new option to disable avatars board-wide. (Bug #46785 - Patch by cYbercOsmOnauT and nickvergessen)
  • +
  • [Feature] Enhance obtain_users_online_string to be able to return user-lists for other session items. (Bug #31975)
  • +
  • [Feature] Add unapproved topic icon for moderators on forum list. (Bug #46865)
  • +
  • [Feature] Ability to define minimum number of characters for posts/pms.
  • +
  • [Feature] Store signature configuration options in database. (Bug #45115)
  • +
  • [Feature] Add bare-bones quick-reply editor to viewtopic.
  • +
  • [Feature] Detect if a post has been altered by someone else while editing.
  • +
  • [Feature] Add unread posts quick search option. (Bug #46765)
  • +
  • [Feature] Add option to disable avatar uploads from remote locations. (Bug #45375)
  • +
  • [Feature] Ability to delete warnings and keep warnings permanently. (Bug #43375)
  • +
  • [Feature] Ability to empty a user's outbox from the user ACP quick tools.
  • +
  • [Feature] Ability to search ACP/MCP logs.
  • +
  • [Feature] Users can report PMs to moderators which are then visible in a new MCP module.
  • +
  • [Feature] Parse email text files with the template engine.
  • +
  • [Feature] Use email-style quoting when bbcodes are disabled.
  • +
  • [Feature] Added new functionality to inactive users module: +
      +
    • Ability to set users per page.
    • +
    • Ability to sort by posts/number of reminders/last reminded date.
    • +
    • Show number of posts and ability to search posts.
    • +
    • Show number of reminders sent to user.
    • +
    • Show date of last reminder sent to user.
    • +
    +
  • +
  • [Feature] Display version check on ACP main page.
  • +
  • [Feature] Ability to copy permissions from one forum to several other forums.
  • +
  • [Feature] Ability to control the display of custom profile fields on viewtopic. (Bug #48985)
  • +
  • [Feature] Fallback options for missing language files. (Bug #38575 - Patch by EXreaction)
  • +
  • [Feature] Separate "PM Reply" and "PM Reply to all" in prosilver.
  • +
  • [Feature] Place debug notices during captcha rendering in the error log - useful for debugging output already started errors.
  • +
  • [Feature] Ability to define constant PHPBB_USE_BOARD_URL_PATH to use board url for images/avatars/ranks/imageset (useful for bridges and applications using phpBB).
  • +
  • [Feature] Added function to generate email hash. (Bug #49195)
  • +
  • [Feature] Style authors are now able to define the default submit button used for form submission on ENTER keypress on forms using more than one submit button. Prosilver uses this for the posting page(s) and registration screen.
  • +
  • [Feature] Ability to specify amount of time user is able to delete his last post in topic.
  • +
  • [Feature] Send anonymous statistical information to phpBB on installation and update (optional).
  • +
+ +

Changes since 3.0.4

+ +
    +
  • [Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)
  • +
  • [Fix] Posts incremented for multiple approval of the same topic (Bug #40495 - Patch by TerraFrost)
  • +
  • [Fix] Missing end " in quote bb tag deletes text (Bug #40565 - Patch by TerraFrost)
  • +
  • [Fix] Friend/foe system displays posts made by foes while composing (Bug #40325 - Patch by TerraFrost and Highway of Life)
  • +
  • [Fix] Check forum_image whether it exists (Bug #39005 - Patch by TerraFrost)
  • +
  • [Fix] The sql query in acp_users.php lacks a condition (Bug #40275 - Patch by grimskies)
  • +
  • [Fix] Added missing read permission information for some phpbb_chmod() calls
  • +
  • [Fix] Correctly display future dates (Bug #38755)
  • +
  • [Fix] Fix guest/bot session problems with apache authentication plugin (Bug #41085)
  • +
  • [Fix] Whois now works reliably for RIRs other than APNIC and RIPE. (Bug #40085)
  • +
  • [Fix] Correctly convert Niels' Birthday MOD to the date format used in phpBB3. (Bug #32895)
  • +
  • [Fix] Changed the success message when requesting a new password to be more accurate. (Bug #41405)
  • +
  • [Fix] Add missing anti-abuse email headers to acp_inactive.php and ucp_resend.php.
  • +
  • [Fix] Only remind users in the correct inactive states depending on the board account activation level.
  • +
  • [Fix] Various XHTML mistakes in prosilver, subsilver2 and the ACP. (Bugs #41745, #42265 - Patch by nickvergessen, #38465, #43015, #46585 - Patch by Raimon)
  • +
  • [Fix] Log password changes via password reset function. (Bug #41365)
  • +
  • [Fix] Poll, negative durations generate error (Bug #41295 - Patch by TerraFrost)
  • +
  • [Fix] Visibility of custom field on registration is incorrectly controlled by setting "display" (Bug #41385 - Patch by Eelke and fade2gray)
  • +
  • [Fix] Smilies in username are misparsed on [quote=""] (Bug #41955 - Patch by TerraFrost)
  • +
  • [Fix] Deleting all posts in a topic - bad redirect (Bug #41705 - Patch by TerraFrost)
  • +
  • [Fix] Deleted users still appear logged in (Bug #41985 - Patch by TerraFrost)
  • +
  • [Fix] Removed redundant code and unnecessary queries in forum management. (Bug #42265 - Patch by nickvergessen)
  • +
  • [Fix] Correct mbstring regular expression for the allowable username characters, only affects USERNAME_LETTER_NUM_SPACERS. (Bug #42325)
  • +
  • [Fix] Fix infinite loop in message handler if cache directory is not writable. (Bug #38675)
  • +
  • [Fix] While post is awaiting approval it can still be edited even though it can not be seen (Bug #41435 - Patch by TerraFrost)
  • +
  • [Fix] Fix imageset editing for retaining and correctly setting dimensions for images, as well as displaying correct settings for first page load.
  • +
  • [Fix] Use OS-specific line endings for mail headers. (related to Bug #42755)
  • +
  • [Fix] Hide font size options which are bigger than the allowed size in the editor. (Bug #42615 - Patch by nickvergessen)
  • +
  • [Fix] Better thumbnail quality with imagemagick. (Bug #42565)
  • +
  • [Fix] Fix download count increments for image attachments without corresponding thumbnails. (Bug #42505)
  • +
  • [Fix] Fix wrong bot ip check if bot ip was wrongly entered by admin. (Bug #42485)
  • +
  • [Fix] Fix javascript errors in simple header (prosilver) by adding forum_fn.js and the corresponding variables. (Bug #42135)
  • +
  • [Fix] Set connection encoding for MySQL versions 4.1.0 to 4.1.2. This may fix some conversion issues with special characters. (Bug #41805)
  • +
  • [Fix] Deleting private message attachments could delete post attachments. (Bug #42815)
  • +
  • [Fix] Do not suppress PHP notices/errors in language packs if DEBUG_EXTRA mode enabled. (Bug #41485)
  • +
  • [Fix] Flash files do not display anymore after update to flash player 10 (Bug #41315)
  • +
  • [Fix] Use FQDN for SMTP EHLO/HELO command. (Bug #41025)
  • +
  • [Fix] Mass Email works again for users with empty jabber address but notification set to 'both'. (Bug #39755)
  • +
  • [Fix] Fix race condition for updating post/topic/etc. counter. (Reported by BartVB)
  • +
  • [Fix] Fix duplicate creation of acl options in acl_add_options() under certain conditions. (Bug #38385, #40225)
  • +
  • [Fix] Cancel when replying to global announcement redirects to first forum - not to the current forum (Bug #41225 - Patch by TerraFrost)
  • +
  • [Fix] Cursor Jumps on New Topic in IE (Bug #42455 - Patch by TerraFrost)
  • +
  • [Fix] Add indicator to be used in code if session was created (user visits the site for the first time).
  • +
  • [Fix] Correctly count topic views for guests visiting the website the first time by entering the topic directly (Bug #43445)
  • +
  • [Fix] Fix bug in postgresql db layer for LIMIT ALL clauses (Reported by JRSweets)
  • +
  • [Fix] Sort backups by date, newest first (Bug #14818)
  • +
  • [Fix] Prevent incomplete backups stored if option "store and download" is selected and admin cancel download by removing the option. (Bug #20325)
  • +
  • [Fix] Enforce correct case for template variables
  • +
  • [Fix] Set topic_last_view_time on post/reply/edit to circumvent race conditions in auto prune and false removal of topics for manual forum prune (Bug #18055, #43515)
  • +
  • [Fix] Correctly split long subject lines according to the used RFC. This fixes extra spaces within long subjects. (Bug #43715)
  • +
  • [Fix] Fix skipping messages if using next/prev PM in history links. (Bug #22205)
  • +
  • [Fix] Messenger now also able to use a custom language path. (Bug #36545)
  • +
  • [Fix] PM Export uses ISO 8601 date now. (Bug #32645)
  • +
  • [Fix] Apply append_sid() to newest/latest post links in viewforum/search and UCP main module. (Bug #26815)
  • +
  • [Fix] Do not create thumbnail if thumbnail would've the same size as the original image. (Bug #30725)
  • +
  • [Fix] Ability to vote in poll is now required for the ability to change existing vote. (Bug #38925)
  • +
  • [Fix] Search for 'topic title only' and 'first post' should work again for non-mysql dbms. (Bug #40605)
  • +
  • [Fix] Make sure additional information for accessibility is always exposed to screen readers (Bug #44335 - Patch by MarcoZ)
  • +
  • [Fix] Approving a topic when some of the posts within that topic have already been approved (Bug #42585 - Patch by TerraFrost)
  • +
  • [Fix] Online status shown when post hidden (Bug #35505 - Patch by Raimon)
  • +
  • [Fix] memberlist.php display formating can be distorted by posting long URL for website (Bug #36675 - Patch by TerraFrost)
  • +
  • [Fix] Display the online status of hidden users to users with the u_viewonline permission when viewing PMs.
  • +
  • [Fix] "Select all" selects much too much in Opera (Bug #42885 - Patch by TerraFrost and ToonArmy)
  • +
  • [Fix] Correct calculation of source/target forum statistics if mass moving topics with global announcements (Bug #44545)
  • +
  • [Fix] Fix column handling in db updater, custom profile fields an db tools for firebird DBMS (Bug #44555)
  • +
  • [Fix] IE8 textarea issues (Bug #43305)
  • +
  • [Fix] Prevent accounts from being activated by users when admin activation is turned on and the correct activation key is known.
  • +
  • [Fix] Allow the installer to operate under PHP 5.3. (Bug #45255)
  • +
  • [Change] Default difference view is now 'inline' instead of 'side by side'
  • +
  • [Change] Added new option for merging differences to conflicting files in automatic updater
  • +
  • [Change] Add link to user profile in the MCP for user notes and warn user.
  • +
  • [Change] Add IN_PHPBB check to generated cache files. (Reported by bantu)
  • +
  • [Change] Add topic icons to prosilver UCP main and subscribed templates (Bug #42735 - Patch by Raimon)
  • +
  • [Change] Add unique key to ACL options table to prevent duplicate permission options. (Bug #41835)
  • +
  • [Change] Redirect to relevant MCP page of multi-page topic if accessing quickmod tools (Split option for example)
  • +
  • [Change] Performance improvements for native fulltext search (Patch by Paul)
  • +
  • [Change] Changed jumpto() JS function to be more fail-safe. (But #27635 - Patch by peterkclee)
  • +
  • [Feature] Added new options for visual confirmation.
  • +
  • [Feature] Allow download of conflicting file for later reference in automatic updater
  • +
  • [Feature] Allow translation of custom BBCode help messages. (Patch by bantu)
  • +
  • [Feature] db_tools now support create table and drop table.
  • +
  • [Feature] Database updater checks for incompatible db schema (MySQL 3.x/4.x against MySQL 4.1.x/5.x/6.x)
  • +
  • [Feature] New search option: Maximum number of words allowed to search for.
  • +
  • [Sec] Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)
  • +
+ +

Changes since 3.0.3

+ +
    +
  • [Fix] Allow mixed-case template directories to be inherited (Bug #36725)
  • +
  • [Fix] Regression bug from revision #8908 regarding log display in ACP
  • +
  • [Fix] Allow the UCP group management to work for groups with avatars. (Bug #37375)
  • +
  • [Fix] Fix header list build for replying oldest PM in PM history (Bug #37275)
  • +
  • [Fix] Do not display COPPA group in memberlist find member dialog if COPPA disabled (Bug #37175)
  • +
  • [Fix] Do not try to send jabber notifications if no jid entered (Bug #36775)
  • +
  • [Fix] Only display special ranks to guests; no longer display normal ranks for guests (Bug #36735)
  • +
  • [Fix] Properly treat punctuation marks after local urls (Bug #37055)
  • +
  • [Fix] Make searching for members by YIM address work in prosilver
  • +
  • [Fix] Tell users to recreate the search index after changing the common word threshold for fulltext_native (Bug #36345)
  • +
  • [Fix] Adjusted phpbb_chmod() to always set permissions for group bit.
  • +
  • [Fix] Do not increment users post count after post approval if post had been posted in a forum with no post count increasing set (Bug #37865)
  • +
  • [Fix] Extend vertical line for last post column if no posts in forum (Bug #37125)
  • +
  • [Fix] correctly update last topic/forum information if changing guest usernames through editing posts (Bug #38095)
  • +
  • [Fix] fix postcount resync for situations where low and high post ids are higher than step value, resulting in users having 0 posts. (Bug #38195)
  • +
  • [Fix] Use a left join for the topics table on search to avoid trouble with FROM syntax on some databases (Bug #37005)
  • +
  • [Fix] Do not show 'Forward' button if the user cannot send PM's
  • +
  • [Change] Alllow applications to set custom module inclusion path (idea by HoL)
  • +
  • [Change] Handle checking for duplicate usernames in chunks (Bug #17285 - Patch by A_Jelly_Doughnut)
  • +
  • [Change] Better handling and finer control for custom profile fields visibility options. (Patch by Highway of Life)
  • +
  • [Change] Performance increase for format_date() (Bug #37575 - Patch by BartVB)
  • +
  • [Change] Changed prosilver date separator from 'on' to '»'
  • +
  • [Change] Performance increase for get_username_string() (Bug #37545 - Patch by BartVB)
  • +
  • [Change] Slight performance increase for common parameter calls to append_sid() (Bug #37555 - Patch by BartVB)
  • +
  • [Feature] Added 'AGO' setting to relative date strings. For example: posted 14 minutes ago. (Patch by BartVB)
  • +
  • [Sec] Fixed an issue where deactivated accounts could be re-activated without the required privileges. (Reported by Jorick)
  • +
  • [Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)
  • +
+ +

Changes since 3.0.2

+ +
    +
  • [Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048)
  • +
  • [Fix] Delete avatar files (Bug #29985).
  • +
  • [Fix] Preserve selection in the MCP. (Bug #31265).
  • +
  • [Fix] Added VST - Venezuela Standard Time (Bug #30545).
  • +
  • [Fix] Close DB connections in file.php.
  • +
  • [Fix] Correctly return results for nested cached queries (Bug #31445 - Patch by faw).
  • +
  • [Fix] Allow export of PM pages greater one. (#33155)
  • +
  • [Fix] Display coloured username of last poster in list of subscribed forums (prosilver).
  • +
  • [Fix] Added missing UCP language string NO_AUTH_READ_HOLD_MESSAGE.
  • +
  • [Fix] Do not jump back to page 1 when hiding member search in memberlist. (Bug #32515)
  • +
  • [Fix] Correctly limit input of the users location to 100 characters in the UCP and ACP. (Bug #32655)
  • +
  • [Fix] Sync reports when using the move all users posts tool in the ACP. (Bug #31165)
  • +
  • [Fix] Extra slash is included in the redirect url when redirecting to the forum root directory. (Bug #33605)
  • +
  • [Fix] Remove reported flag from shadow topics when closing reports. (Bug #19765)
  • +
  • [Fix] Do not show non indexed forums on the search page if they contain no subforums. (Bug #33125)
  • +
  • [Fix] Stop search bots incrementing topic views. (Bug #32675 - Patch by eviL<3)
  • +
  • [Fix] Use correct link for post author search. (Bug #32595)
  • +
  • [Fix] Do not decrease topics counter when deleting shadow topics. (Bug #26495)
  • +
  • [Fix] Send localised disapproval reasons in the recipients local language. (Bug #31645)
  • +
  • [Fix] Language typos/fixes. (Bugs #27625, #30755, #34185, #32795)
  • +
  • [Fix] Added missing terms parameter to search pagination. (Bug #34085)
  • +
  • [Fix] Wrong table order in query obtaining posts if post id given.
  • +
  • [Fix] Do not display reported topic icon for shadow topics. (Bug #13970)
  • +
  • [Fix] Display popular topic based on posts within topic instead of replies within topic. (Bug #16099)
  • +
  • [Fix] Expand shown ban reason in unban screen to fully show long entries. (Bug #16234)
  • +
  • [Fix] Preserve alpha transparency for created thumbnails. (Bug #16575)
  • +
  • [Fix] Use correct port delimiter for MSSQL connections in windows. (Bug #16615)
  • +
  • [Fix] Do not allow setting forums parent to the forum itself. (Bug #18855)
  • +
  • [Fix] Display assigned rank/avatar for guests. (Bug #19155)
  • +
  • [Fix] Set secure cookie for style switcher if required. (Bug #19625)
  • +
  • [Fix] Fix native full text search on postgresql while using excluding keyword matches. (Bug #19195)
  • +
  • [Fix] Pass S_SEARCH_ACTION through append_sid() in search.php. (Bug #21585)
  • +
  • [Fix] Correctly delete message attachments. (Bug #23755)
  • +
  • [Fix] Correctly handle unread status of subforums (that are not shown on the index) of forums that are shown on the index. (Bug #14589)
  • +
  • [Fix] Stop users from deleting posts after the edit time has passed or they have been locked. (Bug #19115)
  • +
  • [Fix] Split posts target forum requires 'f_post' now instead of 'm_split'. (Bug #31015)
  • +
  • [Fix] Duplicate log messages for deleting a topic ('LOG_TOPIC_DELETED' has been deprecated in favour of 'LOG_DELETE_TOPIC').
  • +
  • [Fix] Use a distinct log message for shadow topic deletions to differentiate between normal topic deletions. (Bug #34635)
  • +
  • [Fix] Fix problems with styles using an underscore within the filename. (Bug #34315)
  • +
  • [Fix] Better return links when deleting topics through the MCP. (Bug #34655)
  • +
  • [Fix] Add quoting support to PM history when composing a reply. (Bug #34285)
  • +
  • [Fix] Use phpBB 3.1.x method for storing cached data to prevent PHP bug with our usage of var_export(). (Thanks to Techie-Micheal and HoL for pointing out possible problems)
  • +
  • [Fix] Check users pm preferences for pm's sent to groups. (Bug #33245)
  • +
  • [Fix] Do not allow password reminders if u_passchg permission is not given. (Bug #14806)
  • +
  • [Fix] Implemented strict check for cached user permissions and existing ACL options. This fix makes sure cached permissions are valid, even if they got already cached.
  • +
  • [Fix] Do not show link to user/group profiles if user has no permission to view the linked page and gets a denied message anyway. (Bug #15088)
  • +
  • [Fix] Do not display last post link and sort display options for search engines. (Bug #15088)
  • +
  • [Fix] Make sure users still get notifications if they set to only be notified by Jabber, but Jabber service disabled. (Bug #29715 - Patch by Paul)
  • +
  • [Fix] Don't show forum subscription link on categories. (Bug #34895)
  • +
  • [Fix] Display a message if no topics or forums are selected when unsubscribing. (Bug #34855)
  • +
  • [Fix] Mark/unmark all links in UCP now select/unselect both subscribed topics and forums.
  • +
  • [Fix] Increase board topic counter when splitting topics. (Bug #32125)
  • +
  • [Fix] Display profile icons when viewing a topic, or PM when only the jabber icon is to be visible. (Bug #34755)
  • +
  • [Fix] Do not send PMs with warnings if the user cannot read PMs or they are disabled. (Bug #30815)
  • +
  • [Fix] Correctly convert Niels' Birthday MOD to the date format used in phpBB3. (Bug #32895)
  • +
  • [Fix] Parse BBCode lists of type square, circle and disc. (Bug #35295)
  • +
  • [Fix] Round the displayed percentages in polls. (Bug #32375)
  • +
  • [Fix] Disable mass e-mail when e-mail is disabled. (Bug #27385)
  • +
  • [Fix] Display coloured poster username of queued posts displayed on the front of the MCP.
  • +
  • [Fix] Moderators can only see reports/queue/logs from forums they can actually read. (Bug #31085)
  • +
  • [Fix] Correctly display topic when start parameter is equal to the number of posts.
  • +
  • [Fix] Correctly display topic in MCP when start parameter is equal to or greater than the number of posts. (Bug #30525)
  • + +
  • [Change] No longer allow the direct use of MULTI_INSERT in sql_build_array. sql_multi_insert() must be used.
  • +
  • [Change] Display warning in ACP if config.php file is left writable.
  • +
  • [Change] More restrictive chmod to new files being created. (phpbb_chmod() function mostly by faw)
  • +
  • [Change] Set headers to allow browsers to better cache attachments (Mylek pointed this out)
  • +
  • [Change] Hide parameters if they equal the default in viewforum/viewtopic (Bug #31185)
  • +
  • [Change] Various improvements to group listings (Bugs #32155, #32145, #32085, #26675, #26265)
  • +
  • [Change] Set headers for IE 8 in file.php
  • +
  • [Change] Do not count queued posts to user_posts.
  • +
  • [Change] Allow setting birth year to current year.
  • +
  • [Change] Do not use the topics posted table when performing an egosearch.
  • +
  • [Change] Log the forum name that topics are moved into.
  • +
  • [Change] Automatically add users/groups to the PM recipient list, if entered or selected.
  • +
  • [Change] Reply to PM now includes all previous recipients and not only the original sender.
  • +
  • [Change] Make topic selection for merge less confusing by removing unneeded controls. (Bug #21925)
  • +
  • [Change] MCP topic view checkboxes now default to unchecked.
  • +
  • [Change] Adjust language key SPLIT_AFTER to make the action clearer.
  • +
  • [Change] Add links to the post and forum when viewing a report from the MCP. (Bugs #33795, #33805)
  • +
  • [Change] Added CSRF protection to GET-only actions like marking forums.
  • +
  • [Change] Remove NUL-Bytes directly in request_var() for strings and within the custom DBAL sql_escape() functions (MSSQL, Firebird, Oracle) (reported by AdhostMikeSw)
  • + +
  • [Feature] Allow limited inheritance for template sets.
  • +
  • [Feature] Allow hard disabling of the template editor.
  • +
  • [Feature] Allow setting custom language path through $user->set_custom_lang_path(). $user->lang_path now also do not include the user language, but only the path.
  • +
  • [Feature] Ability to define nullar/singular/plural language entries
  • +
  • [Feature] Ability to mimic sprintf() calls with $user->lang() with the ability to correctly assign nullar/singular/plural language entries.
  • +
  • [Feature] Added the possibility to force user posts put in queue if post count is lower than an admin defined value. Guest posting is not affected by this setting.
  • +
  • [Feature] Added 'max_recipients' setting for private messages. This setting allows admins to define the maximum number of recipients per private message with a board-wide setting and a group-specific setting.
  • +
  • [Feature] Added new permission setting for sending private messages to groups. Now there are two permissions to define sending private messages to multiple recipients and private messages to groups.
  • +
  • [Feature] Allow specific connection to different server for jabber functionality by providing a valid JID as username. This also allows the use of talk.google.com as jabber server with gmail.com JIDs. (Bug #14989)
  • + +
  • [Sec Precaution] Stricter validation of the HTTP_HOST header (Thanks to Techie-Micheal et al for pointing out possible issues in derived code)
  • +
+ +

Changes since 3.0.1

+ +
    +
  • [Fix] Ability to set permissions on non-mysql dbms (Bug #24955)
  • +
  • [Fix] Fixed blank style on setups having no username defined within config.php (Bug #25065)
  • +
  • [Fix] Made the compress_tar class tolerate archives that do not properly have their archived contents listed (Bug #14429 / thanks to JRSweets for his patch)
  • +
  • [Fix] Moved topics should not count towards the number of topics in a forum (Bug #14648 / thanks to Schumi for his patch)
  • +
  • [Fix] Properly check for invalid characters in MySQL DB prefixes during install (Bug #18775)
  • +
  • [Fix] Bring the PostgreSQL backup system back to working order (Bug #22385)
  • +
  • [Fix] Update correct theme for cached styles in style.php (Bug #25805)
  • +
  • [Fix] Also add PHPBB_INSTALLED check to download/file.php for inline avatar delivery
  • +
  • [Fix] Unable to login to some jabber server, reverted previous change (Bug #25095)
  • +
  • [Fix] Do not return BMP as valid image type for GD image manipulation (Bug #25925)
  • +
  • [Fix] Correctly determine safe mode for temp file creation in functions_upload.php (Bug #23525)
  • +
  • [Fix] Correctly sort by rank in memberlist (Bug #24435)
  • +
  • [Fix] Purge cache after database restore (Bug #24245)
  • +
  • [Fix] Correctly display subforum read/unread icons from RTL in FF3, Konqueror and Safari3+. (thanks arod-1 for the fix, related to Bug #14830)
  • +
  • [Fix] Added missing form token in acp (thanks NBBN).
  • +
  • [Fix] Do not remove whitespace in front of url containing the boards url and no relative path appended (Bug #27355)
  • +
  • [Fix] reset forum notifications in viewtopic (Bug #28025)
  • +
  • [Fix] corrected link for searching post author's other posts (Bug #26455)
  • +
  • [Fix] HTTP Authentication supports UTF-8 usernames now (Bug #21135)
  • +
  • [Fix] Topic searches by author no longer return invalid results (Bug #11777)
  • +
  • [Fix] Delete drafts and bookmarks when deleting an user. (#27585, thanks Schumi for the fix)
  • +
  • [Fix] Set last_post_subject for new topics. (#23945)
  • +
  • [Fix] Allow moving posts to invisible forums. (#27325)
  • +
  • [Fix] Don't allow promoting unapproved group members (#16124)
  • +
  • [Fix] Correctly fetch server name if using non-standard port (#27395)
  • +
  • [Fix] Regular expression for email matching in posts will no longer die on long words.
  • +
  • [Fix] Do not display ban message if direct call to cron. (thanks Dog Cow for reporting)
  • +
  • [Fix] Correctly display double-colon on special conditions within highlighted php source (Bug #26795)
  • +
  • [Fix] Increase storage capacity of titles/subjects due to specialchared content (Bug #25235)
  • +
  • [Fix] Catch invalid username wildcard ban (we do not support these) (Bug #29305)
  • +
  • [Fix] Fix (email)-domain checks for those having DNS prefixes set (Bug #29635)
  • +
  • [Change] Adjust truncate_string() to be able to adjust the maximum storage length.
  • +
  • [Change] Generalize load check (Bug #21255 / thanks to Xipher)
  • +
  • [Change] Make utf8_htmlspecialchars not pass its argument by reference (Bug #21885)
  • +
  • [Change] Sort the tables at the database table backup screen
  • +
  • [Change] For determining the maximum number of private messages in one box, use the biggest value from all groups the user is a member of (Bug #24665)
  • +
  • [Change] Show email ban reason on registration. Additionally allow custom errors properly returned if using validate_data(). (Bug #26885)
  • +
  • [Change] Don't allow redirects to different domains. (thanks nookieman)
  • +
  • [Feature] Added optional referer validation of POST requests as additional CSRF protection.
  • +
  • [Feature] Added optional stricter upload validation to avoid mime sniffing in addition to the safeguards provided by file.php. (thanks to Nicolas Grekas for compiling the list).
  • +
  • [Feature] Streamlined banning via the MCP by adding a ban link to the user profile. Also pre-fills ban fields as far as possible.
  • +
  • [Feature] Added ACP logout to reset an admin session.
  • +
  • [Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)
  • +
+ +

Changes since 3.0.0

+ +
    +
  • [Change] Validate birthdays (Bug #15004)
  • +
  • [Fix] Allow correct avatar caching for CGI installations. (thanks wildbill)
  • +
  • [Fix] Fix disabling of word censor, now possible again
  • +
  • [Fix] Allow single quotes in db password to be stored within config.php in installer
  • +
  • [Fix] Correctly quote db password for re-display in installer (Bug #16695 / thanks to m313 for reporting too - #s17235)
  • +
  • [Fix] Correctly handle empty imageset entries (Bug #16865)
  • +
  • [Fix] Correctly check empty subjects/messages (Bug #17915)
  • +
  • [Change] Do not check usernames against word censor list. Disallowed usernames is already checked and word censor belong to posts. (Bug #17745)
  • +
  • [Fix] Additionally include non-postable forums for moderators forums shown within the teams list. (Bug #17265)
  • +
  • [Change] Sped up viewforum considerably (also goes towards mcp_forum)
  • +
  • [Fix] Do not split topic list for topics being promoted to announcements after been moved to another forum (Bug #18635)
  • +
  • [Fix] Allow editing usernames within database_update on username cleanup (Bug #18415)
  • +
  • [Fix] Fixing wrong sync() calls if moving all posts by a member in ACP (Bug #18385)
  • +
  • [Fix] Check entered imagemagick path for trailing slash (Bug #18205)
  • +
  • [Fix] Use proper title on index for new/unread posts (Bug #13101) - patch provided by Pyramide
  • +
  • [Fix] Allow calls to $user->set_cookie() define no cookie time for setting session cookies (Bug #18025)
  • +
  • [Fix] Stricter checks on smilie packs (Bug #19675)
  • +
  • [Fix] Gracefully return from cancelling pm drafts (Bug #19675)
  • +
  • [Fix] Possible login problems with IE7 if browser check is activated (Bug #20135)
  • +
  • [Fix] Fix possible database transaction errors if code returns on error and rollback happened (Bug #17025)
  • +
  • [Change] Allow numbers in permission names for modifications, as well as uppercase letters for the request_ part (Bug #20125)
  • +
  • [Fix] Use HTTP_HOST in favor of SERVER_NAME for determining server url for redirection and installation (Bug #19955)
  • +
  • [Fix] Removing s_watching_img from watch_topic_forum() function (Bug #20445)
  • +
  • [Fix] Changing order for post review if more than one post affected (Bug #15249)
  • +
  • [Fix] Language typos/fixes (Bug #20425, #15719, #15429, #14669, #13479, #20795, #21095, #21405, #21715, #21725, #21755, #21865, #15689)
  • +
  • [Fix] Style/Template fixes (Bug #20065, #19405, #19205, #15028, #14934, #14821, #14752, #14497, #13707, #14738, #19725)
  • +
  • [Fix] Tiny code fixes (Bug #20165, #20025, #19795, #14804)
  • +
  • [Fix] Prepend phpbb_root_path to ranks path for displaying ranks (Bug #19075)
  • +
  • [Fix] Allow forum notifications if topic notifications are disabled but forum notifications enabled (Bug #14765)
  • +
  • [Fix] Fixing realpath issues for provider returning the passed value instead of disabling it. This fixes issues with confirm boxes for those hosted on Network Solutions for example. (Bug #20435)
  • +
  • [Fix] Try to sort last active date on memberlist correctly at least on current page (Bug #18665)
  • +
  • [Fix] Handle generation of form tokens when maximum time is set to -1
  • +
  • [Fix] Correctly delete unapproved posts without deleting the topic (Bug #15120)
  • +
  • [Fix] Respect signature permissions in posting (Bug #16029)
  • +
  • [Fix] Users allowed to resign only from open and freely open groups (Bug #19355)
  • +
  • [Fix] Assign a last viewed date to converted topics (Bug #16565)
  • +
  • [Fix] Many minor and/or cosmetic fixes (Including, but not limited to: #21315, #18575, #18435, #21215)
  • +
  • [Feature] New option to hide the entire list of subforums on listforums
  • +
  • [Fix] Custom BBCode {EMAIL}-Token usage (Bug #21155)
  • +
  • [Fix] Do not rely on parameter returned by unlink() for verifying cache directory write permission (Bug #19565)
  • +
  • [Change] Use correct string for filesize (MiB instead of MB for example)
  • +
  • [Change] Remove left join for query used to retrieve already assigned users and groups within permission panel (Bug #20235)
  • +
  • [Fix] Correctly return sole whitespaces if used with BBCodes (Bug #19535)
  • +
  • [Fix] Quote bbcode parsing adding too much closing tags on special conditions (Bug #20735)
  • +
  • [Change] Added sanity checks to various ACP settings
  • +
  • [Change] Removed minimum form times
  • +
  • [Fix] Check topics_per_page value in acp_forums (Bug #15539)
  • +
  • [Fix] Custom profile fields with date type should be timezone independend (Bug #15003)
  • +
  • [Fix] Fixing some XHTML errors/warnings within the ACP (Bug #22875)
  • +
  • [Fix] Warnings if poll title/options exceed maximum characters per post (Bug #22865)
  • +
  • [Fix] Do not allow selecting non-authorized groups within memberlist by adjusting URL (Bug #22805 - patch provided by ToonArmy)
  • +
  • [Fix] Correctly specify "close report action" (Bug #22685)
  • +
  • [Fix] Display "empty password error" within the login box instead of issuing a general error (Bug #22525)
  • +
  • [Fix] Clean up who is online code in page_header (Bug #22715, thanks HighwayofLife)
  • +
  • [Fix] Pertain select single link on memberlist (Bug #23235 - patch provided by Schumi)
  • +
  • [Fix] Allow & and | in local part of email addresses (Bug #22995)
  • +
  • [Fix] Do not error out if php_uname function disabled / Authenticating on SMTP Server (Bug #22235 - patch by HoL)
  • +
  • [Fix] Correctly obtain to be ignored users within topic/forum notification (Bug #21795 - patch provided by dr.death)
  • +
  • [Fix] Correctly update board statistics for attaching orphaned files to existing posts (Bug #20185)
  • +
  • [Fix] Do not detect the board URL as a link twice in posts (Bug #19215)
  • +
  • [Fix] Set correct error reporting in style.php to avoid blank pages after CSS changes (Bug #23885)
  • +
  • [Fix] If pruning users based on last activity, do not include users never logged in before (Bug #18105)
  • +
  • [Sec] Only allow searching by email address in memberlist for users having the a_user permission (reported by evil<3)
  • +
  • [Sec] Limit private message attachments to be viewable only by the recipient(s)/sender (Report #s23535) - reported by AlleyKat
  • +
  • [Sec] Check for non-empty config.php within style.php (Report #s24575) - reported by bantu
  • +
  • [Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)
  • +
+ +

Changes since 3.0.RC8

+ +
    +
  • [Fix] Cleaned usernames contain only single spaces, so "a_name" and "a__name" are treated as the same name (Bug #15634)
  • +
  • [Fix] Check "able to disable word censor" option while applying word censor on text (Bug #15974)
  • +
  • [Fix] Rollback changes on failed transaction if returning on sql error is set
  • +
  • [Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)
  • +
+ +

Changes since 3.0.RC7

+ +
    +
  • [Fix] Fixed MSSQL related bug in the update system
  • +
  • [Fix] Display "Return to" links on unwritable forums (Bug #14824)
  • +
  • [Fix] Mitigating different realpath() handling between PHP versions (fixing confirm box redirects)
  • +
  • [Fix] Fix signature editing - ability to remove signature (Bug #14820)
  • +
  • [Fix] Send correct activation key by forcing reactivation for inactive user (Bug #14819)
  • +
  • [Fix] Adding correct IP for private messages sent by issuing warnings (Bug #14781)
  • +
  • [Fix] Open private message notification (Bug #14773)
  • +
  • [Fix] Fixing false new private message indicator (Bug #14627)
  • +
  • [Fix] Let newly activated passwords work if users were converted (Bug #14787)
  • +
  • [Fix] Quote bbcode fixes. Letting parse quote="[" and re-allowing whitelisted bbcodes within username portion (Bug #14770)
  • +
  • [Fix] Allow alternative text for styled buttons if images turned off, but CSS staying on
  • +
  • [Sec] Fix bbcode helpline display for custom bbcodes - this requires style changes for any custom style (Bug #14850)
  • +
  • [Fix] Correctly count announcements when filtering forums by date (Bug #14877)
  • +
  • [Fix] Allow charset names containing underscores or spaces
  • +
  • [Fix] Don't allow previous/next links for non-existing topics (Bug #15039)
  • +
  • [Change] Do not assign converted votes to the first option in a vote.
  • +
  • [Fix] Use correct RFC 2822 date format in emails (Bug #15042)
  • +
  • [Fix] Require founder status for some actions on founder-only groups (Bug #15119)
  • +
  • [Fix] Allow changing the "now" option of date CPFs (Bug #15111)
  • +
  • [Change] Some improvements to the caching of avatars
  • +
  • [Change] Set template recompilation to be disabled by default. All mod and style authors and all those who want to modify their styles should enabled it after installation.
  • +
  • [Change] Disable debug mode. All mod and style authors should enable DEBUG and DEBUG_EXTRA.
  • +
  • [Fix] Check error reporting level for all error level. This fixes a problem for hosts having manipulated the error handler. (Bug #14831)
  • +
  • [Feature] Constant PHPBB_DB_NEW_LINK introduced which can be used to force phpBB to create a new database connection instead of reusing an existing one if the dbms supports it (Bug #14927)
  • +
  • [Fix] Automatic URL parsing no longer allows dots in the schema but can parse URLs starting after a dot (Bug #15110)
  • +
  • [Fix] Dynamic width for birthday select boxes (Bug #15149)
  • +
  • [Fix] Recache Moderators when copying permissions. (Bug #15384)
  • +
  • [Fix] Propagate sort options in mcp_forums (Bug #15464)
  • +
  • [Change] Do not allow [size=0] bbcodes (font-size of 0)
  • +
  • [Fix] No duplication of active topics (Bug #15474)
  • +
+ +

Changes since 3.0.RC6

+ +
    +
  • [Fix] Submitting language changes using acp_language (Bug #14736)
  • +
  • [Fix] Fixed wrong bbcode handling for forum rules, forum descriptions and group descriptions
  • +
  • [Fix] Fixed faulty form tokens (Bug #14725, #14762 and #14755)
  • +
  • [Fix] Fixed bbcode uid generation in the phpBB2 converter (Bug #14722)
  • +
  • [Fix] Able to request new password (Bug #14743)
  • +
+ +

Changes since 3.0.RC5

+ +
    +
  • [Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.
  • +
  • [Feature] Constant PHPBB_ADMIN_PATH introduced, having the same purpose as PHPBB_ROOT_PATH, but for the ACP.
  • +
  • [Fix] Further fixing user profile view (please do not forget to update/refresh your template and style) (Bug #14230)
  • +
  • [Fix] Adjust google adsense bot information (Bug #14296)
  • +
  • [Fix] Fix horizontal scrollbar problem in IE6 (Bug #14228) - fix provided by Danny-dev
  • +
  • [Fix] Use correct size values in ACP user signature screen (Bug #13367)
  • +
  • [Fix] Attachment Place inline won't work with single quotes (Bug #14291)
  • +
  • [Fix] Unable to save email templates through ACP language page (Bug #14266)
  • +
  • [Fix] Correctly set user style for guest user (able to be changed within user management)
  • +
  • [Change] Moved note about dns_get_record function for using GTalk (Jabber) from Jabber log to Jabber ACP panel
  • +
  • [Fix] Do not use register_shutdown_function within cron.php if handling the queue and the mail function being used (Bug #14321)
  • +
  • [Fix] Fixing private message on-hold code if moving messages into folder based on rules (Bug #14309)
  • +
  • [Fix] Allow the merge selection screen to work (Bug #14363)
  • +
  • [Change] Require additional permissions for copying permission when editing forums
  • +
  • [Fix] Local magic URLs no longer get an additional trailing slash (Bug #14362)
  • +
  • [Fix] Do not let the cron script stale for one hour if register_shutdown_function is not able to be called (Bug #14436)
  • +
  • [Feature] Added /includes/db/db_tools.php file, which includes tools for handling cross-db actions such as altering columns, etc.
  • +
  • [Change] Reset the start parameter when the timeframe is changed in the mcp topic page (Ticket #14438)
  • +
  • [Change] Added Code for cleaning the confirm table to the session garbage collection
  • +
  • [Fix] Fixed token handling in jabber class for extremely spec-compliant XMPP server (Bug #14445)
  • +
  • [Fix] Disallowed galleries from using special characters (Bug #14466)
  • +
  • [Change] Listing the board url within the email text instead of appending it to the subject (Bug #14378)
  • +
  • [Fix] Always display the quote button as the most accessible one (this means edit is before quote in prosilver due to the way we lay out profiles)
  • +
  • [Fix] Use correct dimension (width x height) in ACP (Bug #14452)
  • +
  • [Fix] Only display PM history links if there are PM's to be displayed (Bug #14484)
  • +
  • [Feature] Added completely new hook system to allow better application/mod integration - see docs/hook_system.html
  • +
  • [Fix] Correctly delete excess poll options (Bug #14566)
  • +
  • [Fix] Allow names evaluating to false for poll options
  • +
  • [Change] use in-build functions for user online list (Bug #14596) - provided by rxu
  • +
  • [Fix] Fixing google cache display problems with Firefox (Bug #14472) - patch provided by Raimon
  • +
  • [Fix] Prevent topic unlocking if locked by someone else while posting (Bug #10307)
  • +
  • [Change] Allow years in future be selected for date custom profile field (Bug #14519)
  • +
  • [Fix] Don't display "Avatars Disabled" message on edit groups in UCP (Bug #14636)
  • +
  • [Change] Require confirm for deleting inactive users. (Bug #14641)
  • +
  • [Fix] Match custom BBCodes in the same way during first and second pass - patch provided by IBBoard (Bug #14268)
  • +
  • [Fix] Correct quote parsing if opening bracket before opening quote (Bug #14667)
  • +
  • [Fix] Clean post message for checking length to prevent posting empty messages
  • +
  • [Fix] Display jumpbox if needed for functionality (Bug #14702)
  • +
  • [Feature] Added an option to enforce that users spend a configurable amount of time on the terms page during registration
  • +
  • [Fix] Fixed copy permissions box in the ACP
  • +
  • [Fix] Enforce types for the user table during conversions
  • +
  • [Sec] Fixing possible XSS through compromised WHOIS server (#i63, #i64)
  • +
  • [Sec] Missing access control on whois in viewonline.php (#i51)
  • +
  • [Sec] Encoding some variables within user::page array correctly (to cope with browser not doing it correctly) to prevent XSS through functions re-using them (#i61)
  • +
  • [Sec] Fixed XSS through memberlist search feature (#i62)
  • +
  • [Sec] Fixed XSS through colour swatch (#i65)
  • +
  • [Sec] Fixed insecure attachment deletion (#i53)
  • +
  • [Sec] Only allow whitelisted protocols in meta_redirect/redirect (#i66)
  • +
  • [Sec] Check file names to be written in language management panel (#i52)
  • +
  • [Sec] Deregister globals if ini_get has been disabled (#i112)
  • +
  • [Sec] Added form tokens to most forms to enforce a lighter variant of CSRF protection (#i91 - #i96)
  • +
  • [Sec] Use new password hash method for forum passwords (#i43)
  • +
  • [Sec] Changed download file location to prevent flash crossdomain policies taking effect (#i8)
  • +
  • [Sec] Do not allow autocompletion for password on admin re-authentication (#i41)
  • +
  • [Sec] Made sure users are not completely locked out if they have a GLOBALS cookie (#i101)
  • +
  • [Sec] Use the secure hash to generate BBCODE_UIDs (#i71)
  • +
  • [Sec] Increase the length of BBCODE_UIDs (#i72)
  • +
  • [Sec] New password hashing mechanism for storing passwords (#i42)
  • +
+ +

Changes since 3.0.RC4

+ +
    +
  • [Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)
  • +
  • [Fix] Allow MS SQL to properly connect when using the mssql driver and PHP is less than either 4.4.1 or 5.1 (Bug #13874)
  • +
  • [Fix] Ignore files containing HTML special chars in the filenames as gallery avatars (Bug #13906)
  • +
  • [Fix] Multiple PM recipients not separated (Bug #13876)
  • +
  • [Change] Split the select list for the smilie order to clarify which are feasible and which are not (Bug #13911)
  • +
  • [Fix] Convert empty homepage fields (Bug #13917)
  • +
  • [Fix] Use board default DST setting on creating new profiles (Bug #11563)
  • +
  • [Feature] New constant PHPBB_EMBEDDED can be used to let phpBB not call exit; if wrapped/embedded (We may re-check this constant on other code locations later too)
  • +
  • [Feature] append_sid() having a check for the function append_sid_phpbb_hook(). This function is called in favour of append_sid() with the exact same parameters if present.
  • +
  • [Fix] Only list enabled modes within the dropdown at user administration (Bug #13883) - patch provided by damnian
  • +
  • [Fix] Properly display ban reason if selecting banned entries within the ACP (Bug #13896)
  • +
  • [Fix] Properly parse SQL expressions for Oracle (Bug #13916)
  • +
  • [Fix] Added label bindings to the custom profile fields in the ACP (Bug #13936) - patch provided by damnian
  • +
  • [Change] Made group avatar/rank changes more intuitive
  • +
  • [Fix] Give more feedback in icon/smilie management (Bug #13295)
  • +
  • [Fix] Correctly set user::lang_id (Bug #14010)
  • +
  • [Fix] Properly display the smiley export screen (Bug #13968)
  • +
  • [Feature] Add "DECIMAL:", "PDECIMAL", and "PDECIMAL:" to the schema creation code (Bug #13999) - patch provided by poyntesm
  • +
  • [Fix] Don't show the notify checkbox in the approval queue if the only posts are written by ANONYMOUS (Bug #13973)
  • +
  • [Fix] Redirect to bots management page on edit/add (Bug #14073)
  • +
  • [Fix] Display locked icon in viewforum/prosilver if forum locked (Bug #14009)
  • +
  • [Feature] Display message history in compose PM screen
  • +
  • [Change] Do not force login on visiting topic/forum from notification emails (Bug #13818)
  • +
  • [Fix] Fixed cron_lock value for cron execution. This bug led to users having problems with the email queue and other cron related issues.
  • +
  • [Fix] Prevent white pages on php notices with gzip compression enabled (Bug #14096)
  • +
  • [Fix] Propagate the cleaned identifier for CFPs (Bug #14072)
  • +
  • [Fix] Do not display NO_TOPICS message if viewing non-postable category (Bug #13489)
  • +
  • [Fix] Let the theme immediately expire if changed from ACP for at least 30 minutes after change
  • +
  • [Fix] Do not append hilit= in search if highlighting term is empty (Bug #13910)
  • +
  • [Fix] Return to last page after voting in viewtopic instead of first page in topic (Bug #13976)
  • +
  • [Fix] If sending PM's to groups only include activated member (Bug #14040)
  • +
  • [Fix] Correctly wrap words in emails containing utf8 characters (Bug #14109)
  • +
  • [Change] For new posts or editing the first post topic titles have a maxlength of 60 characters. For any subsequent posts the length is extended to 64 to make room for the Re: part, but cutting at 60 characters. The maxlength need to be 64, else users using opera are unable to post (opera does not allow pre-filling a field with more characters than specified within the maxlength attribute)
  • +
  • [Fix] Disable gzip compression for cached stylesheet for Internet Explorer 6 or empty browser (IE6 is not able to properly display the compressed stylesheet) (Bug #14054)
  • +
  • [Fix] Header icons fixed in FF for RTL languages (Bug #14084)
  • +
  • [Change] Words in topic titles and post subjects are highlighted on the search results page and viewtopic too now (Bug #13383)
  • +
  • [Fix] Made sure strip_bbcode cannot get the idea that a smiley is a BBCode (Bug #14030)
  • +
  • [Change] Added a filter for user objects to LDAP configuration and improved explanations (Bug #12627)
  • +
  • [Fix] Display searchable subforums of invisible parents in advanced search forum selection (Bug #11395)
  • +
  • [Fix] Allow line breaks in custom BBCodes (Bug #10758)
  • +
  • [Fix] Ordered BBcode parsing functions in the same way everywhere where they are used
  • +
  • [Fix] Prevent {URL} token in custom BBCodes from make_clickable messing (Bug #14151)
  • +
  • [Sec] Added alternative tokens to custom BBCodes which are safe for CSS/Javascript and changed TEXT token to entitise opening and closing parantheses.
  • +
  • [Fix] Convert 2.0 moderator posting permissions (Bug #14105)
  • +
  • [Fix] Correctly apply PM box limit of 0 to custom folder (Bug #14154)
  • +
  • [Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)
  • +
+ +

Changes since 3.0.RC3

+ +
    +
  • [Fix] Fixing some subsilver2 and prosilver style issues
  • +
  • [Fix] Parse error in MCP ban (Bug #13109)
  • +
  • [Fix] Correctly hide online status in the profile (Bug #13059)
  • +
  • [Feature] Let the user choose how to update modified files (merging, using new file or using old file) within automatic updater
  • +
  • [Fix] An extra \ in an Oracle SQL regex was corrected (Bug #13151)
  • +
  • [Fix] Added a missing global to get_file() (Bug #13149)
  • +
  • [Fix] Hide autologin box when autologin is disabled (Bug #13093)
  • +
  • [Fix] Account for the forum id not being part of the request uri in prosilver (Bug #13121)
  • +
  • [Fix] Properly alter PostgreSQL tables
  • +
  • [Fix] Properly cache template files that were stored in the database (Bug #12675)
  • +
  • [Fix] Do not count the deletion of an unapproved topic as a decrease in normally viewable posts (Bug #13167)
  • +
  • [Fix] Allow column_exists() to return true if the column exists but no data is in the table
  • +
  • [Fix] Allow setting the smiley order via the select. Also allow to add smileys at the top. (Bug #13199)
  • +
  • [Fix] Fix php notice on sending jabber messages (Bug #13201)
  • +
  • [Fix] Make the window showing file differences a little wider (Bug #13157)
  • +
  • [Fix] Preserve preview style on search form (Bug #13205)
  • +
  • [Fix] Place attachment filename in new line in posting editor (Bug #9726)
  • +
  • [Fix] Don't allow caching to occur in the update sequence (Bug #13207)
  • +
  • [Fix] Enforce the max password length for automatically generated password created by the password sender (Bug #13181)
  • +
  • [Fix] Handle phpinfo() when expose_php is false (Bug #12777)
  • +
  • [Fix] Allow managing of forum roles without global users (Bug #13249)
  • +
  • [Change] Do not run cron script if board is disabled
  • +
  • [Fix] Correctly destroy sql cache for some query combinations (Bug #13237)
  • +
  • [Fix] Allow link forums being password protected (Bug #12967)
  • +
  • [Fix] Allow wrapping topic/post icons in posting editor (Bug #12843)
  • +
  • [Fix] Display L_RANK only once in template if rank title and image defined (Bug #13231)
  • +
  • [Fix] Make sure selected transfer method exists before calling (Bug #13265)
  • +
  • [Fix] Correctly escape language keys in language editor (Bug #13279)
  • +
  • [Fix] Correctly hide post/reply buttons if permissions are not given (related to Bug #12809)
  • +
  • [Fix] Remove orphan/wrong permission entries for non-existent forums - self-repairing permissions if conversions went "crazy"
  • +
  • [Feature] Allow "older" updates applied with the automatic updater. This allows people using it for updating, say, from 3.0.0 to 3.0.1 (with the correct package of course) and then from 3.0.1 to 3.0.2 if the latest version at this time is 3.0.2. These changes take effect beginning with RC4 or people replacing install/install_update.php manually prior doing the updates.
  • +
  • [Fix] Present correct error message if user tries to edit already read private message (Bug #13271)
  • +
  • [Fix] Also display board disabled notice for admins/mods if board got disabled due to exceeding the load limit (Bug #13267)
  • +
  • [Fix] Correctly deliver avatar if readfile function has been disabled (Bug #13309)
  • +
  • [Fix] Display php information page with the correct direction (Bug #12557)
  • +
  • [Fix] Increased the number of style objects (styles, templates, themes and imagesets) possible from 127 to 65535 for MySQL (Bug #13179)
  • +
  • [Fix] Although theoretically impossible in our code, removed the chance of trying to open a file that does not exist (Bug #13327)
  • +
  • [Fix] Although theoretically impossible in our code, changed the handling of non-existent language files (Bug #13329, #13331)
  • +
  • [Fix] Removed extra ampersand from ACP link (Bug #13315)
  • +
  • [Fix] used cleaned up version of given field identification for pre-filling a new custom profile field (Bug #13319)
  • +
  • [Fix] Correctly convert 2.0 website profile fields. (Bug #13379)
  • +
  • [Fix] Fixed the "Alphanumeric" and "Alphanumeric and spacers" username selection limitations (Bug #13391)
  • +
  • [Fix] Make sure filelist() is only returning array types (Bug #13385)
  • +
  • [Fix] Correctly mark forums read if using cookie based topic tracking (Bug #13245)
  • +
  • [Change] Put custom profile fields into top box and signature into separate box in members profile view (Bug #13357)
  • +
  • [Fix] Only show moderator log entries for forums the user is having moderation rights in (Bug #12481)
  • +
  • [Feature] Show resulting permission alone in trace window (Bug #10952) - thanks to dark/rain for the proposal
  • +
  • [Fix] Fixed bug in realpath replacement letting it actually work again
  • +
  • [Change] Try to be a bit more specific regarding global/local permission trace (Bug #11032)
  • +
  • [Fix] Fixed some strangeness in password validation due to mb_ereg()
  • +
  • [Fix] Subforums of a forum would overwrite the latest post information even if they did not contain the latest post (Bug #11931)
  • +
  • [Fix] Use global username display function on several places (Bug #11080, #11098) - patch by HoL
  • +
  • [Fix] Several viewonline fixes and feature changes. Also displaying the users browser in viewonline list to let the admin easier spot additional search bots, connected to a_user permission (Bug #11088) - patch and suggestions provided by HoL
  • +
  • [Change] u_viewprofile permission also affecting viewonline list now
  • +
  • [Fix] Do not display return to search link in prosilver if search is not allowed (Bug #11393)
  • +
  • [Fix] Use global url validation for img bbcode tag (Bug #11935)
  • +
  • [Fix] Added proper unicode support to style names (Bug #12165)
  • +
  • [Fix] Search result extract should not end in the middle of a multibyte character (Bug #11863)
  • +
  • [Fix] Missing localisation for an imageset no longer triggers a lot of "imageset refreshed" log messages (Bug #12027)
  • +
  • [Fix] Explain that themes which need parsing cannot be stored on the filesystem (Bug #11134)
  • +
  • [Fix] Normalize usernames
  • +
  • [Change] Improved utf8_clean_string with a more complete list of homographs and NFKC normalization
  • +
  • [Fix] Fixed error messages that ACP Database can give (Bug #13463)
  • +
  • [Fix] Fixed potential issues with databases that use tables names is uppercase
  • +
  • [Fix] Handle forum links/redirects within viewforum if no read permission given (to display login box or error message) (Bug #13467)
  • +
  • [Fix] Prevent changing postable forum having subforums to link forum without moving subforums out first
  • +
  • [Fix] Do not display version in admin template (Bug #13495)
  • +
  • [Fix] Allow manual specification of remote avatar dimensions if getimagesize is disabled (Bug #13531)
  • +
  • [Fix] Make viewonline use the session page's added forum parameter (Bug #13597)
  • +
  • [Fix] Correcting BBCode FAQ (Bug #11180)
  • +
  • [Fix] Make to/bcc line in view private message display consistent with other username displays in prosilver (Bug #11989)
  • +
  • [Fix] Send out activation email if admin activation is enabled and user activated through inactive users panel upon registration (Bug #12065)
  • +
  • [Change] Re-implemented All Yes/No/Never links in permission panels for easier changing all categories at once
  • +
  • [Change] Advanced permission link now "marked" if no role is assigned and custom permissions set. With this an admin can instantly see if the object is not set at all or having custom permissions, something you only saw if advanced permissions were viewed before.
  • +
  • [Fix] Change misleading custom BBCodes explanation, regarding tokens and useable template variables (Bug #12403, #5660)
  • +
  • [Feature] Ability to disable birthdays completely with new board features setting
  • +
  • [Fix] Fix disallowed username check (Bug #13511)
  • +
  • [Fix] Allow for unicode usernames to be pruned (Bug #13643)
  • +
  • [Fix] Do not copy forum permissions from self (Bug #13663)
  • +
  • [Fix] Allow for polls to work during preview (Bug #13657) - thanks to Thatbitextra
  • +
  • [Fix] Finer error conditions for sending IM messages (Bugs #13681, #13683)
  • +
  • [Fix] Add a confirmation for log deletion in the MCP (Bug #13693)
  • +
  • [Fix] Do not erase ranks and avatars when changing default groups (Bugs #13701, #13697)
  • +
  • [Fix] Limit author searches to firstpost, if selected (Bug #13579)
  • +
  • [Fix] Properly resync user post counts for users that have no posts (Bug #13581)
  • +
  • [Fix] Do not require space after , in smiley pak files (Bug #13647)
  • +
  • [Fix] Properly display the subscribe link in topic and forum display for Oracle (Bug #13583)
  • +
  • [Change] Add version number to ACP index (Bug #13703)
  • +
  • [Fix] Several fixes for custom profile fields on multi-lingual boards (Bugs #13763, #13527, #13525, #11515)
  • +
  • [Fix] Return to the mode previously selected after disaproving a post (Bug #13796)
  • +
  • [Fix] Cron now uses a locking variable to make sure it does not spawn too many webserver processes (Bug #12741)
  • +
  • [Fix] Cached stylesheet now supporting gzip compression
  • +
  • [Fix] Added link to inbox for deleted PMs (Bug #13813)
  • +
  • [Fix] Re-syncing the board stats also refreshes the newest user (Bug #13831)
  • +
  • [Feature] Ability to externally set $phpbb_root_path if wrapping phpBB3 by defining constant PHPBB_ROOT_PATH
  • +
  • [Fix] Implemented correct left/right floating within ACP in regard to RTL languages (Bug #13777)
  • +
  • [Fix] Fixing session problems when using MySQL strict mode in conjunction with very long browser agent string (Bug #13827)
  • +
  • [Fix] Disallow post/pm subjects entirely made up from non-printable chars and whitespaces (Bug #13800)
  • +
  • [Fix] Allow moving private messages from the sentbox (Bug #13791)
  • +
  • [Fix] Properly export localized imagesets
  • +
  • [Feature] Show the size of Firebird databases
  • +
  • [Fix] Show error when moving topic into a category via quickmod (Bug #11611)
  • +
  • [Fix] Allow Oracle to install on a database without specify the database name
  • + +
+ +

Changes since 3.0.RC2

+ +
    +
  • [Fix] Re-allow searching within the memberlist
  • +
  • [Fix] Force prune related values to integers during conversions
  • +
  • [Fix] Updater now detects successfully merged files having conflicts and user chose to merge with modifications (Bug #12685)
  • +
  • [Fix] Updater is no longer listing missing language entries and styles if these had been removed (Bug #12655)
  • +
  • [Fix] Correct approval of posts in global announcements (Bug #12699)
  • +
  • [Sec] Do not allow setup spiders/robots to post, even if permissions are given. We see no reason why this should be possible. (Thanks to Frank Rizzo for convincing us regarding this)
  • +
  • [Sec] Do not display the last active column within the memberlist if u_viewonline permission is not given (Bug #12797)
  • +
  • [Fix] Display custom profile field "date" based on users language (Bug #12787)
  • +
  • [Fix] Allow adding of help language files within subdirectories (Bug #12783)
  • +
  • [Fix] Correctly apply smileys on posting having # within their emotion code
  • +
  • [Fix] Correctly convert smileys having double quotes within their emotion code (Bug #12731)
  • +
  • [Fix] The converter now adds the protocol to user website profile fields missing it (Bug #12819)
  • +
  • [Fix] Correctly escape banned ip/email using wildcard for ban check (Bug #12815)
  • +
  • [Fix] Fixed some very nasty opera bugs (dropdown list bug, cpu spike bug) (Bug #12763, #11609)
  • +
  • [Fix] Font colour list having the correct height in IE (Bug #9571)
  • +
  • [Feature] Added mark/unmark all links to the bots page (Bug #12461)
  • +
  • [Fix] Introduced check on duplicate usernames during bot creation/edit (Bug #12461)
  • +
  • [Fix] Allow multibyte letters for smilie codes(Bug #12321)
  • +
  • [Fix] Correctly chmod created cache files (Bug #12859)
  • +
  • [Fix] Use our global expression for checking email syntax in memberlist (Bug #12827)
  • +
  • [Fix] Correctly retrieve/refresh templates stored in database if using subdirectories within template directory (Bug #12839)
  • +
  • [Fix] Correctly translate special group names in ucp_groups.php (Bug #12597)
  • +
  • [Fix] Search boxes not losing session id (changing method from get to post) (Bug #12643)
  • +
  • [Fix] Make sure the automatic update is also working for those having fsockopen disabled
  • +
  • [Fix] Simulate recache of theme data on automatic update finished page - recaching it if css data changed
  • +
  • [Feature] Allow dropping in custom "info_[module class]_*.php" files to language/*/mods directory for inclusion into the menu structure without the need to modify phpBB language files for menu placements
  • +
  • [Fix] Added login box to egosearch (Bug #12941)
  • +
  • [Fix] Deal with slashed quotes during quote bbcode conversion (Bug #12607)
  • +
  • [Fix] Minor language and style fixes (Bugs #12235, #12493, #11949)
  • +
  • [Feature] Added backlinks to mcp_report (Bug #12905)
  • +
  • [Fix] Only check usernames in guest posts upon edit (Bug #11349)
  • +
  • [Fix] Consider viewonline permission when viewing friends/foes (Bug #12955)
  • +
  • [Fix] Added proper unicode support to ban reasons (Bug #12947)
  • +
  • [Fix] The forum/topic sync code now recognizes other ways that the latest post in a topic can be expressed (Bug #12947) - patch provided by APTX
  • +
  • [Fix] Topic deletion via the user post deletion mechanism did not take into account statistics for forums that hold shadow topics (Bug #12981)
  • +
  • [Fix] Allow for negative and decimal numbers to be in transposed queries in the Oracle and Firebird DBAL (Bug #13033)
  • +
  • [Fix] Some jabber related bugs (Bug #12989, #11805, #11809)
  • +
  • [Fix] Added UTF-8 support for banning via the MCP (Bug #13013)
  • +
  • [Fix] Properly detect the script name in session::extract_current_page() if PHP_SELF is not defined (Bug #12705) - patch provided by ToonArmy
  • +
  • [Fix] Show role mask for global permission class under Permissions->Permission Roles (Bug #13057)
  • + +
+ +

Changes since 3.0.RC1

+ +
    +
  • [Fix] (X)HTML issues within the templates (Bug #11255, #11255)
  • +
  • [Fix] Tiny language and grammar changes
  • +
  • [Fix] Several style related fixes, mainly fixing cross-browser issues
  • +
  • [Fix] Several RTL fixes within prosilver
  • +
  • [Fix] MCP looses forum_id in some panels (Bug #11255)
  • +
  • [Fix] Moderation queue used unfriendly notification of no posts/topics (Bug #11291)
  • +
  • [Fix] Array in Oracle DBAL not always set (Bug #11475)
  • +
  • [Fix] Improper continue; in acp_styles.php (Bug #11523)
  • +
  • [Fix] Imageset editor more friendly (Bug #11511)
  • +
  • [Fix] Made Custom BBCode validation more strict (Bug #11335)
  • +
  • [Fix] Proper sync of data on topic copy (Bug #11335)
  • +
  • [Fix] Introduced ORDER BY clauses to converter queries (Bug #10697)
  • +
  • [Fix] Stopped bots from getting added to the registered users group during conversion (Bug #11283)
  • +
  • [Fix] Filled "SMILIEYS_DISABLED" template variable (Bug #11257)
  • +
  • [Fix] Properly escaped the delimiter in disallowed username comparisons (Bug #11339)
  • +
  • [Fix] Check global purge setting (Bug #11555)
  • +
  • [Fix] Improper magic url parsing applied to already parsed [url=] bbcode tag (Bug #11429)
  • +
  • [Fix] Renamed two indicies for Oracle support (Bug #11457)
  • +
  • [Fix] Added support for ISO-8859-8(-i) in the character set convertor (Bug #11265, #12039)
  • +
  • [Fix] Added support for Oracle's "easy connect naming"
  • +
  • [Fix] Let Mark/Unmark All work in Manage Drafts (Bug #11679)
  • +
  • [Fix] Display correct message if no attachments found in user administration (Bug #11629)
  • +
  • [Fix] Let the "Delete all board cookies" being displayed for guests too (only prosilver) (Bug #11603)
  • +
  • [Fix] Do not display view topic link in MCP while there is no link present (Bug #11573)
  • +
  • [Fix] MySQL now properly sorts by post_subject (Bug #11637)
  • +
  • [Fix] Introduced checks to stop negative postcounts (Bug #11561, #11421)
  • +
  • [Fix] Allow IP v4/v6 urls for remote avatars (Bug #11633)
  • +
  • [Fix] Delete avatar files automatically (Bug #11631)
  • +
  • [Fix] Automatically add selected columns to group by statements in the converter (Bug #11465)
  • +
  • [Fix] Allow posts without subjects to be clicked in the MCP (Bug #11483)
  • +
  • [Fix] Sync the forums that shadow topics reside in when the topic that they point to is deleted
  • +
  • [Fix] Do not use the gen_random_string function to create cookie names during install (Bug #11431)
  • +
  • [Fix] Send stylesheet in style.php even without a valid session id (Bug #11531)
  • +
  • [Fix] request_var should strictly return the requested number of dimensions
  • +
  • [Fix] Correct assignment of custom width to $user->img(); / Correctly display poll bars in subsilver2 (Bug #11301)
  • +
  • [Fix] Allow removing polls in prosilver
  • +
  • [Fix] Correct link to post in managing users attachments (Bug #11765)
  • +
  • [Fix] Reload confirm screen for selecting new forum for global topic type change if not postable forum is chosen (Bug #11711)
  • +
  • [Fix] Correctly show system default color for disabled options in Internet Explorer which does not support disabled option fields
  • +
  • [Fix] Update query for custom profiles in user management used wrong order for left/right delimiter (affecting mssql) (Bug #11781)
  • +
  • [Fix] Inconsistent display of more smileys link fixed (Bug #11801)
  • +
  • [Fix] Outbox messages are no always neither new nor unread post-conversion (Bug #11461)
  • +
  • [Feature] Replaced outdated jabber class with the one from the flyspray project
  • +
  • [Feature] The converter no longer relies on the smiley ID to decide if it should be displayed on the posting page
  • +
  • [Change] Limit maximum number of allowed characters in messages to 60.000 by default. Admins should increase their PHP time limits if they want to raise this tremedously.
  • +
  • [Change] Some changes to the conversion documentation
  • +
  • [Fix] Only use permissions from existing forums during the conversion (Bug #11417)
  • +
  • [Fix] Do not permit the decimal as a valid prefix character (Bug #11967)
  • +
  • [Fix] Account for the fact that the IM fields might hold non-IM information
  • +
  • [Fix] Make the queue function on post details
  • +
  • [Fix] Check if there are active styles left before deleting a style
  • +
  • [Fix] Correctly update styles after the deletion of an imageset.
  • +
  • [Fix] Replaced jabber validation to use the method used by the new jabber class (Bug #9822)
  • +
  • [Sec] Adding confirm boxes to UCP group actions (ToonArmy)
  • +
  • [Feature] Added the option to disable the flash bbcode globally (DelvarWorld)
  • +
  • [Sec] Changed the embedding of Flash (NeoThermic, DelvarWorld)
  • +
  • [Fix] Use the signature setting for PMs (Bug #12001)
  • +
  • [Fix] Made the DBMS selection use language variables (Bug #11969)
  • +
  • [Fix] Make sure that a folder is used when viewing messages to oneself (Bug #12105)
  • +
  • [Fix] Account for the fact that a board might have no visible Admins (Bug #12185)
  • +
  • [Fix] Change group ranks even if empty (Bug #12231)
  • +
  • [Fix] Correctly propagate variables across the custom profile field wizard (Bug #12237)
  • +
  • [Fix] Correctly move pm's into folders if more than one is received (Bug #12135)
  • +
  • [Fix] Corrected various bugs with CPF on multi-language boards (Bug #11803)
  • +
  • [Fix] Disable notify checkbox in posting editor when board email is disabled (Bug #12263)
  • +
  • [Fix] Removed maxlength from password/username fields (Bugs #12215, #11797)
  • +
  • [Fix] Use icon-unsubscribe in prosilver (Bug #12211)
  • +
  • [Fix] Seperated PREVIOUS/NEXT language vars for pagination and next/previous step (Bug #12197)
  • +
  • [Feature] append_sid() supporting anchor (Bug #11535) - patch provided by Schumi and ToonArmy
  • +
  • [Fix] Remember selected language while registering after submit (Bug #11435)
  • +
  • [Fix] UTF-8 support in theme and template editors (Bug #12251)
  • +
  • [Fix] Allow for posts per page in the MCP to change during topic selection (Bug #12067)
  • +
  • [Fix] Remove group avatars upon deletion from all profiles, not just the people having the group as default (Bug #12275, #12267)
  • +
  • [Fix] Allow for conversions to SQLite (Bug #12279) - patch provided by ToonArmy
  • +
  • [Fix] Apply colours to guests (Bug #12219)
  • +
  • [Fix] Set the Admin group as founder_manage during conversion (Bug #12287)
  • +
  • [Fix] Fixed a special quote BBCode case (Bug #12189)
  • +
  • [Fix] Correctly parse BBCodes in a post when a poll is being used (Bug #11833)
  • +
  • [Fix] Remember attached files on PM edit (Bug #12019)
  • +
  • [Fix] Correctly display poll ending on preview (Bug #12303)
  • +
  • [Feature] Display the success message on posting longer for posts awaiting approval (Bug #12053)
  • +
  • [Fix] Display maximum and entered number of characters for the "maximum number of characters exceeded" error messages (Bug #11981)
  • +
  • [Fix] Wrongly applied setting for allowing links in private messages (used the signature setting instead of the post setting) (Bug #11945)
  • +
  • [Fix] Unread flag for multipage topic wrongly set under some conditions (Bug #12127) - fix provided by asinshesq
  • +
  • [Fix] Able to delete posts within user prune panel (Bug #11849)
  • +
  • [Feature] Allow to specify dimensions of images manually on imageset config (Bug #11675)
  • +
  • [Fix] Correctly re-assign query result id after seeking rows (MSSQL/Firebird) (Bug #12369)
  • +
  • [Feature] Make effect of a changed hideonline permission instantaneous
  • +
  • [Fix] Do not overwrite larger memory values in the installer (Bug #12195)
  • +
  • [Fix] Order forums on role permission mask (Bug #12337)
  • +
  • [Fix] Show "no image" image when a non-selectable item was selected in the acp imageset editor - IE (Bug #12423)
  • +
  • [Fix] Update session information without new pageload (Bug #12393, Bug #12441)
  • +
  • [Fix] Let polls be edited correctly (Bug #12433)
  • +
  • [Fix] Overcome Oracle's inability to handle IN() clauses with over one thousand elements (Bug #12449)
  • +
  • [Fix] Simulate Firebird's affected rows mechanism for older versions of PHP
  • +
  • [Fix] Custom BBCodes properly handle lowercasing of parameterized tags (Bug #12377)
  • +
  • [Fix] Update the forum_id sequence for PostgreSQL during conversion (Bug #11927)
  • +
  • [Fix] Allow for multiple tags containing URL and LOCAL_URL tokens (Bug #12473)
  • +
  • [Fix] Properly display forum list in the MCP Queue (Bug #11313)
  • +
  • [Fix] Use the localised guest name for quotes (Bug #12483)
  • +
  • [Fix] Added post anchor to links in default warning message (Bug #12489)
  • +
  • [Fix] Allow 5 digits in editing time fields (Bug #12489)
  • +
  • [Fix] MS SQL DBAL drivers now write over extension limitations, they are too low for most installations (Bug #12415)
  • +
  • [Fix] Fix sorting by author on "unanswered posts" (Bug #12545)
  • +
  • [Fix] Allow searching for multibyte authors (Bug #11793)
  • +
  • [Fix] Writing directories/files with correct permissions using FTP for transfers on PHP4
  • +
  • [Fix] Oracle sequences during conversions are now corrected (Bug #12555)
  • +
  • [Fix] Allow users to continue after selecting "No" in the merge quickmod confirmation (Bug #12577)
  • +
  • [Fix] Correctly check permissions on the UCP subscription/bookmark pages (Bug #12595)
  • +
  • [Fix] Only convert non-orphaned PMs
  • +
  • [Fix] Fixed a few Postgres related errors (Bug #12587)
  • +
  • [Feature] New DBAL wrapper for LIKE expressions / sql_like_expression()
  • +
  • [Sec] Stricter validation of language entries.
  • + +
+ +
+ + + +
+
+ +
+ +

2. Copyright and disclaimer

+ +
+
+ +
+ +

phpBB is free software, released under the terms of the GNU General Public License, version 2 (GPL-2.0). Copyright © phpBB Limited. For full copyright and license information, please see the docs/CREDITS.txt file.

+ +
+ + + +
+
+ + + + +
+ +
+ +
+ + + diff --git a/sources/phpBB/docs/CREDITS.txt b/sources/phpBB/docs/CREDITS.txt new file mode 100644 index 0000000..5c17787 --- /dev/null +++ b/sources/phpBB/docs/CREDITS.txt @@ -0,0 +1,99 @@ +/** +* +* phpBB © Copyright phpBB Limited 2003-2014 +* http://www.phpbb.com +* +* phpBB is free software. You can redistribute it and/or modify it +* under the terms of the GNU General Public License, version 2 (GPL-2.0) +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* A copy of the license can be viewed in the docs/LICENSE.txt file. +* The same can be viewed at +* +*/ + + +phpBB Project Manager: Marshalrusty (Yuriy Rusko) + +phpBB Lead Developer: naderman (Nils Adermann) + +phpBB Developers: bantu (Andreas Fischer) + dhruv.goel92 (Dhruv Goel) + marc1706 (Marc Alexander) + nickvergessen (Joas Schilling) + nicofuma (Tristan Darricau) + prototech (Cesar Gallegos) + +For a list of phpBB Team members, please see: +http://www.phpbb.com/about/team/ + +For a full list of phpBB code contributors, please see: +https://github.com/phpbb/phpbb/graphs/contributors + +-- Former Developers -- + +phpBB Project Manager: theFinn (James Atkinson) [Founder - 04/2007] + SHS` (Jonathan Stanley) + +phpBB Lead Developer: Acyd Burn (Meik Sievertsen) [09/2005 - 01/2010] + psoTFX (Paul S. Owen) [2001 - 09/2005] + +phpBB Developers: A_Jelly_Doughnut (Josh Woody) [01/2010 - 11/2010] + Acyd Burn (Meik Sievertsen) [02/2003 - 09/2005] + APTX (Marek A. RuszczyÅ„ski) [12/2007 - 04/2011] + Arty (Vjacheslav Trushkin) [02/2012 - 07/2012] + Ashe (Ludovic Arnaud) [10/2002 - 11/2003, 06/2006 - 10/2006] + BartVB (Bart van Bragt) [11/2000 - 03/2006] + ckwalsh (Cullen Walsh) [01/2010 - 07/2011] + DavidMJ (David M.) [12/2005 - 08/2009] + dhn (Dominik Dröscher) [05/2007 - 01/2011] + EXreaction (Nathan Guse) [07/2012 - 05/2014] + GrahamJE (Graham Eames) [09/2005 - 11/2006] + igorw (Igor Wiedler) [08/2010 - 02/2013] + imkingdavid (David King) [11/2012 - 06/2014] + kellanved (Henry Sudhof) [04/2007 - 03/2011] + Oleg (Oleg Pudeyev) [01/2011 - 05/2013] + rxu (Ruslan Uzdenov) [04/2010 - 12/2012] + TerraFrost (Jim Wigginton) [04/2009 - 01/2011] + ToonArmy (Chris Smith) [06/2008 - 11/2011] + Vic D'Elfant (Vic D'Elfant) [04/2007 - 04/2009] + +Major contributions by: leviatan21 (Gabriel Vazquez) + NeoThermic (Ashley Pinner) + Raimon (Raimon Meuldijk) + Xore (Robert Hetzler) + +-- Copyrights -- + +Visual Confirmation: Xore (Robert Hetzler) + +Original subSilver by subBlue Design, Tom Beddard, (c) 2001 phpBB Limited +prosilver by subBlue Design, Tom Beddard, (c) 2004 phpBB Limited +subsilver2 by subBlue Design, Tom Beddard, (c) 2004 phpBB Limited + +phpBB contains code from the following applications: + +LGPL licenced: +Smarty (c) 2001, 2002 by ispi of Lincoln, Inc, http://smarty.php.net/ + +GPL licenced: +phpMyAdmin (c) 2001, 2003 phpMyAdmin Devel team, http://www.phpmyadmin.net/ +Jabber Class (c) 2006 Flyspray.org, http://www.flyspray.org/ +Chora (c) 2000-2006, The Horde Project. http://horde.org/chora/ +Horde Project (c) 2000-2006, The Horde Project. http://horde.org/ +jQuery (c) 2011, John Resig. http://jquery.com/ +Sphinx Technologies Inc (c) 2001-2012 Andrew Aksyonoff, http://sphinxsearch.com/ +Plupload (c) 2010-2013 Moxiecode Systems AB, http://www.plupload.com/ + +PHP License, version 3.0: +Pear (c) 2001-2004 PHP Group, http://pear.php.net + +Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff + +MIT licenced: +Symfony2 (c) 2004-2011 Fabien Potencier, http://symfony.com/ diff --git a/sources/phpBB/docs/FAQ.html b/sources/phpBB/docs/FAQ.html new file mode 100644 index 0000000..cd1ec4a --- /dev/null +++ b/sources/phpBB/docs/FAQ.html @@ -0,0 +1,345 @@ + + + + + + +phpBB • FAQ + + + + + + + +
+ + + + + +
+ + + +

This is a very basic Frequently Asked Questions (FAQ) page which attempts to answer some of the more commonly asked questions. It is by no means exhaustive and should be used in combination with the 'built-in' User FAQ within phpBB, the community forums and our IRC channel (see README for details).

+ +

FAQ

+ + + +
+ +

I am finding phpBB too difficult to install. Will you do it for me?

+ +
+
+ +
+ +

Simple answer, no we will not. We are not being difficult when we say this we are actually trying to help you. phpBB has a reputation for being easy to install, that reputation is we believe well deserved. It is a simple process of unarchiving a single file, uploading the resulting directory/files to their intended location and entering some data in a web based form. The sequence of events, what to type where, etc. is covered in detail in the accompanying INSTALL.html documentation. If you cannot install phpBB the chances are you will be unable to administer or update it.

+ +

There are people, companies (unrelated to your hosting provider), etc. that will install your forum, either for free or for a payment. We do not recommend you make use of these offers. Unless the service is provided by your hosting company you will have to divulge passwords and other sensitive details. If you did not know how to use an ATM would you give a passer-by your bank card and PIN and ask them to show you what to do? No, probably not! The same applies to your hosting account details!

+ +

We think a better solution is for you to carefully read the enclosed documentation, read through our knowledge base at www.phpbb.com and if necessary ask for help on any thing you get stuck on. However, the decision is yours but please note we may not offer support if we believe you have had the board installed by a third party. In such cases you should direct your questions to that company or person/s.

+ +
+ + + +
+
+ +
+ +

I am having problems with the admin at a certain board, help!
+A board has ripped off my graphics/software/etc., stop them!
+A board is dealing in warez/porn/etc., you need to prevent them doing this!
+I want to sue you because i think you host an illegal board!

+ +
+
+ +
+ +

We provide the software, we have absolutely nothing to do with any board that runs it (beyond phpbb.com of course!) and we also do not host any site. The GPL grants the user an unlimited right of use subject to their adherence of that license. Therefore we cannot prevent, dictate, control or otherwise limit the use of phpBB software. So please do not contact us for such matters.

+ +

If you have a problem with a given board please take it up with them, not us. We are not and cannot be held legally responsible for any third party use of this software (much like Microsoft et al cannot be held responsible for the use of Windows in illegal activities, etc.). Additionally we do not track the use of phpBB software in any way. So please do not ask us for details on a "given" board we will not be able to help you. If any law firms or lawyers out there send us writs, cease and desist orders, etc. for third party website use of this software we reserve the right to charge for time wasted dealing with such issues...

+ +
+ + + +
+
+ +
+ +

According to viewonline a user is doing/reading something they should not be able to!

+ +
+
+ +
+ +

No, they probably are not. phpBB uses sessions to keep track of users as they move between pages. The session information tells us who this user is. Therefore in order to determine what a user can do on a page we first need the session details. Once this data is available we can check whether the user is permitted to do whatever it is they are trying to do. This can result in it appearing as if a user is reading a topic in a forum they should not be able to access. Or perhaps viewing private messages when they are only guests, etc. In practice the user is not doing these things, they are viewing a "You are not permitted to do this" type message. The session data has simply been updated before we were able to determine what the user could or could not do.

+ +

Of course this only applies where permissions have been set correctly!

+ +
+ + + +
+
+ +
+ +

I keep getting Mail sending errors when I (or my users) post/send PM's/etc.!

+ +
+
+ +
+ +

This error will occur if phpBB cannot send mail. phpBB can send email two ways; using the PHP mail() function or directly via SMTP. Some hosting providers limit the mail() function to prevent its use in spamming, others may rename it or limit its functionality. If the mail() function got renamed, you are able to enter the correct name within the administration control panel. In either case you may need to make use of SMTP. This requires that you have access to such a facility, e.g. your hosting provider may provide one (perhaps requiring specific written authorisation), etc. Please see www.phpbb.com for additional help on this matter.

+ +

If you do require SMTP services please do not ask (on our forums or elsewhere) for someone to provide you with one. Open relays are now things of the past thanks to the unthinking spammers out there. Therefore you are unlikely to find someone willing to offer you (free) services.

+ +
+ + + +
+
+ +
+ +

My users are complaining that emails are not in their selected language!

+ +
+
+ +
+ +

You must have deleted a language pack or the language pack is incomplete. phpBB will try to send emails in the users selected language. If it cannot find a suitable email template it will switch to the boards default language.

+ + + +
+ + + +
+
+ +
+ +

My AOL based users keep getting logged out!

+ +
+
+ +
+ +

phpBB uses sessions to keep track of users as they browse the board. These sessions use a combination of a unique session id, the users IP and if specified the users browser and/or the users x-forwarded-for header to identify each user. We make use of all of this as an extra safe-guard to help prevent sessions being hijacked (by discovering the unique session id).

+ +

Unfortunately this only works when the users IP is constant as they browse the board. For most users this will be the case. However certain providers route their users via a cluster of proxys. In some cases, particularly the AOL browser, this results in different IPs being forwarded as the user moves between pages. We take account of this by not checking the entire IP by default but only the first "three quads" (A.B.C). Again in most cases this will be fine. However again AOL uses IPs which can vary so much that checking only the first two quads results in a fairly static IP being available for session validation.

+ +

If you are experiencing problems related to this you can set the Session IP validation parameter found in Admin->General->Server Configuration->Security Settings to A.B. Please note that reducing the IP validation length does potentially increase the risk of sessions being hijacked (this is something for you to consider, phpBB Limited takes no responsibility should anything happen!). We suggest to at least additionally enable the browser validation.

+ +
+ + + +
+
+ +
+ +

I am unable to upload avatars from my computer, regardless of the settings.

+ +
+
+ +
+ +

There are two possibilities here, the first is you have not created the directory you specified as the storage location for avatars, ie. as specified in the Admin -> General -> Board Configuration -> Avatar settings section. If the directory does not exist uploadeable avatars are automatically disabled. You should create the required directory (ensuring it has global write access or other appropriate permissions to allow the webserver to write files to it).

+ +

The second possibility is that your provider has disabled file_upload support. You should contact your provider and ask them if this is the case. There is not a lot you can do, there are still three other avatar settings left to choose from including uploading via an URL which will work fine.

+ +
+ + + +
+
+ +
+ +

I just cannot get gallery avatars to appear!

+ +
+
+ +
+ +

phpBB categorises gallery avatars and it does this by reading through folders contained in the location you specified as being the gallery path. For example, if you set the gallery path to images/avatars/gallery phpBB will expect to find a series of folders within that path, e.g. images/avatars/gallery/moviestars, images/avatars/gallery/cartoons, images/avatars/gallery/misc, etc. Placing images directly in images/avatars/gallery/ will result in nothing being listed in your gallery.

+ +
+ + + +
+
+ +
+ +

How do I use/set permissions?

+ +
+
+ +
+ +

Please read the paragraph about permissions in our extensive online documentation.

+ +
+ + + +
+
+ +
+ +

I (or my users) cannot stay logged in to the forum!

+ +
+
+ +
+ +

If you (or your users) are, after attempting a login, being returned to the index (or other page) without appearing to be logged in the most likely problem is incorrect cookie settings. phpBB uses cookies to store a session id and a small amount of user data. For this data to be stored correctly the cookie domain, name, path and secure settings must be correct. You can check this in Admin->General->Server Configuration->Cookie Settings. Typically the cookie domain can be left blank and the cookie path set to / (a single forward slash). Do not set the cookie as being secure unless your board is running over a secure sockets layer connection, ie. https://

+ +

If you still have problems try setting the cookie domain to your full domain name, e.g. www.mysystem.tld, www.something.mydomain.tld. You must ensure the domain name contains at least two dots or browsers will be unlikely to recognise the cookie, e.g. .mydomain.com, mydomain.com. Do not add http:// or anything else to the domain name!

+ +
+ + + +
+
+ +
+ +

My users are complaining about being logged out too quickly!

+ +
+
+ +
+ +

You can increase the default length of sessions (ie. how long before a users session is considered 'dead') in Admin->General->Server Configuration->Load Settings. Set it to whatever value your users feel comfortable with, remember that security issues may affect your decision (ie. having too long a session may allow non-users to abuse your board should a user forget to logout or otherwise leave a current session on a public workstation).

+ +
+ + + +
+
+ +
+ +

My question isn't answered here!

+ +
+
+ +
+ +

Please read our extensive user documentation first, it may just explain what you want to know.

+ +

Feel free to search our community forum for the information you require. PLEASE DO NOT post your question without having first used search, chances are someone has already asked and answered your question. You can find our board here:

+ +

www.phpbb.com

+ +
+ + + +
+
+ +
+ +

Copyright and disclaimer

+ +
+
+ +
+ +

phpBB is free software, released under the terms of the GNU General Public License, version 2 (GPL-2.0). Copyright © phpBB Limited. For full copyright and license information, please see the docs/CREDITS.txt file.

+ +
+ + + +
+
+ + + + +
+ +
+ +
+ + + diff --git a/sources/phpBB/docs/INSTALL.html b/sources/phpBB/docs/INSTALL.html new file mode 100644 index 0000000..df86391 --- /dev/null +++ b/sources/phpBB/docs/INSTALL.html @@ -0,0 +1,508 @@ + + + + + + +phpBB • Install + + + + + + + +
+ + + + + +
+ + + +

Please read this document completely before proceeding with installation, updating or converting.

+ +

This document will walk you through the basics on installing, updating and converting the forum software.

+ +

A basic overview of running phpBB can be found in the accompanying README file. Please ensure you read that document in addition to this! For more detailed information on using, installing, updating and converting phpBB you should read the documentation available online.

+ +

Install

+ + + +
+ +

1. Quick install

+ +
+
+ +
+ +

If you have basic knowledge of using FTP and are sure your hosting service or server will run phpBB3 you can use these steps to quickly get started. For a more detailed explanation you should skip this and go to section 2 below.

+ +
    +
  1. Decompress the phpBB3 archive to a local directory on your system.
  2. +
  3. Upload all the files contained in this archive (retaining the directory structure) to a web accessible directory on your server or hosting account.
  4. +
  5. Change the permissions on config.php to be writable by all (666 or -rw-rw-rw- within your FTP Client)
  6. +
  7. Change the permissions on the following directories to be writable by all (777 or -rwxrwxrwx within your FTP Client):
    + store/, cache/, files/ and images/avatars/upload/.
  8. +
  9. Point your web browser to the location where you uploaded the phpBB3 files with the addition of install/index.php or simply install/, e.g. http://www.example.com/phpBB3/install/index.php, http://www.example.com/forum/install/.
  10. +
  11. Click the INSTALL tab, follow the steps and fill out all the requested information.
  12. +
  13. Change the permissions on config.php to be writable only by yourself (644 or -rw-r--r-- within your FTP Client)
  14. +
  15. phpBB3 should now be available, please MAKE SURE you read at least Section 6 below for important, security related post-installation instructions, and also take note of Section 7 regarding anti-spam measures.
  16. +
+ +

If you experienced problems or do not know how to proceed with any of the steps above please read the rest of this document.

+ +
+ + + +
+
+ +
+ +

2. Requirements

+ +
+
+ +
+ +

phpBB 3.1.x has a few requirements which must be met before you are able to install and use it.

+ +
    +
  • A webserver or web hosting account running on any major Operating System with support for PHP
  • +
  • A SQL database system, one of: +
      +
    • MySQL 3.23 or above (MySQLi supported)
    • +
    • MariaDB 5.1 or above
    • +
    • PostgreSQL 8.3+
    • +
    • SQLite 2.8.2+
    • +
    • SQLite 3.6.15+
    • +
    • MS SQL Server 2000 or above (directly or via ODBC or the native adapter)
    • +
    • Oracle
    • +
    +
  • +
  • PHP 5.3.3+ with support for the database you intend to use.
  • +
  • The following PHP modules are required: +
      +
    • json
    • +
    +
  • +
  • getimagesize() function must be enabled.
  • +
  • Presence of the following modules within PHP will provide access to additional features, but they are not required: +
      +
    • zlib Compression support
    • +
    • Remote FTP support
    • +
    • XML support
    • +
    • Imagemagick support
    • +
    • GD Support
    • +
    +
  • +
+ +

If your server or hosting account does not meet the requirements above then you will be unable to install phpBB 3.1.x.

+ +
+ + + +
+
+ +
+ +

3. New installation

+ +
+
+ +
+ +

Installation of phpBB will vary according to your server and database. If you have shell access to your account (via telnet or ssh for example) you may want to upload the entire phpBB archive (in binary mode!) to a directory on your host and unarchive it there.

+ +

If you do not have shell access or do not wish to use it, you will need to decompress the phpBB archive to a local directory on your system using your favourite compression program, e.g. winzip, rar, zip, etc. From there you must FTP ALL the files it contains (being sure to retain the directory structure and filenames) to your host. Please ensure that the cases of filenames are retained, do NOT force filenames to all lower or upper case as doing so will cause errors later.

+ +

All .php, .sql, .cfg, .css, .js, .html, .htaccess and .txt files should be uploaded in ASCII mode, while all graphics should be uploaded in BINARY mode. If you are unfamiliar with what this means please refer to your FTP client documentation. In most cases this is all handled transparantly by your ftp client, but if you encounter problems later you should be sure the files were uploaded correctly as described here.

+ +

phpBB comes supplied with British English as its standard language. However, a number of separate packs for different languages are available. If you are not a native English speaker you may wish to install one or more of these packages before continuing. The installation process below will allow you to select a default language from those available (you can, of course, change this default at a later stage). For more details on language packs, where to obtain them and how to install them please see the README.

+ +

Once all the files have been uploaded to your site, you should point your browser at this location with the addition of /install/. For example, if your domain name is www.example.com and you placed the phpBB files in the directory /phpBB3 off your web root you would enter http://www.example.com/phpBB3/install/ or (alternatively) http://www.example.com/phpBB3/install/index.php into your browser. When you have done this, you should see the phpBB Introduction screen appear.

+ +

Introduction:

+ +

The initial screen gives you a short introduction into phpBB. It allows you to read the license phpBB is released under (General Public License v2) and provides information about how you can receive support. To start the installation, use the INSTALL tab.

+ +

Requirements

+ +

The first page you will see after starting the installation is the Requirements list. phpBB automatically checks whether everything that it needs to run properly is installed on your server. You need to have at least the minimum PHP version installed, and at least one database available to continue the installation. Also important, is that all shown folders are available and have the correct permissions. Please see the description of each section to find out whether they are optional or required for phpBB to run. If everything is in order, you can continue the installation with Start Install.

+ +

Database settings

+ +

You now have to decide which database to use. See the Requirements section for information on which databases are supported. 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:

+ +
    +
  • The Database Type - the database you will be using.
  • +
  • The Database server hostname or DSN - the address of the database server.
  • +
  • The Database server port - the port of the database server (most of the time this is not needed).
  • +
  • The Database name - the name of the database on the server.
  • +
  • The Database username and Database password - the login data to access the database.
  • +
+ +
+

Note: 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.

+
+ +

You don't need to change the Prefix for tables in database setting, unless you plan on using multipe phpBB installations on one database. In this case, you can use a different prefix for each installation to make it work.

+ +

After you entered your details, you can continue with the Proceed to next step button. Now phpBB will check whether the data you entered will lead to a successful database connection and whether tables with the same prefix already exist.

+ +

A Could not connect to the database error means that you didn't enter the database data correctly and it is not possible for phpBB to connect. Make sure that everything you entered is in order and try again. Again, if you are unsure about your database settings, please contact your host.

+ +

If you installed another version of phpBB before on the same database with the same prefix, phpBB will inform you and you just need to enter a different database prefix.

+ +

If you see the Successful Connection message, you can continue to the next step.

+ +

Administrator details

+ +

Now you have to create your administration user. This user will have full administration access and he/she will be the first user on your forum. All fields on this page are required. You can also set the default language of your forum on this page. In a vanilla phpBB installation, we only include British English. You can download further languages from www.phpbb.com, and add them before installing or later.

+ +

Configuration file

+ +

In this step, phpBB will try to write the configuration file automatically. The forum needs the configuration file in order to operate. It contains all the database settings, so without it, phpBB will not be able to access the database.

+ +

Usually, writing the configuration file automatically works fine. If the file permissions are not set correctly, this process can fail. In this case, you need to upload the file manually. phpBB asks you to download the config.php file and tells you what to do with it. Please read the instructions carefully. After you have uploaded the file, use Done to get to the last step. If Done returns you to the same page as before, and does not return a success message, you did not upload the file correctly.

+ +

Advanced settings

+ +

The Advanced settings allow you to set additional parameters of the board configuration. They are optional and you can always change them later. So, even if you are not sure what these settings mean, you can still proceed to the final step and finish the installation.

+ +

If the installation was successful, you can now use the Login button to visit the Administration Control Panel. Congratulations, you have installed phpBB successfully. But there is still work ahead!

+ +

If you are unable to get phpBB installed even after reading this guide, please look at the support section of the installer's introduction page to find out where you can ask for further assistance.

+ +

At this point if you are converting from phpBB 2.0.x, you should refer to the conversion steps for further information. If not, you should remove the install directory from your server as you will only be able to access the Administration Control Panel whilst it is present.

+ +
+ + + +
+
+ +
+ +

4. Updating from stable releases of phpBB 3.1.x

+ +
+
+ +
+ +

If you are currently using a stable release of phpBB, updating to this version is straightforward. You would have downloaded one of four packages and your choice determines what you need to do. Note: Before updating, we heavily recommend you do a full backup of your database and existing phpBB files! If you are unsure how to achieve this please ask your hosting provider for advice.

+ +

Please make sure you update your phpBB source files too, even if you run the database_update.php file.

+ +

4.i. Full package

+ +

The full package is normally meant for new installations only, but if you want to replace all source files, this package comes in handy.

+ +

First, you should make a copy of your existing config.php file; keep it in a safe place! Next, delete all the existing phpBB files, you may want to leave your files/ and images/ directories in place. You can leave alternative styles in place too. With this complete, you can upload the new phpBB files (see New installation for details if necessary). Once complete, copy back your saved config.php, replacing the new one. Another method is to just replace the existing files with the files from the full package - though make sure you do not overwrite your config.php file.

+ +

You should now run install/database_update.php which, depending on your previous version, will make a number of database changes. You may receive FAILURES during this procedure. They should not be a cause for concern unless you see an actual ERROR, in which case the script will stop (in this case you should seek help via our forums or bug tracker).

+ +

Once install/database_update.php has completed, you may proceed to the Administration Control Panel and then remove the install directory as advised.

+ +

4.ii. Changed files

+ +

This package is meant for those wanting to only replace the files that were changed between a previous version and the latest version.

+ +

This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have 3.1.0 you should select the appropriate phpBB-3.1.1-files.zip/tar.bz2 file.

+ +

The directory structure has been preserved, enabling you (if you wish) to simply upload the uncompressed contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any modifications (MODs) these files will overwrite the originals, possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.

+ +

As for the other update procedures, you should run install/database_update.php after you have finished updating the files. This will update your database schema and increment the version number.

+ +

4.iii. Patch file

+ +

The patch file package is for those wanting to update through the patch application, and should only be used by those who are comfortable with it.

+ +

The patch file is one solution for those with many Modifications (MODs) or other changes and do not want to re-add them back to all the changed files. To use this you will need command line access to a standard UNIX type patch application. If you do not have access to such an application, but still want to use this update approach, we strongly recommend the Automatic update package explained below. It is also the recommended update method.

+ +

A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is 3.1.0, you need the phpBB-3.1.1-patch.zip/tar.bz2 file. Place the correct patch in the parent directory containing the phpBB core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: patch -cl -d [PHPBB DIRECTORY] -p1 < [PATCH NAME] (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.

+ +

If you do get failures, you should look at using the Changed Files package to replace the files which failed to patch. Please note that you will need to manually re-add any MODs to these particular files. Alternatively, if you know how, you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.

+ +

You should, of course, delete the patch file (or files) after use. As for the other update procedures, you should run install/database_update.php after you have finished updating the files. This will update your database schema and data (if appropriate) and increment the version number.

+ +

4.iv. Automatic update package

+ +

This update method is the recommended method for updating. This package detects changed files automatically and merges in changes if needed.

+ +

The automatic update package will update the board from a given version to the latest version. A number of automatic update files are available, and you should choose the one that corresponds to the version of the board that you are currently running. For example, if your current version is 3.0.12, you need the phpBB-3.0.12_to_3.0.13.zip/tar.bz2 file.

+ +

To perform the update, either follow the instructions from the Administration Control Panel->System Tab - this should point out that you are running an outdated version and will guide you through the update - or follow the instructions listed below.

+ +
    +
  • Go to the downloads page and download the latest update package listed there, matching your current version.
  • +
  • Upload the uncompressed archive contents to your phpBB installation - only the install/ and vendor/ folders are required. Upload these folders in their entirety, retaining the file structure.
  • +
  • After the install folder is present, phpBB will go offline automatically.
  • +
  • Point your browser to the install directory, for example http://www.example.com/phpBB3/install/
  • +
  • Choose the "Update" Tab and follow the instructions
  • +
+ +

 

+ +

4.v. All package types

+ +

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.

+ +

These update methods will only update the standard styles, prosilver and subsilver2, any other styles you have installed for your board will usually also need to be updated.

+ +
+ + + +
+
+ +
+ +

5. Updating from phpBB 3.0.x to phpBB 3.1.x

+ +
+
+ +
+ +

Updating from phpBB 3.0.x to 3.1.x is just the same as updating from stable releases of phpBB 3.1.x

+ +

However you can also start with a new set of phpBB 3.1.x files.

+ +
    +
  1. Delete all files EXCEPT for the following: + +
      +
    • The config.php file
    • +
    • The images/ directory
    • +
    • The files/ directory
    • +
    • The store/ directory
    • +
  2. + +
  3. Upload the contents of the 3.1.x Full Package into your forum's directory. Make sure the root level .htaccess file is included in the upload.
  4. +
  5. Browse to install/database_update.php
  6. +
  7. Delete the install/ directory
  8. +
+
+ + + +
+
+ +
+ +

6. Conversion from phpBB 2.0.x to phpBB 3.1.x

+ +
+
+ +
+ +

This paragraph explains the steps necessary to convert your existing phpBB2 installation to phpBB3.

+ +

5.i. Requirements before converting

+ +

Before converting, we heavily recommend you do a full backup of your database and files! If you are unsure how to achieve this, please ask your hosting provider for advice. You basically need to follow the instructions given for New installations. Please do not overwrite any old files - install phpBB3 at a different location.

+ +

Once you made a backup of everything and also have a brand new phpBB3 installation, you can now begin the conversion.

+ +

Note that the conversion requires CREATE and DROP privileges for the phpBB3 database user account.

+ +

5.ii. Converting

+ +

To begin the conversion, visit the install/ folder of your phpBB3 installation (the same as you have done for installing). Now you will see a new tab Convert. Click this tab.

+ +

As with install, the conversion is automated. Your previous 2.0.x database tables will not be changed and the original 2.0.x files will remain unaltered. The conversion is actually only filling your phpBB3 database tables and copying additional data over to your phpBB3 installation. This has the benefit that if something goes wrong, you are able to either re-run the conversion or continue a conversion, while your old board is still accessible. We really recommend that you disable your old installation while converting, else you may have inconsistent data after the conversion.

+ +

Please note that this conversion process may take quite some time and depending on your hosting provider this may result in it failing (due to web server resource limits or other timeout issues). If this is the case, you should ask your provider if they are willing to allow the convert script to temporarily exceed their limits (be nice and they will probably be quite helpful). If your host is unwilling to increase the limits to run the convertor, please see this article for performing the conversion on your local machine: Knowledge Base - Offline Conversions

+ +

Once completed, your board should be immediately available. If you encountered errors, you should report the problems to our bug tracker or seek help via our forums (see README for details).

+ +

5.iii. Things to do after conversion

+ +

After a successful conversion, there may be a few items you need to do - apart from checking if the installation is accessible and everything displayed correctly.

+ +

The first thing you may want to do is to go to the administration control panel and check every configuration item within the general tab. Thereafter, you may want to adjust the forum descriptions/names if you entered HTML there. You also may want to access the other administrative sections, e.g. adjusting permissions, smilies, icons, ranks, etc.

+ +

During the conversion, the search index is not created or transferred. This means after conversion you are not able to find any matches if you want to search for something. We recommend you rebuild your search index within Administration Control Panel -> Maintenance -> Database -> Search Index.

+ +

After verifying the settings in the ACP, you can delete the install directory to enable the board. The board will stay disabled until you do so.

+ +

Once you are pleased with your new installation, you may want to give it the name of your old installation, changing the directory name. With phpBB3 this is possible without any problems, but you may still want to check your cookie settings within the administration panel; in case your cookie path needs to be adjusted prior to renaming.

+ +

5.iv. Common conversion problems

+ +

Broken non-latin characters The conversion script assumes that the database encoding in the source phpBB2 matches the encoding defined in the lang_main.php file of the default language pack of the source installation. Edit that file to match the database's encoding and re-start the conversion procedure.

+ +

http 500 / white pages The conversion is a load-heavy procedure. Restrictions imposed by some server hosting providers can cause problems. The most common causes are: values too low for the PHP settings memory_limit and max_execution_time. Limits on the allowed CPU time are also a frequent cause for such errors, as are limits on the number of database queries allowed. If you cannot change such settings, then contact your hosting provider or run the conversion procedure on a different computer. The phpBB.com forums are also an excellent location to ask for support.

+ +

Password conversion Due to the utf-8 based handling of passwords in phpBB3, it is not always possible to transfer all passwords. For passwords "lost in translation" the easiest workaround is to use the I forgot my password link on the login page.

+ +

Path to your former board The convertor expects the relative path to your old board's files. So, for instance, if the old board is located at http://www.yourdomain.com/forum and the phpBB3 installation is located at http://www.yourdomain.com/phpBB3, then the correct value would be ../forum. Note that the webserver user must be able to access the source installation's files.

+ +

Missing images If your default board language's language pack does not include all images, then some images might be missing in your installation. Always use a complete language pack as default language.

+ +

Smilies During the conversion you might see warnings about image files where the copying failed. This can happen if the old board's smilies have the same file names as those on the new board. Copy those files manually after the conversion, if you want to continue using the old smilies.

+ + +
+ + + +
+
+ +
+ +

7. Important (security related) post-Install tasks for all installation methods

+ +
+
+ +
+ +

Once you have successfully installed phpBB you MUST ensure you remove the entire install/ directory. Leaving the install directory in place is a very serious potential security issue which may lead to deletion or alteration of files, etc. Please note that until this directory is removed, phpBB will not operate and a warning message will be displayed. Beyond this essential deletion, you may also wish to delete the docs/ directory if you wish.

+ +

With these directories deleted, you should proceed to the administration panel. Depending on how the installation completed, you may have been directed there automatically. If not, login as the administrator you specified during install/conversion and click the Administration Control Panel link at the bottom of any page. Ensure that details specified on the General tab are correct!

+ +

6.i. Uploadable avatars

+ +

phpBB supports several methods for allowing users to select their own avatar (an avatar is a small image generally unique to a user and displayed just below their username in posts).

+ +

Two of these options allow users to upload an avatar from their machine or a remote location (via a URL). If you wish to enable this function you should first ensure the correct path for uploadable avatars is set in Administration Control Panel -> General -> Board Configuration -> Avatar settings. By default this is images/avatars/uploads, but you can set it to whatever you like, just ensure the configuration setting is updated. You must also ensure this directory can be written to by the webserver. Usually this means you have to alter its permissions to allow anyone to read and write to it. Exactly how you should do this depends on your FTP client or server operating system.

+ +

On UNIX systems, for example, you set the directory to a+rwx (or ugo+rwx or even 777). This can be done from a command line on your server using chmod or via your FTP client (using the Change Permissions, chmod or other Permissions dialog box, see your FTP client's documentation for help). Most FTP clients list permissions in the form of User (Read, Write, Execute), Group (Read, Write, Execute) and Other (Read, Write, Execute). You need to tick all of these boxes to set correct permissions.

+ +

On Windows systems, you need to ensure the directory is not write-protected and that it has global write permissions (see your server's documentation or contact your hosting provider if you are unsure on how to achieve this).

+ +

Please be aware that setting a directory's permissions to global write access is a potential security issue. While it is unlikely that anything nasty will occur (such as all the avatars being deleted) there are always people out there to cause trouble. Therefore you should monitor this directory and if possible make regular backups.

+ +

6.ii. Webserver configuration

+ +

Depending on your web server, you may have to configure your server to deny web access to the cache/, files/, store/ and other directories. This is to prevent users from accessing sensitive files.

+ +

For Apache there are .htaccess files already in place to do this for you. Similarly, for Windows based servers using IIS there are web.config files already in place to do this for you. For other webservers, you will have to adjust the configuration yourself. Sample files for nginx and lighttpd to help you get started may be found in docs/ directory.

+ +
+ + + +
+
+ +
+ +

8. Anti-Spam Measures

+ +
+
+ +
+

Like any online site that allows user input, your board could be subject to unwanted posts; often referred to as forum spam. The vast majority of these attacks will be from automated computer programs known as spambots. The attacks, generally, are not personal as the spammers are just trying to find accessible targets. phpBB has a number of anti-spam measures built in, including a range of CAPTCHAs. However, administrators are strongly urged to read and follow the advice for Preventing Spam in phpBB as soon as possible after completing the installation of your board.

+
+ + + +
+
+ +
+ +

9. Copyright and disclaimer

+ +
+
+ +
+ +

phpBB is free software, released under the terms of the GNU General Public License, version 2 (GPL-2.0). Copyright © phpBB Limited. For full copyright and license information, please see the docs/CREDITS.txt file.

+ +
+ + + +
+
+ + + + +
+ +
+ +
+ + + diff --git a/sources/phpBB/docs/LICENSE.txt b/sources/phpBB/docs/LICENSE.txt new file mode 100644 index 0000000..ce992b2 --- /dev/null +++ b/sources/phpBB/docs/LICENSE.txt @@ -0,0 +1,281 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + diff --git a/sources/phpBB/docs/README.html b/sources/phpBB/docs/README.html new file mode 100644 index 0000000..b66f471 --- /dev/null +++ b/sources/phpBB/docs/README.html @@ -0,0 +1,369 @@ + + + + + + +phpBB • Readme + + + + + + + +
+ + + + + +
+ + + +

Thank you for downloading phpBB. This README will guide you through the basics of installation and operation of phpBB. Please ensure you read this and the accompanying documentation fully before proceeding with the installation.

+ +

Readme

+ + + +
+ +

1. Installing phpBB

+ +
+
+ +
+

Installation, update and conversion instructions can be found in the INSTALL document in this directory. If you are intending on converting from a phpBB 2.0.x or 3.0.x installation we highly recommend that you backup any existing data before proceeding!

+ +

Users of phpBB 3.0 and 3.1 Beta versions cannot directly update.

+ +

Please note that we don't support the following installation types:

+
    +
  • Updates from phpBB 3.0 Beta versions to phpBB 3.0 RC1 and higher
  • +
  • Updates from phpBB 3.1 Beta versions to phpBB 3.1 RC1 and higher
  • +
  • Conversions from phpBB 2.0.x to phpBB 3.0 or 3.1 Beta versions
  • +
  • phpBB 3.0 or 3.1 Beta installations
  • +
+ +

We give support for the following installation types:

+ +
    +
  • Updates from phpBB 3.0 RC1 and 3.1 RC1 to the latest version
  • +
  • Note: if using the Automatic Update Package, updates are supported from phpBB 3.0.2 onward. To update a pre-3.0.2 installation, first update to 3.0.2 and then update to the current version.
  • +
  • Conversions from phpBB 2.0.x to the latest version
  • +
  • New installations of phpBB 3.0.x - only the latest released version
  • +
  • New installations of phpBB 3.1.x - only the latest released version
  • +
+ +
+ + + +
+
+ +
+ +

2. Running phpBB

+ +
+
+ +
+ +

Once installed, phpBB is easily managed via the Administration and Moderator Control Panels. If you need help or advice with phpBB, please see Section 3 below.

+ +

2.i. Languages (Internationalisation - i18n)

+ +

A number of language packs with included style localisations are available. You can find them listed in the Language Packs pages of our downloads section or from the Language Packs section of the Customisation Database.

+ +

For more information about language packs, please see: https://www.phpbb.com/languages/

+ +

This is the official location for all supported language sets. If you download a package from a 3rd party site you do so with the understanding that we cannot offer support. Please do not ask for support if you download a language pack from a 3rd party site.

+ +

Installation of these packages is straightforward: simply download the required language pack, uncompress (unzip) it and via FTP transfer the included language and styles folders to the root of your board installation. The language can then be installed via the Administration Control Panel of your board: Customise tab -> Language management -> Language packs. A more detailed description of the process is in the Knowledge Base article, How to Install a Language Pack.

+ +

If your language is not available, please visit our [3.1.x] Translations forum where you will find topics on translations in progress. Should you wish to volunteer to translate a language not currently available or assist in maintaining an existing language pack, you can Apply to become a translator.

+ +

2.ii. Styles

+ +

Although we are rather proud of the included styles, we realise that they may not be to everyone's taste. Therefore, phpBB allows styles to be switched with relative ease. First, you need to locate and download a style you like. You can find them listed in the Styles section of our Customisation Database.

+ +

For more information about styles, please see: https://www.phpbb.com/styles/

+ +

Please note that 3rd party styles downloaded for versions of phpBB2 will not work in phpBB3. It is also important to ensure that the style is updated to match the current version of the phpBB software you are using.

+ +

Once you have downloaded a style, the usual next step is to unarchive (or upload the unarchived contents of) the package into your styles/ directory. You then need to visit Administration Control Panel -> Customise tab -> Style management -> Install Styles where you should see the new style available. Click "Install style" to install the style.

+ +

Please note that to improve efficiency, the software caches certain data. For this reason, if you create your own style or modify existing ones, please remember to purge the board cache by clicking the Run now button next to the Purge the cache option in the index page of the Administration Control Panel. You may also need to reload the page you have changed in your web browser to overcome browser caching. If the cache is not purged, you will not see your changes taking effect.

+ +

2.iii. Extensions

+ +

We are proud to have a thriving extensions community. These third party extensions to the standard phpBB software, extend its capabilities still further. You can browse through many of the extensions in the Extensions section of our Customisation Database.

+ +

For more information about extensions, please see: https://www.phpbb.com/extensions

+ +

Please remember that any bugs or other issues that occur after you have added any extension should NOT be reported to the bug tracker (see below). First disable the extension and see if the problem is resolved. Any support for an extension should only be sought in the "Discussion/Support" forum for that extension.

+ +

Also remember that any extensions which modify the database in any way, may render upgrading your forum to future versions more difficult.

+ +
+ + + +
+
+ +
+ +

3. Getting help with phpBB

+ +
+
+ +
+ +

phpBB can sometimes seem a little daunting to new users, particularly with regards to the permission system. The first thing you should do is check the FAQ, which covers a few basic getting started questions. If you need additional help there are several places you can find it.

+ +

3.i. phpBB Documentation

+ +

Comprehensive documentation is now available on the phpBB website:

+ +

https://www.phpbb.com/support/docs/en/3.1/ug/

+ +

This covers everything from installation to setting permissions and managing users.

+ +

3.ii. Knowledge Base

+ +

The Knowledge Base consists of a number of detailed articles on some common issues phpBB users may encounter while using the product. The Knowledge Base can be found at:

+ +

https://www.phpbb.com/kb/

+ +

3.iii. Community Forums

+ +

The phpBB project maintains a thriving community where a number of people have generously decided to donate their time to help support users. This site can be found at:

+ +

https://www.phpbb.com/community/

+ +

If you do seek help via our forums please be sure to do a search before posting; if someone has experienced the issue before, then you may find that your question has already been answered. Please remember that phpBB is entirely staffed by volunteers, no one receives any compensation for the time they give, including moderators as well as developers; please be respectful and mindful when awaiting responses and receiving support.

+ +

3.iv Internet Relay Chat

+ +

Another place you may find help is our IRC channel. This operates on the Freenode IRC network, irc.freenode.net and the channel is #phpbb and can be accessed by any decent IRC client such as mIRC, XChat, etc. Again, please do not abuse this service and be respectful of other users.

+ +

There are other IRC channels available, please see https://www.phpbb.com/support/irc/ for the complete list.

+ +
+ + + +
+
+ +
+ +

4. Status of this version

+ +
+
+ +
+ +

This is a stable release of phpBB. The 3.1.x line is feature frozen, with point releases principally including fixes for bugs and security issues. Feature alterations and minor feature additions may be done if deemed absolutely required. The next major release will be phpBB 3.2 which is currently under development. Please do not post questions asking when 3.2 will be available, no release date has been set.

+ +

Those interested in the development of phpBB should keep an eye on the development forums to see how things are progressing:

+ +

http://area51.phpbb.com/phpBB/

+ +

Please note that the development forums should NOT be used to seek support for phpBB, the main community forums are the place for this.

+ +
+ + + +
+
+ +
+ +

5. Reporting Bugs

+ +
+
+ +
+ +

The phpBB developers use a bug tracking system to store, list and manage all reported bugs, it can be found at the location listed below. Please DO NOT post bug reports to our forums. In addition please DO NOT use the bug tracker for support requests. Posting such a request will only see you directed to the support forums (while taking time away from working on real bugs).

+ +

http://tracker.phpbb.com/browse/PHPBB3

+ +

While we very much appreciate receiving bug reports (the more reports the more stable phpBB will be) we ask you carry out a few steps before adding new entries:

+ +
    +
  • First, determine if your bug is reproduceable; how to determine this depends on the bug in question. Only if the bug is reproduceable is it likely to be a problem with phpBB (or in some way connected). If something cannot be reproduced it may turn out to have been your hosting provider working on something, a user doing something silly, etc. Bug reports for non-reproduceable events can slow down our attempts to fix real, reproduceable issues

  • +
  • Next, please read or search through the existing bug reports to see if your bug (or one very similar to it) is already listed. If it is please add to that existing bug rather than creating a new duplicate entry (all this does is slow us down).

  • +
  • Check the forums (use search!) to see if people have discussed anything that sounds similar to what you are seeing. However, as noted above please DO NOT post your particular bug to the forum unless it's non-reproduceable or you are sure it’s related to something you have done rather than phpBB

  • +
  • If no existing bug exists then please feel free to add it
  • +
+ +

If you do post a new bug (i.e. one that isn't already listed in the bug tracker) first make sure that you have logged in (your username and password are the same as for the community forums) then please include the following details:

+ +
    +
  • Your server type/version, e.g. Apache 2.2.3, IIS 7, Sambar, etc.
  • +
  • PHP version and mode of operation, e.g. PHP 5.3.3 as a module, PHP 5.4.0 running as CGI, etc.
  • +
  • DB type/version, e.g. MySQL 5.0.77, PostgreSQL 9.0.6, MSSQL Server 2000 SP1, etc.
  • +
+ +

The relevant database type/version is listed within the administration control panel.

+ +

Please be as detailed as you can in your report, and if possible, list the steps required to duplicate the problem. If you have a patch that fixes the issue, please attach it to the ticket or submit a pull request to our repository on GitHub.

+ +

If you create a patch, it is very much appreciated (but not required) if you follow the phpBB coding guidelines. Please note that the coding guidelines are somewhat different between different versions of phpBB. For phpBB 3.1.x the coding guidelines may be found here: http://area51.phpbb.com/docs/31x/coding-guidelines.html

+ +

Once a bug has been submitted you will be emailed any follow up comments added to it. Please if you are requested to supply additional information, do so! It is frustrating for us to receive bug reports, ask for additional information but get nothing. In these cases we have a policy of closing the bug, which may leave a very real problem in place. Obviously we would rather not have this situation arise.

+ +

5.i. Security related bugs

+ +

If you find a potential security related vulnerability in phpBB please DO NOT post it to the bug tracker, public forums, etc.! Doing so may allow unscrupulous users to take advantage of it before we have time to put a fix in place. All security related bugs should be sent to our security tracker:

+ +

https://www.phpbb.com/security/

+ +
+ + + +
+
+ +
+ +

6. Overview of current bug list

+ +
+
+ +
+ +

This list is not complete but does represent those bugs which may affect users on a wider scale. Other bugs listed in the tracker have typically been shown to be limited to certain setups or methods of installation, updating and/or conversions.

+ +
    +
  • Conversions may fail to complete on large boards under some hosts.
  • +
  • Updates may fail to complete on large update sets under some hosts.
  • +
  • Smilies placed directly after bbcode tags will not get parsed. Smilies always need to be separated by spaces.
  • +
+ +
+ + + +
+
+ +
+ +

7. PHP compatibility issues

+ +
+
+ +
+ +

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.

+ +

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.

+ +

This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MariaDB 5.x, MSSQL Server 2000, PostgreSQL 8.x, Oracle 8, SQLite 2 and SQLite 3. Versions of PHP used range from 5.3.x to 5.4.x without problem.

+ +

7.i. Notice on PHP security issues

+ +

Currently there are no known issues regarding PHP security.

+ +
+ + + +
+
+ +
+ +

8. Copyright and disclaimer

+ +
+
+ +
+ +

phpBB is free software, released under the terms of the GNU General Public License, version 2 (GPL-2.0). Copyright © phpBB Limited. For full copyright and license information, please see the docs/CREDITS.txt file.

+ +
+ + + +
+
+ + + + +
+ +
+ +
+ + + diff --git a/sources/phpBB/docs/auth_api.html b/sources/phpBB/docs/auth_api.html new file mode 100644 index 0000000..703e7a1 --- /dev/null +++ b/sources/phpBB/docs/auth_api.html @@ -0,0 +1,292 @@ + + + + + + +phpBB3 • Auth API + + + + + + + +
+ + + + + +
+ + + +

This is an explanation of how to use the phpBB auth/acl API.

+ +

Auth API

+ + + +
+ +

1. Introduction

+ +
+
+ +
+ +

What is it?

+ +

The auth class contains methods related to authorisation users to access various board functions, e.g. posting, viewing, replying, logging in (and out), etc. If you need to check whether a user can carry out a task or handle user login/logouts this class is required.

+ +

Initialisation

+ +

To use any methods contained with the auth class it first needs to be instantiated. This is best achieved early in the execution of the script in the following manner:

+ +
+$auth = new phpbb\auth\auth();
+	
+ +

Once an instance of the class has been created you are free to call the various methods it contains. Please note that should you wish to use the auth_admin methods you will need to instantiate this separately but in the same way.

+ +
+ + + +
+
+ +
+ +

2. Methods

+ +
+
+ +
+ +

Following are the methods you are able to use.

+ +

2.i. acl

+ +

The acl method is the initialisation routine for all the acl functions. If you intend calling any acl method you must first call this. The method takes as its one and only required parameter an associative array containing user information as stored in the database. This array must contain at least the following information; user_id, user_permissions and user_type. It is called in the following way:

+ +
+$auth->acl(userdata);
+	
+ +

Where userdata is the array containing the aforementioned data.

+ +

2.ii. acl_get

+ +

This method is the primary way of determining what a user can and cannot do for a given option globally or in a given forum. The method should be called in the following way:

+ +
+$result = $auth->acl_get(option[, forum]);
+	
+ +

Where option is a string representing the required option, e.g. 'f_list', 'm_edit', 'a_adduser', etc. By adding a ! in front of the option, e.g. '!f_list' the result of this method will be negated. The optional forum term is the integer forum_id.

+ +

The method returns a positive integer when the user is allowed to carry out the option and a zero if denied or the other way around if the option is prefixed with an exclamation mark.

+ +

If you specify a forum and there is also a global setting for the specified option then this method will return a positive integer if one of them evaluates to a positive integer. An example would be the m_approve option which can be set per forum but also globally. If a user has the global option he will automatically have m_approve in every forum.

+ +

There are some special options or flags which are used as prefixes for other options, e.g. 'f_' or 'm_'. These flags will automatically be set to a positive integer if the user has one or more permissions with the given prefix. A local setting will result in the flag being set only locally (so it will require a forum id to retrieve). If a user has one or more global permissions with the prefix acl_get will return a positive integer regardless of the forum id.

+ +

2.iii. acl_gets

+ +

This method is funtionally similar to acl_get in that it returns information on whether a user can or cannot carry out a given task. The difference here is the ability to test several different options in one go. This may be useful for testing whether a user is a moderator or an admin in one call. Rather than having to call and check acl_get twice.

+ +

The method should be called thus:

+ +
+$result = $auth->acl_gets(option1[, option2, ..., optionN, forum]);
+	
+ +

As with the acl_get method the options are strings representing the required permissions to check. The forum again is an integer representing a given forum_id.

+ +

The method will return a positive integer if acl_get for one of the options evaluates to a positive integer (combines permissions with OR).

+ +

2.iv. acl_getf

+ +

This method is used to find out in which forums a user is allowed to carry out an operation or to find out in which forums he is not allowed to carry out an operation. The method should be called in the following way:

+ +
+$result = $auth->acl_getf(option[, clean]);
+	
+ +

Just like in the acl_get method the option is a string specifying the permission which has to be checked (negation using ! is allowed). The second parameter is a boolean. If it is set to false this method returns all forums with either zero or a positive integer. If it is set to true only those forums with a positive integer as the result will be returned.

+ +

The method returns an associative array of the form:

+ +
+array(forum_id1 => array(option => integer), forum_id2 => ...)
+	
+ +

Where option is the option passed to the method and integer is either zero or a positive integer and the same acl_get(option, forum_id) would return.

+ +

2.v. acl_getf_global

+ +

This method is used to find out whether a user has a permission in at least one forum or globally. This method is similar to checking whether acl_getf(option, true) returned one or more forums but it's faster. It should be called in the following way:

+ +
+$result = $auth->acl_getf_global(option)
+	
+ +

As with the previous methods option is a string specifying the permission which has to be checked.

+ +

This method returns either zero or a positive integer.

+ +

2.vi. acl_cache

+ +

This should be considered a private method and not be called externally. It handles the generation of the user_permissions data from the basic user and group authorisation data. When necessary this method is called automatically by acl.

+ +

2.vii. acl_clear_prefetch

+ +

This method clears the user_permissions column in the users table for the given user. If the user ID passed is zero, the permissions cache is cleared for all users. This method should be called whenever permissions are set.

+ +
+// clear stored permissions for user 2
+$user_id = 2;
+$auth->acl_clear_prefetch($user_id);
+
+ +

This method returns null.

+ +

2.viii. acl_get_list

+ +

This method returns an an array describing which users have permissions in given fora. The resultant array contains an entry for permission that every user has in every forum when no arguments are passed.

+ +
+$user_id = array(2, 53);
+$permissions = array('f_list', 'f_read');
+$forum_id = array(1, 2, 3);
+$result = $auth->acl_get_list($user_id, $permissions, $forum_id);
+
+ +

The parameters may be of the following legal types:

+
    +
  • $user_id: false, int, array(int, int, int, ...)
  • +
  • $permissions: false, string, array(string, string, ...)
  • +
  • $forum_id: false, int, array(int, int, int, ...)
  • +
+ +

2.ix. Miscellaneous

+ +

There are other methods defined in the auth class which serve mostly as private methods, but are available for use if needed. Each of them is used to pull data directly from the database tables. They are:

+
    +
  • function acl_group_raw_data($group_id = false, $opts = false, $forum_id = false)
  • +
  • function acl_user_raw_data($user_id = false, $opts = false, $forum_id = false)
  • +
  • function acl_raw_data_single_user($user_id)
  • +
  • function acl_raw_data($user_id = false, $opts = false, $forum_id = false)
  • +
  • function acl_role_data($user_type, $role_type, $ug_id = false, $forum_id = false)
  • +
+ +

Of these, acl_raw_data is the most general, but the others will be faster if you need a smaller amount of data.

+ +
+ + + +
+
+ +
+ +

3. Admin related functions

+ +
+
+ +
+ +

A number of additional methods are available related to auth. These handle more basic functions such as adding user and group permissions, new options and clearing the user cache. These methods are contained within a separate class, auth_admin. This can be found in includes/acp/auth.php.

+ +

To use any methods this class contains it first needs to be instantiated separately from auth. This is achieved in the same way as auth:

+ +
+$auth_admin = new auth_admin();
+	
+ +

This instance gives you access to both the methods of this specific class and that of auth.

+ +
+ + + +
+
+ +
+ +

4. Copyright and disclaimer

+ +
+
+ +
+ +

phpBB is free software, released under the terms of the GNU General Public License, version 2 (GPL-2.0). Copyright © phpBB Limited. For full copyright and license information, please see the docs/CREDITS.txt file.

+ +
+ + + +
+
+ + + + +
+ +
+ +
+ + + diff --git a/sources/phpBB/docs/bg_header.gif b/sources/phpBB/docs/bg_header.gif new file mode 100644 index 0000000000000000000000000000000000000000..351de9f46ac2941ac16afc674c99f8ac66767091 GIT binary patch literal 690 zcmZ?wbhEHbWMzn9c*elMRI`(*dIxLMLEh zKjWEtlc{<;@3dQNZAY1^wlS1#6qxr^VD4j{DL1$$UgnwrM3)$=wy`wqWv<`DKkET! z_ZjXmwYqtvo;-I?>Na+vxBquyukctd^7KH^Zjh~o_K|` z=PX<6QMT42jOCjJ<~`w^aYtb86PAX3+>@^{*X|Nr@SL%7EB~BFj1^n>XFp`F+by{8 z1w;8Jp+&D41{qNN$pUtf4u}NB2?P882D7Fn!PZv4j?S)bhu&Vf2@|{~Pnqg5ea1|Q z*|P=a&C^-9kax)v#^uY^R;^-KyVh;P#!Wt3wr-Q!vBPlpZpnT7Tn--OIC4bs_;Hm} zr+)sJYuD^=-n6@OhyVV4`A3f|o<3!H@j~_WYtwh{j6Qxe{_=(O`*)dN zzij{hWn*BRCt(rL?%1p)q;}@ugomx|{JI`fA{HjO%1IcO-Pp0Q!@b|csjbFwl1l4j zb;%VWI~S*Vvl}F?n_*ep;5*x?=$Xxd$?0A5?cF&Vx zD(whe?YJpz>Vc`NyVu7Dc8Km?kaJTx^2u* Gum%8ywf-3Z literal 0 HcmV?d00001 diff --git a/sources/phpBB/docs/coding-guidelines.html b/sources/phpBB/docs/coding-guidelines.html new file mode 100644 index 0000000..98cfe0e --- /dev/null +++ b/sources/phpBB/docs/coding-guidelines.html @@ -0,0 +1,2574 @@ + + + + + + +phpBB3 • Coding Guidelines + + + + + + + +
+ + + + + +
+ + + +

These are the phpBB Coding Guidelines for Ascraeus, all attempts should be made to follow them as closely as possible.

+ +

Coding Guidelines

+ + + +
+ +

1. Defaults

+ +
+
+ +
+ +

1.i. Editor Settings

+ +

Tabs vs Spaces:

+

In order to make this as simple as possible, we will be using tabs, not spaces. We enforce 4 (four) spaces for one tab - therefore you need to set your tab width within your editor to 4 spaces. Make sure that when you save the file, it's saving tabs and not spaces. This way, we can each have the code be displayed the way we like it, without breaking the layout of the actual files.

+

Tabs in front of lines are no problem, but having them within the text can be a problem if you do not set it to the amount of spaces every one of us uses. Here is a short example of how it should look like:

+ +
+{TAB}$mode{TAB}{TAB}= $request->variable('mode', '');
+{TAB}$search_id{TAB}= $request->variable('search_id', '');
+	
+ +

If entered with tabs (replace the {TAB}) both equal signs need to be on the same column.

+ +

Linefeeds:

+

Ensure that your editor is saving files in the UNIX (LF) line ending format. This means that lines are terminated with a newline, not with Windows Line endings (CR/LF combo) as they are on Win32 or Classic Mac (CR) Line endings. Any decent editor should be able to do this, but it might not always be the default setting. Know your editor. If you want advice for an editor for your Operating System, just ask one of the developers. Some of them do their editing on Win32.

+ +

1.ii. File Layout

+ +

Standard header for new files:

+

This template of the header must be included at the start of all phpBB files:

+ +
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+	
+ +

Please see the File Locations section for the correct package name.

+ +

PHP closing tags

+ +

A file containg only PHP code should not end with the optional PHP closing tag ?> to avoid issues with whitespace following it.

+ +

Newline at end of file

+ +

All files should end in a newline so the last line does not appear as modified in diffs, when a line is appended to the file.

+ +

Files containing inline code:

+ +

For those files you have to put an empty comment directly after the header to prevent the documentor assigning the header to the first code element found.

+ +
+/**
+* {HEADER}
+*/
+
+/**
+*/
+{CODE}
+	
+ +

Files containing only functions:

+ +

Do not forget to comment the functions (especially the first function following the header). Each function should have at least a comment of what this function does. For more complex functions it is recommended to document the parameters too.

+ +

Files containing only classes:

+ +

Do not forget to comment the class. Classes need a separate @package definition, it is the same as the header package name. Apart from this special case the above statement for files containing only functions needs to be applied to classes and it's methods too.

+ +

Code following the header but only functions/classes file:

+ +

If this case is true, the best method to avoid documentation confusions is adding an ignore command, for example:

+ +
+/**
+* {HEADER}
+*/
+
+/**
+* @ignore
+*/
+Small code snipped, mostly one or two defines or an if statement
+
+/**
+* {DOCUMENTATION}
+*/
+class ...
+	
+ +

1.iii. File Locations

+ +

Functions used by more than one page should be placed in functions.php, functions specific to one page should be placed on that page (at the bottom) or within the relevant sections functions file. Some files in /includes are holding functions responsible for special sections, for example uploading files, displaying "things", user related functions and so forth.

+ +

The following packages are defined, and related new features/functions should be placed within the mentioned files/locations, as well as specifying the correct package name. The package names are bold within this list:

+ +
    +
  • phpBB3
    Core files and all files not assigned to a separate package
  • +
  • acm
    /phpbb/cache
    Cache System
  • +
  • acp
    /adm, /includes/acp, /includes/functions_admin.php
    Administration Control Panel
  • +
  • dbal
    /phpbb/db, /includes/db
    Database Abstraction Layer. +
      +
    • /phpbb/db/driver/
      Database Abstraction Layer classes
    • +
    • /phpbb/db/migration/
      Migrations are used for updating the database from one release to another
    • +
    +
  • +
  • diff
    /includes/diff
    Diff Engine
  • +
  • docs
    /docs
    phpBB Documentation
  • +
  • images
    /images
    All global images not connected to styles
  • +
  • install
    /install
    Installation System
  • +
  • language
    /language
    All language files
  • +
  • login
    /phpbb/auth
    Login Authentication Plugins
  • +
  • VC
    /includes/captcha
    CAPTCHA
  • +
  • mcp
    mcp.php, /includes/mcp, report.php
    Moderator Control Panel
  • +
  • ucp
    ucp.php, /includes/ucp
    User Control Panel
  • +
  • utf
    /includes/utf
    UTF8-related functions/classes
  • +
  • search
    /phpbb/search, search.php
    Search System
  • +
  • styles
    /styles
    phpBB Styles/Templates/Themes
  • +
+ +

1.iv. Special Constants

+ +

There are some special constants application developers are able to utilize to bend some of phpBB's internal functionality to suit their needs.

+ +
+PHPBB_MSG_HANDLER          (overwrite message handler)
+PHPBB_DB_NEW_LINK          (overwrite new_link parameter for sql_connect)
+PHPBB_ROOT_PATH            (overwrite $phpbb_root_path)
+PHPBB_ADMIN_PATH           (overwrite $phpbb_admin_path)
+PHPBB_USE_BOARD_URL_PATH   (use generate_board_url() for image paths instead of $phpbb_root_path)
+PHPBB_DISABLE_ACP_EDITOR   (disable ACP style editor for templates)
+PHPBB_DISABLE_CONFIG_CHECK (disable ACP config.php writeable check)
+
+PHPBB_ACM_MEMCACHE_PORT     (overwrite memcached port, default is 11211)
+PHPBB_ACM_MEMCACHE_COMPRESS (overwrite memcached compress setting, default is disabled)
+PHPBB_ACM_MEMCACHE_HOST     (overwrite memcached host name, default is localhost)
+
+PHPBB_ACM_REDIS_HOST        (overwrite redis host name, default is localhost)
+PHPBB_ACM_REDIS_PORT        (overwrite redis port, default is 6379)
+PHPBB_ACM_REDIS_PASSWORD    (overwrite redis password, default is empty)
+PHPBB_ACM_REDIS_DB          (overwrite redis default database)
+
+PHPBB_QA                   (Set board to QA-Mode, which means the updater also checks for RC-releases)
+
+ +

PHPBB_USE_BOARD_URL_PATH

+ +

If the PHPBB_USE_BOARD_URL_PATH constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:

+ +
    +
  • /phpbb/user.php - \phpbb\user::img()
  • +
  • /includes/functions_content.php - smiley_text()
  • +
+ +

Path locations for the following template variables are affected by this too:

+ +
    +
  • {T_ASSETS_PATH} - assets (non-style specific, static resources)
  • +
  • {T_THEME_PATH} - styles/xxx/theme
  • +
  • {T_TEMPLATE_PATH} - styles/xxx/template
  • +
  • {T_SUPER_TEMPLATE_PATH} - styles/xxx/template
  • +
  • {T_IMAGES_PATH} - images/
  • +
  • {T_SMILIES_PATH} - $config['smilies_path']/
  • +
  • {T_AVATAR_PATH} - $config['avatar_path']/
  • +
  • {T_AVATAR_GALLERY_PATH} - $config['avatar_gallery_path']/
  • +
  • {T_ICONS_PATH} - $config['icons_path']/
  • +
  • {T_RANKS_PATH} - $config['ranks_path']/
  • +
  • {T_UPLOAD_PATH} - $config['upload_path']/
  • +
  • {T_STYLESHEET_LINK} - styles/xxx/theme/stylesheet.css
  • +
  • New template variable {BOARD_URL} for the board url + script path.
  • +
+ +
+ + + +
+
+ +
+ +

2. Code Layout/Guidelines

+ +
+
+ +
+ +

Please note that these guidelines apply to all php, html, javascript and css files.

+ +

2.i. Variable/Function/Class Naming

+ +

We will not be using any form of hungarian notation in our naming conventions. Many of us believe that hungarian naming is one of the primary code obfuscation techniques currently in use.

+ +

Variable Names:

+

In PHP, variable names should be in all lowercase, with words separated by an underscore, example:

+ +
+

$current_user is right, but $currentuser and $currentUser are not.

+
+ +

In JavaScript, variable names should use camel case:

+ +
+

currentUser is right, but currentuser and current_user are not.

+
+ +

Names should be descriptive, but concise. We don't want huge sentences as our variable names, but typing an extra couple of characters is always better than wondering what exactly a certain variable is for.

+ +

Loop Indices:

+

The only situation where a one-character variable name is allowed is when it's the index for some looping construct. In this case, the index of the outer loop should always be $i. If there's a loop inside that loop, its index should be $j, followed by $k, and so on. If the loop is being indexed by some already-existing variable with a meaningful name, this guideline does not apply, example:

+ +
+for ($i = 0; $i < $outer_size; $i++)
+{
+   for ($j = 0; $j < $inner_size; $j++)
+   {
+      foo($i, $j);
+   }
+}
+	
+ +

Function Names:

+

Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character in PHP, and camel caps in JavaScript. Function names should be prefixed with "phpbb_" and preferably have a verb in them somewhere. Good function names are phpbb_print_login_status(), phpbb_get_user_data(), etc. Constructor functions in JavaScript should begin with a capital letter.

+ +

Function Arguments:

+

Arguments are subject to the same guidelines as variable names. We don't want a bunch of functions like: do_stuff($a, $b, $c). In most cases, we'd like to be able to tell how to use a function by just looking at its declaration.

+ +

Class Names:

+ +

Apart from following the rules for function names, all classes should meet the following conditions:

+
    +
  • Every class must be defined in a separate file.
  • +
  • The classes have to be located in a subdirectory of phpbb/.
  • +
  • Classnames must be namespaced with \phpbb\ to avoid name clashes.
  • +
  • Class names/namespaces have to reflect the location of the file they are defined in. The namespace must be the directory in which the file is located. So the directory names must not contain any underscores, but the filename may.
  • +
  • Directories should typically be a singular noun (e.g. dir in the example below, not dirs.
  • +
+ +

So given the following example directory structure you would result in the below listed lookups

+
+phpbb/
+  class_name.php
+  dir/
+    class_name.php
+      subdir/
+        class_name.php
+	
+ +
+\phpbb\class_name            - phpbb/class_name.php
+\phpbb\dir\class_name        - phpbb/dir/class_name.php
+\phpbb\dir\subdir\class_name - phpbb/dir/subdir/class_name.php
+	
+ + +

Summary:

+

The basic philosophy here is to not hurt code clarity for the sake of laziness. This has to be balanced by a little bit of common sense, though; phpbb_print_login_status_for_a_given_user() goes too far, for example -- that function would be better named phpbb_print_user_login_status(), or just phpbb_print_login_status().

+ +

Special Namings:

+

For all emoticons use the term smiley in singular and smilies in plural. For emails we use the term email (without dash between “e†and “mâ€).

+ +

2.ii. Code Layout

+ +

Always include the braces:

+

This is another case of being too lazy to type 2 extra characters causing problems with code clarity. Even if the body of some construct is only one line long, do not drop the braces. Just don't, examples:

+ +

// These are all wrong.

+ +
+if (condition) do_stuff();
+
+if (condition)
+	do_stuff();
+
+while (condition)
+	do_stuff();
+
+for ($i = 0; $i < size; $i++)
+	do_stuff($i);
+	
+ +

// These are all right.

+
+if (condition)
+{
+	do_stuff();
+}
+
+while (condition)
+{
+	do_stuff();
+}
+
+for ($i = 0; $i < size; $i++)
+{
+	do_stuff();
+}
+	
+ +

Where to put the braces:

+

In PHP code, braces always go on their own line. The closing brace should also always be at the same column as the corresponding opening brace, examples:

+ +
+if (condition)
+{
+	while (condition2)
+	{
+		...
+	}
+}
+else
+{
+	...
+}
+
+for ($i = 0; $i < $size; $i++)
+{
+	...
+}
+
+while (condition)
+{
+	...
+}
+
+function do_stuff()
+{
+	...
+}
+	
+ +

In JavaScript code, braces always go on the same line:

+ +
+if (condition) {
+	while (condition2) {
+		...
+	}
+} else {
+	...
+}
+
+for (var i = 0; i < size; i++) {
+	...
+}
+
+while (condition) {
+	...
+}
+
+function do_stuff() {
+	...
+}
+	
+ +

Use spaces between tokens:

+

This is another simple, easy step that helps keep code readable without much effort. Whenever you write an assignment, expression, etc.. Always leave one space between the tokens. Basically, write code as if it was English. Put spaces between variable names and operators. Don't put spaces just after an opening bracket or before a closing bracket. Don't put spaces just before a comma or a semicolon. This is best shown with a few examples, examples:

+ +

// Each pair shows the wrong way followed by the right way.

+ +
+$i=0;
+$i = 0;
+
+if($i<7) ...
+if ($i < 7) ...
+
+if ( ($i < 7)&&($j > 8) ) ...
+if ($i < 7 && $j > 8) ...
+
+do_stuff( $i, 'foo', $b );
+do_stuff($i, 'foo', $b);
+
+for($i=0; $i<$size; $i++) ...
+for ($i = 0; $i < $size; $i++) ...
+
+$i=($j < $size)?0:1;
+$i = ($j < $size) ? 0 : 1;
+	
+ +

Operator precedence:

+

Do you know the exact precedence of all the operators in PHP? Neither do I. Don't guess. Always make it obvious by using brackets to force the precedence of an equation so you know what it does. Remember to not over-use this, as it may harden the readability. Basically, do not enclose single expressions. Examples:

+ +

// what's the result? who knows.

+
+$bool = ($i < 7 && $j > 8 || $k == 4);
+	
+ +

// now you can be certain what I'm doing here.

+
+$bool = (($i < 7) && (($j < 8) || ($k == 4)));
+	
+ +

// But this one is even better, because it is easier on the eye but the intention is preserved

+
+$bool = ($i < 7 && ($j < 8 || $k == 4));
+	
+ +

Quoting strings:

+

There are two different ways to quote strings in PHP - either with single quotes or with double quotes. The main difference is that the parser does variable interpolation in double-quoted strings, but not in single quoted strings. Because of this, you should always use single quotes unless you specifically need variable interpolation to be done on that string. This way, we can save the parser the trouble of parsing a bunch of strings where no interpolation needs to be done.

+

Also, if you are using a string variable as part of a function call, you do not need to enclose that variable in quotes. Again, this will just make unnecessary work for the parser. Note, however, that nearly all of the escape sequences that exist for double-quoted strings will not work with single-quoted strings. Be careful, and feel free to break this guideline if it's making your code easier to read, examples:

+ +

// wrong

+
+$str = "This is a really long string with no variables for the parser to find.";
+
+do_stuff("$str");
+	
+ +

// right

+
+$str = 'This is a really long string with no variables for the parser to find.';
+
+do_stuff($str);
+	
+ +

// Sometimes single quotes are just not right

+
+$post_url = $phpbb_root_path . 'posting.' . $phpEx . '?mode=' . $mode . '&amp;start=' . $start;
+	
+ +

// Double quotes are sometimes needed to not overcrowd the line with concatenations.

+
+$post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;start=$start";
+	
+ +

In SQL statements mixing single and double quotes is partly allowed (following the guidelines listed here about SQL formatting), else one should try to only use one method - mostly single quotes.

+ +

Commas after every array element:

+

If an array is defined with each element on its own line, you still have to modify the previous line to add a comma when appending a new element. PHP allows for trailing (useless) commas in array definitions. These should always be used so each element including the comma can be appended with a single line. In JavaScript, do not use the trailing comma, as it causes browsers to throw errors.

+ +

// wrong

+
+$foo = array(
+	'bar' => 42,
+	'boo' => 23
+);
+	
+ +

// right

+
+$foo = array(
+	'bar' => 42,
+	'boo' => 23,
+);
+	
+ + +

Associative array keys:

+

In PHP, it's legal to use a literal string as a key to an associative array without quoting that string. We don't want to do this -- the string should always be quoted to avoid confusion. Note that this is only when we're using a literal, not when we're using a variable, examples:

+ +

// wrong

+
+$foo = $assoc_array[blah];
+	
+ +

// right

+
+$foo = $assoc_array['blah'];
+	
+ +

// wrong

+
+$foo = $assoc_array["$var"];
+	
+ +

// right

+
+$foo = $assoc_array[$var];
+	
+ +

Comments:

+

Each complex function should be preceded by a comment that tells a programmer everything they need to know to use that function. The meaning of every parameter, the expected input, and the output are required as a minimal comment. The function's behaviour in error conditions (and what those error conditions are) should also be present - but mostly included within the comment about the output.

Especially important to document are any assumptions the code makes, or preconditions for its proper operation. Any one of the developers should be able to look at any part of the application and figure out what's going on in a reasonable amount of time.

Avoid using /* */ comment blocks for one-line comments, // should be used for one/two-liners.

+ +

Magic numbers:

+

Don't use them. Use named constants for any literal value other than obvious special cases. Basically, it's ok to check if an array has 0 elements by using the literal 0. It's not ok to assign some special meaning to a number and then use it everywhere as a literal. This hurts readability AND maintainability. The constants true and false should be used in place of the literals 1 and 0 -- even though they have the same values (but not type!), it's more obvious what the actual logic is when you use the named constants. Typecast variables where it is needed, do not rely on the correct variable type (PHP is currently very loose on typecasting which can lead to security problems if a developer does not keep a very close eye on it).

+ +

Shortcut operators:

+

The only shortcut operators that cause readability problems are the shortcut increment $i++ and decrement $j-- operators. These operators should not be used as part of an expression. They can, however, be used on their own line. Using them in expressions is just not worth the headaches when debugging, examples:

+ +

// wrong

+
+$array[++$i] = $j;
+$array[$i++] = $k;
+	
+ +

// right

+
+$i++;
+$array[$i] = $j;
+
+$array[$i] = $k;
+$i++;
+	
+ +

Inline conditionals:

+

Inline conditionals should only be used to do very simple things. Preferably, they will only be used to do assignments, and not for function calls or anything complex at all. They can be harmful to readability if used incorrectly, so don't fall in love with saving typing by using them, examples:

+ +

// Bad place to use them

+
+($i < $size && $j > $size) ? do_stuff($foo) : do_stuff($bar);
+	
+ +

// OK place to use them

+
+$min = ($i < $j) ? $i : $j;
+	
+ +

Don't use uninitialized variables.

+

For phpBB3, we intend to use a higher level of run-time error reporting. This will mean that the use of an uninitialized variable will be reported as a warning. These warnings can be avoided by using the built-in isset() function to check whether a variable has been set - but preferably the variable is always existing. For checking if an array has a key set this can come in handy though, examples:

+ +

// Wrong

+
+if ($forum) ...
+	
+ +

// Right

+
+if (isset($forum)) ...
+	
+ +

// Also possible

+
+if (isset($forum) && $forum == 5)
+	
+ +

The empty() function is useful if you want to check if a variable is not set or being empty (an empty string, 0 as an integer or string, NULL, false, an empty array or a variable declared, but without a value in a class). Therefore empty should be used in favor of isset($array) && sizeof($array) > 0 - this can be written in a shorter way as !empty($array).

+ +

Switch statements:

+

Switch/case code blocks can get a bit long sometimes. To have some level of notice and being in-line with the opening/closing brace requirement (where they are on the same line for better readability), this also applies to switch/case code blocks and the breaks. An example:

+ +

// Wrong

+
+switch ($mode)
+{
+	case 'mode1':
+		// I am doing something here
+		break;
+	case 'mode2':
+		// I am doing something completely different here
+		break;
+}
+	
+ +

// Good

+
+switch ($mode)
+{
+	case 'mode1':
+		// I am doing something here
+	break;
+
+	case 'mode2':
+		// I am doing something completely different here
+	break;
+
+	default:
+		// Always assume that a case was not caught
+	break;
+}
+	
+ +

// Also good, if you have more code between the case and the break

+
+switch ($mode)
+{
+	case 'mode1':
+
+		// I am doing something here
+
+	break;
+
+	case 'mode2':
+
+		// I am doing something completely different here
+
+	break;
+
+	default:
+
+		// Always assume that a case was not caught
+
+	break;
+}
+	
+ +

Even if the break for the default case is not needed, it is sometimes better to include it just for readability and completeness.

+ +

If no break is intended, please add a comment instead. An example:

+ +

// Example with no break

+
+switch ($mode)
+{
+	case 'mode1':
+
+		// I am doing something here
+
+	// no break here
+
+	case 'mode2':
+
+		// I am doing something completely different here
+
+	break;
+
+	default:
+
+		// Always assume that a case was not caught
+
+	break;
+}
+	
+ +

Class Members

+

Use the explicit visibility qualifiers public, private and protected for all properties instead of var. + +

Place the static qualifier before the visibility qualifiers.

+ +

//Wrong

+
+var $x;
+private static function f()
+	
+ +

// Right

+
+public $x;
+static private function f()
+	
+ +

Constants

+

Prefer class constants over global constants created with define().

+ +

2.iii. SQL/SQL Layout

+ +

Common SQL Guidelines:

+

All SQL should be cross-DB compatible, if DB specific SQL is used alternatives must be provided which work on all supported DB's (MySQL3/4/5, MSSQL (7.0 and 2000), PostgreSQL (8.3+), SQLite, Oracle8, ODBC (generalised if possible)).

+

All SQL commands should utilise the DataBase Abstraction Layer (DBAL)

+ +

SQL code layout:

+

SQL Statements are often unreadable without some formatting, since they tend to be big at times. Though the formatting of sql statements adds a lot to the readability of code. SQL statements should be formatted in the following way, basically writing keywords:

+ +
+$sql = 'SELECT *
+<-one tab->FROM ' . SOME_TABLE . '
+<-one tab->WHERE a = 1
+<-two tabs->AND (b = 2
+<-three tabs->OR b = 3)
+<-one tab->ORDER BY b';
+	
+ +

Here the example with the tabs applied:

+ +
+$sql = 'SELECT *
+	FROM ' . SOME_TABLE . '
+	WHERE a = 1
+		AND (b = 2
+			OR b = 3)
+	ORDER BY b';
+	
+ +

SQL Quotes:

+

Use double quotes where applicable. (The variables in these examples are typecasted to integers beforehand.) Examples:

+ +

// These are wrong.

+
+"UPDATE " . SOME_TABLE . " SET something = something_else WHERE a = $b";
+
+'UPDATE ' . SOME_TABLE . ' SET something = ' . $user_id . ' WHERE a = ' . $something;
+	
+ +

// These are right.

+ +
+'UPDATE ' . SOME_TABLE . " SET something = something_else WHERE a = $b";
+
+'UPDATE ' . SOME_TABLE . " SET something = $user_id WHERE a = $something";
+	
+ +

In other words use single quotes where no variable substitution is required or where the variable involved shouldn't appear within double quotes. Otherwise use double quotes.

+ +

Avoid DB specific SQL:

+

The "not equals operator", as defined by the SQL:2003 standard, is "<>"

+ +

// This is wrong.

+
+$sql = 'SELECT *
+	FROM ' . SOME_TABLE . '
+	WHERE a != 2';
+	
+ +

// This is right.

+
+$sql = 'SELECT *
+	FROM ' . SOME_TABLE . '
+	WHERE a <> 2';
+	
+ +

Common DBAL methods:

+ +

sql_escape():

+ +

Always use $db->sql_escape() if you need to check for a string within an SQL statement (even if you are sure the variable cannot contain single quotes - never trust your input), for example:

+ +
+$sql = 'SELECT *
+	FROM ' . SOME_TABLE . "
+	WHERE username = '" . $db->sql_escape($username) . "'";
+	
+ +

sql_query_limit():

+ +

We do not add limit statements to the sql query, but instead use $db->sql_query_limit(). You basically pass the query, the total number of lines to retrieve and the offset.

+ +

Note: Since Oracle handles limits differently and because of how we implemented this handling you need to take special care if you use sql_query_limit with an sql query retrieving data from more than one table.

+ +

Make sure when using something like "SELECT x.*, y.jars" that there is not a column named jars in x; make sure that there is no overlap between an implicit column and the explicit columns.

+ +

sql_build_array():

+ +

If you need to UPDATE or INSERT data, make use of the $db->sql_build_array() function. This function already escapes strings and checks other types, so there is no need to do this here. The data to be inserted should go into an array - $sql_ary - or directly within the statement if one or two variables needs to be inserted/updated. An example of an insert statement would be:

+ +
+$sql_ary = array(
+	'somedata'		=> $my_string,
+	'otherdata'		=> $an_int,
+	'moredata'		=> $another_int,
+);
+
+$db->sql_query('INSERT INTO ' . SOME_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
+	
+ +

To complete the example, this is how an update statement would look like:

+ +
+$sql_ary = array(
+	'somedata'		=> $my_string,
+	'otherdata'		=> $an_int,
+	'moredata'		=> $another_int,
+);
+
+$sql = 'UPDATE ' . SOME_TABLE . '
+	SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+	WHERE user_id = ' . (int) $user_id;
+$db->sql_query($sql);
+	
+ +

The $db->sql_build_array() function supports the following modes: INSERT (example above), INSERT_SELECT (building query for INSERT INTO table (...) SELECT value, column ... statements), UPDATE (example above) and SELECT (for building WHERE statement [AND logic]).

+ +

sql_multi_insert():

+ +

If you want to insert multiple statements at once, please use the separate sql_multi_insert() method. An example:

+ +
+$sql_ary = array();
+
+$sql_ary[] = array(
+	'somedata'		=> $my_string_1,
+	'otherdata'		=> $an_int_1,
+	'moredata'		=> $another_int_1,
+);
+
+$sql_ary[] = array(
+	'somedata'		=> $my_string_2,
+	'otherdata'		=> $an_int_2,
+	'moredata'		=> $another_int_2,
+);
+
+$db->sql_multi_insert(SOME_TABLE, $sql_ary);
+	
+ +

sql_in_set():

+ +

The $db->sql_in_set() function should be used for building IN () and NOT IN () constructs. Since (specifically) MySQL tend to be faster if for one value to be compared the = and <> operator is used, we let the DBAL decide what to do. A typical example of doing a positive match against a number of values would be:

+ +
+$sql = 'SELECT *
+	FROM ' . FORUMS_TABLE . '
+	WHERE ' . $db->sql_in_set('forum_id', $forum_ids);
+$db->sql_query($sql);
+	
+ +

Based on the number of values in $forum_ids, the query can look differently.

+ +

// SQL Statement if $forum_ids = array(1, 2, 3);

+ +
+SELECT FROM phpbb_forums WHERE forum_id IN (1, 2, 3)
+	
+ +

// SQL Statement if $forum_ids = array(1) or $forum_ids = 1

+ +
+SELECT FROM phpbb_forums WHERE forum_id = 1
+	
+ +

Of course the same is possible for doing a negative match against a number of values:

+ +
+$sql = 'SELECT *
+	FROM ' . FORUMS_TABLE . '
+	WHERE ' . $db->sql_in_set('forum_id', $forum_ids, true);
+$db->sql_query($sql);
+	
+ +

Based on the number of values in $forum_ids, the query can look differently here too.

+ +

// SQL Statement if $forum_ids = array(1, 2, 3);

+ +
+SELECT FROM phpbb_forums WHERE forum_id NOT IN (1, 2, 3)
+	
+ +

// SQL Statement if $forum_ids = array(1) or $forum_ids = 1

+ +
+SELECT FROM phpbb_forums WHERE forum_id <> 1
+	
+ +

If the given array is empty, an error will be produced.

+ +

sql_build_query():

+ +

The $db->sql_build_query() function is responsible for building sql statements for SELECT and SELECT DISTINCT queries if you need to JOIN on more than one table or retrieve data from more than one table while doing a JOIN. This needs to be used to make sure the resulting statement is working on all supported db's. Instead of explaining every possible combination, I will give a short example:

+ +
+$sql_array = array(
+	'SELECT'	=> 'f.*, ft.mark_time',
+
+	'FROM'		=> array(
+		FORUMS_WATCH_TABLE	=> 'fw',
+		FORUMS_TABLE		=> 'f',
+	),
+
+	'LEFT_JOIN'	=> array(
+		array(
+			'FROM'	=> array(FORUMS_TRACK_TABLE => 'ft'),
+			'ON'	=> 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id',
+		),
+	),
+
+	'WHERE'		=> 'fw.user_id = ' . $user->data['user_id'] . '
+		AND f.forum_id = fw.forum_id',
+
+	'ORDER_BY'	=> 'left_id',
+);
+
+$sql = $db->sql_build_query('SELECT', $sql_array);
+	
+ +

The possible first parameter for sql_build_query() is SELECT or SELECT_DISTINCT. As you can see, the logic is pretty self-explaining. For the LEFT_JOIN key, just add another array if you want to join on to tables for example. The added benefit of using this construct is that you are able to easily build the query statement based on conditions - for example the above LEFT_JOIN is only necessary if server side topic tracking is enabled; a slight adjustement would be:

+ +
+$sql_array = array(
+	'SELECT'	=> 'f.*',
+
+	'FROM'		=> array(
+		FORUMS_WATCH_TABLE	=> 'fw',
+		FORUMS_TABLE		=> 'f',
+	),
+
+	'WHERE'		=> 'fw.user_id = ' . $user->data['user_id'] . '
+		AND f.forum_id = fw.forum_id',
+
+	'ORDER_BY'	=> 'left_id',
+);
+
+if ($config['load_db_lastread'])
+{
+	$sql_array['LEFT_JOIN'] = array(
+		array(
+			'FROM'	=> array(FORUMS_TRACK_TABLE => 'ft'),
+			'ON'	=> 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id',
+		),
+	);
+
+	$sql_array['SELECT'] .= ', ft.mark_time ';
+}
+else
+{
+	// Here we read the cookie data
+}
+
+$sql = $db->sql_build_query('SELECT', $sql_array);
+	
+ +

2.iv. Optimizations

+ +

Operations in loop definition:

+

Always try to optimize your loops if operations are going on at the comparing part, since this part is executed every time the loop is parsed through. For assignments a descriptive name should be chosen. Example:

+ +

// On every iteration the sizeof function is called

+
+for ($i = 0; $i < sizeof($post_data); $i++)
+{
+	do_something();
+}
+	
+ +

// You are able to assign the (not changing) result within the loop itself

+
+for ($i = 0, $size = sizeof($post_data); $i < $size; $i++)
+{
+	do_something();
+}
+	
+ +

Use of in_array():

+

Try to avoid using in_array() on huge arrays, and try to not place them into loops if the array to check consist of more than 20 entries. in_array() can be very time consuming and uses a lot of cpu processing time. For little checks it is not noticeable, but if checked against a huge array within a loop those checks alone can take several seconds. If you need this functionality, try using isset() on the arrays keys instead, actually shifting the values into keys and vice versa. A call to isset($array[$var]) is a lot faster than in_array($var, array_keys($array)) for example.

+ + +

2.v. General Guidelines

+ +

General things:

+

Never trust user input (this also applies to server variables as well as cookies).

+

Try to sanitize values returned from a function.

+

Try to sanitize given function variables within your function.

+

The auth class should be used for all authorisation checking.

+

No attempt should be made to remove any copyright information (either contained within the source or displayed interactively when the source is run/compiled), neither should the copyright information be altered in any way (it may be added to).

+ +

Variables:

+

Make use of the \phpbb\request\request class for everything.

+

The $request->variable() method determines the type to set from the second parameter (which determines the default value too). If you need to get a scalar variable type, you need to tell this the variable() method explicitly. Examples:

+ +

// Old method, do not use it

+
+$start = (isset($HTTP_GET_VARS['start'])) ? intval($HTTP_GET_VARS['start']) : intval($HTTP_POST_VARS['start']);
+$submit = (isset($HTTP_POST_VARS['submit'])) ? true : false;
+	
+ +

// Use request var and define a default variable (use the correct type)

+
+$start = $request->variable('start', 0);
+$submit = $request->is_set_post('submit');
+	
+ +

// $start is an int, the following use of $request->variable() therefore is not allowed

+
+$start = $request->variable('start', '0');
+	
+ +

// Getting an array, keys are integers, value defaults to 0

+
+$mark_array = $request->variable('mark', array(0));
+	
+ +

// Getting an array, keys are strings, value defaults to 0

+
+$action_ary = $request->variable('action', array('' => 0));
+	
+ +

Login checks/redirection:

+

To show a forum login box use login_forum_box($forum_data), else use the login_box() function.

+ +

$forum_data should contain at least the forum_id and forum_password fields. If the field forum_name is available, then it is displayed on the forum login page.

+ +

The login_box() function can have a redirect as the first parameter. As a thumb of rule, specify an empty string if you want to redirect to the users current location, else do not add the $SID to the redirect string (for example within the ucp/login we redirect to the board index because else the user would be redirected to the login screen).

+ +

Sensitive Operations:

+

For sensitive operations always let the user confirm the action. For the confirmation screens, make use of the confirm_box() function.

+ +

Altering Operations:

+

For operations altering the state of the database, for instance posting, always verify the form token, unless you are already using confirm_box(). To do so, make use of the add_form_key() and check_form_key() functions.

+
+	add_form_key('my_form');
+
+	if ($submit)
+	{
+		if (!check_form_key('my_form'))
+		{
+			trigger_error('FORM_INVALID');
+		}
+	}
+	
+ +

The string passed to add_form_key() needs to match the string passed to check_form_key(). Another requirement for this to work correctly is that all forms include the {S_FORM_TOKEN} template variable.

+ + +

Sessions:

+

Sessions should be initiated on each page, as near the top as possible using the following code:

+ +
+$user->session_begin();
+$auth->acl($user->data);
+$user->setup();
+	
+ +

The $user->setup() call can be used to pass on additional language definition and a custom style (used in viewforum).

+ +

Errors and messages:

+

All messages/errors should be outputted by calling trigger_error() using the appropriate message type and language string. Example:

+ +
+trigger_error('NO_FORUM');
+	
+ +
+trigger_error($user->lang['NO_FORUM']);
+	
+ +
+trigger_error('NO_MODE', E_USER_ERROR);
+	
+ +

Url formatting

+ +

All urls pointing to internal files need to be prepended by the $phpbb_root_path variable. Within the administration control panel all urls pointing to internal files need to be prepended by the $phpbb_admin_path variable. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended (though some links will fail and the code need to be slightly adjusted).

+ +

The append_sid() function from 2.0.x is available too, though it does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:

+ +
+append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id'])
+	
+ +

General function usage:

+ +

Some of these functions are only chosen over others because of personal preference and have no benefit other than maintaining consistency throughout the code.

+ +
    +
  • +

    Use sizeof instead of count

    +
  • +
  • +

    Use strpos instead of strstr

    +
  • +
  • +

    Use else if instead of elseif

    +
  • +
  • +

    Use false (lowercase) instead of FALSE

    +
  • +
  • +

    Use true (lowercase) instead of TRUE

    +
  • +
+ +

Exiting

+ +

Your page should either call page_footer() in the end to trigger output through the template engine and terminate the script, or alternatively at least call the exit_handler(). That call is necessary because it provides a method for external applications embedding phpBB to be called at the end of the script.

+ +

2.vi. Restrictions on the Use of PHP

+ +

Dynamic code execution:

+ +

Never execute dynamic PHP code (generated or in a constant string) using any of the following PHP functions:

+ +
    +
  • eval
  • +
  • create_function
  • +
  • preg_replace with the e modifier in the pattern
  • +
+ +

If absolutely necessary a file should be created, and a mechanism for creating this file prior to running phpBB should be provided as a setup process.

+ +

The e modifier in preg_replace can be replaced by preg_replace_callback and objects to encapsulate state that is needed in the callback code.

+ +

Other functions, operators, statements and keywords:

+ +

The following PHP statements should also not be used in phpBB:

+ +
    +
  • goto
  • +
+ +
+ + + +
+
+ +
+ +

3. Styling

+
+
+ +
+

3.i. Style Config Files

+

Style cfg files are simple name-value lists with the information necessary for installing a style. The important part of the style configuration file is assigning an unique name.

+
+# General Information about this style
+name = prosilver_duplicate
+copyright = © phpBB Limited, 2007
+style_version = 3.1.0
+phpbb_version = 3.1.0
+
+# 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 = prosilver
+	
+

3.2. General Styling Rules

+

Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms). Please also note that the indentation and coding guidelines also apply to templates where possible.

+ +

The outer table class forumline has gone and is replaced with tablebg.

+

When writing <table> the order <table class="" cellspacing="" cellpadding="" border="" align=""> creates consistency and allows everyone to easily see which table produces which "look". The same applies to most other tags for which additional parameters can be set, consistency is the major aim here.

+

Each block level element should be indented by one tab, same for tabular elements, e.g. <tr> <td> etc., whereby the intendiation of <table> and the following/ending <tr> should be on the same line. This applies not to div elements of course.

+

Don't use <span> more than is essential ... the CSS is such that text sizes are dependent on the parent class. So writing <span class="gensmall"><span class="gensmall">TEST</span></span> will result in very very small text. Similarly don't use span at all if another element can contain the class definition, e.g.

+ +
+<td><span class="gensmall">TEST</span></td>
+
+ +

can just as well become:

+
+<td class="gensmall">TEST</td>
+
+ +

Try to match text class types with existing useage, e.g. don't use the nav class where viewtopic uses gensmall for example.

+ +

Row colours/classes are now defined by the template, use an IF S_ROW_COUNT switch, see viewtopic or viewforum for an example.

+ +

Remember block level ordering is important.

+ +

Use a standard cellpadding of 2 and cellspacing of 0 on outer tables. Inner tables can vary from 0 to 3 or even 4 depending on the need.

+ +

Use div container/css for styling and table for data representation.

+ +

The separate catXXXX and thXXX classes are gone. When defining a header cell just use <th> rather than <th class="thHead"> etc. Similarly for cat, don't use <td class="catLeft"> use <td class="cat"> etc.

+ +

Try to retain consistency of basic layout and class useage, i.e. _EXPLAIN text should generally be placed below the title it explains, e.g. {L_POST_USERNAME}<br /><span class="gensmall">{L_POST_USERNAME_EXPLAIN}</span> is the typical way of handling this ... there may be exceptions and this isn't a hard and fast rule.

+ +

Try to keep template conditional and other statements tabbed in line with the block to which they refer.

+ +

this is correct

+
+<!-- BEGIN test -->
+	<tr>
+		<td>{test.TEXT}</td>
+	</tr>
+<!-- END test -->
+
+ +

this is also correct:

+
+<!-- BEGIN test -->
+<tr>
+	<td>{test.TEXT}</td>
+</tr>
+<!-- END test -->
+
+ +

it gives immediate feedback on exactly what is looping - decide which way to use based on the readability.

+ +
+ + + +
+
+ +
+ +

4. Templating

+
+
+ +
+

4.i. General Templating

+ +

File naming

+

Firstly templates now take the suffix ".html" rather than ".tpl". This was done simply to make the lives of some people easier wrt syntax highlighting, etc.

+ +

Variables

+

All template variables should be named appropriately (using underscores for spaces), language entries should be prefixed with L_, system data with S_, urls with U_, javascript urls with UA_, language to be put in javascript statements with LA_, all other variables should be presented 'as is'.

+ +

L_* template variables are automatically mapped to the corresponding language entry if the code does not set (and therefore overwrite) this variable specifically and if the language entry exists. For example {L_USERNAME} maps to $user->lang['USERNAME']. The LA_* template variables are handled within the same way, but properly escaped so they can be put in javascript code. This should reduce the need to assign loads of new language variables in MODifications. +

+ +

Blocks/Loops

+

The basic block level loop remains and takes the form:

+
+<!-- BEGIN loopname -->
+	markup, {loopname.X_YYYYY}, etc.
+<!-- END loopname -->
+
+ +

A bit later loops will be explained further. To not irritate you we will explain conditionals as well as other statements first.

+ +

Including files

+

Something that existed in 2.0.x which no longer exists in 3.x is the ability to assign a template to a variable. This was used (for example) to output the jumpbox. Instead (perhaps better, perhaps not but certainly more flexible) we now have INCLUDE. This takes the simple form:

+ +
+<!-- INCLUDE filename -->
+
+ +

You will note in the 3.x templates the major sources start with <!-- INCLUDE overall_header.html --> or <!-- INCLUDE simple_header.html -->, etc. In 2.0.x control of "which" header to use was defined entirely within the code. In 3.x the template designer can output what they like. Note that you can introduce new templates (i.e. other than those in the default set) using this system and include them as you wish ... perhaps useful for a common "menu" bar or some such. No need to modify loads of files as with 2.0.x.

+ +

Added in 3.0.6 is the ability to include a file using a template variable to specify the file, this functionality only works for root variables (i.e. not block variables).

+
+<!-- INCLUDE {FILE_VAR} -->
+
+ +

Template defined variables can also be utilised.

+ +
+<!-- DEFINE $SOME_VAR = 'my_file.html' -->
+<!-- INCLUDE {$SOME_VAR} -->
+
+ +

PHP

+

A contentious decision has seen the ability to include PHP within the template introduced. This is achieved by enclosing the PHP within relevant tags:

+ +
+<!-- PHP -->
+	echo "hello!";
+<!-- ENDPHP -->
+
+ +

You may also include PHP from an external file using:

+ +
+<!-- INCLUDEPHP somefile.php -->
+
+ +

it will be included and executed inline.

A note, it is very much encouraged that template designers do not include PHP. The ability to include raw PHP was introduced primarily to allow end users to include banner code, etc. without modifying multiple files (as with 2.0.x). It was not intended for general use ... hence www.phpbb.com will not make available template sets which include PHP. And by default templates will have PHP disabled (the admin will need to specifically activate PHP for a template).

+ +

Conditionals/Control structures

+

The most significant addition to 3.x are conditions or control structures, "if something then do this else do that". The system deployed is very similar to Smarty. This may confuse some people at first but it offers great potential and great flexibility with a little imagination. In their most simple form these constructs take the form:

+ +
+<!-- IF expr -->
+	markup
+<!-- ENDIF -->
+
+ +

expr can take many forms, for example:

+ +
+<!-- IF loop.S_ROW_COUNT is even -->
+	markup
+<!-- ENDIF -->
+
+ +

This will output the markup if the S_ROW_COUNT variable in the current iteration of loop is an even value (i.e. the expr is TRUE). You can use various comparison methods (standard as well as equivalent textual versions noted in square brackets) including (not, or, and, eq, neq, is should be used if possible for better readability):

+ +
+== [eq]
+!= [neq, ne]
+<> (same as !=)
+!== (not equivalent in value and type)
+=== (equivalent in value and type)
+> [gt]
+< [lt]
+>= [gte]
+<= [lte]
+&& [and]
+|| [or]
+% [mod]
+! [not]
++
+-
+*
+/
+,
+<< (bitwise shift left)
+>> (bitwise shift right)
+| (bitwise or)
+^ (bitwise xor)
+& (bitwise and)
+~ (bitwise not)
+is (can be used to join comparison operations)
+
+ +

Basic parenthesis can also be used to enforce good old BODMAS rules. Additionally some basic comparison types are defined:

+ +
+even
+odd
+div
+
+ +

Beyond the simple use of IF you can also do a sequence of comparisons using the following:

+ +
+<!-- IF expr1 -->
+	markup
+<!-- ELSEIF expr2 -->
+	markup
+	.
+	.
+	.
+<!-- ELSEIF exprN -->
+	markup
+<!-- ELSE -->
+	markup
+<!-- ENDIF -->
+
+ +

Each statement will be tested in turn and the relevant output generated when a match (if a match) is found. It is not necessary to always use ELSEIF, ELSE can be used alone to match "everything else".

So what can you do with all this? Well take for example the colouration of rows in viewforum. In 2.0.x row colours were predefined within the source as either row color1, row color2 or row class1, row class2. In 3.x this is moved to the template, it may look a little daunting at first but remember control flows from top to bottom and it's not too difficult:

+ +
+<table>
+	<!-- IF loop.S_ROW_COUNT is even -->
+		<tr class="row1">
+	<!-- ELSE -->
+		<tr class="row2">
+	<!-- ENDIF -->
+	<td>HELLO!</td>
+</tr>
+</table>
+
+ +

This will cause the row cell to be output using class row1 when the row count is even, and class row2 otherwise. The S_ROW_COUNT parameter gets assigned to loops by default. Another example would be the following:

+ +
+<table>
+	<!-- IF loop.S_ROW_COUNT > 10 -->
+		<tr bgcolor="#FF0000">
+	<!-- ELSEIF loop.S_ROW_COUNT > 5 -->
+		<tr bgcolor="#00FF00">
+	<!-- ELSEIF loop.S_ROW_COUNT > 2 -->
+		<tr bgcolor="#0000FF">
+	<!-- ELSE -->
+		<tr bgcolor="#FF00FF">
+	<!-- ENDIF -->
+	<td>hello!</td>
+</tr>
+</table>
+
+ +

This will output the row cell in purple for the first two rows, blue for rows 2 to 5, green for rows 5 to 10 and red for remainder. So, you could produce a "nice" gradient effect, for example.

What else can you do? Well, you could use IF to do common checks on for example the login state of a user:

+ +
+<!-- IF S_USER_LOGGED_IN -->
+	markup
+<!-- ENDIF -->
+
+ +

This replaces the existing (fudged) method in 2.0.x using a zero length array and BEGIN/END.

+ +

Extended syntax for Blocks/Loops

+ +

Back to our loops - they had been extended with the following additions. Firstly you can set the start and end points of the loop. For example:

+ +
+<!-- BEGIN loopname(2) -->
+	markup
+<!-- END loopname -->
+
+ +

Will start the loop on the third entry (note that indexes start at zero). Extensions of this are: +

+loopname(2): Will start the loop on the 3rd entry
+loopname(-2): Will start the loop two entries from the end
+loopname(3,4): Will start the loop on the fourth entry and end it on the fifth
+loopname(3,-4): Will start the loop on the fourth entry and end it four from last
+

+ +

A further extension to begin is BEGINELSE:

+ +
+<!-- BEGIN loop -->
+	markup
+<!-- BEGINELSE -->
+	markup
+<!-- END loop -->
+
+ +

This will cause the markup between BEGINELSE and END to be output if the loop contains no values. This is useful for forums with no topics (for example) ... in some ways it replaces "bits of" the existing "switch_" type control (the rest being replaced by conditionals).

+ +

Another way of checking if a loop contains values is by prefixing the loops name with a dot:

+ +
+<!-- IF .loop -->
+	<!-- BEGIN loop -->
+		markup
+	<!-- END loop -->
+<!-- ELSE -->
+	markup
+<!-- ENDIF -->
+
+ +

You are even able to check the number of items within a loop by comparing it with values within the IF condition:

+ +
+<!-- IF .loop > 2 -->
+	<!-- BEGIN loop -->
+		markup
+	<!-- END loop -->
+<!-- ELSE -->
+	markup
+<!-- ENDIF -->
+
+ +

Nesting loops cause the conditionals needing prefixed with all loops from the outer one to the inner most. An illustration of this:

+ +
+<!-- BEGIN firstloop -->
+	{firstloop.MY_VARIABLE_FROM_FIRSTLOOP}
+
+	<!-- BEGIN secondloop -->
+		{firstloop.secondloop.MY_VARIABLE_FROM_SECONDLOOP}
+	<!-- END secondloop -->
+<!-- END firstloop -->
+
+ +

Sometimes it is necessary to break out of nested loops to be able to call another loop within the current iteration. This sounds a little bit confusing and it is not used very often. The following (rather complex) example shows this quite good - it also shows how you test for the first and last row in a loop (i will explain the example in detail further down):

+ +
+<!-- BEGIN l_block1 -->
+	<!-- IF l_block1.S_SELECTED -->
+		<strong>{l_block1.L_TITLE}</strong>
+		<!-- IF S_PRIVMSGS -->
+
+			<!-- the ! at the beginning of the loop name forces the loop to be not a nested one of l_block1 -->
+			<!-- BEGIN !folder -->
+				<!-- IF folder.S_FIRST_ROW -->
+					<ul class="nav">
+				<!-- ENDIF -->
+
+				<li><a href="{folder.U_FOLDER}">{folder.FOLDER_NAME}</a></li>
+
+				<!-- IF folder.S_LAST_ROW -->
+					</ul>
+				<!-- ENDIF -->
+			<!-- END !folder -->
+
+		<!-- ENDIF -->
+
+		<ul class="nav">
+		<!-- BEGIN l_block2 -->
+			<li>
+				<!-- IF l_block1.l_block2.S_SELECTED -->
+					<strong>{l_block1.l_block2.L_TITLE}</strong>
+				<!-- ELSE -->
+					<a href="{l_block1.l_block2.U_TITLE}">{l_block1.l_block2.L_TITLE}</a>
+				<!-- ENDIF -->
+			</li>
+		<!-- END l_block2 -->
+		</ul>
+	<!-- ELSE -->
+		<a class="nav" href="{l_block1.U_TITLE}">{l_block1.L_TITLE}</a>
+	<!-- ENDIF -->
+<!-- END l_block1 -->
+
+ +

Let us first concentrate on this part of the example:

+ +
+<!-- BEGIN l_block1 -->
+	<!-- IF l_block1.S_SELECTED -->
+		markup
+	<!-- ELSE -->
+		<a class="nav" href="{l_block1.U_TITLE}">{l_block1.L_TITLE}</a>
+	<!-- ENDIF -->
+<!-- END l_block1 -->
+
+ +

Here we open the loop l_block1 and do some things if the value S_SELECTED within the current loop iteration is true, else we write the blocks link and title. Here, you see {l_block1.L_TITLE} referenced - you remember that L_* variables get automatically assigned the corresponding language entry? This is true, but not within loops. The L_TITLE variable within the loop l_block1 is assigned within the code itself.

+ +

Let's have a closer look at the markup:

+ +
+<!-- BEGIN l_block1 -->
+.
+.
+	<!-- IF S_PRIVMSGS -->
+
+		<!-- BEGIN !folder -->
+			<!-- IF folder.S_FIRST_ROW -->
+				<ul class="nav">
+			<!-- ENDIF -->
+
+			<li><a href="{folder.U_FOLDER}">{folder.FOLDER_NAME}</a></li>
+
+			<!-- IF folder.S_LAST_ROW -->
+				</ul>
+			<!-- ENDIF -->
+		<!-- END !folder -->
+
+	<!-- ENDIF -->
+.
+.
+<!-- END l_block1 -->
+
+ +

The <!-- IF S_PRIVMSGS --> statement clearly checks a global variable and not one within the loop, since the loop is not given here. So, if S_PRIVMSGS is true we execute the shown markup. Now, you see the <!-- BEGIN !folder --> statement. The exclamation mark is responsible for instructing the template engine to iterate through the main loop folder. So, we are now within the loop folder - with <!-- BEGIN folder --> we would have been within the loop l_block1.folder automatically as is the case with l_block2:

+ +
+<!-- BEGIN l_block1 -->
+.
+.
+	<ul class="nav">
+	<!-- BEGIN l_block2 -->
+		<li>
+			<!-- IF l_block1.l_block2.S_SELECTED -->
+				<strong>{l_block1.l_block2.L_TITLE}</strong>
+			<!-- ELSE -->
+				<a href="{l_block1.l_block2.U_TITLE}">{l_block1.l_block2.L_TITLE}</a>
+			<!-- ENDIF -->
+		</li>
+	<!-- END l_block2 -->
+	</ul>
+.
+.
+<!-- END l_block1 -->
+
+ +

You see the difference? The loop l_block2 is a member of the loop l_block1 but the loop folder is a main loop.

+ +

Now back to our folder loop:

+ +
+<!-- IF folder.S_FIRST_ROW -->
+	<ul class="nav">
+<!-- ENDIF -->
+
+<li><a href="{folder.U_FOLDER}">{folder.FOLDER_NAME}</a></li>
+
+<!-- IF folder.S_LAST_ROW -->
+	</ul>
+<!-- ENDIF -->
+
+ +

You may have wondered what the comparison to S_FIRST_ROW and S_LAST_ROW is about. If you haven't guessed already - it is checking for the first iteration of the loop with S_FIRST_ROW and the last iteration with S_LAST_ROW. This can come in handy quite often if you want to open or close design elements, like the above list. Let us imagine a folder loop build with three iterations, it would go this way:

+ +
+<ul class="nav"> <!-- written on first iteration -->
+	<li>first element</li> <!-- written on first iteration -->
+	<li>second element</li> <!-- written on second iteration -->
+	<li>third element</li> <!-- written on third iteration -->
+</ul> <!-- written on third iteration -->
+
+ +

As you can see, all three elements are written down as well as the markup for the first iteration and the last one. Sometimes you want to omit writing the general markup - for example:

+ +
+<!-- IF folder.S_FIRST_ROW -->
+	<ul class="nav">
+<!-- ELSEIF folder.S_LAST_ROW -->
+	</ul>
+<!-- ELSE -->
+	<li><a href="{folder.U_FOLDER}">{folder.FOLDER_NAME}</a></li>
+<!-- ENDIF -->
+
+ +

would result in the following markup:

+ +
+<ul class="nav"> <!-- written on first iteration -->
+	<li>second element</li> <!-- written on second iteration -->
+</ul> <!-- written on third iteration -->
+
+ +

Just always remember that processing is taking place from top to bottom.

+ +

Forms

+

If a form is used for a non-trivial operation (i.e. more than a jumpbox), then it should include the {S_FORM_TOKEN} template variable.

+
+<form method="post" id="mcp" action="{U_POST_ACTION}">
+
+	<fieldset class="submit-buttons">
+		<input type="reset" value="{L_RESET}" name="reset" class="button2" /> 
+		<input type="submit" name="action[add_warning]" value="{L_SUBMIT}" class="button1" />
+		{S_FORM_TOKEN}
+	</fieldset>
+</form>
+		

+ +

4.ii. Styles Tree

+

When basing a new style on an existing one, it is not necessary to provide all the template files. By declaring the base style name in the parent field in the style configuration file, the style can be set to reuse template files from the parent style.

+ +

The effect of doing so is that the template engine will use the template files in the new style where they exist, but fall back to files in the parent style otherwise.

+ +

We strongly encourage the use of parent styles for styles based on the bundled styles, as it will ease the update procedure.

+ +
+# General Information about this style
+name = Custom Style
+copyright = © phpBB Limited, 2007
+style_version = 3.1.0-b1
+phpbb_version = 3.1.0-b1
+
+# 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 = prosilver
+		
+ +

4.iii. Template Events

+

Template events must follow this format: <!-- EVENT event_name -->

+

Using the above example, files named event_name.html located within extensions will be injected into the location of the event.

+ +

Template event naming guidelines:

+
    +
  • An event name must be all lowercase, with each word separated by an underscore.
  • +
  • An event name must briefly describe the location and purpose of the event.
  • +
  • + An event name must end with one of the following suffixes: +
      +
    • _prepend - This event adds an item to the beginning of a block of related items, or adds to the beginning of individual items in a block.
    • +
    • _append - This event adds an item to the end of a block of related items, or adds to the end of individual items in a block.
    • +
    • _before - This event adds content directly before the specified block
    • +
    • _after - This event adds content directly after the specified block
    • +
    +
  • +
+ +

Template event documentation

+

Events must be documented in phpBB/docs/events.md in alphabetical order based on the event name. The format is as follows:

+ +
  • An event found in only one template file: +
    event_name
    +===
    +* Location: styles/<style_name>/template/filename.html
    +* Purpose: A brief description of what this event should be used for.
    +This may span multiple lines.
    +* Since: Version since when the event was added
    +
  • +
  • An event found in multiple template files: +
    event_name
    +===
    +* Locations:
    +    + first/file/path.html
    +    + second/file/path.html
    +* Purpose: Same as above.
    +* Since: 3.1.0-b1
    +
    +
  • An event that is found multiple times in a file should have the number of instances in parenthesis next to the filename. +
    event_name
    +===
    +* Locations:
    +    + first/file/path.html (2)
    +    + second/file/path.html
    +* Purpose: Same as above.
    +* Since: 3.1.0-b1
    +
  • +
  • An actual example event documentation: +
    forumlist_body_last_post_title_prepend
    +====
    +* Locations:
    +    + styles/prosilver/template/forumlist_body.html
    +    + styles/subsilver2/template/forumlist_body.html
    +* Purpose: Add content before the post title of the latest post in a forum on the forum list.
    +* Since: 3.1.0-a1
    +

+ +
+ + + +
+
+ +
+ + + +

5. Character Sets and Encodings

+ +
+
+ +
+ + + +

What are Unicode, UCS and UTF-8?

+

The Universal Character Set (UCS) described in ISO/IEC 10646 consists of a large amount of characters. Each of them has a unique name and a code point which is an integer number. Unicode - which is an industry standard - complements the Universal Character Set with further information about the characters' properties and alternative character encodings. More information on Unicode can be found on the Unicode Consortium's website. One of the Unicode encodings is the 8-bit Unicode Transformation Format (UTF-8). It encodes characters with up to four bytes aiming for maximum compatibility with the American Standard Code for Information Interchange which is a 7-bit encoding of a relatively small subset of the UCS.

+ +

phpBB's use of Unicode

+

Unfortunately PHP does not faciliate the use of Unicode prior to version 6. Most functions simply treat strings as sequences of bytes assuming that each character takes up exactly one byte. This behaviour still allows for storing UTF-8 encoded text in PHP strings but many operations on strings have unexpected results. To circumvent this problem we have created some alternative functions to PHP's native string operations which use code points instead of bytes. These functions can be found in /includes/utf/utf_tools.php. They are also covered in the phpBB3 Sourcecode Documentation. A lot of native PHP functions still work with UTF-8 as long as you stick to certain restrictions. For example explode still works as long as the first and the last character of the delimiter string are ASCII characters.

+ +

phpBB only uses the ASCII and the UTF-8 character encodings. Still all Strings are UTF-8 encoded because ASCII is a subset of UTF-8. The only exceptions to this rule are code sections which deal with external systems which use other encodings and character sets. Such external data should be converted to UTF-8 using the utf8_recode() function supplied with phpBB. It supports a variety of other character sets and encodings, a full list can be found below.

+ +

With $request->variable() you can either allow all UCS characters in user input or restrict user input to ASCII characters. This feature is controlled by the method's third parameter called $multibyte. You should allow multibyte characters in posts, PMs, topic titles, forum names, etc. but it's not necessary for internal uses like a $mode variable which should only hold a predefined list of ASCII strings anyway.

+ +
+// an input string containing a multibyte character
+$_REQUEST['multibyte_string'] = 'Käse';
+
+// print request variable as a UTF-8 string allowing multibyte characters
+echo $request->variable('multibyte_string', '', true);
+// print request variable as ASCII string
+echo $request->variable('multibyte_string', '');
+
+ +

This code snippet will generate the following output:

+ +
+Käse
+K??se
+
+ +

Case Folding

+ +

Case insensitive comparison of strings is no longer possible with strtolower or strtoupper as some characters have multiple lower case or multiple upper case forms depending on their position in a word. The utf8_strtolower and the utf8_strtoupper functions suffer from the same problem so they can only be used to display upper/lower case versions of a string but they cannot be used for case insensitive comparisons either. So instead you should use case folding which gives you a case insensitive version of the string which can be used for case insensitive comparisons. An NFC normalized string can be case folded using utf8_case_fold_nfc().

+ +

// Bad - The strings might be the same even if strtolower differs

+ +
+if (strtolower($string1) == strtolower($string2))
+{
+	echo '$string1 and $string2 are equal or differ in case';
+}
+
+ +

// Good - Case folding is really case insensitive

+ +
+if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
+{
+	echo '$string1 and $string2 are equal or differ in case';
+}
+
+ +

Confusables Detection

+ +

phpBB offers a special method utf8_clean_string which can be used to make sure string identifiers are unique. This method uses Normalization Form Compatibility Composition (NFKC) instead of NFC and replaces similarly looking characters with a particular representative of the equivalence class. This method is currently used for usernames and group names to avoid confusion with similarly looking names.

+ +
+ + + +
+
+ +
+ +

6. Translation (i18n/L10n) Guidelines

+ +
+
+ +
+ +

6.i. Standardisation

+ +

Reason:

+ +

phpBB is one of the most translated open-source projects, with the current stable version being available in over 60 localisations. Whilst the ad hoc approach to the naming of language packs has worked, for phpBB3 and beyond we hope to make this process saner which will allow for better interoperation with current and future web browsers.

+ +

Encoding:

+ +

With phpBB3, the output encoding for the forum in now UTF-8, a Universal Character Encoding by the Unicode Consortium that is by design a superset to US-ASCII and ISO-8859-1. By using one character set which simultaenously supports all scripts which previously would have required different encodings (eg: ISO-8859-1 to ISO-8859-15 (Latin, Greek, Cyrillic, Thai, Hebrew, Arabic); GB2312 (Simplified Chinese); Big5 (Traditional Chinese), EUC-JP (Japanese), EUC-KR (Korean), VISCII (Vietnamese); et cetera), we remove the need to convert between encodings and improves the accessibility of multilingual forums.

+ +

The impact is that the language files for phpBB must now also be encoded as UTF-8, with a caveat that the files must not contain a BOM for compatibility reasons with non-Unicode aware versions of PHP. For those with forums using the Latin character set (ie: most European languages), this change is transparent since UTF-8 is superset to US-ASCII and ISO-8859-1.

+ +

Language Tag:

+ +

The IETF recently published RFC 4646 for tags used to identify languages, which in combination with RFC 4647 obseletes the older RFC 3006 and older-still RFC 1766. RFC 4646 uses ISO 639-1/ISO 639-2, ISO 3166-1 alpha-2, ISO 15924 and UN M.49 to define a language tag. Each complete tag is composed of subtags which are not case sensitive and can also be empty.

+ +

Ordering of the subtags in the case that they are all non-empty is: language-script-region-variant-extension-privateuse. Should any subtag be empty, its corresponding hyphen would also be ommited. Thus, the language tag for English will be en and not en-----.

+ +

Most language tags consist of a two- or three-letter language subtag (from ISO 639-1/ISO 639-2). Sometimes, this is followed by a two-letter or three-digit region subtag (from ISO 3166-1 alpha-2 or UN M.49). Some examples are:

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Examples of various possible language tags as described by RFC 4646 and RFC 4647
Language tagDescriptionComponent subtags
enEnglishlanguage
masMasailanguage
fr-CAFrench as used in Canadalanguage+region
en-833English as used in the Isle of Manlanguage+region
zh-HansChinese written with Simplified scriptlanguage+script
zh-Hant-HKChinese written with Traditional script as used in Hong Konglanguage+script+region
de-AT-1996German as used in Austria with 1996 orthographylanguage+region+variant
+ +

The ultimate aim of a language tag is to convey the needed useful distingushing information, whilst keeping it as short as possible. So for example, use en, fr and ja as opposed to en-GB, fr-FR and ja-JP, since we know English, French and Japanese are the native language of Great Britain, France and Japan respectively.

+ +

Next is the ISO 15924 language script code and when one should or shouldn't use it. For example, whilst en-Latn is syntaxically correct for describing English written with Latin script, real world English writing is more-or-less exclusively in the Latin script. For such languages like English that are written in a single script, the IANA Language Subtag Registry has a "Suppress-Script" field meaning the script code should be ommitted unless a specific language tag requires a specific script code. Some languages are written in more than one script and in such cases, the script code is encouraged since an end-user may be able to read their language in one script, but not the other. Some examples are:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Examples of using a language subtag in combination with a script subtag
Language tagDescriptionComponent subtags
en-BraiEnglish written in Braille scriptlanguage+script
en-DsrtEnglish written in Deseret (Mormon) scriptlanguage+script
sr-LatnSerbian written in Latin scriptlanguage+script
sr-CyrlSerbian written in Cyrillic scriptlanguage+script
mn-MongMongolian written in Mongolian scriptlanguage+script
mn-CyrlMongolian written in Cyrillic scriptlanguage+script
mn-PhagMongolian written in Phags-pa scriptlanguage+script
az-Cyrl-AZAzerbaijani written in Cyrillic script as used in Azerbaijanlanguage+script+region
az-Latn-AZAzerbaijani written in Latin script as used in Azerbaijanlanguage+script+region
az-Arab-IRAzerbaijani written in Arabic script as used in Iranlanguage+script+region
+ +

Usage of the three-digit UN M.49 code over the two-letter ISO 3166-1 alpha-2 code should hapen if a macro-geographical entity is required and/or the ISO 3166-1 alpha-2 is ambiguous.

+ +

Examples of English using marco-geographical regions:

+ + + + + + + + + + + + + + + + + + + + + + + +
Coding for English using macro-geographical regions (examples for English of ISO 3166-1 alpha-2 vs. UN M.49 code)
ISO 639-1/ISO 639-2 + ISO 3166-1 alpha-2ISO 639-1/ISO 639-2 + UN M.49 (Example macro regions)
en-AU
English as used in Australia
en-053
English as used in Australia & New Zealand
en-009
English as used in Oceania
en-NZ
English as used in New Zealand
en-FJ
English as used in Fiji
en-054
English as used in Melanesia
+ +

Examples of Spanish using marco-geographical regions:

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Coding for Spanish macro-geographical regions (examples for Spanish of ISO 3166-1 alpha-2 vs. UN M.49 code)
ISO 639-1/ISO 639-2 + ISO 3166-1 alpha-2ISO 639-1/ISO 639-2 + UN M.49 (Example macro regions)
es-PR
Spanish as used in Puerto Rico
es-419
Spanish as used in Latin America & the Caribbean
es-019
Spanish as used in the Americas
es-HN
Spanish as used in Honduras
es-AR
Spanish as used in Argentina
es-US
Spanish as used in United States of America
es-021
Spanish as used in North America
+ +

Example of where the ISO 3166-1 alpha-2 is ambiguous and why UN M.49 might be preferred:

+ + + + + + + + + + + + + + + + + + + + + +
Coding for ambiguous ISO 3166-1 alpha-2 regions
CS assignment pre-1994CS assignment post-1994
+
+
CS
Czechoslovakia (ISO 3166-1)
+
200
Czechoslovakia (UN M.49)
+
+
+
+
CS
Serbian & Montenegro (ISO 3166-1)
+
891
Serbian & Montenegro (UN M.49)
+
+
+
+
CZ
Czech Republic (ISO 3166-1)
+
203
Czech Republic (UN M.49)
+
+
+
+
SK
Slovakia (ISO 3166-1)
+
703
Slovakia (UN M.49)
+
+
+
+
RS
Serbia (ISO 3166-1)
+
688
Serbia (UN M.49)
+
+
+
+
ME
Montenegro (ISO 3166-1)
+
499
Montenegro (UN M.49)
+
+
+ +

Macro-languages & Topolects:

+ +

RFC 4646 anticipates features which shall be available in (currently draft) ISO 639-3 which aims to provide as complete enumeration of languages as possible, including living, extinct, ancient and constructed languages, whether majour, minor or unwritten. A new feature of ISO 639-3 compared to the previous two revisions is the concept of macrolanguages where Arabic and Chinese are two such examples. In such cases, their respective codes of ar and zh is very vague as to which dialect/topolect is used or perhaps some terse classical variant which may be difficult for all but very educated users. For such macrolanguages, it is recommended that the sub-language tag is used as a suffix to the macrolanguage tag, eg:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Macrolanguage subtag + sub-language subtag examples
Language tagDescriptionComponent subtags
zh-cmnMandarin (Putonghau/Guoyu) Chinesemacrolanguage+sublanguage
zh-yueYue (Cantonese) Chinesemacrolanguage+sublanguage
zh-cmn-HansMandarin (Putonghau/Guoyu) Chinese written in Simplified scriptmacrolanguage+sublanguage+script
zh-cmn-HantMandarin (Putonghau/Guoyu) Chinese written in Traditional scriptmacrolanguage+sublanguage+script
zh-nan-Latn-TWMinnan (Hoklo) Chinese written in Latin script (POJ Romanisation) as used in Taiwanmacrolanguage+sublanguage+script+region
+ +

6.ii. Other considerations

+ +

Normalisation of language tags for phpBB:

+ +

For phpBB, the language tags are not used in their raw form and instead converted to all lower-case and have the hyphen - replaced with an underscore _ where appropriate, with some examples below:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Language tag normalisation examples
Raw language tagDescriptionValue of USER_LANG
in ./common.php
Language pack directory
name in /language/
enBritish Englishenen
de-ATGerman as used in Austriade-atde_at
es-419Spanish as used in Latin America & Caribbeanen-419en_419
zh-yue-Hant-HKCantonese written in Traditional script as used in Hong Kongzh-yue-hant-hkzh_yue_hant_hk
+ +

How to use iso.txt:

+ +

The iso.txt file is a small UTF-8 encoded plain-text file which consists of three lines:

+ +
    +
  1. Language's English name
  2. +
  3. Language's local name
  4. +
  5. Authors information
  6. +
+ +

iso.txt is automatically generated by the language pack submission system on phpBB.com. You don't have to create this file yourself if you plan on releasing your language pack on phpBB.com, but do keep in mind that phpBB itself does require this file to be present.

+ +

Because language tags themselves are meant to be machine read, they can be rather obtuse to humans and why descriptive strings as provided by iso.txt are needed. Whilst en-US could be fairly easily deduced to be "English as used in the United States", de-CH is more difficult less one happens to know that de is from "Deutsch", German for "German" and CH is the abbreviation of the official Latin name for Switzerland, "Confoederatio Helvetica".

+ +

For the English language description, the language name is always first and any additional attributes required to describe the subtags within the language code are then listed in order separated with commas and enclosed within parentheses, eg:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
English language description examples for iso.txt
Raw language tagEnglish description within iso.txt
enBritish English
en-USEnglish (United States)
en-053English (Australia & New Zealand)
deGerman
de-CH-1996German (Switzerland, 1996 orthography)
gws-1996Swiss German (1996 orthography)
zh-cmn-Hans-CNMandarin Chinese (Simplified, Mainland China)
zh-yue-Hant-HKCantonese Chinese (Traditional, Hong Kong)
+ +

For the localised language description, just translate the English version though use whatever appropriate punctuation typical for your own locale, assuming the language uses punctuation at all.

+ +

Unicode bi-directional considerations:

+ +

Because phpBB is now UTF-8, all translators must take into account that certain strings may be shown when the directionality of the document is either opposite to normal or is ambiguous.

+ +

The various Unicode control characters for bi-directional text and their HTML enquivalents where appropriate are as follows:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Unicode bidirectional control characters & HTML elements/entities
Unicode character
abbreviation
Unicode
code-point
Unicode character
name
Equivalent HTML
markup/entity
Raw character
(enclosed between '')
LRMU+200ELeft-to-Right Mark&lrm;'‎'
RLMU+200FRight-to-Left Mark&rlm;'‏'
LREU+202ALeft-to-Right Embeddingdir="ltr"'‪'
RLEU+202BRight-to-Left Embeddingdir="rtl"'‫'
PDFU+202CPop Directional Formatting</bdo>'‬'
LROU+202DLeft-to-Right Override<bdo dir="ltr">'‭'
RLOU+202ERight-to-Left Override<bdo dir="rtl">'‮'
+ +

For iso.txt, the directionality of the text can be explicitly set using special Unicode characters via any of the three methods provided by left-to-right/right-to-left markers/embeds/overrides, as without them, the ordering of characters will be incorrect, eg:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Unicode bidirectional control characters iso.txt
DirectionalityRaw character viewDisplay of localised
description in iso.txt
Ordering
dir="ltr"English (Australia & New Zealand)English (Australia & New Zealand)Correct
dir="rtl"English (Australia & New Zealand)English (Australia & New Zealand)Incorrect
dir="rtl" with LRMEnglish (Australia & New Zealand)U+200EEnglish (Australia & New Zealand)‎Correct
dir="rtl" with LRE & PDFU+202AEnglish (Australia & New Zealand)U+202C‪English (Australia & New Zealand)‬Correct
dir="rtl" with LRO & PDFU+202DEnglish (Australia & New Zealand)U+202C‭English (Australia & New Zealand)‬Correct
+ +

In choosing which of the three methods to use, in the majority of cases, the LRM or RLM to put a "strong" character to fully enclose an ambiguous punctuation character and thus make it inherit the correct directionality is sufficient.

+

Within some cases, there may be mixed scripts of a left-to-right and right-to-left direction, so using LRE & RLE with PDF may be more appropriate. Lastly, in very rare instances where directionality must be forced, then use LRO & RLO with PDF.

+

For further information on authoring techniques of bi-directional text, please see the W3C tutorial on authoring techniques for XHTML pages with bi-directional text.

+ +

6.iii. Working with placeholders

+ +

As phpBB is translated into languages with different ordering rules to that of English, it is possible to show specific values in any order deemed appropriate. Take for example the extremely simple "Page X of Y", whilst in English this could just be coded as:

+ +
+	...
+'PAGE_OF'	=>	'Page %s of %s',
+		/* Just grabbing the replacements as they
+		come and hope they are in the right order */
+	...
+	
+ +

… a clearer way to show explicit replacement ordering is to do:

+ +
+	...
+'PAGE_OF'	=>	'Page %1$s of %2$s',
+		/* Explicit ordering of the replacements,
+		even if they are the same order as English */
+	...
+	
+ +

Why bother at all? Because some languages, the string transliterated back to English might read something like:

+ +
+	...
+'PAGE_OF'	=>	'Total of %2$s pages, currently on page %1$s',
+		/* Explicit ordering of the replacements,
+		reversed compared to English as the total comes first */
+	...
+	
+ +

6.iv. Using plurals

+ +

+ The english language is very simple when it comes to plurals.
+ You have 0 elephants, 1 elephant, or 2+ elephants. So basically you have 2 different forms: one singular and one plural.
+ But for some other languages this is quite more difficult. Let's take the Bosnian language as another example:
+ You have [1/21/31] slon, [2/3/4] slona, [0/5/6] slonova and [7/8/9/11] ... and some more difficult rules. +

+ +

The plural system takes care of this and can be used as follows:

+ +

The PHP code will basically look like this:

+ +
+	...
+	$user->lang('NUMBER_OF_ELEPHANTS', $number_of_elephants);
+	...
+	
+ +

And the English translation would be:

+ +
+	...
+	'NUMBER_OF_ELEPHANTS'	=> array(
+		0	=> 'You have no elephants', // Optional special case for 0
+		1	=> 'You have 1 elephant', // Singular
+		2	=> 'You have %d elephants', // Plural
+	),
+	...
+	
+ +

While the Bosnian translation can have more cases:

+ +
+	...
+	'NUMBER_OF_ELEPHANTS'	=> array(
+		0	=> 'You have no slonova', // Optional special case for 0
+		1	=> 'You have %d slon', // Used for 1, 21, 31, ..
+		2	=> 'You have %d slona', // Used for 5, 6,
+		3	=> ...
+	),
+	...
+	
+ +

NOTE: It is okay to use plurals for an unknown number compared to a single item, when the number is not known and displayed:

+
+	...
+	'MODERATOR'	=> 'Moderator',  // Your board has 1 moderator
+	'MODERATORS'	=> 'Moderators', // Your board has multiple moderators
+	...
+	
+ +

6.v. Writing Style

+ +

Miscellaneous tips & hints:

+ +

As the language files are PHP files, where the various strings for phpBB are stored within an array which in turn are used for display within an HTML page, rules of syntax for both must be considered. Potentially problematic characters are: ' (straight quote/apostrophe), " (straight double quote), < (less-than sign), > (greater-than sign) and & (ampersand).

+ +

// Bad - The un-escapsed straight-quote/apostrophe will throw a PHP parse error

+ +
+	...
+'CONV_ERROR_NO_AVATAR_PATH'
+	=>	'Note to developer: you must specify $convertor['avatar_path'] to use %s.',
+	...
+	
+ +

// Good - Literal straight quotes should be escaped with a backslash, ie: \

+ +
+	...
+'CONV_ERROR_NO_AVATAR_PATH'
+	=>	'Note to developer: you must specify $convertor[\'avatar_path\'] to use %s.',
+	...
+	
+ +

However, because phpBB3 now uses UTF-8 as its sole encoding, we can actually use this to our advantage and not have to remember to escape a straight quote when we don't have to:

+ +

// Bad - The un-escapsed straight-quote/apostrophe will throw a PHP parse error

+ +
+	...
+'USE_PERMISSIONS'	=>	'Test out user's permissions',
+	...
+	
+ +

// Okay - However, non-programmers wouldn't type "user\'s" automatically

+ +
+	...
+'USE_PERMISSIONS'	=>	'Test out user\'s permissions',
+	...
+	
+ +

// Best - Use the Unicode Right-Single-Quotation-Mark character

+ +
+	...
+'USE_PERMISSIONS'	=>	'Test out user’s permissions',
+	...
+	
+ +

The " (straight double quote), < (less-than sign) and > (greater-than sign) characters can all be used as displayed glyphs or as part of HTML markup, for example:

+ +

// Bad - Invalid HTML, as segments not part of elements are not entitised

+ +
+	...
+'FOO_BAR'	=>	'PHP version < 5.3.3.<br />
+	Visit "Downloads" at <a href="http://www.php.net/">www.php.net</a>.',
+	...
+	
+ +

// Okay - No more invalid HTML, but "&quot;" is rather clumsy

+ +
+	...
+'FOO_BAR'	=>	'PHP version &lt; 5.3.3.<br />
+	Visit &quot;Downloads&quot; at <a href="http://www.php.net/">www.php.net</a>.',
+	...
+	
+ +

// Best - No more invalid HTML, and usage of correct typographical quotation marks

+ +
+	...
+'FOO_BAR'	=>	'PHP version &lt; 5.3.3.<br />
+	Visit “Downloads” at <a href="http://www.php.net/">www.php.net</a>.',
+	...
+	
+ +

Lastly, the & (ampersand) must always be entitised regardless of where it is used:

+ +

// Bad - Invalid HTML, none of the ampersands are entitised

+ +
+	...
+'FOO_BAR'	=>	'<a href="http://somedomain.tld/?foo=1&bar=2">Foo & Bar</a>.',
+	...
+	
+ +

// Good - Valid HTML, amperands are correctly entitised in all cases

+ +
+	...
+'FOO_BAR'	=>	'<a href="http://somedomain.tld/?foo=1&amp;bar=2">Foo &amp; Bar</a>.',
+	...
+	
+ +

As for how these charcters are entered depends very much on choice of Operating System, current language locale/keyboard configuration and native abilities of the text editor used to edit phpBB language files. Please see http://en.wikipedia.org/wiki/Unicode#Input_methods for more information.

+ +

Spelling, punctuation, grammar, et cetera:

+ +

The default language pack bundled with phpBB is British English using Cambridge University Press spelling and is assigned the language code en. The style and tone of writing tends towards formal and translations should emulate this style, at least for the variant using the most compact language code. Less formal translations or those with colloquialisms must be denoted as such via either an extension or privateuse tag within its language code.

+ +
+ + + +
+
+ +
+ +

7. Copyright and disclaimer

+ +
+
+ +
+ +

phpBB is free software, released under the terms of the GNU General Public License, version 2 (GPL-2.0). Copyright © phpBB Limited. For full copyright and license information, please see the docs/CREDITS.txt file.

+ +
+ + + +
+
+ + + + +
+ +
+ +
+ + + diff --git a/sources/phpBB/docs/corners_left.gif b/sources/phpBB/docs/corners_left.gif new file mode 100644 index 0000000000000000000000000000000000000000..206e50368daff146227113e91530849214569021 GIT binary patch literal 55 zcmZ?wbhEHbWMklAXkcXc|NlP&1B2pE7DfgJMg|=qn*k)lz{J-gm^kyquSIh%8{Ym< I$jV?10A!F3wg3PC literal 0 HcmV?d00001 diff --git a/sources/phpBB/docs/corners_left.png b/sources/phpBB/docs/corners_left.png new file mode 100644 index 0000000000000000000000000000000000000000..256bde3daa62be78f5ba32f324fda6090183a2ce GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^Y(UJz0U{m4&*%XumUKs7M+Sy#H?H_c7y4$o>ne4iAh3&L2`^WYRA5oO4L^V4Js-_;eQwGtO9r vb18?EcF5l3lUA6=a3sAULP~`}Ac4V8+^F^0SN$nKYZyFT{an^LB{Ts5ju$_5 literal 0 HcmV?d00001 diff --git a/sources/phpBB/docs/events.md b/sources/phpBB/docs/events.md new file mode 100644 index 0000000..3ab3fc6 --- /dev/null +++ b/sources/phpBB/docs/events.md @@ -0,0 +1,1586 @@ +acp_bbcodes_actions_append +=== +* Location: adm/style/acp_bbcodes.html +* Since: 3.1.0-a3 +* Purpose: Add actions to the BBCodes page, after edit/delete buttons + +acp_bbcodes_actions_prepend +=== +* Location: adm/style/acp_bbcodes.html +* Since: 3.1.0-a3 +* Purpose: Add actions to the BBCodes page, before edit/delete buttons + +acp_bbcodes_edit_fieldsets_after +=== +* Location: adm/style/acp_bbcodes.html +* Since: 3.1.0-a3 +* Purpose: Add settings to BBCode add/edit form + +acp_email_options_after +=== +* Location: adm/style/acp_email.html +* Since: 3.1.2-RC1 +* Purpose: Add settings to mass email form + +acp_forums_main_settings_append +=== +* Location: adm/style/acp_forums.html +* Since: 3.1.2-RC1 +* Purpose: Add settings to forums at end of main settings section + +acp_forums_main_settings_prepend +=== +* Location: adm/style/acp_forums.html +* Since: 3.1.2-RC1 +* Purpose: Add settings to forums before main settings section + +acp_forums_normal_settings_append +=== +* Location: adm/style/acp_forums.html +* Since: 3.1.0-a1 +* Purpose: Add settings to forums at end of normal settings section + +acp_forums_normal_settings_prepend +=== +* Location: adm/style/acp_forums.html +* Since: 3.1.2-RC1 +* Purpose: Add settings to forums before normal settings section + +acp_forums_prune_settings_append +=== +* Location: adm/style/acp_forums.html +* Since: 3.1.2-RC1 +* Purpose: Add settings to forums at end of prune settings section + +acp_forums_prune_settings_prepend +=== +* Location: adm/style/acp_forums.html +* Since: 3.1.2-RC1 +* Purpose: Add settings to forums before prune settings section + +acp_forums_rules_settings_append +=== +* Location: adm/style/acp_forums.html +* Since: 3.1.2-RC1 +* Purpose: Add settings to forums at end of rules settings section + +acp_forums_rules_settings_prepend +=== +* Location: adm/style/acp_forums.html +* Since: 3.1.2-RC1 +* Purpose: Add settings to forums before rules settings section + +acp_group_options_before +=== +* Location: adm/style/acp_groups.html +* Since: 3.1.0-b4 +* Purpose: Add addtional options to group settings (before GROUP_FOUNDER_MANAGE) + +acp_group_options_after +=== +* Location: adm/style/acp_groups.html +* Since: 3.1.0-b4 +* Purpose: Add addtional options to group settings (after GROUP_RECEIVE_PM) + +acp_main_actions_append +=== +* Location: adm/style/acp_main.html +* Since: 3.1.0-a1 +* Purpose: Add actions to the ACP main page below the cache purge action + +acp_main_notice_after +=== +* Location: adm/style/acp_main.html +* Since: 3.1.0-a1 +* Purpose: Add notices or other blocks in the ACP below other configuration notices + +acp_overall_footer_after +=== +* Location: adm/style/overall_footer.html +* Since: 3.1.0-a1 +* Purpose: Add content below the footer in the ACP + +acp_overall_header_body_before +=== +* Location: adm/style/overall_header.html +* Since: 3.1.0-b2 +* Purpose: Add content to the header body + +acp_overall_header_head_append +=== +* Location: adm/style/overall_header.html +* Since: 3.1.0-a1 +* Purpose: Add assets within the `` tags in the ACP + +acp_overall_header_stylesheets_after +=== +* Location: adm/style/overall_header.html +* Since: 3.1.0-RC3 +* Purpose: Add assets after stylesheets within the `` tags in the ACP. +Note that INCLUDECSS will not work with this event. + +acp_posting_buttons_after +=== +* Locations: + + adm/style/acp_posting_buttons.html +* Since: 3.1.0-b4 +* Purpose: Add content after BBCode posting buttons in the ACP + +acp_posting_buttons_before +=== +* Locations: + + adm/style/acp_posting_buttons.html +* Since: 3.1.0-b4 +* Purpose: Add content before BBCode posting buttons in the ACP + +acp_ranks_edit_after +=== +* Locations: + + adm/style/acp_ranks.html +* Since: 3.1.0-RC3 +* Purpose: Add content after the rank details when editing a rank in the ACP + +acp_ranks_edit_before +=== +* Locations: + + adm/style/acp_ranks.html +* Since: 3.1.0-RC3 +* Purpose: Add content before the rank details when editing a rank in the ACP + +acp_ranks_list_column_after +=== +* Locations: + + adm/style/acp_ranks.html +* Since: 3.1.0-RC3 +* Purpose: Add content before the first column in the ranks list in the ACP + +acp_ranks_list_column_before +=== +* Locations: + + adm/style/acp_ranks.html +* Since: 3.1.0-RC3 +* Purpose: Add content after the last column (but before the action column) +in the ranks list in the ACP + +acp_ranks_list_header_after +=== +* Locations: + + adm/style/acp_ranks.html +* Since: 3.1.0-RC3 +* Purpose: Add content before the first header-column in the ranks list in the ACP + +acp_ranks_list_header_before +=== +* Locations: + + adm/style/acp_ranks.html +* Since: 3.1.0-RC3 +* Purpose: Add content after the last header-column (but before the action column) +in the ranks list in the ACP + +acp_simple_footer_after +=== +* Location: adm/style/simple_footer.html +* Since: 3.1.0-a1 +* Purpose: Add content below the simple footer in the ACP + +acp_simple_header_body_before +=== +* Location: adm/style/simple_header.html +* Since: 3.1.0-b2 +* Purpose: Add content to the header body + +acp_simple_header_head_append +=== +* Location: adm/style/simple_header.html +* Since: 3.1.0-a1 +* Purpose: Add assets within the `` tags in the simple header of the ACP + +acp_simple_header_stylesheets_after +=== +* Location: adm/style/simple_header.html +* Since: 3.1.0-RC3 +* Purpose: Add assets after stylesheets within the `` tags in the simple header +of the ACP. Note that INCLUDECSS will not work with this event. + +acp_users_overview_options_append +=== +* Location: adm/style/acp_users_overview.html +* Since: 3.1.0-a1 +* Purpose: Add options and settings on user overview page + +acp_users_prefs_append +=== +* Location: adm/style/acp_users_prefs.html +* Since: 3.1.0-b3 +* Purpose: Add user options fieldset to the bottom of ACP users prefs settings + +acp_users_prefs_prepend +=== +* Location: adm/style/acp_users_prefs.html +* Since: 3.1.0-b3 +* Purpose: Add user options fieldset to the top of ACP users prefs settings + +acp_users_prefs_personal_append +=== +* Location: adm/style/acp_users_prefs.html +* Since: 3.1.0-b3 +* Purpose: Add user options fieldset to the bottom of ACP users personal prefs settings + +acp_users_prefs_personal_prepend +=== +* Location: adm/style/acp_users_prefs.html +* Since: 3.1.0-b3 +* Purpose: Add user options fieldset to the top of ACP users personal prefs settings + +acp_users_prefs_post_append +=== +* Location: adm/style/acp_users_prefs.html +* Since: 3.1.0-b3 +* Purpose: Add user options fieldset to the bottom of ACP users post prefs settings + +acp_users_prefs_post_prepend +=== +* Location: adm/style/acp_users_prefs.html +* Since: 3.1.0-b3 +* Purpose: Add user options fieldset to the top of ACP users post prefs settings + +acp_users_prefs_view_append +=== +* Location: adm/style/acp_users_prefs.html +* Since: 3.1.0-b3 +* Purpose: Add user options fieldset to the bottom of ACP users view prefs settings + +acp_users_prefs_view_prepend +=== +* Location: adm/style/acp_users_prefs.html +* Since: 3.1.0-b3 +* Purpose: Add user options fieldset to the top of ACP users view prefs settings + +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. + +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. + +forumlist_body_forum_row_after +=== +* Locations: + + styles/prosilver/template/forumlist_body.html + + styles/subsilver2/template/forumlist_body.html +* Since: 3.1.0-RC5 +* Purpose: Add content after the forum list item. + +forumlist_body_forum_row_append +=== +* Locations: + + styles/prosilver/template/forumlist_body.html + + styles/subsilver2/template/forumlist_body.html +* Since: 3.1.0-RC5 +* Purpose: Add content at the start of the forum list item. + +forumlist_body_forum_row_before +=== +* Locations: + + styles/prosilver/template/forumlist_body.html + + styles/subsilver2/template/forumlist_body.html +* Since: 3.1.0-RC5 +* Purpose: Add content before the forum list item. + +forumlist_body_forum_row_prepend +=== +* Locations: + + styles/prosilver/template/forumlist_body.html + + styles/subsilver2/template/forumlist_body.html +* Since: 3.1.0-RC5 +* Purpose: Add content at the end of the forum list item. + +forumlist_body_last_post_title_prepend +=== +* Locations: + + 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. + +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. + +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. + +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. + +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 + +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 + +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 + +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 + +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 + +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 + +index_body_forumlist_body_after +=== +* Locations: + + styles/prosilver/template/index_body.html + + styles/subsilver2/template/index_body.html +* Since: 3.1.1 +* Purpose: Add content after the forum list body on the index page + +index_body_markforums_after +=== +* Locations: + + 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 + +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 + +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 + +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 + +mcp_ban_fields_after +=== +* Locations: + + styles/prosilver/template/mcp_ban.html + + styles/subsilver2/template/mcp_ban.html +* Since: 3.1.0-RC3 +* Purpose: Add additional fields to the ban form in MCP + +mcp_ban_fields_before +=== +* Locations: + + styles/prosilver/template/mcp_ban.html + + styles/subsilver2/template/mcp_ban.html +* Since: 3.1.0-RC3 +* Purpose: Add additional fields to the ban form in MCP + +mcp_ban_unban_after +=== +* Locations: + + styles/prosilver/template/mcp_ban.html + + styles/subsilver2/template/mcp_ban.html +* Since: 3.1.0-RC3 +* Purpose: Add additional fields to the unban form in MCP + +mcp_ban_unban_before +=== +* Locations: + + styles/prosilver/template/mcp_ban.html + + styles/subsilver2/template/mcp_ban.html +* Since: 3.1.0-RC3 +* Purpose: Add additional fields to the unban form in MCP + +mcp_front_latest_logs_after +=== +* Locations: + + styles/prosilver/template/mcp_front.html + + styles/subsilver2/template/mcp_front.html +* Since: 3.1.3-RC1 +* Purpose: Add content after latest logs list + +mcp_front_latest_logs_before +=== +* Locations: + + styles/prosilver/template/mcp_front.html + + styles/subsilver2/template/mcp_front.html +* Since: 3.1.3-RC1 +* Purpose: Add content before latest logs list + +mcp_front_latest_reported_before +=== +* Locations: + + styles/prosilver/template/mcp_front.html + + styles/subsilver2/template/mcp_front.html +* Since: 3.1.3-RC1 +* Purpose: Add content before latest reported posts list + +mcp_front_latest_reported_pms_before +=== +* Locations: + + styles/prosilver/template/mcp_front.html + + styles/subsilver2/template/mcp_front.html +* Since: 3.1.3-RC1 +* Purpose: Add content before latest reported private messages list + +mcp_front_latest_unapproved_before +=== +* Locations: + + styles/prosilver/template/mcp_front.html + + styles/subsilver2/template/mcp_front.html +* Since: 3.1.3-RC1 +* Purpose: Add content before latest unapproved posts list + +memberlist_body_username_append +=== +* Locations: + + 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). + +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). + +memberlist_search_fields_after +=== +* Locations: + + styles/prosilver/template/memberlist_search.html + + styles/subsilver2/template/memberlist_search.html +* Since: 3.1.2-RC1 +* Purpose: Add information after the search fields column. + +memberlist_search_fields_before +=== +* Locations: + + styles/prosilver/template/memberlist_search.html + + styles/subsilver2/template/memberlist_search.html +* Since: 3.1.2-RC1 +* Purpose: Add information before the search fields column. + +memberlist_search_sorting_options_before +=== +* Locations: + + styles/prosilver/template/memberlist_search.html + + styles/subsilver2/template/memberlist_search.html +* Since: 3.1.2-RC1 +* Purpose: Add information before the search sorting options field. + +memberlist_view_contact_after +=== +* Locations: + + 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 + +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 + +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 + +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_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 + +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 + +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. + +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. + +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. + +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. + +navbar_header_logged_out_content +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC1 +* Purpose: Add text and HTML in place of the username when not logged in. + +navbar_header_profile_list_after +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC2 +* Purpose: Add links to the bottom of the profile drop-down menu in the header navbar + +navbar_header_profile_list_before +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC2 +* Purpose: Add links to the top of the profile drop-down menu in the header navbar + +navbar_header_quick_links_after +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC2 +* Purpose: Add links to the bottom of the quick-links drop-down menu in the header + +navbar_header_quick_links_before +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC2 +* Purpose: Add links to the top of the quick-links drop-down menu in the header + +navbar_header_username_append +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC1 +* Purpose: Add text and HTMl after the username shown in the navbar. + +navbar_header_username_prepend +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC1 +* Purpose: Add text and HTMl before the username shown in the navbar. + +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 `` tag + +overall_footer_body_after +=== +* Locations: + + styles/prosilver/template/overall_footer.html + + styles/subsilver2/template/overall_footer.html +* Since: 3.1.3-RC1 +* Purpose: Add content before the `` tag but after the $SCRIPTS var, i.e. after the js scripts have been loaded + +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 + +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) + +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 + +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 + +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 + +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 + +overall_footer_teamlink_after +=== +* Locations: + + styles/prosilver/template/navbar_footer.html + + styles/subsilver2/template/index_body.html +* Since: 3.1.0-b3 +* Purpose: Add contents after the team-link in the footer + +overall_footer_teamlink_before +=== +* Locations: + + styles/prosilver/template/navbar_footer.html + + styles/subsilver2/template/index_body.html +* Since: 3.1.0-b3 +* Purpose: Add contents before the team-link in the footer + +overall_footer_timezone_after +=== +* Locations: + + styles/prosilver/template/navbar_footer.html + + styles/subsilver2/template/breadcrumbs.html +* Since: 3.1.0-b3 +* Purpose: Add content to the navbar in the page footer, after "Timezone" + +overall_footer_timezone_before +=== +* Locations: + + styles/prosilver/template/navbar_footer.html + + styles/subsilver2/template/breadcrumbs.html +* Since: 3.1.0-b3 +* Purpose: Add content to the navbar in the page footer, before "Timezone" + +overall_header_body_before +=== +* Locations: + + styles/prosilver/template/overall_header.html + + styles/subsilver2/template/overall_header.html +* Since: 3.1.0-b2 +* Purpose: Add content to the header body + +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 + +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) + +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) + +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) + +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 + +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 `` tag + +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 + +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 + +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) + +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) + +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 + +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 `` tag. +Note that INCLUDECSS will not work with this event. + +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 + +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 + +posting_editor_buttons_custom_tags_before +=== +* Locations: + + styles/prosilver/template/posting_buttons.html + + styles/subsilver2/template/posting_buttons.html +* Since: 3.1.2-RC1 +* Purpose: Add content inside the BBCode posting buttons and before the customs BBCode + +posting_editor_message_after +=== +* Locations: + + 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 + +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 + +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 + +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 + +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 + +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 + +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 + +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) + +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) + +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 + +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 + +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 + +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 + +search_results_postprofile_after +=== +* Locations: + + styles/prosilver/template/search_results.html +* Since: 3.1.0-b3 +* Purpose: Add content after the post author and stats in search results (posts view mode) + +search_results_postprofile_before +=== +* Locations: + + styles/prosilver/template/search_results.html +* Since: 3.1.0-b3 +* Purpose: Add content directly before the post author in search results (posts view mode) + +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 + +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 + +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 `` tag of the simple footer + +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 + +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 `` tag + +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 `` tag. +Note that INCLUDECSS will not work with this event. + +topiclist_row_prepend +=== +* Locations: + + styles/prosilver/template/search_results.html + + styles/prosilver/template/viewforum_body.html + + styles/subsilver2/template/search_results.html + + styles/subsilver2/template/viewforum_body.html +* Since: 3.1.0-a1 +* Purpose: Add content into topic rows (inside the elements containing topic titles) + +topiclist_row_append +=== +* Locations: + + styles/prosilver/template/search_results.html + + styles/prosilver/template/viewforum_body.html + + styles/subsilver2/template/search_results.html + + styles/subsilver2/template/viewforum_body.html +* Since: 3.1.0-a1 +* Purpose: Add content into topic rows (inside the elements containing topic titles) + +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 + +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 + +ucp_pm_viewmessage_avatar_after +=== +* Locations: + + styles/prosilver/template/ucp_pm_viewmessage.html +* Since: 3.1.0-RC3 +* Purpose: Add content right after the avatar when viewing a private message + +ucp_pm_viewmessage_avatar_before +=== +* Locations: + + styles/prosilver/template/ucp_pm_viewmessage.html +* Since: 3.1.0-RC3 +* Purpose: Add content right before the avatar when viewing a private message + +ucp_pm_viewmessage_contact_fields_after +=== +* Locations: + + styles/prosilver/template/ucp_pm_viewmessage.html +* Since: 3.1.0-b1 +* Purpose: Add data after the contact fields on the user profile when viewing +a private message + +ucp_pm_viewmessage_contact_fields_before +=== +* Locations: + + styles/prosilver/template/ucp_pm_viewmessage.html +* Since: 3.1.0-b1 +* Purpose: Add data before the contact fields on the user profile when viewing +a private message + +ucp_pm_viewmessage_custom_fields_after +=== +* Locations: + + styles/prosilver/template/ucp_pm_viewmessage.html +* Since: 3.1.0-a1 +* Purpose: Add data after the custom fields on the user profile when viewing +a private message + +ucp_pm_viewmessage_custom_fields_before +=== +* Locations: + + styles/prosilver/template/ucp_pm_viewmessage.html +* Since: 3.1.0-a1 +* Purpose: Add data before the custom fields on the user profile when viewing +a private message + +ucp_pm_viewmessage_post_buttons_after +=== +* Locations: + + styles/prosilver/template/ucp_pm_viewmessage.html + + styles/subsilver2/template/ucp_pm_viewmessage.html +* Since: 3.1.0-RC3 +* Purpose: Add post button to private messages (next to edit, quote etc), at +the end of the list. + +ucp_pm_viewmessage_post_buttons_before +=== +* Locations: + + styles/prosilver/template/ucp_pm_viewmessage.html + + styles/subsilver2/template/ucp_pm_viewmessage.html +* Since: 3.1.0-RC3 +* Purpose: Add post button to private messages (next to edit, quote etc), at +the start of the list. + +ucp_pm_viewmessage_print_head_append +=== +* Locations: + + 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 `` tag of the Print PM screen + +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 + +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 + +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 + +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 + +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 + +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 + +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 + +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 + +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. + +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. + +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. + +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. + +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. + +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 + +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 + +viewforum_buttons_bottom_before +=== +* Locations: + + styles/prosilver/template/viewforum_body.html + + styles/subsilver2/template/viewforum_body.html +* Since: 3.1.0-RC5 +* Purpose: Add buttons before New Topic button on the bottom of the topic's list + +viewforum_buttons_bottom_after +=== +* Locations: + + styles/prosilver/template/viewforum_body.html + + styles/subsilver2/template/viewforum_body.html +* Since: 3.1.0-RC5 +* Purpose: Add buttons after New Topic button on the bottom of the topic's list + +viewforum_buttons_top_before +=== +* Locations: + + styles/prosilver/template/viewforum_body.html + + styles/subsilver2/template/viewforum_body.html +* Since: 3.1.0-RC5 +* Purpose: Add buttons before New Topic button on the top of the topic's list + +viewforum_buttons_top_after +=== +* Locations: + + styles/prosilver/template/viewforum_body.html + + styles/subsilver2/template/viewforum_body.html +* Since: 3.1.0-RC5 +* Purpose: Add buttons after New Topic button on the top of the topic's list + +viewtopic_buttons_bottom_before +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html + + styles/subsilver2/template/viewtopic_body.html +* Since: 3.1.0-RC5 +* Purpose: Add buttons before Post Reply button on the bottom of the posts's list + +viewtopic_buttons_bottom_after +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html + + styles/subsilver2/template/viewtopic_body.html +* Since: 3.1.0-RC5 +* Purpose: Add buttons after Post Reply button on the bottom of the posts's list + +viewtopic_buttons_top_before +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html + + styles/subsilver2/template/viewtopic_body.html +* Since: 3.1.0-RC5 +* Purpose: Add buttons before Post Reply button on the top of the posts's list + +viewtopic_buttons_top_after +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html + + styles/subsilver2/template/viewtopic_body.html +* Since: 3.1.0-RC5 +* Purpose: Add buttons after Post Reply button on the top of the posts's list + +viewforum_forum_name_append +=== +* Locations: + + 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 + +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 + +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 `` tag of the Print Topic screen + +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 + +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 + +viewtopic_body_contact_fields_after +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html +* Since: 3.1.0-b3 +* Purpose: Add data after the contact fields on the user profile when viewing +a post + +viewtopic_body_contact_fields_before +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html +* Since: 3.1.0-b3 +* Purpose: Add data before the contact fields on the user profile when viewing +a post + +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. + +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. + +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. + +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 + +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 + +viewtopic_body_post_author_after +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html + + styles/subsilver2/template/viewtopic_body.html +* Since: 3.1.3-RC1 +* Purpose: Add content directly after the post author on the view topic screen + +viewtopic_body_post_author_before +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html + + styles/subsilver2/template/viewtopic_body.html +* Since: 3.1.3-RC1 +* Purpose: Add content directly before the post author on the view topic screen + +viewtopic_body_post_buttons_after +=== +* Locations: + + 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. + +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. + +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 + +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 + +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 + +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 + +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. + +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. + +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. + +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) + +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 + +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 + +viewtopic_topic_tools_after +=== +* Locations: + + styles/prosilver/template/viewtopic_topic_tools.html +* Since: 3.1.0-a3 +* Purpose: Add a new topic tool after the rest of the existing ones + +viewtopic_topic_tools_before +=== +* Locations: + + styles/prosilver/template/viewtopic_topic_tools.html +* Since: 3.1.0-a3 +* Purpose: Add a new topic tool before the rest of the existing ones diff --git a/sources/phpBB/docs/lighttpd.sample.conf b/sources/phpBB/docs/lighttpd.sample.conf new file mode 100644 index 0000000..5862cb3 --- /dev/null +++ b/sources/phpBB/docs/lighttpd.sample.conf @@ -0,0 +1,70 @@ +# Sample lighttpd configuration file for phpBB. +# Global settings have been removed, copy them +# from your system's lighttpd.conf. +# Tested with lighttpd 1.4.26 + +# If you want to use the X-Sendfile feature, +# uncomment the 'allow-x-send-file' for the fastcgi +# server below and add the following to your config.php +# +# define('PHPBB_ENABLE_X_SENDFILE', true); +# +# See http://blog.lighttpd.net/articles/2006/07/02/x-sendfile +# for the details on X-Sendfile. + +# Load moules +server.modules += ( + "mod_access", + "mod_fastcgi", + "mod_accesslog" +) + +# If you have domains with and without www prefix, +# redirect one to the other. +$HTTP["host"] =~ "^(myforums\.com)$" { + url.redirect = ( + ".*" => "http://www.%1$0" + ) +} + +$HTTP["host"] == "www.myforums.com" { + server.name = "www.myforums.com" + server.document-root = "/path/to/phpbb" + server.dir-listing = "disable" + + index-file.names = ( "index.php", "index.htm", "index.html" ) + accesslog.filename = "/var/log/lighttpd/access-www.myforums.com.log" + + # Deny access to internal phpbb files. + $HTTP["url"] =~ "^/(config\.php|common\.php|includes|cache|files|store|images/avatars/upload)" { + url.access-deny = ( "" ) + } + + # Deny access to version control system directories. + $HTTP["url"] =~ "/\.svn|/\.git" { + url.access-deny = ( "" ) + } + + # Deny access to apache configuration files. + $HTTP["url"] =~ "/\.htaccess|/\.htpasswd|/\.htgroups" { + url.access-deny = ( "" ) + } + + fastcgi.server = ( ".php" => + (( + "bin-path" => "/usr/bin/php-cgi", + "socket" => "/tmp/php.socket", + "max-procs" => 4, + "idle-timeout" => 30, + "bin-environment" => ( + "PHP_FCGI_CHILDREN" => "10", + "PHP_FCGI_MAX_REQUESTS" => "10000" + ), + "bin-copy-environment" => ( + "PATH", "SHELL", "USER" + ), + #"allow-x-send-file" => "enable", + "broken-scriptfilename" => "enable" + )) + ) +} diff --git a/sources/phpBB/docs/nginx.sample.conf b/sources/phpBB/docs/nginx.sample.conf new file mode 100644 index 0000000..c82f5c8 --- /dev/null +++ b/sources/phpBB/docs/nginx.sample.conf @@ -0,0 +1,97 @@ +# Sample nginx configuration file for phpBB. +# Global settings have been removed, copy them +# from your system's nginx.conf. +# Tested with nginx 0.8.35. + +# If you want to use the X-Accel-Redirect feature, +# add the following to your config.php. +# +# define('PHPBB_ENABLE_X_ACCEL_REDIRECT', true); +# +# See http://wiki.nginx.org/XSendfile for the details +# on X-Accel-Redirect. + +http { + # Compression - requires gzip and gzip static modules. + gzip on; + gzip_static on; + gzip_vary on; + gzip_http_version 1.1; + gzip_min_length 700; + + # Compression levels over 6 do not give an appreciable improvement + # in compression ratio, but take more resources. + gzip_comp_level 6; + + # IE 6 and lower do not support gzip with Vary correctly. + gzip_disable "msie6"; + # Before nginx 0.7.63: + #gzip_disable "MSIE [1-6]\."; + + # Catch-all server for requests to invalid hosts. + # Also catches vulnerability scanners probing IP addresses. + server { + # default specifies that this block is to be used when + # no other block matches. + listen 80 default; + + server_name bogus; + return 444; + root /var/empty; + } + + # If you have domains with and without www prefix, + # redirect one to the other. + server { + # Default port is 80. + #listen 80; + + server_name myforums.com; + + # A trick from http://wiki.nginx.org/Pitfalls#Taxing_Rewrites: + rewrite ^ http://www.myforums.com$request_uri permanent; + # Equivalent to: + #rewrite ^(.*)$ http://www.myforums.com$1 permanent; + } + + # The actual board domain. + server { + #listen 80; + server_name www.myforums.com; + + root /path/to/phpbb; + + location / { + # phpbb uses index.htm + index index.php index.html index.htm; + } + + # Deny access to internal phpbb files. + location ~ /(config\.php|common\.php|includes|cache|files|store|images/avatars/upload) { + deny all; + # deny was ignored before 0.8.40 for connections over IPv6. + # Use internal directive to prohibit access on older versions. + internal; + } + + # Pass the php scripts to fastcgi server specified in upstream declaration. + location ~ \.php$ { + fastcgi_pass php; + # Necessary for php. + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + # Unmodified fastcgi_params from nginx distribution. + include fastcgi_params; + } + + # Deny access to version control system directories. + location ~ /\.svn|/\.git { + deny all; + internal; + } + } + + # If running php as fastcgi, specify php upstream. + upstream php { + server unix:/tmp/php.sock; + } +} diff --git a/sources/phpBB/docs/site_logo.gif b/sources/phpBB/docs/site_logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..909114c377af79f664b81c34723f808116d1497f GIT binary patch literal 3430 zcmV-s4Vm&sNk%w1VT%AX0Oo%HyurlL*4gRp@BnhG+TP*v^!54s`>V&*c&o+T?eqX` zqm-<;nZnmBbeP@Y&lSo3ymKymX_wvdPpUh`aLk_yS^;?)LeJz1hj!g(+RWthz3?p2kx;pFC&x5)1C^zQKTyVc?meznQX&=Pm5&ePS{+ucKjrmeEI(A3wm zwz*ZL%V(&{0Cup<(9^rx>UXx)5^kR7?C)ryz@)v(Bzma!`1w|z!`|THxxT>wX`TRC zg#c83)Y;tC*F?vFq>g-R0}#=jfTp-w|Vs=IZR_=jl<1qu1Kq zs?p^{l)E&8tJT@u=Iid|>g?m_>*D9?-{j}l+~3yQ-mkQ`M4QGlk-=uI(ChH?0AG*p z^!EX9sJFbn09S(H=IPVd+7W=a&(zgtrpM;#>#MM{nZMCNdY8Y%$6%AKwbkX>;^)EB z+@rwHs;{!h%+52AzaxOKGmgB>41ejE#}8!iNbL z3iPw3Vnu)gAyKr*v7^U29KtZ;=dt9+kRyrtX~B{u#*B_uwrsherp=ixP540oqajX~ zHgEpa$&;HO2}qH?gvsb=QVBPHka<9r>XHZmo=Vt(K|w>UQKwdYa5d{wu3iz9@S=*9 zp9E0uUZ03ZYa!7fi1+}OkW>B4G6fa?HEY|qioi=yb1s9VRbox30J z;KQR(j0i@C7~ughf)Qfy6X1T^9O55<;SE>_d47OUhZ_`DSYaI?wDVnI7P?WuF(7nk zApw-QcL;wYc<$f_1BKm*CklA_iRYXw>{;9(aSjTBor*%BC!a40I>nlUaN$P)cm@GRaehcj zsUVhON@oxcR2rcPsG_<+8$bNez#A0Qk*Wzz_z}g6v(9>h6MOuygcCQ&I%|d}5Mn6^ zxvtvktFg{n>#YsVngSn(65;{|1qf?`84+9%ZK~5&JIJ-!rpm3ifA8fVNgB_6j6GMXj$;Q$ISqX4o3J^jI$7$w9JGYSs)VI@Ck?2Lj2 zWYF9bX9M&h^briC)$+?R&s_7(Iq%%_&&CA}^AymGK)}u+EYZV@TBE@AGhTx&_P7SH z;5G|QG>{-6jLq=G+bkHMFh6*+kU|7=)9u0zcqc)^*nhat_SE=b*XzpXc?eLum$ z<(MZCx!ZH7;6o2J^NqLVm|w0r-kpCQ`V1lj;CcX>iYv$f6$tQp08FQK>Fq}}kd|_1 zwEnsS7$nI0?Xe$1yX~*%&d=@8NAJ1=dAPt>VbW(mef8HPDu5Z_XTgU5p=7 zB{s1cS&ZTqsi=h!{9r6p@j(L)K*b~YK?yG+qZ!fo05!4^if)7>KeE8bER5g-Uo6B7 z1klGUNU@NH1R)}1P=-PtvX6fZBq0Xr$SoogAe(877{t(rLb?(ETE@8~7&3V?PI}T- z{2+iT2~Yq8NOBM}@Y*V+xJp%8(GW67LM>^z%2vKo5V73l7Hdf&MbZrhF3{yFEx-UY zWl5L{LZ&iR$;?!)as;kaL@-xLf?+~45i+pCH=n6WZ2s~O+f-#YtvO3$((Mcds3ivy zut8$pvV8EAX9D=)fPOka1SB}83`F2hHO$Cm{_L4M3n2qFBvgtC1*kv?+E0USFrf-v zAwv6E1V5l_qy4;R`9RuHe)^LMekfKVFu;V9BH*GAT_~Jd>Q9KCG^L7QsY_v6Q<(~) z0w5*c7BMQ)p9U2J{J?@zmAaGA6~YC6D1%aq5Xq!26$?fGHDL{|D#fc}wJ3*xs#LK+ zRX|#GsUA(l3=DA9B9P#tUQH_^*4kDQ@S_NL#cKgDKo~*fAqROaLJpST%)oZkrzYe; zV5Ml-z4rAFe+}$l3%gi6Ai@iNC_rF2Fo6vk)(@6F1ZFjxR}LV6A6H0iYEha8!YIKH z0#NN04lqj8$~LQiu-|RBDBCNr*0r#eEp2O-hu#_h0~z3ga=CztJov!^Opt9DeCJo= zB6qpWoq=$L)IWpIS`N-@4xAg_5r zmEQHXmx4+Vz30tleQRal$NT;Spg!+6FtwlR)%><20s z`N&2VfCbnQ4-p`l3PWfB1^M(U6|A z92&6bMn5{zh@NzxVJm=6ivR%;5J9I$O=}nr@0+d#@&BTC% z5NN>JekfHU20()eeA|uU_CvL!-GOOa``OqAgSHV5BgznkCw2Drdq^o53hAqNxeHNG2;1PUOa0c2pdat6?W2egU|=<3g7JT8@wI{e`g zFE<4!ZgGrjoHxDc0T_JHs+xZs3_TE-A~+*+n%n&5Id^J9P7ZOJJq8S9Xq69e?wb{6 zk`bgFy2Fb;Fr+J;=|YbtDWl$qt#3UMeh`7!MNo8`d7UW@89Ujt>GiCmy%T;2gWSVl zfNbtU3E%O93nnply4(HjPxZqex}Zn@y>lY&bFce3CE`Ap;i0~P>%gCrE+@=Z$Q}3;13nZLjqLqSI~>z z?yQHSYfQiQYsp~u9FxH*FtCcYC?Bf)*n90`4^=L(Vo8Rtz$)_a4j1S?0ee?#4nV); zzZ=yEH1Go#G*1K^02K!~7!OowU<1K-zz`% zfK-Vf1{#2X2^e?+6EK>m00RL3Ri>wRVqgT$zz>e+fobpuX&`tQFoZflfG{Y7l?PQd zCJ0DFSR02lxTFA#Fd(*x$V zWD_uDe~^TrQUYX{gdNasCm;hd5C!$;g;ywsWmt!s$7paEg9b2%hIohiXB;{}hF92y zl8A*J7=(^TiDP()e}Dlt&;dB`0e^4@Qh)#npn^O1bcJvS;{jB5K!&W?1waKE%zi9ncyB>+^INQlZcNZx^tVKFO2b0+SrK7%s_iML7&3*#Yxrd5xe0rsn}bLX}#%m5LCRQ^}QJ8J1#c Id4T``JL>F2ivR!s literal 0 HcmV?d00001 diff --git a/sources/phpBB/docs/sphinx.sample.conf b/sources/phpBB/docs/sphinx.sample.conf new file mode 100644 index 0000000..0a210ec --- /dev/null +++ b/sources/phpBB/docs/sphinx.sample.conf @@ -0,0 +1,100 @@ +source source_phpbb_{SPHINX_ID}_main +{ + type = mysql # mysql or pgsql + sql_host = localhost # SQL server host sphinx connects to + sql_user = username + sql_pass = password + sql_db = db_name + sql_port = 3306 # optional, default is 3306 for mysql and 5432 for pgsql + sql_query_pre = SET NAMES 'utf8' + sql_query_pre = UPDATE phpbb_sphinx SET max_doc_id = (SELECT MAX(post_id) FROM phpbb_posts) WHERE counter_id = 1 + sql_query_range = SELECT MIN(post_id), MAX(post_id) FROM phpbb_posts + sql_range_step = 5000 + sql_query = SELECT \ + p.post_id AS id, \ + p.forum_id, \ + p.topic_id, \ + p.poster_id, \ + p.post_visibility, \ + CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, \ + p.post_time, \ + p.post_subject, \ + p.post_subject as title, \ + p.post_text as data, \ + t.topic_last_post_time, \ + 0 as deleted\ + FROM phpbb_posts p, phpbb_topics t \ + WHERE \ + p.topic_id = t.topic_id \ + AND p.post_id >= $start AND p.post_id <= $end + sql_query_post = + sql_query_post_index = UPDATE phpbb_sphinx SET max_doc_id = $maxid WHERE counter_id = 1 + sql_query_info = SELECT * FROM phpbb_posts WHERE post_id = $id + sql_attr_uint = forum_id + sql_attr_uint = topic_id + sql_attr_uint = poster_id + sql_attr_uint = post_visibility + sql_attr_bool = topic_first_post + sql_attr_bool = deleted + sql_attr_timestamp = post_time + sql_attr_timestamp = topic_last_post_time + sql_attr_string = post_subject +} +source source_phpbb_{SPHINX_ID}_delta : source_phpbb_{SPHINX_ID}_main +{ + sql_query_pre = + sql_query_range = + sql_range_step = + sql_query = SELECT \ + p.post_id AS id, \ + p.forum_id, \ + p.topic_id, \ + p.poster_id, \ + p.post_visibility, \ + CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, \ + p.post_time, \ + p.post_subject, \ + p.post_subject as title, \ + p.post_text as data, \ + t.topic_last_post_time, \ + 0 as deleted \ + FROM phpbb_posts p, phpbb_topics t \ + WHERE \ + p.topic_id = t.topic_id \ + AND p.post_id >= ( SELECT max_doc_id FROM phpbb_sphinx WHERE counter_id=1 ) + sql_query_pre = +} +index index_phpbb_{SPHINX_ID}_main +{ + path = {DATA_PATH}/index_phpbb_{SPHINX_ID}_main + source = source_phpbb_{SPHINX_ID}_main + docinfo = extern + morphology = none + stopwords = + min_word_len = 2 + charset_type = utf-8 + charset_table = U+FF10..U+FF19->0..9, 0..9, U+FF41..U+FF5A->a..z, U+FF21..U+FF3A->a..z, A..Z->a..z, a..z, U+0149, U+017F, U+0138, U+00DF, U+00FF, U+00C0..U+00D6->U+00E0..U+00F6, U+00E0..U+00F6, U+00D8..U+00DE->U+00F8..U+00FE, U+00F8..U+00FE, U+0100->U+0101, U+0101, U+0102->U+0103, U+0103, U+0104->U+0105, U+0105, U+0106->U+0107, U+0107, U+0108->U+0109, U+0109, U+010A->U+010B, U+010B, U+010C->U+010D, U+010D, U+010E->U+010F, U+010F, U+0110->U+0111, U+0111, U+0112->U+0113, U+0113, U+0114->U+0115, U+0115, U+0116->U+0117, U+0117, U+0118->U+0119, U+0119, U+011A->U+011B, U+011B, U+011C->U+011D, U+011D, U+011E->U+011F, U+011F, U+0130->U+0131, U+0131, U+0132->U+0133, U+0133, U+0134->U+0135, U+0135, U+0136->U+0137, U+0137, U+0139->U+013A, U+013A, U+013B->U+013C, U+013C, U+013D->U+013E, U+013E, U+013F->U+0140, U+0140, U+0141->U+0142, U+0142, U+0143->U+0144, U+0144, U+0145->U+0146, U+0146, U+0147->U+0148, U+0148, U+014A->U+014B, U+014B, U+014C->U+014D, U+014D, U+014E->U+014F, U+014F, U+0150->U+0151, U+0151, U+0152->U+0153, U+0153, U+0154->U+0155, U+0155, U+0156->U+0157, U+0157, U+0158->U+0159, U+0159, U+015A->U+015B, U+015B, U+015C->U+015D, U+015D, U+015E->U+015F, U+015F, U+0160->U+0161, U+0161, U+0162->U+0163, U+0163, U+0164->U+0165, U+0165, U+0166->U+0167, U+0167, U+0168->U+0169, U+0169, U+016A->U+016B, U+016B, U+016C->U+016D, U+016D, U+016E->U+016F, U+016F, U+0170->U+0171, U+0171, U+0172->U+0173, U+0173, U+0174->U+0175, U+0175, U+0176->U+0177, U+0177, U+0178->U+00FF, U+00FF, U+0179->U+017A, U+017A, U+017B->U+017C, U+017C, U+017D->U+017E, U+017E, U+0410..U+042F->U+0430..U+044F, U+0430..U+044F, U+4E00..U+9FFF + min_prefix_len = 0 + min_infix_len = 0 +} +index index_phpbb_{SPHINX_ID}_delta : index_phpbb_{SPHINX_ID}_main +{ + path = {DATA_PATH}/index_phpbb_{SPHINX_ID}_delta + source = source_phpbb_{SPHINX_ID}_delta +} +indexer +{ + mem_limit = 512M +} +searchd +{ + compat_sphinxql_magics = 0 + listen = localhost:9312 + log = {DATA_PATH}/log/searchd.log + query_log = {DATA_PATH}/log/sphinx-query.log + read_timeout = 5 + max_children = 30 + pid_file = {DATA_PATH}/searchd.pid + max_matches = 20000 + binlog_path = {DATA_PATH} +} diff --git a/sources/phpBB/docs/stylesheet.css b/sources/phpBB/docs/stylesheet.css new file mode 100644 index 0000000..6b8f599 --- /dev/null +++ b/sources/phpBB/docs/stylesheet.css @@ -0,0 +1,352 @@ +/* + The original "prosilver" theme for phpBB3 + Created by subBlue design :: http://www.subBlue.com +*/ + +* { margin: 0; padding: 0; } + +html { font-size: 100%; height: 100%; margin-bottom: 1px; } + +body { + font-family: Verdana, Helvetica, Arial, sans-serif; + color: #828282; + background-color: #FFFFFF; + font-size: 12px; + margin: 0; + padding: 12px 0; +} + +img { border-width: 0; } + +p { + line-height: 1.3em; + font-size: 1.1em; + margin-bottom: 1.5em; +} + +hr { + border: 0 none #FFFFFF; + border-top: 1px solid #CCCCCC; + height: 1px; + margin: 5px 0; + display: block; + clear: both; +} + +html, body { + color: #536482; + background-color: #FFFFFF; +} + +#doc-description h1 { + font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; + margin-right: 200px; + color: #FFFFFF; + margin-top: 15px; + font-weight: bold; + font-size: 2em; + color: #fff; +} + +h1 { + font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; + font-weight: normal; + color: #000; + font-size: 2em; + margin: 0.8em 0 0.2em 0; +} + +h2 { + font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; + font-weight: normal; + color: #28313F; + font-size: 1.5em; + margin: 0.8em 0 0.2em 0; +} + +h3 { + font-family: Arial, Helvetica, sans-serif; + font-weight: bold; + border-bottom: 1px solid #CCCCCC; + margin-bottom: 3px; + padding-bottom: 2px; + font-size: 1.05em; + color: #115098; + margin-top: 20px; +} + +h4 { + font-family: Arial, Helvetica, sans-serif; + font-weight: bold; + margin-bottom: 3px; + padding-bottom: 2px; + font-size: 1.05em; + color: #115098; + margin-top: 20px; +} + +.good { color: green; } +.bad { color: red; } + +.version { + margin-top: 20px; + text-align: left; + font-size: 70%; + color: #006600; + border-top: 1px solid #ccc; +} + +code { + color: #006600; + font-weight: normal; + font-family: 'Courier New', monospace; + border-color: #D1D7DC; + border-width: 1px; + border-style: solid; + background-color: #FAFAFA; +} + +#wrap { + padding: 0 20px; + min-width: 650px; +} + +#simple-wrap { + padding: 6px 10px; +} + +#page-body { + margin: 4px 0; + clear: both; +} + +#page-footer { + clear: both; +} + +#logo { + float: left; + width: auto; + padding: 10px 13px 0 10px; +} + +a#logo:hover { + text-decoration: none; +} + +#doc-description { + float: left; + width: 70%; +} + +#doc-description h1 { + margin-right: 0; +} + +.headerbar { + background: #ebebeb none repeat-x 0 0; + color: #FFFFFF; + margin-bottom: 4px; + padding: 0 5px; +} + +span.corners-top, span.corners-bottom, span.corners-top span, span.corners-bottom span { + font-size: 1px; + line-height: 1px; + display: block; + height: 5px; + background-repeat: no-repeat; +} + +span.corners-top { + background-image: none; + background-position: 0 0; + margin: 0 -5px; +} + +span.corners-top span { + background-image: none; + background-position: 100% 0; +} + +span.corners-bottom { + background-image: none; + background-position: 0 100%; + margin: 0 -5px; + clear: both; +} + +span.corners-bottom span { + background-image: none; + background-position: 100% 100%; +} + +.paragraph { + padding: 0 10px; + margin-bottom: 4px; + background-repeat: no-repeat; + background-position: 100% 0; + background-color: #ECF3F7; +} + +.paragraph:target .content { + color: #000000; +} + +.paragraph:target h3 a { + color: #000000; +} + +.content { + color: #333333; +} + +.content h2, .panel h2 { + color: #115098; + border-bottom-color: #CCCCCC; +} + +a:link { color: #898989; text-decoration: none; } +a:visited { color: #898989; text-decoration: none; } +a:hover { color: #d3d3d3; text-decoration: underline; } +a:active { color: #d2d2d2; text-decoration: none; } + +hr { + border-color: #FFFFFF; + border-top-color: #CCCCCC; +} + +.menu { + background-color: #cadceb; +} + +.headerbar { + background-color: #12A3EB; + background-image: url("bg_header.gif"); + color: #FFFFFF; +} + +.panel { + background-color: #ECF1F3; + color: #28313F; +} + + +span.corners-top { + background-image: url("corners_left.png"); +} + +span.corners-top span { + background-image: url("corners_right.png"); +} + +span.corners-bottom { + background-image: url("corners_left.png"); +} + +span.corners-bottom span { + background-image: url("corners_right.png"); +} + +.error { + color: #BC2A4D; +} + +a:link { color: #105289; } +a:visited { color: #105289; } +a:hover { color: #D31141; } +a:active { color: #368AD2; } + +.paragraph span.corners-top, .paragraph span.corners-bottom { + margin: 0 -10px; +} + +.content { + padding: 0; + line-height: 1.48em; + color: #333333; +} + +.content h2, .panel h2 { + color: #115098; + border-bottom-color: #CCCCCC; +} + +.notice { + border-top-color: #CCCCCC; +} + +.codebox { + padding: 3px; + background-color: #FFFFFF; + border: 1px solid #C9D2D8; + font-size: 1em; + margin-bottom: 10px; + display: block; + font: 0.9em Monaco, "Andale Mono","Courier New", Courier, mono; + line-height: 1.3em; +} + +* html hr { margin: 0; } +* html span.corners-top, * html span.corners-bottom { background-image: url("corners_left.gif"); } +* html span.corners-top span, * html span.corners-bottom span { background-image: url("corners_right.gif"); } + +.back2top { + clear: both; + height: 11px; + text-align: right; +} + +.content ol, .content ul { + margin-left: 25px; + margin-top: 0; +} + +.content ul + p, .content ul + div { + margin-top: 20px; +} + +.comment { + color: green; +} + +.indent { + margin-left: 20px; +} + +.paragraph table { + font-size: 8pt; + border-collapse: collapse; + border: 1px solid #cfcfcf; + margin-bottom: 20px; +} + +.paragraph table caption { + display: none; +} + +.paragraph table thead { + background-color: #cadceb; + color: #000; +} + +.paragraph table td, .paragraph table th { + border: 1px solid #006699; + padding: 0.5em; + background-color: #e1ebf2; +} + +.paragraph table th { + background-color: #cadceb; +} + +.paragraph table td dl { + margin: 0; + padding: 0; +} + +.paragraph table td dl dt { + float: left; + clear: both; + margin-right: 1em; +} diff --git a/sources/phpBB/download/file.php b/sources/phpBB/download/file.php new file mode 100644 index 0000000..77fb455 --- /dev/null +++ b/sources/phpBB/download/file.php @@ -0,0 +1,289 @@ + +* @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); +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); + +// Thank you sun. +if (isset($_SERVER['CONTENT_TYPE'])) +{ + if ($_SERVER['CONTENT_TYPE'] === 'application/x-java-archive') + { + exit; + } +} +else if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Java') !== false) +{ + exit; +} + +if (isset($_GET['avatar'])) +{ + require($phpbb_root_path . 'includes/startup.' . $phpEx); + + require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx); + $phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx); + $phpbb_class_loader->register(); + + $phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx); + extract($phpbb_config_php_file->get_all()); + + if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type)) + { + exit; + } + + require($phpbb_root_path . 'includes/constants.' . $phpEx); + require($phpbb_root_path . 'includes/functions.' . $phpEx); + require($phpbb_root_path . 'includes/functions_download' . '.' . $phpEx); + require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); + + // Setup class loader first + $phpbb_class_loader_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_class_loader->set_cache($phpbb_container->get('cache.driver')); + $phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver')); + + // set up caching + $cache = $phpbb_container->get('cache'); + + $phpbb_dispatcher = $phpbb_container->get('dispatcher'); + $request = $phpbb_container->get('request'); + $db = $phpbb_container->get('dbal.conn'); + $phpbb_log = $phpbb_container->get('log'); + + unset($dbpasswd); + + request_var('', 0, false, false, $request); + + $config = $phpbb_container->get('config'); + set_config(null, null, null, $config); + set_config_count(null, null, null, $config); + + // load extensions + $phpbb_extension_manager = $phpbb_container->get('ext.manager'); + + // worst-case default + $browser = strtolower($request->header('User-Agent', 'msie 6.0')); + + $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); + + $filename = request_var('avatar', ''); + $avatar_group = false; + $exit = false; + + if (isset($filename[0]) && $filename[0] === 'g') + { + $avatar_group = true; + $filename = substr($filename, 1); + } + + // '==' is not a bug - . as the first char is as bad as no dot at all + if (strpos($filename, '.') == false) + { + send_status_line(403, 'Forbidden'); + $exit = true; + } + + if (!$exit) + { + $ext = substr(strrchr($filename, '.'), 1); + $stamp = (int) substr(stristr($filename, '_'), 1); + $filename = (int) $filename; + $exit = set_modified_headers($stamp, $browser); + } + if (!$exit && !in_array($ext, array('png', 'gif', 'jpg', 'jpeg'))) + { + // no way such an avatar could exist. They are not following the rules, stop the show. + send_status_line(403, 'Forbidden'); + $exit = true; + } + + + if (!$exit) + { + if (!$filename) + { + // no way such an avatar could exist. They are not following the rules, stop the show. + send_status_line(403, 'Forbidden'); + } + else + { + send_avatar_to_browser(($avatar_group ? 'g' : '') . $filename . '.' . $ext, $browser); + } + } + file_gc(); +} + +// implicit else: we are not in avatar mode +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); + +// Start session management, do not update session page. +$user->session_begin(false); +$auth->acl($user->data); +$user->setup('viewtopic'); + +if (!$config['allow_attachments'] && !$config['allow_pm_attach']) +{ + send_status_line(404, 'Not Found'); + trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED'); +} + +if (!$attach_id) +{ + send_status_line(404, 'Not Found'); + trigger_error('NO_ATTACHMENT_SELECTED'); +} + +$sql = 'SELECT attach_id, post_msg_id, topic_id, in_message, poster_id, is_orphan, physical_filename, real_filename, extension, mimetype, filesize, filetime + FROM ' . ATTACHMENTS_TABLE . " + WHERE attach_id = $attach_id"; +$result = $db->sql_query($sql); +$attachment = $db->sql_fetchrow($result); +$db->sql_freeresult($result); + +if (!$attachment) +{ + send_status_line(404, 'Not Found'); + trigger_error('ERROR_NO_ATTACHMENT'); +} +else if (!download_allowed()) +{ + send_status_line(403, 'Forbidden'); + trigger_error($user->lang['LINKAGE_FORBIDDEN']); +} +else +{ + $attachment['physical_filename'] = utf8_basename($attachment['physical_filename']); + + if (!$attachment['in_message'] && !$config['allow_attachments'] || $attachment['in_message'] && !$config['allow_pm_attach']) + { + send_status_line(404, 'Not Found'); + trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED'); + } + + if ($attachment['is_orphan']) + { + // We allow admins having attachment permissions to see orphan attachments... + $own_attachment = ($auth->acl_get('a_attach') || $attachment['poster_id'] == $user->data['user_id']) ? true : false; + + if (!$own_attachment || ($attachment['in_message'] && !$auth->acl_get('u_pm_download')) || (!$attachment['in_message'] && !$auth->acl_get('u_download'))) + { + send_status_line(404, 'Not Found'); + trigger_error('ERROR_NO_ATTACHMENT'); + } + + // Obtain all extensions... + $extensions = $cache->obtain_attach_extensions(true); + } + else + { + if (!$attachment['in_message']) + { + phpbb_download_handle_forum_auth($db, $auth, $attachment['topic_id']); + + $sql = 'SELECT forum_id, post_visibility + FROM ' . POSTS_TABLE . ' + WHERE post_id = ' . (int) $attachment['post_msg_id']; + $result = $db->sql_query($sql); + $post_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$post_row || ($post_row['post_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $post_row['forum_id']))) + { + // Attachment of a soft deleted post and the user is not allowed to see the post + send_status_line(404, 'Not Found'); + trigger_error('ERROR_NO_ATTACHMENT'); + } + } + else + { + // Attachment is in a private message. + $post_row = array('forum_id' => false); + phpbb_download_handle_pm_auth($db, $auth, $user->data['user_id'], $attachment['post_msg_id']); + } + + $extensions = array(); + if (!extension_allowed($post_row['forum_id'], $attachment['extension'], $extensions)) + { + send_status_line(403, 'Forbidden'); + trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension'])); + } + } + + $download_mode = (int) $extensions[$attachment['extension']]['download_mode']; + $display_cat = $extensions[$attachment['extension']]['display_cat']; + + if (($display_cat == ATTACHMENT_CATEGORY_IMAGE || $display_cat == ATTACHMENT_CATEGORY_THUMB) && !$user->optionget('viewimg')) + { + $display_cat = ATTACHMENT_CATEGORY_NONE; + } + + if ($display_cat == ATTACHMENT_CATEGORY_FLASH && !$user->optionget('viewflash')) + { + $display_cat = ATTACHMENT_CATEGORY_NONE; + } + + if ($thumbnail) + { + $attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename']; + } + else if ($display_cat == ATTACHMENT_CATEGORY_NONE && !$attachment['is_orphan'] && !phpbb_http_byte_range($attachment['filesize'])) + { + // Update download count + phpbb_increment_downloads($db, $attachment['attach_id']); + } + + if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && (strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7)) + { + wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']); + file_gc(); + } + else + { + // Determine the 'presenting'-method + if ($download_mode == PHYSICAL_LINK) + { + // This presenting method should no longer be used + if (!@is_dir($phpbb_root_path . $config['upload_path'])) + { + send_status_line(500, 'Internal Server Error'); + trigger_error($user->lang['PHYSICAL_DOWNLOAD_NOT_POSSIBLE']); + } + + redirect($phpbb_root_path . $config['upload_path'] . '/' . $attachment['physical_filename']); + file_gc(); + } + else + { + send_file_to_browser($attachment, $config['upload_path'], $display_cat); + file_gc(); + } + } +} diff --git a/sources/phpBB/download/index.htm b/sources/phpBB/download/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/download/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/ext/index.htm b/sources/phpBB/ext/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/ext/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/faq.php b/sources/phpBB/faq.php new file mode 100644 index 0000000..0b4aa33 --- /dev/null +++ b/sources/phpBB/faq.php @@ -0,0 +1,91 @@ + +* @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); +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +include($phpbb_root_path . 'common.' . $phpEx); + +// Start session management +$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: + $l_title = $user->lang['FAQ_EXPLAIN']; + $user->add_lang('faq', false, true); + 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') +); +make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); + +page_footer(); diff --git a/sources/phpBB/feed.php b/sources/phpBB/feed.php new file mode 100644 index 0000000..e0c0b01 --- /dev/null +++ b/sources/phpBB/feed.php @@ -0,0 +1,242 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +* Idea and original RSS Feed 2.0 MOD (Version 1.0.8/9) by leviatan21 +* Original MOD: http://www.phpbb.com/community/viewtopic.php?f=69&t=1214645 +* MOD Author Profile: http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=345763 +* MOD Author Homepage: http://www.mssti.com/phpbb3/ +* +**/ + +/** +* @ignore +**/ +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(); + +// Output page + +// gzip_compression +if ($config['gzip_compress']) +{ + if (@extension_loaded('zlib') && !headers_sent()) + { + ob_start('ob_gzhandler'); + } +} + +// 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'])) +{ + // Let reverse proxies know we detected a bot. + header('X-PHPBB-IS-BOT: yes'); +} + +echo '' . "\n"; +echo '' . "\n"; +echo '' . "\n\n"; + +echo (!empty($global_vars['FEED_TITLE'])) ? '' . $global_vars['FEED_TITLE'] . '' . "\n" : ''; +echo (!empty($global_vars['FEED_SUBTITLE'])) ? '' . $global_vars['FEED_SUBTITLE'] . '' . "\n" : ''; +echo (!empty($global_vars['FEED_LINK'])) ? '' . "\n" : ''; +echo '' . $global_vars['FEED_UPDATED'] . '' . "\n\n"; + +echo '' . "\n"; +echo '' . $global_vars['SELF_LINK'] . '' . "\n"; + +foreach ($item_vars as $row) +{ + echo '' . "\n"; + + if (!empty($row['author'])) + { + echo '' . "\n"; + } + + echo '' . ((!empty($row['updated'])) ? $row['updated'] : $row['published']) . '' . "\n"; + + if (!empty($row['published'])) + { + echo '' . $row['published'] . '' . "\n"; + } + + echo '' . $row['link'] . '' . "\n"; + echo '' . "\n"; + echo '<![CDATA[' . $row['title'] . ']]>' . "\n\n"; + + if (!empty($row['category']) && isset($row['category_name']) && $row['category_name'] !== '') + { + echo '' . "\n"; + } + + echo '' . $user->lang['STATISTICS'] . ': ' . $row['statistics'] . '

'; + } + + echo '
' . "\n" . ']]>
' . "\n"; + echo '
' . "\n"; +} + +echo '
'; + +garbage_collection(); +exit_handler(); diff --git a/sources/phpBB/files/.htaccess b/sources/phpBB/files/.htaccess new file mode 100644 index 0000000..aa5afc1 --- /dev/null +++ b/sources/phpBB/files/.htaccess @@ -0,0 +1,4 @@ + + Order Allow,Deny + Deny from All + \ No newline at end of file diff --git a/sources/phpBB/files/index.htm b/sources/phpBB/files/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/files/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/images/avatars/gallery/index.htm b/sources/phpBB/images/avatars/gallery/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/images/avatars/gallery/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/images/avatars/index.htm b/sources/phpBB/images/avatars/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/images/avatars/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/images/avatars/upload/.htaccess b/sources/phpBB/images/avatars/upload/.htaccess new file mode 100644 index 0000000..aa5afc1 --- /dev/null +++ b/sources/phpBB/images/avatars/upload/.htaccess @@ -0,0 +1,4 @@ + + Order Allow,Deny + Deny from All + \ No newline at end of file diff --git a/sources/phpBB/images/avatars/upload/index.htm b/sources/phpBB/images/avatars/upload/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/images/avatars/upload/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/images/icons/index.htm b/sources/phpBB/images/icons/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/images/icons/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/images/icons/misc/fire.gif b/sources/phpBB/images/icons/misc/fire.gif new file mode 100644 index 0000000000000000000000000000000000000000..e436d6e8c92e58a071f22f8e4a3b522063ef8c1d GIT binary patch literal 278 zcmV+x0qOonNk%w1VGsZi0K^{v>b9`cmZ$yBYxK{x*v!=Y)`tD;(BX}4`t0QY#X0`t zq|b_*)w{;RL}LEvx6x>H$zFKAFj4f^*3qM~$#aU-b&Tx7#@2k1#Zzy}e38LCT+nQU z?XisFpQqd0;oIKhA^8LW0018VEC2ui01yBW000G(;3tls7kOk#23Me}3uHm>NSH_~ zqA8(G6~v5U;*AyoO2^i6X7#7JhrJ6qSp&HVKC^78V&FHzKYjn8F%+uY&TfR*s@@b>oh z`1ttq^Yj1z|J&Z + + + + + + + + + diff --git a/sources/phpBB/images/icons/misc/radioactive.gif b/sources/phpBB/images/icons/misc/radioactive.gif new file mode 100644 index 0000000000000000000000000000000000000000..517ae6397b81188becf8fc61a55c82dbf79e6475 GIT binary patch literal 300 zcmV+{0n`3RNk%w1VGsZi0K^{vxzg#y*y*~=-1GDEbf(cfah;dF-o?}4Ymu>6l*)jt z(&_Q{>+J0M`}|{^&Gq;BnzhU3=H?z;kk{Pe=j-l>u+*)?)ug-6f}_6P;p3gb;H1Xm z@9*yrQi=cn|J&Zg()6gumkA;;6ydxX~C_J1Gbi9(e{1dT}TN6bu&!2N(eb11JO&32#zBL2&y6>06Q*Pa~J>s literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/icons/misc/thinking.gif b/sources/phpBB/images/icons/misc/thinking.gif new file mode 100644 index 0000000000000000000000000000000000000000..fdec41bc19be535d35d909b032328a6b6ca867c4 GIT binary patch literal 284 zcmV+%0ptEhNk%w1VGsZi0K^{vSe47v?J(92r9%5EU*43lssCK@Gc2q|J&Z^5nGyhi$A(dH;4Gd;!(eDU zz)umGL1+X70s#$c6apd=aDD-30fHVDVgeKe8;t=~mKz0y5)dAg8yf=yp_(2L5)&C6 VtgWuB85J5B9JRK$wHO*906Q;YecS*5 literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/icons/smile/index.htm b/sources/phpBB/images/icons/smile/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/images/icons/smile/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/images/icons/smile/info.gif b/sources/phpBB/images/icons/smile/info.gif new file mode 100644 index 0000000000000000000000000000000000000000..d715ac7c750e8cfd179237b8d30de1ccc4c457f7 GIT binary patch literal 294 zcmV+>0ondXNk%w1VGsZi0K^{vFLJAOrO#KC%IoXvgRaw;yW95m_PNa6`uh6m@%R!} zl4G3By3^{+-0JoD`_tm?{QdpJ(cjqI*ekB%hlkd#^aj5-k!qX zd!N7Y@$vuv|J&Z}Bn!t#lp+OK3j-o*;5J&+U!eBrE6b}S#5g}MSQ;HTdplUM{fx~0y7&6yF+fYN% zD3nU$dT3K<0s=H01059r00;wxfNCCu1_1y828$haUTgynhz$>mbZ8M#Y!-+UpMM?; s7#{=$G!H5X6m%X16C(jdKR!+^5)%sy2@nn!3@R-n5yF8gts@}-JHKv#mjD0& literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/icons/smile/mrgreen.gif b/sources/phpBB/images/icons/smile/mrgreen.gif new file mode 100644 index 0000000000000000000000000000000000000000..9cd2715824dad81420f7e1e21f2fc1b844f9ee2e GIT binary patch literal 297 zcmV+^0oMLUNk%w1VGsZi0K^{vQ;|1TuS2r3vDew#WWrH@tz3cIX-sc2bjn+OeR67R zSbWoBmF#(l;%|-Sa%x~gQ%*TsT0~4tGDt%&Lp>@^RyE7b&uw>EOkXXWn2}vbDnK+N zR6;2L00960|J&ZKj^-dY!zNz23ac+L^V@*xcgv`1y#i)Kr73sKwss=;&mQvXigKoWS3n!r0HAy<;P7i{opc5$eJOYWmUbk;gyG4%F#F*NskqRVTB(g6he}qA1+w8D#AaXNPe2f@0Hs(DR`q&uZL1EO}>Xl<}f0R zeJW-TXZEeb?K#A@j62pg+1yF3P<^)4?G_dKo zD-`QCc!&)Nc533?Ar_16g#iFyYHCW~|6l*B3D`o$q5k}^t-f4;S7$l`rq5yf2{gn5 zLV&iCY2{1+v>JdJf(#)u&pB#8#)_^U%XB_cXF^P=3^|7~McyEaR4l3GdT!*+33Z5} z55TLPzcXpp1&fj>`N0GE#qP-G%J7-$YBuGl$sUKcfkXGcPRQ$^up4U5p5JzqzE9Tp{fJerM_=^fOO(NNRRiPw50N9)K# zw>wS}<;2+$mpg+GF1TB{VL8!Y&zg0HR%RyX)gYRG2T=icN>lh}iIq?9IAxKz(FhA=oM7P{k_vddvv*n$YxZSPtVY$PJQmI7)HKfF+ zl?>XAcNmg7olW`O7`fExBMmwm78loZd%c2E9sk74ZAWvNJf9+ZM%r5+mncxK@ZRY3{6_j(TI0oo38(ICpN-~6clH+1BDw}= z#^qx|kfCH&6hv#=g{y(+4H%LdNfB|AeP(f&s(w2p;fG4_g zZ#Bl}ta1LPHB~EY<5h)j1vf`9L_?MP_5!(bbsh?nDLhz48qCaQIvWd&UT6(4lC=g0;m^pGWJA!)b3Um3fB_r^hg1D)EkruXMpN{oBDF#&!9M1Drfmr=8ClsBlVfjC%H{rk6ml zrpDB^%@{KoNK2%J9cyQ`P}>aRvEWdBTxJ=^>W{f7bLY8RIdeNIM3iJLD;{otnxMer zDEw0Tst$@*95lD*o+0QLhc6S~FC=-E$*!xo^kTaS>_LgSqy$MBIk(oXvjzqZXUYvCr=EE=pv#`LlVA`wwv}UE(;cAc(xzz3Q5m z>C=J?fcx7AC3XMod(M5A#N=jwRS!Y}e{SNtL&Z92Nv(SkKUf8JWpLg_l5{cM!IIc# z_`{jwQ%uUb1CcKAI30Fl!0x%mny;&LHk_ikK2=rxfa*x<4Q8#PCTznVAzT%lHnWqt zC!n5GkEq#IEu3y~SX71#T@oNAo$0TQu+7_AiipzdKiRkmhhN11wXe#8wl}YI^?#YV zGGKIfE + + + + + + + + + diff --git a/sources/phpBB/images/ranks/index.htm b/sources/phpBB/images/ranks/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/images/ranks/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/images/smilies/icon_arrow.gif b/sources/phpBB/images/smilies/icon_arrow.gif new file mode 100644 index 0000000000000000000000000000000000000000..c0f9117b965bfeb13af1146a9abc75d255da81a7 GIT binary patch literal 407 zcmZ?wbhEHb@VHs2|J%y<@07s5oqYd}3jBX7 z{qK_SzrFnb*6{v2#2@NyeEr(xS1(`uc_{J!iNyQ&?`9Q9|GO#r?~Yh)QQXgWO37iy zg~?X4XY^*qSO>c3y`IhA5UbYFkTJ>pg<+_X_1Dy6xJrDcVCPKEx_H+~M1| zZ(S|L*Nz#y-5@x1Ld}6jp&8B2?^X#Msuy~8#j-TR_3c&Jn=^ze^CDmD7yJMJKgiKA zp!k!8k%7UQK?fuN@{Wn|6}x005%mKGKfX%>+P;^pP!lvh&Wn#o@h zR9>azB*bP>R>7*uCKM?sW7?2zuA(jIBr4F*$Sjh@p~fbvCEU!N9>l}N&#NylBQ7x^ zB&e80Q$US_<6Qx$`u)h_V@%EUi@7A1S1*XsBwUsI|(;k--`O$FrBw literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/smilies/icon_cool.gif b/sources/phpBB/images/smilies/icon_cool.gif new file mode 100644 index 0000000000000000000000000000000000000000..6dd150375ddfa9728f62d5993212eb3a633127bc GIT binary patch literal 408 zcmV;J0cZY4Nk%w1VGjTi0M$GI0002~u@3+89R8#X{-_Q9#Ss7L8AduM{>l*k!VmxL z8~&^f>gniJOEd59?)>2x{?ZfvwGP+T)0%J_{@E3AV>)A2GktPi{<#kRy$|{BBJaHt zZed1gTsu)jF8}}kTSzRmmLvA|_W$G<>zfb$+!oi25rADLh=6XAjCh-vjbm3pUsO7} zxU$)p66n7ciiC4@XhoHfe87Pc*2XaH)gA7t5a!f5n1e&@uo1$45_xV}|Ns9000000 z00000A^8LW002AyEC2ui01p5W06+${K%P(}i*+g;PD&)?H6Rdx6j4Y>0fE4wDQsOh zyB3$1qA3Juh2cR#BnlH4?=rzeuF}C^auKR<8fXFrYZNaQDm)escmO4h7#=7g1(gXA zSqlUNdniH-2QHeN111LyToM&Gfoe4&D-uEu4S|9NBW(y92M#O`gbHdSB@k5^IUW@h zS04aTQqBP&4I2nl$61*q4H6a@83338ngE<2vJM9}n4@|my<7|{Co?8GCoHH!K>$15 CM465N literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/smilies/icon_cry.gif b/sources/phpBB/images/smilies/icon_cry.gif new file mode 100644 index 0000000000000000000000000000000000000000..21a5a3c1137e283b5bdab1b936babf0ee44fc669 GIT binary patch literal 1664 zcmd^;Yg1EK7==$r0w)PM=i~%p1mXmg0vXC+C>_LV!#$ulfPls#a*?3cB3kQU3pOEu z$i*^LYS6X=2IZ0fAwWm1+9Zk<3WCVZdMOHZP!P~6H6ht)zz?12U+CUn_pG&^cfC6z zGCW{iDhe^6zuTeFk-I=efBtN0Zf-VVli%>roio|aMVBYRJx6c}Nl)|xJ(ywE&GeX^ zcPRN_dLYoFmKV<8Dw@7ca8_QPl^QPD`Ce?O&)%faFZP7J80J(}aWLixuAo4Tf>s37(?KJ> z_~%KWq%V%M|7v#t8f@+wUVXqB^x)?ED=e=#pc}JHu(c8#TtjCYv9Z%QIA;&^Saw>V z;n7OdLpC^X4}L<7w{TM%nw+qHQH|vu+zI*}%zDiHfOX>A?LdRPX=j@5uK;(L)!)Yg z9ct=kG@Oc1D58xUB}o;famEfTdZVXFheZo`=0T>p4K2DfVZ4Z$tnn0d z(1I9S(Yu5F(`Qi7Og|w#U{WLIF-P4od_n85sAIfUGj>@6oTtY}@xfKhph5flx)&Rm zmTBjan`@`5(b1vq(Yv?I_4K#RsA-&SZbRm-;QhCIzmzyDdWsSVQeh-*VX z$Z=OrDKU?dp33~&Mkn%*LO3*y& z*q|(dPLOGd&H3Egsy`A50&J=xXfE0B7*U(w)g!QjsJKuv-gM~CE>%*-;S{b^d82fv z{}FDsgvarP(#7O_aR{L)*HhdZCF2q3WU4$xdfe8D6*_+VVTDXa^$EaGcp2Sc37rTL zAR2^N(KkV@y-q@PjZPGStXh+S;W`iEX-^k8wD!WsCy@nTdD=OhbE4RNCA)6CcGg7R(2Es=Xd zxHhs@w@^>E*pVdF@PDrk^H8WnnKwHkL&S+L>-N9yeI|W+o#WH~TsSt^v{`?aJba2e z*dq+~Z^^eU%os=rR>9o+uD54(3>E~7cXaakw2>e# zmb7=6y02C#Y9`@^FJtU>0g*E_&B{1e3!ZUeD(Lx0Nq1(e2+xzJ^$}%oyu$-@b)7X};epv}?zvXb+vO z)0E#{m0dHxyg6R+?FPXa&CWMx2>n~Z`(nRXUX0SUV+Lzxm2I5wRGAm~ZzXSYy3(O~ zp}Y{qe~0*|PN+H1DD?c{#doU&{w?Ndj#Yhj#q!@8-qH-$=l3smwG?k$>J0H9(2s)? zDE?$&WMJ@S&;dCQ6ekYs7aF{q)a~8X#MG3f)tkJ9c}y86O`dG4!rI%UC9Z6#HPc(# zjDu+s2eZ&5J5do&Z*dVW7KSZbSlC3wn`8|onf5cU;53nt^_CD~XFtf!%frvj&BY}r zqa&)f^_KY#nI=9~BR4B!Ha2-yzL^4IuKSkj>L>^_2@3Dq&&15m$RuS1(`uTf_VQ{kwmM`2TI?`}0uZ-zDLn@01FYt^V!g`*%v<-%ZilqPYKW zrIW*q<3p@o&*uMkQlKGLE!sn;qaiOZ(QQ&sMRK@9po`xBClY^G^X}TQDKo};_Ke=G z)0F@1<-gt|_Tj>g{@cJ;n&J9xmB5T<=cyBFZq5*TcE$2Qqfl2%@&Et-fj$}%K=CIFBLjmwgAT~G zpg3`0zu4g3WZ-14C8njUV$kHyD)_~s0uzsq?m^CD+7JHJ~cu;)!!e2CS*qXKWQ%5I&e z{9?b@?pLy*-p1RWhd;Ywx#yMa=6kZQXY*e>W>A{p`v3obkjI7sQ2fcl$iU#vpaXI& zC{7&M&osCqF6*$-)P@U7rib3D1;+D4hbkJtX>DK6Db!Z8XN3b}W-3$g9DO-fL7;b0J} zNw~e`t?&{>7NazlhUQ>(g}ZV!3XILn`tj^RdGDYnNZWd@-v)`u+QN|89!@JH-F*lt8Gr@t=nhKi?_+ ze=GfOFaN)te92+PwMB7-$yUkX4ta@gzkdDNwPVxPY08-~*6;TU{eL3y?~-swL*AsG zif`Y({oBgd5UUm+V)c49f3%0rzdK^HXY>ZT=rJ%bc-yI6?-BH|S9^O^wlu@FtEKor zqtKyxp{WyUylgd|U9tRkMBv|2o|`j-UhEgU-Yw{Dr%{;~`F4Zg|CdtlRtfz7C^Mtk z+1pn0+A)J)_ay$E67;s!__u_|%}V|M|6l)KO8z@4aP`W?SP!lLpJe{6;QhCe&)ZJ( z|Ns9$s|O)a{K>+|z~IZE19BTEP8irPHuyHl=xK=whzUu{H1#qH7;t%VyK0IGGWIIl zO!D+}b>(C=;Zycy;h1YZUxJmLUEG;P+KzkPWJ~*XY;Mfj@|><}8fLB%O16&rJQgZ^ zoIdWCe3UL;=2a13^>OhL_L01I$H!Zdxc zl6obaRH#+pDtgRtfw*Ayk=&EXW;UbQxvQo4&jX3l3|F9=f$kY9K=CIFBLjmQgAT~Spg3`0 zzue%~q-g1?Evc=qpxERl$~<8LCx;Y|2;&U4-X;|peG8S@ZVGmM>?|yNtg<$o>>NVQ zZZbmLA`ClrFfj?qG^snutzcngb&+wa{=NDtX$ivO8WuR%j^WH8YgC;>X z6M0_V-8yW7vxOxM53MrQR1$6y5Iw}coYm?Nr literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/smilies/icon_e_surprised.gif b/sources/phpBB/images/smilies/icon_e_surprised.gif new file mode 100644 index 0000000000000000000000000000000000000000..1be6041e3a32194ff7e4d2a21dcbf27d041a5475 GIT binary patch literal 415 zcmV;Q0bu?|Nk%w1VGjTi0M$MKMmi_||Nj600RFKK{-_Q9qzwMj6aVrY{gnj3a2vpZ5>-nx{@E4R*3)rgI{wNKeR5v>;TZYuB4buF{;UoD+!p@14pBrd zZed1aS3uW{5nog~{=E;In2ms4CX$SJ_V)IOfNonzEV{U|wU#4kTs!Z*66>1}{=yIc z;?(3lA0mxCaU?xBw~u3m=IAivYaDj6E9? z5RMrT5C#(UDEC`sJbtbb505WoOb}PVI3>_j49x);x JsDuOo06T9-psoM_ literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/smilies/icon_e_ugeek.gif b/sources/phpBB/images/smilies/icon_e_ugeek.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d3c17994dda57f775425c22d53a6ad1414de962 GIT binary patch literal 631 zcmZ?wbhEHb6l4%$c;?Lj1pTKP|9_JCw}SWI5}tn>`TB1(yIHCCKWyv2+w%XV3adN`rTkx0I!amXel{p;WWC83Ws-NesLUj5B61^fjx?Im)Te z@n%@Mj6s!4cloj=NnvSj)@95rEW(m~+6LlG`?yvqn@DIkF(`6!oI1te#ltgGWwxFU z?=_)KtbEK{h4uOb*lqa4p0b#-3oI5?a@o7mT}MH%k6&c(J|-@GWm#D#cDV_+43D&Q zifA(IVJLX)-Y@C8MAm!40ufh+^InNen>v}aIpx#lE>h57YU7pPAbR20+AyK2COMe{ hirLY+Ojb;NO$+HZzJFTPcr{sO8z@4@NWh0za>2XE(seO8~-~c@NX~wzeD{0 zw(_}IssDc~{r`!?zcsx7cJlqZDf;T=i$4z~{@oFK|Nh;q0_p45E{A#>$Ao+Qe5X`f z6jzvRl^kZA9PSVwVl{h4@78I`@AnEtd+1#65oBOsSlj298Dsr=Hh-Xt-lU$2j)uI3 zShZa{Hhuf{EicjS*%iyu4A-|;Wv8{9T{~t_nHPDeUg+iwp{WyUx>|~-wVBOmc7Cy6 z>_DT?yHx^jHwga!{~u`P&;^P=Sr{1@92j&!UI4|31N-F$hbBD>Lv}FNr5t=P7V{mwt zk)oVaD$>l5-8LbX1&0O+o64?u~W-)qk)-8D;(8$y(X{99LFyXf{ck5EKx6=Ri^1oXp;OfK~A7T~e zWBhLu-=BvPlX@!t-4S!QWs?-)aW`OjGne1ll$C{EOhw6n`m>I*|Ro$IA+#T89UX^8LW&(x=Fa+oc6o0ZXGB89j z=zuH*#fby^iH4{qIR|qUWff6@H@K$H@ znJ_WLEs9@Qm4}&i8zU2wFn^PTrxMFSHa0yeS9ysjvx%$|#S8?_OpH`hWWO%5g_(KBgS)3r z3UhL%T68?p=iuYgVB2D$l*-1-&TBWtVPfuqZFxItE<{gIU|n0ZvqUB004HNRuZxw> N%?(a-7dS9j0|1Szvc~`b literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/smilies/icon_evil.gif b/sources/phpBB/images/smilies/icon_evil.gif new file mode 100644 index 0000000000000000000000000000000000000000..98e6535fde06dc6dda5b81bdfeab36bde26c4b9c GIT binary patch literal 648 zcmZ?wbhEHbFDPm*LgR7k?f~ z{M*U*Zyirzveo}5690}0)E344+s6BEFaN9p>3?f@f4)-+^)~)@Q?wygZP$)XTc;_% z-zya8qWABTaB`S&W{mYeEr$3ItN(AMzkU1m?=XLIxWmtUu78L4|6LJ`_RzV0?ee6a ziudo|($N2wk<~vj`^#7T}%^5=f&heFIxW2tAJ9R?M|BsUY_VfL_EAs!X%)eE<|4#6| z*e~|~t;E0kV$ZHv{@cd)c7x!*O+5dO@%=l?-_=rbpi$`mXX$^Jh5o;mc(+R6|9@ae z&W zeg+0p>&R;!JUp_-(gHqq8i8!~w%)vljOTH&JBe~|Ff*I5bIoH^WaJAtv92q}V59$q zjVY((5;_E%otqex#6&JI9q8<3_f!d-sj#$}na5u(@^eBj1A_!xNX&x|NgZ2-gn1$+ z2RI&U6_uCp(MVjY&R?Y!R*+ek!0lD}h3$mJg+o)AgeBKqV3_3SV&~t;z+epkz~9{v literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/smilies/icon_exclaim.gif b/sources/phpBB/images/smilies/icon_exclaim.gif new file mode 100644 index 0000000000000000000000000000000000000000..2b4a3df33095776107de1602bf5af89aeb970271 GIT binary patch literal 632 zcmZ?wbhEHb8VAfA?<<@2mppS1(`uyD9qriNv3W617Ef$zjI-?uh+- zr&O41HL0iK{a&H#J%SCfYIParTc;`KCAuYtJM7xA>Gf>>j)uH%-@awWSVw#41iI+W zp3xg0Vzs41CdON(uE1pKgqj15LUs8j|89u3mKj|;X0U6Hc4c1Vwgvi?DHeY=@gJ%e zn$hfhbB2(yvGKcA0#h0--)<1>YAOD*N9gTU*==+6{+<#j&2W9OU+mcx%m4rX16@97 zf#OdVMg|6N1|5(KL2=^1ezn27NyE@XQ$|x+R-?(Amt(>NcYPjqE`}MLy-lhT$`-1# zy=Bb=7?+#!S(>o&un9YRO9*pMXRu;oVrCYWXwtEjUe3tEA};DFspBmvE+%%=n9rP* zot>LoTV09mE)SPAgV4@B>P;e?c8_;4%X5m%=9lq0B*5aTq{81M$b0B8i%y6}zyaqb z4qZKwW(LN#W(5wO5TQ*?&aAu=+7g8UZ*QrJ^4bWzaXZ4Q<|E`|QZXU%U}L^wUCW83 h-beRwa5lt5Z9jeFps$EW!-S8G>>XksSXh}DtN{!ywO;@L literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/smilies/icon_idea.gif b/sources/phpBB/images/smilies/icon_idea.gif new file mode 100644 index 0000000000000000000000000000000000000000..e51d542bfe7d5f128c063404a833c9c107d740d8 GIT binary patch literal 411 zcmZ?wbhEHbig~?Wb9!eyK z8Nc5v^zGZXXb+v_aED1f6|ZOWU+)nNbkWO#j0_Am3_2hl$WIPzI~?X+Fz%jeq8fHW`H8JjfP;d@J8`SnKX#9>1!+SIPvi}G_r|jamsS=X-GGV_A{^xh*_#g39GAz zUMyyn=a=Q=WDmL>E~v!MBf}*oAXGNDLVhbBhgpeWd8N{UC|(6Mb7eg>ja5#L4AuZW CnwUcX literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/smilies/icon_lol.gif b/sources/phpBB/images/smilies/icon_lol.gif new file mode 100644 index 0000000000000000000000000000000000000000..3042b00d6bbe5b4abcae6f98dfe33fb7a37cde82 GIT binary patch literal 707 zcmZ?wbhEHb}MMMnk4l! zLs*cm5G@Dh?`7UrDc+1sSVEvBP1+fPD`&u2NGH;22ItPqc-A2$z!ldr%I zUvm$2?j}Vu-sL{ttK3ca75(@*xO|WLGWmKj`!XRu+M>9BJNf>t=J|J1^xr=If0u*{ldXQfQ~Liz;@?q$KMy66!;JqO=YPLfC^N=- zQcp#oi{AgY(*N#?Y@MbYA7XXANATYj!GGI%{;lBcXvq8jQvBZ`{@F8n^Ag>nJ#_x9 z;BJUj`}XbIt{t0_!yW$J5&QpE;@=wHe|z~$GhAQK=Kudv;@?W%e@FSAU9tSPocrx; z-hU_g4%G{FwG>Yp-$A~&8wCGt+t>>B1?ELQp-@jvg z|Mu|y+s*s`sTeRoKw(5Pp!k!8k%1wBK?h_5C{7sIA2%d4>4lq03rlOs=r#4S30sLU z$}#yU7_jwfMonU5WMUE*@R!g`;NY1%k4aR3g++>)L&jN-k-^W1Da?yOLyX&AQG9_B zgSn_YgQSK@h^&OTXuP_*lVJplpdcTgtgwLLDF$yL76yh`cTQ~{At7aDh5)e`2G>wd zPG%md^?|lUE)GsjE=`hV5;GVQ6TR6=1PWCwHymhTxh{Mv?Mf4QE=I0Q?a3$l|QmqgvY>Wu}dd2y9-ai1&;|#61oi?A1*4fTwK%}XA*Gn K3F{RH25SKRZR2_X literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/smilies/icon_mrgreen.gif b/sources/phpBB/images/smilies/icon_mrgreen.gif new file mode 100644 index 0000000000000000000000000000000000000000..dcb44bb01a3ef0c47f4fd0be57b04bc848083017 GIT binary patch literal 608 zcmZ?wbhEHbRnq8x}Dvi)MJ!#Bd~+;aVBPjq--pI>tu#%(~RS|Nb#NsAkxb%rGsOVOA(Z zg_C!GdTd5iXMaavbuz=MIG{&B{uxq0@h1x-1A_~L4#?G@IB{U#+u+h9?&zQoz2)YX~q{0|3u0lobE~ literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/smilies/icon_neutral.gif b/sources/phpBB/images/smilies/icon_neutral.gif new file mode 100644 index 0000000000000000000000000000000000000000..41c3e14c4810cbf85f5f3580d47c018e9becc5ca GIT binary patch literal 621 zcmZ?wbhEHb)HHnR_g!O@P7OD?cW`-e>?g9-4y+Ih<{Q~#lNk5g~?X`-%6KexbE7q z>EBU-e=B(Z?dAXZPANIeI6lNGGse23A+NS5ZuX4cS1(_@fB)|Kwab4VO3Y|>e!D^N z{a&HUyvRfKLf4KNv7#ntz2p>jAx0Td zIc-Y?O?LL(#~F9a2@6|FhzJSs^NTPt-4_<;=H*~~^@{0~+%s-&eh!`WGVeZq6yW1f zHu-+)f#Zt{i3|;b8V)`mHmrWQu8G%ZB13?m{6R)GPY$b(3T-@ce%%`ELd9zf%JLE(yC?ssB4F@NXyIznh}} z4)Oon$~UV(`uerYuU@`*|NdR5w{c;z)&D0FKi?@OhZ+C7BUW1!_ir!%zcsvn9!mUw zE8P&QmKkIH?c2B4v-y+59cIty4Rq0))Kd{3V)cHnP_&26t{t2565To)^0rP>w$Wz4 z-XplMRP0c_P-R|ZX@;wee_Nwf^4>EtZ@J%a`>}n}KJcG~2g5%vPff>!tv)To04A}p!;r+Re&(VVG?FK;? zV~!*riG^h{KX>vUUM4toLd~)&foE4Nr)6@RYO(!Y!Ruhn@#~!MwPOYc8in%0We+y< ze7GY1|Nnmm8Uw|jEQ|~c@eDd3dq8pG!2X~izDX{~KvqarLs_mVUXX3V1Xf$$7zf4~ z?7dCu;u`wuv*VScq!}3OEo|HaS-ClQo#MrLIe8eZwL@8$n0UpT6x~FYGcYqtaT$v$ z#*0b`3o~2ASw@EWOK@^3X=-si;O21&mSow(tJ%cQZu)EwlMXxoY(AloBht)vS_*tk z0!jkfW(iGAOsrlq4GvC+H}XbIW9e*6Il;u^< zA`$9s{O^v~tCug{zkin;X8i92-@l^*|90}#7RCKL$oJ==#J_F4Ki?@8CR_bm!V@22 z^=~U*W{mZ}o1*`gbLSs!M+qZAm zdjyli9sZr=d%suc-!Z<~GkSOJ*z|8N|IHaf|3B-Oq)AVmP*a&L{cja_X@;wZgMMXR z z{yY@FcFbT#v-7)E0{@Qi{aefPZx`>gE0$d?#pQ95|26?##rtnN@4s6j2O5EvO8=@Y|^o?mXnfG)YfTAFvwlcl%GSX9y0cuu0WKL@j`mphYRf-kc$dsw0+qfAWV z^7ev8iGt!hJPZsxe5{vEL_}1yG=wfcc&Nax)x^(Y8f+CQ?V-!UKZi{!^aux&r-mL| zlK`)z85_?Fr32ju6bv{V9uzn>@UwhhB|1Z)^_Y;5l$}MvgvZCGF}bWWSa?Cvv6Iap zPGX|ML7}$kHVqva2?|Y|+zcfzSw1{<;j9zjaCzCFdYws8+C}5ZmjkX`db({(9tijc IC@@$909b(J*Z=?k literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/smilies/icon_redface.gif b/sources/phpBB/images/smilies/icon_redface.gif new file mode 100644 index 0000000000000000000000000000000000000000..d23a1396a0b14142aba96c7952b99baffb068eee GIT binary patch literal 2990 zcmaLYdpuP6AII@=zs<~DJn*mTqa~?47ry37?Mk=u=+7&+_g1wmxd&C zK_S)emtoVAYUzT?{>s{hA7>glh`Wu#~I*p|fBRm`q zMYzNVvoh@r#{!6l0$d_EmNDM8tSv@IWA?H(8jaz#C z&2C=58WUifdo(`(*ui-L@o3WC`Euf@8!eg2|)kFUD$SV|8| zJ;a-tdpN%5fI8c8LrGD3NnUztY(Q0UQIEBHYIwl>{QGxrr$HDV9KwSgw8Xb8IItic%|89C3G(+G70q`MkjsW5z5QPWM zIM9d#F?gh(3WRv1n1(#3f(AS?3?qv)kPU%y9Jr>5)Kb9}2x+H+1RS`l34(Co00hoz zBDY~s1tHBaQU-%UO^}5HNAZ;`Do7-OIx=`f0t4hqE)|3mKs{Fa5UvcOf=;sZpKzrY z74#8+Jr;SZC2fSIB{2ArjO1(ix>z3FzgN;l2OW6HAf3fD0{?;}<8*M3AZehp%#A=G z1fmImjlbD(73{`?5D57l2E7nS)kIEEkvS@G#eo}ma0v&VX(CzhtQRzM1jB;p%$?L8>0*?}JI&qE zW^djQAI6%gg66Ji3ky@G8f|9mp{YKb>1y)LuB#oT`W*rK(^tqN&5TrTz(_u0>WR&q z53wXWeJ(@0{J7Ipq0QV=?UB2TXXWZ8C)0Z})l=gG=30r?~N|pi>uG zZk`Sctt)UDxxG6o|4?MxQ&gpV5&t%Bg))?Dek+WrF|l-hMw{@hG4@3im5&@jp#w8CJ7wAL{64=;K}*#G%t%*v z*zkIm9jDW*CIWFMaHyqbYxP-|tWA^tyuX$qw=ngq=@4=E^_0ugdvf($MsB5ErtKU^ zk&EnujQuotlYAVXyG4!0_fmQ*kdgUT(;c*lmNF62!&k;huaQkvXy%h?pE<@1ad)jT0x=cH$f4eHc7bSH?2~$U4DTt-z}rkowod2OXABz0NR-~xiroBaq$JBwzO4H( z`8jE7RAaey5?MNE86y;L^LwIP$YJI7uMh2MPTl0{;itFP_Pnbk>k{0~gI>S;*y0y- zH5$@15x#DaQAoOjHMLB%c$tT6bNh{QB%$`(|TSh zv_#oELWP%@y59;LK*KcrCv^B3n3K3*SJAkUL3+IhNipocV*+$a_Y{2{M$hcD$|<3N%ff(Z+J;Y(XotiJ@S_&n*;JY*X;>> zJTBREG9iRWw)A;!T4q7+)>4d3>^YPWVkX{=m)7$6uYcCCvXCnE_+wQ!7IwgPOgYSv zOLDT`s_R{yV%emQ+HoWj8@#-$%ET~Dl=$M$U&OrxsDi5qT0WD>N2Nm@~o510qZ1h#fu@mp=&lCxT&z-w^{ZA7+7Aj^I>-mHSF`gKc`2# zdH1Z_vQh@i>UJPreR7|6J-Zyl{J~T;KVNfw;)77h;yOZUosVol)1uJ4ysjmLV;3uk zy|~8W!ZA&TglE=#EjqeFZ7E^Ti#Bd_N6f(i?rxvUKDhD0tyK=Z?)JOC{?KI6&cBej z|LNc-;f>QOyP8DfT@ zvcY+`54*M-I%XxW)YGkSbZ1#P^FWOfRSG}%wmi`lwa|+FzJ8bzInzxtIhXZ4r!!6` z6iHS=EsQ&>zoXUXk*@~3(l+F;0iH((7(P5WBtQq)Cf>6=sUz24V6r;Evu&_OIQ#+~ zpfdmc-wp7K8t}x~uf&T38x0cM3ugpkv7-`HY%p9W@Lrp&W*haS(Zy@+=2-90({6&?3jlAKt_ntO6TcB#JHT5;j6FLP1s2`{>{ zzy82%)yPPaxID>S+di^i43F)9xQhLX&2@NRrEhQ1k$miwjwTqKV6~ryA3u2ZWh5HqI+y4R; C&*20{M@dNns@eE(Ro~&wW6~)I&HW= z=XmXf2-scoJn*5cY4NrhT`ulrL%)sUCsWSr335kECFlvvpEZhoz0W@BA56S_=G3PP z3k#zoNvhpVcl-LDS})x(N12K!Wk3JA@mi+p?p5#5!B?{*#+ROHjrQ(I?=#MR|4l_&;>%8v7q-0(Rh*crwx5#2>CWhl7wN{(k(y!-%}wKY;Wz}8Eoom zt*)$6DP;AE`)Z9I1DHGKl=~(u@7q4Wmp}5T6}J}K%K4-Uf4DHBqbf~iRdVgd!AOLn zNTSBD7HG6b#waJzqO>p?+Xh{PVGeIPl^@Qlt{^FfWf|vGM(-~*kQXm}m)TW{6H^?Q zVY3;JU28PfW|=Va3r#axi&E)wu79^w#*bp`HHKG>C3Ti6h$hVy9?{GpX2S- zwVp{kmVAzj?A>@H(50xVQX1S}#rTPkIz4VaeMxCnCe>ux{$5N|>}XCWvg1LhbNhZT zRIfBtU@EK#)5s0WfI#0L%ldf)1Ctvv3`jq^L@aY*qTcsv2g zgD@$w!Z7dY;Mupq7+m7YbBkQE$#ISc9MK|(fb8cv-U;^eJ{e05jQ}=98x!IZwq^y> z$(Z%ubV7s3H^u$lw+03e9Ue+SZrSF+f2rj*dMsz->I0oXh`k~72>Albf^Lu$d~98; zZog2+rAAZ3!(Fi@BW%SePX-%hBf!8I6eF8~mjI0-rPGC+^~P`mzom&8W9pAG1)y23 z%pM2hzysS`;Z~Q(hr^Jjm$R&r4CEvuuo;TH4m`#;zyPxuP+&UVf9 ZmgCqDK0FR<+gsn=>Wag#NXv5me*izYg30)Y-)<1}^LBc6#q#Y{+0qQxn=^#U(#$LKBCRcr-mMaNv0u#E!U*Ui zkXHvEQ2fcl$iU#spaXImC{7&MZ#FP8`f6Ld%8AIy+iLqZNwTpqu&}7|8c$*1SjS4Pm{Y;ty2MmrjG;_#H7j<+bo)1=Fum%8-fVfov literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/spacer.gif b/sources/phpBB/images/spacer.gif new file mode 100644 index 0000000000000000000000000000000000000000..cd29009a65a4c35c56a9c296731e1ae8650fd789 GIT binary patch literal 807 zcmc(ev9VP_3`6y2UO*edqfQtYvn%VZ`yDQgw4er)UO?E4 zG}?&ude0I+aCWBTh&{G)+1Z^EH2%S&yR*F@2^#-k(M{6WB}?Lfl40@y3ddLk8ZD?9 zg$ociBaL=%^s=MQ51jIZB#U7`y9^j^TNb@FZ#UFVO{XJzi2OxCoPcgy&uO1 reI`&k%nR$;Tn^vIGfg}7`&jpS9BP}F!UZ;61mvZ_GlkN0Vjjlft!fp0YuJ!me@770a zt}f4I5>I6jjH!!vm1<^Tm31}j$PwVTT7$|CqKia zIu>rB#1v+|cEc%C+1PaTLya?)1Zw!j-BuKu^OoCkuc%qJ+|qi@l3KON`}R+2YEopd F1^`O(UmpMf literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/upload_icons/doc.gif b/sources/phpBB/images/upload_icons/doc.gif new file mode 100644 index 0000000000000000000000000000000000000000..078d9f7a14ae12ac13f99fe1279fac7ff320de26 GIT binary patch literal 940 zcmchWze|^K5XbLJ4mQ}LNN7vokl`R6L}fuOrWiz-LUo4k zXoM6km3z2_Yq*pOn&x2^reRW|m{kw8Pz@C{vKrzc7NQ}rq8cznqY_#4AO;&~uvnHd zR5j1s)m_RTv{Ytp>Lz6u6*Sdc)m3nhC}v&EMP0B*9>`>yIPi}M9HJU9M5B^XbU+L? z&|pa=S8ZyZnn?wTKWM2`O@&;siwc@1YC?`AO#tX(oS<<_l;nX-wuu8x7{(#00YfyK z$U+CiU;{06qMD{n%@Zz0kobd^N~J!I%C)(7HJcMw%*|D5wh6jYZ?db^CXPBn1c_3m!V>;e?mHM%gdd6#@nl} z7CXD=X5O}EUtj(vQ{j`yc8R!q_2#pCj~?B=fBDRf)4T5--G8RJzGM5Q zV_P>I+rH`ewvDIPuR670)?r2}}K{VoH;e+Gu9 z3=BZV9R`Lg3=EeT7>+P7Y-3=U&%od=Ep=Z){Ir6?e3~f(q%AaRCI_ZjwGiYcCnVTymCx=g-+%aiV`?P7@ zh6XYo?xu+efr|26j&>?0M)K~iCJW|Ib8*xT4R%h94@^xCO-TyT)0S|y*RZzG@^Cfv z_puG~cZdx0=xnd;?`>vfVQ{wBcXu|*OpDCRj<2rBId=4*r>j{)v}b6bb4Y+wMQK(| zWuAw#k*AAse3WNhbzx#`U~+tLT2fd_LP%z6WJXFvVQ$j4E$hMpU8YZLx_RYzYC>pR zQ|00XGlP8{L;am|GvcB{y}aD)TN)~-Oz50Cu`4djGdVVR#>6&9OWlI3#Qe;J)r+Q1 zpU{>ZY+F{4QIeNdRg$xE@$C3e&)&A$Y5i@J`#N4fxxI18w3fQ^H&5^OcQmeCG<(CU zB@1RxJ9+Hzq@MPr3+Bw9Id#^Q2@7UTo6^&(-r{Hf`Uq;nL~T5AWQ0eE&Yfpa+USSr|c%)BzEoJmJ9cpMjA> z#$&^RgSI<5CjN4M9V#MhmUoAtP*Hex6Nenbj13;b2VD~G_!uS!Brti{)*Oi7RCZ%` z%jIf|nCQgX$vTNoP$JDI!jN$no1rGBqGao0cW#C3rN8J|F z=_Wqbn6eKygxLLNDmY15E^IXG)XKJ&RsG|yB=uf-XZhoi&1zLJd6zP4a117APjWu$U}!Sy*&HAz;0eH(QlMq z2PkL=lm*fZ|G@yrAQCA4WMO1r5MF-UYo0&harQ>T$_7>@njEeP7|Z3xu#lri_J8bEngw1 H$Y2csmZD3t literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/upload_icons/gif.gif b/sources/phpBB/images/upload_icons/gif.gif new file mode 100644 index 0000000000000000000000000000000000000000..5aa8d463e75b45184fea98cc67690eecc670d5f8 GIT binary patch literal 189 zcmZ?wbhEHb6k!ly*!-UX2>$>0&+vnRp`M|>o&hLO&%kitz=8ey_tyjY7(nqS3nK#q zJA)2L24scV<6Bs1ILVL9gBx0^7 WxHWlJ$;7Qb1H+Uk_w695`@b|Ni|T4mP0plZBCifsH{2BndLZ zfhFa_3D4D2n?(c<2{?<(97tuzShYw^X`g#TL<>WWlU!Fy_n!mvGn<%ME#}I#7W{Y< zcXE>JgQibQ4zDTmUg^ZYd7=6Bz*r+`Ssv?)PwpMdXmvOsJL{uh^r67Yr{Wyt%`ILr J?d^gL)&QM1KvDnz literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/upload_icons/jpg.gif b/sources/phpBB/images/upload_icons/jpg.gif new file mode 100644 index 0000000000000000000000000000000000000000..537de1c3a0b69f5113c2e05db2fe4d6f8c4c16d2 GIT binary patch literal 188 zcmZ?wbhEHb6k!ly*!-UX2>$;7Qb1H+Uk|1j7!Djbuz&x45FZ05{$ycfU|?s^0m*>O zaA3*&aKdx-R81D9uIEh#F`P;BG?*qt-Bxl`>I~UdDkZ)m<1y;AY=+`kCHp@9-Qg|HcUnJYk`}cM^82JLuME6`hq< PRUsPL6&W8d$Y2csOf^5D literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/upload_icons/mid.gif b/sources/phpBB/images/upload_icons/mid.gif new file mode 100644 index 0000000000000000000000000000000000000000..ea7302cb16e099c6c65a5e53105caa2f13eaa2aa GIT binary patch literal 141 zcmZ?wbhEHb6k!lySoEI(2~lR~uvFoJ=%L-mXQ{?HedGyr;9SLO<*IXjxsdOxs#JqG&-KU7K7Vwz?}SRq q6Qj9px||7FDGrgl7F^wQDs1}B`+7%u`>M}8YCe@$Ked;I!5RSWfH>>` literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/upload_icons/mov.gif b/sources/phpBB/images/upload_icons/mov.gif new file mode 100644 index 0000000000000000000000000000000000000000..55f2116261790454ca65d5bbeea02aa91679cd02 GIT binary patch literal 271 zcmZ?wbhEHb6k!lyI3mZ8kTBoCAR!^){Q3C?^XH%c@Zp0&!upS9BP}F!UZ;61mvZ_GlkN0Vjjlft!fp0YuJ!me@770a zt}f4I5>I6jjH!!vm1<^Tm31}j$PwVpS9BP}F!UZ;61mvZ_GlkN0Vjjlft!fp0YuJ!me@770a zt}f4I5>I6jjH!!vm1<^Tm31}j$PwVE{$ycfVBloX0f~al zU|?xBIO(~1?+w1q){Zed0%a~qHc1MxJMkXhzLCRl`BX=d`+X*$AMDa%IQX8!g6rOU3D&^VOnk{z+fF#L9b;!SO;<5C pOihVs5pD}NVbO_IG2t}Tl<({2H0X9}@lcsHNpi{3Wg>zM)&MS7MRNcE literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/upload_icons/pdf.gif b/sources/phpBB/images/upload_icons/pdf.gif new file mode 100644 index 0000000000000000000000000000000000000000..8d0603ae654c1c5a04ef7373d8e2d1edcdc2d1f6 GIT binary patch literal 370 zcmZ?wbhEHb6k!lyxT?T#|Neaj1_l8Ef&W0j!0^Dq;lcX#5BmEhBqZ)Xc<>-U|AD{% z{qyG^Y}oK%{`~tFF1)w5e-IG=J|N(Mfx-Lucur2v2OIXkckq9pum8Z_;X!=-gNB9& z_4N-53LYdRJlMYqMEQ|~c3Jf|R3qXEiVC#37P~f2>)!&@*$%DsYzJFsv zKnNSd4V^Ftj)3+H8-x$2D(qXpka#vNesMDz&fy*|#oENcFVE=4EXu{r fvyFjsS16;GBmPM+R#ERg!Bm literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/upload_icons/ppt.gif b/sources/phpBB/images/upload_icons/ppt.gif new file mode 100644 index 0000000000000000000000000000000000000000..a3800d12c69e3a307fa01e58e0726f0e5dc8990c GIT binary patch literal 867 zcmeIxv1=DG6u|K;O2!l%uGl4;C%@(F(xZ#~5d9gK@)pb4rTtBEW5#TH1u2J9#tu5% zc;FH`Whj+U9j;pjkqm|M#^980@qYh?_~pan%@5wI*Dv?#V@4QBgwV33rKD9)>yZji zMPRjN%h@>-BNLW^WzEEz$kwq~4uzPRLf8UK0rPYP_+sq~8MqiZ%nS$1VdCIr&mvWtT*sghrtgfCX>>9%KNM+RnD!Bzq_O zNop^3kQ(JV$}uXiN(QC98c+>MnWU!Njkzphj;;^* z=)b>siMYRc+gf0># zk|m);gV66db14#3=m$khQ-d^J&wZi)pj*E0ad*!>&vT!*t9#F`wv*MU#u^YA9$^t0 zArZ*TJ>0@IT*8q>^Dqn3FbPBUs)t&rhDs=MR6N8&G(E8eJQho1qE=1mA}0|zOk~ebpBe^*2>nAQ(rDzuQ~K<^vUDF$x;dJe*yh$s2KnN literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/upload_icons/txt.gif b/sources/phpBB/images/upload_icons/txt.gif new file mode 100644 index 0000000000000000000000000000000000000000..cc3639b89ce72ebc591881b82cc787d1b797c858 GIT binary patch literal 138 zcmZ?wbhEHb6k!lySoEI(2>$>0f8fA@{rmUV*VlviV4(Pug^_`Qi9rX%1F3aj_Se{T zXP?RmPxgwG7iV?(7&O|RxX-<(JVAK{*Tu+KKOOJP$>0&+vnRp`PKufdl*Z@2{_~2MQ|wWMO1rU}4Y!sQ{^U zU{3egb;mE6h0)8v`~{Pop{qvU-R8`U1W7rAfSW6)^(EflzTIQ$o{KCE2NXCM7z}Tp zNw!c5_MThfmHQ)rb=ov|)ss9A%C2*aF6Pr;S60WB M(Bc;w#K~X{0GpyZ=l}o! literal 0 HcmV?d00001 diff --git a/sources/phpBB/images/upload_icons/xls.gif b/sources/phpBB/images/upload_icons/xls.gif new file mode 100644 index 0000000000000000000000000000000000000000..187a19b53c3ff8f46ded3daa7ed2ef5ed87758cc GIT binary patch literal 941 zcmchWze|^K5Xa9lP=caziChwcgofxavS?^AzZFDD6f|jekkt@4v=m=*%6=?Sa^R5B zP%b&u&|(r4afG!KO$K#GCk8WHB+jJ z$nXry&Yfsz$1(TB@cBNGXxxDVCxs6kr1l7RyXa@znDO zi_i!uS}ON&3)gTd6*SGmEKI|sL@}!#YM~k`Xk<0SLo7r?U_~`xh(;x{=s^rN&|tAF zWvFVNxvRUBKWM4U+|*6VE-GlMxvHz+9#PD?n2Wk#k35jcHgVt|5jaFOV2DN~qv(Jb zY@orCO0L?}JT;RF5`WNAshSG8Viy%OP1J-ONtyuA#W+FZmMF;snQRjWnlOw*R0D=+ zHj#x6h`|P0>O?h7o0=zFj3Ds`EtN`r9F=Qx?`k$DteBgt)NB)UrQT#$t4$nrgvMbZ zHKOY#jgA6tp!poQ65-(qDrvWumX_M>HlJga|Lg7k+u0$qCi{x8{t4-tkvHAFBa2Vp zO?T~>y!df(Z29_k8JXLAW^HhK^}va^`C$D0z0Ox(o;|)X@!@Xou`NBVuj8+0_jgQ; z4lMS!9)9cpIk$8Bu7gijZ!fR6bkEAwq067153TfloU#6-|6YmOTX^VoV#*% n;rwR1HSp-#g*)2@7LKk>y;z$)wdwHS(oRgLH%t&MSo5y4=>DyDU#ri}n + Order Allow,Deny + Deny from All + diff --git a/sources/phpBB/includes/acp/acp_attachments.php b/sources/phpBB/includes/acp/acp_attachments.php new file mode 100644 index 0000000..2873b48 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_attachments.php @@ -0,0 +1,1749 @@ + +* @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; +} + +class acp_attachments +{ + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + /** @var \phpbb\config\config */ + protected $config; + + /** @var ContainerBuilder */ + protected $phpbb_container; + + /** @var \phpbb\template\template */ + protected $template; + + /** @var \phpbb\user */ + protected $user; + + 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; + + $this->id = $id; + $this->db = $db; + $this->config = $config; + $this->template = $template; + $this->user = $user; + $this->phpbb_container = $phpbb_container; + + $user->add_lang(array('posting', 'viewtopic', 'acp/attachments')); + + $error = $notify = array(); + $submit = (isset($_POST['submit'])) ? true : false; + $action = request_var('action', ''); + + $form_key = 'acp_attach'; + add_form_key($form_key); + + if ($submit && !check_form_key($form_key)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + switch ($mode) + { + case 'attach': + $l_title = 'ACP_ATTACHMENT_SETTINGS'; + break; + + case 'extensions': + $l_title = 'ACP_MANAGE_EXTENSIONS'; + break; + + case 'ext_groups': + $l_title = 'ACP_EXTENSION_GROUPS'; + break; + + case 'orphan': + $l_title = 'ACP_ORPHAN_ATTACHMENTS'; + break; + + case 'manage': + $l_title = 'ACP_MANAGE_ATTACHMENTS'; + break; + + default: + trigger_error('NO_MODE', E_USER_ERROR); + break; + } + + $this->tpl_name = 'acp_attachments'; + $this->page_title = $l_title; + + $template->assign_vars(array( + 'L_TITLE' => $user->lang[$l_title], + 'L_TITLE_EXPLAIN' => $user->lang[$l_title . '_EXPLAIN'], + 'U_ACTION' => $this->u_action) + ); + + switch ($mode) + { + case 'attach': + + include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + + $sql = 'SELECT group_name, cat_id + FROM ' . EXTENSION_GROUPS_TABLE . ' + WHERE cat_id > 0 + ORDER BY cat_id'; + $result = $db->sql_query($sql); + + $s_assigned_groups = array(); + while ($row = $db->sql_fetchrow($result)) + { + $row['group_name'] = (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : $row['group_name']; + $s_assigned_groups[$row['cat_id']][] = $row['group_name']; + } + $db->sql_freeresult($result); + + $l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((!empty($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode($user->lang['COMMA_SEPARATOR'], $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NO_EXT_GROUP']) . ']'; + + $display_vars = array( + 'title' => 'ACP_ATTACHMENT_SETTINGS', + 'vars' => array( + 'legend1' => 'ACP_ATTACHMENT_SETTINGS', + + 'img_max_width' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), + 'img_max_height' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), + 'img_link_width' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), + 'img_link_height' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), + + 'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'upload_path' => array('lang' => 'UPLOAD_DIR', 'validate' => 'wpath', 'type' => 'text:25:100', 'explain' => true), + 'display_order' => array('lang' => 'DISPLAY_ORDER', 'validate' => 'bool', 'type' => 'custom', 'method' => 'display_order', 'explain' => true), + 'attachment_quota' => array('lang' => 'ATTACH_QUOTA', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), + 'max_filesize' => array('lang' => 'ATTACH_MAX_FILESIZE', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), + 'max_filesize_pm' => array('lang' => 'ATTACH_MAX_PM_FILESIZE','validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), + 'max_attachments' => array('lang' => 'MAX_ATTACHMENTS', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => false), + 'max_attachments_pm' => array('lang' => 'MAX_ATTACHMENTS_PM', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => false), + 'secure_downloads' => array('lang' => 'SECURE_DOWNLOADS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'secure_allow_deny' => array('lang' => 'SECURE_ALLOW_DENY', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_allow_deny', 'explain' => true), + 'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERRER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'check_attachment_content' => array('lang' => 'CHECK_CONTENT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + + 'legend2' => $l_legend_cat_images, + 'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'img_max_thumb_width' => array('lang' => 'MAX_THUMB_WIDTH', 'validate' => 'int:0:999999999999999', 'type' => 'number:0:999999999999999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + 'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'validate' => 'int:0:999999999999999', 'type' => 'number:0:999999999999999', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), + 'img_imagick' => array('lang' => 'IMAGICK_PATH', 'validate' => 'path', 'type' => 'text:20:200', 'explain' => true, 'append' => '  [ ' . $user->lang['SEARCH_IMAGICK'] . ' ]'), + 'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int:0:9999', 'type' => 'dimension:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + 'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int:0:9999', 'type' => 'dimension:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + ) + ); + + $this->new_config = $config; + $cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => '')) : $this->new_config; + $error = array(); + + // We validate the complete config if whished + validate_config_vars($display_vars['vars'], $cfg_array, $error); + + // Do not write values if there is an error + if (sizeof($error)) + { + $submit = false; + } + + // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... + foreach ($display_vars['vars'] as $config_name => $null) + { + if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) + { + continue; + } + + $this->new_config[$config_name] = $config_value = $cfg_array[$config_name]; + + if (in_array($config_name, array('attachment_quota', 'max_filesize', 'max_filesize_pm'))) + { + $size_var = request_var($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); + } + } + + $this->perform_site_list(); + + if ($submit) + { + add_log('admin', 'LOG_CONFIG_ATTACH'); + + // Check Settings + $this->test_upload($error, $this->new_config['upload_path'], false); + + if (!sizeof($error)) + { + trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); + } + } + + $template->assign_var('S_ATTACHMENT_SETTINGS', true); + + if ($action == 'imgmagick') + { + $this->new_config['img_imagick'] = $this->search_imagemagick(); + } + + // We strip eventually manual added convert program, we only want the patch + if ($this->new_config['img_imagick']) + { + // Change path separator + $this->new_config['img_imagick'] = str_replace('\\', '/', $this->new_config['img_imagick']); + $this->new_config['img_imagick'] = str_replace(array('convert', '.exe'), array('', ''), $this->new_config['img_imagick']); + + // Check for trailing slash + if (substr($this->new_config['img_imagick'], -1) !== '/') + { + $this->new_config['img_imagick'] .= '/'; + } + } + + $supported_types = get_supported_image_types(); + + // Check Thumbnail Support + if (!$this->new_config['img_imagick'] && (!isset($supported_types['format']) || !sizeof($supported_types['format']))) + { + $this->new_config['img_create_thumbnail'] = 0; + } + + $template->assign_vars(array( + 'U_SEARCH_IMAGICK' => $this->u_action . '&action=imgmagick', + 'S_THUMBNAIL_SUPPORT' => (!$this->new_config['img_imagick'] && (!isset($supported_types['format']) || !sizeof($supported_types['format']))) ? false : true) + ); + + // Secure Download Options - Same procedure as with banning + $allow_deny = ($this->new_config['secure_allow_deny']) ? 'ALLOWED' : 'DISALLOWED'; + + $sql = 'SELECT * + FROM ' . SITELIST_TABLE; + $result = $db->sql_query($sql); + + $defined_ips = ''; + $ips = array(); + + while ($row = $db->sql_fetchrow($result)) + { + $value = ($row['site_ip']) ? $row['site_ip'] : $row['site_hostname']; + if ($value) + { + $defined_ips .= '' . $value . ''; + $ips[$row['site_id']] = $value; + } + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'S_SECURE_DOWNLOADS' => $this->new_config['secure_downloads'], + 'S_DEFINED_IPS' => ($defined_ips != '') ? true : false, + 'S_WARNING' => (sizeof($error)) ? true : false, + + 'WARNING_MSG' => implode('
', $error), + 'DEFINED_IPS' => $defined_ips, + + 'L_SECURE_TITLE' => $user->lang['DEFINE_' . $allow_deny . '_IPS'], + 'L_IP_EXCLUDE' => $user->lang['EXCLUDE_FROM_' . $allow_deny . '_IP'], + 'L_REMOVE_IPS' => $user->lang['REMOVE_' . $allow_deny . '_IPS']) + ); + + // Output relevant options + foreach ($display_vars['vars'] as $config_key => $vars) + { + if (!is_array($vars) && strpos($config_key, 'legend') === false) + { + continue; + } + + if (strpos($config_key, 'legend') !== false) + { + $template->assign_block_vars('options', array( + 'S_LEGEND' => true, + 'LEGEND' => (isset($user->lang[$vars])) ? $user->lang[$vars] : $vars) + ); + + continue; + } + + $type = explode(':', $vars['type']); + + $l_explain = ''; + if ($vars['explain'] && isset($vars['lang_explain'])) + { + $l_explain = (isset($user->lang[$vars['lang_explain']])) ? $user->lang[$vars['lang_explain']] : $vars['lang_explain']; + } + else if ($vars['explain']) + { + $l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : ''; + } + + $content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars); + if (empty($content)) + { + continue; + } + + $template->assign_block_vars('options', array( + 'KEY' => $config_key, + 'TITLE' => $user->lang[$vars['lang']], + 'S_EXPLAIN' => $vars['explain'], + 'TITLE_EXPLAIN' => $l_explain, + 'CONTENT' => $content, + ) + ); + + unset($display_vars['vars'][$config_key]); + } + + break; + + case 'extensions': + + if ($submit || isset($_POST['add_extension_check'])) + { + if ($submit) + { + // Change Extensions ? + $extension_change_list = request_var('extension_change_list', array(0)); + $group_select_list = request_var('group_select', array(0)); + + // Generate correct Change List + $extensions = array(); + + for ($i = 0, $size = sizeof($extension_change_list); $i < $size; $i++) + { + $extensions[$extension_change_list[$i]]['group_id'] = $group_select_list[$i]; + } + + $sql = 'SELECT * + FROM ' . EXTENSIONS_TABLE . ' + ORDER BY extension_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['group_id'] != $extensions[$row['extension_id']]['group_id']) + { + $sql = 'UPDATE ' . EXTENSIONS_TABLE . ' + SET group_id = ' . (int) $extensions[$row['extension_id']]['group_id'] . ' + WHERE extension_id = ' . $row['extension_id']; + $db->sql_query($sql); + + add_log('admin', 'LOG_ATTACH_EXT_UPDATE', $row['extension']); + } + } + $db->sql_freeresult($result); + + // Delete Extension? + $extension_id_list = request_var('extension_id_list', array(0)); + + if (sizeof($extension_id_list)) + { + $sql = 'SELECT extension + FROM ' . EXTENSIONS_TABLE . ' + WHERE ' . $db->sql_in_set('extension_id', $extension_id_list); + $result = $db->sql_query($sql); + + $extension_list = ''; + while ($row = $db->sql_fetchrow($result)) + { + $extension_list .= ($extension_list == '') ? $row['extension'] : ', ' . $row['extension']; + } + $db->sql_freeresult($result); + + $sql = 'DELETE + FROM ' . EXTENSIONS_TABLE . ' + WHERE ' . $db->sql_in_set('extension_id', $extension_id_list); + $db->sql_query($sql); + + add_log('admin', 'LOG_ATTACH_EXT_DEL', $extension_list); + } + } + + // Add Extension? + $add_extension = strtolower(request_var('add_extension', '')); + $add_extension_group = request_var('add_group_select', 0); + $add = (isset($_POST['add_extension_check'])) ? true : false; + + if ($add_extension && $add) + { + if (!sizeof($error)) + { + $sql = 'SELECT extension_id + FROM ' . EXTENSIONS_TABLE . " + WHERE extension = '" . $db->sql_escape($add_extension) . "'"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $error[] = sprintf($user->lang['EXTENSION_EXIST'], $add_extension); + } + $db->sql_freeresult($result); + + if (!sizeof($error)) + { + $sql_ary = array( + 'group_id' => $add_extension_group, + 'extension' => $add_extension + ); + + $db->sql_query('INSERT INTO ' . EXTENSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + add_log('admin', 'LOG_ATTACH_EXT_ADD', $add_extension); + } + } + } + + if (!sizeof($error)) + { + $notify[] = $user->lang['EXTENSIONS_UPDATED']; + } + + $cache->destroy('_extensions'); + } + + $template->assign_vars(array( + 'S_EXTENSIONS' => true, + 'ADD_EXTENSION' => (isset($add_extension)) ? $add_extension : '', + 'GROUP_SELECT_OPTIONS' => (isset($_POST['add_extension_check'])) ? $this->group_select('add_group_select', $add_extension_group, 'extension_group') : $this->group_select('add_group_select', false, 'extension_group')) + ); + + $sql = 'SELECT * + FROM ' . EXTENSIONS_TABLE . ' + ORDER BY group_id, extension'; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $old_group_id = $row['group_id']; + do + { + $s_spacer = false; + + $current_group_id = $row['group_id']; + if ($old_group_id != $current_group_id) + { + $s_spacer = true; + $old_group_id = $current_group_id; + } + + $template->assign_block_vars('extensions', array( + 'S_SPACER' => $s_spacer, + 'EXTENSION_ID' => $row['extension_id'], + 'EXTENSION' => $row['extension'], + 'GROUP_OPTIONS' => $this->group_select('group_select[]', $row['group_id'])) + ); + } + while ($row = $db->sql_fetchrow($result)); + } + $db->sql_freeresult($result); + + break; + + case 'ext_groups': + + $template->assign_var('S_EXTENSION_GROUPS', true); + + if ($submit) + { + $action = request_var('action', ''); + $group_id = request_var('g', 0); + + if ($action != 'add' && $action != 'edit') + { + trigger_error('NO_MODE', E_USER_ERROR); + } + + if (!$group_id && $action == 'edit') + { + trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if ($group_id) + { + $sql = 'SELECT * + FROM ' . EXTENSION_GROUPS_TABLE . " + WHERE group_id = $group_id"; + $result = $db->sql_query($sql); + $ext_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$ext_row) + { + trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + else + { + $ext_row = array(); + } + + $group_name = utf8_normalize_nfc(request_var('group_name', '', true)); + $new_group_name = ($action == 'add') ? $group_name : (($ext_row['group_name'] != $group_name) ? $group_name : ''); + + if (!$group_name) + { + $error[] = $user->lang['NO_EXT_GROUP_NAME']; + } + + // Check New Group Name + if ($new_group_name) + { + $sql = 'SELECT group_id + FROM ' . EXTENSION_GROUPS_TABLE . " + WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($new_group_name)) . "'"; + if ($group_id) + { + $sql .= ' AND group_id <> ' . $group_id; + } + $result = $db->sql_query($sql); + + if ($db->sql_fetchrow($result)) + { + $error[] = sprintf($user->lang['EXTENSION_GROUP_EXIST'], $new_group_name); + } + $db->sql_freeresult($result); + } + + 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)); + $allow_in_pm = (isset($_POST['allow_in_pm'])) ? true : false; + $max_filesize = request_var('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; + + if ($max_filesize == $config['max_filesize']) + { + $max_filesize = 0; + } + + if (!sizeof($allowed_forums)) + { + $forum_select = false; + } + + $group_ary = array( + 'group_name' => $group_name, + 'cat_id' => request_var('special_category', ATTACHMENT_CATEGORY_NONE), + 'allow_group' => ($allow_group) ? 1 : 0, + 'upload_icon' => ($upload_icon == 'no_image') ? '' : $upload_icon, + 'max_filesize' => $max_filesize, + 'allowed_forums'=> ($forum_select) ? serialize($allowed_forums) : '', + 'allow_in_pm' => ($allow_in_pm) ? 1 : 0, + ); + + if ($action == 'add') + { + $group_ary['download_mode'] = INLINE_LINK; + } + + $sql = ($action == 'add') ? 'INSERT INTO ' . EXTENSION_GROUPS_TABLE . ' ' : 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET '; + $sql .= $db->sql_build_array((($action == 'add') ? 'INSERT' : 'UPDATE'), $group_ary); + $sql .= ($action == 'edit') ? " WHERE group_id = $group_id" : ''; + + $db->sql_query($sql); + + if ($action == 'add') + { + $group_id = $db->sql_nextid(); + } + + $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); + } + + $extension_list = request_var('extensions', array(0)); + + if ($action == 'edit' && sizeof($extension_list)) + { + $sql = 'UPDATE ' . EXTENSIONS_TABLE . " + SET group_id = 0 + WHERE group_id = $group_id"; + $db->sql_query($sql); + } + + if (sizeof($extension_list)) + { + $sql = 'UPDATE ' . EXTENSIONS_TABLE . " + SET group_id = $group_id + WHERE " . $db->sql_in_set('extension_id', $extension_list); + $db->sql_query($sql); + } + + $cache->destroy('_extensions'); + + if (!sizeof($error)) + { + $notify[] = $user->lang['SUCCESS_EXTENSION_GROUP_' . strtoupper($action)]; + } + } + + $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); + $action = (isset($_POST['add'])) ? 'add' : $action; + + switch ($action) + { + case 'delete': + + if (confirm_box(true)) + { + $sql = 'SELECT group_name + FROM ' . EXTENSION_GROUPS_TABLE . " + WHERE group_id = $group_id"; + $result = $db->sql_query($sql); + $group_name = (string) $db->sql_fetchfield('group_name'); + $db->sql_freeresult($result); + + $sql = 'DELETE + FROM ' . EXTENSION_GROUPS_TABLE . " + WHERE group_id = $group_id"; + $db->sql_query($sql); + + // Set corresponding Extensions to a pending Group + $sql = 'UPDATE ' . EXTENSIONS_TABLE . " + SET group_id = 0 + WHERE group_id = $group_id"; + $db->sql_query($sql); + + add_log('admin', 'LOG_ATTACH_EXTGROUP_DEL', $group_name); + + $cache->destroy('_extensions'); + + trigger_error($user->lang['EXTENSION_GROUP_DELETED'] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'group_id' => $group_id, + 'action' => 'delete', + ))); + } + + break; + + case 'edit': + + if (!$group_id) + { + trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql = 'SELECT * + FROM ' . EXTENSION_GROUPS_TABLE . " + WHERE group_id = $group_id"; + $result = $db->sql_query($sql); + $ext_group_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $forum_ids = (!$ext_group_row['allowed_forums']) ? array() : unserialize(trim($ext_group_row['allowed_forums'])); + + // no break; + + case 'add': + + if ($action == 'add') + { + $ext_group_row = array( + 'group_name' => utf8_normalize_nfc(request_var('group_name', '', true)), + 'cat_id' => 0, + 'allow_group' => 1, + 'allow_in_pm' => 1, + 'upload_icon' => '', + 'max_filesize' => 0, + ); + + $forum_ids = array(); + } + + $extensions = array(); + + $sql = 'SELECT * + FROM ' . EXTENSIONS_TABLE . " + WHERE group_id = $group_id + OR group_id = 0 + ORDER BY extension"; + $result = $db->sql_query($sql); + $extensions = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + if ($ext_group_row['max_filesize'] == 0) + { + $ext_group_row['max_filesize'] = (int) $config['max_filesize']; + } + + $max_filesize = get_formatted_filesize($ext_group_row['max_filesize'], false, array('mb', 'kb', 'b')); + $size_format = $max_filesize['si_identifier']; + $ext_group_row['max_filesize'] = $max_filesize['value']; + + $img_path = $config['upload_icons_path']; + + $filename_list = ''; + $no_image_select = false; + + $imglist = filelist($phpbb_root_path . $img_path); + + if (!empty($imglist[''])) + { + $imglist = array_values($imglist); + $imglist = $imglist[0]; + + foreach ($imglist as $key => $img) + { + if (!$ext_group_row['upload_icon']) + { + $no_image_select = true; + $selected = ''; + } + else + { + $selected = ($ext_group_row['upload_icon'] == $img) ? ' selected="selected"' : ''; + } + + if (strlen($img) > 255) + { + continue; + } + + $filename_list .= ''; + } + } + + $i = 0; + $assigned_extensions = ''; + foreach ($extensions as $num => $row) + { + if ($row['group_id'] == $group_id && $group_id) + { + $assigned_extensions .= ($i) ? ', ' . $row['extension'] : $row['extension']; + $i++; + } + } + + $s_extension_options = ''; + foreach ($extensions as $row) + { + $s_extension_options .= '' . $row['extension'] . ''; + } + + $template->assign_vars(array( + 'IMG_PATH' => $img_path, + 'ACTION' => $action, + 'GROUP_ID' => $group_id, + 'GROUP_NAME' => $ext_group_row['group_name'], + 'ALLOW_GROUP' => $ext_group_row['allow_group'], + 'ALLOW_IN_PM' => $ext_group_row['allow_in_pm'], + 'UPLOAD_ICON_SRC' => $phpbb_root_path . $img_path . '/' . $ext_group_row['upload_icon'], + 'EXTGROUP_FILESIZE' => $ext_group_row['max_filesize'], + 'ASSIGNED_EXTENSIONS' => $assigned_extensions, + + 'S_CATEGORY_SELECT' => $this->category_select('special_category', $group_id, 'category'), + 'S_EXT_GROUP_SIZE_OPTIONS' => size_select_options($size_format), + 'S_EXTENSION_OPTIONS' => $s_extension_options, + 'S_FILENAME_LIST' => $filename_list, + 'S_EDIT_GROUP' => true, + 'S_NO_IMAGE' => $no_image_select, + 'S_FORUM_IDS' => (sizeof($forum_ids)) ? true : false, + + 'U_EXTENSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=extensions"), + 'U_BACK' => $this->u_action, + + 'L_LEGEND' => $user->lang[strtoupper($action) . '_EXTENSION_GROUP']) + ); + + $s_forum_id_options = ''; + + /** @todo use in-built function **/ + + $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id + FROM ' . FORUMS_TABLE . ' + ORDER BY left_id ASC'; + $result = $db->sql_query($sql, 600); + + $right = $cat_right = $padding_inc = 0; + $padding = $forum_list = $holding = ''; + $padding_store = array('0' => ''); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id'])) + { + // Non-postable forum with no subforums, don't display + continue; + } + + if (!$auth->acl_get('f_list', $row['forum_id'])) + { + // if the user does not have permissions to list this forum skip + continue; + } + + if ($row['left_id'] < $right) + { + $padding .= '   '; + $padding_store[$row['parent_id']] = $padding; + } + else if ($row['left_id'] > $right + 1) + { + $padding = empty($padding_store[$row['parent_id']]) ? '' : $padding_store[$row['parent_id']]; + } + + $right = $row['right_id']; + + $selected = (in_array($row['forum_id'], $forum_ids)) ? ' selected="selected"' : ''; + + if ($row['left_id'] > $cat_right) + { + // make sure we don't forget anything + $s_forum_id_options .= $holding; + $holding = ''; + } + + if ($row['right_id'] - $row['left_id'] > 1) + { + $cat_right = max($cat_right, $row['right_id']); + + $holding .= ''; + } + else + { + $s_forum_id_options .= $holding . ''; + $holding = ''; + } + } + + if ($holding) + { + $s_forum_id_options .= $holding; + } + + $db->sql_freeresult($result); + unset($padding_store); + + $template->assign_vars(array( + 'S_FORUM_ID_OPTIONS' => $s_forum_id_options) + ); + + break; + } + + $sql = 'SELECT * + FROM ' . EXTENSION_GROUPS_TABLE . ' + ORDER BY allow_group DESC, allow_in_pm DESC, group_name'; + $result = $db->sql_query($sql); + + $old_allow_group = $old_allow_pm = 1; + while ($row = $db->sql_fetchrow($result)) + { + $s_add_spacer = ($old_allow_group != $row['allow_group'] || $old_allow_pm != $row['allow_in_pm']) ? true : false; + + $template->assign_block_vars('groups', array( + 'S_ADD_SPACER' => $s_add_spacer, + 'S_ALLOWED_IN_PM' => ($row['allow_in_pm']) ? true : false, + 'S_GROUP_ALLOWED' => ($row['allow_group']) ? true : false, + + 'U_EDIT' => $this->u_action . "&action=edit&g={$row['group_id']}", + 'U_DELETE' => $this->u_action . "&action=delete&g={$row['group_id']}", + + 'GROUP_NAME' => (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : $row['group_name'], + 'CATEGORY' => $cat_lang[$row['cat_id']], + ) + ); + + $old_allow_group = $row['allow_group']; + $old_allow_pm = $row['allow_in_pm']; + } + $db->sql_freeresult($result); + + break; + + case 'orphan': + + 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)); + + if (sizeof($delete_files)) + { + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', $delete_files) . ' + AND is_orphan = 1'; + $result = $db->sql_query($sql); + + $delete_files = array(); + while ($row = $db->sql_fetchrow($result)) + { + phpbb_unlink($row['physical_filename'], 'file'); + + if ($row['thumbnail']) + { + phpbb_unlink($row['physical_filename'], 'thumbnail'); + } + + $delete_files[$row['attach_id']] = $row['real_filename']; + } + $db->sql_freeresult($result); + } + + if (sizeof($delete_files)) + { + $sql = 'DELETE FROM ' . ATTACHMENTS_TABLE . ' + 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)); + $notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode($user->lang['COMMA_SEPARATOR'], $delete_files)); + } + + $upload_list = array(); + foreach ($add_files as $attach_id) + { + if (!isset($delete_files[$attach_id]) && !empty($post_ids[$attach_id])) + { + $upload_list[$attach_id] = $post_ids[$attach_id]; + } + } + unset($add_files); + + if (sizeof($upload_list)) + { + $template->assign_var('S_UPLOADING_FILES', true); + + $sql = 'SELECT forum_id, forum_name + FROM ' . FORUMS_TABLE; + $result = $db->sql_query($sql); + + $forum_names = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_names[$row['forum_id']] = $row['forum_name']; + } + $db->sql_freeresult($result); + + $sql = 'SELECT forum_id, topic_id, post_id, poster_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_id', $upload_list); + $result = $db->sql_query($sql); + + $post_info = array(); + while ($row = $db->sql_fetchrow($result)) + { + $post_info[$row['post_id']] = $row; + } + $db->sql_freeresult($result); + + // Select those attachments we want to change... + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', array_keys($upload_list)) . ' + AND is_orphan = 1'; + $result = $db->sql_query($sql); + + $files_added = $space_taken = 0; + while ($row = $db->sql_fetchrow($result)) + { + $post_row = $post_info[$upload_list[$row['attach_id']]]; + + $template->assign_block_vars('upload', array( + 'FILE_INFO' => sprintf($user->lang['UPLOADING_FILE_TO'], $row['real_filename'], $post_row['post_id']), + 'S_DENIED' => (!$auth->acl_get('f_attach', $post_row['forum_id'])) ? true : false, + 'L_DENIED' => (!$auth->acl_get('f_attach', $post_row['forum_id'])) ? sprintf($user->lang['UPLOAD_DENIED_FORUM'], $forum_names[$row['forum_id']]) : '') + ); + + if (!$auth->acl_get('f_attach', $post_row['forum_id'])) + { + continue; + } + + // Adjust attachment entry + $sql_ary = array( + 'in_message' => 0, + 'is_orphan' => 0, + 'poster_id' => $post_row['poster_id'], + 'post_msg_id' => $post_row['post_id'], + 'topic_id' => $post_row['topic_id'], + ); + + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE attach_id = ' . $row['attach_id']; + $db->sql_query($sql); + + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET post_attachment = 1 + WHERE post_id = ' . $post_row['post_id']; + $db->sql_query($sql); + + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_attachment = 1 + WHERE topic_id = ' . $post_row['topic_id']; + $db->sql_query($sql); + + $space_taken += $row['filesize']; + $files_added++; + + add_log('admin', 'LOG_ATTACH_FILEUPLOAD', $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); + } + } + } + + $template->assign_vars(array( + 'S_ORPHAN' => true) + ); + + // Just get the files with is_orphan set and older than 3 hours + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE is_orphan = 1 + AND filetime < ' . (time() - 3*60*60) . ' + ORDER BY filetime DESC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('orphan', array( + 'FILESIZE' => get_formatted_filesize($row['filesize']), + 'FILETIME' => $user->format_date($row['filetime']), + 'REAL_FILENAME' => utf8_basename($row['real_filename']), + 'PHYSICAL_FILENAME' => utf8_basename($row['physical_filename']), + 'ATTACH_ID' => $row['attach_id'], + 'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '', + 'U_FILE' => append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'mode=view&id=' . $row['attach_id'])) + ); + } + $db->sql_freeresult($result); + + break; + + case 'manage': + + if ($submit) + { + $delete_files = (isset($_POST['delete'])) ? array_keys(request_var('delete', array('' => 0))) : array(); + + if (sizeof($delete_files)) + { + // Select those attachments we want to delete... + $sql = 'SELECT real_filename + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', $delete_files) . ' + AND is_orphan = 0'; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $deleted_filenames[] = $row['real_filename']; + } + $db->sql_freeresult($result); + + if ($num_deleted = delete_attachments('attach', $delete_files)) + { + if (sizeof($delete_files) != $num_deleted) + { + $error[] = $user->lang['FILES_GONE']; + } + add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode(', ', $deleted_filenames)); + $notify[] = sprintf($user->lang['LOG_ATTACHMENTS_DELETED'], implode($user->lang['COMMA_SEPARATOR'], $deleted_filenames)); + } + else + { + $error[] = $user->lang['NO_FILES_TO_DELETE']; + } + } + } + + if ($action == 'stats') + { + $this->handle_stats_resync(); + } + + $stats_error = $this->check_stats_accuracy(); + + if ($stats_error) + { + $error[] = $stats_error; + } + + $template->assign_vars(array( + 'S_MANAGE' => true, + )); + + $start = request_var('start', 0); + + // Sort keys + $sort_days = request_var('st', 0); + $sort_key = request_var('sk', 't'); + $sort_dir = request_var('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']); + $sort_by_text = array('f' => $user->lang['FILENAME'], 't' => $user->lang['FILEDATE'], 's' => $user->lang['FILESIZE'], 'x' => $user->lang['EXTENSION'], 'd' => $user->lang['DOWNLOADS'],'p' => $user->lang['ATTACH_POST_TYPE'], 'u' => $user->lang['AUTHOR']); + $sort_by_sql = array('f' => 'a.real_filename', 't' => 'a.filetime', 's' => 'a.filesize', 'x' => 'a.extension', 'd' => 'a.download_count', 'p' => 'a.in_message', 'u' => 'u.username'); + + $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); + + $min_filetime = ($sort_days) ? (time() - ($sort_days * 86400)) : ''; + $limit_filetime = ($min_filetime) ? " AND a.filetime >= $min_filetime " : ''; + $start = ($sort_days && isset($_POST['sort'])) ? 0 : $start; + + $attachments_per_page = (int) $config['topics_per_page']; + + $stats = $this->get_attachment_stats($limit_filetime); + $num_files = $stats['num_files']; + $total_size = $stats['upload_dir_size']; + + // Make sure $start is set to the last page if it exceeds the amount + $pagination = $phpbb_container->get('pagination'); + $start = $pagination->validate_start($start, $attachments_per_page, $num_files); + + // If the user is trying to reach the second half of the attachments list, fetch it starting from the end + $store_reverse = false; + $sql_limit = $attachments_per_page; + + if ($start > $num_files / 2) + { + $store_reverse = true; + + // Select the sort order. Add time sort anchor for non-time sorting cases + $sql_sort_anchor = ($sort_key != 't') ? ', a.filetime ' . (($sort_dir == 'd') ? 'ASC' : 'DESC') : ''; + $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'ASC' : 'DESC') . $sql_sort_anchor; + $sql_limit = $pagination->reverse_limit($start, $sql_limit, $num_files); + $sql_start = $pagination->reverse_start($start, $sql_limit, $num_files); + } + else + { + // Select the sort order. Add time sort anchor for non-time sorting cases + $sql_sort_anchor = ($sort_key != 't') ? ', a.filetime ' . (($sort_dir == 'd') ? 'DESC' : 'ASC') : ''; + $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC') . $sql_sort_anchor; + $sql_start = $start; + } + + $attachments_list = array(); + + // Just get the files + $sql = 'SELECT a.*, u.username, u.user_colour, t.topic_title + FROM ' . ATTACHMENTS_TABLE . ' a + LEFT JOIN ' . USERS_TABLE . ' u ON (u.user_id = a.poster_id) + LEFT JOIN ' . TOPICS_TABLE . " t ON (a.topic_id = t.topic_id) + WHERE a.is_orphan = 0 + $limit_filetime + ORDER BY $sql_sort_order"; + $result = $db->sql_query_limit($sql, $sql_limit, $sql_start); + + $i = ($store_reverse) ? $sql_limit - 1 : 0; + + // Store increment value in a variable to save some conditional calls + $i_increment = ($store_reverse) ? -1 : 1; + while ($attachment_row = $db->sql_fetchrow($result)) + { + $attachments_list[$i] = $attachment_row; + $i = $i + $i_increment; + } + $db->sql_freeresult($result); + + $base_url = $this->u_action . "&$u_sort_param"; + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $num_files, $attachments_per_page, $start); + + $template->assign_vars(array( + 'TOTAL_FILES' => $num_files, + 'TOTAL_SIZE' => get_formatted_filesize($total_size), + + 'S_LIMIT_DAYS' => $s_limit_days, + 'S_SORT_KEY' => $s_sort_key, + 'S_SORT_DIR' => $s_sort_dir) + ); + + // Grab extensions + $extensions = $cache->obtain_attach_extensions(true); + + for ($i = 0, $end = sizeof($attachments_list); $i < $end; ++$i) + { + $row = $attachments_list[$i]; + + $row['extension'] = strtolower(trim((string) $row['extension'])); + $comment = ($row['attach_comment'] && !$row['in_message']) ? str_replace(array("\n", "\r"), array('
', "\n"), $row['attach_comment']) : ''; + $display_cat = $extensions[$row['extension']]['display_cat']; + $l_downloaded_viewed = ($display_cat == ATTACHMENT_CATEGORY_NONE) ? 'DOWNLOAD_COUNTS' : 'VIEWED_COUNTS'; + + $template->assign_block_vars('attachments', array( + 'ATTACHMENT_POSTER' => get_username_string('full', (int) $row['poster_id'], (string) $row['username'], (string) $row['user_colour'], (string) $row['username']), + 'FILESIZE' => get_formatted_filesize((int) $row['filesize']), + 'FILETIME' => $user->format_date((int) $row['filetime']), + 'REAL_FILENAME' => (!$row['in_message']) ? utf8_basename((string) $row['real_filename']) : '', + 'PHYSICAL_FILENAME' => utf8_basename((string) $row['physical_filename']), + 'EXT_GROUP_NAME' => (!empty($extensions[$row['extension']]['group_name'])) ? $user->lang['EXT_GROUP_' . $extensions[$row['extension']]['group_name']] : '', + 'COMMENT' => $comment, + 'TOPIC_TITLE' => (!$row['in_message']) ? (string) $row['topic_title'] : '', + 'ATTACH_ID' => (int) $row['attach_id'], + 'POST_ID' => (int) $row['post_msg_id'], + 'TOPIC_ID' => (int) $row['topic_id'], + 'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? (int) $post_ids[$row['attach_id']] : '', + + 'L_DOWNLOAD_COUNT' => $user->lang($l_downloaded_viewed, (int) $row['download_count']), + + 'S_IN_MESSAGE' => (bool) $row['in_message'], + + 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&p={$row['post_msg_id']}") . "#p{$row['post_msg_id']}", + 'U_FILE' => append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'mode=view&id=' . $row['attach_id'])) + ); + } + + break; + } + + if (sizeof($error)) + { + $template->assign_vars(array( + 'S_WARNING' => true, + 'WARNING_MSG' => implode('
', $error)) + ); + } + + if (sizeof($notify)) + { + $template->assign_vars(array( + 'S_NOTIFY' => true, + 'NOTIFY_MSG' => implode('
', $notify)) + ); + } + } + + /** + * Get attachment file count and size of upload directory + * + * @param $limit string Additional limit for WHERE clause to filter stats by. + * @return array Returns array with stats: num_files and upload_dir_size + */ + public function get_attachment_stats($limit = '') + { + $sql = 'SELECT COUNT(a.attach_id) AS num_files, SUM(a.filesize) AS upload_dir_size + FROM ' . ATTACHMENTS_TABLE . " a + WHERE a.is_orphan = 0 + $limit"; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + return array( + 'num_files' => (int) $row['num_files'], + 'upload_dir_size' => (float) $row['upload_dir_size'], + ); + } + + /** + * Set config attachment stat values + * + * @param $stats array Array of config key => value pairs to set. + * @return null + */ + public function set_attachment_stats($stats) + { + foreach ($stats as $key => $value) + { + $this->config->set($key, $value, true); + } + } + + /** + * Check accuracy of attachment statistics. + * + * @return bool|string Returns false if stats are correct or error message + * otherwise. + */ + public function check_stats_accuracy() + { + // Get fresh stats. + $stats = $this->get_attachment_stats(); + + // Get current files stats + $num_files = (int) $this->config['num_files']; + $total_size = (float) $this->config['upload_dir_size']; + + if (($num_files != $stats['num_files']) || ($total_size != $stats['upload_dir_size'])) + { + $u_resync = $this->u_action . '&action=stats'; + + return $this->user->lang( + 'FILES_STATS_WRONG', + (int) $stats['num_files'], + get_formatted_filesize($stats['upload_dir_size']), + '', + '' + ); + } + return false; + } + + /** + * Handle stats resync. + * + * @return null + */ + public function handle_stats_resync() + { + if (!confirm_box(true)) + { + confirm_box(false, $this->user->lang['RESYNC_FILES_STATS_CONFIRM'], build_hidden_fields(array( + 'i' => $this->id, + 'mode' => 'manage', + 'action' => 'stats', + ))); + } + else + { + $this->set_attachment_stats($this->get_attachment_stats()); + $log = $this->phpbb_container->get('log'); + $log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_RESYNC_FILES_STATS'); + } + + } + + /** + * Build Select for category items + */ + function category_select($select_name, $group_id = false, $key = '') + { + global $db, $user; + + $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) + { + $sql = 'SELECT cat_id + FROM ' . EXTENSION_GROUPS_TABLE . ' + WHERE group_id = ' . (int) $group_id; + $result = $db->sql_query($sql); + + $cat_type = (!($row = $db->sql_fetchrow($result))) ? ATTACHMENT_CATEGORY_NONE : $row['cat_id']; + + $db->sql_freeresult($result); + } + else + { + $cat_type = ATTACHMENT_CATEGORY_NONE; + } + + $group_select = ''; + + return $group_select; + } + + /** + * Extension group select + */ + function group_select($select_name, $default_group = false, $key = '') + { + global $db, $user; + + $group_select = ''; + + return $group_select; + } + + /** + * Search Imagick + */ + function search_imagemagick() + { + $imagick = ''; + + $exe = ((defined('PHP_OS')) && (preg_match('#^win#i', PHP_OS))) ? '.exe' : ''; + + $magic_home = getenv('MAGICK_HOME'); + + 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) !== '/') + { + $location .= '/'; + } + + if (@file_exists($location) && @is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000) + { + $imagick = str_replace('\\', '/', $location); + continue; + } + } + } + else + { + $imagick = str_replace('\\', '/', $magic_home); + } + + return $imagick; + } + + /** + * Test Settings + */ + function test_upload(&$error, $upload_dir, $create_directory = false) + { + global $user, $phpbb_root_path; + + // Does the target directory exist, is it a directory and writable. + if ($create_directory) + { + 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); + } + } + + if (!file_exists($phpbb_root_path . $upload_dir)) + { + $error[] = sprintf($user->lang['NO_UPLOAD_DIR'], $upload_dir); + return; + } + + if (!is_dir($phpbb_root_path . $upload_dir)) + { + $error[] = sprintf($user->lang['UPLOAD_NOT_DIR'], $upload_dir); + return; + } + + if (!phpbb_is_writable($phpbb_root_path . $upload_dir)) + { + $error[] = sprintf($user->lang['NO_WRITE_UPLOAD'], $upload_dir); + return; + } + } + + /** + * Perform operations on sites for external linking + */ + function perform_site_list() + { + global $db, $user; + global $request; + + if (isset($_REQUEST['securesubmit'])) + { + // Grab the list of entries + $ips = request_var('ips', ''); + $ip_list = array_unique(explode("\n", $ips)); + $ip_list_log = implode(', ', $ip_list); + + $ip_exclude = (int) $request->variable('ipexclude', false, false, \phpbb\request\request_interface::POST); + + $iplist = array(); + $hostlist = array(); + + foreach ($ip_list as $item) + { + if (preg_match('#^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})[ ]*\-[ ]*([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$#', trim($item), $ip_range_explode)) + { + // Don't ask about all this, just don't ask ... ! + $ip_1_counter = $ip_range_explode[1]; + $ip_1_end = $ip_range_explode[5]; + + while ($ip_1_counter <= $ip_1_end) + { + $ip_2_counter = ($ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[2] : 0; + $ip_2_end = ($ip_1_counter < $ip_1_end) ? 254 : $ip_range_explode[6]; + + if ($ip_2_counter == 0 && $ip_2_end == 254) + { + $ip_2_counter = 256; + $ip_2_fragment = 256; + + $iplist[] = "'$ip_1_counter.*'"; + } + + while ($ip_2_counter <= $ip_2_end) + { + $ip_3_counter = ($ip_2_counter == $ip_range_explode[2] && $ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[3] : 0; + $ip_3_end = ($ip_2_counter < $ip_2_end || $ip_1_counter < $ip_1_end) ? 254 : $ip_range_explode[7]; + + if ($ip_3_counter == 0 && $ip_3_end == 254) + { + $ip_3_counter = 256; + $ip_3_fragment = 256; + + $iplist[] = "'$ip_1_counter.$ip_2_counter.*'"; + } + + while ($ip_3_counter <= $ip_3_end) + { + $ip_4_counter = ($ip_3_counter == $ip_range_explode[3] && $ip_2_counter == $ip_range_explode[2] && $ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[4] : 0; + $ip_4_end = ($ip_3_counter < $ip_3_end || $ip_2_counter < $ip_2_end) ? 254 : $ip_range_explode[8]; + + if ($ip_4_counter == 0 && $ip_4_end == 254) + { + $ip_4_counter = 256; + $ip_4_fragment = 256; + + $iplist[] = "'$ip_1_counter.$ip_2_counter.$ip_3_counter.*'"; + } + + while ($ip_4_counter <= $ip_4_end) + { + $iplist[] = "'$ip_1_counter.$ip_2_counter.$ip_3_counter.$ip_4_counter'"; + $ip_4_counter++; + } + $ip_3_counter++; + } + $ip_2_counter++; + } + $ip_1_counter++; + } + } + else if (preg_match('#^([0-9]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})$#', trim($item)) || preg_match('#^[a-f0-9:]+\*?$#i', trim($item))) + { + $iplist[] = "'" . trim($item) . "'"; + } + else if (preg_match('#^([\w\-_]\.?){2,}$#is', trim($item))) + { + $hostlist[] = "'" . trim($item) . "'"; + } + else if (preg_match("#^([a-z0-9\-\*\._/]+?)$#is", trim($item))) + { + $hostlist[] = "'" . trim($item) . "'"; + } + } + + $sql = 'SELECT site_ip, site_hostname + FROM ' . SITELIST_TABLE . " + WHERE ip_exclude = $ip_exclude"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $iplist_tmp = array(); + $hostlist_tmp = array(); + do + { + if ($row['site_ip']) + { + if (strlen($row['site_ip']) > 40) + { + continue; + } + + $iplist_tmp[] = "'" . $row['site_ip'] . "'"; + } + else if ($row['site_hostname']) + { + if (strlen($row['site_hostname']) > 255) + { + continue; + } + + $hostlist_tmp[] = "'" . $row['site_hostname'] . "'"; + } + // break; + } + while ($row = $db->sql_fetchrow($result)); + + $iplist = array_unique(array_diff($iplist, $iplist_tmp)); + $hostlist = array_unique(array_diff($hostlist, $hostlist_tmp)); + unset($iplist_tmp); + unset($hostlist_tmp); + } + $db->sql_freeresult($result); + + if (sizeof($iplist)) + { + foreach ($iplist as $ip_entry) + { + $sql = 'INSERT INTO ' . SITELIST_TABLE . " (site_ip, ip_exclude) + VALUES ($ip_entry, $ip_exclude)"; + $db->sql_query($sql); + } + } + + if (sizeof($hostlist)) + { + foreach ($hostlist as $host_entry) + { + $sql = 'INSERT INTO ' . SITELIST_TABLE . " (site_hostname, ip_exclude) + VALUES ($host_entry, $ip_exclude)"; + $db->sql_query($sql); + } + } + + if (!empty($ip_list_log)) + { + // Update log + $log_entry = ($ip_exclude) ? 'LOG_DOWNLOAD_EXCLUDE_IP' : 'LOG_DOWNLOAD_IP'; + add_log('admin', $log_entry, $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)); + + if (sizeof($unip_sql)) + { + $l_unip_list = ''; + + // Grab details of ips for logging information later + $sql = 'SELECT site_ip, site_hostname + FROM ' . SITELIST_TABLE . ' + WHERE ' . $db->sql_in_set('site_id', $unip_sql); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $l_unip_list .= (($l_unip_list != '') ? ', ' : '') . (($row['site_ip']) ? $row['site_ip'] : $row['site_hostname']); + } + $db->sql_freeresult($result); + + $sql = 'DELETE FROM ' . SITELIST_TABLE . ' + WHERE ' . $db->sql_in_set('site_id', $unip_sql); + $db->sql_query($sql); + + add_log('admin', 'LOG_DOWNLOAD_REMOVE_IP', $l_unip_list); + } + + trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS'] . adm_back_link($this->u_action)); + } + } + + /** + * Write display_order config field + */ + function display_order($value, $key = '') + { + $radio_ary = array(0 => 'DESCENDING', 1 => 'ASCENDING'); + + return h_radio('config[display_order]', $radio_ary, $value, $key); + } + + /** + * Adjust all three max_filesize config vars for display + */ + function max_filesize($value, $key = '') + { + // Determine size var and adjust the value accordingly + $filesize = get_formatted_filesize($value, false, array('mb', 'kb', 'b')); + $size_var = $filesize['si_identifier']; + $value = $filesize['value']; + + // size="8" and maxlength="15" attributes as a fallback for browsers that do not support type="number" yet. + return ' '; + } + + /** + * Write secure_allow_deny config field + */ + function select_allow_deny($value, $key = '') + { + $radio_ary = array(1 => 'ORDER_ALLOW_DENY', 0 => 'ORDER_DENY_ALLOW'); + + return h_radio('config[' . $key . ']', $radio_ary, $value, $key); + } + +} diff --git a/sources/phpBB/includes/acp/acp_ban.php b/sources/phpBB/includes/acp/acp_ban.php new file mode 100644 index 0000000..b555f46 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_ban.php @@ -0,0 +1,298 @@ + +* @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; +} + +class acp_ban +{ + var $u_action; + + function main($id, $mode) + { + global $user, $template, $request, $phpbb_dispatcher; + global $phpbb_root_path, $phpEx; + + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + $bansubmit = $request->is_set_post('bansubmit'); + $unbansubmit = $request->is_set_post('unbansubmit'); + + $user->add_lang(array('acp/ban', 'acp/users')); + $this->tpl_name = 'acp_ban'; + $form_key = 'acp_ban'; + add_form_key($form_key); + + if (($bansubmit || $unbansubmit) && !check_form_key($form_key)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Ban submitted? + if ($bansubmit) + { + // Grab the list of entries + $ban = $request->variable('ban', '', true); + $ban_length = $request->variable('banlength', 0); + $ban_length_other = $request->variable('banlengthother', ''); + $ban_exclude = $request->variable('banexclude', 0); + $ban_reason = $request->variable('banreason', '', true); + $ban_give_reason = $request->variable('bangivereason', '', true); + + if ($ban) + { + $abort_ban = false; + /** + * Use this event to modify the ban details before the ban is performed + * + * @event core.acp_ban_before + * @var string mode One of the following: user, ip, email + * @var string ban Either string or array with usernames, ips or email addresses + * @var int ban_length Ban length in minutes + * @var string ban_length_other Ban length as a date (YYYY-MM-DD) + * @var bool ban_exclude Are we banning or excluding from another ban + * @var string ban_reason Ban reason displayed to moderators + * @var string ban_give_reason Ban reason displayed to the banned user + * @var mixed abort_ban Either false, or an error message that is displayed to the user. + * If a string is given the bans are not issued. + * @since 3.1.0-RC5 + */ + $vars = array( + 'mode', + 'ban', + 'ban_length', + 'ban_length_other', + 'ban_exclude', + 'ban_reason', + 'ban_give_reason', + 'abort_ban', + ); + extract($phpbb_dispatcher->trigger_event('core.acp_ban_before', compact($vars))); + + if ($abort_ban) + { + trigger_error($abort_ban . adm_back_link($this->u_action)); + } + user_ban($mode, $ban, $ban_length, $ban_length_other, $ban_exclude, $ban_reason, $ban_give_reason); + + /** + * Use this event to perform actions after the ban has been performed + * + * @event core.acp_ban_after + * @var string mode One of the following: user, ip, email + * @var string ban Either string or array with usernames, ips or email addresses + * @var int ban_length Ban length in minutes + * @var string ban_length_other Ban length as a date (YYYY-MM-DD) + * @var bool ban_exclude Are we banning or excluding from another ban + * @var string ban_reason Ban reason displayed to moderators + * @var string ban_give_reason Ban reason displayed to the banned user + * @since 3.1.0-RC5 + */ + $vars = array( + 'mode', + 'ban', + 'ban_length', + 'ban_length_other', + 'ban_exclude', + 'ban_reason', + 'ban_give_reason', + ); + extract($phpbb_dispatcher->trigger_event('core.acp_ban_after', compact($vars))); + + trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . adm_back_link($this->u_action)); + } + } + else if ($unbansubmit) + { + $ban = $request->variable('unban', array('')); + + if ($ban) + { + user_unban($mode, $ban); + + trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . adm_back_link($this->u_action)); + } + } + + // Define language vars + $this->page_title = $user->lang[strtoupper($mode) . '_BAN']; + + $l_ban_explain = $user->lang[strtoupper($mode) . '_BAN_EXPLAIN']; + $l_ban_exclude_explain = $user->lang[strtoupper($mode) . '_BAN_EXCLUDE_EXPLAIN']; + $l_unban_title = $user->lang[strtoupper($mode) . '_UNBAN']; + $l_unban_explain = $user->lang[strtoupper($mode) . '_UNBAN_EXPLAIN']; + $l_no_ban_cell = $user->lang[strtoupper($mode) . '_NO_BANNED']; + + switch ($mode) + { + case 'user': + $l_ban_cell = $user->lang['USERNAME']; + break; + + case 'ip': + $l_ban_cell = $user->lang['IP_HOSTNAME']; + break; + + case 'email': + $l_ban_cell = $user->lang['EMAIL_ADDRESS']; + break; + } + + self::display_ban_options($mode); + + $template->assign_vars(array( + 'L_TITLE' => $this->page_title, + 'L_EXPLAIN' => $l_ban_explain, + 'L_UNBAN_TITLE' => $l_unban_title, + 'L_UNBAN_EXPLAIN' => $l_unban_explain, + 'L_BAN_CELL' => $l_ban_cell, + 'L_BAN_EXCLUDE_EXPLAIN' => $l_ban_exclude_explain, + 'L_NO_BAN_CELL' => $l_no_ban_cell, + + 'S_USERNAME_BAN' => ($mode == 'user') ? true : false, + + 'U_ACTION' => $this->u_action, + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_ban&field=ban'), + )); + } + + /** + * Display ban options + */ + static public function display_ban_options($mode) + { + global $user, $db, $template; + + // Ban length options + $ban_end_text = array(0 => $user->lang['PERMANENT'], 30 => $user->lang['30_MINS'], 60 => $user->lang['1_HOUR'], 360 => $user->lang['6_HOURS'], 1440 => $user->lang['1_DAY'], 10080 => $user->lang['7_DAYS'], 20160 => $user->lang['2_WEEKS'], 40320 => $user->lang['1_MONTH'], -1 => $user->lang['UNTIL'] . ' -> '); + + $ban_end_options = ''; + foreach ($ban_end_text as $length => $text) + { + $ban_end_options .= ''; + } + + switch ($mode) + { + case 'user': + + $field = 'username'; + $l_ban_cell = $user->lang['USERNAME']; + + $sql = 'SELECT b.*, u.user_id, u.username, u.username_clean + FROM ' . BANLIST_TABLE . ' b, ' . USERS_TABLE . ' u + WHERE (b.ban_end >= ' . time() . ' + OR b.ban_end = 0) + AND u.user_id = b.ban_userid + ORDER BY u.username_clean ASC'; + break; + + case 'ip': + + $field = 'ban_ip'; + $l_ban_cell = $user->lang['IP_HOSTNAME']; + + $sql = 'SELECT * + FROM ' . BANLIST_TABLE . ' + WHERE (ban_end >= ' . time() . " + OR ban_end = 0) + AND ban_ip <> '' + ORDER BY ban_ip"; + break; + + case 'email': + + $field = 'ban_email'; + $l_ban_cell = $user->lang['EMAIL_ADDRESS']; + + $sql = 'SELECT * + FROM ' . BANLIST_TABLE . ' + WHERE (ban_end >= ' . time() . " + OR ban_end = 0) + AND ban_email <> '' + ORDER BY ban_email"; + break; + } + $result = $db->sql_query($sql); + + $banned_options = $excluded_options = array(); + while ($row = $db->sql_fetchrow($result)) + { + $option = ''; + + if ($row['ban_exclude']) + { + $excluded_options[] = $option; + } + else + { + $banned_options[] = $option; + } + + $time_length = ($row['ban_end']) ? ($row['ban_end'] - $row['ban_start']) / 60 : 0; + + if ($time_length == 0) + { + // Banned permanently + $ban_length = $user->lang['PERMANENT']; + } + else if (isset($ban_end_text[$time_length])) + { + // Banned for a given duration + $ban_length = $user->lang('BANNED_UNTIL_DURATION', $ban_end_text[$time_length], $user->format_date($row['ban_end'], false, true)); + } + else + { + // Banned until given date + $ban_length = $user->lang('BANNED_UNTIL_DATE', $user->format_date($row['ban_end'], false, true)); + } + + $template->assign_block_vars('bans', array( + 'BAN_ID' => (int) $row['ban_id'], + 'LENGTH' => $ban_length, + 'A_LENGTH' => addslashes($ban_length), + 'REASON' => $row['ban_reason'], + 'A_REASON' => addslashes($row['ban_reason']), + 'GIVE_REASON' => $row['ban_give_reason'], + 'A_GIVE_REASON' => addslashes($row['ban_give_reason']), + )); + } + $db->sql_freeresult($result); + + $options = ''; + if ($excluded_options) + { + $options .= ''; + $options .= implode('', $excluded_options); + $options .= ''; + } + + if ($banned_options) + { + $options .= ''; + $options .= implode('', $banned_options); + $options .= ''; + } + + $template->assign_vars(array( + 'S_BAN_END_OPTIONS' => $ban_end_options, + 'S_BANNED_OPTIONS' => ($banned_options || $excluded_options) ? true : false, + 'BANNED_OPTIONS' => $options, + )); + } +} diff --git a/sources/phpBB/includes/acp/acp_bbcodes.php b/sources/phpBB/includes/acp/acp_bbcodes.php new file mode 100644 index 0000000..e245eea --- /dev/null +++ b/sources/phpBB/includes/acp/acp_bbcodes.php @@ -0,0 +1,569 @@ + +* @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; +} + +class acp_bbcodes +{ + var $u_action; + + function main($id, $mode) + { + global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $user->add_lang('acp/posting'); + + // Set up general vars + $action = request_var('action', ''); + $bbcode_id = request_var('bbcode', 0); + + $this->tpl_name = 'acp_bbcodes'; + $this->page_title = 'ACP_BBCODES'; + $form_key = 'acp_bbcodes'; + + add_form_key($form_key); + + // Set up mode-specific vars + switch ($action) + { + case 'add': + $bbcode_match = $bbcode_tpl = $bbcode_helpline = ''; + $display_on_posting = 0; + break; + + case 'edit': + $sql = 'SELECT bbcode_match, bbcode_tpl, display_on_posting, bbcode_helpline + FROM ' . BBCODES_TABLE . ' + WHERE bbcode_id = ' . $bbcode_id; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + trigger_error($user->lang['BBCODE_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $bbcode_match = $row['bbcode_match']; + $bbcode_tpl = htmlspecialchars($row['bbcode_tpl']); + $display_on_posting = $row['display_on_posting']; + $bbcode_helpline = $row['bbcode_helpline']; + break; + + case 'modify': + $sql = 'SELECT bbcode_id, bbcode_tag + FROM ' . BBCODES_TABLE . ' + WHERE bbcode_id = ' . $bbcode_id; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + trigger_error($user->lang['BBCODE_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // No break here + + case 'create': + $display_on_posting = request_var('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)); + break; + } + + // Do major work + switch ($action) + { + case 'edit': + case 'add': + + $tpl_ary = array( + 'S_EDIT_BBCODE' => true, + 'U_BACK' => $this->u_action, + 'U_ACTION' => $this->u_action . '&action=' . (($action == 'add') ? 'create' : 'modify') . (($bbcode_id) ? "&bbcode=$bbcode_id" : ''), + + 'L_BBCODE_USAGE_EXPLAIN'=> sprintf($user->lang['BBCODE_USAGE_EXPLAIN'], '', ''), + 'BBCODE_MATCH' => $bbcode_match, + 'BBCODE_TPL' => $bbcode_tpl, + 'BBCODE_HELPLINE' => $bbcode_helpline, + 'DISPLAY_ON_POSTING' => $display_on_posting, + ); + + $bbcode_tokens = array('TEXT', 'SIMPLETEXT', 'INTTEXT', 'IDENTIFIER', 'NUMBER', 'EMAIL', 'URL', 'LOCAL_URL', 'RELATIVE_URL', 'COLOR'); + + /** + * Modify custom bbcode template data before we display the add/edit form + * + * @event core.acp_bbcodes_edit_add + * @var string action Type of the action: add|edit + * @var array tpl_ary Array with custom bbcode add/edit data + * @var int bbcode_id When editing: the bbcode id, + * when creating: 0 + * @var array bbcode_tokens Array of bbcode tokens + * @since 3.1.0-a3 + */ + $vars = array('action', 'tpl_ary', 'bbcode_id', 'bbcode_tokens'); + extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_edit_add', compact($vars))); + + $template->assign_vars($tpl_ary); + + foreach ($bbcode_tokens as $token) + { + $template->assign_block_vars('token', array( + 'TOKEN' => '{' . $token . '}', + 'EXPLAIN' => ($token === 'LOCAL_URL') ? $user->lang(array('tokens', $token), generate_board_url() . '/') : $user->lang(array('tokens', $token)), + )); + } + + return; + + break; + + case 'modify': + case 'create': + + $sql_ary = $hidden_fields = array(); + + /** + * Modify custom bbcode data before the modify/create action + * + * @event core.acp_bbcodes_modify_create + * @var string action Type of the action: modify|create + * @var array sql_ary Array with new bbcode data + * @var int bbcode_id When editing: the bbcode id, + * when creating: 0 + * @var bool display_on_posting Display bbcode on posting form + * @var string bbcode_match The bbcode usage string to match + * @var string bbcode_tpl The bbcode HTML replacement string + * @var string bbcode_helpline The bbcode help line string + * @var array hidden_fields Array of hidden fields for use when + * submitting form when $warn_text is true + * @since 3.1.0-a3 + */ + $vars = array( + 'action', + 'sql_ary', + 'bbcode_id', + 'display_on_posting', + 'bbcode_match', + 'bbcode_tpl', + 'bbcode_helpline', + 'hidden_fields', + ); + extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_modify_create', compact($vars))); + + $warn_text = preg_match('%<[^>]*\{text[\d]*\}[^>]*>%i', $bbcode_tpl); + if (!$warn_text || confirm_box(true)) + { + $data = $this->build_regexp($bbcode_match, $bbcode_tpl); + + // Make sure the user didn't pick a "bad" name for the BBCode tag. + $hard_coded = array('code', 'quote', 'quote=', 'attachment', 'attachment=', 'b', 'i', 'url', 'url=', 'img', 'size', 'size=', 'color', 'color=', 'u', 'list', 'list=', 'email', 'email=', 'flash', 'flash='); + + if (($action == 'modify' && strtolower($data['bbcode_tag']) !== strtolower($row['bbcode_tag'])) || ($action == 'create')) + { + $sql = 'SELECT 1 as test + FROM ' . BBCODES_TABLE . " + WHERE LOWER(bbcode_tag) = '" . $db->sql_escape(strtolower($data['bbcode_tag'])) . "'"; + $result = $db->sql_query($sql); + $info = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + // Grab the end, interrogate the last closing tag + if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded) || (preg_match('#\[/([^[]*)]$#', $bbcode_match, $regs) && in_array(strtolower($regs[1]), $hard_coded))) + { + trigger_error($user->lang['BBCODE_INVALID_TAG_NAME'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + + if (substr($data['bbcode_tag'], -1) === '=') + { + $test = substr($data['bbcode_tag'], 0, -1); + } + else + { + $test = $data['bbcode_tag']; + } + + if (!preg_match('%\\[' . $test . '[^]]*].*?\\[/' . $test . ']%s', $bbcode_match)) + { + trigger_error($user->lang['BBCODE_OPEN_ENDED_TAG'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (strlen($data['bbcode_tag']) > 16) + { + trigger_error($user->lang['BBCODE_TAG_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (strlen($bbcode_match) > 4000) + { + trigger_error($user->lang['BBCODE_TAG_DEF_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (strlen($bbcode_helpline) > 255) + { + trigger_error($user->lang['BBCODE_HELPLINE_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql_ary = array_merge($sql_ary, array( + 'bbcode_tag' => $data['bbcode_tag'], + 'bbcode_match' => $bbcode_match, + 'bbcode_tpl' => $bbcode_tpl, + 'display_on_posting' => $display_on_posting, + 'bbcode_helpline' => $bbcode_helpline, + 'first_pass_match' => $data['first_pass_match'], + 'first_pass_replace' => $data['first_pass_replace'], + 'second_pass_match' => $data['second_pass_match'], + 'second_pass_replace' => $data['second_pass_replace'] + )); + + if ($action == 'create') + { + $sql = 'SELECT MAX(bbcode_id) as max_bbcode_id + FROM ' . BBCODES_TABLE; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $bbcode_id = $row['max_bbcode_id'] + 1; + + // Make sure it is greater than the core bbcode ids... + if ($bbcode_id <= NUM_CORE_BBCODES) + { + $bbcode_id = NUM_CORE_BBCODES + 1; + } + } + else + { + $bbcode_id = NUM_CORE_BBCODES + 1; + } + + if ($bbcode_id > BBCODE_LIMIT) + { + trigger_error($user->lang['TOO_MANY_BBCODES'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql_ary['bbcode_id'] = (int) $bbcode_id; + + $db->sql_query('INSERT INTO ' . BBCODES_TABLE . $db->sql_build_array('INSERT', $sql_ary)); + $cache->destroy('sql', BBCODES_TABLE); + + $lang = 'BBCODE_ADDED'; + $log_action = 'LOG_BBCODE_ADD'; + } + else + { + $sql = 'UPDATE ' . BBCODES_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE bbcode_id = ' . $bbcode_id; + $db->sql_query($sql); + $cache->destroy('sql', BBCODES_TABLE); + + $lang = 'BBCODE_EDITED'; + $log_action = 'LOG_BBCODE_EDIT'; + } + + add_log('admin', $log_action, $data['bbcode_tag']); + + trigger_error($user->lang[$lang] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, $user->lang['BBCODE_DANGER'], build_hidden_fields(array_merge($hidden_fields, array( + 'action' => $action, + 'bbcode' => $bbcode_id, + 'bbcode_match' => $bbcode_match, + 'bbcode_tpl' => htmlspecialchars($bbcode_tpl), + 'bbcode_helpline' => $bbcode_helpline, + 'display_on_posting' => $display_on_posting, + ))) + , 'confirm_bbcode.html'); + } + + break; + + case 'delete': + + $sql = 'SELECT bbcode_tag + FROM ' . BBCODES_TABLE . " + WHERE bbcode_id = $bbcode_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + if (confirm_box(true)) + { + $db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id"); + $cache->destroy('sql', BBCODES_TABLE); + add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']); + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $user->lang['BBCODE_DELETED'], + 'REFRESH_DATA' => array( + 'time' => 3 + ) + )); + } + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'bbcode' => $bbcode_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action)) + ); + } + } + + break; + } + + $u_action = $this->u_action; + + $template_data = array( + 'U_ACTION' => $this->u_action . '&action=add', + ); + + $sql_ary = array( + 'SELECT' => 'b.*', + 'FROM' => array(BBCODES_TABLE => 'b'), + 'ORDER_BY' => 'b.bbcode_tag', + ); + + /** + * Modify custom bbcode template data before we display the form + * + * @event core.acp_bbcodes_display_form + * @var string action Type of the action: modify|create + * @var string sql_ary The SQL array to get custom bbcode data + * @var array template_data Array with form template data + * @var string u_action The u_action link + * @since 3.1.0-a3 + */ + $vars = array('action', 'sql_ary', 'template_data', 'u_action'); + extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_form', compact($vars))); + + $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); + + $template->assign_vars($template_data); + + while ($row = $db->sql_fetchrow($result)) + { + $bbcodes_array = array( + 'BBCODE_TAG' => $row['bbcode_tag'], + 'U_EDIT' => $u_action . '&action=edit&bbcode=' . $row['bbcode_id'], + 'U_DELETE' => $u_action . '&action=delete&bbcode=' . $row['bbcode_id'], + ); + + /** + * Modify display of custom bbcodes in the form + * + * @event core.acp_bbcodes_display_bbcodes + * @var array row Array with current bbcode data + * @var array bbcodes_array Array of bbcodes template data + * @var string u_action The u_action link + * @since 3.1.0-a3 + */ + $vars = array('bbcodes_array', 'row', 'u_action'); + extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_bbcodes', compact($vars))); + + $template->assign_block_vars('bbcodes', $bbcodes_array); + + } + $db->sql_freeresult($result); + } + + /* + * Build regular expression for custom bbcode + */ + function build_regexp(&$bbcode_match, &$bbcode_tpl) + { + $bbcode_match = trim($bbcode_match); + $bbcode_tpl = trim($bbcode_tpl); + + // 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); + + $sp_match = preg_quote($bbcode_match, '!'); + $sp_match = preg_replace('#^\\\\\[(.*?)\\\\\]#', '\[$1:$uid\]', $sp_match); + $sp_match = preg_replace('#\\\\\[/(.*?)\\\\\]$#', '\[/$1:$uid\]', $sp_match); + $sp_replace = $bbcode_tpl; + + // @todo Make sure to change this too if something changed in message parsing + $tokens = array( + 'URL' => array( + '!(?:(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('url')) . ')|(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('www_url')) . '))!ie' => "\$this->bbcode_specialchars(('\$1') ? '\$1' : 'http://\$2')" + ), + 'LOCAL_URL' => array( + '!(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')!e' => "\$this->bbcode_specialchars('$1')" + ), + 'RELATIVE_URL' => array( + '!(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')!e' => "\$this->bbcode_specialchars('$1')" + ), + 'EMAIL' => array( + '!(' . get_preg_expression('email') . ')!ie' => "\$this->bbcode_specialchars('$1')" + ), + 'TEXT' => array( + '!(.*?)!es' => "str_replace(array(\"\\r\\n\", '\\\"', '\\'', '(', ')'), array(\"\\n\", '\"', ''', '(', ')'), trim('\$1'))" + ), + 'SIMPLETEXT' => array( + '!([a-zA-Z0-9-+.,_ ]+)!' => "$1" + ), + 'INTTEXT' => array( + ($utf8_pcre_properties) ? '!([\p{L}\p{N}\-+,_. ]+)!u' : '!([a-zA-Z0-9\-+,_. ]+)!u' => "$1" + ), + 'IDENTIFIER' => array( + '!([a-zA-Z0-9-_]+)!' => "$1" + ), + 'COLOR' => array( + '!([a-z]+|#[0-9abcdef]+)!i' => '$1' + ), + 'NUMBER' => array( + '!([0-9]+)!' => '$1' + ) + ); + + $sp_tokens = array( + 'URL' => '(?i)((?:' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('url')) . ')|(?:' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('www_url')) . '))(?-i)', + 'LOCAL_URL' => '(?i)(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')(?-i)', + 'RELATIVE_URL' => '(?i)(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')(?-i)', + 'EMAIL' => '(' . get_preg_expression('email') . ')', + 'TEXT' => '(.*?)', + 'SIMPLETEXT' => '([a-zA-Z0-9-+.,_ ]+)', + 'INTTEXT' => ($utf8_pcre_properties) ? '([\p{L}\p{N}\-+,_. ]+)' : '([a-zA-Z0-9\-+,_. ]+)', + 'IDENTIFIER' => '([a-zA-Z0-9-_]+)', + 'COLOR' => '([a-zA-Z]+|#[0-9abcdefABCDEF]+)', + 'NUMBER' => '([0-9]+)', + ); + + $pad = 0; + $modifiers = 'i'; + $modifiers .= ($utf8 && $utf8_pcre_properties) ? 'u' : ''; + + if (preg_match_all('/\{(' . implode('|', array_keys($tokens)) . ')[0-9]*\}/i', $bbcode_match, $m)) + { + foreach ($m[0] as $n => $token) + { + $token_type = $m[1][$n]; + + reset($tokens[strtoupper($token_type)]); + list($match, $replace) = each($tokens[strtoupper($token_type)]); + + // Pad backreference numbers from tokens + if (preg_match_all('/(?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); + + return array( + 'bbcode_tag' => $bbcode_tag, + 'first_pass_match' => $fp_match, + 'first_pass_replace' => $fp_replace, + 'second_pass_match' => $sp_match, + 'second_pass_replace' => $sp_replace + ); + } +} diff --git a/sources/phpBB/includes/acp/acp_board.php b/sources/phpBB/includes/acp/acp_board.php new file mode 100644 index 0000000..63e2647 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_board.php @@ -0,0 +1,1121 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +/** +* @todo add cron intervals to server settings? (database_gc, queue_interval, session_gc, search_gc, cache_gc, warnings_gc) +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +class acp_board +{ + var $u_action; + var $new_config = array(); + + function main($id, $mode) + { + global $db, $user, $auth, $template; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $cache, $phpbb_container, $phpbb_dispatcher; + + $user->add_lang('acp/board'); + + $action = request_var('action', ''); + $submit = (isset($_POST['submit']) || isset($_POST['allow_quick_reply_enable'])) ? true : false; + + $form_key = 'acp_board'; + add_form_key($form_key); + + /** + * Validation types are: + * string, int, bool, + * script_path (absolute path in url - beginning with / and no trailing slash), + * rpath (relative), rwpath (realtive, writable), path (relative path, but able to escape the root), wpath (writable) + */ + switch ($mode) + { + case 'settings': + $display_vars = array( + 'title' => 'ACP_BOARD_SETTINGS', + 'vars' => array( + 'legend1' => 'ACP_BOARD_SETTINGS', + 'sitename' => array('lang' => 'SITE_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false), + 'site_desc' => array('lang' => 'SITE_DESC', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false), + 'site_home_url' => array('lang' => 'SITE_HOME_URL', 'validate' => 'string', 'type' => 'url:40:255', 'explain' => true), + 'site_home_text' => array('lang' => 'SITE_HOME_TEXT', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), + 'board_index_text' => array('lang' => 'BOARD_INDEX_TEXT', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), + 'board_disable' => array('lang' => 'DISABLE_BOARD', 'validate' => 'bool', 'type' => 'custom', 'method' => 'board_disable', 'explain' => true), + 'board_disable_msg' => false, + 'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'lang', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false), + 'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true), + 'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'timezone', 'type' => 'custom', 'method' => 'timezone_select', 'explain' => true), + + 'legend2' => 'BOARD_STYLE', + 'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => true), + 'guest_style' => array('lang' => 'GUEST_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array($this->guest_style_get(), false), 'explain' => true), + 'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + + 'legend3' => 'WARNINGS', + 'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']), + + 'legend4' => 'ACP_SUBMIT_CHANGES', + ) + ); + break; + + case 'features': + $display_vars = array( + 'title' => 'ACP_BOARD_FEATURES', + 'vars' => array( + 'legend1' => 'ACP_BOARD_FEATURES', + 'allow_privmsg' => array('lang' => 'BOARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_pm_report' => array('lang' => 'ALLOW_PM_REPORT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + '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_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), + 'display_last_subject' => array('lang' => 'DISPLAY_LAST_SUBJECT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'custom', 'method' => 'quick_reply', 'explain' => true), + + 'legend2' => 'ACP_LOAD_SETTINGS', + 'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_cpf_pm' => array('lang' => 'LOAD_CPF_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + + 'legend3' => 'ACP_SUBMIT_CHANGES', + ) + ); + break; + + case 'avatar': + $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); + $avatar_drivers = $phpbb_avatar_manager->get_all_drivers(); + + $avatar_vars = array(); + foreach ($avatar_drivers as $current_driver) + { + $driver = $phpbb_avatar_manager->get_driver($current_driver, false); + + /* + * First grab the settings for enabling/disabling the avatar + * driver and afterwards grab additional settings the driver + * might have. + */ + $avatar_vars += $phpbb_avatar_manager->get_avatar_settings($driver); + $avatar_vars += $driver->prepare_form_acp($user); + } + + $display_vars = array( + 'title' => 'ACP_AVATAR_SETTINGS', + 'vars' => array( + 'legend1' => 'ACP_AVATAR_SETTINGS', + + 'avatar_min_width' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false), + 'avatar_min_height' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false), + 'avatar_max_width' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false), + 'avatar_max_height' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false), + + 'allow_avatar' => array('lang' => 'ALLOW_AVATARS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + 'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + ) + ); + + if (!empty($avatar_vars)) + { + $display_vars['vars'] += $avatar_vars; + } + break; + + case 'message': + $display_vars = array( + 'title' => 'ACP_MESSAGE_SETTINGS', + 'lang' => 'ucp', + 'vars' => array( + 'legend1' => 'GENERAL_SETTINGS', + 'allow_privmsg' => array('lang' => 'BOARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), + 'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), + 'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'validate' => 'int', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true), + 'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), + 'pm_max_recipients' => array('lang' => 'PM_MAX_RECIPIENTS', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true), + + 'legend2' => 'GENERAL_OPTIONS', + 'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_bbcode_pm' => array('lang' => 'ALLOW_BBCODE_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_smilies_pm' => array('lang' => 'ALLOW_SMILIES_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_sig_pm' => array('lang' => 'ALLOW_SIG_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'print_pm' => array('lang' => 'ALLOW_PRINT_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'forward_pm' => array('lang' => 'ALLOW_FORWARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_img_pm' => array('lang' => 'ALLOW_IMG_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_flash_pm' => array('lang' => 'ALLOW_FLASH_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'enable_pm_icons' => array('lang' => 'ENABLE_PM_ICONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + + 'legend3' => 'ACP_SUBMIT_CHANGES', + ) + ); + break; + + case 'post': + $display_vars = array( + 'title' => 'ACP_POST_SETTINGS', + 'vars' => array( + 'legend1' => 'GENERAL_OPTIONS', + 'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_post_flash' => array('lang' => 'ALLOW_POST_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_post_links' => array('lang' => 'ALLOW_POST_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + '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), + 'enable_post_confirm' => array('lang' => 'VISUAL_CONFIRM_POST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'custom', 'method' => 'quick_reply', 'explain' => true), + + 'legend2' => 'POSTING', + 'bump_type' => false, + 'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), + 'delete_time' => array('lang' => 'DELETE_TIME', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), + 'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int:0:9999999999', 'type' => 'number:0:9999999999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), + 'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int:0', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true), + 'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), + 'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), + 'smilies_per_page' => array('lang' => 'SMILIES_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), + 'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), + 'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int:2:127', 'type' => 'number:2:127', 'explain' => false), + 'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int:0:999999', 'type' => 'number:0:999999', 'explain' => true), + 'min_post_chars' => array('lang' => 'MIN_CHAR_LIMIT', 'validate' => 'int:1:999999', 'type' => 'number:1:999999', 'explain' => true), + 'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), + 'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), + 'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' %'), + 'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), + 'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + 'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + + 'legend3' => 'ACP_SUBMIT_CHANGES', + ) + ); + break; + + case 'signature': + $display_vars = array( + 'title' => 'ACP_SIGNATURE_SETTINGS', + 'vars' => array( + 'legend1' => 'GENERAL_OPTIONS', + 'allow_sig' => array('lang' => 'ALLOW_SIG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_sig_bbcode' => array('lang' => 'ALLOW_SIG_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_sig_img' => array('lang' => 'ALLOW_SIG_IMG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_sig_flash' => array('lang' => 'ALLOW_SIG_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_sig_smilies' => array('lang' => 'ALLOW_SIG_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_sig_links' => array('lang' => 'ALLOW_SIG_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + + 'legend2' => 'GENERAL_SETTINGS', + 'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), + 'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), + 'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' %'), + 'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), + 'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + 'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + + 'legend3' => 'ACP_SUBMIT_CHANGES', + ) + ); + break; + + case 'registration': + $display_vars = array( + 'title' => 'ACP_REGISTER_SETTINGS', + 'vars' => array( + 'legend1' => 'GENERAL_SETTINGS', + 'max_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:8:180', 'type' => false, 'method' => false, 'explain' => false,), + 'max_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,), + + 'require_activation' => array('lang' => 'ACC_ACTIVATION', 'validate' => 'int', 'type' => 'select', 'method' => 'select_acc_activation', 'explain' => true), + 'new_member_post_limit' => array('lang' => 'NEW_MEMBER_POST_LIMIT', 'validate' => 'int:0:255', 'type' => 'number:0:255', 'explain' => true, 'append' => ' ' . $user->lang['POSTS']), + 'new_member_group_default'=> array('lang' => 'NEW_MEMBER_GROUP_DEFAULT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:1', 'type' => 'custom:5:180', 'method' => 'username_length', 'explain' => true), + 'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:1', 'type' => 'custom', 'method' => 'password_length', 'explain' => true), + 'allow_name_chars' => array('lang' => 'USERNAME_CHARS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_username_chars', 'explain' => true), + 'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true), + 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']), + + 'legend2' => 'GENERAL_OPTIONS', + 'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_emailreuse' => array('lang' => 'ALLOW_EMAIL_REUSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'enable_confirm' => array('lang' => 'VISUAL_CONFIRM_REG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true), + 'max_reg_attempts' => array('lang' => 'REG_LIMIT', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), + + 'legend3' => 'COPPA', + 'coppa_enable' => array('lang' => 'ENABLE_COPPA', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'coppa_mail' => array('lang' => 'COPPA_MAIL', 'validate' => 'string', 'type' => 'textarea:5:40', 'explain' => true), + 'coppa_fax' => array('lang' => 'COPPA_FAX', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => false), + + 'legend4' => 'ACP_SUBMIT_CHANGES', + ) + ); + break; + + case 'feed': + $display_vars = array( + 'title' => 'ACP_FEED_MANAGEMENT', + 'vars' => array( + 'legend1' => 'ACP_FEED_GENERAL', + 'feed_enable' => array('lang' => 'ACP_FEED_ENABLE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ), + 'feed_item_statistics' => array('lang' => 'ACP_FEED_ITEM_STATISTICS', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), + 'feed_http_auth' => array('lang' => 'ACP_FEED_HTTP_AUTH', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), + + 'legend2' => 'ACP_FEED_POST_BASED', + 'feed_limit_post' => array('lang' => 'ACP_FEED_LIMIT', 'validate' => 'int:5:9999', 'type' => 'number:5:9999', 'explain' => true), + 'feed_overall' => array('lang' => 'ACP_FEED_OVERALL', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ), + 'feed_forum' => array('lang' => 'ACP_FEED_FORUM', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ), + 'feed_topic' => array('lang' => 'ACP_FEED_TOPIC', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ), + + 'legend3' => 'ACP_FEED_TOPIC_BASED', + 'feed_limit_topic' => array('lang' => 'ACP_FEED_LIMIT', 'validate' => 'int:5:9999', 'type' => 'number:5:9999', 'explain' => true), + 'feed_topics_new' => array('lang' => 'ACP_FEED_TOPICS_NEW', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ), + 'feed_topics_active' => array('lang' => 'ACP_FEED_TOPICS_ACTIVE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ), + 'feed_news_id' => array('lang' => 'ACP_FEED_NEWS', 'validate' => 'string', 'type' => 'custom', 'method' => 'select_news_forums', 'explain' => true), + + 'legend4' => 'ACP_FEED_SETTINGS_OTHER', + 'feed_overall_forums' => array('lang' => 'ACP_FEED_OVERALL_FORUMS', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ), + 'feed_exclude_id' => array('lang' => 'ACP_FEED_EXCLUDE_ID', 'validate' => 'string', 'type' => 'custom', 'method' => 'select_exclude_forums', 'explain' => true), + ) + ); + break; + + case 'cookie': + $display_vars = array( + 'title' => 'ACP_COOKIE_SETTINGS', + 'vars' => array( + 'legend1' => 'ACP_COOKIE_SETTINGS', + 'cookie_domain' => array('lang' => 'COOKIE_DOMAIN', 'validate' => 'string', 'type' => 'text::255', 'explain' => false), + 'cookie_name' => array('lang' => 'COOKIE_NAME', 'validate' => 'string', 'type' => 'text::16', 'explain' => false), + 'cookie_path' => array('lang' => 'COOKIE_PATH', 'validate' => 'string', 'type' => 'text::255', 'explain' => false), + 'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'validate' => 'bool', 'type' => 'radio:disabled_enabled', 'explain' => true), + ) + ); + break; + + case 'load': + $display_vars = array( + 'title' => 'ACP_LOAD_SETTINGS', + 'vars' => array( + 'legend1' => 'GENERAL_SETTINGS', + 'limit_load' => array('lang' => 'LIMIT_LOAD', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), + 'session_length' => array('lang' => 'SESSION_LENGTH', 'validate' => 'int:60:9999999999', 'type' => 'number:60:9999999999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), + 'active_sessions' => array('lang' => 'LIMIT_SESSIONS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), + 'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), + 'read_notification_expire_days' => array('lang' => 'READ_NOTIFICATION_EXPIRE_DAYS', 'validate' => 'int:0', 'type' => 'number:0', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']), + + 'legend2' => 'GENERAL_OPTIONS', + 'load_notifications' => array('lang' => 'LOAD_NOTIFICATIONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_db_track' => array('lang' => 'YES_POST_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_db_lastread' => array('lang' => 'YES_READ_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_anon_lastread' => array('lang' => 'YES_ANON_READ_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_online' => array('lang' => 'YES_ONLINE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_online_guests' => array('lang' => 'YES_ONLINE_GUESTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_onlinetrack' => array('lang' => 'YES_ONLINE_TRACK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_unreads_search' => array('lang' => 'YES_UNREAD_SEARCH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_user_activity' => array('lang' => 'LOAD_USER_ACTIVITY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_tplcompile' => array('lang' => 'RECOMPILE_STYLES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_cdn' => array('lang' => 'ALLOW_CDN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_live_searches' => array('lang' => 'ALLOW_LIVE_SEARCHES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + + 'legend3' => 'CUSTOM_PROFILE_FIELDS', + 'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_cpf_pm' => array('lang' => 'LOAD_CPF_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + + 'legend4' => 'ACP_SUBMIT_CHANGES', + ) + ); + break; + + case 'auth': + $display_vars = array( + 'title' => 'ACP_AUTH_SETTINGS', + 'vars' => array( + 'legend1' => 'ACP_AUTH_SETTINGS', + 'auth_method' => array('lang' => 'AUTH_METHOD', 'validate' => 'string', 'type' => 'select:1:toggable', 'method' => 'select_auth_method', 'explain' => false), + ) + ); + break; + + case 'server': + $display_vars = array( + 'title' => 'ACP_SERVER_SETTINGS', + 'vars' => array( + 'legend1' => 'ACP_SERVER_SETTINGS', + 'gzip_compress' => array('lang' => 'ENABLE_GZIP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'use_system_cron' => array('lang' => 'USE_SYSTEM_CRON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + + 'legend2' => 'PATH_SETTINGS', + 'enable_mod_rewrite' => array('lang' => 'MOD_REWRITE_ENABLE', 'validate' => 'bool', 'type' => 'custom', 'method' => 'enable_mod_rewrite', 'explain' => true), + 'smilies_path' => array('lang' => 'SMILIES_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true), + 'icons_path' => array('lang' => 'ICONS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true), + 'upload_icons_path' => array('lang' => 'UPLOAD_ICONS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true), + 'ranks_path' => array('lang' => 'RANKS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true), + + 'legend3' => 'SERVER_URL_SETTINGS', + 'force_server_vars' => array('lang' => 'FORCE_SERVER_VARS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true), + 'server_name' => array('lang' => 'SERVER_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), + 'server_port' => array('lang' => 'SERVER_PORT', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true), + 'script_path' => array('lang' => 'SCRIPT_PATH', 'validate' => 'script_path', 'type' => 'text::255', 'explain' => true), + + 'legend4' => 'ACP_SUBMIT_CHANGES', + ) + ); + break; + + case 'security': + $display_vars = array( + 'title' => 'ACP_SECURITY_SETTINGS', + 'vars' => array( + 'legend1' => 'ACP_SECURITY_SETTINGS', + 'allow_autologin' => array('lang' => 'ALLOW_AUTOLOGIN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_password_reset' => array('lang' => 'ALLOW_PASSWORD_RESET', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']), + 'ip_check' => array('lang' => 'IP_VALID', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true), + 'browser_check' => array('lang' => 'BROWSER_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'forwarded_for_check' => array('lang' => 'FORWARDED_FOR_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'referer_validation' => array('lang' => 'REFERRER_VALID', 'validate' => 'int:0:3','type' => 'custom', 'method' => 'select_ref_check', 'explain' => true), + 'check_dnsbl' => array('lang' => 'CHECK_DNSBL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'email_check_mx' => array('lang' => 'EMAIL_CHECK_MX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'max_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,), + 'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:1', 'type' => 'custom', 'method' => 'password_length', 'explain' => true), + 'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true), + 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']), + 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true), + 'ip_login_limit_max' => array('lang' => 'IP_LOGIN_LIMIT_MAX', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true), + 'ip_login_limit_time' => array('lang' => 'IP_LOGIN_LIMIT_TIME', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), + 'ip_login_limit_use_forwarded' => array('lang' => 'IP_LOGIN_LIMIT_USE_FORWARDED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'tpl_allow_php' => array('lang' => 'TPL_ALLOW_PHP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'form_token_lifetime' => array('lang' => 'FORM_TIME_MAX', 'validate' => 'int:-1:99999', 'type' => 'number:-1:99999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), + 'form_token_sid_guests' => array('lang' => 'FORM_SID_GUESTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + + ) + ); + break; + + case 'email': + $display_vars = array( + 'title' => 'ACP_EMAIL_SETTINGS', + 'vars' => array( + 'legend1' => 'GENERAL_SETTINGS', + 'email_enable' => array('lang' => 'ENABLE_EMAIL', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), + 'board_email_form' => array('lang' => 'BOARD_EMAIL_FORM', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), + 'email_function_name' => array('lang' => 'EMAIL_FUNCTION_NAME', 'validate' => 'string', 'type' => 'text:20:50', 'explain' => true), + 'email_package_size' => array('lang' => 'EMAIL_PACKAGE_SIZE', 'validate' => 'int:0', 'type' => 'number:0:99999', 'explain' => true), + 'board_contact' => array('lang' => 'CONTACT_EMAIL', 'validate' => 'email', 'type' => 'email:25:100', 'explain' => true), + 'board_contact_name' => array('lang' => 'CONTACT_EMAIL_NAME', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => true), + 'board_email' => array('lang' => 'ADMIN_EMAIL', 'validate' => 'email', 'type' => 'email:25:100', 'explain' => true), + 'board_email_sig' => array('lang' => 'EMAIL_SIG', 'validate' => 'string', 'type' => 'textarea:5:30', 'explain' => true), + 'board_hide_emails' => array('lang' => 'BOARD_HIDE_EMAILS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + + 'legend2' => 'SMTP_SETTINGS', + 'smtp_delivery' => array('lang' => 'USE_SMTP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'smtp_host' => array('lang' => 'SMTP_SERVER', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => false), + 'smtp_port' => array('lang' => 'SMTP_PORT', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true), + 'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true), + 'smtp_username' => array('lang' => 'SMTP_USERNAME', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true), + 'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'validate' => 'string', 'type' => 'password:25:255', 'explain' => true), + + 'legend3' => 'ACP_SUBMIT_CHANGES', + ) + ); + break; + + default: + trigger_error('NO_MODE', E_USER_ERROR); + break; + } + + /** + * Event to add and/or modify acp_board configurations + * + * @event core.acp_board_config_edit_add + * @var array display_vars Array of config values to display and process + * @var string mode Mode of the config page we are displaying + * @var boolean submit Do we display the form or process the submission + * @since 3.1.0-a4 + */ + $vars = array('display_vars', 'mode', 'submit'); + extract($phpbb_dispatcher->trigger_event('core.acp_board_config_edit_add', compact($vars))); + + if (isset($display_vars['lang'])) + { + $user->add_lang($display_vars['lang']); + } + + $this->new_config = $config; + $cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config; + $error = array(); + + // We validate the complete config if wished + validate_config_vars($display_vars['vars'], $cfg_array, $error); + + if ($submit && !check_form_key($form_key)) + { + $error[] = $user->lang['FORM_INVALID']; + } + // Do not write values if there is an error + if (sizeof($error)) + { + $submit = false; + } + + // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... + foreach ($display_vars['vars'] as $config_name => $null) + { + if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) + { + continue; + } + + if ($config_name == 'auth_method' || $config_name == 'feed_news_id' || $config_name == 'feed_exclude_id') + { + continue; + } + + if ($config_name == 'guest_style') + { + if (isset($cfg_array[$config_name])) { + $this->guest_style_set($cfg_array[$config_name]); + } + continue; + } + + $this->new_config[$config_name] = $config_value = $cfg_array[$config_name]; + + if ($config_name == 'email_function_name') + { + $this->new_config['email_function_name'] = trim(str_replace(array('(', ')'), array('', ''), $this->new_config['email_function_name'])); + $this->new_config['email_function_name'] = (empty($this->new_config['email_function_name']) || !function_exists($this->new_config['email_function_name'])) ? 'mail' : $this->new_config['email_function_name']; + $config_value = $this->new_config['email_function_name']; + } + + if ($submit) + { + set_config($config_name, $config_value); + + if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable'])) + { + enable_bitfield_column_flag(FORUMS_TABLE, 'forum_flags', log(FORUM_FLAG_QUICK_REPLY, 2)); + } + } + } + + // Store news and exclude ids + if ($mode == 'feed' && $submit) + { + $cache->destroy('_feed_news_forum_ids'); + $cache->destroy('_feed_excluded_forum_ids'); + + $this->store_feed_forums(FORUM_OPTION_FEED_NEWS, 'feed_news_id'); + $this->store_feed_forums(FORUM_OPTION_FEED_EXCLUDE, 'feed_exclude_id'); + } + + if ($mode == 'auth') + { + // Retrieve a list of auth plugins and check their config values + $auth_providers = $phpbb_container->get('auth.provider_collection'); + + $updated_auth_settings = false; + $old_auth_config = array(); + foreach ($auth_providers as $provider) + { + if ($fields = $provider->acp()) + { + // Check if we need to create config fields for this plugin and save config when submit was pressed + foreach ($fields as $field) + { + if (!isset($config[$field])) + { + set_config($field, ''); + } + + if (!isset($cfg_array[$field]) || strpos($field, 'legend') !== false) + { + continue; + } + + $old_auth_config[$field] = $this->new_config[$field]; + $config_value = $cfg_array[$field]; + $this->new_config[$field] = $config_value; + + if ($submit) + { + $updated_auth_settings = true; + set_config($field, $config_value); + } + } + } + unset($fields); + } + + if ($submit && (($cfg_array['auth_method'] != $this->new_config['auth_method']) || $updated_auth_settings)) + { + $method = basename($cfg_array['auth_method']); + if (array_key_exists('auth.provider.' . $method, $auth_providers)) + { + $provider = $auth_providers['auth.provider.' . $method]; + if ($error = $provider->init()) + { + foreach ($old_auth_config as $config_name => $config_value) + { + set_config($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'])); + } + else + { + trigger_error('NO_AUTH_PLUGIN', E_USER_ERROR); + } + } + } + + if ($submit) + { + add_log('admin', 'LOG_CONFIG_' . strtoupper($mode)); + + $message = $user->lang('CONFIG_UPDATED'); + $message_type = E_USER_NOTICE; + if (!$config['email_enable'] && in_array($mode, array('email', 'registration')) && + in_array($config['require_activation'], array(USER_ACTIVATION_SELF, USER_ACTIVATION_ADMIN))) + { + $message .= '

' . $user->lang('ACC_ACTIVATION_WARNING'); + $message_type = E_USER_WARNING; + } + trigger_error($message . adm_back_link($this->u_action), $message_type); + } + + $this->tpl_name = 'acp_board'; + $this->page_title = $display_vars['title']; + + $template->assign_vars(array( + 'L_TITLE' => $user->lang[$display_vars['title']], + 'L_TITLE_EXPLAIN' => $user->lang[$display_vars['title'] . '_EXPLAIN'], + + 'S_ERROR' => (sizeof($error)) ? true : false, + 'ERROR_MSG' => implode('
', $error), + + 'U_ACTION' => $this->u_action) + ); + + // Output relevant page + foreach ($display_vars['vars'] as $config_key => $vars) + { + if (!is_array($vars) && strpos($config_key, 'legend') === false) + { + continue; + } + + if (strpos($config_key, 'legend') !== false) + { + $template->assign_block_vars('options', array( + 'S_LEGEND' => true, + 'LEGEND' => (isset($user->lang[$vars])) ? $user->lang[$vars] : $vars) + ); + + continue; + } + + $type = explode(':', $vars['type']); + + $l_explain = ''; + if ($vars['explain'] && isset($vars['lang_explain'])) + { + $l_explain = (isset($user->lang[$vars['lang_explain']])) ? $user->lang[$vars['lang_explain']] : $vars['lang_explain']; + } + else if ($vars['explain']) + { + $l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : ''; + } + + $content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars); + + if (empty($content)) + { + continue; + } + + $template->assign_block_vars('options', array( + 'KEY' => $config_key, + 'TITLE' => (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'], + 'S_EXPLAIN' => $vars['explain'], + 'TITLE_EXPLAIN' => $l_explain, + 'CONTENT' => $content, + ) + ); + + unset($display_vars['vars'][$config_key]); + } + + if ($mode == 'auth') + { + $template->assign_var('S_AUTH', true); + + foreach ($auth_providers as $provider) + { + $auth_tpl = $provider->get_acp_template($this->new_config); + if ($auth_tpl) + { + if (array_key_exists('BLOCK_VAR_NAME', $auth_tpl)) + { + foreach ($auth_tpl['BLOCK_VARS'] as $block_vars) + { + $template->assign_block_vars($auth_tpl['BLOCK_VAR_NAME'], $block_vars); + } + } + $template->assign_vars($auth_tpl['TEMPLATE_VARS']); + $template->assign_block_vars('auth_tpl', array( + 'TEMPLATE_FILE' => $auth_tpl['TEMPLATE_FILE'], + )); + } + } + } + } + + /** + * Select auth method + */ + function select_auth_method($selected_method, $key = '') + { + global $phpbb_root_path, $phpEx, $phpbb_container; + + $auth_plugins = array(); + $auth_providers = $phpbb_container->get('auth.provider_collection'); + + foreach ($auth_providers as $key => $value) + { + if (!($value instanceof \phpbb\auth\provider\provider_interface)) + { + continue; + } + $auth_plugins[] = str_replace('auth.provider.', '', $key); + } + + sort($auth_plugins); + + $auth_select = ''; + foreach ($auth_plugins as $method) + { + $selected = ($selected_method == $method) ? ' selected="selected"' : ''; + $auth_select .= "'; + } + + return $auth_select; + } + + /** + * Select mail authentication method + */ + function mail_auth_select($selected_method, $key = '') + { + global $user; + + $auth_methods = array('PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5', 'POP-BEFORE-SMTP'); + $s_smtp_auth_options = ''; + + foreach ($auth_methods as $method) + { + $s_smtp_auth_options .= ''; + } + + return $s_smtp_auth_options; + } + + /** + * Select full folder action + */ + function full_folder_select($value, $key = '') + { + global $user; + + return ''; + } + + /** + * Select ip validation + */ + function select_ip_check($value, $key = '') + { + $radio_ary = array(4 => 'ALL', 3 => 'CLASS_C', 2 => 'CLASS_B', 0 => 'NO_IP_VALIDATION'); + + return h_radio('config[ip_check]', $radio_ary, $value, $key); + } + + /** + * Select referer validation + */ + function select_ref_check($value, $key = '') + { + $radio_ary = array(REFERER_VALIDATE_PATH => 'REF_PATH', REFERER_VALIDATE_HOST => 'REF_HOST', REFERER_VALIDATE_NONE => 'NO_REF_VALIDATION'); + + return h_radio('config[referer_validation]', $radio_ary, $value, $key); + } + + /** + * Select account activation method + */ + function select_acc_activation($selected_value, $value) + { + global $user, $config; + + $act_ary = array( + 'ACC_DISABLE' => array(true, USER_ACTIVATION_DISABLE), + 'ACC_NONE' => array(true, USER_ACTIVATION_NONE), + 'ACC_USER' => array($config['email_enable'], USER_ACTIVATION_SELF), + 'ACC_ADMIN' => array($config['email_enable'], USER_ACTIVATION_ADMIN), + ); + + $act_options = ''; + foreach ($act_ary as $key => $data) + { + list($available, $value) = $data; + $selected = ($selected_value == $value) ? ' selected="selected"' : ''; + $class = (!$available) ? ' class="disabled-option"' : ''; + $act_options .= ''; + } + + return $act_options; + } + + /** + * Maximum/Minimum username length + */ + function username_length($value, $key = '') + { + global $user; + + return ' ' . $user->lang['MIN_CHARS'] . '   ' . $user->lang['MAX_CHARS']; + } + + /** + * Allowed chars in usernames + */ + function select_username_chars($selected_value, $key) + { + global $user; + + $user_char_ary = array('USERNAME_CHARS_ANY', 'USERNAME_ALPHA_ONLY', 'USERNAME_ALPHA_SPACERS', 'USERNAME_LETTER_NUM', 'USERNAME_LETTER_NUM_SPACERS', 'USERNAME_ASCII'); + $user_char_options = ''; + foreach ($user_char_ary as $user_type) + { + $selected = ($selected_value == $user_type) ? ' selected="selected"' : ''; + $user_char_options .= ''; + } + + return $user_char_options; + } + + /** + * Maximum/Minimum password length + */ + function password_length($value, $key) + { + global $user; + + return ' ' . $user->lang['MIN_CHARS'] . '   ' . $user->lang['MAX_CHARS']; + } + + /** + * Required chars in passwords + */ + function select_password_chars($selected_value, $key) + { + global $user; + + $pass_type_ary = array('PASS_TYPE_ANY', 'PASS_TYPE_CASE', 'PASS_TYPE_ALPHA', 'PASS_TYPE_SYMBOL'); + $pass_char_options = ''; + foreach ($pass_type_ary as $pass_type) + { + $selected = ($selected_value == $pass_type) ? ' selected="selected"' : ''; + $pass_char_options .= ''; + } + + return $pass_char_options; + } + + /** + * Select bump interval + */ + function bump_interval($value, $key) + { + global $user; + + $s_bump_type = ''; + $types = array('m' => 'MINUTES', 'h' => 'HOURS', 'd' => 'DAYS'); + foreach ($types as $type => $lang) + { + $selected = ($this->new_config['bump_type'] == $type) ? ' selected="selected"' : ''; + $s_bump_type .= ''; + } + + return ' '; + } + + /** + * Board disable option and message + */ + function board_disable($value, $key) + { + global $user; + + $radio_ary = array(1 => 'YES', 0 => 'NO'); + + return h_radio('config[board_disable]', $radio_ary, $value) . '
'; + } + + /** + * Global quick reply enable/disable setting and button to enable in all forums + */ + function quick_reply($value, $key) + { + global $user; + + $radio_ary = array(1 => 'YES', 0 => 'NO'); + + return h_radio('config[allow_quick_reply]', $radio_ary, $value) . + '

'; + } + + /** + * Select guest timezone + */ + function timezone_select($value, $key) + { + global $template, $user; + + $timezone_select = phpbb_timezone_select($template, $user, $value, true); + + return ''; + } + + /** + * Get guest style + */ + public function guest_style_get() + { + global $db; + + $sql = 'SELECT user_style + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . ANONYMOUS; + $result = $db->sql_query($sql); + + $style = (int) $db->sql_fetchfield('user_style'); + $db->sql_freeresult($result); + + return $style; + } + + /** + * Set guest style + * + * @param int $style_id The style ID + */ + public function guest_style_set($style_id) + { + global $db; + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_style = ' . (int) $style_id . ' + WHERE user_id = ' . ANONYMOUS; + $db->sql_query($sql); + } + + /** + * Select default dateformat + */ + function dateformat_select($value, $key) + { + global $user, $config; + + // Let the format_date function operate with the acp values + $old_tz = $user->timezone; + try + { + $user->timezone = new DateTimeZone($config['board_timezone']); + } + catch (\Exception $e) + { + // If the board timezone is invalid, we just use the users timezone. + } + + $dateformat_options = ''; + + foreach ($user->lang['dateformats'] as $format => $null) + { + $dateformat_options .= ''; + } + + $dateformat_options .= ''; + + // Reset users date options + $user->timezone = $old_tz; + + return " + "; + } + + /** + * Select multiple forums + */ + function select_news_forums($value, $key) + { + global $user, $config; + + $forum_list = make_forum_select(false, false, true, true, true, false, true); + + // Build forum options + $s_forum_options = ''; + + return $s_forum_options; + } + + function select_exclude_forums($value, $key) + { + global $user, $config; + + $forum_list = make_forum_select(false, false, true, true, true, false, true); + + // Build forum options + $s_forum_options = ''; + + return $s_forum_options; + } + + function store_feed_forums($option, $key) + { + global $db, $cache; + + // Get key + $values = request_var($key, array(0 => 0)); + + // Empty option bit for all forums + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET forum_options = forum_options - ' . (1 << $option) . ' + WHERE ' . $db->sql_bit_and('forum_options', $option, '<> 0'); + $db->sql_query($sql); + + // Already emptied for all... + if (sizeof($values)) + { + // Set for selected forums + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET forum_options = forum_options + ' . (1 << $option) . ' + WHERE ' . $db->sql_in_set('forum_id', $values); + $db->sql_query($sql); + } + + // Empty sql cache for forums table because options changed + $cache->destroy('sql', FORUMS_TABLE); + } + + /** + * Option to enable/disable removal of 'app.php' from URLs + * + * Note that if mod_rewrite is on, URLs without app.php will still work, + * but any paths generated by the controller helper url() method will not + * contain app.php. + * + * @param int $value The current config value + * @param string $key The config key + * @return string The HTML for the form field + */ + function enable_mod_rewrite($value, $key) + { + global $user, $config; + + // Determine whether mod_rewrite is enabled on the server + // NOTE: This only works on Apache servers on which PHP is NOT + // installed as CGI. In that case, there is no way for PHP to + // determine whether or not the Apache module is enabled. + // + // To be clear on the value of $mod_rewite: + // null = Cannot determine whether or not the server has mod_rewrite + // enabled + // false = Can determine that the server does NOT have mod_rewrite + // enabled + // true = Can determine that the server DOES have mod_rewrite_enabled + $mod_rewrite = null; + if (function_exists('apache_get_modules')) + { + $mod_rewrite = (bool) in_array('mod_rewrite', apache_get_modules()); + } + + // If $message is false, mod_rewrite is enabled. + // Otherwise, it is not and we need to: + // 1) disable the form field + // 2) make sure the config value is set to 0 + // 3) append the message to the return + $value = ($mod_rewrite === false) ? 0 : $value; + $message = $mod_rewrite === null ? 'MOD_REWRITE_INFORMATION_UNAVAILABLE' : ($mod_rewrite === false ? 'MOD_REWRITE_DISABLED' : false); + + // Let's do some friendly HTML injection if we want to disable the + // form field because h_radio() has no pretty way of doing so + $field_name = 'config[enable_mod_rewrite]' . ($message === 'MOD_REWRITE_DISABLED' ? '" disabled="disabled' : ''); + + return h_radio($field_name, array(1 => 'YES', 0 => 'NO'), $value) . + ($message !== false ? '
' . $user->lang($message) . '' : ''); + } +} diff --git a/sources/phpBB/includes/acp/acp_bots.php b/sources/phpBB/includes/acp/acp_bots.php new file mode 100644 index 0000000..1ea320e --- /dev/null +++ b/sources/phpBB/includes/acp/acp_bots.php @@ -0,0 +1,423 @@ + +* @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; +} + +class acp_bots +{ + var $u_action; + + function main($id, $mode) + { + global $config, $db, $user, $auth, $template, $cache, $request; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; + + $action = request_var('action', ''); + $submit = (isset($_POST['submit'])) ? true : false; + $mark = request_var('mark', array(0)); + $bot_id = request_var('id', 0); + + if (isset($_POST['add'])) + { + $action = 'add'; + } + + $error = array(); + + $user->add_lang('acp/bots'); + $this->tpl_name = 'acp_bots'; + $this->page_title = 'ACP_BOTS'; + $form_key = 'acp_bots'; + add_form_key($form_key); + + if ($submit && !check_form_key($form_key)) + { + $error[] = $user->lang['FORM_INVALID']; + } + + // User wants to do something, how inconsiderate of them! + switch ($action) + { + case 'activate': + if ($bot_id || sizeof($mark)) + { + $sql_id = ($bot_id) ? " = $bot_id" : ' IN (' . implode(', ', $mark) . ')'; + + $sql = 'UPDATE ' . BOTS_TABLE . " + SET bot_active = 1 + WHERE bot_id $sql_id"; + $db->sql_query($sql); + } + + $cache->destroy('_bots'); + break; + + case 'deactivate': + if ($bot_id || sizeof($mark)) + { + $sql_id = ($bot_id) ? " = $bot_id" : ' IN (' . implode(', ', $mark) . ')'; + + $sql = 'UPDATE ' . BOTS_TABLE . " + SET bot_active = 0 + WHERE bot_id $sql_id"; + $db->sql_query($sql); + } + + $cache->destroy('_bots'); + break; + + case 'delete': + if ($bot_id || sizeof($mark)) + { + if (confirm_box(true)) + { + // We need to delete the relevant user, usergroup and bot entries ... + $sql_id = ($bot_id) ? " = $bot_id" : ' IN (' . implode(', ', $mark) . ')'; + + $sql = 'SELECT bot_name, user_id + FROM ' . BOTS_TABLE . " + WHERE bot_id $sql_id"; + $result = $db->sql_query($sql); + + $user_id_ary = $bot_name_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $user_id_ary[] = (int) $row['user_id']; + $bot_name_ary[] = $row['bot_name']; + } + $db->sql_freeresult($result); + + $db->sql_transaction('begin'); + + $sql = 'DELETE FROM ' . BOTS_TABLE . " + WHERE bot_id $sql_id"; + $db->sql_query($sql); + + if (sizeof($user_id_ary)) + { + $_tables = array(USERS_TABLE, USER_GROUP_TABLE); + foreach ($_tables as $table) + { + $sql = "DELETE FROM $table + WHERE " . $db->sql_in_set('user_id', $user_id_ary); + $db->sql_query($sql); + } + } + + $db->sql_transaction('commit'); + + $cache->destroy('_bots'); + + add_log('admin', 'LOG_BOT_DELETE', implode(', ', $bot_name_ary)); + trigger_error($user->lang['BOT_DELETED'] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'mark' => $mark, + 'id' => $bot_id, + 'mode' => $mode, + 'action' => $action)) + ); + } + } + break; + + case 'edit': + case 'add': + 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']), + ); + + if ($submit) + { + if (!$bot_row['bot_agent'] && !$bot_row['bot_ip']) + { + $error[] = $user->lang['ERR_BOT_NO_MATCHES']; + } + + if ($bot_row['bot_ip'] && !preg_match('#^[\d\.,:]+$#', $bot_row['bot_ip'])) + { + if (!$ip_list = gethostbynamel($bot_row['bot_ip'])) + { + $error[] = $user->lang['ERR_BOT_NO_IP']; + } + else + { + $bot_row['bot_ip'] = implode(',', $ip_list); + } + } + $bot_row['bot_ip'] = str_replace(' ', '', $bot_row['bot_ip']); + + // Make sure the admin is not adding a bot with an user agent similar to his one + if ($bot_row['bot_agent'] && substr($user->data['session_browser'], 0, 149) === substr($bot_row['bot_agent'], 0, 149)) + { + $error[] = $user->lang['ERR_BOT_AGENT_MATCHES_UA']; + } + + $bot_name = false; + if ($bot_id) + { + $sql = 'SELECT u.username_clean + FROM ' . BOTS_TABLE . ' b, ' . USERS_TABLE . " u + WHERE b.bot_id = $bot_id + AND u.user_id = b.user_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$bot_row) + { + $error[] = $user->lang['NO_BOT']; + } + else + { + $bot_name = $row['username_clean']; + } + } + if (!$this->validate_botname($bot_row['bot_name'], $bot_name)) + { + $error[] = $user->lang['BOT_NAME_TAKEN']; + } + + if (!sizeof($error)) + { + // New bot? Create a new user and group entry + if ($action == 'add') + { + $sql = 'SELECT group_id, group_colour + FROM ' . GROUPS_TABLE . " + WHERE group_name = 'BOTS' + AND group_type = " . GROUP_SPECIAL; + $result = $db->sql_query($sql); + $group_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$group_row) + { + trigger_error($user->lang['NO_BOT_GROUP'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"), E_USER_WARNING); + } + + $user_id = user_add(array( + 'user_type' => (int) USER_IGNORE, + 'group_id' => (int) $group_row['group_id'], + 'username' => (string) $bot_row['bot_name'], + 'user_regdate' => time(), + 'user_password' => '', + 'user_colour' => (string) $group_row['group_colour'], + 'user_email' => '', + 'user_lang' => (string) $bot_row['bot_lang'], + 'user_style' => (int) $bot_row['bot_style'], + 'user_allow_massemail' => 0, + )); + + $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'user_id' => (int) $user_id, + 'bot_name' => (string) $bot_row['bot_name'], + 'bot_active' => (int) $bot_row['bot_active'], + 'bot_agent' => (string) $bot_row['bot_agent'], + 'bot_ip' => (string) $bot_row['bot_ip']) + ); + $db->sql_query($sql); + + $log = 'ADDED'; + } + else if ($bot_id) + { + $sql = 'SELECT user_id, bot_name + FROM ' . BOTS_TABLE . " + WHERE bot_id = $bot_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"), E_USER_WARNING); + } + + $sql_ary = array( + 'user_style' => (int) $bot_row['bot_style'], + 'user_lang' => (string) $bot_row['bot_lang'], + ); + + if ($bot_row['bot_name'] !== $row['bot_name']) + { + $sql_ary['username'] = (string) $bot_row['bot_name']; + $sql_ary['username_clean'] = (string) utf8_clean_string($bot_row['bot_name']); + } + + $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE user_id = {$row['user_id']}"; + $db->sql_query($sql); + + $sql = 'UPDATE ' . BOTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( + 'bot_name' => (string) $bot_row['bot_name'], + 'bot_active' => (int) $bot_row['bot_active'], + 'bot_agent' => (string) $bot_row['bot_agent'], + 'bot_ip' => (string) $bot_row['bot_ip']) + ) . " WHERE bot_id = $bot_id"; + $db->sql_query($sql); + + // Updated username? + if ($bot_row['bot_name'] !== $row['bot_name']) + { + user_update_name($row['bot_name'], $bot_row['bot_name']); + } + + $log = 'UPDATED'; + } + + $cache->destroy('_bots'); + + add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']); + trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action)); + + } + } + else if ($bot_id) + { + $sql = 'SELECT b.*, u.user_lang, u.user_style + FROM ' . BOTS_TABLE . ' b, ' . USERS_TABLE . " u + WHERE b.bot_id = $bot_id + AND u.user_id = b.user_id"; + $result = $db->sql_query($sql); + $bot_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$bot_row) + { + trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"), E_USER_WARNING); + } + + $bot_row['bot_lang'] = $bot_row['user_lang']; + $bot_row['bot_style'] = $bot_row['user_style']; + unset($bot_row['user_lang'], $bot_row['user_style']); + } + + $s_active_options = ''; + $_options = array('0' => 'NO', '1' => 'YES'); + foreach ($_options as $value => $lang) + { + $selected = ($bot_row['bot_active'] == $value) ? ' selected="selected"' : ''; + $s_active_options .= ''; + } + + $style_select = style_select($bot_row['bot_style'], true); + $lang_select = language_select($bot_row['bot_lang']); + + $l_title = ($action == 'edit') ? 'EDIT' : 'ADD'; + + $template->assign_vars(array( + 'L_TITLE' => $user->lang['BOT_' . $l_title], + 'U_ACTION' => $this->u_action . "&id=$bot_id&action=$action", + 'U_BACK' => $this->u_action, + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', + + 'BOT_NAME' => $bot_row['bot_name'], + 'BOT_IP' => $bot_row['bot_ip'], + 'BOT_AGENT' => $bot_row['bot_agent'], + + 'S_EDIT_BOT' => true, + 'S_ACTIVE_OPTIONS' => $s_active_options, + 'S_STYLE_OPTIONS' => $style_select, + 'S_LANG_OPTIONS' => $lang_select, + 'S_ERROR' => (sizeof($error)) ? true : false, + ) + ); + + return; + + break; + } + + if ($request->is_ajax() && ($action == 'activate' || $action == 'deactivate')) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'text' => $user->lang['BOT_' . (($action == 'activate') ? 'DE' : '') . 'ACTIVATE'], + )); + } + + $s_options = ''; + $_options = array('activate' => 'BOT_ACTIVATE', 'deactivate' => 'BOT_DEACTIVATE', 'delete' => 'DELETE'); + foreach ($_options as $value => $lang) + { + $s_options .= ''; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'S_BOT_OPTIONS' => $s_options) + ); + + $sql = 'SELECT b.bot_id, b.bot_name, b.bot_active, u.user_lastvisit + FROM ' . BOTS_TABLE . ' b, ' . USERS_TABLE . ' u + WHERE u.user_id = b.user_id + ORDER BY u.user_lastvisit DESC, b.bot_name ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $active_lang = (!$row['bot_active']) ? 'BOT_ACTIVATE' : 'BOT_DEACTIVATE'; + $active_value = (!$row['bot_active']) ? 'activate' : 'deactivate'; + + $template->assign_block_vars('bots', array( + 'BOT_NAME' => $row['bot_name'], + 'BOT_ID' => $row['bot_id'], + 'LAST_VISIT' => ($row['user_lastvisit']) ? $user->format_date($row['user_lastvisit']) : $user->lang['BOT_NEVER'], + + 'U_ACTIVATE_DEACTIVATE' => $this->u_action . "&id={$row['bot_id']}&action=$active_value", + 'L_ACTIVATE_DEACTIVATE' => $user->lang[$active_lang], + 'U_EDIT' => $this->u_action . "&id={$row['bot_id']}&action=edit", + 'U_DELETE' => $this->u_action . "&id={$row['bot_id']}&action=delete") + ); + } + $db->sql_freeresult($result); + } + + /** + * Validate bot name against username table + */ + function validate_botname($newname, $oldname = false) + { + global $db; + + if ($oldname && utf8_clean_string($newname) === $oldname) + { + return true; + } + + // Admins might want to use names otherwise forbidden, thus we only check for duplicates. + $sql = 'SELECT username + FROM ' . USERS_TABLE . " + WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($newname)) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + return ($row) ? false : true; + } +} diff --git a/sources/phpBB/includes/acp/acp_captcha.php b/sources/phpBB/includes/acp/acp_captcha.php new file mode 100644 index 0000000..fa8d8fb --- /dev/null +++ b/sources/phpBB/includes/acp/acp_captcha.php @@ -0,0 +1,148 @@ + +* @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; +} + +class acp_captcha +{ + var $u_action; + + function main($id, $mode) + { + global $db, $user, $auth, $template; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container; + + $user->add_lang('acp/board'); + + $factory = $phpbb_container->get('captcha.factory'); + $captchas = $factory->get_captcha_types(); + + $selected = request_var('select_captcha', $config['captcha_plugin']); + $selected = (isset($captchas['available'][$selected]) || isset($captchas['unavailable'][$selected])) ? $selected : $config['captcha_plugin']; + $configure = request_var('configure', false); + + // Oh, they are just here for the view + if (isset($_GET['captcha_demo'])) + { + $this->deliver_demo($selected); + } + + // Delegate + if ($configure) + { + $config_captcha = $factory->get_instance($selected); + $config_captcha->acp_page($id, $this); + } + else + { + $config_vars = array( + 'enable_confirm' => array('tpl' => 'REG_ENABLE', 'default' => false), + 'enable_post_confirm' => array('tpl' => 'POST_ENABLE', 'default' => false), + 'confirm_refresh' => array('tpl' => 'CONFIRM_REFRESH', 'default' => false), + 'max_reg_attempts' => array('tpl' => 'REG_LIMIT', 'default' => 0), + 'max_login_attempts' => array('tpl' => 'MAX_LOGIN_ATTEMPTS', 'default' => 0), + ); + + $this->tpl_name = 'acp_captcha'; + $this->page_title = 'ACP_VC_SETTINGS'; + $form_key = 'acp_captcha'; + add_form_key($form_key); + + $submit = request_var('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'])); + } + + if ($selected !== $config['captcha_plugin']) + { + // sanity check + if (isset($captchas['available'][$selected])) + { + $old_captcha = $factory->get_instance($config['captcha_plugin']); + $old_captcha->uninstall(); + + set_config('captcha_plugin', $selected); + $new_captcha = $factory->get_instance($config['captcha_plugin']); + $new_captcha->install(); + + add_log('admin', 'LOG_CONFIG_VISUAL'); + } + else + { + trigger_error($user->lang['CAPTCHA_UNAVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); + } + else if ($submit) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + else + { + $captcha_select = ''; + foreach ($captchas['available'] as $value => $title) + { + $current = ($selected !== false && $value == $selected) ? ' selected="selected"' : ''; + $captcha_select .= ''; + } + + foreach ($captchas['unavailable'] as $value => $title) + { + $current = ($selected !== false && $value == $selected) ? ' selected="selected"' : ''; + $captcha_select .= ''; + } + + $demo_captcha = $factory->get_instance($selected); + + 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_vars(array( + 'CAPTCHA_PREVIEW_TPL' => $demo_captcha->get_demo_template($id), + 'S_CAPTCHA_HAS_CONFIG' => $demo_captcha->has_config(), + 'CAPTCHA_SELECT' => $captcha_select, + + 'U_ACTION' => $this->u_action, + )); + } + } + } + + /** + * Entry point for delivering image CAPTCHAs in the ACP. + */ + function deliver_demo($selected) + { + global $db, $user, $config, $phpbb_container; + + $captcha = $phpbb_container->get('captcha.factory')->get_instance($selected); + $captcha->init(CONFIRM_REG); + $captcha->execute_demo(); + + garbage_collection(); + exit_handler(); + } +} diff --git a/sources/phpBB/includes/acp/acp_contact.php b/sources/phpBB/includes/acp/acp_contact.php new file mode 100644 index 0000000..4e46df2 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_contact.php @@ -0,0 +1,134 @@ + +* @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; +} + +/** +* @package acp +*/ +class acp_contact +{ + public $u_action; + + public function main($id, $mode) + { + global $user, $request, $template; + global $config, $phpbb_root_path, $phpEx, $phpbb_container; + + $user->add_lang(array('acp/board', 'posting')); + + $this->tpl_name = 'acp_contact'; + $this->page_title = 'ACP_CONTACT_SETTINGS'; + $form_name = 'acp_contact'; + add_form_key($form_name); + $error = ''; + + if (!function_exists('display_custom_bbcodes')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } + if (!class_exists('parse_message')) + { + include($phpbb_root_path . 'includes/message_parser.' . $phpEx); + } + + $config_text = $phpbb_container->get('config_text'); + + $contact_admin_data = $config_text->get_array(array( + 'contact_admin_info', + 'contact_admin_info_uid', + 'contact_admin_info_bitfield', + 'contact_admin_info_flags', + )); + + $contact_admin_info = $contact_admin_data['contact_admin_info']; + $contact_admin_info_uid = $contact_admin_data['contact_admin_info_uid']; + $contact_admin_info_bitfield= $contact_admin_data['contact_admin_info_bitfield']; + $contact_admin_info_flags = $contact_admin_data['contact_admin_info_flags']; + + if ($request->is_set_post('submit') || $request->is_set_post('preview')) + { + if (!check_form_key($form_name)) + { + $error = $user->lang('FORM_INVALID'); + } + + $contact_admin_info = $request->variable('contact_admin_info', '', true); + + generate_text_for_storage( + $contact_admin_info, + $contact_admin_info_uid, + $contact_admin_info_bitfield, + $contact_admin_info_flags, + !$request->variable('disable_bbcode', false), + !$request->variable('disable_magic_url', false), + !$request->variable('disable_smilies', false) + ); + + if (empty($error) && $request->is_set_post('submit')) + { + $config->set('contact_admin_form_enable', $request->variable('contact_admin_form_enable', false)); + + $config_text->set_array(array( + 'contact_admin_info' => $contact_admin_info, + 'contact_admin_info_uid' => $contact_admin_info_uid, + 'contact_admin_info_bitfield' => $contact_admin_info_bitfield, + 'contact_admin_info_flags' => $contact_admin_info_flags, + )); + + trigger_error($user->lang['CONTACT_US_INFO_UPDATED'] . adm_back_link($this->u_action)); + } + } + + $contact_admin_info_preview = ''; + if ($request->is_set_post('preview')) + { + $contact_admin_info_preview = generate_text_for_display($contact_admin_info, $contact_admin_info_uid, $contact_admin_info_bitfield, $contact_admin_info_flags); + } + + $contact_admin_edit = generate_text_for_edit($contact_admin_info, $contact_admin_info_uid, $contact_admin_info_flags); + + $template->assign_vars(array( + 'ERRORS' => $error, + 'CONTACT_ENABLED' => $config['contact_admin_form_enable'], + + 'CONTACT_US_INFO' => $contact_admin_edit['text'], + 'CONTACT_US_INFO_PREVIEW' => $contact_admin_info_preview, + + 'S_BBCODE_DISABLE_CHECKED' => !$contact_admin_edit['allow_bbcode'], + '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', '', ''), + 'SMILIES_STATUS' => $user->lang['SMILIES_ARE_ON'], + 'IMG_STATUS' => $user->lang['IMAGES_ARE_ON'], + 'FLASH_STATUS' => $user->lang['FLASH_IS_ON'], + 'URL_STATUS' => $user->lang['URL_IS_ON'], + + 'S_BBCODE_ALLOWED' => true, + 'S_SMILIES_ALLOWED' => true, + 'S_BBCODE_IMG' => true, + 'S_BBCODE_FLASH' => true, + 'S_LINKS_ALLOWED' => true, + )); + + // Assigning custom bbcodes + display_custom_bbcodes(); + } +} diff --git a/sources/phpBB/includes/acp/acp_database.php b/sources/phpBB/includes/acp/acp_database.php new file mode 100644 index 0000000..0c52f82 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_database.php @@ -0,0 +1,2268 @@ + +* @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; +} + +class acp_database +{ + var $db_tools; + var $u_action; + + function main($id, $mode) + { + global $cache, $db, $user, $auth, $template, $table_prefix; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $this->db_tools = new \phpbb\db\tools($db); + + $user->add_lang('acp/database'); + + $this->tpl_name = 'acp_database'; + $this->page_title = 'ACP_DATABASE'; + + $action = request_var('action', ''); + $submit = (isset($_POST['submit'])) ? true : false; + + $template->assign_vars(array( + 'MODE' => $mode + )); + + switch ($mode) + { + case 'backup': + + $this->page_title = 'ACP_BACKUP'; + + 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', ''); + + if (!sizeof($table)) + { + trigger_error($user->lang['TABLE_SELECT_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $store = $download = $structure = $schema_data = false; + + if ($where == 'store_and_download' || $where == 'store') + { + $store = true; + } + + if ($where == 'store_and_download' || $where == 'download') + { + $download = true; + } + + if ($type == 'full' || $type == 'structure') + { + $structure = true; + } + + if ($type == 'full' || $type == 'data') + { + $schema_data = true; + } + + @set_time_limit(1200); + @set_time_limit(0); + + $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->write_start($table_prefix); + + foreach ($table as $table_name) + { + // Get the table structure + if ($structure) + { + $extractor->write_table($table_name); + } + else + { + // We might wanna empty out all that junk :D + switch ($db->get_sql_layer()) + { + case 'sqlite': + case 'sqlite3': + $extractor->flush('DELETE FROM ' . $table_name . ";\n"); + break; + + case 'mssql': + case 'mssql_odbc': + case 'mssqlnative': + $extractor->flush('TRUNCATE TABLE ' . $table_name . "GO\n"); + break; + + case 'oracle': + $extractor->flush('TRUNCATE TABLE ' . $table_name . "/\n"); + break; + + default: + $extractor->flush('TRUNCATE TABLE ' . $table_name . ";\n"); + break; + } + } + + // Data + if ($schema_data) + { + $extractor->write_data($table_name); + } + } + + $extractor->write_end(); + + add_log('admin', 'LOG_DB_BACKUP'); + + if ($download == true) + { + exit; + } + + trigger_error($user->lang['BACKUP_SUCCESS'] . adm_back_link($this->u_action)); + break; + + default: + $tables = $this->db_tools->sql_list_tables(); + asort($tables); + foreach ($tables as $table_name) + { + if (strlen($table_prefix) === 0 || stripos($table_name, $table_prefix) === 0) + { + $template->assign_block_vars('tables', array( + 'TABLE' => $table_name + )); + } + } + unset($tables); + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action . '&action=download' + )); + + $available_methods = array('gzip' => 'zlib', 'bzip2' => 'bz2'); + + foreach ($available_methods as $type => $module) + { + if (!@extension_loaded($module)) + { + continue; + } + + $template->assign_block_vars('methods', array( + 'TYPE' => $type + )); + } + + $template->assign_block_vars('methods', array( + 'TYPE' => 'text' + )); + break; + } + break; + + case 'restore': + + $this->page_title = 'ACP_RESTORE'; + + switch ($action) + { + case 'submit': + $delete = request_var('delete', ''); + $file = request_var('file', ''); + $download = request_var('download', ''); + + if (!preg_match('#^backup_\d{10,}_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches)) + { + trigger_error($user->lang['BACKUP_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $file_name = $phpbb_root_path . 'store/' . $matches[0]; + + if (!file_exists($file_name) || !is_readable($file_name)) + { + trigger_error($user->lang['BACKUP_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if ($delete) + { + if (confirm_box(true)) + { + unlink($file_name); + add_log('admin', 'LOG_DB_DELETE'); + trigger_error($user->lang['BACKUP_DELETE'] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, $user->lang['DELETE_SELECTED_BACKUP'], build_hidden_fields(array('delete' => $delete, 'file' => $file))); + } + } + else if ($download || confirm_box(true)) + { + if ($download) + { + $name = $matches[0]; + + switch ($matches[1]) + { + case 'sql': + $mimetype = 'text/x-sql'; + break; + case 'sql.bz2': + $mimetype = 'application/x-bzip2'; + break; + case 'sql.gz': + $mimetype = 'application/x-gzip'; + break; + } + + header('Cache-Control: private, no-cache'); + header("Content-Type: $mimetype; name=\"$name\""); + header("Content-disposition: attachment; filename=$name"); + + @set_time_limit(0); + + $fp = @fopen($file_name, 'rb'); + + if ($fp !== false) + { + while (!feof($fp)) + { + echo fread($fp, 8192); + } + fclose($fp); + } + + flush(); + exit; + } + + switch ($matches[1]) + { + case 'sql': + $fp = fopen($file_name, 'rb'); + $read = 'fread'; + $seek = 'fseek'; + $eof = 'feof'; + $close = 'fclose'; + $fgetd = 'fgetd'; + break; + + case 'sql.bz2': + $fp = bzopen($file_name, 'r'); + $read = 'bzread'; + $seek = ''; + $eof = 'feof'; + $close = 'bzclose'; + $fgetd = 'fgetd_seekless'; + break; + + case 'sql.gz': + $fp = gzopen($file_name, 'rb'); + $read = 'gzread'; + $seek = 'gzseek'; + $eof = 'gzeof'; + $close = 'gzclose'; + $fgetd = 'fgetd'; + break; + } + + switch ($db->get_sql_layer()) + { + case 'mysql': + case 'mysql4': + case 'mysqli': + case 'sqlite': + case 'sqlite3': + while (($sql = $fgetd($fp, ";\n", $read, $seek, $eof)) !== false) + { + $db->sql_query($sql); + } + break; + + case 'postgres': + $delim = ";\n"; + while (($sql = $fgetd($fp, $delim, $read, $seek, $eof)) !== false) + { + $query = trim($sql); + + if (substr($query, 0, 13) == 'CREATE DOMAIN') + { + list(, , $domain) = explode(' ', $query); + $sql = "SELECT domain_name + FROM information_schema.domains + WHERE domain_name = '$domain';"; + $result = $db->sql_query($sql); + if (!$db->sql_fetchrow($result)) + { + $db->sql_query($query); + } + $db->sql_freeresult($result); + } + else + { + $db->sql_query($query); + } + + if (substr($query, 0, 4) == 'COPY') + { + while (($sub = $fgetd($fp, "\n", $read, $seek, $eof)) !== '\.') + { + if ($sub === false) + { + trigger_error($user->lang['RESTORE_FAILURE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + pg_put_line($db->get_db_connect_id(), $sub . "\n"); + } + pg_put_line($db->get_db_connect_id(), "\\.\n"); + pg_end_copy($db->get_db_connect_id()); + } + } + break; + + case 'oracle': + while (($sql = $fgetd($fp, "/\n", $read, $seek, $eof)) !== false) + { + $db->sql_query($sql); + } + break; + + case 'mssql': + case 'mssql_odbc': + case 'mssqlnative': + while (($sql = $fgetd($fp, "GO\n", $read, $seek, $eof)) !== false) + { + $db->sql_query($sql); + } + break; + } + + $close($fp); + + // Purge the cache due to updated data + $cache->purge(); + + add_log('admin', 'LOG_DB_RESTORE'); + trigger_error($user->lang['RESTORE_SUCCESS'] . adm_back_link($this->u_action)); + break; + } + else if (!$download) + { + confirm_box(false, $user->lang['RESTORE_SELECTED_BACKUP'], build_hidden_fields(array('file' => $file))); + } + + default: + $methods = array('sql'); + $available_methods = array('sql.gz' => 'zlib', 'sql.bz2' => 'bz2'); + + foreach ($available_methods as $type => $module) + { + if (!@extension_loaded($module)) + { + continue; + } + $methods[] = $type; + } + + $dir = $phpbb_root_path . 'store/'; + $dh = @opendir($dir); + + $backup_files = array(); + + if ($dh) + { + while (($file = readdir($dh)) !== false) + { + if (preg_match('#^backup_(\d{10,})_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches)) + { + if (in_array($matches[2], $methods)) + { + $backup_files[(int) $matches[1]] = $file; + } + } + } + closedir($dh); + } + + if (!empty($backup_files)) + { + krsort($backup_files); + + foreach ($backup_files as $name => $file) + { + $template->assign_block_vars('files', array( + 'FILE' => $file, + 'NAME' => $user->format_date($name, 'd-m-Y H:i:s', true), + 'SUPPORTED' => true, + )); + } + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action . '&action=submit' + )); + break; + } + break; + } + } +} + +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"); + } + } + + $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() +{ + $val = trim(@ini_get('memory_limit')); + + if (preg_match('/(\\d+)([mkg]?)/i', $val, $regs)) + { + $memory_limit = (int) $regs[1]; + switch ($regs[2]) + { + + case 'k': + case 'K': + $memory_limit *= 1024; + break; + + case 'm': + case 'M': + $memory_limit *= 1048576; + break; + + case 'g': + case 'G': + $memory_limit *= 1073741824; + break; + } + + // how much memory PHP requires at the start of export (it is really a little less) + if ($memory_limit > 6100000) + { + $memory_limit -= 6100000; + } + + // allow us to consume half of the total memory available + $memory_limit /= 2; + } + else + { + // set the buffer to 1M if we have no clue how much memory PHP will give us :P + $memory_limit = 1048576; + } + + return $memory_limit; +} + +function sanitize_data_mssql($text) +{ + $data = preg_split('/[\n\t\r\b\f]/', $text); + preg_match_all('/[\n\t\r\b\f]/', $text, $matches); + + $val = array(); + + foreach ($data as $value) + { + if (strlen($value)) + { + $val[] = "'" . $value . "'"; + } + if (sizeof($matches[0])) + { + $val[] = 'char(' . ord(array_shift($matches[0])) . ')'; + } + } + + return implode('+', $val); +} + +function sanitize_data_oracle($text) +{ +// $data = preg_split('/[\0\n\t\r\b\f\'"\/\\\]/', $text); +// preg_match_all('/[\0\n\t\r\b\f\'"\/\\\]/', $text, $matches); + $data = preg_split('/[\0\b\f\'\/]/', $text); + preg_match_all('/[\0\r\b\f\'\/]/', $text, $matches); + + $val = array(); + + foreach ($data as $value) + { + if (strlen($value)) + { + $val[] = "'" . $value . "'"; + } + if (sizeof($matches[0])) + { + $val[] = 'chr(' . ord(array_shift($matches[0])) . ')'; + } + } + + return implode('||', $val); +} + +function sanitize_data_generic($text) +{ + $data = preg_split('/[\n\t\r\b\f]/', $text); + preg_match_all('/[\n\t\r\b\f]/', $text, $matches); + + $val = array(); + + foreach ($data as $value) + { + if (strlen($value)) + { + $val[] = "'" . $value . "'"; + } + if (sizeof($matches[0])) + { + $val[] = "'" . array_shift($matches[0]) . "'"; + } + } + + return implode('||', $val); +} + +// modified from PHP.net +function fgetd(&$fp, $delim, $read, $seek, $eof, $buffer = 8192) +{ + $record = ''; + $delim_len = strlen($delim); + + while (!$eof($fp)) + { + $pos = strpos($record, $delim); + if ($pos === false) + { + $record .= $read($fp, $buffer); + if ($eof($fp) && ($pos = strpos($record, $delim)) !== false) + { + $seek($fp, $pos + $delim_len - strlen($record), SEEK_CUR); + return substr($record, 0, $pos); + } + } + else + { + $seek($fp, $pos + $delim_len - strlen($record), SEEK_CUR); + return substr($record, 0, $pos); + } + } + + return false; +} + +function fgetd_seekless(&$fp, $delim, $read, $seek, $eof, $buffer = 8192) +{ + static $array = array(); + static $record = ''; + + if (!sizeof($array)) + { + while (!$eof($fp)) + { + if (strpos($record, $delim) !== false) + { + $array = explode($delim, $record); + $record = array_pop($array); + break; + } + else + { + $record .= $read($fp, $buffer); + } + } + if ($eof($fp) && strpos($record, $delim) !== false) + { + $array = explode($delim, $record); + $record = array_pop($array); + } + } + + if (sizeof($array)) + { + return array_shift($array); + } + + return false; +} diff --git a/sources/phpBB/includes/acp/acp_disallow.php b/sources/phpBB/includes/acp/acp_disallow.php new file mode 100644 index 0000000..4c8f3cc --- /dev/null +++ b/sources/phpBB/includes/acp/acp_disallow.php @@ -0,0 +1,118 @@ + +* @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; +} + +class acp_disallow +{ + var $u_action; + + function main($id, $mode) + { + global $db, $user, $auth, $template, $cache; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + $user->add_lang('acp/posting'); + + // Set up general vars + $this->tpl_name = 'acp_disallow'; + $this->page_title = 'ACP_DISALLOW_USERNAMES'; + + $form_key = 'acp_disallow'; + add_form_key($form_key); + + $disallow = (isset($_POST['disallow'])) ? true : false; + $allow = (isset($_POST['allow'])) ? true : false; + + if (($allow || $disallow) && !check_form_key($form_key)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if ($disallow) + { + $disallowed_user = str_replace('*', '%', utf8_normalize_nfc(request_var('disallowed_user', '', true))); + + if (!$disallowed_user) + { + trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql = 'SELECT disallow_id + FROM ' . DISALLOW_TABLE . " + WHERE disallow_username = '" . $db->sql_escape($disallowed_user) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + trigger_error($user->lang['DISALLOWED_ALREADY'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user)); + $db->sql_query($sql); + + $cache->destroy('_disallowed_usernames'); + + $message = $user->lang['DISALLOW_SUCCESSFUL']; + add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user)); + + trigger_error($message . adm_back_link($this->u_action)); + } + else if ($allow) + { + $disallowed_id = request_var('disallowed_id', 0); + + if (!$disallowed_id) + { + trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql = 'DELETE FROM ' . DISALLOW_TABLE . ' + WHERE disallow_id = ' . $disallowed_id; + $db->sql_query($sql); + + $cache->destroy('_disallowed_usernames'); + + add_log('admin', 'LOG_DISALLOW_DELETE'); + + trigger_error($user->lang['DISALLOWED_DELETED'] . adm_back_link($this->u_action)); + } + + // Grab the current list of disallowed usernames... + $sql = 'SELECT * + FROM ' . DISALLOW_TABLE; + $result = $db->sql_query($sql); + + $disallow_select = ''; + while ($row = $db->sql_fetchrow($result)) + { + $disallow_select .= ''; + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'S_DISALLOWED_NAMES' => $disallow_select) + ); + } +} diff --git a/sources/phpBB/includes/acp/acp_email.php b/sources/phpBB/includes/acp/acp_email.php new file mode 100644 index 0000000..fcc2bd7 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_email.php @@ -0,0 +1,330 @@ + +* @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; +} + +class acp_email +{ + var $u_action; + + function main($id, $mode) + { + global $config, $db, $user, $auth, $template, $cache; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $phpbb_dispatcher; + + $user->add_lang('acp/email'); + $this->tpl_name = 'acp_email'; + $this->page_title = 'ACP_MASS_EMAIL'; + + $form_key = 'acp_email'; + add_form_key($form_key); + + // Set some vars + $submit = (isset($_POST['submit'])) ? true : false; + $error = array(); + + $usernames = request_var('usernames', '', true); + $usernames = (!empty($usernames)) ? explode("\n", $usernames) : array(); + $group_id = request_var('g', 0); + $subject = utf8_normalize_nfc(request_var('subject', '', true)); + $message = utf8_normalize_nfc(request_var('message', '', true)); + + // Do the job ... + if ($submit) + { + // 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); + + if (!check_form_key($form_key)) + { + $error[] = $user->lang['FORM_INVALID']; + } + + if (!$subject) + { + $error[] = $user->lang['NO_EMAIL_SUBJECT']; + } + + if (!$message) + { + $error[] = $user->lang['NO_EMAIL_MESSAGE']; + } + + if (!sizeof($error)) + { + if (!empty($usernames)) + { + // If giving usernames the admin is able to email inactive users too... + $sql_ary = array( + 'SELECT' => 'username, user_email, user_jabber, user_notify_type, user_lang', + 'FROM' => array( + USERS_TABLE => '', + ), + 'WHERE' => $db->sql_in_set('username_clean', array_map('utf8_clean_string', $usernames)) . ' + AND user_allow_massemail = 1', + 'ORDER_BY' => 'user_lang, user_notify_type', + ); + } + else + { + if ($group_id) + { + $sql_ary = array( + 'SELECT' => 'u.user_email, u.username, u.username_clean, u.user_lang, u.user_jabber, u.user_notify_type', + 'FROM' => array( + USERS_TABLE => 'u', + USER_GROUP_TABLE => 'ug', + ), + 'WHERE' => 'ug.group_id = ' . $group_id . ' + AND ug.user_pending = 0 + AND u.user_id = ug.user_id + AND u.user_allow_massemail = 1 + AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')', + 'ORDER_BY' => 'u.user_lang, u.user_notify_type', + ); + } + else + { + $sql_ary = array( + 'SELECT' => 'u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type', + 'FROM' => array( + USERS_TABLE => 'u', + ), + 'WHERE' => 'u.user_allow_massemail = 1 + AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')', + 'ORDER_BY' => 'u.user_lang, u.user_notify_type', + ); + } + + // Mail banned or not + if (!isset($_REQUEST['mail_banned_flag'])) + { + $sql_ary['WHERE'] .= ' AND (b.ban_id IS NULL + OR b.ban_exclude = 1)'; + $sql_ary['LEFT_JOIN'] = array( + array( + 'FROM' => array( + BANLIST_TABLE => 'b', + ), + 'ON' => 'u.user_id = b.ban_userid', + ), + ); + } + } + /** + * Modify sql query to change the list of users the email is sent to + * + * @event core.acp_email_modify_sql + * @var array sql_ary Array which is used to build the sql query + * @since 3.1.2-RC1 + */ + $vars = array('sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.acp_email_modify_sql', compact($vars))); + + $sql = $db->sql_build_query('SELECT', $sql_ary); + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + + if (!$row) + { + $db->sql_freeresult($result); + trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $i = $j = 0; + + // Send with BCC + // Maximum number of bcc recipients + $max_chunk_size = (int) $config['email_max_chunk_size']; + $email_list = array(); + $old_lang = $row['user_lang']; + $old_notify_type = $row['user_notify_type']; + + do + { + if (($row['user_notify_type'] == NOTIFY_EMAIL && $row['user_email']) || + ($row['user_notify_type'] == NOTIFY_IM && $row['user_jabber']) || + ($row['user_notify_type'] == NOTIFY_BOTH && ($row['user_email'] || $row['user_jabber']))) + { + if ($i == $max_chunk_size || $row['user_lang'] != $old_lang || $row['user_notify_type'] != $old_notify_type) + { + $i = 0; + + if (sizeof($email_list)) + { + $j++; + } + + $old_lang = $row['user_lang']; + $old_notify_type = $row['user_notify_type']; + } + + $email_list[$j][$i]['lang'] = $row['user_lang']; + $email_list[$j][$i]['method'] = $row['user_notify_type']; + $email_list[$j][$i]['email'] = $row['user_email']; + $email_list[$j][$i]['name'] = $row['username']; + $email_list[$j][$i]['jabber'] = $row['user_jabber']; + $i++; + } + } + while ($row = $db->sql_fetchrow($result)); + $db->sql_freeresult($result); + + // Send the messages + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); + $messenger = new messenger($use_queue); + + $errored = false; + + $email_template = 'admin_send_email'; + $template_data = array( + 'CONTACT_EMAIL' => phpbb_get_board_contact($config, $phpEx), + 'MESSAGE' => htmlspecialchars_decode($message), + ); + $generate_log_entry = true; + + /** + * Modify email template data before the emails are sent + * + * @event core.acp_email_send_before + * @var string email_template The template to be used for sending the email + * @var string subject The subject of the email + * @var array template_data Array with template data assigned to email template + * @var bool generate_log_entry If false, no log entry will be created + * @var array usernames Usernames which will be displayed in log entry, if it will be created + * @var int group_id The group this email will be sent to + * @var bool use_queue If true, email queue will be used for sending + * @var int priority Priority of sent emails + * @since 3.1.3-RC1 + */ + $vars = array( + 'email_template', + 'subject', + 'template_data', + 'generate_log_entry', + 'usernames', + 'group_id', + 'use_queue', + 'priority', + ); + extract($phpbb_dispatcher->trigger_event('core.acp_email_send_before', compact($vars))); + + for ($i = 0, $size = sizeof($email_list); $i < $size; $i++) + { + $used_lang = $email_list[$i][0]['lang']; + $used_method = $email_list[$i][0]['method']; + + for ($j = 0, $list_size = sizeof($email_list[$i]); $j < $list_size; $j++) + { + $email_row = $email_list[$i][$j]; + + $messenger->{((sizeof($email_list[$i]) == 1) ? 'to' : 'bcc')}($email_row['email'], $email_row['name']); + $messenger->im($email_row['jabber'], $email_row['name']); + } + + $messenger->template($email_template, $used_lang); + + $messenger->anti_abuse_headers($config, $user); + + $messenger->subject(htmlspecialchars_decode($subject)); + $messenger->set_mail_priority($priority); + + $messenger->assign_vars($template_data); + + if (!($messenger->send($used_method))) + { + $errored = true; + } + } + unset($email_list); + + $messenger->save_queue(); + + if ($generate_log_entry) + { + if (!empty($usernames)) + { + add_log('admin', 'LOG_MASS_EMAIL', implode(', ', utf8_normalize_nfc($usernames))); + } + else + { + if ($group_id) + { + $group_name = get_group_name($group_id); + } + else + { + // Not great but the logging routine doesn't cope well with localising on the fly + $group_name = $user->lang['ALL_USERS']; + } + + add_log('admin', 'LOG_MASS_EMAIL', $group_name); + } + } + + if (!$errored) + { + $message = ($use_queue) ? $user->lang['EMAIL_SENT_QUEUE'] : $user->lang['EMAIL_SENT']; + trigger_error($message . adm_back_link($this->u_action)); + } + else + { + $message = sprintf($user->lang['EMAIL_SEND_ERROR'], '', ''); + trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING); + } + } + } + + // Exclude bots and guests... + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name IN ('BOTS', 'GUESTS')"; + $result = $db->sql_query($sql); + + $exclude = array(); + while ($row = $db->sql_fetchrow($result)) + { + $exclude[] = $row['group_id']; + } + $db->sql_freeresult($result); + + $select_list = ''; + $select_list .= group_select_options($group_id, $exclude); + + $s_priority_options = ''; + $s_priority_options .= ''; + $s_priority_options .= ''; + + $template->assign_vars(array( + 'S_WARNING' => (sizeof($error)) ? true : false, + 'WARNING_MSG' => (sizeof($error)) ? implode('
', $error) : '', + 'U_ACTION' => $this->u_action, + 'S_GROUP_OPTIONS' => $select_list, + 'USERNAMES' => implode("\n", $usernames), + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_email&field=usernames'), + 'SUBJECT' => $subject, + 'MESSAGE' => $message, + 'S_PRIORITY_OPTIONS' => $s_priority_options) + ); + + } +} diff --git a/sources/phpBB/includes/acp/acp_extensions.php b/sources/phpBB/includes/acp/acp_extensions.php new file mode 100644 index 0000000..89fdc8b --- /dev/null +++ b/sources/phpBB/includes/acp/acp_extensions.php @@ -0,0 +1,555 @@ + +* @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; +} + +class acp_extensions +{ + var $u_action; + + private $db; + private $config; + private $template; + private $user; + private $cache; + private $log; + private $request; + + function main() + { + // Start the page + global $config, $user, $template, $request, $phpbb_extension_manager, $db, $phpbb_root_path, $phpEx, $phpbb_log, $cache; + + $this->db = $db; + $this->config = $config; + $this->template = $template; + $this->user = $user; + $this->cache = $cache; + $this->request = $request; + $this->log = $phpbb_log; + + $user->add_lang(array('install', 'acp/extensions', 'migrator')); + + $this->page_title = 'ACP_EXTENSIONS'; + + $action = $request->variable('action', 'list'); + $ext_name = $request->variable('ext_name', ''); + + // What is a safe limit of execution time? Half the max execution time should be safe. + $safe_time_limit = (ini_get('max_execution_time') / 2); + $start_time = time(); + + // Cancel action + if ($request->is_set_post('cancel')) + { + $action = 'list'; + $ext_name = ''; + } + + if (in_array($action, array('enable', 'disable', 'delete_data')) && !check_link_hash($request->variable('hash', ''), $action . '.' . $ext_name)) + { + trigger_error('FORM_INVALID', E_USER_WARNING); + } + + // 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); + + try + { + $md_manager->get_metadata('all'); + } + catch(\phpbb\extension\exception $e) + { + trigger_error($e, E_USER_WARNING); + } + } + + // What are we doing? + switch ($action) + { + case 'set_config_version_check_force_unstable': + $force_unstable = $this->request->variable('force_unstable', false); + + if ($force_unstable) + { + $s_hidden_fields = build_hidden_fields(array( + 'force_unstable' => $force_unstable, + )); + + confirm_box(false, $user->lang('EXTENSION_FORCE_UNSTABLE_CONFIRM'), $s_hidden_fields); + } + else + { + $config->set('extension_force_unstable', false); + trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); + } + break; + + case 'list': + default: + if (confirm_box(true)) + { + $config->set('extension_force_unstable', true); + trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); + } + + $this->list_enabled_exts($phpbb_extension_manager); + $this->list_disabled_exts($phpbb_extension_manager); + $this->list_available_exts($phpbb_extension_manager); + + $this->template->assign_vars(array( + 'U_VERSIONCHECK_FORCE' => $this->u_action . '&action=list&versioncheck_force=1', + 'FORCE_UNSTABLE' => $config['extension_force_unstable'], + 'U_ACTION' => $this->u_action, + )); + + add_form_key('version_check_settings'); + + $this->tpl_name = 'acp_ext_list'; + break; + + case 'enable_pre': + if (!$md_manager->validate_dir()) + { + trigger_error($user->lang['EXTENSION_DIR_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (!$md_manager->validate_enable()) + { + trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $extension = $phpbb_extension_manager->get_extension($ext_name); + if (!$extension->is_enableable()) + { + trigger_error($user->lang['EXTENSION_NOT_ENABLEABLE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if ($phpbb_extension_manager->is_enabled($ext_name)) + { + redirect($this->u_action); + } + + $this->tpl_name = 'acp_ext_enable'; + + $template->assign_vars(array( + 'PRE' => true, + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')), + 'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name), + )); + break; + + case 'enable': + if (!$md_manager->validate_dir()) + { + trigger_error($user->lang['EXTENSION_DIR_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (!$md_manager->validate_enable()) + { + trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $extension = $phpbb_extension_manager->get_extension($ext_name); + if (!$extension->is_enableable()) + { + trigger_error($user->lang['EXTENSION_NOT_ENABLEABLE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if ($phpbb_extension_manager->is_enabled($ext_name)) + { + redirect($this->u_action); + } + + try + { + while ($phpbb_extension_manager->enable_step($ext_name)) + { + // Are we approaching the time limit? If so we want to pause the update and continue after refreshing + if ((time() - $start_time) >= $safe_time_limit) + { + $template->assign_var('S_NEXT_STEP', true); + + meta_refresh(0, $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name)); + } + } + $this->log->add('admin', $user->data['user_id'], $user->ip, 'LOG_EXT_ENABLE', time(), array($ext_name)); + } + catch (\phpbb\db\migration\exception $e) + { + $template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($user)); + } + + $this->tpl_name = 'acp_ext_enable'; + + $template->assign_vars(array( + 'U_RETURN' => $this->u_action . '&action=list', + )); + break; + + case 'disable_pre': + if (!$phpbb_extension_manager->is_enabled($ext_name)) + { + redirect($this->u_action); + } + + $this->tpl_name = 'acp_ext_disable'; + + $template->assign_vars(array( + 'PRE' => true, + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')), + 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name), + )); + break; + + case 'disable': + if (!$phpbb_extension_manager->is_enabled($ext_name)) + { + redirect($this->u_action); + } + + while ($phpbb_extension_manager->disable_step($ext_name)) + { + // Are we approaching the time limit? If so we want to pause the update and continue after refreshing + if ((time() - $start_time) >= $safe_time_limit) + { + $template->assign_var('S_NEXT_STEP', true); + + meta_refresh(0, $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name)); + } + } + $this->log->add('admin', $user->data['user_id'], $user->ip, 'LOG_EXT_DISABLE', time(), array($ext_name)); + + $this->tpl_name = 'acp_ext_disable'; + + $template->assign_vars(array( + 'U_RETURN' => $this->u_action . '&action=list', + )); + break; + + case 'delete_data_pre': + if ($phpbb_extension_manager->is_enabled($ext_name)) + { + redirect($this->u_action); + } + $this->tpl_name = 'acp_ext_delete_data'; + + $template->assign_vars(array( + 'PRE' => true, + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')), + 'U_PURGE' => $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name), + )); + break; + + case 'delete_data': + if ($phpbb_extension_manager->is_enabled($ext_name)) + { + redirect($this->u_action); + } + + try + { + while ($phpbb_extension_manager->purge_step($ext_name)) + { + // Are we approaching the time limit? If so we want to pause the update and continue after refreshing + if ((time() - $start_time) >= $safe_time_limit) + { + $template->assign_var('S_NEXT_STEP', true); + + meta_refresh(0, $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name)); + } + } + $this->log->add('admin', $user->data['user_id'], $user->ip, 'LOG_EXT_PURGE', time(), array($ext_name)); + } + catch (\phpbb\db\migration\exception $e) + { + $template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($user)); + } + + $this->tpl_name = 'acp_ext_delete_data'; + + $template->assign_vars(array( + 'U_RETURN' => $this->u_action . '&action=list', + )); + break; + + case 'details': + // Output it to the template + $md_manager->output_template_data(); + + try + { + $updates_available = $this->version_check($md_manager, $request->variable('versioncheck_force', false)); + + $template->assign_vars(array( + 'S_UP_TO_DATE' => empty($updates_available), + 'S_VERSIONCHECK' => true, + 'UP_TO_DATE_MSG' => $this->user->lang(empty($updates_available) ? 'UP_TO_DATE' : 'NOT_UP_TO_DATE', $md_manager->get_metadata('display-name')), + )); + + foreach ($updates_available as $branch => $version_data) + { + $template->assign_block_vars('updates_available', $version_data); + } + } + catch (\RuntimeException $e) + { + $template->assign_vars(array( + 'S_VERSIONCHECK_STATUS' => $e->getCode(), + 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '', + )); + } + + $template->assign_vars(array( + 'U_BACK' => $this->u_action . '&action=list', + 'U_VERSIONCHECK_FORCE' => $this->u_action . '&action=details&versioncheck_force=1&ext_name=' . urlencode($md_manager->get_metadata('name')), + )); + + $this->tpl_name = 'acp_ext_details'; + break; + } + } + + /** + * Lists all the enabled extensions and dumps to the template + * + * @param $phpbb_extension_manager An instance of the extension manager + * @return null + */ + public function list_enabled_exts(\phpbb\extension\manager $phpbb_extension_manager) + { + $enabled_extension_meta_data = array(); + + foreach ($phpbb_extension_manager->all_enabled() as $name => $location) + { + $md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name, $this->template); + + try + { + $meta = $md_manager->get_metadata('all'); + $enabled_extension_meta_data[$name] = array( + 'META_DISPLAY_NAME' => $md_manager->get_metadata('display-name'), + 'META_VERSION' => $meta['version'], + ); + + $force_update = $this->request->variable('versioncheck_force', false); + $updates = $this->version_check($md_manager, $force_update, !$force_update); + + $enabled_extension_meta_data[$name]['S_UP_TO_DATE'] = empty($updates); + $enabled_extension_meta_data[$name]['S_VERSIONCHECK'] = true; + $enabled_extension_meta_data[$name]['U_VERSIONCHECK_FORCE'] = $this->u_action . '&action=details&versioncheck_force=1&ext_name=' . urlencode($md_manager->get_metadata('name')); + } + catch(\phpbb\extension\exception $e) + { + $this->template->assign_block_vars('disabled', array( + 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e), + 'S_VERSIONCHECK' => false, + )); + } + catch (\RuntimeException $e) + { + $enabled_extension_meta_data[$name]['S_VERSIONCHECK'] = false; + } + } + + uasort($enabled_extension_meta_data, array($this, 'sort_extension_meta_data_table')); + + foreach ($enabled_extension_meta_data as $name => $block_vars) + { + $block_vars['U_DETAILS'] = $this->u_action . '&action=details&ext_name=' . urlencode($name); + + $this->template->assign_block_vars('enabled', $block_vars); + + $this->output_actions('enabled', array( + 'DISABLE' => $this->u_action . '&action=disable_pre&ext_name=' . urlencode($name), + )); + } + } + + /** + * Lists all the disabled extensions and dumps to the template + * + * @param $phpbb_extension_manager An instance of the extension manager + * @return null + */ + public function list_disabled_exts(\phpbb\extension\manager $phpbb_extension_manager) + { + $disabled_extension_meta_data = array(); + + foreach ($phpbb_extension_manager->all_disabled() as $name => $location) + { + $md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name, $this->template); + + try + { + $meta = $md_manager->get_metadata('all'); + $disabled_extension_meta_data[$name] = array( + 'META_DISPLAY_NAME' => $md_manager->get_metadata('display-name'), + 'META_VERSION' => $meta['version'], + ); + + $force_update = $this->request->variable('versioncheck_force', false); + $updates = $this->version_check($md_manager, $force_update, !$force_update); + + $disabled_extension_meta_data[$name]['S_UP_TO_DATE'] = empty($updates); + $disabled_extension_meta_data[$name]['S_VERSIONCHECK'] = true; + $disabled_extension_meta_data[$name]['U_VERSIONCHECK_FORCE'] = $this->u_action . '&action=details&versioncheck_force=1&ext_name=' . urlencode($md_manager->get_metadata('name')); + } + catch(\phpbb\extension\exception $e) + { + $this->template->assign_block_vars('disabled', array( + 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e), + 'S_VERSIONCHECK' => false, + )); + } + catch (\RuntimeException $e) + { + $disabeld_extension_meta_data[$name]['S_VERSIONCHECK'] = false; + } + } + + uasort($disabled_extension_meta_data, array($this, 'sort_extension_meta_data_table')); + + foreach ($disabled_extension_meta_data as $name => $block_vars) + { + $block_vars['U_DETAILS'] = $this->u_action . '&action=details&ext_name=' . urlencode($name); + + $this->template->assign_block_vars('disabled', $block_vars); + + $this->output_actions('disabled', array( + 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($name), + 'DELETE_DATA' => $this->u_action . '&action=delete_data_pre&ext_name=' . urlencode($name), + )); + } + } + + /** + * Lists all the available extensions and dumps to the template + * + * @param $phpbb_extension_manager An instance of the extension manager + * @return null + */ + public function list_available_exts(\phpbb\extension\manager $phpbb_extension_manager) + { + $uninstalled = array_diff_key($phpbb_extension_manager->all_available(), $phpbb_extension_manager->all_configured()); + + $available_extension_meta_data = array(); + + foreach ($uninstalled as $name => $location) + { + $md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name, $this->template); + + try + { + $meta = $md_manager->get_metadata('all'); + $available_extension_meta_data[$name] = array( + 'META_DISPLAY_NAME' => $md_manager->get_metadata('display-name'), + 'META_VERSION' => $meta['version'], + ); + + $force_update = $this->request->variable('versioncheck_force', false); + $updates = $this->version_check($md_manager, $force_update, !$force_update); + + $available_extension_meta_data[$name]['S_UP_TO_DATE'] = empty($updates); + $available_extension_meta_data[$name]['S_VERSIONCHECK'] = true; + $available_extension_meta_data[$name]['U_VERSIONCHECK_FORCE'] = $this->u_action . '&action=details&versioncheck_force=1&ext_name=' . urlencode($md_manager->get_metadata('name')); + } + catch(\phpbb\extension\exception $e) + { + $this->template->assign_block_vars('disabled', array( + 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e), + 'S_VERSIONCHECK' => false, + )); + } + catch (\RuntimeException $e) + { + $available_extension_meta_data[$name]['S_VERSIONCHECK'] = false; + } + } + + uasort($available_extension_meta_data, array($this, 'sort_extension_meta_data_table')); + + foreach ($available_extension_meta_data as $name => $block_vars) + { + $block_vars['U_DETAILS'] = $this->u_action . '&action=details&ext_name=' . urlencode($name); + + $this->template->assign_block_vars('disabled', $block_vars); + + $this->output_actions('disabled', array( + 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($name), + )); + } + } + + /** + * Output actions to a block + * + * @param string $block + * @param array $actions + */ + private function output_actions($block, $actions) + { + foreach ($actions as $lang => $url) + { + $this->template->assign_block_vars($block . '.actions', array( + 'L_ACTION' => $this->user->lang('EXTENSION_' . $lang), + 'L_ACTION_EXPLAIN' => (isset($this->user->lang['EXTENSION_' . $lang . '_EXPLAIN'])) ? $this->user->lang('EXTENSION_' . $lang . '_EXPLAIN') : '', + 'U_ACTION' => $url, + )); + } + } + + /** + * Check the version and return the available updates. + * + * @param \phpbb\extension\metadata_manager $md_manager The metadata manager for the version to check. + * @param bool $force_update Ignores cached data. Defaults to false. + * @param bool $force_cache Force the use of the cache. Override $force_update. + * @return string + * @throws RuntimeException + */ + protected function version_check(\phpbb\extension\metadata_manager $md_manager, $force_update = false, $force_cache = false) + { + $meta = $md_manager->get_metadata('all'); + + if (!isset($meta['extra']['version-check'])) + { + throw new \RuntimeException($this->user->lang('NO_VERSIONCHECK'), 1); + } + + $version_check = $meta['extra']['version-check']; + + $version_helper = new \phpbb\version_helper($this->cache, $this->config, new \phpbb\file_downloader(), $this->user); + $version_helper->set_current_version($meta['version']); + $version_helper->set_file_location($version_check['host'], $version_check['directory'], $version_check['filename']); + $version_helper->force_stability($this->config['extension_force_unstable'] ? 'unstable' : null); + + return $updates = $version_helper->get_suggested_updates($force_update, $force_cache); + } + + /** + * Sort helper for the table containing the metadata about the extensions. + */ + protected function sort_extension_meta_data_table($val1, $val2) + { + return strnatcasecmp($val1['META_DISPLAY_NAME'], $val2['META_DISPLAY_NAME']); + } +} diff --git a/sources/phpBB/includes/acp/acp_forums.php b/sources/phpBB/includes/acp/acp_forums.php new file mode 100644 index 0000000..adf5de4 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_forums.php @@ -0,0 +1,2119 @@ + +* @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; +} + +class acp_forums +{ + var $u_action; + var $parent_id = 0; + + function main($id, $mode) + { + global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher; + global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx; + + $user->add_lang('acp/forums'); + $this->tpl_name = 'acp_forums'; + $this->page_title = 'ACP_MANAGE_FORUMS'; + + $form_key = 'acp_forums'; + add_form_key($form_key); + + $action = request_var('action', ''); + $update = (isset($_POST['update'])) ? true : false; + $forum_id = request_var('f', 0); + + $this->parent_id = request_var('parent_id', 0); + $forum_data = $errors = array(); + if ($update && !check_form_key($form_key)) + { + $update = false; + $errors[] = $user->lang['FORM_INVALID']; + } + + // Check additional permissions + switch ($action) + { + case 'progress_bar': + $start = request_var('start', 0); + $total = request_var('total', 0); + + $this->display_progress_bar($start, $total); + break; + + case 'delete': + + if (!$auth->acl_get('a_forumdel')) + { + trigger_error($user->lang['NO_PERMISSION_FORUM_DELETE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + break; + + case 'add': + + if (!$auth->acl_get('a_forumadd')) + { + trigger_error($user->lang['NO_PERMISSION_FORUM_ADD'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + break; + } + + // Major routines + if ($update) + { + 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); + + $errors = $this->delete_forum($forum_id, $action_posts, $action_subforums, $posts_to_id, $subforums_to_id); + + if (sizeof($errors)) + { + break; + } + + $auth->acl_clear_prefetch(); + $cache->destroy('sql', FORUMS_TABLE); + + trigger_error($user->lang['FORUM_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); + + break; + + case 'edit': + $forum_data = array( + 'forum_id' => $forum_id + ); + + // No break here + + 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), + '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_desc_uid' => '', + 'forum_desc_options' => 7, + 'forum_desc_bitfield' => '', + 'forum_rules' => utf8_normalize_nfc(request_var('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), + ); + + /** + * Request forum data and operate on it (parse texts, etc.) + * + * @event core.acp_manage_forums_request_data + * @var string action Type of the action: add|edit + * @var array forum_data Array with new forum data + * @since 3.1.0-a1 + */ + $vars = array('action', 'forum_data'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_request_data', compact($vars))); + + // On add, add empty forum_options... else do not consider it (not updating it) + if ($action == 'add') + { + $forum_data['forum_options'] = 0; + } + + // 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); + } + + // Linked forums and categories are not able to be locked... + if ($forum_data['forum_type'] == FORUM_LINK || $forum_data['forum_type'] == FORUM_CAT) + { + $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); + + // 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)); + } + + // 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)); + } + + $errors = $this->update_forum_data($forum_data); + + if (!sizeof($errors)) + { + $forum_perm_from = request_var('forum_perm_from', 0); + $cache->destroy('sql', FORUMS_TABLE); + + $copied_permissions = false; + // Copy permissions? + if ($forum_perm_from && $forum_perm_from != $forum_data['forum_id'] && + ($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth')))) + { + copy_forum_permissions($forum_perm_from, $forum_data['forum_id'], ($action == 'edit') ? true : false); + phpbb_cache_moderators($db, $cache, $auth); + $copied_permissions = true; + } +/* Commented out because of questionable UI workflow - re-visit for 3.0.7 + else if (!$this->parent_id && $action != 'edit' && $auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth')) + { + $this->copy_permission_page($forum_data); + return; + } +*/ + $auth->acl_clear_prefetch(); + + $acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id']; + + $message = ($action == 'add') ? $user->lang['FORUM_CREATED'] : $user->lang['FORUM_UPDATED']; + + // redirect directly to permission settings screen if authed + if ($action == 'add' && !$copied_permissions && $auth->acl_get('a_fauth')) + { + $message .= '

' . sprintf($user->lang['REDIRECT_ACL'], '', ''); + + meta_refresh(4, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url)); + } + + trigger_error($message . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); + } + + break; + } + } + + switch ($action) + { + case 'move_up': + case 'move_down': + + if (!$forum_id) + { + trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + $sql = 'SELECT * + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + $move_forum_name = $this->move_forum_by($row, $action, 1); + + if ($move_forum_name !== false) + { + add_log('admin', 'LOG_FORUM_' . strtoupper($action), $row['forum_name'], $move_forum_name); + $cache->destroy('sql', FORUMS_TABLE); + } + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array('success' => ($move_forum_name !== false))); + } + + break; + + case 'sync': + if (!$forum_id) + { + trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + @set_time_limit(0); + + $sql = 'SELECT forum_name, (forum_topics_approved + forum_topics_unapproved + forum_topics_softdeleted) AS total_topics + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + if ($row['total_topics']) + { + $sql = 'SELECT MIN(topic_id) as min_topic_id, MAX(topic_id) as max_topic_id + FROM ' . TOPICS_TABLE . ' + WHERE forum_id = ' . $forum_id; + $result = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + // Typecast to int if there is no data available + $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']); + + $batch_size = 2000; + $end = $start + $batch_size; + + // Sync all topics in batch mode... + sync('topic', 'range', 'topic_id BETWEEN ' . $start . ' AND ' . $end, true, true); + + if ($end < $row2['max_topic_id']) + { + // We really need to find a way of showing statistics... no progress here + $sql = 'SELECT COUNT(topic_id) as num_topics + FROM ' . TOPICS_TABLE . ' + 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'); + $db->sql_freeresult($result); + + $start += $batch_size; + + $url = $this->u_action . "&parent_id={$this->parent_id}&f=$forum_id&action=sync&start=$start&topics_done=$topics_done&total={$row['total_topics']}"; + + meta_refresh(0, $url); + + $template->assign_vars(array( + 'U_PROGRESS_BAR' => $this->u_action . "&action=progress_bar&start=$topics_done&total={$row['total_topics']}", + 'UA_PROGRESS_BAR' => addslashes($this->u_action . "&action=progress_bar&start=$topics_done&total={$row['total_topics']}"), + 'S_CONTINUE_SYNC' => true, + 'L_PROGRESS_EXPLAIN' => sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], $topics_done, $row['total_topics'])) + ); + + return; + } + } + + $url = $this->u_action . "&parent_id={$this->parent_id}&f=$forum_id&action=sync_forum"; + meta_refresh(0, $url); + + $template->assign_vars(array( + 'U_PROGRESS_BAR' => $this->u_action . '&action=progress_bar', + 'UA_PROGRESS_BAR' => addslashes($this->u_action . '&action=progress_bar'), + 'S_CONTINUE_SYNC' => true, + 'L_PROGRESS_EXPLAIN' => sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], 0, $row['total_topics'])) + ); + + return; + + break; + + case 'sync_forum': + + $sql = 'SELECT forum_name, forum_type + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + sync('forum', 'forum_id', $forum_id, false, true); + + add_log('admin', 'LOG_FORUM_SYNC', $row['forum_name']); + $cache->destroy('sql', FORUMS_TABLE); + + $template->assign_var('L_FORUM_RESYNCED', sprintf($user->lang['FORUM_RESYNCED'], $row['forum_name'])); + + break; + + case 'add': + case 'edit': + + 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'] += ($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; + } + + // Initialise $row, so we always have it in the event + $row = array(); + + // Show form to create/modify a forum + if ($action == 'edit') + { + $this->page_title = 'EDIT_FORUM'; + $row = $this->get_forum_info($forum_id); + $old_forum_type = $row['forum_type']; + + if (!$update) + { + $forum_data = $row; + } + else + { + $forum_data['left_id'] = $row['left_id']; + $forum_data['right_id'] = $row['right_id']; + } + + // Make sure no direct child forums are able to be selected as parents. + $exclude_forums = array(); + foreach (get_forum_branch($forum_id, 'children') as $row) + { + $exclude_forums[] = $row['forum_id']; + } + + $parents_list = make_forum_select($forum_data['parent_id'], $exclude_forums, false, false, false); + + $forum_data['forum_password_confirm'] = $forum_data['forum_password']; + } + else + { + $this->page_title = 'CREATE_FORUM'; + + $forum_id = $this->parent_id; + $parents_list = make_forum_select($this->parent_id, false, false, false, false); + + // Fill forum data with default values + if (!$update) + { + $forum_data = array( + 'parent_id' => $this->parent_id, + 'forum_type' => FORUM_POST, + 'forum_status' => ITEM_UNLOCKED, + 'forum_name' => utf8_normalize_nfc(request_var('forum_name', '', true)), + 'forum_link' => '', + 'forum_link_track' => false, + 'forum_desc' => '', + 'forum_rules' => '', + 'forum_rules_link' => '', + 'forum_image' => '', + 'forum_style' => 0, + 'display_subforum_list' => true, + 'display_on_index' => false, + 'forum_topics_per_page' => 0, + 'enable_indexing' => true, + 'enable_icons' => false, + 'enable_prune' => false, + 'prune_days' => 7, + 'prune_viewed' => 7, + 'prune_freq' => 1, + 'enable_shadow_prune' => false, + 'prune_shadow_days' => 7, + 'prune_shadow_freq' => 1, + 'forum_flags' => FORUM_FLAG_POST_REVIEW + FORUM_FLAG_ACTIVE_TOPICS, + 'forum_options' => 0, + 'forum_password' => '', + 'forum_password_confirm'=> '', + ); + } + } + + /** + * Initialise data before we display the add/edit form + * + * @event core.acp_manage_forums_initialise_data + * @var string action Type of the action: add|edit + * @var bool update Do we display the form only + * or did the user press submit + * @var int forum_id When editing: the forum id, + * when creating: the parent forum id + * @var array row Array with current forum data + * empty when creating new forum + * @var array forum_data Array with new forum data + * @var string parents_list List of parent options + * @since 3.1.0-a1 + */ + $vars = array('action', 'update', 'forum_id', 'row', 'forum_data', 'parents_list'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_initialise_data', compact($vars))); + + $forum_rules_data = array( + 'text' => $forum_data['forum_rules'], + 'allow_bbcode' => true, + 'allow_smilies' => true, + 'allow_urls' => true + ); + + $forum_desc_data = array( + 'text' => $forum_data['forum_desc'], + 'allow_bbcode' => true, + 'allow_smilies' => true, + 'allow_urls' => true + ); + + $forum_rules_preview = ''; + + // Parse rules if specified + if ($forum_data['forum_rules']) + { + 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... + $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 preview content + $forum_rules_preview = generate_text_for_display($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options']); + + // decode... + $forum_rules_data = generate_text_for_edit($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_options']); + } + + // Parse desciption if specified + if ($forum_data['forum_desc']) + { + 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... + $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)); + } + + // decode... + $forum_desc_data = generate_text_for_edit($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_options']); + } + + $forum_type_options = ''; + $forum_type_ary = array(FORUM_CAT => 'CAT', FORUM_POST => 'FORUM', FORUM_LINK => 'LINK'); + + foreach ($forum_type_ary as $value => $lang) + { + $forum_type_options .= ''; + } + + $styles_list = style_select($forum_data['forum_style'], true); + + $statuslist = ''; + + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + WHERE forum_type = ' . FORUM_POST . " + AND forum_id <> $forum_id"; + $result = $db->sql_query_limit($sql, 1); + + $postable_forum_exists = false; + if ($db->sql_fetchrow($result)) + { + $postable_forum_exists = true; + } + $db->sql_freeresult($result); + + // Subforum move options + if ($action == 'edit' && $forum_data['forum_type'] == FORUM_CAT) + { + $subforums_id = array(); + $subforums = get_forum_branch($forum_id, 'children'); + + foreach ($subforums as $row) + { + $subforums_id[] = $row['forum_id']; + } + + $forums_list = make_forum_select($forum_data['parent_id'], $subforums_id); + + if ($postable_forum_exists) + { + $template->assign_vars(array( + 'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $subforums_id)) // , false, true, false??? + ); + } + + $template->assign_vars(array( + 'S_HAS_SUBFORUMS' => ($forum_data['right_id'] - $forum_data['left_id'] > 1) ? true : false, + 'S_FORUMS_LIST' => $forums_list) + ); + } + else if ($postable_forum_exists) + { + $template->assign_vars(array( + 'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $forum_id, false, true, false)) + ); + } + + $s_show_display_on_index = false; + + if ($forum_data['parent_id'] > 0) + { + // if this forum is a subforum put the "display on index" checkbox + if ($parent_info = $this->get_forum_info($forum_data['parent_id'])) + { + if ($parent_info['parent_id'] > 0 || $parent_info['forum_type'] == FORUM_CAT) + { + $s_show_display_on_index = true; + } + } + } + + if (strlen($forum_data['forum_password']) == 32) + { + $errors[] = $user->lang['FORUM_PASSWORD_OLD']; + } + + $template_data = array( + 'S_EDIT_FORUM' => true, + 'S_ERROR' => (sizeof($errors)) ? true : false, + 'S_PARENT_ID' => $this->parent_id, + 'S_FORUM_PARENT_ID' => $forum_data['parent_id'], + 'S_ADD_ACTION' => ($action == 'add') ? true : false, + + 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, + 'U_EDIT_ACTION' => $this->u_action . "&parent_id={$this->parent_id}&action=$action&f=$forum_id", + + 'L_COPY_PERMISSIONS_EXPLAIN' => $user->lang['COPY_PERMISSIONS_' . strtoupper($action) . '_EXPLAIN'], + 'L_TITLE' => $user->lang[$this->page_title], + 'ERROR_MSG' => (sizeof($errors)) ? implode('
', $errors) : '', + + 'FORUM_NAME' => $forum_data['forum_name'], + 'FORUM_DATA_LINK' => $forum_data['forum_link'], + 'FORUM_IMAGE' => $forum_data['forum_image'], + 'FORUM_IMAGE_SRC' => ($forum_data['forum_image']) ? $phpbb_root_path . $forum_data['forum_image'] : '', + 'FORUM_POST' => FORUM_POST, + 'FORUM_LINK' => FORUM_LINK, + 'FORUM_CAT' => FORUM_CAT, + 'PRUNE_FREQ' => $forum_data['prune_freq'], + 'PRUNE_DAYS' => $forum_data['prune_days'], + 'PRUNE_VIEWED' => $forum_data['prune_viewed'], + 'PRUNE_SHADOW_FREQ' => $forum_data['prune_shadow_freq'], + 'PRUNE_SHADOW_DAYS' => $forum_data['prune_shadow_days'], + 'TOPICS_PER_PAGE' => $forum_data['forum_topics_per_page'], + 'FORUM_RULES_LINK' => $forum_data['forum_rules_link'], + 'FORUM_RULES' => $forum_data['forum_rules'], + 'FORUM_RULES_PREVIEW' => $forum_rules_preview, + 'FORUM_RULES_PLAIN' => $forum_rules_data['text'], + 'S_BBCODE_CHECKED' => ($forum_rules_data['allow_bbcode']) ? true : false, + 'S_SMILIES_CHECKED' => ($forum_rules_data['allow_smilies']) ? true : false, + 'S_URLS_CHECKED' => ($forum_rules_data['allow_urls']) ? true : false, + 'S_FORUM_PASSWORD_SET' => (empty($forum_data['forum_password'])) ? false : true, + + 'FORUM_DESC' => $forum_desc_data['text'], + 'S_DESC_BBCODE_CHECKED' => ($forum_desc_data['allow_bbcode']) ? true : false, + 'S_DESC_SMILIES_CHECKED' => ($forum_desc_data['allow_smilies']) ? true : false, + 'S_DESC_URLS_CHECKED' => ($forum_desc_data['allow_urls']) ? true : false, + + 'S_FORUM_TYPE_OPTIONS' => $forum_type_options, + 'S_STATUS_OPTIONS' => $statuslist, + 'S_PARENT_OPTIONS' => $parents_list, + 'S_STYLES_OPTIONS' => $styles_list, + 'S_FORUM_OPTIONS' => make_forum_select(($action == 'add') ? $forum_data['parent_id'] : false, ($action == 'edit') ? $forum_data['forum_id'] : false, false, false, false), + 'S_SHOW_DISPLAY_ON_INDEX' => $s_show_display_on_index, + 'S_FORUM_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false, + 'S_FORUM_ORIG_POST' => (isset($old_forum_type) && $old_forum_type == FORUM_POST) ? true : false, + 'S_FORUM_ORIG_CAT' => (isset($old_forum_type) && $old_forum_type == FORUM_CAT) ? true : false, + 'S_FORUM_ORIG_LINK' => (isset($old_forum_type) && $old_forum_type == FORUM_LINK) ? true : false, + 'S_FORUM_LINK' => ($forum_data['forum_type'] == FORUM_LINK) ? true : false, + 'S_FORUM_CAT' => ($forum_data['forum_type'] == FORUM_CAT) ? true : false, + 'S_ENABLE_INDEXING' => ($forum_data['enable_indexing']) ? true : false, + 'S_TOPIC_ICONS' => ($forum_data['enable_icons']) ? true : false, + 'S_DISPLAY_SUBFORUM_LIST' => ($forum_data['display_subforum_list']) ? true : false, + 'S_DISPLAY_ON_INDEX' => ($forum_data['display_on_index']) ? true : false, + 'S_PRUNE_ENABLE' => ($forum_data['enable_prune']) ? true : false, + 'S_PRUNE_SHADOW_ENABLE' => ($forum_data['enable_shadow_prune']) ? true : false, + 'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? true : false, + 'S_PRUNE_OLD_POLLS' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_POLL) ? true : false, + 'S_PRUNE_ANNOUNCE' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_ANNOUNCE) ? true : false, + 'S_PRUNE_STICKY' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_STICKY) ? true : false, + 'S_DISPLAY_ACTIVE_TOPICS' => ($forum_data['forum_type'] == FORUM_POST) ? ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) : true, + 'S_ENABLE_ACTIVE_TOPICS' => ($forum_data['forum_type'] == FORUM_CAT) ? ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) : false, + 'S_ENABLE_POST_REVIEW' => ($forum_data['forum_flags'] & FORUM_FLAG_POST_REVIEW) ? true : false, + 'S_ENABLE_QUICK_REPLY' => ($forum_data['forum_flags'] & FORUM_FLAG_QUICK_REPLY) ? true : false, + 'S_CAN_COPY_PERMISSIONS' => ($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))) ? true : false, + ); + + /** + * Modify forum template data before we display the form + * + * @event core.acp_manage_forums_display_form + * @var string action Type of the action: add|edit + * @var bool update Do we display the form only + * or did the user press submit + * @var int forum_id When editing: the forum id, + * when creating: the parent forum id + * @var array row Array with current forum data + * empty when creating new forum + * @var array forum_data Array with new forum data + * @var string parents_list List of parent options + * @var array errors Array of errors, if you add errors + * ensure to update the template variables + * S_ERROR and ERROR_MSG to display it + * @var array template_data Array with new forum data + * @since 3.1.0-a1 + */ + $vars = array( + 'action', + 'update', + 'forum_id', + 'row', + 'forum_data', + 'parents_list', + 'errors', + 'template_data', + ); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_display_form', compact($vars))); + + $template->assign_vars($template_data); + + return; + + break; + + case 'delete': + + if (!$forum_id) + { + trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + $forum_data = $this->get_forum_info($forum_id); + + $subforums_id = array(); + $subforums = get_forum_branch($forum_id, 'children'); + + foreach ($subforums as $row) + { + $subforums_id[] = $row['forum_id']; + } + + $forums_list = make_forum_select($forum_data['parent_id'], $subforums_id); + + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + WHERE forum_type = ' . FORUM_POST . " + AND forum_id <> $forum_id"; + $result = $db->sql_query_limit($sql, 1); + + if ($db->sql_fetchrow($result)) + { + $template->assign_vars(array( + 'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $subforums_id, false, true)) // , false, true, false??? + ); + } + $db->sql_freeresult($result); + + $parent_id = ($this->parent_id == $forum_id) ? 0 : $this->parent_id; + + $template->assign_vars(array( + 'S_DELETE_FORUM' => true, + 'U_ACTION' => $this->u_action . "&parent_id={$parent_id}&action=delete&f=$forum_id", + 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, + + 'FORUM_NAME' => $forum_data['forum_name'], + 'S_FORUM_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false, + 'S_FORUM_LINK' => ($forum_data['forum_type'] == FORUM_LINK) ? true : false, + 'S_HAS_SUBFORUMS' => ($forum_data['right_id'] - $forum_data['left_id'] > 1) ? true : false, + 'S_FORUMS_LIST' => $forums_list, + 'S_ERROR' => (sizeof($errors)) ? true : false, + 'ERROR_MSG' => (sizeof($errors)) ? implode('
', $errors) : '') + ); + + return; + break; + + case 'copy_perm': + $forum_perm_from = request_var('forum_perm_from', 0); + + // Copy permissions? + if (!empty($forum_perm_from) && $forum_perm_from != $forum_id) + { + copy_forum_permissions($forum_perm_from, $forum_id, true); + phpbb_cache_moderators($db, $cache, $auth); + $auth->acl_clear_prefetch(); + $cache->destroy('sql', FORUMS_TABLE); + + $acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_id; + + $message = $user->lang['FORUM_UPDATED']; + + // Redirect to permissions + if ($auth->acl_get('a_fauth')) + { + $message .= '

' . sprintf($user->lang['REDIRECT_ACL'], '', ''); + } + + trigger_error($message . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); + } + + break; + } + + // Default management page + if (!$this->parent_id) + { + $navigation = $user->lang['FORUM_INDEX']; + } + else + { + $navigation = '' . $user->lang['FORUM_INDEX'] . ''; + + $forums_nav = get_forum_branch($this->parent_id, 'parents', 'descending'); + foreach ($forums_nav as $row) + { + if ($row['forum_id'] == $this->parent_id) + { + $navigation .= ' -> ' . $row['forum_name']; + } + else + { + $navigation .= ' -> ' . $row['forum_name'] . ''; + } + } + } + + // Jumpbox + $forum_box = make_forum_select($this->parent_id, false, false, false, false); //make_forum_select($this->parent_id); + + if ($action == 'sync' || $action == 'sync_forum') + { + $template->assign_var('S_RESYNCED', true); + } + + $sql = 'SELECT * + FROM ' . FORUMS_TABLE . " + WHERE parent_id = $this->parent_id + ORDER BY left_id"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + do + { + $forum_type = $row['forum_type']; + + if ($row['forum_status'] == ITEM_LOCKED) + { + $folder_image = '' . $user->lang['LOCKED'] . ''; + } + else + { + switch ($forum_type) + { + case FORUM_LINK: + $folder_image = '' . $user->lang['LINK'] . ''; + break; + + default: + $folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '' . $user->lang['SUBFORUM'] . '' : '' . $user->lang['FOLDER'] . ''; + break; + } + } + + $url = $this->u_action . "&parent_id=$this->parent_id&f={$row['forum_id']}"; + + $template->assign_block_vars('forums', array( + 'FOLDER_IMAGE' => $folder_image, + 'FORUM_IMAGE' => ($row['forum_image']) ? '' : '', + 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', + 'FORUM_NAME' => $row['forum_name'], + 'FORUM_DESCRIPTION' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), + 'FORUM_TOPICS' => $row['forum_topics_approved'], + 'FORUM_POSTS' => $row['forum_posts_approved'], + + 'S_FORUM_LINK' => ($forum_type == FORUM_LINK) ? true : false, + 'S_FORUM_POST' => ($forum_type == FORUM_POST) ? true : false, + + 'U_FORUM' => $this->u_action . '&parent_id=' . $row['forum_id'], + 'U_MOVE_UP' => $url . '&action=move_up', + 'U_MOVE_DOWN' => $url . '&action=move_down', + 'U_EDIT' => $url . '&action=edit', + 'U_DELETE' => $url . '&action=delete', + 'U_SYNC' => $url . '&action=sync') + ); + } + while ($row = $db->sql_fetchrow($result)); + } + else if ($this->parent_id) + { + $row = $this->get_forum_info($this->parent_id); + + $url = $this->u_action . '&parent_id=' . $this->parent_id . '&f=' . $row['forum_id']; + + $template->assign_vars(array( + 'S_NO_FORUMS' => true, + + 'U_EDIT' => $url . '&action=edit', + 'U_DELETE' => $url . '&action=delete', + 'U_SYNC' => $url . '&action=sync') + ); + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'ERROR_MSG' => (sizeof($errors)) ? implode('
', $errors) : '', + 'NAVIGATION' => $navigation, + 'FORUM_BOX' => $forum_box, + 'U_SEL_ACTION' => $this->u_action, + 'U_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id, + + 'U_PROGRESS_BAR' => $this->u_action . '&action=progress_bar', + 'UA_PROGRESS_BAR' => addslashes($this->u_action . '&action=progress_bar'), + )); + } + + /** + * Get forum details + */ + function get_forum_info($forum_id) + { + global $db; + + $sql = 'SELECT * + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + trigger_error("Forum #$forum_id does not exist", E_USER_ERROR); + } + + return $row; + } + + /** + * Update forum data + */ + function update_forum_data(&$forum_data) + { + global $db, $user, $cache, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher; + + $errors = array(); + + /** + * Validate the forum data before we create/update the forum + * + * @event core.acp_manage_forums_validate_data + * @var array forum_data Array with new forum data + * @var array errors Array of errors, should be strings and not + * language key. + * @since 3.1.0-a1 + */ + $vars = array('forum_data', 'errors'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_validate_data', compact($vars))); + + if ($forum_data['forum_name'] == '') + { + $errors[] = $user->lang['FORUM_NAME_EMPTY']; + } + + if (utf8_strlen($forum_data['forum_desc']) > 4000) + { + $errors[] = $user->lang['FORUM_DESC_TOO_LONG']; + } + + if (utf8_strlen($forum_data['forum_rules']) > 4000) + { + $errors[] = $user->lang['FORUM_RULES_TOO_LONG']; + } + + if ($forum_data['forum_password'] || $forum_data['forum_password_confirm']) + { + if ($forum_data['forum_password'] != $forum_data['forum_password_confirm']) + { + $forum_data['forum_password'] = $forum_data['forum_password_confirm'] = ''; + $errors[] = $user->lang['FORUM_PASSWORD_MISMATCH']; + } + } + + if ($forum_data['prune_days'] < 0 || $forum_data['prune_viewed'] < 0 || $forum_data['prune_freq'] < 0) + { + $forum_data['prune_days'] = $forum_data['prune_viewed'] = $forum_data['prune_freq'] = 0; + $errors[] = $user->lang['FORUM_DATA_NEGATIVE']; + } + + $range_test_ary = array( + array('lang' => 'FORUM_TOPICS_PAGE', 'value' => $forum_data['forum_topics_per_page'], 'column_type' => 'TINT:0'), + ); + + if (!empty($forum_data['forum_image']) && !file_exists($phpbb_root_path . $forum_data['forum_image'])) + { + $errors[] = $user->lang['FORUM_IMAGE_NO_EXIST']; + } + + validate_range($range_test_ary, $errors); + + // Set forum flags + // 1 = link tracking + // 2 = prune old polls + // 4 = prune announcements + // 8 = prune stickies + // 16 = show active topics + // 32 = enable post review + $forum_data['forum_flags'] = 0; + $forum_data['forum_flags'] += ($forum_data['forum_link_track']) ? FORUM_FLAG_LINK_TRACK : 0; + $forum_data['forum_flags'] += ($forum_data['prune_old_polls']) ? FORUM_FLAG_PRUNE_POLL : 0; + $forum_data['forum_flags'] += ($forum_data['prune_announce']) ? FORUM_FLAG_PRUNE_ANNOUNCE : 0; + $forum_data['forum_flags'] += ($forum_data['prune_sticky']) ? FORUM_FLAG_PRUNE_STICKY : 0; + $forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0; + $forum_data['forum_flags'] += ($forum_data['enable_post_review']) ? FORUM_FLAG_POST_REVIEW : 0; + $forum_data['forum_flags'] += ($forum_data['enable_quick_reply']) ? FORUM_FLAG_QUICK_REPLY : 0; + + // Unset data that are not database fields + $forum_data_sql = $forum_data; + + unset($forum_data_sql['forum_link_track']); + unset($forum_data_sql['prune_old_polls']); + unset($forum_data_sql['prune_announce']); + unset($forum_data_sql['prune_sticky']); + unset($forum_data_sql['show_active']); + unset($forum_data_sql['enable_post_review']); + unset($forum_data_sql['enable_quick_reply']); + unset($forum_data_sql['forum_password_confirm']); + + // What are we going to do tonight Brain? The same thing we do everynight, + // try to take over the world ... or decide whether to continue update + // and if so, whether it's a new forum/cat/link or an existing one + if (sizeof($errors)) + { + return $errors; + } + + // As we don't know the old password, it's kinda tricky to detect changes + if ($forum_data_sql['forum_password_unset']) + { + $forum_data_sql['forum_password'] = ''; + } + else if (empty($forum_data_sql['forum_password'])) + { + unset($forum_data_sql['forum_password']); + } + else + { + // Instantiate passwords manager + $passwords_manager = $phpbb_container->get('passwords.manager'); + + $forum_data_sql['forum_password'] = $passwords_manager->hash($forum_data_sql['forum_password']); + } + unset($forum_data_sql['forum_password_unset']); + + /** + * Remove invalid values from forum_data_sql that should not be updated + * + * @event core.acp_manage_forums_update_data_before + * @var array forum_data Array with forum data + * @var array forum_data_sql Array with data we are going to update + * If forum_data_sql[forum_id] is set, we update + * that forum, otherwise a new one is created. + * @since 3.1.0-a1 + */ + $vars = array('forum_data', 'forum_data_sql'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_update_data_before', compact($vars))); + + $is_new_forum = !isset($forum_data_sql['forum_id']); + + if ($is_new_forum) + { + // no forum_id means we're creating a new forum + unset($forum_data_sql['type_action']); + + if ($forum_data_sql['parent_id']) + { + $sql = 'SELECT left_id, right_id, forum_type + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $forum_data_sql['parent_id']; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + if ($row['forum_type'] == FORUM_LINK) + { + $errors[] = $user->lang['PARENT_IS_LINK_FORUM']; + return $errors; + } + + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET left_id = left_id + 2, right_id = right_id + 2 + WHERE left_id > ' . $row['right_id']; + $db->sql_query($sql); + + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET right_id = right_id + 2 + WHERE ' . $row['left_id'] . ' BETWEEN left_id AND right_id'; + $db->sql_query($sql); + + $forum_data_sql['left_id'] = $row['right_id']; + $forum_data_sql['right_id'] = $row['right_id'] + 1; + } + else + { + $sql = 'SELECT MAX(right_id) AS right_id + FROM ' . FORUMS_TABLE; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $forum_data_sql['left_id'] = $row['right_id'] + 1; + $forum_data_sql['right_id'] = $row['right_id'] + 2; + } + + $sql = 'INSERT INTO ' . FORUMS_TABLE . ' ' . $db->sql_build_array('INSERT', $forum_data_sql); + $db->sql_query($sql); + + $forum_data['forum_id'] = $db->sql_nextid(); + + add_log('admin', 'LOG_FORUM_ADD', $forum_data['forum_name']); + } + else + { + $row = $this->get_forum_info($forum_data_sql['forum_id']); + + if ($row['forum_type'] == FORUM_POST && $row['forum_type'] != $forum_data_sql['forum_type']) + { + // Has subforums and want to change into a link? + if ($row['right_id'] - $row['left_id'] > 1 && $forum_data_sql['forum_type'] == FORUM_LINK) + { + $errors[] = $user->lang['FORUM_WITH_SUBFORUMS_NOT_TO_LINK']; + return $errors; + } + + // 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); + + if ($to_forum_id) + { + $errors = $this->move_forum_content($forum_data_sql['forum_id'], $to_forum_id); + } + else + { + return array($user->lang['NO_DESTINATION_FORUM']); + } + } + else if ($forum_data_sql['type_action'] == 'delete') + { + $errors = $this->delete_forum_content($forum_data_sql['forum_id']); + } + else + { + return array($user->lang['NO_FORUM_ACTION']); + } + + $forum_data_sql['forum_posts_approved'] = $forum_data_sql['forum_posts_unapproved'] = $forum_data_sql['forum_posts_softdeleted'] = $forum_data_sql['forum_topics_approved'] = $forum_data_sql['forum_topics_unapproved'] = $forum_data_sql['forum_topics_softdeleted'] = 0; + $forum_data_sql['forum_last_post_id'] = $forum_data_sql['forum_last_poster_id'] = $forum_data_sql['forum_last_post_time'] = 0; + $forum_data_sql['forum_last_poster_name'] = $forum_data_sql['forum_last_poster_colour'] = ''; + } + else if ($row['forum_type'] == FORUM_CAT && $forum_data_sql['forum_type'] == FORUM_LINK) + { + // Has subforums? + 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); + + if ($action_subforums == 'delete') + { + $rows = get_forum_branch($row['forum_id'], 'children', 'descending', false); + + foreach ($rows as $_row) + { + // Do not remove the forum id we are about to change. ;) + if ($_row['forum_id'] == $row['forum_id']) + { + continue; + } + + $forum_ids[] = $_row['forum_id']; + $errors = array_merge($errors, $this->delete_forum_content($_row['forum_id'])); + } + + if (sizeof($errors)) + { + return $errors; + } + + if (sizeof($forum_ids)) + { + $sql = 'DELETE FROM ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids); + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids); + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_USERS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids); + $db->sql_query($sql); + + // Delete forum ids from extension groups table + $sql = 'SELECT group_id, allowed_forums + FROM ' . EXTENSION_GROUPS_TABLE; + $result = $db->sql_query($sql); + + while ($_row = $db->sql_fetchrow($result)) + { + if (!$_row['allowed_forums']) + { + continue; + } + + $allowed_forums = unserialize(trim($_row['allowed_forums'])); + $allowed_forums = array_diff($allowed_forums, $forum_ids); + + $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . " + SET allowed_forums = '" . ((sizeof($allowed_forums)) ? serialize($allowed_forums) : '') . "' + WHERE group_id = {$_row['group_id']}"; + $db->sql_query($sql); + } + $db->sql_freeresult($result); + + $cache->destroy('_extensions'); + } + } + else if ($action_subforums == 'move') + { + if (!$subforums_to_id) + { + return array($user->lang['NO_DESTINATION_FORUM']); + } + + $sql = 'SELECT forum_name + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $subforums_to_id; + $result = $db->sql_query($sql); + $_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$_row) + { + return array($user->lang['NO_FORUM']); + } + + $subforums_to_name = $_row['forum_name']; + + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . " + WHERE parent_id = {$row['forum_id']}"; + $result = $db->sql_query($sql); + + while ($_row = $db->sql_fetchrow($result)) + { + $this->move_forum($_row['forum_id'], $subforums_to_id); + } + $db->sql_freeresult($result); + + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET parent_id = $subforums_to_id + WHERE parent_id = {$row['forum_id']}"; + $db->sql_query($sql); + } + + // Adjust the left/right id + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET right_id = left_id + 1 + WHERE forum_id = ' . $row['forum_id']; + $db->sql_query($sql); + } + } + else if ($row['forum_type'] == FORUM_CAT && $forum_data_sql['forum_type'] == FORUM_POST) + { + // Changing a category to a forum? Reset the data (you can't post directly in a cat, you must use a forum) + $forum_data_sql['forum_posts_approved'] = 0; + $forum_data_sql['forum_posts_unapproved'] = 0; + $forum_data_sql['forum_posts_softdeleted'] = 0; + $forum_data_sql['forum_topics_approved'] = 0; + $forum_data_sql['forum_topics_unapproved'] = 0; + $forum_data_sql['forum_topics_softdeleted'] = 0; + $forum_data_sql['forum_last_post_id'] = 0; + $forum_data_sql['forum_last_post_subject'] = ''; + $forum_data_sql['forum_last_post_time'] = 0; + $forum_data_sql['forum_last_poster_id'] = 0; + $forum_data_sql['forum_last_poster_name'] = ''; + $forum_data_sql['forum_last_poster_colour'] = ''; + } + + if (sizeof($errors)) + { + return $errors; + } + + if ($row['parent_id'] != $forum_data_sql['parent_id']) + { + if ($row['forum_id'] != $forum_data_sql['parent_id']) + { + $errors = $this->move_forum($forum_data_sql['forum_id'], $forum_data_sql['parent_id']); + } + else + { + $forum_data_sql['parent_id'] = $row['parent_id']; + } + } + + if (sizeof($errors)) + { + return $errors; + } + + unset($forum_data_sql['type_action']); + + if ($row['forum_name'] != $forum_data_sql['forum_name']) + { + // the forum name has changed, clear the parents list of all forums (for safety) + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET forum_parents = ''"; + $db->sql_query($sql); + } + + // Setting the forum id to the forum id is not really received well by some dbs. ;) + $forum_id = $forum_data_sql['forum_id']; + unset($forum_data_sql['forum_id']); + + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $forum_data_sql) . ' + WHERE forum_id = ' . $forum_id; + $db->sql_query($sql); + + // Add it back + $forum_data['forum_id'] = $forum_id; + + add_log('admin', 'LOG_FORUM_EDIT', $forum_data['forum_name']); + } + + /** + * Event after a forum was updated or created + * + * @event core.acp_manage_forums_update_data_after + * @var array forum_data Array with forum data + * @var array forum_data_sql Array with data we updated + * @var bool is_new_forum Did we create a forum or update one + * If you want to overwrite this value, + * ensure to set forum_data_sql[forum_id] + * @var array errors Array of errors, should be strings and not + * language key. + * @since 3.1.0-a1 + */ + $vars = array('forum_data', 'forum_data_sql', 'is_new_forum', 'errors'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_update_data_after', compact($vars))); + + return $errors; + } + + /** + * Move forum + */ + function move_forum($from_id, $to_id) + { + global $db, $user, $phpbb_dispatcher; + + $to_data = $moved_ids = $errors = array(); + + // Check if we want to move to a parent with link type + if ($to_id > 0) + { + $to_data = $this->get_forum_info($to_id); + + if ($to_data['forum_type'] == FORUM_LINK) + { + $errors[] = $user->lang['PARENT_IS_LINK_FORUM']; + } + } + + /** + * Event when we move all children of one forum to another + * + * This event may be triggered, when a forum is deleted + * + * @event core.acp_manage_forums_move_children + * @var int from_id If of the current parent forum + * @var int to_id If of the new parent forum + * @var array errors Array of errors, should be strings and not + * language key. + * @since 3.1.0-a1 + */ + $vars = array('from_id', 'to_id', 'errors'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_move_children', compact($vars))); + + // Return if there were errors + if (!empty($errors)) + { + return $errors; + } + + $moved_forums = get_forum_branch($from_id, 'children', 'descending'); + $from_data = $moved_forums[0]; + $diff = sizeof($moved_forums) * 2; + + $moved_ids = array(); + for ($i = 0; $i < sizeof($moved_forums); ++$i) + { + $moved_ids[] = $moved_forums[$i]['forum_id']; + } + + // Resync parents + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET right_id = right_id - $diff, forum_parents = '' + WHERE left_id < " . $from_data['right_id'] . " + AND right_id > " . $from_data['right_id']; + $db->sql_query($sql); + + // Resync righthand side of tree + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET left_id = left_id - $diff, right_id = right_id - $diff, forum_parents = '' + WHERE left_id > " . $from_data['right_id']; + $db->sql_query($sql); + + if ($to_id > 0) + { + // Retrieve $to_data again, it may have been changed... + $to_data = $this->get_forum_info($to_id); + + // Resync new parents + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET right_id = right_id + $diff, forum_parents = '' + WHERE " . $to_data['right_id'] . ' BETWEEN left_id AND right_id + AND ' . $db->sql_in_set('forum_id', $moved_ids, true); + $db->sql_query($sql); + + // Resync the righthand side of the tree + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET left_id = left_id + $diff, right_id = right_id + $diff, forum_parents = '' + WHERE left_id > " . $to_data['right_id'] . ' + AND ' . $db->sql_in_set('forum_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 ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $moved_ids, true); + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $diff = '+ ' . ($row['right_id'] - $from_data['left_id'] + 1); + } + + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET left_id = left_id $diff, right_id = right_id $diff, forum_parents = '' + WHERE " . $db->sql_in_set('forum_id', $moved_ids); + $db->sql_query($sql); + + return $errors; + } + + /** + * Move forum content from one to another forum + */ + function move_forum_content($from_id, $to_id, $sync = true) + { + global $db, $phpbb_dispatcher; + + $errors = array(); + + /** + * Event when we move content from one forum to another + * + * @event core.acp_manage_forums_move_content + * @var int from_id If of the current parent forum + * @var int to_id If of the new parent forum + * @var bool sync Shall we sync the "to"-forum's data + * @var array errors Array of errors, should be strings and not + * language key. If this array is not empty, + * The content will not be moved. + * @since 3.1.0-a1 + */ + $vars = array('from_id', 'to_id', 'sync', 'errors'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_move_content', compact($vars))); + + // Return if there were errors + if (!empty($errors)) + { + return $errors; + } + + $table_ary = array(LOG_TABLE, POSTS_TABLE, TOPICS_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE); + + foreach ($table_ary as $table) + { + $sql = "UPDATE $table + SET forum_id = $to_id + WHERE forum_id = $from_id"; + $db->sql_query($sql); + } + unset($table_ary); + + $table_ary = array(FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, MODERATOR_CACHE_TABLE); + + foreach ($table_ary as $table) + { + $sql = "DELETE FROM $table + WHERE forum_id = $from_id"; + $db->sql_query($sql); + } + + if ($sync) + { + // Delete ghost topics that link back to the same forum then resync counters + sync('topic_moved'); + sync('forum', 'forum_id', $to_id, false, true); + } + + return array(); + } + + /** + * Remove complete forum + */ + function delete_forum($forum_id, $action_posts = 'delete', $action_subforums = 'delete', $posts_to_id = 0, $subforums_to_id = 0) + { + global $db, $user, $cache; + + $forum_data = $this->get_forum_info($forum_id); + + $errors = array(); + $log_action_posts = $log_action_forums = $posts_to_name = $subforums_to_name = ''; + $forum_ids = array($forum_id); + + if ($action_posts == 'delete') + { + $log_action_posts = 'POSTS'; + $errors = array_merge($errors, $this->delete_forum_content($forum_id)); + } + else if ($action_posts == 'move') + { + if (!$posts_to_id) + { + $errors[] = $user->lang['NO_DESTINATION_FORUM']; + } + else + { + $log_action_posts = 'MOVE_POSTS'; + + $sql = 'SELECT forum_name + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $posts_to_id; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + $errors[] = $user->lang['NO_FORUM']; + } + else + { + $posts_to_name = $row['forum_name']; + $errors = array_merge($errors, $this->move_forum_content($forum_id, $posts_to_id)); + } + } + } + + if (sizeof($errors)) + { + return $errors; + } + + if ($action_subforums == 'delete') + { + $log_action_forums = 'FORUMS'; + $rows = get_forum_branch($forum_id, 'children', 'descending', false); + + foreach ($rows as $row) + { + $forum_ids[] = $row['forum_id']; + $errors = array_merge($errors, $this->delete_forum_content($row['forum_id'])); + } + + if (sizeof($errors)) + { + return $errors; + } + + $diff = sizeof($forum_ids) * 2; + + $sql = 'DELETE FROM ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids); + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids); + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_USERS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids); + $db->sql_query($sql); + } + else if ($action_subforums == 'move') + { + if (!$subforums_to_id) + { + $errors[] = $user->lang['NO_DESTINATION_FORUM']; + } + else + { + $log_action_forums = 'MOVE_FORUMS'; + + $sql = 'SELECT forum_name + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $subforums_to_id; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + $errors[] = $user->lang['NO_FORUM']; + } + else + { + $subforums_to_name = $row['forum_name']; + + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . " + WHERE parent_id = $forum_id"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $this->move_forum($row['forum_id'], $subforums_to_id); + } + $db->sql_freeresult($result); + + // Grab new forum data for correct tree updating later + $forum_data = $this->get_forum_info($forum_id); + + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET parent_id = $subforums_to_id + WHERE parent_id = $forum_id"; + $db->sql_query($sql); + + $diff = 2; + $sql = 'DELETE FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . " + WHERE forum_id = $forum_id"; + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_USERS_TABLE . " + WHERE forum_id = $forum_id"; + $db->sql_query($sql); + } + } + + if (sizeof($errors)) + { + return $errors; + } + } + else + { + $diff = 2; + $sql = 'DELETE FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . " + WHERE forum_id = $forum_id"; + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_USERS_TABLE . " + WHERE forum_id = $forum_id"; + $db->sql_query($sql); + } + + // Resync tree + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET right_id = right_id - $diff + WHERE left_id < {$forum_data['right_id']} AND right_id > {$forum_data['right_id']}"; + $db->sql_query($sql); + + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET left_id = left_id - $diff, right_id = right_id - $diff + WHERE left_id > {$forum_data['right_id']}"; + $db->sql_query($sql); + + // Delete forum ids from extension groups table + $sql = 'SELECT group_id, allowed_forums + FROM ' . EXTENSION_GROUPS_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (!$row['allowed_forums']) + { + continue; + } + + $allowed_forums = unserialize(trim($row['allowed_forums'])); + $allowed_forums = array_diff($allowed_forums, $forum_ids); + + $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . " + SET allowed_forums = '" . ((sizeof($allowed_forums)) ? serialize($allowed_forums) : '') . "' + WHERE group_id = {$row['group_id']}"; + $db->sql_query($sql); + } + $db->sql_freeresult($result); + + $cache->destroy('_extensions'); + + $log_action = implode('_', array($log_action_posts, $log_action_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']); + break; + + case 'MOVE_POSTS_FORUMS': + add_log('admin', 'LOG_FORUM_DEL_MOVE_POSTS_FORUMS', $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']); + break; + + case '_MOVE_FORUMS': + add_log('admin', 'LOG_FORUM_DEL_MOVE_FORUMS', $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']); + break; + + case 'POSTS_FORUMS': + add_log('admin', 'LOG_FORUM_DEL_POSTS_FORUMS', $forum_data['forum_name']); + break; + + case '_FORUMS': + add_log('admin', 'LOG_FORUM_DEL_FORUMS', $forum_data['forum_name']); + break; + + case 'POSTS_': + add_log('admin', 'LOG_FORUM_DEL_POSTS', $forum_data['forum_name']); + break; + + default: + add_log('admin', 'LOG_FORUM_DEL_FORUM', $forum_data['forum_name']); + break; + } + + return $errors; + } + + /** + * Delete forum content + */ + function delete_forum_content($forum_id) + { + global $db, $config, $phpbb_root_path, $phpEx; + + include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + + $db->sql_transaction('begin'); + + // Select then delete all attachments + $sql = 'SELECT a.topic_id + FROM ' . POSTS_TABLE . ' p, ' . ATTACHMENTS_TABLE . " a + WHERE p.forum_id = $forum_id + AND a.in_message = 0 + AND a.topic_id = p.topic_id"; + $result = $db->sql_query($sql); + + $topic_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $topic_ids[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + delete_attachments('topic', $topic_ids, false); + + // Delete shadow topics pointing to topics in this forum + delete_topic_shadows($forum_id); + + // Before we remove anything we make sure we are able to adjust the post counts later. ;) + $sql = 'SELECT poster_id + FROM ' . POSTS_TABLE . ' + WHERE forum_id = ' . $forum_id . ' + AND post_postcount = 1 + AND post_visibility = ' . ITEM_APPROVED; + $result = $db->sql_query($sql); + + $post_counts = array(); + while ($row = $db->sql_fetchrow($result)) + { + $post_counts[$row['poster_id']] = (!empty($post_counts[$row['poster_id']])) ? $post_counts[$row['poster_id']] + 1 : 1; + } + $db->sql_freeresult($result); + + switch ($db->get_sql_layer()) + { + case 'mysql4': + case 'mysqli': + + // Delete everything else and thank MySQL for offering multi-table deletion + $tables_ary = array( + SEARCH_WORDMATCH_TABLE => 'post_id', + REPORTS_TABLE => 'post_id', + WARNINGS_TABLE => 'post_id', + BOOKMARKS_TABLE => 'topic_id', + TOPICS_WATCH_TABLE => 'topic_id', + TOPICS_POSTED_TABLE => 'topic_id', + POLL_OPTIONS_TABLE => 'topic_id', + POLL_VOTES_TABLE => 'topic_id', + ); + + $sql = 'DELETE ' . POSTS_TABLE; + $sql_using = "\nFROM " . POSTS_TABLE; + $sql_where = "\nWHERE " . POSTS_TABLE . ".forum_id = $forum_id\n"; + + foreach ($tables_ary as $table => $field) + { + $sql .= ", $table "; + $sql_using .= ", $table "; + $sql_where .= "\nAND $table.$field = " . POSTS_TABLE . ".$field"; + } + + $db->sql_query($sql . $sql_using . $sql_where); + + break; + + default: + + // Delete everything else and curse your DB for not offering multi-table deletion + $tables_ary = array( + 'post_id' => array( + SEARCH_WORDMATCH_TABLE, + REPORTS_TABLE, + WARNINGS_TABLE, + ), + + 'topic_id' => array( + BOOKMARKS_TABLE, + TOPICS_WATCH_TABLE, + TOPICS_POSTED_TABLE, + POLL_OPTIONS_TABLE, + POLL_VOTES_TABLE, + ) + ); + + // Amount of rows we select and delete in one iteration. + $batch_size = 500; + + foreach ($tables_ary as $field => $tables) + { + $start = 0; + + do + { + $sql = "SELECT $field + FROM " . POSTS_TABLE . ' + WHERE forum_id = ' . $forum_id; + $result = $db->sql_query_limit($sql, $batch_size, $start); + + $ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $ids[] = $row[$field]; + } + $db->sql_freeresult($result); + + if (sizeof($ids)) + { + $start += sizeof($ids); + + foreach ($tables as $table) + { + $db->sql_query("DELETE FROM $table WHERE " . $db->sql_in_set($field, $ids)); + } + } + } + while (sizeof($ids) == $batch_size); + } + unset($ids); + + break; + } + + $table_ary = array(FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, LOG_TABLE, MODERATOR_CACHE_TABLE, POSTS_TABLE, TOPICS_TABLE, TOPICS_TRACK_TABLE); + + foreach ($table_ary as $table) + { + $db->sql_query("DELETE FROM $table WHERE forum_id = $forum_id"); + } + + // Set forum ids to 0 + $table_ary = array(DRAFTS_TABLE); + + foreach ($table_ary as $table) + { + $db->sql_query("UPDATE $table SET forum_id = 0 WHERE forum_id = $forum_id"); + } + + // Adjust users post counts + if (sizeof($post_counts)) + { + foreach ($post_counts as $poster_id => $substract) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_posts = 0 + WHERE user_id = ' . $poster_id . ' + AND user_posts < ' . $substract; + $db->sql_query($sql); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_posts = user_posts - ' . $substract . ' + WHERE user_id = ' . $poster_id . ' + AND user_posts >= ' . $substract; + $db->sql_query($sql); + } + } + + $db->sql_transaction('commit'); + + // Make sure the overall post/topic count is correct... + $sql = 'SELECT COUNT(post_id) AS stat + FROM ' . POSTS_TABLE . ' + WHERE post_visibility = ' . ITEM_APPROVED; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + set_config('num_posts', (int) $row['stat'], true); + + $sql = 'SELECT COUNT(topic_id) AS stat + FROM ' . TOPICS_TABLE . ' + WHERE topic_visibility = ' . ITEM_APPROVED; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + set_config('num_topics', (int) $row['stat'], true); + + $sql = 'SELECT COUNT(attach_id) as stat + FROM ' . ATTACHMENTS_TABLE; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + set_config('num_files', (int) $row['stat'], true); + + $sql = 'SELECT SUM(filesize) as stat + FROM ' . ATTACHMENTS_TABLE; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + set_config('upload_dir_size', (float) $row['stat'], true); + + return array(); + } + + /** + * Move forum position by $steps up/down + */ + function move_forum_by($forum_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 forum_id, forum_name, left_id, right_id + FROM ' . FORUMS_TABLE . " + WHERE parent_id = {$forum_row['parent_id']} + AND " . (($action == 'move_up') ? "right_id < {$forum_row['right_id']} ORDER BY right_id DESC" : "left_id > {$forum_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 forum 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 = $target['left_id']; + $right_id = $forum_row['right_id']; + + $diff_up = $forum_row['left_id'] - $target['left_id']; + $diff_down = $forum_row['right_id'] + 1 - $forum_row['left_id']; + + $move_up_left = $forum_row['left_id']; + $move_up_right = $forum_row['right_id']; + } + else + { + $left_id = $forum_row['left_id']; + $right_id = $target['right_id']; + + $diff_up = $forum_row['right_id'] + 1 - $forum_row['left_id']; + $diff_down = $target['right_id'] - $forum_row['right_id']; + + $move_up_left = $forum_row['right_id'] + 1; + $move_up_right = $target['right_id']; + } + + // Now do the dirty job + $sql = 'UPDATE ' . FORUMS_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, + forum_parents = '' + WHERE + left_id BETWEEN {$left_id} AND {$right_id} + AND right_id BETWEEN {$left_id} AND {$right_id}"; + $db->sql_query($sql); + + return $target['forum_name']; + } + + /** + * Display progress bar for syncinc forums + */ + function display_progress_bar($start, $total) + { + global $template, $user; + + adm_page_header($user->lang['SYNC_IN_PROGRESS']); + + $template->set_filenames(array( + 'body' => 'progress_bar.html') + ); + + $template->assign_vars(array( + 'L_PROGRESS' => $user->lang['SYNC_IN_PROGRESS'], + 'L_PROGRESS_EXPLAIN' => ($start && $total) ? sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], $start, $total) : $user->lang['SYNC_IN_PROGRESS']) + ); + + adm_page_footer(); + } + + /** + * Display copy permission page + * Not used at the moment - we will have a look at it for 3.0.7 + */ + function copy_permission_page($forum_data) + { + global $phpEx, $phpbb_admin_path, $template, $user; + + $acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id']; + $action = append_sid($this->u_action . "&parent_id={$this->parent_id}&f={$forum_data['forum_id']}&action=copy_perm"); + + $l_acl = sprintf($user->lang['COPY_TO_ACL'], '', ''); + + $this->tpl_name = 'acp_forums_copy_perm'; + + $template->assign_vars(array( + 'U_ACL' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url), + 'L_ACL_LINK' => $l_acl, + 'L_BACK_LINK' => adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), + 'S_COPY_ACTION' => $action, + 'S_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $forum_data['forum_id'], false, false, false), + )); + } + +} diff --git a/sources/phpBB/includes/acp/acp_groups.php b/sources/phpBB/includes/acp/acp_groups.php new file mode 100644 index 0000000..edfada1 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_groups.php @@ -0,0 +1,1189 @@ + +* @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; +} + +class acp_groups +{ + var $u_action; + + function main($id, $mode) + { + global $config, $db, $user, $auth, $template, $cache; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads; + global $request, $phpbb_container, $phpbb_dispatcher; + + $user->add_lang('acp/groups'); + $this->tpl_name = 'acp_groups'; + $this->page_title = 'ACP_GROUPS_MANAGE'; + + $form_key = 'acp_groups'; + add_form_key($form_key); + + if ($mode == 'position') + { + $this->manage_position(); + return; + } + + 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); + $update = (isset($_POST['update'])) ? true : false; + + // Clear some vars + $group_row = array(); + + // Grab basic data for group, if group_id is set and exists + if ($group_id) + { + $sql = 'SELECT g.*, t.teampage_position AS group_teampage + FROM ' . GROUPS_TABLE . ' g + LEFT JOIN ' . TEAMPAGE_TABLE . ' t + ON (t.group_id = g.group_id) + WHERE g.group_id = ' . $group_id; + $result = $db->sql_query($sql); + $group_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$group_row) + { + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Check if the user is allowed to manage this group if set to founder only. + if ($user->data['user_type'] != USER_FOUNDER && $group_row['group_founder_manage']) + { + trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + + // Which page? + switch ($action) + { + case 'approve': + case 'demote': + case 'promote': + if (!check_form_key($form_key)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Approve, demote or promote + $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name']; + $error = group_user_attributes($action, $group_id, $mark_ary, false, $group_name); + + if (!$error) + { + switch ($action) + { + case 'demote': + $message = 'GROUP_MODS_DEMOTED'; + break; + + case 'promote': + $message = 'GROUP_MODS_PROMOTED'; + break; + + case 'approve': + $message = 'USERS_APPROVED'; + break; + } + + trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); + } + else + { + trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); + } + + break; + + case 'default': + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); + } + else if (empty($mark_ary)) + { + trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); + } + + if (confirm_box(true)) + { + $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name']; + group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row); + trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'mark' => $mark_ary, + 'g' => $group_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action)) + ); + } + break; + + 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']; + + $start = 0; + + do + { + $sql = 'SELECT user_id + FROM ' . USER_GROUP_TABLE . " + WHERE group_id = $group_id + ORDER BY user_id"; + $result = $db->sql_query_limit($sql, 200, $start); + + $mark_ary = array(); + if ($row = $db->sql_fetchrow($result)) + { + do + { + $mark_ary[] = $row['user_id']; + } + while ($row = $db->sql_fetchrow($result)); + + group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row); + + $start = (sizeof($mark_ary) < 200) ? 0 : $start + 200; + } + else + { + $start = 0; + } + $db->sql_freeresult($result); + } + while ($start); + + trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'mark' => $mark_ary, + 'g' => $group_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action)) + ); + } + break; + + case 'deleteusers': + if (empty($mark_ary)) + { + trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); + } + case 'delete': + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); + } + else if ($action === 'delete' && $group_row['group_type'] == GROUP_SPECIAL) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (confirm_box(true)) + { + $error = ''; + + switch ($action) + { + case 'delete': + if (!$auth->acl_get('a_groupdel')) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $error = group_delete($group_id, $group_row['group_name']); + break; + + case 'deleteusers': + $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name']; + $error = group_user_del($group_id, $mark_ary, false, $group_name); + break; + } + + $back_link = ($action == 'delete') ? $this->u_action : $this->u_action . '&action=list&g=' . $group_id; + + if ($error) + { + trigger_error($user->lang[$error] . adm_back_link($back_link), E_USER_WARNING); + } + + $message = ($action == 'delete') ? 'GROUP_DELETED' : 'GROUP_USERS_REMOVE'; + trigger_error($user->lang[$message] . adm_back_link($back_link)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'mark' => $mark_ary, + 'g' => $group_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action)) + ); + } + break; + + case 'addusers': + if (!check_form_key($form_key)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (!$name_ary) + { + trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); + } + + $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']; + + // Add user/s to group + if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, $leader, 0, $group_row)) + { + trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); + } + + $message = ($leader) ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED'; + trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); + break; + + case 'edit': + case 'add': + + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + + $data = $submit_ary = array(); + + if ($action == 'edit' && !$group_id) + { + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if ($action == 'add' && !$auth->acl_get('a_groupadd')) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $error = array(); + $user->add_lang('ucp'); + + // Setup avatar data for later + $avatars_enabled = false; + $avatar_drivers = null; + $avatar_data = null; + $avatar_error = array(); + + if ($config['allow_avatar']) + { + $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); + $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); + + // This is normalised data, without the group_ prefix + $avatar_data = \phpbb\avatar\manager::clean_row($group_row, 'group'); + if (!isset($avatar_data['id'])) + { + $avatar_data['id'] = 'g' . $group_id; + } + } + + if ($request->is_set_post('avatar_delete')) + { + if (confirm_box(true)) + { + $avatar_data['id'] = substr($avatar_data['id'], 1); + $phpbb_avatar_manager->handle_avatar_delete($db, $user, $avatar_data, GROUPS_TABLE, 'group_'); + + $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED'; + trigger_error($user->lang[$message] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, $user->lang('CONFIRM_AVATAR_DELETE'), build_hidden_fields(array( + 'avatar_delete' => true, + 'i' => $id, + 'mode' => $mode, + 'g' => $group_id, + 'action' => $action)) + ); + } + } + + // Did we submit? + if ($update) + { + if (!check_form_key($form_key)) + { + 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); + + $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); + + $submit_ary = array( + 'colour' => request_var('group_colour', ''), + 'rank' => request_var('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), + 'founder_manage' => 0, + 'skip_auth' => request_var('group_skip_auth', 0), + ); + + if ($user->data['user_type'] == USER_FOUNDER) + { + $submit_ary['founder_manage'] = isset($_REQUEST['group_founder_manage']) ? 1 : 0; + } + + if ($config['allow_avatar']) + { + // Handle avatar + $driver_name = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', '')); + + if (in_array($driver_name, $avatar_drivers) && !$request->is_set_post('avatar_delete')) + { + $driver = $phpbb_avatar_manager->get_driver($driver_name); + $result = $driver->process_form($request, $template, $user, $avatar_data, $avatar_error); + + if ($result && empty($avatar_error)) + { + $result['avatar_type'] = $driver_name; + $submit_ary = array_merge($submit_ary, $result); + } + } + else + { + $driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type']); + if ($driver) + { + $driver->delete($avatar_data); + } + + // Removing the avatar + $submit_ary['avatar_type'] = ''; + $submit_ary['avatar'] = ''; + $submit_ary['avatar_width'] = 0; + $submit_ary['avatar_height'] = 0; + } + + // Merge any avatar errors into the primary error array + $error = array_merge($error, $phpbb_avatar_manager->localize_errors($user, $avatar_error)); + } + + /* + * Validate the length of "Maximum number of allowed recipients per + * private message" setting. We use 16777215 as a maximum because it matches + * MySQL unsigned mediumint maximum value which is the lowest amongst DBMSes + * supported by phpBB3. Also validate the submitted colour value. + */ + $validation_checks = array( + 'max_recipients' => array('num', false, 0, 16777215), + 'colour' => array('hex_colour', true), + ); + + /** + * Request group data and operate on it + * + * @event core.acp_manage_group_request_data + * @var string action Type of the action: add|edit + * @var int group_id The group id + * @var array group_row Array with new group data + * @var array error Array of errors, if you add errors + * ensure to update the template variables + * S_ERROR and ERROR_MSG to display it + * @var string group_name The group name + * @var string group_desc The group description + * @var int group_type The group type + * @var bool allow_desc_bbcode Allow bbcode in group description: true|false + * @var bool allow_desc_urls Allow urls in group description: true|false + * @var bool allow_desc_smilies Allow smiles in group description: true|false + * @var array submit_ary Array with new group data + * @var array validation_checks Array with validation data + * @since 3.1.0-b5 + */ + $vars = array( + 'action', + 'group_id', + 'group_row', + 'error', + 'group_name', + 'group_desc', + 'group_type', + 'allow_desc_bbcode', + 'allow_desc_urls', + 'allow_desc_smilies', + 'submit_ary', + 'validation_checks', + ); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_group_request_data', compact($vars))); + + if ($validation_error = validate_data($submit_ary, $validation_checks)) + { + // Replace "error" string with its real, localised form + $error = array_merge($error, $validation_error); + } + + if (!sizeof($error)) + { + // Only set the rank, colour, etc. if it's changed or if we're adding a new + // group. This prevents existing group members being updated if no changes + // were made. + // However there are some attributes that need to be set everytime, + // otherwise the group gets removed from the feature. + $set_attributes = array('legend', 'teampage'); + + $group_attributes = array(); + $test_variables = array( + 'rank' => 'int', + 'colour' => 'string', + 'avatar' => 'string', + 'avatar_type' => 'string', + 'avatar_width' => 'int', + 'avatar_height' => 'int', + 'receive_pm' => 'int', + 'legend' => 'int', + 'teampage' => 'int', + 'message_limit' => 'int', + 'max_recipients'=> 'int', + 'founder_manage'=> 'int', + 'skip_auth' => 'int', + ); + + /** + * Initialise data before we display the add/edit form + * + * @event core.acp_manage_group_initialise_data + * @var string action Type of the action: add|edit + * @var int group_id The group id + * @var array group_row Array with new group data + * @var array error Array of errors, if you add errors + * ensure to update the template variables + * S_ERROR and ERROR_MSG to display it + * @var string group_name The group name + * @var string group_desc The group description + * @var int group_type The group type + * @var bool allow_desc_bbcode Allow bbcode in group description: true|false + * @var bool allow_desc_urls Allow urls in group description: true|false + * @var bool allow_desc_smilies Allow smiles in group description: true|false + * @var array submit_ary Array with new group data + * @var array test_variables Array with variables for test + * @since 3.1.0-b5 + */ + $vars = array( + 'action', + 'group_id', + 'group_row', + 'error', + 'group_name', + 'group_desc', + 'group_type', + 'allow_desc_bbcode', + 'allow_desc_urls', + 'allow_desc_smilies', + 'submit_ary', + 'test_variables', + ); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_group_initialise_data', compact($vars))); + + foreach ($test_variables as $test => $type) + { + if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test] || isset($group_attributes['group_avatar']) && strpos($test, 'avatar') === 0 || in_array($test, $set_attributes))) + { + settype($submit_ary[$test], $type); + $group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test]; + } + } + + 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); + + // Copy permissions? + // If the user has the a_authgroups permission and at least one additional permission ability set the permissions are fully transferred. + // We do not limit on one auth category because this can lead to incomplete permissions being tricky to fix for the admin, roles being assigned or added non-default permissions. + // Since the user only has the option to copy permissions from non leader managed groups this seems to be a good compromise. + if ($group_perm_from && $action == 'add' && $auth->acl_get('a_authgroups') && $auth->acl_gets('a_aauth', 'a_fauth', 'a_mauth', 'a_uauth')) + { + $sql = 'SELECT group_founder_manage + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . $group_perm_from; + $result = $db->sql_query($sql); + $check_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + // Check the group if non-founder + if ($check_row && ($user->data['user_type'] == USER_FOUNDER || $check_row['group_founder_manage'] == 0)) + { + // From the mysql documentation: + // Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14. + // Due to this we stay on the safe side if we do the insertion "the manual way" + + // Copy permisisons from/to the acl groups table (only group_id gets changed) + $sql = 'SELECT forum_id, auth_option_id, auth_role_id, auth_setting + FROM ' . ACL_GROUPS_TABLE . ' + WHERE group_id = ' . $group_perm_from; + $result = $db->sql_query($sql); + + $groups_sql_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $groups_sql_ary[] = array( + 'group_id' => (int) $group_id, + 'forum_id' => (int) $row['forum_id'], + 'auth_option_id' => (int) $row['auth_option_id'], + 'auth_role_id' => (int) $row['auth_role_id'], + 'auth_setting' => (int) $row['auth_setting'] + ); + } + $db->sql_freeresult($result); + + // Now insert the data + $db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary); + + $auth->acl_clear_prefetch(); + } + } + + $cache->destroy('sql', array(GROUPS_TABLE, TEAMPAGE_TABLE)); + + $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED'; + trigger_error($user->lang[$message] . adm_back_link($this->u_action)); + } + } + + if (sizeof($error)) + { + $error = array_map(array(&$user, 'lang'), $error); + $group_rank = $submit_ary['rank']; + + $group_desc_data = array( + 'text' => $group_desc, + 'allow_bbcode' => $allow_desc_bbcode, + 'allow_smilies' => $allow_desc_smilies, + 'allow_urls' => $allow_desc_urls + ); + } + } + else if (!$group_id) + { + $group_name = utf8_normalize_nfc(request_var('group_name', '', true)); + $group_desc_data = array( + 'text' => '', + 'allow_bbcode' => true, + 'allow_smilies' => true, + 'allow_urls' => true + ); + $group_rank = 0; + $group_type = GROUP_OPEN; + } + else + { + $group_name = $group_row['group_name']; + $group_desc_data = generate_text_for_edit($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_options']); + $group_type = $group_row['group_type']; + $group_rank = $group_row['group_rank']; + } + + $sql = 'SELECT * + FROM ' . RANKS_TABLE . ' + WHERE rank_special = 1 + ORDER BY rank_title'; + $result = $db->sql_query($sql); + + $rank_options = ''; + + while ($row = $db->sql_fetchrow($result)) + { + $selected = ($group_rank && $row['rank_id'] == $group_rank) ? ' selected="selected"' : ''; + $rank_options .= ''; + } + $db->sql_freeresult($result); + + $type_free = ($group_type == GROUP_FREE) ? ' checked="checked"' : ''; + $type_open = ($group_type == GROUP_OPEN) ? ' checked="checked"' : ''; + $type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : ''; + $type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : ''; + + // Load up stuff for avatars + if ($config['allow_avatar']) + { + $avatars_enabled = false; + $selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $avatar_data['avatar_type'])); + + foreach ($avatar_drivers as $current_driver) + { + $driver = $phpbb_avatar_manager->get_driver($current_driver); + + $avatars_enabled = true; + $config_name = $phpbb_avatar_manager->get_driver_config_name($driver); + $template->set_filenames(array( + 'avatar' => "acp_avatar_options_{$config_name}.html", + )); + + if ($driver->prepare_form($request, $template, $user, $avatar_data, $avatar_error)) + { + $driver_name = $phpbb_avatar_manager->prepare_driver_name($current_driver); + $driver_upper = strtoupper($driver_name); + $template->assign_block_vars('avatar_drivers', array( + 'L_TITLE' => $user->lang($driver_upper . '_TITLE'), + 'L_EXPLAIN' => $user->lang($driver_upper . '_EXPLAIN'), + + 'DRIVER' => $driver_name, + 'SELECTED' => $current_driver == $selected_driver, + 'OUTPUT' => $template->assign_display('avatar'), + )); + } + } + } + + $avatar = phpbb_get_group_avatar($group_row, 'GROUP_AVATAR', true); + + if (isset($phpbb_avatar_manager) && !$update) + { + // Merge any avatar errors into the primary error array + $error = array_merge($error, $phpbb_avatar_manager->localize_errors($user, $avatar_error)); + } + + $back_link = request_var('back_link', ''); + + switch ($back_link) + { + case 'acp_users_groups': + $u_back = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=groups&u=' . request_var('u', 0)); + break; + + default: + $u_back = $this->u_action; + break; + } + + $template->assign_vars(array( + 'S_EDIT' => true, + 'S_ADD_GROUP' => ($action == 'add') ? true : false, + 'S_GROUP_PERM' => ($action == 'add' && $auth->acl_get('a_authgroups') && $auth->acl_gets('a_aauth', 'a_fauth', 'a_mauth', 'a_uauth')) ? true : false, + 'S_INCLUDE_SWATCH' => true, + 'S_ERROR' => (sizeof($error)) ? true : false, + 'S_SPECIAL_GROUP' => ($group_type == GROUP_SPECIAL) ? true : false, + 'S_USER_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false, + 'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled), + + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', + 'GROUP_NAME' => ($group_type == GROUP_SPECIAL) ? $user->lang['G_' . $group_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"' : '', + 'GROUP_FOUNDER_MANAGE' => (isset($group_row['group_founder_manage']) && $group_row['group_founder_manage']) ? ' checked="checked"' : '', + 'GROUP_LEGEND' => (isset($group_row['group_legend']) && $group_row['group_legend']) ? ' checked="checked"' : '', + 'GROUP_TEAMPAGE' => (isset($group_row['group_teampage']) && $group_row['group_teampage']) ? ' checked="checked"' : '', + 'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0, + 'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0, + 'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '', + 'GROUP_SKIP_AUTH' => (!empty($group_row['group_skip_auth'])) ? ' checked="checked"' : '', + + 'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'], + 'S_DESC_URLS_CHECKED' => $group_desc_data['allow_urls'], + 'S_DESC_SMILIES_CHECKED'=> $group_desc_data['allow_smilies'], + + 'S_RANK_OPTIONS' => $rank_options, + 'S_GROUP_OPTIONS' => group_select_options(false, false, (($user->data['user_type'] == USER_FOUNDER) ? false : 0)), + 'AVATAR' => empty($avatar) ? '' : $avatar, + 'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'], + 'AVATAR_WIDTH' => (isset($group_row['group_avatar_width'])) ? $group_row['group_avatar_width'] : '', + 'AVATAR_HEIGHT' => (isset($group_row['group_avatar_height'])) ? $group_row['group_avatar_height'] : '', + + 'GROUP_TYPE_FREE' => GROUP_FREE, + 'GROUP_TYPE_OPEN' => GROUP_OPEN, + 'GROUP_TYPE_CLOSED' => GROUP_CLOSED, + 'GROUP_TYPE_HIDDEN' => GROUP_HIDDEN, + 'GROUP_TYPE_SPECIAL' => GROUP_SPECIAL, + + 'GROUP_FREE' => $type_free, + 'GROUP_OPEN' => $type_open, + 'GROUP_CLOSED' => $type_closed, + 'GROUP_HIDDEN' => $type_hidden, + + 'U_BACK' => $u_back, + 'U_ACTION' => "{$this->u_action}&action=$action&g=$group_id", + 'L_AVATAR_EXPLAIN' => phpbb_avatar_explanation_string(), + )); + + /** + * Modify group template data before we display the form + * + * @event core.acp_manage_group_display_form + * @var string action Type of the action: add|edit + * @var bool update Do we display the form only + * or did the user press submit + * @var int group_id The group id + * @var array group_row Array with new group data + * @var string group_name The group name + * @var int group_type The group type + * @var array group_desc_data The group description data + * @var string group_rank The group rank + * @var string rank_options The rank options + * @var array error Array of errors, if you add errors + * ensure to update the template variables + * S_ERROR and ERROR_MSG to display it + * @since 3.1.0-b5 + */ + $vars = array( + 'action', + 'update', + 'group_id', + 'group_row', + 'group_desc_data', + 'group_name', + 'group_type', + 'group_rank', + 'rank_options', + 'error', + ); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_group_display_form', compact($vars))); + + return; + break; + + case 'list': + + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $this->page_title = 'GROUP_MEMBERS'; + $pagination = $phpbb_container->get('pagination'); + + // 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 + FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug + WHERE ug.group_id = $group_id + AND u.user_id = ug.user_id + AND ug.group_leader = 1 + ORDER BY ug.group_leader DESC, ug.user_pending ASC, u.username_clean"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('leader', array( + 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&action=edit&u={$row['user_id']}"), + + 'USERNAME' => $row['username'], + 'USERNAME_COLOUR' => $row['user_colour'], + 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, + 'JOINED' => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ', + 'USER_POSTS' => $row['user_posts'], + 'USER_ID' => $row['user_id'], + )); + } + $db->sql_freeresult($result); + + // Total number of group members (non-leaders) + $sql = 'SELECT COUNT(user_id) AS total_members + FROM ' . USER_GROUP_TABLE . " + WHERE group_id = $group_id + AND group_leader = 0"; + $result = $db->sql_query($sql); + $total_members = (int) $db->sql_fetchfield('total_members'); + $db->sql_freeresult($result); + + $s_action_options = ''; + $options = array('default' => 'DEFAULT', 'approve' => 'APPROVE', 'demote' => 'DEMOTE', 'promote' => 'PROMOTE', 'deleteusers' => 'DELETE'); + + foreach ($options as $option => $lang) + { + $s_action_options .= ''; + } + + $base_url = $this->u_action . "&action=$action&g=$group_id"; + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_members, $config['topics_per_page'], $start); + + $template->assign_vars(array( + 'S_LIST' => true, + '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'], + + 'U_ACTION' => $this->u_action . "&g=$group_id", + 'U_BACK' => $this->u_action, + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=list&field=usernames'), + 'U_DEFAULT_ALL' => "{$this->u_action}&action=set_default_on_all&g=$group_id", + )); + + // Grab the members + $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 + FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug + WHERE ug.group_id = $group_id + AND u.user_id = ug.user_id + AND ug.group_leader = 0 + ORDER BY ug.group_leader DESC, ug.user_pending ASC, u.username_clean"; + $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); + + $pending = false; + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['user_pending'] && !$pending) + { + $template->assign_block_vars('member', array( + 'S_PENDING' => true) + ); + + $pending = true; + } + + $template->assign_block_vars('member', array( + 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&action=edit&u={$row['user_id']}"), + + 'USERNAME' => $row['username'], + 'USERNAME_COLOUR' => $row['user_colour'], + 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, + 'JOINED' => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ', + 'USER_POSTS' => $row['user_posts'], + 'USER_ID' => $row['user_id']) + ); + } + $db->sql_freeresult($result); + + return; + break; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'S_GROUP_ADD' => ($auth->acl_get('a_groupadd')) ? true : false) + ); + + // Get us all the groups + $sql = 'SELECT g.group_id, g.group_name, g.group_type + FROM ' . GROUPS_TABLE . ' g + ORDER BY g.group_type ASC, g.group_name'; + $result = $db->sql_query($sql); + + $lookup = $cached_group_data = array(); + while ($row = $db->sql_fetchrow($result)) + { + $type = ($row['group_type'] == GROUP_SPECIAL) ? 'special' : 'normal'; + + // used to determine what type a group is + $lookup[$row['group_id']] = $type; + + // used for easy access to the data within a group + $cached_group_data[$type][$row['group_id']] = $row; + $cached_group_data[$type][$row['group_id']]['total_members'] = 0; + } + $db->sql_freeresult($result); + + // How many people are in which group? + $sql = 'SELECT COUNT(ug.user_id) AS total_members, ug.group_id + FROM ' . USER_GROUP_TABLE . ' ug + WHERE ' . $db->sql_in_set('ug.group_id', array_keys($lookup)) . ' + GROUP BY ug.group_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $type = $lookup[$row['group_id']]; + $cached_group_data[$type][$row['group_id']]['total_members'] = $row['total_members']; + } + $db->sql_freeresult($result); + + // The order is... normal, then special + ksort($cached_group_data); + + foreach ($cached_group_data as $type => $row_ary) + { + if ($type == 'special') + { + $template->assign_block_vars('groups', array( + 'S_SPECIAL' => true) + ); + } + + foreach ($row_ary as $group_id => $row) + { + $group_name = (!empty($user->lang['G_' . $row['group_name']]))? $user->lang['G_' . $row['group_name']] : $row['group_name']; + + $template->assign_block_vars('groups', array( + 'U_LIST' => "{$this->u_action}&action=list&g=$group_id", + 'U_EDIT' => "{$this->u_action}&action=edit&g=$group_id", + 'U_DELETE' => ($auth->acl_get('a_groupdel')) ? "{$this->u_action}&action=delete&g=$group_id" : '', + + 'S_GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL) ? true : false, + + 'GROUP_NAME' => $group_name, + 'TOTAL_MEMBERS' => $row['total_members'], + )); + } + } + } + + public function manage_position() + { + global $config, $db, $template, $user, $request, $phpbb_container; + + $this->tpl_name = 'acp_groups_position'; + $this->page_title = 'ACP_GROUPS_POSITION'; + + $field = $request->variable('field', ''); + $action = $request->variable('action', ''); + $group_id = $request->variable('g', 0); + $teampage_id = $request->variable('t', 0); + $category_id = $request->variable('c', 0); + + if ($field && !in_array($field, array('legend', 'teampage'))) + { + // Invalid mode + trigger_error($user->lang['NO_MODE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + else if ($field && in_array($field, array('legend', 'teampage'))) + { + + $group_position = $phpbb_container->get('groupposition.' . $field); + } + + if ($field == 'teampage') + { + try + { + switch ($action) + { + case 'add': + $group_position->add_group_teampage($group_id, $category_id); + break; + + case 'add_category': + $group_position->add_category_teampage($request->variable('category_name', '', true)); + break; + + case 'delete': + $group_position->delete_teampage($teampage_id); + break; + + case 'move_up': + $group_position->move_up_teampage($teampage_id); + break; + + case 'move_down': + $group_position->move_down_teampage($teampage_id); + break; + } + } + catch (\phpbb\groupposition\exception $exception) + { + trigger_error($user->lang($exception->getMessage()) . adm_back_link($this->u_action), E_USER_WARNING); + } + } + else if ($field == 'legend') + { + try + { + switch ($action) + { + case 'add': + $group_position->add_group($group_id); + break; + + case 'delete': + $group_position->delete_group($group_id); + break; + + case 'move_up': + $group_position->move_up($group_id); + break; + + case 'move_down': + $group_position->move_down($group_id); + break; + } + } + catch (\phpbb\groupposition\exception $exception) + { + trigger_error($user->lang($exception->getMessage()) . adm_back_link($this->u_action), E_USER_WARNING); + } + } + else + { + switch ($action) + { + case 'set_config_teampage': + $config->set('teampage_forums', $request->variable('teampage_forums', 0)); + $config->set('teampage_memberships', $request->variable('teampage_memberships', 0)); + trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); + break; + + case 'set_config_legend': + $config->set('legend_sort_groupname', $request->variable('legend_sort_groupname', 0)); + trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); + break; + } + } + + if (($action == 'move_up' || $action == 'move_down') && $request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array('success' => true)); + } + + $sql = 'SELECT group_id, group_name, group_colour, group_type, group_legend + FROM ' . GROUPS_TABLE . ' + ORDER BY group_legend ASC, group_type DESC, group_name ASC'; + $result = $db->sql_query($sql); + + $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']; + if ($row['group_legend']) + { + $template->assign_block_vars('legend', array( + 'GROUP_NAME' => $group_name, + 'GROUP_COLOUR' => ($row['group_colour']) ? '#' . $row['group_colour'] : '', + 'GROUP_TYPE' => $user->lang[\phpbb\groupposition\legend::group_type_language($row['group_type'])], + + 'U_MOVE_DOWN' => "{$this->u_action}&field=legend&action=move_down&g=" . $row['group_id'], + 'U_MOVE_UP' => "{$this->u_action}&field=legend&action=move_up&g=" . $row['group_id'], + 'U_DELETE' => "{$this->u_action}&field=legend&action=delete&g=" . $row['group_id'], + )); + } + else + { + $template->assign_block_vars('add_legend', array( + 'GROUP_ID' => (int) $row['group_id'], + 'GROUP_NAME' => $group_name, + 'GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL), + )); + } + } + $db->sql_freeresult($result); + + $category_url_param = (($category_id) ? '&c=' . $category_id : ''); + + $sql = 'SELECT t.*, g.group_name, g.group_colour, g.group_type + FROM ' . TEAMPAGE_TABLE . ' t + LEFT JOIN ' . GROUPS_TABLE . ' g + ON (t.group_id = g.group_id) + WHERE t.teampage_parent = ' . $category_id . ' + OR t.teampage_id = ' . $category_id . ' + ORDER BY t.teampage_position ASC'; + $result = $db->sql_query($sql); + + $category_data = array(); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['teampage_id'] == $category_id) + { + $template->assign_vars(array( + 'CURRENT_CATEGORY_NAME' => $row['teampage_name'], + )); + continue; + } + + if ($row['group_id']) + { + $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']; + $group_type = $user->lang[\phpbb\groupposition\teampage::group_type_language($row['group_type'])]; + } + else + { + $group_name = $row['teampage_name']; + $group_type = ''; + } + + $template->assign_block_vars('teampage', array( + 'GROUP_NAME' => $group_name, + 'GROUP_COLOUR' => ($row['group_colour']) ? '#' . $row['group_colour'] : '', + 'GROUP_TYPE' => $group_type, + + 'U_CATEGORY' => (!$row['group_id']) ? "{$this->u_action}&c=" . $row['teampage_id'] : '', + 'U_MOVE_DOWN' => "{$this->u_action}&field=teampage&action=move_down{$category_url_param}&t=" . $row['teampage_id'], + 'U_MOVE_UP' => "{$this->u_action}&field=teampage&action=move_up{$category_url_param}&t=" . $row['teampage_id'], + 'U_DELETE' => "{$this->u_action}&field=teampage&action=delete{$category_url_param}&t=" . $row['teampage_id'], + )); + } + $db->sql_freeresult($result); + + $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type + FROM ' . GROUPS_TABLE . ' g + LEFT JOIN ' . TEAMPAGE_TABLE . ' t + ON (t.group_id = g.group_id) + WHERE t.teampage_id IS NULL + ORDER BY g.group_type DESC, g.group_name ASC'; + $result = $db->sql_query($sql); + + $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']; + $template->assign_block_vars('add_teampage', array( + 'GROUP_ID' => (int) $row['group_id'], + 'GROUP_NAME' => $group_name, + 'GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL), + )); + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'U_ACTION_LEGEND' => $this->u_action . '&field=legend', + 'U_ACTION_TEAMPAGE' => $this->u_action . '&field=teampage' . $category_url_param, + 'U_ACTION_TEAMPAGE_CAT' => $this->u_action . '&field=teampage_cat', + + 'S_TEAMPAGE_CATEGORY' => $category_id, + 'DISPLAY_FORUMS' => ($config['teampage_forums']) ? true : false, + 'DISPLAY_MEMBERSHIPS' => $config['teampage_memberships'], + 'LEGEND_SORT_GROUPNAME' => ($config['legend_sort_groupname']) ? true : false, + )); + } +} diff --git a/sources/phpBB/includes/acp/acp_icons.php b/sources/phpBB/includes/acp/acp_icons.php new file mode 100644 index 0000000..9265415 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_icons.php @@ -0,0 +1,963 @@ + +* @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; +} + +/** +* @todo [smilies] check regular expressions for special char replacements (stored specialchared in db) +*/ +class acp_icons +{ + var $u_action; + + function main($id, $mode) + { + global $db, $user, $auth, $template, $cache; + 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 = (isset($_POST['add'])) ? 'add' : $action; + $action = (isset($_POST['edit'])) ? 'edit' : $action; + $action = (isset($_POST['import'])) ? 'import' : $action; + $icon_id = request_var('id', 0); + + $mode = ($mode == 'smilies') ? 'smilies' : 'icons'; + + $this->tpl_name = 'acp_icons'; + + // What are we working on? + switch ($mode) + { + case 'smilies': + $table = SMILIES_TABLE; + $lang = 'SMILIES'; + $fields = 'smiley'; + $img_path = $config['smilies_path']; + break; + + case 'icons': + $table = ICONS_TABLE; + $lang = 'ICONS'; + $fields = 'icons'; + $img_path = $config['icons_path']; + break; + } + + $this->page_title = 'ACP_' . $lang; + + // Clear some arrays + $_images = $_paks = array(); + $notice = ''; + + // Grab file list of paks and images + if ($action == 'edit' || $action == 'add' || $action == 'import') + { + $imglist = filelist($phpbb_root_path . $img_path, ''); + + foreach ($imglist as $path => $img_ary) + { + if (empty($img_ary)) + { + continue; + } + + asort($img_ary, SORT_STRING); + + foreach ($img_ary as $img) + { + $img_size = getimagesize($phpbb_root_path . $img_path . '/' . $path . $img); + + if (!$img_size[0] || !$img_size[1] || strlen($img) > 255) + { + continue; + } + + // adjust the width and height to be lower than 128px while perserving the aspect ratio (for icons) + if ($mode == 'icons') + { + if ($img_size[0] > 127 && $img_size[0] > $img_size[1]) + { + $img_size[1] = (int) ($img_size[1] * (127 / $img_size[0])); + $img_size[0] = 127; + } + else if ($img_size[1] > 127) + { + $img_size[0] = (int) ($img_size[0] * (127 / $img_size[1])); + $img_size[1] = 127; + } + } + + $_images[$path . $img]['file'] = $path . $img; + $_images[$path . $img]['width'] = $img_size[0]; + $_images[$path . $img]['height'] = $img_size[1]; + } + } + unset($imglist); + + if ($dir = @opendir($phpbb_root_path . $img_path)) + { + while (($file = readdir($dir)) !== false) + { + if (is_file($phpbb_root_path . $img_path . '/' . $file) && preg_match('#\.pak$#i', $file)) + { + $_paks[] = $file; + } + } + closedir($dir); + + if (!empty($_paks)) + { + asort($_paks, SORT_STRING); + } + } + } + + // What shall we do today? Oops, I believe that's trademarked ... + switch ($action) + { + case 'edit': + unset($_images); + $_images = array(); + + // no break; + + case 'add': + + $smilies = $default_row = array(); + $smiley_options = $order_list = $add_order_list = ''; + + if ($action == 'add' && $mode == 'smilies') + { + $sql = 'SELECT * + FROM ' . SMILIES_TABLE . ' + ORDER BY smiley_order'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (empty($smilies[$row['smiley_url']])) + { + $smilies[$row['smiley_url']] = $row; + } + } + $db->sql_freeresult($result); + + if (sizeof($smilies)) + { + foreach ($smilies as $row) + { + $selected = false; + + if (!$smiley_options) + { + $selected = true; + $default_row = $row; + } + $smiley_options .= ''; + + $template->assign_block_vars('smile', array( + 'SMILEY_URL' => addslashes($row['smiley_url']), + 'CODE' => addslashes($row['code']), + 'EMOTION' => addslashes($row['emotion']), + 'WIDTH' => $row['smiley_width'], + 'HEIGHT' => $row['smiley_height'], + 'ORDER' => $row['smiley_order'] + 1, + )); + } + } + } + + $sql = "SELECT * + FROM $table + ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC'); + $result = $db->sql_query($sql); + + $data = array(); + $after = false; + $display = 0; + $order_lists = array('', ''); + $add_order_lists = array('', ''); + $display_count = 0; + + while ($row = $db->sql_fetchrow($result)) + { + if ($action == 'add') + { + unset($_images[$row[$fields . '_url']]); + } + + if ($row[$fields . '_id'] == $icon_id) + { + $after = true; + $display = $row['display_on_posting']; + $data[$row[$fields . '_url']] = $row; + } + else + { + if ($action == 'edit' && !$icon_id) + { + $data[$row[$fields . '_url']] = $row; + } + + $selected = ''; + if (!empty($after)) + { + $selected = ' selected="selected"'; + $after = false; + } + if ($row['display_on_posting']) + { + $display_count++; + } + $after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url']; + $order_lists[$row['display_on_posting']] = '' . $order_lists[$row['display_on_posting']]; + + if (!empty($default_row)) + { + $add_order_lists[$row['display_on_posting']] = '' . $add_order_lists[$row['display_on_posting']]; + } + } + } + $db->sql_freeresult($result); + + $order_list = ''; + $add_order_list = ''; + + if ($action == 'add') + { + $data = $_images; + } + + $colspan = (($mode == 'smilies') ? 7 : 5); + $colspan += ($icon_id) ? 1 : 0; + $colspan += ($action == 'add') ? 2 : 0; + + $template->assign_vars(array( + 'S_EDIT' => true, + 'S_SMILIES' => ($mode == 'smilies') ? true : false, + 'S_ADD' => ($action == 'add') ? true : false, + + 'S_ORDER_LIST_DISPLAY' => $order_list . $order_lists[1], + 'S_ORDER_LIST_UNDISPLAY' => $order_list . $order_lists[0], + 'S_ORDER_LIST_DISPLAY_COUNT' => $display_count + 1, + + 'L_TITLE' => $user->lang['ACP_' . $lang], + 'L_EXPLAIN' => $user->lang['ACP_' . $lang . '_EXPLAIN'], + 'L_CONFIG' => $user->lang[$lang . '_CONFIG'], + 'L_URL' => $user->lang[$lang . '_URL'], + 'L_LOCATION' => $user->lang[$lang . '_LOCATION'], + 'L_WIDTH' => $user->lang[$lang . '_WIDTH'], + 'L_HEIGHT' => $user->lang[$lang . '_HEIGHT'], + 'L_ORDER' => $user->lang[$lang . '_ORDER'], + 'L_NO_ICONS' => $user->lang['NO_' . $lang . '_' . strtoupper($action)], + + 'COLSPAN' => $colspan, + 'ID' => $icon_id, + + 'U_BACK' => $this->u_action, + 'U_ACTION' => $this->u_action . '&action=' . (($action == 'add') ? 'create' : 'modify'), + )); + + foreach ($data as $img => $img_row) + { + $template->assign_block_vars('items', array( + 'IMG' => $img, + 'A_IMG' => addslashes($img), + 'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $img, + + 'CODE' => ($mode == 'smilies' && isset($img_row['code'])) ? $img_row['code'] : '', + 'EMOTION' => ($mode == 'smilies' && isset($img_row['emotion'])) ? $img_row['emotion'] : '', + + 'S_ID' => (isset($img_row[$fields . '_id'])) ? true : false, + 'ID' => (isset($img_row[$fields . '_id'])) ? $img_row[$fields . '_id'] : 0, + 'WIDTH' => (!empty($img_row[$fields .'_width'])) ? $img_row[$fields .'_width'] : $img_row['width'], + 'HEIGHT' => (!empty($img_row[$fields .'_height'])) ? $img_row[$fields .'_height'] : $img_row['height'], + 'POSTING_CHECKED' => (!empty($img_row['display_on_posting']) || $action == 'add') ? ' checked="checked"' : '', + )); + } + + // Ok, another row for adding an addition code for a pre-existing image... + if ($action == 'add' && $mode == 'smilies' && sizeof($smilies)) + { + $template->assign_vars(array( + 'S_ADD_CODE' => true, + + 'S_IMG_OPTIONS' => $smiley_options, + + 'S_ADD_ORDER_LIST_DISPLAY' => $add_order_list . $add_order_lists[1], + 'S_ADD_ORDER_LIST_UNDISPLAY' => $add_order_list . $add_order_lists[0], + + 'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $default_row['smiley_url'], + 'IMG_PATH' => $img_path, + + 'CODE' => $default_row['code'], + 'EMOTION' => $default_row['emotion'], + + 'WIDTH' => $default_row['smiley_width'], + 'HEIGHT' => $default_row['smiley_height'], + )); + } + + return; + + break; + + case 'create': + case 'modify': + + // Get items to create/modify + $images = (isset($_POST['image'])) ? array_keys(request_var('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(); + + // 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)); + + if ($add_image && $add_emotion && $add_code) + { + $images[] = $add_image; + $image_add[$add_image] = true; + + $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); + + 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); + } + } + + if ($mode == 'smilies' && $action == 'create') + { + $smiley_count = $this->item_count($table); + + $addable_smileys_count = sizeof($images); + foreach ($images as $image) + { + if (!isset($image_add[$image])) + { + --$addable_smileys_count; + } + } + + if ($smiley_count + $addable_smileys_count > SMILEY_LIMIT) + { + trigger_error($user->lang('TOO_MANY_SMILIES', SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING); + } + } + + $icons_updated = 0; + $errors = array(); + foreach ($images as $image) + { + if ($mode == 'smilies' && ($image_emotion[$image] == '' || $image_code[$image] == '')) + { + $errors[$image] = 'SMILIE_NO_' . (($image_emotion[$image] == '') ? 'EMOTION' : 'CODE'); + } + else if ($action == 'create' && !isset($image_add[$image])) + { + // skip images where add wasn't checked + } + else if (!file_exists($phpbb_root_path . $img_path . '/' . $image)) + { + $errors[$image] = 'SMILIE_NO_FILE'; + } + else + { + if ($image_width[$image] == 0 || $image_height[$image] == 0) + { + $img_size = getimagesize($phpbb_root_path . $img_path . '/' . $image); + $image_width[$image] = $img_size[0]; + $image_height[$image] = $img_size[1]; + } + + // Adjust image width/height for icons + if ($mode == 'icons') + { + if ($image_width[$image] > 127 && $image_width[$image] > $image_height[$image]) + { + $image_height[$image] = (int) ($image_height[$image] * (127 / $image_width[$image])); + $image_width[$image] = 127; + } + else if ($image_height[$image] > 127) + { + $image_width[$image] = (int) ($image_width[$image] * (127 / $image_height[$image])); + $image_height[$image] = 127; + } + } + + $img_sql = array( + $fields . '_url' => $image, + $fields . '_width' => $image_width[$image], + $fields . '_height' => $image_height[$image], + 'display_on_posting' => (isset($image_display_on_posting[$image])) ? 1 : 0, + ); + + if ($mode == 'smilies') + { + $img_sql = array_merge($img_sql, array( + 'emotion' => $image_emotion[$image], + 'code' => $image_code[$image]) + ); + } + + // Image_order holds the 'new' order value + if (!empty($image_order[$image])) + { + $img_sql = array_merge($img_sql, array( + $fields . '_order' => $image_order[$image]) + ); + + // Since we always add 'after' an item, we just need to increase all following + the current by one + $sql = "UPDATE $table + SET {$fields}_order = {$fields}_order + 1 + WHERE {$fields}_order >= {$image_order[$image]}"; + $db->sql_query($sql); + + // If we adjust the order, we need to adjust all other orders too - they became inaccurate... + foreach ($image_order as $_image => $_order) + { + if ($_image == $image) + { + continue; + } + + if ($_order >= $image_order[$image]) + { + $image_order[$_image]++; + } + } + } + + if ($action == 'modify' && !empty($image_id[$image])) + { + $sql = "UPDATE $table + SET " . $db->sql_build_array('UPDATE', $img_sql) . " + WHERE {$fields}_id = " . $image_id[$image]; + $db->sql_query($sql); + $icons_updated++; + } + else if ($action !== 'modify') + { + $sql = "INSERT INTO $table " . $db->sql_build_array('INSERT', $img_sql); + $db->sql_query($sql); + $icons_updated++; + } + + } + } + + $cache->destroy('_icons'); + $cache->destroy('sql', $table); + + $level = ($icons_updated) ? E_USER_NOTICE : E_USER_WARNING; + $errormsgs = ''; + foreach ($errors as $img => $error) + { + $errormsgs .= '
' . sprintf($user->lang[$error], $img); + } + if ($action == 'modify') + { + trigger_error($user->lang($lang . '_EDITED', $icons_updated) . $errormsgs . adm_back_link($this->u_action), $level); + } + else + { + trigger_error($user->lang($lang . '_ADDED', $icons_updated) . $errormsgs . adm_back_link($this->u_action), $level); + } + + break; + + case 'import': + + $pak = request_var('pak', ''); + $current = request_var('current', ''); + + if ($pak != '') + { + $order = 0; + + if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak))) + { + trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Make sure the pak_ary is valid + foreach ($pak_ary as $pak_entry) + { + if (preg_match_all("#'(.*?)', ?#", $pak_entry, $data)) + { + if ((sizeof($data[1]) != 4 && $mode == 'icons') || + ((sizeof($data[1]) != 6 || (empty($data[1][4]) || empty($data[1][5]))) && $mode == 'smilies' )) + { + trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + else + { + trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + + // The user has already selected a smilies_pak file + if ($current == 'delete') + { + switch ($db->get_sql_layer()) + { + case 'sqlite': + case 'sqlite3': + $db->sql_query('DELETE FROM ' . $table); + break; + + default: + $db->sql_query('TRUNCATE TABLE ' . $table); + break; + } + + switch ($mode) + { + case 'smilies': + break; + + case 'icons': + // Reset all icon_ids + $db->sql_query('UPDATE ' . TOPICS_TABLE . ' SET icon_id = 0'); + $db->sql_query('UPDATE ' . POSTS_TABLE . ' SET icon_id = 0'); + break; + } + } + else + { + $cur_img = array(); + + $field_sql = ($mode == 'smilies') ? 'code' : 'icons_url'; + + $sql = "SELECT $field_sql + FROM $table"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + ++$order; + $cur_img[$row[$field_sql]] = 1; + } + $db->sql_freeresult($result); + } + + if ($mode == 'smilies') + { + $smiley_count = $this->item_count($table); + if ($smiley_count + sizeof($pak_ary) > SMILEY_LIMIT) + { + trigger_error($user->lang('TOO_MANY_SMILIES', SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING); + } + } + + foreach ($pak_ary as $pak_entry) + { + $data = array(); + if (preg_match_all("#'(.*?)', ?#", $pak_entry, $data)) + { + if ((sizeof($data[1]) != 4 && $mode == 'icons') || + (sizeof($data[1]) != 6 && $mode == 'smilies')) + { + trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Stripslash here because it got addslashed before... (on export) + $img = stripslashes($data[1][0]); + $width = stripslashes($data[1][1]); + $height = stripslashes($data[1][2]); + $display_on_posting = stripslashes($data[1][3]); + + if (isset($data[1][4]) && isset($data[1][5])) + { + $emotion = stripslashes($data[1][4]); + $code = stripslashes($data[1][5]); + } + + if ($current == 'replace' && + (($mode == 'smilies' && !empty($cur_img[$code])) || + ($mode == 'icons' && !empty($cur_img[$img])))) + { + $replace_sql = ($mode == 'smilies') ? $code : $img; + $sql = array( + $fields . '_url' => $img, + $fields . '_height' => (int) $height, + $fields . '_width' => (int) $width, + 'display_on_posting' => (int) $display_on_posting, + ); + + if ($mode == 'smilies') + { + $sql = array_merge($sql, array( + 'emotion' => $emotion, + )); + } + + $sql = "UPDATE $table SET " . $db->sql_build_array('UPDATE', $sql) . " + WHERE $field_sql = '" . $db->sql_escape($replace_sql) . "'"; + $db->sql_query($sql); + } + else + { + ++$order; + + $sql = array( + $fields . '_url' => $img, + $fields . '_height' => (int) $height, + $fields . '_width' => (int) $width, + $fields . '_order' => (int) $order, + 'display_on_posting'=> (int) $display_on_posting, + ); + + if ($mode == 'smilies') + { + $sql = array_merge($sql, array( + 'code' => $code, + 'emotion' => $emotion, + )); + } + $db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql)); + } + } + } + + $cache->destroy('_icons'); + $cache->destroy('sql', $table); + + trigger_error($user->lang[$lang . '_IMPORT_SUCCESS'] . adm_back_link($this->u_action)); + } + else + { + $pak_options = ''; + + foreach ($_paks as $pak) + { + $pak_options .= ''; + } + + $template->assign_vars(array( + 'S_CHOOSE_PAK' => true, + 'S_PAK_OPTIONS' => $pak_options, + + 'L_TITLE' => $user->lang['ACP_' . $lang], + 'L_EXPLAIN' => $user->lang['ACP_' . $lang . '_EXPLAIN'], + 'L_NO_PAK_OPTIONS' => $user->lang['NO_' . $lang . '_PAK'], + 'L_CURRENT' => $user->lang['CURRENT_' . $lang], + 'L_CURRENT_EXPLAIN' => $user->lang['CURRENT_' . $lang . '_EXPLAIN'], + 'L_IMPORT_SUBMIT' => $user->lang['IMPORT_' . $lang], + + 'U_BACK' => $this->u_action, + 'U_ACTION' => $this->u_action . '&action=import', + ) + ); + } + break; + + case 'export': + + $this->page_title = 'EXPORT_' . $lang; + $this->tpl_name = 'message_body'; + + $template->assign_vars(array( + 'MESSAGE_TITLE' => $user->lang['EXPORT_' . $lang], + 'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '', ''), + + 'S_USER_NOTICE' => true, + ) + ); + + return; + + break; + + case 'send': + + $sql = "SELECT * + FROM $table + ORDER BY {$fields}_order"; + $result = $db->sql_query($sql); + + $pak = ''; + while ($row = $db->sql_fetchrow($result)) + { + $pak .= "'" . addslashes($row[$fields . '_url']) . "', "; + $pak .= "'" . addslashes($row[$fields . '_width']) . "', "; + $pak .= "'" . addslashes($row[$fields . '_height']) . "', "; + $pak .= "'" . addslashes($row['display_on_posting']) . "', "; + + if ($mode == 'smilies') + { + $pak .= "'" . addslashes($row['emotion']) . "', "; + $pak .= "'" . addslashes($row['code']) . "', "; + } + + $pak .= "\n"; + } + $db->sql_freeresult($result); + + if ($pak != '') + { + garbage_collection(); + + header('Cache-Control: public'); + + // Send out the Headers + header('Content-Type: text/x-delimtext; name="' . $mode . '.pak"'); + header('Content-Disposition: inline; filename="' . $mode . '.pak"'); + echo $pak; + + flush(); + exit; + } + else + { + trigger_error($user->lang['NO_' . strtoupper($fields) . '_EXPORT'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + break; + + case 'delete': + + if (confirm_box(true)) + { + $sql = "DELETE FROM $table + WHERE {$fields}_id = $icon_id"; + $db->sql_query($sql); + + switch ($mode) + { + case 'smilies': + break; + + case 'icons': + // Reset appropriate icon_ids + $db->sql_query('UPDATE ' . TOPICS_TABLE . " + SET icon_id = 0 + WHERE icon_id = $icon_id"); + + $db->sql_query('UPDATE ' . POSTS_TABLE . " + SET icon_id = 0 + WHERE icon_id = $icon_id"); + break; + } + + $notice = $user->lang[$lang . '_DELETED']; + + $cache->destroy('_icons'); + $cache->destroy('sql', $table); + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $notice, + 'REFRESH_DATA' => array( + 'time' => 3 + ) + )); + } + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'id' => $icon_id, + 'action' => 'delete', + ))); + } + + break; + + case 'move_up': + case 'move_down': + + // Get current order id... + $sql = "SELECT {$fields}_order as current_order + FROM $table + WHERE {$fields}_id = $icon_id"; + $result = $db->sql_query($sql); + $current_order = (int) $db->sql_fetchfield('current_order'); + $db->sql_freeresult($result); + + if ($current_order == 0 && $action == 'move_up') + { + break; + } + + // on move_down, switch position with next order_id... + // on move_up, switch position with previous order_id... + $switch_order_id = ($action == 'move_down') ? $current_order + 1 : $current_order - 1; + + // + $sql = "UPDATE $table + SET {$fields}_order = $current_order + WHERE {$fields}_order = $switch_order_id + AND {$fields}_id <> $icon_id"; + $db->sql_query($sql); + $move_executed = (bool) $db->sql_affectedrows(); + + // Only update the other entry too if the previous entry got updated + if ($move_executed) + { + $sql = "UPDATE $table + SET {$fields}_order = $switch_order_id + WHERE {$fields}_order = $current_order + AND {$fields}_id = $icon_id"; + $db->sql_query($sql); + } + + $cache->destroy('_icons'); + $cache->destroy('sql', $table); + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'success' => $move_executed, + )); + } + + break; + } + + // By default, check that image_order is valid and fix it if necessary + $sql = "SELECT {$fields}_id AS order_id, {$fields}_order AS fields_order + FROM $table + ORDER BY display_on_posting DESC, {$fields}_order"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $order = 0; + do + { + ++$order; + if ($row['fields_order'] != $order) + { + $db->sql_query("UPDATE $table + SET {$fields}_order = $order + WHERE {$fields}_id = " . $row['order_id']); + } + } + while ($row = $db->sql_fetchrow($result)); + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'L_TITLE' => $user->lang['ACP_' . $lang], + 'L_EXPLAIN' => $user->lang['ACP_' . $lang . '_EXPLAIN'], + 'L_IMPORT' => $user->lang['IMPORT_' . $lang], + 'L_EXPORT' => $user->lang['EXPORT_' . $lang], + 'L_NOT_DISPLAYED' => $user->lang[$lang . '_NOT_DISPLAYED'], + 'L_ICON_ADD' => $user->lang['ADD_' . $lang], + 'L_ICON_EDIT' => $user->lang['EDIT_' . $lang], + + 'NOTICE' => $notice, + 'COLSPAN' => ($mode == 'smilies') ? 5 : 3, + + 'S_SMILIES' => ($mode == 'smilies') ? true : false, + + 'U_ACTION' => $this->u_action, + 'U_IMPORT' => $this->u_action . '&action=import', + 'U_EXPORT' => $this->u_action . '&action=export', + ) + ); + + $spacer = false; + $pagination = $phpbb_container->get('pagination'); + $pagination_start = request_var('start', 0); + + $item_count = $this->item_count($table); + + $sql = "SELECT * + FROM $table + ORDER BY {$fields}_order ASC"; + $result = $db->sql_query_limit($sql, $config['smilies_per_page'], $pagination_start); + + while ($row = $db->sql_fetchrow($result)) + { + $alt_text = ($mode == 'smilies') ? $row['code'] : ''; + + $template->assign_block_vars('items', array( + 'S_SPACER' => (!$spacer && !$row['display_on_posting']) ? true : false, + 'ALT_TEXT' => $alt_text, + 'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $row[$fields . '_url'], + 'WIDTH' => $row[$fields . '_width'], + 'HEIGHT' => $row[$fields . '_height'], + 'CODE' => (isset($row['code'])) ? $row['code'] : '', + 'EMOTION' => (isset($row['emotion'])) ? $row['emotion'] : '', + 'U_EDIT' => $this->u_action . '&action=edit&id=' . $row[$fields . '_id'], + 'U_DELETE' => $this->u_action . '&action=delete&id=' . $row[$fields . '_id'], + 'U_MOVE_UP' => $this->u_action . '&action=move_up&id=' . $row[$fields . '_id'] . '&start=' . $pagination_start, + 'U_MOVE_DOWN' => $this->u_action . '&action=move_down&id=' . $row[$fields . '_id'] . '&start=' . $pagination_start, + )); + + if (!$spacer && !$row['display_on_posting']) + { + $spacer = true; + } + } + $db->sql_freeresult($result); + + $pagination->generate_template_pagination($this->u_action, 'pagination', 'start', $item_count, $config['smilies_per_page'], $pagination_start); + } + + /** + * Returns the count of smilies or icons in the database + * + * @param string $table The table of items to count. + * @return int number of items + */ + /* private */ function item_count($table) + { + global $db; + + $sql = "SELECT COUNT(*) AS item_count + FROM $table"; + $result = $db->sql_query($sql); + $item_count = (int) $db->sql_fetchfield('item_count'); + $db->sql_freeresult($result); + + return $item_count; + } +} diff --git a/sources/phpBB/includes/acp/acp_inactive.php b/sources/phpBB/includes/acp/acp_inactive.php new file mode 100644 index 0000000..e96c42d --- /dev/null +++ b/sources/phpBB/includes/acp/acp_inactive.php @@ -0,0 +1,307 @@ + +* @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; +} + +class acp_inactive +{ + var $u_action; + var $p_master; + + function acp_inactive(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($id, $mode) + { + global $config, $db, $user, $auth, $template, $phpbb_container; + 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); + $submit = isset($_POST['submit']); + + // Sort keys + $sort_days = request_var('st', 0); + $sort_key = request_var('sk', 'i'); + $sort_dir = request_var('sd', 'd'); + + $form_key = 'acp_inactive'; + add_form_key($form_key); + $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']); + + // 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']); + $sort_by_text = array('i' => $user->lang['SORT_INACTIVE'], 'j' => $user->lang['SORT_REG_DATE'], 'l' => $user->lang['SORT_LAST_VISIT'], 'd' => $user->lang['SORT_LAST_REMINDER'], 'r' => $user->lang['SORT_REASON'], 'u' => $user->lang['SORT_USERNAME'], 'p' => $user->lang['SORT_POSTS'], 'e' => $user->lang['SORT_REMINDER']); + $sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'd' => 'user_reminded_time', 'r' => 'user_inactive_reason', 'u' => 'username_clean', 'p' => 'user_posts', 'e' => 'user_reminded'); + + $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); + + if ($submit && sizeof($mark)) + { + if ($action !== 'delete' && !check_form_key($form_key)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + switch ($action) + { + case 'activate': + case 'delete': + + $sql = 'SELECT user_id, username + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $mark); + $result = $db->sql_query($sql); + + $user_affected = array(); + while ($row = $db->sql_fetchrow($result)) + { + $user_affected[$row['user_id']] = $row['username']; + } + $db->sql_freeresult($result); + + if ($action == 'activate') + { + // Get those 'being activated'... + $sql = 'SELECT user_id, username' . (($config['require_activation'] == USER_ACTIVATION_ADMIN) ? ', user_email, user_lang' : '') . ' + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $mark) . ' + AND user_type = ' . USER_INACTIVE; + $result = $db->sql_query($sql); + + $inactive_users = array(); + while ($row = $db->sql_fetchrow($result)) + { + $inactive_users[] = $row; + } + $db->sql_freeresult($result); + + user_active_flip('activate', $mark); + + if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !empty($inactive_users)) + { + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $messenger = new messenger(false); + + foreach ($inactive_users as $row) + { + $messenger->template('admin_welcome_activated', $row['user_lang']); + + $messenger->set_addresses($row); + + $messenger->anti_abuse_headers($config, $user); + + $messenger->assign_vars(array( + 'USERNAME' => htmlspecialchars_decode($row['username'])) + ); + + $messenger->send(NOTIFY_EMAIL); + } + + $messenger->save_queue(); + } + + if (!empty($inactive_users)) + { + foreach ($inactive_users as $row) + { + add_log('admin', 'LOG_USER_ACTIVE', $row['username']); + add_log('user', $row['user_id'], 'LOG_USER_ACTIVE_USER'); + } + + trigger_error(sprintf($user->lang['LOG_INACTIVE_ACTIVATE'], implode($user->lang['COMMA_SEPARATOR'], $user_affected) . ' ' . adm_back_link($this->u_action))); + } + + // For activate we really need to redirect, else a refresh can result in users being deactivated again + $u_action = $this->u_action . "&$u_sort_param&start=$start"; + $u_action .= ($per_page != $config['topics_per_page']) ? "&users_per_page=$per_page" : ''; + + redirect($u_action); + } + else if ($action == 'delete') + { + if (confirm_box(true)) + { + if (!$auth->acl_get('a_userdel')) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + user_delete('retain', $mark, true); + + add_log('admin', 'LOG_INACTIVE_' . strtoupper($action), implode(', ', $user_affected)); + + trigger_error(sprintf($user->lang['LOG_INACTIVE_DELETE'], implode($user->lang['COMMA_SEPARATOR'], $user_affected) . ' ' . adm_back_link($this->u_action))); + } + else + { + $s_hidden_fields = array( + 'mode' => $mode, + 'action' => $action, + 'mark' => $mark, + 'submit' => 1, + 'start' => $start, + ); + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields)); + } + } + + break; + + case 'remind': + if (empty($config['email_enable'])) + { + trigger_error($user->lang['EMAIL_DISABLED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type, user_regdate, user_actkey + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $mark) . ' + AND user_inactive_reason'; + + $sql .= ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? ' = ' . INACTIVE_REMIND : ' <> ' . INACTIVE_MANUAL; + + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + // Send the messages + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $messenger = new messenger(); + $usernames = $user_ids = array(); + + do + { + $messenger->template('user_remind_inactive', $row['user_lang']); + + $messenger->set_addresses($row); + + $messenger->anti_abuse_headers($config, $user); + + $messenger->assign_vars(array( + 'USERNAME' => htmlspecialchars_decode($row['username']), + 'REGISTER_DATE' => $user->format_date($row['user_regdate'], false, true), + 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey']) + ); + + $messenger->send($row['user_notify_type']); + + $usernames[] = $row['username']; + $user_ids[] = (int) $row['user_id']; + } + while ($row = $db->sql_fetchrow($result)); + + $messenger->save_queue(); + + // Add the remind state to the database + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_reminded = user_reminded + 1, + user_reminded_time = ' . time() . ' + WHERE ' . $db->sql_in_set('user_id', $user_ids); + $db->sql_query($sql); + + add_log('admin', 'LOG_INACTIVE_REMIND', implode(', ', $usernames)); + + trigger_error(sprintf($user->lang['LOG_INACTIVE_REMIND'], implode($user->lang['COMMA_SEPARATOR'], $usernames) . ' ' . adm_back_link($this->u_action))); + } + $db->sql_freeresult($result); + + // For remind we really need to redirect, else a refresh can result in more than one reminder + $u_action = $this->u_action . "&$u_sort_param&start=$start"; + $u_action .= ($per_page != $config['topics_per_page']) ? "&users_per_page=$per_page" : ''; + + redirect($u_action); + + break; + } + } + + // Define where and sort sql for use in displaying logs + $sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0; + $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); + + $inactive = array(); + $inactive_count = 0; + + $start = view_inactive_users($inactive, $inactive_count, $per_page, $start, $sql_where, $sql_sort); + + foreach ($inactive as $row) + { + $template->assign_block_vars('inactive', array( + 'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']), + 'REMINDED_DATE' => $user->format_date($row['user_reminded_time']), + 'JOINED' => $user->format_date($row['user_regdate']), + 'LAST_VISIT' => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']), + + 'REASON' => $row['inactive_reason'], + 'USER_ID' => $row['user_id'], + 'POSTS' => ($row['user_posts']) ? $row['user_posts'] : 0, + 'REMINDED' => $row['user_reminded'], + + 'REMINDED_EXPLAIN' => $user->lang('USER_LAST_REMINDED', (int) $row['user_reminded'], $user->format_date($row['user_reminded_time'])), + + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview')), + 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), + 'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), + + 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&u={$row['user_id']}"), + 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$row['user_id']}&sr=posts") : '', + )); + } + + $option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE'); + if ($config['email_enable']) + { + $option_ary += array('remind' => 'REMIND'); + } + + $base_url = $this->u_action . "&$u_sort_param&users_per_page=$per_page"; + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $inactive_count, $per_page, $start); + + $template->assign_vars(array( + 'S_INACTIVE_USERS' => true, + 'S_INACTIVE_OPTIONS' => build_select($option_ary), + + 'S_LIMIT_DAYS' => $s_limit_days, + 'S_SORT_KEY' => $s_sort_key, + 'S_SORT_DIR' => $s_sort_dir, + 'USERS_PER_PAGE' => $per_page, + + 'U_ACTION' => $this->u_action . "&$u_sort_param&users_per_page=$per_page&start=$start", + )); + + $this->tpl_name = 'acp_inactive'; + $this->page_title = 'ACP_INACTIVE_USERS'; + } +} diff --git a/sources/phpBB/includes/acp/acp_jabber.php b/sources/phpBB/includes/acp/acp_jabber.php new file mode 100644 index 0000000..8d2e9d4 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_jabber.php @@ -0,0 +1,132 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +/** +* @todo Check/enter/update transport info +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +class acp_jabber +{ + var $u_action; + + function main($id, $mode) + { + global $db, $user, $auth, $template; + 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', ''); + $submit = (isset($_POST['submit'])) ? true : false; + + if ($mode != 'settings') + { + return; + } + + $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']); + + $form_name = 'acp_jabber'; + add_form_key($form_name); + + if ($submit) + { + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); + } + + $error = array(); + + $message = $user->lang['JAB_SETTINGS_CHANGED']; + $log = 'JAB_SETTINGS_CHANGED'; + + // Is this feature enabled? Then try to establish a connection + if ($jab_enable) + { + $jabber = new jabber($jab_host, $jab_port, $jab_username, $jab_password, $jab_use_ssl); + + if (!$jabber->connect()) + { + trigger_error($user->lang['ERR_JAB_CONNECT'] . '

' . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING); + } + + // We'll try to authorise using this account + if (!$jabber->login()) + { + trigger_error($user->lang['ERR_JAB_AUTH'] . '

' . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING); + } + + $jabber->disconnect(); + } + else + { + // This feature is disabled. + // We update the user table to be sure all users that have IM as notify type are set to both as notify type + // We set this to both because users still have their jabber address entered and may want to receive jabber notifications again once it is re-enabled. + $sql_ary = array( + 'user_notify_type' => NOTIFY_BOTH, + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_notify_type = ' . NOTIFY_IM; + $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); + set_config('jab_password', $jab_password); + set_config('jab_package_size', $jab_package_size); + set_config('jab_use_ssl', $jab_use_ssl); + + add_log('admin', 'LOG_' . $log); + trigger_error($message . adm_back_link($this->u_action)); + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'JAB_ENABLE' => $jab_enable, + 'L_JAB_SERVER_EXPLAIN' => sprintf($user->lang['JAB_SERVER_EXPLAIN'], '', ''), + 'JAB_HOST' => $jab_host, + 'JAB_PORT' => ($jab_port) ? $jab_port : '', + 'JAB_USERNAME' => $jab_username, + 'JAB_PASSWORD' => $jab_password, + 'JAB_PACKAGE_SIZE' => $jab_package_size, + 'JAB_USE_SSL' => $jab_use_ssl, + 'S_CAN_USE_SSL' => jabber::can_use_ssl(), + 'S_GTALK_NOTE' => (!@function_exists('dns_get_record')) ? true : false, + )); + } +} diff --git a/sources/phpBB/includes/acp/acp_language.php b/sources/phpBB/includes/acp/acp_language.php new file mode 100644 index 0000000..60e338a --- /dev/null +++ b/sources/phpBB/includes/acp/acp_language.php @@ -0,0 +1,458 @@ + +* @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; +} + +class acp_language +{ + var $u_action; + var $main_files; + var $language_header = ''; + var $lang_header = ''; + + var $language_file = ''; + var $language_directory = ''; + + function main($id, $mode) + { + global $config, $db, $user, $template; + global $phpbb_root_path, $phpEx, $request; + + include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + // Check and set some common vars + $action = (isset($_POST['update_details'])) ? 'update_details' : ''; + $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; + + $form_name = 'acp_lang'; + add_form_key('acp_lang'); + + $lang_id = request_var('id', 0); + + $selected_lang_file = request_var('language_file', '|common.' . $phpEx); + + list($this->language_directory, $this->language_file) = explode('|', $selected_lang_file); + + $this->language_directory = basename($this->language_directory); + $this->language_file = basename($this->language_file); + + $user->add_lang('acp/language'); + $this->tpl_name = 'acp_language'; + $this->page_title = 'ACP_LANGUAGE_PACKS'; + + switch ($action) + { + case 'update_details': + + if (!$submit || !check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); + } + + if (!$lang_id) + { + trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql = 'SELECT * + FROM ' . LANG_TABLE . " + WHERE lang_id = $lang_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $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)), + ); + + $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']); + + trigger_error($user->lang['LANGUAGE_DETAILS_UPDATED'] . adm_back_link($this->u_action)); + break; + + case 'details': + + if (!$lang_id) + { + trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $this->page_title = 'LANGUAGE_PACK_DETAILS'; + + $sql = 'SELECT * + FROM ' . LANG_TABLE . ' + WHERE lang_id = ' . $lang_id; + $result = $db->sql_query($sql); + $lang_entries = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$lang_entries) + { + trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $lang_iso = $lang_entries['lang_iso']; + + $template->assign_vars(array( + 'S_DETAILS' => true, + 'U_ACTION' => $this->u_action . "&action=details&id=$lang_id", + 'U_BACK' => $this->u_action, + + 'LANG_LOCAL_NAME' => $lang_entries['lang_local_name'], + 'LANG_ENGLISH_NAME' => $lang_entries['lang_english_name'], + 'LANG_ISO' => $lang_iso, + 'LANG_AUTHOR' => $lang_entries['lang_author'], + 'L_MISSING_FILES' => $user->lang('THOSE_MISSING_LANG_FILES', $lang_entries['lang_local_name']), + 'L_MISSING_VARS_EXPLAIN' => $user->lang('THOSE_MISSING_LANG_VARIABLES', $lang_entries['lang_local_name']), + )); + + // If current lang is different from the default lang, then highlight missing files and variables + if ($lang_iso != $config['default_lang']) + { + try + { + $iterator = new \RecursiveIteratorIterator( + new \phpbb\recursive_dot_prefix_filter_iterator( + new \RecursiveDirectoryIterator( + $phpbb_root_path . 'language/' . $config['default_lang'] . '/', + \FilesystemIterator::SKIP_DOTS + ) + ), + \RecursiveIteratorIterator::LEAVES_ONLY + ); + } + catch (\Exception $e) + { + return array(); + } + + foreach ($iterator as $file_info) + { + /** @var \RecursiveDirectoryIterator $file_info */ + $relative_path = $iterator->getInnerIterator()->getSubPathname(); + $relative_path = str_replace(DIRECTORY_SEPARATOR, '/', $relative_path); + + if (file_exists($phpbb_root_path . 'language/' . $lang_iso . '/' . $relative_path)) + { + if (substr($relative_path, 0 - strlen($phpEx)) === $phpEx) + { + $missing_vars = $this->compare_language_files($config['default_lang'], $lang_iso, $relative_path); + + if (!empty($missing_vars)) + { + $template->assign_block_vars('missing_varfile', array( + 'FILE_NAME' => $relative_path, + )); + + foreach ($missing_vars as $var) + { + $template->assign_block_vars('missing_varfile.variable', array( + 'VAR_NAME' => $var, + )); + } + } + } + } + else + { + $template->assign_block_vars('missing_files', array( + 'FILE_NAME' => $relative_path, + )); + } + } + } + return; + break; + + case 'delete': + + if (!$lang_id) + { + trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql = 'SELECT * + FROM ' . LANG_TABLE . ' + WHERE lang_id = ' . $lang_id; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row['lang_iso'] == $config['default_lang']) + { + trigger_error($user->lang['NO_REMOVE_DEFAULT_LANG'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (confirm_box(true)) + { + $db->sql_query('DELETE FROM ' . LANG_TABLE . ' WHERE lang_id = ' . $lang_id); + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_lang = '" . $db->sql_escape($config['default_lang']) . "' + WHERE user_lang = '" . $db->sql_escape($row['lang_iso']) . "'"; + $db->sql_query($sql); + + // We also need to remove the translated entries for custom profile fields - we want clean tables, don't we? + $sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . ' WHERE lang_id = ' . $lang_id; + $db->sql_query($sql); + + $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']); + + trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($this->u_action)); + } + else + { + $s_hidden_fields = array( + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'id' => $lang_id, + ); + confirm_box(false, $user->lang('DELETE_LANGUAGE_CONFIRM', $row['lang_english_name']), build_hidden_fields($s_hidden_fields)); + } + break; + + case 'install': + $lang_iso = request_var('iso', ''); + $lang_iso = basename($lang_iso); + + if (!$lang_iso || !file_exists("{$phpbb_root_path}language/$lang_iso/iso.txt")) + { + trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $file = file("{$phpbb_root_path}language/$lang_iso/iso.txt"); + + $lang_pack = array( + 'iso' => $lang_iso, + 'name' => trim(htmlspecialchars($file[0])), + 'local_name'=> trim(htmlspecialchars($file[1], ENT_COMPAT, 'UTF-8')), + 'author' => trim(htmlspecialchars($file[2], ENT_COMPAT, 'UTF-8')) + ); + unset($file); + + $sql = 'SELECT lang_iso + FROM ' . LANG_TABLE . " + WHERE lang_iso = '" . $db->sql_escape($lang_iso) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + trigger_error($user->lang['LANGUAGE_PACK_ALREADY_INSTALLED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (!$lang_pack['name'] || !$lang_pack['local_name']) + { + trigger_error($user->lang['INVALID_LANGUAGE_PACK'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Add language pack + $sql_ary = array( + 'lang_iso' => $lang_pack['iso'], + 'lang_dir' => $lang_pack['iso'], + 'lang_english_name' => $lang_pack['name'], + 'lang_local_name' => $lang_pack['local_name'], + 'lang_author' => $lang_pack['author'] + ); + + $db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + $lang_id = $db->sql_nextid(); + + // Now let's copy the default language entries for custom profile fields for this new language - makes admin's life easier. + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE . " + WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'"; + $result = $db->sql_query($sql); + $default_lang_id = (int) $db->sql_fetchfield('lang_id'); + $db->sql_freeresult($result); + + // We want to notify the admin that custom profile fields need to be updated for the new language. + $notify_cpf_update = false; + + // From the mysql documentation: + // Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14. + // Due to this we stay on the safe side if we do the insertion "the manual way" + + $sql = 'SELECT field_id, lang_name, lang_explain, lang_default_value + FROM ' . PROFILE_LANG_TABLE . ' + WHERE lang_id = ' . $default_lang_id; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $row['lang_id'] = $lang_id; + $db->sql_query('INSERT INTO ' . PROFILE_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $row)); + $notify_cpf_update = true; + } + $db->sql_freeresult($result); + + $sql = 'SELECT field_id, option_id, field_type, lang_value + FROM ' . PROFILE_FIELDS_LANG_TABLE . ' + WHERE lang_id = ' . $default_lang_id; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $row['lang_id'] = $lang_id; + $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $row)); + $notify_cpf_update = true; + } + $db->sql_freeresult($result); + + add_log('admin', 'LOG_LANGUAGE_PACK_INSTALLED', $lang_pack['name']); + + $message = sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name']); + $message .= ($notify_cpf_update) ? '

' . $user->lang['LANGUAGE_PACK_CPF_UPDATE'] : ''; + trigger_error($message . adm_back_link($this->u_action)); + + break; + } + + $sql = 'SELECT user_lang, COUNT(user_lang) AS lang_count + FROM ' . USERS_TABLE . ' + GROUP BY user_lang'; + $result = $db->sql_query($sql); + + $lang_count = array(); + while ($row = $db->sql_fetchrow($result)) + { + $lang_count[$row['user_lang']] = $row['lang_count']; + } + $db->sql_freeresult($result); + + $sql = 'SELECT * + FROM ' . LANG_TABLE . ' + ORDER BY lang_english_name'; + $result = $db->sql_query($sql); + + $installed = array(); + + while ($row = $db->sql_fetchrow($result)) + { + $installed[] = $row['lang_iso']; + $tagstyle = ($row['lang_iso'] == $config['default_lang']) ? '*' : ''; + + $template->assign_block_vars('lang', array( + 'U_DETAILS' => $this->u_action . "&action=details&id={$row['lang_id']}", + 'U_DOWNLOAD' => $this->u_action . "&action=download&id={$row['lang_id']}", + 'U_DELETE' => $this->u_action . "&action=delete&id={$row['lang_id']}", + + 'ENGLISH_NAME' => $row['lang_english_name'], + 'TAG' => $tagstyle, + 'LOCAL_NAME' => $row['lang_local_name'], + 'ISO' => $row['lang_iso'], + 'USED_BY' => (isset($lang_count[$row['lang_iso']])) ? $lang_count[$row['lang_iso']] : 0, + )); + } + $db->sql_freeresult($result); + + $new_ary = $iso = array(); + $dp = @opendir("{$phpbb_root_path}language"); + + if ($dp) + { + while (($file = readdir($dp)) !== false) + { + if ($file[0] == '.' || !is_dir($phpbb_root_path . 'language/' . $file)) + { + continue; + } + + 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]) + ); + } + } + } + } + } + closedir($dp); + } + + unset($installed); + + if (sizeof($new_ary)) + { + foreach ($new_ary as $iso => $lang_ary) + { + $template->assign_block_vars('notinst', array( + 'ISO' => htmlspecialchars($lang_ary['iso']), + 'LOCAL_NAME' => htmlspecialchars($lang_ary['local_name'], ENT_COMPAT, 'UTF-8'), + 'NAME' => htmlspecialchars($lang_ary['name'], ENT_COMPAT, 'UTF-8'), + 'U_INSTALL' => $this->u_action . '&action=install&iso=' . urlencode($lang_ary['iso'])) + ); + } + } + + unset($new_ary); + } + + /** + * Compare two language files + */ + function compare_language_files($source_lang, $dest_lang, $file) + { + global $phpbb_root_path; + + $source_file = $phpbb_root_path . 'language/' . $source_lang . '/' . $file; + $dest_file = $phpbb_root_path . 'language/' . $dest_lang . '/' . $file; + + if (!file_exists($dest_file)) + { + return array(); + } + + $lang = array(); + include($source_file); + $lang_entry_src = $lang; + + $lang = array(); + include($dest_file); + $lang_entry_dst = $lang; + + unset($lang); + + return array_diff(array_keys($lang_entry_src), array_keys($lang_entry_dst)); + } +} diff --git a/sources/phpBB/includes/acp/acp_logs.php b/sources/phpBB/includes/acp/acp_logs.php new file mode 100644 index 0000000..80dee1d --- /dev/null +++ b/sources/phpBB/includes/acp/acp_logs.php @@ -0,0 +1,174 @@ + +* @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; +} + +class acp_logs +{ + var $u_action; + + function main($id, $mode) + { + global $db, $user, $auth, $template, $cache, $phpbb_container; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $request; + + $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); + $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)); + + // Sort keys + $sort_days = request_var('st', 0); + $sort_key = request_var('sk', 't'); + $sort_dir = request_var('sd', 'd'); + + $this->tpl_name = 'acp_logs'; + $this->log_type = constant('LOG_' . strtoupper($mode)); + $pagination = $phpbb_container->get('pagination'); + + // Delete entries if requested and able + if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) + { + if (confirm_box(true)) + { + $conditions = array(); + + if ($deletemark && sizeof($marked)) + { + $conditions['log_id'] = array('IN' => $marked); + } + + if ($deleteall) + { + if ($sort_days) + { + $conditions['log_time'] = array('>=', time() - ($sort_days * 86400)); + } + + $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); + $conditions['keywords'] = $keywords; + } + + $phpbb_log = $phpbb_container->get('log'); + $phpbb_log->delete($mode, $conditions); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'f' => $forum_id, + 'start' => $start, + 'delmarked' => $deletemark, + 'delall' => $deleteall, + 'mark' => $marked, + 'st' => $sort_days, + 'sk' => $sort_key, + 'sd' => $sort_dir, + 'i' => $id, + 'mode' => $mode, + 'action' => $action)) + ); + } + } + + // 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']); + $sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']); + $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); + + $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); + + // Define where and sort sql for use in displaying 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_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; + + $l_title = $user->lang['ACP_' . strtoupper($mode) . '_LOGS']; + $l_title_explain = $user->lang['ACP_' . strtoupper($mode) . '_LOGS_EXPLAIN']; + + $this->page_title = $l_title; + + // Define forum list if we're looking @ mod logs + if ($mode == 'mod') + { + $forum_box = '' . make_forum_select($forum_id); + + $template->assign_vars(array( + 'S_SHOW_FORUMS' => true, + 'S_FORUM_BOX' => $forum_box) + ); + } + + // Grab log data + $log_data = array(); + $log_count = 0; + $start = view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort, $keywords); + + $base_url = $this->u_action . "&$u_sort_param$keywords_param"; + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $log_count, $config['topics_per_page'], $start); + + $template->assign_vars(array( + 'L_TITLE' => $l_title, + 'L_EXPLAIN' => $l_title_explain, + 'U_ACTION' => $this->u_action . "&$u_sort_param$keywords_param&start=$start", + + 'S_LIMIT_DAYS' => $s_limit_days, + 'S_SORT_KEY' => $s_sort_key, + 'S_SORT_DIR' => $s_sort_dir, + 'S_CLEARLOGS' => $auth->acl_get('a_clearlogs'), + 'S_KEYWORDS' => $keywords, + ) + ); + + foreach ($log_data as $row) + { + $data = array(); + + $checks = array('viewtopic', 'viewlogs', 'viewforum'); + foreach ($checks as $check) + { + if (isset($row[$check]) && $row[$check]) + { + $data[] = '' . $user->lang['LOGVIEW_' . strtoupper($check)] . ''; + } + } + + $template->assign_block_vars('log', array( + 'USERNAME' => $row['username_full'], + 'REPORTEE_USERNAME' => ($row['reportee_username'] && $row['user_id'] != $row['reportee_id']) ? $row['reportee_username_full'] : '', + + 'IP' => $row['ip'], + 'DATE' => $user->format_date($row['time']), + 'ACTION' => $row['action'], + 'DATA' => (sizeof($data)) ? implode(' | ', $data) : '', + 'ID' => $row['id'], + ) + ); + } + } +} diff --git a/sources/phpBB/includes/acp/acp_main.php b/sources/phpBB/includes/acp/acp_main.php new file mode 100644 index 0000000..48ca05a --- /dev/null +++ b/sources/phpBB/includes/acp/acp_main.php @@ -0,0 +1,672 @@ + +* @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; +} + +class acp_main +{ + var $u_action; + + function main($id, $mode) + { + global $config, $db, $cache, $user, $auth, $template, $request; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container, $phpbb_dispatcher; + + // Show restore permissions notice + if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) + { + $this->tpl_name = 'acp_main'; + $this->page_title = 'ACP_MAIN'; + + $sql = 'SELECT user_id, username, user_colour + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . $user->data['user_perm_from']; + $result = $db->sql_query($sql); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $perm_from = get_username_string('full', $user_row['user_id'], $user_row['username'], $user_row['user_colour']); + + $template->assign_vars(array( + 'S_RESTORE_PERMISSIONS' => true, + 'U_RESTORE_PERMISSIONS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm'), + 'PERM_FROM' => $perm_from, + 'L_PERMISSIONS_TRANSFERRED_EXPLAIN' => sprintf($user->lang['PERMISSIONS_TRANSFERRED_EXPLAIN'], $perm_from, append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm')), + )); + + return; + } + + $action = request_var('action', ''); + + if ($action) + { + if ($action === 'admlogout') + { + $user->unset_admin(); + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); + } + + if (!confirm_box(true)) + { + switch ($action) + { + case 'online': + $confirm = true; + $confirm_lang = 'RESET_ONLINE_CONFIRM'; + break; + case 'stats': + $confirm = true; + $confirm_lang = 'RESYNC_STATS_CONFIRM'; + break; + case 'user': + $confirm = true; + $confirm_lang = 'RESYNC_POSTCOUNTS_CONFIRM'; + break; + case 'date': + $confirm = true; + $confirm_lang = 'RESET_DATE_CONFIRM'; + break; + case 'db_track': + $confirm = true; + $confirm_lang = 'RESYNC_POST_MARKING_CONFIRM'; + break; + case 'purge_cache': + $confirm = true; + $confirm_lang = 'PURGE_CACHE_CONFIRM'; + break; + case 'purge_sessions': + $confirm = true; + $confirm_lang = 'PURGE_SESSIONS_CONFIRM'; + break; + + default: + $confirm = true; + $confirm_lang = 'CONFIRM_OPERATION'; + } + + if ($confirm) + { + confirm_box(false, $user->lang[$confirm_lang], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + ))); + } + } + else + { + switch ($action) + { + + case 'online': + if (!$auth->acl_get('a_board')) + { + 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'); + + if ($request->is_ajax()) + { + trigger_error('RESET_ONLINE_SUCCESS'); + } + break; + + case 'stats': + if (!$auth->acl_get('a_board')) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql = 'SELECT COUNT(post_id) AS stat + FROM ' . POSTS_TABLE . ' + WHERE post_visibility = ' . ITEM_APPROVED; + $result = $db->sql_query($sql); + set_config('num_posts', (int) $db->sql_fetchfield('stat'), true); + $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); + $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); + $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); + $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); + $db->sql_freeresult($result); + + if (!function_exists('update_last_username')) + { + include($phpbb_root_path . "includes/functions_user.$phpEx"); + } + update_last_username(); + + add_log('admin', 'LOG_RESYNC_STATS'); + + if ($request->is_ajax()) + { + trigger_error('RESYNC_STATS_SUCCESS'); + } + break; + + case 'user': + if (!$auth->acl_get('a_board')) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Resync post counts + $start = $max_post_id = 0; + + // Find the maximum post ID, we can only stop the cycle when we've reached it + $sql = 'SELECT MAX(forum_last_post_id) as max_post_id + FROM ' . FORUMS_TABLE; + $result = $db->sql_query($sql); + $max_post_id = (int) $db->sql_fetchfield('max_post_id'); + $db->sql_freeresult($result); + + // No maximum post id? :o + if (!$max_post_id) + { + $sql = 'SELECT MAX(post_id) as max_post_id + FROM ' . POSTS_TABLE; + $result = $db->sql_query($sql); + $max_post_id = (int) $db->sql_fetchfield('max_post_id'); + $db->sql_freeresult($result); + } + + // Still no maximum post id? Then we are finished + if (!$max_post_id) + { + add_log('admin', 'LOG_RESYNC_POSTCOUNTS'); + break; + } + + $step = ($config['num_posts']) ? (max((int) ($config['num_posts'] / 5), 20000)) : 20000; + $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_posts = 0'); + + while ($start < $max_post_id) + { + $sql = 'SELECT COUNT(post_id) AS num_posts, poster_id + FROM ' . POSTS_TABLE . ' + WHERE post_id BETWEEN ' . ($start + 1) . ' AND ' . ($start + $step) . ' + AND post_postcount = 1 AND post_visibility = ' . ITEM_APPROVED . ' + GROUP BY poster_id'; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + do + { + $sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = user_posts + {$row['num_posts']} WHERE user_id = {$row['poster_id']}"; + $db->sql_query($sql); + } + while ($row = $db->sql_fetchrow($result)); + } + $db->sql_freeresult($result); + + $start += $step; + } + + add_log('admin', 'LOG_RESYNC_POSTCOUNTS'); + + if ($request->is_ajax()) + { + trigger_error('RESYNC_POSTCOUNTS_SUCCESS'); + } + break; + + case 'date': + if (!$auth->acl_get('a_board')) + { + 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'); + + if ($request->is_ajax()) + { + trigger_error('RESET_DATE_SUCCESS'); + } + break; + + case 'db_track': + switch ($db->get_sql_layer()) + { + case 'sqlite': + case 'sqlite3': + $db->sql_query('DELETE FROM ' . TOPICS_POSTED_TABLE); + break; + + default: + $db->sql_query('TRUNCATE TABLE ' . TOPICS_POSTED_TABLE); + break; + } + + // This can get really nasty... therefore we only do the last six months + $get_from_time = time() - (6 * 4 * 7 * 24 * 60 * 60); + + // Select forum ids, do not include categories + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + WHERE forum_type <> ' . FORUM_CAT; + $result = $db->sql_query($sql); + + $forum_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_ids[] = $row['forum_id']; + } + $db->sql_freeresult($result); + + // Any global announcements? ;) + $forum_ids[] = 0; + + // Now go through the forums and get us some topics... + foreach ($forum_ids as $forum_id) + { + $sql = 'SELECT p.poster_id, p.topic_id + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t + WHERE t.forum_id = ' . $forum_id . ' + AND t.topic_moved_id = 0 + AND t.topic_last_post_time > ' . $get_from_time . ' + AND t.topic_id = p.topic_id + AND p.poster_id <> ' . ANONYMOUS . ' + GROUP BY p.poster_id, p.topic_id'; + $result = $db->sql_query($sql); + + $posted = array(); + while ($row = $db->sql_fetchrow($result)) + { + $posted[$row['poster_id']][] = $row['topic_id']; + } + $db->sql_freeresult($result); + + $sql_ary = array(); + foreach ($posted as $user_id => $topic_row) + { + foreach ($topic_row as $topic_id) + { + $sql_ary[] = array( + 'user_id' => (int) $user_id, + 'topic_id' => (int) $topic_id, + 'topic_posted' => 1, + ); + } + } + unset($posted); + + if (sizeof($sql_ary)) + { + $db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary); + } + } + + add_log('admin', 'LOG_RESYNC_POST_MARKING'); + + if ($request->is_ajax()) + { + trigger_error('RESYNC_POST_MARKING_SUCCESS'); + } + break; + + case 'purge_cache': + $config->increment('assets_version', 1); + $cache->purge(); + + // Clear permissions + $auth->acl_clear_prefetch(); + phpbb_cache_moderators($db, $cache, $auth); + + add_log('admin', 'LOG_PURGE_CACHE'); + + if ($request->is_ajax()) + { + trigger_error('PURGE_CACHE_SUCCESS'); + } + break; + + case 'purge_sessions': + if ((int) $user->data['user_type'] !== USER_FOUNDER) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $tables = array(CONFIRM_TABLE, SESSIONS_TABLE); + + foreach ($tables as $table) + { + switch ($db->get_sql_layer()) + { + case 'sqlite': + case 'sqlite3': + $db->sql_query("DELETE FROM $table"); + break; + + default: + $db->sql_query("TRUNCATE TABLE $table"); + break; + } + } + + // let's restore the admin session + $reinsert_ary = array( + 'session_id' => (string) $user->session_id, + 'session_page' => (string) substr($user->page['page'], 0, 199), + 'session_forum_id' => $user->page['forum'], + 'session_user_id' => (int) $user->data['user_id'], + 'session_start' => (int) $user->data['session_start'], + 'session_last_visit' => (int) $user->data['session_last_visit'], + 'session_time' => (int) $user->time_now, + 'session_browser' => (string) trim(substr($user->browser, 0, 149)), + 'session_forwarded_for' => (string) $user->forwarded_for, + 'session_ip' => (string) $user->ip, + 'session_autologin' => (int) $user->data['session_autologin'], + 'session_admin' => 1, + 'session_viewonline' => (int) $user->data['session_viewonline'], + ); + + $sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $reinsert_ary); + $db->sql_query($sql); + + add_log('admin', 'LOG_PURGE_SESSIONS'); + + if ($request->is_ajax()) + { + trigger_error('PURGE_SESSIONS_SUCCESS'); + } + break; + } + } + } + + // Version check + $user->add_lang('install'); + + if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.3.3', '<')) + { + $template->assign_vars(array( + 'S_PHP_VERSION_OLD' => true, + 'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], '', ''), + )); + } + + $version_helper = $phpbb_container->get('version_helper'); + try + { + $recheck = $request->variable('versioncheck_force', false); + $updates_available = $version_helper->get_suggested_updates($recheck); + + $template->assign_var('S_VERSION_UP_TO_DATE', empty($updates_available)); + } + catch (\RuntimeException $e) + { + $template->assign_vars(array( + 'S_VERSIONCHECK_FAIL' => true, + 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '', + )); + } + + /** + * Notice admin + * + * @event core.acp_main_notice + * @since 3.1.0-RC3 + */ + $phpbb_dispatcher->dispatch('core.acp_main_notice'); + + // Get forum statistics + $total_posts = $config['num_posts']; + $total_topics = $config['num_topics']; + $total_users = $config['num_users']; + $total_files = $config['num_files']; + + $start_date = $user->format_date($config['board_startdate']); + + $boarddays = (time() - $config['board_startdate']) / 86400; + + $posts_per_day = sprintf('%.2f', $total_posts / $boarddays); + $topics_per_day = sprintf('%.2f', $total_topics / $boarddays); + $users_per_day = sprintf('%.2f', $total_users / $boarddays); + $files_per_day = sprintf('%.2f', $total_files / $boarddays); + + $upload_dir_size = get_formatted_filesize($config['upload_dir_size']); + + $avatar_dir_size = 0; + + if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path'])) + { + while (($file = readdir($avatar_dir)) !== false) + { + if ($file[0] != '.' && $file != 'CVS' && strpos($file, 'index.') === false) + { + $avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file); + } + } + closedir($avatar_dir); + + $avatar_dir_size = get_formatted_filesize($avatar_dir_size); + } + else + { + // Couldn't open Avatar dir. + $avatar_dir_size = $user->lang['NOT_AVAILABLE']; + } + + if ($posts_per_day > $total_posts) + { + $posts_per_day = $total_posts; + } + + if ($topics_per_day > $total_topics) + { + $topics_per_day = $total_topics; + } + + if ($users_per_day > $total_users) + { + $users_per_day = $total_users; + } + + if ($files_per_day > $total_files) + { + $files_per_day = $total_files; + } + + if ($config['allow_attachments'] || $config['allow_pm_attach']) + { + $sql = 'SELECT COUNT(attach_id) AS total_orphan + FROM ' . ATTACHMENTS_TABLE . ' + WHERE is_orphan = 1 + AND filetime < ' . (time() - 3*60*60); + $result = $db->sql_query($sql); + $total_orphan = (int) $db->sql_fetchfield('total_orphan'); + $db->sql_freeresult($result); + } + else + { + $total_orphan = false; + } + + $dbsize = get_database_size(); + + $template->assign_vars(array( + 'TOTAL_POSTS' => $total_posts, + 'POSTS_PER_DAY' => $posts_per_day, + 'TOTAL_TOPICS' => $total_topics, + 'TOPICS_PER_DAY' => $topics_per_day, + 'TOTAL_USERS' => $total_users, + 'USERS_PER_DAY' => $users_per_day, + 'TOTAL_FILES' => $total_files, + 'FILES_PER_DAY' => $files_per_day, + 'START_DATE' => $start_date, + 'AVATAR_DIR_SIZE' => $avatar_dir_size, + 'DBSIZE' => $dbsize, + 'UPLOAD_DIR_SIZE' => $upload_dir_size, + 'TOTAL_ORPHAN' => $total_orphan, + 'S_TOTAL_ORPHAN' => ($total_orphan === false) ? false : true, + 'GZIP_COMPRESSION' => ($config['gzip_compress'] && @extension_loaded('zlib')) ? $user->lang['ON'] : $user->lang['OFF'], + 'DATABASE_INFO' => $db->sql_server_info(), + 'BOARD_VERSION' => $config['version'], + + 'U_ACTION' => $this->u_action, + 'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&mode=admin'), + 'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&mode=list'), + 'U_VERSIONCHECK' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=update&mode=version_check'), + 'U_VERSIONCHECK_FORCE' => append_sid("{$phpbb_admin_path}index.$phpEx", 'versioncheck_force=1'), + + 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false, + 'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false, + ) + ); + + $log_data = array(); + $log_count = false; + + if ($auth->acl_get('a_viewlogs')) + { + view_log('admin', $log_data, $log_count, 5); + + foreach ($log_data as $row) + { + $template->assign_block_vars('log', array( + 'USERNAME' => $row['username_full'], + 'IP' => $row['ip'], + 'DATE' => $user->format_date($row['time']), + 'ACTION' => $row['action']) + ); + } + } + + if ($auth->acl_get('a_user')) + { + $user->add_lang('memberlist'); + + $inactive = array(); + $inactive_count = 0; + + view_inactive_users($inactive, $inactive_count, 10); + + foreach ($inactive as $row) + { + $template->assign_block_vars('inactive', array( + 'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']), + 'REMINDED_DATE' => $user->format_date($row['user_reminded_time']), + 'JOINED' => $user->format_date($row['user_regdate']), + 'LAST_VISIT' => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']), + + 'REASON' => $row['inactive_reason'], + 'USER_ID' => $row['user_id'], + 'POSTS' => ($row['user_posts']) ? $row['user_posts'] : 0, + 'REMINDED' => $row['user_reminded'], + + 'REMINDED_EXPLAIN' => $user->lang('USER_LAST_REMINDED', (int) $row['user_reminded'], $user->format_date($row['user_reminded_time'])), + + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview')), + 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), + 'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), + + 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&u={$row['user_id']}"), + 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$row['user_id']}&sr=posts") : '', + )); + } + + $option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE'); + if ($config['email_enable']) + { + $option_ary += array('remind' => 'REMIND'); + } + + $template->assign_vars(array( + 'S_INACTIVE_USERS' => true, + 'S_INACTIVE_OPTIONS' => build_select($option_ary)) + ); + } + + // Warn if install is still present + if (file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install')) + { + $template->assign_var('S_REMOVE_INSTALL', true); + } + + // Warn if no search index is created + if ($config['num_posts'] && class_exists($config['search_type'])) + { + $error = false; + $search_type = $config['search_type']; + $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); + + if (!$search->index_created()) + { + $template->assign_vars(array( + 'S_SEARCH_INDEX_MISSING' => true, + 'L_NO_SEARCH_INDEX' => $user->lang('NO_SEARCH_INDEX', $search->get_name(), '', ''), + )); + } + } + + if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx)) + { + // World-Writable? (000x) + $template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002)); + } + + if (extension_loaded('mbstring')) + { + $template->assign_vars(array( + 'S_MBSTRING_LOADED' => true, + 'S_MBSTRING_FUNC_OVERLOAD_FAIL' => (intval(@ini_get('mbstring.func_overload')) & (MB_OVERLOAD_MAIL | MB_OVERLOAD_STRING)), + 'S_MBSTRING_ENCODING_TRANSLATION_FAIL' => (@ini_get('mbstring.encoding_translation') != 0), + 'S_MBSTRING_HTTP_INPUT_FAIL' => !in_array(@ini_get('mbstring.http_input'), array('pass', '')), + 'S_MBSTRING_HTTP_OUTPUT_FAIL' => !in_array(@ini_get('mbstring.http_output'), array('pass', '')), + )); + } + + // Fill dbms version if not yet filled + if (empty($config['dbms_version'])) + { + set_config('dbms_version', $db->sql_server_info(true)); + } + + $this->tpl_name = 'acp_main'; + $this->page_title = 'ACP_MAIN'; + } +} diff --git a/sources/phpBB/includes/acp/acp_modules.php b/sources/phpBB/includes/acp/acp_modules.php new file mode 100644 index 0000000..ea6b388 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_modules.php @@ -0,0 +1,1089 @@ + +* @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; +} + +/** +* - Able to check for new module versions (modes changed/adjusted/added/removed) +* Icons for: +* - module enabled and displayed (common) +* - module enabled and not displayed +* - module deactivated +* - category (enabled) +* - category disabled +*/ + +class acp_modules +{ + var $module_class = ''; + var $parent_id; + var $u_action; + + function main($id, $mode) + { + global $db, $user, $auth, $template, $module, $request; + global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx; + + // 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); + + $user->add_lang('acp/modules'); + $this->tpl_name = 'acp_modules'; + + // module class + $this->module_class = $mode; + + if ($this->module_class == 'ucp') + { + $user->add_lang('ucp'); + } + else if ($this->module_class == 'mcp') + { + $user->add_lang('mcp'); + } + + if ($module->p_class != $this->module_class) + { + $module->add_mod_info($this->module_class); + } + + $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', ''); + $errors = array(); + + switch ($action) + { + case 'delete': + if (!$module_id) + { + trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + if (confirm_box(true)) + { + // Make sure we are not directly within a module + if ($module_id == $this->parent_id) + { + $sql = 'SELECT parent_id + FROM ' . MODULES_TABLE . ' + WHERE module_id = ' . $module_id; + $result = $db->sql_query($sql); + $this->parent_id = (int) $db->sql_fetchfield('parent_id'); + $db->sql_freeresult($result); + } + + $errors = $this->delete_module($module_id); + + if (!sizeof($errors)) + { + $this->remove_cache_file(); + trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); + } + } + else + { + confirm_box(false, 'DELETE_MODULE', build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'parent_id' => $this->parent_id, + 'module_id' => $module_id, + 'action' => $action, + ))); + } + + break; + + case 'enable': + case 'disable': + if (!$module_id) + { + trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + $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 . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + $sql = 'UPDATE ' . MODULES_TABLE . ' + SET module_enabled = ' . (($action == 'enable') ? 1 : 0) . " + WHERE module_class = '" . $db->sql_escape($this->module_class) . "' + 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(); + + break; + + case 'move_up': + case 'move_down': + if (!$module_id) + { + trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + $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 . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + $move_module_name = $this->move_module_by($row, $action, 1); + + if ($move_module_name !== false) + { + add_log('admin', 'LOG_MODULE_' . strtoupper($action), $this->lang_name($row['module_langname']), $move_module_name); + $this->remove_cache_file(); + } + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'success' => ($move_module_name !== false), + )); + } + + break; + + case 'quickadd': + $quick_install = request_var('quick_install', ''); + + if (confirm_box(true)) + { + if (!$quick_install || strpos($quick_install, '::') === false) + { + break; + } + + list($module_basename, $module_mode) = explode('::', $quick_install); + + // Check if module name and mode exist... + $fileinfo = $this->get_module_infos($module_basename); + $fileinfo = $fileinfo[$module_basename]; + + if (isset($fileinfo['modes'][$module_mode])) + { + $module_data = array( + 'module_basename' => $module_basename, + 'module_enabled' => 0, + 'module_display' => (isset($fileinfo['modes'][$module_mode]['display'])) ? $fileinfo['modes'][$module_mode]['display'] : 1, + 'parent_id' => $this->parent_id, + 'module_class' => $this->module_class, + 'module_langname' => $fileinfo['modes'][$module_mode]['title'], + 'module_mode' => $module_mode, + 'module_auth' => $fileinfo['modes'][$module_mode]['auth'], + ); + + $errors = $this->update_module_data($module_data); + + if (!sizeof($errors)) + { + $this->remove_cache_file(); + + trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); + } + } + } + else + { + confirm_box(false, 'ADD_MODULE', build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'parent_id' => $this->parent_id, + 'action' => 'quickadd', + 'quick_install' => $quick_install, + ))); + } + + break; + + case 'edit': + + if (!$module_id) + { + trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + $module_row = $this->get_module_row($module_id); + + // no break + + case 'add': + + if ($action == 'add') + { + $module_row = array( + 'module_basename' => '', + 'module_enabled' => 0, + 'module_display' => 1, + 'parent_id' => 0, + 'module_langname' => utf8_normalize_nfc(request_var('module_langname', '', true)), + 'module_mode' => '', + 'module_auth' => '', + ); + } + + $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_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']); + + $submit = (isset($_POST['submit'])) ? true : false; + + if ($submit) + { + if (!$module_data['module_langname']) + { + trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + $module_type = request_var('module_type', 'category'); + + if ($module_type == 'category') + { + $module_data['module_basename'] = $module_data['module_mode'] = $module_data['module_auth'] = ''; + $module_data['module_display'] = 1; + } + + if ($action == 'edit') + { + $module_data['module_id'] = $module_id; + } + + // Adjust auth row + if ($module_data['module_basename'] && $module_data['module_mode']) + { + $fileinfo = $this->get_module_infos($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); + + if (!sizeof($errors)) + { + $this->remove_cache_file(); + + trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); + } + } + + // Category/not category? + $is_cat = (!$module_data['module_basename']) ? true : false; + + // Get module information + $module_infos = $this->get_module_infos(); + + // Build name options + $s_name_options = $s_mode_options = ''; + foreach ($module_infos as $option => $values) + { + if (!$module_data['module_basename']) + { + $module_data['module_basename'] = $option; + } + + // Name options + $s_name_options .= ''; + + $template->assign_block_vars('m_names', array('NAME' => $option, 'A_NAME' => addslashes($option))); + + // Build module modes + foreach ($values['modes'] as $m_mode => $m_values) + { + if ($option == $module_data['module_basename']) + { + $s_mode_options .= ''; + } + + $template->assign_block_vars('m_names.modes', array( + 'OPTION' => $m_mode, + 'VALUE' => $this->lang_name($m_values['title']), + 'A_OPTION' => addslashes($m_mode), + 'A_VALUE' => addslashes($this->lang_name($m_values['title']))) + ); + } + } + + $s_cat_option = ''; + + $template->assign_vars(array_merge(array( + 'S_EDIT_MODULE' => true, + 'S_IS_CAT' => $is_cat, + 'S_CAT_OPTIONS' => $s_cat_option . $this->make_module_select($module_data['parent_id'], ($action == 'edit') ? $module_row['module_id'] : false, false, false, false, true), + 'S_MODULE_NAMES' => $s_name_options, + 'S_MODULE_MODES' => $s_mode_options, + 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, + 'U_EDIT_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id, + + 'L_TITLE' => $user->lang[strtoupper($action) . '_MODULE'], + + 'MODULENAME' => $this->lang_name($module_data['module_langname']), + 'ACTION' => $action, + 'MODULE_ID' => $module_id, + + ), + array_change_key_case($module_data, CASE_UPPER)) + ); + + if (sizeof($errors)) + { + $template->assign_vars(array( + 'S_ERROR' => true, + 'ERROR_MSG' => implode('
', $errors)) + ); + } + + return; + + break; + } + + // Default management page + if (sizeof($errors)) + { + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'MESSAGE_TITLE' => $user->lang('ERROR'), + 'MESSAGE_TEXT' => implode('
', $errors), + 'SUCCESS' => false, + )); + } + + $template->assign_vars(array( + 'S_ERROR' => true, + 'ERROR_MSG' => implode('
', $errors)) + ); + } + + if (!$this->parent_id) + { + $navigation = strtoupper($this->module_class); + } + else + { + $navigation = '' . strtoupper($this->module_class) . ''; + + $modules_nav = $this->get_module_branch($this->parent_id, 'parents', 'descending'); + + foreach ($modules_nav as $row) + { + $langname = $this->lang_name($row['module_langname']); + + if ($row['module_id'] == $this->parent_id) + { + $navigation .= ' -> ' . $langname; + } + else + { + $navigation .= ' -> ' . $langname . ''; + } + } + } + + // Jumpbox + $module_box = $this->make_module_select($this->parent_id, false, false, false, false); + + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE parent_id = {$this->parent_id} + AND module_class = '" . $db->sql_escape($this->module_class) . "' + ORDER BY left_id"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + do + { + $langname = $this->lang_name($row['module_langname']); + + if (!$row['module_enabled']) + { + $module_image = '' . $user->lang['DEACTIVATED_MODULE'] .''; + } + else + { + $module_image = (!$row['module_basename'] || $row['left_id'] + 1 != $row['right_id']) ? '' . $user->lang['CATEGORY'] . '' : '' . $user->lang['MODULE'] . ''; + } + + $url = $this->u_action . '&parent_id=' . $this->parent_id . '&m=' . $row['module_id']; + + $template->assign_block_vars('modules', array( + 'MODULE_IMAGE' => $module_image, + 'MODULE_TITLE' => $langname, + 'MODULE_ENABLED' => ($row['module_enabled']) ? true : false, + 'MODULE_DISPLAYED' => ($row['module_display']) ? true : false, + + 'S_ACP_CAT_SYSTEM' => ($this->module_class == 'acp' && $row['module_langname'] == 'ACP_CAT_SYSTEM') ? true : false, + 'S_ACP_MODULE_MANAGEMENT' => ($this->module_class == 'acp' && ($row['module_basename'] == 'modules' || $row['module_langname'] == 'ACP_MODULE_MANAGEMENT')) ? true : false, + + 'U_MODULE' => $this->u_action . '&parent_id=' . $row['module_id'], + 'U_MOVE_UP' => $url . '&action=move_up', + 'U_MOVE_DOWN' => $url . '&action=move_down', + 'U_EDIT' => $url . '&action=edit', + 'U_DELETE' => $url . '&action=delete', + 'U_ENABLE' => $url . '&action=enable', + 'U_DISABLE' => $url . '&action=disable') + ); + } + while ($row = $db->sql_fetchrow($result)); + } + else if ($this->parent_id) + { + $row = $this->get_module_row($this->parent_id); + + $url = $this->u_action . '&parent_id=' . $this->parent_id . '&m=' . $row['module_id']; + + $template->assign_vars(array( + 'S_NO_MODULES' => true, + 'MODULE_TITLE' => $langname, + 'MODULE_ENABLED' => ($row['module_enabled']) ? true : false, + 'MODULE_DISPLAYED' => ($row['module_display']) ? true : false, + + 'U_EDIT' => $url . '&action=edit', + 'U_DELETE' => $url . '&action=delete', + 'U_ENABLE' => $url . '&action=enable', + 'U_DISABLE' => $url . '&action=disable') + ); + } + $db->sql_freeresult($result); + + // Quick adding module + $module_infos = $this->get_module_infos(); + + // Build quick options + $s_install_options = ''; + foreach ($module_infos as $option => $values) + { + // Name options + $s_install_options .= ''; + + // Build module modes + foreach ($values['modes'] as $m_mode => $m_values) + { + $s_install_options .= ''; + } + + $s_install_options .= ''; + } + + $template->assign_vars(array( + 'U_SEL_ACTION' => $this->u_action, + 'U_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id, + 'NAVIGATION' => $navigation, + 'MODULE_BOX' => $module_box, + 'PARENT_ID' => $this->parent_id, + 'S_INSTALL_OPTIONS' => $s_install_options, + ) + ); + } + + /** + * 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 . '&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) + { + global $db, $user, $auth, $config; + + $sql = 'SELECT module_id, module_enabled, module_basename, parent_id, module_langname, left_id, right_id, module_auth + FROM ' . MODULES_TABLE . " + WHERE module_class = '" . $db->sql_escape($this->module_class) . "' + ORDER BY left_id ASC"; + $result = $db->sql_query($sql); + + $right = $iteration = 0; + $padding_store = array('0' => ''); + $module_list = $padding = ''; + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['left_id'] < $right) + { + $padding .= '   '; + $padding_store[$row['parent_id']] = $padding; + } + else if ($row['left_id'] > $right + 1) + { + $padding = (isset($padding_store[$row['parent_id']])) ? $padding_store[$row['parent_id']] : ''; + } + + $right = $row['right_id']; + + if (!$ignore_acl && $row['module_auth']) + { + // We use zero as the forum id to check - global setting. + if (!p_master::module_auth($row['module_auth'], 0)) + { + continue; + } + } + + // ignore this module? + if ((is_array($ignore_id) && in_array($row['module_id'], $ignore_id)) || $row['module_id'] == $ignore_id) + { + continue; + } + + // empty category + if (!$row['module_basename'] && ($row['left_id'] + 1 == $row['right_id']) && $ignore_emptycat) + { + continue; + } + + // ignore non-category? + if ($row['module_basename'] && $ignore_noncat) + { + continue; + } + + $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']); + $module_list .= ''; + + $iteration++; + } + $db->sql_freeresult($result); + + unset($padding_store); + + 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 . '&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/sources/phpBB/includes/acp/acp_permission_roles.php b/sources/phpBB/includes/acp/acp_permission_roles.php new file mode 100644 index 0000000..cd36162 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_permission_roles.php @@ -0,0 +1,582 @@ + +* @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; +} + +class acp_permission_roles +{ + var $u_action; + protected $auth_admin; + + function main($id, $mode) + { + global $db, $user, $auth, $template, $cache, $phpbb_container; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $request; + + include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); + include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx); + + $this->auth_admin = new auth_admin(); + + $user->add_lang('acp/permissions'); + add_permission_language(); + + $this->tpl_name = 'acp_permission_roles'; + + $submit = (isset($_POST['submit'])) ? true : false; + $role_id = request_var('role_id', 0); + $action = request_var('action', ''); + $action = (isset($_POST['add'])) ? 'add' : $action; + + $form_name = 'acp_permissions'; + add_form_key($form_name); + + if (!$role_id && in_array($action, array('remove', 'edit', 'move_up', 'move_down'))) + { + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + switch ($mode) + { + case 'admin_roles': + $permission_type = 'a_'; + $this->page_title = 'ACP_ADMIN_ROLES'; + break; + + case 'user_roles': + $permission_type = 'u_'; + $this->page_title = 'ACP_USER_ROLES'; + break; + + case 'mod_roles': + $permission_type = 'm_'; + $this->page_title = 'ACP_MOD_ROLES'; + break; + + case 'forum_roles': + $permission_type = 'f_'; + $this->page_title = 'ACP_FORUM_ROLES'; + break; + + default: + trigger_error('NO_MODE', E_USER_ERROR); + break; + } + + $template->assign_vars(array( + 'L_TITLE' => $user->lang[$this->page_title], + 'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN']) + ); + + // Take action... admin submitted something + if ($submit || $action == 'remove') + { + switch ($action) + { + case 'remove': + + $sql = 'SELECT * + FROM ' . ACL_ROLES_TABLE . ' + WHERE role_id = ' . $role_id; + $result = $db->sql_query($sql); + $role_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$role_row) + { + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (confirm_box(true)) + { + $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); + trigger_error($user->lang['ROLE_DELETED'] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, 'DELETE_ROLE', build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'role_id' => $role_id, + 'action' => $action, + ))); + } + + break; + + case 'edit': + + // Get role we edit + $sql = 'SELECT * + FROM ' . ACL_ROLES_TABLE . ' + WHERE role_id = ' . $role_id; + $result = $db->sql_query($sql); + $role_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$role_row) + { + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // no break; + + case 'add': + + if (!check_form_key($form_name)) + { + 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)); + + if (!$role_name) + { + trigger_error($user->lang['NO_ROLE_NAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (utf8_strlen($role_description) > 4000) + { + trigger_error($user->lang['ROLE_DESCRIPTION_LONG'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // if we add/edit a role we check the name to be unique among the settings... + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = '" . $db->sql_escape($permission_type) . "' + AND role_name = '" . $db->sql_escape($role_name) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + // Make sure we only print out the error if we add the role or change it's name + if ($row && ($mode == 'add' || ($mode == 'edit' && $role_row['role_name'] != $role_name))) + { + trigger_error(sprintf($user->lang['ROLE_NAME_ALREADY_EXIST'], $role_name) . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql_ary = array( + 'role_name' => (string) $role_name, + 'role_description' => (string) $role_description, + 'role_type' => (string) $permission_type, + ); + + if ($action == 'edit') + { + $sql = 'UPDATE ' . ACL_ROLES_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE role_id = ' . $role_id; + $db->sql_query($sql); + } + else + { + // Get maximum role order for inserting a new role... + $sql = 'SELECT MAX(role_order) as max_order + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = '" . $db->sql_escape($permission_type) . "'"; + $result = $db->sql_query($sql); + $max_order = (int) $db->sql_fetchfield('max_order'); + $db->sql_freeresult($result); + + $sql_ary['role_order'] = $max_order + 1; + + $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + + $role_id = $db->sql_nextid(); + } + + // Now add the auth settings + $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); + + trigger_error($user->lang['ROLE_' . strtoupper($action) . '_SUCCESS'] . adm_back_link($this->u_action)); + + break; + } + } + + // Display screens + switch ($action) + { + case 'add': + + $options_from = request_var('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_type' => $permission_type, + ); + + if ($options_from) + { + $sql = 'SELECT p.auth_option_id, p.auth_setting, o.auth_option + FROM ' . ACL_ROLES_DATA_TABLE . ' p, ' . ACL_OPTIONS_TABLE . ' o + WHERE o.auth_option_id = p.auth_option_id + AND p.role_id = ' . $options_from . ' + ORDER BY p.auth_option_id'; + $result = $db->sql_query($sql); + + $auth_options = array(); + while ($row = $db->sql_fetchrow($result)) + { + $auth_options[$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + } + else + { + $sql = 'SELECT auth_option_id, auth_option + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()) . " + AND auth_option <> '{$permission_type}' + ORDER BY auth_option_id"; + $result = $db->sql_query($sql); + + $auth_options = array(); + while ($row = $db->sql_fetchrow($result)) + { + $auth_options[$row['auth_option']] = ACL_NO; + } + $db->sql_freeresult($result); + } + + // no break; + + case 'edit': + + if ($action == 'edit') + { + $sql = 'SELECT * + FROM ' . ACL_ROLES_TABLE . ' + WHERE role_id = ' . $role_id; + $result = $db->sql_query($sql); + $role_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $sql = 'SELECT p.auth_option_id, p.auth_setting, o.auth_option + FROM ' . ACL_ROLES_DATA_TABLE . ' p, ' . ACL_OPTIONS_TABLE . ' o + WHERE o.auth_option_id = p.auth_option_id + AND p.role_id = ' . $role_id . ' + ORDER BY p.auth_option_id'; + $result = $db->sql_query($sql); + + $auth_options = array(); + while ($row = $db->sql_fetchrow($result)) + { + $auth_options[$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + } + + if (!$role_row) + { + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $phpbb_permissions = $phpbb_container->get('acl.permissions'); + + $template->assign_vars(array( + 'S_EDIT' => true, + + 'U_ACTION' => $this->u_action . "&action={$action}&role_id={$role_id}", + 'U_BACK' => $this->u_action, + + 'ROLE_NAME' => $role_row['role_name'], + 'ROLE_DESCRIPTION' => $role_row['role_description'], + 'L_ACL_TYPE' => $phpbb_permissions->get_type_lang($permission_type), + )); + + // We need to fill the auth options array with ACL_NO options ;) + $sql = 'SELECT auth_option_id, auth_option + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()) . " + AND auth_option <> '{$permission_type}' + ORDER BY auth_option_id"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($auth_options[$row['auth_option']])) + { + $auth_options[$row['auth_option']] = ACL_NO; + } + } + $db->sql_freeresult($result); + + // Unset global permission option + unset($auth_options[$permission_type]); + + // Display auth options + $this->display_auth_options($auth_options); + + // Get users/groups/forums using this preset... + if ($action == 'edit') + { + $hold_ary = $this->auth_admin->get_role_mask($role_id); + + if (sizeof($hold_ary)) + { + $role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name']; + + $template->assign_vars(array( + 'S_DISPLAY_ROLE_MASK' => true, + 'L_ROLE_ASSIGNED_TO' => sprintf($user->lang['ROLE_ASSIGNED_TO'], $role_name)) + ); + + $this->auth_admin->display_role_mask($hold_ary); + } + } + + return; + break; + + case 'move_up': + case 'move_down': + + $sql = 'SELECT role_order + FROM ' . ACL_ROLES_TABLE . " + WHERE role_id = $role_id"; + $result = $db->sql_query($sql); + $order = $db->sql_fetchfield('role_order'); + $db->sql_freeresult($result); + + if ($order === false || ($order == 0 && $action == 'move_up')) + { + break; + } + $order = (int) $order; + $order_total = $order * 2 + (($action == 'move_up') ? -1 : 1); + + $sql = 'UPDATE ' . ACL_ROLES_TABLE . ' + SET role_order = ' . $order_total . " - role_order + WHERE role_type = '" . $db->sql_escape($permission_type) . "' + AND role_order IN ($order, " . (($action == 'move_up') ? $order - 1 : $order + 1) . ')'; + $db->sql_query($sql); + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'success' => (bool) $db->sql_affectedrows(), + )); + } + + break; + } + + // By default, check that role_order is valid and fix it if necessary + $sql = 'SELECT role_id, role_order + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = '" . $db->sql_escape($permission_type) . "' + ORDER BY role_order ASC"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $order = 0; + do + { + $order++; + if ($row['role_order'] != $order) + { + $db->sql_query('UPDATE ' . ACL_ROLES_TABLE . " SET role_order = $order WHERE role_id = {$row['role_id']}"); + } + } + while ($row = $db->sql_fetchrow($result)); + } + $db->sql_freeresult($result); + + // Display assigned items? + $display_item = request_var('display_item', 0); + + // Select existing roles + $sql = 'SELECT * + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = '" . $db->sql_escape($permission_type) . "' + ORDER BY role_order ASC"; + $result = $db->sql_query($sql); + + $s_role_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $role_name = (!empty($user->lang[$row['role_name']])) ? $user->lang[$row['role_name']] : $row['role_name']; + + $template->assign_block_vars('roles', array( + 'ROLE_NAME' => $role_name, + 'ROLE_DESCRIPTION' => (!empty($user->lang[$row['role_description']])) ? $user->lang[$row['role_description']] : nl2br($row['role_description']), + + 'U_EDIT' => $this->u_action . '&action=edit&role_id=' . $row['role_id'], + 'U_REMOVE' => $this->u_action . '&action=remove&role_id=' . $row['role_id'], + 'U_MOVE_UP' => $this->u_action . '&action=move_up&role_id=' . $row['role_id'], + 'U_MOVE_DOWN' => $this->u_action . '&action=move_down&role_id=' . $row['role_id'], + 'U_DISPLAY_ITEMS' => ($row['role_id'] == $display_item) ? '' : $this->u_action . '&display_item=' . $row['role_id'] . '#assigned_to') + ); + + $s_role_options .= ''; + + if ($display_item == $row['role_id']) + { + $template->assign_vars(array( + 'L_ROLE_ASSIGNED_TO' => sprintf($user->lang['ROLE_ASSIGNED_TO'], $role_name)) + ); + } + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'S_ROLE_OPTIONS' => $s_role_options) + ); + + if ($display_item) + { + $template->assign_vars(array( + 'S_DISPLAY_ROLE_MASK' => true) + ); + + $hold_ary = $this->auth_admin->get_role_mask($display_item); + $this->auth_admin->display_role_mask($hold_ary); + } + } + + /** + * Display permission settings able to be set + */ + function display_auth_options($auth_options) + { + global $template, $user, $phpbb_container; + + $phpbb_permissions = $phpbb_container->get('acl.permissions'); + + $content_array = $categories = array(); + $key_sort_array = array(0); + $auth_options = array(0 => $auth_options); + + // Making use of auth_admin method here (we do not really want to change two similar code fragments) + $this->auth_admin->build_permission_array($auth_options, $content_array, $categories, $key_sort_array); + + $content_array = $content_array[0]; + + $template->assign_var('S_NUM_PERM_COLS', sizeof($categories)); + + // Assign to template + foreach ($content_array as $cat => $cat_array) + { + $template->assign_block_vars('auth', array( + 'CAT_NAME' => $phpbb_permissions->get_category_lang($cat), + + 'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false, + 'S_NEVER' => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false, + 'S_NO' => ($cat_array['S_NO'] && !$cat_array['S_NEVER'] && !$cat_array['S_YES']) ? true : false) + ); + + foreach ($cat_array['permissions'] as $permission => $allowed) + { + $template->assign_block_vars('auth.mask', array( + 'S_YES' => ($allowed == ACL_YES) ? true : false, + 'S_NEVER' => ($allowed == ACL_NEVER) ? true : false, + 'S_NO' => ($allowed == ACL_NO) ? true : false, + + 'FIELD_NAME' => $permission, + 'PERMISSION' => $phpbb_permissions->get_permission_lang($permission), + )); + } + } + } + + /** + * Remove role + */ + function remove_role($role_id, $permission_type) + { + global $db; + + // Get complete auth array + $sql = 'SELECT auth_option, auth_option_id + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()); + $result = $db->sql_query($sql); + + $auth_settings = array(); + while ($row = $db->sql_fetchrow($result)) + { + $auth_settings[$row['auth_option']] = ACL_NO; + } + $db->sql_freeresult($result); + + // Get the role auth settings we need to re-set... + $sql = 'SELECT o.auth_option, r.auth_setting + FROM ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' o + WHERE o.auth_option_id = r.auth_option_id + AND r.role_id = ' . $role_id; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $auth_settings[$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + + // Get role assignments + $hold_ary = $this->auth_admin->get_role_mask($role_id); + + // Re-assign permissions + foreach ($hold_ary as $forum_id => $forum_ary) + { + if (isset($forum_ary['users'])) + { + $this->auth_admin->acl_set('user', $forum_id, $forum_ary['users'], $auth_settings, 0, false); + } + + if (isset($forum_ary['groups'])) + { + $this->auth_admin->acl_set('group', $forum_id, $forum_ary['groups'], $auth_settings, 0, false); + } + } + + // Remove role from users and groups just to be sure (happens through acl_set) + $sql = 'DELETE FROM ' . ACL_USERS_TABLE . ' + WHERE auth_role_id = ' . $role_id; + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . ' + WHERE auth_role_id = ' . $role_id; + $db->sql_query($sql); + + // Remove role data and role + $sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . ' + WHERE role_id = ' . $role_id; + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_ROLES_TABLE . ' + WHERE role_id = ' . $role_id; + $db->sql_query($sql); + + $this->auth_admin->acl_clear_prefetch(); + } +} diff --git a/sources/phpBB/includes/acp/acp_permissions.php b/sources/phpBB/includes/acp/acp_permissions.php new file mode 100644 index 0000000..cb408e3 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_permissions.php @@ -0,0 +1,1319 @@ + +* @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; +} + +class acp_permissions +{ + var $u_action; + var $permission_dropdown; + protected $permissions; + + function main($id, $mode) + { + global $db, $user, $auth, $template, $cache, $phpbb_container; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); + include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx); + + $this->permissions = $phpbb_container->get('acl.permissions'); + + $auth_admin = new auth_admin(); + + $user->add_lang('acp/permissions'); + add_permission_language(); + + $this->tpl_name = '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', ''); + + $this->tpl_name = 'permission_trace'; + + if ($user_id && isset($auth_admin->acl_options['id'][$permission]) && $auth->acl_get('a_viewauth')) + { + $this->page_title = sprintf($user->lang['TRACE_PERMISSION'], $this->permissions->get_permission_lang($permission)); + $this->permission_trace($user_id, $forum_id, $permission); + return; + } + trigger_error('NO_MODE', E_USER_ERROR); + } + + // Copy forum permissions + if ($mode == 'setting_forum_copy') + { + $this->tpl_name = 'permission_forum_copy'; + + if ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth')) + { + $this->page_title = 'ACP_FORUM_PERMISSIONS_COPY'; + $this->copy_forum_permissions(); + return; + } + + trigger_error('NO_MODE', E_USER_ERROR); + } + + // Set some vars + $action = request_var('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)); + + $username = request_var('username', array(''), true); + $usernames = request_var('usernames', '', true); + $user_id = request_var('user_id', array(0)); + + $group_id = request_var('group_id', array(0)); + $select_all_groups = request_var('select_all_groups', 0); + + $form_name = 'acp_permissions'; + add_form_key($form_name); + + // If select all groups is set, we pre-build the group id array (this option is used for other screens to link to the permission settings screen) + if ($select_all_groups) + { + // Add default groups to selection + $sql_and = (!$config['coppa_enable']) ? " AND group_name <> 'REGISTERED_COPPA'" : ''; + + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . ' + WHERE group_type = ' . GROUP_SPECIAL . " + $sql_and"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $group_id[] = $row['group_id']; + } + $db->sql_freeresult($result); + } + + // Map usernames to ids and vice versa + if ($usernames) + { + $username = explode("\n", $usernames); + } + unset($usernames); + + if (sizeof($username) && !sizeof($user_id)) + { + user_get_id_name($user_id, $username); + + if (!sizeof($user_id)) + { + trigger_error($user->lang['SELECTED_USER_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + unset($username); + + // Build forum ids (of all forums are checked or subforum listing used) + if ($all_forums) + { + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + ORDER BY left_id'; + $result = $db->sql_query($sql); + + $forum_id = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_id[] = (int) $row['forum_id']; + } + $db->sql_freeresult($result); + } + else if ($subforum_id) + { + $forum_id = array(); + foreach (get_forum_branch($subforum_id, 'children') as $row) + { + $forum_id[] = (int) $row['forum_id']; + } + } + + // Define some common variables for every mode + $error = array(); + + $permission_scope = (strpos($mode, '_global') !== false) ? 'global' : 'local'; + + // Showing introductionary page? + if ($mode == 'intro') + { + $this->page_title = 'ACP_PERMISSIONS'; + + $template->assign_vars(array( + 'S_INTRO' => true) + ); + + return; + } + + switch ($mode) + { + case 'setting_user_global': + case 'setting_group_global': + $this->permission_dropdown = array('u_', 'm_', 'a_'); + $permission_victim = ($mode == 'setting_user_global') ? array('user') : array('group'); + $this->page_title = ($mode == 'setting_user_global') ? 'ACP_USERS_PERMISSIONS' : 'ACP_GROUPS_PERMISSIONS'; + break; + + case 'setting_user_local': + case 'setting_group_local': + $this->permission_dropdown = array('f_', 'm_'); + $permission_victim = ($mode == 'setting_user_local') ? array('user', 'forums') : array('group', 'forums'); + $this->page_title = ($mode == 'setting_user_local') ? 'ACP_USERS_FORUM_PERMISSIONS' : 'ACP_GROUPS_FORUM_PERMISSIONS'; + break; + + case 'setting_admin_global': + case 'setting_mod_global': + $this->permission_dropdown = (strpos($mode, '_admin_') !== false) ? array('a_') : array('m_'); + $permission_victim = array('usergroup'); + $this->page_title = ($mode == 'setting_admin_global') ? 'ACP_ADMINISTRATORS' : 'ACP_GLOBAL_MODERATORS'; + break; + + case 'setting_mod_local': + case 'setting_forum_local': + $this->permission_dropdown = ($mode == 'setting_mod_local') ? array('m_') : array('f_'); + $permission_victim = array('forums', 'usergroup'); + $this->page_title = ($mode == 'setting_mod_local') ? 'ACP_FORUM_MODERATORS' : 'ACP_FORUM_PERMISSIONS'; + break; + + case 'view_admin_global': + case 'view_user_global': + case 'view_mod_global': + $this->permission_dropdown = ($mode == 'view_admin_global') ? array('a_') : (($mode == 'view_user_global') ? array('u_') : array('m_')); + $permission_victim = array('usergroup_view'); + $this->page_title = ($mode == 'view_admin_global') ? 'ACP_VIEW_ADMIN_PERMISSIONS' : (($mode == 'view_user_global') ? 'ACP_VIEW_USER_PERMISSIONS' : 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS'); + break; + + case 'view_mod_local': + case 'view_forum_local': + $this->permission_dropdown = ($mode == 'view_mod_local') ? array('m_') : array('f_'); + $permission_victim = array('forums', 'usergroup_view'); + $this->page_title = ($mode == 'view_mod_local') ? 'ACP_VIEW_FORUM_MOD_PERMISSIONS' : 'ACP_VIEW_FORUM_PERMISSIONS'; + break; + + default: + trigger_error('NO_MODE', E_USER_ERROR); + break; + } + + $template->assign_vars(array( + 'L_TITLE' => $user->lang[$this->page_title], + 'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN']) + ); + + // Get permission type + $permission_type = request_var('type', $this->permission_dropdown[0]); + + if (!in_array($permission_type, $this->permission_dropdown)) + { + trigger_error($user->lang['WRONG_PERMISSION_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Handle actions + if (strpos($mode, 'setting_') === 0 && $action) + { + switch ($action) + { + case 'delete': + if (confirm_box(true)) + { + // All users/groups selected? + $all_users = (isset($_POST['all_users'])) ? true : false; + $all_groups = (isset($_POST['all_groups'])) ? true : false; + + if ($all_users || $all_groups) + { + $items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type); + + if ($all_users && sizeof($items['user_ids'])) + { + $user_id = $items['user_ids']; + } + else if ($all_groups && sizeof($items['group_ids'])) + { + $group_id = $items['group_ids']; + } + } + + if (sizeof($user_id) || sizeof($group_id)) + { + $this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id); + } + else + { + trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + else + { + if (isset($_POST['cancel'])) + { + $u_redirect = $this->u_action . '&type=' . $permission_type; + foreach ($forum_id as $fid) + { + $u_redirect .= '&forum_id[]=' . $fid; + } + redirect($u_redirect); + } + + $s_hidden_fields = array( + 'i' => $id, + 'mode' => $mode, + 'action' => array($action => 1), + 'user_id' => $user_id, + 'group_id' => $group_id, + 'forum_id' => $forum_id, + 'type' => $permission_type, + ); + if (isset($_POST['all_users'])) + { + $s_hidden_fields['all_users'] = 1; + } + if (isset($_POST['all_groups'])) + { + $s_hidden_fields['all_groups'] = 1; + } + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields)); + } + break; + + case 'apply_permissions': + if (!isset($_POST['setting'])) + { + trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING); + } + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); + } + + $this->set_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id); + break; + + case 'apply_all_permissions': + if (!isset($_POST['setting'])) + { + trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING); + } + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); + } + + $this->set_all_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id); + break; + } + } + + // Go through the screens/options needed and present them in correct order + foreach ($permission_victim as $victim) + { + switch ($victim) + { + case 'forum_dropdown': + + if (sizeof($forum_id)) + { + $this->check_existence('forum', $forum_id); + continue 2; + } + + $template->assign_vars(array( + 'S_SELECT_FORUM' => true, + 'S_FORUM_OPTIONS' => make_forum_select(false, false, true, false, false)) + ); + + break; + + case 'forums': + + if (sizeof($forum_id)) + { + $this->check_existence('forum', $forum_id); + continue 2; + } + + $forum_list = make_forum_select(false, false, true, false, false, false, true); + + // Build forum options + $s_forum_options = ''; + foreach ($forum_list as $f_id => $f_row) + { + $s_forum_options .= ''; + } + + // Build subforum options + $s_subforum_options = $this->build_subforum_options($forum_list); + + $template->assign_vars(array( + 'S_SELECT_FORUM' => true, + 'S_FORUM_OPTIONS' => $s_forum_options, + 'S_SUBFORUM_OPTIONS' => $s_subforum_options, + 'S_FORUM_ALL' => true, + 'S_FORUM_MULTIPLE' => true) + ); + + break; + + case 'user': + + if (sizeof($user_id)) + { + $this->check_existence('user', $user_id); + continue 2; + } + + $template->assign_vars(array( + 'S_SELECT_USER' => true, + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_victim&field=username&select_single=true'), + )); + + break; + + case 'group': + + if (sizeof($group_id)) + { + $this->check_existence('group', $group_id); + continue 2; + } + + $template->assign_vars(array( + 'S_SELECT_GROUP' => true, + 'S_GROUP_OPTIONS' => group_select_options(false, false, false), // Show all groups + )); + + break; + + case 'usergroup': + case 'usergroup_view': + + $all_users = (isset($_POST['all_users'])) ? true : false; + $all_groups = (isset($_POST['all_groups'])) ? true : false; + + if ((sizeof($user_id) && !$all_users) || (sizeof($group_id) && !$all_groups)) + { + if (sizeof($user_id)) + { + $this->check_existence('user', $user_id); + } + + if (sizeof($group_id)) + { + $this->check_existence('group', $group_id); + } + + continue 2; + } + + // Now we check the users... because the "all"-selection is different here (all defined users/groups) + $items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type); + + if ($all_users && sizeof($items['user_ids'])) + { + $user_id = $items['user_ids']; + continue 2; + } + + if ($all_groups && sizeof($items['group_ids'])) + { + $group_id = $items['group_ids']; + continue 2; + } + + $template->assign_vars(array( + 'S_SELECT_USERGROUP' => ($victim == 'usergroup') ? true : false, + 'S_SELECT_USERGROUP_VIEW' => ($victim == 'usergroup_view') ? true : false, + 'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'], + 'S_DEFINED_GROUP_OPTIONS' => $items['group_ids_options'], + 'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids'], false), // Show all groups + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username&select_single=true'), + )); + + break; + } + + // The S_ALLOW_SELECT parameter below is a measure to lower memory usage. + // If there are more than 5 forums selected the admin is not able to select all users/groups too. + // We need to see if the number of forums can be increased or need to be decreased. + + // Setting permissions screen + $s_hidden_fields = build_hidden_fields(array( + 'user_id' => $user_id, + 'group_id' => $group_id, + 'forum_id' => $forum_id, + 'type' => $permission_type, + )); + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'ANONYMOUS_USER_ID' => ANONYMOUS, + + 'S_SELECT_VICTIM' => true, + 'S_ALLOW_ALL_SELECT' => (sizeof($forum_id) > 5) ? false : true, + 'S_CAN_SELECT_USER' => ($auth->acl_get('a_authusers')) ? true : false, + 'S_CAN_SELECT_GROUP' => ($auth->acl_get('a_authgroups')) ? true : false, + 'S_HIDDEN_FIELDS' => $s_hidden_fields) + ); + + // Let the forum names being displayed + if (sizeof($forum_id)) + { + $sql = 'SELECT forum_name + FROM ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_id) . ' + ORDER BY left_id ASC'; + $result = $db->sql_query($sql); + + $forum_names = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_names[] = $row['forum_name']; + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'S_FORUM_NAMES' => (sizeof($forum_names)) ? true : false, + 'FORUM_NAMES' => implode($user->lang['COMMA_SEPARATOR'], $forum_names)) + ); + } + + return; + } + + // Setting permissions screen + $s_hidden_fields = build_hidden_fields(array( + 'user_id' => $user_id, + 'group_id' => $group_id, + 'forum_id' => $forum_id, + 'type' => $permission_type, + )); + + // Do not allow forum_ids being set and no other setting defined (will bog down the server too much) + if (sizeof($forum_id) && !sizeof($user_id) && !sizeof($group_id)) + { + trigger_error($user->lang['ONLY_FORUM_DEFINED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $template->assign_vars(array( + 'S_PERMISSION_DROPDOWN' => (sizeof($this->permission_dropdown) > 1) ? $this->build_permission_dropdown($this->permission_dropdown, $permission_type, $permission_scope) : false, + 'L_PERMISSION_TYPE' => $this->permissions->get_type_lang($permission_type), + + 'U_ACTION' => $this->u_action, + 'S_HIDDEN_FIELDS' => $s_hidden_fields) + ); + + if (strpos($mode, 'setting_') === 0) + { + $template->assign_vars(array( + 'S_SETTING_PERMISSIONS' => true) + ); + + $hold_ary = $auth_admin->get_mask('set', (sizeof($user_id)) ? $user_id : false, (sizeof($group_id)) ? $group_id : false, (sizeof($forum_id)) ? $forum_id : false, $permission_type, $permission_scope, ACL_NO); + $auth_admin->display_mask('set', $permission_type, $hold_ary, ((sizeof($user_id)) ? 'user' : 'group'), (($permission_scope == 'local') ? true : false)); + } + else + { + $template->assign_vars(array( + 'S_VIEWING_PERMISSIONS' => true) + ); + + $hold_ary = $auth_admin->get_mask('view', (sizeof($user_id)) ? $user_id : false, (sizeof($group_id)) ? $group_id : false, (sizeof($forum_id)) ? $forum_id : false, $permission_type, $permission_scope, ACL_NEVER); + $auth_admin->display_mask('view', $permission_type, $hold_ary, ((sizeof($user_id)) ? 'user' : 'group'), (($permission_scope == 'local') ? true : false)); + } + } + + /** + * Build +subforum options + */ + function build_subforum_options($forum_list) + { + global $user; + + $s_options = ''; + + $forum_list = array_merge($forum_list); + + foreach ($forum_list as $key => $row) + { + if ($row['disabled']) + { + continue; + } + + $s_options .= ''; + } + + return $s_options; + } + + /** + * Build dropdown field for changing permission types + */ + function build_permission_dropdown($options, $default_option, $permission_scope) + { + global $auth; + + $s_dropdown_options = ''; + foreach ($options as $setting) + { + if (!$auth->acl_get('a_' . str_replace('_', '', $setting) . 'auth')) + { + continue; + } + + $selected = ($setting == $default_option) ? ' selected="selected"' : ''; + $l_setting = $this->permissions->get_type_lang($setting, $permission_scope); + $s_dropdown_options .= ''; + } + + return $s_dropdown_options; + } + + /** + * Check if selected items exist. Remove not found ids and if empty return error. + */ + function check_existence($mode, &$ids) + { + global $db, $user; + + switch ($mode) + { + case 'user': + $table = USERS_TABLE; + $sql_id = 'user_id'; + break; + + case 'group': + $table = GROUPS_TABLE; + $sql_id = 'group_id'; + break; + + case 'forum': + $table = FORUMS_TABLE; + $sql_id = 'forum_id'; + break; + } + + if (sizeof($ids)) + { + $sql = "SELECT $sql_id + FROM $table + WHERE " . $db->sql_in_set($sql_id, $ids); + $result = $db->sql_query($sql); + + $ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $ids[] = (int) $row[$sql_id]; + } + $db->sql_freeresult($result); + } + + if (!sizeof($ids)) + { + trigger_error($user->lang['SELECTED_' . strtoupper($mode) . '_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + + /** + * Apply permissions + */ + function set_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id) + { + global $db, $cache, $user, $auth; + global $request; + + $psubmit = request_var('psubmit', array(0 => array(0 => 0))); + + // User or group to be set? + $ug_type = (sizeof($user_id)) ? 'user' : 'group'; + + // Check the permission setting again + if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's')) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $ug_id = $forum_id = 0; + + // We loop through the auth settings defined in our submit + list($ug_id, ) = each($psubmit); + list($forum_id, ) = each($psubmit[$ug_id]); + + $settings = $request->variable('setting', array(0 => array(0 => array('' => 0))), false, \phpbb\request\request_interface::POST); + if (empty($settings) || empty($settings[$ug_id]) || empty($settings[$ug_id][$forum_id])) + { + trigger_error('WRONG_PERMISSION_SETTING_FORMAT', E_USER_WARNING); + } + + $auth_settings = $settings[$ug_id][$forum_id]; + + // Do we have a role we want to set? + $roles = $request->variable('role', array(0 => array(0 => 0)), false, \phpbb\request\request_interface::POST); + $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))); + + $ug_id = array($ug_id); + $forum_id = array($forum_id); + + if (sizeof($inherit)) + { + foreach ($inherit as $_ug_id => $forum_id_ary) + { + // Inherit users/groups? + if (!in_array($_ug_id, $ug_id)) + { + $ug_id[] = $_ug_id; + } + + // Inherit forums? + $forum_id = array_merge($forum_id, array_keys($forum_id_ary)); + } + } + + $forum_id = array_unique($forum_id); + + // If the auth settings differ from the assigned role, then do not set a role... + if ($assigned_role) + { + if (!$this->check_assigned_role($assigned_role, $auth_settings)) + { + $assigned_role = 0; + } + } + + // Update the permission set... + $auth_admin->acl_set($ug_type, $forum_id, $ug_id, $auth_settings, $assigned_role); + + // Do we need to recache the moderator lists? + if ($permission_type == 'm_') + { + phpbb_cache_moderators($db, $cache, $auth); + } + + // Remove users who are now moderators or admins from everyones foes list + if ($permission_type == 'm_' || $permission_type == 'a_') + { + phpbb_update_foes($db, $auth, $group_id, $user_id); + } + + $this->log_action($mode, 'add', $permission_type, $ug_type, $ug_id, $forum_id); + + trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action)); + } + + /** + * Apply all permissions + */ + function set_all_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id) + { + global $db, $cache, $user, $auth; + global $request; + + // User or group to be set? + $ug_type = (sizeof($user_id)) ? 'user' : 'group'; + + // Check the permission setting again + if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's')) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $auth_settings = $request->variable('setting', array(0 => array(0 => array('' => 0))), false, \phpbb\request\request_interface::POST); + $auth_roles = $request->variable('role', array(0 => array(0 => 0)), false, \phpbb\request\request_interface::POST); + $ug_ids = $forum_ids = array(); + + // We need to go through the auth settings + foreach ($auth_settings as $ug_id => $forum_auth_row) + { + $ug_id = (int) $ug_id; + $ug_ids[] = $ug_id; + + foreach ($forum_auth_row as $forum_id => $auth_options) + { + $forum_id = (int) $forum_id; + $forum_ids[] = $forum_id; + + // Check role... + $assigned_role = (isset($auth_roles[$ug_id][$forum_id])) ? (int) $auth_roles[$ug_id][$forum_id] : 0; + + // If the auth settings differ from the assigned role, then do not set a role... + if ($assigned_role) + { + if (!$this->check_assigned_role($assigned_role, $auth_options)) + { + $assigned_role = 0; + } + } + + // Update the permission set... + $auth_admin->acl_set($ug_type, $forum_id, $ug_id, $auth_options, $assigned_role, false); + } + } + + $auth_admin->acl_clear_prefetch(); + + // Do we need to recache the moderator lists? + if ($permission_type == 'm_') + { + phpbb_cache_moderators($db, $cache, $auth); + } + + // Remove users who are now moderators or admins from everyones foes list + if ($permission_type == 'm_' || $permission_type == 'a_') + { + phpbb_update_foes($db, $auth, $group_id, $user_id); + } + + $this->log_action($mode, 'add', $permission_type, $ug_type, $ug_ids, $forum_ids); + + if ($mode == 'setting_forum_local' || $mode == 'setting_mod_local') + { + trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action . '&forum_id[]=' . implode('&forum_id[]=', $forum_ids))); + } + else + { + trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action)); + } + } + + /** + * Compare auth settings with auth settings from role + * returns false if they differ, true if they are equal + */ + function check_assigned_role($role_id, &$auth_settings) + { + global $db; + + $sql = 'SELECT o.auth_option, r.auth_setting + FROM ' . ACL_OPTIONS_TABLE . ' o, ' . ACL_ROLES_DATA_TABLE . ' r + WHERE o.auth_option_id = r.auth_option_id + AND r.role_id = ' . $role_id; + $result = $db->sql_query($sql); + + $test_auth_settings = array(); + while ($row = $db->sql_fetchrow($result)) + { + $test_auth_settings[$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + + // We need to add any ACL_NO setting from auth_settings to compare correctly + foreach ($auth_settings as $option => $setting) + { + if ($setting == ACL_NO) + { + $test_auth_settings[$option] = $setting; + } + } + + if (sizeof(array_diff_assoc($auth_settings, $test_auth_settings))) + { + return false; + } + + return true; + } + + /** + * Remove permissions + */ + function remove_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id, &$forum_id) + { + global $user, $db, $cache, $auth; + + // User or group to be set? + $ug_type = (sizeof($user_id)) ? 'user' : 'group'; + + // Check the permission setting again + if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's')) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $auth_admin->acl_delete($ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : false), $permission_type); + + // Do we need to recache the moderator lists? + if ($permission_type == 'm_') + { + phpbb_cache_moderators($db, $cache, $auth); + } + + $this->log_action($mode, 'del', $permission_type, $ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : array(0 => 0))); + + if ($mode == 'setting_forum_local' || $mode == 'setting_mod_local') + { + trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action . '&forum_id[]=' . implode('&forum_id[]=', $forum_id))); + } + else + { + trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action)); + } + } + + /** + * Log permission changes + */ + function log_action($mode, $action, $permission_type, $ug_type, $ug_id, $forum_id) + { + global $db, $user; + + if (!is_array($ug_id)) + { + $ug_id = array($ug_id); + } + + if (!is_array($forum_id)) + { + $forum_id = array($forum_id); + } + + // Logging ... first grab user or groupnames ... + $sql = ($ug_type == 'group') ? 'SELECT group_name as name, group_type FROM ' . GROUPS_TABLE . ' WHERE ' : 'SELECT username as name FROM ' . USERS_TABLE . ' WHERE '; + $sql .= $db->sql_in_set(($ug_type == 'group') ? 'group_id' : 'user_id', array_map('intval', $ug_id)); + $result = $db->sql_query($sql); + + $l_ug_list = ''; + while ($row = $db->sql_fetchrow($result)) + { + $l_ug_list .= (($l_ug_list != '') ? ', ' : '') . ((isset($row['group_type']) && $row['group_type'] == GROUP_SPECIAL) ? '' . $user->lang['G_' . $row['name']] . '' : $row['name']); + } + $db->sql_freeresult($result); + + $mode = str_replace('setting_', '', $mode); + + if ($forum_id[0] == 0) + { + add_log('admin', 'LOG_ACL_' . strtoupper($action) . '_' . strtoupper($mode) . '_' . strtoupper($permission_type), $l_ug_list); + } + else + { + // Grab the forum details if non-zero forum_id + $sql = 'SELECT forum_name + FROM ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_id); + $result = $db->sql_query($sql); + + $l_forum_list = ''; + while ($row = $db->sql_fetchrow($result)) + { + $l_forum_list .= (($l_forum_list != '') ? ', ' : '') . $row['forum_name']; + } + $db->sql_freeresult($result); + + add_log('admin', 'LOG_ACL_' . strtoupper($action) . '_' . strtoupper($mode) . '_' . strtoupper($permission_type), $l_forum_list, $l_ug_list); + } + } + + /** + * Display a complete trace tree for the selected permission to determine where settings are set/unset + */ + function permission_trace($user_id, $forum_id, $permission) + { + global $db, $template, $user, $auth; + + if ($user_id != $user->data['user_id']) + { + $userdata = $auth->obtain_user_data($user_id); + } + else + { + $userdata = $user->data; + } + + if (!$userdata) + { + trigger_error('NO_USERS', E_USER_ERROR); + } + + $forum_name = false; + + if ($forum_id) + { + $sql = 'SELECT forum_name + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $db->sql_query($sql, 3600); + $forum_name = $db->sql_fetchfield('forum_name'); + $db->sql_freeresult($result); + } + + $back = request_var('back', 0); + + $template->assign_vars(array( + 'PERMISSION' => $this->permissions->get_permission_lang($permission), + 'PERMISSION_USERNAME' => $userdata['username'], + 'FORUM_NAME' => $forum_name, + + 'S_GLOBAL_TRACE' => ($forum_id) ? false : true, + + 'U_BACK' => ($back) ? build_url(array('f', 'back')) . "&f=$back" : '') + ); + + $template->assign_block_vars('trace', array( + 'WHO' => $user->lang['DEFAULT'], + 'INFORMATION' => $user->lang['TRACE_DEFAULT'], + + 'S_SETTING_NO' => true, + 'S_TOTAL_NO' => true) + ); + + $sql = 'SELECT DISTINCT g.group_name, g.group_id, g.group_type + FROM ' . GROUPS_TABLE . ' g + LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (ug.group_id = g.group_id) + WHERE ug.user_id = ' . $user_id . ' + AND ug.user_pending = 0 + AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1) + ORDER BY g.group_type DESC, g.group_id DESC'; + $result = $db->sql_query($sql); + + $groups = array(); + while ($row = $db->sql_fetchrow($result)) + { + $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'] + ); + } + $db->sql_freeresult($result); + + $total = ACL_NO; + $add_key = (($forum_id) ? '_LOCAL' : ''); + + if (sizeof($groups)) + { + // Get group auth settings + $hold_ary = $auth->acl_group_raw_data(array_keys($groups), $permission, $forum_id); + + foreach ($hold_ary as $group_id => $forum_ary) + { + $groups[$group_id]['auth_setting'] = $hold_ary[$group_id][$forum_id][$permission]; + } + unset($hold_ary); + + foreach ($groups as $id => $row) + { + switch ($row['auth_setting']) + { + case ACL_NO: + $information = $user->lang['TRACE_GROUP_NO' . $add_key]; + break; + + case ACL_YES: + $information = ($total == ACL_YES) ? $user->lang['TRACE_GROUP_YES_TOTAL_YES' . $add_key] : (($total == ACL_NEVER) ? $user->lang['TRACE_GROUP_YES_TOTAL_NEVER' . $add_key] : $user->lang['TRACE_GROUP_YES_TOTAL_NO' . $add_key]); + $total = ($total == ACL_NO) ? ACL_YES : $total; + break; + + case ACL_NEVER: + $information = ($total == ACL_YES) ? $user->lang['TRACE_GROUP_NEVER_TOTAL_YES' . $add_key] : (($total == ACL_NEVER) ? $user->lang['TRACE_GROUP_NEVER_TOTAL_NEVER' . $add_key] : $user->lang['TRACE_GROUP_NEVER_TOTAL_NO' . $add_key]); + $total = ACL_NEVER; + break; + } + + $template->assign_block_vars('trace', array( + 'WHO' => $row['group_name'], + 'INFORMATION' => $information, + + 'S_SETTING_NO' => ($row['auth_setting'] == ACL_NO) ? true : false, + 'S_SETTING_YES' => ($row['auth_setting'] == ACL_YES) ? true : false, + 'S_SETTING_NEVER' => ($row['auth_setting'] == ACL_NEVER) ? true : false, + 'S_TOTAL_NO' => ($total == ACL_NO) ? true : false, + 'S_TOTAL_YES' => ($total == ACL_YES) ? true : false, + 'S_TOTAL_NEVER' => ($total == ACL_NEVER) ? true : false) + ); + } + } + + // Get user specific permission... globally or for this forum + $hold_ary = $auth->acl_user_raw_data($user_id, $permission, $forum_id); + $auth_setting = (!sizeof($hold_ary)) ? ACL_NO : $hold_ary[$user_id][$forum_id][$permission]; + + switch ($auth_setting) + { + case ACL_NO: + $information = ($total == ACL_NO) ? $user->lang['TRACE_USER_NO_TOTAL_NO' . $add_key] : $user->lang['TRACE_USER_KEPT' . $add_key]; + $total = ($total == ACL_NO) ? ACL_NEVER : $total; + break; + + case ACL_YES: + $information = ($total == ACL_YES) ? $user->lang['TRACE_USER_YES_TOTAL_YES' . $add_key] : (($total == ACL_NEVER) ? $user->lang['TRACE_USER_YES_TOTAL_NEVER' . $add_key] : $user->lang['TRACE_USER_YES_TOTAL_NO' . $add_key]); + $total = ($total == ACL_NO) ? ACL_YES : $total; + break; + + case ACL_NEVER: + $information = ($total == ACL_YES) ? $user->lang['TRACE_USER_NEVER_TOTAL_YES' . $add_key] : (($total == ACL_NEVER) ? $user->lang['TRACE_USER_NEVER_TOTAL_NEVER' . $add_key] : $user->lang['TRACE_USER_NEVER_TOTAL_NO' . $add_key]); + $total = ACL_NEVER; + break; + } + + $template->assign_block_vars('trace', array( + 'WHO' => $userdata['username'], + 'INFORMATION' => $information, + + 'S_SETTING_NO' => ($auth_setting == ACL_NO) ? true : false, + 'S_SETTING_YES' => ($auth_setting == ACL_YES) ? true : false, + 'S_SETTING_NEVER' => ($auth_setting == ACL_NEVER) ? true : false, + 'S_TOTAL_NO' => false, + 'S_TOTAL_YES' => ($total == ACL_YES) ? true : false, + 'S_TOTAL_NEVER' => ($total == ACL_NEVER) ? true : false) + ); + + if ($forum_id != 0 && isset($auth->acl_options['global'][$permission])) + { + if ($user_id != $user->data['user_id']) + { + $auth2 = new \phpbb\auth\auth(); + $auth2->acl($userdata); + $auth_setting = $auth2->acl_get($permission); + } + else + { + $auth_setting = $auth->acl_get($permission); + } + + if ($auth_setting) + { + $information = ($total == ACL_YES) ? $user->lang['TRACE_USER_GLOBAL_YES_TOTAL_YES'] : $user->lang['TRACE_USER_GLOBAL_YES_TOTAL_NEVER']; + $total = ACL_YES; + } + else + { + $information = $user->lang['TRACE_USER_GLOBAL_NEVER_TOTAL_KEPT']; + } + + // If there is no auth information we do not need to worry the user by showing non-relevant data. + if ($auth_setting) + { + $template->assign_block_vars('trace', array( + 'WHO' => sprintf($user->lang['TRACE_GLOBAL_SETTING'], $userdata['username']), + 'INFORMATION' => sprintf($information, '", ''), + + 'S_SETTING_NO' => false, + 'S_SETTING_YES' => $auth_setting, + 'S_SETTING_NEVER' => !$auth_setting, + 'S_TOTAL_NO' => false, + 'S_TOTAL_YES' => ($total == ACL_YES) ? true : false, + 'S_TOTAL_NEVER' => ($total == ACL_NEVER) ? true : false) + ); + } + } + + // Take founder status into account, overwriting the default values + if ($userdata['user_type'] == USER_FOUNDER && strpos($permission, 'a_') === 0) + { + $template->assign_block_vars('trace', array( + 'WHO' => $userdata['username'], + 'INFORMATION' => $user->lang['TRACE_USER_FOUNDER'], + + 'S_SETTING_NO' => ($auth_setting == ACL_NO) ? true : false, + 'S_SETTING_YES' => ($auth_setting == ACL_YES) ? true : false, + 'S_SETTING_NEVER' => ($auth_setting == ACL_NEVER) ? true : false, + 'S_TOTAL_NO' => false, + 'S_TOTAL_YES' => true, + 'S_TOTAL_NEVER' => false) + ); + + $total = ACL_YES; + } + + // Total value... + $template->assign_vars(array( + 'S_RESULT_NO' => ($total == ACL_NO) ? true : false, + 'S_RESULT_YES' => ($total == ACL_YES) ? true : false, + 'S_RESULT_NEVER' => ($total == ACL_NEVER) ? true : false, + )); + } + + /** + * Handles copying permissions from one forum to others + */ + function copy_forum_permissions() + { + global $db, $auth, $cache, $template, $user; + + $user->add_lang('acp/forums'); + + $submit = isset($_POST['submit']) ? true : false; + + if ($submit) + { + $src = request_var('src_forum_id', 0); + $dest = request_var('dest_forum_ids', array(0)); + + if (confirm_box(true)) + { + if (copy_forum_permissions($src, $dest)) + { + phpbb_cache_moderators($db, $cache, $auth); + + $auth->acl_clear_prefetch(); + $cache->destroy('sql', FORUMS_TABLE); + + trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action)); + } + else + { + trigger_error($user->lang['SELECTED_FORUM_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + else + { + $s_hidden_fields = array( + 'submit' => $submit, + 'src_forum_id' => $src, + 'dest_forum_ids' => $dest, + ); + + $s_hidden_fields = build_hidden_fields($s_hidden_fields); + + confirm_box(false, $user->lang['COPY_PERMISSIONS_CONFIRM'], $s_hidden_fields); + } + } + + $template->assign_vars(array( + 'S_FORUM_OPTIONS' => make_forum_select(false, false, false, false, false), + )); + } + + /** + * Get already assigned users/groups + */ + function retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type) + { + global $db, $user; + + $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'); + + // Permission options are only able to be a permission set... therefore we will pre-fetch the possible options and also the possible roles + $option_ids = $role_ids = array(); + + $sql = 'SELECT auth_option_id + FROM ' . ACL_OPTIONS_TABLE . ' + WHERE auth_option ' . $db->sql_like_expression($permission_type . $db->get_any_char()); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $option_ids[] = (int) $row['auth_option_id']; + } + $db->sql_freeresult($result); + + if (sizeof($option_ids)) + { + $sql = 'SELECT DISTINCT role_id + FROM ' . ACL_ROLES_DATA_TABLE . ' + WHERE ' . $db->sql_in_set('auth_option_id', $option_ids); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $role_ids[] = (int) $row['role_id']; + } + $db->sql_freeresult($result); + } + + if (sizeof($option_ids) && sizeof($role_ids)) + { + $sql_where = 'AND (' . $db->sql_in_set('a.auth_option_id', $option_ids) . ' OR ' . $db->sql_in_set('a.auth_role_id', $role_ids) . ')'; + } + else if (sizeof($role_ids)) + { + $sql_where = 'AND ' . $db->sql_in_set('a.auth_role_id', $role_ids); + } + else if (sizeof($option_ids)) + { + $sql_where = 'AND ' . $db->sql_in_set('a.auth_option_id', $option_ids); + } + + // Not ideal, due to the filesort, non-use of indexes, etc. + $sql = 'SELECT DISTINCT u.user_id, u.username, u.username_clean, u.user_regdate + FROM ' . USERS_TABLE . ' u, ' . ACL_USERS_TABLE . " a + WHERE u.user_id = a.user_id + $sql_forum_id + $sql_where + ORDER BY u.username_clean, u.user_regdate ASC"; + $result = $db->sql_query($sql); + + $s_defined_user_options = ''; + $defined_user_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $s_defined_user_options .= ''; + $defined_user_ids[] = $row['user_id']; + } + $db->sql_freeresult($result); + + $sql = 'SELECT DISTINCT g.group_type, g.group_name, g.group_id + FROM ' . GROUPS_TABLE . ' g, ' . ACL_GROUPS_TABLE . " a + WHERE g.group_id = a.group_id + $sql_forum_id + $sql_where + ORDER BY g.group_type DESC, g.group_name ASC"; + $result = $db->sql_query($sql); + + $s_defined_group_options = ''; + $defined_group_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $s_defined_group_options .= '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; + $defined_group_ids[] = $row['group_id']; + } + $db->sql_freeresult($result); + + return array( + 'group_ids' => $defined_group_ids, + 'group_ids_options' => $s_defined_group_options, + 'user_ids' => $defined_user_ids, + 'user_ids_options' => $s_defined_user_options + ); + } +} diff --git a/sources/phpBB/includes/acp/acp_php_info.php b/sources/phpBB/includes/acp/acp_php_info.php new file mode 100644 index 0000000..810a111 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_php_info.php @@ -0,0 +1,90 @@ + +* @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; +} + +class acp_php_info +{ + var $u_action; + + function main($id, $mode) + { + global $db, $user, $auth, $template; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + if ($mode != 'info') + { + trigger_error('NO_MODE', E_USER_ERROR); + } + + $this->tpl_name = 'acp_php_info'; + $this->page_title = 'ACP_PHP_INFO'; + + ob_start(); + phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_VARIABLES); + $phpinfo = ob_get_clean(); + + $phpinfo = trim($phpinfo); + + // Here we play around a little with the PHP Info HTML to try and stylise + // it along phpBB's lines ... hopefully without breaking anything. The idea + // for this was nabbed from the PHP annotated manual + preg_match_all('#]*>(.*)#si', $phpinfo, $output); + + if (empty($phpinfo) || empty($output[1][0])) + { + trigger_error('NO_PHPINFO_AVAILABLE', E_USER_WARNING); + } + + $output = $output[1][0]; + + // expose_php can make the image not exist + if (preg_match('#]*>]*>#', $output)) + { + $output = preg_replace('#(.*?]*>]*>)(.*?)#s', '
\2\1
', $output); + } + else + { + $output = preg_replace('#(.*?)#s', '
\1
', $output); + } + $output = preg_replace('#]+>#i', '', $output); + $output = preg_replace('#', ''), array('class="row1"', 'class="row2"', '', '', ''), $output); + + // Fix invalid anchor names (eg "module_Zend Optimizer") + $output = preg_replace_callback('##', array($this, 'remove_spaces'), $output); + + if (empty($output)) + { + trigger_error('NO_PHPINFO_AVAILABLE', E_USER_WARNING); + } + + $orig_output = $output; + + preg_match_all('#
(.*)
#siU', $output, $output); + $output = (!empty($output[1][0])) ? $output[1][0] : $orig_output; + + $template->assign_var('PHPINFO', $output); + } + + function remove_spaces($matches) + { + return '
'; + } +} diff --git a/sources/phpBB/includes/acp/acp_profile.php b/sources/phpBB/includes/acp/acp_profile.php new file mode 100644 index 0000000..0462815 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_profile.php @@ -0,0 +1,1139 @@ + +* @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; +} + +class acp_profile +{ + var $u_action; + + var $edit_lang_id; + var $lang_defs; + 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; + + include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + $user->add_lang(array('ucp', 'acp/profile')); + $this->tpl_name = 'acp_profile'; + $this->page_title = 'ACP_CUSTOM_PROFILE_FIELDS'; + + $field_id = $request->variable('field_id', 0); + $action = (isset($_POST['create'])) ? 'create' : request_var('action', ''); + + $error = array(); + $s_hidden_fields = ''; + + if (!$field_id && in_array($action, array('delete','activate', 'deactivate', 'move_up', 'move_down', 'edit'))) + { + trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $cp = $phpbb_container->get('profilefields.manager'); + $this->type_collection = $phpbb_container->get('profilefields.type_collection'); + + // Build Language array + // Based on this, we decide which elements need to be edited later and which language items are missing + $this->lang_defs = array(); + + $sql = 'SELECT lang_id, lang_iso + FROM ' . LANG_TABLE . ' + ORDER BY lang_english_name'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + // Make some arrays with all available languages + $this->lang_defs['id'][$row['lang_id']] = $row['lang_iso']; + $this->lang_defs['iso'][$row['lang_iso']] = $row['lang_id']; + } + $db->sql_freeresult($result); + + $sql = 'SELECT field_id, lang_id + FROM ' . PROFILE_LANG_TABLE . ' + ORDER BY lang_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + // Which languages are available for each item + $this->lang_defs['entry'][$row['field_id']][] = $row['lang_id']; + } + $db->sql_freeresult($result); + + // Have some fields been defined? + if (isset($this->lang_defs['entry'])) + { + foreach ($this->lang_defs['entry'] as $field_ident => $field_ary) + { + // Fill an array with the languages that are missing for each field + $this->lang_defs['diff'][$field_ident] = array_diff(array_values($this->lang_defs['iso']), $field_ary); + } + } + + switch ($action) + { + case 'delete': + + if (confirm_box(true)) + { + $sql = 'SELECT field_ident + FROM ' . PROFILE_FIELDS_TABLE . " + WHERE field_id = $field_id"; + $result = $db->sql_query($sql); + $field_ident = (string) $db->sql_fetchfield('field_ident'); + $db->sql_freeresult($result); + + $db->sql_transaction('begin'); + + $db->sql_query('DELETE FROM ' . PROFILE_FIELDS_TABLE . " WHERE field_id = $field_id"); + $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"); + + $db_tools = $phpbb_container->get('dbal.tools'); + $db_tools->sql_column_remove(PROFILE_FIELDS_DATA_TABLE, 'pf_' . $field_ident); + + $order = 0; + + $sql = 'SELECT * + FROM ' . PROFILE_FIELDS_TABLE . ' + ORDER BY field_order'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $order++; + if ($row['field_order'] != $order) + { + $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . " + SET field_order = $order + WHERE field_id = {$row['field_id']}"; + $db->sql_query($sql); + } + } + $db->sql_freeresult($result); + + $db->sql_transaction('commit'); + + add_log('admin', 'LOG_PROFILE_FIELD_REMOVED', $field_ident); + trigger_error($user->lang['REMOVED_PROFILE_FIELD'] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, 'DELETE_PROFILE_FIELD', build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'field_id' => $field_id, + ))); + } + + break; + + case 'activate': + + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE . " + WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'"; + $result = $db->sql_query($sql); + $default_lang_id = (int) $db->sql_fetchfield('lang_id'); + $db->sql_freeresult($result); + + if (!in_array($default_lang_id, $this->lang_defs['entry'][$field_id])) + { + trigger_error($user->lang['DEFAULT_LANGUAGE_NOT_FILLED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . " + SET field_active = 1 + WHERE field_id = $field_id"; + $db->sql_query($sql); + + $sql = 'SELECT field_ident + FROM ' . PROFILE_FIELDS_TABLE . " + WHERE field_id = $field_id"; + $result = $db->sql_query($sql); + $field_ident = (string) $db->sql_fetchfield('field_ident'); + $db->sql_freeresult($result); + + add_log('admin', 'LOG_PROFILE_FIELD_ACTIVATE', $field_ident); + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response(); + $json_response->send(array( + 'text' => $user->lang('DEACTIVATE'), + )); + } + + trigger_error($user->lang['PROFILE_FIELD_ACTIVATED'] . adm_back_link($this->u_action)); + + break; + + case 'deactivate': + + $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . " + SET field_active = 0 + WHERE field_id = $field_id"; + $db->sql_query($sql); + + $sql = 'SELECT field_ident + FROM ' . PROFILE_FIELDS_TABLE . " + WHERE field_id = $field_id"; + $result = $db->sql_query($sql); + $field_ident = (string) $db->sql_fetchfield('field_ident'); + $db->sql_freeresult($result); + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response(); + $json_response->send(array( + 'text' => $user->lang('ACTIVATE'), + )); + } + + add_log('admin', 'LOG_PROFILE_FIELD_DEACTIVATE', $field_ident); + + trigger_error($user->lang['PROFILE_FIELD_DEACTIVATED'] . adm_back_link($this->u_action)); + + break; + + case 'move_up': + case 'move_down': + + $sql = 'SELECT field_order + FROM ' . PROFILE_FIELDS_TABLE . " + WHERE field_id = $field_id"; + $result = $db->sql_query($sql); + $field_order = $db->sql_fetchfield('field_order'); + $db->sql_freeresult($result); + + if ($field_order === false || ($field_order == 0 && $action == 'move_up')) + { + break; + } + $field_order = (int) $field_order; + $order_total = $field_order * 2 + (($action == 'move_up') ? -1 : 1); + + $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . " + SET field_order = $order_total - field_order + WHERE field_order IN ($field_order, " . (($action == 'move_up') ? $field_order - 1 : $field_order + 1) . ')'; + $db->sql_query($sql); + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'success' => (bool) $db->sql_affectedrows(), + )); + } + + break; + + case 'create': + case 'edit': + + $step = request_var('step', 1); + + $submit = (isset($_REQUEST['next']) || isset($_REQUEST['prev'])) ? true : false; + $save = (isset($_REQUEST['save'])) ? true : false; + + // The language id of default language + $this->edit_lang_id = $this->lang_defs['iso'][$config['default_lang']]; + + // We are editing... we need to grab basic things + if ($action == 'edit') + { + $sql = 'SELECT l.*, f.* + FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f + WHERE l.lang_id = ' . $this->edit_lang_id . " + AND f.field_id = $field_id + AND l.field_id = f.field_id"; + $result = $db->sql_query($sql); + $field_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$field_row) + { + // Some admin changed the default language? + $sql = 'SELECT l.*, f.* + FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f + WHERE l.lang_id <> ' . $this->edit_lang_id . " + AND f.field_id = $field_id + AND l.field_id = f.field_id"; + $result = $db->sql_query($sql); + $field_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$field_row) + { + trigger_error($user->lang['FIELD_NOT_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $this->edit_lang_id = $field_row['lang_id']; + } + $field_type = $field_row['field_type']; + $profile_field = $this->type_collection[$field_type]; + + // Get language entries + $sql = 'SELECT * + FROM ' . PROFILE_FIELDS_LANG_TABLE . ' + WHERE lang_id = ' . $this->edit_lang_id . " + AND field_id = $field_id + ORDER BY option_id ASC"; + $result = $db->sql_query($sql); + + $lang_options = array(); + while ($row = $db->sql_fetchrow($result)) + { + $lang_options[$row['option_id']] = $row['lang_value']; + } + $db->sql_freeresult($result); + + $s_hidden_fields = ''; + } + else + { + // We are adding a new field, define basic params + $lang_options = $field_row = array(); + + $field_type = request_var('field_type', ''); + + if (!isset($this->type_collection[$field_type])) + { + trigger_error($user->lang['NO_FIELD_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $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_required' => 0, + 'field_show_novalue'=> 0, + 'field_hide' => 0, + 'field_show_profile'=> 0, + 'field_no_view' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 0, + 'field_show_on_vt' => 0, + 'field_show_on_ml' => 0, + 'field_is_contact' => 0, + 'field_contact_desc'=> '', + 'field_contact_url' => '', + 'lang_name' => utf8_normalize_nfc(request_var('field_ident', '', true)), + 'lang_explain' => '', + 'lang_default_value'=> '') + ); + + $s_hidden_fields = ''; + } + + // $exclude contains the data we gather in each step + $exclude = array( + 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_pm', 'field_show_on_vt', 'field_show_on_ml', 'field_required', 'field_show_novalue', 'field_hide', 'field_show_profile', 'field_no_view', 'field_is_contact', 'field_contact_desc', 'field_contact_url'), + 2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'), + 3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options') + ); + + // Visibility Options... + $visibility_ary = array( + '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_is_contact', + ); + + $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['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); + $cp->vars['field_contact_desc'] = $request->variable('field_contact_desc', $field_row['field_contact_desc'], true); + $cp->vars['field_contact_url'] = $request->variable('field_contact_url', $field_row['field_contact_url'], true); + + foreach ($visibility_ary as $val) + { + $cp->vars[$val] = ($submit || $save) ? $request->variable($val, 0) : $field_row[$val]; + } + + $cp->vars['field_no_view'] = $request->variable('field_no_view', (int) $field_row['field_no_view']); + + // If the user has submitted a form with options (i.e. dropdown field) + if ($options) + { + $exploded_options = (is_array($options)) ? $options : explode("\n", $options); + + if (sizeof($exploded_options) == sizeof($lang_options) || $action == 'create') + { + // The number of options in the field is equal to the number of options already in the database + // Or we are creating a new dropdown list. + $cp->vars['lang_options'] = $exploded_options; + } + else if ($action == 'edit') + { + // Changing the number of options? (We remove and re-create the option fields) + $cp->vars['lang_options'] = $exploded_options; + } + } + else + { + $cp->vars['lang_options'] = $lang_options; + } + + // step 2 + foreach ($exclude[2] as $key) + { + $var = utf8_normalize_nfc(request_var($key, $field_row[$key], true)); + + $field_data = $cp->vars; + $var = $profile_field->get_excluded_options($key, $action, $var, $field_data, 2); + $cp->vars = $field_data; + + $cp->vars[$key] = $var; + } + + // step 3 - all arrays + if ($action == 'edit') + { + // Get language entries + $sql = 'SELECT * + FROM ' . PROFILE_FIELDS_LANG_TABLE . ' + WHERE lang_id <> ' . $this->edit_lang_id . " + AND field_id = $field_id + ORDER BY option_id ASC"; + $result = $db->sql_query($sql); + + $l_lang_options = array(); + while ($row = $db->sql_fetchrow($result)) + { + $l_lang_options[$row['lang_id']][$row['option_id']] = $row['lang_value']; + } + $db->sql_freeresult($result); + + $sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value + FROM ' . PROFILE_LANG_TABLE . ' + WHERE lang_id <> ' . $this->edit_lang_id . " + AND field_id = $field_id + ORDER BY lang_id ASC"; + $result = $db->sql_query($sql); + + $l_lang_name = $l_lang_explain = $l_lang_default_value = array(); + while ($row = $db->sql_fetchrow($result)) + { + $l_lang_name[$row['lang_id']] = $row['lang_name']; + $l_lang_explain[$row['lang_id']] = $row['lang_explain']; + $l_lang_default_value[$row['lang_id']] = $row['lang_default_value']; + } + $db->sql_freeresult($result); + } + + foreach ($exclude[3] as $key) + { + $cp->vars[$key] = utf8_normalize_nfc(request_var($key, array(0 => ''), true)); + + if (!$cp->vars[$key] && $action == 'edit') + { + $cp->vars[$key] = $$key; + } + + $field_data = $cp->vars; + $var = $profile_field->get_excluded_options($key, $action, $var, $field_data, 3); + $cp->vars = $field_data; + } + + // Check for general issues in every step + if ($submit) // && $step == 1 + { + // Check values for step 1 + if ($cp->vars['field_ident'] == '') + { + $error[] = $user->lang['EMPTY_FIELD_IDENT']; + } + + if (!preg_match('/^[a-z_]+$/', $cp->vars['field_ident'])) + { + $error[] = $user->lang['INVALID_CHARS_FIELD_IDENT']; + } + + if (strlen($cp->vars['field_ident']) > 17) + { + $error[] = $user->lang['INVALID_FIELD_IDENT_LEN']; + } + + if ($cp->vars['lang_name'] == '') + { + $error[] = $user->lang['EMPTY_USER_FIELD_NAME']; + } + + $error = $profile_field->validate_options_on_submit($error, $cp->vars); + + // Check for already existing field ident + if ($action != 'edit') + { + $sql = 'SELECT field_ident + FROM ' . PROFILE_FIELDS_TABLE . " + WHERE field_ident = '" . $db->sql_escape($cp->vars['field_ident']) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $error[] = $user->lang['FIELD_IDENT_ALREADY_EXIST']; + } + } + } + + $step = (isset($_REQUEST['next'])) ? $step + 1 : ((isset($_REQUEST['prev'])) ? $step - 1 : $step); + + if (sizeof($error)) + { + $step--; + $submit = false; + } + + // Build up the specific hidden fields + foreach ($exclude as $num => $key_ary) + { + if ($num == $step) + { + continue; + } + + $_new_key_ary = array(); + + $field_data = $cp->vars; + foreach ($key_ary as $key) + { + $var = $profile_field->prepare_hidden_fields($step, $key, $action, $field_data); + if ($var !== null) + { + $_new_key_ary[$key] = $profile_field->prepare_hidden_fields($step, $key, $action, $field_data); + } + } + $cp->vars = $field_data; + + $s_hidden_fields .= build_hidden_fields($_new_key_ary); + } + + if (!sizeof($error)) + { + if ($step == 3 && (sizeof($this->lang_defs['iso']) == 1 || $save)) + { + $this->save_profile_field($cp, $field_type, $action); + } + else if ($action == 'edit' && $save) + { + $this->save_profile_field($cp, $field_type, $action); + } + } + + $template->assign_vars(array( + 'S_EDIT' => true, + 'S_EDIT_MODE' => ($action == 'edit') ? true : false, + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', + + 'L_TITLE' => $user->lang['STEP_' . $step . '_TITLE_' . strtoupper($action)], + 'L_EXPLAIN' => $user->lang['STEP_' . $step . '_EXPLAIN_' . strtoupper($action)], + + 'U_ACTION' => $this->u_action . "&action=$action&step=$step", + 'U_BACK' => $this->u_action) + ); + + // Now go through the steps + switch ($step) + { + // Create basic options - only small differences between field types + case 1: + $template_vars = array( + 'S_STEP_ONE' => true, + 'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false, + 'S_FIELD_SHOW_NOVALUE'=> ($cp->vars['field_show_novalue']) ? true : false, + 'S_SHOW_ON_REG' => ($cp->vars['field_show_on_reg']) ? true : false, + 'S_SHOW_ON_PM' => ($cp->vars['field_show_on_pm']) ? true : false, + 'S_SHOW_ON_VT' => ($cp->vars['field_show_on_vt']) ? true : false, + 'S_SHOW_ON_MEMBERLIST'=> ($cp->vars['field_show_on_ml']) ? true : false, + 'S_FIELD_HIDE' => ($cp->vars['field_hide']) ? true : false, + 'S_SHOW_PROFILE' => ($cp->vars['field_show_profile']) ? true : false, + 'S_FIELD_NO_VIEW' => ($cp->vars['field_no_view']) ? true : false, + 'S_FIELD_CONTACT' => $cp->vars['field_is_contact'], + 'FIELD_CONTACT_DESC'=> $cp->vars['field_contact_desc'], + 'FIELD_CONTACT_URL' => $cp->vars['field_contact_url'], + + 'L_LANG_SPECIFIC' => sprintf($user->lang['LANG_SPECIFIC_OPTIONS'], $config['default_lang']), + 'FIELD_TYPE' => $profile_field->get_name(), + 'FIELD_IDENT' => $cp->vars['field_ident'], + 'LANG_NAME' => $cp->vars['lang_name'], + 'LANG_EXPLAIN' => $cp->vars['lang_explain'], + ); + + $field_data = $cp->vars; + $profile_field->display_options($template_vars, $field_data); + $cp->vars = $field_data; + + // Build common create options + $template->assign_vars($template_vars); + break; + + case 2: + + $template->assign_vars(array( + 'S_STEP_TWO' => true, + 'L_NEXT_STEP' => (sizeof($this->lang_defs['iso']) == 1) ? $user->lang['SAVE'] : $user->lang['PROFILE_LANG_OPTIONS']) + ); + + // Build options based on profile type + $options = $profile_field->get_options($this->lang_defs['iso'][$config['default_lang']], $cp->vars); + + foreach ($options as $num => $option_ary) + { + $template->assign_block_vars('option', $option_ary); + } + + break; + + // Define remaining language variables + case 3: + + $template->assign_var('S_STEP_THREE', true); + $options = $this->build_language_options($cp, $field_type, $action); + + foreach ($options as $lang_id => $lang_ary) + { + $template->assign_block_vars('options', array( + 'LANGUAGE' => sprintf($user->lang[(($lang_id == $this->edit_lang_id) ? 'DEFAULT_' : '') . 'ISO_LANGUAGE'], $lang_ary['lang_iso'])) + ); + + foreach ($lang_ary['fields'] as $field_ident => $field_ary) + { + $template->assign_block_vars('options.field', array( + 'L_TITLE' => $field_ary['TITLE'], + 'L_EXPLAIN' => (isset($field_ary['EXPLAIN'])) ? $field_ary['EXPLAIN'] : '', + 'FIELD' => $field_ary['FIELD']) + ); + } + } + + break; + } + + $template->assign_vars(array( + 'S_HIDDEN_FIELDS' => $s_hidden_fields) + ); + + return; + + break; + } + + $sql = 'SELECT * + FROM ' . PROFILE_FIELDS_TABLE . ' + ORDER BY field_order'; + $result = $db->sql_query($sql); + + $s_one_need_edit = false; + while ($row = $db->sql_fetchrow($result)) + { + $active_lang = (!$row['field_active']) ? 'ACTIVATE' : 'DEACTIVATE'; + $active_value = (!$row['field_active']) ? 'activate' : 'deactivate'; + $id = $row['field_id']; + + $s_need_edit = (sizeof($this->lang_defs['diff'][$row['field_id']])) ? true : false; + + if ($s_need_edit) + { + $s_one_need_edit = true; + } + + $profile_field = $this->type_collection[$row['field_type']]; + $template->assign_block_vars('fields', array( + 'FIELD_IDENT' => $row['field_ident'], + 'FIELD_TYPE' => $profile_field->get_name(), + + 'L_ACTIVATE_DEACTIVATE' => $user->lang[$active_lang], + 'U_ACTIVATE_DEACTIVATE' => $this->u_action . "&action=$active_value&field_id=$id", + 'U_EDIT' => $this->u_action . "&action=edit&field_id=$id", + 'U_TRANSLATE' => $this->u_action . "&action=edit&field_id=$id&step=3", + 'U_DELETE' => $this->u_action . "&action=delete&field_id=$id", + 'U_MOVE_UP' => $this->u_action . "&action=move_up&field_id=$id", + 'U_MOVE_DOWN' => $this->u_action . "&action=move_down&field_id=$id", + + 'S_NEED_EDIT' => $s_need_edit) + ); + } + $db->sql_freeresult($result); + + // At least one option field needs editing? + if ($s_one_need_edit) + { + $template->assign_var('S_NEED_EDIT', true); + } + + $s_select_type = ''; + foreach ($this->type_collection as $key => $profile_field) + { + $s_select_type .= ''; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'S_TYPE_OPTIONS' => $s_select_type, + )); + } + + /** + * Build all Language specific options + */ + function build_language_options(&$cp, $field_type, $action = 'create') + { + global $user, $config, $db, $phpbb_container; + + $default_lang_id = (!empty($this->edit_lang_id)) ? $this->edit_lang_id : $this->lang_defs['iso'][$config['default_lang']]; + + $sql = 'SELECT lang_id, lang_iso + FROM ' . LANG_TABLE . ' + WHERE lang_id <> ' . (int) $default_lang_id . ' + ORDER BY lang_english_name'; + $result = $db->sql_query($sql); + + $languages = array(); + while ($row = $db->sql_fetchrow($result)) + { + $languages[$row['lang_id']] = $row['lang_iso']; + } + $db->sql_freeresult($result); + + $profile_field = $this->type_collection[$field_type]; + $options = $profile_field->get_language_options($cp->vars); + + $lang_options = array(); + + foreach ($options as $field => $field_type) + { + $lang_options[1]['lang_iso'] = $this->lang_defs['id'][$default_lang_id]; + $lang_options[1]['fields'][$field] = array( + 'TITLE' => $user->lang['CP_' . strtoupper($field)], + 'FIELD' => '
' . ((is_array($cp->vars[$field])) ? implode('
', $cp->vars[$field]) : bbcode_nl2br($cp->vars[$field])) . '
' + ); + + if (isset($user->lang['CP_' . strtoupper($field) . '_EXPLAIN'])) + { + $lang_options[1]['fields'][$field]['EXPLAIN'] = $user->lang['CP_' . strtoupper($field) . '_EXPLAIN']; + } + } + + foreach ($languages as $lang_id => $lang_iso) + { + $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]; + 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]; + + switch ($field_type) + { + case 'two_options': + + $lang_options[$lang_id]['fields'][$field] = array( + 'TITLE' => $user->lang['CP_' . strtoupper($field)], + 'FIELD' => ' +
' . $user->lang['FIRST_OPTION'] . '
+
' . $user->lang['SECOND_OPTION'] . '
' + ); + break; + + case 'optionfield': + $value = ((isset($value[$lang_id])) ? ((is_array($value[$lang_id])) ? implode("\n", $value[$lang_id]) : $value[$lang_id]) : implode("\n", $var)); + $lang_options[$lang_id]['fields'][$field] = array( + 'TITLE' => $user->lang['CP_' . strtoupper($field)], + 'FIELD' => '
' + ); + break; + } + + if (isset($user->lang['CP_' . strtoupper($field) . '_EXPLAIN'])) + { + $lang_options[$lang_id]['fields'][$field]['EXPLAIN'] = $user->lang['CP_' . strtoupper($field) . '_EXPLAIN']; + } + } + else + { + $var = ($action == 'create' || !is_array($cp->vars[$field])) ? $cp->vars[$field] : $cp->vars[$field][$lang_id]; + + $lang_options[$lang_id]['fields'][$field] = array( + 'TITLE' => $user->lang['CP_' . strtoupper($field)], + 'FIELD' => ($field_type == 'string') ? '
' : '
' + ); + + if (isset($user->lang['CP_' . strtoupper($field) . '_EXPLAIN'])) + { + $lang_options[$lang_id]['fields'][$field]['EXPLAIN'] = $user->lang['CP_' . strtoupper($field) . '_EXPLAIN']; + } + } + } + } + + return $lang_options; + } + + /** + * Save Profile Field + */ + function save_profile_field(&$cp, $field_type, $action = 'create') + { + global $db, $config, $user, $phpbb_container; + + $field_id = request_var('field_id', 0); + + // Collect all information, if something is going wrong, abort the operation + $profile_sql = $profile_lang = $empty_lang = $profile_lang_fields = array(); + + $default_lang_id = (!empty($this->edit_lang_id)) ? $this->edit_lang_id : $this->lang_defs['iso'][$config['default_lang']]; + + if ($action == 'create') + { + $sql = 'SELECT MAX(field_order) as max_field_order + FROM ' . PROFILE_FIELDS_TABLE; + $result = $db->sql_query($sql); + $new_field_order = (int) $db->sql_fetchfield('max_field_order'); + $db->sql_freeresult($result); + + $field_ident = $cp->vars['field_ident']; + } + + // Save the field + $profile_fields = array( + 'field_length' => $cp->vars['field_length'], + 'field_minlen' => $cp->vars['field_minlen'], + 'field_maxlen' => $cp->vars['field_maxlen'], + 'field_novalue' => $cp->vars['field_novalue'], + 'field_default_value' => $cp->vars['field_default_value'], + 'field_validation' => $cp->vars['field_validation'], + 'field_required' => $cp->vars['field_required'], + 'field_show_novalue' => $cp->vars['field_show_novalue'], + 'field_show_on_reg' => $cp->vars['field_show_on_reg'], + 'field_show_on_pm' => $cp->vars['field_show_on_pm'], + 'field_show_on_vt' => $cp->vars['field_show_on_vt'], + 'field_show_on_ml' => $cp->vars['field_show_on_ml'], + 'field_hide' => $cp->vars['field_hide'], + 'field_show_profile' => $cp->vars['field_show_profile'], + 'field_no_view' => $cp->vars['field_no_view'], + 'field_is_contact' => $cp->vars['field_is_contact'], + 'field_contact_desc' => $cp->vars['field_contact_desc'], + 'field_contact_url' => $cp->vars['field_contact_url'], + ); + + if ($action == 'create') + { + $profile_fields += array( + 'field_type' => $field_type, + 'field_ident' => $field_ident, + 'field_name' => $field_ident, + 'field_order' => $new_field_order + 1, + 'field_active' => 1 + ); + + $sql = 'INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $db->sql_build_array('INSERT', $profile_fields); + $db->sql_query($sql); + + $field_id = $db->sql_nextid(); + } + else + { + $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $profile_fields) . " + WHERE field_id = $field_id"; + $db->sql_query($sql); + } + + $profile_field = $this->type_collection[$field_type]; + + if ($action == 'create') + { + $field_ident = 'pf_' . $field_ident; + + $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)); + } + + $sql_ary = array( + 'lang_name' => $cp->vars['lang_name'], + 'lang_explain' => $cp->vars['lang_explain'], + 'lang_default_value' => $cp->vars['lang_default_value'] + ); + + if ($action == 'create') + { + $sql_ary['field_id'] = $field_id; + $sql_ary['lang_id'] = $default_lang_id; + + $profile_sql[] = 'INSERT INTO ' . PROFILE_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + } + else + { + $this->update_insert(PROFILE_LANG_TABLE, $sql_ary, array('field_id' => $field_id, 'lang_id' => $default_lang_id)); + } + + if (is_array($cp->vars['l_lang_name']) && sizeof($cp->vars['l_lang_name'])) + { + foreach ($cp->vars['l_lang_name'] as $lang_id => $data) + { + if (($cp->vars['lang_name'] != '' && $cp->vars['l_lang_name'][$lang_id] == '') + || ($cp->vars['lang_explain'] != '' && $cp->vars['l_lang_explain'][$lang_id] == '') + || ($cp->vars['lang_default_value'] != '' && $cp->vars['l_lang_default_value'][$lang_id] == '')) + { + $empty_lang[$lang_id] = true; + break; + } + + if (!isset($empty_lang[$lang_id])) + { + $profile_lang[] = array( + 'field_id' => $field_id, + 'lang_id' => $lang_id, + 'lang_name' => $cp->vars['l_lang_name'][$lang_id], + 'lang_explain' => (isset($cp->vars['l_lang_explain'][$lang_id])) ? $cp->vars['l_lang_explain'][$lang_id] : '', + 'lang_default_value' => (isset($cp->vars['l_lang_default_value'][$lang_id])) ? $cp->vars['l_lang_default_value'][$lang_id] : '' + ); + } + } + + foreach ($empty_lang as $lang_id => $NULL) + { + $sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . " + WHERE field_id = $field_id + AND lang_id = " . (int) $lang_id; + $db->sql_query($sql); + } + } + + $cp->vars = $profile_field->get_language_options_input($cp->vars); + + if ($cp->vars['lang_options']) + { + if (!is_array($cp->vars['lang_options'])) + { + $cp->vars['lang_options'] = explode("\n", $cp->vars['lang_options']); + } + + if ($action != 'create') + { + $sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . " + WHERE field_id = $field_id + AND lang_id = " . (int) $default_lang_id; + $db->sql_query($sql); + } + + foreach ($cp->vars['lang_options'] as $option_id => $value) + { + $sql_ary = array( + 'field_type' => $field_type, + 'lang_value' => $value + ); + + if ($action == 'create') + { + $sql_ary['field_id'] = $field_id; + $sql_ary['lang_id'] = $default_lang_id; + $sql_ary['option_id'] = (int) $option_id; + + $profile_sql[] = 'INSERT INTO ' . PROFILE_FIELDS_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + } + else + { + $this->update_insert(PROFILE_FIELDS_LANG_TABLE, $sql_ary, array( + 'field_id' => $field_id, + 'lang_id' => (int) $default_lang_id, + 'option_id' => (int) $option_id) + ); + } + } + } + + if (is_array($cp->vars['l_lang_options']) && sizeof($cp->vars['l_lang_options'])) + { + $empty_lang = array(); + + foreach ($cp->vars['l_lang_options'] as $lang_id => $lang_ary) + { + if (!is_array($lang_ary)) + { + $lang_ary = explode("\n", $lang_ary); + } + + if (sizeof($lang_ary) != sizeof($cp->vars['lang_options'])) + { + $empty_lang[$lang_id] = true; + } + + if (!isset($empty_lang[$lang_id])) + { + if ($action != 'create') + { + $sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . " + WHERE field_id = $field_id + AND lang_id = " . (int) $lang_id; + $db->sql_query($sql); + } + + foreach ($lang_ary as $option_id => $value) + { + $profile_lang_fields[] = array( + 'field_id' => (int) $field_id, + 'lang_id' => (int) $lang_id, + 'option_id' => (int) $option_id, + 'field_type' => $field_type, + 'lang_value' => $value + ); + } + } + } + + foreach ($empty_lang as $lang_id => $NULL) + { + $sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . " + WHERE field_id = $field_id + AND lang_id = " . (int) $lang_id; + $db->sql_query($sql); + } + } + + foreach ($profile_lang as $sql) + { + if ($action == 'create') + { + $profile_sql[] = 'INSERT INTO ' . PROFILE_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql); + } + else + { + $lang_id = $sql['lang_id']; + unset($sql['lang_id'], $sql['field_id']); + + $this->update_insert(PROFILE_LANG_TABLE, $sql, array('lang_id' => (int) $lang_id, 'field_id' => $field_id)); + } + } + + if (sizeof($profile_lang_fields)) + { + foreach ($profile_lang_fields as $sql) + { + if ($action == 'create') + { + $profile_sql[] = 'INSERT INTO ' . PROFILE_FIELDS_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql); + } + else + { + $lang_id = $sql['lang_id']; + $option_id = $sql['option_id']; + unset($sql['lang_id'], $sql['field_id'], $sql['option_id']); + + $this->update_insert(PROFILE_FIELDS_LANG_TABLE, $sql, array( + 'lang_id' => $lang_id, + 'field_id' => $field_id, + 'option_id' => $option_id) + ); + } + } + } + + $db->sql_transaction('begin'); + + if ($action == 'create') + { + foreach ($profile_sql as $sql) + { + $db->sql_query($sql); + } + } + + $db->sql_transaction('commit'); + + if ($action == 'edit') + { + add_log('admin', 'LOG_PROFILE_FIELD_EDIT', $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']); + trigger_error($user->lang['ADDED_PROFILE_FIELD'] . adm_back_link($this->u_action)); + } + } + + /** + * Update, then insert if not successfull + */ + function update_insert($table, $sql_ary, $where_fields) + { + global $db; + + $where_sql = array(); + $check_key = ''; + + foreach ($where_fields as $key => $value) + { + $check_key = (!$check_key) ? $key : $check_key; + $where_sql[] = $key . ' = ' . ((is_string($value)) ? "'" . $db->sql_escape($value) . "'" : (int) $value); + } + + if (!sizeof($where_sql)) + { + return; + } + + $sql = "SELECT $check_key + FROM $table + WHERE " . implode(' AND ', $where_sql); + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + $sql_ary = array_merge($where_fields, $sql_ary); + + if (sizeof($sql_ary)) + { + $db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql_ary)); + } + } + else + { + if (sizeof($sql_ary)) + { + $sql = "UPDATE $table SET " . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE ' . implode(' AND ', $where_sql); + $db->sql_query($sql); + } + } + } +} diff --git a/sources/phpBB/includes/acp/acp_prune.php b/sources/phpBB/includes/acp/acp_prune.php new file mode 100644 index 0000000..59f15c4 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_prune.php @@ -0,0 +1,557 @@ + +* @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; +} + +class acp_prune +{ + var $u_action; + + function main($id, $mode) + { + global $user, $phpEx, $phpbb_admin_path, $phpbb_root_path; + + $user->add_lang('acp/prune'); + include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + switch ($mode) + { + case 'forums': + $this->tpl_name = 'acp_prune_forums'; + $this->page_title = 'ACP_PRUNE_FORUMS'; + $this->prune_forums($id, $mode); + break; + + case 'users': + $this->tpl_name = 'acp_prune_users'; + $this->page_title = 'ACP_PRUNE_USERS'; + $this->prune_users($id, $mode); + break; + } + } + + /** + * Prune forums + */ + function prune_forums($id, $mode) + { + global $db, $user, $auth, $template, $cache; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $all_forums = request_var('all_forums', 0); + $forum_id = request_var('f', array(0)); + $submit = (isset($_POST['submit'])) ? true : false; + + if ($all_forums) + { + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + ORDER BY left_id'; + $result = $db->sql_query($sql); + + $forum_id = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_id[] = $row['forum_id']; + } + $db->sql_freeresult($result); + } + + if ($submit) + { + if (confirm_box(true)) + { + $prune_posted = request_var('prune_days', 0); + $prune_viewed = request_var('prune_vieweddays', 0); + $prune_all = (!$prune_posted && !$prune_viewed) ? true : false; + + $prune_flags = 0; + $prune_flags += (request_var('prune_old_polls', 0)) ? 2 : 0; + $prune_flags += (request_var('prune_announce', 0)) ? 4 : 0; + $prune_flags += (request_var('prune_sticky', 0)) ? 8 : 0; + + // Convert days to seconds for timestamp functions... + $prunedate_posted = time() - ($prune_posted * 86400); + $prunedate_viewed = time() - ($prune_viewed * 86400); + + $template->assign_vars(array( + 'S_PRUNED' => true) + ); + + $sql_forum = (sizeof($forum_id)) ? ' AND ' . $db->sql_in_set('forum_id', $forum_id) : ''; + + // Get a list of forum's or the data for the forum that we are pruning. + $sql = 'SELECT forum_id, forum_name + FROM ' . FORUMS_TABLE . ' + WHERE forum_type = ' . FORUM_POST . " + $sql_forum + ORDER BY left_id ASC"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $prune_ids = array(); + $p_result['topics'] = 0; + $p_result['posts'] = 0; + $log_data = ''; + + do + { + if (!$auth->acl_get('f_list', $row['forum_id'])) + { + continue; + } + + if ($prune_all) + { + $p_result = prune($row['forum_id'], 'posted', time(), $prune_flags, false); + } + else + { + if ($prune_posted) + { + $return = prune($row['forum_id'], 'posted', $prunedate_posted, $prune_flags, false); + $p_result['topics'] += $return['topics']; + $p_result['posts'] += $return['posts']; + } + + if ($prune_viewed) + { + $return = prune($row['forum_id'], 'viewed', $prunedate_viewed, $prune_flags, false); + $p_result['topics'] += $return['topics']; + $p_result['posts'] += $return['posts']; + } + } + + $prune_ids[] = $row['forum_id']; + + $template->assign_block_vars('pruned', array( + 'FORUM_NAME' => $row['forum_name'], + 'NUM_TOPICS' => $p_result['topics'], + 'NUM_POSTS' => $p_result['posts']) + ); + + $log_data .= (($log_data != '') ? ', ' : '') . $row['forum_name']; + } + while ($row = $db->sql_fetchrow($result)); + + // Sync all pruned forums at once + sync('forum', 'forum_id', $prune_ids, true, true); + add_log('admin', 'LOG_PRUNE', $log_data); + } + $db->sql_freeresult($result); + + return; + } + else + { + confirm_box(false, $user->lang['PRUNE_FORUM_CONFIRM'], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'submit' => 1, + '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), + ))); + } + } + + // If they haven't selected a forum for pruning yet then + // display a select box to use for pruning. + if (!sizeof($forum_id)) + { + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'S_SELECT_FORUM' => true, + 'S_FORUM_OPTIONS' => make_forum_select(false, false, false)) + ); + } + else + { + $sql = 'SELECT forum_id, forum_name + FROM ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_id); + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + + if (!$row) + { + $db->sql_freeresult($result); + trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $forum_list = $s_hidden_fields = ''; + do + { + $forum_list .= (($forum_list != '') ? ', ' : '') . '' . $row['forum_name'] . ''; + $s_hidden_fields .= ''; + } + while ($row = $db->sql_fetchrow($result)); + + $db->sql_freeresult($result); + + $l_selected_forums = (sizeof($forum_id) == 1) ? 'SELECTED_FORUM' : 'SELECTED_FORUMS'; + + $template->assign_vars(array( + 'L_SELECTED_FORUMS' => $user->lang[$l_selected_forums], + 'U_ACTION' => $this->u_action, + 'U_BACK' => $this->u_action, + 'FORUM_LIST' => $forum_list, + 'S_HIDDEN_FIELDS' => $s_hidden_fields) + ); + } + } + + /** + * Prune users + */ + function prune_users($id, $mode) + { + global $db, $user, $auth, $template, $cache; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $user->add_lang('memberlist'); + + $prune = (isset($_POST['prune'])) ? true : false; + + if ($prune) + { + $action = request_var('action', 'deactivate'); + $deleteposts = request_var('deleteposts', 0); + + if (confirm_box(true)) + { + $user_ids = $usernames = array(); + + $this->get_prune_users($user_ids, $usernames); + if (sizeof($user_ids)) + { + if ($action == 'deactivate') + { + user_active_flip('deactivate', $user_ids); + $l_log = 'LOG_PRUNE_USER_DEAC'; + } + else if ($action == 'delete') + { + if ($deleteposts) + { + user_delete('remove', $user_ids); + + $l_log = 'LOG_PRUNE_USER_DEL_DEL'; + } + else + { + user_delete('retain', $user_ids, true); + + $l_log = 'LOG_PRUNE_USER_DEL_ANON'; + } + } + + add_log('admin', $l_log, implode(', ', $usernames)); + $msg = $user->lang['USER_' . strtoupper($action) . '_SUCCESS']; + } + else + { + $msg = $user->lang['USER_PRUNE_FAILURE']; + } + + trigger_error($msg . adm_back_link($this->u_action)); + } + else + { + // We list the users which will be pruned... + $user_ids = $usernames = array(); + $this->get_prune_users($user_ids, $usernames); + + if (!sizeof($user_ids)) + { + trigger_error($user->lang['USER_PRUNE_FAILURE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Assign to template + foreach ($user_ids as $user_id) + { + $template->assign_block_vars('users', array( + 'USERNAME' => $usernames[$user_id], + 'USER_ID' => $user_id, + 'U_PROFILE' => get_username_string('profile', $user_id, $usernames[$user_id]), + 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview&u=' . $user_id, true, $user->session_id) : '', + )); + } + + $template->assign_vars(array( + 'S_DEACTIVATE' => ($action == 'deactivate') ? true : false, + 'S_DELETE' => ($action == 'delete') ? true : false, + )); + + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'prune' => 1, + + 'deleteposts' => request_var('deleteposts', 0), + 'action' => request_var('action', ''), + )), 'confirm_body_prune.html'); + } + } + + $find_count = array('lt' => $user->lang['LESS_THAN'], 'eq' => $user->lang['EQUAL_TO'], 'gt' => $user->lang['MORE_THAN']); + $s_find_count = ''; + + foreach ($find_count as $key => $value) + { + $selected = ($key == 'eq') ? ' selected="selected"' : ''; + $s_find_count .= ''; + } + + $find_time = array('lt' => $user->lang['BEFORE'], 'gt' => $user->lang['AFTER']); + $s_find_active_time = ''; + foreach ($find_time as $key => $value) + { + $s_find_active_time .= ''; + } + + $sql = 'SELECT group_id, group_name + FROM ' . GROUPS_TABLE . ' + WHERE group_type <> ' . GROUP_SPECIAL . ' + ORDER BY group_name ASC'; + $result = $db->sql_query($sql); + + $s_group_list = ''; + while ($row = $db->sql_fetchrow($result)) + { + $s_group_list .= ''; + } + $db->sql_freeresult($result); + + if ($s_group_list) + { + // Only prepend the "All groups" option if there are groups, + // otherwise we don't want to display this option at all. + $s_group_list = '' . $s_group_list; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'S_ACTIVE_OPTIONS' => $s_find_active_time, + 'S_GROUP_LIST' => $s_group_list, + 'S_COUNT_OPTIONS' => $s_find_count, + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_prune&field=users'), + )); + } + + /** + * Get user_ids/usernames from those being pruned + */ + function get_prune_users(&$user_ids, &$usernames) + { + 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); + $posts_on_queue = (trim($request->variable('posts_on_queue', '')) === '') ? false : $request->variable('posts_on_queue', 0); + + if ($users_by_name) + { + $users = explode("\n", $users_by_name); + $where_sql = ' AND ' . $db->sql_in_set('username_clean', array_map('utf8_clean_string', $users)); + } + else if (!empty($users_by_id)) + { + $user_ids = $users_by_id; + user_get_id_name($user_ids, $usernames); + + $where_sql = ' AND ' . $db->sql_in_set('user_id', $user_ids); + } + 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', ''); + + $count = ($request->variable('count', '') === '') ? false : $request->variable('count', 0); + + $active = ($active) ? explode('-', $active) : array(); + $joined_before = ($joined_before) ? explode('-', $joined_before) : array(); + $joined_after = ($joined_after) ? explode('-', $joined_after) : array(); + + // calculate the conditions required by the join time criteria + $joined_sql = ''; + if (!empty($joined_before) && !empty($joined_after)) + { + // if the two entered dates are equal, we need to adjust + // so that our time range is a full day instead of 1 second + if ($joined_after == $joined_before) + { + $joined_after[2] += 1; + } + + $joined_sql = ' AND user_regdate BETWEEN ' . gmmktime(0, 0, 0, (int) $joined_after[1], (int) $joined_after[2], (int) $joined_after[0]) . + ' AND ' . gmmktime(0, 0, 0, (int) $joined_before[1], (int) $joined_before[2], (int) $joined_before[0]); + } + else if (empty($joined_before) && !empty($joined_after)) + { + $joined_sql = ' AND user_regdate > ' . gmmktime(0, 0, 0, (int) $joined_after[1], (int) $joined_after[2], (int) $joined_after[0]); + } + else if (empty($joined_after) && !empty($joined_before)) + { + $joined_sql = ' AND user_regdate < ' . gmmktime(0, 0, 0, (int) $joined_before[1], (int) $joined_before[2], (int) $joined_before[0]); + } + // implicit else when both arrays are empty do nothing + + if ((sizeof($active) && sizeof($active) != 3) || (sizeof($joined_before) && sizeof($joined_before) != 3) || (sizeof($joined_after) && sizeof($joined_after) != 3)) + { + trigger_error($user->lang['WRONG_ACTIVE_JOINED_DATE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $key_match = array('lt' => '<', 'gt' => '>', 'eq' => '='); + $sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit'); + + $where_sql = ''; + $where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($username))) : ''; + $where_sql .= ($email) ? ' AND user_email ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), $email)) . ' ' : ''; + $where_sql .= $joined_sql; + $where_sql .= ($count !== false) ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : ''; + + // First handle pruning of users who never logged in, last active date is 0000-00-00 + if (sizeof($active) && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0) + { + $where_sql .= ' AND user_lastvisit = 0'; + } + else if (sizeof($active) && $active_select != 'lt') + { + $where_sql .= ' AND user_lastvisit ' . $key_match[$active_select] . ' ' . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]); + } + else if (sizeof($active)) + { + $where_sql .= ' AND (user_lastvisit > 0 AND user_lastvisit < ' . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]) . ')'; + } + } + + // If no search criteria were provided, go no further. + if (!$where_sql && !$group_id && $posts_on_queue === false) + { + return; + } + + // Get bot ids + $sql = 'SELECT user_id + FROM ' . BOTS_TABLE; + $result = $db->sql_query($sql); + + $bot_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $bot_ids[] = $row['user_id']; + } + $db->sql_freeresult($result); + + // Protect the admin, do not prune if no options are given... + if ($where_sql) + { + // Do not prune founder members + $sql = 'SELECT user_id, username + FROM ' . USERS_TABLE . ' + WHERE user_id <> ' . ANONYMOUS . ' + AND user_type <> ' . USER_FOUNDER . " + $where_sql"; + $result = $db->sql_query($sql); + + $user_ids = $usernames = array(); + + while ($row = $db->sql_fetchrow($result)) + { + // Do not prune bots and the user currently pruning. + if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids)) + { + $user_ids[] = $row['user_id']; + $usernames[$row['user_id']] = $row['username']; + } + } + $db->sql_freeresult($result); + } + + if ($group_id) + { + $sql = 'SELECT u.user_id, u.username + FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u + WHERE ug.group_id = ' . (int) $group_id . ' + AND ug.user_id <> ' . ANONYMOUS . ' + AND u.user_type <> ' . USER_FOUNDER . ' + AND ug.user_pending = 0 ' . + ((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '') . ' + AND u.user_id = ug.user_id'; + $result = $db->sql_query($sql); + + // we're performing an intersection operation, so all the relevant users + // come from this most recent query (which was limited to the results of the + // previous query) + $user_ids = $usernames = array(); + while ($row = $db->sql_fetchrow($result)) + { + // Do not prune bots and the user currently pruning. + if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids)) + { + $user_ids[] = $row['user_id']; + $usernames[$row['user_id']] = $row['username']; + } + } + $db->sql_freeresult($result); + } + + if ($posts_on_queue !== false) + { + $sql = 'SELECT u.user_id, u.username, COUNT(p.post_id) AS queue_posts + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u + WHERE u.user_id <> ' . ANONYMOUS . ' + AND u.user_type <> ' . USER_FOUNDER . + ((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . ' + AND ' . $db->sql_in_set('p.post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) . ' + AND u.user_id = p.poster_id + GROUP BY p.poster_id + HAVING queue_posts ' . $key_match[$queue_select] . ' ' . $posts_on_queue; + $result = $db->sql_query($sql); + + // same intersection logic as the above group ID portion + $user_ids = $usernames = array(); + while ($row = $db->sql_fetchrow($result)) + { + // Do not prune bots and the user currently pruning. + if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids)) + { + $user_ids[] = $row['user_id']; + $usernames[$row['user_id']] = $row['username']; + } + } + $db->sql_freeresult($result); + } + } +} diff --git a/sources/phpBB/includes/acp/acp_ranks.php b/sources/phpBB/includes/acp/acp_ranks.php new file mode 100644 index 0000000..5885de5 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_ranks.php @@ -0,0 +1,285 @@ + +* @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; +} + +class acp_ranks +{ + var $u_action; + + function main($id, $mode) + { + global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $user->add_lang('acp/posting'); + + // Set up general vars + $action = request_var('action', ''); + $action = (isset($_POST['add'])) ? 'add' : $action; + $action = (isset($_POST['save'])) ? 'save' : $action; + $rank_id = request_var('id', 0); + + $this->tpl_name = 'acp_ranks'; + $this->page_title = 'ACP_MANAGE_RANKS'; + + $form_name = 'acp_ranks'; + add_form_key($form_name); + + switch ($action) + { + case 'save': + + if (!check_form_key($form_name)) + { + 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', ''); + + // The rank image has to be a jpg, gif or png + if ($rank_image != '' && !preg_match('#(\.gif|\.png|\.jpg|\.jpeg)$#i', $rank_image)) + { + $rank_image = ''; + } + + if (!$rank_title) + { + trigger_error($user->lang['NO_RANK_TITLE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql_ary = array( + 'rank_title' => $rank_title, + 'rank_special' => $special_rank, + 'rank_min' => $min_posts, + 'rank_image' => htmlspecialchars_decode($rank_image) + ); + + /** + * Modify the SQL array when saving a rank + * + * @event core.acp_ranks_save_modify_sql_ary + * @var int rank_id The ID of the rank (if available) + * @var array sql_ary Array with the rank's data + * @since 3.1.0-RC3 + */ + $vars = array('rank_id', 'sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.acp_ranks_save_modify_sql_ary', compact($vars))); + + if ($rank_id) + { + $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); + } + 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); + } + $db->sql_query($sql); + + $cache->destroy('_ranks'); + + trigger_error($message . adm_back_link($this->u_action)); + + break; + + case 'delete': + + if (!$rank_id) + { + trigger_error($user->lang['MUST_SELECT_RANK'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (confirm_box(true)) + { + $sql = 'SELECT rank_title + FROM ' . RANKS_TABLE . ' + WHERE rank_id = ' . $rank_id; + $result = $db->sql_query($sql); + $rank_title = (string) $db->sql_fetchfield('rank_title'); + $db->sql_freeresult($result); + + $sql = 'DELETE FROM ' . RANKS_TABLE . " + WHERE rank_id = $rank_id"; + $db->sql_query($sql); + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_rank = 0 + WHERE user_rank = $rank_id"; + $db->sql_query($sql); + + $cache->destroy('_ranks'); + + add_log('admin', 'LOG_RANK_REMOVED', $rank_title); + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $user->lang['RANK_REMOVED'], + 'REFRESH_DATA' => array( + 'time' => 3 + ) + )); + } + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'rank_id' => $rank_id, + 'action' => 'delete', + ))); + } + + break; + + case 'edit': + case 'add': + + $data = $ranks = $existing_imgs = array(); + + $sql = 'SELECT * + FROM ' . RANKS_TABLE . ' + ORDER BY rank_min ASC, rank_special ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $existing_imgs[] = $row['rank_image']; + + if ($action == 'edit' && $rank_id == $row['rank_id']) + { + $ranks = $row; + } + } + $db->sql_freeresult($result); + + $imglist = filelist($phpbb_root_path . $config['ranks_path'], ''); + $edit_img = $filename_list = ''; + + foreach ($imglist as $path => $img_ary) + { + sort($img_ary); + + foreach ($img_ary as $img) + { + $img = $path . $img; + + if ($ranks && $img == $ranks['rank_image']) + { + $selected = ' selected="selected"'; + $edit_img = $img; + } + else + { + $selected = ''; + } + + if (strlen($img) > 255) + { + continue; + } + + $filename_list .= ''; + } + } + + $filename_list = '' . $filename_list; + unset($existing_imgs, $imglist); + + $tpl_ary = array( + 'S_EDIT' => true, + 'U_BACK' => $this->u_action, + 'RANKS_PATH' => $phpbb_root_path . $config['ranks_path'], + 'U_ACTION' => $this->u_action . '&id=' . $rank_id, + + 'RANK_TITLE' => (isset($ranks['rank_title'])) ? $ranks['rank_title'] : '', + 'S_FILENAME_LIST' => $filename_list, + 'RANK_IMAGE' => ($edit_img) ? $phpbb_root_path . $config['ranks_path'] . '/' . $edit_img : htmlspecialchars($phpbb_admin_path) . 'images/spacer.gif', + 'S_SPECIAL_RANK' => (isset($ranks['rank_special']) && $ranks['rank_special']) ? true : false, + 'MIN_POSTS' => (isset($ranks['rank_min']) && !$ranks['rank_special']) ? $ranks['rank_min'] : 0, + ); + + /** + * Modify the template output array for editing/adding ranks + * + * @event core.acp_ranks_edit_modify_tpl_ary + * @var array ranks Array with the rank's data + * @var array tpl_ary Array with the rank's template data + * @since 3.1.0-RC3 + */ + $vars = array('ranks', 'tpl_ary'); + extract($phpbb_dispatcher->trigger_event('core.acp_ranks_edit_modify_tpl_ary', compact($vars))); + + $template->assign_vars($tpl_ary); + return; + + break; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action) + ); + + $sql = 'SELECT * + FROM ' . RANKS_TABLE . ' + ORDER BY rank_special DESC, rank_min ASC, rank_title ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $rank_row = array( + 'S_RANK_IMAGE' => ($row['rank_image']) ? true : false, + 'S_SPECIAL_RANK' => ($row['rank_special']) ? true : false, + + 'RANK_IMAGE' => $phpbb_root_path . $config['ranks_path'] . '/' . $row['rank_image'], + 'RANK_TITLE' => $row['rank_title'], + 'MIN_POSTS' => $row['rank_min'], + + 'U_EDIT' => $this->u_action . '&action=edit&id=' . $row['rank_id'], + 'U_DELETE' => $this->u_action . '&action=delete&id=' . $row['rank_id'], + ); + + /** + * Modify the template output array for each listed rank + * + * @event core.acp_ranks_list_modify_rank_row + * @var array row Array with the rank's data + * @var array rank_row Array with the rank's template data + * @since 3.1.0-RC3 + */ + $vars = array('row', 'rank_row'); + extract($phpbb_dispatcher->trigger_event('core.acp_ranks_list_modify_rank_row', compact($vars))); + + $template->assign_block_vars('ranks', $rank_row); + } + $db->sql_freeresult($result); + + } +} diff --git a/sources/phpBB/includes/acp/acp_reasons.php b/sources/phpBB/includes/acp/acp_reasons.php new file mode 100644 index 0000000..3d7ccf4 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_reasons.php @@ -0,0 +1,392 @@ + +* @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; +} + +class acp_reasons +{ + var $u_action; + + function main($id, $mode) + { + global $db, $user, $auth, $template, $cache; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $request; + + $user->add_lang(array('mcp', 'acp/posting')); + + // Set up general vars + $action = request_var('action', ''); + $submit = (isset($_POST['submit'])) ? true : false; + $reason_id = request_var('id', 0); + + $this->tpl_name = 'acp_reasons'; + $this->page_title = 'ACP_REASONS'; + + $form_name = 'acp_reason'; + add_form_key('acp_reason'); + + $error = array(); + + switch ($action) + { + case 'add': + 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)), + ); + + if ($submit) + { + if (!check_form_key($form_name)) + { + $error[] = $user->lang['FORM_INVALID']; + } + // Reason specified? + if (!$reason_row['reason_title'] || !$reason_row['reason_description']) + { + $error[] = $user->lang['NO_REASON_INFO']; + } + + $check_double = ($action == 'add') ? true : false; + + if ($action == 'edit') + { + $sql = 'SELECT reason_title + FROM ' . REPORTS_REASONS_TABLE . " + WHERE reason_id = $reason_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (strtolower($row['reason_title']) == 'other' || strtolower($reason_row['reason_title']) == 'other') + { + $reason_row['reason_title'] = 'other'; + } + + if ($row['reason_title'] != $reason_row['reason_title']) + { + $check_double = true; + } + } + + // Check for same reason if adding it... + if ($check_double) + { + $sql = 'SELECT reason_id + FROM ' . REPORTS_REASONS_TABLE . " + WHERE reason_title = '" . $db->sql_escape($reason_row['reason_title']) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row || ($action == 'add' && strtolower($reason_row['reason_title']) == 'other')) + { + $error[] = $user->lang['REASON_ALREADY_EXIST']; + } + } + + if (!sizeof($error)) + { + // New reason? + if ($action == 'add') + { + // Get new order... + $sql = 'SELECT MAX(reason_order) as max_reason_order + FROM ' . REPORTS_REASONS_TABLE; + $result = $db->sql_query($sql); + $max_order = (int) $db->sql_fetchfield('max_reason_order'); + $db->sql_freeresult($result); + + $sql_ary = array( + 'reason_title' => (string) $reason_row['reason_title'], + 'reason_description' => (string) $reason_row['reason_description'], + 'reason_order' => $max_order + 1 + ); + + $db->sql_query('INSERT INTO ' . REPORTS_REASONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + + $log = 'ADDED'; + } + else if ($reason_id) + { + $sql_ary = array( + 'reason_title' => (string) $reason_row['reason_title'], + 'reason_description' => (string) $reason_row['reason_description'], + ); + + $db->sql_query('UPDATE ' . REPORTS_REASONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE reason_id = ' . $reason_id); + + $log = 'UPDATED'; + } + + add_log('admin', 'LOG_REASON_' . $log, $reason_row['reason_title']); + trigger_error($user->lang['REASON_' . $log] . adm_back_link($this->u_action)); + } + } + else if ($reason_id) + { + $sql = 'SELECT * + FROM ' . REPORTS_REASONS_TABLE . ' + WHERE reason_id = ' . $reason_id; + $result = $db->sql_query($sql); + $reason_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$reason_row) + { + trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + + $l_title = ($action == 'edit') ? 'EDIT' : 'ADD'; + + $translated = false; + + // 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($reason_row['reason_title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason_row['reason_title'])])) + { + $translated = true; + } + + $template->assign_vars(array( + 'L_TITLE' => $user->lang['REASON_' . $l_title], + 'U_ACTION' => $this->u_action . "&id=$reason_id&action=$action", + 'U_BACK' => $this->u_action, + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', + + 'REASON_TITLE' => $reason_row['reason_title'], + 'REASON_DESCRIPTION' => $reason_row['reason_description'], + + 'TRANSLATED_TITLE' => ($translated) ? $user->lang['report_reasons']['TITLE'][strtoupper($reason_row['reason_title'])] : '', + 'TRANSLATED_DESCRIPTION'=> ($translated) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason_row['reason_title'])] : '', + + 'S_AVAILABLE_TITLES' => implode($user->lang['COMMA_SEPARATOR'], array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))), + 'S_EDIT_REASON' => true, + 'S_TRANSLATED' => $translated, + 'S_ERROR' => (sizeof($error)) ? true : false, + ) + ); + + return; + break; + + case 'delete': + + $sql = 'SELECT * + FROM ' . REPORTS_REASONS_TABLE . ' + WHERE reason_id = ' . $reason_id; + $result = $db->sql_query($sql); + $reason_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$reason_row) + { + trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (strtolower($reason_row['reason_title']) == 'other') + { + trigger_error($user->lang['NO_REMOVE_DEFAULT_REASON'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Let the deletion be confirmed... + if (confirm_box(true)) + { + $sql = 'SELECT reason_id + FROM ' . REPORTS_REASONS_TABLE . " + WHERE LOWER(reason_title) = 'other'"; + $result = $db->sql_query($sql); + $other_reason_id = (int) $db->sql_fetchfield('reason_id'); + $db->sql_freeresult($result); + + switch ($db->get_sql_layer()) + { + // The ugly one! + case 'mysqli': + case 'mysql4': + case 'mysql': + // Change the reports using this reason to 'other' + $sql = 'UPDATE ' . REPORTS_TABLE . ' + SET reason_id = ' . $other_reason_id . ", report_text = CONCAT('" . $db->sql_escape($reason_row['reason_description']) . "\n\n', report_text) + WHERE reason_id = $reason_id"; + break; + + // Standard? What's that? + case 'mssql': + case 'mssql_odbc': + case 'mssqlnative': + // Change the reports using this reason to 'other' + $sql = "DECLARE @ptrval binary(16) + + SELECT @ptrval = TEXTPTR(report_text) + FROM " . REPORTS_TABLE . " + WHERE reason_id = " . $reason_id . " + + UPDATETEXT " . REPORTS_TABLE . ".report_text @ptrval 0 0 '" . $db->sql_escape($reason_row['reason_description']) . "\n\n' + + UPDATE " . REPORTS_TABLE . ' + SET reason_id = ' . $other_reason_id . " + WHERE reason_id = $reason_id"; + break; + + // Teh standard + case 'postgres': + case 'oracle': + case 'sqlite': + case 'sqlite3': + // Change the reports using this reason to 'other' + $sql = 'UPDATE ' . REPORTS_TABLE . ' + SET reason_id = ' . $other_reason_id . ", report_text = '" . $db->sql_escape($reason_row['reason_description']) . "\n\n' || report_text + WHERE reason_id = $reason_id"; + break; + } + $db->sql_query($sql); + + $db->sql_query('DELETE FROM ' . REPORTS_REASONS_TABLE . ' WHERE reason_id = ' . $reason_id); + + add_log('admin', 'LOG_REASON_REMOVED', $reason_row['reason_title']); + trigger_error($user->lang['REASON_REMOVED'] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'id' => $reason_id)) + ); + } + + break; + + case 'move_up': + case 'move_down': + + $sql = 'SELECT reason_order + FROM ' . REPORTS_REASONS_TABLE . " + WHERE reason_id = $reason_id"; + $result = $db->sql_query($sql); + $order = $db->sql_fetchfield('reason_order'); + $db->sql_freeresult($result); + + if ($order === false || ($order == 0 && $action == 'move_up')) + { + break; + } + $order = (int) $order; + $order_total = $order * 2 + (($action == 'move_up') ? -1 : 1); + + $sql = 'UPDATE ' . REPORTS_REASONS_TABLE . ' + SET reason_order = ' . $order_total . ' - reason_order + WHERE reason_order IN (' . $order . ', ' . (($action == 'move_up') ? $order - 1 : $order + 1) . ')'; + $db->sql_query($sql); + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'success' => (bool) $db->sql_affectedrows(), + )); + } + break; + } + + // By default, check that order is valid and fix it if necessary + $sql = 'SELECT reason_id, reason_order + FROM ' . REPORTS_REASONS_TABLE . ' + ORDER BY reason_order'; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $order = 0; + do + { + ++$order; + + if ($row['reason_order'] != $order) + { + $sql = 'UPDATE ' . REPORTS_REASONS_TABLE . " + SET reason_order = $order + WHERE reason_id = {$row['reason_id']}"; + $db->sql_query($sql); + } + } + while ($row = $db->sql_fetchrow($result)); + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + ) + ); + + // Reason count + $sql = 'SELECT reason_id, COUNT(reason_id) AS reason_count + FROM ' . REPORTS_TABLE . ' + GROUP BY reason_id'; + $result = $db->sql_query($sql); + + $reason_count = array(); + while ($row = $db->sql_fetchrow($result)) + { + $reason_count[$row['reason_id']] = $row['reason_count']; + } + $db->sql_freeresult($result); + + $sql = 'SELECT * + FROM ' . REPORTS_REASONS_TABLE . ' + ORDER BY reason_order ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $translated = false; + $other_reason = ($row['reason_title'] == 'other') ? true : false; + + // 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'])]; + + $translated = true; + } + + $template->assign_block_vars('reasons', array( + 'REASON_TITLE' => $row['reason_title'], + 'REASON_DESCRIPTION' => $row['reason_description'], + 'REASON_COUNT' => (isset($reason_count[$row['reason_id']])) ? $reason_count[$row['reason_id']] : 0, + + 'S_TRANSLATED' => $translated, + 'S_OTHER_REASON' => $other_reason, + + 'U_EDIT' => $this->u_action . '&action=edit&id=' . $row['reason_id'], + 'U_DELETE' => (!$other_reason) ? $this->u_action . '&action=delete&id=' . $row['reason_id'] : '', + 'U_MOVE_UP' => $this->u_action . '&action=move_up&id=' . $row['reason_id'], + 'U_MOVE_DOWN' => $this->u_action . '&action=move_down&id=' . $row['reason_id']) + ); + } + $db->sql_freeresult($result); + } +} diff --git a/sources/phpBB/includes/acp/acp_search.php b/sources/phpBB/includes/acp/acp_search.php new file mode 100644 index 0000000..eddc687 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_search.php @@ -0,0 +1,615 @@ + +* @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; +} + +class acp_search +{ + var $u_action; + var $state; + var $search; + var $max_post_id; + var $batch_size = 100; + + function main($id, $mode) + { + global $user; + + $user->add_lang('acp/search'); + + // For some this may be of help... + @ini_set('memory_limit', '128M'); + + switch ($mode) + { + case 'settings': + $this->settings($id, $mode); + break; + + case 'index': + $this->index($id, $mode); + break; + } + } + + function settings($id, $mode) + { + global $db, $user, $auth, $template, $cache; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $submit = (isset($_POST['submit'])) ? true : false; + + $search_types = $this->get_search_types(); + + $settings = array( + 'search_interval' => 'float', + 'search_anonymous_interval' => 'float', + 'load_search' => 'bool', + 'limit_search_load' => 'float', + 'min_search_author_chars' => 'integer', + 'max_num_search_keywords' => 'integer', + 'search_store_results' => 'integer', + ); + + $search = null; + $error = false; + $search_options = ''; + foreach ($search_types as $type) + { + if ($this->init_search($type, $search, $error)) + { + continue; + } + + $name = $search->get_name(); + + $selected = ($config['search_type'] == $type) ? ' selected="selected"' : ''; + $identifier = substr($type, strrpos($type, '\\') + 1); + $search_options .= ""; + + if (method_exists($search, 'acp')) + { + $vars = $search->acp(); + + if (!$submit) + { + $template->assign_block_vars('backend', array( + 'NAME' => $name, + 'SETTINGS' => $vars['tpl'], + 'IDENTIFIER' => $identifier, + )); + } + else if (is_array($vars['config'])) + { + $settings = array_merge($settings, $vars['config']); + } + } + } + unset($search); + unset($error); + + $cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => ''), true) : array(); + $updated = request_var('updated', false); + + foreach ($settings as $config_name => $var_type) + { + if (!isset($cfg_array[$config_name])) + { + continue; + } + + // e.g. integer:4:12 (min 4, max 12) + $var_type = explode(':', $var_type); + + $config_value = $cfg_array[$config_name]; + settype($config_value, $var_type[0]); + + if (isset($var_type[1])) + { + $config_value = max($var_type[1], $config_value); + } + + if (isset($var_type[2])) + { + $config_value = min($var_type[2], $config_value); + } + + // only change config if anything was actually changed + if ($submit && ($config[$config_name] != $config_value)) + { + set_config($config_name, $config_value); + $updated = true; + } + } + + if ($submit) + { + $extra_message = ''; + if ($updated) + { + add_log('admin', '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'])) + { + $search = null; + $error = false; + + if (!$this->init_search($cfg_array['search_type'], $search, $error)) + { + if (confirm_box(true)) + { + if (!method_exists($search, 'init') || !($error = $search->init())) + { + set_config('search_type', $cfg_array['search_type']); + + if (!$updated) + { + add_log('admin', 'LOG_CONFIG_SEARCH'); + } + $extra_message = '
' . $user->lang['SWITCHED_SEARCH_BACKEND'] . '
» ' . $user->lang['GO_TO_SEARCH_INDEX'] . ''; + } + else + { + trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING); + } + } + else + { + confirm_box(false, $user->lang['CONFIRM_SEARCH_BACKEND'], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'submit' => true, + 'updated' => $updated, + 'config' => array('search_type' => $cfg_array['search_type']), + ))); + } + } + else + { + trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING); + } + } + + $search = null; + $error = false; + if (!$this->init_search($config['search_type'], $search, $error)) + { + if ($updated) + { + if (method_exists($search, 'config_updated')) + { + if ($search->config_updated()) + { + trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING); + } + } + } + } + else + { + trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING); + } + + trigger_error($user->lang['CONFIG_UPDATED'] . $extra_message . adm_back_link($this->u_action)); + } + unset($cfg_array); + + $this->tpl_name = 'acp_search'; + $this->page_title = 'ACP_SEARCH_SETTINGS'; + + $template->assign_vars(array( + 'LIMIT_SEARCH_LOAD' => (float) $config['limit_search_load'], + 'MIN_SEARCH_AUTHOR_CHARS' => (int) $config['min_search_author_chars'], + 'SEARCH_INTERVAL' => (float) $config['search_interval'], + 'SEARCH_GUEST_INTERVAL' => (float) $config['search_anonymous_interval'], + 'SEARCH_STORE_RESULTS' => (int) $config['search_store_results'], + 'MAX_NUM_SEARCH_KEYWORDS' => (int) $config['max_num_search_keywords'], + + 'S_SEARCH_TYPES' => $search_options, + 'S_YES_SEARCH' => (bool) $config['load_search'], + 'S_SETTINGS' => true, + + 'U_ACTION' => $this->u_action) + ); + } + + function index($id, $mode) + { + global $db, $user, $auth, $template, $cache; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $action = request_var('action', ''); + $this->state = explode(',', $config['search_indexing_state']); + + if (isset($_POST['cancel'])) + { + $action = ''; + $this->state = array(); + $this->save_state(); + } + + if ($action) + { + switch ($action) + { + case 'progress_bar': + $type = request_var('type', ''); + $this->display_progress_bar($type); + break; + + case 'delete': + $this->state[1] = 'delete'; + break; + + case 'create': + $this->state[1] = 'create'; + break; + + default: + trigger_error('NO_ACTION', E_USER_ERROR); + break; + } + + if (empty($this->state[0])) + { + $this->state[0] = request_var('search_type', ''); + } + + $this->search = null; + $error = false; + if ($this->init_search($this->state[0], $this->search, $error)) + { + trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING); + } + $name = $this->search->get_name(); + + $action = &$this->state[1]; + + $this->max_post_id = $this->get_max_post_id(); + + $post_counter = (isset($this->state[2])) ? $this->state[2] : 0; + $this->state[2] = &$post_counter; + $this->save_state(); + + switch ($action) + { + case 'delete': + if (method_exists($this->search, 'delete_index')) + { + // pass a reference to myself so the $search object can make use of save_state() and attributes + if ($error = $this->search->delete_index($this, append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=delete", false))) + { + $this->state = array(''); + $this->save_state(); + trigger_error($error . adm_back_link($this->u_action) . $this->close_popup_js(), E_USER_WARNING); + } + } + else + { + $starttime = explode(' ', microtime()); + $starttime = $starttime[1] + $starttime[0]; + $row_count = 0; + while (still_on_time() && $post_counter <= $this->max_post_id) + { + $sql = 'SELECT post_id, poster_id, forum_id + FROM ' . POSTS_TABLE . ' + WHERE post_id >= ' . (int) ($post_counter + 1) . ' + AND post_id <= ' . (int) ($post_counter + $this->batch_size); + $result = $db->sql_query($sql); + + $ids = $posters = $forum_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $ids[] = $row['post_id']; + $posters[] = $row['poster_id']; + $forum_ids[] = $row['forum_id']; + } + $db->sql_freeresult($result); + $row_count += sizeof($ids); + + if (sizeof($ids)) + { + $this->search->index_remove($ids, $posters, $forum_ids); + } + + $post_counter += $this->batch_size; + } + // save the current state + $this->save_state(); + + if ($post_counter <= $this->max_post_id) + { + $mtime = explode(' ', microtime()); + $totaltime = $mtime[0] + $mtime[1] - $starttime; + $rows_per_second = $row_count / $totaltime; + meta_refresh(1, append_sid($this->u_action . '&action=delete&skip_rows=' . $post_counter)); + trigger_error($user->lang('SEARCH_INDEX_DELETE_REDIRECT', (int) $row_count, $post_counter, $rows_per_second)); + } + } + + $this->search->tidy(); + + $this->state = array(''); + $this->save_state(); + + add_log('admin', 'LOG_SEARCH_INDEX_REMOVED', $name); + trigger_error($user->lang['SEARCH_INDEX_REMOVED'] . adm_back_link($this->u_action) . $this->close_popup_js()); + break; + + case 'create': + if (method_exists($this->search, 'create_index')) + { + // pass a reference to acp_search so the $search object can make use of save_state() and attributes + if ($error = $this->search->create_index($this, append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=create", false))) + { + $this->state = array(''); + $this->save_state(); + trigger_error($error . adm_back_link($this->u_action) . $this->close_popup_js(), E_USER_WARNING); + } + } + else + { + $sql = 'SELECT forum_id, enable_indexing + FROM ' . FORUMS_TABLE; + $result = $db->sql_query($sql, 3600); + + while ($row = $db->sql_fetchrow($result)) + { + $forums[$row['forum_id']] = (bool) $row['enable_indexing']; + } + $db->sql_freeresult($result); + + $starttime = explode(' ', microtime()); + $starttime = $starttime[1] + $starttime[0]; + $row_count = 0; + while (still_on_time() && $post_counter <= $this->max_post_id) + { + $sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id + FROM ' . POSTS_TABLE . ' + WHERE post_id >= ' . (int) ($post_counter + 1) . ' + AND post_id <= ' . (int) ($post_counter + $this->batch_size); + $result = $db->sql_query($sql); + + $buffer = $db->sql_buffer_nested_transactions(); + + if ($buffer) + { + $rows = $db->sql_fetchrowset($result); + $rows[] = false; // indicate end of array for while loop below + + $db->sql_freeresult($result); + } + + $i = 0; + while ($row = ($buffer ? $rows[$i++] : $db->sql_fetchrow($result))) + { + // Indexing enabled for this forum + if (isset($forums[$row['forum_id']]) && $forums[$row['forum_id']]) + { + $this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id'], $row['forum_id']); + } + $row_count++; + } + if (!$buffer) + { + $db->sql_freeresult($result); + } + + $post_counter += $this->batch_size; + } + // save the current state + $this->save_state(); + + // pretend the number of posts was as big as the number of ids we indexed so far + // just an estimation as it includes deleted posts + $num_posts = $config['num_posts']; + $config['num_posts'] = min($config['num_posts'], $post_counter); + $this->search->tidy(); + $config['num_posts'] = $num_posts; + + if ($post_counter <= $this->max_post_id) + { + $mtime = explode(' ', microtime()); + $totaltime = $mtime[0] + $mtime[1] - $starttime; + $rows_per_second = $row_count / $totaltime; + meta_refresh(1, append_sid($this->u_action . '&action=create&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)); + } + } + + $this->search->tidy(); + + $this->state = array(''); + $this->save_state(); + + add_log('admin', 'LOG_SEARCH_INDEX_CREATED', $name); + trigger_error($user->lang['SEARCH_INDEX_CREATED'] . adm_back_link($this->u_action) . $this->close_popup_js()); + break; + } + } + + $search_types = $this->get_search_types(); + + $search = null; + $error = false; + $search_options = ''; + foreach ($search_types as $type) + { + if ($this->init_search($type, $search, $error) || !method_exists($search, 'index_created')) + { + continue; + } + + $name = $search->get_name(); + + $data = array(); + if (method_exists($search, 'index_stats')) + { + $data = $search->index_stats(); + } + + $statistics = array(); + foreach ($data as $statistic => $value) + { + $n = sizeof($statistics); + if ($n && sizeof($statistics[$n - 1]) < 3) + { + $statistics[$n - 1] += array('statistic_2' => $statistic, 'value_2' => $value); + } + else + { + $statistics[] = array('statistic_1' => $statistic, 'value_1' => $value); + } + } + + $template->assign_block_vars('backend', array( + 'L_NAME' => $name, + 'NAME' => $type, + + 'S_ACTIVE' => ($type == $config['search_type']) ? true : false, + 'S_HIDDEN_FIELDS' => build_hidden_fields(array('search_type' => $type)), + 'S_INDEXED' => (bool) $search->index_created(), + 'S_STATS' => (bool) sizeof($statistics)) + ); + + foreach ($statistics as $statistic) + { + $template->assign_block_vars('backend.data', array( + 'STATISTIC_1' => $statistic['statistic_1'], + 'VALUE_1' => $statistic['value_1'], + 'STATISTIC_2' => (isset($statistic['statistic_2'])) ? $statistic['statistic_2'] : '', + 'VALUE_2' => (isset($statistic['value_2'])) ? $statistic['value_2'] : '') + ); + } + } + unset($search); + unset($error); + unset($statistics); + unset($data); + + $this->tpl_name = 'acp_search'; + $this->page_title = 'ACP_SEARCH_INDEX'; + + $template->assign_vars(array( + 'S_INDEX' => true, + 'U_ACTION' => $this->u_action, + 'U_PROGRESS_BAR' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=progress_bar"), + 'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=progress_bar")), + )); + + if (isset($this->state[1])) + { + $template->assign_vars(array( + 'S_CONTINUE_INDEXING' => $this->state[1], + 'U_CONTINUE_INDEXING' => $this->u_action . '&action=' . $this->state[1], + 'L_CONTINUE' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING'] : $user->lang['CONTINUE_DELETING_INDEX'], + 'L_CONTINUE_EXPLAIN' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING_EXPLAIN'] : $user->lang['CONTINUE_DELETING_INDEX_EXPLAIN']) + ); + } + } + + function display_progress_bar($type) + { + global $template, $user; + + $l_type = ($type == 'create') ? 'INDEXING_IN_PROGRESS' : 'DELETING_INDEX_IN_PROGRESS'; + + adm_page_header($user->lang[$l_type]); + + $template->set_filenames(array( + 'body' => 'progress_bar.html') + ); + + $template->assign_vars(array( + 'L_PROGRESS' => $user->lang[$l_type], + 'L_PROGRESS_EXPLAIN' => $user->lang[$l_type . '_EXPLAIN']) + ); + + adm_page_footer(); + } + + function close_popup_js() + { + return "\n"; + } + + function get_search_types() + { + global $phpbb_root_path, $phpEx, $phpbb_extension_manager; + + $finder = $phpbb_extension_manager->get_finder(); + + return $finder + ->extension_suffix('_backend') + ->extension_directory('/search') + ->core_path('phpbb/search/') + ->get_classes(); + } + + function get_max_post_id() + { + global $db; + + $sql = 'SELECT MAX(post_id) as max_post_id + FROM '. POSTS_TABLE; + $result = $db->sql_query($sql); + $max_post_id = (int) $db->sql_fetchfield('max_post_id'); + $db->sql_freeresult($result); + + return $max_post_id; + } + + function save_state($state = false) + { + if ($state) + { + $this->state = $state; + } + + ksort($this->state); + + set_config('search_indexing_state', implode(',', $this->state), true); + } + + /** + * Initialises a search backend object + * + * @return false if no error occurred else an error message + */ + function init_search($type, &$search, &$error) + { + global $phpbb_root_path, $phpEx, $user, $auth, $config, $db; + + if (!class_exists($type) || !method_exists($type, 'keyword_search')) + { + $error = $user->lang['NO_SUCH_SEARCH_MODULE']; + return $error; + } + + $error = false; + $search = new $type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); + + return $error; + } +} diff --git a/sources/phpBB/includes/acp/acp_send_statistics.php b/sources/phpBB/includes/acp/acp_send_statistics.php new file mode 100644 index 0000000..d178be2 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_send_statistics.php @@ -0,0 +1,88 @@ + +* @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; +} + +class acp_send_statistics +{ + var $u_action; + + function main($id, $mode) + { + global $config, $template, $phpbb_admin_path, $phpbb_root_path, $phpEx; + + include($phpbb_root_path . 'includes/questionnaire/questionnaire.' . $phpEx); + + $collect_url = "https://www.phpbb.com/stats/receive_stats.php"; + + $this->tpl_name = 'acp_send_statistics'; + $this->page_title = 'ACP_SEND_STATISTICS'; + + // generate a unique id if necessary + if (!isset($config['questionnaire_unique_id'])) + { + $install_id = unique_id(); + set_config('questionnaire_unique_id', $install_id); + } + else + { + $install_id = $config['questionnaire_unique_id']; + } + + $collector = new phpbb_questionnaire_data_collector($install_id); + + // Add data provider + $collector->add_data_provider(new phpbb_questionnaire_php_data_provider()); + $collector->add_data_provider(new phpbb_questionnaire_system_data_provider()); + $collector->add_data_provider(new phpbb_questionnaire_phpbb_data_provider($config)); + + $template->assign_vars(array( + 'U_COLLECT_STATS' => $collect_url, + 'RAW_DATA' => $collector->get_data_for_form(), + 'U_ACP_MAIN' => append_sid("{$phpbb_admin_path}index.$phpEx"), + )); + + $raw = $collector->get_data_raw(); + + foreach ($raw as $provider => $data) + { + if ($provider == 'install_id') + { + $data = array($provider => $data); + } + + $template->assign_block_vars('providers', array( + 'NAME' => htmlspecialchars($provider), + )); + + foreach ($data as $key => $value) + { + if (is_array($value)) + { + $value = utf8_wordwrap(serialize($value), 75, "\n", true); + } + + $template->assign_block_vars('providers.values', array( + 'KEY' => utf8_htmlspecialchars($key), + 'VALUE' => utf8_htmlspecialchars($value), + )); + } + } + } +} diff --git a/sources/phpBB/includes/acp/acp_styles.php b/sources/phpBB/includes/acp/acp_styles.php new file mode 100644 index 0000000..6bd27a8 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_styles.php @@ -0,0 +1,1334 @@ + +* @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; +} + +class acp_styles +{ + public $u_action; + + protected $u_base_action; + protected $s_hidden_fields; + protected $mode; + protected $styles_path; + protected $styles_path_absolute = 'styles'; + protected $default_style = 0; + protected $styles_list_cols = 0; + protected $reserved_style_names = array('adm', 'admin', 'all'); + + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + /** @var \phpbb\user */ + protected $user; + + /** @var \phpbb\template\template */ + protected $template; + + /** @var \phpbb\request\request_interface */ + protected $request; + + /** @var \phpbb\cache\driver\driver_interface */ + protected $cache; + + /** @var \phpbb\auth\auth */ + protected $auth; + + /** @var string */ + protected $phpbb_root_path; + + /** @var string */ + protected $php_ext; + + public function main($id, $mode) + { + global $db, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx, $template, $request, $cache, $auth, $config; + + $this->db = $db; + $this->user = $user; + $this->template = $template; + $this->request = $request; + $this->cache = $cache; + $this->auth = $auth; + $this->config = $config; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $phpEx; + + $this->default_style = $config['default_style']; + $this->styles_path = $this->phpbb_root_path . $this->styles_path_absolute . '/'; + + $this->u_base_action = append_sid("{$phpbb_admin_path}index.{$this->php_ext}", "i={$id}"); + $this->s_hidden_fields = array( + 'mode' => $mode, + ); + + $this->user->add_lang('acp/styles'); + + $this->tpl_name = 'acp_styles'; + $this->page_title = 'ACP_CAT_STYLES'; + $this->mode = $mode; + + $action = $this->request->variable('action', ''); + $post_actions = array('install', 'activate', 'deactivate', 'uninstall'); + + foreach ($post_actions as $key) + { + if ($this->request->is_set_post($key)) + { + $action = $key; + } + } + + // The uninstall action uses confirm_box() to verify the validity of the request, + // so there is no need to check for a valid token here. + if (in_array($action, $post_actions) && $action != 'uninstall') + { + $is_valid_request = check_link_hash($request->variable('hash', ''), $action) || check_form_key('styles_management'); + + if (!$is_valid_request) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + + if ($action != '') + { + $this->s_hidden_fields['action'] = $action; + } + + $this->template->assign_vars(array( + 'U_ACTION' => $this->u_base_action, + 'S_HIDDEN_FIELDS' => build_hidden_fields($this->s_hidden_fields) + ) + ); + + // Execute actions + switch ($action) + { + case 'install': + $this->action_install(); + return; + case 'uninstall': + $this->action_uninstall(); + return; + case 'activate': + $this->action_activate(); + return; + case 'deactivate': + $this->action_deactivate(); + return; + case 'details': + $this->action_details(); + return; + default: + $this->frontend(); + } + } + + /** + * Main page + */ + protected function frontend() + { + add_form_key('styles_management'); + + // Check mode + switch ($this->mode) + { + case 'style': + $this->welcome_message('ACP_STYLES', 'ACP_STYLES_EXPLAIN'); + $this->show_installed(); + return; + case 'install': + $this->welcome_message('INSTALL_STYLES', 'INSTALL_STYLES_EXPLAIN'); + $this->show_available(); + return; + } + trigger_error($this->user->lang['NO_MODE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + /** + * Install style(s) + */ + protected function action_install() + { + // Get list of styles to install + $dirs = $this->request_vars('dir', '', true); + + // Get list of styles that can be installed + $styles = $this->find_available(false); + + // Install each style + $messages = array(); + $installed_names = array(); + $installed_dirs = array(); + $last_installed = false; + foreach ($dirs as $dir) + { + if (in_array($dir, $this->reserved_style_names)) + { + $messages[] = $this->user->lang('STYLE_NAME_RESERVED', htmlspecialchars($dir)); + continue; + } + + $found = false; + foreach ($styles as &$style) + { + // Check if: + // 1. Directory matches directory we are looking for + // 2. Style is not installed yet + // 3. Style with same name or directory hasn't been installed already within this function + if ($style['style_path'] == $dir && empty($style['_installed']) && !in_array($style['style_path'], $installed_dirs) && !in_array($style['style_name'], $installed_names)) + { + // Install style + $style['style_active'] = 1; + $style['style_id'] = $this->install_style($style); + $style['_installed'] = true; + $found = true; + $last_installed = $style['style_id']; + $installed_names[] = $style['style_name']; + $installed_dirs[] = $style['style_path']; + $messages[] = sprintf($this->user->lang['STYLE_INSTALLED'], htmlspecialchars($style['style_name'])); + } + } + if (!$found) + { + $messages[] = sprintf($this->user->lang['STYLE_NOT_INSTALLED'], htmlspecialchars($dir)); + } + } + + // Show message + if (!count($messages)) + { + trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING); + } + $message = implode('
', $messages); + $message .= '

« ' . $this->user->lang('STYLE_INSTALLED_RETURN_INSTALLED_STYLES') . ''; + $message .= '

» ' . $this->user->lang('STYLE_INSTALLED_RETURN_UNINSTALLED_STYLES') . ''; + trigger_error($message, E_USER_NOTICE); + } + + /** + * Confirm styles removal + */ + protected function action_uninstall() + { + // Get list of styles to uninstall + $ids = $this->request_vars('id', 0, true); + + // Check if confirmation box was submitted + if (confirm_box(true)) + { + // Uninstall + $this->action_uninstall_confirmed($ids, $this->request->variable('confirm_delete_files', false)); + return; + } + + // Confirm box + $s_hidden = build_hidden_fields(array( + 'action' => 'uninstall', + 'ids' => $ids + )); + $this->template->assign_var('S_CONFIRM_DELETE', true); + confirm_box(false, $this->user->lang['CONFIRM_UNINSTALL_STYLES'], $s_hidden, 'acp_styles.html'); + + // Canceled - show styles list + $this->frontend(); + } + + /** + * Uninstall styles(s) + * + * @param array $ids List of style IDs + * @param bool $delete_files If true, script will attempt to remove files for selected styles + */ + protected function action_uninstall_confirmed($ids, $delete_files) + { + $default = $this->default_style; + $uninstalled = array(); + $messages = array(); + + // Check styles list + foreach ($ids as $id) + { + if (!$id) + { + trigger_error($this->user->lang['INVALID_STYLE_ID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + if ($id == $default) + { + trigger_error($this->user->lang['UNINSTALL_DEFAULT'] . adm_back_link($this->u_action), E_USER_WARNING); + } + $uninstalled[$id] = false; + } + + // Order by reversed style_id, so parent styles would be removed after child styles + // This way parent and child styles can be removed in same function call + $sql = 'SELECT * + FROM ' . STYLES_TABLE . ' + WHERE style_id IN (' . implode(', ', $ids) . ') + ORDER BY style_id DESC'; + $result = $this->db->sql_query($sql); + + $rows = $this->db->sql_fetchrowset($result); + $this->db->sql_freeresult($result); + + // Uinstall each style + $uninstalled = array(); + foreach ($rows as $style) + { + $result = $this->uninstall_style($style, $delete_files); + + if (is_string($result)) + { + $messages[] = $result; + continue; + } + $messages[] = sprintf($this->user->lang['STYLE_UNINSTALLED'], $style['style_name']); + $uninstalled[] = $style['style_name']; + + // Attempt to delete files + if ($delete_files) + { + $messages[] = sprintf($this->user->lang[$this->delete_style_files($style['style_path']) ? 'DELETE_STYLE_FILES_SUCCESS' : 'DELETE_STYLE_FILES_FAILED'], $style['style_name']); + } + } + + if (empty($messages)) + { + // Nothing to uninstall? + trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Log action + if (count($uninstalled)) + { + add_log('admin', 'LOG_STYLE_DELETE', implode(', ', $uninstalled)); + } + + // Clear cache + $this->cache->purge(); + + // Show message + trigger_error(implode('
', $messages) . adm_back_link($this->u_action), E_USER_NOTICE); + } + + /** + * Activate styles + */ + protected function action_activate() + { + // Get list of styles to activate + $ids = $this->request_vars('id', 0, true); + + // Activate styles + $sql = 'UPDATE ' . STYLES_TABLE . ' + SET style_active = 1 + WHERE style_id IN (' . implode(', ', $ids) . ')'; + $this->db->sql_query($sql); + + // Purge cache + $this->cache->destroy('sql', STYLES_TABLE); + + // Show styles list + $this->frontend(); + } + + /** + * Deactivate styles + */ + protected function action_deactivate() + { + // Get list of styles to deactivate + $ids = $this->request_vars('id', 0, true); + + // Check for default style + foreach ($ids as $id) + { + if ($id == $this->default_style) + { + trigger_error($this->user->lang['DEACTIVATE_DEFAULT'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + + // Reset default style for users who use selected styles + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_style = 0 + WHERE user_style IN (' . implode(', ', $ids) . ')'; + $this->db->sql_query($sql); + + // Deactivate styles + $sql = 'UPDATE ' . STYLES_TABLE . ' + SET style_active = 0 + WHERE style_id IN (' . implode(', ', $ids) . ')'; + $this->db->sql_query($sql); + + // Purge cache + $this->cache->destroy('sql', STYLES_TABLE); + + // Show styles list + $this->frontend(); + } + + /** + * Show style details + */ + protected function action_details() + { + $id = $this->request->variable('id', 0); + if (!$id) + { + trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Get all styles + $styles = $this->get_styles(); + usort($styles, array($this, 'sort_styles')); + + // Find current style + $style = false; + foreach ($styles as $row) + { + if ($row['style_id'] == $id) + { + $style = $row; + break; + } + } + + if ($style === false) + { + trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Find all available parent styles + $list = $this->find_possible_parents($styles, $id); + + // Add form key + $form_key = 'acp_styles'; + add_form_key($form_key); + + // Change data + if ($this->request->variable('update', false)) + { + if (!check_form_key($form_key)) + { + trigger_error($this->user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $update = array( + 'style_name' => trim($this->request->variable('style_name', $style['style_name'])), + 'style_parent_id' => $this->request->variable('style_parent', (int) $style['style_parent_id']), + 'style_active' => $this->request->variable('style_active', (int) $style['style_active']), + ); + $update_action = $this->u_action . '&action=details&id=' . $id; + + // Check style name + if ($update['style_name'] != $style['style_name']) + { + if (!strlen($update['style_name'])) + { + trigger_error($this->user->lang['STYLE_ERR_STYLE_NAME'] . adm_back_link($update_action), E_USER_WARNING); + } + foreach ($styles as $row) + { + if ($row['style_name'] == $update['style_name']) + { + trigger_error($this->user->lang['STYLE_ERR_NAME_EXIST'] . adm_back_link($update_action), E_USER_WARNING); + } + } + } + else + { + unset($update['style_name']); + } + + // Check parent style id + if ($update['style_parent_id'] != $style['style_parent_id']) + { + if ($update['style_parent_id'] != 0) + { + $found = false; + foreach ($list as $row) + { + if ($row['style_id'] == $update['style_parent_id']) + { + $found = true; + $update['style_parent_tree'] = ($row['style_parent_tree'] != '' ? $row['style_parent_tree'] . '/' : '') . $row['style_path']; + break; + } + } + if (!$found) + { + trigger_error($this->user->lang['STYLE_ERR_INVALID_PARENT'] . adm_back_link($update_action), E_USER_WARNING); + } + } + else + { + $update['style_parent_tree'] = ''; + } + } + else + { + unset($update['style_parent_id']); + } + + // Check style_active + if ($update['style_active'] != $style['style_active']) + { + if (!$update['style_active'] && $this->default_style == $style['style_id']) + { + trigger_error($this->user->lang['DEACTIVATE_DEFAULT'] . adm_back_link($update_action), E_USER_WARNING); + } + } + else + { + unset($update['style_active']); + } + + // Update data + if (count($update)) + { + $sql = 'UPDATE ' . STYLES_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $update) . " + WHERE style_id = $id"; + $this->db->sql_query($sql); + + $style = array_merge($style, $update); + + if (isset($update['style_parent_id'])) + { + // Update styles tree + $styles = $this->get_styles(); + if ($this->update_styles_tree($styles, $style)) + { + // Something was changed in styles tree, purge all cache + $this->cache->purge(); + } + } + add_log('admin', 'LOG_STYLE_EDIT_DETAILS', $style['style_name']); + } + + // Update default style + $default = $this->request->variable('style_default', 0); + if ($default) + { + if (!$style['style_active']) + { + trigger_error($this->user->lang['STYLE_DEFAULT_CHANGE_INACTIVE'] . adm_back_link($update_action), E_USER_WARNING); + } + set_config('default_style', $id); + $this->cache->purge(); + } + + // Show styles list + $this->frontend(); + return; + } + + // Show page title + $this->welcome_message('ACP_STYLES', null); + + // Show parent styles + foreach ($list as $row) + { + $this->template->assign_block_vars('parent_styles', array( + 'STYLE_ID' => $row['style_id'], + 'STYLE_NAME' => htmlspecialchars($row['style_name']), + 'LEVEL' => $row['level'], + 'SPACER' => str_repeat('  ', $row['level']), + ) + ); + } + + // Show style details + $this->template->assign_vars(array( + 'S_STYLE_DETAILS' => true, + 'STYLE_ID' => $style['style_id'], + 'STYLE_NAME' => htmlspecialchars($style['style_name']), + 'STYLE_PATH' => htmlspecialchars($style['style_path']), + 'STYLE_COPYRIGHT' => strip_tags($style['style_copyright']), + 'STYLE_PARENT' => $style['style_parent_id'], + 'S_STYLE_ACTIVE' => $style['style_active'], + 'S_STYLE_DEFAULT' => ($style['style_id'] == $this->default_style) + ) + ); + } + + /** + * List installed styles + */ + protected function show_installed() + { + // Get all installed styles + $styles = $this->get_styles(); + + if (!count($styles)) + { + trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + usort($styles, array($this, 'sort_styles')); + + // Get users + $users = $this->get_users(); + + // Add users counter to rows + foreach ($styles as &$style) + { + $style['_users'] = isset($users[$style['style_id']]) ? $users[$style['style_id']] : 0; + } + + // Set up styles list variables + // Addons should increase this number and update template variable + $this->styles_list_cols = 4; + $this->template->assign_var('STYLES_LIST_COLS', $this->styles_list_cols); + + // Show styles list + $this->show_styles_list($styles, 0, 0); + + // Show styles with invalid inherits_id + foreach ($styles as $style) + { + if (empty($style['_shown'])) + { + $style['_note'] = sprintf($this->user->lang['REQUIRES_STYLE'], htmlspecialchars($style['style_parent_tree'])); + $this->list_style($style, 0); + } + } + + // Add buttons + $this->template->assign_block_vars('extra_actions', array( + 'ACTION_NAME' => 'activate', + 'L_ACTION' => $this->user->lang['STYLE_ACTIVATE'], + ) + ); + + $this->template->assign_block_vars('extra_actions', array( + 'ACTION_NAME' => 'deactivate', + 'L_ACTION' => $this->user->lang['STYLE_DEACTIVATE'], + ) + ); + + if (isset($this->style_counters) && $this->style_counters['total'] > 1) + { + $this->template->assign_block_vars('extra_actions', array( + 'ACTION_NAME' => 'uninstall', + 'L_ACTION' => $this->user->lang['STYLE_UNINSTALL'], + ) + ); + } + } + + /** + * Show list of styles that can be installed + */ + protected function show_available() + { + // Get list of styles + $styles = $this->find_available(true); + + // Show styles + if (empty($styles)) + { + trigger_error($this->user->lang['NO_UNINSTALLED_STYLE'] . adm_back_link($this->u_base_action), E_USER_NOTICE); + } + + usort($styles, array($this, 'sort_styles')); + + $this->styles_list_cols = 3; + $this->template->assign_vars(array( + 'STYLES_LIST_COLS' => $this->styles_list_cols, + 'STYLES_LIST_HIDE_COUNT' => true + ) + ); + + // Show styles + foreach ($styles as &$style) + { + // Check if style has a parent style in styles list + $has_parent = false; + if ($style['_inherit_name'] != '') + { + foreach ($styles as $parent_style) + { + if ($parent_style['style_name'] == $style['_inherit_name'] && empty($parent_style['_shown'])) + { + // Show parent style first + $has_parent = true; + } + } + } + if (!$has_parent) + { + $this->list_style($style, 0); + $this->show_available_child_styles($styles, $style['style_name'], 1); + } + } + + // Show styles that do not have parent style in styles list + foreach ($styles as $style) + { + if (empty($style['_shown'])) + { + $this->list_style($style, 0); + } + } + + // Add button + if (isset($this->style_counters) && $this->style_counters['caninstall'] > 0) + { + $this->template->assign_block_vars('extra_actions', array( + 'ACTION_NAME' => 'install', + 'L_ACTION' => $this->user->lang['INSTALL_STYLES'], + ) + ); + } + } + + /** + * Find styles available for installation + * + * @param bool $all if true, function will return all installable styles. if false, function will return only styles that can be installed + * @return array List of styles + */ + protected function find_available($all) + { + // Get list of installed styles + $installed = $this->get_styles(); + + $installed_dirs = array(); + $installed_names = array(); + foreach ($installed as $style) + { + $installed_dirs[] = $style['style_path']; + $installed_names[$style['style_name']] = array( + 'path' => $style['style_path'], + 'id' => $style['style_id'], + 'parent' => $style['style_parent_id'], + 'tree' => (strlen($style['style_parent_tree']) ? $style['style_parent_tree'] . '/' : '') . $style['style_path'], + ); + } + + // Get list of directories + $dirs = $this->find_style_dirs(); + + // Find styles that can be installed + $styles = array(); + foreach ($dirs as $dir) + { + if (in_array($dir, $installed_dirs)) + { + // Style is already installed + continue; + } + $cfg = $this->read_style_cfg($dir); + if ($cfg === false) + { + // Invalid style.cfg + continue; + } + + // Style should be available for installation + $parent = $cfg['parent']; + $style = array( + 'style_id' => 0, + 'style_name' => $cfg['name'], + 'style_copyright' => $cfg['copyright'], + 'style_active' => 0, + 'style_path' => $dir, + 'bbcode_bitfield' => $cfg['template_bitfield'], + 'style_parent_id' => 0, + 'style_parent_tree' => '', + // Extra values for styles list + // All extra variable start with _ so they won't be confused with data that can be added to styles table + '_inherit_name' => $parent, + '_available' => true, + '_note' => '', + ); + + // Check style inheritance + if ($parent != '') + { + if (isset($installed_names[$parent])) + { + // Parent style is installed + $row = $installed_names[$parent]; + $style['style_parent_id'] = $row['id']; + $style['style_parent_tree'] = $row['tree']; + } + else + { + // Parent style is not installed yet + $style['_available'] = false; + $style['_note'] = sprintf($this->user->lang['REQUIRES_STYLE'], htmlspecialchars($parent)); + } + } + + if ($all || $style['_available']) + { + $styles[] = $style; + } + } + + return $styles; + } + + /** + * Show styles list + * + * @param array $styles styles list + * @param int $parent parent style id + * @param int $level style inheritance level + */ + protected function show_styles_list(&$styles, $parent, $level) + { + foreach ($styles as &$style) + { + if (empty($style['_shown']) && $style['style_parent_id'] == $parent) + { + $this->list_style($style, $level); + $this->show_styles_list($styles, $style['style_id'], $level + 1); + } + } + } + + /** + * Show available styles tree + * + * @param array $styles Styles list, passed as reference + * @param string $name Name of parent style + * @param int $level Styles tree level + */ + protected function show_available_child_styles(&$styles, $name, $level) + { + foreach ($styles as &$style) + { + if (empty($style['_shown']) && $style['_inherit_name'] == $name) + { + $this->list_style($style, $level); + $this->show_available_child_styles($styles, $style['style_name'], $level + 1); + } + } + } + + /** + * Update styles tree + * + * @param array $styles Styles list, passed as reference + * @param array|false $style Current style, false if root + * @return bool True if something was updated, false if not + */ + protected function update_styles_tree(&$styles, $style = false) + { + $parent_id = ($style === false) ? 0 : $style['style_id']; + $parent_tree = ($style === false) ? '' : ($style['style_parent_tree'] == '' ? '' : $style['style_parent_tree']) . $style['style_path']; + $update = false; + $updated = false; + foreach ($styles as &$row) + { + if ($row['style_parent_id'] == $parent_id) + { + if ($row['style_parent_tree'] != $parent_tree) + { + $row['style_parent_tree'] = $parent_tree; + $update = true; + } + $updated |= $this->update_styles_tree($styles, $row); + } + } + if ($update) + { + $sql = 'UPDATE ' . STYLES_TABLE . " + SET style_parent_tree = '" . $this->db->sql_escape($parent_tree) . "' + WHERE style_parent_id = {$parent_id}"; + $this->db->sql_query($sql); + $updated = true; + } + return $updated; + } + + /** + * Find all possible parent styles for style + * + * @param array $styles list of styles + * @param int $id id of style + * @param int $parent current parent style id + * @param int $level current tree level + * @return array Style ids, names and levels + */ + protected function find_possible_parents($styles, $id = -1, $parent = 0, $level = 0) + { + $results = array(); + foreach ($styles as $style) + { + if ($style['style_id'] != $id && $style['style_parent_id'] == $parent) + { + $results[] = array( + 'style_id' => $style['style_id'], + 'style_name' => $style['style_name'], + 'style_path' => $style['style_path'], + 'style_parent_id' => $style['style_parent_id'], + 'style_parent_tree' => $style['style_parent_tree'], + 'level' => $level + ); + $results = array_merge($results, $this->find_possible_parents($styles, $id, $style['style_id'], $level + 1)); + } + } + return $results; + } + + /** + * Show item in styles list + * + * @param array $style style row + * @param int $level style inheritance level + */ + protected function list_style(&$style, $level) + { + // Mark row as shown + if (!empty($style['_shown'])) + { + return; + } + + $style['_shown'] = true; + + // Generate template variables + $actions = array(); + $row = array( + // Style data + 'STYLE_ID' => $style['style_id'], + 'STYLE_NAME' => htmlspecialchars($style['style_name']), + 'STYLE_PATH' => htmlspecialchars($style['style_path']), + 'STYLE_COPYRIGHT' => strip_tags($style['style_copyright']), + 'STYLE_ACTIVE' => $style['style_active'], + + // Additional data + 'DEFAULT' => ($style['style_id'] && $style['style_id'] == $this->default_style), + 'USERS' => (isset($style['_users'])) ? $style['_users'] : '', + 'LEVEL' => $level, + 'PADDING' => (4 + 16 * $level), + 'SHOW_COPYRIGHT' => ($style['style_id']) ? false : true, + 'STYLE_PATH_FULL' => htmlspecialchars($this->styles_path_absolute . '/' . $style['style_path']) . '/', + + // Comment to show below style + 'COMMENT' => (isset($style['_note'])) ? $style['_note'] : '', + + // The following variables should be used by hooks to add custom HTML code + 'EXTRA' => '', + 'EXTRA_OPTIONS' => '' + ); + + // Status specific data + if ($style['style_id']) + { + // Style is installed + + // Details + $actions[] = array( + 'U_ACTION' => $this->u_action . '&action=details&id=' . $style['style_id'], + 'L_ACTION' => $this->user->lang['DETAILS'] + ); + + // Activate/Deactive + $action_name = ($style['style_active'] ? 'de' : '') . 'activate'; + + $actions[] = array( + 'U_ACTION' => $this->u_action . '&action=' . $action_name . '&hash=' . generate_link_hash($action_name) . '&id=' . $style['style_id'], + 'L_ACTION' => $this->user->lang['STYLE_' . ($style['style_active'] ? 'DE' : '') . 'ACTIVATE'] + ); + +/* // Export + $actions[] = array( + 'U_ACTION' => $this->u_action . '&action=export&hash=' . generate_link_hash('export') . '&id=' . $style['style_id'], + 'L_ACTION' => $this->user->lang['EXPORT'] + ); */ + + // Uninstall + $actions[] = array( + 'U_ACTION' => $this->u_action . '&action=uninstall&hash=' . generate_link_hash('uninstall') . '&id=' . $style['style_id'], + 'L_ACTION' => $this->user->lang['STYLE_UNINSTALL'] + ); + + // Preview + $actions[] = array( + 'U_ACTION' => append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'style=' . $style['style_id']), + 'L_ACTION' => $this->user->lang['PREVIEW'] + ); + } + else + { + // Style is not installed + if (empty($style['_available'])) + { + $actions[] = array( + 'HTML' => $this->user->lang['CANNOT_BE_INSTALLED'] + ); + } + else + { + $actions[] = array( + 'U_ACTION' => $this->u_action . '&action=install&hash=' . generate_link_hash('install') . '&dir=' . urlencode($style['style_path']), + 'L_ACTION' => $this->user->lang['INSTALL_STYLE'] + ); + } + } + + // todo: add hook + + // Assign template variables + $this->template->assign_block_vars('styles_list', $row); + foreach($actions as $action) + { + $this->template->assign_block_vars('styles_list.actions', $action); + } + + // Increase counters + $counter = ($style['style_id']) ? ($style['style_active'] ? 'active' : 'inactive') : (empty($style['_available']) ? 'cannotinstall' : 'caninstall'); + if (!isset($this->style_counters)) + { + $this->style_counters = array( + 'total' => 0, + 'active' => 0, + 'inactive' => 0, + 'caninstall' => 0, + 'cannotinstall' => 0 + ); + } + $this->style_counters[$counter]++; + $this->style_counters['total']++; + } + + /** + * Show welcome message + * + * @param string $title main title + * @param string $description page description + */ + protected function welcome_message($title, $description) + { + $this->template->assign_vars(array( + 'L_TITLE' => $this->user->lang[$title], + 'L_EXPLAIN' => (isset($this->user->lang[$description])) ? $this->user->lang[$description] : '' + ) + ); + } + + /** + * Find all directories that have styles + * + * @return array Directory names + */ + protected function find_style_dirs() + { + $styles = array(); + + $dp = @opendir($this->styles_path); + if ($dp) + { + while (($file = readdir($dp)) !== false) + { + $dir = $this->styles_path . $file; + if ($file[0] == '.' || !is_dir($dir)) + { + continue; + } + + if (file_exists("{$dir}/style.cfg")) + { + $styles[] = $file; + } + } + closedir($dp); + } + + return $styles; + } + + /** + * Sort styles + */ + public function sort_styles($style1, $style2) + { + if ($style1['style_active'] != $style2['style_active']) + { + return ($style1['style_active']) ? -1 : 1; + } + if (isset($style1['_available']) && $style1['_available'] != $style2['_available']) + { + return ($style1['_available']) ? -1 : 1; + } + return strcasecmp(isset($style1['style_name']) ? $style1['style_name'] : $style1['name'], isset($style2['style_name']) ? $style2['style_name'] : $style2['name']); + } + + /** + * Read style configuration file + * + * @param string $dir style directory + * @return array|bool Style data, false on error + */ + protected function read_style_cfg($dir) + { + static $required = array('name', 'phpbb_version', 'copyright'); + $cfg = parse_cfg_file($this->styles_path . $dir . '/style.cfg'); + + // Check if it is a valid file + foreach ($required as $key) + { + if (!isset($cfg[$key])) + { + return false; + } + } + + // Check data + if (!isset($cfg['parent']) || !is_string($cfg['parent']) || $cfg['parent'] == $cfg['name']) + { + $cfg['parent'] = ''; + } + if (!isset($cfg['template_bitfield'])) + { + $cfg['template_bitfield'] = $this->default_bitfield(); + } + + return $cfg; + } + + /** + * Install style + * + * @param array $style style data + * @return int Style id + */ + protected function install_style($style) + { + // Generate row + $sql_ary = array(); + foreach ($style as $key => $value) + { + if ($key != 'style_id' && substr($key, 0, 1) != '_') + { + $sql_ary[$key] = $value; + } + } + + // Add to database + $this->db->sql_transaction('begin'); + + $sql = 'INSERT INTO ' . STYLES_TABLE . ' + ' . $this->db->sql_build_array('INSERT', $sql_ary); + $this->db->sql_query($sql); + + $id = $this->db->sql_nextid(); + + $this->db->sql_transaction('commit'); + + add_log('admin', 'LOG_STYLE_ADD', $sql_ary['style_name']); + + return $id; + } + + /** + * Lists all styles + * + * @return array Rows with styles data + */ + protected function get_styles() + { + $sql = 'SELECT * + FROM ' . STYLES_TABLE; + $result = $this->db->sql_query($sql); + + $rows = $this->db->sql_fetchrowset($result); + $this->db->sql_freeresult($result); + + return $rows; + } + + /** + * Count users for each style + * + * @return array Styles in following format: [style_id] = number of users + */ + protected function get_users() + { + $sql = 'SELECT user_style, COUNT(user_style) AS style_count + FROM ' . USERS_TABLE . ' + GROUP BY user_style'; + $result = $this->db->sql_query($sql); + + $style_count = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $style_count[$row['user_style']] = $row['style_count']; + } + $this->db->sql_freeresult($result); + + return $style_count; + } + + /** + * Uninstall style + * + * @param array $style Style data + * @return bool|string True on success, error message on error + */ + protected function uninstall_style($style) + { + $id = $style['style_id']; + $path = $style['style_path']; + + // Check if style has child styles + $sql = 'SELECT style_id + FROM ' . STYLES_TABLE . ' + WHERE style_parent_id = ' . (int) $id . " OR style_parent_tree = '" . $this->db->sql_escape($path) . "'"; + $result = $this->db->sql_query($sql); + + $conflict = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if ($conflict !== false) + { + return sprintf($this->user->lang['STYLE_UNINSTALL_DEPENDENT'], $style['style_name']); + } + + // Change default style for users + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_style = 0 + WHERE user_style = ' . $id; + $this->db->sql_query($sql); + + // Uninstall style + $sql = 'DELETE FROM ' . STYLES_TABLE . ' + WHERE style_id = ' . $id; + $this->db->sql_query($sql); + return true; + } + + /** + * Delete all files in style directory + * + * @param string $path Style directory + * @param string $dir Directory to remove inside style's directory + * @return bool True on success, false on error + */ + protected function delete_style_files($path, $dir = '') + { + $dirname = $this->styles_path . $path . $dir; + $result = true; + + $dp = @opendir($dirname); + + if ($dp) + { + while (($file = readdir($dp)) !== false) + { + if ($file == '.' || $file == '..') + { + continue; + } + $filename = $dirname . '/' . $file; + if (is_dir($filename)) + { + if (!$this->delete_style_files($path, $dir . '/' . $file)) + { + $result = false; + } + } + else + { + if (!@unlink($filename)) + { + $result = false; + } + } + } + closedir($dp); + } + if (!@rmdir($dirname)) + { + return false; + } + + return $result; + } + + /** + * Get list of items from posted data + * + * @param string $name Variable name + * @param string|int $default Default value for array + * @param bool $error If true, error will be triggered if list is empty + * @return array Items + */ + protected function request_vars($name, $default, $error = false) + { + $item = $this->request->variable($name, $default); + $items = $this->request->variable($name . 's', array($default)); + + if (count($items) == 1 && $items[0] == $default) + { + $items = array(); + } + + if ($item != $default && !count($items)) + { + $items[] = $item; + } + + if ($error && !count($items)) + { + trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + return $items; + } + + /** + * Generates default bitfield + * + * This bitfield decides which bbcodes are defined in a template. + * + * @return string Bitfield + */ + protected function default_bitfield() + { + static $value; + if (isset($value)) + { + return $value; + } + + // Hardcoded template bitfield to add for new templates + $bitfield = new bitfield(); + $bitfield->set(0); + $bitfield->set(1); + $bitfield->set(2); + $bitfield->set(3); + $bitfield->set(4); + $bitfield->set(8); + $bitfield->set(9); + $bitfield->set(11); + $bitfield->set(12); + $value = $bitfield->get_base64(); + return $value; + } + +} diff --git a/sources/phpBB/includes/acp/acp_update.php b/sources/phpBB/includes/acp/acp_update.php new file mode 100644 index 0000000..0167a06 --- /dev/null +++ b/sources/phpBB/includes/acp/acp_update.php @@ -0,0 +1,66 @@ + +* @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; +} + +class acp_update +{ + var $u_action; + + function main($id, $mode) + { + global $config, $user, $template, $request; + global $phpbb_root_path, $phpEx, $phpbb_container; + + $user->add_lang('install'); + + $this->tpl_name = 'acp_update'; + $this->page_title = 'ACP_VERSION_CHECK'; + + $version_helper = $phpbb_container->get('version_helper'); + try + { + $recheck = $request->variable('versioncheck_force', false); + $updates_available = $version_helper->get_suggested_updates($recheck); + } + catch (\RuntimeException $e) + { + $template->assign_var('S_VERSIONCHECK_FAIL', true); + + $updates_available = array(); + } + + foreach ($updates_available as $branch => $version_data) + { + $template->assign_block_vars('updates_available', $version_data); + } + + $update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update'); + + $template->assign_vars(array( + 'S_UP_TO_DATE' => empty($updates_available), + 'U_ACTION' => $this->u_action, + 'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&versioncheck_force=1'), + + 'CURRENT_VERSION' => $config['version'], + + 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $update_link), + )); + } +} diff --git a/sources/phpBB/includes/acp/acp_users.php b/sources/phpBB/includes/acp/acp_users.php new file mode 100644 index 0000000..881e50d --- /dev/null +++ b/sources/phpBB/includes/acp/acp_users.php @@ -0,0 +1,2494 @@ + +* @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; +} + +class acp_users +{ + var $u_action; + var $p_master; + + function acp_users(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($id, $mode) + { + 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; + + $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', ''); + + $submit = (isset($_POST['update']) && !isset($_POST['cancel'])) ? true : false; + + $form_name = 'acp_users'; + add_form_key($form_name); + + // Whois (special case) + if ($action == 'whois') + { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + $this->page_title = 'WHOIS'; + $this->tpl_name = 'simple_body'; + + $user_ip = phpbb_ip_normalise(request_var('user_ip', '')); + $domain = gethostbyaddr($user_ip); + $ipwhois = user_ipwhois($user_ip); + + $template->assign_vars(array( + 'MESSAGE_TITLE' => sprintf($user->lang['IP_WHOIS_FOR'], $domain), + 'MESSAGE_TEXT' => nl2br($ipwhois)) + ); + + return; + } + + // Show user selection mask + if (!$username && !$user_id) + { + $this->page_title = 'SELECT_USER'; + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'ANONYMOUS_USER_ID' => ANONYMOUS, + + 'S_SELECT_USER' => true, + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_user&field=username&select_single=true'), + )); + + return; + } + + if (!$user_id) + { + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . " + WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; + $result = $db->sql_query($sql); + $user_id = (int) $db->sql_fetchfield('user_id'); + $db->sql_freeresult($result); + + if (!$user_id) + { + trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + + // Generate content for all modes + $sql = 'SELECT u.*, s.* + FROM ' . USERS_TABLE . ' u + LEFT JOIN ' . SESSIONS_TABLE . ' s ON (s.session_user_id = u.user_id) + WHERE u.user_id = ' . $user_id . ' + ORDER BY s.session_time DESC'; + $result = $db->sql_query_limit($sql, 1); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$user_row) + { + trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Generate overall "header" for user admin + $s_form_options = ''; + + // Build modes dropdown list + $sql = 'SELECT module_mode, module_auth + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'acp_users' + AND module_enabled = 1 + AND module_class = 'acp' + ORDER BY left_id, module_mode"; + $result = $db->sql_query($sql); + + $dropdown_modes = array(); + while ($row = $db->sql_fetchrow($result)) + { + if (!$this->p_master->module_auth_self($row['module_auth'])) + { + continue; + } + + $dropdown_modes[$row['module_mode']] = true; + } + $db->sql_freeresult($result); + + foreach ($dropdown_modes as $module_mode => $null) + { + $selected = ($mode == $module_mode) ? ' selected="selected"' : ''; + $s_form_options .= ''; + } + + $template->assign_vars(array( + 'U_BACK' => $this->u_action, + 'U_MODE_SELECT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&u=$user_id"), + 'U_ACTION' => $this->u_action . '&u=' . $user_id, + 'S_FORM_OPTIONS' => $s_form_options, + 'MANAGED_USERNAME' => $user_row['username']) + ); + + // Prevent normal users/admins change/view founders if they are not a founder by themselves + if ($user->data['user_type'] != USER_FOUNDER && $user_row['user_type'] == USER_FOUNDER) + { + trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $this->page_title = $user_row['username'] . ' :: ' . $user->lang('ACP_USER_' . strtoupper($mode)); + + switch ($mode) + { + case 'overview': + + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + $user->add_lang('acp/ban'); + + $delete = request_var('delete', 0); + $delete_type = request_var('delete_type', ''); + $ip = request_var('ip', 'ip'); + + /** + * Run code at beginning of ACP users overview + * + * @event core.acp_users_overview_before + * @var array user_row Current user data + * @var string mode Active module + * @var string action Module that should be run + * @var bool submit Do we display the form only + * or did the user press submit + * @var array error Array holding error messages + * @since 3.1.3-RC1 + */ + $vars = array('user_row', 'mode', 'action', 'submit', 'error'); + extract($phpbb_dispatcher->trigger_event('core.acp_users_overview_before', compact($vars))); + + if ($submit) + { + if ($delete) + { + if (!$auth->acl_get('a_userdel')) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + // Check if the user wants to remove himself or the guest user account + if ($user_id == ANONYMOUS) + { + trigger_error($user->lang['CANNOT_REMOVE_ANONYMOUS'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + // Founders can not be deleted. + if ($user_row['user_type'] == USER_FOUNDER) + { + trigger_error($user->lang['CANNOT_REMOVE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($user_id == $user->data['user_id']) + { + trigger_error($user->lang['CANNOT_REMOVE_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($delete_type) + { + if (confirm_box(true)) + { + user_delete($delete_type, $user_id, $user_row['username']); + + add_log('admin', 'LOG_USER_DELETED', $user_row['username']); + trigger_error($user->lang['USER_DELETED'] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'u' => $user_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'update' => true, + 'delete' => 1, + 'delete_type' => $delete_type)) + ); + } + } + else + { + trigger_error($user->lang['NO_MODE'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + } + + // Handle quicktool actions + switch ($action) + { + case 'banuser': + case 'banemail': + case 'banip': + + if ($user_id == $user->data['user_id']) + { + trigger_error($user->lang['CANNOT_BAN_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($user_id == ANONYMOUS) + { + trigger_error($user->lang['CANNOT_BAN_ANONYMOUS'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($user_row['user_type'] == USER_FOUNDER) + { + trigger_error($user->lang['CANNOT_BAN_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + $ban = array(); + + switch ($action) + { + case 'banuser': + $ban[] = $user_row['username']; + $reason = 'USER_ADMIN_BAN_NAME_REASON'; + $log = 'LOG_USER_BAN_USER'; + break; + + case 'banemail': + $ban[] = $user_row['user_email']; + $reason = 'USER_ADMIN_BAN_EMAIL_REASON'; + $log = 'LOG_USER_BAN_EMAIL'; + break; + + case 'banip': + $ban[] = $user_row['user_ip']; + + $sql = 'SELECT DISTINCT poster_ip + FROM ' . POSTS_TABLE . " + WHERE poster_id = $user_id"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $ban[] = $row['poster_ip']; + } + $db->sql_freeresult($result); + + $reason = 'USER_ADMIN_BAN_IP_REASON'; + $log = 'LOG_USER_BAN_IP'; + 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)); + + // 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); + + trigger_error((($result === false) ? $user->lang['BAN_ALREADY_ENTERED'] : $user->lang['BAN_SUCCESSFUL']) . adm_back_link($this->u_action . '&u=' . $user_id)); + + break; + + case 'reactivate': + + if ($user_id == $user->data['user_id']) + { + trigger_error($user->lang['CANNOT_FORCE_REACT_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($user_row['user_type'] == USER_FOUNDER) + { + trigger_error($user->lang['CANNOT_FORCE_REACT_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($user_row['user_type'] == USER_IGNORE) + { + trigger_error($user->lang['CANNOT_FORCE_REACT_BOT'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($config['email_enable']) + { + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $server_url = generate_board_url(); + + $user_actkey = gen_rand_string(mt_rand(6, 10)); + $email_template = ($user_row['user_type'] == USER_NORMAL) ? 'user_reactivate_account' : 'user_resend_inactive'; + + if ($user_row['user_type'] == USER_NORMAL) + { + user_active_flip('deactivate', $user_id, INACTIVE_REMIND); + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_actkey = '" . $db->sql_escape($user_actkey) . "' + WHERE user_id = $user_id"; + $db->sql_query($sql); + } + else + { + // Grabbing the last confirm key - we only send a reminder + $sql = 'SELECT user_actkey + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . $user_id; + $result = $db->sql_query($sql); + $user_actkey = (string) $db->sql_fetchfield('user_actkey'); + $db->sql_freeresult($result); + } + + $messenger = new messenger(false); + + $messenger->template($email_template, $user_row['user_lang']); + + $messenger->set_addresses($user_row); + + $messenger->anti_abuse_headers($config, $user); + + $messenger->assign_vars(array( + 'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])), + 'USERNAME' => htmlspecialchars_decode($user_row['username']), + 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k=$user_actkey") + ); + + $messenger->send(NOTIFY_EMAIL); + + add_log('admin', 'LOG_USER_REACTIVATE', $user_row['username']); + add_log('user', $user_id, 'LOG_USER_REACTIVATE_USER'); + + trigger_error($user->lang['FORCE_REACTIVATION_SUCCESS'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + + break; + + case 'active': + + if ($user_id == $user->data['user_id']) + { + // It is only deactivation since the user is already activated (else he would not have reached this page) + trigger_error($user->lang['CANNOT_DEACTIVATE_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($user_row['user_type'] == USER_FOUNDER) + { + trigger_error($user->lang['CANNOT_DEACTIVATE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($user_row['user_type'] == USER_IGNORE) + { + trigger_error($user->lang['CANNOT_DEACTIVATE_BOT'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + user_active_flip('flip', $user_id); + + if ($user_row['user_type'] == USER_INACTIVE) + { + if ($config['require_activation'] == USER_ACTIVATION_ADMIN) + { + $phpbb_notifications = $phpbb_container->get('notification_manager'); + $phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_row['user_id']); + + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $messenger = new messenger(false); + + $messenger->template('admin_welcome_activated', $user_row['user_lang']); + + $messenger->set_addresses($user_row); + + $messenger->anti_abuse_headers($config, $user); + + $messenger->assign_vars(array( + 'USERNAME' => htmlspecialchars_decode($user_row['username'])) + ); + + $messenger->send(NOTIFY_EMAIL); + } + } + + $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'); + + trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&u=' . $user_id)); + + break; + + case 'delsig': + + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + $sql_ary = array( + 'user_sig' => '', + 'user_sig_bbcode_uid' => '', + 'user_sig_bbcode_bitfield' => '' + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + 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'); + + trigger_error($user->lang['USER_ADMIN_SIG_REMOVED'] . adm_back_link($this->u_action . '&u=' . $user_id)); + + break; + + case 'delavatar': + + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + // Delete old avatar if present + $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'); + + trigger_error($user->lang['USER_ADMIN_AVATAR_REMOVED'] . adm_back_link($this->u_action . '&u=' . $user_id)); + break; + + case 'delposts': + + if (confirm_box(true)) + { + // Delete posts, attachments, etc. + delete_posts('poster_id', $user_id); + + add_log('admin', 'LOG_USER_DEL_POSTS', $user_row['username']); + trigger_error($user->lang['USER_POSTS_DELETED'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'u' => $user_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'update' => true)) + ); + } + + break; + + case 'delattach': + + if (confirm_box(true)) + { + delete_attachments('user', $user_id); + + add_log('admin', 'LOG_USER_DEL_ATTACH', $user_row['username']); + trigger_error($user->lang['USER_ATTACHMENTS_REMOVED'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'u' => $user_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'update' => true)) + ); + } + + break; + + case 'deloutbox': + + if (confirm_box(true)) + { + $msg_ids = array(); + $lang = 'EMPTY'; + + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . " + WHERE author_id = $user_id + AND folder_id = " . PRIVMSGS_OUTBOX; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + if (!function_exists('delete_pm')) + { + include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + } + + do + { + $msg_ids[] = (int) $row['msg_id']; + } + while ($row = $db->sql_fetchrow($result)); + + $db->sql_freeresult($result); + + delete_pm($user_id, $msg_ids, PRIVMSGS_OUTBOX); + + add_log('admin', 'LOG_USER_DEL_OUTBOX', $user_row['username']); + + $lang = 'EMPTIED'; + } + $db->sql_freeresult($result); + + trigger_error($user->lang['USER_OUTBOX_' . $lang] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'u' => $user_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'update' => true)) + ); + } + break; + + case 'moveposts': + + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + $user->add_lang('acp/forums'); + + $new_forum_id = request_var('new_f', 0); + + if (!$new_forum_id) + { + $this->page_title = 'USER_ADMIN_MOVE_POSTS'; + + $template->assign_vars(array( + 'S_SELECT_FORUM' => true, + 'U_ACTION' => $this->u_action . "&action=$action&u=$user_id", + 'U_BACK' => $this->u_action . "&u=$user_id", + 'S_FORUM_OPTIONS' => make_forum_select(false, false, false, true)) + ); + + return; + } + + // Is the new forum postable to? + $sql = 'SELECT forum_name, forum_type + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $new_forum_id"; + $result = $db->sql_query($sql); + $forum_info = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$forum_info) + { + trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($forum_info['forum_type'] != FORUM_POST) + { + trigger_error($user->lang['MOVE_POSTS_NO_POSTABLE_FORUM'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + // Two stage? + // Move topics comprising only posts from this user + $topic_id_ary = $move_topic_ary = $move_post_ary = $new_topic_id_ary = array(); + $forum_id_ary = array($new_forum_id); + + $sql = 'SELECT topic_id, post_visibility, COUNT(post_id) AS total_posts + FROM ' . POSTS_TABLE . " + WHERE poster_id = $user_id + AND forum_id <> $new_forum_id + GROUP BY topic_id, post_visibility"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $topic_id_ary[$row['topic_id']][$row['post_visibility']] = $row['total_posts']; + } + $db->sql_freeresult($result); + + if (sizeof($topic_id_ary)) + { + $sql = 'SELECT topic_id, forum_id, topic_title, topic_posts_approved, topic_posts_unapproved, topic_posts_softdeleted, topic_attachment + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', array_keys($topic_id_ary)); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($topic_id_ary[$row['topic_id']][ITEM_APPROVED] == $row['topic_posts_approved'] + && $topic_id_ary[$row['topic_id']][ITEM_UNAPPROVED] == $row['topic_posts_unapproved'] + && $topic_id_ary[$row['topic_id']][ITEM_REAPPROVE] == $row['topic_posts_unapproved'] + && $topic_id_ary[$row['topic_id']][ITEM_DELETED] == $row['topic_posts_softdeleted']) + { + $move_topic_ary[] = $row['topic_id']; + } + else + { + $move_post_ary[$row['topic_id']]['title'] = $row['topic_title']; + $move_post_ary[$row['topic_id']]['attach'] = ($row['topic_attachment']) ? 1 : 0; + } + + $forum_id_ary[] = $row['forum_id']; + } + $db->sql_freeresult($result); + } + + // Entire topic comprises posts by this user, move these topics + if (sizeof($move_topic_ary)) + { + move_topics($move_topic_ary, $new_forum_id, false); + } + + if (sizeof($move_post_ary)) + { + // Create new topic + // Update post_ids, report_ids, attachment_ids + foreach ($move_post_ary as $topic_id => $post_ary) + { + // Create new topic + $sql = 'INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'topic_poster' => $user_id, + 'topic_time' => time(), + 'forum_id' => $new_forum_id, + 'icon_id' => 0, + 'topic_visibility' => ITEM_APPROVED, + 'topic_title' => $post_ary['title'], + 'topic_first_poster_name' => $user_row['username'], + 'topic_type' => POST_NORMAL, + 'topic_time_limit' => 0, + 'topic_attachment' => $post_ary['attach']) + ); + $db->sql_query($sql); + + $new_topic_id = $db->sql_nextid(); + + // Move posts + $sql = 'UPDATE ' . POSTS_TABLE . " + SET forum_id = $new_forum_id, topic_id = $new_topic_id + WHERE topic_id = $topic_id + AND poster_id = $user_id"; + $db->sql_query($sql); + + if ($post_ary['attach']) + { + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . " + SET topic_id = $new_topic_id + WHERE topic_id = $topic_id + AND poster_id = $user_id"; + $db->sql_query($sql); + } + + $new_topic_id_ary[] = $new_topic_id; + } + } + + $forum_id_ary = array_unique($forum_id_ary); + $topic_id_ary = array_unique(array_merge(array_keys($topic_id_ary), $new_topic_id_ary)); + + if (sizeof($topic_id_ary)) + { + sync('topic_reported', 'topic_id', $topic_id_ary); + sync('topic', 'topic_id', $topic_id_ary); + } + + if (sizeof($forum_id_ary)) + { + 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']); + + trigger_error($user->lang['USER_POSTS_MOVED'] . adm_back_link($this->u_action . '&u=' . $user_id)); + + break; + + case 'leave_nr': + + if (confirm_box(true)) + { + remove_newly_registered($user_id, $user_row); + + add_log('admin', 'LOG_USER_REMOVED_NR', $user_row['username']); + trigger_error($user->lang['USER_LIFTED_NR'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'u' => $user_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'update' => true)) + ); + } + + break; + + default: + /** + * Run custom quicktool code + * + * @event core.acp_users_overview_run_quicktool + * @var array user_row Current user data + * @var string action Quick tool that should be run + * @since 3.1.0-a1 + */ + $vars = array('action', 'user_row'); + extract($phpbb_dispatcher->trigger_event('core.acp_users_overview_run_quicktool', compact($vars))); + break; + } + + // 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'])), + 'new_password' => $request->variable('new_password', '', true), + 'password_confirm' => $request->variable('password_confirm', '', true), + ); + + // Validation data - we do not check the password complexity setting here + $check_ary = array( + 'new_password' => array( + array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), + array('password')), + 'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), + ); + + // Check username if altered + if ($data['username'] != $user_row['username']) + { + $check_ary += array( + 'username' => array( + array('string', false, $config['min_name_chars'], $config['max_name_chars']), + array('username', $user_row['username']) + ), + ); + } + + // Check email if altered + if ($data['email'] != $user_row['user_email']) + { + $check_ary += array( + 'email' => array( + array('string', false, 6, 60), + array('user_email', $user_row['user_email']), + ), + ); + } + + $error = validate_data($data, $check_ary); + + if ($data['new_password'] && $data['password_confirm'] != $data['new_password']) + { + $error[] = 'NEW_PASSWORD_ERROR'; + } + + if (!check_form_key($form_name)) + { + $error[] = 'FORM_INVALID'; + } + + // Instantiate passwords manager + $passwords_manager = $phpbb_container->get('passwords.manager'); + + // Which updates do we need to do? + $update_username = ($user_row['username'] != $data['username']) ? $data['username'] : false; + $update_password = $data['new_password'] && !$passwords_manager->check($data['new_password'], $user_row['user_password']); + $update_email = ($data['email'] != $user_row['user_email']) ? $data['email'] : false; + + if (!sizeof($error)) + { + $sql_ary = array(); + + if ($user_row['user_type'] != USER_FOUNDER || $user->data['user_type'] == USER_FOUNDER) + { + // Only allow founders updating the founder status... + if ($user->data['user_type'] == USER_FOUNDER) + { + // Setting a normal member to be a founder + if ($data['user_founder'] && $user_row['user_type'] != USER_FOUNDER) + { + // Make sure the user is not setting an Inactive or ignored user to be a founder + if ($user_row['user_type'] == USER_IGNORE) + { + trigger_error($user->lang['CANNOT_SET_FOUNDER_IGNORED'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($user_row['user_type'] == USER_INACTIVE) + { + trigger_error($user->lang['CANNOT_SET_FOUNDER_INACTIVE'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + $sql_ary['user_type'] = USER_FOUNDER; + } + else if (!$data['user_founder'] && $user_row['user_type'] == USER_FOUNDER) + { + // Check if at least one founder is present + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_FOUNDER . ' + AND user_id <> ' . $user_id; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $sql_ary['user_type'] = USER_NORMAL; + } + else + { + trigger_error($user->lang['AT_LEAST_ONE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + } + } + } + + /** + * Modify user data before we update it + * + * @event core.acp_users_overview_modify_data + * @var array user_row Current user data + * @var array data Submitted user data + * @var array sql_ary User data we udpate + * @since 3.1.0-a1 + */ + $vars = array('user_row', 'data', 'sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.acp_users_overview_modify_data', compact($vars))); + + if ($update_username !== false) + { + $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); + } + + if ($update_email !== false) + { + $sql_ary += array( + 'user_email' => $update_email, + '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); + } + + if ($update_password) + { + $sql_ary += array( + 'user_password' => $passwords_manager->hash($data['new_password']), + 'user_passchg' => time(), + ); + + $user->reset_login_keys($user_id); + add_log('user', $user_id, 'LOG_USER_NEW_PASSWORD', $user_row['username']); + } + + if (sizeof($sql_ary)) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . $user_id; + $db->sql_query($sql); + } + + if ($update_username) + { + user_update_name($user_row['username'], $update_username); + } + + // Let the users permissions being updated + $auth->acl_clear_prefetch($user_id); + + add_log('admin', 'LOG_USER_USER_UPDATE', $data['username']); + + trigger_error($user->lang['USER_OVERVIEW_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + + // Replace "error" strings with their real, localised form + $error = array_map(array($user, 'lang'), $error); + } + + if ($user_id == $user->data['user_id']) + { + $quick_tool_ary = array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH', 'deloutbox' => 'DEL_OUTBOX'); + if ($user_row['user_new']) + { + $quick_tool_ary['leave_nr'] = 'LEAVE_NR'; + } + } + else + { + $quick_tool_ary = array(); + + if ($user_row['user_type'] != USER_FOUNDER) + { + $quick_tool_ary += array('banuser' => 'BAN_USER', 'banemail' => 'BAN_EMAIL', 'banip' => 'BAN_IP'); + } + + if ($user_row['user_type'] != USER_FOUNDER && $user_row['user_type'] != USER_IGNORE) + { + $quick_tool_ary += array('active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE')); + } + + $quick_tool_ary += array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH', 'deloutbox' => 'DEL_OUTBOX'); + + if ($config['email_enable'] && ($user_row['user_type'] == USER_NORMAL || $user_row['user_type'] == USER_INACTIVE)) + { + $quick_tool_ary['reactivate'] = 'FORCE'; + } + + if ($user_row['user_new']) + { + $quick_tool_ary['leave_nr'] = 'LEAVE_NR'; + } + } + + if ($config['load_onlinetrack']) + { + $sql = 'SELECT MAX(session_time) AS session_time, MIN(session_viewonline) AS session_viewonline + FROM ' . SESSIONS_TABLE . " + WHERE session_user_id = $user_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $user_row['session_time'] = (isset($row['session_time'])) ? $row['session_time'] : 0; + $user_row['session_viewonline'] = (isset($row['session_viewonline'])) ? $row['session_viewonline'] : 0; + unset($row); + } + + /** + * Add additional quick tool options and overwrite user data + * + * @event core.acp_users_display_overview + * @var array user_row Array with user data + * @var array quick_tool_ary Ouick tool options + * @since 3.1.0-a1 + */ + $vars = array('user_row', 'quick_tool_ary'); + extract($phpbb_dispatcher->trigger_event('core.acp_users_display_overview', compact($vars))); + + $s_action_options = ''; + foreach ($quick_tool_ary as $value => $lang) + { + $s_action_options .= ''; + } + + $last_active = (!empty($user_row['session_time'])) ? $user_row['session_time'] : $user_row['user_lastvisit']; + + $inactive_reason = ''; + if ($user_row['user_type'] == USER_INACTIVE) + { + $inactive_reason = $user->lang['INACTIVE_REASON_UNKNOWN']; + + switch ($user_row['user_inactive_reason']) + { + case INACTIVE_REGISTER: + $inactive_reason = $user->lang['INACTIVE_REASON_REGISTER']; + break; + + case INACTIVE_PROFILE: + $inactive_reason = $user->lang['INACTIVE_REASON_PROFILE']; + break; + + case INACTIVE_MANUAL: + $inactive_reason = $user->lang['INACTIVE_REASON_MANUAL']; + break; + + case INACTIVE_REMIND: + $inactive_reason = $user->lang['INACTIVE_REASON_REMIND']; + break; + } + } + + // Posts in Queue + $sql = 'SELECT COUNT(post_id) as posts_in_queue + FROM ' . POSTS_TABLE . ' + WHERE poster_id = ' . $user_id . ' + AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)); + $result = $db->sql_query($sql); + $user_row['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue'); + $db->sql_freeresult($result); + + $sql = 'SELECT post_id + FROM ' . POSTS_TABLE . ' + WHERE poster_id = '. $user_id; + $result = $db->sql_query_limit($sql, 1); + $user_row['user_has_posts'] = (bool) $db->sql_fetchfield('post_id'); + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'L_NAME_CHARS_EXPLAIN' => $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_name_chars']), $user->lang('CHARACTERS', (int) $config['max_name_chars'])), + 'L_CHANGE_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])), + 'L_POSTS_IN_QUEUE' => $user->lang('NUM_POSTS_IN_QUEUE', $user_row['posts_in_queue']), + 'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false, + + 'S_OVERVIEW' => true, + 'S_USER_IP' => ($user_row['user_ip']) ? true : false, + 'S_USER_FOUNDER' => ($user_row['user_type'] == USER_FOUNDER) ? true : false, + 'S_ACTION_OPTIONS' => $s_action_options, + 'S_OWN_ACCOUNT' => ($user_id == $user->data['user_id']) ? true : false, + 'S_USER_INACTIVE' => ($user_row['user_type'] == USER_INACTIVE) ? true : false, + + 'U_SHOW_IP' => $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'), + 'U_WHOIS' => $this->u_action . "&action=whois&user_ip={$user_row['user_ip']}", + 'U_MCP_QUEUE' => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '', + 'U_SEARCH_USER' => ($config['load_search'] && $auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$user_row['user_id']}&sr=posts") : '', + + 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_row['user_id']}&hash=" . generate_link_hash('switchperm')) : '', + + 'POSTS_IN_QUEUE' => $user_row['posts_in_queue'], + 'USER' => $user_row['username'], + 'USER_REGISTERED' => $user->format_date($user_row['user_regdate']), + 'REGISTERED_IP' => ($ip == 'hostname') ? gethostbyaddr($user_row['user_ip']) : $user_row['user_ip'], + 'USER_LASTACTIVE' => ($last_active) ? $user->format_date($last_active) : ' - ', + 'USER_EMAIL' => $user_row['user_email'], + 'USER_WARNINGS' => $user_row['user_warnings'], + 'USER_POSTS' => $user_row['user_posts'], + 'USER_HAS_POSTS' => $user_row['user_has_posts'], + 'USER_INACTIVE_REASON' => $inactive_reason, + )); + + break; + + case 'feedback': + + $user->add_lang('mcp'); + + // Set up general vars + $start = request_var('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)); + $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'); + + // Delete entries if requested and able + if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) + { + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + $where_sql = ''; + if ($deletemark && $marked) + { + $sql_in = array(); + foreach ($marked as $mark) + { + $sql_in[] = $mark; + } + $where_sql = ' AND ' . $db->sql_in_set('log_id', $sql_in); + unset($sql_in); + } + + if ($where_sql || $deleteall) + { + $sql = 'DELETE FROM ' . LOG_TABLE . ' + WHERE log_type = ' . LOG_USERS . " + AND reportee_id = $user_id + $where_sql"; + $db->sql_query($sql); + + add_log('admin', 'LOG_CLEAR_USER', $user_row['username']); + } + } + + if ($submit && $message) + { + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&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); + + trigger_error($user->lang['USER_FEEDBACK_ADDED'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + + // 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']); + $sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']); + $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); + + $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); + + // Define where and sort sql for use in displaying logs + $sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0; + $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); + + // Grab log data + $log_data = array(); + $log_count = 0; + $start = view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort); + + $base_url = $this->u_action . "&u=$user_id&$u_sort_param"; + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $log_count, $config['topics_per_page'], $start); + + $template->assign_vars(array( + 'S_FEEDBACK' => true, + + 'S_LIMIT_DAYS' => $s_limit_days, + 'S_SORT_KEY' => $s_sort_key, + 'S_SORT_DIR' => $s_sort_dir, + 'S_CLEARLOGS' => $auth->acl_get('a_clearlogs')) + ); + + foreach ($log_data as $row) + { + $template->assign_block_vars('log', array( + 'USERNAME' => $row['username_full'], + 'IP' => $row['ip'], + 'DATE' => $user->format_date($row['time']), + 'ACTION' => nl2br($row['action']), + 'ID' => $row['id']) + ); + } + + break; + + case 'warnings': + $user->add_lang('mcp'); + + // Set up general vars + $start = request_var('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)); + + // Sort keys + $sort_days = request_var('st', 0); + $sort_key = request_var('sk', 't'); + $sort_dir = request_var('sd', 'd'); + + // Delete entries if requested and able + if ($deletemark || $deleteall || $confirm) + { + if (confirm_box(true)) + { + $where_sql = ''; + $deletemark = request_var('delmarked', 0); + $deleteall = request_var('delall', 0); + if ($deletemark && $marked) + { + $where_sql = ' AND ' . $db->sql_in_set('warning_id', array_values($marked)); + } + + if ($where_sql || $deleteall) + { + $sql = 'DELETE FROM ' . WARNINGS_TABLE . " + WHERE user_id = $user_id + $where_sql"; + $db->sql_query($sql); + + if ($deleteall) + { + $log_warnings = $deleted_warnings = 0; + } + else + { + $num_warnings = (int) $db->sql_affectedrows(); + $deleted_warnings = ' user_warnings - ' . $num_warnings; + $log_warnings = ($num_warnings > 2) ? 2 : $num_warnings; + } + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_warnings = $deleted_warnings + WHERE user_id = $user_id"; + $db->sql_query($sql); + + if ($log_warnings) + { + add_log('admin', 'LOG_WARNINGS_DELETED', $user_row['username'], $num_warnings); + } + else + { + add_log('admin', 'LOG_WARNINGS_DELETED_ALL', $user_row['username']); + } + } + } + else + { + $s_hidden_fields = array( + 'i' => $id, + 'mode' => $mode, + 'u' => $user_id, + 'mark' => $marked, + ); + if (isset($_POST['delmarked'])) + { + $s_hidden_fields['delmarked'] = 1; + } + if (isset($_POST['delall'])) + { + $s_hidden_fields['delall'] = 1; + } + if (isset($_POST['delall']) || (isset($_POST['delmarked']) && sizeof($marked))) + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields)); + } + } + } + + $sql = 'SELECT w.warning_id, w.warning_time, w.post_id, l.log_operation, l.log_data, l.user_id AS mod_user_id, m.username AS mod_username, m.user_colour AS mod_user_colour + FROM ' . WARNINGS_TABLE . ' w + LEFT JOIN ' . LOG_TABLE . ' l + ON (w.log_id = l.log_id) + LEFT JOIN ' . USERS_TABLE . ' m + ON (l.user_id = m.user_id) + WHERE w.user_id = ' . $user_id . ' + ORDER BY w.warning_time DESC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (!$row['log_operation']) + { + // We do not have a log-entry anymore, so there is no data available + $row['action'] = $user->lang['USER_WARNING_LOG_DELETED']; + } + else + { + $row['action'] = (isset($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}'; + if (!empty($row['log_data'])) + { + $log_data_ary = @unserialize($row['log_data']); + $log_data_ary = ($log_data_ary === false) ? array() : $log_data_ary; + + if (isset($user->lang[$row['log_operation']])) + { + // Check if there are more occurrences of % than arguments, if there are we fill out the arguments array + // It doesn't matter if we add more arguments than placeholders + if ((substr_count($row['action'], '%') - sizeof($log_data_ary)) > 0) + { + $log_data_ary = array_merge($log_data_ary, array_fill(0, substr_count($row['action'], '%') - sizeof($log_data_ary), '')); + } + $row['action'] = vsprintf($row['action'], $log_data_ary); + $row['action'] = bbcode_nl2br(censor_text($row['action'])); + } + else if (!empty($log_data_ary)) + { + $row['action'] .= '
' . implode('', $log_data_ary); + } + } + } + + $template->assign_block_vars('warn', array( + 'ID' => $row['warning_id'], + 'USERNAME' => ($row['log_operation']) ? get_username_string('full', $row['mod_user_id'], $row['mod_username'], $row['mod_user_colour']) : '-', + 'ACTION' => make_clickable($row['action']), + 'DATE' => $user->format_date($row['warning_time']), + )); + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'S_WARNINGS' => true, + )); + + break; + + case 'profile': + + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + $cp = $phpbb_container->get('profilefields.manager'); + + $cp_data = $cp_error = array(); + + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE . " + WHERE lang_iso = '" . $db->sql_escape($user->data['user_lang']) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $user_row['iso_lang_id'] = $row['lang_id']; + + $data = array( + 'jabber' => utf8_normalize_nfc(request_var('jabber', $user_row['user_jabber'], true)), + 'bday_day' => 0, + 'bday_month' => 0, + 'bday_year' => 0, + ); + + if ($user_row['user_birthday']) + { + 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['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']); + + if ($submit) + { + $error = validate_data($data, array( + 'jabber' => array( + array('string', true, 5, 255), + array('jabber')), + 'bday_day' => array('num', true, 1, 31), + 'bday_month' => array('num', true, 1, 12), + 'bday_year' => array('num', true, 1901, gmdate('Y', time())), + 'user_birthday' => array('date', true), + )); + + // validate custom profile fields + $cp->submit_cp_field('profile', $user_row['iso_lang_id'], $cp_data, $cp_error); + + if (sizeof($cp_error)) + { + $error = array_merge($error, $cp_error); + } + if (!check_form_key($form_name)) + { + $error[] = 'FORM_INVALID'; + } + + if (!sizeof($error)) + { + $sql_ary = array( + 'user_jabber' => $data['jabber'], + 'user_birthday' => $data['user_birthday'], + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE user_id = $user_id"; + $db->sql_query($sql); + + // Update Custom Fields + $cp->update_profile_field_data($user_id, $cp_data); + + trigger_error($user->lang['USER_PROFILE_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + + // Replace "error" strings with their real, localised form + $error = array_map(array($user, 'lang'), $error); + } + + $s_birthday_day_options = ''; + for ($i = 1; $i < 32; $i++) + { + $selected = ($i == $data['bday_day']) ? ' selected="selected"' : ''; + $s_birthday_day_options .= ""; + } + + $s_birthday_month_options = ''; + for ($i = 1; $i < 13; $i++) + { + $selected = ($i == $data['bday_month']) ? ' selected="selected"' : ''; + $s_birthday_month_options .= ""; + } + $s_birthday_year_options = ''; + + $now = getdate(); + $s_birthday_year_options = ''; + for ($i = $now['year'] - 100; $i <= $now['year']; $i++) + { + $selected = ($i == $data['bday_year']) ? ' selected="selected"' : ''; + $s_birthday_year_options .= ""; + } + unset($now); + + $template->assign_vars(array( + 'JABBER' => $data['jabber'], + 'S_BIRTHDAY_DAY_OPTIONS' => $s_birthday_day_options, + 'S_BIRTHDAY_MONTH_OPTIONS' => $s_birthday_month_options, + 'S_BIRTHDAY_YEAR_OPTIONS' => $s_birthday_year_options, + + 'S_PROFILE' => true) + ); + + // Get additional profile fields and assign them to the template block var 'profile_fields' + $user->get_profile_fields($user_id); + + $cp->generate_profile_fields('profile', $user_row['iso_lang_id']); + + break; + + case 'prefs': + + 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']), + ); + + /** + * Modify users preferences data + * + * @event core.acp_users_prefs_modify_data + * @var array data Array with users preferences data + * @var array user_row Array with user data + * @since 3.1.0-b3 + */ + $vars = array('data', 'user_row'); + extract($phpbb_dispatcher->trigger_event('core.acp_users_prefs_modify_data', compact($vars))); + + if ($submit) + { + $error = validate_data($data, array( + 'dateformat' => array('string', false, 1, 30), + 'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'), + 'tz' => array('timezone'), + + 'topic_sk' => array('string', false, 1, 1), + 'topic_sd' => array('string', false, 1, 1), + 'post_sk' => array('string', false, 1, 1), + 'post_sd' => array('string', false, 1, 1), + )); + + if (!check_form_key($form_name)) + { + $error[] = 'FORM_INVALID'; + } + + if (!sizeof($error)) + { + $this->optionset($user_row, 'viewimg', $data['view_images']); + $this->optionset($user_row, 'viewflash', $data['view_flash']); + $this->optionset($user_row, 'viewsmilies', $data['view_smilies']); + $this->optionset($user_row, 'viewsigs', $data['view_sigs']); + $this->optionset($user_row, 'viewavatars', $data['view_avatars']); + $this->optionset($user_row, 'viewcensors', $data['view_wordcensor']); + $this->optionset($user_row, 'bbcode', $data['bbcode']); + $this->optionset($user_row, 'smilies', $data['smilies']); + $this->optionset($user_row, 'attachsig', $data['sig']); + + $sql_ary = array( + 'user_options' => $user_row['user_options'], + + 'user_allow_pm' => $data['allowpm'], + 'user_allow_viewemail' => $data['viewemail'], + 'user_allow_massemail' => $data['massemail'], + 'user_allow_viewonline' => !$data['hideonline'], + 'user_notify_type' => $data['notifymethod'], + 'user_notify_pm' => $data['notifypm'], + + 'user_dateformat' => $data['dateformat'], + 'user_lang' => $data['lang'], + 'user_timezone' => $data['tz'], + 'user_style' => $data['style'], + + 'user_topic_sortby_type' => $data['topic_sk'], + 'user_post_sortby_type' => $data['post_sk'], + 'user_topic_sortby_dir' => $data['topic_sd'], + 'user_post_sortby_dir' => $data['post_sd'], + + 'user_topic_show_days' => $data['topic_st'], + 'user_post_show_days' => $data['post_st'], + + 'user_notify' => $data['notify'], + ); + + /** + * Modify SQL query before users preferences are updated + * + * @event core.acp_users_prefs_modify_sql + * @var array data Array with users preferences data + * @var array user_row Array with user data + * @var array sql_ary SQL array with users preferences data to update + * @var array error Array with errors data + * @since 3.1.0-b3 + */ + $vars = array('data', 'user_row', 'sql_ary', 'error'); + extract($phpbb_dispatcher->trigger_event('core.acp_users_prefs_modify_sql', compact($vars))); + + if (!sizeof($error)) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE user_id = $user_id"; + $db->sql_query($sql); + + // Check if user has an active session + if ($user_row['session_id']) + { + // We'll update the session if user_allow_viewonline has changed and the user is a bot + // Or if it's a regular user and the admin set it to hide the session + if ($user_row['user_allow_viewonline'] != $sql_ary['user_allow_viewonline'] && $user_row['user_type'] == USER_IGNORE + || $user_row['user_allow_viewonline'] && !$sql_ary['user_allow_viewonline']) + { + // We also need to check if the user has the permission to cloak. + $user_auth = new \phpbb\auth\auth(); + $user_auth->acl($user_row); + + $session_sql_ary = array( + 'session_viewonline' => ($user_auth->acl_get('u_hideonline')) ? $sql_ary['user_allow_viewonline'] : true, + ); + + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $session_sql_ary) . " + WHERE session_user_id = $user_id"; + $db->sql_query($sql); + + unset($user_auth); + } + } + + trigger_error($user->lang['USER_PREFS_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + } + + // Replace "error" strings with their real, localised form + $error = array_map(array($user, 'lang'), $error); + } + + $dateformat_options = ''; + foreach ($user->lang['dateformats'] as $format => $null) + { + $dateformat_options .= ''; + } + + $s_custom = false; + + $dateformat_options .= ''; + + $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); + + // Topic ordering options + $limit_topic_days = array(0 => $user->lang['ALL_TOPICS'], 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_topic_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']); + + // Post ordering options + $limit_post_days = array(0 => $user->lang['ALL_POSTS'], 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_post_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); + + $_options = array('topic', 'post'); + foreach ($_options as $sort_option) + { + ${'s_limit_' . $sort_option . '_days'} = ''; + + ${'s_sort_' . $sort_option . '_key'} = ''; + + ${'s_sort_' . $sort_option . '_dir'} = ''; + } + + phpbb_timezone_select($template, $user, $data['tz'], true); + $user_prefs_data = array( + 'S_PREFS' => true, + 'S_JABBER_DISABLED' => ($config['jab_enable'] && $user_row['user_jabber'] && @extension_loaded('xml')) ? false : true, + + 'VIEW_EMAIL' => $data['viewemail'], + 'MASS_EMAIL' => $data['massemail'], + 'ALLOW_PM' => $data['allowpm'], + 'HIDE_ONLINE' => $data['hideonline'], + 'NOTIFY_EMAIL' => ($data['notifymethod'] == NOTIFY_EMAIL) ? true : false, + 'NOTIFY_IM' => ($data['notifymethod'] == NOTIFY_IM) ? true : false, + 'NOTIFY_BOTH' => ($data['notifymethod'] == NOTIFY_BOTH) ? true : false, + 'NOTIFY_PM' => $data['notifypm'], + 'BBCODE' => $data['bbcode'], + 'SMILIES' => $data['smilies'], + 'ATTACH_SIG' => $data['sig'], + 'NOTIFY' => $data['notify'], + 'VIEW_IMAGES' => $data['view_images'], + 'VIEW_FLASH' => $data['view_flash'], + 'VIEW_SMILIES' => $data['view_smilies'], + 'VIEW_SIGS' => $data['view_sigs'], + 'VIEW_AVATARS' => $data['view_avatars'], + 'VIEW_WORDCENSOR' => $data['view_wordcensor'], + + 'S_TOPIC_SORT_DAYS' => $s_limit_topic_days, + 'S_TOPIC_SORT_KEY' => $s_sort_topic_key, + 'S_TOPIC_SORT_DIR' => $s_sort_topic_dir, + 'S_POST_SORT_DAYS' => $s_limit_post_days, + 'S_POST_SORT_KEY' => $s_sort_post_key, + 'S_POST_SORT_DIR' => $s_sort_post_dir, + + 'DATE_FORMAT' => $data['dateformat'], + 'S_DATEFORMAT_OPTIONS' => $dateformat_options, + 'S_CUSTOM_DATEFORMAT' => $s_custom, + 'DEFAULT_DATEFORMAT' => $config['default_dateformat'], + 'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']), + + 'S_LANG_OPTIONS' => language_select($data['lang']), + 'S_STYLE_OPTIONS' => style_select($data['style']), + ); + + /** + * Modify users preferences data before assigning it to the template + * + * @event core.acp_users_prefs_modify_template_data + * @var array data Array with users preferences data + * @var array user_row Array with user data + * @var array user_prefs_data Array with users preferences data to be assigned to the template + * @since 3.1.0-b3 + */ + $vars = array('data', 'user_row', 'user_prefs_data'); + extract($phpbb_dispatcher->trigger_event('core.acp_users_prefs_modify_template_data', compact($vars))); + + $template->assign_vars($user_prefs_data); + + break; + + case 'avatar': + + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + + $avatars_enabled = false; + + if ($config['allow_avatar']) + { + $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); + $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); + + // This is normalised data, without the user_ prefix + $avatar_data = \phpbb\avatar\manager::clean_row($user_row, 'user'); + + if ($submit) + { + if (check_form_key($form_name)) + { + $driver_name = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', '')); + + if (in_array($driver_name, $avatar_drivers) && !$request->is_set_post('avatar_delete')) + { + $driver = $phpbb_avatar_manager->get_driver($driver_name); + $result = $driver->process_form($request, $template, $user, $avatar_data, $error); + + if ($result && empty($error)) + { + // Success! Lets save the result in the database + $result = array( + 'user_avatar_type' => $driver_name, + 'user_avatar' => $result['avatar'], + 'user_avatar_width' => $result['avatar_width'], + 'user_avatar_height' => $result['avatar_height'], + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $result) . ' + WHERE user_id = ' . (int) $user_id; + + $db->sql_query($sql); + trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + } + } + else + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + } + + // Handle deletion of avatars + if ($request->is_set_post('avatar_delete')) + { + if (!confirm_box(true)) + { + confirm_box(false, $user->lang('CONFIRM_AVATAR_DELETE'), build_hidden_fields(array( + 'avatar_delete' => true)) + ); + } + else + { + $phpbb_avatar_manager->handle_avatar_delete($db, $user, $avatar_data, USERS_TABLE, 'user_'); + + trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + } + + $selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $user_row['user_avatar_type'])); + + foreach ($avatar_drivers as $current_driver) + { + $driver = $phpbb_avatar_manager->get_driver($current_driver); + + $avatars_enabled = true; + $config_name = $phpbb_avatar_manager->get_driver_config_name($driver); + $template->set_filenames(array( + 'avatar' => "acp_avatar_options_{$config_name}.html", + )); + + if ($driver->prepare_form($request, $template, $user, $avatar_data, $error)) + { + $driver_name = $phpbb_avatar_manager->prepare_driver_name($current_driver); + $driver_upper = strtoupper($driver_name); + + $template->assign_block_vars('avatar_drivers', array( + 'L_TITLE' => $user->lang($driver_upper . '_TITLE'), + 'L_EXPLAIN' => $user->lang($driver_upper . '_EXPLAIN'), + + 'DRIVER' => $driver_name, + 'SELECTED' => $current_driver == $selected_driver, + 'OUTPUT' => $template->assign_display('avatar'), + )); + } + } + } + + // Replace "error" strings with their real, localised form + $error = $phpbb_avatar_manager->localize_errors($user, $error); + + $avatar = phpbb_get_user_avatar($user_row, 'USER_AVATAR', true); + + $template->assign_vars(array( + 'S_AVATAR' => true, + 'ERROR' => (!empty($error)) ? implode('
', $error) : '', + 'AVATAR' => (empty($avatar) ? '' : $avatar), + + 'S_FORM_ENCTYPE' => ' enctype="multipart/form-data"', + + 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024), + + 'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled), + )); + + break; + + case 'rank': + + if ($submit) + { + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + $rank_id = request_var('user_rank', 0); + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_rank = $rank_id + WHERE user_id = $user_id"; + $db->sql_query($sql); + + trigger_error($user->lang['USER_RANK_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + + $sql = 'SELECT * + FROM ' . RANKS_TABLE . ' + WHERE rank_special = 1 + ORDER BY rank_title'; + $result = $db->sql_query($sql); + + $s_rank_options = ''; + + while ($row = $db->sql_fetchrow($result)) + { + $selected = ($user_row['user_rank'] && $row['rank_id'] == $user_row['user_rank']) ? ' selected="selected"' : ''; + $s_rank_options .= ''; + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'S_RANK' => true, + 'S_RANK_OPTIONS' => $s_rank_options) + ); + + break; + + 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)); + + $preview = (isset($_POST['preview'])) ? true : false; + + if ($submit || $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('
', $message_parser->warn_msg); + } + + if (!check_form_key($form_name)) + { + $error = 'FORM_INVALID'; + } + + if (!sizeof($error) && $submit) + { + $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_options' => $user_row['user_options'], + 'user_sig_bbcode_uid' => (string) $message_parser->bbcode_uid, + 'user_sig_bbcode_bitfield' => (string) $message_parser->bbcode_bitfield + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . $user_id; + $db->sql_query($sql); + + trigger_error($user->lang['USER_SIG_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + + // 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); + } + + decode_message($signature, $user_row['user_sig_bbcode_uid']); + + $template->assign_vars(array( + 'S_SIGNATURE' => true, + + 'SIGNATURE' => $signature, + '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'], '', '') : sprintf($user->lang['BBCODE_IS_OFF'], '', ''), + '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'], + 'URL_STATUS' => ($config['allow_sig_links']) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'], + + 'L_SIGNATURE_EXPLAIN' => $user->lang('SIGNATURE_EXPLAIN', (int) $config['max_sig_chars']), + + 'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'], + 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'], + 'S_BBCODE_IMG' => ($config['allow_sig_img']) ? true : false, + 'S_BBCODE_FLASH' => ($config['allow_sig_flash']) ? true : false, + 'S_LINKS_ALLOWED' => ($config['allow_sig_links']) ? true : false) + ); + + // Assigning custom bbcodes + display_custom_bbcodes(); + + break; + + case 'attach': + + $start = request_var('start', 0); + $deletemark = (isset($_POST['delmarked'])) ? true : false; + $marked = request_var('mark', array(0)); + $pagination = $phpbb_container->get('pagination'); + + // Sort keys + $sort_key = request_var('sk', 'a'); + $sort_dir = request_var('sd', 'd'); + + if ($deletemark && sizeof($marked)) + { + $sql = 'SELECT attach_id + FROM ' . ATTACHMENTS_TABLE . ' + WHERE poster_id = ' . $user_id . ' + AND is_orphan = 0 + AND ' . $db->sql_in_set('attach_id', $marked); + $result = $db->sql_query($sql); + + $marked = array(); + while ($row = $db->sql_fetchrow($result)) + { + $marked[] = $row['attach_id']; + } + $db->sql_freeresult($result); + } + + if ($deletemark && sizeof($marked)) + { + if (confirm_box(true)) + { + $sql = 'SELECT real_filename + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', $marked); + $result = $db->sql_query($sql); + + $log_attachments = array(); + while ($row = $db->sql_fetchrow($result)) + { + $log_attachments[] = $row['real_filename']; + } + $db->sql_freeresult($result); + + delete_attachments('attach', $marked); + + $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)); + trigger_error($message . adm_back_link($this->u_action . '&u=' . $user_id)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'u' => $user_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'delmarked' => true, + 'mark' => $marked)) + ); + } + } + + $sk_text = array('a' => $user->lang['SORT_FILENAME'], 'c' => $user->lang['SORT_EXTENSION'], 'd' => $user->lang['SORT_SIZE'], 'e' => $user->lang['SORT_DOWNLOADS'], 'f' => $user->lang['SORT_POST_TIME'], 'g' => $user->lang['SORT_TOPIC_TITLE']); + $sk_sql = array('a' => 'a.real_filename', 'c' => 'a.extension', 'd' => 'a.filesize', 'e' => 'a.download_count', 'f' => 'a.filetime', 'g' => 't.topic_title'); + + $sd_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); + + $s_sort_key = ''; + foreach ($sk_text as $key => $value) + { + $selected = ($sort_key == $key) ? ' selected="selected"' : ''; + $s_sort_key .= ''; + } + + $s_sort_dir = ''; + foreach ($sd_text as $key => $value) + { + $selected = ($sort_dir == $key) ? ' selected="selected"' : ''; + $s_sort_dir .= ''; + } + + if (!isset($sk_sql[$sort_key])) + { + $sort_key = 'a'; + } + + $order_by = $sk_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); + + $sql = 'SELECT COUNT(attach_id) as num_attachments + FROM ' . ATTACHMENTS_TABLE . " + WHERE poster_id = $user_id + AND is_orphan = 0"; + $result = $db->sql_query_limit($sql, 1); + $num_attachments = (int) $db->sql_fetchfield('num_attachments'); + $db->sql_freeresult($result); + + $sql = 'SELECT a.*, t.topic_title, p.message_subject as message_title + FROM ' . ATTACHMENTS_TABLE . ' a + LEFT JOIN ' . TOPICS_TABLE . ' t ON (a.topic_id = t.topic_id + AND a.in_message = 0) + LEFT JOIN ' . PRIVMSGS_TABLE . ' p ON (a.post_msg_id = p.msg_id + AND a.in_message = 1) + WHERE a.poster_id = ' . $user_id . " + AND a.is_orphan = 0 + ORDER BY $order_by"; + $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['in_message']) + { + $view_topic = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&p={$row['post_msg_id']}"); + } + else + { + $view_topic = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&p={$row['post_msg_id']}") . '#p' . $row['post_msg_id']; + } + + $template->assign_block_vars('attach', array( + 'REAL_FILENAME' => $row['real_filename'], + 'COMMENT' => nl2br($row['attach_comment']), + 'EXTENSION' => $row['extension'], + 'SIZE' => get_formatted_filesize($row['filesize']), + 'DOWNLOAD_COUNT' => $row['download_count'], + 'POST_TIME' => $user->format_date($row['filetime']), + 'TOPIC_TITLE' => ($row['in_message']) ? $row['message_title'] : $row['topic_title'], + + 'ATTACH_ID' => $row['attach_id'], + 'POST_ID' => $row['post_msg_id'], + 'TOPIC_ID' => $row['topic_id'], + + 'S_IN_MESSAGE' => $row['in_message'], + + 'U_DOWNLOAD' => append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&id=' . $row['attach_id']), + 'U_VIEW_TOPIC' => $view_topic) + ); + } + $db->sql_freeresult($result); + + $base_url = $this->u_action . "&u=$user_id&sk=$sort_key&sd=$sort_dir"; + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $num_attachments, $config['topics_per_page'], $start); + + $template->assign_vars(array( + 'S_ATTACHMENTS' => true, + 'S_SORT_KEY' => $s_sort_key, + 'S_SORT_DIR' => $s_sort_dir, + )); + + break; + + case 'groups': + + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + $user->add_lang(array('groups', 'acp/groups')); + $group_id = request_var('g', 0); + + if ($group_id) + { + // Check the founder only entry for this group to make sure everything is well + $sql = 'SELECT group_founder_manage + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . $group_id; + $result = $db->sql_query($sql); + $founder_manage = (int) $db->sql_fetchfield('group_founder_manage'); + $db->sql_freeresult($result); + + if ($user->data['user_type'] != USER_FOUNDER && $founder_manage) + { + trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + } + else + { + $founder_manage = 0; + } + + switch ($action) + { + case 'demote': + case 'promote': + case 'default': + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + group_user_attributes($action, $group_id, $user_id); + + if ($action == 'default') + { + $user_row['group_id'] = $group_id; + } + break; + + case 'delete': + + if (confirm_box(true)) + { + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($error = group_user_del($group_id, $user_id)) + { + trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + $error = array(); + + // The delete action was successful - therefore update the user row... + $sql = 'SELECT u.*, s.* + FROM ' . USERS_TABLE . ' u + LEFT JOIN ' . SESSIONS_TABLE . ' s ON (s.session_user_id = u.user_id) + WHERE u.user_id = ' . $user_id . ' + ORDER BY s.session_time DESC'; + $result = $db->sql_query_limit($sql, 1); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'u' => $user_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'g' => $group_id)) + ); + } + + break; + + case 'approve': + + if (confirm_box(true)) + { + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + group_user_attributes($action, $group_id, $user_id); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'u' => $user_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'g' => $group_id)) + ); + } + + break; + } + + // Add user to group? + if ($submit) + { + + if (!check_form_key($form_name)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + // Add user/s to group + if ($error = group_user_add($group_id, $user_id)) + { + trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + $error = array(); + } + + $sql = 'SELECT ug.*, g.* + FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . " ug + WHERE ug.user_id = $user_id + AND g.group_id = ug.group_id + ORDER BY g.group_type DESC, ug.user_pending ASC, g.group_name"; + $result = $db->sql_query($sql); + + $i = 0; + $group_data = $id_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $type = ($row['group_type'] == GROUP_SPECIAL) ? 'special' : (($row['user_pending']) ? 'pending' : 'normal'); + + $group_data[$type][$i]['group_id'] = $row['group_id']; + $group_data[$type][$i]['group_name'] = $row['group_name']; + $group_data[$type][$i]['group_leader'] = ($row['group_leader']) ? 1 : 0; + + $id_ary[] = $row['group_id']; + + $i++; + } + $db->sql_freeresult($result); + + // Select box for other groups + $sql = 'SELECT group_id, group_name, group_type, group_founder_manage + FROM ' . GROUPS_TABLE . ' + ' . ((sizeof($id_ary)) ? 'WHERE ' . $db->sql_in_set('group_id', $id_ary, true) : '') . ' + ORDER BY group_type DESC, group_name ASC'; + $result = $db->sql_query($sql); + + $s_group_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + if (!$config['coppa_enable'] && $row['group_name'] == 'REGISTERED_COPPA') + { + continue; + } + + // Do not display those groups not allowed to be managed + if ($user->data['user_type'] != USER_FOUNDER && $row['group_founder_manage']) + { + continue; + } + + $s_group_options .= '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; + } + $db->sql_freeresult($result); + + $current_type = ''; + foreach ($group_data as $group_type => $data_ary) + { + if ($current_type != $group_type) + { + $template->assign_block_vars('group', array( + 'S_NEW_GROUP_TYPE' => true, + 'GROUP_TYPE' => $user->lang['USER_GROUP_' . strtoupper($group_type)]) + ); + } + + foreach ($data_ary as $data) + { + $template->assign_block_vars('group', array( + 'U_EDIT_GROUP' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=groups&mode=manage&action=edit&u=$user_id&g={$data['group_id']}&back_link=acp_users_groups"), + 'U_DEFAULT' => $this->u_action . "&action=default&u=$user_id&g=" . $data['group_id'], + 'U_DEMOTE_PROMOTE' => $this->u_action . '&action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&u=$user_id&g=" . $data['group_id'], + 'U_DELETE' => $this->u_action . "&action=delete&u=$user_id&g=" . $data['group_id'], + 'U_APPROVE' => ($group_type == 'pending') ? $this->u_action . "&action=approve&u=$user_id&g=" . $data['group_id'] : '', + + 'GROUP_NAME' => ($group_type == 'special') ? $user->lang['G_' . $data['group_name']] : $data['group_name'], + 'L_DEMOTE_PROMOTE' => ($data['group_leader']) ? $user->lang['GROUP_DEMOTE'] : $user->lang['GROUP_PROMOTE'], + + 'S_IS_MEMBER' => ($group_type != 'pending') ? true : false, + 'S_NO_DEFAULT' => ($user_row['group_id'] != $data['group_id']) ? true : false, + 'S_SPECIAL_GROUP' => ($group_type == 'special') ? true : false, + ) + ); + } + } + + $template->assign_vars(array( + 'S_GROUPS' => true, + 'S_GROUP_OPTIONS' => $s_group_options) + ); + + break; + + case 'perm': + + include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx); + + $auth_admin = new auth_admin(); + + $user->add_lang('acp/permissions'); + add_permission_language(); + + $forum_id = request_var('f', 0); + + // Global Permissions + if (!$forum_id) + { + // Select auth options + $sql = 'SELECT auth_option, is_local, is_global + FROM ' . ACL_OPTIONS_TABLE . ' + WHERE auth_option ' . $db->sql_like_expression($db->get_any_char() . '_') . ' + AND is_global = 1 + ORDER BY auth_option'; + $result = $db->sql_query($sql); + + $hold_ary = array(); + + while ($row = $db->sql_fetchrow($result)) + { + $hold_ary = $auth_admin->get_mask('view', $user_id, false, false, $row['auth_option'], 'global', ACL_NEVER); + $auth_admin->display_mask('view', $row['auth_option'], $hold_ary, 'user', false, false); + } + $db->sql_freeresult($result); + + unset($hold_ary); + } + else + { + $sql = 'SELECT auth_option, is_local, is_global + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option " . $db->sql_like_expression($db->get_any_char() . '_') . " + AND is_local = 1 + ORDER BY is_global DESC, auth_option"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $hold_ary = $auth_admin->get_mask('view', $user_id, false, $forum_id, $row['auth_option'], 'local', ACL_NEVER); + $auth_admin->display_mask('view', $row['auth_option'], $hold_ary, 'user', true, false); + } + $db->sql_freeresult($result); + } + + $s_forum_options = ''; + $s_forum_options .= make_forum_select($forum_id, false, true, false, false, false); + + $template->assign_vars(array( + 'S_PERMISSIONS' => true, + + 'S_GLOBAL' => (!$forum_id) ? true : false, + 'S_FORUM_OPTIONS' => $s_forum_options, + + 'U_ACTION' => $this->u_action . '&u=' . $user_id, + 'U_USER_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx" ,'i=permissions&mode=setting_user_global&user_id[]=' . $user_id), + 'U_USER_FORUM_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions&mode=setting_user_local&user_id[]=' . $user_id)) + ); + + break; + + } + + // Assign general variables + $template->assign_vars(array( + 'S_ERROR' => (sizeof($error)) ? true : false, + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '') + ); + } + + /** + * Set option bit field for user options in a user row array. + * + * Optionset replacement for this module based on $user->optionset. + * + * @param array $user_row Row from the users table. + * @param int $key Option key, as defined in $user->keyoptions property. + * @param bool $value True to set the option, false to clear the option. + * @param int $data Current bit field value, or false to use $user_row['user_options'] + * @return int|bool If $data is false, the bit field is modified and + * written back to $user_row['user_options'], and + * return value is true if the bit field changed and + * false otherwise. If $data is not false, the new + * bitfield value is returned. + */ + function optionset(&$user_row, $key, $value, $data = false) + { + global $user; + + $var = ($data !== false) ? $data : $user_row['user_options']; + + $new_var = phpbb_optionset($user->keyoptions[$key], $value, $var); + + if ($data === false) + { + if ($new_var != $var) + { + $user_row['user_options'] = $new_var; + return true; + } + else + { + return false; + } + } + else + { + return $new_var; + } + } + + /** + * Get option bit field from user options in a user row array. + * + * Optionget replacement for this module based on $user->optionget. + * + * @param array $user_row Row from the users table. + * @param int $key option key, as defined in $user->keyoptions property. + * @param int $data bit field value to use, or false to use $user_row['user_options'] + * @return bool true if the option is set in the bit field, false otherwise + */ + function optionget(&$user_row, $key, $data = false) + { + global $user; + + $var = ($data !== false) ? $data : $user_row['user_options']; + return phpbb_optionget($user->keyoptions[$key], $var); + } +} diff --git a/sources/phpBB/includes/acp/acp_words.php b/sources/phpBB/includes/acp/acp_words.php new file mode 100644 index 0000000..272d38b --- /dev/null +++ b/sources/phpBB/includes/acp/acp_words.php @@ -0,0 +1,189 @@ + +* @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; +} + +/** +* @todo [words] check regular expressions for special char replacements (stored specialchared in db) +*/ +class acp_words +{ + var $u_action; + + function main($id, $mode) + { + global $db, $user, $auth, $template, $cache; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $user->add_lang('acp/posting'); + + // Set up general vars + $action = request_var('action', ''); + $action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['save'])) ? 'save' : $action); + + $s_hidden_fields = ''; + $word_info = array(); + + $this->tpl_name = 'acp_words'; + $this->page_title = 'ACP_WORDS'; + + $form_name = 'acp_words'; + add_form_key($form_name); + + switch ($action) + { + case 'edit': + + $word_id = request_var('id', 0); + + if (!$word_id) + { + trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql = 'SELECT * + FROM ' . WORDS_TABLE . " + WHERE word_id = $word_id"; + $result = $db->sql_query($sql); + $word_info = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $s_hidden_fields .= ''; + + case 'add': + + $template->assign_vars(array( + 'S_EDIT_WORD' => true, + 'U_ACTION' => $this->u_action, + 'U_BACK' => $this->u_action, + 'WORD' => (isset($word_info['word'])) ? $word_info['word'] : '', + 'REPLACEMENT' => (isset($word_info['replacement'])) ? $word_info['replacement'] : '', + 'S_HIDDEN_FIELDS' => $s_hidden_fields) + ); + + return; + + break; + + case 'save': + + if (!check_form_key($form_name)) + { + 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)); + + if ($word === '' || $replacement === '') + { + trigger_error($user->lang['ENTER_WORD'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Replace multiple consecutive asterisks with single one as those are not needed + $word = preg_replace('#\*{2,}#', '*', $word); + + $sql_ary = array( + 'word' => $word, + 'replacement' => $replacement + ); + + if ($word_id) + { + $db->sql_query('UPDATE ' . WORDS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE word_id = ' . $word_id); + } + else + { + $db->sql_query('INSERT INTO ' . WORDS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + } + + $cache->destroy('_word_censors'); + + $log_action = ($word_id) ? 'LOG_WORD_EDIT' : 'LOG_WORD_ADD'; + add_log('admin', $log_action, $word); + + $message = ($word_id) ? $user->lang['WORD_UPDATED'] : $user->lang['WORD_ADDED']; + trigger_error($message . adm_back_link($this->u_action)); + + break; + + case 'delete': + + $word_id = request_var('id', 0); + + if (!$word_id) + { + trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (confirm_box(true)) + { + $sql = 'SELECT word + FROM ' . WORDS_TABLE . " + WHERE word_id = $word_id"; + $result = $db->sql_query($sql); + $deleted_word = $db->sql_fetchfield('word'); + $db->sql_freeresult($result); + + $sql = 'DELETE FROM ' . WORDS_TABLE . " + WHERE word_id = $word_id"; + $db->sql_query($sql); + + $cache->destroy('_word_censors'); + + add_log('admin', 'LOG_WORD_DELETE', $deleted_word); + + trigger_error($user->lang['WORD_REMOVED'] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'id' => $word_id, + 'action' => 'delete', + ))); + } + + break; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'S_HIDDEN_FIELDS' => $s_hidden_fields) + ); + + $sql = 'SELECT * + FROM ' . WORDS_TABLE . ' + ORDER BY word'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('words', array( + 'WORD' => $row['word'], + 'REPLACEMENT' => $row['replacement'], + 'U_EDIT' => $this->u_action . '&action=edit&id=' . $row['word_id'], + 'U_DELETE' => $this->u_action . '&action=delete&id=' . $row['word_id']) + ); + } + $db->sql_freeresult($result); + } +} diff --git a/sources/phpBB/includes/acp/auth.php b/sources/phpBB/includes/acp/auth.php new file mode 100644 index 0000000..905e981 --- /dev/null +++ b/sources/phpBB/includes/acp/auth.php @@ -0,0 +1,1284 @@ + +* @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; +} + +/** +* ACP Permission/Auth class +*/ +class auth_admin extends \phpbb\auth\auth +{ + /** + * Init auth settings + */ + function auth_admin() + { + global $db, $cache; + + if (($this->acl_options = $cache->get('_acl_options')) === false) + { + $sql = 'SELECT auth_option_id, auth_option, is_global, is_local + FROM ' . ACL_OPTIONS_TABLE . ' + ORDER BY auth_option_id'; + $result = $db->sql_query($sql); + + $global = $local = 0; + $this->acl_options = array(); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['is_global']) + { + $this->acl_options['global'][$row['auth_option']] = $global++; + } + + if ($row['is_local']) + { + $this->acl_options['local'][$row['auth_option']] = $local++; + } + + $this->acl_options['id'][$row['auth_option']] = (int) $row['auth_option_id']; + $this->acl_options['option'][(int) $row['auth_option_id']] = $row['auth_option']; + } + $db->sql_freeresult($result); + + $cache->put('_acl_options', $this->acl_options); + } + } + + /** + * Get permission mask + * This function only supports getting permissions of one type (for example a_) + * + * @param set|view $mode defines the permissions we get, view gets effective permissions (checking user AND group permissions), set only gets the user or group permission set alone + * @param mixed $user_id user ids to search for (a user_id or a group_id has to be specified at least) + * @param mixed $group_id group ids to search for, return group related settings (a user_id or a group_id has to be specified at least) + * @param mixed $forum_id forum_ids to search for. Defining a forum id also means getting local settings + * @param string $auth_option the auth_option defines the permission setting to look for (a_ for example) + * @param local|global $scope the scope defines the permission scope. If local, a forum_id is additionally required + * @param ACL_NEVER|ACL_NO|ACL_YES $acl_fill defines the mode those permissions not set are getting filled with + */ + function get_mask($mode, $user_id = false, $group_id = false, $forum_id = false, $auth_option = false, $scope = false, $acl_fill = ACL_NEVER) + { + global $db, $user; + + $hold_ary = array(); + $view_user_mask = ($mode == 'view' && $group_id === false) ? true : false; + + if ($auth_option === false || $scope === false) + { + return array(); + } + + $acl_user_function = ($mode == 'set') ? 'acl_user_raw_data' : 'acl_raw_data'; + + if (!$view_user_mask) + { + if ($forum_id !== false) + { + $hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, $auth_option . '%', $forum_id) : $this->$acl_user_function($user_id, $auth_option . '%', $forum_id); + } + else + { + $hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, $auth_option . '%', ($scope == 'global') ? 0 : false) : $this->$acl_user_function($user_id, $auth_option . '%', ($scope == 'global') ? 0 : false); + } + } + + // Make sure hold_ary is filled with every setting (prevents missing forums/users/groups) + $ug_id = ($group_id !== false) ? ((!is_array($group_id)) ? array($group_id) : $group_id) : ((!is_array($user_id)) ? array($user_id) : $user_id); + $forum_ids = ($forum_id !== false) ? ((!is_array($forum_id)) ? array($forum_id) : $forum_id) : (($scope == 'global') ? array(0) : array()); + + // Only those options we need + $compare_options = array_diff(preg_replace('/^((?!' . $auth_option . ').+)|(' . $auth_option . ')$/', '', array_keys($this->acl_options[$scope])), array('')); + + // If forum_ids is false and the scope is local we actually want to have all forums within the array + if ($scope == 'local' && !sizeof($forum_ids)) + { + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE; + $result = $db->sql_query($sql, 120); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_ids[] = (int) $row['forum_id']; + } + $db->sql_freeresult($result); + } + + if ($view_user_mask) + { + $auth2 = null; + + $sql = 'SELECT user_id, user_permissions, user_type + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $ug_id); + $result = $db->sql_query($sql); + + while ($userdata = $db->sql_fetchrow($result)) + { + if ($user->data['user_id'] != $userdata['user_id']) + { + $auth2 = new \phpbb\auth\auth(); + $auth2->acl($userdata); + } + else + { + global $auth; + $auth2 = &$auth; + } + + $hold_ary[$userdata['user_id']] = array(); + foreach ($forum_ids as $f_id) + { + $hold_ary[$userdata['user_id']][$f_id] = array(); + foreach ($compare_options as $option) + { + $hold_ary[$userdata['user_id']][$f_id][$option] = $auth2->acl_get($option, $f_id); + } + } + } + $db->sql_freeresult($result); + + unset($userdata); + unset($auth2); + } + + foreach ($ug_id as $_id) + { + if (!isset($hold_ary[$_id])) + { + $hold_ary[$_id] = array(); + } + + foreach ($forum_ids as $f_id) + { + if (!isset($hold_ary[$_id][$f_id])) + { + $hold_ary[$_id][$f_id] = array(); + } + } + } + + // Now, we need to fill the gaps with $acl_fill. ;) + + // Now switch back to keys + if (sizeof($compare_options)) + { + $compare_options = array_combine($compare_options, array_fill(1, sizeof($compare_options), $acl_fill)); + } + + // Defining the user-function here to save some memory + $return_acl_fill = function () use ($acl_fill) + { + return $acl_fill; + }; + + // Actually fill the gaps + if (sizeof($hold_ary)) + { + foreach ($hold_ary as $ug_id => $row) + { + foreach ($row as $id => $options) + { + // Do not include the global auth_option + unset($options[$auth_option]); + + // Not a "fine" solution, but at all it's a 1-dimensional + // array_diff_key function filling the resulting array values with zeros + // The differences get merged into $hold_ary (all permissions having $acl_fill set) + $hold_ary[$ug_id][$id] = array_merge($options, + + array_map($return_acl_fill, + array_flip( + array_diff( + array_keys($compare_options), array_keys($options) + ) + ) + ) + ); + } + } + } + else + { + $hold_ary[($group_id !== false) ? $group_id : $user_id][(int) $forum_id] = $compare_options; + } + + return $hold_ary; + } + + /** + * Get permission mask for roles + * This function only supports getting masks for one role + */ + function get_role_mask($role_id) + { + global $db; + + $hold_ary = array(); + + // Get users having this role set... + $sql = 'SELECT user_id, forum_id + FROM ' . ACL_USERS_TABLE . ' + WHERE auth_role_id = ' . $role_id . ' + ORDER BY forum_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $hold_ary[$row['forum_id']]['users'][] = $row['user_id']; + } + $db->sql_freeresult($result); + + // Now grab groups... + $sql = 'SELECT group_id, forum_id + FROM ' . ACL_GROUPS_TABLE . ' + WHERE auth_role_id = ' . $role_id . ' + ORDER BY forum_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $hold_ary[$row['forum_id']]['groups'][] = $row['group_id']; + } + $db->sql_freeresult($result); + + return $hold_ary; + } + + /** + * Display permission mask (assign to template) + */ + 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; + $phpbb_permissions = $phpbb_container->get('acl.permissions'); + + // Define names for template loops, might be able to be set + $tpl_pmask = 'p_mask'; + $tpl_fmask = 'f_mask'; + $tpl_category = 'category'; + $tpl_mask = 'mask'; + + $l_acl_type = $phpbb_permissions->get_type_lang($permission_type, (($local) ? 'local' : 'global')); + + // Allow trace for viewing permissions and in user mode + $show_trace = ($mode == 'view' && $user_mode == 'user') ? true : false; + + // Get names + if ($user_mode == 'user') + { + $sql = 'SELECT user_id as ug_id, username as ug_name + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', array_keys($hold_ary)) . ' + ORDER BY username_clean ASC'; + } + else + { + $sql = 'SELECT group_id as ug_id, group_name as ug_name, group_type + FROM ' . GROUPS_TABLE . ' + WHERE ' . $db->sql_in_set('group_id', array_keys($hold_ary)) . ' + ORDER BY group_type DESC, group_name ASC'; + } + $result = $db->sql_query($sql); + + $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']); + } + $db->sql_freeresult($result); + + // Get used forums + $forum_ids = array(); + foreach ($hold_ary as $ug_id => $row) + { + $forum_ids = array_merge($forum_ids, array_keys($row)); + } + $forum_ids = array_unique($forum_ids); + + $forum_names_ary = array(); + if ($local) + { + $forum_names_ary = make_forum_select(false, false, true, false, false, false, true); + + // Remove the disabled ones, since we do not create an option field here... + foreach ($forum_names_ary as $key => $value) + { + if (!$value['disabled']) + { + continue; + } + unset($forum_names_ary[$key]); + } + } + else + { + $forum_names_ary[0] = $l_acl_type; + } + + // Get available roles + $sql = 'SELECT * + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = '" . $db->sql_escape($permission_type) . "' + ORDER BY role_order ASC"; + $result = $db->sql_query($sql); + + $roles = array(); + while ($row = $db->sql_fetchrow($result)) + { + $roles[$row['role_id']] = $row; + } + $db->sql_freeresult($result); + + $cur_roles = $this->acl_role_data($user_mode, $permission_type, array_keys($hold_ary)); + + // Build js roles array (role data assignments) + $s_role_js_array = ''; + + if (sizeof($roles)) + { + $s_role_js_array = array(); + + // Make sure every role (even if empty) has its array defined + foreach ($roles as $_role_id => $null) + { + $s_role_js_array[$_role_id] = "\n" . 'role_options[' . $_role_id . '] = new Array();' . "\n"; + } + + $sql = 'SELECT r.role_id, o.auth_option, r.auth_setting + FROM ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' o + WHERE o.auth_option_id = r.auth_option_id + AND ' . $db->sql_in_set('r.role_id', array_keys($roles)); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $flag = substr($row['auth_option'], 0, strpos($row['auth_option'], '_') + 1); + if ($flag == $row['auth_option']) + { + continue; + } + + $s_role_js_array[$row['role_id']] .= 'role_options[' . $row['role_id'] . '][\'' . addslashes($row['auth_option']) . '\'] = ' . $row['auth_setting'] . '; '; + } + $db->sql_freeresult($result); + + $s_role_js_array = implode('', $s_role_js_array); + } + + $template->assign_var('S_ROLE_JS_ARRAY', $s_role_js_array); + unset($s_role_js_array); + + // Now obtain memberships + $user_groups_default = $user_groups_custom = array(); + if ($user_mode == 'user' && $group_display) + { + $sql = 'SELECT group_id, group_name, group_type + FROM ' . GROUPS_TABLE . ' + ORDER BY group_type DESC, group_name ASC'; + $result = $db->sql_query($sql); + + $groups = array(); + while ($row = $db->sql_fetchrow($result)) + { + $groups[$row['group_id']] = $row; + } + $db->sql_freeresult($result); + + $memberships = group_memberships(false, array_keys($hold_ary), false); + + // User is not a member of any group? Bad admin, bad bad admin... + if ($memberships) + { + 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']; + } + } + } + unset($memberships, $groups); + } + + // If we only have one forum id to display or being in local mode and more than one user/group to display, + // we switch the complete interface to group by user/usergroup instead of grouping by forum + // To achieve this, we need to switch the array a bit + if (sizeof($forum_ids) == 1 || ($local && sizeof($ug_names_ary) > 1)) + { + $hold_ary_temp = $hold_ary; + $hold_ary = array(); + foreach ($hold_ary_temp as $ug_id => $row) + { + foreach ($forum_names_ary as $forum_id => $forum_row) + { + if (isset($row[$forum_id])) + { + $hold_ary[$forum_id][$ug_id] = $row[$forum_id]; + } + } + } + unset($hold_ary_temp); + + foreach ($hold_ary as $forum_id => $forum_array) + { + $content_array = $categories = array(); + $this->build_permission_array($hold_ary[$forum_id], $content_array, $categories, array_keys($ug_names_ary)); + + $template->assign_block_vars($tpl_pmask, 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'], + + 'CATEGORIES' => implode('
', $categories), + + 'L_ACL_TYPE' => $l_acl_type, + + 'S_LOCAL' => ($local) ? true : false, + 'S_GLOBAL' => (!$local) ? true : false, + 'S_NUM_CATS' => sizeof($categories), + 'S_VIEW' => ($mode == 'view') ? true : false, + 'S_NUM_OBJECTS' => sizeof($content_array), + 'S_USER_MODE' => ($user_mode == 'user') ? true : false, + 'S_GROUP_MODE' => ($user_mode == 'group') ? true : false) + ); + + @reset($content_array); + while (list($ug_id, $ug_array) = each($content_array)) + { + // Build role dropdown options + $current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0; + + $s_role_options = ''; + + @reset($roles); + while (list($role_id, $role_row) = each($roles)) + { + $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 .= ''; + } + + if ($s_role_options) + { + $s_role_options = '' . $s_role_options; + } + + if (!$current_role_id && $mode != 'view') + { + $s_custom_permissions = false; + + foreach ($ug_array as $key => $value) + { + if ($value['S_NEVER'] || $value['S_YES']) + { + $s_custom_permissions = true; + break; + } + } + } + else + { + $s_custom_permissions = false; + } + + $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) + ); + + $this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, ($mode == 'view'), $show_trace); + + unset($content_array[$ug_id]); + } + + unset($hold_ary[$forum_id]); + } + } + else + { + foreach ($ug_names_ary as $ug_id => $ug_name) + { + if (!isset($hold_ary[$ug_id])) + { + continue; + } + + $content_array = $categories = array(); + $this->build_permission_array($hold_ary[$ug_id], $content_array, $categories, array_keys($forum_names_ary)); + + $template->assign_block_vars($tpl_pmask, array( + 'NAME' => $ug_name, + 'CATEGORIES' => implode('', $categories), + + 'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_default[$ug_id]) : '', + 'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_custom[$ug_id]) : '', + 'L_ACL_TYPE' => $l_acl_type, + + 'S_LOCAL' => ($local) ? true : false, + 'S_GLOBAL' => (!$local) ? true : false, + 'S_NUM_CATS' => sizeof($categories), + 'S_VIEW' => ($mode == 'view') ? true : false, + 'S_NUM_OBJECTS' => sizeof($content_array), + 'S_USER_MODE' => ($user_mode == 'user') ? true : false, + 'S_GROUP_MODE' => ($user_mode == 'group') ? true : false) + ); + + @reset($content_array); + while (list($forum_id, $forum_array) = each($content_array)) + { + // Build role dropdown options + $current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0; + + $s_role_options = ''; + + @reset($roles); + while (list($role_id, $role_row) = each($roles)) + { + $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 .= ''; + } + + if ($s_role_options) + { + $s_role_options = '' . $s_role_options; + } + + if (!$current_role_id && $mode != 'view') + { + $s_custom_permissions = false; + + foreach ($forum_array as $key => $value) + { + if ($value['S_NEVER'] || $value['S_YES']) + { + $s_custom_permissions = true; + break; + } + } + } + else + { + $s_custom_permissions = false; + } + + $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) + ); + + $this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, ($mode == 'view'), $show_trace); + } + + unset($hold_ary[$ug_id], $ug_names_ary[$ug_id]); + } + } + } + + /** + * Display permission mask for roles + */ + function display_role_mask(&$hold_ary) + { + global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + if (!sizeof($hold_ary)) + { + return; + } + + // Get forum names + $sql = 'SELECT forum_id, forum_name + FROM ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', array_keys($hold_ary)) . ' + ORDER BY left_id'; + $result = $db->sql_query($sql); + + // If the role is used globally, then reflect that + $forum_names = (isset($hold_ary[0])) ? array(0 => '') : array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_names[$row['forum_id']] = $row['forum_name']; + } + $db->sql_freeresult($result); + + foreach ($forum_names as $forum_id => $forum_name) + { + $auth_ary = $hold_ary[$forum_id]; + + $template->assign_block_vars('role_mask', array( + 'NAME' => ($forum_id == 0) ? $user->lang['GLOBAL_MASK'] : $forum_name, + 'FORUM_ID' => $forum_id) + ); + + if (isset($auth_ary['users']) && sizeof($auth_ary['users'])) + { + $sql = 'SELECT user_id, username + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $auth_ary['users']) . ' + ORDER BY username_clean ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('role_mask.users', array( + 'USER_ID' => $row['user_id'], + 'USERNAME' => get_username_string('username', $row['user_id'], $row['username']), + 'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username']), + )); + } + $db->sql_freeresult($result); + } + + if (isset($auth_ary['groups']) && sizeof($auth_ary['groups'])) + { + $sql = 'SELECT group_id, group_name, group_type + FROM ' . GROUPS_TABLE . ' + WHERE ' . $db->sql_in_set('group_id', $auth_ary['groups']) . ' + ORDER BY group_type ASC, group_name'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $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'], + 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=group&g={$row['group_id']}")) + ); + } + $db->sql_freeresult($result); + } + } + } + + /** + * NOTE: this function is not in use atm + * Add a new option to the list ... $options is a hash of form -> + * $options = array( + * 'local' => array('option1', 'option2', ...), + * 'global' => array('optionA', 'optionB', ...) + * ); + */ + function acl_add_option($options) + { + global $db, $cache; + + if (!is_array($options)) + { + return false; + } + + $cur_options = array(); + + // Determine current options + $sql = 'SELECT auth_option, is_global, is_local + FROM ' . ACL_OPTIONS_TABLE . ' + ORDER BY auth_option_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $cur_options[$row['auth_option']] = ($row['is_global'] && $row['is_local']) ? 'both' : (($row['is_global']) ? 'global' : 'local'); + } + $db->sql_freeresult($result); + + // Here we need to insert new options ... this requires discovering whether + // an options is global, local or both and whether we need to add an permission + // set flag (x_) + $new_options = array('local' => array(), 'global' => array()); + + foreach ($options as $type => $option_ary) + { + $option_ary = array_unique($option_ary); + + foreach ($option_ary as $option_value) + { + $new_options[$type][] = $option_value; + + $flag = substr($option_value, 0, strpos($option_value, '_') + 1); + + if (!in_array($flag, $new_options[$type])) + { + $new_options[$type][] = $flag; + } + } + } + unset($options); + + $options = array(); + $options['local'] = array_diff($new_options['local'], $new_options['global']); + $options['global'] = array_diff($new_options['global'], $new_options['local']); + $options['both'] = array_intersect($new_options['local'], $new_options['global']); + + // Now check which options to add/update + $add_options = $update_options = array(); + + // First local ones... + foreach ($options as $type => $option_ary) + { + foreach ($option_ary as $option) + { + if (!isset($cur_options[$option])) + { + $add_options[] = array( + 'auth_option' => (string) $option, + 'is_global' => ($type == 'global' || $type == 'both') ? 1 : 0, + 'is_local' => ($type == 'local' || $type == 'both') ? 1 : 0 + ); + + continue; + } + + // Else, update existing entry if it is changed... + if ($type === $cur_options[$option]) + { + continue; + } + + // New type is always both: + // If is now both, we set both. + // If it was global the new one is local and we need to set it to both + // If it was local the new one is global and we need to set it to both + $update_options[] = $option; + } + } + + if (!empty($add_options)) + { + $db->sql_multi_insert(ACL_OPTIONS_TABLE, $add_options); + } + + if (!empty($update_options)) + { + $sql = 'UPDATE ' . ACL_OPTIONS_TABLE . ' + SET is_global = 1, is_local = 1 + WHERE ' . $db->sql_in_set('auth_option', $update_options); + $db->sql_query($sql); + } + + $cache->destroy('_acl_options'); + $this->acl_clear_prefetch(); + + // Because we just changed the options and also purged the options cache, we instantly update/regenerate it for later calls to succeed. + $this->acl_options = array(); + $this->auth_admin(); + + return true; + } + + /** + * Set a user or group ACL record + */ + function acl_set($ug_type, $forum_id, $ug_id, $auth, $role_id = 0, $clear_prefetch = true) + { + global $db; + + // One or more forums + if (!is_array($forum_id)) + { + $forum_id = array($forum_id); + } + + // One or more users + if (!is_array($ug_id)) + { + $ug_id = array($ug_id); + } + + $ug_id_sql = $db->sql_in_set($ug_type . '_id', array_map('intval', $ug_id)); + $forum_sql = $db->sql_in_set('forum_id', array_map('intval', $forum_id)); + + // Instead of updating, inserting, removing we just remove all current settings and re-set everything... + $table = ($ug_type == 'user') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE; + $id_field = $ug_type . '_id'; + + // Get any flags as required + reset($auth); + $flag = key($auth); + $flag = substr($flag, 0, strpos($flag, '_') + 1); + + // This ID (the any-flag) is set if one or more permissions are true... + $any_option_id = (int) $this->acl_options['id'][$flag]; + + // Remove any-flag from auth ary + if (isset($auth[$flag])) + { + unset($auth[$flag]); + } + + // Remove current auth options... + $auth_option_ids = array((int) $any_option_id); + foreach ($auth as $auth_option => $auth_setting) + { + $auth_option_ids[] = (int) $this->acl_options['id'][$auth_option]; + } + + $sql = "DELETE FROM $table + WHERE $forum_sql + AND $ug_id_sql + AND " . $db->sql_in_set('auth_option_id', $auth_option_ids); + $db->sql_query($sql); + + // Remove those having a role assigned... the correct type of course... + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = '" . $db->sql_escape($flag) . "'"; + $result = $db->sql_query($sql); + + $role_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $role_ids[] = $row['role_id']; + } + $db->sql_freeresult($result); + + if (sizeof($role_ids)) + { + $sql = "DELETE FROM $table + WHERE $forum_sql + AND $ug_id_sql + AND auth_option_id = 0 + AND " . $db->sql_in_set('auth_role_id', $role_ids); + $db->sql_query($sql); + } + + // Ok, include the any-flag if one or more auth options are set to yes... + foreach ($auth as $auth_option => $setting) + { + if ($setting == ACL_YES && (!isset($auth[$flag]) || $auth[$flag] == ACL_NEVER)) + { + $auth[$flag] = ACL_YES; + } + } + + $sql_ary = array(); + foreach ($forum_id as $forum) + { + $forum = (int) $forum; + + if ($role_id) + { + foreach ($ug_id as $id) + { + $sql_ary[] = array( + $id_field => (int) $id, + 'forum_id' => (int) $forum, + 'auth_option_id' => 0, + 'auth_setting' => 0, + 'auth_role_id' => (int) $role_id, + ); + } + } + else + { + foreach ($auth as $auth_option => $setting) + { + $auth_option_id = (int) $this->acl_options['id'][$auth_option]; + + if ($setting != ACL_NO) + { + foreach ($ug_id as $id) + { + $sql_ary[] = array( + $id_field => (int) $id, + 'forum_id' => (int) $forum, + 'auth_option_id' => (int) $auth_option_id, + 'auth_setting' => (int) $setting + ); + } + } + } + } + } + + $db->sql_multi_insert($table, $sql_ary); + + if ($clear_prefetch) + { + $this->acl_clear_prefetch(); + } + } + + /** + * Set a role-specific ACL record + */ + function acl_set_role($role_id, $auth) + { + global $db; + + // Get any-flag as required + reset($auth); + $flag = key($auth); + $flag = substr($flag, 0, strpos($flag, '_') + 1); + + // Remove any-flag from auth ary + if (isset($auth[$flag])) + { + unset($auth[$flag]); + } + + // Re-set any flag... + foreach ($auth as $auth_option => $setting) + { + if ($setting == ACL_YES && (!isset($auth[$flag]) || $auth[$flag] == ACL_NEVER)) + { + $auth[$flag] = ACL_YES; + } + } + + $sql_ary = array(); + foreach ($auth as $auth_option => $setting) + { + $auth_option_id = (int) $this->acl_options['id'][$auth_option]; + + if ($setting != ACL_NO) + { + $sql_ary[] = array( + 'role_id' => (int) $role_id, + 'auth_option_id' => (int) $auth_option_id, + 'auth_setting' => (int) $setting + ); + } + } + + // If no data is there, we set the any-flag to ACL_NEVER... + if (!sizeof($sql_ary)) + { + $sql_ary[] = array( + 'role_id' => (int) $role_id, + 'auth_option_id' => (int) $this->acl_options['id'][$flag], + 'auth_setting' => ACL_NEVER + ); + } + + // Remove current auth options... + $sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . ' + WHERE role_id = ' . $role_id; + $db->sql_query($sql); + + // Now insert the new values + $db->sql_multi_insert(ACL_ROLES_DATA_TABLE, $sql_ary); + + $this->acl_clear_prefetch(); + } + + /** + * Remove local permission + */ + function acl_delete($mode, $ug_id = false, $forum_id = false, $permission_type = false) + { + global $db; + + if ($ug_id === false && $forum_id === false) + { + return; + } + + $option_id_ary = array(); + $table = ($mode == 'user') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE; + $id_field = $mode . '_id'; + + $where_sql = array(); + + if ($forum_id !== false) + { + $where_sql[] = (!is_array($forum_id)) ? 'forum_id = ' . (int) $forum_id : $db->sql_in_set('forum_id', array_map('intval', $forum_id)); + } + + if ($ug_id !== false) + { + $where_sql[] = (!is_array($ug_id)) ? $id_field . ' = ' . (int) $ug_id : $db->sql_in_set($id_field, array_map('intval', $ug_id)); + } + + // There seem to be auth options involved, therefore we need to go through the list and make sure we capture roles correctly + if ($permission_type !== false) + { + // Get permission type + $sql = 'SELECT auth_option, auth_option_id + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()); + $result = $db->sql_query($sql); + + $auth_id_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $option_id_ary[] = $row['auth_option_id']; + $auth_id_ary[$row['auth_option']] = ACL_NO; + } + $db->sql_freeresult($result); + + // First of all, lets grab the items having roles with the specified auth options assigned + $sql = "SELECT auth_role_id, $id_field, forum_id + FROM $table, " . ACL_ROLES_TABLE . " r + WHERE auth_role_id <> 0 + AND auth_role_id = r.role_id + AND r.role_type = '{$permission_type}' + AND " . implode(' AND ', $where_sql) . ' + ORDER BY auth_role_id'; + $result = $db->sql_query($sql); + + $cur_role_auth = array(); + while ($row = $db->sql_fetchrow($result)) + { + $cur_role_auth[$row['auth_role_id']][$row['forum_id']][] = $row[$id_field]; + } + $db->sql_freeresult($result); + + // Get role data for resetting data + if (sizeof($cur_role_auth)) + { + $sql = 'SELECT ao.auth_option, rd.role_id, rd.auth_setting + FROM ' . ACL_OPTIONS_TABLE . ' ao, ' . ACL_ROLES_DATA_TABLE . ' rd + WHERE ao.auth_option_id = rd.auth_option_id + AND ' . $db->sql_in_set('rd.role_id', array_keys($cur_role_auth)); + $result = $db->sql_query($sql); + + $auth_settings = array(); + while ($row = $db->sql_fetchrow($result)) + { + // We need to fill all auth_options, else setting it will fail... + if (!isset($auth_settings[$row['role_id']])) + { + $auth_settings[$row['role_id']] = $auth_id_ary; + } + $auth_settings[$row['role_id']][$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + + // Set the options + foreach ($cur_role_auth as $role_id => $auth_row) + { + foreach ($auth_row as $f_id => $ug_row) + { + $this->acl_set($mode, $f_id, $ug_row, $auth_settings[$role_id], 0, false); + } + } + } + } + + // Now, normally remove permissions... + if ($permission_type !== false) + { + $where_sql[] = $db->sql_in_set('auth_option_id', array_map('intval', $option_id_ary)); + } + + $sql = "DELETE FROM $table + WHERE " . implode(' AND ', $where_sql); + $db->sql_query($sql); + + $this->acl_clear_prefetch(); + } + + /** + * Assign category to template + * used by display_mask() + */ + function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $s_view, $show_trace = false) + { + global $template, $user, $phpbb_admin_path, $phpEx, $phpbb_container; + + $phpbb_permissions = $phpbb_container->get('acl.permissions'); + + @reset($category_array); + while (list($cat, $cat_array) = each($category_array)) + { + $template->assign_block_vars($tpl_cat, array( + 'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false, + 'S_NEVER' => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false, + 'S_NO' => ($cat_array['S_NO'] && !$cat_array['S_NEVER'] && !$cat_array['S_YES']) ? true : false, + + 'CAT_NAME' => $phpbb_permissions->get_category_lang($cat), + )); + + /* Sort permissions by name (more naturaly and user friendly than sorting by a primary key) + * Commented out due to it's memory consumption and time needed + * + $key_array = array_intersect(array_keys($user->lang), array_map(create_function('$a', 'return "acl_" . $a;'), array_keys($cat_array['permissions']))); + $values_array = $cat_array['permissions']; + + $cat_array['permissions'] = array(); + + foreach ($key_array as $key) + { + $key = str_replace('acl_', '', $key); + $cat_array['permissions'][$key] = $values_array[$key]; + } + unset($key_array, $values_array); +*/ + @reset($cat_array['permissions']); + while (list($permission, $allowed) = each($cat_array['permissions'])) + { + if ($s_view) + { + $template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array( + 'S_YES' => ($allowed == ACL_YES) ? true : false, + 'S_NEVER' => ($allowed == ACL_NEVER) ? true : false, + + 'UG_ID' => $ug_id, + 'FORUM_ID' => $forum_id, + 'FIELD_NAME' => $permission, + 'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']', + + 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission") : '', + 'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '', + + 'PERMISSION' => $phpbb_permissions->get_permission_lang($permission), + )); + } + else + { + $template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array( + 'S_YES' => ($allowed == ACL_YES) ? true : false, + 'S_NEVER' => ($allowed == ACL_NEVER) ? true : false, + 'S_NO' => ($allowed == ACL_NO) ? true : false, + + 'UG_ID' => $ug_id, + 'FORUM_ID' => $forum_id, + 'FIELD_NAME' => $permission, + 'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']', + + 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission") : '', + 'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '', + + 'PERMISSION' => $phpbb_permissions->get_permission_lang($permission), + )); + } + } + } + } + + /** + * Building content array from permission rows with explicit key ordering + * used by display_mask() + */ + function build_permission_array(&$permission_row, &$content_array, &$categories, $key_sort_array) + { + global $user, $phpbb_container; + + $phpbb_permissions = $phpbb_container->get('acl.permissions'); + + foreach ($key_sort_array as $forum_id) + { + if (!isset($permission_row[$forum_id])) + { + continue; + } + + $permissions = $permission_row[$forum_id]; + ksort($permissions); + + @reset($permissions); + while (list($permission, $auth_setting) = each($permissions)) + { + $cat = $phpbb_permissions->get_permission_category($permission); + + // Build our categories array + if (!isset($categories[$cat])) + { + $categories[$cat] = $phpbb_permissions->get_category_lang($cat); + } + + // Build our content array + if (!isset($content_array[$forum_id])) + { + $content_array[$forum_id] = array(); + } + + if (!isset($content_array[$forum_id][$cat])) + { + $content_array[$forum_id][$cat] = array( + 'S_YES' => false, + 'S_NEVER' => false, + 'S_NO' => false, + 'permissions' => array(), + ); + } + + $content_array[$forum_id][$cat]['S_YES'] |= ($auth_setting == ACL_YES) ? true : false; + $content_array[$forum_id][$cat]['S_NEVER'] |= ($auth_setting == ACL_NEVER) ? true : false; + $content_array[$forum_id][$cat]['S_NO'] |= ($auth_setting == ACL_NO) ? true : false; + + $content_array[$forum_id][$cat]['permissions'][$permission] = $auth_setting; + } + } + } + + /** + * Use permissions from another user. This transferes a permission set from one user to another. + * The other user is always able to revert back to his permission set. + * This function does not check for lower/higher permissions, it is possible for the user to gain + * "more" permissions by this. + * Admin permissions will not be copied. + */ + function ghost_permissions($from_user_id, $to_user_id) + { + global $db; + + if ($to_user_id == ANONYMOUS) + { + return false; + } + + $hold_ary = $this->acl_raw_data_single_user($from_user_id); + + // Key 0 in $hold_ary are global options, all others are forum_ids + + // We disallow copying admin permissions + foreach ($this->acl_options['global'] as $opt => $id) + { + if (strpos($opt, 'a_') === 0) + { + $hold_ary[0][$this->acl_options['id'][$opt]] = ACL_NEVER; + } + } + + // Force a_switchperm to be allowed + $hold_ary[0][$this->acl_options['id']['a_switchperm']] = ACL_YES; + + $user_permissions = $this->build_bitstring($hold_ary); + + if (!$user_permissions) + { + return false; + } + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_permissions = '" . $db->sql_escape($user_permissions) . "', + user_perm_from = $from_user_id + WHERE user_id = " . $to_user_id; + $db->sql_query($sql); + + return true; + } +} diff --git a/sources/phpBB/includes/acp/info/acp_attachments.php b/sources/phpBB/includes/acp/info/acp_attachments.php new file mode 100644 index 0000000..ff6e342 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_attachments.php @@ -0,0 +1,39 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_attachments_info +{ + function module() + { + 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')), + 'ext_groups' => array('title' => 'ACP_EXTENSION_GROUPS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_ATTACHMENTS')), + 'orphan' => array('title' => 'ACP_ORPHAN_ATTACHMENTS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_ATTACHMENTS')), + 'manage' => array('title' => 'ACP_MANAGE_ATTACHMENTS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_ATTACHMENTS')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_ban.php b/sources/phpBB/includes/acp/info/acp_ban.php new file mode 100644 index 0000000..4959f4d --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_ban.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_ban_info +{ + function module() + { + 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')), + 'user' => array('title' => 'ACP_BAN_USERNAMES', 'auth' => 'acl_a_ban', 'cat' => array('ACP_USER_SECURITY')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_bbcodes.php b/sources/phpBB/includes/acp/info/acp_bbcodes.php new file mode 100644 index 0000000..2bca319 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_bbcodes.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_bbcodes_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_board.php b/sources/phpBB/includes/acp/info/acp_board.php new file mode 100644 index 0000000..6838b4f --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_board.php @@ -0,0 +1,50 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_board_info +{ + function module() + { + 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')), + 'avatar' => array('title' => 'ACP_AVATAR_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')), + 'message' => array('title' => 'ACP_MESSAGE_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION', 'ACP_MESSAGES')), + 'post' => array('title' => 'ACP_POST_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION', 'ACP_MESSAGES')), + 'signature' => array('title' => 'ACP_SIGNATURE_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')), + 'feed' => array('title' => 'ACP_FEED_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')), + 'registration' => array('title' => 'ACP_REGISTER_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')), + + 'auth' => array('title' => 'ACP_AUTH_SETTINGS', 'auth' => 'acl_a_server', 'cat' => array('ACP_CLIENT_COMMUNICATION')), + 'email' => array('title' => 'ACP_EMAIL_SETTINGS', 'auth' => 'acl_a_server', 'cat' => array('ACP_CLIENT_COMMUNICATION')), + + 'cookie' => array('title' => 'ACP_COOKIE_SETTINGS', 'auth' => 'acl_a_server', 'cat' => array('ACP_SERVER_CONFIGURATION')), + 'server' => array('title' => 'ACP_SERVER_SETTINGS', 'auth' => 'acl_a_server', 'cat' => array('ACP_SERVER_CONFIGURATION')), + 'security' => array('title' => 'ACP_SECURITY_SETTINGS', 'auth' => 'acl_a_server', 'cat' => array('ACP_SERVER_CONFIGURATION')), + 'load' => array('title' => 'ACP_LOAD_SETTINGS', 'auth' => 'acl_a_server', 'cat' => array('ACP_SERVER_CONFIGURATION')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_bots.php b/sources/phpBB/includes/acp/info/acp_bots.php new file mode 100644 index 0000000..9aa2492 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_bots.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_bots_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_captcha.php b/sources/phpBB/includes/acp/info/acp_captcha.php new file mode 100644 index 0000000..99dc5ce --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_captcha.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_captcha_info +{ + function module() + { + 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) + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_contact.php b/sources/phpBB/includes/acp/info/acp_contact.php new file mode 100644 index 0000000..548eb52 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_contact.php @@ -0,0 +1,30 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +/** +* @package module_install +*/ +class acp_contact_info +{ + public function module() + { + return array( + 'filename' => 'acp_contact', + 'title' => 'ACP_CONTACT', + 'version' => '1.0.0', + 'modes' => array( + 'contact' => array('title' => 'ACP_CONTACT_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')), + ), + ); + } +} diff --git a/sources/phpBB/includes/acp/info/acp_database.php b/sources/phpBB/includes/acp/info/acp_database.php new file mode 100644 index 0000000..5cf9da2 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_database.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_database_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_disallow.php b/sources/phpBB/includes/acp/info/acp_disallow.php new file mode 100644 index 0000000..ebd44b5 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_disallow.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_disallow_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_email.php b/sources/phpBB/includes/acp/info/acp_email.php new file mode 100644 index 0000000..2f77fc6 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_email.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_email_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_extensions.php b/sources/phpBB/includes/acp/info/acp_extensions.php new file mode 100644 index 0000000..d4cf1b0 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_extensions.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_extensions_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_forums.php b/sources/phpBB/includes/acp/info/acp_forums.php new file mode 100644 index 0000000..647090c --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_forums.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_forums_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_groups.php b/sources/phpBB/includes/acp/info/acp_groups.php new file mode 100644 index 0000000..6c5ad70 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_groups.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_groups_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_icons.php b/sources/phpBB/includes/acp/info/acp_icons.php new file mode 100644 index 0000000..001d6cb --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_icons.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_icons_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_inactive.php b/sources/phpBB/includes/acp/info/acp_inactive.php new file mode 100644 index 0000000..442eb13 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_inactive.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_inactive_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_jabber.php b/sources/phpBB/includes/acp/info/acp_jabber.php new file mode 100644 index 0000000..c1dfb2a --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_jabber.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_jabber_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_language.php b/sources/phpBB/includes/acp/info/acp_language.php new file mode 100644 index 0000000..b9efbbb --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_language.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_language_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_logs.php b/sources/phpBB/includes/acp/info/acp_logs.php new file mode 100644 index 0000000..e9e6034 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_logs.php @@ -0,0 +1,38 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_logs_info +{ + function module() + { + 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')), + 'users' => array('title' => 'ACP_USERS_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')), + 'critical' => array('title' => 'ACP_CRITICAL_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_main.php b/sources/phpBB/includes/acp/info/acp_main.php new file mode 100644 index 0000000..51259e3 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_main.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_main_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_modules.php b/sources/phpBB/includes/acp/info/acp_modules.php new file mode 100644 index 0000000..a47cd4a --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_modules.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_modules_info +{ + function module() + { + 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')), + 'mcp' => array('title' => 'MCP', 'auth' => 'acl_a_modules', 'cat' => array('ACP_MODULE_MANAGEMENT')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_permission_roles.php b/sources/phpBB/includes/acp/info/acp_permission_roles.php new file mode 100644 index 0000000..e8aa133 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_permission_roles.php @@ -0,0 +1,38 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_permission_roles_info +{ + function module() + { + 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')), + 'mod_roles' => array('title' => 'ACP_MOD_ROLES', 'auth' => 'acl_a_roles && acl_a_mauth', 'cat' => array('ACP_PERMISSION_ROLES')), + 'forum_roles' => array('title' => 'ACP_FORUM_ROLES', 'auth' => 'acl_a_roles && acl_a_fauth', 'cat' => array('ACP_PERMISSION_ROLES')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_permissions.php b/sources/phpBB/includes/acp/info/acp_permissions.php new file mode 100644 index 0000000..3ec592a --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_permissions.php @@ -0,0 +1,52 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_permissions_info +{ + function module() + { + 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')), + + 'setting_forum_local' => array('title' => 'ACP_FORUM_PERMISSIONS', 'auth' => 'acl_a_fauth && (acl_a_authusers || acl_a_authgroups)', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS')), + 'setting_forum_copy' => array('title' => 'ACP_FORUM_PERMISSIONS_COPY', 'auth' => 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS')), + 'setting_mod_local' => array('title' => 'ACP_FORUM_MODERATORS', 'auth' => 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS')), + 'setting_user_global' => array('title' => 'ACP_USERS_PERMISSIONS', 'auth' => 'acl_a_authusers && (acl_a_aauth || acl_a_mauth || acl_a_uauth)', 'cat' => array('ACP_GLOBAL_PERMISSIONS', 'ACP_CAT_USERS')), + 'setting_user_local' => array('title' => 'ACP_USERS_FORUM_PERMISSIONS', 'auth' => 'acl_a_authusers && (acl_a_mauth || acl_a_fauth)', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS', 'ACP_CAT_USERS')), + 'setting_group_global' => array('title' => 'ACP_GROUPS_PERMISSIONS', 'auth' => 'acl_a_authgroups && (acl_a_aauth || acl_a_mauth || acl_a_uauth)', 'cat' => array('ACP_GLOBAL_PERMISSIONS', 'ACP_GROUPS')), + 'setting_group_local' => array('title' => 'ACP_GROUPS_FORUM_PERMISSIONS', 'auth' => 'acl_a_authgroups && (acl_a_mauth || acl_a_fauth)', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS', 'ACP_GROUPS')), + 'setting_admin_global' => array('title' => 'ACP_ADMINISTRATORS', 'auth' => 'acl_a_aauth && (acl_a_authusers || acl_a_authgroups)', 'cat' => array('ACP_GLOBAL_PERMISSIONS')), + 'setting_mod_global' => array('title' => 'ACP_GLOBAL_MODERATORS', 'auth' => 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)', 'cat' => array('ACP_GLOBAL_PERMISSIONS')), + + 'view_admin_global' => array('title' => 'ACP_VIEW_ADMIN_PERMISSIONS', 'auth' => 'acl_a_viewauth', 'cat' => array('ACP_PERMISSION_MASKS')), + 'view_user_global' => array('title' => 'ACP_VIEW_USER_PERMISSIONS', 'auth' => 'acl_a_viewauth', 'cat' => array('ACP_PERMISSION_MASKS')), + 'view_mod_global' => array('title' => 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS', 'auth' => 'acl_a_viewauth', 'cat' => array('ACP_PERMISSION_MASKS')), + 'view_mod_local' => array('title' => 'ACP_VIEW_FORUM_MOD_PERMISSIONS', 'auth' => 'acl_a_viewauth', 'cat' => array('ACP_PERMISSION_MASKS')), + 'view_forum_local' => array('title' => 'ACP_VIEW_FORUM_PERMISSIONS', 'auth' => 'acl_a_viewauth', 'cat' => array('ACP_PERMISSION_MASKS')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_php_info.php b/sources/phpBB/includes/acp/info/acp_php_info.php new file mode 100644 index 0000000..af978e0 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_php_info.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_php_info_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_profile.php b/sources/phpBB/includes/acp/info/acp_profile.php new file mode 100644 index 0000000..307e711 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_profile.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_profile_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_prune.php b/sources/phpBB/includes/acp/info/acp_prune.php new file mode 100644 index 0000000..58cb1ba --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_prune.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_prune_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_ranks.php b/sources/phpBB/includes/acp/info/acp_ranks.php new file mode 100644 index 0000000..3cc9b4a --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_ranks.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_ranks_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_reasons.php b/sources/phpBB/includes/acp/info/acp_reasons.php new file mode 100644 index 0000000..c48fd1a --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_reasons.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_reasons_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_search.php b/sources/phpBB/includes/acp/info/acp_search.php new file mode 100644 index 0000000..5d681a7 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_search.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_search_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_send_statistics.php b/sources/phpBB/includes/acp/info/acp_send_statistics.php new file mode 100644 index 0000000..a4f2ddc --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_send_statistics.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_send_statistics_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_styles.php b/sources/phpBB/includes/acp/info/acp_styles.php new file mode 100644 index 0000000..c0ab005 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_styles.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_styles_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_update.php b/sources/phpBB/includes/acp/info/acp_update.php new file mode 100644 index 0000000..ca00f6d --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_update.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_update_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_users.php b/sources/phpBB/includes/acp/info/acp_users.php new file mode 100644 index 0000000..ab69523 --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_users.php @@ -0,0 +1,45 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_users_info +{ + function module() + { + 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')), + 'warnings' => array('title' => 'ACP_USER_WARNINGS', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')), + 'profile' => array('title' => 'ACP_USER_PROFILE', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')), + 'prefs' => array('title' => 'ACP_USER_PREFS', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')), + 'avatar' => array('title' => 'ACP_USER_AVATAR', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')), + 'rank' => array('title' => 'ACP_USER_RANK', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')), + 'sig' => array('title' => 'ACP_USER_SIG', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')), + 'groups' => array('title' => 'ACP_USER_GROUPS', 'auth' => 'acl_a_user && acl_a_group', 'display' => false, 'cat' => array('ACP_CAT_USERS')), + 'perm' => array('title' => 'ACP_USER_PERM', 'auth' => 'acl_a_user && acl_a_viewauth', 'display' => false, 'cat' => array('ACP_CAT_USERS')), + 'attach' => array('title' => 'ACP_USER_ATTACH', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/acp/info/acp_words.php b/sources/phpBB/includes/acp/info/acp_words.php new file mode 100644 index 0000000..3c8c79f --- /dev/null +++ b/sources/phpBB/includes/acp/info/acp_words.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class acp_words_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/bbcode.php b/sources/phpBB/includes/bbcode.php new file mode 100644 index 0000000..5f6dcde --- /dev/null +++ b/sources/phpBB/includes/bbcode.php @@ -0,0 +1,616 @@ + +* @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; +} + +/** +* BBCode class +*/ +class bbcode +{ + var $bbcode_uid = ''; + var $bbcode_bitfield = ''; + var $bbcode_cache = array(); + var $bbcode_template = array(); + + var $bbcodes = array(); + + var $template_bitfield; + + /** + * Constructor + * Init bbcode cache entries if bitfield is specified + */ + function bbcode($bitfield = '') + { + if ($bitfield) + { + $this->bbcode_bitfield = $bitfield; + $this->bbcode_cache_init(); + } + } + + /** + * Second pass bbcodes + */ + function bbcode_second_pass(&$message, $bbcode_uid = '', $bbcode_bitfield = false) + { + if ($bbcode_uid) + { + $this->bbcode_uid = $bbcode_uid; + } + + if ($bbcode_bitfield !== false) + { + $this->bbcode_bitfield = $bbcode_bitfield; + + // Init those added with a new bbcode_bitfield (already stored codes will not get parsed again) + $this->bbcode_cache_init(); + } + + if (!$this->bbcode_bitfield) + { + // Remove the uid from tags that have not been transformed into HTML + if ($this->bbcode_uid) + { + $message = str_replace(':' . $this->bbcode_uid, '', $message); + } + + return; + } + + $str = array('search' => array(), 'replace' => array()); + $preg = array('search' => array(), 'replace' => array()); + + $bitfield = new bitfield($this->bbcode_bitfield); + $bbcodes_set = $bitfield->get_all_set(); + + $undid_bbcode_specialchars = false; + foreach ($bbcodes_set as $bbcode_id) + { + if (!empty($this->bbcode_cache[$bbcode_id])) + { + foreach ($this->bbcode_cache[$bbcode_id] as $type => $array) + { + foreach ($array as $search => $replace) + { + ${$type}['search'][] = str_replace('$uid', $this->bbcode_uid, $search); + ${$type}['replace'][] = $replace; + } + + if (sizeof($str['search'])) + { + $message = str_replace($str['search'], $str['replace'], $message); + $str = array('search' => array(), 'replace' => array()); + } + + if (sizeof($preg['search'])) + { + // we need to turn the entities back into their original form to allow the + // search patterns to work properly + if (!$undid_bbcode_specialchars) + { + $message = str_replace(array(':', '.'), array(':', '.'), $message); + $undid_bbcode_specialchars = true; + } + + $message = preg_replace($preg['search'], $preg['replace'], $message); + $preg = array('search' => array(), 'replace' => array()); + } + } + } + } + + // Remove the uid from tags that have not been transformed into HTML + $message = str_replace(':' . $this->bbcode_uid, '', $message); + } + + /** + * Init bbcode cache + * + * requires: $this->bbcode_bitfield + * sets: $this->bbcode_cache with bbcode templates needed for bbcode_bitfield + */ + function bbcode_cache_init() + { + global $phpbb_root_path, $phpEx, $config, $user, $phpbb_dispatcher, $phpbb_extension_manager, $phpbb_path_helper; + + 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->set_style(); + $template->set_filenames(array('bbcode.html' => 'bbcode.html')); + $this->template_filename = $template->get_source_file_for_handle('bbcode.html'); + } + + $bbcode_ids = $rowset = $sql = array(); + + $bitfield = new bitfield($this->bbcode_bitfield); + $bbcodes_set = $bitfield->get_all_set(); + + foreach ($bbcodes_set as $bbcode_id) + { + if (isset($this->bbcode_cache[$bbcode_id])) + { + // do not try to re-cache it if it's already in + continue; + } + $bbcode_ids[] = $bbcode_id; + + if ($bbcode_id > NUM_CORE_BBCODES) + { + $sql[] = $bbcode_id; + } + } + + if (sizeof($sql)) + { + global $db; + + $sql = 'SELECT * + FROM ' . BBCODES_TABLE . ' + WHERE ' . $db->sql_in_set('bbcode_id', $sql); + $result = $db->sql_query($sql, 3600); + + while ($row = $db->sql_fetchrow($result)) + { + // To circumvent replacing newlines with
for the generated html, + // we use carriage returns here. They are later changed back to newlines + $row['bbcode_tpl'] = str_replace("\n", "\r", $row['bbcode_tpl']); + $row['second_pass_replace'] = str_replace("\n", "\r", $row['second_pass_replace']); + + $rowset[$row['bbcode_id']] = $row; + } + $db->sql_freeresult($result); + } + + foreach ($bbcode_ids as $bbcode_id) + { + switch ($bbcode_id) + { + case 0: + $this->bbcode_cache[$bbcode_id] = array( + 'str' => array( + '[/quote:$uid]' => $this->bbcode_tpl('quote_close', $bbcode_id) + ), + 'preg' => array( + '#\[quote(?:="(.*?)")?:$uid\]((?!\[quote(?:=".*?")?:$uid\]).)?#ise' => "\$this->bbcode_second_pass_quote('\$1', '\$2')" + ) + ); + break; + + case 1: + $this->bbcode_cache[$bbcode_id] = array( + 'str' => array( + '[b:$uid]' => $this->bbcode_tpl('b_open', $bbcode_id), + '[/b:$uid]' => $this->bbcode_tpl('b_close', $bbcode_id), + ) + ); + break; + + case 2: + $this->bbcode_cache[$bbcode_id] = array( + 'str' => array( + '[i:$uid]' => $this->bbcode_tpl('i_open', $bbcode_id), + '[/i:$uid]' => $this->bbcode_tpl('i_close', $bbcode_id), + ) + ); + break; + + case 3: + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array( + '#\[url:$uid\]((.*?))\[/url:$uid\]#s' => $this->bbcode_tpl('url', $bbcode_id), + '#\[url=([^\[]+?):$uid\](.*?)\[/url:$uid\]#s' => $this->bbcode_tpl('url', $bbcode_id), + ) + ); + break; + + case 4: + if ($user->optionget('viewimg')) + { + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array( + '#\[img:$uid\](.*?)\[/img:$uid\]#s' => $this->bbcode_tpl('img', $bbcode_id), + ) + ); + } + else + { + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array( + '#\[img:$uid\](.*?)\[/img:$uid\]#s' => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id, true)), + ) + ); + } + break; + + case 5: + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array( + '#\[size=([\-\+]?\d+):$uid\](.*?)\[/size:$uid\]#s' => $this->bbcode_tpl('size', $bbcode_id), + ) + ); + break; + + case 6: + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array( + '!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+):$uid\](.*?)\[/color:$uid\]!is' => $this->bbcode_tpl('color', $bbcode_id), + ) + ); + break; + + case 7: + $this->bbcode_cache[$bbcode_id] = array( + 'str' => array( + '[u:$uid]' => $this->bbcode_tpl('u_open', $bbcode_id), + '[/u:$uid]' => $this->bbcode_tpl('u_close', $bbcode_id), + ) + ); + break; + + case 8: + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array( + '#\[code(?:=([a-z]+))?:$uid\](.*?)\[/code:$uid\]#ise' => "\$this->bbcode_second_pass_code('\$1', '\$2')", + ) + ); + break; + + case 9: + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array( + '#(\[\/?(list|\*):[mou]?:?$uid\])[\n]{1}#' => "\$1", + '#(\[list=([^\[]+):$uid\])[\n]{1}#' => "\$1", + '#\[list=([^\[]+):$uid\]#e' => "\$this->bbcode_list('\$1')", + ), + 'str' => array( + '[list:$uid]' => $this->bbcode_tpl('ulist_open_default', $bbcode_id), + '[/list:u:$uid]' => $this->bbcode_tpl('ulist_close', $bbcode_id), + '[/list:o:$uid]' => $this->bbcode_tpl('olist_close', $bbcode_id), + '[*:$uid]' => $this->bbcode_tpl('listitem', $bbcode_id), + '[/*:$uid]' => $this->bbcode_tpl('listitem_close', $bbcode_id), + '[/*:m:$uid]' => $this->bbcode_tpl('listitem_close', $bbcode_id) + ), + ); + break; + + case 10: + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array( + '#\[email:$uid\]((.*?))\[/email:$uid\]#is' => $this->bbcode_tpl('email', $bbcode_id), + '#\[email=([^\[]+):$uid\](.*?)\[/email:$uid\]#is' => $this->bbcode_tpl('email', $bbcode_id) + ) + ); + break; + + case 11: + if ($user->optionget('viewflash')) + { + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array( + '#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => $this->bbcode_tpl('flash', $bbcode_id), + ) + ); + } + else + { + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array( + '#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => str_replace('$1', '$3', str_replace('$2', '[ flash ]', $this->bbcode_tpl('url', $bbcode_id, true))) + ) + ); + } + break; + + case 12: + $this->bbcode_cache[$bbcode_id] = array( + 'str' => array( + '[/attachment:$uid]' => $this->bbcode_tpl('inline_attachment_close', $bbcode_id) + ), + 'preg' => array( + '#\[attachment=([0-9]+):$uid\]#' => $this->bbcode_tpl('inline_attachment_open', $bbcode_id) + ) + ); + break; + + default: + if (isset($rowset[$bbcode_id])) + { + if ($this->template_bitfield->get($bbcode_id)) + { + // The bbcode requires a custom template to be loaded + if (!$bbcode_tpl = $this->bbcode_tpl($rowset[$bbcode_id]['bbcode_tag'], $bbcode_id)) + { + // For some reason, the required template seems not to be available, use the default template + $bbcode_tpl = (!empty($rowset[$bbcode_id]['second_pass_replace'])) ? $rowset[$bbcode_id]['second_pass_replace'] : $rowset[$bbcode_id]['bbcode_tpl']; + } + else + { + // In order to use templates with custom bbcodes we need + // to replace all {VARS} to corresponding backreferences + // Note that backreferences are numbered from bbcode_match + if (preg_match_all('/\{(URL|LOCAL_URL|EMAIL|TEXT|SIMPLETEXT|INTTEXT|IDENTIFIER|COLOR|NUMBER)[0-9]*\}/', $rowset[$bbcode_id]['bbcode_match'], $m)) + { + foreach ($m[0] as $i => $tok) + { + $bbcode_tpl = str_replace($tok, '$' . ($i + 1), $bbcode_tpl); + } + } + } + } + else + { + // Default template + $bbcode_tpl = (!empty($rowset[$bbcode_id]['second_pass_replace'])) ? $rowset[$bbcode_id]['second_pass_replace'] : $rowset[$bbcode_id]['bbcode_tpl']; + } + + // 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); + + if (!empty($rowset[$bbcode_id]['second_pass_replace'])) + { + // The custom BBCode requires second-pass pattern replacements + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array($rowset[$bbcode_id]['second_pass_match'] => $bbcode_tpl) + ); + } + else + { + $this->bbcode_cache[$bbcode_id] = array( + 'str' => array($rowset[$bbcode_id]['second_pass_match'] => $bbcode_tpl) + ); + } + } + else + { + $this->bbcode_cache[$bbcode_id] = false; + } + break; + } + } + + $bbcode_cache = $this->bbcode_cache; + $bbcode_bitfield = $this->bbcode_bitfield; + $bbcode_uid = $this->bbcode_uid; + + /** + * Use this event to modify the bbcode_cache + * + * @event core.bbcode_cache_init_end + * @var array bbcode_cache The array of cached search and replace patterns of bbcodes + * @var string bbcode_bitfield The bbcode bitfield + * @var string bbcode_uid The bbcode uid + * @since 3.1.3-RC1 + */ + $vars = array('bbcode_cache', 'bbcode_bitfield', 'bbcode_uid'); + extract($phpbb_dispatcher->trigger_event('core.bbcode_cache_init_end', compact($vars))); + + $this->bbcode_cache = $bbcode_cache; + $this->bbcode_bitfield = $bbcode_bitfield; + $this->bbcode_uid = $bbcode_uid; + } + + /** + * Return bbcode template + */ + function bbcode_tpl($tpl_name, $bbcode_id = -1, $skip_bitfield_check = false) + { + static $bbcode_hardtpl = array(); + if (empty($bbcode_hardtpl)) + { + global $user; + + $bbcode_hardtpl = array( + 'b_open' => '', + 'b_close' => '', + 'i_open' => '', + 'i_close' => '', + 'u_open' => '', + 'u_close' => '', + 'img' => '' . $user->lang['IMAGE'] . '', + 'size' => '$2', + 'color' => '$2', + 'email' => '$2' + ); + } + + if ($bbcode_id != -1 && !$skip_bitfield_check && !$this->template_bitfield->get($bbcode_id)) + { + return (isset($bbcode_hardtpl[$tpl_name])) ? $bbcode_hardtpl[$tpl_name] : false; + } + + if (empty($this->bbcode_template)) + { + if (($tpl = file_get_contents($this->template_filename)) === false) + { + trigger_error('Could not load bbcode template', E_USER_ERROR); + } + + // replace \ with \\ and then ' with \'. + $tpl = str_replace('\\', '\\\\', $tpl); + $tpl = str_replace("'", "\'", $tpl); + + // strip newlines and indent + $tpl = preg_replace("/\n[\n\r\s\t]*/", '', $tpl); + + // Turn template blocks into PHP assignment statements for the values of $bbcode_tpl.. + $this->bbcode_template = array(); + + $matches = preg_match_all('#(.*?)#', $tpl, $match); + + for ($i = 0; $i < $matches; $i++) + { + if (empty($match[1][$i])) + { + continue; + } + + $this->bbcode_template[$match[1][$i]] = $this->bbcode_tpl_replace($match[1][$i], $match[2][$i]); + } + } + + return (isset($this->bbcode_template[$tpl_name])) ? $this->bbcode_template[$tpl_name] : ((isset($bbcode_hardtpl[$tpl_name])) ? $bbcode_hardtpl[$tpl_name] : false); + } + + /** + * Return bbcode template replacement + */ + function bbcode_tpl_replace($tpl_name, $tpl) + { + global $user; + + static $replacements = array( + 'quote_username_open' => array('{USERNAME}' => '$1'), + 'color' => array('{COLOR}' => '$1', '{TEXT}' => '$2'), + 'size' => array('{SIZE}' => '$1', '{TEXT}' => '$2'), + 'img' => array('{URL}' => '$1'), + 'flash' => array('{WIDTH}' => '$1', '{HEIGHT}' => '$2', '{URL}' => '$3'), + 'url' => array('{URL}' => '$1', '{DESCRIPTION}' => '$2'), + '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); + + if (!empty($replacements[$tpl_name])) + { + $tpl = strtr($tpl, $replacements[$tpl_name]); + } + + return trim($tpl); + } + + /** + * Second parse list bbcode + */ + function bbcode_list($type) + { + if ($type == '') + { + $tpl = 'ulist_open_default'; + $type = 'default'; + } + else if ($type == 'i') + { + $tpl = 'olist_open'; + $type = 'lower-roman'; + } + else if ($type == 'I') + { + $tpl = 'olist_open'; + $type = 'upper-roman'; + } + else if (preg_match('#^(disc|circle|square)$#i', $type)) + { + $tpl = 'ulist_open'; + $type = strtolower($type); + } + else if (preg_match('#^[a-z]$#', $type)) + { + $tpl = 'olist_open'; + $type = 'lower-alpha'; + } + else if (preg_match('#[A-Z]#', $type)) + { + $tpl = 'olist_open'; + $type = 'upper-alpha'; + } + else if (is_numeric($type)) + { + $tpl = 'olist_open'; + $type = 'decimal'; + } + else + { + $tpl = 'olist_open'; + $type = 'decimal'; + } + + return str_replace('{LIST_TYPE}', $type, $this->bbcode_tpl($tpl)); + } + + /** + * Second parse quote tag + */ + function bbcode_second_pass_quote($username, $quote) + { + // when using the /e modifier, preg_replace slashes double-quotes but does not + // seem to slash anything else + $quote = str_replace('\"', '"', $quote); + $username = str_replace('\"', '"', $username); + + // remove newline at the beginning + if ($quote == "\n") + { + $quote = ''; + } + + $quote = (($username) ? str_replace('$1', $username, $this->bbcode_tpl('quote_username_open')) : $this->bbcode_tpl('quote_open')) . $quote; + + return $quote; + } + + /** + * Second parse code tag + */ + function bbcode_second_pass_code($type, $code) + { + // when using the /e modifier, preg_replace slashes double-quotes but does not + // seem to slash anything else + $code = str_replace('\"', '"', $code); + + switch ($type) + { + case 'php': + // Not the english way, but valid because of hardcoded syntax highlighting + if (strpos($code, '
') === 0) + { + $code = substr($code, 41); + } + + // no break; + + default: + $code = str_replace("\t", '   ', $code); + $code = str_replace(' ', '  ', $code); + $code = str_replace(' ', '  ', $code); + $code = str_replace("\n ", "\n ", $code); + + // keep space at the beginning + if (!empty($code) && $code[0] == ' ') + { + $code = ' ' . substr($code, 1); + } + + // remove newline at the beginning + if (!empty($code) && $code[0] == "\n") + { + $code = substr($code, 1); + } + break; + } + + $code = $this->bbcode_tpl('code_open') . $code . $this->bbcode_tpl('code_close'); + + return $code; + } +} diff --git a/sources/phpBB/includes/compatibility_globals.php b/sources/phpBB/includes/compatibility_globals.php new file mode 100644 index 0000000..54c9287 --- /dev/null +++ b/sources/phpBB/includes/compatibility_globals.php @@ -0,0 +1,47 @@ + +* @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; +} + +// set up caching +$cache = $phpbb_container->get('cache'); + +// 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'); + +// make sure request_var uses this request instance +request_var('', 0, false, false, $request); // "dependency injection" for a function + +// 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); + +$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'); + +// load extensions +$phpbb_extension_manager = $phpbb_container->get('ext.manager'); + +$template = $phpbb_container->get('template'); diff --git a/sources/phpBB/includes/constants.php b/sources/phpBB/includes/constants.php new file mode 100644 index 0000000..9f408f4 --- /dev/null +++ b/sources/phpBB/includes/constants.php @@ -0,0 +1,297 @@ + +* @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; +} + +/** +* valid external constants: +* PHPBB_MSG_HANDLER +* PHPBB_DB_NEW_LINK +* PHPBB_ROOT_PATH +* PHPBB_ADMIN_PATH +*/ + +// phpBB Version +define('PHPBB_VERSION', '3.1.3'); + +// QA-related +// define('PHPBB_QA', 1); + +// User related +define('ANONYMOUS', 1); + +define('USER_ACTIVATION_NONE', 0); +define('USER_ACTIVATION_SELF', 1); +define('USER_ACTIVATION_ADMIN', 2); +define('USER_ACTIVATION_DISABLE', 3); + +define('AVATAR_UPLOAD', 1); +define('AVATAR_REMOTE', 2); +define('AVATAR_GALLERY', 3); + +define('USER_NORMAL', 0); +define('USER_INACTIVE', 1); +define('USER_IGNORE', 2); +define('USER_FOUNDER', 3); + +define('INACTIVE_REGISTER', 1); // Newly registered account +define('INACTIVE_PROFILE', 2); // Profile details changed +define('INACTIVE_MANUAL', 3); // Account deactivated by administrator +define('INACTIVE_REMIND', 4); // Forced user account reactivation + +// ACL +define('ACL_NEVER', 0); +define('ACL_YES', 1); +define('ACL_NO', -1); + +// Login error codes +define('LOGIN_CONTINUE', 1); +define('LOGIN_BREAK', 2); +define('LOGIN_SUCCESS', 3); +define('LOGIN_SUCCESS_CREATE_PROFILE', 20); +define('LOGIN_SUCCESS_LINK_PROFILE', 21); +define('LOGIN_ERROR_USERNAME', 10); +define('LOGIN_ERROR_PASSWORD', 11); +define('LOGIN_ERROR_ACTIVE', 12); +define('LOGIN_ERROR_ATTEMPTS', 13); +define('LOGIN_ERROR_EXTERNAL_AUTH', 14); +define('LOGIN_ERROR_PASSWORD_CONVERT', 15); + +// Maximum login attempts +// The value is arbitrary, but it has to fit into the user_login_attempts field. +define('LOGIN_ATTEMPTS_MAX', 100); + +// Group settings +define('GROUP_OPEN', 0); +define('GROUP_CLOSED', 1); +define('GROUP_HIDDEN', 2); +define('GROUP_SPECIAL', 3); +define('GROUP_FREE', 4); + +// Forum/Topic states +define('FORUM_CAT', 0); +define('FORUM_POST', 1); +define('FORUM_LINK', 2); +define('ITEM_UNLOCKED', 0); +define('ITEM_LOCKED', 1); +define('ITEM_MOVED', 2); + +define('ITEM_UNAPPROVED', 0); // => has not yet been approved +define('ITEM_APPROVED', 1); // => has been approved, and has not been soft deleted +define('ITEM_DELETED', 2); // => has been soft deleted +define('ITEM_REAPPROVE', 3); // => has been edited and needs to be re-approved + +// Forum Flags +define('FORUM_FLAG_LINK_TRACK', 1); +define('FORUM_FLAG_PRUNE_POLL', 2); +define('FORUM_FLAG_PRUNE_ANNOUNCE', 4); +define('FORUM_FLAG_PRUNE_STICKY', 8); +define('FORUM_FLAG_ACTIVE_TOPICS', 16); +define('FORUM_FLAG_POST_REVIEW', 32); +define('FORUM_FLAG_QUICK_REPLY', 64); + +// Forum Options... sequential order. Modifications should begin at number 10 (number 29 is maximum) +define('FORUM_OPTION_FEED_NEWS', 1); +define('FORUM_OPTION_FEED_EXCLUDE', 2); + +// Optional text flags +define('OPTION_FLAG_BBCODE', 1); +define('OPTION_FLAG_SMILIES', 2); +define('OPTION_FLAG_LINKS', 4); + +// Topic types +define('POST_NORMAL', 0); +define('POST_STICKY', 1); +define('POST_ANNOUNCE', 2); +define('POST_GLOBAL', 3); + +// Lastread types +define('TRACK_NORMAL', 0); +define('TRACK_POSTED', 1); + +// Notify methods +define('NOTIFY_EMAIL', 0); +define('NOTIFY_IM', 1); +define('NOTIFY_BOTH', 2); + +// Notify status +define('NOTIFY_YES', 0); +define('NOTIFY_NO', 1); + +// Email Priority Settings +define('MAIL_LOW_PRIORITY', 4); +define('MAIL_NORMAL_PRIORITY', 3); +define('MAIL_HIGH_PRIORITY', 2); + +// Log types +define('LOG_ADMIN', 0); +define('LOG_MOD', 1); +define('LOG_CRITICAL', 2); +define('LOG_USERS', 3); + +// Private messaging - Do NOT change these values +define('PRIVMSGS_HOLD_BOX', -4); +define('PRIVMSGS_NO_BOX', -3); +define('PRIVMSGS_OUTBOX', -2); +define('PRIVMSGS_SENTBOX', -1); +define('PRIVMSGS_INBOX', 0); + +// Full Folder Actions +define('FULL_FOLDER_NONE', -3); +define('FULL_FOLDER_DELETE', -2); +define('FULL_FOLDER_HOLD', -1); + +// Download Modes - Attachments +define('INLINE_LINK', 1); +// This mode is only used internally to allow modders extending the attachment functionality +define('PHYSICAL_LINK', 2); + +// Confirm types +define('CONFIRM_REG', 1); +define('CONFIRM_LOGIN', 2); +define('CONFIRM_POST', 3); +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_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 + +// BBCode UID length +define('BBCODE_UID_LEN', 8); + +// Number of core BBCodes +define('NUM_CORE_BBCODES', 12); + +// BBCode hard limit +define('BBCODE_LIMIT', 1511); + +// Smiley hard limit +define('SMILEY_LIMIT', 1000); + +// Magic url types +define('MAGIC_URL_EMAIL', 1); +define('MAGIC_URL_FULL', 2); +define('MAGIC_URL_LOCAL', 3); +define('MAGIC_URL_WWW', 4); + +// Profile Field Types +define('FIELD_INT', 1); +define('FIELD_STRING', 2); +define('FIELD_TEXT', 3); +define('FIELD_BOOL', 4); +define('FIELD_DROPDOWN', 5); +define('FIELD_DATE', 6); + +// referer validation +define('REFERER_VALIDATE_NONE', 0); +define('REFERER_VALIDATE_HOST', 1); +define('REFERER_VALIDATE_PATH', 2); + +// phpbb_chmod() permissions +@define('CHMOD_ALL', 7); +@define('CHMOD_READ', 4); +@define('CHMOD_WRITE', 2); +@define('CHMOD_EXECUTE', 1); + +// Captcha code length +define('CAPTCHA_MIN_CHARS', 4); +define('CAPTCHA_MAX_CHARS', 7); + +// Additional constants +define('VOTE_CONVERTED', 127); + +// Table names +define('ACL_GROUPS_TABLE', $table_prefix . 'acl_groups'); +define('ACL_OPTIONS_TABLE', $table_prefix . 'acl_options'); +define('ACL_ROLES_DATA_TABLE', $table_prefix . 'acl_roles_data'); +define('ACL_ROLES_TABLE', $table_prefix . 'acl_roles'); +define('ACL_USERS_TABLE', $table_prefix . 'acl_users'); +define('ATTACHMENTS_TABLE', $table_prefix . 'attachments'); +define('BANLIST_TABLE', $table_prefix . 'banlist'); +define('BBCODES_TABLE', $table_prefix . 'bbcodes'); +define('BOOKMARKS_TABLE', $table_prefix . 'bookmarks'); +define('BOTS_TABLE', $table_prefix . 'bots'); +define('CONFIG_TABLE', $table_prefix . 'config'); +define('CONFIG_TEXT_TABLE', $table_prefix . 'config_text'); +define('CONFIRM_TABLE', $table_prefix . 'confirm'); +define('DISALLOW_TABLE', $table_prefix . 'disallow'); +define('DRAFTS_TABLE', $table_prefix . 'drafts'); +define('EXT_TABLE', $table_prefix . 'ext'); +define('EXTENSIONS_TABLE', $table_prefix . 'extensions'); +define('EXTENSION_GROUPS_TABLE', $table_prefix . 'extension_groups'); +define('FORUMS_TABLE', $table_prefix . 'forums'); +define('FORUMS_ACCESS_TABLE', $table_prefix . 'forums_access'); +define('FORUMS_TRACK_TABLE', $table_prefix . 'forums_track'); +define('FORUMS_WATCH_TABLE', $table_prefix . 'forums_watch'); +define('GROUPS_TABLE', $table_prefix . 'groups'); +define('ICONS_TABLE', $table_prefix . 'icons'); +define('LANG_TABLE', $table_prefix . 'lang'); +define('LOG_TABLE', $table_prefix . 'log'); +define('LOGIN_ATTEMPT_TABLE', $table_prefix . 'login_attempts'); +define('MIGRATIONS_TABLE', $table_prefix . 'migrations'); +define('MODERATOR_CACHE_TABLE', $table_prefix . 'moderator_cache'); +define('MODULES_TABLE', $table_prefix . 'modules'); +define('NOTIFICATION_TYPES_TABLE', $table_prefix . 'notification_types'); +define('NOTIFICATIONS_TABLE', $table_prefix . 'notifications'); +define('POLL_OPTIONS_TABLE', $table_prefix . 'poll_options'); +define('POLL_VOTES_TABLE', $table_prefix . 'poll_votes'); +define('POSTS_TABLE', $table_prefix . 'posts'); +define('PRIVMSGS_TABLE', $table_prefix . 'privmsgs'); +define('PRIVMSGS_FOLDER_TABLE', $table_prefix . 'privmsgs_folder'); +define('PRIVMSGS_RULES_TABLE', $table_prefix . 'privmsgs_rules'); +define('PRIVMSGS_TO_TABLE', $table_prefix . 'privmsgs_to'); +define('PROFILE_FIELDS_TABLE', $table_prefix . 'profile_fields'); +define('PROFILE_FIELDS_DATA_TABLE', $table_prefix . 'profile_fields_data'); +define('PROFILE_FIELDS_LANG_TABLE', $table_prefix . 'profile_fields_lang'); +define('PROFILE_LANG_TABLE', $table_prefix . 'profile_lang'); +define('RANKS_TABLE', $table_prefix . 'ranks'); +define('REPORTS_TABLE', $table_prefix . 'reports'); +define('REPORTS_REASONS_TABLE', $table_prefix . 'reports_reasons'); +define('SEARCH_RESULTS_TABLE', $table_prefix . 'search_results'); +define('SEARCH_WORDLIST_TABLE', $table_prefix . 'search_wordlist'); +define('SEARCH_WORDMATCH_TABLE', $table_prefix . 'search_wordmatch'); +define('SESSIONS_TABLE', $table_prefix . 'sessions'); +define('SESSIONS_KEYS_TABLE', $table_prefix . 'sessions_keys'); +define('SITELIST_TABLE', $table_prefix . 'sitelist'); +define('SMILIES_TABLE', $table_prefix . 'smilies'); +define('SPHINX_TABLE', $table_prefix . 'sphinx'); +define('STYLES_TABLE', $table_prefix . 'styles'); +define('STYLES_TEMPLATE_TABLE', $table_prefix . 'styles_template'); +define('STYLES_TEMPLATE_DATA_TABLE',$table_prefix . 'styles_template_data'); +define('STYLES_THEME_TABLE', $table_prefix . 'styles_theme'); +define('STYLES_IMAGESET_TABLE', $table_prefix . 'styles_imageset'); +define('STYLES_IMAGESET_DATA_TABLE',$table_prefix . 'styles_imageset_data'); +define('TEAMPAGE_TABLE', $table_prefix . 'teampage'); +define('TOPICS_TABLE', $table_prefix . 'topics'); +define('TOPICS_POSTED_TABLE', $table_prefix . 'topics_posted'); +define('TOPICS_TRACK_TABLE', $table_prefix . 'topics_track'); +define('TOPICS_WATCH_TABLE', $table_prefix . 'topics_watch'); +define('USER_GROUP_TABLE', $table_prefix . 'user_group'); +define('USER_NOTIFICATIONS_TABLE', $table_prefix . 'user_notifications'); +define('USERS_TABLE', $table_prefix . 'users'); +define('WARNINGS_TABLE', $table_prefix . 'warnings'); +define('WORDS_TABLE', $table_prefix . 'words'); +define('ZEBRA_TABLE', $table_prefix . 'zebra'); + +// Additional tables diff --git a/sources/phpBB/includes/diff/diff.php b/sources/phpBB/includes/diff/diff.php new file mode 100644 index 0000000..d307880 --- /dev/null +++ b/sources/phpBB/includes/diff/diff.php @@ -0,0 +1,1152 @@ + +* @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; +} + +/** +* Code from pear.php.net, Text_Diff-1.1.0 package +* http://pear.php.net/package/Text_Diff/ +* +* Modified by phpBB Limited to meet our coding standards +* and being able to integrate into phpBB +* +* General API for generating and formatting diffs - the differences between +* two sequences of strings. +* +* Copyright 2004 Geoffrey T. Dairiki +* Copyright 2004-2008 The Horde Project (http://www.horde.org/) +* +* @package diff +* @author Geoffrey T. Dairiki +*/ +class diff +{ + /** + * Array of changes. + * @var array + */ + var $_edits; + + /** + * Computes diffs between sequences of strings. + * + * @param array &$from_content An array of strings. Typically these are lines from a file. + * @param array &$to_content An array of strings. + * @param bool $preserve_cr If true, \r is replaced by a new line in the diff output + */ + function diff(&$from_content, &$to_content, $preserve_cr = true) + { + $diff_engine = new diff_engine(); + $this->_edits = $diff_engine->diff($from_content, $to_content, $preserve_cr); + } + + /** + * Returns the array of differences. + */ + function get_diff() + { + return $this->_edits; + } + + /** + * returns the number of new (added) lines in a given diff. + * + * @since Text_Diff 1.1.0 + * + * @return integer The number of new lines + */ + function count_added_lines() + { + $count = 0; + + for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++) + { + $edit = $this->_edits[$i]; + + if (is_a($edit, 'diff_op_add') || is_a($edit, 'diff_op_change')) + { + $count += $edit->nfinal(); + } + } + return $count; + } + + /** + * Returns the number of deleted (removed) lines in a given diff. + * + * @since Text_Diff 1.1.0 + * + * @return integer The number of deleted lines + */ + function count_deleted_lines() + { + $count = 0; + + for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++) + { + $edit = $this->_edits[$i]; + + if (is_a($edit, 'diff_op_delete') || is_a($edit, 'diff_op_change')) + { + $count += $edit->norig(); + } + } + return $count; + } + + /** + * Computes a reversed diff. + * + * Example: + * + * $diff = new diff($lines1, $lines2); + * $rev = $diff->reverse(); + * + * + * @return diff A Diff object representing the inverse of the original diff. + * Note that we purposely don't return a reference here, since + * this essentially is a clone() method. + */ + function reverse() + { + if (version_compare(zend_version(), '2', '>')) + { + $rev = clone($this); + } + else + { + $rev = $this; + } + + $rev->_edits = array(); + + for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++) + { + $edit = $this->_edits[$i]; + $rev->_edits[] = $edit->reverse(); + } + + return $rev; + } + + /** + * Checks for an empty diff. + * + * @return boolean True if two sequences were identical. + */ + function is_empty() + { + for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++) + { + $edit = $this->_edits[$i]; + + // skip diff_op_copy + if (is_a($edit, 'diff_op_copy')) + { + continue; + } + + if (is_a($edit, 'diff_op_delete') || is_a($edit, 'diff_op_add')) + { + $orig = $edit->orig; + $final = $edit->final; + + // We can simplify one case where the array is usually supposed to be empty... + if (sizeof($orig) == 1 && trim($orig[0]) === '') $orig = array(); + if (sizeof($final) == 1 && trim($final[0]) === '') $final = array(); + + if (!$orig && !$final) + { + continue; + } + + return false; + } + + return false; + } + + return true; + } + + /** + * Computes the length of the Longest Common Subsequence (LCS). + * + * This is mostly for diagnostic purposes. + * + * @return integer The length of the LCS. + */ + function lcs() + { + $lcs = 0; + + for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++) + { + $edit = $this->_edits[$i]; + + if (is_a($edit, 'diff_op_copy')) + { + $lcs += sizeof($edit->orig); + } + } + return $lcs; + } + + /** + * Gets the original set of lines. + * + * This reconstructs the $from_lines parameter passed to the constructor. + * + * @return array The original sequence of strings. + */ + function get_original() + { + $lines = array(); + + for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++) + { + $edit = $this->_edits[$i]; + + if ($edit->orig) + { + array_splice($lines, sizeof($lines), 0, $edit->orig); + } + } + return $lines; + } + + /** + * Gets the final set of lines. + * + * This reconstructs the $to_lines parameter passed to the constructor. + * + * @return array The sequence of strings. + */ + function get_final() + { + $lines = array(); + + for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++) + { + $edit = $this->_edits[$i]; + + if ($edit->final) + { + array_splice($lines, sizeof($lines), 0, $edit->final); + } + } + return $lines; + } + + /** + * Removes trailing newlines from a line of text. This is meant to be used with array_walk(). + * + * @param string &$line The line to trim. + * @param integer $key The index of the line in the array. Not used. + */ + function trim_newlines(&$line, $key) + { + $line = str_replace(array("\n", "\r"), '', $line); + } + + /** + * Checks a diff for validity. + * + * This is here only for debugging purposes. + */ + function _check($from_lines, $to_lines) + { + if (serialize($from_lines) != serialize($this->get_original())) + { + trigger_error("[diff] Reconstructed original doesn't match", E_USER_ERROR); + } + + if (serialize($to_lines) != serialize($this->get_final())) + { + trigger_error("[diff] Reconstructed final doesn't match", E_USER_ERROR); + } + + $rev = $this->reverse(); + + if (serialize($to_lines) != serialize($rev->get_original())) + { + trigger_error("[diff] Reversed original doesn't match", E_USER_ERROR); + } + + if (serialize($from_lines) != serialize($rev->get_final())) + { + trigger_error("[diff] Reversed final doesn't match", E_USER_ERROR); + } + + $prevtype = null; + + for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++) + { + $edit = $this->_edits[$i]; + + if ($prevtype == get_class($edit)) + { + trigger_error("[diff] Edit sequence is non-optimal", E_USER_ERROR); + } + $prevtype = get_class($edit); + } + + return true; + } +} + +/** +* @package diff +* @author Geoffrey T. Dairiki +*/ +class mapped_diff extends diff +{ + /** + * Computes a diff between sequences of strings. + * + * This can be used to compute things like case-insensitve diffs, or diffs + * which ignore changes in white-space. + * + * @param array $from_lines An array of strings. + * @param array $to_lines An array of strings. + * @param array $mapped_from_lines This array should have the same size number of elements as $from_lines. + * The elements in $mapped_from_lines and $mapped_to_lines are what is actually + * compared when computing the diff. + * @param array $mapped_to_lines This array should have the same number of elements as $to_lines. + */ + function mapped_diff(&$from_lines, &$to_lines, &$mapped_from_lines, &$mapped_to_lines) + { + if (sizeof($from_lines) != sizeof($mapped_from_lines) || sizeof($to_lines) != sizeof($mapped_to_lines)) + { + return false; + } + + parent::diff($mapped_from_lines, $mapped_to_lines); + + $xi = $yi = 0; + for ($i = 0; $i < sizeof($this->_edits); $i++) + { + $orig = &$this->_edits[$i]->orig; + if (is_array($orig)) + { + $orig = array_slice($from_lines, $xi, sizeof($orig)); + $xi += sizeof($orig); + } + + $final = &$this->_edits[$i]->final; + if (is_array($final)) + { + $final = array_slice($to_lines, $yi, sizeof($final)); + $yi += sizeof($final); + } + } + } +} + +/** +* @package diff +* @author Geoffrey T. Dairiki +* +* @access private +*/ +class diff_op +{ + var $orig; + var $final; + + function &reverse() + { + trigger_error('[diff] Abstract method', E_USER_ERROR); + } + + function norig() + { + return ($this->orig) ? sizeof($this->orig) : 0; + } + + function nfinal() + { + return ($this->final) ? sizeof($this->final) : 0; + } +} + +/** +* @package diff +* @author Geoffrey T. Dairiki +* +* @access private +*/ +class diff_op_copy extends diff_op +{ + function diff_op_copy($orig, $final = false) + { + if (!is_array($final)) + { + $final = $orig; + } + $this->orig = $orig; + $this->final = $final; + } + + function &reverse() + { + $reverse = new diff_op_copy($this->final, $this->orig); + return $reverse; + } +} + +/** +* @package diff +* @author Geoffrey T. Dairiki +* +* @access private +*/ +class diff_op_delete extends diff_op +{ + function diff_op_delete($lines) + { + $this->orig = $lines; + $this->final = false; + } + + function &reverse() + { + $reverse = new diff_op_add($this->orig); + return $reverse; + } +} + +/** +* @package diff +* @author Geoffrey T. Dairiki +* +* @access private +*/ +class diff_op_add extends diff_op +{ + function diff_op_add($lines) + { + $this->final = $lines; + $this->orig = false; + } + + function &reverse() + { + $reverse = new diff_op_delete($this->final); + return $reverse; + } +} + +/** +* @package diff +* @author Geoffrey T. Dairiki +* +* @access private +*/ +class diff_op_change extends diff_op +{ + function diff_op_change($orig, $final) + { + $this->orig = $orig; + $this->final = $final; + } + + function &reverse() + { + $reverse = new diff_op_change($this->final, $this->orig); + return $reverse; + } +} + + +/** +* A class for computing three way diffs. +* +* @package diff +* @author Geoffrey T. Dairiki +*/ +class diff3 extends diff +{ + /** + * Conflict counter. + * @var integer + */ + var $_conflicting_blocks = 0; + + /** + * Computes diff between 3 sequences of strings. + * + * @param array &$orig The original lines to use. + * @param array &$final1 The first version to compare to. + * @param array &$final2 The second version to compare to. + * @param bool $preserve_cr If true, \r\n and bare \r are replaced by a new line + * in the diff output + */ + function diff3(&$orig, &$final1, &$final2, $preserve_cr = true) + { + $diff_engine = new diff_engine(); + + $diff_1 = $diff_engine->diff($orig, $final1, $preserve_cr); + $diff_2 = $diff_engine->diff($orig, $final2, $preserve_cr); + + unset($diff_engine); + + $this->_edits = $this->_diff3($diff_1, $diff_2); + } + + /** + * Return number of conflicts + */ + function get_num_conflicts() + { + $conflicts = 0; + + for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++) + { + $edit = $this->_edits[$i]; + + if ($edit->is_conflict()) + { + $conflicts++; + } + } + + return $conflicts; + } + + /** + * Get conflicts content for download. This is generally a merged file, but preserving conflicts and adding explanations to it. + * A user could then go through this file, search for the conflicts and changes the code accordingly. + * + * @param string $label1 the cvs file version/label from the original set of lines + * @param string $label2 the cvs file version/label from the new set of lines + * @param string $label_sep the explanation between label1 and label2 - more of a helper for the user + * + * @return mixed the merged output + */ + function get_conflicts_content($label1 = 'CURRENT_FILE', $label2 = 'NEW_FILE', $label_sep = 'DIFF_SEP_EXPLAIN') + { + global $user; + + $label1 = (!empty($user->lang[$label1])) ? $user->lang[$label1] : $label1; + $label2 = (!empty($user->lang[$label2])) ? $user->lang[$label2] : $label2; + $label_sep = (!empty($user->lang[$label_sep])) ? $user->lang[$label_sep] : $label_sep; + + $lines = array(); + + for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++) + { + $edit = $this->_edits[$i]; + + if ($edit->is_conflict()) + { + // Start conflict label + $label_start = array('<<<<<<< ' . $label1); + $label_mid = array('======= ' . $label_sep); + $label_end = array('>>>>>>> ' . $label2); + + $lines = array_merge($lines, $label_start, $edit->final1, $label_mid, $edit->final2, $label_end); + $this->_conflicting_blocks++; + } + else + { + $lines = array_merge($lines, $edit->merged()); + } + } + + return $lines; + } + + /** + * Return merged output (used by the renderer) + * + * @return mixed the merged output + */ + function merged_output() + { + return $this->get_conflicts_content(); + } + + /** + * Merge the output and use the new file code for conflicts + */ + function merged_new_output() + { + $lines = array(); + + for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++) + { + $edit = $this->_edits[$i]; + + if ($edit->is_conflict()) + { + $lines = array_merge($lines, $edit->final2); + } + else + { + $lines = array_merge($lines, $edit->merged()); + } + } + + return $lines; + } + + /** + * Merge the output and use the original file code for conflicts + */ + function merged_orig_output() + { + $lines = array(); + + for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++) + { + $edit = $this->_edits[$i]; + + if ($edit->is_conflict()) + { + $lines = array_merge($lines, $edit->final1); + } + else + { + $lines = array_merge($lines, $edit->merged()); + } + } + + return $lines; + } + + /** + * Get conflicting block(s) + */ + function get_conflicts() + { + $conflicts = array(); + + for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++) + { + $edit = $this->_edits[$i]; + + if ($edit->is_conflict()) + { + $conflicts[] = array($edit->final1, $edit->final2); + } + } + + return $conflicts; + } + + /** + * @access private + */ + function _diff3(&$edits1, &$edits2) + { + $edits = array(); + $bb = new diff3_block_builder(); + + $e1 = current($edits1); + $e2 = current($edits2); + + while ($e1 || $e2) + { + if ($e1 && $e2 && is_a($e1, 'diff_op_copy') && is_a($e2, 'diff_op_copy')) + { + // We have copy blocks from both diffs. This is the (only) time we want to emit a diff3 copy block. + // Flush current diff3 diff block, if any. + if ($edit = $bb->finish()) + { + $edits[] = $edit; + } + + $ncopy = min($e1->norig(), $e2->norig()); + $edits[] = new diff3_op_copy(array_slice($e1->orig, 0, $ncopy)); + + if ($e1->norig() > $ncopy) + { + array_splice($e1->orig, 0, $ncopy); + array_splice($e1->final, 0, $ncopy); + } + else + { + $e1 = next($edits1); + } + + if ($e2->norig() > $ncopy) + { + array_splice($e2->orig, 0, $ncopy); + array_splice($e2->final, 0, $ncopy); + } + else + { + $e2 = next($edits2); + } + } + else + { + if ($e1 && $e2) + { + if ($e1->orig && $e2->orig) + { + $norig = min($e1->norig(), $e2->norig()); + $orig = array_splice($e1->orig, 0, $norig); + array_splice($e2->orig, 0, $norig); + $bb->input($orig); + } + else + { + $norig = 0; + } + + if (is_a($e1, 'diff_op_copy')) + { + $bb->out1(array_splice($e1->final, 0, $norig)); + } + + if (is_a($e2, 'diff_op_copy')) + { + $bb->out2(array_splice($e2->final, 0, $norig)); + } + } + + if ($e1 && ! $e1->orig) + { + $bb->out1($e1->final); + $e1 = next($edits1); + } + + if ($e2 && ! $e2->orig) + { + $bb->out2($e2->final); + $e2 = next($edits2); + } + } + } + + if ($edit = $bb->finish()) + { + $edits[] = $edit; + } + + return $edits; + } +} + +/** +* @package diff +* @author Geoffrey T. Dairiki +* +* @access private +*/ +class diff3_op +{ + function diff3_op($orig = false, $final1 = false, $final2 = false) + { + $this->orig = $orig ? $orig : array(); + $this->final1 = $final1 ? $final1 : array(); + $this->final2 = $final2 ? $final2 : array(); + } + + function merged() + { + if (!isset($this->_merged)) + { + // Prepare the arrays before we compare them. ;) + $this->solve_prepare(); + + if ($this->final1 === $this->final2) + { + $this->_merged = &$this->final1; + } + else if ($this->final1 === $this->orig) + { + $this->_merged = &$this->final2; + } + else if ($this->final2 === $this->orig) + { + $this->_merged = &$this->final1; + } + else + { + // The following tries to aggressively solve conflicts... + $this->_merged = false; + $this->solve_conflict(); + } + } + + return $this->_merged; + } + + function is_conflict() + { + return ($this->merged() === false) ? true : false; + } + + /** + * Function to prepare the arrays for comparing - we want to skip over newline changes + * @author acydburn + */ + function solve_prepare() + { + // We can simplify one case where the array is usually supposed to be empty... + if (sizeof($this->orig) == 1 && trim($this->orig[0]) === '') $this->orig = array(); + if (sizeof($this->final1) == 1 && trim($this->final1[0]) === '') $this->final1 = array(); + if (sizeof($this->final2) == 1 && trim($this->final2[0]) === '') $this->final2 = array(); + + // Now we only can have the case where the only difference between arrays are newlines, so compare all cases + + // First, some strings we can compare... + $orig = $final1 = $final2 = ''; + + foreach ($this->orig as $null => $line) $orig .= trim($line); + foreach ($this->final1 as $null => $line) $final1 .= trim($line); + foreach ($this->final2 as $null => $line) $final2 .= trim($line); + + // final1 === final2 + if ($final1 === $final2) + { + // We preserve the part which will be used in the merge later + $this->final2 = $this->final1; + } + // final1 === orig + else if ($final1 === $orig) + { + // Here it does not really matter what we choose, but we will use the new code + $this->orig = $this->final1; + } + // final2 === orig + else if ($final2 === $orig) + { + // Here it does not really matter too (final1 will be used), but we will use the new code + $this->orig = $this->final2; + } + } + + /** + * Find code portions from $orig in $final1 and use $final2 as merged instance if provided + * @author acydburn + */ + function _compare_conflict_seq($orig, $final1, $final2 = false) + { + $result = array('merge_found' => false, 'merge' => array()); + + $_orig = &$this->$orig; + $_final1 = &$this->$final1; + + // Ok, we basically search for $orig in $final1 + $compare_seq = sizeof($_orig); + + // Go through the conflict code + for ($i = 0, $j = 0, $size = sizeof($_final1); $i < $size; $i++, $j = $i) + { + $line = $_final1[$i]; + $skip = 0; + + for ($x = 0; $x < $compare_seq; $x++) + { + // Try to skip all matching lines + if (trim($line) === trim($_orig[$x])) + { + $line = (++$j < $size) ? $_final1[$j] : $line; + $skip++; + } + } + + if ($skip === $compare_seq) + { + $result['merge_found'] = true; + + if ($final2 !== false) + { + $result['merge'] = array_merge($result['merge'], $this->$final2); + } + $i += ($skip - 1); + } + else if ($final2 !== false) + { + $result['merge'][] = $line; + } + } + + return $result; + } + + /** + * Tries to solve conflicts aggressively based on typical "assumptions" + * @author acydburn + */ + function solve_conflict() + { + $this->_merged = false; + + // CASE ONE: orig changed into final2, but modified/unknown code in final1. + // IF orig is found "as is" in final1 we replace the code directly in final1 and populate this as final2/merge + if (sizeof($this->orig) && sizeof($this->final2)) + { + $result = $this->_compare_conflict_seq('orig', 'final1', 'final2'); + + if ($result['merge_found']) + { + $this->final2 = $result['merge']; + $this->_merged = &$this->final2; + return; + } + + $result = $this->_compare_conflict_seq('final2', 'final1'); + + if ($result['merge_found']) + { + $this->_merged = &$this->final1; + return; + } + + // Try to solve $Id$ issues. ;) + if (sizeof($this->orig) == 1 && sizeof($this->final1) == 1 && sizeof($this->final2) == 1) + { + $match = '#^' . preg_quote('* @version $Id: ', '#') . '[a-z\._\- ]+[0-9]+ [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9\:Z]+ [a-z0-9_\- ]+\$$#'; + + if (preg_match($match, $this->orig[0]) && preg_match($match, $this->final1[0]) && preg_match($match, $this->final2[0])) + { + $this->_merged = &$this->final2; + return; + } + } + + $second_run = false; + + // Try to solve issues where the only reason why the above did not work is a newline being removed in the final1 code but exist in the orig/final2 code + if (trim($this->orig[0]) === '' && trim($this->final2[0]) === '') + { + unset($this->orig[0], $this->final2[0]); + $this->orig = array_values($this->orig); + $this->final2 = array_values($this->final2); + + $second_run = true; + } + + // The same is true for a line at the end. ;) + if (sizeof($this->orig) && sizeof($this->final2) && sizeof($this->orig) === sizeof($this->final2) && trim($this->orig[sizeof($this->orig)-1]) === '' && trim($this->final2[sizeof($this->final2)-1]) === '') + { + unset($this->orig[sizeof($this->orig)-1], $this->final2[sizeof($this->final2)-1]); + $this->orig = array_values($this->orig); + $this->final2 = array_values($this->final2); + + $second_run = true; + } + + if ($second_run) + { + $result = $this->_compare_conflict_seq('orig', 'final1', 'final2'); + + if ($result['merge_found']) + { + $this->final2 = $result['merge']; + $this->_merged = &$this->final2; + return; + } + + $result = $this->_compare_conflict_seq('final2', 'final1'); + + if ($result['merge_found']) + { + $this->_merged = &$this->final1; + return; + } + } + + return; + } + + // CASE TWO: Added lines from orig to final2 but final1 had added lines too. Just merge them. + if (!sizeof($this->orig) && $this->final1 !== $this->final2 && sizeof($this->final1) && sizeof($this->final2)) + { + $result = $this->_compare_conflict_seq('final2', 'final1'); + + if ($result['merge_found']) + { + $this->final2 = $this->final1; + $this->_merged = &$this->final1; + } + else + { + $result = $this->_compare_conflict_seq('final1', 'final2'); + + if (!$result['merge_found']) + { + $this->final2 = array_merge($this->final1, $this->final2); + $this->_merged = &$this->final2; + } + else + { + $this->final2 = $this->final1; + $this->_merged = &$this->final1; + } + } + + return; + } + + // CASE THREE: Removed lines (orig has the to-remove line(s), but final1 has additional lines which does not need to be removed). Just remove orig from final1 and then use final1 as final2/merge + if (!sizeof($this->final2) && sizeof($this->orig) && sizeof($this->final1) && $this->orig !== $this->final1) + { + $result = $this->_compare_conflict_seq('orig', 'final1'); + + if (!$result['merge_found']) + { + return; + } + + // First of all, try to find the code in orig in final1. ;) + $compare_seq = sizeof($this->orig); + $begin = $end = -1; + $j = 0; + + for ($i = 0, $size = sizeof($this->final1); $i < $size; $i++) + { + $line = $this->final1[$i]; + + if (trim($line) === trim($this->orig[$j])) + { + // Mark begin + if ($begin === -1) + { + $begin = $i; + } + + // End is always $i, the last found line + $end = $i; + + if (isset($this->orig[$j+1])) + { + $j++; + } + } + } + + if ($begin !== -1 && $begin + ($compare_seq - 1) == $end) + { + foreach ($this->final1 as $i => $line) + { + if ($i < $begin || $i > $end) + { + $merged[] = $line; + } + } + + $this->final2 = $merged; + $this->_merged = &$this->final2; + } + + return; + } + + return; + } +} + +/** +* @package diff +* @author Geoffrey T. Dairiki +* +* @access private +*/ +class diff3_op_copy extends diff3_op +{ + function diff3_op_copy($lines = false) + { + $this->orig = $lines ? $lines : array(); + $this->final1 = &$this->orig; + $this->final2 = &$this->orig; + } + + function merged() + { + return $this->orig; + } + + function is_conflict() + { + return false; + } +} + +/** +* @package diff +* @author Geoffrey T. Dairiki +* +* @access private +*/ +class diff3_block_builder +{ + function diff3_block_builder() + { + $this->_init(); + } + + function input($lines) + { + if ($lines) + { + $this->_append($this->orig, $lines); + } + } + + function out1($lines) + { + if ($lines) + { + $this->_append($this->final1, $lines); + } + } + + function out2($lines) + { + if ($lines) + { + $this->_append($this->final2, $lines); + } + } + + function is_empty() + { + return !$this->orig && !$this->final1 && !$this->final2; + } + + function finish() + { + if ($this->is_empty()) + { + return false; + } + else + { + $edit = new diff3_op($this->orig, $this->final1, $this->final2); + $this->_init(); + return $edit; + } + } + + function _init() + { + $this->orig = $this->final1 = $this->final2 = array(); + } + + function _append(&$array, $lines) + { + array_splice($array, sizeof($array), 0, $lines); + } +} diff --git a/sources/phpBB/includes/diff/engine.php b/sources/phpBB/includes/diff/engine.php new file mode 100644 index 0000000..bc21b3b --- /dev/null +++ b/sources/phpBB/includes/diff/engine.php @@ -0,0 +1,555 @@ + +* @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; +} + +/** +* Code from pear.php.net, Text_Diff-1.1.0 package +* http://pear.php.net/package/Text_Diff/ (native engine) +* +* Modified by phpBB Limited to meet our coding standards +* and being able to integrate into phpBB +* +* Class used internally by Text_Diff to actually compute the diffs. This +* class is implemented using native PHP code. +* +* The algorithm used here is mostly lifted from the perl module +* Algorithm::Diff (version 1.06) by Ned Konz, which is available at: +* http://www.perl.com/CPAN/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip +* +* More ideas are taken from: http://www.ics.uci.edu/~eppstein/161/960229.html +* +* Some ideas (and a bit of code) are taken from analyze.c, of GNU +* diffutils-2.7, which can be found at: +* ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz +* +* Some ideas (subdivision by NCHUNKS > 2, and some optimizations) are from +* Geoffrey T. Dairiki . The original PHP version of this +* code was written by him, and is used/adapted with his permission. +* +* Copyright 2004-2008 The Horde Project (http://www.horde.org/) +* +* @author Geoffrey T. Dairiki +* @package diff +* +* @access private +*/ +class diff_engine +{ + /** + * If set to true we trim all lines before we compare them. This ensures that sole space/tab changes do not trigger diffs. + */ + var $skip_whitespace_changes = true; + + function diff(&$from_lines, &$to_lines, $preserve_cr = true) + { + // Remove empty lines... + // If preserve_cr is true, we basically only change \r\n and bare \r to \n to get the same carriage returns for both files + // If it is false, we try to only use \n once per line and ommit all empty lines to be able to get a proper data diff + + if (is_array($from_lines)) + { + $from_lines = implode("\n", $from_lines); + } + + if (is_array($to_lines)) + { + $to_lines = implode("\n", $to_lines); + } + + if ($preserve_cr) + { + $from_lines = explode("\n", str_replace("\r", "\n", str_replace("\r\n", "\n", $from_lines))); + $to_lines = explode("\n", str_replace("\r", "\n", str_replace("\r\n", "\n", $to_lines))); + } + else + { + $from_lines = explode("\n", preg_replace('#[\n\r]+#', "\n", $from_lines)); + $to_lines = explode("\n", preg_replace('#[\n\r]+#', "\n", $to_lines)); + } + + $n_from = sizeof($from_lines); + $n_to = sizeof($to_lines); + + $this->xchanged = $this->ychanged = $this->xv = $this->yv = $this->xind = $this->yind = array(); + unset($this->seq, $this->in_seq, $this->lcs); + + // Skip leading common lines. + for ($skip = 0; $skip < $n_from && $skip < $n_to; $skip++) + { + if (trim($from_lines[$skip]) !== trim($to_lines[$skip])) + { + break; + } + $this->xchanged[$skip] = $this->ychanged[$skip] = false; + } + + // Skip trailing common lines. + $xi = $n_from; + $yi = $n_to; + + for ($endskip = 0; --$xi > $skip && --$yi > $skip; $endskip++) + { + if (trim($from_lines[$xi]) !== trim($to_lines[$yi])) + { + break; + } + $this->xchanged[$xi] = $this->ychanged[$yi] = false; + } + + // Ignore lines which do not exist in both files. + for ($xi = $skip; $xi < $n_from - $endskip; $xi++) + { + if ($this->skip_whitespace_changes) $xhash[trim($from_lines[$xi])] = 1; else $xhash[$from_lines[$xi]] = 1; + } + + for ($yi = $skip; $yi < $n_to - $endskip; $yi++) + { + $line = ($this->skip_whitespace_changes) ? trim($to_lines[$yi]) : $to_lines[$yi]; + + if (($this->ychanged[$yi] = empty($xhash[$line]))) + { + continue; + } + $yhash[$line] = 1; + $this->yv[] = $line; + $this->yind[] = $yi; + } + + for ($xi = $skip; $xi < $n_from - $endskip; $xi++) + { + $line = ($this->skip_whitespace_changes) ? trim($from_lines[$xi]) : $from_lines[$xi]; + + if (($this->xchanged[$xi] = empty($yhash[$line]))) + { + continue; + } + $this->xv[] = $line; + $this->xind[] = $xi; + } + + // Find the LCS. + $this->_compareseq(0, sizeof($this->xv), 0, sizeof($this->yv)); + + // Merge edits when possible. + if ($this->skip_whitespace_changes) + { + $from_lines_clean = array_map('trim', $from_lines); + $to_lines_clean = array_map('trim', $to_lines); + + $this->_shift_boundaries($from_lines_clean, $this->xchanged, $this->ychanged); + $this->_shift_boundaries($to_lines_clean, $this->ychanged, $this->xchanged); + + unset($from_lines_clean, $to_lines_clean); + } + else + { + $this->_shift_boundaries($from_lines, $this->xchanged, $this->ychanged); + $this->_shift_boundaries($to_lines, $this->ychanged, $this->xchanged); + } + + // Compute the edit operations. + $edits = array(); + $xi = $yi = 0; + + while ($xi < $n_from || $yi < $n_to) + { + // Skip matching "snake". + $copy = array(); + + while ($xi < $n_from && $yi < $n_to && !$this->xchanged[$xi] && !$this->ychanged[$yi]) + { + $copy[] = $from_lines[$xi++]; + $yi++; + } + + if ($copy) + { + $edits[] = new diff_op_copy($copy); + } + + // Find deletes & adds. + $delete = array(); + while ($xi < $n_from && $this->xchanged[$xi]) + { + $delete[] = $from_lines[$xi++]; + } + + $add = array(); + while ($yi < $n_to && $this->ychanged[$yi]) + { + $add[] = $to_lines[$yi++]; + } + + if ($delete && $add) + { + $edits[] = new diff_op_change($delete, $add); + } + else if ($delete) + { + $edits[] = new diff_op_delete($delete); + } + else if ($add) + { + $edits[] = new diff_op_add($add); + } + } + + return $edits; + } + + /** + * Divides the Largest Common Subsequence (LCS) of the sequences (XOFF, + * XLIM) and (YOFF, YLIM) into NCHUNKS approximately equally sized segments. + * + * Returns (LCS, PTS). LCS is the length of the LCS. PTS is an array of + * NCHUNKS+1 (X, Y) indexes giving the diving points between sub + * sequences. The first sub-sequence is contained in (X0, X1), (Y0, Y1), + * the second in (X1, X2), (Y1, Y2) and so on. Note that (X0, Y0) == + * (XOFF, YOFF) and (X[NCHUNKS], Y[NCHUNKS]) == (XLIM, YLIM). + * + * This function assumes that the first lines of the specified portions of + * the two files do not match, and likewise that the last lines do not + * match. The caller must trim matching lines from the beginning and end + * of the portions it is going to specify. + */ + function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) + { + $flip = false; + + if ($xlim - $xoff > $ylim - $yoff) + { + // Things seems faster (I'm not sure I understand why) when the shortest sequence is in X. + $flip = true; + list($xoff, $xlim, $yoff, $ylim) = array($yoff, $ylim, $xoff, $xlim); + } + + if ($flip) + { + for ($i = $ylim - 1; $i >= $yoff; $i--) + { + $ymatches[$this->xv[$i]][] = $i; + } + } + else + { + for ($i = $ylim - 1; $i >= $yoff; $i--) + { + $ymatches[$this->yv[$i]][] = $i; + } + } + + $this->lcs = 0; + $this->seq[0]= $yoff - 1; + $this->in_seq = array(); + $ymids[0] = array(); + + $numer = $xlim - $xoff + $nchunks - 1; + $x = $xoff; + + for ($chunk = 0; $chunk < $nchunks; $chunk++) + { + if ($chunk > 0) + { + for ($i = 0; $i <= $this->lcs; $i++) + { + $ymids[$i][$chunk - 1] = $this->seq[$i]; + } + } + + $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $chunk) / $nchunks); + + for (; $x < $x1; $x++) + { + $line = $flip ? $this->yv[$x] : $this->xv[$x]; + if (empty($ymatches[$line])) + { + continue; + } + $matches = $ymatches[$line]; + + reset($matches); + while (list(, $y) = each($matches)) + { + if (empty($this->in_seq[$y])) + { + $k = $this->_lcs_pos($y); + $ymids[$k] = $ymids[$k - 1]; + break; + } + } + + // no reset() here + while (list(, $y) = each($matches)) + { + if ($y > $this->seq[$k - 1]) + { + // Optimization: this is a common case: next match is just replacing previous match. + $this->in_seq[$this->seq[$k]] = false; + $this->seq[$k] = $y; + $this->in_seq[$y] = 1; + } + else if (empty($this->in_seq[$y])) + { + $k = $this->_lcs_pos($y); + $ymids[$k] = $ymids[$k - 1]; + } + } + } + } + + $seps[] = $flip ? array($yoff, $xoff) : array($xoff, $yoff); + $ymid = $ymids[$this->lcs]; + + for ($n = 0; $n < $nchunks - 1; $n++) + { + $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $n) / $nchunks); + $y1 = $ymid[$n] + 1; + $seps[] = $flip ? array($y1, $x1) : array($x1, $y1); + } + $seps[] = $flip ? array($ylim, $xlim) : array($xlim, $ylim); + + return array($this->lcs, $seps); + } + + function _lcs_pos($ypos) + { + $end = $this->lcs; + + if ($end == 0 || $ypos > $this->seq[$end]) + { + $this->seq[++$this->lcs] = $ypos; + $this->in_seq[$ypos] = 1; + return $this->lcs; + } + + $beg = 1; + while ($beg < $end) + { + $mid = (int)(($beg + $end) / 2); + if ($ypos > $this->seq[$mid]) + { + $beg = $mid + 1; + } + else + { + $end = $mid; + } + } + + $this->in_seq[$this->seq[$end]] = false; + $this->seq[$end] = $ypos; + $this->in_seq[$ypos] = 1; + + return $end; + } + + /** + * Finds LCS of two sequences. + * + * The results are recorded in the vectors $this->{x,y}changed[], by + * storing a 1 in the element for each line that is an insertion or + * deletion (ie. is not in the LCS). + * + * The subsequence of file 0 is (XOFF, XLIM) and likewise for file 1. + * + * Note that XLIM, YLIM are exclusive bounds. All line numbers are + * origin-0 and discarded lines are not counted. + */ + function _compareseq($xoff, $xlim, $yoff, $ylim) + { + // Slide down the bottom initial diagonal. + while ($xoff < $xlim && $yoff < $ylim && $this->xv[$xoff] == $this->yv[$yoff]) + { + ++$xoff; + ++$yoff; + } + + // Slide up the top initial diagonal. + while ($xlim > $xoff && $ylim > $yoff && $this->xv[$xlim - 1] == $this->yv[$ylim - 1]) + { + --$xlim; + --$ylim; + } + + if ($xoff == $xlim || $yoff == $ylim) + { + $lcs = 0; + } + else + { + // This is ad hoc but seems to work well. + // $nchunks = sqrt(min($xlim - $xoff, $ylim - $yoff) / 2.5); + // $nchunks = max(2,min(8,(int)$nchunks)); + $nchunks = min(7, $xlim - $xoff, $ylim - $yoff) + 1; + list($lcs, $seps) = $this->_diag($xoff, $xlim, $yoff, $ylim, $nchunks); + } + + if ($lcs == 0) + { + // X and Y sequences have no common subsequence: mark all changed. + while ($yoff < $ylim) + { + $this->ychanged[$this->yind[$yoff++]] = 1; + } + + while ($xoff < $xlim) + { + $this->xchanged[$this->xind[$xoff++]] = 1; + } + } + else + { + // Use the partitions to split this problem into subproblems. + reset($seps); + $pt1 = $seps[0]; + + while ($pt2 = next($seps)) + { + $this->_compareseq($pt1[0], $pt2[0], $pt1[1], $pt2[1]); + $pt1 = $pt2; + } + } + } + + /** + * Adjusts inserts/deletes of identical lines to join changes as much as possible. + * + * We do something when a run of changed lines include a line at one end + * and has an excluded, identical line at the other. We are free to + * choose which identical line is included. 'compareseq' usually chooses + * the one at the beginning, but usually it is cleaner to consider the + * following identical line to be the "change". + * + * This is extracted verbatim from analyze.c (GNU diffutils-2.7). + */ + function _shift_boundaries($lines, &$changed, $other_changed) + { + $i = 0; + $j = 0; + + $len = sizeof($lines); + $other_len = sizeof($other_changed); + + while (1) + { + // Scan forward to find the beginning of another run of + // changes. Also keep track of the corresponding point in the other file. + // + // Throughout this code, $i and $j are adjusted together so that + // the first $i elements of $changed and the first $j elements of + // $other_changed both contain the same number of zeros (unchanged lines). + // + // Furthermore, $j is always kept so that $j == $other_len or $other_changed[$j] == false. + while ($j < $other_len && $other_changed[$j]) + { + $j++; + } + + while ($i < $len && ! $changed[$i]) + { + $i++; + $j++; + + while ($j < $other_len && $other_changed[$j]) + { + $j++; + } + } + + if ($i == $len) + { + break; + } + + $start = $i; + + // Find the end of this run of changes. + while (++$i < $len && $changed[$i]) + { + continue; + } + + do + { + // Record the length of this run of changes, so that we can later determine whether the run has grown. + $runlength = $i - $start; + + // Move the changed region back, so long as the previous unchanged line matches the last changed one. + // This merges with previous changed regions. + while ($start > 0 && $lines[$start - 1] == $lines[$i - 1]) + { + $changed[--$start] = 1; + $changed[--$i] = false; + + while ($start > 0 && $changed[$start - 1]) + { + $start--; + } + + while ($other_changed[--$j]) + { + continue; + } + } + + // Set CORRESPONDING to the end of the changed run, at the last point where it corresponds to a changed run in the + // other file. CORRESPONDING == LEN means no such point has been found. + $corresponding = $j < $other_len ? $i : $len; + + // Move the changed region forward, so long as the first changed line matches the following unchanged one. + // This merges with following changed regions. + // Do this second, so that if there are no merges, the changed region is moved forward as far as possible. + while ($i < $len && $lines[$start] == $lines[$i]) + { + $changed[$start++] = false; + $changed[$i++] = 1; + + while ($i < $len && $changed[$i]) + { + $i++; + } + + $j++; + if ($j < $other_len && $other_changed[$j]) + { + $corresponding = $i; + while ($j < $other_len && $other_changed[$j]) + { + $j++; + } + } + } + } + while ($runlength != $i - $start); + + // If possible, move the fully-merged run of changes back to a corresponding run in the other file. + while ($corresponding < $i) + { + $changed[--$start] = 1; + $changed[--$i] = 0; + + while ($other_changed[--$j]) + { + continue; + } + } + } + } +} diff --git a/sources/phpBB/includes/diff/renderer.php b/sources/phpBB/includes/diff/renderer.php new file mode 100644 index 0000000..6b7f07c --- /dev/null +++ b/sources/phpBB/includes/diff/renderer.php @@ -0,0 +1,861 @@ + +* @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; +} + +/** +* Code from pear.php.net, Text_Diff-1.1.0 package +* http://pear.php.net/package/Text_Diff/ +* +* Modified by phpBB Limited to meet our coding standards +* and being able to integrate into phpBB +* +* A class to render Diffs in different formats. +* +* This class renders the diff in classic diff format. It is intended that +* this class be customized via inheritance, to obtain fancier outputs. +* +* Copyright 2004-2008 The Horde Project (http://www.horde.org/) +* +* @package diff +*/ +class diff_renderer +{ + /** + * Number of leading context "lines" to preserve. + * + * This should be left at zero for this class, but subclasses may want to + * set this to other values. + */ + var $_leading_context_lines = 0; + + /** + * Number of trailing context "lines" to preserve. + * + * This should be left at zero for this class, but subclasses may want to + * set this to other values. + */ + var $_trailing_context_lines = 0; + + /** + * Constructor. + */ + function diff_renderer($params = array()) + { + foreach ($params as $param => $value) + { + $v = '_' . $param; + if (isset($this->$v)) + { + $this->$v = $value; + } + } + } + + /** + * Get any renderer parameters. + * + * @return array All parameters of this renderer object. + */ + function get_params() + { + $params = array(); + foreach (get_object_vars($this) as $k => $v) + { + if ($k[0] == '_') + { + $params[substr($k, 1)] = $v; + } + } + + return $params; + } + + /** + * Renders a diff. + * + * @param diff &$diff A diff object. + * + * @return string The formatted output. + */ + function render(&$diff) + { + $xi = $yi = 1; + $block = false; + $context = array(); + + // Create a new diff object if it is a 3-way diff + if (is_a($diff, 'diff3')) + { + $diff3 = &$diff; + + $diff_1 = $diff3->get_original(); + $diff_2 = $diff3->merged_output(); + + unset($diff3); + + $diff = new diff($diff_1, $diff_2); + } + + $nlead = $this->_leading_context_lines; + $ntrail = $this->_trailing_context_lines; + + $output = $this->_start_diff(); + $diffs = $diff->get_diff(); + + foreach ($diffs as $i => $edit) + { + // If these are unchanged (copied) lines, and we want to keep leading or trailing context lines, extract them from the copy block. + if (is_a($edit, 'diff_op_copy')) + { + // Do we have any diff blocks yet? + if (is_array($block)) + { + // How many lines to keep as context from the copy block. + $keep = ($i == sizeof($diffs) - 1) ? $ntrail : $nlead + $ntrail; + if (sizeof($edit->orig) <= $keep) + { + // We have less lines in the block than we want for context => keep the whole block. + $block[] = $edit; + } + else + { + if ($ntrail) + { + // Create a new block with as many lines as we need for the trailing context. + $context = array_slice($edit->orig, 0, $ntrail); + $block[] = new diff_op_copy($context); + } + + $output .= $this->_block($x0, $ntrail + $xi - $x0, $y0, $ntrail + $yi - $y0, $block); + $block = false; + } + } + // Keep the copy block as the context for the next block. + $context = $edit->orig; + } + else + { + // Don't we have any diff blocks yet? + if (!is_array($block)) + { + // Extract context lines from the preceding copy block. + $context = array_slice($context, sizeof($context) - $nlead); + $x0 = $xi - sizeof($context); + $y0 = $yi - sizeof($context); + $block = array(); + + if ($context) + { + $block[] = new diff_op_copy($context); + } + } + $block[] = $edit; + } + + $xi += ($edit->orig) ? sizeof($edit->orig) : 0; + $yi += ($edit->final) ? sizeof($edit->final) : 0; + } + + if (is_array($block)) + { + $output .= $this->_block($x0, $xi - $x0, $y0, $yi - $y0, $block); + } + + return $output . $this->_end_diff(); + } + + function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) + { + $output = $this->_start_block($this->_block_header($xbeg, $xlen, $ybeg, $ylen)); + + foreach ($edits as $edit) + { + switch (get_class($edit)) + { + case 'diff_op_copy': + $output .= $this->_context($edit->orig); + break; + + case 'diff_op_add': + $output .= $this->_added($edit->final); + break; + + case 'diff_op_delete': + $output .= $this->_deleted($edit->orig); + break; + + case 'diff_op_change': + $output .= $this->_changed($edit->orig, $edit->final); + break; + } + } + + return $output . $this->_end_block(); + } + + function _start_diff() + { + return ''; + } + + function _end_diff() + { + return ''; + } + + function _block_header($xbeg, $xlen, $ybeg, $ylen) + { + if ($xlen > 1) + { + $xbeg .= ',' . ($xbeg + $xlen - 1); + } + + if ($ylen > 1) + { + $ybeg .= ',' . ($ybeg + $ylen - 1); + } + + // this matches the GNU Diff behaviour + if ($xlen && !$ylen) + { + $ybeg--; + } + else if (!$xlen) + { + $xbeg--; + } + + return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg; + } + + function _start_block($header) + { + return $header . "\n"; + } + + function _end_block() + { + return ''; + } + + function _lines($lines, $prefix = ' ') + { + return $prefix . implode("\n$prefix", $lines) . "\n"; + } + + function _context($lines) + { + return $this->_lines($lines, ' '); + } + + function _added($lines) + { + return $this->_lines($lines, '> '); + } + + function _deleted($lines) + { + return $this->_lines($lines, '< '); + } + + function _changed($orig, $final) + { + return $this->_deleted($orig) . "---\n" . $this->_added($final); + } + + /** + * Our function to get the diff + */ + function get_diff_content($diff) + { + return $this->render($diff); + } +} + +/** +* Renders a unified diff +* @package diff +*/ +class diff_renderer_unified extends diff_renderer +{ + var $_leading_context_lines = 4; + var $_trailing_context_lines = 4; + + /** + * Our function to get the diff + */ + function get_diff_content($diff) + { + return nl2br($this->render($diff)); + } + + function _block_header($xbeg, $xlen, $ybeg, $ylen) + { + if ($xlen != 1) + { + $xbeg .= ',' . $xlen; + } + + if ($ylen != 1) + { + $ybeg .= ',' . $ylen; + } + return '
@@ -' . $xbeg . ' +' . $ybeg . ' @@
'; + } + + function _context($lines) + { + return '
' . htmlspecialchars($this->_lines($lines, ' ')) . '
'; + } + + function _added($lines) + { + return '
' . htmlspecialchars($this->_lines($lines, '+')) . '
'; + } + + function _deleted($lines) + { + return '
' . htmlspecialchars($this->_lines($lines, '-')) . '
'; + } + + function _changed($orig, $final) + { + return $this->_deleted($orig) . $this->_added($final); + } + + function _start_diff() + { + $start = '
'; + + return $start; + } + + function _end_diff() + { + return '
'; + } + + function _end_block() + { + return ''; + } +} + +/** +* "Inline" diff renderer. +* +* This class renders diffs in the Wiki-style "inline" format. +* +* @author Ciprian Popovici +* @package diff +*/ +class diff_renderer_inline extends diff_renderer +{ + var $_leading_context_lines = 10000; + var $_trailing_context_lines = 10000; + + // Prefix and suffix for inserted text + var $_ins_prefix = ''; + var $_ins_suffix = ''; + + // Prefix and suffix for deleted text + var $_del_prefix = ''; + var $_del_suffix = ''; + + var $_block_head = ''; + + // What are we currently splitting on? Used to recurse to show word-level + var $_split_level = 'lines'; + + /** + * Our function to get the diff + */ + function get_diff_content($diff) + { + return '
' . nl2br($this->render($diff)) . '
'; + } + + function _start_diff() + { + return ''; + } + + function _end_diff() + { + return ''; + } + + function _block_header($xbeg, $xlen, $ybeg, $ylen) + { + return $this->_block_head; + } + + function _start_block($header) + { + return $header; + } + + function _lines($lines, $prefix = ' ', $encode = true) + { + if ($encode) + { + array_walk($lines, array(&$this, '_encode')); + } + + if ($this->_split_level == 'words') + { + return implode('', $lines); + } + else + { + return implode("\n", $lines) . "\n"; + } + } + + function _added($lines) + { + array_walk($lines, array(&$this, '_encode')); + $lines[0] = $this->_ins_prefix . $lines[0]; + $lines[sizeof($lines) - 1] .= $this->_ins_suffix; + return $this->_lines($lines, ' ', false); + } + + function _deleted($lines, $words = false) + { + array_walk($lines, array(&$this, '_encode')); + $lines[0] = $this->_del_prefix . $lines[0]; + $lines[sizeof($lines) - 1] .= $this->_del_suffix; + return $this->_lines($lines, ' ', false); + } + + function _changed($orig, $final) + { + // If we've already split on words, don't try to do so again - just display. + if ($this->_split_level == 'words') + { + $prefix = ''; + while ($orig[0] !== false && $final[0] !== false && substr($orig[0], 0, 1) == ' ' && substr($final[0], 0, 1) == ' ') + { + $prefix .= substr($orig[0], 0, 1); + $orig[0] = substr($orig[0], 1); + $final[0] = substr($final[0], 1); + } + + return $prefix . $this->_deleted($orig) . $this->_added($final); + } + + $text1 = implode("\n", $orig); + $text2 = implode("\n", $final); + + // Non-printing newline marker. + $nl = "\0"; + + // We want to split on word boundaries, but we need to preserve whitespace as well. + // Therefore we split on words, but include all blocks of whitespace in the wordlist. + $splitted_text_1 = $this->_split_on_words($text1, $nl); + $splitted_text_2 = $this->_split_on_words($text2, $nl); + + $diff = new diff($splitted_text_1, $splitted_text_2); + unset($splitted_text_1, $splitted_text_2); + + // Get the diff in inline format. + $renderer = new diff_renderer_inline(array_merge($this->get_params(), array('split_level' => 'words'))); + + // Run the diff and get the output. + return str_replace($nl, "\n", $renderer->render($diff)) . "\n"; + } + + function _split_on_words($string, $newline_escape = "\n") + { + // Ignore \0; otherwise the while loop will never finish. + $string = str_replace("\0", '', $string); + + $words = array(); + $length = strlen($string); + $pos = 0; + + $tab_there = true; + while ($pos < $length) + { + // Check for tabs... do not include them + if ($tab_there && substr($string, $pos, 1) === "\t") + { + $words[] = "\t"; + $pos++; + + continue; + } + else + { + $tab_there = false; + } + + // Eat a word with any preceding whitespace. + $spaces = strspn(substr($string, $pos), " \n"); + $nextpos = strcspn(substr($string, $pos + $spaces), " \n"); + $words[] = str_replace("\n", $newline_escape, substr($string, $pos, $spaces + $nextpos)); + $pos += $spaces + $nextpos; + } + + return $words; + } + + function _encode(&$string) + { + $string = htmlspecialchars($string); + } +} + +/** +* "raw" diff renderer. +* This class could be used to output a raw unified patch file +* +* @package diff +*/ +class diff_renderer_raw extends diff_renderer +{ + var $_leading_context_lines = 4; + var $_trailing_context_lines = 4; + + /** + * Our function to get the diff + */ + function get_diff_content($diff) + { + return ''; + } + + function _block_header($xbeg, $xlen, $ybeg, $ylen) + { + if ($xlen != 1) + { + $xbeg .= ',' . $xlen; + } + + if ($ylen != 1) + { + $ybeg .= ',' . $ylen; + } + return '@@ -' . $xbeg . ' +' . $ybeg . ' @@'; + } + + function _context($lines) + { + return $this->_lines($lines, ' '); + } + + function _added($lines) + { + return $this->_lines($lines, '+'); + } + + function _deleted($lines) + { + return $this->_lines($lines, '-'); + } + + function _changed($orig, $final) + { + return $this->_deleted($orig) . $this->_added($final); + } +} + +/** +* "chora (Horde)" diff renderer - similar style. +* This renderer class is a modified human_readable function from the Horde Framework. +* +* @package diff +*/ +class diff_renderer_side_by_side extends diff_renderer +{ + var $_leading_context_lines = 3; + var $_trailing_context_lines = 3; + + var $lines = array(); + + // Hold the left and right columns of lines for change blocks. + var $cols; + var $state; + + var $data = false; + + /** + * Our function to get the diff + */ + function get_diff_content($diff) + { + global $user; + + $output = ''; + $output .= ' + + +'; + + $this->render($diff); + + // Is the diff empty? + if (!sizeof($this->lines)) + { + $output .= ''; + } + else + { + // Iterate through every header block of changes + foreach ($this->lines as $header) + { + $output .= ''; + + // Each header block consists of a number of changes (add, remove, change). + $current_context = ''; + + foreach ($header['contents'] as $change) + { + if (!empty($current_context) && $change['type'] != 'empty') + { + $line = $current_context; + $current_context = ''; + + $output .= ' + '; + } + + switch ($change['type']) + { + case 'add': + $line = ''; + + foreach ($change['lines'] as $_line) + { + $line .= htmlspecialchars($_line) . '
'; + } + + $output .= ''; + break; + + case 'remove': + $line = ''; + + foreach ($change['lines'] as $_line) + { + $line .= htmlspecialchars($_line) . '
'; + } + + $output .= ''; + break; + + case 'empty': + $current_context .= htmlspecialchars($change['line']) . '
'; + break; + + case 'change': + // Pop the old/new stacks one by one, until both are empty. + $oldsize = sizeof($change['old']); + $newsize = sizeof($change['new']); + $left = $right = ''; + + for ($row = 0, $row_max = max($oldsize, $newsize); $row < $row_max; ++$row) + { + $left .= isset($change['old'][$row]) ? htmlspecialchars($change['old'][$row]) : ''; + $left .= '
'; + $right .= isset($change['new'][$row]) ? htmlspecialchars($change['new'][$row]) : ''; + $right .= '
'; + } + + $output .= ''; + + if (!empty($left)) + { + $output .= ''; + } + else if ($row < $oldsize) + { + $output .= ''; + } + else + { + $output .= ''; + } + + if (!empty($right)) + { + $output .= ''; + } + else if ($row < $newsize) + { + $output .= ''; + } + else + { + $output .= ''; + } + + $output .= ''; + break; + } + } + + if (!empty($current_context)) + { + $line = $current_context; + $current_context = ''; + + $output .= ''; + $output .= ''; + } + } + } + + $output .= '
+   ' . $user->lang['LINE_UNMODIFIED'] . ' +   ' . $user->lang['LINE_ADDED'] . ' +   ' . $user->lang['LINE_MODIFIED'] . ' +   ' . $user->lang['LINE_REMOVED'] . ' +
' . $user->lang['NO_VISIBLE_CHANGES'] . '
' . $user->lang['LINE'] . ' ' . $header['oldline'] . '' . $user->lang['LINE'] . ' ' . $header['newline'] . '
' . ((strlen($line)) ? $line : ' ') . '
' . ((strlen($line)) ? $line : ' ') . '
 
' . ((strlen($line)) ? $line : ' ') . '
' . ((strlen($line)) ? $line : ' ') . '
 
' . $left . '
  
' . $right . '
  
' . ((strlen($line)) ? $line : ' ') . '
' . ((strlen($line)) ? $line : ' ') . '
'; + + return $output; + } + + function _start_diff() + { + $this->lines = array(); + + $this->data = false; + $this->cols = array(array(), array()); + $this->state = 'empty'; + + return ''; + } + + function _end_diff() + { + // Just flush any remaining entries in the columns stack. + switch ($this->state) + { + case 'add': + $this->data['contents'][] = array('type' => 'add', 'lines' => $this->cols[0]); + break; + + case 'remove': + // We have some removal lines pending in our stack, so flush them. + $this->data['contents'][] = array('type' => 'remove', 'lines' => $this->cols[0]); + break; + + case 'change': + // We have both remove and addition lines, so this is a change block. + $this->data['contents'][] = array('type' => 'change', 'old' => $this->cols[0], 'new' => $this->cols[1]); + break; + } + + if ($this->data !== false) + { + $this->lines[] = $this->data; + } + + return ''; + } + + function _block_header($xbeg, $xlen, $ybeg, $ylen) + { + // Push any previous header information to the return stack. + if ($this->data !== false) + { + $this->lines[] = $this->data; + } + + $this->data = array('type' => 'header', 'oldline' => $xbeg, 'newline' => $ybeg, 'contents' => array()); + $this->state = 'dump'; + } + + function _added($lines) + { + array_walk($lines, array(&$this, '_perform_add')); + } + + function _perform_add($line) + { + if ($this->state == 'empty') + { + return ''; + } + + // This is just an addition line. + if ($this->state == 'dump' || $this->state == 'add') + { + // Start adding to the addition stack. + $this->cols[0][] = $line; + $this->state = 'add'; + } + else + { + // This is inside a change block, so start accumulating lines. + $this->state = 'change'; + $this->cols[1][] = $line; + } + } + + function _deleted($lines) + { + array_walk($lines, array(&$this, '_perform_delete')); + } + + function _perform_delete($line) + { + // This is a removal line. + $this->state = 'remove'; + $this->cols[0][] = $line; + } + + function _context($lines) + { + array_walk($lines, array(&$this, '_perform_context')); + } + + function _perform_context($line) + { + // An empty block with no action. + switch ($this->state) + { + case 'add': + $this->data['contents'][] = array('type' => 'add', 'lines' => $this->cols[0]); + break; + + case 'remove': + // We have some removal lines pending in our stack, so flush them. + $this->data['contents'][] = array('type' => 'remove', 'lines' => $this->cols[0]); + break; + + case 'change': + // We have both remove and addition lines, so this is a change block. + $this->data['contents'][] = array('type' => 'change', 'old' => $this->cols[0], 'new' => $this->cols[1]); + break; + } + + $this->cols = array(array(), array()); + $this->data['contents'][] = array('type' => 'empty', 'line' => $line); + $this->state = 'dump'; + } + + function _changed($orig, $final) + { + return $this->_deleted($orig) . $this->_added($final); + } + +} diff --git a/sources/phpBB/includes/functions.php b/sources/phpBB/includes/functions.php new file mode 100644 index 0000000..97429a0 --- /dev/null +++ b/sources/phpBB/includes/functions.php @@ -0,0 +1,5464 @@ + +* @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; +} + +// Common global functions +/** +* Load the autoloaders added by the extensions. +* +* @param string $phpbb_root_path Path to the phpbb root directory. +*/ +function phpbb_load_extensions_autoloaders($phpbb_root_path) +{ + $iterator = new \RecursiveIteratorIterator( + new \phpbb\recursive_dot_prefix_filter_iterator( + new \RecursiveDirectoryIterator( + $phpbb_root_path . 'ext/', + \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS + ) + ), + \RecursiveIteratorIterator::SELF_FIRST + ); + $iterator->setMaxDepth(2); + + foreach ($iterator as $file_info) + { + if ($file_info->getFilename() === 'vendor' && $iterator->getDepth() === 2) + { + $filename = $file_info->getRealPath() . '/autoload.php'; + if (file_exists($filename)) + { + require $filename; + } + } + } +} + +/** +* Casts a variable to the given type. +* +* @deprecated +*/ +function set_var(&$result, $var, $type, $multibyte = false) +{ + // no need for dependency injection here, if you have the object, call the method yourself! + $type_cast_helper = new \phpbb\request\type_cast_helper(); + $type_cast_helper->set_var($result, $var, $type, $multibyte); +} + +/** +* 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 +*/ +function gen_rand_string($num_chars = 8) +{ + // [a, z] + [0, 9] = 36 + return substr(strtoupper(base_convert(unique_id(), 16, 36)), 0, $num_chars); +} + +/** +* Generates a user-friendly alphanumeric random string of given length +* We remove 0 and O so users cannot confuse those in passwords etc. +* +* @return string +*/ +function gen_rand_string_friendly($num_chars = 8) +{ + $rand_str = unique_id(); + + // Remove Z and Y from the base_convert(), replace 0 with Z and O with Y + // [a, z] + [0, 9] - {z, y} = [a, z] + [0, 9] - {0, o} = 34 + $rand_str = str_replace(array('0', 'O'), array('Z', 'Y'), strtoupper(base_convert($rand_str, 16, 34))); + + return substr($rand_str, 0, $num_chars); +} + +/** +* Return unique id +* @param string $extra additional entropy +*/ +function unique_id($extra = 'c') +{ + static $dss_seeded = false; + global $config; + + $val = $config['rand_seed'] . microtime(); + $val = md5($val); + $config['rand_seed'] = md5($config['rand_seed'] . $val . $extra); + + 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); + $dss_seeded = true; + } + + return substr($val, 4, 16); +} + +/** +* Wrapper for mt_rand() which allows swapping $min and $max parameters. +* +* PHP does not allow us to swap the order of the arguments for mt_rand() anymore. +* (since PHP 5.3.4, see http://bugs.php.net/46587) +* +* @param int $min Lowest value to be returned +* @param int $max Highest value to be returned +* +* @return int Random integer between $min and $max (or $max and $min) +*/ +function phpbb_mt_rand($min, $max) +{ + return ($min > $max) ? mt_rand($max, $min) : mt_rand($min, $max); +} + +/** +* Wrapper for getdate() which returns the equivalent array for UTC timestamps. +* +* @param int $time Unix timestamp (optional) +* +* @return array Returns an associative array of information related to the timestamp. +* See http://www.php.net/manual/en/function.getdate.php +*/ +function phpbb_gmgetdate($time = false) +{ + if ($time === false) + { + $time = time(); + } + + // getdate() interprets timestamps in local time. + // What follows uses the fact that getdate() and + // date('Z') balance each other out. + return getdate($time - date('Z')); +} + +/** +* Return formatted string for filesizes +* +* @param mixed $value filesize in bytes +* (non-negative number; int, float or string) +* @param bool $string_only true if language string should be returned +* @param array $allowed_units only allow these units (data array indexes) +* +* @return mixed data array if $string_only is false +*/ +function get_formatted_filesize($value, $string_only = true, $allowed_units = false) +{ + global $user; + + $available_units = array( + 'tb' => array( + 'min' => 1099511627776, // pow(2, 40) + 'index' => 4, + 'si_unit' => 'TB', + 'iec_unit' => 'TIB', + ), + 'gb' => array( + 'min' => 1073741824, // pow(2, 30) + 'index' => 3, + 'si_unit' => 'GB', + 'iec_unit' => 'GIB', + ), + 'mb' => array( + 'min' => 1048576, // pow(2, 20) + 'index' => 2, + 'si_unit' => 'MB', + 'iec_unit' => 'MIB', + ), + 'kb' => array( + 'min' => 1024, // pow(2, 10) + 'index' => 1, + 'si_unit' => 'KB', + 'iec_unit' => 'KIB', + ), + 'b' => array( + 'min' => 0, + 'index' => 0, + 'si_unit' => 'BYTES', // Language index + 'iec_unit' => 'BYTES', // Language index + ), + ); + + foreach ($available_units as $si_identifier => $unit_info) + { + if (!empty($allowed_units) && $si_identifier != 'b' && !in_array($si_identifier, $allowed_units)) + { + continue; + } + + if ($value >= $unit_info['min']) + { + $unit_info['si_identifier'] = $si_identifier; + + break; + } + } + unset($available_units); + + for ($i = 0; $i < $unit_info['index']; $i++) + { + $value /= 1024; + } + $value = round($value, 2); + + // Lookup units in language dictionary + $unit_info['si_unit'] = (isset($user->lang[$unit_info['si_unit']])) ? $user->lang[$unit_info['si_unit']] : $unit_info['si_unit']; + $unit_info['iec_unit'] = (isset($user->lang[$unit_info['iec_unit']])) ? $user->lang[$unit_info['iec_unit']] : $unit_info['iec_unit']; + + // Default to IEC + $unit_info['unit'] = $unit_info['iec_unit']; + + if (!$string_only) + { + $unit_info['value'] = $value; + + return $unit_info; + } + + return $value . ' ' . $unit_info['unit']; +} + +/** +* Determine whether we are approaching the maximum execution time. Should be called once +* at the beginning of the script in which it's used. +* @return bool Either true if the maximum execution time is nearly reached, or false +* if some time is still left. +*/ +function still_on_time($extra_time = 15) +{ + static $max_execution_time, $start_time; + + $time = explode(' ', microtime()); + $current_time = $time[0] + $time[1]; + + if (empty($max_execution_time)) + { + $max_execution_time = (function_exists('ini_get')) ? (int) @ini_get('max_execution_time') : (int) @get_cfg_var('max_execution_time'); + + // If zero, then set to something higher to not let the user catch the ten seconds barrier. + if ($max_execution_time === 0) + { + $max_execution_time = 50 + $extra_time; + } + + $max_execution_time = min(max(10, ($max_execution_time - $extra_time)), 50); + + // For debugging purposes + // $max_execution_time = 10; + + global $starttime; + $start_time = (empty($starttime)) ? $current_time : $starttime; + } + + return (ceil($current_time - $start_time) < $max_execution_time) ? true : false; +} + +/** +* Hashes an email address to a big integer +* +* @param string $email Email address +* +* @return string Unsigned Big Integer +*/ +function phpbb_email_hash($email) +{ + return sprintf('%u', crc32(strtolower($email))) . strlen($email); +} + +/** +* Wrapper for version_compare() that allows using uppercase A and B +* for alpha and beta releases. +* +* See http://www.php.net/manual/en/function.version-compare.php +* +* @param string $version1 First version number +* @param string $version2 Second version number +* @param string $operator Comparison operator (optional) +* +* @return mixed Boolean (true, false) if comparison operator is specified. +* Integer (-1, 0, 1) otherwise. +*/ +function phpbb_version_compare($version1, $version2, $operator = null) +{ + $version1 = strtolower($version1); + $version2 = strtolower($version2); + + if (is_null($operator)) + { + return version_compare($version1, $version2); + } + else + { + return version_compare($version1, $version2, $operator); + } +} + +/** +* 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 +* @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 + +/** +* Pick a language, any language ... +*/ +function language_select($default = '') +{ + global $db; + + $sql = 'SELECT lang_iso, lang_local_name + FROM ' . LANG_TABLE . ' + ORDER BY lang_english_name'; + $result = $db->sql_query($sql); + + $lang_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $selected = ($row['lang_iso'] == $default) ? ' selected="selected"' : ''; + $lang_options .= ''; + } + $db->sql_freeresult($result); + + return $lang_options; +} + +/** +* Pick a template/theme combo, +*/ +function style_select($default = '', $all = false) +{ + global $db; + + $sql_where = (!$all) ? 'WHERE style_active = 1 ' : ''; + $sql = 'SELECT style_id, style_name + FROM ' . STYLES_TABLE . " + $sql_where + ORDER BY style_name"; + $result = $db->sql_query($sql); + + $style_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $selected = ($row['style_id'] == $default) ? ' selected="selected"' : ''; + $style_options .= ''; + } + $db->sql_freeresult($result); + + return $style_options; +} + +/** +* Format the timezone offset with hours and minutes +* +* @param int $tz_offset Timezone offset in seconds +* @param bool $show_null Whether null offsets should be shown +* @return string Normalized offset string: -7200 => -02:00 +* 16200 => +04:30 +*/ +function phpbb_format_timezone_offset($tz_offset, $show_null = false) +{ + $sign = ($tz_offset < 0) ? '-' : '+'; + $time_offset = abs($tz_offset); + + if ($time_offset == 0 && $show_null == false) + { + return ''; + } + + $offset_seconds = $time_offset % 3600; + $offset_minutes = $offset_seconds / 60; + $offset_hours = ($time_offset - $offset_seconds) / 3600; + + $offset_string = sprintf("%s%02d:%02d", $sign, $offset_hours, $offset_minutes); + return $offset_string; +} + +/** +* Compares two time zone labels. +* Arranges them in increasing order by timezone offset. +* Places UTC before other timezones in the same offset. +*/ +function phpbb_tz_select_compare($a, $b) +{ + $a_sign = $a[3]; + $b_sign = $b[3]; + if ($a_sign != $b_sign) + { + return $a_sign == '-' ? -1 : 1; + } + + $a_offset = substr($a, 4, 5); + $b_offset = substr($b, 4, 5); + if ($a_offset == $b_offset) + { + $a_name = substr($a, 12); + $b_name = substr($b, 12); + if ($a_name == $b_name) + { + return 0; + } + else if ($a_name == 'UTC') + { + return -1; + } + else if ($b_name == 'UTC') + { + return 1; + } + else + { + return $a_name < $b_name ? -1 : 1; + } + } + else + { + if ($a_sign == '-') + { + return $a_offset > $b_offset ? -1 : 1; + } + else + { + return $a_offset < $b_offset ? -1 : 1; + } + } +} + +/** +* Return list of timezone identifiers +* We also add the selected timezone if we can create an object with it. +* DateTimeZone::listIdentifiers seems to not add all identifiers to the list, +* because some are only kept for backward compatible reasons. If the user has +* a deprecated value, we add it here, so it can still be kept. Once the user +* changed his value, there is no way back to deprecated values. +* +* @param string $selected_timezone Additional timezone that shall +* be added to the list of identiers +* @return array DateTimeZone::listIdentifiers and additional +* selected_timezone if it is a valid timezone. +*/ +function phpbb_get_timezone_identifiers($selected_timezone) +{ + $timezones = DateTimeZone::listIdentifiers(); + + if (!in_array($selected_timezone, $timezones)) + { + try + { + // Add valid timezones that are currently selected but not returned + // by DateTimeZone::listIdentifiers + $validate_timezone = new DateTimeZone($selected_timezone); + $timezones[] = $selected_timezone; + } + catch (\Exception $e) + { + } + } + + return $timezones; +} + +/** +* Options to pick a timezone and date/time +* +* @param \phpbb\template\template $template phpBB template object +* @param \phpbb\user $user Object of the current user +* @param string $default A timezone to select +* @param boolean $truncate Shall we truncate the options text +* +* @return array Returns an array containing the options for the time selector. +*/ +function phpbb_timezone_select($template, $user, $default = '', $truncate = false) +{ + static $timezones; + + $default_offset = ''; + if (!isset($timezones)) + { + $unsorted_timezones = phpbb_get_timezone_identifiers($default); + + $timezones = array(); + foreach ($unsorted_timezones as $timezone) + { + $tz = new DateTimeZone($timezone); + $dt = $user->create_datetime('now', $tz); + $offset = $dt->getOffset(); + $current_time = $dt->format($user->lang['DATETIME_FORMAT'], true); + $offset_string = phpbb_format_timezone_offset($offset, true); + $timezones['UTC' . $offset_string . ' - ' . $timezone] = array( + 'tz' => $timezone, + 'offset' => $offset_string, + 'current' => $current_time, + ); + if ($timezone === $default) + { + $default_offset = 'UTC' . $offset_string; + } + } + unset($unsorted_timezones); + + uksort($timezones, 'phpbb_tz_select_compare'); + } + + $tz_select = $opt_group = ''; + + foreach ($timezones as $key => $timezone) + { + if ($opt_group != $timezone['offset']) + { + // Generate tz_select for backwards compatibility + $tz_select .= ($opt_group) ? '' : ''; + $tz_select .= ''; + $opt_group = $timezone['offset']; + $template->assign_block_vars('timezone_select', array( + 'LABEL' => $user->lang(array('timezones', 'UTC_OFFSET_CURRENT'), $timezone['offset'], $timezone['current']), + 'VALUE' => $key . ' - ' . $timezone['current'], + )); + + $selected = (!empty($default_offset) && strpos($key, $default_offset) !== false) ? ' selected="selected"' : ''; + $template->assign_block_vars('timezone_date', array( + 'VALUE' => $key . ' - ' . $timezone['current'], + 'SELECTED' => !empty($selected), + 'TITLE' => $user->lang(array('timezones', 'UTC_OFFSET_CURRENT'), $timezone['offset'], $timezone['current']), + )); + } + + $label = $timezone['tz']; + if (isset($user->lang['timezones'][$label])) + { + $label = $user->lang['timezones'][$label]; + } + $title = $user->lang(array('timezones', 'UTC_OFFSET_CURRENT'), $timezone['offset'], $label); + + if ($truncate) + { + $label = truncate_string($label, 50, 255, false, '...'); + } + + // Also generate timezone_select for backwards compatibility + $selected = ($timezone['tz'] === $default) ? ' selected="selected"' : ''; + $tz_select .= ''; + $template->assign_block_vars('timezone_select.timezone_options', array( + 'TITLE' => $title, + 'VALUE' => $timezone['tz'], + 'SELECTED' => !empty($selected), + 'LABEL' => $label, + )); + } + $tz_select .= ''; + + return $tz_select; +} + +// Functions handling topic/post tracking/marking + +/** +* Marks a topic/forum as read +* Marks a topic as posted to +* +* @param string $mode (all, topics, topic, post) +* @param int|bool $forum_id Used in all, topics, and topic mode +* @param int|bool $topic_id Used in topic and post mode +* @param int $post_time 0 means current time(), otherwise to set a specific mark time +* @param int $user_id can only be used with $mode == 'post' +*/ +function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $user_id = 0) +{ + global $db, $user, $config; + global $request, $phpbb_container; + + $post_time = ($post_time === 0 || $post_time > time()) ? time() : (int) $post_time; + + if ($mode == 'all') + { + if ($forum_id === false || !sizeof($forum_id)) + { + // Mark all forums read (index page) + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + // Mark all topic notifications read for this user + $phpbb_notifications->mark_notifications_read(array( + 'notification.type.topic', + 'notification.type.quote', + 'notification.type.bookmark', + 'notification.type.post', + 'notification.type.approve_topic', + 'notification.type.approve_post', + ), false, $user->data['user_id'], $post_time); + + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + // Mark all forums read (index page) + $tables = array(TOPICS_TRACK_TABLE, FORUMS_TRACK_TABLE); + foreach ($tables as $table) + { + $sql = 'DELETE FROM ' . $table . " + WHERE user_id = {$user->data['user_id']} + AND mark_time < $post_time"; + $db->sql_query($sql); + } + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_lastmark = $post_time + WHERE user_id = {$user->data['user_id']} + AND user_lastmark < $post_time"; + $db->sql_query($sql); + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE); + $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array(); + + unset($tracking_topics['tf']); + unset($tracking_topics['t']); + unset($tracking_topics['f']); + $tracking_topics['l'] = base_convert($post_time - $config['board_startdate'], 10, 36); + + $user->set_cookie('track', tracking_serialize($tracking_topics), $post_time + 31536000); + $request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking_topics), \phpbb\request\request_interface::COOKIE); + + unset($tracking_topics); + + if ($user->data['is_registered']) + { + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_lastmark = $post_time + WHERE user_id = {$user->data['user_id']} + AND user_lastmark < $post_time"; + $db->sql_query($sql); + } + } + } + + return; + } + else if ($mode == 'topics') + { + // Mark all topics in forums read + if (!is_array($forum_id)) + { + $forum_id = array($forum_id); + } + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + $phpbb_notifications->mark_notifications_read_by_parent(array( + 'notification.type.topic', + 'notification.type.approve_topic', + ), $forum_id, $user->data['user_id'], $post_time); + + // Mark all post/quote notifications read for this user in this forum + $topic_ids = array(); + $sql = 'SELECT topic_id + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_id); + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $topic_ids[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + $phpbb_notifications->mark_notifications_read_by_parent(array( + 'notification.type.quote', + 'notification.type.bookmark', + 'notification.type.post', + 'notification.type.approve_post', + ), $topic_ids, $user->data['user_id'], $post_time); + + // Add 0 to forums array to mark global announcements correctly + // $forum_id[] = 0; + + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + $sql = 'DELETE FROM ' . TOPICS_TRACK_TABLE . " + WHERE user_id = {$user->data['user_id']} + AND mark_time < $post_time + AND " . $db->sql_in_set('forum_id', $forum_id); + $db->sql_query($sql); + + $sql = 'SELECT forum_id + FROM ' . FORUMS_TRACK_TABLE . " + WHERE user_id = {$user->data['user_id']} + AND " . $db->sql_in_set('forum_id', $forum_id); + $result = $db->sql_query($sql); + + $sql_update = array(); + while ($row = $db->sql_fetchrow($result)) + { + $sql_update[] = (int) $row['forum_id']; + } + $db->sql_freeresult($result); + + if (sizeof($sql_update)) + { + $sql = 'UPDATE ' . FORUMS_TRACK_TABLE . " + SET mark_time = $post_time + WHERE user_id = {$user->data['user_id']} + AND mark_time < $post_time + AND " . $db->sql_in_set('forum_id', $sql_update); + $db->sql_query($sql); + } + + if ($sql_insert = array_diff($forum_id, $sql_update)) + { + $sql_ary = array(); + foreach ($sql_insert as $f_id) + { + $sql_ary[] = array( + 'user_id' => (int) $user->data['user_id'], + 'forum_id' => (int) $f_id, + 'mark_time' => $post_time, + ); + } + + $db->sql_multi_insert(FORUMS_TRACK_TABLE, $sql_ary); + } + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + $tracking = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE); + $tracking = ($tracking) ? tracking_unserialize($tracking) : array(); + + foreach ($forum_id as $f_id) + { + $topic_ids36 = (isset($tracking['tf'][$f_id])) ? $tracking['tf'][$f_id] : array(); + + if (isset($tracking['tf'][$f_id])) + { + unset($tracking['tf'][$f_id]); + } + + foreach ($topic_ids36 as $topic_id36) + { + unset($tracking['t'][$topic_id36]); + } + + if (isset($tracking['f'][$f_id])) + { + unset($tracking['f'][$f_id]); + } + + $tracking['f'][$f_id] = base_convert($post_time - $config['board_startdate'], 10, 36); + } + + if (isset($tracking['tf']) && empty($tracking['tf'])) + { + unset($tracking['tf']); + } + + $user->set_cookie('track', tracking_serialize($tracking), $post_time + 31536000); + $request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), \phpbb\request\request_interface::COOKIE); + + unset($tracking); + } + + return; + } + else if ($mode == 'topic') + { + if ($topic_id === false || $forum_id === false) + { + return; + } + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + // Mark post notifications read for this user in this topic + $phpbb_notifications->mark_notifications_read(array( + 'notification.type.topic', + 'notification.type.approve_topic', + ), $topic_id, $user->data['user_id'], $post_time); + + $phpbb_notifications->mark_notifications_read_by_parent(array( + 'notification.type.quote', + 'notification.type.bookmark', + 'notification.type.post', + 'notification.type.approve_post', + ), $topic_id, $user->data['user_id'], $post_time); + + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + $sql = 'UPDATE ' . TOPICS_TRACK_TABLE . " + SET mark_time = $post_time + WHERE user_id = {$user->data['user_id']} + AND mark_time < $post_time + AND topic_id = $topic_id"; + $db->sql_query($sql); + + // insert row + if (!$db->sql_affectedrows()) + { + $db->sql_return_on_error(true); + + $sql_ary = array( + 'user_id' => (int) $user->data['user_id'], + 'topic_id' => (int) $topic_id, + 'forum_id' => (int) $forum_id, + 'mark_time' => $post_time, + ); + + $db->sql_query('INSERT INTO ' . TOPICS_TRACK_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + + $db->sql_return_on_error(false); + } + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + $tracking = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE); + $tracking = ($tracking) ? tracking_unserialize($tracking) : array(); + + $topic_id36 = base_convert($topic_id, 10, 36); + + if (!isset($tracking['t'][$topic_id36])) + { + $tracking['tf'][$forum_id][$topic_id36] = true; + } + + $tracking['t'][$topic_id36] = base_convert($post_time - $config['board_startdate'], 10, 36); + + // If the cookie grows larger than 10000 characters we will remove the smallest value + // This can result in old topics being unread - but most of the time it should be accurate... + if (strlen($request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE)) > 10000) + { + //echo 'Cookie grown too large' . print_r($tracking, true); + + // We get the ten most minimum stored time offsets and its associated topic ids + $time_keys = array(); + for ($i = 0; $i < 10 && sizeof($tracking['t']); $i++) + { + $min_value = min($tracking['t']); + $m_tkey = array_search($min_value, $tracking['t']); + unset($tracking['t'][$m_tkey]); + + $time_keys[$m_tkey] = $min_value; + } + + // Now remove the topic ids from the array... + foreach ($tracking['tf'] as $f_id => $topic_id_ary) + { + foreach ($time_keys as $m_tkey => $min_value) + { + if (isset($topic_id_ary[$m_tkey])) + { + $tracking['f'][$f_id] = $min_value; + unset($tracking['tf'][$f_id][$m_tkey]); + } + } + } + + if ($user->data['is_registered']) + { + $user->data['user_lastmark'] = intval(base_convert(max($time_keys) + $config['board_startdate'], 36, 10)); + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_lastmark = $post_time + WHERE user_id = {$user->data['user_id']} + AND mark_time < $post_time"; + $db->sql_query($sql); + } + else + { + $tracking['l'] = max($time_keys); + } + } + + $user->set_cookie('track', tracking_serialize($tracking), $post_time + 31536000); + $request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), \phpbb\request\request_interface::COOKIE); + } + + return; + } + else if ($mode == 'post') + { + if ($topic_id === false) + { + return; + } + + $use_user_id = (!$user_id) ? $user->data['user_id'] : $user_id; + + if ($config['load_db_track'] && $use_user_id != ANONYMOUS) + { + $db->sql_return_on_error(true); + + $sql_ary = array( + 'user_id' => (int) $use_user_id, + 'topic_id' => (int) $topic_id, + 'topic_posted' => 1, + ); + + $db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + + $db->sql_return_on_error(false); + } + + return; + } +} + +/** +* Get topic tracking info by using already fetched info +*/ +function get_topic_tracking($forum_id, $topic_ids, &$rowset, $forum_mark_time, $global_announce_list = false) +{ + global $config, $user; + + $last_read = array(); + + if (!is_array($topic_ids)) + { + $topic_ids = array($topic_ids); + } + + foreach ($topic_ids as $topic_id) + { + if (!empty($rowset[$topic_id]['mark_time'])) + { + $last_read[$topic_id] = $rowset[$topic_id]['mark_time']; + } + } + + $topic_ids = array_diff($topic_ids, array_keys($last_read)); + + if (sizeof($topic_ids)) + { + $mark_time = array(); + + if (!empty($forum_mark_time[$forum_id]) && $forum_mark_time[$forum_id] !== false) + { + $mark_time[$forum_id] = $forum_mark_time[$forum_id]; + } + + $user_lastmark = (isset($mark_time[$forum_id])) ? $mark_time[$forum_id] : $user->data['user_lastmark']; + + foreach ($topic_ids as $topic_id) + { + $last_read[$topic_id] = $user_lastmark; + } + } + + return $last_read; +} + +/** +* Get topic tracking info from db (for cookie based tracking only this function is used) +*/ +function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_list = false) +{ + global $config, $user, $request; + + $last_read = array(); + + if (!is_array($topic_ids)) + { + $topic_ids = array($topic_ids); + } + + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + global $db; + + $sql = 'SELECT topic_id, mark_time + FROM ' . TOPICS_TRACK_TABLE . " + WHERE user_id = {$user->data['user_id']} + AND " . $db->sql_in_set('topic_id', $topic_ids); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $last_read[$row['topic_id']] = $row['mark_time']; + } + $db->sql_freeresult($result); + + $topic_ids = array_diff($topic_ids, array_keys($last_read)); + + if (sizeof($topic_ids)) + { + $sql = 'SELECT forum_id, mark_time + FROM ' . FORUMS_TRACK_TABLE . " + WHERE user_id = {$user->data['user_id']} + AND forum_id = $forum_id"; + $result = $db->sql_query($sql); + + $mark_time = array(); + while ($row = $db->sql_fetchrow($result)) + { + $mark_time[$row['forum_id']] = $row['mark_time']; + } + $db->sql_freeresult($result); + + $user_lastmark = (isset($mark_time[$forum_id])) ? $mark_time[$forum_id] : $user->data['user_lastmark']; + + foreach ($topic_ids as $topic_id) + { + $last_read[$topic_id] = $user_lastmark; + } + } + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + global $tracking_topics; + + if (!isset($tracking_topics) || !sizeof($tracking_topics)) + { + $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE); + $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array(); + } + + if (!$user->data['is_registered']) + { + $user_lastmark = (isset($tracking_topics['l'])) ? base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate'] : 0; + } + else + { + $user_lastmark = $user->data['user_lastmark']; + } + + foreach ($topic_ids as $topic_id) + { + $topic_id36 = base_convert($topic_id, 10, 36); + + if (isset($tracking_topics['t'][$topic_id36])) + { + $last_read[$topic_id] = base_convert($tracking_topics['t'][$topic_id36], 36, 10) + $config['board_startdate']; + } + } + + $topic_ids = array_diff($topic_ids, array_keys($last_read)); + + if (sizeof($topic_ids)) + { + $mark_time = array(); + + if (isset($tracking_topics['f'][$forum_id])) + { + $mark_time[$forum_id] = base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate']; + } + + $user_lastmark = (isset($mark_time[$forum_id])) ? $mark_time[$forum_id] : $user_lastmark; + + foreach ($topic_ids as $topic_id) + { + $last_read[$topic_id] = $user_lastmark; + } + } + } + + return $last_read; +} + +/** +* Get list of unread topics +* +* @param int $user_id User ID (or false for current user) +* @param string $sql_extra Extra WHERE SQL statement +* @param string $sql_sort ORDER BY SQL sorting statement +* @param string $sql_limit Limits the size of unread topics list, 0 for unlimited query +* @param string $sql_limit_offset Sets the offset of the first row to search, 0 to search from the start +* +* @return array[int][int] Topic ids as keys, mark_time of topic as value +*/ +function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001, $sql_limit_offset = 0) +{ + global $config, $db, $user; + + $user_id = ($user_id === false) ? (int) $user->data['user_id'] : (int) $user_id; + + // Data array we're going to return + $unread_topics = array(); + + if (empty($sql_sort)) + { + $sql_sort = 'ORDER BY t.topic_last_post_time DESC, t.topic_last_post_id DESC'; + } + + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + // Get list of the unread topics + $last_mark = (int) $user->data['user_lastmark']; + + $sql_array = array( + 'SELECT' => 't.topic_id, t.topic_last_post_time, tt.mark_time as topic_mark_time, ft.mark_time as forum_mark_time', + + 'FROM' => array(TOPICS_TABLE => 't'), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(TOPICS_TRACK_TABLE => 'tt'), + 'ON' => "tt.user_id = $user_id AND t.topic_id = tt.topic_id", + ), + array( + 'FROM' => array(FORUMS_TRACK_TABLE => 'ft'), + 'ON' => "ft.user_id = $user_id AND t.forum_id = ft.forum_id", + ), + ), + + 'WHERE' => " + t.topic_last_post_time > $last_mark AND + ( + (tt.mark_time IS NOT NULL AND t.topic_last_post_time > tt.mark_time) OR + (tt.mark_time IS NULL AND ft.mark_time IS NOT NULL AND t.topic_last_post_time > ft.mark_time) OR + (tt.mark_time IS NULL AND ft.mark_time IS NULL) + ) + $sql_extra + $sql_sort", + ); + + $sql = $db->sql_build_query('SELECT', $sql_array); + $result = $db->sql_query_limit($sql, $sql_limit, $sql_limit_offset); + + while ($row = $db->sql_fetchrow($result)) + { + $topic_id = (int) $row['topic_id']; + $unread_topics[$topic_id] = ($row['topic_mark_time']) ? (int) $row['topic_mark_time'] : (($row['forum_mark_time']) ? (int) $row['forum_mark_time'] : $last_mark); + } + $db->sql_freeresult($result); + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + global $tracking_topics; + + if (empty($tracking_topics)) + { + $tracking_topics = request_var($config['cookie_name'] . '_track', '', false, true); + $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array(); + } + + if (!$user->data['is_registered']) + { + $user_lastmark = (isset($tracking_topics['l'])) ? base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate'] : 0; + } + else + { + $user_lastmark = (int) $user->data['user_lastmark']; + } + + $sql = 'SELECT t.topic_id, t.forum_id, t.topic_last_post_time + FROM ' . TOPICS_TABLE . ' t + WHERE t.topic_last_post_time > ' . $user_lastmark . " + $sql_extra + $sql_sort"; + $result = $db->sql_query_limit($sql, $sql_limit, $sql_limit_offset); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_id = (int) $row['forum_id']; + $topic_id = (int) $row['topic_id']; + $topic_id36 = base_convert($topic_id, 10, 36); + + if (isset($tracking_topics['t'][$topic_id36])) + { + $last_read = base_convert($tracking_topics['t'][$topic_id36], 36, 10) + $config['board_startdate']; + + if ($row['topic_last_post_time'] > $last_read) + { + $unread_topics[$topic_id] = $last_read; + } + } + else if (isset($tracking_topics['f'][$forum_id])) + { + $mark_time = base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate']; + + if ($row['topic_last_post_time'] > $mark_time) + { + $unread_topics[$topic_id] = $mark_time; + } + } + else + { + $unread_topics[$topic_id] = $user_lastmark; + } + } + $db->sql_freeresult($result); + } + + return $unread_topics; +} + +/** +* Check for read forums and update topic tracking info accordingly +* +* @param int $forum_id the forum id to check +* @param int $forum_last_post_time the forums last post time +* @param int $f_mark_time the forums last mark time if user is registered and load_db_lastread enabled +* @param int $mark_time_forum false if the mark time needs to be obtained, else the last users forum mark time +* +* @return true if complete forum got marked read, else false. +*/ +function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_time = false, $mark_time_forum = false) +{ + global $db, $tracking_topics, $user, $config, $auth, $request, $phpbb_container; + + // Determine the users last forum mark time if not given. + if ($mark_time_forum === false) + { + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + $mark_time_forum = (!empty($f_mark_time)) ? $f_mark_time : $user->data['user_lastmark']; + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE); + $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array(); + + if (!$user->data['is_registered']) + { + $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0; + } + + $mark_time_forum = (isset($tracking_topics['f'][$forum_id])) ? (int) (base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate']) : $user->data['user_lastmark']; + } + } + + // Handle update of unapproved topics info. + // Only update for moderators having m_approve permission for the forum. + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + + // Check the forum for any left unread topics. + // If there are none, we mark the forum as read. + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + if ($mark_time_forum >= $forum_last_post_time) + { + // We do not need to mark read, this happened before. Therefore setting this to true + $row = true; + } + else + { + $sql = 'SELECT t.forum_id + FROM ' . TOPICS_TABLE . ' t + LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt + ON (tt.topic_id = t.topic_id + AND tt.user_id = ' . $user->data['user_id'] . ') + WHERE t.forum_id = ' . $forum_id . ' + AND t.topic_last_post_time > ' . $mark_time_forum . ' + AND t.topic_moved_id = 0 + AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.') . ' + AND (tt.topic_id IS NULL + OR tt.mark_time < t.topic_last_post_time)'; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + // Get information from cookie + $row = false; + + if (!isset($tracking_topics['tf'][$forum_id])) + { + // We do not need to mark read, this happened before. Therefore setting this to true + $row = true; + } + else + { + $sql = 'SELECT t.topic_id + FROM ' . TOPICS_TABLE . ' t + WHERE t.forum_id = ' . $forum_id . ' + AND t.topic_last_post_time > ' . $mark_time_forum . ' + AND t.topic_moved_id = 0 + AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.'); + $result = $db->sql_query($sql); + + $check_forum = $tracking_topics['tf'][$forum_id]; + $unread = false; + + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($check_forum[base_convert($row['topic_id'], 10, 36)])) + { + $unread = true; + break; + } + } + $db->sql_freeresult($result); + + $row = $unread; + } + } + else + { + $row = true; + } + + if (!$row) + { + markread('topics', $forum_id); + return true; + } + + return false; +} + +/** +* Transform an array into a serialized format +*/ +function tracking_serialize($input) +{ + $out = ''; + foreach ($input as $key => $value) + { + if (is_array($value)) + { + $out .= $key . ':(' . tracking_serialize($value) . ');'; + } + else + { + $out .= $key . ':' . $value . ';'; + } + } + return $out; +} + +/** +* Transform a serialized array into an actual array +*/ +function tracking_unserialize($string, $max_depth = 3) +{ + $n = strlen($string); + if ($n > 10010) + { + die('Invalid data supplied'); + } + $data = $stack = array(); + $key = ''; + $mode = 0; + $level = &$data; + for ($i = 0; $i < $n; ++$i) + { + switch ($mode) + { + case 0: + switch ($string[$i]) + { + case ':': + $level[$key] = 0; + $mode = 1; + break; + case ')': + unset($level); + $level = array_pop($stack); + $mode = 3; + break; + default: + $key .= $string[$i]; + } + break; + + case 1: + switch ($string[$i]) + { + case '(': + if (sizeof($stack) >= $max_depth) + { + die('Invalid data supplied'); + } + $stack[] = &$level; + $level[$key] = array(); + $level = &$level[$key]; + $key = ''; + $mode = 0; + break; + default: + $level[$key] = $string[$i]; + $mode = 2; + break; + } + break; + + case 2: + switch ($string[$i]) + { + case ')': + unset($level); + $level = array_pop($stack); + $mode = 3; + break; + case ';': + $key = ''; + $mode = 0; + break; + default: + $level[$key] .= $string[$i]; + break; + } + break; + + case 3: + switch ($string[$i]) + { + case ')': + unset($level); + $level = array_pop($stack); + break; + case ';': + $key = ''; + $mode = 0; + break; + default: + die('Invalid data supplied'); + break; + } + break; + } + } + + if (sizeof($stack) != 0 || ($mode != 0 && $mode != 3)) + { + die('Invalid data supplied'); + } + + return $level; +} + +// Server functions (building urls, redirecting...) + +/** +* Append session id to url. +* This function supports hooks. +* +* @param string $url The url the session id needs to be appended to (can have params) +* @param mixed $params String or array of additional url parameters +* @param bool $is_amp Is url using & (true) or & (false) +* @param string $session_id Possibility to use a custom session id instead of the global one +* @param bool $is_route Is url generated by a route. +* +* @return string The corrected url. +* +* Examples: +* +* append_sid("{$phpbb_root_path}viewtopic.$phpEx?t=1&f=2"); +* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&f=2'); +* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&f=2', false); +* append_sid("{$phpbb_root_path}viewtopic.$phpEx", array('t' => 1, 'f' => 2)); +* +* +*/ +function append_sid($url, $params = false, $is_amp = true, $session_id = false, $is_route = false) +{ + global $_SID, $_EXTRA_URL, $phpbb_hook, $phpbb_path_helper; + global $phpbb_dispatcher; + + if ($params === '' || (is_array($params) && empty($params))) + { + // Do not append the ? if the param-list is empty anyway. + $params = false; + } + + // Update the root path with the correct relative web path + if (!$is_route && $phpbb_path_helper instanceof \phpbb\path_helper) + { + $url = $phpbb_path_helper->update_web_root_path($url); + } + + $append_sid_overwrite = false; + + /** + * This event can either supplement or override the append_sid() function + * + * To override this function, the event must set $append_sid_overwrite to + * the new URL value, which will be returned following the event + * + * @event core.append_sid + * @var string url The url the session id needs + * to be appended to (can have + * params) + * @var mixed params String or array of additional + * url parameters + * @var bool is_amp Is url using & (true) or + * & (false) + * @var bool|string session_id Possibility to use a custom + * session id (string) instead of + * the global one (false) + * @var bool|string append_sid_overwrite Overwrite function (string + * URL) or not (false) + * @var bool is_route Is url generated by a route. + * @since 3.1.0-a1 + */ + $vars = array('url', 'params', 'is_amp', 'session_id', 'append_sid_overwrite', 'is_route'); + extract($phpbb_dispatcher->trigger_event('core.append_sid', compact($vars))); + + if ($append_sid_overwrite) + { + return $append_sid_overwrite; + } + + // The following hook remains for backwards compatibility, though use of + // the event above is preferred. + // Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropriately. + // They could mimic most of what is within this function + if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__, $url, $params, $is_amp, $session_id)) + { + if ($phpbb_hook->hook_return(__FUNCTION__)) + { + return $phpbb_hook->hook_return_result(__FUNCTION__); + } + } + + $params_is_array = is_array($params); + + // Get anchor + $anchor = ''; + if (strpos($url, '#') !== false) + { + list($url, $anchor) = explode('#', $url, 2); + $anchor = '#' . $anchor; + } + else if (!$params_is_array && strpos($params, '#') !== false) + { + list($params, $anchor) = explode('#', $params, 2); + $anchor = '#' . $anchor; + } + + // Handle really simple cases quickly + if ($_SID == '' && $session_id === false && empty($_EXTRA_URL) && !$params_is_array && !$anchor) + { + if ($params === false) + { + return $url; + } + + $url_delim = (strpos($url, '?') === false) ? '?' : (($is_amp) ? '&' : '&'); + return $url . ($params !== false ? $url_delim. $params : ''); + } + + // Assign sid if session id is not specified + if ($session_id === false) + { + $session_id = $_SID; + } + + $amp_delim = ($is_amp) ? '&' : '&'; + $url_delim = (strpos($url, '?') === false) ? '?' : $amp_delim; + + // Appending custom url parameter? + $append_url = (!empty($_EXTRA_URL)) ? implode($amp_delim, $_EXTRA_URL) : ''; + + // Use the short variant if possible ;) + if ($params === false) + { + // Append session id + if (!$session_id) + { + return $url . (($append_url) ? $url_delim . $append_url : '') . $anchor; + } + else + { + return $url . (($append_url) ? $url_delim . $append_url . $amp_delim : $url_delim) . 'sid=' . $session_id . $anchor; + } + } + + // Build string if parameters are specified as array + if (is_array($params)) + { + $output = array(); + + foreach ($params as $key => $item) + { + if ($item === NULL) + { + continue; + } + + if ($key == '#') + { + $anchor = '#' . $item; + continue; + } + + $output[] = $key . '=' . $item; + } + + $params = implode($amp_delim, $output); + } + + // Append session id and parameters (even if they are empty) + // If parameters are empty, the developer can still append his/her parameters without caring about the delimiter + return $url . (($append_url) ? $url_delim . $append_url . $amp_delim : $url_delim) . $params . ((!$session_id) ? '' : $amp_delim . 'sid=' . $session_id) . $anchor; +} + +/** +* Generate board url (example: http://www.example.com/phpBB) +* +* @param bool $without_script_path if set to true the script path gets not appended (example: http://www.example.com) +* +* @return string the generated board url +*/ +function generate_board_url($without_script_path = false) +{ + global $config, $user, $request; + + $server_name = $user->host; + $server_port = $request->server('SERVER_PORT', 0); + + // Forcing server vars is the only way to specify/override the protocol + if ($config['force_server_vars'] || !$server_name) + { + $server_protocol = ($config['server_protocol']) ? $config['server_protocol'] : (($config['cookie_secure']) ? 'https://' : 'http://'); + $server_name = $config['server_name']; + $server_port = (int) $config['server_port']; + $script_path = $config['script_path']; + + $url = $server_protocol . $server_name; + $cookie_secure = $config['cookie_secure']; + } + else + { + // Do not rely on cookie_secure, users seem to think that it means a secured cookie instead of an encrypted connection + $cookie_secure = $request->is_secure() ? 1 : 0; + $url = (($cookie_secure) ? 'https://' : 'http://') . $server_name; + + $script_path = $user->page['root_script_path']; + } + + if ($server_port && (($cookie_secure && $server_port <> 443) || (!$cookie_secure && $server_port <> 80))) + { + // HTTP HOST can carry a port number (we fetch $user->host, but for old versions this may be true) + if (strpos($server_name, ':') === false) + { + $url .= ':' . $server_port; + } + } + + if (!$without_script_path) + { + $url .= $script_path; + } + + // Strip / from the end + if (substr($url, -1, 1) == '/') + { + $url = substr($url, 0, -1); + } + + return $url; +} + +/** +* Redirects the user to another page then exits the script nicely +* This function is intended for urls within the board. It's not meant to redirect to cross-domains. +* +* @param string $url The url to redirect to +* @param bool $return If true, do not redirect but return the sanitized URL. Default is no return. +* @param bool $disable_cd_check If true, redirect() will redirect to an external domain. If false, the redirect point to the boards url if it does not match the current domain. Default is false. +*/ +function redirect($url, $return = false, $disable_cd_check = false) +{ + global $db, $cache, $config, $user, $phpbb_root_path, $phpbb_filesystem, $phpbb_path_helper, $phpEx, $phpbb_dispatcher; + + $failover_flag = false; + + if (empty($user->lang)) + { + $user->add_lang('common'); + } + + // Make sure no &'s are in, this will break the redirect + $url = str_replace('&', '&', $url); + + // Determine which type of redirect we need to handle... + $url_parts = @parse_url($url); + + if ($url_parts === false) + { + // Malformed url, redirect to current page... + $url = generate_board_url() . '/' . $user->page['page']; + } + else if (!empty($url_parts['scheme']) && !empty($url_parts['host'])) + { + // Attention: only able to redirect within the same domain if $disable_cd_check is false (yourdomain.com -> www.yourdomain.com will not work) + if (!$disable_cd_check && $url_parts['host'] !== $user->host) + { + $url = generate_board_url(); + } + } + else if ($url[0] == '/') + { + // Absolute uri, prepend direct url... + $url = generate_board_url(true) . $url; + } + else + { + // Relative uri + $pathinfo = pathinfo($url); + + // Is the uri pointing to the current directory? + if ($pathinfo['dirname'] == '.') + { + $url = str_replace('./', '', $url); + + // Strip / from the beginning + if ($url && substr($url, 0, 1) == '/') + { + $url = substr($url, 1); + } + } + + $url = $phpbb_path_helper->remove_web_root_path($url); + + if ($user->page['page_dir']) + { + $url = $user->page['page_dir'] . '/' . $url; + } + + $url = generate_board_url() . '/' . $url; + } + + // Clean URL and check if we go outside the forum directory + $url = $phpbb_path_helper->clean_url($url); + + if (!$disable_cd_check && strpos($url, generate_board_url(true)) === false) + { + trigger_error('INSECURE_REDIRECT', E_USER_ERROR); + } + + // Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2 + if (strpos(urldecode($url), "\n") !== false || strpos(urldecode($url), "\r") !== false || strpos($url, ';') !== false) + { + trigger_error('INSECURE_REDIRECT', E_USER_ERROR); + } + + // Now, also check the protocol and for a valid url the last time... + $allowed_protocols = array('http', 'https', 'ftp', 'ftps'); + $url_parts = parse_url($url); + + if ($url_parts === false || empty($url_parts['scheme']) || !in_array($url_parts['scheme'], $allowed_protocols)) + { + trigger_error('INSECURE_REDIRECT', E_USER_ERROR); + } + + /** + * Execute code and/or overwrite redirect() + * + * @event core.functions.redirect + * @var string url The url + * @var bool return If true, do not redirect but return the sanitized URL. + * @var bool disable_cd_check If true, redirect() will redirect to an external domain. If false, the redirect point to the boards url if it does not match the current domain. + * @since 3.1.0-RC3 + */ + $vars = array('url', 'return', 'disable_cd_check'); + extract($phpbb_dispatcher->trigger_event('core.functions.redirect', compact($vars))); + + if ($return) + { + return $url; + } + else + { + garbage_collection(); + } + + // Redirect via an HTML form for PITA webservers + if (@preg_match('#Microsoft|WebSTAR|Xitami#', getenv('SERVER_SOFTWARE'))) + { + header('Refresh: 0; URL=' . $url); + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '' . $user->lang['REDIRECT'] . ''; + echo ''; + echo ''; + echo '
' . sprintf($user->lang['URL_REDIRECT'], '', '') . '
'; + echo ''; + echo ''; + + exit; + } + + // Behave as per HTTP/1.1 spec for others + header('Location: ' . $url); + exit; +} + +/** +* Re-Apply session id after page reloads +*/ +function reapply_sid($url) +{ + global $phpEx, $phpbb_root_path; + + if ($url === "index.$phpEx") + { + return append_sid("index.$phpEx"); + } + else if ($url === "{$phpbb_root_path}index.$phpEx") + { + return append_sid("{$phpbb_root_path}index.$phpEx"); + } + + // Remove previously added sid + if (strpos($url, 'sid=') !== false) + { + // All kind of links + $url = preg_replace('/(\?)?(&|&)?sid=[a-z0-9]+/', '', $url); + // if the sid was the first param, make the old second as first ones + $url = preg_replace("/$phpEx(&|&)+?/", "$phpEx?", $url); + } + + return append_sid($url); +} + +/** +* Returns url from the session/current page with an re-appended SID with optionally stripping vars from the url +*/ +function build_url($strip_vars = false) +{ + global $config, $user, $phpbb_path_helper; + + $page = $phpbb_path_helper->get_valid_page($user->page['page'], $config['enable_mod_rewrite']); + + // Append SID + $redirect = append_sid($page, false, false); + + if ($strip_vars !== false) + { + $redirect = $phpbb_path_helper->strip_url_params($redirect, $strip_vars, false); + } + else + { + $redirect = str_replace('&', '&', $redirect); + } + + return $redirect . ((strpos($redirect, '?') === false) ? '?' : ''); +} + +/** +* Meta refresh assignment +* Adds META template variable with meta http tag. +* +* @param int $time Time in seconds for meta refresh tag +* @param string $url URL to redirect to. The url will go through redirect() first before the template variable is assigned +* @param bool $disable_cd_check If true, meta_refresh() will redirect to an external domain. If false, the redirect point to the boards url if it does not match the current domain. Default is false. +*/ +function meta_refresh($time, $url, $disable_cd_check = false) +{ + global $template, $refresh_data, $request; + + $url = redirect($url, true, $disable_cd_check); + if ($request->is_ajax()) + { + $refresh_data = array( + 'time' => $time, + 'url' => $url, + ); + } + else + { + // For XHTML compatibility we change back & to & + $url = str_replace('&', '&', $url); + + $template->assign_vars(array( + 'META' => '') + ); + } + + return $url; +} + +/** +* Outputs correct status line header. +* +* Depending on php sapi one of the two following forms is used: +* +* Status: 404 Not Found +* +* HTTP/1.x 404 Not Found +* +* HTTP version is taken from HTTP_VERSION environment variable, +* and defaults to 1.0. +* +* Sample usage: +* +* send_status_line(404, 'Not Found'); +* +* @param int $code HTTP status code +* @param string $message Message for the status code +* @return null +*/ +function send_status_line($code, $message) +{ + if (substr(strtolower(@php_sapi_name()), 0, 3) === 'cgi') + { + // in theory, we shouldn't need that due to php doing it. Reality offers a differing opinion, though + header("Status: $code $message", true, $code); + } + else + { + $version = phpbb_request_http_version(); + header("$version $code $message", true, $code); + } +} + +/** +* Returns the HTTP version used in the current request. +* +* Handles the case of being called before $request is present, +* in which case it falls back to the $_SERVER superglobal. +* +* @return string HTTP version +*/ +function phpbb_request_http_version() +{ + global $request; + + if ($request && $request->server('SERVER_PROTOCOL')) + { + return $request->server('SERVER_PROTOCOL'); + } + else if (isset($_SERVER['SERVER_PROTOCOL'])) + { + return $_SERVER['SERVER_PROTOCOL']; + } + + return 'HTTP/1.0'; +} + +//Form validation + + +/** +* Add a secret hash for use in links/GET requests +* @param string $link_name The name of the link; has to match the name used in check_link_hash, otherwise no restrictions apply +* @return string the hash + +*/ +function generate_link_hash($link_name) +{ + global $user; + + if (!isset($user->data["hash_$link_name"])) + { + $user->data["hash_$link_name"] = substr(sha1($user->data['user_form_salt'] . $link_name), 0, 8); + } + + return $user->data["hash_$link_name"]; +} + + +/** +* checks a link hash - for GET requests +* @param string $token the submitted token +* @param string $link_name The name of the link +* @return boolean true if all is fine +*/ +function check_link_hash($token, $link_name) +{ + return $token === generate_link_hash($link_name); +} + +/** +* Add a secret token to the form (requires the S_FORM_TOKEN template variable) +* @param string $form_name The name of the form; has to match the name used in check_form_key, otherwise no restrictions apply +*/ +function add_form_key($form_name) +{ + global $config, $template, $user, $phpbb_dispatcher; + + $now = time(); + $token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : ''; + $token = sha1($now . $user->data['user_form_salt'] . $form_name . $token_sid); + + $s_fields = build_hidden_fields(array( + 'creation_time' => $now, + 'form_token' => $token, + )); + + /** + * Perform additional actions on creation of the form token + * + * @event core.add_form_key + * @var string form_name The form name + * @var int now Current time timestamp + * @var string s_fields Generated hidden fields + * @var string token Form token + * @var string token_sid User session ID + * + * @since 3.1.0-RC3 + */ + $vars = array( + 'form_name', + 'now', + 's_fields', + 'token', + 'token_sid', + ); + extract($phpbb_dispatcher->trigger_event('core.add_form_key', compact($vars))); + + $template->assign_vars(array( + 'S_FORM_TOKEN' => $s_fields, + )); +} + +/** + * Check the form key. Required for all altering actions not secured by confirm_box + * + * @param string $form_name The name of the form; has to match the name used + * in add_form_key, otherwise no restrictions apply + * @param int $timespan The maximum acceptable age for a submitted form + * in seconds. Defaults to the config setting. + * @return bool True, if the form key was valid, false otherwise + */ +function check_form_key($form_name, $timespan = false) +{ + global $config, $request, $user; + + if ($timespan === false) + { + // we enforce a minimum value of half a minute here. + $timespan = ($config['form_token_lifetime'] == -1) ? -1 : max(30, $config['form_token_lifetime']); + } + + if ($request->is_set_post('creation_time') && $request->is_set_post('form_token')) + { + $creation_time = abs($request->variable('creation_time', 0)); + $token = $request->variable('form_token', ''); + + $diff = time() - $creation_time; + + // If creation_time and the time() now is zero we can assume it was not a human doing this (the check for if ($diff)... + if (defined('DEBUG_TEST') || $diff && ($diff <= $timespan || $timespan === -1)) + { + $token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : ''; + $key = sha1($creation_time . $user->data['user_form_salt'] . $form_name . $token_sid); + + if ($key === $token) + { + return true; + } + } + } + + return false; +} + +// Message/Login boxes + +/** +* Build Confirm box +* @param boolean $check True for checking if confirmed (without any additional parameters) and false for displaying the confirm box +* @param string $title Title/Message used for confirm box. +* message text is _CONFIRM appended to title. +* If title cannot be found in user->lang a default one is displayed +* If title_CONFIRM cannot be found in user->lang the text given is used. +* @param string $hidden Hidden variables +* @param string $html_body Template used for confirm box +* @param string $u_action Custom form action +*/ +function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '') +{ + global $user, $template, $db, $request; + global $config, $phpbb_path_helper; + + if (isset($_POST['cancel'])) + { + return false; + } + + $confirm = ($user->lang['YES'] === $request->variable('confirm', '', true, \phpbb\request\request_interface::POST)); + + if ($check && $confirm) + { + $user_id = request_var('confirm_uid', 0); + $session_id = request_var('sess', ''); + $confirm_key = request_var('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']) + { + return false; + } + + // Reset user_last_confirm_key + $sql = 'UPDATE ' . USERS_TABLE . " SET user_last_confirm_key = '' + WHERE user_id = " . $user->data['user_id']; + $db->sql_query($sql); + + return true; + } + else if ($check) + { + return false; + } + + $s_hidden_fields = build_hidden_fields(array( + 'confirm_uid' => $user->data['user_id'], + 'sess' => $user->session_id, + 'sid' => $user->session_id, + )); + + // generate activation key + $confirm_key = gen_rand_string(10); + + if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) + { + adm_page_header((!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title]); + } + else + { + page_header((!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title]); + } + + $template->set_filenames(array( + 'body' => $html_body) + ); + + // If activation key already exist, we better do not re-use the key (something very strange is going on...) + if (request_var('confirm_key', '')) + { + // This should not occur, therefore we cancel the operation to safe the user + return false; + } + + // re-add sid / transform & to & for user->page (user->page is always using &) + $use_page = ($u_action) ? $u_action : str_replace('&', '&', $user->page['page']); + $u_action = reapply_sid($phpbb_path_helper->get_valid_page($use_page, $config['enable_mod_rewrite'])); + $u_action .= ((strpos($u_action, '?') === false) ? '?' : '&') . 'confirm_key=' . $confirm_key; + + $template->assign_vars(array( + 'MESSAGE_TITLE' => (!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title], + 'MESSAGE_TEXT' => (!isset($user->lang[$title . '_CONFIRM'])) ? $title : $user->lang[$title . '_CONFIRM'], + + 'YES_VALUE' => $user->lang['YES'], + 'S_CONFIRM_ACTION' => $u_action, + 'S_HIDDEN_FIELDS' => $hidden . $s_hidden_fields, + 'S_AJAX_REQUEST' => $request->is_ajax(), + )); + + $sql = 'UPDATE ' . USERS_TABLE . " SET user_last_confirm_key = '" . $db->sql_escape($confirm_key) . "' + WHERE user_id = " . $user->data['user_id']; + $db->sql_query($sql); + + if ($request->is_ajax()) + { + $u_action .= '&confirm_uid=' . $user->data['user_id'] . '&sess=' . $user->session_id . '&sid=' . $user->session_id; + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'MESSAGE_BODY' => $template->assign_display('body'), + 'MESSAGE_TITLE' => (!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title], + 'MESSAGE_TEXT' => (!isset($user->lang[$title . '_CONFIRM'])) ? $title : $user->lang[$title . '_CONFIRM'], + + 'YES_VALUE' => $user->lang['YES'], + 'S_CONFIRM_ACTION' => str_replace('&', '&', $u_action), //inefficient, rewrite whole function + 'S_HIDDEN_FIELDS' => $hidden . $s_hidden_fields + )); + } + + if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) + { + adm_page_footer(); + } + else + { + page_footer(); + } +} + +/** +* Generate login box or verify password +*/ +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; + + $err = ''; + + // Make sure user->setup() has been called + if (empty($user->lang)) + { + $user->setup(); + } + + // Print out error if user tries to authenticate as an administrator without having the privileges... + if ($admin && !$auth->acl_get('a_')) + { + // Not authd + // 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'); + } + trigger_error('NO_AUTH_ADMIN'); + } + + if ($request->is_set_post('login') || ($request->is_set('login') && $request->variable('login', '') == 'external')) + { + // Get credential + if ($admin) + { + $credential = request_var('credential', ''); + + if (strspn($credential, 'abcdef0123456789') !== strlen($credential) || strlen($credential) != 32) + { + if ($user->data['is_registered']) + { + add_log('admin', 'LOG_ADMIN_AUTH_FAIL'); + } + trigger_error('NO_AUTH_ADMIN'); + } + + $password = $request->untrimmed_variable('password_' . $credential, '', true); + } + else + { + $password = $request->untrimmed_variable('password', '', true); + } + + $username = request_var('username', '', true); + $autologin = $request->is_set_post('autologin'); + $viewonline = (int) !$request->is_set_post('viewonline'); + $admin = ($admin) ? 1 : 0; + $viewonline = ($admin) ? $user->data['session_viewonline'] : $viewonline; + + // Check if the supplied username is equal to the one stored within the database if re-authenticating + 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'); + trigger_error('NO_AUTH_ADMIN_USER_DIFFER'); + } + + // If authentication is successful we redirect user to previous page + $result = $auth->login($username, $password, $autologin, $viewonline, $admin); + + // If admin authentication and login, we will log if it was a success or not... + // We also break the operation on the first non-success login - it could be argued that the user already knows + if ($admin) + { + if ($result['status'] == LOGIN_SUCCESS) + { + add_log('admin', 'LOG_ADMIN_AUTH_SUCCESS'); + } + else + { + // Only log the failed attempt if a real user tried to. + // 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'); + } + } + } + + // 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"); + + /** + * This event allows an extension to modify the redirection when a user successfully logs in + * + * @event core.login_box_redirect + * @var string redirect Redirect string + * @var boolean admin Is admin? + * @var bool return If true, do not redirect but return the sanitized URL. + * @since 3.1.0-RC5 + */ + $vars = array('redirect', 'admin', 'return'); + extract($phpbb_dispatcher->trigger_event('core.login_box_redirect', compact($vars))); + + // append/replace SID (may change during the session for AOL users) + $redirect = reapply_sid($redirect); + + // Special case... the user is effectively banned, but we allow founders to login + if (defined('IN_CHECK_BAN') && $result['user_row']['user_type'] != USER_FOUNDER) + { + return; + } + + redirect($redirect); + } + + // Something failed, determine what... + if ($result['status'] == LOGIN_BREAK) + { + trigger_error($result['error_msg']); + } + + // Special cases... determine + switch ($result['status']) + { + case LOGIN_ERROR_ATTEMPTS: + + $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']); + $captcha->init(CONFIRM_LOGIN); + // $captcha->reset(); + + $template->assign_vars(array( + 'CAPTCHA_TEMPLATE' => $captcha->get_template(), + )); + + $err = $user->lang[$result['error_msg']]; + break; + + case LOGIN_ERROR_PASSWORD_CONVERT: + $err = sprintf( + $user->lang[$result['error_msg']], + ($config['email_enable']) ? '' : '', + ($config['email_enable']) ? '' : '', + '', + '' + ); + break; + + // Username, password, etc... + default: + $err = $user->lang[$result['error_msg']]; + + // Assign admin contact to some error messages + if ($result['error_msg'] == 'LOGIN_ERROR_USERNAME' || $result['error_msg'] == 'LOGIN_ERROR_PASSWORD') + { + $err = sprintf($user->lang[$result['error_msg']], '', ''); + } + + break; + } + + /** + * This event allows an extension to process when a user fails a login attempt + * + * @event core.login_box_failed + * @var array result Login result data + * @var string username User name used to login + * @var string password Password used to login + * @var string err Error message + * @since 3.1.3-RC1 + */ + $vars = array('result', 'username', 'password', 'err'); + extract($phpbb_dispatcher->trigger_event('core.login_box_failed', compact($vars))); + } + + // Assign credential for username/password pair + $credential = ($admin) ? md5(unique_id()) : false; + + $s_hidden_fields = array( + 'sid' => $user->session_id, + ); + + if ($redirect) + { + $s_hidden_fields['redirect'] = $redirect; + } + + if ($admin) + { + $s_hidden_fields['credential'] = $credential; + } + + $provider_collection = $phpbb_container->get('auth.provider_collection'); + $auth_provider = $provider_collection->get_provider(); + + $auth_provider_data = $auth_provider->get_login_data(); + if ($auth_provider_data) + { + if (isset($auth_provider_data['VARS'])) + { + $template->assign_vars($auth_provider_data['VARS']); + } + + if (isset($auth_provider_data['BLOCK_VAR_NAME'])) + { + foreach ($auth_provider_data['BLOCK_VARS'] as $block_vars) + { + $template->assign_block_vars($auth_provider_data['BLOCK_VAR_NAME'], $block_vars); + } + } + + $template->assign_vars(array( + 'PROVIDER_TEMPLATE_FILE' => $auth_provider_data['TEMPLATE_FILE'], + )); + } + + $s_hidden_fields = build_hidden_fields($s_hidden_fields); + + $template->assign_vars(array( + 'LOGIN_ERROR' => $err, + 'LOGIN_EXPLAIN' => $l_explain, + + 'U_SEND_PASSWORD' => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '', + 'U_RESEND_ACTIVATION' => ($config['require_activation'] == USER_ACTIVATION_SELF && $config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=resend_act') : '', + 'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'), + 'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'), + + 'S_DISPLAY_FULL_LOGIN' => ($s_display) ? true : false, + 'S_HIDDEN_FIELDS' => $s_hidden_fields, + + 'S_ADMIN_AUTH' => $admin, + 'USERNAME' => ($admin) ? $user->data['username'] : '', + + 'USERNAME_CREDENTIAL' => 'username', + 'PASSWORD_CREDENTIAL' => ($admin) ? 'password_' . $credential : 'password', + )); + + page_header($user->lang['LOGIN']); + + $template->set_filenames(array( + 'body' => 'login_body.html') + ); + make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); + + page_footer(); +} + +/** +* Generate forum login box +*/ +function login_forum_box($forum_data) +{ + global $db, $phpbb_container, $request, $template, $user, $phpbb_dispatcher; + + $password = $request->variable('password', '', true); + + $sql = 'SELECT forum_id + FROM ' . FORUMS_ACCESS_TABLE . ' + WHERE forum_id = ' . $forum_data['forum_id'] . ' + AND user_id = ' . $user->data['user_id'] . " + AND session_id = '" . $db->sql_escape($user->session_id) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + return true; + } + + if ($password) + { + // Remove expired authorised sessions + $sql = 'SELECT f.session_id + FROM ' . FORUMS_ACCESS_TABLE . ' f + LEFT JOIN ' . SESSIONS_TABLE . ' s ON (f.session_id = s.session_id) + WHERE s.session_id IS NULL'; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $sql_in = array(); + do + { + $sql_in[] = (string) $row['session_id']; + } + while ($row = $db->sql_fetchrow($result)); + + // Remove expired sessions + $sql = 'DELETE FROM ' . FORUMS_ACCESS_TABLE . ' + WHERE ' . $db->sql_in_set('session_id', $sql_in); + $db->sql_query($sql); + } + $db->sql_freeresult($result); + + $passwords_manager = $phpbb_container->get('passwords.manager'); + + if ($passwords_manager->check($password, $forum_data['forum_password'])) + { + $sql_ary = array( + 'forum_id' => (int) $forum_data['forum_id'], + 'user_id' => (int) $user->data['user_id'], + 'session_id' => (string) $user->session_id, + ); + + $db->sql_query('INSERT INTO ' . FORUMS_ACCESS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + + return true; + } + + $template->assign_var('LOGIN_ERROR', $user->lang['WRONG_PASSWORD']); + } + + /** + * Performing additional actions, load additional data on forum login + * + * @event core.login_forum_box + * @var array forum_data Array with forum data + * @var string password Password entered + * @since 3.1.0-RC3 + */ + $vars = array('forum_data', 'password'); + extract($phpbb_dispatcher->trigger_event('core.login_forum_box', compact($vars))); + + page_header($user->lang['LOGIN']); + + $template->assign_vars(array( + 'FORUM_NAME' => isset($forum_data['forum_name']) ? $forum_data['forum_name'] : '', + 'S_LOGIN_ACTION' => build_url(array('f')), + 'S_HIDDEN_FIELDS' => build_hidden_fields(array('f' => $forum_data['forum_id']))) + ); + + $template->set_filenames(array( + 'body' => 'login_forum.html') + ); + + page_footer(); +} + +// Little helpers + +/** +* Little helper for the build_hidden_fields function +*/ +function _build_hidden_fields($key, $value, $specialchar, $stripslashes) +{ + $hidden_fields = ''; + + if (!is_array($value)) + { + $value = ($stripslashes) ? stripslashes($value) : $value; + $value = ($specialchar) ? htmlspecialchars($value, ENT_COMPAT, 'UTF-8') : $value; + + $hidden_fields .= '' . "\n"; + } + else + { + foreach ($value as $_key => $_value) + { + $_key = ($stripslashes) ? stripslashes($_key) : $_key; + $_key = ($specialchar) ? htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') : $_key; + + $hidden_fields .= _build_hidden_fields($key . '[' . $_key . ']', $_value, $specialchar, $stripslashes); + } + } + + return $hidden_fields; +} + +/** +* Build simple hidden fields from array +* +* @param array $field_ary an array of values to build the hidden field from +* @param bool $specialchar if true, keys and values get specialchared +* @param bool $stripslashes if true, keys and values get stripslashed +* +* @return string the hidden fields +*/ +function build_hidden_fields($field_ary, $specialchar = false, $stripslashes = false) +{ + $s_hidden_fields = ''; + + foreach ($field_ary as $name => $vars) + { + $name = ($stripslashes) ? stripslashes($name) : $name; + $name = ($specialchar) ? htmlspecialchars($name, ENT_COMPAT, 'UTF-8') : $name; + + $s_hidden_fields .= _build_hidden_fields($name, $vars, $specialchar, $stripslashes); + } + + return $s_hidden_fields; +} + +/** +* Parse cfg file +*/ +function parse_cfg_file($filename, $lines = false) +{ + $parsed_items = array(); + + if ($lines === false) + { + $lines = file($filename); + } + + foreach ($lines as $line) + { + $line = trim($line); + + if (!$line || $line[0] == '#' || ($delim_pos = strpos($line, '=')) === false) + { + continue; + } + + // Determine first occurrence, since in values the equal sign is allowed + $key = htmlspecialchars(strtolower(trim(substr($line, 0, $delim_pos)))); + $value = trim(substr($line, $delim_pos + 1)); + + if (in_array($value, array('off', 'false', '0'))) + { + $value = false; + } + else if (in_array($value, array('on', 'true', '1'))) + { + $value = true; + } + else if (!trim($value)) + { + $value = ''; + } + else if (($value[0] == "'" && $value[sizeof($value) - 1] == "'") || ($value[0] == '"' && $value[sizeof($value) - 1] == '"')) + { + $value = htmlspecialchars(substr($value, 1, sizeof($value)-2)); + } + else + { + $value = htmlspecialchars($value); + } + + $parsed_items[$key] = $value; + } + + if (isset($parsed_items['parent']) && isset($parsed_items['name']) && $parsed_items['parent'] == $parsed_items['name']) + { + unset($parsed_items['parent']); + } + + return $parsed_items; +} + +/** +* 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. +* Also filters out absolute paths to phpBB root. +* +* @return string HTML markup +*/ +function get_backtrace() +{ + $output = '
'; + $backtrace = debug_backtrace(); + + // We skip the first one, because it only shows this file/function + unset($backtrace[0]); + + foreach ($backtrace as $trace) + { + // Strip the current directory from path + $trace['file'] = (empty($trace['file'])) ? '(not given by php)' : htmlspecialchars(phpbb_filter_root_path($trace['file'])); + $trace['line'] = (empty($trace['line'])) ? '(not given by php)' : $trace['line']; + + // Only show function arguments for include etc. + // Other parameters may contain sensible information + $argument = ''; + if (!empty($trace['args'][0]) && in_array($trace['function'], array('include', 'require', 'include_once', 'require_once'))) + { + $argument = htmlspecialchars(phpbb_filter_root_path($trace['args'][0])); + } + + $trace['class'] = (!isset($trace['class'])) ? '' : $trace['class']; + $trace['type'] = (!isset($trace['type'])) ? '' : $trace['type']; + + $output .= '
'; + $output .= 'FILE: ' . $trace['file'] . '
'; + $output .= 'LINE: ' . ((!empty($trace['line'])) ? $trace['line'] : '') . '
'; + + $output .= 'CALL: ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function']); + $output .= '(' . (($argument !== '') ? "'$argument'" : '') . ')
'; + } + $output .= '
'; + return $output; +} + +/** +* This function returns a regular expression pattern for commonly used expressions +* Use with / as delimiter for email mode and # for url modes +* mode can be: email|bbcode_htm|url|url_inline|www_url|www_url_inline|relative_url|relative_url_inline|ipv4|ipv6 +*/ +function get_preg_expression($mode) +{ + switch ($mode) + { + case 'email': + // Regex written by James Watts and Francisco Jose Martin Moreno + // http://fightingforalostcause.net/misc/2006/compare-email-regex.php + return '([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&)+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,63})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)'; + break; + + case 'bbcode_htm': + return array( + '#.*?#', + '#.*?#', + '#.*?#', + '# strlen($longest_match)) + { + $longest_match = $match[0]; + $longest_match_offset = $match[1]; + } + } + + $ret = substr_replace($ret, '', $longest_match_offset, strlen($longest_match)); + + if ($longest_match_offset == strlen($ret)) + { + $ret .= ':'; + } + + if ($longest_match_offset == 0) + { + $ret = ':' . $ret; + } + + return $ret; + + default: + return false; + } +} + +/** +* Wrapper for inet_pton() +* +* Converts a human readable IP address to its packed in_addr representation +* inet_pton() is supported by PHP since 5.1.0, since 5.3.0 also on Windows. +* +* @param string $address A human readable IPv4 or IPv6 address. +* +* @return mixed false if address is invalid, +* in_addr representation of the given address otherwise (string) +*/ +function phpbb_inet_pton($address) +{ + $ret = ''; + if (preg_match(get_preg_expression('ipv4'), $address)) + { + foreach (explode('.', $address) as $part) + { + $ret .= ($part <= 0xF ? '0' : '') . dechex($part); + } + + return pack('H*', $ret); + } + + if (preg_match(get_preg_expression('ipv6'), $address)) + { + $parts = explode(':', $address); + $missing_parts = 8 - sizeof($parts) + 1; + + if (substr($address, 0, 2) === '::') + { + ++$missing_parts; + } + + if (substr($address, -2) === '::') + { + ++$missing_parts; + } + + $embedded_ipv4 = false; + $last_part = end($parts); + + if (preg_match(get_preg_expression('ipv4'), $last_part)) + { + $parts[sizeof($parts) - 1] = ''; + $last_part = phpbb_inet_pton($last_part); + $embedded_ipv4 = true; + --$missing_parts; + } + + foreach ($parts as $i => $part) + { + if (strlen($part)) + { + $ret .= str_pad($part, 4, '0', STR_PAD_LEFT); + } + else if ($i && $i < sizeof($parts) - 1) + { + $ret .= str_repeat('0000', $missing_parts); + } + } + + $ret = pack('H*', $ret); + + if ($embedded_ipv4) + { + $ret .= $last_part; + } + + return $ret; + } + + return false; +} + +/** +* Wrapper for php's checkdnsrr function. +* +* @param string $host Fully-Qualified Domain Name +* @param string $type Resource record type to lookup +* Supported types are: MX (default), A, AAAA, NS, TXT, CNAME +* Other types may work or may not work +* +* @return mixed true if entry found, +* false if entry not found, +* null if this function is not supported by this environment +* +* Since null can also be returned, you probably want to compare the result +* with === true or === false, +*/ +function phpbb_checkdnsrr($host, $type = 'MX') +{ + // The dot indicates to search the DNS root (helps those having DNS prefixes on the same domain) + if (substr($host, -1) == '.') + { + $host_fqdn = $host; + $host = substr($host, 0, -1); + } + else + { + $host_fqdn = $host . '.'; + } + // $host has format some.host.example.com + // $host_fqdn has format some.host.example.com. + + // If we're looking for an A record we can use gethostbyname() + if ($type == 'A' && function_exists('gethostbyname')) + { + 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') + ) + { + 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') + ) + { + // dns_get_record() expects an integer as second parameter + // We have to convert the string $type to the corresponding integer constant. + $type_constant = 'DNS_' . $type; + $type_param = (defined($type_constant)) ? constant($type_constant) : DNS_ANY; + + // dns_get_record() might throw E_WARNING and return false for records that do not exist + $resultset = @dns_get_record($host_fqdn, $type_param); + + if (empty($resultset) || !is_array($resultset)) + { + return false; + } + else if ($type_param == DNS_ANY) + { + // $resultset is a non-empty array + return true; + } + + foreach ($resultset as $result) + { + if ( + isset($result['host']) && $result['host'] == $host && + isset($result['type']) && $result['type'] == $type + ) + { + return true; + } + } + + return false; + } + + // If we're on Windows we can still try to call nslookup via exec() as a last resort + if (DIRECTORY_SEPARATOR == '\\' && function_exists('exec')) + { + @exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host_fqdn), $output); + + // If output is empty, the nslookup failed + if (empty($output)) + { + return NULL; + } + + foreach ($output as $line) + { + $line = trim($line); + + if (empty($line)) + { + continue; + } + + // Squash tabs and multiple whitespaces to a single whitespace. + $line = preg_replace('/\s+/', ' ', $line); + + switch ($type) + { + case 'MX': + if (stripos($line, "$host MX") === 0) + { + return true; + } + break; + + case 'NS': + if (stripos($line, "$host nameserver") === 0) + { + return true; + } + break; + + case 'TXT': + if (stripos($line, "$host text") === 0) + { + return true; + } + break; + + case 'CNAME': + if (stripos($line, "$host canonical name") === 0) + { + return true; + } + break; + + default: + case 'AAAA': + // AAAA records returned by nslookup on Windows XP/2003 have this format. + // Later Windows versions use the A record format below for AAAA records. + if (stripos($line, "$host AAAA IPv6 address") === 0) + { + return true; + } + // No break + + case 'A': + if (!empty($host_matches)) + { + // Second line + if (stripos($line, "Address: ") === 0) + { + return true; + } + else + { + $host_matches = false; + } + } + else if (stripos($line, "Name: $host") === 0) + { + // First line + $host_matches = true; + } + break; + } + } + + return false; + } + + return NULL; +} + +// Handler, header and footer + +/** +* Error and message handler, call with trigger_error if read +*/ +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; + + // 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) + { + return; + } + + // Message handler is stripping text. In case we need it, we are possible to define long text... + if (isset($msg_long_text) && $msg_long_text && !$msg_text) + { + $msg_text = $msg_long_text; + } + + if (!defined('E_DEPRECATED')) + { + define('E_DEPRECATED', 8192); + } + + switch ($errno) + { + case E_NOTICE: + case E_WARNING: + + // Check the error reporting level and return if the error level does not match + // If DEBUG is defined the default level is E_ALL + if (($errno & ((defined('DEBUG')) ? E_ALL : error_reporting())) == 0) + { + return; + } + + if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false) + { + $errfile = phpbb_filter_root_path($errfile); + $msg_text = phpbb_filter_root_path($msg_text); + $error_name = ($errno === E_WARNING) ? 'PHP Warning' : 'PHP Notice'; + echo '[phpBB Debug] ' . $error_name . ': in file ' . $errfile . ' on line ' . $errline . ': ' . $msg_text . '
' . "\n"; + + // 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); + } + // echo '

BACKTRACE
' . get_backtrace() . '
' . "\n"; + } + + return; + + break; + + case E_USER_ERROR: + + if (!empty($user) && !empty($user->lang)) + { + $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); + + $l_return_index = sprintf($user->lang['RETURN_INDEX'], '', ''); + $l_notify = ''; + + if (!empty($config['board_contact'])) + { + $l_notify = '

' . sprintf($user->lang['NOTIFY_ADMIN_EMAIL'], $config['board_contact']) . '

'; + } + } + else + { + $msg_title = 'General Error'; + $l_return_index = 'Return to index page'; + $l_notify = ''; + + if (!empty($config['board_contact'])) + { + $l_notify = '

Please notify the board administrator or webmaster: ' . $config['board_contact'] . '

'; + } + } + + $log_text = $msg_text; + $backtrace = get_backtrace(); + if ($backtrace) + { + $log_text .= '

BACKTRACE
' . $backtrace; + } + + if (defined('IN_INSTALL') || defined('DEBUG') || isset($auth) && $auth->acl_get('a_')) + { + $msg_text = $log_text; + + // If this is defined there already was some output + // So let's not break it + if (defined('IN_DB_UPDATE')) + { + echo '
' . $msg_text . '
'; + + $db->sql_return_on_error(true); + phpbb_end_update($cache, $config); + } + } + + if ((defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db)) + { + // let's avoid loops + $db->sql_return_on_error(true); + add_log('critical', 'LOG_GENERAL_ERROR', $msg_title, $log_text); + $db->sql_return_on_error(false); + } + + // Do not send 200 OK, but service unavailable on errors + send_status_line(503, 'Service Unavailable'); + + garbage_collection(); + + // Try to not call the adm page data... + + echo ''; + echo ''; + echo ''; + echo ''; + echo '' . $msg_title . ''; + echo ''; + echo ''; + echo ''; + echo '
'; + echo ' '; + echo '
'; + echo '
'; + echo '
'; + echo '

' . $msg_title . '

'; + + echo '
' . $msg_text . '
'; + + echo $l_notify; + + echo '
'; + echo '
'; + echo '
'; + echo ' '; + echo '
'; + echo ''; + echo ''; + + exit_handler(); + + // On a fatal error (and E_USER_ERROR *is* fatal) we never want other scripts to continue and force an exit here. + exit; + break; + + case E_USER_WARNING: + case E_USER_NOTICE: + + define('IN_ERROR_HANDLER', true); + + if (empty($user->data)) + { + $user->session_begin(); + } + + // We re-init the auth array to get correct results on login/logout + $auth->acl($user->data); + + if (empty($user->lang)) + { + $user->setup(); + } + + if ($msg_text == 'ERROR_NO_ATTACHMENT' || $msg_text == 'NO_FORUM' || $msg_text == 'NO_TOPIC' || $msg_text == 'NO_USER') + { + send_status_line(404, 'Not Found'); + } + + $msg_text = (!empty($user->lang[$msg_text])) ? $user->lang[$msg_text] : $msg_text; + $msg_title = (!isset($msg_title)) ? $user->lang['INFORMATION'] : ((!empty($user->lang[$msg_title])) ? $user->lang[$msg_title] : $msg_title); + + if (!defined('HEADER_INC')) + { + if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) + { + adm_page_header($msg_title); + } + else + { + page_header($msg_title); + } + } + + $template->set_filenames(array( + 'body' => 'message_body.html') + ); + + $template->assign_vars(array( + 'MESSAGE_TITLE' => $msg_title, + 'MESSAGE_TEXT' => $msg_text, + 'S_USER_WARNING' => ($errno == E_USER_WARNING) ? true : false, + 'S_USER_NOTICE' => ($errno == E_USER_NOTICE) ? true : false) + ); + + if ($request->is_ajax()) + { + global $refresh_data; + + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'MESSAGE_TITLE' => $msg_title, + 'MESSAGE_TEXT' => $msg_text, + 'S_USER_WARNING' => ($errno == E_USER_WARNING) ? true : false, + 'S_USER_NOTICE' => ($errno == E_USER_NOTICE) ? true : false, + 'REFRESH_DATA' => (!empty($refresh_data)) ? $refresh_data : null + )); + } + + // We do not want the cron script to be called on error messages + define('IN_CRON', true); + + if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) + { + adm_page_footer(); + } + else + { + page_footer(); + } + + exit_handler(); + break; + + // PHP4 compatibility + case E_DEPRECATED: + return true; + break; + } + + // If we notice an error not handled here we pass this back to PHP by returning false + // This may not work for all php versions + return false; +} + +/** +* Removes absolute path to phpBB root directory from error messages +* and converts backslashes to forward slashes. +* +* @param string $errfile Absolute file path +* (e.g. /var/www/phpbb3/phpBB/includes/functions.php) +* Please note that if $errfile is outside of the phpBB root, +* the root path will not be found and can not be filtered. +* @return string Relative file path +* (e.g. /includes/functions.php) +*/ +function phpbb_filter_root_path($errfile) +{ + static $root_path; + + if (empty($root_path)) + { + $root_path = phpbb_realpath(dirname(__FILE__) . '/../'); + } + + return str_replace(array($root_path, '\\'), array('[ROOT]', '/'), $errfile); +} + +/** +* Queries the session table to get information about online guests +* @param int $item_id Limits the search to the item with this id +* @param string $item The name of the item which is stored in the session table as session_{$item}_id +* @return int The number of active distinct guest sessions +*/ +function obtain_guest_count($item_id = 0, $item = 'forum') +{ + global $db, $config; + + if ($item_id) + { + $reading_sql = ' AND s.session_' . $item . '_id = ' . (int) $item_id; + } + else + { + $reading_sql = ''; + } + $time = (time() - (intval($config['load_online_time']) * 60)); + + // Get number of online guests + + if ($db->get_sql_layer() === 'sqlite' || $db->get_sql_layer() === 'sqlite3') + { + $sql = 'SELECT COUNT(session_ip) as num_guests + FROM ( + SELECT DISTINCT s.session_ip + FROM ' . SESSIONS_TABLE . ' s + WHERE s.session_user_id = ' . ANONYMOUS . ' + AND s.session_time >= ' . ($time - ((int) ($time % 60))) . + $reading_sql . + ')'; + } + else + { + $sql = 'SELECT COUNT(DISTINCT s.session_ip) as num_guests + FROM ' . SESSIONS_TABLE . ' s + WHERE s.session_user_id = ' . ANONYMOUS . ' + AND s.session_time >= ' . ($time - ((int) ($time % 60))) . + $reading_sql; + } + $result = $db->sql_query($sql); + $guests_online = (int) $db->sql_fetchfield('num_guests'); + $db->sql_freeresult($result); + + return $guests_online; +} + +/** +* Queries the session table to get information about online users +* @param int $item_id Limits the search to the item with this id +* @param string $item The name of the item which is stored in the session table as session_{$item}_id +* @return array An array containing the ids of online, hidden and visible users, as well as statistical info +*/ +function obtain_users_online($item_id = 0, $item = 'forum') +{ + global $db, $config, $user; + + $reading_sql = ''; + if ($item_id !== 0) + { + $reading_sql = ' AND s.session_' . $item . '_id = ' . (int) $item_id; + } + + $online_users = array( + 'online_users' => array(), + 'hidden_users' => array(), + 'total_online' => 0, + 'visible_online' => 0, + 'hidden_online' => 0, + 'guests_online' => 0, + ); + + if ($config['load_online_guests']) + { + $online_users['guests_online'] = obtain_guest_count($item_id, $item); + } + + // a little discrete magic to cache this for 30 seconds + $time = (time() - (intval($config['load_online_time']) * 60)); + + $sql = 'SELECT s.session_user_id, s.session_ip, s.session_viewonline + FROM ' . SESSIONS_TABLE . ' s + WHERE s.session_time >= ' . ($time - ((int) ($time % 30))) . + $reading_sql . + ' AND s.session_user_id <> ' . ANONYMOUS; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + // Skip multiple sessions for one user + if (!isset($online_users['online_users'][$row['session_user_id']])) + { + $online_users['online_users'][$row['session_user_id']] = (int) $row['session_user_id']; + if ($row['session_viewonline']) + { + $online_users['visible_online']++; + } + else + { + $online_users['hidden_users'][$row['session_user_id']] = (int) $row['session_user_id']; + $online_users['hidden_online']++; + } + } + } + $online_users['total_online'] = $online_users['guests_online'] + $online_users['visible_online'] + $online_users['hidden_online']; + $db->sql_freeresult($result); + + return $online_users; +} + +/** +* Uses the result of obtain_users_online to generate a localized, readable representation. +* @param mixed $online_users result of obtain_users_online - array with user_id lists for total, hidden and visible users, and statistics +* @param int $item_id Indicate that the data is limited to one item and not global +* @param string $item The name of the item which is stored in the session table as session_{$item}_id +* @return array An array containing the string for output to the template +*/ +function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum') +{ + global $config, $db, $user, $auth; + + $user_online_link = $online_userlist = ''; + // Need caps version of $item for language-strings + $item_caps = strtoupper($item); + + if (sizeof($online_users['online_users'])) + { + $sql = 'SELECT username, username_clean, user_id, user_type, user_allow_viewonline, user_colour + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $online_users['online_users']) . ' + ORDER BY username_clean ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + // User is logged in and therefore not a guest + if ($row['user_id'] != ANONYMOUS) + { + if (isset($online_users['hidden_users'][$row['user_id']])) + { + $row['username'] = '' . $row['username'] . ''; + } + + if (!isset($online_users['hidden_users'][$row['user_id']]) || $auth->acl_get('u_viewonline')) + { + $user_online_link = get_username_string(($row['user_type'] <> USER_IGNORE) ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']); + $online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link; + } + } + } + $db->sql_freeresult($result); + } + + if (!$online_userlist) + { + $online_userlist = $user->lang['NO_ONLINE_USERS']; + } + + if ($item_id === 0) + { + $online_userlist = $user->lang['REGISTERED_USERS'] . ' ' . $online_userlist; + } + else if ($config['load_online_guests']) + { + $online_userlist = $user->lang('BROWSING_' . $item_caps . '_GUESTS', $online_users['guests_online'], $online_userlist); + } + else + { + $online_userlist = sprintf($user->lang['BROWSING_' . $item_caps], $online_userlist); + } + // Build online listing + $visible_online = $user->lang('REG_USERS_TOTAL', (int) $online_users['visible_online']); + $hidden_online = $user->lang('HIDDEN_USERS_TOTAL', (int) $online_users['hidden_online']); + + if ($config['load_online_guests']) + { + $guests_online = $user->lang('GUEST_USERS_TOTAL', (int) $online_users['guests_online']); + $l_online_users = $user->lang('ONLINE_USERS_TOTAL_GUESTS', (int) $online_users['total_online'], $visible_online, $hidden_online, $guests_online); + } + else + { + $l_online_users = $user->lang('ONLINE_USERS_TOTAL', (int) $online_users['total_online'], $visible_online, $hidden_online); + } + + return array( + 'online_userlist' => $online_userlist, + 'l_online_users' => $l_online_users, + ); +} + +/** +* Get option bitfield from custom data +* +* @param int $bit The bit/value to get +* @param int $data Current bitfield to check +* @return bool Returns true if value of constant is set in bitfield, else false +*/ +function phpbb_optionget($bit, $data) +{ + return ($data & 1 << (int) $bit) ? true : false; +} + +/** +* Set option bitfield +* +* @param int $bit The bit/value to set/unset +* @param bool $set True if option should be set, false if option should be unset. +* @param int $data Current bitfield to change +* +* @return int The new bitfield +*/ +function phpbb_optionset($bit, $set, $data) +{ + if ($set && !($data & 1 << $bit)) + { + $data += 1 << $bit; + } + else if (!$set && ($data & 1 << $bit)) + { + $data -= 1 << $bit; + } + + return $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. +* +* @return null +*/ +function phpbb_http_login($param) +{ + global $auth, $user, $request; + global $config; + + $param_defaults = array( + 'auth_message' => '', + + 'autologin' => false, + 'viewonline' => true, + 'admin' => false, + ); + + // Overwrite default values with passed values + $param = array_merge($param_defaults, $param); + + // User is already logged in + // We will not overwrite his session + if (!empty($user->data['is_registered'])) + { + return; + } + + // $_SERVER keys to check + $username_keys = array( + 'PHP_AUTH_USER', + 'Authorization', + 'REMOTE_USER', 'REDIRECT_REMOTE_USER', + 'HTTP_AUTHORIZATION', 'REDIRECT_HTTP_AUTHORIZATION', + 'REMOTE_AUTHORIZATION', 'REDIRECT_REMOTE_AUTHORIZATION', + 'AUTH_USER', + ); + + $password_keys = array( + 'PHP_AUTH_PW', + 'REMOTE_PASSWORD', + 'AUTH_PASSWORD', + ); + + $username = null; + foreach ($username_keys as $k) + { + if ($request->is_set($k, \phpbb\request\request_interface::SERVER)) + { + $username = htmlspecialchars_decode($request->server($k)); + break; + } + } + + $password = null; + foreach ($password_keys as $k) + { + if ($request->is_set($k, \phpbb\request\request_interface::SERVER)) + { + $password = htmlspecialchars_decode($request->server($k)); + break; + } + } + + // Decode encoded information (IIS, CGI, FastCGI etc.) + if (!is_null($username) && is_null($password) && strpos($username, 'Basic ') === 0) + { + list($username, $password) = explode(':', base64_decode(substr($username, 6)), 2); + } + + if (!is_null($username) && !is_null($password)) + { + set_var($username, $username, 'string', true); + set_var($password, $password, 'string', true); + + $auth_result = $auth->login($username, $password, $param['autologin'], $param['viewonline'], $param['admin']); + + if ($auth_result['status'] == LOGIN_SUCCESS) + { + return; + } + else if ($auth_result['status'] == LOGIN_ERROR_ATTEMPTS) + { + send_status_line(401, 'Unauthorized'); + + trigger_error('NOT_AUTHORISED'); + } + } + + // Prepend sitename to auth_message + $param['auth_message'] = ($param['auth_message'] === '') ? $config['sitename'] : $config['sitename'] . ' - ' . $param['auth_message']; + + // We should probably filter out non-ASCII characters - RFC2616 + $param['auth_message'] = preg_replace('/[\x80-\xFF]/', '?', $param['auth_message']); + + header('WWW-Authenticate: Basic realm="' . $param['auth_message'] . '"'); + send_status_line(401, 'Unauthorized'); + + trigger_error('NOT_AUTHORISED'); +} + +/** +* Escapes and quotes a string for use as an HTML/XML attribute value. +* +* This is a port of Python xml.sax.saxutils quoteattr. +* +* The function will attempt to choose a quote character in such a way as to +* avoid escaping quotes in the string. If this is not possible the string will +* be wrapped in double quotes and double quotes will be escaped. +* +* @param string $data The string to be escaped +* @param array $entities Associative array of additional entities to be escaped +* @return string Escaped and quoted string +*/ +function phpbb_quoteattr($data, $entities = null) +{ + $data = str_replace('&', '&', $data); + $data = str_replace('>', '>', $data); + $data = str_replace('<', '<', $data); + + $data = str_replace("\n", ' ', $data); + $data = str_replace("\r", ' ', $data); + $data = str_replace("\t", ' ', $data); + + if (!empty($entities)) + { + $data = str_replace(array_keys($entities), array_values($entities), $data); + } + + if (strpos($data, '"') !== false) + { + if (strpos($data, "'") !== false) + { + $data = '"' . str_replace('"', '"', $data) . '"'; + } + else + { + $data = "'" . $data . "'"; + } + } + else + { + $data = '"' . $data . '"'; + } + + return $data; +} + +/** +* Converts query string (GET) parameters in request into hidden fields. +* +* Useful for forwarding GET parameters when submitting forms with GET method. +* +* It is possible to omit some of the GET parameters, which is useful if +* they are specified in the form being submitted. +* +* sid is always omitted. +* +* @param \phpbb\request\request $request Request object +* @param array $exclude A list of variable names that should not be forwarded +* @return string HTML with hidden fields +*/ +function phpbb_build_hidden_fields_for_query_params($request, $exclude = null) +{ + $names = $request->variable_names(\phpbb\request\request_interface::GET); + $hidden = ''; + foreach ($names as $name) + { + // Sessions are dealt with elsewhere, omit sid always + if ($name == 'sid') + { + continue; + } + + // Omit any additional parameters requested + if (!empty($exclude) && in_array($name, $exclude)) + { + continue; + } + + $escaped_name = phpbb_quoteattr($name); + + // Note: we might retrieve the variable from POST or cookies + // here. To avoid exposing cookies, skip variables that are + // overwritten somewhere other than GET entirely. + $value = $request->variable($name, '', true); + $get_value = $request->variable($name, '', true, \phpbb\request\request_interface::GET); + if ($value === $get_value) + { + $escaped_value = phpbb_quoteattr($value); + $hidden .= ""; + } + } + return $hidden; +} + +/** +* Get user avatar +* +* @param array $user_row Row from the users table +* @param string $alt Optional language string for alt tag within image, can be a language key or text +* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP +* +* @return string Avatar html +*/ +function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config = false) +{ + $row = \phpbb\avatar\manager::clean_row($user_row, 'user'); + return phpbb_get_avatar($row, $alt, $ignore_config); +} + +/** +* Get group avatar +* +* @param array $group_row Row from the groups table +* @param string $alt Optional language string for alt tag within image, can be a language key or text +* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP +* +* @return string Avatar html +*/ +function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config = false) +{ + $row = \phpbb\avatar\manager::clean_row($user_row, 'group'); + return phpbb_get_avatar($row, $alt, $ignore_config); +} + +/** +* Get avatar +* +* @param array $row Row cleaned by \phpbb\avatar\manager::clean_row +* @param string $alt Optional language string for alt tag within image, can be a language key or text +* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP +* +* @return string Avatar html +*/ +function phpbb_get_avatar($row, $alt, $ignore_config = false) +{ + global $user, $config, $cache, $phpbb_root_path, $phpEx; + global $request; + global $phpbb_container; + + if (!$config['allow_avatar'] && !$ignore_config) + { + return ''; + } + + $avatar_data = array( + 'src' => $row['avatar'], + 'width' => $row['avatar_width'], + 'height' => $row['avatar_height'], + ); + + $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); + $driver = $phpbb_avatar_manager->get_driver($row['avatar_type'], $ignore_config); + $html = ''; + + if ($driver) + { + $html = $driver->get_custom_html($user, $row, $alt); + if (!empty($html)) + { + return $html; + } + + $avatar_data = $driver->get_data($row, $ignore_config); + } + else + { + $avatar_data['src'] = ''; + } + + if (!empty($avatar_data['src'])) + { + $html = ''; + } + + return $html; +} + +/** +* Generate page header +*/ +function page_header($page_title = '', $display_online_list = false, $item_id = 0, $item = 'forum') +{ + global $db, $config, $template, $SID, $_SID, $_EXTRA_URL, $user, $auth, $phpEx, $phpbb_root_path; + global $phpbb_dispatcher, $request, $phpbb_container, $phpbb_admin_path; + + if (defined('HEADER_INC')) + { + return; + } + + define('HEADER_INC', true); + + // A listener can set this variable to `true` when it overrides this function + $page_header_override = false; + + /** + * Execute code and/or overwrite page_header() + * + * @event core.page_header + * @var string page_title Page title + * @var bool display_online_list Do we display online users list + * @var string item Restrict online users to a certain + * session item, e.g. forum for + * session_forum_id + * @var int item_id Restrict online users to item id + * @var bool page_header_override Shall we return instead of running + * the rest of page_header() + * @since 3.1.0-a1 + */ + $vars = array('page_title', 'display_online_list', 'item_id', 'item', 'page_header_override'); + extract($phpbb_dispatcher->trigger_event('core.page_header', compact($vars))); + + if ($page_header_override) + { + return; + } + + // gzip_compression + if ($config['gzip_compress']) + { + // to avoid partially compressed output resulting in blank pages in + // the browser or error messages, compression is disabled in a few cases: + // + // 1) if headers have already been sent, this indicates plaintext output + // has been started so further content must not be compressed + // 2) the length of the current output buffer is non-zero. This means + // there is already some uncompressed content in this output buffer + // so further output must not be compressed + // 3) if more than one level of output buffering is used because we + // cannot test all output buffer level content lengths. One level + // could be caused by php.ini output_buffering. Anything + // beyond that is manual, so the code wrapping phpBB in output buffering + // can easily compress the output itself. + // + if (@extension_loaded('zlib') && !headers_sent() && ob_get_level() <= 1 && ob_get_length() == 0) + { + ob_start('ob_gzhandler'); + } + } + + // Generate logged in/logged out status + if ($user->data['user_id'] != ANONYMOUS) + { + $u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout', true, $user->session_id); + $l_login_logout = $user->lang['LOGOUT']; + } + else + { + $u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'); + $l_login_logout = $user->lang['LOGIN']; + } + + // Last visit date/time + $s_last_visit = ($user->data['user_id'] != ANONYMOUS) ? $user->format_date($user->data['session_last_visit']) : ''; + + // Get users online list ... if required + $l_online_users = $online_userlist = $l_online_record = $l_online_time = ''; + + if ($config['load_online'] && $config['load_online_time'] && $display_online_list) + { + /** + * Load online data: + * For obtaining another session column use $item and $item_id in the function-parameter, whereby the column is session_{$item}_id. + */ + $item_id = max($item_id, 0); + + $online_users = obtain_users_online($item_id, $item); + $user_online_strings = obtain_users_online_string($online_users, $item_id, $item); + + $l_online_users = $user_online_strings['l_online_users']; + $online_userlist = $user_online_strings['online_userlist']; + $total_online_users = $online_users['total_online']; + + if ($total_online_users > $config['record_online_users']) + { + set_config('record_online_users', $total_online_users, true); + set_config('record_online_date', time(), true); + } + + $l_online_record = $user->lang('RECORD_ONLINE_USERS', (int) $config['record_online_users'], $user->format_date($config['record_online_date'], false, true)); + + $l_online_time = $user->lang('VIEW_ONLINE_TIMES', (int) $config['load_online_time']); + } + + $s_privmsg_new = false; + + // Check for new private messages if user is logged in + if (!empty($user->data['is_registered'])) + { + if ($user->data['user_new_privmsg']) + { + if (!$user->data['user_last_privmsg'] || $user->data['user_last_privmsg'] > $user->data['session_last_visit']) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_last_privmsg = ' . $user->data['session_last_visit'] . ' + WHERE user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + + $s_privmsg_new = true; + } + else + { + $s_privmsg_new = false; + } + } + else + { + $s_privmsg_new = false; + } + } + + $forum_id = request_var('f', 0); + $topic_id = request_var('t', 0); + + $s_feed_news = false; + + // Get option for news + if ($config['feed_enable']) + { + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_bit_and('forum_options', FORUM_OPTION_FEED_NEWS, '<> 0'); + $result = $db->sql_query_limit($sql, 1, 0, 600); + $s_feed_news = (int) $db->sql_fetchfield('forum_id'); + $db->sql_freeresult($result); + } + + // Determine board url - we may need it later + $board_url = generate_board_url() . '/'; + // 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. + $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; + + // Send a proper content-language to the output + $user_lang = $user->lang['USER_LANG']; + if (strpos($user_lang, '-x-') !== false) + { + $user_lang = substr($user_lang, 0, strpos($user_lang, '-x-')); + } + + $s_search_hidden_fields = array(); + if ($_SID) + { + $s_search_hidden_fields['sid'] = $_SID; + } + + if (!empty($_EXTRA_URL)) + { + foreach ($_EXTRA_URL as $url_param) + { + $url_param = explode('=', $url_param, 2); + $s_search_hidden_fields[$url_param[0]] = $url_param[1]; + } + } + + $dt = $user->create_datetime(); + $timezone_offset = $user->lang(array('timezones', 'UTC_OFFSET'), phpbb_format_timezone_offset($dt->getOffset())); + $timezone_name = $user->timezone->getName(); + if (isset($user->lang['timezones'][$timezone_name])) + { + $timezone_name = $user->lang['timezones'][$timezone_name]; + } + + // Output the notifications + $notifications = false; + if ($config['load_notifications'] && $user->data['user_id'] != ANONYMOUS && $user->data['user_type'] != USER_IGNORE) + { + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + $notifications = $phpbb_notifications->load_notifications(array( + 'all_unread' => true, + 'limit' => 5, + )); + + foreach ($notifications['notifications'] as $notification) + { + $template->assign_block_vars('notifications', $notification->prepare_for_display()); + } + } + + $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. + $template->assign_vars(array( + 'SITENAME' => $config['sitename'], + 'SITE_DESCRIPTION' => $config['site_desc'], + 'PAGE_TITLE' => $page_title, + 'SCRIPT_NAME' => str_replace('.' . $phpEx, '', $user->page['page_name']), + 'LAST_VISIT_DATE' => sprintf($user->lang['YOU_LAST_VISIT'], $s_last_visit), + 'LAST_VISIT_YOU' => $s_last_visit, + 'CURRENT_TIME' => sprintf($user->lang['CURRENT_TIME'], $user->format_date(time(), false, true)), + 'TOTAL_USERS_ONLINE' => $l_online_users, + 'LOGGED_IN_USER_LIST' => $online_userlist, + 'RECORD_USERS' => $l_online_record, + + 'PRIVATE_MESSAGE_COUNT' => (!empty($user->data['user_unread_privmsg'])) ? $user->data['user_unread_privmsg'] : 0, + 'CURRENT_USER_AVATAR' => phpbb_get_user_avatar($user->data), + 'CURRENT_USERNAME_SIMPLE' => get_username_string('no_profile', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), + 'CURRENT_USERNAME_FULL' => get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), + 'UNREAD_NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '', + 'NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '', + '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&mode=notification_list&mark=all&token=' . $notification_mark_hash), + 'U_NOTIFICATION_SETTINGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_notifications&mode=notification_options'), + 'S_NOTIFICATIONS_DISPLAY' => $config['load_notifications'], + + 'S_USER_NEW_PRIVMSG' => $user->data['user_new_privmsg'], + 'S_USER_UNREAD_PRIVMSG' => $user->data['user_unread_privmsg'], + 'S_USER_NEW' => $user->data['user_new'], + + 'SID' => $SID, + '_SID' => $_SID, + 'SESSION_ID' => $user->session_id, + 'ROOT_PATH' => $web_path, + 'BOARD_URL' => $board_url, + + 'L_LOGIN_LOGOUT' => $l_login_logout, + 'L_INDEX' => ($config['board_index_text'] !== '') ? $config['board_index_text'] : $user->lang['FORUM_INDEX'], + 'L_SITE_HOME' => ($config['site_home_text'] !== '') ? $config['site_home_text'] : $user->lang['HOME'], + 'L_ONLINE_EXPLAIN' => $l_online_time, + + 'U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'), + 'U_RETURN_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'), + 'U_MEMBERLIST' => append_sid("{$phpbb_root_path}memberlist.$phpEx"), + 'U_VIEWONLINE' => ($auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid("{$phpbb_root_path}viewonline.$phpEx") : '', + 'U_LOGIN_LOGOUT' => $u_login_logout, + 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"), + 'U_SEARCH' => append_sid("{$phpbb_root_path}search.$phpEx"), + 'U_SITE_HOME' => $config['site_home_url'], + 'U_REGISTER' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'), + '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_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'), + 'U_SEARCH_UNREAD' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unreadposts'), + 'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'), + 'U_DELETE_COOKIES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies'), + 'U_CONTACT_US' => ($config['contact_admin_form_enable'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin') : '', + 'U_TEAM' => ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=team'), + 'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'), + 'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'), + '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", + + 'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false, + 'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false, + 'S_BOARD_DISABLED' => ($config['board_disable']) ? true : false, + 'S_REGISTERED_USER' => (!empty($user->data['is_registered'])) ? true : false, + 'S_IS_BOT' => (!empty($user->data['is_bot'])) ? true : false, + 'S_USER_LANG' => $user_lang, + 'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'], + 'S_USERNAME' => $user->data['username'], + 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], + 'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right', + 'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left', + 'S_CONTENT_ENCODING' => 'UTF-8', + 'S_TIMEZONE' => sprintf($user->lang['ALL_TIMES'], $timezone_offset, $timezone_name), + 'S_DISPLAY_ONLINE_LIST' => ($l_online_time) ? 1 : 0, + 'S_DISPLAY_SEARCH' => (!$config['load_search']) ? 0 : (isset($auth) ? ($auth->acl_get('u_search') && $auth->acl_getf_global('f_search')) : 1), + 'S_DISPLAY_PM' => ($config['allow_privmsg'] && !empty($user->data['is_registered']) && ($auth->acl_get('u_readpm') || $auth->acl_get('u_sendpm'))) ? true : false, + 'S_DISPLAY_MEMBERLIST' => (isset($auth)) ? $auth->acl_get('u_viewprofile') : 0, + 'S_NEW_PM' => ($s_privmsg_new) ? 1 : 0, + 'S_REGISTER_ENABLED' => ($config['require_activation'] != USER_ACTIVATION_DISABLE) ? true : false, + 'S_FORUM_ID' => $forum_id, + 'S_TOPIC_ID' => $topic_id, + + 'S_LOGIN_ACTION' => ((!defined('ADMIN_START')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("{$phpbb_admin_path}index.$phpEx", false, true, $user->session_id)), + 'S_LOGIN_REDIRECT' => build_hidden_fields(array('redirect' => $phpbb_path_helper->remove_web_root_path(build_url()))), + + 'S_ENABLE_FEEDS' => ($config['feed_enable']) ? true : false, + 'S_ENABLE_FEEDS_OVERALL' => ($config['feed_overall']) ? true : false, + 'S_ENABLE_FEEDS_FORUMS' => ($config['feed_overall_forums']) ? true : false, + 'S_ENABLE_FEEDS_TOPICS' => ($config['feed_topics_new']) ? true : false, + 'S_ENABLE_FEEDS_TOPICS_ACTIVE' => ($config['feed_topics_active']) ? true : false, + 'S_ENABLE_FEEDS_NEWS' => ($s_feed_news) ? true : false, + + 'S_LOAD_UNREADS' => ($config['load_unreads_search'] && ($config['load_anon_lastread'] || $user->data['is_registered'])) ? true : false, + + 'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields), + + 'T_ASSETS_VERSION' => $config['assets_version'], + 'T_ASSETS_PATH' => "{$web_path}assets", + 'T_THEME_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme', + 'T_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/template', + 'T_SUPER_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/template', + 'T_IMAGES_PATH' => "{$web_path}images/", + 'T_SMILIES_PATH' => "{$web_path}{$config['smilies_path']}/", + 'T_AVATAR_PATH' => "{$web_path}{$config['avatar_path']}/", + 'T_AVATAR_GALLERY_PATH' => "{$web_path}{$config['avatar_gallery_path']}/", + 'T_ICONS_PATH' => "{$web_path}{$config['icons_path']}/", + 'T_RANKS_PATH' => "{$web_path}{$config['ranks_path']}/", + 'T_UPLOAD_PATH' => "{$web_path}{$config['upload_path']}/", + 'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'], + 'T_STYLESHEET_LANG_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'], + 'T_JQUERY_LINK' => !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery.min.js?assets_version=" . $config['assets_version'], + 'S_ALLOW_CDN' => !empty($config['allow_cdn']), + + 'T_THEME_NAME' => rawurlencode($user->style['style_path']), + 'T_THEME_LANG_NAME' => $user->data['user_lang'], + 'T_TEMPLATE_NAME' => $user->style['style_path'], + 'T_SUPER_TEMPLATE_NAME' => rawurlencode((isset($user->style['style_parent_tree']) && $user->style['style_parent_tree']) ? $user->style['style_parent_tree'] : $user->style['style_path']), + 'T_IMAGES' => 'images', + 'T_SMILIES' => $config['smilies_path'], + 'T_AVATAR' => $config['avatar_path'], + 'T_AVATAR_GALLERY' => $config['avatar_gallery_path'], + 'T_ICONS' => $config['icons_path'], + 'T_RANKS' => $config['ranks_path'], + 'T_UPLOAD' => $config['upload_path'], + + 'SITE_LOGO_IMG' => $user->img('site_logo'), + )); + + // An array of http headers that phpbb will set. The following event may override these. + $http_headers = array( + // application/xhtml+xml not used because of IE + 'Content-type' => 'text/html; charset=UTF-8', + 'Cache-Control' => 'private, no-cache="set-cookie"', + 'Expires' => gmdate('D, d M Y H:i:s', time()) . ' GMT', + ); + if (!empty($user->data['is_bot'])) + { + // Let reverse proxies know we detected a bot. + $http_headers['X-PHPBB-IS-BOT'] = 'yes'; + } + + /** + * Execute code and/or overwrite _common_ template variables after they have been assigned. + * + * @event core.page_header_after + * @var string page_title Page title + * @var bool display_online_list Do we display online users list + * @var string item Restrict online users to a certain + * session item, e.g. forum for + * session_forum_id + * @var int item_id Restrict online users to item id + * @var array http_headers HTTP headers that should be set by phpbb + * + * @since 3.1.0-b3 + */ + $vars = array('page_title', 'display_online_list', 'item_id', 'item', 'http_headers'); + extract($phpbb_dispatcher->trigger_event('core.page_header_after', compact($vars))); + + foreach ($http_headers as $hname => $hval) + { + header((string) $hname . ': ' . (string) $hval); + } + + return; +} + +/** +* Check and display the SQL report if requested. +* +* @param \phpbb\request\request_interface $request Request object +* @param \phpbb\auth\auth $auth Auth object +* @param \phpbb\db\driver\driver_interface $db Database connection +*/ +function phpbb_check_and_display_sql_report(\phpbb\request\request_interface $request, \phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db) +{ + if ($request->variable('explain', false) && $auth->acl_get('a_') && defined('DEBUG')) + { + $db->sql_report('display'); + } +} + +/** +* Generate the debug output string +* +* @param \phpbb\db\driver\driver_interface $db Database connection +* @param \phpbb\config\config $config Config object +* @param \phpbb\auth\auth $auth Auth object +* @param \phpbb\user $user User object +* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher +* @return string +*/ +function phpbb_generate_debug_output(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\auth\auth $auth, \phpbb\user $user, \phpbb\event\dispatcher_interface $phpbb_dispatcher) +{ + $debug_info = array(); + + // Output page creation time + if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + if (isset($GLOBALS['starttime'])) + { + $totaltime = microtime(true) - $GLOBALS['starttime']; + $debug_info[] = sprintf('Time: %.3fs', $db->get_sql_time(), ($totaltime - $db->get_sql_time()), $totaltime); + } + + $debug_info[] = sprintf('Queries: %d', $db->sql_num_queries(true), $db->sql_num_queries()); + + $memory_usage = memory_get_peak_usage(); + if ($memory_usage) + { + $memory_usage = get_formatted_filesize($memory_usage); + + $debug_info[] = 'Peak Memory Usage: ' . $memory_usage; + } + } + + if (defined('DEBUG')) + { + $debug_info[] = 'GZIP: ' . (($config['gzip_compress'] && @extension_loaded('zlib')) ? 'On' : 'Off'); + + if ($user->load) + { + $debug_info[] = 'Load: ' . $user->load; + } + + if ($auth->acl_get('a_')) + { + $debug_info[] = 'SQL Explain'; + } + } + + /** + * Modify debug output information + * + * @event core.phpbb_generate_debug_output + * @var array debug_info Array of strings with debug information + * + * @since 3.1.0-RC3 + */ + $vars = array('debug_info'); + extract($phpbb_dispatcher->trigger_event('core.phpbb_generate_debug_output', compact($vars))); + + return implode(' | ', $debug_info); +} + +/** +* Generate page footer +* +* @param bool $run_cron Whether or not to run the cron +* @param bool $display_template Whether or not to display the template +* @param bool $exit_handler Whether or not to run the exit_handler() +*/ +function page_footer($run_cron = true, $display_template = true, $exit_handler = true) +{ + global $db, $config, $template, $user, $auth, $cache, $starttime, $phpbb_root_path, $phpEx; + global $request, $phpbb_dispatcher, $phpbb_admin_path; + + // A listener can set this variable to `true` when it overrides this function + $page_footer_override = false; + + /** + * Execute code and/or overwrite page_footer() + * + * @event core.page_footer + * @var bool run_cron Shall we run cron tasks + * @var bool page_footer_override Shall we return instead of running + * the rest of page_footer() + * @since 3.1.0-a1 + */ + $vars = array('run_cron', 'page_footer_override'); + extract($phpbb_dispatcher->trigger_event('core.page_footer', compact($vars))); + + if ($page_footer_override) + { + return; + } + + phpbb_check_and_display_sql_report($request, $auth, $db); + + $template->assign_vars(array( + 'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user, $phpbb_dispatcher), + 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', + 'CREDIT_LINE' => $user->lang('POWERED_BY', 'phpBB® Forum Software © phpBB Limited'), + + 'U_ACP' => ($auth->acl_get('a_') && !empty($user->data['is_registered'])) ? append_sid("{$phpbb_admin_path}index.$phpEx", false, true, $user->session_id) : '') + ); + + // Call cron-type script + $call_cron = false; + if (!defined('IN_CRON') && !$config['use_system_cron'] && $run_cron && !$config['board_disable'] && !$user->data['is_bot'] && !$cache->get('_cron.lock_check')) + { + $call_cron = true; + $time_now = (!empty($user->time_now) && is_int($user->time_now)) ? $user->time_now : time(); + + // Any old lock present? + if (!empty($config['cron_lock'])) + { + $cron_time = explode(' ', $config['cron_lock']); + + // If 1 hour lock is present we do not call cron.php + if ($cron_time[0] + 3600 >= $time_now) + { + $call_cron = false; + } + } + } + + // Call cron job? + if ($call_cron) + { + global $phpbb_container; + $cron = $phpbb_container->get('cron.manager'); + $task = $cron->find_one_ready_task(); + + if ($task) + { + $url = $task->get_url(); + $template->assign_var('RUN_CRON_TASK', 'cron'); + } + else + { + $cache->put('_cron.lock_check', true, 60); + } + } + + /** + * Execute code and/or modify output before displaying the template. + * + * @event core.page_footer_after + * @var bool display_template Whether or not to display the template + * @var bool exit_handler Whether or not to run the exit_handler() + * + * @since 3.1.0-RC5 + */ + $vars = array('display_template', 'exit_handler'); + extract($phpbb_dispatcher->trigger_event('core.page_footer_after', compact($vars))); + + if ($display_template) + { + $template->display('body'); + } + + garbage_collection(); + + if ($exit_handler) + { + exit_handler(); + } +} + +/** +* Closing the cache object and the database +* Cool function name, eh? We might want to add operations to it later +*/ +function garbage_collection() +{ + global $cache, $db; + global $phpbb_dispatcher; + + if (!empty($phpbb_dispatcher)) + { + /** + * Unload some objects, to free some memory, before we finish our task + * + * @event core.garbage_collection + * @since 3.1.0-a1 + */ + $phpbb_dispatcher->dispatch('core.garbage_collection'); + } + + // Unload cache, must be done before the DB connection if closed + if (!empty($cache)) + { + $cache->unload(); + } + + // Close our DB connection. + if (!empty($db)) + { + $db->sql_close(); + } +} + +/** +* Handler for exit calls in phpBB. +* This function supports hooks. +* +* Note: This function is called after the template has been outputted. +*/ +function exit_handler() +{ + global $phpbb_hook, $config; + + if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__)) + { + if ($phpbb_hook->hook_return(__FUNCTION__)) + { + return $phpbb_hook->hook_return_result(__FUNCTION__); + } + } + + // As a pre-caution... some setups display a blank page if the flush() is not there. + (ob_get_level() > 0) ? @ob_flush() : @flush(); + + exit; +} + +/** +* Handler for init calls in phpBB. This function is called in \phpbb\user::setup(); +* This function supports hooks. +*/ +function phpbb_user_session_handler() +{ + global $phpbb_hook; + + if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__)) + { + if ($phpbb_hook->hook_return(__FUNCTION__)) + { + return $phpbb_hook->hook_return_result(__FUNCTION__); + } + } + + return; +} + +/** +* 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. +* +* @return int|float Integer $input if $input fits integer, +* float $input otherwise. +*/ +function phpbb_to_numeric($input) +{ + return ($input > PHP_INT_MAX) ? (float) $input : (int) $input; +} + +/** +* Get the board contact details (e.g. for emails) +* +* @param \phpbb\config\config $config +* @param string $phpEx +* @return string +*/ +function phpbb_get_board_contact(\phpbb\config\config $config, $phpEx) +{ + if ($config['contact_admin_form_enable']) + { + return generate_board_url() . '/memberlist.' . $phpEx . '?mode=contactadmin'; + } + else + { + return $config['board_contact']; + } +} + +/** +* Get a clickable board contact details link +* +* @param \phpbb\config\config $config +* @param string $phpbb_root_path +* @param string $phpEx +* @return string +*/ +function phpbb_get_board_contact_link(\phpbb\config\config $config, $phpbb_root_path, $phpEx) +{ + if ($config['contact_admin_form_enable'] && $config['email_enable']) + { + return append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin'); + } + else + { + return 'mailto:' . htmlspecialchars($config['board_contact']); + } +} diff --git a/sources/phpBB/includes/functions_acp.php b/sources/phpBB/includes/functions_acp.php new file mode 100644 index 0000000..e30c6da --- /dev/null +++ b/sources/phpBB/includes/functions_acp.php @@ -0,0 +1,702 @@ + +* @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; +} + +/** +* Header for acp pages +*/ +function adm_page_header($page_title) +{ + global $config, $db, $user, $template; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID; + global $phpbb_dispatcher; + + if (defined('HEADER_INC')) + { + return; + } + + define('HEADER_INC', true); + + // A listener can set this variable to `true` when it overrides this function + $adm_page_header_override = false; + + /** + * Execute code and/or overwrite adm_page_header() + * + * @event core.adm_page_header + * @var string page_title Page title + * @var bool adm_page_header_override Shall we return instead of + * running the rest of adm_page_header() + * @since 3.1.0-a1 + */ + $vars = array('page_title', 'adm_page_header_override'); + extract($phpbb_dispatcher->trigger_event('core.adm_page_header', compact($vars))); + + if ($adm_page_header_override) + { + return; + } + + // gzip_compression + if ($config['gzip_compress']) + { + if (@extension_loaded('zlib') && !headers_sent()) + { + ob_start('ob_gzhandler'); + } + } + + $template->assign_vars(array( + 'PAGE_TITLE' => $page_title, + 'USERNAME' => $user->data['username'], + + 'SID' => $SID, + '_SID' => $_SID, + 'SESSION_ID' => $user->session_id, + 'ROOT_PATH' => $phpbb_root_path, + 'ADMIN_ROOT_PATH' => $phpbb_admin_path, + + 'U_LOGOUT' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout'), + 'U_ADM_LOGOUT' => append_sid("{$phpbb_admin_path}index.$phpEx", 'action=admlogout'), + 'U_ADM_INDEX' => append_sid("{$phpbb_admin_path}index.$phpEx"), + 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"), + + 'T_IMAGES_PATH' => "{$phpbb_root_path}images/", + 'T_SMILIES_PATH' => "{$phpbb_root_path}{$config['smilies_path']}/", + 'T_AVATAR_PATH' => "{$phpbb_root_path}{$config['avatar_path']}/", + 'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/", + 'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/", + 'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/", + 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/", + + 'T_ASSETS_VERSION' => $config['assets_version'], + + 'ICON_MOVE_UP' => '' . $user->lang['MOVE_UP'] . '', + 'ICON_MOVE_UP_DISABLED' => '' . $user->lang['MOVE_UP'] . '', + 'ICON_MOVE_DOWN' => '' . $user->lang['MOVE_DOWN'] . '', + 'ICON_MOVE_DOWN_DISABLED' => '' . $user->lang['MOVE_DOWN'] . '', + 'ICON_EDIT' => '' . $user->lang['EDIT'] . '', + 'ICON_EDIT_DISABLED' => '' . $user->lang['EDIT'] . '', + 'ICON_DELETE' => '' . $user->lang['DELETE'] . '', + 'ICON_DELETE_DISABLED' => '' . $user->lang['DELETE'] . '', + 'ICON_SYNC' => '' . $user->lang['RESYNC'] . '', + 'ICON_SYNC_DISABLED' => '' . $user->lang['RESYNC'] . '', + + 'S_USER_LANG' => $user->lang['USER_LANG'], + 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], + 'S_CONTENT_ENCODING' => 'UTF-8', + 'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right', + 'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left', + )); + + // An array of http headers that phpbb will set. The following event may override these. + $http_headers = array( + // application/xhtml+xml not used because of IE + 'Content-type' => 'text/html; charset=UTF-8', + 'Cache-Control' => 'private, no-cache="set-cookie"', + 'Expires' => gmdate('D, d M Y H:i:s', time()) . ' GMT', + ); + + /** + * Execute code and/or overwrite _common_ template variables after they have been assigned. + * + * @event core.adm_page_header_after + * @var string page_title Page title + * @var array http_headers HTTP headers that should be set by phpbb + * + * @since 3.1.0-RC3 + */ + $vars = array('page_title', 'http_headers'); + extract($phpbb_dispatcher->trigger_event('core.adm_page_header_after', compact($vars))); + + foreach ($http_headers as $hname => $hval) + { + header((string) $hname . ': ' . (string) $hval); + } + + return; +} + +/** +* Page footer for acp pages +*/ +function adm_page_footer($copyright_html = true) +{ + global $db, $config, $template, $user, $auth, $cache; + global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $request, $phpbb_dispatcher; + + // A listener can set this variable to `true` when it overrides this function + $adm_page_footer_override = false; + + /** + * Execute code and/or overwrite adm_page_footer() + * + * @event core.adm_page_footer + * @var bool copyright_html Shall we display the copyright? + * @var bool adm_page_footer_override Shall we return instead of + * running the rest of adm_page_footer() + * @since 3.1.0-a1 + */ + $vars = array('copyright_html', 'adm_page_footer_override'); + extract($phpbb_dispatcher->trigger_event('core.adm_page_footer', compact($vars))); + + if ($adm_page_footer_override) + { + return; + } + + phpbb_check_and_display_sql_report($request, $auth, $db); + + $template->assign_vars(array( + 'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user, $phpbb_dispatcher), + 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', + 'S_COPYRIGHT_HTML' => $copyright_html, + 'CREDIT_LINE' => $user->lang('POWERED_BY', 'phpBB® Forum Software © phpBB Limited'), + 'T_JQUERY_LINK' => !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$phpbb_root_path}assets/javascript/jquery.min.js", + 'S_ALLOW_CDN' => !empty($config['allow_cdn']), + 'VERSION' => $config['version']) + ); + + $template->display('body'); + + garbage_collection(); + exit_handler(); +} + +/** +* Generate back link for acp pages +*/ +function adm_back_link($u_action) +{ + global $user; + return '

« ' . $user->lang['BACK_TO_PREV'] . ''; +} + +/** +* Build select field options in acp pages +*/ +function build_select($option_ary, $option_default = false) +{ + global $user; + + $html = ''; + foreach ($option_ary as $value => $title) + { + $selected = ($option_default !== false && $value == $option_default) ? ' selected="selected"' : ''; + $html .= ''; + } + + return $html; +} + +/** +* Build radio fields in acp pages +*/ +function h_radio($name, $input_ary, $input_default = false, $id = false, $key = false, $separator = '') +{ + global $user; + + $html = ''; + $id_assigned = false; + foreach ($input_ary as $value => $title) + { + $selected = ($input_default !== false && $value == $input_default) ? ' checked="checked"' : ''; + $html .= '' . $separator; + $id_assigned = true; + } + + return $html; +} + +/** +* Build configuration template for acp configuration pages +*/ +function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) +{ + global $user, $module, $phpbb_dispatcher; + + $tpl = ''; + $name = 'config[' . $config_key . ']'; + + // Make sure there is no notice printed out for non-existent config options (we simply set them) + if (!isset($new[$config_key])) + { + $new[$config_key] = ''; + } + + switch ($tpl_type[0]) + { + case 'text': + case 'password': + case 'url': + case 'email': + case 'color': + case 'date': + case 'time': + case 'datetime': + case 'datetime-local': + case 'month': + case 'range': + case 'search': + case 'tel': + case 'week': + $size = (int) $tpl_type[1]; + $maxlength = (int) $tpl_type[2]; + + $tpl = ''; + break; + + case 'number': + $min = $max = $maxlength = ''; + $min = ( isset($tpl_type[1]) ) ? (int) $tpl_type[1] : false; + if ( isset($tpl_type[2]) ) + { + $max = (int) $tpl_type[2]; + $maxlength = strlen( (string) $max ); + } + + $tpl = ''; + break; + + case 'dimension': + $min = $max = $maxlength = $size = ''; + + $min = (int) $tpl_type[1]; + + if ( isset($tpl_type[2]) ) + { + $max = (int) $tpl_type[2]; + $size = $maxlength = strlen( (string) $max ); + } + + $tpl = ' x '; + break; + + case 'textarea': + $rows = (int) $tpl_type[1]; + $cols = (int) $tpl_type[2]; + + $tpl = ''; + break; + + case 'radio': + $key_yes = ($new[$config_key]) ? ' checked="checked"' : ''; + $key_no = (!$new[$config_key]) ? ' checked="checked"' : ''; + + $tpl_type_cond = explode('_', $tpl_type[1]); + $type_no = ($tpl_type_cond[0] == 'disabled' || $tpl_type_cond[0] == 'enabled') ? false : true; + + $tpl_no = ''; + $tpl_yes = ''; + + $tpl = ($tpl_type_cond[0] == 'yes' || $tpl_type_cond[0] == 'enabled') ? $tpl_yes . $tpl_no : $tpl_no . $tpl_yes; + break; + + case 'select': + case 'custom': + + $return = ''; + + if (isset($vars['method'])) + { + $call = array($module->module, $vars['method']); + } + else if (isset($vars['function'])) + { + $call = $vars['function']; + } + else + { + break; + } + + if (isset($vars['params'])) + { + $args = array(); + foreach ($vars['params'] as $value) + { + switch ($value) + { + case '{CONFIG_VALUE}': + $value = $new[$config_key]; + break; + + case '{KEY}': + $value = $key; + break; + } + + $args[] = $value; + } + } + else + { + $args = array($new[$config_key], $key); + } + + $return = call_user_func_array($call, $args); + + if ($tpl_type[0] == 'select') + { + $size = (isset($tpl_type[1])) ? (int) $tpl_type[1] : 1; + $data_toggle = (!empty($tpl_type[2])) ? ' data-togglable-settings="true"' : ''; + + $tpl = ''; + } + else + { + $tpl = $return; + } + + break; + + default: + break; + } + + if (isset($vars['append'])) + { + $tpl .= $vars['append']; + } + + /** + * Overwrite the html code we display for the config value + * + * @event core.build_config_template + * @var array tpl_type Config type array: + * 0 => data type + * 1 [optional] => string: size, int: minimum + * 2 [optional] => string: max. length, int: maximum + * @var string key Should be used for the id attribute in html + * @var array new Array with the config values we display + * @var string name Should be used for the name attribute + * @var array vars Array with the options for the config + * @var string tpl The resulting html code we display + * @since 3.1.0-a1 + */ + $vars = array('tpl_type', 'key', 'new', 'name', 'vars', 'tpl'); + extract($phpbb_dispatcher->trigger_event('core.build_config_template', compact($vars))); + + return $tpl; +} + +/** +* Going through a config array and validate values, writing errors to $error. The validation method accepts parameters separated by ':' for string and int. +* The first parameter defines the type to be used, the second the lower bound and the third the upper bound. Only the type is required. +*/ +function validate_config_vars($config_vars, &$cfg_array, &$error) +{ + global $phpbb_root_path, $user, $phpbb_dispatcher; + + $type = 0; + $min = 1; + $max = 2; + + foreach ($config_vars as $config_name => $config_definition) + { + if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) + { + continue; + } + + if (!isset($config_definition['validate'])) + { + continue; + } + + $validator = explode(':', $config_definition['validate']); + + // Validate a bit. ;) (0 = type, 1 = min, 2= max) + switch ($validator[$type]) + { + case 'string': + $length = utf8_strlen($cfg_array[$config_name]); + + // the column is a VARCHAR + $validator[$max] = (isset($validator[$max])) ? min(255, $validator[$max]) : 255; + + if (isset($validator[$min]) && $length < $validator[$min]) + { + $error[] = sprintf($user->lang['SETTING_TOO_SHORT'], $user->lang[$config_definition['lang']], $validator[$min]); + } + else if (isset($validator[$max]) && $length > $validator[2]) + { + $error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$config_definition['lang']], $validator[$max]); + } + break; + + case 'bool': + $cfg_array[$config_name] = ($cfg_array[$config_name]) ? 1 : 0; + break; + + case 'int': + $cfg_array[$config_name] = (int) $cfg_array[$config_name]; + + if (isset($validator[$min]) && $cfg_array[$config_name] < $validator[$min]) + { + $error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$config_definition['lang']], $validator[$min]); + } + else if (isset($validator[$max]) && $cfg_array[$config_name] > $validator[$max]) + { + $error[] = sprintf($user->lang['SETTING_TOO_BIG'], $user->lang[$config_definition['lang']], $validator[$max]); + } + + if (strpos($config_name, '_max') !== false) + { + // Min/max pairs of settings should ensure that min <= max + // Replace _max with _min to find the name of the minimum + // corresponding configuration variable + $min_name = str_replace('_max', '_min', $config_name); + + if (isset($cfg_array[$min_name]) && is_numeric($cfg_array[$min_name]) && $cfg_array[$config_name] < $cfg_array[$min_name]) + { + // A minimum value exists and the maximum value is less than it + $error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$config_definition['lang']], (int) $cfg_array[$min_name]); + } + } + break; + + case 'email': + if (!preg_match('/^' . get_preg_expression('email') . '$/i', $cfg_array[$config_name])) + { + $error[] = $user->lang['EMAIL_INVALID_EMAIL']; + } + break; + + // Absolute path + case 'script_path': + if (!$cfg_array[$config_name]) + { + break; + } + + $destination = str_replace('\\', '/', $cfg_array[$config_name]); + + if ($destination !== '/') + { + // Adjust destination path (no trailing slash) + if (substr($destination, -1, 1) == '/') + { + $destination = substr($destination, 0, -1); + } + + $destination = str_replace(array('../', './'), '', $destination); + + if ($destination[0] != '/') + { + $destination = '/' . $destination; + } + } + + $cfg_array[$config_name] = trim($destination); + + break; + + // Absolute path + case 'lang': + if (!$cfg_array[$config_name]) + { + break; + } + + $cfg_array[$config_name] = basename($cfg_array[$config_name]); + + if (!file_exists($phpbb_root_path . 'language/' . $cfg_array[$config_name] . '/')) + { + $error[] = $user->lang['WRONG_DATA_LANG']; + } + break; + + // Relative path (appended $phpbb_root_path) + case 'rpath': + case 'rwpath': + if (!$cfg_array[$config_name]) + { + break; + } + + $destination = $cfg_array[$config_name]; + + // Adjust destination path (no trailing slash) + if (substr($destination, -1, 1) == '/' || substr($destination, -1, 1) == '\\') + { + $destination = substr($destination, 0, -1); + } + + $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination); + if ($destination && ($destination[0] == '/' || $destination[0] == "\\")) + { + $destination = ''; + } + + $cfg_array[$config_name] = trim($destination); + + // Path being relative (still prefixed by phpbb_root_path), but with the ability to escape the root dir... + case 'path': + case 'wpath': + + if (!$cfg_array[$config_name]) + { + break; + } + + $cfg_array[$config_name] = trim($cfg_array[$config_name]); + + // Make sure no NUL byte is present... + if (strpos($cfg_array[$config_name], "\0") !== false || strpos($cfg_array[$config_name], '%00') !== false) + { + $cfg_array[$config_name] = ''; + break; + } + + if (!file_exists($phpbb_root_path . $cfg_array[$config_name])) + { + $error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]); + } + + if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_dir($phpbb_root_path . $cfg_array[$config_name])) + { + $error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]); + } + + // Check if the path is writable + if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath') + { + if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !phpbb_is_writable($phpbb_root_path . $cfg_array[$config_name])) + { + $error[] = sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]); + } + } + + break; + + default: + /** + * Validate a config value + * + * @event core.validate_config_variable + * @var array cfg_array Array with config values + * @var string config_name Name of the config we validate + * @var array config_definition Array with the options for + * this config + * @var array error Array of errors, the errors should + * be strings only, language keys are + * not replaced afterwards + * @since 3.1.0-a1 + */ + $vars = array('cfg_array', 'config_name', 'config_definition', 'error'); + extract($phpbb_dispatcher->trigger_event('core.validate_config_variable', compact($vars))); + break; + } + } + + return; +} + +/** +* Checks whatever or not a variable is OK for use in the Database +* param mixed $value_ary An array of the form array(array('lang' => ..., 'value' => ..., 'column_type' =>))' +* param mixed $error The error array +*/ +function validate_range($value_ary, &$error) +{ + global $user; + + $column_types = array( + 'BOOL' => array('php_type' => 'int', 'min' => 0, 'max' => 1), + 'USINT' => array('php_type' => 'int', 'min' => 0, 'max' => 65535), + 'UINT' => array('php_type' => 'int', 'min' => 0, 'max' => (int) 0x7fffffff), + // Do not use (int) 0x80000000 - it evaluates to different + // values on 32-bit and 64-bit systems. + // Apparently -2147483648 is a float on 32-bit systems, + // despite fitting in an int, thus explicit cast is needed. + 'INT' => array('php_type' => 'int', 'min' => (int) -2147483648, 'max' => (int) 0x7fffffff), + 'TINT' => array('php_type' => 'int', 'min' => -128, 'max' => 127), + + 'VCHAR' => array('php_type' => 'string', 'min' => 0, 'max' => 255), + ); + foreach ($value_ary as $value) + { + $column = explode(':', $value['column_type']); + $max = $min = 0; + $type = 0; + if (!isset($column_types[$column[0]])) + { + continue; + } + else + { + $type = $column_types[$column[0]]; + } + + switch ($type['php_type']) + { + case 'string' : + $max = (isset($column[1])) ? min($column[1],$type['max']) : $type['max']; + if (utf8_strlen($value['value']) > $max) + { + $error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$value['lang']], $max); + } + break; + + case 'int': + $min = (isset($column[1])) ? max($column[1],$type['min']) : $type['min']; + $max = (isset($column[2])) ? min($column[2],$type['max']) : $type['max']; + if ($value['value'] < $min) + { + $error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$value['lang']], $min); + } + else if ($value['value'] > $max) + { + $error[] = sprintf($user->lang['SETTING_TOO_BIG'], $user->lang[$value['lang']], $max); + } + break; + } + } +} + +/** +* Inserts new config display_vars into an exisiting display_vars array +* at the given position. +* +* @param array $display_vars An array of existing config display vars +* @param array $add_config_vars An array of new config display vars +* @param array $where Where to place the new config vars, +* before or after an exisiting config, as an array +* of the form: array('after' => 'config_name') or +* array('before' => 'config_name'). +* @return array The array of config display vars +*/ +function phpbb_insert_config_array($display_vars, $add_config_vars, $where) +{ + if (is_array($where) && array_key_exists(current($where), $display_vars)) + { + $position = array_search(current($where), array_keys($display_vars)) + ((key($where) == 'before') ? 0 : 1); + $display_vars = array_merge( + array_slice($display_vars, 0, $position), + $add_config_vars, + array_slice($display_vars, $position) + ); + } + + return $display_vars; +} diff --git a/sources/phpBB/includes/functions_admin.php b/sources/phpBB/includes/functions_admin.php new file mode 100644 index 0000000..b016659 --- /dev/null +++ b/sources/phpBB/includes/functions_admin.php @@ -0,0 +1,3144 @@ + +* @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; +} + +/** +* Recalculate Nested Sets +* +* @param int $new_id first left_id (should start with 1) +* @param string $pkey primary key-column (containing the id for the parent_id of the children) +* @param string $table constant or fullname of the table +* @param int $parent_id parent_id of the current set (default = 0) +* @param array $where contains strings to compare closer on the where statement (additional) +*/ +function recalc_nested_sets(&$new_id, $pkey, $table, $parent_id = 0, $where = array()) +{ + global $db; + + $sql = 'SELECT * + FROM ' . $table . ' + WHERE parent_id = ' . (int) $parent_id . + ((!empty($where)) ? ' AND ' . implode(' AND ', $where) : '') . ' + ORDER BY left_id ASC'; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + // First we update the left_id for this module + if ($row['left_id'] != $new_id) + { + $db->sql_query('UPDATE ' . $table . ' SET ' . $db->sql_build_array('UPDATE', array('left_id' => $new_id)) . " WHERE $pkey = {$row[$pkey]}"); + } + $new_id++; + + // Then we go through any children and update their left/right id's + recalc_nested_sets($new_id, $pkey, $table, $row[$pkey], $where); + + // Then we come back and update the right_id for this module + if ($row['right_id'] != $new_id) + { + $db->sql_query('UPDATE ' . $table . ' SET ' . $db->sql_build_array('UPDATE', array('right_id' => $new_id)) . " WHERE $pkey = {$row[$pkey]}"); + } + $new_id++; + } + $db->sql_freeresult($result); +} + +/** +* Simple version of jumpbox, just lists authed forums +*/ +function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl = false, $ignore_nonpost = false, $ignore_emptycat = true, $only_acl_post = false, $return_array = false) +{ + global $db, $user, $auth; + + // This query is identical to the jumpbox one + $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, forum_flags, forum_options, left_id, right_id + FROM ' . FORUMS_TABLE . ' + ORDER BY left_id ASC'; + $result = $db->sql_query($sql, 600); + + $right = 0; + $padding_store = array('0' => ''); + $padding = ''; + $forum_list = ($return_array) ? array() : ''; + + // Sometimes it could happen that forums will be displayed here not be displayed within the index page + // This is the result of forums not displayed at index, having list permissions and a parent of a forum with no permissions. + // If this happens, the padding could be "broken" + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['left_id'] < $right) + { + $padding .= '   '; + $padding_store[$row['parent_id']] = $padding; + } + else if ($row['left_id'] > $right + 1) + { + $padding = (isset($padding_store[$row['parent_id']])) ? $padding_store[$row['parent_id']] : ''; + } + + $right = $row['right_id']; + $disabled = false; + + if (!$ignore_acl && $auth->acl_gets(array('f_list', 'a_forum', 'a_forumadd', 'a_forumdel'), $row['forum_id'])) + { + if ($only_acl_post && !$auth->acl_get('f_post', $row['forum_id']) || (!$auth->acl_get('m_approve', $row['forum_id']) && !$auth->acl_get('f_noapprove', $row['forum_id']))) + { + $disabled = true; + } + } + else if (!$ignore_acl) + { + continue; + } + + if ( + ((is_array($ignore_id) && in_array($row['forum_id'], $ignore_id)) || $row['forum_id'] == $ignore_id) + || + // Non-postable forum with no subforums, don't display + ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id']) && $ignore_emptycat) + || + ($row['forum_type'] != FORUM_POST && $ignore_nonpost) + ) + { + $disabled = true; + } + + if ($return_array) + { + // Include some more information... + $selected = (is_array($select_id)) ? ((in_array($row['forum_id'], $select_id)) ? true : false) : (($row['forum_id'] == $select_id) ? true : false); + $forum_list[$row['forum_id']] = array_merge(array('padding' => $padding, 'selected' => ($selected && !$disabled), 'disabled' => $disabled), $row); + } + else + { + $selected = (is_array($select_id)) ? ((in_array($row['forum_id'], $select_id)) ? ' selected="selected"' : '') : (($row['forum_id'] == $select_id) ? ' selected="selected"' : ''); + $forum_list .= ''; + } + } + $db->sql_freeresult($result); + unset($padding_store); + + return $forum_list; +} + +/** +* Generate size select options +*/ +function size_select_options($size_compare) +{ + global $user; + + $size_types_text = array($user->lang['BYTES'], $user->lang['KIB'], $user->lang['MIB']); + $size_types = array('b', 'kb', 'mb'); + + $s_size_options = ''; + + for ($i = 0, $size = sizeof($size_types_text); $i < $size; $i++) + { + $selected = ($size_compare == $size_types[$i]) ? ' selected="selected"' : ''; + $s_size_options .= ''; + } + + return $s_size_options; +} + +/** +* Generate list of groups (option fields without select) +* +* @param int $group_id The default group id to mark as selected +* @param array $exclude_ids The group ids to exclude from the list, false (default) if you whish to exclude no id +* @param int $manage_founder If set to false (default) all groups are returned, if 0 only those groups returned not being managed by founders only, if 1 only those groups returned managed by founders only. +* +* @return string The list of options. +*/ +function group_select_options($group_id, $exclude_ids = false, $manage_founder = false) +{ + global $db, $user, $config; + + $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'" : ''; + $sql_founder = ($manage_founder !== false) ? (($exclude_sql || $sql_and) ? ' AND ' : ' WHERE ') . 'group_founder_manage = ' . (int) $manage_founder : ''; + + $sql = 'SELECT group_id, group_name, group_type + FROM ' . GROUPS_TABLE . " + $exclude_sql + $sql_and + $sql_founder + ORDER BY group_type DESC, group_name ASC"; + $result = $db->sql_query($sql); + + $s_group_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $selected = ($row['group_id'] == $group_id) ? ' selected="selected"' : ''; + $s_group_options .= '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; + } + $db->sql_freeresult($result); + + return $s_group_options; +} + +/** +* Obtain authed forums list +*/ +function get_forum_list($acl_list = 'f_list', $id_only = true, $postable_only = false, $no_cache = false) +{ + global $db, $auth; + static $forum_rows; + + if (!isset($forum_rows)) + { + // This query is identical to the jumpbox one + $expire_time = ($no_cache) ? 0 : 600; + + $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id + FROM ' . FORUMS_TABLE . ' + ORDER BY left_id ASC'; + $result = $db->sql_query($sql, $expire_time); + + $forum_rows = array(); + + $right = $padding = 0; + $padding_store = array('0' => 0); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['left_id'] < $right) + { + $padding++; + $padding_store[$row['parent_id']] = $padding; + } + else if ($row['left_id'] > $right + 1) + { + // Ok, if the $padding_store for this parent is empty there is something wrong. For now we will skip over it. + // @todo digging deep to find out "how" this can happen. + $padding = (isset($padding_store[$row['parent_id']])) ? $padding_store[$row['parent_id']] : $padding; + } + + $right = $row['right_id']; + $row['padding'] = $padding; + + $forum_rows[] = $row; + } + $db->sql_freeresult($result); + unset($padding_store); + } + + $rowset = array(); + foreach ($forum_rows as $row) + { + if ($postable_only && $row['forum_type'] != FORUM_POST) + { + continue; + } + + if ($acl_list == '' || ($acl_list != '' && $auth->acl_gets($acl_list, $row['forum_id']))) + { + $rowset[] = ($id_only) ? (int) $row['forum_id'] : $row; + } + } + + return $rowset; +} + +/** +* Get forum branch +*/ +function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $include_forum = true) +{ + global $db; + + switch ($type) + { + case 'parents': + $condition = 'f1.left_id BETWEEN f2.left_id AND f2.right_id'; + break; + + case 'children': + $condition = 'f2.left_id BETWEEN f1.left_id AND f1.right_id'; + break; + + default: + $condition = 'f2.left_id BETWEEN f1.left_id AND f1.right_id OR f1.left_id BETWEEN f2.left_id AND f2.right_id'; + break; + } + + $rows = array(); + + $sql = 'SELECT f2.* + FROM ' . FORUMS_TABLE . ' f1 + LEFT JOIN ' . FORUMS_TABLE . " f2 ON ($condition) + WHERE f1.forum_id = $forum_id + ORDER BY f2.left_id " . (($order == 'descending') ? 'ASC' : 'DESC'); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (!$include_forum && $row['forum_id'] == $forum_id) + { + continue; + } + + $rows[] = $row; + } + $db->sql_freeresult($result); + + return $rows; +} + +/** +* Copies permissions from one forum to others +* +* @param int $src_forum_id The source forum we want to copy permissions from +* @param array $dest_forum_ids The destination forum(s) we want to copy to +* @param bool $clear_dest_perms True if destination permissions should be deleted +* @param bool $add_log True if log entry should be added +* +* @return bool False on error +*/ +function copy_forum_permissions($src_forum_id, $dest_forum_ids, $clear_dest_perms = true, $add_log = true) +{ + global $db; + + // Only one forum id specified + if (!is_array($dest_forum_ids)) + { + $dest_forum_ids = array($dest_forum_ids); + } + + // Make sure forum ids are integers + $src_forum_id = (int) $src_forum_id; + $dest_forum_ids = array_map('intval', $dest_forum_ids); + + // No source forum or no destination forums specified + if (empty($src_forum_id) || empty($dest_forum_ids)) + { + return false; + } + + // Check if source forum exists + $sql = 'SELECT forum_name + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $src_forum_id; + $result = $db->sql_query($sql); + $src_forum_name = $db->sql_fetchfield('forum_name'); + $db->sql_freeresult($result); + + // Source forum doesn't exist + if (empty($src_forum_name)) + { + return false; + } + + // Check if destination forums exists + $sql = 'SELECT forum_id, forum_name + FROM ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $dest_forum_ids); + $result = $db->sql_query($sql); + + $dest_forum_ids = $dest_forum_names = array(); + while ($row = $db->sql_fetchrow($result)) + { + $dest_forum_ids[] = (int) $row['forum_id']; + $dest_forum_names[] = $row['forum_name']; + } + $db->sql_freeresult($result); + + // No destination forum exists + if (empty($dest_forum_ids)) + { + return false; + } + + // From the mysql documentation: + // Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear + // in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14. + // Due to this we stay on the safe side if we do the insertion "the manual way" + + // Rowsets we're going to insert + $users_sql_ary = $groups_sql_ary = array(); + + // Query acl users table for source forum data + $sql = 'SELECT user_id, auth_option_id, auth_role_id, auth_setting + FROM ' . ACL_USERS_TABLE . ' + WHERE forum_id = ' . $src_forum_id; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $row = array( + 'user_id' => (int) $row['user_id'], + 'auth_option_id' => (int) $row['auth_option_id'], + 'auth_role_id' => (int) $row['auth_role_id'], + 'auth_setting' => (int) $row['auth_setting'], + ); + + foreach ($dest_forum_ids as $dest_forum_id) + { + $users_sql_ary[] = $row + array('forum_id' => $dest_forum_id); + } + } + $db->sql_freeresult($result); + + // Query acl groups table for source forum data + $sql = 'SELECT group_id, auth_option_id, auth_role_id, auth_setting + FROM ' . ACL_GROUPS_TABLE . ' + WHERE forum_id = ' . $src_forum_id; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $row = array( + 'group_id' => (int) $row['group_id'], + 'auth_option_id' => (int) $row['auth_option_id'], + 'auth_role_id' => (int) $row['auth_role_id'], + 'auth_setting' => (int) $row['auth_setting'], + ); + + foreach ($dest_forum_ids as $dest_forum_id) + { + $groups_sql_ary[] = $row + array('forum_id' => $dest_forum_id); + } + } + $db->sql_freeresult($result); + + $db->sql_transaction('begin'); + + // Clear current permissions of destination forums + if ($clear_dest_perms) + { + $sql = 'DELETE FROM ' . ACL_USERS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $dest_forum_ids); + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $dest_forum_ids); + $db->sql_query($sql); + } + + $db->sql_multi_insert(ACL_USERS_TABLE, $users_sql_ary); + $db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary); + + if ($add_log) + { + add_log('admin', 'LOG_FORUM_COPIED_PERMISSIONS', $src_forum_name, implode(', ', $dest_forum_names)); + } + + $db->sql_transaction('commit'); + + return true; +} + +/** +* Get physical file listing +*/ +function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png') +{ + $matches = array($dir => array()); + + // Remove initial / if present + $rootdir = (substr($rootdir, 0, 1) == '/') ? substr($rootdir, 1) : $rootdir; + // Add closing / if not present + $rootdir = ($rootdir && substr($rootdir, -1) != '/') ? $rootdir . '/' : $rootdir; + + // Remove initial / if present + $dir = (substr($dir, 0, 1) == '/') ? substr($dir, 1) : $dir; + // Add closing / if not present + $dir = ($dir && substr($dir, -1) != '/') ? $dir . '/' : $dir; + + if (!is_dir($rootdir . $dir)) + { + return $matches; + } + + $dh = @opendir($rootdir . $dir); + + if (!$dh) + { + return $matches; + } + + while (($fname = readdir($dh)) !== false) + { + if (is_file("$rootdir$dir$fname")) + { + if (filesize("$rootdir$dir$fname") && preg_match('#\.' . $type . '$#i', $fname)) + { + $matches[$dir][] = $fname; + } + } + else if ($fname[0] != '.' && is_dir("$rootdir$dir$fname")) + { + $matches += filelist($rootdir, "$dir$fname", $type); + } + } + closedir($dh); + + return $matches; +} + +/** +* Move topic(s) +*/ +function move_topics($topic_ids, $forum_id, $auto_sync = true) +{ + global $db; + + if (empty($topic_ids)) + { + return; + } + + $forum_ids = array($forum_id); + + if (!is_array($topic_ids)) + { + $topic_ids = array($topic_ids); + } + + $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids) . ' + AND forum_id = ' . $forum_id; + $db->sql_query($sql); + + if ($auto_sync) + { + $sql = 'SELECT DISTINCT forum_id + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_ids); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_ids[] = $row['forum_id']; + } + $db->sql_freeresult($result); + } + + $table_ary = array(TOPICS_TABLE, POSTS_TABLE, LOG_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE); + foreach ($table_ary as $table) + { + $sql = "UPDATE $table + SET forum_id = $forum_id + WHERE " . $db->sql_in_set('topic_id', $topic_ids); + $db->sql_query($sql); + } + unset($table_ary); + + if ($auto_sync) + { + sync('forum', 'forum_id', $forum_ids, true, true); + unset($forum_ids); + } +} + +/** +* Move post(s) +*/ +function move_posts($post_ids, $topic_id, $auto_sync = true) +{ + global $db; + + if (!is_array($post_ids)) + { + $post_ids = array($post_ids); + } + + $forum_ids = array(); + $topic_ids = array($topic_id); + + $sql = 'SELECT DISTINCT topic_id, forum_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_id', $post_ids); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_ids[] = (int) $row['forum_id']; + $topic_ids[] = (int) $row['topic_id']; + } + $db->sql_freeresult($result); + + $sql = 'SELECT forum_id + FROM ' . TOPICS_TABLE . ' + WHERE topic_id = ' . $topic_id; + $result = $db->sql_query($sql); + $forum_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$forum_row) + { + trigger_error('NO_TOPIC'); + } + + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET forum_id = ' . (int) $forum_row['forum_id'] . ", topic_id = $topic_id + WHERE " . $db->sql_in_set('post_id', $post_ids); + $db->sql_query($sql); + + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . " + SET topic_id = $topic_id, in_message = 0 + WHERE " . $db->sql_in_set('post_msg_id', $post_ids); + $db->sql_query($sql); + + if ($auto_sync) + { + $forum_ids[] = (int) $forum_row['forum_id']; + + sync('topic_reported', 'topic_id', $topic_ids); + sync('topic_attachment', 'topic_id', $topic_ids); + sync('topic', 'topic_id', $topic_ids, true); + sync('forum', 'forum_id', $forum_ids, true, true); + } + + // Update posted information + update_posted_info($topic_ids); +} + +/** +* Remove topic(s) +*/ +function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_sync = true, $call_delete_posts = true) +{ + global $db, $config, $phpbb_container; + + $approved_topics = 0; + $forum_ids = $topic_ids = array(); + + if ($where_type === 'range') + { + $where_clause = $where_ids; + } + else + { + $where_ids = (is_array($where_ids)) ? array_unique($where_ids) : array($where_ids); + + if (!sizeof($where_ids)) + { + return array('topics' => 0, 'posts' => 0); + } + + $where_clause = $db->sql_in_set($where_type, $where_ids); + } + + // Making sure that delete_posts does not call delete_topics again... + $return = array( + 'posts' => ($call_delete_posts) ? delete_posts($where_type, $where_ids, false, true, $post_count_sync, false) : 0, + ); + + $sql = 'SELECT topic_id, forum_id, topic_visibility, topic_moved_id + FROM ' . TOPICS_TABLE . ' + WHERE ' . $where_clause; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_ids[] = $row['forum_id']; + $topic_ids[] = $row['topic_id']; + + if ($row['topic_visibility'] == ITEM_APPROVED && !$row['topic_moved_id']) + { + $approved_topics++; + } + } + $db->sql_freeresult($result); + + $return['topics'] = sizeof($topic_ids); + + if (!sizeof($topic_ids)) + { + return $return; + } + + $db->sql_transaction('begin'); + + $table_ary = array(BOOKMARKS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, POLL_VOTES_TABLE, POLL_OPTIONS_TABLE, TOPICS_WATCH_TABLE, TOPICS_TABLE); + + foreach ($table_ary as $table) + { + $sql = "DELETE FROM $table + WHERE " . $db->sql_in_set('topic_id', $topic_ids); + $db->sql_query($sql); + } + unset($table_ary); + + $moved_topic_ids = array(); + + // update the other forums + $sql = 'SELECT topic_id, forum_id + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_ids[] = $row['forum_id']; + $moved_topic_ids[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + if (sizeof($moved_topic_ids)) + { + $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $moved_topic_ids); + $db->sql_query($sql); + } + + $db->sql_transaction('commit'); + + if ($auto_sync) + { + sync('forum', 'forum_id', array_unique($forum_ids), true, true); + sync('topic_reported', $where_type, $where_ids); + } + + if ($approved_topics) + { + set_config_count('num_topics', $approved_topics * (-1), true); + } + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + $phpbb_notifications->delete_notifications(array( + 'notification.type.topic', + 'notification.type.approve_topic', + 'notification.type.topic_in_queue', + ), $topic_ids); + + return $return; +} + +/** +* Remove post(s) +*/ +function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = true, $post_count_sync = true, $call_delete_topics = true) +{ + global $db, $config, $phpbb_root_path, $phpEx, $auth, $user, $phpbb_container, $phpbb_dispatcher; + + // Notifications types to delete + $delete_notifications_types = array( + 'notification.type.quote', + 'notification.type.approve_post', + 'notification.type.post_in_queue', + ); + + /** + * Perform additional actions before post(s) deletion + * + * @event core.delete_posts_before + * @var string where_type Variable containing posts deletion mode + * @var mixed where_ids Array or comma separated list of posts ids to delete + * @var bool auto_sync Flag indicating if topics/forums should be synchronized + * @var bool posted_sync Flag indicating if topics_posted table should be resynchronized + * @var bool post_count_sync Flag indicating if posts count should be resynchronized + * @var bool call_delete_topics Flag indicating if topics having no posts should be deleted + * @var array delete_notifications_types Array with notifications types to delete + * @since 3.1.0-a4 + */ + $vars = array( + 'where_type', + 'where_ids', + 'auto_sync', + 'posted_sync', + 'post_count_sync', + 'call_delete_topics', + 'delete_notifications_types', + ); + extract($phpbb_dispatcher->trigger_event('core.delete_posts_before', compact($vars))); + + if ($where_type === 'range') + { + $where_clause = $where_ids; + } + else + { + if (is_array($where_ids)) + { + $where_ids = array_unique($where_ids); + } + else + { + $where_ids = array($where_ids); + } + + if (!sizeof($where_ids)) + { + return false; + } + + $where_ids = array_map('intval', $where_ids); + +/* Possible code for splitting post deletion + if (sizeof($where_ids) >= 1001) + { + // Split into chunks of 1000 + $chunks = array_chunk($where_ids, 1000); + + foreach ($chunks as $_where_ids) + { + delete_posts($where_type, $_where_ids, $auto_sync, $posted_sync, $post_count_sync, $call_delete_topics); + } + + return; + }*/ + + $where_clause = $db->sql_in_set($where_type, $where_ids); + } + + $approved_posts = 0; + $post_ids = $topic_ids = $forum_ids = $post_counts = $remove_topics = array(); + + $sql = 'SELECT post_id, poster_id, post_visibility, post_postcount, topic_id, forum_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $where_clause; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $post_ids[] = (int) $row['post_id']; + $poster_ids[] = (int) $row['poster_id']; + $topic_ids[] = (int) $row['topic_id']; + $forum_ids[] = (int) $row['forum_id']; + + if ($row['post_postcount'] && $post_count_sync && $row['post_visibility'] == ITEM_APPROVED) + { + $post_counts[$row['poster_id']] = (!empty($post_counts[$row['poster_id']])) ? $post_counts[$row['poster_id']] + 1 : 1; + } + + if ($row['post_visibility'] == ITEM_APPROVED) + { + $approved_posts++; + } + } + $db->sql_freeresult($result); + + if (!sizeof($post_ids)) + { + return false; + } + + $db->sql_transaction('begin'); + + $table_ary = array(POSTS_TABLE, REPORTS_TABLE); + + foreach ($table_ary as $table) + { + $sql = "DELETE FROM $table + WHERE " . $db->sql_in_set('post_id', $post_ids); + $db->sql_query($sql); + } + unset($table_ary); + + // Adjust users post counts + if (sizeof($post_counts) && $post_count_sync) + { + foreach ($post_counts as $poster_id => $substract) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_posts = 0 + WHERE user_id = ' . $poster_id . ' + AND user_posts < ' . $substract; + $db->sql_query($sql); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_posts = user_posts - ' . $substract . ' + WHERE user_id = ' . $poster_id . ' + AND user_posts >= ' . $substract; + $db->sql_query($sql); + } + } + + // Remove topics now having no posts? + if (sizeof($topic_ids)) + { + $sql = 'SELECT topic_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . ' + GROUP BY topic_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $remove_topics[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + // Actually, those not within remove_topics should be removed. ;) + $remove_topics = array_diff($topic_ids, $remove_topics); + } + + // Remove the message from the search index + $search_type = $config['search_type']; + + if (!class_exists($search_type)) + { + trigger_error('NO_SUCH_SEARCH_MODULE'); + } + + $error = false; + $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); + + if ($error) + { + trigger_error($error); + } + + $search->index_remove($post_ids, $poster_ids, $forum_ids); + + delete_attachments('post', $post_ids, false); + + /** + * Perform additional actions during post(s) deletion + * + * @event core.delete_posts_in_transaction + * @var array post_ids Array with deleted posts' ids + * @var array poster_ids Array with deleted posts' author ids + * @var array topic_ids Array with deleted posts' topic ids + * @var array forum_ids Array with deleted posts' forum ids + * @var string where_type Variable containing posts deletion mode + * @var mixed where_ids Array or comma separated list of posts ids to delete + * @var array delete_notifications_types Array with notifications types to delete + * @since 3.1.0-a4 + */ + $vars = array( + 'post_ids', + 'poster_ids', + 'topic_ids', + 'forum_ids', + 'where_type', + 'where_ids', + 'delete_notifications_types', + ); + extract($phpbb_dispatcher->trigger_event('core.delete_posts_in_transaction', compact($vars))); + + $db->sql_transaction('commit'); + + /** + * Perform additional actions after post(s) deletion + * + * @event core.delete_posts_after + * @var array post_ids Array with deleted posts' ids + * @var array poster_ids Array with deleted posts' author ids + * @var array topic_ids Array with deleted posts' topic ids + * @var array forum_ids Array with deleted posts' forum ids + * @var string where_type Variable containing posts deletion mode + * @var mixed where_ids Array or comma separated list of posts ids to delete + * @var array delete_notifications_types Array with notifications types to delete + * @since 3.1.0-a4 + */ + $vars = array( + 'post_ids', + 'poster_ids', + 'topic_ids', + 'forum_ids', + 'where_type', + 'where_ids', + 'delete_notifications_types', + ); + extract($phpbb_dispatcher->trigger_event('core.delete_posts_after', compact($vars))); + + // Resync topics_posted table + if ($posted_sync) + { + update_posted_info($topic_ids); + } + + if ($auto_sync) + { + sync('topic_reported', 'topic_id', $topic_ids); + sync('topic', 'topic_id', $topic_ids, true); + sync('forum', 'forum_id', $forum_ids, true, true); + } + + if ($approved_posts && $post_count_sync) + { + set_config_count('num_posts', $approved_posts * (-1), true); + } + + // We actually remove topics now to not be inconsistent (the delete_topics function calls this function too) + if (sizeof($remove_topics) && $call_delete_topics) + { + delete_topics('topic_id', $remove_topics, $auto_sync, $post_count_sync, false); + } + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + $phpbb_notifications->delete_notifications($delete_notifications_types, $post_ids); + + return sizeof($post_ids); +} + +/** +* Delete Attachments +* +* @param string $mode can be: post|message|topic|attach|user +* @param mixed $ids can be: post_ids, message_ids, topic_ids, attach_ids, user_ids +* @param bool $resync set this to false if you are deleting posts or topics +*/ +function delete_attachments($mode, $ids, $resync = true) +{ + global $db, $config; + + // 0 is as bad as an empty array + if (empty($ids)) + { + return false; + } + + if (is_array($ids)) + { + $ids = array_unique($ids); + $ids = array_map('intval', $ids); + } + else + { + $ids = array((int) $ids); + } + + $sql_where = ''; + + switch ($mode) + { + case 'post': + case 'message': + $sql_id = 'post_msg_id'; + $sql_where = ' AND in_message = ' . ($mode == 'message' ? 1 : 0); + break; + + case 'topic': + $sql_id = 'topic_id'; + break; + + case 'user': + $sql_id = 'poster_id'; + break; + + case 'attach': + default: + $sql_id = 'attach_id'; + $mode = 'attach'; + break; + } + + $post_ids = $message_ids = $topic_ids = $physical = array(); + + // Collect post and topic ids for later use if we need to touch remaining entries (if resync is enabled) + $sql = 'SELECT post_msg_id, topic_id, in_message, physical_filename, thumbnail, filesize, is_orphan + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set($sql_id, $ids); + + $sql .= $sql_where; + + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + // We only need to store post/message/topic ids if resync is enabled and the file is not orphaned + if ($resync && !$row['is_orphan']) + { + if (!$row['in_message']) + { + $post_ids[] = $row['post_msg_id']; + $topic_ids[] = $row['topic_id']; + } + else + { + $message_ids[] = $row['post_msg_id']; + } + } + + $physical[] = array('filename' => $row['physical_filename'], 'thumbnail' => $row['thumbnail'], 'filesize' => $row['filesize'], 'is_orphan' => $row['is_orphan']); + } + $db->sql_freeresult($result); + + // Delete attachments + $sql = 'DELETE FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set($sql_id, $ids); + + $sql .= $sql_where; + + $db->sql_query($sql); + $num_deleted = $db->sql_affectedrows(); + + if (!$num_deleted) + { + return 0; + } + + // Delete attachments from filesystem + $space_removed = $files_removed = 0; + foreach ($physical as $file_ary) + { + if (phpbb_unlink($file_ary['filename'], 'file', true) && !$file_ary['is_orphan']) + { + // Only non-orphaned files count to the file size + $space_removed += $file_ary['filesize']; + $files_removed++; + } + + if ($file_ary['thumbnail']) + { + phpbb_unlink($file_ary['filename'], 'thumbnail', 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); + } + + // If we do not resync, we do not need to adjust any message, post, topic or user entries + if (!$resync) + { + return $num_deleted; + } + + // No more use for the original ids + unset($ids); + + // Now, we need to resync posts, messages, topics. We go through every one of them + $post_ids = array_unique($post_ids); + $message_ids = array_unique($message_ids); + $topic_ids = array_unique($topic_ids); + + // Update post indicators for posts now no longer having attachments + if (sizeof($post_ids)) + { + // Just check which posts are still having an assigned attachment not orphaned by querying the attachments table + $sql = 'SELECT post_msg_id + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_msg_id', $post_ids) . ' + AND in_message = 0 + AND is_orphan = 0'; + $result = $db->sql_query($sql); + + $remaining_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $remaining_ids[] = $row['post_msg_id']; + } + $db->sql_freeresult($result); + + // Now only unset those ids remaining + $post_ids = array_diff($post_ids, $remaining_ids); + + if (sizeof($post_ids)) + { + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET post_attachment = 0 + WHERE ' . $db->sql_in_set('post_id', $post_ids); + $db->sql_query($sql); + } + } + + // Update message table if messages are affected + if (sizeof($message_ids)) + { + // Just check which messages are still having an assigned attachment not orphaned by querying the attachments table + $sql = 'SELECT post_msg_id + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_msg_id', $message_ids) . ' + AND in_message = 1 + AND is_orphan = 0'; + $result = $db->sql_query($sql); + + $remaining_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $remaining_ids[] = $row['post_msg_id']; + } + $db->sql_freeresult($result); + + // Now only unset those ids remaining + $message_ids = array_diff($message_ids, $remaining_ids); + + if (sizeof($message_ids)) + { + $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' + SET message_attachment = 0 + WHERE ' . $db->sql_in_set('msg_id', $message_ids); + $db->sql_query($sql); + } + } + + // Now update the topics. This is a bit trickier, because there could be posts still having attachments within the topic + if (sizeof($topic_ids)) + { + // Just check which topics are still having an assigned attachment not orphaned by querying the attachments table (much less entries expected) + $sql = 'SELECT topic_id + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . ' + AND is_orphan = 0'; + $result = $db->sql_query($sql); + + $remaining_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $remaining_ids[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + // Now only unset those ids remaining + $topic_ids = array_diff($topic_ids, $remaining_ids); + + if (sizeof($topic_ids)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_attachment = 0 + WHERE ' . $db->sql_in_set('topic_id', $topic_ids); + $db->sql_query($sql); + } + } + + return $num_deleted; +} + +/** +* Deletes shadow topics pointing to a specified forum. +* +* @param int $forum_id The forum id +* @param string $sql_more Additional WHERE statement, e.g. t.topic_time < (time() - 1234) +* @param bool $auto_sync Will call sync() if this is true +* +* @return array Array with affected forums +*/ +function delete_topic_shadows($forum_id, $sql_more = '', $auto_sync = true) +{ + global $db; + + if (!$forum_id) + { + // Nothing to do. + return; + } + + // Set of affected forums we have to resync + $sync_forum_ids = array(); + + // Amount of topics we select and delete at once. + $batch_size = 500; + + do + { + $sql = 'SELECT t2.forum_id, t2.topic_id + FROM ' . TOPICS_TABLE . ' t2, ' . TOPICS_TABLE . ' t + WHERE t2.topic_moved_id = t.topic_id + AND t.forum_id = ' . (int) $forum_id . ' + ' . (($sql_more) ? 'AND ' . $sql_more : ''); + $result = $db->sql_query_limit($sql, $batch_size); + + $topic_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $topic_ids[] = (int) $row['topic_id']; + + $sync_forum_ids[(int) $row['forum_id']] = (int) $row['forum_id']; + } + $db->sql_freeresult($result); + + if (!empty($topic_ids)) + { + $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_ids); + $db->sql_query($sql); + } + } + while (sizeof($topic_ids) == $batch_size); + + if ($auto_sync) + { + sync('forum', 'forum_id', $sync_forum_ids, true, true); + } + + return $sync_forum_ids; +} + +/** +* Update/Sync posted information for topics +*/ +function update_posted_info(&$topic_ids) +{ + global $db, $config; + + if (empty($topic_ids) || !$config['load_db_track']) + { + return; + } + + // First of all, let us remove any posted information for these topics + $sql = 'DELETE FROM ' . TOPICS_POSTED_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_ids); + $db->sql_query($sql); + + // Now, let us collect the user/topic combos for rebuilding the information + $sql = 'SELECT poster_id, topic_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . ' + AND poster_id <> ' . ANONYMOUS . ' + GROUP BY poster_id, topic_id'; + $result = $db->sql_query($sql); + + $posted = array(); + while ($row = $db->sql_fetchrow($result)) + { + // Add as key to make them unique (grouping by) and circumvent empty keys on array_unique + $posted[$row['poster_id']][] = $row['topic_id']; + } + $db->sql_freeresult($result); + + // Now add the information... + $sql_ary = array(); + foreach ($posted as $user_id => $topic_row) + { + foreach ($topic_row as $topic_id) + { + $sql_ary[] = array( + 'user_id' => (int) $user_id, + 'topic_id' => (int) $topic_id, + 'topic_posted' => 1, + ); + } + } + unset($posted); + + $db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary); +} + +/** +* Delete attached file +*/ +function phpbb_unlink($filename, $mode = 'file', $entry_removed = false) +{ + global $db, $phpbb_root_path, $config; + + // Because of copying topics or modifications a physical filename could be assigned more than once. If so, do not remove the file itself. + $sql = 'SELECT COUNT(attach_id) AS num_entries + FROM ' . ATTACHMENTS_TABLE . " + WHERE physical_filename = '" . $db->sql_escape(utf8_basename($filename)) . "'"; + $result = $db->sql_query($sql); + $num_entries = (int) $db->sql_fetchfield('num_entries'); + $db->sql_freeresult($result); + + // Do not remove file if at least one additional entry with the same name exist. + if (($entry_removed && $num_entries > 0) || (!$entry_removed && $num_entries > 1)) + { + return false; + } + + $filename = ($mode == 'thumbnail') ? 'thumb_' . utf8_basename($filename) : utf8_basename($filename); + return @unlink($phpbb_root_path . $config['upload_path'] . '/' . $filename); +} + +/** +* All-encompasing sync function +* +* Exaples: +* +* sync('topic', 'topic_id', 123); // resync topic #123 +* sync('topic', 'forum_id', array(2, 3)); // resync topics from forum #2 and #3 +* sync('topic'); // resync all topics +* sync('topic', 'range', 'topic_id BETWEEN 1 AND 60'); // resync a range of topics/forums (only available for 'topic' and 'forum' modes) +* +* +* Modes: +* - forum Resync complete forum +* - topic Resync topics +* - topic_moved Removes topic shadows that would be in the same forum as the topic they link to +* - topic_visibility Resyncs the topic_visibility flag according to the status of the first post +* - post_reported Resyncs the post_reported flag, relying on actual reports +* - topic_reported Resyncs the topic_reported flag, relying on post_reported flags +* - post_attachement Same as post_reported, but with attachment flags +* - topic_attachement Same as topic_reported, but with attachment flags +*/ +function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $sync_extra = false) +{ + global $db; + + if (is_array($where_ids)) + { + $where_ids = array_unique($where_ids); + $where_ids = array_map('intval', $where_ids); + } + else if ($where_type != 'range') + { + $where_ids = ($where_ids) ? array((int) $where_ids) : array(); + } + + if ($mode == 'forum' || $mode == 'topic' || $mode == 'topic_visibility' || $mode == 'topic_reported' || $mode == 'post_reported') + { + if (!$where_type) + { + $where_sql = ''; + $where_sql_and = 'WHERE'; + } + else if ($where_type == 'range') + { + // Only check a range of topics/forums. For instance: 'topic_id BETWEEN 1 AND 60' + $where_sql = 'WHERE (' . $mode[0] . ".$where_ids)"; + $where_sql_and = $where_sql . "\n\tAND"; + } + else + { + // Do not sync the "global forum" + $where_ids = array_diff($where_ids, array(0)); + + if (!sizeof($where_ids)) + { + // Empty array with IDs. This means that we don't have any work to do. Just return. + return; + } + + // Limit the topics/forums we are syncing, use specific topic/forum IDs. + // $where_type contains the field for the where clause (forum_id, topic_id) + $where_sql = 'WHERE ' . $db->sql_in_set($mode[0] . '.' . $where_type, $where_ids); + $where_sql_and = $where_sql . "\n\tAND"; + } + } + else + { + if (!sizeof($where_ids)) + { + return; + } + + // $where_type contains the field for the where clause (forum_id, topic_id) + $where_sql = 'WHERE ' . $db->sql_in_set($mode[0] . '.' . $where_type, $where_ids); + $where_sql_and = $where_sql . "\n\tAND"; + } + + switch ($mode) + { + case 'topic_moved': + $db->sql_transaction('begin'); + switch ($db->get_sql_layer()) + { + case 'mysql4': + case 'mysqli': + $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + USING ' . TOPICS_TABLE . ' t1, ' . TOPICS_TABLE . " t2 + WHERE t1.topic_moved_id = t2.topic_id + AND t1.forum_id = t2.forum_id"; + $db->sql_query($sql); + break; + + default: + $sql = 'SELECT t1.topic_id + FROM ' .TOPICS_TABLE . ' t1, ' . TOPICS_TABLE . " t2 + WHERE t1.topic_moved_id = t2.topic_id + AND t1.forum_id = t2.forum_id"; + $result = $db->sql_query($sql); + + $topic_id_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $topic_id_ary[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + if (!sizeof($topic_id_ary)) + { + return; + } + + $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_id_ary); + $db->sql_query($sql); + + break; + } + + $db->sql_transaction('commit'); + break; + + case 'topic_visibility': + + $db->sql_transaction('begin'); + + $sql = 'SELECT t.topic_id, p.post_visibility + FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p + $where_sql_and p.topic_id = t.topic_id + AND p.post_visibility = " . ITEM_APPROVED; + $result = $db->sql_query($sql); + + $topics_approved = array(); + while ($row = $db->sql_fetchrow($result)) + { + $topics_approved[] = (int) $row['topic_id']; + } + $db->sql_freeresult($result); + + $sql = 'SELECT t.topic_id, p.post_visibility + FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p + $where_sql_and " . $db->sql_in_set('t.topic_id', $topics_approved, true, true) . ' + AND p.topic_id = t.topic_id + AND p.post_visibility = ' . ITEM_DELETED; + $result = $db->sql_query($sql); + + $topics_softdeleted = array(); + while ($row = $db->sql_fetchrow($result)) + { + $topics_softdeleted[] = (int) $row['topic_id']; + } + $db->sql_freeresult($result); + + $topics_softdeleted = array_diff($topics_softdeleted, $topics_approved); + $topics_not_unapproved = array_merge($topics_softdeleted, $topics_approved); + + $update_ary = array( + ITEM_UNAPPROVED => (!empty($topics_not_unapproved)) ? $where_sql_and . ' ' . $db->sql_in_set('topic_id', $topics_not_unapproved, true) : '', + ITEM_APPROVED => (!empty($topics_approved)) ? ' WHERE ' . $db->sql_in_set('topic_id', $topics_approved) : '', + ITEM_DELETED => (!empty($topics_softdeleted)) ? ' WHERE ' . $db->sql_in_set('topic_id', $topics_softdeleted) : '', + ); + + foreach ($update_ary as $visibility => $sql_where) + { + if ($sql_where) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_visibility = ' . $visibility . ' + ' . $sql_where; + $db->sql_query($sql); + } + } + + $db->sql_transaction('commit'); + break; + + case 'post_reported': + $post_ids = $post_reported = array(); + + $db->sql_transaction('begin'); + + $sql = 'SELECT p.post_id, p.post_reported + FROM ' . POSTS_TABLE . " p + $where_sql + GROUP BY p.post_id, p.post_reported"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $post_ids[$row['post_id']] = $row['post_id']; + if ($row['post_reported']) + { + $post_reported[$row['post_id']] = 1; + } + } + $db->sql_freeresult($result); + + $sql = 'SELECT DISTINCT(post_id) + FROM ' . REPORTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_id', $post_ids) . ' + AND report_closed = 0'; + $result = $db->sql_query($sql); + + $post_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($post_reported[$row['post_id']])) + { + $post_ids[] = $row['post_id']; + } + else + { + unset($post_reported[$row['post_id']]); + } + } + $db->sql_freeresult($result); + + // $post_reported should be empty by now, if it's not it contains + // posts that are falsely flagged as reported + foreach ($post_reported as $post_id => $void) + { + $post_ids[] = $post_id; + } + + if (sizeof($post_ids)) + { + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET post_reported = 1 - post_reported + WHERE ' . $db->sql_in_set('post_id', $post_ids); + $db->sql_query($sql); + } + + $db->sql_transaction('commit'); + break; + + case 'topic_reported': + if ($sync_extra) + { + sync('post_reported', $where_type, $where_ids); + } + + $topic_ids = $topic_reported = array(); + + $db->sql_transaction('begin'); + + $sql = 'SELECT DISTINCT(t.topic_id) + FROM ' . POSTS_TABLE . " t + $where_sql_and t.post_reported = 1"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $topic_reported[$row['topic_id']] = 1; + } + $db->sql_freeresult($result); + + $sql = 'SELECT t.topic_id, t.topic_reported + FROM ' . TOPICS_TABLE . " t + $where_sql"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['topic_reported'] ^ isset($topic_reported[$row['topic_id']])) + { + $topic_ids[] = $row['topic_id']; + } + } + $db->sql_freeresult($result); + + if (sizeof($topic_ids)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_reported = 1 - topic_reported + WHERE ' . $db->sql_in_set('topic_id', $topic_ids); + $db->sql_query($sql); + } + + $db->sql_transaction('commit'); + break; + + case 'post_attachment': + $post_ids = $post_attachment = array(); + + $db->sql_transaction('begin'); + + $sql = 'SELECT p.post_id, p.post_attachment + FROM ' . POSTS_TABLE . " p + $where_sql + GROUP BY p.post_id, p.post_attachment"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $post_ids[$row['post_id']] = $row['post_id']; + if ($row['post_attachment']) + { + $post_attachment[$row['post_id']] = 1; + } + } + $db->sql_freeresult($result); + + $sql = 'SELECT DISTINCT(post_msg_id) + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_msg_id', $post_ids) . ' + AND in_message = 0'; + $result = $db->sql_query($sql); + + $post_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($post_attachment[$row['post_msg_id']])) + { + $post_ids[] = $row['post_msg_id']; + } + else + { + unset($post_attachment[$row['post_msg_id']]); + } + } + $db->sql_freeresult($result); + + // $post_attachment should be empty by now, if it's not it contains + // posts that are falsely flagged as having attachments + foreach ($post_attachment as $post_id => $void) + { + $post_ids[] = $post_id; + } + + if (sizeof($post_ids)) + { + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET post_attachment = 1 - post_attachment + WHERE ' . $db->sql_in_set('post_id', $post_ids); + $db->sql_query($sql); + } + + $db->sql_transaction('commit'); + break; + + case 'topic_attachment': + if ($sync_extra) + { + sync('post_attachment', $where_type, $where_ids); + } + + $topic_ids = $topic_attachment = array(); + + $db->sql_transaction('begin'); + + $sql = 'SELECT DISTINCT(t.topic_id) + FROM ' . POSTS_TABLE . " t + $where_sql_and t.post_attachment = 1"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $topic_attachment[$row['topic_id']] = 1; + } + $db->sql_freeresult($result); + + $sql = 'SELECT t.topic_id, t.topic_attachment + FROM ' . TOPICS_TABLE . " t + $where_sql"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['topic_attachment'] ^ isset($topic_attachment[$row['topic_id']])) + { + $topic_ids[] = $row['topic_id']; + } + } + $db->sql_freeresult($result); + + if (sizeof($topic_ids)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_attachment = 1 - topic_attachment + WHERE ' . $db->sql_in_set('topic_id', $topic_ids); + $db->sql_query($sql); + } + + $db->sql_transaction('commit'); + + break; + + case 'forum': + + $db->sql_transaction('begin'); + + // 1: Get the list of all forums + $sql = 'SELECT f.* + FROM ' . FORUMS_TABLE . " f + $where_sql"; + $result = $db->sql_query($sql); + + $forum_data = $forum_ids = $post_ids = $last_post_id = $post_info = array(); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['forum_type'] == FORUM_LINK) + { + continue; + } + + $forum_id = (int) $row['forum_id']; + $forum_ids[$forum_id] = $forum_id; + + $forum_data[$forum_id] = $row; + if ($sync_extra) + { + $forum_data[$forum_id]['posts_approved'] = 0; + $forum_data[$forum_id]['posts_unapproved'] = 0; + $forum_data[$forum_id]['posts_softdeleted'] = 0; + $forum_data[$forum_id]['topics_approved'] = 0; + $forum_data[$forum_id]['topics_unapproved'] = 0; + $forum_data[$forum_id]['topics_softdeleted'] = 0; + } + $forum_data[$forum_id]['last_post_id'] = 0; + $forum_data[$forum_id]['last_post_subject'] = ''; + $forum_data[$forum_id]['last_post_time'] = 0; + $forum_data[$forum_id]['last_poster_id'] = 0; + $forum_data[$forum_id]['last_poster_name'] = ''; + $forum_data[$forum_id]['last_poster_colour'] = ''; + } + $db->sql_freeresult($result); + + if (!sizeof($forum_ids)) + { + break; + } + + $forum_ids = array_values($forum_ids); + + // 2: Get topic counts for each forum (optional) + if ($sync_extra) + { + $sql = 'SELECT forum_id, topic_visibility, COUNT(topic_id) AS total_topics + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids) . ' + GROUP BY forum_id, topic_visibility'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_id = (int) $row['forum_id']; + + if ($row['topic_visibility'] == ITEM_APPROVED) + { + $forum_data[$forum_id]['topics_approved'] = $row['total_topics']; + } + else if ($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE) + { + $forum_data[$forum_id]['topics_unapproved'] = $row['total_topics']; + } + else if ($row['topic_visibility'] == ITEM_DELETED) + { + $forum_data[$forum_id]['topics_softdeleted'] = $row['total_topics']; + } + } + $db->sql_freeresult($result); + } + + // 3: Get post count for each forum (optional) + if ($sync_extra) + { + if (sizeof($forum_ids) == 1) + { + $sql = 'SELECT SUM(t.topic_posts_approved) AS forum_posts_approved, SUM(t.topic_posts_unapproved) AS forum_posts_unapproved, SUM(t.topic_posts_softdeleted) AS forum_posts_softdeleted + FROM ' . TOPICS_TABLE . ' t + WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . ' + AND t.topic_status <> ' . ITEM_MOVED; + } + else + { + $sql = 'SELECT t.forum_id, SUM(t.topic_posts_approved) AS forum_posts_approved, SUM(t.topic_posts_unapproved) AS forum_posts_unapproved, SUM(t.topic_posts_softdeleted) AS forum_posts_softdeleted + FROM ' . TOPICS_TABLE . ' t + WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . ' + AND t.topic_status <> ' . ITEM_MOVED . ' + GROUP BY t.forum_id'; + } + + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_id = (sizeof($forum_ids) == 1) ? (int) $forum_ids[0] : (int) $row['forum_id']; + + $forum_data[$forum_id]['posts_approved'] = (int) $row['forum_posts_approved']; + $forum_data[$forum_id]['posts_unapproved'] = (int) $row['forum_posts_unapproved']; + $forum_data[$forum_id]['posts_softdeleted'] = (int) $row['forum_posts_softdeleted']; + } + $db->sql_freeresult($result); + } + + // 4: Get last_post_id for each forum + if (sizeof($forum_ids) == 1) + { + $sql = 'SELECT MAX(t.topic_last_post_id) as last_post_id + FROM ' . TOPICS_TABLE . ' t + WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . ' + AND t.topic_visibility = ' . ITEM_APPROVED; + } + else + { + $sql = 'SELECT t.forum_id, MAX(t.topic_last_post_id) as last_post_id + FROM ' . TOPICS_TABLE . ' t + WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . ' + AND t.topic_visibility = ' . ITEM_APPROVED . ' + GROUP BY t.forum_id'; + } + + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_id = (sizeof($forum_ids) == 1) ? (int) $forum_ids[0] : (int) $row['forum_id']; + + $forum_data[$forum_id]['last_post_id'] = (int) $row['last_post_id']; + + $post_ids[] = $row['last_post_id']; + } + $db->sql_freeresult($result); + + // 5: Retrieve last_post infos + if (sizeof($post_ids)) + { + $sql = 'SELECT p.post_id, p.poster_id, p.post_subject, p.post_time, p.post_username, u.username, u.user_colour + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u + WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . ' + AND p.poster_id = u.user_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $post_info[$row['post_id']] = $row; + } + $db->sql_freeresult($result); + + foreach ($forum_data as $forum_id => $data) + { + if ($data['last_post_id']) + { + if (isset($post_info[$data['last_post_id']])) + { + $forum_data[$forum_id]['last_post_subject'] = $post_info[$data['last_post_id']]['post_subject']; + $forum_data[$forum_id]['last_post_time'] = $post_info[$data['last_post_id']]['post_time']; + $forum_data[$forum_id]['last_poster_id'] = $post_info[$data['last_post_id']]['poster_id']; + $forum_data[$forum_id]['last_poster_name'] = ($post_info[$data['last_post_id']]['poster_id'] != ANONYMOUS) ? $post_info[$data['last_post_id']]['username'] : $post_info[$data['last_post_id']]['post_username']; + $forum_data[$forum_id]['last_poster_colour'] = $post_info[$data['last_post_id']]['user_colour']; + } + else + { + // For some reason we did not find the post in the db + $forum_data[$forum_id]['last_post_id'] = 0; + $forum_data[$forum_id]['last_post_subject'] = ''; + $forum_data[$forum_id]['last_post_time'] = 0; + $forum_data[$forum_id]['last_poster_id'] = 0; + $forum_data[$forum_id]['last_poster_name'] = ''; + $forum_data[$forum_id]['last_poster_colour'] = ''; + } + } + } + unset($post_info); + } + + // 6: Now do that thing + $fieldnames = array('last_post_id', 'last_post_subject', 'last_post_time', 'last_poster_id', 'last_poster_name', 'last_poster_colour'); + + if ($sync_extra) + { + array_push($fieldnames, 'posts_approved', 'posts_unapproved', 'posts_softdeleted', 'topics_approved', 'topics_unapproved', 'topics_softdeleted'); + } + + foreach ($forum_data as $forum_id => $row) + { + $sql_ary = array(); + + foreach ($fieldnames as $fieldname) + { + if ($row['forum_' . $fieldname] != $row[$fieldname]) + { + if (preg_match('#(name|colour|subject)$#', $fieldname)) + { + $sql_ary['forum_' . $fieldname] = (string) $row[$fieldname]; + } + else + { + $sql_ary['forum_' . $fieldname] = (int) $row[$fieldname]; + } + } + } + + if (sizeof($sql_ary)) + { + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE forum_id = ' . $forum_id; + $db->sql_query($sql); + } + } + + $db->sql_transaction('commit'); + break; + + case 'topic': + $topic_data = $post_ids = $resync_forums = $delete_topics = $delete_posts = $moved_topics = array(); + + $db->sql_transaction('begin'); + + $sql = 'SELECT t.topic_id, t.forum_id, t.topic_moved_id, t.topic_visibility, ' . (($sync_extra) ? 't.topic_attachment, t.topic_reported, ' : '') . 't.topic_poster, t.topic_time, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_first_post_id, t.topic_first_poster_name, t.topic_first_poster_colour, t.topic_last_post_id, t.topic_last_post_subject, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_poster_colour, t.topic_last_post_time + FROM ' . TOPICS_TABLE . " t + $where_sql"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['topic_moved_id']) + { + $moved_topics[] = $row['topic_id']; + continue; + } + + $topic_id = (int) $row['topic_id']; + $topic_data[$topic_id] = $row; + $topic_data[$topic_id]['visibility'] = ITEM_UNAPPROVED; + $topic_data[$topic_id]['posts_approved'] = 0; + $topic_data[$topic_id]['posts_unapproved'] = 0; + $topic_data[$topic_id]['posts_softdeleted'] = 0; + $topic_data[$topic_id]['first_post_id'] = 0; + $topic_data[$topic_id]['last_post_id'] = 0; + unset($topic_data[$topic_id]['topic_id']); + + // This array holds all topic_ids + $delete_topics[$topic_id] = ''; + + if ($sync_extra) + { + $topic_data[$topic_id]['reported'] = 0; + $topic_data[$topic_id]['attachment'] = 0; + } + } + $db->sql_freeresult($result); + + // Use "t" as table alias because of the $where_sql clause + // NOTE: 't.post_visibility' in the GROUP BY is causing a major slowdown. + $sql = 'SELECT t.topic_id, t.post_visibility, COUNT(t.post_id) AS total_posts, MIN(t.post_id) AS first_post_id, MAX(t.post_id) AS last_post_id + FROM ' . POSTS_TABLE . " t + $where_sql + GROUP BY t.topic_id, t.post_visibility"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $topic_id = (int) $row['topic_id']; + + $row['first_post_id'] = (int) $row['first_post_id']; + $row['last_post_id'] = (int) $row['last_post_id']; + + if (!isset($topic_data[$topic_id])) + { + // Hey, these posts come from a topic that does not exist + $delete_posts[$topic_id] = ''; + } + else + { + // Unset the corresponding entry in $delete_topics + // When we'll be done, only topics with no posts will remain + unset($delete_topics[$topic_id]); + + if ($row['post_visibility'] == ITEM_APPROVED) + { + $topic_data[$topic_id]['posts_approved'] = $row['total_posts']; + } + else if ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) + { + $topic_data[$topic_id]['posts_unapproved'] = $row['total_posts']; + } + else if ($row['post_visibility'] == ITEM_DELETED) + { + $topic_data[$topic_id]['posts_softdeleted'] = $row['total_posts']; + } + + if ($row['post_visibility'] == ITEM_APPROVED) + { + $topic_data[$topic_id]['visibility'] = ITEM_APPROVED; + $topic_data[$topic_id]['first_post_id'] = $row['first_post_id']; + $topic_data[$topic_id]['last_post_id'] = $row['last_post_id']; + } + else if ($topic_data[$topic_id]['visibility'] != ITEM_APPROVED) + { + // If there is no approved post, we take the min/max of the other visibilities + // for the last and first post info, because it is only visible to moderators anyway + $topic_data[$topic_id]['first_post_id'] = (!empty($topic_data[$topic_id]['first_post_id'])) ? min($topic_data[$topic_id]['first_post_id'], $row['first_post_id']) : $row['first_post_id']; + $topic_data[$topic_id]['last_post_id'] = max($topic_data[$topic_id]['last_post_id'], $row['last_post_id']); + + if ($topic_data[$topic_id]['visibility'] == ITEM_UNAPPROVED || $topic_data[$topic_id]['visibility'] == ITEM_REAPPROVE) + { + // Soft delete status is stronger than unapproved. + $topic_data[$topic_id]['visibility'] = $row['post_visibility']; + } + } + } + } + $db->sql_freeresult($result); + + foreach ($topic_data as $topic_id => $row) + { + $post_ids[] = $row['first_post_id']; + if ($row['first_post_id'] != $row['last_post_id']) + { + $post_ids[] = $row['last_post_id']; + } + } + + // Now we delete empty topics and orphan posts + if (sizeof($delete_posts)) + { + delete_posts('topic_id', array_keys($delete_posts), false); + unset($delete_posts); + } + + if (!sizeof($topic_data)) + { + // If we get there, topic ids were invalid or topics did not contain any posts + delete_topics($where_type, $where_ids, true); + return; + } + + if (sizeof($delete_topics)) + { + $delete_topic_ids = array(); + foreach ($delete_topics as $topic_id => $void) + { + unset($topic_data[$topic_id]); + $delete_topic_ids[] = $topic_id; + } + + delete_topics('topic_id', $delete_topic_ids, false); + unset($delete_topics, $delete_topic_ids); + } + + $sql = 'SELECT p.post_id, p.topic_id, p.post_visibility, p.poster_id, p.post_subject, p.post_username, p.post_time, u.username, u.user_colour + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u + WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . ' + AND u.user_id = p.poster_id'; + $result = $db->sql_query($sql); + + $post_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $topic_id = intval($row['topic_id']); + + if ($row['post_id'] == $topic_data[$topic_id]['first_post_id']) + { + $topic_data[$topic_id]['time'] = $row['post_time']; + $topic_data[$topic_id]['poster'] = $row['poster_id']; + $topic_data[$topic_id]['first_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']; + $topic_data[$topic_id]['first_poster_colour'] = $row['user_colour']; + } + + if ($row['post_id'] == $topic_data[$topic_id]['last_post_id']) + { + $topic_data[$topic_id]['last_poster_id'] = $row['poster_id']; + $topic_data[$topic_id]['last_post_subject'] = $row['post_subject']; + $topic_data[$topic_id]['last_post_time'] = $row['post_time']; + $topic_data[$topic_id]['last_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']; + $topic_data[$topic_id]['last_poster_colour'] = $row['user_colour']; + } + } + $db->sql_freeresult($result); + + // Make sure shadow topics do link to existing topics + if (sizeof($moved_topics)) + { + $delete_topics = array(); + + $sql = 'SELECT t1.topic_id, t1.topic_moved_id + FROM ' . TOPICS_TABLE . ' t1 + LEFT JOIN ' . TOPICS_TABLE . ' t2 ON (t2.topic_id = t1.topic_moved_id) + WHERE ' . $db->sql_in_set('t1.topic_id', $moved_topics) . ' + AND t2.topic_id IS NULL'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $delete_topics[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + if (sizeof($delete_topics)) + { + delete_topics('topic_id', $delete_topics, false); + } + unset($delete_topics); + + // Make sure shadow topics having no last post data being updated (this only rarely happens...) + $sql = 'SELECT topic_id, topic_moved_id, topic_last_post_id, topic_first_post_id + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $moved_topics) . ' + AND topic_last_post_time = 0'; + $result = $db->sql_query($sql); + + $shadow_topic_data = $post_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $shadow_topic_data[$row['topic_moved_id']] = $row; + $post_ids[] = $row['topic_last_post_id']; + $post_ids[] = $row['topic_first_post_id']; + } + $db->sql_freeresult($result); + + $sync_shadow_topics = array(); + if (sizeof($post_ids)) + { + $sql = 'SELECT p.post_id, p.topic_id, p.post_visibility, p.poster_id, p.post_subject, p.post_username, p.post_time, u.username, u.user_colour + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u + WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . ' + AND u.user_id = p.poster_id'; + $result = $db->sql_query($sql); + + $post_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $topic_id = (int) $row['topic_id']; + + // Ok, there should be a shadow topic. If there isn't, then there's something wrong with the db. + // However, there's not much we can do about it. + if (!empty($shadow_topic_data[$topic_id])) + { + if ($row['post_id'] == $shadow_topic_data[$topic_id]['topic_first_post_id']) + { + $orig_topic_id = $shadow_topic_data[$topic_id]['topic_id']; + + if (!isset($sync_shadow_topics[$orig_topic_id])) + { + $sync_shadow_topics[$orig_topic_id] = array(); + } + + $sync_shadow_topics[$orig_topic_id]['topic_time'] = $row['post_time']; + $sync_shadow_topics[$orig_topic_id]['topic_poster'] = $row['poster_id']; + $sync_shadow_topics[$orig_topic_id]['topic_first_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']; + $sync_shadow_topics[$orig_topic_id]['topic_first_poster_colour'] = $row['user_colour']; + } + + if ($row['post_id'] == $shadow_topic_data[$topic_id]['topic_last_post_id']) + { + $orig_topic_id = $shadow_topic_data[$topic_id]['topic_id']; + + if (!isset($sync_shadow_topics[$orig_topic_id])) + { + $sync_shadow_topics[$orig_topic_id] = array(); + } + + $sync_shadow_topics[$orig_topic_id]['topic_last_poster_id'] = $row['poster_id']; + $sync_shadow_topics[$orig_topic_id]['topic_last_post_subject'] = $row['post_subject']; + $sync_shadow_topics[$orig_topic_id]['topic_last_post_time'] = $row['post_time']; + $sync_shadow_topics[$orig_topic_id]['topic_last_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']; + $sync_shadow_topics[$orig_topic_id]['topic_last_poster_colour'] = $row['user_colour']; + } + } + } + $db->sql_freeresult($result); + + $shadow_topic_data = array(); + + // Update the information we collected + if (sizeof($sync_shadow_topics)) + { + foreach ($sync_shadow_topics as $sync_topic_id => $sql_ary) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE topic_id = ' . $sync_topic_id; + $db->sql_query($sql); + } + } + } + + unset($sync_shadow_topics, $shadow_topic_data); + } + + // These are fields that will be synchronised + $fieldnames = array('time', 'visibility', 'posts_approved', 'posts_unapproved', 'posts_softdeleted', 'poster', 'first_post_id', 'first_poster_name', 'first_poster_colour', 'last_post_id', 'last_post_subject', 'last_post_time', 'last_poster_id', 'last_poster_name', 'last_poster_colour'); + + if ($sync_extra) + { + // This routine assumes that post_reported values are correct + // if they are not, use sync('post_reported') first + $sql = 'SELECT t.topic_id, p.post_id + FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p + $where_sql_and p.topic_id = t.topic_id + AND p.post_reported = 1 + GROUP BY t.topic_id, p.post_id"; + $result = $db->sql_query($sql); + + $fieldnames[] = 'reported'; + while ($row = $db->sql_fetchrow($result)) + { + $topic_data[intval($row['topic_id'])]['reported'] = 1; + } + $db->sql_freeresult($result); + + // This routine assumes that post_attachment values are correct + // if they are not, use sync('post_attachment') first + $sql = 'SELECT t.topic_id, p.post_id + FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p + $where_sql_and p.topic_id = t.topic_id + AND p.post_attachment = 1 + GROUP BY t.topic_id, p.post_id"; + $result = $db->sql_query($sql); + + $fieldnames[] = 'attachment'; + while ($row = $db->sql_fetchrow($result)) + { + $topic_data[intval($row['topic_id'])]['attachment'] = 1; + } + $db->sql_freeresult($result); + } + + foreach ($topic_data as $topic_id => $row) + { + $sql_ary = array(); + + foreach ($fieldnames as $fieldname) + { + if (isset($row[$fieldname]) && isset($row['topic_' . $fieldname]) && $row['topic_' . $fieldname] != $row[$fieldname]) + { + $sql_ary['topic_' . $fieldname] = $row[$fieldname]; + } + } + + if (sizeof($sql_ary)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE topic_id = ' . $topic_id; + $db->sql_query($sql); + + $resync_forums[$row['forum_id']] = $row['forum_id']; + } + } + unset($topic_data); + + $db->sql_transaction('commit'); + + // if some topics have been resync'ed then resync parent forums + // except when we're only syncing a range, we don't want to sync forums during + // batch processing. + if ($resync_parents && sizeof($resync_forums) && $where_type != 'range') + { + sync('forum', 'forum_id', array_values($resync_forums), true, true); + } + break; + } + + return; +} + +/** +* Prune function +*/ +function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync = true) +{ + global $db, $phpbb_dispatcher; + + if (!is_array($forum_id)) + { + $forum_id = array($forum_id); + } + + if (!sizeof($forum_id)) + { + return; + } + + $sql_and = ''; + + if (!($prune_flags & FORUM_FLAG_PRUNE_ANNOUNCE)) + { + $sql_and .= ' AND topic_type <> ' . POST_ANNOUNCE; + $sql_and .= ' AND topic_type <> ' . POST_GLOBAL; + } + + if (!($prune_flags & FORUM_FLAG_PRUNE_STICKY)) + { + $sql_and .= ' AND topic_type <> ' . POST_STICKY; + } + + if ($prune_mode == 'posted') + { + $sql_and .= " AND topic_last_post_time < $prune_date"; + } + + if ($prune_mode == 'viewed') + { + $sql_and .= " AND topic_last_view_time < $prune_date"; + } + + if ($prune_mode == 'shadow') + { + $sql_and .= ' AND topic_status = ' . ITEM_MOVED . " AND topic_last_post_time < $prune_date"; + } + + /** + * Use this event to modify the SQL that selects topics to be pruned + * + * @event core.prune_sql + * @var string forum_id The forum id + * @var string prune_mode The prune mode + * @var string prune_date The prune date + * @var int prune_flags The prune flags + * @var bool auto_sync Whether or not to perform auto sync + * @var string sql_and SQL text appended to where clause + * @since 3.1.3-RC1 + */ + $vars = array('forum_id', 'prune_mode', 'prune_date', 'prune_flags', 'auto_sync', 'sql_and'); + extract($phpbb_dispatcher->trigger_event('core.prune_sql', compact($vars))); + + $sql = 'SELECT topic_id + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_id) . " + AND poll_start = 0 + $sql_and"; + $result = $db->sql_query($sql); + + $topic_list = array(); + while ($row = $db->sql_fetchrow($result)) + { + $topic_list[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + if ($prune_flags & FORUM_FLAG_PRUNE_POLL) + { + $sql = 'SELECT topic_id + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_id) . " + AND poll_start > 0 + AND poll_last_vote < $prune_date + $sql_and"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $topic_list[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + $topic_list = array_unique($topic_list); + } + + return delete_topics('topic_id', $topic_list, $auto_sync, false); +} + +/** +* Function auto_prune(), this function now relies on passed vars +*/ +function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_freq) +{ + global $db; + + $sql = 'SELECT forum_name + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $db->sql_query($sql, 3600); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $prune_date = time() - ($prune_days * 86400); + $next_prune = time() + ($prune_freq * 86400); + + prune($forum_id, $prune_mode, $prune_date, $prune_flags, true); + + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET prune_next = $next_prune + WHERE forum_id = $forum_id"; + $db->sql_query($sql); + + add_log('admin', 'LOG_AUTO_PRUNE', $row['forum_name']); + } + + return; +} + +/** +* Cache moderators. Called whenever permissions are changed +* via admin_permissions. Changes of usernames and group names +* must be carried through for the moderators table. +* +* @param \phpbb\db\driver\driver_interface $db Database connection +* @param \phpbb\cache\driver\driver_interface Cache driver +* @param \phpbb\auth\auth $auth Authentication object +* @return null +*/ +function phpbb_cache_moderators($db, $cache, $auth) +{ + // Remove cached sql results + $cache->destroy('sql', MODERATOR_CACHE_TABLE); + + // Clear table + switch ($db->get_sql_layer()) + { + case 'sqlite': + case 'sqlite3': + $db->sql_query('DELETE FROM ' . MODERATOR_CACHE_TABLE); + break; + + default: + $db->sql_query('TRUNCATE TABLE ' . MODERATOR_CACHE_TABLE); + break; + } + + // We add moderators who have forum moderator permissions without an explicit ACL_NEVER setting + $hold_ary = $ug_id_ary = $sql_ary = array(); + + // Grab all users having moderative options... + $hold_ary = $auth->acl_user_raw_data(false, 'm_%', false); + + // Add users? + if (sizeof($hold_ary)) + { + // At least one moderative option warrants a display + $ug_id_ary = array_keys($hold_ary); + + // Remove users who have group memberships with DENY moderator permissions + $sql_ary_deny = array( + 'SELECT' => 'a.forum_id, ug.user_id, g.group_id', + + 'FROM' => array( + ACL_OPTIONS_TABLE => 'o', + USER_GROUP_TABLE => 'ug', + GROUPS_TABLE => 'g', + ACL_GROUPS_TABLE => 'a', + ), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'), + 'ON' => 'a.auth_role_id = r.role_id', + ), + ), + + 'WHERE' => '(o.auth_option_id = a.auth_option_id OR o.auth_option_id = r.auth_option_id) + AND ((a.auth_setting = ' . ACL_NEVER . ' AND r.auth_setting IS NULL) + OR r.auth_setting = ' . ACL_NEVER . ') + AND a.group_id = ug.group_id + AND g.group_id = ug.group_id + AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1) + AND ' . $db->sql_in_set('ug.user_id', $ug_id_ary) . " + AND ug.user_pending = 0 + AND o.auth_option " . $db->sql_like_expression('m_' . $db->get_any_char()), + ); + $sql = $db->sql_build_query('SELECT', $sql_ary_deny); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (isset($hold_ary[$row['user_id']][$row['forum_id']])) + { + unset($hold_ary[$row['user_id']][$row['forum_id']]); + } + } + $db->sql_freeresult($result); + + if (sizeof($hold_ary)) + { + // Get usernames... + $sql = 'SELECT user_id, username + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', array_keys($hold_ary)); + $result = $db->sql_query($sql); + + $usernames_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $usernames_ary[$row['user_id']] = $row['username']; + } + $db->sql_freeresult($result); + + foreach ($hold_ary as $user_id => $forum_id_ary) + { + // Do not continue if user does not exist + if (!isset($usernames_ary[$user_id])) + { + continue; + } + + foreach ($forum_id_ary as $forum_id => $auth_ary) + { + $sql_ary[] = array( + 'forum_id' => (int) $forum_id, + 'user_id' => (int) $user_id, + 'username' => (string) $usernames_ary[$user_id], + 'group_id' => 0, + 'group_name' => '' + ); + } + } + } + } + + // Now to the groups... + $hold_ary = $auth->acl_group_raw_data(false, 'm_%', false); + + if (sizeof($hold_ary)) + { + $ug_id_ary = array_keys($hold_ary); + + // Make sure not hidden or special groups are involved... + $sql = 'SELECT group_name, group_id, group_type + FROM ' . GROUPS_TABLE . ' + WHERE ' . $db->sql_in_set('group_id', $ug_id_ary); + $result = $db->sql_query($sql); + + $groupnames_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['group_type'] == GROUP_HIDDEN || $row['group_type'] == GROUP_SPECIAL) + { + unset($hold_ary[$row['group_id']]); + } + + $groupnames_ary[$row['group_id']] = $row['group_name']; + } + $db->sql_freeresult($result); + + foreach ($hold_ary as $group_id => $forum_id_ary) + { + // If there is no group, we do not assign it... + if (!isset($groupnames_ary[$group_id])) + { + continue; + } + + foreach ($forum_id_ary as $forum_id => $auth_ary) + { + $flag = false; + foreach ($auth_ary as $auth_option => $setting) + { + // Make sure at least one ACL_YES option is set... + if ($setting == ACL_YES) + { + $flag = true; + break; + } + } + + if (!$flag) + { + continue; + } + + $sql_ary[] = array( + 'forum_id' => (int) $forum_id, + 'user_id' => 0, + 'username' => '', + 'group_id' => (int) $group_id, + 'group_name' => (string) $groupnames_ary[$group_id] + ); + } + } + } + + $db->sql_multi_insert(MODERATOR_CACHE_TABLE, $sql_ary); +} + +/** +* View log +* +* @param string $mode The mode defines which log_type is used and from which log the entry is retrieved +* @param array &$log The result array with the logs +* @param mixed &$log_count If $log_count is set to false, we will skip counting all entries in the database. +* Otherwise an integer with the number of total matching entries is returned. +* @param int $limit Limit the number of entries that are returned +* @param int $offset Offset when fetching the log entries, f.e. when paginating +* @param mixed $forum_id Restrict the log entries to the given forum_id (can also be an array of forum_ids) +* @param int $topic_id Restrict the log entries to the given topic_id +* @param int $user_id Restrict the log entries to the given user_id +* @param int $log_time Only get log entries newer than the given timestamp +* @param string $sort_by SQL order option, e.g. 'l.log_time DESC' +* @param string $keywords Will only return log entries that have the keywords in log_operation or log_data +* +* @return int Returns the offset of the last valid page, if the specified offset was invalid (too high) +*/ +function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC', $keywords = '') +{ + global $phpbb_log; + + $count_logs = ($log_count !== false); + + $log = $phpbb_log->get_logs($mode, $count_logs, $limit, $offset, $forum_id, $topic_id, $user_id, $limit_days, $sort_by, $keywords); + $log_count = $phpbb_log->get_log_count(); + + return $phpbb_log->get_valid_offset(); +} + +/** +* Removes moderators and administrators from foe lists. +* +* @param \phpbb\db\driver\driver_interface $db Database connection +* @param \phpbb\auth\auth $auth Authentication object +* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore +* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore +* @return null +*/ +function phpbb_update_foes($db, $auth, $group_id = false, $user_id = false) +{ + // update foes for some user + if (is_array($user_id) && sizeof($user_id)) + { + $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' + WHERE ' . $db->sql_in_set('zebra_id', $user_id) . ' + AND foe = 1'; + $db->sql_query($sql); + return; + } + + // update foes for some group + if (is_array($group_id) && sizeof($group_id)) + { + // Grab group settings... + $sql_ary = array( + 'SELECT' => 'a.group_id', + + 'FROM' => array( + ACL_OPTIONS_TABLE => 'ao', + ACL_GROUPS_TABLE => 'a', + ), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'), + 'ON' => 'a.auth_role_id = r.role_id', + ), + ), + + 'WHERE' => '(ao.auth_option_id = a.auth_option_id OR ao.auth_option_id = r.auth_option_id) + AND ' . $db->sql_in_set('a.group_id', $group_id) . " + AND ao.auth_option IN ('a_', 'm_')", + + 'GROUP_BY' => 'a.group_id', + ); + $sql = $db->sql_build_query('SELECT', $sql_ary); + $result = $db->sql_query($sql); + + $groups = array(); + while ($row = $db->sql_fetchrow($result)) + { + $groups[] = (int) $row['group_id']; + } + $db->sql_freeresult($result); + + if (!sizeof($groups)) + { + return; + } + + switch ($db->get_sql_layer()) + { + case 'mysqli': + case 'mysql4': + $sql = 'DELETE ' . (($db->get_sql_layer() === 'mysqli' || version_compare($db->sql_server_info(true), '4.1', '>=')) ? 'z.*' : ZEBRA_TABLE) . ' + FROM ' . ZEBRA_TABLE . ' z, ' . USER_GROUP_TABLE . ' ug + WHERE z.zebra_id = ug.user_id + AND z.foe = 1 + AND ' . $db->sql_in_set('ug.group_id', $groups); + $db->sql_query($sql); + break; + + default: + $sql = 'SELECT user_id + FROM ' . USER_GROUP_TABLE . ' + WHERE ' . $db->sql_in_set('group_id', $groups); + $result = $db->sql_query($sql); + + $users = array(); + while ($row = $db->sql_fetchrow($result)) + { + $users[] = (int) $row['user_id']; + } + $db->sql_freeresult($result); + + if (sizeof($users)) + { + $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' + WHERE ' . $db->sql_in_set('zebra_id', $users) . ' + AND foe = 1'; + $db->sql_query($sql); + } + break; + } + + return; + } + + // update foes for everyone + $perms = array(); + foreach ($auth->acl_get_list(false, array('a_', 'm_'), false) as $forum_id => $forum_ary) + { + foreach ($forum_ary as $auth_option => $user_ary) + { + $perms = array_merge($perms, $user_ary); + } + } + + if (sizeof($perms)) + { + $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' + WHERE ' . $db->sql_in_set('zebra_id', array_unique($perms)) . ' + AND foe = 1'; + $db->sql_query($sql); + } + unset($perms); +} + +/** +* Lists inactive users +*/ +function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $limit_days = 0, $sort_by = 'user_inactive_time DESC') +{ + global $db, $user; + + $sql = 'SELECT COUNT(user_id) AS user_count + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_INACTIVE . + (($limit_days) ? " AND user_inactive_time >= $limit_days" : ''); + $result = $db->sql_query($sql); + $user_count = (int) $db->sql_fetchfield('user_count'); + $db->sql_freeresult($result); + + if ($user_count == 0) + { + // Save the queries, because there are no users to display + return 0; + } + + if ($offset >= $user_count) + { + $offset = ($offset - $limit < 0) ? 0 : $offset - $limit; + } + + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_INACTIVE . + (($limit_days) ? " AND user_inactive_time >= $limit_days" : '') . " + ORDER BY $sort_by"; + $result = $db->sql_query_limit($sql, $limit, $offset); + + while ($row = $db->sql_fetchrow($result)) + { + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_UNKNOWN']; + switch ($row['user_inactive_reason']) + { + case INACTIVE_REGISTER: + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_REGISTER']; + break; + + case INACTIVE_PROFILE: + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_PROFILE']; + break; + + case INACTIVE_MANUAL: + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_MANUAL']; + break; + + case INACTIVE_REMIND: + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_REMIND']; + break; + } + + $users[] = $row; + } + $db->sql_freeresult($result); + + return $offset; +} + +/** +* Lists warned users +*/ +function view_warned_users(&$users, &$user_count, $limit = 0, $offset = 0, $limit_days = 0, $sort_by = 'user_warnings DESC') +{ + global $db; + + $sql = 'SELECT user_id, username, user_colour, user_warnings, user_last_warning + FROM ' . USERS_TABLE . ' + WHERE user_warnings > 0 + ' . (($limit_days) ? "AND user_last_warning >= $limit_days" : '') . " + ORDER BY $sort_by"; + $result = $db->sql_query_limit($sql, $limit, $offset); + $users = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + $sql = 'SELECT count(user_id) AS user_count + FROM ' . USERS_TABLE . ' + WHERE user_warnings > 0 + ' . (($limit_days) ? "AND user_last_warning >= $limit_days" : ''); + $result = $db->sql_query($sql); + $user_count = (int) $db->sql_fetchfield('user_count'); + $db->sql_freeresult($result); + + return; +} + +/** +* Get database size +* Currently only mysql and mssql are supported +*/ +function get_database_size() +{ + global $db, $user, $table_prefix; + + $database_size = false; + + // This code is heavily influenced by a similar routine in phpMyAdmin 2.2.0 + switch ($db->get_sql_layer()) + { + case 'mysql': + case 'mysql4': + case 'mysqli': + $sql = 'SELECT VERSION() AS mysql_version'; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $version = $row['mysql_version']; + + if (preg_match('#(3\.23|[45]\.)#', $version)) + { + $db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.#', $version)) ? "`{$db->get_db_name()}`" : $db->get_db_name(); + + $sql = 'SHOW TABLE STATUS + FROM ' . $db_name; + $result = $db->sql_query($sql, 7200); + + $database_size = 0; + while ($row = $db->sql_fetchrow($result)) + { + if ((isset($row['Type']) && $row['Type'] != 'MRG_MyISAM') || (isset($row['Engine']) && ($row['Engine'] == 'MyISAM' || $row['Engine'] == 'InnoDB'))) + { + if ($table_prefix != '') + { + if (strpos($row['Name'], $table_prefix) !== false) + { + $database_size += $row['Data_length'] + $row['Index_length']; + } + } + else + { + $database_size += $row['Data_length'] + $row['Index_length']; + } + } + } + $db->sql_freeresult($result); + } + } + break; + + case 'sqlite': + case 'sqlite3': + global $dbhost; + + if (file_exists($dbhost)) + { + $database_size = filesize($dbhost); + } + + break; + + case 'mssql': + case 'mssql_odbc': + case 'mssqlnative': + $sql = 'SELECT @@VERSION AS mssql_version'; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $sql = 'SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize + FROM sysfiles'; + + if ($row) + { + // Azure stats are stored elsewhere + if (strpos($row['mssql_version'], 'SQL Azure') !== false) + { + $sql = 'SELECT ((SUM(reserved_page_count) * 8.0) * 1024.0) as dbsize + FROM sys.dm_db_partition_stats'; + } + } + + $result = $db->sql_query($sql, 7200); + $database_size = ($row = $db->sql_fetchrow($result)) ? $row['dbsize'] : false; + $db->sql_freeresult($result); + break; + + case 'postgres': + $sql = "SELECT proname + FROM pg_proc + WHERE proname = 'pg_database_size'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row['proname'] == 'pg_database_size') + { + $database = $db->get_db_name(); + if (strpos($database, '.') !== false) + { + list($database, ) = explode('.', $database); + } + + $sql = "SELECT oid + FROM pg_database + WHERE datname = '$database'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $oid = $row['oid']; + + $sql = 'SELECT pg_database_size(' . $oid . ') as size'; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $database_size = $row['size']; + } + break; + + case 'oracle': + $sql = 'SELECT SUM(bytes) as dbsize + FROM user_segments'; + $result = $db->sql_query($sql, 7200); + $database_size = ($row = $db->sql_fetchrow($result)) ? $row['dbsize'] : false; + $db->sql_freeresult($result); + break; + } + + $database_size = ($database_size !== false) ? get_formatted_filesize($database_size) : $user->lang['NOT_AVAILABLE']; + + 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 +* The duration of a warning can be defined by the administrator +* This only removes the warning and reduces the associated count, +* it does not remove the user note recording the contents of the warning +*/ +function tidy_warnings() +{ + global $db, $config; + + $expire_date = time() - ($config['warnings_expire_days'] * 86400); + $warning_list = $user_list = array(); + + $sql = 'SELECT * FROM ' . WARNINGS_TABLE . " + WHERE warning_time < $expire_date"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $warning_list[] = $row['warning_id']; + $user_list[$row['user_id']] = isset($user_list[$row['user_id']]) ? ++$user_list[$row['user_id']] : 1; + } + $db->sql_freeresult($result); + + if (sizeof($warning_list)) + { + $db->sql_transaction('begin'); + + $sql = 'DELETE FROM ' . WARNINGS_TABLE . ' + WHERE ' . $db->sql_in_set('warning_id', $warning_list); + $db->sql_query($sql); + + foreach ($user_list as $user_id => $value) + { + $sql = 'UPDATE ' . USERS_TABLE . " SET user_warnings = user_warnings - $value + WHERE user_id = $user_id"; + $db->sql_query($sql); + } + + $db->sql_transaction('commit'); + } + + set_config('warnings_last_gc', time(), true); +} + +/** +* Tidy database, doing some maintanance tasks +*/ +function tidy_database() +{ + global $db; + + // Here we check permission consistency + + // Sometimes, it can happen permission tables having forums listed which do not exist + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE; + $result = $db->sql_query($sql); + + $forum_ids = array(0); + while ($row = $db->sql_fetchrow($result)) + { + $forum_ids[] = $row['forum_id']; + } + $db->sql_freeresult($result); + + // Delete those rows from the acl tables not having listed the forums above + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids, true); + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_USERS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids, true); + $db->sql_query($sql); + + set_config('database_last_gc', time(), true); +} + +/** +* Add permission language - this will make sure custom files will be included +*/ +function add_permission_language() +{ + global $user, $phpEx, $phpbb_extension_manager; + + // add permission language files from extensions + $finder = $phpbb_extension_manager->get_finder(); + + $lang_files = $finder + ->prefix('permissions_') + ->suffix(".$phpEx") + ->core_path('language/' . $user->lang_name . '/') + ->extension_directory('/language/' . $user->lang_name) + ->find(); + + foreach ($lang_files as $lang_file => $ext_name) + { + if ($ext_name === '/') + { + $user->add_lang($lang_file); + } + else + { + $user->add_lang_ext($ext_name, $lang_file); + } + } +} + +/** + * Enables a particular flag in a bitfield column of a given table. + * + * @param string $table_name The table to update + * @param string $column_name The column containing a bitfield to update + * @param int $flag The binary flag which is OR-ed with the current column value + * @param string $sql_more This string is attached to the sql query generated to update the table. + * + * @return null + */ +function enable_bitfield_column_flag($table_name, $column_name, $flag, $sql_more = '') +{ + global $db; + + $sql = 'UPDATE ' . $table_name . ' + SET ' . $column_name . ' = ' . $db->sql_bit_or($column_name, $flag) . ' + ' . $sql_more; + $db->sql_query($sql); +} diff --git a/sources/phpBB/includes/functions_compatibility.php b/sources/phpBB/includes/functions_compatibility.php new file mode 100644 index 0000000..43952ae --- /dev/null +++ b/sources/phpBB/includes/functions_compatibility.php @@ -0,0 +1,197 @@ + +* @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; +} + +/** +* Get user avatar +* +* @deprecated 3.1.0-a1 (To be removed: 3.3.0) +* +* @param string $avatar Users assigned avatar name +* @param int $avatar_type Type of avatar +* @param string $avatar_width Width of users avatar +* @param string $avatar_height Height of users avatar +* @param string $alt Optional language string for alt tag within image, can be a language key or text +* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP +* +* @return string Avatar image +*/ +function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false) +{ + // map arguments to new function phpbb_get_avatar() + $row = array( + 'avatar' => $avatar, + 'avatar_type' => $avatar_type, + 'avatar_width' => $avatar_width, + 'avatar_height' => $avatar_height, + ); + + return phpbb_get_avatar($row, $alt, $ignore_config); +} + +/** +* Hash the password +* +* @deprecated 3.1.0-a2 (To be removed: 3.3.0) +* +* @param string $password Password to be hashed +* +* @return string|bool Password hash or false if something went wrong during hashing +*/ +function phpbb_hash($password) +{ + global $phpbb_container; + + $passwords_manager = $phpbb_container->get('passwords.manager'); + return $passwords_manager->hash($password); +} + +/** +* Check for correct password +* +* @deprecated 3.1.0-a2 (To be removed: 3.3.0) +* +* @param string $password The password in plain text +* @param string $hash The stored password hash +* +* @return bool Returns true if the password is correct, false if not. +*/ +function phpbb_check_hash($password, $hash) +{ + global $phpbb_container; + + $passwords_manager = $phpbb_container->get('passwords.manager'); + return $passwords_manager->check($password, $hash); +} + +/** +* Eliminates useless . and .. components from specified path. +* +* Deprecated, use filesystem class instead +* +* @param string $path Path to clean +* @return string Cleaned path +* +* @deprecated +*/ +function phpbb_clean_path($path) +{ + global $phpbb_path_helper, $phpbb_container; + + if (!$phpbb_path_helper && $phpbb_container) + { + $phpbb_path_helper = $phpbb_container->get('path_helper'); + } + else if (!$phpbb_path_helper) + { + global $phpbb_root_path, $phpEx; + + // The container is not yet loaded, use a new instance + if (!class_exists('\phpbb\path_helper')) + { + require($phpbb_root_path . 'phpbb/path_helper.' . $phpEx); + } + + $request = new phpbb\request\request(); + $phpbb_path_helper = new phpbb\path_helper( + new phpbb\symfony_request( + $request + ), + new phpbb\filesystem(), + $request, + $phpbb_root_path, + $phpEx + ); + } + + return $phpbb_path_helper->clean_path($path); +} + +/** +* Pick a timezone +* +* @param string $default A timezone to select +* @param boolean $truncate Shall we truncate the options text +* +* @return string Returns the options for timezone selector only +* +* @deprecated +*/ +function tz_select($default = '', $truncate = false) +{ + global $template, $user; + + return phpbb_timezone_select($template, $user, $default, $truncate); +} + +/** +* Cache moderators. Called whenever permissions are changed +* via admin_permissions. Changes of usernames and group names +* must be carried through for the moderators table. +* +* @deprecated 3.1 +* @return null +*/ +function cache_moderators() +{ + global $db, $cache, $auth; + return phpbb_cache_moderators($db, $cache, $auth); +} + +/** +* Removes moderators and administrators from foe lists. +* +* @deprecated 3.1 +* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore +* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore +* @return null +*/ +function update_foes($group_id = false, $user_id = false) +{ + global $db, $auth; + return phpbb_update_foes($db, $auth, $group_id, $user_id); +} + +/** +* Get user rank title and image +* +* @param int $user_rank the current stored users rank id +* @param int $user_posts the users number of posts +* @param string &$rank_title the rank title will be stored here after execution +* @param string &$rank_img the rank image as full img tag is stored here after execution +* @param string &$rank_img_src the rank image source is stored here after execution +* +* @deprecated 3.1.0-RC5 (To be removed: 3.3.0) +* +* Note: since we do not want to break backwards-compatibility, this function will only properly assign ranks to guests if you call it for them with user_posts == false +*/ +function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src) +{ + global $phpbb_root_path, $phpEx; + if (!function_exists('phpbb_get_user_rank')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } + + $rank_data = phpbb_get_user_rank(array('user_rank' => $user_rank), $user_posts); + $rank_title = $rank_data['title']; + $rank_img = $rank_data['img']; + $rank_img_src = $rank_data['img_src']; +} diff --git a/sources/phpBB/includes/functions_compress.php b/sources/phpBB/includes/functions_compress.php new file mode 100644 index 0000000..a7ee29d --- /dev/null +++ b/sources/phpBB/includes/functions_compress.php @@ -0,0 +1,774 @@ + +* @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; +} + +/** +* Class for handling archives (compression/decompression) +*/ +class compress +{ + var $fp = 0; + + /** + * @var array + */ + protected $filelist = array(); + + /** + * Add file to archive + */ + function add_file($src, $src_rm_prefix = '', $src_add_prefix = '', $skip_files = '') + { + global $phpbb_root_path; + + $skip_files = explode(',', $skip_files); + + // Remove rm prefix from src path + $src_path = ($src_rm_prefix) ? preg_replace('#^(' . preg_quote($src_rm_prefix, '#') . ')#', '', $src) : $src; + // Add src prefix + $src_path = ($src_add_prefix) ? ($src_add_prefix . ((substr($src_add_prefix, -1) != '/') ? '/' : '') . $src_path) : $src_path; + // Remove initial "/" if present + $src_path = (substr($src_path, 0, 1) == '/') ? substr($src_path, 1) : $src_path; + + if (is_file($phpbb_root_path . $src)) + { + $this->data($src_path, file_get_contents("$phpbb_root_path$src"), stat("$phpbb_root_path$src"), false); + } + else if (is_dir($phpbb_root_path . $src)) + { + // Clean up path, add closing / if not present + $src_path = ($src_path && substr($src_path, -1) != '/') ? $src_path . '/' : $src_path; + + $filelist = array(); + $filelist = filelist("$phpbb_root_path$src", '', '*'); + krsort($filelist); + + /** + * Commented out, as adding the folders produces corrupted archives + if ($src_path) + { + $this->data($src_path, '', true, stat("$phpbb_root_path$src")); + } + */ + + foreach ($filelist as $path => $file_ary) + { + /** + * Commented out, as adding the folders produces corrupted archives + if ($path) + { + // Same as for src_path + $path = (substr($path, 0, 1) == '/') ? substr($path, 1) : $path; + $path = ($path && substr($path, -1) != '/') ? $path . '/' : $path; + + $this->data("$src_path$path", '', true, stat("$phpbb_root_path$src$path")); + } + */ + + foreach ($file_ary as $file) + { + if (in_array($path . $file, $skip_files)) + { + continue; + } + + $this->data("$src_path$path$file", file_get_contents("$phpbb_root_path$src$path$file"), stat("$phpbb_root_path$src$path$file"), false); + } + } + } + else + { + // $src does not exist + return false; + } + + return true; + } + + /** + * Add custom file (the filepath will not be adjusted) + */ + function add_custom_file($src, $filename) + { + if (!file_exists($src)) + { + return false; + } + + $this->data($filename, file_get_contents($src), stat($src), false); + return true; + } + + /** + * Add file data + */ + function add_data($src, $name) + { + $stat = array(); + $stat[2] = 436; //384 + $stat[4] = $stat[5] = 0; + $stat[7] = strlen($src); + $stat[9] = time(); + $this->data($name, $src, $stat, false); + return true; + } + + /** + * Checks if a file by that name as already been added and, if it has, + * returns a new, unique name. + * + * @param string $name The filename + * @return string A unique filename + */ + protected function unique_filename($name) + { + if (isset($this->filelist[$name])) + { + $start = $name; + $ext = ''; + $this->filelist[$name]++; + + // Separate the extension off the end of the filename to preserve it + $pos = strrpos($name, '.'); + if ($pos !== false) + { + $start = substr($name, 0, $pos); + $ext = substr($name, $pos); + } + + return $start . '_' . $this->filelist[$name] . $ext; + } + + $this->filelist[$name] = 0; + return $name; + } + + /** + * Return available methods + * + * @return array Array of strings of available compression methods (.tar, .tar.gz, .zip, etc.) + */ + static public function methods() + { + $methods = array('.tar'); + $available_methods = array('.tar.gz' => 'zlib', '.tar.bz2' => 'bz2', '.zip' => 'zlib'); + + foreach ($available_methods as $type => $module) + { + if (!@extension_loaded($module)) + { + continue; + } + $methods[] = $type; + } + + return $methods; + } +} + +/** +* 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 +* +* Modified extensively by psoTFX and DavidMJ, (c) phpBB Limited, 2003 +* +* Based on work by Eric Mueller and Denis125 +* Official ZIP file format: http://www.pkware.com/appnote.txt +*/ +class compress_zip extends compress +{ + var $datasec = array(); + var $ctrl_dir = array(); + var $eof_cdh = "\x50\x4b\x05\x06\x00\x00\x00\x00"; + + var $old_offset = 0; + var $datasec_len = 0; + + /** + * Constructor + */ + function compress_zip($mode, $file) + { + $this->fp = @fopen($file, $mode . 'b'); + + if (!$this->fp) + { + trigger_error('Unable to open file ' . $file . ' [' . $mode . 'b]'); + } + } + + /** + * Convert unix to dos time + */ + function unix_to_dos_time($time) + { + $timearray = (!$time) ? getdate() : getdate($time); + + if ($timearray['year'] < 1980) + { + $timearray['year'] = 1980; + $timearray['mon'] = $timearray['mday'] = 1; + $timearray['hours'] = $timearray['minutes'] = $timearray['seconds'] = 0; + } + + return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) | ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1); + } + + /** + * Extract archive + */ + function extract($dst) + { + // Loop the file, looking for files and folders + $dd_try = false; + rewind($this->fp); + + while (!feof($this->fp)) + { + // Check if the signature is valid... + $signature = fread($this->fp, 4); + + switch ($signature) + { + // 'Local File Header' + case "\x50\x4b\x03\x04": + // Lets get everything we need. + // We don't store the version needed to extract, the general purpose bit flag or the date and time fields + $data = unpack("@4/vc_method/@10/Vcrc/Vc_size/Vuc_size/vname_len/vextra_field", fread($this->fp, 26)); + $file_name = fread($this->fp, $data['name_len']); // filename + + if ($data['extra_field']) + { + fread($this->fp, $data['extra_field']); // extra field + } + + $target_filename = "$dst$file_name"; + + if (!$data['uc_size'] && !$data['crc'] && substr($file_name, -1, 1) == '/') + { + if (!is_dir($target_filename)) + { + $str = ''; + $folders = explode('/', $target_filename); + + // Create and folders and subfolders if they do not exist + foreach ($folders as $folder) + { + $folder = trim($folder); + if (!$folder) + { + continue; + } + + $str = (!empty($str)) ? $str . '/' . $folder : $folder; + if (!is_dir($str)) + { + if (!@mkdir($str, 0777)) + { + trigger_error("Could not create directory $folder"); + } + phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE); + } + } + } + // This is a directory, we are not writting files + continue; + } + else + { + // Some archivers are punks, they don't include folders in their archives! + $str = ''; + $folders = explode('/', pathinfo($target_filename, PATHINFO_DIRNAME)); + + // Create and folders and subfolders if they do not exist + foreach ($folders as $folder) + { + $folder = trim($folder); + if (!$folder) + { + continue; + } + + $str = (!empty($str)) ? $str . '/' . $folder : $folder; + if (!is_dir($str)) + { + if (!@mkdir($str, 0777)) + { + trigger_error("Could not create directory $folder"); + } + phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE); + } + } + } + + if (!$data['uc_size']) + { + $content = ''; + } + else + { + $content = fread($this->fp, $data['c_size']); + } + + $fp = fopen($target_filename, "w"); + + switch ($data['c_method']) + { + case 0: + // Not compressed + fwrite($fp, $content); + break; + + case 8: + // Deflate + fwrite($fp, gzinflate($content, $data['uc_size'])); + break; + + case 12: + // Bzip2 + fwrite($fp, bzdecompress($content)); + break; + } + + fclose($fp); + break; + + // We hit the 'Central Directory Header', we can stop because nothing else in here requires our attention + // or we hit the end of the central directory record, we can safely end the loop as we are totally finished with looking for files and folders + case "\x50\x4b\x01\x02": + // This case should simply never happen.. but it does exist.. + case "\x50\x4b\x05\x06": + break 2; + + // 'Packed to Removable Disk', ignore it and look for the next signature... + case 'PK00': + continue 2; + + // We have encountered a header that is weird. Lets look for better data... + default: + if (!$dd_try) + { + // Unexpected header. Trying to detect wrong placed 'Data Descriptor'; + $dd_try = true; + fseek($this->fp, 8, SEEK_CUR); // Jump over 'crc-32'(4) 'compressed-size'(4), 'uncompressed-size'(4) + continue 2; + } + trigger_error("Unexpected header, ending loop"); + break 2; + } + + $dd_try = false; + } + } + + /** + * Close archive + */ + function close() + { + // Write out central file directory and footer ... if it exists + if (sizeof($this->ctrl_dir)) + { + fwrite($this->fp, $this->file()); + } + fclose($this->fp); + } + + /** + * Create the structures ... note we assume version made by is MSDOS + */ + function data($name, $data, $stat, $is_dir = false) + { + $name = str_replace('\\', '/', $name); + $name = $this->unique_filename($name); + + $hexdtime = pack('V', $this->unix_to_dos_time($stat[9])); + + if ($is_dir) + { + $unc_len = $c_len = $crc = 0; + $zdata = ''; + $var_ext = 10; + } + else + { + $unc_len = strlen($data); + $crc = crc32($data); + $zdata = gzdeflate($data); + $c_len = strlen($zdata); + $var_ext = 20; + + // Did we compress? No, then use data as is + if ($c_len >= $unc_len) + { + $zdata = $data; + $c_len = $unc_len; + $var_ext = 10; + } + } + unset($data); + + // If we didn't compress set method to store, else deflate + $c_method = ($c_len == $unc_len) ? "\x00\x00" : "\x08\x00"; + + // Are we a file or a directory? Set archive for file + $attrib = ($is_dir) ? 16 : 32; + + // File Record Header + $fr = "\x50\x4b\x03\x04"; // Local file header 4bytes + $fr .= pack('v', $var_ext); // ver needed to extract 2bytes + $fr .= "\x00\x00"; // gen purpose bit flag 2bytes + $fr .= $c_method; // compression method 2bytes + $fr .= $hexdtime; // last mod time and date 2+2bytes + $fr .= pack('V', $crc); // crc32 4bytes + $fr .= pack('V', $c_len); // compressed filesize 4bytes + $fr .= pack('V', $unc_len); // uncompressed filesize 4bytes + $fr .= pack('v', strlen($name));// length of filename 2bytes + + $fr .= pack('v', 0); // extra field length 2bytes + $fr .= $name; + $fr .= $zdata; + unset($zdata); + + $this->datasec_len += strlen($fr); + + // Add data to file ... by writing data out incrementally we save some memory + fwrite($this->fp, $fr); + unset($fr); + + // Central Directory Header + $cdrec = "\x50\x4b\x01\x02"; // header 4bytes + $cdrec .= "\x00\x00"; // version made by + $cdrec .= pack('v', $var_ext); // version needed to extract + $cdrec .= "\x00\x00"; // gen purpose bit flag + $cdrec .= $c_method; // compression method + $cdrec .= $hexdtime; // last mod time & date + $cdrec .= pack('V', $crc); // crc32 + $cdrec .= pack('V', $c_len); // compressed filesize + $cdrec .= pack('V', $unc_len); // uncompressed filesize + $cdrec .= pack('v', strlen($name)); // length of filename + $cdrec .= pack('v', 0); // extra field length + $cdrec .= pack('v', 0); // file comment length + $cdrec .= pack('v', 0); // disk number start + $cdrec .= pack('v', 0); // internal file attributes + $cdrec .= pack('V', $attrib); // external file attributes + $cdrec .= pack('V', $this->old_offset); // relative offset of local header + $cdrec .= $name; + + // Save to central directory + $this->ctrl_dir[] = $cdrec; + + $this->old_offset = $this->datasec_len; + } + + /** + * file + */ + function file() + { + $ctrldir = implode('', $this->ctrl_dir); + + return $ctrldir . $this->eof_cdh . + pack('v', sizeof($this->ctrl_dir)) . // total # of entries "on this disk" + pack('v', sizeof($this->ctrl_dir)) . // total # of entries overall + pack('V', strlen($ctrldir)) . // size of central dir + pack('V', $this->datasec_len) . // offset to start of central dir + "\x00\x00"; // .zip file comment length + } + + /** + * Download archive + */ + function download($filename, $download_name = false) + { + global $phpbb_root_path; + + if ($download_name === false) + { + $download_name = $filename; + } + + $mimetype = 'application/zip'; + + header('Cache-Control: private, no-cache'); + header("Content-Type: $mimetype; name=\"$download_name.zip\""); + header("Content-disposition: attachment; filename=$download_name.zip"); + + $fp = @fopen("{$phpbb_root_path}store/$filename.zip", 'rb'); + if ($fp) + { + while ($buffer = fread($fp, 1024)) + { + echo $buffer; + } + fclose($fp); + } + } +} + +/** +* Tar/tar.gz compression routine +* Header/checksum creation derived from tarfile.pl, (c) Tom Horsley, 1994 +*/ +class compress_tar extends compress +{ + var $isgz = false; + var $isbz = false; + var $filename = ''; + var $mode = ''; + var $type = ''; + var $wrote = false; + + /** + * Constructor + */ + function compress_tar($mode, $file, $type = '') + { + $type = (!$type) ? $file : $type; + $this->isgz = preg_match('#(\.tar\.gz|\.tgz)$#', $type); + $this->isbz = preg_match('#\.tar\.bz2$#', $type); + + $this->mode = &$mode; + $this->file = &$file; + $this->type = &$type; + $this->open(); + } + + /** + * Extract archive + */ + function extract($dst) + { + $fzread = ($this->isbz && function_exists('bzread')) ? 'bzread' : (($this->isgz && @extension_loaded('zlib')) ? 'gzread' : 'fread'); + + // Run through the file and grab directory entries + while ($buffer = $fzread($this->fp, 512)) + { + $tmp = unpack('A6magic', substr($buffer, 257, 6)); + + if (trim($tmp['magic']) == 'ustar') + { + $tmp = unpack('A100name', $buffer); + $filename = trim($tmp['name']); + + $tmp = unpack('Atype', substr($buffer, 156, 1)); + $filetype = (int) trim($tmp['type']); + + $tmp = unpack('A12size', substr($buffer, 124, 12)); + $filesize = octdec((int) trim($tmp['size'])); + + $target_filename = "$dst$filename"; + + if ($filetype == 5) + { + if (!is_dir($target_filename)) + { + $str = ''; + $folders = explode('/', $target_filename); + + // Create and folders and subfolders if they do not exist + foreach ($folders as $folder) + { + $folder = trim($folder); + if (!$folder) + { + continue; + } + + $str = (!empty($str)) ? $str . '/' . $folder : $folder; + if (!is_dir($str)) + { + if (!@mkdir($str, 0777)) + { + trigger_error("Could not create directory $folder"); + } + phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE); + } + } + } + } + else if ($filesize >= 0 && ($filetype == 0 || $filetype == "\0")) + { + // Some archivers are punks, they don't properly order the folders in their archives! + $str = ''; + $folders = explode('/', pathinfo($target_filename, PATHINFO_DIRNAME)); + + // Create and folders and subfolders if they do not exist + foreach ($folders as $folder) + { + $folder = trim($folder); + if (!$folder) + { + continue; + } + + $str = (!empty($str)) ? $str . '/' . $folder : $folder; + if (!is_dir($str)) + { + if (!@mkdir($str, 0777)) + { + trigger_error("Could not create directory $folder"); + } + phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE); + } + } + + // Write out the files + if (!($fp = fopen($target_filename, 'wb'))) + { + trigger_error("Couldn't create file $filename"); + } + phpbb_chmod($target_filename, CHMOD_READ); + + // Grab the file contents + fwrite($fp, ($filesize) ? $fzread($this->fp, ($filesize + 511) &~ 511) : '', $filesize); + fclose($fp); + } + } + } + } + + /** + * Close archive + */ + function close() + { + $fzclose = ($this->isbz && function_exists('bzclose')) ? 'bzclose' : (($this->isgz && @extension_loaded('zlib')) ? 'gzclose' : 'fclose'); + + if ($this->wrote) + { + $fzwrite = ($this->isbz && function_exists('bzwrite')) ? 'bzwrite' : (($this->isgz && @extension_loaded('zlib')) ? 'gzwrite' : 'fwrite'); + + // The end of a tar archive ends in two records of all NULLs (1024 bytes of \0) + $fzwrite($this->fp, str_repeat("\0", 1024)); + } + + $fzclose($this->fp); + } + + /** + * Create the structures + */ + function data($name, $data, $stat, $is_dir = false) + { + $name = $this->unique_filename($name); + $this->wrote = true; + $fzwrite = ($this->isbz && function_exists('bzwrite')) ? 'bzwrite' : (($this->isgz && @extension_loaded('zlib')) ? 'gzwrite' : 'fwrite'); + + $typeflag = ($is_dir) ? '5' : ''; + + // This is the header data, it contains all the info we know about the file or folder that we are about to archive + $header = ''; + $header .= pack('a100', $name); // file name + $header .= pack('a8', sprintf("%07o", $stat[2])); // file mode + $header .= pack('a8', sprintf("%07o", $stat[4])); // owner id + $header .= pack('a8', sprintf("%07o", $stat[5])); // group id + $header .= pack('a12', sprintf("%011o", $stat[7])); // file size + $header .= pack('a12', sprintf("%011o", $stat[9])); // last mod time + + // Checksum + $checksum = 0; + for ($i = 0; $i < 148; $i++) + { + $checksum += ord($header[$i]); + } + + // We precompute the rest of the hash, this saves us time in the loop and allows us to insert our hash without resorting to string functions + $checksum += 2415 + (($is_dir) ? 53 : 0); + + $header .= pack('a8', sprintf("%07o", $checksum)); // checksum + $header .= pack('a1', $typeflag); // link indicator + $header .= pack('a100', ''); // name of linked file + $header .= pack('a6', 'ustar'); // ustar indicator + $header .= pack('a2', '00'); // ustar version + $header .= pack('a32', 'Unknown'); // owner name + $header .= pack('a32', 'Unknown'); // group name + $header .= pack('a8', ''); // device major number + $header .= pack('a8', ''); // device minor number + $header .= pack('a155', ''); // filename prefix + $header .= pack('a12', ''); // end + + // This writes the entire file in one shot. Header, followed by data and then null padded to a multiple of 512 + $fzwrite($this->fp, $header . (($stat[7] !== 0 && !$is_dir) ? $data . str_repeat("\0", (($stat[7] + 511) &~ 511) - $stat[7]) : '')); + unset($data); + } + + /** + * Open archive + */ + function open() + { + $fzopen = ($this->isbz && function_exists('bzopen')) ? 'bzopen' : (($this->isgz && @extension_loaded('zlib')) ? 'gzopen' : 'fopen'); + $this->fp = @$fzopen($this->file, $this->mode . (($fzopen == 'bzopen') ? '' : 'b') . (($fzopen == 'gzopen') ? '9' : '')); + + if (!$this->fp) + { + trigger_error('Unable to open file ' . $this->file . ' [' . $fzopen . ' - ' . $this->mode . 'b]'); + } + } + + /** + * Download archive + */ + function download($filename, $download_name = false) + { + global $phpbb_root_path; + + if ($download_name === false) + { + $download_name = $filename; + } + + switch ($this->type) + { + case '.tar': + $mimetype = 'application/x-tar'; + break; + + case '.tar.gz': + $mimetype = 'application/x-gzip'; + break; + + case '.tar.bz2': + $mimetype = 'application/x-bzip2'; + break; + + default: + $mimetype = 'application/octet-stream'; + break; + } + + header('Cache-Control: private, no-cache'); + header("Content-Type: $mimetype; name=\"$download_name$this->type\""); + header("Content-disposition: attachment; filename=$download_name$this->type"); + + $fp = @fopen("{$phpbb_root_path}store/$filename$this->type", 'rb'); + if ($fp) + { + while ($buffer = fread($fp, 1024)) + { + echo $buffer; + } + fclose($fp); + } + } +} diff --git a/sources/phpBB/includes/functions_content.php b/sources/phpBB/includes/functions_content.php new file mode 100644 index 0000000..87cf34b --- /dev/null +++ b/sources/phpBB/includes/functions_content.php @@ -0,0 +1,1621 @@ + +* @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; +} + +/** +* gen_sort_selects() +* make_jumpbox() +* bump_topic_allowed() +* get_context() +* phpbb_clean_search_string() +* decode_message() +* strip_bbcode() +* generate_text_for_display() +* generate_text_for_storage() +* generate_text_for_edit() +* make_clickable_callback() +* make_clickable() +* censor_text() +* bbcode_nl2br() +* smiley_text() +* parse_attachments() +* extension_allowed() +* truncate_string() +* get_username_string() +* class bitfield +*/ + +/** +* Generate sort selection fields +*/ +function 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, $def_st = false, $def_sk = false, $def_sd = false) +{ + global $user; + + $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); + + $sorts = array( + 'st' => array( + 'key' => 'sort_days', + 'default' => $def_st, + 'options' => $limit_days, + 'output' => &$s_limit_days, + ), + + 'sk' => array( + 'key' => 'sort_key', + 'default' => $def_sk, + 'options' => $sort_by_text, + 'output' => &$s_sort_key, + ), + + 'sd' => array( + 'key' => 'sort_dir', + 'default' => $def_sd, + 'options' => $sort_dir_text, + 'output' => &$s_sort_dir, + ), + ); + $u_sort_param = ''; + + foreach ($sorts as $name => $sort_ary) + { + $key = $sort_ary['key']; + $selected = $$sort_ary['key']; + + // Check if the key is selectable. If not, we reset to the default or first key found. + // This ensures the values are always valid. We also set $sort_dir/sort_key/etc. to the + // correct value, else the protection is void. ;) + if (!isset($sort_ary['options'][$selected])) + { + if ($sort_ary['default'] !== false) + { + $selected = $$key = $sort_ary['default']; + } + else + { + @reset($sort_ary['options']); + $selected = $$key = key($sort_ary['options']); + } + } + + $sort_ary['output'] = ''; + + $u_sort_param .= ($selected !== $sort_ary['default']) ? ((strlen($u_sort_param)) ? '&' : '') . "{$name}={$selected}" : ''; + } + + return; +} + +/** +* Generate Jumpbox +*/ +function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false, $force_display = false) +{ + global $config, $auth, $template, $user, $db, $phpbb_path_helper; + + // We only return if the jumpbox is not forced to be displayed (in case it is needed for functionality) + if (!$config['load_jumpbox'] && $force_display === false) + { + return; + } + + $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id + FROM ' . FORUMS_TABLE . ' + ORDER BY left_id ASC'; + $result = $db->sql_query($sql, 600); + + $right = $padding = 0; + $padding_store = array('0' => 0); + $display_jumpbox = false; + $iteration = 0; + + // Sometimes it could happen that forums will be displayed here not be displayed within the index page + // This is the result of forums not displayed at index, having list permissions and a parent of a forum with no permissions. + // If this happens, the padding could be "broken" + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['left_id'] < $right) + { + $padding++; + $padding_store[$row['parent_id']] = $padding; + } + else if ($row['left_id'] > $right + 1) + { + // Ok, if the $padding_store for this parent is empty there is something wrong. For now we will skip over it. + // @todo digging deep to find out "how" this can happen. + $padding = (isset($padding_store[$row['parent_id']])) ? $padding_store[$row['parent_id']] : $padding; + } + + $right = $row['right_id']; + + if ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id'])) + { + // Non-postable forum with no subforums, don't display + continue; + } + + if (!$auth->acl_get('f_list', $row['forum_id'])) + { + // if the user does not have permissions to list this forum skip + continue; + } + + if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id'])) + { + continue; + } + + if (!$display_jumpbox) + { + $template->assign_block_vars('jumpbox_forums', array( + 'FORUM_ID' => ($select_all) ? 0 : -1, + 'FORUM_NAME' => ($select_all) ? $user->lang['ALL_FORUMS'] : $user->lang['SELECT_FORUM'], + 'S_FORUM_COUNT' => $iteration, + 'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)), + )); + + $iteration++; + $display_jumpbox = true; + } + + $template->assign_block_vars('jumpbox_forums', array( + 'FORUM_ID' => $row['forum_id'], + 'FORUM_NAME' => $row['forum_name'], + 'SELECTED' => ($row['forum_id'] == $forum_id) ? ' selected="selected"' : '', + 'S_FORUM_COUNT' => $iteration, + 'S_IS_CAT' => ($row['forum_type'] == FORUM_CAT) ? true : false, + 'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false, + 'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false, + 'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $row['forum_id'])), + )); + + for ($i = 0; $i < $padding; $i++) + { + $template->assign_block_vars('jumpbox_forums.level', array()); + } + $iteration++; + } + $db->sql_freeresult($result); + unset($padding_store); + + $url_parts = $phpbb_path_helper->get_url_parts($action); + + $template->assign_vars(array( + 'S_DISPLAY_JUMPBOX' => $display_jumpbox, + 'S_JUMPBOX_ACTION' => $action, + 'HIDDEN_FIELDS_FOR_JUMPBOX' => build_hidden_fields($url_parts['params']), + )); + + return; +} + +/** +* Bump Topic Check - used by posting and viewtopic +*/ +function bump_topic_allowed($forum_id, $topic_bumped, $last_post_time, $topic_poster, $last_topic_poster) +{ + global $config, $auth, $user; + + // Check permission and make sure the last post was not already bumped + if (!$auth->acl_get('f_bump', $forum_id) || $topic_bumped) + { + return false; + } + + // Check bump time range, is the user really allowed to bump the topic at this time? + $bump_time = ($config['bump_type'] == 'm') ? $config['bump_interval'] * 60 : (($config['bump_type'] == 'h') ? $config['bump_interval'] * 3600 : $config['bump_interval'] * 86400); + + // Check bump time + if ($last_post_time + $bump_time > time()) + { + return false; + } + + // Check bumper, only topic poster and last poster are allowed to bump + if ($topic_poster != $user->data['user_id'] && $last_topic_poster != $user->data['user_id']) + { + return false; + } + + // A bump time of 0 will completely disable the bump feature... not intended but might be useful. + return $bump_time; +} + +/** +* Generates a text with approx. the specified length which contains the specified words and their context +* +* @param string $text The full text from which context shall be extracted +* @param string $words An array of words which should be contained in the result, has to be a valid part of a PCRE pattern (escape with preg_quote!) +* @param int $length The desired length of the resulting text, however the result might be shorter or longer than this value +* +* @return string Context of the specified words separated by "..." +*/ +function get_context($text, $words, $length = 400) +{ + // first replace all whitespaces with single spaces + $text = preg_replace('/ +/', ' ', strtr($text, "\t\n\r\x0C ", ' ')); + + // we need to turn the entities back into their original form, to not cut the message in between them + $entities = array('<', '>', '[', ']', '.', ':', ':'); + $characters = array('<', '>', '[', ']', '.', ':', ':'); + $text = str_replace($entities, $characters, $text); + + $word_indizes = array(); + if (sizeof($words)) + { + $match = ''; + // find the starting indizes of all words + foreach ($words as $word) + { + if ($word) + { + if (preg_match('#(?:[^\w]|^)(' . $word . ')(?:[^\w]|$)#i', $text, $match)) + { + if (empty($match[1])) + { + continue; + } + + $pos = utf8_strpos($text, $match[1]); + if ($pos !== false) + { + $word_indizes[] = $pos; + } + } + } + } + unset($match); + + if (sizeof($word_indizes)) + { + $word_indizes = array_unique($word_indizes); + sort($word_indizes); + + $wordnum = sizeof($word_indizes); + // number of characters on the right and left side of each word + $sequence_length = (int) ($length / (2 * $wordnum)) - 2; + $final_text = ''; + $word = $j = 0; + $final_text_index = -1; + + // cycle through every character in the original text + for ($i = $word_indizes[$word], $n = utf8_strlen($text); $i < $n; $i++) + { + // if the current position is the start of one of the words then append $sequence_length characters to the final text + if (isset($word_indizes[$word]) && ($i == $word_indizes[$word])) + { + if ($final_text_index < $i - $sequence_length - 1) + { + $final_text .= '... ' . preg_replace('#^([^ ]*)#', '', utf8_substr($text, $i - $sequence_length, $sequence_length)); + } + else + { + // if the final text is already nearer to the current word than $sequence_length we only append the text + // from its current index on and distribute the unused length to all other sequenes + $sequence_length += (int) (($final_text_index - $i + $sequence_length + 1) / (2 * $wordnum)); + $final_text .= utf8_substr($text, $final_text_index + 1, $i - $final_text_index - 1); + } + $final_text_index = $i - 1; + + // add the following characters to the final text (see below) + $word++; + $j = 1; + } + + if ($j > 0) + { + // add the character to the final text and increment the sequence counter + $final_text .= utf8_substr($text, $i, 1); + $final_text_index++; + $j++; + + // if this is a whitespace then check whether we are done with this sequence + if (utf8_substr($text, $i, 1) == ' ') + { + // only check whether we have to exit the context generation completely if we haven't already reached the end anyway + if ($i + 4 < $n) + { + if (($j > $sequence_length && $word >= $wordnum) || utf8_strlen($final_text) > $length) + { + $final_text .= ' ...'; + break; + } + } + else + { + // make sure the text really reaches the end + $j -= 4; + } + + // stop context generation and wait for the next word + if ($j > $sequence_length) + { + $j = 0; + } + } + } + } + return str_replace($characters, $entities, $final_text); + } + } + + if (!sizeof($words) || !sizeof($word_indizes)) + { + return str_replace($characters, $entities, ((utf8_strlen($text) >= $length + 3) ? utf8_substr($text, 0, $length) . '...' : $text)); + } +} + +/** +* Cleans a search string by removing single wildcards from it and replacing multiple spaces with a single one. +* +* @param string $search_string The full search string which should be cleaned. +* +* @return string The cleaned search string without any wildcards and multiple spaces. +*/ +function phpbb_clean_search_string($search_string) +{ + // This regular expressions matches every single wildcard. + // That means one after a whitespace or the beginning of the string or one before a whitespace or the end of the string. + $search_string = preg_replace('#(?<=^|\s)\*+(?=\s|$)#', '', $search_string); + $search_string = trim($search_string); + $search_string = preg_replace(array('#\s+#u', '#\*+#u'), array(' ', '*'), $search_string); + return $search_string; +} + +/** +* Decode text whereby text is coming from the db and expected to be pre-parsed content +* We are placing this outside of the message parser because we are often in need of it... +*/ +function decode_message(&$message, $bbcode_uid = '') +{ + global $config; + + if ($bbcode_uid) + { + $match = array('
', "[/*:m:$bbcode_uid]", ":u:$bbcode_uid", ":o:$bbcode_uid", ":$bbcode_uid"); + $replace = array("\n", '', '', '', ''); + } + else + { + $match = array('
'); + $replace = array("\n"); + } + + $message = str_replace($match, $replace, $message); + + $match = get_preg_expression('bbcode_htm'); + $replace = array('\1', '\1', '\2', '\1', '', ''); + + $message = preg_replace($match, $replace, $message); +} + +/** +* Strips all bbcode from a text and returns the plain content +*/ +function strip_bbcode(&$text, $uid = '') +{ + if (!$uid) + { + $uid = '[0-9a-z]{5,}'; + } + + $text = preg_replace("#\[\/?[a-z0-9\*\+\-]+(?:=(?:".*"|[^\]]*))?(?::[a-z])?(\:$uid)\]#", ' ', $text); + + $match = get_preg_expression('bbcode_htm'); + $replace = array('\1', '\1', '\2', '\1', '', ''); + + $text = preg_replace($match, $replace, $text); +} + +/** +* For display of custom parsed text on user-facing pages +* Expects $text to be the value directly from the database (stored value) +*/ +function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text = true) +{ + static $bbcode; + global $phpbb_dispatcher; + + if ($text === '') + { + return ''; + } + + /** + * Use this event to modify the text before it is parsed + * + * @event core.modify_text_for_display_before + * @var string text The text to parse + * @var string uid The BBCode UID + * @var string bitfield The BBCode Bitfield + * @var int flags The BBCode Flags + * @var bool censor_text Whether or not to apply word censors + * @since 3.1.0-a1 + */ + $vars = array('text', 'uid', 'bitfield', 'flags', 'censor_text'); + extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_before', compact($vars))); + + if ($censor_text) + { + $text = censor_text($text); + } + + // 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); + } + + $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 + * + * @event core.modify_text_for_display_after + * @var string text The text to parse + * @var string uid The BBCode UID + * @var string bitfield The BBCode Bitfield + * @var int flags The BBCode Flags + * @since 3.1.0-a1 + */ + $vars = array('text', 'uid', 'bitfield', 'flags'); + extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_after', compact($vars))); + + return $text; +} + +/** +* For parsing custom parsed text to be stored within the database. +* This function additionally returns the uid and bitfield that needs to be stored. +* Expects $text to be the value directly from request_var() and in it's non-parsed form +* +* @param string $text The text to be replaced with the parsed one +* @param string $uid The BBCode uid for this parse +* @param string $bitfield The BBCode bitfield for this parse +* @param int $flags The allow_bbcode, allow_urls and allow_smilies compiled into a single integer. +* @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 +* +* @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) +{ + global $phpbb_root_path, $phpEx, $phpbb_dispatcher; + + /** + * Use this event to modify the text before it is prepared for storage + * + * @event core.modify_text_for_storage_before + * @var string text The text to parse + * @var string uid The BBCode UID + * @var string bitfield The BBCode Bitfield + * @var int flags The BBCode Flags + * @var bool allow_bbcode Whether or not to parse BBCode + * @var bool allow_urls Whether or not to parse URLs + * @var bool allow_smilies Whether or not to parse Smilies + * @since 3.1.0-a1 + */ + $vars = array( + 'text', + 'uid', + 'bitfield', + 'flags', + 'allow_bbcode', + 'allow_urls', + 'allow_smilies', + ); + extract($phpbb_dispatcher->trigger_event('core.modify_text_for_storage_before', compact($vars))); + + $uid = $bitfield = ''; + $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); + + $text = $message_parser->message; + $uid = $message_parser->bbcode_uid; + + // If the bbcode_bitfield is empty, there is no need for the uid to be stored. + if (!$message_parser->bbcode_bitfield) + { + $uid = ''; + } + + $bitfield = $message_parser->bbcode_bitfield; + + /** + * Use this event to modify the text after it is prepared for storage + * + * @event core.modify_text_for_storage_after + * @var string text The text to parse + * @var string uid The BBCode UID + * @var string bitfield The BBCode Bitfield + * @var int flags The BBCode Flags + * @since 3.1.0-a1 + */ + $vars = array('text', 'uid', 'bitfield', 'flags'); + extract($phpbb_dispatcher->trigger_event('core.modify_text_for_storage_after', compact($vars))); + + return $message_parser->warn_msg; +} + +/** +* For decoding custom parsed text for edits as well as extracting the flags +* Expects $text to be the value directly from the database (pre-parsed content) +*/ +function generate_text_for_edit($text, $uid, $flags) +{ + global $phpbb_root_path, $phpEx, $phpbb_dispatcher; + + /** + * Use this event to modify the text before it is decoded for editing + * + * @event core.modify_text_for_edit_before + * @var string text The text to parse + * @var string uid The BBCode UID + * @var int flags The BBCode Flags + * @since 3.1.0-a1 + */ + $vars = array('text', 'uid', 'flags'); + extract($phpbb_dispatcher->trigger_event('core.modify_text_for_edit_before', compact($vars))); + + decode_message($text, $uid); + + /** + * Use this event to modify the text after it is decoded for editing + * + * @event core.modify_text_for_edit_after + * @var string text The text to parse + * @var int flags The BBCode Flags + * @since 3.1.0-a1 + */ + $vars = array('text', 'flags'); + extract($phpbb_dispatcher->trigger_event('core.modify_text_for_edit_after', compact($vars))); + + return array( + 'allow_bbcode' => ($flags & OPTION_FLAG_BBCODE) ? 1 : 0, + 'allow_smilies' => ($flags & OPTION_FLAG_SMILIES) ? 1 : 0, + 'allow_urls' => ($flags & OPTION_FLAG_LINKS) ? 1 : 0, + 'text' => $text + ); +} + +/** +* A subroutine of make_clickable used with preg_replace +* It places correct HTML around an url, shortens the displayed text +* and makes sure no entities are inside URLs +*/ +function make_clickable_callback($type, $whitespace, $url, $relative_url, $class) +{ + $orig_url = $url; + $orig_relative = $relative_url; + $append = ''; + $url = htmlspecialchars_decode($url); + $relative_url = htmlspecialchars_decode($relative_url); + + // make sure no HTML entities were matched + $chars = array('<', '>', '"'); + $split = false; + + foreach ($chars as $char) + { + $next_split = strpos($url, $char); + if ($next_split !== false) + { + $split = ($split !== false) ? min($split, $next_split) : $next_split; + } + } + + if ($split !== false) + { + // an HTML entity was found, so the URL has to end before it + $append = substr($url, $split) . $relative_url; + $url = substr($url, 0, $split); + $relative_url = ''; + } + else if ($relative_url) + { + // same for $relative_url + $split = false; + foreach ($chars as $char) + { + $next_split = strpos($relative_url, $char); + if ($next_split !== false) + { + $split = ($split !== false) ? min($split, $next_split) : $next_split; + } + } + + if ($split !== false) + { + $append = substr($relative_url, $split); + $relative_url = substr($relative_url, 0, $split); + } + } + + // if the last character of the url is a punctuation mark, exclude it from the url + $last_char = ($relative_url) ? $relative_url[strlen($relative_url) - 1] : $url[strlen($url) - 1]; + + switch ($last_char) + { + case '.': + case '?': + case '!': + case ':': + case ',': + $append = $last_char; + if ($relative_url) + { + $relative_url = substr($relative_url, 0, -1); + } + else + { + $url = substr($url, 0, -1); + } + break; + + // set last_char to empty here, so the variable can be used later to + // check whether a character was removed + default: + $last_char = ''; + break; + } + + $short_url = (utf8_strlen($url) > 55) ? utf8_substr($url, 0, 39) . ' ... ' . utf8_substr($url, -10) : $url; + + switch ($type) + { + case MAGIC_URL_LOCAL: + $tag = 'l'; + $relative_url = preg_replace('/[&?]sid=[0-9a-f]{32}$/', '', preg_replace('/([&?])sid=[0-9a-f]{32}&/', '$1', $relative_url)); + $url = $url . '/' . $relative_url; + $text = $relative_url; + + // this url goes to http://domain.tld/path/to/board/ which + // would result in an empty link if treated as local so + // don't touch it and let MAGIC_URL_FULL take care of it. + if (!$relative_url) + { + return $whitespace . $orig_url . '/' . $orig_relative; // slash is taken away by relative url pattern + } + break; + + case MAGIC_URL_FULL: + $tag = 'm'; + $text = $short_url; + break; + + case MAGIC_URL_WWW: + $tag = 'w'; + $url = 'http://' . $url; + $text = $short_url; + break; + + case MAGIC_URL_EMAIL: + $tag = 'e'; + $text = $short_url; + $url = 'mailto:' . $url; + break; + } + + $url = htmlspecialchars($url); + $text = htmlspecialchars($text); + $append = htmlspecialchars($append); + + $html = "$whitespace$text$append"; + + return $html; +} + +/** +* make_clickable function +* +* Replace magic urls of form http://xxx.xxx., www.xxx. and xxx@xxx.xxx. +* Cuts down displayed size of link if over 50 chars, turns absolute links +* into relative versions when the server/script path matches the link +*/ +function make_clickable($text, $server_url = false, $class = 'postlink') +{ + if ($server_url === false) + { + $server_url = generate_board_url(); + } + + static $static_class; + static $magic_url_match_args; + + if (!isset($magic_url_match_args[$server_url]) || $static_class != $class) + { + $static_class = $class; + $class = ($static_class) ? ' class="' . $static_class . '"' : ''; + $local_class = ($static_class) ? ' class="' . $static_class . '-local"' : ''; + + if (!is_array($magic_url_match_args)) + { + $magic_url_match_args = array(); + } + + // relative urls for this board + $magic_url_match_args[$server_url][] = array( + '#(^|[\n\t (>.])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#iu', + MAGIC_URL_LOCAL, + $local_class, + ); + + // matches a xxxx://aaaaa.bbb.cccc. ... + $magic_url_match_args[$server_url][] = array( + '#(^|[\n\t (>.])(' . get_preg_expression('url_inline') . ')#iu', + MAGIC_URL_FULL, + $class, + ); + + // matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing + $magic_url_match_args[$server_url][] = array( + '#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#iu', + MAGIC_URL_WWW, + $class, + ); + + // matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode. + $magic_url_match_args[$server_url][] = array( + '/(^|[\n\t (>])(' . get_preg_expression('email') . ')/iu', + MAGIC_URL_EMAIL, + '', + ); + } + + foreach ($magic_url_match_args[$server_url] as $magic_args) + { + if (preg_match($magic_args[0], $text, $matches)) + { + $text = preg_replace_callback($magic_args[0], function($matches) use ($magic_args) + { + $relative_url = isset($matches[3]) ? $matches[3] : ''; + return make_clickable_callback($magic_args[1], $matches[1], $matches[2], $relative_url, $magic_args[2]); + }, $text); + } + } + + return $text; +} + +/** +* Censoring +*/ +function censor_text($text) +{ + static $censors; + + // Nothing to do? + if ($text === '') + { + return ''; + } + + // We moved the word censor checks in here because we call this function quite often - and then only need to do the check once + if (!isset($censors) || !is_array($censors)) + { + global $config, $user, $auth, $cache; + + // We check here if the user is having viewing censors disabled (and also allowed to do so). + if (!$user->optionget('viewcensors') && $config['allow_nocensors'] && $auth->acl_get('u_chgcensors')) + { + $censors = array(); + } + else + { + $censors = $cache->obtain_word_list(); + } + } + + if (sizeof($censors)) + { + return preg_replace($censors['match'], $censors['replace'], $text); + } + + return $text; +} + +/** +* custom version of nl2br which takes custom BBCodes into account +*/ +function bbcode_nl2br($text) +{ + // custom BBCodes might contain carriage returns so they + // are not converted into
so now revert that + $text = str_replace(array("\n", "\r"), array('
', "\n"), $text); + return $text; +} + +/** +* Smiley processing +*/ +function smiley_text($text, $force_option = false) +{ + global $config, $user, $phpbb_path_helper; + + if ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies')) + { + return preg_replace('##', ''; + } + } + + $filesize = get_formatted_filesize($attachment['filesize'], false); + + $comment = bbcode_nl2br(censor_text($attachment['attach_comment'])); + + $block_array += array( + 'UPLOAD_ICON' => $upload_icon, + 'FILESIZE' => $filesize['value'], + 'SIZE_LANG' => $filesize['unit'], + 'DOWNLOAD_NAME' => utf8_basename($attachment['real_filename']), + 'COMMENT' => $comment, + ); + + $denied = false; + + if (!extension_allowed($forum_id, $attachment['extension'], $extensions)) + { + $denied = true; + + $block_array += array( + 'S_DENIED' => true, + 'DENIED_MESSAGE' => sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']) + ); + } + + if (!$denied) + { + $l_downloaded_viewed = $download_link = ''; + $display_cat = $extensions[$attachment['extension']]['display_cat']; + + if ($display_cat == ATTACHMENT_CATEGORY_IMAGE) + { + if ($attachment['thumbnail']) + { + $display_cat = ATTACHMENT_CATEGORY_THUMB; + } + else + { + if ($config['img_display_inlined']) + { + if ($config['img_link_width'] || $config['img_link_height']) + { + $dimension = @getimagesize($filename); + + // If the dimensions could not be determined or the image being 0x0 we display it as a link for safety purposes + if ($dimension === false || empty($dimension[0]) || empty($dimension[1])) + { + $display_cat = ATTACHMENT_CATEGORY_NONE; + } + else + { + $display_cat = ($dimension[0] <= $config['img_link_width'] && $dimension[1] <= $config['img_link_height']) ? ATTACHMENT_CATEGORY_IMAGE : ATTACHMENT_CATEGORY_NONE; + } + } + } + else + { + $display_cat = ATTACHMENT_CATEGORY_NONE; + } + } + } + + // Make some descisions based on user options being set. + if (($display_cat == ATTACHMENT_CATEGORY_IMAGE || $display_cat == ATTACHMENT_CATEGORY_THUMB) && !$user->optionget('viewimg')) + { + $display_cat = ATTACHMENT_CATEGORY_NONE; + } + + if ($display_cat == ATTACHMENT_CATEGORY_FLASH && !$user->optionget('viewflash')) + { + $display_cat = ATTACHMENT_CATEGORY_NONE; + } + + $download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']); + $l_downloaded_viewed = 'VIEWED_COUNTS'; + + switch ($display_cat) + { + // Images + case ATTACHMENT_CATEGORY_IMAGE: + $inline_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']); + $download_link .= '&mode=view'; + + $block_array += array( + 'S_IMAGE' => true, + 'U_INLINE_LINK' => $inline_link, + ); + + $update_count[] = $attachment['attach_id']; + break; + + // Images, but display Thumbnail + case ATTACHMENT_CATEGORY_THUMB: + $thumbnail_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id'] . '&t=1'); + $download_link .= '&mode=view'; + + $block_array += array( + 'S_THUMBNAIL' => true, + 'THUMB_IMAGE' => $thumbnail_link, + ); + + $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); + + $block_array += array( + 'S_FLASH_FILE' => true, + 'WIDTH' => $width, + 'HEIGHT' => $height, + 'U_VIEW_LINK' => $download_link . '&view=1', + ); + + // Viewed/Heared File ... update the download count + $update_count[] = $attachment['attach_id']; + break; + + default: + $l_downloaded_viewed = 'DOWNLOAD_COUNTS'; + + $block_array += array( + 'S_FILE' => true, + ); + break; + } + + if (!isset($attachment['download_count'])) + { + $attachment['download_count'] = 0; + } + + $block_array += array( + 'U_DOWNLOAD_LINK' => $download_link, + 'L_DOWNLOAD_COUNT' => $user->lang($l_downloaded_viewed, (int) $attachment['download_count']), + ); + } + + /** + * Use this event to modify the attachment template data. + * + * This event is triggered once per attachment. + * + * @event core.parse_attachments_modify_template_data + * @var array attachment Array with attachment data + * @var array block_array Template data of the attachment + * @var int display_cat Attachment category data + * @var string download_link Attachment download link + * @var array extensions Array with attachment extensions data + * @var mixed forum_id The forum id the attachments are displayed in (false if in private message) + * @var bool preview Flag indicating if we are in post preview mode + * @var array update_count Array with attachment ids to update download count + * @since 3.1.0-RC5 + */ + $vars = array( + 'attachment', + 'block_array', + 'display_cat', + 'download_link', + 'extensions', + 'forum_id', + 'preview', + 'update_count', + ); + extract($phpbb_dispatcher->trigger_event('core.parse_attachments_modify_template_data', compact($vars))); + + $template->assign_block_vars('_file', $block_array); + + $compiled_attachments[] = $template->assign_display('attachment_tpl'); + } + + $attachments = $compiled_attachments; + unset($compiled_attachments); + + $tpl_size = sizeof($attachments); + + $unset_tpl = array(); + + preg_match_all('#(.*?)#', $message, $matches, PREG_PATTERN_ORDER); + + $replace = array(); + foreach ($matches[0] as $num => $capture) + { + // Flip index if we are displaying the reverse way + $index = ($config['display_order']) ? ($tpl_size-($matches[1][$num] + 1)) : $matches[1][$num]; + + $replace['from'][] = $matches[0][$num]; + $replace['to'][] = (isset($attachments[$index])) ? $attachments[$index] : sprintf($user->lang['MISSING_INLINE_ATTACHMENT'], $matches[2][array_search($index, $matches[1])]); + + $unset_tpl[] = $index; + } + + if (isset($replace['from'])) + { + $message = str_replace($replace['from'], $replace['to'], $message); + } + + $unset_tpl = array_unique($unset_tpl); + + // Needed to let not display the inlined attachments at the end of the post again + foreach ($unset_tpl as $index) + { + unset($attachments[$index]); + } +} + +/** +* Check if extension is allowed to be posted. +* +* @param mixed $forum_id The forum id to check or false if private message +* @param string $extension The extension to check, for example zip. +* @param array &$extensions The extension array holding the information from the cache (will be obtained if empty) +* +* @return bool False if the extension is not allowed to be posted, else true. +*/ +function extension_allowed($forum_id, $extension, &$extensions) +{ + if (empty($extensions)) + { + global $cache; + $extensions = $cache->obtain_attach_extensions($forum_id); + } + + return (!isset($extensions['_allowed_'][$extension])) ? false : true; +} + +/** +* Truncates string while retaining special characters if going over the max length +* The default max length is 60 at the moment +* The maximum storage length is there to fit the string within the given length. The string may be further truncated due to html entities. +* For example: string given is 'a "quote"' (length: 9), would be a stored as 'a "quote"' (length: 19) +* +* @param string $string The text to truncate to the given length. String is specialchared. +* @param int $max_length Maximum length of string (multibyte character count as 1 char / Html entity count as 1 char) +* @param int $max_store_length Maximum character length of string (multibyte character count as 1 char / Html entity count as entity chars). +* @param bool $allow_reply Allow Re: in front of string +* NOTE: This parameter can cause undesired behavior (returning strings longer than $max_store_length) and is deprecated. +* @param string $append String to be appended +*/ +function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = false, $append = '') +{ + $chars = array(); + + $strip_reply = false; + $stripped = false; + if ($allow_reply && strpos($string, 'Re: ') === 0) + { + $strip_reply = true; + $string = substr($string, 4); + } + + $_chars = utf8_str_split(htmlspecialchars_decode($string)); + $chars = array_map('utf8_htmlspecialchars', $_chars); + + // Now check the length ;) + if (sizeof($chars) > $max_length) + { + // Cut off the last elements from the array + $string = implode('', array_slice($chars, 0, $max_length - utf8_strlen($append))); + $stripped = true; + } + + // Due to specialchars, we may not be able to store the string... + if (utf8_strlen($string) > $max_store_length) + { + // let's split again, we do not want half-baked strings where entities are split + $_chars = utf8_str_split(htmlspecialchars_decode($string)); + $chars = array_map('utf8_htmlspecialchars', $_chars); + + do + { + array_pop($chars); + $string = implode('', $chars); + } + while (!empty($chars) && utf8_strlen($string) > $max_store_length); + } + + if ($strip_reply) + { + $string = 'Re: ' . $string; + } + + if ($append != '' && $stripped) + { + $string = $string . $append; + } + + return $string; +} + +/** +* Get username details for placing into templates. +* This function caches all modes on first call, except for no_profile and anonymous user - determined by $user_id. +* +* @param string $mode Can be profile (for getting an url to the profile), username (for obtaining the username), colour (for obtaining the user colour), full (for obtaining a html string representing a coloured link to the users profile) or no_profile (the same as full but forcing no profile link) +* @param int $user_id The users id +* @param string $username The users name +* @param string $username_colour The users colour +* @param string $guest_username optional parameter to specify the guest username. It will be used in favor of the GUEST language variable then. +* @param string $custom_profile_url optional parameter to specify a profile url. The user id get appended to this url as &u={user_id} +* +* @return string A string consisting of what is wanted based on $mode. +*/ +function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false) +{ + static $_profile_cache; + global $phpbb_dispatcher; + + // We cache some common variables we need within this function + if (empty($_profile_cache)) + { + global $phpbb_root_path, $phpEx; + + $_profile_cache['base_url'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u={USER_ID}'); + $_profile_cache['tpl_noprofile'] = '{USERNAME}'; + $_profile_cache['tpl_noprofile_colour'] = '{USERNAME}'; + $_profile_cache['tpl_profile'] = '{USERNAME}'; + $_profile_cache['tpl_profile_colour'] = '{USERNAME}'; + } + + global $user, $auth; + + // This switch makes sure we only run code required for the mode + switch ($mode) + { + case 'full': + case 'no_profile': + case 'colour': + + // Build correct username colour + $username_colour = ($username_colour) ? '#' . $username_colour : ''; + + // Return colour + if ($mode == 'colour') + { + $username_string = $username_colour; + break; + } + + // no break; + + case 'username': + + // Build correct username + if ($guest_username === false) + { + $username = ($username) ? $username : $user->lang['GUEST']; + } + else + { + $username = ($user_id && $user_id != ANONYMOUS) ? $username : ((!empty($guest_username)) ? $guest_username : $user->lang['GUEST']); + } + + // Return username + if ($mode == 'username') + { + $username_string = $username; + break; + } + + // no break; + + case 'profile': + + // Build correct profile url - only show if not anonymous and permission to view profile if registered user + // For anonymous the link leads to a login page. + if ($user_id && $user_id != ANONYMOUS && ($user->data['user_id'] == ANONYMOUS || $auth->acl_get('u_viewprofile'))) + { + $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : str_replace(array('={USER_ID}', '=%7BUSER_ID%7D'), '=' . (int) $user_id, $_profile_cache['base_url']); + } + else + { + $profile_url = ''; + } + + // Return profile + if ($mode == 'profile') + { + $username_string = $profile_url; + break; + } + + // no break; + } + + if (!isset($username_string)) + { + if (($mode == 'full' && !$profile_url) || $mode == 'no_profile') + { + $username_string = str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']); + } + else + { + $username_string = str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']); + } + } + + /** + * Use this event to change the output of get_username_string() + * + * @event core.modify_username_string + * @var string mode profile|username|colour|full|no_profile + * @var int user_id String or array of additional url + * parameters + * @var string username The user's username + * @var string username_colour The user's colour + * @var string guest_username Optional parameter to specify the + * guest username. + * @var string custom_profile_url Optional parameter to specify a + * profile url. + * @var string username_string The string that has been generated + * @var array _profile_cache Array of original return templates + * @since 3.1.0-a1 + */ + $vars = array( + 'mode', + 'user_id', + 'username', + 'username_colour', + 'guest_username', + 'custom_profile_url', + 'username_string', + '_profile_cache', + ); + extract($phpbb_dispatcher->trigger_event('core.modify_username_string', compact($vars))); + + return $username_string; +} + +/** + * Add an option to the quick-mod tools. + * + * @param string $url The recepting URL for the quickmod actions. + * @param string $option The language key for the value of the option. + * @param string $lang_string The language string to use. + */ +function phpbb_add_quickmod_option($url, $option, $lang_string) +{ + global $template, $user, $phpbb_path_helper; + + $lang_string = $user->lang($lang_string); + $template->assign_block_vars('quickmod', array( + 'VALUE' => $option, + 'TITLE' => $lang_string, + 'LINK' => $phpbb_path_helper->append_url_params($url, array('action' => $option)), + )); +} + +/** +* Concatenate an array into a string list. +* +* @param array $items Array of items to concatenate +* @param object $user The phpBB $user object. +* +* @return string String list. Examples: "A"; "A and B"; "A, B, and C" +*/ +function phpbb_generate_string_list($items, $user) +{ + if (empty($items)) + { + return ''; + } + + $count = sizeof($items); + $last_item = array_pop($items); + $lang_key = 'STRING_LIST_MULTI'; + + if ($count == 1) + { + return $last_item; + } + else if ($count == 2) + { + $lang_key = 'STRING_LIST_SIMPLE'; + } + $list = implode($user->lang['COMMA_SEPARATOR'], $items); + + return $user->lang($lang_key, $list, $last_item); +} + +class bitfield +{ + var $data; + + function bitfield($bitfield = '') + { + $this->data = base64_decode($bitfield); + } + + /** + */ + function get($n) + { + // Get the ($n / 8)th char + $byte = $n >> 3; + + if (strlen($this->data) >= $byte + 1) + { + $c = $this->data[$byte]; + + // Lookup the ($n % 8)th bit of the byte + $bit = 7 - ($n & 7); + return (bool) (ord($c) & (1 << $bit)); + } + else + { + return false; + } + } + + function set($n) + { + $byte = $n >> 3; + $bit = 7 - ($n & 7); + + if (strlen($this->data) >= $byte + 1) + { + $this->data[$byte] = $this->data[$byte] | chr(1 << $bit); + } + else + { + $this->data .= str_repeat("\0", $byte - strlen($this->data)); + $this->data .= chr(1 << $bit); + } + } + + function clear($n) + { + $byte = $n >> 3; + + if (strlen($this->data) >= $byte + 1) + { + $bit = 7 - ($n & 7); + $this->data[$byte] = $this->data[$byte] &~ chr(1 << $bit); + } + } + + function get_blob() + { + return $this->data; + } + + function get_base64() + { + return base64_encode($this->data); + } + + function get_bin() + { + $bin = ''; + $len = strlen($this->data); + + for ($i = 0; $i < $len; ++$i) + { + $bin .= str_pad(decbin(ord($this->data[$i])), 8, '0', STR_PAD_LEFT); + } + + return $bin; + } + + function get_all_set() + { + return array_keys(array_filter(str_split($this->get_bin()))); + } + + function merge($bitfield) + { + $this->data = $this->data | $bitfield->get_blob(); + } +} diff --git a/sources/phpBB/includes/functions_convert.php b/sources/phpBB/includes/functions_convert.php new file mode 100644 index 0000000..61ab472 --- /dev/null +++ b/sources/phpBB/includes/functions_convert.php @@ -0,0 +1,2513 @@ + +* @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; +} + +/** +* Default avatar width/height +* @ignore +*/ +define('DEFAULT_AVATAR_X', 80); +define('DEFAULT_AVATAR_Y', 80); + +// Global functions - all functions can be used by convertors + +// SIMPLE FUNCTIONS + +/** +* Return the preceding value +*/ +function dec($var) +{ + return --$var; +} + +/** +* Return the next value +*/ +function inc($var) +{ + return ++$var; +} + +/** +* Return whether the value is positive +*/ +function is_positive($n) +{ + return ($n > 0) ? 1 : 0; +} + +/** +* Boolean inverse of the value +*/ +function not($var) +{ + return ($var) ? 0 : 1; +} + +/** +* Convert a textual value to it's equivalent boolean value +* +* @param string $str String to convert (converts yes, on, y, 1 and true to boolean true) +* @return boolean The equivalent value +*/ +function str_to_bool($str) +{ + $str = strtolower($str); + return ($str == 'yes' || $str == 'on' || $str == 'y' || $str == 'true' || $str == '1') ? true : false; +} + +/** +* Function to mimic php's empty() function (it is the same) +*/ +function is_empty($mixed) +{ + return empty($mixed); +} + +/** +* Convert the name of a user's primary group to the appropriate equivalent phpBB group id +* +* @param string $status The name of the group +* @return int The group_id corresponding to the equivalent group +*/ +function str_to_primary_group($status) +{ + switch (ucfirst(strtolower($status))) + { + case 'Administrator': + return get_group_id('administrators'); + break; + + case 'Super moderator': + case 'Global moderator': + case 'Moderator': + return get_group_id('global_moderators'); + break; + + case 'Guest': + case 'Anonymous': + return get_group_id('guests'); + break; + + default: + return get_group_id('registered'); + break; + } +} + +/** +* Convert a boolean into the appropriate phpBB constant indicating whether the item is locked +*/ +function is_item_locked($bool) +{ + return ($bool) ? ITEM_LOCKED : ITEM_UNLOCKED; +} + +/** +* Convert a value from days to seconds +*/ +function days_to_seconds($days) +{ + return ($days * 86400); +} + +/** +* Determine whether a user is anonymous and return the appropriate new user_id +*/ +function is_user_anonymous($user_id) +{ + return ($user_id > ANONYMOUS) ? $user_id : ANONYMOUS; +} + +/** +* Generate a key value based on existing values +* +* @param int $pad Amount to add to the maximum value +* @return int Key value +*/ +function auto_id($pad = 0) +{ + global $auto_id, $convert_row; + + if (!empty($convert_row['max_id'])) + { + return $convert_row['max_id'] + $pad; + } + + return $auto_id + $pad; +} + +/** +* Convert a boolean into the appropriate phpBB constant indicating whether the user is active +*/ +function set_user_type($user_active) +{ + return ($user_active) ? USER_NORMAL : USER_INACTIVE; +} + +/** +* Convert a value from minutes to hours +*/ +function minutes_to_hours($minutes) +{ + return ($minutes / 3600); +} + +/** +* Return the group_id for a given group name +*/ +function get_group_id($group_name) +{ + global $db, $group_mapping; + + if (empty($group_mapping)) + { + $sql = 'SELECT group_name, group_id + FROM ' . GROUPS_TABLE; + $result = $db->sql_query($sql); + + $group_mapping = array(); + while ($row = $db->sql_fetchrow($result)) + { + $group_mapping[strtoupper($row['group_name'])] = (int) $row['group_id']; + } + $db->sql_freeresult($result); + } + + if (!sizeof($group_mapping)) + { + add_default_groups(); + return get_group_id($group_name); + } + + if (isset($group_mapping[strtoupper($group_name)])) + { + return $group_mapping[strtoupper($group_name)]; + } + + return $group_mapping['REGISTERED']; +} + +/** +* Generate the email hash stored in the users table +* +* Note: Deprecated, calls should directly go to phpbb_email_hash() +*/ +function gen_email_hash($email) +{ + return phpbb_email_hash($email); +} + +/** +* Convert a boolean into the appropriate phpBB constant indicating whether the topic is locked +*/ +function is_topic_locked($bool) +{ + return (!empty($bool)) ? ITEM_LOCKED : ITEM_UNLOCKED; +} + +/** +* Generate a bbcode_uid value +*/ +function make_uid($timestamp) +{ + static $last_timestamp, $last_uid; + + if (empty($last_timestamp) || $timestamp != $last_timestamp) + { + $last_uid = substr(base_convert(unique_id(), 16, 36), 0, BBCODE_UID_LEN); + } + $last_timestamp = $timestamp; + return $last_uid; +} + + +/** +* Validate a website address +*/ +function validate_website($url) +{ + if ($url === 'http://') + { + return ''; + } + else if (!preg_match('#^[a-z0-9]+://#i', $url) && strlen($url) > 0) + { + return 'http://' . $url; + } + return $url; +} + +/** +* Convert nulls to zeros for fields which allowed a NULL value in the source but not the destination +*/ +function null_to_zero($value) +{ + return ($value === NULL) ? 0 : $value; +} + +/** +* Convert nulls to empty strings for fields which allowed a NULL value in the source but not the destination +*/ +function null_to_str($value) +{ + return ($value === NULL) ? '' : $value; +} + +// EXTENDED FUNCTIONS + +/** +* Get old config value +*/ +function get_config_value($config_name) +{ + static $convert_config; + + if (!isset($convert_config)) + { + $convert_config = get_config(); + } + + if (!isset($convert_config[$config_name])) + { + return false; + } + + return (empty($convert_config[$config_name])) ? '' : $convert_config[$config_name]; +} + +/** +* Convert an IP address from the hexadecimal notation to normal dotted-quad notation +*/ +function decode_ip($int_ip) +{ + if (!$int_ip) + { + return $int_ip; + } + + $hexipbang = explode('.', chunk_split($int_ip, 2, '.')); + + // Any mod changing the way ips are stored? Then we are not able to convert and enter the ip "as is" to not "destroy" anything... + if (sizeof($hexipbang) < 4) + { + return $int_ip; + } + + return hexdec($hexipbang[0]) . '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]); +} + +/** +* Reverse the encoding of wild-carded bans +*/ +function decode_ban_ip($int_ip) +{ + return str_replace('255', '*', decode_ip($int_ip)); +} + +/** +* Determine the MIME-type of a specified filename +* This does not actually inspect the file, but simply uses the file extension +*/ +function mimetype($filename) +{ + if (!preg_match('/\.([a-z0-9]+)$/i', $filename, $m)) + { + return 'application/octet-stream'; + } + + switch (strtolower($m[1])) + { + case 'zip': return 'application/zip'; + case 'jpeg': return 'image/jpeg'; + case 'jpg': return 'image/jpeg'; + case 'jpe': return 'image/jpeg'; + case 'png': return 'image/png'; + case 'gif': return 'image/gif'; + case 'htm': + case 'html': return 'text/html'; + case 'tif': return 'image/tiff'; + case 'tiff': return 'image/tiff'; + case 'ras': return 'image/x-cmu-raster'; + case 'pnm': return 'image/x-portable-anymap'; + case 'pbm': return 'image/x-portable-bitmap'; + case 'pgm': return 'image/x-portable-graymap'; + case 'ppm': return 'image/x-portable-pixmap'; + case 'rgb': return 'image/x-rgb'; + case 'xbm': return 'image/x-xbitmap'; + case 'xpm': return 'image/x-xpixmap'; + case 'xwd': return 'image/x-xwindowdump'; + case 'z': return 'application/x-compress'; + case 'gtar': return 'application/x-gtar'; + case 'tgz': return 'application/x-gtar'; + case 'gz': return 'application/x-gzip'; + case 'tar': return 'application/x-tar'; + case 'xls': return 'application/excel'; + case 'pdf': return 'application/pdf'; + case 'ppt': return 'application/powerpoint'; + case 'rm': return 'application/vnd.rn-realmedia'; + case 'wma': return 'audio/x-ms-wma'; + case 'swf': return 'application/x-shockwave-flash'; + case 'ief': return 'image/ief'; + case 'doc': + case 'dot': + case 'wrd': return 'application/msword'; + case 'ai': + case 'eps': + case 'ps': return 'application/postscript'; + case 'asc': + case 'txt': + case 'c': + case 'cc': + case 'h': + case 'hh': + case 'cpp': + case 'hpp': + case 'php': + case 'php3': return 'text/plain'; + default: return 'application/octet-stream'; + } +} + +/** +* Obtain the dimensions of all remotely hosted avatars +* This should only be called from execute_last +* There can be significant network overhead if there are a large number of remote avatars +* @todo Look at the option of allowing the user to decide whether this is called or to force the dimensions +*/ +function remote_avatar_dims() +{ + global $db; + + $sql = 'SELECT user_id, user_avatar + FROM ' . USERS_TABLE . ' + WHERE user_avatar_type = ' . AVATAR_REMOTE; + $result = $db->sql_query($sql); + + $remote_avatars = array(); + while ($row = $db->sql_fetchrow($result)) + { + $remote_avatars[(int) $row['user_id']] = $row['user_avatar']; + } + $db->sql_freeresult($result); + + foreach ($remote_avatars as $user_id => $avatar) + { + $width = (int) get_remote_avatar_dim($avatar, 0); + $height = (int) get_remote_avatar_dim($avatar, 1); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_avatar_width = ' . (int) $width . ', user_avatar_height = ' . (int) $height . ' + WHERE user_id = ' . $user_id; + $db->sql_query($sql); + } +} + +function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false) +{ + global $config, $convert, $phpbb_root_path, $user; + + $relative_path = empty($convert->convertor['source_path_absolute']); + + // check for trailing slash + if (rtrim($convert->convertor['avatar_gallery_path'], '/') === '') + { + $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_GALLERY_PATH'], 'import_avatar_gallery()'), __LINE__, __FILE__); + } + + $src_path = relative_base(path($convert->convertor['avatar_gallery_path'], $relative_path), $relative_path); + + if (is_dir($src_path)) + { + // Do not die on failure... safe mode restrictions may be in effect. + copy_dir($convert->convertor['avatar_gallery_path'], path($config['avatar_gallery_path']) . $gallery_name, !$subdirs_as_galleries, false, false, $relative_path); + + // only doing 1 level deep. (ibf 1.x) + // notes: ibf has 2 tiers: directly in the avatar directory for base gallery (handled in the above statement), plus subdirs(handled below). + // recursive subdirs ignored. -- i don't know if other forums support recursive galleries. if they do, this following code could be upgraded to be recursive. + if ($subdirs_as_galleries) + { + $dirlist = array(); + if ($handle = @opendir($src_path)) + { + while ($entry = readdir($handle)) + { + if ($entry[0] == '.' || $entry == 'CVS' || $entry == 'index.htm') + { + continue; + } + + if (is_dir($src_path . $entry)) + { + $dirlist[] = $entry; + } + } + closedir($handle); + } + else if ($dir = @dir($src_path)) + { + while ($entry = $dir->read()) + { + if ($entry[0] == '.' || $entry == 'CVS' || $entry == 'index.htm') + { + continue; + } + + if (is_dir($src_path . $entry)) + { + $dirlist[] = $entry; + } + } + $dir->close(); + } + + for ($i = 0; $i < sizeof($dirlist); ++$i) + { + $dir = $dirlist[$i]; + + // Do not die on failure... safe mode restrictions may be in effect. + copy_dir(path($convert->convertor['avatar_gallery_path'], $relative_path) . $dir, path($config['avatar_gallery_path']) . $dir, true, false, false, $relative_path); + } + } + } +} + +function import_attachment_files($category_name = '') +{ + global $config, $convert, $phpbb_root_path, $db, $user; + + $sql = 'SELECT config_value AS upload_path + FROM ' . CONFIG_TABLE . " + WHERE config_name = 'upload_path'"; + $result = $db->sql_query($sql); + $config['upload_path'] = $db->sql_fetchfield('upload_path'); + $db->sql_freeresult($result); + + $relative_path = empty($convert->convertor['source_path_absolute']); + + if (empty($convert->convertor['upload_path'])) + { + $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_UPLOAD_DIR'], 'import_attachment_files()'), __LINE__, __FILE__); + } + + if (is_dir(relative_base(path($convert->convertor['upload_path'], $relative_path), $relative_path))) + { + copy_dir($convert->convertor['upload_path'], path($config['upload_path']) . $category_name, true, false, true, $relative_path); + } +} + +function attachment_forum_perms($forum_id) +{ + if (!is_array($forum_id)) + { + $forum_id = array($forum_id); + } + + return serialize($forum_id); +} + +// base64todec function +// -> from php manual? +function base64_unpack($string) +{ + $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-'; + $base = strlen($chars); + + $length = strlen($string); + $number = 0; + + for ($i = 1; $i <= $length; $i++) + { + $pos = $length - $i; + $operand = strpos($chars, substr($string, $pos, 1)); + $exponent = pow($base, $i-1); + $dec_value = $operand * $exponent; + $number += $dec_value; + } + + return $number; +} + +function _import_check($config_var, $source, $use_target) +{ + global $convert, $config; + + $result = array( + 'orig_source' => $source, + 'copied' => false, + 'relative_path' => (empty($convert->convertor['source_path_absolute'])) ? true : false, + ); + + // copy file will prepend $phpBB_root_path + $target = $config[$config_var] . '/' . utf8_basename(($use_target === false) ? $source : $use_target); + + if (!empty($convert->convertor[$config_var]) && strpos($source, $convert->convertor[$config_var]) !== 0) + { + $source = $convert->convertor[$config_var] . $source; + } + + $result['source'] = $source; + + if (file_exists(relative_base($source, $result['relative_path'], __LINE__, __FILE__))) + { + $result['copied'] = copy_file($source, $target, false, false, $result['relative_path']); + } + + if ($result['copied']) + { + $result['target'] = utf8_basename($target); + } + else + { + $result['target'] = ($use_target !== false) ? $result['orig_source'] : utf8_basename($target); + } + + return $result; +} + +function import_attachment($source, $use_target = false) +{ + if (empty($source)) + { + return ''; + } + + global $convert, $phpbb_root_path, $config, $user; + + // check for trailing slash + if (rtrim($convert->convertor['upload_path'], '/') === '') + { + $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_UPLOAD_DIR'], 'import_attachment()'), __LINE__, __FILE__); + } + + $result = _import_check('upload_path', $source, $use_target); + + if ($result['copied']) + { + // Thumbnails? + if (is_array($convert->convertor['thumbnails'])) + { + $thumb_dir = $convert->convertor['thumbnails'][0]; + $thumb_prefix = $convert->convertor['thumbnails'][1]; + $thumb_source = $thumb_dir . $thumb_prefix . utf8_basename($result['source']); + + if (strpos($thumb_source, $convert->convertor['upload_path']) !== 0) + { + $thumb_source = $convert->convertor['upload_path'] . $thumb_source; + } + $thumb_target = $config['upload_path'] . '/thumb_' . $result['target']; + + if (file_exists(relative_base($thumb_source, $result['relative_path'], __LINE__, __FILE__))) + { + copy_file($thumb_source, $thumb_target, false, false, $result['relative_path']); + } + } + } + + return $result['target']; +} + +function import_rank($source, $use_target = false) +{ + if (empty($source)) + { + return ''; + } + + global $convert, $phpbb_root_path, $config, $user; + + if (!isset($convert->convertor['ranks_path'])) + { + $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_RANKS_PATH'], 'import_rank()'), __LINE__, __FILE__); + } + + $result = _import_check('ranks_path', $source, $use_target); + return $result['target']; +} + +function import_smiley($source, $use_target = false) +{ + if (empty($source)) + { + return ''; + } + + global $convert, $phpbb_root_path, $config, $user; + + // check for trailing slash + if (rtrim($convert->convertor['smilies_path'], '/') === '') + { + $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_SMILIES_PATH'], 'import_smiley()'), __LINE__, __FILE__); + } + + $result = _import_check('smilies_path', $source, $use_target); + return $result['target']; +} + +/* +*/ +function import_avatar($source, $use_target = false, $user_id = false) +{ + if (empty($source) || preg_match('#^https?:#i', $source) || preg_match('#blank\.(gif|png)$#i', $source)) + { + return; + } + + global $convert, $phpbb_root_path, $config, $user; + + // check for trailing slash + if (rtrim($convert->convertor['avatar_path'], '/') === '') + { + $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_AVATAR_PATH'], 'import_avatar()'), __LINE__, __FILE__); + } + + if ($use_target === false && $user_id !== false) + { + $use_target = $config['avatar_salt'] . '_' . $user_id . '.' . substr(strrchr($source, '.'), 1); + } + + $result = _import_check('avatar_path', $source, $use_target); + + return ((!empty($user_id)) ? $user_id : $use_target) . '.' . substr(strrchr($source, '.'), 1); +} + +/** +* @todo all image dimension functions below (there are a *lot*) should get revisited and converted to one or two functions (no more needed, really). +*/ + +/** +* Calculate the size of the specified image +* Called from the following functions for calculating the size of specific image types +*/ +function get_image_dim($source) +{ + if (empty($source)) + { + return array(0, 0); + } + + global $convert; + + $relative_path = empty($convert->convertor['source_path_absolute']); + + if (file_exists(relative_base($source, $relative_path))) + { + $image = relative_base($source, $relative_path); + return @getimagesize($image); + } + + return false; +} + +/** +* Obtain the width of the specified smilie +*/ +function get_smiley_width($src) +{ + return get_smiley_dim($src, 0); +} + +/** +* Obtain the height of the specified smilie +*/ +function get_smiley_height($src) +{ + return get_smiley_dim($src, 1); +} + +/** +* Obtain the size of the specified smilie (using the cache if possible) and cache the value +*/ +function get_smiley_dim($source, $axis) +{ + if (empty($source)) + { + return 15; + } + + static $smiley_cache = array(); + + if (isset($smiley_cache[$source])) + { + return $smiley_cache[$source][$axis]; + } + + global $convert, $phpbb_root_path, $config, $user; + + $orig_source = $source; + + if (!isset($convert->convertor['smilies_path'])) + { + $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_SMILIES_PATH'], 'get_smiley_dim()'), __LINE__, __FILE__); + } + + if (!empty($convert->convertor['smilies_path']) && strpos($source, $convert->convertor['smilies_path']) !== 0) + { + $source = $convert->convertor['smilies_path'] . $source; + } + + $smiley_cache[$orig_source] = get_image_dim($source); + + if (empty($smiley_cache[$orig_source]) || empty($smiley_cache[$orig_source][0]) || empty($smiley_cache[$orig_source][1])) + { + $smiley_cache[$orig_source] = array(15, 15); + return 15; + } + + return $smiley_cache[$orig_source][$axis]; +} + +/** +* Obtain the width of the specified avatar +*/ +function get_avatar_width($src, $func = false, $arg1 = false, $arg2 = false) +{ + return get_avatar_dim($src, 0, $func, $arg1, $arg2); +} + +/** +* Obtain the height of the specified avatar +*/ +function get_avatar_height($src, $func = false, $arg1 = false, $arg2 = false) +{ + return get_avatar_dim($src, 1, $func, $arg1, $arg2); +} + +/** +*/ +function get_avatar_dim($src, $axis, $func = false, $arg1 = false, $arg2 = false) +{ + $avatar_type = AVATAR_UPLOAD; + + if ($func) + { + if ($arg1 || $arg2) + { + $ary = array($arg1); + + if ($arg2) + { + $ary[] = $arg2; + } + + $avatar_type = call_user_func_array($func, $ary); + } + else + { + $avatar_type = call_user_func($func); + } + } + + switch ($avatar_type) + { + case AVATAR_UPLOAD: + return get_upload_avatar_dim($src, $axis); + break; + + case AVATAR_GALLERY: + return get_gallery_avatar_dim($src, $axis); + break; + + case AVATAR_REMOTE: + // see notes on this functions usage and (hopefully) model $func to avoid this accordingly + return get_remote_avatar_dim($src, $axis); + break; + + default: + $default_x = (defined('DEFAULT_AVATAR_X_CUSTOM')) ? DEFAULT_AVATAR_X_CUSTOM : DEFAULT_AVATAR_X; + $default_y = (defined('DEFAULT_AVATAR_Y_CUSTOM')) ? DEFAULT_AVATAR_Y_CUSTOM : DEFAULT_AVATAR_Y; + + return $axis ? $default_y : $default_x; + break; + } +} + +/** +* Obtain the size of the specified uploaded avatar (using the cache if possible) and cache the value +*/ +function get_upload_avatar_dim($source, $axis) +{ + static $cachedims = false; + static $cachekey = false; + + if (empty($source)) + { + return 0; + } + + if ($cachekey == $source) + { + return $cachedims[$axis]; + } + + $orig_source = $source; + + if (substr($source, 0, 7) == 'upload:') + { + $source = substr($source, 7); + } + + global $convert, $phpbb_root_path, $config, $user; + + if (!isset($convert->convertor['avatar_path'])) + { + $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_AVATAR_PATH'], 'get_upload_avatar_dim()'), __LINE__, __FILE__); + } + + if (!empty($convert->convertor['avatar_path']) && strpos($source, $convert->convertor['avatar_path']) !== 0) + { + $source = path($convert->convertor['avatar_path'], empty($convert->convertor['source_path_absolute'])) . $source; + } + + $cachedims = get_image_dim($source); + + if (empty($cachedims) || empty($cachedims[0]) || empty($cachedims[1])) + { + $default_x = (defined('DEFAULT_AVATAR_X_CUSTOM')) ? DEFAULT_AVATAR_X_CUSTOM : DEFAULT_AVATAR_X; + $default_y = (defined('DEFAULT_AVATAR_Y_CUSTOM')) ? DEFAULT_AVATAR_Y_CUSTOM : DEFAULT_AVATAR_Y; + + $cachedims = array($default_x, $default_y); + } + + return $cachedims[$axis]; +} + +/** +* Obtain the size of the specified gallery avatar (using the cache if possible) and cache the value +*/ +function get_gallery_avatar_dim($source, $axis) +{ + if (empty($source)) + { + return 0; + } + + static $avatar_cache = array(); + + if (isset($avatar_cache[$source])) + { + return $avatar_cache[$source][$axis]; + } + + global $convert, $phpbb_root_path, $config, $user; + + $orig_source = $source; + + if (!isset($convert->convertor['avatar_gallery_path'])) + { + $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_GALLERY_PATH'], 'get_gallery_avatar_dim()'), __LINE__, __FILE__); + } + + if (!empty($convert->convertor['avatar_gallery_path']) && strpos($source, $convert->convertor['avatar_gallery_path']) !== 0) + { + $source = path($convert->convertor['avatar_gallery_path'], empty($convert->convertor['source_path_absolute'])) . $source; + } + + $avatar_cache[$orig_source] = get_image_dim($source); + + if (empty($avatar_cache[$orig_source]) || empty($avatar_cache[$orig_source][0]) || empty($avatar_cache[$orig_source][1])) + { + $default_x = (defined('DEFAULT_AVATAR_X_CUSTOM')) ? DEFAULT_AVATAR_X_CUSTOM : DEFAULT_AVATAR_X; + $default_y = (defined('DEFAULT_AVATAR_Y_CUSTOM')) ? DEFAULT_AVATAR_Y_CUSTOM : DEFAULT_AVATAR_Y; + + $avatar_cache[$orig_source] = array($default_x, $default_y); + } + + return $avatar_cache[$orig_source][$axis]; +} + +/** +* Obtain the size of the specified remote avatar (using the cache if possible) and cache the value +* Whilst it's unlikely that remote avatars will be duplicated, it is possible so caching seems the best option +* This should only be called from a post processing step due to the possibility of network timeouts +*/ +function get_remote_avatar_dim($src, $axis) +{ + if (empty($src)) + { + return 0; + } + + static $remote_avatar_cache = array(); + + // an ugly hack: we assume that the dimensions of each remote avatar are accessed exactly twice (x and y) + if (isset($remote_avatar_cache[$src])) + { + $retval = $remote_avatar_cache[$src][$axis]; + unset($remote_avatar_cache); + return $retval; + } + + $url_info = @parse_url($src); + if (empty($url_info['host'])) + { + return 0; + } + $host = $url_info['host']; + $port = (isset($url_info['port'])) ? $url_info['port'] : 0; + $protocol = (isset($url_info['scheme'])) ? $url_info['scheme'] : 'http'; + if (empty($port)) + { + switch(strtolower($protocol)) + { + case 'ftp': + $port = 21; + break; + + case 'https': + $port = 443; + break; + + default: + $port = 80; + } + } + + $timeout = @ini_get('default_socket_timeout'); + @ini_set('default_socket_timeout', 2); + + // We're just trying to reach the server to avoid timeouts + $fp = @fsockopen($host, $port, $errno, $errstr, 1); + if ($fp) + { + $remote_avatar_cache[$src] = @getimagesize($src); + fclose($fp); + } + + $default_x = (defined('DEFAULT_AVATAR_X_CUSTOM')) ? DEFAULT_AVATAR_X_CUSTOM : DEFAULT_AVATAR_X; + $default_y = (defined('DEFAULT_AVATAR_Y_CUSTOM')) ? DEFAULT_AVATAR_Y_CUSTOM : DEFAULT_AVATAR_Y; + $default = array($default_x, $default_y); + + if (empty($remote_avatar_cache[$src]) || empty($remote_avatar_cache[$src][0]) || empty($remote_avatar_cache[$src][1])) + { + $remote_avatar_cache[$src] = $default; + } + else + { + // We trust gallery and uploaded avatars to conform to the size settings; we might have to adjust here + if ($remote_avatar_cache[$src][0] > $default_x || $remote_avatar_cache[$src][1] > $default_y) + { + $bigger = ($remote_avatar_cache[$src][0] > $remote_avatar_cache[$src][1]) ? 0 : 1; + $ratio = $default[$bigger] / $remote_avatar_cache[$src][$bigger]; + $remote_avatar_cache[$src][0] = (int) ($remote_avatar_cache[$src][0] * $ratio); + $remote_avatar_cache[$src][1] = (int) ($remote_avatar_cache[$src][1] * $ratio); + } + } + + @ini_set('default_socket_timeout', $timeout); + return $remote_avatar_cache[$src][$axis]; +} + +function set_user_options() +{ + global $convert_row; + + // Key need to be set in row, else default value is chosen + $keyoptions = array( + 'viewimg' => array('bit' => 0, 'default' => 1), + 'viewflash' => array('bit' => 1, 'default' => 1), + 'viewsmilies' => array('bit' => 2, 'default' => 1), + 'viewsigs' => array('bit' => 3, 'default' => 1), + 'viewavatars' => array('bit' => 4, 'default' => 1), + 'viewcensors' => array('bit' => 5, 'default' => 1), + 'attachsig' => array('bit' => 6, 'default' => 0), + 'bbcode' => array('bit' => 8, 'default' => 1), + 'smilies' => array('bit' => 9, 'default' => 1), + 'sig_bbcode' => array('bit' => 15, 'default' => 1), + 'sig_smilies' => array('bit' => 16, 'default' => 1), + 'sig_links' => array('bit' => 17, 'default' => 1), + ); + + $option_field = 0; + + foreach ($keyoptions as $key => $key_ary) + { + $value = (isset($convert_row[$key])) ? (int) $convert_row[$key] : $key_ary['default']; + + if ($value && !($option_field & 1 << $key_ary['bit'])) + { + $option_field += 1 << $key_ary['bit']; + } + } + + return $option_field; +} + +/** +* Index messages on the fly as we convert them +* @todo naderman, can you check that this works with the new search plugins as it's use is currently disabled (and thus untested) +function search_indexing($message = '') +{ + global $fulltext_search, $convert_row; + + if (!isset($convert_row['post_id'])) + { + return; + } + + if (!$message) + { + if (!isset($convert_row['message'])) + { + return; + } + + $message = $convert_row['message']; + } + + $title = (isset($convert_row['title'])) ? $convert_row['title'] : ''; + + $fulltext_search->index('post', $convert_row['post_id'], $message, $title, $convert_row['poster_id'], $convert_row['forum_id']); +} +*/ + +function make_unique_filename($filename) +{ + if (!strlen($filename)) + { + $filename = md5(unique_id()) . '.dat'; + } + else if ($filename[0] == '.') + { + $filename = md5(unique_id()) . $filename; + } + else if (preg_match('/\.([a-z]+)$/i', $filename, $m)) + { + $filename = preg_replace('/\.([a-z]+)$/i', '_' . md5(unique_id()) . '.\1', $filename); + } + else + { + $filename .= '_' . md5(unique_id()) . '.dat'; + } + + return $filename; +} + +function words_unique(&$words) +{ + reset($words); + $return_array = array(); + + $word = current($words); + do + { + $return_array[$word] = $word; + } + while ($word = next($words)); + + return $return_array; +} + +/** +* Adds a user to the specified group and optionally makes them a group leader +* This function does not create the group if it does not exist and so should only be called after the groups have been created +*/ +function add_user_group($group_id, $user_id, $group_leader = false) +{ + global $convert, $phpbb_root_path, $config, $user, $db; + + $sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'group_id' => $group_id, + 'user_id' => $user_id, + 'group_leader' => ($group_leader) ? 1 : 0, + 'user_pending' => 0)); + $db->sql_query($sql); +} + +// STANDALONE FUNCTIONS + +/** +* Add users to the pre-defined "special" groups +* +* @param string $group The name of the special group to add to +* @param string $select_query An SQL query to retrieve the user(s) to add to the group +*/ +function user_group_auth($group, $select_query, $use_src_db) +{ + global $convert, $phpbb_root_path, $config, $user, $db, $src_db, $same_db; + + if (!in_array($group, array('guests', 'registered', 'registered_coppa', 'global_moderators', 'administrators', 'bots'))) + { + $convert->p_master->error(sprintf($user->lang['CONV_ERROR_WRONG_GROUP'], $group, 'user_group_auth()'), __LINE__, __FILE__, true); + return; + } + + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = '" . $db->sql_escape(strtoupper($group)) . "'"; + $result = $db->sql_query($sql); + $group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); + + if (!$group_id) + { + $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_GROUP'], $group, 'user_group_auth()'), __LINE__, __FILE__, true); + return; + } + + if ($same_db || !$use_src_db) + { + $sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' (user_id, group_id, user_pending) + ' . str_replace('{' . strtoupper($group) . '}', $group_id . ', 0', $select_query); + $db->sql_query($sql); + } + else + { + $result = $src_db->sql_query(str_replace('{' . strtoupper($group) . '}', $group_id . ' ', $select_query)); + while ($row = $src_db->sql_fetchrow($result)) + { + // this might become quite a lot of INSERTS unfortunately + $sql = 'INSERT INTO ' . USER_GROUP_TABLE . " (user_id, group_id, user_pending) + VALUES ({$row['user_id']}, $group_id, 0)"; + $db->sql_query($sql); + } + $src_db->sql_freeresult($result); + } +} + +/** +* Retrieves configuration information from the source forum and caches it as an array +* Both database and file driven configuration formats can be handled +* (the type used is specified in $config_schema, see convert_phpbb20.php for more details) +*/ +function get_config() +{ + static $convert_config; + global $user; + + if (isset($convert_config)) + { + return $convert_config; + } + + global $src_db, $same_db, $phpbb_root_path, $config; + global $convert; + + if ($convert->config_schema['table_format'] != 'file') + { + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'binary'"); + } + + $sql = 'SELECT * FROM ' . $convert->src_table_prefix . $convert->config_schema['table_name']; + $result = $src_db->sql_query($sql); + $row = $src_db->sql_fetchrow($result); + + if (!$row) + { + $convert->p_master->error($user->lang['CONV_ERROR_GET_CONFIG'], __LINE__, __FILE__); + } + } + + if (is_array($convert->config_schema['table_format'])) + { + $convert_config = array(); + list($key, $val) = each($convert->config_schema['table_format']); + + do + { + $convert_config[$row[$key]] = $row[$val]; + } + while ($row = $src_db->sql_fetchrow($result)); + $src_db->sql_freeresult($result); + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'utf8'"); + } + } + else if ($convert->config_schema['table_format'] == 'file') + { + $filename = $convert->options['forum_path'] . '/' . $convert->config_schema['filename']; + if (!file_exists($filename)) + { + $convert->p_master->error($user->lang('FILE_NOT_FOUND', $filename), __LINE__, __FILE__); + } + + if (isset($convert->config_schema['array_name'])) + { + unset($convert->config_schema['array_name']); + } + + $convert_config = extract_variables_from_file($filename); + if (!empty($convert->config_schema['array_name'])) + { + $convert_config = $convert_config[$convert->config_schema['array_name']]; + } + } + else + { + $convert_config = $row; + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'utf8'"); + } + } + + if (!sizeof($convert_config)) + { + $convert->p_master->error($user->lang['CONV_ERROR_CONFIG_EMPTY'], __LINE__, __FILE__); + } + + return $convert_config; +} + +/** +* Transfers the relevant configuration information from the source forum +* The mapping of fields is specified in $config_schema, see convert_phpbb20.php for more details +*/ +function restore_config($schema) +{ + global $db, $config; + + $convert_config = get_config(); + + foreach ($schema['settings'] as $config_name => $src) + { + if (preg_match('/(.*)\((.*)\)/', $src, $m)) + { + $var = (empty($m[2]) || empty($convert_config[$m[2]])) ? "''" : "'" . addslashes($convert_config[$m[2]]) . "'"; + $exec = '$config_value = ' . $m[1] . '(' . $var . ');'; + // @codingStandardsIgnoreStart + eval($exec); + // @codingStandardsIgnoreEnd + } + else + { + if ($schema['table_format'] != 'file' || empty($schema['array_name'])) + { + $config_value = (isset($convert_config[$src])) ? $convert_config[$src] : ''; + } + else if (!empty($schema['array_name'])) + { + $src_ary = $schema['array_name']; + $config_value = (isset($convert_config[$src_ary][$src])) ? $convert_config[$src_ary][$src] : ''; + } + } + + if ($config_value !== '') + { + // Most are... + if (is_string($config_value)) + { + $config_value = truncate_string(utf8_htmlspecialchars($config_value), 255, 255, false); + } + + set_config($config_name, $config_value); + } + } +} + +/** +* Update the count of PM's in custom folders for all users +*/ +function update_folder_pm_count() +{ + global $db, $convert, $user; + + $sql = 'SELECT user_id, folder_id, COUNT(msg_id) as num_messages + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE folder_id NOT IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ', ' . PRIVMSGS_INBOX . ', ' . PRIVMSGS_OUTBOX . ', ' . PRIVMSGS_SENTBOX . ') + GROUP BY folder_id, user_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $db->sql_query('UPDATE ' . PRIVMSGS_FOLDER_TABLE . ' SET pm_count = ' . $row['num_messages'] . ' + WHERE user_id = ' . $row['user_id'] . ' AND folder_id = ' . $row['folder_id']); + } + $db->sql_freeresult($result); +} + +// Functions mainly used by the main convertor script + +function path($path, $path_relative = true) +{ + if ($path === false) + { + return ''; + } + + if (substr($path, -1) != '/') + { + $path .= '/'; + } + + if (!$path_relative) + { + return $path; + } + + if (substr($path, 0, 1) == '/') + { + $path = substr($path, 1); + } + + return $path; +} + +/** +* Extract the variables defined in a configuration file +* @todo As noted by Xore we need to look at this from a security perspective +*/ +function extract_variables_from_file($_filename) +{ + include($_filename); + + $vars = get_defined_vars(); + unset($vars['_filename']); + + return $vars; +} + +function get_path($src_path, $src_url, $test_file) +{ + global $config, $phpbb_root_path, $phpEx; + + $board_config = get_config(); + + $test_file = preg_replace('/\.php$/i', ".$phpEx", $test_file); + $src_path = path($src_path); + + if (@file_exists($phpbb_root_path . $src_path . $test_file)) + { + return $src_path; + } + + if (!empty($src_url) && !empty($board_config['server_name'])) + { + if (!preg_match('#https?://([^/]+)(.*)#i', $src_url, $m)) + { + return false; + } + + if ($m[1] != $board_config['server_name']) + { + return false; + } + + $url_parts = explode('/', $m[2]); + if (substr($src_url, -1) != '/') + { + if (preg_match('/.*\.([a-z0-9]{3,4})$/i', $url_parts[sizeof($url_parts) - 1])) + { + $url_parts[sizeof($url_parts) - 1] = ''; + } + else + { + $url_parts[] = ''; + } + } + + $script_path = $board_config['script_path']; + if (substr($script_path, -1) == '/') + { + $script_path = substr($script_path, 0, -1); + } + + $path_array = array(); + + $phpbb_parts = explode('/', $script_path); + for ($i = 0; $i < sizeof($url_parts); ++$i) + { + if ($i < sizeof($phpbb_parts[$i]) && $url_parts[$i] == $phpbb_parts[$i]) + { + $path_array[] = $url_parts[$i]; + unset($url_parts[$i]); + } + else + { + $path = ''; + for ($j = $i; $j < sizeof($phpbb_parts); ++$j) + { + $path .= '../'; + } + $path .= implode('/', $url_parts); + break; + } + } + + if (!empty($path)) + { + if (@file_exists($phpbb_root_path . $path . $test_file)) + { + return $path; + } + } + } + + return false; +} + +function compare_table($tables, $tablename, &$prefixes) +{ + for ($i = 0, $table_size = sizeof($tables); $i < $table_size; ++$i) + { + if (preg_match('/(.*)' . $tables[$i] . '$/', $tablename, $m)) + { + if (empty($m[1])) + { + $m[1] = '*'; + } + + if (isset($prefixes[$m[1]])) + { + $prefixes[$m[1]]++; + } + else + { + $prefixes[$m[1]] = 1; + } + } + } +} + +/** +* Grant permissions to a specified user or group +* +* @param string $ug_type user|group|user_role|group_role +* @param mixed $forum_id forum ids (array|int|0) -> 0 == all forums +* @param mixed $ug_id [int] user_id|group_id : [string] usergroup name +* @param mixed $acl_list [string] acl entry : [array] acl entries : [string] role entry +* @param int $setting ACL_YES|ACL_NO|ACL_NEVER +*/ +function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting = ACL_NO) +{ + global $db, $convert, $user, $config; + static $acl_option_ids, $group_ids; + + if (($ug_type == 'group' || $ug_type == 'group_role') && is_string($ug_id)) + { + if (!isset($group_ids[$ug_id])) + { + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = '" . $db->sql_escape(strtoupper($ug_id)) . "'"; + $result = $db->sql_query_limit($sql, 1); + $id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); + + if (!$id) + { + return; + } + + $group_ids[$ug_id] = $id; + } + + $ug_id = (int) $group_ids[$ug_id]; + } + + $table = ($ug_type == 'user' || $ug_type == 'user_role') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE; + $id_field = ($ug_type == 'user' || $ug_type == 'user_role') ? 'user_id' : 'group_id'; + + // Role based permissions are the simplest to handle so check for them first + if ($ug_type == 'user_role' || $ug_type == 'group_role') + { + if (is_numeric($forum_id)) + { + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_name = 'ROLE_" . $db->sql_escape($acl_list) . "'"; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + // If we have no role id there is something wrong here + if ($row) + { + $sql = "INSERT INTO $table ($id_field, forum_id, auth_role_id) VALUES ($ug_id, $forum_id, " . $row['role_id'] . ')'; + $db->sql_query($sql); + } + } + + return; + } + + // Build correct parameters + $auth = array(); + + if (!is_array($acl_list)) + { + $auth = array($acl_list => $setting); + } + else + { + foreach ($acl_list as $auth_option) + { + $auth[$auth_option] = $setting; + } + } + unset($acl_list); + + if (!is_array($forum_id)) + { + $forum_id = array($forum_id); + } + + // Set any flags as required + foreach ($auth as $auth_option => $acl_setting) + { + $flag = substr($auth_option, 0, strpos($auth_option, '_') + 1); + if (empty($auth[$flag])) + { + $auth[$flag] = $acl_setting; + } + } + + if (!is_array($acl_option_ids) || empty($acl_option_ids)) + { + $sql = 'SELECT auth_option_id, auth_option + FROM ' . ACL_OPTIONS_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $acl_option_ids[$row['auth_option']] = $row['auth_option_id']; + } + $db->sql_freeresult($result); + } + + $sql_forum = 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id), false, true); + + $sql = ($ug_type == 'user') ? 'SELECT o.auth_option_id, o.auth_option, a.forum_id, a.auth_setting FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . " o WHERE a.auth_option_id = o.auth_option_id $sql_forum AND a.user_id = $ug_id" : 'SELECT o.auth_option_id, o.auth_option, a.forum_id, a.auth_setting FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . " o WHERE a.auth_option_id = o.auth_option_id $sql_forum AND a.group_id = $ug_id"; + $result = $db->sql_query($sql); + + $cur_auth = array(); + while ($row = $db->sql_fetchrow($result)) + { + $cur_auth[$row['forum_id']][$row['auth_option_id']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + + $sql_ary = array(); + foreach ($forum_id as $forum) + { + foreach ($auth as $auth_option => $setting) + { + $auth_option_id = $acl_option_ids[$auth_option]; + + if (!$auth_option_id) + { + continue; + } + + switch ($setting) + { + case ACL_NO: + if (isset($cur_auth[$forum][$auth_option_id])) + { + $sql_ary['delete'][] = "DELETE FROM $table + WHERE forum_id = $forum + AND auth_option_id = $auth_option_id + AND $id_field = $ug_id"; + } + break; + + default: + if (!isset($cur_auth[$forum][$auth_option_id])) + { + $sql_ary['insert'][] = "$ug_id, $forum, $auth_option_id, $setting"; + } + else if ($cur_auth[$forum][$auth_option_id] != $setting) + { + $sql_ary['update'][] = "UPDATE " . $table . " + SET auth_setting = $setting + WHERE $id_field = $ug_id + AND forum_id = $forum + AND auth_option_id = $auth_option_id"; + } + } + } + } + unset($cur_auth); + + $sql = ''; + foreach ($sql_ary as $sql_type => $sql_subary) + { + switch ($sql_type) + { + case 'insert': + switch ($db->get_sql_layer()) + { + case 'mysql': + case 'mysql4': + $sql = 'VALUES ' . implode(', ', preg_replace('#^(.*?)$#', '(\1)', $sql_subary)); + break; + + case 'mssql': + case 'sqlite': + case 'sqlite3': + case 'mssqlnative': + $sql = implode(' UNION ALL ', preg_replace('#^(.*?)$#', 'SELECT \1', $sql_subary)); + break; + + default: + foreach ($sql_subary as $sql) + { + $sql = "INSERT INTO $table ($id_field, forum_id, auth_option_id, auth_setting) VALUES ($sql)"; + $db->sql_query($sql); + $sql = ''; + } + } + + if ($sql != '') + { + $sql = "INSERT INTO $table ($id_field, forum_id, auth_option_id, auth_setting) $sql"; + $db->sql_query($sql); + } + break; + + case 'update': + case 'delete': + foreach ($sql_subary as $sql) + { + $db->sql_query($sql); + $sql = ''; + } + break; + } + unset($sql_ary[$sql_type]); + } + unset($sql_ary); + +} + +/** +* Update the count of unread private messages for all users +*/ +function update_unread_count() +{ + global $db; + + $sql = 'SELECT user_id, COUNT(msg_id) as num_messages + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE pm_unread = 1 + AND folder_id <> ' . PRIVMSGS_OUTBOX . ' + GROUP BY user_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_unread_privmsg = ' . $row['num_messages'] . ' + WHERE user_id = ' . $row['user_id']); + } + $db->sql_freeresult($result); +} + +/** +* Add any of the pre-defined "special" groups which are missing from the database +*/ +function add_default_groups() +{ + global $db; + + $default_groups = array( + 'GUESTS' => array('', 0, 0), + 'REGISTERED' => array('', 0, 0), + 'REGISTERED_COPPA' => array('', 0, 0), + 'GLOBAL_MODERATORS' => array('00AA00', 2, 0), + 'ADMINISTRATORS' => array('AA0000', 1, 1), + 'BOTS' => array('9E8DA7', 0, 0), + 'NEWLY_REGISTERED' => array('', 0, 0), + ); + + $sql = 'SELECT * + FROM ' . GROUPS_TABLE . ' + WHERE ' . $db->sql_in_set('group_name', array_keys($default_groups)); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + unset($default_groups[strtoupper($row['group_name'])]); + } + $db->sql_freeresult($result); + + $sql_ary = array(); + + foreach ($default_groups as $name => $data) + { + $sql_ary[] = array( + 'group_name' => (string) $name, + 'group_desc' => '', + 'group_desc_uid' => '', + 'group_desc_bitfield' => '', + 'group_type' => GROUP_SPECIAL, + 'group_colour' => (string) $data[0], + 'group_legend' => (int) $data[1], + 'group_founder_manage' => (int) $data[2], + ); + } + + if (sizeof($sql_ary)) + { + $db->sql_multi_insert(GROUPS_TABLE, $sql_ary); + } +} + +function add_groups_to_teampage() +{ + global $db; + + $teampage_groups = array( + 'ADMINISTRATORS' => 1, + 'GLOBAL_MODERATORS' => 2, + ); + + $sql = 'SELECT * + FROM ' . GROUPS_TABLE . ' + WHERE ' . $db->sql_in_set('group_name', array_keys($teampage_groups)); + $result = $db->sql_query($sql); + + $teampage_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $teampage_ary[] = array( + 'group_id' => (int) $row['group_id'], + 'teampage_name' => '', + 'teampage_position' => (int) $teampage_groups[$row['group_name']], + 'teampage_parent' => 0, + ); + } + $db->sql_freeresult($result); + + if (sizeof($teampage_ary)) + { + $db->sql_multi_insert(TEAMPAGE_TABLE, $teampage_ary); + } +} + + +/** +* Sync post count. We might need to do this in batches. +*/ +function sync_post_count($offset, $limit) +{ + global $db; + $sql = 'SELECT COUNT(post_id) AS num_posts, poster_id + FROM ' . POSTS_TABLE . ' + WHERE post_postcount = 1 + AND post_visibility = ' . ITEM_APPROVED . ' + GROUP BY poster_id + ORDER BY poster_id'; + $result = $db->sql_query_limit($sql, $limit, $offset); + + while ($row = $db->sql_fetchrow($result)) + { + $db->sql_query('UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['poster_id']}"); + } + $db->sql_freeresult($result); +} + +/** +* Add the search bots into the database +* This code should be used in execute_last if the source database did not have bots +* If you are converting bots this function should not be called +* @todo We might want to look at sharing the bot list between the install code and this code for consistancy +*/ +function add_bots() +{ + global $db, $convert, $user, $config, $phpbb_root_path, $phpEx; + + $db->sql_query($convert->truncate_statement . BOTS_TABLE); + + $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " WHERE group_name = 'BOTS'"; + $result = $db->sql_query($sql); + $group_id = (int) $db->sql_fetchfield('group_id', false, $result); + $db->sql_freeresult($result); + + if (!$group_id) + { + add_default_groups(); + + $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " WHERE group_name = 'BOTS'"; + $result = $db->sql_query($sql); + $group_id = (int) $db->sql_fetchfield('group_id', false, $result); + $db->sql_freeresult($result); + + if (!$group_id) + { + global $install; + $install->error($user->lang['CONV_ERROR_INCONSISTENT_GROUPS'], __LINE__, __FILE__); + } + } + + $bots = 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/2', ''), + 'Majestic-12 [Bot]' => array('MJ12bot/', ''), + 'Metager [Bot]' => array('MetagerBot/', ''), + 'MSN NewsBlogs' => array('msnbot-NewsBlogs/', ''), + 'MSN [Bot]' => array('msnbot/', ''), + 'MSNbot Media' => array('msnbot-media/', ''), + 'NG-Search [Bot]' => array('NG-Search/', ''), + 'Nutch [Bot]' => array('http://lucene.apache.org/nutch/', ''), + 'Nutch/CVS [Bot]' => array('NutchCVS/', ''), + 'OmniExplorer [Bot]' => array('OmniExplorer_Bot/', ''), + 'Online link [Validator]' => array('online link validator', ''), + 'psbot [Picsearch]' => array('psbot/0', ''), + 'Seekport [Bot]' => array('Seekbot/', ''), + '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/', ''), + 'Synoo [Bot]' => array('SynooBot/', ''), + 'Telekom [Bot]' => array('crawleradmin.t-info@telekom.de', ''), + 'TurnitinBot [Bot]' => array('TurnitinBot/', ''), + 'Voyager [Bot]' => array('voyager/1.0', ''), + 'W3 [Sitesearch]' => array('W3 SiteSearch Crawler', ''), + 'W3C [Linkcheck]' => array('W3C-checklink/', ''), + 'W3C [Validator]' => array('W3C_*Validator', ''), + 'WiseNut [Bot]' => array('http://www.WISEnutbot.com', ''), + '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/', ''), + ); + + if (!function_exists('user_add')) + { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + } + + foreach ($bots 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' => $config['default_lang'], + 'user_style' => 1, + 'user_timezone' => 'UTC', + 'user_allow_massemail' => 0, + ); + + $user_id = user_add($user_row); + + if ($user_id) + { + $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'bot_active' => 1, + 'bot_name' => $bot_name, + 'user_id' => $user_id, + 'bot_agent' => $bot_ary[0], + 'bot_ip' => $bot_ary[1]) + ); + $db->sql_query($sql); + } + } +} + +/** +* Update any dynamic configuration variables after the conversion is finished +* @todo Confirm that this updates all relevant values since it has not necessarily been kept in sync with all changes +*/ +function update_dynamic_config() +{ + global $db, $config; + + // Get latest username + $sql = 'SELECT user_id, username, user_colour + FROM ' . USERS_TABLE . ' + WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')'; + + if (!empty($config['increment_user_id'])) + { + $sql .= ' AND user_id <> ' . $config['increment_user_id']; + } + + $sql .= ' ORDER BY user_id DESC'; + + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + 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); + } + +// Also do not reset record online user/date. There will be old data or the fresh data from the schema. +// set_config('record_online_users', 1, true); +// set_config('record_online_date', time(), true); + + $sql = 'SELECT COUNT(post_id) AS stat + FROM ' . POSTS_TABLE . ' + WHERE post_visibility = ' . ITEM_APPROVED; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + set_config('num_posts', (int) $row['stat'], true); + + $sql = 'SELECT COUNT(topic_id) AS stat + FROM ' . TOPICS_TABLE . ' + WHERE topic_visibility = ' . ITEM_APPROVED; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + set_config('num_topics', (int) $row['stat'], true); + + $sql = 'SELECT COUNT(user_id) AS stat + FROM ' . USERS_TABLE . ' + WHERE user_type IN (' . USER_NORMAL . ',' . USER_FOUNDER . ')'; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + set_config('num_users', (int) $row['stat'], true); + + $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); + $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); + $db->sql_freeresult($result); + + /** + * We do not resync users post counts - this can be done by the admin after conversion if wanted. + $sql = 'SELECT COUNT(post_id) AS num_posts, poster_id + FROM ' . POSTS_TABLE . ' + WHERE post_postcount = 1 + GROUP BY poster_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $db->sql_query('UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['poster_id']}"); + } + $db->sql_freeresult($result); + */ +} + +/** +* Updates topics_posted entries +*/ +function update_topics_posted() +{ + global $db, $config; + + switch ($db->get_sql_layer()) + { + case 'sqlite': + case 'sqlite3': + $db->sql_query('DELETE FROM ' . TOPICS_POSTED_TABLE); + break; + + default: + $db->sql_query('TRUNCATE TABLE ' . TOPICS_POSTED_TABLE); + break; + } + + // This can get really nasty... therefore we only do the last six months + $get_from_time = time() - (6 * 4 * 7 * 24 * 60 * 60); + + // Select forum ids, do not include categories + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + WHERE forum_type <> ' . FORUM_CAT; + $result = $db->sql_query($sql); + + $forum_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_ids[] = $row['forum_id']; + } + $db->sql_freeresult($result); + + // Any global announcements? ;) + $forum_ids[] = 0; + + // Now go through the forums and get us some topics... + foreach ($forum_ids as $forum_id) + { + $sql = 'SELECT p.poster_id, p.topic_id + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t + WHERE t.forum_id = ' . $forum_id . ' + AND t.topic_moved_id = 0 + AND t.topic_last_post_time > ' . $get_from_time . ' + AND t.topic_id = p.topic_id + AND p.poster_id <> ' . ANONYMOUS . ' + GROUP BY p.poster_id, p.topic_id'; + $result = $db->sql_query($sql); + + $posted = array(); + while ($row = $db->sql_fetchrow($result)) + { + $posted[$row['poster_id']][] = $row['topic_id']; + } + $db->sql_freeresult($result); + + $sql_ary = array(); + foreach ($posted as $user_id => $topic_row) + { + foreach ($topic_row as $topic_id) + { + $sql_ary[] = array( + 'user_id' => (int) $user_id, + 'topic_id' => (int) $topic_id, + 'topic_posted' => 1, + ); + } + } + unset($posted); + + if (sizeof($sql_ary)) + { + $db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary); + } + } +} + +/** +* Ensure that all users have a default group specified and update related information such as their colour +*/ +function fix_empty_primary_groups() +{ + global $db; + + // Set group ids for users not already having it + $sql = 'UPDATE ' . USERS_TABLE . ' SET group_id = ' . get_group_id('registered') . ' + WHERE group_id = 0 AND user_type = ' . USER_INACTIVE; + $db->sql_query($sql); + + $sql = 'UPDATE ' . USERS_TABLE . ' SET group_id = ' . get_group_id('registered') . ' + WHERE group_id = 0 AND user_type = ' . USER_NORMAL; + $db->sql_query($sql); + + $db->sql_query('UPDATE ' . USERS_TABLE . ' SET group_id = ' . get_group_id('guests') . ' WHERE user_id = ' . ANONYMOUS); + + $sql = 'SELECT user_id FROM ' . USER_GROUP_TABLE . ' WHERE group_id = ' . get_group_id('administrators'); + $result = $db->sql_query($sql); + + $user_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $user_ids[] = $row['user_id']; + } + $db->sql_freeresult($result); + + if (sizeof($user_ids)) + { + $db->sql_query('UPDATE ' . USERS_TABLE . ' SET group_id = ' . get_group_id('administrators') . ' + WHERE group_id = 0 AND ' . $db->sql_in_set('user_id', $user_ids)); + } + + $sql = 'SELECT user_id FROM ' . USER_GROUP_TABLE . ' WHERE group_id = ' . get_group_id('global_moderators'); + $result = $db->sql_query($sql); + + $user_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $user_ids[] = $row['user_id']; + } + $db->sql_freeresult($result); + + if (sizeof($user_ids)) + { + $db->sql_query('UPDATE ' . USERS_TABLE . ' SET group_id = ' . get_group_id('global_moderators') . ' + WHERE group_id = 0 AND ' . $db->sql_in_set('user_id', $user_ids)); + } + + // Set user colour + $sql = 'SELECT group_id, group_colour FROM ' . GROUPS_TABLE . " + WHERE group_colour <> ''"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $db->sql_query('UPDATE ' . USERS_TABLE . " SET user_colour = '{$row['group_colour']}' WHERE group_id = {$row['group_id']}"); + } + $db->sql_freeresult($result); +} + +/** +* Cleanly remove invalid user entries after converting the users table... +*/ +function remove_invalid_users() +{ + global $convert, $db, $phpEx, $phpbb_root_path; + + // username_clean is UNIQUE + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . " + WHERE username_clean = ''"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + if (!function_exists('user_delete')) + { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + } + + user_delete('remove', $row['user_id']); + } +} + +function convert_bbcode($message, $convert_size = true, $extended_bbcodes = false) +{ + static $orig, $repl, $origx, $replx, $str_from, $str_to; + + if (empty($orig)) + { + $orig = $repl = array(); + + $orig[] = '#\[(php|sql)\](.*?)\[/(php|sql)\]#is'; + $repl[] = '[code]\2[/code]'; + + $orig[] = '#\[font=[^\]]+\](.*?)\[/font\]#is'; + $repl[] = '\1'; + + $orig[] = '#\[align=[a-z]+\](.*?)\[/align\]#is'; + $repl[] = '\1'; + + $orig[] = '#\[/list=.*?\]#is'; + $repl[] = '[/list]'; + + $origx = array( + '#\[glow[^\]]+\](.*?)\[/glow\]#is', + '#\[shadow[^\]]+\](.*?)\[/shadow\]#is', + '#\[flash[^\]]+\](.*?)\[/flash\]#is' + ); + + $replx = array( + '\1', + '\1', + '[url=\1]Flash[/url]' + ); + + $str_from = array( + '[ftp]', '[/ftp]', + '[ftp=', '[/ftp]', + '[pre]', '[/pre]', + '[table]', '[/table]', + '[td]', '[/td]', + '[tr]', '[/tr]', + '[s]', '[/s]', + '[left]', '[/left]', + '[right]', '[/right]', + '[center]', '[/center]', + '[sub]', '[/sub]', + '[sup]', '[/sup]', + '[tt]', '[/tt]', + '[move]', '[/move]', + '[hr]' + ); + + $str_to = array( + '[url]', '[/url]', + '[url=', '[/url]', + '[code]', '[/code]', + "\n", '', + '', '', + "\n", '', + '', '', + '', '', + '', '', + '', '', + '', '', + '', '', + '', '', + '', '', + "\n\n" + ); + + for ($i = 0; $i < sizeof($str_from); ++$i) + { + $origx[] = '#\\' . str_replace(']', '\\]', $str_from[$i]) . '#is'; + $replx[] = $str_to[$i]; + } + } + + if (preg_match_all('#\[email=([^\]]+)\](.*?)\[/email\]#i', $message, $m)) + { + for ($i = 0; $i < sizeof($m[1]); ++$i) + { + if ($m[1][$i] == $m[2][$i]) + { + $message = str_replace($m[0][$i], '[email]' . $m[1][$i] . '[/email]', $message); + } + else + { + $message = str_replace($m[0][$i], $m[2][$i] . ' ([email]' . $m[1][$i] . '[/email])', $message); + } + } + } + + if ($convert_size && preg_match('#\[size=[0-9]+\].*?\[/size\]#i', $message)) + { + $size = array(9, 9, 12, 15, 18, 24, 29, 29, 29, 29); + $message = preg_replace('#\[size=([0-9]+)\](.*?)\[/size\]#i', '[size=\1]\2[/size]', $message); + $message = preg_replace('#\[size=[0-9]{2,}\](.*?)\[/size\]#i', '[size=29]\1[/size]', $message); + + for ($i = sizeof($size); $i;) + { + $i--; + $message = str_replace('[size=' . $i . ']', '[size=' . $size[$i] . ']', $message); + } + } + + if ($extended_bbcodes) + { + $message = preg_replace($origx, $replx, $message); + } + + $message = preg_replace($orig, $repl, $message); + return $message; +} + + +function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $source_relative_path = true) +{ + global $convert, $phpbb_root_path, $config, $user, $db; + + if (substr($trg, -1) == '/') + { + $trg .= utf8_basename($src); + } + $src_path = relative_base($src, $source_relative_path, __LINE__, __FILE__); + $trg_path = $trg; + + if (!$overwrite && @file_exists($trg_path)) + { + return true; + } + + if (!@file_exists($src_path)) + { + return; + } + + $path = $phpbb_root_path; + $parts = explode('/', $trg); + unset($parts[sizeof($parts) - 1]); + + for ($i = 0; $i < sizeof($parts); ++$i) + { + $path .= $parts[$i] . '/'; + + if (!is_dir($path)) + { + @mkdir($path, 0777); + } + } + + if (!phpbb_is_writable($path)) + { + @chmod($path, 0777); + } + + if (!@copy($src_path, $phpbb_root_path . $trg_path)) + { + $convert->p_master->error(sprintf($user->lang['COULD_NOT_COPY'], $src_path, $phpbb_root_path . $trg_path), __LINE__, __FILE__, !$die_on_failure); + return; + } + + if ($perm = @fileperms($src_path)) + { + @chmod($phpbb_root_path . $trg_path, $perm); + } + + return true; +} + +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; + + $dirlist = $filelist = $bad_dirs = array(); + $src = path($src, $source_relative_path); + $trg = path($trg); + $src_path = relative_base($src, $source_relative_path, __LINE__, __FILE__); + $trg_path = $phpbb_root_path . $trg; + + if (!is_dir($trg_path)) + { + @mkdir($trg_path, 0777); + @chmod($trg_path, 0777); + } + + if (!phpbb_is_writable($trg_path)) + { + $bad_dirs[] = path($config['script_path']) . $trg; + } + + if ($handle = @opendir($src_path)) + { + while ($entry = readdir($handle)) + { + if ($entry[0] == '.' || $entry == 'CVS' || $entry == 'index.htm') + { + continue; + } + + if (is_dir($src_path . $entry)) + { + $dirlist[] = $entry; + } + else + { + $filelist[] = $entry; + } + } + closedir($handle); + } + else if ($dir = @dir($src_path)) + { + while ($entry = $dir->read()) + { + if ($entry[0] == '.' || $entry == 'CVS' || $entry == 'index.htm') + { + continue; + } + + if (is_dir($src_path . $entry)) + { + $dirlist[] = $entry; + } + else + { + $filelist[] = $entry; + } + } + $dir->close(); + } + else + { + $convert->p_master->error(sprintf($user->lang['CONV_ERROR_COULD_NOT_READ'], relative_base($src, $source_relative_path)), __LINE__, __FILE__); + } + + if ($copy_subdirs) + { + for ($i = 0; $i < sizeof($dirlist); ++$i) + { + $dir = $dirlist[$i]; + + if ($dir == 'CVS') + { + continue; + } + + if (!is_dir($trg_path . $dir)) + { + @mkdir($trg_path . $dir, 0777); + @chmod($trg_path . $dir, 0777); + } + + if (!phpbb_is_writable($trg_path . $dir)) + { + $bad_dirs[] = $trg . $dir; + $bad_dirs[] = $trg_path . $dir; + } + + if (!sizeof($bad_dirs)) + { + copy_dir($src . $dir, $trg . $dir, true, $overwrite, $die_on_failure, $source_relative_path); + } + } + } + + if (sizeof($bad_dirs)) + { + $str = (sizeof($bad_dirs) == 1) ? $user->lang['MAKE_FOLDER_WRITABLE'] : $user->lang['MAKE_FOLDERS_WRITABLE']; + sort($bad_dirs); + $convert->p_master->error(sprintf($str, implode('
', $bad_dirs)), __LINE__, __FILE__); + } + + for ($i = 0; $i < sizeof($filelist); ++$i) + { + copy_file($src . $filelist[$i], $trg . $filelist[$i], $overwrite, $die_on_failure, $source_relative_path); + } +} + +function relative_base($path, $is_relative = true, $line = false, $file = false) +{ + global $convert, $phpbb_root_path, $config, $user, $db; + + if (!$is_relative) + { + return $path; + } + + if (empty($convert->options['forum_path']) && $is_relative) + { + $line = $line ? $line : __LINE__; + $file = $file ? $file : __FILE__; + + $convert->p_master->error($user->lang['CONV_ERROR_NO_FORUM_PATH'], $line, $file); + } + + return $convert->options['forum_path'] . '/' . $path; +} + +function get_smiley_display() +{ + static $smiley_count = 0; + $smiley_count++; + return ($smiley_count < 50) ? 1 : 0; +} + + +function fill_dateformat($user_dateformat) +{ + global $config; + + return ((empty($user_dateformat)) ? $config['default_dateformat'] : $user_dateformat); +} diff --git a/sources/phpBB/includes/functions_database_helper.php b/sources/phpBB/includes/functions_database_helper.php new file mode 100644 index 0000000..8f363d5 --- /dev/null +++ b/sources/phpBB/includes/functions_database_helper.php @@ -0,0 +1,210 @@ + +* @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; +} + +/** +* Updates rows in given table from a set of values to a new value. +* If this results in rows violating uniqueness constraints, the duplicate +* rows are eliminated. +* +* The only supported table is bookmarks. +* +* @param \phpbb\db\driver\driver_interface $db Database object +* @param string $table Table on which to perform the update +* @param string $column Column whose values to change +* @param array $from_values An array of values that should be changed +* @param int $to_value The new value +* @return null +*/ +function phpbb_update_rows_avoiding_duplicates(\phpbb\db\driver\driver_interface $db, $table, $column, $from_values, $to_value) +{ + $sql = "SELECT $column, user_id + FROM $table + WHERE " . $db->sql_in_set($column, $from_values); + $result = $db->sql_query($sql); + + $old_user_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $old_user_ids[$row[$column]][] = (int) $row['user_id']; + } + $db->sql_freeresult($result); + + $sql = "SELECT $column, user_id + FROM $table + WHERE $column = " . (int) $to_value; + $result = $db->sql_query($sql); + + $new_user_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $new_user_ids[$row[$column]][] = (int) $row['user_id']; + } + $db->sql_freeresult($result); + + $queries = array(); + foreach ($from_values as $from_value) + { + if (!isset($old_user_ids[$from_value])) + { + continue; + } + if (empty($new_user_ids)) + { + $sql = "UPDATE $table + SET $column = " . (int) $to_value . " + WHERE $column = '" . $db->sql_escape($from_value) . "'"; + $queries[] = $sql; + } + else + { + $different_user_ids = array_diff($old_user_ids[$from_value], $new_user_ids[$to_value]); + if (!empty($different_user_ids)) + { + $sql = "UPDATE $table + SET $column = " . (int) $to_value . " + WHERE $column = '" . $db->sql_escape($from_value) . "' + AND " . $db->sql_in_set('user_id', $different_user_ids); + $queries[] = $sql; + } + } + } + + if (!empty($queries)) + { + $db->sql_transaction('begin'); + + foreach ($queries as $sql) + { + $db->sql_query($sql); + } + + $sql = "DELETE FROM $table + WHERE " . $db->sql_in_set($column, $from_values); + $db->sql_query($sql); + + $db->sql_transaction('commit'); + } +} + +/** +* Updates rows in given table from a set of values to a new value. +* If this results in rows violating uniqueness constraints, the duplicate +* rows are merged respecting notify_status (0 takes precedence over 1). +* +* The only supported table is topics_watch. +* +* @param \phpbb\db\driver\driver_interface $db Database object +* @param string $table Table on which to perform the update +* @param string $column Column whose values to change +* @param array $from_values An array of values that should be changed +* @param int $to_value The new value +* @return null +*/ +function phpbb_update_rows_avoiding_duplicates_notify_status(\phpbb\db\driver\driver_interface $db, $table, $column, $from_values, $to_value) +{ + $sql = "SELECT $column, user_id, notify_status + FROM $table + WHERE " . $db->sql_in_set($column, $from_values); + $result = $db->sql_query($sql); + + $old_user_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $old_user_ids[(int) $row['notify_status']][$row[$column]][] = (int) $row['user_id']; + } + $db->sql_freeresult($result); + + $sql = "SELECT $column, user_id + FROM $table + WHERE $column = " . (int) $to_value; + $result = $db->sql_query($sql); + + $new_user_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $new_user_ids[$row[$column]][] = (int) $row['user_id']; + } + $db->sql_freeresult($result); + + $queries = array(); + $extra_updates = array( + 0 => 'notify_status = 0', + 1 => '', + ); + foreach ($from_values as $from_value) + { + foreach ($extra_updates as $notify_status => $extra_update) + { + if (!isset($old_user_ids[$notify_status][$from_value])) + { + continue; + } + if (empty($new_user_ids)) + { + $sql = "UPDATE $table + SET $column = " . (int) $to_value . " + WHERE $column = '" . $db->sql_escape($from_value) . "'"; + $queries[] = $sql; + } + else + { + $different_user_ids = array_diff($old_user_ids[$notify_status][$from_value], $new_user_ids[$to_value]); + if (!empty($different_user_ids)) + { + $sql = "UPDATE $table + SET $column = " . (int) $to_value . " + WHERE $column = '" . $db->sql_escape($from_value) . "' + AND " . $db->sql_in_set('user_id', $different_user_ids); + $queries[] = $sql; + } + + if ($extra_update) + { + $same_user_ids = array_diff($old_user_ids[$notify_status][$from_value], $different_user_ids); + if (!empty($same_user_ids)) + { + $sql = "UPDATE $table + SET $extra_update + WHERE $column = '" . (int) $to_value . "' + AND " . $db->sql_in_set('user_id', $same_user_ids); + $queries[] = $sql; + } + } + } + } + } + + if (!empty($queries)) + { + $db->sql_transaction('begin'); + + foreach ($queries as $sql) + { + $db->sql_query($sql); + } + + $sql = "DELETE FROM $table + WHERE " . $db->sql_in_set($column, $from_values); + $db->sql_query($sql); + + $db->sql_transaction('commit'); + } +} diff --git a/sources/phpBB/includes/functions_display.php b/sources/phpBB/includes/functions_display.php new file mode 100644 index 0000000..31cf43e --- /dev/null +++ b/sources/phpBB/includes/functions_display.php @@ -0,0 +1,1651 @@ + +* @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; +} + +/** +* Display Forums +*/ +function display_forums($root_data = '', $display_moderators = true, $return_moderators = false) +{ + global $db, $auth, $user, $template; + global $phpbb_root_path, $phpEx, $config; + global $request, $phpbb_dispatcher, $phpbb_container; + + $forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array(); + $parent_id = $visible_forums = 0; + $sql_from = ''; + + // Mark forums read? + $mark_read = request_var('mark', ''); + + if ($mark_read == 'all') + { + $mark_read = ''; + } + + if (!$root_data) + { + if ($mark_read == 'forums') + { + $mark_read = 'all'; + } + + $root_data = array('forum_id' => 0); + $sql_where = ''; + } + else + { + $sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id']; + } + + // Handle marking everything read + if ($mark_read == 'all') + { + $redirect = build_url(array('mark', 'hash', 'mark_time')); + meta_refresh(3, $redirect); + + if (check_link_hash(request_var('hash', ''), 'global')) + { + markread('all', false, false, request_var('mark_time', 0)); + + if ($request->is_ajax()) + { + // Tell the ajax script what language vars and URL need to be replaced + $data = array( + 'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'], + 'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'], + 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums&mark_time=' . time()) : '', + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $user->lang['FORUMS_MARKED'] + ); + $json_response = new \phpbb\json_response(); + $json_response->send($data); + } + + trigger_error( + $user->lang['FORUMS_MARKED'] . '

' . + sprintf($user->lang['RETURN_INDEX'], '', '') + ); + } + else + { + trigger_error(sprintf($user->lang['RETURN_PAGE'], '', '')); + } + } + + // Display list of active topics for this category? + $show_active = (isset($root_data['forum_flags']) && ($root_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false; + + $sql_array = array( + 'SELECT' => 'f.*', + 'FROM' => array( + FORUMS_TABLE => 'f' + ), + 'LEFT_JOIN' => array(), + ); + + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + $sql_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TRACK_TABLE => 'ft'), 'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id'); + $sql_array['SELECT'] .= ', ft.mark_time'; + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE); + $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array(); + + if (!$user->data['is_registered']) + { + $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0; + } + } + + if ($show_active) + { + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(FORUMS_ACCESS_TABLE => 'fa'), + 'ON' => "fa.forum_id = f.forum_id AND fa.session_id = '" . $db->sql_escape($user->session_id) . "'" + ); + + $sql_array['SELECT'] .= ', fa.user_id'; + } + + $sql_ary = array( + 'SELECT' => $sql_array['SELECT'], + 'FROM' => $sql_array['FROM'], + 'LEFT_JOIN' => $sql_array['LEFT_JOIN'], + + 'WHERE' => $sql_where, + + 'ORDER_BY' => 'f.left_id', + ); + + /** + * Event to modify the SQL query before the forum data is queried + * + * @event core.display_forums_modify_sql + * @var array sql_ary The SQL array to get the data of the forums + * @since 3.1.0-a1 + */ + $vars = array('sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_sql', compact($vars))); + + $sql = $db->sql_build_query('SELECT', $sql_ary); + $result = $db->sql_query($sql); + + $forum_tracking_info = array(); + $branch_root_id = $root_data['forum_id']; + + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + + while ($row = $db->sql_fetchrow($result)) + { + /** + * Event to modify the data set of a forum + * + * This event is triggered once per forum + * + * @event core.display_forums_modify_row + * @var int branch_root_id Last top-level forum + * @var array row The data of the forum + * @since 3.1.0-a1 + */ + $vars = array('branch_root_id', 'row'); + extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_row', compact($vars))); + + $forum_id = $row['forum_id']; + + // Mark forums read? + if ($mark_read == 'forums') + { + if ($auth->acl_get('f_list', $forum_id)) + { + $forum_ids[] = $forum_id; + } + + continue; + } + + // Category with no members + if ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id'])) + { + continue; + } + + // Skip branch + if (isset($right_id)) + { + if ($row['left_id'] < $right_id) + { + continue; + } + unset($right_id); + } + + if (!$auth->acl_get('f_list', $forum_id)) + { + // if the user does not have permissions to list this forum, skip everything until next branch + $right_id = $row['right_id']; + continue; + } + + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + $forum_tracking_info[$forum_id] = (!empty($row['mark_time'])) ? $row['mark_time'] : $user->data['user_lastmark']; + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + if (!$user->data['is_registered']) + { + $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0; + } + $forum_tracking_info[$forum_id] = (isset($tracking_topics['f'][$forum_id])) ? (int) (base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate']) : $user->data['user_lastmark']; + } + + // Lets check whether there are unapproved topics/posts, so we can display an information to moderators + $row['forum_id_unapproved_topics'] = ($auth->acl_get('m_approve', $forum_id) && $row['forum_topics_unapproved']) ? $forum_id : 0; + $row['forum_id_unapproved_posts'] = ($auth->acl_get('m_approve', $forum_id) && $row['forum_posts_unapproved']) ? $forum_id : 0; + $row['forum_posts'] = $phpbb_content_visibility->get_count('forum_posts', $row, $forum_id); + $row['forum_topics'] = $phpbb_content_visibility->get_count('forum_topics', $row, $forum_id); + + // Display active topics from this forum? + if ($show_active && $row['forum_type'] == FORUM_POST && $auth->acl_get('f_read', $forum_id) && ($row['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) + { + if (!isset($active_forum_ary['forum_topics'])) + { + $active_forum_ary['forum_topics'] = 0; + } + + if (!isset($active_forum_ary['forum_posts'])) + { + $active_forum_ary['forum_posts'] = 0; + } + + $active_forum_ary['forum_id'][] = $forum_id; + $active_forum_ary['enable_icons'][] = $row['enable_icons']; + $active_forum_ary['forum_topics'] += $row['forum_topics']; + $active_forum_ary['forum_posts'] += $row['forum_posts']; + + // If this is a passworded forum we do not show active topics from it if the user is not authorised to view it... + if ($row['forum_password'] && $row['user_id'] != $user->data['user_id']) + { + $active_forum_ary['exclude_forum_id'][] = $forum_id; + } + } + + // + if ($row['parent_id'] == $root_data['forum_id'] || $row['parent_id'] == $branch_root_id) + { + if ($row['forum_type'] != FORUM_CAT) + { + $forum_ids_moderator[] = (int) $forum_id; + } + + // Direct child of current branch + $parent_id = $forum_id; + $forum_rows[$forum_id] = $row; + + if ($row['forum_type'] == FORUM_CAT && $row['parent_id'] == $root_data['forum_id']) + { + $branch_root_id = $forum_id; + } + $forum_rows[$parent_id]['forum_id_last_post'] = $row['forum_id']; + $forum_rows[$parent_id]['orig_forum_last_post_time'] = $row['forum_last_post_time']; + } + else if ($row['forum_type'] != FORUM_CAT) + { + $subforums[$parent_id][$forum_id]['display'] = ($row['display_on_index']) ? true : false; + $subforums[$parent_id][$forum_id]['name'] = $row['forum_name']; + $subforums[$parent_id][$forum_id]['orig_forum_last_post_time'] = $row['forum_last_post_time']; + $subforums[$parent_id][$forum_id]['children'] = array(); + + if (isset($subforums[$parent_id][$row['parent_id']]) && !$row['display_on_index']) + { + $subforums[$parent_id][$row['parent_id']]['children'][] = $forum_id; + } + + if (!$forum_rows[$parent_id]['forum_id_unapproved_topics'] && $row['forum_id_unapproved_topics']) + { + $forum_rows[$parent_id]['forum_id_unapproved_topics'] = $forum_id; + } + + if (!$forum_rows[$parent_id]['forum_id_unapproved_posts'] && $row['forum_id_unapproved_posts']) + { + $forum_rows[$parent_id]['forum_id_unapproved_posts'] = $forum_id; + } + + $forum_rows[$parent_id]['forum_topics'] += $row['forum_topics']; + + // Do not list redirects in LINK Forums as Posts. + if ($row['forum_type'] != FORUM_LINK) + { + $forum_rows[$parent_id]['forum_posts'] += $row['forum_posts']; + } + + if ($row['forum_last_post_time'] > $forum_rows[$parent_id]['forum_last_post_time']) + { + $forum_rows[$parent_id]['forum_last_post_id'] = $row['forum_last_post_id']; + $forum_rows[$parent_id]['forum_last_post_subject'] = $row['forum_last_post_subject']; + $forum_rows[$parent_id]['forum_last_post_time'] = $row['forum_last_post_time']; + $forum_rows[$parent_id]['forum_last_poster_id'] = $row['forum_last_poster_id']; + $forum_rows[$parent_id]['forum_last_poster_name'] = $row['forum_last_poster_name']; + $forum_rows[$parent_id]['forum_last_poster_colour'] = $row['forum_last_poster_colour']; + $forum_rows[$parent_id]['forum_id_last_post'] = $forum_id; + } + } + + /** + * Event to modify the forum rows data set + * + * This event is triggered once per forum + * + * @event core.display_forums_modify_forum_rows + * @var array forum_rows Data array of all forums we display + * @var array subforums Data array of all subforums we display + * @var int branch_root_id Current top-level forum + * @var int parent_id Current parent forum + * @var array row The data of the forum + * @since 3.1.0-a1 + */ + $vars = array('forum_rows', 'subforums', 'branch_root_id', 'parent_id', 'row'); + extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_forum_rows', compact($vars))); + } + $db->sql_freeresult($result); + + // Handle marking posts + if ($mark_read == 'forums') + { + $redirect = build_url(array('mark', 'hash', 'mark_time')); + $token = request_var('hash', ''); + if (check_link_hash($token, 'global')) + { + markread('topics', $forum_ids, false, request_var('mark_time', 0)); + $message = sprintf($user->lang['RETURN_FORUM'], '', ''); + meta_refresh(3, $redirect); + + if ($request->is_ajax()) + { + // Tell the ajax script what language vars and URL need to be replaced + $data = array( + 'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'], + 'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'], + 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . '&f=' . $root_data['forum_id'] . '&mark=forums&mark_time=' . time()) : '', + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $user->lang['FORUMS_MARKED'] + ); + $json_response = new \phpbb\json_response(); + $json_response->send($data); + } + + trigger_error($user->lang['FORUMS_MARKED'] . '

' . $message); + } + else + { + $message = sprintf($user->lang['RETURN_PAGE'], '', ''); + meta_refresh(3, $redirect); + trigger_error($message); + } + + } + + // Grab moderators ... if necessary + if ($display_moderators) + { + if ($return_moderators) + { + $forum_ids_moderator[] = $root_data['forum_id']; + } + get_moderators($forum_moderators, $forum_ids_moderator); + } + + // Used to tell whatever we have to create a dummy category or not. + $last_catless = true; + foreach ($forum_rows as $row) + { + // Category + if ($row['parent_id'] == $root_data['forum_id'] && $row['forum_type'] == FORUM_CAT) + { + $cat_row = array( + 'S_IS_CAT' => true, + 'FORUM_ID' => $row['forum_id'], + 'FORUM_NAME' => $row['forum_name'], + 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), + 'FORUM_FOLDER_IMG' => '', + 'FORUM_FOLDER_IMG_SRC' => '', + 'FORUM_IMAGE' => ($row['forum_image']) ? '' . $user->lang['FORUM_CAT'] . '' : '', + 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', + 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']), + ); + + /** + * Modify the template data block of the 'category' + * + * This event is triggered once per 'category' + * + * @event core.display_forums_modify_category_template_vars + * @var array cat_row Template data of the 'category' + * @var bool catless The flag indicating whether the 'category' has a parent category + * @var bool last_catless The flag indicating whether the last forum had a parent category + * @var array root_data Array with the root forum data + * @var array row The data of the 'category' + * @since 3.1.0-RC4 + */ + $vars = array( + 'cat_row', + 'catless', + 'last_catless', + 'root_data', + 'row', + ); + extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_category_template_vars', compact($vars))); + + $template->assign_block_vars('forumrow', $cat_row); + + continue; + } + + $visible_forums++; + $forum_id = $row['forum_id']; + + $forum_unread = (isset($forum_tracking_info[$forum_id]) && $row['orig_forum_last_post_time'] > $forum_tracking_info[$forum_id]) ? true : false; + + $folder_image = $folder_alt = $l_subforums = ''; + $subforums_list = array(); + + // Generate list of subforums if we need to + if (isset($subforums[$forum_id])) + { + foreach ($subforums[$forum_id] as $subforum_id => $subforum_row) + { + $subforum_unread = (isset($forum_tracking_info[$subforum_id]) && $subforum_row['orig_forum_last_post_time'] > $forum_tracking_info[$subforum_id]) ? true : false; + + if (!$subforum_unread && !empty($subforum_row['children'])) + { + foreach ($subforum_row['children'] as $child_id) + { + if (isset($forum_tracking_info[$child_id]) && $subforums[$forum_id][$child_id]['orig_forum_last_post_time'] > $forum_tracking_info[$child_id]) + { + // Once we found an unread child forum, we can drop out of this loop + $subforum_unread = true; + break; + } + } + } + + if ($subforum_row['display'] && $subforum_row['name']) + { + $subforums_list[] = array( + 'link' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $subforum_id), + 'name' => $subforum_row['name'], + 'unread' => $subforum_unread, + ); + } + else + { + unset($subforums[$forum_id][$subforum_id]); + } + + // If one subforum is unread the forum gets unread too... + if ($subforum_unread) + { + $forum_unread = true; + } + } + + $l_subforums = (sizeof($subforums[$forum_id]) == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS']; + $folder_image = ($forum_unread) ? 'forum_unread_subforum' : 'forum_read_subforum'; + } + else + { + switch ($row['forum_type']) + { + case FORUM_POST: + $folder_image = ($forum_unread) ? 'forum_unread' : 'forum_read'; + break; + + case FORUM_LINK: + $folder_image = 'forum_link'; + break; + } + } + + // Which folder should we display? + if ($row['forum_status'] == ITEM_LOCKED) + { + $folder_image = ($forum_unread) ? 'forum_unread_locked' : 'forum_read_locked'; + $folder_alt = 'FORUM_LOCKED'; + } + else + { + $folder_alt = ($forum_unread) ? 'UNREAD_POSTS' : 'NO_UNREAD_POSTS'; + } + + // Create last post link information, if appropriate + if ($row['forum_last_post_id']) + { + $last_post_subject = $row['forum_last_post_subject']; + $last_post_subject_truncated = truncate_string(censor_text($last_post_subject), 30, 255, false, $user->lang['ELLIPSIS']); + $last_post_time = $user->format_date($row['forum_last_post_time']); + $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id']; + } + else + { + $last_post_subject = $last_post_time = $last_post_url = $last_post_subject_truncated = ''; + } + + // Output moderator listing ... if applicable + $l_moderator = $moderators_list = ''; + if ($display_moderators && !empty($forum_moderators[$forum_id])) + { + $l_moderator = (sizeof($forum_moderators[$forum_id]) == 1) ? $user->lang['MODERATOR'] : $user->lang['MODERATORS']; + $moderators_list = implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]); + } + + $l_post_click_count = ($row['forum_type'] == FORUM_LINK) ? 'CLICKS' : 'POSTS'; + $post_click_count = ($row['forum_type'] != FORUM_LINK || $row['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? $row['forum_posts'] : ''; + + $s_subforums_list = $subforums_row = array(); + foreach ($subforums_list as $subforum) + { + $s_subforums_list[] = '' . $subforum['name'] . ''; + $subforums_row[] = array( + 'U_SUBFORUM' => $subforum['link'], + 'SUBFORUM_NAME' => $subforum['name'], + 'S_UNREAD' => $subforum['unread'], + ); + } + $s_subforums_list = (string) implode($user->lang['COMMA_SEPARATOR'], $s_subforums_list); + $catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false; + + if ($row['forum_type'] != FORUM_LINK) + { + $u_viewforum = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']); + } + else + { + // If the forum is a link and we count redirects we need to visit it + // If the forum is having a password or no read access we do not expose the link, but instead handle it in viewforum + if (($row['forum_flags'] & FORUM_FLAG_LINK_TRACK) || $row['forum_password'] || !$auth->acl_get('f_read', $forum_id)) + { + $u_viewforum = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']); + } + else + { + $u_viewforum = $row['forum_link']; + } + } + + $forum_row = array( + 'S_IS_CAT' => false, + 'S_NO_CAT' => $catless && !$last_catless, + 'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false, + 'S_UNREAD_FORUM' => $forum_unread, + 'S_AUTH_READ' => $auth->acl_get('f_read', $row['forum_id']), + 'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false, + 'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false, + 'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false, + 'S_DISPLAY_SUBJECT' => ($last_post_subject && $config['display_last_subject'] && !$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? true : false, + 'S_FEED_ENABLED' => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options']) && $row['forum_type'] == FORUM_POST) ? true : false, + + 'FORUM_ID' => $row['forum_id'], + 'FORUM_NAME' => $row['forum_name'], + 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), + 'TOPICS' => $row['forum_topics'], + $l_post_click_count => $post_click_count, + 'FORUM_IMG_STYLE' => $folder_image, + 'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt), + 'FORUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '', + 'FORUM_IMAGE' => ($row['forum_image']) ? '' . $user->lang[$folder_alt] . '' : '', + 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', + 'LAST_POST_SUBJECT' => (!$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? censor_text($last_post_subject) : "", + 'LAST_POST_SUBJECT_TRUNCATED' => (!$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? $last_post_subject_truncated : "", + 'LAST_POST_TIME' => $last_post_time, + 'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), + 'LAST_POSTER_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), + 'LAST_POSTER_FULL' => get_username_string('full', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), + 'MODERATORS' => $moderators_list, + 'SUBFORUMS' => $s_subforums_list, + + 'L_SUBFORUM_STR' => $l_subforums, + 'L_MODERATOR_STR' => $l_moderator, + + 'U_UNAPPROVED_TOPICS' => ($row['forum_id_unapproved_topics']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=unapproved_topics&f=' . $row['forum_id_unapproved_topics']) : '', + 'U_UNAPPROVED_POSTS' => ($row['forum_id_unapproved_posts']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=unapproved_posts&f=' . $row['forum_id_unapproved_posts']) : '', + 'U_VIEWFORUM' => $u_viewforum, + 'U_LAST_POSTER' => get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), + 'U_LAST_POST' => $last_post_url, + ); + + /** + * Modify the template data block of the forum + * + * This event is triggered once per forum + * + * @event core.display_forums_modify_template_vars + * @var array forum_row Template data of the forum + * @var array row The data of the forum + * @var array subforums_row Template data of subforums + * @since 3.1.0-a1 + * @change 3.1.0-b5 Added var subforums_row + */ + $vars = array('forum_row', 'row', 'subforums_row'); + extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_template_vars', compact($vars))); + + $template->assign_block_vars('forumrow', $forum_row); + + // Assign subforums loop for style authors + $template->assign_block_vars_array('forumrow.subforum', $subforums_row); + + /** + * Modify and/or assign additional template data for the forum + * after forumrow loop has been assigned. This can be used + * to create additional forumrow subloops in extensions. + * + * This event is triggered once per forum + * + * @event core.display_forums_add_template_data + * @var array forum_row Template data of the forum + * @var array row The data of the forum + * @var array subforums_list The data of subforums + * @var array subforums_row Template data of subforums + * @var bool catless The flag indicating whether a forum has a parent category + * @since 3.1.0-b5 + */ + $vars = array( + 'forum_row', + 'row', + 'subforums_list', + 'subforums_row', + 'catless', + ); + extract($phpbb_dispatcher->trigger_event('core.display_forums_add_template_data', compact($vars))); + + $last_catless = $catless; + } + + $template->assign_vars(array( + 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . '&f=' . $root_data['forum_id'] . '&mark=forums&mark_time=' . time()) : '', + 'S_HAS_SUBFORUM' => ($visible_forums) ? true : false, + 'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'], + 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), + 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPICS_UNAPPROVED'), + 'UNAPPROVED_POST_IMG' => $user->img('icon_topic_unapproved', 'POSTS_UNAPPROVED_FORUM'), + )); + + /** + * Event to perform additional actions after the forum list has been generated + * + * @event core.display_forums_after + * @var array active_forum_ary Array with forum data to display active topics + * @var bool display_moderators Flag indicating if we display forum moderators + * @var array forum_moderators Array with forum moderators list + * @var array forum_rows Data array of all forums we display + * @var bool return_moderators Flag indicating if moderators list should be returned + * @var array root_data Array with the root forum data + * @since 3.1.0-RC5 + */ + $vars = array( + 'active_forum_ary', + 'display_moderators', + 'forum_moderators', + 'forum_rows', + 'return_moderators', + 'root_data', + ); + extract($phpbb_dispatcher->trigger_event('core.display_forums_after', compact($vars))); + + if ($return_moderators) + { + return array($active_forum_ary, $forum_moderators); + } + + return array($active_forum_ary, array()); +} + +/** +* Create forum rules for given forum +*/ +function generate_forum_rules(&$forum_data) +{ + if (!$forum_data['forum_rules'] && !$forum_data['forum_rules_link']) + { + return; + } + + global $template, $phpbb_root_path, $phpEx; + + if ($forum_data['forum_rules']) + { + $forum_data['forum_rules'] = generate_text_for_display($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options']); + } + + $template->assign_vars(array( + 'S_FORUM_RULES' => true, + 'U_FORUM_RULES' => $forum_data['forum_rules_link'], + 'FORUM_RULES' => $forum_data['forum_rules']) + ); +} + +/** +* Create forum navigation links for given forum, create parent +* list if currently null, assign basic forum info to template +*/ +function generate_forum_nav(&$forum_data) +{ + global $db, $user, $template, $auth, $config; + global $phpEx, $phpbb_root_path; + + if (!$auth->acl_get('f_list', $forum_data['forum_id'])) + { + return; + } + + // Get forum parents + $forum_parents = get_forum_parents($forum_data); + + $microdata_attr = 'data-forum-id'; + + // Build navigation links + if (!empty($forum_parents)) + { + foreach ($forum_parents as $parent_forum_id => $parent_data) + { + list($parent_name, $parent_type) = array_values($parent_data); + + // Skip this parent if the user does not have the permission to view it + if (!$auth->acl_get('f_list', $parent_forum_id)) + { + continue; + } + + $template->assign_block_vars('navlinks', array( + 'S_IS_CAT' => ($parent_type == FORUM_CAT) ? true : false, + 'S_IS_LINK' => ($parent_type == FORUM_LINK) ? true : false, + 'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false, + 'FORUM_NAME' => $parent_name, + 'FORUM_ID' => $parent_forum_id, + 'MICRODATA' => $microdata_attr . '="' . $parent_forum_id . '"', + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id)) + ); + } + } + + $template->assign_block_vars('navlinks', array( + 'S_IS_CAT' => ($forum_data['forum_type'] == FORUM_CAT) ? true : false, + 'S_IS_LINK' => ($forum_data['forum_type'] == FORUM_LINK) ? true : false, + 'S_IS_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false, + 'FORUM_NAME' => $forum_data['forum_name'], + 'FORUM_ID' => $forum_data['forum_id'], + 'MICRODATA' => $microdata_attr . '="' . $forum_data['forum_id'] . '"', + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data['forum_id'])) + ); + + $template->assign_vars(array( + 'FORUM_ID' => $forum_data['forum_id'], + 'FORUM_NAME' => $forum_data['forum_name'], + 'FORUM_DESC' => generate_text_for_display($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options']), + + 'S_ENABLE_FEEDS_FORUM' => ($config['feed_forum'] && $forum_data['forum_type'] == FORUM_POST && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $forum_data['forum_options'])) ? true : false, + )); + + return; +} + +/** +* Returns forum parents as an array. Get them from forum_data if available, or update the database otherwise +*/ +function get_forum_parents(&$forum_data) +{ + global $db; + + $forum_parents = array(); + + if ($forum_data['parent_id'] > 0) + { + if ($forum_data['forum_parents'] == '') + { + $sql = 'SELECT forum_id, forum_name, forum_type + FROM ' . FORUMS_TABLE . ' + WHERE left_id < ' . $forum_data['left_id'] . ' + AND right_id > ' . $forum_data['right_id'] . ' + ORDER BY left_id ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_parents[$row['forum_id']] = array($row['forum_name'], (int) $row['forum_type']); + } + $db->sql_freeresult($result); + + $forum_data['forum_parents'] = serialize($forum_parents); + + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET forum_parents = '" . $db->sql_escape($forum_data['forum_parents']) . "' + WHERE parent_id = " . $forum_data['parent_id']; + $db->sql_query($sql); + } + else + { + $forum_parents = unserialize($forum_data['forum_parents']); + } + } + + return $forum_parents; +} + +/** +* Obtain list of moderators of each forum +*/ +function get_moderators(&$forum_moderators, $forum_id = false) +{ + global $config, $template, $db, $phpbb_root_path, $phpEx, $user, $auth; + + $forum_id_ary = array(); + + if ($forum_id !== false) + { + if (!is_array($forum_id)) + { + $forum_id = array($forum_id); + } + + // Exchange key/value pair to be able to faster check for the forum id existence + $forum_id_ary = array_flip($forum_id); + } + + $sql_array = array( + 'SELECT' => 'm.*, u.user_colour, g.group_colour, g.group_type', + + 'FROM' => array( + MODERATOR_CACHE_TABLE => 'm', + ), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(USERS_TABLE => 'u'), + 'ON' => 'm.user_id = u.user_id', + ), + array( + 'FROM' => array(GROUPS_TABLE => 'g'), + 'ON' => 'm.group_id = g.group_id', + ), + ), + + 'WHERE' => 'm.display_on_index = 1', + ); + + // 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); + + while ($row = $db->sql_fetchrow($result)) + { + $f_id = (int) $row['forum_id']; + + if (!isset($forum_id_ary[$f_id])) + { + continue; + } + + if (!empty($row['user_id'])) + { + $forum_moderators[$f_id][] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']); + } + else + { + $group_name = (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']); + + if ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) + { + $forum_moderators[$f_id][] = '' . $group_name . ''; + } + else + { + $forum_moderators[$f_id][] = '' . $group_name . ''; + } + } + } + $db->sql_freeresult($result); + + return; +} + +/** +* User authorisation levels output +* +* @param string $mode Can be forum or topic. Not in use at the moment. +* @param int $forum_id The current forum the user is in. +* @param int $forum_status The forums status bit. +*/ +function gen_forum_auth_level($mode, $forum_id, $forum_status) +{ + global $template, $auth, $user, $config; + + $locked = ($forum_status == ITEM_LOCKED && !$auth->acl_get('m_edit', $forum_id)) ? true : false; + + $rules = array( + ($auth->acl_get('f_post', $forum_id) && !$locked) ? $user->lang['RULES_POST_CAN'] : $user->lang['RULES_POST_CANNOT'], + ($auth->acl_get('f_reply', $forum_id) && !$locked) ? $user->lang['RULES_REPLY_CAN'] : $user->lang['RULES_REPLY_CANNOT'], + ($user->data['is_registered'] && $auth->acl_gets('f_edit', 'm_edit', $forum_id) && !$locked) ? $user->lang['RULES_EDIT_CAN'] : $user->lang['RULES_EDIT_CANNOT'], + ($user->data['is_registered'] && ($auth->acl_gets('f_delete', 'm_delete', $forum_id) || $auth->acl_gets('f_softdelete', 'm_softdelete', $forum_id)) && !$locked) ? $user->lang['RULES_DELETE_CAN'] : $user->lang['RULES_DELETE_CANNOT'], + ); + + if ($config['allow_attachments']) + { + $rules[] = ($auth->acl_get('f_attach', $forum_id) && $auth->acl_get('u_attach') && !$locked) ? $user->lang['RULES_ATTACH_CAN'] : $user->lang['RULES_ATTACH_CANNOT']; + } + + foreach ($rules as $rule) + { + $template->assign_block_vars('rules', array('RULE' => $rule)); + } + + return; +} + +/** +* Generate topic status +*/ +function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$folder_alt, &$topic_type) +{ + global $user, $config; + + $folder = $folder_new = ''; + + if ($topic_row['topic_status'] == ITEM_MOVED) + { + $topic_type = $user->lang['VIEW_TOPIC_MOVED']; + $folder_img = 'topic_moved'; + $folder_alt = 'TOPIC_MOVED'; + } + else + { + switch ($topic_row['topic_type']) + { + case POST_GLOBAL: + $topic_type = $user->lang['VIEW_TOPIC_GLOBAL']; + $folder = 'global_read'; + $folder_new = 'global_unread'; + break; + + case POST_ANNOUNCE: + $topic_type = $user->lang['VIEW_TOPIC_ANNOUNCEMENT']; + $folder = 'announce_read'; + $folder_new = 'announce_unread'; + break; + + case POST_STICKY: + $topic_type = $user->lang['VIEW_TOPIC_STICKY']; + $folder = 'sticky_read'; + $folder_new = 'sticky_unread'; + break; + + default: + $topic_type = ''; + $folder = 'topic_read'; + $folder_new = 'topic_unread'; + + // Hot topic threshold is for posts in a topic, which is replies + the first post. ;) + if ($config['hot_threshold'] && ($replies + 1) >= $config['hot_threshold'] && $topic_row['topic_status'] != ITEM_LOCKED) + { + $folder .= '_hot'; + $folder_new .= '_hot'; + } + break; + } + + if ($topic_row['topic_status'] == ITEM_LOCKED) + { + $topic_type = $user->lang['VIEW_TOPIC_LOCKED']; + $folder .= '_locked'; + $folder_new .= '_locked'; + } + + $folder_img = ($unread_topic) ? $folder_new : $folder; + $folder_alt = ($unread_topic) ? 'UNREAD_POSTS' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_UNREAD_POSTS'); + + // Posted image? + if (!empty($topic_row['topic_posted']) && $topic_row['topic_posted']) + { + $folder_img .= '_mine'; + } + } + + if ($topic_row['poll_start'] && $topic_row['topic_status'] != ITEM_MOVED) + { + $topic_type = $user->lang['VIEW_TOPIC_POLL']; + } +} + +/** +* Assign/Build custom bbcodes for display in screens supporting using of bbcodes +* The custom bbcodes buttons will be placed within the template block 'custom_tags' +*/ +function display_custom_bbcodes() +{ + global $db, $template, $user, $phpbb_dispatcher; + + // Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing) + $num_predefined_bbcodes = 22; + + $sql_ary = array( + 'SELECT' => 'b.bbcode_id, b.bbcode_tag, b.bbcode_helpline', + 'FROM' => array(BBCODES_TABLE => 'b'), + 'WHERE' => 'b.display_on_posting = 1', + 'ORDER_BY' => 'b.bbcode_tag', + ); + + /** + * Event to modify the SQL query before custom bbcode data is queried + * + * @event core.display_custom_bbcodes_modify_sql + * @var array sql_ary The SQL array to get the bbcode data + * @var int num_predefined_bbcodes The number of predefined core bbcodes + * (multiplied by factor of 2) + * @since 3.1.0-a3 + */ + $vars = array('sql_ary', 'num_predefined_bbcodes'); + extract($phpbb_dispatcher->trigger_event('core.display_custom_bbcodes_modify_sql', compact($vars))); + + $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); + + $i = 0; + while ($row = $db->sql_fetchrow($result)) + { + // If the helpline is defined within the language file, we will use the localised version, else just use the database entry... + if (isset($user->lang[strtoupper($row['bbcode_helpline'])])) + { + $row['bbcode_helpline'] = $user->lang[strtoupper($row['bbcode_helpline'])]; + } + + $custom_tags = array( + 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'", + 'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2), + 'BBCODE_TAG' => $row['bbcode_tag'], + 'BBCODE_TAG_CLEAN' => str_replace('=', '-', $row['bbcode_tag']), + 'BBCODE_HELPLINE' => $row['bbcode_helpline'], + 'A_BBCODE_HELPLINE' => str_replace(array('&', '"', "'", '<', '>'), array('&', '"', "\'", '<', '>'), $row['bbcode_helpline']), + ); + + /** + * Event to modify the template data block of a custom bbcode + * + * This event is triggered once per bbcode + * + * @event core.display_custom_bbcodes_modify_row + * @var array custom_tags Template data of the bbcode + * @var array row The data of the bbcode + * @since 3.1.0-a1 + */ + $vars = array('custom_tags', 'row'); + extract($phpbb_dispatcher->trigger_event('core.display_custom_bbcodes_modify_row', compact($vars))); + + $template->assign_block_vars('custom_tags', $custom_tags); + + $i++; + } + $db->sql_freeresult($result); + + /** + * Display custom bbcodes + * + * @event core.display_custom_bbcodes + * @since 3.1.0-a1 + */ + $phpbb_dispatcher->dispatch('core.display_custom_bbcodes'); +} + +/** +* Display reasons +*/ +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'])]; + } + + $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); +} + +/** +* Display user activity (action forum/topic) +*/ +function display_user_activity(&$userdata) +{ + global $auth, $template, $db, $user; + global $phpbb_root_path, $phpEx; + global $phpbb_container, $phpbb_dispatcher; + + // Do not display user activity for users having more than 5000 posts... + if ($userdata['user_posts'] > 5000) + { + return; + } + + $forum_ary = array(); + + $forum_read_ary = $auth->acl_getf('f_read'); + foreach ($forum_read_ary as $forum_id => $allowed) + { + if ($allowed['f_read']) + { + $forum_ary[] = (int) $forum_id; + } + } + + $forum_ary = array_diff($forum_ary, $user->get_passworded_forums()); + + $active_f_row = $active_t_row = array(); + if (!empty($forum_ary)) + { + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + + // Obtain active forum + $sql = 'SELECT forum_id, COUNT(post_id) AS num_posts + FROM ' . POSTS_TABLE . ' + WHERE poster_id = ' . $userdata['user_id'] . ' + AND post_postcount = 1 + AND ' . $phpbb_content_visibility->get_forums_visibility_sql('post', $forum_ary) . ' + GROUP BY forum_id + ORDER BY num_posts DESC'; + $result = $db->sql_query_limit($sql, 1); + $active_f_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!empty($active_f_row)) + { + $sql = 'SELECT forum_name + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $active_f_row['forum_id']; + $result = $db->sql_query($sql, 3600); + $active_f_row['forum_name'] = (string) $db->sql_fetchfield('forum_name'); + $db->sql_freeresult($result); + } + + // Obtain active topic + $sql = 'SELECT topic_id, COUNT(post_id) AS num_posts + FROM ' . POSTS_TABLE . ' + WHERE poster_id = ' . $userdata['user_id'] . ' + AND post_postcount = 1 + AND ' . $phpbb_content_visibility->get_forums_visibility_sql('post', $forum_ary) . ' + GROUP BY topic_id + ORDER BY num_posts DESC'; + $result = $db->sql_query_limit($sql, 1); + $active_t_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!empty($active_t_row)) + { + $sql = 'SELECT topic_title + FROM ' . TOPICS_TABLE . ' + WHERE topic_id = ' . $active_t_row['topic_id']; + $result = $db->sql_query($sql); + $active_t_row['topic_title'] = (string) $db->sql_fetchfield('topic_title'); + $db->sql_freeresult($result); + } + } + + /** + * Alter list of forums and topics to display as active + * + * @event core.display_user_activity_modify_actives + * @var array userdata User's data + * @var array active_f_row List of active forums + * @var array active_t_row List of active posts + * @since 3.1.0-RC3 + */ + $vars = array('userdata', 'active_f_row', 'active_t_row'); + extract($phpbb_dispatcher->trigger_event('core.display_user_activity_modify_actives', compact($vars))); + + $userdata['active_t_row'] = $active_t_row; + $userdata['active_f_row'] = $active_f_row; + + $active_f_name = $active_f_id = $active_f_count = $active_f_pct = ''; + if (!empty($active_f_row['num_posts'])) + { + $active_f_name = $active_f_row['forum_name']; + $active_f_id = $active_f_row['forum_id']; + $active_f_count = $active_f_row['num_posts']; + $active_f_pct = ($userdata['user_posts']) ? ($active_f_count / $userdata['user_posts']) * 100 : 0; + } + + $active_t_name = $active_t_id = $active_t_count = $active_t_pct = ''; + if (!empty($active_t_row['num_posts'])) + { + $active_t_name = $active_t_row['topic_title']; + $active_t_id = $active_t_row['topic_id']; + $active_t_count = $active_t_row['num_posts']; + $active_t_pct = ($userdata['user_posts']) ? ($active_t_count / $userdata['user_posts']) * 100 : 0; + } + + $l_active_pct = ($userdata['user_id'] != ANONYMOUS && $userdata['user_id'] == $user->data['user_id']) ? $user->lang['POST_PCT_ACTIVE_OWN'] : $user->lang['POST_PCT_ACTIVE']; + + $template->assign_vars(array( + 'ACTIVE_FORUM' => $active_f_name, + 'ACTIVE_FORUM_POSTS' => $user->lang('USER_POSTS', (int) $active_f_count), + 'ACTIVE_FORUM_PCT' => sprintf($l_active_pct, $active_f_pct), + 'ACTIVE_TOPIC' => censor_text($active_t_name), + 'ACTIVE_TOPIC_POSTS' => $user->lang('USER_POSTS', (int) $active_t_count), + 'ACTIVE_TOPIC_PCT' => sprintf($l_active_pct, $active_t_pct), + 'U_ACTIVE_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $active_f_id), + 'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id), + 'S_SHOW_ACTIVITY' => true) + ); +} + +/** +* Topic and forum watching common code +*/ +function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0, $item_title = '') +{ + global $template, $db, $user, $phpEx, $start, $phpbb_root_path; + global $request; + + $table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE; + $where_sql = ($mode == 'forum') ? 'forum_id' : 'topic_id'; + $match_id = ($mode == 'forum') ? $forum_id : $topic_id; + $u_url = "uid={$user->data['user_id']}"; + $u_url .= ($mode == 'forum') ? '&f' : '&f=' . $forum_id . '&t'; + $is_watching = 0; + + // Is user watching this topic? + if ($user_id != ANONYMOUS) + { + $can_watch = true; + + if ($notify_status == 'unset') + { + $sql = "SELECT notify_status + FROM $table_sql + WHERE $where_sql = $match_id + AND user_id = $user_id"; + $result = $db->sql_query($sql); + + $notify_status = ($row = $db->sql_fetchrow($result)) ? $row['notify_status'] : NULL; + $db->sql_freeresult($result); + } + + if (!is_null($notify_status) && $notify_status !== '') + { + if (isset($_GET['unwatch'])) + { + $uid = request_var('uid', 0); + $token = request_var('hash', ''); + + if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true)) + { + if ($uid != $user_id || $request->variable('unwatch', '', false, \phpbb\request\request_interface::GET) != $mode) + { + $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); + $message = $user->lang['ERR_UNWATCHING']; + + if (!$request->is_ajax()) + { + $message .= '

' . $user->lang('RETURN_' . strtoupper($mode), '', ''); + } + trigger_error($message); + } + + $sql = 'DELETE FROM ' . $table_sql . " + WHERE $where_sql = $match_id + AND user_id = $user_id"; + $db->sql_query($sql); + + $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); + $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)]; + + if (!$request->is_ajax()) + { + $message .= '

' . $user->lang('RETURN_' . strtoupper($mode), '', ''); + } + meta_refresh(3, $redirect_url); + trigger_error($message); + } + else + { + $s_hidden_fields = array( + 'uid' => $user->data['user_id'], + 'unwatch' => $mode, + 'start' => $start, + 'f' => $forum_id, + ); + if ($mode != 'forum') + { + $s_hidden_fields['t'] = $topic_id; + } + + if ($item_title == '') + { + $confirm_box_message = 'UNWATCH_' . strtoupper($mode); + } + else + { + $confirm_box_message = $user->lang('UNWATCH_' . strtoupper($mode) . '_DETAILED', $item_title); + } + confirm_box(false, $confirm_box_message, build_hidden_fields($s_hidden_fields)); + } + } + else + { + $is_watching = true; + + if ($notify_status != NOTIFY_YES) + { + $sql = 'UPDATE ' . $table_sql . " + SET notify_status = " . NOTIFY_YES . " + WHERE $where_sql = $match_id + AND user_id = $user_id"; + $db->sql_query($sql); + } + } + } + else + { + if (isset($_GET['watch'])) + { + $uid = request_var('uid', 0); + $token = request_var('hash', ''); + + if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true)) + { + if ($uid != $user_id || $request->variable('watch', '', false, \phpbb\request\request_interface::GET) != $mode) + { + $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); + $message = $user->lang['ERR_WATCHING']; + + if (!$request->is_ajax()) + { + $message .= '

' . $user->lang('RETURN_' . strtoupper($mode), '', ''); + } + trigger_error($message); + } + + $is_watching = true; + + $sql = 'INSERT INTO ' . $table_sql . " (user_id, $where_sql, notify_status) + VALUES ($user_id, $match_id, " . NOTIFY_YES . ')'; + $db->sql_query($sql); + + $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); + $message = $user->lang['ARE_WATCHING_' . strtoupper($mode)]; + + if (!$request->is_ajax()) + { + $message .= '

' . $user->lang('RETURN_' . strtoupper($mode), '', ''); + } + meta_refresh(3, $redirect_url); + trigger_error($message); + } + else + { + $s_hidden_fields = array( + 'uid' => $user->data['user_id'], + 'watch' => $mode, + 'start' => $start, + 'f' => $forum_id, + ); + if ($mode != 'forum') + { + $s_hidden_fields['t'] = $topic_id; + } + + $confirm_box_message = (($item_title == '') ? 'WATCH_' . strtoupper($mode) : $user->lang('WATCH_' . strtoupper($mode) . '_DETAILED', $item_title)); + confirm_box(false, $confirm_box_message, build_hidden_fields($s_hidden_fields)); + } + } + else + { + $is_watching = 0; + } + } + } + else + { + if ((isset($_GET['unwatch']) && $request->variable('unwatch', '', false, \phpbb\request\request_interface::GET) == $mode) || + (isset($_GET['watch']) && $request->variable('watch', '', false, \phpbb\request\request_interface::GET) == $mode)) + { + login_box(); + } + else + { + $can_watch = 0; + $is_watching = 0; + } + } + + if ($can_watch) + { + $s_watching['link'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start&hash=" . generate_link_hash("{$mode}_$match_id")); + $s_watching['link_toggle'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&" . ((!$is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start&hash=" . generate_link_hash("{$mode}_$match_id")); + $s_watching['title'] = $user->lang[(($is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)]; + $s_watching['title_toggle'] = $user->lang[((!$is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)]; + $s_watching['is_watching'] = $is_watching; + } + + return; +} + +/** +* Get user rank title and image +* +* @param array $user_data the current stored users data +* @param int $user_posts the users number of posts +* +* @return array An associative array containing the rank title (title), the rank image source (img) and the rank image as full img tag (img) +* +* Note: since we do not want to break backwards-compatibility, this function will only properly assign ranks to guests if you call it for them with user_posts == false +*/ +function phpbb_get_user_rank($user_data, $user_posts) +{ + global $ranks, $config, $phpbb_root_path, $phpbb_path_helper, $phpbb_dispatcher; + + $user_rank_data = array( + 'title' => null, + 'img' => null, + 'img_src' => null, + ); + + /** + * Preparing a user's rank before displaying + * + * @event core.modify_user_rank + * @var array user_data Array with user's data + * @var int user_posts User_posts to change + * @since 3.1.0-RC4 + */ + + $vars = array('user_data', 'user_posts'); + extract($phpbb_dispatcher->trigger_event('core.modify_user_rank', compact($vars))); + + if (empty($ranks)) + { + global $cache; + $ranks = $cache->obtain_ranks(); + } + + if (!empty($user_data['user_rank'])) + { + + $user_rank_data['title'] = (isset($ranks['special'][$user_data['user_rank']]['rank_title'])) ? $ranks['special'][$user_data['user_rank']]['rank_title'] : ''; + + $user_rank_data['img_src'] = (!empty($ranks['special'][$user_data['user_rank']]['rank_image'])) ? $phpbb_path_helper->update_web_root_path($phpbb_root_path . $config['ranks_path'] . '/' . $ranks['special'][$user_data['user_rank']]['rank_image']) : ''; + + $user_rank_data['img'] = (!empty($ranks['special'][$user_data['user_rank']]['rank_image'])) ? '' . $ranks['special'][$user_data['user_rank']]['rank_title'] . '' : ''; + } + else if ($user_posts !== false) + { + if (!empty($ranks['normal'])) + { + foreach ($ranks['normal'] as $rank) + { + if ($user_posts >= $rank['rank_min']) + { + $user_rank_data['title'] = $rank['rank_title']; + $user_rank_data['img_src'] = (!empty($rank['rank_image'])) ? $phpbb_path_helper->update_web_root_path($phpbb_root_path . $config['ranks_path'] . '/' . $rank['rank_image']) : ''; + $user_rank_data['img'] = (!empty($rank['rank_image'])) ? '' . $rank['rank_title'] . '' : ''; + break; + } + } + } + } + + return $user_rank_data; +} + +/** +* Prepare profile data +*/ +function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false, $check_can_receive_pm = true) +{ + global $config, $auth, $user, $phpEx, $phpbb_root_path, $phpbb_dispatcher; + + $username = $data['username']; + $user_id = $data['user_id']; + + $user_rank_data = phpbb_get_user_rank($data, (($user_id == ANONYMOUS) ? false : $data['user_posts'])); + + if ((!empty($data['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_user')) + { + $email = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&u=' . $user_id) : (($config['board_hide_emails'] && !$auth->acl_get('a_user')) ? '' : 'mailto:' . $data['user_email']); + } + else + { + $email = ''; + } + + if ($config['load_onlinetrack']) + { + $update_time = $config['load_online_time'] * 60; + $online = (time() - $update_time < $data['session_time'] && ((isset($data['session_viewonline']) && $data['session_viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false; + } + else + { + $online = false; + } + + if ($data['user_allow_viewonline'] || $auth->acl_get('u_viewonline')) + { + $last_active = (!empty($data['session_time'])) ? $data['session_time'] : $data['user_lastvisit']; + } + else + { + $last_active = ''; + } + + $age = ''; + + if ($config['allow_birthdays'] && $data['user_birthday']) + { + list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $data['user_birthday'])); + + if ($bday_year) + { + $now = $user->create_datetime(); + $now = phpbb_gmgetdate($now->getTimestamp() + $now->getOffset()); + + $diff = $now['mon'] - $bday_month; + if ($diff == 0) + { + $diff = ($now['mday'] - $bday_day < 0) ? 1 : 0; + } + else + { + $diff = ($diff < 0) ? 1 : 0; + } + + $age = max(0, (int) ($now['year'] - $bday_year - $diff)); + } + } + + if (!function_exists('phpbb_get_banned_user_ids')) + { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + } + + // Can this user receive a Private Message? + $can_receive_pm = $check_can_receive_pm && ( + // They must be a "normal" user + $data['user_type'] != USER_IGNORE && + + // They must not be deactivated by the administrator + ($data['user_type'] != USER_INACTIVE || $data['user_inactive_reason'] != INACTIVE_MANUAL) && + + // They must be able to read PMs + sizeof($auth->acl_get_list($user_id, 'u_readpm')) && + + // They must not be permanently banned + !sizeof(phpbb_get_banned_user_ids($user_id, false)) && + + // They must allow users to contact via PM + (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $data['user_allow_pm']) + ); + + // Dump it out to the template + $template_data = array( + 'AGE' => $age, + 'RANK_TITLE' => $user_rank_data['title'], + 'JOINED' => $user->format_date($data['user_regdate']), + 'LAST_ACTIVE' => (empty($last_active)) ? ' - ' : $user->format_date($last_active), + 'POSTS' => ($data['user_posts']) ? $data['user_posts'] : 0, + 'WARNINGS' => isset($data['user_warnings']) ? $data['user_warnings'] : 0, + + 'USERNAME_FULL' => get_username_string('full', $user_id, $username, $data['user_colour']), + 'USERNAME' => get_username_string('username', $user_id, $username, $data['user_colour']), + 'USER_COLOR' => get_username_string('colour', $user_id, $username, $data['user_colour']), + 'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $username, $data['user_colour']), + + 'A_USERNAME' => addslashes(get_username_string('username', $user_id, $username, $data['user_colour'])), + + 'AVATAR_IMG' => phpbb_get_user_avatar($data), + 'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : (($online) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')), + 'S_ONLINE' => ($config['load_onlinetrack'] && $online) ? true : false, + 'RANK_IMG' => $user_rank_data['img'], + 'RANK_IMG_SRC' => $user_rank_data['img_src'], + 'S_JABBER_ENABLED' => ($config['jab_enable']) ? true : false, + + 'S_WARNINGS' => ($auth->acl_getf_global('m_') || $auth->acl_get('m_warn')) ? true : false, + + 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&sr=posts") : '', + 'U_NOTES' => ($user_notes_enabled && $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $user_id, true, $user->session_id) : '', + 'U_WARN' => ($warn_user_enabled && $auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $user_id, true, $user->session_id) : '', + 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && $can_receive_pm) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $user_id) : '', + 'U_EMAIL' => $email, + 'U_JABBER' => ($data['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=jabber&u=' . $user_id) : '', + + 'USER_JABBER' => ($config['jab_enable']) ? $data['user_jabber'] : '', + 'USER_JABBER_IMG' => ($config['jab_enable'] && $data['user_jabber']) ? $user->img('icon_contact_jabber', $data['user_jabber']) : '', + + 'L_SEND_EMAIL_USER' => $user->lang('SEND_EMAIL_USER', $username), + 'L_CONTACT_USER' => $user->lang('CONTACT_USER', $username), + 'L_VIEWING_PROFILE' => $user->lang('VIEWING_PROFILE', $username), + ); + + /** + * Preparing a user's data before displaying it in profile and memberlist + * + * @event core.memberlist_prepare_profile_data + * @var array data Array with user's data + * @var array template_data Template array with user's data + * @since 3.1.0-a1 + */ + $vars = array('data', 'template_data'); + extract($phpbb_dispatcher->trigger_event('core.memberlist_prepare_profile_data', compact($vars))); + + return $template_data; +} + +function phpbb_sort_last_active($first, $second) +{ + global $id_cache, $sort_dir; + + $lesser_than = ($sort_dir === 'd') ? -1 : 1; + + if (isset($id_cache[$first]['group_leader']) && $id_cache[$first]['group_leader'] && (!isset($id_cache[$second]['group_leader']) || !$id_cache[$second]['group_leader'])) + { + return -1; + } + else if (isset($id_cache[$second]['group_leader']) && (!isset($id_cache[$first]['group_leader']) || !$id_cache[$first]['group_leader']) && $id_cache[$second]['group_leader']) + { + return 1; + } + else + { + return $lesser_than * (int) ($id_cache[$first]['last_visit'] - $id_cache[$second]['last_visit']); + } +} diff --git a/sources/phpBB/includes/functions_download.php b/sources/phpBB/includes/functions_download.php new file mode 100644 index 0000000..fbeae50 --- /dev/null +++ b/sources/phpBB/includes/functions_download.php @@ -0,0 +1,739 @@ + +* @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 simplified function to deliver avatars +* The argument needs to be checked before calling this function. +*/ +function send_avatar_to_browser($file, $browser) +{ + global $config, $phpbb_root_path; + + $prefix = $config['avatar_salt'] . '_'; + $image_dir = $config['avatar_path']; + + // Adjust image_dir path (no trailing slash) + if (substr($image_dir, -1, 1) == '/' || substr($image_dir, -1, 1) == '\\') + { + $image_dir = substr($image_dir, 0, -1) . '/'; + } + $image_dir = str_replace(array('../', '..\\', './', '.\\'), '', $image_dir); + + if ($image_dir && ($image_dir[0] == '/' || $image_dir[0] == '\\')) + { + $image_dir = ''; + } + $file_path = $phpbb_root_path . $image_dir . '/' . $prefix . $file; + + if ((@file_exists($file_path) && @is_readable($file_path)) && !headers_sent()) + { + header('Cache-Control: public'); + + $image_data = @getimagesize($file_path); + header('Content-Type: ' . image_type_to_mime_type($image_data[2])); + + if ((strpos(strtolower($browser), 'msie') !== false) && !phpbb_is_greater_ie_version($browser, 7)) + { + header('Content-Disposition: attachment; ' . header_filename($file)); + + if (strpos(strtolower($browser), 'msie 6.0') !== false) + { + header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); + } + else + { + header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 31536000) . ' GMT'); + } + } + else + { + header('Content-Disposition: inline; ' . header_filename($file)); + header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 31536000) . ' GMT'); + } + + $size = @filesize($file_path); + if ($size) + { + header("Content-Length: $size"); + } + + if (@readfile($file_path) == false) + { + $fp = @fopen($file_path, 'rb'); + + if ($fp !== false) + { + while (!feof($fp)) + { + echo fread($fp, 8192); + } + fclose($fp); + } + } + + flush(); + } + else + { + header('HTTP/1.0 404 Not Found'); + } +} + +/** +* Wraps an url into a simple html page. Used to display attachments in IE. +* this is a workaround for now; might be moved to template system later +* direct any complaints to 1 Microsoft Way, Redmond +*/ +function wrap_img_in_html($src, $title) +{ + echo ''; + echo ''; + echo ''; + echo ''; + echo '' . $title . ''; + echo ''; + echo ''; + echo '
'; + echo '' . $title . ''; + echo '
'; + echo ''; + echo ''; +} + +/** +* Send file to browser +*/ +function send_file_to_browser($attachment, $upload_dir, $category) +{ + global $user, $db, $config, $phpbb_root_path; + + $filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename']; + + if (!@file_exists($filename)) + { + send_status_line(404, 'Not Found'); + trigger_error('ERROR_NO_ATTACHMENT'); + } + + // Correct the mime type - we force application/octetstream for all files, except images + // Please do not change this, it is a security precaution + if ($category != ATTACHMENT_CATEGORY_IMAGE || strpos($attachment['mimetype'], 'image') !== 0) + { + $attachment['mimetype'] = (strpos(strtolower($user->browser), 'msie') !== false || strpos(strtolower($user->browser), 'opera') !== false) ? 'application/octetstream' : 'application/octet-stream'; + } + + if (@ob_get_length()) + { + @ob_end_clean(); + } + + // Now send the File Contents to the Browser + $size = @filesize($filename); + + // To correctly display further errors we need to make sure we are using the correct headers for both (unsetting content-length may not work) + + // Check if headers already sent or not able to get the file contents. + if (headers_sent() || !@file_exists($filename) || !@is_readable($filename)) + { + // PHP track_errors setting On? + if (!empty($php_errormsg)) + { + send_status_line(500, 'Internal Server Error'); + trigger_error($user->lang['UNABLE_TO_DELIVER_FILE'] . '
' . sprintf($user->lang['TRACKED_PHP_ERROR'], $php_errormsg)); + } + + send_status_line(500, 'Internal Server Error'); + trigger_error('UNABLE_TO_DELIVER_FILE'); + } + + // Make sure the database record for the filesize is correct + if ($size > 0 && $size != $attachment['filesize']) + { + // Update database record + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' + SET filesize = ' . (int) $size . ' + WHERE attach_id = ' . (int) $attachment['attach_id']; + $db->sql_query($sql); + } + + // Now the tricky part... let's dance + header('Cache-Control: public'); + + // Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer. + header('Content-Type: ' . $attachment['mimetype']); + + if (phpbb_is_greater_ie_version($user->browser, 7)) + { + header('X-Content-Type-Options: nosniff'); + } + + if ($category == ATTACHMENT_CATEGORY_FLASH && request_var('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'); + } + else + { + if (empty($user->browser) || ((strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7))) + { + header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename']))); + if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false)) + { + header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); + } + } + else + { + header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename']))); + if (phpbb_is_greater_ie_version($user->browser, 7) && (strpos($attachment['mimetype'], 'image') !== 0)) + { + header('X-Download-Options: noopen'); + } + } + } + + if ($size) + { + header("Content-Length: $size"); + } + + // Close the db connection before sending the file etc. + file_gc(false); + + if (!set_modified_headers($attachment['filetime'], $user->browser)) + { + // We make sure those have to be enabled manually by defining a constant + // because of the potential disclosure of full attachment path + // in case support for features is absent in the webserver software. + if (defined('PHPBB_ENABLE_X_ACCEL_REDIRECT') && PHPBB_ENABLE_X_ACCEL_REDIRECT) + { + // X-Accel-Redirect - http://wiki.nginx.org/XSendfile + header('X-Accel-Redirect: ' . $user->page['root_script_path'] . $upload_dir . '/' . $attachment['physical_filename']); + exit; + } + else if (defined('PHPBB_ENABLE_X_SENDFILE') && PHPBB_ENABLE_X_SENDFILE && !phpbb_http_byte_range($size)) + { + // X-Sendfile - http://blog.lighttpd.net/articles/2006/07/02/x-sendfile + // Lighttpd's X-Sendfile does not support range requests as of 1.4.26 + // and always requires an absolute path. + header('X-Sendfile: ' . dirname(__FILE__) . "/../$upload_dir/{$attachment['physical_filename']}"); + exit; + } + + // Try to deliver in chunks + @set_time_limit(0); + + $fp = @fopen($filename, 'rb'); + + if ($fp !== false) + { + // Deliver file partially if requested + if ($range = phpbb_http_byte_range($size)) + { + fseek($fp, $range['byte_pos_start']); + + send_status_line(206, 'Partial Content'); + header('Content-Range: bytes ' . $range['byte_pos_start'] . '-' . $range['byte_pos_end'] . '/' . $range['bytes_total']); + header('Content-Length: ' . $range['bytes_requested']); + } + + while (!feof($fp)) + { + echo fread($fp, 8192); + } + fclose($fp); + } + else + { + @readfile($filename); + } + + flush(); + } + + exit; +} + +/** +* Get a browser friendly UTF-8 encoded filename +*/ +function header_filename($file) +{ + global $request; + + $user_agent = $request->header('User-Agent'); + + // There be dragons here. + // Not many follows the RFC... + if (strpos($user_agent, 'MSIE') !== false || strpos($user_agent, 'Safari') !== false || strpos($user_agent, 'Konqueror') !== false) + { + return "filename=" . rawurlencode($file); + } + + // follow the RFC for extended filename for the rest + return "filename*=UTF-8''" . rawurlencode($file); +} + +/** +* Check if downloading item is allowed +*/ +function download_allowed() +{ + global $config, $user, $db, $request; + + if (!$config['secure_downloads']) + { + return true; + } + + $url = htmlspecialchars_decode($request->header('Referer')); + + if (!$url) + { + return ($config['secure_allow_empty_referer']) ? true : false; + } + + // Split URL into domain and script part + $url = @parse_url($url); + + if ($url === false) + { + return ($config['secure_allow_empty_referer']) ? true : false; + } + + $hostname = $url['host']; + unset($url); + + $allowed = ($config['secure_allow_deny']) ? false : true; + $iplist = array(); + + if (($ip_ary = @gethostbynamel($hostname)) !== false) + { + foreach ($ip_ary as $ip) + { + if ($ip) + { + $iplist[] = $ip; + } + } + } + + // Check for own server... + $server_name = $user->host; + + // Forcing server vars is the only way to specify/override the protocol + if ($config['force_server_vars'] || !$server_name) + { + $server_name = $config['server_name']; + } + + if (preg_match('#^.*?' . preg_quote($server_name, '#') . '.*?$#i', $hostname)) + { + $allowed = true; + } + + // Get IP's and Hostnames + if (!$allowed) + { + $sql = 'SELECT site_ip, site_hostname, ip_exclude + FROM ' . SITELIST_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $site_ip = trim($row['site_ip']); + $site_hostname = trim($row['site_hostname']); + + if ($site_ip) + { + foreach ($iplist as $ip) + { + if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($site_ip, '#')) . '$#i', $ip)) + { + if ($row['ip_exclude']) + { + $allowed = ($config['secure_allow_deny']) ? false : true; + break 2; + } + else + { + $allowed = ($config['secure_allow_deny']) ? true : false; + } + } + } + } + + if ($site_hostname) + { + if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($site_hostname, '#')) . '$#i', $hostname)) + { + if ($row['ip_exclude']) + { + $allowed = ($config['secure_allow_deny']) ? false : true; + break; + } + else + { + $allowed = ($config['secure_allow_deny']) ? true : false; + } + } + } + } + $db->sql_freeresult($result); + } + + return $allowed; +} + +/** +* Check if the browser has the file already and set the appropriate headers- +* @returns false if a resend is in order. +*/ +function set_modified_headers($stamp, $browser) +{ + global $request; + + // let's see if we have to send the file at all + $last_load = $request->header('Modified-Since') ? strtotime(trim($request->header('Modified-Since'))) : false; + + if (strpos(strtolower($browser), 'msie 6.0') === false && !phpbb_is_greater_ie_version($browser, 7)) + { + if ($last_load !== false && $last_load >= $stamp) + { + send_status_line(304, 'Not Modified'); + // seems that we need those too ... browsers + header('Cache-Control: public'); + header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 31536000) . ' GMT'); + return true; + } + else + { + header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $stamp) . ' GMT'); + } + } + return false; +} + +/** +* Garbage Collection +* +* @param bool $exit Whether to die or not. +* +* @return null +*/ +function file_gc($exit = true) +{ + global $cache, $db; + + if (!empty($cache)) + { + $cache->unload(); + } + + $db->sql_close(); + + if ($exit) + { + exit; + } +} + +/** +* HTTP range support (RFC 2616 Section 14.35) +* +* Allows browsers to request partial file content +* in case a download has been interrupted. +* +* @param int $filesize the size of the file in bytes we are about to deliver +* +* @return mixed false if the whole file has to be delivered +* associative array on success +*/ +function phpbb_http_byte_range($filesize) +{ + // Only call find_range_request() once. + static $request_array; + + if (!$filesize) + { + return false; + } + + if (!isset($request_array)) + { + $request_array = phpbb_find_range_request(); + } + + return (empty($request_array)) ? false : phpbb_parse_range_request($request_array, $filesize); +} + +/** +* Searches for HTTP range request in request headers. +* +* @return mixed false if no request found +* array of strings containing the requested ranges otherwise +* e.g. array(0 => '0-0', 1 => '123-125') +*/ +function phpbb_find_range_request() +{ + global $request; + + $value = $request->header('Range'); + + // Make sure range request starts with "bytes=" + if (strpos($value, 'bytes=') === 0) + { + // Strip leading 'bytes=' + // Multiple ranges can be separated by a comma + return explode(',', substr($value, 6)); + } + + return false; +} + +/** +* Analyses a range request array. +* +* A range request can contain multiple ranges, +* we however only handle the first request and +* only support requests from a given byte to the end of the file. +* +* @param array $request_array array of strings containing the requested ranges +* @param int $filesize the full size of the file in bytes that has been requested +* +* @return mixed false if the whole file has to be delivered +* associative array on success +* byte_pos_start the first byte position, can be passed to fseek() +* byte_pos_end the last byte position +* bytes_requested the number of bytes requested +* bytes_total the full size of the file +*/ +function phpbb_parse_range_request($request_array, $filesize) +{ + // Go through all ranges + foreach ($request_array as $range_string) + { + $range = explode('-', trim($range_string)); + + // "-" is invalid, "0-0" however is valid and means the very first byte. + if (sizeof($range) != 2 || $range[0] === '' && $range[1] === '') + { + continue; + } + + if ($range[0] === '') + { + // Return last $range[1] bytes. + + if (!$range[1]) + { + continue; + } + + if ($range[1] >= $filesize) + { + return false; + } + + $first_byte_pos = $filesize - (int) $range[1]; + $last_byte_pos = $filesize - 1; + } + else + { + // Return bytes from $range[0] to $range[1] + + $first_byte_pos = (int) $range[0]; + $last_byte_pos = (int) $range[1]; + + if ($last_byte_pos && $last_byte_pos < $first_byte_pos) + { + // The requested range contains 0 bytes. + continue; + } + + if ($first_byte_pos >= $filesize) + { + // Requested range not satisfiable + return false; + } + + // Adjust last-byte-pos if it is absent or greater than the content. + if ($range[1] === '' || $last_byte_pos >= $filesize) + { + $last_byte_pos = $filesize - 1; + } + } + + // We currently do not support range requests that end before the end of the file + if ($last_byte_pos != $filesize - 1) + { + continue; + } + + return array( + 'byte_pos_start' => $first_byte_pos, + 'byte_pos_end' => $last_byte_pos, + 'bytes_requested' => $last_byte_pos - $first_byte_pos + 1, + 'bytes_total' => $filesize, + ); + } +} + +/** +* Increments the download count of all provided attachments +* +* @param \phpbb\db\driver\driver_interface $db The database object +* @param array|int $ids The attach_id of each attachment +* +* @return null +*/ +function phpbb_increment_downloads($db, $ids) +{ + if (!is_array($ids)) + { + $ids = array($ids); + } + + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' + SET download_count = download_count + 1 + WHERE ' . $db->sql_in_set('attach_id', $ids); + $db->sql_query($sql); +} + +/** +* Handles authentication when downloading attachments from a post or topic +* +* @param \phpbb\db\driver\driver_interface $db The database object +* @param \phpbb\auth\auth $auth The authentication object +* @param int $topic_id The id of the topic that we are downloading from +* +* @return null +*/ +function phpbb_download_handle_forum_auth($db, $auth, $topic_id) +{ + $sql_array = array( + 'SELECT' => 't.topic_visibility, t.forum_id, f.forum_name, f.forum_password, f.parent_id', + 'FROM' => array( + TOPICS_TABLE => 't', + FORUMS_TABLE => 'f', + ), + 'WHERE' => 't.topic_id = ' . (int) $topic_id . ' + AND t.forum_id = f.forum_id', + ); + + $sql = $db->sql_build_query('SELECT', $sql_array); + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row && $row['topic_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $row['forum_id'])) + { + send_status_line(404, 'Not Found'); + trigger_error('ERROR_NO_ATTACHMENT'); + } + else if ($row && $auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id'])) + { + if ($row['forum_password']) + { + // Do something else ... ? + login_forum_box($row); + } + } + else + { + send_status_line(403, 'Forbidden'); + trigger_error('SORRY_AUTH_VIEW_ATTACH'); + } +} + +/** +* Handles authentication when downloading attachments from PMs +* +* @param \phpbb\db\driver\driver_interface $db The database object +* @param \phpbb\auth\auth $auth The authentication object +* @param int $user_id The user id +* @param int $msg_id The id of the PM that we are downloading from +* +* @return null +*/ +function phpbb_download_handle_pm_auth($db, $auth, $user_id, $msg_id) +{ + if (!$auth->acl_get('u_pm_download')) + { + send_status_line(403, 'Forbidden'); + trigger_error('SORRY_AUTH_VIEW_ATTACH'); + } + + $allowed = phpbb_download_check_pm_auth($db, $user_id, $msg_id); + + if (!$allowed) + { + send_status_line(403, 'Forbidden'); + trigger_error('ERROR_NO_ATTACHMENT'); + } +} + +/** +* Checks whether a user can download from a particular PM +* +* @param \phpbb\db\driver\driver_interface $db The database object +* @param int $user_id The user id +* @param int $msg_id The id of the PM that we are downloading from +* +* @return bool Whether the user is allowed to download from that PM or not +*/ +function phpbb_download_check_pm_auth($db, $user_id, $msg_id) +{ + // Check if the attachment is within the users scope... + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE msg_id = ' . (int) $msg_id . ' + AND ( + user_id = ' . (int) $user_id . ' + OR author_id = ' . (int) $user_id . ' + )'; + $result = $db->sql_query_limit($sql, 1); + $allowed = (bool) $db->sql_fetchfield('msg_id'); + $db->sql_freeresult($result); + + return $allowed; +} + +/** +* Check if the browser is internet explorer version 7+ +* +* @param string $user_agent User agent HTTP header +* @param int $version IE version to check against +* +* @return bool true if internet explorer version is greater than $version +*/ +function phpbb_is_greater_ie_version($user_agent, $version) +{ + if (preg_match('/msie (\d+)/', strtolower($user_agent), $matches)) + { + $ie_version = (int) $matches[1]; + return ($ie_version > $version); + } + else + { + return false; + } +} diff --git a/sources/phpBB/includes/functions_install.php b/sources/phpBB/includes/functions_install.php new file mode 100644 index 0000000..28cc603 --- /dev/null +++ b/sources/phpBB/includes/functions_install.php @@ -0,0 +1,545 @@ + +* @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; +} + +/** +* Returns an array of available DBMS with some data, if a DBMS is specified it will only +* return data for that DBMS and will load its extension if necessary. +*/ +function get_available_dbms($dbms = false, $return_unavailable = false, $only_20x_options = false) +{ + global $lang; + $available_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, + ), + ); + + if ($dbms) + { + if (isset($available_dbms[$dbms])) + { + $available_dbms = array($dbms => $available_dbms[$dbms]); + } + else + { + return array(); + } + } + + // now perform some checks whether they are really available + foreach ($available_dbms as $db_name => $db_ary) + { + if ($only_20x_options && !$db_ary['2.0.x']) + { + if ($return_unavailable) + { + $available_dbms[$db_name]['AVAILABLE'] = false; + } + else + { + unset($available_dbms[$db_name]); + } + continue; + } + + $dll = $db_ary['MODULE']; + + if (!@extension_loaded($dll)) + { + if ($return_unavailable) + { + $available_dbms[$db_name]['AVAILABLE'] = false; + } + else + { + unset($available_dbms[$db_name]); + } + continue; + } + $any_db_support = true; + } + + if ($return_unavailable) + { + $available_dbms['ANY_DB_SUPPORT'] = $any_db_support; + } + return $available_dbms; +} + +/** +* Generate the drop down of available database options +*/ +function dbms_select($default = '', $only_20x_options = false) +{ + global $lang; + + $available_dbms = get_available_dbms(false, false, $only_20x_options); + $dbms_options = ''; + foreach ($available_dbms as $dbms_name => $details) + { + $selected = ($dbms_name == $default) ? ' selected="selected"' : ''; + $dbms_options .= ''; + } + return $dbms_options; +} + +/** +* 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()} +* necessary extensions should be loaded already +*/ +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; + + $dbms = $dbms_details['DRIVER']; + + // Instantiate it and set return on error true + $db = new $dbms(); + $db->sql_return_on_error(true); + + // Check that we actually have a database name before going any further..... + if ($dbms_details['DRIVER'] != 'phpbb\db\driver\sqlite' && $dbms_details['DRIVER'] != 'phpbb\db\driver\sqlite3' && $dbms_details['DRIVER'] != 'phpbb\db\driver\oracle' && $dbname === '') + { + $error[] = $lang['INST_ERR_DB_NO_NAME']; + return false; + } + + // 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) + { + $error[] = $lang['INST_ERR_DB_FORUM_PATH']; + return false; + } + + // Check the prefix length to ensure that index names are not too long and does not contain invalid characters + switch ($dbms_details['DRIVER']) + { + case 'phpbb\db\driver\mysql': + case 'phpbb\db\driver\mysqli': + if (strspn($table_prefix, '-./\\') !== 0) + { + $error[] = $lang['INST_ERR_PREFIX_INVALID']; + return false; + } + + // no break; + + case 'phpbb\db\driver\postgres': + $prefix_length = 36; + break; + + case 'phpbb\db\driver\mssql': + case 'phpbb\db\driver\mssql_odbc': + case 'phpbb\db\driver\mssqlnative': + $prefix_length = 90; + break; + + case 'phpbb\db\driver\sqlite': + case 'phpbb\db\driver\sqlite3': + $prefix_length = 200; + break; + + case 'phpbb\db\driver\oracle': + $prefix_length = 6; + break; + } + + if (strlen($table_prefix) > $prefix_length) + { + $error[] = sprintf($lang['INST_ERR_PREFIX_TOO_LONG'], $prefix_length); + return false; + } + + // Try and connect ... + if (is_array($db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true))) + { + $db_error = $db->sql_error(); + $error[] = $lang['INST_ERR_DB_CONNECT'] . '
' . (($db_error['message']) ? utf8_convert_message($db_error['message']) : $lang['INST_ERR_DB_NO_ERROR']); + } + else + { + // Likely matches for an existing phpBB installation + if (!$prefix_may_exist) + { + $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); + $tables = array_map('strtolower', $tables); + $table_intersect = array_intersect($tables, $table_ary); + + if (sizeof($table_intersect)) + { + $error[] = $lang['INST_ERR_PREFIX']; + } + } + + // Make sure that the user has selected a sensible DBAL for the DBMS actually installed + switch ($dbms_details['DRIVER']) + { + case 'phpbb\db\driver\mysqli': + if (version_compare(mysqli_get_server_info($db->get_db_connect_id()), '4.1.3', '<')) + { + $error[] = $lang['INST_ERR_DB_NO_MYSQLI']; + } + break; + + case 'phpbb\db\driver\sqlite': + if (version_compare(sqlite_libversion(), '2.8.2', '<')) + { + $error[] = $lang['INST_ERR_DB_NO_SQLITE']; + } + break; + + case 'phpbb\db\driver\sqlite3': + $version = \SQLite3::version(); + if (version_compare($version['versionString'], '3.6.15', '<')) + { + $error[] = $lang['INST_ERR_DB_NO_SQLITE3']; + } + break; + + case 'phpbb\db\driver\oracle': + if ($unicode_check) + { + $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') + { + $error[] = $lang['INST_ERR_DB_NO_ORACLE']; + } + } + break; + + case 'phpbb\db\driver\postgres': + if ($unicode_check) + { + $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') + { + $error[] = $lang['INST_ERR_DB_NO_POSTGRES']; + } + } + break; + } + + } + + if ($error_connect && (!isset($error) || !sizeof($error))) + { + return true; + } + return false; +} + +/** +* Removes "/* style" as well as "# style" comments from $input. +* +* @param string $input Input string +* +* @return string Input string with comments removed +*/ +function phpbb_remove_comments($input) +{ + // Remove /* */ comments (http://ostermiller.org/findcomment.html) + $input = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $input); + + // Remove # style comments + $input = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $input)); + + return $input; +} + +/** +* split_sql_file will split an uploaded sql file into single sql statements. +* Note: expects trim() to have already been run on $sql. +*/ +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; +} + +/** +* For replacing {L_*} strings with preg_replace_callback +*/ +function adjust_language_keys_callback($matches) +{ + if (!empty($matches[1])) + { + global $lang, $db; + + return (!empty($lang[$matches[1]])) ? $db->sql_escape($lang[$matches[1]]) : $db->sql_escape($matches[1]); + } +} + +/** +* Creates the output to be stored in a phpBB config.php file +* +* @param array $data Array containing the database connection information +* @param string $dbms The name of the DBAL class to use +* @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 The output to write to the file +*/ +function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_container = false, $debug_test = false) +{ + $config_data = " $dbms, + 'dbhost' => $data['dbhost'], + 'dbport' => $data['dbport'], + 'dbname' => $data['dbname'], + 'dbuser' => $data['dbuser'], + 'dbpasswd' => htmlspecialchars_decode($data['dbpasswd']), + 'table_prefix' => $data['table_prefix'], + + 'phpbb_adm_relative_path' => 'adm/', + + 'acm_type' => 'phpbb\cache\driver\file', + ); + + foreach ($config_data_array as $key => $value) + { + $config_data .= "\${$key} = '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $value)) . "';\n"; + } + + $config_data .= "\n@define('PHPBB_INSTALLED', true);\n"; + $config_data .= "// @define('PHPBB_DISPLAY_LOAD_TIME', true);\n"; + + if ($debug) + { + $config_data .= "@define('DEBUG', true);\n"; + } + else + { + $config_data .= "// @define('DEBUG', true);\n"; + } + + if ($debug_container) + { + $config_data .= "@define('DEBUG_CONTAINER', true);\n"; + } + else + { + $config_data .= "// @define('DEBUG_CONTAINER', true);\n"; + } + + if ($debug_test) + { + $config_data .= "@define('DEBUG_TEST', true);\n"; + } + + return $config_data; +} + +/** +* Check whether a file should be ignored on update +* +* We ignore new files in some circumstances: +* 1. The file is a language file, but the language is not installed +* 2. The file is a style file, but the style is not installed +* 3. The file is a style language file, but the language is not installed +* +* @param string $phpbb_root_path phpBB root path +* @param string $file File including path from phpbb root +* @return bool Should we ignore the new file or add it to the board? +*/ +function phpbb_ignore_new_file_on_update($phpbb_root_path, $file) +{ + $ignore_new_file = false; + + // We ignore new files in some circumstances: + // 1. The file is a language file, but the language is not installed + if (!$ignore_new_file && strpos($file, 'language/') === 0) + { + list($language_dir, $language_iso) = explode('/', $file); + $ignore_new_file = !file_exists($phpbb_root_path . $language_dir . '/' . $language_iso); + } + + // 2. The file is a style file, but the style is not installed + if (!$ignore_new_file && strpos($file, 'styles/') === 0) + { + list($styles_dir, $style_name) = explode('/', $file); + $ignore_new_file = !file_exists($phpbb_root_path . $styles_dir . '/' . $style_name); + } + + // 3. The file is a style language file, but the language is not installed + if (!$ignore_new_file && strpos($file, 'styles/') === 0) + { + $dirs = explode('/', $file); + if (sizeof($dirs) >= 5) + { + list($styles_dir, $style_name, $template_component, $language_iso) = explode('/', $file); + if ($template_component == 'theme' && $language_iso !== 'images') + { + $ignore_new_file = !file_exists($phpbb_root_path . 'language/' . $language_iso); + } + } + } + + return $ignore_new_file; +} + +/** +* Check whether phpBB is installed. +* +* @param string $phpbb_root_path Path to the phpBB board root. +* @param string $php_ext PHP file extension. +* +* @return bool Returns true if phpBB is installed. +*/ +function phpbb_check_installation_exists($phpbb_root_path, $php_ext) +{ + // Try opening config file + if (file_exists($phpbb_root_path . 'config.' . $php_ext)) + { + include($phpbb_root_path . 'config.' . $php_ext); + } + + return defined('PHPBB_INSTALLED'); +} diff --git a/sources/phpBB/includes/functions_jabber.php b/sources/phpBB/includes/functions_jabber.php new file mode 100644 index 0000000..bd2e9e9 --- /dev/null +++ b/sources/phpBB/includes/functions_jabber.php @@ -0,0 +1,872 @@ + +* @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; +} + +/** +* +* Jabber class from Flyspray project +* +* @version class.jabber2.php 1595 2008-09-19 (0.9.9) +* @copyright 2006 Flyspray.org +* @author Florian Schmitz (floele) +* +* Only slightly modified by Acyd Burn +*/ +class jabber +{ + var $connection = null; + var $session = array(); + var $timeout = 10; + + var $server; + var $connect_server; + var $port; + var $username; + var $password; + var $use_ssl; + var $resource = 'functions_jabber.phpbb.php'; + + var $enable_logging; + var $log_array; + + var $features = array(); + + /** + */ + function jabber($server, $port, $username, $password, $use_ssl = false) + { + $this->connect_server = ($server) ? $server : 'localhost'; + $this->port = ($port) ? $port : 5222; + + // Get the server and the username + if (strpos($username, '@') === false) + { + $this->server = $this->connect_server; + $this->username = $username; + } + else + { + $jid = explode('@', $username, 2); + + $this->username = $jid[0]; + $this->server = $jid[1]; + } + + $this->password = $password; + $this->use_ssl = ($use_ssl && self::can_use_ssl()) ? true : false; + + // Change port if we use SSL + if ($this->port == 5222 && $this->use_ssl) + { + $this->port = 5223; + } + + $this->enable_logging = true; + $this->log_array = array(); + } + + /** + * Able to use the SSL functionality? + */ + 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; + } + + /** + * Able to use TLS? + */ + static public function can_use_tls() + { + if (!@extension_loaded('openssl') || !function_exists('stream_socket_enable_crypto') || !function_exists('stream_get_meta_data') || !function_exists('socket_set_blocking') || !function_exists('stream_get_wrappers')) + { + return false; + } + + /** + * Make sure the encryption stream is supported + * Also seem to work without the crypto stream if correctly compiled + + $streams = stream_get_wrappers(); + + if (!in_array('streams.crypto', $streams)) + { + return false; + } + */ + + return true; + } + + /** + * Sets the resource which is used. No validation is done here, only escaping. + * @param string $name + * @access public + */ + function set_resource($name) + { + $this->resource = $name; + } + + /** + * Connect + */ + function connect() + { +/* if (!$this->check_jid($this->username . '@' . $this->server)) + { + $this->add_to_log('Error: Jabber ID is not valid: ' . $this->username . '@' . $this->server); + return false; + }*/ + + $this->session['ssl'] = $this->use_ssl; + + if ($this->open_socket($this->connect_server, $this->port, $this->use_ssl)) + { + $this->send("\n"); + $this->send("\n"); + } + else + { + $this->add_to_log('Error: connect() #2'); + return false; + } + + // Now we listen what the server has to say...and give appropriate responses + $this->response($this->listen()); + return true; + } + + /** + * Disconnect + */ + function disconnect() + { + if ($this->connected()) + { + // disconnect gracefully + if (isset($this->session['sent_presence'])) + { + $this->send_presence('offline', '', true); + } + + $this->send(''); + $this->session = array(); + return fclose($this->connection); + } + + return false; + } + + /** + * Connected? + */ + function connected() + { + return (is_resource($this->connection) && !feof($this->connection)) ? true : false; + } + + + /** + * Initiates login (using data from contructor, after calling connect()) + * @access public + * @return bool + */ + function login() + { + if (!sizeof($this->features)) + { + $this->add_to_log('Error: No feature information from server available.'); + return false; + } + + return $this->response($this->features); + } + + /** + * Send data to the Jabber server + * @param string $xml + * @access public + * @return bool + */ + function send($xml) + { + if ($this->connected()) + { + $xml = trim($xml); + $this->add_to_log('SEND: '. $xml); + return fwrite($this->connection, $xml); + } + else + { + $this->add_to_log('Error: Could not send, connection lost (flood?).'); + return false; + } + } + + /** + * OpenSocket + * @param string $server host to connect to + * @param int $port port number + * @param bool $use_ssl use ssl or not + * @access public + * @return bool + */ + function open_socket($server, $port, $use_ssl = false) + { + if (@function_exists('dns_get_record')) + { + $record = @dns_get_record("_xmpp-client._tcp.$server", DNS_SRV); + if (!empty($record) && !empty($record[0]['target'])) + { + $server = $record[0]['target']; + } + } + + $server = $use_ssl ? 'ssl://' . $server : $server; + + if ($this->connection = @fsockopen($server, $port, $errorno, $errorstr, $this->timeout)) + { + socket_set_blocking($this->connection, 0); + socket_set_timeout($this->connection, 60); + + return true; + } + + // Apparently an error occurred... + $this->add_to_log('Error: open_socket() - ' . $errorstr); + return false; + } + + /** + * Return log + */ + function get_log() + { + if ($this->enable_logging && sizeof($this->log_array)) + { + return implode("

", $this->log_array); + } + + return ''; + } + + /** + * Add information to log + */ + function add_to_log($string) + { + if ($this->enable_logging) + { + $this->log_array[] = utf8_htmlspecialchars($string); + } + } + + /** + * Listens to the connection until it gets data or the timeout is reached. + * Thus, it should only be called if data is expected to be received. + * @access public + * @return mixed either false for timeout or an array with the received data + */ + function listen($timeout = 10, $wait = false) + { + if (!$this->connected()) + { + return false; + } + + // Wait for a response until timeout is reached + $start = time(); + $data = ''; + + do + { + $read = trim(fread($this->connection, 4096)); + $data .= $read; + } + while (time() <= $start + $timeout && !feof($this->connection) && ($wait || $data == '' || $read != '' || (substr(rtrim($data), -1) != '>'))); + + if ($data != '') + { + $this->add_to_log('RECV: '. $data); + return $this->xmlize($data); + } + else + { + $this->add_to_log('Timeout, no response from server.'); + return false; + } + } + + /** + * Initiates account registration (based on data used for contructor) + * @access public + * @return bool + */ + function register() + { + if (!isset($this->session['id']) || isset($this->session['jid'])) + { + $this->add_to_log('Error: Cannot initiate registration.'); + return false; + } + + $this->send(""); + return $this->response($this->listen()); + } + + /** + * Sets account presence. No additional info required (default is "online" status) + * @param $message online, offline... + * @param $type dnd, away, chat, xa or nothing + * @param $unavailable set this to true if you want to become unavailable + * @access public + * @return bool + */ + function send_presence($message = '', $type = '', $unavailable = false) + { + if (!isset($this->session['jid'])) + { + $this->add_to_log('ERROR: send_presence() - Cannot set presence at this point, no jid given.'); + return false; + } + + $type = strtolower($type); + $type = (in_array($type, array('dnd', 'away', 'chat', 'xa'))) ? ''. $type .'' : ''; + + $unavailable = ($unavailable) ? " type='unavailable'" : ''; + $message = ($message) ? '' . utf8_htmlspecialchars($message) .'' : ''; + + $this->session['sent_presence'] = !$unavailable; + + return $this->send("" . $type . $message . ''); + } + + /** + * This handles all the different XML elements + * @param array $xml + * @access public + * @return bool + */ + function response($xml) + { + if (!is_array($xml) || !sizeof($xml)) + { + return false; + } + + // did we get multiple elements? do one after another + // array('message' => ..., 'presence' => ...) + if (sizeof($xml) > 1) + { + foreach ($xml as $key => $value) + { + $this->response(array($key => $value)); + } + return; + } + else + { + // or even multiple elements of the same type? + // array('message' => array(0 => ..., 1 => ...)) + if (sizeof(reset($xml)) > 1) + { + foreach (reset($xml) as $value) + { + $this->response(array(key($xml) => array(0 => $value))); + } + return; + } + } + + switch (key($xml)) + { + case 'stream:stream': + // Connection initialised (or after authentication). Not much to do here... + + if (isset($xml['stream:stream'][0]['#']['stream:features'])) + { + // we already got all info we need + $this->features = $xml['stream:stream'][0]['#']; + } + else + { + $this->features = $this->listen(); + } + + $second_time = isset($this->session['id']); + $this->session['id'] = $xml['stream:stream'][0]['@']['id']; + + if ($second_time) + { + // If we are here for the second time after TLS, we need to continue logging in + return $this->login(); + } + + // go on with authentication? + if (isset($this->features['stream:features'][0]['#']['bind']) || !empty($this->session['tls'])) + { + return $this->response($this->features); + } + break; + + case 'stream:features': + // Resource binding after successful authentication + if (isset($this->session['authenticated'])) + { + // session required? + $this->session['sess_required'] = isset($xml['stream:features'][0]['#']['session']); + + $this->send(" + + " . utf8_htmlspecialchars($this->resource) . ' + + '); + return $this->response($this->listen()); + } + + // Let's use TLS if SSL is not enabled and we can actually use it + if (!$this->session['ssl'] && self::can_use_tls() && self::can_use_ssl() && isset($xml['stream:features'][0]['#']['starttls'])) + { + $this->add_to_log('Switching to TLS.'); + $this->send("\n"); + return $this->response($this->listen()); + } + + // Does the server support SASL authentication? + + // I hope so, because we do (and no other method). + if (isset($xml['stream:features'][0]['#']['mechanisms'][0]['@']['xmlns']) && $xml['stream:features'][0]['#']['mechanisms'][0]['@']['xmlns'] == 'urn:ietf:params:xml:ns:xmpp-sasl') + { + // Now decide on method + $methods = array(); + + foreach ($xml['stream:features'][0]['#']['mechanisms'][0]['#']['mechanism'] as $value) + { + $methods[] = $value['#']; + } + + // we prefer DIGEST-MD5 + // we don't want to use plain authentication (neither does the server usually) if no encryption is in place + + // http://www.xmpp.org/extensions/attic/jep-0078-1.7.html + // The plaintext mechanism SHOULD NOT be used unless the underlying stream is encrypted (using SSL or TLS) + // and the client has verified that the server certificate is signed by a trusted certificate authority. + + if (in_array('DIGEST-MD5', $methods)) + { + $this->send(""); + } + else if (in_array('PLAIN', $methods) && ($this->session['ssl'] || !empty($this->session['tls']))) + { + // http://www.ietf.org/rfc/rfc4616.txt (PLAIN SASL Mechanism) + $this->send("" + . base64_encode($this->username . '@' . $this->server . chr(0) . $this->username . chr(0) . $this->password) . + ''); + } + else if (in_array('ANONYMOUS', $methods)) + { + $this->send(""); + } + else + { + // not good... + $this->add_to_log('Error: No authentication method supported.'); + $this->disconnect(); + return false; + } + + return $this->response($this->listen()); + } + else + { + // ok, this is it. bye. + $this->add_to_log('Error: Server does not offer SASL authentication.'); + $this->disconnect(); + return false; + } + break; + + case 'challenge': + // continue with authentication...a challenge literally -_- + $decoded = base64_decode($xml['challenge'][0]['#']); + $decoded = $this->parse_data($decoded); + + if (!isset($decoded['digest-uri'])) + { + $decoded['digest-uri'] = 'xmpp/'. $this->server; + } + + // better generate a cnonce, maybe it's needed + $decoded['cnonce'] = base64_encode(md5(uniqid(mt_rand(), true))); + + // second challenge? + if (isset($decoded['rspauth'])) + { + $this->send(""); + } + else + { + // Make sure we only use 'auth' for qop (relevant for $this->encrypt_password()) + // If the is choking up on the changed parameter we may need to adjust encrypt_password() directly + if (isset($decoded['qop']) && $decoded['qop'] != 'auth' && strpos($decoded['qop'], 'auth') !== false) + { + $decoded['qop'] = 'auth'; + } + + $response = array( + 'username' => $this->username, + 'response' => $this->encrypt_password(array_merge($decoded, array('nc' => '00000001'))), + 'charset' => 'utf-8', + 'nc' => '00000001', + 'qop' => 'auth', // only auth being supported + ); + + foreach (array('nonce', 'digest-uri', 'realm', 'cnonce') as $key) + { + if (isset($decoded[$key])) + { + $response[$key] = $decoded[$key]; + } + } + + $this->send("" . base64_encode($this->implode_data($response)) . ''); + } + + return $this->response($this->listen()); + break; + + case 'failure': + $this->add_to_log('Error: Server sent "failure".'); + $this->disconnect(); + return false; + break; + + case 'proceed': + // continue switching to TLS + $meta = stream_get_meta_data($this->connection); + socket_set_blocking($this->connection, 1); + + if (!stream_socket_enable_crypto($this->connection, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) + { + $this->add_to_log('Error: TLS mode change failed.'); + return false; + } + + socket_set_blocking($this->connection, $meta['blocked']); + $this->session['tls'] = true; + + // new stream + $this->send("\n"); + $this->send("\n"); + + return $this->response($this->listen()); + break; + + case 'success': + // Yay, authentication successful. + $this->send("\n"); + $this->session['authenticated'] = true; + + // we have to wait for another response + return $this->response($this->listen()); + break; + + case 'iq': + // we are not interested in IQs we did not expect + if (!isset($xml['iq'][0]['@']['id'])) + { + return false; + } + + // multiple possibilities here + switch ($xml['iq'][0]['@']['id']) + { + case 'bind_1': + $this->session['jid'] = $xml['iq'][0]['#']['bind'][0]['#']['jid'][0]['#']; + + // and (maybe) yet another request to be able to send messages *finally* + if ($this->session['sess_required']) + { + $this->send(" + + "); + return $this->response($this->listen()); + } + + return true; + break; + + case 'sess_1': + return true; + break; + + case 'reg_1': + $this->send(" + + " . utf8_htmlspecialchars($this->username) . " + " . utf8_htmlspecialchars($this->password) . " + + "); + return $this->response($this->listen()); + break; + + case 'reg_2': + // registration end + if (isset($xml['iq'][0]['#']['error'])) + { + $this->add_to_log('Warning: Registration failed.'); + return false; + } + return true; + break; + + case 'unreg_1': + return true; + break; + + default: + $this->add_to_log('Notice: Received unexpected IQ.'); + return false; + break; + } + break; + + case 'message': + // we are only interested in content... + if (!isset($xml['message'][0]['#']['body'])) + { + return false; + } + + $message['body'] = $xml['message'][0]['#']['body'][0]['#']; + $message['from'] = $xml['message'][0]['@']['from']; + + if (isset($xml['message'][0]['#']['subject'])) + { + $message['subject'] = $xml['message'][0]['#']['subject'][0]['#']; + } + $this->session['messages'][] = $message; + break; + + default: + // hm...don't know this response + $this->add_to_log('Notice: Unknown server response (' . key($xml) . ')'); + return false; + break; + } + } + + function send_message($to, $text, $subject = '', $type = 'normal') + { + if (!isset($this->session['jid'])) + { + return false; + } + + if (!in_array($type, array('chat', 'normal', 'error', 'groupchat', 'headline'))) + { + $type = 'normal'; + } + + return $this->send(" + " . utf8_htmlspecialchars($subject) . " + " . utf8_htmlspecialchars($text) . " + " + ); + } + + /** + * Encrypts a password as in RFC 2831 + * @param array $data Needs data from the client-server connection + * @access public + * @return string + */ + function encrypt_password($data) + { + // let's me think about again... + foreach (array('realm', 'cnonce', 'digest-uri') as $key) + { + if (!isset($data[$key])) + { + $data[$key] = ''; + } + } + + $pack = md5($this->username . ':' . $data['realm'] . ':' . $this->password); + + if (isset($data['authzid'])) + { + $a1 = pack('H32', $pack) . sprintf(':%s:%s:%s', $data['nonce'], $data['cnonce'], $data['authzid']); + } + else + { + $a1 = pack('H32', $pack) . sprintf(':%s:%s', $data['nonce'], $data['cnonce']); + } + + // should be: qop = auth + $a2 = 'AUTHENTICATE:'. $data['digest-uri']; + + return md5(sprintf('%s:%s:%s:%s:%s:%s', md5($a1), $data['nonce'], $data['nc'], $data['cnonce'], $data['qop'], md5($a2))); + } + + /** + * parse_data like a="b",c="d",... or like a="a, b", c, d="e", f=g,... + * @param string $data + * @access public + * @return array a => b ... + */ + function parse_data($data) + { + $data = explode(',', $data); + $pairs = array(); + $key = false; + + foreach ($data as $pair) + { + $dd = strpos($pair, '='); + + if ($dd) + { + $key = trim(substr($pair, 0, $dd)); + $pairs[$key] = trim(trim(substr($pair, $dd + 1)), '"'); + } + else if (strpos(strrev(trim($pair)), '"') === 0 && $key) + { + // We are actually having something left from "a, b" values, add it to the last one we handled. + $pairs[$key] .= ',' . trim(trim($pair), '"'); + continue; + } + } + + return $pairs; + } + + /** + * opposite of jabber::parse_data() + * @param array $data + * @access public + * @return string + */ + function implode_data($data) + { + $return = array(); + foreach ($data as $key => $value) + { + $return[] = $key . '="' . $value . '"'; + } + return implode(',', $return); + } + + /** + * xmlize() + * @author Hans Anderson + * @copyright Hans Anderson / http://www.hansanderson.com/php/xml/ + */ + function xmlize($data, $skip_white = 1, $encoding = 'UTF-8') + { + $data = trim($data); + + if (substr($data, 0, 5) != ''. $data . ''; + } + + $vals = $index = $array = array(); + $parser = xml_parser_create($encoding); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, $skip_white); + xml_parse_into_struct($parser, $data, $vals, $index); + xml_parser_free($parser); + + $i = 0; + $tagname = $vals[$i]['tag']; + + $array[$tagname][0]['@'] = (isset($vals[$i]['attributes'])) ? $vals[$i]['attributes'] : array(); + $array[$tagname][0]['#'] = $this->_xml_depth($vals, $i); + + if (substr($data, 0, 5) != '_xml_depth($vals, $i); + + break; + + case 'cdata': + array_push($children, $vals[$i]['value']); + break; + + case 'complete': + + $tagname = $vals[$i]['tag']; + $size = (isset($children[$tagname])) ? sizeof($children[$tagname]) : 0; + $children[$tagname][$size]['#'] = (isset($vals[$i]['value'])) ? $vals[$i]['value'] : array(); + + if (isset($vals[$i]['attributes'])) + { + $children[$tagname][$size]['@'] = $vals[$i]['attributes']; + } + + break; + + case 'close': + return $children; + break; + } + } + + return $children; + } +} diff --git a/sources/phpBB/includes/functions_mcp.php b/sources/phpBB/includes/functions_mcp.php new file mode 100644 index 0000000..811d49f --- /dev/null +++ b/sources/phpBB/includes/functions_mcp.php @@ -0,0 +1,675 @@ + +* @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; +} + +/** +* Functions used to generate additional URL paramters +*/ +function phpbb_module__url($mode, &$module_row) +{ + return phpbb_extra_url(); +} + +function phpbb_module_notes_url($mode, &$module_row) +{ + if ($mode == 'front') + { + return ''; + } + + global $user_id; + return ($user_id) ? "&u=$user_id" : ''; +} + +function phpbb_module_warn_url($mode, &$module_row) +{ + if ($mode == 'front' || $mode == 'list') + { + global $forum_id; + + return ($forum_id) ? "&f=$forum_id" : ''; + } + + if ($mode == 'warn_post') + { + global $forum_id, $post_id; + + $url_extra = ($forum_id) ? "&f=$forum_id" : ''; + $url_extra .= ($post_id) ? "&p=$post_id" : ''; + + return $url_extra; + } + else + { + global $user_id; + + return ($user_id) ? "&u=$user_id" : ''; + } +} + +function phpbb_module_main_url($mode, &$module_row) +{ + return phpbb_extra_url(); +} + +function phpbb_module_logs_url($mode, &$module_row) +{ + return phpbb_extra_url(); +} + +function phpbb_module_ban_url($mode, &$module_row) +{ + return phpbb_extra_url(); +} + +function phpbb_module_queue_url($mode, &$module_row) +{ + return phpbb_extra_url(); +} + +function phpbb_module_reports_url($mode, &$module_row) +{ + return phpbb_extra_url(); +} + +function phpbb_extra_url() +{ + global $forum_id, $topic_id, $post_id, $report_id, $user_id; + + $url_extra = ''; + $url_extra .= ($forum_id) ? "&f=$forum_id" : ''; + $url_extra .= ($topic_id) ? "&t=$topic_id" : ''; + $url_extra .= ($post_id) ? "&p=$post_id" : ''; + $url_extra .= ($user_id) ? "&u=$user_id" : ''; + $url_extra .= ($report_id) ? "&r=$report_id" : ''; + + return $url_extra; +} + +/** +* Get simple topic data +*/ +function phpbb_get_topic_data($topic_ids, $acl_list = false, $read_tracking = false) +{ + global $auth, $db, $config, $user; + static $rowset = array(); + + $topics = array(); + + if (!sizeof($topic_ids)) + { + return array(); + } + + // cache might not contain read tracking info, so we can't use it if read + // tracking information is requested + if (!$read_tracking) + { + $cache_topic_ids = array_intersect($topic_ids, array_keys($rowset)); + $topic_ids = array_diff($topic_ids, array_keys($rowset)); + } + else + { + $cache_topic_ids = array(); + } + + if (sizeof($topic_ids)) + { + $sql_array = array( + 'SELECT' => 't.*, f.*', + + 'FROM' => array( + TOPICS_TABLE => 't', + ), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(FORUMS_TABLE => 'f'), + 'ON' => 'f.forum_id = t.forum_id' + ) + ), + + 'WHERE' => $db->sql_in_set('t.topic_id', $topic_ids) + ); + + if ($read_tracking && $config['load_db_lastread']) + { + $sql_array['SELECT'] .= ', tt.mark_time, ft.mark_time as forum_mark_time'; + + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(TOPICS_TRACK_TABLE => 'tt'), + 'ON' => 'tt.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = tt.topic_id' + ); + + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(FORUMS_TRACK_TABLE => 'ft'), + 'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND t.forum_id = ft.forum_id' + ); + } + + $sql = $db->sql_build_query('SELECT', $sql_array); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $rowset[$row['topic_id']] = $row; + + if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id'])) + { + continue; + } + + $topics[$row['topic_id']] = $row; + } + $db->sql_freeresult($result); + } + + foreach ($cache_topic_ids as $id) + { + if (!$acl_list || $auth->acl_gets($acl_list, $rowset[$id]['forum_id'])) + { + $topics[$id] = $rowset[$id]; + } + } + + return $topics; +} + +/** +* Get simple post data +*/ +function phpbb_get_post_data($post_ids, $acl_list = false, $read_tracking = false) +{ + global $db, $auth, $config, $user; + + $rowset = array(); + + if (!sizeof($post_ids)) + { + return array(); + } + + $sql_array = array( + 'SELECT' => 'p.*, u.*, t.*, f.*', + + 'FROM' => array( + USERS_TABLE => 'u', + POSTS_TABLE => 'p', + TOPICS_TABLE => 't', + ), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(FORUMS_TABLE => 'f'), + 'ON' => 'f.forum_id = t.forum_id' + ) + ), + + 'WHERE' => $db->sql_in_set('p.post_id', $post_ids) . ' + AND u.user_id = p.poster_id + AND t.topic_id = p.topic_id', + ); + + if ($read_tracking && $config['load_db_lastread']) + { + $sql_array['SELECT'] .= ', tt.mark_time, ft.mark_time as forum_mark_time'; + + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(TOPICS_TRACK_TABLE => 'tt'), + 'ON' => 'tt.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = tt.topic_id' + ); + + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(FORUMS_TRACK_TABLE => 'ft'), + 'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND t.forum_id = ft.forum_id' + ); + } + + $sql = $db->sql_build_query('SELECT', $sql_array); + $result = $db->sql_query($sql); + unset($sql_array); + + while ($row = $db->sql_fetchrow($result)) + { + if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id'])) + { + continue; + } + + if ($row['post_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $row['forum_id'])) + { + // Moderators without the permission to approve post should at least not see them. ;) + continue; + } + + $rowset[$row['post_id']] = $row; + } + $db->sql_freeresult($result); + + return $rowset; +} + +/** +* Get simple forum data +*/ +function phpbb_get_forum_data($forum_id, $acl_list = 'f_list', $read_tracking = false) +{ + global $auth, $db, $user, $config, $phpbb_container; + + $rowset = array(); + + if (!is_array($forum_id)) + { + $forum_id = array($forum_id); + } + + if (!sizeof($forum_id)) + { + return array(); + } + + if ($read_tracking && $config['load_db_lastread']) + { + $read_tracking_join = ' LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' + AND ft.forum_id = f.forum_id)'; + $read_tracking_select = ', ft.mark_time'; + } + else + { + $read_tracking_join = $read_tracking_select = ''; + } + + $sql = "SELECT f.* $read_tracking_select + FROM " . FORUMS_TABLE . " f$read_tracking_join + WHERE " . $db->sql_in_set('f.forum_id', $forum_id); + $result = $db->sql_query($sql); + + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + + while ($row = $db->sql_fetchrow($result)) + { + if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id'])) + { + continue; + } + + $row['forum_topics_approved'] = $phpbb_content_visibility->get_count('forum_topics', $row, $row['forum_id']); + + $rowset[$row['forum_id']] = $row; + } + $db->sql_freeresult($result); + + return $rowset; +} + +/** +* Get simple pm data +*/ +function phpbb_get_pm_data($pm_ids) +{ + global $db; + + $rowset = array(); + + if (!sizeof($pm_ids)) + { + return array(); + } + + $sql_array = array( + 'SELECT' => 'p.*, u.*', + + 'FROM' => array( + USERS_TABLE => 'u', + PRIVMSGS_TABLE => 'p', + ), + + 'WHERE' => $db->sql_in_set('p.msg_id', $pm_ids) . ' + AND u.user_id = p.author_id', + ); + + $sql = $db->sql_build_query('SELECT', $sql_array); + $result = $db->sql_query($sql); + unset($sql_array); + + while ($row = $db->sql_fetchrow($result)) + { + $rowset[$row['msg_id']] = $row; + } + $db->sql_freeresult($result); + + return $rowset; +} + +/** +* sorting in mcp +* +* @param string $where_sql should either be WHERE (default if ommited) or end with AND or OR +* +* $mode reports and reports_closed: the $where parameters uses aliases p for posts table and r for report table +* $mode unapproved_posts: the $where parameters uses aliases p for posts table and t for topic table +*/ +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; + + $sort_days = request_var('st', 0); + $min_time = ($sort_days) ? time() - ($sort_days * 86400) : 0; + + switch ($mode) + { + case 'viewforum': + $type = 'topics'; + $default_key = 't'; + $default_dir = 'd'; + + $sql = 'SELECT COUNT(topic_id) AS total + FROM ' . TOPICS_TABLE . " + $where_sql forum_id = $forum_id + AND topic_type NOT IN (" . POST_ANNOUNCE . ', ' . POST_GLOBAL . ") + AND topic_last_post_time >= $min_time"; + + if (!$auth->acl_get('m_approve', $forum_id)) + { + $sql .= 'AND topic_visibility = ' . ITEM_APPROVED; + } + break; + + case 'viewtopic': + $type = 'posts'; + $default_key = 't'; + $default_dir = 'a'; + + $sql = 'SELECT COUNT(post_id) AS total + FROM ' . POSTS_TABLE . " + $where_sql topic_id = $topic_id + AND post_time >= $min_time"; + + if (!$auth->acl_get('m_approve', $forum_id)) + { + $sql .= 'AND post_visibility = ' . ITEM_APPROVED; + } + break; + + case 'unapproved_posts': + case 'deleted_posts': + $visibility_const = ($mode == 'unapproved_posts') ? array(ITEM_UNAPPROVED, ITEM_REAPPROVE) : ITEM_DELETED; + $type = 'posts'; + $default_key = 't'; + $default_dir = 'd'; + $where_sql .= ($topic_id) ? ' p.topic_id = ' . $topic_id . ' AND' : ''; + + $sql = 'SELECT COUNT(p.post_id) AS total + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t + $where_sql " . $db->sql_in_set('p.forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . ' + AND ' . $db->sql_in_set('p.post_visibility', $visibility_const) .' + AND t.topic_id = p.topic_id + AND t.topic_visibility <> p.post_visibility'; + + if ($min_time) + { + $sql .= ' AND post_time >= ' . $min_time; + } + break; + + case 'unapproved_topics': + case 'deleted_topics': + $visibility_const = ($mode == 'unapproved_topics') ? array(ITEM_UNAPPROVED, ITEM_REAPPROVE) : ITEM_DELETED; + $type = 'topics'; + $default_key = 't'; + $default_dir = 'd'; + + $sql = 'SELECT COUNT(topic_id) AS total + FROM ' . TOPICS_TABLE . " + $where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . ' + AND ' . $db->sql_in_set('topic_visibility', $visibility_const); + + if ($min_time) + { + $sql .= ' AND topic_time >= ' . $min_time; + } + break; + + case 'pm_reports': + case 'pm_reports_closed': + case 'reports': + case 'reports_closed': + $pm = (strpos($mode, 'pm_') === 0) ? true : false; + + $type = ($pm) ? 'pm_reports' : 'reports'; + $default_key = 't'; + $default_dir = 'd'; + $limit_time_sql = ($min_time) ? "AND r.report_time >= $min_time" : ''; + + if ($topic_id) + { + $where_sql .= ' p.topic_id = ' . $topic_id . ' AND '; + } + else if ($forum_id) + { + $where_sql .= ' p.forum_id = ' . $forum_id . ' AND '; + } + else if (!$pm) + { + $where_sql .= ' ' . $db->sql_in_set('p.forum_id', get_forum_list(array('!f_read', '!m_report')), true, true) . ' AND '; + } + + if ($mode == 'reports' || $mode == 'pm_reports') + { + $where_sql .= ' r.report_closed = 0 AND '; + } + else + { + $where_sql .= ' r.report_closed = 1 AND '; + } + + if ($pm) + { + $sql = 'SELECT COUNT(r.report_id) AS total + FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . " p + $where_sql r.post_id = 0 + AND p.msg_id = r.pm_id + $limit_time_sql"; + } + else + { + $sql = 'SELECT COUNT(r.report_id) AS total + FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . " p + $where_sql r.pm_id = 0 + AND p.post_id = r.post_id + $limit_time_sql"; + } + break; + + case 'viewlogs': + $type = 'logs'; + $default_key = 't'; + $default_dir = 'd'; + + $sql = 'SELECT COUNT(log_id) AS total + FROM ' . LOG_TABLE . " + $where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_'))) . ' + AND log_time >= ' . $min_time . ' + AND log_type = ' . LOG_MOD; + break; + } + + $sort_key = request_var('sk', $default_key); + $sort_dir = request_var('sd', $default_dir); + $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); + + switch ($type) + { + case 'topics': + $limit_days = array(0 => $user->lang['ALL_TOPICS'], 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['AUTHOR'], 't' => $user->lang['POST_TIME'], 'tt' => $user->lang['TOPIC_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']); + + $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => array('t.topic_last_post_time', 't.topic_last_post_id'), 'tt' => 't.topic_time', 'r' => (($auth->acl_get('m_approve', $forum_id)) ? 't.topic_posts_approved + t.topic_posts_unapproved + t.topic_posts_softdeleted' : 't.topic_posts_approved'), 's' => 't.topic_title', 'v' => 't.topic_views'); + $limit_time_sql = ($min_time) ? "AND t.topic_last_post_time >= $min_time" : ''; + break; + + case 'posts': + $limit_days = array(0 => $user->lang['ALL_POSTS'], 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['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); + $sort_by_sql = array('a' => 'u.username_clean', 't' => array('p.post_time', 'p.post_id'), 's' => 'p.post_subject'); + $limit_time_sql = ($min_time) ? "AND p.post_time >= $min_time" : ''; + break; + + case 'reports': + $limit_days = array(0 => $user->lang['ALL_REPORTS'], 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['AUTHOR'], 'r' => $user->lang['REPORTER'], 'p' => $user->lang['POST_TIME'], 't' => $user->lang['REPORT_TIME'], 's' => $user->lang['SUBJECT']); + $sort_by_sql = array('a' => 'u.username_clean', 'r' => 'ru.username', 'p' => array('p.post_time', 'p.post_id'), 't' => 'r.report_time', 's' => 'p.post_subject'); + break; + + case 'pm_reports': + $limit_days = array(0 => $user->lang['ALL_REPORTS'], 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['AUTHOR'], 'r' => $user->lang['REPORTER'], 'p' => $user->lang['POST_TIME'], 't' => $user->lang['REPORT_TIME'], 's' => $user->lang['SUBJECT']); + $sort_by_sql = array('a' => 'u.username_clean', 'r' => 'ru.username', 'p' => 'p.message_time', 't' => 'r.report_time', 's' => 'p.message_subject'); + break; + + case 'logs': + $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('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']); + + $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); + $limit_time_sql = ($min_time) ? "AND l.log_time >= $min_time" : ''; + break; + } + + if (!isset($sort_by_sql[$sort_key])) + { + $sort_key = $default_key; + } + + $direction = ($sort_dir == 'd') ? 'DESC' : 'ASC'; + + if (is_array($sort_by_sql[$sort_key])) + { + $sort_order_sql = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; + } + else + { + $sort_order_sql = $sort_by_sql[$sort_key] . ' ' . $direction; + } + + $s_limit_days = $s_sort_key = $s_sort_dir = $sort_url = ''; + gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $sort_url); + + $template->assign_vars(array( + 'S_SELECT_SORT_DIR' => $s_sort_dir, + 'S_SELECT_SORT_KEY' => $s_sort_key, + 'S_SELECT_SORT_DAYS' => $s_limit_days) + ); + + if (($sort_days && $mode != 'viewlogs') || in_array($mode, array('reports', 'unapproved_topics', 'unapproved_posts', 'deleted_topics', 'deleted_posts')) || $where_sql != 'WHERE') + { + $result = $db->sql_query($sql); + $total = (int) $db->sql_fetchfield('total'); + $db->sql_freeresult($result); + } + else + { + $total = -1; + } +} + +/** +* Validate ids +* +* @param array &$ids The relevant ids to check +* @param string $table The table to find the ids in +* @param string $sql_id The ids relevant column name +* @param array $acl_list A list of permissions the user need to have +* @param mixed $singe_forum Limit to one forum id (int) or the first forum found (true) +* +* @return mixed False if no ids were able to be retrieved, true if at least one id left. +* Additionally, this value can be the forum_id assigned if $single_forum was set. +* Therefore checking the result for with !== false is the best method. +*/ +function phpbb_check_ids(&$ids, $table, $sql_id, $acl_list = false, $single_forum = false) +{ + global $db, $auth; + + if (!is_array($ids) || empty($ids)) + { + return false; + } + + $sql = "SELECT $sql_id, forum_id FROM $table + WHERE " . $db->sql_in_set($sql_id, $ids); + $result = $db->sql_query($sql); + + $ids = array(); + $forum_id = false; + + while ($row = $db->sql_fetchrow($result)) + { + if ($acl_list && $row['forum_id'] && !$auth->acl_gets($acl_list, $row['forum_id'])) + { + continue; + } + + if ($acl_list && !$row['forum_id'] && !$auth->acl_getf_global($acl_list)) + { + continue; + } + + // Limit forum? If not, just assign the id. + if ($single_forum === false) + { + $ids[] = $row[$sql_id]; + continue; + } + + // Limit forum to a specific forum id? + // This can get really tricky, because we do not want to create a failure on global topics. :) + if ($row['forum_id']) + { + if ($single_forum !== true && $row['forum_id'] == (int) $single_forum) + { + $forum_id = (int) $single_forum; + } + else if ($forum_id === false) + { + $forum_id = $row['forum_id']; + } + + if ($row['forum_id'] == $forum_id) + { + $ids[] = $row[$sql_id]; + } + } + else + { + // Always add a global topic + $ids[] = $row[$sql_id]; + } + } + $db->sql_freeresult($result); + + if (!sizeof($ids)) + { + return false; + } + + // If forum id is false and ids populated we may have only global announcements selected (returning 0 because of (int) $forum_id) + + return ($single_forum === false) ? true : (int) $forum_id; +} diff --git a/sources/phpBB/includes/functions_messenger.php b/sources/phpBB/includes/functions_messenger.php new file mode 100644 index 0000000..045e555 --- /dev/null +++ b/sources/phpBB/includes/functions_messenger.php @@ -0,0 +1,1731 @@ + +* @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; +} + +/** +* Messenger +*/ +class messenger +{ + var $msg, $extra_headers, $replyto, $from, $subject; + var $addresses = array(); + + var $mail_priority = MAIL_NORMAL_PRIORITY; + var $use_queue = true; + + /** @var \phpbb\template\template */ + protected $template; + + var $eol = "\n"; + + /** + * Constructor + */ + function messenger($use_queue = true) + { + global $config; + + $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; + } + + /** + * Resets all the data (address, template file, etc etc) to default + */ + function reset() + { + $this->addresses = $this->extra_headers = array(); + $this->msg = $this->replyto = $this->from = ''; + $this->mail_priority = MAIL_NORMAL_PRIORITY; + } + + /** + * Set addresses for to/im as available + * + * @param array $user User row + */ + function set_addresses($user) + { + if (isset($user['user_email']) && $user['user_email']) + { + $this->to($user['user_email'], (isset($user['username']) ? $user['username'] : '')); + } + + if (isset($user['user_jabber']) && $user['user_jabber']) + { + $this->im($user['user_jabber'], (isset($user['username']) ? $user['username'] : '')); + } + } + + /** + * Sets an email address to send to + */ + function to($address, $realname = '') + { + global $config; + + if (!trim($address)) + { + return; + } + + $pos = isset($this->addresses['to']) ? sizeof($this->addresses['to']) : 0; + + $this->addresses['to'][$pos]['email'] = trim($address); + + // If empty sendmail_path on windows, PHP changes the to line + if (!$config['smtp_delivery'] && DIRECTORY_SEPARATOR == '\\') + { + $this->addresses['to'][$pos]['name'] = ''; + } + else + { + $this->addresses['to'][$pos]['name'] = trim($realname); + } + } + + /** + * Sets an cc address to send to + */ + function cc($address, $realname = '') + { + if (!trim($address)) + { + return; + } + + $pos = isset($this->addresses['cc']) ? sizeof($this->addresses['cc']) : 0; + $this->addresses['cc'][$pos]['email'] = trim($address); + $this->addresses['cc'][$pos]['name'] = trim($realname); + } + + /** + * Sets an bcc address to send to + */ + function bcc($address, $realname = '') + { + if (!trim($address)) + { + return; + } + + $pos = isset($this->addresses['bcc']) ? sizeof($this->addresses['bcc']) : 0; + $this->addresses['bcc'][$pos]['email'] = trim($address); + $this->addresses['bcc'][$pos]['name'] = trim($realname); + } + + /** + * Sets a im contact to send to + */ + function im($address, $realname = '') + { + // IM-Addresses could be empty + if (!trim($address)) + { + return; + } + + $pos = isset($this->addresses['im']) ? sizeof($this->addresses['im']) : 0; + $this->addresses['im'][$pos]['uid'] = trim($address); + $this->addresses['im'][$pos]['name'] = trim($realname); + } + + /** + * Set the reply to address + */ + function replyto($address) + { + $this->replyto = trim($address); + } + + /** + * Set the from address + */ + function from($address) + { + $this->from = trim($address); + } + + /** + * set up subject for mail + */ + function subject($subject = '') + { + $this->subject = trim($subject); + } + + /** + * set up extra mail headers + */ + function headers($headers) + { + $this->extra_headers[] = trim($headers); + } + + /** + * Adds X-AntiAbuse headers + * + * @param array $config Configuration array + * @param user $user A user object + * + * @return null + */ + function anti_abuse_headers($config, $user) + { + $this->headers('X-AntiAbuse: Board servername - ' . mail_encode($config['server_name'])); + $this->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']); + $this->headers('X-AntiAbuse: Username - ' . mail_encode($user->data['username'])); + $this->headers('X-AntiAbuse: User IP - ' . $user->ip); + } + + /** + * Set the email priority + */ + function set_mail_priority($priority = MAIL_NORMAL_PRIORITY) + { + $this->mail_priority = $priority; + } + + /** + * Set email template to use + */ + function template($template_file, $template_lang = '', $template_path = '') + { + global $config, $phpbb_root_path, $phpEx, $user, $phpbb_extension_manager; + + $this->setup_template(); + + if (!trim($template_file)) + { + trigger_error('No template file for emailing set.', E_USER_ERROR); + } + + if (!trim($template_lang)) + { + // fall back to board default language if the user's language is + // missing $template_file. If this does not exist either, + // $this->template->set_filenames will do a trigger_error + $template_lang = basename($config['default_lang']); + } + + if ($template_path) + { + $template_paths = array( + $template_path, + ); + } + else + { + $template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/'; + $template_path .= $template_lang . '/email'; + + $template_paths = array( + $template_path, + ); + + // we can only specify default language fallback when the path is not a custom one for which we + // do not know the default language alternative + if ($template_lang !== basename($config['default_lang'])) + { + $fallback_template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/'; + $fallback_template_path .= basename($config['default_lang']) . '/email'; + + $template_paths[] = $fallback_template_path; + } + } + + $this->set_template_paths(array( + array( + 'name' => $template_lang . '_email', + 'ext_path' => 'language/' . $template_lang . '/email' + ), + ), $template_paths); + + $this->template->set_filenames(array( + 'body' => $template_file . '.txt', + )); + + return true; + } + + /** + * assign variables to email template + */ + function assign_vars($vars) + { + $this->setup_template(); + + $this->template->assign_vars($vars); + } + + function assign_block_vars($blockname, $vars) + { + $this->setup_template(); + + $this->template->assign_block_vars($blockname, $vars); + } + + /** + * Send the mail out to the recipients set previously in var $this->addresses + */ + function send($method = NOTIFY_EMAIL, $break = false) + { + global $config, $user; + + // We add some standard variables we always use, no need to specify them always + $this->assign_vars(array( + 'U_BOARD' => generate_board_url(), + 'EMAIL_SIG' => str_replace('
', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])), + 'SITENAME' => htmlspecialchars_decode($config['sitename']), + )); + + // Parse message through template + $this->msg = trim($this->template->assign_display('body')); + + // Because we use \n for newlines in the body message we need to fix line encoding errors for those admins who uploaded email template files in the wrong encoding + $this->msg = str_replace("\r\n", "\n", $this->msg); + + // We now try and pull a subject from the email body ... if it exists, + // do this here because the subject may contain a variable + $drop_header = ''; + $match = array(); + if (preg_match('#^(Subject:(.*?))$#m', $this->msg, $match)) + { + $this->subject = (trim($match[2]) != '') ? trim($match[2]) : (($this->subject != '') ? $this->subject : $user->lang['NO_EMAIL_SUBJECT']); + $drop_header .= '[\r\n]*?' . preg_quote($match[1], '#'); + } + else + { + $this->subject = (($this->subject != '') ? $this->subject : $user->lang['NO_EMAIL_SUBJECT']); + } + + if ($drop_header) + { + $this->msg = trim(preg_replace('#' . $drop_header . '#s', '', $this->msg)); + } + + if ($break) + { + return true; + } + + switch ($method) + { + case NOTIFY_EMAIL: + $result = $this->msg_email(); + break; + + case NOTIFY_IM: + $result = $this->msg_jabber(); + break; + + case NOTIFY_BOTH: + $result = $this->msg_email(); + $this->msg_jabber(); + break; + } + + $this->reset(); + return $result; + } + + /** + * Add error message to log + */ + function error($type, $msg) + { + global $user, $phpEx, $phpbb_root_path, $config, $request; + + // Session doesn't exist, create it + if (!isset($user->session_id) || $user->session_id === '') + { + $user->session_begin(); + } + + $calling_page = htmlspecialchars_decode($request->server('PHP_SELF')); + + $message = ''; + switch ($type) + { + case 'EMAIL': + $message = 'EMAIL/' . (($config['smtp_delivery']) ? 'SMTP' : 'PHP/' . $config['email_function_name'] . '()') . ''; + break; + + default: + $message = "$type"; + break; + } + + $message .= '
' . htmlspecialchars($calling_page) . '

' . $msg . '
'; + add_log('critical', 'LOG_ERROR_' . $type, $message); + } + + /** + * Save to queue + */ + function save_queue() + { + global $config; + + if ($config['email_package_size'] && $this->use_queue && !empty($this->queue)) + { + $this->queue->save(); + return; + } + } + + /** + * Generates a valid message id to be used in emails + * + * @return string message id + */ + function generate_message_id() + { + global $config, $request; + + $domain = ($config['server_name']) ?: $request->server('SERVER_NAME', 'phpbb.generated'); + + return md5(unique_id(time())) . '@' . $domain; + } + + /** + * Return email header + */ + function build_header($to, $cc, $bcc) + { + global $config; + + // We could use keys here, but we won't do this for 3.0.x to retain backwards compatibility + $headers = array(); + + $headers[] = 'From: ' . $this->from; + + if ($cc) + { + $headers[] = 'Cc: ' . $cc; + } + + if ($bcc) + { + $headers[] = 'Bcc: ' . $bcc; + } + + $headers[] = 'Reply-To: ' . $this->replyto; + $headers[] = 'Return-Path: <' . $config['board_email'] . '>'; + $headers[] = 'Sender: <' . $config['board_email'] . '>'; + $headers[] = 'MIME-Version: 1.0'; + $headers[] = 'Message-ID: <' . $this->generate_message_id() . '>'; + $headers[] = 'Date: ' . date('r', time()); + $headers[] = 'Content-Type: text/plain; charset=UTF-8'; // format=flowed + $headers[] = 'Content-Transfer-Encoding: 8bit'; // 7bit + + $headers[] = 'X-Priority: ' . $this->mail_priority; + $headers[] = 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High')); + $headers[] = 'X-Mailer: phpBB3'; + $headers[] = 'X-MimeOLE: phpBB3'; + $headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()); + + if (sizeof($this->extra_headers)) + { + $headers = array_merge($headers, $this->extra_headers); + } + + return $headers; + } + + /** + * Send out emails + */ + function msg_email() + { + global $config, $user; + + if (empty($config['email_enable'])) + { + return false; + } + + // Addresses to send to? + if (empty($this->addresses) || (empty($this->addresses['to']) && empty($this->addresses['cc']) && empty($this->addresses['bcc']))) + { + // Send was successful. ;) + return true; + } + + $use_queue = false; + if ($config['email_package_size'] && $this->use_queue) + { + if (empty($this->queue)) + { + $this->queue = new queue(); + $this->queue->init('email', $config['email_package_size']); + } + $use_queue = true; + } + + $contact_name = htmlspecialchars_decode($config['board_contact_name']); + $board_contact = (($contact_name !== '') ? '"' . mail_encode($contact_name) . '" ' : '') . '<' . $config['board_contact'] . '>'; + + if (empty($this->replyto)) + { + $this->replyto = $board_contact; + } + + if (empty($this->from)) + { + $this->from = $board_contact; + } + + $encode_eol = ($config['smtp_delivery']) ? "\r\n" : $this->eol; + + // Build to, cc and bcc strings + $to = $cc = $bcc = ''; + foreach ($this->addresses as $type => $address_ary) + { + if ($type == 'im') + { + continue; + } + + foreach ($address_ary as $which_ary) + { + $$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? mail_encode($which_ary['name'], $encode_eol) . ' <' . $which_ary['email'] . '>' : $which_ary['email']); + } + } + + // Build header + $headers = $this->build_header($to, $cc, $bcc); + + // Send message ... + if (!$use_queue) + { + $mail_to = ($to == '') ? 'undisclosed-recipients:;' : $to; + $err_msg = ''; + + if ($config['smtp_delivery']) + { + $result = smtpmail($this->addresses, mail_encode($this->subject), wordwrap(utf8_wordwrap($this->msg), 997, "\n", true), $err_msg, $headers); + } + else + { + $result = phpbb_mail($mail_to, $this->subject, $this->msg, $headers, $this->eol, $err_msg); + } + + if (!$result) + { + $this->error('EMAIL', $err_msg); + return false; + } + } + else + { + $this->queue->put('email', array( + 'to' => $to, + 'addresses' => $this->addresses, + 'subject' => $this->subject, + 'msg' => $this->msg, + 'headers' => $headers) + ); + } + + return true; + } + + /** + * Send jabber message out + */ + function msg_jabber() + { + global $config, $db, $user, $phpbb_root_path, $phpEx; + + if (empty($config['jab_enable']) || empty($config['jab_host']) || empty($config['jab_username']) || empty($config['jab_password'])) + { + return false; + } + + if (empty($this->addresses['im'])) + { + // Send was successful. ;) + return true; + } + + $use_queue = false; + if ($config['jab_package_size'] && $this->use_queue) + { + if (empty($this->queue)) + { + $this->queue = new queue(); + $this->queue->init('jabber', $config['jab_package_size']); + } + $use_queue = true; + } + + $addresses = array(); + foreach ($this->addresses['im'] as $type => $uid_ary) + { + $addresses[] = $uid_ary['uid']; + } + $addresses = array_unique($addresses); + + if (!$use_queue) + { + include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx); + $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']); + + if (!$this->jabber->connect()) + { + $this->error('JABBER', $user->lang['ERR_JAB_CONNECT'] . '
' . $this->jabber->get_log()); + return false; + } + + if (!$this->jabber->login()) + { + $this->error('JABBER', $user->lang['ERR_JAB_AUTH'] . '
' . $this->jabber->get_log()); + return false; + } + + foreach ($addresses as $address) + { + $this->jabber->send_message($address, $this->msg, $this->subject); + } + + $this->jabber->disconnect(); + } + else + { + $this->queue->put('jabber', array( + 'addresses' => $addresses, + 'subject' => $this->subject, + 'msg' => $this->msg) + ); + } + unset($addresses); + return true; + } + + /** + * Setup template engine + */ + protected function setup_template() + { + global $config, $phpbb_path_helper, $user, $phpbb_extension_manager; + + 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); + } + + /** + * Set template paths to load + */ + protected function set_template_paths($path_name, $paths) + { + $this->setup_template(); + + $this->template->set_custom_style($path_name, $paths); + } +} + +/** +* handling email and jabber queue +*/ +class queue +{ + var $data = array(); + var $queue_data = array(); + var $package_size = 0; + var $cache_file = ''; + var $eol = "\n"; + + /** + * constructor + */ + function queue() + { + global $phpEx, $phpbb_root_path; + + $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; + } + + /** + * Init a queue object + */ + function init($object, $package_size) + { + $this->data[$object] = array(); + $this->data[$object]['package_size'] = $package_size; + $this->data[$object]['data'] = array(); + } + + /** + * Put object in queue + */ + function put($object, $scope) + { + $this->data[$object]['data'][] = $scope; + } + + /** + * Process queue + * Using lock file + */ + function process() + { + global $db, $config, $phpEx, $phpbb_root_path, $user; + + $lock = new \phpbb\lock\flock($this->cache_file); + $lock->acquire(); + + // avoid races, check file existence once + $have_cache_file = file_exists($this->cache_file); + if (!$have_cache_file || $config['last_queue_run'] > time() - $config['queue_interval']) + { + if (!$have_cache_file) + { + set_config('last_queue_run', time(), true); + } + + $lock->release(); + return; + } + + set_config('last_queue_run', time(), true); + + include($this->cache_file); + + foreach ($this->queue_data as $object => $data_ary) + { + @set_time_limit(0); + + if (!isset($data_ary['package_size'])) + { + $data_ary['package_size'] = 0; + } + + $package_size = $data_ary['package_size']; + $num_items = (!$package_size || sizeof($data_ary['data']) < $package_size) ? sizeof($data_ary['data']) : $package_size; + + /* + * This code is commented out because it causes problems on some web hosts. + * The core problem is rather restrictive email sending limits. + * This code is nly useful if you have no such restrictions from the + * web host and the package size setting is wrong. + + // If the amount of emails to be sent is way more than package_size than we need to increase it to prevent backlogs... + if (sizeof($data_ary['data']) > $package_size * 2.5) + { + $num_items = sizeof($data_ary['data']); + } + */ + + switch ($object) + { + case 'email': + // Delete the email queued objects if mailing is disabled + if (!$config['email_enable']) + { + unset($this->queue_data['email']); + continue 2; + } + break; + + case 'jabber': + if (!$config['jab_enable']) + { + unset($this->queue_data['jabber']); + continue 2; + } + + include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx); + $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']); + + if (!$this->jabber->connect()) + { + $messenger = new messenger(); + $messenger->error('JABBER', $user->lang['ERR_JAB_CONNECT']); + continue 2; + } + + if (!$this->jabber->login()) + { + $messenger = new messenger(); + $messenger->error('JABBER', $user->lang['ERR_JAB_AUTH']); + continue 2; + } + + break; + + default: + $lock->release(); + return; + } + + for ($i = 0; $i < $num_items; $i++) + { + // Make variables available... + extract(array_shift($this->queue_data[$object]['data'])); + + switch ($object) + { + case 'email': + $err_msg = ''; + $to = (!$to) ? 'undisclosed-recipients:;' : $to; + + if ($config['smtp_delivery']) + { + $result = smtpmail($addresses, mail_encode($subject), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $err_msg, $headers); + } + else + { + $result = phpbb_mail($to, $subject, $msg, $headers, $this->eol, $err_msg); + } + + if (!$result) + { + $messenger = new messenger(); + $messenger->error('EMAIL', $err_msg); + continue 2; + } + break; + + case 'jabber': + foreach ($addresses as $address) + { + if ($this->jabber->send_message($address, $msg, $subject) === false) + { + $messenger = new messenger(); + $messenger->error('JABBER', $this->jabber->get_log()); + continue 3; + } + } + break; + } + } + + // No more data for this object? Unset it + if (!sizeof($this->queue_data[$object]['data'])) + { + unset($this->queue_data[$object]); + } + + // Post-object processing + switch ($object) + { + case 'jabber': + // Hang about a couple of secs to ensure the messages are + // handled, then disconnect + $this->jabber->disconnect(); + break; + } + } + + if (!sizeof($this->queue_data)) + { + @unlink($this->cache_file); + } + else + { + if ($fp = @fopen($this->cache_file, 'wb')) + { + fwrite($fp, "queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>"); + fclose($fp); + + phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE); + } + } + + $lock->release(); + } + + /** + * Save queue + */ + function save() + { + if (!sizeof($this->data)) + { + return; + } + + $lock = new \phpbb\lock\flock($this->cache_file); + $lock->acquire(); + + if (file_exists($this->cache_file)) + { + include($this->cache_file); + + foreach ($this->queue_data as $object => $data_ary) + { + if (isset($this->data[$object]) && sizeof($this->data[$object])) + { + $this->data[$object]['data'] = array_merge($data_ary['data'], $this->data[$object]['data']); + } + else + { + $this->data[$object]['data'] = $data_ary['data']; + } + } + } + + if ($fp = @fopen($this->cache_file, 'w')) + { + fwrite($fp, "queue_data = unserialize(" . var_export(serialize($this->data), true) . ");\n\n?>"); + fclose($fp); + + phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE); + } + + $lock->release(); + } +} + +/** +* Replacement or substitute for PHP's mail command +*/ +function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false) +{ + global $config, $user; + + // Fix any bare linefeeds in the message to make it RFC821 Compliant. + $message = preg_replace("#(?lang['NO_EMAIL_SUBJECT'])) ? $user->lang['NO_EMAIL_SUBJECT'] : 'No email subject specified'; + return false; + } + + if (trim($message) == '') + { + $err_msg = (isset($user->lang['NO_EMAIL_MESSAGE'])) ? $user->lang['NO_EMAIL_MESSAGE'] : 'Email message was blank'; + return false; + } + + $mail_rcpt = $mail_to = $mail_cc = array(); + + // Build correct addresses for RCPT TO command and the client side display (TO, CC) + if (isset($addresses['to']) && sizeof($addresses['to'])) + { + foreach ($addresses['to'] as $which_ary) + { + $mail_to[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name'])) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>'; + $mail_rcpt['to'][] = '<' . trim($which_ary['email']) . '>'; + } + } + + if (isset($addresses['bcc']) && sizeof($addresses['bcc'])) + { + foreach ($addresses['bcc'] as $which_ary) + { + $mail_rcpt['bcc'][] = '<' . trim($which_ary['email']) . '>'; + } + } + + if (isset($addresses['cc']) && sizeof($addresses['cc'])) + { + foreach ($addresses['cc'] as $which_ary) + { + $mail_cc[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name'])) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>'; + $mail_rcpt['cc'][] = '<' . trim($which_ary['email']) . '>'; + } + } + + $smtp = new smtp_class(); + + $errno = 0; + $errstr = ''; + + $smtp->add_backtrace('Connecting to ' . $config['smtp_host'] . ':' . $config['smtp_port']); + + // Ok we have error checked as much as we can to this point let's get on it already. + if (!class_exists('\phpbb\error_collector')) + { + global $phpbb_root_path, $phpEx; + include($phpbb_root_path . 'includes/error_collector.' . $phpEx); + } + $collector = new \phpbb\error_collector; + $collector->install(); + $smtp->socket = fsockopen($config['smtp_host'], $config['smtp_port'], $errno, $errstr, 20); + $collector->uninstall(); + $error_contents = $collector->format_errors(); + + if (!$smtp->socket) + { + if ($errstr) + { + $errstr = utf8_convert_message($errstr); + } + + $err_msg = (isset($user->lang['NO_CONNECT_TO_SMTP_HOST'])) ? sprintf($user->lang['NO_CONNECT_TO_SMTP_HOST'], $errno, $errstr) : "Could not connect to smtp host : $errno : $errstr"; + $err_msg .= ($error_contents) ? '

' . htmlspecialchars($error_contents) : ''; + return false; + } + + // Wait for reply + if ($err_msg = $smtp->server_parse('220', __LINE__)) + { + $smtp->close_session($err_msg); + return false; + } + + // Let me in. This function handles the complete authentication process + if ($err_msg = $smtp->log_into_server($config['smtp_host'], $config['smtp_username'], htmlspecialchars_decode($config['smtp_password']), $config['smtp_auth_method'])) + { + $smtp->close_session($err_msg); + return false; + } + + // From this point onward most server response codes should be 250 + // Specify who the mail is from.... + $smtp->server_send('MAIL FROM:<' . $config['board_email'] . '>'); + if ($err_msg = $smtp->server_parse('250', __LINE__)) + { + $smtp->close_session($err_msg); + return false; + } + + // Specify each user to send to and build to header. + $to_header = implode(', ', $mail_to); + $cc_header = implode(', ', $mail_cc); + + // Now tell the MTA to send the Message to the following people... [TO, BCC, CC] + $rcpt = false; + foreach ($mail_rcpt as $type => $mail_to_addresses) + { + foreach ($mail_to_addresses as $mail_to_address) + { + // Add an additional bit of error checking to the To field. + if (preg_match('#[^ ]+\@[^ ]+#', $mail_to_address)) + { + $smtp->server_send("RCPT TO:$mail_to_address"); + if ($err_msg = $smtp->server_parse('250', __LINE__)) + { + // We continue... if users are not resolved we do not care + if ($smtp->numeric_response_code != 550) + { + $smtp->close_session($err_msg); + return false; + } + } + else + { + $rcpt = true; + } + } + } + } + + // We try to send messages even if a few people do not seem to have valid email addresses, but if no one has, we have to exit here. + if (!$rcpt) + { + $user->session_begin(); + $err_msg .= '

'; + $err_msg .= (isset($user->lang['INVALID_EMAIL_LOG'])) ? sprintf($user->lang['INVALID_EMAIL_LOG'], htmlspecialchars($mail_to_address)) : '' . htmlspecialchars($mail_to_address) . ' possibly an invalid email address?'; + $smtp->close_session($err_msg); + return false; + } + + // Ok now we tell the server we are ready to start sending data + $smtp->server_send('DATA'); + + // This is the last response code we look for until the end of the message. + if ($err_msg = $smtp->server_parse('354', __LINE__)) + { + $smtp->close_session($err_msg); + return false; + } + + // Send the Subject Line... + $smtp->server_send("Subject: $subject"); + + // Now the To Header. + $to_header = ($to_header == '') ? 'undisclosed-recipients:;' : $to_header; + $smtp->server_send("To: $to_header"); + + // Now the CC Header. + if ($cc_header != '') + { + $smtp->server_send("CC: $cc_header"); + } + + // Now any custom headers.... + if ($headers !== false) + { + $smtp->server_send("$headers\r\n"); + } + + // Ok now we are ready for the message... + $smtp->server_send($message); + + // Ok the all the ingredients are mixed in let's cook this puppy... + $smtp->server_send('.'); + if ($err_msg = $smtp->server_parse('250', __LINE__)) + { + $smtp->close_session($err_msg); + return false; + } + + // Now tell the server we are done and close the socket... + $smtp->server_send('QUIT'); + $smtp->close_session($err_msg); + + return true; +} + +/** +* SMTP Class +* Auth Mechanisms originally taken from the AUTH Modules found within the PHP Extension and Application Repository (PEAR) +* See docs/AUTHORS for more details +*/ +class smtp_class +{ + var $server_response = ''; + var $socket = 0; + protected $socket_tls = false; + var $responses = array(); + var $commands = array(); + var $numeric_response_code = 0; + + var $backtrace = false; + var $backtrace_log = array(); + + function smtp_class() + { + // Always create a backtrace for admins to identify SMTP problems + $this->backtrace = true; + $this->backtrace_log = array(); + } + + /** + * Add backtrace message for debugging + */ + function add_backtrace($message) + { + if ($this->backtrace) + { + $this->backtrace_log[] = utf8_htmlspecialchars($message); + } + } + + /** + * Send command to smtp server + */ + function server_send($command, $private_info = false) + { + fputs($this->socket, $command . "\r\n"); + + (!$private_info) ? $this->add_backtrace("# $command") : $this->add_backtrace('# Omitting sensitive information'); + + // We could put additional code here + } + + /** + * We use the line to give the support people an indication at which command the error occurred + */ + function server_parse($response, $line) + { + global $user; + + $this->server_response = ''; + $this->responses = array(); + $this->numeric_response_code = 0; + + while (substr($this->server_response, 3, 1) != ' ') + { + if (!($this->server_response = fgets($this->socket, 256))) + { + return (isset($user->lang['NO_EMAIL_RESPONSE_CODE'])) ? $user->lang['NO_EMAIL_RESPONSE_CODE'] : 'Could not get mail server response codes'; + } + $this->responses[] = substr(rtrim($this->server_response), 4); + $this->numeric_response_code = (int) substr($this->server_response, 0, 3); + + $this->add_backtrace("LINE: $line <- {$this->server_response}"); + } + + if (!(substr($this->server_response, 0, 3) == $response)) + { + $this->numeric_response_code = (int) substr($this->server_response, 0, 3); + return (isset($user->lang['EMAIL_SMTP_ERROR_RESPONSE'])) ? sprintf($user->lang['EMAIL_SMTP_ERROR_RESPONSE'], $line, $this->server_response) : "Ran into problems sending Mail at Line $line. Response: $this->server_response"; + } + + return 0; + } + + /** + * Close session + */ + function close_session(&$err_msg) + { + fclose($this->socket); + + if ($this->backtrace) + { + $message = '

Backtrace

' . implode('
', $this->backtrace_log) . '

'; + $err_msg .= $message; + } + } + + /** + * Log into server and get possible auth codes if neccessary + */ + function log_into_server($hostname, $username, $password, $default_auth_method) + { + global $user; + + $err_msg = ''; + + // Here we try to determine the *real* hostname (reverse DNS entry preferrably) + $local_host = $user->host; + + if (function_exists('php_uname')) + { + $local_host = php_uname('n'); + + // Able to resolve name to IP + if (($addr = @gethostbyname($local_host)) !== $local_host) + { + // Able to resolve IP back to name + if (($name = @gethostbyaddr($addr)) !== $addr) + { + $local_host = $name; + } + } + } + + // If we are authenticating through pop-before-smtp, we + // have to login ones before we get authenticated + // NOTE: on some configurations the time between an update of the auth database takes so + // long that the first email send does not work. This is not a biggie on a live board (only + // the install mail will most likely fail) - but on a dynamic ip connection this might produce + // severe problems and is not fixable! + if ($default_auth_method == 'POP-BEFORE-SMTP' && $username && $password) + { + global $config; + + $errno = 0; + $errstr = ''; + + $this->server_send("QUIT"); + fclose($this->socket); + + $result = $this->pop_before_smtp($hostname, $username, $password); + $username = $password = $default_auth_method = ''; + + // We need to close the previous session, else the server is not + // able to get our ip for matching... + if (!$this->socket = @fsockopen($config['smtp_host'], $config['smtp_port'], $errno, $errstr, 10)) + { + if ($errstr) + { + $errstr = utf8_convert_message($errstr); + } + + $err_msg = (isset($user->lang['NO_CONNECT_TO_SMTP_HOST'])) ? sprintf($user->lang['NO_CONNECT_TO_SMTP_HOST'], $errno, $errstr) : "Could not connect to smtp host : $errno : $errstr"; + return $err_msg; + } + + // Wait for reply + if ($err_msg = $this->server_parse('220', __LINE__)) + { + $this->close_session($err_msg); + return $err_msg; + } + } + + $hello_result = $this->hello($local_host); + if (!is_null($hello_result)) + { + return $hello_result; + } + + // SMTP STARTTLS (RFC 3207) + if (!$this->socket_tls) + { + $this->socket_tls = $this->starttls(); + + if ($this->socket_tls) + { + // Switched to TLS + // RFC 3207: "The client MUST discard any knowledge obtained from the server, [...]" + // So say hello again + $hello_result = $this->hello($local_host); + + if (!is_null($hello_result)) + { + return $hello_result; + } + } + } + + // If we are not authenticated yet, something might be wrong if no username and passwd passed + if (!$username || !$password) + { + return false; + } + + if (!isset($this->commands['AUTH'])) + { + return (isset($user->lang['SMTP_NO_AUTH_SUPPORT'])) ? $user->lang['SMTP_NO_AUTH_SUPPORT'] : 'SMTP server does not support authentication'; + } + + // Get best authentication method + $available_methods = explode(' ', $this->commands['AUTH']); + + // Define the auth ordering if the default auth method was not found + $auth_methods = array('PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5'); + $method = ''; + + if (in_array($default_auth_method, $available_methods)) + { + $method = $default_auth_method; + } + else + { + foreach ($auth_methods as $_method) + { + if (in_array($_method, $available_methods)) + { + $method = $_method; + break; + } + } + } + + if (!$method) + { + return (isset($user->lang['NO_SUPPORTED_AUTH_METHODS'])) ? $user->lang['NO_SUPPORTED_AUTH_METHODS'] : 'No supported authentication methods'; + } + + $method = strtolower(str_replace('-', '_', $method)); + return $this->$method($username, $password); + } + + /** + * SMTP EHLO/HELO + * + * @return mixed Null if the authentication process is supposed to continue + * False if already authenticated + * Error message (string) otherwise + */ + protected function hello($hostname) + { + // Try EHLO first + $this->server_send("EHLO $hostname"); + if ($err_msg = $this->server_parse('250', __LINE__)) + { + // a 503 response code means that we're already authenticated + if ($this->numeric_response_code == 503) + { + return false; + } + + // If EHLO fails, we try HELO + $this->server_send("HELO $hostname"); + if ($err_msg = $this->server_parse('250', __LINE__)) + { + return ($this->numeric_response_code == 503) ? false : $err_msg; + } + } + + foreach ($this->responses as $response) + { + $response = explode(' ', $response); + $response_code = $response[0]; + unset($response[0]); + $this->commands[$response_code] = implode(' ', $response); + } + } + + /** + * SMTP STARTTLS (RFC 3207) + * + * @return bool Returns true if TLS was started + * Otherwise false + */ + protected function starttls() + { + if (!function_exists('stream_socket_enable_crypto')) + { + return false; + } + + if (!isset($this->commands['STARTTLS'])) + { + return false; + } + + $this->server_send('STARTTLS'); + + if ($err_msg = $this->server_parse('220', __LINE__)) + { + return false; + } + + $result = false; + $stream_meta = stream_get_meta_data($this->socket); + + if (socket_set_blocking($this->socket, 1)) + { + $result = stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT); + socket_set_blocking($this->socket, (int) $stream_meta['blocked']); + } + + return $result; + } + + /** + * Pop before smtp authentication + */ + function pop_before_smtp($hostname, $username, $password) + { + global $user; + + if (!$this->socket = @fsockopen($hostname, 110, $errno, $errstr, 10)) + { + if ($errstr) + { + $errstr = utf8_convert_message($errstr); + } + + return (isset($user->lang['NO_CONNECT_TO_SMTP_HOST'])) ? sprintf($user->lang['NO_CONNECT_TO_SMTP_HOST'], $errno, $errstr) : "Could not connect to smtp host : $errno : $errstr"; + } + + $this->server_send("USER $username", true); + if ($err_msg = $this->server_parse('+OK', __LINE__)) + { + return $err_msg; + } + + $this->server_send("PASS $password", true); + if ($err_msg = $this->server_parse('+OK', __LINE__)) + { + return $err_msg; + } + + $this->server_send('QUIT'); + fclose($this->socket); + + return false; + } + + /** + * Plain authentication method + */ + function plain($username, $password) + { + $this->server_send('AUTH PLAIN'); + if ($err_msg = $this->server_parse('334', __LINE__)) + { + return ($this->numeric_response_code == 503) ? false : $err_msg; + } + + $base64_method_plain = base64_encode("\0" . $username . "\0" . $password); + $this->server_send($base64_method_plain, true); + if ($err_msg = $this->server_parse('235', __LINE__)) + { + return $err_msg; + } + + return false; + } + + /** + * Login authentication method + */ + function login($username, $password) + { + $this->server_send('AUTH LOGIN'); + if ($err_msg = $this->server_parse('334', __LINE__)) + { + return ($this->numeric_response_code == 503) ? false : $err_msg; + } + + $this->server_send(base64_encode($username), true); + if ($err_msg = $this->server_parse('334', __LINE__)) + { + return $err_msg; + } + + $this->server_send(base64_encode($password), true); + if ($err_msg = $this->server_parse('235', __LINE__)) + { + return $err_msg; + } + + return false; + } + + /** + * cram_md5 authentication method + */ + function cram_md5($username, $password) + { + $this->server_send('AUTH CRAM-MD5'); + if ($err_msg = $this->server_parse('334', __LINE__)) + { + return ($this->numeric_response_code == 503) ? false : $err_msg; + } + + $md5_challenge = base64_decode($this->responses[0]); + $password = (strlen($password) > 64) ? pack('H32', md5($password)) : ((strlen($password) < 64) ? str_pad($password, 64, chr(0)) : $password); + $md5_digest = md5((substr($password, 0, 64) ^ str_repeat(chr(0x5C), 64)) . (pack('H32', md5((substr($password, 0, 64) ^ str_repeat(chr(0x36), 64)) . $md5_challenge)))); + + $base64_method_cram_md5 = base64_encode($username . ' ' . $md5_digest); + + $this->server_send($base64_method_cram_md5, true); + if ($err_msg = $this->server_parse('235', __LINE__)) + { + return $err_msg; + } + + return false; + } + + /** + * digest_md5 authentication method + * A real pain in the *** + */ + function digest_md5($username, $password) + { + global $config, $user; + + $this->server_send('AUTH DIGEST-MD5'); + if ($err_msg = $this->server_parse('334', __LINE__)) + { + return ($this->numeric_response_code == 503) ? false : $err_msg; + } + + $md5_challenge = base64_decode($this->responses[0]); + + // Parse the md5 challenge - from AUTH_SASL (PEAR) + $tokens = array(); + while (preg_match('/^([a-z-]+)=("[^"]+(?host; + } + + // Maxbuf + if (empty($tokens['maxbuf'])) + { + $tokens['maxbuf'] = 65536; + } + + // Required: nonce, algorithm + if (empty($tokens['nonce']) || empty($tokens['algorithm'])) + { + $tokens = array(); + } + $md5_challenge = $tokens; + + if (!empty($md5_challenge)) + { + $str = ''; + for ($i = 0; $i < 32; $i++) + { + $str .= chr(mt_rand(0, 255)); + } + $cnonce = base64_encode($str); + + $digest_uri = 'smtp/' . $config['smtp_host']; + + $auth_1 = sprintf('%s:%s:%s', pack('H32', md5(sprintf('%s:%s:%s', $username, $md5_challenge['realm'], $password))), $md5_challenge['nonce'], $cnonce); + $auth_2 = 'AUTHENTICATE:' . $digest_uri; + $response_value = md5(sprintf('%s:%s:00000001:%s:auth:%s', md5($auth_1), $md5_challenge['nonce'], $cnonce, md5($auth_2))); + + $input_string = sprintf('username="%s",realm="%s",nonce="%s",cnonce="%s",nc="00000001",qop=auth,digest-uri="%s",response=%s,%d', $username, $md5_challenge['realm'], $md5_challenge['nonce'], $cnonce, $digest_uri, $response_value, $md5_challenge['maxbuf']); + } + else + { + return (isset($user->lang['INVALID_DIGEST_CHALLENGE'])) ? $user->lang['INVALID_DIGEST_CHALLENGE'] : 'Invalid digest challenge'; + } + + $base64_method_digest_md5 = base64_encode($input_string); + $this->server_send($base64_method_digest_md5, true); + if ($err_msg = $this->server_parse('334', __LINE__)) + { + return $err_msg; + } + + $this->server_send(' '); + if ($err_msg = $this->server_parse('235', __LINE__)) + { + return $err_msg; + } + + return false; + } +} + +/** +* Encodes the given string for proper display in UTF-8. +* +* This version is using base64 encoded data. The downside of this +* is if the mail client does not understand this encoding the user +* is basically doomed with an unreadable subject. +* +* Please note that this version fully supports RFC 2045 section 6.8. +* +* @param string $eol End of line we are using (optional to be backwards compatible) +*/ +function mail_encode($str, $eol = "\r\n") +{ + // define start delimimter, end delimiter and spacer + $start = "=?UTF-8?B?"; + $end = "?="; + $delimiter = "$eol "; + + // Maximum length is 75. $split_length *must* be a multiple of 4, but <= 75 - strlen($start . $delimiter . $end)!!! + $split_length = 60; + $encoded_str = base64_encode($str); + + // If encoded string meets the limits, we just return with the correct data. + if (strlen($encoded_str) <= $split_length) + { + return $start . $encoded_str . $end; + } + + // If there is only ASCII data, we just return what we want, correctly splitting the lines. + if (strlen($str) === utf8_strlen($str)) + { + return $start . implode($end . $delimiter . $start, str_split($encoded_str, $split_length)) . $end; + } + + // UTF-8 data, compose encoded lines + $array = utf8_str_split($str); + $str = ''; + + while (sizeof($array)) + { + $text = ''; + + while (sizeof($array) && intval((strlen($text . $array[0]) + 2) / 3) << 2 <= $split_length) + { + $text .= array_shift($array); + } + + $str .= $start . base64_encode($text) . $end . $delimiter; + } + + return substr($str, 0, -strlen($delimiter)); +} + +/** +* Wrapper for sending out emails with the PHP's mail function +*/ +function phpbb_mail($to, $subject, $msg, $headers, $eol, &$err_msg) +{ + global $config, $phpbb_root_path, $phpEx; + + // We use the EOL character for the OS here because the PHP mail function does not correctly transform line endings. On Windows SMTP is used (SMTP is \r\n), on UNIX a command is used... + // Reference: http://bugs.php.net/bug.php?id=15841 + $headers = implode($eol, $headers); + + if (!class_exists('\phpbb\error_collector')) + { + include($phpbb_root_path . 'includes/error_collector.' . $phpEx); + } + + $collector = new \phpbb\error_collector; + $collector->install(); + + // On some PHP Versions mail() *may* fail if there are newlines within the subject. + // Newlines are used as a delimiter for lines in mail_encode() according to RFC 2045 section 6.8. + // Because PHP can't decide what is wanted we revert back to the non-RFC-compliant way of separating by one space (Use '' as parameter to mail_encode() results in SPACE used) + $result = $config['email_function_name']($to, mail_encode($subject, ''), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $headers); + + $collector->uninstall(); + $err_msg = $collector->format_errors(); + + return $result; +} diff --git a/sources/phpBB/includes/functions_module.php b/sources/phpBB/includes/functions_module.php new file mode 100644 index 0000000..fe9bcdb --- /dev/null +++ b/sources/phpBB/includes/functions_module.php @@ -0,0 +1,1145 @@ + +* @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; +} + +/** +* Class handling all types of 'plugins' (a future term) +*/ +class p_master +{ + var $p_id; + var $p_class; + var $p_name; + var $p_mode; + var $p_parent; + + var $include_path = false; + var $active_module = false; + var $active_module_row_id = false; + var $acl_forum_id = false; + var $module_ary = array(); + + /** + * Constuctor + * Set module include path + */ + function p_master($include_path = false) + { + global $phpbb_root_path; + + $this->include_path = ($include_path !== false) ? $include_path : $phpbb_root_path . 'includes/'; + + // Make sure the path ends with / + if (substr($this->include_path, -1) !== '/') + { + $this->include_path .= '/'; + } + } + + /** + * Set custom include path for modules + * Schema for inclusion is include_path . modulebase + * + * @param string $include_path include path to be used. + * @access public + */ + function set_custom_include_path($include_path) + { + $this->include_path = $include_path; + + // Make sure the path ends with / + if (substr($this->include_path, -1) !== '/') + { + $this->include_path .= '/'; + } + } + + /** + * List modules + * + * This creates a list, stored in $this->module_ary of all available + * modules for the given class (ucp, mcp and acp). Additionally + * $this->module_y_ary is created with indentation information for + * displaying the module list appropriately. Only modules for which + * the user has access rights are included in these lists. + */ + function list_modules($p_class) + { + global $auth, $db, $user, $cache; + global $config, $phpbb_root_path, $phpEx, $phpbb_dispatcher; + + // Sanitise for future path use, it's escaped as appropriate for queries + $this->p_class = str_replace(array('.', '/', '\\'), '', basename($p_class)); + + // Get cached modules + if (($this->module_cache = $cache->get('_modules_' . $this->p_class)) === false) + { + // Get modules + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_class = '" . $db->sql_escape($this->p_class) . "' + ORDER BY left_id ASC"; + $result = $db->sql_query($sql); + + $rows = array(); + while ($row = $db->sql_fetchrow($result)) + { + $rows[$row['module_id']] = $row; + } + $db->sql_freeresult($result); + + $this->module_cache = array(); + foreach ($rows as $module_id => $row) + { + $this->module_cache['modules'][] = $row; + $this->module_cache['parents'][$row['module_id']] = $this->get_parents($row['parent_id'], $row['left_id'], $row['right_id'], $rows); + } + unset($rows); + + $cache->put('_modules_' . $this->p_class, $this->module_cache); + } + + if (empty($this->module_cache)) + { + $this->module_cache = array('modules' => array(), 'parents' => array()); + } + + // We "could" build a true tree with this function - maybe mod authors want to use this... + // Functions for traversing and manipulating the tree are not available though + // We might re-structure the module system to use true trees in 3.2.x... + // $tree = $this->build_tree($this->module_cache['modules'], $this->module_cache['parents']); + + // Clean up module cache array to only let survive modules the user can access + $right_id = false; + + $hide_categories = array(); + foreach ($this->module_cache['modules'] as $key => $row) + { + // When the module has no mode (category) we check whether it has visible children + // before listing it as well. + if (!$row['module_mode']) + { + $hide_categories[(int) $row['module_id']] = $key; + } + + // Not allowed to view module? + if (!$this->module_auth_self($row['module_auth'])) + { + unset($this->module_cache['modules'][$key]); + continue; + } + + // Category with no members, ignore + if (!$row['module_basename'] && ($row['left_id'] + 1 == $row['right_id'])) + { + unset($this->module_cache['modules'][$key]); + continue; + } + + // Skip branch + if ($right_id !== false) + { + if ($row['left_id'] < $right_id) + { + unset($this->module_cache['modules'][$key]); + continue; + } + + $right_id = false; + } + + // Not enabled? + if (!$row['module_enabled']) + { + // If category is disabled then disable every child too + unset($this->module_cache['modules'][$key]); + $right_id = $row['right_id']; + continue; + } + + if ($row['module_mode']) + { + // The parent category has a visible child + // So remove it and all its parents from the hide array + unset($hide_categories[(int) $row['parent_id']]); + foreach ($this->module_cache['parents'][$row['module_id']] as $module_id => $row_id) + { + unset($hide_categories[$module_id]); + } + } + } + + foreach ($hide_categories as $module_id => $row_id) + { + unset($this->module_cache['modules'][$row_id]); + } + + // Re-index (this is needed, else we are not able to array_slice later) + $this->module_cache['modules'] = array_merge($this->module_cache['modules']); + + // Include MOD _info files for populating language entries within the menus + $this->add_mod_info($this->p_class); + + // Now build the module array, but exclude completely empty categories... + $right_id = false; + $names = array(); + + foreach ($this->module_cache['modules'] as $key => $row) + { + // Skip branch + if ($right_id !== false) + { + if ($row['left_id'] < $right_id) + { + continue; + } + + $right_id = false; + } + + // Category with no members on their way down (we have to check every level) + if (!$row['module_basename']) + { + $empty_category = true; + + // We go through the branch and look for an activated module + foreach (array_slice($this->module_cache['modules'], $key + 1) as $temp_row) + { + if ($temp_row['left_id'] > $row['left_id'] && $temp_row['left_id'] < $row['right_id']) + { + // Module there + if ($temp_row['module_basename'] && $temp_row['module_enabled']) + { + $empty_category = false; + break; + } + continue; + } + break; + } + + // Skip the branch + if ($empty_category) + { + $right_id = $row['right_id']; + continue; + } + } + + $depth = sizeof($this->module_cache['parents'][$row['module_id']]); + + // We need to prefix the functions to not create a naming conflict + + // Function for building 'url_extra' + $short_name = $this->get_short_name($row['module_basename']); + + $url_func = 'phpbb_module_' . $short_name . '_url'; + if (!function_exists($url_func)) + { + $url_func = '_module_' . $short_name . '_url'; + } + + // Function for building the language name + $lang_func = 'phpbb_module_' . $short_name . '_lang'; + if (!function_exists($lang_func)) + { + $lang_func = '_module_' . $short_name . '_lang'; + } + + // Custom function for calling parameters on module init (for example assigning template variables) + $custom_func = 'phpbb_module_' . $short_name; + if (!function_exists($custom_func)) + { + $custom_func = '_module_' . $short_name; + } + + $names[$row['module_basename'] . '_' . $row['module_mode']][] = true; + + $module_row = array( + 'depth' => $depth, + + 'id' => (int) $row['module_id'], + 'parent' => (int) $row['parent_id'], + 'cat' => ($row['right_id'] > $row['left_id'] + 1) ? true : false, + + 'is_duplicate' => ($row['module_basename'] && sizeof($names[$row['module_basename'] . '_' . $row['module_mode']]) > 1) ? true : false, + + 'name' => (string) $row['module_basename'], + 'mode' => (string) $row['module_mode'], + 'display' => (int) $row['module_display'], + + 'url_extra' => (function_exists($url_func)) ? $url_func($row['module_mode'], $row) : '', + + 'lang' => ($row['module_basename'] && function_exists($lang_func)) ? $lang_func($row['module_mode'], $row['module_langname']) : ((!empty($user->lang[$row['module_langname']])) ? $user->lang[$row['module_langname']] : $row['module_langname']), + 'langname' => $row['module_langname'], + + 'left' => $row['left_id'], + 'right' => $row['right_id'], + ); + + if (function_exists($custom_func)) + { + $custom_func($row['module_mode'], $module_row); + } + + /** + * This event allows to modify parameters for building modules list + * + * @event core.modify_module_row + * @var string url_func Function for building 'url_extra' + * @var string lang_func Function for building the language name + * @var string custom_func Custom function for calling parameters on module init + * @var array row Array holding the basic module data + * @var array module_row Array holding the module display parameters + * @since 3.1.0-b3 + */ + $vars = array('url_func', 'lang_func', 'custom_func', 'row', 'module_row'); + extract($phpbb_dispatcher->trigger_event('core.modify_module_row', compact($vars))); + + $this->module_ary[] = $module_row; + } + + unset($this->module_cache['modules'], $names); + } + + /** + * Check if a certain main module is accessible/loaded + * By giving the module mode you are able to additionally check for only one mode within the main module + * + * @param string $module_basename The module base name, for example logs, reports, main (for the mcp). + * @param mixed $module_mode The module mode to check. If provided the mode will be checked in addition for presence. + * + * @return bool Returns true if module is loaded and accessible, else returns false + */ + function loaded($module_basename, $module_mode = false) + { + if (!$this->is_full_class($module_basename)) + { + $module_basename = $this->p_class . '_' . $module_basename; + } + + if (empty($this->loaded_cache)) + { + $this->loaded_cache = array(); + + foreach ($this->module_ary as $row) + { + if (!$row['name']) + { + continue; + } + + if (!isset($this->loaded_cache[$row['name']])) + { + $this->loaded_cache[$row['name']] = array(); + } + + if (!$row['mode']) + { + continue; + } + + $this->loaded_cache[$row['name']][$row['mode']] = true; + } + } + + if ($module_mode === false) + { + return (isset($this->loaded_cache[$module_basename])) ? true : false; + } + + return (!empty($this->loaded_cache[$module_basename][$module_mode])) ? true : false; + } + + /** + * Check module authorisation. + * + * This is a non-static version that uses $this->acl_forum_id + * for the forum id. + */ + function module_auth_self($module_auth) + { + return self::module_auth($module_auth, $this->acl_forum_id); + } + + /** + * Check module authorisation. + * + * This is a static version, it must be given $forum_id. + * See also module_auth_self. + */ + static function module_auth($module_auth, $forum_id) + { + global $auth, $config; + global $request, $phpbb_extension_manager, $phpbb_dispatcher; + + $module_auth = trim($module_auth); + + // Generally allowed to access module if module_auth is empty + if (!$module_auth) + { + return true; + } + + // With the code below we make sure only those elements get eval'd we really want to be checked + preg_match_all('/(?: + "[^"\\\\]*(?:\\\\.[^"\\\\]*)*" | + \'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\' | + [(),] | + [^\s(),]+)/x', $module_auth, $match); + + // Valid tokens for auth and their replacements + $valid_tokens = array( + 'acl_([a-z0-9_]+)(,\$id)?' => '(int) $auth->acl_get(\'\\1\'\\2)', + '\$id' => '(int) $forum_id', + 'aclf_([a-z0-9_]+)' => '(int) $auth->acl_getf_global(\'\\1\')', + 'cfg_([a-z0-9_]+)' => '(int) $config[\'\\1\']', + 'request_([a-zA-Z0-9_]+)' => '$request->variable(\'\\1\', false)', + 'ext_([a-zA-Z0-9_/]+)' => 'array_key_exists(\'\\1\', $phpbb_extension_manager->all_enabled())', + 'authmethod_([a-z0-9_\\\\]+)' => '($config[\'auth_method\'] === \'\\1\')', + ); + + /** + * Alter tokens for module authorisation check + * + * @event core.module_auth + * @var array valid_tokens Valid tokens and their auth check + * replacements + * @var string module_auth The module_auth of the current + * module + * @var int forum_id The current forum_id + * @since 3.1.0-a3 + */ + $vars = array('valid_tokens', 'module_auth', 'forum_id'); + extract($phpbb_dispatcher->trigger_event('core.module_auth', compact($vars))); + + $tokens = $match[0]; + for ($i = 0, $size = sizeof($tokens); $i < $size; $i++) + { + $token = &$tokens[$i]; + + switch ($token) + { + case ')': + case '(': + case '&&': + case '||': + case ',': + break; + + default: + if (!preg_match('#(?:' . implode(array_keys($valid_tokens), ')|(?:') . ')#', $token)) + { + $token = ''; + } + break; + } + } + + $module_auth = implode(' ', $tokens); + + // Make sure $id separation is working fine + $module_auth = str_replace(' , ', ',', $module_auth); + + $module_auth = preg_replace( + // Array keys with # prepended/appended + array_map(function($value) { + return '#' . $value . '#'; + }, array_keys($valid_tokens)), + array_values($valid_tokens), + $module_auth + ); + + $is_auth = false; + // @codingStandardsIgnoreStart + eval('$is_auth = (int) (' . $module_auth . ');'); + // @codingStandardsIgnoreEnd + + return $is_auth; + } + + /** + * Set active module + */ + function set_active($id = false, $mode = false) + { + $icat = false; + $this->active_module = false; + + if (request_var('icat', '')) + { + $icat = $id; + $id = request_var('icat', ''); + } + + // Restore the backslashes in class names + if (strpos($id, '-') !== false) + { + $id = str_replace('-', '\\', $id); + } + + if ($id && !is_numeric($id) && !$this->is_full_class($id)) + { + $id = $this->p_class . '_' . $id; + } + + $category = false; + foreach ($this->module_ary as $row_id => $item_ary) + { + // If this is a module and it's selected, active + // If this is a category and the module is the first within it, active + // If this is a module and no mode selected, select first mode + // If no category or module selected, go active for first module in first category + if ( + (($item_ary['name'] === $id || $item_ary['name'] === $this->p_class . '_' . $id || $item_ary['id'] === (int) $id) && (($item_ary['mode'] == $mode && !$item_ary['cat']) || ($icat && $item_ary['cat']))) || + ($item_ary['parent'] === $category && !$item_ary['cat'] && !$icat && $item_ary['display']) || + (($item_ary['name'] === $id || $item_ary['name'] === $this->p_class . '_' . $id || $item_ary['id'] === (int) $id) && !$mode && !$item_ary['cat']) || + (!$id && !$mode && !$item_ary['cat'] && $item_ary['display']) + ) + { + if ($item_ary['cat']) + { + $id = $icat; + $icat = false; + + continue; + } + + $this->p_id = $item_ary['id']; + $this->p_parent = $item_ary['parent']; + $this->p_name = $item_ary['name']; + $this->p_mode = $item_ary['mode']; + $this->p_left = $item_ary['left']; + $this->p_right = $item_ary['right']; + + $this->module_cache['parents'] = $this->module_cache['parents'][$this->p_id]; + $this->active_module = $item_ary['id']; + $this->active_module_row_id = $row_id; + + break; + } + else if (($item_ary['cat'] && $item_ary['id'] === (int) $id) || ($item_ary['parent'] === $category && $item_ary['cat'])) + { + $category = $item_ary['id']; + } + } + } + + /** + * Loads currently active module + * + * This method loads a given module, passing it the relevant id and mode. + * + * @param string|false $mode mode, as passed through to the module + * @param string|false $module_url If supplied, we use this module url + * @param bool $execute_module If true, at the end we execute the main method for the new instance + */ + function load_active($mode = false, $module_url = false, $execute_module = true) + { + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user, $template; + + $module_path = $this->include_path . $this->p_class; + $icat = request_var('icat', ''); + + if ($this->active_module === false) + { + trigger_error('MODULE_NOT_ACCESS', E_USER_ERROR); + } + + // new modules use the full class names, old ones are always called _, e.g. acp_board + if (!class_exists($this->p_name)) + { + if (!file_exists("$module_path/{$this->p_name}.$phpEx")) + { + trigger_error($user->lang('MODULE_NOT_FIND', "$module_path/{$this->p_name}.$phpEx"), E_USER_ERROR); + } + + include("$module_path/{$this->p_name}.$phpEx"); + + if (!class_exists($this->p_name)) + { + trigger_error($user->lang('MODULE_FILE_INCORRECT_CLASS', "$module_path/{$this->p_name}.$phpEx", $this->p_name), E_USER_ERROR); + } + } + + if (!empty($mode)) + { + $this->p_mode = $mode; + } + + // Create a new instance of the desired module ... + $class_name = $this->p_name; + + $this->module = new $class_name($this); + + // We pre-define the action parameter we are using all over the place + if (defined('IN_ADMIN')) + { + /* + * If this is an extension module, we'll try to automatically set + * the style paths for the extension (the ext author can change them + * if necessary). + */ + $module_dir = explode('\\', get_class($this->module)); + + // 0 vendor, 1 extension name, ... + if (isset($module_dir[1])) + { + $module_style_dir = $phpbb_root_path . 'ext/' . $module_dir[0] . '/' . $module_dir[1] . '/adm/style'; + + if (is_dir($module_style_dir)) + { + $template->set_custom_style(array( + array( + 'name' => 'adm', + 'ext_path' => 'adm/style/', + ), + ), array($module_style_dir, $phpbb_admin_path . 'style')); + } + } + + // Is first module automatically enabled a duplicate and the category not passed yet? + if (!$icat && $this->module_ary[$this->active_module_row_id]['is_duplicate']) + { + $icat = $this->module_ary[$this->active_module_row_id]['parent']; + } + + // Not being able to overwrite ;) + $this->module->u_action = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=' . $this->get_module_identifier($this->p_name)) . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}"; + } + else + { + /* + * If this is an extension module, we'll try to automatically set + * the style paths for the extension (the ext author can change them + * if necessary). + */ + $module_dir = explode('\\', get_class($this->module)); + + // 0 vendor, 1 extension name, ... + if (isset($module_dir[1])) + { + $module_style_dir = 'ext/' . $module_dir[0] . '/' . $module_dir[1] . '/styles'; + + if (is_dir($phpbb_root_path . $module_style_dir)) + { + $template->set_style(array($module_style_dir, 'styles')); + } + } + + // If user specified the module url we will use it... + if ($module_url !== false) + { + $this->module->u_action = $module_url; + } + else + { + $this->module->u_action = $phpbb_root_path . (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name']; + } + + $this->module->u_action = append_sid($this->module->u_action, 'i=' . $this->get_module_identifier($this->p_name)) . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}"; + } + + // Add url_extra parameter to u_action url + if (!empty($this->module_ary) && $this->active_module !== false && $this->module_ary[$this->active_module_row_id]['url_extra']) + { + $this->module->u_action .= $this->module_ary[$this->active_module_row_id]['url_extra']; + } + + // Assign the module path for re-usage + $this->module->module_path = $module_path . '/'; + + // Execute the main method for the new instance, we send the module id and mode as parameters + // Users are able to call the main method after this function to be able to assign additional parameters manually + if ($execute_module) + { + $short_name = preg_replace("#^{$this->p_class}_#", '', $this->p_name); + $this->module->main($short_name, $this->p_mode); + } + } + + /** + * Appending url parameter to the currently active module. + * + * This function is called for adding specific url parameters while executing the current module. + * It is doing the same as the _module_{name}_url() function, apart from being able to be called after + * having dynamically parsed specific parameters. This allows more freedom in choosing additional parameters. + * One example can be seen in /includes/mcp/mcp_notes.php - $this->p_master->adjust_url() call. + * + * @param string $url_extra Extra url parameters, e.g.: &u=$user_id + * + */ + function adjust_url($url_extra) + { + if (empty($this->module_ary[$this->active_module_row_id])) + { + return; + } + + $row = &$this->module_ary[$this->active_module_row_id]; + + // We check for the same url_extra in $row['url_extra'] to overcome doubled additions... + if (strpos($row['url_extra'], $url_extra) === false) + { + $row['url_extra'] .= $url_extra; + } + } + + /** + * Check if a module is active + */ + function is_active($id, $mode = false) + { + // If we find a name by this id and being enabled we have our active one... + foreach ($this->module_ary as $row_id => $item_ary) + { + if (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && $item_ary['display'] || $item_ary['name'] === $this->p_class . '_' . $id) + { + if ($mode === false || $mode === $item_ary['mode']) + { + return true; + } + } + } + + return false; + } + + /** + * Get parents + */ + function get_parents($parent_id, $left_id, $right_id, &$all_parents) + { + global $db; + + $parents = array(); + + if ($parent_id > 0) + { + foreach ($all_parents as $module_id => $row) + { + if ($row['left_id'] < $left_id && $row['right_id'] > $right_id) + { + $parents[$module_id] = $row['parent_id']; + } + + if ($row['left_id'] > $left_id) + { + break; + } + } + } + + return $parents; + } + + /** + * Get tree branch + */ + function get_branch($left_id, $right_id, $remaining) + { + $branch = array(); + + foreach ($remaining as $key => $row) + { + if ($row['left_id'] > $left_id && $row['left_id'] < $right_id) + { + $branch[] = $row; + continue; + } + break; + } + + return $branch; + } + + /** + * Build true binary tree from given array + * Not in use + */ + function build_tree(&$modules, &$parents) + { + $tree = array(); + + foreach ($modules as $row) + { + $branch = &$tree; + + if ($row['parent_id']) + { + // Go through the tree to find our branch + $parent_tree = $parents[$row['module_id']]; + + foreach ($parent_tree as $id => $value) + { + if (!isset($branch[$id]) && isset($branch['child'])) + { + $branch = &$branch['child']; + } + $branch = &$branch[$id]; + } + $branch = &$branch['child']; + } + + $branch[$row['module_id']] = $row; + if (!isset($branch[$row['module_id']]['child'])) + { + $branch[$row['module_id']]['child'] = array(); + } + } + + return $tree; + } + + /** + * Build navigation structure + */ + function assign_tpl_vars($module_url) + { + global $template; + + $current_id = $right_id = false; + + // Make sure the module_url has a question mark set, effectively determining the delimiter to use + $delim = (strpos($module_url, '?') === false) ? '?' : '&'; + + $current_padding = $current_depth = 0; + $linear_offset = 'l_block1'; + $tabular_offset = 't_block2'; + + // Generate the list of modules, we'll do this in two ways ... + // 1) In a linear fashion + // 2) In a combined tabbed + linear fashion ... tabs for the categories + // and a linear list for subcategories/items + foreach ($this->module_ary as $row_id => $item_ary) + { + // Skip hidden modules + if (!$item_ary['display']) + { + continue; + } + + // Skip branch + if ($right_id !== false) + { + if ($item_ary['left'] < $right_id) + { + continue; + } + + $right_id = false; + } + + // Category with no members on their way down (we have to check every level) + if (!$item_ary['name']) + { + $empty_category = true; + + // We go through the branch and look for an activated module + foreach (array_slice($this->module_ary, $row_id + 1) as $temp_row) + { + if ($temp_row['left'] > $item_ary['left'] && $temp_row['left'] < $item_ary['right']) + { + // Module there and displayed? + if ($temp_row['name'] && $temp_row['display']) + { + $empty_category = false; + break; + } + continue; + } + break; + } + + // Skip the branch + if ($empty_category) + { + $right_id = $item_ary['right']; + continue; + } + } + + // Select first id we can get + if (!$current_id && (isset($this->module_cache['parents'][$item_ary['id']]) || $item_ary['id'] == $this->p_id)) + { + $current_id = $item_ary['id']; + } + + $depth = $item_ary['depth']; + + if ($depth > $current_depth) + { + $linear_offset = $linear_offset . '.l_block' . ($depth + 1); + $tabular_offset = ($depth + 1 > 2) ? $tabular_offset . '.t_block' . ($depth + 1) : $tabular_offset; + } + else if ($depth < $current_depth) + { + for ($i = $current_depth - $depth; $i > 0; $i--) + { + $linear_offset = substr($linear_offset, 0, strrpos($linear_offset, '.')); + $tabular_offset = ($i + $depth > 1) ? substr($tabular_offset, 0, strrpos($tabular_offset, '.')) : $tabular_offset; + } + } + + $u_title = $module_url . $delim . 'i='; + // if the item has a name use it, else use its id + if (empty($item_ary['name'])) + { + $u_title .= $item_ary['id']; + } + else + { + // if the category has a name, then use it. + $u_title .= $this->get_module_identifier($item_ary['name']); + } + // If the item is not a category append the mode + if (!$item_ary['cat']) + { + if ($item_ary['is_duplicate']) + { + $u_title .= '&icat=' . $current_id; + } + $u_title .= '&mode=' . $item_ary['mode']; + } + + // Was not allowed in categories before - /*!$item_ary['cat'] && */ + $u_title .= (isset($item_ary['url_extra'])) ? $item_ary['url_extra'] : ''; + + // Only output a categories items if it's currently selected + if (!$depth || ($depth && (in_array($item_ary['parent'], array_values($this->module_cache['parents'])) || $item_ary['parent'] == $this->p_parent))) + { + $use_tabular_offset = (!$depth) ? 't_block1' : $tabular_offset; + + $tpl_ary = array( + 'L_TITLE' => $item_ary['lang'], + 'S_SELECTED' => (isset($this->module_cache['parents'][$item_ary['id']]) || $item_ary['id'] == $this->p_id) ? true : false, + 'U_TITLE' => $u_title + ); + + $template->assign_block_vars($use_tabular_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER))); + } + + $tpl_ary = array( + 'L_TITLE' => $item_ary['lang'], + 'S_SELECTED' => (isset($this->module_cache['parents'][$item_ary['id']]) || $item_ary['id'] == $this->p_id) ? true : false, + 'U_TITLE' => $u_title + ); + + $template->assign_block_vars($linear_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER))); + + $current_depth = $depth; + } + } + + /** + * Returns desired template name + */ + function get_tpl_name() + { + return $this->module->tpl_name . '.html'; + } + + /** + * Returns the desired page title + */ + function get_page_title() + { + global $user; + + if (!isset($this->module->page_title)) + { + return ''; + } + + return (isset($user->lang[$this->module->page_title])) ? $user->lang[$this->module->page_title] : $this->module->page_title; + } + + /** + * Load module as the current active one without the need for registering it + * + * @param string $class module class (acp/mcp/ucp) + * @param string $name module name (class name of the module, or its basename + * phpbb_ext_foo_acp_bar_module, ucp_zebra or zebra) + * @param string $mode mode, as passed through to the module + * + */ + function load($class, $name, $mode = false) + { + // new modules use the full class names, old ones are always called _, e.g. acp_board + // in the latter case this function may be called as load('acp', 'board') + if (!class_exists($name) && substr($name, 0, strlen($class) + 1) !== $class . '_') + { + $name = $class . '_' . $name; + } + + $this->p_class = $class; + $this->p_name = $name; + + // Set active module to true instead of using the id + $this->active_module = true; + + $this->load_active($mode); + } + + /** + * Display module + */ + function display($page_title, $display_online_list = false) + { + global $template, $user; + + // Generate the page + if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) + { + adm_page_header($page_title); + } + else + { + page_header($page_title, $display_online_list); + } + + $template->set_filenames(array( + 'body' => $this->get_tpl_name()) + ); + + if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) + { + adm_page_footer(); + } + else + { + page_footer(); + } + } + + /** + * Toggle whether this module will be displayed or not + */ + function set_display($id, $mode = false, $display = true) + { + foreach ($this->module_ary as $row_id => $item_ary) + { + if (($item_ary['name'] === $id || $item_ary['name'] === $this->p_class . '_' . $id || $item_ary['id'] === (int) $id) && (!$mode || $item_ary['mode'] === $mode)) + { + $this->module_ary[$row_id]['display'] = (int) $display; + } + } + } + + /** + * Add custom MOD info language file + */ + function add_mod_info($module_class) + { + global $config, $user, $phpEx, $phpbb_extension_manager; + + $finder = $phpbb_extension_manager->get_finder(); + + // We grab the language files from the default, English and user's language. + // So we can fall back to the other files like we do when using add_lang() + $default_lang_files = $english_lang_files = $user_lang_files = array(); + + // Search for board default language if it's not the user language + if ($config['default_lang'] != $user->lang_name) + { + $default_lang_files = $finder + ->prefix('info_' . strtolower($module_class) . '_') + ->suffix(".$phpEx") + ->extension_directory('/language/' . basename($config['default_lang'])) + ->core_path('language/' . basename($config['default_lang']) . '/mods/') + ->find(); + } + + // Search for english, if its not the default or user language + if ($config['default_lang'] != 'en' && $user->lang_name != 'en') + { + $english_lang_files = $finder + ->prefix('info_' . strtolower($module_class) . '_') + ->suffix(".$phpEx") + ->extension_directory('/language/en') + ->core_path('language/en/mods/') + ->find(); + } + + // Find files in the user's language + $user_lang_files = $finder + ->prefix('info_' . strtolower($module_class) . '_') + ->suffix(".$phpEx") + ->extension_directory('/language/' . $user->lang_name) + ->core_path('language/' . $user->lang_name . '/mods/') + ->find(); + + $lang_files = array_unique(array_merge($user_lang_files, $english_lang_files, $default_lang_files)); + foreach ($lang_files as $lang_file => $ext_name) + { + $user->add_lang_ext($ext_name, $lang_file); + } + } + + /** + * Retrieve shortened module basename for legacy basenames (with xcp_ prefix) + * + * @param string $basename A module basename + * @return string The basename if it starts with phpbb_ or the basename with + * the current p_class (e.g. acp_) stripped. + */ + protected function get_short_name($basename) + { + if (substr($basename, 0, 6) === 'phpbb\\' || strpos($basename, '\\') !== false) + { + return $basename; + } + + // strip xcp_ prefix from old classes + return substr($basename, strlen($this->p_class) + 1); + } + + /** + * If the basename contains a \ we don't use that for the URL. + * + * Firefox is currently unable to correctly copy a urlencoded \ + * so users will be unable to post links to modules. + * However we can replace them with dashes and re-replace them later + * + * @param string $basename Basename of the module + * @return string Identifier that should be used for + * module link creation + */ + protected function get_module_identifier($basename) + { + if (strpos($basename, '\\') === false) + { + return $basename; + } + + return str_replace('\\', '-', $basename); + } + + /** + * Checks whether the given module basename is a correct class name + * + * @param string $basename A module basename + * @return bool True if the basename starts with phpbb_ or (x)cp_, false otherwise + */ + protected function is_full_class($basename) + { + return (strpos($basename, '\\') !== false || preg_match('/^(ucp|mcp|acp)_/', $basename)); + } +} diff --git a/sources/phpBB/includes/functions_posting.php b/sources/phpBB/includes/functions_posting.php new file mode 100644 index 0000000..22ade15 --- /dev/null +++ b/sources/phpBB/includes/functions_posting.php @@ -0,0 +1,2671 @@ + +* @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; +} + +/** +* Fill smiley templates (or just the variables) with smilies, either in a window or inline +*/ +function generate_smilies($mode, $forum_id) +{ + global $db, $user, $config, $template, $phpbb_dispatcher; + global $phpEx, $phpbb_root_path, $phpbb_container, $phpbb_path_helper; + + $base_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&f=' . $forum_id); + $pagination = $phpbb_container->get('pagination'); + $start = request_var('start', 0); + + if ($mode == 'window') + { + if ($forum_id) + { + $sql = 'SELECT forum_style + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $user->setup('posting', (int) $row['forum_style']); + } + else + { + $user->setup('posting'); + } + + page_header($user->lang['SMILIES']); + + $sql = 'SELECT COUNT(smiley_id) AS item_count + FROM ' . SMILIES_TABLE . ' + GROUP BY smiley_url'; + $result = $db->sql_query($sql, 3600); + + $smiley_count = 0; + while ($row = $db->sql_fetchrow($result)) + { + ++$smiley_count; + } + $db->sql_freeresult($result); + + $template->set_filenames(array( + 'body' => 'posting_smilies.html') + ); + + $start = $pagination->validate_start($start, $config['smilies_per_page'], $smiley_count); + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $smiley_count, $config['smilies_per_page'], $start); + } + + $display_link = false; + if ($mode == 'inline') + { + $sql = 'SELECT smiley_id + FROM ' . SMILIES_TABLE . ' + WHERE display_on_posting = 0'; + $result = $db->sql_query_limit($sql, 1, 0, 3600); + + if ($row = $db->sql_fetchrow($result)) + { + $display_link = true; + } + $db->sql_freeresult($result); + } + + if ($mode == 'window') + { + $sql = 'SELECT smiley_url, MIN(emotion) as emotion, MIN(code) AS code, smiley_width, smiley_height, MIN(smiley_order) AS min_smiley_order + FROM ' . SMILIES_TABLE . ' + GROUP BY smiley_url, smiley_width, smiley_height + ORDER BY min_smiley_order'; + $result = $db->sql_query_limit($sql, $config['smilies_per_page'], $start, 3600); + } + else + { + $sql = 'SELECT * + FROM ' . SMILIES_TABLE . ' + WHERE display_on_posting = 1 + ORDER BY smiley_order'; + $result = $db->sql_query($sql, 3600); + } + + $smilies = array(); + while ($row = $db->sql_fetchrow($result)) + { + if (empty($smilies[$row['smiley_url']])) + { + $smilies[$row['smiley_url']] = $row; + } + } + $db->sql_freeresult($result); + + if (sizeof($smilies)) + { + $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_path_helper->get_web_root_path(); + + foreach ($smilies as $row) + { + $template->assign_block_vars('smiley', array( + 'SMILEY_CODE' => $row['code'], + 'A_SMILEY_CODE' => addslashes($row['code']), + 'SMILEY_IMG' => $root_path . $config['smilies_path'] . '/' . $row['smiley_url'], + 'SMILEY_WIDTH' => $row['smiley_width'], + 'SMILEY_HEIGHT' => $row['smiley_height'], + 'SMILEY_DESC' => $row['emotion']) + ); + } + } + + /** + * This event is called after the smilies are populated + * + * @event core.generate_smilies_after + * @var string mode Mode of the smilies: window|inline + * @var int forum_id The forum ID we are currently in + * @var bool display_link Shall we display the "more smilies" link? + * @since 3.1.0-a1 + */ + $vars = array('mode', 'forum_id', 'display_link'); + extract($phpbb_dispatcher->trigger_event('core.generate_smilies_after', compact($vars))); + + if ($mode == 'inline' && $display_link) + { + $template->assign_vars(array( + 'S_SHOW_SMILEY_LINK' => true, + 'U_MORE_SMILIES' => $base_url, + )); + } + + if ($mode == 'window') + { + page_footer(); + } +} + +/** +* Update last post information +* Should be used instead of sync() if only the last post information are out of sync... faster +* +* @param string $type Can be forum|topic +* @param mixed $ids topic/forum ids +* @param bool $return_update_sql true: SQL query shall be returned, false: execute SQL +*/ +function update_post_information($type, $ids, $return_update_sql = false) +{ + global $db; + + if (empty($ids)) + { + return; + } + if (!is_array($ids)) + { + $ids = array($ids); + } + + $update_sql = $empty_forums = $not_empty_forums = array(); + + if ($type != 'topic') + { + $topic_join = ', ' . TOPICS_TABLE . ' t'; + $topic_condition = 'AND t.topic_id = p.topic_id AND t.topic_visibility = ' . ITEM_APPROVED; + } + else + { + $topic_join = ''; + $topic_condition = ''; + } + + if (sizeof($ids) == 1) + { + $sql = 'SELECT MAX(p.post_id) as last_post_id + FROM ' . POSTS_TABLE . " p $topic_join + WHERE " . $db->sql_in_set('p.' . $type . '_id', $ids) . " + $topic_condition + AND p.post_visibility = " . ITEM_APPROVED; + } + else + { + $sql = 'SELECT p.' . $type . '_id, MAX(p.post_id) as last_post_id + FROM ' . POSTS_TABLE . " p $topic_join + WHERE " . $db->sql_in_set('p.' . $type . '_id', $ids) . " + $topic_condition + AND p.post_visibility = " . ITEM_APPROVED . " + GROUP BY p.{$type}_id"; + } + $result = $db->sql_query($sql); + + $last_post_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + if (sizeof($ids) == 1) + { + $row[$type . '_id'] = $ids[0]; + } + + if ($type == 'forum') + { + $not_empty_forums[] = $row['forum_id']; + + if (empty($row['last_post_id'])) + { + $empty_forums[] = $row['forum_id']; + } + } + + $last_post_ids[] = $row['last_post_id']; + } + $db->sql_freeresult($result); + + if ($type == 'forum') + { + $empty_forums = array_merge($empty_forums, array_diff($ids, $not_empty_forums)); + + foreach ($empty_forums as $void => $forum_id) + { + $update_sql[$forum_id][] = 'forum_last_post_id = 0'; + $update_sql[$forum_id][] = "forum_last_post_subject = ''"; + $update_sql[$forum_id][] = 'forum_last_post_time = 0'; + $update_sql[$forum_id][] = 'forum_last_poster_id = 0'; + $update_sql[$forum_id][] = "forum_last_poster_name = ''"; + $update_sql[$forum_id][] = "forum_last_poster_colour = ''"; + } + } + + if (sizeof($last_post_ids)) + { + $sql = 'SELECT p.' . $type . '_id, p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.user_id, u.username, u.user_colour + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u + WHERE p.poster_id = u.user_id + AND ' . $db->sql_in_set('p.post_id', $last_post_ids); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $update_sql[$row["{$type}_id"]][] = $type . '_last_post_id = ' . (int) $row['post_id']; + $update_sql[$row["{$type}_id"]][] = "{$type}_last_post_subject = '" . $db->sql_escape($row['post_subject']) . "'"; + $update_sql[$row["{$type}_id"]][] = $type . '_last_post_time = ' . (int) $row['post_time']; + $update_sql[$row["{$type}_id"]][] = $type . '_last_poster_id = ' . (int) $row['poster_id']; + $update_sql[$row["{$type}_id"]][] = "{$type}_last_poster_colour = '" . $db->sql_escape($row['user_colour']) . "'"; + $update_sql[$row["{$type}_id"]][] = "{$type}_last_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'"; + } + $db->sql_freeresult($result); + } + unset($empty_forums, $ids, $last_post_ids); + + if ($return_update_sql || !sizeof($update_sql)) + { + return $update_sql; + } + + $table = ($type == 'forum') ? FORUMS_TABLE : TOPICS_TABLE; + + foreach ($update_sql as $update_id => $update_sql_ary) + { + $sql = "UPDATE $table + SET " . implode(', ', $update_sql_ary) . " + WHERE {$type}_id = $update_id"; + $db->sql_query($sql); + } + + return; +} + +/** +* Generate Topic Icons for display +*/ +function posting_gen_topic_icons($mode, $icon_id) +{ + global $phpbb_root_path, $config, $template, $cache; + + // Grab icons + $icons = $cache->obtain_icons(); + + if (!$icon_id) + { + $template->assign_var('S_NO_ICON_CHECKED', ' checked="checked"'); + } + + if (sizeof($icons)) + { + $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path; + + foreach ($icons as $id => $data) + { + if ($data['display']) + { + $template->assign_block_vars('topic_icon', array( + 'ICON_ID' => $id, + 'ICON_IMG' => $root_path . $config['icons_path'] . '/' . $data['img'], + 'ICON_WIDTH' => $data['width'], + 'ICON_HEIGHT' => $data['height'], + + 'S_CHECKED' => ($id == $icon_id) ? true : false, + 'S_ICON_CHECKED' => ($id == $icon_id) ? ' checked="checked"' : '') + ); + } + } + + return true; + } + + return false; +} + +/** +* Build topic types able to be selected +*/ +function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) +{ + global $auth, $user, $template, $topic_type; + + $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') + ); + + $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; + + $topic_type_array[] = array( + 'VALUE' => $topic_value['const'], + 'S_CHECKED' => ($cur_topic_type == $topic_value['const']) ? ' checked="checked"' : '', + 'L_TOPIC_TYPE' => $user->lang[$topic_value['lang']] + ); + } + } + + if ($toggle) + { + $topic_type_array = array_merge(array(0 => array( + 'VALUE' => POST_NORMAL, + 'S_CHECKED' => ($cur_topic_type == POST_NORMAL) ? ' checked="checked"' : '', + 'L_TOPIC_TYPE' => $user->lang['POST_NORMAL'])), + + $topic_type_array + ); + + foreach ($topic_type_array as $array) + { + $template->assign_block_vars('topic_type', $array); + } + + $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))) + ); + } + + return $toggle; +} + +// +// Attachment related functions +// + +/** +* Upload Attachment - filedata is generated here +* Uses upload class +* +* @param string $form_name The form name of the file upload input +* @param int $forum_id The id of the forum +* @param bool $local Whether the file is local or not +* @param string $local_storage The path to the local file +* @param bool $is_message Whether it is a PM or not +* @param \filespec $local_filedata A filespec object created for the local file +* @param \phpbb\mimetype\guesser $mimetype_guesser The mimetype guesser object if used +* @param \phpbb\plupload\plupload $plupload The plupload object if one is being used +* +* @return object filespec +*/ +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; + + $filedata = array( + 'error' => array() + ); + + include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx); + $upload = new fileupload(); + + if ($config['check_attachment_content'] && isset($config['mime_triggers'])) + { + $upload->set_disallowed_content(explode('|', $config['mime_triggers'])); + } + else if (!$config['check_attachment_content']) + { + $upload->set_disallowed_content(array()); + } + + $filedata['post_attach'] = $local || $upload->is_valid($form_name); + + if (!$filedata['post_attach']) + { + $filedata['error'][] = $user->lang['NO_UPLOAD_FORM_FOUND']; + return $filedata; + } + + $extensions = $cache->obtain_attach_extensions((($is_message) ? false : (int) $forum_id)); + $upload->set_allowed_extensions(array_keys($extensions['_allowed_'])); + + $file = ($local) ? $upload->local_upload($local_storage, $local_filedata, $mimetype_guesser) : $upload->form_upload($form_name, $mimetype_guesser, $plupload); + + if ($file->init_error) + { + $filedata['post_attach'] = false; + return $filedata; + } + + // Whether the uploaded file is in the image category + $is_image = (isset($extensions[$file->get('extension')]['display_cat'])) ? $extensions[$file->get('extension')]['display_cat'] == ATTACHMENT_CATEGORY_IMAGE : false; + + if (!$auth->acl_get('a_') && !$auth->acl_get('m_', $forum_id)) + { + // Check Image Size, if it is an image + if ($is_image) + { + $file->upload->set_allowed_dimensions(0, 0, $config['img_max_width'], $config['img_max_height']); + } + + // Admins and mods are allowed to exceed the allowed filesize + if (!empty($extensions[$file->get('extension')]['max_filesize'])) + { + $allowed_filesize = $extensions[$file->get('extension')]['max_filesize']; + } + else + { + $allowed_filesize = ($is_message) ? $config['max_filesize_pm'] : $config['max_filesize']; + } + + $file->upload->set_max_filesize($allowed_filesize); + } + + $file->clean_filename('unique', $user->data['user_id'] . '_'); + + // Are we uploading an image *and* this image being within the image category? + // Only then perform additional image checks. + $file->move_file($config['upload_path'], false, !$is_image); + + // Do we have to create a thumbnail? + $filedata['thumbnail'] = ($is_image && $config['img_create_thumbnail']) ? 1 : 0; + + if (sizeof($file->error)) + { + $file->remove(); + $filedata['error'] = array_merge($filedata['error'], $file->error); + $filedata['post_attach'] = false; + + return $filedata; + } + + // Make sure the image category only holds valid images... + if ($is_image && !$file->is_image()) + { + $file->remove(); + + if ($plupload && $plupload->is_active()) + { + $plupload->emit_error(104, 'ATTACHED_IMAGE_NOT_IMAGE'); + } + + // If this error occurs a user tried to exploit an IE Bug by renaming extensions + // Since the image category is displaying content inline we need to catch this. + trigger_error($user->lang['ATTACHED_IMAGE_NOT_IMAGE']); + } + + $filedata['filesize'] = $file->get('filesize'); + $filedata['mimetype'] = $file->get('mimetype'); + $filedata['extension'] = $file->get('extension'); + $filedata['physical_filename'] = $file->get('realname'); + $filedata['real_filename'] = $file->get('uploadname'); + $filedata['filetime'] = time(); + + /** + * Event to modify uploaded file before submit to the post + * + * @event core.modify_uploaded_file + * @var array filedata Array containing uploaded file data + * @var bool is_image Flag indicating if the file is an image + * @since 3.1.0-RC3 + */ + $vars = array( + 'filedata', + 'is_image', + ); + extract($phpbb_dispatcher->trigger_event('core.modify_uploaded_file', compact($vars))); + + // Check our complete quota + if ($config['attachment_quota']) + { + if ($config['upload_dir_size'] + $file->get('filesize') > $config['attachment_quota']) + { + $filedata['error'][] = $user->lang['ATTACH_QUOTA_REACHED']; + $filedata['post_attach'] = false; + + $file->remove(); + + return $filedata; + } + } + + // Check free disk space + if ($free_space = @disk_free_space($phpbb_root_path . $config['upload_path'])) + { + if ($free_space <= $file->get('filesize')) + { + if ($auth->acl_get('a_')) + { + $filedata['error'][] = $user->lang['ATTACH_DISK_FULL']; + } + else + { + $filedata['error'][] = $user->lang['ATTACH_QUOTA_REACHED']; + } + $filedata['post_attach'] = false; + + $file->remove(); + + return $filedata; + } + } + + // Create Thumbnail + if ($filedata['thumbnail']) + { + $source = $file->get('destination_file'); + $destination = $file->get('destination_path') . '/thumb_' . $file->get('realname'); + + if (!create_thumbnail($source, $destination, $file->get('mimetype'))) + { + $filedata['thumbnail'] = 0; + } + } + + return $filedata; +} + +/** +* Calculate the needed size for Thumbnail +*/ +function get_img_size_format($width, $height) +{ + global $config; + + // Maximum Width the Image can take + $max_width = ($config['img_max_thumb_width']) ? $config['img_max_thumb_width'] : 400; + + if ($width > $height) + { + return array( + round($width * ($max_width / $width)), + round($height * ($max_width / $width)) + ); + } + else + { + return array( + round($width * ($max_width / $height)), + round($height * ($max_width / $height)) + ); + } +} + +/** +* Return supported image types +*/ +function get_supported_image_types($type = false) +{ + if (@extension_loaded('gd')) + { + $format = imagetypes(); + $new_type = 0; + + if ($type !== false) + { + // Type is one of the IMAGETYPE constants - it is fetched from getimagesize() + switch ($type) + { + // GIF + case IMAGETYPE_GIF: + $new_type = ($format & IMG_GIF) ? IMG_GIF : false; + break; + + // JPG, JPC, JP2 + case IMAGETYPE_JPEG: + case IMAGETYPE_JPC: + case IMAGETYPE_JPEG2000: + case IMAGETYPE_JP2: + case IMAGETYPE_JPX: + case IMAGETYPE_JB2: + $new_type = ($format & IMG_JPG) ? IMG_JPG : false; + break; + + // PNG + case IMAGETYPE_PNG: + $new_type = ($format & IMG_PNG) ? IMG_PNG : false; + break; + + // WBMP + case IMAGETYPE_WBMP: + $new_type = ($format & IMG_WBMP) ? IMG_WBMP : false; + break; + } + } + else + { + $new_type = array(); + $go_through_types = array(IMG_GIF, IMG_JPG, IMG_PNG, IMG_WBMP); + + foreach ($go_through_types as $check_type) + { + if ($format & $check_type) + { + $new_type[] = $check_type; + } + } + } + + return array( + 'gd' => ($new_type) ? true : false, + 'format' => $new_type, + 'version' => (function_exists('imagecreatetruecolor')) ? 2 : 1 + ); + } + + return array('gd' => false); +} + +/** +* Create Thumbnail +*/ +function create_thumbnail($source, $destination, $mimetype) +{ + global $config; + + $min_filesize = (int) $config['img_min_thumb_filesize']; + $img_filesize = (file_exists($source)) ? @filesize($source) : false; + + if (!$img_filesize || $img_filesize <= $min_filesize) + { + return false; + } + + $dimension = @getimagesize($source); + + if ($dimension === false) + { + return false; + } + + list($width, $height, $type, ) = $dimension; + + if (empty($width) || empty($height)) + { + return false; + } + + list($new_width, $new_height) = get_img_size_format($width, $height); + + // Do not create a thumbnail if the resulting width/height is bigger than the original one + if ($new_width >= $width && $new_height >= $height) + { + return false; + } + + $used_imagick = false; + + // Only use imagemagick if defined and the passthru function not disabled + if ($config['img_imagick'] && function_exists('passthru')) + { + if (substr($config['img_imagick'], -1) !== '/') + { + $config['img_imagick'] .= '/'; + } + + @passthru(escapeshellcmd($config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -quality 85 -geometry ' . $new_width . 'x' . $new_height . ' "' . str_replace('\\', '/', $source) . '" "' . str_replace('\\', '/', $destination) . '"'); + + if (file_exists($destination)) + { + $used_imagick = true; + } + } + + if (!$used_imagick) + { + $type = get_supported_image_types($type); + + if ($type['gd']) + { + // If the type is not supported, we are not able to create a thumbnail + if ($type['format'] === false) + { + return false; + } + + switch ($type['format']) + { + case IMG_GIF: + $image = @imagecreatefromgif($source); + break; + + case IMG_JPG: + @ini_set('gd.jpeg_ignore_warning', 1); + $image = @imagecreatefromjpeg($source); + break; + + case IMG_PNG: + $image = @imagecreatefrompng($source); + break; + + case IMG_WBMP: + $image = @imagecreatefromwbmp($source); + break; + } + + if (empty($image)) + { + return false; + } + + if ($type['version'] == 1) + { + $new_image = imagecreate($new_width, $new_height); + + if ($new_image === false) + { + return false; + } + + imagecopyresized($new_image, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); + } + else + { + $new_image = imagecreatetruecolor($new_width, $new_height); + + if ($new_image === false) + { + return false; + } + + // Preserve alpha transparency (png for example) + @imagealphablending($new_image, false); + @imagesavealpha($new_image, true); + + imagecopyresampled($new_image, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); + } + + // If we are in safe mode create the destination file prior to using the gd functions to circumvent a PHP bug + if (@ini_get('safe_mode') || @strtolower(ini_get('safe_mode')) == 'on') + { + @touch($destination); + } + + switch ($type['format']) + { + case IMG_GIF: + imagegif($new_image, $destination); + break; + + case IMG_JPG: + imagejpeg($new_image, $destination, 90); + break; + + case IMG_PNG: + imagepng($new_image, $destination); + break; + + case IMG_WBMP: + imagewbmp($new_image, $destination); + break; + } + + imagedestroy($new_image); + } + else + { + return false; + } + } + + if (!file_exists($destination)) + { + return false; + } + + phpbb_chmod($destination, CHMOD_READ | CHMOD_WRITE); + + return true; +} + +/** +* Assign Inline attachments (build option fields) +*/ +function posting_gen_inline_attachments(&$attachment_data) +{ + global $template; + + if (sizeof($attachment_data)) + { + $s_inline_attachment_options = ''; + + foreach ($attachment_data as $i => $attachment) + { + $s_inline_attachment_options .= ''; + } + + $template->assign_var('S_INLINE_ATTACHMENT_OPTIONS', $s_inline_attachment_options); + + return true; + } + + return false; +} + +/** +* Generate inline attachment entry +*/ +function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_attach_box = true) +{ + global $template, $config, $phpbb_root_path, $phpEx, $user; + + // Some default template variables + $template->assign_vars(array( + 'S_SHOW_ATTACH_BOX' => $show_attach_box, + 'S_HAS_ATTACHMENTS' => sizeof($attachment_data), + 'FILESIZE' => $config['max_filesize'], + 'FILE_COMMENT' => (isset($filename_data['filecomment'])) ? $filename_data['filecomment'] : '', + )); + + if (sizeof($attachment_data)) + { + // We display the posted attachments within the desired order. + ($config['display_order']) ? krsort($attachment_data) : ksort($attachment_data); + + foreach ($attachment_data as $count => $attach_row) + { + $hidden = ''; + $attach_row['real_filename'] = utf8_basename($attach_row['real_filename']); + + foreach ($attach_row as $key => $value) + { + $hidden .= ''; + } + + $download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&id=' . (int) $attach_row['attach_id'], true, ($attach_row['is_orphan']) ? $user->session_id : false); + + $template->assign_block_vars('attach_row', array( + 'FILENAME' => utf8_basename($attach_row['real_filename']), + 'A_FILENAME' => addslashes(utf8_basename($attach_row['real_filename'])), + 'FILE_COMMENT' => $attach_row['attach_comment'], + 'ATTACH_ID' => $attach_row['attach_id'], + 'S_IS_ORPHAN' => $attach_row['is_orphan'], + 'ASSOC_INDEX' => $count, + 'FILESIZE' => get_formatted_filesize($attach_row['filesize']), + + 'U_VIEW_ATTACHMENT' => $download_link, + 'S_HIDDEN' => $hidden) + ); + } + } + + return sizeof($attachment_data); +} + +// +// General Post functions +// + +/** +* Load Drafts +*/ +function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $msg_id = 0) +{ + global $user, $db, $template, $auth; + global $phpbb_root_path, $phpbb_dispatcher, $phpEx; + + $topic_ids = $forum_ids = $draft_rows = array(); + + // Load those drafts not connected to forums/topics + // If forum_id == 0 AND topic_id == 0 then this is a PM draft + if (!$topic_id && !$forum_id) + { + $sql_and = ' AND d.forum_id = 0 AND d.topic_id = 0'; + } + else + { + $sql_and = ''; + $sql_and .= ($forum_id) ? ' AND d.forum_id = ' . (int) $forum_id : ''; + $sql_and .= ($topic_id) ? ' AND d.topic_id = ' . (int) $topic_id : ''; + } + + $sql = 'SELECT d.*, f.forum_id, f.forum_name + FROM ' . DRAFTS_TABLE . ' d + LEFT JOIN ' . FORUMS_TABLE . ' f ON (f.forum_id = d.forum_id) + WHERE d.user_id = ' . $user->data['user_id'] . " + $sql_and + ORDER BY d.save_time DESC"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['topic_id']) + { + $topic_ids[] = (int) $row['topic_id']; + } + $draft_rows[] = $row; + } + $db->sql_freeresult($result); + + if (!sizeof($draft_rows)) + { + return; + } + + $topic_rows = array(); + if (sizeof($topic_ids)) + { + $sql = 'SELECT topic_id, forum_id, topic_title, topic_poster + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', array_unique($topic_ids)); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $topic_rows[$row['topic_id']] = $row; + } + $db->sql_freeresult($result); + } + + /** + * Drafts found and their topics + * Edit $draft_rows in order to add or remove drafts loaded + * + * @event core.load_drafts_draft_list_result + * @var array draft_rows The drafts query result. Includes its forum id and everything about the draft + * @var array topic_ids The list of topics got from the topics table + * @var array topic_rows The topics that draft_rows references + * @since 3.1.0-RC3 + */ + $vars = array('draft_rows', 'topic_ids', 'topic_rows'); + extract($phpbb_dispatcher->trigger_event('core.load_drafts_draft_list_result', compact($vars))); + + unset($topic_ids); + + $template->assign_var('S_SHOW_DRAFTS', true); + + foreach ($draft_rows as $draft) + { + $link_topic = $link_forum = $link_pm = false; + $insert_url = $view_url = $title = ''; + + if (isset($topic_rows[$draft['topic_id']]) + && ( + ($topic_rows[$draft['topic_id']]['forum_id'] && $auth->acl_get('f_read', $topic_rows[$draft['topic_id']]['forum_id'])) + || + (!$topic_rows[$draft['topic_id']]['forum_id'] && $auth->acl_getf_global('f_read')) + )) + { + $topic_forum_id = ($topic_rows[$draft['topic_id']]['forum_id']) ? $topic_rows[$draft['topic_id']]['forum_id'] : $forum_id; + + $link_topic = true; + $view_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_forum_id . '&t=' . $draft['topic_id']); + $title = $topic_rows[$draft['topic_id']]['topic_title']; + + $insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $topic_forum_id . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']); + } + else if ($draft['forum_id'] && $auth->acl_get('f_read', $draft['forum_id'])) + { + $link_forum = true; + $view_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $draft['forum_id']); + $title = $draft['forum_name']; + + $insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id']); + } + else + { + // Either display as PM draft if forum_id and topic_id are empty or if access to the forums has been denied afterwards... + $link_pm = true; + $insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=compose&d={$draft['draft_id']}" . (($pm_action) ? "&action=$pm_action" : '') . (($msg_id) ? "&p=$msg_id" : '')); + } + + $template->assign_block_vars('draftrow', array( + 'DRAFT_ID' => $draft['draft_id'], + 'DATE' => $user->format_date($draft['save_time']), + 'DRAFT_SUBJECT' => $draft['draft_subject'], + + 'TITLE' => $title, + 'U_VIEW' => $view_url, + 'U_INSERT' => $insert_url, + + 'S_LINK_PM' => $link_pm, + 'S_LINK_TOPIC' => $link_topic, + 'S_LINK_FORUM' => $link_forum) + ); + } +} + +/** +* Topic Review +*/ +function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true) +{ + global $user, $auth, $db, $template, $bbcode, $cache; + global $config, $phpbb_root_path, $phpEx, $phpbb_container; + + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + $sql_sort = ($mode == 'post_review') ? 'ASC' : 'DESC'; + + // Go ahead and pull all data for this topic + $sql = 'SELECT p.post_id + FROM ' . POSTS_TABLE . ' p' . " + WHERE p.topic_id = $topic_id + AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id, 'p.') . ' + ' . (($mode == 'post_review') ? " AND p.post_id > $cur_post_id" : '') . ' + ' . (($mode == 'post_review_edit') ? " AND p.post_id = $cur_post_id" : '') . ' + ORDER BY p.post_time ' . $sql_sort . ', p.post_id ' . $sql_sort; + $result = $db->sql_query_limit($sql, $config['posts_per_page']); + + $post_list = array(); + + while ($row = $db->sql_fetchrow($result)) + { + $post_list[] = $row['post_id']; + } + + $db->sql_freeresult($result); + + if (!sizeof($post_list)) + { + return false; + } + + // Handle 'post_review_edit' like 'post_review' from now on + if ($mode == 'post_review_edit') + { + $mode = 'post_review'; + } + + $sql_ary = array( + 'SELECT' => 'u.username, u.user_id, u.user_colour, p.*, z.friend, z.foe', + + 'FROM' => array( + USERS_TABLE => 'u', + POSTS_TABLE => 'p', + ), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(ZEBRA_TABLE => 'z'), + 'ON' => 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id', + ), + ), + + 'WHERE' => $db->sql_in_set('p.post_id', $post_list) . ' + AND u.user_id = p.poster_id', + ); + + $sql = $db->sql_build_query('SELECT', $sql_ary); + $result = $db->sql_query($sql); + + $bbcode_bitfield = ''; + $rowset = array(); + $has_attachments = false; + while ($row = $db->sql_fetchrow($result)) + { + $rowset[$row['post_id']] = $row; + $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']); + + if ($row['post_attachment']) + { + $has_attachments = true; + } + } + $db->sql_freeresult($result); + + // Instantiate BBCode class + if (!isset($bbcode) && $bbcode_bitfield !== '') + { + include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); + $bbcode = new bbcode(base64_encode($bbcode_bitfield)); + } + + // Grab extensions + $extensions = $attachments = array(); + if ($has_attachments && $auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id)) + { + $extensions = $cache->obtain_attach_extensions($forum_id); + + // Get attachments... + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_msg_id', $post_list) . ' + AND in_message = 0 + ORDER BY filetime DESC, post_msg_id ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $attachments[$row['post_msg_id']][] = $row; + } + $db->sql_freeresult($result); + } + + for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) + { + // A non-existing rowset only happens if there was no user present for the entered poster_id + // This could be a broken posts table. + if (!isset($rowset[$post_list[$i]])) + { + continue; + } + + $row = $rowset[$post_list[$i]]; + + $poster_id = $row['user_id']; + $post_subject = $row['post_subject']; + + $decoded_message = false; + + if ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) + { + $decoded_message = censor_text($row['post_text']); + decode_message($decoded_message, $row['bbcode_uid']); + + $decoded_message = bbcode_nl2br($decoded_message); + } + + $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0); + $parse_flags |= ($row['enable_smilies'] ? OPTION_FLAG_SMILIES : 0); + $message = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, true); + + if (!empty($attachments[$row['post_id']])) + { + $update_count = array(); + parse_attachments($forum_id, $message, $attachments[$row['post_id']], $update_count); + } + + $post_subject = censor_text($post_subject); + + $post_anchor = ($mode == 'post_review') ? 'ppr' . $row['post_id'] : 'pr' . $row['post_id']; + $u_show_post = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, "f=$forum_id&t=$topic_id&p={$row['post_id']}&view=show#p{$row['post_id']}"); + + $template->assign_block_vars($mode . '_row', array( + 'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), + 'POST_AUTHOR_COLOUR' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), + 'POST_AUTHOR' => get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), + 'U_POST_AUTHOR' => get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), + + 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false, + 'S_FRIEND' => ($row['friend']) ? true : false, + 'S_IGNORE_POST' => ($row['foe']) ? true : false, + 'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), "", '') : '', + + 'POST_SUBJECT' => $post_subject, + 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']), + 'POST_DATE' => $user->format_date($row['post_time']), + 'MESSAGE' => $message, + 'DECODED_MESSAGE' => $decoded_message, + 'POST_ID' => $row['post_id'], + 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'], + 'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=post_details&f=' . $forum_id . '&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'])) : '') + ); + + // Display not already displayed Attachments for this post, we already parsed them. ;) + if (!empty($attachments[$row['post_id']])) + { + foreach ($attachments[$row['post_id']] as $attachment) + { + $template->assign_block_vars($mode . '_row.attachment', array( + 'DISPLAY_ATTACHMENT' => $attachment) + ); + } + } + + unset($rowset[$post_list[$i]]); + } + + if ($mode == 'topic_review') + { + $template->assign_var('QUOTE_IMG', $user->img('icon_post_quote', $user->lang['REPLY_WITH_QUOTE'])); + } + + return true; +} + +// +// Post handling functions +// + +/** +* Delete Post +*/ +function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $softdelete_reason = '') +{ + global $db, $user, $auth, $phpbb_container; + global $config, $phpEx, $phpbb_root_path; + + // Specify our post mode + $post_mode = 'delete'; + if (($data['topic_first_post_id'] === $data['topic_last_post_id']) && ($data['topic_posts_approved'] + $data['topic_posts_unapproved'] + $data['topic_posts_softdeleted'] == 1)) + { + $post_mode = 'delete_topic'; + } + else if ($data['topic_first_post_id'] == $post_id) + { + $post_mode = 'delete_first_post'; + } + else if ($data['topic_last_post_id'] == $post_id) + { + $post_mode = 'delete_last_post'; + } + $sql_data = array(); + $next_post_id = false; + + include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + + $db->sql_transaction('begin'); + + // we must make sure to update forums that contain the shadow'd topic + if ($post_mode == 'delete_topic') + { + $shadow_forum_ids = array(); + + $sql = 'SELECT forum_id + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_moved_id', $topic_id); + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($shadow_forum_ids[(int) $row['forum_id']])) + { + $shadow_forum_ids[(int) $row['forum_id']] = 1; + } + else + { + $shadow_forum_ids[(int) $row['forum_id']]++; + } + } + $db->sql_freeresult($result); + } + + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + + // (Soft) delete the post + if ($is_soft && ($post_mode != 'delete_topic')) + { + $phpbb_content_visibility->set_post_visibility(ITEM_DELETED, $post_id, $topic_id, $forum_id, $user->data['user_id'], time(), $softdelete_reason, ($data['topic_first_post_id'] == $post_id), ($data['topic_last_post_id'] == $post_id)); + } + else if (!$is_soft) + { + if (!delete_posts('post_id', array($post_id), false, false, false)) + { + // Try to delete topic, we may had an previous error causing inconsistency + if ($post_mode == 'delete_topic') + { + delete_topics('topic_id', array($topic_id), false); + } + trigger_error('ALREADY_DELETED'); + } + } + + $db->sql_transaction('commit'); + + // Collect the necessary information for updating the tables + $sql_data[FORUMS_TABLE] = $sql_data[TOPICS_TABLE] = ''; + switch ($post_mode) + { + case 'delete_topic': + + foreach ($shadow_forum_ids as $updated_forum => $topic_count) + { + // counting is fun! we only have to do sizeof($forum_ids) number of queries, + // even if the topic is moved back to where its shadow lives (we count how many times it is in a forum) + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET forum_topics_approved = forum_topics_approved - ' . $topic_count . ' + WHERE forum_id = ' . $updated_forum; + $db->sql_query($sql); + update_post_information('forum', $updated_forum); + } + + if ($is_soft) + { + $topic_row = array(); + $phpbb_content_visibility->set_topic_visibility(ITEM_DELETED, $topic_id, $forum_id, $user->data['user_id'], time(), $softdelete_reason); + } + else + { + delete_topics('topic_id', array($topic_id), false); + + $phpbb_content_visibility->remove_topic_from_statistic($data, $sql_data); + + $update_sql = update_post_information('forum', $forum_id, true); + if (sizeof($update_sql)) + { + $sql_data[FORUMS_TABLE] .= ($sql_data[FORUMS_TABLE]) ? ', ' : ''; + $sql_data[FORUMS_TABLE] .= implode(', ', $update_sql[$forum_id]); + } + } + + break; + + case 'delete_first_post': + $sql = 'SELECT p.post_id, p.poster_id, p.post_time, p.post_username, u.username, u.user_colour + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u + WHERE p.topic_id = $topic_id + AND p.poster_id = u.user_id + AND p.post_visibility = " . ITEM_APPROVED . ' + ORDER BY p.post_time ASC, p.post_id ASC'; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + // No approved post, so the first is a not-approved post (unapproved or soft deleted) + $sql = 'SELECT p.post_id, p.poster_id, p.post_time, p.post_username, u.username, u.user_colour + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u + WHERE p.topic_id = $topic_id + AND p.poster_id = u.user_id + ORDER BY p.post_time ASC, p.post_id ASC"; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + $next_post_id = (int) $row['post_id']; + + $sql_data[TOPICS_TABLE] = $db->sql_build_array('UPDATE', array( + 'topic_poster' => (int) $row['poster_id'], + 'topic_first_post_id' => (int) $row['post_id'], + 'topic_first_poster_colour' => $row['user_colour'], + 'topic_first_poster_name' => ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username'], + 'topic_time' => (int) $row['post_time'], + )); + break; + + case 'delete_last_post': + if (!$is_soft) + { + // Update last post information when hard deleting. Soft delete already did that by itself. + $update_sql = update_post_information('forum', $forum_id, true); + if (sizeof($update_sql)) + { + $sql_data[FORUMS_TABLE] = (($sql_data[FORUMS_TABLE]) ? $sql_data[FORUMS_TABLE] . ', ' : '') . implode(', ', $update_sql[$forum_id]); + } + + $sql_data[TOPICS_TABLE] = (($sql_data[TOPICS_TABLE]) ? $sql_data[TOPICS_TABLE] . ', ' : '') . 'topic_bumped = 0, topic_bumper = 0'; + + $update_sql = update_post_information('topic', $topic_id, true); + if (!empty($update_sql)) + { + $sql_data[TOPICS_TABLE] .= ', ' . implode(', ', $update_sql[$topic_id]); + $next_post_id = (int) str_replace('topic_last_post_id = ', '', $update_sql[$topic_id][0]); + } + } + + if (!$next_post_id) + { + $sql = 'SELECT MAX(post_id) as last_post_id + FROM ' . POSTS_TABLE . " + WHERE topic_id = $topic_id + AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id); + $result = $db->sql_query($sql); + $next_post_id = (int) $db->sql_fetchfield('last_post_id'); + $db->sql_freeresult($result); + } + break; + + case 'delete': + $sql = 'SELECT post_id + FROM ' . POSTS_TABLE . " + WHERE topic_id = $topic_id + AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id) . ' + AND post_time > ' . $data['post_time'] . ' + ORDER BY post_time ASC, post_id ASC'; + $result = $db->sql_query_limit($sql, 1); + $next_post_id = (int) $db->sql_fetchfield('post_id'); + $db->sql_freeresult($result); + break; + } + + if (($post_mode == 'delete') || ($post_mode == 'delete_last_post') || ($post_mode == 'delete_first_post')) + { + if (!$is_soft) + { + $phpbb_content_visibility->remove_post_from_statistic($data, $sql_data); + } + + $sql = 'SELECT 1 AS has_attachments + FROM ' . ATTACHMENTS_TABLE . ' + WHERE topic_id = ' . $topic_id; + $result = $db->sql_query_limit($sql, 1); + $has_attachments = (int) $db->sql_fetchfield('has_attachments'); + $db->sql_freeresult($result); + + if (!$has_attachments) + { + $sql_data[TOPICS_TABLE] = (($sql_data[TOPICS_TABLE]) ? $sql_data[TOPICS_TABLE] . ', ' : '') . 'topic_attachment = 0'; + } + } + + $db->sql_transaction('begin'); + + $where_sql = array( + FORUMS_TABLE => "forum_id = $forum_id", + TOPICS_TABLE => "topic_id = $topic_id", + USERS_TABLE => 'user_id = ' . $data['poster_id'], + ); + + foreach ($sql_data as $table => $update_sql) + { + if ($update_sql) + { + $db->sql_query("UPDATE $table SET $update_sql WHERE " . $where_sql[$table]); + } + } + + // Adjust posted info for this user by looking for a post by him/her within this topic... + if ($post_mode != 'delete_topic' && $config['load_db_track'] && $data['poster_id'] != ANONYMOUS) + { + $sql = 'SELECT poster_id + FROM ' . POSTS_TABLE . ' + WHERE topic_id = ' . $topic_id . ' + AND poster_id = ' . $data['poster_id']; + $result = $db->sql_query_limit($sql, 1); + $poster_id = (int) $db->sql_fetchfield('poster_id'); + $db->sql_freeresult($result); + + // The user is not having any more posts within this topic + if (!$poster_id) + { + $sql = 'DELETE FROM ' . TOPICS_POSTED_TABLE . ' + WHERE topic_id = ' . $topic_id . ' + AND user_id = ' . $data['poster_id']; + $db->sql_query($sql); + } + } + + $db->sql_transaction('commit'); + + if ($data['post_reported'] && ($post_mode != 'delete_topic')) + { + sync('topic_reported', 'topic_id', array($topic_id)); + } + + return $next_post_id; +} + +/** +* Submit Post +* @todo Split up and create lightweight, simple API for this. +*/ +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; + + /** + * Modify the data for post submitting + * + * @event core.modify_submit_post_data + * @var string mode Variable containing posting mode value + * @var string subject Variable containing post subject value + * @var string username Variable containing post author name + * @var int topic_type Variable containing topic type value + * @var array poll Array with the poll data for the post + * @var array data Array with the data for the post + * @var bool update_message Flag indicating if the post will be updated + * @var bool update_search_index Flag indicating if the search index will be updated + * @since 3.1.0-a4 + */ + $vars = array( + 'mode', + 'subject', + 'username', + 'topic_type', + 'poll', + 'data', + 'update_message', + 'update_search_index', + ); + extract($phpbb_dispatcher->trigger_event('core.modify_submit_post_data', compact($vars))); + + // We do not handle erasing posts here + if ($mode == 'delete') + { + return false; + } + + $current_time = time(); + + if ($mode == 'post') + { + $post_mode = 'post'; + $update_message = true; + } + else if ($mode != 'edit') + { + $post_mode = 'reply'; + $update_message = true; + } + else if ($mode == 'edit') + { + $post_mode = ($data['topic_posts_approved'] + $data['topic_posts_unapproved'] + $data['topic_posts_softdeleted'] == 1) ? 'edit_topic' : (($data['topic_first_post_id'] == $data['post_id']) ? 'edit_first_post' : (($data['topic_last_post_id'] == $data['post_id']) ? 'edit_last_post' : 'edit')); + } + + // First of all make sure the subject and topic title are having the correct length. + // To achieve this without cutting off between special chars we convert to an array and then count the elements. + $subject = truncate_string($subject, 120); + $data['topic_title'] = truncate_string($data['topic_title'], 120); + + // Collect some basic information about which tables and which rows to update/insert + $sql_data = $topic_row = array(); + $poster_id = ($mode == 'edit') ? $data['poster_id'] : (int) $user->data['user_id']; + + // Retrieve some additional information if not present + if ($mode == 'edit' && (!isset($data['post_visibility']) || !isset($data['topic_visibility']) || $data['post_visibility'] === false || $data['topic_visibility'] === false)) + { + $sql = 'SELECT p.post_visibility, t.topic_type, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_visibility + FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p + WHERE t.topic_id = p.topic_id + AND p.post_id = ' . $data['post_id']; + $result = $db->sql_query($sql); + $topic_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $data['topic_visibility'] = $topic_row['topic_visibility']; + $data['post_visibility'] = $topic_row['post_visibility']; + } + + // This variable indicates if the user is able to post or put into the queue + $post_visibility = ITEM_APPROVED; + + // Check the permissions for post approval. + // Moderators must go through post approval like ordinary users. + if (!$auth->acl_get('f_noapprove', $data['forum_id'])) + { + // Post not approved, but in queue + $post_visibility = ITEM_UNAPPROVED; + switch ($post_mode) + { + case 'edit_first_post': + case 'edit': + case 'edit_last_post': + case 'edit_topic': + $post_visibility = ITEM_REAPPROVE; + break; + } + } + + // MODs/Extensions are able to force any visibility on posts + if (isset($data['force_approved_state'])) + { + $post_visibility = (in_array((int) $data['force_approved_state'], array(ITEM_APPROVED, ITEM_UNAPPROVED, ITEM_DELETED, ITEM_REAPPROVE))) ? (int) $data['force_approved_state'] : $post_visibility; + } + if (isset($data['force_visibility'])) + { + $post_visibility = (in_array((int) $data['force_visibility'], array(ITEM_APPROVED, ITEM_UNAPPROVED, ITEM_DELETED, ITEM_REAPPROVE))) ? (int) $data['force_visibility'] : $post_visibility; + } + + // Start the transaction here + $db->sql_transaction('begin'); + + // Collect Information + switch ($post_mode) + { + case 'post': + case 'reply': + $sql_data[POSTS_TABLE]['sql'] = array( + 'forum_id' => $data['forum_id'], + 'poster_id' => (int) $user->data['user_id'], + 'icon_id' => $data['icon_id'], + 'poster_ip' => $user->ip, + 'post_time' => $current_time, + 'post_visibility' => $post_visibility, + 'enable_bbcode' => $data['enable_bbcode'], + 'enable_smilies' => $data['enable_smilies'], + 'enable_magic_url' => $data['enable_urls'], + 'enable_sig' => $data['enable_sig'], + 'post_username' => (!$user->data['is_registered']) ? $username : '', + 'post_subject' => $subject, + 'post_text' => $data['message'], + 'post_checksum' => $data['message_md5'], + 'post_attachment' => (!empty($data['attachment_data'])) ? 1 : 0, + 'bbcode_bitfield' => $data['bbcode_bitfield'], + 'bbcode_uid' => $data['bbcode_uid'], + 'post_postcount' => ($auth->acl_get('f_postcount', $data['forum_id'])) ? 1 : 0, + 'post_edit_locked' => $data['post_edit_locked'] + ); + break; + + case 'edit_first_post': + case 'edit': + + case 'edit_last_post': + case 'edit_topic': + + // If edit reason is given always display edit info + + // If editing last post then display no edit info + // If m_edit permission then display no edit info + // If normal edit display edit info + + // Display edit info if edit reason given or user is editing his post, which is not the last within the topic. + if ($data['post_edit_reason'] || (!$auth->acl_get('m_edit', $data['forum_id']) && ($post_mode == 'edit' || $post_mode == 'edit_first_post'))) + { + $data['post_edit_reason'] = truncate_string($data['post_edit_reason'], 255, 255, false); + + $sql_data[POSTS_TABLE]['sql'] = array( + 'post_edit_time' => $current_time, + 'post_edit_reason' => $data['post_edit_reason'], + 'post_edit_user' => (int) $data['post_edit_user'], + ); + + $sql_data[POSTS_TABLE]['stat'][] = 'post_edit_count = post_edit_count + 1'; + } + else if (!$data['post_edit_reason'] && $mode == 'edit' && $auth->acl_get('m_edit', $data['forum_id'])) + { + $sql_data[POSTS_TABLE]['sql'] = array( + 'post_edit_reason' => '', + ); + } + + // If the person editing this post is different to the one having posted then we will add a log entry stating the edit + // Could be simplified by only adding to the log if the edit is not tracked - but this may confuse admins/mods + 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']); + } + + if (!isset($sql_data[POSTS_TABLE]['sql'])) + { + $sql_data[POSTS_TABLE]['sql'] = array(); + } + + $sql_data[POSTS_TABLE]['sql'] = array_merge($sql_data[POSTS_TABLE]['sql'], array( + 'forum_id' => $data['forum_id'], + 'poster_id' => $data['poster_id'], + 'icon_id' => $data['icon_id'], + // We will change the visibility later + //'post_visibility' => $post_visibility, + 'enable_bbcode' => $data['enable_bbcode'], + 'enable_smilies' => $data['enable_smilies'], + 'enable_magic_url' => $data['enable_urls'], + 'enable_sig' => $data['enable_sig'], + 'post_username' => ($username && $data['poster_id'] == ANONYMOUS) ? $username : '', + 'post_subject' => $subject, + 'post_checksum' => $data['message_md5'], + 'post_attachment' => (!empty($data['attachment_data'])) ? 1 : 0, + 'bbcode_bitfield' => $data['bbcode_bitfield'], + 'bbcode_uid' => $data['bbcode_uid'], + 'post_edit_locked' => $data['post_edit_locked']) + ); + + if ($update_message) + { + $sql_data[POSTS_TABLE]['sql']['post_text'] = $data['message']; + } + + break; + } + $topic_row = array(); + + // And the topic ladies and gentlemen + switch ($post_mode) + { + case 'post': + $sql_data[TOPICS_TABLE]['sql'] = array( + 'topic_poster' => (int) $user->data['user_id'], + 'topic_time' => $current_time, + 'topic_last_view_time' => $current_time, + 'forum_id' => $data['forum_id'], + 'icon_id' => $data['icon_id'], + 'topic_posts_approved' => ($post_visibility == ITEM_APPROVED) ? 1 : 0, + 'topic_posts_softdeleted' => ($post_visibility == ITEM_DELETED) ? 1 : 0, + 'topic_posts_unapproved' => ($post_visibility == ITEM_UNAPPROVED) ? 1 : 0, + 'topic_visibility' => $post_visibility, + 'topic_delete_user' => ($post_visibility != ITEM_APPROVED) ? (int) $user->data['user_id'] : 0, + 'topic_title' => $subject, + 'topic_first_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''), + 'topic_first_poster_colour' => $user->data['user_colour'], + 'topic_type' => $topic_type, + 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, + 'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : 0, + ); + + if (isset($poll['poll_options']) && !empty($poll['poll_options'])) + { + $poll_start = ($poll['poll_start']) ? $poll['poll_start'] : $current_time; + $poll_length = $poll['poll_length'] * 86400; + if ($poll_length < 0) + { + $poll_start = $poll_start + $poll_length; + if ($poll_start < 0) + { + $poll_start = 0; + } + $poll_length = 1; + } + + $sql_data[TOPICS_TABLE]['sql'] = array_merge($sql_data[TOPICS_TABLE]['sql'], array( + 'poll_title' => $poll['poll_title'], + 'poll_start' => $poll_start, + 'poll_max_options' => $poll['poll_max_options'], + 'poll_length' => $poll_length, + 'poll_vote_change' => $poll['poll_vote_change']) + ); + } + + $sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id']) && $post_visibility == ITEM_APPROVED) ? ', user_posts = user_posts + 1' : ''); + + if ($post_visibility == ITEM_APPROVED) + { + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_approved = forum_topics_approved + 1'; + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts_approved = forum_posts_approved + 1'; + } + else if ($post_visibility == ITEM_UNAPPROVED) + { + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_unapproved = forum_topics_unapproved + 1'; + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts_unapproved = forum_posts_unapproved + 1'; + } + else if ($post_visibility == ITEM_DELETED) + { + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_softdeleted = forum_topics_softdeleted + 1'; + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts_softdeleted = forum_posts_softdeleted + 1'; + } + break; + + case 'reply': + $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_view_time = ' . $current_time . ', + topic_bumped = 0, + topic_bumper = 0' . + (($post_visibility == ITEM_APPROVED) ? ', topic_posts_approved = topic_posts_approved + 1' : '') . + (($post_visibility == ITEM_UNAPPROVED) ? ', topic_posts_unapproved = topic_posts_unapproved + 1' : '') . + (($post_visibility == ITEM_DELETED) ? ', topic_posts_softdeleted = topic_posts_softdeleted + 1' : '') . + ((!empty($data['attachment_data']) || (isset($data['topic_attachment']) && $data['topic_attachment'])) ? ', topic_attachment = 1' : ''); + + $sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id']) && $post_visibility == ITEM_APPROVED) ? ', user_posts = user_posts + 1' : ''); + + if ($post_visibility == ITEM_APPROVED) + { + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts_approved = forum_posts_approved + 1'; + } + else if ($post_visibility == ITEM_UNAPPROVED) + { + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts_unapproved = forum_posts_unapproved + 1'; + } + else if ($post_visibility == ITEM_DELETED) + { + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts_softdeleted = forum_posts_softdeleted + 1'; + } + break; + + case 'edit_topic': + case 'edit_first_post': + if (isset($poll['poll_options'])) + { + $poll_start = ($poll['poll_start'] || empty($poll['poll_options'])) ? $poll['poll_start'] : $current_time; + $poll_length = $poll['poll_length'] * 86400; + if ($poll_length < 0) + { + $poll_start = $poll_start + $poll_length; + if ($poll_start < 0) + { + $poll_start = 0; + } + $poll_length = 1; + } + } + + $sql_data[TOPICS_TABLE]['sql'] = array( + 'forum_id' => $data['forum_id'], + 'icon_id' => $data['icon_id'], + 'topic_title' => $subject, + 'topic_first_poster_name' => $username, + 'topic_type' => $topic_type, + 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, + 'poll_title' => (isset($poll['poll_options'])) ? $poll['poll_title'] : '', + 'poll_start' => (isset($poll['poll_options'])) ? $poll_start : 0, + 'poll_max_options' => (isset($poll['poll_options'])) ? $poll['poll_max_options'] : 1, + 'poll_length' => (isset($poll['poll_options'])) ? $poll_length : 0, + 'poll_vote_change' => (isset($poll['poll_vote_change'])) ? $poll['poll_vote_change'] : 0, + 'topic_last_view_time' => $current_time, + + 'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : (isset($data['topic_attachment']) ? $data['topic_attachment'] : 0), + ); + + break; + } + + /** + * Modify sql query data for post submitting + * + * @event core.submit_post_modify_sql_data + * @var array data Array with the data for the post + * @var array poll Array with the poll data for the post + * @var string post_mode Variable containing posting mode value + * @var bool sql_data Array with the data for the posting SQL query + * @var string subject Variable containing post subject value + * @var int topic_type Variable containing topic type value + * @var string username Variable containing post author name + * @since 3.1.3-RC1 + */ + $vars = array( + 'data', + 'poll', + 'post_mode', + 'sql_data', + 'subject', + 'topic_type', + 'username', + ); + extract($phpbb_dispatcher->trigger_event('core.submit_post_modify_sql_data', compact($vars))); + + // Submit new topic + if ($post_mode == 'post') + { + $sql = 'INSERT INTO ' . TOPICS_TABLE . ' ' . + $db->sql_build_array('INSERT', $sql_data[TOPICS_TABLE]['sql']); + $db->sql_query($sql); + + $data['topic_id'] = $db->sql_nextid(); + + $sql_data[POSTS_TABLE]['sql'] = array_merge($sql_data[POSTS_TABLE]['sql'], array( + 'topic_id' => $data['topic_id']) + ); + unset($sql_data[TOPICS_TABLE]['sql']); + } + + // Submit new post + if ($post_mode == 'post' || $post_mode == 'reply') + { + if ($post_mode == 'reply') + { + $sql_data[POSTS_TABLE]['sql'] = array_merge($sql_data[POSTS_TABLE]['sql'], array( + 'topic_id' => $data['topic_id'], + )); + } + + $sql = 'INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_data[POSTS_TABLE]['sql']); + $db->sql_query($sql); + $data['post_id'] = $db->sql_nextid(); + + if ($post_mode == 'post' || $post_visibility == ITEM_APPROVED) + { + $sql_data[TOPICS_TABLE]['sql'] = array( + 'topic_last_post_id' => $data['post_id'], + 'topic_last_post_time' => $current_time, + 'topic_last_poster_id' => $sql_data[POSTS_TABLE]['sql']['poster_id'], + 'topic_last_poster_name' => ($user->data['user_id'] == ANONYMOUS) ? $sql_data[POSTS_TABLE]['sql']['post_username'] : $user->data['username'], + 'topic_last_poster_colour' => $user->data['user_colour'], + 'topic_last_post_subject' => (string) $subject, + ); + } + + if ($post_mode == 'post') + { + $sql_data[TOPICS_TABLE]['sql']['topic_first_post_id'] = $data['post_id']; + } + + // Update total post count and forum information + if ($post_visibility == ITEM_APPROVED) + { + if ($post_mode == 'post') + { + set_config_count('num_topics', 1, true); + } + set_config_count('num_posts', 1, true); + + $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) . "'"; + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_time = ' . $current_time; + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_poster_id = ' . (int) $user->data['user_id']; + $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape((!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : '')) . "'"; + $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_colour = '" . $db->sql_escape($user->data['user_colour']) . "'"; + } + + unset($sql_data[POSTS_TABLE]['sql']); + } + + // Update the topics table + if (isset($sql_data[TOPICS_TABLE]['sql'])) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_data[TOPICS_TABLE]['sql']) . ' + WHERE topic_id = ' . $data['topic_id']; + $db->sql_query($sql); + + unset($sql_data[TOPICS_TABLE]['sql']); + } + + // Update the posts table + if (isset($sql_data[POSTS_TABLE]['sql'])) + { + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_data[POSTS_TABLE]['sql']) . ' + WHERE post_id = ' . $data['post_id']; + $db->sql_query($sql); + + unset($sql_data[POSTS_TABLE]['sql']); + } + + // Update Poll Tables + if (isset($poll['poll_options'])) + { + $cur_poll_options = array(); + + if ($mode == 'edit') + { + $sql = 'SELECT * + FROM ' . POLL_OPTIONS_TABLE . ' + WHERE topic_id = ' . $data['topic_id'] . ' + ORDER BY poll_option_id'; + $result = $db->sql_query($sql); + + $cur_poll_options = array(); + while ($row = $db->sql_fetchrow($result)) + { + $cur_poll_options[] = $row; + } + $db->sql_freeresult($result); + } + + $sql_insert_ary = array(); + + for ($i = 0, $size = sizeof($poll['poll_options']); $i < $size; $i++) + { + if (strlen(trim($poll['poll_options'][$i]))) + { + if (empty($cur_poll_options[$i])) + { + // If we add options we need to put them to the end to be able to preserve votes... + $sql_insert_ary[] = array( + 'poll_option_id' => (int) sizeof($cur_poll_options) + 1 + sizeof($sql_insert_ary), + 'topic_id' => (int) $data['topic_id'], + 'poll_option_text' => (string) $poll['poll_options'][$i] + ); + } + else if ($poll['poll_options'][$i] != $cur_poll_options[$i]) + { + $sql = 'UPDATE ' . POLL_OPTIONS_TABLE . " + SET poll_option_text = '" . $db->sql_escape($poll['poll_options'][$i]) . "' + WHERE poll_option_id = " . $cur_poll_options[$i]['poll_option_id'] . ' + AND topic_id = ' . $data['topic_id']; + $db->sql_query($sql); + } + } + } + + $db->sql_multi_insert(POLL_OPTIONS_TABLE, $sql_insert_ary); + + if (sizeof($poll['poll_options']) < sizeof($cur_poll_options)) + { + $sql = 'DELETE FROM ' . POLL_OPTIONS_TABLE . ' + WHERE poll_option_id > ' . sizeof($poll['poll_options']) . ' + AND topic_id = ' . $data['topic_id']; + $db->sql_query($sql); + } + + // If edited, we would need to reset votes (since options can be re-ordered above, you can't be sure if the change is for changing the text or adding an option + if ($mode == 'edit' && sizeof($poll['poll_options']) != sizeof($cur_poll_options)) + { + $db->sql_query('DELETE FROM ' . POLL_VOTES_TABLE . ' WHERE topic_id = ' . $data['topic_id']); + $db->sql_query('UPDATE ' . POLL_OPTIONS_TABLE . ' SET poll_option_total = 0 WHERE topic_id = ' . $data['topic_id']); + } + } + + // Submit Attachments + if (!empty($data['attachment_data']) && $data['post_id'] && in_array($mode, array('post', 'reply', 'quote', 'edit'))) + { + $space_taken = $files_added = 0; + $orphan_rows = array(); + + foreach ($data['attachment_data'] as $pos => $attach_row) + { + $orphan_rows[(int) $attach_row['attach_id']] = array(); + } + + if (sizeof($orphan_rows)) + { + $sql = 'SELECT attach_id, filesize, physical_filename + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', array_keys($orphan_rows)) . ' + AND is_orphan = 1 + AND poster_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + + $orphan_rows = array(); + while ($row = $db->sql_fetchrow($result)) + { + $orphan_rows[$row['attach_id']] = $row; + } + $db->sql_freeresult($result); + } + + foreach ($data['attachment_data'] as $pos => $attach_row) + { + if ($attach_row['is_orphan'] && !isset($orphan_rows[$attach_row['attach_id']])) + { + continue; + } + + if (!$attach_row['is_orphan']) + { + // update entry in db if attachment already stored in db and filespace + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . " + SET attach_comment = '" . $db->sql_escape($attach_row['attach_comment']) . "' + WHERE attach_id = " . (int) $attach_row['attach_id'] . ' + AND is_orphan = 0'; + $db->sql_query($sql); + } + else + { + // insert attachment into db + if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . utf8_basename($orphan_rows[$attach_row['attach_id']]['physical_filename']))) + { + continue; + } + + $space_taken += $orphan_rows[$attach_row['attach_id']]['filesize']; + $files_added++; + + $attach_sql = array( + 'post_msg_id' => $data['post_id'], + 'topic_id' => $data['topic_id'], + 'is_orphan' => 0, + 'poster_id' => $poster_id, + 'attach_comment' => $attach_row['attach_comment'], + ); + + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $attach_sql) . ' + WHERE attach_id = ' . $attach_row['attach_id'] . ' + AND is_orphan = 1 + AND poster_id = ' . $user->data['user_id']; + $db->sql_query($sql); + } + } + + if ($space_taken && $files_added) + { + set_config_count('upload_dir_size', $space_taken, true); + set_config_count('num_files', $files_added, true); + } + } + + $first_post_has_topic_info = ($post_mode == 'edit_first_post' && + (($post_visibility == ITEM_DELETED && $data['topic_posts_softdeleted'] == 1) || + ($post_visibility == ITEM_UNAPPROVED && $data['topic_posts_unapproved'] == 1) || + ($post_visibility == ITEM_REAPPROVE && $data['topic_posts_unapproved'] == 1) || + ($post_visibility == ITEM_APPROVED && $data['topic_posts_approved'] == 1))); + // Fix the post's and topic's visibility and first/last post information, when the post is edited + if (($post_mode != 'post' && $post_mode != 'reply') && $data['post_visibility'] != $post_visibility) + { + // If the post was not approved, it could also be the starter, + // so we sync the starter after approving/restoring, to ensure that the stats are correct + // Same applies for the last post + $is_starter = ($post_mode == 'edit_first_post' || $post_mode == 'edit_topic' || $data['post_visibility'] != ITEM_APPROVED); + $is_latest = ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || $data['post_visibility'] != ITEM_APPROVED); + + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + $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); + } + else if ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || $first_post_has_topic_info) + { + if ($post_visibility == ITEM_APPROVED || $data['topic_visibility'] == $post_visibility) + { + // only the subject can be changed from edit + $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_post_subject = '" . $db->sql_escape($subject) . "'"; + + // Maybe not only the subject, but also changing anonymous usernames. ;) + if ($data['poster_id'] == ANONYMOUS) + { + $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_poster_name = '" . $db->sql_escape($username) . "'"; + } + + if ($post_visibility == ITEM_APPROVED) + { + // this does not _necessarily_ mean that we must update the info again, + // it just means that we might have to + $sql = 'SELECT forum_last_post_id, forum_last_post_subject + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . (int) $data['forum_id']; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + // this post is the latest post in the forum, better update + if ($row['forum_last_post_id'] == $data['post_id'] && ($row['forum_last_post_subject'] !== $subject || $data['poster_id'] == ANONYMOUS)) + { + // the post's subject changed + if ($row['forum_last_post_subject'] !== $subject) + { + $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_post_subject = '" . $db->sql_escape($subject) . "'"; + } + + // Update the user name if poster is anonymous... just in case a moderator changed it + if ($data['poster_id'] == ANONYMOUS) + { + $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape($username) . "'"; + } + } + } + } + } + + // Update forum stats + $where_sql = array( + POSTS_TABLE => 'post_id = ' . $data['post_id'], + TOPICS_TABLE => 'topic_id = ' . $data['topic_id'], + FORUMS_TABLE => 'forum_id = ' . $data['forum_id'], + USERS_TABLE => 'user_id = ' . $poster_id + ); + + foreach ($sql_data as $table => $update_ary) + { + if (isset($update_ary['stat']) && implode('', $update_ary['stat'])) + { + $sql = "UPDATE $table SET " . implode(', ', $update_ary['stat']) . ' WHERE ' . $where_sql[$table]; + $db->sql_query($sql); + } + } + + // Delete topic shadows (if any exist). We do not need a shadow topic for an global announcement + if ($topic_type == POST_GLOBAL) + { + $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + WHERE topic_moved_id = ' . $data['topic_id']; + $db->sql_query($sql); + } + + // Committing the transaction before updating search index + $db->sql_transaction('commit'); + + // Delete draft if post was loaded... + $draft_id = request_var('draft_loaded', 0); + if ($draft_id) + { + $sql = 'DELETE FROM ' . DRAFTS_TABLE . " + WHERE draft_id = $draft_id + AND user_id = {$user->data['user_id']}"; + $db->sql_query($sql); + } + + // Index message contents + if ($update_search_index && $data['enable_indexing']) + { + // Select the search method and do some additional checks to ensure it can actually be utilised + $search_type = $config['search_type']; + + if (!class_exists($search_type)) + { + trigger_error('NO_SUCH_SEARCH_MODULE'); + } + + $error = false; + $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); + + if ($error) + { + trigger_error($error); + } + + $search->index($mode, $data['post_id'], $data['message'], $subject, $poster_id, $data['forum_id']); + } + + // Topic Notification, do not change if moderator is changing other users posts... + if ($user->data['user_id'] == $poster_id) + { + if (!$data['notify_set'] && $data['notify']) + { + $sql = 'INSERT INTO ' . TOPICS_WATCH_TABLE . ' (user_id, topic_id) + VALUES (' . $user->data['user_id'] . ', ' . $data['topic_id'] . ')'; + $db->sql_query($sql); + } + else if (($config['email_enable'] || $config['jab_enable']) && $data['notify_set'] && !$data['notify']) + { + $sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . ' + AND topic_id = ' . $data['topic_id']; + $db->sql_query($sql); + } + } + + if ($mode == 'post' || $mode == 'reply' || $mode == 'quote') + { + // Mark this topic as posted to + markread('post', $data['forum_id'], $data['topic_id']); + } + + // Mark this topic as read + // We do not use post_time here, this is intended (post_time can have a date in the past if editing a message) + markread('topic', $data['forum_id'], $data['topic_id'], time()); + + // + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + $sql = 'SELECT mark_time + FROM ' . FORUMS_TRACK_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . ' + AND forum_id = ' . $data['forum_id']; + $result = $db->sql_query($sql); + $f_mark_time = (int) $db->sql_fetchfield('mark_time'); + $db->sql_freeresult($result); + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + $f_mark_time = false; + } + + if (($config['load_db_lastread'] && $user->data['is_registered']) || $config['load_anon_lastread'] || $user->data['is_registered']) + { + // Update forum info + $sql = 'SELECT forum_last_post_time + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $data['forum_id']; + $result = $db->sql_query($sql); + $forum_last_post_time = (int) $db->sql_fetchfield('forum_last_post_time'); + $db->sql_freeresult($result); + + update_forum_tracking_info($data['forum_id'], $forum_last_post_time, $f_mark_time, false); + } + + // If a username was supplied or the poster is a guest, we will use the supplied username. + // Doing it this way we can use "...post by guest-username..." in notifications when + // "guest-username" is supplied or ommit the username if it is not. + $username = ($username !== '' || !$user->data['is_registered']) ? $username : $user->data['username']; + + // Send Notifications + $notification_data = array_merge($data, array( + 'topic_title' => (isset($data['topic_title'])) ? $data['topic_title'] : $subject, + 'post_username' => $username, + 'poster_id' => $poster_id, + 'post_text' => $data['message'], + 'post_time' => $current_time, + 'post_subject' => $subject, + )); + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + if ($post_visibility == ITEM_APPROVED) + { + switch ($mode) + { + case 'post': + $phpbb_notifications->add_notifications(array( + 'notification.type.quote', + 'notification.type.topic', + ), $notification_data); + break; + + case 'reply': + case 'quote': + $phpbb_notifications->add_notifications(array( + 'notification.type.quote', + 'notification.type.bookmark', + 'notification.type.post', + ), $notification_data); + break; + + case 'edit_topic': + case 'edit_first_post': + case 'edit': + case 'edit_last_post': + $phpbb_notifications->update_notifications(array( + 'notification.type.quote', + 'notification.type.bookmark', + 'notification.type.topic', + 'notification.type.post', + ), $notification_data); + break; + } + } + else if ($post_visibility == ITEM_UNAPPROVED) + { + switch ($mode) + { + case 'post': + $phpbb_notifications->add_notifications('notification.type.topic_in_queue', $notification_data); + break; + + case 'reply': + case 'quote': + $phpbb_notifications->add_notifications('notification.type.post_in_queue', $notification_data); + break; + + case 'edit_topic': + case 'edit_first_post': + case 'edit': + case 'edit_last_post': + // Nothing to do here + break; + } + } + else if ($post_visibility == ITEM_REAPPROVE) + { + switch ($mode) + { + case 'edit_topic': + case 'edit_first_post': + $phpbb_notifications->add_notifications('notification.type.topic_in_queue', $notification_data); + + // Delete the approve_post notification so we can notify the user again, + // when his post got reapproved + $phpbb_notifications->delete_notifications('notification.type.approve_post', $notification_data['post_id']); + break; + + case 'edit': + case 'edit_last_post': + $phpbb_notifications->add_notifications('notification.type.post_in_queue', $notification_data); + + // Delete the approve_post notification so we can notify the user again, + // when his post got reapproved + $phpbb_notifications->delete_notifications('notification.type.approve_post', $notification_data['post_id']); + break; + + case 'post': + case 'reply': + case 'quote': + // Nothing to do here + break; + } + } + else if ($post_visibility == ITEM_DELETED) + { + switch ($mode) + { + case 'post': + case 'reply': + case 'quote': + case 'edit_topic': + case 'edit_first_post': + case 'edit': + case 'edit_last_post': + // Nothing to do here + break; + } + } + + $params = $add_anchor = ''; + + if ($post_visibility == ITEM_APPROVED) + { + $params .= '&t=' . $data['topic_id']; + + if ($mode != 'post') + { + $params .= '&p=' . $data['post_id']; + $add_anchor = '#p' . $data['post_id']; + } + } + else if ($mode != 'post' && $post_mode != 'edit_first_post' && $post_mode != 'edit_topic') + { + $params .= '&t=' . $data['topic_id']; + } + + $url = (!$params) ? "{$phpbb_root_path}viewforum.$phpEx" : "{$phpbb_root_path}viewtopic.$phpEx"; + $url = append_sid($url, 'f=' . $data['forum_id'] . $params) . $add_anchor; + + /** + * This event is used for performing actions directly after a post or topic + * has been submitted. When a new topic is posted, the topic ID is + * available in the $data array. + * + * The only action that can be done by altering data made available to this + * event is to modify the return URL ($url). + * + * @event core.submit_post_end + * @var string mode Variable containing posting mode value + * @var string subject Variable containing post subject value + * @var string username Variable containing post author name + * @var int topic_type Variable containing topic type value + * @var array poll Array with the poll data for the post + * @var array data Array with the data for the post + * @var int post_visibility Variable containing up to date post visibility + * @var bool update_message Flag indicating if the post will be updated + * @var bool update_search_index Flag indicating if the search index will be updated + * @var string url The "Return to topic" URL + * + * @since 3.1.0-a3 + * @change 3.1.0-RC3 Added vars mode, subject, username, topic_type, + * poll, update_message, update_search_index + */ + $vars = array( + 'mode', + 'subject', + 'username', + 'topic_type', + 'poll', + 'data', + 'post_visibility', + 'update_message', + 'update_search_index', + 'url', + ); + extract($phpbb_dispatcher->trigger_event('core.submit_post_end', compact($vars))); + + return $url; +} + +/** +* Handle topic bumping +* @param int $forum_id The ID of the forum the topic is being bumped belongs to +* @param int $topic_id The ID of the topic is being bumping +* @param array $post_data Passes some topic parameters: +* - 'topic_title' +* - 'topic_last_post_id' +* - 'topic_last_poster_id' +* - 'topic_last_post_subject' +* - 'topic_last_poster_name' +* - 'topic_last_poster_colour' +* @param int $bump_time The time at which topic was bumped, usually it is a current time as obtained via time(). +* @return string An URL to the bumped topic, example: ./viewtopic.php?forum_id=1&topic_id=2&p=3#p3 +*/ +function phpbb_bump_topic($forum_id, $topic_id, $post_data, $bump_time = false) +{ + global $config, $db, $user, $phpEx, $phpbb_root_path; + + if ($bump_time === false) + { + $bump_time = time(); + } + + // Begin bumping + $db->sql_transaction('begin'); + + // Update the topic's last post post_time + $sql = 'UPDATE ' . POSTS_TABLE . " + SET post_time = $bump_time + WHERE post_id = {$post_data['topic_last_post_id']} + AND topic_id = $topic_id"; + $db->sql_query($sql); + + // Sync the topic's last post time, the rest of the topic's last post data isn't changed + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_last_post_time = $bump_time, + topic_bumped = 1, + topic_bumper = " . $user->data['user_id'] . " + WHERE topic_id = $topic_id"; + $db->sql_query($sql); + + // Update the forum's last post info + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET forum_last_post_id = " . $post_data['topic_last_post_id'] . ", + forum_last_poster_id = " . $post_data['topic_last_poster_id'] . ", + forum_last_post_subject = '" . $db->sql_escape($post_data['topic_last_post_subject']) . "', + forum_last_post_time = $bump_time, + forum_last_poster_name = '" . $db->sql_escape($post_data['topic_last_poster_name']) . "', + forum_last_poster_colour = '" . $db->sql_escape($post_data['topic_last_poster_colour']) . "' + WHERE forum_id = $forum_id"; + $db->sql_query($sql); + + // Update bumper's time of the last posting to prevent flood + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_lastpost_time = $bump_time + WHERE user_id = " . $user->data['user_id']; + $db->sql_query($sql); + + $db->sql_transaction('commit'); + + // Mark this topic as posted to + markread('post', $forum_id, $topic_id, $bump_time); + + // Mark this topic as read + markread('topic', $forum_id, $topic_id, $bump_time); + + // Update forum tracking info + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + $sql = 'SELECT mark_time + FROM ' . FORUMS_TRACK_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . ' + AND forum_id = ' . $forum_id; + $result = $db->sql_query($sql); + $f_mark_time = (int) $db->sql_fetchfield('mark_time'); + $db->sql_freeresult($result); + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + $f_mark_time = false; + } + + if (($config['load_db_lastread'] && $user->data['is_registered']) || $config['load_anon_lastread'] || $user->data['is_registered']) + { + // Update forum info + $sql = 'SELECT forum_last_post_time + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $forum_id; + $result = $db->sql_query($sql); + $forum_last_post_time = (int) $db->sql_fetchfield('forum_last_post_time'); + $db->sql_freeresult($result); + + 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']); + + $url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}"; + + return $url; +} + +/** +* Show upload popup (progress bar) +*/ +function phpbb_upload_popup($forum_style = 0) +{ + global $template, $user; + + ($forum_style) ? $user->setup('posting', $forum_style) : $user->setup('posting'); + + page_header($user->lang['PROGRESS_BAR']); + + $template->set_filenames(array( + 'popup' => 'posting_progress_bar.html') + ); + + $template->assign_vars(array( + 'PROGRESS_BAR' => $user->img('upload_bar', $user->lang['UPLOAD_IN_PROGRESS'])) + ); + + $template->display('popup'); + + garbage_collection(); + exit_handler(); +} + +/** +* Do the various checks required for removing posts as well as removing it +*/ +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; + + $perm_check = ($is_soft) ? 'softdelete' : 'delete'; + + // If moderator removing post or user itself removing post, present a confirmation screen + if ($auth->acl_get("m_$perm_check", $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get("f_$perm_check", $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time']))) + { + $s_hidden_fields = array( + 'p' => $post_id, + 'f' => $forum_id, + 'mode' => ($is_soft) ? 'soft_delete' : 'delete', + ); + + if (confirm_box(true)) + { + $data = array( + 'topic_first_post_id' => $post_data['topic_first_post_id'], + 'topic_last_post_id' => $post_data['topic_last_post_id'], + 'topic_posts_approved' => $post_data['topic_posts_approved'], + 'topic_posts_unapproved' => $post_data['topic_posts_unapproved'], + 'topic_posts_softdeleted' => $post_data['topic_posts_softdeleted'], + 'topic_visibility' => $post_data['topic_visibility'], + 'topic_type' => $post_data['topic_type'], + 'post_visibility' => $post_data['post_visibility'], + 'post_reported' => $post_data['post_reported'], + 'post_time' => $post_data['post_time'], + 'poster_id' => $post_data['poster_id'], + 'post_postcount' => $post_data['post_postcount'], + ); + + $next_post_id = delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $delete_reason); + $post_username = ($post_data['poster_id'] == ANONYMOUS && !empty($post_data['post_username'])) ? $post_data['post_username'] : $post_data['username']; + + 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); + + $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); + + $meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p=$next_post_id") . "#p$next_post_id"; + $message = $user->lang['POST_DELETED']; + + if (!$request->is_ajax()) + { + $message .= '

' . $user->lang('RETURN_TOPIC', '', ''); + } + } + + meta_refresh(3, $meta_info); + if (!$request->is_ajax()) + { + $message .= '

' . $user->lang('RETURN_FORUM', '', ''); + } + trigger_error($message); + } + else + { + global $user, $template, $request; + + $can_delete = $auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id)); + $can_softdelete = $auth->acl_get('m_softdelete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_softdelete', $forum_id)); + + $template->assign_vars(array( + 'S_SOFTDELETED' => $post_data['post_visibility'] == ITEM_DELETED, + 'S_CHECKED_PERMANENT' => $request->is_set_post('delete_permanent') ? ' checked="checked"' : '', + 'S_ALLOWED_DELETE' => $can_delete, + 'S_ALLOWED_SOFTDELETE' => $can_softdelete, + )); + + $l_confirm = 'DELETE_POST'; + if ($post_data['post_visibility'] == ITEM_DELETED) + { + $l_confirm .= '_PERMANENTLY'; + $s_hidden_fields['delete_permanent'] = '1'; + } + else if (!$can_softdelete) + { + $s_hidden_fields['delete_permanent'] = '1'; + } + + confirm_box(false, $l_confirm, build_hidden_fields($s_hidden_fields), 'confirm_delete_body.html'); + } + } + + // If we are here the user is not able to delete - present the correct error message + if ($post_data['poster_id'] != $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) + { + trigger_error('DELETE_OWN_POSTS'); + } + + if ($post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id) && $post_id != $post_data['topic_last_post_id']) + { + trigger_error('CANNOT_DELETE_REPLIED'); + } + + trigger_error('USER_CANNOT_DELETE'); +} diff --git a/sources/phpBB/includes/functions_privmsgs.php b/sources/phpBB/includes/functions_privmsgs.php new file mode 100644 index 0000000..838c6a0 --- /dev/null +++ b/sources/phpBB/includes/functions_privmsgs.php @@ -0,0 +1,2238 @@ + +* @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; +} + +/* + Ability to simply add own rules by doing three things: + 1) Add an appropriate constant + 2) Add a new check array to the global_privmsgs_rules variable and the condition array (if one is required) + 3) Implement the rule logic in the check_rule() function + 4) Add a new language variable to ucp.php + + The user is then able to select the new rule. It will be checked against and handled as specified. + To add new actions (yes, checks can be added here too) to the rule management, the core code has to be modified. +*/ + +define('RULE_IS_LIKE', 1); // Is Like +define('RULE_IS_NOT_LIKE', 2); // Is Not Like +define('RULE_IS', 3); // Is +define('RULE_IS_NOT', 4); // Is Not +define('RULE_BEGINS_WITH', 5); // Begins with +define('RULE_ENDS_WITH', 6); // Ends with +define('RULE_IS_FRIEND', 7); // Is Friend +define('RULE_IS_FOE', 8); // Is Foe +define('RULE_IS_USER', 9); // Is User +define('RULE_IS_GROUP', 10); // Is In Usergroup +define('RULE_ANSWERED', 11); // Answered +define('RULE_FORWARDED', 12); // Forwarded +define('RULE_TO_GROUP', 14); // Usergroup +define('RULE_TO_ME', 15); // Me + +define('ACTION_PLACE_INTO_FOLDER', 1); +define('ACTION_MARK_AS_READ', 2); +define('ACTION_MARK_AS_IMPORTANT', 3); +define('ACTION_DELETE_MESSAGE', 4); + +define('CHECK_SUBJECT', 1); +define('CHECK_SENDER', 2); +define('CHECK_MESSAGE', 3); +define('CHECK_STATUS', 4); +define('CHECK_TO', 5); + +/** +* Global private message rules +* These rules define what to do if a rule is hit +*/ +$global_privmsgs_rules = array( + CHECK_SUBJECT => array( + RULE_IS_LIKE => array('check0' => 'message_subject'), + RULE_IS_NOT_LIKE => array('check0' => 'message_subject'), + RULE_IS => array('check0' => 'message_subject'), + RULE_IS_NOT => array('check0' => 'message_subject'), + RULE_BEGINS_WITH => array('check0' => 'message_subject'), + RULE_ENDS_WITH => array('check0' => 'message_subject'), + ), + + CHECK_SENDER => array( + RULE_IS_LIKE => array('check0' => 'username'), + RULE_IS_NOT_LIKE => array('check0' => 'username'), + RULE_IS => array('check0' => 'username'), + RULE_IS_NOT => array('check0' => 'username'), + RULE_BEGINS_WITH => array('check0' => 'username'), + RULE_ENDS_WITH => array('check0' => 'username'), + RULE_IS_FRIEND => array('check0' => 'friend'), + RULE_IS_FOE => array('check0' => 'foe'), + RULE_IS_USER => array('check0' => 'author_id'), + RULE_IS_GROUP => array('check0' => 'author_in_group'), + ), + + CHECK_MESSAGE => array( + RULE_IS_LIKE => array('check0' => 'message_text'), + RULE_IS_NOT_LIKE => array('check0' => 'message_text'), + RULE_IS => array('check0' => 'message_text'), + RULE_IS_NOT => array('check0' => 'message_text'), + ), + + CHECK_STATUS => array( + RULE_ANSWERED => array('check0' => 'pm_replied'), + RULE_FORWARDED => array('check0' => 'pm_forwarded'), + ), + + CHECK_TO => array( + RULE_TO_GROUP => array('check0' => 'to', 'check1' => 'bcc', 'check2' => 'user_in_group'), + RULE_TO_ME => array('check0' => 'to', 'check1' => 'bcc'), + ) +); + +/** +* This is for defining which condition fields to show for which Rule +*/ +$global_rule_conditions = array( + RULE_IS_LIKE => 'text', + RULE_IS_NOT_LIKE => 'text', + RULE_IS => 'text', + RULE_IS_NOT => 'text', + RULE_BEGINS_WITH => 'text', + RULE_ENDS_WITH => 'text', + RULE_IS_USER => 'user', + RULE_IS_GROUP => 'group' +); + +/** +* Get all folder +*/ +function get_folder($user_id, $folder_id = false) +{ + global $db, $user, $template; + global $phpbb_root_path, $phpEx; + + $folder = array(); + + // Get folder information + $sql = 'SELECT folder_id, COUNT(msg_id) as num_messages, SUM(pm_unread) as num_unread + FROM ' . PRIVMSGS_TO_TABLE . " + WHERE user_id = $user_id + AND folder_id <> " . PRIVMSGS_NO_BOX . ' + GROUP BY folder_id'; + $result = $db->sql_query($sql); + + $num_messages = $num_unread = array(); + while ($row = $db->sql_fetchrow($result)) + { + $num_messages[(int) $row['folder_id']] = $row['num_messages']; + $num_unread[(int) $row['folder_id']] = $row['num_unread']; + } + $db->sql_freeresult($result); + + // Make sure the default boxes are defined + $available_folder = array(PRIVMSGS_INBOX, PRIVMSGS_OUTBOX, PRIVMSGS_SENTBOX); + + foreach ($available_folder as $default_folder) + { + if (!isset($num_messages[$default_folder])) + { + $num_messages[$default_folder] = 0; + } + + if (!isset($num_unread[$default_folder])) + { + $num_unread[$default_folder] = 0; + } + } + + // Adjust unread status for outbox + $num_unread[PRIVMSGS_OUTBOX] = $num_messages[PRIVMSGS_OUTBOX]; + + $folder[PRIVMSGS_INBOX] = array( + 'folder_name' => $user->lang['PM_INBOX'], + 'num_messages' => $num_messages[PRIVMSGS_INBOX], + 'unread_messages' => $num_unread[PRIVMSGS_INBOX] + ); + + // Custom Folder + $sql = 'SELECT folder_id, folder_name, pm_count + FROM ' . PRIVMSGS_FOLDER_TABLE . " + WHERE user_id = $user_id"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $folder[$row['folder_id']] = array( + 'folder_name' => $row['folder_name'], + 'num_messages' => $row['pm_count'], + 'unread_messages' => ((isset($num_unread[$row['folder_id']])) ? $num_unread[$row['folder_id']] : 0) + ); + } + $db->sql_freeresult($result); + + $folder[PRIVMSGS_OUTBOX] = array( + 'folder_name' => $user->lang['PM_OUTBOX'], + 'num_messages' => $num_messages[PRIVMSGS_OUTBOX], + 'unread_messages' => $num_unread[PRIVMSGS_OUTBOX] + ); + + $folder[PRIVMSGS_SENTBOX] = array( + 'folder_name' => $user->lang['PM_SENTBOX'], + 'num_messages' => $num_messages[PRIVMSGS_SENTBOX], + 'unread_messages' => $num_unread[PRIVMSGS_SENTBOX] + ); + + // Define Folder Array for template designers (and for making custom folders usable by the template too) + foreach ($folder as $f_id => $folder_ary) + { + $folder_id_name = ($f_id == PRIVMSGS_INBOX) ? 'inbox' : (($f_id == PRIVMSGS_OUTBOX) ? 'outbox' : 'sentbox'); + + $template->assign_block_vars('folder', array( + 'FOLDER_ID' => $f_id, + 'FOLDER_NAME' => $folder_ary['folder_name'], + 'NUM_MESSAGES' => $folder_ary['num_messages'], + 'UNREAD_MESSAGES' => $folder_ary['unread_messages'], + + 'U_FOLDER' => ($f_id > 0) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $f_id) : append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $folder_id_name), + + 'S_CUR_FOLDER' => ($f_id === $folder_id) ? true : false, + 'S_UNREAD_MESSAGES' => ($folder_ary['unread_messages']) ? true : false, + 'S_CUSTOM_FOLDER' => ($f_id > 0) ? true : false) + ); + } + + if ($folder_id !== false && $folder_id !== PRIVMSGS_HOLD_BOX && !isset($folder[$folder_id])) + { + trigger_error('UNKNOWN_FOLDER'); + } + + return $folder; +} + +/** +* Delete Messages From Sentbox +* we are doing this here because this saves us a bunch of checks and queries +*/ +function clean_sentbox($num_sentbox_messages) +{ + global $db, $user, $config; + + // Check Message Limit + if ($user->data['message_limit'] && $num_sentbox_messages > $user->data['message_limit']) + { + // Delete old messages + $sql = 'SELECT t.msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p + WHERE t.msg_id = p.msg_id + AND t.user_id = ' . $user->data['user_id'] . ' + AND t.folder_id = ' . PRIVMSGS_SENTBOX . ' + ORDER BY p.message_time ASC'; + $result = $db->sql_query_limit($sql, ($num_sentbox_messages - $user->data['message_limit'])); + + $delete_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $delete_ids[] = $row['msg_id']; + } + $db->sql_freeresult($result); + delete_pm($user->data['user_id'], $delete_ids, PRIVMSGS_SENTBOX); + } +} + +/** +* Check Rule against Message Information +*/ +function check_rule(&$rules, &$rule_row, &$message_row, $user_id) +{ + global $user, $config; + + if (!isset($rules[$rule_row['rule_check']][$rule_row['rule_connection']])) + { + return false; + } + + $check_ary = $rules[$rule_row['rule_check']][$rule_row['rule_connection']]; + + $result = false; + + $check0 = $message_row[$check_ary['check0']]; + + switch ($rule_row['rule_connection']) + { + case RULE_IS_LIKE: + $result = preg_match("/" . preg_quote($rule_row['rule_string'], '/') . '/i', $check0); + break; + + case RULE_IS_NOT_LIKE: + $result = !preg_match("/" . preg_quote($rule_row['rule_string'], '/') . '/i', $check0); + break; + + case RULE_IS: + $result = ($check0 == $rule_row['rule_string']); + break; + + case RULE_IS_NOT: + $result = ($check0 != $rule_row['rule_string']); + break; + + case RULE_BEGINS_WITH: + $result = preg_match("/^" . preg_quote($rule_row['rule_string'], '/') . '/i', $check0); + break; + + case RULE_ENDS_WITH: + $result = preg_match("/" . preg_quote($rule_row['rule_string'], '/') . '$/i', $check0); + break; + + case RULE_IS_FRIEND: + case RULE_IS_FOE: + case RULE_ANSWERED: + case RULE_FORWARDED: + $result = ($check0 == 1); + break; + + case RULE_IS_USER: + $result = ($check0 == $rule_row['rule_user_id']); + break; + + case RULE_IS_GROUP: + $result = in_array($rule_row['rule_group_id'], $check0); + break; + + case RULE_TO_GROUP: + $result = (in_array('g_' . $message_row[$check_ary['check2']], $check0) || in_array('g_' . $message_row[$check_ary['check2']], $message_row[$check_ary['check1']])); + break; + + case RULE_TO_ME: + $result = (in_array('u_' . $user_id, $check0) || in_array('u_' . $user_id, $message_row[$check_ary['check1']])); + break; + } + + if (!$result) + { + return false; + } + + switch ($rule_row['rule_action']) + { + case ACTION_PLACE_INTO_FOLDER: + return array('action' => $rule_row['rule_action'], 'folder_id' => $rule_row['rule_folder_id']); + break; + + case ACTION_MARK_AS_READ: + case ACTION_MARK_AS_IMPORTANT: + return array('action' => $rule_row['rule_action'], 'pm_unread' => $message_row['pm_unread'], 'pm_marked' => $message_row['pm_marked']); + break; + + case ACTION_DELETE_MESSAGE: + global $db, $auth; + + // Check for admins/mods - users are not allowed to remove those messages... + // We do the check here to make sure the data we use is consistent + $sql = 'SELECT user_id, user_type, user_permissions + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . (int) $message_row['author_id']; + $result = $db->sql_query($sql); + $userdata = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $auth2 = new \phpbb\auth\auth(); + $auth2->acl($userdata); + + if (!$auth2->acl_get('a_') && !$auth2->acl_get('m_') && !$auth2->acl_getf_global('m_')) + { + return array('action' => $rule_row['rule_action'], 'pm_unread' => $message_row['pm_unread'], 'pm_marked' => $message_row['pm_marked']); + } + + return false; + break; + + default: + return false; + } + + return false; +} + +/** +* Update user PM count +*/ +function update_pm_counts() +{ + global $user, $db; + + // Update unread count + $sql = 'SELECT COUNT(msg_id) as num_messages + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE pm_unread = 1 + AND folder_id <> ' . PRIVMSGS_OUTBOX . ' + AND user_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + $user->data['user_unread_privmsg'] = (int) $db->sql_fetchfield('num_messages'); + $db->sql_freeresult($result); + + // Update new pm count + $sql = 'SELECT COUNT(msg_id) as num_messages + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE pm_new = 1 + AND folder_id IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ') + AND user_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + $user->data['user_new_privmsg'] = (int) $db->sql_fetchfield('num_messages'); + $db->sql_freeresult($result); + + $db->sql_query('UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( + 'user_unread_privmsg' => (int) $user->data['user_unread_privmsg'], + 'user_new_privmsg' => (int) $user->data['user_new_privmsg'], + )) . ' WHERE user_id = ' . $user->data['user_id']); + + // Ok, here we need to repair something, other boxes than privmsgs_no_box and privmsgs_hold_box should not carry the pm_new flag. + if (!$user->data['user_new_privmsg']) + { + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + SET pm_new = 0 + WHERE pm_new = 1 + AND folder_id NOT IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ') + AND user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + } +} + +/** +* Place new messages into appropriate folder +*/ +function place_pm_into_folder(&$global_privmsgs_rules, $release = false) +{ + global $db, $user, $config; + + if (!$user->data['user_new_privmsg']) + { + return array('not_moved' => 0, 'removed' => 0); + } + + $user_message_rules = (int) $user->data['user_message_rules']; + $user_id = (int) $user->data['user_id']; + + $action_ary = $move_into_folder = array(); + $num_removed = 0; + + // Newly processing on-hold messages + if ($release) + { + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + SET folder_id = ' . PRIVMSGS_NO_BOX . ' + WHERE folder_id = ' . PRIVMSGS_HOLD_BOX . " + AND user_id = $user_id"; + $db->sql_query($sql); + } + + // Get those messages not yet placed into any box + $retrieve_sql = 'SELECT t.*, p.*, u.username, u.user_id, u.group_id + FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . " u + WHERE t.user_id = $user_id + AND p.author_id = u.user_id + AND t.folder_id = " . PRIVMSGS_NO_BOX . ' + AND t.msg_id = p.msg_id'; + + // Just place into the appropriate arrays if no rules need to be checked + if (!$user_message_rules) + { + $result = $db->sql_query($retrieve_sql); + + while ($row = $db->sql_fetchrow($result)) + { + $action_ary[$row['msg_id']][] = array('action' => false); + } + $db->sql_freeresult($result); + } + else + { + $user_rules = $zebra = $check_rows = array(); + $user_ids = $memberships = array(); + + // First of all, grab all rules and retrieve friends/foes + $sql = 'SELECT * + FROM ' . PRIVMSGS_RULES_TABLE . " + WHERE user_id = $user_id"; + $result = $db->sql_query($sql); + $user_rules = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + if (sizeof($user_rules)) + { + $sql = 'SELECT zebra_id, friend, foe + FROM ' . ZEBRA_TABLE . " + WHERE user_id = $user_id"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $zebra[$row['zebra_id']] = $row; + } + $db->sql_freeresult($result); + } + + // Now build a bare-bone check_row array + $result = $db->sql_query($retrieve_sql); + + while ($row = $db->sql_fetchrow($result)) + { + $check_rows[] = array_merge($row, array( + 'to' => explode(':', $row['to_address']), + 'bcc' => explode(':', $row['bcc_address']), + 'friend' => (isset($zebra[$row['author_id']])) ? $zebra[$row['author_id']]['friend'] : 0, + 'foe' => (isset($zebra[$row['author_id']])) ? $zebra[$row['author_id']]['foe'] : 0, + 'user_in_group' => array($user->data['group_id']), + 'author_in_group' => array()) + ); + + $user_ids[] = $row['user_id']; + } + $db->sql_freeresult($result); + + // Retrieve user memberships + if (sizeof($user_ids)) + { + $sql = 'SELECT * + FROM ' . USER_GROUP_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $user_ids) . ' + AND user_pending = 0'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $memberships[$row['user_id']][] = $row['group_id']; + } + $db->sql_freeresult($result); + } + + // Now place into the appropriate folder + foreach ($check_rows as $row) + { + // Add membership if set + if (isset($memberships[$row['author_id']])) + { + $row['author_in_group'] = $memberships[$row['user_id']]; + } + + // Check Rule - this should be very quick since we have all information we need + $is_match = false; + foreach ($user_rules as $rule_row) + { + if (($action = check_rule($global_privmsgs_rules, $rule_row, $row, $user_id)) !== false) + { + $is_match = true; + $action_ary[$row['msg_id']][] = $action; + } + } + + if (!$is_match) + { + $action_ary[$row['msg_id']][] = array('action' => false); + } + } + + unset($user_rules, $zebra, $check_rows, $user_ids, $memberships); + } + + // We place actions into arrays, to save queries. + $sql = $unread_ids = $delete_ids = $important_ids = array(); + + foreach ($action_ary as $msg_id => $msg_ary) + { + // It is allowed to execute actions more than once, except placing messages into folder + $folder_action = $message_removed = false; + + foreach ($msg_ary as $pos => $rule_ary) + { + if ($folder_action && $rule_ary['action'] == ACTION_PLACE_INTO_FOLDER) + { + continue; + } + + switch ($rule_ary['action']) + { + case ACTION_PLACE_INTO_FOLDER: + // Folder actions have precedence, so we will remove any other ones + $folder_action = true; + $move_into_folder[(int) $rule_ary['folder_id']][] = $msg_id; + break; + + case ACTION_MARK_AS_READ: + if ($rule_ary['pm_unread']) + { + $unread_ids[] = $msg_id; + } + break; + + case ACTION_DELETE_MESSAGE: + $delete_ids[] = $msg_id; + $message_removed = true; + break; + + case ACTION_MARK_AS_IMPORTANT: + if (!$rule_ary['pm_marked']) + { + $important_ids[] = $msg_id; + } + break; + } + } + + // We place this here because it could happen that the messages are doubled if a rule marks a message and then moves it into a specific + // folder. Here we simply move the message into the INBOX if it gets not removed and also not put into a custom folder. + if (!$folder_action && !$message_removed) + { + $move_into_folder[PRIVMSGS_INBOX][] = $msg_id; + } + } + + // Do not change the order of processing + // The number of queries needed to be executed here highly depends on the defined rules and are + // only gone through if new messages arrive. + + // Delete messages + if (sizeof($delete_ids)) + { + $num_removed += sizeof($delete_ids); + delete_pm($user_id, $delete_ids, PRIVMSGS_NO_BOX); + } + + // Set messages to Unread + if (sizeof($unread_ids)) + { + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + SET pm_unread = 0 + WHERE ' . $db->sql_in_set('msg_id', $unread_ids) . " + AND user_id = $user_id + AND folder_id = " . PRIVMSGS_NO_BOX; + $db->sql_query($sql); + } + + // mark messages as important + if (sizeof($important_ids)) + { + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + SET pm_marked = 1 - pm_marked + WHERE folder_id = ' . PRIVMSGS_NO_BOX . " + AND user_id = $user_id + AND " . $db->sql_in_set('msg_id', $important_ids); + $db->sql_query($sql); + } + + // Move into folder + $folder = array(); + + if (sizeof($move_into_folder)) + { + // Determine Full Folder Action - we need the move to folder id later eventually + $full_folder_action = ($user->data['user_full_folder'] == FULL_FOLDER_NONE) ? ($config['full_folder_action'] - (FULL_FOLDER_NONE*(-1))) : $user->data['user_full_folder']; + + $sql_folder = array_keys($move_into_folder); + if ($full_folder_action >= 0) + { + $sql_folder[] = $full_folder_action; + } + + $sql = 'SELECT folder_id, pm_count + FROM ' . PRIVMSGS_FOLDER_TABLE . ' + WHERE ' . $db->sql_in_set('folder_id', $sql_folder) . " + AND user_id = $user_id"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $folder[(int) $row['folder_id']] = (int) $row['pm_count']; + } + $db->sql_freeresult($result); + + unset($sql_folder); + + if (isset($move_into_folder[PRIVMSGS_INBOX])) + { + $sql = 'SELECT COUNT(msg_id) as num_messages + FROM ' . PRIVMSGS_TO_TABLE . " + WHERE user_id = $user_id + AND folder_id = " . PRIVMSGS_INBOX; + $result = $db->sql_query($sql); + $folder[PRIVMSGS_INBOX] = (int) $db->sql_fetchfield('num_messages'); + $db->sql_freeresult($result); + } + } + + // Here we have ideally only one folder to move into + foreach ($move_into_folder as $folder_id => $msg_ary) + { + $dest_folder = $folder_id; + $full_folder_action = FULL_FOLDER_NONE; + + // Check Message Limit - we calculate with the complete array, most of the time it is one message + // But we are making sure that the other way around works too (more messages in queue than allowed to be stored) + if ($user->data['message_limit'] && $folder[$folder_id] && ($folder[$folder_id] + sizeof($msg_ary)) > $user->data['message_limit']) + { + $full_folder_action = ($user->data['user_full_folder'] == FULL_FOLDER_NONE) ? ($config['full_folder_action'] - (FULL_FOLDER_NONE*(-1))) : $user->data['user_full_folder']; + + // If destination folder itself is full... + if ($full_folder_action >= 0 && ($folder[$full_folder_action] + sizeof($msg_ary)) > $user->data['message_limit']) + { + $full_folder_action = $config['full_folder_action'] - (FULL_FOLDER_NONE*(-1)); + } + + // If Full Folder Action is to move to another folder, we simply adjust the destination folder + if ($full_folder_action >= 0) + { + $dest_folder = $full_folder_action; + } + else if ($full_folder_action == FULL_FOLDER_DELETE) + { + // Delete some messages. NOTE: Ordered by msg_id here instead of message_time! + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . " + WHERE user_id = $user_id + AND folder_id = $dest_folder + ORDER BY msg_id ASC"; + $result = $db->sql_query_limit($sql, (($folder[$dest_folder] + sizeof($msg_ary)) - $user->data['message_limit'])); + + $delete_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $delete_ids[] = $row['msg_id']; + } + $db->sql_freeresult($result); + + $num_removed += sizeof($delete_ids); + delete_pm($user_id, $delete_ids, $dest_folder); + } + } + + // + if ($full_folder_action == FULL_FOLDER_HOLD) + { + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + SET folder_id = ' . PRIVMSGS_HOLD_BOX . ' + WHERE folder_id = ' . PRIVMSGS_NO_BOX . " + AND user_id = $user_id + AND " . $db->sql_in_set('msg_id', $msg_ary); + $db->sql_query($sql); + } + else + { + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . " + SET folder_id = $dest_folder, pm_new = 0 + WHERE folder_id = " . PRIVMSGS_NO_BOX . " + AND user_id = $user_id + AND pm_new = 1 + AND " . $db->sql_in_set('msg_id', $msg_ary); + $db->sql_query($sql); + + if ($dest_folder != PRIVMSGS_INBOX) + { + $sql = 'UPDATE ' . PRIVMSGS_FOLDER_TABLE . ' + SET pm_count = pm_count + ' . (int) $db->sql_affectedrows() . " + WHERE folder_id = $dest_folder + AND user_id = $user_id"; + $db->sql_query($sql); + } + } + } + + if (sizeof($action_ary)) + { + // Move from OUTBOX to SENTBOX + // We are not checking any full folder status here... SENTBOX is a special treatment (old messages get deleted) + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + SET folder_id = ' . PRIVMSGS_SENTBOX . ' + WHERE folder_id = ' . PRIVMSGS_OUTBOX . ' + AND ' . $db->sql_in_set('msg_id', array_keys($action_ary)); + $db->sql_query($sql); + } + + // Update new/unread count + update_pm_counts(); + + // Now check how many messages got not moved... + $sql = 'SELECT COUNT(msg_id) as num_messages + FROM ' . PRIVMSGS_TO_TABLE . " + WHERE user_id = $user_id + AND folder_id = " . PRIVMSGS_HOLD_BOX; + $result = $db->sql_query($sql); + $num_not_moved = (int) $db->sql_fetchfield('num_messages'); + $db->sql_freeresult($result); + + return array('not_moved' => $num_not_moved, 'removed' => $num_removed); +} + +/** +* Move PM from one to another folder +*/ +function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_folder_id) +{ + global $db, $user; + global $phpbb_root_path, $phpEx; + + $num_moved = 0; + + if (!is_array($move_msg_ids)) + { + $move_msg_ids = array($move_msg_ids); + } + + if (sizeof($move_msg_ids) && !in_array($dest_folder, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX, PRIVMSGS_SENTBOX)) && + !in_array($cur_folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)) && $cur_folder_id != $dest_folder) + { + // We have to check the destination folder ;) + if ($dest_folder != PRIVMSGS_INBOX) + { + $sql = 'SELECT folder_id, folder_name, pm_count + FROM ' . PRIVMSGS_FOLDER_TABLE . " + WHERE folder_id = $dest_folder + AND user_id = $user_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + trigger_error('NOT_AUTHORISED'); + } + + if ($message_limit && $row['pm_count'] + sizeof($move_msg_ids) > $message_limit) + { + $message = sprintf($user->lang['NOT_ENOUGH_SPACE_FOLDER'], $row['folder_name']) . '

'; + $message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '', '', $row['folder_name']); + trigger_error($message); + } + } + else + { + $sql = 'SELECT COUNT(msg_id) as num_messages + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE folder_id = ' . PRIVMSGS_INBOX . " + AND user_id = $user_id"; + $result = $db->sql_query($sql); + $num_messages = (int) $db->sql_fetchfield('num_messages'); + $db->sql_freeresult($result); + + if ($message_limit && $num_messages + sizeof($move_msg_ids) > $message_limit) + { + $message = sprintf($user->lang['NOT_ENOUGH_SPACE_FOLDER'], $user->lang['PM_INBOX']) . '

'; + $message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '', '', $user->lang['PM_INBOX']); + trigger_error($message); + } + } + + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . " + SET folder_id = $dest_folder + WHERE folder_id = $cur_folder_id + AND user_id = $user_id + AND " . $db->sql_in_set('msg_id', $move_msg_ids); + $db->sql_query($sql); + $num_moved = $db->sql_affectedrows(); + + // Update pm counts + if ($num_moved) + { + if (!in_array($cur_folder_id, array(PRIVMSGS_INBOX, PRIVMSGS_OUTBOX, PRIVMSGS_SENTBOX))) + { + $sql = 'UPDATE ' . PRIVMSGS_FOLDER_TABLE . " + SET pm_count = pm_count - $num_moved + WHERE folder_id = $cur_folder_id + AND user_id = $user_id"; + $db->sql_query($sql); + } + + if ($dest_folder != PRIVMSGS_INBOX) + { + $sql = 'UPDATE ' . PRIVMSGS_FOLDER_TABLE . " + SET pm_count = pm_count + $num_moved + WHERE folder_id = $dest_folder + AND user_id = $user_id"; + $db->sql_query($sql); + } + } + } + else if (in_array($cur_folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX))) + { + trigger_error('CANNOT_MOVE_SPECIAL'); + } + + return $num_moved; +} + +/** +* Update unread message status +*/ +function update_unread_status($unread, $msg_id, $user_id, $folder_id) +{ + if (!$unread) + { + return; + } + + global $db, $user, $phpbb_container; + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + $phpbb_notifications->mark_notifications_read('notification.type.pm', $msg_id, $user_id); + + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . " + SET pm_unread = 0 + WHERE msg_id = $msg_id + AND user_id = $user_id + AND folder_id = $folder_id"; + $db->sql_query($sql); + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_unread_privmsg = user_unread_privmsg - 1 + WHERE user_id = $user_id"; + $db->sql_query($sql); + + if ($user->data['user_id'] == $user_id) + { + $user->data['user_unread_privmsg']--; + + // Try to cope with previous wrong conversions... + if ($user->data['user_unread_privmsg'] < 0) + { + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_unread_privmsg = 0 + WHERE user_id = $user_id"; + $db->sql_query($sql); + + $user->data['user_unread_privmsg'] = 0; + } + } +} + +function mark_folder_read($user_id, $folder_id) +{ + global $db; + + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE folder_id = ' . ((int) $folder_id) . ' + AND user_id = ' . ((int) $user_id) . ' + AND pm_unread = 1'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + update_unread_status(true, $row['msg_id'], $user_id, $folder_id); + } + $db->sql_freeresult($result); +} + +/** +* Handle all actions possible with marked messages +*/ +function handle_mark_actions($user_id, $mark_action) +{ + global $db, $user, $phpbb_root_path, $phpEx; + + $msg_ids = request_var('marked_msg_id', array(0)); + $cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX); + $confirm = (isset($_POST['confirm'])) ? true : false; + + if (!sizeof($msg_ids)) + { + return false; + } + + switch ($mark_action) + { + case 'mark_important': + + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . " + SET pm_marked = 1 - pm_marked + WHERE folder_id = $cur_folder_id + AND user_id = $user_id + AND " . $db->sql_in_set('msg_id', $msg_ids); + $db->sql_query($sql); + + break; + + case 'delete_marked': + + global $auth; + + if (!$auth->acl_get('u_pm_delete')) + { + trigger_error('NO_AUTH_DELETE_MESSAGE'); + } + + if (confirm_box(true)) + { + delete_pm($user_id, $msg_ids, $cur_folder_id); + + $success_msg = (sizeof($msg_ids) == 1) ? 'MESSAGE_DELETED' : 'MESSAGES_DELETED'; + $redirect = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $cur_folder_id); + + meta_refresh(3, $redirect); + trigger_error($user->lang[$success_msg] . '

' . sprintf($user->lang['RETURN_FOLDER'], '', '')); + } + else + { + $s_hidden_fields = array( + 'cur_folder_id' => $cur_folder_id, + 'mark_option' => 'delete_marked', + 'submit_mark' => true, + 'marked_msg_id' => $msg_ids + ); + + confirm_box(false, 'DELETE_MARKED_PM', build_hidden_fields($s_hidden_fields)); + } + + break; + + default: + return false; + } + + return true; +} + +/** +* Delete PM(s) +*/ +function delete_pm($user_id, $msg_ids, $folder_id) +{ + global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher; + + $user_id = (int) $user_id; + $folder_id = (int) $folder_id; + + if (!$user_id) + { + return false; + } + + if (!is_array($msg_ids)) + { + if (!$msg_ids) + { + return false; + } + $msg_ids = array($msg_ids); + } + + if (!sizeof($msg_ids)) + { + return false; + } + + /** + * Get all info for PM(s) before they are deleted + * + * @event core.delete_pm_before + * @var int user_id ID of the user requested the message delete + * @var array msg_ids array of all messages to be deleted + * @var int folder_id ID of the user folder where the messages are stored + * @since 3.1.0-b5 + */ + $vars = array('user_id', 'msg_ids', 'folder_id'); + extract($phpbb_dispatcher->trigger_event('core.delete_pm_before', compact($vars))); + + // Get PM Information for later deleting + $sql = 'SELECT msg_id, pm_unread, pm_new + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', array_map('intval', $msg_ids)) . " + AND folder_id = $folder_id + AND user_id = $user_id"; + $result = $db->sql_query($sql); + + $delete_rows = array(); + $num_unread = $num_new = $num_deleted = 0; + while ($row = $db->sql_fetchrow($result)) + { + $num_unread += (int) $row['pm_unread']; + $num_new += (int) $row['pm_new']; + + $delete_rows[$row['msg_id']] = 1; + } + $db->sql_freeresult($result); + unset($msg_ids); + + if (!sizeof($delete_rows)) + { + return false; + } + + $db->sql_transaction('begin'); + + // if no one has read the message yet (meaning it is in users outbox) + // then mark the message as deleted... + if ($folder_id == PRIVMSGS_OUTBOX) + { + // Remove PM from Outbox + $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . " + WHERE user_id = $user_id AND folder_id = " . PRIVMSGS_OUTBOX . ' + AND ' . $db->sql_in_set('msg_id', array_keys($delete_rows)); + $db->sql_query($sql); + + // Update PM Information for safety + $sql = 'UPDATE ' . PRIVMSGS_TABLE . " SET message_text = '' + WHERE " . $db->sql_in_set('msg_id', array_keys($delete_rows)); + $db->sql_query($sql); + + // Set delete flag for those intended to receive the PM + // We do not remove the message actually, to retain some basic information (sent time for example) + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + SET pm_deleted = 1 + WHERE ' . $db->sql_in_set('msg_id', array_keys($delete_rows)); + $db->sql_query($sql); + + $num_deleted = $db->sql_affectedrows(); + } + else + { + // Delete private message data + $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . " + WHERE user_id = $user_id + AND folder_id = $folder_id + AND " . $db->sql_in_set('msg_id', array_keys($delete_rows)); + $db->sql_query($sql); + $num_deleted = $db->sql_affectedrows(); + } + + // if folder id is user defined folder then decrease pm_count + if (!in_array($folder_id, array(PRIVMSGS_INBOX, PRIVMSGS_OUTBOX, PRIVMSGS_SENTBOX, PRIVMSGS_NO_BOX))) + { + $sql = 'UPDATE ' . PRIVMSGS_FOLDER_TABLE . " + SET pm_count = pm_count - $num_deleted + WHERE folder_id = $folder_id"; + $db->sql_query($sql); + } + + // Update unread and new status field + if ($num_unread || $num_new) + { + $set_sql = ($num_unread) ? 'user_unread_privmsg = user_unread_privmsg - ' . $num_unread : ''; + + if ($num_new) + { + $set_sql .= ($set_sql != '') ? ', ' : ''; + $set_sql .= 'user_new_privmsg = user_new_privmsg - ' . $num_new; + } + + $db->sql_query('UPDATE ' . USERS_TABLE . " SET $set_sql WHERE user_id = $user_id"); + + $user->data['user_new_privmsg'] -= $num_new; + $user->data['user_unread_privmsg'] -= $num_unread; + } + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + $phpbb_notifications->delete_notifications('notification.type.pm', array_keys($delete_rows)); + + // Now we have to check which messages we can delete completely + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', array_keys($delete_rows)); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + unset($delete_rows[$row['msg_id']]); + } + $db->sql_freeresult($result); + + $delete_ids = array_keys($delete_rows); + + if (sizeof($delete_ids)) + { + // Check if there are any attachments we need to remove + if (!function_exists('delete_attachments')) + { + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } + + delete_attachments('message', $delete_ids, false); + + $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', $delete_ids); + $db->sql_query($sql); + } + + $db->sql_transaction('commit'); + + return true; +} + +/** +* Delete all PM(s) for a given user and delete the ones without references +* +* @param int $user_id ID of the user whose private messages we want to delete +* +* @return boolean False if there were no pms found, true otherwise. +*/ +function phpbb_delete_user_pms($user_id) +{ + global $db, $user, $phpbb_root_path, $phpEx; + + $user_id = (int) $user_id; + + if (!$user_id) + { + return false; + } + + return phpbb_delete_users_pms(array($user_id)); +} + +/** +* Delete all PM(s) for given users and delete the ones without references +* +* @param array $user_ids IDs of the users whose private messages we want to delete +* +* @return boolean False if there were no pms found, true otherwise. +*/ +function phpbb_delete_users_pms($user_ids) +{ + global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container; + + $user_id_sql = $db->sql_in_set('user_id', $user_ids); + $author_id_sql = $db->sql_in_set('author_id', $user_ids); + + // Get PM Information for later deleting + // The two queries where split, so we can use our indexes + $undelivered_msg = $delete_ids = array(); + + // Part 1: get PMs the user received + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE ' . $user_id_sql; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $msg_id = (int) $row['msg_id']; + $delete_ids[$msg_id] = $msg_id; + } + $db->sql_freeresult($result); + + // Part 2: get PMs the users sent, but are yet to be received. + // We cannot simply delete them. First we have to check + // whether another user already received and read the message. + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE ' . $author_id_sql . ' + AND folder_id = ' . PRIVMSGS_NO_BOX; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $msg_id = (int) $row['msg_id']; + $undelivered_msg[$msg_id] = $msg_id; + } + $db->sql_freeresult($result); + + if (empty($delete_ids) && empty($undelivered_msg)) + { + return false; + } + + $db->sql_transaction('begin'); + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + if (!empty($undelivered_msg)) + { + // A pm is delivered, if for any recipient the message was moved + // from their NO_BOX to another folder. We do not delete such + // messages, but only delete them for users, who have not yet + // received them. + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE ' . $author_id_sql . ' + AND folder_id <> ' . PRIVMSGS_NO_BOX . ' + AND folder_id <> ' . PRIVMSGS_OUTBOX . ' + AND folder_id <> ' . PRIVMSGS_SENTBOX; + $result = $db->sql_query($sql); + + $delivered_msg = array(); + while ($row = $db->sql_fetchrow($result)) + { + $msg_id = (int) $row['msg_id']; + $delivered_msg[$msg_id] = $msg_id; + unset($undelivered_msg[$msg_id]); + } + $db->sql_freeresult($result); + + $undelivered_user = array(); + + // Count the messages we delete, so we can correct the user pm data + $sql = 'SELECT user_id, COUNT(msg_id) as num_undelivered_privmsgs + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE ' . $author_id_sql . ' + AND folder_id = ' . PRIVMSGS_NO_BOX . ' + AND ' . $db->sql_in_set('msg_id', array_merge($undelivered_msg, $delivered_msg)) . ' + GROUP BY user_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $num_pms = (int) $row['num_undelivered_privmsgs']; + $undelivered_user[$num_pms][] = (int) $row['user_id']; + + if (sizeof($undelivered_user[$num_pms]) > 50) + { + // If there are too many users affected the query might get + // too long, so we update the value for the first bunch here. + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ', + user_unread_privmsg = user_unread_privmsg - ' . $num_pms . ' + WHERE ' . $db->sql_in_set('user_id', $undelivered_user[$num_pms]); + $db->sql_query($sql); + unset($undelivered_user[$num_pms]); + } + } + $db->sql_freeresult($result); + + foreach ($undelivered_user as $num_pms => $undelivered_user_set) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ', + user_unread_privmsg = user_unread_privmsg - ' . $num_pms . ' + WHERE ' . $db->sql_in_set('user_id', $undelivered_user_set); + $db->sql_query($sql); + } + + if (!empty($delivered_msg)) + { + $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE folder_id = ' . PRIVMSGS_NO_BOX . ' + AND ' . $db->sql_in_set('msg_id', $delivered_msg); + $db->sql_query($sql); + + $phpbb_notifications->delete_notifications('notification.type.pm', $delivered_msg); + } + + if (!empty($undelivered_msg)) + { + $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg); + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg); + $db->sql_query($sql); + + $phpbb_notifications->delete_notifications('notification.type.pm', $undelivered_msg); + } + } + + // Reset the user's pm count to 0 + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = 0, + user_unread_privmsg = 0 + WHERE ' . $user_id_sql; + $db->sql_query($sql); + + // Delete private message data of the user + $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE ' . $user_id_sql; + $db->sql_query($sql); + + if (!empty($delete_ids)) + { + // Now we have to check which messages we can delete completely + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', $delete_ids); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + unset($delete_ids[$row['msg_id']]); + } + $db->sql_freeresult($result); + + if (!empty($delete_ids)) + { + // Check if there are any attachments we need to remove + if (!function_exists('delete_attachments')) + { + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } + + delete_attachments('message', $delete_ids, false); + + $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', $delete_ids); + $db->sql_query($sql); + + $phpbb_notifications->delete_notifications('notification.type.pm', $delete_ids); + } + } + + // Set the remaining author id to anonymous + // This way users are still able to read messages from users being removed + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + SET author_id = ' . ANONYMOUS . ' + WHERE ' . $author_id_sql; + $db->sql_query($sql); + + $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' + SET author_id = ' . ANONYMOUS . ' + WHERE ' . $author_id_sql; + $db->sql_query($sql); + + $db->sql_transaction('commit'); + + return true; +} + +/** +* Rebuild message header +*/ +function rebuild_header($check_ary) +{ + global $db; + + $address = array(); + + foreach ($check_ary as $check_type => $address_field) + { + // Split Addresses into users and groups + preg_match_all('/:?(u|g)_([0-9]+):?/', $address_field, $match); + + $u = $g = array(); + foreach ($match[1] as $id => $type) + { + ${$type}[] = (int) $match[2][$id]; + } + + $_types = array('u', 'g'); + foreach ($_types as $type) + { + if (sizeof($$type)) + { + foreach ($$type as $id) + { + $address[$type][$id] = $check_type; + } + } + } + } + + return $address; +} + +/** +* Print out/assign recipient information +*/ +function write_pm_addresses($check_ary, $author_id, $plaintext = false) +{ + global $db, $user, $template, $phpbb_root_path, $phpEx; + + $addresses = array(); + + foreach ($check_ary as $check_type => $address_field) + { + if (!is_array($address_field)) + { + // Split Addresses into users and groups + preg_match_all('/:?(u|g)_([0-9]+):?/', $address_field, $match); + + $u = $g = array(); + foreach ($match[1] as $id => $type) + { + ${$type}[] = (int) $match[2][$id]; + } + } + else + { + $u = $address_field['u']; + $g = $address_field['g']; + } + + $address = array(); + if (sizeof($u)) + { + $sql = 'SELECT user_id, username, user_colour + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $u); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($check_type == 'to' || $author_id == $user->data['user_id'] || $row['user_id'] == $user->data['user_id']) + { + if ($plaintext) + { + $address[] = $row['username']; + } + else + { + $address['user'][$row['user_id']] = array('name' => $row['username'], 'colour' => $row['user_colour']); + } + } + } + $db->sql_freeresult($result); + } + + if (sizeof($g)) + { + if ($plaintext) + { + $sql = 'SELECT group_name, group_type + FROM ' . GROUPS_TABLE . ' + WHERE ' . $db->sql_in_set('group_id', $g); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + 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']; + } + } + $db->sql_freeresult($result); + } + else + { + $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id + FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug + WHERE ' . $db->sql_in_set('g.group_id', $g) . ' + AND g.group_id = ug.group_id + AND ug.user_pending = 0'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($address['group'][$row['group_id']])) + { + 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']; + $address['group'][$row['group_id']] = array('name' => $row['group_name'], 'colour' => $row['group_colour']); + } + } + + if (isset($address['user'][$row['user_id']])) + { + $address['user'][$row['user_id']]['in_group'] = $row['group_id']; + } + } + $db->sql_freeresult($result); + } + } + + if (sizeof($address) && !$plaintext) + { + $template->assign_var('S_' . strtoupper($check_type) . '_RECIPIENT', true); + + foreach ($address as $type => $adr_ary) + { + foreach ($adr_ary as $id => $row) + { + $tpl_ary = array( + 'IS_GROUP' => ($type == 'group') ? true : false, + 'IS_USER' => ($type == 'user') ? true : false, + 'UG_ID' => $id, + 'NAME' => $row['name'], + 'COLOUR' => ($row['colour']) ? '#' . $row['colour'] : '', + 'TYPE' => $type, + ); + + if ($type == 'user') + { + $tpl_ary = array_merge($tpl_ary, array( + 'U_VIEW' => get_username_string('profile', $id, $row['name'], $row['colour']), + 'NAME_FULL' => get_username_string('full', $id, $row['name'], $row['colour']), + )); + } + else + { + $tpl_ary = array_merge($tpl_ary, array( + 'U_VIEW' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $id), + )); + } + + $template->assign_block_vars($check_type . '_recipient', $tpl_ary); + } + } + } + + $addresses[$check_type] = $address; + } + + return $addresses; +} + +/** +* Get folder status +*/ +function get_folder_status($folder_id, $folder) +{ + global $db, $user, $config; + + if (isset($folder[$folder_id])) + { + $folder = $folder[$folder_id]; + } + else + { + return false; + } + + $return = array( + 'folder_name' => $folder['folder_name'], + 'cur' => $folder['num_messages'], + 'remaining' => ($user->data['message_limit']) ? $user->data['message_limit'] - $folder['num_messages'] : 0, + 'max' => $user->data['message_limit'], + 'percent' => ($user->data['message_limit']) ? (($user->data['message_limit'] > 0) ? floor(($folder['num_messages'] / $user->data['message_limit']) * 100) : 100) : 0, + ); + + $return['message'] = $user->lang('FOLDER_STATUS_MSG', $user->lang('MESSAGES_COUNT', (int) $return['max']), $return['cur'], $return['percent']); + + return $return; +} + +// +// COMPOSE MESSAGES +// + +/** +* Submit PM +*/ +function submit_pm($mode, $subject, &$data, $put_in_outbox = true) +{ + global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher; + + // We do not handle erasing pms here + if ($mode == 'delete') + { + return false; + } + + $current_time = time(); + + /** + * Get all parts of the PM that are to be submited to the DB. + * + * @event core.submit_pm_before + * @var string mode PM Post mode - post|reply|quote|quotepost|forward|edit + * @var string subject Subject of the private message + * @var array data The whole row data of the PM. + * @since 3.1.0-b3 + */ + $vars = array('mode', 'subject', 'data'); + extract($phpbb_dispatcher->trigger_event('core.submit_pm_before', compact($vars))); + + // Collect some basic information about which tables and which rows to update/insert + $sql_data = array(); + $root_level = 0; + + // Recipient Information + $recipients = $to = $bcc = array(); + + if ($mode != 'edit') + { + // Build Recipient List + // u|g => array($user_id => 'to'|'bcc') + $_types = array('u', 'g'); + foreach ($_types as $ug_type) + { + if (isset($data['address_list'][$ug_type]) && sizeof($data['address_list'][$ug_type])) + { + foreach ($data['address_list'][$ug_type] as $id => $field) + { + $id = (int) $id; + + // Do not rely on the address list being "valid" + if (!$id || ($ug_type == 'u' && $id == ANONYMOUS)) + { + continue; + } + + $field = ($field == 'to') ? 'to' : 'bcc'; + if ($ug_type == 'u') + { + $recipients[$id] = $field; + } + ${$field}[] = $ug_type . '_' . $id; + } + } + } + + if (isset($data['address_list']['g']) && sizeof($data['address_list']['g'])) + { + // We need to check the PM status of group members (do they want to receive PM's?) + // Only check if not a moderator or admin, since they are allowed to override this user setting + $sql_allow_pm = (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) ? ' AND u.user_allow_pm = 1' : ''; + + $sql = 'SELECT u.user_type, ug.group_id, ug.user_id + FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug + WHERE ' . $db->sql_in_set('ug.group_id', array_keys($data['address_list']['g'])) . ' + AND ug.user_pending = 0 + AND u.user_id = ug.user_id + AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')' . + $sql_allow_pm; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $field = ($data['address_list']['g'][$row['group_id']] == 'to') ? 'to' : 'bcc'; + $recipients[$row['user_id']] = $field; + } + $db->sql_freeresult($result); + } + + if (!sizeof($recipients)) + { + trigger_error('NO_RECIPIENT'); + } + } + + // First of all make sure the subject are having the correct length. + $subject = truncate_string($subject); + + $db->sql_transaction('begin'); + + $sql = ''; + + switch ($mode) + { + case 'reply': + case 'quote': + $root_level = ($data['reply_from_root_level']) ? $data['reply_from_root_level'] : $data['reply_from_msg_id']; + + // Set message_replied switch for this user + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + SET pm_replied = 1 + WHERE user_id = ' . $data['from_user_id'] . ' + AND msg_id = ' . $data['reply_from_msg_id']; + + // no break + + case 'forward': + case 'post': + case 'quotepost': + $sql_data = array( + 'root_level' => $root_level, + 'author_id' => $data['from_user_id'], + 'icon_id' => $data['icon_id'], + 'author_ip' => $data['from_user_ip'], + 'message_time' => $current_time, + 'enable_bbcode' => $data['enable_bbcode'], + 'enable_smilies' => $data['enable_smilies'], + 'enable_magic_url' => $data['enable_urls'], + 'enable_sig' => $data['enable_sig'], + 'message_subject' => $subject, + 'message_text' => $data['message'], + 'message_attachment'=> (!empty($data['attachment_data'])) ? 1 : 0, + 'bbcode_bitfield' => $data['bbcode_bitfield'], + 'bbcode_uid' => $data['bbcode_uid'], + 'to_address' => implode(':', $to), + 'bcc_address' => implode(':', $bcc), + 'message_reported' => 0, + ); + break; + + case 'edit': + $sql_data = array( + 'icon_id' => $data['icon_id'], + 'message_edit_time' => $current_time, + 'enable_bbcode' => $data['enable_bbcode'], + 'enable_smilies' => $data['enable_smilies'], + 'enable_magic_url' => $data['enable_urls'], + 'enable_sig' => $data['enable_sig'], + 'message_subject' => $subject, + 'message_text' => $data['message'], + 'message_attachment'=> (!empty($data['attachment_data'])) ? 1 : 0, + 'bbcode_bitfield' => $data['bbcode_bitfield'], + 'bbcode_uid' => $data['bbcode_uid'] + ); + break; + } + + if (sizeof($sql_data)) + { + $query = ''; + + if ($mode == 'post' || $mode == 'reply' || $mode == 'quote' || $mode == 'quotepost' || $mode == 'forward') + { + $db->sql_query('INSERT INTO ' . PRIVMSGS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_data)); + $data['msg_id'] = $db->sql_nextid(); + } + else if ($mode == 'edit') + { + $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' + SET message_edit_count = message_edit_count + 1, ' . $db->sql_build_array('UPDATE', $sql_data) . ' + WHERE msg_id = ' . $data['msg_id']; + $db->sql_query($sql); + } + } + + if ($mode != 'edit') + { + if ($sql) + { + $db->sql_query($sql); + } + unset($sql); + + $sql_ary = array(); + foreach ($recipients as $user_id => $type) + { + $sql_ary[] = array( + 'msg_id' => (int) $data['msg_id'], + 'user_id' => (int) $user_id, + 'author_id' => (int) $data['from_user_id'], + 'folder_id' => PRIVMSGS_NO_BOX, + 'pm_new' => 1, + 'pm_unread' => 1, + 'pm_forwarded' => ($mode == 'forward') ? 1 : 0 + ); + } + + $db->sql_multi_insert(PRIVMSGS_TO_TABLE, $sql_ary); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = user_new_privmsg + 1, user_unread_privmsg = user_unread_privmsg + 1, user_last_privmsg = ' . time() . ' + WHERE ' . $db->sql_in_set('user_id', array_keys($recipients)); + $db->sql_query($sql); + + // Put PM into outbox + if ($put_in_outbox) + { + $db->sql_query('INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'msg_id' => (int) $data['msg_id'], + 'user_id' => (int) $data['from_user_id'], + 'author_id' => (int) $data['from_user_id'], + 'folder_id' => PRIVMSGS_OUTBOX, + 'pm_new' => 0, + 'pm_unread' => 0, + 'pm_forwarded' => ($mode == 'forward') ? 1 : 0)) + ); + } + } + + // Set user last post time + if ($mode == 'reply' || $mode == 'quote' || $mode == 'quotepost' || $mode == 'forward' || $mode == 'post') + { + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_lastpost_time = $current_time + WHERE user_id = " . $data['from_user_id']; + $db->sql_query($sql); + } + + // Submit Attachments + if (!empty($data['attachment_data']) && $data['msg_id'] && in_array($mode, array('post', 'reply', 'quote', 'quotepost', 'edit', 'forward'))) + { + $space_taken = $files_added = 0; + $orphan_rows = array(); + + foreach ($data['attachment_data'] as $pos => $attach_row) + { + $orphan_rows[(int) $attach_row['attach_id']] = array(); + } + + if (sizeof($orphan_rows)) + { + $sql = 'SELECT attach_id, filesize, physical_filename + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', array_keys($orphan_rows)) . ' + AND in_message = 1 + AND is_orphan = 1 + AND poster_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + + $orphan_rows = array(); + while ($row = $db->sql_fetchrow($result)) + { + $orphan_rows[$row['attach_id']] = $row; + } + $db->sql_freeresult($result); + } + + foreach ($data['attachment_data'] as $pos => $attach_row) + { + if ($attach_row['is_orphan'] && !isset($orphan_rows[$attach_row['attach_id']])) + { + continue; + } + + if (!$attach_row['is_orphan']) + { + // update entry in db if attachment already stored in db and filespace + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . " + SET attach_comment = '" . $db->sql_escape($attach_row['attach_comment']) . "' + WHERE attach_id = " . (int) $attach_row['attach_id'] . ' + AND is_orphan = 0'; + $db->sql_query($sql); + } + else + { + // insert attachment into db + if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . utf8_basename($orphan_rows[$attach_row['attach_id']]['physical_filename']))) + { + continue; + } + + $space_taken += $orphan_rows[$attach_row['attach_id']]['filesize']; + $files_added++; + + $attach_sql = array( + 'post_msg_id' => $data['msg_id'], + 'topic_id' => 0, + 'is_orphan' => 0, + 'poster_id' => $data['from_user_id'], + 'attach_comment' => $attach_row['attach_comment'], + ); + + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $attach_sql) . ' + WHERE attach_id = ' . $attach_row['attach_id'] . ' + AND is_orphan = 1 + AND poster_id = ' . $user->data['user_id']; + $db->sql_query($sql); + } + } + + if ($space_taken && $files_added) + { + set_config_count('upload_dir_size', $space_taken, true); + set_config_count('num_files', $files_added, true); + } + } + + // Delete draft if post was loaded... + $draft_id = request_var('draft_loaded', 0); + if ($draft_id) + { + $sql = 'DELETE FROM ' . DRAFTS_TABLE . " + WHERE draft_id = $draft_id + AND user_id = " . $data['from_user_id']; + $db->sql_query($sql); + } + + $db->sql_transaction('commit'); + + // Send Notifications + $pm_data = array_merge($data, array( + 'message_subject' => $subject, + 'recipients' => $recipients, + )); + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + if ($mode == 'edit') + { + $phpbb_notifications->update_notifications('notification.type.pm', $pm_data); + } + else + { + $phpbb_notifications->add_notifications('notification.type.pm', $pm_data); + } + + /** + * Get PM message ID after submission to DB + * + * @event core.submit_pm_after + * @var string mode PM Post mode - post|reply|quote|quotepost|forward|edit + * @var string subject Subject of the private message + * @var array data The whole row data of the PM. + * @var array pm_data The data sent to notification class + * @since 3.1.0-b5 + */ + $vars = array('mode', 'subject', 'data', 'pm_data'); + extract($phpbb_dispatcher->trigger_event('core.submit_pm_after', compact($vars))); + + return $data['msg_id']; +} + +/** +* Display Message History +*/ +function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode = false) +{ + global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth, $bbcode; + + // Select all receipts and the author from the pm we currently view, to only display their pm-history + $sql = 'SELECT author_id, user_id + FROM ' . PRIVMSGS_TO_TABLE . " + WHERE msg_id = $msg_id + AND folder_id <> " . PRIVMSGS_HOLD_BOX; + $result = $db->sql_query($sql); + + $recipients = array(); + while ($row = $db->sql_fetchrow($result)) + { + $recipients[] = (int) $row['user_id']; + $recipients[] = (int) $row['author_id']; + } + $db->sql_freeresult($result); + $recipients = array_unique($recipients); + + // Get History Messages (could be newer) + $sql = 'SELECT t.*, p.*, u.* + FROM ' . PRIVMSGS_TABLE . ' p, ' . PRIVMSGS_TO_TABLE . ' t, ' . USERS_TABLE . ' u + WHERE t.msg_id = p.msg_id + AND p.author_id = u.user_id + AND t.folder_id NOT IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ') + AND ' . $db->sql_in_set('t.author_id', $recipients, false, true) . " + AND t.user_id = $user_id"; + + // We no longer need those. + unset($recipients); + + if (!$message_row['root_level']) + { + $sql .= " AND (p.root_level = $msg_id OR (p.root_level = 0 AND p.msg_id = $msg_id))"; + } + else + { + $sql .= " AND (p.root_level = " . $message_row['root_level'] . ' OR p.msg_id = ' . $message_row['root_level'] . ')'; + } + $sql .= ' ORDER BY p.message_time DESC'; + + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + + if (!$row) + { + $db->sql_freeresult($result); + return false; + } + + $title = $row['message_subject']; + + $rowset = array(); + $bbcode_bitfield = ''; + $folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm') . '&folder='; + + do + { + $folder_id = (int) $row['folder_id']; + + $row['folder'][] = (isset($folder[$folder_id])) ? '' . $folder[$folder_id]['folder_name'] . '' : $user->lang['UNKNOWN_FOLDER']; + + if (isset($rowset[$row['msg_id']])) + { + $rowset[$row['msg_id']]['folder'][] = (isset($folder[$folder_id])) ? '' . $folder[$folder_id]['folder_name'] . '' : $user->lang['UNKNOWN_FOLDER']; + } + else + { + $rowset[$row['msg_id']] = $row; + $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']); + } + } + while ($row = $db->sql_fetchrow($result)); + $db->sql_freeresult($result); + + if (sizeof($rowset) == 1 && !$in_post_mode) + { + return false; + } + + // Instantiate BBCode class + if ((empty($bbcode) || $bbcode === false) && $bbcode_bitfield !== '') + { + if (!class_exists('bbcode')) + { + include($phpbb_root_path . 'includes/bbcode.' . $phpEx); + } + $bbcode = new bbcode(base64_encode($bbcode_bitfield)); + } + + $title = censor_text($title); + + $url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm'); + $next_history_pm = $previous_history_pm = $prev_id = 0; + + // Re-order rowset to be able to get the next/prev message rows... + $rowset = array_values($rowset); + + for ($i = 0, $size = sizeof($rowset); $i < $size; $i++) + { + $row = &$rowset[$i]; + $id = (int) $row['msg_id']; + + $author_id = $row['author_id']; + $folder_id = (int) $row['folder_id']; + + $subject = $row['message_subject']; + $message = $row['message_text']; + + $message = censor_text($message); + + $decoded_message = false; + + if ($in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) + { + $decoded_message = $message; + decode_message($decoded_message, $row['bbcode_uid']); + + $decoded_message = bbcode_nl2br($decoded_message); + } + + $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0); + $parse_flags |= ($row['enable_smilies'] ? OPTION_FLAG_SMILIES : 0); + + $message = generate_text_for_display($message, $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, false); + + $subject = censor_text($subject); + + if ($id == $msg_id) + { + $next_history_pm = (isset($rowset[$i + 1])) ? (int) $rowset[$i + 1]['msg_id'] : 0; + $previous_history_pm = $prev_id; + } + + $template->assign_block_vars('history_row', array( + 'MESSAGE_AUTHOR_QUOTE' => (($decoded_message) ? addslashes(get_username_string('username', $author_id, $row['username'], $row['user_colour'], $row['username'])) : ''), + 'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $row['username'], $row['user_colour'], $row['username']), + 'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $row['username'], $row['user_colour'], $row['username']), + 'MESSAGE_AUTHOR' => get_username_string('username', $author_id, $row['username'], $row['user_colour'], $row['username']), + 'U_MESSAGE_AUTHOR' => get_username_string('profile', $author_id, $row['username'], $row['user_colour'], $row['username']), + + 'SUBJECT' => $subject, + 'SENT_DATE' => $user->format_date($row['message_time']), + 'MESSAGE' => $message, + 'FOLDER' => implode($user->lang['COMMA_SEPARATOR'], $row['folder']), + 'DECODED_MESSAGE' => $decoded_message, + + 'S_CURRENT_MSG' => ($row['msg_id'] == $msg_id), + 'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false, + 'S_IN_POST_MODE' => $in_post_mode, + + 'MSG_ID' => $row['msg_id'], + 'U_VIEW_MESSAGE' => "$url&f=$folder_id&p=" . $row['msg_id'], + 'U_QUOTE' => (!$in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=quote&f=" . $folder_id . "&p=" . $row['msg_id'] : '', + 'U_POST_REPLY_PM' => ($author_id != $user->data['user_id'] && $author_id != ANONYMOUS && $auth->acl_get('u_sendpm')) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $row['msg_id'] : '') + ); + unset($rowset[$i]); + $prev_id = $id; + } + + $template->assign_vars(array( + 'QUOTE_IMG' => $user->img('icon_post_quote', $user->lang['REPLY_WITH_QUOTE']), + 'HISTORY_TITLE' => $title, + + 'U_VIEW_NEXT_HISTORY' => ($next_history_pm) ? "$url&p=" . $next_history_pm : '', + 'U_VIEW_PREVIOUS_HISTORY' => ($previous_history_pm) ? "$url&p=" . $previous_history_pm : '', + )); + + return true; +} + +/** +* Set correct users max messages in PM folder. +* If several group memberships define different amount of messages, the highest will be chosen. +*/ +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 + 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); + $message_limit = (int) $db->sql_fetchfield('max_message_limit'); + $db->sql_freeresult($result); + + $user->data['message_limit'] = (!$message_limit) ? $config['pm_max_msgs'] : $message_limit; +} + +/** +* Generates an array of coloured recipient names from a list of PMs - (groups & users) +* +* @param array $pm_by_id An array of rows from PRIVMSGS_TABLE, keys are the msg_ids. +* +* @return array 2D Array: array(msg_id => array('username or group string', ...), ...) +* Usernames are generated with {@link get_username_string get_username_string} +* Groups are coloured and have a link to the membership page +*/ +function get_recipient_strings($pm_by_id) +{ + global $db, $phpbb_root_path, $phpEx, $user; + + $address_list = $recipient_list = $address = array(); + + $_types = array('u', 'g'); + + foreach ($pm_by_id as $message_id => $row) + { + $address[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address'])); + + foreach ($_types as $ug_type) + { + if (isset($address[$message_id][$ug_type]) && sizeof($address[$message_id][$ug_type])) + { + foreach ($address[$message_id][$ug_type] as $ug_id => $in_to) + { + $recipient_list[$ug_type][$ug_id] = array('name' => $user->lang['NA'], 'colour' => ''); + } + } + } + } + + foreach ($_types as $ug_type) + { + if (!empty($recipient_list[$ug_type])) + { + if ($ug_type == 'u') + { + $sql = 'SELECT user_id as id, username as name, user_colour as colour + FROM ' . USERS_TABLE . ' + WHERE '; + } + else + { + $sql = 'SELECT group_id as id, group_name as name, group_colour as colour, group_type + FROM ' . GROUPS_TABLE . ' + WHERE '; + } + $sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($recipient_list[$ug_type]))); + + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($ug_type == 'g') + { + $row['name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['name']] : $row['name']; + } + + $recipient_list[$ug_type][$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']); + } + $db->sql_freeresult($result); + } + } + + foreach ($address as $message_id => $adr_ary) + { + foreach ($adr_ary as $type => $id_ary) + { + foreach ($id_ary as $ug_id => $_id) + { + if ($type == 'u') + { + $address_list[$message_id][] = get_username_string('full', $ug_id, $recipient_list[$type][$ug_id]['name'], $recipient_list[$type][$ug_id]['colour']); + } + else + { + $user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="font-weight: bold; color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : ''; + $link = ''; + $address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? '' : ''); + } + } + } + } + + return $address_list; +} diff --git a/sources/phpBB/includes/functions_transfer.php b/sources/phpBB/includes/functions_transfer.php new file mode 100644 index 0000000..42fdee3 --- /dev/null +++ b/sources/phpBB/includes/functions_transfer.php @@ -0,0 +1,902 @@ + +* @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; +} + +/** +* Transfer class, wrapper for ftp/sftp/ssh +*/ +class transfer +{ + var $connection; + var $host; + var $port; + var $username; + var $password; + var $timeout; + var $root_path; + var $tmp_path; + var $file_perms; + var $dir_perms; + + /** + * Constructor - init some basic values + */ + function transfer() + { + global $phpbb_root_path; + + $this->file_perms = 0644; + $this->dir_perms = 0777; + + // We use the store directory as temporary path to circumvent open basedir restrictions + $this->tmp_path = $phpbb_root_path . 'store/'; + } + + /** + * Write file to location + */ + function write_file($destination_file = '', $contents = '') + { + global $phpbb_root_path; + + $destination_file = $this->root_path . str_replace($phpbb_root_path, '', $destination_file); + + // need to create a temp file and then move that temp file. + // ftp functions can only move files around and can't create. + // This means that the users will need to have access to write + // temporary files or have write access on a folder within phpBB + // like the cache folder. If the user can't do either, then + // he/she needs to use the fsock ftp method + $temp_name = tempnam($this->tmp_path, 'transfer_'); + @unlink($temp_name); + + $fp = @fopen($temp_name, 'w'); + + if (!$fp) + { + trigger_error('Unable to create temporary file ' . $temp_name, E_USER_ERROR); + } + + @fwrite($fp, $contents); + @fclose($fp); + + $result = $this->overwrite_file($temp_name, $destination_file); + + // remove temporary file now + @unlink($temp_name); + + return $result; + } + + /** + * Moving file into location. If the destination file already exists it gets overwritten + */ + function overwrite_file($source_file, $destination_file) + { + /** + * @todo generally think about overwriting files in another way, by creating a temporary file and then renaming it + * @todo check for the destination file existance too + */ + $this->_delete($destination_file); + $result = $this->_put($source_file, $destination_file); + $this->_chmod($destination_file, $this->file_perms); + + return $result; + } + + /** + * Create directory structure + */ + function make_dir($dir) + { + global $phpbb_root_path; + + $dir = str_replace($phpbb_root_path, '', $dir); + $dir = explode('/', $dir); + $dirs = ''; + + for ($i = 0, $total = sizeof($dir); $i < $total; $i++) + { + $result = true; + + if (strpos($dir[$i], '.') === 0) + { + continue; + } + $cur_dir = $dir[$i] . '/'; + + if (!file_exists($phpbb_root_path . $dirs . $cur_dir)) + { + // create the directory + $result = $this->_mkdir($dir[$i]); + $this->_chmod($dir[$i], $this->dir_perms); + } + + $this->_chdir($this->root_path . $dirs . $dir[$i]); + $dirs .= $cur_dir; + } + + $this->_chdir($this->root_path); + + /** + * @todo stack result into array to make sure every path creation has been taken care of + */ + return $result; + } + + /** + * Copy file from source location to destination location + */ + function copy_file($from_loc, $to_loc) + { + global $phpbb_root_path; + + $from_loc = ((strpos($from_loc, $phpbb_root_path) !== 0) ? $phpbb_root_path : '') . $from_loc; + $to_loc = $this->root_path . str_replace($phpbb_root_path, '', $to_loc); + + if (!file_exists($from_loc)) + { + return false; + } + + $result = $this->overwrite_file($from_loc, $to_loc); + + return $result; + } + + /** + * Remove file + */ + function delete_file($file) + { + global $phpbb_root_path; + + $file = $this->root_path . str_replace($phpbb_root_path, '', $file); + + return $this->_delete($file); + } + + /** + * Remove directory + * @todo remove child directories? + */ + function remove_dir($dir) + { + global $phpbb_root_path; + + $dir = $this->root_path . str_replace($phpbb_root_path, '', $dir); + + return $this->_rmdir($dir); + } + + /** + * Rename a file or folder + */ + function rename($old_handle, $new_handle) + { + global $phpbb_root_path; + + $old_handle = $this->root_path . str_replace($phpbb_root_path, '', $old_handle); + + return $this->_rename($old_handle, $new_handle); + } + + /** + * Check if a specified file exist... + */ + function file_exists($directory, $filename) + { + global $phpbb_root_path; + + $directory = $this->root_path . str_replace($phpbb_root_path, '', $directory); + + $this->_chdir($directory); + $result = $this->_ls(); + + if ($result !== false && is_array($result)) + { + return (in_array($filename, $result)) ? true : false; + } + + return false; + } + + /** + * Open session + */ + function open_session() + { + return $this->_init(); + } + + /** + * Close current session + */ + function close_session() + { + return $this->_close(); + } + + /** + * Determine methods able to be used + */ + static public function methods() + { + $methods = array(); + $disabled_functions = explode(',', @ini_get('disable_functions')); + + if (@extension_loaded('ftp')) + { + $methods[] = 'ftp'; + } + + if (!in_array('fsockopen', $disabled_functions)) + { + $methods[] = 'ftp_fsock'; + } + + return $methods; + } +} + +/** +* FTP transfer class +*/ +class ftp extends transfer +{ + /** + * Standard parameters for FTP session + */ + function ftp($host, $username, $password, $root_path, $port = 21, $timeout = 10) + { + $this->host = $host; + $this->port = $port; + $this->username = $username; + $this->password = $password; + $this->timeout = $timeout; + + // Make sure $this->root_path is layed out the same way as the $user->page['root_script_path'] value (/ at the end) + $this->root_path = str_replace('\\', '/', $this->root_path); + + if (!empty($root_path)) + { + $this->root_path = (($root_path[0] != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/'); + } + + // Init some needed values + $this->transfer(); + + return; + } + + /** + * Requests data + */ + static public function data() + { + global $user; + + return array( + 'host' => 'localhost', + 'username' => 'anonymous', + 'password' => '', + 'root_path' => $user->page['root_script_path'], + 'port' => 21, + 'timeout' => 10 + ); + } + + /** + * Init FTP Session + * @access private + */ + function _init() + { + // connect to the server + $this->connection = @ftp_connect($this->host, $this->port, $this->timeout); + + if (!$this->connection) + { + return 'ERR_CONNECTING_SERVER'; + } + + // login to the server + if (!@ftp_login($this->connection, $this->username, $this->password)) + { + return 'ERR_UNABLE_TO_LOGIN'; + } + + // attempt to turn pasv mode on + @ftp_pasv($this->connection, true); + + // change to the root directory + if (!$this->_chdir($this->root_path)) + { + return 'ERR_CHANGING_DIRECTORY'; + } + + return true; + } + + /** + * Create Directory (MKDIR) + * @access private + */ + function _mkdir($dir) + { + return @ftp_mkdir($this->connection, $dir); + } + + /** + * Remove directory (RMDIR) + * @access private + */ + function _rmdir($dir) + { + return @ftp_rmdir($this->connection, $dir); + } + + /** + * Rename file + * @access private + */ + function _rename($old_handle, $new_handle) + { + return @ftp_rename($this->connection, $old_handle, $new_handle); + } + + /** + * Change current working directory (CHDIR) + * @access private + */ + function _chdir($dir = '') + { + if ($dir && $dir !== '/') + { + if (substr($dir, -1, 1) == '/') + { + $dir = substr($dir, 0, -1); + } + } + + return @ftp_chdir($this->connection, $dir); + } + + /** + * change file permissions (CHMOD) + * @access private + */ + function _chmod($file, $perms) + { + if (function_exists('ftp_chmod')) + { + $err = @ftp_chmod($this->connection, $perms, $file); + } + else + { + // Unfortunatly CHMOD is not expecting an octal value... + // We need to transform the integer (which was an octal) to an octal representation (to get the int) and then pass as is. ;) + $chmod_cmd = 'CHMOD ' . base_convert($perms, 10, 8) . ' ' . $file; + $err = $this->_site($chmod_cmd); + } + + return $err; + } + + /** + * Upload file to location (PUT) + * @access private + */ + function _put($from_file, $to_file) + { + // get the file extension + $file_extension = strtolower(substr(strrchr($to_file, '.'), 1)); + + // We only use the BINARY file mode to cicumvent rewrite actions from ftp server (mostly linefeeds being replaced) + $mode = FTP_BINARY; + + $to_dir = dirname($to_file); + $to_file = basename($to_file); + $this->_chdir($to_dir); + + $result = @ftp_put($this->connection, $to_file, $from_file, $mode); + $this->_chdir($this->root_path); + + return $result; + } + + /** + * Delete file (DELETE) + * @access private + */ + function _delete($file) + { + return @ftp_delete($this->connection, $file); + } + + /** + * Close ftp session (CLOSE) + * @access private + */ + function _close() + { + if (!$this->connection) + { + return false; + } + + return @ftp_quit($this->connection); + } + + /** + * Return current working directory (CWD) + * At the moment not used by parent class + * @access private + */ + function _cwd() + { + return @ftp_pwd($this->connection); + } + + /** + * Return list of files in a given directory (LS) + * @access private + */ + function _ls($dir = './') + { + $list = @ftp_nlist($this->connection, $dir); + + // See bug #46295 - Some FTP daemons don't like './' + if ($dir === './') + { + // Let's try some alternatives + $list = (empty($list)) ? @ftp_nlist($this->connection, '.') : $list; + $list = (empty($list)) ? @ftp_nlist($this->connection, '') : $list; + } + + // Return on error + if ($list === false) + { + return false; + } + + // Remove path if prepended + foreach ($list as $key => $item) + { + // Use same separator for item and dir + $item = str_replace('\\', '/', $item); + $dir = str_replace('\\', '/', $dir); + + if (!empty($dir) && strpos($item, $dir) === 0) + { + $item = substr($item, strlen($dir)); + } + + $list[$key] = $item; + } + + return $list; + } + + /** + * FTP SITE command (ftp-only function) + * @access private + */ + function _site($command) + { + return @ftp_site($this->connection, $command); + } +} + +/** +* FTP fsock transfer class +*/ +class ftp_fsock extends transfer +{ + var $data_connection; + + /** + * Standard parameters for FTP session + */ + function ftp_fsock($host, $username, $password, $root_path, $port = 21, $timeout = 10) + { + $this->host = $host; + $this->port = $port; + $this->username = $username; + $this->password = $password; + $this->timeout = $timeout; + + // Make sure $this->root_path is layed out the same way as the $user->page['root_script_path'] value (/ at the end) + $this->root_path = str_replace('\\', '/', $this->root_path); + + if (!empty($root_path)) + { + $this->root_path = (($root_path[0] != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/'); + } + + // Init some needed values + $this->transfer(); + + return; + } + + /** + * Requests data + */ + static public function data() + { + global $user; + + return array( + 'host' => 'localhost', + 'username' => 'anonymous', + 'password' => '', + 'root_path' => $user->page['root_script_path'], + 'port' => 21, + 'timeout' => 10 + ); + } + + /** + * Init FTP Session + * @access private + */ + function _init() + { + $errno = 0; + $errstr = ''; + + // connect to the server + $this->connection = @fsockopen($this->host, $this->port, $errno, $errstr, $this->timeout); + + if (!$this->connection || !$this->_check_command()) + { + return 'ERR_CONNECTING_SERVER'; + } + + @stream_set_timeout($this->connection, $this->timeout); + + // login + if (!$this->_send_command('USER', $this->username)) + { + return 'ERR_UNABLE_TO_LOGIN'; + } + + if (!$this->_send_command('PASS', $this->password)) + { + return 'ERR_UNABLE_TO_LOGIN'; + } + + // change to the root directory + if (!$this->_chdir($this->root_path)) + { + return 'ERR_CHANGING_DIRECTORY'; + } + + return true; + } + + /** + * Create Directory (MKDIR) + * @access private + */ + function _mkdir($dir) + { + return $this->_send_command('MKD', $dir); + } + + /** + * Remove directory (RMDIR) + * @access private + */ + function _rmdir($dir) + { + return $this->_send_command('RMD', $dir); + } + + /** + * Rename File + * @access private + */ + function _rename($old_handle, $new_handle) + { + $this->_send_command('RNFR', $old_handle); + return $this->_send_command('RNTO', $new_handle); + } + + /** + * Change current working directory (CHDIR) + * @access private + */ + function _chdir($dir = '') + { + if ($dir && $dir !== '/') + { + if (substr($dir, -1, 1) == '/') + { + $dir = substr($dir, 0, -1); + } + } + + return $this->_send_command('CWD', $dir); + } + + /** + * change file permissions (CHMOD) + * @access private + */ + function _chmod($file, $perms) + { + // Unfortunatly CHMOD is not expecting an octal value... + // We need to transform the integer (which was an octal) to an octal representation (to get the int) and then pass as is. ;) + return $this->_send_command('SITE CHMOD', base_convert($perms, 10, 8) . ' ' . $file); + } + + /** + * Upload file to location (PUT) + * @access private + */ + function _put($from_file, $to_file) + { + // We only use the BINARY file mode to cicumvent rewrite actions from ftp server (mostly linefeeds being replaced) + // 'I' == BINARY + // 'A' == ASCII + if (!$this->_send_command('TYPE', 'I')) + { + return false; + } + + // open the connection to send file over + if (!$this->_open_data_connection()) + { + return false; + } + + $this->_send_command('STOR', $to_file, false); + + // send the file + $fp = @fopen($from_file, 'rb'); + while (!@feof($fp)) + { + @fwrite($this->data_connection, @fread($fp, 4096)); + } + @fclose($fp); + + // close connection + $this->_close_data_connection(); + + return $this->_check_command(); + } + + /** + * Delete file (DELETE) + * @access private + */ + function _delete($file) + { + return $this->_send_command('DELE', $file); + } + + /** + * Close ftp session (CLOSE) + * @access private + */ + function _close() + { + if (!$this->connection) + { + return false; + } + + return $this->_send_command('QUIT'); + } + + /** + * Return current working directory (CWD) + * At the moment not used by parent class + * @access private + */ + function _cwd() + { + $this->_send_command('PWD', '', false); + return preg_replace('#^[0-9]{3} "(.+)" .+\r\n#', '\\1', $this->_check_command(true)); + } + + /** + * Return list of files in a given directory (LS) + * @access private + */ + function _ls($dir = './') + { + if (!$this->_open_data_connection()) + { + return false; + } + + $this->_send_command('NLST', $dir); + + $list = array(); + while (!@feof($this->data_connection)) + { + $filename = preg_replace('#[\r\n]#', '', @fgets($this->data_connection, 512)); + + if ($filename !== '') + { + $list[] = $filename; + } + } + $this->_close_data_connection(); + + // Clear buffer + $this->_check_command(); + + // See bug #46295 - Some FTP daemons don't like './' + if ($dir === './' && empty($list)) + { + // Let's try some alternatives + $list = $this->_ls('.'); + + if (empty($list)) + { + $list = $this->_ls(''); + } + + return $list; + } + + // Remove path if prepended + foreach ($list as $key => $item) + { + // Use same separator for item and dir + $item = str_replace('\\', '/', $item); + $dir = str_replace('\\', '/', $dir); + + if (!empty($dir) && strpos($item, $dir) === 0) + { + $item = substr($item, strlen($dir)); + } + + $list[$key] = $item; + } + + return $list; + } + + /** + * Send a command to server (FTP fsock only function) + * @access private + */ + function _send_command($command, $args = '', $check = true) + { + if (!empty($args)) + { + $command = "$command $args"; + } + + fwrite($this->connection, $command . "\r\n"); + + if ($check === true && !$this->_check_command()) + { + return false; + } + + return true; + } + + /** + * Opens a connection to send data (FTP fosck only function) + * @access private + */ + function _open_data_connection() + { + // Try to find out whether we have a IPv4 or IPv6 (control) connection + if (function_exists('stream_socket_get_name')) + { + $socket_name = stream_socket_get_name($this->connection, true); + $server_ip = substr($socket_name, 0, strrpos($socket_name, ':')); + } + + if (!isset($server_ip) || preg_match(get_preg_expression('ipv4'), $server_ip)) + { + // Passive mode + $this->_send_command('PASV', '', false); + + if (!$ip_port = $this->_check_command(true)) + { + return false; + } + + // open the connection to start sending the file + if (!preg_match('#[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+#', $ip_port, $temp)) + { + // bad ip and port + return false; + } + + $temp = explode(',', $temp[0]); + $server_ip = $temp[0] . '.' . $temp[1] . '.' . $temp[2] . '.' . $temp[3]; + $server_port = $temp[4] * 256 + $temp[5]; + } + else + { + // Extended Passive Mode - RFC2428 + $this->_send_command('EPSV', '', false); + + if (!$epsv_response = $this->_check_command(true)) + { + return false; + } + + // Response looks like "229 Entering Extended Passive Mode (|||12345|)" + // where 12345 is the tcp port for the data connection + if (!preg_match('#\(\|\|\|([0-9]+)\|\)#', $epsv_response, $match)) + { + return false; + } + $server_port = (int) $match[1]; + + // fsockopen expects IPv6 address in square brackets + $server_ip = "[$server_ip]"; + } + + $errno = 0; + $errstr = ''; + + if (!$this->data_connection = @fsockopen($server_ip, $server_port, $errno, $errstr, $this->timeout)) + { + return false; + } + @stream_set_timeout($this->data_connection, $this->timeout); + + return true; + } + + /** + * Closes a connection used to send data + * @access private + */ + function _close_data_connection() + { + return @fclose($this->data_connection); + } + + /** + * Check to make sure command was successful (FTP fsock only function) + * @access private + */ + function _check_command($return = false) + { + $response = ''; + + do + { + $result = @fgets($this->connection, 512); + $response .= $result; + } + while (substr($result, 3, 1) !== ' '); + + if (!preg_match('#^[123]#', $response)) + { + return false; + } + + return ($return) ? $response : true; + } +} diff --git a/sources/phpBB/includes/functions_upload.php b/sources/phpBB/includes/functions_upload.php new file mode 100644 index 0000000..f179b2f --- /dev/null +++ b/sources/phpBB/includes/functions_upload.php @@ -0,0 +1,1107 @@ + +* @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; +} + +/** +* Responsible for holding all file relevant information, as well as doing file-specific operations. +* The {@link fileupload fileupload class} can be used to upload several files, each of them being this object to operate further on. +*/ +class filespec +{ + var $filename = ''; + var $realname = ''; + var $uploadname = ''; + var $mimetype = ''; + var $extension = ''; + var $filesize = 0; + var $width = 0; + var $height = 0; + var $image_info = array(); + + var $destination_file = ''; + var $destination_path = ''; + + var $file_moved = false; + var $init_error = false; + var $local = false; + + var $error = array(); + + var $upload = ''; + + /** + * The plupload object + * @var \phpbb\plupload\plupload + */ + protected $plupload; + + /** + * phpBB Mimetype guesser + * @var \phpbb\mimetype\guesser + */ + protected $mimetype_guesser; + + /** + * File Class + * @access private + */ + function filespec($upload_ary, $upload_namespace, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null) + { + if (!isset($upload_ary)) + { + $this->init_error = true; + return; + } + + $this->filename = $upload_ary['tmp_name']; + $this->filesize = $upload_ary['size']; + $name = (STRIP) ? stripslashes($upload_ary['name']) : $upload_ary['name']; + $name = trim(utf8_basename($name)); + $this->realname = $this->uploadname = $name; + $this->mimetype = $upload_ary['type']; + + // Opera adds the name to the mime type + $this->mimetype = (strpos($this->mimetype, '; name') !== false) ? str_replace(strstr($this->mimetype, '; name'), '', $this->mimetype) : $this->mimetype; + + if (!$this->mimetype) + { + $this->mimetype = 'application/octet-stream'; + } + + $this->extension = strtolower(self::get_extension($this->realname)); + + // Try to get real filesize from temporary folder (not always working) ;) + $this->filesize = (@filesize($this->filename)) ? @filesize($this->filename) : $this->filesize; + + $this->width = $this->height = 0; + $this->file_moved = false; + + $this->local = (isset($upload_ary['local_mode'])) ? true : false; + $this->upload = $upload_namespace; + $this->plupload = $plupload; + $this->mimetype_guesser = $mimetype_guesser; + } + + /** + * Cleans destination filename + * + * @param real|unique|unique_ext $mode real creates a realname, filtering some characters, lowering every character. Unique creates an unique filename + * @param string $prefix Prefix applied to filename + * @param string $user_id The user_id is only needed for when cleaning a user's avatar + * @access public + */ + function clean_filename($mode = 'unique', $prefix = '', $user_id = '') + { + if ($this->init_error) + { + return; + } + + switch ($mode) + { + case 'real': + // Remove every extension from filename (to not let the mime bug being exposed) + if (strpos($this->realname, '.') !== false) + { + $this->realname = substr($this->realname, 0, strpos($this->realname, '.')); + } + + // Replace any chars which may cause us problems with _ + $bad_chars = array("'", "\\", ' ', '/', ':', '*', '?', '"', '<', '>', '|'); + + $this->realname = rawurlencode(str_replace($bad_chars, '_', strtolower($this->realname))); + $this->realname = preg_replace("/%(\w{2})/", '_', $this->realname); + + $this->realname = $prefix . $this->realname . '.' . $this->extension; + break; + + case 'unique': + $this->realname = $prefix . md5(unique_id()); + break; + + case 'avatar': + $this->extension = strtolower($this->extension); + $this->realname = $prefix . $user_id . '.' . $this->extension; + + break; + + case 'unique_ext': + default: + $this->realname = $prefix . md5(unique_id()) . '.' . $this->extension; + break; + } + } + + /** + * Get property from file object + */ + function get($property) + { + if ($this->init_error || !isset($this->$property)) + { + return false; + } + + return $this->$property; + } + + /** + * Check if file is an image (mimetype) + * + * @return true if it is an image, false if not + */ + function is_image() + { + return (strpos($this->mimetype, 'image/') === 0); + } + + /** + * Check if the file got correctly uploaded + * + * @return true if it is a valid upload, false if not + */ + function is_uploaded() + { + $is_plupload = $this->plupload && $this->plupload->is_active(); + + if (!$this->local && !$is_plupload && !is_uploaded_file($this->filename)) + { + return false; + } + + if (($this->local || $is_plupload) && !file_exists($this->filename)) + { + return false; + } + + return true; + } + + /** + * Remove file + */ + function remove() + { + if ($this->file_moved) + { + @unlink($this->destination_file); + } + } + + /** + * Get file extension + * + * @param string Filename that needs to be checked + * @return string Extension of the supplied filename + */ + static public function get_extension($filename) + { + if (strpos($filename, '.') === false) + { + return ''; + } + + $filename = explode('.', $filename); + return array_pop($filename); + } + + /** + * Get mimetype + * + * @param string $filename Filename that needs to be checked + * @return string Mimetype of supplied filename + */ + function get_mimetype($filename) + { + if ($this->mimetype_guesser !== null) + { + $mimetype = $this->mimetype_guesser->guess($filename, $this->uploadname); + + if ($mimetype !== 'application/octet-stream') + { + $this->mimetype = $mimetype; + } + } + + return $this->mimetype; + } + + /** + * Get filesize + */ + function get_filesize($filename) + { + return @filesize($filename); + } + + + /** + * Check the first 256 bytes for forbidden content + */ + function check_content($disallowed_content) + { + if (empty($disallowed_content)) + { + return true; + } + + $fp = @fopen($this->filename, 'rb'); + + if ($fp !== false) + { + $ie_mime_relevant = fread($fp, 256); + fclose($fp); + foreach ($disallowed_content as $forbidden) + { + if (stripos($ie_mime_relevant, '<' . $forbidden) !== false) + { + return false; + } + } + } + return true; + } + + /** + * Move file to destination folder + * The phpbb_root_path variable will be applied to the destination path + * + * @param string $destination Destination path, for example $config['avatar_path'] + * @param bool $overwrite If set to true, an already existing file will be overwritten + * @param bool $skip_image_check If set to true, the check for the file to be a valid image is skipped + * @param string $chmod Permission mask for chmodding the file after a successful move. The mode entered here reflects the mode defined by {@link phpbb_chmod()} + * + * @access public + */ + function move_file($destination, $overwrite = false, $skip_image_check = false, $chmod = false) + { + global $user, $phpbb_root_path; + + if (sizeof($this->error)) + { + return false; + } + + $chmod = ($chmod === false) ? CHMOD_READ | CHMOD_WRITE : $chmod; + + // We need to trust the admin in specifying valid upload directories and an attacker not being able to overwrite it... + $this->destination_path = $phpbb_root_path . $destination; + + // Check if the destination path exist... + if (!file_exists($this->destination_path)) + { + @unlink($this->filename); + return false; + } + + $upload_mode = (@ini_get('open_basedir') || @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on') ? 'move' : 'copy'; + $upload_mode = ($this->local) ? 'local' : $upload_mode; + $this->destination_file = $this->destination_path . '/' . utf8_basename($this->realname); + + // Check if the file already exist, else there is something wrong... + if (file_exists($this->destination_file) && !$overwrite) + { + @unlink($this->filename); + $this->error[] = $user->lang($this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR', $this->destination_file); + $this->file_moved = false; + return false; + } + else + { + if (file_exists($this->destination_file)) + { + @unlink($this->destination_file); + } + + switch ($upload_mode) + { + case 'copy': + + if (!@copy($this->filename, $this->destination_file)) + { + if (!@move_uploaded_file($this->filename, $this->destination_file)) + { + $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); + } + } + + break; + + case 'move': + + if (!@move_uploaded_file($this->filename, $this->destination_file)) + { + if (!@copy($this->filename, $this->destination_file)) + { + $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); + } + } + + break; + + case 'local': + + if (!@copy($this->filename, $this->destination_file)) + { + $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); + } + + break; + } + + // Remove temporary filename + @unlink($this->filename); + + if (sizeof($this->error)) + { + return false; + } + + phpbb_chmod($this->destination_file, $chmod); + } + + // Try to get real filesize from destination folder + $this->filesize = (@filesize($this->destination_file)) ? @filesize($this->destination_file) : $this->filesize; + + // Get mimetype of supplied file + $this->mimetype = $this->get_mimetype($this->destination_file); + + if ($this->is_image() && !$skip_image_check) + { + $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]; + + if (!empty($this->image_info['mime'])) + { + $this->mimetype = $this->image_info['mime']; + } + + // 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[2]])) + { + $this->error[] = sprintf($user->lang['IMAGE_FILETYPE_INVALID'], $this->image_info[2], $this->mimetype); + } + else + { + $this->error[] = sprintf($user->lang['IMAGE_FILETYPE_MISMATCH'], $types[$this->image_info[2]][0], $this->extension); + } + } + + // Make sure the dimensions match a valid image + if (empty($this->width) || empty($this->height)) + { + $this->error[] = $user->lang['ATTACHED_IMAGE_NOT_IMAGE']; + } + } + else + { + $this->error[] = $user->lang['UNABLE_GET_IMAGE_SIZE']; + } + } + + $this->file_moved = true; + $this->additional_checks(); + unset($this->upload); + + return true; + } + + /** + * Performing additional checks + */ + function additional_checks() + { + global $user; + + if (!$this->file_moved) + { + return false; + } + + // Filesize is too big or it's 0 if it was larger than the maxsize in the upload form + if ($this->upload->max_filesize && ($this->get('filesize') > $this->upload->max_filesize || $this->filesize == 0)) + { + $max_filesize = get_formatted_filesize($this->upload->max_filesize, false); + + $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']); + + return false; + } + + if (!$this->upload->valid_dimensions($this)) + { + $this->error[] = $user->lang($this->upload->error_prefix . 'WRONG_SIZE', + $user->lang('PIXELS', (int) $this->upload->min_width), + $user->lang('PIXELS', (int) $this->upload->min_height), + $user->lang('PIXELS', (int) $this->upload->max_width), + $user->lang('PIXELS', (int) $this->upload->max_height), + $user->lang('PIXELS', (int) $this->width), + $user->lang('PIXELS', (int) $this->height)); + + return false; + } + + return true; + } +} + +/** +* Class for assigning error messages before a real filespec class can be assigned +*/ +class fileerror extends filespec +{ + function fileerror($error_msg) + { + $this->error[] = $error_msg; + } +} + +/** +* File upload class +* Init class (all parameters optional and able to be set/overwritten separately) - scope is global and valid for all uploads +*/ +class fileupload +{ + var $allowed_extensions = array(); + var $disallowed_content = array('body', 'head', 'html', 'img', 'plaintext', 'a href', 'pre', 'script', 'table', 'title'); + var $max_filesize = 0; + var $min_width = 0; + var $min_height = 0; + var $max_width = 0; + var $max_height = 0; + var $error_prefix = ''; + + /** @var int Timeout for remote upload */ + var $upload_timeout = 6; + + /** + * Init file upload class. + * + * @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 + * @param int $min_width Minimum image width (only checked for images) + * @param int $min_height Minimum image height (only checked for images) + * @param int $max_width Maximum image width (only checked for images) + * @param int $max_height Maximum image height (only checked for images) + * @param bool|array $disallowed_content If enabled, the first 256 bytes of the file must not + * 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) + { + $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); + } + + /** + * Reset vars + */ + function reset_vars() + { + $this->max_filesize = 0; + $this->min_width = $this->min_height = $this->max_width = $this->max_height = 0; + $this->error_prefix = ''; + $this->allowed_extensions = array(); + $this->disallowed_content = array(); + } + + /** + * Set allowed extensions + */ + function set_allowed_extensions($allowed_extensions) + { + if ($allowed_extensions !== false && is_array($allowed_extensions)) + { + $this->allowed_extensions = $allowed_extensions; + } + } + + /** + * Set allowed dimensions + */ + function set_allowed_dimensions($min_width, $min_height, $max_width, $max_height) + { + $this->min_width = (int) $min_width; + $this->min_height = (int) $min_height; + $this->max_width = (int) $max_width; + $this->max_height = (int) $max_height; + } + + /** + * Set maximum allowed filesize + */ + function set_max_filesize($max_filesize) + { + if ($max_filesize !== false && (int) $max_filesize) + { + $this->max_filesize = (int) $max_filesize; + } + } + + /** + * Set disallowed strings + */ + function set_disallowed_content($disallowed_content) + { + if ($disallowed_content !== false && is_array($disallowed_content)) + { + $this->disallowed_content = array_diff($disallowed_content, array('')); + } + } + + /** + * Set error prefix + */ + function set_error_prefix($error_prefix) + { + $this->error_prefix = $error_prefix; + } + + /** + * Form upload method + * Upload file from users harddisk + * + * @param string $form_name Form name assigned to the file input field (if it is an array, the key has to be specified) + * @param \phpbb\mimetype\guesser $mimetype_guesser Mimetype guesser + * @param \phpbb\plupload\plupload $plupload The plupload object + * + * @return object $file Object "filespec" is returned, all further operations can be done with this object + * @access public + */ + function form_upload($form_name, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null) + { + global $user, $request; + + $upload = $request->file($form_name); + unset($upload['local_mode']); + + if ($plupload) + { + $result = $plupload->handle_upload($form_name); + if (is_array($result)) + { + $upload = array_merge($upload, $result); + } + } + + $file = new filespec($upload, $this, $mimetype_guesser, $plupload); + + if ($file->init_error) + { + $file->error[] = ''; + return $file; + } + + // Error array filled? + if (isset($upload['error'])) + { + $error = $this->assign_internal_error($upload['error']); + + if ($error !== false) + { + $file->error[] = $error; + return $file; + } + } + + // Check if empty file got uploaded (not catched by is_uploaded_file) + if (isset($upload['size']) && $upload['size'] == 0) + { + $file->error[] = $user->lang[$this->error_prefix . 'EMPTY_FILEUPLOAD']; + return $file; + } + + // PHP Upload filesize exceeded + if ($file->get('filename') == 'none') + { + $max_filesize = @ini_get('upload_max_filesize'); + $unit = 'MB'; + + if (!empty($max_filesize)) + { + $unit = strtolower(substr($max_filesize, -1, 1)); + $max_filesize = (int) $max_filesize; + + $unit = ($unit == 'k') ? 'KB' : (($unit == 'g') ? 'GB' : 'MB'); + } + + $file->error[] = (empty($max_filesize)) ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], $max_filesize, $user->lang[$unit]); + return $file; + } + + // Not correctly uploaded + if (!$file->is_uploaded()) + { + $file->error[] = $user->lang[$this->error_prefix . 'NOT_UPLOADED']; + return $file; + } + + $this->common_checks($file); + + return $file; + } + + /** + * Move file from another location to phpBB + */ + function local_upload($source_file, $filedata = false, \phpbb\mimetype\guesser $mimetype_guesser = null) + { + global $user, $request; + + $upload = array(); + + $upload['local_mode'] = true; + $upload['tmp_name'] = $source_file; + + if ($filedata === false) + { + $upload['name'] = utf8_basename($source_file); + $upload['size'] = 0; + } + else + { + $upload['name'] = $filedata['realname']; + $upload['size'] = $filedata['size']; + $upload['type'] = $filedata['type']; + } + + $file = new filespec($upload, $this, $mimetype_guesser); + + if ($file->init_error) + { + $file->error[] = ''; + return $file; + } + + if (isset($upload['error'])) + { + $error = $this->assign_internal_error($upload['error']); + + if ($error !== false) + { + $file->error[] = $error; + return $file; + } + } + + // PHP Upload filesize exceeded + if ($file->get('filename') == 'none') + { + $max_filesize = @ini_get('upload_max_filesize'); + $unit = 'MB'; + + if (!empty($max_filesize)) + { + $unit = strtolower(substr($max_filesize, -1, 1)); + $max_filesize = (int) $max_filesize; + + $unit = ($unit == 'k') ? 'KB' : (($unit == 'g') ? 'GB' : 'MB'); + } + + $file->error[] = (empty($max_filesize)) ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], $max_filesize, $user->lang[$unit]); + return $file; + } + + // Not correctly uploaded + if (!$file->is_uploaded()) + { + $file->error[] = $user->lang[$this->error_prefix . 'NOT_UPLOADED']; + return $file; + } + + $this->common_checks($file); + $request->overwrite('local', $upload, \phpbb\request\request_interface::FILES); + + return $file; + } + + /** + * Remote upload method + * Uploads file from given url + * + * @param string $upload_url URL pointing to file to upload, for example http://www.foobar.com/example.gif + * @param \phpbb\mimetype\guesser $mimetype_guesser Mimetype guesser + * @return object $file Object "filespec" is returned, all further operations can be done with this object + * @access public + */ + function remote_upload($upload_url, \phpbb\mimetype\guesser $mimetype_guesser = null) + { + global $user, $phpbb_root_path; + + $upload_ary = array(); + $upload_ary['local_mode'] = true; + + if (!preg_match('#^(https?://).*?\.(' . implode('|', $this->allowed_extensions) . ')$#i', $upload_url, $match)) + { + $file = new fileerror($user->lang[$this->error_prefix . 'URL_INVALID']); + return $file; + } + + if (empty($match[2])) + { + $file = new fileerror($user->lang[$this->error_prefix . 'URL_INVALID']); + return $file; + } + + $url = parse_url($upload_url); + + $host = $url['host']; + $path = $url['path']; + $port = (!empty($url['port'])) ? (int) $url['port'] : 80; + + $upload_ary['type'] = 'application/octet-stream'; + + $url['path'] = explode('.', $url['path']); + $ext = array_pop($url['path']); + + $url['path'] = implode('', $url['path']); + $upload_ary['name'] = utf8_basename($url['path']) . (($ext) ? '.' . $ext : ''); + $filename = $url['path']; + $filesize = 0; + + $remote_max_filesize = $this->max_filesize; + if (!$remote_max_filesize) + { + $max_filesize = @ini_get('upload_max_filesize'); + + if (!empty($max_filesize)) + { + $unit = strtolower(substr($max_filesize, -1, 1)); + $remote_max_filesize = (int) $max_filesize; + + switch ($unit) + { + case 'g': + $remote_max_filesize *= 1024; + // no break + case 'm': + $remote_max_filesize *= 1024; + // no break + case 'k': + $remote_max_filesize *= 1024; + // no break + } + } + } + + $errno = 0; + $errstr = ''; + + if (!($fsock = @fsockopen($host, $port, $errno, $errstr))) + { + $file = new fileerror($user->lang[$this->error_prefix . 'NOT_UPLOADED']); + return $file; + } + + // Make sure $path not beginning with / + if (strpos($path, '/') === 0) + { + $path = substr($path, 1); + } + + fputs($fsock, 'GET /' . $path . " HTTP/1.1\r\n"); + fputs($fsock, "HOST: " . $host . "\r\n"); + fputs($fsock, "Connection: close\r\n\r\n"); + + // Set a proper timeout for the socket + socket_set_timeout($fsock, $this->upload_timeout); + + $get_info = false; + $data = ''; + $length = false; + $timer_stop = time() + $this->upload_timeout; + + while ((!$length || $filesize < $length) && !@feof($fsock)) + { + if ($get_info) + { + if ($length) + { + // Don't attempt to read past end of file if server indicated length + $block = @fread($fsock, min($length - $filesize, 1024)); + } + else + { + $block = @fread($fsock, 1024); + } + + $filesize += strlen($block); + + if ($remote_max_filesize && $filesize > $remote_max_filesize) + { + $max_filesize = get_formatted_filesize($remote_max_filesize, false); + + $file = new fileerror(sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit'])); + return $file; + } + + $data .= $block; + } + else + { + $line = @fgets($fsock, 1024); + + if ($line == "\r\n") + { + $get_info = true; + } + else + { + if (stripos($line, 'content-type: ') !== false) + { + $upload_ary['type'] = rtrim(str_replace('content-type: ', '', strtolower($line))); + } + else if ($this->max_filesize && stripos($line, 'content-length: ') !== false) + { + $length = (int) str_replace('content-length: ', '', strtolower($line)); + + if ($remote_max_filesize && $length && $length > $remote_max_filesize) + { + $max_filesize = get_formatted_filesize($remote_max_filesize, false); + + $file = new fileerror(sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit'])); + return $file; + } + } + else if (stripos($line, '404 not found') !== false) + { + $file = new fileerror($user->lang[$this->error_prefix . 'URL_NOT_FOUND']); + return $file; + } + } + } + + $stream_meta_data = stream_get_meta_data($fsock); + + // Cancel upload if we exceed timeout + if (!empty($stream_meta_data['timed_out']) || time() >= $timer_stop) + { + $file = new fileerror($user->lang[$this->error_prefix . 'REMOTE_UPLOAD_TIMEOUT']); + return $file; + } + } + @fclose($fsock); + + if (empty($data)) + { + $file = new fileerror($user->lang[$this->error_prefix . 'EMPTY_REMOTE_DATA']); + return $file; + } + + $tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? false : $phpbb_root_path . 'cache'; + $filename = tempnam($tmp_path, unique_id() . '-'); + + if (!($fp = @fopen($filename, 'wb'))) + { + $file = new fileerror($user->lang[$this->error_prefix . 'NOT_UPLOADED']); + return $file; + } + + $upload_ary['size'] = fwrite($fp, $data); + fclose($fp); + unset($data); + + $upload_ary['tmp_name'] = $filename; + + $file = new filespec($upload_ary, $this, $mimetype_guesser); + $this->common_checks($file); + + return $file; + } + + /** + * Assign internal error + * @access private + */ + function assign_internal_error($errorcode) + { + global $user; + + switch ($errorcode) + { + case 1: + $max_filesize = @ini_get('upload_max_filesize'); + $unit = 'MB'; + + if (!empty($max_filesize)) + { + $unit = strtolower(substr($max_filesize, -1, 1)); + $max_filesize = (int) $max_filesize; + + $unit = ($unit == 'k') ? 'KB' : (($unit == 'g') ? 'GB' : 'MB'); + } + + $error = (empty($max_filesize)) ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], $max_filesize, $user->lang[$unit]); + break; + + case 2: + $max_filesize = get_formatted_filesize($this->max_filesize, false); + + $error = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']); + break; + + case 3: + $error = $user->lang[$this->error_prefix . 'PARTIAL_UPLOAD']; + break; + + case 4: + $error = $user->lang[$this->error_prefix . 'NOT_UPLOADED']; + break; + + case 6: + $error = 'Temporary folder could not be found. Please check your PHP installation.'; + break; + + default: + $error = false; + break; + } + + return $error; + } + + /** + * Perform common checks + */ + function common_checks(&$file) + { + global $user; + + // Filesize is too big or it's 0 if it was larger than the maxsize in the upload form + if ($this->max_filesize && ($file->get('filesize') > $this->max_filesize || $file->get('filesize') == 0)) + { + $max_filesize = get_formatted_filesize($this->max_filesize, false); + + $file->error[] = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']); + } + + // check Filename + if (preg_match("#[\\/:*?\"<>|]#i", $file->get('realname'))) + { + $file->error[] = sprintf($user->lang[$this->error_prefix . 'INVALID_FILENAME'], $file->get('realname')); + } + + // Invalid Extension + if (!$this->valid_extension($file)) + { + $file->error[] = sprintf($user->lang[$this->error_prefix . 'DISALLOWED_EXTENSION'], $file->get('extension')); + } + + // MIME Sniffing + if (!$this->valid_content($file)) + { + $file->error[] = sprintf($user->lang[$this->error_prefix . 'DISALLOWED_CONTENT']); + } + } + + /** + * Check for allowed extension + */ + function valid_extension(&$file) + { + return (in_array($file->get('extension'), $this->allowed_extensions)) ? true : false; + } + + /** + * Check for allowed dimension + */ + function valid_dimensions(&$file) + { + if (!$this->max_width && !$this->max_height && !$this->min_width && !$this->min_height) + { + return true; + } + + if (($file->get('width') > $this->max_width && $this->max_width) || + ($file->get('height') > $this->max_height && $this->max_height) || + ($file->get('width') < $this->min_width && $this->min_width) || + ($file->get('height') < $this->min_height && $this->min_height)) + { + return false; + } + + return true; + } + + /** + * Check if form upload is valid + */ + function is_valid($form_name) + { + global $request; + $upload = $request->file($form_name); + + return (!empty($upload) && $upload['name'] !== 'none'); + } + + + /** + * Check for bad content (IE mime-sniffing) + */ + function valid_content(&$file) + { + return ($file->check_content($this->disallowed_content)); + } + + /** + * Get image type/extension mapping + * + * @return array Array containing the image types and their extensions + */ + static public function image_types() + { + $result = array( + IMAGETYPE_GIF => array('gif'), + IMAGETYPE_JPEG => array('jpg', 'jpeg'), + IMAGETYPE_PNG => array('png'), + IMAGETYPE_SWF => array('swf'), + IMAGETYPE_PSD => array('psd'), + IMAGETYPE_BMP => array('bmp'), + IMAGETYPE_TIFF_II => array('tif', 'tiff'), + IMAGETYPE_TIFF_MM => array('tif', 'tiff'), + IMAGETYPE_JPC => array('jpg', 'jpeg'), + IMAGETYPE_JP2 => array('jpg', 'jpeg'), + IMAGETYPE_JPX => array('jpg', 'jpeg'), + IMAGETYPE_JB2 => array('jpg', 'jpeg'), + IMAGETYPE_IFF => array('iff'), + IMAGETYPE_WBMP => array('wbmp'), + IMAGETYPE_XBM => array('xbm'), + ); + + if (defined('IMAGETYPE_SWC')) + { + $result[IMAGETYPE_SWC] = array('swc'); + } + + return $result; + } +} diff --git a/sources/phpBB/includes/functions_url_matcher.php b/sources/phpBB/includes/functions_url_matcher.php new file mode 100644 index 0000000..b965046 --- /dev/null +++ b/sources/phpBB/includes/functions_url_matcher.php @@ -0,0 +1,112 @@ + +* @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/sources/phpBB/includes/functions_user.php b/sources/phpBB/includes/functions_user.php new file mode 100644 index 0000000..f79a899 --- /dev/null +++ b/sources/phpBB/includes/functions_user.php @@ -0,0 +1,3616 @@ + +* @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; +} + +/** +* Obtain user_ids from usernames or vice versa. Returns false on +* success else the error string +* +* @param array &$user_id_ary The user ids to check or empty if usernames used +* @param array &$username_ary The usernames to check or empty if user ids used +* @param mixed $user_type Array of user types to check, false if not restricting by user type +*/ +function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false) +{ + global $db; + + // Are both arrays already filled? Yep, return else + // are neither array filled? + if ($user_id_ary && $username_ary) + { + return false; + } + else if (!$user_id_ary && !$username_ary) + { + return 'NO_USERS'; + } + + $which_ary = ($user_id_ary) ? 'user_id_ary' : 'username_ary'; + + if ($$which_ary && !is_array($$which_ary)) + { + $$which_ary = array($$which_ary); + } + + $sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', $$which_ary) : array_map('utf8_clean_string', $$which_ary); + unset($$which_ary); + + $user_id_ary = $username_ary = array(); + + // Grab the user id/username records + $sql_where = ($which_ary == 'user_id_ary') ? 'user_id' : 'username_clean'; + $sql = 'SELECT user_id, username + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set($sql_where, $sql_in); + + if ($user_type !== false && !empty($user_type)) + { + $sql .= ' AND ' . $db->sql_in_set('user_type', $user_type); + } + + $result = $db->sql_query($sql); + + if (!($row = $db->sql_fetchrow($result))) + { + $db->sql_freeresult($result); + return 'NO_USERS'; + } + + do + { + $username_ary[$row['user_id']] = $row['username']; + $user_id_ary[] = $row['user_id']; + } + while ($row = $db->sql_fetchrow($result)); + $db->sql_freeresult($result); + + return false; +} + +/** +* Get latest registered username and update database to reflect it +*/ +function update_last_username() +{ + global $db; + + // Get latest username + $sql = 'SELECT user_id, username, user_colour + FROM ' . USERS_TABLE . ' + WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') + ORDER BY user_id DESC'; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + 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); + } +} + +/** +* Updates a username across all relevant tables/fields +* +* @param string $old_name the old/current username +* @param string $new_name the new username +*/ +function user_update_name($old_name, $new_name) +{ + global $config, $db, $cache, $phpbb_dispatcher; + + $update_ary = array( + FORUMS_TABLE => array('forum_last_poster_name'), + MODERATOR_CACHE_TABLE => array('username'), + POSTS_TABLE => array('post_username'), + TOPICS_TABLE => array('topic_first_poster_name', 'topic_last_poster_name'), + ); + + foreach ($update_ary as $table => $field_ary) + { + foreach ($field_ary as $field) + { + $sql = "UPDATE $table + SET $field = '" . $db->sql_escape($new_name) . "' + WHERE $field = '" . $db->sql_escape($old_name) . "'"; + $db->sql_query($sql); + } + } + + if ($config['newest_username'] == $old_name) + { + set_config('newest_username', $new_name, true); + } + + /** + * Update a username when it is changed + * + * @event core.update_username + * @var string old_name The old username that is replaced + * @var string new_name The new username + * @since 3.1.0-a1 + */ + $vars = array('old_name', 'new_name'); + extract($phpbb_dispatcher->trigger_event('core.update_username', compact($vars))); + + // Because some tables/caches use username-specific data we need to purge this here. + $cache->destroy('sql', MODERATOR_CACHE_TABLE); +} + +/** +* Adds an user +* +* @param mixed $user_row An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded. +* @param string $cp_data custom profile fields, see custom_profile::build_insert_sql_array +* @param array $notifications_data The notifications settings for the new user +* @return the new user's ID. +*/ +function user_add($user_row, $cp_data = false, $notifications_data = null) +{ + global $db, $user, $auth, $config, $phpbb_root_path, $phpEx; + global $phpbb_dispatcher, $phpbb_container; + + if (empty($user_row['username']) || !isset($user_row['group_id']) || !isset($user_row['user_email']) || !isset($user_row['user_type'])) + { + return false; + } + + $username_clean = utf8_clean_string($user_row['username']); + + if (empty($username_clean)) + { + return false; + } + + $sql_ary = array( + 'username' => $user_row['username'], + 'username_clean' => $username_clean, + 'user_password' => (isset($user_row['user_password'])) ? $user_row['user_password'] : '', + 'user_email' => strtolower($user_row['user_email']), + 'user_email_hash' => phpbb_email_hash($user_row['user_email']), + 'group_id' => $user_row['group_id'], + 'user_type' => $user_row['user_type'], + ); + + // These are the additional vars able to be specified + $additional_vars = array( + 'user_permissions' => '', + 'user_timezone' => $config['board_timezone'], + 'user_dateformat' => $config['default_dateformat'], + 'user_lang' => $config['default_lang'], + 'user_style' => (int) $config['default_style'], + 'user_actkey' => '', + 'user_ip' => '', + 'user_regdate' => time(), + 'user_passchg' => time(), + 'user_options' => 230271, + // We do not set the new flag here - registration scripts need to specify it + 'user_new' => 0, + + 'user_inactive_reason' => 0, + 'user_inactive_time' => 0, + 'user_lastmark' => time(), + 'user_lastvisit' => 0, + 'user_lastpost_time' => 0, + 'user_lastpage' => '', + 'user_posts' => 0, + 'user_colour' => '', + 'user_avatar' => '', + 'user_avatar_type' => '', + 'user_avatar_width' => 0, + 'user_avatar_height' => 0, + 'user_new_privmsg' => 0, + 'user_unread_privmsg' => 0, + 'user_last_privmsg' => 0, + 'user_message_rules' => 0, + 'user_full_folder' => PRIVMSGS_NO_BOX, + 'user_emailtime' => 0, + + 'user_notify' => 0, + 'user_notify_pm' => 1, + 'user_notify_type' => NOTIFY_EMAIL, + 'user_allow_pm' => 1, + 'user_allow_viewonline' => 1, + 'user_allow_viewemail' => 1, + 'user_allow_massemail' => 1, + + 'user_sig' => '', + 'user_sig_bbcode_uid' => '', + 'user_sig_bbcode_bitfield' => '', + + 'user_form_salt' => unique_id(), + ); + + // Now fill the sql array with not required variables + foreach ($additional_vars as $key => $default_value) + { + $sql_ary[$key] = (isset($user_row[$key])) ? $user_row[$key] : $default_value; + } + + // Any additional variables in $user_row not covered above? + $remaining_vars = array_diff(array_keys($user_row), array_keys($sql_ary)); + + // Now fill our sql array with the remaining vars + if (sizeof($remaining_vars)) + { + foreach ($remaining_vars as $key) + { + $sql_ary[$key] = $user_row[$key]; + } + } + + /** + * Use this event to modify the values to be inserted when a user is added + * + * @event core.user_add_modify_data + * @var array user_row Array of user details submited to user_add + * @var array cp_data Array of Custom profile fields submited to user_add + * @var array sql_ary Array of data to be inserted when a user is added + * @since 3.1.0-a1 + * @change 3.1.0-b5 + */ + $vars = array('user_row', 'cp_data', 'sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.user_add_modify_data', compact($vars))); + + $sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + + $user_id = $db->sql_nextid(); + + // Insert Custom Profile Fields + if ($cp_data !== false && sizeof($cp_data)) + { + $cp_data['user_id'] = (int) $user_id; + + $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)); + $db->sql_query($sql); + } + + // Place into appropriate group... + $sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'user_id' => (int) $user_id, + 'group_id' => (int) $user_row['group_id'], + 'user_pending' => 0) + ); + $db->sql_query($sql); + + // Now make it the users default group... + group_set_user_default($user_row['group_id'], array($user_id), false); + + // Add to newly registered users group if user_new is 1 + if ($config['new_member_post_limit'] && $sql_ary['user_new']) + { + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = 'NEWLY_REGISTERED' + AND group_type = " . GROUP_SPECIAL; + $result = $db->sql_query($sql); + $add_group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); + + if ($add_group_id) + { + global $phpbb_log; + + // Because these actions only fill the log unneccessarily we skip the add_log() entry. + $phpbb_log->disable('admin'); + + // Add user to "newly registered users" group and set to default group if admin specified so. + if ($config['new_member_group_default']) + { + group_user_add($add_group_id, $user_id, false, false, true); + $user_row['group_id'] = $add_group_id; + } + else + { + group_user_add($add_group_id, $user_id); + } + + $phpbb_log->enable('admin'); + } + } + + // 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); + + $sql = 'SELECT group_colour + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . (int) $user_row['group_id']; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + set_config('newest_user_colour', $row['group_colour'], true); + } + + // Use default notifications settings if notifications_data is not set + if ($notifications_data === null) + { + $notifications_data = array( + array( + 'item_type' => 'notification.type.post', + 'method' => 'notification.method.email', + ), + array( + 'item_type' => 'notification.type.topic', + 'method' => 'notification.method.email', + ), + ); + } + + // Subscribe user to notifications if necessary + if (!empty($notifications_data)) + { + $phpbb_notifications = $phpbb_container->get('notification_manager'); + foreach ($notifications_data as $subscription) + { + $phpbb_notifications->add_subscription($subscription['item_type'], 0, $subscription['method'], $user_id); + } + } + + /** + * Event that returns user id, user detals and user CPF of newly registared user + * + * @event core.user_add_after + * @var int user_id User id of newly registared user + * @var array user_row Array of user details submited to user_add + * @var array cp_data Array of Custom profile fields submited to user_add + * @since 3.1.0-b5 + */ + $vars = array('user_id', 'user_row', 'cp_data'); + extract($phpbb_dispatcher->trigger_event('core.user_add_after', compact($vars))); + + return $user_id; +} + +/** + * Remove User + * + * @param string $mode Either 'retain' or 'remove' + * @param mixed $user_ids Either an array of integers or an integer + * @param bool $retain_username + * @return bool + */ +function user_delete($mode, $user_ids, $retain_username = true) +{ + global $cache, $config, $db, $user, $phpbb_dispatcher; + global $phpbb_root_path, $phpEx; + + $db->sql_transaction('begin'); + + $user_rows = array(); + if (!is_array($user_ids)) + { + $user_ids = array($user_ids); + } + + $user_id_sql = $db->sql_in_set('user_id', $user_ids); + + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE ' . $user_id_sql; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $user_rows[(int) $row['user_id']] = $row; + } + $db->sql_freeresult($result); + + if (empty($user_rows)) + { + return false; + } + + /** + * Event before a user is deleted + * + * @event core.delete_user_before + * @var string mode Mode of deletion (retain/delete posts) + * @var array user_ids IDs of the deleted user + * @var mixed retain_username True if username should be retained + * or false if not + * @since 3.1.0-a1 + */ + $vars = array('mode', 'user_ids', 'retain_username'); + extract($phpbb_dispatcher->trigger_event('core.delete_user_before', compact($vars))); + + // Before we begin, we will remove the reports the user issued. + $sql = 'SELECT r.post_id, p.topic_id + FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p + WHERE ' . $db->sql_in_set('r.user_id', $user_ids) . ' + AND p.post_id = r.post_id'; + $result = $db->sql_query($sql); + + $report_posts = $report_topics = array(); + while ($row = $db->sql_fetchrow($result)) + { + $report_posts[] = $row['post_id']; + $report_topics[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + if (sizeof($report_posts)) + { + $report_posts = array_unique($report_posts); + $report_topics = array_unique($report_topics); + + // Get a list of topics that still contain reported posts + $sql = 'SELECT DISTINCT topic_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $report_topics) . ' + AND post_reported = 1 + AND ' . $db->sql_in_set('post_id', $report_posts, true); + $result = $db->sql_query($sql); + + $keep_report_topics = array(); + while ($row = $db->sql_fetchrow($result)) + { + $keep_report_topics[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + if (sizeof($keep_report_topics)) + { + $report_topics = array_diff($report_topics, $keep_report_topics); + } + unset($keep_report_topics); + + // Now set the flags back + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET post_reported = 0 + WHERE ' . $db->sql_in_set('post_id', $report_posts); + $db->sql_query($sql); + + if (sizeof($report_topics)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_reported = 0 + WHERE ' . $db->sql_in_set('topic_id', $report_topics); + $db->sql_query($sql); + } + } + + // Remove reports + $db->sql_query('DELETE FROM ' . REPORTS_TABLE . ' WHERE ' . $user_id_sql); + + $num_users_delta = 0; + + // Some things need to be done in the loop (if the query changes based + // on which user is currently being deleted) + $added_guest_posts = 0; + foreach ($user_rows as $user_id => $user_row) + { + if ($user_row['user_avatar'] && $user_row['user_avatar_type'] == 'avatar.driver.upload') + { + avatar_delete('user', $user_row); + } + + // Decrement number of users if this user is active + if ($user_row['user_type'] != USER_INACTIVE && $user_row['user_type'] != USER_IGNORE) + { + --$num_users_delta; + } + + switch ($mode) + { + case 'retain': + if ($retain_username === false) + { + $post_username = $user->lang['GUEST']; + } + else + { + $post_username = $user_row['username']; + } + + // If the user is inactive and newly registered + // we assume no posts from the user, and save + // the queries + if ($user_row['user_type'] != USER_INACTIVE || $user_row['user_inactive_reason'] != INACTIVE_REGISTER || $user_row['user_posts']) + { + // When we delete these users and retain the posts, we must assign all the data to the guest user + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET forum_last_poster_id = ' . ANONYMOUS . ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "', forum_last_poster_colour = '' + WHERE forum_last_poster_id = $user_id"; + $db->sql_query($sql); + + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET poster_id = ' . ANONYMOUS . ", post_username = '" . $db->sql_escape($post_username) . "' + WHERE poster_id = $user_id"; + $db->sql_query($sql); + + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_poster = ' . ANONYMOUS . ", topic_first_poster_name = '" . $db->sql_escape($post_username) . "', topic_first_poster_colour = '' + WHERE topic_poster = $user_id"; + $db->sql_query($sql); + + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_last_poster_id = ' . ANONYMOUS . ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "', topic_last_poster_colour = '' + WHERE topic_last_poster_id = $user_id"; + $db->sql_query($sql); + + // Since we change every post by this author, we need to count this amount towards the anonymous user + + if ($user_row['user_posts']) + { + $added_guest_posts += $user_row['user_posts']; + } + } + break; + + case 'remove': + // there is nothing variant specific to deleting posts + break; + } + } + + if ($num_users_delta != 0) + { + set_config_count('num_users', $num_users_delta, true); + } + + // Now do the invariant tasks + // all queries performed in one call of this function are in a single transaction + // so this is kosher + if ($mode == 'retain') + { + // Assign more data to the Anonymous user + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' + SET poster_id = ' . ANONYMOUS . ' + WHERE ' . $db->sql_in_set('poster_id', $user_ids); + $db->sql_query($sql); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_posts = user_posts + ' . $added_guest_posts . ' + WHERE user_id = ' . ANONYMOUS; + $db->sql_query($sql); + } + else if ($mode == 'remove') + { + if (!function_exists('delete_posts')) + { + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } + + // Delete posts, attachments, etc. + // delete_posts can handle any number of IDs in its second argument + delete_posts('poster_id', $user_ids); + } + + $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE); + + // Delete the miscellaneous (non-post) data for the user + foreach ($table_ary as $table) + { + $sql = "DELETE FROM $table + WHERE " . $user_id_sql; + $db->sql_query($sql); + } + + $cache->destroy('sql', MODERATOR_CACHE_TABLE); + + // Change user_id to anonymous for posts edited by this user + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET post_edit_user = ' . ANONYMOUS . ' + WHERE ' . $db->sql_in_set('post_edit_user', $user_ids); + $db->sql_query($sql); + + // Change user_id to anonymous for pms edited by this user + $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' + SET message_edit_user = ' . ANONYMOUS . ' + WHERE ' . $db->sql_in_set('message_edit_user', $user_ids); + $db->sql_query($sql); + + // Change user_id to anonymous for posts deleted by this user + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET post_delete_user = ' . ANONYMOUS . ' + WHERE ' . $db->sql_in_set('post_delete_user', $user_ids); + $db->sql_query($sql); + + // Change user_id to anonymous for topics deleted by this user + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_delete_user = ' . ANONYMOUS . ' + WHERE ' . $db->sql_in_set('topic_delete_user', $user_ids); + $db->sql_query($sql); + + // Delete user log entries about this user + $sql = 'DELETE FROM ' . LOG_TABLE . ' + WHERE ' . $db->sql_in_set('reportee_id', $user_ids); + $db->sql_query($sql); + + // Change user_id to anonymous for this users triggered events + $sql = 'UPDATE ' . LOG_TABLE . ' + SET user_id = ' . ANONYMOUS . ' + WHERE ' . $user_id_sql; + $db->sql_query($sql); + + // Delete the user_id from the zebra table + $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' + WHERE ' . $user_id_sql . ' + OR ' . $db->sql_in_set('zebra_id', $user_ids); + $db->sql_query($sql); + + // Delete the user_id from the banlist + $sql = 'DELETE FROM ' . BANLIST_TABLE . ' + WHERE ' . $db->sql_in_set('ban_userid', $user_ids); + $db->sql_query($sql); + + // Delete the user_id from the session table + $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' + WHERE ' . $db->sql_in_set('session_user_id', $user_ids); + $db->sql_query($sql); + + // Clean the private messages tables from the user + if (!function_exists('phpbb_delete_user_pms')) + { + include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + } + phpbb_delete_users_pms($user_ids); + + $db->sql_transaction('commit'); + + /** + * Event after a user is deleted + * + * @event core.delete_user_after + * @var string mode Mode of deletion (retain/delete posts) + * @var array user_ids IDs of the deleted user + * @var mixed retain_username True if username should be retained + * or false if not + * @since 3.1.0-a1 + */ + $vars = array('mode', 'user_ids', 'retain_username'); + extract($phpbb_dispatcher->trigger_event('core.delete_user_after', compact($vars))); + + // Reset newest user info if appropriate + if (in_array($config['newest_user_id'], $user_ids)) + { + update_last_username(); + } + + return false; +} + +/** +* Flips user_type from active to inactive and vice versa, handles group membership updates +* +* @param string $mode can be flip for flipping from active/inactive, activate or deactivate +*/ +function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL) +{ + global $config, $db, $user, $auth; + + $deactivated = $activated = 0; + $sql_statements = array(); + + if (!is_array($user_id_ary)) + { + $user_id_ary = array($user_id_ary); + } + + if (!sizeof($user_id_ary)) + { + return; + } + + $sql = 'SELECT user_id, group_id, user_type, user_inactive_reason + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $user_id_ary); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $sql_ary = array(); + + if ($row['user_type'] == USER_IGNORE || $row['user_type'] == USER_FOUNDER || + ($mode == 'activate' && $row['user_type'] != USER_INACTIVE) || + ($mode == 'deactivate' && $row['user_type'] == USER_INACTIVE)) + { + continue; + } + + if ($row['user_type'] == USER_INACTIVE) + { + $activated++; + } + else + { + $deactivated++; + + // Remove the users session key... + $user->reset_login_keys($row['user_id']); + } + + $sql_ary += array( + 'user_type' => ($row['user_type'] == USER_NORMAL) ? USER_INACTIVE : USER_NORMAL, + 'user_inactive_time' => ($row['user_type'] == USER_NORMAL) ? time() : 0, + 'user_inactive_reason' => ($row['user_type'] == USER_NORMAL) ? $reason : 0, + ); + + $sql_statements[$row['user_id']] = $sql_ary; + } + $db->sql_freeresult($result); + + if (sizeof($sql_statements)) + { + foreach ($sql_statements as $user_id => $sql_ary) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . $user_id; + $db->sql_query($sql); + } + + $auth->acl_clear_prefetch(array_keys($sql_statements)); + } + + if ($deactivated) + { + set_config_count('num_users', $deactivated * (-1), true); + } + + if ($activated) + { + set_config_count('num_users', $activated, true); + } + + // Update latest username + update_last_username(); +} + +/** +* Add a ban or ban exclusion to the banlist. Bans either a user, an IP or an email address +* +* @param string $mode Type of ban. One of the following: user, ip, email +* @param mixed $ban Banned entity. Either string or array with usernames, ips or email addresses +* @param int $ban_len Ban length in minutes +* @param string $ban_len_other Ban length as a date (YYYY-MM-DD) +* @param boolean $ban_exclude Exclude these entities from banning? +* @param string $ban_reason String describing the reason for this ban +* @return boolean +*/ +function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason = '') +{ + global $db, $user, $auth, $cache; + + // Delete stale bans + $sql = 'DELETE FROM ' . BANLIST_TABLE . ' + WHERE ban_end < ' . time() . ' + AND ban_end <> 0'; + $db->sql_query($sql); + + $ban_list = (!is_array($ban)) ? array_unique(explode("\n", $ban)) : $ban; + $ban_list_log = implode(', ', $ban_list); + + $current_time = time(); + + // Set $ban_end to the unix time when the ban should end. 0 is a permanent ban. + if ($ban_len) + { + if ($ban_len != -1 || !$ban_len_other) + { + $ban_end = max($current_time, $current_time + ($ban_len) * 60); + } + else + { + $ban_other = explode('-', $ban_len_other); + if (sizeof($ban_other) == 3 && ((int) $ban_other[0] < 9999) && + (strlen($ban_other[0]) == 4) && (strlen($ban_other[1]) == 2) && (strlen($ban_other[2]) == 2)) + { + $ban_end = max($current_time, $user->create_datetime() + ->setDate((int) $ban_other[0], (int) $ban_other[1], (int) $ban_other[2]) + ->setTime(0, 0, 0) + ->getTimestamp() + $user->timezone->getOffset(new DateTime('UTC'))); + } + else + { + trigger_error('LENGTH_BAN_INVALID', E_USER_WARNING); + } + } + } + else + { + $ban_end = 0; + } + + $founder = $founder_names = array(); + + if (!$ban_exclude) + { + // Create a list of founder... + $sql = 'SELECT user_id, user_email, username_clean + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_FOUNDER; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $founder[$row['user_id']] = $row['user_email']; + $founder_names[$row['user_id']] = $row['username_clean']; + } + $db->sql_freeresult($result); + } + + $banlist_ary = array(); + + switch ($mode) + { + case 'user': + $type = 'ban_userid'; + + // At the moment we do not support wildcard username banning + + // Select the relevant user_ids. + $sql_usernames = array(); + + foreach ($ban_list as $username) + { + $username = trim($username); + if ($username != '') + { + $clean_name = utf8_clean_string($username); + if ($clean_name == $user->data['username_clean']) + { + trigger_error('CANNOT_BAN_YOURSELF', E_USER_WARNING); + } + if (in_array($clean_name, $founder_names)) + { + trigger_error('CANNOT_BAN_FOUNDER', E_USER_WARNING); + } + $sql_usernames[] = $clean_name; + } + } + + // Make sure we have been given someone to ban + if (!sizeof($sql_usernames)) + { + trigger_error('NO_USER_SPECIFIED', E_USER_WARNING); + } + + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('username_clean', $sql_usernames); + + // Do not allow banning yourself, the guest account, or founders. + $non_bannable = array($user->data['user_id'], ANONYMOUS); + if (sizeof($founder)) + { + $sql .= ' AND ' . $db->sql_in_set('user_id', array_merge(array_keys($founder), $non_bannable), true); + } + else + { + $sql .= ' AND ' . $db->sql_in_set('user_id', $non_bannable, true); + } + + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + do + { + $banlist_ary[] = (int) $row['user_id']; + } + while ($row = $db->sql_fetchrow($result)); + } + else + { + $db->sql_freeresult($result); + trigger_error('NO_USERS', E_USER_WARNING); + } + $db->sql_freeresult($result); + break; + + case 'ip': + $type = 'ban_ip'; + + foreach ($ban_list as $ban_item) + { + if (preg_match('#^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})[ ]*\-[ ]*([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$#', trim($ban_item), $ip_range_explode)) + { + // This is an IP range + // Don't ask about all this, just don't ask ... ! + $ip_1_counter = $ip_range_explode[1]; + $ip_1_end = $ip_range_explode[5]; + + while ($ip_1_counter <= $ip_1_end) + { + $ip_2_counter = ($ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[2] : 0; + $ip_2_end = ($ip_1_counter < $ip_1_end) ? 254 : $ip_range_explode[6]; + + if ($ip_2_counter == 0 && $ip_2_end == 254) + { + $ip_2_counter = 256; + $ip_2_fragment = 256; + + $banlist_ary[] = "$ip_1_counter.*"; + } + + while ($ip_2_counter <= $ip_2_end) + { + $ip_3_counter = ($ip_2_counter == $ip_range_explode[2] && $ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[3] : 0; + $ip_3_end = ($ip_2_counter < $ip_2_end || $ip_1_counter < $ip_1_end) ? 254 : $ip_range_explode[7]; + + if ($ip_3_counter == 0 && $ip_3_end == 254) + { + $ip_3_counter = 256; + $ip_3_fragment = 256; + + $banlist_ary[] = "$ip_1_counter.$ip_2_counter.*"; + } + + while ($ip_3_counter <= $ip_3_end) + { + $ip_4_counter = ($ip_3_counter == $ip_range_explode[3] && $ip_2_counter == $ip_range_explode[2] && $ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[4] : 0; + $ip_4_end = ($ip_3_counter < $ip_3_end || $ip_2_counter < $ip_2_end) ? 254 : $ip_range_explode[8]; + + if ($ip_4_counter == 0 && $ip_4_end == 254) + { + $ip_4_counter = 256; + $ip_4_fragment = 256; + + $banlist_ary[] = "$ip_1_counter.$ip_2_counter.$ip_3_counter.*"; + } + + while ($ip_4_counter <= $ip_4_end) + { + $banlist_ary[] = "$ip_1_counter.$ip_2_counter.$ip_3_counter.$ip_4_counter"; + $ip_4_counter++; + } + $ip_3_counter++; + } + $ip_2_counter++; + } + $ip_1_counter++; + } + } + else if (preg_match('#^([0-9]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})$#', trim($ban_item)) || preg_match('#^[a-f0-9:]+\*?$#i', trim($ban_item))) + { + // Normal IP address + $banlist_ary[] = trim($ban_item); + } + else if (preg_match('#^\*$#', trim($ban_item))) + { + // Ban all IPs + $banlist_ary[] = '*'; + } + else if (preg_match('#^([\w\-_]\.?){2,}$#is', trim($ban_item))) + { + // hostname + $ip_ary = gethostbynamel(trim($ban_item)); + + if (!empty($ip_ary)) + { + foreach ($ip_ary as $ip) + { + if ($ip) + { + if (strlen($ip) > 40) + { + continue; + } + + $banlist_ary[] = $ip; + } + } + } + } + + if (empty($banlist_ary)) + { + trigger_error('NO_IPS_DEFINED', E_USER_WARNING); + } + } + break; + + case 'email': + $type = 'ban_email'; + + foreach ($ban_list as $ban_item) + { + $ban_item = trim($ban_item); + + if (preg_match('#^.*?@*|(([a-z0-9\-]+\.)+([a-z]{2,3}))$#i', $ban_item)) + { + if (strlen($ban_item) > 100) + { + continue; + } + + if (!sizeof($founder) || !in_array($ban_item, $founder)) + { + $banlist_ary[] = $ban_item; + } + } + } + + if (sizeof($ban_list) == 0) + { + trigger_error('NO_EMAILS_DEFINED', E_USER_WARNING); + } + break; + + default: + trigger_error('NO_MODE', E_USER_WARNING); + break; + } + + // Fetch currently set bans of the specified type and exclude state. Prevent duplicate bans. + $sql_where = ($type == 'ban_userid') ? 'ban_userid <> 0' : "$type <> ''"; + + $sql = "SELECT $type + FROM " . BANLIST_TABLE . " + WHERE $sql_where + AND ban_exclude = " . (int) $ban_exclude; + $result = $db->sql_query($sql); + + // Reset $sql_where, because we use it later... + $sql_where = ''; + + if ($row = $db->sql_fetchrow($result)) + { + $banlist_ary_tmp = array(); + do + { + switch ($mode) + { + case 'user': + $banlist_ary_tmp[] = $row['ban_userid']; + break; + + case 'ip': + $banlist_ary_tmp[] = $row['ban_ip']; + break; + + case 'email': + $banlist_ary_tmp[] = $row['ban_email']; + break; + } + } + while ($row = $db->sql_fetchrow($result)); + + $banlist_ary_tmp = array_intersect($banlist_ary, $banlist_ary_tmp); + + if (sizeof($banlist_ary_tmp)) + { + // One or more entities are already banned/excluded, delete the existing bans, so they can be re-inserted with the given new length + $sql = 'DELETE FROM ' . BANLIST_TABLE . ' + WHERE ' . $db->sql_in_set($type, $banlist_ary_tmp) . ' + AND ban_exclude = ' . (int) $ban_exclude; + $db->sql_query($sql); + } + + unset($banlist_ary_tmp); + } + $db->sql_freeresult($result); + + // We have some entities to ban + if (sizeof($banlist_ary)) + { + $sql_ary = array(); + + foreach ($banlist_ary as $ban_entry) + { + $sql_ary[] = array( + $type => $ban_entry, + 'ban_start' => (int) $current_time, + 'ban_end' => (int) $ban_end, + 'ban_exclude' => (int) $ban_exclude, + 'ban_reason' => (string) $ban_reason, + 'ban_give_reason' => (string) $ban_give_reason, + ); + } + + $db->sql_multi_insert(BANLIST_TABLE, $sql_ary); + + // If we are banning we want to logout anyone matching the ban + if (!$ban_exclude) + { + switch ($mode) + { + case 'user': + $sql_where = 'WHERE ' . $db->sql_in_set('session_user_id', $banlist_ary); + break; + + case 'ip': + $sql_where = 'WHERE ' . $db->sql_in_set('session_ip', $banlist_ary); + break; + + case 'email': + $banlist_ary_sql = array(); + + foreach ($banlist_ary as $ban_entry) + { + $banlist_ary_sql[] = (string) str_replace('*', '%', $ban_entry); + } + + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_email', $banlist_ary_sql); + $result = $db->sql_query($sql); + + $sql_in = array(); + + if ($row = $db->sql_fetchrow($result)) + { + do + { + $sql_in[] = $row['user_id']; + } + while ($row = $db->sql_fetchrow($result)); + + $sql_where = 'WHERE ' . $db->sql_in_set('session_user_id', $sql_in); + } + $db->sql_freeresult($result); + break; + } + + if (isset($sql_where) && $sql_where) + { + $sql = 'DELETE FROM ' . SESSIONS_TABLE . " + $sql_where"; + $db->sql_query($sql); + + if ($mode == 'user') + { + $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' ' . ((in_array('*', $banlist_ary)) ? '' : 'WHERE ' . $db->sql_in_set('user_id', $banlist_ary)); + $db->sql_query($sql); + } + } + } + + // Update log + $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); + if ($mode == 'user') + { + foreach ($banlist_ary as $user_id) + { + add_log('user', $user_id, $log_entry . strtoupper($mode), $ban_reason, $ban_list_log); + } + } + + $cache->destroy('sql', BANLIST_TABLE); + + return true; + } + + // There was nothing to ban/exclude. But destroying the cache because of the removal of stale bans. + $cache->destroy('sql', BANLIST_TABLE); + + return false; +} + +/** +* Unban User +*/ +function user_unban($mode, $ban) +{ + global $db, $user, $auth, $cache; + + // Delete stale bans + $sql = 'DELETE FROM ' . BANLIST_TABLE . ' + WHERE ban_end < ' . time() . ' + AND ban_end <> 0'; + $db->sql_query($sql); + + if (!is_array($ban)) + { + $ban = array($ban); + } + + $unban_sql = array_map('intval', $ban); + + if (sizeof($unban_sql)) + { + // Grab details of bans for logging information later + switch ($mode) + { + case 'user': + $sql = 'SELECT u.username AS unban_info, u.user_id + FROM ' . USERS_TABLE . ' u, ' . BANLIST_TABLE . ' b + WHERE ' . $db->sql_in_set('b.ban_id', $unban_sql) . ' + AND u.user_id = b.ban_userid'; + break; + + case 'email': + $sql = 'SELECT ban_email AS unban_info + FROM ' . BANLIST_TABLE . ' + WHERE ' . $db->sql_in_set('ban_id', $unban_sql); + break; + + case 'ip': + $sql = 'SELECT ban_ip AS unban_info + FROM ' . BANLIST_TABLE . ' + WHERE ' . $db->sql_in_set('ban_id', $unban_sql); + break; + } + $result = $db->sql_query($sql); + + $l_unban_list = ''; + $user_ids_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $l_unban_list .= (($l_unban_list != '') ? ', ' : '') . $row['unban_info']; + if ($mode == 'user') + { + $user_ids_ary[] = $row['user_id']; + } + } + $db->sql_freeresult($result); + + $sql = 'DELETE FROM ' . BANLIST_TABLE . ' + WHERE ' . $db->sql_in_set('ban_id', $unban_sql); + $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); + if ($mode == 'user') + { + foreach ($user_ids_ary as $user_id) + { + add_log('user', $user_id, 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list); + } + } + } + + $cache->destroy('sql', BANLIST_TABLE); + + return false; +} + +/** +* Internet Protocol Address Whois +* RFC3912: WHOIS Protocol Specification +* +* @param string $ip Ip address, either IPv4 or IPv6. +* +* @return string Empty string if not a valid ip address. +* Otherwise make_clickable()'ed whois result. +*/ +function user_ipwhois($ip) +{ + if (empty($ip)) + { + return ''; + } + + if (preg_match(get_preg_expression('ipv4'), $ip)) + { + // IPv4 address + $whois_host = 'whois.arin.net.'; + } + else if (preg_match(get_preg_expression('ipv6'), $ip)) + { + // IPv6 address + $whois_host = 'whois.sixxs.net.'; + } + else + { + return ''; + } + + $ipwhois = ''; + + if (($fsk = @fsockopen($whois_host, 43))) + { + // CRLF as per RFC3912 + fputs($fsk, "$ip\r\n"); + while (!feof($fsk)) + { + $ipwhois .= fgets($fsk, 1024); + } + @fclose($fsk); + } + + $match = array(); + + // Test for referrals from $whois_host to other whois databases, roll on rwhois + if (preg_match('#ReferralServer: whois://(.+)#im', $ipwhois, $match)) + { + if (strpos($match[1], ':') !== false) + { + $pos = strrpos($match[1], ':'); + $server = substr($match[1], 0, $pos); + $port = (int) substr($match[1], $pos + 1); + unset($pos); + } + else + { + $server = $match[1]; + $port = 43; + } + + $buffer = ''; + + if (($fsk = @fsockopen($server, $port))) + { + fputs($fsk, "$ip\r\n"); + while (!feof($fsk)) + { + $buffer .= fgets($fsk, 1024); + } + @fclose($fsk); + } + + // Use the result from $whois_host if we don't get any result here + $ipwhois = (empty($buffer)) ? $ipwhois : $buffer; + } + + $ipwhois = htmlspecialchars($ipwhois); + + // Magic URL ;) + return trim(make_clickable($ipwhois, false, '')); +} + +/** +* Data validation ... used primarily but not exclusively by ucp modules +* +* "Master" function for validating a range of data types +*/ +function validate_data($data, $val_ary) +{ + global $user; + + $error = array(); + + foreach ($val_ary as $var => $val_seq) + { + if (!is_array($val_seq[0])) + { + $val_seq = array($val_seq); + } + + foreach ($val_seq as $validate) + { + $function = array_shift($validate); + array_unshift($validate, $data[$var]); + + if (is_array($function)) + { + $result = call_user_func_array(array($function[0], 'validate_' . $function[1]), $validate); + } + else + { + $function_prefix = (function_exists('phpbb_validate_' . $function)) ? 'phpbb_validate_' : 'validate_'; + $result = call_user_func_array($function_prefix . $function, $validate); + } + + if ($result) + { + // Since errors are checked later for their language file existence, we need to make sure custom errors are not adjusted. + $error[] = (empty($user->lang[$result . '_' . strtoupper($var)])) ? $result : $result . '_' . strtoupper($var); + } + } + } + + return $error; +} + +/** +* Validate String +* +* @return boolean|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) +*/ +function validate_string($string, $optional = false, $min = 0, $max = 0) +{ + if (empty($string) && $optional) + { + return false; + } + + if ($min && utf8_strlen(htmlspecialchars_decode($string)) < $min) + { + return 'TOO_SHORT'; + } + else if ($max && utf8_strlen(htmlspecialchars_decode($string)) > $max) + { + return 'TOO_LONG'; + } + + return false; +} + +/** +* Validate Number +* +* @return boolean|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) +*/ +function validate_num($num, $optional = false, $min = 0, $max = 1E99) +{ + if (empty($num) && $optional) + { + return false; + } + + if ($num < $min) + { + return 'TOO_SMALL'; + } + else if ($num > $max) + { + return 'TOO_LARGE'; + } + + return false; +} + +/** +* Validate Date +* @param String $string a date in the dd-mm-yyyy format +* @return boolean +*/ +function validate_date($date_string, $optional = false) +{ + $date = explode('-', $date_string); + if ((empty($date) || sizeof($date) != 3) && $optional) + { + return false; + } + else if ($optional) + { + for ($field = 0; $field <= 1; $field++) + { + $date[$field] = (int) $date[$field]; + if (empty($date[$field])) + { + $date[$field] = 1; + } + } + $date[2] = (int) $date[2]; + // assume an arbitrary leap year + if (empty($date[2])) + { + $date[2] = 1980; + } + } + + if (sizeof($date) != 3 || !checkdate($date[1], $date[0], $date[2])) + { + return 'INVALID'; + } + + return false; +} + + +/** +* Validate Match +* +* @return boolean|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) +*/ +function validate_match($string, $optional = false, $match = '') +{ + if (empty($string) && $optional) + { + return false; + } + + if (empty($match)) + { + return false; + } + + if (!preg_match($match, $string)) + { + return 'WRONG_DATA'; + } + + return false; +} + +/** +* Validate Language Pack ISO Name +* +* Tests whether a language name is valid and installed +* +* @param string $lang_iso The language string to test +* +* @return bool|string Either false if validation succeeded or +* a string which will be used as the error message +* (with the variable name appended) +*/ +function validate_language_iso_name($lang_iso) +{ + global $db; + + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE . " + WHERE lang_iso = '" . $db->sql_escape($lang_iso) . "'"; + $result = $db->sql_query($sql); + $lang_id = (int) $db->sql_fetchfield('lang_id'); + $db->sql_freeresult($result); + + return ($lang_id) ? false : 'WRONG_DATA'; +} + +/** +* Validate Timezone Name +* +* Tests whether a timezone name is valid +* +* @param string $timezone The timezone string to test +* +* @return bool|string Either false if validation succeeded or +* a string which will be used as the error message +* (with the variable name appended) +*/ +function phpbb_validate_timezone($timezone) +{ + return (in_array($timezone, phpbb_get_timezone_identifiers($timezone))) ? false : 'TIMEZONE_INVALID'; +} + +/** +* Check to see if the username has been taken, or if it is disallowed. +* Also checks if it includes the " character, which we don't allow in usernames. +* Used for registering, changing names, and posting anonymously with a username +* +* @param string $username The username to check +* @param string $allowed_username An allowed username, default being $user->data['username'] +* +* @return mixed Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) +*/ +function validate_username($username, $allowed_username = false) +{ + global $config, $db, $user, $cache; + + $clean_username = utf8_clean_string($username); + $allowed_username = ($allowed_username === false) ? $user->data['username_clean'] : utf8_clean_string($allowed_username); + + if ($allowed_username == $clean_username) + { + return false; + } + + // ... fast checks first. + if (strpos($username, '"') !== false || strpos($username, '"') !== false || empty($clean_username)) + { + 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]+'; + } + 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]+'; + } + break; + + case 'USERNAME_ASCII': + default: + $pcre = true; + $regex = '[\x01-\x7F]+'; + break; + } + + if ($pcre) + { + 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'; + } + } + + $sql = 'SELECT username + FROM ' . USERS_TABLE . " + WHERE username_clean = '" . $db->sql_escape($clean_username) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + return 'USERNAME_TAKEN'; + } + + $sql = 'SELECT group_name + FROM ' . GROUPS_TABLE . " + WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($username)) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + return 'USERNAME_TAKEN'; + } + + $bad_usernames = $cache->obtain_disallowed_usernames(); + + foreach ($bad_usernames as $bad_username) + { + if (preg_match('#^' . $bad_username . '$#', $clean_username)) + { + return 'USERNAME_DISALLOWED'; + } + } + + return false; +} + +/** +* Check to see if the password meets the complexity settings +* +* @return boolean|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) +*/ +function validate_password($password) +{ + global $config; + + if ($password === '' || $config['pass_complex'] === 'PASS_TYPE_ANY') + { + // Password empty or no password complexity required. + 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; + } + + $chars = array(); + + switch ($config['pass_complex']) + { + // No break statements below ... + // We require strong passwords in case pass_complex is not set or is invalid + default: + + // Require mixed case letters, numbers and symbols + case 'PASS_TYPE_SYMBOL': + $chars[] = $sym; + + // Require mixed case letters and numbers + case 'PASS_TYPE_ALPHA': + $chars[] = $num; + + // Require mixed case letters + case 'PASS_TYPE_CASE': + $chars[] = $low; + $chars[] = $upp; + } + + if ($pcre) + { + foreach ($chars as $char) + { + 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 false; +} + +/** +* Check to see if email address is a valid address and contains a MX record +* +* @param string $email The email to check +* +* @return mixed Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) +*/ +function phpbb_validate_email($email, $config = null) +{ + if ($config === null) + { + global $config; + } + + $email = strtolower($email); + + if (!preg_match('/^' . get_preg_expression('email') . '$/i', $email)) + { + return 'EMAIL_INVALID'; + } + + // Check MX record. + // The idea for this is from reading the UseBB blog/announcement. :) + if ($config['email_check_mx']) + { + list(, $domain) = explode('@', $email); + + if (phpbb_checkdnsrr($domain, 'A') === false && phpbb_checkdnsrr($domain, 'MX') === false) + { + return 'DOMAIN_NO_MX_RECORD'; + } + } + + return false; +} + +/** +* Check to see if email address is banned or already present in the DB +* +* @param string $email The email to check +* @param string $allowed_email An allowed email, default being $user->data['user_email'] +* +* @return mixed Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) +*/ +function validate_user_email($email, $allowed_email = false) +{ + global $config, $db, $user; + + $email = strtolower($email); + $allowed_email = ($allowed_email === false) ? strtolower($user->data['user_email']) : strtolower($allowed_email); + + if ($allowed_email == $email) + { + return false; + } + + $validate_email = phpbb_validate_email($email, $config); + if ($validate_email) + { + return $validate_email; + } + + if (($ban_reason = $user->check_ban(false, false, $email, true)) !== false) + { + return ($ban_reason === true) ? 'EMAIL_BANNED' : $ban_reason; + } + + if (!$config['allow_emailreuse']) + { + $sql = 'SELECT user_email_hash + FROM ' . USERS_TABLE . " + WHERE user_email_hash = " . $db->sql_escape(phpbb_email_hash($email)); + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + return 'EMAIL_TAKEN'; + } + } + + return false; +} + +/** +* Validate jabber address +* Taken from the jabber class within flyspray (see author notes) +* +* @author flyspray.org +*/ +function validate_jabber($jid) +{ + if (!$jid) + { + return false; + } + + $separator_pos = strpos($jid, '@'); + + if ($separator_pos === false) + { + return 'WRONG_DATA'; + } + + $username = substr($jid, 0, $separator_pos); + $realm = substr($jid, $separator_pos + 1); + + if (strlen($username) == 0 || strlen($realm) < 3) + { + return 'WRONG_DATA'; + } + + $arr = explode('.', $realm); + + if (sizeof($arr) == 0) + { + return 'WRONG_DATA'; + } + + foreach ($arr as $part) + { + if (substr($part, 0, 1) == '-' || substr($part, -1, 1) == '-') + { + return 'WRONG_DATA'; + } + + if (!preg_match("@^[a-zA-Z0-9-.]+$@", $part)) + { + return 'WRONG_DATA'; + } + } + + $boundary = array(array(0, 127), array(192, 223), array(224, 239), array(240, 247), array(248, 251), array(252, 253)); + + // Prohibited Characters RFC3454 + RFC3920 + $prohibited = array( + // Table C.1.1 + array(0x0020, 0x0020), // SPACE + // Table C.1.2 + array(0x00A0, 0x00A0), // NO-BREAK SPACE + array(0x1680, 0x1680), // OGHAM SPACE MARK + array(0x2000, 0x2001), // EN QUAD + array(0x2001, 0x2001), // EM QUAD + array(0x2002, 0x2002), // EN SPACE + array(0x2003, 0x2003), // EM SPACE + array(0x2004, 0x2004), // THREE-PER-EM SPACE + array(0x2005, 0x2005), // FOUR-PER-EM SPACE + array(0x2006, 0x2006), // SIX-PER-EM SPACE + array(0x2007, 0x2007), // FIGURE SPACE + array(0x2008, 0x2008), // PUNCTUATION SPACE + array(0x2009, 0x2009), // THIN SPACE + array(0x200A, 0x200A), // HAIR SPACE + array(0x200B, 0x200B), // ZERO WIDTH SPACE + array(0x202F, 0x202F), // NARROW NO-BREAK SPACE + array(0x205F, 0x205F), // MEDIUM MATHEMATICAL SPACE + array(0x3000, 0x3000), // IDEOGRAPHIC SPACE + // Table C.2.1 + array(0x0000, 0x001F), // [CONTROL CHARACTERS] + array(0x007F, 0x007F), // DELETE + // Table C.2.2 + array(0x0080, 0x009F), // [CONTROL CHARACTERS] + array(0x06DD, 0x06DD), // ARABIC END OF AYAH + array(0x070F, 0x070F), // SYRIAC ABBREVIATION MARK + array(0x180E, 0x180E), // MONGOLIAN VOWEL SEPARATOR + array(0x200C, 0x200C), // ZERO WIDTH NON-JOINER + array(0x200D, 0x200D), // ZERO WIDTH JOINER + array(0x2028, 0x2028), // LINE SEPARATOR + array(0x2029, 0x2029), // PARAGRAPH SEPARATOR + array(0x2060, 0x2060), // WORD JOINER + array(0x2061, 0x2061), // FUNCTION APPLICATION + array(0x2062, 0x2062), // INVISIBLE TIMES + array(0x2063, 0x2063), // INVISIBLE SEPARATOR + array(0x206A, 0x206F), // [CONTROL CHARACTERS] + array(0xFEFF, 0xFEFF), // ZERO WIDTH NO-BREAK SPACE + array(0xFFF9, 0xFFFC), // [CONTROL CHARACTERS] + array(0x1D173, 0x1D17A), // [MUSICAL CONTROL CHARACTERS] + // Table C.3 + array(0xE000, 0xF8FF), // [PRIVATE USE, PLANE 0] + array(0xF0000, 0xFFFFD), // [PRIVATE USE, PLANE 15] + array(0x100000, 0x10FFFD), // [PRIVATE USE, PLANE 16] + // Table C.4 + array(0xFDD0, 0xFDEF), // [NONCHARACTER CODE POINTS] + array(0xFFFE, 0xFFFF), // [NONCHARACTER CODE POINTS] + array(0x1FFFE, 0x1FFFF), // [NONCHARACTER CODE POINTS] + array(0x2FFFE, 0x2FFFF), // [NONCHARACTER CODE POINTS] + array(0x3FFFE, 0x3FFFF), // [NONCHARACTER CODE POINTS] + array(0x4FFFE, 0x4FFFF), // [NONCHARACTER CODE POINTS] + array(0x5FFFE, 0x5FFFF), // [NONCHARACTER CODE POINTS] + array(0x6FFFE, 0x6FFFF), // [NONCHARACTER CODE POINTS] + array(0x7FFFE, 0x7FFFF), // [NONCHARACTER CODE POINTS] + array(0x8FFFE, 0x8FFFF), // [NONCHARACTER CODE POINTS] + array(0x9FFFE, 0x9FFFF), // [NONCHARACTER CODE POINTS] + array(0xAFFFE, 0xAFFFF), // [NONCHARACTER CODE POINTS] + array(0xBFFFE, 0xBFFFF), // [NONCHARACTER CODE POINTS] + array(0xCFFFE, 0xCFFFF), // [NONCHARACTER CODE POINTS] + array(0xDFFFE, 0xDFFFF), // [NONCHARACTER CODE POINTS] + array(0xEFFFE, 0xEFFFF), // [NONCHARACTER CODE POINTS] + array(0xFFFFE, 0xFFFFF), // [NONCHARACTER CODE POINTS] + array(0x10FFFE, 0x10FFFF), // [NONCHARACTER CODE POINTS] + // Table C.5 + array(0xD800, 0xDFFF), // [SURROGATE CODES] + // Table C.6 + array(0xFFF9, 0xFFF9), // INTERLINEAR ANNOTATION ANCHOR + array(0xFFFA, 0xFFFA), // INTERLINEAR ANNOTATION SEPARATOR + array(0xFFFB, 0xFFFB), // INTERLINEAR ANNOTATION TERMINATOR + array(0xFFFC, 0xFFFC), // OBJECT REPLACEMENT CHARACTER + array(0xFFFD, 0xFFFD), // REPLACEMENT CHARACTER + // Table C.7 + array(0x2FF0, 0x2FFB), // [IDEOGRAPHIC DESCRIPTION CHARACTERS] + // Table C.8 + array(0x0340, 0x0340), // COMBINING GRAVE TONE MARK + array(0x0341, 0x0341), // COMBINING ACUTE TONE MARK + array(0x200E, 0x200E), // LEFT-TO-RIGHT MARK + array(0x200F, 0x200F), // RIGHT-TO-LEFT MARK + array(0x202A, 0x202A), // LEFT-TO-RIGHT EMBEDDING + array(0x202B, 0x202B), // RIGHT-TO-LEFT EMBEDDING + array(0x202C, 0x202C), // POP DIRECTIONAL FORMATTING + array(0x202D, 0x202D), // LEFT-TO-RIGHT OVERRIDE + array(0x202E, 0x202E), // RIGHT-TO-LEFT OVERRIDE + array(0x206A, 0x206A), // INHIBIT SYMMETRIC SWAPPING + array(0x206B, 0x206B), // ACTIVATE SYMMETRIC SWAPPING + array(0x206C, 0x206C), // INHIBIT ARABIC FORM SHAPING + array(0x206D, 0x206D), // ACTIVATE ARABIC FORM SHAPING + array(0x206E, 0x206E), // NATIONAL DIGIT SHAPES + array(0x206F, 0x206F), // NOMINAL DIGIT SHAPES + // Table C.9 + array(0xE0001, 0xE0001), // LANGUAGE TAG + array(0xE0020, 0xE007F), // [TAGGING CHARACTERS] + // RFC3920 + array(0x22, 0x22), // " + array(0x26, 0x26), // & + array(0x27, 0x27), // ' + array(0x2F, 0x2F), // / + array(0x3A, 0x3A), // : + array(0x3C, 0x3C), // < + array(0x3E, 0x3E), // > + array(0x40, 0x40) // @ + ); + + $pos = 0; + $result = true; + + while ($pos < strlen($username)) + { + $len = $uni = 0; + for ($i = 0; $i <= 5; $i++) + { + if (ord($username[$pos]) >= $boundary[$i][0] && ord($username[$pos]) <= $boundary[$i][1]) + { + $len = $i + 1; + $uni = (ord($username[$pos]) - $boundary[$i][0]) * pow(2, $i * 6); + + for ($k = 1; $k < $len; $k++) + { + $uni += (ord($username[$pos + $k]) - 128) * pow(2, ($i - $k) * 6); + } + + break; + } + } + + if ($len == 0) + { + return 'WRONG_DATA'; + } + + foreach ($prohibited as $pval) + { + if ($uni >= $pval[0] && $uni <= $pval[1]) + { + $result = false; + break 2; + } + } + + $pos = $pos + $len; + } + + if (!$result) + { + return 'WRONG_DATA'; + } + + return false; +} + +/** +* Validate hex colour value +* +* @param string $colour The hex colour value +* @param bool $optional Whether the colour value is optional. True if an empty +* string will be accepted as correct input, false if not. +* @return bool|string Error message if colour value is incorrect, false if it +* fits the hex colour code +*/ +function phpbb_validate_hex_colour($colour, $optional = false) +{ + if ($colour === '') + { + return (($optional) ? false : 'WRONG_DATA'); + } + + if (!preg_match('/^([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/', $colour)) + { + return 'WRONG_DATA'; + } + + return false; +} + +/** +* Verifies whether a style ID corresponds to an active style. +* +* @param int $style_id The style_id of a style which should be checked if activated or not. +* @return boolean +*/ +function phpbb_style_is_active($style_id) +{ + global $db; + + $sql = 'SELECT style_active + FROM ' . STYLES_TABLE . ' + WHERE style_id = '. (int) $style_id; + $result = $db->sql_query($sql); + + $style_is_active = (bool) $db->sql_fetchfield('style_active'); + $db->sql_freeresult($result); + + return $style_is_active; +} + +/** +* Remove avatar +*/ +function avatar_delete($mode, $row, $clean_db = false) +{ + global $phpbb_root_path, $config, $db, $user; + + // Check if the users avatar is actually *not* a group avatar + if ($mode == 'user') + { + if (strpos($row['user_avatar'], 'g') === 0 || (((int) $row['user_avatar'] !== 0) && ((int) $row['user_avatar'] !== (int) $row['user_id']))) + { + return false; + } + } + + if ($clean_db) + { + avatar_remove_db($row[$mode . '_avatar']); + } + $filename = get_avatar_filename($row[$mode . '_avatar']); + + if (file_exists($phpbb_root_path . $config['avatar_path'] . '/' . $filename)) + { + @unlink($phpbb_root_path . $config['avatar_path'] . '/' . $filename); + return true; + } + + return false; +} + +/** +* Generates avatar filename from the database entry +*/ +function get_avatar_filename($avatar_entry) +{ + global $config; + + if ($avatar_entry[0] === 'g') + { + $avatar_group = true; + $avatar_entry = substr($avatar_entry, 1); + } + else + { + $avatar_group = false; + } + $ext = substr(strrchr($avatar_entry, '.'), 1); + $avatar_entry = intval($avatar_entry); + return $config['avatar_salt'] . '_' . (($avatar_group) ? 'g' : '') . $avatar_entry . '.' . $ext; +} + +/** +* Returns an explanation string with maximum avatar settings +* +* @return string +*/ +function phpbb_avatar_explanation_string() +{ + global $config, $user; + + return $user->lang('AVATAR_EXPLAIN', + $user->lang('PIXELS', (int) $config['avatar_max_width']), + $user->lang('PIXELS', (int) $config['avatar_max_height']), + round($config['avatar_filesize'] / 1024)); +} + +// +// Usergroup functions +// + +/** +* Add or edit a group. If we're editing a group we only update user +* parameters such as rank, etc. if they are changed +*/ +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; + + $error = array(); + + // Attributes which also affect the users table + $user_attribute_ary = array('group_colour', 'group_rank', 'group_avatar', 'group_avatar_type', 'group_avatar_width', 'group_avatar_height'); + + // Check data. Limit group name length. + if (!utf8_strlen($name) || utf8_strlen($name) > 60) + { + $error[] = (!utf8_strlen($name)) ? $user->lang['GROUP_ERR_USERNAME'] : $user->lang['GROUP_ERR_USER_LONG']; + } + + $err = group_validate_groupname($group_id, $name); + if (!empty($err)) + { + $error[] = $user->lang[$err]; + } + + if (!in_array($type, array(GROUP_OPEN, GROUP_CLOSED, GROUP_HIDDEN, GROUP_SPECIAL, GROUP_FREE))) + { + $error[] = $user->lang['GROUP_ERR_TYPE']; + } + + $group_teampage = !empty($group_attributes['group_teampage']); + unset($group_attributes['group_teampage']); + + if (!sizeof($error)) + { + $current_legend = \phpbb\groupposition\legend::GROUP_DISABLED; + $current_teampage = \phpbb\groupposition\teampage::GROUP_DISABLED; + + $legend = $phpbb_container->get('groupposition.legend'); + $teampage = $phpbb_container->get('groupposition.teampage'); + if ($group_id) + { + try + { + $current_legend = $legend->get_group_value($group_id); + $current_teampage = $teampage->get_group_value($group_id); + } + catch (\phpbb\groupposition\exception $exception) + { + trigger_error($user->lang($exception->getMessage())); + } + } + + if (!empty($group_attributes['group_legend'])) + { + if (($group_id && ($current_legend == \phpbb\groupposition\legend::GROUP_DISABLED)) || !$group_id) + { + // Old group currently not in the legend or new group, add at the end. + $group_attributes['group_legend'] = 1 + $legend->get_group_count(); + } + else + { + // Group stayes in the legend + $group_attributes['group_legend'] = $current_legend; + } + } + else if ($group_id && ($current_legend != \phpbb\groupposition\legend::GROUP_DISABLED)) + { + // Group is removed from the legend + try + { + $legend->delete_group($group_id, true); + } + catch (\phpbb\groupposition\exception $exception) + { + trigger_error($user->lang($exception->getMessage())); + } + $group_attributes['group_legend'] = \phpbb\groupposition\legend::GROUP_DISABLED; + } + else + { + $group_attributes['group_legend'] = \phpbb\groupposition\legend::GROUP_DISABLED; + } + + // Unset the objects, we don't need them anymore. + unset($legend); + + $user_ary = array(); + $sql_ary = array( + 'group_name' => (string) $name, + 'group_desc' => (string) $desc, + 'group_desc_uid' => '', + 'group_desc_bitfield' => '', + 'group_type' => (int) $type, + ); + + // Parse description + if ($desc) + { + generate_text_for_storage($sql_ary['group_desc'], $sql_ary['group_desc_uid'], $sql_ary['group_desc_bitfield'], $sql_ary['group_desc_options'], $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies); + } + + if (sizeof($group_attributes)) + { + // Merge them with $sql_ary to properly update the group + $sql_ary = array_merge($sql_ary, $group_attributes); + } + + // Setting the log message before we set the group id (if group gets added) + $log = ($group_id) ? 'LOG_GROUP_UPDATED' : 'LOG_GROUP_CREATED'; + + $query = ''; + + if ($group_id) + { + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . ' + WHERE group_id = ' . $group_id; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $user_ary[] = $row['user_id']; + } + $db->sql_freeresult($result); + + if (isset($sql_ary['group_avatar'])) + { + remove_default_avatar($group_id, $user_ary); + } + + if (isset($sql_ary['group_rank'])) + { + remove_default_rank($group_id, $user_ary); + } + + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE group_id = $group_id"; + $db->sql_query($sql); + + // Since we may update the name too, we need to do this on other tables too... + $sql = 'UPDATE ' . MODERATOR_CACHE_TABLE . " + SET group_name = '" . $db->sql_escape($sql_ary['group_name']) . "' + WHERE group_id = $group_id"; + $db->sql_query($sql); + + // One special case is the group skip auth setting. If this was changed we need to purge permissions for this group + if (isset($group_attributes['group_skip_auth'])) + { + // Get users within this group... + $sql = 'SELECT user_id + FROM ' . USER_GROUP_TABLE . ' + WHERE group_id = ' . $group_id . ' + AND user_pending = 0'; + $result = $db->sql_query($sql); + + $user_id_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $user_id_ary[] = $row['user_id']; + } + $db->sql_freeresult($result); + + if (!empty($user_id_ary)) + { + global $auth; + + // Clear permissions cache of relevant users + $auth->acl_clear_prefetch($user_id_ary); + } + } + } + else + { + $sql = 'INSERT INTO ' . GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + } + + // Remove the group from the teampage, only if unselected and we are editing a group, + // which is currently displayed. + if (!$group_teampage && $group_id && $current_teampage != \phpbb\groupposition\teampage::GROUP_DISABLED) + { + try + { + $teampage->delete_group($group_id); + } + catch (\phpbb\groupposition\exception $exception) + { + trigger_error($user->lang($exception->getMessage())); + } + } + + if (!$group_id) + { + $group_id = $db->sql_nextid(); + + if (isset($sql_ary['group_avatar_type']) && $sql_ary['group_avatar_type'] == 'avatar.driver.upload') + { + group_correct_avatar($group_id, $sql_ary['group_avatar']); + } + } + + try + { + if ($group_teampage && $current_teampage == \phpbb\groupposition\teampage::GROUP_DISABLED) + { + $teampage->add_group($group_id); + } + + if ($group_teampage) + { + if ($current_teampage == \phpbb\groupposition\teampage::GROUP_DISABLED) + { + $teampage->add_group($group_id); + } + } + else if ($group_id && ($current_teampage != \phpbb\groupposition\teampage::GROUP_DISABLED)) + { + $teampage->delete_group($group_id); + } + } + catch (\phpbb\groupposition\exception $exception) + { + trigger_error($user->lang($exception->getMessage())); + } + unset($teampage); + + // Set user attributes + $sql_ary = array(); + if (sizeof($group_attributes)) + { + // Go through the user attributes array, check if a group attribute matches it and then set it. ;) + foreach ($user_attribute_ary as $attribute) + { + if (!isset($group_attributes[$attribute])) + { + continue; + } + + // If we are about to set an avatar, we will not overwrite user avatars if no group avatar is set... + if (strpos($attribute, 'group_avatar') === 0 && !$group_attributes[$attribute]) + { + continue; + } + + $sql_ary[$attribute] = $group_attributes[$attribute]; + } + } + + if (sizeof($sql_ary) && sizeof($user_ary)) + { + group_set_user_default($group_id, $user_ary, $sql_ary); + } + + $name = ($type == GROUP_SPECIAL) ? $user->lang['G_' . $name] : $name; + add_log('admin', $log, $name); + + group_update_listings($group_id); + } + + return (sizeof($error)) ? $error : false; +} + + +/** +* Changes a group avatar's filename to conform to the naming scheme +*/ +function group_correct_avatar($group_id, $old_entry) +{ + global $config, $db, $phpbb_root_path; + + $group_id = (int) $group_id; + $ext = substr(strrchr($old_entry, '.'), 1); + $old_filename = get_avatar_filename($old_entry); + $new_filename = $config['avatar_salt'] . "_g$group_id.$ext"; + $new_entry = 'g' . $group_id . '_' . substr(time(), -5) . ".$ext"; + + $avatar_path = $phpbb_root_path . $config['avatar_path']; + if (@rename($avatar_path . '/'. $old_filename, $avatar_path . '/' . $new_filename)) + { + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_avatar = \'' . $db->sql_escape($new_entry) . "' + WHERE group_id = $group_id"; + $db->sql_query($sql); + } +} + + +/** +* Remove avatar also for users not having the group as default +*/ +function avatar_remove_db($avatar_name) +{ + global $config, $db; + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_avatar = '', + user_avatar_type = '' + WHERE user_avatar = '" . $db->sql_escape($avatar_name) . '\''; + $db->sql_query($sql); +} + + +/** +* Group Delete +*/ +function group_delete($group_id, $group_name = false) +{ + global $db, $cache, $auth, $user, $phpbb_root_path, $phpEx, $phpbb_dispatcher, $phpbb_container; + + if (!$group_name) + { + $group_name = get_group_name($group_id); + } + + $start = 0; + + do + { + $user_id_ary = $username_ary = array(); + + // Batch query for group members, call group_user_del + $sql = 'SELECT u.user_id, u.username + FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . " u + WHERE ug.group_id = $group_id + AND u.user_id = ug.user_id"; + $result = $db->sql_query_limit($sql, 200, $start); + + if ($row = $db->sql_fetchrow($result)) + { + do + { + $user_id_ary[] = $row['user_id']; + $username_ary[] = $row['username']; + + $start++; + } + while ($row = $db->sql_fetchrow($result)); + + group_user_del($group_id, $user_id_ary, $username_ary, $group_name); + } + else + { + $start = 0; + } + $db->sql_freeresult($result); + } + while ($start); + + // Delete group from legend and teampage + try + { + $legend = $phpbb_container->get('groupposition.legend'); + $legend->delete_group($group_id); + unset($legend); + } + catch (\phpbb\groupposition\exception $exception) + { + // The group we want to delete does not exist. + // No reason to worry, we just continue the deleting process. + //trigger_error($user->lang($exception->getMessage())); + } + + try + { + $teampage = $phpbb_container->get('groupposition.teampage'); + $teampage->delete_group($group_id); + unset($teampage); + } + catch (\phpbb\groupposition\exception $exception) + { + // The group we want to delete does not exist. + // No reason to worry, we just continue the deleting process. + //trigger_error($user->lang($exception->getMessage())); + } + + // Delete group + $sql = 'DELETE FROM ' . GROUPS_TABLE . " + WHERE group_id = $group_id"; + $db->sql_query($sql); + + // Delete auth entries from the groups table + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . " + WHERE group_id = $group_id"; + $db->sql_query($sql); + + /** + * Event after a group is deleted + * + * @event core.delete_group_after + * @var int group_id ID of the deleted group + * @var string group_name Name of the deleted group + * @since 3.1.0-a1 + */ + $vars = array('group_id', 'group_name'); + extract($phpbb_dispatcher->trigger_event('core.delete_group_after', compact($vars))); + + // Re-cache moderators + if (!function_exists('phpbb_cache_moderators')) + { + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } + + phpbb_cache_moderators($db, $cache, $auth); + + add_log('admin', 'LOG_GROUP_DELETE', $group_name); + + // Return false - no error + return false; +} + +/** +* Add user(s) to group +* +* @return mixed false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER' +*/ +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; + + // We need both username and user_id info + $result = user_get_id_name($user_id_ary, $username_ary); + + if (!sizeof($user_id_ary) || $result !== false) + { + return 'NO_USER'; + } + + // Remove users who are already members of this group + $sql = 'SELECT user_id, group_leader + FROM ' . USER_GROUP_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $user_id_ary) . " + AND group_id = $group_id"; + $result = $db->sql_query($sql); + + $add_id_ary = $update_id_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $add_id_ary[] = (int) $row['user_id']; + + if ($leader && !$row['group_leader']) + { + $update_id_ary[] = (int) $row['user_id']; + } + } + $db->sql_freeresult($result); + + // Do all the users exist in this group? + $add_id_ary = array_diff($user_id_ary, $add_id_ary); + + // If we have no users + if (!sizeof($add_id_ary) && !sizeof($update_id_ary)) + { + return 'GROUP_USERS_EXIST'; + } + + $db->sql_transaction('begin'); + + // Insert the new users + if (sizeof($add_id_ary)) + { + $sql_ary = array(); + + foreach ($add_id_ary as $user_id) + { + $sql_ary[] = array( + 'user_id' => (int) $user_id, + 'group_id' => (int) $group_id, + 'group_leader' => (int) $leader, + 'user_pending' => (int) $pending, + ); + } + + $db->sql_multi_insert(USER_GROUP_TABLE, $sql_ary); + } + + if (sizeof($update_id_ary)) + { + $sql = 'UPDATE ' . USER_GROUP_TABLE . ' + SET group_leader = 1 + WHERE ' . $db->sql_in_set('user_id', $update_id_ary) . " + AND group_id = $group_id"; + $db->sql_query($sql); + } + + if ($default) + { + group_user_attributes('default', $group_id, $user_id_ary, false, $group_name, $group_attributes); + } + + $db->sql_transaction('commit'); + + // Clear permissions cache of relevant users + $auth->acl_clear_prefetch($user_id_ary); + + if (!$group_name) + { + $group_name = get_group_name($group_id); + } + + $log = ($leader) ? 'LOG_MODS_ADDED' : (($pending) ? 'LOG_USERS_PENDING' : 'LOG_USERS_ADDED'); + + add_log('admin', $log, $group_name, implode(', ', $username_ary)); + + group_update_listings($group_id); + + if ($pending) + { + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + foreach ($add_id_ary as $user_id) + { + $phpbb_notifications->add_notifications('notification.type.group_request', array( + 'group_id' => $group_id, + 'user_id' => $user_id, + 'group_name' => $group_name, + )); + } + } + + // Return false - no error + return false; +} + +/** +* Remove a user/s from a given group. When we remove users we update their +* default group_id. We do this by examining which "special" groups they belong +* to. The selection is made based on a reasonable priority system +* +* @return false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER' +*/ +function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false) +{ + global $db, $auth, $config, $phpbb_dispatcher, $phpbb_container; + + if ($config['coppa_enable']) + { + $group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'NEWLY_REGISTERED', 'REGISTERED_COPPA', 'REGISTERED', 'BOTS', 'GUESTS'); + } + else + { + $group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'NEWLY_REGISTERED', 'REGISTERED', 'BOTS', 'GUESTS'); + } + + // We need both username and user_id info + $result = user_get_id_name($user_id_ary, $username_ary); + + if (!sizeof($user_id_ary) || $result !== false) + { + return 'NO_USER'; + } + + $sql = 'SELECT * + FROM ' . GROUPS_TABLE . ' + WHERE ' . $db->sql_in_set('group_name', $group_order); + $result = $db->sql_query($sql); + + $group_order_id = $special_group_data = array(); + while ($row = $db->sql_fetchrow($result)) + { + $group_order_id[$row['group_name']] = $row['group_id']; + + $special_group_data[$row['group_id']] = array( + 'group_colour' => $row['group_colour'], + 'group_rank' => $row['group_rank'], + ); + + // Only set the group avatar if one is defined... + if ($row['group_avatar']) + { + $special_group_data[$row['group_id']] = array_merge($special_group_data[$row['group_id']], array( + 'group_avatar' => $row['group_avatar'], + 'group_avatar_type' => $row['group_avatar_type'], + 'group_avatar_width' => $row['group_avatar_width'], + 'group_avatar_height' => $row['group_avatar_height']) + ); + } + } + $db->sql_freeresult($result); + + // Get users default groups - we only need to reset default group membership if the group from which the user gets removed is set as default + $sql = 'SELECT user_id, group_id + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $user_id_ary); + $result = $db->sql_query($sql); + + $default_groups = array(); + while ($row = $db->sql_fetchrow($result)) + { + $default_groups[$row['user_id']] = $row['group_id']; + } + $db->sql_freeresult($result); + + // What special group memberships exist for these users? + $sql = 'SELECT g.group_id, g.group_name, ug.user_id + FROM ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g + WHERE ' . $db->sql_in_set('ug.user_id', $user_id_ary) . " + AND g.group_id = ug.group_id + AND g.group_id <> $group_id + AND g.group_type = " . GROUP_SPECIAL . ' + ORDER BY ug.user_id, g.group_id'; + $result = $db->sql_query($sql); + + $temp_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + if ($default_groups[$row['user_id']] == $group_id && (!isset($temp_ary[$row['user_id']]) || $group_order_id[$row['group_name']] < $temp_ary[$row['user_id']])) + { + $temp_ary[$row['user_id']] = $row['group_id']; + } + } + $db->sql_freeresult($result); + + // sql_where_ary holds the new default groups and their users + $sql_where_ary = array(); + foreach ($temp_ary as $uid => $gid) + { + $sql_where_ary[$gid][] = $uid; + } + unset($temp_ary); + + foreach ($special_group_data as $gid => $default_data_ary) + { + if (isset($sql_where_ary[$gid]) && sizeof($sql_where_ary[$gid])) + { + remove_default_rank($group_id, $sql_where_ary[$gid]); + remove_default_avatar($group_id, $sql_where_ary[$gid]); + group_set_user_default($gid, $sql_where_ary[$gid], $default_data_ary); + } + } + unset($special_group_data); + + /** + * Event before users are removed from a group + * + * @event core.group_delete_user_before + * @var int group_id ID of the group from which users are deleted + * @var string group_name Name of the group + * @var array user_id_ary IDs of the users which are removed + * @var array username_ary names of the users which are removed + * @since 3.1.0-a1 + */ + $vars = array('group_id', 'group_name', 'user_id_ary', 'username_ary'); + extract($phpbb_dispatcher->trigger_event('core.group_delete_user_before', compact($vars))); + + $sql = 'DELETE FROM ' . USER_GROUP_TABLE . " + WHERE group_id = $group_id + AND " . $db->sql_in_set('user_id', $user_id_ary); + $db->sql_query($sql); + + // Clear permissions cache of relevant users + $auth->acl_clear_prefetch($user_id_ary); + + if (!$group_name) + { + $group_name = get_group_name($group_id); + } + + $log = 'LOG_GROUP_REMOVE'; + + if ($group_name) + { + add_log('admin', $log, $group_name, implode(', ', $username_ary)); + } + + group_update_listings($group_id); + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + $phpbb_notifications->delete_notifications('notification.type.group_request', $user_id_ary, $group_id); + + // Return false - no error + return false; +} + + +/** +* Removes the group avatar of the default group from the users in user_ids who have that group as default. +*/ +function remove_default_avatar($group_id, $user_ids) +{ + global $db; + + if (!is_array($user_ids)) + { + $user_ids = array($user_ids); + } + if (empty($user_ids)) + { + return false; + } + + $user_ids = array_map('intval', $user_ids); + + $sql = 'SELECT * + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . (int) $group_id; + $result = $db->sql_query($sql); + if (!$row = $db->sql_fetchrow($result)) + { + $db->sql_freeresult($result); + return false; + } + $db->sql_freeresult($result); + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_avatar = '', + user_avatar_type = '', + user_avatar_width = 0, + user_avatar_height = 0 + WHERE group_id = " . (int) $group_id . " + AND user_avatar = '" . $db->sql_escape($row['group_avatar']) . "' + AND " . $db->sql_in_set('user_id', $user_ids); + + $db->sql_query($sql); +} + +/** +* Removes the group rank of the default group from the users in user_ids who have that group as default. +*/ +function remove_default_rank($group_id, $user_ids) +{ + global $db; + + if (!is_array($user_ids)) + { + $user_ids = array($user_ids); + } + if (empty($user_ids)) + { + return false; + } + + $user_ids = array_map('intval', $user_ids); + + $sql = 'SELECT * + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . (int) $group_id; + $result = $db->sql_query($sql); + if (!$row = $db->sql_fetchrow($result)) + { + $db->sql_freeresult($result); + return false; + } + $db->sql_freeresult($result); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_rank = 0 + WHERE group_id = ' . (int) $group_id . ' + AND user_rank <> 0 + AND user_rank = ' . (int) $row['group_rank'] . ' + AND ' . $db->sql_in_set('user_id', $user_ids); + $db->sql_query($sql); +} + +/** +* This is used to promote (to leader), demote or set as default a member/s +*/ +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; + + // We need both username and user_id info + $result = user_get_id_name($user_id_ary, $username_ary); + + if (!sizeof($user_id_ary) || $result !== false) + { + return 'NO_USERS'; + } + + if (!$group_name) + { + $group_name = get_group_name($group_id); + } + + switch ($action) + { + case 'demote': + case 'promote': + + $sql = 'SELECT user_id + FROM ' . USER_GROUP_TABLE . " + WHERE group_id = $group_id + AND user_pending = 1 + AND " . $db->sql_in_set('user_id', $user_id_ary); + $result = $db->sql_query_limit($sql, 1); + $not_empty = ($db->sql_fetchrow($result)); + $db->sql_freeresult($result); + if ($not_empty) + { + return 'NO_VALID_USERS'; + } + + $sql = 'UPDATE ' . USER_GROUP_TABLE . ' + SET group_leader = ' . (($action == 'promote') ? 1 : 0) . " + WHERE group_id = $group_id + AND user_pending = 0 + AND " . $db->sql_in_set('user_id', $user_id_ary); + $db->sql_query($sql); + + $log = ($action == 'promote') ? 'LOG_GROUP_PROMOTED' : 'LOG_GROUP_DEMOTED'; + break; + + case 'approve': + // Make sure we only approve those which are pending ;) + $sql = 'SELECT u.user_id, u.user_email, u.username, u.username_clean, u.user_notify_type, u.user_jabber, u.user_lang + FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug + WHERE ug.group_id = ' . $group_id . ' + AND ug.user_pending = 1 + AND ug.user_id = u.user_id + AND ' . $db->sql_in_set('ug.user_id', $user_id_ary); + $result = $db->sql_query($sql); + + $user_id_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $user_id_ary[] = $row['user_id']; + } + $db->sql_freeresult($result); + + if (!sizeof($user_id_ary)) + { + return false; + } + + $sql = 'UPDATE ' . USER_GROUP_TABLE . " + SET user_pending = 0 + WHERE group_id = $group_id + AND " . $db->sql_in_set('user_id', $user_id_ary); + $db->sql_query($sql); + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + $phpbb_notifications->add_notifications('notification.type.group_request_approved', array( + 'user_ids' => $user_id_ary, + 'group_id' => $group_id, + 'group_name' => $group_name, + )); + $phpbb_notifications->delete_notifications('notification.type.group_request', $user_id_ary, $group_id); + + $log = 'LOG_USERS_APPROVED'; + break; + + case 'default': + // We only set default group for approved members of the group + $sql = 'SELECT user_id + FROM ' . USER_GROUP_TABLE . " + WHERE group_id = $group_id + AND user_pending = 0 + AND " . $db->sql_in_set('user_id', $user_id_ary); + $result = $db->sql_query($sql); + + $user_id_ary = $username_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $user_id_ary[] = $row['user_id']; + } + $db->sql_freeresult($result); + + $result = user_get_id_name($user_id_ary, $username_ary); + if (!sizeof($user_id_ary) || $result !== false) + { + return 'NO_USERS'; + } + + $sql = 'SELECT user_id, group_id + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $user_id_ary, false, true); + $result = $db->sql_query($sql); + + $groups = array(); + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($groups[$row['group_id']])) + { + $groups[$row['group_id']] = array(); + } + $groups[$row['group_id']][] = $row['user_id']; + } + $db->sql_freeresult($result); + + foreach ($groups as $gid => $uids) + { + remove_default_rank($gid, $uids); + remove_default_avatar($gid, $uids); + } + group_set_user_default($group_id, $user_id_ary, $group_attributes); + $log = 'LOG_GROUP_DEFAULTS'; + break; + } + + // Clear permissions cache of relevant users + $auth->acl_clear_prefetch($user_id_ary); + + add_log('admin', $log, $group_name, implode(', ', $username_ary)); + + group_update_listings($group_id); + + return false; +} + +/** +* A small version of validate_username to check for a group name's existence. To be called directly. +*/ +function group_validate_groupname($group_id, $group_name) +{ + global $config, $db; + + $group_name = utf8_clean_string($group_name); + + if (!empty($group_id)) + { + $sql = 'SELECT group_name + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . (int) $group_id; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + return false; + } + + $allowed_groupname = utf8_clean_string($row['group_name']); + + if ($allowed_groupname == $group_name) + { + return false; + } + } + + $sql = 'SELECT group_name + FROM ' . GROUPS_TABLE . " + WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($group_name)) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + return 'GROUP_NAME_TAKEN'; + } + + return false; +} + +/** +* Set users default group +* +* @access private +*/ +function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false) +{ + global $phpbb_container, $db, $phpbb_dispatcher; + + if (empty($user_id_ary)) + { + return; + } + + $attribute_ary = array( + 'group_colour' => 'string', + 'group_rank' => 'int', + 'group_avatar' => 'string', + 'group_avatar_type' => 'string', + 'group_avatar_width' => 'int', + 'group_avatar_height' => 'int', + ); + + $sql_ary = array( + 'group_id' => $group_id + ); + + // Were group attributes passed to the function? If not we need to obtain them + if ($group_attributes === false) + { + $sql = 'SELECT ' . implode(', ', array_keys($attribute_ary)) . ' + FROM ' . GROUPS_TABLE . " + WHERE group_id = $group_id"; + $result = $db->sql_query($sql); + $group_attributes = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + foreach ($attribute_ary as $attribute => $type) + { + if (isset($group_attributes[$attribute])) + { + // If we are about to set an avatar or rank, we will not overwrite with empty, unless we are not actually changing the default group + if ((strpos($attribute, 'group_avatar') === 0 || strpos($attribute, 'group_rank') === 0) && !$group_attributes[$attribute]) + { + continue; + } + + settype($group_attributes[$attribute], $type); + $sql_ary[str_replace('group_', 'user_', $attribute)] = $group_attributes[$attribute]; + } + } + + $updated_sql_ary = $sql_ary; + + // Before we update the user attributes, we will update the rank for users that don't have a custom rank + if (isset($sql_ary['user_rank'])) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', array('user_rank' => $sql_ary['user_rank'])) . ' + WHERE user_rank = 0 + AND ' . $db->sql_in_set('user_id', $user_id_ary); + $db->sql_query($sql); + unset($sql_ary['user_rank']); + } + + // Before we update the user attributes, we will update the avatar for users that don't have a custom avatar + $avatar_options = array('user_avatar', 'user_avatar_type', 'user_avatar_height', 'user_avatar_width'); + + if (isset($sql_ary['user_avatar'])) + { + $avatar_sql_ary = array(); + foreach ($avatar_options as $avatar_option) + { + 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) . " + WHERE user_avatar = '' + AND " . $db->sql_in_set('user_id', $user_id_ary); + $db->sql_query($sql); + } + + // Remove the avatar options, as we already updated them + foreach ($avatar_options as $avatar_option) + { + unset($sql_ary[$avatar_option]); + } + + if (!empty($sql_ary)) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE ' . $db->sql_in_set('user_id', $user_id_ary); + $db->sql_query($sql); + } + + if (isset($sql_ary['user_colour'])) + { + // Update any cached colour information for these users + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET forum_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' + WHERE " . $db->sql_in_set('forum_last_poster_id', $user_id_ary); + $db->sql_query($sql); + + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_first_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' + WHERE " . $db->sql_in_set('topic_poster', $user_id_ary); + $db->sql_query($sql); + + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' + 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); + } + } + + // Make all values available for the event + $sql_ary = $updated_sql_ary; + + /** + * Event when the default group is set for an array of users + * + * @event core.user_set_default_group + * @var int group_id ID of the group + * @var array user_id_ary IDs of the users + * @var array group_attributes Group attributes which were changed + * @var array update_listing Update the list of moderators and foes + * @var array sql_ary User attributes which were changed + * @since 3.1.0-a1 + */ + $vars = array('group_id', 'user_id_ary', 'group_attributes', 'update_listing', 'sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.user_set_default_group', compact($vars))); + + if ($update_listing) + { + group_update_listings($group_id); + } + + // Because some tables/caches use usercolour-specific data we need to purge this here. + $phpbb_container->get('cache.driver')->destroy('sql', MODERATOR_CACHE_TABLE); +} + +/** +* Get group name +*/ +function get_group_name($group_id) +{ + global $db, $user; + + $sql = 'SELECT group_name, group_type + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . (int) $group_id; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row || ($row['group_type'] == GROUP_SPECIAL && empty($user->lang))) + { + return ''; + } + + return ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']; +} + +/** +* Obtain either the members of a specified group, the groups the specified user is subscribed to +* or checking if a specified user is in a specified group. This function does not return pending memberships. +* +* Note: Never use this more than once... first group your users/groups +*/ +function group_memberships($group_id_ary = false, $user_id_ary = false, $return_bool = false) +{ + global $db; + + if (!$group_id_ary && !$user_id_ary) + { + return true; + } + + if ($user_id_ary) + { + $user_id_ary = (!is_array($user_id_ary)) ? array($user_id_ary) : $user_id_ary; + } + + if ($group_id_ary) + { + $group_id_ary = (!is_array($group_id_ary)) ? array($group_id_ary) : $group_id_ary; + } + + $sql = 'SELECT ug.*, u.username, u.username_clean, u.user_email + FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u + WHERE ug.user_id = u.user_id + AND ug.user_pending = 0 AND '; + + if ($group_id_ary) + { + $sql .= ' ' . $db->sql_in_set('ug.group_id', $group_id_ary); + } + + if ($user_id_ary) + { + $sql .= ($group_id_ary) ? ' AND ' : ' '; + $sql .= $db->sql_in_set('ug.user_id', $user_id_ary); + } + + $result = ($return_bool) ? $db->sql_query_limit($sql, 1) : $db->sql_query($sql); + + $row = $db->sql_fetchrow($result); + + if ($return_bool) + { + $db->sql_freeresult($result); + return ($row) ? true : false; + } + + if (!$row) + { + return false; + } + + $return = array(); + + do + { + $return[] = $row; + } + while ($row = $db->sql_fetchrow($result)); + + $db->sql_freeresult($result); + + return $return; +} + +/** +* Re-cache moderators and foes if group has a_ or m_ permissions +*/ +function group_update_listings($group_id) +{ + global $db, $cache, $auth; + + $hold_ary = $auth->acl_group_raw_data($group_id, array('a_', 'm_')); + + if (!sizeof($hold_ary)) + { + return; + } + + $mod_permissions = $admin_permissions = false; + + foreach ($hold_ary as $g_id => $forum_ary) + { + foreach ($forum_ary as $forum_id => $auth_ary) + { + foreach ($auth_ary as $auth_option => $setting) + { + if ($mod_permissions && $admin_permissions) + { + break 3; + } + + if ($setting != ACL_YES) + { + continue; + } + + if ($auth_option == 'm_') + { + $mod_permissions = true; + } + + if ($auth_option == 'a_') + { + $admin_permissions = true; + } + } + } + } + + if ($mod_permissions) + { + if (!function_exists('phpbb_cache_moderators')) + { + global $phpbb_root_path, $phpEx; + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } + phpbb_cache_moderators($db, $cache, $auth); + } + + if ($mod_permissions || $admin_permissions) + { + if (!function_exists('phpbb_update_foes')) + { + global $phpbb_root_path, $phpEx; + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } + phpbb_update_foes($db, $auth, array($group_id)); + } +} + + + +/** +* Funtion to make a user leave the NEWLY_REGISTERED system group. +* @access public +* @param $user_id The id of the user to remove from the group +*/ +function remove_newly_registered($user_id, $user_data = false) +{ + global $db; + + if ($user_data === false) + { + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . $user_id; + $result = $db->sql_query($sql); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$user_row) + { + return false; + } + else + { + $user_data = $user_row; + } + } + + if (empty($user_data['user_new'])) + { + return false; + } + + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = 'NEWLY_REGISTERED' + AND group_type = " . GROUP_SPECIAL; + $result = $db->sql_query($sql); + $group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); + + if (!$group_id) + { + return false; + } + + // We need to call group_user_del here, because this function makes sure everything is correctly changed. + // A downside for a call within the session handler is that the language is not set up yet - so no log entry + group_user_del($group_id, $user_id); + + // Set user_new to 0 to let this not be triggered again + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new = 0 + WHERE user_id = ' . $user_id; + $db->sql_query($sql); + + // The new users group was the users default group? + if ($user_data['group_id'] == $group_id) + { + // Which group is now the users default one? + $sql = 'SELECT group_id + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . $user_id; + $result = $db->sql_query($sql); + $user_data['group_id'] = $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); + } + + return $user_data['group_id']; +} + +/** +* Gets user ids of currently banned registered users. +* +* @param array $user_ids Array of users' ids to check for banning, +* leave empty to get complete list of banned ids +* @param bool|int $ban_end Bool True to get users currently banned +* Bool False to only get permanently banned users +* Int Unix timestamp to get users banned until that time +* @return array Array of banned users' ids if any, empty array otherwise +*/ +function phpbb_get_banned_user_ids($user_ids = array(), $ban_end = true) +{ + global $db; + + $sql_user_ids = (!empty($user_ids)) ? $db->sql_in_set('ban_userid', $user_ids) : 'ban_userid <> 0'; + + // Get banned User ID's + // Ignore stale bans which were not wiped yet + $banned_ids_list = array(); + $sql = 'SELECT ban_userid + FROM ' . BANLIST_TABLE . " + WHERE $sql_user_ids + AND ban_exclude <> 1"; + + if ($ban_end === true) + { + // Banned currently + $sql .= " AND (ban_end > " . time() . ' + OR ban_end = 0)'; + } + else if ($ban_end === false) + { + // Permanently banned + $sql .= " AND ban_end = 0"; + } + else + { + // Banned until a specified time + $sql .= " AND (ban_end > " . (int) $ban_end . ' + OR ban_end = 0)'; + } + + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $user_id = (int) $row['ban_userid']; + $banned_ids_list[$user_id] = $user_id; + } + $db->sql_freeresult($result); + + return $banned_ids_list; +} + +/** +* Function for assigning a template var if the zebra module got included +*/ +function phpbb_module_zebra($mode, &$module_row) +{ + global $template; + + $template->assign_var('S_ZEBRA_ENABLED', true); + + if ($mode == 'friends') + { + $template->assign_var('S_ZEBRA_FRIENDS_ENABLED', true); + } + + if ($mode == 'foes') + { + $template->assign_var('S_ZEBRA_FOES_ENABLED', true); + } +} diff --git a/sources/phpBB/includes/hooks/index.php b/sources/phpBB/includes/hooks/index.php new file mode 100644 index 0000000..805e0ee --- /dev/null +++ b/sources/phpBB/includes/hooks/index.php @@ -0,0 +1,250 @@ + +* @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; +} + +/** +* phpBB Hook Class +*/ +class phpbb_hook +{ + /** + * Registered hooks + */ + var $hooks = array(); + + /** + * Results returned by functions called + */ + var $hook_result = array(); + + /** + * internal pointer + */ + var $current_hook = NULL; + + /** + * Initialize hook class. + * + * @param array $valid_hooks array containing the hookable functions/methods + */ + function phpbb_hook($valid_hooks) + { + foreach ($valid_hooks as $_null => $method) + { + $this->add_hook($method); + } + + if (function_exists('phpbb_hook_register')) + { + phpbb_hook_register($this); + } + } + + /** + * Register function/method to be called within hook + * This function is normally called by the modification/application to attach/register the functions. + * + * @param mixed $definition Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__) + * @param mixed $hook The replacement function/method to be called. Passing function name or array with object/class definition + * @param string $mode Specify the priority/chain mode. 'normal' -> hook gets appended to the chain. 'standalone' -> only the specified hook gets called - later hooks are not able to overwrite this (E_NOTICE is triggered then). 'first' -> hook is called as the first one within the chain. 'last' -> hook is called as the last one within the chain. + */ + function register($definition, $hook, $mode = 'normal') + { + $class = (!is_array($definition)) ? '__global' : $definition[0]; + $function = (!is_array($definition)) ? $definition : $definition[1]; + + // Method able to be hooked? + if (isset($this->hooks[$class][$function])) + { + switch ($mode) + { + case 'standalone': + if (!isset($this->hooks[$class][$function]['standalone'])) + { + $this->hooks[$class][$function] = array('standalone' => $hook); + } + else + { + trigger_error('Hook not able to be called standalone, previous hook already standalone.', E_NOTICE); + } + break; + + case 'first': + case 'last': + $this->hooks[$class][$function][$mode][] = $hook; + break; + + case 'normal': + default: + $this->hooks[$class][$function]['normal'][] = $hook; + break; + } + } + } + + /** + * Calling all functions/methods attached to a specified hook. + * Called by the function allowing hooks... + * + * @param mixed $definition Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__) + * @return bool False if no hook got executed, true otherwise + */ + function call_hook($definition) + { + $class = (!is_array($definition)) ? '__global' : $definition[0]; + $function = (!is_array($definition)) ? $definition : $definition[1]; + + if (!empty($this->hooks[$class][$function])) + { + // Developer tries to call a hooked function within the hooked function... + if ($this->current_hook !== NULL && $this->current_hook['class'] === $class && $this->current_hook['function'] === $function) + { + return false; + } + + // Call the hook with the arguments attached and store result + $arguments = func_get_args(); + $this->current_hook = array('class' => $class, 'function' => $function); + $arguments[0] = &$this; + + // Call the hook chain... + if (isset($this->hooks[$class][$function]['standalone'])) + { + $this->hook_result[$class][$function] = call_user_func_array($this->hooks[$class][$function]['standalone'], $arguments); + } + else + { + foreach (array('first', 'normal', 'last') as $mode) + { + if (!isset($this->hooks[$class][$function][$mode])) + { + continue; + } + + foreach ($this->hooks[$class][$function][$mode] as $hook) + { + $this->hook_result[$class][$function] = call_user_func_array($hook, $arguments); + } + } + } + + $this->current_hook = NULL; + return true; + } + + $this->current_hook = NULL; + return false; + } + + /** + * Get result from previously called functions/methods for the same hook + * + * @param mixed $definition Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__) + * @return mixed False if nothing returned if there is no result, else array('result' => ... ) + */ + function previous_hook_result($definition) + { + $class = (!is_array($definition)) ? '__global' : $definition[0]; + $function = (!is_array($definition)) ? $definition : $definition[1]; + + if (!empty($this->hooks[$class][$function]) && isset($this->hook_result[$class][$function])) + { + return array('result' => $this->hook_result[$class][$function]); + } + + return false; + } + + /** + * Check if the called functions/methods returned something. + * + * @param mixed $definition Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__) + * @return bool True if results are there, false if not + */ + function hook_return($definition) + { + $class = (!is_array($definition)) ? '__global' : $definition[0]; + $function = (!is_array($definition)) ? $definition : $definition[1]; + + if (!empty($this->hooks[$class][$function]) && isset($this->hook_result[$class][$function])) + { + return true; + } + + return false; + } + + /** + * Give actual result from called functions/methods back. + * + * @param mixed $definition Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__) + * @return mixed The result + */ + function hook_return_result($definition) + { + $class = (!is_array($definition)) ? '__global' : $definition[0]; + $function = (!is_array($definition)) ? $definition : $definition[1]; + + if (!empty($this->hooks[$class][$function]) && isset($this->hook_result[$class][$function])) + { + $result = $this->hook_result[$class][$function]; + unset($this->hook_result[$class][$function]); + return $result; + } + + return; + } + + /** + * Add new function to the allowed hooks. + * + * @param mixed $definition Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__) + */ + function add_hook($definition) + { + if (!is_array($definition)) + { + $definition = array('__global', $definition); + } + + $this->hooks[$definition[0]][$definition[1]] = array(); + } + + /** + * Remove function from the allowed hooks. + * + * @param mixed $definition Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__) + */ + function remove_hook($definition) + { + $class = (!is_array($definition)) ? '__global' : $definition[0]; + $function = (!is_array($definition)) ? $definition : $definition[1]; + + if (isset($this->hooks[$class][$function])) + { + unset($this->hooks[$class][$function]); + + if (isset($this->hook_result[$class][$function])) + { + unset($this->hook_result[$class][$function]); + } + } + } +} diff --git a/sources/phpBB/includes/index.htm b/sources/phpBB/includes/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/includes/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/includes/mcp/info/mcp_ban.php b/sources/phpBB/includes/mcp/info/mcp_ban.php new file mode 100644 index 0000000..4aedbc8 --- /dev/null +++ b/sources/phpBB/includes/mcp/info/mcp_ban.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class mcp_ban_info +{ + function module() + { + 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')), + 'email' => array('title' => 'MCP_BAN_EMAILS', 'auth' => 'acl_m_ban', 'cat' => array('MCP_BAN')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/mcp/info/mcp_logs.php b/sources/phpBB/includes/mcp/info/mcp_logs.php new file mode 100644 index 0000000..c6482c1 --- /dev/null +++ b/sources/phpBB/includes/mcp/info/mcp_logs.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class mcp_logs_info +{ + function module() + { + 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')), + 'topic_logs' => array('title' => 'MCP_LOGS_TOPIC_VIEW', 'auth' => 'acl_m_,$id', 'cat' => array('MCP_LOGS')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/mcp/info/mcp_main.php b/sources/phpBB/includes/mcp/info/mcp_main.php new file mode 100644 index 0000000..81ccdbd --- /dev/null +++ b/sources/phpBB/includes/mcp/info/mcp_main.php @@ -0,0 +1,38 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class mcp_main_info +{ + function module() + { + 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')), + 'topic_view' => array('title' => 'MCP_MAIN_TOPIC_VIEW', 'auth' => 'acl_m_,$id', 'cat' => array('MCP_MAIN')), + 'post_details' => array('title' => 'MCP_MAIN_POST_DETAILS', 'auth' => 'acl_m_,$id || (!$id && aclf_m_)', 'cat' => array('MCP_MAIN')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/mcp/info/mcp_notes.php b/sources/phpBB/includes/mcp/info/mcp_notes.php new file mode 100644 index 0000000..4b8c255 --- /dev/null +++ b/sources/phpBB/includes/mcp/info/mcp_notes.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class mcp_notes_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/mcp/info/mcp_pm_reports.php b/sources/phpBB/includes/mcp/info/mcp_pm_reports.php new file mode 100644 index 0000000..8670b71 --- /dev/null +++ b/sources/phpBB/includes/mcp/info/mcp_pm_reports.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class mcp_pm_reports_info +{ + function module() + { + 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')), + 'pm_report_details' => array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/mcp/info/mcp_queue.php b/sources/phpBB/includes/mcp/info/mcp_queue.php new file mode 100644 index 0000000..556c390 --- /dev/null +++ b/sources/phpBB/includes/mcp/info/mcp_queue.php @@ -0,0 +1,39 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class mcp_queue_info +{ + function module() + { + 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')), + 'deleted_topics' => array('title' => 'MCP_QUEUE_DELETED_TOPICS', 'auth' => 'aclf_m_approve', 'cat' => array('MCP_QUEUE')), + 'deleted_posts' => array('title' => 'MCP_QUEUE_DELETED_POSTS', 'auth' => 'aclf_m_approve', 'cat' => array('MCP_QUEUE')), + 'approve_details' => array('title' => 'MCP_QUEUE_APPROVE_DETAILS', 'auth' => 'acl_m_approve,$id || (!$id && aclf_m_approve)', 'cat' => array('MCP_QUEUE')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/mcp/info/mcp_reports.php b/sources/phpBB/includes/mcp/info/mcp_reports.php new file mode 100644 index 0000000..31fee19 --- /dev/null +++ b/sources/phpBB/includes/mcp/info/mcp_reports.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class mcp_reports_info +{ + function module() + { + 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')), + 'report_details' => array('title' => 'MCP_REPORT_DETAILS', 'auth' => 'acl_m_report,$id || (!$id && aclf_m_report)', 'cat' => array('MCP_REPORTS')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/mcp/info/mcp_warn.php b/sources/phpBB/includes/mcp/info/mcp_warn.php new file mode 100644 index 0000000..d85499f --- /dev/null +++ b/sources/phpBB/includes/mcp/info/mcp_warn.php @@ -0,0 +1,38 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class mcp_warn_info +{ + function module() + { + 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')), + 'warn_user' => array('title' => 'MCP_WARN_USER', 'auth' => 'aclf_m_warn', 'cat' => array('MCP_WARN')), + 'warn_post' => array('title' => 'MCP_WARN_POST', 'auth' => 'acl_m_warn && acl_f_read,$id', 'cat' => array('MCP_WARN')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/mcp/mcp_ban.php b/sources/phpBB/includes/mcp/mcp_ban.php new file mode 100644 index 0000000..4d2151f --- /dev/null +++ b/sources/phpBB/includes/mcp/mcp_ban.php @@ -0,0 +1,295 @@ + +* @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; +} + +class mcp_ban +{ + var $u_action; + + function main($id, $mode) + { + global $db, $user, $auth, $template, $request, $phpbb_dispatcher; + global $phpbb_root_path, $phpEx; + + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + // Include the admin banning interface... + include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx); + + $bansubmit = $request->is_set_post('bansubmit'); + $unbansubmit = $request->is_set_post('unbansubmit'); + + $user->add_lang(array('acp/ban', 'acp/users')); + $this->tpl_name = 'mcp_ban'; + + /** + * Use this event to pass perform actions when a ban is issued or revoked + * + * @event core.mcp_ban_main + * @var bool bansubmit True if a ban is issued + * @var bool unbansubmit True if a ban is removed + * @var string mode Mode of the ban that is being worked on + * @since 3.1.0-RC5 + */ + $vars = array( + 'bansubmit', + 'unbansubmit', + 'mode', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_ban_main', compact($vars))); + + // Ban submitted? + if ($bansubmit) + { + // Grab the list of entries + $ban = $request->variable('ban', '', $mode === 'user'); + $ban_length = $request->variable('banlength', 0); + $ban_length_other = $request->variable('banlengthother', ''); + $ban_exclude = $request->variable('banexclude', 0); + $ban_reason = $request->variable('banreason', '', true); + $ban_give_reason = $request->variable('bangivereason', '', true); + + if ($ban) + { + if (confirm_box(true)) + { + $abort_ban = false; + /** + * Use this event to modify the ban details before the ban is performed + * + * @event core.mcp_ban_before + * @var string mode One of the following: user, ip, email + * @var string ban Either string or array with usernames, ips or email addresses + * @var int ban_length Ban length in minutes + * @var string ban_length_other Ban length as a date (YYYY-MM-DD) + * @var bool ban_exclude Are we banning or excluding from another ban + * @var string ban_reason Ban reason displayed to moderators + * @var string ban_give_reason Ban reason displayed to the banned user + * @var mixed abort_ban Either false, or an error message that is displayed to the user. + * If a string is given the bans are not issued. + * @since 3.1.0-RC5 + */ + $vars = array( + 'mode', + 'ban', + 'ban_length', + 'ban_length_other', + 'ban_exclude', + 'ban_reason', + 'ban_give_reason', + 'abort_ban', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_ban_before', compact($vars))); + + if ($abort_ban) + { + trigger_error($abort_ban); + } + user_ban($mode, $ban, $ban_length, $ban_length_other, $ban_exclude, $ban_reason, $ban_give_reason); + + /** + * Use this event to perform actions after the ban has been performed + * + * @event core.mcp_ban_after + * @var string mode One of the following: user, ip, email + * @var string ban Either string or array with usernames, ips or email addresses + * @var int ban_length Ban length in minutes + * @var string ban_length_other Ban length as a date (YYYY-MM-DD) + * @var bool ban_exclude Are we banning or excluding from another ban + * @var string ban_reason Ban reason displayed to moderators + * @var string ban_give_reason Ban reason displayed to the banned user + * @since 3.1.0-RC5 + */ + $vars = array( + 'mode', + 'ban', + 'ban_length', + 'ban_length_other', + 'ban_exclude', + 'ban_reason', + 'ban_give_reason', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_ban_after', compact($vars))); + + trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . '

« ' . $user->lang['BACK_TO_PREV'] . ''); + } + else + { + $hidden_fields = array( + 'mode' => $mode, + 'ban' => $ban, + 'bansubmit' => true, + 'banlength' => $ban_length, + 'banlengthother' => $ban_length_other, + 'banexclude' => $ban_exclude, + 'banreason' => $ban_reason, + 'bangivereason' => $ban_give_reason, + ); + + /** + * Use this event to pass data from the ban form to the confirmation screen + * + * @event core.mcp_ban_confirm + * @var array hidden_fields Hidden fields that are passed through the confirm screen + * @since 3.1.0-RC5 + */ + $vars = array('hidden_fields'); + extract($phpbb_dispatcher->trigger_event('core.mcp_ban_confirm', compact($vars))); + + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($hidden_fields)); + } + } + } + else if ($unbansubmit) + { + $ban = $request->variable('unban', array('')); + + if ($ban) + { + if (confirm_box(true)) + { + user_unban($mode, $ban); + + trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . '

« ' . $user->lang['BACK_TO_PREV'] . ''); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'mode' => $mode, + 'unbansubmit' => true, + 'unban' => $ban))); + } + } + } + + // Ban length options + $ban_end_text = array(0 => $user->lang['PERMANENT'], 30 => $user->lang['30_MINS'], 60 => $user->lang['1_HOUR'], 360 => $user->lang['6_HOURS'], 1440 => $user->lang['1_DAY'], 10080 => $user->lang['7_DAYS'], 20160 => $user->lang['2_WEEKS'], 40320 => $user->lang['1_MONTH'], -1 => $user->lang['UNTIL'] . ' -> '); + + $ban_end_options = ''; + foreach ($ban_end_text as $length => $text) + { + $ban_end_options .= ''; + } + + // Define language vars + $this->page_title = $user->lang[strtoupper($mode) . '_BAN']; + + $l_ban_explain = $user->lang[strtoupper($mode) . '_BAN_EXPLAIN']; + $l_ban_exclude_explain = $user->lang[strtoupper($mode) . '_BAN_EXCLUDE_EXPLAIN']; + $l_unban_title = $user->lang[strtoupper($mode) . '_UNBAN']; + $l_unban_explain = $user->lang[strtoupper($mode) . '_UNBAN_EXPLAIN']; + $l_no_ban_cell = $user->lang[strtoupper($mode) . '_NO_BANNED']; + + switch ($mode) + { + case 'user': + $l_ban_cell = $user->lang['USERNAME']; + break; + + case 'ip': + $l_ban_cell = $user->lang['IP_HOSTNAME']; + break; + + case 'email': + $l_ban_cell = $user->lang['EMAIL_ADDRESS']; + break; + } + + acp_ban::display_ban_options($mode); + + $template->assign_vars(array( + 'L_TITLE' => $this->page_title, + 'L_EXPLAIN' => $l_ban_explain, + 'L_UNBAN_TITLE' => $l_unban_title, + 'L_UNBAN_EXPLAIN' => $l_unban_explain, + 'L_BAN_CELL' => $l_ban_cell, + 'L_BAN_EXCLUDE_EXPLAIN' => $l_ban_exclude_explain, + 'L_NO_BAN_CELL' => $l_no_ban_cell, + + 'S_USERNAME_BAN' => ($mode == 'user') ? true : false, + + 'U_ACTION' => $this->u_action, + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_ban&field=ban'), + )); + + if ($mode === 'email' && !$auth->acl_get('a_user')) + { + return; + } + + // As a "service" we will check if any post id is specified and populate the username of the poster id if given + $post_id = $request->variable('p', 0); + $user_id = $request->variable('u', 0); + $pre_fill = false; + + if ($user_id && $user_id <> ANONYMOUS) + { + $sql = 'SELECT username, user_email, user_ip + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . $user_id; + $result = $db->sql_query($sql); + switch ($mode) + { + case 'user': + $pre_fill = (string) $db->sql_fetchfield('username'); + break; + + case 'ip': + $pre_fill = (string) $db->sql_fetchfield('user_ip'); + break; + + case 'email': + $pre_fill = (string) $db->sql_fetchfield('user_email'); + break; + } + $db->sql_freeresult($result); + } + else if ($post_id) + { + $post_info = phpbb_get_post_data($post_id, 'm_ban'); + + if (sizeof($post_info) && !empty($post_info[$post_id])) + { + switch ($mode) + { + case 'user': + $pre_fill = $post_info[$post_id]['username']; + break; + + case 'ip': + $pre_fill = $post_info[$post_id]['poster_ip']; + break; + + case 'email': + $pre_fill = $post_info[$post_id]['user_email']; + break; + } + + } + } + + if ($pre_fill) + { + // left for legacy template compatibility + $template->assign_var('USERNAMES', $pre_fill); + $template->assign_var('BAN_QUANTIFIER', $pre_fill); + } + } +} diff --git a/sources/phpBB/includes/mcp/mcp_forum.php b/sources/phpBB/includes/mcp/mcp_forum.php new file mode 100644 index 0000000..c18ca1a --- /dev/null +++ b/sources/phpBB/includes/mcp/mcp_forum.php @@ -0,0 +1,498 @@ + +* @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; +} + +/** +* MCP Forum View +*/ +function mcp_forum_view($id, $mode, $action, $forum_info) +{ + global $template, $db, $user, $auth, $cache, $module; + global $phpEx, $phpbb_root_path, $config; + global $request, $phpbb_dispatcher, $phpbb_container; + + $user->add_lang(array('viewtopic', 'viewforum')); + + include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx); + + // merge_topic is the quickmod action, merge_topics is the mcp_forum action, and merge_select is the mcp_topic action + $merge_select = ($action == 'merge_select' || $action == 'merge_topic' || $action == 'merge_topics') ? true : false; + + if ($merge_select) + { + // Fixes a "bug" that makes forum_view use the same ordering as topic_view + $request->overwrite('sk', null); + $request->overwrite('sd', null); + $request->overwrite('sk', null, \phpbb\request\request_interface::POST); + $request->overwrite('sd', null, \phpbb\request\request_interface::POST); + } + + $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); + + $url_extra = ''; + $url_extra .= ($forum_id) ? "&f=$forum_id" : ''; + $url_extra .= ($GLOBALS['topic_id']) ? '&t=' . $GLOBALS['topic_id'] : ''; + $url_extra .= ($GLOBALS['post_id']) ? '&p=' . $GLOBALS['post_id'] : ''; + $url_extra .= ($GLOBALS['user_id']) ? '&u=' . $GLOBALS['user_id'] : ''; + + $url = append_sid("{$phpbb_root_path}mcp.$phpEx?$url_extra"); + + // Resync Topics + switch ($action) + { + case 'resync': + $topic_ids = request_var('topic_id_list', array(0)); + mcp_resync_topics($topic_ids); + break; + + case 'merge_topics': + $source_topic_ids = $topic_id_list; + case 'merge_topic': + if ($to_topic_id) + { + merge_topics($forum_id, $source_topic_ids, $to_topic_id); + } + break; + } + + $pagination = $phpbb_container->get('pagination'); + + $selected_ids = ''; + if (sizeof($post_id_list) && $action != 'merge_topics') + { + foreach ($post_id_list as $num => $post_id) + { + $selected_ids .= '&post_id_list[' . $num . ']=' . $post_id; + } + } + else if (sizeof($topic_id_list) && $action == 'merge_topics') + { + foreach ($topic_id_list as $num => $topic_id) + { + $selected_ids .= '&topic_id_list[' . $num . ']=' . $topic_id; + } + } + + make_jumpbox($url . "&i=$id&action=$action&mode=$mode" . (($merge_select) ? $selected_ids : ''), $forum_id, false, 'm_', true); + + $topics_per_page = ($forum_info['forum_topics_per_page']) ? $forum_info['forum_topics_per_page'] : $config['topics_per_page']; + + $sort_days = $total = 0; + $sort_key = $sort_dir = ''; + $sort_by_sql = $sort_order_sql = array(); + phpbb_mcp_sorting('viewforum', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id); + + $forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total; + $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : ''; + + $base_url = $url . "&i=$id&action=$action&mode=$mode&sd=$sort_dir&sk=$sort_key&st=$sort_days" . (($merge_select) ? $selected_ids : ''); + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $forum_topics, $topics_per_page, $start); + + $template->assign_vars(array( + 'ACTION' => $action, + 'FORUM_NAME' => $forum_info['forum_name'], + 'FORUM_DESCRIPTION' => generate_text_for_display($forum_info['forum_desc'], $forum_info['forum_desc_uid'], $forum_info['forum_desc_bitfield'], $forum_info['forum_desc_options']), + + 'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'), + 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'), + 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), + 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'), + + 'S_CAN_REPORT' => $auth->acl_get('m_report', $forum_id), + 'S_CAN_DELETE' => $auth->acl_get('m_delete', $forum_id), + 'S_CAN_RESTORE' => $auth->acl_get('m_approve', $forum_id), + 'S_CAN_MERGE' => $auth->acl_get('m_merge', $forum_id), + 'S_CAN_MOVE' => $auth->acl_get('m_move', $forum_id), + 'S_CAN_FORK' => $auth->acl_get('m_', $forum_id), + 'S_CAN_LOCK' => $auth->acl_get('m_lock', $forum_id), + '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_STICKY' => $auth->acl_get('f_sticky', $forum_id), + 'S_CAN_MAKE_ANNOUNCE' => $auth->acl_get('f_announce', $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&mode=forum_logs&f=' . $forum_id) : '', + + 'S_MCP_ACTION' => $url . "&i=$id&forum_action=$action&mode=$mode&start=$start" . (($merge_select) ? $selected_ids : ''), + + 'TOTAL_TOPICS' => $user->lang('VIEW_FORUM_TOPICS', (int) $forum_topics), + )); + + // Grab icons + $icons = $cache->obtain_icons(); + + $topic_rows = array(); + + if ($config['load_db_lastread']) + { + $read_tracking_join = ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')'; + $read_tracking_select = ', tt.mark_time'; + } + else + { + $read_tracking_join = $read_tracking_select = ''; + } + + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + + $sql = 'SELECT t.topic_id + FROM ' . TOPICS_TABLE . ' t + WHERE t.forum_id = ' . $forum_id . ' + AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.') . " + $limit_time_sql + ORDER BY t.topic_type DESC, $sort_order_sql"; + + /** + * Modify SQL query before MCP forum view topic list is queried + * + * @event core.mcp_view_forum_modify_sql + * @var string sql SQL query for forum view topic list + * @var int forum_id ID of the forum + * @var string limit_time_sql SQL query part for limit time + * @var string sort_order_sql SQL query part for sort order + * @var int topics_per_page Number of topics per page + * @var int start Start value + * @since 3.1.2-RC1 + */ + $vars = array('sql', 'forum_id', 'limit_time_sql', 'sort_order_sql', 'topics_per_page', 'start'); + extract($phpbb_dispatcher->trigger_event('core.mcp_view_forum_modify_sql', compact($vars))); + + $result = $db->sql_query_limit($sql, $topics_per_page, $start); + + $topic_list = $topic_tracking_info = array(); + + while ($row = $db->sql_fetchrow($result)) + { + $topic_list[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + $sql = "SELECT t.*$read_tracking_select + FROM " . TOPICS_TABLE . " t $read_tracking_join + WHERE " . $db->sql_in_set('t.topic_id', $topic_list, false, true); + + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $topic_rows[$row['topic_id']] = $row; + } + $db->sql_freeresult($result); + + // If there is more than one page, but we have no topic list, then the start parameter is... erm... out of sync + if (!sizeof($topic_list) && $forum_topics && $start > 0) + { + redirect($url . "&i=$id&action=$action&mode=$mode"); + } + + // Get topic tracking info + if (sizeof($topic_list)) + { + if ($config['load_db_lastread']) + { + $topic_tracking_info = get_topic_tracking($forum_id, $topic_list, $topic_rows, array($forum_id => $forum_info['mark_time'])); + } + else + { + $topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_list); + } + } + + foreach ($topic_list as $topic_id) + { + $topic_title = ''; + + $row = &$topic_rows[$topic_id]; + + $replies = $phpbb_content_visibility->get_count('topic_posts', $row, $forum_id) - 1; + + if ($row['topic_status'] == ITEM_MOVED) + { + $unread_topic = false; + } + else + { + $unread_topic = (isset($topic_tracking_info[$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false; + } + + // Get folder img, topic status/type related information + $folder_img = $folder_alt = $topic_type = ''; + topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type); + + $topic_title = censor_text($row['topic_title']); + + $topic_unapproved = (($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false; + $posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false; + $topic_deleted = $row['topic_visibility'] == ITEM_DELETED; + $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? $url . '&i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . '&t=' . $row['topic_id'] : ''; + $u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? $url . '&i=queue&mode=deleted_topics&t=' . $topic_id : $u_mcp_queue; + + $topic_row = array( + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + 'TOPIC_IMG_STYLE' => $folder_img, + 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), + 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', + 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', + 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '', + 'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '', + 'DELETED_IMG' => ($topic_deleted) ? $user->img('icon_topic_deleted', 'POSTS_DELETED') : '', + + 'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'TOPIC_AUTHOR_FULL' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + + 'LAST_POST_AUTHOR' => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + + 'TOPIC_TYPE' => $topic_type, + 'TOPIC_TITLE' => $topic_title, + 'REPLIES' => $phpbb_content_visibility->get_count('topic_posts', $row, $row['forum_id']) - 1, + 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), + 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), + 'LAST_POST_SUBJECT' => $row['topic_last_post_subject'], + 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), + + 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && empty($row['topic_moved_id']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false, + 'S_TOPIC_UNAPPROVED' => $topic_unapproved, + 'S_POSTS_UNAPPROVED' => $posts_unapproved, + 'S_TOPIC_DELETED' => $topic_deleted, + 'S_UNREAD_TOPIC' => $unread_topic, + ); + + if ($row['topic_status'] == ITEM_MOVED) + { + $topic_row = array_merge($topic_row, array( + 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_moved_id']}"), + 'U_DELETE_TOPIC' => ($auth->acl_get('m_delete', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&f=$forum_id&topic_id_list[]={$row['topic_id']}&mode=forum_view&action=delete_topic") : '', + 'S_MOVED_TOPIC' => true, + 'TOPIC_ID' => $row['topic_moved_id'], + )); + } + else + { + if ($action == 'merge_topic' || $action == 'merge_topics') + { + $u_select_topic = $url . "&i=$id&mode=forum_view&action=$action&to_topic_id=" . $row['topic_id'] . $selected_ids; + } + else + { + $u_select_topic = $url . "&i=$id&mode=topic_view&action=merge&to_topic_id=" . $row['topic_id'] . $selected_ids; + } + $topic_row = array_merge($topic_row, array( + 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&f=$forum_id&t={$row['topic_id']}&mode=topic_view"), + + 'S_SELECT_TOPIC' => ($merge_select && !in_array($row['topic_id'], $source_topic_ids)) ? true : false, + 'U_SELECT_TOPIC' => $u_select_topic, + 'U_MCP_QUEUE' => $u_mcp_queue, + 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=topic_view&t=' . $row['topic_id'] . '&action=reports') : '', + 'TOPIC_ID' => $row['topic_id'], + 'S_TOPIC_CHECKED' => ($topic_id_list && in_array($row['topic_id'], $topic_id_list)) ? true : false, + )); + } + + /** + * Modify the topic data before it is assigned to the template in MCP + * + * @event core.mcp_view_forum_modify_topicrow + * @var array row Array with topic data + * @var array topic_row Template array with topic data + * @since 3.1.0-a1 + */ + $vars = array('row', 'topic_row'); + extract($phpbb_dispatcher->trigger_event('core.mcp_view_forum_modify_topicrow', compact($vars))); + + $template->assign_block_vars('topicrow', $topic_row); + } + unset($topic_rows); +} + +/** +* Resync topics +*/ +function mcp_resync_topics($topic_ids) +{ + global $auth, $db, $template, $phpEx, $user, $phpbb_root_path; + + if (!sizeof($topic_ids)) + { + trigger_error('NO_TOPIC_SELECTED'); + } + + if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_'))) + { + return; + } + + // Sync everything and perform extra checks separately + sync('topic_reported', 'topic_id', $topic_ids, false, true); + sync('topic_attachment', 'topic_id', $topic_ids, false, true); + sync('topic', 'topic_id', $topic_ids, true, false); + + $sql = 'SELECT topic_id, forum_id, topic_title + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_ids); + $result = $db->sql_query($sql); + + // Log this action + while ($row = $db->sql_fetchrow($result)) + { + add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_TOPIC_RESYNC', $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']); + + meta_refresh(3, $redirect); + trigger_error($msg . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); + + return; +} + +/** +* Merge selected topics into selected topic +*/ +function merge_topics($forum_id, $topic_ids, $to_topic_id) +{ + global $db, $template, $user, $phpEx, $phpbb_root_path, $auth; + + if (!sizeof($topic_ids)) + { + $template->assign_var('MESSAGE', $user->lang['NO_TOPIC_SELECTED']); + return; + } + if (!$to_topic_id) + { + $template->assign_var('MESSAGE', $user->lang['NO_FINAL_TOPIC_SELECTED']); + return; + } + + $sync_topics = array_merge($topic_ids, array($to_topic_id)); + + $topic_data = phpbb_get_topic_data($sync_topics, 'm_merge'); + + if (!sizeof($topic_data) || empty($topic_data[$to_topic_id])) + { + $template->assign_var('MESSAGE', $user->lang['NO_FINAL_TOPIC_SELECTED']); + return; + } + + $sync_forums = array(); + foreach ($topic_data as $data) + { + $sync_forums[$data['forum_id']] = $data['forum_id']; + } + + $topic_data = $topic_data[$to_topic_id]; + + $post_id_list = request_var('post_id_list', array(0)); + $start = request_var('start', 0); + + if (!sizeof($post_id_list) && sizeof($topic_ids)) + { + $sql = 'SELECT post_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_ids); + $result = $db->sql_query($sql); + + $post_id_list = array(); + while ($row = $db->sql_fetchrow($result)) + { + $post_id_list[] = $row['post_id']; + } + $db->sql_freeresult($result); + } + + if (!sizeof($post_id_list)) + { + $template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']); + return; + } + + if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_merge'))) + { + return; + } + + $redirect = request_var('redirect', build_url(array('quickmod'))); + + $s_hidden_fields = build_hidden_fields(array( + 'i' => 'main', + 'f' => $forum_id, + 'post_id_list' => $post_id_list, + 'to_topic_id' => $to_topic_id, + 'mode' => 'forum_view', + 'action' => 'merge_topics', + 'start' => $start, + 'redirect' => $redirect, + 'topic_id_list' => $topic_ids) + ); + $success_msg = $return_link = ''; + + if (confirm_box(true)) + { + $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']); + + // Message and return links + $success_msg = 'POSTS_MERGED_SUCCESS'; + + if (!function_exists('phpbb_update_rows_avoiding_duplicates_notify_status')) + { + include($phpbb_root_path . 'includes/functions_database_helper.' . $phpEx); + } + + // Update the topic watch table. + phpbb_update_rows_avoiding_duplicates_notify_status($db, TOPICS_WATCH_TABLE, 'topic_id', $topic_ids, $to_topic_id); + + // Update the bookmarks table. + phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', $topic_ids, $to_topic_id); + + // Re-sync the topics and forums because the auto-sync was deactivated in the call of move_posts() + sync('topic_reported', 'topic_id', $sync_topics); + sync('topic_attachment', 'topic_id', $sync_topics); + sync('topic', 'topic_id', $sync_topics, true); + sync('forum', 'forum_id', $sync_forums, true, true); + + // Link to the new topic + $return_link .= (($return_link) ? '

' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '', ''); + $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); + $redirect = reapply_sid($redirect); + + meta_refresh(3, $redirect); + trigger_error($user->lang[$success_msg] . '

' . $return_link); + } + else + { + confirm_box(false, 'MERGE_TOPICS', $s_hidden_fields); + } +} diff --git a/sources/phpBB/includes/mcp/mcp_front.php b/sources/phpBB/includes/mcp/mcp_front.php new file mode 100644 index 0000000..ebcf7ce --- /dev/null +++ b/sources/phpBB/includes/mcp/mcp_front.php @@ -0,0 +1,360 @@ + +* @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; +} + +/** +* MCP Front Panel +*/ +function mcp_front_view($id, $mode, $action) +{ + global $phpEx, $phpbb_root_path, $config; + global $template, $db, $user, $auth, $module; + global $phpbb_dispatcher; + + // Latest 5 unapproved + if ($module->loaded('queue')) + { + $forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))); + $post_list = array(); + $forum_names = array(); + + $forum_id = request_var('f', 0); + + $template->assign_var('S_SHOW_UNAPPROVED', (!empty($forum_list)) ? true : false); + + if (!empty($forum_list)) + { + $sql = 'SELECT COUNT(post_id) AS total + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_list) . ' + AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)); + $result = $db->sql_query($sql); + $total = (int) $db->sql_fetchfield('total'); + $db->sql_freeresult($result); + + if ($total) + { + $sql = 'SELECT forum_id, forum_name + FROM ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_list); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_names[$row['forum_id']] = $row['forum_name']; + } + $db->sql_freeresult($result); + + $sql = 'SELECT post_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_list) . ' + AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) . ' + ORDER BY post_time DESC, post_id DESC'; + $result = $db->sql_query_limit($sql, 5); + + while ($row = $db->sql_fetchrow($result)) + { + $post_list[] = $row['post_id']; + } + $db->sql_freeresult($result); + + if (empty($post_list)) + { + $total = 0; + } + } + + /** + * Alter list of posts and total as required + * + * @event core.mcp_front_view_queue_postid_list_after + * @var int total Number of unapproved posts + * @var array post_list List of unapproved posts + * @var array forum_list List of forums that contain the posts + * @var array forum_names Associative array with forum_id as key and it's corresponding forum_name as value + * @since 3.1.0-RC3 + */ + $vars = array('total', 'post_list', 'forum_list', 'forum_names'); + extract($phpbb_dispatcher->trigger_event('core.mcp_front_view_queue_postid_list_after', compact($vars))); + + if ($total) + { + $sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.post_attachment, p.poster_id, p.post_username, u.username, u.username_clean, u.user_colour, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u + WHERE ' . $db->sql_in_set('p.post_id', $post_list) . ' + AND t.topic_id = p.topic_id + AND p.poster_id = u.user_id + ORDER BY p.post_time DESC, p.post_id DESC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('unapproved', array( + 'U_POST_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $row['forum_id'] . '&p=' . $row['post_id']), + 'U_MCP_FORUM' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=forum_view&f=' . $row['forum_id']), + 'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=topic_view&f=' . $row['forum_id'] . '&t=' . $row['topic_id']), + 'U_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']), + 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']), + + 'AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour']), + 'AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour']), + 'AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour']), + 'U_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour']), + + 'FORUM_NAME' => $forum_names[$row['forum_id']], + 'POST_ID' => $row['post_id'], + 'TOPIC_TITLE' => $row['topic_title'], + 'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'], + 'POST_TIME' => $user->format_date($row['post_time']), + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + )); + } + $db->sql_freeresult($result); + } + + $s_hidden_fields = build_hidden_fields(array( + 'redirect' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main' . (($forum_id) ? '&f=' . $forum_id : '')) + )); + + $template->assign_vars(array( + 'S_HIDDEN_FIELDS' => $s_hidden_fields, + 'S_MCP_QUEUE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue"), + 'L_UNAPPROVED_TOTAL' => $user->lang('UNAPPROVED_POSTS_TOTAL', (int) $total), + 'S_HAS_UNAPPROVED_POSTS'=> ($total != 0), + )); + } + } + + // Latest 5 reported + if ($module->loaded('reports')) + { + $forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_report'))); + + $template->assign_var('S_SHOW_REPORTS', (!empty($forum_list)) ? true : false); + + if (!empty($forum_list)) + { + $sql = 'SELECT COUNT(r.report_id) AS total + FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p + WHERE r.post_id = p.post_id + AND r.pm_id = 0 + AND r.report_closed = 0 + AND ' . $db->sql_in_set('p.forum_id', $forum_list); + $result = $db->sql_query($sql); + $total = (int) $db->sql_fetchfield('total'); + $db->sql_freeresult($result); + + if ($total) + { + $sql_ary = array( + 'SELECT' => 'r.report_time, p.post_id, p.post_subject, p.post_time, p.post_attachment, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id, t.topic_id, t.topic_title, f.forum_id, f.forum_name', + + 'FROM' => array( + REPORTS_TABLE => 'r', + REPORTS_REASONS_TABLE => 'rr', + TOPICS_TABLE => 't', + USERS_TABLE => array('u', 'u2'), + POSTS_TABLE => 'p', + ), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(FORUMS_TABLE => 'f'), + 'ON' => 'f.forum_id = p.forum_id', + ), + ), + + 'WHERE' => 'r.post_id = p.post_id + AND r.pm_id = 0 + AND r.report_closed = 0 + AND r.reason_id = rr.reason_id + AND p.topic_id = t.topic_id + AND r.user_id = u.user_id + AND p.poster_id = u2.user_id + AND ' . $db->sql_in_set('p.forum_id', $forum_list), + + 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC', + ); + + /** + * Alter sql query to get latest reported posts + * + * @event core.mcp_front_reports_listing_query_before + * @var int sql_ary Associative array with the query to be executed + * @var array forum_list List of forums that contain the posts + * @since 3.1.0-RC3 + */ + $vars = array('sql_ary', 'forum_list'); + extract($phpbb_dispatcher->trigger_event('core.mcp_front_reports_listing_query_before', compact($vars))); + + $sql = $db->sql_build_query('SELECT', $sql_ary); + $result = $db->sql_query_limit($sql, 5); + + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('report', array( + 'U_POST_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&p=' . $row['post_id'] . "&i=reports&mode=report_details"), + 'U_MCP_FORUM' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . "&i=$id&mode=forum_view"), + 'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'] . "&i=$id&mode=topic_view"), + 'U_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']), + 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']), + + 'REPORTER_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'REPORTER' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), + 'REPORTER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), + 'U_REPORTER' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), + + 'AUTHOR_FULL' => get_username_string('full', $row['author_id'], $row['author_name'], $row['author_colour']), + 'AUTHOR' => get_username_string('username', $row['author_id'], $row['author_name'], $row['author_colour']), + 'AUTHOR_COLOUR' => get_username_string('colour', $row['author_id'], $row['author_name'], $row['author_colour']), + 'U_AUTHOR' => get_username_string('profile', $row['author_id'], $row['author_name'], $row['author_colour']), + + 'FORUM_NAME' => $row['forum_name'], + 'TOPIC_TITLE' => $row['topic_title'], + 'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'], + 'REPORT_TIME' => $user->format_date($row['report_time']), + 'POST_TIME' => $user->format_date($row['post_time']), + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + )); + } + } + + $template->assign_vars(array( + 'L_REPORTS_TOTAL' => $user->lang('REPORTS_TOTAL', (int) $total), + 'S_HAS_REPORTS' => ($total != 0), + )); + } + } + + // Latest 5 reported PMs + if ($module->loaded('pm_reports') && $auth->acl_getf_global('m_report')) + { + $template->assign_var('S_SHOW_PM_REPORTS', true); + $user->add_lang(array('ucp')); + + $sql = 'SELECT COUNT(r.report_id) AS total + FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . ' p + WHERE r.post_id = 0 + AND r.pm_id = p.msg_id + AND r.report_closed = 0'; + $result = $db->sql_query($sql); + $total = (int) $db->sql_fetchfield('total'); + $db->sql_freeresult($result); + + if ($total) + { + include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + + $sql_ary = array( + 'SELECT' => 'r.report_id, r.report_time, p.msg_id, p.message_subject, p.message_time, p.to_address, p.bcc_address, p.message_attachment, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id', + + 'FROM' => array( + REPORTS_TABLE => 'r', + REPORTS_REASONS_TABLE => 'rr', + USERS_TABLE => array('u', 'u2'), + PRIVMSGS_TABLE => 'p', + ), + + 'WHERE' => 'r.pm_id = p.msg_id + AND r.post_id = 0 + AND r.report_closed = 0 + AND r.reason_id = rr.reason_id + AND r.user_id = u.user_id + AND p.author_id = u2.user_id', + + 'ORDER_BY' => 'p.message_time DESC', + ); + $sql = $db->sql_build_query('SELECT', $sql_ary); + $result = $db->sql_query_limit($sql, 5); + + $pm_by_id = $pm_list = array(); + while ($row = $db->sql_fetchrow($result)) + { + $pm_by_id[(int) $row['msg_id']] = $row; + $pm_list[] = (int) $row['msg_id']; + } + + $address_list = get_recipient_strings($pm_by_id); + + foreach ($pm_list as $message_id) + { + $row = $pm_by_id[$message_id]; + + $template->assign_block_vars('pm_report', array( + 'U_PM_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'r=' . $row['report_id'] . "&i=pm_reports&mode=pm_report_details"), + + 'REPORTER_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'REPORTER' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), + 'REPORTER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), + 'U_REPORTER' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), + + 'PM_AUTHOR_FULL' => get_username_string('full', $row['author_id'], $row['author_name'], $row['author_colour']), + 'PM_AUTHOR' => get_username_string('username', $row['author_id'], $row['author_name'], $row['author_colour']), + 'PM_AUTHOR_COLOUR' => get_username_string('colour', $row['author_id'], $row['author_name'], $row['author_colour']), + 'U_PM_AUTHOR' => get_username_string('profile', $row['author_id'], $row['author_name'], $row['author_colour']), + + 'PM_SUBJECT' => $row['message_subject'], + 'REPORT_TIME' => $user->format_date($row['report_time']), + 'PM_TIME' => $user->format_date($row['message_time']), + 'RECIPIENTS' => implode(', ', $address_list[$row['msg_id']]), + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $row['message_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + )); + } + } + + $template->assign_vars(array( + 'L_PM_REPORTS_TOTAL' => $user->lang('PM_REPORTS_TOTAL', (int) $total), + 'S_HAS_PM_REPORTS' => ($total != 0), + )); + } + + // Latest 5 logs + if ($module->loaded('logs')) + { + $forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_'))); + + if (!empty($forum_list)) + { + $log_count = false; + $log = array(); + view_log('mod', $log, $log_count, 5, 0, $forum_list); + + foreach ($log as $row) + { + $template->assign_block_vars('log', array( + 'USERNAME' => $row['username_full'], + 'IP' => $row['ip'], + 'TIME' => $user->format_date($row['time']), + 'ACTION' => $row['action'], + 'U_VIEW_TOPIC' => (!empty($row['viewtopic'])) ? $row['viewtopic'] : '', + 'U_VIEWLOGS' => (!empty($row['viewlogs'])) ? $row['viewlogs'] : '') + ); + } + } + + $template->assign_vars(array( + 'S_SHOW_LOGS' => (!empty($forum_list)) ? true : false, + 'S_HAS_LOGS' => (!empty($log)) ? true : false) + ); + } + + $template->assign_var('S_MCP_ACTION', append_sid("{$phpbb_root_path}mcp.$phpEx")); + make_jumpbox(append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=forum_view'), 0, false, 'm_', true); +} diff --git a/sources/phpBB/includes/mcp/mcp_logs.php b/sources/phpBB/includes/mcp/mcp_logs.php new file mode 100644 index 0000000..9c76f0d --- /dev/null +++ b/sources/phpBB/includes/mcp/mcp_logs.php @@ -0,0 +1,227 @@ + +* @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; +} + +/** +* mcp_logs +* Handling warning the users +*/ +class mcp_logs +{ + var $u_action; + var $p_master; + + function mcp_logs(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($id, $mode) + { + global $auth, $db, $user, $template; + global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_log; + + $user->add_lang('acp/common'); + + $action = request_var('action', array('' => '')); + + if (is_array($action)) + { + list($action, ) = each($action); + } + else + { + $action = request_var('action', ''); + } + + // Set up general vars + $start = request_var('start', 0); + $deletemark = ($action == 'del_marked') ? true : false; + $deleteall = ($action == 'del_all') ? true : false; + $marked = request_var('mark', array(0)); + + // Sort keys + $sort_days = request_var('st', 0); + $sort_key = request_var('sk', 't'); + $sort_dir = request_var('sd', 'd'); + + $this->tpl_name = 'mcp_logs'; + $this->page_title = 'MCP_LOGS'; + + $pagination = $phpbb_container->get('pagination'); + + $forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_'))); + $forum_list[] = 0; + + $forum_id = $topic_id = 0; + + switch ($mode) + { + case 'front': + break; + + case 'forum_logs': + $forum_id = request_var('f', 0); + + if (!in_array($forum_id, $forum_list)) + { + trigger_error('NOT_AUTHORISED'); + } + + $forum_list = array($forum_id); + break; + + case 'topic_logs': + $topic_id = request_var('t', 0); + + $sql = 'SELECT forum_id + FROM ' . TOPICS_TABLE . ' + WHERE topic_id = ' . $topic_id; + $result = $db->sql_query($sql); + $forum_id = (int) $db->sql_fetchfield('forum_id'); + $db->sql_freeresult($result); + + if (!in_array($forum_id, $forum_list)) + { + trigger_error('NOT_AUTHORISED'); + } + + $forum_list = array($forum_id); + break; + } + + // Delete entries if requested and able + if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) + { + if (confirm_box(true)) + { + if ($deletemark && sizeof($marked)) + { + $conditions = array( + 'forum_id' => array('IN' => $forum_list), + 'log_id' => array('IN' => $marked), + ); + + $phpbb_log->delete('mod', $conditions); + } + else if ($deleteall) + { + $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); + + $conditions = array( + 'forum_id' => array('IN' => $forum_list), + 'keywords' => $keywords, + ); + + if ($sort_days) + { + $conditions['log_time'] = array('>=', time() - ($sort_days * 86400)); + } + + if ($mode == 'topic_logs') + { + $conditions['topic_id'] = $topic_id; + } + + $phpbb_log->delete('mod', $conditions); + } + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'f' => $forum_id, + 't' => $topic_id, + 'start' => $start, + 'delmarked' => $deletemark, + 'delall' => $deleteall, + 'mark' => $marked, + 'st' => $sort_days, + 'sk' => $sort_key, + 'sd' => $sort_dir, + 'i' => $id, + 'mode' => $mode, + 'action' => request_var('action', array('' => '')))) + ); + } + } + + // 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']); + $sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']); + $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); + + $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); + + // Define where and sort sql for use in displaying 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_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; + + // Grab log data + $log_data = array(); + $log_count = 0; + $start = view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort, $keywords); + + $base_url = $this->u_action . "&$u_sort_param$keywords_param"; + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $log_count, $config['topics_per_page'], $start); + + $template->assign_vars(array( + 'TOTAL' => $user->lang('TOTAL_LOGS', (int) $log_count), + + 'L_TITLE' => $user->lang['MCP_LOGS'], + + 'U_POST_ACTION' => $this->u_action . "&$u_sort_param$keywords_param&start=$start", + 'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false, + 'S_SELECT_SORT_DIR' => $s_sort_dir, + 'S_SELECT_SORT_KEY' => $s_sort_key, + 'S_SELECT_SORT_DAYS' => $s_limit_days, + 'S_LOGS' => ($log_count > 0), + 'S_KEYWORDS' => $keywords, + ) + ); + + foreach ($log_data as $row) + { + $data = array(); + + $checks = array('viewtopic', 'viewforum'); + foreach ($checks as $check) + { + if (isset($row[$check]) && $row[$check]) + { + $data[] = '' . $user->lang['LOGVIEW_' . strtoupper($check)] . ''; + } + } + + $template->assign_block_vars('log', array( + 'USERNAME' => $row['username_full'], + 'IP' => $row['ip'], + 'DATE' => $user->format_date($row['time']), + 'ACTION' => $row['action'], + 'DATA' => (sizeof($data)) ? implode(' | ', $data) : '', + 'ID' => $row['id'], + ) + ); + } + } +} diff --git a/sources/phpBB/includes/mcp/mcp_main.php b/sources/phpBB/includes/mcp/mcp_main.php new file mode 100644 index 0000000..227ae84 --- /dev/null +++ b/sources/phpBB/includes/mcp/mcp_main.php @@ -0,0 +1,1515 @@ + +* @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; +} + +/** +* mcp_main +* Handling mcp actions +*/ +class mcp_main +{ + var $p_master; + var $u_action; + + function mcp_main(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($id, $mode) + { + global $auth, $db, $user, $template, $action; + global $config, $phpbb_root_path, $phpEx, $request; + global $phpbb_dispatcher; + + $quickmod = ($mode == 'quickmod') ? true : false; + + switch ($action) + { + case 'lock': + case 'unlock': + $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0)); + + if (!sizeof($topic_ids)) + { + trigger_error('NO_TOPIC_SELECTED'); + } + + lock_unlock($action, $topic_ids); + break; + + case 'lock_post': + case 'unlock_post': + + $post_ids = (!$quickmod) ? request_var('post_id_list', array(0)) : array(request_var('p', 0)); + + if (!sizeof($post_ids)) + { + trigger_error('NO_POST_SELECTED'); + } + + lock_unlock($action, $post_ids); + break; + + case 'make_announce': + case 'make_sticky': + case 'make_global': + case 'make_normal': + + $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0)); + + if (!sizeof($topic_ids)) + { + trigger_error('NO_TOPIC_SELECTED'); + } + + change_topic_type($action, $topic_ids); + break; + + case 'move': + $user->add_lang('viewtopic'); + + $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0)); + + if (!sizeof($topic_ids)) + { + trigger_error('NO_TOPIC_SELECTED'); + } + + mcp_move_topic($topic_ids); + break; + + case 'fork': + $user->add_lang('viewtopic'); + + $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0)); + + if (!sizeof($topic_ids)) + { + trigger_error('NO_TOPIC_SELECTED'); + } + + mcp_fork_topic($topic_ids); + break; + + case 'delete_topic': + $user->add_lang('viewtopic'); + + // f parameter is not reliable for permission usage, however we just use it to decide + // which permission we will check later on. So if it is manipulated, we will still catch it later on. + $forum_id = $request->variable('f', 0); + $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); + $soft_delete = (($request->is_set_post('confirm') && !$request->is_set_post('delete_permanent')) || !$auth->acl_get('m_delete', $forum_id)) ? true : false; + + if (!sizeof($topic_ids)) + { + trigger_error('NO_TOPIC_SELECTED'); + } + + mcp_delete_topic($topic_ids, $soft_delete, $request->variable('delete_reason', '', true)); + break; + + case 'delete_post': + $user->add_lang('posting'); + + // f parameter is not reliable for permission usage, however we just use it to decide + // which permission we will check later on. So if it is manipulated, we will still catch it later on. + $forum_id = $request->variable('f', 0); + $post_ids = (!$quickmod) ? $request->variable('post_id_list', array(0)) : array($request->variable('p', 0)); + $soft_delete = (($request->is_set_post('confirm') && !$request->is_set_post('delete_permanent')) || !$auth->acl_get('m_delete', $forum_id)) ? true : false; + + if (!sizeof($post_ids)) + { + trigger_error('NO_POST_SELECTED'); + } + + mcp_delete_post($post_ids, $soft_delete, $request->variable('delete_reason', '', true)); + break; + + case 'restore_topic': + $user->add_lang('posting'); + + $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); + + if (!sizeof($topic_ids)) + { + trigger_error('NO_TOPIC_SELECTED'); + } + + mcp_restore_topic($topic_ids); + break; + + default: + /** + * This event allows you to handle custom quickmod options + * + * @event core.modify_quickmod_actions + * @var string action Topic quick moderation action name + * @var bool quickmod Flag indicating whether MCP is in quick moderation mode + * @since 3.1.0-a4 + * @change 3.1.0-RC4 Added variables: action, quickmod + */ + $vars = array('action', 'quickmod'); + extract($phpbb_dispatcher->trigger_event('core.modify_quickmod_actions', compact($vars))); + break; + } + + switch ($mode) + { + case 'front': + include($phpbb_root_path . 'includes/mcp/mcp_front.' . $phpEx); + + $user->add_lang('acp/common'); + + mcp_front_view($id, $mode, $action); + + $this->tpl_name = 'mcp_front'; + $this->page_title = 'MCP_MAIN'; + break; + + case 'forum_view': + include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx); + + $user->add_lang('viewforum'); + + $forum_id = request_var('f', 0); + + $forum_info = phpbb_get_forum_data($forum_id, 'm_', true); + + if (!sizeof($forum_info)) + { + $this->main('main', 'front'); + return; + } + + $forum_info = $forum_info[$forum_id]; + + mcp_forum_view($id, $mode, $action, $forum_info); + + $this->tpl_name = 'mcp_forum'; + $this->page_title = 'MCP_MAIN_FORUM_VIEW'; + break; + + case 'topic_view': + include($phpbb_root_path . 'includes/mcp/mcp_topic.' . $phpEx); + + mcp_topic_view($id, $mode, $action); + + $this->tpl_name = 'mcp_topic'; + $this->page_title = 'MCP_MAIN_TOPIC_VIEW'; + break; + + case 'post_details': + include($phpbb_root_path . 'includes/mcp/mcp_post.' . $phpEx); + + mcp_post_details($id, $mode, $action); + + $this->tpl_name = ($action == 'whois') ? 'mcp_whois' : 'mcp_post'; + $this->page_title = 'MCP_MAIN_POST_DETAILS'; + break; + + default: + trigger_error('NO_MODE', E_USER_ERROR); + break; + } + } +} + +/** +* Lock/Unlock Topic/Post +*/ +function lock_unlock($action, $ids) +{ + global $auth, $user, $db, $phpEx, $phpbb_root_path, $request; + + if ($action == 'lock' || $action == 'unlock') + { + $table = TOPICS_TABLE; + $sql_id = 'topic_id'; + $set_id = 'topic_status'; + $l_prefix = 'TOPIC'; + } + else + { + $table = POSTS_TABLE; + $sql_id = 'post_id'; + $set_id = 'post_edit_locked'; + $l_prefix = 'POST'; + } + + $orig_ids = $ids; + + if (!phpbb_check_ids($ids, $table, $sql_id, array('m_lock'))) + { + // Make sure that for f_user_lock only the lock action is triggered. + if ($action != 'lock') + { + return; + } + + $ids = $orig_ids; + + if (!phpbb_check_ids($ids, $table, $sql_id, array('f_user_lock'))) + { + return; + } + } + unset($orig_ids); + + $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); + $redirect = reapply_sid($redirect); + + $s_hidden_fields = build_hidden_fields(array( + $sql_id . '_list' => $ids, + 'action' => $action, + 'redirect' => $redirect) + ); + $success_msg = ''; + + if (confirm_box(true)) + { + $sql = "UPDATE $table + SET $set_id = " . (($action == 'lock' || $action == 'lock_post') ? ITEM_LOCKED : ITEM_UNLOCKED) . ' + WHERE ' . $db->sql_in_set($sql_id, $ids); + $db->sql_query($sql); + + $data = ($action == 'lock' || $action == 'unlock') ? phpbb_get_topic_data($ids) : phpbb_get_post_data($ids); + + foreach ($data as $id => $row) + { + add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_' . strtoupper($action), $row['topic_title']); + } + + $success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS'; + + meta_refresh(2, $redirect); + $message = $user->lang[$success_msg]; + + if (!$request->is_ajax()) + { + $message .= '

' . $user->lang('RETURN_PAGE', '', ''); + } + trigger_error($message); + } + else + { + confirm_box(false, strtoupper($action) . '_' . $l_prefix . ((sizeof($ids) == 1) ? '' : 'S'), $s_hidden_fields); + } + + redirect($redirect); +} + +/** +* Change Topic Type +*/ +function change_topic_type($action, $topic_ids) +{ + global $auth, $user, $db, $phpEx, $phpbb_root_path, $request; + + switch ($action) + { + case 'make_announce': + $new_topic_type = POST_ANNOUNCE; + $check_acl = 'f_announce'; + $l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_ANNOUNCEMENT' : 'MCP_MAKE_ANNOUNCEMENTS'; + break; + + case 'make_global': + $new_topic_type = POST_GLOBAL; + $check_acl = 'f_announce'; + $l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_GLOBAL' : 'MCP_MAKE_GLOBALS'; + break; + + case 'make_sticky': + $new_topic_type = POST_STICKY; + $check_acl = 'f_sticky'; + $l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_STICKY' : 'MCP_MAKE_STICKIES'; + break; + + default: + $new_topic_type = POST_NORMAL; + $check_acl = false; + $l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_NORMAL' : 'MCP_MAKE_NORMALS'; + break; + } + + $forum_id = phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', $check_acl, true); + + if ($forum_id === false) + { + return; + } + + $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); + $redirect = reapply_sid($redirect); + + $s_hidden_fields = array( + 'topic_id_list' => $topic_ids, + 'f' => $forum_id, + 'action' => $action, + 'redirect' => $redirect, + ); + $success_msg = ''; + + if (confirm_box(true)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_type = $new_topic_type + WHERE " . $db->sql_in_set('topic_id', $topic_ids); + $db->sql_query($sql); + + if (($new_topic_type == POST_GLOBAL) && sizeof($topic_ids)) + { + // Delete topic shadows for global announcements + $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids); + $db->sql_query($sql); + + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_type = $new_topic_type + WHERE " . $db->sql_in_set('topic_id', $topic_ids); + $db->sql_query($sql); + } + + $success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_TYPE_CHANGED' : 'TOPICS_TYPE_CHANGED'; + + if (sizeof($topic_ids)) + { + $data = phpbb_get_topic_data($topic_ids); + + foreach ($data as $topic_id => $row) + { + add_log('mod', $forum_id, $topic_id, 'LOG_TOPIC_TYPE_CHANGED', $row['topic_title']); + } + } + + meta_refresh(2, $redirect); + $message = $user->lang[$success_msg]; + + if (!$request->is_ajax()) + { + $message .= '

' . $user->lang('RETURN_PAGE', '', ''); + } + trigger_error($message); + } + else + { + confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields)); + } + + redirect($redirect); +} + +/** +* Move Topic +*/ +function mcp_move_topic($topic_ids) +{ + global $auth, $user, $db, $template, $phpbb_log, $request; + global $phpEx, $phpbb_root_path; + + // Here we limit the operation to one forum only + $forum_id = phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_move'), true); + + if ($forum_id === false) + { + return; + } + + $to_forum_id = request_var('to_forum_id', 0); + $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); + $additional_msg = $success_msg = ''; + + $s_hidden_fields = build_hidden_fields(array( + 'topic_id_list' => $topic_ids, + 'f' => $forum_id, + 'action' => 'move', + 'redirect' => $redirect) + ); + + if ($to_forum_id) + { + $forum_data = phpbb_get_forum_data($to_forum_id, 'f_post'); + + if (!sizeof($forum_data)) + { + $additional_msg = $user->lang['FORUM_NOT_EXIST']; + } + else + { + $forum_data = $forum_data[$to_forum_id]; + + if ($forum_data['forum_type'] != FORUM_POST) + { + $additional_msg = $user->lang['FORUM_NOT_POSTABLE']; + } + else if (!$auth->acl_get('f_post', $to_forum_id) || (!$auth->acl_get('m_approve', $to_forum_id) && !$auth->acl_get('f_noapprove', $to_forum_id))) + { + $additional_msg = $user->lang['USER_CANNOT_POST']; + } + else if ($forum_id == $to_forum_id) + { + $additional_msg = $user->lang['CANNOT_MOVE_SAME_FORUM']; + } + } + } + else if (isset($_POST['confirm'])) + { + $additional_msg = $user->lang['FORUM_NOT_EXIST']; + } + + if (!$to_forum_id || $additional_msg) + { + $request->overwrite('confirm', null, \phpbb\request\request_interface::POST); + $request->overwrite('confirm_key', null); + } + + if (confirm_box(true)) + { + $topic_data = phpbb_get_topic_data($topic_ids); + $leave_shadow = (isset($_POST['move_leave_shadow'])) ? true : false; + + $forum_sync_data = array(); + + $forum_sync_data[$forum_id] = current($topic_data); + $forum_sync_data[$to_forum_id] = $forum_data; + + $topics_moved = $topics_moved_unapproved = $topics_moved_softdeleted = 0; + $posts_moved = $posts_moved_unapproved = $posts_moved_softdeleted = 0; + + foreach ($topic_data as $topic_id => $topic_info) + { + if ($topic_info['topic_visibility'] == ITEM_APPROVED) + { + $topics_moved++; + } + else if ($topic_info['topic_visibility'] == ITEM_UNAPPROVED || $topic_info['topic_visibility'] == ITEM_REAPPROVE) + { + $topics_moved_unapproved++; + } + else if ($topic_info['topic_visibility'] == ITEM_DELETED) + { + $topics_moved_softdeleted++; + } + + $posts_moved += $topic_info['topic_posts_approved']; + $posts_moved_unapproved += $topic_info['topic_posts_unapproved']; + $posts_moved_softdeleted += $topic_info['topic_posts_softdeleted']; + } + + $db->sql_transaction('begin'); + + // Move topics, but do not resync yet + move_topics($topic_ids, $to_forum_id, false); + + if ($request->is_set_post('move_lock_topics') && $auth->acl_get('m_lock', $to_forum_id)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_status = ' . ITEM_LOCKED . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_ids); + $db->sql_query($sql); + } + + $shadow_topics = 0; + $forum_ids = array($to_forum_id); + foreach ($topic_data as $topic_id => $row) + { + // Get the list of forums to resync + $forum_ids[] = $row['forum_id']; + + // We add the $to_forum_id twice, because 'forum_id' is updated + // when the topic is moved again later. + $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_MOVE', false, array( + 'forum_id' => (int) $to_forum_id, + 'topic_id' => (int) $topic_id, + $row['forum_name'], + $forum_data['forum_name'], + (int) $row['forum_id'], + (int) $forum_data['forum_id'], + )); + + // Leave a redirection if required and only if the topic is visible to users + if ($leave_shadow && $row['topic_visibility'] == ITEM_APPROVED && $row['topic_type'] != POST_GLOBAL) + { + $shadow = array( + 'forum_id' => (int) $row['forum_id'], + 'icon_id' => (int) $row['icon_id'], + 'topic_attachment' => (int) $row['topic_attachment'], + 'topic_visibility' => ITEM_APPROVED, // a shadow topic is always approved + 'topic_reported' => 0, // a shadow topic is never reported + 'topic_title' => (string) $row['topic_title'], + 'topic_poster' => (int) $row['topic_poster'], + 'topic_time' => (int) $row['topic_time'], + 'topic_time_limit' => (int) $row['topic_time_limit'], + 'topic_views' => (int) $row['topic_views'], + 'topic_posts_approved' => (int) $row['topic_posts_approved'], + 'topic_posts_unapproved'=> (int) $row['topic_posts_unapproved'], + 'topic_posts_softdeleted'=> (int) $row['topic_posts_softdeleted'], + 'topic_status' => ITEM_MOVED, + 'topic_type' => POST_NORMAL, + 'topic_first_post_id' => (int) $row['topic_first_post_id'], + 'topic_first_poster_colour'=>(string) $row['topic_first_poster_colour'], + 'topic_first_poster_name'=> (string) $row['topic_first_poster_name'], + 'topic_last_post_id' => (int) $row['topic_last_post_id'], + 'topic_last_poster_id' => (int) $row['topic_last_poster_id'], + 'topic_last_poster_colour'=>(string) $row['topic_last_poster_colour'], + 'topic_last_poster_name'=> (string) $row['topic_last_poster_name'], + 'topic_last_post_subject'=> (string) $row['topic_last_post_subject'], + 'topic_last_post_time' => (int) $row['topic_last_post_time'], + 'topic_last_view_time' => (int) $row['topic_last_view_time'], + 'topic_moved_id' => (int) $row['topic_id'], + 'topic_bumped' => (int) $row['topic_bumped'], + 'topic_bumper' => (int) $row['topic_bumper'], + 'poll_title' => (string) $row['poll_title'], + 'poll_start' => (int) $row['poll_start'], + 'poll_length' => (int) $row['poll_length'], + 'poll_max_options' => (int) $row['poll_max_options'], + 'poll_last_vote' => (int) $row['poll_last_vote'] + ); + + $db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $shadow)); + + // Shadow topics only count on new "topics" and not posts... a shadow topic alone has 0 posts + $shadow_topics++; + } + } + unset($topic_data); + + $sync_sql = array(); + if ($posts_moved) + { + $sync_sql[$to_forum_id][] = 'forum_posts_approved = forum_posts_approved + ' . (int) $posts_moved; + $sync_sql[$forum_id][] = 'forum_posts_approved = forum_posts_approved - ' . (int) $posts_moved; + } + if ($posts_moved_unapproved) + { + $sync_sql[$to_forum_id][] = 'forum_posts_unapproved = forum_posts_unapproved + ' . (int) $posts_moved_unapproved; + $sync_sql[$forum_id][] = 'forum_posts_unapproved = forum_posts_unapproved - ' . (int) $posts_moved_unapproved; + } + if ($posts_moved_softdeleted) + { + $sync_sql[$to_forum_id][] = 'forum_posts_softdeleted = forum_posts_softdeleted + ' . (int) $posts_moved_softdeleted; + $sync_sql[$forum_id][] = 'forum_posts_softdeleted = forum_posts_softdeleted - ' . (int) $posts_moved_softdeleted; + } + + if ($topics_moved) + { + $sync_sql[$to_forum_id][] = 'forum_topics_approved = forum_topics_approved + ' . (int) $topics_moved; + if ($topics_moved - $shadow_topics > 0) + { + $sync_sql[$forum_id][] = 'forum_topics_approved = forum_topics_approved - ' . (int) ($topics_moved - $shadow_topics); + } + } + if ($topics_moved_unapproved) + { + $sync_sql[$to_forum_id][] = 'forum_topics_unapproved = forum_topics_unapproved + ' . (int) $topics_moved_unapproved; + $sync_sql[$forum_id][] = 'forum_topics_unapproved = forum_topics_unapproved - ' . (int) $topics_moved_unapproved; + } + if ($topics_moved_softdeleted) + { + $sync_sql[$to_forum_id][] = 'forum_topics_softdeleted = forum_topics_softdeleted + ' . (int) $topics_moved_softdeleted; + $sync_sql[$forum_id][] = 'forum_topics_softdeleted = forum_topics_softdeleted - ' . (int) $topics_moved_softdeleted; + } + + $success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_MOVED_SUCCESS' : 'TOPICS_MOVED_SUCCESS'; + + foreach ($sync_sql as $forum_id_key => $array) + { + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET ' . implode(', ', $array) . ' + WHERE forum_id = ' . $forum_id_key; + $db->sql_query($sql); + } + + $db->sql_transaction('commit'); + + sync('forum', 'forum_id', array($forum_id, $to_forum_id)); + } + else + { + $template->assign_vars(array( + 'S_FORUM_SELECT' => make_forum_select($to_forum_id, $forum_id, false, true, true, true), + 'S_CAN_LEAVE_SHADOW' => true, + 'S_CAN_LOCK_TOPIC' => ($auth->acl_get('m_lock', $to_forum_id)) ? true : false, + 'ADDITIONAL_MSG' => $additional_msg) + ); + + confirm_box(false, 'MOVE_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html'); + } + + $redirect = request_var('redirect', "index.$phpEx"); + $redirect = reapply_sid($redirect); + + if (!$success_msg) + { + redirect($redirect); + } + else + { + meta_refresh(3, $redirect); + + $message = $user->lang[$success_msg]; + $message .= '

' . sprintf($user->lang['RETURN_PAGE'], '', ''); + $message .= '

' . sprintf($user->lang['RETURN_FORUM'], '', ''); + $message .= '

' . sprintf($user->lang['RETURN_NEW_FORUM'], '', ''); + + trigger_error($message); + } +} + +/** +* Restore Topics +*/ +function mcp_restore_topic($topic_ids) +{ + global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container; + + if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_approve'))) + { + return; + } + + $redirect = $request->variable('redirect', build_url(array('action', 'quickmod'))); + $forum_id = $request->variable('f', 0); + + $s_hidden_fields = build_hidden_fields(array( + 'topic_id_list' => $topic_ids, + 'f' => $forum_id, + 'action' => 'restore_topic', + 'redirect' => $redirect, + )); + $success_msg = ''; + + if (confirm_box(true)) + { + $success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_RESTORED_SUCCESS' : 'TOPICS_RESTORED_SUCCESS'; + + $data = phpbb_get_topic_data($topic_ids); + + $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']); + } + } + } + else + { + confirm_box(false, (sizeof($topic_ids) == 1) ? 'RESTORE_TOPIC' : 'RESTORE_TOPICS', $s_hidden_fields); + } + + $topic_id = $request->variable('t', 0); + if (!$request->is_set('quickmod', \phpbb\request\request_interface::REQUEST)) + { + $redirect = $request->variable('redirect', "index.$phpEx"); + $redirect = reapply_sid($redirect); + $redirect_message = 'PAGE'; + } + else if ($topic_id) + { + $redirect = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id); + $redirect_message = 'TOPIC'; + } + else + { + $redirect = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); + $redirect_message = 'FORUM'; + } + + if (!$success_msg) + { + redirect($redirect); + } + else + { + meta_refresh(3, $redirect); + trigger_error($user->lang[$success_msg] . '

' . sprintf($user->lang['RETURN_' . $redirect_message], '', '')); + } +} + +/** +* Delete Topics +*/ +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; + + $check_permission = ($is_soft) ? 'm_softdelete' : 'm_delete'; + if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array($check_permission))) + { + return; + } + + $redirect = $request->variable('redirect', build_url(array('action', 'quickmod'))); + $forum_id = $request->variable('f', 0); + + $s_hidden_fields = array( + 'topic_id_list' => $topic_ids, + 'f' => $forum_id, + 'action' => $action, + 'redirect' => $redirect, + ); + $success_msg = ''; + + if (confirm_box(true)) + { + $success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_DELETED_SUCCESS' : 'TOPICS_DELETED_SUCCESS'; + + $data = phpbb_get_topic_data($topic_ids); + + foreach ($data as $topic_id => $row) + { + if ($row['topic_moved_id']) + { + add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_SHADOW_TOPIC', $row['topic_title']); + } + else + { + // Only soft delete non-shadow topics + if ($is_soft) + { + $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); + } + } + else + { + add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name'], $soft_delete_reason); + } + } + } + + if (!$is_soft) + { + $return = delete_topics('topic_id', $topic_ids); + } + } + else + { + global $template; + + $user->add_lang('posting'); + + // If there are only shadow topics, we neither need a reason nor softdelete + $sql = 'SELECT topic_id + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . ' + AND topic_moved_id = 0'; + $result = $db->sql_query_limit($sql, 1); + $only_shadow = !$db->sql_fetchfield('topic_id'); + $db->sql_freeresult($result); + + $only_softdeleted = false; + if (!$only_shadow && $auth->acl_get('m_delete', $forum_id) && $auth->acl_get('m_softdelete', $forum_id)) + { + // If there are only soft deleted topics, we display a message why the option is not available + $sql = 'SELECT topic_id + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . ' + AND topic_visibility <> ' . ITEM_DELETED; + $result = $db->sql_query_limit($sql, 1); + $only_softdeleted = !$db->sql_fetchfield('topic_id'); + $db->sql_freeresult($result); + } + + $template->assign_vars(array( + 'S_SHADOW_TOPICS' => $only_shadow, + 'S_SOFTDELETED' => $only_softdeleted, + 'S_TOPIC_MODE' => true, + 'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id), + 'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id), + )); + + $l_confirm = (sizeof($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS'; + if ($only_softdeleted) + { + $l_confirm .= '_PERMANENTLY'; + $s_hidden_fields['delete_permanent'] = '1'; + } + else if ($only_shadow || !$auth->acl_get('m_softdelete', $forum_id)) + { + $s_hidden_fields['delete_permanent'] = '1'; + } + + confirm_box(false, $l_confirm, build_hidden_fields($s_hidden_fields), 'confirm_delete_body.html'); + } + + $topic_id = $request->variable('t', 0); + if (!$request->is_set('quickmod', \phpbb\request\request_interface::REQUEST)) + { + $redirect = $request->variable('redirect', "index.$phpEx"); + $redirect = reapply_sid($redirect); + $redirect_message = 'PAGE'; + } + else if ($is_soft && $topic_id) + { + $redirect = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id); + $redirect_message = 'TOPIC'; + } + else + { + $redirect = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); + $redirect_message = 'FORUM'; + } + + if (!$success_msg) + { + redirect($redirect); + } + else + { + meta_refresh(3, $redirect); + trigger_error($user->lang[$success_msg] . '

' . sprintf($user->lang['RETURN_' . $redirect_message], '', '')); + } +} + +/** +* Delete Posts +*/ +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; + + $check_permission = ($is_soft) ? 'm_softdelete' : 'm_delete'; + if (!phpbb_check_ids($post_ids, POSTS_TABLE, 'post_id', array($check_permission))) + { + return; + } + + $redirect = $request->variable('redirect', build_url(array('action', 'quickmod'))); + $forum_id = $request->variable('f', 0); + + $s_hidden_fields = array( + 'post_id_list' => $post_ids, + 'f' => $forum_id, + 'action' => $action, + 'redirect' => $redirect, + ); + $success_msg = ''; + + if (confirm_box(true) && $is_soft) + { + $post_info = phpbb_get_post_data($post_ids); + + $topic_info = $approve_log = array(); + + // Group the posts by topic_id + foreach ($post_info as $post_id => $post_data) + { + if ($post_data['post_visibility'] != ITEM_APPROVED) + { + continue; + } + $topic_id = (int) $post_data['topic_id']; + + $topic_info[$topic_id]['posts'][] = (int) $post_id; + $topic_info[$topic_id]['forum_id'] = (int) $post_data['forum_id']; + + if ($post_id == $post_data['topic_first_post_id']) + { + $topic_info[$topic_id]['first_post'] = true; + } + + if ($post_id == $post_data['topic_last_post_id']) + { + $topic_info[$topic_id]['last_post'] = true; + } + + $approve_log[] = array( + 'forum_id' => $post_data['forum_id'], + 'topic_id' => $post_data['topic_id'], + 'post_subject' => $post_data['post_subject'], + 'poster_id' => $post_data['poster_id'], + 'post_username' => $post_data['post_username'], + 'username' => $post_data['username'], + ); + } + + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + foreach ($topic_info as $topic_id => $topic_data) + { + $phpbb_content_visibility->set_post_visibility(ITEM_DELETED, $topic_data['posts'], $topic_id, $topic_data['forum_id'], $user->data['user_id'], time(), $soft_delete_reason, isset($topic_data['first_post']), isset($topic_data['last_post'])); + } + $affected_topics = sizeof($topic_info); + // None of the topics is really deleted, so a redirect won't hurt much. + $deleted_topics = 0; + + $success_msg = (sizeof($post_info) == 1) ? $user->lang['POST_DELETED_SUCCESS'] : $user->lang['POSTS_DELETED_SUCCESS']; + + 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); + } + + $topic_id = $request->variable('t', 0); + + // Return links + $return_link = array(); + if ($affected_topics == 1 && $topic_id) + { + $return_link[] = sprintf($user->lang['RETURN_TOPIC'], '', ''); + } + $return_link[] = sprintf($user->lang['RETURN_FORUM'], '', ''); + + } + else if (confirm_box(true)) + { + if (!function_exists('delete_posts')) + { + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } + + // Count the number of topics that are affected + // I did not use COUNT(DISTINCT ...) because I remember having problems + // with it on older versions of MySQL -- Ashe + + $sql = 'SELECT DISTINCT topic_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_id', $post_ids); + $result = $db->sql_query($sql); + + $topic_id_list = array(); + while ($row = $db->sql_fetchrow($result)) + { + $topic_id_list[] = $row['topic_id']; + } + $affected_topics = sizeof($topic_id_list); + $db->sql_freeresult($result); + + $post_data = phpbb_get_post_data($post_ids); + + 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); + } + + // Now delete the posts, topics and forums are automatically resync'ed + delete_posts('post_id', $post_ids); + + $sql = 'SELECT COUNT(topic_id) AS topics_left + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_id_list); + $result = $db->sql_query_limit($sql, 1); + + $deleted_topics = ($row = $db->sql_fetchrow($result)) ? ($affected_topics - $row['topics_left']) : $affected_topics; + $db->sql_freeresult($result); + + $topic_id = $request->variable('t', 0); + + // Return links + $return_link = array(); + if ($affected_topics == 1 && !$deleted_topics && $topic_id) + { + $return_link[] = sprintf($user->lang['RETURN_TOPIC'], '', ''); + } + $return_link[] = sprintf($user->lang['RETURN_FORUM'], '', ''); + + if (sizeof($post_ids) == 1) + { + if ($deleted_topics) + { + // We deleted the only post of a topic, which in turn has + // been removed from the database + $success_msg = $user->lang['TOPIC_DELETED_SUCCESS']; + } + else + { + $success_msg = $user->lang['POST_DELETED_SUCCESS']; + } + } + else + { + if ($deleted_topics) + { + // Some of topics disappeared + $success_msg = $user->lang['POSTS_DELETED_SUCCESS'] . '

' . $user->lang['EMPTY_TOPICS_REMOVED_WARNING']; + } + else + { + $success_msg = $user->lang['POSTS_DELETED_SUCCESS']; + } + } + } + else + { + global $template; + + $user->add_lang('posting'); + + $only_softdeleted = false; + if ($auth->acl_get('m_delete', $forum_id) && $auth->acl_get('m_softdelete', $forum_id)) + { + // If there are only soft deleted posts, we display a message why the option is not available + $sql = 'SELECT post_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_id', $post_ids) . ' + AND post_visibility <> ' . ITEM_DELETED; + $result = $db->sql_query_limit($sql, 1); + $only_softdeleted = !$db->sql_fetchfield('post_id'); + $db->sql_freeresult($result); + } + + $template->assign_vars(array( + 'S_SOFTDELETED' => $only_softdeleted, + 'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id), + 'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id), + )); + + $l_confirm = (sizeof($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS'; + if ($only_softdeleted) + { + $l_confirm .= '_PERMANENTLY'; + $s_hidden_fields['delete_permanent'] = '1'; + } + else if (!$auth->acl_get('m_softdelete', $forum_id)) + { + $s_hidden_fields['delete_permanent'] = '1'; + } + + confirm_box(false, $l_confirm, build_hidden_fields($s_hidden_fields), 'confirm_delete_body.html'); + } + + $redirect = $request->variable('redirect', "index.$phpEx"); + $redirect = reapply_sid($redirect); + + if (!$success_msg) + { + redirect($redirect); + } + else + { + if ($affected_topics != 1 || $deleted_topics || !$topic_id) + { + $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", false); + } + + meta_refresh(3, $redirect); + trigger_error($success_msg . '

' . sprintf($user->lang['RETURN_PAGE'], '', '') . '

' . implode('

', $return_link)); + } +} + +/** +* Fork Topic +*/ +function mcp_fork_topic($topic_ids) +{ + global $auth, $user, $db, $template, $config; + global $phpEx, $phpbb_root_path; + + 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'))); + $additional_msg = $success_msg = ''; + $counter = array(); + + $s_hidden_fields = build_hidden_fields(array( + 'topic_id_list' => $topic_ids, + 'f' => $forum_id, + 'action' => 'fork', + 'redirect' => $redirect) + ); + + if ($to_forum_id) + { + $forum_data = phpbb_get_forum_data($to_forum_id, 'f_post'); + + if (!sizeof($topic_ids)) + { + $additional_msg = $user->lang['NO_TOPIC_SELECTED']; + } + else if (!sizeof($forum_data)) + { + $additional_msg = $user->lang['FORUM_NOT_EXIST']; + } + else + { + $forum_data = $forum_data[$to_forum_id]; + + if ($forum_data['forum_type'] != FORUM_POST) + { + $additional_msg = $user->lang['FORUM_NOT_POSTABLE']; + } + else if (!$auth->acl_get('f_post', $to_forum_id)) + { + $additional_msg = $user->lang['USER_CANNOT_POST']; + } + } + } + else if (isset($_POST['confirm'])) + { + $additional_msg = $user->lang['FORUM_NOT_EXIST']; + } + + if ($additional_msg) + { + $request->overwrite('confirm', null, \phpbb\request\request_interface::POST); + $request->overwrite('confirm_key', null); + } + + if (confirm_box(true)) + { + $topic_data = phpbb_get_topic_data($topic_ids, 'f_post'); + + $total_topics = $total_topics_unapproved = $total_topics_softdeleted = 0; + $total_posts = $total_posts_unapproved = $total_posts_softdeleted = 0; + $new_topic_id_list = array(); + + foreach ($topic_data as $topic_id => $topic_row) + { + if (!isset($search_type) && $topic_row['enable_indexing']) + { + // Select the search method and do some additional checks to ensure it can actually be utilised + $search_type = $config['search_type']; + + if (!class_exists($search_type)) + { + trigger_error('NO_SUCH_SEARCH_MODULE'); + } + + $error = false; + $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); + $search_mode = 'post'; + + if ($error) + { + trigger_error($error); + } + } + else if (!isset($search_type) && !$topic_row['enable_indexing']) + { + $search_type = false; + } + + $sql_ary = array( + 'forum_id' => (int) $to_forum_id, + 'icon_id' => (int) $topic_row['icon_id'], + 'topic_attachment' => (int) $topic_row['topic_attachment'], + 'topic_visibility' => (int) $topic_row['topic_visibility'], + 'topic_reported' => 0, + 'topic_title' => (string) $topic_row['topic_title'], + 'topic_poster' => (int) $topic_row['topic_poster'], + 'topic_time' => (int) $topic_row['topic_time'], + 'topic_posts_approved' => (int) $topic_row['topic_posts_approved'], + 'topic_posts_unapproved' => (int) $topic_row['topic_posts_unapproved'], + 'topic_posts_softdeleted' => (int) $topic_row['topic_posts_softdeleted'], + 'topic_status' => (int) $topic_row['topic_status'], + 'topic_type' => (int) $topic_row['topic_type'], + 'topic_first_poster_name' => (string) $topic_row['topic_first_poster_name'], + 'topic_last_poster_id' => (int) $topic_row['topic_last_poster_id'], + 'topic_last_poster_name' => (string) $topic_row['topic_last_poster_name'], + 'topic_last_post_time' => (int) $topic_row['topic_last_post_time'], + 'topic_last_view_time' => (int) $topic_row['topic_last_view_time'], + 'topic_bumped' => (int) $topic_row['topic_bumped'], + 'topic_bumper' => (int) $topic_row['topic_bumper'], + 'poll_title' => (string) $topic_row['poll_title'], + 'poll_start' => (int) $topic_row['poll_start'], + 'poll_length' => (int) $topic_row['poll_length'], + 'poll_max_options' => (int) $topic_row['poll_max_options'], + 'poll_vote_change' => (int) $topic_row['poll_vote_change'], + ); + + $db->sql_query('INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + $new_topic_id = $db->sql_nextid(); + $new_topic_id_list[$topic_id] = $new_topic_id; + + switch ($topic_row['topic_visibility']) + { + case ITEM_APPROVED: + $total_topics++; + break; + case ITEM_UNAPPROVED: + case ITEM_REAPPROVE: + $total_topics_unapproved++; + break; + case ITEM_DELETED: + $total_topics_softdeleted++; + break; + } + + if ($topic_row['poll_start']) + { + $poll_rows = array(); + + $sql = 'SELECT * + FROM ' . POLL_OPTIONS_TABLE . " + WHERE topic_id = $topic_id"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $sql_ary = array( + 'poll_option_id' => (int) $row['poll_option_id'], + 'topic_id' => (int) $new_topic_id, + 'poll_option_text' => (string) $row['poll_option_text'], + 'poll_option_total' => 0 + ); + + $db->sql_query('INSERT INTO ' . POLL_OPTIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + } + } + + $sql = 'SELECT * + FROM ' . POSTS_TABLE . " + WHERE topic_id = $topic_id + ORDER BY post_time ASC, post_id ASC"; + $result = $db->sql_query($sql); + + $post_rows = array(); + while ($row = $db->sql_fetchrow($result)) + { + $post_rows[] = $row; + } + $db->sql_freeresult($result); + + if (!sizeof($post_rows)) + { + continue; + } + + foreach ($post_rows as $row) + { + $sql_ary = array( + 'topic_id' => (int) $new_topic_id, + 'forum_id' => (int) $to_forum_id, + 'poster_id' => (int) $row['poster_id'], + 'icon_id' => (int) $row['icon_id'], + 'poster_ip' => (string) $row['poster_ip'], + 'post_time' => (int) $row['post_time'], + 'post_visibility' => (int) $row['post_visibility'], + 'post_reported' => 0, + 'enable_bbcode' => (int) $row['enable_bbcode'], + 'enable_smilies' => (int) $row['enable_smilies'], + 'enable_magic_url' => (int) $row['enable_magic_url'], + 'enable_sig' => (int) $row['enable_sig'], + 'post_username' => (string) $row['post_username'], + 'post_subject' => (string) $row['post_subject'], + 'post_text' => (string) $row['post_text'], + 'post_edit_reason' => (string) $row['post_edit_reason'], + 'post_edit_user' => (int) $row['post_edit_user'], + 'post_checksum' => (string) $row['post_checksum'], + 'post_attachment' => (int) $row['post_attachment'], + 'bbcode_bitfield' => $row['bbcode_bitfield'], + 'bbcode_uid' => (string) $row['bbcode_uid'], + 'post_edit_time' => (int) $row['post_edit_time'], + 'post_edit_count' => (int) $row['post_edit_count'], + 'post_edit_locked' => (int) $row['post_edit_locked'], + 'post_postcount' => $row['post_postcount'], + ); + // Adjust post count only if the post can be incremented to the user counter + if ($row['post_postcount']) + { + if (isset($counter[$row['poster_id']])) + { + ++$counter[$row['poster_id']]; + } + else + { + $counter[$row['poster_id']] = 1; + } + } + $db->sql_query('INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + $new_post_id = $db->sql_nextid(); + + switch ($row['post_visibility']) + { + case ITEM_APPROVED: + $total_posts++; + break; + case ITEM_UNAPPROVED: + case ITEM_REAPPROVE: + $total_posts_unapproved++; + break; + case ITEM_DELETED: + $total_posts_softdeleted++; + break; + } + + // Copy whether the topic is dotted + markread('post', $to_forum_id, $new_topic_id, 0, $row['poster_id']); + + if (!empty($search_type)) + { + $search->index($search_mode, $new_post_id, $sql_ary['post_text'], $sql_ary['post_subject'], $sql_ary['poster_id'], ($topic_row['topic_type'] == POST_GLOBAL) ? 0 : $to_forum_id); + $search_mode = 'reply'; // After one we index replies + } + + // Copy Attachments + if ($row['post_attachment']) + { + $sql = 'SELECT * FROM ' . ATTACHMENTS_TABLE . " + WHERE post_msg_id = {$row['post_id']} + AND topic_id = $topic_id + AND in_message = 0"; + $result = $db->sql_query($sql); + + $sql_ary = array(); + while ($attach_row = $db->sql_fetchrow($result)) + { + $sql_ary[] = array( + 'post_msg_id' => (int) $new_post_id, + 'topic_id' => (int) $new_topic_id, + 'in_message' => 0, + 'is_orphan' => (int) $attach_row['is_orphan'], + 'poster_id' => (int) $attach_row['poster_id'], + 'physical_filename' => (string) utf8_basename($attach_row['physical_filename']), + 'real_filename' => (string) utf8_basename($attach_row['real_filename']), + 'download_count' => (int) $attach_row['download_count'], + 'attach_comment' => (string) $attach_row['attach_comment'], + 'extension' => (string) $attach_row['extension'], + 'mimetype' => (string) $attach_row['mimetype'], + 'filesize' => (int) $attach_row['filesize'], + 'filetime' => (int) $attach_row['filetime'], + 'thumbnail' => (int) $attach_row['thumbnail'] + ); + } + $db->sql_freeresult($result); + + if (sizeof($sql_ary)) + { + $db->sql_multi_insert(ATTACHMENTS_TABLE, $sql_ary); + } + } + } + + // Copy topic subscriptions to new topic + $sql = 'SELECT user_id, notify_status + FROM ' . TOPICS_WATCH_TABLE . ' + WHERE topic_id = ' . $topic_id; + $result = $db->sql_query($sql); + + $sql_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $sql_ary[] = array( + 'topic_id' => (int) $new_topic_id, + 'user_id' => (int) $row['user_id'], + 'notify_status' => (int) $row['notify_status'], + ); + } + $db->sql_freeresult($result); + + if (sizeof($sql_ary)) + { + $db->sql_multi_insert(TOPICS_WATCH_TABLE, $sql_ary); + } + + // Copy bookmarks to new topic + $sql = 'SELECT user_id + FROM ' . BOOKMARKS_TABLE . ' + WHERE topic_id = ' . $topic_id; + $result = $db->sql_query($sql); + + $sql_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $sql_ary[] = array( + 'topic_id' => (int) $new_topic_id, + 'user_id' => (int) $row['user_id'], + ); + } + $db->sql_freeresult($result); + + if (sizeof($sql_ary)) + { + $db->sql_multi_insert(BOOKMARKS_TABLE, $sql_ary); + } + } + + // Sync new topics, parent forums and board stats + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET forum_posts_approved = forum_posts_approved + ' . $total_posts . ', + forum_posts_unapproved = forum_posts_unapproved + ' . $total_posts_unapproved . ', + forum_posts_softdeleted = forum_posts_softdeleted + ' . $total_posts_softdeleted . ', + forum_topics_approved = forum_topics_approved + ' . $total_topics . ', + forum_topics_unapproved = forum_topics_unapproved + ' . $total_topics_unapproved . ', + forum_topics_softdeleted = forum_topics_softdeleted + ' . $total_topics_softdeleted . ' + WHERE forum_id = ' . $to_forum_id; + $db->sql_query($sql); + + if (!empty($counter)) + { + // Do only one query per user and not a query per post. + foreach ($counter as $user_id => $count) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_posts = user_posts + ' . (int) $count . ' + WHERE user_id = ' . (int) $user_id; + $db->sql_query($sql); + } + } + + 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); + + 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']); + } + + $success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_FORKED_SUCCESS' : 'TOPICS_FORKED_SUCCESS'; + } + else + { + $template->assign_vars(array( + 'S_FORUM_SELECT' => make_forum_select($to_forum_id, false, false, true, true, true), + 'S_CAN_LEAVE_SHADOW' => false, + 'ADDITIONAL_MSG' => $additional_msg) + ); + + confirm_box(false, 'FORK_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html'); + } + + $redirect = request_var('redirect', "index.$phpEx"); + $redirect = reapply_sid($redirect); + + if (!$success_msg) + { + redirect($redirect); + } + else + { + $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); + meta_refresh(3, $redirect_url); + $return_link = sprintf($user->lang['RETURN_FORUM'], '', ''); + + if ($forum_id != $to_forum_id) + { + $return_link .= '

' . sprintf($user->lang['RETURN_NEW_FORUM'], '', ''); + } + + trigger_error($user->lang[$success_msg] . '

' . $return_link); + } +} diff --git a/sources/phpBB/includes/mcp/mcp_notes.php b/sources/phpBB/includes/mcp/mcp_notes.php new file mode 100644 index 0000000..465ee63 --- /dev/null +++ b/sources/phpBB/includes/mcp/mcp_notes.php @@ -0,0 +1,249 @@ + +* @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; +} + +/** +* mcp_notes +* Displays notes about a user +*/ +class mcp_notes +{ + var $p_master; + var $u_action; + + function mcp_notes(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($id, $mode) + { + global $auth, $db, $user, $template; + global $config, $phpbb_root_path, $phpEx; + + $action = request_var('action', array('' => '')); + + if (is_array($action)) + { + list($action, ) = each($action); + } + + $this->page_title = 'MCP_NOTES'; + + switch ($mode) + { + case 'front': + $template->assign_vars(array( + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username&select_single=true'), + 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes'), + + 'L_TITLE' => $user->lang['MCP_NOTES'], + )); + + $this->tpl_name = 'mcp_notes_front'; + break; + + case 'user_notes': + $user->add_lang('acp/common'); + + $this->mcp_notes_user_view($action); + $this->tpl_name = 'mcp_notes_user'; + break; + } + } + + /** + * Display user notes + */ + function mcp_notes_user_view($action) + { + global $phpEx, $phpbb_root_path, $config; + 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'); + $pagination = $phpbb_container->get('pagination'); + + add_form_key('mcp_notes'); + + $sql_where = ($user_id) ? "user_id = $user_id" : "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; + + $sql = 'SELECT * + FROM ' . USERS_TABLE . " + WHERE $sql_where"; + $result = $db->sql_query($sql); + $userrow = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$userrow) + { + trigger_error('NO_USER'); + } + + $user_id = $userrow['user_id']; + + // Populate user id to the currently active module (this module) + // The following method is another way of adjusting module urls. It is the easy variant if we want + // to directly adjust the current module url based on data retrieved within the same module. + if (strpos($this->u_action, "&u=$user_id") === false) + { + $this->p_master->adjust_url('&u=' . $user_id); + $this->u_action .= "&u=$user_id"; + } + + $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)); + + // Handle any actions + if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) + { + $where_sql = ''; + if ($deletemark && $marked) + { + $sql_in = array(); + foreach ($marked as $mark) + { + $sql_in[] = $mark; + } + $where_sql = ' AND ' . $db->sql_in_set('log_id', $sql_in); + unset($sql_in); + } + + if ($where_sql || $deleteall) + { + if (check_form_key('mcp_notes')) + { + $sql = 'DELETE FROM ' . LOG_TABLE . ' + WHERE log_type = ' . LOG_USERS . " + AND reportee_id = $user_id + $where_sql"; + $db->sql_query($sql); + + add_log('admin', 'LOG_CLEAR_USER', $userrow['username']); + + $msg = ($deletemark) ? 'MARKED_NOTES_DELETED' : 'ALL_NOTES_DELETED'; + } + else + { + $msg = 'FORM_INVALID'; + } + $redirect = $this->u_action . '&u=' . $user_id; + meta_refresh(3, $redirect); + trigger_error($user->lang[$msg] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); + } + } + + if ($usernote && $action == 'add_feedback') + { + if (check_form_key('mcp_notes')) + { + add_log('admin', 'LOG_USER_FEEDBACK', $userrow['username']); + add_log('mod', 0, 0, 'LOG_USER_FEEDBACK', $userrow['username']); + + add_log('user', $user_id, 'LOG_USER_GENERAL', $usernote); + $msg = $user->lang['USER_FEEDBACK_ADDED']; + } + else + { + $msg = $user->lang['FORM_INVALID']; + } + $redirect = $this->u_action; + meta_refresh(3, $redirect); + + trigger_error($msg . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); + } + + // Generate the appropriate user information for the user we are looking at + + $rank_title = $rank_img = ''; + $avatar_img = phpbb_get_user_avatar($userrow); + + $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_IP'], 'd' => $user->lang['SORT_ACTION']); + $sort_by_sql = array('a' => 'u.username_clean', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation'); + + $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; + gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); + + // Define where and sort sql for use in displaying logs + $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_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; + + $log_data = array(); + $log_count = 0; + $start = view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort, $keywords); + + if ($log_count) + { + $template->assign_var('S_USER_NOTES', true); + + foreach ($log_data as $row) + { + $template->assign_block_vars('usernotes', array( + 'REPORT_BY' => $row['username_full'], + 'REPORT_AT' => $user->format_date($row['time']), + 'ACTION' => $row['action'], + 'IP' => $row['ip'], + 'ID' => $row['id']) + ); + } + } + + $base_url = $this->u_action . "&$u_sort_param$keywords_param"; + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $log_count, $config['topics_per_page'], $start); + + $template->assign_vars(array( + 'U_POST_ACTION' => $this->u_action, + 'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false, + 'S_SELECT_SORT_DIR' => $s_sort_dir, + 'S_SELECT_SORT_KEY' => $s_sort_key, + 'S_SELECT_SORT_DAYS' => $s_limit_days, + 'S_KEYWORDS' => $keywords, + + 'L_TITLE' => $user->lang['MCP_NOTES_USER'], + + 'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $log_count), + + 'RANK_TITLE' => $rank_title, + 'JOINED' => $user->format_date($userrow['user_regdate']), + 'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0, + 'WARNINGS' => ($userrow['user_warnings']) ? $userrow['user_warnings'] : 0, + + 'USERNAME_FULL' => get_username_string('full', $userrow['user_id'], $userrow['username'], $userrow['user_colour']), + 'USERNAME_COLOUR' => get_username_string('colour', $userrow['user_id'], $userrow['username'], $userrow['user_colour']), + 'USERNAME' => get_username_string('username', $userrow['user_id'], $userrow['username'], $userrow['user_colour']), + 'U_PROFILE' => get_username_string('profile', $userrow['user_id'], $userrow['username'], $userrow['user_colour']), + + 'AVATAR_IMG' => $avatar_img, + 'RANK_IMG' => $rank_img, + ) + ); + } + +} diff --git a/sources/phpBB/includes/mcp/mcp_pm_reports.php b/sources/phpBB/includes/mcp/mcp_pm_reports.php new file mode 100644 index 0000000..d76bedb --- /dev/null +++ b/sources/phpBB/includes/mcp/mcp_pm_reports.php @@ -0,0 +1,324 @@ + +* @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; +} + +/** +* mcp_reports +* Handling the reports queue +*/ +class mcp_pm_reports +{ + var $p_master; + var $u_action; + + function mcp_pm_reports(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($id, $mode) + { + global $auth, $db, $user, $template, $cache; + 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); + $pagination = $phpbb_container->get('pagination'); + + $this->page_title = 'MCP_PM_REPORTS'; + + switch ($action) + { + case 'close': + case 'delete': + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $report_id_list = request_var('report_id_list', array(0)); + + if (!sizeof($report_id_list)) + { + trigger_error('NO_REPORT_SELECTED'); + } + + if (!function_exists('close_report')) + { + include($phpbb_root_path . 'includes/mcp/mcp_reports.' . $phpEx); + } + + close_report($report_id_list, $mode, $action, true); + + break; + } + + switch ($mode) + { + case 'pm_report_details': + + $user->add_lang(array('posting', 'viewforum', 'viewtopic', 'ucp')); + + $report_id = request_var('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 + WHERE r.report_id = ' . $report_id . ' + AND rr.reason_id = r.reason_id + AND r.user_id = u.user_id + AND r.post_id = 0 + ORDER BY report_closed ASC'; + $result = $db->sql_query_limit($sql, 1); + $report = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$report_id || !$report) + { + trigger_error('NO_REPORT'); + } + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + $phpbb_notifications->mark_notifications_read_by_parent('notification.type.report_pm', $report_id, $user->data['user_id']); + + $pm_id = $report['pm_id']; + $report_id = $report['report_id']; + + $pm_info = phpbb_get_pm_data(array($pm_id)); + + if (!sizeof($pm_info)) + { + trigger_error('NO_REPORT_SELECTED'); + } + + $pm_info = $pm_info[$pm_id]; + + write_pm_addresses(array('to' => $pm_info['to_address'], 'bcc' => $pm_info['bcc_address']), (int) $pm_info['author_id']); + + $reason = array('title' => $report['reason_title'], 'description' => $report['reason_description']); + if (isset($user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])])) + { + $reason['description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])]; + $reason['title'] = $user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])]; + } + + // Process message, leave it uncensored + $parse_flags = ($pm_info['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; + $message = generate_text_for_display($pm_info['message_text'], $pm_info['bbcode_uid'], $pm_info['bbcode_bitfield'], $parse_flags, false); + + $report['report_text'] = make_clickable(bbcode_nl2br($report['report_text'])); + + if ($pm_info['message_attachment'] && $auth->acl_get('u_pm_download')) + { + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE post_msg_id = ' . $pm_id . ' + AND in_message = 1 + ORDER BY filetime DESC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $attachments[] = $row; + } + $db->sql_freeresult($result); + + if (sizeof($attachments)) + { + $update_count = array(); + parse_attachments(0, $message, $attachments, $update_count); + } + + // Display not already displayed Attachments for this post, we already parsed them. ;) + if (!empty($attachments)) + { + $template->assign_var('S_HAS_ATTACHMENTS', true); + + foreach ($attachments as $attachment) + { + $template->assign_block_vars('attachment', array( + 'DISPLAY_ATTACHMENT' => $attachment) + ); + } + } + } + + $template->assign_vars(array( + 'S_MCP_REPORT' => true, + 'S_PM' => true, + 'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&mode=pm_report_details&r=' . $report_id), + 'S_CAN_VIEWIP' => $auth->acl_getf_global('m_info'), + 'S_POST_REPORTED' => $pm_info['message_reported'], + 'S_REPORT_CLOSED' => $report['report_closed'], + 'S_USER_NOTES' => true, + + 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&mode=pm_report_details&r=' . $report_id), + 'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $report['user_id']), + 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $pm_info['author_id']), + 'U_MCP_WARN_REPORTER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $report['user_id']) : '', + 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $pm_info['author_id']) : '', + + 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), + 'MINI_POST_IMG' => $user->img('icon_post_target', 'POST'), + + 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '', ''), + 'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']), + 'REPORT_DATE' => $user->format_date($report['report_time']), + 'REPORT_ID' => $report_id, + 'REPORT_REASON_TITLE' => $reason['title'], + 'REPORT_REASON_DESCRIPTION' => $reason['description'], + 'REPORT_TEXT' => $report['report_text'], + + 'POST_AUTHOR_FULL' => get_username_string('full', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']), + 'POST_AUTHOR_COLOUR' => get_username_string('colour', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']), + 'POST_AUTHOR' => get_username_string('username', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']), + 'U_POST_AUTHOR' => get_username_string('profile', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']), + + 'REPORTER_FULL' => get_username_string('full', $report['user_id'], $report['username'], $report['user_colour']), + 'REPORTER_COLOUR' => get_username_string('colour', $report['user_id'], $report['username'], $report['user_colour']), + 'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']), + 'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']), + + 'POST_PREVIEW' => $message, + '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_ID' => $pm_info['msg_id'], + + 'U_LOOKUP_IP' => ($auth->acl_getf_global('m_info')) ? $this->u_action . '&r=' . $report_id . '&pm=' . $pm_id . '&lookup=' . $pm_info['author_ip'] . '#ip' : '', + )); + + $this->tpl_name = 'mcp_post'; + + break; + + case 'pm_reports': + case 'pm_reports_closed': + $user->add_lang(array('ucp')); + + $sort_days = $total = 0; + $sort_key = $sort_dir = ''; + $sort_by_sql = $sort_order_sql = array(); + phpbb_mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total); + + $limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : ''; + + if ($mode == 'pm_reports') + { + $report_state = 'p.message_reported = 1 AND r.report_closed = 0'; + } + else + { + $report_state = 'r.report_closed = 1'; + } + + $sql = 'SELECT r.report_id + FROM ' . PRIVMSGS_TABLE . ' p, ' . REPORTS_TABLE . ' r ' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . (($sort_order_sql[0] == 'r') ? ', ' . USERS_TABLE . ' ru' : '') . " + WHERE $report_state + AND r.pm_id = p.msg_id + " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.author_id' : '') . ' + ' . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = r.user_id' : '') . " + AND r.post_id = 0 + $limit_time_sql + ORDER BY $sort_order_sql"; + $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); + + $i = 0; + $report_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $report_ids[] = $row['report_id']; + $row_num[$row['report_id']] = $i++; + } + $db->sql_freeresult($result); + + if (sizeof($report_ids)) + { + $sql = 'SELECT p.*, u.username, u.username_clean, u.user_colour, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id + FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . ' u, ' . USERS_TABLE . ' ru + WHERE ' . $db->sql_in_set('r.report_id', $report_ids) . " + AND r.pm_id = p.msg_id + AND p.author_id = u.user_id + AND ru.user_id = r.user_id + ORDER BY $sort_order_sql"; + $result = $db->sql_query($sql); + + $pm_list = $pm_by_id = array(); + while ($row = $db->sql_fetchrow($result)) + { + $pm_by_id[(int) $row['msg_id']] = $row; + $pm_list[] = (int) $row['msg_id']; + } + $db->sql_freeresult($result); + + if (sizeof($pm_list)) + { + $address_list = get_recipient_strings($pm_by_id); + + foreach ($pm_list as $message_id) + { + $row = $pm_by_id[$message_id]; + $template->assign_block_vars('postrow', array( + 'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=pm_reports&mode=pm_report_details&r={$row['report_id']}"), + + 'PM_AUTHOR_FULL' => get_username_string('full', $row['author_id'], $row['username'], $row['user_colour']), + 'PM_AUTHOR_COLOUR' => get_username_string('colour', $row['author_id'], $row['username'], $row['user_colour']), + 'PM_AUTHOR' => get_username_string('username', $row['author_id'], $row['username'], $row['user_colour']), + 'U_PM_AUTHOR' => get_username_string('profile', $row['author_id'], $row['username'], $row['user_colour']), + + 'REPORTER_FULL' => get_username_string('full', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), + 'REPORTER_COLOUR' => get_username_string('colour', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), + 'REPORTER' => get_username_string('username', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), + 'U_REPORTER' => get_username_string('profile', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), + + 'PM_SUBJECT' => ($row['message_subject']) ? $row['message_subject'] : $user->lang['NO_SUBJECT'], + 'PM_TIME' => $user->format_date($row['message_time']), + 'REPORT_ID' => $row['report_id'], + 'REPORT_TIME' => $user->format_date($row['report_time']), + + 'RECIPIENTS' => implode($user->lang['COMMA_SEPARATOR'], $address_list[$row['msg_id']]), + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $row['message_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + )); + } + } + } + + $base_url = $this->u_action . "&st=$sort_days&sk=$sort_key&sd=$sort_dir"; + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start); + + // Now display the page + $template->assign_vars(array( + 'L_EXPLAIN' => ($mode == 'pm_reports') ? $user->lang['MCP_PM_REPORTS_OPEN_EXPLAIN'] : $user->lang['MCP_PM_REPORTS_CLOSED_EXPLAIN'], + 'L_TITLE' => ($mode == 'pm_reports') ? $user->lang['MCP_PM_REPORTS_OPEN'] : $user->lang['MCP_PM_REPORTS_CLOSED'], + + 'S_PM' => true, + 'S_MCP_ACTION' => $this->u_action, + 'S_CLOSED' => ($mode == 'pm_reports_closed') ? true : false, + + 'TOTAL' => $total, + 'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $total), + ) + ); + + $this->tpl_name = 'mcp_reports'; + break; + } + } +} diff --git a/sources/phpBB/includes/mcp/mcp_post.php b/sources/phpBB/includes/mcp/mcp_post.php new file mode 100644 index 0000000..1687409 --- /dev/null +++ b/sources/phpBB/includes/mcp/mcp_post.php @@ -0,0 +1,523 @@ + +* @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; +} + +/** +* Handling actions in post details screen +*/ +function mcp_post_details($id, $mode, $action) +{ + global $phpEx, $phpbb_root_path, $config; + global $template, $db, $user, $auth, $cache; + + $user->add_lang('posting'); + + $post_id = request_var('p', 0); + $start = request_var('start', 0); + + // Get post data + $post_info = phpbb_get_post_data(array($post_id), false, true); + + add_form_key('mcp_post_details'); + + if (!sizeof($post_info)) + { + trigger_error('POST_NOT_EXIST'); + } + + $post_info = $post_info[$post_id]; + $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . phpbb_extra_url()); + + switch ($action) + { + case 'whois': + + if ($auth->acl_get('m_info', $post_info['forum_id'])) + { + $ip = request_var('ip', ''); + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + $template->assign_vars(array( + 'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '', ''), + 'U_RETURN_POST' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&p=$post_id"), + 'L_RETURN_POST' => sprintf($user->lang['RETURN_POST'], '', ''), + 'WHOIS' => user_ipwhois($ip), + )); + } + + // We're done with the whois page so return + return; + + break; + + case 'chgposter': + case 'chgposter_ip': + + if ($action == 'chgposter') + { + $username = request_var('username', '', true); + $sql_where = "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; + } + else + { + $new_user_id = request_var('u', 0); + $sql_where = 'user_id = ' . $new_user_id; + } + + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE ' . $sql_where; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + trigger_error('NO_USER'); + } + + if ($auth->acl_get('m_chgposter', $post_info['forum_id'])) + { + if (check_form_key('mcp_post_details')) + { + change_poster($post_info, $row); + } + else + { + trigger_error('FORM_INVALID'); + } + } + + break; + } + + // Set some vars + $users_ary = $usernames_ary = array(); + $attachments = $extensions = array(); + $post_id = $post_info['post_id']; + $topic_tracking_info = array(); + + // Get topic tracking info + if ($config['load_db_lastread']) + { + $tmp_topic_data = array($post_info['topic_id'] => $post_info); + $topic_tracking_info = get_topic_tracking($post_info['forum_id'], $post_info['topic_id'], $tmp_topic_data, array($post_info['forum_id'] => $post_info['forum_mark_time'])); + unset($tmp_topic_data); + } + else + { + $topic_tracking_info = get_complete_topic_tracking($post_info['forum_id'], $post_info['topic_id']); + } + + $post_unread = (isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']]) ? true : false; + + // Process message, leave it uncensored + $parse_flags = ($post_info['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; + $message = generate_text_for_display($post_info['post_text'], $post_info['bbcode_uid'], $post_info['bbcode_bitfield'], $parse_flags, false); + + if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id'])) + { + $extensions = $cache->obtain_attach_extensions($post_info['forum_id']); + + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE post_msg_id = ' . $post_id . ' + AND in_message = 0 + ORDER BY filetime DESC, post_msg_id ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $attachments[] = $row; + } + $db->sql_freeresult($result); + + if (sizeof($attachments)) + { + $user->add_lang('viewtopic'); + $update_count = array(); + parse_attachments($post_info['forum_id'], $message, $attachments, $update_count); + } + + // Display not already displayed Attachments for this post, we already parsed them. ;) + if (!empty($attachments)) + { + $template->assign_var('S_HAS_ATTACHMENTS', true); + + foreach ($attachments as $attachment) + { + $template->assign_block_vars('attachment', array( + 'DISPLAY_ATTACHMENT' => $attachment) + ); + } + } + } + + // Deleting information + if ($post_info['post_visibility'] == ITEM_DELETED && $post_info['post_delete_user']) + { + // User having deleted the post also being the post author? + if (!$post_info['post_delete_user'] || $post_info['post_delete_user'] == $post_info['poster_id']) + { + $display_username = get_username_string('full', $post_info['poster_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']); + } + else + { + $sql = 'SELECT user_id, username, user_colour + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . (int) $post_info['post_delete_user']; + $result = $db->sql_query($sql); + $user_delete_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + $display_username = get_username_string('full', $post_info['post_delete_user'], $user_delete_row['username'], $user_delete_row['user_colour']); + } + + $user->add_lang('viewtopic'); + $l_deleted_by = $user->lang('DELETED_INFORMATION', $display_username, $user->format_date($post_info['post_delete_time'], false, true)); + } + else + { + $l_deleted_by = ''; + } + + $template->assign_vars(array( + 'U_MCP_ACTION' => "$url&i=main&quickmod=1&mode=post_details", // Use this for mode paramaters + 'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters + 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f={$post_info['forum_id']}"), + + 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), + 'S_CAN_CHGPOSTER' => $auth->acl_get('m_chgposter', $post_info['forum_id']), + 'S_CAN_LOCK_POST' => $auth->acl_get('m_lock', $post_info['forum_id']), + 'S_CAN_DELETE_POST' => $auth->acl_get('m_delete', $post_info['forum_id']), + + 'S_POST_REPORTED' => ($post_info['post_reported']) ? true : false, + 'S_POST_UNAPPROVED' => ($post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE) ? true : false, + 'S_POST_DELETED' => ($post_info['post_visibility'] == ITEM_DELETED) ? true : false, + 'S_POST_LOCKED' => ($post_info['post_edit_locked']) ? true : false, + 'S_USER_NOTES' => true, + 'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false, + 'DELETED_MESSAGE' => $l_deleted_by, + 'DELETE_REASON' => $post_info['post_delete_reason'], + + 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '', + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_chgposter&field=username&select_single=true'), + 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), + 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), + 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']), + 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '', + 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&p=' . $post_info['post_id'] . '#p' . $post_info['post_id']), + 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']), + + 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'), + + 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '", ''), + 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '', ''), + 'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']), + 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']), + 'DELETED_IMG' => $user->img('icon_topic_deleted', $user->lang['POST_DELETED']), + 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), + 'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']), + + 'POST_AUTHOR_FULL' => get_username_string('full', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), + 'POST_AUTHOR_COLOUR' => get_username_string('colour', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), + 'POST_AUTHOR' => get_username_string('username', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), + 'U_POST_AUTHOR' => get_username_string('profile', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), + + 'POST_PREVIEW' => $message, + '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_ID' => $post_info['post_id'], + + 'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? "$url&i=$id&mode=$mode&lookup={$post_info['poster_ip']}#ip" : '', + 'U_WHOIS' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&action=whois&p=$post_id&ip={$post_info['poster_ip']}") : '', + )); + + // Get User Notes + $log_data = array(); + $log_count = false; + view_log('user', $log_data, $log_count, $config['posts_per_page'], 0, 0, 0, $post_info['user_id']); + + if (!empty($log_data)) + { + $template->assign_var('S_USER_NOTES', true); + + foreach ($log_data as $row) + { + $template->assign_block_vars('usernotes', array( + 'REPORT_BY' => $row['username_full'], + 'REPORT_AT' => $user->format_date($row['time']), + 'ACTION' => $row['action'], + 'ID' => $row['id']) + ); + } + } + + // Get Reports + if ($auth->acl_get('m_report', $post_info['forum_id'])) + { + $sql = 'SELECT r.*, re.*, u.user_id, u.username + FROM ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u, ' . REPORTS_REASONS_TABLE . " re + WHERE r.post_id = $post_id + AND r.reason_id = re.reason_id + AND u.user_id = r.user_id + ORDER BY r.report_time DESC"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $template->assign_var('S_SHOW_REPORTS', true); + + do + { + // 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['reson_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]; + $row['reason_title'] = $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]; + } + + $template->assign_block_vars('reports', array( + 'REPORT_ID' => $row['report_id'], + 'REASON_TITLE' => $row['reason_title'], + 'REASON_DESC' => $row['reason_description'], + 'REPORTER' => get_username_string('username', $row['user_id'], $row['username']), + 'U_REPORTER' => get_username_string('profile', $row['user_id'], $row['username']), + 'USER_NOTIFY' => ($row['user_notify']) ? true : false, + 'REPORT_TIME' => $user->format_date($row['report_time']), + 'REPORT_TEXT' => bbcode_nl2br(trim($row['report_text'])), + )); + } + while ($row = $db->sql_fetchrow($result)); + } + $db->sql_freeresult($result); + } + + // Get IP + if ($auth->acl_get('m_info', $post_info['forum_id'])) + { + $rdns_ip_num = request_var('rdns', ''); + + if ($rdns_ip_num != 'all') + { + $template->assign_vars(array( + 'U_LOOKUP_ALL' => "$url&i=main&mode=post_details&rdns=all") + ); + } + + // Get other users who've posted under this IP + $sql = 'SELECT poster_id, COUNT(poster_id) as postings + FROM ' . POSTS_TABLE . " + WHERE poster_ip = '" . $db->sql_escape($post_info['poster_ip']) . "' + GROUP BY poster_id + ORDER BY postings DESC"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + // Fill the user select list with users who have posted under this IP + if ($row['poster_id'] != $post_info['poster_id']) + { + $users_ary[$row['poster_id']] = $row; + } + } + $db->sql_freeresult($result); + + if (sizeof($users_ary)) + { + // Get the usernames + $sql = 'SELECT user_id, username + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', array_keys($users_ary)); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $users_ary[$row['user_id']]['username'] = $row['username']; + $usernames_ary[utf8_clean_string($row['username'])] = $users_ary[$row['user_id']]; + } + $db->sql_freeresult($result); + + foreach ($users_ary as $user_id => $user_row) + { + $template->assign_block_vars('userrow', array( + 'USERNAME' => get_username_string('username', $user_id, $user_row['username']), + 'NUM_POSTS' => $user_row['postings'], + 'L_POST_S' => ($user_row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'], + + 'U_PROFILE' => get_username_string('profile', $user_id, $user_row['username']), + 'U_SEARCHPOSTS' => append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $user_id . '&sr=topics')) + ); + } + } + + // Get other IP's this user has posted under + + // A compound index on poster_id, poster_ip (posts table) would help speed up this query a lot, + // but the extra size is only valuable if there are persons having more than a thousands posts. + // This is better left to the really really big forums. + + $sql = 'SELECT poster_ip, COUNT(poster_ip) AS postings + FROM ' . POSTS_TABLE . ' + WHERE poster_id = ' . $post_info['poster_id'] . " + GROUP BY poster_ip + ORDER BY postings DESC"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $hostname = (($rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all') && $row['poster_ip']) ? @gethostbyaddr($row['poster_ip']) : ''; + + $template->assign_block_vars('iprow', array( + 'IP' => $row['poster_ip'], + 'HOSTNAME' => $hostname, + 'NUM_POSTS' => $row['postings'], + 'L_POST_S' => ($row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'], + + 'U_LOOKUP_IP' => ($rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all') ? '' : "$url&i=$id&mode=post_details&rdns={$row['poster_ip']}#ip", + 'U_WHOIS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&action=whois&p=$post_id&ip={$row['poster_ip']}")) + ); + } + $db->sql_freeresult($result); + + $user_select = ''; + + if (sizeof($usernames_ary)) + { + ksort($usernames_ary); + + foreach ($usernames_ary as $row) + { + $user_select .= '\n"; + } + } + + $template->assign_var('S_USER_SELECT', $user_select); + } + +} + +/** +* Change a post's poster +*/ +function change_poster(&$post_info, $userdata) +{ + global $auth, $db, $config, $phpbb_root_path, $phpEx, $user; + + if (empty($userdata) || $userdata['user_id'] == $post_info['user_id']) + { + return; + } + + $post_id = $post_info['post_id']; + + $sql = 'UPDATE ' . POSTS_TABLE . " + SET poster_id = {$userdata['user_id']} + WHERE post_id = $post_id"; + $db->sql_query($sql); + + // Resync topic/forum if needed + if ($post_info['topic_last_post_id'] == $post_id || $post_info['forum_last_post_id'] == $post_id || $post_info['topic_first_post_id'] == $post_id) + { + sync('topic', 'topic_id', $post_info['topic_id'], false, false); + sync('forum', 'forum_id', $post_info['forum_id'], false, false); + } + + // Adjust post counts... only if the post is approved (else, it was not added the users post count anyway) + if ($post_info['post_postcount'] && $post_info['post_visibility'] == ITEM_APPROVED) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_posts = user_posts - 1 + WHERE user_id = ' . $post_info['user_id'] .' + AND user_posts > 0'; + $db->sql_query($sql); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_posts = user_posts + 1 + WHERE user_id = ' . $userdata['user_id']; + $db->sql_query($sql); + } + + // Add posted to information for this topic for the new user + markread('post', $post_info['forum_id'], $post_info['topic_id'], time(), $userdata['user_id']); + + // Remove the dotted topic option if the old user has no more posts within this topic + if ($config['load_db_track'] && $post_info['user_id'] != ANONYMOUS) + { + $sql = 'SELECT topic_id + FROM ' . POSTS_TABLE . ' + WHERE topic_id = ' . $post_info['topic_id'] . ' + AND poster_id = ' . $post_info['user_id']; + $result = $db->sql_query_limit($sql, 1); + $topic_id = (int) $db->sql_fetchfield('topic_id'); + $db->sql_freeresult($result); + + if (!$topic_id) + { + $sql = 'DELETE FROM ' . TOPICS_POSTED_TABLE . ' + WHERE user_id = ' . $post_info['user_id'] . ' + AND topic_id = ' . $post_info['topic_id']; + $db->sql_query($sql); + } + } + + // change the poster_id within the attachments table, else the data becomes out of sync and errors displayed because of wrong ownership + if ($post_info['post_attachment']) + { + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' + SET poster_id = ' . $userdata['user_id'] . ' + WHERE poster_id = ' . $post_info['user_id'] . ' + AND post_msg_id = ' . $post_info['post_id'] . ' + AND topic_id = ' . $post_info['topic_id']; + $db->sql_query($sql); + } + + // refresh search cache of this post + $search_type = $config['search_type']; + + if (class_exists($search_type)) + { + // We do some additional checks in the module to ensure it can actually be utilised + $error = false; + $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); + + if (!$error && method_exists($search, 'destroy_cache')) + { + $search->destroy_cache(array(), array($post_info['user_id'], $userdata['user_id'])); + } + } + + $from_username = $post_info['username']; + $to_username = $userdata['username']; + + // Renew post info + $post_info = phpbb_get_post_data(array($post_id), false, true); + + if (!sizeof($post_info)) + { + trigger_error('POST_NOT_EXIST'); + } + + $post_info = $post_info[$post_id]; + + // 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); +} diff --git a/sources/phpBB/includes/mcp/mcp_queue.php b/sources/phpBB/includes/mcp/mcp_queue.php new file mode 100644 index 0000000..f9c00da --- /dev/null +++ b/sources/phpBB/includes/mcp/mcp_queue.php @@ -0,0 +1,1343 @@ + +* @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; +} + +/** +* mcp_queue +* Handling the moderation queue +*/ +class mcp_queue +{ + var $p_master; + var $u_action; + + public function mcp_queue(&$p_master) + { + $this->p_master = &$p_master; + } + + public function main($id, $mode) + { + global $auth, $db, $user, $template, $cache, $request; + global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container; + global $phpbb_dispatcher; + + include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + + $forum_id = request_var('f', 0); + $start = request_var('start', 0); + + $this->page_title = 'MCP_QUEUE'; + + switch ($action) + { + case 'approve': + case 'restore': + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $post_id_list = $request->variable('post_id_list', array(0)); + $topic_id_list = $request->variable('topic_id_list', array(0)); + + if (!empty($post_id_list)) + { + self::approve_posts($action, $post_id_list, 'queue', $mode); + } + else if (!empty($topic_id_list)) + { + self::approve_topics($action, $topic_id_list, 'queue', $mode); + } + else + { + trigger_error('NO_POST_SELECTED'); + } + break; + + case 'delete': + $post_id_list = $request->variable('post_id_list', array(0)); + $topic_id_list = $request->variable('topic_id_list', array(0)); + + if (!empty($post_id_list)) + { + if (!function_exists('mcp_delete_post')) + { + global $phpbb_root_path, $phpEx; + include($phpbb_root_path . 'includes/mcp/mcp_main.' . $phpEx); + } + mcp_delete_post($post_id_list, false, '', $action); + } + else if (!empty($topic_id_list)) + { + if (!function_exists('mcp_delete_topic')) + { + global $phpbb_root_path, $phpEx; + include($phpbb_root_path . 'includes/mcp/mcp_main.' . $phpEx); + } + mcp_delete_topic($topic_id_list, false, '', $action); + } + else + { + trigger_error('NO_POST_SELECTED'); + } + break; + + case 'disapprove': + $post_id_list = $request->variable('post_id_list', array(0)); + $topic_id_list = $request->variable('topic_id_list', array(0)); + + if (!empty($topic_id_list) && $mode == 'deleted_topics') + { + if (!function_exists('mcp_delete_topics')) + { + global $phpbb_root_path, $phpEx; + include($phpbb_root_path . 'includes/mcp/mcp_main.' . $phpEx); + } + mcp_delete_topic($topic_id_list, false, '', 'disapprove'); + return; + } + + if (!class_exists('messenger')) + { + include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + } + + if (!empty($topic_id_list)) + { + $post_visibility = ($mode == 'deleted_topics') ? ITEM_DELETED : array(ITEM_UNAPPROVED, ITEM_REAPPROVE); + $sql = 'SELECT post_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_visibility', $post_visibility) . ' + AND ' . $db->sql_in_set('topic_id', $topic_id_list); + $result = $db->sql_query($sql); + + $post_id_list = array(); + while ($row = $db->sql_fetchrow($result)) + { + $post_id_list[] = (int) $row['post_id']; + } + $db->sql_freeresult($result); + } + + if (!empty($post_id_list)) + { + self::disapprove_posts($post_id_list, 'queue', $mode); + } + else + { + trigger_error('NO_POST_SELECTED'); + } + break; + } + + switch ($mode) + { + case 'approve_details': + + $this->tpl_name = 'mcp_post'; + + $user->add_lang(array('posting', 'viewtopic')); + + $post_id = request_var('p', 0); + $topic_id = request_var('t', 0); + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + if ($topic_id) + { + $topic_info = phpbb_get_topic_data(array($topic_id), 'm_approve'); + if (isset($topic_info[$topic_id]['topic_first_post_id'])) + { + $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']); + } + else + { + $topic_id = 0; + } + } + + $phpbb_notifications->mark_notifications_read('notification.type.post_in_queue', $post_id, $user->data['user_id']); + + $post_info = phpbb_get_post_data(array($post_id), 'm_approve', true); + + if (!sizeof($post_info)) + { + trigger_error('NO_POST_SELECTED'); + } + + $post_info = $post_info[$post_id]; + + if ($post_info['topic_first_post_id'] != $post_id && topic_review($post_info['topic_id'], $post_info['forum_id'], 'topic_review', 0, false)) + { + $template->assign_vars(array( + 'S_TOPIC_REVIEW' => true, + 'S_BBCODE_ALLOWED' => $post_info['enable_bbcode'], + 'TOPIC_TITLE' => $post_info['topic_title'], + )); + } + + $extensions = $attachments = $topic_tracking_info = array(); + + // Get topic tracking info + if ($config['load_db_lastread']) + { + $tmp_topic_data = array($post_info['topic_id'] => $post_info); + $topic_tracking_info = get_topic_tracking($post_info['forum_id'], $post_info['topic_id'], $tmp_topic_data, array($post_info['forum_id'] => $post_info['forum_mark_time'])); + unset($tmp_topic_data); + } + else + { + $topic_tracking_info = get_complete_topic_tracking($post_info['forum_id'], $post_info['topic_id']); + } + + $post_unread = (isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']]) ? true : false; + + // Process message, leave it uncensored + $parse_flags = ($post_info['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; + $message = generate_text_for_display($post_info['post_text'], $post_info['bbcode_uid'], $post_info['bbcode_bitfield'], $parse_flags, false); + + if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id'])) + { + $extensions = $cache->obtain_attach_extensions($post_info['forum_id']); + + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE post_msg_id = ' . $post_id . ' + AND in_message = 0 + ORDER BY filetime DESC, post_msg_id ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $attachments[] = $row; + } + $db->sql_freeresult($result); + + if (sizeof($attachments)) + { + $update_count = array(); + parse_attachments($post_info['forum_id'], $message, $attachments, $update_count); + } + + // Display not already displayed Attachments for this post, we already parsed them. ;) + if (!empty($attachments)) + { + $template->assign_var('S_HAS_ATTACHMENTS', true); + + foreach ($attachments as $attachment) + { + $template->assign_block_vars('attachment', array( + 'DISPLAY_ATTACHMENT' => $attachment, + )); + } + } + } + + // Deleting information + if ($post_info['post_visibility'] == ITEM_DELETED && $post_info['post_delete_user']) + { + // User having deleted the post also being the post author? + if (!$post_info['post_delete_user'] || $post_info['post_delete_user'] == $post_info['poster_id']) + { + $display_username = get_username_string('full', $post_info['poster_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']); + } + else + { + $sql = 'SELECT u.user_id, u.username, u.user_colour + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u + WHERE p.post_id = ' . $post_info['post_id'] . ' + AND p.post_delete_user = u.user_id'; + $result = $db->sql_query($sql); + $post_delete_userinfo = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + $display_username = get_username_string('full', $post_info['post_delete_user'], $post_delete_userinfo['username'], $post_delete_userinfo['user_colour']); + } + + $l_deleted_by = $user->lang('DELETED_INFORMATION', $display_username, $user->format_date($post_info['post_delete_time'], false, true)); + } + else + { + $l_deleted_by = ''; + } + + $post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&p=' . $post_info['post_id'] . '#p' . $post_info['post_id']); + $topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']); + + $template->assign_vars(array( + 'S_MCP_QUEUE' => true, + 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f=$forum_id"), + 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), + 'S_POST_REPORTED' => $post_info['post_reported'], + 'S_POST_UNAPPROVED' => $post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE, + 'S_POST_LOCKED' => $post_info['post_edit_locked'], + 'S_USER_NOTES' => true, + 'S_POST_DELETED' => ($post_info['post_visibility'] == ITEM_DELETED), + 'DELETED_MESSAGE' => $l_deleted_by, + 'DELETE_REASON' => $post_info['post_delete_reason'], + + 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '', + 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), + 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), + 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']), + 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '', + 'U_VIEW_POST' => $post_url, + 'U_VIEW_TOPIC' => $topic_url, + + 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'), + + 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '', ''), + 'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '', ''), + 'RETURN_TOPIC_SIMPLE' => sprintf($user->lang['RETURN_TOPIC_SIMPLE'], '', ''), + 'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']), + 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']), + 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), + + 'POST_AUTHOR_FULL' => get_username_string('full', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), + 'POST_AUTHOR_COLOUR' => get_username_string('colour', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), + 'POST_AUTHOR' => get_username_string('username', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), + 'U_POST_AUTHOR' => get_username_string('profile', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), + + 'POST_PREVIEW' => $message, + '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_ID' => $post_info['post_id'], + 'S_FIRST_POST' => ($post_info['topic_first_post_id'] == $post_id), + + 'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id . '&lookup=' . $post_info['poster_ip']) . '#ip' : '', + )); + + break; + + case 'unapproved_topics': + case 'unapproved_posts': + case 'deleted_topics': + case 'deleted_posts': + $m_perm = 'm_approve'; + $is_topics = ($mode == 'unapproved_topics' || $mode == 'deleted_topics') ? true : false; + $is_restore = ($mode == 'deleted_posts' || $mode == 'deleted_topics') ? true : false; + $visibility_const = (!$is_restore) ? array(ITEM_UNAPPROVED, ITEM_REAPPROVE) : ITEM_DELETED; + + $user->add_lang(array('viewtopic', 'viewforum')); + + $topic_id = $request->variable('t', 0); + $forum_info = array(); + $pagination = $phpbb_container->get('pagination'); + + if ($topic_id) + { + $topic_info = phpbb_get_topic_data(array($topic_id)); + + if (!sizeof($topic_info)) + { + trigger_error('TOPIC_NOT_EXIST'); + } + + $topic_info = $topic_info[$topic_id]; + $forum_id = $topic_info['forum_id']; + } + + $forum_list_approve = get_forum_list($m_perm, false, true); + $forum_list_read = array_flip(get_forum_list('f_read', true, true)); // Flipped so we can isset() the forum IDs + + // Remove forums we cannot read + foreach ($forum_list_approve as $k => $forum_data) + { + if (!isset($forum_list_read[$forum_data['forum_id']])) + { + unset($forum_list_approve[$k]); + } + } + unset($forum_list_read); + + if (!$forum_id) + { + $forum_list = array(); + foreach ($forum_list_approve as $row) + { + $forum_list[] = $row['forum_id']; + } + + if (!sizeof($forum_list)) + { + trigger_error('NOT_MODERATOR'); + } + + $sql = 'SELECT SUM(forum_topics_approved) as sum_forum_topics + FROM ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_list); + $result = $db->sql_query($sql); + $forum_info['forum_topics_approved'] = (int) $db->sql_fetchfield('sum_forum_topics'); + $db->sql_freeresult($result); + } + else + { + $forum_info = phpbb_get_forum_data(array($forum_id), $m_perm); + + if (!sizeof($forum_info)) + { + trigger_error('NOT_MODERATOR'); + } + + $forum_info = $forum_info[$forum_id]; + $forum_list = $forum_id; + } + + $forum_options = ''; + foreach ($forum_list_approve as $row) + { + $forum_options .= ''; + } + + $sort_days = $total = 0; + $sort_key = $sort_dir = ''; + $sort_by_sql = $sort_order_sql = array(); + phpbb_mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id); + + $forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total; + $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : ''; + + $forum_names = array(); + + if (!$is_topics) + { + $sql = 'SELECT p.post_id + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . ' + WHERE ' . $db->sql_in_set('p.forum_id', $forum_list) . ' + AND ' . $db->sql_in_set('p.post_visibility', $visibility_const) . ' + ' . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . ' + ' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . " + AND t.topic_id = p.topic_id + AND (t.topic_visibility <> p.post_visibility + OR t.topic_delete_user = 0) + $limit_time_sql + ORDER BY $sort_order_sql"; + + /** + * Alter sql query to get posts in queue to be accepted + * + * @event core.mcp_queue_get_posts_query_before + * @var string sql Associative array with the query to be executed + * @var array forum_list List of forums that contain the posts + * @var int visibility_const Integer with one of the possible ITEM_* constant values + * @var int topic_id If topic_id not equal to 0, the topic id to filter the posts to display + * @var string limit_time_sql String with the SQL code to limit the time interval of the post (Note: May be empty string) + * @var string sort_order_sql String with the ORDER BY SQL code used in this query + * @since 3.1.0-RC3 + */ + $vars = array( + 'sql', + 'forum_list', + 'visibility_const', + 'topic_id', + 'limit_time_sql', + 'sort_order_sql', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_queue_get_posts_query_before', compact($vars))); + + $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); + + $i = 0; + $post_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $post_ids[] = $row['post_id']; + $row_num[$row['post_id']] = $i++; + } + $db->sql_freeresult($result); + + if (sizeof($post_ids)) + { + $sql = 'SELECT t.topic_id, t.topic_title, t.forum_id, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, p.post_attachment, u.username, u.username_clean, u.user_colour + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u + WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . ' + AND t.topic_id = p.topic_id + AND u.user_id = p.poster_id + ORDER BY ' . $sort_order_sql; + $result = $db->sql_query($sql); + + $post_data = $rowset = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_names[] = $row['forum_id']; + $post_data[$row['post_id']] = $row; + } + $db->sql_freeresult($result); + + foreach ($post_ids as $post_id) + { + $rowset[] = $post_data[$post_id]; + } + unset($post_data, $post_ids); + } + else + { + $rowset = array(); + } + } + else + { + $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_title AS post_subject, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_attachment AS post_attachment, t.topic_first_poster_name AS username, t.topic_first_poster_colour AS user_colour + FROM ' . TOPICS_TABLE . ' t + WHERE ' . $db->sql_in_set('forum_id', $forum_list) . ' + AND ' . $db->sql_in_set('topic_visibility', $visibility_const) . " + AND topic_delete_user <> 0 + $limit_time_sql + ORDER BY $sort_order_sql"; + + /** + * Alter sql query to get information on all topics in the list of forums provided. + * + * @event core.mcp_queue_get_posts_for_topics_query_before + * @var string sql String with the query to be executed + * @var array forum_list List of forums that contain the posts + * @var int visibility_const Integer with one of the possible ITEM_* constant values + * @var int topic_id topic_id in the page request + * @var string limit_time_sql String with the SQL code to limit the time interval of the post (Note: May be empty string) + * @var string sort_order_sql String with the ORDER BY SQL code used in this query + * @since 3.1.0-RC3 + */ + $vars = array( + 'sql', + 'forum_list', + 'visibility_const', + 'topic_id', + 'limit_time_sql', + 'sort_order_sql', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_queue_get_posts_for_topics_query_before', compact($vars))); + + $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); + + $rowset = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_names[] = $row['forum_id']; + $rowset[] = $row; + } + $db->sql_freeresult($result); + } + + if (sizeof($forum_names)) + { + // Select the names for the forum_ids + $sql = 'SELECT forum_id, forum_name + FROM ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_names); + $result = $db->sql_query($sql, 3600); + + $forum_names = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_names[$row['forum_id']] = $row['forum_name']; + } + $db->sql_freeresult($result); + } + + foreach ($rowset as $row) + { + if (empty($row['post_username'])) + { + $row['post_username'] = $row['username'] ?: $user->lang['GUEST']; + } + + $template->assign_block_vars('postrow', array( + 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']), + 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']), + 'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''), + 'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&start=$start&mode=approve_details&f={$row['forum_id']}&p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&t={$row['topic_id']}" : '')), + + 'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + 'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + 'POST_AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + 'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + + 'POST_ID' => $row['post_id'], + 'TOPIC_ID' => $row['topic_id'], + 'FORUM_NAME' => $forum_names[$row['forum_id']], + 'POST_SUBJECT' => ($row['post_subject'] != '') ? $row['post_subject'] : $user->lang['NO_SUBJECT'], + 'TOPIC_TITLE' => $row['topic_title'], + 'POST_TIME' => $user->format_date($row['post_time']), + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + )); + } + unset($rowset, $forum_names); + + $base_url = $this->u_action . "&f=$forum_id&st=$sort_days&sk=$sort_key&sd=$sort_dir"; + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start); + + // Now display the page + $template->assign_vars(array( + 'L_DISPLAY_ITEMS' => (!$is_topics) ? $user->lang['DISPLAY_POSTS'] : $user->lang['DISPLAY_TOPICS'], + 'L_EXPLAIN' => $user->lang['MCP_QUEUE_' . strtoupper($mode) . '_EXPLAIN'], + 'L_TITLE' => $user->lang['MCP_QUEUE_' . strtoupper($mode)], + 'L_ONLY_TOPIC' => ($topic_id) ? sprintf($user->lang['ONLY_TOPIC'], $topic_info['topic_title']) : '', + + 'S_FORUM_OPTIONS' => $forum_options, + 'S_MCP_ACTION' => build_url(array('t', 'f', 'sd', 'st', 'sk')), + 'S_TOPICS' => $is_topics, + 'S_RESTORE' => $is_restore, + + 'TOPIC_ID' => $topic_id, + 'TOTAL' => $user->lang(((!$is_topics) ? 'VIEW_TOPIC_POSTS' : 'VIEW_FORUM_TOPICS'), (int) $total), + )); + + $this->tpl_name = 'mcp_queue'; + break; + } + } + + /** + * Approve/Restore posts + * + * @param $action string Action we perform on the posts ('approve' or 'restore') + * @param $post_id_list array IDs of the posts to approve/restore + * @param $id mixed Category of the current active module + * @param $mode string Active module + * @return null + */ + static public function approve_posts($action, $post_id_list, $id, $mode) + { + global $db, $template, $user, $config, $request, $phpbb_container; + global $phpEx, $phpbb_root_path; + + if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve'))) + { + trigger_error('NOT_AUTHORISED'); + } + + $redirect = $request->variable('redirect', build_url(array('quickmod'))); + $redirect = reapply_sid($redirect); + $success_msg = $post_url = ''; + $approve_log = array(); + $num_topics = 0; + + $s_hidden_fields = build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'post_id_list' => $post_id_list, + 'action' => $action, + 'redirect' => $redirect, + )); + + $post_info = phpbb_get_post_data($post_id_list, 'm_approve'); + + if (confirm_box(true)) + { + $notify_poster = ($action == 'approve' && isset($_REQUEST['notify_poster'])); + + $topic_info = array(); + + // Group the posts by topic_id + foreach ($post_info as $post_id => $post_data) + { + if ($post_data['post_visibility'] == ITEM_APPROVED) + { + continue; + } + $topic_id = (int) $post_data['topic_id']; + + $topic_info[$topic_id]['posts'][] = (int) $post_id; + $topic_info[$topic_id]['forum_id'] = (int) $post_data['forum_id']; + + // Refresh the first post, if the time or id is older then the current one + if ($post_id <= $post_data['topic_first_post_id'] || $post_data['post_time'] <= $post_data['topic_time']) + { + $topic_info[$topic_id]['first_post'] = true; + } + + // Refresh the last post, if the time or id is newer then the current one + if ($post_id >= $post_data['topic_last_post_id'] || $post_data['post_time'] >= $post_data['topic_last_post_time']) + { + $topic_info[$topic_id]['last_post'] = true; + } + + $post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$post_data['forum_id']}&t={$post_data['topic_id']}&p={$post_data['post_id']}") . '#p' . $post_data['post_id']; + + $approve_log[] = array( + 'forum_id' => $post_data['forum_id'], + 'topic_id' => $post_data['topic_id'], + 'post_subject' => $post_data['post_subject'], + ); + } + + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + foreach ($topic_info as $topic_id => $topic_data) + { + $phpbb_content_visibility->set_post_visibility(ITEM_APPROVED, $topic_data['posts'], $topic_id, $topic_data['forum_id'], $user->data['user_id'], time(), '', isset($topic_data['first_post']), isset($topic_data['last_post'])); + } + + 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']); + } + + // Only send out the mails, when the posts are being approved + if ($action == 'approve') + { + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + // Handle notifications + foreach ($post_info as $post_id => $post_data) + { + // A single topic approval may also happen here, so handle deleting the respective notification. + if (!$post_data['topic_posts_approved']) + { + $phpbb_notifications->delete_notifications('notification.type.topic_in_queue', $post_data['topic_id']); + + if ($post_data['post_visibility'] == ITEM_UNAPPROVED) + { + $phpbb_notifications->add_notifications(array('notification.type.topic'), $post_data); + } + if ($post_data['post_visibility'] != ITEM_APPROVED) + { + $num_topics++; + } + } + else + { + // Only add notifications, if we are not reapproving post + // When the topic was already approved, but was edited and + // now needs re-approval, we don't want to notify the users + // again. + if ($post_data['post_visibility'] == ITEM_UNAPPROVED) + { + $phpbb_notifications->add_notifications(array( + 'notification.type.bookmark', + 'notification.type.post', + ), $post_data); + } + } + $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( + 'notification.type.quote', + 'notification.type.bookmark', + 'notification.type.post', + ), $post_data['post_id'], $user->data['user_id']); + + // Notify Poster? + if ($notify_poster) + { + if ($post_data['poster_id'] == ANONYMOUS) + { + continue; + } + + if (!$post_data['topic_posts_approved']) + { + $phpbb_notifications->add_notifications('notification.type.approve_topic', $post_data); + } + else + { + $phpbb_notifications->add_notifications('notification.type.approve_post', $post_data); + } + } + } + } + + if ($num_topics >= 1) + { + $success_msg = ($num_topics == 1) ? 'TOPIC_' . strtoupper($action) . 'D_SUCCESS' : 'TOPICS_' . strtoupper($action) . 'D_SUCCESS'; + } + else + { + $success_msg = (sizeof($post_info) == 1) ? 'POST_' . strtoupper($action) . 'D_SUCCESS' : 'POSTS_' . strtoupper($action) . 'D_SUCCESS'; + } + + meta_refresh(3, $redirect); + $message = $user->lang[$success_msg]; + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $message, + 'REFRESH_DATA' => null, + 'visible' => true, + )); + } + $message .= '

' . $user->lang('RETURN_PAGE', '', ''); + + // If approving one post, also give links back to post... + if (sizeof($post_info) == 1 && $post_url) + { + $message .= '

' . $user->lang('RETURN_POST', '', ''); + } + trigger_error($message); + } + else + { + $show_notify = false; + + if ($action == 'approve') + { + foreach ($post_info as $post_data) + { + if (!$post_data['topic_posts_approved']) + { + $num_topics++; + } + + if (!$show_notify && $post_data['poster_id'] != ANONYMOUS) + { + $show_notify = true; + } + } + } + + $template->assign_vars(array( + 'S_NOTIFY_POSTER' => $show_notify, + 'S_' . strtoupper($action) => true, + )); + + // Create the confirm box message + $action_msg = strtoupper($action); + $num_posts = sizeof($post_id_list) - $num_topics; + if ($num_topics > 0 && $num_posts <= 0) + { + $action_msg .= '_TOPIC' . (($num_topics == 1) ? '' : 'S'); + } + else + { + $action_msg .= '_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'); + } + confirm_box(false, $action_msg, $s_hidden_fields, 'mcp_approve.html'); + } + + redirect($redirect); + } + + /** + * Approve/Restore topics + * + * @param $action string Action we perform on the posts ('approve' or 'restore') + * @param $topic_id_list array IDs of the topics to approve/restore + * @param $id mixed Category of the current active module + * @param $mode string Active module + * @return null + */ + static public function approve_topics($action, $topic_id_list, $id, $mode) + { + global $db, $template, $user, $config; + global $phpEx, $phpbb_root_path, $request, $phpbb_container; + + if (!phpbb_check_ids($topic_id_list, TOPICS_TABLE, 'topic_id', array('m_approve'))) + { + trigger_error('NOT_AUTHORISED'); + } + + $redirect = $request->variable('redirect', build_url(array('quickmod'))); + $redirect = reapply_sid($redirect); + $success_msg = $topic_url = ''; + $approve_log = array(); + + $s_hidden_fields = build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'topic_id_list' => $topic_id_list, + 'action' => $action, + 'redirect' => $redirect, + )); + + $topic_info = phpbb_get_topic_data($topic_id_list, 'm_approve'); + + if (confirm_box(true)) + { + $notify_poster = ($action == 'approve' && isset($_REQUEST['notify_poster'])) ? true : false; + + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + $first_post_ids = array(); + + foreach ($topic_info as $topic_id => $topic_data) + { + $phpbb_content_visibility->set_topic_visibility(ITEM_APPROVED, $topic_id, $topic_data['forum_id'], $user->data['user_id'], time(), ''); + $first_post_ids[$topic_id] = (int) $topic_data['topic_first_post_id']; + + $topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$topic_data['forum_id']}&t={$topic_id}"); + + $approve_log[] = array( + 'forum_id' => $topic_data['forum_id'], + 'topic_id' => $topic_data['topic_id'], + 'topic_title' => $topic_data['topic_title'], + ); + } + + if (sizeof($topic_info) >= 1) + { + $success_msg = (sizeof($topic_info) == 1) ? 'TOPIC_' . strtoupper($action) . 'D_SUCCESS' : 'TOPICS_' . strtoupper($action) . 'D_SUCCESS'; + } + + 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']); + } + + // Only send out the mails, when the posts are being approved + if ($action == 'approve') + { + // Grab the first post text as it's needed for the quote notification. + $sql = 'SELECT topic_id, post_text + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_id', $first_post_ids); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $topic_info[$row['topic_id']]['post_text'] = $row['post_text']; + } + $db->sql_freeresult($result); + + // Handle notifications + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + foreach ($topic_info as $topic_id => $topic_data) + { + $topic_data = array_merge($topic_data, array( + 'post_id' => $topic_data['topic_first_post_id'], + 'post_subject' => $topic_data['topic_title'], + 'post_time' => $topic_data['topic_time'], + 'poster_id' => $topic_data['topic_poster'], + 'post_username' => $topic_data['topic_first_poster_name'], + )); + + $phpbb_notifications->delete_notifications('notification.type.topic_in_queue', $topic_id); + + // Only add notifications, if we are not reapproving post + // When the topic was already approved, but was edited and + // now needs re-approval, we don't want to notify the users + // again. + if ($topic_data['topic_visibility'] == ITEM_UNAPPROVED) + { + $phpbb_notifications->add_notifications(array( + 'notification.type.quote', + 'notification.type.topic', + ), $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']); + + if ($notify_poster) + { + $phpbb_notifications->add_notifications('notification.type.approve_topic', $topic_data); + } + } + } + + meta_refresh(3, $redirect); + $message = $user->lang[$success_msg]; + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $message, + 'REFRESH_DATA' => null, + 'visible' => true, + )); + } + $message .= '

' . $user->lang('RETURN_PAGE', '', ''); + + // If approving one topic, also give links back to topic... + if (sizeof($topic_info) == 1 && $topic_url) + { + $message .= '

' . $user->lang('RETURN_TOPIC', '', ''); + } + trigger_error($message); + } + else + { + $show_notify = false; + + if ($action == 'approve') + { + foreach ($topic_info as $topic_data) + { + if ($topic_data['topic_poster'] == ANONYMOUS) + { + continue; + } + else + { + $show_notify = true; + break; + } + } + } + + $template->assign_vars(array( + 'S_NOTIFY_POSTER' => $show_notify, + 'S_' . strtoupper($action) => true, + )); + + confirm_box(false, strtoupper($action) . '_TOPIC' . ((sizeof($topic_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html'); + } + + redirect($redirect); + } + + /** + * Disapprove Post + * + * @param $post_id_list array IDs of the posts to disapprove/delete + * @param $id mixed Category of the current active module + * @param $mode string Active module + * @return null + */ + static public function disapprove_posts($post_id_list, $id, $mode) + { + global $db, $template, $user, $config, $phpbb_container; + global $phpEx, $phpbb_root_path, $request; + + if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve'))) + { + trigger_error('NOT_AUTHORISED'); + } + + $redirect = $request->variable('redirect', build_url(array('t', 'mode', 'quickmod')) . "&mode=$mode"); + $redirect = reapply_sid($redirect); + $reason = $request->variable('reason', '', true); + $reason_id = $request->variable('reason_id', 0); + $success_msg = $additional_msg = ''; + + $s_hidden_fields = build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'post_id_list' => $post_id_list, + 'action' => 'disapprove', + 'redirect' => $redirect, + )); + + $notify_poster = $request->is_set('notify_poster'); + $disapprove_reason = ''; + + if ($reason_id) + { + $sql = 'SELECT reason_title, reason_description + 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 || (!$reason && strtolower($row['reason_title']) == 'other')) + { + $additional_msg = $user->lang['NO_REASON_DISAPPROVAL']; + + $request->overwrite('confirm', null, \phpbb\request\request_interface::POST); + $request->overwrite('confirm_key', null, \phpbb\request\request_interface::POST); + $request->overwrite('confirm_key', null, \phpbb\request\request_interface::REQUEST); + } + else + { + // If the reason is defined within the language file, we will use the localized version, else just use the database entry... + $disapprove_reason = (strtolower($row['reason_title']) != 'other') ? ((isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description']) : ''; + $disapprove_reason .= ($reason) ? "\n\n" . $reason : ''; + + if (isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) + { + $disapprove_reason_lang = strtoupper($row['reason_title']); + } + } + } + + $post_info = phpbb_get_post_data($post_id_list, 'm_approve'); + + $is_disapproving = false; + foreach ($post_info as $post_id => $post_data) + { + if ($post_data['post_visibility'] == ITEM_DELETED) + { + continue; + } + + $is_disapproving = true; + } + + if (confirm_box(true)) + { + $disapprove_log = $disapprove_log_topics = $disapprove_log_posts = array(); + $topic_posts_unapproved = $post_disapprove_list = $topic_information = array(); + + // Build a list of posts to be disapproved and get the related topics real replies count + foreach ($post_info as $post_id => $post_data) + { + $post_disapprove_list[$post_id] = $post_data['topic_id']; + if (!isset($topic_posts_unapproved[$post_data['topic_id']])) + { + $topic_information[$post_data['topic_id']] = $post_data; + $topic_posts_unapproved[$post_data['topic_id']] = 0; + } + $topic_posts_unapproved[$post_data['topic_id']]++; + } + + // Now we build the log array + foreach ($post_disapprove_list as $post_id => $topic_id) + { + // If the count of disapproved posts for the topic is equal + // to the number of unapproved posts in the topic, and there are no different + // posts, we disapprove the hole topic + if ($topic_information[$topic_id]['topic_posts_approved'] == 0 && + $topic_information[$topic_id]['topic_posts_softdeleted'] == 0 && + $topic_information[$topic_id]['topic_posts_unapproved'] == $topic_posts_unapproved[$topic_id]) + { + // Don't write the log more than once for every topic + if (!isset($disapprove_log_topics[$topic_id])) + { + // Build disapproved topics log + $disapprove_log_topics[$topic_id] = array( + 'type' => 'topic', + 'post_subject' => $post_info[$post_id]['topic_title'], + 'forum_id' => $post_info[$post_id]['forum_id'], + 'topic_id' => 0, // useless to log a topic id, as it will be deleted + 'post_username' => ($post_info[$post_id]['poster_id'] == ANONYMOUS && !empty($post_info[$post_id]['post_username'])) ? $post_info[$post_id]['post_username'] : $post_info[$post_id]['username'], + ); + } + } + else + { + // Build disapproved posts log + $disapprove_log_posts[] = array( + 'type' => 'post', + 'post_subject' => $post_info[$post_id]['post_subject'], + 'forum_id' => $post_info[$post_id]['forum_id'], + 'topic_id' => $post_info[$post_id]['topic_id'], + 'post_username' => ($post_info[$post_id]['poster_id'] == ANONYMOUS && !empty($post_info[$post_id]['post_username'])) ? $post_info[$post_id]['post_username'] : $post_info[$post_id]['username'], + ); + + } + } + + // Get disapproved posts/topics counts separately + $num_disapproved_topics = sizeof($disapprove_log_topics); + $num_disapproved_posts = sizeof($disapprove_log_posts); + + // Build the whole log + $disapprove_log = array_merge($disapprove_log_topics, $disapprove_log_posts); + + // Unset unneeded arrays + unset($post_data, $disapprove_log_topics, $disapprove_log_posts); + + // Let's do the job - delete disapproved posts + if (sizeof($post_disapprove_list)) + { + if (!function_exists('delete_posts')) + { + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } + + // We do not check for permissions here, because the moderator allowed approval/disapproval should be allowed to delete the disapproved posts + // Note: function delete_posts triggers related forums/topics sync, + // so we don't need to call update_post_information later and to adjust real topic replies or forum topics count manually + delete_posts('post_id', array_keys($post_disapprove_list)); + + foreach ($disapprove_log as $log_data) + { + 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']); + } + 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_notifications = $phpbb_container->get('notification_manager'); + + $lang_reasons = array(); + + foreach ($post_info as $post_id => $post_data) + { + $disapprove_all_posts_in_topic = $topic_information[$topic_id]['topic_posts_approved'] == 0 && + $topic_information[$topic_id]['topic_posts_softdeleted'] == 0 && + $topic_information[$topic_id]['topic_posts_unapproved'] == $topic_posts_unapproved[$topic_id]; + + $phpbb_notifications->delete_notifications('notification.type.post_in_queue', $post_id); + + // Do we disapprove the whole topic? Remove potential notifications + if ($disapprove_all_posts_in_topic) + { + $phpbb_notifications->delete_notifications('notification.type.topic_in_queue', $post_data['topic_id']); + } + + // Notify Poster? + if ($notify_poster) + { + if ($post_data['poster_id'] == ANONYMOUS) + { + continue; + } + + $post_data['disapprove_reason'] = ''; + if (isset($disapprove_reason_lang)) + { + // Okay we need to get the reason from the posters language + if (!isset($lang_reasons[$post_data['user_lang']])) + { + // Assign the current users translation as the default, this is not ideal but getting the board default adds another layer of complexity. + $lang_reasons[$post_data['user_lang']] = $user->lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang]; + + // Only load up the language pack if the language is different to the current one + if ($post_data['user_lang'] != $user->lang_name && file_exists($phpbb_root_path . '/language/' . $post_data['user_lang'] . '/mcp.' . $phpEx)) + { + // Load up the language pack + $lang = array(); + @include($phpbb_root_path . '/language/' . basename($post_data['user_lang']) . '/mcp.' . $phpEx); + + // If we find the reason in this language pack use it + if (isset($lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang])) + { + $lang_reasons[$post_data['user_lang']] = $lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang]; + } + + unset($lang); // Free memory + } + } + + $post_data['disapprove_reason'] = $lang_reasons[$post_data['user_lang']]; + $post_data['disapprove_reason'] .= ($reason) ? "\n\n" . $reason : ''; + } + + if ($disapprove_all_posts_in_topic && $topic_information[$topic_id]['topic_posts_unapproved'] == 1) + { + // If there is only 1 post when disapproving the topic, + // we send the user a "disapprove topic" notification... + $phpbb_notifications->add_notifications('notification.type.disapprove_topic', $post_data); + } + else + { + // ... otherwise there are multiple unapproved posts and + // all of them are disapproved as posts. + $phpbb_notifications->add_notifications('notification.type.disapprove_post', $post_data); + } + } + } + + unset($lang_reasons, $post_info, $disapprove_reason, $disapprove_reason_lang); + + if ($num_disapproved_topics) + { + $success_msg = ($num_disapproved_topics == 1) ? 'TOPIC' : 'TOPICS'; + } + else + { + $success_msg = ($num_disapproved_posts == 1) ? 'POST' : 'POSTS'; + } + + if ($is_disapproving) + { + $success_msg .= '_DISAPPROVED_SUCCESS'; + } + else + { + $success_msg .= '_DELETED_SUCCESS'; + } + + // If we came from viewtopic, we try to go back to it. + if (strpos($redirect, $phpbb_root_path . 'viewtopic.' . $phpEx) === 0) + { + if ($num_disapproved_topics == 0) + { + // So we need to remove the post id part from the Url + $redirect = str_replace("&p={$post_id_list[0]}#p{$post_id_list[0]}", '', $redirect); + } + else + { + // However this is only possible if the topic still exists, + // Otherwise we go back to the viewforum page + $redirect = append_sid($phpbb_root_path . 'viewforum.' . $phpEx, 'f=' . $request->variable('f', 0)); + } + } + + meta_refresh(3, $redirect); + $message = $user->lang[$success_msg]; + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $message, + 'REFRESH_DATA' => null, + 'visible' => false, + )); + } + $message .= '

' . $user->lang('RETURN_PAGE', '', ''); + trigger_error($message); + } + else + { + if (!function_exists('display_reasons')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } + + $show_notify = false; + + foreach ($post_info as $post_data) + { + if ($post_data['poster_id'] == ANONYMOUS) + { + continue; + } + else + { + $show_notify = true; + break; + } + } + + $l_confirm_msg = 'DISAPPROVE_POST'; + $confirm_template = 'mcp_approve.html'; + if ($is_disapproving) + { + display_reasons($reason_id); + } + else + { + $user->add_lang('posting'); + + $l_confirm_msg = 'DELETE_POST_PERMANENTLY'; + $confirm_template = 'confirm_delete_body.html'; + } + $l_confirm_msg .= ((sizeof($post_id_list) == 1) ? '' : 'S'); + + $template->assign_vars(array( + 'S_NOTIFY_POSTER' => $show_notify, + 'S_APPROVE' => false, + 'REASON' => ($is_disapproving) ? $reason : '', + 'ADDITIONAL_MSG' => $additional_msg, + )); + + confirm_box(false, $l_confirm_msg, $s_hidden_fields, $confirm_template); + } + + redirect($redirect); + } +} diff --git a/sources/phpBB/includes/mcp/mcp_reports.php b/sources/phpBB/includes/mcp/mcp_reports.php new file mode 100644 index 0000000..804d48e --- /dev/null +++ b/sources/phpBB/includes/mcp/mcp_reports.php @@ -0,0 +1,741 @@ + +* @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; +} + +/** +* mcp_reports +* Handling the reports queue +*/ +class mcp_reports +{ + var $p_master; + var $u_action; + + function mcp_reports(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($id, $mode) + { + global $auth, $db, $user, $template, $cache; + 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); + + $this->page_title = 'MCP_REPORTS'; + + switch ($action) + { + case 'close': + case 'delete': + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $report_id_list = request_var('report_id_list', array(0)); + + if (!sizeof($report_id_list)) + { + trigger_error('NO_REPORT_SELECTED'); + } + + close_report($report_id_list, $mode, $action); + + break; + } + + switch ($mode) + { + case 'report_details': + + $user->add_lang(array('posting', 'viewforum', 'viewtopic')); + + $post_id = request_var('p', 0); + + // closed reports are accessed by report id + $report_id = request_var('r', 0); + + $sql = '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 + FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u + WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id") . ' + AND rr.reason_id = r.reason_id + AND r.user_id = u.user_id + AND r.pm_id = 0 + ORDER BY report_closed ASC'; + $result = $db->sql_query_limit($sql, 1); + $report = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$report) + { + trigger_error('NO_REPORT'); + } + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + $phpbb_notifications->mark_notifications_read('notification.type.report_post', $post_id, $user->data['user_id']); + + if (!$report_id && $report['report_closed']) + { + trigger_error('REPORT_CLOSED'); + } + + $post_id = $report['post_id']; + $report_id = $report['report_id']; + + $parse_post_flags = $report['reported_post_enable_bbcode'] ? OPTION_FLAG_BBCODE : 0; + $parse_post_flags += $report['reported_post_enable_smilies'] ? OPTION_FLAG_SMILIES : 0; + $parse_post_flags += $report['reported_post_enable_magic_url'] ? OPTION_FLAG_LINKS : 0; + + $post_info = phpbb_get_post_data(array($post_id), 'm_report', true); + + if (!sizeof($post_info)) + { + trigger_error('NO_REPORT_SELECTED'); + } + + $post_info = $post_info[$post_id]; + + $reason = array('title' => $report['reason_title'], 'description' => $report['reason_description']); + if (isset($user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])])) + { + $reason['description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])]; + $reason['title'] = $user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])]; + } + + if (topic_review($post_info['topic_id'], $post_info['forum_id'], 'topic_review', 0, false)) + { + $template->assign_vars(array( + 'S_TOPIC_REVIEW' => true, + 'S_BBCODE_ALLOWED' => $post_info['enable_bbcode'], + 'TOPIC_TITLE' => $post_info['topic_title'], + 'REPORTED_POST_ID' => $post_id, + )); + } + + $topic_tracking_info = $extensions = $attachments = array(); + // Get topic tracking info + if ($config['load_db_lastread']) + { + $tmp_topic_data = array($post_info['topic_id'] => $post_info); + $topic_tracking_info = get_topic_tracking($post_info['forum_id'], $post_info['topic_id'], $tmp_topic_data, array($post_info['forum_id'] => $post_info['forum_mark_time'])); + unset($tmp_topic_data); + } + else + { + $topic_tracking_info = get_complete_topic_tracking($post_info['forum_id'], $post_info['topic_id']); + } + + $post_unread = (isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']]) ? true : false; + $message = generate_text_for_display( + $report['reported_post_text'], + $report['reported_post_uid'], + $report['reported_post_bitfield'], + $parse_post_flags, + false + ); + + $report['report_text'] = make_clickable(bbcode_nl2br($report['report_text'])); + + if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id'])) + { + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE post_msg_id = ' . $post_id . ' + AND in_message = 0 + AND filetime <= ' . (int) $report['report_time'] . ' + ORDER BY filetime DESC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $attachments[] = $row; + } + $db->sql_freeresult($result); + + if (sizeof($attachments)) + { + $update_count = array(); + parse_attachments($post_info['forum_id'], $message, $attachments, $update_count); + } + + // Display not already displayed Attachments for this post, we already parsed them. ;) + if (!empty($attachments)) + { + $template->assign_var('S_HAS_ATTACHMENTS', true); + + foreach ($attachments as $attachment) + { + $template->assign_block_vars('attachment', array( + 'DISPLAY_ATTACHMENT' => $attachment) + ); + } + } + } + + $template->assign_vars(array( + 'S_MCP_REPORT' => true, + 'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), + 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), + 'S_POST_REPORTED' => $post_info['post_reported'], + 'S_POST_UNAPPROVED' => $post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE, + 'S_POST_LOCKED' => $post_info['post_edit_locked'], + 'S_REPORT_CLOSED' => $report['report_closed'], + 'S_USER_NOTES' => true, + + 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '', + 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), + 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), + 'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $report['user_id']), + 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']), + 'U_MCP_WARN_REPORTER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $report['user_id']) : '', + 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '', + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $post_info['forum_id']), + 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&p=' . $post_info['post_id'] . '#p' . $post_info['post_id']), + 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']), + + 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), + 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'), + 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']), + + 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '', ''), + 'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']), + 'REPORT_DATE' => $user->format_date($report['report_time']), + 'REPORT_ID' => $report_id, + 'REPORT_REASON_TITLE' => $reason['title'], + 'REPORT_REASON_DESCRIPTION' => $reason['description'], + 'REPORT_TEXT' => $report['report_text'], + + 'POST_AUTHOR_FULL' => get_username_string('full', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), + 'POST_AUTHOR_COLOUR' => get_username_string('colour', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), + 'POST_AUTHOR' => get_username_string('username', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), + 'U_POST_AUTHOR' => get_username_string('profile', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), + + 'REPORTER_FULL' => get_username_string('full', $report['user_id'], $report['username'], $report['user_colour']), + 'REPORTER_COLOUR' => get_username_string('colour', $report['user_id'], $report['username'], $report['user_colour']), + 'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']), + 'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']), + + 'POST_PREVIEW' => $message, + '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_ID' => $post_info['post_id'], + + 'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? $this->u_action . '&r=' . $report_id . '&p=' . $post_id . '&f=' . $forum_id . '&lookup=' . $post_info['poster_ip'] . '#ip' : '', + )); + + $this->tpl_name = 'mcp_post'; + + break; + + case 'reports': + case 'reports_closed': + $topic_id = request_var('t', 0); + + $forum_info = array(); + $forum_list_reports = get_forum_list('m_report', false, true); + $forum_list_read = array_flip(get_forum_list('f_read', true, true)); // Flipped so we can isset() the forum IDs + + // Remove forums we cannot read + foreach ($forum_list_reports as $k => $forum_data) + { + if (!isset($forum_list_read[$forum_data['forum_id']])) + { + unset($forum_list_reports[$k]); + } + } + unset($forum_list_read); + + if ($topic_id) + { + $topic_info = phpbb_get_topic_data(array($topic_id)); + + if (!sizeof($topic_info)) + { + trigger_error('TOPIC_NOT_EXIST'); + } + + if ($forum_id != $topic_info[$topic_id]['forum_id']) + { + $topic_id = 0; + } + else + { + $topic_info = $topic_info[$topic_id]; + $forum_id = (int) $topic_info['forum_id']; + } + } + + $forum_list = array(); + + if (!$forum_id) + { + foreach ($forum_list_reports as $row) + { + $forum_list[] = $row['forum_id']; + } + + if (!sizeof($forum_list)) + { + trigger_error('NOT_MODERATOR'); + } + + $global_id = $forum_list[0]; + + $sql = 'SELECT SUM(forum_topics_approved) as sum_forum_topics + FROM ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_list); + $result = $db->sql_query($sql); + $forum_info['forum_topics_approved'] = (int) $db->sql_fetchfield('sum_forum_topics'); + $db->sql_freeresult($result); + } + else + { + $forum_info = phpbb_get_forum_data(array($forum_id), 'm_report'); + + if (!sizeof($forum_info)) + { + trigger_error('NOT_MODERATOR'); + } + + $forum_info = $forum_info[$forum_id]; + $forum_list = array($forum_id); + } + + $forum_list[] = 0; + $forum_data = array(); + $pagination = $phpbb_container->get('pagination'); + + $forum_options = ''; + foreach ($forum_list_reports as $row) + { + $forum_options .= ''; + $forum_data[$row['forum_id']] = $row; + } + unset($forum_list_reports); + + $sort_days = $total = 0; + $sort_key = $sort_dir = ''; + $sort_by_sql = $sort_order_sql = array(); + phpbb_mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id); + + $forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total; + $limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : ''; + + if ($mode == 'reports') + { + $report_state = 'AND p.post_reported = 1 AND r.report_closed = 0'; + } + else + { + $report_state = 'AND r.report_closed = 1'; + } + + $sql = 'SELECT r.report_id + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . REPORTS_TABLE . ' r ' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . (($sort_order_sql[0] == 'r') ? ', ' . USERS_TABLE . ' ru' : '') . ' + WHERE ' . $db->sql_in_set('p.forum_id', $forum_list) . " + $report_state + AND r.post_id = p.post_id + " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . ' + ' . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = r.user_id' : '') . ' + ' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . " + AND t.topic_id = p.topic_id + AND r.pm_id = 0 + $limit_time_sql + ORDER BY $sort_order_sql"; + + /** + * Alter sql query to get report id of all reports for requested forum and topic or just forum + * + * @event core.mcp_reports_get_reports_query_before + * @var string sql String with the query to be executed + * @var array forum_list List of forums that contain the posts + * @var int topic_id topic_id in the page request + * @var string limit_time_sql String with the SQL code to limit the time interval of the post (Note: May be empty string) + * @var string sort_order_sql String with the ORDER BY SQL code used in this query + * @since 3.1.0-RC4 + */ + $vars = array( + 'sql', + 'forum_list', + 'topic_id', + 'limit_time_sql', + 'sort_order_sql', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_reports_get_reports_query_before', compact($vars))); + + $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); + + $i = 0; + $report_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $report_ids[] = $row['report_id']; + $row_num[$row['report_id']] = $i++; + } + $db->sql_freeresult($result); + + if (sizeof($report_ids)) + { + $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, p.post_attachment, u.username, u.username_clean, u.user_colour, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id + FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . USERS_TABLE . ' ru + WHERE ' . $db->sql_in_set('r.report_id', $report_ids) . ' + AND t.topic_id = p.topic_id + AND r.post_id = p.post_id + AND u.user_id = p.poster_id + AND ru.user_id = r.user_id + AND r.pm_id = 0 + ORDER BY ' . $sort_order_sql; + $result = $db->sql_query($sql); + + $report_data = $rowset = array(); + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('postrow', array( + 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']), + 'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&p=' . $row['post_id']) . '#p' . $row['post_id'], + 'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=reports&start=$start&mode=report_details&f={$row['forum_id']}&r={$row['report_id']}"), + + 'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + 'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + 'POST_AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + 'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + + 'REPORTER_FULL' => get_username_string('full', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), + 'REPORTER_COLOUR' => get_username_string('colour', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), + 'REPORTER' => get_username_string('username', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), + 'U_REPORTER' => get_username_string('profile', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), + + 'FORUM_NAME' => $forum_data[$row['forum_id']]['forum_name'], + 'POST_ID' => $row['post_id'], + 'POST_SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'], + 'POST_TIME' => $user->format_date($row['post_time']), + 'REPORT_ID' => $row['report_id'], + 'REPORT_TIME' => $user->format_date($row['report_time']), + 'TOPIC_TITLE' => $row['topic_title'], + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + )); + } + $db->sql_freeresult($result); + unset($report_ids, $row); + } + + $base_url = $this->u_action . "&f=$forum_id&t=$topic_id&st=$sort_days&sk=$sort_key&sd=$sort_dir"; + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start); + + // Now display the page + $template->assign_vars(array( + 'L_EXPLAIN' => ($mode == 'reports') ? $user->lang['MCP_REPORTS_OPEN_EXPLAIN'] : $user->lang['MCP_REPORTS_CLOSED_EXPLAIN'], + 'L_TITLE' => ($mode == 'reports') ? $user->lang['MCP_REPORTS_OPEN'] : $user->lang['MCP_REPORTS_CLOSED'], + 'L_ONLY_TOPIC' => ($topic_id) ? sprintf($user->lang['ONLY_TOPIC'], $topic_info['topic_title']) : '', + + 'S_MCP_ACTION' => $this->u_action, + 'S_FORUM_OPTIONS' => $forum_options, + 'S_CLOSED' => ($mode == 'reports_closed') ? true : false, + + 'TOPIC_ID' => $topic_id, + 'TOTAL' => $total, + 'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $total), + ) + ); + + $this->tpl_name = 'mcp_reports'; + break; + } + } +} + +/** +* Closes a report +*/ +function close_report($report_id_list, $mode, $action, $pm = false) +{ + global $db, $template, $user, $config, $auth; + global $phpEx, $phpbb_root_path, $phpbb_container; + + $pm_where = ($pm) ? ' AND r.post_id = 0 ' : ' AND r.pm_id = 0 '; + $id_column = ($pm) ? 'pm_id' : 'post_id'; + $module = ($pm) ? 'pm_reports' : 'reports'; + $pm_prefix = ($pm) ? 'PM_' : ''; + + $sql = "SELECT r.$id_column + FROM " . REPORTS_TABLE . ' r + WHERE ' . $db->sql_in_set('r.report_id', $report_id_list) . $pm_where; + $result = $db->sql_query($sql); + + $post_id_list = array(); + while ($row = $db->sql_fetchrow($result)) + { + $post_id_list[] = $row[$id_column]; + } + $post_id_list = array_unique($post_id_list); + + if ($pm) + { + if (!$auth->acl_getf_global('m_report')) + { + trigger_error('NOT_AUTHORISED'); + } + } + else + { + if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_report'))) + { + trigger_error('NOT_AUTHORISED'); + } + } + + if ($action == 'delete' && strpos($user->data['session_page'], 'mode=report_details') !== false) + { + $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&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')) . '&mode=pm_reports'); + } + else if ($action == 'close' && !request_var('r', 0)) + { + $redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&mode=' . $module); + } + else + { + $redirect = request_var('redirect', build_url(array('quickmod'))); + } + $success_msg = ''; + $forum_ids = array(); + $topic_ids = array(); + + $s_hidden_fields = build_hidden_fields(array( + 'i' => $module, + 'mode' => $mode, + 'report_id_list' => $report_id_list, + 'action' => $action, + 'redirect' => $redirect) + ); + + if (confirm_box(true)) + { + $post_info = ($pm) ? phpbb_get_pm_data($post_id_list) : phpbb_get_post_data($post_id_list, 'm_report'); + + $sql = "SELECT r.report_id, r.$id_column, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type + FROM " . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u + WHERE ' . $db->sql_in_set('r.report_id', $report_id_list) . ' + ' . (($action == 'close') ? 'AND r.report_closed = 0' : '') . ' + AND r.user_id = u.user_id' . $pm_where; + $result = $db->sql_query($sql); + + $reports = $close_report_posts = $close_report_topics = $notify_reporters = $report_id_list = array(); + while ($report = $db->sql_fetchrow($result)) + { + $reports[$report['report_id']] = $report; + $report_id_list[] = $report['report_id']; + + if (!$report['report_closed']) + { + $close_report_posts[] = $report[$id_column]; + + if (!$pm) + { + $close_report_topics[] = $post_info[$report['post_id']]['topic_id']; + } + } + + if ($report['user_notify'] && !$report['report_closed']) + { + $notify_reporters[$report['report_id']] = &$reports[$report['report_id']]; + } + } + $db->sql_freeresult($result); + + if (sizeof($reports)) + { + $close_report_posts = array_unique($close_report_posts); + $close_report_topics = array_unique($close_report_topics); + + if (!$pm && sizeof($close_report_posts)) + { + // Get a list of topics that still contain reported posts + $sql = 'SELECT DISTINCT topic_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $close_report_topics) . ' + AND post_reported = 1 + AND ' . $db->sql_in_set('post_id', $close_report_posts, true); + $result = $db->sql_query($sql); + + $keep_report_topics = array(); + while ($row = $db->sql_fetchrow($result)) + { + $keep_report_topics[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + $close_report_topics = array_diff($close_report_topics, $keep_report_topics); + unset($keep_report_topics); + } + + $db->sql_transaction('begin'); + + if ($action == 'close') + { + $sql = 'UPDATE ' . REPORTS_TABLE . ' + SET report_closed = 1 + WHERE ' . $db->sql_in_set('report_id', $report_id_list); + } + else + { + $sql = 'DELETE FROM ' . REPORTS_TABLE . ' + WHERE ' . $db->sql_in_set('report_id', $report_id_list); + } + $db->sql_query($sql); + + if (sizeof($close_report_posts)) + { + if ($pm) + { + $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' + SET message_reported = 0 + WHERE ' . $db->sql_in_set('msg_id', $close_report_posts); + $db->sql_query($sql); + + if ($action == 'delete') + { + delete_pm(ANONYMOUS, $close_report_posts, PRIVMSGS_INBOX); + } + } + else + { + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET post_reported = 0 + WHERE ' . $db->sql_in_set('post_id', $close_report_posts); + $db->sql_query($sql); + + if (sizeof($close_report_topics)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_reported = 0 + WHERE ' . $db->sql_in_set('topic_id', $close_report_topics) . ' + OR ' . $db->sql_in_set('topic_moved_id', $close_report_topics); + $db->sql_query($sql); + } + } + } + + $db->sql_transaction('commit'); + } + unset($close_report_posts, $close_report_topics); + + $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_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_notifications->delete_notifications('notification.type.report_post', $report['post_id']); + } + } + + // Notify reporters + if (sizeof($notify_reporters)) + { + foreach ($notify_reporters as $report_id => $reporter) + { + if ($reporter['user_id'] == ANONYMOUS) + { + continue; + } + + $post_id = $reporter[$id_column]; + + if ($pm) + { + $phpbb_notifications->add_notifications('notification.type.report_pm_closed', array_merge($post_info[$post_id], array( + 'reporter' => $reporter['user_id'], + 'closer_id' => $user->data['user_id'], + 'from_user_id' => $post_info[$post_id]['author_id'], + ))); + } + else + { + $phpbb_notifications->add_notifications('notification.type.report_post_closed', array_merge($post_info[$post_id], array( + 'reporter' => $reporter['user_id'], + 'closer_id' => $user->data['user_id'], + ))); + } + } + } + + if (!$pm) + { + foreach ($post_info as $post) + { + $forum_ids[$post['forum_id']] = $post['forum_id']; + $topic_ids[$post['topic_id']] = $post['topic_id']; + } + } + + unset($notify_reporters, $post_info, $reports); + + $success_msg = (sizeof($report_id_list) == 1) ? "{$pm_prefix}REPORT_" . strtoupper($action) . 'D_SUCCESS' : "{$pm_prefix}REPORTS_" . strtoupper($action) . 'D_SUCCESS'; + } + else + { + 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 = reapply_sid($redirect); + + if (!$success_msg) + { + redirect($redirect); + } + else + { + meta_refresh(3, $redirect); + + $return_forum = ''; + $return_topic = ''; + + if (!$pm) + { + if (sizeof($forum_ids) === 1) + { + $return_forum = sprintf($user->lang['RETURN_FORUM'], '', '') . '

'; + } + + if (sizeof($topic_ids) === 1) + { + $return_topic = sprintf($user->lang['RETURN_TOPIC'], '', '') . '

'; + } + } + + trigger_error($user->lang[$success_msg] . '

' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "", '')); + } +} diff --git a/sources/phpBB/includes/mcp/mcp_topic.php b/sources/phpBB/includes/mcp/mcp_topic.php new file mode 100644 index 0000000..1698b08 --- /dev/null +++ b/sources/phpBB/includes/mcp/mcp_topic.php @@ -0,0 +1,695 @@ + +* @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; +} + +/** +* View topic in MCP +*/ +function mcp_topic_view($id, $mode, $action) +{ + global $phpEx, $phpbb_root_path, $config; + global $template, $db, $user, $auth, $cache, $phpbb_container; + + $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . phpbb_extra_url()); + + $user->add_lang('viewtopic'); + $pagination = $phpbb_container->get('pagination'); + + $topic_id = request_var('t', 0); + $topic_info = phpbb_get_topic_data(array($topic_id), false, true); + + if (!sizeof($topic_info)) + { + trigger_error('TOPIC_NOT_EXIST'); + } + + $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); + $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)); + + // Resync Topic? + if ($action == 'resync') + { + if (!function_exists('mcp_resync_topics')) + { + include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx); + } + mcp_resync_topics(array($topic_id)); + } + + // Split Topic? + if ($action == 'split_all' || $action == 'split_beyond') + { + if (!$sort) + { + split_topic($action, $topic_id, $to_forum_id, $subject); + } + $action = 'split'; + } + + // Merge Posts? + if ($action == 'merge_posts') + { + if (!$sort) + { + merge_posts($topic_id, $to_topic_id); + } + $action = 'merge'; + } + + if ($action == 'split' && !$subject) + { + $subject = $topic_info['topic_title']; + } + + // Restore or pprove posts? + if (($action == 'restore' || $action == 'approve') && $auth->acl_get('m_approve', $topic_info['forum_id'])) + { + include($phpbb_root_path . 'includes/mcp/mcp_queue.' . $phpEx); + include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + if (!sizeof($post_id_list)) + { + trigger_error('NO_POST_SELECTED'); + } + + if (!$sort) + { + mcp_queue::approve_posts($action, $post_id_list, $id, $mode); + } + } + + // Jumpbox, sort selects and that kind of things + make_jumpbox($url . "&i=$id&mode=forum_view", $topic_info['forum_id'], false, 'm_', true); + $where_sql = ($action == 'reports') ? 'WHERE post_reported = 1 AND ' : 'WHERE'; + + $sort_days = $total = 0; + $sort_key = $sort_dir = ''; + $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)) : ''; + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + + 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']))); + if ($posts_per_page == 0) + { + $posts_per_page = $total; + } + + if ((!empty($sort_days_old) && $sort_days_old != $sort_days) || $total <= $posts_per_page) + { + $start = 0; + } + $start = $pagination->validate_start($start, $posts_per_page, $total); + + $sql = 'SELECT u.username, u.username_clean, u.user_colour, p.* + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u + WHERE ' . (($action == 'reports') ? 'p.post_reported = 1 AND ' : '') . ' + p.topic_id = ' . $topic_id . ' + AND ' . $phpbb_content_visibility->get_visibility_sql('post', $topic_info['forum_id'], 'p.') . ' + AND p.poster_id = u.user_id ' . + $limit_time_sql . ' + ORDER BY ' . $sort_order_sql; + $result = $db->sql_query_limit($sql, $posts_per_page, $start); + + $rowset = $post_id_list = array(); + $bbcode_bitfield = ''; + while ($row = $db->sql_fetchrow($result)) + { + $rowset[] = $row; + $post_id_list[] = $row['post_id']; + $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']); + } + $db->sql_freeresult($result); + + if ($bbcode_bitfield !== '') + { + include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); + $bbcode = new bbcode(base64_encode($bbcode_bitfield)); + } + + $topic_tracking_info = array(); + + // Get topic tracking info + if ($config['load_db_lastread']) + { + $tmp_topic_data = array($topic_id => $topic_info); + $topic_tracking_info = get_topic_tracking($topic_info['forum_id'], $topic_id, $tmp_topic_data, array($topic_info['forum_id'] => $topic_info['forum_mark_time'])); + unset($tmp_topic_data); + } + else + { + $topic_tracking_info = get_complete_topic_tracking($topic_info['forum_id'], $topic_id); + } + + $has_unapproved_posts = $has_deleted_posts = false; + + // Grab extensions + $extensions = $attachments = array(); + if ($topic_info['topic_attachment'] && sizeof($post_id_list)) + { + $extensions = $cache->obtain_attach_extensions($topic_info['forum_id']); + + // Get attachments... + if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $topic_info['forum_id'])) + { + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_msg_id', $post_id_list) . ' + AND in_message = 0 + ORDER BY filetime DESC, post_msg_id ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $attachments[$row['post_msg_id']][] = $row; + } + $db->sql_freeresult($result); + } + } + + foreach ($rowset as $i => $row) + { + $message = $row['post_text']; + $post_subject = ($row['post_subject'] != '') ? $row['post_subject'] : $topic_info['topic_title']; + + $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; + $message = generate_text_for_display($message, $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, false); + + if (!empty($attachments[$row['post_id']])) + { + $update_count = array(); + parse_attachments($topic_info['forum_id'], $message, $attachments[$row['post_id']], $update_count); + } + + if ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) + { + $has_unapproved_posts = true; + } + + if ($row['post_visibility'] == ITEM_DELETED) + { + $has_deleted_posts = true; + } + + $post_unread = (isset($topic_tracking_info[$topic_id]) && $row['post_time'] > $topic_tracking_info[$topic_id]) ? true : false; + + $template->assign_block_vars('postrow', array( + 'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + 'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + 'POST_AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + 'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + + 'POST_DATE' => $user->format_date($row['post_time']), + 'POST_SUBJECT' => $post_subject, + 'MESSAGE' => $message, + 'POST_ID' => $row['post_id'], + 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '', ''), + + 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'), + + 'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $topic_info['forum_id'])), + 'S_POST_UNAPPROVED' => (($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $topic_info['forum_id'])), + 'S_POST_DELETED' => ($row['post_visibility'] == ITEM_DELETED && $auth->acl_get('m_approve', $topic_info['forum_id'])), + 'S_CHECKED' => (($submitted_id_list && !in_array(intval($row['post_id']), $submitted_id_list)) || in_array(intval($row['post_id']), $checked_ids)) ? true : false, + 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false, + + 'U_POST_DETAILS' => "$url&i=$id&p={$row['post_id']}&mode=post_details" . (($forum_id) ? "&f=$forum_id" : ''), + 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $topic_info['forum_id'] . '&p=' . $row['post_id']) : '', + 'U_MCP_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $topic_info['forum_id'] . '&p=' . $row['post_id']) : '') + ); + + // Display not already displayed Attachments for this post, we already parsed them. ;) + if (!empty($attachments[$row['post_id']])) + { + foreach ($attachments[$row['post_id']] as $attachment) + { + $template->assign_block_vars('postrow.attachment', array( + 'DISPLAY_ATTACHMENT' => $attachment) + ); + } + } + + unset($rowset[$i]); + } + + // Display topic icons for split topic + $s_topic_icons = false; + + if ($auth->acl_gets('m_split', 'm_merge', (int) $topic_info['forum_id'])) + { + include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + $s_topic_icons = posting_gen_topic_icons('', $icon_id); + + // Has the user selected a topic for merge? + if ($to_topic_id) + { + $to_topic_info = phpbb_get_topic_data(array($to_topic_id), 'm_merge'); + + if (!sizeof($to_topic_info)) + { + $to_topic_id = 0; + } + else + { + $to_topic_info = $to_topic_info[$to_topic_id]; + + if (!$to_topic_info['enable_icons'] || $auth->acl_get('!f_icons', $topic_info['forum_id'])) + { + $s_topic_icons = false; + } + } + } + } + + $s_hidden_fields = build_hidden_fields(array( + 'st_old' => $sort_days, + 'post_ids' => $post_id_list, + )); + + $base_url = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&t={$topic_info['topic_id']}&mode=$mode&action=$action&to_topic_id=$to_topic_id&posts_per_page=$posts_per_page&st=$sort_days&sk=$sort_key&sd=$sort_dir"); + if ($posts_per_page) + { + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total, $posts_per_page, $start); + } + + $template->assign_vars(array( + 'TOPIC_TITLE' => $topic_info['topic_title'], + 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_info['forum_id'] . '&t=' . $topic_info['topic_id']), + + 'TO_TOPIC_ID' => $to_topic_id, + 'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '' . $to_topic_info['topic_title'] . '') : '', + + 'SPLIT_SUBJECT' => $subject, + 'POSTS_PER_PAGE' => $posts_per_page, + 'ACTION' => $action, + + 'REPORTED_IMG' => $user->img('icon_topic_reported', 'POST_REPORTED'), + 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'POST_UNAPPROVED'), + 'DELETED_IMG' => $user->img('icon_topic_deleted', 'POST_DELETED_RESTORE'), + 'INFO_IMG' => $user->img('icon_post_info', 'VIEW_INFO'), + + 'S_MCP_ACTION' => "$url&i=$id&mode=$mode&action=$action&start=$start", + 'S_FORUM_SELECT' => ($to_forum_id) ? make_forum_select($to_forum_id, false, false, true, true, true) : make_forum_select($topic_info['forum_id'], false, false, true, true, true), + 'S_CAN_SPLIT' => ($auth->acl_get('m_split', $topic_info['forum_id'])) ? true : false, + 'S_CAN_MERGE' => ($auth->acl_get('m_merge', $topic_info['forum_id'])) ? true : false, + 'S_CAN_DELETE' => ($auth->acl_get('m_delete', $topic_info['forum_id'])) ? true : false, + 'S_CAN_APPROVE' => ($has_unapproved_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false, + 'S_CAN_RESTORE' => ($has_deleted_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false, + 'S_CAN_LOCK' => ($auth->acl_get('m_lock', $topic_info['forum_id'])) ? true : false, + 'S_CAN_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? true : false, + 'S_CAN_SYNC' => $auth->acl_get('m_', $topic_info['forum_id']), + 'S_REPORT_VIEW' => ($action == 'reports') ? true : false, + 'S_MERGE_VIEW' => ($action == 'merge') ? true : false, + 'S_SPLIT_VIEW' => ($action == 'split') ? true : false, + + 'S_HIDDEN_FIELDS' => $s_hidden_fields, + + 'S_SHOW_TOPIC_ICONS' => $s_topic_icons, + 'S_TOPIC_ICON' => $icon_id, + + 'U_SELECT_TOPIC' => "$url&i=$id&mode=forum_view&action=merge_select" . (($forum_id) ? "&f=$forum_id" : ''), + + 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '', ''), + 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '', ''), + + 'TOTAL_POSTS' => $user->lang('VIEW_TOPIC_POSTS', (int) $total), + )); +} + +/** +* Split topic +*/ +function split_topic($action, $topic_id, $to_forum_id, $subject) +{ + global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $config; + + $post_id_list = request_var('post_id_list', array(0)); + $forum_id = request_var('forum_id', 0); + $start = request_var('start', 0); + + if (!sizeof($post_id_list)) + { + $template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']); + return; + } + + if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_split'))) + { + return; + } + + $post_id = $post_id_list[0]; + $post_info = phpbb_get_post_data(array($post_id)); + + if (!sizeof($post_info)) + { + $template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']); + return; + } + + $post_info = $post_info[$post_id]; + $subject = trim($subject); + + // Make some tests + if (!$subject) + { + $template->assign_var('MESSAGE', $user->lang['EMPTY_SUBJECT']); + return; + } + + if ($to_forum_id <= 0) + { + $template->assign_var('MESSAGE', $user->lang['NO_DESTINATION_FORUM']); + return; + } + + $forum_info = phpbb_get_forum_data(array($to_forum_id), 'f_post'); + + if (!sizeof($forum_info)) + { + $template->assign_var('MESSAGE', $user->lang['USER_CANNOT_POST']); + return; + } + + $forum_info = $forum_info[$to_forum_id]; + + if ($forum_info['forum_type'] != FORUM_POST) + { + $template->assign_var('MESSAGE', $user->lang['FORUM_NOT_POSTABLE']); + return; + } + + $redirect = request_var('redirect', build_url(array('quickmod'))); + + $s_hidden_fields = build_hidden_fields(array( + 'i' => 'main', + 'post_id_list' => $post_id_list, + 'f' => $forum_id, + 'mode' => 'topic_view', + 'start' => $start, + 'action' => $action, + 't' => $topic_id, + 'redirect' => $redirect, + 'subject' => $subject, + 'to_forum_id' => $to_forum_id, + 'icon' => request_var('icon', 0)) + ); + $success_msg = $return_link = ''; + + if (confirm_box(true)) + { + if ($action == 'split_beyond') + { + $sort_days = $total = 0; + $sort_key = $sort_dir = ''; + $sort_by_sql = $sort_order_sql = array(); + phpbb_mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id); + + $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : ''; + + if ($sort_order_sql[0] == 'u') + { + $sql = 'SELECT p.post_id, p.forum_id, p.post_visibility + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u + WHERE p.topic_id = $topic_id + AND p.poster_id = u.user_id + $limit_time_sql + ORDER BY $sort_order_sql"; + } + else + { + $sql = 'SELECT p.post_id, p.forum_id, p.post_visibility + FROM ' . POSTS_TABLE . " p + WHERE p.topic_id = $topic_id + $limit_time_sql + ORDER BY $sort_order_sql"; + } + $result = $db->sql_query_limit($sql, 0, $start); + + $store = false; + $post_id_list = array(); + while ($row = $db->sql_fetchrow($result)) + { + // If split from selected post (split_beyond), we split the unapproved items too. + if (($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) && !$auth->acl_get('m_approve', $row['forum_id'])) + { +// continue; + } + + // Start to store post_ids as soon as we see the first post that was selected + if ($row['post_id'] == $post_id) + { + $store = true; + } + + if ($store) + { + $post_id_list[] = $row['post_id']; + } + } + $db->sql_freeresult($result); + } + + if (!sizeof($post_id_list)) + { + trigger_error('NO_POST_SELECTED'); + } + + $icon_id = request_var('icon', 0); + + $sql_ary = array( + 'forum_id' => $to_forum_id, + 'topic_title' => $subject, + 'icon_id' => $icon_id, + 'topic_visibility' => 1 + ); + + $sql = 'INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + + $to_topic_id = $db->sql_nextid(); + move_posts($post_id_list, $to_topic_id); + + $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']); + + // Change topic title of first post + $sql = 'UPDATE ' . POSTS_TABLE . " + SET post_subject = '" . $db->sql_escape($subject) . "' + WHERE post_id = {$post_id_list[0]}"; + $db->sql_query($sql); + + // Copy topic subscriptions to new topic + $sql = 'SELECT user_id, notify_status + FROM ' . TOPICS_WATCH_TABLE . ' + WHERE topic_id = ' . $topic_id; + $result = $db->sql_query($sql); + + $sql_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $sql_ary[] = array( + 'topic_id' => (int) $to_topic_id, + 'user_id' => (int) $row['user_id'], + 'notify_status' => (int) $row['notify_status'], + ); + } + $db->sql_freeresult($result); + + if (sizeof($sql_ary)) + { + $db->sql_multi_insert(TOPICS_WATCH_TABLE, $sql_ary); + } + + // Copy bookmarks to new topic + $sql = 'SELECT user_id + FROM ' . BOOKMARKS_TABLE . ' + WHERE topic_id = ' . $topic_id; + $result = $db->sql_query($sql); + + $sql_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $sql_ary[] = array( + 'topic_id' => (int) $to_topic_id, + 'user_id' => (int) $row['user_id'], + ); + } + $db->sql_freeresult($result); + + if (sizeof($sql_ary)) + { + $db->sql_multi_insert(BOOKMARKS_TABLE, $sql_ary); + } + + $success_msg = 'TOPIC_SPLIT_SUCCESS'; + + // Update forum statistics + set_config_count('num_topics', 1, true); + + // Link back to both topics + $return_link = sprintf($user->lang['RETURN_TOPIC'], '', '') . '

' . sprintf($user->lang['RETURN_NEW_TOPIC'], '', ''); + $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); + $redirect = reapply_sid($redirect); + + meta_refresh(3, $redirect); + trigger_error($user->lang[$success_msg] . '

' . $return_link); + } + else + { + confirm_box(false, ($action == 'split_all') ? 'SPLIT_TOPIC_ALL' : 'SPLIT_TOPIC_BEYOND', $s_hidden_fields); + } +} + +/** +* Merge selected posts into selected topic +*/ +function merge_posts($topic_id, $to_topic_id) +{ + global $db, $template, $user, $phpEx, $phpbb_root_path, $auth; + + if (!$to_topic_id) + { + $template->assign_var('MESSAGE', $user->lang['NO_FINAL_TOPIC_SELECTED']); + return; + } + + $sync_topics = array($topic_id, $to_topic_id); + + $topic_data = phpbb_get_topic_data($sync_topics, 'm_merge'); + + if (!sizeof($topic_data) || empty($topic_data[$to_topic_id])) + { + $template->assign_var('MESSAGE', $user->lang['NO_FINAL_TOPIC_SELECTED']); + return; + } + + $sync_forums = array(); + foreach ($topic_data as $data) + { + $sync_forums[$data['forum_id']] = $data['forum_id']; + } + + $topic_data = $topic_data[$to_topic_id]; + + $post_id_list = request_var('post_id_list', array(0)); + $start = request_var('start', 0); + + if (!sizeof($post_id_list)) + { + $template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']); + return; + } + + if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_merge'))) + { + return; + } + + $redirect = request_var('redirect', build_url(array('quickmod'))); + + $s_hidden_fields = build_hidden_fields(array( + 'i' => 'main', + 'post_id_list' => $post_id_list, + 'to_topic_id' => $to_topic_id, + 'mode' => 'topic_view', + 'action' => 'merge_posts', + 'start' => $start, + 'redirect' => $redirect, + 't' => $topic_id) + ); + $success_msg = $return_link = ''; + + if (confirm_box(true)) + { + $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']); + + // Message and return links + $success_msg = 'POSTS_MERGED_SUCCESS'; + + // Does the original topic still exist? If yes, link back to it + $sql = 'SELECT forum_id + FROM ' . POSTS_TABLE . ' + WHERE topic_id = ' . $topic_id; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $return_link .= sprintf($user->lang['RETURN_TOPIC'], '', ''); + } + else + { + if (!function_exists('phpbb_update_rows_avoiding_duplicates_notify_status')) + { + include($phpbb_root_path . 'includes/functions_database_helper.' . $phpEx); + } + + // If the topic no longer exist, we will update the topic watch table. + phpbb_update_rows_avoiding_duplicates_notify_status($db, TOPICS_WATCH_TABLE, 'topic_id', array($topic_id), $to_topic_id); + + // If the topic no longer exist, we will update the bookmarks table. + phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', array($topic_id), $to_topic_id); + } + + // Re-sync the topics and forums because the auto-sync was deactivated in the call of move_posts() + sync('topic_reported', 'topic_id', $sync_topics); + sync('topic_attachment', 'topic_id', $sync_topics); + sync('topic', 'topic_id', $sync_topics, true); + sync('forum', 'forum_id', $sync_forums, true, true); + + // Link to the new topic + $return_link .= (($return_link) ? '

' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '', ''); + $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); + $redirect = reapply_sid($redirect); + + meta_refresh(3, $redirect); + trigger_error($user->lang[$success_msg] . '

' . $return_link); + } + else + { + confirm_box(false, 'MERGE_POSTS', $s_hidden_fields); + } +} diff --git a/sources/phpBB/includes/mcp/mcp_warn.php b/sources/phpBB/includes/mcp/mcp_warn.php new file mode 100644 index 0000000..d724b87 --- /dev/null +++ b/sources/phpBB/includes/mcp/mcp_warn.php @@ -0,0 +1,586 @@ + +* @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; +} + +/** +* mcp_warn +* Handling warning the users +*/ +class mcp_warn +{ + var $p_master; + var $u_action; + + function mcp_warn(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($id, $mode) + { + global $auth, $db, $user, $template; + global $config, $phpbb_root_path, $phpEx; + + $action = request_var('action', array('' => '')); + + if (is_array($action)) + { + list($action, ) = each($action); + } + + $this->page_title = 'MCP_WARN'; + + add_form_key('mcp_warn'); + + switch ($mode) + { + case 'front': + $this->mcp_warn_front_view(); + $this->tpl_name = 'mcp_warn_front'; + break; + + case 'list': + $this->mcp_warn_list_view($action); + $this->tpl_name = 'mcp_warn_list'; + break; + + case 'warn_post': + $this->mcp_warn_post_view($action); + $this->tpl_name = 'mcp_warn_post'; + break; + + case 'warn_user': + $this->mcp_warn_user_view($action); + $this->tpl_name = 'mcp_warn_user'; + break; + } + } + + /** + * Generates the summary on the main page of the warning module + */ + function mcp_warn_front_view() + { + global $phpEx, $phpbb_root_path, $config; + global $template, $db, $user, $auth; + + $template->assign_vars(array( + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username&select_single=true'), + 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user'), + )); + + // Obtain a list of the 5 naughtiest users.... + // These are the 5 users with the highest warning count + $highest = array(); + $count = 0; + + view_warned_users($highest, $count, 5); + + foreach ($highest as $row) + { + $template->assign_block_vars('highest', array( + 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $row['user_id']), + + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + + 'WARNING_TIME' => $user->format_date($row['user_last_warning']), + 'WARNINGS' => $row['user_warnings'], + )); + } + + // And now the 5 most recent users to get in trouble + $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_colour, u.user_warnings, w.warning_time + FROM ' . USERS_TABLE . ' u, ' . WARNINGS_TABLE . ' w + WHERE u.user_id = w.user_id + ORDER BY w.warning_time DESC'; + $result = $db->sql_query_limit($sql, 5); + + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('latest', array( + 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $row['user_id']), + + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + + 'WARNING_TIME' => $user->format_date($row['warning_time']), + 'WARNINGS' => $row['user_warnings'], + )); + } + $db->sql_freeresult($result); + } + + /** + * Lists all users with warnings + */ + function mcp_warn_list_view($action) + { + global $phpEx, $phpbb_root_path, $config, $phpbb_container; + global $template, $db, $user, $auth; + + $user->add_lang('memberlist'); + $pagination = $phpbb_container->get('pagination'); + + $start = request_var('start', 0); + $st = request_var('st', 0); + $sk = request_var('sk', 'b'); + $sd = request_var('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']); + $sort_by_sql = array('a' => 'username_clean', 'b' => 'user_last_warning', 'c' => 'user_warnings'); + + $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; + gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); + + // Define where and sort sql for use in displaying logs + $sql_where = ($st) ? (time() - ($st * 86400)) : 0; + $sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC'); + + $users = array(); + $user_count = 0; + + view_warned_users($users, $user_count, $config['topics_per_page'], $start, $sql_where, $sql_sort); + + foreach ($users as $row) + { + $template->assign_block_vars('user', array( + 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $row['user_id']), + + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + + 'WARNING_TIME' => $user->format_date($row['user_last_warning']), + 'WARNINGS' => $row['user_warnings'], + )); + } + + $base_url = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=warn&mode=list&st=$st&sk=$sk&sd=$sd"); + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $user_count, $config['topics_per_page'], $start); + + $template->assign_vars(array( + 'U_POST_ACTION' => $this->u_action, + 'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false, + 'S_SELECT_SORT_DIR' => $s_sort_dir, + 'S_SELECT_SORT_KEY' => $s_sort_key, + 'S_SELECT_SORT_DAYS' => $s_limit_days, + + 'TOTAL_USERS' => $user->lang('LIST_USERS', (int) $user_count), + )); + } + + /** + * Handles warning the user when the warning is for a specific post + */ + function mcp_warn_post_view($action) + { + global $phpEx, $phpbb_root_path, $config; + global $template, $db, $user, $auth, $phpbb_dispatcher; + + $post_id = request_var('p', 0); + $forum_id = request_var('f', 0); + $notify = (isset($_REQUEST['notify_user'])) ? true : false; + $warning = utf8_normalize_nfc(request_var('warning', '', true)); + + $sql = 'SELECT u.*, p.* + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u + WHERE p.post_id = $post_id + AND u.user_id = p.poster_id"; + $result = $db->sql_query($sql); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$user_row) + { + trigger_error('NO_POST'); + } + + // There is no point issuing a warning to ignored users (ie anonymous and bots) + if ($user_row['user_type'] == USER_IGNORE) + { + trigger_error('CANNOT_WARN_ANONYMOUS'); + } + + // Prevent someone from warning themselves + if ($user_row['user_id'] == $user->data['user_id']) + { + trigger_error('CANNOT_WARN_SELF'); + } + + // Check if there is already a warning for this post to prevent multiple + // warnings for the same offence + $sql = 'SELECT post_id + FROM ' . WARNINGS_TABLE . " + WHERE post_id = $post_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + trigger_error('ALREADY_WARNED'); + } + + $user_id = $user_row['user_id']; + + if (strpos($this->u_action, "&f=$forum_id&p=$post_id") === false) + { + $this->p_master->adjust_url("&f=$forum_id&p=$post_id"); + $this->u_action .= "&f=$forum_id&p=$post_id"; + } + + // Check if can send a notification + if ($config['allow_privmsg']) + { + $auth2 = new \phpbb\auth\auth(); + $auth2->acl($user_row); + $s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false; + unset($auth2); + } + else + { + $s_can_notify = false; + } + + // Prevent against clever people + if ($notify && !$s_can_notify) + { + $notify = false; + } + + if ($warning && $action == 'add_warning') + { + if (check_form_key('mcp_warn')) + { + $s_mcp_warn_post = true; + + /** + * Event for before warning a user for a post. + * + * @event core.mcp_warn_post_before + * @var array user_row The entire user row + * @var string warning The warning message + * @var bool notify If true, we notify the user for the warning + * @var int post_id The post id for which the warning is added + * @var bool s_mcp_warn_post If true, we add the warning else we omit it + * @since 3.1.0-b4 + */ + $vars = array( + 'user_row', + 'warning', + 'notify', + 'post_id', + 's_mcp_warn_post', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_warn_post_before', compact($vars))); + + if ($s_mcp_warn_post) + { + add_warning($user_row, $warning, $notify, $post_id); + $message = $user->lang['USER_WARNING_ADDED']; + + /** + * Event for after warning a user for a post. + * + * @event core.mcp_warn_post_after + * @var array user_row The entire user row + * @var string warning The warning message + * @var bool notify If true, the user was notified for the warning + * @var int post_id The post id for which the warning is added + * @var string message Message displayed to the moderator + * @since 3.1.0-b4 + */ + $vars = array( + 'user_row', + 'warning', + 'notify', + 'post_id', + 'message', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_warn_post_after', compact($vars))); + } + } + else + { + $message = $user->lang['FORM_INVALID']; + } + + if (!empty($message)) + { + $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&mode=user_notes&u=$user_id"); + meta_refresh(2, $redirect); + trigger_error($message . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); + } + } + + // OK, they didn't submit a warning so lets build the page for them to do so + + // We want to make the message available here as a reminder + // Parse the message and subject + $parse_flags = OPTION_FLAG_SMILIES | ($user_row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0); + $message = generate_text_for_display($user_row['post_text'], $user_row['bbcode_uid'], $user_row['bbcode_bitfield'], $parse_flags, true); + + // Generate the appropriate user information for the user we are looking at + if (!function_exists('phpbb_get_user_rank')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } + + $user_rank_data = phpbb_get_user_rank($user_row, $user_row['user_posts']); + $avatar_img = phpbb_get_user_avatar($user_row); + + $template->assign_vars(array( + 'U_POST_ACTION' => $this->u_action, + + 'POST' => $message, + 'USERNAME' => $user_row['username'], + 'USER_COLOR' => (!empty($user_row['user_colour'])) ? $user_row['user_colour'] : '', + 'RANK_TITLE' => $user_rank_data['title'], + 'JOINED' => $user->format_date($user_row['user_regdate']), + 'POSTS' => ($user_row['user_posts']) ? $user_row['user_posts'] : 0, + 'WARNINGS' => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0, + + 'AVATAR_IMG' => $avatar_img, + 'RANK_IMG' => $user_rank_data['img'], + + 'L_WARNING_POST_DEFAULT' => sprintf($user->lang['WARNING_POST_DEFAULT'], generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&p=$post_id#p$post_id"), + + 'S_CAN_NOTIFY' => $s_can_notify, + )); + } + + /** + * Handles warning the user + */ + function mcp_warn_user_view($action) + { + global $phpEx, $phpbb_root_path, $config, $module; + global $template, $db, $user, $auth, $phpbb_dispatcher; + + $user_id = request_var('u', 0); + $username = request_var('username', '', true); + $notify = (isset($_REQUEST['notify_user'])) ? true : false; + $warning = utf8_normalize_nfc(request_var('warning', '', true)); + + $sql_where = ($user_id) ? "user_id = $user_id" : "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; + + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE ' . $sql_where; + $result = $db->sql_query($sql); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$user_row) + { + trigger_error('NO_USER'); + } + + // Prevent someone from warning themselves + if ($user_row['user_id'] == $user->data['user_id']) + { + trigger_error('CANNOT_WARN_SELF'); + } + + $user_id = $user_row['user_id']; + + if (strpos($this->u_action, "&u=$user_id") === false) + { + $this->p_master->adjust_url('&u=' . $user_id); + $this->u_action .= "&u=$user_id"; + } + + // Check if can send a notification + if ($config['allow_privmsg']) + { + $auth2 = new \phpbb\auth\auth(); + $auth2->acl($user_row); + $s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false; + unset($auth2); + } + else + { + $s_can_notify = false; + } + + // Prevent against clever people + if ($notify && !$s_can_notify) + { + $notify = false; + } + + if ($warning && $action == 'add_warning') + { + if (check_form_key('mcp_warn')) + { + $s_mcp_warn_user = true; + + /** + * Event for before warning a user from MCP. + * + * @event core.mcp_warn_user_before + * @var array user_row The entire user row + * @var string warning The warning message + * @var bool notify If true, we notify the user for the warning + * @var bool s_mcp_warn_user If true, we add the warning else we omit it + * @since 3.1.0-b4 + */ + $vars = array( + 'user_row', + 'warning', + 'notify', + 's_mcp_warn_user', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_warn_user_before', compact($vars))); + + if ($s_mcp_warn_user) + { + add_warning($user_row, $warning, $notify); + $message = $user->lang['USER_WARNING_ADDED']; + + /** + * Event for after warning a user from MCP. + * + * @event core.mcp_warn_user_after + * @var array user_row The entire user row + * @var string warning The warning message + * @var bool notify If true, the user was notified for the warning + * @var string message Message displayed to the moderator + * @since 3.1.0-b4 + */ + $vars = array( + 'user_row', + 'warning', + 'notify', + 'message', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_warn_user_after', compact($vars))); + } + } + else + { + $message = $user->lang['FORM_INVALID']; + } + + if (!empty($message)) + { + $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&mode=user_notes&u=$user_id"); + meta_refresh(2, $redirect); + trigger_error($message . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); + } + } + + // Generate the appropriate user information for the user we are looking at + if (!function_exists('phpbb_get_user_rank')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } + $user_rank_data = phpbb_get_user_rank($user_row, $user_row['user_posts']); + $avatar_img = phpbb_get_user_avatar($user_row); + + // OK, they didn't submit a warning so lets build the page for them to do so + $template->assign_vars(array( + 'U_POST_ACTION' => $this->u_action, + + 'RANK_TITLE' => $user_rank_data['title'], + 'JOINED' => $user->format_date($user_row['user_regdate']), + 'POSTS' => ($user_row['user_posts']) ? $user_row['user_posts'] : 0, + 'WARNINGS' => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0, + + 'USERNAME_FULL' => get_username_string('full', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), + 'USERNAME_COLOUR' => get_username_string('colour', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), + 'USERNAME' => get_username_string('username', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), + 'U_PROFILE' => get_username_string('profile', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), + + 'AVATAR_IMG' => $avatar_img, + 'RANK_IMG' => $user_rank_data['img'], + + 'S_CAN_NOTIFY' => $s_can_notify, + )); + + return $user_id; + } +} + +/** +* Insert the warning into the database +*/ +function add_warning($user_row, $warning, $send_pm = true, $post_id = 0) +{ + global $phpEx, $phpbb_root_path, $config; + global $template, $db, $user, $auth; + + if ($send_pm) + { + include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx); + + $user_row['user_lang'] = (file_exists($phpbb_root_path . 'language/' . $user_row['user_lang'] . "/mcp.$phpEx")) ? $user_row['user_lang'] : $config['default_lang']; + include($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp.$phpEx"); + + $message_parser = new parse_message(); + + $message_parser->message = $user->lang('WARNING_PM_BODY', $warning); + $message_parser->parse(true, true, true, false, false, true, true); + + $pm_data = array( + 'from_user_id' => $user->data['user_id'], + 'from_user_ip' => $user->ip, + 'from_username' => $user->data['username'], + 'enable_sig' => false, + 'enable_bbcode' => true, + 'enable_smilies' => true, + 'enable_urls' => false, + 'icon_id' => 0, + 'bbcode_bitfield' => $message_parser->bbcode_bitfield, + 'bbcode_uid' => $message_parser->bbcode_uid, + 'message' => $message_parser->message, + 'address_list' => array('u' => array($user_row['user_id'] => 'to')), + ); + + 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); + + $sql_ary = array( + 'user_id' => $user_row['user_id'], + 'post_id' => $post_id, + 'log_id' => $log_id, + 'warning_time' => time(), + ); + + $db->sql_query('INSERT INTO ' . WARNINGS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_warnings = user_warnings + 1, + user_last_warning = ' . time() . ' + WHERE user_id = ' . $user_row['user_id']; + $db->sql_query($sql); + + // We add this to the mod log too for moderators to see that a specific user got warned. + $sql = 'SELECT forum_id, topic_id + FROM ' . POSTS_TABLE . ' + WHERE post_id = ' . $post_id; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_USER_WARNING', $user_row['username']); +} diff --git a/sources/phpBB/includes/message_parser.php b/sources/phpBB/includes/message_parser.php new file mode 100644 index 0000000..04a2726 --- /dev/null +++ b/sources/phpBB/includes/message_parser.php @@ -0,0 +1,1865 @@ + +* @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; +} + +if (!class_exists('bbcode')) +{ + include($phpbb_root_path . 'includes/bbcode.' . $phpEx); +} + +/** +* BBCODE FIRSTPASS +* BBCODE first pass class (functions for parsing messages for db storage) +*/ +class bbcode_firstpass extends bbcode +{ + var $message = ''; + var $warn_msg = array(); + var $parsed_items = array(); + + /** + * Parse BBCode + */ + function parse_bbcode() + { + if (!$this->bbcodes) + { + $this->bbcode_init(); + } + + global $user; + + $this->bbcode_bitfield = ''; + $bitfield = new bitfield(); + + foreach ($this->bbcodes as $bbcode_name => $bbcode_data) + { + if (isset($bbcode_data['disabled']) && $bbcode_data['disabled']) + { + foreach ($bbcode_data['regexp'] as $regexp => $replacement) + { + if (preg_match($regexp, $this->message)) + { + $this->warn_msg[] = sprintf($user->lang['UNAUTHORISED_BBCODE'] , '[' . $bbcode_name . ']'); + continue; + } + } + } + else + { + foreach ($bbcode_data['regexp'] as $regexp => $replacement) + { + // The pattern gets compiled and cached by the PCRE extension, + // it should not demand recompilation + if (preg_match($regexp, $this->message)) + { + $this->message = preg_replace($regexp, $replacement, $this->message); + $bitfield->set($bbcode_data['bbcode_id']); + } + } + } + } + + $this->bbcode_bitfield = $bitfield->get_base64(); + } + + /** + * Prepare some bbcodes for better parsing + */ + function prepare_bbcodes() + { + // Ok, seems like users instead want the no-parsing of urls, smilies, etc. after and before and within quote tags being tagged as "not a bug". + // Fine by me ;) Will ease our live... but do not come back and cry at us, we won't hear you. + + /* Add newline at the end and in front of each quote block to prevent parsing errors (urls, smilies, etc.) + if (strpos($this->message, '[quote') !== false && strpos($this->message, '[/quote]') !== false) + { + $this->message = str_replace("\r\n", "\n", $this->message); + + // We strip newlines and spaces after and before quotes in quotes (trimming) and then add exactly one newline + $this->message = preg_replace('#\[quote(=".*?")?\]\s*(.*?)\s*\[/quote\]#siu', '[quote\1]' . "\n" . '\2' ."\n[/quote]", $this->message); + } + */ + + // Add other checks which needs to be placed before actually parsing anything (be it bbcodes, smilies, urls...) + } + + /** + * Init bbcode data for later parsing + */ + function bbcode_init($allow_custom_bbcode = true) + { + global $phpbb_dispatcher; + + static $rowset; + + // 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. + // To parse multiline URL we enable dotall option setting only for URL text + // but not for link itself, thus [url][/url] is not affected. + $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(?:="(.*?)")?\](.+)\[/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')")) + ); + + // Zero the parsed items array + $this->parsed_items = array(); + + foreach ($this->bbcodes as $tag => $bbcode_data) + { + $this->parsed_items[$tag] = 0; + } + + if (!$allow_custom_bbcode) + { + return; + } + + if (!is_array($rowset)) + { + global $db; + $rowset = array(); + + $sql = 'SELECT * + FROM ' . BBCODES_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $rowset[] = $row; + } + $db->sql_freeresult($result); + } + + foreach ($rowset as $row) + { + $this->bbcodes[$row['bbcode_tag']] = array( + 'bbcode_id' => (int) $row['bbcode_id'], + 'regexp' => array($row['first_pass_match'] => str_replace('$uid', $this->bbcode_uid, $row['first_pass_replace'])) + ); + } + + $bbcodes = $this->bbcodes; + + /** + * Event to modify the bbcode data for later parsing + * + * @event core.modify_bbcode_init + * @var array bbcodes Array of bbcode data for use in parsing + * @var array rowset Array of bbcode data from the database + * @since 3.1.0-a3 + */ + $vars = array('bbcodes', 'rowset'); + extract($phpbb_dispatcher->trigger_event('core.modify_bbcode_init', compact($vars))); + + $this->bbcodes = $bbcodes; + } + + /** + * Making some pre-checks for bbcodes as well as increasing the number of parsed items + */ + function check_bbcode($bbcode, &$in) + { + // when using the /e modifier, preg_replace slashes double-quotes but does not + // seem to slash anything else + $in = str_replace("\r\n", "\n", str_replace('\"', '"', $in)); + + // Trimming here to make sure no empty bbcodes are parsed accidently + if (trim($in) == '') + { + return false; + } + + $this->parsed_items[$bbcode]++; + + return true; + } + + /** + * Transform some characters in valid bbcodes + */ + function bbcode_specialchars($text) + { + $str_from = array('<', '>', '[', ']', '.', ':'); + $str_to = array('<', '>', '[', ']', '.', ':'); + + return str_replace($str_from, $str_to, $text); + } + + /** + * Parse size tag + */ + function bbcode_size($stx, $in) + { + global $user, $config; + + if (!$this->check_bbcode('size', $in)) + { + return $in; + } + + if ($config['max_' . $this->mode . '_font_size'] && $config['max_' . $this->mode . '_font_size'] < $stx) + { + $this->warn_msg[] = $user->lang('MAX_FONT_SIZE_EXCEEDED', (int) $config['max_' . $this->mode . '_font_size']); + + return '[size=' . $stx . ']' . $in . '[/size]'; + } + + // Do not allow size=0 + if ($stx <= 0) + { + return '[size=' . $stx . ']' . $in . '[/size]'; + } + + return '[size=' . $stx . ':' . $this->bbcode_uid . ']' . $in . '[/size:' . $this->bbcode_uid . ']'; + } + + /** + * Parse color tag + */ + function bbcode_color($stx, $in) + { + if (!$this->check_bbcode('color', $in)) + { + return $in; + } + + return '[color=' . $stx . ':' . $this->bbcode_uid . ']' . $in . '[/color:' . $this->bbcode_uid . ']'; + } + + /** + * Parse u tag + */ + function bbcode_underline($in) + { + if (!$this->check_bbcode('u', $in)) + { + return $in; + } + + return '[u:' . $this->bbcode_uid . ']' . $in . '[/u:' . $this->bbcode_uid . ']'; + } + + /** + * Parse b tag + */ + function bbcode_strong($in) + { + if (!$this->check_bbcode('b', $in)) + { + return $in; + } + + return '[b:' . $this->bbcode_uid . ']' . $in . '[/b:' . $this->bbcode_uid . ']'; + } + + /** + * Parse i tag + */ + function bbcode_italic($in) + { + if (!$this->check_bbcode('i', $in)) + { + return $in; + } + + return '[i:' . $this->bbcode_uid . ']' . $in . '[/i:' . $this->bbcode_uid . ']'; + } + + /** + * Parse img tag + */ + function bbcode_img($in) + { + global $user, $config; + + if (!$this->check_bbcode('img', $in)) + { + return $in; + } + + $in = trim($in); + $error = false; + + $in = str_replace(' ', '%20', $in); + + // Checking urls + if (!preg_match('#^' . get_preg_expression('url') . '$#iu', $in) && !preg_match('#^' . get_preg_expression('www_url') . '$#iu', $in)) + { + return '[img]' . $in . '[/img]'; + } + + // Try to cope with a common user error... not specifying a protocol but only a subdomain + if (!preg_match('#^[a-z0-9]+://#i', $in)) + { + $in = 'http://' . $in; + } + + if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width']) + { + $stats = @getimagesize(htmlspecialchars_decode($in)); + + if ($stats === 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]) + { + $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]) + { + $error = true; + $this->warn_msg[] = $user->lang('MAX_IMG_WIDTH_EXCEEDED', (int) $config['max_' . $this->mode . '_img_width']); + } + } + } + + if ($error || $this->path_in_domain($in)) + { + return '[img]' . $in . '[/img]'; + } + + return '[img:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($in) . '[/img:' . $this->bbcode_uid . ']'; + } + + /** + * Parse flash tag + */ + function bbcode_flash($width, $height, $in) + { + global $user, $config; + + if (!$this->check_bbcode('flash', $in)) + { + return $in; + } + + $in = trim($in); + $error = false; + + // Do not allow 0-sizes generally being entered + if ($width <= 0 || $height <= 0) + { + return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]'; + } + + $in = str_replace(' ', '%20', $in); + + // Make sure $in is a URL. + if (!preg_match('#^' . get_preg_expression('url') . '$#iu', $in) && + !preg_match('#^' . get_preg_expression('www_url') . '$#iu', $in)) + { + return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]'; + } + + // Apply the same size checks on flash files as on images + if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width']) + { + if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $height) + { + $error = true; + $this->warn_msg[] = $user->lang('MAX_FLASH_HEIGHT_EXCEEDED', (int) $config['max_' . $this->mode . '_img_height']); + } + + if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $width) + { + $error = true; + $this->warn_msg[] = $user->lang('MAX_FLASH_WIDTH_EXCEEDED', (int) $config['max_' . $this->mode . '_img_width']); + } + } + + if ($error || $this->path_in_domain($in)) + { + return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]'; + } + + return '[flash=' . $width . ',' . $height . ':' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($in) . '[/flash:' . $this->bbcode_uid . ']'; + } + + /** + * Parse inline attachments [ia] + */ + function bbcode_attachment($stx, $in) + { + if (!$this->check_bbcode('attachment', $in)) + { + return $in; + } + + return '[attachment=' . $stx . ':' . $this->bbcode_uid . ']' . trim($in) . '[/attachment:' . $this->bbcode_uid . ']'; + } + + /** + * Parse code text from code tag + * @access private + */ + function bbcode_parse_code($stx, &$code) + { + switch (strtolower($stx)) + { + case 'php': + + $remove_tags = false; + + $str_from = array('<', '>', '[', ']', '.', ':', ':'); + $str_to = array('<', '>', '[', ']', '.', ':', ':'); + $code = str_replace($str_from, $str_to, $code); + + if (!preg_match('/\<\?.*?\?\>/is', $code)) + { + $remove_tags = true; + $code = ""; + } + + $conf = array('highlight.bg', 'highlight.comment', 'highlight.default', 'highlight.html', 'highlight.keyword', 'highlight.string'); + foreach ($conf as $ini_var) + { + @ini_set($ini_var, str_replace('highlight.', 'syntax', $ini_var)); + } + + // Because highlight_string is specialcharing the text (but we already did this before), we have to reverse this in order to get correct results + $code = htmlspecialchars_decode($code); + $code = highlight_string($code, true); + + $str_from = array('', '', '','[', ']', '.', ':'); + $str_to = array('', '', '', '[', ']', '.', ':'); + + if ($remove_tags) + { + $str_from[] = '<?php '; + $str_to[] = ''; + $str_from[] = '<?php '; + $str_to[] = ''; + } + + $code = str_replace($str_from, $str_to, $code); + $code = preg_replace('#^()\n?(.*?)\n?()$#is', '$1$2$3', $code); + + if ($remove_tags) + { + $code = preg_replace('#()?\?>()#', '$1 $2', $code); + } + + $code = preg_replace('#^(.*)#s', '$2', $code); + $code = preg_replace('#(?:\s++| )*+$#u', '', $code); + + // remove newline at the end + if (!empty($code) && substr($code, -1) == "\n") + { + $code = substr($code, 0, -1); + } + + return "[code=$stx:" . $this->bbcode_uid . ']' . $code . '[/code:' . $this->bbcode_uid . ']'; + break; + + default: + return '[code:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($code) . '[/code:' . $this->bbcode_uid . ']'; + break; + } + } + + /** + * Parse code tag + * Expects the argument to start right after the opening [code] tag and to end with [/code] + */ + function bbcode_code($stx, $in) + { + if (!$this->check_bbcode('code', $in)) + { + return $in; + } + + // We remove the hardcoded elements from the code block here because it is not used in code blocks + // Having it here saves us one preg_replace per message containing [code] blocks + // Additionally, magic url parsing should go after parsing bbcodes, but for safety those are stripped out too... + $htm_match = get_preg_expression('bbcode_htm'); + unset($htm_match[4], $htm_match[5]); + $htm_replace = array('\1', '\1', '\2', '\1'); + + $out = $code_block = ''; + $open = 1; + + while ($in) + { + // Determine position and tag length of next code block + preg_match('#(.*?)(\[code(?:=([a-z]+))?\])(.+)#is', $in, $buffer); + $pos = (isset($buffer[1])) ? strlen($buffer[1]) : false; + $tag_length = (isset($buffer[2])) ? strlen($buffer[2]) : false; + + // Determine position of ending code tag + $pos2 = stripos($in, '[/code]'); + + // Which is the next block, ending code or code block + if ($pos !== false && $pos < $pos2) + { + // Open new block + if (!$open) + { + $out .= substr($in, 0, $pos); + $in = substr($in, $pos); + $stx = (isset($buffer[3])) ? $buffer[3] : ''; + $code_block = ''; + } + else + { + // Already opened block, just append to the current block + $code_block .= substr($in, 0, $pos) . ((isset($buffer[2])) ? $buffer[2] : ''); + $in = substr($in, $pos); + } + + $in = substr($in, $tag_length); + $open++; + } + else + { + // Close the block + if ($open == 1) + { + $code_block .= substr($in, 0, $pos2); + $code_block = preg_replace($htm_match, $htm_replace, $code_block); + + // Parse this code block + $out .= $this->bbcode_parse_code($stx, $code_block); + $code_block = ''; + $open--; + } + else if ($open) + { + // Close one open tag... add to the current code block + $code_block .= substr($in, 0, $pos2 + 7); + $open--; + } + else + { + // end code without opening code... will be always outside code block + $out .= substr($in, 0, $pos2 + 7); + } + + $in = substr($in, $pos2 + 7); + } + } + + // if now $code_block has contents we need to parse the remaining code while removing the last closing tag to match up. + if ($code_block) + { + $code_block = substr($code_block, 0, -7); + $code_block = preg_replace($htm_match, $htm_replace, $code_block); + + $out .= $this->bbcode_parse_code($stx, $code_block); + } + + return $out; + } + + /** + * Parse list bbcode + * Expects the argument to start with a tag + */ + function bbcode_parse_list($in) + { + if (!$this->check_bbcode('list', $in)) + { + return $in; + } + + // $tok holds characters to stop at. Since the string starts with a '[' we'll get everything up to the first ']' which should be the opening [list] tag + $tok = ']'; + $out = '['; + + // First character is [ + $in = substr($in, 1); + $list_end_tags = $item_end_tags = array(); + + do + { + $pos = strlen($in); + + for ($i = 0, $tok_len = strlen($tok); $i < $tok_len; ++$i) + { + $tmp_pos = strpos($in, $tok[$i]); + + if ($tmp_pos !== false && $tmp_pos < $pos) + { + $pos = $tmp_pos; + } + } + + $buffer = substr($in, 0, $pos); + $tok = $in[$pos]; + + $in = substr($in, $pos + 1); + + if ($tok == ']') + { + // if $tok is ']' the buffer holds a tag + if (strtolower($buffer) == '/list' && sizeof($list_end_tags)) + { + // valid [/list] tag, check nesting so that we don't hit false positives + if (sizeof($item_end_tags) && sizeof($item_end_tags) >= sizeof($list_end_tags)) + { + // current li tag has not been closed + $out = preg_replace('/\n?\[$/', '[', $out) . array_pop($item_end_tags) . ']['; + } + + $out .= array_pop($list_end_tags) . ']'; + $tok = '['; + } + else if (preg_match('#^list(=[0-9a-z]+)?$#i', $buffer, $m)) + { + // sub-list, add a closing tag + if (empty($m[1]) || preg_match('/^=(?:disc|square|circle)$/i', $m[1])) + { + array_push($list_end_tags, '/list:u:' . $this->bbcode_uid); + } + else + { + array_push($list_end_tags, '/list:o:' . $this->bbcode_uid); + } + $out .= 'list' . substr($buffer, 4) . ':' . $this->bbcode_uid . ']'; + $tok = '['; + } + else + { + if (($buffer == '*' || substr($buffer, -2) == '[*') && sizeof($list_end_tags)) + { + // the buffer holds a bullet tag and we have a [list] tag open + if (sizeof($item_end_tags) >= sizeof($list_end_tags)) + { + if (substr($buffer, -2) == '[*') + { + $out .= substr($buffer, 0, -2) . '['; + } + // current li tag has not been closed + if (preg_match('/\n\[$/', $out, $m)) + { + $out = preg_replace('/\n\[$/', '[', $out); + $buffer = array_pop($item_end_tags) . "]\n[*:" . $this->bbcode_uid; + } + else + { + $buffer = array_pop($item_end_tags) . '][*:' . $this->bbcode_uid; + } + } + else + { + $buffer = '*:' . $this->bbcode_uid; + } + + $item_end_tags[] = '/*:m:' . $this->bbcode_uid; + } + else if ($buffer == '/*') + { + array_pop($item_end_tags); + $buffer = '/*:' . $this->bbcode_uid; + } + + $out .= $buffer . $tok; + $tok = '[]'; + } + } + else + { + // Not within a tag, just add buffer to the return string + $out .= $buffer . $tok; + $tok = ($tok == '[') ? ']' : '[]'; + } + } + while ($in); + + // do we have some tags open? close them now + if (sizeof($item_end_tags)) + { + $out .= '[' . implode('][', $item_end_tags) . ']'; + } + if (sizeof($list_end_tags)) + { + $out .= '[' . implode('][', $list_end_tags) . ']'; + } + + return $out; + } + + /** + * Parse quote bbcode + * Expects the argument to start with a tag + */ + function bbcode_quote($in) + { + global $config, $user; + + $in = str_replace("\r\n", "\n", str_replace('\"', '"', trim($in))); + + if (!$in) + { + return ''; + } + + // To let the parser not catch tokens within quote_username quotes we encode them before we start this... + $in = preg_replace('#quote="(.*?)"\]#ie', "'quote="' . str_replace(array('[', ']', '\\\"'), array('[', ']', '\"'), '\$1') . '"]'", $in); + + $tok = ']'; + $out = '['; + + $in = substr($in, 1); + $close_tags = $error_ary = array(); + $buffer = ''; + + do + { + $pos = strlen($in); + for ($i = 0, $tok_len = strlen($tok); $i < $tok_len; ++$i) + { + $tmp_pos = strpos($in, $tok[$i]); + if ($tmp_pos !== false && $tmp_pos < $pos) + { + $pos = $tmp_pos; + } + } + + $buffer .= substr($in, 0, $pos); + $tok = $in[$pos]; + $in = substr($in, $pos + 1); + + if ($tok == ']') + { + if (strtolower($buffer) == '/quote' && sizeof($close_tags) && substr($out, -1, 1) == '[') + { + // we have found a closing tag + $out .= array_pop($close_tags) . ']'; + $tok = '['; + $buffer = ''; + + /* Add space at the end of the closing tag if not happened before to allow following urls/smilies to be parsed correctly + * Do not try to think for the user. :/ Do not parse urls/smilies if there is no space - is the same as with other bbcodes too. + * Also, we won't have any spaces within $in anyway, only adding up spaces -> #10982 + if (!$in || $in[0] !== ' ') + { + $out .= ' '; + }*/ + } + else if (preg_match('#^quote(?:="(.*?)")?$#is', $buffer, $m) && substr($out, -1, 1) == '[') + { + $this->parsed_items['quote']++; + + // the buffer holds a valid opening tag + if ($config['max_quote_depth'] && sizeof($close_tags) >= $config['max_quote_depth']) + { + if ($config['max_quote_depth'] == 1) + { + // Depth 1 - no nesting is allowed + $error_ary['quote_depth'] = $user->lang('QUOTE_NO_NESTING'); + } + else + { + // There are too many nested quotes + $error_ary['quote_depth'] = $user->lang('QUOTE_DEPTH_EXCEEDED', (int) $config['max_quote_depth']); + } + + $out .= $buffer . $tok; + $tok = '[]'; + $buffer = ''; + + continue; + } + + array_push($close_tags, '/quote:' . $this->bbcode_uid); + + if (isset($m[1]) && $m[1]) + { + $username = str_replace(array('[', ']'), array('[', ']'), $m[1]); + $username = preg_replace('#\[(?!b|i|u|color|url|email|/b|/i|/u|/color|/url|/email)#iU', '[$1', $username); + + $end_tags = array(); + $error = false; + + preg_match_all('#\[((?:/)?(?:[a-z]+))#i', $username, $tags); + foreach ($tags[1] as $tag) + { + if ($tag[0] != '/') + { + $end_tags[] = '/' . $tag; + } + else + { + $end_tag = array_pop($end_tags); + $error = ($end_tag != $tag) ? true : false; + } + } + + if ($error) + { + $username = $m[1]; + } + + $out .= 'quote="' . $username . '":' . $this->bbcode_uid . ']'; + } + else + { + $out .= 'quote:' . $this->bbcode_uid . ']'; + } + + $tok = '['; + $buffer = ''; + } + else if (preg_match('#^quote="(.*?)#is', $buffer, $m)) + { + // the buffer holds an invalid opening tag + $buffer .= ']'; + } + else + { + $out .= $buffer . $tok; + $tok = '[]'; + $buffer = ''; + } + } + else + { +/** +* Old quote code working fine, but having errors listed in bug #3572 +* +* $out .= $buffer . $tok; +* $tok = ($tok == '[') ? ']' : '[]'; +* $buffer = ''; +*/ + + $out .= $buffer . $tok; + + if ($tok == '[') + { + // Search the text for the next tok... if an ending quote comes first, then change tok to [] + $pos1 = stripos($in, '[/quote'); + // If the token ] comes first, we change it to ] + $pos2 = strpos($in, ']'); + // If the token [ comes first, we change it to [ + $pos3 = strpos($in, '['); + + if ($pos1 !== false && ($pos2 === false || $pos1 < $pos2) && ($pos3 === false || $pos1 < $pos3)) + { + $tok = '[]'; + } + else if ($pos3 !== false && ($pos2 === false || $pos3 < $pos2)) + { + $tok = '['; + } + else + { + $tok = ']'; + } + } + else + { + $tok = '[]'; + } + $buffer = ''; + } + } + while ($in); + + $out .= $buffer; + + if (sizeof($close_tags)) + { + $out .= '[' . implode('][', $close_tags) . ']'; + } + + foreach ($error_ary as $error_msg) + { + $this->warn_msg[] = $error_msg; + } + + return $out; + } + + /** + * Validate email + */ + function validate_email($var1, $var2) + { + $var1 = str_replace("\r\n", "\n", str_replace('\"', '"', trim($var1))); + $var2 = str_replace("\r\n", "\n", str_replace('\"', '"', trim($var2))); + + $txt = $var2; + $email = ($var1) ? $var1 : $var2; + + $validated = true; + + if (!preg_match('/^' . get_preg_expression('email') . '$/i', $email)) + { + $validated = false; + } + + if (!$validated) + { + return '[email' . (($var1) ? "=$var1" : '') . ']' . $var2 . '[/email]'; + } + + $this->parsed_items['email']++; + + if ($var1) + { + $retval = '[email=' . $this->bbcode_specialchars($email) . ':' . $this->bbcode_uid . ']' . $txt . '[/email:' . $this->bbcode_uid . ']'; + } + else + { + $retval = '[email:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($email) . '[/email:' . $this->bbcode_uid . ']'; + } + + return $retval; + } + + /** + * Validate url + * + * @param string $var1 optional url parameter for url bbcode: [url(=$var1)]$var2[/url] + * @param string $var2 url bbcode content: [url(=$var1)]$var2[/url] + */ + function validate_url($var1, $var2) + { + global $config; + + $var1 = str_replace("\r\n", "\n", str_replace('\"', '"', trim($var1))); + $var2 = str_replace("\r\n", "\n", str_replace('\"', '"', trim($var2))); + + $url = ($var1) ? $var1 : $var2; + + if ($var1 && !$var2) + { + $var2 = $var1; + } + + if (!$url) + { + return '[url' . (($var1) ? '=' . $var1 : '') . ']' . $var2 . '[/url]'; + } + + $valid = false; + + $url = str_replace(' ', '%20', $url); + + // Checking urls + if (preg_match('#^' . get_preg_expression('url') . '$#iu', $url) || + preg_match('#^' . get_preg_expression('www_url') . '$#iu', $url) || + preg_match('#^' . preg_quote(generate_board_url(), '#') . get_preg_expression('relative_url') . '$#iu', $url)) + { + $valid = true; + } + + if ($valid) + { + $this->parsed_items['url']++; + + // if there is no scheme, then add http schema + if (!preg_match('#^[a-z][a-z\d+\-.]*:/{2}#i', $url)) + { + $url = 'http://' . $url; + } + + // Is this a link to somewhere inside this board? If so then remove the session id from the url + if (strpos($url, generate_board_url()) !== false && strpos($url, 'sid=') !== false) + { + $url = preg_replace('/(&|\?)sid=[0-9a-f]{32}&/', '\1', $url); + $url = preg_replace('/(&|\?)sid=[0-9a-f]{32}$/', '', $url); + $url = append_sid($url); + } + + return ($var1) ? '[url=' . $this->bbcode_specialchars($url) . ':' . $this->bbcode_uid . ']' . $var2 . '[/url:' . $this->bbcode_uid . ']' : '[url:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($url) . '[/url:' . $this->bbcode_uid . ']'; + } + + return '[url' . (($var1) ? '=' . $var1 : '') . ']' . $var2 . '[/url]'; + } + + /** + * Check if url is pointing to this domain/script_path/php-file + * + * @param string $url the url to check + * @return true if the url is pointing to this domain/script_path/php-file, false if not + * + * @access private + */ + function path_in_domain($url) + { + global $config, $phpEx, $user; + + if ($config['force_server_vars']) + { + $check_path = $config['script_path']; + } + else + { + $check_path = ($user->page['root_script_path'] != '/') ? substr($user->page['root_script_path'], 0, -1) : '/'; + } + + // Is the user trying to link to a php file in this domain and script path? + if (strpos($url, ".{$phpEx}") !== false && strpos($url, $check_path) !== false) + { + $server_name = $user->host; + + // Forcing server vars is the only way to specify/override the protocol + if ($config['force_server_vars'] || !$server_name) + { + $server_name = $config['server_name']; + } + + // Check again in correct order... + $pos_ext = strpos($url, ".{$phpEx}"); + $pos_path = strpos($url, $check_path); + $pos_domain = strpos($url, $server_name); + + if ($pos_domain !== false && $pos_path >= $pos_domain && $pos_ext >= $pos_path) + { + // Ok, actually we allow linking to some files (this may be able to be extended in some way later...) + if (strpos($url, '/' . $check_path . '/download/file.' . $phpEx) !== 0) + { + return false; + } + + return true; + } + } + + return false; + } +} + +/** +* Main message parser for posting, pm, etc. takes raw message +* and parses it for attachments, bbcode and smilies +*/ +class parse_message extends bbcode_firstpass +{ + var $attachment_data = array(); + var $filename_data = array(); + + // Helps ironing out user error + var $message_status = ''; + + var $allow_img_bbcode = true; + var $allow_flash_bbcode = true; + var $allow_quote_bbcode = true; + var $allow_url_bbcode = true; + + var $mode; + + /** + * The plupload object used for dealing with attachments + * @var \phpbb\plupload\plupload + */ + protected $plupload; + + /** + * The mimetype guesser object used for attachment mimetypes + * @var \phpbb\mimetype\guesser + */ + protected $mimetype_guesser; + + /** + * Init - give message here or manually + */ + function parse_message($message = '') + { + // Init BBCode UID + $this->bbcode_uid = substr(base_convert(unique_id(), 16, 36), 0, BBCODE_UID_LEN); + $this->message = $message; + } + + /** + * Parse Message + */ + 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; + + $this->mode = $mode; + + foreach (array('chars', 'smilies', 'urls', 'font_size', 'img_height', 'img_width') as $key) + { + if (!isset($config['max_' . $mode . '_' . $key])) + { + $config['max_' . $mode . '_' . $key] = 0; + } + } + + $this->allow_img_bbcode = $allow_img_bbcode; + $this->allow_flash_bbcode = $allow_flash_bbcode; + $this->allow_quote_bbcode = $allow_quote_bbcode; + $this->allow_url_bbcode = $allow_url_bbcode; + + // If false, then $this->message won't be altered, the text will be returned instead. + if (!$update_this_message) + { + $tmp_message = $this->message; + $return_message = &$this->message; + } + + if ($this->message_status == 'display') + { + $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:"); + $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)); + + // Maximum message length check. 0 disables this check completely. + if ((int) $config['max_' . $mode . '_chars'] > 0 && $message_length > (int) $config['max_' . $mode . '_chars']) + { + $this->warn_msg[] = $user->lang('CHARS_' . strtoupper($mode) . '_CONTAINS', $message_length) . '
' . $user->lang('TOO_MANY_CHARS_LIMIT', (int) $config['max_' . $mode . '_chars']); + return (!$update_this_message) ? $return_message : $this->warn_msg; + } + + // Minimum message length check for post only + if ($mode === 'post') + { + if (!$message_length || $message_length < (int) $config['min_post_chars']) + { + $this->warn_msg[] = (!$message_length) ? $user->lang['TOO_FEW_CHARS'] : ($user->lang('CHARS_POST_CONTAINS', $message_length) . '
' . $user->lang('TOO_FEW_CHARS_LIMIT', (int) $config['min_post_chars'])); + return (!$update_this_message) ? $return_message : $this->warn_msg; + } + } + + /** + * This event can be used for additional message checks/cleanup before parsing + * + * @event core.message_parser_check_message + * @var bool allow_bbcode Do we allow BBCodes + * @var bool allow_magic_url Do we allow magic urls + * @var bool allow_smilies Do we allow smilies + * @var bool allow_img_bbcode Do we allow image BBCode + * @var bool allow_flash_bbcode Do we allow flash BBCode + * @var bool allow_quote_bbcode Do we allow quote BBCode + * @var bool allow_url_bbcode Do we allow url BBCode + * @var bool update_this_message Do we alter the parsed message + * @var string mode Posting mode + * @var string message The message text to parse + * @var string bbcode_bitfield The bbcode_bitfield before parsing + * @var string bbcode_uid The bbcode_uid before parsing + * @var bool return Do we return after the event is triggered if $warn_msg is not empty + * @var array warn_msg Array of the warning messages + * @since 3.1.2-RC1 + * @change 3.1.3-RC1 Added vars $bbcode_bitfield and $bbcode_uid + */ + $message = $this->message; + $warn_msg = $this->warn_msg; + $return = false; + $bbcode_bitfield = $this->bbcode_bitfield; + $bbcode_uid = $this->bbcode_uid; + $vars = array( + 'allow_bbcode', + 'allow_magic_url', + 'allow_smilies', + 'allow_img_bbcode', + 'allow_flash_bbcode', + 'allow_quote_bbcode', + 'allow_url_bbcode', + 'update_this_message', + 'mode', + 'message', + 'bbcode_bitfield', + 'bbcode_uid', + 'return', + 'warn_msg', + ); + extract($phpbb_dispatcher->trigger_event('core.message_parser_check_message', compact($vars))); + $this->message = $message; + $this->warn_msg = $warn_msg; + $this->bbcode_bitfield = $bbcode_bitfield; + $this->bbcode_uid = $bbcode_uid; + if ($return && !empty($this->warn_msg)) + { + return (!$update_this_message) ? $return_message : $this->warn_msg; + } + + // Prepare BBcode (just prepares some tags for better parsing) + if ($allow_bbcode && strpos($this->message, '[') !== false) + { + $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(); + } + + // Parse smilies + if ($allow_smilies) + { + $this->smilies($config['max_' . $mode . '_smilies']); + } + + $num_urls = 0; + + // 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('#\' . $row['code'] . ''; + } + $db->sql_freeresult($result); + } + + if (sizeof($match)) + { + if ($max_smilies) + { + // 'u' modifier has been added to correctly parse smilies within unicode strings + // For details: http://tracker.phpbb.com/browse/PHPBB3-10117 + $num_matches = preg_match_all('#(?<=^|[\n .])(?:' . implode('|', $match) . ')(?![^<>]*>)#u', $this->message, $matches); + unset($matches); + + if ($num_matches !== false && $num_matches > $max_smilies) + { + $this->warn_msg[] = sprintf($user->lang['TOO_MANY_SMILIES'], $max_smilies); + return; + } + } + + // Make sure the delimiter # is added in front and at the end of every element within $match + // 'u' modifier has been added to correctly parse smilies within unicode strings + // For details: http://tracker.phpbb.com/browse/PHPBB3-10117 + + $this->message = trim(preg_replace(explode(chr(0), '#(?<=^|[\n .])' . implode('(?![^<>]*>)#u' . chr(0) . '#(?<=^|[\n .])', $match) . '(?![^<>]*>)#u'), $replace, $this->message)); + } + } + + /** + * Parse Attachments + */ + function parse_attachments($form_name, $mode, $forum_id, $submit, $preview, $refresh, $is_message = false) + { + global $config, $auth, $user, $phpbb_root_path, $phpEx, $db, $request; + + $error = array(); + + $num_attachments = sizeof($this->attachment_data); + $this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true)); + $upload = $request->file($form_name); + $upload_file = (!empty($upload) && $upload['name'] !== 'none' && trim($upload['name'])); + + $add_file = (isset($_POST['add_file'])) ? true : false; + $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)); + + foreach ($actual_comment_list as $comment_key => $comment) + { + if (!isset($this->attachment_data[$comment_key])) + { + continue; + } + + if ($this->attachment_data[$comment_key]['attach_comment'] != $actual_comment_list[$comment_key]) + { + $this->attachment_data[$comment_key]['attach_comment'] = $actual_comment_list[$comment_key]; + } + } + + $cfg = array(); + $cfg['max_attachments'] = ($is_message) ? $config['max_attachments_pm'] : $config['max_attachments']; + $forum_id = ($is_message) ? 0 : $forum_id; + + if ($submit && in_array($mode, array('post', 'reply', 'quote', 'edit')) && $upload_file) + { + if ($num_attachments < $cfg['max_attachments'] || $auth->acl_get('a_') || $auth->acl_get('m_', $forum_id)) + { + $filedata = upload_attachment($form_name, $forum_id, false, '', $is_message); + $error = $filedata['error']; + + if ($filedata['post_attach'] && !sizeof($error)) + { + $sql_ary = array( + 'physical_filename' => $filedata['physical_filename'], + 'attach_comment' => $this->filename_data['filecomment'], + 'real_filename' => $filedata['real_filename'], + 'extension' => $filedata['extension'], + 'mimetype' => $filedata['mimetype'], + 'filesize' => $filedata['filesize'], + 'filetime' => $filedata['filetime'], + 'thumbnail' => $filedata['thumbnail'], + 'is_orphan' => 1, + 'in_message' => ($is_message) ? 1 : 0, + 'poster_id' => $user->data['user_id'], + ); + + $db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + + $new_entry = array( + 'attach_id' => $db->sql_nextid(), + 'is_orphan' => 1, + 'real_filename' => $filedata['real_filename'], + 'attach_comment'=> $this->filename_data['filecomment'], + 'filesize' => $filedata['filesize'], + ); + + $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->filename_data['filecomment'] = ''; + + // This Variable is set to false here, because Attachments are entered into the + // Database in two modes, one if the id_list is 0 and the second one if post_attach is true + // Since post_attach is automatically switched to true if an Attachment got added to the filesystem, + // but we are assigning an id of 0 here, we have to reset the post_attach variable to false. + // + // This is very relevant, because it could happen that the post got not submitted, but we do not + // know this circumstance here. We could be at the posting page or we could be redirected to the entered + // post. :) + $filedata['post_attach'] = false; + } + } + else + { + $error[] = $user->lang('TOO_MANY_ATTACHMENTS', (int) $cfg['max_attachments']); + } + } + + if ($preview || $refresh || sizeof($error)) + { + if (isset($this->plupload) && $this->plupload->is_active()) + { + $json_response = new \phpbb\json_response(); + } + + // Perform actions on temporary attachments + if ($delete_file) + { + include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + + $index = array_keys(request_var('delete_file', array(0 => 0))); + $index = (!empty($index)) ? $index[0] : false; + + if ($index !== false && !empty($this->attachment_data[$index])) + { + // delete selected attachment + if ($this->attachment_data[$index]['is_orphan']) + { + $sql = 'SELECT attach_id, physical_filename, thumbnail + FROM ' . ATTACHMENTS_TABLE . ' + WHERE attach_id = ' . (int) $this->attachment_data[$index]['attach_id'] . ' + AND is_orphan = 1 + AND poster_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + phpbb_unlink($row['physical_filename'], 'file'); + + if ($row['thumbnail']) + { + phpbb_unlink($row['physical_filename'], 'thumbnail'); + } + + $db->sql_query('DELETE FROM ' . ATTACHMENTS_TABLE . ' WHERE attach_id = ' . (int) $this->attachment_data[$index]['attach_id']); + } + } + else + { + delete_attachments('attach', array(intval($this->attachment_data[$index]['attach_id']))); + } + + 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); + + // Reindex Array + $this->attachment_data = array_values($this->attachment_data); + if (isset($this->plupload) && $this->plupload->is_active()) + { + $json_response->send($this->attachment_data); + } + } + } + else if (($add_file || $preview) && $upload_file) + { + if ($num_attachments < $cfg['max_attachments'] || $auth->acl_gets('m_', 'a_', $forum_id)) + { + $filedata = upload_attachment($form_name, $forum_id, false, '', $is_message, false, $this->mimetype_guesser, $this->plupload); + $error = array_merge($error, $filedata['error']); + + if (!sizeof($error)) + { + $sql_ary = array( + 'physical_filename' => $filedata['physical_filename'], + 'attach_comment' => $this->filename_data['filecomment'], + 'real_filename' => $filedata['real_filename'], + 'extension' => $filedata['extension'], + 'mimetype' => $filedata['mimetype'], + 'filesize' => $filedata['filesize'], + 'filetime' => $filedata['filetime'], + 'thumbnail' => $filedata['thumbnail'], + 'is_orphan' => 1, + 'in_message' => ($is_message) ? 1 : 0, + 'poster_id' => $user->data['user_id'], + ); + + $db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + + $new_entry = array( + 'attach_id' => $db->sql_nextid(), + 'is_orphan' => 1, + 'real_filename' => $filedata['real_filename'], + 'attach_comment'=> $this->filename_data['filecomment'], + 'filesize' => $filedata['filesize'], + ); + + $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->filename_data['filecomment'] = ''; + + if (isset($this->plupload) && $this->plupload->is_active()) + { + $download_url = append_sid("{$phpbb_root_path}download/file.{$phpEx}", 'mode=view&id=' . $new_entry['attach_id']); + + // Send the client the attachment data to maintain state + $json_response->send(array('data' => $this->attachment_data, 'download_url' => $download_url)); + } + } + } + else + { + $error[] = $user->lang('TOO_MANY_ATTACHMENTS', (int) $cfg['max_attachments']); + } + + if (!empty($error) && isset($this->plupload) && $this->plupload->is_active()) + { + // If this is a plupload (and thus ajax) request, give the + // client the first error we have + $json_response->send(array( + 'jsonrpc' => '2.0', + 'id' => 'id', + 'error' => array( + 'code' => 105, + 'message' => current($error), + ), + )); + } + } + } + + foreach ($error as $error_msg) + { + $this->warn_msg[] = $error_msg; + } + } + + /** + * Get Attachment Data + */ + function get_submitted_attachment_data($check_user_id = false) + { + global $user, $db, $phpbb_root_path, $phpEx, $config; + global $request; + + $this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true)); + $attachment_data = $request->variable('attachment_data', array(0 => array('' => '')), true, \phpbb\request\request_interface::POST); + $this->attachment_data = array(); + + $check_user_id = ($check_user_id === false) ? $user->data['user_id'] : $check_user_id; + + if (!sizeof($attachment_data)) + { + return; + } + + $not_orphan = $orphan = array(); + + foreach ($attachment_data as $pos => $var_ary) + { + if ($var_ary['is_orphan']) + { + $orphan[(int) $var_ary['attach_id']] = $pos; + } + else + { + $not_orphan[(int) $var_ary['attach_id']] = $pos; + } + } + + // Regenerate already posted attachments + if (sizeof($not_orphan)) + { + // Get the attachment data, based on the poster id... + $sql = 'SELECT attach_id, is_orphan, real_filename, attach_comment, filesize + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', array_keys($not_orphan)) . ' + AND poster_id = ' . $check_user_id; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $pos = $not_orphan[$row['attach_id']]; + $this->attachment_data[$pos] = $row; + $this->attachment_data[$pos]['attach_comment'] = $attachment_data[$pos]['attach_comment']; + + unset($not_orphan[$row['attach_id']]); + } + $db->sql_freeresult($result); + } + + if (sizeof($not_orphan)) + { + trigger_error('NO_ACCESS_ATTACHMENT', E_USER_ERROR); + } + + // Regenerate newly uploaded attachments + if (sizeof($orphan)) + { + $sql = 'SELECT attach_id, is_orphan, real_filename, attach_comment, filesize + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', array_keys($orphan)) . ' + AND poster_id = ' . $user->data['user_id'] . ' + AND is_orphan = 1'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $pos = $orphan[$row['attach_id']]; + $this->attachment_data[$pos] = $row; + $this->attachment_data[$pos]['attach_comment'] = $attachment_data[$pos]['attach_comment']; + + unset($orphan[$row['attach_id']]); + } + $db->sql_freeresult($result); + } + + if (sizeof($orphan)) + { + trigger_error('NO_ACCESS_ATTACHMENT', E_USER_ERROR); + } + + ksort($this->attachment_data); + } + + /** + * Parse Poll + */ + function parse_poll(&$poll) + { + global $auth, $user, $config; + + $poll_max_options = $poll['poll_max_options']; + + // 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'); + + $bbcode_bitfield = base64_encode(base64_decode($bbcode_bitfield) | base64_decode($this->bbcode_bitfield)); + $this->message = $tmp_message; + + // 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']; + } + else + { + if (utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message)) > 100) + { + $this->warn_msg[] = $user->lang['POLL_TITLE_TOO_LONG']; + } + $poll['poll_title'] = $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'); + if (strlen($poll['poll_title']) > 255) + { + $this->warn_msg[] = $user->lang['POLL_TITLE_COMP_TOO_LONG']; + } + } + + $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']; + } + else if ($poll['poll_options_size'] > (int) $config['max_poll_options']) + { + $this->warn_msg[] = $user->lang['TOO_MANY_POLL_OPTIONS']; + } + else if ($poll_max_options > $poll['poll_options_size']) + { + $this->warn_msg[] = $user->lang['TOO_MANY_USER_OPTIONS']; + } + + $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']); + } + + /** + * Setter function for passing the plupload object + * + * @param \phpbb\plupload\plupload $plupload The plupload object + * + * @return null + */ + public function set_plupload(\phpbb\plupload\plupload $plupload) + { + $this->plupload = $plupload; + } + + /** + * Setter function for passing the mimetype_guesser object + * + * @param \phpbb\mimetype\guesser $mimetype_guesser The mimetype_guesser object + * + * @return null + */ + public function set_mimetype_guesser(\phpbb\mimetype\guesser $mimetype_guesser) + { + $this->mimetype_guesser = $mimetype_guesser; + } +} diff --git a/sources/phpBB/includes/questionnaire/questionnaire.php b/sources/phpBB/includes/questionnaire/questionnaire.php new file mode 100644 index 0000000..63ea432 --- /dev/null +++ b/sources/phpBB/includes/questionnaire/questionnaire.php @@ -0,0 +1,503 @@ + +* @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; +} + +/** +* This class collects data which is used to create some usage statistics. +* +* The collected data is - after authorization of the administrator - submitted +* to a central server. For privacy reasons we try to collect only data which aren't private +* or don't give any information which might help to identify the user. +* +* @author Johannes Schlueter +* @copyright (c) 2007-2008 Johannes Schlueter +*/ +class phpbb_questionnaire_data_collector +{ + var $providers; + var $data = null; + var $install_id = ''; + + /** + * Constructor. + * + * @param string + */ + function phpbb_questionnaire_data_collector($install_id) + { + $this->install_id = $install_id; + $this->providers = array(); + } + + function add_data_provider(&$provider) + { + $this->providers[] = &$provider; + } + + /** + * Get data as an array. + * + * @return array All Data + */ + function get_data_raw() + { + if (!$this->data) + { + $this->collect(); + } + + return $this->data; + } + + function get_data_for_form() + { + return base64_encode(serialize($this->get_data_raw())); + } + + /** + * Collect info into the data property. + * + * @return null + */ + function collect() + { + foreach (array_keys($this->providers) as $key) + { + $provider = &$this->providers[$key]; + $this->data[$provider->get_identifier()] = $provider->get_data(); + } + $this->data['install_id'] = $this->install_id; + } +} + +/** interface: get_indentifier(), get_data() */ + +/** +* Questionnaire PHP data provider +*/ +class phpbb_questionnaire_php_data_provider +{ + function get_identifier() + { + return 'PHP'; + } + + /** + * Get data about the PHP runtime setup. + * + * @return array + */ + function get_data() + { + return array( + 'version' => PHP_VERSION, + 'sapi' => PHP_SAPI, + 'int_size' => defined('PHP_INT_SIZE') ? PHP_INT_SIZE : '', + 'safe_mode' => (int) @ini_get('safe_mode'), + 'open_basedir' => (int) @ini_get('open_basedir'), + 'memory_limit' => @ini_get('memory_limit'), + 'allow_url_fopen' => (int) @ini_get('allow_url_fopen'), + 'allow_url_include' => (int) @ini_get('allow_url_include'), + 'file_uploads' => (int) @ini_get('file_uploads'), + 'upload_max_filesize' => @ini_get('upload_max_filesize'), + 'post_max_size' => @ini_get('post_max_size'), + 'disable_functions' => @ini_get('disable_functions'), + 'disable_classes' => @ini_get('disable_classes'), + 'enable_dl' => (int) @ini_get('enable_dl'), + 'magic_quotes_gpc' => (int) @ini_get('magic_quotes_gpc'), + 'register_globals' => (int) @ini_get('register_globals'), + 'filter.default' => @ini_get('filter.default'), + 'zend.ze1_compatibility_mode' => (int) @ini_get('zend.ze1_compatibility_mode'), + 'unicode.semantics' => (int) @ini_get('unicode.semantics'), + 'zend_thread_safty' => (int) function_exists('zend_thread_id'), + 'extensions' => get_loaded_extensions(), + ); + } +} + +/** +* Questionnaire System data provider +*/ +class phpbb_questionnaire_system_data_provider +{ + function get_identifier() + { + return 'System'; + } + + /** + * Get data about the general system information, like OS or IP (shortened). + * + * @return array + */ + function get_data() + { + global $request; + + // Start discovering the IPV4 server address, if available + // Try apache, IIS, fall back to 0.0.0.0 + $server_address = htmlspecialchars_decode($request->server('SERVER_ADDR', $request->server('LOCAL_ADDR', '0.0.0.0'))); + + return array( + 'os' => PHP_OS, + 'httpd' => htmlspecialchars_decode($request->server('SERVER_SOFTWARE')), + // we don't want the real IP address (for privacy policy reasons) but only + // a network address to see whether your installation is running on a private or public network. + 'private_ip' => $this->is_private_ip($server_address), + 'ipv6' => strpos($server_address, ':') !== false, + ); + } + + /** + * Checks whether the given IP is in a private network. + * + * @param string $ip IP in v4 dot-decimal or v6 hex format + * @return bool true if the IP is from a private network, else false + */ + function is_private_ip($ip) + { + // IPv4 + if (strpos($ip, ':') === false) + { + $ip_address_ary = explode('.', $ip); + + // build ip + if (!isset($ip_address_ary[0]) || !isset($ip_address_ary[1])) + { + $ip_address_ary = explode('.', '0.0.0.0'); + } + + // IANA reserved addresses for private networks (RFC 1918) are: + // - 10.0.0.0/8 + // - 172.16.0.0/12 + // - 192.168.0.0/16 + if ($ip_address_ary[0] == '10' || + ($ip_address_ary[0] == '172' && intval($ip_address_ary[1]) > 15 && intval($ip_address_ary[1]) < 32) || + ($ip_address_ary[0] == '192' && $ip_address_ary[1] == '168') || + ($ip_address_ary[0] == '192' && $ip_address_ary[1] == '168')) + { + return true; + } + } + // IPv6 + else + { + // unique local unicast + $prefix = substr($ip, 0, 2); + if ($prefix == 'fc' || $prefix == 'fd') + { + return true; + } + } + + return false; + } +} + +/** +* Questionnaire phpBB data provider +*/ +class phpbb_questionnaire_phpbb_data_provider +{ + var $config; + var $unique_id; + + /** + * Constructor. + * + * @param array $config + */ + function phpbb_questionnaire_phpbb_data_provider($config) + { + // generate a unique id if necessary + if (empty($config['questionnaire_unique_id'])) + { + $this->unique_id = unique_id(); + set_config('questionnaire_unique_id', $this->unique_id); + } + else + { + $this->unique_id = $config['questionnaire_unique_id']; + } + + $this->config = $config; + } + + /** + * Returns a string identifier for this data provider + * + * @return string "phpBB" + */ + function get_identifier() + { + return 'phpBB'; + } + + /** + * Get data about this phpBB installation. + * + * @return array Relevant anonymous config options + */ + function get_data() + { + global $phpbb_root_path, $phpEx, $phpbb_config_php_file; + + extract($phpbb_config_php_file->get_all()); + unset($dbhost, $dbport, $dbname, $dbuser, $dbpasswd); // Just a precaution + + $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms); + + // Only send certain config vars + $config_vars = array( + 'active_sessions' => true, + 'allow_attachments' => true, + 'allow_autologin' => true, + 'allow_avatar' => true, + 'allow_avatar_local' => true, + 'allow_avatar_remote' => true, + 'allow_avatar_upload' => true, + 'allow_bbcode' => true, + 'allow_birthdays' => true, + 'allow_bookmarks' => true, + 'allow_emailreuse' => true, + 'allow_forum_notify' => true, + 'allow_mass_pm' => true, + 'allow_name_chars' => true, + 'allow_namechange' => true, + 'allow_nocensors' => true, + 'allow_pm_attach' => true, + 'allow_pm_report' => true, + 'allow_post_flash' => true, + 'allow_post_links' => true, + 'allow_privmsg' => true, + 'allow_quick_reply' => true, + 'allow_sig' => true, + 'allow_sig_bbcode' => true, + 'allow_sig_flash' => true, + 'allow_sig_img' => true, + 'allow_sig_links' => true, + 'allow_sig_pm' => true, + 'allow_sig_smilies' => true, + 'allow_smilies' => true, + 'allow_topic_notify' => true, + 'attachment_quota' => true, + 'auth_bbcode_pm' => true, + 'auth_flash_pm' => true, + 'auth_img_pm' => true, + 'auth_method' => true, + 'auth_smilies_pm' => true, + 'avatar_filesize' => true, + 'avatar_max_height' => true, + 'avatar_max_width' => true, + 'avatar_min_height' => true, + 'avatar_min_width' => true, + 'board_email_form' => true, + 'board_hide_emails' => true, + 'board_timezone' => true, + 'browser_check' => true, + 'bump_interval' => true, + 'bump_type' => true, + 'cache_gc' => true, + 'captcha_plugin' => true, + 'captcha_gd' => true, + 'captcha_gd_foreground_noise' => true, + 'captcha_gd_x_grid' => true, + 'captcha_gd_y_grid' => true, + 'captcha_gd_wave' => true, + 'captcha_gd_3d_noise' => true, + 'captcha_gd_fonts' => true, + 'confirm_refresh' => true, + 'check_attachment_content' => true, + 'check_dnsbl' => true, + 'chg_passforce' => true, + 'cookie_secure' => true, + 'coppa_enable' => true, + 'database_gc' => true, + 'dbms_version' => true, + 'default_dateformat' => true, + 'default_lang' => true, + 'display_last_edited' => true, + 'display_order' => true, + 'edit_time' => true, + 'email_check_mx' => true, + 'email_enable' => true, + 'email_function_name' => true, + 'email_package_size' => true, + 'enable_confirm' => true, + 'enable_pm_icons' => true, + 'enable_post_confirm' => true, + 'feed_enable' => true, + 'feed_http_auth' => true, + 'feed_limit_post' => true, + 'feed_limit_topic' => true, + 'feed_overall' => true, + 'feed_overall_forums' => true, + 'feed_forum' => true, + 'feed_topic' => true, + 'feed_topics_new' => true, + 'feed_topics_active' => true, + 'feed_item_statistics' => true, + 'flood_interval' => true, + 'force_server_vars' => true, + 'form_token_lifetime' => true, + 'form_token_mintime' => true, + 'form_token_sid_guests' => true, + 'forward_pm' => true, + 'forwarded_for_check' => true, + 'full_folder_action' => true, + 'fulltext_native_common_thres' => true, + 'fulltext_native_load_upd' => true, + 'fulltext_native_max_chars' => true, + 'fulltext_native_min_chars' => true, + 'gzip_compress' => true, + 'hot_threshold' => true, + 'img_create_thumbnail' => true, + 'img_display_inlined' => true, + 'img_imagick' => true, + 'img_link_height' => true, + 'img_link_width' => true, + 'img_max_height' => true, + 'img_max_thumb_width' => true, + 'img_max_width' => true, + 'img_min_thumb_filesize' => true, + 'ip_check' => true, + 'jab_enable' => true, + 'jab_package_size' => true, + 'jab_use_ssl' => true, + 'limit_load' => true, + 'limit_search_load' => true, + 'load_anon_lastread' => true, + 'load_birthdays' => true, + 'load_cpf_memberlist' => true, + 'load_cpf_viewprofile' => true, + 'load_cpf_viewtopic' => true, + 'load_db_lastread' => true, + 'load_db_track' => true, + 'load_jumpbox' => true, + 'load_moderators' => true, + 'load_online' => true, + 'load_online_guests' => true, + 'load_online_time' => true, + 'load_onlinetrack' => true, + 'load_search' => true, + 'load_tplcompile' => true, + 'load_user_activity' => true, + 'max_attachments' => true, + 'max_attachments_pm' => true, + 'max_autologin_time' => true, + 'max_filesize' => true, + 'max_filesize_pm' => true, + 'max_login_attempts' => true, + 'max_name_chars' => true, + 'max_num_search_keywords' => true, + 'max_pass_chars' => true, + 'max_poll_options' => true, + 'max_post_chars' => true, + 'max_post_font_size' => true, + 'max_post_img_height' => true, + 'max_post_img_width' => true, + 'max_post_smilies' => true, + 'max_post_urls' => true, + 'max_quote_depth' => true, + 'max_reg_attempts' => true, + 'max_sig_chars' => true, + 'max_sig_font_size' => true, + 'max_sig_img_height' => true, + 'max_sig_img_width' => true, + 'max_sig_smilies' => true, + 'max_sig_urls' => true, + 'min_name_chars' => true, + 'min_pass_chars' => true, + 'min_post_chars' => true, + 'min_search_author_chars' => true, + 'mime_triggers' => true, + 'new_member_post_limit' => true, + 'new_member_group_default' => true, + 'override_user_style' => true, + 'pass_complex' => true, + 'pm_edit_time' => true, + 'pm_max_boxes' => true, + 'pm_max_msgs' => true, + 'pm_max_recipients' => true, + 'posts_per_page' => true, + 'print_pm' => true, + 'queue_interval' => true, + 'require_activation' => true, + 'referer_validation' => true, + 'search_block_size' => true, + 'search_gc' => true, + 'search_interval' => true, + 'search_anonymous_interval' => true, + 'search_type' => true, + 'search_store_results' => true, + 'secure_allow_deny' => true, + 'secure_allow_empty_referer' => true, + 'secure_downloads' => true, + 'session_gc' => true, + 'session_length' => true, + 'smtp_auth_method' => true, + 'smtp_delivery' => true, + 'topics_per_page' => true, + 'tpl_allow_php' => true, + 'version' => true, + 'warnings_expire_days' => true, + 'warnings_gc' => true, + + 'num_files' => true, + 'num_posts' => true, + 'num_topics' => true, + 'num_users' => true, + 'record_online_users' => true, + ); + + $result = array(); + foreach ($config_vars as $name => $void) + { + if (isset($this->config[$name])) + { + $result['config_' . $name] = $this->config[$name]; + } + } + + global $db, $request; + + $result['dbms'] = $dbms; + $result['acm_type'] = $acm_type; + $result['user_agent'] = 'Unknown'; + $result['dbms_version'] = $db->sql_server_info(true); + + // Try to get user agent vendor and version + $match = array(); + $user_agent = $request->header('User-Agent'); + $agents = array('firefox', 'msie', 'opera', 'chrome', 'safari', 'mozilla', 'seamonkey', 'konqueror', 'netscape', 'gecko', 'navigator', 'mosaic', 'lynx', 'amaya', 'omniweb', 'avant', 'camino', 'flock', 'aol'); + + // We check here 1 by 1 because some strings occur after others (for example Mozilla [...] Firefox/) + foreach ($agents as $agent) + { + if (preg_match('#(' . $agent . ')[/ ]?([0-9.]*)#i', $user_agent, $match)) + { + $result['user_agent'] = $match[1] . ' ' . $match[2]; + break; + } + } + + return $result; + } +} diff --git a/sources/phpBB/includes/sphinxapi.php b/sources/phpBB/includes/sphinxapi.php new file mode 100644 index 0000000..6c3b667 --- /dev/null +++ b/sources/phpBB/includes/sphinxapi.php @@ -0,0 +1,1712 @@ +=8 ) + { + $v = (int)$v; + return pack ( "NN", $v>>32, $v&0xFFFFFFFF ); + } + + // x32, int + if ( is_int($v) ) + return pack ( "NN", $v < 0 ? -1 : 0, $v ); + + // x32, bcmath + if ( function_exists("bcmul") ) + { + if ( bccomp ( $v, 0 ) == -1 ) + $v = bcadd ( "18446744073709551616", $v ); + $h = bcdiv ( $v, "4294967296", 0 ); + $l = bcmod ( $v, "4294967296" ); + return pack ( "NN", (float)$h, (float)$l ); // conversion to float is intentional; int would lose 31st bit + } + + // x32, no-bcmath + $p = max(0, strlen($v) - 13); + $lo = abs((float)substr($v, $p)); + $hi = abs((float)substr($v, 0, $p)); + + $m = $lo + $hi*1316134912.0; // (10 ^ 13) % (1 << 32) = 1316134912 + $q = floor($m/4294967296.0); + $l = $m - ($q*4294967296.0); + $h = $hi*2328.0 + $q; // (10 ^ 13) / (1 << 32) = 2328 + + if ( $v<0 ) + { + if ( $l==0 ) + $h = 4294967296.0 - $h; + else + { + $h = 4294967295.0 - $h; + $l = 4294967296.0 - $l; + } + } + return pack ( "NN", $h, $l ); +} + +/// pack 64-bit unsigned +function sphPackU64 ( $v ) +{ + assert ( is_numeric($v) ); + + // x64 + if ( PHP_INT_SIZE>=8 ) + { + assert ( $v>=0 ); + + // x64, int + if ( is_int($v) ) + return pack ( "NN", $v>>32, $v&0xFFFFFFFF ); + + // x64, bcmath + if ( function_exists("bcmul") ) + { + $h = bcdiv ( $v, 4294967296, 0 ); + $l = bcmod ( $v, 4294967296 ); + return pack ( "NN", $h, $l ); + } + + // x64, no-bcmath + $p = max ( 0, strlen($v) - 13 ); + $lo = (int)substr ( $v, $p ); + $hi = (int)substr ( $v, 0, $p ); + + $m = $lo + $hi*1316134912; + $l = $m % 4294967296; + $h = $hi*2328 + (int)($m/4294967296); + + return pack ( "NN", $h, $l ); + } + + // x32, int + if ( is_int($v) ) + return pack ( "NN", 0, $v ); + + // x32, bcmath + if ( function_exists("bcmul") ) + { + $h = bcdiv ( $v, "4294967296", 0 ); + $l = bcmod ( $v, "4294967296" ); + return pack ( "NN", (float)$h, (float)$l ); // conversion to float is intentional; int would lose 31st bit + } + + // x32, no-bcmath + $p = max(0, strlen($v) - 13); + $lo = (float)substr($v, $p); + $hi = (float)substr($v, 0, $p); + + $m = $lo + $hi*1316134912.0; + $q = floor($m / 4294967296.0); + $l = $m - ($q * 4294967296.0); + $h = $hi*2328.0 + $q; + + return pack ( "NN", $h, $l ); +} + +// unpack 64-bit unsigned +function sphUnpackU64 ( $v ) +{ + list ( $hi, $lo ) = array_values ( unpack ( "N*N*", $v ) ); + + if ( PHP_INT_SIZE>=8 ) + { + if ( $hi<0 ) $hi += (1<<32); // because php 5.2.2 to 5.2.5 is totally fucked up again + if ( $lo<0 ) $lo += (1<<32); + + // x64, int + if ( $hi<=2147483647 ) + return ($hi<<32) + $lo; + + // x64, bcmath + if ( function_exists("bcmul") ) + return bcadd ( $lo, bcmul ( $hi, "4294967296" ) ); + + // x64, no-bcmath + $C = 100000; + $h = ((int)($hi / $C) << 32) + (int)($lo / $C); + $l = (($hi % $C) << 32) + ($lo % $C); + if ( $l>$C ) + { + $h += (int)($l / $C); + $l = $l % $C; + } + + if ( $h==0 ) + return $l; + return sprintf ( "%d%05d", $h, $l ); + } + + // x32, int + if ( $hi==0 ) + { + if ( $lo>0 ) + return $lo; + return sprintf ( "%u", $lo ); + } + + $hi = sprintf ( "%u", $hi ); + $lo = sprintf ( "%u", $lo ); + + // x32, bcmath + if ( function_exists("bcmul") ) + return bcadd ( $lo, bcmul ( $hi, "4294967296" ) ); + + // x32, no-bcmath + $hi = (float)$hi; + $lo = (float)$lo; + + $q = floor($hi/10000000.0); + $r = $hi - $q*10000000.0; + $m = $lo + $r*4967296.0; + $mq = floor($m/10000000.0); + $l = $m - $mq*10000000.0; + $h = $q*4294967296.0 + $r*429.0 + $mq; + + $h = sprintf ( "%.0f", $h ); + $l = sprintf ( "%07.0f", $l ); + if ( $h=="0" ) + return sprintf( "%.0f", (float)$l ); + return $h . $l; +} + +// unpack 64-bit signed +function sphUnpackI64 ( $v ) +{ + list ( $hi, $lo ) = array_values ( unpack ( "N*N*", $v ) ); + + // x64 + if ( PHP_INT_SIZE>=8 ) + { + if ( $hi<0 ) $hi += (1<<32); // because php 5.2.2 to 5.2.5 is totally fucked up again + if ( $lo<0 ) $lo += (1<<32); + + return ($hi<<32) + $lo; + } + + // x32, int + if ( $hi==0 ) + { + if ( $lo>0 ) + return $lo; + return sprintf ( "%u", $lo ); + } + // x32, int + elseif ( $hi==-1 ) + { + if ( $lo<0 ) + return $lo; + return sprintf ( "%.0f", $lo - 4294967296.0 ); + } + + $neg = ""; + $c = 0; + if ( $hi<0 ) + { + $hi = ~$hi; + $lo = ~$lo; + $c = 1; + $neg = "-"; + } + + $hi = sprintf ( "%u", $hi ); + $lo = sprintf ( "%u", $lo ); + + // x32, bcmath + if ( function_exists("bcmul") ) + return $neg . bcadd ( bcadd ( $lo, bcmul ( $hi, "4294967296" ) ), $c ); + + // x32, no-bcmath + $hi = (float)$hi; + $lo = (float)$lo; + + $q = floor($hi/10000000.0); + $r = $hi - $q*10000000.0; + $m = $lo + $r*4967296.0; + $mq = floor($m/10000000.0); + $l = $m - $mq*10000000.0 + $c; + $h = $q*4294967296.0 + $r*429.0 + $mq; + if ( $l==10000000 ) + { + $l = 0; + $h += 1; + } + + $h = sprintf ( "%.0f", $h ); + $l = sprintf ( "%07.0f", $l ); + if ( $h=="0" ) + return $neg . sprintf( "%.0f", (float)$l ); + return $neg . $h . $l; +} + + +function sphFixUint ( $value ) +{ + if ( PHP_INT_SIZE>=8 ) + { + // x64 route, workaround broken unpack() in 5.2.2+ + if ( $value<0 ) $value += (1<<32); + return $value; + } + else + { + // x32 route, workaround php signed/unsigned braindamage + return sprintf ( "%u", $value ); + } +} + + +/// sphinx searchd client class +class SphinxClient +{ + var $_host; ///< searchd host (default is "localhost") + var $_port; ///< searchd port (default is 9312) + var $_offset; ///< how many records to seek from result-set start (default is 0) + var $_limit; ///< how many records to return from result-set starting at offset (default is 20) + var $_mode; ///< query matching mode (default is SPH_MATCH_ALL) + var $_weights; ///< per-field weights (default is 1 for all fields) + var $_sort; ///< match sorting mode (default is SPH_SORT_RELEVANCE) + var $_sortby; ///< attribute to sort by (defualt is "") + var $_min_id; ///< min ID to match (default is 0, which means no limit) + var $_max_id; ///< max ID to match (default is 0, which means no limit) + var $_filters; ///< search filters + var $_groupby; ///< group-by attribute name + var $_groupfunc; ///< group-by function (to pre-process group-by attribute value with) + var $_groupsort; ///< group-by sorting clause (to sort groups in result set with) + var $_groupdistinct;///< group-by count-distinct attribute + var $_maxmatches; ///< max matches to retrieve + var $_cutoff; ///< cutoff to stop searching at (default is 0) + var $_retrycount; ///< distributed retries count + var $_retrydelay; ///< distributed retries delay + var $_anchor; ///< geographical anchor point + var $_indexweights; ///< per-index weights + var $_ranker; ///< ranking mode (default is SPH_RANK_PROXIMITY_BM25) + var $_rankexpr; ///< ranking mode expression (for SPH_RANK_EXPR) + var $_maxquerytime; ///< max query time, milliseconds (default is 0, do not limit) + var $_fieldweights; ///< per-field-name weights + var $_overrides; ///< per-query attribute values overrides + var $_select; ///< select-list (attributes or expressions, with optional aliases) + + var $_error; ///< last error message + var $_warning; ///< last warning message + var $_connerror; ///< connection error vs remote error flag + + var $_reqs; ///< requests array for multi-query + var $_mbenc; ///< stored mbstring encoding + var $_arrayresult; ///< whether $result["matches"] should be a hash or an array + var $_timeout; ///< connect timeout + + ///////////////////////////////////////////////////////////////////////////// + // common stuff + ///////////////////////////////////////////////////////////////////////////// + + /// create a new client object and fill defaults + function SphinxClient () + { + // per-client-object settings + $this->_host = "localhost"; + $this->_port = 9312; + $this->_path = false; + $this->_socket = false; + + // per-query settings + $this->_offset = 0; + $this->_limit = 20; + $this->_mode = SPH_MATCH_ALL; + $this->_weights = array (); + $this->_sort = SPH_SORT_RELEVANCE; + $this->_sortby = ""; + $this->_min_id = 0; + $this->_max_id = 0; + $this->_filters = array (); + $this->_groupby = ""; + $this->_groupfunc = SPH_GROUPBY_DAY; + $this->_groupsort = "@group desc"; + $this->_groupdistinct= ""; + $this->_maxmatches = 1000; + $this->_cutoff = 0; + $this->_retrycount = 0; + $this->_retrydelay = 0; + $this->_anchor = array (); + $this->_indexweights= array (); + $this->_ranker = SPH_RANK_PROXIMITY_BM25; + $this->_rankexpr = ""; + $this->_maxquerytime= 0; + $this->_fieldweights= array(); + $this->_overrides = array(); + $this->_select = "*"; + + $this->_error = ""; // per-reply fields (for single-query case) + $this->_warning = ""; + $this->_connerror = false; + + $this->_reqs = array (); // requests storage (for multi-query case) + $this->_mbenc = ""; + $this->_arrayresult = false; + $this->_timeout = 0; + } + + function __destruct() + { + if ( $this->_socket !== false ) + fclose ( $this->_socket ); + } + + /// get last error message (string) + function GetLastError () + { + return $this->_error; + } + + /// get last warning message (string) + function GetLastWarning () + { + return $this->_warning; + } + + /// get last error flag (to tell network connection errors from searchd errors or broken responses) + function IsConnectError() + { + return $this->_connerror; + } + + /// set searchd host name (string) and port (integer) + function SetServer ( $host, $port = 0 ) + { + assert ( is_string($host) ); + if ( $host[0] == '/') + { + $this->_path = 'unix://' . $host; + return; + } + if ( substr ( $host, 0, 7 )=="unix://" ) + { + $this->_path = $host; + return; + } + + assert ( is_int($port) ); + $this->_host = $host; + $this->_port = $port; + $this->_path = ''; + + } + + /// set server connection timeout (0 to remove) + function SetConnectTimeout ( $timeout ) + { + assert ( is_numeric($timeout) ); + $this->_timeout = $timeout; + } + + + function _Send ( $handle, $data, $length ) + { + if ( feof($handle) || fwrite ( $handle, $data, $length ) !== $length ) + { + $this->_error = 'connection unexpectedly closed (timed out?)'; + $this->_connerror = true; + return false; + } + return true; + } + + ///////////////////////////////////////////////////////////////////////////// + + /// enter mbstring workaround mode + function _MBPush () + { + $this->_mbenc = ""; + if ( ini_get ( "mbstring.func_overload" ) & 2 ) + { + $this->_mbenc = mb_internal_encoding(); + mb_internal_encoding ( "latin1" ); + } + } + + /// leave mbstring workaround mode + function _MBPop () + { + if ( $this->_mbenc ) + mb_internal_encoding ( $this->_mbenc ); + } + + /// connect to searchd server + function _Connect () + { + if ( $this->_socket!==false ) + { + // we are in persistent connection mode, so we have a socket + // however, need to check whether it's still alive + if ( !@feof ( $this->_socket ) ) + return $this->_socket; + + // force reopen + $this->_socket = false; + } + + $errno = 0; + $errstr = ""; + $this->_connerror = false; + + if ( $this->_path ) + { + $host = $this->_path; + $port = 0; + } + else + { + $host = $this->_host; + $port = $this->_port; + } + + if ( $this->_timeout<=0 ) + $fp = @fsockopen ( $host, $port, $errno, $errstr ); + else + $fp = @fsockopen ( $host, $port, $errno, $errstr, $this->_timeout ); + + if ( !$fp ) + { + if ( $this->_path ) + $location = $this->_path; + else + $location = "{$this->_host}:{$this->_port}"; + + $errstr = trim ( $errstr ); + $this->_error = "connection to $location failed (errno=$errno, msg=$errstr)"; + $this->_connerror = true; + return false; + } + + // send my version + // this is a subtle part. we must do it before (!) reading back from searchd. + // because otherwise under some conditions (reported on FreeBSD for instance) + // TCP stack could throttle write-write-read pattern because of Nagle. + if ( !$this->_Send ( $fp, pack ( "N", 1 ), 4 ) ) + { + fclose ( $fp ); + $this->_error = "failed to send client protocol version"; + return false; + } + + // check version + list(,$v) = unpack ( "N*", fread ( $fp, 4 ) ); + $v = (int)$v; + if ( $v<1 ) + { + fclose ( $fp ); + $this->_error = "expected searchd protocol version 1+, got version '$v'"; + return false; + } + + return $fp; + } + + /// get and check response packet from searchd server + function _GetResponse ( $fp, $client_ver ) + { + $response = ""; + $len = 0; + + $header = fread ( $fp, 8 ); + if ( strlen($header)==8 ) + { + list ( $status, $ver, $len ) = array_values ( unpack ( "n2a/Nb", $header ) ); + $left = $len; + while ( $left>0 && !feof($fp) ) + { + $chunk = fread ( $fp, min ( 8192, $left ) ); + if ( $chunk ) + { + $response .= $chunk; + $left -= strlen($chunk); + } + } + } + if ( $this->_socket === false ) + fclose ( $fp ); + + // check response + $read = strlen ( $response ); + if ( !$response || $read!=$len ) + { + $this->_error = $len + ? "failed to read searchd response (status=$status, ver=$ver, len=$len, read=$read)" + : "received zero-sized searchd response"; + return false; + } + + // check status + if ( $status==SEARCHD_WARNING ) + { + list(,$wlen) = unpack ( "N*", substr ( $response, 0, 4 ) ); + $this->_warning = substr ( $response, 4, $wlen ); + return substr ( $response, 4+$wlen ); + } + if ( $status==SEARCHD_ERROR ) + { + $this->_error = "searchd error: " . substr ( $response, 4 ); + return false; + } + if ( $status==SEARCHD_RETRY ) + { + $this->_error = "temporary searchd error: " . substr ( $response, 4 ); + return false; + } + if ( $status!=SEARCHD_OK ) + { + $this->_error = "unknown status code '$status'"; + return false; + } + + // check version + if ( $ver<$client_ver ) + { + $this->_warning = sprintf ( "searchd command v.%d.%d older than client's v.%d.%d, some options might not work", + $ver>>8, $ver&0xff, $client_ver>>8, $client_ver&0xff ); + } + + return $response; + } + + ///////////////////////////////////////////////////////////////////////////// + // searching + ///////////////////////////////////////////////////////////////////////////// + + /// set offset and count into result set, + /// and optionally set max-matches and cutoff limits + function SetLimits ( $offset, $limit, $max=0, $cutoff=0 ) + { + assert ( is_int($offset) ); + assert ( is_int($limit) ); + assert ( $offset>=0 ); + assert ( $limit>0 ); + assert ( $max>=0 ); + $this->_offset = $offset; + $this->_limit = $limit; + if ( $max>0 ) + $this->_maxmatches = $max; + if ( $cutoff>0 ) + $this->_cutoff = $cutoff; + } + + /// set maximum query time, in milliseconds, per-index + /// integer, 0 means "do not limit" + function SetMaxQueryTime ( $max ) + { + assert ( is_int($max) ); + assert ( $max>=0 ); + $this->_maxquerytime = $max; + } + + /// set matching mode + function SetMatchMode ( $mode ) + { + assert ( $mode==SPH_MATCH_ALL + || $mode==SPH_MATCH_ANY + || $mode==SPH_MATCH_PHRASE + || $mode==SPH_MATCH_BOOLEAN + || $mode==SPH_MATCH_EXTENDED + || $mode==SPH_MATCH_FULLSCAN + || $mode==SPH_MATCH_EXTENDED2 ); + $this->_mode = $mode; + } + + /// set ranking mode + function SetRankingMode ( $ranker, $rankexpr="" ) + { + assert ( $ranker>=0 && $ranker_ranker = $ranker; + $this->_rankexpr = $rankexpr; + } + + /// set matches sorting mode + function SetSortMode ( $mode, $sortby="" ) + { + assert ( + $mode==SPH_SORT_RELEVANCE || + $mode==SPH_SORT_ATTR_DESC || + $mode==SPH_SORT_ATTR_ASC || + $mode==SPH_SORT_TIME_SEGMENTS || + $mode==SPH_SORT_EXTENDED || + $mode==SPH_SORT_EXPR ); + assert ( is_string($sortby) ); + assert ( $mode==SPH_SORT_RELEVANCE || strlen($sortby)>0 ); + + $this->_sort = $mode; + $this->_sortby = $sortby; + } + + /// bind per-field weights by order + /// DEPRECATED; use SetFieldWeights() instead + function SetWeights ( $weights ) + { + assert ( is_array($weights) ); + foreach ( $weights as $weight ) + assert ( is_int($weight) ); + + $this->_weights = $weights; + } + + /// bind per-field weights by name + function SetFieldWeights ( $weights ) + { + assert ( is_array($weights) ); + foreach ( $weights as $name=>$weight ) + { + assert ( is_string($name) ); + assert ( is_int($weight) ); + } + $this->_fieldweights = $weights; + } + + /// bind per-index weights by name + function SetIndexWeights ( $weights ) + { + assert ( is_array($weights) ); + foreach ( $weights as $index=>$weight ) + { + assert ( is_string($index) ); + assert ( is_int($weight) ); + } + $this->_indexweights = $weights; + } + + /// set IDs range to match + /// only match records if document ID is beetwen $min and $max (inclusive) + function SetIDRange ( $min, $max ) + { + assert ( is_numeric($min) ); + assert ( is_numeric($max) ); + assert ( $min<=$max ); + $this->_min_id = $min; + $this->_max_id = $max; + } + + /// set values set filter + /// only match records where $attribute value is in given set + function SetFilter ( $attribute, $values, $exclude=false ) + { + assert ( is_string($attribute) ); + assert ( is_array($values) ); + assert ( count($values) ); + + if ( is_array($values) && count($values) ) + { + foreach ( $values as $value ) + assert ( is_numeric($value) ); + + $this->_filters[] = array ( "type"=>SPH_FILTER_VALUES, "attr"=>$attribute, "exclude"=>$exclude, "values"=>$values ); + } + } + + /// set range filter + /// only match records if $attribute value is beetwen $min and $max (inclusive) + function SetFilterRange ( $attribute, $min, $max, $exclude=false ) + { + assert ( is_string($attribute) ); + assert ( is_numeric($min) ); + assert ( is_numeric($max) ); + assert ( $min<=$max ); + + $this->_filters[] = array ( "type"=>SPH_FILTER_RANGE, "attr"=>$attribute, "exclude"=>$exclude, "min"=>$min, "max"=>$max ); + } + + /// set float range filter + /// only match records if $attribute value is beetwen $min and $max (inclusive) + function SetFilterFloatRange ( $attribute, $min, $max, $exclude=false ) + { + assert ( is_string($attribute) ); + assert ( is_float($min) ); + assert ( is_float($max) ); + assert ( $min<=$max ); + + $this->_filters[] = array ( "type"=>SPH_FILTER_FLOATRANGE, "attr"=>$attribute, "exclude"=>$exclude, "min"=>$min, "max"=>$max ); + } + + /// setup anchor point for geosphere distance calculations + /// required to use @geodist in filters and sorting + /// latitude and longitude must be in radians + function SetGeoAnchor ( $attrlat, $attrlong, $lat, $long ) + { + assert ( is_string($attrlat) ); + assert ( is_string($attrlong) ); + assert ( is_float($lat) ); + assert ( is_float($long) ); + + $this->_anchor = array ( "attrlat"=>$attrlat, "attrlong"=>$attrlong, "lat"=>$lat, "long"=>$long ); + } + + /// set grouping attribute and function + function SetGroupBy ( $attribute, $func, $groupsort="@group desc" ) + { + assert ( is_string($attribute) ); + assert ( is_string($groupsort) ); + assert ( $func==SPH_GROUPBY_DAY + || $func==SPH_GROUPBY_WEEK + || $func==SPH_GROUPBY_MONTH + || $func==SPH_GROUPBY_YEAR + || $func==SPH_GROUPBY_ATTR + || $func==SPH_GROUPBY_ATTRPAIR ); + + $this->_groupby = $attribute; + $this->_groupfunc = $func; + $this->_groupsort = $groupsort; + } + + /// set count-distinct attribute for group-by queries + function SetGroupDistinct ( $attribute ) + { + assert ( is_string($attribute) ); + $this->_groupdistinct = $attribute; + } + + /// set distributed retries count and delay + function SetRetries ( $count, $delay=0 ) + { + assert ( is_int($count) && $count>=0 ); + assert ( is_int($delay) && $delay>=0 ); + $this->_retrycount = $count; + $this->_retrydelay = $delay; + } + + /// set result set format (hash or array; hash by default) + /// PHP specific; needed for group-by-MVA result sets that may contain duplicate IDs + function SetArrayResult ( $arrayresult ) + { + assert ( is_bool($arrayresult) ); + $this->_arrayresult = $arrayresult; + } + + /// set attribute values override + /// there can be only one override per attribute + /// $values must be a hash that maps document IDs to attribute values + function SetOverride ( $attrname, $attrtype, $values ) + { + assert ( is_string ( $attrname ) ); + assert ( in_array ( $attrtype, array ( SPH_ATTR_INTEGER, SPH_ATTR_TIMESTAMP, SPH_ATTR_BOOL, SPH_ATTR_FLOAT, SPH_ATTR_BIGINT ) ) ); + assert ( is_array ( $values ) ); + + $this->_overrides[$attrname] = array ( "attr"=>$attrname, "type"=>$attrtype, "values"=>$values ); + } + + /// set select-list (attributes or expressions), SQL-like syntax + function SetSelect ( $select ) + { + assert ( is_string ( $select ) ); + $this->_select = $select; + } + + ////////////////////////////////////////////////////////////////////////////// + + /// clear all filters (for multi-queries) + function ResetFilters () + { + $this->_filters = array(); + $this->_anchor = array(); + } + + /// clear groupby settings (for multi-queries) + function ResetGroupBy () + { + $this->_groupby = ""; + $this->_groupfunc = SPH_GROUPBY_DAY; + $this->_groupsort = "@group desc"; + $this->_groupdistinct= ""; + } + + /// clear all attribute value overrides (for multi-queries) + function ResetOverrides () + { + $this->_overrides = array (); + } + + ////////////////////////////////////////////////////////////////////////////// + + /// connect to searchd server, run given search query through given indexes, + /// and return the search results + function Query ( $query, $index="*", $comment="" ) + { + assert ( empty($this->_reqs) ); + + $this->AddQuery ( $query, $index, $comment ); + $results = $this->RunQueries (); + $this->_reqs = array (); // just in case it failed too early + + if ( !is_array($results) ) + return false; // probably network error; error message should be already filled + + $this->_error = $results[0]["error"]; + $this->_warning = $results[0]["warning"]; + if ( $results[0]["status"]==SEARCHD_ERROR ) + return false; + else + return $results[0]; + } + + /// helper to pack floats in network byte order + function _PackFloat ( $f ) + { + $t1 = pack ( "f", $f ); // machine order + list(,$t2) = unpack ( "L*", $t1 ); // int in machine order + return pack ( "N", $t2 ); + } + + /// add query to multi-query batch + /// returns index into results array from RunQueries() call + function AddQuery ( $query, $index="*", $comment="" ) + { + // mbstring workaround + $this->_MBPush (); + + // build request + $req = pack ( "NNNN", $this->_offset, $this->_limit, $this->_mode, $this->_ranker ); + if ( $this->_ranker==SPH_RANK_EXPR ) + $req .= pack ( "N", strlen($this->_rankexpr) ) . $this->_rankexpr; + $req .= pack ( "N", $this->_sort ); // (deprecated) sort mode + $req .= pack ( "N", strlen($this->_sortby) ) . $this->_sortby; + $req .= pack ( "N", strlen($query) ) . $query; // query itself + $req .= pack ( "N", count($this->_weights) ); // weights + foreach ( $this->_weights as $weight ) + $req .= pack ( "N", (int)$weight ); + $req .= pack ( "N", strlen($index) ) . $index; // indexes + $req .= pack ( "N", 1 ); // id64 range marker + $req .= sphPackU64 ( $this->_min_id ) . sphPackU64 ( $this->_max_id ); // id64 range + + // filters + $req .= pack ( "N", count($this->_filters) ); + foreach ( $this->_filters as $filter ) + { + $req .= pack ( "N", strlen($filter["attr"]) ) . $filter["attr"]; + $req .= pack ( "N", $filter["type"] ); + switch ( $filter["type"] ) + { + case SPH_FILTER_VALUES: + $req .= pack ( "N", count($filter["values"]) ); + foreach ( $filter["values"] as $value ) + $req .= sphPackI64 ( $value ); + break; + + case SPH_FILTER_RANGE: + $req .= sphPackI64 ( $filter["min"] ) . sphPackI64 ( $filter["max"] ); + break; + + case SPH_FILTER_FLOATRANGE: + $req .= $this->_PackFloat ( $filter["min"] ) . $this->_PackFloat ( $filter["max"] ); + break; + + default: + assert ( 0 && "internal error: unhandled filter type" ); + } + $req .= pack ( "N", $filter["exclude"] ); + } + + // group-by clause, max-matches count, group-sort clause, cutoff count + $req .= pack ( "NN", $this->_groupfunc, strlen($this->_groupby) ) . $this->_groupby; + $req .= pack ( "N", $this->_maxmatches ); + $req .= pack ( "N", strlen($this->_groupsort) ) . $this->_groupsort; + $req .= pack ( "NNN", $this->_cutoff, $this->_retrycount, $this->_retrydelay ); + $req .= pack ( "N", strlen($this->_groupdistinct) ) . $this->_groupdistinct; + + // anchor point + if ( empty($this->_anchor) ) + { + $req .= pack ( "N", 0 ); + } else + { + $a =& $this->_anchor; + $req .= pack ( "N", 1 ); + $req .= pack ( "N", strlen($a["attrlat"]) ) . $a["attrlat"]; + $req .= pack ( "N", strlen($a["attrlong"]) ) . $a["attrlong"]; + $req .= $this->_PackFloat ( $a["lat"] ) . $this->_PackFloat ( $a["long"] ); + } + + // per-index weights + $req .= pack ( "N", count($this->_indexweights) ); + foreach ( $this->_indexweights as $idx=>$weight ) + $req .= pack ( "N", strlen($idx) ) . $idx . pack ( "N", $weight ); + + // max query time + $req .= pack ( "N", $this->_maxquerytime ); + + // per-field weights + $req .= pack ( "N", count($this->_fieldweights) ); + foreach ( $this->_fieldweights as $field=>$weight ) + $req .= pack ( "N", strlen($field) ) . $field . pack ( "N", $weight ); + + // comment + $req .= pack ( "N", strlen($comment) ) . $comment; + + // attribute overrides + $req .= pack ( "N", count($this->_overrides) ); + foreach ( $this->_overrides as $key => $entry ) + { + $req .= pack ( "N", strlen($entry["attr"]) ) . $entry["attr"]; + $req .= pack ( "NN", $entry["type"], count($entry["values"]) ); + foreach ( $entry["values"] as $id=>$val ) + { + assert ( is_numeric($id) ); + assert ( is_numeric($val) ); + + $req .= sphPackU64 ( $id ); + switch ( $entry["type"] ) + { + case SPH_ATTR_FLOAT: $req .= $this->_PackFloat ( $val ); break; + case SPH_ATTR_BIGINT: $req .= sphPackI64 ( $val ); break; + default: $req .= pack ( "N", $val ); break; + } + } + } + + // select-list + $req .= pack ( "N", strlen($this->_select) ) . $this->_select; + + // mbstring workaround + $this->_MBPop (); + + // store request to requests array + $this->_reqs[] = $req; + return count($this->_reqs)-1; + } + + /// connect to searchd, run queries batch, and return an array of result sets + function RunQueries () + { + if ( empty($this->_reqs) ) + { + $this->_error = "no queries defined, issue AddQuery() first"; + return false; + } + + // mbstring workaround + $this->_MBPush (); + + if (!( $fp = $this->_Connect() )) + { + $this->_MBPop (); + return false; + } + + // send query, get response + $nreqs = count($this->_reqs); + $req = join ( "", $this->_reqs ); + $len = 8+strlen($req); + $req = pack ( "nnNNN", SEARCHD_COMMAND_SEARCH, VER_COMMAND_SEARCH, $len, 0, $nreqs ) . $req; // add header + + if ( !( $this->_Send ( $fp, $req, $len+8 ) ) || + !( $response = $this->_GetResponse ( $fp, VER_COMMAND_SEARCH ) ) ) + { + $this->_MBPop (); + return false; + } + + // query sent ok; we can reset reqs now + $this->_reqs = array (); + + // parse and return response + return $this->_ParseSearchResponse ( $response, $nreqs ); + } + + /// parse and return search query (or queries) response + function _ParseSearchResponse ( $response, $nreqs ) + { + $p = 0; // current position + $max = strlen($response); // max position for checks, to protect against broken responses + + $results = array (); + for ( $ires=0; $ires<$nreqs && $p<$max; $ires++ ) + { + $results[] = array(); + $result =& $results[$ires]; + + $result["error"] = ""; + $result["warning"] = ""; + + // extract status + list(,$status) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $result["status"] = $status; + if ( $status!=SEARCHD_OK ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $message = substr ( $response, $p, $len ); $p += $len; + + if ( $status==SEARCHD_WARNING ) + { + $result["warning"] = $message; + } else + { + $result["error"] = $message; + continue; + } + } + + // read schema + $fields = array (); + $attrs = array (); + + list(,$nfields) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + while ( $nfields-->0 && $p<$max ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $fields[] = substr ( $response, $p, $len ); $p += $len; + } + $result["fields"] = $fields; + + list(,$nattrs) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + while ( $nattrs-->0 && $p<$max ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $attr = substr ( $response, $p, $len ); $p += $len; + list(,$type) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $attrs[$attr] = $type; + } + $result["attrs"] = $attrs; + + // read match count + list(,$count) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + list(,$id64) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + + // read matches + $idx = -1; + while ( $count-->0 && $p<$max ) + { + // index into result array + $idx++; + + // parse document id and weight + if ( $id64 ) + { + $doc = sphUnpackU64 ( substr ( $response, $p, 8 ) ); $p += 8; + list(,$weight) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + } + else + { + list ( $doc, $weight ) = array_values ( unpack ( "N*N*", + substr ( $response, $p, 8 ) ) ); + $p += 8; + $doc = sphFixUint($doc); + } + $weight = sprintf ( "%u", $weight ); + + // create match entry + if ( $this->_arrayresult ) + $result["matches"][$idx] = array ( "id"=>$doc, "weight"=>$weight ); + else + $result["matches"][$doc]["weight"] = $weight; + + // parse and create attributes + $attrvals = array (); + foreach ( $attrs as $attr=>$type ) + { + // handle 64bit ints + if ( $type==SPH_ATTR_BIGINT ) + { + $attrvals[$attr] = sphUnpackI64 ( substr ( $response, $p, 8 ) ); $p += 8; + continue; + } + + // handle floats + if ( $type==SPH_ATTR_FLOAT ) + { + list(,$uval) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + list(,$fval) = unpack ( "f*", pack ( "L", $uval ) ); + $attrvals[$attr] = $fval; + continue; + } + + // handle everything else as unsigned ints + list(,$val) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + if ( $type==SPH_ATTR_MULTI ) + { + $attrvals[$attr] = array (); + $nvalues = $val; + while ( $nvalues-->0 && $p<$max ) + { + list(,$val) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $attrvals[$attr][] = sphFixUint($val); + } + } else if ( $type==SPH_ATTR_MULTI64 ) + { + $attrvals[$attr] = array (); + $nvalues = $val; + while ( $nvalues>0 && $p<$max ) + { + $attrvals[$attr][] = sphUnpackU64 ( substr ( $response, $p, 8 ) ); $p += 8; + $nvalues -= 2; + } + } else if ( $type==SPH_ATTR_STRING ) + { + $attrvals[$attr] = substr ( $response, $p, $val ); + $p += $val; + } else + { + $attrvals[$attr] = sphFixUint($val); + } + } + + if ( $this->_arrayresult ) + $result["matches"][$idx]["attrs"] = $attrvals; + else + $result["matches"][$doc]["attrs"] = $attrvals; + } + + list ( $total, $total_found, $msecs, $words ) = + array_values ( unpack ( "N*N*N*N*", substr ( $response, $p, 16 ) ) ); + $result["total"] = sprintf ( "%u", $total ); + $result["total_found"] = sprintf ( "%u", $total_found ); + $result["time"] = sprintf ( "%.3f", $msecs/1000 ); + $p += 16; + + while ( $words-->0 && $p<$max ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $word = substr ( $response, $p, $len ); $p += $len; + list ( $docs, $hits ) = array_values ( unpack ( "N*N*", substr ( $response, $p, 8 ) ) ); $p += 8; + $result["words"][$word] = array ( + "docs"=>sprintf ( "%u", $docs ), + "hits"=>sprintf ( "%u", $hits ) ); + } + } + + $this->_MBPop (); + return $results; + } + + ///////////////////////////////////////////////////////////////////////////// + // excerpts generation + ///////////////////////////////////////////////////////////////////////////// + + /// connect to searchd server, and generate exceprts (snippets) + /// of given documents for given query. returns false on failure, + /// an array of snippets on success + function BuildExcerpts ( $docs, $index, $words, $opts=array() ) + { + assert ( is_array($docs) ); + assert ( is_string($index) ); + assert ( is_string($words) ); + assert ( is_array($opts) ); + + $this->_MBPush (); + + if (!( $fp = $this->_Connect() )) + { + $this->_MBPop(); + return false; + } + + ///////////////// + // fixup options + ///////////////// + + if ( !isset($opts["before_match"]) ) $opts["before_match"] = ""; + if ( !isset($opts["after_match"]) ) $opts["after_match"] = ""; + if ( !isset($opts["chunk_separator"]) ) $opts["chunk_separator"] = " ... "; + if ( !isset($opts["limit"]) ) $opts["limit"] = 256; + if ( !isset($opts["limit_passages"]) ) $opts["limit_passages"] = 0; + if ( !isset($opts["limit_words"]) ) $opts["limit_words"] = 0; + if ( !isset($opts["around"]) ) $opts["around"] = 5; + if ( !isset($opts["exact_phrase"]) ) $opts["exact_phrase"] = false; + if ( !isset($opts["single_passage"]) ) $opts["single_passage"] = false; + if ( !isset($opts["use_boundaries"]) ) $opts["use_boundaries"] = false; + if ( !isset($opts["weight_order"]) ) $opts["weight_order"] = false; + if ( !isset($opts["query_mode"]) ) $opts["query_mode"] = false; + if ( !isset($opts["force_all_words"]) ) $opts["force_all_words"] = false; + if ( !isset($opts["start_passage_id"]) ) $opts["start_passage_id"] = 1; + if ( !isset($opts["load_files"]) ) $opts["load_files"] = false; + if ( !isset($opts["html_strip_mode"]) ) $opts["html_strip_mode"] = "index"; + if ( !isset($opts["allow_empty"]) ) $opts["allow_empty"] = false; + if ( !isset($opts["passage_boundary"]) ) $opts["passage_boundary"] = "none"; + if ( !isset($opts["emit_zones"]) ) $opts["emit_zones"] = false; + if ( !isset($opts["load_files_scattered"]) ) $opts["load_files_scattered"] = false; + + + ///////////////// + // build request + ///////////////// + + // v.1.2 req + $flags = 1; // remove spaces + if ( $opts["exact_phrase"] ) $flags |= 2; + if ( $opts["single_passage"] ) $flags |= 4; + if ( $opts["use_boundaries"] ) $flags |= 8; + if ( $opts["weight_order"] ) $flags |= 16; + if ( $opts["query_mode"] ) $flags |= 32; + if ( $opts["force_all_words"] ) $flags |= 64; + if ( $opts["load_files"] ) $flags |= 128; + if ( $opts["allow_empty"] ) $flags |= 256; + if ( $opts["emit_zones"] ) $flags |= 512; + if ( $opts["load_files_scattered"] ) $flags |= 1024; + $req = pack ( "NN", 0, $flags ); // mode=0, flags=$flags + $req .= pack ( "N", strlen($index) ) . $index; // req index + $req .= pack ( "N", strlen($words) ) . $words; // req words + + // options + $req .= pack ( "N", strlen($opts["before_match"]) ) . $opts["before_match"]; + $req .= pack ( "N", strlen($opts["after_match"]) ) . $opts["after_match"]; + $req .= pack ( "N", strlen($opts["chunk_separator"]) ) . $opts["chunk_separator"]; + $req .= pack ( "NN", (int)$opts["limit"], (int)$opts["around"] ); + $req .= pack ( "NNN", (int)$opts["limit_passages"], (int)$opts["limit_words"], (int)$opts["start_passage_id"] ); // v.1.2 + $req .= pack ( "N", strlen($opts["html_strip_mode"]) ) . $opts["html_strip_mode"]; + $req .= pack ( "N", strlen($opts["passage_boundary"]) ) . $opts["passage_boundary"]; + + // documents + $req .= pack ( "N", count($docs) ); + foreach ( $docs as $doc ) + { + assert ( is_string($doc) ); + $req .= pack ( "N", strlen($doc) ) . $doc; + } + + //////////////////////////// + // send query, get response + //////////////////////////// + + $len = strlen($req); + $req = pack ( "nnN", SEARCHD_COMMAND_EXCERPT, VER_COMMAND_EXCERPT, $len ) . $req; // add header + if ( !( $this->_Send ( $fp, $req, $len+8 ) ) || + !( $response = $this->_GetResponse ( $fp, VER_COMMAND_EXCERPT ) ) ) + { + $this->_MBPop (); + return false; + } + + ////////////////// + // parse response + ////////////////// + + $pos = 0; + $res = array (); + $rlen = strlen($response); + for ( $i=0; $i $rlen ) + { + $this->_error = "incomplete reply"; + $this->_MBPop (); + return false; + } + $res[] = $len ? substr ( $response, $pos, $len ) : ""; + $pos += $len; + } + + $this->_MBPop (); + return $res; + } + + + ///////////////////////////////////////////////////////////////////////////// + // keyword generation + ///////////////////////////////////////////////////////////////////////////// + + /// connect to searchd server, and generate keyword list for a given query + /// returns false on failure, + /// an array of words on success + function BuildKeywords ( $query, $index, $hits ) + { + assert ( is_string($query) ); + assert ( is_string($index) ); + assert ( is_bool($hits) ); + + $this->_MBPush (); + + if (!( $fp = $this->_Connect() )) + { + $this->_MBPop(); + return false; + } + + ///////////////// + // build request + ///////////////// + + // v.1.0 req + $req = pack ( "N", strlen($query) ) . $query; // req query + $req .= pack ( "N", strlen($index) ) . $index; // req index + $req .= pack ( "N", (int)$hits ); + + //////////////////////////// + // send query, get response + //////////////////////////// + + $len = strlen($req); + $req = pack ( "nnN", SEARCHD_COMMAND_KEYWORDS, VER_COMMAND_KEYWORDS, $len ) . $req; // add header + if ( !( $this->_Send ( $fp, $req, $len+8 ) ) || + !( $response = $this->_GetResponse ( $fp, VER_COMMAND_KEYWORDS ) ) ) + { + $this->_MBPop (); + return false; + } + + ////////////////// + // parse response + ////////////////// + + $pos = 0; + $res = array (); + $rlen = strlen($response); + list(,$nwords) = unpack ( "N*", substr ( $response, $pos, 4 ) ); + $pos += 4; + for ( $i=0; $i<$nwords; $i++ ) + { + list(,$len) = unpack ( "N*", substr ( $response, $pos, 4 ) ); $pos += 4; + $tokenized = $len ? substr ( $response, $pos, $len ) : ""; + $pos += $len; + + list(,$len) = unpack ( "N*", substr ( $response, $pos, 4 ) ); $pos += 4; + $normalized = $len ? substr ( $response, $pos, $len ) : ""; + $pos += $len; + + $res[] = array ( "tokenized"=>$tokenized, "normalized"=>$normalized ); + + if ( $hits ) + { + list($ndocs,$nhits) = array_values ( unpack ( "N*N*", substr ( $response, $pos, 8 ) ) ); + $pos += 8; + $res [$i]["docs"] = $ndocs; + $res [$i]["hits"] = $nhits; + } + + if ( $pos > $rlen ) + { + $this->_error = "incomplete reply"; + $this->_MBPop (); + return false; + } + } + + $this->_MBPop (); + return $res; + } + + function EscapeString ( $string ) + { + $from = array ( '\\', '(',')','|','-','!','@','~','"','&', '/', '^', '$', '=' ); + $to = array ( '\\\\', '\(','\)','\|','\-','\!','\@','\~','\"', '\&', '\/', '\^', '\$', '\=' ); + + return str_replace ( $from, $to, $string ); + } + + ///////////////////////////////////////////////////////////////////////////// + // attribute updates + ///////////////////////////////////////////////////////////////////////////// + + /// batch update given attributes in given rows in given indexes + /// returns amount of updated documents (0 or more) on success, or -1 on failure + function UpdateAttributes ( $index, $attrs, $values, $mva=false ) + { + // verify everything + assert ( is_string($index) ); + assert ( is_bool($mva) ); + + assert ( is_array($attrs) ); + foreach ( $attrs as $attr ) + assert ( is_string($attr) ); + + assert ( is_array($values) ); + foreach ( $values as $id=>$entry ) + { + assert ( is_numeric($id) ); + assert ( is_array($entry) ); + assert ( count($entry)==count($attrs) ); + foreach ( $entry as $v ) + { + if ( $mva ) + { + assert ( is_array($v) ); + foreach ( $v as $vv ) + assert ( is_int($vv) ); + } else + assert ( is_int($v) ); + } + } + + // build request + $this->_MBPush (); + $req = pack ( "N", strlen($index) ) . $index; + + $req .= pack ( "N", count($attrs) ); + foreach ( $attrs as $attr ) + { + $req .= pack ( "N", strlen($attr) ) . $attr; + $req .= pack ( "N", $mva ? 1 : 0 ); + } + + $req .= pack ( "N", count($values) ); + foreach ( $values as $id=>$entry ) + { + $req .= sphPackU64 ( $id ); + foreach ( $entry as $v ) + { + $req .= pack ( "N", $mva ? count($v) : $v ); + if ( $mva ) + foreach ( $v as $vv ) + $req .= pack ( "N", $vv ); + } + } + + // connect, send query, get response + if (!( $fp = $this->_Connect() )) + { + $this->_MBPop (); + return -1; + } + + $len = strlen($req); + $req = pack ( "nnN", SEARCHD_COMMAND_UPDATE, VER_COMMAND_UPDATE, $len ) . $req; // add header + if ( !$this->_Send ( $fp, $req, $len+8 ) ) + { + $this->_MBPop (); + return -1; + } + + if (!( $response = $this->_GetResponse ( $fp, VER_COMMAND_UPDATE ) )) + { + $this->_MBPop (); + return -1; + } + + // parse response + list(,$updated) = unpack ( "N*", substr ( $response, 0, 4 ) ); + $this->_MBPop (); + return $updated; + } + + ///////////////////////////////////////////////////////////////////////////// + // persistent connections + ///////////////////////////////////////////////////////////////////////////// + + function Open() + { + if ( $this->_socket !== false ) + { + $this->_error = 'already connected'; + return false; + } + if ( !$fp = $this->_Connect() ) + return false; + + // command, command version = 0, body length = 4, body = 1 + $req = pack ( "nnNN", SEARCHD_COMMAND_PERSIST, 0, 4, 1 ); + if ( !$this->_Send ( $fp, $req, 12 ) ) + return false; + + $this->_socket = $fp; + return true; + } + + function Close() + { + if ( $this->_socket === false ) + { + $this->_error = 'not connected'; + return false; + } + + fclose ( $this->_socket ); + $this->_socket = false; + + return true; + } + + ////////////////////////////////////////////////////////////////////////// + // status + ////////////////////////////////////////////////////////////////////////// + + function Status () + { + $this->_MBPush (); + if (!( $fp = $this->_Connect() )) + { + $this->_MBPop(); + return false; + } + + $req = pack ( "nnNN", SEARCHD_COMMAND_STATUS, VER_COMMAND_STATUS, 4, 1 ); // len=4, body=1 + if ( !( $this->_Send ( $fp, $req, 12 ) ) || + !( $response = $this->_GetResponse ( $fp, VER_COMMAND_STATUS ) ) ) + { + $this->_MBPop (); + return false; + } + + $res = substr ( $response, 4 ); // just ignore length, error handling, etc + $p = 0; + list ( $rows, $cols ) = array_values ( unpack ( "N*N*", substr ( $response, $p, 8 ) ) ); $p += 8; + + $res = array(); + for ( $i=0; $i<$rows; $i++ ) + for ( $j=0; $j<$cols; $j++ ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $res[$i][] = substr ( $response, $p, $len ); $p += $len; + } + + $this->_MBPop (); + return $res; + } + + ////////////////////////////////////////////////////////////////////////// + // flush + ////////////////////////////////////////////////////////////////////////// + + function FlushAttributes () + { + $this->_MBPush (); + if (!( $fp = $this->_Connect() )) + { + $this->_MBPop(); + return -1; + } + + $req = pack ( "nnN", SEARCHD_COMMAND_FLUSHATTRS, VER_COMMAND_FLUSHATTRS, 0 ); // len=0 + if ( !( $this->_Send ( $fp, $req, 8 ) ) || + !( $response = $this->_GetResponse ( $fp, VER_COMMAND_FLUSHATTRS ) ) ) + { + $this->_MBPop (); + return -1; + } + + $tag = -1; + if ( strlen($response)==4 ) + list(,$tag) = unpack ( "N*", $response ); + else + $this->_error = "unexpected response length"; + + $this->_MBPop (); + return $tag; + } +} + +// +// $Id: sphinxapi.php 3087 2012-01-30 23:07:35Z shodan $ +// diff --git a/sources/phpBB/includes/startup.php b/sources/phpBB/includes/startup.php new file mode 100644 index 0000000..2885c80 --- /dev/null +++ b/sources/phpBB/includes/startup.php @@ -0,0 +1,172 @@ + +* @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; +} + +// 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); + +/* +* Remove variables created by register_globals from the global scope +* Thanks to Matt Kavanagh +*/ +function deregister_globals() +{ + $not_unset = array( + 'GLOBALS' => true, + '_GET' => true, + '_POST' => true, + '_COOKIE' => true, + '_REQUEST' => true, + '_SERVER' => true, + '_SESSION' => true, + '_ENV' => true, + '_FILES' => true, + 'phpEx' => true, + 'phpbb_root_path' => true + ); + + // Not only will array_merge and array_keys give a warning if + // a parameter is not an array, array_merge will actually fail. + // So we check if _SESSION has been initialised. + if (!isset($_SESSION) || !is_array($_SESSION)) + { + $_SESSION = array(); + } + + // Merge all into one extremely huge array; unset this later + $input = array_merge( + array_keys($_GET), + array_keys($_POST), + array_keys($_COOKIE), + array_keys($_SERVER), + array_keys($_SESSION), + array_keys($_ENV), + array_keys($_FILES) + ); + + foreach ($input as $varname) + { + if (isset($not_unset[$varname])) + { + // Hacking attempt. No point in continuing. + if (isset($_COOKIE[$varname])) + { + echo "Clear your cookies. "; + } + echo "Malicious variable name detected. Contact the administrator and ask them to disable register_globals."; + exit; + } + + unset($GLOBALS[$varname]); + } + + unset($input); +} + +// Register globals and magic quotes have been dropped in PHP 5.4 +if (version_compare(PHP_VERSION, '5.4.0-dev', '>=')) +{ + /** + * @ignore + */ + define('STRIP', false); +} +else +{ + @set_magic_quotes_runtime(0); + + // Be paranoid with passed vars + if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on' || !function_exists('ini_get')) + { + deregister_globals(); + } + + 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. + + // 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 @. + + // 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: +// 1. If dependencies are installed with Composer, Composer will create a +// vendor/autoload.php. If this file exists it will be +// automatically used by phpBB. This is the default mode that phpBB +// will use when shipped. +// 2. To disable composer autoloading, PHPBB_NO_COMPOSER_AUTOLOAD can be specified. +// Additionally specify PHPBB_AUTOLOAD=/path/to/autoload.php in the +// environment. This is useful for running CLI scripts and tests. +// /path/to/autoload.php should define and register class loaders +// for all of phpBB's dependencies. +// 3. You can also set PHPBB_NO_COMPOSER_AUTOLOAD without setting PHPBB_AUTOLOAD. +// In this case autoloading needs to be defined before running any phpBB +// script. This might be useful in cases when phpBB is integrated into a +// larger program. +if (getenv('PHPBB_NO_COMPOSER_AUTOLOAD')) +{ + if (getenv('PHPBB_AUTOLOAD')) + { + require(getenv('PHPBB_AUTOLOAD')); + } +} +else +{ + if (!file_exists($phpbb_root_path . 'vendor/autoload.php')) + { + trigger_error( + 'Composer dependencies have not been set up yet, run ' . + "'php ../composer.phar install' from the phpBB directory to do so.", + E_USER_ERROR + ); + } + require($phpbb_root_path . 'vendor/autoload.php'); +} + +$starttime = explode(' ', microtime()); +$starttime = $starttime[1] + $starttime[0]; diff --git a/sources/phpBB/includes/ucp/info/ucp_attachments.php b/sources/phpBB/includes/ucp/info/ucp_attachments.php new file mode 100644 index 0000000..2e20106 --- /dev/null +++ b/sources/phpBB/includes/ucp/info/ucp_attachments.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class ucp_attachments_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/ucp/info/ucp_auth_link.php b/sources/phpBB/includes/ucp/info/ucp_auth_link.php new file mode 100644 index 0000000..9ec4cb7 --- /dev/null +++ b/sources/phpBB/includes/ucp/info/ucp_auth_link.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class ucp_auth_link_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/ucp/info/ucp_groups.php b/sources/phpBB/includes/ucp/info/ucp_groups.php new file mode 100644 index 0000000..6da2a4f --- /dev/null +++ b/sources/phpBB/includes/ucp/info/ucp_groups.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class ucp_groups_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/ucp/info/ucp_main.php b/sources/phpBB/includes/ucp/info/ucp_main.php new file mode 100644 index 0000000..de8e7d5 --- /dev/null +++ b/sources/phpBB/includes/ucp/info/ucp_main.php @@ -0,0 +1,38 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class ucp_main_info +{ + function module() + { + 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')), + 'bookmarks' => array('title' => 'UCP_MAIN_BOOKMARKS', 'auth' => 'cfg_allow_bookmarks', 'cat' => array('UCP_MAIN')), + 'drafts' => array('title' => 'UCP_MAIN_DRAFTS', 'auth' => '', 'cat' => array('UCP_MAIN')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/ucp/info/ucp_notifications.php b/sources/phpBB/includes/ucp/info/ucp_notifications.php new file mode 100644 index 0000000..0cc011d --- /dev/null +++ b/sources/phpBB/includes/ucp/info/ucp_notifications.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class ucp_notifications_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/ucp/info/ucp_pm.php b/sources/phpBB/includes/ucp/info/ucp_pm.php new file mode 100644 index 0000000..6aa1669 --- /dev/null +++ b/sources/phpBB/includes/ucp/info/ucp_pm.php @@ -0,0 +1,38 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class ucp_pm_info +{ + function module() + { + 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')), + 'drafts' => array('title' => 'UCP_PM_DRAFTS', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')), + 'options' => array('title' => 'UCP_PM_OPTIONS', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/ucp/info/ucp_prefs.php b/sources/phpBB/includes/ucp/info/ucp_prefs.php new file mode 100644 index 0000000..5c2d29a --- /dev/null +++ b/sources/phpBB/includes/ucp/info/ucp_prefs.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class ucp_prefs_info +{ + function module() + { + 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')), + 'view' => array('title' => 'UCP_PREFS_VIEW', 'auth' => '', 'cat' => array('UCP_PREFS')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/ucp/info/ucp_profile.php b/sources/phpBB/includes/ucp/info/ucp_profile.php new file mode 100644 index 0000000..919de99 --- /dev/null +++ b/sources/phpBB/includes/ucp/info/ucp_profile.php @@ -0,0 +1,39 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class ucp_profile_info +{ + function module() + { + 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')), + 'avatar' => array('title' => 'UCP_PROFILE_AVATAR', 'auth' => 'cfg_allow_avatar', 'cat' => array('UCP_PROFILE')), + 'reg_details' => array('title' => 'UCP_PROFILE_REG_DETAILS', 'auth' => '', 'cat' => array('UCP_PROFILE')), + 'autologin_keys'=> array('title' => 'UCP_PROFILE_AUTOLOGIN_KEYS', 'auth' => '', 'cat' => array('UCP_PROFILE')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/ucp/info/ucp_zebra.php b/sources/phpBB/includes/ucp/info/ucp_zebra.php new file mode 100644 index 0000000..99d4a4f --- /dev/null +++ b/sources/phpBB/includes/ucp/info/ucp_zebra.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class ucp_zebra_info +{ + function module() + { + 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')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/sources/phpBB/includes/ucp/ucp_activate.php b/sources/phpBB/includes/ucp/ucp_activate.php new file mode 100644 index 0000000..6e357b2 --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_activate.php @@ -0,0 +1,149 @@ + +* @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; +} + +/** +* ucp_activate +* User activation +*/ +class ucp_activate +{ + var $u_action; + + function main($id, $mode) + { + global $config, $phpbb_root_path, $phpEx; + global $db, $user, $auth, $template, $phpbb_container; + + $user_id = request_var('u', 0); + $key = request_var('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 . " + WHERE user_id = $user_id"; + $result = $db->sql_query($sql); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$user_row) + { + trigger_error('NO_USER'); + } + + if ($user_row['user_type'] <> USER_INACTIVE && !$user_row['user_newpasswd']) + { + meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); + trigger_error('ALREADY_ACTIVATED'); + } + + if ($user_row['user_inactive_reason'] == INACTIVE_MANUAL || $user_row['user_actkey'] !== $key) + { + trigger_error('WRONG_ACTIVATION'); + } + + // Do not allow activating by non administrators when admin activation is on + // Only activation type the user should be able to do is INACTIVE_REMIND + // or activate a new password which is not an activation state :@ + if (!$user_row['user_newpasswd'] && $user_row['user_inactive_reason'] != INACTIVE_REMIND && $config['require_activation'] == USER_ACTIVATION_ADMIN && !$auth->acl_get('a_user')) + { + if (!$user->data['is_registered']) + { + login_box('', $user->lang['NO_AUTH_OPERATION']); + } + trigger_error('NO_AUTH_OPERATION'); + } + + $update_password = ($user_row['user_newpasswd']) ? true : false; + + if ($update_password) + { + $sql_ary = array( + 'user_actkey' => '', + 'user_password' => $user_row['user_newpasswd'], + 'user_newpasswd' => '', + 'user_login_attempts' => 0, + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + 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']); + } + + if (!$update_password) + { + include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + user_active_flip('activate', $user_row['user_id']); + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_actkey = '' + WHERE user_id = {$user_row['user_id']}"; + $db->sql_query($sql); + + // Create the correct logs + add_log('user', $user_row['user_id'], 'LOG_USER_ACTIVE_USER'); + if ($auth->acl_get('a_user')) + { + add_log('admin', 'LOG_USER_ACTIVE', $user_row['username']); + } + } + + if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password) + { + $phpbb_notifications = $phpbb_container->get('notification_manager'); + $phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_row['user_id']); + + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $messenger = new messenger(false); + + $messenger->template('admin_welcome_activated', $user_row['user_lang']); + + $messenger->set_addresses($user_row); + + $messenger->anti_abuse_headers($config, $user); + + $messenger->assign_vars(array( + 'USERNAME' => htmlspecialchars_decode($user_row['username'])) + ); + + $messenger->send($user_row['user_notify_type']); + + $message = 'ACCOUNT_ACTIVE_ADMIN'; + } + else + { + if (!$update_password) + { + $message = ($user_row['user_inactive_reason'] == INACTIVE_PROFILE) ? 'ACCOUNT_ACTIVE_PROFILE' : 'ACCOUNT_ACTIVE'; + } + else + { + $message = 'PASSWORD_ACTIVATED'; + } + } + + meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); + trigger_error($user->lang[$message]); + } +} diff --git a/sources/phpBB/includes/ucp/ucp_attachments.php b/sources/phpBB/includes/ucp/ucp_attachments.php new file mode 100644 index 0000000..4272420 --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_attachments.php @@ -0,0 +1,207 @@ + +* @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; +} + +/** +* ucp_attachments +* User attachments +*/ +class ucp_attachments +{ + var $u_action; + + function main($id, $mode) + { + global $template, $user, $db, $config, $phpEx, $phpbb_root_path, $phpbb_container; + + $start = request_var('start', 0); + $sort_key = request_var('sk', 'a'); + $sort_dir = request_var('sd', 'a'); + + $delete = (isset($_POST['delete'])) ? true : false; + $confirm = (isset($_POST['confirm'])) ? true : false; + $delete_ids = array_keys(request_var('attachment', array(0))); + + if ($delete && sizeof($delete_ids)) + { + // Validate $delete_ids... + $sql = 'SELECT attach_id + FROM ' . ATTACHMENTS_TABLE . ' + WHERE poster_id = ' . $user->data['user_id'] . ' + AND is_orphan = 0 + AND ' . $db->sql_in_set('attach_id', $delete_ids); + $result = $db->sql_query($sql); + + $delete_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $delete_ids[] = $row['attach_id']; + } + $db->sql_freeresult($result); + } + + if ($delete && sizeof($delete_ids)) + { + $s_hidden_fields = array( + 'delete' => 1 + ); + + foreach ($delete_ids as $attachment_id) + { + $s_hidden_fields['attachment'][$attachment_id] = 1; + } + + if (confirm_box(true)) + { + if (!function_exists('delete_attachments')) + { + include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } + + delete_attachments('attach', $delete_ids); + + meta_refresh(3, $this->u_action); + $message = ((sizeof($delete_ids) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED']) . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + trigger_error($message); + } + else + { + confirm_box(false, (sizeof($delete_ids) == 1) ? 'DELETE_ATTACHMENT' : 'DELETE_ATTACHMENTS', build_hidden_fields($s_hidden_fields)); + } + } + + // Select box eventually + $sort_key_text = array('a' => $user->lang['SORT_FILENAME'], 'b' => $user->lang['SORT_COMMENT'], 'c' => $user->lang['SORT_EXTENSION'], 'd' => $user->lang['SORT_SIZE'], 'e' => $user->lang['SORT_DOWNLOADS'], 'f' => $user->lang['SORT_POST_TIME'], 'g' => $user->lang['SORT_TOPIC_TITLE']); + $sort_key_sql = array('a' => 'a.real_filename', 'b' => 'a.attach_comment', 'c' => 'a.extension', 'd' => 'a.filesize', 'e' => 'a.download_count', 'f' => 'a.filetime', 'g' => 't.topic_title'); + + $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); + + $s_sort_key = ''; + foreach ($sort_key_text as $key => $value) + { + $selected = ($sort_key == $key) ? ' selected="selected"' : ''; + $s_sort_key .= ''; + } + + $s_sort_dir = ''; + foreach ($sort_dir_text as $key => $value) + { + $selected = ($sort_dir == $key) ? ' selected="selected"' : ''; + $s_sort_dir .= ''; + } + + if (!isset($sort_key_sql[$sort_key])) + { + $sort_key = 'a'; + } + + $order_by = $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); + + $sql = 'SELECT COUNT(attach_id) as num_attachments + FROM ' . ATTACHMENTS_TABLE . ' + WHERE poster_id = ' . $user->data['user_id'] . ' + AND is_orphan = 0'; + $result = $db->sql_query($sql); + $num_attachments = $db->sql_fetchfield('num_attachments'); + $db->sql_freeresult($result); + + // Ensure start is a valid value + $pagination = $phpbb_container->get('pagination'); + $start = $pagination->validate_start($start, $config['topics_per_page'], $num_attachments); + + $sql = 'SELECT a.*, t.topic_title, p.message_subject as message_title + FROM ' . ATTACHMENTS_TABLE . ' a + LEFT JOIN ' . TOPICS_TABLE . ' t ON (a.topic_id = t.topic_id AND a.in_message = 0) + LEFT JOIN ' . PRIVMSGS_TABLE . ' p ON (a.post_msg_id = p.msg_id AND a.in_message = 1) + WHERE a.poster_id = ' . $user->data['user_id'] . " + AND a.is_orphan = 0 + ORDER BY $order_by"; + $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); + + $row_count = 0; + if ($row = $db->sql_fetchrow($result)) + { + $template->assign_var('S_ATTACHMENT_ROWS', true); + + do + { + if ($row['in_message']) + { + $view_topic = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&p={$row['post_msg_id']}"); + } + else + { + $view_topic = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&p={$row['post_msg_id']}") . "#p{$row['post_msg_id']}"; + } + + $template->assign_block_vars('attachrow', array( + 'ROW_NUMBER' => $row_count + ($start + 1), + 'FILENAME' => $row['real_filename'], + 'COMMENT' => bbcode_nl2br($row['attach_comment']), + 'EXTENSION' => $row['extension'], + 'SIZE' => get_formatted_filesize($row['filesize']), + 'DOWNLOAD_COUNT' => $row['download_count'], + 'POST_TIME' => $user->format_date($row['filetime']), + 'TOPIC_TITLE' => ($row['in_message']) ? $row['message_title'] : $row['topic_title'], + + 'ATTACH_ID' => $row['attach_id'], + 'POST_ID' => $row['post_msg_id'], + 'TOPIC_ID' => $row['topic_id'], + + 'S_IN_MESSAGE' => $row['in_message'], + + 'U_VIEW_ATTACHMENT' => append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $row['attach_id']), + 'U_VIEW_TOPIC' => $view_topic) + ); + + $row_count++; + } + while ($row = $db->sql_fetchrow($result)); + } + $db->sql_freeresult($result); + + $base_url = $this->u_action . "&sk=$sort_key&sd=$sort_dir"; + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $num_attachments, $config['topics_per_page'], $start); + + $template->assign_vars(array( + 'TOTAL_ATTACHMENTS' => $num_attachments, + 'NUM_ATTACHMENTS' => $user->lang('NUM_ATTACHMENTS', $num_attachments), + + 'L_TITLE' => $user->lang['UCP_ATTACHMENTS'], + + 'U_SORT_FILENAME' => $this->u_action . "&sk=a&sd=" . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_FILE_COMMENT' => $this->u_action . "&sk=b&sd=" . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_EXTENSION' => $this->u_action . "&sk=c&sd=" . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_FILESIZE' => $this->u_action . "&sk=d&sd=" . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_DOWNLOADS' => $this->u_action . "&sk=e&sd=" . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_POST_TIME' => $this->u_action . "&sk=f&sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_TOPIC_TITLE' => $this->u_action . "&sk=g&sd=" . (($sort_key == 'g' && $sort_dir == 'a') ? 'd' : 'a'), + + 'S_DISPLAY_MARK_ALL' => ($num_attachments) ? true : false, + 'S_DISPLAY_PAGINATION' => ($num_attachments) ? true : false, + 'S_UCP_ACTION' => $this->u_action, + 'S_SORT_OPTIONS' => $s_sort_key, + 'S_ORDER_SELECT' => $s_sort_dir) + ); + + $this->tpl_name = 'ucp_attachments'; + $this->page_title = 'UCP_ATTACHMENTS'; + } +} diff --git a/sources/phpBB/includes/ucp/ucp_auth_link.php b/sources/phpBB/includes/ucp/ucp_auth_link.php new file mode 100644 index 0000000..748f0fd --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_auth_link.php @@ -0,0 +1,147 @@ + +* @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; +} + +class ucp_auth_link +{ + /** + * @var string + */ + public $u_action; + + /** + * Generates the ucp_auth_link page and handles the auth link process + * + * @param int $id + * @param string $mode + */ + public function main($id, $mode) + { + global $request, $template, $phpbb_container, $user; + + $error = array(); + + $provider_collection = $phpbb_container->get('auth.provider_collection'); + $auth_provider = $provider_collection->get_provider(); + + // confirm that the auth provider supports this page + $provider_data = $auth_provider->get_auth_link_data(); + if ($provider_data === null) + { + $error[] = 'UCP_AUTH_LINK_NOT_SUPPORTED'; + } + + $s_hidden_fields = array(); + add_form_key('ucp_auth_link'); + + $submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST); + + // This path is only for primary actions + if (!sizeof($error) && $submit) + { + if (!check_form_key('ucp_auth_link')) + { + $error[] = 'FORM_INVALID'; + } + + if (!sizeof($error)) + { + // Any post data could be necessary for auth (un)linking + $link_data = $request->get_super_global(\phpbb\request\request_interface::POST); + + // The current user_id is also necessary + $link_data['user_id'] = $user->data['user_id']; + + // Tell the provider that the method is auth_link not login_link + $link_data['link_method'] = 'auth_link'; + + if ($request->variable('link', 0, false, \phpbb\request\request_interface::POST)) + { + $error[] = $auth_provider->link_account($link_data); + } + else + { + $error[] = $auth_provider->unlink_account($link_data); + } + + // Template data may have changed, get new data + $provider_data = $auth_provider->get_auth_link_data(); + } + } + + // In some cases, a request to an external server may be required. In + // these cases, the GET parameter 'link' should exist and should be true + if ($request->variable('link', false)) + { + // In this case the link data should only be populated with the + // link_method as the provider dictates how data is returned to it. + $link_data = array('link_method' => 'auth_link'); + + $error[] = $auth_provider->link_account($link_data); + + // Template data may have changed, get new data + $provider_data = $auth_provider->get_auth_link_data(); + } + + if (isset($provider_data['VARS'])) + { + // Handle hidden fields separately + if (isset($provider_data['VARS']['HIDDEN_FIELDS'])) + { + $s_hidden_fields = array_merge($s_hidden_fields, $provider_data['VARS']['HIDDEN_FIELDS']); + unset($provider_data['VARS']['HIDDEN_FIELDS']); + } + + $template->assign_vars($provider_data['VARS']); + } + + if (isset($provider_data['BLOCK_VAR_NAME'])) + { + foreach ($provider_data['BLOCK_VARS'] as $block_vars) + { + // See if there are additional hidden fields. This should be an associative array + if (isset($block_vars['HIDDEN_FIELDS'])) + { + $block_vars['HIDDEN_FIELDS'] = build_hidden_fields($block_vars['HIDDEN_FIELDS']); + } + + $template->assign_block_vars($provider_data['BLOCK_VAR_NAME'], $block_vars); + } + } + + $s_hidden_fields = build_hidden_fields($s_hidden_fields); + + // Replace "error" strings with their real, localised form + $error = array_map(array($user, 'lang'), $error); + $error = implode('
', $error); + + $template->assign_vars(array( + 'ERROR' => $error, + + 'PROVIDER_TEMPLATE_FILE' => $provider_data['TEMPLATE_FILE'], + + 'S_HIDDEN_FIELDS' => $s_hidden_fields, + 'S_UCP_ACTION' => $this->u_action, + )); + + $this->tpl_name = 'ucp_auth_link'; + $this->page_title = 'UCP_AUTH_LINK'; + } +} diff --git a/sources/phpBB/includes/ucp/ucp_confirm.php b/sources/phpBB/includes/ucp/ucp_confirm.php new file mode 100644 index 0000000..7392f8d --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_confirm.php @@ -0,0 +1,48 @@ + +* @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; +} + +/** +* ucp_confirm +* Visual confirmation +* +* Note to potential users of this code ... +* +* Remember this is released under the _GPL_ and is subject +* to that licence. Do not incorporate this within software +* released or distributed in any way under a licence other +* than the GPL. We will be watching ... ;) +*/ +class ucp_confirm +{ + var $u_action; + + function main($id, $mode) + { + global $db, $user, $phpbb_root_path, $config, $phpEx, $phpbb_container; + + $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']); + $captcha->init(request_var('type', 0)); + $captcha->execute(); + + garbage_collection(); + exit_handler(); + } +} diff --git a/sources/phpBB/includes/ucp/ucp_groups.php b/sources/phpBB/includes/ucp/ucp_groups.php new file mode 100644 index 0000000..b960694 --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_groups.php @@ -0,0 +1,1097 @@ + +* @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; +} + +/** +* ucp_groups +*/ +class ucp_groups +{ + var $u_action; + + function main($id, $mode) + { + global $config, $phpbb_root_path, $phpEx, $phpbb_admin_path; + global $db, $user, $auth, $cache, $template; + global $request, $phpbb_container; + + $user->add_lang('groups'); + + $return_page = '

' . sprintf($user->lang['RETURN_PAGE'], '', ''); + + $mark_ary = request_var('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(); + + switch ($mode) + { + case 'membership': + + $this->page_title = 'UCP_USERGROUPS_MEMBER'; + + 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); + + if (!$group_id) + { + trigger_error('NO_GROUP_SELECTED'); + } + + $sql = 'SELECT group_id, group_name, group_type + FROM ' . GROUPS_TABLE . " + WHERE group_id IN ($group_id, {$user->data['group_id']})"; + $result = $db->sql_query($sql); + + $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']; + $group_row[$row['group_id']] = $row; + } + $db->sql_freeresult($result); + + if (!sizeof($group_row)) + { + trigger_error('GROUP_NOT_EXIST'); + } + + switch ($action) + { + case 'change_default': + // User already having this group set as default? + if ($group_id == $user->data['group_id']) + { + trigger_error($user->lang['ALREADY_DEFAULT_GROUP'] . $return_page); + } + + if (!$auth->acl_get('u_chggrp')) + { + trigger_error($user->lang['NOT_AUTHORISED'] . $return_page); + } + + // User needs to be member of the group in order to make it default + if (!group_memberships($group_id, $user->data['user_id'], true)) + { + trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page); + } + + if (confirm_box(true)) + { + 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'])); + + meta_refresh(3, $this->u_action); + trigger_error($user->lang['CHANGED_DEFAULT_GROUP'] . $return_page); + } + else + { + $s_hidden_fields = array( + 'default' => $group_id, + 'change_default'=> true + ); + + confirm_box(false, sprintf($user->lang['GROUP_CHANGE_DEFAULT'], $group_row[$group_id]['group_name']), build_hidden_fields($s_hidden_fields)); + } + + break; + + case 'resign': + + // User tries to resign from default group but is not allowed to change it? + if ($group_id == $user->data['group_id'] && !$auth->acl_get('u_chggrp')) + { + trigger_error($user->lang['NOT_RESIGN_FROM_DEFAULT_GROUP'] . $return_page); + } + + if (!($row = group_memberships($group_id, $user->data['user_id']))) + { + trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page); + } + list(, $row) = each($row); + + $sql = 'SELECT group_type + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . $group_id; + $result = $db->sql_query($sql); + $group_type = (int) $db->sql_fetchfield('group_type'); + $db->sql_freeresult($result); + + if ($group_type != GROUP_OPEN && $group_type != GROUP_FREE) + { + trigger_error($user->lang['CANNOT_RESIGN_GROUP'] . $return_page); + } + + if (confirm_box(true)) + { + 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']); + + meta_refresh(3, $this->u_action); + trigger_error($user->lang[($row['user_pending']) ? 'GROUP_RESIGNED_PENDING' : 'GROUP_RESIGNED_MEMBERSHIP'] . $return_page); + } + else + { + $s_hidden_fields = array( + 'selected' => $group_id, + 'action' => 'resign', + 'submit' => true + ); + + confirm_box(false, ($row['user_pending']) ? 'GROUP_RESIGN_PENDING' : 'GROUP_RESIGN_MEMBERSHIP', build_hidden_fields($s_hidden_fields)); + } + + break; + + case 'join': + + $sql = 'SELECT ug.*, u.username, u.username_clean, u.user_email + FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u + WHERE ug.user_id = u.user_id + AND ug.group_id = ' . $group_id . ' + AND ug.user_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + if ($row['user_pending']) + { + trigger_error($user->lang['ALREADY_IN_GROUP_PENDING'] . $return_page); + } + + trigger_error($user->lang['ALREADY_IN_GROUP'] . $return_page); + } + + // Check permission to join (open group or request) + if ($group_row[$group_id]['group_type'] != GROUP_OPEN && $group_row[$group_id]['group_type'] != GROUP_FREE) + { + trigger_error($user->lang['CANNOT_JOIN_GROUP'] . $return_page); + } + + if (confirm_box(true)) + { + if ($group_row[$group_id]['group_type'] == GROUP_FREE) + { + group_user_add($group_id, $user->data['user_id']); + } + else + { + 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']); + + 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); + } + else + { + $s_hidden_fields = array( + 'selected' => $group_id, + 'action' => 'join', + 'submit' => true + ); + + confirm_box(false, ($group_row[$group_id]['group_type'] == GROUP_FREE) ? 'GROUP_JOIN' : 'GROUP_JOIN_PENDING', build_hidden_fields($s_hidden_fields)); + } + + break; + + case 'demote': + + if (!($row = group_memberships($group_id, $user->data['user_id']))) + { + trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page); + } + list(, $row) = each($row); + + if (!$row['group_leader']) + { + trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page); + } + + if (confirm_box(true)) + { + 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']); + + meta_refresh(3, $this->u_action); + trigger_error($user->lang['USER_GROUP_DEMOTED'] . $return_page); + } + else + { + $s_hidden_fields = array( + 'selected' => $group_id, + 'action' => 'demote', + 'submit' => true + ); + + confirm_box(false, 'USER_GROUP_DEMOTE', build_hidden_fields($s_hidden_fields)); + } + + break; + } + } + + $sql = 'SELECT g.*, ug.group_leader, ug.user_pending + FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug + WHERE ug.user_id = ' . $user->data['user_id'] . ' + AND g.group_id = ug.group_id + ORDER BY g.group_type DESC, g.group_name'; + $result = $db->sql_query($sql); + + $group_id_ary = array(); + $leader_count = $member_count = $pending_count = 0; + while ($row = $db->sql_fetchrow($result)) + { + $block = ($row['group_leader']) ? 'leader' : (($row['user_pending']) ? 'pending' : 'member'); + + switch ($row['group_type']) + { + case GROUP_OPEN: + $group_status = 'OPEN'; + break; + + case GROUP_CLOSED: + $group_status = 'CLOSED'; + break; + + case GROUP_HIDDEN: + $group_status = 'HIDDEN'; + break; + + case GROUP_SPECIAL: + $group_status = 'SPECIAL'; + break; + + case GROUP_FREE: + $group_status = 'FREE'; + break; + } + + $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_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], + 'GROUP_COLOUR' => $row['group_colour'], + + 'U_VIEW_GROUP' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']), + + 'S_GROUP_DEFAULT' => ($row['group_id'] == $user->data['group_id']) ? true : false, + 'S_ROW_COUNT' => ${$block . '_count'}++) + ); + + $group_id_ary[] = (int) $row['group_id']; + } + $db->sql_freeresult($result); + + // Hide hidden groups unless user is an admin with group privileges + $sql_and = ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? '<> ' . GROUP_SPECIAL : 'NOT IN (' . GROUP_SPECIAL . ', ' . GROUP_HIDDEN . ')'; + + $sql = 'SELECT group_id, group_name, group_colour, group_desc, group_desc_uid, group_desc_bitfield, group_desc_options, group_type, group_founder_manage + FROM ' . GROUPS_TABLE . ' + WHERE ' . ((sizeof($group_id_ary)) ? $db->sql_in_set('group_id', $group_id_ary, true) . ' AND ' : '') . " + group_type $sql_and + ORDER BY group_type DESC, group_name"; + $result = $db->sql_query($sql); + + $nonmember_count = 0; + while ($row = $db->sql_fetchrow($result)) + { + switch ($row['group_type']) + { + case GROUP_OPEN: + $group_status = 'OPEN'; + break; + + case GROUP_CLOSED: + $group_status = 'CLOSED'; + break; + + case GROUP_HIDDEN: + $group_status = 'HIDDEN'; + break; + + case GROUP_SPECIAL: + $group_status = 'SPECIAL'; + break; + + case GROUP_FREE: + $group_status = 'FREE'; + break; + } + + $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_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, + 'GROUP_STATUS' => $user->lang['GROUP_IS_' . $group_status], + 'S_CAN_JOIN' => ($row['group_type'] == GROUP_OPEN || $row['group_type'] == GROUP_FREE) ? true : false, + 'GROUP_COLOUR' => $row['group_colour'], + + 'U_VIEW_GROUP' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']), + + 'S_ROW_COUNT' => $nonmember_count++) + ); + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'S_CHANGE_DEFAULT' => ($auth->acl_get('u_chggrp')) ? true : false, + 'S_LEADER_COUNT' => $leader_count, + 'S_MEMBER_COUNT' => $member_count, + 'S_PENDING_COUNT' => $pending_count, + 'S_NONMEMBER_COUNT' => $nonmember_count, + + 'S_UCP_ACTION' => $this->u_action) + ); + + break; + + case 'manage': + + $this->page_title = 'UCP_USERGROUPS_MANAGE'; + $action = (isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''); + $group_id = request_var('g', 0); + + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + + add_form_key('ucp_groups'); + + if ($group_id) + { + $sql = 'SELECT g.*, t.teampage_position AS group_teampage + FROM ' . GROUPS_TABLE . ' g + LEFT JOIN ' . TEAMPAGE_TABLE . ' t + ON (t.group_id = g.group_id) + WHERE g.group_id = ' . $group_id; + $result = $db->sql_query($sql); + $group_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$group_row) + { + trigger_error($user->lang['NO_GROUP'] . $return_page); + } + + // Check if the user is allowed to manage this group if set to founder only. + if ($user->data['user_type'] != USER_FOUNDER && $group_row['group_founder_manage']) + { + trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . $return_page, E_USER_WARNING); + } + + $group_name = $group_row['group_name']; + $group_type = $group_row['group_type']; + + $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_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']), + 'GROUP_TYPE' => $group_row['group_type'], + + 'AVATAR' => (empty($avatar) ? '' : $avatar), + 'AVATAR_IMAGE' => (empty($avatar) ? '' : $avatar), + 'AVATAR_WIDTH' => (isset($group_row['group_avatar_width'])) ? $group_row['group_avatar_width'] : '', + 'AVATAR_HEIGHT' => (isset($group_row['group_avatar_height'])) ? $group_row['group_avatar_height'] : '', + )); + } + + switch ($action) + { + case 'edit': + + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . $return_page); + } + + if (!($row = group_memberships($group_id, $user->data['user_id']))) + { + trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page); + } + list(, $row) = each($row); + + if (!$row['group_leader']) + { + trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page); + } + + $file_uploads = (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on') ? true : false; + $user->add_lang(array('acp/groups', 'acp/common')); + + $data = $submit_ary = array(); + + $update = (isset($_POST['update'])) ? true : false; + + $error = array(); + + // Setup avatar data for later + $avatars_enabled = false; + $avatar_drivers = null; + $avatar_data = null; + $avatar_error = array(); + + if ($config['allow_avatar']) + { + $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); + $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); + + // This is normalised data, without the group_ prefix + $avatar_data = \phpbb\avatar\manager::clean_row($group_row, 'group'); + } + + // Handle deletion of avatars + if ($request->is_set_post('avatar_delete')) + { + if (confirm_box(true)) + { + $phpbb_avatar_manager->handle_avatar_delete($db, $user, $avatar_data, GROUPS_TABLE, 'group_'); + $cache->destroy('sql', GROUPS_TABLE); + + $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED'; + trigger_error($user->lang[$message] . $return_page); + } + else + { + confirm_box(false, $user->lang('CONFIRM_AVATAR_DELETE'), build_hidden_fields(array( + 'avatar_delete' => true, + 'i' => $id, + 'mode' => $mode, + 'g' => $group_id, + 'action' => $action)) + ); + } + } + + // 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); + + $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); + + $submit_ary = array( + 'colour' => request_var('group_colour', ''), + 'rank' => request_var('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), + 'legend' => $group_row['group_legend'], + 'teampage' => $group_row['group_teampage'], + ); + + if ($config['allow_avatar']) + { + // Handle avatar + $driver_name = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', '')); + $config_name = preg_replace('#^avatar\.driver.#', '', $driver_name); + + if (in_array($driver_name, $avatar_drivers) && !$request->is_set_post('avatar_delete')) + { + $driver = $phpbb_avatar_manager->get_driver($driver_name); + $result = $driver->process_form($request, $template, $user, $avatar_data, $avatar_error); + + if ($result && empty($avatar_error)) + { + $result['avatar_type'] = $driver_name; + + $submit_ary = array_merge($submit_ary, $result); + } + } + + // Merge any avatars errors into the primary error array + $error = array_merge($error, $phpbb_avatar_manager->localize_errors($user, $avatar_error)); + } + + if (!check_form_key('ucp_groups')) + { + $error[] = $user->lang['FORM_INVALID']; + } + + // Validate submitted colour value + if ($colour_error = validate_data($submit_ary, array('colour' => array('hex_colour', true)))) + { + // Replace "error" string with its real, localised form + $error = array_merge($error, $colour_error); + } + + if (!sizeof($error)) + { + // Only set the rank, colour, etc. if it's changed or if we're adding a new + // group. This prevents existing group members being updated if no changes + // were made. + // However there are some attributes that need to be set everytime, + // otherwise the group gets removed from the feature. + $set_attributes = array('legend', 'teampage'); + + $group_attributes = array(); + $test_variables = array( + 'rank' => 'int', + 'colour' => 'string', + 'avatar' => 'string', + 'avatar_type' => 'string', + 'avatar_width' => 'int', + 'avatar_height' => 'int', + 'receive_pm' => 'int', + 'legend' => 'int', + 'teampage' => 'int', + 'message_limit' => 'int', + 'max_recipients'=> 'int', + ); + + foreach ($test_variables as $test => $type) + { + if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test] || isset($group_attributes['group_avatar']) && strpos($test, 'avatar') === 0 || in_array($test, $set_attributes))) + { + settype($submit_ary[$test], $type); + $group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test]; + } + } + + if (!($error = group_create($group_id, $group_type, $group_name, $group_desc, $group_attributes, $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies))) + { + $cache->destroy('sql', GROUPS_TABLE); + $cache->destroy('sql', TEAMPAGE_TABLE); + + $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED'; + trigger_error($user->lang[$message] . $return_page); + } + } + + if (sizeof($error)) + { + $error = array_map(array(&$user, 'lang'), $error); + $group_rank = $submit_ary['rank']; + + $group_desc_data = array( + 'text' => $group_desc, + 'allow_bbcode' => $allow_desc_bbcode, + 'allow_smilies' => $allow_desc_smilies, + 'allow_urls' => $allow_desc_urls + ); + } + } + else if (!$group_id) + { + $group_name = utf8_normalize_nfc(request_var('group_name', '', true)); + $group_desc_data = array( + 'text' => '', + 'allow_bbcode' => true, + 'allow_smilies' => true, + 'allow_urls' => true + ); + $group_rank = 0; + $group_type = GROUP_OPEN; + } + else + { + $group_desc_data = generate_text_for_edit($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_options']); + $group_rank = $group_row['group_rank']; + } + + $sql = 'SELECT * + FROM ' . RANKS_TABLE . ' + WHERE rank_special = 1 + ORDER BY rank_title'; + $result = $db->sql_query($sql); + + $rank_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $selected = ($group_rank && $row['rank_id'] == $group_rank) ? ' selected="selected"' : ''; + $rank_options .= ''; + } + $db->sql_freeresult($result); + + $type_free = ($group_type == GROUP_FREE) ? ' checked="checked"' : ''; + $type_open = ($group_type == GROUP_OPEN) ? ' checked="checked"' : ''; + $type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : ''; + $type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : ''; + + // Load up stuff for avatars + if ($config['allow_avatar']) + { + $avatars_enabled = false; + $selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $avatar_data['avatar_type'])); + + foreach ($avatar_drivers as $current_driver) + { + $driver = $phpbb_avatar_manager->get_driver($current_driver); + + $avatars_enabled = true; + $template->set_filenames(array( + 'avatar' => $driver->get_template_name(), + )); + + if ($driver->prepare_form($request, $template, $user, $avatar_data, $avatar_error)) + { + $driver_name = $phpbb_avatar_manager->prepare_driver_name($current_driver); + $driver_upper = strtoupper($driver_name); + $template->assign_block_vars('avatar_drivers', array( + 'L_TITLE' => $user->lang($driver_upper . '_TITLE'), + 'L_EXPLAIN' => $user->lang($driver_upper . '_EXPLAIN'), + + 'DRIVER' => $driver_name, + 'SELECTED' => $current_driver == $selected_driver, + 'OUTPUT' => $template->assign_display('avatar'), + )); + } + } + } + + if (isset($phpbb_avatar_manager) && !$update) + { + // Merge any avatars errors into the primary error array + $error = array_merge($error, $phpbb_avatar_manager->localize_errors($user, $avatar_error)); + } + + $template->assign_vars(array( + 'S_EDIT' => true, + 'S_INCLUDE_SWATCH' => true, + 'S_FORM_ENCTYPE' => ' enctype="multipart/form-data"', + 'S_ERROR' => (sizeof($error)) ? true : false, + 'S_SPECIAL_GROUP' => ($group_type == GROUP_SPECIAL) ? true : false, + 'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled), + 'S_GROUP_MANAGE' => true, + + 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', + 'GROUP_RECEIVE_PM' => (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '', + 'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0, + 'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0, + + 'GROUP_DESC' => $group_desc_data['text'], + 'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'], + 'S_DESC_URLS_CHECKED' => $group_desc_data['allow_urls'], + 'S_DESC_SMILIES_CHECKED'=> $group_desc_data['allow_smilies'], + + 'S_RANK_OPTIONS' => $rank_options, + + 'GROUP_TYPE_FREE' => GROUP_FREE, + 'GROUP_TYPE_OPEN' => GROUP_OPEN, + 'GROUP_TYPE_CLOSED' => GROUP_CLOSED, + 'GROUP_TYPE_HIDDEN' => GROUP_HIDDEN, + 'GROUP_TYPE_SPECIAL' => GROUP_SPECIAL, + + 'GROUP_FREE' => $type_free, + 'GROUP_OPEN' => $type_open, + 'GROUP_CLOSED' => $type_closed, + 'GROUP_HIDDEN' => $type_hidden, + + 'S_UCP_ACTION' => $this->u_action . "&action=$action&g=$group_id", + 'L_AVATAR_EXPLAIN' => phpbb_avatar_explanation_string(), + )); + + break; + + case 'list': + + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . $return_page); + } + + if (!($row = group_memberships($group_id, $user->data['user_id']))) + { + trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page); + } + list(, $row) = each($row); + + if (!$row['group_leader']) + { + trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page); + } + + $user->add_lang(array('acp/groups', 'acp/common')); + $start = request_var('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 + FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug + WHERE ug.group_id = $group_id + AND u.user_id = ug.user_id + AND ug.group_leader = 1 + ORDER BY ug.user_pending DESC, u.username_clean"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('leader', array( + 'USERNAME' => $row['username'], + 'USERNAME_COLOUR' => $row['user_colour'], + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'U_USER_VIEW' => get_username_string('profile', $row['user_id'], $row['username']), + 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, + 'JOINED' => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ', + 'USER_POSTS' => $row['user_posts'], + 'USER_ID' => $row['user_id']) + ); + } + $db->sql_freeresult($result); + + // Total number of group members (non-leaders) + $sql = 'SELECT COUNT(user_id) AS total_members + FROM ' . USER_GROUP_TABLE . " + WHERE group_id = $group_id + AND group_leader = 0"; + $result = $db->sql_query($sql); + $total_members = (int) $db->sql_fetchfield('total_members'); + $db->sql_freeresult($result); + + // Grab the members + $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 + FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug + WHERE ug.group_id = $group_id + AND u.user_id = ug.user_id + AND ug.group_leader = 0 + ORDER BY ug.user_pending DESC, u.username_clean"; + $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); + + $pending = false; + $approved = false; + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['user_pending'] && !$pending) + { + $template->assign_block_vars('member', array( + 'S_PENDING' => true) + ); + $template->assign_var('S_PENDING_SET', true); + + $pending = true; + } + else if (!$row['user_pending'] && !$approved) + { + $template->assign_block_vars('member', array( + 'S_APPROVED' => true) + ); + $template->assign_var('S_APPROVED_SET', true); + + $approved = true; + } + + $template->assign_block_vars('member', array( + 'USERNAME' => $row['username'], + 'USERNAME_COLOUR' => $row['user_colour'], + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'U_USER_VIEW' => get_username_string('profile', $row['user_id'], $row['username']), + 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, + 'JOINED' => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ', + 'USER_POSTS' => $row['user_posts'], + 'USER_ID' => $row['user_id']) + ); + } + $db->sql_freeresult($result); + + $s_action_options = ''; + $options = array('default' => 'DEFAULT', 'approve' => 'APPROVE', 'deleteusers' => 'DELETE'); + + foreach ($options as $option => $lang) + { + $s_action_options .= ''; + } + + $pagination = $phpbb_container->get('pagination'); + $base_url = $this->u_action . "&action=$action&g=$group_id"; + $start = $pagination->validate_start($start, $config['topics_per_page'], $total_members); + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_members, $config['topics_per_page'], $start); + + $template->assign_vars(array( + 'S_LIST' => true, + 'S_ACTION_OPTIONS' => $s_action_options, + + 'U_ACTION' => $this->u_action . "&g=$group_id", + 'S_UCP_ACTION' => $this->u_action . "&g=$group_id", + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=usernames'), + )); + + break; + + case 'approve': + + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . $return_page); + } + + if (!($row = group_memberships($group_id, $user->data['user_id']))) + { + trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page); + } + list(, $row) = each($row); + + if (!$row['group_leader']) + { + trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page); + } + + $user->add_lang('acp/groups'); + + // Approve, demote or promote + group_user_attributes('approve', $group_id, $mark_ary, false, false); + + trigger_error($user->lang['USERS_APPROVED'] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); + + break; + + case 'default': + + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . $return_page); + } + + if (!($row = group_memberships($group_id, $user->data['user_id']))) + { + trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page); + } + list(, $row) = each($row); + + if (!$row['group_leader']) + { + 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']; + + if (confirm_box(true)) + { + if (!sizeof($mark_ary)) + { + $start = 0; + + do + { + $sql = 'SELECT user_id + FROM ' . USER_GROUP_TABLE . " + WHERE group_id = $group_id + ORDER BY user_id"; + $result = $db->sql_query_limit($sql, 200, $start); + + $mark_ary = array(); + if ($row = $db->sql_fetchrow($result)) + { + do + { + $mark_ary[] = $row['user_id']; + } + while ($row = $db->sql_fetchrow($result)); + + group_user_attributes('default', $group_id, $mark_ary, false, $group_row['group_name'], $group_row); + + $start = (sizeof($mark_ary) < 200) ? 0 : $start + 200; + } + else + { + $start = 0; + } + $db->sql_freeresult($result); + } + while ($start); + } + else + { + group_user_attributes('default', $group_id, $mark_ary, false, $group_row['group_name'], $group_row); + } + + $user->add_lang('acp/groups'); + + trigger_error($user->lang['GROUP_DEFS_UPDATED'] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); + } + else + { + $user->add_lang('acp/common'); + + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'mark' => $mark_ary, + 'g' => $group_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action)) + ); + } + + // redirect to last screen + redirect($this->u_action . '&action=list&g=' . $group_id); + + break; + + case 'deleteusers': + + $user->add_lang(array('acp/groups', 'acp/common')); + + if (!($row = group_memberships($group_id, $user->data['user_id']))) + { + trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page); + } + list(, $row) = each($row); + + if (!$row['group_leader']) + { + 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']; + + if (confirm_box(true)) + { + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . $return_page); + } + + $error = group_user_del($group_id, $mark_ary, false, $group_row['group_name']); + + if ($error) + { + trigger_error($user->lang[$error] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); + } + + trigger_error($user->lang['GROUP_USERS_REMOVE'] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'mark' => $mark_ary, + 'g' => $group_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action)) + ); + } + + // redirect to last screen + redirect($this->u_action . '&action=list&g=' . $group_id); + + break; + + case 'addusers': + + $user->add_lang(array('acp/groups', 'acp/common')); + + $names = utf8_normalize_nfc(request_var('usernames', '', true)); + + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . $return_page); + } + + if (!$names) + { + trigger_error($user->lang['NO_USERS'] . $return_page); + } + + if (!($row = group_memberships($group_id, $user->data['user_id']))) + { + trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page); + } + list(, $row) = each($row); + + if (!$row['group_leader']) + { + trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page); + } + + $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']; + + $default = request_var('default', 0); + + if (confirm_box(true)) + { + // Add user/s to group + if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, 0, 0, $group_row)) + { + trigger_error($user->lang[$error] . $return_page); + } + + trigger_error($user->lang['GROUP_USERS_ADDED'] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); + } + else + { + $s_hidden_fields = array( + 'default' => $default, + 'usernames' => $names, + 'g' => $group_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action + ); + + confirm_box(false, $user->lang('GROUP_CONFIRM_ADD_USERS', sizeof($name_ary), implode($user->lang['COMMA_SEPARATOR'], $name_ary)), build_hidden_fields($s_hidden_fields)); + } + + trigger_error($user->lang['NO_USERS_ADDED'] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); + + break; + + default: + $user->add_lang('acp/common'); + + $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_desc, g.group_desc_uid, g.group_desc_bitfield, g.group_desc_options, g.group_type, ug.group_leader + FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug + WHERE ug.user_id = ' . $user->data['user_id'] . ' + AND g.group_id = ug.group_id + AND ug.group_leader = 1 + ORDER BY g.group_type DESC, g.group_name'; + $result = $db->sql_query($sql); + + 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_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'], + 'GROUP_COLOUR' => $value['group_colour'], + + 'U_LIST' => $this->u_action . "&action=list&g={$value['group_id']}", + 'U_EDIT' => $this->u_action . "&action=edit&g={$value['group_id']}") + ); + } + $db->sql_freeresult($result); + + break; + } + + break; + } + + $this->tpl_name = 'ucp_groups_' . $mode; + } +} diff --git a/sources/phpBB/includes/ucp/ucp_login_link.php b/sources/phpBB/includes/ucp/ucp_login_link.php new file mode 100644 index 0000000..bfe4804 --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_login_link.php @@ -0,0 +1,246 @@ + +* @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; +} + +/** +* ucp_login_link +* Allows users of external accounts link those accounts to their phpBB accounts +* during an attempted login. +*/ +class ucp_login_link +{ + /** + * @var string + */ + public $u_action; + + /** + * Generates the ucp_login_link page and handles login link process + * + * @param int $id + * @param string $mode + */ + function main($id, $mode) + { + global $phpbb_container, $request, $template, $user; + global $phpbb_root_path, $phpEx; + + // Initialize necessary variables + $login_error = null; + $login_link_error = null; + $login_username = null; + + // Build the data array + $data = $this->get_login_link_data_array(); + + // Ensure the person was sent here with login_link data + if (empty($data)) + { + $login_link_error = $user->lang['LOGIN_LINK_NO_DATA_PROVIDED']; + } + + // Use the auth_provider requested even if different from configured + $provider_collection = $phpbb_container->get('auth.provider_collection'); + $auth_provider = $provider_collection->get_provider($request->variable('auth_provider', '')); + + // Set the link_method to login_link + $data['link_method'] = 'login_link'; + + // Have the authentication provider check that all necessary data is available + $result = $auth_provider->login_link_has_necessary_data($data); + if ($result !== null) + { + $login_link_error = $user->lang[$result]; + } + + // Perform link action if there is no error + if (!$login_link_error) + { + if ($request->is_set_post('login')) + { + $login_username = $request->variable('login_username', '', true, \phpbb\request\request_interface::POST); + $login_password = $request->untrimmed_variable('login_password', '', true, \phpbb\request\request_interface::POST); + + $login_result = $auth_provider->login($login_username, $login_password); + + // We only care if there is or is not an error + $login_error = $this->process_login_result($login_result); + + if (!$login_error) + { + // Give the user_id to the data + $data['user_id'] = $login_result['user_row']['user_id']; + + // The user is now logged in, attempt to link the user to the external account + $result = $auth_provider->link_account($data); + + if ($result) + { + $login_link_error = $user->lang[$result]; + } + else + { + // Finish login + $result = $user->session_create($login_result['user_row']['user_id'], false, false, true); + + // Perform a redirect as the account has been linked + $this->perform_redirect(); + } + } + } + } + + $template->assign_vars(array( + // Common template elements + 'LOGIN_LINK_ERROR' => $login_link_error, + 'PASSWORD_CREDENTIAL' => 'login_password', + 'USERNAME_CREDENTIAL' => 'login_username', + 'S_HIDDEN_FIELDS' => $this->get_hidden_fields($data), + + // Registration elements + 'REGISTER_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'), + + // Login elements + 'LOGIN_ERROR' => $login_error, + 'LOGIN_USERNAME' => $login_username, + )); + + $this->tpl_name = 'ucp_login_link'; + $this->page_title = 'UCP_LOGIN_LINK'; + } + + /** + * Builds the hidden fields string from the data array. + * + * @param array $data This function only includes data in the array + * that has a key that begins with 'login_link_' + * @return string A string of hidden fields that can be included in the + * template + */ + protected function get_hidden_fields($data) + { + $fields = array(); + + foreach ($data as $key => $value) + { + $fields['login_link_' . $key] = $value; + } + + return build_hidden_fields($fields); + } + + /** + * Builds the login_link data array + * + * @return array All login_link data. This is all GET data whose names + * begin with 'login_link_' + */ + protected function get_login_link_data_array() + { + global $request; + + $var_names = $request->variable_names(\phpbb\request\request_interface::GET); + $login_link_data = array(); + $string_start_length = strlen('login_link_'); + + foreach ($var_names as $var_name) + { + if (strpos($var_name, 'login_link_') === 0) + { + $key_name = substr($var_name, $string_start_length); + $login_link_data[$key_name] = $request->variable($var_name, '', false, \phpbb\request\request_interface::GET); + } + } + + return $login_link_data; + } + + /** + * Processes the result array from the login process + * @param array $result The login result array + * @return string|null If there was an error in the process, a string is + * returned. If the login was successful, then null is + * returned. + */ + protected function process_login_result($result) + { + global $config, $request, $template, $user, $phpbb_container; + + $login_error = null; + + if ($result['status'] != LOGIN_SUCCESS) + { + // Handle all errors first + if ($result['status'] == LOGIN_BREAK) + { + trigger_error($result['error_msg']); + } + + switch ($result['status']) + { + case LOGIN_ERROR_ATTEMPTS: + + $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']); + $captcha->init(CONFIRM_LOGIN); + + $template->assign_vars(array( + 'CAPTCHA_TEMPLATE' => $captcha->get_template(), + )); + + $login_error = $user->lang[$result['error_msg']]; + break; + + case LOGIN_ERROR_PASSWORD_CONVERT: + $login_error = sprintf( + $user->lang[$result['error_msg']], + ($config['email_enable']) ? '' : '', + ($config['email_enable']) ? '' : '', + ($config['board_contact']) ? '' : '', + ($config['board_contact']) ? '' : '' + ); + break; + + // Username, password, etc... + default: + $login_error = $user->lang[$result['error_msg']]; + + // Assign admin contact to some error messages + if ($result['error_msg'] == 'LOGIN_ERROR_USERNAME' || $result['error_msg'] == 'LOGIN_ERROR_PASSWORD') + { + $login_error = (!$config['board_contact']) ? sprintf($user->lang[$result['error_msg']], '', '') : sprintf($user->lang[$result['error_msg']], '', ''); + } + + break; + } + } + + return $login_error; + } + + /** + * Performs a post login redirect + */ + protected function perform_redirect() + { + global $phpbb_root_path, $phpEx; + $url = append_sid($phpbb_root_path . 'index.' . $phpEx); + redirect($url); + } +} diff --git a/sources/phpBB/includes/ucp/ucp_main.php b/sources/phpBB/includes/ucp/ucp_main.php new file mode 100644 index 0000000..a1624e7 --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_main.php @@ -0,0 +1,846 @@ + +* @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; +} + +/** +* ucp_main +* UCP Front Panel +*/ +class ucp_main +{ + var $p_master; + var $u_action; + + function ucp_main(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($id, $mode) + { + global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; + global $request; + + switch ($mode) + { + case 'front': + + $user->add_lang('memberlist'); + + $sql_from = TOPICS_TABLE . ' t '; + $sql_select = ''; + + if ($config['load_db_track']) + { + $sql_from .= ' LEFT JOIN ' . TOPICS_POSTED_TABLE . ' tp ON (tp.topic_id = t.topic_id + AND tp.user_id = ' . $user->data['user_id'] . ')'; + $sql_select .= ', tp.topic_posted'; + } + + if ($config['load_db_lastread']) + { + $sql_from .= ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id + AND tt.user_id = ' . $user->data['user_id'] . ')'; + $sql_select .= ', tt.mark_time'; + + $sql_from .= ' LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.forum_id = t.forum_id + AND ft.user_id = ' . $user->data['user_id'] . ')'; + $sql_select .= ', ft.mark_time AS forum_mark_time'; + } + + $topic_type = $user->lang['VIEW_TOPIC_GLOBAL']; + $folder = 'global_read'; + $folder_new = 'global_unread'; + + // Get cleaned up list... return only those forums having the f_read permission + $forum_ary = $auth->acl_getf('f_read', true); + $forum_ary = array_unique(array_keys($forum_ary)); + $topic_list = $rowset = array(); + + // If the user can't see any forums, he can't read any posts because fid of 0 is invalid + if (!empty($forum_ary)) + { + $sql = "SELECT t.* $sql_select + FROM $sql_from + WHERE t.topic_type = " . POST_GLOBAL . ' + AND ' . $db->sql_in_set('t.forum_id', $forum_ary) . ' + ORDER BY t.topic_last_post_time DESC, t.topic_last_post_id DESC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $topic_list[] = $row['topic_id']; + $rowset[$row['topic_id']] = $row; + } + $db->sql_freeresult($result); + } + + $topic_forum_list = array(); + foreach ($rowset as $t_id => $row) + { + if (isset($forum_tracking_info[$row['forum_id']])) + { + $row['forum_mark_time'] = $forum_tracking_info[$row['forum_id']]; + } + + $topic_forum_list[$row['forum_id']]['forum_mark_time'] = ($config['load_db_lastread'] && $user->data['is_registered'] && isset($row['forum_mark_time'])) ? $row['forum_mark_time'] : 0; + $topic_forum_list[$row['forum_id']]['topics'][] = (int) $t_id; + } + + $topic_tracking_info = $tracking_topics = array(); + if ($config['load_db_lastread']) + { + foreach ($topic_forum_list as $f_id => $topic_row) + { + $topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time'])); + } + } + else + { + foreach ($topic_forum_list as $f_id => $topic_row) + { + $topic_tracking_info += get_complete_topic_tracking($f_id, $topic_row['topics']); + } + } + unset($topic_forum_list); + + foreach ($topic_list as $topic_id) + { + $row = &$rowset[$topic_id]; + + $forum_id = $row['forum_id']; + $topic_id = $row['topic_id']; + + $unread_topic = (isset($topic_tracking_info[$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false; + + $folder_img = ($unread_topic) ? $folder_new : $folder; + $folder_alt = ($unread_topic) ? 'UNREAD_POSTS' : (($row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_UNREAD_POSTS'); + + if ($row['topic_status'] == ITEM_LOCKED) + { + $folder_img .= '_locked'; + } + + // Posted image? + if (!empty($row['topic_posted']) && $row['topic_posted']) + { + $folder_img .= '_mine'; + } + + $template->assign_block_vars('topicrow', array( + 'FORUM_ID' => $forum_id, + 'TOPIC_ID' => $topic_id, + 'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'TOPIC_AUTHOR_FULL' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), + 'LAST_POST_SUBJECT' => censor_text($row['topic_last_post_subject']), + 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), + 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), + 'LAST_POST_AUTHOR' => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'TOPIC_TITLE' => censor_text($row['topic_title']), + 'TOPIC_TYPE' => $topic_type, + + 'TOPIC_IMG_STYLE' => $folder_img, + 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', '') : '', + + 'S_USER_POSTED' => (!empty($row['topic_posted']) && $row['topic_posted']) ? true : false, + 'S_UNREAD' => $unread_topic, + + 'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], + 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=unread") . '#unread', + 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id")) + ); + } + + if ($config['load_user_activity']) + { + if (!function_exists('display_user_activity')) + { + include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } + display_user_activity($user->data); + } + + // Do the relevant calculations + $memberdays = max(1, round((time() - $user->data['user_regdate']) / 86400)); + $posts_per_day = $user->data['user_posts'] / $memberdays; + $percentage = ($config['num_posts']) ? min(100, ($user->data['user_posts'] / $config['num_posts']) * 100) : 0; + + $template->assign_vars(array( + 'USER_COLOR' => (!empty($user->data['user_colour'])) ? $user->data['user_colour'] : '', + 'JOINED' => $user->format_date($user->data['user_regdate']), + 'LAST_ACTIVE' => (empty($last_active)) ? ' - ' : $user->format_date($last_active), + 'WARNINGS' => ($user->data['user_warnings']) ? $user->data['user_warnings'] : 0, + 'POSTS' => ($user->data['user_posts']) ? $user->data['user_posts'] : 0, + 'POSTS_DAY' => $user->lang('POST_DAY', $posts_per_day), + 'POSTS_PCT' => $user->lang('POST_PCT', $percentage), + +// 'S_GROUP_OPTIONS' => $group_options, + + 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $user->data['user_id'] . '&sr=posts') : '', + )); + + break; + + case 'subscribed': + + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + + $user->add_lang('viewforum'); + + add_form_key('ucp_front_subscribed'); + + $unwatch = (isset($_POST['unwatch'])) ? true : false; + + if ($unwatch) + { + 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))); + $msg = ''; + + if (sizeof($forums) || sizeof($topics)) + { + $l_unwatch = ''; + if (sizeof($forums)) + { + $sql = 'DELETE FROM ' . FORUMS_WATCH_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forums) . ' + AND user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + + $l_unwatch .= '_FORUMS'; + } + + if (sizeof($topics)) + { + $sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topics) . ' + AND user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + + $l_unwatch .= '_TOPICS'; + } + $msg = $user->lang['UNWATCHED' . $l_unwatch]; + } + else + { + $msg = $user->lang['NO_WATCHED_SELECTED']; + } + } + else + { + $msg = $user->lang['FORM_INVALID']; + } + $message = $msg . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + meta_refresh(3, append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=subscribed")); + trigger_error($message); + } + + $forbidden_forums = array(); + + if ($config['allow_forum_notify']) + { + $forbidden_forums = $auth->acl_getf('!f_read', true); + $forbidden_forums = array_unique(array_keys($forbidden_forums)); + + $sql_array = array( + 'SELECT' => 'f.*', + + 'FROM' => array( + FORUMS_WATCH_TABLE => 'fw', + FORUMS_TABLE => 'f' + ), + + 'WHERE' => 'fw.user_id = ' . $user->data['user_id'] . ' + AND f.forum_id = fw.forum_id + AND ' . $db->sql_in_set('f.forum_id', $forbidden_forums, true, true), + + 'ORDER_BY' => 'left_id' + ); + + if ($config['load_db_lastread']) + { + $sql_array['LEFT_JOIN'] = array( + array( + 'FROM' => array(FORUMS_TRACK_TABLE => 'ft'), + 'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id' + ) + ); + + $sql_array['SELECT'] .= ', ft.mark_time '; + } + else + { + $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE); + $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array(); + } + + $sql = $db->sql_build_query('SELECT', $sql_array); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_id = $row['forum_id']; + + if ($config['load_db_lastread']) + { + $forum_check = (!empty($row['mark_time'])) ? $row['mark_time'] : $user->data['user_lastmark']; + } + else + { + $forum_check = (isset($tracking_topics['f'][$forum_id])) ? (int) (base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate']) : $user->data['user_lastmark']; + } + + $unread_forum = ($row['forum_last_post_time'] > $forum_check) ? true : false; + + // Which folder should we display? + if ($row['forum_status'] == ITEM_LOCKED) + { + $folder_image = ($unread_forum) ? 'forum_unread_locked' : 'forum_read_locked'; + $folder_alt = 'FORUM_LOCKED'; + } + else + { + $folder_image = ($unread_forum) ? 'forum_unread' : 'forum_read'; + $folder_alt = ($unread_forum) ? 'UNREAD_POSTS' : 'NO_UNREAD_POSTS'; + } + + // Create last post link information, if appropriate + if ($row['forum_last_post_id']) + { + $last_post_time = $user->format_date($row['forum_last_post_time']); + $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&p=" . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id']; + } + else + { + $last_post_time = $last_post_url = ''; + } + + $template->assign_block_vars('forumrow', array( + 'FORUM_ID' => $forum_id, + 'FORUM_IMG_STYLE' => $folder_image, + 'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt), + 'FORUM_IMAGE' => ($row['forum_image']) ? '' . $user->lang[$folder_alt] . '' : '', + 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', + 'FORUM_NAME' => $row['forum_name'], + 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), + 'LAST_POST_SUBJECT' => $row['forum_last_post_subject'], + 'LAST_POST_TIME' => $last_post_time, + + 'LAST_POST_AUTHOR' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), + 'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), + 'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), + 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), + + 'S_UNREAD_FORUM' => $unread_forum, + + 'U_LAST_POST' => $last_post_url, + 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id'])) + ); + } + $db->sql_freeresult($result); + } + + // Subscribed Topics + if ($config['allow_topic_notify']) + { + if (empty($forbidden_forums)) + { + $forbidden_forums = $auth->acl_getf('!f_read', true); + $forbidden_forums = array_unique(array_keys($forbidden_forums)); + } + $this->assign_topiclist('subscribed', $forbidden_forums); + } + + $template->assign_vars(array( + 'S_TOPIC_NOTIFY' => $config['allow_topic_notify'], + 'S_FORUM_NOTIFY' => $config['allow_forum_notify'], + )); + + break; + + case 'bookmarks': + + if (!$config['allow_bookmarks']) + { + $template->assign_vars(array( + 'S_NO_DISPLAY_BOOKMARKS' => true) + ); + break; + } + + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + + $user->add_lang('viewforum'); + + if (isset($_POST['unbookmark'])) + { + $s_hidden_fields = array('unbookmark' => 1); + $topics = (isset($_POST['t'])) ? array_keys(request_var('t', array(0 => 0))) : array(); + $url = $this->u_action; + + if (!sizeof($topics)) + { + trigger_error('NO_BOOKMARKS_SELECTED'); + } + + foreach ($topics as $topic_id) + { + $s_hidden_fields['t'][$topic_id] = 1; + } + + if (confirm_box(true)) + { + $sql = 'DELETE FROM ' . BOOKMARKS_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . ' + AND ' . $db->sql_in_set('topic_id', $topics); + $db->sql_query($sql); + + meta_refresh(3, $url); + $message = $user->lang['BOOKMARKS_REMOVED'] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + trigger_error($message); + } + else + { + confirm_box(false, 'REMOVE_SELECTED_BOOKMARKS', build_hidden_fields($s_hidden_fields)); + } + } + $forbidden_forums = $auth->acl_getf('!f_read', true); + $forbidden_forums = array_unique(array_keys($forbidden_forums)); + + $this->assign_topiclist('bookmarks', $forbidden_forums); + + break; + + case 'drafts': + + $pm_drafts = ($this->p_master->p_name == 'pm') ? true : false; + $template->assign_var('S_SHOW_DRAFTS', true); + + $user->add_lang('posting'); + + $edit = (isset($_REQUEST['edit'])) ? true : false; + $submit = (isset($_POST['submit'])) ? true : false; + $draft_id = $request->variable('edit', 0); + $delete = (isset($_POST['delete'])) ? true : false; + + $s_hidden_fields = ($edit) ? '' : ''; + $draft_subject = $draft_message = ''; + add_form_key('ucp_draft'); + + if ($delete) + { + if (check_form_key('ucp_draft')) + { + $drafts = array_keys(request_var('d', array(0 => 0))); + + if (sizeof($drafts)) + { + $sql = 'DELETE FROM ' . DRAFTS_TABLE . ' + WHERE ' . $db->sql_in_set('draft_id', $drafts) . ' + AND user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + } + $msg = $user->lang['DRAFTS_DELETED']; + unset($drafts); + } + else + { + $msg = $user->lang['FORM_INVALID']; + } + $message = $msg . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + meta_refresh(3, $this->u_action); + trigger_error($message); + } + + if ($submit && $edit) + { + $draft_subject = utf8_normalize_nfc(request_var('subject', '', true)); + $draft_message = utf8_normalize_nfc(request_var('message', '', true)); + if (check_form_key('ucp_draft')) + { + if ($draft_message && $draft_subject) + { + $draft_row = array( + 'draft_subject' => $draft_subject, + 'draft_message' => $draft_message + ); + + $sql = 'UPDATE ' . DRAFTS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $draft_row) . " + WHERE draft_id = $draft_id + AND user_id = " . $user->data['user_id']; + $db->sql_query($sql); + + $message = $user->lang['DRAFT_UPDATED'] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + + meta_refresh(3, $this->u_action); + trigger_error($message); + } + else + { + $template->assign_var('ERROR', ($draft_message == '') ? $user->lang['EMPTY_DRAFT'] : (($draft_subject == '') ? $user->lang['EMPTY_DRAFT_TITLE'] : '')); + } + } + else + { + $template->assign_var('ERROR', $user->lang['FORM_INVALID']); + } + } + + if (!$pm_drafts) + { + $sql = 'SELECT d.*, f.forum_name + FROM ' . DRAFTS_TABLE . ' d, ' . FORUMS_TABLE . ' f + WHERE d.user_id = ' . $user->data['user_id'] . ' ' . + (($edit) ? "AND d.draft_id = $draft_id" : '') . ' + AND f.forum_id = d.forum_id + ORDER BY d.save_time DESC'; + } + else + { + $sql = 'SELECT * FROM ' . DRAFTS_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . ' ' . + (($edit) ? "AND draft_id = $draft_id" : '') . ' + AND forum_id = 0 + AND topic_id = 0 + ORDER BY save_time DESC'; + } + $result = $db->sql_query($sql); + + $draftrows = $topic_ids = array(); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['topic_id']) + { + $topic_ids[] = (int) $row['topic_id']; + } + $draftrows[] = $row; + } + $db->sql_freeresult($result); + + if (sizeof($topic_ids)) + { + $sql = 'SELECT topic_id, forum_id, topic_title + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', array_unique($topic_ids)); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $topic_rows[$row['topic_id']] = $row; + } + $db->sql_freeresult($result); + } + unset($topic_ids); + + $template->assign_var('S_EDIT_DRAFT', $edit); + + $row_count = 0; + foreach ($draftrows as $draft) + { + $link_topic = $link_forum = $link_pm = false; + $insert_url = $view_url = $title = ''; + + if (isset($topic_rows[$draft['topic_id']]) && $auth->acl_get('f_read', $topic_rows[$draft['topic_id']]['forum_id'])) + { + $link_topic = true; + $view_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id']); + $title = $topic_rows[$draft['topic_id']]['topic_title']; + + $insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']); + } + else if ($auth->acl_get('f_read', $draft['forum_id'])) + { + $link_forum = true; + $view_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $draft['forum_id']); + $title = $draft['forum_name']; + + $insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id']); + } + else if ($pm_drafts) + { + $link_pm = true; + $insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=compose&d=" . $draft['draft_id']); + } + + $template_row = array( + 'DATE' => $user->format_date($draft['save_time']), + 'DRAFT_MESSAGE' => ($submit) ? $draft_message : $draft['draft_message'], + 'DRAFT_SUBJECT' => ($submit) ? $draft_subject : $draft['draft_subject'], + 'TITLE' => $title, + + 'DRAFT_ID' => $draft['draft_id'], + 'FORUM_ID' => $draft['forum_id'], + 'TOPIC_ID' => $draft['topic_id'], + + 'U_VIEW' => $view_url, + 'U_VIEW_EDIT' => $this->u_action . '&edit=' . $draft['draft_id'], + 'U_INSERT' => $insert_url, + + 'S_LINK_TOPIC' => $link_topic, + 'S_LINK_FORUM' => $link_forum, + 'S_LINK_PM' => $link_pm, + 'S_HIDDEN_FIELDS' => $s_hidden_fields + ); + $row_count++; + + ($edit) ? $template->assign_vars($template_row) : $template->assign_block_vars('draftrow', $template_row); + } + + if (!$edit) + { + $template->assign_var('S_DRAFT_ROWS', $row_count); + } + + break; + } + + $template->assign_vars(array( + 'L_TITLE' => $user->lang['UCP_MAIN_' . strtoupper($mode)], + + 'S_DISPLAY_MARK_ALL' => ($mode == 'watched' || ($mode == 'drafts' && !isset($_GET['edit']))) ? true : false, + 'S_HIDDEN_FIELDS' => (isset($s_hidden_fields)) ? $s_hidden_fields : '', + 'S_UCP_ACTION' => $this->u_action, + + 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), + 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'), + )); + + // Set desired template + $this->tpl_name = 'ucp_main_' . $mode; + $this->page_title = 'UCP_MAIN_' . strtoupper($mode); + } + + /** + * Build and assign topiclist for bookmarks/subscribed topics + */ + function assign_topiclist($mode = 'subscribed', $forbidden_forum_ary = array()) + { + global $user, $db, $template, $config, $cache, $auth, $phpbb_root_path, $phpEx, $phpbb_container; + + $table = ($mode == 'subscribed') ? TOPICS_WATCH_TABLE : BOOKMARKS_TABLE; + $start = request_var('start', 0); + $pagination = $phpbb_container->get('pagination'); + + // Grab icons + $icons = $cache->obtain_icons(); + + $sql_array = array( + 'SELECT' => 'COUNT(t.topic_id) as topics_count', + + 'FROM' => array( + $table => 'i', + TOPICS_TABLE => 't' + ), + + 'WHERE' => 'i.topic_id = t.topic_id + AND i.user_id = ' . $user->data['user_id'] . ' + AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true), + ); + $sql = $db->sql_build_query('SELECT', $sql_array); + $result = $db->sql_query($sql); + $topics_count = (int) $db->sql_fetchfield('topics_count'); + $db->sql_freeresult($result); + + if ($topics_count) + { + $start = $pagination->validate_start($start, $config['topics_per_page'], $topics_count); + $pagination->generate_template_pagination($this->u_action, 'pagination', 'start', $topics_count, $config['topics_per_page'], $start); + + $template->assign_vars(array( + 'TOTAL_TOPICS' => $user->lang('VIEW_FORUM_TOPICS', (int) $topics_count), + )); + } + + if ($mode == 'subscribed') + { + $sql_array = array( + 'SELECT' => 't.*, f.forum_name', + + 'FROM' => array( + TOPICS_WATCH_TABLE => 'tw', + TOPICS_TABLE => 't' + ), + + 'WHERE' => 'tw.user_id = ' . $user->data['user_id'] . ' + AND t.topic_id = tw.topic_id + AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true), + + 'ORDER_BY' => 't.topic_last_post_time DESC, t.topic_last_post_id DESC' + ); + + $sql_array['LEFT_JOIN'] = array(); + } + else + { + $sql_array = array( + 'SELECT' => 't.*, f.forum_name, b.topic_id as b_topic_id', + + 'FROM' => array( + BOOKMARKS_TABLE => 'b', + ), + + 'WHERE' => 'b.user_id = ' . $user->data['user_id'] . ' + AND ' . $db->sql_in_set('f.forum_id', $forbidden_forum_ary, true, true), + + 'ORDER_BY' => 't.topic_last_post_time DESC, t.topic_last_post_id DESC' + ); + + $sql_array['LEFT_JOIN'] = array(); + $sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_TABLE => 't'), 'ON' => 'b.topic_id = t.topic_id'); + } + + $sql_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TABLE => 'f'), 'ON' => 't.forum_id = f.forum_id'); + + if ($config['load_db_lastread']) + { + $sql_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TRACK_TABLE => 'ft'), 'ON' => 'ft.forum_id = t.forum_id AND ft.user_id = ' . $user->data['user_id']); + $sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_TRACK_TABLE => 'tt'), 'ON' => 'tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id']); + $sql_array['SELECT'] .= ', tt.mark_time, ft.mark_time AS forum_mark_time'; + } + + if ($config['load_db_track']) + { + $sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_POSTED_TABLE => 'tp'), 'ON' => 'tp.topic_id = t.topic_id AND tp.user_id = ' . $user->data['user_id']); + $sql_array['SELECT'] .= ', tp.topic_posted'; + } + + $sql = $db->sql_build_query('SELECT', $sql_array); + $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); + + $topic_list = $topic_forum_list = $global_announce_list = $rowset = array(); + while ($row = $db->sql_fetchrow($result)) + { + $topic_id = (isset($row['b_topic_id'])) ? $row['b_topic_id'] : $row['topic_id']; + + $topic_list[] = $topic_id; + $rowset[$topic_id] = $row; + + $topic_forum_list[$row['forum_id']]['forum_mark_time'] = ($config['load_db_lastread']) ? $row['forum_mark_time'] : 0; + $topic_forum_list[$row['forum_id']]['topics'][] = $topic_id; + + if ($row['topic_type'] == POST_GLOBAL) + { + $global_announce_list[] = $topic_id; + } + } + $db->sql_freeresult($result); + + $topic_tracking_info = array(); + if ($config['load_db_lastread']) + { + foreach ($topic_forum_list as $f_id => $topic_row) + { + $topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time'])); + } + } + else + { + foreach ($topic_forum_list as $f_id => $topic_row) + { + $topic_tracking_info += get_complete_topic_tracking($f_id, $topic_row['topics']); + } + } + + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + + foreach ($topic_list as $topic_id) + { + $row = &$rowset[$topic_id]; + + $forum_id = $row['forum_id']; + $topic_id = (isset($row['b_topic_id'])) ? $row['b_topic_id'] : $row['topic_id']; + + $unread_topic = (isset($topic_tracking_info[$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false; + + // Replies + $replies = $phpbb_content_visibility->get_count('topic_posts', $row, $forum_id) - 1; + + if ($row['topic_status'] == ITEM_MOVED && !empty($row['topic_moved_id'])) + { + $topic_id = $row['topic_moved_id']; + } + + // Get folder img, topic status/type related information + $folder_img = $folder_alt = $topic_type = ''; + topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type); + + $view_topic_url_params = "f=$forum_id&t=$topic_id"; + $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params); + + // Send vars to template + $template->assign_block_vars('topicrow', array( + 'FORUM_ID' => $forum_id, + 'TOPIC_ID' => $topic_id, + 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), + 'LAST_POST_SUBJECT' => $row['topic_last_post_subject'], + 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), + 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), + + 'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'TOPIC_AUTHOR_FULL' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + + 'LAST_POST_AUTHOR' => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + + 'S_DELETED_TOPIC' => (!$row['topic_id']) ? true : false, + + 'REPLIES' => $replies, + 'VIEWS' => $row['topic_views'], + 'TOPIC_TITLE' => censor_text($row['topic_title']), + 'TOPIC_TYPE' => $topic_type, + 'FORUM_NAME' => $row['forum_name'], + + 'TOPIC_IMG_STYLE' => $folder_img, + 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), + 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], + 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', + 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', + 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '', + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + + 'S_TOPIC_TYPE' => $row['topic_type'], + 'S_USER_POSTED' => (!empty($row['topic_posted'])) ? true : false, + 'S_UNREAD_TOPIC' => $unread_topic, + + 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&view=unread') . '#unread', + 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], + 'U_VIEW_TOPIC' => $view_topic_url, + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), + )); + + $pagination->generate_template_pagination(append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . "&t=$topic_id"), 'topicrow.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true); + } + } +} diff --git a/sources/phpBB/includes/ucp/ucp_notifications.php b/sources/phpBB/includes/ucp/ucp_notifications.php new file mode 100644 index 0000000..b0aeaba --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_notifications.php @@ -0,0 +1,239 @@ + +* @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; +} + +class ucp_notifications +{ + public $u_action; + + public function main($id, $mode) + { + global $config, $template, $user, $request, $phpbb_container; + global $phpbb_root_path, $phpEx; + + add_form_key('ucp_notification'); + + $start = $request->variable('start', 0); + $form_time = $request->variable('form_time', 0); + $form_time = ($form_time <= 0 || $form_time > time()) ? time() : $form_time; + + $phpbb_notifications = $phpbb_container->get('notification_manager'); + $pagination = $phpbb_container->get('pagination'); + + switch ($mode) + { + case 'notification_options': + $subscriptions = $phpbb_notifications->get_global_subscriptions(false); + + // Add/remove subscriptions + if ($request->is_set_post('submit')) + { + if (!check_form_key('ucp_notification')) + { + trigger_error('FORM_INVALID'); + } + + $notification_methods = $phpbb_notifications->get_subscription_methods(); + + foreach($phpbb_notifications->get_subscription_types() as $group => $subscription_types) + { + foreach($subscription_types as $type => $data) + { + foreach($notification_methods as $method => $method_data) + { + if ($request->is_set_post(str_replace('.', '_', $type . '_' . $method_data['id'])) && (!isset($subscriptions[$type]) || !in_array($method_data['id'], $subscriptions[$type]))) + { + $phpbb_notifications->add_subscription($type, 0, $method_data['id']); + } + else if (!$request->is_set_post(str_replace('.', '_', $type . '_' . $method_data['id'])) && isset($subscriptions[$type]) && in_array($method_data['id'], $subscriptions[$type])) + { + $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); + } + } + } + + meta_refresh(3, $this->u_action); + $message = $user->lang['PREFERENCES_UPDATED'] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + trigger_error($message); + } + + $this->output_notification_methods($phpbb_notifications, $template, $user, 'notification_methods'); + + $this->output_notification_types($subscriptions, $phpbb_notifications, $template, $user, 'notification_types'); + + $this->tpl_name = 'ucp_notifications'; + $this->page_title = 'UCP_NOTIFICATION_OPTIONS'; + break; + + case 'notification_list': + default: + // 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); + + meta_refresh(3, $this->u_action); + $message = $user->lang['NOTIFICATIONS_MARK_ALL_READ_SUCCESS']; + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response(); + $json_response->send(array( + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $message, + 'success' => true, + )); + } + $message .= '

' . $user->lang('RETURN_UCP', '', ''); + + trigger_error($message); + } + + // Mark specific notifications read + if ($request->is_set_post('submit')) + { + if (!check_form_key('ucp_notification')) + { + trigger_error('FORM_INVALID'); + } + + $mark_read = $request->variable('mark', array(0)); + + if (!empty($mark_read)) + { + $phpbb_notifications->mark_notifications_read_by_id($mark_read, $form_time); + } + } + + $notifications = $phpbb_notifications->load_notifications(array( + 'start' => $start, + 'limit' => $config['topics_per_page'], + 'count_total' => true, + )); + + foreach ($notifications['notifications'] as $notification) + { + $template->assign_block_vars('notification_list', $notification->prepare_for_display()); + } + + $base_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=ucp_notifications&mode=notification_list"); + $start = $pagination->validate_start($start, $config['topics_per_page'], $notifications['total_count']); + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $notifications['total_count'], $config['topics_per_page'], $start); + + $template->assign_vars(array( + 'TOTAL_COUNT' => $notifications['total_count'], + 'U_MARK_ALL' => $base_url . '&mark=all&token=' . generate_link_hash('mark_all_notifications_read'), + )); + + $this->tpl_name = 'ucp_notifications'; + $this->page_title = 'UCP_NOTIFICATION_LIST'; + break; + } + + $template->assign_vars(array( + 'TITLE' => $user->lang($this->page_title), + 'TITLE_EXPLAIN' => $user->lang($this->page_title . '_EXPLAIN'), + + 'MODE' => $mode, + + 'FORM_TIME' => time(), + )); + } + + /** + * Output all the notification types to the template + * + * @param array $subscriptions Array containing global subscriptions + * @param \phpbb\notification\manager $phpbb_notifications + * @param \phpbb\template\template $template + * @param \phpbb\user $user + * @param string $block + */ + public function output_notification_types($subscriptions, \phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user, $block = 'notification_types') + { + $notification_methods = $phpbb_notifications->get_subscription_methods(); + + foreach($phpbb_notifications->get_subscription_types() as $group => $subscription_types) + { + $template->assign_block_vars($block, array( + 'GROUP_NAME' => $user->lang($group), + )); + + foreach($subscription_types as $type => $data) + { + $template->assign_block_vars($block, array( + 'TYPE' => $type, + + '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) + { + $template->assign_block_vars($block . '.notification_methods', array( + 'METHOD' => $method_data['id'], + + 'NAME' => $user->lang($method_data['lang']), + + 'SUBSCRIBED' => (isset($subscriptions[$type]) && in_array($method_data['id'], $subscriptions[$type])) ? true : false, + )); + } + } + } + + $template->assign_vars(array( + strtoupper($block) . '_COLS' => sizeof($notification_methods) + 2, + )); + } + + /** + * Output all the notification methods to the template + * + * @param \phpbb\notification\manager $phpbb_notifications + * @param \phpbb\template\template $template + * @param \phpbb\user $user + * @param string $block + */ + public function output_notification_methods(\phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user, $block = 'notification_methods') + { + $notification_methods = $phpbb_notifications->get_subscription_methods(); + + foreach($notification_methods as $method => $method_data) + { + $template->assign_block_vars($block, array( + 'METHOD' => $method_data['id'], + + 'NAME' => $user->lang($method_data['lang']), + )); + } + } +} diff --git a/sources/phpBB/includes/ucp/ucp_pm.php b/sources/phpBB/includes/ucp/ucp_pm.php new file mode 100644 index 0000000..425a56c --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_pm.php @@ -0,0 +1,411 @@ + +* @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; +} + +/** +* Private Message Class +* +* $_REQUEST['folder'] display folder with the id used +* $_REQUEST['folder'] inbox|outbox|sentbox display folder with the associated name +* +* Display Messages (default to inbox) - mode=view +* Display single message - mode=view&p=[msg_id] or &p=[msg_id] (short linkage) +* +* if the folder id with (&f=[folder_id]) is used when displaying messages, one query will be saved. If it is not used, phpBB needs to grab +* the folder id first in order to display the input boxes and folder names and such things. ;) phpBB always checks this against the database to make +* sure the user is able to view the message. +* +* Composing Messages (mode=compose): +* To specific user (u=[user_id]) +* To specific group (g=[group_id]) +* Quoting a post (action=quotepost&p=[post_id]) +* Quoting a PM (action=quote&p=[msg_id]) +* Forwarding a PM (action=forward&p=[msg_id]) +*/ +class ucp_pm +{ + var $u_action; + + function main($id, $mode) + { + global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $config, $request; + + if (!$user->data['is_registered']) + { + trigger_error('NO_MESSAGE'); + } + + // Is PM disabled? + if (!$config['allow_privmsg']) + { + trigger_error('PM_DISABLED'); + } + + $user->add_lang('posting'); + $template->assign_var('S_PRIVMSGS', true); + + // Folder directly specified? + $folder_specified = request_var('folder', ''); + + if (!in_array($folder_specified, array('inbox', 'outbox', 'sentbox'))) + { + $folder_specified = (int) $folder_specified; + } + else + { + $folder_specified = ($folder_specified == 'inbox') ? PRIVMSGS_INBOX : (($folder_specified == 'outbox') ? PRIVMSGS_OUTBOX : PRIVMSGS_SENTBOX); + } + + if (!$folder_specified) + { + $mode = (!$mode) ? request_var('mode', 'view') : $mode; + } + else + { + $mode = 'view'; + } + + include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + + switch ($mode) + { + // Compose message + case 'compose': + $action = request_var('action', 'post'); + + $user_folders = get_folder($user->data['user_id']); + + if (!$auth->acl_get('u_sendpm')) + { + // trigger_error('NO_AUTH_SEND_MESSAGE'); + $template->assign_vars(array( + 'S_NO_AUTH_SEND_MESSAGE' => true, + 'S_COMPOSE_PM_VIEW' => true, + )); + + $tpl_file = 'ucp_pm_viewfolder'; + break; + } + + include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx); + compose_pm($id, $mode, $action, $user_folders); + + $tpl_file = 'posting_body'; + break; + + case 'options': + set_user_message_limit(); + get_folder($user->data['user_id']); + + include($phpbb_root_path . 'includes/ucp/ucp_pm_options.' . $phpEx); + message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions); + + $tpl_file = 'ucp_pm_options'; + break; + + case 'drafts': + + get_folder($user->data['user_id']); + $this->p_name = 'pm'; + + // Call another module... please do not try this at home... Hoochie Coochie Man + include($phpbb_root_path . 'includes/ucp/ucp_main.' . $phpEx); + + $module = new ucp_main($this); + $module->u_action = $this->u_action; + $module->main($id, $mode); + + $this->tpl_name = $module->tpl_name; + $this->page_title = 'UCP_PM_DRAFTS'; + + unset($module); + return; + + break; + + case 'view': + + set_user_message_limit(); + + if ($folder_specified) + { + $folder_id = $folder_specified; + $action = 'view_folder'; + } + else + { + $folder_id = request_var('f', PRIVMSGS_NO_BOX); + $action = request_var('action', 'view_folder'); + } + + $msg_id = request_var('p', 0); + $view = request_var('view', ''); + + // View message if specified + if ($msg_id) + { + $action = 'view_message'; + } + + if (!$auth->acl_get('u_readpm')) + { + trigger_error('NO_AUTH_READ_MESSAGE'); + } + + // Do not allow hold messages to be seen + if ($folder_id == PRIVMSGS_HOLD_BOX) + { + trigger_error('NO_AUTH_READ_HOLD_MESSAGE'); + } + + // First Handle Mark actions and moving messages + $submit_mark = (isset($_POST['submit_mark'])) ? true : false; + $move_pm = (isset($_POST['move_pm'])) ? true : false; + $mark_option = request_var('mark_option', ''); + $dest_folder = request_var('dest_folder', PRIVMSGS_NO_BOX); + + // Is moving PM triggered through mark options? + if (!in_array($mark_option, array('mark_important', 'delete_marked')) && $submit_mark) + { + $move_pm = true; + $dest_folder = (int) $mark_option; + $submit_mark = false; + } + + // 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); + + if (move_pm($user->data['user_id'], $user->data['message_limit'], $move_msg_ids, $dest_folder, $cur_folder_id)) + { + // Return to folder view if single message moved + if ($action == 'view_message') + { + $msg_id = 0; + $folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX); + $action = 'view_folder'; + } + } + } + + // Message Mark Options + if ($submit_mark) + { + handle_mark_actions($user->data['user_id'], $mark_option); + } + + // If new messages arrived, place them into the appropriate folder + $num_not_moved = $num_removed = 0; + $release = request_var('release', 0); + + if ($user->data['user_new_privmsg'] && ($action == 'view_folder' || $action == 'view_message')) + { + $return = place_pm_into_folder($global_privmsgs_rules, $release); + $num_not_moved = $return['not_moved']; + $num_removed = $return['removed']; + } + + if (!$msg_id && $folder_id == PRIVMSGS_NO_BOX) + { + $folder_id = PRIVMSGS_INBOX; + } + else if ($msg_id && $folder_id == PRIVMSGS_NO_BOX) + { + $sql = 'SELECT folder_id + FROM ' . PRIVMSGS_TO_TABLE . " + WHERE msg_id = $msg_id + AND folder_id <> " . PRIVMSGS_NO_BOX . ' + AND user_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + trigger_error('NO_MESSAGE'); + } + $folder_id = (int) $row['folder_id']; + } + + if ($request->variable('mark', '') == 'all' && check_link_hash($request->variable('token', ''), 'mark_all_pms_read')) + { + mark_folder_read($user->data['user_id'], $folder_id); + + meta_refresh(3, $this->u_action); + $message = $user->lang['PM_MARK_ALL_READ_SUCCESS']; + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response(); + $json_response->send(array( + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $message, + 'success' => true, + )); + } + $message .= '

' . $user->lang('RETURN_UCP', '', ''); + + trigger_error($message); + } + + $message_row = array(); + if ($action == 'view_message' && $msg_id) + { + // Get Message user want to see + if ($view == 'next' || $view == 'previous') + { + $sql_condition = ($view == 'next') ? '>' : '<'; + $sql_ordering = ($view == 'next') ? 'ASC' : 'DESC'; + + $sql = 'SELECT t.msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . PRIVMSGS_TABLE . " p2 + WHERE p2.msg_id = $msg_id + AND t.folder_id = $folder_id + AND t.user_id = " . $user->data['user_id'] . " + AND t.msg_id = p.msg_id + AND p.message_time $sql_condition p2.message_time + ORDER BY p.message_time $sql_ordering"; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + $message = ($view == 'next') ? 'NO_NEWER_PM' : 'NO_OLDER_PM'; + trigger_error($message); + } + else + { + $msg_id = $row['msg_id']; + } + } + + $sql = 'SELECT t.*, p.*, u.* + FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . ' u + WHERE t.user_id = ' . $user->data['user_id'] . " + AND p.author_id = u.user_id + AND t.folder_id = $folder_id + AND t.msg_id = p.msg_id + AND p.msg_id = $msg_id"; + $result = $db->sql_query($sql); + $message_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$message_row) + { + trigger_error('NO_MESSAGE'); + } + + // Update unread status + update_unread_status($message_row['pm_unread'], $message_row['msg_id'], $user->data['user_id'], $folder_id); + } + + $folder = get_folder($user->data['user_id'], $folder_id); + + $s_folder_options = $s_to_folder_options = ''; + foreach ($folder as $f_id => $folder_ary) + { + $option = '' . $folder_ary['folder_name'] . (($folder_ary['unread_messages']) ? ' [' . $folder_ary['unread_messages'] . '] ' : '') . ''; + + $s_to_folder_options .= ($f_id != PRIVMSGS_OUTBOX && $f_id != PRIVMSGS_SENTBOX) ? $option : ''; + $s_folder_options .= $option; + } + clean_sentbox($folder[PRIVMSGS_SENTBOX]['num_messages']); + + // Header for message view - folder and so on + $folder_status = get_folder_status($folder_id, $folder); + + $template->assign_vars(array( + 'CUR_FOLDER_ID' => $folder_id, + 'CUR_FOLDER_NAME' => $folder_status['folder_name'], + 'NUM_NOT_MOVED' => $num_not_moved, + 'NUM_REMOVED' => $num_removed, + 'RELEASE_MESSAGE_INFO' => sprintf($user->lang['RELEASE_MESSAGES'], '', ''), + 'NOT_MOVED_MESSAGES' => $user->lang('NOT_MOVED_MESSAGES', (int) $num_not_moved), + 'RULE_REMOVED_MESSAGES' => $user->lang('RULE_REMOVED_MESSAGES', (int) $num_removed), + + 'S_FOLDER_OPTIONS' => $s_folder_options, + 'S_TO_FOLDER_OPTIONS' => $s_to_folder_options, + 'S_FOLDER_ACTION' => $this->u_action . '&action=view_folder', + 'S_PM_ACTION' => $this->u_action . '&action=' . $action, + + 'U_INBOX' => $this->u_action . '&folder=inbox', + 'U_OUTBOX' => $this->u_action . '&folder=outbox', + 'U_SENTBOX' => $this->u_action . '&folder=sentbox', + 'U_CREATE_FOLDER' => $this->u_action . '&mode=options', + 'U_CURRENT_FOLDER' => $this->u_action . '&folder=' . $folder_id, + 'U_MARK_ALL' => $this->u_action . '&folder=' . $folder_id . '&mark=all&token=' . generate_link_hash('mark_all_pms_read'), + + 'S_IN_INBOX' => ($folder_id == PRIVMSGS_INBOX) ? true : false, + 'S_IN_OUTBOX' => ($folder_id == PRIVMSGS_OUTBOX) ? true : false, + 'S_IN_SENTBOX' => ($folder_id == PRIVMSGS_SENTBOX) ? true : false, + + 'FOLDER_STATUS' => $folder_status['message'], + 'FOLDER_MAX_MESSAGES' => $folder_status['max'], + 'FOLDER_CUR_MESSAGES' => $folder_status['cur'], + 'FOLDER_REMAINING_MESSAGES' => $folder_status['remaining'], + 'FOLDER_PERCENT' => $folder_status['percent']) + ); + + if ($action == 'view_folder') + { + include($phpbb_root_path . 'includes/ucp/ucp_pm_viewfolder.' . $phpEx); + view_folder($id, $mode, $folder_id, $folder); + + $tpl_file = 'ucp_pm_viewfolder'; + } + else if ($action == 'view_message') + { + $template->assign_vars(array( + 'S_VIEW_MESSAGE' => true, + 'L_RETURN_TO_FOLDER' => $user->lang('RETURN_TO', $folder_status['folder_name']), + 'MSG_ID' => $msg_id, + )); + + if (!$msg_id) + { + trigger_error('NO_MESSAGE'); + } + + include($phpbb_root_path . 'includes/ucp/ucp_pm_viewmessage.' . $phpEx); + view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row); + + $tpl_file = ($view == 'print') ? 'ucp_pm_viewmessage_print' : 'ucp_pm_viewmessage'; + } + + break; + + default: + trigger_error('NO_ACTION_MODE', E_USER_ERROR); + break; + } + + $template->assign_vars(array( + 'L_TITLE' => $user->lang['UCP_PM_' . strtoupper($mode)], + 'S_UCP_ACTION' => $this->u_action . ((isset($action)) ? "&action=$action" : '')) + ); + + // Set desired template + $this->tpl_name = $tpl_file; + $this->page_title = 'UCP_PM_' . strtoupper($mode); + } +} diff --git a/sources/phpBB/includes/ucp/ucp_pm_compose.php b/sources/phpBB/includes/ucp/ucp_pm_compose.php new file mode 100644 index 0000000..f3b5918 --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_pm_compose.php @@ -0,0 +1,1433 @@ + +* @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; +} + +/** +* Compose private message +* Called from ucp_pm with mode == 'compose' +*/ +function compose_pm($id, $mode, $action, $user_folders = array()) +{ + global $template, $db, $auth, $user, $cache; + global $phpbb_root_path, $phpEx, $config; + global $request, $phpbb_dispatcher, $phpbb_container; + + // Damn php and globals - i know, this is horrible + // Needed for handle_message_list_actions() + global $refresh, $submit, $preview; + + include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + include($phpbb_root_path . 'includes/message_parser.' . $phpEx); + + if (!$action) + { + $action = 'post'; + } + 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); + + // Reply to all triggered (quote/reply) + $reply_to_all = request_var('reply_to_all', 0); + + $address_list = $request->variable('address_list', array('' => array(0 => ''))); + + $submit = (isset($_POST['post'])) ? true : false; + $preview = (isset($_POST['preview'])) ? true : false; + $save = (isset($_POST['save'])) ? true : false; + $load = (isset($_POST['load'])) ? true : false; + $cancel = (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false; + $delete = (isset($_POST['delete'])) ? true : false; + + $remove_u = (isset($_REQUEST['remove_u'])) ? true : false; + $remove_g = (isset($_REQUEST['remove_g'])) ? true : false; + $add_to = (isset($_REQUEST['add_to'])) ? true : false; + $add_bcc = (isset($_REQUEST['add_bcc'])) ? true : false; + + $refresh = isset($_POST['add_file']) || isset($_POST['delete_file']) || $save || $load + || $remove_u || $remove_g || $add_to || $add_bcc; + + $action = ($delete && !$preview && !$refresh && $submit) ? 'delete' : $action; + $select_single = ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? false : true; + + $error = array(); + $current_time = time(); + + // Was cancel pressed? If so then redirect to the appropriate page + if ($cancel || ($current_time - $lastclick < 2 && $submit)) + { + if ($msg_id) + { + redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=view&action=view_message&p=' . $msg_id)); + } + redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm')); + } + + // Since viewtopic.php language entries are used in several modes, + // we include the language file here + $user->add_lang('viewtopic'); + + // Output PM_TO box if message composing + if ($action != 'edit') + { + // Add groups to PM box + if ($config['allow_mass_pm'] && $auth->acl_get('u_masspm_group')) + { + $sql = 'SELECT g.group_id, g.group_name, g.group_type + FROM ' . GROUPS_TABLE . ' g'; + + if (!$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) + { + $sql .= ' LEFT JOIN ' . USER_GROUP_TABLE . ' ug + ON ( + g.group_id = ug.group_id + AND ug.user_id = ' . $user->data['user_id'] . ' + AND ug.user_pending = 0 + ) + WHERE (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')'; + } + + $sql .= ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? ' WHERE ' : ' AND '; + + $sql .= 'g.group_receive_pm = 1 + ORDER BY g.group_type DESC, g.group_name ASC'; + $result = $db->sql_query($sql); + + $group_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $group_options .= '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; + } + $db->sql_freeresult($result); + } + + $template->assign_vars(array( + 'S_SHOW_PM_BOX' => true, + 'S_ALLOW_MASS_PM' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? true : false, + 'S_GROUP_OPTIONS' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm_group')) ? $group_options : '', + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&form=postform&field=username_list&select_single=$select_single"), + )); + } + + $sql = ''; + $folder_id = 0; + + // What is all this following SQL for? Well, we need to know + // some basic information in all cases before we do anything. + switch ($action) + { + case 'post': + if (!$auth->acl_get('u_sendpm')) + { + trigger_error('NO_AUTH_SEND_MESSAGE'); + } + break; + + case 'reply': + case 'quote': + case 'forward': + case 'quotepost': + if (!$msg_id) + { + trigger_error('NO_MESSAGE'); + } + + if (!$auth->acl_get('u_sendpm')) + { + trigger_error('NO_AUTH_SEND_MESSAGE'); + } + + if ($action == 'quotepost') + { + $sql = 'SELECT p.post_id as msg_id, p.forum_id, p.post_text as message_text, p.poster_id as author_id, p.post_time as message_time, p.bbcode_bitfield, p.bbcode_uid, p.enable_sig, p.enable_smilies, p.enable_magic_url, t.topic_title as message_subject, u.username as quote_username + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . " u + WHERE p.post_id = $msg_id + AND t.topic_id = p.topic_id + AND u.user_id = p.poster_id"; + } + else + { + $sql = 'SELECT t.folder_id, p.*, u.username as quote_username + FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . ' u + WHERE t.user_id = ' . $user->data['user_id'] . " + AND p.author_id = u.user_id + AND t.msg_id = p.msg_id + AND p.msg_id = $msg_id"; + } + break; + + case 'edit': + if (!$msg_id) + { + trigger_error('NO_MESSAGE'); + } + + // check for outbox (not read) status, we do not allow editing if one user already having the message + $sql = 'SELECT p.*, t.folder_id + FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p + WHERE t.user_id = ' . $user->data['user_id'] . ' + AND t.folder_id = ' . PRIVMSGS_OUTBOX . " + AND t.msg_id = $msg_id + AND t.msg_id = p.msg_id"; + break; + + case 'delete': + if (!$auth->acl_get('u_pm_delete')) + { + trigger_error('NO_AUTH_DELETE_MESSAGE'); + } + + if (!$msg_id) + { + trigger_error('NO_MESSAGE'); + } + + $sql = 'SELECT msg_id, pm_unread, pm_new, author_id, folder_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . " + AND msg_id = $msg_id"; + break; + + case 'smilies': + generate_smilies('window', 0); + break; + + default: + trigger_error('NO_ACTION_MODE', E_USER_ERROR); + break; + } + + if ($action == 'forward' && (!$config['forward_pm'] || !$auth->acl_get('u_pm_forward'))) + { + trigger_error('NO_AUTH_FORWARD_MESSAGE'); + } + + if ($action == 'edit' && !$auth->acl_get('u_pm_edit')) + { + trigger_error('NO_AUTH_EDIT_MESSAGE'); + } + + if ($sql) + { + /** + * Alter sql query to get message for user to write the PM + * + * @event core.ucp_pm_compose_compose_pm_basic_info_query_before + * @var string sql String with the query to be executed + * @var array forum_list List of forums that contain the posts + * @var int visibility_const Integer with one of the possible ITEM_* constant values + * @var int msg_id topic_id in the page request + * @var int to_user_id The id of whom the message is to + * @var int to_group_id The id of the group whom the message is to + * @var bool submit Whether the user is sending the PM or not + * @var bool preview Whether the user is previewing the PM or not + * @var string action One of: post, reply, quote, forward, quotepost, edit, delete, smilies + * @var bool delete Whether the user is deleting the PM + * @var int reply_to_all Value of reply_to_all request variable. + * @var string limit_time_sql String with the SQL code to limit the time interval of the post (Note: May be empty string) + * @var string sort_order_sql String with the ORDER BY SQL code used in this query + * @since 3.1.0-RC5 + */ + $vars = array( + 'sql', + 'forum_list', + 'visibility_const', + 'msg_id', + 'to_user_id', + 'to_group_id', + 'submit', + 'preview', + 'action', + 'delete', + 'reply_to_all', + 'limit_time_sql', + 'sort_order_sql', + ); + extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_compose_pm_basic_info_query_before', compact($vars))); + + $result = $db->sql_query($sql); + $post = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$post) + { + // If editing it could be the recipient already read the message... + if ($action == 'edit') + { + $sql = 'SELECT p.*, t.folder_id + FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p + WHERE t.user_id = ' . $user->data['user_id'] . " + AND t.msg_id = $msg_id + AND t.msg_id = p.msg_id"; + $result = $db->sql_query($sql); + $post = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($post) + { + trigger_error('NO_EDIT_READ_MESSAGE'); + } + } + + trigger_error('NO_MESSAGE'); + } + + if ($action == 'quotepost') + { + if (($post['forum_id'] && !$auth->acl_get('f_read', $post['forum_id'])) || (!$post['forum_id'] && !$auth->acl_getf_global('f_read'))) + { + trigger_error('NOT_AUTHORISED'); + } + + /** + * Get the result of querying for the post to be quoted in the pm message + * + * @event core.ucp_pm_compose_quotepost_query_after + * @var string sql The original SQL used in the query + * @var array post Associative array with the data of the quoted post + * @var array msg_id The post_id that was searched to get the message for quoting + * @var int visibility_const Visibility of the quoted post (one of the possible ITEM_* constant values) + * @var int topic_id Topic ID of the quoted post + * @var int to_user_id Users the message is sent to + * @var int to_group_id Groups the message is sent to + * @var bool submit Whether the user is sending the PM or not + * @var bool preview Whether the user is previewing the PM or not + * @var string action One of: post, reply, quote, forward, quotepost, edit, delete, smilies + * @var bool delete If deleting message + * @var int reply_to_all Value of reply_to_all request variable. + * @since 3.1.0-RC5 + */ + $vars = array( + 'sql', + 'post', + 'msg_id', + 'visibility_const', + 'topic_id', + 'to_user_id', + 'to_group_id', + 'submit', + 'preview', + 'action', + 'delete', + 'reply_to_all', + ); + extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_quotepost_query_after', compact($vars))); + + // Passworded forum? + if ($post['forum_id']) + { + $sql = 'SELECT forum_id, forum_name, forum_password + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . (int) $post['forum_id']; + $result = $db->sql_query($sql); + $forum_data = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!empty($forum_data['forum_password'])) + { + login_forum_box($forum_data); + } + } + } + + $msg_id = (int) $post['msg_id']; + $folder_id = (isset($post['folder_id'])) ? $post['folder_id'] : 0; + $message_text = (isset($post['message_text'])) ? $post['message_text'] : ''; + + if ((!$post['author_id'] || ($post['author_id'] == ANONYMOUS && $action != 'delete')) && $msg_id) + { + trigger_error('NO_AUTHOR'); + } + + if ($action == 'quotepost') + { + // Decode text for message display + decode_message($message_text, $post['bbcode_uid']); + } + + if ($action != 'delete') + { + $enable_urls = $post['enable_magic_url']; + $enable_sig = (isset($post['enable_sig'])) ? $post['enable_sig'] : 0; + + $message_attachment = (isset($post['message_attachment'])) ? $post['message_attachment'] : 0; + $message_subject = $post['message_subject']; + $message_time = $post['message_time']; + $bbcode_uid = $post['bbcode_uid']; + + $quote_username = (isset($post['quote_username'])) ? $post['quote_username'] : ''; + $icon_id = (isset($post['icon_id'])) ? $post['icon_id'] : 0; + + if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !sizeof($address_list) && !$refresh && !$submit && !$preview) + { + // Add the original author as the recipient if quoting a post or only replying and not having checked "reply to all" + if ($action == 'quotepost' || !$reply_to_all) + { + $address_list = array('u' => array($post['author_id'] => 'to')); + } + else + { + // We try to include every previously listed member from the TO Header - Reply to all + $address_list = rebuild_header(array('to' => $post['to_address'])); + + // Add the author (if he is already listed then this is no shame (it will be overwritten)) + $address_list['u'][$post['author_id']] = 'to'; + + // Now, make sure the user itself is not listed. ;) + if (isset($address_list['u'][$user->data['user_id']])) + { + unset($address_list['u'][$user->data['user_id']]); + } + } + } + else if ($action == 'edit' && !sizeof($address_list) && !$refresh && !$submit && !$preview) + { + // Rebuild TO and BCC Header + $address_list = rebuild_header(array('to' => $post['to_address'], 'bcc' => $post['bcc_address'])); + } + + if ($action == 'quotepost') + { + $check_value = 0; + } + else + { + $check_value = (($post['enable_bbcode']+1) << 8) + (($post['enable_smilies']+1) << 4) + (($enable_urls+1) << 2) + (($post['enable_sig']+1) << 1); + } + } + } + else + { + $message_attachment = 0; + $message_text = $message_subject = ''; + + if ($to_user_id && $to_user_id != ANONYMOUS && $action == 'post') + { + $address_list['u'][$to_user_id] = 'to'; + } + else if ($to_group_id && $action == 'post') + { + $address_list['g'][$to_group_id] = 'to'; + } + $check_value = 0; + } + + if (($to_group_id || isset($address_list['g'])) && (!$config['allow_mass_pm'] || !$auth->acl_get('u_masspm_group'))) + { + trigger_error('NO_AUTH_GROUP_MESSAGE'); + } + + if ($action == 'edit' && !$refresh && !$preview && !$submit) + { + if (!($message_time > time() - ($config['pm_edit_time'] * 60) || !$config['pm_edit_time'])) + { + trigger_error('CANNOT_EDIT_MESSAGE_TIME'); + } + } + + if ($action == 'post') + { + $template->assign_var('S_NEW_MESSAGE', true); + } + + if (!isset($icon_id)) + { + $icon_id = 0; + } + + $message_parser = new parse_message(); + $plupload = $phpbb_container->get('plupload'); + $message_parser->set_plupload($plupload); + + $message_parser->message = ($action == 'reply') ? '' : $message_text; + unset($message_text); + + $s_action = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=$mode&action=$action", true, $user->session_id); + $s_action .= (($folder_id) ? "&f=$folder_id" : '') . (($msg_id) ? "&p=$msg_id" : ''); + + // Delete triggered ? + if ($action == 'delete') + { + // Folder id has been determined by the SQL Statement + // $folder_id = request_var('f', PRIVMSGS_NO_BOX); + + // Do we need to confirm ? + if (confirm_box(true)) + { + delete_pm($user->data['user_id'], $msg_id, $folder_id); + + // jump to next message in "history"? nope, not for the moment. But able to be included later. + $meta_info = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&folder=$folder_id"); + $message = $user->lang['MESSAGE_DELETED']; + + meta_refresh(3, $meta_info); + $message .= '

' . sprintf($user->lang['RETURN_FOLDER'], '', ''); + trigger_error($message); + } + else + { + $s_hidden_fields = array( + 'p' => $msg_id, + 'f' => $folder_id, + 'action' => 'delete' + ); + + // "{$phpbb_root_path}ucp.$phpEx?i=pm&mode=compose" + confirm_box(false, 'DELETE_MESSAGE', build_hidden_fields($s_hidden_fields)); + } + + redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=view&action=view_message&p=' . $msg_id)); + } + + // 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 = (!$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 + if (($action == 'reply' || $action == 'quote') && $max_recipients && $reply_to_all) + { + // We try to include every previously listed member from the TO Header + $list = rebuild_header(array('to' => $post['to_address'])); + + // Can be an empty array too ;) + $list = (!empty($list['u'])) ? $list['u'] : array(); + $list[$post['author_id']] = 'to'; + + if (isset($list[$user->data['user_id']])) + { + unset($list[$user->data['user_id']]); + } + + $max_recipients = ($max_recipients < sizeof($list)) ? sizeof($list) : $max_recipients; + + unset($list); + } + + // Handle User/Group adding/removing + handle_message_list_actions($address_list, $error, $remove_u, $remove_g, $add_to, $add_bcc); + + // Check mass pm to group permission + if ((!$config['allow_mass_pm'] || !$auth->acl_get('u_masspm_group')) && !empty($address_list['g'])) + { + $address_list = array(); + $error[] = $user->lang['NO_AUTH_GROUP_MESSAGE']; + } + + // Check mass pm to users permission + if ((!$config['allow_mass_pm'] || !$auth->acl_get('u_masspm')) && num_recipients($address_list) > 1) + { + $address_list = get_recipients($address_list, 1); + $error[] = $user->lang('TOO_MANY_RECIPIENTS', 1); + } + + // Check for too many recipients + if (!empty($address_list['u']) && $max_recipients && sizeof($address_list['u']) > $max_recipients) + { + $address_list = get_recipients($address_list, $max_recipients); + $error[] = $user->lang('TOO_MANY_RECIPIENTS', $max_recipients); + } + + // Always check if the submitted attachment data is valid and belongs to the user. + // Further down (especially in submit_post()) we do not check this again. + $message_parser->get_submitted_attachment_data(); + + if ($message_attachment && !$submit && !$refresh && !$preview && $action == 'edit') + { + // Do not change to SELECT * + $sql = 'SELECT attach_id, is_orphan, attach_comment, real_filename, filesize + FROM ' . ATTACHMENTS_TABLE . " + WHERE post_msg_id = $msg_id + AND in_message = 1 + AND is_orphan = 0 + ORDER BY filetime DESC"; + $result = $db->sql_query($sql); + $message_parser->attachment_data = array_merge($message_parser->attachment_data, $db->sql_fetchrowset($result)); + $db->sql_freeresult($result); + } + + if (!in_array($action, array('quote', 'edit', 'delete', 'forward'))) + { + $enable_sig = ($config['allow_sig'] && $config['allow_sig_pm'] && $auth->acl_get('u_sig') && $user->optionget('attachsig')); + $enable_smilies = ($config['allow_smilies'] && $auth->acl_get('u_pm_smilies') && $user->optionget('smilies')); + $enable_bbcode = ($config['allow_bbcode'] && $auth->acl_get('u_pm_bbcode') && $user->optionget('bbcode')); + $enable_urls = true; + } + + $enable_magic_url = $drafts = false; + + // User own some drafts? + if ($auth->acl_get('u_savedrafts') && $action != 'delete') + { + $sql = 'SELECT draft_id + FROM ' . DRAFTS_TABLE . ' + WHERE forum_id = 0 + AND topic_id = 0 + AND user_id = ' . $user->data['user_id'] . + (($draft_id) ? " AND draft_id <> $draft_id" : ''); + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $drafts = true; + } + } + + if ($action == 'edit') + { + $message_parser->bbcode_uid = $bbcode_uid; + } + + $bbcode_status = ($config['allow_bbcode'] && $config['auth_bbcode_pm'] && $auth->acl_get('u_pm_bbcode')) ? true : false; + $smilies_status = ($config['allow_smilies'] && $config['auth_smilies_pm'] && $auth->acl_get('u_pm_smilies')) ? true : false; + $img_status = ($config['auth_img_pm'] && $auth->acl_get('u_pm_img')) ? true : false; + $flash_status = ($config['auth_flash_pm'] && $auth->acl_get('u_pm_flash')) ? true : false; + $url_status = ($config['allow_post_links']) ? true : false; + + // Save Draft + if ($save && $auth->acl_get('u_savedrafts')) + { + $subject = utf8_normalize_nfc(request_var('subject', '', true)); + $subject = (!$subject && $action != 'post') ? $user->lang['NEW_MESSAGE'] : $subject; + $message = utf8_normalize_nfc(request_var('message', '', true)); + + if ($subject && $message) + { + if (confirm_box(true)) + { + $sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'user_id' => $user->data['user_id'], + 'topic_id' => 0, + 'forum_id' => 0, + 'save_time' => $current_time, + 'draft_subject' => $subject, + 'draft_message' => $message + ) + ); + $db->sql_query($sql); + + $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=$mode"); + + meta_refresh(3, $redirect_url); + $message = $user->lang['DRAFT_SAVED'] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + + trigger_error($message); + } + else + { + $s_hidden_fields = build_hidden_fields(array( + 'mode' => $mode, + 'action' => $action, + 'save' => true, + 'subject' => $subject, + 'message' => $message, + 'u' => $to_user_id, + 'g' => $to_group_id, + 'p' => $msg_id) + ); + $s_hidden_fields .= build_address_field($address_list); + + confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields); + } + } + else + { + if (utf8_clean_string($subject) === '') + { + $error[] = $user->lang['EMPTY_MESSAGE_SUBJECT']; + } + + if (utf8_clean_string($message) === '') + { + $error[] = $user->lang['TOO_FEW_CHARS']; + } + } + + unset($subject, $message); + } + + // Load Draft + if ($draft_id && $auth->acl_get('u_savedrafts')) + { + $sql = 'SELECT draft_subject, draft_message + FROM ' . DRAFTS_TABLE . " + WHERE draft_id = $draft_id + AND topic_id = 0 + AND forum_id = 0 + AND user_id = " . $user->data['user_id']; + $result = $db->sql_query_limit($sql, 1); + + if ($row = $db->sql_fetchrow($result)) + { + $message_parser->message = $row['draft_message']; + $message_subject = $row['draft_subject']; + + $template->assign_var('S_DRAFT_LOADED', true); + } + else + { + $draft_id = 0; + } + $db->sql_freeresult($result); + } + + // Load Drafts + if ($load && $drafts) + { + load_drafts(0, 0, $id, $action, $msg_id); + } + + if ($submit || $preview || $refresh) + { + if (($submit || $preview) && !check_form_key('ucp_pm_compose')) + { + $error[] = $user->lang['FORM_INVALID']; + } + $subject = utf8_normalize_nfc(request_var('subject', '', true)); + $message_parser->message = utf8_normalize_nfc(request_var('message', '', true)); + + $icon_id = request_var('icon', 0); + + $enable_bbcode = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true; + $enable_smilies = (!$smilies_status || isset($_POST['disable_smilies'])) ? false : true; + $enable_urls = (isset($_POST['disable_magic_url'])) ? 0 : 1; + $enable_sig = (!$config['allow_sig'] ||!$config['allow_sig_pm']) ? false : ((isset($_POST['attach_sig'])) ? true : false); + + if ($submit) + { + $status_switch = (($enable_bbcode+1) << 8) + (($enable_smilies+1) << 4) + (($enable_urls+1) << 2) + (($enable_sig+1) << 1); + $status_switch = ($status_switch != $check_value); + } + else + { + $status_switch = 1; + } + + // Parse Attachments - before checksum is calculated + $message_parser->parse_attachments('fileupload', $action, 0, $submit, $preview, $refresh, true); + + if (sizeof($message_parser->warn_msg) && !($remove_u || $remove_g || $add_to || $add_bcc)) + { + $error[] = implode('
', $message_parser->warn_msg); + $message_parser->warn_msg = array(); + } + + // Parse message + $message_parser->parse($enable_bbcode, ($config['allow_post_links']) ? $enable_urls : false, $enable_smilies, $img_status, $flash_status, true, $config['allow_post_links']); + + // On a refresh we do not care about message parsing errors + if (sizeof($message_parser->warn_msg) && !$refresh) + { + $error[] = implode('
', $message_parser->warn_msg); + } + + if ($action != 'edit' && !$preview && !$refresh && $config['flood_interval'] && !$auth->acl_get('u_ignoreflood')) + { + // Flood check + $last_post_time = $user->data['user_lastpost_time']; + + if ($last_post_time) + { + if ($last_post_time && ($current_time - $last_post_time) < intval($config['flood_interval'])) + { + $error[] = $user->lang['FLOOD_ERROR']; + } + } + } + + // Subject defined + if ($submit) + { + if (utf8_clean_string($subject) === '') + { + $error[] = $user->lang['EMPTY_MESSAGE_SUBJECT']; + } + + if (!sizeof($address_list)) + { + $error[] = $user->lang['NO_RECIPIENT']; + } + } + + // Store message, sync counters + if (!sizeof($error) && $submit) + { + $pm_data = array( + 'msg_id' => (int) $msg_id, + 'from_user_id' => $user->data['user_id'], + 'from_user_ip' => $user->ip, + 'from_username' => $user->data['username'], + 'reply_from_root_level' => (isset($post['root_level'])) ? (int) $post['root_level'] : 0, + 'reply_from_msg_id' => (int) $msg_id, + 'icon_id' => (int) $icon_id, + 'enable_sig' => (bool) $enable_sig, + 'enable_bbcode' => (bool) $enable_bbcode, + 'enable_smilies' => (bool) $enable_smilies, + 'enable_urls' => (bool) $enable_urls, + 'bbcode_bitfield' => $message_parser->bbcode_bitfield, + 'bbcode_uid' => $message_parser->bbcode_uid, + 'message' => $message_parser->message, + 'attachment_data' => $message_parser->attachment_data, + 'filename_data' => $message_parser->filename_data, + 'address_list' => $address_list + ); + + // ((!$message_subject) ? $subject : $message_subject) + $msg_id = submit_pm($action, $subject, $pm_data); + + $return_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=view&p=' . $msg_id); + $inbox_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'); + $outbox_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=outbox'); + + $folder_url = ''; + if (($folder_id > 0) && isset($user_folders[$folder_id])) + { + $folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $folder_id); + } + + $return_box_url = ($action === 'post' || $action === 'edit') ? $outbox_folder_url : $inbox_folder_url; + $return_box_lang = ($action === 'post' || $action === 'edit') ? 'PM_OUTBOX' : 'PM_INBOX'; + + $save_message = ($action === 'edit') ? $user->lang['MESSAGE_EDITED'] : $user->lang['MESSAGE_STORED']; + $message = $save_message . '

' . $user->lang('VIEW_PRIVATE_MESSAGE', '', ''); + + $last_click_type = 'CLICK_RETURN_FOLDER'; + if ($folder_url) + { + $message .= '

' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '', '', $user_folders[$folder_id]['folder_name']); + $last_click_type = 'CLICK_GOTO_FOLDER'; + } + $message .= '

' . sprintf($user->lang[$last_click_type], '', '', $user->lang[$return_box_lang]); + + meta_refresh(3, $return_message_url); + trigger_error($message); + } + + $message_subject = $subject; + } + + // Preview + if (!sizeof($error) && $preview) + { + $preview_message = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false); + + $preview_signature = $user->data['user_sig']; + $preview_signature_uid = $user->data['user_sig_bbcode_uid']; + $preview_signature_bitfield = $user->data['user_sig_bbcode_bitfield']; + + // Signature + if ($enable_sig && $config['allow_sig'] && $preview_signature) + { + $parse_sig = new parse_message($preview_signature); + $parse_sig->bbcode_uid = $preview_signature_uid; + $parse_sig->bbcode_bitfield = $preview_signature_bitfield; + + $parse_sig->format_display($config['allow_sig_bbcode'], $config['allow_sig_links'], $config['allow_sig_smilies']); + $preview_signature = $parse_sig->message; + unset($parse_sig); + } + else + { + $preview_signature = ''; + } + + // Attachment Preview + if (sizeof($message_parser->attachment_data)) + { + $template->assign_var('S_HAS_ATTACHMENTS', true); + + $update_count = array(); + $attachment_data = $message_parser->attachment_data; + + parse_attachments(false, $preview_message, $attachment_data, $update_count, true); + + foreach ($attachment_data as $i => $attachment) + { + $template->assign_block_vars('attachment', array( + 'DISPLAY_ATTACHMENT' => $attachment) + ); + } + unset($attachment_data); + } + + $preview_subject = censor_text($subject); + + if (!sizeof($error)) + { + $template->assign_vars(array( + 'PREVIEW_SUBJECT' => $preview_subject, + 'PREVIEW_MESSAGE' => $preview_message, + 'PREVIEW_SIGNATURE' => $preview_signature, + + 'S_DISPLAY_PREVIEW' => true) + ); + } + unset($message_text); + } + + // Decode text for message display + $bbcode_uid = (($action == 'quote' || $action == 'forward') && !$preview && !$refresh && (!sizeof($error) || (sizeof($error) && !$submit))) ? $bbcode_uid : $message_parser->bbcode_uid; + + $message_parser->decode_message($bbcode_uid); + + if (($action == 'quote' || $action == 'quotepost') && !$preview && !$refresh && !$submit) + { + if ($action == 'quotepost') + { + $post_id = request_var('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"; + } + else + { + $message_link = $user->lang['SUBJECT'] . $user->lang['COLON'] . ' ' . $message_subject . " (" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id})\n\n"; + } + } + else + { + $message_link = ''; + } + $message_parser->message = $message_link . '[quote="' . $quote_username . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n"; + } + + if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh) + { + $message_subject = ((!preg_match('/^Re:/', $message_subject)) ? 'Re: ' : '') . censor_text($message_subject); + } + + if ($action == 'forward' && !$preview && !$refresh && !$submit) + { + $fwd_to_field = write_pm_addresses(array('to' => $post['to_address']), 0, true); + + if ($config['allow_post_links']) + { + $quote_username_text = '[url=' . generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&u={$post['author_id']}]{$quote_username}[/url]"; + } + else + { + $quote_username_text = $quote_username . ' (' . generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&u={$post['author_id']})"; + } + + $forward_text = array(); + $forward_text[] = $user->lang['FWD_ORIGINAL_MESSAGE']; + $forward_text[] = sprintf($user->lang['FWD_SUBJECT'], censor_text($message_subject)); + $forward_text[] = sprintf($user->lang['FWD_DATE'], $user->format_date($message_time, false, true)); + $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="{$quote_username}"]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]"; + $message_subject = ((!preg_match('/^Fwd:/', $message_subject)) ? 'Fwd: ' : '') . censor_text($message_subject); + } + + $attachment_data = $message_parser->attachment_data; + $filename_data = $message_parser->filename_data; + $message_text = $message_parser->message; + + // MAIN PM PAGE BEGINS HERE + + // Generate smiley listing + generate_smilies('inline', 0); + + // Generate PM Icons + $s_pm_icons = false; + if ($config['enable_pm_icons']) + { + $s_pm_icons = posting_gen_topic_icons($action, $icon_id); + } + + // Generate inline attachment select box + posting_gen_inline_attachments($attachment_data); + + // Build address list for display + // array('u' => array($author_id => 'to')); + if (sizeof($address_list)) + { + // Get Usernames and Group Names + $result = array(); + if (!empty($address_list['u'])) + { + $sql = 'SELECT user_id as id, username as name, user_colour as colour + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', array_map('intval', array_keys($address_list['u']))) . ' + ORDER BY username_clean ASC'; + $result['u'] = $db->sql_query($sql); + } + + if (!empty($address_list['g'])) + { + $sql = 'SELECT g.group_id AS id, g.group_name AS name, g.group_colour AS colour, g.group_type + FROM ' . GROUPS_TABLE . ' g'; + + if (!$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) + { + $sql .= ' LEFT JOIN ' . USER_GROUP_TABLE . ' ug + ON ( + g.group_id = ug.group_id + AND ug.user_id = ' . $user->data['user_id'] . ' + AND ug.user_pending = 0 + ) + WHERE (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')'; + } + + $sql .= ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? ' WHERE ' : ' AND '; + + $sql .= 'g.group_receive_pm = 1 + AND ' . $db->sql_in_set('g.group_id', array_map('intval', array_keys($address_list['g']))) . ' + ORDER BY g.group_name ASC'; + + $result['g'] = $db->sql_query($sql); + } + + $u = $g = array(); + $_types = array('u', 'g'); + foreach ($_types as $type) + { + if (isset($result[$type]) && $result[$type]) + { + while ($row = $db->sql_fetchrow($result[$type])) + { + if ($type == 'g') + { + $row['name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['name']] : $row['name']; + } + + ${$type}[$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']); + } + $db->sql_freeresult($result[$type]); + } + } + + // Now Build the address list + $plain_address_field = ''; + foreach ($address_list as $type => $adr_ary) + { + foreach ($adr_ary as $id => $field) + { + if (!isset(${$type}[$id])) + { + unset($address_list[$type][$id]); + continue; + } + + $field = ($field == 'to') ? 'to' : 'bcc'; + $type = ($type == 'u') ? 'u' : 'g'; + $id = (int) $id; + + $tpl_ary = array( + 'IS_GROUP' => ($type == 'g') ? true : false, + 'IS_USER' => ($type == 'u') ? true : false, + 'UG_ID' => $id, + 'NAME' => ${$type}[$id]['name'], + 'COLOUR' => (${$type}[$id]['colour']) ? '#' . ${$type}[$id]['colour'] : '', + 'TYPE' => $type, + ); + + if ($type == 'u') + { + $tpl_ary = array_merge($tpl_ary, array( + 'U_VIEW' => get_username_string('profile', $id, ${$type}[$id]['name'], ${$type}[$id]['colour']), + 'NAME_FULL' => get_username_string('full', $id, ${$type}[$id]['name'], ${$type}[$id]['colour']), + )); + } + else + { + $tpl_ary = array_merge($tpl_ary, array( + 'U_VIEW' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $id), + )); + } + + $template->assign_block_vars($field . '_recipient', $tpl_ary); + } + } + } + + // Build hidden address list + $s_hidden_address_field = build_address_field($address_list); + + $bbcode_checked = (isset($enable_bbcode)) ? !$enable_bbcode : (($config['allow_bbcode'] && $auth->acl_get('u_pm_bbcode')) ? !$user->optionget('bbcode') : 1); + $smilies_checked = (isset($enable_smilies)) ? !$enable_smilies : (($config['allow_smilies'] && $auth->acl_get('u_pm_smilies')) ? !$user->optionget('smilies') : 1); + $urls_checked = (isset($enable_urls)) ? !$enable_urls : 0; + $sig_checked = $enable_sig; + + switch ($action) + { + case 'post': + $page_title = $user->lang['POST_NEW_PM']; + break; + + case 'quote': + $page_title = $user->lang['POST_QUOTE_PM']; + break; + + case 'quotepost': + $page_title = $user->lang['POST_PM_POST']; + break; + + case 'reply': + $page_title = $user->lang['POST_REPLY_PM']; + break; + + case 'edit': + $page_title = $user->lang['POST_EDIT_PM']; + break; + + case 'forward': + $page_title = $user->lang['POST_FORWARD_PM']; + break; + + default: + trigger_error('NO_ACTION_MODE', E_USER_ERROR); + break; + } + + $s_hidden_fields = ''; + $s_hidden_fields .= (isset($check_value)) ? '' : ''; + $s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '' : ''; + + $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"'; + + // Start assigning vars for main posting page ... + $template->assign_vars(array( + 'L_POST_A' => $page_title, + 'L_ICON' => $user->lang['PM_ICON'], + 'L_MESSAGE_BODY_EXPLAIN' => $user->lang('MESSAGE_BODY_EXPLAIN', (int) $config['max_post_chars']), + + 'SUBJECT' => (isset($message_subject)) ? $message_subject : '', + 'MESSAGE' => $message_text, + 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '', '') : sprintf($user->lang['BBCODE_IS_OFF'], '', ''), + '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'], + 'URL_STATUS' => ($url_status) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'], + 'MAX_FONT_SIZE' => (int) $config['max_post_font_size'], + 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['PM']), + 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', + 'MAX_RECIPIENTS' => ($config['allow_mass_pm'] && ($auth->acl_get('u_masspm') || $auth->acl_get('u_masspm_group'))) ? $max_recipients : 0, + + 'S_COMPOSE_PM' => true, + 'S_EDIT_POST' => ($action == 'edit'), + 'S_SHOW_PM_ICONS' => $s_pm_icons, + 'S_BBCODE_ALLOWED' => ($bbcode_status) ? 1 : 0, + 'S_BBCODE_CHECKED' => ($bbcode_checked) ? ' checked="checked"' : '', + 'S_SMILIES_ALLOWED' => $smilies_status, + 'S_SMILIES_CHECKED' => ($smilies_checked) ? ' checked="checked"' : '', + 'S_SIG_ALLOWED' => ($config['allow_sig'] && $config['allow_sig_pm'] && $auth->acl_get('u_sig')), + 'S_SIGNATURE_CHECKED' => ($sig_checked) ? ' checked="checked"' : '', + 'S_LINKS_ALLOWED' => $url_status, + 'S_MAGIC_URL_CHECKED' => ($urls_checked) ? ' checked="checked"' : '', + 'S_SAVE_ALLOWED' => ($auth->acl_get('u_savedrafts') && $action != 'edit') ? true : false, + 'S_HAS_DRAFTS' => ($auth->acl_get('u_savedrafts') && $drafts), + 'S_FORM_ENCTYPE' => $form_enctype, + 'S_ATTACH_DATA' => json_encode($message_parser->attachment_data), + + 'S_BBCODE_IMG' => $img_status, + 'S_BBCODE_FLASH' => $flash_status, + 'S_BBCODE_QUOTE' => true, + 'S_BBCODE_URL' => $url_status, + + 'S_POST_ACTION' => $s_action, + 'S_HIDDEN_ADDRESS_FIELD' => $s_hidden_address_field, + 'S_HIDDEN_FIELDS' => $s_hidden_fields, + + 'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']), + 'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", 'f=0&mode=popup'), + 'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_root_path}posting.$phpEx", 'f=0&mode=popup')), + )); + + // Build custom bbcodes array + display_custom_bbcodes(); + + // Show attachment box for adding attachments if true + $allowed = ($auth->acl_get('u_pm_attach') && $config['allow_pm_attach'] && $form_enctype); + + if ($allowed) + { + $max_files = ($auth->acl_gets('a_', 'm_')) ? 0 : (int) $config['max_attachments_pm']; + $plupload->configure($cache, $template, $s_action, false, $max_files); + } + + // Attachment entry + posting_gen_attachment_entry($attachment_data, $filename_data, $allowed); + + // Message History + if ($action == 'reply' || $action == 'quote' || $action == 'forward') + { + if (message_history($msg_id, $user->data['user_id'], $post, array(), true)) + { + $template->assign_var('S_DISPLAY_HISTORY', true); + } + } +} + +/** +* For composing messages, handle list actions +*/ +function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove_g, $add_to, $add_bcc) +{ + global $auth, $db, $user; + global $request; + + // Delete User [TO/BCC] + if ($remove_u && $request->variable('remove_u', array(0 => ''))) + { + $remove_user_id = array_keys($request->variable('remove_u', array(0 => ''))); + + if (isset($remove_user_id[0])) + { + unset($address_list['u'][(int) $remove_user_id[0]]); + } + } + + // Delete Group [TO/BCC] + if ($remove_g && $request->variable('remove_g', array(0 => ''))) + { + $remove_group_id = array_keys($request->variable('remove_g', array(0 => ''))); + + if (isset($remove_group_id[0])) + { + unset($address_list['g'][(int) $remove_group_id[0]]); + } + } + + // Add Selected Groups + $group_list = request_var('group_list', array(0)); + + // Build usernames to add + $usernames = request_var('username', '', true); + $usernames = (empty($usernames)) ? array() : array($usernames); + + $username_list = request_var('username_list', '', true); + if ($username_list) + { + $usernames = array_merge($usernames, explode("\n", $username_list)); + } + + // If add to or add bcc not pressed, users could still have usernames listed they want to add... + if (!$add_to && !$add_bcc && (sizeof($group_list) || sizeof($usernames))) + { + $add_to = true; + + global $refresh, $submit, $preview; + + $refresh = true; + $submit = false; + + // Preview is only true if there was also a message entered + if (request_var('message', '')) + { + $preview = true; + } + } + + // Add User/Group [TO] + if ($add_to || $add_bcc) + { + $type = ($add_to) ? 'to' : 'bcc'; + + if (sizeof($group_list)) + { + foreach ($group_list as $group_id) + { + $address_list['g'][$group_id] = $type; + } + } + + // User ID's to add... + $user_id_ary = array(); + + // Reveal the correct user_ids + if (sizeof($usernames)) + { + $user_id_ary = array(); + user_get_id_name($user_id_ary, $usernames, array(USER_NORMAL, USER_FOUNDER, USER_INACTIVE)); + + // If there are users not existing, we will at least print a notice... + if (!sizeof($user_id_ary)) + { + $error[] = $user->lang['PM_NO_USERS']; + } + } + + // Add Friends if specified + $friend_list = array_keys($request->variable('add_' . $type, array(0))); + $user_id_ary = array_merge($user_id_ary, $friend_list); + + foreach ($user_id_ary as $user_id) + { + if ($user_id == ANONYMOUS) + { + continue; + } + + $address_list['u'][$user_id] = $type; + } + } + + // Check for disallowed recipients + if (!empty($address_list['u'])) + { + $can_ignore_allow_pm = $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'); + + // Administrator deactivated users check and we need to check their + // PM status (do they want to receive PM's?) + // Only check PM status if not a moderator or admin, since they + // are allowed to override this user setting + $sql = 'SELECT user_id, user_allow_pm + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', array_keys($address_list['u'])) . ' + AND ( + (user_type = ' . USER_INACTIVE . ' + AND user_inactive_reason = ' . INACTIVE_MANUAL . ') + ' . ($can_ignore_allow_pm ? '' : ' OR user_allow_pm = 0') . ' + )'; + + $result = $db->sql_query($sql); + + $removed_no_pm = $removed_no_permission = false; + while ($row = $db->sql_fetchrow($result)) + { + if (!$can_ignore_allow_pm && !$row['user_allow_pm']) + { + $removed_no_pm = true; + } + else + { + $removed_no_permission = true; + } + + unset($address_list['u'][$row['user_id']]); + } + $db->sql_freeresult($result); + + // print a notice about users not being added who do not want to receive pms + if ($removed_no_pm) + { + $error[] = $user->lang['PM_USERS_REMOVED_NO_PM']; + } + + // print a notice about users not being added who do not have permission to receive PMs + if ($removed_no_permission) + { + $error[] = $user->lang['PM_USERS_REMOVED_NO_PERMISSION']; + } + + if (!sizeof(array_keys($address_list['u']))) + { + return; + } + + // Check if users have permission to read PMs + $can_read = $auth->acl_get_list(array_keys($address_list['u']), 'u_readpm'); + $can_read = (empty($can_read) || !isset($can_read[0]['u_readpm'])) ? array() : $can_read[0]['u_readpm']; + $cannot_read_list = array_diff(array_keys($address_list['u']), $can_read); + if (!empty($cannot_read_list)) + { + foreach ($cannot_read_list as $cannot_read) + { + unset($address_list['u'][$cannot_read]); + } + + $error[] = $user->lang['PM_USERS_REMOVED_NO_PERMISSION']; + } + + // Check if users are banned + $banned_user_list = phpbb_get_banned_user_ids(array_keys($address_list['u']), false); + if (!empty($banned_user_list)) + { + foreach ($banned_user_list as $banned_user) + { + unset($address_list['u'][$banned_user]); + } + + $error[] = $user->lang['PM_USERS_REMOVED_NO_PERMISSION']; + } + } +} + +/** +* Build the hidden field for the recipients. Needed, as the variable is not read via request_var. +*/ +function build_address_field($address_list) +{ + $s_hidden_address_field = ''; + foreach ($address_list as $type => $adr_ary) + { + foreach ($adr_ary as $id => $field) + { + $s_hidden_address_field .= ''; + } + } + return $s_hidden_address_field; +} + +/** +* Return number of private message recipients +*/ +function num_recipients($address_list) +{ + $num_recipients = 0; + + foreach ($address_list as $field => $adr_ary) + { + $num_recipients += sizeof($adr_ary); + } + + return $num_recipients; +} + +/** +* Get number of 'num_recipients' recipients from first position +*/ +function get_recipients($address_list, $num_recipients = 1) +{ + $recipient = array(); + + $count = 0; + foreach ($address_list as $field => $adr_ary) + { + foreach ($adr_ary as $id => $type) + { + if ($count >= $num_recipients) + { + break 2; + } + $recipient[$field][$id] = $type; + $count++; + } + } + + return $recipient; +} diff --git a/sources/phpBB/includes/ucp/ucp_pm_options.php b/sources/phpBB/includes/ucp/ucp_pm_options.php new file mode 100644 index 0000000..d1fc9d2 --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_pm_options.php @@ -0,0 +1,871 @@ + +* @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; +} + +/** +* Execute message options +*/ +function message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions) +{ + global $phpbb_root_path, $phpEx, $user, $template, $auth, $config, $db; + + $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=options"); + + add_form_key('ucp_pm_options'); + // Change "full folder" setting - what to do if folder is full + if (isset($_POST['fullfolder'])) + { + if (!check_form_key('ucp_pm_options')) + { + trigger_error('FORM_INVALID'); + } + + $full_action = request_var('full_action', 0); + + $set_folder_id = 0; + switch ($full_action) + { + case 1: + $set_folder_id = FULL_FOLDER_DELETE; + break; + + case 2: + $set_folder_id = request_var('full_move_to', PRIVMSGS_INBOX); + break; + + case 3: + $set_folder_id = FULL_FOLDER_HOLD; + break; + + default: + $full_action = 0; + break; + } + + if ($full_action) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_full_folder = ' . $set_folder_id . ' + WHERE user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + + $user->data['user_full_folder'] = $set_folder_id; + + $message = $user->lang['FULL_FOLDER_OPTION_CHANGED'] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + meta_refresh(3, $redirect_url); + trigger_error($message); + } + } + + // Add Folder + if (isset($_POST['addfolder'])) + { + if (check_form_key('ucp_pm_options')) + { + $folder_name = utf8_normalize_nfc(request_var('foldername', '', true)); + $msg = ''; + + if ($folder_name) + { + $sql = 'SELECT folder_name + FROM ' . PRIVMSGS_FOLDER_TABLE . " + WHERE folder_name = '" . $db->sql_escape($folder_name) . "' + AND user_id = " . $user->data['user_id']; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + trigger_error(sprintf($user->lang['FOLDER_NAME_EXIST'], $folder_name)); + } + + $sql = 'SELECT COUNT(folder_id) as num_folder + FROM ' . PRIVMSGS_FOLDER_TABLE . ' + WHERE user_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + $num_folder = (int) $db->sql_fetchfield('num_folder'); + $db->sql_freeresult($result); + + if ($num_folder >= $config['pm_max_boxes']) + { + trigger_error('MAX_FOLDER_REACHED'); + } + + $sql = 'INSERT INTO ' . PRIVMSGS_FOLDER_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'user_id' => (int) $user->data['user_id'], + 'folder_name' => $folder_name) + ); + $db->sql_query($sql); + $msg = $user->lang['FOLDER_ADDED']; + } + else + { + $msg = $user->lang['FOLDER_NAME_EMPTY']; + } + } + else + { + $msg = $user->lang['FORM_INVALID']; + } + $message = $msg . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + meta_refresh(3, $redirect_url); + trigger_error($message); + } + + // Rename folder + if (isset($_POST['rename_folder'])) + { + 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); + + if (!$new_folder_name) + { + trigger_error('NO_NEW_FOLDER_NAME'); + } + + // Select custom folder + $sql = 'SELECT folder_name, pm_count + FROM ' . PRIVMSGS_FOLDER_TABLE . " + WHERE user_id = {$user->data['user_id']} + AND folder_id = $rename_folder_id"; + $result = $db->sql_query_limit($sql, 1); + $folder_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$folder_row) + { + trigger_error('CANNOT_RENAME_FOLDER'); + } + + $sql = 'UPDATE ' . PRIVMSGS_FOLDER_TABLE . " + SET folder_name = '" . $db->sql_escape($new_folder_name) . "' + WHERE folder_id = $rename_folder_id + AND user_id = {$user->data['user_id']}"; + $db->sql_query($sql); + $msg = $user->lang['FOLDER_RENAMED']; + } + else + { + $msg = $user->lang['FORM_INVALID']; + } + + $message = $msg . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + + meta_refresh(3, $redirect_url); + trigger_error($message); + } + + // Remove Folder + if (isset($_POST['remove_folder'])) + { + $remove_folder_id = request_var('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); + + // Move to same folder? + if ($remove_action == 1 && $remove_folder_id == $move_to) + { + trigger_error('CANNOT_MOVE_TO_SAME_FOLDER'); + } + + // Select custom folder + $sql = 'SELECT folder_name, pm_count + FROM ' . PRIVMSGS_FOLDER_TABLE . " + WHERE user_id = {$user->data['user_id']} + AND folder_id = $remove_folder_id"; + $result = $db->sql_query_limit($sql, 1); + $folder_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$folder_row) + { + trigger_error('CANNOT_REMOVE_FOLDER'); + } + + $s_hidden_fields = array( + 'remove_folder_id' => $remove_folder_id, + 'remove_action' => $remove_action, + 'move_to' => $move_to, + 'remove_folder' => 1 + ); + + // Do we need to confirm? + if (confirm_box(true)) + { + // Gather message ids + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . " + AND folder_id = $remove_folder_id"; + $result = $db->sql_query($sql); + + $msg_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $msg_ids[] = (int) $row['msg_id']; + } + $db->sql_freeresult($result); + + // First of all, copy all messages to another folder... or delete all messages + switch ($remove_action) + { + // Move Messages + case 1: + $num_moved = move_pm($user->data['user_id'], $user->data['message_limit'], $msg_ids, $move_to, $remove_folder_id); + + // Something went wrong, only partially moved? + if ($num_moved != $folder_row['pm_count']) + { + trigger_error($user->lang('MOVE_PM_ERROR', $user->lang('MESSAGES_COUNT', (int) $folder_row['pm_count']), $num_moved)); + } + break; + + // Remove Messages + case 2: + delete_pm($user->data['user_id'], $msg_ids, $remove_folder_id); + break; + } + + // Remove folder + $sql = 'DELETE FROM ' . PRIVMSGS_FOLDER_TABLE . " + WHERE user_id = {$user->data['user_id']} + AND folder_id = $remove_folder_id"; + $db->sql_query($sql); + + // Check full folder option. If the removed folder has been specified as destination switch back to inbox + if ($user->data['user_full_folder'] == $remove_folder_id) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_full_folder = ' . PRIVMSGS_INBOX . ' + WHERE user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + + $user->data['user_full_folder'] = PRIVMSGS_INBOX; + } + + // Now make sure the folder is not used for rules + // We assign another folder id (the one the messages got moved to) or assign the INBOX (to not have to remove any rule) + $sql = 'UPDATE ' . PRIVMSGS_RULES_TABLE . ' SET rule_folder_id = '; + $sql .= ($remove_action == 1) ? $move_to : PRIVMSGS_INBOX; + $sql .= ' WHERE rule_folder_id = ' . $remove_folder_id; + + $db->sql_query($sql); + + $meta_info = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=$mode"); + $message = $user->lang['FOLDER_REMOVED']; + + meta_refresh(3, $meta_info); + $message .= '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + trigger_error($message); + } + else + { + confirm_box(false, 'REMOVE_FOLDER', build_hidden_fields($s_hidden_fields)); + } + } + + // Add Rule + if (isset($_POST['add_rule'])) + { + 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; + + $action = (int) $action_option[0]; + $folder_id = (int) $action_option[1]; + + if (!$action || !$check_option || !$rule_option || !$cond_option || ($cond_option != 'none' && !$rule_string)) + { + trigger_error('RULE_NOT_DEFINED'); + } + + if (($cond_option == 'user' && !$rule_user_id) || ($cond_option == 'group' && !$rule_group_id)) + { + trigger_error('RULE_NOT_DEFINED'); + } + + $rule_ary = array( + 'user_id' => $user->data['user_id'], + 'rule_check' => $check_option, + 'rule_connection' => $rule_option, + 'rule_string' => $rule_string, + 'rule_user_id' => $rule_user_id, + 'rule_group_id' => $rule_group_id, + 'rule_action' => $action, + 'rule_folder_id' => $folder_id + ); + + $sql = 'SELECT rule_id + FROM ' . PRIVMSGS_RULES_TABLE . ' + WHERE ' . $db->sql_build_array('SELECT', $rule_ary); + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + trigger_error('RULE_ALREADY_DEFINED'); + } + + // Prevent users from flooding the rules table + $sql = 'SELECT COUNT(rule_id) AS num_rules + FROM ' . PRIVMSGS_RULES_TABLE . ' + WHERE user_id = ' . (int) $user->data['user_id']; + $result = $db->sql_query($sql); + $num_rules = (int) $db->sql_fetchfield('num_rules'); + $db->sql_freeresult($result); + + if ($num_rules >= 5000) + { + trigger_error('RULE_LIMIT_REACHED'); + } + + $sql = 'INSERT INTO ' . PRIVMSGS_RULES_TABLE . ' ' . $db->sql_build_array('INSERT', $rule_ary); + $db->sql_query($sql); + + // Set the user_message_rules bit + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_message_rules = 1 + WHERE user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + + $msg = $user->lang['RULE_ADDED']; + } + else + { + $msg = $user->lang['FORM_INVALID']; + } + $message = $msg . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + meta_refresh(3, $redirect_url); + trigger_error($message); + } + + // Remove Rule + if (isset($_POST['delete_rule']) && !isset($_POST['cancel'])) + { + $delete_id = array_keys(request_var('delete_rule', array(0 => 0))); + $delete_id = (!empty($delete_id[0])) ? $delete_id[0] : 0; + + if (!$delete_id) + { + redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=' . $mode)); + } + + // Do we need to confirm? + if (confirm_box(true)) + { + $sql = 'DELETE FROM ' . PRIVMSGS_RULES_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . " + AND rule_id = $delete_id"; + $db->sql_query($sql); + + $meta_info = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=' . $mode); + $message = $user->lang['RULE_DELETED']; + + // Reset user_message_rules if no more assigned + $sql = 'SELECT rule_id + FROM ' . PRIVMSGS_RULES_TABLE . ' + WHERE user_id = ' . $user->data['user_id']; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + // Unset the user_message_rules bit + if (!$row) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_message_rules = 0 + WHERE user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + } + + meta_refresh(3, $meta_info); + $message .= '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + trigger_error($message); + } + else + { + confirm_box(false, 'DELETE_RULE', build_hidden_fields(array('delete_rule' => array($delete_id => 1)))); + } + } + + $folder = array(); + + $sql = 'SELECT COUNT(msg_id) as num_messages + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . ' + AND folder_id = ' . PRIVMSGS_INBOX; + $result = $db->sql_query($sql); + $num_messages = (int) $db->sql_fetchfield('num_messages'); + $db->sql_freeresult($result); + + $folder[PRIVMSGS_INBOX] = array( + 'folder_name' => $user->lang['PM_INBOX'], + 'message_status' => $user->lang('FOLDER_MESSAGE_STATUS', $user->lang('MESSAGES_COUNT', (int) $user->data['message_limit']), $num_messages), + ); + + $sql = 'SELECT folder_id, folder_name, pm_count + FROM ' . PRIVMSGS_FOLDER_TABLE . ' + WHERE user_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + + $num_user_folder = 0; + while ($row = $db->sql_fetchrow($result)) + { + $num_user_folder++; + $folder[$row['folder_id']] = array( + 'folder_name' => $row['folder_name'], + 'message_status' => $user->lang('FOLDER_MESSAGE_STATUS', $user->lang('MESSAGES_COUNT', (int) $user->data['message_limit']), (int) $row['pm_count']), + ); + } + $db->sql_freeresult($result); + + $s_full_folder_options = $s_to_folder_options = $s_folder_options = ''; + + if ($user->data['user_full_folder'] == FULL_FOLDER_NONE) + { + // -3 here to let the correct folder id be selected + $to_folder_id = $config['full_folder_action'] - 3; + } + else + { + $to_folder_id = $user->data['user_full_folder']; + } + + foreach ($folder as $folder_id => $folder_ary) + { + $s_full_folder_options .= ''; + $s_to_folder_options .= ''; + + if ($folder_id != PRIVMSGS_INBOX) + { + $s_folder_options .= ''; + } + } + + $s_delete_checked = ($user->data['user_full_folder'] == FULL_FOLDER_DELETE) ? ' checked="checked"' : ''; + $s_hold_checked = ($user->data['user_full_folder'] == FULL_FOLDER_HOLD) ? ' checked="checked"' : ''; + $s_move_checked = ($user->data['user_full_folder'] >= 0) ? ' checked="checked"' : ''; + + if ($user->data['user_full_folder'] == FULL_FOLDER_NONE) + { + switch ($config['full_folder_action']) + { + case 1: + $s_delete_checked = ' checked="checked"'; + break; + + case 2: + $s_hold_checked = ' checked="checked"'; + break; + } + } + + $template->assign_vars(array( + 'S_FULL_FOLDER_OPTIONS' => $s_full_folder_options, + 'S_TO_FOLDER_OPTIONS' => $s_to_folder_options, + 'S_FOLDER_OPTIONS' => $s_folder_options, + 'S_DELETE_CHECKED' => $s_delete_checked, + 'S_HOLD_CHECKED' => $s_hold_checked, + 'S_MOVE_CHECKED' => $s_move_checked, + 'S_MAX_FOLDER_REACHED' => ($num_user_folder >= $config['pm_max_boxes']) ? true : false, + 'S_MAX_FOLDER_ZERO' => ($config['pm_max_boxes'] == 0) ? true : false, + + 'DEFAULT_ACTION' => ($config['full_folder_action'] == 1) ? $user->lang['DELETE_OLDEST_MESSAGES'] : $user->lang['HOLD_NEW_MESSAGES'], + + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=rule_string&select_single=true'), + )); + + $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())); + + /* + 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(); + + if (sizeof($back)) + { + if ($action_option) + { + $action_option = ''; + } + else if ($cond_option) + { + $cond_option = ''; + } + else if ($rule_option) + { + $rule_option = 0; + } + else if ($check_option) + { + $check_option = 0; + } + } + + if (isset($back['action']) && $cond_option == 'none') + { + $back['cond'] = true; + } + + // Check + if (!isset($global_privmsgs_rules[$check_option])) + { + $check_option = 0; + } + + define_check_option(($check_option && !isset($back['rule'])) ? true : false, $check_option, $check_lang); + + if ($check_option && !isset($back['rule'])) + { + define_rule_option(($rule_option && !isset($back['cond'])) ? true : false, $rule_option, $rule_lang, $global_privmsgs_rules[$check_option]); + } + + if ($rule_option && !isset($back['cond'])) + { + if (!isset($global_rule_conditions[$rule_option])) + { + $cond_option = 'none'; + $template->assign_var('NONE_CONDITION', true); + } + else + { + define_cond_option(($cond_option && !isset($back['action'])) ? true : false, $cond_option, $rule_option, $global_rule_conditions); + } + } + + if ($cond_option && !isset($back['action'])) + { + define_action_option(false, $action_option, $action_lang, $folder); + } + + show_defined_rules($user->data['user_id'], $check_lang, $rule_lang, $action_lang, $folder); +} + +/** +* Defining check option for message rules +*/ +function define_check_option($hardcoded, $check_option, $check_lang) +{ + global $template; + + $s_check_options = ''; + if (!$hardcoded) + { + foreach ($check_lang as $value => $lang) + { + $s_check_options .= ''; + } + } + + $template->assign_vars(array( + 'S_CHECK_DEFINED' => true, + 'S_CHECK_SELECT' => ($hardcoded) ? false : true, + 'CHECK_CURRENT' => isset($check_lang[$check_option]) ? $check_lang[$check_option] : '', + 'S_CHECK_OPTIONS' => $s_check_options, + 'CHECK_OPTION' => $check_option) + ); +} + +/** +* Defining action option for message rules +*/ +function define_action_option($hardcoded, $action_option, $action_lang, $folder) +{ + global $db, $template, $user; + + $l_action = $s_action_options = ''; + if ($hardcoded) + { + $option = explode('|', $action_option); + $action = (int) $option[0]; + $folder_id = (int) $option[1]; + + $l_action = $action_lang[$action]; + if ($action == ACTION_PLACE_INTO_FOLDER) + { + $l_action .= ' -> ' . $folder[$folder_id]['folder_name']; + } + } + else + { + foreach ($action_lang as $action => $lang) + { + if ($action == ACTION_PLACE_INTO_FOLDER) + { + foreach ($folder as $folder_id => $folder_ary) + { + $s_action_options .= ''; + } + } + else + { + $s_action_options .= ''; + } + } + } + + $template->assign_vars(array( + 'S_ACTION_DEFINED' => true, + 'S_ACTION_SELECT' => ($hardcoded) ? false : true, + 'ACTION_CURRENT' => $l_action, + 'S_ACTION_OPTIONS' => $s_action_options, + 'ACTION_OPTION' => $action_option) + ); +} + +/** +* Defining rule option for message rules +*/ +function define_rule_option($hardcoded, $rule_option, $rule_lang, $check_ary) +{ + global $template; + global $module; + + $exclude = array(); + + if (!$module->loaded('zebra', 'friends')) + { + $exclude[RULE_IS_FRIEND] = true; + } + + if (!$module->loaded('zebra', 'foes')) + { + $exclude[RULE_IS_FOE] = true; + } + + $s_rule_options = ''; + if (!$hardcoded) + { + foreach ($check_ary as $value => $_check) + { + if (isset($exclude[$value])) + { + continue; + } + $s_rule_options .= ''; + } + } + + $template->assign_vars(array( + 'S_RULE_DEFINED' => true, + 'S_RULE_SELECT' => !$hardcoded, + 'RULE_CURRENT' => isset($rule_lang[$rule_option]) ? $rule_lang[$rule_option] : '', + 'S_RULE_OPTIONS' => $s_rule_options, + 'RULE_OPTION' => $rule_option) + ); +} + +/** +* Defining condition option for message rules +*/ +function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule_conditions) +{ + global $db, $template, $auth, $user; + + $template->assign_vars(array( + 'S_COND_DEFINED' => true, + 'S_COND_SELECT' => (!$hardcoded && isset($global_rule_conditions[$rule_option])) ? true : false) + ); + + // Define COND_OPTION + if (!isset($global_rule_conditions[$rule_option])) + { + $template->assign_vars(array( + 'COND_OPTION' => 'none', + 'COND_CURRENT' => false) + ); + return; + } + + // Define Condition + $condition = $global_rule_conditions[$rule_option]; + $current_value = ''; + + switch ($condition) + { + case 'text': + $rule_string = utf8_normalize_nfc(request_var('rule_string', '', true)); + + $template->assign_vars(array( + 'S_TEXT_CONDITION' => true, + 'CURRENT_STRING' => $rule_string, + 'CURRENT_USER_ID' => 0, + 'CURRENT_GROUP_ID' => 0) + ); + + $current_value = $rule_string; + break; + + case 'user': + $rule_user_id = request_var('rule_user_id', 0); + $rule_string = utf8_normalize_nfc(request_var('rule_string', '', true)); + + if ($rule_string && !$rule_user_id) + { + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . " + WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($rule_string)) . "'"; + $result = $db->sql_query($sql); + $rule_user_id = (int) $db->sql_fetchfield('user_id'); + $db->sql_freeresult($result); + + if (!$rule_user_id) + { + $rule_string = ''; + } + } + else if (!$rule_string && $rule_user_id) + { + $sql = 'SELECT username + FROM ' . USERS_TABLE . " + WHERE user_id = $rule_user_id"; + $result = $db->sql_query($sql); + $rule_string = $db->sql_fetchfield('username'); + $db->sql_freeresult($result); + + if (!$rule_string) + { + $rule_user_id = 0; + } + } + + $template->assign_vars(array( + 'S_USER_CONDITION' => true, + 'CURRENT_STRING' => $rule_string, + 'CURRENT_USER_ID' => $rule_user_id, + 'CURRENT_GROUP_ID' => 0) + ); + + $current_value = $rule_string; + break; + + case 'group': + $rule_group_id = request_var('rule_group_id', 0); + $rule_string = utf8_normalize_nfc(request_var('rule_string', '', true)); + + $sql = 'SELECT g.group_id, g.group_name, g.group_type + FROM ' . GROUPS_TABLE . ' g '; + + if (!$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) + { + $sql .= 'LEFT JOIN ' . USER_GROUP_TABLE . ' ug + ON ( + g.group_id = ug.group_id + AND ug.user_id = ' . $user->data['user_id'] . ' + AND ug.user_pending = 0 + ) + WHERE (ug.user_id = ' . $user->data['user_id'] . ' OR g.group_type <> ' . GROUP_HIDDEN . ') + AND'; + } + else + { + $sql .= 'WHERE'; + } + + $sql .= " (g.group_name NOT IN ('GUESTS', 'BOTS') OR g.group_type <> " . GROUP_SPECIAL . ') + ORDER BY g.group_type DESC, g.group_name ASC'; + + $result = $db->sql_query($sql); + + $s_group_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + 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']); + } + + $s_class = ($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : ''; + $s_selected = ($row['group_id'] == $rule_group_id) ? ' selected="selected"' : ''; + + $s_group_options .= ''; + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'S_GROUP_CONDITION' => true, + 'S_GROUP_OPTIONS' => $s_group_options, + 'CURRENT_STRING' => $rule_string, + 'CURRENT_USER_ID' => 0, + 'CURRENT_GROUP_ID' => $rule_group_id) + ); + + $current_value = $rule_string; + break; + + default: + return; + } + + $template->assign_vars(array( + 'COND_OPTION' => $condition, + 'COND_CURRENT' => $current_value) + ); +} + +/** +* Display defined message rules +*/ +function show_defined_rules($user_id, $check_lang, $rule_lang, $action_lang, $folder) +{ + global $db, $template; + + $sql = 'SELECT * + FROM ' . PRIVMSGS_RULES_TABLE . ' + WHERE user_id = ' . $user_id . ' + ORDER BY rule_id ASC'; + $result = $db->sql_query($sql); + + $count = 0; + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('rule', array( + 'COUNT' => ++$count, + 'RULE_ID' => $row['rule_id'], + 'CHECK' => $check_lang[$row['rule_check']], + 'RULE' => $rule_lang[$row['rule_connection']], + 'STRING' => $row['rule_string'], + 'ACTION' => $action_lang[$row['rule_action']], + 'FOLDER' => ($row['rule_action'] == ACTION_PLACE_INTO_FOLDER) ? $folder[$row['rule_folder_id']]['folder_name'] : '') + ); + } + $db->sql_freeresult($result); +} diff --git a/sources/phpBB/includes/ucp/ucp_pm_viewfolder.php b/sources/phpBB/includes/ucp/ucp_pm_viewfolder.php new file mode 100644 index 0000000..19acd9e --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -0,0 +1,557 @@ + +* @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; +} + +/** +* View message folder +* Called from ucp_pm with mode == 'view' && action == 'view_folder' +*/ +function view_folder($id, $mode, $folder_id, $folder) +{ + global $user, $template, $auth, $db, $cache; + global $phpbb_root_path, $config, $phpEx; + + $submit_export = (isset($_POST['submit_export'])) ? true : false; + + $folder_info = get_pm_from($folder_id, $folder, $user->data['user_id']); + + if (!$submit_export) + { + $user->add_lang('viewforum'); + + // Grab icons + $icons = $cache->obtain_icons(); + + $color_rows = array('marked', 'replied'); + + // only show the friend/foe color rows if the module is enabled + $zebra_enabled = false; + + $_module = new p_master(); + $_module->list_modules('ucp'); + $_module->set_active('zebra'); + + $zebra_enabled = ($_module->active_module === false) ? false : true; + + unset($_module); + + if ($zebra_enabled) + { + $color_rows = array_merge($color_rows, array('friend', 'foe')); + } + + foreach ($color_rows as $var) + { + $template->assign_block_vars('pm_colour_info', array( + 'IMG' => $user->img("pm_{$var}", ''), + 'CLASS' => "pm_{$var}_colour", + 'LANG' => $user->lang[strtoupper($var) . '_MESSAGE']) + ); + } + + $mark_options = array('mark_important', 'delete_marked'); + + // Minimise edits + if (!$auth->acl_get('u_pm_delete') && $key = array_search('delete_marked', $mark_options)) + { + unset($mark_options[$key]); + } + + $s_mark_options = ''; + foreach ($mark_options as $mark_option) + { + $s_mark_options .= ''; + } + + // We do the folder moving options here too, for template authors to use... + $s_folder_move_options = ''; + if ($folder_id != PRIVMSGS_NO_BOX && $folder_id != PRIVMSGS_OUTBOX) + { + foreach ($folder as $f_id => $folder_ary) + { + if ($f_id == PRIVMSGS_OUTBOX || $f_id == PRIVMSGS_SENTBOX || $f_id == $folder_id) + { + continue; + } + + $s_folder_move_options .= ''; + $s_folder_move_options .= sprintf($user->lang['MOVE_MARKED_TO_FOLDER'], $folder_ary['folder_name']); + $s_folder_move_options .= (($folder_ary['unread_messages']) ? ' [' . $folder_ary['unread_messages'] . '] ' : '') . ''; + } + } + $friend = $foe = array(); + + // Get friends and foes + $sql = 'SELECT * + FROM ' . ZEBRA_TABLE . ' + WHERE user_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $friend[$row['zebra_id']] = $row['friend']; + $foe[$row['zebra_id']] = $row['foe']; + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'S_MARK_OPTIONS' => $s_mark_options, + 'S_MOVE_MARKED_OPTIONS' => $s_folder_move_options) + ); + + // Okay, lets dump out the page ... + if (sizeof($folder_info['pm_list'])) + { + $address_list = array(); + + // Build Recipient List if in outbox/sentbox - max two additional queries + if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) + { + $address_list = get_recipient_strings($folder_info['rowset']); + } + + foreach ($folder_info['pm_list'] as $message_id) + { + $row = &$folder_info['rowset'][$message_id]; + + $folder_img = ($row['pm_unread']) ? 'pm_unread' : 'pm_read'; + $folder_alt = ($row['pm_unread']) ? 'NEW_MESSAGES' : 'NO_NEW_MESSAGES'; + + // Generate all URIs ... + $view_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=view&f=$folder_id&p=$message_id"); + $remove_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=compose&action=delete&p=$message_id"); + + $row_indicator = ''; + foreach ($color_rows as $var) + { + if (($var != 'friend' && $var != 'foe' && $row['pm_' . $var]) + || + (($var == 'friend' || $var == 'foe') && isset(${$var}[$row['author_id']]) && ${$var}[$row['author_id']])) + { + $row_indicator = $var; + break; + } + } + + // Send vars to template + $template->assign_block_vars('messagerow', array( + 'PM_CLASS' => ($row_indicator) ? 'pm_' . $row_indicator . '_colour' : '', + + 'MESSAGE_AUTHOR_FULL' => get_username_string('full', $row['author_id'], $row['username'], $row['user_colour'], $row['username']), + 'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $row['author_id'], $row['username'], $row['user_colour'], $row['username']), + 'MESSAGE_AUTHOR' => get_username_string('username', $row['author_id'], $row['username'], $row['user_colour'], $row['username']), + 'U_MESSAGE_AUTHOR' => get_username_string('profile', $row['author_id'], $row['username'], $row['user_colour'], $row['username']), + + 'FOLDER_ID' => $folder_id, + 'MESSAGE_ID' => $message_id, + 'SENT_TIME' => $user->format_date($row['message_time']), + 'SUBJECT' => censor_text($row['message_subject']), + 'FOLDER' => (isset($folder[$row['folder_id']])) ? $folder[$row['folder_id']]['folder_name'] : '', + 'U_FOLDER' => (isset($folder[$row['folder_id']])) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'folder=' . $row['folder_id']) : '', + 'PM_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '' : '', + 'PM_ICON_URL' => (!empty($icons[$row['icon_id']])) ? $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] : '', + 'FOLDER_IMG' => $user->img($folder_img, $folder_alt), + 'FOLDER_IMG_STYLE' => $folder_img, + 'PM_IMG' => ($row_indicator) ? $user->img('pm_' . $row_indicator, '') : '', + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_pm_download') && $row['message_attachment'] && $config['allow_pm_attach']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + + 'S_PM_UNREAD' => ($row['pm_unread']) ? true : false, + 'S_PM_DELETED' => ($row['pm_deleted']) ? true : false, + 'S_PM_REPORTED' => (isset($row['report_id'])) ? true : false, + 'S_AUTHOR_DELETED' => ($row['author_id'] == ANONYMOUS) ? true : false, + + 'U_VIEW_PM' => ($row['pm_deleted']) ? '' : $view_message_url, + 'U_REMOVE_PM' => ($row['pm_deleted']) ? $remove_message_url : '', + 'U_MCP_REPORT' => (isset($row['report_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&mode=pm_report_details&r=' . $row['report_id']) : '', + 'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode($user->lang['COMMA_SEPARATOR'], $address_list[$message_id]) : '') + ); + } + unset($folder_info['rowset']); + + $template->assign_vars(array( + 'S_SHOW_RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? true : false, + 'S_SHOW_COLOUR_LEGEND' => true, + + 'REPORTED_IMG' => $user->img('icon_topic_reported', 'PM_REPORTED'), + 'S_PM_ICONS' => ($config['enable_pm_icons']) ? true : false) + ); + } + } + else + { + $export_type = request_var('export_option', ''); + $enclosure = request_var('enclosure', ''); + $delimiter = request_var('delimiter', ''); + + if ($export_type == 'CSV' && ($delimiter === '' || $enclosure === '')) + { + $template->assign_var('PROMPT', true); + } + else + { + // Build Recipient List if in outbox/sentbox + + $address_temp = $address = $data = array(); + + if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) + { + foreach ($folder_info['rowset'] as $message_id => $row) + { + $address_temp[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address'])); + $address[$message_id] = array(); + } + } + + foreach ($folder_info['pm_list'] as $message_id) + { + $row = &$folder_info['rowset'][$message_id]; + + include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + + $sql = 'SELECT p.message_text, p.bbcode_uid + FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . ' u + WHERE t.user_id = ' . $user->data['user_id'] . " + AND p.author_id = u.user_id + AND t.folder_id = $folder_id + AND t.msg_id = p.msg_id + AND p.msg_id = $message_id"; + $result = $db->sql_query_limit($sql, 1); + $message_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_types = array('u', 'g'); + foreach ($_types as $ug_type) + { + if (isset($address_temp[$message_id][$ug_type]) && sizeof($address_temp[$message_id][$ug_type])) + { + if (!isset($address[$message_id][$ug_type])) + { + $address[$message_id][$ug_type] = array(); + } + if ($ug_type == 'u') + { + $sql = 'SELECT user_id as id, username as name + FROM ' . USERS_TABLE . ' + WHERE '; + } + else + { + $sql = 'SELECT group_id as id, group_name as name + FROM ' . GROUPS_TABLE . ' + WHERE '; + } + $sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($address_temp[$message_id][$ug_type]))); + + $result = $db->sql_query($sql); + + while ($info_row = $db->sql_fetchrow($result)) + { + $address[$message_id][$ug_type][$address_temp[$message_id][$ug_type][$info_row['id']]][] = $info_row['name']; + unset($address_temp[$message_id][$ug_type][$info_row['id']]); + } + $db->sql_freeresult($result); + } + } + + // There is the chance that all recipients of the message got deleted. To avoid creating + // exports without recipients, we add a bogus "undisclosed recipient". + if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) && + !(isset($address[$message_id]['u']) && sizeof($address[$message_id]['u']))) + { + $address[$message_id]['u'] = array(); + $address[$message_id]['u']['to'] = array(); + $address[$message_id]['u']['to'][] = $user->lang['UNDISCLOSED_RECIPIENT']; + } + + decode_message($message_row['message_text'], $message_row['bbcode_uid']); + + $data[] = array( + 'subject' => censor_text($row['message_subject']), + 'sender' => $row['username'], + // ISO 8601 date. For PHP4 we are able to hardcode the timezone because $user->format_date() does not set it. + 'date' => $user->format_date($row['message_time'], 'c', true), + 'to' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? $address[$message_id] : '', + 'message' => $message_row['message_text'] + ); + } + + switch ($export_type) + { + case 'CSV': + case 'CSV_EXCEL': + $mimetype = 'text/csv'; + $filetype = 'csv'; + + if ($export_type == 'CSV_EXCEL') + { + $enclosure = '"'; + $delimiter = ','; + $newline = "\r\n"; + } + else + { + $newline = "\n"; + } + + $string = ''; + foreach ($data as $value) + { + $recipients = $value['to']; + $value['to'] = $value['bcc'] = ''; + + if (is_array($recipients)) + { + foreach ($recipients as $values) + { + $value['bcc'] .= (isset($values['bcc']) && is_array($values['bcc'])) ? ',' . implode(',', $values['bcc']) : ''; + $value['to'] .= (isset($values['to']) && is_array($values['to'])) ? ',' . implode(',', $values['to']) : ''; + } + + // Remove the commas which will appear before the first entry. + $value['to'] = substr($value['to'], 1); + $value['bcc'] = substr($value['bcc'], 1); + } + + foreach ($value as $tag => $text) + { + $cell = str_replace($enclosure, $enclosure . $enclosure, $text); + + if (strpos($cell, $enclosure) !== false || strpos($cell, $delimiter) !== false || strpos($cell, $newline) !== false) + { + $string .= $enclosure . $text . $enclosure . $delimiter; + } + else + { + $string .= $cell . $delimiter; + } + } + $string = substr($string, 0, -1) . $newline; + } + break; + + case 'XML': + $mimetype = 'application/xml'; + $filetype = 'xml'; + $string = '' . "\n"; + $string .= "\n"; + + foreach ($data as $value) + { + $string .= "\t\n"; + + if (is_array($value['to'])) + { + foreach ($value['to'] as $key => $values) + { + foreach ($values as $type => $types) + { + foreach ($types as $name) + { + $string .= "\t\t$name\n"; + } + } + } + } + + unset($value['to']); + + foreach ($value as $tag => $text) + { + $string .= "\t\t<$tag>$text\n"; + } + + $string .= "\t\n"; + } + $string .= ''; + break; + } + + header('Cache-Control: private, no-cache'); + header("Content-Type: $mimetype; name=\"data.$filetype\""); + header("Content-disposition: attachment; filename=data.$filetype"); + echo $string; + exit; + } + } +} + +/** +* Get Messages from folder/user +*/ +function get_pm_from($folder_id, $folder, $user_id) +{ + global $user, $db, $template, $config, $auth, $phpbb_container, $phpbb_root_path, $phpEx; + + $start = request_var('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'); + + $pagination = $phpbb_container->get('pagination'); + + // PM ordering options + $limit_days = array(0 => $user->lang['ALL_MESSAGES'], 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']); + + // No sort by Author for sentbox/outbox (already only author available) + // Also, sort by msg_id for the time - private messages are not as prone to errors as posts are. + if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) + { + $sort_by_text = array('t' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); + $sort_by_sql = array('t' => 'p.message_time', 's' => array('p.message_subject', 'p.message_time')); + } + else + { + $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); + $sort_by_sql = array('a' => array('u.username_clean', 'p.message_time'), 't' => 'p.message_time', 's' => array('p.message_subject', 'p.message_time')); + } + + $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); + + $folder_sql = 't.folder_id = ' . (int) $folder_id; + + // Limit pms to certain time frame, obtain correct pm count + if ($sort_days) + { + $min_post_time = time() - ($sort_days * 86400); + + if (isset($_POST['sort'])) + { + $start = 0; + } + + $sql = 'SELECT COUNT(t.msg_id) AS pm_count + FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . " p + WHERE $folder_sql + AND t.user_id = $user_id + AND t.msg_id = p.msg_id + AND p.message_time >= $min_post_time"; + $result = $db->sql_query_limit($sql, 1); + $pm_count = (int) $db->sql_fetchfield('pm_count'); + $db->sql_freeresult($result); + + $sql_limit_time = "AND p.message_time >= $min_post_time"; + } + else + { + $pm_count = (!empty($folder[$folder_id]['num_messages'])) ? $folder[$folder_id]['num_messages'] : 0; + $sql_limit_time = ''; + } + + $base_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id&$u_sort_param"); + $start = $pagination->validate_start($start, $config['topics_per_page'], $pm_count); + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $pm_count, $config['topics_per_page'], $start); + + $template->assign_vars(array( + 'TOTAL_MESSAGES' => $user->lang('VIEW_PM_MESSAGES', (int) $pm_count), + + 'POST_IMG' => (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'POST_PM_LOCKED') : $user->img('button_pm_new', 'POST_NEW_PM'), + + 'S_NO_AUTH_SEND_MESSAGE' => !$auth->acl_get('u_sendpm'), + + 'S_SELECT_SORT_DIR' => $s_sort_dir, + 'S_SELECT_SORT_KEY' => $s_sort_key, + 'S_SELECT_SORT_DAYS' => $s_limit_days, + 'S_TOPIC_ICONS' => ($config['enable_pm_icons']) ? true : false, + + 'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose') : '', + 'S_PM_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id" . (($start !== 0) ? "&start=$start" : '')), + )); + + // Grab all pm data + $rowset = $pm_list = array(); + + // If the user is trying to reach late pages, start searching from the end + $store_reverse = false; + $sql_limit = $config['topics_per_page']; + if ($start > $pm_count / 2) + { + $store_reverse = true; + + // Select the sort order + $direction = ($sort_dir == 'd') ? 'ASC' : 'DESC'; + $sql_limit = $pagination->reverse_limit($start, $sql_limit, $pm_count); + $sql_start = $pagination->reverse_start($start, $sql_limit, $pm_count); + } + else + { + // Select the sort order + $direction = ($sort_dir == 'd') ? 'DESC' : 'ASC'; + $sql_start = $start; + } + + // Sql sort order + if (is_array($sort_by_sql[$sort_key])) + { + $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; + } + else + { + $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; + } + + $sql = 'SELECT t.*, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username, u.username_clean, u.user_colour, p.message_reported + FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . " u + WHERE t.user_id = $user_id + AND p.author_id = u.user_id + AND $folder_sql + AND t.msg_id = p.msg_id + $sql_limit_time + ORDER BY $sql_sort_order"; + $result = $db->sql_query_limit($sql, $sql_limit, $sql_start); + + $pm_reported = array(); + while ($row = $db->sql_fetchrow($result)) + { + $rowset[$row['msg_id']] = $row; + $pm_list[] = $row['msg_id']; + if ($row['message_reported']) + { + $pm_reported[] = $row['msg_id']; + } + } + $db->sql_freeresult($result); + + // Fetch the report_ids, if there are any reported pms. + if (!empty($pm_reported) && $auth->acl_getf_global('m_report')) + { + $sql = 'SELECT pm_id, report_id + FROM ' . REPORTS_TABLE . ' + WHERE report_closed = 0 + AND ' . $db->sql_in_set('pm_id', $pm_reported); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $rowset[$row['pm_id']]['report_id'] = $row['report_id']; + } + $db->sql_freeresult($result); + } + + $pm_list = ($store_reverse) ? array_reverse($pm_list) : $pm_list; + + return array( + 'pm_count' => $pm_count, + 'pm_list' => $pm_list, + 'rowset' => $rowset + ); +} diff --git a/sources/phpBB/includes/ucp/ucp_pm_viewmessage.php b/sources/phpBB/includes/ucp/ucp_pm_viewmessage.php new file mode 100644 index 0000000..888c2e6 --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -0,0 +1,423 @@ + +* @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; +} + +/** +* View private message +*/ +function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) +{ + global $user, $template, $auth, $db, $cache, $phpbb_container; + global $phpbb_root_path, $request, $phpEx, $config, $phpbb_dispatcher; + + $user->add_lang(array('viewtopic', 'memberlist')); + + $msg_id = (int) $msg_id; + $folder_id = (int) $folder_id; + $author_id = (int) $message_row['author_id']; + $view = request_var('view', ''); + + // Not able to view message, it was deleted by the sender + if ($message_row['pm_deleted']) + { + $meta_info = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&folder=$folder_id"); + $message = $user->lang['NO_AUTH_READ_REMOVED_MESSAGE']; + + $message .= '

' . sprintf($user->lang['RETURN_FOLDER'], '', ''); + trigger_error($message); + } + + // Do not allow hold messages to be seen + if ($folder_id == PRIVMSGS_HOLD_BOX) + { + trigger_error('NO_AUTH_READ_HOLD_MESSAGE'); + } + + // Grab icons + $icons = $cache->obtain_icons(); + + $bbcode = false; + + // Instantiate BBCode if need be + if ($message_row['bbcode_bitfield']) + { + include($phpbb_root_path . 'includes/bbcode.' . $phpEx); + $bbcode = new bbcode($message_row['bbcode_bitfield']); + } + + // Load the custom profile fields + if ($config['load_cpf_pm']) + { + $cp = $phpbb_container->get('profilefields.manager'); + + $profile_fields = $cp->grab_profile_fields_data($author_id); + } + + // Assign TO/BCC Addresses to template + write_pm_addresses(array('to' => $message_row['to_address'], 'bcc' => $message_row['bcc_address']), $author_id); + + $user_info = get_user_information($author_id, $message_row); + + // Parse the message and subject + $parse_flags = ($message_row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; + $message = generate_text_for_display($message_row['message_text'], $message_row['bbcode_uid'], $message_row['bbcode_bitfield'], $parse_flags, true); + + // Replace naughty words such as farty pants + $message_row['message_subject'] = censor_text($message_row['message_subject']); + + // Editing information + if ($message_row['message_edit_count'] && $config['display_last_edited']) + { + if (!$message_row['message_edit_user']) + { + $display_username = get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour']); + } + else + { + $edit_user_info = get_user_information($message_row['message_edit_user'], false); + $display_username = get_username_string('full', $message_row['message_edit_user'], $edit_user_info['username'], $edit_user_info['user_colour']); + } + $l_edited_by = '

' . $user->lang('EDITED_TIMES_TOTAL', (int) $message_row['message_edit_count'], $display_username, $user->format_date($message_row['message_edit_time'], false, true)); + } + else + { + $l_edited_by = ''; + } + + // Pull attachment data + $display_notice = false; + $attachments = array(); + + if ($message_row['message_attachment'] && $config['allow_pm_attach']) + { + if ($auth->acl_get('u_pm_download')) + { + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . " + WHERE post_msg_id = $msg_id + AND in_message = 1 + ORDER BY filetime DESC, post_msg_id ASC"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $attachments[] = $row; + } + $db->sql_freeresult($result); + + // No attachments exist, but message table thinks they do so go ahead and reset attach flags + if (!sizeof($attachments)) + { + $sql = 'UPDATE ' . PRIVMSGS_TABLE . " + SET message_attachment = 0 + WHERE msg_id = $msg_id"; + $db->sql_query($sql); + } + } + else + { + $display_notice = true; + } + } + + // Assign inline attachments + if (!empty($attachments)) + { + $update_count = array(); + parse_attachments(false, $message, $attachments, $update_count); + + // Update the attachment download counts + if (sizeof($update_count)) + { + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' + SET download_count = download_count + 1 + WHERE ' . $db->sql_in_set('attach_id', array_unique($update_count)); + $db->sql_query($sql); + } + } + + $user_info['sig'] = ''; + + $signature = ($message_row['enable_sig'] && $config['allow_sig'] && $auth->acl_get('u_sig') && $user->optionget('viewsigs')) ? $user_info['user_sig'] : ''; + + // End signature parsing, only if needed + if ($signature) + { + $parse_flags = ($user_info['user_sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; + $signature = generate_text_for_display($signature, $user_info['user_sig_bbcode_uid'], $user_info['user_sig_bbcode_bitfield'], $parse_flags, true); + } + + $url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm'); + + // Number of "to" recipients + $num_recipients = (int) preg_match_all('/:?(u|g)_([0-9]+):?/', $message_row['to_address'], $match); + + $bbcode_status = ($config['allow_bbcode'] && $config['auth_bbcode_pm'] && $auth->acl_get('u_pm_bbcode')) ? true : false; + + // Get the profile fields template data + $cp_row = array(); + if ($config['load_cpf_pm'] && isset($profile_fields[$author_id])) + { + // Filter the fields we don't want to show + foreach ($profile_fields[$author_id] as $used_ident => $profile_field) + { + if (!$profile_field['data']['field_show_on_pm']) + { + unset($profile_fields[$author_id][$used_ident]); + } + } + + if (isset($profile_fields[$author_id])) + { + $cp_row = $cp->generate_profile_fields_template_data($profile_fields[$author_id]); + } + } + + $u_pm = $u_jabber = ''; + + if ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_info['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) + { + $u_pm = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $author_id); + } + + if ($config['jab_enable'] && $user_info['user_jabber'] && $auth->acl_get('u_sendim')) + { + $u_jabber = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=jabber&u=' . $author_id); + } + + $msg_data = array( + 'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), + 'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), + 'MESSAGE_AUTHOR' => get_username_string('username', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), + 'U_MESSAGE_AUTHOR' => get_username_string('profile', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), + + 'RANK_TITLE' => $user_info['rank_title'], + 'RANK_IMG' => $user_info['rank_image'], + 'AUTHOR_AVATAR' => (isset($user_info['avatar'])) ? $user_info['avatar'] : '', + 'AUTHOR_JOINED' => $user->format_date($user_info['user_regdate']), + 'AUTHOR_POSTS' => (int) $user_info['user_posts'], + 'U_AUTHOR_POSTS' => ($config['load_search'] && $auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$author_id&sr=posts") : '', + 'CONTACT_USER' => $user->lang('CONTACT_USER', get_username_string('username', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username'])), + + 'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : ((isset($user_info['online']) && $user_info['online']) ? $user->img('icon_user_online', $user->lang['ONLINE']) : $user->img('icon_user_offline', $user->lang['OFFLINE'])), + 'S_ONLINE' => (!$config['load_onlinetrack']) ? false : ((isset($user_info['online']) && $user_info['online']) ? true : false), + 'DELETE_IMG' => $user->img('icon_post_delete', $user->lang['DELETE_MESSAGE']), + 'INFO_IMG' => $user->img('icon_post_info', $user->lang['VIEW_PM_INFO']), + 'PROFILE_IMG' => $user->img('icon_user_profile', $user->lang['READ_PROFILE']), + 'EMAIL_IMG' => $user->img('icon_contact_email', $user->lang['SEND_EMAIL']), + 'QUOTE_IMG' => $user->img('icon_post_quote', $user->lang['POST_QUOTE_PM']), + 'REPLY_IMG' => $user->img('button_pm_reply', $user->lang['POST_REPLY_PM']), + 'REPORT_IMG' => $user->img('icon_post_report', 'REPORT_PM'), + 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['POST_EDIT_PM']), + 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['PM']), + + 'SENT_DATE' => ($view == 'print') ? $user->format_date($message_row['message_time'], false, true) : $user->format_date($message_row['message_time']), + 'SUBJECT' => $message_row['message_subject'], + 'MESSAGE' => $message, + 'SIGNATURE' => ($message_row['enable_sig']) ? $signature : '', + 'EDITED_MESSAGE' => $l_edited_by, + 'MESSAGE_ID' => $message_row['msg_id'], + + 'U_PM' => $u_pm, + 'U_JABBER' => $u_jabber, + + 'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&mode=compose&action=delete&f=$folder_id&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_QUOTE' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=quote&f=$folder_id&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&mode=compose&action=edit&f=$folder_id&p=" . $message_row['msg_id'] : '', + 'U_POST_REPLY_PM' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $message_row['msg_id'] : '', + 'U_POST_REPLY_ALL' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=reply&f=$folder_id&reply_to_all=1&p=" . $message_row['msg_id'] : '', + 'U_PREVIOUS_PM' => "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=previous", + 'U_NEXT_PM' => "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=next", + + 'U_PM_ACTION' => $url . '&mode=compose&f=' . $folder_id . '&p=' . $message_row['msg_id'], + + 'S_HAS_ATTACHMENTS' => (sizeof($attachments)) ? true : false, + 'S_DISPLAY_NOTICE' => $display_notice && $message_row['message_attachment'], + 'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false, + 'S_SPECIAL_FOLDER' => in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)), + 'S_PM_RECIPIENTS' => $num_recipients, + 'S_BBCODE_ALLOWED' => ($bbcode_status) ? 1 : 0, + 'S_CUSTOM_FIELDS' => (!empty($cp_row['row'])) ? true : false, + + 'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '', + 'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '', + ); + + /** + * Modify pm and sender data before it is assigned to the template + * + * @event core.ucp_pm_view_messsage + * @var mixed id Active module category (can be int or string) + * @var string mode Active module + * @var int folder_id ID of the folder the message is in + * @var int msg_id ID of the private message + * @var array folder Array with data of user's message folders + * @var array message_row Array with message data + * @var array cp_row Array with senders custom profile field data + * @var array msg_data Template array with message data + * @since 3.1.0-a1 + */ + $vars = array( + 'id', + 'mode', + 'folder_id', + 'msg_id', + 'folder', + 'message_row', + 'cp_row', + 'msg_data', + ); + extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_messsage', compact($vars))); + + $template->assign_vars($msg_data); + + $contact_fields = array( + array( + 'ID' => 'pm', + 'NAME' => $user->lang['SEND_PRIVATE_MESSAGE'], + 'U_CONTACT' => $u_pm, + ), + array( + 'ID' => 'email', + 'NAME' => $user->lang['SEND_EMAIL'], + 'U_CONTACT' => $user_info['email'], + ), + array( + 'ID' => 'jabber', + 'NAME' => $user->lang['JABBER'], + 'U_CONTACT' => $u_jabber, + ), + ); + + foreach ($contact_fields as $field) + { + if ($field['U_CONTACT']) + { + $template->assign_block_vars('contact', $field); + } + } + + // Display the custom profile fields + if (!empty($cp_row['row'])) + { + $template->assign_vars($cp_row['row']); + + foreach ($cp_row['blockrow'] as $cp_block_row) + { + $template->assign_block_vars('custom_fields', $cp_block_row); + + if ($cp_block_row['S_PROFILE_CONTACT']) + { + $template->assign_block_vars('contact', array( + 'ID' => $cp_block_row['PROFILE_FIELD_IDENT'], + 'NAME' => $cp_block_row['PROFILE_FIELD_NAME'], + 'U_CONTACT' => $cp_block_row['PROFILE_FIELD_CONTACT'], + )); + } + } + } + + // Display not already displayed Attachments for this post, we already parsed them. ;) + if (isset($attachments) && sizeof($attachments)) + { + foreach ($attachments as $attachment) + { + $template->assign_block_vars('attachment', array( + 'DISPLAY_ATTACHMENT' => $attachment) + ); + } + } + + if (!isset($_REQUEST['view']) || $request->variable('view', '') != 'print') + { + // Message History + if (message_history($msg_id, $user->data['user_id'], $message_row, $folder)) + { + $template->assign_var('S_DISPLAY_HISTORY', true); + } + } +} + +/** +* Get user information (only for message display) +*/ +function get_user_information($user_id, $user_row) +{ + global $db, $auth, $user, $cache; + global $phpbb_root_path, $phpEx, $config; + + if (!$user_id) + { + return array(); + } + + if (empty($user_row)) + { + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . (int) $user_id; + $result = $db->sql_query($sql); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + // Some standard values + $user_row['online'] = false; + $user_row['rank_title'] = $user_row['rank_image'] = $user_row['rank_image_src'] = $user_row['email'] = ''; + + // Generate online information for user + if ($config['load_onlinetrack']) + { + $sql = 'SELECT session_user_id, MAX(session_time) as online_time, MIN(session_viewonline) AS viewonline + FROM ' . SESSIONS_TABLE . " + WHERE session_user_id = $user_id + GROUP BY session_user_id"; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $update_time = $config['load_online_time'] * 60; + if ($row) + { + $user_row['online'] = (time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline'))) ? true : false; + } + } + + $user_row['avatar'] = ($user->optionget('viewavatars')) ? phpbb_get_user_avatar($user_row) : ''; + + if (!function_exists('phpbb_get_user_rank')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } + + $user_rank_data = phpbb_get_user_rank($user_row, $user_row['user_posts']); + $user_row['rank_title'] = $user_rank_data['title']; + $user_row['rank_image'] = $user_rank_data['img']; + $user_row['rank_image_src'] = $user_rank_data['img_src']; + + if ((!empty($user_row['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_email')) + { + $user_row['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&u=$user_id") : ((($config['board_hide_emails'] && !$auth->acl_get('a_email')) || empty($user_row['user_email'])) ? '' : 'mailto:' . $user_row['user_email']); + } + + return $user_row; +} diff --git a/sources/phpBB/includes/ucp/ucp_prefs.php b/sources/phpBB/includes/ucp/ucp_prefs.php new file mode 100644 index 0000000..2195500 --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_prefs.php @@ -0,0 +1,492 @@ + +* @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; +} + +/** +* ucp_prefs +* Changing user preferences +*/ +class ucp_prefs +{ + var $u_action; + + function main($id, $mode) + { + global $config, $db, $user, $auth, $template, $phpbb_dispatcher, $phpbb_root_path, $phpEx; + + $submit = (isset($_POST['submit'])) ? true : false; + $error = $data = array(); + $s_hidden_fields = ''; + + switch ($mode) + { + 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']), + ); + + if ($data['notifymethod'] == NOTIFY_IM && (!$config['jab_enable'] || !$user->data['user_jabber'] || !@extension_loaded('xml'))) + { + // Jabber isnt enabled, or no jabber field filled in. Update the users table to be sure its correct. + $data['notifymethod'] = NOTIFY_BOTH; + } + + /** + * Add UCP edit global settings data before they are assigned to the template or submitted + * + * To assign data to the template, use $template->assign_vars() + * + * @event core.ucp_prefs_personal_data + * @var bool submit Do we display the form only + * or did the user press submit + * @var array data Array with current ucp options data + * @since 3.1.0-a1 + */ + $vars = array('submit', 'data'); + extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_data', compact($vars))); + + if ($submit) + { + if ($config['override_user_style']) + { + $data['user_style'] = (int) $config['default_style']; + } + else if (!phpbb_style_is_active($data['user_style'])) + { + $data['user_style'] = (int) $user->data['user_style']; + } + + $error = validate_data($data, array( + 'dateformat' => array('string', false, 1, 30), + 'lang' => array('language_iso_name'), + 'tz' => array('timezone'), + )); + + if (!check_form_key('ucp_prefs_personal')) + { + $error[] = 'FORM_INVALID'; + } + + if (!sizeof($error)) + { + $sql_ary = array( + 'user_allow_pm' => $data['allowpm'], + 'user_allow_viewemail' => $data['viewemail'], + 'user_allow_massemail' => $data['massemail'], + 'user_allow_viewonline' => ($auth->acl_get('u_hideonline')) ? !$data['hideonline'] : $user->data['user_allow_viewonline'], + 'user_notify_type' => $data['notifymethod'], + 'user_options' => $user->data['user_options'], + + 'user_dateformat' => $data['dateformat'], + 'user_lang' => $data['lang'], + 'user_timezone' => $data['tz'], + 'user_style' => $data['user_style'], + ); + + /** + * Update UCP edit global settings data on form submit + * + * @event core.ucp_prefs_personal_update_data + * @var array data Submitted display options data + * @var array sql_ary Display options data we update + * @since 3.1.0-a1 + */ + $vars = array('data', 'sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_update_data', compact($vars))); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + + meta_refresh(3, $this->u_action); + $message = $user->lang['PREFERENCES_UPDATED'] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + trigger_error($message); + } + + // Replace "error" strings with their real, localised form + $error = array_map(array($user, 'lang'), $error); + } + + $dateformat_options = ''; + + foreach ($user->lang['dateformats'] as $format => $null) + { + $dateformat_options .= ''; + } + + $s_custom = false; + + $dateformat_options .= ''; + + phpbb_timezone_select($template, $user, $data['tz'], true); + + // check if there are any user-selectable languages + $sql = 'SELECT COUNT(lang_id) as languages_count + FROM ' . LANG_TABLE; + $result = $db->sql_query($sql); + if ($db->sql_fetchfield('languages_count') > 1) + { + $s_more_languages = true; + } + else + { + $s_more_languages = false; + } + $db->sql_freeresult($result); + + // check if there are any user-selectable styles + $sql = 'SELECT COUNT(style_id) as styles_count + FROM ' . STYLES_TABLE . ' + WHERE style_active = 1'; + $result = $db->sql_query($sql); + if ($db->sql_fetchfield('styles_count') > 1) + { + $s_more_styles = true; + } + else + { + $s_more_styles = false; + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', + + 'S_NOTIFY_EMAIL' => ($data['notifymethod'] == NOTIFY_EMAIL) ? true : false, + 'S_NOTIFY_IM' => ($data['notifymethod'] == NOTIFY_IM) ? true : false, + 'S_NOTIFY_BOTH' => ($data['notifymethod'] == NOTIFY_BOTH) ? true : false, + 'S_VIEW_EMAIL' => $data['viewemail'], + 'S_MASS_EMAIL' => $data['massemail'], + 'S_ALLOW_PM' => $data['allowpm'], + 'S_HIDE_ONLINE' => $data['hideonline'], + + 'DATE_FORMAT' => $data['dateformat'], + 'A_DATE_FORMAT' => addslashes($data['dateformat']), + 'S_DATEFORMAT_OPTIONS' => $dateformat_options, + 'S_CUSTOM_DATEFORMAT' => $s_custom, + 'DEFAULT_DATEFORMAT' => $config['default_dateformat'], + 'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']), + + 'S_MORE_LANGUAGES' => $s_more_languages, + 'S_MORE_STYLES' => $s_more_styles, + + 'S_LANG_OPTIONS' => language_select($data['lang']), + 'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : style_select($data['user_style']), + 'S_CAN_HIDE_ONLINE' => ($auth->acl_get('u_hideonline')) ? true : false, + 'S_SELECT_NOTIFY' => ($config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml')) ? true : false) + ); + + break; + + case 'view': + + 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')), + ); + + /** + * Add UCP edit display options data before they are assigned to the template or submitted + * + * To assign data to the template, use $template->assign_vars() + * + * @event core.ucp_prefs_view_data + * @var bool submit Do we display the form only + * or did the user press submit + * @var array data Array with current ucp options data + * @since 3.1.0-a1 + */ + $vars = array('submit', 'data'); + extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_data', compact($vars))); + + if ($submit) + { + $error = validate_data($data, array( + 'topic_sk' => array( + array('string', false, 1, 1), + array('match', false, '#(a|r|s|t|v)#'), + ), + 'topic_sd' => array( + array('string', false, 1, 1), + array('match', false, '#(a|d)#'), + ), + 'post_sk' => array( + array('string', false, 1, 1), + array('match', false, '#(a|s|t)#'), + ), + 'post_sd' => array( + array('string', false, 1, 1), + array('match', false, '#(a|d)#'), + ), + )); + + if (!check_form_key('ucp_prefs_view')) + { + $error[] = 'FORM_INVALID'; + } + + if (!sizeof($error)) + { + $user->optionset('viewimg', $data['images']); + $user->optionset('viewflash', $data['flash']); + $user->optionset('viewsmilies', $data['smilies']); + $user->optionset('viewsigs', $data['sigs']); + $user->optionset('viewavatars', $data['avatars']); + + if ($auth->acl_get('u_chgcensors')) + { + $user->optionset('viewcensors', $data['wordcensor']); + } + + $sql_ary = array( + 'user_options' => $user->data['user_options'], + 'user_topic_sortby_type' => $data['topic_sk'], + 'user_post_sortby_type' => $data['post_sk'], + 'user_topic_sortby_dir' => $data['topic_sd'], + 'user_post_sortby_dir' => $data['post_sd'], + + 'user_topic_show_days' => $data['topic_st'], + 'user_post_show_days' => $data['post_st'], + ); + + /** + * Update UCP edit display options data on form submit + * + * @event core.ucp_prefs_view_update_data + * @var array data Submitted display options data + * @var array sql_ary Display options data we update + * @since 3.1.0-a1 + */ + $vars = array('data', 'sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_update_data', compact($vars))); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + + meta_refresh(3, $this->u_action); + $message = $user->lang['PREFERENCES_UPDATED'] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + trigger_error($message); + } + + // Replace "error" strings with their real, localised form + $error = array_map(array($user, 'lang'), $error); + } + + $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); + + // Topic ordering options + $limit_topic_days = array(0 => $user->lang['ALL_TOPICS'], 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_topic_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']); + $sort_by_topic_sql = array('a' => 't.topic_first_poster_name', 't' => array('t.topic_last_post_time', 't.topic_last_post_id'), 'r' => 't.topic_posts_approved', 's' => 't.topic_title', 'v' => 't.topic_views'); + + // Post ordering options + $limit_post_days = array(0 => $user->lang['ALL_POSTS'], 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_post_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); + $sort_by_post_sql = array('a' => 'u.username_clean', 't' => 'p.post_id', 's' => 'p.post_subject'); + + $_options = array('topic', 'post'); + foreach ($_options as $sort_option) + { + ${'s_limit_' . $sort_option . '_days'} = ''; + + ${'s_sort_' . $sort_option . '_key'} = ''; + + ${'s_sort_' . $sort_option . '_dir'} = ''; + } + + $template->assign_vars(array( + 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', + + 'S_IMAGES' => $data['images'], + 'S_FLASH' => $data['flash'], + 'S_SMILIES' => $data['smilies'], + 'S_SIGS' => $data['sigs'], + 'S_AVATARS' => $data['avatars'], + 'S_DISABLE_CENSORS' => $data['wordcensor'], + + 'S_CHANGE_CENSORS' => ($auth->acl_get('u_chgcensors') && $config['allow_nocensors']) ? true : false, + + 'S_TOPIC_SORT_DAYS' => $s_limit_topic_days, + 'S_TOPIC_SORT_KEY' => $s_sort_topic_key, + 'S_TOPIC_SORT_DIR' => $s_sort_topic_dir, + 'S_POST_SORT_DAYS' => $s_limit_post_days, + 'S_POST_SORT_KEY' => $s_sort_post_key, + 'S_POST_SORT_DIR' => $s_sort_post_dir) + ); + + break; + + 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']), + ); + add_form_key('ucp_prefs_post'); + + /** + * Add UCP edit posting defaults data before they are assigned to the template or submitted + * + * To assign data to the template, use $template->assign_vars() + * + * @event core.ucp_prefs_post_data + * @var bool submit Do we display the form only + * or did the user press submit + * @var array data Array with current ucp options data + * @since 3.1.0-a1 + */ + $vars = array('submit', 'data'); + extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_post_data', compact($vars))); + + if ($submit) + { + if (check_form_key('ucp_prefs_post')) + { + $user->optionset('bbcode', $data['bbcode']); + $user->optionset('smilies', $data['smilies']); + $user->optionset('attachsig', $data['sig']); + + $sql_ary = array( + 'user_options' => $user->data['user_options'], + 'user_notify' => $data['notify'], + ); + + /** + * Update UCP edit posting defaults data on form submit + * + * @event core.ucp_prefs_post_update_data + * @var array data Submitted display options data + * @var array sql_ary Display options data we update + * @since 3.1.0-a1 + */ + $vars = array('data', 'sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_post_update_data', compact($vars))); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + + $msg = $user->lang['PREFERENCES_UPDATED']; + } + else + { + $msg = $user->lang['FORM_INVALID']; + } + meta_refresh(3, $this->u_action); + $message = $msg . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + trigger_error($message); + } + + $template->assign_vars(array( + 'S_BBCODE' => $data['bbcode'], + 'S_SMILIES' => $data['smilies'], + 'S_SIG' => $data['sig'], + 'S_NOTIFY' => $data['notify']) + ); + break; + } + + /** + * Modify UCP preferences data before the page load + * + * @event core.ucp_prefs_modify_common + * @var array data Array with current/submitted UCP options data + * @var array error Errors data + * @var string mode UCP prefs operation mode + * @var string s_hidden_fields Hidden fields data + * @since 3.1.0-RC3 + */ + $vars = array( + 'data', + 'error', + 'mode', + 's_hidden_fields', + ); + extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_modify_common', compact($vars))); + + $template->assign_vars(array( + 'L_TITLE' => $user->lang['UCP_PREFS_' . strtoupper($mode)], + + 'S_HIDDEN_FIELDS' => $s_hidden_fields, + 'S_UCP_ACTION' => $this->u_action) + ); + + $this->tpl_name = 'ucp_prefs_' . $mode; + $this->page_title = 'UCP_PREFS_' . strtoupper($mode); + } +} diff --git a/sources/phpBB/includes/ucp/ucp_profile.php b/sources/phpBB/includes/ucp/ucp_profile.php new file mode 100644 index 0000000..a876d01 --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_profile.php @@ -0,0 +1,713 @@ + +* @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; +} + +/** +* ucp_profile +* Changing profile settings +* +* @todo what about pertaining user_sig_options? +*/ +class ucp_profile +{ + var $u_action; + + function main($id, $mode) + { + global $cache, $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; + global $request, $phpbb_container; + + $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(); + $s_hidden_fields = ''; + + switch ($mode) + { + 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'])), + 'new_password' => $request->variable('new_password', '', true), + 'cur_password' => $request->variable('cur_password', '', true), + 'password_confirm' => $request->variable('password_confirm', '', true), + ); + + add_form_key('ucp_reg_details'); + + if ($submit) + { + // Do not check cur_password, it is the old one. + $check_ary = array( + 'new_password' => array( + array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), + array('password')), + 'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), + 'email' => array( + array('string', false, 6, 60), + array('user_email')), + ); + + if ($auth->acl_get('u_chgname') && $config['allow_namechange']) + { + $check_ary['username'] = array( + array('string', false, $config['min_name_chars'], $config['max_name_chars']), + array('username'), + ); + } + + $error = validate_data($data, $check_ary); + + if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password']) + { + $error[] = ($data['password_confirm']) ? 'NEW_PASSWORD_ERROR' : 'NEW_PASSWORD_CONFIRM_EMPTY'; + } + + // Instantiate passwords manager + $passwords_manager = $phpbb_container->get('passwords.manager'); + + // Only check the new password against the previous password if there have been no errors + if (!sizeof($error) && $auth->acl_get('u_chgpasswd') && $data['new_password'] && $passwords_manager->check($data['new_password'], $user->data['user_password'])) + { + $error[] = 'SAME_PASSWORD_ERROR'; + } + + if (!$passwords_manager->check($data['cur_password'], $user->data['user_password'])) + { + $error[] = ($data['cur_password']) ? 'CUR_PASSWORD_ERROR' : 'CUR_PASSWORD_EMPTY'; + } + + if (!check_form_key('ucp_reg_details')) + { + $error[] = 'FORM_INVALID'; + } + + if (!sizeof($error)) + { + $sql_ary = array( + 'username' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? $data['username'] : $user->data['username'], + 'username_clean' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? utf8_clean_string($data['username']) : $user->data['username_clean'], + 'user_email' => ($auth->acl_get('u_chgemail')) ? $data['email'] : $user->data['user_email'], + 'user_email_hash' => ($auth->acl_get('u_chgemail')) ? phpbb_email_hash($data['email']) : $user->data['user_email_hash'], + 'user_password' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? $passwords_manager->hash($data['new_password']) : $user->data['user_password'], + 'user_passchg' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? time() : 0, + ); + + 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']); + } + + 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']); + } + + 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']); + } + + $message = 'PROFILE_UPDATED'; + + if ($auth->acl_get('u_chgemail') && $config['email_enable'] && $data['email'] != $user->data['user_email'] && $user->data['user_type'] != USER_FOUNDER && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN)) + { + $message = ($config['require_activation'] == USER_ACTIVATION_SELF) ? 'ACCOUNT_EMAIL_CHANGED' : 'ACCOUNT_EMAIL_CHANGED_ADMIN'; + + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $server_url = generate_board_url(); + + $user_actkey = gen_rand_string(mt_rand(6, 10)); + + $messenger = new messenger(false); + + $template_file = ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? 'user_activate_inactive' : 'user_activate'; + $messenger->template($template_file, $user->data['user_lang']); + + $messenger->to($data['email'], $data['username']); + + $messenger->anti_abuse_headers($config, $user); + + $messenger->assign_vars(array( + 'USERNAME' => htmlspecialchars_decode($data['username']), + 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey") + ); + + $messenger->send(NOTIFY_EMAIL); + + if ($config['require_activation'] == USER_ACTIVATION_ADMIN) + { + // Grab an array of user_id's with a_user permissions ... these users can activate a user + $admin_ary = $auth->acl_get_list(false, 'a_user', false); + $admin_ary = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array(); + + // Also include founders + $where_sql = ' WHERE user_type = ' . USER_FOUNDER; + + if (sizeof($admin_ary)) + { + $where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary); + } + + $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type + FROM ' . USERS_TABLE . ' ' . + $where_sql; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $messenger->template('admin_activate', $row['user_lang']); + $messenger->set_addresses($row); + + $messenger->assign_vars(array( + 'USERNAME' => htmlspecialchars_decode($data['username']), + 'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}", + 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey") + ); + + $messenger->send($row['user_notify_type']); + } + $db->sql_freeresult($result); + } + + user_active_flip('deactivate', $user->data['user_id'], INACTIVE_PROFILE); + + // Because we want the profile to be reactivated we set user_newpasswd to empty (else the reactivation will fail) + $sql_ary['user_actkey'] = $user_actkey; + $sql_ary['user_newpasswd'] = ''; + } + + if (sizeof($sql_ary)) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + } + + // Need to update config, forum, topic, posting, messages, etc. + if ($data['username'] != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange']) + { + user_update_name($user->data['username'], $data['username']); + } + + // Now, we can remove the user completely (kill the session) - NOT BEFORE!!! + if (!empty($sql_ary['user_actkey'])) + { + meta_refresh(5, append_sid($phpbb_root_path . 'index.' . $phpEx)); + $message = $user->lang[$message] . '

' . sprintf($user->lang['RETURN_INDEX'], '', ''); + + // Because the user gets deactivated we log him out too, killing his session + $user->session_kill(); + } + else + { + meta_refresh(3, $this->u_action); + $message = $user->lang[$message] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + } + + trigger_error($message); + } + + // Replace "error" strings with their real, localised form + $error = array_map(array($user, 'lang'), $error); + } + + $template->assign_vars(array( + 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', + + 'USERNAME' => $data['username'], + 'EMAIL' => $data['email'], + 'PASSWORD_CONFIRM' => $data['password_confirm'], + 'NEW_PASSWORD' => $data['new_password'], + 'CUR_PASSWORD' => '', + + 'L_USERNAME_EXPLAIN' => $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_name_chars']), $user->lang('CHARACTERS', (int) $config['max_name_chars'])), + 'L_CHANGE_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])), + + 'S_FORCE_PASSWORD' => ($auth->acl_get('u_chgpasswd') && $config['chg_passforce'] && $user->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400)) ? true : false, + 'S_CHANGE_USERNAME' => ($config['allow_namechange'] && $auth->acl_get('u_chgname')) ? true : false, + 'S_CHANGE_EMAIL' => ($auth->acl_get('u_chgemail')) ? true : false, + 'S_CHANGE_PASSWORD' => ($auth->acl_get('u_chgpasswd')) ? true : false) + ); + break; + + case 'profile_info': + // Do not display profile information panel if not authed to do so + if (!$auth->acl_get('u_chgprofileinfo')) + { + trigger_error('NO_AUTH_PROFILEINFO'); + } + + $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)), + ); + + if ($config['allow_birthdays']) + { + $data['bday_day'] = $data['bday_month'] = $data['bday_year'] = 0; + + if ($user->data['user_birthday']) + { + 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['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']); + } + + add_form_key('ucp_profile_info'); + + if ($submit) + { + $validate_array = array( + 'jabber' => array( + array('string', true, 5, 255), + array('jabber')), + ); + + if ($config['allow_birthdays']) + { + $validate_array = array_merge($validate_array, array( + 'bday_day' => array('num', true, 1, 31), + 'bday_month' => array('num', true, 1, 12), + 'bday_year' => array('num', true, 1901, gmdate('Y', time()) + 50), + 'user_birthday' => array('date', true), + )); + } + + $error = validate_data($data, $validate_array); + + // validate custom profile fields + $cp->submit_cp_field('profile', $user->get_iso_lang_id(), $cp_data, $cp_error); + + if (sizeof($cp_error)) + { + $error = array_merge($error, $cp_error); + } + + if (!check_form_key('ucp_profile_info')) + { + $error[] = 'FORM_INVALID'; + } + + if (!sizeof($error)) + { + $data['notify'] = $user->data['user_notify_type']; + + if ($data['notify'] == NOTIFY_IM && (!$config['jab_enable'] || !$data['jabber'] || !@extension_loaded('xml'))) + { + // User has not filled in a jabber address (Or one of the modules is disabled or jabber is disabled) + // Disable notify by Jabber now for this user. + $data['notify'] = NOTIFY_EMAIL; + } + + $sql_ary = array( + 'user_jabber' => $data['jabber'], + 'user_notify_type' => $data['notify'], + ); + + if ($config['allow_birthdays']) + { + $sql_ary['user_birthday'] = $data['user_birthday']; + } + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + + // Update Custom Fields + $cp->update_profile_field_data($user->data['user_id'], $cp_data); + + meta_refresh(3, $this->u_action); + $message = $user->lang['PROFILE_UPDATED'] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + trigger_error($message); + } + + // Replace "error" strings with their real, localised form + $error = array_map(array($user, 'lang'), $error); + } + + if ($config['allow_birthdays']) + { + $s_birthday_day_options = ''; + for ($i = 1; $i < 32; $i++) + { + $selected = ($i == $data['bday_day']) ? ' selected="selected"' : ''; + $s_birthday_day_options .= ""; + } + + $s_birthday_month_options = ''; + for ($i = 1; $i < 13; $i++) + { + $selected = ($i == $data['bday_month']) ? ' selected="selected"' : ''; + $s_birthday_month_options .= ""; + } + $s_birthday_year_options = ''; + + $now = getdate(); + $s_birthday_year_options = ''; + for ($i = $now['year'] - 100; $i <= $now['year']; $i++) + { + $selected = ($i == $data['bday_year']) ? ' selected="selected"' : ''; + $s_birthday_year_options .= ""; + } + unset($now); + + $template->assign_vars(array( + 'S_BIRTHDAY_DAY_OPTIONS' => $s_birthday_day_options, + 'S_BIRTHDAY_MONTH_OPTIONS' => $s_birthday_month_options, + 'S_BIRTHDAY_YEAR_OPTIONS' => $s_birthday_year_options, + 'S_BIRTHDAYS_ENABLED' => true, + )); + } + + $template->assign_vars(array( + 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', + 'S_JABBER_ENABLED' => $config['jab_enable'], + 'JABBER' => $data['jabber'], + )); + + // Get additional profile fields and assign them to the template block var 'profile_fields' + $user->get_profile_fields($user->data['user_id']); + + $cp->generate_profile_fields('profile', $user->get_iso_lang_id()); + + break; + + case 'signature': + + if (!$auth->acl_get('u_sig')) + { + trigger_error('NO_AUTH_SIGNATURE'); + } + + 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; + + $signature = utf8_normalize_nfc(request_var('signature', (string) $user->data['user_sig'], true)); + + add_form_key('ucp_sig'); + + if ($submit || $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; + + if (!sizeof($error)) + { + $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('
', $message_parser->warn_msg); + } + + if (!check_form_key('ucp_sig')) + { + $error[] = 'FORM_INVALID'; + } + + 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 = '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'] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + 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); + } + + decode_message($signature, $user->data['user_sig_bbcode_uid']); + + $template->assign_vars(array( + 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', + 'SIGNATURE' => $signature, + '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'], '', '') : sprintf($user->lang['BBCODE_IS_OFF'], '', ''), + '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'], + 'URL_STATUS' => ($config['allow_sig_links']) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'], + 'MAX_FONT_SIZE' => (int) $config['max_sig_font_size'], + + 'L_SIGNATURE_EXPLAIN' => $user->lang('SIGNATURE_EXPLAIN', (int) $config['max_sig_chars']), + + 'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'], + 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'], + 'S_BBCODE_IMG' => ($config['allow_sig_img']) ? true : false, + 'S_BBCODE_FLASH' => ($config['allow_sig_flash']) ? true : false, + 'S_LINKS_ALLOWED' => ($config['allow_sig_links']) ? true : false) + ); + + // Build custom bbcodes array + display_custom_bbcodes(); + + // Generate smiley listing + generate_smilies('inline', 0); + + break; + + case 'avatar': + + add_form_key('ucp_avatar'); + + $avatars_enabled = false; + + if ($config['allow_avatar'] && $auth->acl_get('u_chgavatar')) + { + $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); + $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); + + // This is normalised data, without the user_ prefix + $avatar_data = \phpbb\avatar\manager::clean_row($user->data, 'user'); + + if ($submit) + { + if (check_form_key('ucp_avatar')) + { + $driver_name = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', '')); + + if (in_array($driver_name, $avatar_drivers) && !$request->is_set_post('avatar_delete')) + { + $driver = $phpbb_avatar_manager->get_driver($driver_name); + $result = $driver->process_form($request, $template, $user, $avatar_data, $error); + + if ($result && empty($error)) + { + // Success! Lets save the result in the database + $result = array( + 'user_avatar_type' => $driver_name, + 'user_avatar' => $result['avatar'], + 'user_avatar_width' => $result['avatar_width'], + 'user_avatar_height' => $result['avatar_height'], + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $result) . ' + WHERE user_id = ' . (int) $user->data['user_id']; + + $db->sql_query($sql); + + meta_refresh(3, $this->u_action); + $message = $user->lang['PROFILE_UPDATED'] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + trigger_error($message); + } + } + } + else + { + $error[] = 'FORM_INVALID'; + } + } + + // Handle deletion of avatars + if ($request->is_set_post('avatar_delete')) + { + if (!confirm_box(true)) + { + confirm_box(false, $user->lang('CONFIRM_AVATAR_DELETE'), build_hidden_fields(array( + 'avatar_delete' => true, + 'i' => $id, + 'mode' => $mode)) + ); + } + else + { + $phpbb_avatar_manager->handle_avatar_delete($db, $user, $avatar_data, USERS_TABLE, 'user_'); + + meta_refresh(3, $this->u_action); + $message = $user->lang['PROFILE_UPDATED'] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + trigger_error($message); + } + } + + $selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $user->data['user_avatar_type'])); + + foreach ($avatar_drivers as $current_driver) + { + $driver = $phpbb_avatar_manager->get_driver($current_driver); + + $avatars_enabled = true; + $template->set_filenames(array( + 'avatar' => $driver->get_template_name(), + )); + + if ($driver->prepare_form($request, $template, $user, $avatar_data, $error)) + { + $driver_name = $phpbb_avatar_manager->prepare_driver_name($current_driver); + $driver_upper = strtoupper($driver_name); + + $template->assign_block_vars('avatar_drivers', array( + 'L_TITLE' => $user->lang($driver_upper . '_TITLE'), + 'L_EXPLAIN' => $user->lang($driver_upper . '_EXPLAIN'), + + 'DRIVER' => $driver_name, + 'SELECTED' => $current_driver == $selected_driver, + 'OUTPUT' => $template->assign_display('avatar'), + )); + } + } + + // Replace "error" strings with their real, localised form + $error = $phpbb_avatar_manager->localize_errors($user, $error); + } + + $avatar = phpbb_get_user_avatar($user->data, 'USER_AVATAR', true); + + $template->assign_vars(array( + 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', + 'AVATAR' => $avatar, + + 'S_FORM_ENCTYPE' => ' enctype="multipart/form-data"', + + 'L_AVATAR_EXPLAIN' => phpbb_avatar_explanation_string(), + + 'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled), + )); + + break; + + case 'autologin_keys': + + add_form_key('ucp_autologin_keys'); + + if ($submit) + { + $keys = request_var('keys', array('')); + + if (!check_form_key('ucp_autologin_keys')) + { + $error[] = 'FORM_INVALID'; + } + + if (!sizeof($error)) + { + if (!empty($keys)) + { + foreach ($keys as $key => $id) + { + $keys[$key] = $db->sql_like_expression($id . $db->get_any_char()); + } + $sql_where = '(key_id ' . implode(' OR key_id ', $keys) . ')'; + $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' + WHERE user_id = ' . (int) $user->data['user_id'] . ' + AND ' . $sql_where ; + + $db->sql_query($sql); + + meta_refresh(3, $this->u_action); + $message = $user->lang['AUTOLOGIN_SESSION_KEYS_DELETED'] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + trigger_error($message); + } + } + + // Replace "error" strings with their real, localised form + $error = array_map(array($user, 'lang'), $error); + } + + $sql = 'SELECT key_id, last_ip, last_login + FROM ' . SESSIONS_KEYS_TABLE . ' + WHERE user_id = ' . (int) $user->data['user_id'] . ' + ORDER BY last_login ASC'; + + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('sessions', array( + 'KEY' => substr($row['key_id'], 0, 8), + 'IP' => $row['last_ip'], + 'LOGIN_TIME' => $user->format_date($row['last_login']), + )); + } + + $db->sql_freeresult($result); + + break; + } + + $template->assign_vars(array( + 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', + + 'L_TITLE' => $user->lang['UCP_PROFILE_' . strtoupper($mode)], + + 'S_HIDDEN_FIELDS' => $s_hidden_fields, + 'S_UCP_ACTION' => $this->u_action) + ); + + // Set desired template + $this->tpl_name = 'ucp_profile_' . $mode; + $this->page_title = 'UCP_PROFILE_' . strtoupper($mode); + } +} diff --git a/sources/phpBB/includes/ucp/ucp_register.php b/sources/phpBB/includes/ucp/ucp_register.php new file mode 100644 index 0000000..14f6a8b --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_register.php @@ -0,0 +1,535 @@ + +* @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; +} + +/** +* ucp_register +* Board registration +*/ +class ucp_register +{ + var $u_action; + + function main($id, $mode) + { + global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; + global $request, $phpbb_container; + + // + if ($config['require_activation'] == USER_ACTIVATION_DISABLE || + (in_array($config['require_activation'], array(USER_ACTIVATION_SELF, USER_ACTIVATION_ADMIN)) && !$config['email_enable'])) + { + trigger_error('UCP_REGISTER_DISABLE'); + } + + $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); + + if ($agreed) + { + add_form_key('ucp_register'); + } + else + { + add_form_key('ucp_register_terms'); + } + + if ($change_lang || $user_lang != $config['default_lang']) + { + $use_lang = ($change_lang) ? basename($change_lang) : basename($user_lang); + + if (!validate_language_iso_name($use_lang)) + { + if ($change_lang) + { + $submit = false; + + // Setting back agreed to let the user view the agreement in his/her language + $agreed = false; + } + + $user_lang = $use_lang; + } + else + { + $change_lang = ''; + $user_lang = $user->lang_name; + } + } + + $cp = $phpbb_container->get('profilefields.manager'); + + $error = $cp_data = $cp_error = array(); + $s_hidden_fields = array(); + + // Handle login_link data added to $_hidden_fields + $login_link_data = $this->get_login_link_data_array(); + + if (!empty($login_link_data)) + { + // Confirm that we have all necessary data + $provider_collection = $phpbb_container->get('auth.provider_collection'); + $auth_provider = $provider_collection->get_provider($request->variable('auth_provider', '')); + + $result = $auth_provider->login_link_has_necessary_data($login_link_data); + if ($result !== null) + { + $error[] = $user->lang[$result]; + } + + $s_hidden_fields = array_merge($s_hidden_fields, $this->get_login_link_data_for_hidden_fields($login_link_data)); + } + + if (!$agreed || ($coppa === false && $config['coppa_enable']) || ($coppa && !$config['coppa_enable'])) + { + $add_coppa = ($coppa !== false) ? '&coppa=' . $coppa : ''; + + $s_hidden_fields = array_merge($s_hidden_fields, array( + 'change_lang' => '', + )); + + // If we change the language, we want to pass on some more possible parameter. + if ($change_lang) + { + // 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', '')), + 'lang' => $user->lang_name, + 'tz' => request_var('tz', $config['board_timezone']), + )); + + } + + // Checking amount of available languages + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE; + $result = $db->sql_query($sql); + + $lang_row = array(); + while ($row = $db->sql_fetchrow($result)) + { + $lang_row[] = $row; + } + $db->sql_freeresult($result); + + if ($coppa === false && $config['coppa_enable']) + { + $now = getdate(); + $coppa_birthday = $user->create_datetime() + ->setDate($now['year'] - 13, $now['mon'], $now['mday'] - 1) + ->setTime(0, 0, 0) + ->format($user->lang['DATE_FORMAT'], true); + unset($now); + + $template->assign_vars(array( + 'S_LANG_OPTIONS' => (sizeof($lang_row) > 1) ? language_select($user_lang) : '', + 'L_COPPA_NO' => sprintf($user->lang['UCP_COPPA_BEFORE'], $coppa_birthday), + 'L_COPPA_YES' => sprintf($user->lang['UCP_COPPA_ON_AFTER'], $coppa_birthday), + + 'U_COPPA_NO' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=0'), + 'U_COPPA_YES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=1'), + + 'S_SHOW_COPPA' => true, + 'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields), + 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'), + + 'COOKIE_NAME' => $config['cookie_name'], + 'COOKIE_PATH' => $config['cookie_path'], + )); + } + else + { + $template->assign_vars(array( + 'S_LANG_OPTIONS' => (sizeof($lang_row) > 1) ? language_select($user_lang) : '', + 'L_TERMS_OF_USE' => sprintf($user->lang['TERMS_OF_USE_CONTENT'], $config['sitename'], generate_board_url()), + + 'S_SHOW_COPPA' => false, + 'S_REGISTRATION' => true, + 'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields), + 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_coppa), + + 'COOKIE_NAME' => $config['cookie_name'], + 'COOKIE_PATH' => $config['cookie_path'], + ) + ); + } + unset($lang_row); + + $this->tpl_name = 'ucp_agreement'; + return; + } + + // The CAPTCHA kicks in here. We can't help that the information gets lost on language change. + if ($config['enable_confirm']) + { + $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']); + $captcha->init(CONFIRM_REG); + } + + $timezone = $config['board_timezone']; + + $data = array( + 'username' => utf8_normalize_nfc(request_var('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), + ); + + // Check and initialize some variables if needed + if ($submit) + { + $error = validate_data($data, array( + 'username' => array( + array('string', false, $config['min_name_chars'], $config['max_name_chars']), + array('username', '')), + 'new_password' => array( + array('string', false, $config['min_pass_chars'], $config['max_pass_chars']), + array('password')), + 'password_confirm' => array('string', false, $config['min_pass_chars'], $config['max_pass_chars']), + 'email' => array( + array('string', false, 6, 60), + array('user_email')), + 'tz' => array('timezone'), + 'lang' => array('language_iso_name'), + )); + + if (!check_form_key('ucp_register')) + { + $error[] = $user->lang['FORM_INVALID']; + } + + // Replace "error" strings with their real, localised form + $error = array_map(array($user, 'lang'), $error); + + if ($config['enable_confirm']) + { + $vc_response = $captcha->validate($data); + if ($vc_response !== false) + { + $error[] = $vc_response; + } + + if ($config['max_reg_attempts'] && $captcha->get_attempt_count() > $config['max_reg_attempts']) + { + $error[] = $user->lang['TOO_MANY_REGISTERS']; + } + } + + // DNSBL check + if ($config['check_dnsbl']) + { + if (($dnsbl = $user->check_dnsbl('register')) !== false) + { + $error[] = sprintf($user->lang['IP_BLACKLISTED'], $user->ip, $dnsbl[1]); + } + } + + // validate custom profile fields + $cp->submit_cp_field('register', $user->get_iso_lang_id(), $cp_data, $error); + + if (!sizeof($error)) + { + if ($data['new_password'] != $data['password_confirm']) + { + $error[] = $user->lang['NEW_PASSWORD_ERROR']; + } + } + + if (!sizeof($error)) + { + $server_url = generate_board_url(); + + // Which group by default? + $group_name = ($coppa) ? 'REGISTERED_COPPA' : 'REGISTERED'; + + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = '" . $db->sql_escape($group_name) . "' + AND group_type = " . GROUP_SPECIAL; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + trigger_error('NO_GROUP'); + } + + $group_id = $row['group_id']; + + if (($coppa || + $config['require_activation'] == USER_ACTIVATION_SELF || + $config['require_activation'] == USER_ACTIVATION_ADMIN) && $config['email_enable']) + { + $user_actkey = gen_rand_string(mt_rand(6, 10)); + $user_type = USER_INACTIVE; + $user_inactive_reason = INACTIVE_REGISTER; + $user_inactive_time = time(); + } + else + { + $user_type = USER_NORMAL; + $user_actkey = ''; + $user_inactive_reason = 0; + $user_inactive_time = 0; + } + + // Instantiate passwords manager + $passwords_manager = $phpbb_container->get('passwords.manager'); + + $user_row = array( + 'username' => $data['username'], + 'user_password' => $passwords_manager->hash($data['new_password']), + 'user_email' => $data['email'], + 'group_id' => (int) $group_id, + 'user_timezone' => $data['tz'], + 'user_lang' => $data['lang'], + 'user_type' => $user_type, + 'user_actkey' => $user_actkey, + 'user_ip' => $user->ip, + 'user_regdate' => time(), + 'user_inactive_reason' => $user_inactive_reason, + 'user_inactive_time' => $user_inactive_time, + ); + + if ($config['new_member_post_limit']) + { + $user_row['user_new'] = 1; + } + + // Register user... + $user_id = user_add($user_row, $cp_data); + + // This should not happen, because the required variables are listed above... + if ($user_id === false) + { + trigger_error('NO_USER', E_USER_ERROR); + } + + // Okay, captcha, your job is done. + if ($config['enable_confirm'] && isset($captcha)) + { + $captcha->reset(); + } + + if ($coppa && $config['email_enable']) + { + $message = $user->lang['ACCOUNT_COPPA']; + $email_template = 'coppa_welcome_inactive'; + } + else if ($config['require_activation'] == USER_ACTIVATION_SELF && $config['email_enable']) + { + $message = $user->lang['ACCOUNT_INACTIVE']; + $email_template = 'user_welcome_inactive'; + } + else if ($config['require_activation'] == USER_ACTIVATION_ADMIN && $config['email_enable']) + { + $message = $user->lang['ACCOUNT_INACTIVE_ADMIN']; + $email_template = 'admin_welcome_inactive'; + } + else + { + $message = $user->lang['ACCOUNT_ADDED']; + $email_template = 'user_welcome'; + } + + if ($config['email_enable']) + { + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $messenger = new messenger(false); + + $messenger->template($email_template, $data['lang']); + + $messenger->to($data['email'], $data['username']); + + $messenger->anti_abuse_headers($config, $user); + + $messenger->assign_vars(array( + 'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])), + 'USERNAME' => htmlspecialchars_decode($data['username']), + 'PASSWORD' => htmlspecialchars_decode($data['new_password']), + 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey") + ); + + if ($coppa) + { + $messenger->assign_vars(array( + 'FAX_INFO' => $config['coppa_fax'], + 'MAIL_INFO' => $config['coppa_mail'], + 'EMAIL_ADDRESS' => $data['email']) + ); + } + + $messenger->send(NOTIFY_EMAIL); + } + + if ($config['require_activation'] == USER_ACTIVATION_ADMIN) + { + $phpbb_notifications = $phpbb_container->get('notification_manager'); + $phpbb_notifications->add_notifications('notification.type.admin_activate_user', array( + 'user_id' => $user_id, + 'user_actkey' => $user_row['user_actkey'], + 'user_regdate' => $user_row['user_regdate'], + )); + } + + // Perform account linking if necessary + if (!empty($login_link_data)) + { + $login_link_data['user_id'] = $user_id; + + $result = $auth_provider->link_account($login_link_data); + + if ($result) + { + $message = $message . '

' . $user->lang[$result]; + } + } + + $message = $message . '

' . sprintf($user->lang['RETURN_INDEX'], '', ''); + trigger_error($message); + } + } + + $s_hidden_fields = array_merge($s_hidden_fields, array( + 'agreed' => 'true', + 'change_lang' => 0, + )); + + if ($config['coppa_enable']) + { + $s_hidden_fields['coppa'] = $coppa; + } + + if ($config['enable_confirm']) + { + $s_hidden_fields = array_merge($s_hidden_fields, $captcha->get_hidden_fields()); + } + $s_hidden_fields = build_hidden_fields($s_hidden_fields); + $confirm_image = ''; + + // Visual Confirmation - Show images + if ($config['enable_confirm']) + { + $template->assign_vars(array( + 'CAPTCHA_TEMPLATE' => $captcha->get_template(), + )); + } + + // + $l_reg_cond = ''; + switch ($config['require_activation']) + { + case USER_ACTIVATION_SELF: + $l_reg_cond = $user->lang['UCP_EMAIL_ACTIVATE']; + break; + + case USER_ACTIVATION_ADMIN: + $l_reg_cond = $user->lang['UCP_ADMIN_ACTIVATE']; + break; + } + + $timezone_selects = phpbb_timezone_select($template, $user, $data['tz'], true); + $template->assign_vars(array( + 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', + 'USERNAME' => $data['username'], + 'PASSWORD' => $data['new_password'], + 'PASSWORD_CONFIRM' => $data['password_confirm'], + 'EMAIL' => $data['email'], + + 'L_REG_COND' => $l_reg_cond, + 'L_USERNAME_EXPLAIN' => $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_name_chars']), $user->lang('CHARACTERS', (int) $config['max_name_chars'])), + 'L_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])), + + 'S_LANG_OPTIONS' => language_select($data['lang']), + 'S_TZ_PRESELECT' => !$submit, + 'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh']) ? true : false, + 'S_REGISTRATION' => true, + 'S_COPPA' => $coppa, + 'S_HIDDEN_FIELDS' => $s_hidden_fields, + 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'), + + 'COOKIE_NAME' => $config['cookie_name'], + 'COOKIE_PATH' => $config['cookie_path'], + )); + + // + $user->profile_fields = array(); + + // Generate profile fields -> Template Block Variable profile_fields + $cp->generate_profile_fields('register', $user->get_iso_lang_id()); + + // + $this->tpl_name = 'ucp_register'; + $this->page_title = 'UCP_REGISTRATION'; + } + + /** + * Creates the login_link data array + * + * @return array Returns an array of all POST paramaters whose names + * begin with 'login_link_' + */ + protected function get_login_link_data_array() + { + global $request; + + $var_names = $request->variable_names(\phpbb\request\request_interface::POST); + $login_link_data = array(); + $string_start_length = strlen('login_link_'); + + foreach ($var_names as $var_name) + { + if (strpos($var_name, 'login_link_') === 0) + { + $key_name = substr($var_name, $string_start_length); + $login_link_data[$key_name] = $request->variable($var_name, '', false, \phpbb\request\request_interface::POST); + } + } + + return $login_link_data; + } + + /** + * Prepends they key names of an associative array with 'login_link_' for + * inclusion on the page as hidden fields. + * + * @param array $data The array to be modified + * @return array The modified array + */ + protected function get_login_link_data_for_hidden_fields($data) + { + $new_data = array(); + + foreach ($data as $key => $value) + { + $new_data['login_link_' . $key] = $value; + } + + return $new_data; + } +} diff --git a/sources/phpBB/includes/ucp/ucp_remind.php b/sources/phpBB/includes/ucp/ucp_remind.php new file mode 100644 index 0000000..415bf0e --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_remind.php @@ -0,0 +1,135 @@ + +* @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; +} + +/** +* ucp_remind +* Sending password reminders +*/ +class ucp_remind +{ + var $u_action; + + function main($id, $mode) + { + global $config, $phpbb_root_path, $phpEx; + global $db, $user, $auth, $template, $phpbb_container; + + if (!$config['allow_password_reset']) + { + trigger_error($user->lang('UCP_PASSWORD_RESET_DISABLED', '', '')); + } + + $username = request_var('username', '', true); + $email = strtolower(request_var('email', '')); + $submit = (isset($_POST['submit'])) ? true : false; + + if ($submit) + { + $sql = 'SELECT user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason + FROM ' . USERS_TABLE . " + WHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "' + AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; + $result = $db->sql_query($sql); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$user_row) + { + trigger_error('NO_EMAIL_USER'); + } + + if ($user_row['user_type'] == USER_IGNORE) + { + trigger_error('NO_USER'); + } + + if ($user_row['user_type'] == USER_INACTIVE) + { + if ($user_row['user_inactive_reason'] == INACTIVE_MANUAL) + { + trigger_error('ACCOUNT_DEACTIVATED'); + } + else + { + trigger_error('ACCOUNT_NOT_ACTIVATED'); + } + } + + // Check users permissions + $auth2 = new \phpbb\auth\auth(); + $auth2->acl($user_row); + + if (!$auth2->acl_get('u_chgpasswd')) + { + trigger_error('NO_AUTH_PASSWORD_REMINDER'); + } + + $server_url = generate_board_url(); + + // Make password at least 8 characters long, make it longer if admin wants to. + // gen_rand_string() however has a limit of 12 or 13. + $user_password = gen_rand_string_friendly(max(8, mt_rand((int) $config['min_pass_chars'], (int) $config['max_pass_chars']))); + + // For the activation key a random length between 6 and 10 will do. + $user_actkey = gen_rand_string(mt_rand(6, 10)); + + // Instantiate passwords manager + $passwords_manager = $phpbb_container->get('passwords.manager'); + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_newpasswd = '" . $db->sql_escape($passwords_manager->hash($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "' + WHERE user_id = " . $user_row['user_id']; + $db->sql_query($sql); + + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $messenger = new messenger(false); + + $messenger->template('user_activate_passwd', $user_row['user_lang']); + + $messenger->set_addresses($user_row); + + $messenger->anti_abuse_headers($config, $user); + + $messenger->assign_vars(array( + 'USERNAME' => htmlspecialchars_decode($user_row['username']), + 'PASSWORD' => htmlspecialchars_decode($user_password), + 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k=$user_actkey") + ); + + $messenger->send($user_row['user_notify_type']); + + meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); + + $message = $user->lang['PASSWORD_UPDATED'] . '

' . sprintf($user->lang['RETURN_INDEX'], '', ''); + trigger_error($message); + } + + $template->assign_vars(array( + 'USERNAME' => $username, + 'EMAIL' => $email, + 'S_PROFILE_ACTION' => append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=sendpassword')) + ); + + $this->tpl_name = 'ucp_remind'; + $this->page_title = 'UCP_REMIND'; + } +} diff --git a/sources/phpBB/includes/ucp/ucp_resend.php b/sources/phpBB/includes/ucp/ucp_resend.php new file mode 100644 index 0000000..9fe8850 --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_resend.php @@ -0,0 +1,163 @@ + +* @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; +} + +/** +* ucp_resend +* Resending activation emails +*/ +class ucp_resend +{ + var $u_action; + + function main($id, $mode) + { + global $config, $phpbb_root_path, $phpEx; + global $db, $user, $auth, $template; + + $username = request_var('username', '', true); + $email = strtolower(request_var('email', '')); + $submit = (isset($_POST['submit'])) ? true : false; + + add_form_key('ucp_resend'); + + if ($submit) + { + if (!check_form_key('ucp_resend')) + { + trigger_error('FORM_INVALID'); + } + + $sql = 'SELECT user_id, group_id, username, user_email, user_type, user_lang, user_actkey, user_inactive_reason + FROM ' . USERS_TABLE . " + WHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "' + AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; + $result = $db->sql_query($sql); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$user_row) + { + trigger_error('NO_EMAIL_USER'); + } + + if ($user_row['user_type'] == USER_IGNORE) + { + trigger_error('NO_USER'); + } + + if (!$user_row['user_actkey'] && $user_row['user_type'] != USER_INACTIVE) + { + trigger_error('ACCOUNT_ALREADY_ACTIVATED'); + } + + if (!$user_row['user_actkey'] || ($user_row['user_type'] == USER_INACTIVE && $user_row['user_inactive_reason'] == INACTIVE_MANUAL)) + { + trigger_error('ACCOUNT_DEACTIVATED'); + } + + // Determine coppa status on group (REGISTERED(_COPPA)) + $sql = 'SELECT group_name, group_type + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . $user_row['group_id']; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + trigger_error('NO_GROUP'); + } + + $coppa = ($row['group_name'] == 'REGISTERED_COPPA' && $row['group_type'] == GROUP_SPECIAL) ? true : false; + + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + $messenger = new messenger(false); + + if ($config['require_activation'] == USER_ACTIVATION_SELF || $coppa) + { + $messenger->template(($coppa) ? 'coppa_resend_inactive' : 'user_resend_inactive', $user_row['user_lang']); + $messenger->set_addresses($user_row); + + $messenger->anti_abuse_headers($config, $user); + + $messenger->assign_vars(array( + 'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])), + 'USERNAME' => htmlspecialchars_decode($user_row['username']), + 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}") + ); + + if ($coppa) + { + $messenger->assign_vars(array( + 'FAX_INFO' => $config['coppa_fax'], + 'MAIL_INFO' => $config['coppa_mail'], + 'EMAIL_ADDRESS' => $user_row['user_email']) + ); + } + + $messenger->send(NOTIFY_EMAIL); + } + + if ($config['require_activation'] == USER_ACTIVATION_ADMIN) + { + // Grab an array of user_id's with a_user permissions ... these users can activate a user + $admin_ary = $auth->acl_get_list(false, 'a_user', false); + + $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $admin_ary[0]['a_user']); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $messenger->template('admin_activate', $row['user_lang']); + $messenger->set_addresses($row); + + $messenger->anti_abuse_headers($config, $user); + + $messenger->assign_vars(array( + 'USERNAME' => htmlspecialchars_decode($user_row['username']), + 'U_USER_DETAILS' => generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&u={$user_row['user_id']}", + 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}") + ); + + $messenger->send($row['user_notify_type']); + } + $db->sql_freeresult($result); + } + + meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); + + $message = ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? $user->lang['ACTIVATION_EMAIL_SENT_ADMIN'] : $user->lang['ACTIVATION_EMAIL_SENT']; + $message .= '

' . sprintf($user->lang['RETURN_INDEX'], '', ''); + trigger_error($message); + } + + $template->assign_vars(array( + 'USERNAME' => $username, + 'EMAIL' => $email, + 'S_PROFILE_ACTION' => append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=resend_act')) + ); + + $this->tpl_name = 'ucp_resend'; + $this->page_title = 'UCP_RESEND'; + } +} diff --git a/sources/phpBB/includes/ucp/ucp_zebra.php b/sources/phpBB/includes/ucp/ucp_zebra.php new file mode 100644 index 0000000..dbf8cf3 --- /dev/null +++ b/sources/phpBB/includes/ucp/ucp_zebra.php @@ -0,0 +1,296 @@ + +* @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; +} + +class ucp_zebra +{ + var $u_action; + + function main($id, $mode) + { + global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request, $phpbb_dispatcher; + + $submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false; + $s_hidden_fields = ''; + + $l_mode = strtoupper($mode); + + if ($submit) + { + $data = $error = array(); + $updated = false; + + $var_ary = array( + 'usernames' => array(0), + 'add' => '', + ); + + foreach ($var_ary as $var => $default) + { + $data[$var] = request_var($var, $default, true); + } + + if (!empty($data['add']) || sizeof($data['usernames'])) + { + if (confirm_box(true)) + { + // Remove users + if (!empty($data['usernames'])) + { + $user_ids = $data['usernames']; + + /** + * Remove users from friends/foes + * + * @event core.ucp_remove_zebra + * @var string mode Zebra type: friends|foes + * @var array user_ids User ids we remove + * @since 3.1.0-a1 + */ + $vars = array('mode', 'user_ids'); + extract($phpbb_dispatcher->trigger_event('core.ucp_remove_zebra', compact($vars))); + + $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . ' + AND ' . $db->sql_in_set('zebra_id', $user_ids); + $db->sql_query($sql); + + $updated = true; + } + + // Add users + if ($data['add']) + { + $data['add'] = array_map('trim', array_map('utf8_clean_string', explode("\n", $data['add']))); + + // Do these name/s exist on a list already? If so, ignore ... we could be + // 'nice' and automatically handle names added to one list present on + // the other (by removing the existing one) ... but I have a feeling this + // may lead to complaints + $sql = 'SELECT z.*, u.username, u.username_clean + FROM ' . ZEBRA_TABLE . ' z, ' . USERS_TABLE . ' u + WHERE z.user_id = ' . $user->data['user_id'] . ' + AND u.user_id = z.zebra_id'; + $result = $db->sql_query($sql); + + $friends = $foes = array(); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['friend']) + { + $friends[] = utf8_clean_string($row['username']); + } + else + { + $foes[] = utf8_clean_string($row['username']); + } + } + $db->sql_freeresult($result); + + // remove friends from the username array + $n = sizeof($data['add']); + $data['add'] = array_diff($data['add'], $friends); + + if (sizeof($data['add']) < $n && $mode == 'foes') + { + $error[] = $user->lang['NOT_ADDED_FOES_FRIENDS']; + } + + // remove foes from the username array + $n = sizeof($data['add']); + $data['add'] = array_diff($data['add'], $foes); + + if (sizeof($data['add']) < $n && $mode == 'friends') + { + $error[] = $user->lang['NOT_ADDED_FRIENDS_FOES']; + } + + // remove the user himself from the username array + $n = sizeof($data['add']); + $data['add'] = array_diff($data['add'], array(utf8_clean_string($user->data['username']))); + + if (sizeof($data['add']) < $n) + { + $error[] = $user->lang['NOT_ADDED_' . $l_mode . '_SELF']; + } + + unset($friends, $foes, $n); + + if (sizeof($data['add'])) + { + $sql = 'SELECT user_id, user_type + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('username_clean', $data['add']) . ' + AND user_type <> ' . USER_INACTIVE; + $result = $db->sql_query($sql); + + $user_id_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['user_id'] != ANONYMOUS && $row['user_type'] != USER_IGNORE) + { + $user_id_ary[] = $row['user_id']; + } + else if ($row['user_id'] != ANONYMOUS) + { + $error[] = $user->lang['NOT_ADDED_' . $l_mode . '_BOTS']; + } + else + { + $error[] = $user->lang['NOT_ADDED_' . $l_mode . '_ANONYMOUS']; + } + } + $db->sql_freeresult($result); + + if (sizeof($user_id_ary)) + { + // Remove users from foe list if they are admins or moderators + if ($mode == 'foes') + { + $perms = array(); + foreach ($auth->acl_get_list($user_id_ary, array('a_', 'm_')) as $forum_id => $forum_ary) + { + foreach ($forum_ary as $auth_option => $user_ary) + { + $perms = array_merge($perms, $user_ary); + } + } + + $perms = array_unique($perms); + + if (sizeof($perms)) + { + $error[] = $user->lang['NOT_ADDED_FOES_MOD_ADMIN']; + } + + // This may not be right ... it may yield true when perms equate to deny + $user_id_ary = array_diff($user_id_ary, $perms); + unset($perms); + } + + if (sizeof($user_id_ary)) + { + $sql_mode = ($mode == 'friends') ? 'friend' : 'foe'; + + $sql_ary = array(); + foreach ($user_id_ary as $zebra_id) + { + $sql_ary[] = array( + 'user_id' => (int) $user->data['user_id'], + 'zebra_id' => (int) $zebra_id, + $sql_mode => 1 + ); + } + + /** + * Add users to friends/foes + * + * @event core.ucp_add_zebra + * @var string mode Zebra type: + * friends|foes + * @var array sql_ary Array of + * entries we add + * @since 3.1.0-a1 + */ + $vars = array('mode', 'sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.ucp_add_zebra', compact($vars))); + + $db->sql_multi_insert(ZEBRA_TABLE, $sql_ary); + + $updated = true; + } + unset($user_id_ary); + } + else if (!sizeof($error)) + { + $error[] = $user->lang['USER_NOT_FOUND_OR_INACTIVE']; + } + } + } + + if ($request->is_ajax()) + { + $message = ($updated) ? $user->lang[$l_mode . '_UPDATED'] : implode('
', $error); + + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'success' => $updated, + + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $message, + 'REFRESH_DATA' => array( + 'time' => 3, + 'url' => $this->u_action + ) + )); + } + else if ($updated) + { + meta_refresh(3, $this->u_action); + $message = $user->lang[$l_mode . '_UPDATED'] . '
' . implode('
', $error) . ((sizeof($error)) ? '
' : '') . '
' . sprintf($user->lang['RETURN_UCP'], '', ''); + trigger_error($message); + } + else + { + $template->assign_var('ERROR', implode('
', $error)); + } + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'mode' => $mode, + 'submit' => true, + 'usernames' => $data['usernames'], + 'add' => $data['add'])) + ); + } + } + } + + $sql_and = ($mode == 'friends') ? 'z.friend = 1' : 'z.foe = 1'; + $sql = 'SELECT z.*, u.username, u.username_clean + FROM ' . ZEBRA_TABLE . ' z, ' . USERS_TABLE . ' u + WHERE z.user_id = ' . $user->data['user_id'] . " + AND $sql_and + AND u.user_id = z.zebra_id + ORDER BY u.username_clean ASC"; + $result = $db->sql_query($sql); + + $s_username_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $s_username_options .= ''; + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'L_TITLE' => $user->lang['UCP_ZEBRA_' . $l_mode], + + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=add'), + + 'S_USERNAME_OPTIONS' => $s_username_options, + 'S_HIDDEN_FIELDS' => $s_hidden_fields, + 'S_UCP_ACTION' => $this->u_action) + ); + + $this->tpl_name = 'ucp_zebra_' . $mode; + $this->page_title = 'UCP_ZEBRA_' . $l_mode; + } +} diff --git a/sources/phpBB/includes/utf/data/case_fold_c.php b/sources/phpBB/includes/utf/data/case_fold_c.php new file mode 100644 index 0000000..a5e3fc7 --- /dev/null +++ b/sources/phpBB/includes/utf/data/case_fold_c.php @@ -0,0 +1 @@ +'a','B'=>'b','C'=>'c','D'=>'d','E'=>'e','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','M'=>'m','N'=>'n','O'=>'o','P'=>'p','Q'=>'q','R'=>'r','S'=>'s','T'=>'t','U'=>'u','V'=>'v','W'=>'w','X'=>'x','Y'=>'y','Z'=>'z','µ'=>'μ','À'=>'à','Ã'=>'á','Â'=>'â','Ã'=>'ã','Ä'=>'ä','Ã…'=>'Ã¥','Æ'=>'æ','Ç'=>'ç','È'=>'è','É'=>'é','Ê'=>'ê','Ë'=>'ë','ÃŒ'=>'ì','Ã'=>'í','ÃŽ'=>'î','Ã'=>'ï','Ã'=>'ð','Ñ'=>'ñ','Ã’'=>'ò','Ó'=>'ó','Ô'=>'ô','Õ'=>'õ','Ö'=>'ö','Ø'=>'ø','Ù'=>'ù','Ú'=>'ú','Û'=>'û','Ãœ'=>'ü','Ã'=>'ý','Þ'=>'þ','Ä€'=>'Ä','Ä‚'=>'ă','Ä„'=>'Ä…','Ć'=>'ć','Ĉ'=>'ĉ','ÄŠ'=>'Ä‹','ÄŒ'=>'Ä','ÄŽ'=>'Ä','Ä'=>'Ä‘','Ä’'=>'Ä“','Ä”'=>'Ä•','Ä–'=>'Ä—','Ę'=>'Ä™','Äš'=>'Ä›','Äœ'=>'Ä','Äž'=>'ÄŸ','Ä '=>'Ä¡','Ä¢'=>'Ä£','Ĥ'=>'Ä¥','Ħ'=>'ħ','Ĩ'=>'Ä©','Ī'=>'Ä«','Ĭ'=>'Ä­','Ä®'=>'į','IJ'=>'ij','Ä´'=>'ĵ','Ķ'=>'Ä·','Ĺ'=>'ĺ','Ä»'=>'ļ','Ľ'=>'ľ','Ä¿'=>'Å€','Å'=>'Å‚','Ń'=>'Å„','Å…'=>'ņ','Ň'=>'ň','ÅŠ'=>'Å‹','ÅŒ'=>'Å','ÅŽ'=>'Å','Å'=>'Å‘','Å’'=>'Å“','Å”'=>'Å•','Å–'=>'Å—','Ř'=>'Å™','Åš'=>'Å›','Åœ'=>'Å','Åž'=>'ÅŸ','Å '=>'Å¡','Å¢'=>'Å£','Ť'=>'Å¥','Ŧ'=>'ŧ','Ũ'=>'Å©','Ū'=>'Å«','Ŭ'=>'Å­','Å®'=>'ů','Å°'=>'ű','Ų'=>'ų','Å´'=>'ŵ','Ŷ'=>'Å·','Ÿ'=>'ÿ','Ź'=>'ź','Å»'=>'ż','Ž'=>'ž','Å¿'=>'s','Æ'=>'É“','Æ‚'=>'ƃ','Æ„'=>'Æ…','Ɔ'=>'É”','Ƈ'=>'ƈ','Ɖ'=>'É–','ÆŠ'=>'É—','Æ‹'=>'ÆŒ','ÆŽ'=>'Ç','Æ'=>'É™','Æ'=>'É›','Æ‘'=>'Æ’','Æ“'=>'É ','Æ”'=>'É£','Æ–'=>'É©','Æ—'=>'ɨ','Ƙ'=>'Æ™','Æœ'=>'ɯ','Æ'=>'ɲ','ÆŸ'=>'ɵ','Æ '=>'Æ¡','Æ¢'=>'Æ£','Ƥ'=>'Æ¥','Ʀ'=>'Ê€','Ƨ'=>'ƨ','Æ©'=>'ʃ','Ƭ'=>'Æ­','Æ®'=>'ʈ','Ư'=>'Æ°','Ʊ'=>'ÊŠ','Ʋ'=>'Ê‹','Ƴ'=>'Æ´','Ƶ'=>'ƶ','Æ·'=>'Ê’','Ƹ'=>'ƹ','Ƽ'=>'ƽ','Ç„'=>'dž','Ç…'=>'dž','LJ'=>'lj','Lj'=>'lj','ÇŠ'=>'ÇŒ','Ç‹'=>'ÇŒ','Ç'=>'ÇŽ','Ç'=>'Ç','Ç‘'=>'Ç’','Ç“'=>'Ç”','Ç•'=>'Ç–','Ç—'=>'ǘ','Ç™'=>'Çš','Ç›'=>'Çœ','Çž'=>'ÇŸ','Ç '=>'Ç¡','Ç¢'=>'Ç£','Ǥ'=>'Ç¥','Ǧ'=>'ǧ','Ǩ'=>'Ç©','Ǫ'=>'Ç«','Ǭ'=>'Ç­','Ç®'=>'ǯ','DZ'=>'dz','Dz'=>'dz','Ç´'=>'ǵ','Ƕ'=>'Æ•','Ç·'=>'Æ¿','Ǹ'=>'ǹ','Ǻ'=>'Ç»','Ǽ'=>'ǽ','Ǿ'=>'Ç¿','È€'=>'È','È‚'=>'ȃ','È„'=>'È…','Ȇ'=>'ȇ','Ȉ'=>'ȉ','ÈŠ'=>'È‹','ÈŒ'=>'È','ÈŽ'=>'È','È'=>'È‘','È’'=>'È“','È”'=>'È•','È–'=>'È—','Ș'=>'È™','Èš'=>'È›','Èœ'=>'È','Èž'=>'ÈŸ','È '=>'Æž','È¢'=>'È£','Ȥ'=>'È¥','Ȧ'=>'ȧ','Ȩ'=>'È©','Ȫ'=>'È«','Ȭ'=>'È­','È®'=>'ȯ','È°'=>'ȱ','Ȳ'=>'ȳ','Ⱥ'=>'â±¥','È»'=>'ȼ','Ƚ'=>'Æš','Ⱦ'=>'ⱦ','É'=>'É‚','Ƀ'=>'Æ€','É„'=>'ʉ','É…'=>'ÊŒ','Ɇ'=>'ɇ','Ɉ'=>'ɉ','ÉŠ'=>'É‹','ÉŒ'=>'É','ÉŽ'=>'É','Í…'=>'ι','Ά'=>'ά','Έ'=>'έ','Ή'=>'ή','Ί'=>'ί','ÎŒ'=>'ÏŒ','ÎŽ'=>'Ï','Î'=>'ÏŽ','Α'=>'α','Î’'=>'β','Γ'=>'γ','Δ'=>'δ','Ε'=>'ε','Ζ'=>'ζ','Η'=>'η','Θ'=>'θ','Ι'=>'ι','Κ'=>'κ','Λ'=>'λ','Îœ'=>'μ','Î'=>'ν','Ξ'=>'ξ','Ο'=>'ο','Π'=>'Ï€','Ρ'=>'Ï','Σ'=>'σ','Τ'=>'Ï„','Î¥'=>'Ï…','Φ'=>'φ','Χ'=>'χ','Ψ'=>'ψ','Ω'=>'ω','Ϊ'=>'ÏŠ','Ϋ'=>'Ï‹','Ï‚'=>'σ','Ï'=>'β','Ï‘'=>'θ','Ï•'=>'φ','Ï–'=>'Ï€','Ϙ'=>'Ï™','Ïš'=>'Ï›','Ïœ'=>'Ï','Ïž'=>'ÏŸ','Ï '=>'Ï¡','Ï¢'=>'Ï£','Ϥ'=>'Ï¥','Ϧ'=>'ϧ','Ϩ'=>'Ï©','Ϫ'=>'Ï«','Ϭ'=>'Ï­','Ï®'=>'ϯ','Ï°'=>'κ','ϱ'=>'Ï','Ï´'=>'θ','ϵ'=>'ε','Ï·'=>'ϸ','Ϲ'=>'ϲ','Ϻ'=>'Ï»','Ͻ'=>'Í»','Ͼ'=>'ͼ','Ï¿'=>'ͽ','Ѐ'=>'Ñ','Ð'=>'Ñ‘','Ђ'=>'Ñ’','Ѓ'=>'Ñ“','Є'=>'Ñ”','Ð…'=>'Ñ•','І'=>'Ñ–','Ї'=>'Ñ—','Ј'=>'ј','Љ'=>'Ñ™','Њ'=>'Ñš','Ћ'=>'Ñ›','ÐŒ'=>'Ñœ','Ð'=>'Ñ','ÐŽ'=>'Ñž','Ð'=>'ÑŸ','Ð'=>'а','Б'=>'б','Ð’'=>'в','Г'=>'г','Д'=>'д','Е'=>'е','Ж'=>'ж','З'=>'з','И'=>'и','Й'=>'й','К'=>'к','Л'=>'л','Ðœ'=>'м','Ð'=>'н','О'=>'о','П'=>'п','Р'=>'Ñ€','С'=>'Ñ','Т'=>'Ñ‚','У'=>'у','Ф'=>'Ñ„','Ð¥'=>'Ñ…','Ц'=>'ц','Ч'=>'ч','Ш'=>'ш','Щ'=>'щ','Ъ'=>'ÑŠ','Ы'=>'Ñ‹','Ь'=>'ÑŒ','Э'=>'Ñ','Ю'=>'ÑŽ','Я'=>'Ñ','Ñ '=>'Ñ¡','Ñ¢'=>'Ñ£','Ѥ'=>'Ñ¥','Ѧ'=>'ѧ','Ѩ'=>'Ñ©','Ѫ'=>'Ñ«','Ѭ'=>'Ñ­','Ñ®'=>'ѯ','Ñ°'=>'ѱ','Ѳ'=>'ѳ','Ñ´'=>'ѵ','Ѷ'=>'Ñ·','Ѹ'=>'ѹ','Ѻ'=>'Ñ»','Ѽ'=>'ѽ','Ѿ'=>'Ñ¿','Ò€'=>'Ò','ÒŠ'=>'Ò‹','ÒŒ'=>'Ò','ÒŽ'=>'Ò','Ò'=>'Ò‘','Ò’'=>'Ò“','Ò”'=>'Ò•','Ò–'=>'Ò—','Ò˜'=>'Ò™','Òš'=>'Ò›','Òœ'=>'Ò','Òž'=>'ÒŸ','Ò '=>'Ò¡','Ò¢'=>'Ò£','Ò¤'=>'Ò¥','Ò¦'=>'Ò§','Ò¨'=>'Ò©','Òª'=>'Ò«','Ò¬'=>'Ò­','Ò®'=>'Ò¯','Ò°'=>'Ò±','Ò²'=>'Ò³','Ò´'=>'Òµ','Ò¶'=>'Ò·','Ò¸'=>'Ò¹','Òº'=>'Ò»','Ò¼'=>'Ò½','Ò¾'=>'Ò¿','Ó€'=>'Ó','Ó'=>'Ó‚','Óƒ'=>'Ó„','Ó…'=>'Ó†','Ó‡'=>'Óˆ','Ó‰'=>'ÓŠ','Ó‹'=>'ÓŒ','Ó'=>'ÓŽ','Ó'=>'Ó‘','Ó’'=>'Ó“','Ó”'=>'Ó•','Ó–'=>'Ó—','Ó˜'=>'Ó™','Óš'=>'Ó›','Óœ'=>'Ó','Óž'=>'ÓŸ','Ó '=>'Ó¡','Ó¢'=>'Ó£','Ó¤'=>'Ó¥','Ó¦'=>'Ó§','Ó¨'=>'Ó©','Óª'=>'Ó«','Ó¬'=>'Ó­','Ó®'=>'Ó¯','Ó°'=>'Ó±','Ó²'=>'Ó³','Ó´'=>'Óµ','Ó¶'=>'Ó·','Ó¸'=>'Ó¹','Óº'=>'Ó»','Ó¼'=>'Ó½','Ó¾'=>'Ó¿','Ô€'=>'Ô','Ô‚'=>'Ôƒ','Ô„'=>'Ô…','Ô†'=>'Ô‡','Ôˆ'=>'Ô‰','ÔŠ'=>'Ô‹','ÔŒ'=>'Ô','ÔŽ'=>'Ô','Ô'=>'Ô‘','Ô’'=>'Ô“','Ô±'=>'Õ¡','Ô²'=>'Õ¢','Ô³'=>'Õ£','Ô´'=>'Õ¤','Ôµ'=>'Õ¥','Ô¶'=>'Õ¦','Ô·'=>'Õ§','Ô¸'=>'Õ¨','Ô¹'=>'Õ©','Ôº'=>'Õª','Ô»'=>'Õ«','Ô¼'=>'Õ¬','Ô½'=>'Õ­','Ô¾'=>'Õ®','Ô¿'=>'Õ¯','Õ€'=>'Õ°','Õ'=>'Õ±','Õ‚'=>'Õ²','Õƒ'=>'Õ³','Õ„'=>'Õ´','Õ…'=>'Õµ','Õ†'=>'Õ¶','Õ‡'=>'Õ·','Õˆ'=>'Õ¸','Õ‰'=>'Õ¹','ÕŠ'=>'Õº','Õ‹'=>'Õ»','ÕŒ'=>'Õ¼','Õ'=>'Õ½','ÕŽ'=>'Õ¾','Õ'=>'Õ¿','Õ'=>'Ö€','Õ‘'=>'Ö','Õ’'=>'Ö‚','Õ“'=>'Öƒ','Õ”'=>'Ö„','Õ•'=>'Ö…','Õ–'=>'Ö†','á‚ '=>'â´€','á‚¡'=>'â´','á‚¢'=>'â´‚','á‚£'=>'â´ƒ','Ⴄ'=>'â´„','á‚¥'=>'â´…','Ⴆ'=>'â´†','Ⴇ'=>'â´‡','Ⴈ'=>'â´ˆ','á‚©'=>'â´‰','Ⴊ'=>'â´Š','á‚«'=>'â´‹','Ⴌ'=>'â´Œ','á‚­'=>'â´','á‚®'=>'â´Ž','Ⴏ'=>'â´','á‚°'=>'â´','Ⴑ'=>'â´‘','Ⴒ'=>'â´’','Ⴓ'=>'â´“','á‚´'=>'â´”','Ⴕ'=>'â´•','Ⴖ'=>'â´–','á‚·'=>'â´—','Ⴘ'=>'â´˜','Ⴙ'=>'â´™','Ⴚ'=>'â´š','á‚»'=>'â´›','Ⴜ'=>'â´œ','Ⴝ'=>'â´','Ⴞ'=>'â´ž','á‚¿'=>'â´Ÿ','Ⴠ'=>'â´ ','áƒ'=>'â´¡','Ⴢ'=>'â´¢','Ⴣ'=>'â´£','Ⴤ'=>'â´¤','Ⴥ'=>'â´¥','Ḁ'=>'á¸','Ḃ'=>'ḃ','Ḅ'=>'ḅ','Ḇ'=>'ḇ','Ḉ'=>'ḉ','Ḋ'=>'ḋ','Ḍ'=>'á¸','Ḏ'=>'á¸','á¸'=>'ḑ','Ḓ'=>'ḓ','Ḕ'=>'ḕ','Ḗ'=>'ḗ','Ḙ'=>'ḙ','Ḛ'=>'ḛ','Ḝ'=>'á¸','Ḟ'=>'ḟ','Ḡ'=>'ḡ','Ḣ'=>'ḣ','Ḥ'=>'ḥ','Ḧ'=>'ḧ','Ḩ'=>'ḩ','Ḫ'=>'ḫ','Ḭ'=>'ḭ','Ḯ'=>'ḯ','Ḱ'=>'ḱ','Ḳ'=>'ḳ','Ḵ'=>'ḵ','Ḷ'=>'ḷ','Ḹ'=>'ḹ','Ḻ'=>'ḻ','Ḽ'=>'ḽ','Ḿ'=>'ḿ','á¹€'=>'á¹','Ṃ'=>'ṃ','Ṅ'=>'á¹…','Ṇ'=>'ṇ','Ṉ'=>'ṉ','Ṋ'=>'ṋ','Ṍ'=>'á¹','Ṏ'=>'á¹','á¹'=>'ṑ','á¹’'=>'ṓ','á¹”'=>'ṕ','á¹–'=>'á¹—','Ṙ'=>'á¹™','Ṛ'=>'á¹›','Ṝ'=>'á¹','Ṟ'=>'ṟ','á¹ '=>'ṡ','á¹¢'=>'á¹£','Ṥ'=>'á¹¥','Ṧ'=>'ṧ','Ṩ'=>'ṩ','Ṫ'=>'ṫ','Ṭ'=>'á¹­','á¹®'=>'ṯ','á¹°'=>'á¹±','á¹²'=>'á¹³','á¹´'=>'á¹µ','Ṷ'=>'á¹·','Ṹ'=>'á¹¹','Ṻ'=>'á¹»','á¹¼'=>'á¹½','á¹¾'=>'ṿ','Ẁ'=>'áº','Ẃ'=>'ẃ','Ẅ'=>'ẅ','Ẇ'=>'ẇ','Ẉ'=>'ẉ','Ẋ'=>'ẋ','Ẍ'=>'áº','Ẏ'=>'áº','áº'=>'ẑ','Ẓ'=>'ẓ','Ẕ'=>'ẕ','ẛ'=>'ṡ','Ạ'=>'ạ','Ả'=>'ả','Ấ'=>'ấ','Ầ'=>'ầ','Ẩ'=>'ẩ','Ẫ'=>'ẫ','Ậ'=>'ậ','Ắ'=>'ắ','Ằ'=>'ằ','Ẳ'=>'ẳ','Ẵ'=>'ẵ','Ặ'=>'ặ','Ẹ'=>'ẹ','Ẻ'=>'ẻ','Ẽ'=>'ẽ','Ế'=>'ế','Ề'=>'á»','Ể'=>'ể','Ễ'=>'á»…','Ệ'=>'ệ','Ỉ'=>'ỉ','Ị'=>'ị','Ọ'=>'á»','Ỏ'=>'á»','á»'=>'ố','á»’'=>'ồ','á»”'=>'ổ','á»–'=>'á»—','Ộ'=>'á»™','Ớ'=>'á»›','Ờ'=>'á»','Ở'=>'ở','á» '=>'ỡ','Ợ'=>'ợ','Ụ'=>'ụ','Ủ'=>'ủ','Ứ'=>'ứ','Ừ'=>'ừ','Ử'=>'á»­','á»®'=>'ữ','á»°'=>'á»±','Ỳ'=>'ỳ','á»´'=>'ỵ','Ỷ'=>'á»·','Ỹ'=>'ỹ','Ἀ'=>'á¼€','Ἁ'=>'á¼','Ἂ'=>'ἂ','Ἃ'=>'ἃ','Ἄ'=>'ἄ','á¼'=>'á¼…','Ἆ'=>'ἆ','á¼'=>'ἇ','Ἐ'=>'á¼','á¼™'=>'ἑ','Ἒ'=>'á¼’','á¼›'=>'ἓ','Ἔ'=>'á¼”','á¼'=>'ἕ','Ἠ'=>'á¼ ','Ἡ'=>'ἡ','Ἢ'=>'á¼¢','Ἣ'=>'á¼£','Ἤ'=>'ἤ','á¼­'=>'á¼¥','á¼®'=>'ἦ','Ἧ'=>'ἧ','Ἰ'=>'á¼°','á¼¹'=>'á¼±','Ἲ'=>'á¼²','á¼»'=>'á¼³','á¼¼'=>'á¼´','á¼½'=>'á¼µ','á¼¾'=>'ἶ','Ἷ'=>'á¼·','Ὀ'=>'á½€','Ὁ'=>'á½','Ὂ'=>'ὂ','Ὃ'=>'ὃ','Ὄ'=>'ὄ','á½'=>'á½…','á½™'=>'ὑ','á½›'=>'ὓ','á½'=>'ὕ','Ὗ'=>'á½—','Ὠ'=>'á½ ','Ὡ'=>'ὡ','Ὢ'=>'á½¢','Ὣ'=>'á½£','Ὤ'=>'ὤ','á½­'=>'á½¥','á½®'=>'ὦ','Ὧ'=>'ὧ','Ᾰ'=>'á¾°','á¾¹'=>'á¾±','Ὰ'=>'á½°','á¾»'=>'á½±','á¾¾'=>'ι','Ὲ'=>'á½²','Έ'=>'á½³','á¿Š'=>'á½´','á¿‹'=>'á½µ','Ῐ'=>'á¿','á¿™'=>'á¿‘','á¿š'=>'ὶ','á¿›'=>'á½·','Ῠ'=>'á¿ ','á¿©'=>'á¿¡','Ὺ'=>'ὺ','á¿«'=>'á½»','Ῥ'=>'á¿¥','Ὸ'=>'ὸ','Ό'=>'á½¹','Ὼ'=>'á½¼','á¿»'=>'á½½','Ω'=>'ω','K'=>'k','â„«'=>'Ã¥','Ⅎ'=>'â…Ž','â… '=>'â…°','â…¡'=>'â…±','â…¢'=>'â…²','â…£'=>'â…³','â…¤'=>'â…´','â…¥'=>'â…µ','â…¦'=>'â…¶','â…§'=>'â…·','â…¨'=>'â…¸','â…©'=>'â…¹','â…ª'=>'â…º','â…«'=>'â…»','â…¬'=>'â…¼','â…­'=>'â…½','â…®'=>'â…¾','â…¯'=>'â…¿','Ↄ'=>'ↄ','â’¶'=>'â“','â’·'=>'â“‘','â’¸'=>'â“’','â’¹'=>'â““','â’º'=>'â“”','â’»'=>'â“•','â’¼'=>'â“–','â’½'=>'â“—','â’¾'=>'ⓘ','â’¿'=>'â“™','â“€'=>'â“š','â“'=>'â“›','â“‚'=>'â“œ','Ⓝ'=>'â“','â“„'=>'â“ž','â“…'=>'â“Ÿ','Ⓠ'=>'â“ ','Ⓡ'=>'â“¡','Ⓢ'=>'â“¢','Ⓣ'=>'â“£','â“Š'=>'ⓤ','â“‹'=>'â“¥','â“Œ'=>'ⓦ','â“'=>'ⓧ','â“Ž'=>'ⓨ','â“'=>'â“©','â°€'=>'â°°','â°'=>'â°±','â°‚'=>'â°²','â°ƒ'=>'â°³','â°„'=>'â°´','â°…'=>'â°µ','â°†'=>'â°¶','â°‡'=>'â°·','â°ˆ'=>'â°¸','â°‰'=>'â°¹','â°Š'=>'â°º','â°‹'=>'â°»','â°Œ'=>'â°¼','â°'=>'â°½','â°Ž'=>'â°¾','â°'=>'â°¿','â°'=>'â±€','â°‘'=>'â±','â°’'=>'ⱂ','â°“'=>'ⱃ','â°”'=>'ⱄ','â°•'=>'â±…','â°–'=>'ⱆ','â°—'=>'ⱇ','â°˜'=>'ⱈ','â°™'=>'ⱉ','â°š'=>'ⱊ','â°›'=>'ⱋ','â°œ'=>'ⱌ','â°'=>'â±','â°ž'=>'ⱎ','â°Ÿ'=>'â±','â° '=>'â±','â°¡'=>'ⱑ','â°¢'=>'â±’','â°£'=>'ⱓ','â°¤'=>'â±”','â°¥'=>'ⱕ','â°¦'=>'â±–','â°§'=>'â±—','â°¨'=>'ⱘ','â°©'=>'â±™','â°ª'=>'ⱚ','â°«'=>'â±›','â°¬'=>'ⱜ','â°­'=>'â±','â°®'=>'ⱞ','â± '=>'ⱡ','â±¢'=>'É«','â±£'=>'áµ½','Ɽ'=>'ɽ','Ⱨ'=>'ⱨ','Ⱪ'=>'ⱪ','Ⱬ'=>'ⱬ','â±µ'=>'ⱶ','â²€'=>'â²','Ⲃ'=>'ⲃ','Ⲅ'=>'â²…','Ⲇ'=>'ⲇ','Ⲉ'=>'ⲉ','Ⲋ'=>'ⲋ','Ⲍ'=>'â²','Ⲏ'=>'â²','â²'=>'ⲑ','â²’'=>'ⲓ','â²”'=>'ⲕ','â²–'=>'â²—','Ⲙ'=>'â²™','Ⲛ'=>'â²›','Ⲝ'=>'â²','Ⲟ'=>'ⲟ','â² '=>'ⲡ','â²¢'=>'â²£','Ⲥ'=>'â²¥','Ⲧ'=>'ⲧ','Ⲩ'=>'ⲩ','Ⲫ'=>'ⲫ','Ⲭ'=>'â²­','â²®'=>'ⲯ','â²°'=>'â²±','â²²'=>'â²³','â²´'=>'â²µ','Ⲷ'=>'â²·','Ⲹ'=>'â²¹','Ⲻ'=>'â²»','â²¼'=>'â²½','â²¾'=>'ⲿ','â³€'=>'â³','Ⳃ'=>'ⳃ','Ⳅ'=>'â³…','Ⳇ'=>'ⳇ','Ⳉ'=>'ⳉ','Ⳋ'=>'ⳋ','Ⳍ'=>'â³','Ⳏ'=>'â³','â³'=>'ⳑ','â³’'=>'ⳓ','â³”'=>'ⳕ','â³–'=>'â³—','Ⳙ'=>'â³™','Ⳛ'=>'â³›','Ⳝ'=>'â³','Ⳟ'=>'ⳟ','â³ '=>'ⳡ','â³¢'=>'â³£','A'=>'ï½','ï¼¢'=>'b','ï¼£'=>'c','D'=>'d','ï¼¥'=>'ï½…','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','ï¼­'=>'ï½','ï¼®'=>'n','O'=>'ï½','ï¼°'=>'ï½','ï¼±'=>'q','ï¼²'=>'ï½’','ï¼³'=>'s','ï¼´'=>'ï½”','ï¼µ'=>'u','V'=>'ï½–','ï¼·'=>'ï½—','X'=>'x','ï¼¹'=>'ï½™','Z'=>'z','ð€'=>'ð¨','ð'=>'ð©','ð‚'=>'ðª','ðƒ'=>'ð«','ð„'=>'ð¬','ð…'=>'ð­','ð†'=>'ð®','ð‡'=>'ð¯','ðˆ'=>'ð°','ð‰'=>'ð±','ðŠ'=>'ð²','ð‹'=>'ð³','ðŒ'=>'ð´','ð'=>'ðµ','ðŽ'=>'ð¶','ð'=>'ð·','ð'=>'ð¸','ð‘'=>'ð¹','ð’'=>'ðº','ð“'=>'ð»','ð”'=>'ð¼','ð•'=>'ð½','ð–'=>'ð¾','ð—'=>'ð¿','ð˜'=>'ð‘€','ð™'=>'ð‘','ðš'=>'ð‘‚','ð›'=>'ð‘ƒ','ðœ'=>'ð‘„','ð'=>'ð‘…','ðž'=>'ð‘†','ðŸ'=>'ð‘‡','ð '=>'ð‘ˆ','ð¡'=>'ð‘‰','ð¢'=>'ð‘Š','ð£'=>'ð‘‹','ð¤'=>'ð‘Œ','ð¥'=>'ð‘','ð¦'=>'ð‘Ž','ð§'=>'ð‘'); diff --git a/sources/phpBB/includes/utf/data/case_fold_f.php b/sources/phpBB/includes/utf/data/case_fold_f.php new file mode 100644 index 0000000..5f2d88e --- /dev/null +++ b/sources/phpBB/includes/utf/data/case_fold_f.php @@ -0,0 +1 @@ +'ss','Ä°'=>'i̇','ʼn'=>'ʼn','Ç°'=>'jÌŒ','Î'=>'ϊÌ','ΰ'=>'ϋÌ','Ö‡'=>'Õ¥Ö‚','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'wÌŠ','ẙ'=>'yÌŠ','ẚ'=>'aʾ','á½'=>'Ï…Ì“','á½’'=>'Ï…Ì“Ì€','á½”'=>'Ï…Ì“Ì','á½–'=>'Ï…Ì“Í‚','á¾€'=>'ἀι','á¾'=>'á¼Î¹','ᾂ'=>'ἂι','ᾃ'=>'ἃι','ᾄ'=>'ἄι','á¾…'=>'ἅι','ᾆ'=>'ἆι','ᾇ'=>'ἇι','ᾈ'=>'ἀι','ᾉ'=>'á¼Î¹','ᾊ'=>'ἂι','ᾋ'=>'ἃι','ᾌ'=>'ἄι','á¾'=>'ἅι','ᾎ'=>'ἆι','á¾'=>'ἇι','á¾'=>'ἠι','ᾑ'=>'ἡι','á¾’'=>'ἢι','ᾓ'=>'ἣι','á¾”'=>'ἤι','ᾕ'=>'ἥι','á¾–'=>'ἦι','á¾—'=>'ἧι','ᾘ'=>'ἠι','á¾™'=>'ἡι','ᾚ'=>'ἢι','á¾›'=>'ἣι','ᾜ'=>'ἤι','á¾'=>'ἥι','ᾞ'=>'ἦι','ᾟ'=>'ἧι','á¾ '=>'ὠι','ᾡ'=>'ὡι','á¾¢'=>'ὢι','á¾£'=>'ὣι','ᾤ'=>'ὤι','á¾¥'=>'ὥι','ᾦ'=>'ὦι','ᾧ'=>'ὧι','ᾨ'=>'ὠι','ᾩ'=>'ὡι','ᾪ'=>'ὢι','ᾫ'=>'ὣι','ᾬ'=>'ὤι','á¾­'=>'ὥι','á¾®'=>'ὦι','ᾯ'=>'ὧι','á¾²'=>'ὰι','á¾³'=>'αι','á¾´'=>'άι','ᾶ'=>'ᾶ','á¾·'=>'ᾶι','á¾¼'=>'αι','á¿‚'=>'ὴι','ῃ'=>'ηι','á¿„'=>'ήι','ῆ'=>'ῆ','ῇ'=>'ῆι','á¿Œ'=>'ηι','á¿’'=>'ῒ','á¿“'=>'ϊÌ','á¿–'=>'ῖ','á¿—'=>'ῗ','á¿¢'=>'ῢ','á¿£'=>'ϋÌ','ῤ'=>'ÏÌ“','ῦ'=>'Ï…Í‚','ῧ'=>'ῧ','ῲ'=>'ὼι','ῳ'=>'ωι','á¿´'=>'ώι','ῶ'=>'ῶ','á¿·'=>'ῶι','ῼ'=>'ωι','ff'=>'ff','ï¬'=>'fi','fl'=>'fl','ffi'=>'ffi','ffl'=>'ffl','ſt'=>'st','st'=>'st','ﬓ'=>'Õ´Õ¶','ﬔ'=>'Õ´Õ¥','ﬕ'=>'Õ´Õ«','ﬖ'=>'Õ¾Õ¶','ﬗ'=>'Õ´Õ­'); diff --git a/sources/phpBB/includes/utf/data/case_fold_s.php b/sources/phpBB/includes/utf/data/case_fold_s.php new file mode 100644 index 0000000..4ee5d8d --- /dev/null +++ b/sources/phpBB/includes/utf/data/case_fold_s.php @@ -0,0 +1 @@ +'á¾€','ᾉ'=>'á¾','ᾊ'=>'ᾂ','ᾋ'=>'ᾃ','ᾌ'=>'ᾄ','á¾'=>'á¾…','ᾎ'=>'ᾆ','á¾'=>'ᾇ','ᾘ'=>'á¾','á¾™'=>'ᾑ','ᾚ'=>'á¾’','á¾›'=>'ᾓ','ᾜ'=>'á¾”','á¾'=>'ᾕ','ᾞ'=>'á¾–','ᾟ'=>'á¾—','ᾨ'=>'á¾ ','ᾩ'=>'ᾡ','ᾪ'=>'á¾¢','ᾫ'=>'á¾£','ᾬ'=>'ᾤ','á¾­'=>'á¾¥','á¾®'=>'ᾦ','ᾯ'=>'ᾧ','á¾¼'=>'á¾³','á¿Œ'=>'ῃ','ῼ'=>'ῳ'); diff --git a/sources/phpBB/includes/utf/data/confusables.php b/sources/phpBB/includes/utf/data/confusables.php new file mode 100644 index 0000000..767d242 --- /dev/null +++ b/sources/phpBB/includes/utf/data/confusables.php @@ -0,0 +1 @@ +'i','ǃ'=>'!','α'=>'a',' '=>' ','­'=>'','Û'=>'','Ü'=>'','á †'=>'','á Ž'=>'','​'=>'','‌'=>'','â€'=>'','
'=>'','
'=>'','â '=>'','â¡'=>'','â¢'=>'','â£'=>'','âª'=>'','â«'=>'','â¬'=>'','â­'=>'','â®'=>'','â¯'=>'',''=>'',''=>'',''=>'','ï¿»'=>'',''=>'','ð…³'=>'','ð…´'=>'','ð…µ'=>'','ð…¶'=>'','ð…·'=>'','ð…¸'=>'','ð…¹'=>'','ð…º'=>'','Û¬'=>'ÛŸ','̓'=>'Ì“','Ù'=>'Ì“','Öœ'=>'Ì','Í'=>'Ì','݇'=>'Ì','॔'=>'Ì','Í€'=>'Ì€','॓'=>'Ì€','ÌŒ'=>'̆','Ì‘'=>'Ì‚','Ö¯'=>'ÌŠ','ஂ'=>'ÌŠ','à¹'=>'ÌŠ','à»'=>'ÌŠ','ံ'=>'ÌŠ','ំ'=>'ÌŠ','៓'=>'ÌŠ','ã‚š'=>'ÌŠ','゚'=>'ÌŠ','ͦ'=>'ÌŠ','Í‚'=>'̃','ׄ'=>'̇','Ö¹'=>'̇','ׂ'=>'̇','×'=>'̇','Ý'=>'̇','ं'=>'̇','ਂ'=>'̇','ં'=>'̇','à¯'=>'̇','Ì…'=>'Ì„','〬'=>'̉','̱'=>'Ì ','॒'=>'Ì ','̧'=>'Ì¡','̦'=>'Ì¡','̨'=>'Ì¢','़'=>'Ì£','়'=>'Ì£','਼'=>'Ì£','઼'=>'Ì£','଼'=>'Ì£','͇'=>'̳','̶'=>'̵','ﱞ'=>'ï¹²Ù‘','ﱟ'=>'ï¹´Ù‘','ï³²'=>'ï¹·Ù‘','ï± '=>'ﹶّ','ï³³'=>'ï¹¹Ù‘','ﱡ'=>'ﹸّ','ï³´'=>'ï¹»Ù‘','ï±¢'=>'ﹺّ','ï±£'=>'ï¹¼Ù°','Ù´'=>'Ù”','Ý‚'=>'ܼ','౦'=>'o','೦'=>'o','゙'=>'ã‚™',' '=>' ',' '=>' ','â€'=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ','âŸ'=>' ',' '=>' ',' '=>' ',' '=>' ','`'=>'`','ï½€'=>'`','á¿€'=>'Ëœ','ï¼¾'=>'^','︿'=>'^','_'=>'_','ï¹'=>'_','﹎'=>'_','ï¹'=>'_','⌇'=>'︴','ï¼'=>'-','â€'=>'-','‑'=>'-','‒'=>'-','–'=>'-','﹘'=>'-','∼'=>'â“','ï½¥'=>'・','•'=>'・',','=>',','‚'=>',','Ù¬'=>'ØŒ','、'=>'ã€',';'=>';','ï¼›'=>';',':'=>':','Ö‰'=>':','︰'=>':','׃'=>':','â©´'=>'::=','.'=>'.','․'=>'.','Ü‚'=>'.','‥'=>'..','…'=>'...','。'=>'。','·'=>'·','‧'=>'·','∙'=>'·','â‹…'=>'·','á§'=>'·','ᔯ'=>'·4','áŒ'=>'·á','áŽ'=>'·áƒ','á'=>'·á„','á’'=>'·á…','á”'=>'·á†','á—'=>'·áŠ','á™'=>'·á‹','á·'=>'·á³','á‘€'=>'·á³','á‘‚'=>'·á´','á‘„'=>'·á¸','ᑆ'=>'·á¹','á‘—'=>'·ᑌ','á‘™'=>'·ᑎ','á‘›'=>'·á‘','á‘”'=>'·á‘','á‘'=>'·á‘','á‘Ÿ'=>'·ᑑ','á‘¡'=>'·ᑕ','á‘£'=>'·ᑖ','á‘´'=>'·ᑫ','ᑸ'=>'·ᑮ','ᑼ'=>'·ᑰ','ᑾ'=>'·ᑲ','á’€'=>'·ᑳ','á’’'=>'·ᒉ','á’”'=>'·ᒋ','á’–'=>'·ᒌ','á’š'=>'·ᒎ','á’œ'=>'·á’','á’ž'=>'·ᒑ','á’¬'=>'·ᒣ','á’®'=>'·ᒥ','á’°'=>'·ᒦ','á’²'=>'·ᒧ','á’´'=>'·ᒨ','á’¶'=>'·L','á’¸'=>'·ᒫ','ᓉ'=>'·ᓀ','á“‹'=>'·ᓇ','á“'=>'·ᓈ','á“œ'=>'·ᓓ','á“ž'=>'·ᓕ','á“ '=>'·ᓖ','á“¢'=>'·ᓗ','ᓤ'=>'·ᓘ','ᓦ'=>'·ᓚ','ᓨ'=>'·ᓛ','ᓶ'=>'·ᓭ','ᓸ'=>'·ᓯ','ᓺ'=>'·ᓰ','ᓼ'=>'·ᓱ','ᓾ'=>'·ᓲ','ᔀ'=>'·ᓴ','ᔂ'=>'·ᓵ','á”—'=>'·á”','á”™'=>'·ᔑ','á”›'=>'·ᔒ','á”'=>'·ᔓ','ᔟ'=>'·ᔔ','ᔡ'=>'·ᔕ','ᔣ'=>'·ᔖ','á”±'=>'·ᔨ','ᔳ'=>'·ᔩ','ᔵ'=>'·ᔪ','á”·'=>'·ᔫ','ᔹ'=>'·ᔭ','á”»'=>'·ᔮ','á•Ž'=>'·ᕌ','á•›'=>'·ᕚ','ᕨ'=>'·ᕧ','('=>'(','â‘´'=>'(1)','â’§'=>'(l)','⑽'=>'(10)','⑾'=>'(11)','â‘¿'=>'(12)','â’€'=>'(13)','â’'=>'(14)','â’‚'=>'(15)','â’ƒ'=>'(16)','â’„'=>'(17)','â’…'=>'(18)','â’†'=>'(19)','⑵'=>'(2)','â’‡'=>'(20)','⑶'=>'(3)','â‘·'=>'(4)','⑸'=>'(5)','⑹'=>'(6)','⑺'=>'(7)','â‘»'=>'(8)','⑼'=>'(9)','â’œ'=>'(a)','â’'=>'(b)','â’ž'=>'(c)','â’Ÿ'=>'(d)','â’ '=>'(e)','â’¡'=>'(f)','â’¢'=>'(g)','â’£'=>'(h)','â’¤'=>'(i)','â’¥'=>'(j)','â’¦'=>'(k)','â’¨'=>'(m)','â’©'=>'(n)','â’ª'=>'(o)','â’«'=>'(p)','â’¬'=>'(q)','â’­'=>'(r)','â’®'=>'(s)','â’¯'=>'(t)','â’°'=>'(u)','â’±'=>'(v)','â’²'=>'(w)','â’³'=>'(x)','â’´'=>'(y)','â’µ'=>'(z)','㈀'=>'(á„€)','㈎'=>'(ê°€)','ãˆ'=>'(á„‚)','ãˆ'=>'(나)','㈂'=>'(ᄃ)','ãˆ'=>'(다)','㈃'=>'(á„…)','㈑'=>'(ë¼)','㈄'=>'(ᄆ)','㈒'=>'(마)','㈅'=>'(ᄇ)','㈓'=>'(ë°”)','㈆'=>'(ᄉ)','㈔'=>'(사)','㈇'=>'(á„‹)','㈕'=>'(ì•„)','ãˆ'=>'(오전)','㈞'=>'(오후)','㈈'=>'(á„Œ)','㈖'=>'(ìž)','㈜'=>'(주)','㈉'=>'(á„Ž)','㈗'=>'(ì°¨)','㈊'=>'(á„)','㈘'=>'(ì¹´)','㈋'=>'(á„)','㈙'=>'(타)','㈌'=>'(á„‘)','㈚'=>'(파)','ãˆ'=>'(á„’)','㈛'=>'(하)','㈠'=>'(一)','㈦'=>'(七)','㈢'=>'(三)','㈨'=>'(ä¹)','㈡'=>'(二)','㈤'=>'(五)','㈹'=>'(代)','㈽'=>'(ä¼)','ã‰'=>'(休)','㈧'=>'(å…«)','㈥'=>'(å…­)','㈸'=>'(労)','㈩'=>'(å)','㈿'=>'(å”)','㈴'=>'(å)','㈺'=>'(呼)','㈣'=>'(å››)','㈯'=>'(土)','㈻'=>'(å­¦)','㈰'=>'(æ—¥)','㈪'=>'(月)','㈲'=>'(有)','㈭'=>'(木)','㈱'=>'(æ ª)','㈬'=>'(æ°´)','㈫'=>'(ç«)','㈵'=>'(特)','㈼'=>'(監)','㈳'=>'(社)','㈷'=>'(ç¥)','㉀'=>'(祭)','㉂'=>'(自)','㉃'=>'(至)','㈶'=>'(財)','㈾'=>'(資)','㈮'=>'(金)',')'=>')','ï¼»'=>'[','〔'=>'[','ï¼½'=>']','〕'=>']','ï½›'=>'{','ï½'=>'}','⦅'=>'⦅','ï½ '=>'⦆','ï½¢'=>'「','ï½£'=>'ã€','ï¼ '=>'@','*'=>'*','ï¼'=>'/','â„'=>'/','∕'=>'/','ï¼¼'=>'\\','&'=>'&','#'=>'#','ï¼…'=>'%','‶'=>'‵‵','‷'=>'‵‵‵','༌'=>'་','´'=>'ʹ','΄'=>'ʹ','´'=>'ʹ','\''=>'ʹ','''=>'ʹ','′'=>'ʹ','׳'=>'ʹ','Í´'=>'ʹ','ËŠ'=>'ʹ','"'=>'ʹʹ','"'=>'ʹʹ','″'=>'ʹʹ','〃'=>'ʹʹ','×´'=>'ʹʹ','ʺ'=>'ʹʹ','‴'=>'ʹʹʹ','â—'=>'ʹʹʹʹ','¯'=>'ˉ','ï¿£'=>'ˉ','‾'=>'ˉ','﹉'=>'ˉ','﹊'=>'ˉ','﹋'=>'ˉ','﹌'=>'ˉ','Ëš'=>'°','௵'=>'௳','ï¿©'=>'â†','ï¿«'=>'→','↑'=>'↑','↓'=>'↓','↵'=>'↲','⨡'=>'↾','ð››'=>'∂','ðœ•'=>'∂','ð'=>'∂','ðž‰'=>'∂','ðŸƒ'=>'∂','ð›'=>'∇','ð›»'=>'∇','ðœµ'=>'∇','ð¯'=>'∇','ðž©'=>'∇','+'=>'+','﬩'=>'+','‹'=>'<','<'=>'<','ï¼'=>'=','⩵'=>'==','⩶'=>'===','›'=>'>','>'=>'>','ï¿¢'=>'¬','¦'=>'¦','〜'=>'~','~'=>'~','﹨'=>'∖','â‹€'=>'∧','â‹'=>'∨','â‹‚'=>'∩','⋃'=>'∪','∯'=>'∮∮','∰'=>'∮∮∮','≣'=>'≡','â™'=>'⊕','☉'=>'⊙','⟂'=>'⊥','â–·'=>'⊲','â¨'=>'⋈','⨽'=>'⌙','☸'=>'⎈','⎮'=>'⎥','│'=>'│','â–'=>'â–Œ','ï¿­'=>'â– ','â˜'=>'â–¡','ï¿®'=>'â—‹','⦾'=>'â—Ž','〛'=>'⟧','〈'=>'⟨','〈'=>'⟨','〉'=>'⟩','〉'=>'⟩','⧙'=>'⦚','〶'=>'〒','ï½°'=>'ー','ï¿ '=>'¢','$'=>'$','ï¿¡'=>'£','ï¿¥'=>'Y̵','₩'=>'W̵','ï¼'=>'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点','1'=>'1','ðŸ'=>'1','ðŸ™'=>'1','ðŸ£'=>'1','ðŸ­'=>'1','ðŸ·'=>'1','â„'=>'1','â„‘'=>'1','ðˆ'=>'1','ð¼'=>'1','ð‘°'=>'1','ð“˜'=>'1','ð•€'=>'1','ð•´'=>'1','ð–¨'=>'1','ð—œ'=>'1','ð˜'=>'1','ð™„'=>'1','ð™¸'=>'1','l'=>'l','l'=>'l','â…¼'=>'1','â„“'=>'l','ð¥'=>'l','ð‘™'=>'l','ð’'=>'l','ð“'=>'l','ð“µ'=>'l','ð”©'=>'l','ð•'=>'l','ð–‘'=>'l','ð—…'=>'l','ð—¹'=>'l','ð˜­'=>'l','ð™¡'=>'l','ðš•'=>'l','ðš°'=>'l','ð›ª'=>'l','ðœ¤'=>'l','ðž'=>'l','ðž˜'=>'l','â‘ '=>'➀','É­'=>'lÌ¢','É«'=>'lÌ´','Æš'=>'l̵','Å‚'=>'lÌ·','Û±'=>'Ù¡','â’ˆ'=>'1.','Å€'=>'l·','á’·'=>'1·','â‘©'=>'➉','â’‘'=>'10.','ã©'=>'10æ—¥','㋉'=>'10月','ã¢'=>'10点','â’’'=>'11.','ãª'=>'11æ—¥','ã‹Š'=>'11月','ã£'=>'11点','â’“'=>'12.','ã«'=>'12æ—¥','ã‹‹'=>'12月','ã¤'=>'12点','â’”'=>'13.','ã¬'=>'13æ—¥','ã¥'=>'13点','â’•'=>'14.','ã­'=>'14æ—¥','ã¦'=>'14点','â’–'=>'15.','ã®'=>'15æ—¥','ã§'=>'15点','â’—'=>'16.','ã¯'=>'16æ—¥','ã¨'=>'16点','â’˜'=>'17.','ã°'=>'17æ—¥','ã©'=>'17点','â’™'=>'18.','ã±'=>'18æ—¥','ãª'=>'18点','â’š'=>'19.','ã²'=>'19æ—¥','ã«'=>'19点','lj'=>'lj','ã '=>'1æ—¥','ã‹€'=>'1月','ã™'=>'1点','ï¼’'=>'2','ðŸ'=>'2','ðŸš'=>'2','ðŸ¤'=>'2','ðŸ®'=>'2','ðŸ¸'=>'2','á’¿'=>'2','â‘¡'=>'âž','Û²'=>'Ù¢','â’‰'=>'2.','â’›'=>'20.','ã³'=>'20æ—¥','ã¬'=>'20点','ã´'=>'21æ—¥','ã­'=>'21点','ãµ'=>'22æ—¥','ã®'=>'22点','ã¶'=>'23æ—¥','ã¯'=>'23点','ã·'=>'24æ—¥','ã°'=>'24点','ã¸'=>'25æ—¥','ã¹'=>'26æ—¥','ãº'=>'27æ—¥','ã»'=>'28æ—¥','ã¼'=>'29æ—¥','ã¡'=>'2æ—¥','ã‹'=>'2月','ãš'=>'2点','3'=>'3','ðŸ‘'=>'3','ðŸ›'=>'3','ðŸ¥'=>'3','ðŸ¯'=>'3','ðŸ¹'=>'3','â‘¢'=>'âž‚','Û³'=>'Ù£','â’Š'=>'3.','ã½'=>'30æ—¥','ã¾'=>'31æ—¥','ã¢'=>'3æ—¥','ã‹‚'=>'3月','ã›'=>'3点','ï¼”'=>'4','ðŸ’'=>'4','ðŸœ'=>'4','ðŸ¦'=>'4','ðŸ°'=>'4','ðŸº'=>'4','áŽ'=>'4','â‘£'=>'➃','â’‹'=>'4.','á”°'=>'4·','ã£'=>'4æ—¥','㋃'=>'4月','ãœ'=>'4点','5'=>'5','ðŸ“'=>'5','ðŸ'=>'5','ðŸ§'=>'5','ðŸ±'=>'5','ðŸ»'=>'5','⑤'=>'âž„','â’Œ'=>'5.','ã¤'=>'5æ—¥','ã‹„'=>'5月','ã'=>'5点','ï¼–'=>'6','ðŸ”'=>'6','ðŸž'=>'6','ðŸ¨'=>'6','ðŸ²'=>'6','ðŸ¼'=>'6','б'=>'6','â‘¥'=>'âž…','â’'=>'6.','ã¥'=>'6æ—¥','ã‹…'=>'6月','ãž'=>'6点','ï¼—'=>'7','ðŸ•'=>'7','ðŸŸ'=>'7','ðŸ©'=>'7','ðŸ³'=>'7','ðŸ½'=>'7','⑦'=>'➆','Û·'=>'Ù§','â’Ž'=>'7.','ã¦'=>'7æ—¥','㋆'=>'7月','ãŸ'=>'7点','ଃ'=>'8','৪'=>'8','੪'=>'8','8'=>'8','ðŸ–'=>'8','ðŸ '=>'8','ðŸª'=>'8','ðŸ´'=>'8','ðŸ¾'=>'8','È£'=>'8','⑧'=>'➇','Û¸'=>'Ù¨','â’'=>'8.','ã§'=>'8æ—¥','㋇'=>'8月','ã '=>'8点','੧'=>'9','à­¨'=>'9','৭'=>'9','ï¼™'=>'9','ðŸ—'=>'9','ðŸ¡'=>'9','ðŸ«'=>'9','ðŸµ'=>'9','ðŸ¿'=>'9','⑨'=>'➈','Û¹'=>'Ù©','â’'=>'9.','ã¨'=>'9æ—¥','㋈'=>'9月','ã¡'=>'9点','ï½'=>'a','ðš'=>'a','ð‘Ž'=>'a','ð’‚'=>'a','ð’¶'=>'a','ð“ª'=>'a','ð”ž'=>'a','ð•’'=>'a','ð–†'=>'a','ð–º'=>'a','ð—®'=>'a','ð˜¢'=>'a','ð™–'=>'a','ðšŠ'=>'a','â„€'=>'a/c','â„'=>'a/s','æ'=>'ae','b'=>'b','ð›'=>'b','ð‘'=>'b','ð’ƒ'=>'b','ð’·'=>'b','ð“«'=>'b','ð”Ÿ'=>'b','ð•“'=>'b','ð–‡'=>'b','ð–»'=>'b','ð—¯'=>'b','ð˜£'=>'b','ð™—'=>'b','ðš‹'=>'b','É“'=>'bÌ”','ƃ'=>'bÌ„','Æ€'=>'b̵','c'=>'c','â…½'=>'c','ðœ'=>'c','ð‘'=>'c','ð’„'=>'c','ð’¸'=>'c','ð“¬'=>'c','ð” '=>'c','ð•”'=>'c','ð–ˆ'=>'c','ð–¼'=>'c','ð—°'=>'c','ð˜¤'=>'c','ð™˜'=>'c','ðšŒ'=>'c','ð›“'=>'c','ðœ'=>'c','ð‡'=>'c','ðž'=>'c','ðž»'=>'c','â„…'=>'c/o','℆'=>'c/u','d'=>'d','â…¾'=>'d','â…†'=>'d','ð'=>'d','ð‘‘'=>'d','ð’…'=>'d','ð’¹'=>'d','ð“­'=>'d','ð”¡'=>'d','ð••'=>'d','ð–‰'=>'d','ð–½'=>'d','ð—±'=>'d','ð˜¥'=>'d','ð™™'=>'d','ðš'=>'d','É—'=>'dÌ”','ÆŒ'=>'dÌ„','É–'=>'dÌ¢','Ä‘'=>'d̵','dz'=>'dz','dž'=>'dž','ï½…'=>'e','ℯ'=>'e','â…‡'=>'e','ðž'=>'e','ð‘’'=>'e','ð’†'=>'e','ð“®'=>'e','ð”¢'=>'e','ð•–'=>'e','ð–Š'=>'e','ð–¾'=>'e','ð—²'=>'e','ð˜¦'=>'e','ð™š'=>'e','ðšŽ'=>'e','â´¹'=>'E','É™'=>'Ç','Éš'=>'ÇËž','â‹´'=>'É›','ð›†'=>'É›','ð›œ'=>'É›','ðœ€'=>'É›','ðœ–'=>'É›','ðœº'=>'É›','ð'=>'É›','ð´'=>'É›','ðžŠ'=>'É›','ðž®'=>'É›','ðŸ„'=>'É›','f'=>'f','ðŸ'=>'f','ð‘“'=>'f','ð’‡'=>'f','ð’»'=>'f','ð“¯'=>'f','ð”£'=>'f','ð•—'=>'f','ð–‹'=>'f','ð–¿'=>'f','ð—³'=>'f','ð˜§'=>'f','ð™›'=>'f','ðš'=>'f','Æ’'=>'fÌ¡','g'=>'g','â„Š'=>'g','ð '=>'g','ð‘”'=>'g','ð’ˆ'=>'g','ð“°'=>'g','ð”¤'=>'g','ð•˜'=>'g','ð–Œ'=>'g','ð—€'=>'g','ð—´'=>'g','ð˜¨'=>'g','ð™œ'=>'g','ðš'=>'g','É¡'=>'g','É '=>'gÌ”','Ç¥'=>'g̵','h'=>'h','â„Ž'=>'h','ð¡'=>'h','ð’‰'=>'h','ð’½'=>'h','ð“±'=>'h','ð”¥'=>'h','ð•™'=>'h','ð–'=>'h','ð—'=>'h','ð—µ'=>'h','ð˜©'=>'h','ð™'=>'h','ðš‘'=>'h','ɦ'=>'hÌ”','ħ'=>'h̵','â„'=>'h̵','῾'=>'Ê»','‘'=>'Ê»','‛'=>'Ê»','ʽ'=>'Ê»','â³'=>'i','i'=>'i','â…°'=>'i','ℹ'=>'i','â…ˆ'=>'i','ð¢'=>'i','ð‘–'=>'i','ð’Š'=>'i','ð’¾'=>'i','ð“²'=>'i','ð”¦'=>'i','ð•š'=>'i','ð–Ž'=>'i','ð—‚'=>'i','ð—¶'=>'i','ð˜ª'=>'i','ð™ž'=>'i','ðš’'=>'i','ı'=>'i','ðš¤'=>'i','ɪ'=>'i','É©'=>'i','ð›Š'=>'i','ðœ„'=>'i','ðœ¾'=>'i','ð¸'=>'i','ðž²'=>'i','ɨ'=>'i̵','â…±'=>'ii','â…²'=>'iii','ij'=>'ij','â…³'=>'iv','â…¸'=>'ix','j'=>'j','â…‰'=>'j','ð£'=>'j','ð‘—'=>'j','ð’‹'=>'j','ð’¿'=>'j','ð“³'=>'j','ð”§'=>'j','ð•›'=>'j','ð–'=>'j','ð—ƒ'=>'j','ð—·'=>'j','ð˜«'=>'j','ð™Ÿ'=>'j','ðš“'=>'j','ϳ'=>'j','ðš¥'=>'È·','k'=>'k','ð¤'=>'k','ð‘˜'=>'k','ð’Œ'=>'k','ð“€'=>'k','ð“´'=>'k','ð”¨'=>'k','ð•œ'=>'k','ð–'=>'k','ð—„'=>'k','ð—¸'=>'k','ð˜¬'=>'k','ð™ '=>'k','ðš”'=>'k','Æ™'=>'kÌ”','ï½'=>'m','â…¿'=>'m','ð¦'=>'m','ð‘š'=>'m','ð’Ž'=>'m','ð“‚'=>'m','ð“¶'=>'m','ð”ª'=>'m','ð•ž'=>'m','ð–’'=>'m','ð—†'=>'m','ð—º'=>'m','ð˜®'=>'m','ð™¢'=>'m','ðš–'=>'m','ɱ'=>'mÌ¡','n'=>'n','ð§'=>'n','ð‘›'=>'n','ð’'=>'n','ð“ƒ'=>'n','ð“·'=>'n','ð”«'=>'n','ð•Ÿ'=>'n','ð–“'=>'n','ð—‡'=>'n','ð—»'=>'n','ð˜¯'=>'n','ð™£'=>'n','ðš—'=>'n','ð'=>'N','ð‘'=>'N','ð‘µ'=>'N','ð’©'=>'N','ð“'=>'N','ð”‘'=>'N','ð•¹'=>'N','ð–­'=>'N','ð—¡'=>'N','ð˜•'=>'N','ð™‰'=>'N','ð™½'=>'N','ðš´'=>'N','ð›®'=>'N','ðœ¨'=>'N','ð¢'=>'N','ðžœ'=>'N','ɲ'=>'ņ','ɳ'=>'nÌ¢','Æž'=>'nÌ©','ð›ˆ'=>'nÌ©','ðœ‚'=>'nÌ©','ðœ¼'=>'nÌ©','ð¶'=>'nÌ©','ðž°'=>'nÌ©','ÇŒ'=>'nj','ï½'=>'o','â„´'=>'o','ð¨'=>'o','ð‘œ'=>'o','ð’'=>'o','ð“¸'=>'o','ð”¬'=>'o','ð• '=>'o','ð–”'=>'o','ð—ˆ'=>'o','ð—¼'=>'o','ð˜°'=>'o','ð™¤'=>'o','ðš˜'=>'o','á´'=>'o','ð›'=>'o','ðœŠ'=>'o','ð„'=>'o','ð¾'=>'o','ðž¸'=>'o','ɵ'=>'o̵','Ç¿'=>'o̵Ì','ø'=>'oÌ·','Å“'=>'oe','Æ¡'=>'oʼ','â´'=>'p','ï½'=>'p','ð©'=>'p','ð‘'=>'p','ð’‘'=>'p','ð“…'=>'p','ð“¹'=>'p','ð”­'=>'p','ð•¡'=>'p','ð–•'=>'p','ð—‰'=>'p','ð—½'=>'p','ð˜±'=>'p','ð™¥'=>'p','ðš™'=>'p','ð›’'=>'p','ð› '=>'p','ðœŒ'=>'p','ðœš'=>'p','ð†'=>'p','ð”'=>'p','ðž€'=>'p','ðžŽ'=>'p','ðžº'=>'p','ðŸˆ'=>'p','Æ¥'=>'pÌ”','q'=>'q','ðª'=>'q','ð‘ž'=>'q','ð’’'=>'q','ð“†'=>'q','ð“º'=>'q','ð”®'=>'q','ð•¢'=>'q','ð––'=>'q','ð—Š'=>'q','ð—¾'=>'q','ð˜²'=>'q','ð™¦'=>'q','ðšš'=>'q','ð'=>'Q','ð‘„'=>'Q','ð‘¸'=>'Q','ð’¬'=>'Q','ð“ '=>'Q','ð””'=>'Q','ð•¼'=>'Q','ð–°'=>'Q','ð—¤'=>'Q','ð˜˜'=>'Q','ð™Œ'=>'Q','ðš€'=>'Q','Ê '=>'qÌ”','ð›‹'=>'ĸ','ð›ž'=>'ĸ','ðœ…'=>'ĸ','ðœ˜'=>'ĸ','ðœ¿'=>'ĸ','ð’'=>'ĸ','ð¹'=>'ĸ','ðžŒ'=>'ĸ','ðž³'=>'ĸ','ðŸ†'=>'ĸ','ï½’'=>'r','ð«'=>'r','ð‘Ÿ'=>'r','ð’“'=>'r','ð“‡'=>'r','ð“»'=>'r','ð”¯'=>'r','ð•£'=>'r','ð–—'=>'r','ð—‹'=>'r','ð—¿'=>'r','ð˜³'=>'r','ð™§'=>'r','ðš›'=>'r','ɽ'=>'rÌ¢','ɼ'=>'rÌ©','s'=>'s','ð¬'=>'s','ð‘ '=>'s','ð’”'=>'s','ð“ˆ'=>'s','ð“¼'=>'s','ð”°'=>'s','ð•¤'=>'s','ð–˜'=>'s','ð—Œ'=>'s','ð˜€'=>'s','ð˜´'=>'s','ð™¨'=>'s','ðšœ'=>'s','ƽ'=>'s','Ê‚'=>'sÌ¢','∫'=>'ʃ','∬'=>'ʃʃ','∭'=>'ʃʃʃ','⨌'=>'ʃʃʃʃ','ï½”'=>'t','ð­'=>'t','ð‘¡'=>'t','ð’•'=>'t','ð“‰'=>'t','ð“½'=>'t','ð”±'=>'t','ð•¥'=>'t','ð–™'=>'t','ð—'=>'t','ð˜'=>'t','ð˜µ'=>'t','ð™©'=>'t','ðš'=>'t','ð‘‡'=>'T','ð‘»'=>'T','ð’¯'=>'T','ð“£'=>'T','ð”—'=>'T','ð•‹'=>'T','ð•¿'=>'T','ð–³'=>'T','ð—§'=>'T','ð˜›'=>'T','ð™'=>'T','ðšƒ'=>'T','ðš»'=>'T','ð›µ'=>'T','ðœ¯'=>'T','ð©'=>'T','ðž£'=>'T','Æ­'=>'tÌ”','È›'=>'Å£','Æ«'=>'Å£','ŧ'=>'t̵','u'=>'u','ð®'=>'u','ð‘¢'=>'u','ð’–'=>'u','ð“Š'=>'u','ð“¾'=>'u','ð”²'=>'u','ð•¦'=>'u','ð–š'=>'u','ð—Ž'=>'u','ð˜‚'=>'u','ð˜¶'=>'u','ð™ª'=>'u','ðšž'=>'u','ÊŠ'=>'u','Ê‹'=>'u','ð›–'=>'u','ðœ'=>'u','ðŠ'=>'u','ðž„'=>'u','ðž¾'=>'u','ð‘ˆ'=>'U','ð‘¼'=>'U','ð’°'=>'U','ð“¤'=>'U','ð”˜'=>'U','ð•Œ'=>'U','ð–€'=>'U','ð–´'=>'U','ð—¨'=>'U','ð˜œ'=>'U','ð™'=>'U','ðš„'=>'U','ï½–'=>'v','â…´'=>'v','ð¯'=>'v','ð‘£'=>'v','ð’—'=>'v','ð“‹'=>'v','ð“¿'=>'v','ð”³'=>'v','ð•§'=>'v','ð–›'=>'v','ð—'=>'v','ð˜ƒ'=>'v','ð˜·'=>'v','ð™«'=>'v','ðšŸ'=>'v','ð›Ž'=>'v','ðœˆ'=>'v','ð‚'=>'v','ð¼'=>'v','ðž¶'=>'v','â…µ'=>'vi','â…¶'=>'vii','â…·'=>'viii','ɯ'=>'w','ï½—'=>'w','ð°'=>'w','ð‘¤'=>'w','ð’˜'=>'w','ð“Œ'=>'w','ð”€'=>'w','ð”´'=>'w','ð•¨'=>'w','ð–œ'=>'w','ð—'=>'w','ð˜„'=>'w','ð˜¸'=>'w','ð™¬'=>'w','ðš '=>'w','ð‘Š'=>'W','ð‘¾'=>'W','ð’²'=>'W','ð“¦'=>'W','ð”š'=>'W','ð•Ž'=>'W','ð–‚'=>'W','ð–¶'=>'W','ð—ª'=>'W','ð˜ž'=>'W','ð™’'=>'W','ðš†'=>'W','×'=>'x','x'=>'x','â…¹'=>'x','ð±'=>'x','ð‘¥'=>'x','ð’™'=>'x','ð“'=>'x','ð”'=>'x','ð”µ'=>'x','ð•©'=>'x','ð–'=>'x','ð—‘'=>'x','ð˜…'=>'x','ð˜¹'=>'x','ð™­'=>'x','ðš¡'=>'x','á™­'=>'X','ð‘‹'=>'X','ð‘¿'=>'X','ð’³'=>'X','ð“§'=>'X','ð”›'=>'X','ð•'=>'X','ð–ƒ'=>'X','ð–·'=>'X','ð—«'=>'X','ð˜Ÿ'=>'X','ð™“'=>'X','ðš‡'=>'X','ðš¾'=>'X','ð›¸'=>'X','ðœ²'=>'X','ð¬'=>'X','ðž¦'=>'X','â…º'=>'xi','â…»'=>'xii','ï½™'=>'y','ð²'=>'y','ð‘¦'=>'y','ð’š'=>'y','ð“Ž'=>'y','ð”‚'=>'y','ð”¶'=>'y','ð•ª'=>'y','ð–ž'=>'y','ð—’'=>'y','ð˜†'=>'y','ð˜º'=>'y','ð™®'=>'y','ðš¢'=>'y','Æ´'=>'yÌ”','z'=>'z','ð³'=>'z','ð‘§'=>'z','ð’›'=>'z','ð“'=>'z','ð”ƒ'=>'z','ð”·'=>'z','ð•«'=>'z','ð–Ÿ'=>'z','ð—“'=>'z','ð˜‡'=>'z','ð˜»'=>'z','ð™¯'=>'z','ðš£'=>'z','È¥'=>'zÌ¡','Ê'=>'zÌ¢','ƶ'=>'z̵','È'=>'Ê’','?'=>'Ê”','?'=>'Ê”','â‡'=>'ʔʔ','âˆ'=>'ʔǃ','á¾½'=>'ʼ','᾿'=>'ʼ','’'=>'ʼ','ʾ'=>'ʼ','!'=>'ǃ','ï¼'=>'ǃ','â‰'=>'ǃʔ','‼'=>'ǃǃ','âº'=>'α','ð›‚'=>'α','ð›¼'=>'α','ðœ¶'=>'α','ð°'=>'α','ðžª'=>'α','ð›ƒ'=>'β','ð›½'=>'β','ðœ·'=>'β','ð±'=>'β','ðž«'=>'β','ℽ'=>'γ','ð›„'=>'γ','ð›¾'=>'γ','ðœ¸'=>'γ','ð²'=>'γ','ðž¬'=>'γ','ð›…'=>'δ','ð›¿'=>'δ','ðœ¹'=>'δ','ð³'=>'δ','ðž­'=>'δ','ðŸ‹'=>'Ï','ð›‡'=>'ζ','ðœ'=>'ζ','ðœ»'=>'ζ','ðµ'=>'ζ','ðž¯'=>'ζ','â¬'=>'θ','ð›‰'=>'θ','ð›'=>'θ','ðœƒ'=>'θ','ðœ—'=>'θ','ðœ½'=>'θ','ð‘'=>'θ','ð·'=>'θ','ðž‹'=>'θ','ðž±'=>'θ','ðŸ…'=>'θ','ð›Œ'=>'λ','ðœ†'=>'λ','ð€'=>'λ','ðº'=>'λ','ðž´'=>'λ','ð›¬'=>'Λ','ðœ¦'=>'Λ','ð '=>'Λ','ðžš'=>'Λ','ð›'=>'μ','ðœ‡'=>'μ','ð'=>'μ','ð»'=>'μ','ðžµ'=>'μ','ð›'=>'ξ','ðœ‰'=>'ξ','ðƒ'=>'ξ','ð½'=>'ξ','ðž·'=>'ξ','ð›¯'=>'Ξ','ðœ©'=>'Ξ','ð£'=>'Ξ','ðž'=>'Ξ','ℼ'=>'Ï€','ð›‘'=>'Ï€','ð›¡'=>'Ï€','ðœ‹'=>'Ï€','ðœ›'=>'Ï€','ð…'=>'Ï€','ð•'=>'Ï€','ð¿'=>'Ï€','ðž'=>'Ï€','ðž¹'=>'Ï€','ðŸ‰'=>'Ï€','á´¨'=>'Ï€','âˆ'=>'Π','ðš·'=>'Π','ð›±'=>'Π','ðœ«'=>'Π','ð¥'=>'Π','ðžŸ'=>'Π','ð›”'=>'σ','ðœŽ'=>'σ','ðˆ'=>'σ','ðž‚'=>'σ','ðž¼'=>'σ','ð›•'=>'Ï„','ðœ'=>'Ï„','ð‰'=>'Ï„','ðžƒ'=>'Ï„','ðž½'=>'Ï„','ð˜'=>'Y','ð‘Œ'=>'Y','ð’€'=>'Y','ð’´'=>'Y','ð“¨'=>'Y','ð”œ'=>'Y','ð•'=>'Y','ð–„'=>'Y','ð–¸'=>'Y','ð—¬'=>'Y','ð˜ '=>'Y','ð™”'=>'Y','ðšˆ'=>'Y','ðš¼'=>'Y','ð›¶'=>'Y','ðœ°'=>'Y','ðª'=>'Y','ðž¤'=>'Y','ð›—'=>'φ','ð›Ÿ'=>'φ','ðœ‘'=>'φ','ðœ™'=>'φ','ð‹'=>'φ','ð“'=>'φ','ðž…'=>'φ','ðž'=>'φ','ðž¿'=>'φ','ðŸ‡'=>'φ','ð›·'=>'Φ','ðœ±'=>'Φ','ð«'=>'Φ','ðž¥'=>'Φ','ð›˜'=>'χ','ðœ’'=>'χ','ðŒ'=>'χ','ðž†'=>'χ','ðŸ€'=>'χ','ð›™'=>'ψ','ðœ“'=>'ψ','ð'=>'ψ','ðž‡'=>'ψ','ðŸ'=>'ψ','ð›¹'=>'Ψ','ðœ³'=>'Ψ','ð­'=>'Ψ','ðž§'=>'Ψ','âµ'=>'ω','ð›š'=>'ω','ðœ”'=>'ω','ðŽ'=>'ω','ðžˆ'=>'ω','ðŸ‚'=>'ω','Ó•'=>'ae','Ò“'=>'r̵','Ò‘'=>'rá‘Š','Ò—'=>'ж̩','Ò™'=>'з̡','Ó'=>'i','Ò‹'=>'й̡','Ò›'=>'ĸ̩','ÒŸ'=>'ĸ̵','á´«'=>'л','Ó†'=>'л̡','ÓŽ'=>'м̡','ÓŠ'=>'н̡','Óˆ'=>'н̡','Ò£'=>'н̩','Ó©'=>'o̵','ѳ'=>'o̵','Ò«'=>'cÌ¡','Ò­'=>'Ñ‚Ì©','Ò¯'=>'y','Ò±'=>'y̵','Ñ›'=>'h̵','ѽ'=>'Ñ¡Òƒ','ÓŒ'=>'Ò·','Ò¿'=>'ҽ̢','Ò'=>'Ь̵','Õ¦'=>'q','Õ¼'=>'n','ℵ'=>'×','ﬡ'=>'×','אָ'=>'אַ','אּ'=>'אַ','ï­'=>'×ל','ℶ'=>'ב','â„·'=>'×’','ℸ'=>'ד','ﬢ'=>'ד','ﬣ'=>'×”','ﬤ'=>'×›','ﬥ'=>'ל','ﬦ'=>'×','ﬠ'=>'×¢','ﬧ'=>'ר','ﬨ'=>'ת','ﺀ'=>'Ø¡','ﺂ'=>'Ø¢','ïº'=>'Ø¢','ﺄ'=>'Ø£','ﺃ'=>'Ø£','Ùµ'=>'أ','ï­‘'=>'Ù±','ï­'=>'Ù±','ﺆ'=>'ؤ','ﺅ'=>'ؤ','Ù¶'=>'ÙˆÙ”','ﺈ'=>'Ø¥','ﺇ'=>'Ø¥','ﺋ'=>'ئ','ﺌ'=>'ئ','ﺊ'=>'ئ','ﺉ'=>'ئ','ﯫ'=>'ئا','ﯪ'=>'ئا','ﯸ'=>'ئٻ','ﯷ'=>'ئٻ','ﯶ'=>'ئٻ','ï²—'=>'ئج','ï°€'=>'ئج','ﲘ'=>'ئح','ï°'=>'ئح','ï²™'=>'ئخ','ﱤ'=>'ئر','ï±¥'=>'ئز','ﲚ'=>'ئم','ﳟ'=>'ئم','ﱦ'=>'ئم','ï°‚'=>'ئم','ﱧ'=>'ئن','ï²›'=>'ئه','ï³ '=>'ئه','ﯭ'=>'ئه','ﯬ'=>'ئه','ﯯ'=>'ئو','ﯮ'=>'ئو','ﯳ'=>'ئۆ','ﯲ'=>'ئۆ','ﯱ'=>'ئۇ','ﯰ'=>'ئۇ','ﯵ'=>'ئۈ','ﯴ'=>'ئۈ','ﯻ'=>'ئى','ﯺ'=>'ئى','ﱨ'=>'ئى','ﯹ'=>'ئى','ï°ƒ'=>'ئى','ﱩ'=>'ئى','ï°„'=>'ئى','ﺎ'=>'ا','ïº'=>'ا','ï´¼'=>'اً','ï´½'=>'اً','ï·³'=>'اكبر','ï·²'=>'الله','ﺑ'=>'ب','ﺒ'=>'ب','ïº'=>'ب','ïº'=>'ب','ﲜ'=>'بج','ï°…'=>'بج','ï²'=>'بح','ï°†'=>'بح','ï·‚'=>'بحى','ﲞ'=>'بخ','ï°‡'=>'بخ','ﶞ'=>'بخى','ﱪ'=>'بر','ﱫ'=>'بز','ﲟ'=>'بم','ﳡ'=>'بم','ﱬ'=>'بم','ï°ˆ'=>'بم','ï±­'=>'بن','ï² '=>'به','ï³¢'=>'به','ï±®'=>'بى','ï°‰'=>'بى','ﱯ'=>'بى','ï°Š'=>'بى','ï­”'=>'Ù»','ï­•'=>'Ù»','ï­“'=>'Ù»','ï­’'=>'Ù»','Û'=>'Ù»','ﯦ'=>'Ù»','ﯧ'=>'Ù»','ﯥ'=>'Ù»','ﯤ'=>'Ù»','ï­˜'=>'Ù¾','ï­™'=>'Ù¾','ï­—'=>'Ù¾','ï­–'=>'Ù¾','ï­œ'=>'Ú€','ï­'=>'Ú€','ï­›'=>'Ú€','ï­š'=>'Ú€','ﺔ'=>'Ø©','ﺓ'=>'Ø©','ﺗ'=>'ت','ﺘ'=>'ت','ﺖ'=>'ت','ﺕ'=>'ت','ﲡ'=>'تج','ï°‹'=>'تج','ïµ'=>'تجم','ﶠ'=>'تجى','ﶟ'=>'تجى','ï²¢'=>'تح','ï°Œ'=>'تح','ïµ’'=>'تحج','ﵑ'=>'تحج','ﵓ'=>'تحم','ï²£'=>'تخ','ï°'=>'تخ','ïµ”'=>'تخم','ﶢ'=>'تخى','ﶡ'=>'تخى','ï±°'=>'تر','ï±±'=>'تز','ﲤ'=>'تم','ï³£'=>'تم','ï±²'=>'تم','ï°Ž'=>'تم','ﵕ'=>'تمج','ïµ–'=>'تمح','ïµ—'=>'تمخ','ﶤ'=>'تمى','ﶣ'=>'تمى','ï±³'=>'تن','ï²¥'=>'ته','ﳤ'=>'ته','ï±´'=>'تى','ï°'=>'تى','ï±µ'=>'تى','ï°'=>'تى','ﺛ'=>'Ø«','ﺜ'=>'Ø«','ﺚ'=>'Ø«','ﺙ'=>'Ø«','ï°‘'=>'ثج','ﱶ'=>'ثر','ï±·'=>'ثز','ﲦ'=>'ثم','ï³¥'=>'ثم','ﱸ'=>'ثم','ï°’'=>'ثم','ï±¹'=>'ثن','ﳦ'=>'ثه','ﱺ'=>'ثى','ï°“'=>'ثى','ï±»'=>'ثى','ï°”'=>'ثى','ï­¨'=>'Ù¹','ï­©'=>'Ù¹','ï­§'=>'Ù¹','ï­¦'=>'Ù¹','Ú»'=>'Ù¹','ﮢ'=>'Ù¹','ﮣ'=>'Ù¹','ﮡ'=>'Ù¹','ï® '=>'Ù¹','ï­ '=>'Ùº','ï­¡'=>'Ùº','ï­Ÿ'=>'Ùº','ï­ž'=>'Ùº','ï­¤'=>'Ù¿','ï­¥'=>'Ù¿','ï­£'=>'Ù¿','ï­¢'=>'Ù¿','ﺟ'=>'ج','ﺠ'=>'ج','ﺞ'=>'ج','ïº'=>'ج','ﲧ'=>'جح','ï°•'=>'جح','ﶦ'=>'جحى','ﶾ'=>'جحى','ï·»'=>'جل جلاله','ﲨ'=>'جم','ï°–'=>'جم','ïµ™'=>'جمح','ﵘ'=>'جمح','ﶧ'=>'جمى','ﶥ'=>'جمى','ï´'=>'جى','ï´'=>'جى','ï´ž'=>'جى','ï´‚'=>'جى','ï­¸'=>'Úƒ','ï­¹'=>'Úƒ','ï­·'=>'Úƒ','ï­¶'=>'Úƒ','ï­´'=>'Ú„','ï­µ'=>'Ú„','ï­³'=>'Ú„','ï­²'=>'Ú„','ï­¼'=>'Ú†','ï­½'=>'Ú†','ï­»'=>'Ú†','ï­º'=>'Ú†','ﮀ'=>'Ú‡','ï®'=>'Ú‡','ï­¿'=>'Ú‡','ï­¾'=>'Ú‡','ﺣ'=>'Ø­','ﺤ'=>'Ø­','ﺢ'=>'Ø­','ﺡ'=>'Ø­','ﲩ'=>'حج','ï°—'=>'حج','ﶿ'=>'حجى','ﲪ'=>'حم','ï°˜'=>'حم','ïµ›'=>'حمى','ﵚ'=>'حمى','ï´›'=>'حى','ﳿ'=>'حى','ï´œ'=>'حى','ï´€'=>'حى','ﺧ'=>'Ø®','ﺨ'=>'Ø®','ﺦ'=>'Ø®','ﺥ'=>'Ø®','ﲫ'=>'خج','ï°™'=>'خج','ï°š'=>'خح','ﲬ'=>'خم','ï°›'=>'خم','ï´Ÿ'=>'خى','ï´ƒ'=>'خى','ï´ '=>'خى','ï´„'=>'خى','ﺪ'=>'د','ﺩ'=>'د','ﺬ'=>'Ø°','ﺫ'=>'Ø°','ï±›'=>'ذٰ','ﮉ'=>'Úˆ','ﮈ'=>'Úˆ','ï®…'=>'ÚŒ','ﮄ'=>'ÚŒ','ﮃ'=>'Ú','ﮂ'=>'Ú','ﮇ'=>'ÚŽ','ﮆ'=>'ÚŽ','ﺮ'=>'ر','ﺭ'=>'ر','ﱜ'=>'رٰ','ï·¶'=>'رسول','ï·¼'=>'رىال','ﺰ'=>'ز','ﺯ'=>'ز','ï®'=>'Ú‘','ﮌ'=>'Ú‘','ﮋ'=>'Ú˜','ﮊ'=>'Ú˜','ﺳ'=>'س','ﺴ'=>'س','ﺲ'=>'س','ﺱ'=>'س','ï²­'=>'سج','ï´´'=>'سج','ï°œ'=>'سج','ïµ'=>'سجح','ﵞ'=>'سجى','ï²®'=>'سح','ï´µ'=>'سح','ï°'=>'سح','ﵜ'=>'سحج','ﲯ'=>'سخ','ï´¶'=>'سخ','ï°ž'=>'سخ','ﶨ'=>'سخى','ï·†'=>'سخى','ï´ª'=>'سر','ï´Ž'=>'سر','ï²°'=>'سم','ﳧ'=>'سم','ï°Ÿ'=>'سم','ﵡ'=>'سمج','ïµ '=>'سمح','ﵟ'=>'سمح','ïµ£'=>'سمم','ïµ¢'=>'سمم','ï´±'=>'سه','ﳨ'=>'سه','ï´—'=>'سى','ï³»'=>'سى','ï´˜'=>'سى','ï³¼'=>'سى','ﺷ'=>'Ø´','ﺸ'=>'Ø´','ﺶ'=>'Ø´','ﺵ'=>'Ø´','ï´­'=>'شج','ï´·'=>'شج','ï´¥'=>'شج','ï´‰'=>'شج','ﵩ'=>'شجى','ï´®'=>'شح','ï´¸'=>'شح','ï´¦'=>'شح','ï´Š'=>'شح','ﵨ'=>'شحم','ﵧ'=>'شحم','ﶪ'=>'شحى','ï´¯'=>'شخ','ï´¹'=>'شخ','ï´§'=>'شخ','ï´‹'=>'شخ','ï´©'=>'شر','ï´'=>'شر','ï´°'=>'شم','ﳩ'=>'شم','ï´¨'=>'شم','ï´Œ'=>'شم','ﵫ'=>'شمخ','ﵪ'=>'شمخ','ïµ­'=>'شمم','ﵬ'=>'شمم','ï´²'=>'شه','ﳪ'=>'شه','ï´™'=>'شى','ï³½'=>'شى','ï´š'=>'شى','ï³¾'=>'شى','ﺻ'=>'ص','ﺼ'=>'ص','ﺺ'=>'ص','ﺹ'=>'ص','ï²±'=>'صح','ï° '=>'صح','ïµ¥'=>'صحح','ﵤ'=>'صحح','ﶩ'=>'صحى','ï²²'=>'صخ','ï´«'=>'صر','ï´'=>'صر','ï·µ'=>'صلعم','ï·¹'=>'صلى','ï·º'=>'صلى الله علىه وسلم','ï·°'=>'صلے','ï²³'=>'صم','ï°¡'=>'صم','ï·…'=>'صمم','ﵦ'=>'صمم','ï´¡'=>'صى','ï´…'=>'صى','ï´¢'=>'صى','ï´†'=>'صى','ﺿ'=>'ض','ﻀ'=>'ض','ﺾ'=>'ض','ﺽ'=>'ض','ï²´'=>'ضج','ï°¢'=>'ضج','ï²µ'=>'ضح','ï°£'=>'ضح','ïµ®'=>'ضحى','ﶫ'=>'ضحى','ﲶ'=>'ضخ','ï°¤'=>'ضخ','ïµ°'=>'ضخم','ﵯ'=>'ضخم','ï´¬'=>'ضر','ï´'=>'ضر','ï²·'=>'ضم','ï°¥'=>'ضم','ï´£'=>'ضى','ï´‡'=>'ضى','ï´¤'=>'ضى','ï´ˆ'=>'ضى','ﻃ'=>'Ø·','ﻄ'=>'Ø·','ﻂ'=>'Ø·','ï»'=>'Ø·','ﲸ'=>'طح','ï°¦'=>'طح','ï´³'=>'طم','ï´º'=>'طم','ï°§'=>'طم','ïµ²'=>'طمح','ïµ±'=>'طمح','ïµ³'=>'طمم','ïµ´'=>'طمى','ï´‘'=>'طى','ï³µ'=>'طى','ï´’'=>'طى','ﳶ'=>'طى','ﻇ'=>'ظ','ﻈ'=>'ظ','ﻆ'=>'ظ','ï»…'=>'ظ','ï²¹'=>'ظم','ï´»'=>'ظم','ï°¨'=>'ظم','ﻋ'=>'ع','ﻌ'=>'ع','ﻊ'=>'ع','ﻉ'=>'ع','ﲺ'=>'عج','ï°©'=>'عج','ï·„'=>'عجم','ïµµ'=>'عجم','ï··'=>'علىه','ï²»'=>'عم','ï°ª'=>'عم','ïµ·'=>'عمم','ﵶ'=>'عمم','ﵸ'=>'عمى','ﶶ'=>'عمى','ï´“'=>'عى','ï³·'=>'عى','ï´”'=>'عى','ﳸ'=>'عى','ï»'=>'غ','ï»'=>'غ','ﻎ'=>'غ','ï»'=>'غ','ï²¼'=>'غج','ï°«'=>'غج','ï²½'=>'غم','ï°¬'=>'غم','ïµ¹'=>'غمم','ïµ»'=>'غمى','ﵺ'=>'غمى','ï´•'=>'غى','ï³¹'=>'غى','ï´–'=>'غى','ﳺ'=>'غى','ﻓ'=>'Ù','ï»”'=>'Ù','ï»’'=>'Ù','ﻑ'=>'Ù','ï²¾'=>'Ùج','ï°­'=>'Ùج','ﲿ'=>'ÙØ­','ï°®'=>'ÙØ­','ï³€'=>'ÙØ®','ï°¯'=>'ÙØ®','ïµ½'=>'Ùخم','ïµ¼'=>'Ùخم','ï³'=>'ÙÙ…','ï°°'=>'ÙÙ…','ï·'=>'Ùمى','ï±¼'=>'ÙÙ‰','ï°±'=>'ÙÙ‰','ï±½'=>'ÙÙ‰','ï°²'=>'ÙÙ‰','ï­¬'=>'Ú¤','ï­­'=>'Ú¤','ï­«'=>'Ú¤','ï­ª'=>'Ú¤','ï­°'=>'Ú¦','ï­±'=>'Ú¦','ï­¯'=>'Ú¦','ï­®'=>'Ú¦','ï»—'=>'Ù‚','ﻘ'=>'Ù‚','ï»–'=>'Ù‚','ﻕ'=>'Ù‚','ﳂ'=>'قح','ï°³'=>'قح','ï·±'=>'قلے','ﳃ'=>'قم','ï°´'=>'قم','ﶴ'=>'قمح','ïµ¾'=>'قمح','ﵿ'=>'قمم','ﶲ'=>'قمى','ï±¾'=>'قى','ï°µ'=>'قى','ﱿ'=>'قى','ï°¶'=>'قى','ï»›'=>'Ùƒ','ﻜ'=>'Ùƒ','ﻚ'=>'Ùƒ','ï»™'=>'Ùƒ','Ú©'=>'Ùƒ','ï®'=>'Ùƒ','ﮑ'=>'Ùƒ','ï®'=>'Ùƒ','ﮎ'=>'Ùƒ','ï²€'=>'كا','ï°·'=>'كا','ﳄ'=>'كج','ï°¸'=>'كج','ï³…'=>'كح','ï°¹'=>'كح','ﳆ'=>'كخ','ï°º'=>'كخ','ﳇ'=>'كل','ﳫ'=>'كل','ï²'=>'كل','ï°»'=>'كل','ﳈ'=>'كم','ﳬ'=>'كم','ﲂ'=>'كم','ï°¼'=>'كم','ï·ƒ'=>'كمم','ﶻ'=>'كمم','ﶷ'=>'كمى','ﲃ'=>'كى','ï°½'=>'كى','ﲄ'=>'كى','ï°¾'=>'كى','ﯕ'=>'Ú­','ﯖ'=>'Ú­','ﯔ'=>'Ú­','ﯓ'=>'Ú­','ï®”'=>'Ú¯','ﮕ'=>'Ú¯','ﮓ'=>'Ú¯','ï®’'=>'Ú¯','ﮜ'=>'Ú±','ï®'=>'Ú±','ï®›'=>'Ú±','ﮚ'=>'Ú±','ﮘ'=>'Ú³','ï®™'=>'Ú³','ï®—'=>'Ú³','ï®–'=>'Ú³','ﻟ'=>'Ù„','ï» '=>'Ù„','ﻞ'=>'Ù„','ï»'=>'Ù„','ﻶ'=>'لآ','ﻵ'=>'لآ','ﻸ'=>'لأ','ï»·'=>'لأ','ﻺ'=>'لإ','ﻹ'=>'لإ','ﻼ'=>'لا','ï»»'=>'لا','ﳉ'=>'لج','ï°¿'=>'لج','ﶃ'=>'لجج','ﶄ'=>'لجج','ﶺ'=>'لجم','ﶼ'=>'لجم','ﶬ'=>'لجى','ﳊ'=>'لح','ï±€'=>'لح','ﶵ'=>'لحم','ﶀ'=>'لحم','ﶂ'=>'لحى','ï¶'=>'لحى','ﳋ'=>'لخ','ï±'=>'لخ','ﶆ'=>'لخم','ﶅ'=>'لخم','ﳌ'=>'لم','ï³­'=>'لم','ï²…'=>'لم','ﱂ'=>'لم','ﶈ'=>'لمح','ﶇ'=>'لمح','ﶭ'=>'لمى','ï³'=>'له','ﲆ'=>'لى','ﱃ'=>'لى','ﲇ'=>'لى','ﱄ'=>'لى','ﻣ'=>'Ù…','ﻤ'=>'Ù…','ﻢ'=>'Ù…','ﻡ'=>'Ù…','ﲈ'=>'ما','ﳎ'=>'مج','ï±…'=>'مج','ﶌ'=>'مجح','ﶒ'=>'مجخ','ï¶'=>'مجم','ï·€'=>'مجى','ï³'=>'مح','ﱆ'=>'مح','ﶉ'=>'محج','ﶊ'=>'محم','ï·´'=>'محمد','ﶋ'=>'محى','ï³'=>'مخ','ﱇ'=>'مخ','ﶎ'=>'مخج','ï¶'=>'مخم','ﶹ'=>'مخى','ﳑ'=>'مم','ﲉ'=>'مم','ﱈ'=>'مم','ﶱ'=>'ممى','ﱉ'=>'مى','ﱊ'=>'مى','ﻧ'=>'Ù†','ﻨ'=>'Ù†','ﻦ'=>'Ù†','ﻥ'=>'Ù†','ï³’'=>'نج','ﱋ'=>'نج','ﶸ'=>'نجح','ﶽ'=>'نجح','ﶘ'=>'نجم','ﶗ'=>'نجم','ﶙ'=>'نجى','ï·‡'=>'نجى','ﳓ'=>'نح','ﱌ'=>'نح','ﶕ'=>'نحم','ﶖ'=>'نحى','ﶳ'=>'نحى','ï³”'=>'نخ','ï±'=>'نخ','ﲊ'=>'نر','ﲋ'=>'نز','ﳕ'=>'نم','ï³®'=>'نم','ﲌ'=>'نم','ﱎ'=>'نم','ﶛ'=>'نمى','ﶚ'=>'نمى','ï²'=>'نن','ï³–'=>'نه','ﳯ'=>'نه','ﲎ'=>'نى','ï±'=>'نى','ï²'=>'نى','ï±'=>'نى','ﮟ'=>'Úº','ﮞ'=>'Úº','ﻫ'=>'Ù‡','ﻬ'=>'Ù‡','ﻪ'=>'Ù‡','ﻩ'=>'Ù‡','Ú¾'=>'Ù‡','ﮬ'=>'Ù‡','ï®­'=>'Ù‡','ﮫ'=>'Ù‡','ﮪ'=>'Ù‡','Û'=>'Ù‡','ﮨ'=>'Ù‡','ﮩ'=>'Ù‡','ﮧ'=>'Ù‡','ﮦ'=>'Ù‡','Û•'=>'Ù‡','ï³™'=>'هٰ','ï³—'=>'هج','ﱑ'=>'هج','ﳘ'=>'هم','ï±’'=>'هم','ﶓ'=>'همج','ﶔ'=>'همم','ﱓ'=>'هى','ï±”'=>'هى','ﮥ'=>'Û€','ﮤ'=>'Û€','ï»®'=>'Ùˆ','ï»­'=>'Ùˆ','ï·¸'=>'وسلم','ﯡ'=>'Û…','ﯠ'=>'Û…','ﯚ'=>'Û†','ﯙ'=>'Û†','ﯘ'=>'Û‡','ﯗ'=>'Û‡','Ù·'=>'Û‡Ù”','ï¯'=>'Û‡Ù”','ﯜ'=>'Ûˆ','ﯛ'=>'Ûˆ','ﯣ'=>'Û‰','ﯢ'=>'Û‰','ﯟ'=>'Û‹','ﯞ'=>'Û‹','ﯨ'=>'Ù‰','ﯩ'=>'Ù‰','ï»°'=>'Ù‰','ﻯ'=>'Ù‰','ÙŠ'=>'Ù‰','ﻳ'=>'Ù‰','ï»´'=>'Ù‰','ﻲ'=>'Ù‰','ï»±'=>'Ù‰','ÛŒ'=>'Ù‰','ﯾ'=>'Ù‰','ﯿ'=>'Ù‰','ﯽ'=>'Ù‰','ﯼ'=>'Ù‰','Ù¸'=>'Ù‰Ù”','ï²'=>'ىٰ','ï±'=>'ىٰ','ﳚ'=>'ىج','ﱕ'=>'ىج','ﶯ'=>'ىجى','ï³›'=>'ىح','ï±–'=>'ىح','ﶮ'=>'ىحى','ﳜ'=>'ىخ','ï±—'=>'ىخ','ﲑ'=>'ىر','ï²’'=>'ىز','ï³'=>'ىم','ï³°'=>'ىم','ﲓ'=>'ىم','ﱘ'=>'ىم','ï¶'=>'ىمم','ﶜ'=>'ىمم','ﶰ'=>'ىمى','ï²”'=>'ىن','ﳞ'=>'ىه','ï³±'=>'ىه','ﲕ'=>'ىى','ï±™'=>'ىى','ï²–'=>'ىى','ﱚ'=>'ىى','Û§'=>'Û¦','ﮯ'=>'Û’','ï®®'=>'Û’','ï®±'=>'Û“','ï®°'=>'Û“','∃'=>'â´º','आ'=>'अा','ऒ'=>'अाॆ','ओ'=>'अाे','औ'=>'अाै','ऄ'=>'अॆ','ऑ'=>'अॉ','à¤'=>'à¤à¥…','ऎ'=>'à¤à¥†','à¤'=>'à¤à¥‡','ई'=>'रà¥à¤‡','আ'=>'অা','ৠ'=>'ঋৃ','ৡ'=>'ঌৢ','ਉ'=>'ੳà©','ਊ'=>'ੳੂ','ਆ'=>'ਅਾ','à¨'=>'ਅੈ','ਔ'=>'ਅੌ','ਇ'=>'ੲਿ','ਈ'=>'ੲੀ','à¨'=>'ੲੇ','આ'=>'અા','ઑ'=>'અાૅ','ઓ'=>'અાે','ઔ'=>'અાૈ','àª'=>'અૅ','àª'=>'અે','àª'=>'અૈ','ଆ'=>'ଅା','௮'=>'à®…','à®°'=>'ஈ','ா'=>'ஈ','௫'=>'ஈà¯','௨'=>'உ','ஊ'=>'உள','௭'=>'எ','௷'=>'எவ','ஜ'=>'à®','௧'=>'க','௪'=>'ச','௬'=>'சà¯','௲'=>'சூ','௺'=>'நீ','ை'=>'ன','௴'=>'மீ','௰'=>'ய','ௗ'=>'ள','௸'=>'à®·','ொ'=>'ெஈ','ௌ'=>'ெள','ோ'=>'ேஈ','à± '=>'à°‹à°¾','ౡ'=>'ఌా','à°”'=>'ఒౌ','à°“'=>'ఒౕ','à°¢'=>'à°¡Ì£','à°­'=>'బ̣','à°·'=>'వ̣','à°¹'=>'వా','à°®'=>'à°µà±','ూ'=>'à±à°¾','ౄ'=>'ృా','ೡ'=>'ಌಾ','ಔ'=>'ఒౌ','à´ˆ'=>'ഇൗ','à´Š'=>'உൗ','à´'=>'എെ','à´“'=>'à´’à´¾','à´”'=>'ഒൗ','ൡ'=>'à´ž','൫'=>'à´¦àµà´°','à´Œ'=>'നூ','à´™'=>'നூ','൯'=>'à´¨àµ','à´±'=>'à´°','൪'=>'à´°àµ','൮'=>'à´µàµ','ീ'=>'ி','ൂ'=>'ூ','ൃ'=>'ூ','ൈ'=>'െെ','ฃ'=>'ข','ด'=>'ค','ต'=>'ค','ม'=>'ฆ','ซ'=>'ช','à¸'=>'ฎ','ท'=>'ฑ','ๅ'=>'า','ำ'=>'̊า','à¹'=>'เเ','ໜ'=>'ຫນ','à»'=>'ຫມ','ຳ'=>'̊າ','ཷ'=>'ྲཱྀ','ཹ'=>'ླཱྀ','á€'=>'o','ឣ'=>'អ','á§'=>'ᦞ','á­’'=>'á¬','á­“'=>'ᬑ','á­˜'=>'ᬨ','ᢖ'=>'á¡œ','á¡•'=>'á µ','á’'=>'Ꭱ','Ꮍ'=>'y','ð€'=>'A','ð´'=>'A','ð‘¨'=>'A','ð’œ'=>'A','ð“'=>'A','ð”„'=>'A','ð”¸'=>'A','ð•¬'=>'A','ð– '=>'A','ð—”'=>'A','ð˜ˆ'=>'A','ð˜¼'=>'A','ð™°'=>'A','ðš¨'=>'A','ð›¢'=>'A','ðœœ'=>'A','ð–'=>'A','ðž'=>'A','ð‰'=>'J','ð½'=>'J','ð‘±'=>'J','ð’¥'=>'J','ð“™'=>'J','ð”'=>'J','ð•'=>'J','ð•µ'=>'J','ð–©'=>'J','ð—'=>'J','ð˜‘'=>'J','ð™…'=>'J','ð™¹'=>'J','á§'=>'J','â‹¿'=>'E','â„°'=>'E','ð„'=>'E','ð¸'=>'E','ð‘¬'=>'E','ð“”'=>'E','ð”ˆ'=>'E','ð”¼'=>'E','ð•°'=>'E','ð–¤'=>'E','ð—˜'=>'E','ð˜Œ'=>'E','ð™€'=>'E','ð™´'=>'E','ðš¬'=>'E','ð›¦'=>'E','ðœ '=>'E','ðš'=>'E','ðž”'=>'E','ℾ'=>'Ꮁ','ðšª'=>'Ꮁ','ð›¤'=>'Ꮁ','ðœž'=>'Ꮁ','ð˜'=>'Ꮁ','ðž’'=>'Ꮁ','á”'=>'w','ℳ'=>'M','ðŒ'=>'M','ð‘€'=>'M','ð‘´'=>'M','ð“œ'=>'M','ð”'=>'M','ð•„'=>'M','ð•¸'=>'M','ð–¬'=>'M','ð— '=>'M','ð˜”'=>'M','ð™ˆ'=>'M','ð™¼'=>'M','ðš³'=>'M','ð›­'=>'M','ðœ§'=>'M','ð¡'=>'M','ðž›'=>'M','â„‹'=>'H','â„Œ'=>'H','â„'=>'H','ð‡'=>'H','ð»'=>'H','ð‘¯'=>'H','ð“—'=>'H','ð•³'=>'H','ð–§'=>'H','ð—›'=>'H','ð˜'=>'H','ð™ƒ'=>'H','ð™·'=>'H','ðš®'=>'H','ð›¨'=>'H','ðœ¢'=>'H','ðœ'=>'H','ðž–'=>'H','ð†'=>'G','ðº'=>'G','ð‘®'=>'G','ð’¢'=>'G','ð“–'=>'G','ð”Š'=>'G','ð”¾'=>'G','ð•²'=>'G','ð–¦'=>'G','ð—š'=>'G','ð˜Ž'=>'G','ð™‚'=>'G','ð™¶'=>'G','á³'=>'G','ℤ'=>'Z','ℨ'=>'Z','ð™'=>'Z','ð‘'=>'Z','ð’'=>'Z','ð’µ'=>'Z','ð“©'=>'Z','ð–…'=>'Z','ð–¹'=>'Z','ð—­'=>'Z','ð˜¡'=>'Z','ð™•'=>'Z','ðš‰'=>'Z','ðš­'=>'Z','ð›§'=>'Z','ðœ¡'=>'Z','ð›'=>'Z','ðž•'=>'Z','ð’'=>'S','ð‘†'=>'S','ð‘º'=>'S','ð’®'=>'S','ð“¢'=>'S','ð”–'=>'S','ð•Š'=>'S','ð•¾'=>'S','ð–²'=>'S','ð—¦'=>'S','ð˜š'=>'S','ð™Ž'=>'S','ðš‚'=>'S','áš'=>'S','ð•'=>'V','ð‘‰'=>'V','ð‘½'=>'V','ð’±'=>'V','ð“¥'=>'V','ð”™'=>'V','ð•'=>'V','ð–'=>'V','ð–µ'=>'V','ð—©'=>'V','ð˜'=>'V','ð™‘'=>'V','ðš…'=>'V','â„’'=>'L','ð‹'=>'L','ð¿'=>'L','ð‘³'=>'L','ð“›'=>'L','ð”'=>'L','ð•ƒ'=>'L','ð•·'=>'L','ð–«'=>'L','ð—Ÿ'=>'L','ð˜“'=>'L','ð™‡'=>'L','ð™»'=>'L','∑'=>'C','â…€'=>'C','â„‚'=>'C','â„­'=>'C','ð‚'=>'C','ð¶'=>'C','ð‘ª'=>'C','ð’ž'=>'C','ð“’'=>'C','ð•®'=>'C','ð–¢'=>'C','ð—–'=>'C','ð˜Š'=>'C','ð˜¾'=>'C','ð™²'=>'C','ðšº'=>'C','ð›´'=>'C','ðœ®'=>'C','ð¨'=>'C','ðž¢'=>'C','â„™'=>'P','ð'=>'P','ð‘ƒ'=>'P','ð‘·'=>'P','ð’«'=>'P','ð“Ÿ'=>'P','ð”“'=>'P','ð•»'=>'P','ð–¯'=>'P','ð—£'=>'P','ð˜—'=>'P','ð™‹'=>'P','ð™¿'=>'P','ðš¸'=>'P','ð›²'=>'P','ðœ¬'=>'P','ð¦'=>'P','ðž '=>'P','ðŠ'=>'K','ð¾'=>'K','ð‘²'=>'K','ð’¦'=>'K','ð“š'=>'K','ð”Ž'=>'K','ð•‚'=>'K','ð•¶'=>'K','ð–ª'=>'K','ð—ž'=>'K','ð˜’'=>'K','ð™†'=>'K','ð™º'=>'K','ðš±'=>'K','ð›«'=>'K','ðœ¥'=>'K','ðŸ'=>'K','ðž™'=>'K','ℬ'=>'B','ð'=>'B','ðµ'=>'B','ð‘©'=>'B','ð“‘'=>'B','ð”…'=>'B','ð”¹'=>'B','ð•­'=>'B','ð–¡'=>'B','ð—•'=>'B','ð˜‰'=>'B','ð˜½'=>'B','ð™±'=>'B','ðš©'=>'B','ð›£'=>'B','ðœ'=>'B','ð—'=>'B','ðž‘'=>'B','á'=>'á·','∆'=>'áƒ','ðš«'=>'áƒ','ð›¥'=>'áƒ','ðœŸ'=>'áƒ','ð™'=>'áƒ','ðž“'=>'áƒ','á'=>'áƒÂ·','á‘'=>'á„·','á“'=>'á…·','á•'=>'á†Â·','á˜'=>'áŠÂ·','áš'=>'á‹Â·','á“‘'=>'á¡','ᑶ'=>'·P','ᑺ'=>'·d','á’˜'=>'·J','á‘'=>'á³Â·','ᑃ'=>'á´Â·','á‘…'=>'á¸Â·','ᑇ'=>'á¹Â·','ˈ'=>'á‘Š','ᑘ'=>'ᑌ·','ᑧ'=>'ᑌᑊ','á‘š'=>'ᑎ·','ᑨ'=>'á‘Žá‘Š','á‘œ'=>'á‘·','á‘ž'=>'á‘·','á‘©'=>'á‘á‘Š','á‘ '=>'ᑑ·','á‘¢'=>'ᑕ·','ᑪ'=>'á‘•á‘Š','ᑤ'=>'ᑖ·','ᑵ'=>'ᑫ·','á’…'=>'á‘«á‘Š','á‘·'=>'P·','á’†'=>'Pá‘Š','ᑹ'=>'ᑮ·','á‘»'=>'d·','á’‡'=>'dá‘Š','ᑽ'=>'ᑰ·','á‘¿'=>'ᑲ·','á’ˆ'=>'ᑲᑊ','á’'=>'ᑳ·','ᘃ'=>'á’‰','á’“'=>'ᒉ·','á’•'=>'ᒋ·','á’—'=>'ᒌ·','á’™'=>'J·','á’›'=>'ᒎ·','ᘂ'=>'á’','á’'=>'á’·','á’Ÿ'=>'ᒑ·','á’­'=>'ᒣ·','á’¯'=>'ᒥ·','á’±'=>'ᒦ·','á’³'=>'ᒧ·','á’µ'=>'ᒨ·','á’¹'=>'ᒫ·','á“Š'=>'ᓀ·','á“Œ'=>'ᓇ·','á“Ž'=>'ᓈᒫ','ᘄ'=>'á““','á“'=>'ᓓ·','á“Ÿ'=>'ᓕ·','á“¡'=>'ᓖ·','á“£'=>'ᓗ·','á“¥'=>'ᓘ·','ᘇ'=>'á“š','ᓧ'=>'ᓚ·','á“©'=>'ᓛ·','á“·'=>'ᓭ·','ᓹ'=>'ᓯ·','á“»'=>'ᓰ·','ᓽ'=>'ᓱ·','á“¿'=>'ᓲ·','á”'=>'ᓴ·','ᔃ'=>'ᓵ·','ᔌ'=>'ᔋá¸','á”'=>'ᔋᑕ','ᔎ'=>'ᔋᑲ','á”'=>'ᔋá’','ᔘ'=>'á”·','ᔚ'=>'ᔑ·','ᔜ'=>'ᔒ·','ᔞ'=>'ᔓ·','á” '=>'ᔔ·','ᔢ'=>'ᔕ·','ᔤ'=>'ᔖ·','ᔲ'=>'ᔨ·','á”´'=>'ᔩ·','ᔶ'=>'ᔪ·','ᔸ'=>'ᔫ·','ᔺ'=>'ᔭ·','ᔼ'=>'ᔮ·','á™®'=>'x','ᕽ'=>'x','ᘢ'=>'ᕃ','ᘣ'=>'ᕆ','ᘤ'=>'á•Š','á•'=>'ᕌ·','ᙯ'=>'á•á‘«','ᕾ'=>'á•á‘¬','á•¿'=>'á•P','á–€'=>'á•á‘®','á–'=>'á•d','á–‚'=>'á•á‘°','á–ƒ'=>'á•á‘²','á–„'=>'á•á‘³','á–…'=>'á•á’ƒ','á•œ'=>'ᕚ·','á•©'=>'ᕧ·','â„›'=>'R','â„œ'=>'R','â„'=>'R','ð‘'=>'R','ð‘…'=>'R','ð‘¹'=>'R','ð“¡'=>'R','ð•½'=>'R','ð–±'=>'R','ð—¥'=>'R','ð˜™'=>'R','ð™'=>'R','ðš'=>'R','á™°'=>'á–•á’‰','á–Ž'=>'á–•á’Š','á–'=>'á–•á’‹','á–'=>'á–•á’Œ','á–‘'=>'á–•J','á–’'=>'á–•á’Ž','á–“'=>'á–•á’','á–”'=>'á–•á’‘','á™±'=>'á––á’‹','ᙲ'=>'á––á’Œ','ᙳ'=>'á––J','á™´'=>'á––á’Ž','ᙵ'=>'á––á’','ᙶ'=>'á––á’‘','ℱ'=>'F','ð…'=>'F','ð¹'=>'F','ð‘­'=>'F','ð“•'=>'F','ð”‰'=>'F','ð”½'=>'F','ð•±'=>'F','ð–¥'=>'F','ð—™'=>'F','ð˜'=>'F','ð™'=>'F','ð™µ'=>'F','ðŸŠ'=>'F','â……'=>'D','ðƒ'=>'D','ð·'=>'D','ð‘«'=>'D','ð’Ÿ'=>'D','ð““'=>'D','ð”‡'=>'D','ð”»'=>'D','ð•¯'=>'D','ð–£'=>'D','ð——'=>'D','ð˜‹'=>'D','ð˜¿'=>'D','ð™³'=>'D','á—ª'=>'D','℧'=>'ᘮ','ᘴ'=>'ᘮ','ð›€'=>'ᘯ','ð›º'=>'ᘯ','ðœ´'=>'ᘯ','ð®'=>'ᘯ','ðž¨'=>'ᘯ','ᘵ'=>'ᘯ','ㄱ'=>'á„€','ᄀ'=>'á„€','ᆨ'=>'á„€','ㄲ'=>'á„','ï¾¢'=>'á„','ᆩ'=>'á„','ã„´'=>'á„‚','ᄂ'=>'á„‚','ᆫ'=>'á„‚','ã„·'=>'ᄃ','ᄃ'=>'ᄃ','ᆮ'=>'ᄃ','ㄸ'=>'á„„','ᄄ'=>'á„„','ㄹ'=>'á„…','ᄅ'=>'á„…','ᆯ'=>'á„…','ã…'=>'ᄆ','ï¾±'=>'ᄆ','ᆷ'=>'ᄆ','ã…‚'=>'ᄇ','ï¾²'=>'ᄇ','ᆸ'=>'ᄇ','ã…ƒ'=>'ᄈ','ï¾³'=>'ᄈ','ã……'=>'ᄉ','ï¾µ'=>'ᄉ','ᆺ'=>'ᄉ','ã…†'=>'á„Š','ᄊ'=>'á„Š','ᆻ'=>'á„Š','ã…‡'=>'á„‹','ï¾·'=>'á„‹','ᆼ'=>'á„‹','ã…ˆ'=>'á„Œ','ᄌ'=>'á„Œ','ᆽ'=>'á„Œ','ã…‰'=>'á„','ï¾¹'=>'á„','ã…Š'=>'á„Ž','ᄎ'=>'á„Ž','ᆾ'=>'á„Ž','ã…‹'=>'á„','ï¾»'=>'á„','ᆿ'=>'á„','ã…Œ'=>'á„','ï¾¼'=>'á„','ᇀ'=>'á„','ã…'=>'á„‘','ï¾½'=>'á„‘','á‡'=>'á„‘','ã…Ž'=>'á„’','ï¾¾'=>'á„’','ᇂ'=>'á„’','ᇅ'=>'á„“','ã…¥'=>'á„”','ã…¦'=>'á„•','ᇆ'=>'á„•','ᇊ'=>'á„—','á‡'=>'ᄘ','á‡'=>'á„™','ã…€'=>'á„š','ï¾°'=>'á„š','á„»'=>'á„š','ᆶ'=>'á„š','ã…®'=>'á„œ','ᇜ'=>'á„œ','ã…±'=>'á„','ᇢ'=>'á„','ã…²'=>'á„ž','ã…³'=>'á„ ','ã…„'=>'á„¡','ï¾´'=>'á„¡','ᆹ'=>'á„¡','ã…´'=>'á„¢','ã…µ'=>'á„£','ã…¶'=>'ᄧ','ã…·'=>'á„©','ã…¸'=>'á„«','ᇦ'=>'á„«','ã…¹'=>'ᄬ','ã…º'=>'á„­','ᇧ'=>'á„­','ã…»'=>'á„®','ã…¼'=>'ᄯ','ᇨ'=>'ᄯ','ᇩ'=>'á„°','ã…½'=>'ᄲ','ᇪ'=>'ᄲ','ã…¾'=>'ᄶ','ã…¿'=>'á…€','ᇫ'=>'á…€','ᇬ'=>'á…','ᇱ'=>'á……','ㆂ'=>'á……','ᇲ'=>'á…†','ㆃ'=>'á…†','ㆀ'=>'á…‡','ᇮ'=>'á…‡','ã†'=>'á…Œ','ᇰ'=>'á…Œ','ᇳ'=>'á…–','ㆄ'=>'á…—','ᇴ'=>'á…—','ㆅ'=>'á…˜','ㆆ'=>'á…™','ᇹ'=>'á…™','ã…¤'=>'á… ','ï¾ '=>'á… ','ã…'=>'á…¡','ï¿‚'=>'á…¡','ã…'=>'á…¢','ᅢ'=>'á…¢','ã…‘'=>'á…£','ï¿„'=>'á…£','ã…’'=>'á…¤','ï¿…'=>'á…¤','ã…“'=>'á…¥','ᅥ'=>'á…¥','ã…”'=>'á…¦','ᅦ'=>'á…¦','ã…•'=>'á…§','ï¿Š'=>'á…§','ã…–'=>'á…¨','ï¿‹'=>'á…¨','ã…—'=>'á…©','ï¿Œ'=>'á…©','ã…˜'=>'á…ª','ï¿'=>'á…ª','ã…™'=>'á…«','ï¿Ž'=>'á…«','ã…š'=>'á…¬','ï¿'=>'á…¬','ã…›'=>'á…­','ï¿’'=>'á…­','ã…œ'=>'á…®','ï¿“'=>'á…®','ã…'=>'á…¯','ï¿”'=>'á…¯','ã…ž'=>'á…°','ï¿•'=>'á…°','ã…Ÿ'=>'á…±','ï¿–'=>'á…±','ã… '=>'á…²','ï¿—'=>'á…²','ã…¡'=>'一','ï¿š'=>'一','ã…¢'=>'á…´','ï¿›'=>'á…´','ã…£'=>'丨','ï¿œ'=>'丨','ㆇ'=>'ᆄ','ᆆ'=>'ᆄ','ㆈ'=>'ᆅ','ㆉ'=>'ᆈ','ㆊ'=>'ᆑ','ㆋ'=>'ᆒ','ㆌ'=>'ᆔ','ã†'=>'ᆞ','ㆎ'=>'ᆡ','ㄳ'=>'ᆪ','ï¾£'=>'ᆪ','ㄵ'=>'ᆬ','ï¾¥'=>'ᆬ','ㄶ'=>'ᆭ','ᆭ'=>'ᆭ','ㄺ'=>'ᆰ','ᆰ'=>'ᆰ','ã„»'=>'ᆱ','ᆱ'=>'ᆱ','ㄼ'=>'ᆲ','ᆲ'=>'ᆲ','ㄽ'=>'ᆳ','ï¾­'=>'ᆳ','ㄾ'=>'ᆴ','ï¾®'=>'ᆴ','ã„¿'=>'ᆵ','ᆵ'=>'ᆵ','ã…§'=>'ᇇ','ã…¨'=>'ᇈ','ã…©'=>'ᇌ','ã…ª'=>'ᇎ','ã…«'=>'ᇓ','ã…¬'=>'ᇗ','ã…­'=>'ᇙ','ã…¯'=>'á‡','ã…°'=>'ᇟ','ァ'=>'ã‚¡','ï½±'=>'ã‚¢','ィ'=>'ã‚£','ï½²'=>'イ','ゥ'=>'ã‚¥','ï½³'=>'ウ','ェ'=>'ェ','ï½´'=>'エ','ォ'=>'ã‚©','ï½µ'=>'オ','カ'=>'ã‚«','ï½·'=>'ã‚­','ク'=>'ク','ï½¹'=>'ケ','コ'=>'コ','ï½»'=>'サ','ï½¼'=>'ã‚·','ï½½'=>'ス','ï½¾'=>'ã‚»','ソ'=>'ソ','ï¾€'=>'ã‚¿','ï¾'=>'ãƒ','ッ'=>'ッ','ツ'=>'ツ','テ'=>'テ','ト'=>'ト','ï¾…'=>'ナ','ニ'=>'ニ','ヌ'=>'ヌ','ネ'=>'ãƒ','ノ'=>'ノ','ハ'=>'ãƒ','ヒ'=>'ヒ','フ'=>'フ','ï¾'=>'ã¸','ホ'=>'ホ','ï¾'=>'マ','⧄'=>'〼','ï¾'=>'ミ','ム'=>'ム','ï¾’'=>'メ','モ'=>'モ','ャ'=>'ャ','ï¾”'=>'ヤ','ï½­'=>'ュ','ユ'=>'ユ','ï½®'=>'ョ','ï¾–'=>'ヨ','ï¾—'=>'ラ','リ'=>'リ','ï¾™'=>'ル','レ'=>'レ','ï¾›'=>'ロ','ワ'=>'ワ','ヲ'=>'ヲ','ï¾'=>'ン','ê’ž'=>'êŠ','ê’¬'=>'ê','ê’œ'=>'ꃀ','ê’¿'=>'ꉙ','ê’¾'=>'ꊱ','ê“€'=>'ꎫ','ê“‚'=>'ꎵ','ê’º'=>'ꎿ','ê’°'=>'ê‚','ð’ '=>'ð’†','—'=>'一','―'=>'一','−'=>'一','─'=>'一','â¼€'=>'一','不'=>'ä¸','ï©°'=>'並','|'=>'丨','|'=>'丨','∣'=>'丨','â¼'=>'丨','‖'=>'丨丨','∥'=>'丨丨','串'=>'串','⼂'=>'丶','ð¯ '=>'丸','丹'=>'丹','丽'=>'丽','⼃'=>'丿','乁'=>'ä¹','⼄'=>'ä¹™','亂'=>'亂','â¼…'=>'亅','了'=>'了','⼆'=>'二','⼇'=>'亠','亮'=>'亮','⼈'=>'人','什'=>'什','仌'=>'仌','令'=>'令','你'=>'ä½ ','倂'=>'ä½µ','倂'=>'ä½µ','侀'=>'ä¾€','來'=>'來','例'=>'例','侮'=>'ä¾®','侮'=>'ä¾®','侻'=>'ä¾»','便'=>'便','值'=>'値','倫'=>'倫','偺'=>'åº','備'=>'å‚™','像'=>'åƒ','僚'=>'僚','僧'=>'僧','僧'=>'僧','⼉'=>'å„¿','兀'=>'å…€','ï©´'=>'å……','免'=>'å…','免'=>'å…','ð¯ '=>'å…”','ð¯ '=>'å…¤','⼊'=>'å…¥','內'=>'å…§','全'=>'å…¨','兩'=>'å…©','⼋'=>'å…«','六'=>'å…­','具'=>'å…·','冀'=>'冀','⼌'=>'冂','再'=>'å†','冒'=>'冒','冕'=>'冕','â¼'=>'冖','冗'=>'冗','冤'=>'冤','⼎'=>'冫','冬'=>'冬','况'=>'况','况'=>'况','冷'=>'冷','凉'=>'凉','凌'=>'凌','凜'=>'凜','凞'=>'凞','â¼'=>'几','ð¯ '=>'凵','â¼'=>'凵','⼑'=>'刀','刃'=>'刃','切'=>'切','ð¯¡'=>'切','列'=>'列','ï§'=>'利','刺'=>'刺','刻'=>'刻','剆'=>'剆','割'=>'割','剷'=>'剷','劉'=>'劉','力'=>'力','â¼’'=>'力','ï¦'=>'劣','劳'=>'劳','勇'=>'勇','勇'=>'勇','勉'=>'勉','勉'=>'勉','勒'=>'å‹’','勞'=>'å‹ž','勤'=>'勤','勤'=>'勤','勵'=>'勵','⼓'=>'勹','ï©·'=>'勺','勺'=>'勺','包'=>'包','匆'=>'匆','â¼”'=>'匕','北'=>'北','北'=>'北','⼕'=>'匚','â¼–'=>'匸','匿'=>'匿','â¼—'=>'å','〸'=>'å','〹'=>'å„','〺'=>'å…','卉'=>'å‰','卑'=>'å‘','卑'=>'å‘','博'=>'åš','⼘'=>'åœ','â¼™'=>'å©','即'=>'å³','卵'=>'åµ','卽'=>'å½','卿'=>'å¿','卿'=>'å¿','卿'=>'å¿','⼚'=>'厂','â¼›'=>'厶','參'=>'åƒ','⼜'=>'åˆ','及'=>'åŠ','叟'=>'åŸ','â¼'=>'å£','句'=>'å¥','叫'=>'å«','叱'=>'å±','吆'=>'å†','吏'=>'å','吝'=>'å','吸'=>'å¸','呂'=>'å‘‚','呈'=>'呈','周'=>'周','咞'=>'å’ž','咢'=>'å’¢','咽'=>'å’½','ð¯¡'=>'哶','唐'=>'å”','啓'=>'å•“','å•Ÿ'=>'å•“','啕'=>'å••','啣'=>'å•£','善'=>'å–„','善'=>'å–„','喇'=>'å–‡','喙'=>'å–™','喙'=>'å–™','喝'=>'å–','喝'=>'å–','喫'=>'å–«','喳'=>'å–³','ï¨'=>'å—€','嗂'=>'å—‚','ï©»'=>'å—¢','嘆'=>'嘆','嘆'=>'嘆','噑'=>'噑','器'=>'器','ð¯¡'=>'å™´','⼞'=>'å›—','囹'=>'囹','圖'=>'圖','ð¯¡'=>'圗','⼟'=>'土','型'=>'åž‹','城'=>'城','埴'=>'埴','堍'=>'å ','報'=>'å ±','堲'=>'å ²','塀'=>'å¡€','ï¨'=>'å¡š','塚'=>'å¡š','塞'=>'å¡ž','å¡«'=>'å¡¡','墨'=>'墨','壿'=>'墫','墬'=>'墬','墳'=>'墳','壘'=>'壘','壟'=>'壟','â¼ '=>'士','壮'=>'壮','売'=>'売','壷'=>'壷','⼡'=>'夂','夆'=>'夆','â¼¢'=>'夊','â¼£'=>'夕','ð¯¡'=>'多','夢'=>'夢','⼤'=>'大','奄'=>'奄','奈'=>'奈','契'=>'契','ï©¿'=>'奔','奢'=>'奢','ï¦'=>'女','â¼¥'=>'女','姘'=>'姘','姬'=>'姬','娛'=>'娛','娧'=>'娧','婢'=>'å©¢','婦'=>'婦','嬀'=>'媯','媵'=>'媵','嬈'=>'嬈','ïª'=>'嬨','嬾'=>'嬾','嬾'=>'嬾','⼦'=>'å­','⼧'=>'宀','宅'=>'å®…','寃'=>'寃','寘'=>'寘','寧'=>'寧','寧'=>'寧','寧'=>'寧','寮'=>'寮','寳'=>'寳','⼨'=>'寸','寿'=>'寿','将'=>'å°†','⼩'=>'å°','尢'=>'å°¢','⼪'=>'å°¢','⼫'=>'å°¸','尿'=>'å°¿','屠'=>'å± ','屢'=>'å±¢','層'=>'層','履'=>'å±¥','屮'=>'å±®','屮'=>'å±®','⼬'=>'å±®','â¼­'=>'å±±','岍'=>'å²','峀'=>'å³€','崙'=>'å´™','嵃'=>'嵃','嵐'=>'åµ','嵫'=>'嵫','嵮'=>'åµ®','嵼'=>'åµ¼','嶲'=>'嶲','嶺'=>'嶺','â¼®'=>'å·›','ð¯¢'=>'å·¡','巢'=>'å·¢','⼯'=>'å·¥','â¼°'=>'å·±','巽'=>'å·½','â¼±'=>'å·¾','帲'=>'帡','帨'=>'帨','帽'=>'帽','幩'=>'幩','â¼²'=>'å¹²','年'=>'å¹´','â¼³'=>'幺','â¼´'=>'广','ï¨'=>'度','庰'=>'庰','庳'=>'庳','ð¯¢'=>'庶','廉'=>'廉','廊'=>'廊','廊'=>'廊','廒'=>'å»’','廓'=>'廓','廙'=>'å»™','廬'=>'廬','â¼µ'=>'å»´','ð¯¢'=>'廾','⼶'=>'廾','弄'=>'弄','â¼·'=>'弋','⼸'=>'弓','弢'=>'å¼¢','弢'=>'å¼¢','â¼¹'=>'å½','当'=>'当','⼺'=>'彡','形'=>'å½¢','彩'=>'彩','彫'=>'彫','â¼»'=>'å½³','律'=>'律','徚'=>'徚','復'=>'復','徭'=>'å¾­','â¼¼'=>'心','ð¯¢'=>'å¿','志'=>'å¿—','念'=>'念','忹'=>'忹','怒'=>'怒','怜'=>'怜','悁'=>'æ‚','悔'=>'æ‚”','悔'=>'æ‚”','惇'=>'惇','惘'=>'惘','惡'=>'惡','愈'=>'愈','慄'=>'æ…„','慈'=>'æ…ˆ','慌'=>'æ…Œ','慌'=>'æ…Œ','慎'=>'æ…Ž','慎'=>'æ…Ž','慠'=>'æ… ','慨'=>'æ…¨','慺'=>'æ…º','憎'=>'憎','憎'=>'憎','憎'=>'憎','ï¦'=>'æ†','憤'=>'憤','憯'=>'憯','憲'=>'憲','懞'=>'懞','ï©€'=>'懲','懲'=>'懲','懲'=>'懲','ï¤'=>'懶','懶'=>'懶','ï¦'=>'戀','â¼½'=>'戈','成'=>'æˆ','戛'=>'戛','戮'=>'戮','戴'=>'戴','â¼¾'=>'戶','⼿'=>'手','扝'=>'æ‰','抱'=>'抱','拉'=>'拉','拏'=>'æ‹','拓'=>'æ‹“','拔'=>'æ‹”','拼'=>'拼','拾'=>'拾','挽'=>'挽','捐'=>'æ','捨'=>'æ¨','捻'=>'æ»','掃'=>'掃','掠'=>'掠','ð¯£'=>'掩','ïª'=>'æ„','揅'=>'æ…','揤'=>'æ¤','ã©'=>'æ‰','搜'=>'æœ','搢'=>'æ¢','ïª'=>'æ‘’','摩'=>'æ‘©','摷'=>'æ‘·','摾'=>'摾','撚'=>'æ’š','撝'=>'æ’','擄'=>'æ“„','â½€'=>'支','â½'=>'æ”´','ï©'=>'æ•','敏'=>'æ•','ïª'=>'æ•–','敬'=>'敬','數'=>'數','⽂'=>'æ–‡','⽃'=>'æ–—','料'=>'æ–™','⽄'=>'æ–¤','â½…'=>'æ–¹','旅'=>'æ—…','⽆'=>'æ— ','ï©‚'=>'æ—¢','旣'=>'æ—£','⽇'=>'æ—¥','易'=>'易','ð¯£'=>'晉','晩'=>'晚','䀿'=>'晣','晴'=>'æ™´','晴'=>'æ™´','暈'=>'暈','暑'=>'æš‘','ð¯£'=>'æš‘','暜'=>'æšœ','暴'=>'æš´','曆'=>'曆','⽈'=>'æ›°','ï¤'=>'æ›´','ã«š'=>'曶','書'=>'書','最'=>'最','⽉'=>'月','肦'=>'朌','èƒ'=>'æœ','胊'=>'æœ','è„'=>'朓','朗'=>'朗','朗'=>'朗','朗'=>'朗','脧'=>'朘','望'=>'望','望'=>'望','朡'=>'朡','膧'=>'朣','⽊'=>'木','李'=>'æŽ','杓'=>'æ“','杖'=>'æ–','杞'=>'æž','柿'=>'æ®','杻'=>'æ»','枅'=>'æž…','林'=>'æž—','柳'=>'柳','柺'=>'柺','栗'=>'æ —','栟'=>'æ Ÿ','桒'=>'æ¡’','梁'=>'æ¢','ï©„'=>'梅','梅'=>'梅','梎'=>'梎','梨'=>'梨','椔'=>'椔','楂'=>'楂','樧'=>'æ¦','榣'=>'榣','槪'=>'槪','樂'=>'樂','樂'=>'樂','樂'=>'樂','樓'=>'樓','檨'=>'檨','櫓'=>'æ«“','櫛'=>'æ«›','ï¤'=>'欄','⽋'=>'欠','次'=>'次','歔'=>'æ­”','⽌'=>'æ­¢','歲'=>'æ­²','歷'=>'æ­·','歹'=>'æ­¹','â½'=>'æ­¹','殟'=>'殟','殮'=>'æ®®','⽎'=>'殳','殺'=>'殺','殺'=>'殺','殺'=>'殺','殻'=>'æ®»','â½'=>'毋','⺟'=>'æ¯','â½'=>'比','⽑'=>'毛','â½’'=>'æ°','⽓'=>'æ°”','â½”'=>'æ°´','汎'=>'汎','汧'=>'汧','沈'=>'沈','沿'=>'沿','泌'=>'泌','泍'=>'æ³','泥'=>'æ³¥','洖'=>'æ´–','洛'=>'æ´›','洞'=>'æ´ž','洴'=>'æ´´','派'=>'æ´¾','流'=>'æµ','流'=>'æµ','流'=>'æµ','浩'=>'浩','浪'=>'浪','ï©…'=>'æµ·','ð¯¤'=>'æµ·','浸'=>'浸','涅'=>'涅','淋'=>'æ·‹','ï¥'=>'æ·š','淪'=>'æ·ª','淹'=>'æ·¹','渚'=>'渚','港'=>'港','湮'=>'æ¹®','æ½™'=>'溈','溜'=>'溜','溺'=>'溺','滇'=>'滇','滋'=>'滋','滋'=>'滋','滑'=>'滑','滛'=>'æ»›','漏'=>'æ¼','漢'=>'æ¼¢','漢'=>'æ¼¢','漣'=>'æ¼£','ð¯¤'=>'æ½®','濆'=>'濆','濫'=>'æ¿«','濾'=>'濾','瀛'=>'瀛','瀞'=>'瀞','瀞'=>'瀞','瀹'=>'瀹','灊'=>'çŠ','⽕'=>'ç«','灰'=>'ç°','灷'=>'ç·','災'=>'ç½','炙'=>'ç‚™','炭'=>'ç‚­','烈'=>'烈','烙'=>'烙','煅'=>'ç……','煉'=>'ç…‰','煮'=>'ç…®','煮'=>'ç…®','熜'=>'熜','燎'=>'燎','燐'=>'ç‡','爐'=>'çˆ','爛'=>'爛','爨'=>'爨','â½–'=>'爪','爫'=>'爫','⺤'=>'爫','爵'=>'爵','爵'=>'爵','â½—'=>'父','⽘'=>'爻','â½™'=>'爿','⽚'=>'片','牐'=>'ç‰','â½›'=>'牙','⽜'=>'牛','牢'=>'牢','犀'=>'犀','犕'=>'犕','â½'=>'犬','犯'=>'犯','狀'=>'ç‹€','狼'=>'狼','猪'=>'猪','猪'=>'猪','獵'=>'çµ','獺'=>'çº','⽞'=>'玄','率'=>'率','率'=>'率','⽟'=>'玉','王'=>'王','玥'=>'玥','玲'=>'玲','珞'=>'çž','理'=>'ç†','琉'=>'ç‰','ï©Š'=>'ç¢','瑇'=>'瑇','瑜'=>'ç‘œ','瑩'=>'ç‘©','瑱'=>'瑱','瑱'=>'瑱','璅'=>'ç’…','璉'=>'ç’‰','璘'=>'ç’˜','瓊'=>'ç“Š','â½ '=>'ç“œ','⽡'=>'瓦','甆'=>'甆','â½¢'=>'甘','â½£'=>'生','甤'=>'甤','⽤'=>'用','â½¥'=>'ç”°','画'=>'ç”»','甾'=>'甾','ï§'=>'ç•™','略'=>'ç•¥','異'=>'ç•°','異'=>'ç•°','⽦'=>'ç–‹','⽧'=>'ç–’','痢'=>'ç—¢','瘐'=>'ç˜','瘝'=>'ç˜','瘟'=>'瘟','ï§'=>'療','癩'=>'癩','⽨'=>'癶','⽩'=>'白','⽪'=>'çš®','⽫'=>'çš¿','益'=>'益','益'=>'益','盛'=>'ç››','盧'=>'盧','⽬'=>'ç›®','直'=>'ç›´','直'=>'ç›´','省'=>'çœ','眞'=>'眞','真'=>'真','真'=>'真','着'=>'ç€','睊'=>'çŠ','睊'=>'çŠ','瞋'=>'çž‹','ïª'=>'瞧','â½­'=>'矛','â½®'=>'矢','⽯'=>'石','ç¡'=>'ç ”','硎'=>'ç¡Ž','硫'=>'ç¡«','碌'=>'碌','ð¯¥'=>'碌','ï©‹'=>'碑','磊'=>'磊','磌'=>'磌','ð¯¥'=>'磌','磻'=>'磻','礪'=>'礪','â½°'=>'示','礼'=>'礼','ï©Œ'=>'社','ï©Ž'=>'祈','ï©'=>'祉','ï©'=>'ç¥','ï©'=>'祖','祖'=>'祖','ï©‘'=>'ç¥','神'=>'神','祥'=>'祥','祿'=>'祿','ï©’'=>'ç¦','ï©“'=>'禎','福'=>'ç¦','福'=>'ç¦','禮'=>'禮','â½±'=>'禸','â½²'=>'禾','秊'=>'秊','秫'=>'秫','稜'=>'稜','ï©”'=>'ç©€','穀'=>'ç©€','穊'=>'ç©Š','穏'=>'ç©','â½³'=>'ç©´','ï©•'=>'çª','窱'=>'窱','立'=>'ç«‹','â½´'=>'ç«‹','竮'=>'ç«®','â½µ'=>'竹','笠'=>'笠','ï©–'=>'節','節'=>'節','篆'=>'篆','築'=>'築','簾'=>'ç°¾','籠'=>'ç± ','⽶'=>'ç±³','类'=>'ç±»','粒'=>'ç²’','ï¨'=>'ç²¾','糒'=>'ç³’','糖'=>'ç³–','糣'=>'ç³£','糧'=>'糧','糨'=>'糨','â½·'=>'糸','紀'=>'ç´€','ï§'=>'ç´','索'=>'ç´¢','ï¥'=>'ç´¯','絶'=>'絕','絛'=>'çµ›','絣'=>'çµ£','綠'=>'綠','綾'=>'綾','緇'=>'ç·‡','練'=>'ç·´','ï©—'=>'ç·´','練'=>'ç·´','縂'=>'縂','縉'=>'縉','ï¥'=>'縷','ï©™'=>'ç¹','繅'=>'ç¹…','⽸'=>'缶','缾'=>'ç¼¾','â½¹'=>'网','⺫'=>'ç½’','ï©š'=>'ç½²','罹'=>'ç½¹','罺'=>'罺','ï¤'=>'ç¾…','⽺'=>'羊','羕'=>'羕','羚'=>'羚','羽'=>'ç¾½','â½»'=>'ç¾½','翺'=>'翺','老'=>'è€','â½¼'=>'è€','ï©›'=>'者','者'=>'者','者'=>'者','â½½'=>'而','â½¾'=>'耒','⽿'=>'耳','聆'=>'è†','聠'=>'è ','聯'=>'è¯','聰'=>'è°','聾'=>'è¾','â¾€'=>'è¿','â¾'=>'肉','肋'=>'è‚‹','肭'=>'è‚­','育'=>'育','㬵'=>'胶','è…'=>'胼','脃'=>'脃','脾'=>'脾','臘'=>'臘','⾂'=>'臣','臨'=>'臨','⾃'=>'自','ï©œ'=>'臭','⾄'=>'至','â¾…'=>'臼','舁'=>'èˆ','舁'=>'èˆ','舄'=>'舄','⾆'=>'舌','⾇'=>'舛','⾈'=>'舟','⾉'=>'艮','良'=>'良','⾊'=>'色','⾋'=>'艸','ï©'=>'艹','ï©ž'=>'艹','ð¯¦'=>'芋','ð¯¦'=>'芑','芝'=>'èŠ','花'=>'花','芳'=>'芳','芽'=>'芽','若'=>'è‹¥','若'=>'è‹¥','苦'=>'苦','茝'=>'èŒ','茣'=>'茣','茶'=>'茶','荒'=>'è’','荓'=>'è“','荣'=>'è£','莭'=>'莭','ð¯¦'=>'莽','菉'=>'è‰','菊'=>'èŠ','菌'=>'èŒ','菜'=>'èœ','菧'=>'è§','華'=>'è¯','菱'=>'è±','落'=>'è½','葉'=>'葉','ï©Ÿ'=>'è‘—','著'=>'è‘—','蔿'=>'è’','蓮'=>'è“®','蓱'=>'蓱','蓳'=>'蓳','蓼'=>'蓼','蔖'=>'è”–','蕤'=>'蕤','藍'=>'è—','藺'=>'è—º','蘆'=>'蘆','蘒'=>'蘒','蘭'=>'蘭','è™'=>'蘷','ï¤'=>'蘿','⾌'=>'è™','虐'=>'è™','虜'=>'虜','虜'=>'虜','虧'=>'虧','虩'=>'虩','â¾'=>'虫','蚈'=>'蚈','蚩'=>'èš©','蛢'=>'蛢','蜎'=>'蜎','蜨'=>'蜨','蝫'=>'è«','蝹'=>'è¹','蝹'=>'è¹','螆'=>'螆','螺'=>'螺','蟡'=>'蟡','ð¯§'=>'è ','蠟'=>'è Ÿ','⾎'=>'è¡€','行'=>'è¡Œ','â¾'=>'è¡Œ','衠'=>'è¡ ','衣'=>'è¡£','â¾'=>'è¡£','裂'=>'裂','裏'=>'è£','裗'=>'裗','裞'=>'裞','裡'=>'裡','裸'=>'裸','裺'=>'裺','ï© '=>'è¤','襁'=>'è¥','襤'=>'襤','⾑'=>'襾','覆'=>'覆','見'=>'見','â¾’'=>'見','ï©¡'=>'視','視'=>'視','⾓'=>'角','â¾”'=>'言','䚶'=>'訞','詽'=>'訮','ð¯§'=>'誠','說'=>'說','說'=>'說','調'=>'調','請'=>'è«‹','諒'=>'è«’','ï¥'=>'è«–','諭'=>'è«­','ð¯§'=>'è«­','諸'=>'諸','諸'=>'諸','ï¥'=>'諾','諾'=>'諾','ï©¢'=>'è¬','謁'=>'è¬','ï©£'=>'謹','謹'=>'謹','識'=>'è­˜','讀'=>'讀','è®'=>'讆','ï«€'=>'變','變'=>'變','⾕'=>'è°·','â¾–'=>'豆','豈'=>'豈','豕'=>'豕','â¾—'=>'豕','⾘'=>'豸','â¾™'=>'è²','貫'=>'貫','賁'=>'è³','賂'=>'賂','賈'=>'賈','賓'=>'賓','ï©¥'=>'è´ˆ','ï«'=>'è´ˆ','贛'=>'è´›','⾚'=>'赤','â¾›'=>'èµ°','起'=>'èµ·','趆'=>'赿','⾜'=>'足','趼'=>'趼','跋'=>'è·‹','è·º'=>'è·¥','路'=>'è·¯','跰'=>'è·°','躛'=>'躗','â¾'=>'身','車'=>'車','⾞'=>'車','軔'=>'è»”','輧'=>'軿','輦'=>'輦','輪'=>'輪','ï«‚'=>'輸','輸'=>'輸','輻'=>'è¼»','ï¦'=>'è½¢','⾟'=>'è¾›','ð¯¦'=>'辞','辰'=>'è¾°','â¾ '=>'è¾°','⾡'=>'è¾µ','辶'=>'辶','⻌'=>'辶','連'=>'連','逸'=>'逸','逸'=>'逸','遲'=>'é²','遼'=>'é¼','邏'=>'é‚','â¾¢'=>'é‚‘','邔'=>'é‚”','郎'=>'郎','郱'=>'郱','都'=>'都','鄑'=>'é„‘','鄛'=>'é„›','â¾£'=>'é…‰','酪'=>'é…ª','ï«„'=>'醙','醴'=>'醴','⾤'=>'釆','里'=>'里','â¾¥'=>'里','量'=>'é‡','金'=>'金','⾦'=>'金','鈴'=>'鈴','鈸'=>'鈸','ï«…'=>'鉶','鉼'=>'鉼','鋗'=>'é‹—','鋘'=>'鋘','錄'=>'錄','鍊'=>'éŠ','鎮'=>'鎭','鏹'=>'é¹','鐕'=>'é•','⾧'=>'é•·','⾨'=>'é–€','開'=>'é–‹','閭'=>'é–­','閷'=>'é–·','⾩'=>'阜','阮'=>'阮','陋'=>'陋','降'=>'é™','陵'=>'陵','陸'=>'陸','陼'=>'陼','隆'=>'隆','隣'=>'隣','⾪'=>'隶','隸'=>'隸','⾫'=>'éš¹','雃'=>'雃','離'=>'離','難'=>'難','難'=>'難','⾬'=>'雨','零'=>'零','雷'=>'é›·','霣'=>'霣','露'=>'露','靈'=>'éˆ','â¾­'=>'é‘','靖'=>'é–','靖'=>'é–','â¾®'=>'éž','⾯'=>'é¢','â¾°'=>'é©','â¾±'=>'韋','韛'=>'韛','韠'=>'韠','â¾²'=>'韭','â¾³'=>'音','ï©©'=>'響','ï«Š'=>'響','â¾´'=>'é ','ï«‹'=>'é ‹','頋'=>'é ‹','頋'=>'é ‹','領'=>'é ˜','頩'=>'é ©','頻'=>'é »','ï«Œ'=>'é »','ï§'=>'é¡ž','â¾µ'=>'風','⾶'=>'飛','â»'=>'食','â¾·'=>'食','飢'=>'飢','飯'=>'飯','飼'=>'飼','館'=>'館','餩'=>'餩','⾸'=>'首','â¾¹'=>'香','馧'=>'馧','⾺'=>'馬','駂'=>'駂','駱'=>'駱','駾'=>'駾','驪'=>'驪','â¾»'=>'骨','â¾¼'=>'高','â¾½'=>'é«Ÿ','ï«'=>'鬒','鬒'=>'鬒','â¾¾'=>'鬥','⾿'=>'鬯','â¿€'=>'鬲','â¿'=>'鬼','â¿‚'=>'é­š','魯'=>'é­¯','鱀'=>'é±€','鱗'=>'é±—','⿃'=>'é³¥','鳽'=>'é³½','ð¯¨'=>'鵧','鶴'=>'鶴','鷺'=>'é·º','鸞'=>'鸞','鹃'=>'鹂','â¿„'=>'é¹µ','鹿'=>'鹿','â¿…'=>'鹿','麗'=>'麗','麟'=>'麟','⿆'=>'麥','麻'=>'麻','⿇'=>'麻','⿈'=>'黃','⿉'=>'é»','黎'=>'黎','â¿Š'=>'黑','黹'=>'黹','â¿‹'=>'黹','â¿Œ'=>'黽','黾'=>'黾','鼅'=>'é¼…','â¿'=>'鼎','鼏'=>'é¼','â¿Ž'=>'鼓','鼖'=>'é¼–','â¿'=>'é¼ ','鼻'=>'é¼»','â¿'=>'é¼»','齃'=>'齃','â¿‘'=>'齊','â¿’'=>'é½’','龍'=>'é¾','â¿“'=>'é¾','ï«™'=>'龎','龜'=>'龜','龜'=>'龜','ï«Ž'=>'龜','â¿”'=>'龜','⻳'=>'龟','â¿•'=>'é¾ ','㒞'=>'ã’ž','㒹'=>'ã’¹','㒻'=>'ã’»','㓟'=>'ã“Ÿ','㔕'=>'㔕','䎛'=>'ã–ˆ','㛮'=>'ã›®','㛼'=>'㛼','㞁'=>'ãž','㠯'=>'ã ¯','㡢'=>'ã¡¢','㡼'=>'㡼','㣇'=>'㣇','㣣'=>'㣣','㤜'=>'㤜','㤺'=>'㤺','㨮'=>'㨮','㩬'=>'㩬','㫤'=>'㫤','ð¯£'=>'㬈','㬙'=>'㬙','ä '=>'㬻','㭉'=>'ã­‰','ï«’'=>'ã®','㮝'=>'ã®','㰘'=>'ã°˜','㱎'=>'㱎','㴳'=>'ã´³','㶖'=>'㶖','㺬'=>'㺬','㺸'=>'㺸','㺸'=>'㺸','㼛'=>'ã¼›','㿼'=>'㿼','䀈'=>'䀈','ï«“'=>'䀘','ï«”'=>'䀹','䀹'=>'䀹','䁆'=>'ä†','䂖'=>'ä‚–','䃣'=>'䃣','䄯'=>'䄯','䈂'=>'䈂','䈧'=>'䈧','䊠'=>'䊠','䌁'=>'äŒ','䌴'=>'䌴','䍙'=>'ä™','ð¯¦'=>'ä•','䏙'=>'ä™','䐋'=>'ä‹','䑫'=>'ä‘«','䔫'=>'䔫','䕝'=>'ä•','䕡'=>'ä•¡','䕫'=>'ä•«','䗗'=>'ä——','䗹'=>'ä—¹','䘵'=>'䘵','ð¯§'=>'äš¾','䛇'=>'䛇','䦕'=>'䦕','䧦'=>'䧦','䩮'=>'ä©®','䩶'=>'䩶','䪲'=>'䪲','䬳'=>'䬳','䯎'=>'䯎','ð¯¨'=>'䳎','䳭'=>'ä³­','䳸'=>'䳸','䵖'=>'äµ–','𠄢'=>'ð „¢','𠔜'=>'𠔜','𠔥'=>'𠔥','𠕋'=>'ð •‹','ð¯ '=>'𠘺','𠠄'=>'ð  „','ð¯§'=>'𠣞','𠨬'=>'𠨬','𠭣'=>'ð ­£','𡓤'=>'𡓤','𡚨'=>'𡚨','𡛪'=>'𡛪','𡧈'=>'𡧈','𡬘'=>'𡬘','𡴋'=>'ð¡´‹','𡷤'=>'ð¡·¤','𡷦'=>'ð¡·¦','𢆃'=>'𢆃','𢆟'=>'𢆟','𢌱'=>'𢌱','𢌱'=>'𢌱','𢛔'=>'𢛔','ï«'=>'𢡄','ï«'=>'𢡊','𢬌'=>'𢬌','𢯱'=>'𢯱','𣀊'=>'𣀊','𣊸'=>'𣊸','𣍟'=>'ð£Ÿ','𣎓'=>'𣎓','𣎜'=>'𣎜','ð¯£'=>'ð£ƒ','ï«‘'=>'ð£•','𣑭'=>'𣑭','𣚣'=>'𣚣','𣢧'=>'𣢧','𣪍'=>'ð£ª','𣫺'=>'𣫺','𣲼'=>'𣲼','𣴞'=>'𣴞','ð¯¤'=>'𣻑','ð¯¤'=>'𣽞','𣾎'=>'𣾎','ð¯¤'=>'𤉣','𤎫'=>'𤎫','𤘈'=>'𤘈','𤜵'=>'𤜵','𤠔'=>'𤠔','𤰶'=>'𤰶','𤲒'=>'𤲒','𤾡'=>'𤾡','𤾸'=>'𤾸','𥁄'=>'ð¥„','𥃲'=>'𥃲','ð¯¥'=>'𥃳','𥄙'=>'𥄙','𥄳'=>'𥄳','ï«•'=>'𥉉','ð¯¥'=>'ð¥','𥘦'=>'𥘦','𥚚'=>'𥚚','𥛅'=>'𥛅','𥥼'=>'𥥼','ð¯¥'=>'𥪧','𥪧'=>'𥪧','𥮫'=>'𥮫','𥲀'=>'𥲀','ï«–'=>'ð¥³','𥾆'=>'𥾆','𦇚'=>'𦇚','𦈨'=>'𦈨','𦉇'=>'𦉇','𦋙'=>'𦋙','𦌾'=>'𦌾','𦓚'=>'𦓚','𦔣'=>'𦔣','𦖨'=>'𦖨','𦞧'=>'𦞧','𦞵'=>'𦞵','𦬼'=>'𦬼','𦰶'=>'𦰶','𦳕'=>'𦳕','𦵫'=>'𦵫','𦼬'=>'𦼬','𦾱'=>'𦾱','𧃒'=>'𧃒','𧏊'=>'ð§Š','𧙧'=>'𧙧','𧢮'=>'𧢮','𧥦'=>'𧥦','𧲨'=>'𧲨','ï«—'=>'𧻓','𧼯'=>'𧼯','𨗒'=>'𨗒','𨗭'=>'𨗭','𨜮'=>'𨜮','𨯺'=>'𨯺','𨵷'=>'𨵷','𩅅'=>'ð©……','𩇟'=>'𩇟','𩈚'=>'𩈚','𩐊'=>'ð©Š','𩒖'=>'ð©’–','ð¯¨'=>'ð©–¶','𩬰'=>'𩬰','ð¯¨'=>'𪃎','𪄅'=>'𪄅','𪈎'=>'𪈎','𪊑'=>'𪊑','ð¯¢'=>'𪎒','ð¯¨'=>'𪘀','℃'=>'°C','℉'=>'°F','ℇ'=>'Æ','â„»'=>'FAX','â„•'=>'N','â„–'=>'No','â„š'=>'Q','₨'=>'Rs','ð“'=>'T','â„¡'=>'TEL','ð”'=>'U','ð–'=>'W','â‚©'=>'W̵','ð—'=>'X','Â¥'=>'Y̵','ðš²'=>'Λ','ðšµ'=>'Ξ','â„¿'=>'Π','ϲ'=>'c','Ï’'=>'Y','ðš½'=>'Φ','ðš¿'=>'Ψ','Ñ£'=>'Ь̵','ਃ'=>'ঃ','ಃ'=>'à°ƒ','່'=>'่','់'=>'่','້'=>'้','໊'=>'๊','໋'=>'๋','៕'=>'๚','៚'=>'๛','ÑŠ'=>'ˉb','៙'=>'à¹','೧'=>'౧','૨'=>'२','೨'=>'౨','à«©'=>'३','૪'=>'४','à«®'=>'८','೯'=>'౯','а'=>'a','á'=>'b','á–¯'=>'b','Ñ'=>'c','Ô'=>'d','ᑯ'=>'d','е'=>'e','Ó™'=>'Ç','ε'=>'É›','Ñ”'=>'É›','Ö„'=>'f','Ö'=>'g','Ò»'=>'h','Õ°'=>'h','á‚'=>'h','á²'=>'hÌ”','ι'=>'i','Ñ–'=>'i','Ꭵ'=>'i','ј'=>'j','Õµ'=>'j','á—°'=>'m','Õ¸'=>'n','η'=>'nÌ©','à°‚'=>'o','ಂ'=>'o','à´‚'=>'o','०'=>'o','੦'=>'o','૦'=>'o','à¹'=>'o','à»'=>'o','ο'=>'o','о'=>'o','Ö…'=>'o','á€'=>'o','Ï'=>'p','Ñ€'=>'p','á´©'=>'á´˜','Õ£'=>'q','κ'=>'ĸ','к'=>'ĸ','á´¦'=>'r','г'=>'r','Ñ•'=>'s','Ï…'=>'u','Õ½'=>'u','ν'=>'v','ѵ'=>'v','Ꮃ'=>'w','á—¯'=>'w','Ñ…'=>'x','á•'=>'x','у'=>'y','Ꭹ'=>'y','Ó¡'=>'Ê’','ჳ'=>'Ê’','Ï©'=>'ƨ','ÑŒ'=>'Æ…','Ñ‹'=>'Æ…i','É‘'=>'α','Õ®'=>'δ','á•·'=>'δ','п'=>'Ï€','ɸ'=>'φ','Ñ„'=>'φ','Ê™'=>'в','Éœ'=>'з','á´'=>'м','Êœ'=>'н','É¢'=>'Ô','á´›'=>'Ñ‚','á´™'=>'Ñ','ઽ'=>'ऽ','à«'=>'à¥','à«‚'=>'ू','à©‹'=>'ॆ','à©'=>'à¥','à«'=>'à¥','à´‰'=>'உ','à´œ'=>'à®','à´£'=>'ண','à´´'=>'à®´','à´¿'=>'ி','àµ'=>'ூ','ಅ'=>'à°…','ಆ'=>'à°†','ಇ'=>'à°‡','ಒ'=>'à°’','ಓ'=>'ఒౕ','ಜ'=>'à°œ','ಞ'=>'à°ž','ಣ'=>'à°£','à°¥'=>'à°§Ö¼','ಯ'=>'à°¯','à° '=>'à°°Ö¼','ಱ'=>'à°±','ಲ'=>'à°²','ඌ'=>'à´¨àµà´¨','ஶ'=>'à´¶','ຈ'=>'จ','ບ'=>'บ','ປ'=>'ป','àº'=>'à¸','ພ'=>'พ','ຟ'=>'ฟ','àº'=>'ย','។'=>'ฯ','áž·'=>'ิ','ី'=>'ี','áž¹'=>'ึ','ឺ'=>'ื','ຸ'=>'ุ','ູ'=>'ู','á—…'=>'A','á’'=>'J','ᕼ'=>'H','á¯'=>'V','á‘­'=>'P','á—·'=>'B','ヘ'=>'ã¸','ð‘'=>'ðŽ‚','ð“'=>'ðŽ“','𒀸'=>'ðŽš','á…³'=>'一','Ç€'=>'丨','á…µ'=>'丨','Ꭺ'=>'A','á´'=>'B','áŸ'=>'C','á—ž'=>'D','Ꭼ'=>'E','á–´'=>'F','á€'=>'G','Ꮋ'=>'H','Ꭻ'=>'J','á¦'=>'K','áž'=>'L','Ꮇ'=>'M','á¢'=>'P','á–‡'=>'R','á•'=>'S','á™'=>'V','áƒ'=>'Z'); diff --git a/sources/phpBB/includes/utf/data/recode_basic.php b/sources/phpBB/includes/utf/data/recode_basic.php new file mode 100644 index 0000000..8a9dc54 --- /dev/null +++ b/sources/phpBB/includes/utf/data/recode_basic.php @@ -0,0 +1,1541 @@ + "\xC2\x80", + "\x81" => "\xC2\x81", + "\x82" => "\xC2\x82", + "\x83" => "\xC2\x83", + "\x84" => "\xC2\x84", + "\x85" => "\xC2\x85", + "\x86" => "\xC2\x86", + "\x87" => "\xC2\x87", + "\x88" => "\xC2\x88", + "\x89" => "\xC2\x89", + "\x8A" => "\xC2\x8A", + "\x8B" => "\xC2\x8B", + "\x8C" => "\xC2\x8C", + "\x8D" => "\xC2\x8D", + "\x8E" => "\xC2\x8E", + "\x8F" => "\xC2\x8F", + "\x90" => "\xC2\x90", + "\x91" => "\xC2\x91", + "\x92" => "\xC2\x92", + "\x93" => "\xC2\x93", + "\x94" => "\xC2\x94", + "\x95" => "\xC2\x95", + "\x96" => "\xC2\x96", + "\x97" => "\xC2\x97", + "\x98" => "\xC2\x98", + "\x99" => "\xC2\x99", + "\x9A" => "\xC2\x9A", + "\x9B" => "\xC2\x9B", + "\x9C" => "\xC2\x9C", + "\x9D" => "\xC2\x9D", + "\x9E" => "\xC2\x9E", + "\x9F" => "\xC2\x9F", + "\xA0" => "\xC2\xA0", + "\xA1" => "\xC4\x84", + "\xA2" => "\xCB\x98", + "\xA3" => "\xC5\x81", + "\xA4" => "\xC2\xA4", + "\xA5" => "\xC4\xBD", + "\xA6" => "\xC5\x9A", + "\xA7" => "\xC2\xA7", + "\xA8" => "\xC2\xA8", + "\xA9" => "\xC5\xA0", + "\xAA" => "\xC5\x9E", + "\xAB" => "\xC5\xA4", + "\xAC" => "\xC5\xB9", + "\xAD" => "\xC2\xAD", + "\xAE" => "\xC5\xBD", + "\xAF" => "\xC5\xBB", + "\xB0" => "\xC2\xB0", + "\xB1" => "\xC4\x85", + "\xB2" => "\xCB\x9B", + "\xB3" => "\xC5\x82", + "\xB4" => "\xC2\xB4", + "\xB5" => "\xC4\xBE", + "\xB6" => "\xC5\x9B", + "\xB7" => "\xCB\x87", + "\xB8" => "\xC2\xB8", + "\xB9" => "\xC5\xA1", + "\xBA" => "\xC5\x9F", + "\xBB" => "\xC5\xA5", + "\xBC" => "\xC5\xBA", + "\xBD" => "\xCB\x9D", + "\xBE" => "\xC5\xBE", + "\xBF" => "\xC5\xBC", + "\xC0" => "\xC5\x94", + "\xC1" => "\xC3\x81", + "\xC2" => "\xC3\x82", + "\xC3" => "\xC4\x82", + "\xC4" => "\xC3\x84", + "\xC5" => "\xC4\xB9", + "\xC6" => "\xC4\x86", + "\xC7" => "\xC3\x87", + "\xC8" => "\xC4\x8C", + "\xC9" => "\xC3\x89", + "\xCA" => "\xC4\x98", + "\xCB" => "\xC3\x8B", + "\xCC" => "\xC4\x9A", + "\xCD" => "\xC3\x8D", + "\xCE" => "\xC3\x8E", + "\xCF" => "\xC4\x8E", + "\xD0" => "\xC4\x90", + "\xD1" => "\xC5\x83", + "\xD2" => "\xC5\x87", + "\xD3" => "\xC3\x93", + "\xD4" => "\xC3\x94", + "\xD5" => "\xC5\x90", + "\xD6" => "\xC3\x96", + "\xD7" => "\xC3\x97", + "\xD8" => "\xC5\x98", + "\xD9" => "\xC5\xAE", + "\xDA" => "\xC3\x9A", + "\xDB" => "\xC5\xB0", + "\xDC" => "\xC3\x9C", + "\xDD" => "\xC3\x9D", + "\xDE" => "\xC5\xA2", + "\xDF" => "\xC3\x9F", + "\xE0" => "\xC5\x95", + "\xE1" => "\xC3\xA1", + "\xE2" => "\xC3\xA2", + "\xE3" => "\xC4\x83", + "\xE4" => "\xC3\xA4", + "\xE5" => "\xC4\xBA", + "\xE6" => "\xC4\x87", + "\xE7" => "\xC3\xA7", + "\xE8" => "\xC4\x8D", + "\xE9" => "\xC3\xA9", + "\xEA" => "\xC4\x99", + "\xEB" => "\xC3\xAB", + "\xEC" => "\xC4\x9B", + "\xED" => "\xC3\xAD", + "\xEE" => "\xC3\xAE", + "\xEF" => "\xC4\x8F", + "\xF0" => "\xC4\x91", + "\xF1" => "\xC5\x84", + "\xF2" => "\xC5\x88", + "\xF3" => "\xC3\xB3", + "\xF4" => "\xC3\xB4", + "\xF5" => "\xC5\x91", + "\xF6" => "\xC3\xB6", + "\xF7" => "\xC3\xB7", + "\xF8" => "\xC5\x99", + "\xF9" => "\xC5\xAF", + "\xFA" => "\xC3\xBA", + "\xFB" => "\xC5\xB1", + "\xFC" => "\xC3\xBC", + "\xFD" => "\xC3\xBD", + "\xFE" => "\xC5\xA3", + "\xFF" => "\xCB\x99", + ); + return strtr($string, $transform); +} + +function iso_8859_4($string) +{ + static $transform = array( + "\x80" => "\xC2\x80", + "\x81" => "\xC2\x81", + "\x82" => "\xC2\x82", + "\x83" => "\xC2\x83", + "\x84" => "\xC2\x84", + "\x85" => "\xC2\x85", + "\x86" => "\xC2\x86", + "\x87" => "\xC2\x87", + "\x88" => "\xC2\x88", + "\x89" => "\xC2\x89", + "\x8A" => "\xC2\x8A", + "\x8B" => "\xC2\x8B", + "\x8C" => "\xC2\x8C", + "\x8D" => "\xC2\x8D", + "\x8E" => "\xC2\x8E", + "\x8F" => "\xC2\x8F", + "\x90" => "\xC2\x90", + "\x91" => "\xC2\x91", + "\x92" => "\xC2\x92", + "\x93" => "\xC2\x93", + "\x94" => "\xC2\x94", + "\x95" => "\xC2\x95", + "\x96" => "\xC2\x96", + "\x97" => "\xC2\x97", + "\x98" => "\xC2\x98", + "\x99" => "\xC2\x99", + "\x9A" => "\xC2\x9A", + "\x9B" => "\xC2\x9B", + "\x9C" => "\xC2\x9C", + "\x9D" => "\xC2\x9D", + "\x9E" => "\xC2\x9E", + "\x9F" => "\xC2\x9F", + "\xA0" => "\xC2\xA0", + "\xA1" => "\xC4\x84", + "\xA2" => "\xC4\xB8", + "\xA3" => "\xC5\x96", + "\xA4" => "\xC2\xA4", + "\xA5" => "\xC4\xA8", + "\xA6" => "\xC4\xBB", + "\xA7" => "\xC2\xA7", + "\xA8" => "\xC2\xA8", + "\xA9" => "\xC5\xA0", + "\xAA" => "\xC4\x92", + "\xAB" => "\xC4\xA2", + "\xAC" => "\xC5\xA6", + "\xAD" => "\xC2\xAD", + "\xAE" => "\xC5\xBD", + "\xAF" => "\xC2\xAF", + "\xB0" => "\xC2\xB0", + "\xB1" => "\xC4\x85", + "\xB2" => "\xCB\x9B", + "\xB3" => "\xC5\x97", + "\xB4" => "\xC2\xB4", + "\xB5" => "\xC4\xA9", + "\xB6" => "\xC4\xBC", + "\xB7" => "\xCB\x87", + "\xB8" => "\xC2\xB8", + "\xB9" => "\xC5\xA1", + "\xBA" => "\xC4\x93", + "\xBB" => "\xC4\xA3", + "\xBC" => "\xC5\xA7", + "\xBD" => "\xC5\x8A", + "\xBE" => "\xC5\xBE", + "\xBF" => "\xC5\x8B", + "\xC0" => "\xC4\x80", + "\xC1" => "\xC3\x81", + "\xC2" => "\xC3\x82", + "\xC3" => "\xC3\x83", + "\xC4" => "\xC3\x84", + "\xC5" => "\xC3\x85", + "\xC6" => "\xC3\x86", + "\xC7" => "\xC4\xAE", + "\xC8" => "\xC4\x8C", + "\xC9" => "\xC3\x89", + "\xCA" => "\xC4\x98", + "\xCB" => "\xC3\x8B", + "\xCC" => "\xC4\x96", + "\xCD" => "\xC3\x8D", + "\xCE" => "\xC3\x8E", + "\xCF" => "\xC4\xAA", + "\xD0" => "\xC4\x90", + "\xD1" => "\xC5\x85", + "\xD2" => "\xC5\x8C", + "\xD3" => "\xC4\xB6", + "\xD4" => "\xC3\x94", + "\xD5" => "\xC3\x95", + "\xD6" => "\xC3\x96", + "\xD7" => "\xC3\x97", + "\xD8" => "\xC3\x98", + "\xD9" => "\xC5\xB2", + "\xDA" => "\xC3\x9A", + "\xDB" => "\xC3\x9B", + "\xDC" => "\xC3\x9C", + "\xDD" => "\xC5\xA8", + "\xDE" => "\xC5\xAA", + "\xDF" => "\xC3\x9F", + "\xE0" => "\xC4\x81", + "\xE1" => "\xC3\xA1", + "\xE2" => "\xC3\xA2", + "\xE3" => "\xC3\xA3", + "\xE4" => "\xC3\xA4", + "\xE5" => "\xC3\xA5", + "\xE6" => "\xC3\xA6", + "\xE7" => "\xC4\xAF", + "\xE8" => "\xC4\x8D", + "\xE9" => "\xC3\xA9", + "\xEA" => "\xC4\x99", + "\xEB" => "\xC3\xAB", + "\xEC" => "\xC4\x97", + "\xED" => "\xC3\xAD", + "\xEE" => "\xC3\xAE", + "\xEF" => "\xC4\xAB", + "\xF0" => "\xC4\x91", + "\xF1" => "\xC5\x86", + "\xF2" => "\xC5\x8D", + "\xF3" => "\xC4\xB7", + "\xF4" => "\xC3\xB4", + "\xF5" => "\xC3\xB5", + "\xF6" => "\xC3\xB6", + "\xF7" => "\xC3\xB7", + "\xF8" => "\xC3\xB8", + "\xF9" => "\xC5\xB3", + "\xFA" => "\xC3\xBA", + "\xFB" => "\xC3\xBB", + "\xFC" => "\xC3\xBC", + "\xFD" => "\xC5\xA9", + "\xFE" => "\xC5\xAB", + "\xFF" => "\xCB\x99", + ); + return strtr($string, $transform); +} + +function iso_8859_7($string) +{ + static $transform = array( + "\x80" => "\xC2\x80", + "\x81" => "\xC2\x81", + "\x82" => "\xC2\x82", + "\x83" => "\xC2\x83", + "\x84" => "\xC2\x84", + "\x85" => "\xC2\x85", + "\x86" => "\xC2\x86", + "\x87" => "\xC2\x87", + "\x88" => "\xC2\x88", + "\x89" => "\xC2\x89", + "\x8A" => "\xC2\x8A", + "\x8B" => "\xC2\x8B", + "\x8C" => "\xC2\x8C", + "\x8D" => "\xC2\x8D", + "\x8E" => "\xC2\x8E", + "\x8F" => "\xC2\x8F", + "\x90" => "\xC2\x90", + "\x91" => "\xC2\x91", + "\x92" => "\xC2\x92", + "\x93" => "\xC2\x93", + "\x94" => "\xC2\x94", + "\x95" => "\xC2\x95", + "\x96" => "\xC2\x96", + "\x97" => "\xC2\x97", + "\x98" => "\xC2\x98", + "\x99" => "\xC2\x99", + "\x9A" => "\xC2\x9A", + "\x9B" => "\xC2\x9B", + "\x9C" => "\xC2\x9C", + "\x9D" => "\xC2\x9D", + "\x9E" => "\xC2\x9E", + "\x9F" => "\xC2\x9F", + "\xA0" => "\xC2\xA0", + "\xA1" => "\xE2\x80\x98", + "\xA2" => "\xE2\x80\x99", + "\xA3" => "\xC2\xA3", + "\xA4" => "\xE2\x82\xAC", + "\xA5" => "\xE2\x82\xAF", + "\xA6" => "\xC2\xA6", + "\xA7" => "\xC2\xA7", + "\xA8" => "\xC2\xA8", + "\xA9" => "\xC2\xA9", + "\xAA" => "\xCD\xBA", + "\xAB" => "\xC2\xAB", + "\xAC" => "\xC2\xAC", + "\xAD" => "\xC2\xAD", + "\xAF" => "\xE2\x80\x95", + "\xB0" => "\xC2\xB0", + "\xB1" => "\xC2\xB1", + "\xB2" => "\xC2\xB2", + "\xB3" => "\xC2\xB3", + "\xB4" => "\xCE\x84", + "\xB5" => "\xCE\x85", + "\xB6" => "\xCE\x86", + "\xB7" => "\xC2\xB7", + "\xB8" => "\xCE\x88", + "\xB9" => "\xCE\x89", + "\xBA" => "\xCE\x8A", + "\xBB" => "\xC2\xBB", + "\xBC" => "\xCE\x8C", + "\xBD" => "\xC2\xBD", + "\xBE" => "\xCE\x8E", + "\xBF" => "\xCE\x8F", + "\xC0" => "\xCE\x90", + "\xC1" => "\xCE\x91", + "\xC2" => "\xCE\x92", + "\xC3" => "\xCE\x93", + "\xC4" => "\xCE\x94", + "\xC5" => "\xCE\x95", + "\xC6" => "\xCE\x96", + "\xC7" => "\xCE\x97", + "\xC8" => "\xCE\x98", + "\xC9" => "\xCE\x99", + "\xCA" => "\xCE\x9A", + "\xCB" => "\xCE\x9B", + "\xCC" => "\xCE\x9C", + "\xCD" => "\xCE\x9D", + "\xCE" => "\xCE\x9E", + "\xCF" => "\xCE\x9F", + "\xD0" => "\xCE\xA0", + "\xD1" => "\xCE\xA1", + "\xD3" => "\xCE\xA3", + "\xD4" => "\xCE\xA4", + "\xD5" => "\xCE\xA5", + "\xD6" => "\xCE\xA6", + "\xD7" => "\xCE\xA7", + "\xD8" => "\xCE\xA8", + "\xD9" => "\xCE\xA9", + "\xDA" => "\xCE\xAA", + "\xDB" => "\xCE\xAB", + "\xDC" => "\xCE\xAC", + "\xDD" => "\xCE\xAD", + "\xDE" => "\xCE\xAE", + "\xDF" => "\xCE\xAF", + "\xE0" => "\xCE\xB0", + "\xE1" => "\xCE\xB1", + "\xE2" => "\xCE\xB2", + "\xE3" => "\xCE\xB3", + "\xE4" => "\xCE\xB4", + "\xE5" => "\xCE\xB5", + "\xE6" => "\xCE\xB6", + "\xE7" => "\xCE\xB7", + "\xE8" => "\xCE\xB8", + "\xE9" => "\xCE\xB9", + "\xEA" => "\xCE\xBA", + "\xEB" => "\xCE\xBB", + "\xEC" => "\xCE\xBC", + "\xED" => "\xCE\xBD", + "\xEE" => "\xCE\xBE", + "\xEF" => "\xCE\xBF", + "\xF0" => "\xCF\x80", + "\xF1" => "\xCF\x81", + "\xF2" => "\xCF\x82", + "\xF3" => "\xCF\x83", + "\xF4" => "\xCF\x84", + "\xF5" => "\xCF\x85", + "\xF6" => "\xCF\x86", + "\xF7" => "\xCF\x87", + "\xF8" => "\xCF\x88", + "\xF9" => "\xCF\x89", + "\xFA" => "\xCF\x8A", + "\xFB" => "\xCF\x8B", + "\xFC" => "\xCF\x8C", + "\xFD" => "\xCF\x8D", + "\xFE" => "\xCF\x8E", + ); + return strtr($string, $transform); +} + +function iso_8859_8($string) +{ + static $transform = array( + "\xC2\xAA" => "\xC3\x97", + "\xC2\xBA" => "\xC3\xB7", + "\xC3\x9F" => "\xE2\x80\x97", + "\xC3\xA0" => "\xD7\x90", + "\xC3\xA1" => "\xD7\x91", + "\xC3\xA2" => "\xD7\x92", + "\xC3\xA3" => "\xD7\x93", + "\xC3\xA4" => "\xD7\x94", + "\xC3\xA5" => "\xD7\x95", + "\xC3\xA6" => "\xD7\x96", + "\xC3\xA7" => "\xD7\x97", + "\xC3\xA8" => "\xD7\x98", + "\xC3\xA9" => "\xD7\x99", + "\xC3\xAA" => "\xD7\x9A", + "\xC3\xAB" => "\xD7\x9B", + "\xC3\xAC" => "\xD7\x9C", + "\xC3\xAD" => "\xD7\x9D", + "\xC3\xAE" => "\xD7\x9E", + "\xC3\xAF" => "\xD7\x9F", + "\xC3\xB0" => "\xD7\xA0", + "\xC3\xB1" => "\xD7\xA1", + "\xC3\xB2" => "\xD7\xA2", + "\xC3\xB3" => "\xD7\xA3", + "\xC3\xB4" => "\xD7\xA4", + "\xC3\xB5" => "\xD7\xA5", + "\xC3\xB6" => "\xD7\xA6", + "\xC3\xB7" => "\xD7\xA7", + "\xC3\xB8" => "\xD7\xA8", + "\xC3\xB9" => "\xD7\xA9", + "\xC3\xBA" => "\xD7\xAA", + "\xC3\xBD" => "\xE2\x80\x8E", + "\xC3\xBE" => "\xE2\x80\x8F", + ); + return strtr(utf8_encode($string), $transform); +} + +function iso_8859_9($string) +{ + static $transform = array( + "\xC3\x90" => "\xC4\x9E", + "\xC3\x9D" => "\xC4\xB0", + "\xC3\x9E" => "\xC5\x9E", + "\xC3\xB0" => "\xC4\x9F", + "\xC3\xBD" => "\xC4\xB1", + "\xC3\xBE" => "\xC5\x9F", + ); + return strtr(utf8_encode($string), $transform); +} + +function iso_8859_15($string) +{ + static $transform = array( + "\xC2\xA4" => "\xE2\x82\xAC", + "\xC2\xA6" => "\xC5\xA0", + "\xC2\xA8" => "\xC5\xA1", + "\xC2\xB4" => "\xC5\xBD", + "\xC2\xB8" => "\xC5\xBE", + "\xC2\xBC" => "\xC5\x92", + "\xC2\xBD" => "\xC5\x93", + "\xC2\xBE" => "\xC5\xB8", + ); + return strtr(utf8_encode($string), $transform); +} + +// nearly the same as iso-8859-11 +function tis_620($string) +{ + static $transform = array( + "\x80" => "\xC2\x80", + "\x81" => "\xC2\x81", + "\x82" => "\xC2\x82", + "\x83" => "\xC2\x83", + "\x84" => "\xC2\x84", + "\x85" => "\xC2\x85", + "\x86" => "\xC2\x86", + "\x87" => "\xC2\x87", + "\x88" => "\xC2\x88", + "\x89" => "\xC2\x89", + "\x8A" => "\xC2\x8A", + "\x8B" => "\xC2\x8B", + "\x8C" => "\xC2\x8C", + "\x8D" => "\xC2\x8D", + "\x8E" => "\xC2\x8E", + "\x8F" => "\xC2\x8F", + "\x90" => "\xC2\x90", + "\x91" => "\xC2\x91", + "\x92" => "\xC2\x92", + "\x93" => "\xC2\x93", + "\x94" => "\xC2\x94", + "\x95" => "\xC2\x95", + "\x96" => "\xC2\x96", + "\x97" => "\xC2\x97", + "\x98" => "\xC2\x98", + "\x99" => "\xC2\x99", + "\x9A" => "\xC2\x9A", + "\x9B" => "\xC2\x9B", + "\x9C" => "\xC2\x9C", + "\x9D" => "\xC2\x9D", + "\x9E" => "\xC2\x9E", + "\x9F" => "\xC2\x9F", + "\xA1" => "\xE0\xB8\x81", + "\xA2" => "\xE0\xB8\x82", + "\xA3" => "\xE0\xB8\x83", + "\xA4" => "\xE0\xB8\x84", + "\xA5" => "\xE0\xB8\x85", + "\xA6" => "\xE0\xB8\x86", + "\xA7" => "\xE0\xB8\x87", + "\xA8" => "\xE0\xB8\x88", + "\xA9" => "\xE0\xB8\x89", + "\xAA" => "\xE0\xB8\x8A", + "\xAB" => "\xE0\xB8\x8B", + "\xAC" => "\xE0\xB8\x8C", + "\xAD" => "\xE0\xB8\x8D", + "\xAE" => "\xE0\xB8\x8E", + "\xAF" => "\xE0\xB8\x8F", + "\xB0" => "\xE0\xB8\x90", + "\xB1" => "\xE0\xB8\x91", + "\xB2" => "\xE0\xB8\x92", + "\xB3" => "\xE0\xB8\x93", + "\xB4" => "\xE0\xB8\x94", + "\xB5" => "\xE0\xB8\x95", + "\xB6" => "\xE0\xB8\x96", + "\xB7" => "\xE0\xB8\x97", + "\xB8" => "\xE0\xB8\x98", + "\xB9" => "\xE0\xB8\x99", + "\xBA" => "\xE0\xB8\x9A", + "\xBB" => "\xE0\xB8\x9B", + "\xBC" => "\xE0\xB8\x9C", + "\xBD" => "\xE0\xB8\x9D", + "\xBE" => "\xE0\xB8\x9E", + "\xBF" => "\xE0\xB8\x9F", + "\xC0" => "\xE0\xB8\xA0", + "\xC1" => "\xE0\xB8\xA1", + "\xC2" => "\xE0\xB8\xA2", + "\xC3" => "\xE0\xB8\xA3", + "\xC4" => "\xE0\xB8\xA4", + "\xC5" => "\xE0\xB8\xA5", + "\xC6" => "\xE0\xB8\xA6", + "\xC7" => "\xE0\xB8\xA7", + "\xC8" => "\xE0\xB8\xA8", + "\xC9" => "\xE0\xB8\xA9", + "\xCA" => "\xE0\xB8\xAA", + "\xCB" => "\xE0\xB8\xAB", + "\xCC" => "\xE0\xB8\xAC", + "\xCD" => "\xE0\xB8\xAD", + "\xCE" => "\xE0\xB8\xAE", + "\xCF" => "\xE0\xB8\xAF", + "\xD0" => "\xE0\xB8\xB0", + "\xD1" => "\xE0\xB8\xB1", + "\xD2" => "\xE0\xB8\xB2", + "\xD3" => "\xE0\xB8\xB3", + "\xD4" => "\xE0\xB8\xB4", + "\xD5" => "\xE0\xB8\xB5", + "\xD6" => "\xE0\xB8\xB6", + "\xD7" => "\xE0\xB8\xB7", + "\xD8" => "\xE0\xB8\xB8", + "\xD9" => "\xE0\xB8\xB9", + "\xDA" => "\xE0\xB8\xBA", + "\xDF" => "\xE0\xB8\xBF", + "\xE0" => "\xE0\xB9\x80", + "\xE1" => "\xE0\xB9\x81", + "\xE2" => "\xE0\xB9\x82", + "\xE3" => "\xE0\xB9\x83", + "\xE4" => "\xE0\xB9\x84", + "\xE5" => "\xE0\xB9\x85", + "\xE6" => "\xE0\xB9\x86", + "\xE7" => "\xE0\xB9\x87", + "\xE8" => "\xE0\xB9\x88", + "\xE9" => "\xE0\xB9\x89", + "\xEA" => "\xE0\xB9\x8A", + "\xEB" => "\xE0\xB9\x8B", + "\xEC" => "\xE0\xB9\x8C", + "\xED" => "\xE0\xB9\x8D", + "\xEE" => "\xE0\xB9\x8E", + "\xEF" => "\xE0\xB9\x8F", + "\xF0" => "\xE0\xB9\x90", + "\xF1" => "\xE0\xB9\x91", + "\xF2" => "\xE0\xB9\x92", + "\xF3" => "\xE0\xB9\x93", + "\xF4" => "\xE0\xB9\x94", + "\xF5" => "\xE0\xB9\x95", + "\xF6" => "\xE0\xB9\x96", + "\xF7" => "\xE0\xB9\x97", + "\xF8" => "\xE0\xB9\x98", + "\xF9" => "\xE0\xB9\x99", + "\xFA" => "\xE0\xB9\x9A", + "\xFB" => "\xE0\xB9\x9B", + ); + return strtr($string, $transform); +} + +function cp874($string) +{ + static $transform = array( + "\x80" => "\xE2\x82\xAC", + "\x85" => "\xE2\x80\xA6", + "\x91" => "\xE2\x80\x98", + "\x92" => "\xE2\x80\x99", + "\x93" => "\xE2\x80\x9C", + "\x94" => "\xE2\x80\x9D", + "\x95" => "\xE2\x80\xA2", + "\x96" => "\xE2\x80\x93", + "\x97" => "\xE2\x80\x94", + "\xA0" => "\xC2\xA0", + "\xA1" => "\xE0\xB8\x81", + "\xA2" => "\xE0\xB8\x82", + "\xA3" => "\xE0\xB8\x83", + "\xA4" => "\xE0\xB8\x84", + "\xA5" => "\xE0\xB8\x85", + "\xA6" => "\xE0\xB8\x86", + "\xA7" => "\xE0\xB8\x87", + "\xA8" => "\xE0\xB8\x88", + "\xA9" => "\xE0\xB8\x89", + "\xAA" => "\xE0\xB8\x8A", + "\xAB" => "\xE0\xB8\x8B", + "\xAC" => "\xE0\xB8\x8C", + "\xAD" => "\xE0\xB8\x8D", + "\xAE" => "\xE0\xB8\x8E", + "\xAF" => "\xE0\xB8\x8F", + "\xB0" => "\xE0\xB8\x90", + "\xB1" => "\xE0\xB8\x91", + "\xB2" => "\xE0\xB8\x92", + "\xB3" => "\xE0\xB8\x93", + "\xB4" => "\xE0\xB8\x94", + "\xB5" => "\xE0\xB8\x95", + "\xB6" => "\xE0\xB8\x96", + "\xB7" => "\xE0\xB8\x97", + "\xB8" => "\xE0\xB8\x98", + "\xB9" => "\xE0\xB8\x99", + "\xBA" => "\xE0\xB8\x9A", + "\xBB" => "\xE0\xB8\x9B", + "\xBC" => "\xE0\xB8\x9C", + "\xBD" => "\xE0\xB8\x9D", + "\xBE" => "\xE0\xB8\x9E", + "\xBF" => "\xE0\xB8\x9F", + "\xC0" => "\xE0\xB8\xA0", + "\xC1" => "\xE0\xB8\xA1", + "\xC2" => "\xE0\xB8\xA2", + "\xC3" => "\xE0\xB8\xA3", + "\xC4" => "\xE0\xB8\xA4", + "\xC5" => "\xE0\xB8\xA5", + "\xC6" => "\xE0\xB8\xA6", + "\xC7" => "\xE0\xB8\xA7", + "\xC8" => "\xE0\xB8\xA8", + "\xC9" => "\xE0\xB8\xA9", + "\xCA" => "\xE0\xB8\xAA", + "\xCB" => "\xE0\xB8\xAB", + "\xCC" => "\xE0\xB8\xAC", + "\xCD" => "\xE0\xB8\xAD", + "\xCE" => "\xE0\xB8\xAE", + "\xCF" => "\xE0\xB8\xAF", + "\xD0" => "\xE0\xB8\xB0", + "\xD1" => "\xE0\xB8\xB1", + "\xD2" => "\xE0\xB8\xB2", + "\xD3" => "\xE0\xB8\xB3", + "\xD4" => "\xE0\xB8\xB4", + "\xD5" => "\xE0\xB8\xB5", + "\xD6" => "\xE0\xB8\xB6", + "\xD7" => "\xE0\xB8\xB7", + "\xD8" => "\xE0\xB8\xB8", + "\xD9" => "\xE0\xB8\xB9", + "\xDA" => "\xE0\xB8\xBA", + "\xDF" => "\xE0\xB8\xBF", + "\xE0" => "\xE0\xB9\x80", + "\xE1" => "\xE0\xB9\x81", + "\xE2" => "\xE0\xB9\x82", + "\xE3" => "\xE0\xB9\x83", + "\xE4" => "\xE0\xB9\x84", + "\xE5" => "\xE0\xB9\x85", + "\xE6" => "\xE0\xB9\x86", + "\xE7" => "\xE0\xB9\x87", + "\xE8" => "\xE0\xB9\x88", + "\xE9" => "\xE0\xB9\x89", + "\xEA" => "\xE0\xB9\x8A", + "\xEB" => "\xE0\xB9\x8B", + "\xEC" => "\xE0\xB9\x8C", + "\xED" => "\xE0\xB9\x8D", + "\xEE" => "\xE0\xB9\x8E", + "\xEF" => "\xE0\xB9\x8F", + "\xF0" => "\xE0\xB9\x90", + "\xF1" => "\xE0\xB9\x91", + "\xF2" => "\xE0\xB9\x92", + "\xF3" => "\xE0\xB9\x93", + "\xF4" => "\xE0\xB9\x94", + "\xF5" => "\xE0\xB9\x95", + "\xF6" => "\xE0\xB9\x96", + "\xF7" => "\xE0\xB9\x97", + "\xF8" => "\xE0\xB9\x98", + "\xF9" => "\xE0\xB9\x99", + "\xFA" => "\xE0\xB9\x9A", + "\xFB" => "\xE0\xB9\x9B", + ); + return strtr($string, $transform); +} + +function cp1250($string) +{ + static $transform = array( + "\x80" => "\xE2\x82\xAC", + "\x82" => "\xE2\x80\x9A", + "\x84" => "\xE2\x80\x9E", + "\x85" => "\xE2\x80\xA6", + "\x86" => "\xE2\x80\xA0", + "\x87" => "\xE2\x80\xA1", + "\x89" => "\xE2\x80\xB0", + "\x8A" => "\xC5\xA0", + "\x8B" => "\xE2\x80\xB9", + "\x8C" => "\xC5\x9A", + "\x8D" => "\xC5\xA4", + "\x8E" => "\xC5\xBD", + "\x8F" => "\xC5\xB9", + "\x91" => "\xE2\x80\x98", + "\x92" => "\xE2\x80\x99", + "\x93" => "\xE2\x80\x9C", + "\x94" => "\xE2\x80\x9D", + "\x95" => "\xE2\x80\xA2", + "\x96" => "\xE2\x80\x93", + "\x97" => "\xE2\x80\x94", + "\x99" => "\xE2\x84\xA2", + "\x9A" => "\xC5\xA1", + "\x9B" => "\xE2\x80\xBA", + "\x9C" => "\xC5\x9B", + "\x9D" => "\xC5\xA5", + "\x9E" => "\xC5\xBE", + "\x9F" => "\xC5\xBA", + "\xA0" => "\xC2\xA0", + "\xA1" => "\xCB\x87", + "\xA2" => "\xCB\x98", + "\xA3" => "\xC5\x81", + "\xA4" => "\xC2\xA4", + "\xA5" => "\xC4\x84", + "\xA6" => "\xC2\xA6", + "\xA7" => "\xC2\xA7", + "\xA8" => "\xC2\xA8", + "\xA9" => "\xC2\xA9", + "\xAA" => "\xC5\x9E", + "\xAB" => "\xC2\xAB", + "\xAC" => "\xC2\xAC", + "\xAD" => "\xC2\xAD", + "\xAE" => "\xC2\xAE", + "\xAF" => "\xC5\xBB", + "\xB0" => "\xC2\xB0", + "\xB1" => "\xC2\xB1", + "\xB2" => "\xCB\x9B", + "\xB3" => "\xC5\x82", + "\xB4" => "\xC2\xB4", + "\xB5" => "\xC2\xB5", + "\xB6" => "\xC2\xB6", + "\xB7" => "\xC2\xB7", + "\xB8" => "\xC2\xB8", + "\xB9" => "\xC4\x85", + "\xBA" => "\xC5\x9F", + "\xBB" => "\xC2\xBB", + "\xBC" => "\xC4\xBD", + "\xBD" => "\xCB\x9D", + "\xBE" => "\xC4\xBE", + "\xBF" => "\xC5\xBC", + "\xC0" => "\xC5\x94", + "\xC1" => "\xC3\x81", + "\xC2" => "\xC3\x82", + "\xC3" => "\xC4\x82", + "\xC4" => "\xC3\x84", + "\xC5" => "\xC4\xB9", + "\xC6" => "\xC4\x86", + "\xC7" => "\xC3\x87", + "\xC8" => "\xC4\x8C", + "\xC9" => "\xC3\x89", + "\xCA" => "\xC4\x98", + "\xCB" => "\xC3\x8B", + "\xCC" => "\xC4\x9A", + "\xCD" => "\xC3\x8D", + "\xCE" => "\xC3\x8E", + "\xCF" => "\xC4\x8E", + "\xD0" => "\xC4\x90", + "\xD1" => "\xC5\x83", + "\xD2" => "\xC5\x87", + "\xD3" => "\xC3\x93", + "\xD4" => "\xC3\x94", + "\xD5" => "\xC5\x90", + "\xD6" => "\xC3\x96", + "\xD7" => "\xC3\x97", + "\xD8" => "\xC5\x98", + "\xD9" => "\xC5\xAE", + "\xDA" => "\xC3\x9A", + "\xDB" => "\xC5\xB0", + "\xDC" => "\xC3\x9C", + "\xDD" => "\xC3\x9D", + "\xDE" => "\xC5\xA2", + "\xDF" => "\xC3\x9F", + "\xE0" => "\xC5\x95", + "\xE1" => "\xC3\xA1", + "\xE2" => "\xC3\xA2", + "\xE3" => "\xC4\x83", + "\xE4" => "\xC3\xA4", + "\xE5" => "\xC4\xBA", + "\xE6" => "\xC4\x87", + "\xE7" => "\xC3\xA7", + "\xE8" => "\xC4\x8D", + "\xE9" => "\xC3\xA9", + "\xEA" => "\xC4\x99", + "\xEB" => "\xC3\xAB", + "\xEC" => "\xC4\x9B", + "\xED" => "\xC3\xAD", + "\xEE" => "\xC3\xAE", + "\xEF" => "\xC4\x8F", + "\xF0" => "\xC4\x91", + "\xF1" => "\xC5\x84", + "\xF2" => "\xC5\x88", + "\xF3" => "\xC3\xB3", + "\xF4" => "\xC3\xB4", + "\xF5" => "\xC5\x91", + "\xF6" => "\xC3\xB6", + "\xF7" => "\xC3\xB7", + "\xF8" => "\xC5\x99", + "\xF9" => "\xC5\xAF", + "\xFA" => "\xC3\xBA", + "\xFB" => "\xC5\xB1", + "\xFC" => "\xC3\xBC", + "\xFD" => "\xC3\xBD", + "\xFE" => "\xC5\xA3", + "\xFF" => "\xCB\x99", + ); + return strtr($string, $transform); +} + +function cp1251($string) +{ + static $transform = array( + "\x80" => "\xD0\x82", + "\x81" => "\xD0\x83", + "\x82" => "\xE2\x80\x9A", + "\x83" => "\xD1\x93", + "\x84" => "\xE2\x80\x9E", + "\x85" => "\xE2\x80\xA6", + "\x86" => "\xE2\x80\xA0", + "\x87" => "\xE2\x80\xA1", + "\x88" => "\xE2\x82\xAC", + "\x89" => "\xE2\x80\xB0", + "\x8A" => "\xD0\x89", + "\x8B" => "\xE2\x80\xB9", + "\x8C" => "\xD0\x8A", + "\x8D" => "\xD0\x8C", + "\x8E" => "\xD0\x8B", + "\x8F" => "\xD0\x8F", + "\x90" => "\xD1\x92", + "\x91" => "\xE2\x80\x98", + "\x92" => "\xE2\x80\x99", + "\x93" => "\xE2\x80\x9C", + "\x94" => "\xE2\x80\x9D", + "\x95" => "\xE2\x80\xA2", + "\x96" => "\xE2\x80\x93", + "\x97" => "\xE2\x80\x94", + "\x99" => "\xE2\x84\xA2", + "\x9A" => "\xD1\x99", + "\x9B" => "\xE2\x80\xBA", + "\x9C" => "\xD1\x9A", + "\x9D" => "\xD1\x9C", + "\x9E" => "\xD1\x9B", + "\x9F" => "\xD1\x9F", + "\xA0" => "\xC2\xA0", + "\xA1" => "\xD0\x8E", + "\xA2" => "\xD1\x9E", + "\xA3" => "\xD0\x88", + "\xA4" => "\xC2\xA4", + "\xA5" => "\xD2\x90", + "\xA6" => "\xC2\xA6", + "\xA7" => "\xC2\xA7", + "\xA8" => "\xD0\x81", + "\xA9" => "\xC2\xA9", + "\xAA" => "\xD0\x84", + "\xAB" => "\xC2\xAB", + "\xAC" => "\xC2\xAC", + "\xAD" => "\xC2\xAD", + "\xAE" => "\xC2\xAE", + "\xAF" => "\xD0\x87", + "\xB0" => "\xC2\xB0", + "\xB1" => "\xC2\xB1", + "\xB2" => "\xD0\x86", + "\xB3" => "\xD1\x96", + "\xB4" => "\xD2\x91", + "\xB5" => "\xC2\xB5", + "\xB6" => "\xC2\xB6", + "\xB7" => "\xC2\xB7", + "\xB8" => "\xD1\x91", + "\xB9" => "\xE2\x84\x96", + "\xBA" => "\xD1\x94", + "\xBB" => "\xC2\xBB", + "\xBC" => "\xD1\x98", + "\xBD" => "\xD0\x85", + "\xBE" => "\xD1\x95", + "\xBF" => "\xD1\x97", + "\xC0" => "\xD0\x90", + "\xC1" => "\xD0\x91", + "\xC2" => "\xD0\x92", + "\xC3" => "\xD0\x93", + "\xC4" => "\xD0\x94", + "\xC5" => "\xD0\x95", + "\xC6" => "\xD0\x96", + "\xC7" => "\xD0\x97", + "\xC8" => "\xD0\x98", + "\xC9" => "\xD0\x99", + "\xCA" => "\xD0\x9A", + "\xCB" => "\xD0\x9B", + "\xCC" => "\xD0\x9C", + "\xCD" => "\xD0\x9D", + "\xCE" => "\xD0\x9E", + "\xCF" => "\xD0\x9F", + "\xD0" => "\xD0\xA0", + "\xD1" => "\xD0\xA1", + "\xD2" => "\xD0\xA2", + "\xD3" => "\xD0\xA3", + "\xD4" => "\xD0\xA4", + "\xD5" => "\xD0\xA5", + "\xD6" => "\xD0\xA6", + "\xD7" => "\xD0\xA7", + "\xD8" => "\xD0\xA8", + "\xD9" => "\xD0\xA9", + "\xDA" => "\xD0\xAA", + "\xDB" => "\xD0\xAB", + "\xDC" => "\xD0\xAC", + "\xDD" => "\xD0\xAD", + "\xDE" => "\xD0\xAE", + "\xDF" => "\xD0\xAF", + "\xE0" => "\xD0\xB0", + "\xE1" => "\xD0\xB1", + "\xE2" => "\xD0\xB2", + "\xE3" => "\xD0\xB3", + "\xE4" => "\xD0\xB4", + "\xE5" => "\xD0\xB5", + "\xE6" => "\xD0\xB6", + "\xE7" => "\xD0\xB7", + "\xE8" => "\xD0\xB8", + "\xE9" => "\xD0\xB9", + "\xEA" => "\xD0\xBA", + "\xEB" => "\xD0\xBB", + "\xEC" => "\xD0\xBC", + "\xED" => "\xD0\xBD", + "\xEE" => "\xD0\xBE", + "\xEF" => "\xD0\xBF", + "\xF0" => "\xD1\x80", + "\xF1" => "\xD1\x81", + "\xF2" => "\xD1\x82", + "\xF3" => "\xD1\x83", + "\xF4" => "\xD1\x84", + "\xF5" => "\xD1\x85", + "\xF6" => "\xD1\x86", + "\xF7" => "\xD1\x87", + "\xF8" => "\xD1\x88", + "\xF9" => "\xD1\x89", + "\xFA" => "\xD1\x8A", + "\xFB" => "\xD1\x8B", + "\xFC" => "\xD1\x8C", + "\xFD" => "\xD1\x8D", + "\xFE" => "\xD1\x8E", + "\xFF" => "\xD1\x8F", + ); + return strtr($string, $transform); +} + +function cp1252($string) +{ + static $transform = array( + "\xC2\x80" => "\xE2\x82\xAC", + "\xC2\x82" => "\xE2\x80\x9A", + "\xC2\x83" => "\xC6\x92", + "\xC2\x84" => "\xE2\x80\x9E", + "\xC2\x85" => "\xE2\x80\xA6", + "\xC2\x86" => "\xE2\x80\xA0", + "\xC2\x87" => "\xE2\x80\xA1", + "\xC2\x88" => "\xCB\x86", + "\xC2\x89" => "\xE2\x80\xB0", + "\xC2\x8A" => "\xC5\xA0", + "\xC2\x8B" => "\xE2\x80\xB9", + "\xC2\x8C" => "\xC5\x92", + "\xC2\x8E" => "\xC5\xBD", + "\xC2\x91" => "\xE2\x80\x98", + "\xC2\x92" => "\xE2\x80\x99", + "\xC2\x93" => "\xE2\x80\x9C", + "\xC2\x94" => "\xE2\x80\x9D", + "\xC2\x95" => "\xE2\x80\xA2", + "\xC2\x96" => "\xE2\x80\x93", + "\xC2\x97" => "\xE2\x80\x94", + "\xC2\x98" => "\xCB\x9C", + "\xC2\x99" => "\xE2\x84\xA2", + "\xC2\x9A" => "\xC5\xA1", + "\xC2\x9B" => "\xE2\x80\xBA", + "\xC2\x9C" => "\xC5\x93", + "\xC2\x9E" => "\xC5\xBE", + "\xC2\x9F" => "\xC5\xB8" + ); + return strtr(utf8_encode($string), $transform); +} + +function cp1254($string) +{ + static $transform = array( + "\xC2\x80" => "\xE2\x82\xAC", + "\xC2\x82" => "\xE2\x80\x9A", + "\xC2\x83" => "\xC6\x92", + "\xC2\x84" => "\xE2\x80\x9E", + "\xC2\x85" => "\xE2\x80\xA6", + "\xC2\x86" => "\xE2\x80\xA0", + "\xC2\x87" => "\xE2\x80\xA1", + "\xC2\x88" => "\xCB\x86", + "\xC2\x89" => "\xE2\x80\xB0", + "\xC2\x8A" => "\xC5\xA0", + "\xC2\x8B" => "\xE2\x80\xB9", + "\xC2\x8C" => "\xC5\x92", + "\xC2\x91" => "\xE2\x80\x98", + "\xC2\x92" => "\xE2\x80\x99", + "\xC2\x93" => "\xE2\x80\x9C", + "\xC2\x94" => "\xE2\x80\x9D", + "\xC2\x95" => "\xE2\x80\xA2", + "\xC2\x96" => "\xE2\x80\x93", + "\xC2\x97" => "\xE2\x80\x94", + "\xC2\x98" => "\xCB\x9C", + "\xC2\x99" => "\xE2\x84\xA2", + "\xC2\x9A" => "\xC5\xA1", + "\xC2\x9B" => "\xE2\x80\xBA", + "\xC2\x9C" => "\xC5\x93", + "\xC2\x9F" => "\xC5\xB8", + "\xC3\x90" => "\xC4\x9E", + "\xC3\x9D" => "\xC4\xB0", + "\xC3\x9E" => "\xC5\x9E", + "\xC3\xB0" => "\xC4\x9F", + "\xC3\xBD" => "\xC4\xB1", + "\xC3\xBE" => "\xC5\x9F", + ); + return strtr(utf8_encode($string), $transform); +} + +function cp1255($string) +{ + static $transform = array( + "\x80" => "\xE2\x82\xAC", + "\x82" => "\xE2\x80\x9A", + "\x83" => "\xC6\x92", + "\x84" => "\xE2\x80\x9E", + "\x85" => "\xE2\x80\xA6", + "\x86" => "\xE2\x80\xA0", + "\x87" => "\xE2\x80\xA1", + "\x88" => "\xCB\x86", + "\x89" => "\xE2\x80\xB0", + "\x8B" => "\xE2\x80\xB9", + "\x91" => "\xE2\x80\x98", + "\x92" => "\xE2\x80\x99", + "\x93" => "\xE2\x80\x9C", + "\x94" => "\xE2\x80\x9D", + "\x95" => "\xE2\x80\xA2", + "\x96" => "\xE2\x80\x93", + "\x97" => "\xE2\x80\x94", + "\x98" => "\xCB\x9C", + "\x99" => "\xE2\x84\xA2", + "\x9B" => "\xE2\x80\xBA", + "\xA0" => "\xC2\xA0", + "\xA1" => "\xC2\xA1", + "\xA2" => "\xC2\xA2", + "\xA3" => "\xC2\xA3", + "\xA4" => "\xE2\x82\xAA", + "\xA5" => "\xC2\xA5", + "\xA6" => "\xC2\xA6", + "\xA7" => "\xC2\xA7", + "\xA8" => "\xC2\xA8", + "\xA9" => "\xC2\xA9", + "\xAA" => "\xC3\x97", + "\xAB" => "\xC2\xAB", + "\xAC" => "\xC2\xAC", + "\xAD" => "\xC2\xAD", + "\xAE" => "\xC2\xAE", + "\xAF" => "\xC2\xAF", + "\xB0" => "\xC2\xB0", + "\xB1" => "\xC2\xB1", + "\xB2" => "\xC2\xB2", + "\xB3" => "\xC2\xB3", + "\xB4" => "\xC2\xB4", + "\xB5" => "\xC2\xB5", + "\xB6" => "\xC2\xB6", + "\xB7" => "\xC2\xB7", + "\xB8" => "\xC2\xB8", + "\xB9" => "\xC2\xB9", + "\xBA" => "\xC3\xB7", + "\xBB" => "\xC2\xBB", + "\xBC" => "\xC2\xBC", + "\xBD" => "\xC2\xBD", + "\xBE" => "\xC2\xBE", + "\xBF" => "\xC2\xBF", + "\xC0" => "\xD6\xB0", + "\xC1" => "\xD6\xB1", + "\xC2" => "\xD6\xB2", + "\xC3" => "\xD6\xB3", + "\xC4" => "\xD6\xB4", + "\xC5" => "\xD6\xB5", + "\xC6" => "\xD6\xB6", + "\xC7" => "\xD6\xB7", + "\xC8" => "\xD6\xB8", + "\xC9" => "\xD6\xB9", + "\xCB" => "\xD6\xBB", + "\xCC" => "\xD6\xBC", + "\xCD" => "\xD6\xBD", + "\xCE" => "\xD6\xBE", + "\xCF" => "\xD6\xBF", + "\xD0" => "\xD7\x80", + "\xD1" => "\xD7\x81", + "\xD2" => "\xD7\x82", + "\xD3" => "\xD7\x83", + "\xD4" => "\xD7\xB0", + "\xD5" => "\xD7\xB1", + "\xD6" => "\xD7\xB2", + "\xD7" => "\xD7\xB3", + "\xD8" => "\xD7\xB4", + "\xE0" => "\xD7\x90", + "\xE1" => "\xD7\x91", + "\xE2" => "\xD7\x92", + "\xE3" => "\xD7\x93", + "\xE4" => "\xD7\x94", + "\xE5" => "\xD7\x95", + "\xE6" => "\xD7\x96", + "\xE7" => "\xD7\x97", + "\xE8" => "\xD7\x98", + "\xE9" => "\xD7\x99", + "\xEA" => "\xD7\x9A", + "\xEB" => "\xD7\x9B", + "\xEC" => "\xD7\x9C", + "\xED" => "\xD7\x9D", + "\xEE" => "\xD7\x9E", + "\xEF" => "\xD7\x9F", + "\xF0" => "\xD7\xA0", + "\xF1" => "\xD7\xA1", + "\xF2" => "\xD7\xA2", + "\xF3" => "\xD7\xA3", + "\xF4" => "\xD7\xA4", + "\xF5" => "\xD7\xA5", + "\xF6" => "\xD7\xA6", + "\xF7" => "\xD7\xA7", + "\xF8" => "\xD7\xA8", + "\xF9" => "\xD7\xA9", + "\xFA" => "\xD7\xAA", + "\xFD" => "\xE2\x80\x8E", + "\xFE" => "\xE2\x80\x8F", + ); + return strtr($string, $transform); +} + +function cp1256($string) +{ + static $transform = array( + "\x80" => "\xE2\x82\xAC", + "\x81" => "\xD9\xBE", + "\x82" => "\xE2\x80\x9A", + "\x83" => "\xC6\x92", + "\x84" => "\xE2\x80\x9E", + "\x85" => "\xE2\x80\xA6", + "\x86" => "\xE2\x80\xA0", + "\x87" => "\xE2\x80\xA1", + "\x88" => "\xCB\x86", + "\x89" => "\xE2\x80\xB0", + "\x8A" => "\xD9\xB9", + "\x8B" => "\xE2\x80\xB9", + "\x8C" => "\xC5\x92", + "\x8D" => "\xDA\x86", + "\x8E" => "\xDA\x98", + "\x8F" => "\xDA\x88", + "\x90" => "\xDA\xAF", + "\x91" => "\xE2\x80\x98", + "\x92" => "\xE2\x80\x99", + "\x93" => "\xE2\x80\x9C", + "\x94" => "\xE2\x80\x9D", + "\x95" => "\xE2\x80\xA2", + "\x96" => "\xE2\x80\x93", + "\x97" => "\xE2\x80\x94", + "\x98" => "\xDA\xA9", + "\x99" => "\xE2\x84\xA2", + "\x9A" => "\xDA\x91", + "\x9B" => "\xE2\x80\xBA", + "\x9C" => "\xC5\x93", + "\x9D" => "\xE2\x80\x8C", + "\x9E" => "\xE2\x80\x8D", + "\x9F" => "\xDA\xBA", + "\xA0" => "\xC2\xA0", + "\xA1" => "\xD8\x8C", + "\xA2" => "\xC2\xA2", + "\xA3" => "\xC2\xA3", + "\xA4" => "\xC2\xA4", + "\xA5" => "\xC2\xA5", + "\xA6" => "\xC2\xA6", + "\xA7" => "\xC2\xA7", + "\xA8" => "\xC2\xA8", + "\xA9" => "\xC2\xA9", + "\xAA" => "\xDA\xBE", + "\xAB" => "\xC2\xAB", + "\xAC" => "\xC2\xAC", + "\xAD" => "\xC2\xAD", + "\xAE" => "\xC2\xAE", + "\xAF" => "\xC2\xAF", + "\xB0" => "\xC2\xB0", + "\xB1" => "\xC2\xB1", + "\xB2" => "\xC2\xB2", + "\xB3" => "\xC2\xB3", + "\xB4" => "\xC2\xB4", + "\xB5" => "\xC2\xB5", + "\xB6" => "\xC2\xB6", + "\xB7" => "\xC2\xB7", + "\xB8" => "\xC2\xB8", + "\xB9" => "\xC2\xB9", + "\xBA" => "\xD8\x9B", + "\xBB" => "\xC2\xBB", + "\xBC" => "\xC2\xBC", + "\xBD" => "\xC2\xBD", + "\xBE" => "\xC2\xBE", + "\xBF" => "\xD8\x9F", + "\xC0" => "\xDB\x81", + "\xC1" => "\xD8\xA1", + "\xC2" => "\xD8\xA2", + "\xC3" => "\xD8\xA3", + "\xC4" => "\xD8\xA4", + "\xC5" => "\xD8\xA5", + "\xC6" => "\xD8\xA6", + "\xC7" => "\xD8\xA7", + "\xC8" => "\xD8\xA8", + "\xC9" => "\xD8\xA9", + "\xCA" => "\xD8\xAA", + "\xCB" => "\xD8\xAB", + "\xCC" => "\xD8\xAC", + "\xCD" => "\xD8\xAD", + "\xCE" => "\xD8\xAE", + "\xCF" => "\xD8\xAF", + "\xD0" => "\xD8\xB0", + "\xD1" => "\xD8\xB1", + "\xD2" => "\xD8\xB2", + "\xD3" => "\xD8\xB3", + "\xD4" => "\xD8\xB4", + "\xD5" => "\xD8\xB5", + "\xD6" => "\xD8\xB6", + "\xD7" => "\xC3\x97", + "\xD8" => "\xD8\xB7", + "\xD9" => "\xD8\xB8", + "\xDA" => "\xD8\xB9", + "\xDB" => "\xD8\xBA", + "\xDC" => "\xD9\x80", + "\xDD" => "\xD9\x81", + "\xDE" => "\xD9\x82", + "\xDF" => "\xD9\x83", + "\xE0" => "\xC3\xA0", + "\xE1" => "\xD9\x84", + "\xE2" => "\xC3\xA2", + "\xE3" => "\xD9\x85", + "\xE4" => "\xD9\x86", + "\xE5" => "\xD9\x87", + "\xE6" => "\xD9\x88", + "\xE7" => "\xC3\xA7", + "\xE8" => "\xC3\xA8", + "\xE9" => "\xC3\xA9", + "\xEA" => "\xC3\xAA", + "\xEB" => "\xC3\xAB", + "\xEC" => "\xD9\x89", + "\xED" => "\xD9\x8A", + "\xEE" => "\xC3\xAE", + "\xEF" => "\xC3\xAF", + "\xF0" => "\xD9\x8B", + "\xF1" => "\xD9\x8C", + "\xF2" => "\xD9\x8D", + "\xF3" => "\xD9\x8E", + "\xF4" => "\xC3\xB4", + "\xF5" => "\xD9\x8F", + "\xF6" => "\xD9\x90", + "\xF7" => "\xC3\xB7", + "\xF8" => "\xD9\x91", + "\xF9" => "\xC3\xB9", + "\xFA" => "\xD9\x92", + "\xFB" => "\xC3\xBB", + "\xFC" => "\xC3\xBC", + "\xFD" => "\xE2\x80\x8E", + "\xFE" => "\xE2\x80\x8F", + "\xFF" => "\xDB\x92", + ); + return strtr($string, $transform); +} + +function cp1257($string) +{ + static $transform = array( + "\x80" => "\xE2\x82\xAC", + "\x82" => "\xE2\x80\x9A", + "\x84" => "\xE2\x80\x9E", + "\x85" => "\xE2\x80\xA6", + "\x86" => "\xE2\x80\xA0", + "\x87" => "\xE2\x80\xA1", + "\x89" => "\xE2\x80\xB0", + "\x8B" => "\xE2\x80\xB9", + "\x8D" => "\xC2\xA8", + "\x8E" => "\xCB\x87", + "\x8F" => "\xC2\xB8", + "\x91" => "\xE2\x80\x98", + "\x92" => "\xE2\x80\x99", + "\x93" => "\xE2\x80\x9C", + "\x94" => "\xE2\x80\x9D", + "\x95" => "\xE2\x80\xA2", + "\x96" => "\xE2\x80\x93", + "\x97" => "\xE2\x80\x94", + "\x99" => "\xE2\x84\xA2", + "\x9B" => "\xE2\x80\xBA", + "\x9D" => "\xC2\xAF", + "\x9E" => "\xCB\x9B", + "\xA0" => "\xC2\xA0", + "\xA2" => "\xC2\xA2", + "\xA3" => "\xC2\xA3", + "\xA4" => "\xC2\xA4", + "\xA6" => "\xC2\xA6", + "\xA7" => "\xC2\xA7", + "\xA8" => "\xC3\x98", + "\xA9" => "\xC2\xA9", + "\xAA" => "\xC5\x96", + "\xAB" => "\xC2\xAB", + "\xAC" => "\xC2\xAC", + "\xAD" => "\xC2\xAD", + "\xAE" => "\xC2\xAE", + "\xAF" => "\xC3\x86", + "\xB0" => "\xC2\xB0", + "\xB1" => "\xC2\xB1", + "\xB2" => "\xC2\xB2", + "\xB3" => "\xC2\xB3", + "\xB4" => "\xC2\xB4", + "\xB5" => "\xC2\xB5", + "\xB6" => "\xC2\xB6", + "\xB7" => "\xC2\xB7", + "\xB8" => "\xC3\xB8", + "\xB9" => "\xC2\xB9", + "\xBA" => "\xC5\x97", + "\xBB" => "\xC2\xBB", + "\xBC" => "\xC2\xBC", + "\xBD" => "\xC2\xBD", + "\xBE" => "\xC2\xBE", + "\xBF" => "\xC3\xA6", + "\xC0" => "\xC4\x84", + "\xC1" => "\xC4\xAE", + "\xC2" => "\xC4\x80", + "\xC3" => "\xC4\x86", + "\xC4" => "\xC3\x84", + "\xC5" => "\xC3\x85", + "\xC6" => "\xC4\x98", + "\xC7" => "\xC4\x92", + "\xC8" => "\xC4\x8C", + "\xC9" => "\xC3\x89", + "\xCA" => "\xC5\xB9", + "\xCB" => "\xC4\x96", + "\xCC" => "\xC4\xA2", + "\xCD" => "\xC4\xB6", + "\xCE" => "\xC4\xAA", + "\xCF" => "\xC4\xBB", + "\xD0" => "\xC5\xA0", + "\xD1" => "\xC5\x83", + "\xD2" => "\xC5\x85", + "\xD3" => "\xC3\x93", + "\xD4" => "\xC5\x8C", + "\xD5" => "\xC3\x95", + "\xD6" => "\xC3\x96", + "\xD7" => "\xC3\x97", + "\xD8" => "\xC5\xB2", + "\xD9" => "\xC5\x81", + "\xDA" => "\xC5\x9A", + "\xDB" => "\xC5\xAA", + "\xDC" => "\xC3\x9C", + "\xDD" => "\xC5\xBB", + "\xDE" => "\xC5\xBD", + "\xDF" => "\xC3\x9F", + "\xE0" => "\xC4\x85", + "\xE1" => "\xC4\xAF", + "\xE2" => "\xC4\x81", + "\xE3" => "\xC4\x87", + "\xE4" => "\xC3\xA4", + "\xE5" => "\xC3\xA5", + "\xE6" => "\xC4\x99", + "\xE7" => "\xC4\x93", + "\xE8" => "\xC4\x8D", + "\xE9" => "\xC3\xA9", + "\xEA" => "\xC5\xBA", + "\xEB" => "\xC4\x97", + "\xEC" => "\xC4\xA3", + "\xED" => "\xC4\xB7", + "\xEE" => "\xC4\xAB", + "\xEF" => "\xC4\xBC", + "\xF0" => "\xC5\xA1", + "\xF1" => "\xC5\x84", + "\xF2" => "\xC5\x86", + "\xF3" => "\xC3\xB3", + "\xF4" => "\xC5\x8D", + "\xF5" => "\xC3\xB5", + "\xF6" => "\xC3\xB6", + "\xF7" => "\xC3\xB7", + "\xF8" => "\xC5\xB3", + "\xF9" => "\xC5\x82", + "\xFA" => "\xC5\x9B", + "\xFB" => "\xC5\xAB", + "\xFC" => "\xC3\xBC", + "\xFD" => "\xC5\xBC", + "\xFE" => "\xC5\xBE", + "\xFF" => "\xCB\x99", + ); + return strtr($string, $transform); +} + +function utf8_to_cp1252($string) +{ + static $transform = array( + "\xE2\x82\xAC" => "\x80", + "\xE2\x80\x9A" => "\x82", + "\xC6\x92" => "\x83", + "\xE2\x80\x9E" => "\x84", + "\xE2\x80\xA6" => "\x85", + "\xE2\x80\xA0" => "\x86", + "\xE2\x80\xA1" => "\x87", + "\xCB\x86" => "\x88", + "\xE2\x80\xB0" => "\x89", + "\xC5\xA0" => "\x8A", + "\xE2\x80\xB9" => "\x8B", + "\xC5\x92" => "\x8C", + "\xC5\xBD" => "\x8E", + "\xE2\x80\x98" => "\x91", + "\xE2\x80\x99" => "\x92", + "\xE2\x80\x9C" => "\x93", + "\xE2\x80\x9D" => "\x94", + "\xE2\x80\xA2" => "\x95", + "\xE2\x80\x93" => "\x96", + "\xE2\x80\x94" => "\x97", + "\xCB\x9C" => "\x98", + "\xE2\x84\xA2" => "\x99", + "\xC5\xA1" => "\x9A", + "\xE2\x80\xBA" => "\x9B", + "\xC5\x93" => "\x9C", + "\xC5\xBE" => "\x9E", + "\xC5\xB8" => "\x9F", + "\xC2\xA0" => "\xA0", + "\xC2\xA1" => "\xA1", + "\xC2\xA2" => "\xA2", + "\xC2\xA3" => "\xA3", + "\xC2\xA4" => "\xA4", + "\xC2\xA5" => "\xA5", + "\xC2\xA6" => "\xA6", + "\xC2\xA7" => "\xA7", + "\xC2\xA8" => "\xA8", + "\xC2\xA9" => "\xA9", + "\xC2\xAA" => "\xAA", + "\xC2\xAB" => "\xAB", + "\xC2\xAC" => "\xAC", + "\xC2\xAD" => "\xAD", + "\xC2\xAE" => "\xAE", + "\xC2\xAF" => "\xAF", + "\xC2\xB0" => "\xB0", + "\xC2\xB1" => "\xB1", + "\xC2\xB2" => "\xB2", + "\xC2\xB3" => "\xB3", + "\xC2\xB4" => "\xB4", + "\xC2\xB5" => "\xB5", + "\xC2\xB6" => "\xB6", + "\xC2\xB7" => "\xB7", + "\xC2\xB8" => "\xB8", + "\xC2\xB9" => "\xB9", + "\xC2\xBA" => "\xBA", + "\xC2\xBB" => "\xBB", + "\xC2\xBC" => "\xBC", + "\xC2\xBD" => "\xBD", + "\xC2\xBE" => "\xBE", + "\xC2\xBF" => "\xBF", + "\xC3\x80" => "\xC0", + "\xC3\x81" => "\xC1", + "\xC3\x82" => "\xC2", + "\xC3\x83" => "\xC3", + "\xC3\x84" => "\xC4", + "\xC3\x85" => "\xC5", + "\xC3\x86" => "\xC6", + "\xC3\x87" => "\xC7", + "\xC3\x88" => "\xC8", + "\xC3\x89" => "\xC9", + "\xC3\x8A" => "\xCA", + "\xC3\x8B" => "\xCB", + "\xC3\x8C" => "\xCC", + "\xC3\x8D" => "\xCD", + "\xC3\x8E" => "\xCE", + "\xC3\x8F" => "\xCF", + "\xC3\x90" => "\xD0", + "\xC3\x91" => "\xD1", + "\xC3\x92" => "\xD2", + "\xC3\x93" => "\xD3", + "\xC3\x94" => "\xD4", + "\xC3\x95" => "\xD5", + "\xC3\x96" => "\xD6", + "\xC3\x97" => "\xD7", + "\xC3\x98" => "\xD8", + "\xC3\x99" => "\xD9", + "\xC3\x9A" => "\xDA", + "\xC3\x9B" => "\xDB", + "\xC3\x9C" => "\xDC", + "\xC3\x9D" => "\xDD", + "\xC3\x9E" => "\xDE", + "\xC3\x9F" => "\xDF", + "\xC3\xA0" => "\xE0", + "\xC3\xA1" => "\xE1", + "\xC3\xA2" => "\xE2", + "\xC3\xA3" => "\xE3", + "\xC3\xA4" => "\xE4", + "\xC3\xA5" => "\xE5", + "\xC3\xA6" => "\xE6", + "\xC3\xA7" => "\xE7", + "\xC3\xA8" => "\xE8", + "\xC3\xA9" => "\xE9", + "\xC3\xAA" => "\xEA", + "\xC3\xAB" => "\xEB", + "\xC3\xAC" => "\xEC", + "\xC3\xAD" => "\xED", + "\xC3\xAE" => "\xEE", + "\xC3\xAF" => "\xEF", + "\xC3\xB0" => "\xF0", + "\xC3\xB1" => "\xF1", + "\xC3\xB2" => "\xF2", + "\xC3\xB3" => "\xF3", + "\xC3\xB4" => "\xF4", + "\xC3\xB5" => "\xF5", + "\xC3\xB6" => "\xF6", + "\xC3\xB7" => "\xF7", + "\xC3\xB8" => "\xF8", + "\xC3\xB9" => "\xF9", + "\xC3\xBA" => "\xFA", + "\xC3\xBB" => "\xFB", + "\xC3\xBC" => "\xFC", + "\xC3\xBD" => "\xFD", + "\xC3\xBE" => "\xFE", + "\xC3\xBF" => "\xFF" + ); + return strtr($string, $transform); +} diff --git a/sources/phpBB/includes/utf/data/recode_cjk.php b/sources/phpBB/includes/utf/data/recode_cjk.php new file mode 100644 index 0000000..8c65274 --- /dev/null +++ b/sources/phpBB/includes/utf/data/recode_cjk.php @@ -0,0 +1,45177 @@ + "\xE3\x80\x80", + "\xA1\xA2" => "\xE3\x80\x81", + "\xA1\xA3" => "\xE3\x80\x82", + "\xA1\xA4" => "\xE3\x83\xBB", + "\xA1\xA5" => "\xCB\x89", + "\xA1\xA6" => "\xCB\x87", + "\xA1\xA7" => "\xC2\xA8", + "\xA1\xA8" => "\xE3\x80\x83", + "\xA1\xA9" => "\xE3\x80\x85", + "\xA1\xAA" => "\xE2\x80\x95", + "\xA1\xAB" => "\xEF\xBD\x9E", + "\xA1\xAC" => "\xE2\x80\x96", + "\xA1\xAD" => "\xE2\x80\xA6", + "\xA1\xAE" => "\xE2\x80\x98", + "\xA1\xAF" => "\xE2\x80\x99", + "\xA1\xB0" => "\xE2\x80\x9C", + "\xA1\xB1" => "\xE2\x80\x9D", + "\xA1\xB2" => "\xE3\x80\x94", + "\xA1\xB3" => "\xE3\x80\x95", + "\xA1\xB4" => "\xE3\x80\x88", + "\xA1\xB5" => "\xE3\x80\x89", + "\xA1\xB6" => "\xE3\x80\x8A", + "\xA1\xB7" => "\xE3\x80\x8B", + "\xA1\xB8" => "\xE3\x80\x8C", + "\xA1\xB9" => "\xE3\x80\x8D", + "\xA1\xBA" => "\xE3\x80\x8E", + "\xA1\xBB" => "\xE3\x80\x8F", + "\xA1\xBC" => "\xE3\x80\x96", + "\xA1\xBD" => "\xE3\x80\x97", + "\xA1\xBE" => "\xE3\x80\x90", + "\xA1\xBF" => "\xE3\x80\x91", + "\xA1\xC0" => "\xC2\xB1", + "\xA1\xC1" => "\xC3\x97", + "\xA1\xC2" => "\xC3\xB7", + "\xA1\xC3" => "\xE2\x88\xB6", + "\xA1\xC4" => "\xE2\x88\xA7", + "\xA1\xC5" => "\xE2\x88\xA8", + "\xA1\xC6" => "\xE2\x88\x91", + "\xA1\xC7" => "\xE2\x88\x8F", + "\xA1\xC8" => "\xE2\x88\xAA", + "\xA1\xC9" => "\xE2\x88\xA9", + "\xA1\xCA" => "\xE2\x88\x88", + "\xA1\xCB" => "\xE2\x88\xB7", + "\xA1\xCC" => "\xE2\x88\x9A", + "\xA1\xCD" => "\xE2\x8A\xA5", + "\xA1\xCE" => "\xE2\x88\xA5", + "\xA1\xCF" => "\xE2\x88\xA0", + "\xA1\xD0" => "\xE2\x8C\x92", + "\xA1\xD1" => "\xE2\x8A\x99", + "\xA1\xD2" => "\xE2\x88\xAB", + "\xA1\xD3" => "\xE2\x88\xAE", + "\xA1\xD4" => "\xE2\x89\xA1", + "\xA1\xD5" => "\xE2\x89\x8C", + "\xA1\xD6" => "\xE2\x89\x88", + "\xA1\xD7" => "\xE2\x88\xBD", + "\xA1\xD8" => "\xE2\x88\x9D", + "\xA1\xD9" => "\xE2\x89\xA0", + "\xA1\xDA" => "\xE2\x89\xAE", + "\xA1\xDB" => "\xE2\x89\xAF", + "\xA1\xDC" => "\xE2\x89\xA4", + "\xA1\xDD" => "\xE2\x89\xA5", + "\xA1\xDE" => "\xE2\x88\x9E", + "\xA1\xDF" => "\xE2\x88\xB5", + "\xA1\xE0" => "\xE2\x88\xB4", + "\xA1\xE1" => "\xE2\x99\x82", + "\xA1\xE2" => "\xE2\x99\x80", + "\xA1\xE3" => "\xC2\xB0", + "\xA1\xE4" => "\xE2\x80\xB2", + "\xA1\xE5" => "\xE2\x80\xB3", + "\xA1\xE6" => "\xE2\x84\x83", + "\xA1\xE7" => "\xEF\xBC\x84", + "\xA1\xE8" => "\xC2\xA4", + "\xA1\xE9" => "\xEF\xBF\xA0", + "\xA1\xEA" => "\xEF\xBF\xA1", + "\xA1\xEB" => "\xE2\x80\xB0", + "\xA1\xEC" => "\xC2\xA7", + "\xA1\xED" => "\xE2\x84\x96", + "\xA1\xEE" => "\xE2\x98\x86", + "\xA1\xEF" => "\xE2\x98\x85", + "\xA1\xF0" => "\xE2\x97\x8B", + "\xA1\xF1" => "\xE2\x97\x8F", + "\xA1\xF2" => "\xE2\x97\x8E", + "\xA1\xF3" => "\xE2\x97\x87", + "\xA1\xF4" => "\xE2\x97\x86", + "\xA1\xF5" => "\xE2\x96\xA1", + "\xA1\xF6" => "\xE2\x96\xA0", + "\xA1\xF7" => "\xE2\x96\xB3", + "\xA1\xF8" => "\xE2\x96\xB2", + "\xA1\xF9" => "\xE2\x80\xBB", + "\xA1\xFA" => "\xE2\x86\x92", + "\xA1\xFB" => "\xE2\x86\x90", + "\xA1\xFC" => "\xE2\x86\x91", + "\xA1\xFD" => "\xE2\x86\x93", + "\xA1\xFE" => "\xE3\x80\x93", + "\xA2\xB1" => "\xE2\x92\x88", + "\xA2\xB2" => "\xE2\x92\x89", + "\xA2\xB3" => "\xE2\x92\x8A", + "\xA2\xB4" => "\xE2\x92\x8B", + "\xA2\xB5" => "\xE2\x92\x8C", + "\xA2\xB6" => "\xE2\x92\x8D", + "\xA2\xB7" => "\xE2\x92\x8E", + "\xA2\xB8" => "\xE2\x92\x8F", + "\xA2\xB9" => "\xE2\x92\x90", + "\xA2\xBA" => "\xE2\x92\x91", + "\xA2\xBB" => "\xE2\x92\x92", + "\xA2\xBC" => "\xE2\x92\x93", + "\xA2\xBD" => "\xE2\x92\x94", + "\xA2\xBE" => "\xE2\x92\x95", + "\xA2\xBF" => "\xE2\x92\x96", + "\xA2\xC0" => "\xE2\x92\x97", + "\xA2\xC1" => "\xE2\x92\x98", + "\xA2\xC2" => "\xE2\x92\x99", + "\xA2\xC3" => "\xE2\x92\x9A", + "\xA2\xC4" => "\xE2\x92\x9B", + "\xA2\xC5" => "\xE2\x91\xB4", + "\xA2\xC6" => "\xE2\x91\xB5", + "\xA2\xC7" => "\xE2\x91\xB6", + "\xA2\xC8" => "\xE2\x91\xB7", + "\xA2\xC9" => "\xE2\x91\xB8", + "\xA2\xCA" => "\xE2\x91\xB9", + "\xA2\xCB" => "\xE2\x91\xBA", + "\xA2\xCC" => "\xE2\x91\xBB", + "\xA2\xCD" => "\xE2\x91\xBC", + "\xA2\xCE" => "\xE2\x91\xBD", + "\xA2\xCF" => "\xE2\x91\xBE", + "\xA2\xD0" => "\xE2\x91\xBF", + "\xA2\xD1" => "\xE2\x92\x80", + "\xA2\xD2" => "\xE2\x92\x81", + "\xA2\xD3" => "\xE2\x92\x82", + "\xA2\xD4" => "\xE2\x92\x83", + "\xA2\xD5" => "\xE2\x92\x84", + "\xA2\xD6" => "\xE2\x92\x85", + "\xA2\xD7" => "\xE2\x92\x86", + "\xA2\xD8" => "\xE2\x92\x87", + "\xA2\xD9" => "\xE2\x91\xA0", + "\xA2\xDA" => "\xE2\x91\xA1", + "\xA2\xDB" => "\xE2\x91\xA2", + "\xA2\xDC" => "\xE2\x91\xA3", + "\xA2\xDD" => "\xE2\x91\xA4", + "\xA2\xDE" => "\xE2\x91\xA5", + "\xA2\xDF" => "\xE2\x91\xA6", + "\xA2\xE0" => "\xE2\x91\xA7", + "\xA2\xE1" => "\xE2\x91\xA8", + "\xA2\xE2" => "\xE2\x91\xA9", + "\xA2\xE5" => "\xE3\x88\xA0", + "\xA2\xE6" => "\xE3\x88\xA1", + "\xA2\xE7" => "\xE3\x88\xA2", + "\xA2\xE8" => "\xE3\x88\xA3", + "\xA2\xE9" => "\xE3\x88\xA4", + "\xA2\xEA" => "\xE3\x88\xA5", + "\xA2\xEB" => "\xE3\x88\xA6", + "\xA2\xEC" => "\xE3\x88\xA7", + "\xA2\xED" => "\xE3\x88\xA8", + "\xA2\xEE" => "\xE3\x88\xA9", + "\xA2\xF1" => "\xE2\x85\xA0", + "\xA2\xF2" => "\xE2\x85\xA1", + "\xA2\xF3" => "\xE2\x85\xA2", + "\xA2\xF4" => "\xE2\x85\xA3", + "\xA2\xF5" => "\xE2\x85\xA4", + "\xA2\xF6" => "\xE2\x85\xA5", + "\xA2\xF7" => "\xE2\x85\xA6", + "\xA2\xF8" => "\xE2\x85\xA7", + "\xA2\xF9" => "\xE2\x85\xA8", + "\xA2\xFA" => "\xE2\x85\xA9", + "\xA2\xFB" => "\xE2\x85\xAA", + "\xA2\xFC" => "\xE2\x85\xAB", + "\xA3\xA1" => "\xEF\xBC\x81", + "\xA3\xA2" => "\xEF\xBC\x82", + "\xA3\xA3" => "\xEF\xBC\x83", + "\xA3\xA4" => "\xEF\xBF\xA5", + "\xA3\xA5" => "\xEF\xBC\x85", + "\xA3\xA6" => "\xEF\xBC\x86", + "\xA3\xA7" => "\xEF\xBC\x87", + "\xA3\xA8" => "\xEF\xBC\x88", + "\xA3\xA9" => "\xEF\xBC\x89", + "\xA3\xAA" => "\xEF\xBC\x8A", + "\xA3\xAB" => "\xEF\xBC\x8B", + "\xA3\xAC" => "\xEF\xBC\x8C", + "\xA3\xAD" => "\xEF\xBC\x8D", + "\xA3\xAE" => "\xEF\xBC\x8E", + "\xA3\xAF" => "\xEF\xBC\x8F", + "\xA3\xB0" => "\xEF\xBC\x90", + "\xA3\xB1" => "\xEF\xBC\x91", + "\xA3\xB2" => "\xEF\xBC\x92", + "\xA3\xB3" => "\xEF\xBC\x93", + "\xA3\xB4" => "\xEF\xBC\x94", + "\xA3\xB5" => "\xEF\xBC\x95", + "\xA3\xB6" => "\xEF\xBC\x96", + "\xA3\xB7" => "\xEF\xBC\x97", + "\xA3\xB8" => "\xEF\xBC\x98", + "\xA3\xB9" => "\xEF\xBC\x99", + "\xA3\xBA" => "\xEF\xBC\x9A", + "\xA3\xBB" => "\xEF\xBC\x9B", + "\xA3\xBC" => "\xEF\xBC\x9C", + "\xA3\xBD" => "\xEF\xBC\x9D", + "\xA3\xBE" => "\xEF\xBC\x9E", + "\xA3\xBF" => "\xEF\xBC\x9F", + "\xA3\xC0" => "\xEF\xBC\xA0", + "\xA3\xC1" => "\xEF\xBC\xA1", + "\xA3\xC2" => "\xEF\xBC\xA2", + "\xA3\xC3" => "\xEF\xBC\xA3", + "\xA3\xC4" => "\xEF\xBC\xA4", + "\xA3\xC5" => "\xEF\xBC\xA5", + "\xA3\xC6" => "\xEF\xBC\xA6", + "\xA3\xC7" => "\xEF\xBC\xA7", + "\xA3\xC8" => "\xEF\xBC\xA8", + "\xA3\xC9" => "\xEF\xBC\xA9", + "\xA3\xCA" => "\xEF\xBC\xAA", + "\xA3\xCB" => "\xEF\xBC\xAB", + "\xA3\xCC" => "\xEF\xBC\xAC", + "\xA3\xCD" => "\xEF\xBC\xAD", + "\xA3\xCE" => "\xEF\xBC\xAE", + "\xA3\xCF" => "\xEF\xBC\xAF", + "\xA3\xD0" => "\xEF\xBC\xB0", + "\xA3\xD1" => "\xEF\xBC\xB1", + "\xA3\xD2" => "\xEF\xBC\xB2", + "\xA3\xD3" => "\xEF\xBC\xB3", + "\xA3\xD4" => "\xEF\xBC\xB4", + "\xA3\xD5" => "\xEF\xBC\xB5", + "\xA3\xD6" => "\xEF\xBC\xB6", + "\xA3\xD7" => "\xEF\xBC\xB7", + "\xA3\xD8" => "\xEF\xBC\xB8", + "\xA3\xD9" => "\xEF\xBC\xB9", + "\xA3\xDA" => "\xEF\xBC\xBA", + "\xA3\xDB" => "\xEF\xBC\xBB", + "\xA3\xDC" => "\xEF\xBC\xBC", + "\xA3\xDD" => "\xEF\xBC\xBD", + "\xA3\xDE" => "\xEF\xBC\xBE", + "\xA3\xDF" => "\xEF\xBC\xBF", + "\xA3\xE0" => "\xEF\xBD\x80", + "\xA3\xE1" => "\xEF\xBD\x81", + "\xA3\xE2" => "\xEF\xBD\x82", + "\xA3\xE3" => "\xEF\xBD\x83", + "\xA3\xE4" => "\xEF\xBD\x84", + "\xA3\xE5" => "\xEF\xBD\x85", + "\xA3\xE6" => "\xEF\xBD\x86", + "\xA3\xE7" => "\xEF\xBD\x87", + "\xA3\xE8" => "\xEF\xBD\x88", + "\xA3\xE9" => "\xEF\xBD\x89", + "\xA3\xEA" => "\xEF\xBD\x8A", + "\xA3\xEB" => "\xEF\xBD\x8B", + "\xA3\xEC" => "\xEF\xBD\x8C", + "\xA3\xED" => "\xEF\xBD\x8D", + "\xA3\xEE" => "\xEF\xBD\x8E", + "\xA3\xEF" => "\xEF\xBD\x8F", + "\xA3\xF0" => "\xEF\xBD\x90", + "\xA3\xF1" => "\xEF\xBD\x91", + "\xA3\xF2" => "\xEF\xBD\x92", + "\xA3\xF3" => "\xEF\xBD\x93", + "\xA3\xF4" => "\xEF\xBD\x94", + "\xA3\xF5" => "\xEF\xBD\x95", + "\xA3\xF6" => "\xEF\xBD\x96", + "\xA3\xF7" => "\xEF\xBD\x97", + "\xA3\xF8" => "\xEF\xBD\x98", + "\xA3\xF9" => "\xEF\xBD\x99", + "\xA3\xFA" => "\xEF\xBD\x9A", + "\xA3\xFB" => "\xEF\xBD\x9B", + "\xA3\xFC" => "\xEF\xBD\x9C", + "\xA3\xFD" => "\xEF\xBD\x9D", + "\xA3\xFE" => "\xEF\xBF\xA3", + "\xA4\xA1" => "\xE3\x81\x81", + "\xA4\xA2" => "\xE3\x81\x82", + "\xA4\xA3" => "\xE3\x81\x83", + "\xA4\xA4" => "\xE3\x81\x84", + "\xA4\xA5" => "\xE3\x81\x85", + "\xA4\xA6" => "\xE3\x81\x86", + "\xA4\xA7" => "\xE3\x81\x87", + "\xA4\xA8" => "\xE3\x81\x88", + "\xA4\xA9" => "\xE3\x81\x89", + "\xA4\xAA" => "\xE3\x81\x8A", + "\xA4\xAB" => "\xE3\x81\x8B", + "\xA4\xAC" => "\xE3\x81\x8C", + "\xA4\xAD" => "\xE3\x81\x8D", + "\xA4\xAE" => "\xE3\x81\x8E", + "\xA4\xAF" => "\xE3\x81\x8F", + "\xA4\xB0" => "\xE3\x81\x90", + "\xA4\xB1" => "\xE3\x81\x91", + "\xA4\xB2" => "\xE3\x81\x92", + "\xA4\xB3" => "\xE3\x81\x93", + "\xA4\xB4" => "\xE3\x81\x94", + "\xA4\xB5" => "\xE3\x81\x95", + "\xA4\xB6" => "\xE3\x81\x96", + "\xA4\xB7" => "\xE3\x81\x97", + "\xA4\xB8" => "\xE3\x81\x98", + "\xA4\xB9" => "\xE3\x81\x99", + "\xA4\xBA" => "\xE3\x81\x9A", + "\xA4\xBB" => "\xE3\x81\x9B", + "\xA4\xBC" => "\xE3\x81\x9C", + "\xA4\xBD" => "\xE3\x81\x9D", + "\xA4\xBE" => "\xE3\x81\x9E", + "\xA4\xBF" => "\xE3\x81\x9F", + "\xA4\xC0" => "\xE3\x81\xA0", + "\xA4\xC1" => "\xE3\x81\xA1", + "\xA4\xC2" => "\xE3\x81\xA2", + "\xA4\xC3" => "\xE3\x81\xA3", + "\xA4\xC4" => "\xE3\x81\xA4", + "\xA4\xC5" => "\xE3\x81\xA5", + "\xA4\xC6" => "\xE3\x81\xA6", + "\xA4\xC7" => "\xE3\x81\xA7", + "\xA4\xC8" => "\xE3\x81\xA8", + "\xA4\xC9" => "\xE3\x81\xA9", + "\xA4\xCA" => "\xE3\x81\xAA", + "\xA4\xCB" => "\xE3\x81\xAB", + "\xA4\xCC" => "\xE3\x81\xAC", + "\xA4\xCD" => "\xE3\x81\xAD", + "\xA4\xCE" => "\xE3\x81\xAE", + "\xA4\xCF" => "\xE3\x81\xAF", + "\xA4\xD0" => "\xE3\x81\xB0", + "\xA4\xD1" => "\xE3\x81\xB1", + "\xA4\xD2" => "\xE3\x81\xB2", + "\xA4\xD3" => "\xE3\x81\xB3", + "\xA4\xD4" => "\xE3\x81\xB4", + "\xA4\xD5" => "\xE3\x81\xB5", + "\xA4\xD6" => "\xE3\x81\xB6", + "\xA4\xD7" => "\xE3\x81\xB7", + "\xA4\xD8" => "\xE3\x81\xB8", + "\xA4\xD9" => "\xE3\x81\xB9", + "\xA4\xDA" => "\xE3\x81\xBA", + "\xA4\xDB" => "\xE3\x81\xBB", + "\xA4\xDC" => "\xE3\x81\xBC", + "\xA4\xDD" => "\xE3\x81\xBD", + "\xA4\xDE" => "\xE3\x81\xBE", + "\xA4\xDF" => "\xE3\x81\xBF", + "\xA4\xE0" => "\xE3\x82\x80", + "\xA4\xE1" => "\xE3\x82\x81", + "\xA4\xE2" => "\xE3\x82\x82", + "\xA4\xE3" => "\xE3\x82\x83", + "\xA4\xE4" => "\xE3\x82\x84", + "\xA4\xE5" => "\xE3\x82\x85", + "\xA4\xE6" => "\xE3\x82\x86", + "\xA4\xE7" => "\xE3\x82\x87", + "\xA4\xE8" => "\xE3\x82\x88", + "\xA4\xE9" => "\xE3\x82\x89", + "\xA4\xEA" => "\xE3\x82\x8A", + "\xA4\xEB" => "\xE3\x82\x8B", + "\xA4\xEC" => "\xE3\x82\x8C", + "\xA4\xED" => "\xE3\x82\x8D", + "\xA4\xEE" => "\xE3\x82\x8E", + "\xA4\xEF" => "\xE3\x82\x8F", + "\xA4\xF0" => "\xE3\x82\x90", + "\xA4\xF1" => "\xE3\x82\x91", + "\xA4\xF2" => "\xE3\x82\x92", + "\xA4\xF3" => "\xE3\x82\x93", + "\xA5\xA1" => "\xE3\x82\xA1", + "\xA5\xA2" => "\xE3\x82\xA2", + "\xA5\xA3" => "\xE3\x82\xA3", + "\xA5\xA4" => "\xE3\x82\xA4", + "\xA5\xA5" => "\xE3\x82\xA5", + "\xA5\xA6" => "\xE3\x82\xA6", + "\xA5\xA7" => "\xE3\x82\xA7", + "\xA5\xA8" => "\xE3\x82\xA8", + "\xA5\xA9" => "\xE3\x82\xA9", + "\xA5\xAA" => "\xE3\x82\xAA", + "\xA5\xAB" => "\xE3\x82\xAB", + "\xA5\xAC" => "\xE3\x82\xAC", + "\xA5\xAD" => "\xE3\x82\xAD", + "\xA5\xAE" => "\xE3\x82\xAE", + "\xA5\xAF" => "\xE3\x82\xAF", + "\xA5\xB0" => "\xE3\x82\xB0", + "\xA5\xB1" => "\xE3\x82\xB1", + "\xA5\xB2" => "\xE3\x82\xB2", + "\xA5\xB3" => "\xE3\x82\xB3", + "\xA5\xB4" => "\xE3\x82\xB4", + "\xA5\xB5" => "\xE3\x82\xB5", + "\xA5\xB6" => "\xE3\x82\xB6", + "\xA5\xB7" => "\xE3\x82\xB7", + "\xA5\xB8" => "\xE3\x82\xB8", + "\xA5\xB9" => "\xE3\x82\xB9", + "\xA5\xBA" => "\xE3\x82\xBA", + "\xA5\xBB" => "\xE3\x82\xBB", + "\xA5\xBC" => "\xE3\x82\xBC", + "\xA5\xBD" => "\xE3\x82\xBD", + "\xA5\xBE" => "\xE3\x82\xBE", + "\xA5\xBF" => "\xE3\x82\xBF", + "\xA5\xC0" => "\xE3\x83\x80", + "\xA5\xC1" => "\xE3\x83\x81", + "\xA5\xC2" => "\xE3\x83\x82", + "\xA5\xC3" => "\xE3\x83\x83", + "\xA5\xC4" => "\xE3\x83\x84", + "\xA5\xC5" => "\xE3\x83\x85", + "\xA5\xC6" => "\xE3\x83\x86", + "\xA5\xC7" => "\xE3\x83\x87", + "\xA5\xC8" => "\xE3\x83\x88", + "\xA5\xC9" => "\xE3\x83\x89", + "\xA5\xCA" => "\xE3\x83\x8A", + "\xA5\xCB" => "\xE3\x83\x8B", + "\xA5\xCC" => "\xE3\x83\x8C", + "\xA5\xCD" => "\xE3\x83\x8D", + "\xA5\xCE" => "\xE3\x83\x8E", + "\xA5\xCF" => "\xE3\x83\x8F", + "\xA5\xD0" => "\xE3\x83\x90", + "\xA5\xD1" => "\xE3\x83\x91", + "\xA5\xD2" => "\xE3\x83\x92", + "\xA5\xD3" => "\xE3\x83\x93", + "\xA5\xD4" => "\xE3\x83\x94", + "\xA5\xD5" => "\xE3\x83\x95", + "\xA5\xD6" => "\xE3\x83\x96", + "\xA5\xD7" => "\xE3\x83\x97", + "\xA5\xD8" => "\xE3\x83\x98", + "\xA5\xD9" => "\xE3\x83\x99", + "\xA5\xDA" => "\xE3\x83\x9A", + "\xA5\xDB" => "\xE3\x83\x9B", + "\xA5\xDC" => "\xE3\x83\x9C", + "\xA5\xDD" => "\xE3\x83\x9D", + "\xA5\xDE" => "\xE3\x83\x9E", + "\xA5\xDF" => "\xE3\x83\x9F", + "\xA5\xE0" => "\xE3\x83\xA0", + "\xA5\xE1" => "\xE3\x83\xA1", + "\xA5\xE2" => "\xE3\x83\xA2", + "\xA5\xE3" => "\xE3\x83\xA3", + "\xA5\xE4" => "\xE3\x83\xA4", + "\xA5\xE5" => "\xE3\x83\xA5", + "\xA5\xE6" => "\xE3\x83\xA6", + "\xA5\xE7" => "\xE3\x83\xA7", + "\xA5\xE8" => "\xE3\x83\xA8", + "\xA5\xE9" => "\xE3\x83\xA9", + "\xA5\xEA" => "\xE3\x83\xAA", + "\xA5\xEB" => "\xE3\x83\xAB", + "\xA5\xEC" => "\xE3\x83\xAC", + "\xA5\xED" => "\xE3\x83\xAD", + "\xA5\xEE" => "\xE3\x83\xAE", + "\xA5\xEF" => "\xE3\x83\xAF", + "\xA5\xF0" => "\xE3\x83\xB0", + "\xA5\xF1" => "\xE3\x83\xB1", + "\xA5\xF2" => "\xE3\x83\xB2", + "\xA5\xF3" => "\xE3\x83\xB3", + "\xA5\xF4" => "\xE3\x83\xB4", + "\xA5\xF5" => "\xE3\x83\xB5", + "\xA5\xF6" => "\xE3\x83\xB6", + "\xA6\xA1" => "\xCE\x91", + "\xA6\xA2" => "\xCE\x92", + "\xA6\xA3" => "\xCE\x93", + "\xA6\xA4" => "\xCE\x94", + "\xA6\xA5" => "\xCE\x95", + "\xA6\xA6" => "\xCE\x96", + "\xA6\xA7" => "\xCE\x97", + "\xA6\xA8" => "\xCE\x98", + "\xA6\xA9" => "\xCE\x99", + "\xA6\xAA" => "\xCE\x9A", + "\xA6\xAB" => "\xCE\x9B", + "\xA6\xAC" => "\xCE\x9C", + "\xA6\xAD" => "\xCE\x9D", + "\xA6\xAE" => "\xCE\x9E", + "\xA6\xAF" => "\xCE\x9F", + "\xA6\xB0" => "\xCE\xA0", + "\xA6\xB1" => "\xCE\xA1", + "\xA6\xB2" => "\xCE\xA3", + "\xA6\xB3" => "\xCE\xA4", + "\xA6\xB4" => "\xCE\xA5", + "\xA6\xB5" => "\xCE\xA6", + "\xA6\xB6" => "\xCE\xA7", + "\xA6\xB7" => "\xCE\xA8", + "\xA6\xB8" => "\xCE\xA9", + "\xA6\xC1" => "\xCE\xB1", + "\xA6\xC2" => "\xCE\xB2", + "\xA6\xC3" => "\xCE\xB3", + "\xA6\xC4" => "\xCE\xB4", + "\xA6\xC5" => "\xCE\xB5", + "\xA6\xC6" => "\xCE\xB6", + "\xA6\xC7" => "\xCE\xB7", + "\xA6\xC8" => "\xCE\xB8", + "\xA6\xC9" => "\xCE\xB9", + "\xA6\xCA" => "\xCE\xBA", + "\xA6\xCB" => "\xCE\xBB", + "\xA6\xCC" => "\xCE\xBC", + "\xA6\xCD" => "\xCE\xBD", + "\xA6\xCE" => "\xCE\xBE", + "\xA6\xCF" => "\xCE\xBF", + "\xA6\xD0" => "\xCF\x80", + "\xA6\xD1" => "\xCF\x81", + "\xA6\xD2" => "\xCF\x83", + "\xA6\xD3" => "\xCF\x84", + "\xA6\xD4" => "\xCF\x85", + "\xA6\xD5" => "\xCF\x86", + "\xA6\xD6" => "\xCF\x87", + "\xA6\xD7" => "\xCF\x88", + "\xA6\xD8" => "\xCF\x89", + "\xA7\xA1" => "\xD0\x90", + "\xA7\xA2" => "\xD0\x91", + "\xA7\xA3" => "\xD0\x92", + "\xA7\xA4" => "\xD0\x93", + "\xA7\xA5" => "\xD0\x94", + "\xA7\xA6" => "\xD0\x95", + "\xA7\xA7" => "\xD0\x81", + "\xA7\xA8" => "\xD0\x96", + "\xA7\xA9" => "\xD0\x97", + "\xA7\xAA" => "\xD0\x98", + "\xA7\xAB" => "\xD0\x99", + "\xA7\xAC" => "\xD0\x9A", + "\xA7\xAD" => "\xD0\x9B", + "\xA7\xAE" => "\xD0\x9C", + "\xA7\xAF" => "\xD0\x9D", + "\xA7\xB0" => "\xD0\x9E", + "\xA7\xB1" => "\xD0\x9F", + "\xA7\xB2" => "\xD0\xA0", + "\xA7\xB3" => "\xD0\xA1", + "\xA7\xB4" => "\xD0\xA2", + "\xA7\xB5" => "\xD0\xA3", + "\xA7\xB6" => "\xD0\xA4", + "\xA7\xB7" => "\xD0\xA5", + "\xA7\xB8" => "\xD0\xA6", + "\xA7\xB9" => "\xD0\xA7", + "\xA7\xBA" => "\xD0\xA8", + "\xA7\xBB" => "\xD0\xA9", + "\xA7\xBC" => "\xD0\xAA", + "\xA7\xBD" => "\xD0\xAB", + "\xA7\xBE" => "\xD0\xAC", + "\xA7\xBF" => "\xD0\xAD", + "\xA7\xC0" => "\xD0\xAE", + "\xA7\xC1" => "\xD0\xAF", + "\xA7\xD1" => "\xD0\xB0", + "\xA7\xD2" => "\xD0\xB1", + "\xA7\xD3" => "\xD0\xB2", + "\xA7\xD4" => "\xD0\xB3", + "\xA7\xD5" => "\xD0\xB4", + "\xA7\xD6" => "\xD0\xB5", + "\xA7\xD7" => "\xD1\x91", + "\xA7\xD8" => "\xD0\xB6", + "\xA7\xD9" => "\xD0\xB7", + "\xA7\xDA" => "\xD0\xB8", + "\xA7\xDB" => "\xD0\xB9", + "\xA7\xDC" => "\xD0\xBA", + "\xA7\xDD" => "\xD0\xBB", + "\xA7\xDE" => "\xD0\xBC", + "\xA7\xDF" => "\xD0\xBD", + "\xA7\xE0" => "\xD0\xBE", + "\xA7\xE1" => "\xD0\xBF", + "\xA7\xE2" => "\xD1\x80", + "\xA7\xE3" => "\xD1\x81", + "\xA7\xE4" => "\xD1\x82", + "\xA7\xE5" => "\xD1\x83", + "\xA7\xE6" => "\xD1\x84", + "\xA7\xE7" => "\xD1\x85", + "\xA7\xE8" => "\xD1\x86", + "\xA7\xE9" => "\xD1\x87", + "\xA7\xEA" => "\xD1\x88", + "\xA7\xEB" => "\xD1\x89", + "\xA7\xEC" => "\xD1\x8A", + "\xA7\xED" => "\xD1\x8B", + "\xA7\xEE" => "\xD1\x8C", + "\xA7\xEF" => "\xD1\x8D", + "\xA7\xF0" => "\xD1\x8E", + "\xA7\xF1" => "\xD1\x8F", + "\xA8\xA1" => "\xC4\x81", + "\xA8\xA2" => "\xC3\xA1", + "\xA8\xA3" => "\xC7\x8E", + "\xA8\xA4" => "\xC3\xA0", + "\xA8\xA5" => "\xC4\x93", + "\xA8\xA6" => "\xC3\xA9", + "\xA8\xA7" => "\xC4\x9B", + "\xA8\xA8" => "\xC3\xA8", + "\xA8\xA9" => "\xC4\xAB", + "\xA8\xAA" => "\xC3\xAD", + "\xA8\xAB" => "\xC7\x90", + "\xA8\xAC" => "\xC3\xAC", + "\xA8\xAD" => "\xC5\x8D", + "\xA8\xAE" => "\xC3\xB3", + "\xA8\xAF" => "\xC7\x92", + "\xA8\xB0" => "\xC3\xB2", + "\xA8\xB1" => "\xC5\xAB", + "\xA8\xB2" => "\xC3\xBA", + "\xA8\xB3" => "\xC7\x94", + "\xA8\xB4" => "\xC3\xB9", + "\xA8\xB5" => "\xC7\x96", + "\xA8\xB6" => "\xC7\x98", + "\xA8\xB7" => "\xC7\x9A", + "\xA8\xB8" => "\xC7\x9C", + "\xA8\xB9" => "\xC3\xBC", + "\xA8\xBA" => "\xC3\xAA", + "\xA8\xC5" => "\xE3\x84\x85", + "\xA8\xC6" => "\xE3\x84\x86", + "\xA8\xC7" => "\xE3\x84\x87", + "\xA8\xC8" => "\xE3\x84\x88", + "\xA8\xC9" => "\xE3\x84\x89", + "\xA8\xCA" => "\xE3\x84\x8A", + "\xA8\xCB" => "\xE3\x84\x8B", + "\xA8\xCC" => "\xE3\x84\x8C", + "\xA8\xCD" => "\xE3\x84\x8D", + "\xA8\xCE" => "\xE3\x84\x8E", + "\xA8\xCF" => "\xE3\x84\x8F", + "\xA8\xD0" => "\xE3\x84\x90", + "\xA8\xD1" => "\xE3\x84\x91", + "\xA8\xD2" => "\xE3\x84\x92", + "\xA8\xD3" => "\xE3\x84\x93", + "\xA8\xD4" => "\xE3\x84\x94", + "\xA8\xD5" => "\xE3\x84\x95", + "\xA8\xD6" => "\xE3\x84\x96", + "\xA8\xD7" => "\xE3\x84\x97", + "\xA8\xD8" => "\xE3\x84\x98", + "\xA8\xD9" => "\xE3\x84\x99", + "\xA8\xDA" => "\xE3\x84\x9A", + "\xA8\xDB" => "\xE3\x84\x9B", + "\xA8\xDC" => "\xE3\x84\x9C", + "\xA8\xDD" => "\xE3\x84\x9D", + "\xA8\xDE" => "\xE3\x84\x9E", + "\xA8\xDF" => "\xE3\x84\x9F", + "\xA8\xE0" => "\xE3\x84\xA0", + "\xA8\xE1" => "\xE3\x84\xA1", + "\xA8\xE2" => "\xE3\x84\xA2", + "\xA8\xE3" => "\xE3\x84\xA3", + "\xA8\xE4" => "\xE3\x84\xA4", + "\xA8\xE5" => "\xE3\x84\xA5", + "\xA8\xE6" => "\xE3\x84\xA6", + "\xA8\xE7" => "\xE3\x84\xA7", + "\xA8\xE8" => "\xE3\x84\xA8", + "\xA8\xE9" => "\xE3\x84\xA9", + "\xA9\xA4" => "\xE2\x94\x80", + "\xA9\xA5" => "\xE2\x94\x81", + "\xA9\xA6" => "\xE2\x94\x82", + "\xA9\xA7" => "\xE2\x94\x83", + "\xA9\xA8" => "\xE2\x94\x84", + "\xA9\xA9" => "\xE2\x94\x85", + "\xA9\xAA" => "\xE2\x94\x86", + "\xA9\xAB" => "\xE2\x94\x87", + "\xA9\xAC" => "\xE2\x94\x88", + "\xA9\xAD" => "\xE2\x94\x89", + "\xA9\xAE" => "\xE2\x94\x8A", + "\xA9\xAF" => "\xE2\x94\x8B", + "\xA9\xB0" => "\xE2\x94\x8C", + "\xA9\xB1" => "\xE2\x94\x8D", + "\xA9\xB2" => "\xE2\x94\x8E", + "\xA9\xB3" => "\xE2\x94\x8F", + "\xA9\xB4" => "\xE2\x94\x90", + "\xA9\xB5" => "\xE2\x94\x91", + "\xA9\xB6" => "\xE2\x94\x92", + "\xA9\xB7" => "\xE2\x94\x93", + "\xA9\xB8" => "\xE2\x94\x94", + "\xA9\xB9" => "\xE2\x94\x95", + "\xA9\xBA" => "\xE2\x94\x96", + "\xA9\xBB" => "\xE2\x94\x97", + "\xA9\xBC" => "\xE2\x94\x98", + "\xA9\xBD" => "\xE2\x94\x99", + "\xA9\xBE" => "\xE2\x94\x9A", + "\xA9\xBF" => "\xE2\x94\x9B", + "\xA9\xC0" => "\xE2\x94\x9C", + "\xA9\xC1" => "\xE2\x94\x9D", + "\xA9\xC2" => "\xE2\x94\x9E", + "\xA9\xC3" => "\xE2\x94\x9F", + "\xA9\xC4" => "\xE2\x94\xA0", + "\xA9\xC5" => "\xE2\x94\xA1", + "\xA9\xC6" => "\xE2\x94\xA2", + "\xA9\xC7" => "\xE2\x94\xA3", + "\xA9\xC8" => "\xE2\x94\xA4", + "\xA9\xC9" => "\xE2\x94\xA5", + "\xA9\xCA" => "\xE2\x94\xA6", + "\xA9\xCB" => "\xE2\x94\xA7", + "\xA9\xCC" => "\xE2\x94\xA8", + "\xA9\xCD" => "\xE2\x94\xA9", + "\xA9\xCE" => "\xE2\x94\xAA", + "\xA9\xCF" => "\xE2\x94\xAB", + "\xA9\xD0" => "\xE2\x94\xAC", + "\xA9\xD1" => "\xE2\x94\xAD", + "\xA9\xD2" => "\xE2\x94\xAE", + "\xA9\xD3" => "\xE2\x94\xAF", + "\xA9\xD4" => "\xE2\x94\xB0", + "\xA9\xD5" => "\xE2\x94\xB1", + "\xA9\xD6" => "\xE2\x94\xB2", + "\xA9\xD7" => "\xE2\x94\xB3", + "\xA9\xD8" => "\xE2\x94\xB4", + "\xA9\xD9" => "\xE2\x94\xB5", + "\xA9\xDA" => "\xE2\x94\xB6", + "\xA9\xDB" => "\xE2\x94\xB7", + "\xA9\xDC" => "\xE2\x94\xB8", + "\xA9\xDD" => "\xE2\x94\xB9", + "\xA9\xDE" => "\xE2\x94\xBA", + "\xA9\xDF" => "\xE2\x94\xBB", + "\xA9\xE0" => "\xE2\x94\xBC", + "\xA9\xE1" => "\xE2\x94\xBD", + "\xA9\xE2" => "\xE2\x94\xBE", + "\xA9\xE3" => "\xE2\x94\xBF", + "\xA9\xE4" => "\xE2\x95\x80", + "\xA9\xE5" => "\xE2\x95\x81", + "\xA9\xE6" => "\xE2\x95\x82", + "\xA9\xE7" => "\xE2\x95\x83", + "\xA9\xE8" => "\xE2\x95\x84", + "\xA9\xE9" => "\xE2\x95\x85", + "\xA9\xEA" => "\xE2\x95\x86", + "\xA9\xEB" => "\xE2\x95\x87", + "\xA9\xEC" => "\xE2\x95\x88", + "\xA9\xED" => "\xE2\x95\x89", + "\xA9\xEE" => "\xE2\x95\x8A", + "\xA9\xEF" => "\xE2\x95\x8B", + "\xB0\xA1" => "\xE5\x95\x8A", + "\xB0\xA2" => "\xE9\x98\xBF", + "\xB0\xA3" => "\xE5\x9F\x83", + "\xB0\xA4" => "\xE6\x8C\xA8", + "\xB0\xA5" => "\xE5\x93\x8E", + "\xB0\xA6" => "\xE5\x94\x89", + "\xB0\xA7" => "\xE5\x93\x80", + "\xB0\xA8" => "\xE7\x9A\x91", + "\xB0\xA9" => "\xE7\x99\x8C", + "\xB0\xAA" => "\xE8\x94\xBC", + "\xB0\xAB" => "\xE7\x9F\xAE", + "\xB0\xAC" => "\xE8\x89\xBE", + "\xB0\xAD" => "\xE7\xA2\x8D", + "\xB0\xAE" => "\xE7\x88\xB1", + "\xB0\xAF" => "\xE9\x9A\x98", + "\xB0\xB0" => "\xE9\x9E\x8D", + "\xB0\xB1" => "\xE6\xB0\xA8", + "\xB0\xB2" => "\xE5\xAE\x89", + "\xB0\xB3" => "\xE4\xBF\xBA", + "\xB0\xB4" => "\xE6\x8C\x89", + "\xB0\xB5" => "\xE6\x9A\x97", + "\xB0\xB6" => "\xE5\xB2\xB8", + "\xB0\xB7" => "\xE8\x83\xBA", + "\xB0\xB8" => "\xE6\xA1\x88", + "\xB0\xB9" => "\xE8\x82\xAE", + "\xB0\xBA" => "\xE6\x98\x82", + "\xB0\xBB" => "\xE7\x9B\x8E", + "\xB0\xBC" => "\xE5\x87\xB9", + "\xB0\xBD" => "\xE6\x95\x96", + "\xB0\xBE" => "\xE7\x86\xAC", + "\xB0\xBF" => "\xE7\xBF\xB1", + "\xB0\xC0" => "\xE8\xA2\x84", + "\xB0\xC1" => "\xE5\x82\xB2", + "\xB0\xC2" => "\xE5\xA5\xA5", + "\xB0\xC3" => "\xE6\x87\x8A", + "\xB0\xC4" => "\xE6\xBE\xB3", + "\xB0\xC5" => "\xE8\x8A\xAD", + "\xB0\xC6" => "\xE6\x8D\x8C", + "\xB0\xC7" => "\xE6\x89\x92", + "\xB0\xC8" => "\xE5\x8F\xAD", + "\xB0\xC9" => "\xE5\x90\xA7", + "\xB0\xCA" => "\xE7\xAC\x86", + "\xB0\xCB" => "\xE5\x85\xAB", + "\xB0\xCC" => "\xE7\x96\xA4", + "\xB0\xCD" => "\xE5\xB7\xB4", + "\xB0\xCE" => "\xE6\x8B\x94", + "\xB0\xCF" => "\xE8\xB7\x8B", + "\xB0\xD0" => "\xE9\x9D\xB6", + "\xB0\xD1" => "\xE6\x8A\x8A", + "\xB0\xD2" => "\xE8\x80\x99", + "\xB0\xD3" => "\xE5\x9D\x9D", + "\xB0\xD4" => "\xE9\x9C\xB8", + "\xB0\xD5" => "\xE7\xBD\xA2", + "\xB0\xD6" => "\xE7\x88\xB8", + "\xB0\xD7" => "\xE7\x99\xBD", + "\xB0\xD8" => "\xE6\x9F\x8F", + "\xB0\xD9" => "\xE7\x99\xBE", + "\xB0\xDA" => "\xE6\x91\x86", + "\xB0\xDB" => "\xE4\xBD\xB0", + "\xB0\xDC" => "\xE8\xB4\xA5", + "\xB0\xDD" => "\xE6\x8B\x9C", + "\xB0\xDE" => "\xE7\xA8\x97", + "\xB0\xDF" => "\xE6\x96\x91", + "\xB0\xE0" => "\xE7\x8F\xAD", + "\xB0\xE1" => "\xE6\x90\xAC", + "\xB0\xE2" => "\xE6\x89\xB3", + "\xB0\xE3" => "\xE8\x88\xAC", + "\xB0\xE4" => "\xE9\xA2\x81", + "\xB0\xE5" => "\xE6\x9D\xBF", + "\xB0\xE6" => "\xE7\x89\x88", + "\xB0\xE7" => "\xE6\x89\xAE", + "\xB0\xE8" => "\xE6\x8B\x8C", + "\xB0\xE9" => "\xE4\xBC\xB4", + "\xB0\xEA" => "\xE7\x93\xA3", + "\xB0\xEB" => "\xE5\x8D\x8A", + "\xB0\xEC" => "\xE5\x8A\x9E", + "\xB0\xED" => "\xE7\xBB\x8A", + "\xB0\xEE" => "\xE9\x82\xA6", + "\xB0\xEF" => "\xE5\xB8\xAE", + "\xB0\xF0" => "\xE6\xA2\x86", + "\xB0\xF1" => "\xE6\xA6\x9C", + "\xB0\xF2" => "\xE8\x86\x80", + "\xB0\xF3" => "\xE7\xBB\x91", + "\xB0\xF4" => "\xE6\xA3\x92", + "\xB0\xF5" => "\xE7\xA3\x85", + "\xB0\xF6" => "\xE8\x9A\x8C", + "\xB0\xF7" => "\xE9\x95\x91", + "\xB0\xF8" => "\xE5\x82\x8D", + "\xB0\xF9" => "\xE8\xB0\xA4", + "\xB0\xFA" => "\xE8\x8B\x9E", + "\xB0\xFB" => "\xE8\x83\x9E", + "\xB0\xFC" => "\xE5\x8C\x85", + "\xB0\xFD" => "\xE8\xA4\x92", + "\xB0\xFE" => "\xE5\x89\xA5", + "\xB1\xA1" => "\xE8\x96\x84", + "\xB1\xA2" => "\xE9\x9B\xB9", + "\xB1\xA3" => "\xE4\xBF\x9D", + "\xB1\xA4" => "\xE5\xA0\xA1", + "\xB1\xA5" => "\xE9\xA5\xB1", + "\xB1\xA6" => "\xE5\xAE\x9D", + "\xB1\xA7" => "\xE6\x8A\xB1", + "\xB1\xA8" => "\xE6\x8A\xA5", + "\xB1\xA9" => "\xE6\x9A\xB4", + "\xB1\xAA" => "\xE8\xB1\xB9", + "\xB1\xAB" => "\xE9\xB2\x8D", + "\xB1\xAC" => "\xE7\x88\x86", + "\xB1\xAD" => "\xE6\x9D\xAF", + "\xB1\xAE" => "\xE7\xA2\x91", + "\xB1\xAF" => "\xE6\x82\xB2", + "\xB1\xB0" => "\xE5\x8D\x91", + "\xB1\xB1" => "\xE5\x8C\x97", + "\xB1\xB2" => "\xE8\xBE\x88", + "\xB1\xB3" => "\xE8\x83\x8C", + "\xB1\xB4" => "\xE8\xB4\x9D", + "\xB1\xB5" => "\xE9\x92\xA1", + "\xB1\xB6" => "\xE5\x80\x8D", + "\xB1\xB7" => "\xE7\x8B\x88", + "\xB1\xB8" => "\xE5\xA4\x87", + "\xB1\xB9" => "\xE6\x83\xAB", + "\xB1\xBA" => "\xE7\x84\x99", + "\xB1\xBB" => "\xE8\xA2\xAB", + "\xB1\xBC" => "\xE5\xA5\x94", + "\xB1\xBD" => "\xE8\x8B\xAF", + "\xB1\xBE" => "\xE6\x9C\xAC", + "\xB1\xBF" => "\xE7\xAC\xA8", + "\xB1\xC0" => "\xE5\xB4\xA9", + "\xB1\xC1" => "\xE7\xBB\xB7", + "\xB1\xC2" => "\xE7\x94\xAD", + "\xB1\xC3" => "\xE6\xB3\xB5", + "\xB1\xC4" => "\xE8\xB9\xA6", + "\xB1\xC5" => "\xE8\xBF\xB8", + "\xB1\xC6" => "\xE9\x80\xBC", + "\xB1\xC7" => "\xE9\xBC\xBB", + "\xB1\xC8" => "\xE6\xAF\x94", + "\xB1\xC9" => "\xE9\x84\x99", + "\xB1\xCA" => "\xE7\xAC\x94", + "\xB1\xCB" => "\xE5\xBD\xBC", + "\xB1\xCC" => "\xE7\xA2\xA7", + "\xB1\xCD" => "\xE8\x93\x96", + "\xB1\xCE" => "\xE8\x94\xBD", + "\xB1\xCF" => "\xE6\xAF\x95", + "\xB1\xD0" => "\xE6\xAF\x99", + "\xB1\xD1" => "\xE6\xAF\x96", + "\xB1\xD2" => "\xE5\xB8\x81", + "\xB1\xD3" => "\xE5\xBA\x87", + "\xB1\xD4" => "\xE7\x97\xB9", + "\xB1\xD5" => "\xE9\x97\xAD", + "\xB1\xD6" => "\xE6\x95\x9D", + "\xB1\xD7" => "\xE5\xBC\x8A", + "\xB1\xD8" => "\xE5\xBF\x85", + "\xB1\xD9" => "\xE8\xBE\x9F", + "\xB1\xDA" => "\xE5\xA3\x81", + "\xB1\xDB" => "\xE8\x87\x82", + "\xB1\xDC" => "\xE9\x81\xBF", + "\xB1\xDD" => "\xE9\x99\x9B", + "\xB1\xDE" => "\xE9\x9E\xAD", + "\xB1\xDF" => "\xE8\xBE\xB9", + "\xB1\xE0" => "\xE7\xBC\x96", + "\xB1\xE1" => "\xE8\xB4\xAC", + "\xB1\xE2" => "\xE6\x89\x81", + "\xB1\xE3" => "\xE4\xBE\xBF", + "\xB1\xE4" => "\xE5\x8F\x98", + "\xB1\xE5" => "\xE5\x8D\x9E", + "\xB1\xE6" => "\xE8\xBE\xA8", + "\xB1\xE7" => "\xE8\xBE\xA9", + "\xB1\xE8" => "\xE8\xBE\xAB", + "\xB1\xE9" => "\xE9\x81\x8D", + "\xB1\xEA" => "\xE6\xA0\x87", + "\xB1\xEB" => "\xE5\xBD\xAA", + "\xB1\xEC" => "\xE8\x86\x98", + "\xB1\xED" => "\xE8\xA1\xA8", + "\xB1\xEE" => "\xE9\xB3\x96", + "\xB1\xEF" => "\xE6\x86\x8B", + "\xB1\xF0" => "\xE5\x88\xAB", + "\xB1\xF1" => "\xE7\x98\xAA", + "\xB1\xF2" => "\xE5\xBD\xAC", + "\xB1\xF3" => "\xE6\x96\x8C", + "\xB1\xF4" => "\xE6\xBF\x92", + "\xB1\xF5" => "\xE6\xBB\xA8", + "\xB1\xF6" => "\xE5\xAE\xBE", + "\xB1\xF7" => "\xE6\x91\x88", + "\xB1\xF8" => "\xE5\x85\xB5", + "\xB1\xF9" => "\xE5\x86\xB0", + "\xB1\xFA" => "\xE6\x9F\x84", + "\xB1\xFB" => "\xE4\xB8\x99", + "\xB1\xFC" => "\xE7\xA7\x89", + "\xB1\xFD" => "\xE9\xA5\xBC", + "\xB1\xFE" => "\xE7\x82\xB3", + "\xB2\xA1" => "\xE7\x97\x85", + "\xB2\xA2" => "\xE5\xB9\xB6", + "\xB2\xA3" => "\xE7\x8E\xBB", + "\xB2\xA4" => "\xE8\x8F\xA0", + "\xB2\xA5" => "\xE6\x92\xAD", + "\xB2\xA6" => "\xE6\x8B\xA8", + "\xB2\xA7" => "\xE9\x92\xB5", + "\xB2\xA8" => "\xE6\xB3\xA2", + "\xB2\xA9" => "\xE5\x8D\x9A", + "\xB2\xAA" => "\xE5\x8B\x83", + "\xB2\xAB" => "\xE6\x90\x8F", + "\xB2\xAC" => "\xE9\x93\x82", + "\xB2\xAD" => "\xE7\xAE\x94", + "\xB2\xAE" => "\xE4\xBC\xAF", + "\xB2\xAF" => "\xE5\xB8\x9B", + "\xB2\xB0" => "\xE8\x88\xB6", + "\xB2\xB1" => "\xE8\x84\x96", + "\xB2\xB2" => "\xE8\x86\x8A", + "\xB2\xB3" => "\xE6\xB8\xA4", + "\xB2\xB4" => "\xE6\xB3\x8A", + "\xB2\xB5" => "\xE9\xA9\xB3", + "\xB2\xB6" => "\xE6\x8D\x95", + "\xB2\xB7" => "\xE5\x8D\x9C", + "\xB2\xB8" => "\xE5\x93\xBA", + "\xB2\xB9" => "\xE8\xA1\xA5", + "\xB2\xBA" => "\xE5\x9F\xA0", + "\xB2\xBB" => "\xE4\xB8\x8D", + "\xB2\xBC" => "\xE5\xB8\x83", + "\xB2\xBD" => "\xE6\xAD\xA5", + "\xB2\xBE" => "\xE7\xB0\xBF", + "\xB2\xBF" => "\xE9\x83\xA8", + "\xB2\xC0" => "\xE6\x80\x96", + "\xB2\xC1" => "\xE6\x93\xA6", + "\xB2\xC2" => "\xE7\x8C\x9C", + "\xB2\xC3" => "\xE8\xA3\x81", + "\xB2\xC4" => "\xE6\x9D\x90", + "\xB2\xC5" => "\xE6\x89\x8D", + "\xB2\xC6" => "\xE8\xB4\xA2", + "\xB2\xC7" => "\xE7\x9D\xAC", + "\xB2\xC8" => "\xE8\xB8\xA9", + "\xB2\xC9" => "\xE9\x87\x87", + "\xB2\xCA" => "\xE5\xBD\xA9", + "\xB2\xCB" => "\xE8\x8F\x9C", + "\xB2\xCC" => "\xE8\x94\xA1", + "\xB2\xCD" => "\xE9\xA4\x90", + "\xB2\xCE" => "\xE5\x8F\x82", + "\xB2\xCF" => "\xE8\x9A\x95", + "\xB2\xD0" => "\xE6\xAE\x8B", + "\xB2\xD1" => "\xE6\x83\xAD", + "\xB2\xD2" => "\xE6\x83\xA8", + "\xB2\xD3" => "\xE7\x81\xBF", + "\xB2\xD4" => "\xE8\x8B\x8D", + "\xB2\xD5" => "\xE8\x88\xB1", + "\xB2\xD6" => "\xE4\xBB\x93", + "\xB2\xD7" => "\xE6\xB2\xA7", + "\xB2\xD8" => "\xE8\x97\x8F", + "\xB2\xD9" => "\xE6\x93\x8D", + "\xB2\xDA" => "\xE7\xB3\x99", + "\xB2\xDB" => "\xE6\xA7\xBD", + "\xB2\xDC" => "\xE6\x9B\xB9", + "\xB2\xDD" => "\xE8\x8D\x89", + "\xB2\xDE" => "\xE5\x8E\x95", + "\xB2\xDF" => "\xE7\xAD\x96", + "\xB2\xE0" => "\xE4\xBE\xA7", + "\xB2\xE1" => "\xE5\x86\x8C", + "\xB2\xE2" => "\xE6\xB5\x8B", + "\xB2\xE3" => "\xE5\xB1\x82", + "\xB2\xE4" => "\xE8\xB9\xAD", + "\xB2\xE5" => "\xE6\x8F\x92", + "\xB2\xE6" => "\xE5\x8F\x89", + "\xB2\xE7" => "\xE8\x8C\xAC", + "\xB2\xE8" => "\xE8\x8C\xB6", + "\xB2\xE9" => "\xE6\x9F\xA5", + "\xB2\xEA" => "\xE7\xA2\xB4", + "\xB2\xEB" => "\xE6\x90\xBD", + "\xB2\xEC" => "\xE5\xAF\x9F", + "\xB2\xED" => "\xE5\xB2\x94", + "\xB2\xEE" => "\xE5\xB7\xAE", + "\xB2\xEF" => "\xE8\xAF\xA7", + "\xB2\xF0" => "\xE6\x8B\x86", + "\xB2\xF1" => "\xE6\x9F\xB4", + "\xB2\xF2" => "\xE8\xB1\xBA", + "\xB2\xF3" => "\xE6\x90\x80", + "\xB2\xF4" => "\xE6\x8E\xBA", + "\xB2\xF5" => "\xE8\x9D\x89", + "\xB2\xF6" => "\xE9\xA6\x8B", + "\xB2\xF7" => "\xE8\xB0\x97", + "\xB2\xF8" => "\xE7\xBC\xA0", + "\xB2\xF9" => "\xE9\x93\xB2", + "\xB2\xFA" => "\xE4\xBA\xA7", + "\xB2\xFB" => "\xE9\x98\x90", + "\xB2\xFC" => "\xE9\xA2\xA4", + "\xB2\xFD" => "\xE6\x98\x8C", + "\xB2\xFE" => "\xE7\x8C\x96", + "\xB3\xA1" => "\xE5\x9C\xBA", + "\xB3\xA2" => "\xE5\xB0\x9D", + "\xB3\xA3" => "\xE5\xB8\xB8", + "\xB3\xA4" => "\xE9\x95\xBF", + "\xB3\xA5" => "\xE5\x81\xBF", + "\xB3\xA6" => "\xE8\x82\xA0", + "\xB3\xA7" => "\xE5\x8E\x82", + "\xB3\xA8" => "\xE6\x95\x9E", + "\xB3\xA9" => "\xE7\x95\x85", + "\xB3\xAA" => "\xE5\x94\xB1", + "\xB3\xAB" => "\xE5\x80\xA1", + "\xB3\xAC" => "\xE8\xB6\x85", + "\xB3\xAD" => "\xE6\x8A\x84", + "\xB3\xAE" => "\xE9\x92\x9E", + "\xB3\xAF" => "\xE6\x9C\x9D", + "\xB3\xB0" => "\xE5\x98\xB2", + "\xB3\xB1" => "\xE6\xBD\xAE", + "\xB3\xB2" => "\xE5\xB7\xA2", + "\xB3\xB3" => "\xE5\x90\xB5", + "\xB3\xB4" => "\xE7\x82\x92", + "\xB3\xB5" => "\xE8\xBD\xA6", + "\xB3\xB6" => "\xE6\x89\xAF", + "\xB3\xB7" => "\xE6\x92\xA4", + "\xB3\xB8" => "\xE6\x8E\xA3", + "\xB3\xB9" => "\xE5\xBD\xBB", + "\xB3\xBA" => "\xE6\xBE\x88", + "\xB3\xBB" => "\xE9\x83\xB4", + "\xB3\xBC" => "\xE8\x87\xA3", + "\xB3\xBD" => "\xE8\xBE\xB0", + "\xB3\xBE" => "\xE5\xB0\x98", + "\xB3\xBF" => "\xE6\x99\xA8", + "\xB3\xC0" => "\xE5\xBF\xB1", + "\xB3\xC1" => "\xE6\xB2\x89", + "\xB3\xC2" => "\xE9\x99\x88", + "\xB3\xC3" => "\xE8\xB6\x81", + "\xB3\xC4" => "\xE8\xA1\xAC", + "\xB3\xC5" => "\xE6\x92\x91", + "\xB3\xC6" => "\xE7\xA7\xB0", + "\xB3\xC7" => "\xE5\x9F\x8E", + "\xB3\xC8" => "\xE6\xA9\x99", + "\xB3\xC9" => "\xE6\x88\x90", + "\xB3\xCA" => "\xE5\x91\x88", + "\xB3\xCB" => "\xE4\xB9\x98", + "\xB3\xCC" => "\xE7\xA8\x8B", + "\xB3\xCD" => "\xE6\x83\xA9", + "\xB3\xCE" => "\xE6\xBE\x84", + "\xB3\xCF" => "\xE8\xAF\x9A", + "\xB3\xD0" => "\xE6\x89\xBF", + "\xB3\xD1" => "\xE9\x80\x9E", + "\xB3\xD2" => "\xE9\xAA\x8B", + "\xB3\xD3" => "\xE7\xA7\xA4", + "\xB3\xD4" => "\xE5\x90\x83", + "\xB3\xD5" => "\xE7\x97\xB4", + "\xB3\xD6" => "\xE6\x8C\x81", + "\xB3\xD7" => "\xE5\x8C\x99", + "\xB3\xD8" => "\xE6\xB1\xA0", + "\xB3\xD9" => "\xE8\xBF\x9F", + "\xB3\xDA" => "\xE5\xBC\x9B", + "\xB3\xDB" => "\xE9\xA9\xB0", + "\xB3\xDC" => "\xE8\x80\xBB", + "\xB3\xDD" => "\xE9\xBD\xBF", + "\xB3\xDE" => "\xE4\xBE\x88", + "\xB3\xDF" => "\xE5\xB0\xBA", + "\xB3\xE0" => "\xE8\xB5\xA4", + "\xB3\xE1" => "\xE7\xBF\x85", + "\xB3\xE2" => "\xE6\x96\xA5", + "\xB3\xE3" => "\xE7\x82\xBD", + "\xB3\xE4" => "\xE5\x85\x85", + "\xB3\xE5" => "\xE5\x86\xB2", + "\xB3\xE6" => "\xE8\x99\xAB", + "\xB3\xE7" => "\xE5\xB4\x87", + "\xB3\xE8" => "\xE5\xAE\xA0", + "\xB3\xE9" => "\xE6\x8A\xBD", + "\xB3\xEA" => "\xE9\x85\xAC", + "\xB3\xEB" => "\xE7\x95\xB4", + "\xB3\xEC" => "\xE8\xB8\x8C", + "\xB3\xED" => "\xE7\xA8\xA0", + "\xB3\xEE" => "\xE6\x84\x81", + "\xB3\xEF" => "\xE7\xAD\xB9", + "\xB3\xF0" => "\xE4\xBB\x87", + "\xB3\xF1" => "\xE7\xBB\xB8", + "\xB3\xF2" => "\xE7\x9E\x85", + "\xB3\xF3" => "\xE4\xB8\x91", + "\xB3\xF4" => "\xE8\x87\xAD", + "\xB3\xF5" => "\xE5\x88\x9D", + "\xB3\xF6" => "\xE5\x87\xBA", + "\xB3\xF7" => "\xE6\xA9\xB1", + "\xB3\xF8" => "\xE5\x8E\xA8", + "\xB3\xF9" => "\xE8\xBA\x87", + "\xB3\xFA" => "\xE9\x94\x84", + "\xB3\xFB" => "\xE9\x9B\x8F", + "\xB3\xFC" => "\xE6\xBB\x81", + "\xB3\xFD" => "\xE9\x99\xA4", + "\xB3\xFE" => "\xE6\xA5\x9A", + "\xB4\xA1" => "\xE7\xA1\x80", + "\xB4\xA2" => "\xE5\x82\xA8", + "\xB4\xA3" => "\xE7\x9F\x97", + "\xB4\xA4" => "\xE6\x90\x90", + "\xB4\xA5" => "\xE8\xA7\xA6", + "\xB4\xA6" => "\xE5\xA4\x84", + "\xB4\xA7" => "\xE6\x8F\xA3", + "\xB4\xA8" => "\xE5\xB7\x9D", + "\xB4\xA9" => "\xE7\xA9\xBF", + "\xB4\xAA" => "\xE6\xA4\xBD", + "\xB4\xAB" => "\xE4\xBC\xA0", + "\xB4\xAC" => "\xE8\x88\xB9", + "\xB4\xAD" => "\xE5\x96\x98", + "\xB4\xAE" => "\xE4\xB8\xB2", + "\xB4\xAF" => "\xE7\x96\xAE", + "\xB4\xB0" => "\xE7\xAA\x97", + "\xB4\xB1" => "\xE5\xB9\xA2", + "\xB4\xB2" => "\xE5\xBA\x8A", + "\xB4\xB3" => "\xE9\x97\xAF", + "\xB4\xB4" => "\xE5\x88\x9B", + "\xB4\xB5" => "\xE5\x90\xB9", + "\xB4\xB6" => "\xE7\x82\x8A", + "\xB4\xB7" => "\xE6\x8D\xB6", + "\xB4\xB8" => "\xE9\x94\xA4", + "\xB4\xB9" => "\xE5\x9E\x82", + "\xB4\xBA" => "\xE6\x98\xA5", + "\xB4\xBB" => "\xE6\xA4\xBF", + "\xB4\xBC" => "\xE9\x86\x87", + "\xB4\xBD" => "\xE5\x94\x87", + "\xB4\xBE" => "\xE6\xB7\xB3", + "\xB4\xBF" => "\xE7\xBA\xAF", + "\xB4\xC0" => "\xE8\xA0\xA2", + "\xB4\xC1" => "\xE6\x88\xB3", + "\xB4\xC2" => "\xE7\xBB\xB0", + "\xB4\xC3" => "\xE7\x96\xB5", + "\xB4\xC4" => "\xE8\x8C\xA8", + "\xB4\xC5" => "\xE7\xA3\x81", + "\xB4\xC6" => "\xE9\x9B\x8C", + "\xB4\xC7" => "\xE8\xBE\x9E", + "\xB4\xC8" => "\xE6\x85\x88", + "\xB4\xC9" => "\xE7\x93\xB7", + "\xB4\xCA" => "\xE8\xAF\x8D", + "\xB4\xCB" => "\xE6\xAD\xA4", + "\xB4\xCC" => "\xE5\x88\xBA", + "\xB4\xCD" => "\xE8\xB5\x90", + "\xB4\xCE" => "\xE6\xAC\xA1", + "\xB4\xCF" => "\xE8\x81\xAA", + "\xB4\xD0" => "\xE8\x91\xB1", + "\xB4\xD1" => "\xE5\x9B\xB1", + "\xB4\xD2" => "\xE5\x8C\x86", + "\xB4\xD3" => "\xE4\xBB\x8E", + "\xB4\xD4" => "\xE4\xB8\x9B", + "\xB4\xD5" => "\xE5\x87\x91", + "\xB4\xD6" => "\xE7\xB2\x97", + "\xB4\xD7" => "\xE9\x86\x8B", + "\xB4\xD8" => "\xE7\xB0\x87", + "\xB4\xD9" => "\xE4\xBF\x83", + "\xB4\xDA" => "\xE8\xB9\xBF", + "\xB4\xDB" => "\xE7\xAF\xA1", + "\xB4\xDC" => "\xE7\xAA\x9C", + "\xB4\xDD" => "\xE6\x91\xA7", + "\xB4\xDE" => "\xE5\xB4\x94", + "\xB4\xDF" => "\xE5\x82\xAC", + "\xB4\xE0" => "\xE8\x84\x86", + "\xB4\xE1" => "\xE7\x98\x81", + "\xB4\xE2" => "\xE7\xB2\xB9", + "\xB4\xE3" => "\xE6\xB7\xAC", + "\xB4\xE4" => "\xE7\xBF\xA0", + "\xB4\xE5" => "\xE6\x9D\x91", + "\xB4\xE6" => "\xE5\xAD\x98", + "\xB4\xE7" => "\xE5\xAF\xB8", + "\xB4\xE8" => "\xE7\xA3\x8B", + "\xB4\xE9" => "\xE6\x92\xAE", + "\xB4\xEA" => "\xE6\x90\x93", + "\xB4\xEB" => "\xE6\x8E\xAA", + "\xB4\xEC" => "\xE6\x8C\xAB", + "\xB4\xED" => "\xE9\x94\x99", + "\xB4\xEE" => "\xE6\x90\xAD", + "\xB4\xEF" => "\xE8\xBE\xBE", + "\xB4\xF0" => "\xE7\xAD\x94", + "\xB4\xF1" => "\xE7\x98\xA9", + "\xB4\xF2" => "\xE6\x89\x93", + "\xB4\xF3" => "\xE5\xA4\xA7", + "\xB4\xF4" => "\xE5\x91\x86", + "\xB4\xF5" => "\xE6\xAD\xB9", + "\xB4\xF6" => "\xE5\x82\xA3", + "\xB4\xF7" => "\xE6\x88\xB4", + "\xB4\xF8" => "\xE5\xB8\xA6", + "\xB4\xF9" => "\xE6\xAE\x86", + "\xB4\xFA" => "\xE4\xBB\xA3", + "\xB4\xFB" => "\xE8\xB4\xB7", + "\xB4\xFC" => "\xE8\xA2\x8B", + "\xB4\xFD" => "\xE5\xBE\x85", + "\xB4\xFE" => "\xE9\x80\xAE", + "\xB5\xA1" => "\xE6\x80\xA0", + "\xB5\xA2" => "\xE8\x80\xBD", + "\xB5\xA3" => "\xE6\x8B\x85", + "\xB5\xA4" => "\xE4\xB8\xB9", + "\xB5\xA5" => "\xE5\x8D\x95", + "\xB5\xA6" => "\xE9\x83\xB8", + "\xB5\xA7" => "\xE6\x8E\xB8", + "\xB5\xA8" => "\xE8\x83\x86", + "\xB5\xA9" => "\xE6\x97\xA6", + "\xB5\xAA" => "\xE6\xB0\xAE", + "\xB5\xAB" => "\xE4\xBD\x86", + "\xB5\xAC" => "\xE6\x83\xAE", + "\xB5\xAD" => "\xE6\xB7\xA1", + "\xB5\xAE" => "\xE8\xAF\x9E", + "\xB5\xAF" => "\xE5\xBC\xB9", + "\xB5\xB0" => "\xE8\x9B\x8B", + "\xB5\xB1" => "\xE5\xBD\x93", + "\xB5\xB2" => "\xE6\x8C\xA1", + "\xB5\xB3" => "\xE5\x85\x9A", + "\xB5\xB4" => "\xE8\x8D\xA1", + "\xB5\xB5" => "\xE6\xA1\xA3", + "\xB5\xB6" => "\xE5\x88\x80", + "\xB5\xB7" => "\xE6\x8D\xA3", + "\xB5\xB8" => "\xE8\xB9\x88", + "\xB5\xB9" => "\xE5\x80\x92", + "\xB5\xBA" => "\xE5\xB2\x9B", + "\xB5\xBB" => "\xE7\xA5\xB7", + "\xB5\xBC" => "\xE5\xAF\xBC", + "\xB5\xBD" => "\xE5\x88\xB0", + "\xB5\xBE" => "\xE7\xA8\xBB", + "\xB5\xBF" => "\xE6\x82\xBC", + "\xB5\xC0" => "\xE9\x81\x93", + "\xB5\xC1" => "\xE7\x9B\x97", + "\xB5\xC2" => "\xE5\xBE\xB7", + "\xB5\xC3" => "\xE5\xBE\x97", + "\xB5\xC4" => "\xE7\x9A\x84", + "\xB5\xC5" => "\xE8\xB9\xAC", + "\xB5\xC6" => "\xE7\x81\xAF", + "\xB5\xC7" => "\xE7\x99\xBB", + "\xB5\xC8" => "\xE7\xAD\x89", + "\xB5\xC9" => "\xE7\x9E\xAA", + "\xB5\xCA" => "\xE5\x87\xB3", + "\xB5\xCB" => "\xE9\x82\x93", + "\xB5\xCC" => "\xE5\xA0\xA4", + "\xB5\xCD" => "\xE4\xBD\x8E", + "\xB5\xCE" => "\xE6\xBB\xB4", + "\xB5\xCF" => "\xE8\xBF\xAA", + "\xB5\xD0" => "\xE6\x95\x8C", + "\xB5\xD1" => "\xE7\xAC\x9B", + "\xB5\xD2" => "\xE7\x8B\x84", + "\xB5\xD3" => "\xE6\xB6\xA4", + "\xB5\xD4" => "\xE7\xBF\x9F", + "\xB5\xD5" => "\xE5\xAB\xA1", + "\xB5\xD6" => "\xE6\x8A\xB5", + "\xB5\xD7" => "\xE5\xBA\x95", + "\xB5\xD8" => "\xE5\x9C\xB0", + "\xB5\xD9" => "\xE8\x92\x82", + "\xB5\xDA" => "\xE7\xAC\xAC", + "\xB5\xDB" => "\xE5\xB8\x9D", + "\xB5\xDC" => "\xE5\xBC\x9F", + "\xB5\xDD" => "\xE9\x80\x92", + "\xB5\xDE" => "\xE7\xBC\x94", + "\xB5\xDF" => "\xE9\xA2\xA0", + "\xB5\xE0" => "\xE6\x8E\x82", + "\xB5\xE1" => "\xE6\xBB\x87", + "\xB5\xE2" => "\xE7\xA2\x98", + "\xB5\xE3" => "\xE7\x82\xB9", + "\xB5\xE4" => "\xE5\x85\xB8", + "\xB5\xE5" => "\xE9\x9D\x9B", + "\xB5\xE6" => "\xE5\x9E\xAB", + "\xB5\xE7" => "\xE7\x94\xB5", + "\xB5\xE8" => "\xE4\xBD\x83", + "\xB5\xE9" => "\xE7\x94\xB8", + "\xB5\xEA" => "\xE5\xBA\x97", + "\xB5\xEB" => "\xE6\x83\xA6", + "\xB5\xEC" => "\xE5\xA5\xA0", + "\xB5\xED" => "\xE6\xB7\x80", + "\xB5\xEE" => "\xE6\xAE\xBF", + "\xB5\xEF" => "\xE7\xA2\x89", + "\xB5\xF0" => "\xE5\x8F\xBC", + "\xB5\xF1" => "\xE9\x9B\x95", + "\xB5\xF2" => "\xE5\x87\x8B", + "\xB5\xF3" => "\xE5\x88\x81", + "\xB5\xF4" => "\xE6\x8E\x89", + "\xB5\xF5" => "\xE5\x90\x8A", + "\xB5\xF6" => "\xE9\x92\x93", + "\xB5\xF7" => "\xE8\xB0\x83", + "\xB5\xF8" => "\xE8\xB7\x8C", + "\xB5\xF9" => "\xE7\x88\xB9", + "\xB5\xFA" => "\xE7\xA2\x9F", + "\xB5\xFB" => "\xE8\x9D\xB6", + "\xB5\xFC" => "\xE8\xBF\xAD", + "\xB5\xFD" => "\xE8\xB0\x8D", + "\xB5\xFE" => "\xE5\x8F\xA0", + "\xB6\xA1" => "\xE4\xB8\x81", + "\xB6\xA2" => "\xE7\x9B\xAF", + "\xB6\xA3" => "\xE5\x8F\xAE", + "\xB6\xA4" => "\xE9\x92\x89", + "\xB6\xA5" => "\xE9\xA1\xB6", + "\xB6\xA6" => "\xE9\xBC\x8E", + "\xB6\xA7" => "\xE9\x94\xAD", + "\xB6\xA8" => "\xE5\xAE\x9A", + "\xB6\xA9" => "\xE8\xAE\xA2", + "\xB6\xAA" => "\xE4\xB8\xA2", + "\xB6\xAB" => "\xE4\xB8\x9C", + "\xB6\xAC" => "\xE5\x86\xAC", + "\xB6\xAD" => "\xE8\x91\xA3", + "\xB6\xAE" => "\xE6\x87\x82", + "\xB6\xAF" => "\xE5\x8A\xA8", + "\xB6\xB0" => "\xE6\xA0\x8B", + "\xB6\xB1" => "\xE4\xBE\x97", + "\xB6\xB2" => "\xE6\x81\xAB", + "\xB6\xB3" => "\xE5\x86\xBB", + "\xB6\xB4" => "\xE6\xB4\x9E", + "\xB6\xB5" => "\xE5\x85\x9C", + "\xB6\xB6" => "\xE6\x8A\x96", + "\xB6\xB7" => "\xE6\x96\x97", + "\xB6\xB8" => "\xE9\x99\xA1", + "\xB6\xB9" => "\xE8\xB1\x86", + "\xB6\xBA" => "\xE9\x80\x97", + "\xB6\xBB" => "\xE7\x97\x98", + "\xB6\xBC" => "\xE9\x83\xBD", + "\xB6\xBD" => "\xE7\x9D\xA3", + "\xB6\xBE" => "\xE6\xAF\x92", + "\xB6\xBF" => "\xE7\x8A\x8A", + "\xB6\xC0" => "\xE7\x8B\xAC", + "\xB6\xC1" => "\xE8\xAF\xBB", + "\xB6\xC2" => "\xE5\xA0\xB5", + "\xB6\xC3" => "\xE7\x9D\xB9", + "\xB6\xC4" => "\xE8\xB5\x8C", + "\xB6\xC5" => "\xE6\x9D\x9C", + "\xB6\xC6" => "\xE9\x95\x80", + "\xB6\xC7" => "\xE8\x82\x9A", + "\xB6\xC8" => "\xE5\xBA\xA6", + "\xB6\xC9" => "\xE6\xB8\xA1", + "\xB6\xCA" => "\xE5\xA6\x92", + "\xB6\xCB" => "\xE7\xAB\xAF", + "\xB6\xCC" => "\xE7\x9F\xAD", + "\xB6\xCD" => "\xE9\x94\xBB", + "\xB6\xCE" => "\xE6\xAE\xB5", + "\xB6\xCF" => "\xE6\x96\xAD", + "\xB6\xD0" => "\xE7\xBC\x8E", + "\xB6\xD1" => "\xE5\xA0\x86", + "\xB6\xD2" => "\xE5\x85\x91", + "\xB6\xD3" => "\xE9\x98\x9F", + "\xB6\xD4" => "\xE5\xAF\xB9", + "\xB6\xD5" => "\xE5\xA2\xA9", + "\xB6\xD6" => "\xE5\x90\xA8", + "\xB6\xD7" => "\xE8\xB9\xB2", + "\xB6\xD8" => "\xE6\x95\xA6", + "\xB6\xD9" => "\xE9\xA1\xBF", + "\xB6\xDA" => "\xE5\x9B\xA4", + "\xB6\xDB" => "\xE9\x92\x9D", + "\xB6\xDC" => "\xE7\x9B\xBE", + "\xB6\xDD" => "\xE9\x81\x81", + "\xB6\xDE" => "\xE6\x8E\x87", + "\xB6\xDF" => "\xE5\x93\x86", + "\xB6\xE0" => "\xE5\xA4\x9A", + "\xB6\xE1" => "\xE5\xA4\xBA", + "\xB6\xE2" => "\xE5\x9E\x9B", + "\xB6\xE3" => "\xE8\xBA\xB2", + "\xB6\xE4" => "\xE6\x9C\xB5", + "\xB6\xE5" => "\xE8\xB7\xBA", + "\xB6\xE6" => "\xE8\x88\xB5", + "\xB6\xE7" => "\xE5\x89\x81", + "\xB6\xE8" => "\xE6\x83\xB0", + "\xB6\xE9" => "\xE5\xA0\x95", + "\xB6\xEA" => "\xE8\x9B\xBE", + "\xB6\xEB" => "\xE5\xB3\xA8", + "\xB6\xEC" => "\xE9\xB9\x85", + "\xB6\xED" => "\xE4\xBF\x84", + "\xB6\xEE" => "\xE9\xA2\x9D", + "\xB6\xEF" => "\xE8\xAE\xB9", + "\xB6\xF0" => "\xE5\xA8\xA5", + "\xB6\xF1" => "\xE6\x81\xB6", + "\xB6\xF2" => "\xE5\x8E\x84", + "\xB6\xF3" => "\xE6\x89\xBC", + "\xB6\xF4" => "\xE9\x81\x8F", + "\xB6\xF5" => "\xE9\x84\x82", + "\xB6\xF6" => "\xE9\xA5\xBF", + "\xB6\xF7" => "\xE6\x81\xA9", + "\xB6\xF8" => "\xE8\x80\x8C", + "\xB6\xF9" => "\xE5\x84\xBF", + "\xB6\xFA" => "\xE8\x80\xB3", + "\xB6\xFB" => "\xE5\xB0\x94", + "\xB6\xFC" => "\xE9\xA5\xB5", + "\xB6\xFD" => "\xE6\xB4\xB1", + "\xB6\xFE" => "\xE4\xBA\x8C", + "\xB7\xA1" => "\xE8\xB4\xB0", + "\xB7\xA2" => "\xE5\x8F\x91", + "\xB7\xA3" => "\xE7\xBD\x9A", + "\xB7\xA4" => "\xE7\xAD\x8F", + "\xB7\xA5" => "\xE4\xBC\x90", + "\xB7\xA6" => "\xE4\xB9\x8F", + "\xB7\xA7" => "\xE9\x98\x80", + "\xB7\xA8" => "\xE6\xB3\x95", + "\xB7\xA9" => "\xE7\x8F\x90", + "\xB7\xAA" => "\xE8\x97\xA9", + "\xB7\xAB" => "\xE5\xB8\x86", + "\xB7\xAC" => "\xE7\x95\xAA", + "\xB7\xAD" => "\xE7\xBF\xBB", + "\xB7\xAE" => "\xE6\xA8\x8A", + "\xB7\xAF" => "\xE7\x9F\xBE", + "\xB7\xB0" => "\xE9\x92\x92", + "\xB7\xB1" => "\xE7\xB9\x81", + "\xB7\xB2" => "\xE5\x87\xA1", + "\xB7\xB3" => "\xE7\x83\xA6", + "\xB7\xB4" => "\xE5\x8F\x8D", + "\xB7\xB5" => "\xE8\xBF\x94", + "\xB7\xB6" => "\xE8\x8C\x83", + "\xB7\xB7" => "\xE8\xB4\xA9", + "\xB7\xB8" => "\xE7\x8A\xAF", + "\xB7\xB9" => "\xE9\xA5\xAD", + "\xB7\xBA" => "\xE6\xB3\x9B", + "\xB7\xBB" => "\xE5\x9D\x8A", + "\xB7\xBC" => "\xE8\x8A\xB3", + "\xB7\xBD" => "\xE6\x96\xB9", + "\xB7\xBE" => "\xE8\x82\xAA", + "\xB7\xBF" => "\xE6\x88\xBF", + "\xB7\xC0" => "\xE9\x98\xB2", + "\xB7\xC1" => "\xE5\xA6\xA8", + "\xB7\xC2" => "\xE4\xBB\xBF", + "\xB7\xC3" => "\xE8\xAE\xBF", + "\xB7\xC4" => "\xE7\xBA\xBA", + "\xB7\xC5" => "\xE6\x94\xBE", + "\xB7\xC6" => "\xE8\x8F\xB2", + "\xB7\xC7" => "\xE9\x9D\x9E", + "\xB7\xC8" => "\xE5\x95\xA1", + "\xB7\xC9" => "\xE9\xA3\x9E", + "\xB7\xCA" => "\xE8\x82\xA5", + "\xB7\xCB" => "\xE5\x8C\xAA", + "\xB7\xCC" => "\xE8\xAF\xBD", + "\xB7\xCD" => "\xE5\x90\xA0", + "\xB7\xCE" => "\xE8\x82\xBA", + "\xB7\xCF" => "\xE5\xBA\x9F", + "\xB7\xD0" => "\xE6\xB2\xB8", + "\xB7\xD1" => "\xE8\xB4\xB9", + "\xB7\xD2" => "\xE8\x8A\xAC", + "\xB7\xD3" => "\xE9\x85\x9A", + "\xB7\xD4" => "\xE5\x90\xA9", + "\xB7\xD5" => "\xE6\xB0\x9B", + "\xB7\xD6" => "\xE5\x88\x86", + "\xB7\xD7" => "\xE7\xBA\xB7", + "\xB7\xD8" => "\xE5\x9D\x9F", + "\xB7\xD9" => "\xE7\x84\x9A", + "\xB7\xDA" => "\xE6\xB1\xBE", + "\xB7\xDB" => "\xE7\xB2\x89", + "\xB7\xDC" => "\xE5\xA5\x8B", + "\xB7\xDD" => "\xE4\xBB\xBD", + "\xB7\xDE" => "\xE5\xBF\xBF", + "\xB7\xDF" => "\xE6\x84\xA4", + "\xB7\xE0" => "\xE7\xB2\xAA", + "\xB7\xE1" => "\xE4\xB8\xB0", + "\xB7\xE2" => "\xE5\xB0\x81", + "\xB7\xE3" => "\xE6\x9E\xAB", + "\xB7\xE4" => "\xE8\x9C\x82", + "\xB7\xE5" => "\xE5\xB3\xB0", + "\xB7\xE6" => "\xE9\x94\x8B", + "\xB7\xE7" => "\xE9\xA3\x8E", + "\xB7\xE8" => "\xE7\x96\xAF", + "\xB7\xE9" => "\xE7\x83\xBD", + "\xB7\xEA" => "\xE9\x80\xA2", + "\xB7\xEB" => "\xE5\x86\xAF", + "\xB7\xEC" => "\xE7\xBC\x9D", + "\xB7\xED" => "\xE8\xAE\xBD", + "\xB7\xEE" => "\xE5\xA5\x89", + "\xB7\xEF" => "\xE5\x87\xA4", + "\xB7\xF0" => "\xE4\xBD\x9B", + "\xB7\xF1" => "\xE5\x90\xA6", + "\xB7\xF2" => "\xE5\xA4\xAB", + "\xB7\xF3" => "\xE6\x95\xB7", + "\xB7\xF4" => "\xE8\x82\xA4", + "\xB7\xF5" => "\xE5\xAD\xB5", + "\xB7\xF6" => "\xE6\x89\xB6", + "\xB7\xF7" => "\xE6\x8B\x82", + "\xB7\xF8" => "\xE8\xBE\x90", + "\xB7\xF9" => "\xE5\xB9\x85", + "\xB7\xFA" => "\xE6\xB0\x9F", + "\xB7\xFB" => "\xE7\xAC\xA6", + "\xB7\xFC" => "\xE4\xBC\x8F", + "\xB7\xFD" => "\xE4\xBF\x98", + "\xB7\xFE" => "\xE6\x9C\x8D", + "\xB8\xA1" => "\xE6\xB5\xAE", + "\xB8\xA2" => "\xE6\xB6\xAA", + "\xB8\xA3" => "\xE7\xA6\x8F", + "\xB8\xA4" => "\xE8\xA2\xB1", + "\xB8\xA5" => "\xE5\xBC\x97", + "\xB8\xA6" => "\xE7\x94\xAB", + "\xB8\xA7" => "\xE6\x8A\x9A", + "\xB8\xA8" => "\xE8\xBE\x85", + "\xB8\xA9" => "\xE4\xBF\xAF", + "\xB8\xAA" => "\xE9\x87\x9C", + "\xB8\xAB" => "\xE6\x96\xA7", + "\xB8\xAC" => "\xE8\x84\xAF", + "\xB8\xAD" => "\xE8\x85\x91", + "\xB8\xAE" => "\xE5\xBA\x9C", + "\xB8\xAF" => "\xE8\x85\x90", + "\xB8\xB0" => "\xE8\xB5\xB4", + "\xB8\xB1" => "\xE5\x89\xAF", + "\xB8\xB2" => "\xE8\xA6\x86", + "\xB8\xB3" => "\xE8\xB5\x8B", + "\xB8\xB4" => "\xE5\xA4\x8D", + "\xB8\xB5" => "\xE5\x82\x85", + "\xB8\xB6" => "\xE4\xBB\x98", + "\xB8\xB7" => "\xE9\x98\x9C", + "\xB8\xB8" => "\xE7\x88\xB6", + "\xB8\xB9" => "\xE8\x85\xB9", + "\xB8\xBA" => "\xE8\xB4\x9F", + "\xB8\xBB" => "\xE5\xAF\x8C", + "\xB8\xBC" => "\xE8\xAE\xA3", + "\xB8\xBD" => "\xE9\x99\x84", + "\xB8\xBE" => "\xE5\xA6\x87", + "\xB8\xBF" => "\xE7\xBC\x9A", + "\xB8\xC0" => "\xE5\x92\x90", + "\xB8\xC1" => "\xE5\x99\xB6", + "\xB8\xC2" => "\xE5\x98\x8E", + "\xB8\xC3" => "\xE8\xAF\xA5", + "\xB8\xC4" => "\xE6\x94\xB9", + "\xB8\xC5" => "\xE6\xA6\x82", + "\xB8\xC6" => "\xE9\x92\x99", + "\xB8\xC7" => "\xE7\x9B\x96", + "\xB8\xC8" => "\xE6\xBA\x89", + "\xB8\xC9" => "\xE5\xB9\xB2", + "\xB8\xCA" => "\xE7\x94\x98", + "\xB8\xCB" => "\xE6\x9D\x86", + "\xB8\xCC" => "\xE6\x9F\x91", + "\xB8\xCD" => "\xE7\xAB\xBF", + "\xB8\xCE" => "\xE8\x82\x9D", + "\xB8\xCF" => "\xE8\xB5\xB6", + "\xB8\xD0" => "\xE6\x84\x9F", + "\xB8\xD1" => "\xE7\xA7\x86", + "\xB8\xD2" => "\xE6\x95\xA2", + "\xB8\xD3" => "\xE8\xB5\xA3", + "\xB8\xD4" => "\xE5\x86\x88", + "\xB8\xD5" => "\xE5\x88\x9A", + "\xB8\xD6" => "\xE9\x92\xA2", + "\xB8\xD7" => "\xE7\xBC\xB8", + "\xB8\xD8" => "\xE8\x82\x9B", + "\xB8\xD9" => "\xE7\xBA\xB2", + "\xB8\xDA" => "\xE5\xB2\x97", + "\xB8\xDB" => "\xE6\xB8\xAF", + "\xB8\xDC" => "\xE6\x9D\xA0", + "\xB8\xDD" => "\xE7\xAF\x99", + "\xB8\xDE" => "\xE7\x9A\x8B", + "\xB8\xDF" => "\xE9\xAB\x98", + "\xB8\xE0" => "\xE8\x86\x8F", + "\xB8\xE1" => "\xE7\xBE\x94", + "\xB8\xE2" => "\xE7\xB3\x95", + "\xB8\xE3" => "\xE6\x90\x9E", + "\xB8\xE4" => "\xE9\x95\x90", + "\xB8\xE5" => "\xE7\xA8\xBF", + "\xB8\xE6" => "\xE5\x91\x8A", + "\xB8\xE7" => "\xE5\x93\xA5", + "\xB8\xE8" => "\xE6\xAD\x8C", + "\xB8\xE9" => "\xE6\x90\x81", + "\xB8\xEA" => "\xE6\x88\x88", + "\xB8\xEB" => "\xE9\xB8\xBD", + "\xB8\xEC" => "\xE8\x83\xB3", + "\xB8\xED" => "\xE7\x96\x99", + "\xB8\xEE" => "\xE5\x89\xB2", + "\xB8\xEF" => "\xE9\x9D\xA9", + "\xB8\xF0" => "\xE8\x91\x9B", + "\xB8\xF1" => "\xE6\xA0\xBC", + "\xB8\xF2" => "\xE8\x9B\xA4", + "\xB8\xF3" => "\xE9\x98\x81", + "\xB8\xF4" => "\xE9\x9A\x94", + "\xB8\xF5" => "\xE9\x93\xAC", + "\xB8\xF6" => "\xE4\xB8\xAA", + "\xB8\xF7" => "\xE5\x90\x84", + "\xB8\xF8" => "\xE7\xBB\x99", + "\xB8\xF9" => "\xE6\xA0\xB9", + "\xB8\xFA" => "\xE8\xB7\x9F", + "\xB8\xFB" => "\xE8\x80\x95", + "\xB8\xFC" => "\xE6\x9B\xB4", + "\xB8\xFD" => "\xE5\xBA\x9A", + "\xB8\xFE" => "\xE7\xBE\xB9", + "\xB9\xA1" => "\xE5\x9F\x82", + "\xB9\xA2" => "\xE8\x80\xBF", + "\xB9\xA3" => "\xE6\xA2\x97", + "\xB9\xA4" => "\xE5\xB7\xA5", + "\xB9\xA5" => "\xE6\x94\xBB", + "\xB9\xA6" => "\xE5\x8A\x9F", + "\xB9\xA7" => "\xE6\x81\xAD", + "\xB9\xA8" => "\xE9\xBE\x9A", + "\xB9\xA9" => "\xE4\xBE\x9B", + "\xB9\xAA" => "\xE8\xBA\xAC", + "\xB9\xAB" => "\xE5\x85\xAC", + "\xB9\xAC" => "\xE5\xAE\xAB", + "\xB9\xAD" => "\xE5\xBC\x93", + "\xB9\xAE" => "\xE5\xB7\xA9", + "\xB9\xAF" => "\xE6\xB1\x9E", + "\xB9\xB0" => "\xE6\x8B\xB1", + "\xB9\xB1" => "\xE8\xB4\xA1", + "\xB9\xB2" => "\xE5\x85\xB1", + "\xB9\xB3" => "\xE9\x92\xA9", + "\xB9\xB4" => "\xE5\x8B\xBE", + "\xB9\xB5" => "\xE6\xB2\x9F", + "\xB9\xB6" => "\xE8\x8B\x9F", + "\xB9\xB7" => "\xE7\x8B\x97", + "\xB9\xB8" => "\xE5\x9E\xA2", + "\xB9\xB9" => "\xE6\x9E\x84", + "\xB9\xBA" => "\xE8\xB4\xAD", + "\xB9\xBB" => "\xE5\xA4\x9F", + "\xB9\xBC" => "\xE8\xBE\x9C", + "\xB9\xBD" => "\xE8\x8F\x87", + "\xB9\xBE" => "\xE5\x92\x95", + "\xB9\xBF" => "\xE7\xAE\x8D", + "\xB9\xC0" => "\xE4\xBC\xB0", + "\xB9\xC1" => "\xE6\xB2\xBD", + "\xB9\xC2" => "\xE5\xAD\xA4", + "\xB9\xC3" => "\xE5\xA7\x91", + "\xB9\xC4" => "\xE9\xBC\x93", + "\xB9\xC5" => "\xE5\x8F\xA4", + "\xB9\xC6" => "\xE8\x9B\x8A", + "\xB9\xC7" => "\xE9\xAA\xA8", + "\xB9\xC8" => "\xE8\xB0\xB7", + "\xB9\xC9" => "\xE8\x82\xA1", + "\xB9\xCA" => "\xE6\x95\x85", + "\xB9\xCB" => "\xE9\xA1\xBE", + "\xB9\xCC" => "\xE5\x9B\xBA", + "\xB9\xCD" => "\xE9\x9B\x87", + "\xB9\xCE" => "\xE5\x88\xAE", + "\xB9\xCF" => "\xE7\x93\x9C", + "\xB9\xD0" => "\xE5\x89\x90", + "\xB9\xD1" => "\xE5\xAF\xA1", + "\xB9\xD2" => "\xE6\x8C\x82", + "\xB9\xD3" => "\xE8\xA4\x82", + "\xB9\xD4" => "\xE4\xB9\x96", + "\xB9\xD5" => "\xE6\x8B\x90", + "\xB9\xD6" => "\xE6\x80\xAA", + "\xB9\xD7" => "\xE6\xA3\xBA", + "\xB9\xD8" => "\xE5\x85\xB3", + "\xB9\xD9" => "\xE5\xAE\x98", + "\xB9\xDA" => "\xE5\x86\xA0", + "\xB9\xDB" => "\xE8\xA7\x82", + "\xB9\xDC" => "\xE7\xAE\xA1", + "\xB9\xDD" => "\xE9\xA6\x86", + "\xB9\xDE" => "\xE7\xBD\x90", + "\xB9\xDF" => "\xE6\x83\xAF", + "\xB9\xE0" => "\xE7\x81\x8C", + "\xB9\xE1" => "\xE8\xB4\xAF", + "\xB9\xE2" => "\xE5\x85\x89", + "\xB9\xE3" => "\xE5\xB9\xBF", + "\xB9\xE4" => "\xE9\x80\x9B", + "\xB9\xE5" => "\xE7\x91\xB0", + "\xB9\xE6" => "\xE8\xA7\x84", + "\xB9\xE7" => "\xE5\x9C\xAD", + "\xB9\xE8" => "\xE7\xA1\x85", + "\xB9\xE9" => "\xE5\xBD\x92", + "\xB9\xEA" => "\xE9\xBE\x9F", + "\xB9\xEB" => "\xE9\x97\xBA", + "\xB9\xEC" => "\xE8\xBD\xA8", + "\xB9\xED" => "\xE9\xAC\xBC", + "\xB9\xEE" => "\xE8\xAF\xA1", + "\xB9\xEF" => "\xE7\x99\xB8", + "\xB9\xF0" => "\xE6\xA1\x82", + "\xB9\xF1" => "\xE6\x9F\x9C", + "\xB9\xF2" => "\xE8\xB7\xAA", + "\xB9\xF3" => "\xE8\xB4\xB5", + "\xB9\xF4" => "\xE5\x88\xBD", + "\xB9\xF5" => "\xE8\xBE\x8A", + "\xB9\xF6" => "\xE6\xBB\x9A", + "\xB9\xF7" => "\xE6\xA3\x8D", + "\xB9\xF8" => "\xE9\x94\x85", + "\xB9\xF9" => "\xE9\x83\xAD", + "\xB9\xFA" => "\xE5\x9B\xBD", + "\xB9\xFB" => "\xE6\x9E\x9C", + "\xB9\xFC" => "\xE8\xA3\xB9", + "\xB9\xFD" => "\xE8\xBF\x87", + "\xB9\xFE" => "\xE5\x93\x88", + "\xBA\xA1" => "\xE9\xAA\xB8", + "\xBA\xA2" => "\xE5\xAD\xA9", + "\xBA\xA3" => "\xE6\xB5\xB7", + "\xBA\xA4" => "\xE6\xB0\xA6", + "\xBA\xA5" => "\xE4\xBA\xA5", + "\xBA\xA6" => "\xE5\xAE\xB3", + "\xBA\xA7" => "\xE9\xAA\x87", + "\xBA\xA8" => "\xE9\x85\xA3", + "\xBA\xA9" => "\xE6\x86\xA8", + "\xBA\xAA" => "\xE9\x82\xAF", + "\xBA\xAB" => "\xE9\x9F\xA9", + "\xBA\xAC" => "\xE5\x90\xAB", + "\xBA\xAD" => "\xE6\xB6\xB5", + "\xBA\xAE" => "\xE5\xAF\x92", + "\xBA\xAF" => "\xE5\x87\xBD", + "\xBA\xB0" => "\xE5\x96\x8A", + "\xBA\xB1" => "\xE7\xBD\x95", + "\xBA\xB2" => "\xE7\xBF\xB0", + "\xBA\xB3" => "\xE6\x92\xBC", + "\xBA\xB4" => "\xE6\x8D\x8D", + "\xBA\xB5" => "\xE6\x97\xB1", + "\xBA\xB6" => "\xE6\x86\xBE", + "\xBA\xB7" => "\xE6\x82\x8D", + "\xBA\xB8" => "\xE7\x84\x8A", + "\xBA\xB9" => "\xE6\xB1\x97", + "\xBA\xBA" => "\xE6\xB1\x89", + "\xBA\xBB" => "\xE5\xA4\xAF", + "\xBA\xBC" => "\xE6\x9D\xAD", + "\xBA\xBD" => "\xE8\x88\xAA", + "\xBA\xBE" => "\xE5\xA3\x95", + "\xBA\xBF" => "\xE5\x9A\x8E", + "\xBA\xC0" => "\xE8\xB1\xAA", + "\xBA\xC1" => "\xE6\xAF\xAB", + "\xBA\xC2" => "\xE9\x83\x9D", + "\xBA\xC3" => "\xE5\xA5\xBD", + "\xBA\xC4" => "\xE8\x80\x97", + "\xBA\xC5" => "\xE5\x8F\xB7", + "\xBA\xC6" => "\xE6\xB5\xA9", + "\xBA\xC7" => "\xE5\x91\xB5", + "\xBA\xC8" => "\xE5\x96\x9D", + "\xBA\xC9" => "\xE8\x8D\xB7", + "\xBA\xCA" => "\xE8\x8F\x8F", + "\xBA\xCB" => "\xE6\xA0\xB8", + "\xBA\xCC" => "\xE7\xA6\xBE", + "\xBA\xCD" => "\xE5\x92\x8C", + "\xBA\xCE" => "\xE4\xBD\x95", + "\xBA\xCF" => "\xE5\x90\x88", + "\xBA\xD0" => "\xE7\x9B\x92", + "\xBA\xD1" => "\xE8\xB2\x89", + "\xBA\xD2" => "\xE9\x98\x82", + "\xBA\xD3" => "\xE6\xB2\xB3", + "\xBA\xD4" => "\xE6\xB6\xB8", + "\xBA\xD5" => "\xE8\xB5\xAB", + "\xBA\xD6" => "\xE8\xA4\x90", + "\xBA\xD7" => "\xE9\xB9\xA4", + "\xBA\xD8" => "\xE8\xB4\xBA", + "\xBA\xD9" => "\xE5\x98\xBF", + "\xBA\xDA" => "\xE9\xBB\x91", + "\xBA\xDB" => "\xE7\x97\x95", + "\xBA\xDC" => "\xE5\xBE\x88", + "\xBA\xDD" => "\xE7\x8B\xA0", + "\xBA\xDE" => "\xE6\x81\xA8", + "\xBA\xDF" => "\xE5\x93\xBC", + "\xBA\xE0" => "\xE4\xBA\xA8", + "\xBA\xE1" => "\xE6\xA8\xAA", + "\xBA\xE2" => "\xE8\xA1\xA1", + "\xBA\xE3" => "\xE6\x81\x92", + "\xBA\xE4" => "\xE8\xBD\xB0", + "\xBA\xE5" => "\xE5\x93\x84", + "\xBA\xE6" => "\xE7\x83\x98", + "\xBA\xE7" => "\xE8\x99\xB9", + "\xBA\xE8" => "\xE9\xB8\xBF", + "\xBA\xE9" => "\xE6\xB4\xAA", + "\xBA\xEA" => "\xE5\xAE\x8F", + "\xBA\xEB" => "\xE5\xBC\x98", + "\xBA\xEC" => "\xE7\xBA\xA2", + "\xBA\xED" => "\xE5\x96\x89", + "\xBA\xEE" => "\xE4\xBE\xAF", + "\xBA\xEF" => "\xE7\x8C\xB4", + "\xBA\xF0" => "\xE5\x90\xBC", + "\xBA\xF1" => "\xE5\x8E\x9A", + "\xBA\xF2" => "\xE5\x80\x99", + "\xBA\xF3" => "\xE5\x90\x8E", + "\xBA\xF4" => "\xE5\x91\xBC", + "\xBA\xF5" => "\xE4\xB9\x8E", + "\xBA\xF6" => "\xE5\xBF\xBD", + "\xBA\xF7" => "\xE7\x91\x9A", + "\xBA\xF8" => "\xE5\xA3\xB6", + "\xBA\xF9" => "\xE8\x91\xAB", + "\xBA\xFA" => "\xE8\x83\xA1", + "\xBA\xFB" => "\xE8\x9D\xB4", + "\xBA\xFC" => "\xE7\x8B\x90", + "\xBA\xFD" => "\xE7\xB3\x8A", + "\xBA\xFE" => "\xE6\xB9\x96", + "\xBB\xA1" => "\xE5\xBC\xA7", + "\xBB\xA2" => "\xE8\x99\x8E", + "\xBB\xA3" => "\xE5\x94\xAC", + "\xBB\xA4" => "\xE6\x8A\xA4", + "\xBB\xA5" => "\xE4\xBA\x92", + "\xBB\xA6" => "\xE6\xB2\xAA", + "\xBB\xA7" => "\xE6\x88\xB7", + "\xBB\xA8" => "\xE8\x8A\xB1", + "\xBB\xA9" => "\xE5\x93\x97", + "\xBB\xAA" => "\xE5\x8D\x8E", + "\xBB\xAB" => "\xE7\x8C\xBE", + "\xBB\xAC" => "\xE6\xBB\x91", + "\xBB\xAD" => "\xE7\x94\xBB", + "\xBB\xAE" => "\xE5\x88\x92", + "\xBB\xAF" => "\xE5\x8C\x96", + "\xBB\xB0" => "\xE8\xAF\x9D", + "\xBB\xB1" => "\xE6\xA7\x90", + "\xBB\xB2" => "\xE5\xBE\x8A", + "\xBB\xB3" => "\xE6\x80\x80", + "\xBB\xB4" => "\xE6\xB7\xAE", + "\xBB\xB5" => "\xE5\x9D\x8F", + "\xBB\xB6" => "\xE6\xAC\xA2", + "\xBB\xB7" => "\xE7\x8E\xAF", + "\xBB\xB8" => "\xE6\xA1\x93", + "\xBB\xB9" => "\xE8\xBF\x98", + "\xBB\xBA" => "\xE7\xBC\x93", + "\xBB\xBB" => "\xE6\x8D\xA2", + "\xBB\xBC" => "\xE6\x82\xA3", + "\xBB\xBD" => "\xE5\x94\xA4", + "\xBB\xBE" => "\xE7\x97\xAA", + "\xBB\xBF" => "\xE8\xB1\xA2", + "\xBB\xC0" => "\xE7\x84\x95", + "\xBB\xC1" => "\xE6\xB6\xA3", + "\xBB\xC2" => "\xE5\xAE\xA6", + "\xBB\xC3" => "\xE5\xB9\xBB", + "\xBB\xC4" => "\xE8\x8D\x92", + "\xBB\xC5" => "\xE6\x85\x8C", + "\xBB\xC6" => "\xE9\xBB\x84", + "\xBB\xC7" => "\xE7\xA3\xBA", + "\xBB\xC8" => "\xE8\x9D\x97", + "\xBB\xC9" => "\xE7\xB0\xA7", + "\xBB\xCA" => "\xE7\x9A\x87", + "\xBB\xCB" => "\xE5\x87\xB0", + "\xBB\xCC" => "\xE6\x83\xB6", + "\xBB\xCD" => "\xE7\x85\x8C", + "\xBB\xCE" => "\xE6\x99\x83", + "\xBB\xCF" => "\xE5\xB9\x8C", + "\xBB\xD0" => "\xE6\x81\x8D", + "\xBB\xD1" => "\xE8\xB0\x8E", + "\xBB\xD2" => "\xE7\x81\xB0", + "\xBB\xD3" => "\xE6\x8C\xA5", + "\xBB\xD4" => "\xE8\xBE\x89", + "\xBB\xD5" => "\xE5\xBE\xBD", + "\xBB\xD6" => "\xE6\x81\xA2", + "\xBB\xD7" => "\xE8\x9B\x94", + "\xBB\xD8" => "\xE5\x9B\x9E", + "\xBB\xD9" => "\xE6\xAF\x81", + "\xBB\xDA" => "\xE6\x82\x94", + "\xBB\xDB" => "\xE6\x85\xA7", + "\xBB\xDC" => "\xE5\x8D\x89", + "\xBB\xDD" => "\xE6\x83\xA0", + "\xBB\xDE" => "\xE6\x99\xA6", + "\xBB\xDF" => "\xE8\xB4\xBF", + "\xBB\xE0" => "\xE7\xA7\xBD", + "\xBB\xE1" => "\xE4\xBC\x9A", + "\xBB\xE2" => "\xE7\x83\xA9", + "\xBB\xE3" => "\xE6\xB1\x87", + "\xBB\xE4" => "\xE8\xAE\xB3", + "\xBB\xE5" => "\xE8\xAF\xB2", + "\xBB\xE6" => "\xE7\xBB\x98", + "\xBB\xE7" => "\xE8\x8D\xA4", + "\xBB\xE8" => "\xE6\x98\x8F", + "\xBB\xE9" => "\xE5\xA9\x9A", + "\xBB\xEA" => "\xE9\xAD\x82", + "\xBB\xEB" => "\xE6\xB5\x91", + "\xBB\xEC" => "\xE6\xB7\xB7", + "\xBB\xED" => "\xE8\xB1\x81", + "\xBB\xEE" => "\xE6\xB4\xBB", + "\xBB\xEF" => "\xE4\xBC\x99", + "\xBB\xF0" => "\xE7\x81\xAB", + "\xBB\xF1" => "\xE8\x8E\xB7", + "\xBB\xF2" => "\xE6\x88\x96", + "\xBB\xF3" => "\xE6\x83\x91", + "\xBB\xF4" => "\xE9\x9C\x8D", + "\xBB\xF5" => "\xE8\xB4\xA7", + "\xBB\xF6" => "\xE7\xA5\xB8", + "\xBB\xF7" => "\xE5\x87\xBB", + "\xBB\xF8" => "\xE5\x9C\xBE", + "\xBB\xF9" => "\xE5\x9F\xBA", + "\xBB\xFA" => "\xE6\x9C\xBA", + "\xBB\xFB" => "\xE7\x95\xB8", + "\xBB\xFC" => "\xE7\xA8\xBD", + "\xBB\xFD" => "\xE7\xA7\xAF", + "\xBB\xFE" => "\xE7\xAE\x95", + "\xBC\xA1" => "\xE8\x82\x8C", + "\xBC\xA2" => "\xE9\xA5\xA5", + "\xBC\xA3" => "\xE8\xBF\xB9", + "\xBC\xA4" => "\xE6\xBF\x80", + "\xBC\xA5" => "\xE8\xAE\xA5", + "\xBC\xA6" => "\xE9\xB8\xA1", + "\xBC\xA7" => "\xE5\xA7\xAC", + "\xBC\xA8" => "\xE7\xBB\xA9", + "\xBC\xA9" => "\xE7\xBC\x89", + "\xBC\xAA" => "\xE5\x90\x89", + "\xBC\xAB" => "\xE6\x9E\x81", + "\xBC\xAC" => "\xE6\xA3\x98", + "\xBC\xAD" => "\xE8\xBE\x91", + "\xBC\xAE" => "\xE7\xB1\x8D", + "\xBC\xAF" => "\xE9\x9B\x86", + "\xBC\xB0" => "\xE5\x8F\x8A", + "\xBC\xB1" => "\xE6\x80\xA5", + "\xBC\xB2" => "\xE7\x96\xBE", + "\xBC\xB3" => "\xE6\xB1\xB2", + "\xBC\xB4" => "\xE5\x8D\xB3", + "\xBC\xB5" => "\xE5\xAB\x89", + "\xBC\xB6" => "\xE7\xBA\xA7", + "\xBC\xB7" => "\xE6\x8C\xA4", + "\xBC\xB8" => "\xE5\x87\xA0", + "\xBC\xB9" => "\xE8\x84\x8A", + "\xBC\xBA" => "\xE5\xB7\xB1", + "\xBC\xBB" => "\xE8\x93\x9F", + "\xBC\xBC" => "\xE6\x8A\x80", + "\xBC\xBD" => "\xE5\x86\x80", + "\xBC\xBE" => "\xE5\xAD\xA3", + "\xBC\xBF" => "\xE4\xBC\x8E", + "\xBC\xC0" => "\xE7\xA5\xAD", + "\xBC\xC1" => "\xE5\x89\x82", + "\xBC\xC2" => "\xE6\x82\xB8", + "\xBC\xC3" => "\xE6\xB5\x8E", + "\xBC\xC4" => "\xE5\xAF\x84", + "\xBC\xC5" => "\xE5\xAF\x82", + "\xBC\xC6" => "\xE8\xAE\xA1", + "\xBC\xC7" => "\xE8\xAE\xB0", + "\xBC\xC8" => "\xE6\x97\xA2", + "\xBC\xC9" => "\xE5\xBF\x8C", + "\xBC\xCA" => "\xE9\x99\x85", + "\xBC\xCB" => "\xE5\xA6\x93", + "\xBC\xCC" => "\xE7\xBB\xA7", + "\xBC\xCD" => "\xE7\xBA\xAA", + "\xBC\xCE" => "\xE5\x98\x89", + "\xBC\xCF" => "\xE6\x9E\xB7", + "\xBC\xD0" => "\xE5\xA4\xB9", + "\xBC\xD1" => "\xE4\xBD\xB3", + "\xBC\xD2" => "\xE5\xAE\xB6", + "\xBC\xD3" => "\xE5\x8A\xA0", + "\xBC\xD4" => "\xE8\x8D\x9A", + "\xBC\xD5" => "\xE9\xA2\x8A", + "\xBC\xD6" => "\xE8\xB4\xBE", + "\xBC\xD7" => "\xE7\x94\xB2", + "\xBC\xD8" => "\xE9\x92\xBE", + "\xBC\xD9" => "\xE5\x81\x87", + "\xBC\xDA" => "\xE7\xA8\xBC", + "\xBC\xDB" => "\xE4\xBB\xB7", + "\xBC\xDC" => "\xE6\x9E\xB6", + "\xBC\xDD" => "\xE9\xA9\xBE", + "\xBC\xDE" => "\xE5\xAB\x81", + "\xBC\xDF" => "\xE6\xAD\xBC", + "\xBC\xE0" => "\xE7\x9B\x91", + "\xBC\xE1" => "\xE5\x9D\x9A", + "\xBC\xE2" => "\xE5\xB0\x96", + "\xBC\xE3" => "\xE7\xAC\xBA", + "\xBC\xE4" => "\xE9\x97\xB4", + "\xBC\xE5" => "\xE7\x85\x8E", + "\xBC\xE6" => "\xE5\x85\xBC", + "\xBC\xE7" => "\xE8\x82\xA9", + "\xBC\xE8" => "\xE8\x89\xB0", + "\xBC\xE9" => "\xE5\xA5\xB8", + "\xBC\xEA" => "\xE7\xBC\x84", + "\xBC\xEB" => "\xE8\x8C\xA7", + "\xBC\xEC" => "\xE6\xA3\x80", + "\xBC\xED" => "\xE6\x9F\xAC", + "\xBC\xEE" => "\xE7\xA2\xB1", + "\xBC\xEF" => "\xE7\xA1\xB7", + "\xBC\xF0" => "\xE6\x8B\xA3", + "\xBC\xF1" => "\xE6\x8D\xA1", + "\xBC\xF2" => "\xE7\xAE\x80", + "\xBC\xF3" => "\xE4\xBF\xAD", + "\xBC\xF4" => "\xE5\x89\xAA", + "\xBC\xF5" => "\xE5\x87\x8F", + "\xBC\xF6" => "\xE8\x8D\x90", + "\xBC\xF7" => "\xE6\xA7\x9B", + "\xBC\xF8" => "\xE9\x89\xB4", + "\xBC\xF9" => "\xE8\xB7\xB5", + "\xBC\xFA" => "\xE8\xB4\xB1", + "\xBC\xFB" => "\xE8\xA7\x81", + "\xBC\xFC" => "\xE9\x94\xAE", + "\xBC\xFD" => "\xE7\xAE\xAD", + "\xBC\xFE" => "\xE4\xBB\xB6", + "\xBD\xA1" => "\xE5\x81\xA5", + "\xBD\xA2" => "\xE8\x88\xB0", + "\xBD\xA3" => "\xE5\x89\x91", + "\xBD\xA4" => "\xE9\xA5\xAF", + "\xBD\xA5" => "\xE6\xB8\x90", + "\xBD\xA6" => "\xE6\xBA\x85", + "\xBD\xA7" => "\xE6\xB6\xA7", + "\xBD\xA8" => "\xE5\xBB\xBA", + "\xBD\xA9" => "\xE5\x83\xB5", + "\xBD\xAA" => "\xE5\xA7\x9C", + "\xBD\xAB" => "\xE5\xB0\x86", + "\xBD\xAC" => "\xE6\xB5\x86", + "\xBD\xAD" => "\xE6\xB1\x9F", + "\xBD\xAE" => "\xE7\x96\x86", + "\xBD\xAF" => "\xE8\x92\x8B", + "\xBD\xB0" => "\xE6\xA1\xA8", + "\xBD\xB1" => "\xE5\xA5\x96", + "\xBD\xB2" => "\xE8\xAE\xB2", + "\xBD\xB3" => "\xE5\x8C\xA0", + "\xBD\xB4" => "\xE9\x85\xB1", + "\xBD\xB5" => "\xE9\x99\x8D", + "\xBD\xB6" => "\xE8\x95\x89", + "\xBD\xB7" => "\xE6\xA4\x92", + "\xBD\xB8" => "\xE7\xA4\x81", + "\xBD\xB9" => "\xE7\x84\xA6", + "\xBD\xBA" => "\xE8\x83\xB6", + "\xBD\xBB" => "\xE4\xBA\xA4", + "\xBD\xBC" => "\xE9\x83\x8A", + "\xBD\xBD" => "\xE6\xB5\x87", + "\xBD\xBE" => "\xE9\xAA\x84", + "\xBD\xBF" => "\xE5\xA8\x87", + "\xBD\xC0" => "\xE5\x9A\xBC", + "\xBD\xC1" => "\xE6\x90\x85", + "\xBD\xC2" => "\xE9\x93\xB0", + "\xBD\xC3" => "\xE7\x9F\xAB", + "\xBD\xC4" => "\xE4\xBE\xA5", + "\xBD\xC5" => "\xE8\x84\x9A", + "\xBD\xC6" => "\xE7\x8B\xA1", + "\xBD\xC7" => "\xE8\xA7\x92", + "\xBD\xC8" => "\xE9\xA5\xBA", + "\xBD\xC9" => "\xE7\xBC\xB4", + "\xBD\xCA" => "\xE7\xBB\x9E", + "\xBD\xCB" => "\xE5\x89\xBF", + "\xBD\xCC" => "\xE6\x95\x99", + "\xBD\xCD" => "\xE9\x85\xB5", + "\xBD\xCE" => "\xE8\xBD\xBF", + "\xBD\xCF" => "\xE8\xBE\x83", + "\xBD\xD0" => "\xE5\x8F\xAB", + "\xBD\xD1" => "\xE7\xAA\x96", + "\xBD\xD2" => "\xE6\x8F\xAD", + "\xBD\xD3" => "\xE6\x8E\xA5", + "\xBD\xD4" => "\xE7\x9A\x86", + "\xBD\xD5" => "\xE7\xA7\xB8", + "\xBD\xD6" => "\xE8\xA1\x97", + "\xBD\xD7" => "\xE9\x98\xB6", + "\xBD\xD8" => "\xE6\x88\xAA", + "\xBD\xD9" => "\xE5\x8A\xAB", + "\xBD\xDA" => "\xE8\x8A\x82", + "\xBD\xDB" => "\xE6\xA1\x94", + "\xBD\xDC" => "\xE6\x9D\xB0", + "\xBD\xDD" => "\xE6\x8D\xB7", + "\xBD\xDE" => "\xE7\x9D\xAB", + "\xBD\xDF" => "\xE7\xAB\xAD", + "\xBD\xE0" => "\xE6\xB4\x81", + "\xBD\xE1" => "\xE7\xBB\x93", + "\xBD\xE2" => "\xE8\xA7\xA3", + "\xBD\xE3" => "\xE5\xA7\x90", + "\xBD\xE4" => "\xE6\x88\x92", + "\xBD\xE5" => "\xE8\x97\x89", + "\xBD\xE6" => "\xE8\x8A\xA5", + "\xBD\xE7" => "\xE7\x95\x8C", + "\xBD\xE8" => "\xE5\x80\x9F", + "\xBD\xE9" => "\xE4\xBB\x8B", + "\xBD\xEA" => "\xE7\x96\xA5", + "\xBD\xEB" => "\xE8\xAF\xAB", + "\xBD\xEC" => "\xE5\xB1\x8A", + "\xBD\xED" => "\xE5\xB7\xBE", + "\xBD\xEE" => "\xE7\xAD\x8B", + "\xBD\xEF" => "\xE6\x96\xA4", + "\xBD\xF0" => "\xE9\x87\x91", + "\xBD\xF1" => "\xE4\xBB\x8A", + "\xBD\xF2" => "\xE6\xB4\xA5", + "\xBD\xF3" => "\xE8\xA5\x9F", + "\xBD\xF4" => "\xE7\xB4\xA7", + "\xBD\xF5" => "\xE9\x94\xA6", + "\xBD\xF6" => "\xE4\xBB\x85", + "\xBD\xF7" => "\xE8\xB0\xA8", + "\xBD\xF8" => "\xE8\xBF\x9B", + "\xBD\xF9" => "\xE9\x9D\xB3", + "\xBD\xFA" => "\xE6\x99\x8B", + "\xBD\xFB" => "\xE7\xA6\x81", + "\xBD\xFC" => "\xE8\xBF\x91", + "\xBD\xFD" => "\xE7\x83\xAC", + "\xBD\xFE" => "\xE6\xB5\xB8", + "\xBE\xA1" => "\xE5\xB0\xBD", + "\xBE\xA2" => "\xE5\x8A\xB2", + "\xBE\xA3" => "\xE8\x8D\x86", + "\xBE\xA4" => "\xE5\x85\xA2", + "\xBE\xA5" => "\xE8\x8C\x8E", + "\xBE\xA6" => "\xE7\x9D\x9B", + "\xBE\xA7" => "\xE6\x99\xB6", + "\xBE\xA8" => "\xE9\xB2\xB8", + "\xBE\xA9" => "\xE4\xBA\xAC", + "\xBE\xAA" => "\xE6\x83\x8A", + "\xBE\xAB" => "\xE7\xB2\xBE", + "\xBE\xAC" => "\xE7\xB2\xB3", + "\xBE\xAD" => "\xE7\xBB\x8F", + "\xBE\xAE" => "\xE4\xBA\x95", + "\xBE\xAF" => "\xE8\xAD\xA6", + "\xBE\xB0" => "\xE6\x99\xAF", + "\xBE\xB1" => "\xE9\xA2\x88", + "\xBE\xB2" => "\xE9\x9D\x99", + "\xBE\xB3" => "\xE5\xA2\x83", + "\xBE\xB4" => "\xE6\x95\xAC", + "\xBE\xB5" => "\xE9\x95\x9C", + "\xBE\xB6" => "\xE5\xBE\x84", + "\xBE\xB7" => "\xE7\x97\x89", + "\xBE\xB8" => "\xE9\x9D\x96", + "\xBE\xB9" => "\xE7\xAB\x9F", + "\xBE\xBA" => "\xE7\xAB\x9E", + "\xBE\xBB" => "\xE5\x87\x80", + "\xBE\xBC" => "\xE7\x82\xAF", + "\xBE\xBD" => "\xE7\xAA\x98", + "\xBE\xBE" => "\xE6\x8F\xAA", + "\xBE\xBF" => "\xE7\xA9\xB6", + "\xBE\xC0" => "\xE7\xBA\xA0", + "\xBE\xC1" => "\xE7\x8E\x96", + "\xBE\xC2" => "\xE9\x9F\xAD", + "\xBE\xC3" => "\xE4\xB9\x85", + "\xBE\xC4" => "\xE7\x81\xB8", + "\xBE\xC5" => "\xE4\xB9\x9D", + "\xBE\xC6" => "\xE9\x85\x92", + "\xBE\xC7" => "\xE5\x8E\xA9", + "\xBE\xC8" => "\xE6\x95\x91", + "\xBE\xC9" => "\xE6\x97\xA7", + "\xBE\xCA" => "\xE8\x87\xBC", + "\xBE\xCB" => "\xE8\x88\x85", + "\xBE\xCC" => "\xE5\x92\x8E", + "\xBE\xCD" => "\xE5\xB0\xB1", + "\xBE\xCE" => "\xE7\x96\x9A", + "\xBE\xCF" => "\xE9\x9E\xA0", + "\xBE\xD0" => "\xE6\x8B\x98", + "\xBE\xD1" => "\xE7\x8B\x99", + "\xBE\xD2" => "\xE7\x96\xBD", + "\xBE\xD3" => "\xE5\xB1\x85", + "\xBE\xD4" => "\xE9\xA9\xB9", + "\xBE\xD5" => "\xE8\x8F\x8A", + "\xBE\xD6" => "\xE5\xB1\x80", + "\xBE\xD7" => "\xE5\x92\x80", + "\xBE\xD8" => "\xE7\x9F\xA9", + "\xBE\xD9" => "\xE4\xB8\xBE", + "\xBE\xDA" => "\xE6\xB2\xAE", + "\xBE\xDB" => "\xE8\x81\x9A", + "\xBE\xDC" => "\xE6\x8B\x92", + "\xBE\xDD" => "\xE6\x8D\xAE", + "\xBE\xDE" => "\xE5\xB7\xA8", + "\xBE\xDF" => "\xE5\x85\xB7", + "\xBE\xE0" => "\xE8\xB7\x9D", + "\xBE\xE1" => "\xE8\xB8\x9E", + "\xBE\xE2" => "\xE9\x94\xAF", + "\xBE\xE3" => "\xE4\xBF\xB1", + "\xBE\xE4" => "\xE5\x8F\xA5", + "\xBE\xE5" => "\xE6\x83\xA7", + "\xBE\xE6" => "\xE7\x82\xAC", + "\xBE\xE7" => "\xE5\x89\xA7", + "\xBE\xE8" => "\xE6\x8D\x90", + "\xBE\xE9" => "\xE9\xB9\x83", + "\xBE\xEA" => "\xE5\xA8\x9F", + "\xBE\xEB" => "\xE5\x80\xA6", + "\xBE\xEC" => "\xE7\x9C\xB7", + "\xBE\xED" => "\xE5\x8D\xB7", + "\xBE\xEE" => "\xE7\xBB\xA2", + "\xBE\xEF" => "\xE6\x92\x85", + "\xBE\xF0" => "\xE6\x94\xAB", + "\xBE\xF1" => "\xE6\x8A\x89", + "\xBE\xF2" => "\xE6\x8E\x98", + "\xBE\xF3" => "\xE5\x80\x94", + "\xBE\xF4" => "\xE7\x88\xB5", + "\xBE\xF5" => "\xE8\xA7\x89", + "\xBE\xF6" => "\xE5\x86\xB3", + "\xBE\xF7" => "\xE8\xAF\x80", + "\xBE\xF8" => "\xE7\xBB\x9D", + "\xBE\xF9" => "\xE5\x9D\x87", + "\xBE\xFA" => "\xE8\x8F\x8C", + "\xBE\xFB" => "\xE9\x92\xA7", + "\xBE\xFC" => "\xE5\x86\x9B", + "\xBE\xFD" => "\xE5\x90\x9B", + "\xBE\xFE" => "\xE5\xB3\xBB", + "\xBF\xA1" => "\xE4\xBF\x8A", + "\xBF\xA2" => "\xE7\xAB\xA3", + "\xBF\xA3" => "\xE6\xB5\x9A", + "\xBF\xA4" => "\xE9\x83\xA1", + "\xBF\xA5" => "\xE9\xAA\x8F", + "\xBF\xA6" => "\xE5\x96\x80", + "\xBF\xA7" => "\xE5\x92\x96", + "\xBF\xA8" => "\xE5\x8D\xA1", + "\xBF\xA9" => "\xE5\x92\xAF", + "\xBF\xAA" => "\xE5\xBC\x80", + "\xBF\xAB" => "\xE6\x8F\xA9", + "\xBF\xAC" => "\xE6\xA5\xB7", + "\xBF\xAD" => "\xE5\x87\xAF", + "\xBF\xAE" => "\xE6\x85\xA8", + "\xBF\xAF" => "\xE5\x88\x8A", + "\xBF\xB0" => "\xE5\xA0\xAA", + "\xBF\xB1" => "\xE5\x8B\x98", + "\xBF\xB2" => "\xE5\x9D\x8E", + "\xBF\xB3" => "\xE7\xA0\x8D", + "\xBF\xB4" => "\xE7\x9C\x8B", + "\xBF\xB5" => "\xE5\xBA\xB7", + "\xBF\xB6" => "\xE6\x85\xB7", + "\xBF\xB7" => "\xE7\xB3\xA0", + "\xBF\xB8" => "\xE6\x89\x9B", + "\xBF\xB9" => "\xE6\x8A\x97", + "\xBF\xBA" => "\xE4\xBA\xA2", + "\xBF\xBB" => "\xE7\x82\x95", + "\xBF\xBC" => "\xE8\x80\x83", + "\xBF\xBD" => "\xE6\x8B\xB7", + "\xBF\xBE" => "\xE7\x83\xA4", + "\xBF\xBF" => "\xE9\x9D\xA0", + "\xBF\xC0" => "\xE5\x9D\xB7", + "\xBF\xC1" => "\xE8\x8B\x9B", + "\xBF\xC2" => "\xE6\x9F\xAF", + "\xBF\xC3" => "\xE6\xA3\xB5", + "\xBF\xC4" => "\xE7\xA3\x95", + "\xBF\xC5" => "\xE9\xA2\x97", + "\xBF\xC6" => "\xE7\xA7\x91", + "\xBF\xC7" => "\xE5\xA3\xB3", + "\xBF\xC8" => "\xE5\x92\xB3", + "\xBF\xC9" => "\xE5\x8F\xAF", + "\xBF\xCA" => "\xE6\xB8\xB4", + "\xBF\xCB" => "\xE5\x85\x8B", + "\xBF\xCC" => "\xE5\x88\xBB", + "\xBF\xCD" => "\xE5\xAE\xA2", + "\xBF\xCE" => "\xE8\xAF\xBE", + "\xBF\xCF" => "\xE8\x82\xAF", + "\xBF\xD0" => "\xE5\x95\x83", + "\xBF\xD1" => "\xE5\x9E\xA6", + "\xBF\xD2" => "\xE6\x81\xB3", + "\xBF\xD3" => "\xE5\x9D\x91", + "\xBF\xD4" => "\xE5\x90\xAD", + "\xBF\xD5" => "\xE7\xA9\xBA", + "\xBF\xD6" => "\xE6\x81\x90", + "\xBF\xD7" => "\xE5\xAD\x94", + "\xBF\xD8" => "\xE6\x8E\xA7", + "\xBF\xD9" => "\xE6\x8A\xA0", + "\xBF\xDA" => "\xE5\x8F\xA3", + "\xBF\xDB" => "\xE6\x89\xA3", + "\xBF\xDC" => "\xE5\xAF\x87", + "\xBF\xDD" => "\xE6\x9E\xAF", + "\xBF\xDE" => "\xE5\x93\xAD", + "\xBF\xDF" => "\xE7\xAA\x9F", + "\xBF\xE0" => "\xE8\x8B\xA6", + "\xBF\xE1" => "\xE9\x85\xB7", + "\xBF\xE2" => "\xE5\xBA\x93", + "\xBF\xE3" => "\xE8\xA3\xA4", + "\xBF\xE4" => "\xE5\xA4\xB8", + "\xBF\xE5" => "\xE5\x9E\xAE", + "\xBF\xE6" => "\xE6\x8C\x8E", + "\xBF\xE7" => "\xE8\xB7\xA8", + "\xBF\xE8" => "\xE8\x83\xAF", + "\xBF\xE9" => "\xE5\x9D\x97", + "\xBF\xEA" => "\xE7\xAD\xB7", + "\xBF\xEB" => "\xE4\xBE\xA9", + "\xBF\xEC" => "\xE5\xBF\xAB", + "\xBF\xED" => "\xE5\xAE\xBD", + "\xBF\xEE" => "\xE6\xAC\xBE", + "\xBF\xEF" => "\xE5\x8C\xA1", + "\xBF\xF0" => "\xE7\xAD\x90", + "\xBF\xF1" => "\xE7\x8B\x82", + "\xBF\xF2" => "\xE6\xA1\x86", + "\xBF\xF3" => "\xE7\x9F\xBF", + "\xBF\xF4" => "\xE7\x9C\xB6", + "\xBF\xF5" => "\xE6\x97\xB7", + "\xBF\xF6" => "\xE5\x86\xB5", + "\xBF\xF7" => "\xE4\xBA\x8F", + "\xBF\xF8" => "\xE7\x9B\x94", + "\xBF\xF9" => "\xE5\xB2\xBF", + "\xBF\xFA" => "\xE7\xAA\xA5", + "\xBF\xFB" => "\xE8\x91\xB5", + "\xBF\xFC" => "\xE5\xA5\x8E", + "\xBF\xFD" => "\xE9\xAD\x81", + "\xBF\xFE" => "\xE5\x82\x80", + "\xC0\xA1" => "\xE9\xA6\x88", + "\xC0\xA2" => "\xE6\x84\xA7", + "\xC0\xA3" => "\xE6\xBA\x83", + "\xC0\xA4" => "\xE5\x9D\xA4", + "\xC0\xA5" => "\xE6\x98\x86", + "\xC0\xA6" => "\xE6\x8D\x86", + "\xC0\xA7" => "\xE5\x9B\xB0", + "\xC0\xA8" => "\xE6\x8B\xAC", + "\xC0\xA9" => "\xE6\x89\xA9", + "\xC0\xAA" => "\xE5\xBB\x93", + "\xC0\xAB" => "\xE9\x98\x94", + "\xC0\xAC" => "\xE5\x9E\x83", + "\xC0\xAD" => "\xE6\x8B\x89", + "\xC0\xAE" => "\xE5\x96\x87", + "\xC0\xAF" => "\xE8\x9C\xA1", + "\xC0\xB0" => "\xE8\x85\x8A", + "\xC0\xB1" => "\xE8\xBE\xA3", + "\xC0\xB2" => "\xE5\x95\xA6", + "\xC0\xB3" => "\xE8\x8E\xB1", + "\xC0\xB4" => "\xE6\x9D\xA5", + "\xC0\xB5" => "\xE8\xB5\x96", + "\xC0\xB6" => "\xE8\x93\x9D", + "\xC0\xB7" => "\xE5\xA9\xAA", + "\xC0\xB8" => "\xE6\xA0\x8F", + "\xC0\xB9" => "\xE6\x8B\xA6", + "\xC0\xBA" => "\xE7\xAF\xAE", + "\xC0\xBB" => "\xE9\x98\x91", + "\xC0\xBC" => "\xE5\x85\xB0", + "\xC0\xBD" => "\xE6\xBE\x9C", + "\xC0\xBE" => "\xE8\xB0\xB0", + "\xC0\xBF" => "\xE6\x8F\xBD", + "\xC0\xC0" => "\xE8\xA7\x88", + "\xC0\xC1" => "\xE6\x87\x92", + "\xC0\xC2" => "\xE7\xBC\x86", + "\xC0\xC3" => "\xE7\x83\x82", + "\xC0\xC4" => "\xE6\xBB\xA5", + "\xC0\xC5" => "\xE7\x90\x85", + "\xC0\xC6" => "\xE6\xA6\x94", + "\xC0\xC7" => "\xE7\x8B\xBC", + "\xC0\xC8" => "\xE5\xBB\x8A", + "\xC0\xC9" => "\xE9\x83\x8E", + "\xC0\xCA" => "\xE6\x9C\x97", + "\xC0\xCB" => "\xE6\xB5\xAA", + "\xC0\xCC" => "\xE6\x8D\x9E", + "\xC0\xCD" => "\xE5\x8A\xB3", + "\xC0\xCE" => "\xE7\x89\xA2", + "\xC0\xCF" => "\xE8\x80\x81", + "\xC0\xD0" => "\xE4\xBD\xAC", + "\xC0\xD1" => "\xE5\xA7\xA5", + "\xC0\xD2" => "\xE9\x85\xAA", + "\xC0\xD3" => "\xE7\x83\x99", + "\xC0\xD4" => "\xE6\xB6\x9D", + "\xC0\xD5" => "\xE5\x8B\x92", + "\xC0\xD6" => "\xE4\xB9\x90", + "\xC0\xD7" => "\xE9\x9B\xB7", + "\xC0\xD8" => "\xE9\x95\xAD", + "\xC0\xD9" => "\xE8\x95\xBE", + "\xC0\xDA" => "\xE7\xA3\x8A", + "\xC0\xDB" => "\xE7\xB4\xAF", + "\xC0\xDC" => "\xE5\x84\xA1", + "\xC0\xDD" => "\xE5\x9E\x92", + "\xC0\xDE" => "\xE6\x93\x82", + "\xC0\xDF" => "\xE8\x82\x8B", + "\xC0\xE0" => "\xE7\xB1\xBB", + "\xC0\xE1" => "\xE6\xB3\xAA", + "\xC0\xE2" => "\xE6\xA3\xB1", + "\xC0\xE3" => "\xE6\xA5\x9E", + "\xC0\xE4" => "\xE5\x86\xB7", + "\xC0\xE5" => "\xE5\x8E\x98", + "\xC0\xE6" => "\xE6\xA2\xA8", + "\xC0\xE7" => "\xE7\x8A\x81", + "\xC0\xE8" => "\xE9\xBB\x8E", + "\xC0\xE9" => "\xE7\xAF\xB1", + "\xC0\xEA" => "\xE7\x8B\xB8", + "\xC0\xEB" => "\xE7\xA6\xBB", + "\xC0\xEC" => "\xE6\xBC\x93", + "\xC0\xED" => "\xE7\x90\x86", + "\xC0\xEE" => "\xE6\x9D\x8E", + "\xC0\xEF" => "\xE9\x87\x8C", + "\xC0\xF0" => "\xE9\xB2\xA4", + "\xC0\xF1" => "\xE7\xA4\xBC", + "\xC0\xF2" => "\xE8\x8E\x89", + "\xC0\xF3" => "\xE8\x8D\x94", + "\xC0\xF4" => "\xE5\x90\x8F", + "\xC0\xF5" => "\xE6\xA0\x97", + "\xC0\xF6" => "\xE4\xB8\xBD", + "\xC0\xF7" => "\xE5\x8E\x89", + "\xC0\xF8" => "\xE5\x8A\xB1", + "\xC0\xF9" => "\xE7\xA0\xBE", + "\xC0\xFA" => "\xE5\x8E\x86", + "\xC0\xFB" => "\xE5\x88\xA9", + "\xC0\xFC" => "\xE5\x82\x88", + "\xC0\xFD" => "\xE4\xBE\x8B", + "\xC0\xFE" => "\xE4\xBF\x90", + "\xC1\xA1" => "\xE7\x97\xA2", + "\xC1\xA2" => "\xE7\xAB\x8B", + "\xC1\xA3" => "\xE7\xB2\x92", + "\xC1\xA4" => "\xE6\xB2\xA5", + "\xC1\xA5" => "\xE9\x9A\xB6", + "\xC1\xA6" => "\xE5\x8A\x9B", + "\xC1\xA7" => "\xE7\x92\x83", + "\xC1\xA8" => "\xE5\x93\xA9", + "\xC1\xA9" => "\xE4\xBF\xA9", + "\xC1\xAA" => "\xE8\x81\x94", + "\xC1\xAB" => "\xE8\x8E\xB2", + "\xC1\xAC" => "\xE8\xBF\x9E", + "\xC1\xAD" => "\xE9\x95\xB0", + "\xC1\xAE" => "\xE5\xBB\x89", + "\xC1\xAF" => "\xE6\x80\x9C", + "\xC1\xB0" => "\xE6\xB6\x9F", + "\xC1\xB1" => "\xE5\xB8\x98", + "\xC1\xB2" => "\xE6\x95\x9B", + "\xC1\xB3" => "\xE8\x84\xB8", + "\xC1\xB4" => "\xE9\x93\xBE", + "\xC1\xB5" => "\xE6\x81\x8B", + "\xC1\xB6" => "\xE7\x82\xBC", + "\xC1\xB7" => "\xE7\xBB\x83", + "\xC1\xB8" => "\xE7\xB2\xAE", + "\xC1\xB9" => "\xE5\x87\x89", + "\xC1\xBA" => "\xE6\xA2\x81", + "\xC1\xBB" => "\xE7\xB2\xB1", + "\xC1\xBC" => "\xE8\x89\xAF", + "\xC1\xBD" => "\xE4\xB8\xA4", + "\xC1\xBE" => "\xE8\xBE\x86", + "\xC1\xBF" => "\xE9\x87\x8F", + "\xC1\xC0" => "\xE6\x99\xBE", + "\xC1\xC1" => "\xE4\xBA\xAE", + "\xC1\xC2" => "\xE8\xB0\x85", + "\xC1\xC3" => "\xE6\x92\xA9", + "\xC1\xC4" => "\xE8\x81\x8A", + "\xC1\xC5" => "\xE5\x83\x9A", + "\xC1\xC6" => "\xE7\x96\x97", + "\xC1\xC7" => "\xE7\x87\x8E", + "\xC1\xC8" => "\xE5\xAF\xA5", + "\xC1\xC9" => "\xE8\xBE\xBD", + "\xC1\xCA" => "\xE6\xBD\xA6", + "\xC1\xCB" => "\xE4\xBA\x86", + "\xC1\xCC" => "\xE6\x92\x82", + "\xC1\xCD" => "\xE9\x95\xA3", + "\xC1\xCE" => "\xE5\xBB\x96", + "\xC1\xCF" => "\xE6\x96\x99", + "\xC1\xD0" => "\xE5\x88\x97", + "\xC1\xD1" => "\xE8\xA3\x82", + "\xC1\xD2" => "\xE7\x83\x88", + "\xC1\xD3" => "\xE5\x8A\xA3", + "\xC1\xD4" => "\xE7\x8C\x8E", + "\xC1\xD5" => "\xE7\x90\xB3", + "\xC1\xD6" => "\xE6\x9E\x97", + "\xC1\xD7" => "\xE7\xA3\xB7", + "\xC1\xD8" => "\xE9\x9C\x96", + "\xC1\xD9" => "\xE4\xB8\xB4", + "\xC1\xDA" => "\xE9\x82\xBB", + "\xC1\xDB" => "\xE9\xB3\x9E", + "\xC1\xDC" => "\xE6\xB7\x8B", + "\xC1\xDD" => "\xE5\x87\x9B", + "\xC1\xDE" => "\xE8\xB5\x81", + "\xC1\xDF" => "\xE5\x90\x9D", + "\xC1\xE0" => "\xE6\x8B\x8E", + "\xC1\xE1" => "\xE7\x8E\xB2", + "\xC1\xE2" => "\xE8\x8F\xB1", + "\xC1\xE3" => "\xE9\x9B\xB6", + "\xC1\xE4" => "\xE9\xBE\x84", + "\xC1\xE5" => "\xE9\x93\x83", + "\xC1\xE6" => "\xE4\xBC\xB6", + "\xC1\xE7" => "\xE7\xBE\x9A", + "\xC1\xE8" => "\xE5\x87\x8C", + "\xC1\xE9" => "\xE7\x81\xB5", + "\xC1\xEA" => "\xE9\x99\xB5", + "\xC1\xEB" => "\xE5\xB2\xAD", + "\xC1\xEC" => "\xE9\xA2\x86", + "\xC1\xED" => "\xE5\x8F\xA6", + "\xC1\xEE" => "\xE4\xBB\xA4", + "\xC1\xEF" => "\xE6\xBA\x9C", + "\xC1\xF0" => "\xE7\x90\x89", + "\xC1\xF1" => "\xE6\xA6\xB4", + "\xC1\xF2" => "\xE7\xA1\xAB", + "\xC1\xF3" => "\xE9\xA6\x8F", + "\xC1\xF4" => "\xE7\x95\x99", + "\xC1\xF5" => "\xE5\x88\x98", + "\xC1\xF6" => "\xE7\x98\xA4", + "\xC1\xF7" => "\xE6\xB5\x81", + "\xC1\xF8" => "\xE6\x9F\xB3", + "\xC1\xF9" => "\xE5\x85\xAD", + "\xC1\xFA" => "\xE9\xBE\x99", + "\xC1\xFB" => "\xE8\x81\x8B", + "\xC1\xFC" => "\xE5\x92\x99", + "\xC1\xFD" => "\xE7\xAC\xBC", + "\xC1\xFE" => "\xE7\xAA\xBF", + "\xC2\xA1" => "\xE9\x9A\x86", + "\xC2\xA2" => "\xE5\x9E\x84", + "\xC2\xA3" => "\xE6\x8B\xA2", + "\xC2\xA4" => "\xE9\x99\x87", + "\xC2\xA5" => "\xE6\xA5\xBC", + "\xC2\xA6" => "\xE5\xA8\x84", + "\xC2\xA7" => "\xE6\x90\x82", + "\xC2\xA8" => "\xE7\xAF\x93", + "\xC2\xA9" => "\xE6\xBC\x8F", + "\xC2\xAA" => "\xE9\x99\x8B", + "\xC2\xAB" => "\xE8\x8A\xA6", + "\xC2\xAC" => "\xE5\x8D\xA2", + "\xC2\xAD" => "\xE9\xA2\x85", + "\xC2\xAE" => "\xE5\xBA\x90", + "\xC2\xAF" => "\xE7\x82\x89", + "\xC2\xB0" => "\xE6\x8E\xB3", + "\xC2\xB1" => "\xE5\x8D\xA4", + "\xC2\xB2" => "\xE8\x99\x8F", + "\xC2\xB3" => "\xE9\xB2\x81", + "\xC2\xB4" => "\xE9\xBA\x93", + "\xC2\xB5" => "\xE7\xA2\x8C", + "\xC2\xB6" => "\xE9\x9C\xB2", + "\xC2\xB7" => "\xE8\xB7\xAF", + "\xC2\xB8" => "\xE8\xB5\x82", + "\xC2\xB9" => "\xE9\xB9\xBF", + "\xC2\xBA" => "\xE6\xBD\x9E", + "\xC2\xBB" => "\xE7\xA6\x84", + "\xC2\xBC" => "\xE5\xBD\x95", + "\xC2\xBD" => "\xE9\x99\x86", + "\xC2\xBE" => "\xE6\x88\xAE", + "\xC2\xBF" => "\xE9\xA9\xB4", + "\xC2\xC0" => "\xE5\x90\x95", + "\xC2\xC1" => "\xE9\x93\x9D", + "\xC2\xC2" => "\xE4\xBE\xA3", + "\xC2\xC3" => "\xE6\x97\x85", + "\xC2\xC4" => "\xE5\xB1\xA5", + "\xC2\xC5" => "\xE5\xB1\xA1", + "\xC2\xC6" => "\xE7\xBC\x95", + "\xC2\xC7" => "\xE8\x99\x91", + "\xC2\xC8" => "\xE6\xB0\xAF", + "\xC2\xC9" => "\xE5\xBE\x8B", + "\xC2\xCA" => "\xE7\x8E\x87", + "\xC2\xCB" => "\xE6\xBB\xA4", + "\xC2\xCC" => "\xE7\xBB\xBF", + "\xC2\xCD" => "\xE5\xB3\xA6", + "\xC2\xCE" => "\xE6\x8C\x9B", + "\xC2\xCF" => "\xE5\xAD\xAA", + "\xC2\xD0" => "\xE6\xBB\xA6", + "\xC2\xD1" => "\xE5\x8D\xB5", + "\xC2\xD2" => "\xE4\xB9\xB1", + "\xC2\xD3" => "\xE6\x8E\xA0", + "\xC2\xD4" => "\xE7\x95\xA5", + "\xC2\xD5" => "\xE6\x8A\xA1", + "\xC2\xD6" => "\xE8\xBD\xAE", + "\xC2\xD7" => "\xE4\xBC\xA6", + "\xC2\xD8" => "\xE4\xBB\x91", + "\xC2\xD9" => "\xE6\xB2\xA6", + "\xC2\xDA" => "\xE7\xBA\xB6", + "\xC2\xDB" => "\xE8\xAE\xBA", + "\xC2\xDC" => "\xE8\x90\x9D", + "\xC2\xDD" => "\xE8\x9E\xBA", + "\xC2\xDE" => "\xE7\xBD\x97", + "\xC2\xDF" => "\xE9\x80\xBB", + "\xC2\xE0" => "\xE9\x94\xA3", + "\xC2\xE1" => "\xE7\xAE\xA9", + "\xC2\xE2" => "\xE9\xAA\xA1", + "\xC2\xE3" => "\xE8\xA3\xB8", + "\xC2\xE4" => "\xE8\x90\xBD", + "\xC2\xE5" => "\xE6\xB4\x9B", + "\xC2\xE6" => "\xE9\xAA\x86", + "\xC2\xE7" => "\xE7\xBB\x9C", + "\xC2\xE8" => "\xE5\xA6\x88", + "\xC2\xE9" => "\xE9\xBA\xBB", + "\xC2\xEA" => "\xE7\x8E\x9B", + "\xC2\xEB" => "\xE7\xA0\x81", + "\xC2\xEC" => "\xE8\x9A\x82", + "\xC2\xED" => "\xE9\xA9\xAC", + "\xC2\xEE" => "\xE9\xAA\x82", + "\xC2\xEF" => "\xE5\x98\x9B", + "\xC2\xF0" => "\xE5\x90\x97", + "\xC2\xF1" => "\xE5\x9F\x8B", + "\xC2\xF2" => "\xE4\xB9\xB0", + "\xC2\xF3" => "\xE9\xBA\xA6", + "\xC2\xF4" => "\xE5\x8D\x96", + "\xC2\xF5" => "\xE8\xBF\x88", + "\xC2\xF6" => "\xE8\x84\x89", + "\xC2\xF7" => "\xE7\x9E\x92", + "\xC2\xF8" => "\xE9\xA6\x92", + "\xC2\xF9" => "\xE8\x9B\xAE", + "\xC2\xFA" => "\xE6\xBB\xA1", + "\xC2\xFB" => "\xE8\x94\x93", + "\xC2\xFC" => "\xE6\x9B\xBC", + "\xC2\xFD" => "\xE6\x85\xA2", + "\xC2\xFE" => "\xE6\xBC\xAB", + "\xC3\xA1" => "\xE8\xB0\xA9", + "\xC3\xA2" => "\xE8\x8A\x92", + "\xC3\xA3" => "\xE8\x8C\xAB", + "\xC3\xA4" => "\xE7\x9B\xB2", + "\xC3\xA5" => "\xE6\xB0\x93", + "\xC3\xA6" => "\xE5\xBF\x99", + "\xC3\xA7" => "\xE8\x8E\xBD", + "\xC3\xA8" => "\xE7\x8C\xAB", + "\xC3\xA9" => "\xE8\x8C\x85", + "\xC3\xAA" => "\xE9\x94\x9A", + "\xC3\xAB" => "\xE6\xAF\x9B", + "\xC3\xAC" => "\xE7\x9F\x9B", + "\xC3\xAD" => "\xE9\x93\x86", + "\xC3\xAE" => "\xE5\x8D\xAF", + "\xC3\xAF" => "\xE8\x8C\x82", + "\xC3\xB0" => "\xE5\x86\x92", + "\xC3\xB1" => "\xE5\xB8\xBD", + "\xC3\xB2" => "\xE8\xB2\x8C", + "\xC3\xB3" => "\xE8\xB4\xB8", + "\xC3\xB4" => "\xE4\xB9\x88", + "\xC3\xB5" => "\xE7\x8E\xAB", + "\xC3\xB6" => "\xE6\x9E\x9A", + "\xC3\xB7" => "\xE6\xA2\x85", + "\xC3\xB8" => "\xE9\x85\xB6", + "\xC3\xB9" => "\xE9\x9C\x89", + "\xC3\xBA" => "\xE7\x85\xA4", + "\xC3\xBB" => "\xE6\xB2\xA1", + "\xC3\xBC" => "\xE7\x9C\x89", + "\xC3\xBD" => "\xE5\xAA\x92", + "\xC3\xBE" => "\xE9\x95\x81", + "\xC3\xBF" => "\xE6\xAF\x8F", + "\xC3\xC0" => "\xE7\xBE\x8E", + "\xC3\xC1" => "\xE6\x98\xA7", + "\xC3\xC2" => "\xE5\xAF\x90", + "\xC3\xC3" => "\xE5\xA6\xB9", + "\xC3\xC4" => "\xE5\xAA\x9A", + "\xC3\xC5" => "\xE9\x97\xA8", + "\xC3\xC6" => "\xE9\x97\xB7", + "\xC3\xC7" => "\xE4\xBB\xAC", + "\xC3\xC8" => "\xE8\x90\x8C", + "\xC3\xC9" => "\xE8\x92\x99", + "\xC3\xCA" => "\xE6\xAA\xAC", + "\xC3\xCB" => "\xE7\x9B\x9F", + "\xC3\xCC" => "\xE9\x94\xB0", + "\xC3\xCD" => "\xE7\x8C\x9B", + "\xC3\xCE" => "\xE6\xA2\xA6", + "\xC3\xCF" => "\xE5\xAD\x9F", + "\xC3\xD0" => "\xE7\x9C\xAF", + "\xC3\xD1" => "\xE9\x86\x9A", + "\xC3\xD2" => "\xE9\x9D\xA1", + "\xC3\xD3" => "\xE7\xB3\x9C", + "\xC3\xD4" => "\xE8\xBF\xB7", + "\xC3\xD5" => "\xE8\xB0\x9C", + "\xC3\xD6" => "\xE5\xBC\xA5", + "\xC3\xD7" => "\xE7\xB1\xB3", + "\xC3\xD8" => "\xE7\xA7\x98", + "\xC3\xD9" => "\xE8\xA7\x85", + "\xC3\xDA" => "\xE6\xB3\x8C", + "\xC3\xDB" => "\xE8\x9C\x9C", + "\xC3\xDC" => "\xE5\xAF\x86", + "\xC3\xDD" => "\xE5\xB9\x82", + "\xC3\xDE" => "\xE6\xA3\x89", + "\xC3\xDF" => "\xE7\x9C\xA0", + "\xC3\xE0" => "\xE7\xBB\xB5", + "\xC3\xE1" => "\xE5\x86\x95", + "\xC3\xE2" => "\xE5\x85\x8D", + "\xC3\xE3" => "\xE5\x8B\x89", + "\xC3\xE4" => "\xE5\xA8\xA9", + "\xC3\xE5" => "\xE7\xBC\x85", + "\xC3\xE6" => "\xE9\x9D\xA2", + "\xC3\xE7" => "\xE8\x8B\x97", + "\xC3\xE8" => "\xE6\x8F\x8F", + "\xC3\xE9" => "\xE7\x9E\x84", + "\xC3\xEA" => "\xE8\x97\x90", + "\xC3\xEB" => "\xE7\xA7\x92", + "\xC3\xEC" => "\xE6\xB8\xBA", + "\xC3\xED" => "\xE5\xBA\x99", + "\xC3\xEE" => "\xE5\xA6\x99", + "\xC3\xEF" => "\xE8\x94\x91", + "\xC3\xF0" => "\xE7\x81\xAD", + "\xC3\xF1" => "\xE6\xB0\x91", + "\xC3\xF2" => "\xE6\x8A\xBF", + "\xC3\xF3" => "\xE7\x9A\xBF", + "\xC3\xF4" => "\xE6\x95\x8F", + "\xC3\xF5" => "\xE6\x82\xAF", + "\xC3\xF6" => "\xE9\x97\xBD", + "\xC3\xF7" => "\xE6\x98\x8E", + "\xC3\xF8" => "\xE8\x9E\x9F", + "\xC3\xF9" => "\xE9\xB8\xA3", + "\xC3\xFA" => "\xE9\x93\xAD", + "\xC3\xFB" => "\xE5\x90\x8D", + "\xC3\xFC" => "\xE5\x91\xBD", + "\xC3\xFD" => "\xE8\xB0\xAC", + "\xC3\xFE" => "\xE6\x91\xB8", + "\xC4\xA1" => "\xE6\x91\xB9", + "\xC4\xA2" => "\xE8\x98\x91", + "\xC4\xA3" => "\xE6\xA8\xA1", + "\xC4\xA4" => "\xE8\x86\x9C", + "\xC4\xA5" => "\xE7\xA3\xA8", + "\xC4\xA6" => "\xE6\x91\xA9", + "\xC4\xA7" => "\xE9\xAD\x94", + "\xC4\xA8" => "\xE6\x8A\xB9", + "\xC4\xA9" => "\xE6\x9C\xAB", + "\xC4\xAA" => "\xE8\x8E\xAB", + "\xC4\xAB" => "\xE5\xA2\xA8", + "\xC4\xAC" => "\xE9\xBB\x98", + "\xC4\xAD" => "\xE6\xB2\xAB", + "\xC4\xAE" => "\xE6\xBC\xA0", + "\xC4\xAF" => "\xE5\xAF\x9E", + "\xC4\xB0" => "\xE9\x99\x8C", + "\xC4\xB1" => "\xE8\xB0\x8B", + "\xC4\xB2" => "\xE7\x89\x9F", + "\xC4\xB3" => "\xE6\x9F\x90", + "\xC4\xB4" => "\xE6\x8B\x87", + "\xC4\xB5" => "\xE7\x89\xA1", + "\xC4\xB6" => "\xE4\xBA\xA9", + "\xC4\xB7" => "\xE5\xA7\x86", + "\xC4\xB8" => "\xE6\xAF\x8D", + "\xC4\xB9" => "\xE5\xA2\x93", + "\xC4\xBA" => "\xE6\x9A\xAE", + "\xC4\xBB" => "\xE5\xB9\x95", + "\xC4\xBC" => "\xE5\x8B\x9F", + "\xC4\xBD" => "\xE6\x85\x95", + "\xC4\xBE" => "\xE6\x9C\xA8", + "\xC4\xBF" => "\xE7\x9B\xAE", + "\xC4\xC0" => "\xE7\x9D\xA6", + "\xC4\xC1" => "\xE7\x89\xA7", + "\xC4\xC2" => "\xE7\xA9\x86", + "\xC4\xC3" => "\xE6\x8B\xBF", + "\xC4\xC4" => "\xE5\x93\xAA", + "\xC4\xC5" => "\xE5\x91\x90", + "\xC4\xC6" => "\xE9\x92\xA0", + "\xC4\xC7" => "\xE9\x82\xA3", + "\xC4\xC8" => "\xE5\xA8\x9C", + "\xC4\xC9" => "\xE7\xBA\xB3", + "\xC4\xCA" => "\xE6\xB0\x96", + "\xC4\xCB" => "\xE4\xB9\x83", + "\xC4\xCC" => "\xE5\xA5\xB6", + "\xC4\xCD" => "\xE8\x80\x90", + "\xC4\xCE" => "\xE5\xA5\x88", + "\xC4\xCF" => "\xE5\x8D\x97", + "\xC4\xD0" => "\xE7\x94\xB7", + "\xC4\xD1" => "\xE9\x9A\xBE", + "\xC4\xD2" => "\xE5\x9B\x8A", + "\xC4\xD3" => "\xE6\x8C\xA0", + "\xC4\xD4" => "\xE8\x84\x91", + "\xC4\xD5" => "\xE6\x81\xBC", + "\xC4\xD6" => "\xE9\x97\xB9", + "\xC4\xD7" => "\xE6\xB7\x96", + "\xC4\xD8" => "\xE5\x91\xA2", + "\xC4\xD9" => "\xE9\xA6\x81", + "\xC4\xDA" => "\xE5\x86\x85", + "\xC4\xDB" => "\xE5\xAB\xA9", + "\xC4\xDC" => "\xE8\x83\xBD", + "\xC4\xDD" => "\xE5\xA6\xAE", + "\xC4\xDE" => "\xE9\x9C\x93", + "\xC4\xDF" => "\xE5\x80\xAA", + "\xC4\xE0" => "\xE6\xB3\xA5", + "\xC4\xE1" => "\xE5\xB0\xBC", + "\xC4\xE2" => "\xE6\x8B\x9F", + "\xC4\xE3" => "\xE4\xBD\xA0", + "\xC4\xE4" => "\xE5\x8C\xBF", + "\xC4\xE5" => "\xE8\x85\xBB", + "\xC4\xE6" => "\xE9\x80\x86", + "\xC4\xE7" => "\xE6\xBA\xBA", + "\xC4\xE8" => "\xE8\x94\xAB", + "\xC4\xE9" => "\xE6\x8B\x88", + "\xC4\xEA" => "\xE5\xB9\xB4", + "\xC4\xEB" => "\xE7\xA2\xBE", + "\xC4\xEC" => "\xE6\x92\xB5", + "\xC4\xED" => "\xE6\x8D\xBB", + "\xC4\xEE" => "\xE5\xBF\xB5", + "\xC4\xEF" => "\xE5\xA8\x98", + "\xC4\xF0" => "\xE9\x85\xBF", + "\xC4\xF1" => "\xE9\xB8\x9F", + "\xC4\xF2" => "\xE5\xB0\xBF", + "\xC4\xF3" => "\xE6\x8D\x8F", + "\xC4\xF4" => "\xE8\x81\x82", + "\xC4\xF5" => "\xE5\xAD\xBD", + "\xC4\xF6" => "\xE5\x95\xAE", + "\xC4\xF7" => "\xE9\x95\x8A", + "\xC4\xF8" => "\xE9\x95\x8D", + "\xC4\xF9" => "\xE6\xB6\x85", + "\xC4\xFA" => "\xE6\x82\xA8", + "\xC4\xFB" => "\xE6\x9F\xA0", + "\xC4\xFC" => "\xE7\x8B\x9E", + "\xC4\xFD" => "\xE5\x87\x9D", + "\xC4\xFE" => "\xE5\xAE\x81", + "\xC5\xA1" => "\xE6\x8B\xA7", + "\xC5\xA2" => "\xE6\xB3\x9E", + "\xC5\xA3" => "\xE7\x89\x9B", + "\xC5\xA4" => "\xE6\x89\xAD", + "\xC5\xA5" => "\xE9\x92\xAE", + "\xC5\xA6" => "\xE7\xBA\xBD", + "\xC5\xA7" => "\xE8\x84\x93", + "\xC5\xA8" => "\xE6\xB5\x93", + "\xC5\xA9" => "\xE5\x86\x9C", + "\xC5\xAA" => "\xE5\xBC\x84", + "\xC5\xAB" => "\xE5\xA5\xB4", + "\xC5\xAC" => "\xE5\x8A\xAA", + "\xC5\xAD" => "\xE6\x80\x92", + "\xC5\xAE" => "\xE5\xA5\xB3", + "\xC5\xAF" => "\xE6\x9A\x96", + "\xC5\xB0" => "\xE8\x99\x90", + "\xC5\xB1" => "\xE7\x96\x9F", + "\xC5\xB2" => "\xE6\x8C\xAA", + "\xC5\xB3" => "\xE6\x87\xA6", + "\xC5\xB4" => "\xE7\xB3\xAF", + "\xC5\xB5" => "\xE8\xAF\xBA", + "\xC5\xB6" => "\xE5\x93\xA6", + "\xC5\xB7" => "\xE6\xAC\xA7", + "\xC5\xB8" => "\xE9\xB8\xA5", + "\xC5\xB9" => "\xE6\xAE\xB4", + "\xC5\xBA" => "\xE8\x97\x95", + "\xC5\xBB" => "\xE5\x91\x95", + "\xC5\xBC" => "\xE5\x81\xB6", + "\xC5\xBD" => "\xE6\xB2\xA4", + "\xC5\xBE" => "\xE5\x95\xAA", + "\xC5\xBF" => "\xE8\xB6\xB4", + "\xC5\xC0" => "\xE7\x88\xAC", + "\xC5\xC1" => "\xE5\xB8\x95", + "\xC5\xC2" => "\xE6\x80\x95", + "\xC5\xC3" => "\xE7\x90\xB6", + "\xC5\xC4" => "\xE6\x8B\x8D", + "\xC5\xC5" => "\xE6\x8E\x92", + "\xC5\xC6" => "\xE7\x89\x8C", + "\xC5\xC7" => "\xE5\xBE\x98", + "\xC5\xC8" => "\xE6\xB9\x83", + "\xC5\xC9" => "\xE6\xB4\xBE", + "\xC5\xCA" => "\xE6\x94\x80", + "\xC5\xCB" => "\xE6\xBD\x98", + "\xC5\xCC" => "\xE7\x9B\x98", + "\xC5\xCD" => "\xE7\xA3\x90", + "\xC5\xCE" => "\xE7\x9B\xBC", + "\xC5\xCF" => "\xE7\x95\x94", + "\xC5\xD0" => "\xE5\x88\xA4", + "\xC5\xD1" => "\xE5\x8F\x9B", + "\xC5\xD2" => "\xE4\xB9\x93", + "\xC5\xD3" => "\xE5\xBA\x9E", + "\xC5\xD4" => "\xE6\x97\x81", + "\xC5\xD5" => "\xE8\x80\xAA", + "\xC5\xD6" => "\xE8\x83\x96", + "\xC5\xD7" => "\xE6\x8A\x9B", + "\xC5\xD8" => "\xE5\x92\x86", + "\xC5\xD9" => "\xE5\x88\xA8", + "\xC5\xDA" => "\xE7\x82\xAE", + "\xC5\xDB" => "\xE8\xA2\x8D", + "\xC5\xDC" => "\xE8\xB7\x91", + "\xC5\xDD" => "\xE6\xB3\xA1", + "\xC5\xDE" => "\xE5\x91\xB8", + "\xC5\xDF" => "\xE8\x83\x9A", + "\xC5\xE0" => "\xE5\x9F\xB9", + "\xC5\xE1" => "\xE8\xA3\xB4", + "\xC5\xE2" => "\xE8\xB5\x94", + "\xC5\xE3" => "\xE9\x99\xAA", + "\xC5\xE4" => "\xE9\x85\x8D", + "\xC5\xE5" => "\xE4\xBD\xA9", + "\xC5\xE6" => "\xE6\xB2\x9B", + "\xC5\xE7" => "\xE5\x96\xB7", + "\xC5\xE8" => "\xE7\x9B\x86", + "\xC5\xE9" => "\xE7\xA0\xB0", + "\xC5\xEA" => "\xE6\x8A\xA8", + "\xC5\xEB" => "\xE7\x83\xB9", + "\xC5\xEC" => "\xE6\xBE\x8E", + "\xC5\xED" => "\xE5\xBD\xAD", + "\xC5\xEE" => "\xE8\x93\xAC", + "\xC5\xEF" => "\xE6\xA3\x9A", + "\xC5\xF0" => "\xE7\xA1\xBC", + "\xC5\xF1" => "\xE7\xAF\xB7", + "\xC5\xF2" => "\xE8\x86\xA8", + "\xC5\xF3" => "\xE6\x9C\x8B", + "\xC5\xF4" => "\xE9\xB9\x8F", + "\xC5\xF5" => "\xE6\x8D\xA7", + "\xC5\xF6" => "\xE7\xA2\xB0", + "\xC5\xF7" => "\xE5\x9D\xAF", + "\xC5\xF8" => "\xE7\xA0\x92", + "\xC5\xF9" => "\xE9\x9C\xB9", + "\xC5\xFA" => "\xE6\x89\xB9", + "\xC5\xFB" => "\xE6\x8A\xAB", + "\xC5\xFC" => "\xE5\x8A\x88", + "\xC5\xFD" => "\xE7\x90\xB5", + "\xC5\xFE" => "\xE6\xAF\x97", + "\xC6\xA1" => "\xE5\x95\xA4", + "\xC6\xA2" => "\xE8\x84\xBE", + "\xC6\xA3" => "\xE7\x96\xB2", + "\xC6\xA4" => "\xE7\x9A\xAE", + "\xC6\xA5" => "\xE5\x8C\xB9", + "\xC6\xA6" => "\xE7\x97\x9E", + "\xC6\xA7" => "\xE5\x83\xBB", + "\xC6\xA8" => "\xE5\xB1\x81", + "\xC6\xA9" => "\xE8\xAD\xAC", + "\xC6\xAA" => "\xE7\xAF\x87", + "\xC6\xAB" => "\xE5\x81\x8F", + "\xC6\xAC" => "\xE7\x89\x87", + "\xC6\xAD" => "\xE9\xAA\x97", + "\xC6\xAE" => "\xE9\xA3\x98", + "\xC6\xAF" => "\xE6\xBC\x82", + "\xC6\xB0" => "\xE7\x93\xA2", + "\xC6\xB1" => "\xE7\xA5\xA8", + "\xC6\xB2" => "\xE6\x92\x87", + "\xC6\xB3" => "\xE7\x9E\xA5", + "\xC6\xB4" => "\xE6\x8B\xBC", + "\xC6\xB5" => "\xE9\xA2\x91", + "\xC6\xB6" => "\xE8\xB4\xAB", + "\xC6\xB7" => "\xE5\x93\x81", + "\xC6\xB8" => "\xE8\x81\x98", + "\xC6\xB9" => "\xE4\xB9\x92", + "\xC6\xBA" => "\xE5\x9D\xAA", + "\xC6\xBB" => "\xE8\x8B\xB9", + "\xC6\xBC" => "\xE8\x90\x8D", + "\xC6\xBD" => "\xE5\xB9\xB3", + "\xC6\xBE" => "\xE5\x87\xAD", + "\xC6\xBF" => "\xE7\x93\xB6", + "\xC6\xC0" => "\xE8\xAF\x84", + "\xC6\xC1" => "\xE5\xB1\x8F", + "\xC6\xC2" => "\xE5\x9D\xA1", + "\xC6\xC3" => "\xE6\xB3\xBC", + "\xC6\xC4" => "\xE9\xA2\x87", + "\xC6\xC5" => "\xE5\xA9\x86", + "\xC6\xC6" => "\xE7\xA0\xB4", + "\xC6\xC7" => "\xE9\xAD\x84", + "\xC6\xC8" => "\xE8\xBF\xAB", + "\xC6\xC9" => "\xE7\xB2\x95", + "\xC6\xCA" => "\xE5\x89\x96", + "\xC6\xCB" => "\xE6\x89\x91", + "\xC6\xCC" => "\xE9\x93\xBA", + "\xC6\xCD" => "\xE4\xBB\x86", + "\xC6\xCE" => "\xE8\x8E\x86", + "\xC6\xCF" => "\xE8\x91\xA1", + "\xC6\xD0" => "\xE8\x8F\xA9", + "\xC6\xD1" => "\xE8\x92\xB2", + "\xC6\xD2" => "\xE5\x9F\x94", + "\xC6\xD3" => "\xE6\x9C\xB4", + "\xC6\xD4" => "\xE5\x9C\x83", + "\xC6\xD5" => "\xE6\x99\xAE", + "\xC6\xD6" => "\xE6\xB5\xA6", + "\xC6\xD7" => "\xE8\xB0\xB1", + "\xC6\xD8" => "\xE6\x9B\x9D", + "\xC6\xD9" => "\xE7\x80\x91", + "\xC6\xDA" => "\xE6\x9C\x9F", + "\xC6\xDB" => "\xE6\xAC\xBA", + "\xC6\xDC" => "\xE6\xA0\x96", + "\xC6\xDD" => "\xE6\x88\x9A", + "\xC6\xDE" => "\xE5\xA6\xBB", + "\xC6\xDF" => "\xE4\xB8\x83", + "\xC6\xE0" => "\xE5\x87\x84", + "\xC6\xE1" => "\xE6\xBC\x86", + "\xC6\xE2" => "\xE6\x9F\x92", + "\xC6\xE3" => "\xE6\xB2\x8F", + "\xC6\xE4" => "\xE5\x85\xB6", + "\xC6\xE5" => "\xE6\xA3\x8B", + "\xC6\xE6" => "\xE5\xA5\x87", + "\xC6\xE7" => "\xE6\xAD\xA7", + "\xC6\xE8" => "\xE7\x95\xA6", + "\xC6\xE9" => "\xE5\xB4\x8E", + "\xC6\xEA" => "\xE8\x84\x90", + "\xC6\xEB" => "\xE9\xBD\x90", + "\xC6\xEC" => "\xE6\x97\x97", + "\xC6\xED" => "\xE7\xA5\x88", + "\xC6\xEE" => "\xE7\xA5\x81", + "\xC6\xEF" => "\xE9\xAA\x91", + "\xC6\xF0" => "\xE8\xB5\xB7", + "\xC6\xF1" => "\xE5\xB2\x82", + "\xC6\xF2" => "\xE4\xB9\x9E", + "\xC6\xF3" => "\xE4\xBC\x81", + "\xC6\xF4" => "\xE5\x90\xAF", + "\xC6\xF5" => "\xE5\xA5\x91", + "\xC6\xF6" => "\xE7\xA0\x8C", + "\xC6\xF7" => "\xE5\x99\xA8", + "\xC6\xF8" => "\xE6\xB0\x94", + "\xC6\xF9" => "\xE8\xBF\x84", + "\xC6\xFA" => "\xE5\xBC\x83", + "\xC6\xFB" => "\xE6\xB1\xBD", + "\xC6\xFC" => "\xE6\xB3\xA3", + "\xC6\xFD" => "\xE8\xAE\xAB", + "\xC6\xFE" => "\xE6\x8E\x90", + "\xC7\xA1" => "\xE6\x81\xB0", + "\xC7\xA2" => "\xE6\xB4\xBD", + "\xC7\xA3" => "\xE7\x89\xB5", + "\xC7\xA4" => "\xE6\x89\xA6", + "\xC7\xA5" => "\xE9\x92\x8E", + "\xC7\xA6" => "\xE9\x93\x85", + "\xC7\xA7" => "\xE5\x8D\x83", + "\xC7\xA8" => "\xE8\xBF\x81", + "\xC7\xA9" => "\xE7\xAD\xBE", + "\xC7\xAA" => "\xE4\xBB\x9F", + "\xC7\xAB" => "\xE8\xB0\xA6", + "\xC7\xAC" => "\xE4\xB9\xBE", + "\xC7\xAD" => "\xE9\xBB\x94", + "\xC7\xAE" => "\xE9\x92\xB1", + "\xC7\xAF" => "\xE9\x92\xB3", + "\xC7\xB0" => "\xE5\x89\x8D", + "\xC7\xB1" => "\xE6\xBD\x9C", + "\xC7\xB2" => "\xE9\x81\xA3", + "\xC7\xB3" => "\xE6\xB5\x85", + "\xC7\xB4" => "\xE8\xB0\xB4", + "\xC7\xB5" => "\xE5\xA0\x91", + "\xC7\xB6" => "\xE5\xB5\x8C", + "\xC7\xB7" => "\xE6\xAC\xA0", + "\xC7\xB8" => "\xE6\xAD\x89", + "\xC7\xB9" => "\xE6\x9E\xAA", + "\xC7\xBA" => "\xE5\x91\x9B", + "\xC7\xBB" => "\xE8\x85\x94", + "\xC7\xBC" => "\xE7\xBE\x8C", + "\xC7\xBD" => "\xE5\xA2\x99", + "\xC7\xBE" => "\xE8\x94\xB7", + "\xC7\xBF" => "\xE5\xBC\xBA", + "\xC7\xC0" => "\xE6\x8A\xA2", + "\xC7\xC1" => "\xE6\xA9\x87", + "\xC7\xC2" => "\xE9\x94\xB9", + "\xC7\xC3" => "\xE6\x95\xB2", + "\xC7\xC4" => "\xE6\x82\x84", + "\xC7\xC5" => "\xE6\xA1\xA5", + "\xC7\xC6" => "\xE7\x9E\xA7", + "\xC7\xC7" => "\xE4\xB9\x94", + "\xC7\xC8" => "\xE4\xBE\xA8", + "\xC7\xC9" => "\xE5\xB7\xA7", + "\xC7\xCA" => "\xE9\x9E\x98", + "\xC7\xCB" => "\xE6\x92\xAC", + "\xC7\xCC" => "\xE7\xBF\x98", + "\xC7\xCD" => "\xE5\xB3\xAD", + "\xC7\xCE" => "\xE4\xBF\x8F", + "\xC7\xCF" => "\xE7\xAA\x8D", + "\xC7\xD0" => "\xE5\x88\x87", + "\xC7\xD1" => "\xE8\x8C\x84", + "\xC7\xD2" => "\xE4\xB8\x94", + "\xC7\xD3" => "\xE6\x80\xAF", + "\xC7\xD4" => "\xE7\xAA\x83", + "\xC7\xD5" => "\xE9\x92\xA6", + "\xC7\xD6" => "\xE4\xBE\xB5", + "\xC7\xD7" => "\xE4\xBA\xB2", + "\xC7\xD8" => "\xE7\xA7\xA6", + "\xC7\xD9" => "\xE7\x90\xB4", + "\xC7\xDA" => "\xE5\x8B\xA4", + "\xC7\xDB" => "\xE8\x8A\xB9", + "\xC7\xDC" => "\xE6\x93\x92", + "\xC7\xDD" => "\xE7\xA6\xBD", + "\xC7\xDE" => "\xE5\xAF\x9D", + "\xC7\xDF" => "\xE6\xB2\x81", + "\xC7\xE0" => "\xE9\x9D\x92", + "\xC7\xE1" => "\xE8\xBD\xBB", + "\xC7\xE2" => "\xE6\xB0\xA2", + "\xC7\xE3" => "\xE5\x80\xBE", + "\xC7\xE4" => "\xE5\x8D\xBF", + "\xC7\xE5" => "\xE6\xB8\x85", + "\xC7\xE6" => "\xE6\x93\x8E", + "\xC7\xE7" => "\xE6\x99\xB4", + "\xC7\xE8" => "\xE6\xB0\xB0", + "\xC7\xE9" => "\xE6\x83\x85", + "\xC7\xEA" => "\xE9\xA1\xB7", + "\xC7\xEB" => "\xE8\xAF\xB7", + "\xC7\xEC" => "\xE5\xBA\x86", + "\xC7\xED" => "\xE7\x90\xBC", + "\xC7\xEE" => "\xE7\xA9\xB7", + "\xC7\xEF" => "\xE7\xA7\x8B", + "\xC7\xF0" => "\xE4\xB8\x98", + "\xC7\xF1" => "\xE9\x82\xB1", + "\xC7\xF2" => "\xE7\x90\x83", + "\xC7\xF3" => "\xE6\xB1\x82", + "\xC7\xF4" => "\xE5\x9B\x9A", + "\xC7\xF5" => "\xE9\x85\x8B", + "\xC7\xF6" => "\xE6\xB3\x85", + "\xC7\xF7" => "\xE8\xB6\x8B", + "\xC7\xF8" => "\xE5\x8C\xBA", + "\xC7\xF9" => "\xE8\x9B\x86", + "\xC7\xFA" => "\xE6\x9B\xB2", + "\xC7\xFB" => "\xE8\xBA\xAF", + "\xC7\xFC" => "\xE5\xB1\x88", + "\xC7\xFD" => "\xE9\xA9\xB1", + "\xC7\xFE" => "\xE6\xB8\xA0", + "\xC8\xA1" => "\xE5\x8F\x96", + "\xC8\xA2" => "\xE5\xA8\xB6", + "\xC8\xA3" => "\xE9\xBE\x8B", + "\xC8\xA4" => "\xE8\xB6\xA3", + "\xC8\xA5" => "\xE5\x8E\xBB", + "\xC8\xA6" => "\xE5\x9C\x88", + "\xC8\xA7" => "\xE9\xA2\xA7", + "\xC8\xA8" => "\xE6\x9D\x83", + "\xC8\xA9" => "\xE9\x86\x9B", + "\xC8\xAA" => "\xE6\xB3\x89", + "\xC8\xAB" => "\xE5\x85\xA8", + "\xC8\xAC" => "\xE7\x97\x8A", + "\xC8\xAD" => "\xE6\x8B\xB3", + "\xC8\xAE" => "\xE7\x8A\xAC", + "\xC8\xAF" => "\xE5\x88\xB8", + "\xC8\xB0" => "\xE5\x8A\x9D", + "\xC8\xB1" => "\xE7\xBC\xBA", + "\xC8\xB2" => "\xE7\x82\x94", + "\xC8\xB3" => "\xE7\x98\xB8", + "\xC8\xB4" => "\xE5\x8D\xB4", + "\xC8\xB5" => "\xE9\xB9\x8A", + "\xC8\xB6" => "\xE6\xA6\xB7", + "\xC8\xB7" => "\xE7\xA1\xAE", + "\xC8\xB8" => "\xE9\x9B\x80", + "\xC8\xB9" => "\xE8\xA3\x99", + "\xC8\xBA" => "\xE7\xBE\xA4", + "\xC8\xBB" => "\xE7\x84\xB6", + "\xC8\xBC" => "\xE7\x87\x83", + "\xC8\xBD" => "\xE5\x86\x89", + "\xC8\xBE" => "\xE6\x9F\x93", + "\xC8\xBF" => "\xE7\x93\xA4", + "\xC8\xC0" => "\xE5\xA3\xA4", + "\xC8\xC1" => "\xE6\x94\x98", + "\xC8\xC2" => "\xE5\x9A\xB7", + "\xC8\xC3" => "\xE8\xAE\xA9", + "\xC8\xC4" => "\xE9\xA5\xB6", + "\xC8\xC5" => "\xE6\x89\xB0", + "\xC8\xC6" => "\xE7\xBB\x95", + "\xC8\xC7" => "\xE6\x83\xB9", + "\xC8\xC8" => "\xE7\x83\xAD", + "\xC8\xC9" => "\xE5\xA3\xAC", + "\xC8\xCA" => "\xE4\xBB\x81", + "\xC8\xCB" => "\xE4\xBA\xBA", + "\xC8\xCC" => "\xE5\xBF\x8D", + "\xC8\xCD" => "\xE9\x9F\xA7", + "\xC8\xCE" => "\xE4\xBB\xBB", + "\xC8\xCF" => "\xE8\xAE\xA4", + "\xC8\xD0" => "\xE5\x88\x83", + "\xC8\xD1" => "\xE5\xA6\x8A", + "\xC8\xD2" => "\xE7\xBA\xAB", + "\xC8\xD3" => "\xE6\x89\x94", + "\xC8\xD4" => "\xE4\xBB\x8D", + "\xC8\xD5" => "\xE6\x97\xA5", + "\xC8\xD6" => "\xE6\x88\x8E", + "\xC8\xD7" => "\xE8\x8C\xB8", + "\xC8\xD8" => "\xE8\x93\x89", + "\xC8\xD9" => "\xE8\x8D\xA3", + "\xC8\xDA" => "\xE8\x9E\x8D", + "\xC8\xDB" => "\xE7\x86\x94", + "\xC8\xDC" => "\xE6\xBA\xB6", + "\xC8\xDD" => "\xE5\xAE\xB9", + "\xC8\xDE" => "\xE7\xBB\x92", + "\xC8\xDF" => "\xE5\x86\x97", + "\xC8\xE0" => "\xE6\x8F\x89", + "\xC8\xE1" => "\xE6\x9F\x94", + "\xC8\xE2" => "\xE8\x82\x89", + "\xC8\xE3" => "\xE8\x8C\xB9", + "\xC8\xE4" => "\xE8\xA0\x95", + "\xC8\xE5" => "\xE5\x84\x92", + "\xC8\xE6" => "\xE5\xAD\xBA", + "\xC8\xE7" => "\xE5\xA6\x82", + "\xC8\xE8" => "\xE8\xBE\xB1", + "\xC8\xE9" => "\xE4\xB9\xB3", + "\xC8\xEA" => "\xE6\xB1\x9D", + "\xC8\xEB" => "\xE5\x85\xA5", + "\xC8\xEC" => "\xE8\xA4\xA5", + "\xC8\xED" => "\xE8\xBD\xAF", + "\xC8\xEE" => "\xE9\x98\xAE", + "\xC8\xEF" => "\xE8\x95\x8A", + "\xC8\xF0" => "\xE7\x91\x9E", + "\xC8\xF1" => "\xE9\x94\x90", + "\xC8\xF2" => "\xE9\x97\xB0", + "\xC8\xF3" => "\xE6\xB6\xA6", + "\xC8\xF4" => "\xE8\x8B\xA5", + "\xC8\xF5" => "\xE5\xBC\xB1", + "\xC8\xF6" => "\xE6\x92\x92", + "\xC8\xF7" => "\xE6\xB4\x92", + "\xC8\xF8" => "\xE8\x90\xA8", + "\xC8\xF9" => "\xE8\x85\xAE", + "\xC8\xFA" => "\xE9\xB3\x83", + "\xC8\xFB" => "\xE5\xA1\x9E", + "\xC8\xFC" => "\xE8\xB5\x9B", + "\xC8\xFD" => "\xE4\xB8\x89", + "\xC8\xFE" => "\xE5\x8F\x81", + "\xC9\xA1" => "\xE4\xBC\x9E", + "\xC9\xA2" => "\xE6\x95\xA3", + "\xC9\xA3" => "\xE6\xA1\x91", + "\xC9\xA4" => "\xE5\x97\x93", + "\xC9\xA5" => "\xE4\xB8\xA7", + "\xC9\xA6" => "\xE6\x90\x94", + "\xC9\xA7" => "\xE9\xAA\x9A", + "\xC9\xA8" => "\xE6\x89\xAB", + "\xC9\xA9" => "\xE5\xAB\x82", + "\xC9\xAA" => "\xE7\x91\x9F", + "\xC9\xAB" => "\xE8\x89\xB2", + "\xC9\xAC" => "\xE6\xB6\xA9", + "\xC9\xAD" => "\xE6\xA3\xAE", + "\xC9\xAE" => "\xE5\x83\xA7", + "\xC9\xAF" => "\xE8\x8E\x8E", + "\xC9\xB0" => "\xE7\xA0\x82", + "\xC9\xB1" => "\xE6\x9D\x80", + "\xC9\xB2" => "\xE5\x88\xB9", + "\xC9\xB3" => "\xE6\xB2\x99", + "\xC9\xB4" => "\xE7\xBA\xB1", + "\xC9\xB5" => "\xE5\x82\xBB", + "\xC9\xB6" => "\xE5\x95\xA5", + "\xC9\xB7" => "\xE7\x85\x9E", + "\xC9\xB8" => "\xE7\xAD\x9B", + "\xC9\xB9" => "\xE6\x99\x92", + "\xC9\xBA" => "\xE7\x8F\x8A", + "\xC9\xBB" => "\xE8\x8B\xAB", + "\xC9\xBC" => "\xE6\x9D\x89", + "\xC9\xBD" => "\xE5\xB1\xB1", + "\xC9\xBE" => "\xE5\x88\xA0", + "\xC9\xBF" => "\xE7\x85\xBD", + "\xC9\xC0" => "\xE8\xA1\xAB", + "\xC9\xC1" => "\xE9\x97\xAA", + "\xC9\xC2" => "\xE9\x99\x95", + "\xC9\xC3" => "\xE6\x93\x85", + "\xC9\xC4" => "\xE8\xB5\xA1", + "\xC9\xC5" => "\xE8\x86\xB3", + "\xC9\xC6" => "\xE5\x96\x84", + "\xC9\xC7" => "\xE6\xB1\x95", + "\xC9\xC8" => "\xE6\x89\x87", + "\xC9\xC9" => "\xE7\xBC\xAE", + "\xC9\xCA" => "\xE5\xA2\x92", + "\xC9\xCB" => "\xE4\xBC\xA4", + "\xC9\xCC" => "\xE5\x95\x86", + "\xC9\xCD" => "\xE8\xB5\x8F", + "\xC9\xCE" => "\xE6\x99\x8C", + "\xC9\xCF" => "\xE4\xB8\x8A", + "\xC9\xD0" => "\xE5\xB0\x9A", + "\xC9\xD1" => "\xE8\xA3\xB3", + "\xC9\xD2" => "\xE6\xA2\xA2", + "\xC9\xD3" => "\xE6\x8D\x8E", + "\xC9\xD4" => "\xE7\xA8\x8D", + "\xC9\xD5" => "\xE7\x83\xA7", + "\xC9\xD6" => "\xE8\x8A\x8D", + "\xC9\xD7" => "\xE5\x8B\xBA", + "\xC9\xD8" => "\xE9\x9F\xB6", + "\xC9\xD9" => "\xE5\xB0\x91", + "\xC9\xDA" => "\xE5\x93\xA8", + "\xC9\xDB" => "\xE9\x82\xB5", + "\xC9\xDC" => "\xE7\xBB\x8D", + "\xC9\xDD" => "\xE5\xA5\xA2", + "\xC9\xDE" => "\xE8\xB5\x8A", + "\xC9\xDF" => "\xE8\x9B\x87", + "\xC9\xE0" => "\xE8\x88\x8C", + "\xC9\xE1" => "\xE8\x88\x8D", + "\xC9\xE2" => "\xE8\xB5\xA6", + "\xC9\xE3" => "\xE6\x91\x84", + "\xC9\xE4" => "\xE5\xB0\x84", + "\xC9\xE5" => "\xE6\x85\x91", + "\xC9\xE6" => "\xE6\xB6\x89", + "\xC9\xE7" => "\xE7\xA4\xBE", + "\xC9\xE8" => "\xE8\xAE\xBE", + "\xC9\xE9" => "\xE7\xA0\xB7", + "\xC9\xEA" => "\xE7\x94\xB3", + "\xC9\xEB" => "\xE5\x91\xBB", + "\xC9\xEC" => "\xE4\xBC\xB8", + "\xC9\xED" => "\xE8\xBA\xAB", + "\xC9\xEE" => "\xE6\xB7\xB1", + "\xC9\xEF" => "\xE5\xA8\xA0", + "\xC9\xF0" => "\xE7\xBB\x85", + "\xC9\xF1" => "\xE7\xA5\x9E", + "\xC9\xF2" => "\xE6\xB2\x88", + "\xC9\xF3" => "\xE5\xAE\xA1", + "\xC9\xF4" => "\xE5\xA9\xB6", + "\xC9\xF5" => "\xE7\x94\x9A", + "\xC9\xF6" => "\xE8\x82\xBE", + "\xC9\xF7" => "\xE6\x85\x8E", + "\xC9\xF8" => "\xE6\xB8\x97", + "\xC9\xF9" => "\xE5\xA3\xB0", + "\xC9\xFA" => "\xE7\x94\x9F", + "\xC9\xFB" => "\xE7\x94\xA5", + "\xC9\xFC" => "\xE7\x89\xB2", + "\xC9\xFD" => "\xE5\x8D\x87", + "\xC9\xFE" => "\xE7\xBB\xB3", + "\xCA\xA1" => "\xE7\x9C\x81", + "\xCA\xA2" => "\xE7\x9B\x9B", + "\xCA\xA3" => "\xE5\x89\xA9", + "\xCA\xA4" => "\xE8\x83\x9C", + "\xCA\xA5" => "\xE5\x9C\xA3", + "\xCA\xA6" => "\xE5\xB8\x88", + "\xCA\xA7" => "\xE5\xA4\xB1", + "\xCA\xA8" => "\xE7\x8B\xAE", + "\xCA\xA9" => "\xE6\x96\xBD", + "\xCA\xAA" => "\xE6\xB9\xBF", + "\xCA\xAB" => "\xE8\xAF\x97", + "\xCA\xAC" => "\xE5\xB0\xB8", + "\xCA\xAD" => "\xE8\x99\xB1", + "\xCA\xAE" => "\xE5\x8D\x81", + "\xCA\xAF" => "\xE7\x9F\xB3", + "\xCA\xB0" => "\xE6\x8B\xBE", + "\xCA\xB1" => "\xE6\x97\xB6", + "\xCA\xB2" => "\xE4\xBB\x80", + "\xCA\xB3" => "\xE9\xA3\x9F", + "\xCA\xB4" => "\xE8\x9A\x80", + "\xCA\xB5" => "\xE5\xAE\x9E", + "\xCA\xB6" => "\xE8\xAF\x86", + "\xCA\xB7" => "\xE5\x8F\xB2", + "\xCA\xB8" => "\xE7\x9F\xA2", + "\xCA\xB9" => "\xE4\xBD\xBF", + "\xCA\xBA" => "\xE5\xB1\x8E", + "\xCA\xBB" => "\xE9\xA9\xB6", + "\xCA\xBC" => "\xE5\xA7\x8B", + "\xCA\xBD" => "\xE5\xBC\x8F", + "\xCA\xBE" => "\xE7\xA4\xBA", + "\xCA\xBF" => "\xE5\xA3\xAB", + "\xCA\xC0" => "\xE4\xB8\x96", + "\xCA\xC1" => "\xE6\x9F\xBF", + "\xCA\xC2" => "\xE4\xBA\x8B", + "\xCA\xC3" => "\xE6\x8B\xAD", + "\xCA\xC4" => "\xE8\xAA\x93", + "\xCA\xC5" => "\xE9\x80\x9D", + "\xCA\xC6" => "\xE5\x8A\xBF", + "\xCA\xC7" => "\xE6\x98\xAF", + "\xCA\xC8" => "\xE5\x97\x9C", + "\xCA\xC9" => "\xE5\x99\xAC", + "\xCA\xCA" => "\xE9\x80\x82", + "\xCA\xCB" => "\xE4\xBB\x95", + "\xCA\xCC" => "\xE4\xBE\x8D", + "\xCA\xCD" => "\xE9\x87\x8A", + "\xCA\xCE" => "\xE9\xA5\xB0", + "\xCA\xCF" => "\xE6\xB0\x8F", + "\xCA\xD0" => "\xE5\xB8\x82", + "\xCA\xD1" => "\xE6\x81\x83", + "\xCA\xD2" => "\xE5\xAE\xA4", + "\xCA\xD3" => "\xE8\xA7\x86", + "\xCA\xD4" => "\xE8\xAF\x95", + "\xCA\xD5" => "\xE6\x94\xB6", + "\xCA\xD6" => "\xE6\x89\x8B", + "\xCA\xD7" => "\xE9\xA6\x96", + "\xCA\xD8" => "\xE5\xAE\x88", + "\xCA\xD9" => "\xE5\xAF\xBF", + "\xCA\xDA" => "\xE6\x8E\x88", + "\xCA\xDB" => "\xE5\x94\xAE", + "\xCA\xDC" => "\xE5\x8F\x97", + "\xCA\xDD" => "\xE7\x98\xA6", + "\xCA\xDE" => "\xE5\x85\xBD", + "\xCA\xDF" => "\xE8\x94\xAC", + "\xCA\xE0" => "\xE6\x9E\xA2", + "\xCA\xE1" => "\xE6\xA2\xB3", + "\xCA\xE2" => "\xE6\xAE\x8A", + "\xCA\xE3" => "\xE6\x8A\x92", + "\xCA\xE4" => "\xE8\xBE\x93", + "\xCA\xE5" => "\xE5\x8F\x94", + "\xCA\xE6" => "\xE8\x88\x92", + "\xCA\xE7" => "\xE6\xB7\x91", + "\xCA\xE8" => "\xE7\x96\x8F", + "\xCA\xE9" => "\xE4\xB9\xA6", + "\xCA\xEA" => "\xE8\xB5\x8E", + "\xCA\xEB" => "\xE5\xAD\xB0", + "\xCA\xEC" => "\xE7\x86\x9F", + "\xCA\xED" => "\xE8\x96\xAF", + "\xCA\xEE" => "\xE6\x9A\x91", + "\xCA\xEF" => "\xE6\x9B\x99", + "\xCA\xF0" => "\xE7\xBD\xB2", + "\xCA\xF1" => "\xE8\x9C\x80", + "\xCA\xF2" => "\xE9\xBB\x8D", + "\xCA\xF3" => "\xE9\xBC\xA0", + "\xCA\xF4" => "\xE5\xB1\x9E", + "\xCA\xF5" => "\xE6\x9C\xAF", + "\xCA\xF6" => "\xE8\xBF\xB0", + "\xCA\xF7" => "\xE6\xA0\x91", + "\xCA\xF8" => "\xE6\x9D\x9F", + "\xCA\xF9" => "\xE6\x88\x8D", + "\xCA\xFA" => "\xE7\xAB\x96", + "\xCA\xFB" => "\xE5\xA2\x85", + "\xCA\xFC" => "\xE5\xBA\xB6", + "\xCA\xFD" => "\xE6\x95\xB0", + "\xCA\xFE" => "\xE6\xBC\xB1", + "\xCB\xA1" => "\xE6\x81\x95", + "\xCB\xA2" => "\xE5\x88\xB7", + "\xCB\xA3" => "\xE8\x80\x8D", + "\xCB\xA4" => "\xE6\x91\x94", + "\xCB\xA5" => "\xE8\xA1\xB0", + "\xCB\xA6" => "\xE7\x94\xA9", + "\xCB\xA7" => "\xE5\xB8\x85", + "\xCB\xA8" => "\xE6\xA0\x93", + "\xCB\xA9" => "\xE6\x8B\xB4", + "\xCB\xAA" => "\xE9\x9C\x9C", + "\xCB\xAB" => "\xE5\x8F\x8C", + "\xCB\xAC" => "\xE7\x88\xBD", + "\xCB\xAD" => "\xE8\xB0\x81", + "\xCB\xAE" => "\xE6\xB0\xB4", + "\xCB\xAF" => "\xE7\x9D\xA1", + "\xCB\xB0" => "\xE7\xA8\x8E", + "\xCB\xB1" => "\xE5\x90\xAE", + "\xCB\xB2" => "\xE7\x9E\xAC", + "\xCB\xB3" => "\xE9\xA1\xBA", + "\xCB\xB4" => "\xE8\x88\x9C", + "\xCB\xB5" => "\xE8\xAF\xB4", + "\xCB\xB6" => "\xE7\xA1\x95", + "\xCB\xB7" => "\xE6\x9C\x94", + "\xCB\xB8" => "\xE7\x83\x81", + "\xCB\xB9" => "\xE6\x96\xAF", + "\xCB\xBA" => "\xE6\x92\x95", + "\xCB\xBB" => "\xE5\x98\xB6", + "\xCB\xBC" => "\xE6\x80\x9D", + "\xCB\xBD" => "\xE7\xA7\x81", + "\xCB\xBE" => "\xE5\x8F\xB8", + "\xCB\xBF" => "\xE4\xB8\x9D", + "\xCB\xC0" => "\xE6\xAD\xBB", + "\xCB\xC1" => "\xE8\x82\x86", + "\xCB\xC2" => "\xE5\xAF\xBA", + "\xCB\xC3" => "\xE5\x97\xA3", + "\xCB\xC4" => "\xE5\x9B\x9B", + "\xCB\xC5" => "\xE4\xBC\xBA", + "\xCB\xC6" => "\xE4\xBC\xBC", + "\xCB\xC7" => "\xE9\xA5\xB2", + "\xCB\xC8" => "\xE5\xB7\xB3", + "\xCB\xC9" => "\xE6\x9D\xBE", + "\xCB\xCA" => "\xE8\x80\xB8", + "\xCB\xCB" => "\xE6\x80\x82", + "\xCB\xCC" => "\xE9\xA2\x82", + "\xCB\xCD" => "\xE9\x80\x81", + "\xCB\xCE" => "\xE5\xAE\x8B", + "\xCB\xCF" => "\xE8\xAE\xBC", + "\xCB\xD0" => "\xE8\xAF\xB5", + "\xCB\xD1" => "\xE6\x90\x9C", + "\xCB\xD2" => "\xE8\x89\x98", + "\xCB\xD3" => "\xE6\x93\x9E", + "\xCB\xD4" => "\xE5\x97\xBD", + "\xCB\xD5" => "\xE8\x8B\x8F", + "\xCB\xD6" => "\xE9\x85\xA5", + "\xCB\xD7" => "\xE4\xBF\x97", + "\xCB\xD8" => "\xE7\xB4\xA0", + "\xCB\xD9" => "\xE9\x80\x9F", + "\xCB\xDA" => "\xE7\xB2\x9F", + "\xCB\xDB" => "\xE5\x83\xB3", + "\xCB\xDC" => "\xE5\xA1\x91", + "\xCB\xDD" => "\xE6\xBA\xAF", + "\xCB\xDE" => "\xE5\xAE\xBF", + "\xCB\xDF" => "\xE8\xAF\x89", + "\xCB\xE0" => "\xE8\x82\x83", + "\xCB\xE1" => "\xE9\x85\xB8", + "\xCB\xE2" => "\xE8\x92\x9C", + "\xCB\xE3" => "\xE7\xAE\x97", + "\xCB\xE4" => "\xE8\x99\xBD", + "\xCB\xE5" => "\xE9\x9A\x8B", + "\xCB\xE6" => "\xE9\x9A\x8F", + "\xCB\xE7" => "\xE7\xBB\xA5", + "\xCB\xE8" => "\xE9\xAB\x93", + "\xCB\xE9" => "\xE7\xA2\x8E", + "\xCB\xEA" => "\xE5\xB2\x81", + "\xCB\xEB" => "\xE7\xA9\x97", + "\xCB\xEC" => "\xE9\x81\x82", + "\xCB\xED" => "\xE9\x9A\xA7", + "\xCB\xEE" => "\xE7\xA5\x9F", + "\xCB\xEF" => "\xE5\xAD\x99", + "\xCB\xF0" => "\xE6\x8D\x9F", + "\xCB\xF1" => "\xE7\xAC\x8B", + "\xCB\xF2" => "\xE8\x93\x91", + "\xCB\xF3" => "\xE6\xA2\xAD", + "\xCB\xF4" => "\xE5\x94\x86", + "\xCB\xF5" => "\xE7\xBC\xA9", + "\xCB\xF6" => "\xE7\x90\x90", + "\xCB\xF7" => "\xE7\xB4\xA2", + "\xCB\xF8" => "\xE9\x94\x81", + "\xCB\xF9" => "\xE6\x89\x80", + "\xCB\xFA" => "\xE5\xA1\x8C", + "\xCB\xFB" => "\xE4\xBB\x96", + "\xCB\xFC" => "\xE5\xAE\x83", + "\xCB\xFD" => "\xE5\xA5\xB9", + "\xCB\xFE" => "\xE5\xA1\x94", + "\xCC\xA1" => "\xE7\x8D\xAD", + "\xCC\xA2" => "\xE6\x8C\x9E", + "\xCC\xA3" => "\xE8\xB9\x8B", + "\xCC\xA4" => "\xE8\xB8\x8F", + "\xCC\xA5" => "\xE8\x83\x8E", + "\xCC\xA6" => "\xE8\x8B\x94", + "\xCC\xA7" => "\xE6\x8A\xAC", + "\xCC\xA8" => "\xE5\x8F\xB0", + "\xCC\xA9" => "\xE6\xB3\xB0", + "\xCC\xAA" => "\xE9\x85\x9E", + "\xCC\xAB" => "\xE5\xA4\xAA", + "\xCC\xAC" => "\xE6\x80\x81", + "\xCC\xAD" => "\xE6\xB1\xB0", + "\xCC\xAE" => "\xE5\x9D\x8D", + "\xCC\xAF" => "\xE6\x91\x8A", + "\xCC\xB0" => "\xE8\xB4\xAA", + "\xCC\xB1" => "\xE7\x98\xAB", + "\xCC\xB2" => "\xE6\xBB\xA9", + "\xCC\xB3" => "\xE5\x9D\x9B", + "\xCC\xB4" => "\xE6\xAA\x80", + "\xCC\xB5" => "\xE7\x97\xB0", + "\xCC\xB6" => "\xE6\xBD\xAD", + "\xCC\xB7" => "\xE8\xB0\xAD", + "\xCC\xB8" => "\xE8\xB0\x88", + "\xCC\xB9" => "\xE5\x9D\xA6", + "\xCC\xBA" => "\xE6\xAF\xAF", + "\xCC\xBB" => "\xE8\xA2\x92", + "\xCC\xBC" => "\xE7\xA2\xB3", + "\xCC\xBD" => "\xE6\x8E\xA2", + "\xCC\xBE" => "\xE5\x8F\xB9", + "\xCC\xBF" => "\xE7\x82\xAD", + "\xCC\xC0" => "\xE6\xB1\xA4", + "\xCC\xC1" => "\xE5\xA1\x98", + "\xCC\xC2" => "\xE6\x90\xAA", + "\xCC\xC3" => "\xE5\xA0\x82", + "\xCC\xC4" => "\xE6\xA3\xA0", + "\xCC\xC5" => "\xE8\x86\x9B", + "\xCC\xC6" => "\xE5\x94\x90", + "\xCC\xC7" => "\xE7\xB3\x96", + "\xCC\xC8" => "\xE5\x80\x98", + "\xCC\xC9" => "\xE8\xBA\xBA", + "\xCC\xCA" => "\xE6\xB7\x8C", + "\xCC\xCB" => "\xE8\xB6\x9F", + "\xCC\xCC" => "\xE7\x83\xAB", + "\xCC\xCD" => "\xE6\x8E\x8F", + "\xCC\xCE" => "\xE6\xB6\x9B", + "\xCC\xCF" => "\xE6\xBB\x94", + "\xCC\xD0" => "\xE7\xBB\xA6", + "\xCC\xD1" => "\xE8\x90\x84", + "\xCC\xD2" => "\xE6\xA1\x83", + "\xCC\xD3" => "\xE9\x80\x83", + "\xCC\xD4" => "\xE6\xB7\x98", + "\xCC\xD5" => "\xE9\x99\xB6", + "\xCC\xD6" => "\xE8\xAE\xA8", + "\xCC\xD7" => "\xE5\xA5\x97", + "\xCC\xD8" => "\xE7\x89\xB9", + "\xCC\xD9" => "\xE8\x97\xA4", + "\xCC\xDA" => "\xE8\x85\xBE", + "\xCC\xDB" => "\xE7\x96\xBC", + "\xCC\xDC" => "\xE8\xAA\x8A", + "\xCC\xDD" => "\xE6\xA2\xAF", + "\xCC\xDE" => "\xE5\x89\x94", + "\xCC\xDF" => "\xE8\xB8\xA2", + "\xCC\xE0" => "\xE9\x94\x91", + "\xCC\xE1" => "\xE6\x8F\x90", + "\xCC\xE2" => "\xE9\xA2\x98", + "\xCC\xE3" => "\xE8\xB9\x84", + "\xCC\xE4" => "\xE5\x95\xBC", + "\xCC\xE5" => "\xE4\xBD\x93", + "\xCC\xE6" => "\xE6\x9B\xBF", + "\xCC\xE7" => "\xE5\x9A\x8F", + "\xCC\xE8" => "\xE6\x83\x95", + "\xCC\xE9" => "\xE6\xB6\x95", + "\xCC\xEA" => "\xE5\x89\x83", + "\xCC\xEB" => "\xE5\xB1\x89", + "\xCC\xEC" => "\xE5\xA4\xA9", + "\xCC\xED" => "\xE6\xB7\xBB", + "\xCC\xEE" => "\xE5\xA1\xAB", + "\xCC\xEF" => "\xE7\x94\xB0", + "\xCC\xF0" => "\xE7\x94\x9C", + "\xCC\xF1" => "\xE6\x81\xAC", + "\xCC\xF2" => "\xE8\x88\x94", + "\xCC\xF3" => "\xE8\x85\x86", + "\xCC\xF4" => "\xE6\x8C\x91", + "\xCC\xF5" => "\xE6\x9D\xA1", + "\xCC\xF6" => "\xE8\xBF\xA2", + "\xCC\xF7" => "\xE7\x9C\xBA", + "\xCC\xF8" => "\xE8\xB7\xB3", + "\xCC\xF9" => "\xE8\xB4\xB4", + "\xCC\xFA" => "\xE9\x93\x81", + "\xCC\xFB" => "\xE5\xB8\x96", + "\xCC\xFC" => "\xE5\x8E\x85", + "\xCC\xFD" => "\xE5\x90\xAC", + "\xCC\xFE" => "\xE7\x83\x83", + "\xCD\xA1" => "\xE6\xB1\x80", + "\xCD\xA2" => "\xE5\xBB\xB7", + "\xCD\xA3" => "\xE5\x81\x9C", + "\xCD\xA4" => "\xE4\xBA\xAD", + "\xCD\xA5" => "\xE5\xBA\xAD", + "\xCD\xA6" => "\xE6\x8C\xBA", + "\xCD\xA7" => "\xE8\x89\x87", + "\xCD\xA8" => "\xE9\x80\x9A", + "\xCD\xA9" => "\xE6\xA1\x90", + "\xCD\xAA" => "\xE9\x85\xAE", + "\xCD\xAB" => "\xE7\x9E\xB3", + "\xCD\xAC" => "\xE5\x90\x8C", + "\xCD\xAD" => "\xE9\x93\x9C", + "\xCD\xAE" => "\xE5\xBD\xA4", + "\xCD\xAF" => "\xE7\xAB\xA5", + "\xCD\xB0" => "\xE6\xA1\xB6", + "\xCD\xB1" => "\xE6\x8D\x85", + "\xCD\xB2" => "\xE7\xAD\x92", + "\xCD\xB3" => "\xE7\xBB\x9F", + "\xCD\xB4" => "\xE7\x97\x9B", + "\xCD\xB5" => "\xE5\x81\xB7", + "\xCD\xB6" => "\xE6\x8A\x95", + "\xCD\xB7" => "\xE5\xA4\xB4", + "\xCD\xB8" => "\xE9\x80\x8F", + "\xCD\xB9" => "\xE5\x87\xB8", + "\xCD\xBA" => "\xE7\xA7\x83", + "\xCD\xBB" => "\xE7\xAA\x81", + "\xCD\xBC" => "\xE5\x9B\xBE", + "\xCD\xBD" => "\xE5\xBE\x92", + "\xCD\xBE" => "\xE9\x80\x94", + "\xCD\xBF" => "\xE6\xB6\x82", + "\xCD\xC0" => "\xE5\xB1\xA0", + "\xCD\xC1" => "\xE5\x9C\x9F", + "\xCD\xC2" => "\xE5\x90\x90", + "\xCD\xC3" => "\xE5\x85\x94", + "\xCD\xC4" => "\xE6\xB9\x8D", + "\xCD\xC5" => "\xE5\x9B\xA2", + "\xCD\xC6" => "\xE6\x8E\xA8", + "\xCD\xC7" => "\xE9\xA2\x93", + "\xCD\xC8" => "\xE8\x85\xBF", + "\xCD\xC9" => "\xE8\x9C\x95", + "\xCD\xCA" => "\xE8\xA4\xAA", + "\xCD\xCB" => "\xE9\x80\x80", + "\xCD\xCC" => "\xE5\x90\x9E", + "\xCD\xCD" => "\xE5\xB1\xAF", + "\xCD\xCE" => "\xE8\x87\x80", + "\xCD\xCF" => "\xE6\x8B\x96", + "\xCD\xD0" => "\xE6\x89\x98", + "\xCD\xD1" => "\xE8\x84\xB1", + "\xCD\xD2" => "\xE9\xB8\xB5", + "\xCD\xD3" => "\xE9\x99\x80", + "\xCD\xD4" => "\xE9\xA9\xAE", + "\xCD\xD5" => "\xE9\xA9\xBC", + "\xCD\xD6" => "\xE6\xA4\xAD", + "\xCD\xD7" => "\xE5\xA6\xA5", + "\xCD\xD8" => "\xE6\x8B\x93", + "\xCD\xD9" => "\xE5\x94\xBE", + "\xCD\xDA" => "\xE6\x8C\x96", + "\xCD\xDB" => "\xE5\x93\x87", + "\xCD\xDC" => "\xE8\x9B\x99", + "\xCD\xDD" => "\xE6\xB4\xBC", + "\xCD\xDE" => "\xE5\xA8\x83", + "\xCD\xDF" => "\xE7\x93\xA6", + "\xCD\xE0" => "\xE8\xA2\x9C", + "\xCD\xE1" => "\xE6\xAD\xAA", + "\xCD\xE2" => "\xE5\xA4\x96", + "\xCD\xE3" => "\xE8\xB1\x8C", + "\xCD\xE4" => "\xE5\xBC\xAF", + "\xCD\xE5" => "\xE6\xB9\xBE", + "\xCD\xE6" => "\xE7\x8E\xA9", + "\xCD\xE7" => "\xE9\xA1\xBD", + "\xCD\xE8" => "\xE4\xB8\xB8", + "\xCD\xE9" => "\xE7\x83\xB7", + "\xCD\xEA" => "\xE5\xAE\x8C", + "\xCD\xEB" => "\xE7\xA2\x97", + "\xCD\xEC" => "\xE6\x8C\xBD", + "\xCD\xED" => "\xE6\x99\x9A", + "\xCD\xEE" => "\xE7\x9A\x96", + "\xCD\xEF" => "\xE6\x83\x8B", + "\xCD\xF0" => "\xE5\xAE\x9B", + "\xCD\xF1" => "\xE5\xA9\x89", + "\xCD\xF2" => "\xE4\xB8\x87", + "\xCD\xF3" => "\xE8\x85\x95", + "\xCD\xF4" => "\xE6\xB1\xAA", + "\xCD\xF5" => "\xE7\x8E\x8B", + "\xCD\xF6" => "\xE4\xBA\xA1", + "\xCD\xF7" => "\xE6\x9E\x89", + "\xCD\xF8" => "\xE7\xBD\x91", + "\xCD\xF9" => "\xE5\xBE\x80", + "\xCD\xFA" => "\xE6\x97\xBA", + "\xCD\xFB" => "\xE6\x9C\x9B", + "\xCD\xFC" => "\xE5\xBF\x98", + "\xCD\xFD" => "\xE5\xA6\x84", + "\xCD\xFE" => "\xE5\xA8\x81", + "\xCE\xA1" => "\xE5\xB7\x8D", + "\xCE\xA2" => "\xE5\xBE\xAE", + "\xCE\xA3" => "\xE5\x8D\xB1", + "\xCE\xA4" => "\xE9\x9F\xA6", + "\xCE\xA5" => "\xE8\xBF\x9D", + "\xCE\xA6" => "\xE6\xA1\x85", + "\xCE\xA7" => "\xE5\x9B\xB4", + "\xCE\xA8" => "\xE5\x94\xAF", + "\xCE\xA9" => "\xE6\x83\x9F", + "\xCE\xAA" => "\xE4\xB8\xBA", + "\xCE\xAB" => "\xE6\xBD\x8D", + "\xCE\xAC" => "\xE7\xBB\xB4", + "\xCE\xAD" => "\xE8\x8B\x87", + "\xCE\xAE" => "\xE8\x90\x8E", + "\xCE\xAF" => "\xE5\xA7\x94", + "\xCE\xB0" => "\xE4\xBC\x9F", + "\xCE\xB1" => "\xE4\xBC\xAA", + "\xCE\xB2" => "\xE5\xB0\xBE", + "\xCE\xB3" => "\xE7\xBA\xAC", + "\xCE\xB4" => "\xE6\x9C\xAA", + "\xCE\xB5" => "\xE8\x94\x9A", + "\xCE\xB6" => "\xE5\x91\xB3", + "\xCE\xB7" => "\xE7\x95\x8F", + "\xCE\xB8" => "\xE8\x83\x83", + "\xCE\xB9" => "\xE5\x96\x82", + "\xCE\xBA" => "\xE9\xAD\x8F", + "\xCE\xBB" => "\xE4\xBD\x8D", + "\xCE\xBC" => "\xE6\xB8\xAD", + "\xCE\xBD" => "\xE8\xB0\x93", + "\xCE\xBE" => "\xE5\xB0\x89", + "\xCE\xBF" => "\xE6\x85\xB0", + "\xCE\xC0" => "\xE5\x8D\xAB", + "\xCE\xC1" => "\xE7\x98\x9F", + "\xCE\xC2" => "\xE6\xB8\xA9", + "\xCE\xC3" => "\xE8\x9A\x8A", + "\xCE\xC4" => "\xE6\x96\x87", + "\xCE\xC5" => "\xE9\x97\xBB", + "\xCE\xC6" => "\xE7\xBA\xB9", + "\xCE\xC7" => "\xE5\x90\xBB", + "\xCE\xC8" => "\xE7\xA8\xB3", + "\xCE\xC9" => "\xE7\xB4\x8A", + "\xCE\xCA" => "\xE9\x97\xAE", + "\xCE\xCB" => "\xE5\x97\xA1", + "\xCE\xCC" => "\xE7\xBF\x81", + "\xCE\xCD" => "\xE7\x93\xAE", + "\xCE\xCE" => "\xE6\x8C\x9D", + "\xCE\xCF" => "\xE8\x9C\x97", + "\xCE\xD0" => "\xE6\xB6\xA1", + "\xCE\xD1" => "\xE7\xAA\x9D", + "\xCE\xD2" => "\xE6\x88\x91", + "\xCE\xD3" => "\xE6\x96\xA1", + "\xCE\xD4" => "\xE5\x8D\xA7", + "\xCE\xD5" => "\xE6\x8F\xA1", + "\xCE\xD6" => "\xE6\xB2\x83", + "\xCE\xD7" => "\xE5\xB7\xAB", + "\xCE\xD8" => "\xE5\x91\x9C", + "\xCE\xD9" => "\xE9\x92\xA8", + "\xCE\xDA" => "\xE4\xB9\x8C", + "\xCE\xDB" => "\xE6\xB1\xA1", + "\xCE\xDC" => "\xE8\xAF\xAC", + "\xCE\xDD" => "\xE5\xB1\x8B", + "\xCE\xDE" => "\xE6\x97\xA0", + "\xCE\xDF" => "\xE8\x8A\x9C", + "\xCE\xE0" => "\xE6\xA2\xA7", + "\xCE\xE1" => "\xE5\x90\xBE", + "\xCE\xE2" => "\xE5\x90\xB4", + "\xCE\xE3" => "\xE6\xAF\x8B", + "\xCE\xE4" => "\xE6\xAD\xA6", + "\xCE\xE5" => "\xE4\xBA\x94", + "\xCE\xE6" => "\xE6\x8D\x82", + "\xCE\xE7" => "\xE5\x8D\x88", + "\xCE\xE8" => "\xE8\x88\x9E", + "\xCE\xE9" => "\xE4\xBC\x8D", + "\xCE\xEA" => "\xE4\xBE\xAE", + "\xCE\xEB" => "\xE5\x9D\x9E", + "\xCE\xEC" => "\xE6\x88\x8A", + "\xCE\xED" => "\xE9\x9B\xBE", + "\xCE\xEE" => "\xE6\x99\xA4", + "\xCE\xEF" => "\xE7\x89\xA9", + "\xCE\xF0" => "\xE5\x8B\xBF", + "\xCE\xF1" => "\xE5\x8A\xA1", + "\xCE\xF2" => "\xE6\x82\x9F", + "\xCE\xF3" => "\xE8\xAF\xAF", + "\xCE\xF4" => "\xE6\x98\x94", + "\xCE\xF5" => "\xE7\x86\x99", + "\xCE\xF6" => "\xE6\x9E\x90", + "\xCE\xF7" => "\xE8\xA5\xBF", + "\xCE\xF8" => "\xE7\xA1\x92", + "\xCE\xF9" => "\xE7\x9F\xBD", + "\xCE\xFA" => "\xE6\x99\xB0", + "\xCE\xFB" => "\xE5\x98\xBB", + "\xCE\xFC" => "\xE5\x90\xB8", + "\xCE\xFD" => "\xE9\x94\xA1", + "\xCE\xFE" => "\xE7\x89\xBA", + "\xCF\xA1" => "\xE7\xA8\x80", + "\xCF\xA2" => "\xE6\x81\xAF", + "\xCF\xA3" => "\xE5\xB8\x8C", + "\xCF\xA4" => "\xE6\x82\x89", + "\xCF\xA5" => "\xE8\x86\x9D", + "\xCF\xA6" => "\xE5\xA4\x95", + "\xCF\xA7" => "\xE6\x83\x9C", + "\xCF\xA8" => "\xE7\x86\x84", + "\xCF\xA9" => "\xE7\x83\xAF", + "\xCF\xAA" => "\xE6\xBA\xAA", + "\xCF\xAB" => "\xE6\xB1\x90", + "\xCF\xAC" => "\xE7\x8A\x80", + "\xCF\xAD" => "\xE6\xAA\x84", + "\xCF\xAE" => "\xE8\xA2\xAD", + "\xCF\xAF" => "\xE5\xB8\xAD", + "\xCF\xB0" => "\xE4\xB9\xA0", + "\xCF\xB1" => "\xE5\xAA\xB3", + "\xCF\xB2" => "\xE5\x96\x9C", + "\xCF\xB3" => "\xE9\x93\xA3", + "\xCF\xB4" => "\xE6\xB4\x97", + "\xCF\xB5" => "\xE7\xB3\xBB", + "\xCF\xB6" => "\xE9\x9A\x99", + "\xCF\xB7" => "\xE6\x88\x8F", + "\xCF\xB8" => "\xE7\xBB\x86", + "\xCF\xB9" => "\xE7\x9E\x8E", + "\xCF\xBA" => "\xE8\x99\xBE", + "\xCF\xBB" => "\xE5\x8C\xA3", + "\xCF\xBC" => "\xE9\x9C\x9E", + "\xCF\xBD" => "\xE8\xBE\x96", + "\xCF\xBE" => "\xE6\x9A\x87", + "\xCF\xBF" => "\xE5\xB3\xA1", + "\xCF\xC0" => "\xE4\xBE\xA0", + "\xCF\xC1" => "\xE7\x8B\xAD", + "\xCF\xC2" => "\xE4\xB8\x8B", + "\xCF\xC3" => "\xE5\x8E\xA6", + "\xCF\xC4" => "\xE5\xA4\x8F", + "\xCF\xC5" => "\xE5\x90\x93", + "\xCF\xC6" => "\xE6\x8E\x80", + "\xCF\xC7" => "\xE9\x94\xA8", + "\xCF\xC8" => "\xE5\x85\x88", + "\xCF\xC9" => "\xE4\xBB\x99", + "\xCF\xCA" => "\xE9\xB2\x9C", + "\xCF\xCB" => "\xE7\xBA\xA4", + "\xCF\xCC" => "\xE5\x92\xB8", + "\xCF\xCD" => "\xE8\xB4\xA4", + "\xCF\xCE" => "\xE8\xA1\x94", + "\xCF\xCF" => "\xE8\x88\xB7", + "\xCF\xD0" => "\xE9\x97\xB2", + "\xCF\xD1" => "\xE6\xB6\x8E", + "\xCF\xD2" => "\xE5\xBC\xA6", + "\xCF\xD3" => "\xE5\xAB\x8C", + "\xCF\xD4" => "\xE6\x98\xBE", + "\xCF\xD5" => "\xE9\x99\xA9", + "\xCF\xD6" => "\xE7\x8E\xB0", + "\xCF\xD7" => "\xE7\x8C\xAE", + "\xCF\xD8" => "\xE5\x8E\xBF", + "\xCF\xD9" => "\xE8\x85\xBA", + "\xCF\xDA" => "\xE9\xA6\x85", + "\xCF\xDB" => "\xE7\xBE\xA1", + "\xCF\xDC" => "\xE5\xAE\xAA", + "\xCF\xDD" => "\xE9\x99\xB7", + "\xCF\xDE" => "\xE9\x99\x90", + "\xCF\xDF" => "\xE7\xBA\xBF", + "\xCF\xE0" => "\xE7\x9B\xB8", + "\xCF\xE1" => "\xE5\x8E\xA2", + "\xCF\xE2" => "\xE9\x95\xB6", + "\xCF\xE3" => "\xE9\xA6\x99", + "\xCF\xE4" => "\xE7\xAE\xB1", + "\xCF\xE5" => "\xE8\xA5\x84", + "\xCF\xE6" => "\xE6\xB9\x98", + "\xCF\xE7" => "\xE4\xB9\xA1", + "\xCF\xE8" => "\xE7\xBF\x94", + "\xCF\xE9" => "\xE7\xA5\xA5", + "\xCF\xEA" => "\xE8\xAF\xA6", + "\xCF\xEB" => "\xE6\x83\xB3", + "\xCF\xEC" => "\xE5\x93\x8D", + "\xCF\xED" => "\xE4\xBA\xAB", + "\xCF\xEE" => "\xE9\xA1\xB9", + "\xCF\xEF" => "\xE5\xB7\xB7", + "\xCF\xF0" => "\xE6\xA9\xA1", + "\xCF\xF1" => "\xE5\x83\x8F", + "\xCF\xF2" => "\xE5\x90\x91", + "\xCF\xF3" => "\xE8\xB1\xA1", + "\xCF\xF4" => "\xE8\x90\xA7", + "\xCF\xF5" => "\xE7\xA1\x9D", + "\xCF\xF6" => "\xE9\x9C\x84", + "\xCF\xF7" => "\xE5\x89\x8A", + "\xCF\xF8" => "\xE5\x93\xAE", + "\xCF\xF9" => "\xE5\x9A\xA3", + "\xCF\xFA" => "\xE9\x94\x80", + "\xCF\xFB" => "\xE6\xB6\x88", + "\xCF\xFC" => "\xE5\xAE\xB5", + "\xCF\xFD" => "\xE6\xB7\x86", + "\xCF\xFE" => "\xE6\x99\x93", + "\xD0\xA1" => "\xE5\xB0\x8F", + "\xD0\xA2" => "\xE5\xAD\x9D", + "\xD0\xA3" => "\xE6\xA0\xA1", + "\xD0\xA4" => "\xE8\x82\x96", + "\xD0\xA5" => "\xE5\x95\xB8", + "\xD0\xA6" => "\xE7\xAC\x91", + "\xD0\xA7" => "\xE6\x95\x88", + "\xD0\xA8" => "\xE6\xA5\x94", + "\xD0\xA9" => "\xE4\xBA\x9B", + "\xD0\xAA" => "\xE6\xAD\x87", + "\xD0\xAB" => "\xE8\x9D\x8E", + "\xD0\xAC" => "\xE9\x9E\x8B", + "\xD0\xAD" => "\xE5\x8D\x8F", + "\xD0\xAE" => "\xE6\x8C\x9F", + "\xD0\xAF" => "\xE6\x90\xBA", + "\xD0\xB0" => "\xE9\x82\xAA", + "\xD0\xB1" => "\xE6\x96\x9C", + "\xD0\xB2" => "\xE8\x83\x81", + "\xD0\xB3" => "\xE8\xB0\x90", + "\xD0\xB4" => "\xE5\x86\x99", + "\xD0\xB5" => "\xE6\xA2\xB0", + "\xD0\xB6" => "\xE5\x8D\xB8", + "\xD0\xB7" => "\xE8\x9F\xB9", + "\xD0\xB8" => "\xE6\x87\x88", + "\xD0\xB9" => "\xE6\xB3\x84", + "\xD0\xBA" => "\xE6\xB3\xBB", + "\xD0\xBB" => "\xE8\xB0\xA2", + "\xD0\xBC" => "\xE5\xB1\x91", + "\xD0\xBD" => "\xE8\x96\xAA", + "\xD0\xBE" => "\xE8\x8A\xAF", + "\xD0\xBF" => "\xE9\x94\x8C", + "\xD0\xC0" => "\xE6\xAC\xA3", + "\xD0\xC1" => "\xE8\xBE\x9B", + "\xD0\xC2" => "\xE6\x96\xB0", + "\xD0\xC3" => "\xE5\xBF\xBB", + "\xD0\xC4" => "\xE5\xBF\x83", + "\xD0\xC5" => "\xE4\xBF\xA1", + "\xD0\xC6" => "\xE8\xA1\x85", + "\xD0\xC7" => "\xE6\x98\x9F", + "\xD0\xC8" => "\xE8\x85\xA5", + "\xD0\xC9" => "\xE7\x8C\xA9", + "\xD0\xCA" => "\xE6\x83\xBA", + "\xD0\xCB" => "\xE5\x85\xB4", + "\xD0\xCC" => "\xE5\x88\x91", + "\xD0\xCD" => "\xE5\x9E\x8B", + "\xD0\xCE" => "\xE5\xBD\xA2", + "\xD0\xCF" => "\xE9\x82\xA2", + "\xD0\xD0" => "\xE8\xA1\x8C", + "\xD0\xD1" => "\xE9\x86\x92", + "\xD0\xD2" => "\xE5\xB9\xB8", + "\xD0\xD3" => "\xE6\x9D\x8F", + "\xD0\xD4" => "\xE6\x80\xA7", + "\xD0\xD5" => "\xE5\xA7\x93", + "\xD0\xD6" => "\xE5\x85\x84", + "\xD0\xD7" => "\xE5\x87\xB6", + "\xD0\xD8" => "\xE8\x83\xB8", + "\xD0\xD9" => "\xE5\x8C\x88", + "\xD0\xDA" => "\xE6\xB1\xB9", + "\xD0\xDB" => "\xE9\x9B\x84", + "\xD0\xDC" => "\xE7\x86\x8A", + "\xD0\xDD" => "\xE4\xBC\x91", + "\xD0\xDE" => "\xE4\xBF\xAE", + "\xD0\xDF" => "\xE7\xBE\x9E", + "\xD0\xE0" => "\xE6\x9C\xBD", + "\xD0\xE1" => "\xE5\x97\x85", + "\xD0\xE2" => "\xE9\x94\x88", + "\xD0\xE3" => "\xE7\xA7\x80", + "\xD0\xE4" => "\xE8\xA2\x96", + "\xD0\xE5" => "\xE7\xBB\xA3", + "\xD0\xE6" => "\xE5\xA2\x9F", + "\xD0\xE7" => "\xE6\x88\x8C", + "\xD0\xE8" => "\xE9\x9C\x80", + "\xD0\xE9" => "\xE8\x99\x9A", + "\xD0\xEA" => "\xE5\x98\x98", + "\xD0\xEB" => "\xE9\xA1\xBB", + "\xD0\xEC" => "\xE5\xBE\x90", + "\xD0\xED" => "\xE8\xAE\xB8", + "\xD0\xEE" => "\xE8\x93\x84", + "\xD0\xEF" => "\xE9\x85\x97", + "\xD0\xF0" => "\xE5\x8F\x99", + "\xD0\xF1" => "\xE6\x97\xAD", + "\xD0\xF2" => "\xE5\xBA\x8F", + "\xD0\xF3" => "\xE7\x95\x9C", + "\xD0\xF4" => "\xE6\x81\xA4", + "\xD0\xF5" => "\xE7\xB5\xAE", + "\xD0\xF6" => "\xE5\xA9\xBF", + "\xD0\xF7" => "\xE7\xBB\xAA", + "\xD0\xF8" => "\xE7\xBB\xAD", + "\xD0\xF9" => "\xE8\xBD\xA9", + "\xD0\xFA" => "\xE5\x96\xA7", + "\xD0\xFB" => "\xE5\xAE\xA3", + "\xD0\xFC" => "\xE6\x82\xAC", + "\xD0\xFD" => "\xE6\x97\x8B", + "\xD0\xFE" => "\xE7\x8E\x84", + "\xD1\xA1" => "\xE9\x80\x89", + "\xD1\xA2" => "\xE7\x99\xA3", + "\xD1\xA3" => "\xE7\x9C\xA9", + "\xD1\xA4" => "\xE7\xBB\x9A", + "\xD1\xA5" => "\xE9\x9D\xB4", + "\xD1\xA6" => "\xE8\x96\x9B", + "\xD1\xA7" => "\xE5\xAD\xA6", + "\xD1\xA8" => "\xE7\xA9\xB4", + "\xD1\xA9" => "\xE9\x9B\xAA", + "\xD1\xAA" => "\xE8\xA1\x80", + "\xD1\xAB" => "\xE5\x8B\x8B", + "\xD1\xAC" => "\xE7\x86\x8F", + "\xD1\xAD" => "\xE5\xBE\xAA", + "\xD1\xAE" => "\xE6\x97\xAC", + "\xD1\xAF" => "\xE8\xAF\xA2", + "\xD1\xB0" => "\xE5\xAF\xBB", + "\xD1\xB1" => "\xE9\xA9\xAF", + "\xD1\xB2" => "\xE5\xB7\xA1", + "\xD1\xB3" => "\xE6\xAE\x89", + "\xD1\xB4" => "\xE6\xB1\x9B", + "\xD1\xB5" => "\xE8\xAE\xAD", + "\xD1\xB6" => "\xE8\xAE\xAF", + "\xD1\xB7" => "\xE9\x80\x8A", + "\xD1\xB8" => "\xE8\xBF\x85", + "\xD1\xB9" => "\xE5\x8E\x8B", + "\xD1\xBA" => "\xE6\x8A\xBC", + "\xD1\xBB" => "\xE9\xB8\xA6", + "\xD1\xBC" => "\xE9\xB8\xAD", + "\xD1\xBD" => "\xE5\x91\x80", + "\xD1\xBE" => "\xE4\xB8\xAB", + "\xD1\xBF" => "\xE8\x8A\xBD", + "\xD1\xC0" => "\xE7\x89\x99", + "\xD1\xC1" => "\xE8\x9A\x9C", + "\xD1\xC2" => "\xE5\xB4\x96", + "\xD1\xC3" => "\xE8\xA1\x99", + "\xD1\xC4" => "\xE6\xB6\xAF", + "\xD1\xC5" => "\xE9\x9B\x85", + "\xD1\xC6" => "\xE5\x93\x91", + "\xD1\xC7" => "\xE4\xBA\x9A", + "\xD1\xC8" => "\xE8\xAE\xB6", + "\xD1\xC9" => "\xE7\x84\x89", + "\xD1\xCA" => "\xE5\x92\xBD", + "\xD1\xCB" => "\xE9\x98\x89", + "\xD1\xCC" => "\xE7\x83\x9F", + "\xD1\xCD" => "\xE6\xB7\xB9", + "\xD1\xCE" => "\xE7\x9B\x90", + "\xD1\xCF" => "\xE4\xB8\xA5", + "\xD1\xD0" => "\xE7\xA0\x94", + "\xD1\xD1" => "\xE8\x9C\x92", + "\xD1\xD2" => "\xE5\xB2\xA9", + "\xD1\xD3" => "\xE5\xBB\xB6", + "\xD1\xD4" => "\xE8\xA8\x80", + "\xD1\xD5" => "\xE9\xA2\x9C", + "\xD1\xD6" => "\xE9\x98\x8E", + "\xD1\xD7" => "\xE7\x82\x8E", + "\xD1\xD8" => "\xE6\xB2\xBF", + "\xD1\xD9" => "\xE5\xA5\x84", + "\xD1\xDA" => "\xE6\x8E\xA9", + "\xD1\xDB" => "\xE7\x9C\xBC", + "\xD1\xDC" => "\xE8\xA1\x8D", + "\xD1\xDD" => "\xE6\xBC\x94", + "\xD1\xDE" => "\xE8\x89\xB3", + "\xD1\xDF" => "\xE5\xA0\xB0", + "\xD1\xE0" => "\xE7\x87\x95", + "\xD1\xE1" => "\xE5\x8E\x8C", + "\xD1\xE2" => "\xE7\xA0\x9A", + "\xD1\xE3" => "\xE9\x9B\x81", + "\xD1\xE4" => "\xE5\x94\x81", + "\xD1\xE5" => "\xE5\xBD\xA6", + "\xD1\xE6" => "\xE7\x84\xB0", + "\xD1\xE7" => "\xE5\xAE\xB4", + "\xD1\xE8" => "\xE8\xB0\x9A", + "\xD1\xE9" => "\xE9\xAA\x8C", + "\xD1\xEA" => "\xE6\xAE\x83", + "\xD1\xEB" => "\xE5\xA4\xAE", + "\xD1\xEC" => "\xE9\xB8\xAF", + "\xD1\xED" => "\xE7\xA7\xA7", + "\xD1\xEE" => "\xE6\x9D\xA8", + "\xD1\xEF" => "\xE6\x89\xAC", + "\xD1\xF0" => "\xE4\xBD\xAF", + "\xD1\xF1" => "\xE7\x96\xA1", + "\xD1\xF2" => "\xE7\xBE\x8A", + "\xD1\xF3" => "\xE6\xB4\x8B", + "\xD1\xF4" => "\xE9\x98\xB3", + "\xD1\xF5" => "\xE6\xB0\xA7", + "\xD1\xF6" => "\xE4\xBB\xB0", + "\xD1\xF7" => "\xE7\x97\x92", + "\xD1\xF8" => "\xE5\x85\xBB", + "\xD1\xF9" => "\xE6\xA0\xB7", + "\xD1\xFA" => "\xE6\xBC\xBE", + "\xD1\xFB" => "\xE9\x82\x80", + "\xD1\xFC" => "\xE8\x85\xB0", + "\xD1\xFD" => "\xE5\xA6\x96", + "\xD1\xFE" => "\xE7\x91\xB6", + "\xD2\xA1" => "\xE6\x91\x87", + "\xD2\xA2" => "\xE5\xB0\xA7", + "\xD2\xA3" => "\xE9\x81\xA5", + "\xD2\xA4" => "\xE7\xAA\x91", + "\xD2\xA5" => "\xE8\xB0\xA3", + "\xD2\xA6" => "\xE5\xA7\x9A", + "\xD2\xA7" => "\xE5\x92\xAC", + "\xD2\xA8" => "\xE8\x88\x80", + "\xD2\xA9" => "\xE8\x8D\xAF", + "\xD2\xAA" => "\xE8\xA6\x81", + "\xD2\xAB" => "\xE8\x80\x80", + "\xD2\xAC" => "\xE6\xA4\xB0", + "\xD2\xAD" => "\xE5\x99\x8E", + "\xD2\xAE" => "\xE8\x80\xB6", + "\xD2\xAF" => "\xE7\x88\xB7", + "\xD2\xB0" => "\xE9\x87\x8E", + "\xD2\xB1" => "\xE5\x86\xB6", + "\xD2\xB2" => "\xE4\xB9\x9F", + "\xD2\xB3" => "\xE9\xA1\xB5", + "\xD2\xB4" => "\xE6\x8E\x96", + "\xD2\xB5" => "\xE4\xB8\x9A", + "\xD2\xB6" => "\xE5\x8F\xB6", + "\xD2\xB7" => "\xE6\x9B\xB3", + "\xD2\xB8" => "\xE8\x85\x8B", + "\xD2\xB9" => "\xE5\xA4\x9C", + "\xD2\xBA" => "\xE6\xB6\xB2", + "\xD2\xBB" => "\xE4\xB8\x80", + "\xD2\xBC" => "\xE5\xA3\xB9", + "\xD2\xBD" => "\xE5\x8C\xBB", + "\xD2\xBE" => "\xE6\x8F\x96", + "\xD2\xBF" => "\xE9\x93\xB1", + "\xD2\xC0" => "\xE4\xBE\x9D", + "\xD2\xC1" => "\xE4\xBC\x8A", + "\xD2\xC2" => "\xE8\xA1\xA3", + "\xD2\xC3" => "\xE9\xA2\x90", + "\xD2\xC4" => "\xE5\xA4\xB7", + "\xD2\xC5" => "\xE9\x81\x97", + "\xD2\xC6" => "\xE7\xA7\xBB", + "\xD2\xC7" => "\xE4\xBB\xAA", + "\xD2\xC8" => "\xE8\x83\xB0", + "\xD2\xC9" => "\xE7\x96\x91", + "\xD2\xCA" => "\xE6\xB2\x82", + "\xD2\xCB" => "\xE5\xAE\x9C", + "\xD2\xCC" => "\xE5\xA7\xA8", + "\xD2\xCD" => "\xE5\xBD\x9D", + "\xD2\xCE" => "\xE6\xA4\x85", + "\xD2\xCF" => "\xE8\x9A\x81", + "\xD2\xD0" => "\xE5\x80\x9A", + "\xD2\xD1" => "\xE5\xB7\xB2", + "\xD2\xD2" => "\xE4\xB9\x99", + "\xD2\xD3" => "\xE7\x9F\xA3", + "\xD2\xD4" => "\xE4\xBB\xA5", + "\xD2\xD5" => "\xE8\x89\xBA", + "\xD2\xD6" => "\xE6\x8A\x91", + "\xD2\xD7" => "\xE6\x98\x93", + "\xD2\xD8" => "\xE9\x82\x91", + "\xD2\xD9" => "\xE5\xB1\xB9", + "\xD2\xDA" => "\xE4\xBA\xBF", + "\xD2\xDB" => "\xE5\xBD\xB9", + "\xD2\xDC" => "\xE8\x87\x86", + "\xD2\xDD" => "\xE9\x80\xB8", + "\xD2\xDE" => "\xE8\x82\x84", + "\xD2\xDF" => "\xE7\x96\xAB", + "\xD2\xE0" => "\xE4\xBA\xA6", + "\xD2\xE1" => "\xE8\xA3\x94", + "\xD2\xE2" => "\xE6\x84\x8F", + "\xD2\xE3" => "\xE6\xAF\x85", + "\xD2\xE4" => "\xE5\xBF\x86", + "\xD2\xE5" => "\xE4\xB9\x89", + "\xD2\xE6" => "\xE7\x9B\x8A", + "\xD2\xE7" => "\xE6\xBA\xA2", + "\xD2\xE8" => "\xE8\xAF\xA3", + "\xD2\xE9" => "\xE8\xAE\xAE", + "\xD2\xEA" => "\xE8\xB0\x8A", + "\xD2\xEB" => "\xE8\xAF\x91", + "\xD2\xEC" => "\xE5\xBC\x82", + "\xD2\xED" => "\xE7\xBF\xBC", + "\xD2\xEE" => "\xE7\xBF\x8C", + "\xD2\xEF" => "\xE7\xBB\x8E", + "\xD2\xF0" => "\xE8\x8C\xB5", + "\xD2\xF1" => "\xE8\x8D\xAB", + "\xD2\xF2" => "\xE5\x9B\xA0", + "\xD2\xF3" => "\xE6\xAE\xB7", + "\xD2\xF4" => "\xE9\x9F\xB3", + "\xD2\xF5" => "\xE9\x98\xB4", + "\xD2\xF6" => "\xE5\xA7\xBB", + "\xD2\xF7" => "\xE5\x90\x9F", + "\xD2\xF8" => "\xE9\x93\xB6", + "\xD2\xF9" => "\xE6\xB7\xAB", + "\xD2\xFA" => "\xE5\xAF\x85", + "\xD2\xFB" => "\xE9\xA5\xAE", + "\xD2\xFC" => "\xE5\xB0\xB9", + "\xD2\xFD" => "\xE5\xBC\x95", + "\xD2\xFE" => "\xE9\x9A\x90", + "\xD3\xA1" => "\xE5\x8D\xB0", + "\xD3\xA2" => "\xE8\x8B\xB1", + "\xD3\xA3" => "\xE6\xA8\xB1", + "\xD3\xA4" => "\xE5\xA9\xB4", + "\xD3\xA5" => "\xE9\xB9\xB0", + "\xD3\xA6" => "\xE5\xBA\x94", + "\xD3\xA7" => "\xE7\xBC\xA8", + "\xD3\xA8" => "\xE8\x8E\xB9", + "\xD3\xA9" => "\xE8\x90\xA4", + "\xD3\xAA" => "\xE8\x90\xA5", + "\xD3\xAB" => "\xE8\x8D\xA7", + "\xD3\xAC" => "\xE8\x9D\x87", + "\xD3\xAD" => "\xE8\xBF\x8E", + "\xD3\xAE" => "\xE8\xB5\xA2", + "\xD3\xAF" => "\xE7\x9B\x88", + "\xD3\xB0" => "\xE5\xBD\xB1", + "\xD3\xB1" => "\xE9\xA2\x96", + "\xD3\xB2" => "\xE7\xA1\xAC", + "\xD3\xB3" => "\xE6\x98\xA0", + "\xD3\xB4" => "\xE5\x93\x9F", + "\xD3\xB5" => "\xE6\x8B\xA5", + "\xD3\xB6" => "\xE4\xBD\xA3", + "\xD3\xB7" => "\xE8\x87\x83", + "\xD3\xB8" => "\xE7\x97\x88", + "\xD3\xB9" => "\xE5\xBA\xB8", + "\xD3\xBA" => "\xE9\x9B\x8D", + "\xD3\xBB" => "\xE8\xB8\x8A", + "\xD3\xBC" => "\xE8\x9B\xB9", + "\xD3\xBD" => "\xE5\x92\x8F", + "\xD3\xBE" => "\xE6\xB3\xB3", + "\xD3\xBF" => "\xE6\xB6\x8C", + "\xD3\xC0" => "\xE6\xB0\xB8", + "\xD3\xC1" => "\xE6\x81\xBF", + "\xD3\xC2" => "\xE5\x8B\x87", + "\xD3\xC3" => "\xE7\x94\xA8", + "\xD3\xC4" => "\xE5\xB9\xBD", + "\xD3\xC5" => "\xE4\xBC\x98", + "\xD3\xC6" => "\xE6\x82\xA0", + "\xD3\xC7" => "\xE5\xBF\xA7", + "\xD3\xC8" => "\xE5\xB0\xA4", + "\xD3\xC9" => "\xE7\x94\xB1", + "\xD3\xCA" => "\xE9\x82\xAE", + "\xD3\xCB" => "\xE9\x93\x80", + "\xD3\xCC" => "\xE7\x8A\xB9", + "\xD3\xCD" => "\xE6\xB2\xB9", + "\xD3\xCE" => "\xE6\xB8\xB8", + "\xD3\xCF" => "\xE9\x85\x89", + "\xD3\xD0" => "\xE6\x9C\x89", + "\xD3\xD1" => "\xE5\x8F\x8B", + "\xD3\xD2" => "\xE5\x8F\xB3", + "\xD3\xD3" => "\xE4\xBD\x91", + "\xD3\xD4" => "\xE9\x87\x89", + "\xD3\xD5" => "\xE8\xAF\xB1", + "\xD3\xD6" => "\xE5\x8F\x88", + "\xD3\xD7" => "\xE5\xB9\xBC", + "\xD3\xD8" => "\xE8\xBF\x82", + "\xD3\xD9" => "\xE6\xB7\xA4", + "\xD3\xDA" => "\xE4\xBA\x8E", + "\xD3\xDB" => "\xE7\x9B\x82", + "\xD3\xDC" => "\xE6\xA6\x86", + "\xD3\xDD" => "\xE8\x99\x9E", + "\xD3\xDE" => "\xE6\x84\x9A", + "\xD3\xDF" => "\xE8\x88\x86", + "\xD3\xE0" => "\xE4\xBD\x99", + "\xD3\xE1" => "\xE4\xBF\x9E", + "\xD3\xE2" => "\xE9\x80\xBE", + "\xD3\xE3" => "\xE9\xB1\xBC", + "\xD3\xE4" => "\xE6\x84\x89", + "\xD3\xE5" => "\xE6\xB8\x9D", + "\xD3\xE6" => "\xE6\xB8\x94", + "\xD3\xE7" => "\xE9\x9A\x85", + "\xD3\xE8" => "\xE4\xBA\x88", + "\xD3\xE9" => "\xE5\xA8\xB1", + "\xD3\xEA" => "\xE9\x9B\xA8", + "\xD3\xEB" => "\xE4\xB8\x8E", + "\xD3\xEC" => "\xE5\xB1\xBF", + "\xD3\xED" => "\xE7\xA6\xB9", + "\xD3\xEE" => "\xE5\xAE\x87", + "\xD3\xEF" => "\xE8\xAF\xAD", + "\xD3\xF0" => "\xE7\xBE\xBD", + "\xD3\xF1" => "\xE7\x8E\x89", + "\xD3\xF2" => "\xE5\x9F\x9F", + "\xD3\xF3" => "\xE8\x8A\x8B", + "\xD3\xF4" => "\xE9\x83\x81", + "\xD3\xF5" => "\xE5\x90\x81", + "\xD3\xF6" => "\xE9\x81\x87", + "\xD3\xF7" => "\xE5\x96\xBB", + "\xD3\xF8" => "\xE5\xB3\xAA", + "\xD3\xF9" => "\xE5\xBE\xA1", + "\xD3\xFA" => "\xE6\x84\x88", + "\xD3\xFB" => "\xE6\xAC\xB2", + "\xD3\xFC" => "\xE7\x8B\xB1", + "\xD3\xFD" => "\xE8\x82\xB2", + "\xD3\xFE" => "\xE8\xAA\x89", + "\xD4\xA1" => "\xE6\xB5\xB4", + "\xD4\xA2" => "\xE5\xAF\x93", + "\xD4\xA3" => "\xE8\xA3\x95", + "\xD4\xA4" => "\xE9\xA2\x84", + "\xD4\xA5" => "\xE8\xB1\xAB", + "\xD4\xA6" => "\xE9\xA9\xAD", + "\xD4\xA7" => "\xE9\xB8\xB3", + "\xD4\xA8" => "\xE6\xB8\x8A", + "\xD4\xA9" => "\xE5\x86\xA4", + "\xD4\xAA" => "\xE5\x85\x83", + "\xD4\xAB" => "\xE5\x9E\xA3", + "\xD4\xAC" => "\xE8\xA2\x81", + "\xD4\xAD" => "\xE5\x8E\x9F", + "\xD4\xAE" => "\xE6\x8F\xB4", + "\xD4\xAF" => "\xE8\xBE\x95", + "\xD4\xB0" => "\xE5\x9B\xAD", + "\xD4\xB1" => "\xE5\x91\x98", + "\xD4\xB2" => "\xE5\x9C\x86", + "\xD4\xB3" => "\xE7\x8C\xBF", + "\xD4\xB4" => "\xE6\xBA\x90", + "\xD4\xB5" => "\xE7\xBC\x98", + "\xD4\xB6" => "\xE8\xBF\x9C", + "\xD4\xB7" => "\xE8\x8B\x91", + "\xD4\xB8" => "\xE6\x84\xBF", + "\xD4\xB9" => "\xE6\x80\xA8", + "\xD4\xBA" => "\xE9\x99\xA2", + "\xD4\xBB" => "\xE6\x9B\xB0", + "\xD4\xBC" => "\xE7\xBA\xA6", + "\xD4\xBD" => "\xE8\xB6\x8A", + "\xD4\xBE" => "\xE8\xB7\x83", + "\xD4\xBF" => "\xE9\x92\xA5", + "\xD4\xC0" => "\xE5\xB2\xB3", + "\xD4\xC1" => "\xE7\xB2\xA4", + "\xD4\xC2" => "\xE6\x9C\x88", + "\xD4\xC3" => "\xE6\x82\xA6", + "\xD4\xC4" => "\xE9\x98\x85", + "\xD4\xC5" => "\xE8\x80\x98", + "\xD4\xC6" => "\xE4\xBA\x91", + "\xD4\xC7" => "\xE9\x83\xA7", + "\xD4\xC8" => "\xE5\x8C\x80", + "\xD4\xC9" => "\xE9\x99\xA8", + "\xD4\xCA" => "\xE5\x85\x81", + "\xD4\xCB" => "\xE8\xBF\x90", + "\xD4\xCC" => "\xE8\x95\xB4", + "\xD4\xCD" => "\xE9\x85\x9D", + "\xD4\xCE" => "\xE6\x99\x95", + "\xD4\xCF" => "\xE9\x9F\xB5", + "\xD4\xD0" => "\xE5\xAD\x95", + "\xD4\xD1" => "\xE5\x8C\x9D", + "\xD4\xD2" => "\xE7\xA0\xB8", + "\xD4\xD3" => "\xE6\x9D\x82", + "\xD4\xD4" => "\xE6\xA0\xBD", + "\xD4\xD5" => "\xE5\x93\x89", + "\xD4\xD6" => "\xE7\x81\xBE", + "\xD4\xD7" => "\xE5\xAE\xB0", + "\xD4\xD8" => "\xE8\xBD\xBD", + "\xD4\xD9" => "\xE5\x86\x8D", + "\xD4\xDA" => "\xE5\x9C\xA8", + "\xD4\xDB" => "\xE5\x92\xB1", + "\xD4\xDC" => "\xE6\x94\x92", + "\xD4\xDD" => "\xE6\x9A\x82", + "\xD4\xDE" => "\xE8\xB5\x9E", + "\xD4\xDF" => "\xE8\xB5\x83", + "\xD4\xE0" => "\xE8\x84\x8F", + "\xD4\xE1" => "\xE8\x91\xAC", + "\xD4\xE2" => "\xE9\x81\xAD", + "\xD4\xE3" => "\xE7\xB3\x9F", + "\xD4\xE4" => "\xE5\x87\xBF", + "\xD4\xE5" => "\xE8\x97\xBB", + "\xD4\xE6" => "\xE6\x9E\xA3", + "\xD4\xE7" => "\xE6\x97\xA9", + "\xD4\xE8" => "\xE6\xBE\xA1", + "\xD4\xE9" => "\xE8\x9A\xA4", + "\xD4\xEA" => "\xE8\xBA\x81", + "\xD4\xEB" => "\xE5\x99\xAA", + "\xD4\xEC" => "\xE9\x80\xA0", + "\xD4\xED" => "\xE7\x9A\x82", + "\xD4\xEE" => "\xE7\x81\xB6", + "\xD4\xEF" => "\xE7\x87\xA5", + "\xD4\xF0" => "\xE8\xB4\xA3", + "\xD4\xF1" => "\xE6\x8B\xA9", + "\xD4\xF2" => "\xE5\x88\x99", + "\xD4\xF3" => "\xE6\xB3\xBD", + "\xD4\xF4" => "\xE8\xB4\xBC", + "\xD4\xF5" => "\xE6\x80\x8E", + "\xD4\xF6" => "\xE5\xA2\x9E", + "\xD4\xF7" => "\xE6\x86\x8E", + "\xD4\xF8" => "\xE6\x9B\xBE", + "\xD4\xF9" => "\xE8\xB5\xA0", + "\xD4\xFA" => "\xE6\x89\x8E", + "\xD4\xFB" => "\xE5\x96\xB3", + "\xD4\xFC" => "\xE6\xB8\xA3", + "\xD4\xFD" => "\xE6\x9C\xAD", + "\xD4\xFE" => "\xE8\xBD\xA7", + "\xD5\xA1" => "\xE9\x93\xA1", + "\xD5\xA2" => "\xE9\x97\xB8", + "\xD5\xA3" => "\xE7\x9C\xA8", + "\xD5\xA4" => "\xE6\xA0\x85", + "\xD5\xA5" => "\xE6\xA6\xA8", + "\xD5\xA6" => "\xE5\x92\x8B", + "\xD5\xA7" => "\xE4\xB9\x8D", + "\xD5\xA8" => "\xE7\x82\xB8", + "\xD5\xA9" => "\xE8\xAF\x88", + "\xD5\xAA" => "\xE6\x91\x98", + "\xD5\xAB" => "\xE6\x96\x8B", + "\xD5\xAC" => "\xE5\xAE\x85", + "\xD5\xAD" => "\xE7\xAA\x84", + "\xD5\xAE" => "\xE5\x80\xBA", + "\xD5\xAF" => "\xE5\xAF\xA8", + "\xD5\xB0" => "\xE7\x9E\xBB", + "\xD5\xB1" => "\xE6\xAF\xA1", + "\xD5\xB2" => "\xE8\xA9\xB9", + "\xD5\xB3" => "\xE7\xB2\x98", + "\xD5\xB4" => "\xE6\xB2\xBE", + "\xD5\xB5" => "\xE7\x9B\x8F", + "\xD5\xB6" => "\xE6\x96\xA9", + "\xD5\xB7" => "\xE8\xBE\x97", + "\xD5\xB8" => "\xE5\xB4\xAD", + "\xD5\xB9" => "\xE5\xB1\x95", + "\xD5\xBA" => "\xE8\x98\xB8", + "\xD5\xBB" => "\xE6\xA0\x88", + "\xD5\xBC" => "\xE5\x8D\xA0", + "\xD5\xBD" => "\xE6\x88\x98", + "\xD5\xBE" => "\xE7\xAB\x99", + "\xD5\xBF" => "\xE6\xB9\x9B", + "\xD5\xC0" => "\xE7\xBB\xBD", + "\xD5\xC1" => "\xE6\xA8\x9F", + "\xD5\xC2" => "\xE7\xAB\xA0", + "\xD5\xC3" => "\xE5\xBD\xB0", + "\xD5\xC4" => "\xE6\xBC\xB3", + "\xD5\xC5" => "\xE5\xBC\xA0", + "\xD5\xC6" => "\xE6\x8E\x8C", + "\xD5\xC7" => "\xE6\xB6\xA8", + "\xD5\xC8" => "\xE6\x9D\x96", + "\xD5\xC9" => "\xE4\xB8\x88", + "\xD5\xCA" => "\xE5\xB8\x90", + "\xD5\xCB" => "\xE8\xB4\xA6", + "\xD5\xCC" => "\xE4\xBB\x97", + "\xD5\xCD" => "\xE8\x83\x80", + "\xD5\xCE" => "\xE7\x98\xB4", + "\xD5\xCF" => "\xE9\x9A\x9C", + "\xD5\xD0" => "\xE6\x8B\x9B", + "\xD5\xD1" => "\xE6\x98\xAD", + "\xD5\xD2" => "\xE6\x89\xBE", + "\xD5\xD3" => "\xE6\xB2\xBC", + "\xD5\xD4" => "\xE8\xB5\xB5", + "\xD5\xD5" => "\xE7\x85\xA7", + "\xD5\xD6" => "\xE7\xBD\xA9", + "\xD5\xD7" => "\xE5\x85\x86", + "\xD5\xD8" => "\xE8\x82\x87", + "\xD5\xD9" => "\xE5\x8F\xAC", + "\xD5\xDA" => "\xE9\x81\xAE", + "\xD5\xDB" => "\xE6\x8A\x98", + "\xD5\xDC" => "\xE5\x93\xB2", + "\xD5\xDD" => "\xE8\x9B\xB0", + "\xD5\xDE" => "\xE8\xBE\x99", + "\xD5\xDF" => "\xE8\x80\x85", + "\xD5\xE0" => "\xE9\x94\x97", + "\xD5\xE1" => "\xE8\x94\x97", + "\xD5\xE2" => "\xE8\xBF\x99", + "\xD5\xE3" => "\xE6\xB5\x99", + "\xD5\xE4" => "\xE7\x8F\x8D", + "\xD5\xE5" => "\xE6\x96\x9F", + "\xD5\xE6" => "\xE7\x9C\x9F", + "\xD5\xE7" => "\xE7\x94\x84", + "\xD5\xE8" => "\xE7\xA0\xA7", + "\xD5\xE9" => "\xE8\x87\xBB", + "\xD5\xEA" => "\xE8\xB4\x9E", + "\xD5\xEB" => "\xE9\x92\x88", + "\xD5\xEC" => "\xE4\xBE\xA6", + "\xD5\xED" => "\xE6\x9E\x95", + "\xD5\xEE" => "\xE7\x96\xB9", + "\xD5\xEF" => "\xE8\xAF\x8A", + "\xD5\xF0" => "\xE9\x9C\x87", + "\xD5\xF1" => "\xE6\x8C\xAF", + "\xD5\xF2" => "\xE9\x95\x87", + "\xD5\xF3" => "\xE9\x98\xB5", + "\xD5\xF4" => "\xE8\x92\xB8", + "\xD5\xF5" => "\xE6\x8C\xA3", + "\xD5\xF6" => "\xE7\x9D\x81", + "\xD5\xF7" => "\xE5\xBE\x81", + "\xD5\xF8" => "\xE7\x8B\xB0", + "\xD5\xF9" => "\xE4\xBA\x89", + "\xD5\xFA" => "\xE6\x80\x94", + "\xD5\xFB" => "\xE6\x95\xB4", + "\xD5\xFC" => "\xE6\x8B\xAF", + "\xD5\xFD" => "\xE6\xAD\xA3", + "\xD5\xFE" => "\xE6\x94\xBF", + "\xD6\xA1" => "\xE5\xB8\xA7", + "\xD6\xA2" => "\xE7\x97\x87", + "\xD6\xA3" => "\xE9\x83\x91", + "\xD6\xA4" => "\xE8\xAF\x81", + "\xD6\xA5" => "\xE8\x8A\x9D", + "\xD6\xA6" => "\xE6\x9E\x9D", + "\xD6\xA7" => "\xE6\x94\xAF", + "\xD6\xA8" => "\xE5\x90\xB1", + "\xD6\xA9" => "\xE8\x9C\x98", + "\xD6\xAA" => "\xE7\x9F\xA5", + "\xD6\xAB" => "\xE8\x82\xA2", + "\xD6\xAC" => "\xE8\x84\x82", + "\xD6\xAD" => "\xE6\xB1\x81", + "\xD6\xAE" => "\xE4\xB9\x8B", + "\xD6\xAF" => "\xE7\xBB\x87", + "\xD6\xB0" => "\xE8\x81\x8C", + "\xD6\xB1" => "\xE7\x9B\xB4", + "\xD6\xB2" => "\xE6\xA4\x8D", + "\xD6\xB3" => "\xE6\xAE\x96", + "\xD6\xB4" => "\xE6\x89\xA7", + "\xD6\xB5" => "\xE5\x80\xBC", + "\xD6\xB6" => "\xE4\xBE\x84", + "\xD6\xB7" => "\xE5\x9D\x80", + "\xD6\xB8" => "\xE6\x8C\x87", + "\xD6\xB9" => "\xE6\xAD\xA2", + "\xD6\xBA" => "\xE8\xB6\xBE", + "\xD6\xBB" => "\xE5\x8F\xAA", + "\xD6\xBC" => "\xE6\x97\xA8", + "\xD6\xBD" => "\xE7\xBA\xB8", + "\xD6\xBE" => "\xE5\xBF\x97", + "\xD6\xBF" => "\xE6\x8C\x9A", + "\xD6\xC0" => "\xE6\x8E\xB7", + "\xD6\xC1" => "\xE8\x87\xB3", + "\xD6\xC2" => "\xE8\x87\xB4", + "\xD6\xC3" => "\xE7\xBD\xAE", + "\xD6\xC4" => "\xE5\xB8\x9C", + "\xD6\xC5" => "\xE5\xB3\x99", + "\xD6\xC6" => "\xE5\x88\xB6", + "\xD6\xC7" => "\xE6\x99\xBA", + "\xD6\xC8" => "\xE7\xA7\xA9", + "\xD6\xC9" => "\xE7\xA8\x9A", + "\xD6\xCA" => "\xE8\xB4\xA8", + "\xD6\xCB" => "\xE7\x82\x99", + "\xD6\xCC" => "\xE7\x97\x94", + "\xD6\xCD" => "\xE6\xBB\x9E", + "\xD6\xCE" => "\xE6\xB2\xBB", + "\xD6\xCF" => "\xE7\xAA\x92", + "\xD6\xD0" => "\xE4\xB8\xAD", + "\xD6\xD1" => "\xE7\x9B\x85", + "\xD6\xD2" => "\xE5\xBF\xA0", + "\xD6\xD3" => "\xE9\x92\x9F", + "\xD6\xD4" => "\xE8\xA1\xB7", + "\xD6\xD5" => "\xE7\xBB\x88", + "\xD6\xD6" => "\xE7\xA7\x8D", + "\xD6\xD7" => "\xE8\x82\xBF", + "\xD6\xD8" => "\xE9\x87\x8D", + "\xD6\xD9" => "\xE4\xBB\xB2", + "\xD6\xDA" => "\xE4\xBC\x97", + "\xD6\xDB" => "\xE8\x88\x9F", + "\xD6\xDC" => "\xE5\x91\xA8", + "\xD6\xDD" => "\xE5\xB7\x9E", + "\xD6\xDE" => "\xE6\xB4\xB2", + "\xD6\xDF" => "\xE8\xAF\x8C", + "\xD6\xE0" => "\xE7\xB2\xA5", + "\xD6\xE1" => "\xE8\xBD\xB4", + "\xD6\xE2" => "\xE8\x82\x98", + "\xD6\xE3" => "\xE5\xB8\x9A", + "\xD6\xE4" => "\xE5\x92\x92", + "\xD6\xE5" => "\xE7\x9A\xB1", + "\xD6\xE6" => "\xE5\xAE\x99", + "\xD6\xE7" => "\xE6\x98\xBC", + "\xD6\xE8" => "\xE9\xAA\xA4", + "\xD6\xE9" => "\xE7\x8F\xA0", + "\xD6\xEA" => "\xE6\xA0\xAA", + "\xD6\xEB" => "\xE8\x9B\x9B", + "\xD6\xEC" => "\xE6\x9C\xB1", + "\xD6\xED" => "\xE7\x8C\xAA", + "\xD6\xEE" => "\xE8\xAF\xB8", + "\xD6\xEF" => "\xE8\xAF\x9B", + "\xD6\xF0" => "\xE9\x80\x90", + "\xD6\xF1" => "\xE7\xAB\xB9", + "\xD6\xF2" => "\xE7\x83\x9B", + "\xD6\xF3" => "\xE7\x85\xAE", + "\xD6\xF4" => "\xE6\x8B\x84", + "\xD6\xF5" => "\xE7\x9E\xA9", + "\xD6\xF6" => "\xE5\x98\xB1", + "\xD6\xF7" => "\xE4\xB8\xBB", + "\xD6\xF8" => "\xE8\x91\x97", + "\xD6\xF9" => "\xE6\x9F\xB1", + "\xD6\xFA" => "\xE5\x8A\xA9", + "\xD6\xFB" => "\xE8\x9B\x80", + "\xD6\xFC" => "\xE8\xB4\xAE", + "\xD6\xFD" => "\xE9\x93\xB8", + "\xD6\xFE" => "\xE7\xAD\x91", + "\xD7\xA1" => "\xE4\xBD\x8F", + "\xD7\xA2" => "\xE6\xB3\xA8", + "\xD7\xA3" => "\xE7\xA5\x9D", + "\xD7\xA4" => "\xE9\xA9\xBB", + "\xD7\xA5" => "\xE6\x8A\x93", + "\xD7\xA6" => "\xE7\x88\xAA", + "\xD7\xA7" => "\xE6\x8B\xBD", + "\xD7\xA8" => "\xE4\xB8\x93", + "\xD7\xA9" => "\xE7\xA0\x96", + "\xD7\xAA" => "\xE8\xBD\xAC", + "\xD7\xAB" => "\xE6\x92\xB0", + "\xD7\xAC" => "\xE8\xB5\x9A", + "\xD7\xAD" => "\xE7\xAF\x86", + "\xD7\xAE" => "\xE6\xA1\xA9", + "\xD7\xAF" => "\xE5\xBA\x84", + "\xD7\xB0" => "\xE8\xA3\x85", + "\xD7\xB1" => "\xE5\xA6\x86", + "\xD7\xB2" => "\xE6\x92\x9E", + "\xD7\xB3" => "\xE5\xA3\xAE", + "\xD7\xB4" => "\xE7\x8A\xB6", + "\xD7\xB5" => "\xE6\xA4\x8E", + "\xD7\xB6" => "\xE9\x94\xA5", + "\xD7\xB7" => "\xE8\xBF\xBD", + "\xD7\xB8" => "\xE8\xB5\x98", + "\xD7\xB9" => "\xE5\x9D\xA0", + "\xD7\xBA" => "\xE7\xBC\x80", + "\xD7\xBB" => "\xE8\xB0\x86", + "\xD7\xBC" => "\xE5\x87\x86", + "\xD7\xBD" => "\xE6\x8D\x89", + "\xD7\xBE" => "\xE6\x8B\x99", + "\xD7\xBF" => "\xE5\x8D\x93", + "\xD7\xC0" => "\xE6\xA1\x8C", + "\xD7\xC1" => "\xE7\x90\xA2", + "\xD7\xC2" => "\xE8\x8C\x81", + "\xD7\xC3" => "\xE9\x85\x8C", + "\xD7\xC4" => "\xE5\x95\x84", + "\xD7\xC5" => "\xE7\x9D\x80", + "\xD7\xC6" => "\xE7\x81\xBC", + "\xD7\xC7" => "\xE6\xB5\x8A", + "\xD7\xC8" => "\xE5\x85\xB9", + "\xD7\xC9" => "\xE5\x92\xA8", + "\xD7\xCA" => "\xE8\xB5\x84", + "\xD7\xCB" => "\xE5\xA7\xBF", + "\xD7\xCC" => "\xE6\xBB\x8B", + "\xD7\xCD" => "\xE6\xB7\x84", + "\xD7\xCE" => "\xE5\xAD\x9C", + "\xD7\xCF" => "\xE7\xB4\xAB", + "\xD7\xD0" => "\xE4\xBB\x94", + "\xD7\xD1" => "\xE7\xB1\xBD", + "\xD7\xD2" => "\xE6\xBB\x93", + "\xD7\xD3" => "\xE5\xAD\x90", + "\xD7\xD4" => "\xE8\x87\xAA", + "\xD7\xD5" => "\xE6\xB8\x8D", + "\xD7\xD6" => "\xE5\xAD\x97", + "\xD7\xD7" => "\xE9\xAC\x83", + "\xD7\xD8" => "\xE6\xA3\x95", + "\xD7\xD9" => "\xE8\xB8\xAA", + "\xD7\xDA" => "\xE5\xAE\x97", + "\xD7\xDB" => "\xE7\xBB\xBC", + "\xD7\xDC" => "\xE6\x80\xBB", + "\xD7\xDD" => "\xE7\xBA\xB5", + "\xD7\xDE" => "\xE9\x82\xB9", + "\xD7\xDF" => "\xE8\xB5\xB0", + "\xD7\xE0" => "\xE5\xA5\x8F", + "\xD7\xE1" => "\xE6\x8F\x8D", + "\xD7\xE2" => "\xE7\xA7\x9F", + "\xD7\xE3" => "\xE8\xB6\xB3", + "\xD7\xE4" => "\xE5\x8D\x92", + "\xD7\xE5" => "\xE6\x97\x8F", + "\xD7\xE6" => "\xE7\xA5\x96", + "\xD7\xE7" => "\xE8\xAF\x85", + "\xD7\xE8" => "\xE9\x98\xBB", + "\xD7\xE9" => "\xE7\xBB\x84", + "\xD7\xEA" => "\xE9\x92\xBB", + "\xD7\xEB" => "\xE7\xBA\x82", + "\xD7\xEC" => "\xE5\x98\xB4", + "\xD7\xED" => "\xE9\x86\x89", + "\xD7\xEE" => "\xE6\x9C\x80", + "\xD7\xEF" => "\xE7\xBD\xAA", + "\xD7\xF0" => "\xE5\xB0\x8A", + "\xD7\xF1" => "\xE9\x81\xB5", + "\xD7\xF2" => "\xE6\x98\xA8", + "\xD7\xF3" => "\xE5\xB7\xA6", + "\xD7\xF4" => "\xE4\xBD\x90", + "\xD7\xF5" => "\xE6\x9F\x9E", + "\xD7\xF6" => "\xE5\x81\x9A", + "\xD7\xF7" => "\xE4\xBD\x9C", + "\xD7\xF8" => "\xE5\x9D\x90", + "\xD7\xF9" => "\xE5\xBA\xA7", + "\xD8\xA1" => "\xE4\xBA\x8D", + "\xD8\xA2" => "\xE4\xB8\x8C", + "\xD8\xA3" => "\xE5\x85\x80", + "\xD8\xA4" => "\xE4\xB8\x90", + "\xD8\xA5" => "\xE5\xBB\xBF", + "\xD8\xA6" => "\xE5\x8D\x85", + "\xD8\xA7" => "\xE4\xB8\x95", + "\xD8\xA8" => "\xE4\xBA\x98", + "\xD8\xA9" => "\xE4\xB8\x9E", + "\xD8\xAA" => "\xE9\xAC\xB2", + "\xD8\xAB" => "\xE5\xAD\xAC", + "\xD8\xAC" => "\xE5\x99\xA9", + "\xD8\xAD" => "\xE4\xB8\xA8", + "\xD8\xAE" => "\xE7\xA6\xBA", + "\xD8\xAF" => "\xE4\xB8\xBF", + "\xD8\xB0" => "\xE5\x8C\x95", + "\xD8\xB1" => "\xE4\xB9\x87", + "\xD8\xB2" => "\xE5\xA4\xAD", + "\xD8\xB3" => "\xE7\x88\xBB", + "\xD8\xB4" => "\xE5\x8D\xAE", + "\xD8\xB5" => "\xE6\xB0\x90", + "\xD8\xB6" => "\xE5\x9B\x9F", + "\xD8\xB7" => "\xE8\x83\xA4", + "\xD8\xB8" => "\xE9\xA6\x97", + "\xD8\xB9" => "\xE6\xAF\x93", + "\xD8\xBA" => "\xE7\x9D\xBE", + "\xD8\xBB" => "\xE9\xBC\x97", + "\xD8\xBC" => "\xE4\xB8\xB6", + "\xD8\xBD" => "\xE4\xBA\x9F", + "\xD8\xBE" => "\xE9\xBC\x90", + "\xD8\xBF" => "\xE4\xB9\x9C", + "\xD8\xC0" => "\xE4\xB9\xA9", + "\xD8\xC1" => "\xE4\xBA\x93", + "\xD8\xC2" => "\xE8\x8A\x88", + "\xD8\xC3" => "\xE5\xAD\x9B", + "\xD8\xC4" => "\xE5\x95\xAC", + "\xD8\xC5" => "\xE5\x98\x8F", + "\xD8\xC6" => "\xE4\xBB\x84", + "\xD8\xC7" => "\xE5\x8E\x8D", + "\xD8\xC8" => "\xE5\x8E\x9D", + "\xD8\xC9" => "\xE5\x8E\xA3", + "\xD8\xCA" => "\xE5\x8E\xA5", + "\xD8\xCB" => "\xE5\x8E\xAE", + "\xD8\xCC" => "\xE9\x9D\xA5", + "\xD8\xCD" => "\xE8\xB5\x9D", + "\xD8\xCE" => "\xE5\x8C\x9A", + "\xD8\xCF" => "\xE5\x8F\xB5", + "\xD8\xD0" => "\xE5\x8C\xA6", + "\xD8\xD1" => "\xE5\x8C\xAE", + "\xD8\xD2" => "\xE5\x8C\xBE", + "\xD8\xD3" => "\xE8\xB5\x9C", + "\xD8\xD4" => "\xE5\x8D\xA6", + "\xD8\xD5" => "\xE5\x8D\xA3", + "\xD8\xD6" => "\xE5\x88\x82", + "\xD8\xD7" => "\xE5\x88\x88", + "\xD8\xD8" => "\xE5\x88\x8E", + "\xD8\xD9" => "\xE5\x88\xAD", + "\xD8\xDA" => "\xE5\x88\xB3", + "\xD8\xDB" => "\xE5\x88\xBF", + "\xD8\xDC" => "\xE5\x89\x80", + "\xD8\xDD" => "\xE5\x89\x8C", + "\xD8\xDE" => "\xE5\x89\x9E", + "\xD8\xDF" => "\xE5\x89\xA1", + "\xD8\xE0" => "\xE5\x89\x9C", + "\xD8\xE1" => "\xE8\x92\xAF", + "\xD8\xE2" => "\xE5\x89\xBD", + "\xD8\xE3" => "\xE5\x8A\x82", + "\xD8\xE4" => "\xE5\x8A\x81", + "\xD8\xE5" => "\xE5\x8A\x90", + "\xD8\xE6" => "\xE5\x8A\x93", + "\xD8\xE7" => "\xE5\x86\x82", + "\xD8\xE8" => "\xE7\xBD\x94", + "\xD8\xE9" => "\xE4\xBA\xBB", + "\xD8\xEA" => "\xE4\xBB\x83", + "\xD8\xEB" => "\xE4\xBB\x89", + "\xD8\xEC" => "\xE4\xBB\x82", + "\xD8\xED" => "\xE4\xBB\xA8", + "\xD8\xEE" => "\xE4\xBB\xA1", + "\xD8\xEF" => "\xE4\xBB\xAB", + "\xD8\xF0" => "\xE4\xBB\x9E", + "\xD8\xF1" => "\xE4\xBC\x9B", + "\xD8\xF2" => "\xE4\xBB\xB3", + "\xD8\xF3" => "\xE4\xBC\xA2", + "\xD8\xF4" => "\xE4\xBD\xA4", + "\xD8\xF5" => "\xE4\xBB\xB5", + "\xD8\xF6" => "\xE4\xBC\xA5", + "\xD8\xF7" => "\xE4\xBC\xA7", + "\xD8\xF8" => "\xE4\xBC\x89", + "\xD8\xF9" => "\xE4\xBC\xAB", + "\xD8\xFA" => "\xE4\xBD\x9E", + "\xD8\xFB" => "\xE4\xBD\xA7", + "\xD8\xFC" => "\xE6\x94\xB8", + "\xD8\xFD" => "\xE4\xBD\x9A", + "\xD8\xFE" => "\xE4\xBD\x9D", + "\xD9\xA1" => "\xE4\xBD\x9F", + "\xD9\xA2" => "\xE4\xBD\x97", + "\xD9\xA3" => "\xE4\xBC\xB2", + "\xD9\xA4" => "\xE4\xBC\xBD", + "\xD9\xA5" => "\xE4\xBD\xB6", + "\xD9\xA6" => "\xE4\xBD\xB4", + "\xD9\xA7" => "\xE4\xBE\x91", + "\xD9\xA8" => "\xE4\xBE\x89", + "\xD9\xA9" => "\xE4\xBE\x83", + "\xD9\xAA" => "\xE4\xBE\x8F", + "\xD9\xAB" => "\xE4\xBD\xBE", + "\xD9\xAC" => "\xE4\xBD\xBB", + "\xD9\xAD" => "\xE4\xBE\xAA", + "\xD9\xAE" => "\xE4\xBD\xBC", + "\xD9\xAF" => "\xE4\xBE\xAC", + "\xD9\xB0" => "\xE4\xBE\x94", + "\xD9\xB1" => "\xE4\xBF\xA6", + "\xD9\xB2" => "\xE4\xBF\xA8", + "\xD9\xB3" => "\xE4\xBF\xAA", + "\xD9\xB4" => "\xE4\xBF\x85", + "\xD9\xB5" => "\xE4\xBF\x9A", + "\xD9\xB6" => "\xE4\xBF\xA3", + "\xD9\xB7" => "\xE4\xBF\x9C", + "\xD9\xB8" => "\xE4\xBF\x91", + "\xD9\xB9" => "\xE4\xBF\x9F", + "\xD9\xBA" => "\xE4\xBF\xB8", + "\xD9\xBB" => "\xE5\x80\xA9", + "\xD9\xBC" => "\xE5\x81\x8C", + "\xD9\xBD" => "\xE4\xBF\xB3", + "\xD9\xBE" => "\xE5\x80\xAC", + "\xD9\xBF" => "\xE5\x80\x8F", + "\xD9\xC0" => "\xE5\x80\xAE", + "\xD9\xC1" => "\xE5\x80\xAD", + "\xD9\xC2" => "\xE4\xBF\xBE", + "\xD9\xC3" => "\xE5\x80\x9C", + "\xD9\xC4" => "\xE5\x80\x8C", + "\xD9\xC5" => "\xE5\x80\xA5", + "\xD9\xC6" => "\xE5\x80\xA8", + "\xD9\xC7" => "\xE5\x81\xBE", + "\xD9\xC8" => "\xE5\x81\x83", + "\xD9\xC9" => "\xE5\x81\x95", + "\xD9\xCA" => "\xE5\x81\x88", + "\xD9\xCB" => "\xE5\x81\x8E", + "\xD9\xCC" => "\xE5\x81\xAC", + "\xD9\xCD" => "\xE5\x81\xBB", + "\xD9\xCE" => "\xE5\x82\xA5", + "\xD9\xCF" => "\xE5\x82\xA7", + "\xD9\xD0" => "\xE5\x82\xA9", + "\xD9\xD1" => "\xE5\x82\xBA", + "\xD9\xD2" => "\xE5\x83\x96", + "\xD9\xD3" => "\xE5\x84\x86", + "\xD9\xD4" => "\xE5\x83\xAD", + "\xD9\xD5" => "\xE5\x83\xAC", + "\xD9\xD6" => "\xE5\x83\xA6", + "\xD9\xD7" => "\xE5\x83\xAE", + "\xD9\xD8" => "\xE5\x84\x87", + "\xD9\xD9" => "\xE5\x84\x8B", + "\xD9\xDA" => "\xE4\xBB\x9D", + "\xD9\xDB" => "\xE6\xB0\xBD", + "\xD9\xDC" => "\xE4\xBD\x98", + "\xD9\xDD" => "\xE4\xBD\xA5", + "\xD9\xDE" => "\xE4\xBF\x8E", + "\xD9\xDF" => "\xE9\xBE\xA0", + "\xD9\xE0" => "\xE6\xB1\x86", + "\xD9\xE1" => "\xE7\xB1\xB4", + "\xD9\xE2" => "\xE5\x85\xAE", + "\xD9\xE3" => "\xE5\xB7\xBD", + "\xD9\xE4" => "\xE9\xBB\x89", + "\xD9\xE5" => "\xE9\xA6\x98", + "\xD9\xE6" => "\xE5\x86\x81", + "\xD9\xE7" => "\xE5\xA4\x94", + "\xD9\xE8" => "\xE5\x8B\xB9", + "\xD9\xE9" => "\xE5\x8C\x8D", + "\xD9\xEA" => "\xE8\xA8\x87", + "\xD9\xEB" => "\xE5\x8C\x90", + "\xD9\xEC" => "\xE5\x87\xAB", + "\xD9\xED" => "\xE5\xA4\x99", + "\xD9\xEE" => "\xE5\x85\x95", + "\xD9\xEF" => "\xE4\xBA\xA0", + "\xD9\xF0" => "\xE5\x85\x96", + "\xD9\xF1" => "\xE4\xBA\xB3", + "\xD9\xF2" => "\xE8\xA1\xAE", + "\xD9\xF3" => "\xE8\xA2\xA4", + "\xD9\xF4" => "\xE4\xBA\xB5", + "\xD9\xF5" => "\xE8\x84\x94", + "\xD9\xF6" => "\xE8\xA3\x92", + "\xD9\xF7" => "\xE7\xA6\x80", + "\xD9\xF8" => "\xE5\xAC\xB4", + "\xD9\xF9" => "\xE8\xA0\x83", + "\xD9\xFA" => "\xE7\xBE\xB8", + "\xD9\xFB" => "\xE5\x86\xAB", + "\xD9\xFC" => "\xE5\x86\xB1", + "\xD9\xFD" => "\xE5\x86\xBD", + "\xD9\xFE" => "\xE5\x86\xBC", + "\xDA\xA1" => "\xE5\x87\x87", + "\xDA\xA2" => "\xE5\x86\x96", + "\xDA\xA3" => "\xE5\x86\xA2", + "\xDA\xA4" => "\xE5\x86\xA5", + "\xDA\xA5" => "\xE8\xAE\xA0", + "\xDA\xA6" => "\xE8\xAE\xA6", + "\xDA\xA7" => "\xE8\xAE\xA7", + "\xDA\xA8" => "\xE8\xAE\xAA", + "\xDA\xA9" => "\xE8\xAE\xB4", + "\xDA\xAA" => "\xE8\xAE\xB5", + "\xDA\xAB" => "\xE8\xAE\xB7", + "\xDA\xAC" => "\xE8\xAF\x82", + "\xDA\xAD" => "\xE8\xAF\x83", + "\xDA\xAE" => "\xE8\xAF\x8B", + "\xDA\xAF" => "\xE8\xAF\x8F", + "\xDA\xB0" => "\xE8\xAF\x8E", + "\xDA\xB1" => "\xE8\xAF\x92", + "\xDA\xB2" => "\xE8\xAF\x93", + "\xDA\xB3" => "\xE8\xAF\x94", + "\xDA\xB4" => "\xE8\xAF\x96", + "\xDA\xB5" => "\xE8\xAF\x98", + "\xDA\xB6" => "\xE8\xAF\x99", + "\xDA\xB7" => "\xE8\xAF\x9C", + "\xDA\xB8" => "\xE8\xAF\x9F", + "\xDA\xB9" => "\xE8\xAF\xA0", + "\xDA\xBA" => "\xE8\xAF\xA4", + "\xDA\xBB" => "\xE8\xAF\xA8", + "\xDA\xBC" => "\xE8\xAF\xA9", + "\xDA\xBD" => "\xE8\xAF\xAE", + "\xDA\xBE" => "\xE8\xAF\xB0", + "\xDA\xBF" => "\xE8\xAF\xB3", + "\xDA\xC0" => "\xE8\xAF\xB6", + "\xDA\xC1" => "\xE8\xAF\xB9", + "\xDA\xC2" => "\xE8\xAF\xBC", + "\xDA\xC3" => "\xE8\xAF\xBF", + "\xDA\xC4" => "\xE8\xB0\x80", + "\xDA\xC5" => "\xE8\xB0\x82", + "\xDA\xC6" => "\xE8\xB0\x84", + "\xDA\xC7" => "\xE8\xB0\x87", + "\xDA\xC8" => "\xE8\xB0\x8C", + "\xDA\xC9" => "\xE8\xB0\x8F", + "\xDA\xCA" => "\xE8\xB0\x91", + "\xDA\xCB" => "\xE8\xB0\x92", + "\xDA\xCC" => "\xE8\xB0\x94", + "\xDA\xCD" => "\xE8\xB0\x95", + "\xDA\xCE" => "\xE8\xB0\x96", + "\xDA\xCF" => "\xE8\xB0\x99", + "\xDA\xD0" => "\xE8\xB0\x9B", + "\xDA\xD1" => "\xE8\xB0\x98", + "\xDA\xD2" => "\xE8\xB0\x9D", + "\xDA\xD3" => "\xE8\xB0\x9F", + "\xDA\xD4" => "\xE8\xB0\xA0", + "\xDA\xD5" => "\xE8\xB0\xA1", + "\xDA\xD6" => "\xE8\xB0\xA5", + "\xDA\xD7" => "\xE8\xB0\xA7", + "\xDA\xD8" => "\xE8\xB0\xAA", + "\xDA\xD9" => "\xE8\xB0\xAB", + "\xDA\xDA" => "\xE8\xB0\xAE", + "\xDA\xDB" => "\xE8\xB0\xAF", + "\xDA\xDC" => "\xE8\xB0\xB2", + "\xDA\xDD" => "\xE8\xB0\xB3", + "\xDA\xDE" => "\xE8\xB0\xB5", + "\xDA\xDF" => "\xE8\xB0\xB6", + "\xDA\xE0" => "\xE5\x8D\xA9", + "\xDA\xE1" => "\xE5\x8D\xBA", + "\xDA\xE2" => "\xE9\x98\x9D", + "\xDA\xE3" => "\xE9\x98\xA2", + "\xDA\xE4" => "\xE9\x98\xA1", + "\xDA\xE5" => "\xE9\x98\xB1", + "\xDA\xE6" => "\xE9\x98\xAA", + "\xDA\xE7" => "\xE9\x98\xBD", + "\xDA\xE8" => "\xE9\x98\xBC", + "\xDA\xE9" => "\xE9\x99\x82", + "\xDA\xEA" => "\xE9\x99\x89", + "\xDA\xEB" => "\xE9\x99\x94", + "\xDA\xEC" => "\xE9\x99\x9F", + "\xDA\xED" => "\xE9\x99\xA7", + "\xDA\xEE" => "\xE9\x99\xAC", + "\xDA\xEF" => "\xE9\x99\xB2", + "\xDA\xF0" => "\xE9\x99\xB4", + "\xDA\xF1" => "\xE9\x9A\x88", + "\xDA\xF2" => "\xE9\x9A\x8D", + "\xDA\xF3" => "\xE9\x9A\x97", + "\xDA\xF4" => "\xE9\x9A\xB0", + "\xDA\xF5" => "\xE9\x82\x97", + "\xDA\xF6" => "\xE9\x82\x9B", + "\xDA\xF7" => "\xE9\x82\x9D", + "\xDA\xF8" => "\xE9\x82\x99", + "\xDA\xF9" => "\xE9\x82\xAC", + "\xDA\xFA" => "\xE9\x82\xA1", + "\xDA\xFB" => "\xE9\x82\xB4", + "\xDA\xFC" => "\xE9\x82\xB3", + "\xDA\xFD" => "\xE9\x82\xB6", + "\xDA\xFE" => "\xE9\x82\xBA", + "\xDB\xA1" => "\xE9\x82\xB8", + "\xDB\xA2" => "\xE9\x82\xB0", + "\xDB\xA3" => "\xE9\x83\x8F", + "\xDB\xA4" => "\xE9\x83\x85", + "\xDB\xA5" => "\xE9\x82\xBE", + "\xDB\xA6" => "\xE9\x83\x90", + "\xDB\xA7" => "\xE9\x83\x84", + "\xDB\xA8" => "\xE9\x83\x87", + "\xDB\xA9" => "\xE9\x83\x93", + "\xDB\xAA" => "\xE9\x83\xA6", + "\xDB\xAB" => "\xE9\x83\xA2", + "\xDB\xAC" => "\xE9\x83\x9C", + "\xDB\xAD" => "\xE9\x83\x97", + "\xDB\xAE" => "\xE9\x83\x9B", + "\xDB\xAF" => "\xE9\x83\xAB", + "\xDB\xB0" => "\xE9\x83\xAF", + "\xDB\xB1" => "\xE9\x83\xBE", + "\xDB\xB2" => "\xE9\x84\x84", + "\xDB\xB3" => "\xE9\x84\xA2", + "\xDB\xB4" => "\xE9\x84\x9E", + "\xDB\xB5" => "\xE9\x84\xA3", + "\xDB\xB6" => "\xE9\x84\xB1", + "\xDB\xB7" => "\xE9\x84\xAF", + "\xDB\xB8" => "\xE9\x84\xB9", + "\xDB\xB9" => "\xE9\x85\x83", + "\xDB\xBA" => "\xE9\x85\x86", + "\xDB\xBB" => "\xE5\x88\x8D", + "\xDB\xBC" => "\xE5\xA5\x82", + "\xDB\xBD" => "\xE5\x8A\xA2", + "\xDB\xBE" => "\xE5\x8A\xAC", + "\xDB\xBF" => "\xE5\x8A\xAD", + "\xDB\xC0" => "\xE5\x8A\xBE", + "\xDB\xC1" => "\xE5\x93\xBF", + "\xDB\xC2" => "\xE5\x8B\x90", + "\xDB\xC3" => "\xE5\x8B\x96", + "\xDB\xC4" => "\xE5\x8B\xB0", + "\xDB\xC5" => "\xE5\x8F\x9F", + "\xDB\xC6" => "\xE7\x87\xAE", + "\xDB\xC7" => "\xE7\x9F\x8D", + "\xDB\xC8" => "\xE5\xBB\xB4", + "\xDB\xC9" => "\xE5\x87\xB5", + "\xDB\xCA" => "\xE5\x87\xBC", + "\xDB\xCB" => "\xE9\xAC\xAF", + "\xDB\xCC" => "\xE5\x8E\xB6", + "\xDB\xCD" => "\xE5\xBC\x81", + "\xDB\xCE" => "\xE7\x95\x9A", + "\xDB\xCF" => "\xE5\xB7\xAF", + "\xDB\xD0" => "\xE5\x9D\x8C", + "\xDB\xD1" => "\xE5\x9E\xA9", + "\xDB\xD2" => "\xE5\x9E\xA1", + "\xDB\xD3" => "\xE5\xA1\xBE", + "\xDB\xD4" => "\xE5\xA2\xBC", + "\xDB\xD5" => "\xE5\xA3\x85", + "\xDB\xD6" => "\xE5\xA3\x91", + "\xDB\xD7" => "\xE5\x9C\xA9", + "\xDB\xD8" => "\xE5\x9C\xAC", + "\xDB\xD9" => "\xE5\x9C\xAA", + "\xDB\xDA" => "\xE5\x9C\xB3", + "\xDB\xDB" => "\xE5\x9C\xB9", + "\xDB\xDC" => "\xE5\x9C\xAE", + "\xDB\xDD" => "\xE5\x9C\xAF", + "\xDB\xDE" => "\xE5\x9D\x9C", + "\xDB\xDF" => "\xE5\x9C\xBB", + "\xDB\xE0" => "\xE5\x9D\x82", + "\xDB\xE1" => "\xE5\x9D\xA9", + "\xDB\xE2" => "\xE5\x9E\x85", + "\xDB\xE3" => "\xE5\x9D\xAB", + "\xDB\xE4" => "\xE5\x9E\x86", + "\xDB\xE5" => "\xE5\x9D\xBC", + "\xDB\xE6" => "\xE5\x9D\xBB", + "\xDB\xE7" => "\xE5\x9D\xA8", + "\xDB\xE8" => "\xE5\x9D\xAD", + "\xDB\xE9" => "\xE5\x9D\xB6", + "\xDB\xEA" => "\xE5\x9D\xB3", + "\xDB\xEB" => "\xE5\x9E\xAD", + "\xDB\xEC" => "\xE5\x9E\xA4", + "\xDB\xED" => "\xE5\x9E\x8C", + "\xDB\xEE" => "\xE5\x9E\xB2", + "\xDB\xEF" => "\xE5\x9F\x8F", + "\xDB\xF0" => "\xE5\x9E\xA7", + "\xDB\xF1" => "\xE5\x9E\xB4", + "\xDB\xF2" => "\xE5\x9E\x93", + "\xDB\xF3" => "\xE5\x9E\xA0", + "\xDB\xF4" => "\xE5\x9F\x95", + "\xDB\xF5" => "\xE5\x9F\x98", + "\xDB\xF6" => "\xE5\x9F\x9A", + "\xDB\xF7" => "\xE5\x9F\x99", + "\xDB\xF8" => "\xE5\x9F\x92", + "\xDB\xF9" => "\xE5\x9E\xB8", + "\xDB\xFA" => "\xE5\x9F\xB4", + "\xDB\xFB" => "\xE5\x9F\xAF", + "\xDB\xFC" => "\xE5\x9F\xB8", + "\xDB\xFD" => "\xE5\x9F\xA4", + "\xDB\xFE" => "\xE5\x9F\x9D", + "\xDC\xA1" => "\xE5\xA0\x8B", + "\xDC\xA2" => "\xE5\xA0\x8D", + "\xDC\xA3" => "\xE5\x9F\xBD", + "\xDC\xA4" => "\xE5\x9F\xAD", + "\xDC\xA5" => "\xE5\xA0\x80", + "\xDC\xA6" => "\xE5\xA0\x9E", + "\xDC\xA7" => "\xE5\xA0\x99", + "\xDC\xA8" => "\xE5\xA1\x84", + "\xDC\xA9" => "\xE5\xA0\xA0", + "\xDC\xAA" => "\xE5\xA1\xA5", + "\xDC\xAB" => "\xE5\xA1\xAC", + "\xDC\xAC" => "\xE5\xA2\x81", + "\xDC\xAD" => "\xE5\xA2\x89", + "\xDC\xAE" => "\xE5\xA2\x9A", + "\xDC\xAF" => "\xE5\xA2\x80", + "\xDC\xB0" => "\xE9\xA6\xA8", + "\xDC\xB1" => "\xE9\xBC\x99", + "\xDC\xB2" => "\xE6\x87\xBF", + "\xDC\xB3" => "\xE8\x89\xB9", + "\xDC\xB4" => "\xE8\x89\xBD", + "\xDC\xB5" => "\xE8\x89\xBF", + "\xDC\xB6" => "\xE8\x8A\x8F", + "\xDC\xB7" => "\xE8\x8A\x8A", + "\xDC\xB8" => "\xE8\x8A\xA8", + "\xDC\xB9" => "\xE8\x8A\x84", + "\xDC\xBA" => "\xE8\x8A\x8E", + "\xDC\xBB" => "\xE8\x8A\x91", + "\xDC\xBC" => "\xE8\x8A\x97", + "\xDC\xBD" => "\xE8\x8A\x99", + "\xDC\xBE" => "\xE8\x8A\xAB", + "\xDC\xBF" => "\xE8\x8A\xB8", + "\xDC\xC0" => "\xE8\x8A\xBE", + "\xDC\xC1" => "\xE8\x8A\xB0", + "\xDC\xC2" => "\xE8\x8B\x88", + "\xDC\xC3" => "\xE8\x8B\x8A", + "\xDC\xC4" => "\xE8\x8B\xA3", + "\xDC\xC5" => "\xE8\x8A\x98", + "\xDC\xC6" => "\xE8\x8A\xB7", + "\xDC\xC7" => "\xE8\x8A\xAE", + "\xDC\xC8" => "\xE8\x8B\x8B", + "\xDC\xC9" => "\xE8\x8B\x8C", + "\xDC\xCA" => "\xE8\x8B\x81", + "\xDC\xCB" => "\xE8\x8A\xA9", + "\xDC\xCC" => "\xE8\x8A\xB4", + "\xDC\xCD" => "\xE8\x8A\xA1", + "\xDC\xCE" => "\xE8\x8A\xAA", + "\xDC\xCF" => "\xE8\x8A\x9F", + "\xDC\xD0" => "\xE8\x8B\x84", + "\xDC\xD1" => "\xE8\x8B\x8E", + "\xDC\xD2" => "\xE8\x8A\xA4", + "\xDC\xD3" => "\xE8\x8B\xA1", + "\xDC\xD4" => "\xE8\x8C\x89", + "\xDC\xD5" => "\xE8\x8B\xB7", + "\xDC\xD6" => "\xE8\x8B\xA4", + "\xDC\xD7" => "\xE8\x8C\x8F", + "\xDC\xD8" => "\xE8\x8C\x87", + "\xDC\xD9" => "\xE8\x8B\x9C", + "\xDC\xDA" => "\xE8\x8B\xB4", + "\xDC\xDB" => "\xE8\x8B\x92", + "\xDC\xDC" => "\xE8\x8B\x98", + "\xDC\xDD" => "\xE8\x8C\x8C", + "\xDC\xDE" => "\xE8\x8B\xBB", + "\xDC\xDF" => "\xE8\x8B\x93", + "\xDC\xE0" => "\xE8\x8C\x91", + "\xDC\xE1" => "\xE8\x8C\x9A", + "\xDC\xE2" => "\xE8\x8C\x86", + "\xDC\xE3" => "\xE8\x8C\x94", + "\xDC\xE4" => "\xE8\x8C\x95", + "\xDC\xE5" => "\xE8\x8B\xA0", + "\xDC\xE6" => "\xE8\x8B\x95", + "\xDC\xE7" => "\xE8\x8C\x9C", + "\xDC\xE8" => "\xE8\x8D\x91", + "\xDC\xE9" => "\xE8\x8D\x9B", + "\xDC\xEA" => "\xE8\x8D\x9C", + "\xDC\xEB" => "\xE8\x8C\x88", + "\xDC\xEC" => "\xE8\x8E\x92", + "\xDC\xED" => "\xE8\x8C\xBC", + "\xDC\xEE" => "\xE8\x8C\xB4", + "\xDC\xEF" => "\xE8\x8C\xB1", + "\xDC\xF0" => "\xE8\x8E\x9B", + "\xDC\xF1" => "\xE8\x8D\x9E", + "\xDC\xF2" => "\xE8\x8C\xAF", + "\xDC\xF3" => "\xE8\x8D\x8F", + "\xDC\xF4" => "\xE8\x8D\x87", + "\xDC\xF5" => "\xE8\x8D\x83", + "\xDC\xF6" => "\xE8\x8D\x9F", + "\xDC\xF7" => "\xE8\x8D\x80", + "\xDC\xF8" => "\xE8\x8C\x97", + "\xDC\xF9" => "\xE8\x8D\xA0", + "\xDC\xFA" => "\xE8\x8C\xAD", + "\xDC\xFB" => "\xE8\x8C\xBA", + "\xDC\xFC" => "\xE8\x8C\xB3", + "\xDC\xFD" => "\xE8\x8D\xA6", + "\xDC\xFE" => "\xE8\x8D\xA5", + "\xDD\xA1" => "\xE8\x8D\xA8", + "\xDD\xA2" => "\xE8\x8C\x9B", + "\xDD\xA3" => "\xE8\x8D\xA9", + "\xDD\xA4" => "\xE8\x8D\xAC", + "\xDD\xA5" => "\xE8\x8D\xAA", + "\xDD\xA6" => "\xE8\x8D\xAD", + "\xDD\xA7" => "\xE8\x8D\xAE", + "\xDD\xA8" => "\xE8\x8E\xB0", + "\xDD\xA9" => "\xE8\x8D\xB8", + "\xDD\xAA" => "\xE8\x8E\xB3", + "\xDD\xAB" => "\xE8\x8E\xB4", + "\xDD\xAC" => "\xE8\x8E\xA0", + "\xDD\xAD" => "\xE8\x8E\xAA", + "\xDD\xAE" => "\xE8\x8E\x93", + "\xDD\xAF" => "\xE8\x8E\x9C", + "\xDD\xB0" => "\xE8\x8E\x85", + "\xDD\xB1" => "\xE8\x8D\xBC", + "\xDD\xB2" => "\xE8\x8E\xB6", + "\xDD\xB3" => "\xE8\x8E\xA9", + "\xDD\xB4" => "\xE8\x8D\xBD", + "\xDD\xB5" => "\xE8\x8E\xB8", + "\xDD\xB6" => "\xE8\x8D\xBB", + "\xDD\xB7" => "\xE8\x8E\x98", + "\xDD\xB8" => "\xE8\x8E\x9E", + "\xDD\xB9" => "\xE8\x8E\xA8", + "\xDD\xBA" => "\xE8\x8E\xBA", + "\xDD\xBB" => "\xE8\x8E\xBC", + "\xDD\xBC" => "\xE8\x8F\x81", + "\xDD\xBD" => "\xE8\x90\x81", + "\xDD\xBE" => "\xE8\x8F\xA5", + "\xDD\xBF" => "\xE8\x8F\x98", + "\xDD\xC0" => "\xE5\xA0\x87", + "\xDD\xC1" => "\xE8\x90\x98", + "\xDD\xC2" => "\xE8\x90\x8B", + "\xDD\xC3" => "\xE8\x8F\x9D", + "\xDD\xC4" => "\xE8\x8F\xBD", + "\xDD\xC5" => "\xE8\x8F\x96", + "\xDD\xC6" => "\xE8\x90\x9C", + "\xDD\xC7" => "\xE8\x90\xB8", + "\xDD\xC8" => "\xE8\x90\x91", + "\xDD\xC9" => "\xE8\x90\x86", + "\xDD\xCA" => "\xE8\x8F\x94", + "\xDD\xCB" => "\xE8\x8F\x9F", + "\xDD\xCC" => "\xE8\x90\x8F", + "\xDD\xCD" => "\xE8\x90\x83", + "\xDD\xCE" => "\xE8\x8F\xB8", + "\xDD\xCF" => "\xE8\x8F\xB9", + "\xDD\xD0" => "\xE8\x8F\xAA", + "\xDD\xD1" => "\xE8\x8F\x85", + "\xDD\xD2" => "\xE8\x8F\x80", + "\xDD\xD3" => "\xE8\x90\xA6", + "\xDD\xD4" => "\xE8\x8F\xB0", + "\xDD\xD5" => "\xE8\x8F\xA1", + "\xDD\xD6" => "\xE8\x91\x9C", + "\xDD\xD7" => "\xE8\x91\x91", + "\xDD\xD8" => "\xE8\x91\x9A", + "\xDD\xD9" => "\xE8\x91\x99", + "\xDD\xDA" => "\xE8\x91\xB3", + "\xDD\xDB" => "\xE8\x92\x87", + "\xDD\xDC" => "\xE8\x92\x88", + "\xDD\xDD" => "\xE8\x91\xBA", + "\xDD\xDE" => "\xE8\x92\x89", + "\xDD\xDF" => "\xE8\x91\xB8", + "\xDD\xE0" => "\xE8\x90\xBC", + "\xDD\xE1" => "\xE8\x91\x86", + "\xDD\xE2" => "\xE8\x91\xA9", + "\xDD\xE3" => "\xE8\x91\xB6", + "\xDD\xE4" => "\xE8\x92\x8C", + "\xDD\xE5" => "\xE8\x92\x8E", + "\xDD\xE6" => "\xE8\x90\xB1", + "\xDD\xE7" => "\xE8\x91\xAD", + "\xDD\xE8" => "\xE8\x93\x81", + "\xDD\xE9" => "\xE8\x93\x8D", + "\xDD\xEA" => "\xE8\x93\x90", + "\xDD\xEB" => "\xE8\x93\xA6", + "\xDD\xEC" => "\xE8\x92\xBD", + "\xDD\xED" => "\xE8\x93\x93", + "\xDD\xEE" => "\xE8\x93\x8A", + "\xDD\xEF" => "\xE8\x92\xBF", + "\xDD\xF0" => "\xE8\x92\xBA", + "\xDD\xF1" => "\xE8\x93\xA0", + "\xDD\xF2" => "\xE8\x92\xA1", + "\xDD\xF3" => "\xE8\x92\xB9", + "\xDD\xF4" => "\xE8\x92\xB4", + "\xDD\xF5" => "\xE8\x92\x97", + "\xDD\xF6" => "\xE8\x93\xA5", + "\xDD\xF7" => "\xE8\x93\xA3", + "\xDD\xF8" => "\xE8\x94\x8C", + "\xDD\xF9" => "\xE7\x94\x8D", + "\xDD\xFA" => "\xE8\x94\xB8", + "\xDD\xFB" => "\xE8\x93\xB0", + "\xDD\xFC" => "\xE8\x94\xB9", + "\xDD\xFD" => "\xE8\x94\x9F", + "\xDD\xFE" => "\xE8\x94\xBA", + "\xDE\xA1" => "\xE8\x95\x96", + "\xDE\xA2" => "\xE8\x94\xBB", + "\xDE\xA3" => "\xE8\x93\xBF", + "\xDE\xA4" => "\xE8\x93\xBC", + "\xDE\xA5" => "\xE8\x95\x99", + "\xDE\xA6" => "\xE8\x95\x88", + "\xDE\xA7" => "\xE8\x95\xA8", + "\xDE\xA8" => "\xE8\x95\xA4", + "\xDE\xA9" => "\xE8\x95\x9E", + "\xDE\xAA" => "\xE8\x95\xBA", + "\xDE\xAB" => "\xE7\x9E\xA2", + "\xDE\xAC" => "\xE8\x95\x83", + "\xDE\xAD" => "\xE8\x95\xB2", + "\xDE\xAE" => "\xE8\x95\xBB", + "\xDE\xAF" => "\xE8\x96\xA4", + "\xDE\xB0" => "\xE8\x96\xA8", + "\xDE\xB1" => "\xE8\x96\x87", + "\xDE\xB2" => "\xE8\x96\x8F", + "\xDE\xB3" => "\xE8\x95\xB9", + "\xDE\xB4" => "\xE8\x96\xAE", + "\xDE\xB5" => "\xE8\x96\x9C", + "\xDE\xB6" => "\xE8\x96\x85", + "\xDE\xB7" => "\xE8\x96\xB9", + "\xDE\xB8" => "\xE8\x96\xB7", + "\xDE\xB9" => "\xE8\x96\xB0", + "\xDE\xBA" => "\xE8\x97\x93", + "\xDE\xBB" => "\xE8\x97\x81", + "\xDE\xBC" => "\xE8\x97\x9C", + "\xDE\xBD" => "\xE8\x97\xBF", + "\xDE\xBE" => "\xE8\x98\xA7", + "\xDE\xBF" => "\xE8\x98\x85", + "\xDE\xC0" => "\xE8\x98\xA9", + "\xDE\xC1" => "\xE8\x98\x96", + "\xDE\xC2" => "\xE8\x98\xBC", + "\xDE\xC3" => "\xE5\xBB\xBE", + "\xDE\xC4" => "\xE5\xBC\x88", + "\xDE\xC5" => "\xE5\xA4\xBC", + "\xDE\xC6" => "\xE5\xA5\x81", + "\xDE\xC7" => "\xE8\x80\xB7", + "\xDE\xC8" => "\xE5\xA5\x95", + "\xDE\xC9" => "\xE5\xA5\x9A", + "\xDE\xCA" => "\xE5\xA5\x98", + "\xDE\xCB" => "\xE5\x8C\x8F", + "\xDE\xCC" => "\xE5\xB0\xA2", + "\xDE\xCD" => "\xE5\xB0\xA5", + "\xDE\xCE" => "\xE5\xB0\xAC", + "\xDE\xCF" => "\xE5\xB0\xB4", + "\xDE\xD0" => "\xE6\x89\x8C", + "\xDE\xD1" => "\xE6\x89\xAA", + "\xDE\xD2" => "\xE6\x8A\x9F", + "\xDE\xD3" => "\xE6\x8A\xBB", + "\xDE\xD4" => "\xE6\x8B\x8A", + "\xDE\xD5" => "\xE6\x8B\x9A", + "\xDE\xD6" => "\xE6\x8B\x97", + "\xDE\xD7" => "\xE6\x8B\xAE", + "\xDE\xD8" => "\xE6\x8C\xA2", + "\xDE\xD9" => "\xE6\x8B\xB6", + "\xDE\xDA" => "\xE6\x8C\xB9", + "\xDE\xDB" => "\xE6\x8D\x8B", + "\xDE\xDC" => "\xE6\x8D\x83", + "\xDE\xDD" => "\xE6\x8E\xAD", + "\xDE\xDE" => "\xE6\x8F\xB6", + "\xDE\xDF" => "\xE6\x8D\xB1", + "\xDE\xE0" => "\xE6\x8D\xBA", + "\xDE\xE1" => "\xE6\x8E\x8E", + "\xDE\xE2" => "\xE6\x8E\xB4", + "\xDE\xE3" => "\xE6\x8D\xAD", + "\xDE\xE4" => "\xE6\x8E\xAC", + "\xDE\xE5" => "\xE6\x8E\x8A", + "\xDE\xE6" => "\xE6\x8D\xA9", + "\xDE\xE7" => "\xE6\x8E\xAE", + "\xDE\xE8" => "\xE6\x8E\xBC", + "\xDE\xE9" => "\xE6\x8F\xB2", + "\xDE\xEA" => "\xE6\x8F\xB8", + "\xDE\xEB" => "\xE6\x8F\xA0", + "\xDE\xEC" => "\xE6\x8F\xBF", + "\xDE\xED" => "\xE6\x8F\x84", + "\xDE\xEE" => "\xE6\x8F\x9E", + "\xDE\xEF" => "\xE6\x8F\x8E", + "\xDE\xF0" => "\xE6\x91\x92", + "\xDE\xF1" => "\xE6\x8F\x86", + "\xDE\xF2" => "\xE6\x8E\xBE", + "\xDE\xF3" => "\xE6\x91\x85", + "\xDE\xF4" => "\xE6\x91\x81", + "\xDE\xF5" => "\xE6\x90\x8B", + "\xDE\xF6" => "\xE6\x90\x9B", + "\xDE\xF7" => "\xE6\x90\xA0", + "\xDE\xF8" => "\xE6\x90\x8C", + "\xDE\xF9" => "\xE6\x90\xA6", + "\xDE\xFA" => "\xE6\x90\xA1", + "\xDE\xFB" => "\xE6\x91\x9E", + "\xDE\xFC" => "\xE6\x92\x84", + "\xDE\xFD" => "\xE6\x91\xAD", + "\xDE\xFE" => "\xE6\x92\x96", + "\xDF\xA1" => "\xE6\x91\xBA", + "\xDF\xA2" => "\xE6\x92\xB7", + "\xDF\xA3" => "\xE6\x92\xB8", + "\xDF\xA4" => "\xE6\x92\x99", + "\xDF\xA5" => "\xE6\x92\xBA", + "\xDF\xA6" => "\xE6\x93\x80", + "\xDF\xA7" => "\xE6\x93\x90", + "\xDF\xA8" => "\xE6\x93\x97", + "\xDF\xA9" => "\xE6\x93\xA4", + "\xDF\xAA" => "\xE6\x93\xA2", + "\xDF\xAB" => "\xE6\x94\x89", + "\xDF\xAC" => "\xE6\x94\xA5", + "\xDF\xAD" => "\xE6\x94\xAE", + "\xDF\xAE" => "\xE5\xBC\x8B", + "\xDF\xAF" => "\xE5\xBF\x92", + "\xDF\xB0" => "\xE7\x94\x99", + "\xDF\xB1" => "\xE5\xBC\x91", + "\xDF\xB2" => "\xE5\x8D\x9F", + "\xDF\xB3" => "\xE5\x8F\xB1", + "\xDF\xB4" => "\xE5\x8F\xBD", + "\xDF\xB5" => "\xE5\x8F\xA9", + "\xDF\xB6" => "\xE5\x8F\xA8", + "\xDF\xB7" => "\xE5\x8F\xBB", + "\xDF\xB8" => "\xE5\x90\x92", + "\xDF\xB9" => "\xE5\x90\x96", + "\xDF\xBA" => "\xE5\x90\x86", + "\xDF\xBB" => "\xE5\x91\x8B", + "\xDF\xBC" => "\xE5\x91\x92", + "\xDF\xBD" => "\xE5\x91\x93", + "\xDF\xBE" => "\xE5\x91\x94", + "\xDF\xBF" => "\xE5\x91\x96", + "\xDF\xC0" => "\xE5\x91\x83", + "\xDF\xC1" => "\xE5\x90\xA1", + "\xDF\xC2" => "\xE5\x91\x97", + "\xDF\xC3" => "\xE5\x91\x99", + "\xDF\xC4" => "\xE5\x90\xA3", + "\xDF\xC5" => "\xE5\x90\xB2", + "\xDF\xC6" => "\xE5\x92\x82", + "\xDF\xC7" => "\xE5\x92\x94", + "\xDF\xC8" => "\xE5\x91\xB7", + "\xDF\xC9" => "\xE5\x91\xB1", + "\xDF\xCA" => "\xE5\x91\xA4", + "\xDF\xCB" => "\xE5\x92\x9A", + "\xDF\xCC" => "\xE5\x92\x9B", + "\xDF\xCD" => "\xE5\x92\x84", + "\xDF\xCE" => "\xE5\x91\xB6", + "\xDF\xCF" => "\xE5\x91\xA6", + "\xDF\xD0" => "\xE5\x92\x9D", + "\xDF\xD1" => "\xE5\x93\x90", + "\xDF\xD2" => "\xE5\x92\xAD", + "\xDF\xD3" => "\xE5\x93\x82", + "\xDF\xD4" => "\xE5\x92\xB4", + "\xDF\xD5" => "\xE5\x93\x92", + "\xDF\xD6" => "\xE5\x92\xA7", + "\xDF\xD7" => "\xE5\x92\xA6", + "\xDF\xD8" => "\xE5\x93\x93", + "\xDF\xD9" => "\xE5\x93\x94", + "\xDF\xDA" => "\xE5\x91\xB2", + "\xDF\xDB" => "\xE5\x92\xA3", + "\xDF\xDC" => "\xE5\x93\x95", + "\xDF\xDD" => "\xE5\x92\xBB", + "\xDF\xDE" => "\xE5\x92\xBF", + "\xDF\xDF" => "\xE5\x93\x8C", + "\xDF\xE0" => "\xE5\x93\x99", + "\xDF\xE1" => "\xE5\x93\x9A", + "\xDF\xE2" => "\xE5\x93\x9C", + "\xDF\xE3" => "\xE5\x92\xA9", + "\xDF\xE4" => "\xE5\x92\xAA", + "\xDF\xE5" => "\xE5\x92\xA4", + "\xDF\xE6" => "\xE5\x93\x9D", + "\xDF\xE7" => "\xE5\x93\x8F", + "\xDF\xE8" => "\xE5\x93\x9E", + "\xDF\xE9" => "\xE5\x94\x9B", + "\xDF\xEA" => "\xE5\x93\xA7", + "\xDF\xEB" => "\xE5\x94\xA0", + "\xDF\xEC" => "\xE5\x93\xBD", + "\xDF\xED" => "\xE5\x94\x94", + "\xDF\xEE" => "\xE5\x93\xB3", + "\xDF\xEF" => "\xE5\x94\xA2", + "\xDF\xF0" => "\xE5\x94\xA3", + "\xDF\xF1" => "\xE5\x94\x8F", + "\xDF\xF2" => "\xE5\x94\x91", + "\xDF\xF3" => "\xE5\x94\xA7", + "\xDF\xF4" => "\xE5\x94\xAA", + "\xDF\xF5" => "\xE5\x95\xA7", + "\xDF\xF6" => "\xE5\x96\x8F", + "\xDF\xF7" => "\xE5\x96\xB5", + "\xDF\xF8" => "\xE5\x95\x89", + "\xDF\xF9" => "\xE5\x95\xAD", + "\xDF\xFA" => "\xE5\x95\x81", + "\xDF\xFB" => "\xE5\x95\x95", + "\xDF\xFC" => "\xE5\x94\xBF", + "\xDF\xFD" => "\xE5\x95\x90", + "\xDF\xFE" => "\xE5\x94\xBC", + "\xE0\xA1" => "\xE5\x94\xB7", + "\xE0\xA2" => "\xE5\x95\x96", + "\xE0\xA3" => "\xE5\x95\xB5", + "\xE0\xA4" => "\xE5\x95\xB6", + "\xE0\xA5" => "\xE5\x95\xB7", + "\xE0\xA6" => "\xE5\x94\xB3", + "\xE0\xA7" => "\xE5\x94\xB0", + "\xE0\xA8" => "\xE5\x95\x9C", + "\xE0\xA9" => "\xE5\x96\x8B", + "\xE0\xAA" => "\xE5\x97\x92", + "\xE0\xAB" => "\xE5\x96\x83", + "\xE0\xAC" => "\xE5\x96\xB1", + "\xE0\xAD" => "\xE5\x96\xB9", + "\xE0\xAE" => "\xE5\x96\x88", + "\xE0\xAF" => "\xE5\x96\x81", + "\xE0\xB0" => "\xE5\x96\x9F", + "\xE0\xB1" => "\xE5\x95\xBE", + "\xE0\xB2" => "\xE5\x97\x96", + "\xE0\xB3" => "\xE5\x96\x91", + "\xE0\xB4" => "\xE5\x95\xBB", + "\xE0\xB5" => "\xE5\x97\x9F", + "\xE0\xB6" => "\xE5\x96\xBD", + "\xE0\xB7" => "\xE5\x96\xBE", + "\xE0\xB8" => "\xE5\x96\x94", + "\xE0\xB9" => "\xE5\x96\x99", + "\xE0\xBA" => "\xE5\x97\xAA", + "\xE0\xBB" => "\xE5\x97\xB7", + "\xE0\xBC" => "\xE5\x97\x89", + "\xE0\xBD" => "\xE5\x98\x9F", + "\xE0\xBE" => "\xE5\x97\x91", + "\xE0\xBF" => "\xE5\x97\xAB", + "\xE0\xC0" => "\xE5\x97\xAC", + "\xE0\xC1" => "\xE5\x97\x94", + "\xE0\xC2" => "\xE5\x97\xA6", + "\xE0\xC3" => "\xE5\x97\x9D", + "\xE0\xC4" => "\xE5\x97\x84", + "\xE0\xC5" => "\xE5\x97\xAF", + "\xE0\xC6" => "\xE5\x97\xA5", + "\xE0\xC7" => "\xE5\x97\xB2", + "\xE0\xC8" => "\xE5\x97\xB3", + "\xE0\xC9" => "\xE5\x97\x8C", + "\xE0\xCA" => "\xE5\x97\x8D", + "\xE0\xCB" => "\xE5\x97\xA8", + "\xE0\xCC" => "\xE5\x97\xB5", + "\xE0\xCD" => "\xE5\x97\xA4", + "\xE0\xCE" => "\xE8\xBE\x94", + "\xE0\xCF" => "\xE5\x98\x9E", + "\xE0\xD0" => "\xE5\x98\x88", + "\xE0\xD1" => "\xE5\x98\x8C", + "\xE0\xD2" => "\xE5\x98\x81", + "\xE0\xD3" => "\xE5\x98\xA4", + "\xE0\xD4" => "\xE5\x98\xA3", + "\xE0\xD5" => "\xE5\x97\xBE", + "\xE0\xD6" => "\xE5\x98\x80", + "\xE0\xD7" => "\xE5\x98\xA7", + "\xE0\xD8" => "\xE5\x98\xAD", + "\xE0\xD9" => "\xE5\x99\x98", + "\xE0\xDA" => "\xE5\x98\xB9", + "\xE0\xDB" => "\xE5\x99\x97", + "\xE0\xDC" => "\xE5\x98\xAC", + "\xE0\xDD" => "\xE5\x99\x8D", + "\xE0\xDE" => "\xE5\x99\xA2", + "\xE0\xDF" => "\xE5\x99\x99", + "\xE0\xE0" => "\xE5\x99\x9C", + "\xE0\xE1" => "\xE5\x99\x8C", + "\xE0\xE2" => "\xE5\x99\x94", + "\xE0\xE3" => "\xE5\x9A\x86", + "\xE0\xE4" => "\xE5\x99\xA4", + "\xE0\xE5" => "\xE5\x99\xB1", + "\xE0\xE6" => "\xE5\x99\xAB", + "\xE0\xE7" => "\xE5\x99\xBB", + "\xE0\xE8" => "\xE5\x99\xBC", + "\xE0\xE9" => "\xE5\x9A\x85", + "\xE0\xEA" => "\xE5\x9A\x93", + "\xE0\xEB" => "\xE5\x9A\xAF", + "\xE0\xEC" => "\xE5\x9B\x94", + "\xE0\xED" => "\xE5\x9B\x97", + "\xE0\xEE" => "\xE5\x9B\x9D", + "\xE0\xEF" => "\xE5\x9B\xA1", + "\xE0\xF0" => "\xE5\x9B\xB5", + "\xE0\xF1" => "\xE5\x9B\xAB", + "\xE0\xF2" => "\xE5\x9B\xB9", + "\xE0\xF3" => "\xE5\x9B\xBF", + "\xE0\xF4" => "\xE5\x9C\x84", + "\xE0\xF5" => "\xE5\x9C\x8A", + "\xE0\xF6" => "\xE5\x9C\x89", + "\xE0\xF7" => "\xE5\x9C\x9C", + "\xE0\xF8" => "\xE5\xB8\x8F", + "\xE0\xF9" => "\xE5\xB8\x99", + "\xE0\xFA" => "\xE5\xB8\x94", + "\xE0\xFB" => "\xE5\xB8\x91", + "\xE0\xFC" => "\xE5\xB8\xB1", + "\xE0\xFD" => "\xE5\xB8\xBB", + "\xE0\xFE" => "\xE5\xB8\xBC", + "\xE1\xA1" => "\xE5\xB8\xB7", + "\xE1\xA2" => "\xE5\xB9\x84", + "\xE1\xA3" => "\xE5\xB9\x94", + "\xE1\xA4" => "\xE5\xB9\x9B", + "\xE1\xA5" => "\xE5\xB9\x9E", + "\xE1\xA6" => "\xE5\xB9\xA1", + "\xE1\xA7" => "\xE5\xB2\x8C", + "\xE1\xA8" => "\xE5\xB1\xBA", + "\xE1\xA9" => "\xE5\xB2\x8D", + "\xE1\xAA" => "\xE5\xB2\x90", + "\xE1\xAB" => "\xE5\xB2\x96", + "\xE1\xAC" => "\xE5\xB2\x88", + "\xE1\xAD" => "\xE5\xB2\x98", + "\xE1\xAE" => "\xE5\xB2\x99", + "\xE1\xAF" => "\xE5\xB2\x91", + "\xE1\xB0" => "\xE5\xB2\x9A", + "\xE1\xB1" => "\xE5\xB2\x9C", + "\xE1\xB2" => "\xE5\xB2\xB5", + "\xE1\xB3" => "\xE5\xB2\xA2", + "\xE1\xB4" => "\xE5\xB2\xBD", + "\xE1\xB5" => "\xE5\xB2\xAC", + "\xE1\xB6" => "\xE5\xB2\xAB", + "\xE1\xB7" => "\xE5\xB2\xB1", + "\xE1\xB8" => "\xE5\xB2\xA3", + "\xE1\xB9" => "\xE5\xB3\x81", + "\xE1\xBA" => "\xE5\xB2\xB7", + "\xE1\xBB" => "\xE5\xB3\x84", + "\xE1\xBC" => "\xE5\xB3\x92", + "\xE1\xBD" => "\xE5\xB3\xA4", + "\xE1\xBE" => "\xE5\xB3\x8B", + "\xE1\xBF" => "\xE5\xB3\xA5", + "\xE1\xC0" => "\xE5\xB4\x82", + "\xE1\xC1" => "\xE5\xB4\x83", + "\xE1\xC2" => "\xE5\xB4\xA7", + "\xE1\xC3" => "\xE5\xB4\xA6", + "\xE1\xC4" => "\xE5\xB4\xAE", + "\xE1\xC5" => "\xE5\xB4\xA4", + "\xE1\xC6" => "\xE5\xB4\x9E", + "\xE1\xC7" => "\xE5\xB4\x86", + "\xE1\xC8" => "\xE5\xB4\x9B", + "\xE1\xC9" => "\xE5\xB5\x98", + "\xE1\xCA" => "\xE5\xB4\xBE", + "\xE1\xCB" => "\xE5\xB4\xB4", + "\xE1\xCC" => "\xE5\xB4\xBD", + "\xE1\xCD" => "\xE5\xB5\xAC", + "\xE1\xCE" => "\xE5\xB5\x9B", + "\xE1\xCF" => "\xE5\xB5\xAF", + "\xE1\xD0" => "\xE5\xB5\x9D", + "\xE1\xD1" => "\xE5\xB5\xAB", + "\xE1\xD2" => "\xE5\xB5\x8B", + "\xE1\xD3" => "\xE5\xB5\x8A", + "\xE1\xD4" => "\xE5\xB5\xA9", + "\xE1\xD5" => "\xE5\xB5\xB4", + "\xE1\xD6" => "\xE5\xB6\x82", + "\xE1\xD7" => "\xE5\xB6\x99", + "\xE1\xD8" => "\xE5\xB6\x9D", + "\xE1\xD9" => "\xE8\xB1\xB3", + "\xE1\xDA" => "\xE5\xB6\xB7", + "\xE1\xDB" => "\xE5\xB7\x85", + "\xE1\xDC" => "\xE5\xBD\xB3", + "\xE1\xDD" => "\xE5\xBD\xB7", + "\xE1\xDE" => "\xE5\xBE\x82", + "\xE1\xDF" => "\xE5\xBE\x87", + "\xE1\xE0" => "\xE5\xBE\x89", + "\xE1\xE1" => "\xE5\xBE\x8C", + "\xE1\xE2" => "\xE5\xBE\x95", + "\xE1\xE3" => "\xE5\xBE\x99", + "\xE1\xE4" => "\xE5\xBE\x9C", + "\xE1\xE5" => "\xE5\xBE\xA8", + "\xE1\xE6" => "\xE5\xBE\xAD", + "\xE1\xE7" => "\xE5\xBE\xB5", + "\xE1\xE8" => "\xE5\xBE\xBC", + "\xE1\xE9" => "\xE8\xA1\xA2", + "\xE1\xEA" => "\xE5\xBD\xA1", + "\xE1\xEB" => "\xE7\x8A\xAD", + "\xE1\xEC" => "\xE7\x8A\xB0", + "\xE1\xED" => "\xE7\x8A\xB4", + "\xE1\xEE" => "\xE7\x8A\xB7", + "\xE1\xEF" => "\xE7\x8A\xB8", + "\xE1\xF0" => "\xE7\x8B\x83", + "\xE1\xF1" => "\xE7\x8B\x81", + "\xE1\xF2" => "\xE7\x8B\x8E", + "\xE1\xF3" => "\xE7\x8B\x8D", + "\xE1\xF4" => "\xE7\x8B\x92", + "\xE1\xF5" => "\xE7\x8B\xA8", + "\xE1\xF6" => "\xE7\x8B\xAF", + "\xE1\xF7" => "\xE7\x8B\xA9", + "\xE1\xF8" => "\xE7\x8B\xB2", + "\xE1\xF9" => "\xE7\x8B\xB4", + "\xE1\xFA" => "\xE7\x8B\xB7", + "\xE1\xFB" => "\xE7\x8C\x81", + "\xE1\xFC" => "\xE7\x8B\xB3", + "\xE1\xFD" => "\xE7\x8C\x83", + "\xE1\xFE" => "\xE7\x8B\xBA", + "\xE2\xA1" => "\xE7\x8B\xBB", + "\xE2\xA2" => "\xE7\x8C\x97", + "\xE2\xA3" => "\xE7\x8C\x93", + "\xE2\xA4" => "\xE7\x8C\xA1", + "\xE2\xA5" => "\xE7\x8C\x8A", + "\xE2\xA6" => "\xE7\x8C\x9E", + "\xE2\xA7" => "\xE7\x8C\x9D", + "\xE2\xA8" => "\xE7\x8C\x95", + "\xE2\xA9" => "\xE7\x8C\xA2", + "\xE2\xAA" => "\xE7\x8C\xB9", + "\xE2\xAB" => "\xE7\x8C\xA5", + "\xE2\xAC" => "\xE7\x8C\xAC", + "\xE2\xAD" => "\xE7\x8C\xB8", + "\xE2\xAE" => "\xE7\x8C\xB1", + "\xE2\xAF" => "\xE7\x8D\x90", + "\xE2\xB0" => "\xE7\x8D\x8D", + "\xE2\xB1" => "\xE7\x8D\x97", + "\xE2\xB2" => "\xE7\x8D\xA0", + "\xE2\xB3" => "\xE7\x8D\xAC", + "\xE2\xB4" => "\xE7\x8D\xAF", + "\xE2\xB5" => "\xE7\x8D\xBE", + "\xE2\xB6" => "\xE8\x88\x9B", + "\xE2\xB7" => "\xE5\xA4\xA5", + "\xE2\xB8" => "\xE9\xA3\xA7", + "\xE2\xB9" => "\xE5\xA4\xA4", + "\xE2\xBA" => "\xE5\xA4\x82", + "\xE2\xBB" => "\xE9\xA5\xA3", + "\xE2\xBC" => "\xE9\xA5\xA7", + "\xE2\xBD" => "\xE9\xA5\xA8", + "\xE2\xBE" => "\xE9\xA5\xA9", + "\xE2\xBF" => "\xE9\xA5\xAA", + "\xE2\xC0" => "\xE9\xA5\xAB", + "\xE2\xC1" => "\xE9\xA5\xAC", + "\xE2\xC2" => "\xE9\xA5\xB4", + "\xE2\xC3" => "\xE9\xA5\xB7", + "\xE2\xC4" => "\xE9\xA5\xBD", + "\xE2\xC5" => "\xE9\xA6\x80", + "\xE2\xC6" => "\xE9\xA6\x84", + "\xE2\xC7" => "\xE9\xA6\x87", + "\xE2\xC8" => "\xE9\xA6\x8A", + "\xE2\xC9" => "\xE9\xA6\x8D", + "\xE2\xCA" => "\xE9\xA6\x90", + "\xE2\xCB" => "\xE9\xA6\x91", + "\xE2\xCC" => "\xE9\xA6\x93", + "\xE2\xCD" => "\xE9\xA6\x94", + "\xE2\xCE" => "\xE9\xA6\x95", + "\xE2\xCF" => "\xE5\xBA\x80", + "\xE2\xD0" => "\xE5\xBA\x91", + "\xE2\xD1" => "\xE5\xBA\x8B", + "\xE2\xD2" => "\xE5\xBA\x96", + "\xE2\xD3" => "\xE5\xBA\xA5", + "\xE2\xD4" => "\xE5\xBA\xA0", + "\xE2\xD5" => "\xE5\xBA\xB9", + "\xE2\xD6" => "\xE5\xBA\xB5", + "\xE2\xD7" => "\xE5\xBA\xBE", + "\xE2\xD8" => "\xE5\xBA\xB3", + "\xE2\xD9" => "\xE8\xB5\x93", + "\xE2\xDA" => "\xE5\xBB\x92", + "\xE2\xDB" => "\xE5\xBB\x91", + "\xE2\xDC" => "\xE5\xBB\x9B", + "\xE2\xDD" => "\xE5\xBB\xA8", + "\xE2\xDE" => "\xE5\xBB\xAA", + "\xE2\xDF" => "\xE8\x86\xBA", + "\xE2\xE0" => "\xE5\xBF\x84", + "\xE2\xE1" => "\xE5\xBF\x89", + "\xE2\xE2" => "\xE5\xBF\x96", + "\xE2\xE3" => "\xE5\xBF\x8F", + "\xE2\xE4" => "\xE6\x80\x83", + "\xE2\xE5" => "\xE5\xBF\xAE", + "\xE2\xE6" => "\xE6\x80\x84", + "\xE2\xE7" => "\xE5\xBF\xA1", + "\xE2\xE8" => "\xE5\xBF\xA4", + "\xE2\xE9" => "\xE5\xBF\xBE", + "\xE2\xEA" => "\xE6\x80\x85", + "\xE2\xEB" => "\xE6\x80\x86", + "\xE2\xEC" => "\xE5\xBF\xAA", + "\xE2\xED" => "\xE5\xBF\xAD", + "\xE2\xEE" => "\xE5\xBF\xB8", + "\xE2\xEF" => "\xE6\x80\x99", + "\xE2\xF0" => "\xE6\x80\xB5", + "\xE2\xF1" => "\xE6\x80\xA6", + "\xE2\xF2" => "\xE6\x80\x9B", + "\xE2\xF3" => "\xE6\x80\x8F", + "\xE2\xF4" => "\xE6\x80\x8D", + "\xE2\xF5" => "\xE6\x80\xA9", + "\xE2\xF6" => "\xE6\x80\xAB", + "\xE2\xF7" => "\xE6\x80\x8A", + "\xE2\xF8" => "\xE6\x80\xBF", + "\xE2\xF9" => "\xE6\x80\xA1", + "\xE2\xFA" => "\xE6\x81\xB8", + "\xE2\xFB" => "\xE6\x81\xB9", + "\xE2\xFC" => "\xE6\x81\xBB", + "\xE2\xFD" => "\xE6\x81\xBA", + "\xE2\xFE" => "\xE6\x81\x82", + "\xE3\xA1" => "\xE6\x81\xAA", + "\xE3\xA2" => "\xE6\x81\xBD", + "\xE3\xA3" => "\xE6\x82\x96", + "\xE3\xA4" => "\xE6\x82\x9A", + "\xE3\xA5" => "\xE6\x82\xAD", + "\xE3\xA6" => "\xE6\x82\x9D", + "\xE3\xA7" => "\xE6\x82\x83", + "\xE3\xA8" => "\xE6\x82\x92", + "\xE3\xA9" => "\xE6\x82\x8C", + "\xE3\xAA" => "\xE6\x82\x9B", + "\xE3\xAB" => "\xE6\x83\xAC", + "\xE3\xAC" => "\xE6\x82\xBB", + "\xE3\xAD" => "\xE6\x82\xB1", + "\xE3\xAE" => "\xE6\x83\x9D", + "\xE3\xAF" => "\xE6\x83\x98", + "\xE3\xB0" => "\xE6\x83\x86", + "\xE3\xB1" => "\xE6\x83\x9A", + "\xE3\xB2" => "\xE6\x82\xB4", + "\xE3\xB3" => "\xE6\x84\xA0", + "\xE3\xB4" => "\xE6\x84\xA6", + "\xE3\xB5" => "\xE6\x84\x95", + "\xE3\xB6" => "\xE6\x84\xA3", + "\xE3\xB7" => "\xE6\x83\xB4", + "\xE3\xB8" => "\xE6\x84\x80", + "\xE3\xB9" => "\xE6\x84\x8E", + "\xE3\xBA" => "\xE6\x84\xAB", + "\xE3\xBB" => "\xE6\x85\x8A", + "\xE3\xBC" => "\xE6\x85\xB5", + "\xE3\xBD" => "\xE6\x86\xAC", + "\xE3\xBE" => "\xE6\x86\x94", + "\xE3\xBF" => "\xE6\x86\xA7", + "\xE3\xC0" => "\xE6\x86\xB7", + "\xE3\xC1" => "\xE6\x87\x94", + "\xE3\xC2" => "\xE6\x87\xB5", + "\xE3\xC3" => "\xE5\xBF\x9D", + "\xE3\xC4" => "\xE9\x9A\xB3", + "\xE3\xC5" => "\xE9\x97\xA9", + "\xE3\xC6" => "\xE9\x97\xAB", + "\xE3\xC7" => "\xE9\x97\xB1", + "\xE3\xC8" => "\xE9\x97\xB3", + "\xE3\xC9" => "\xE9\x97\xB5", + "\xE3\xCA" => "\xE9\x97\xB6", + "\xE3\xCB" => "\xE9\x97\xBC", + "\xE3\xCC" => "\xE9\x97\xBE", + "\xE3\xCD" => "\xE9\x98\x83", + "\xE3\xCE" => "\xE9\x98\x84", + "\xE3\xCF" => "\xE9\x98\x86", + "\xE3\xD0" => "\xE9\x98\x88", + "\xE3\xD1" => "\xE9\x98\x8A", + "\xE3\xD2" => "\xE9\x98\x8B", + "\xE3\xD3" => "\xE9\x98\x8C", + "\xE3\xD4" => "\xE9\x98\x8D", + "\xE3\xD5" => "\xE9\x98\x8F", + "\xE3\xD6" => "\xE9\x98\x92", + "\xE3\xD7" => "\xE9\x98\x95", + "\xE3\xD8" => "\xE9\x98\x96", + "\xE3\xD9" => "\xE9\x98\x97", + "\xE3\xDA" => "\xE9\x98\x99", + "\xE3\xDB" => "\xE9\x98\x9A", + "\xE3\xDC" => "\xE4\xB8\xAC", + "\xE3\xDD" => "\xE7\x88\xBF", + "\xE3\xDE" => "\xE6\x88\x95", + "\xE3\xDF" => "\xE6\xB0\xB5", + "\xE3\xE0" => "\xE6\xB1\x94", + "\xE3\xE1" => "\xE6\xB1\x9C", + "\xE3\xE2" => "\xE6\xB1\x8A", + "\xE3\xE3" => "\xE6\xB2\xA3", + "\xE3\xE4" => "\xE6\xB2\x85", + "\xE3\xE5" => "\xE6\xB2\x90", + "\xE3\xE6" => "\xE6\xB2\x94", + "\xE3\xE7" => "\xE6\xB2\x8C", + "\xE3\xE8" => "\xE6\xB1\xA8", + "\xE3\xE9" => "\xE6\xB1\xA9", + "\xE3\xEA" => "\xE6\xB1\xB4", + "\xE3\xEB" => "\xE6\xB1\xB6", + "\xE3\xEC" => "\xE6\xB2\x86", + "\xE3\xED" => "\xE6\xB2\xA9", + "\xE3\xEE" => "\xE6\xB3\x90", + "\xE3\xEF" => "\xE6\xB3\x94", + "\xE3\xF0" => "\xE6\xB2\xAD", + "\xE3\xF1" => "\xE6\xB3\xB7", + "\xE3\xF2" => "\xE6\xB3\xB8", + "\xE3\xF3" => "\xE6\xB3\xB1", + "\xE3\xF4" => "\xE6\xB3\x97", + "\xE3\xF5" => "\xE6\xB2\xB2", + "\xE3\xF6" => "\xE6\xB3\xA0", + "\xE3\xF7" => "\xE6\xB3\x96", + "\xE3\xF8" => "\xE6\xB3\xBA", + "\xE3\xF9" => "\xE6\xB3\xAB", + "\xE3\xFA" => "\xE6\xB3\xAE", + "\xE3\xFB" => "\xE6\xB2\xB1", + "\xE3\xFC" => "\xE6\xB3\x93", + "\xE3\xFD" => "\xE6\xB3\xAF", + "\xE3\xFE" => "\xE6\xB3\xBE", + "\xE4\xA1" => "\xE6\xB4\xB9", + "\xE4\xA2" => "\xE6\xB4\xA7", + "\xE4\xA3" => "\xE6\xB4\x8C", + "\xE4\xA4" => "\xE6\xB5\x83", + "\xE4\xA5" => "\xE6\xB5\x88", + "\xE4\xA6" => "\xE6\xB4\x87", + "\xE4\xA7" => "\xE6\xB4\x84", + "\xE4\xA8" => "\xE6\xB4\x99", + "\xE4\xA9" => "\xE6\xB4\x8E", + "\xE4\xAA" => "\xE6\xB4\xAB", + "\xE4\xAB" => "\xE6\xB5\x8D", + "\xE4\xAC" => "\xE6\xB4\xAE", + "\xE4\xAD" => "\xE6\xB4\xB5", + "\xE4\xAE" => "\xE6\xB4\x9A", + "\xE4\xAF" => "\xE6\xB5\x8F", + "\xE4\xB0" => "\xE6\xB5\x92", + "\xE4\xB1" => "\xE6\xB5\x94", + "\xE4\xB2" => "\xE6\xB4\xB3", + "\xE4\xB3" => "\xE6\xB6\x91", + "\xE4\xB4" => "\xE6\xB5\xAF", + "\xE4\xB5" => "\xE6\xB6\x9E", + "\xE4\xB6" => "\xE6\xB6\xA0", + "\xE4\xB7" => "\xE6\xB5\x9E", + "\xE4\xB8" => "\xE6\xB6\x93", + "\xE4\xB9" => "\xE6\xB6\x94", + "\xE4\xBA" => "\xE6\xB5\x9C", + "\xE4\xBB" => "\xE6\xB5\xA0", + "\xE4\xBC" => "\xE6\xB5\xBC", + "\xE4\xBD" => "\xE6\xB5\xA3", + "\xE4\xBE" => "\xE6\xB8\x9A", + "\xE4\xBF" => "\xE6\xB7\x87", + "\xE4\xC0" => "\xE6\xB7\x85", + "\xE4\xC1" => "\xE6\xB7\x9E", + "\xE4\xC2" => "\xE6\xB8\x8E", + "\xE4\xC3" => "\xE6\xB6\xBF", + "\xE4\xC4" => "\xE6\xB7\xA0", + "\xE4\xC5" => "\xE6\xB8\x91", + "\xE4\xC6" => "\xE6\xB7\xA6", + "\xE4\xC7" => "\xE6\xB7\x9D", + "\xE4\xC8" => "\xE6\xB7\x99", + "\xE4\xC9" => "\xE6\xB8\x96", + "\xE4\xCA" => "\xE6\xB6\xAB", + "\xE4\xCB" => "\xE6\xB8\x8C", + "\xE4\xCC" => "\xE6\xB6\xAE", + "\xE4\xCD" => "\xE6\xB8\xAB", + "\xE4\xCE" => "\xE6\xB9\xAE", + "\xE4\xCF" => "\xE6\xB9\x8E", + "\xE4\xD0" => "\xE6\xB9\xAB", + "\xE4\xD1" => "\xE6\xBA\xB2", + "\xE4\xD2" => "\xE6\xB9\x9F", + "\xE4\xD3" => "\xE6\xBA\x86", + "\xE4\xD4" => "\xE6\xB9\x93", + "\xE4\xD5" => "\xE6\xB9\x94", + "\xE4\xD6" => "\xE6\xB8\xB2", + "\xE4\xD7" => "\xE6\xB8\xA5", + "\xE4\xD8" => "\xE6\xB9\x84", + "\xE4\xD9" => "\xE6\xBB\x9F", + "\xE4\xDA" => "\xE6\xBA\xB1", + "\xE4\xDB" => "\xE6\xBA\x98", + "\xE4\xDC" => "\xE6\xBB\xA0", + "\xE4\xDD" => "\xE6\xBC\xAD", + "\xE4\xDE" => "\xE6\xBB\xA2", + "\xE4\xDF" => "\xE6\xBA\xA5", + "\xE4\xE0" => "\xE6\xBA\xA7", + "\xE4\xE1" => "\xE6\xBA\xBD", + "\xE4\xE2" => "\xE6\xBA\xBB", + "\xE4\xE3" => "\xE6\xBA\xB7", + "\xE4\xE4" => "\xE6\xBB\x97", + "\xE4\xE5" => "\xE6\xBA\xB4", + "\xE4\xE6" => "\xE6\xBB\x8F", + "\xE4\xE7" => "\xE6\xBA\x8F", + "\xE4\xE8" => "\xE6\xBB\x82", + "\xE4\xE9" => "\xE6\xBA\x9F", + "\xE4\xEA" => "\xE6\xBD\xA2", + "\xE4\xEB" => "\xE6\xBD\x86", + "\xE4\xEC" => "\xE6\xBD\x87", + "\xE4\xED" => "\xE6\xBC\xA4", + "\xE4\xEE" => "\xE6\xBC\x95", + "\xE4\xEF" => "\xE6\xBB\xB9", + "\xE4\xF0" => "\xE6\xBC\xAF", + "\xE4\xF1" => "\xE6\xBC\xB6", + "\xE4\xF2" => "\xE6\xBD\x8B", + "\xE4\xF3" => "\xE6\xBD\xB4", + "\xE4\xF4" => "\xE6\xBC\xAA", + "\xE4\xF5" => "\xE6\xBC\x89", + "\xE4\xF6" => "\xE6\xBC\xA9", + "\xE4\xF7" => "\xE6\xBE\x89", + "\xE4\xF8" => "\xE6\xBE\x8D", + "\xE4\xF9" => "\xE6\xBE\x8C", + "\xE4\xFA" => "\xE6\xBD\xB8", + "\xE4\xFB" => "\xE6\xBD\xB2", + "\xE4\xFC" => "\xE6\xBD\xBC", + "\xE4\xFD" => "\xE6\xBD\xBA", + "\xE4\xFE" => "\xE6\xBF\x91", + "\xE5\xA1" => "\xE6\xBF\x89", + "\xE5\xA2" => "\xE6\xBE\xA7", + "\xE5\xA3" => "\xE6\xBE\xB9", + "\xE5\xA4" => "\xE6\xBE\xB6", + "\xE5\xA5" => "\xE6\xBF\x82", + "\xE5\xA6" => "\xE6\xBF\xA1", + "\xE5\xA7" => "\xE6\xBF\xAE", + "\xE5\xA8" => "\xE6\xBF\x9E", + "\xE5\xA9" => "\xE6\xBF\xA0", + "\xE5\xAA" => "\xE6\xBF\xAF", + "\xE5\xAB" => "\xE7\x80\x9A", + "\xE5\xAC" => "\xE7\x80\xA3", + "\xE5\xAD" => "\xE7\x80\x9B", + "\xE5\xAE" => "\xE7\x80\xB9", + "\xE5\xAF" => "\xE7\x80\xB5", + "\xE5\xB0" => "\xE7\x81\x8F", + "\xE5\xB1" => "\xE7\x81\x9E", + "\xE5\xB2" => "\xE5\xAE\x80", + "\xE5\xB3" => "\xE5\xAE\x84", + "\xE5\xB4" => "\xE5\xAE\x95", + "\xE5\xB5" => "\xE5\xAE\x93", + "\xE5\xB6" => "\xE5\xAE\xA5", + "\xE5\xB7" => "\xE5\xAE\xB8", + "\xE5\xB8" => "\xE7\x94\xAF", + "\xE5\xB9" => "\xE9\xAA\x9E", + "\xE5\xBA" => "\xE6\x90\xB4", + "\xE5\xBB" => "\xE5\xAF\xA4", + "\xE5\xBC" => "\xE5\xAF\xAE", + "\xE5\xBD" => "\xE8\xA4\xB0", + "\xE5\xBE" => "\xE5\xAF\xB0", + "\xE5\xBF" => "\xE8\xB9\x87", + "\xE5\xC0" => "\xE8\xAC\x87", + "\xE5\xC1" => "\xE8\xBE\xB6", + "\xE5\xC2" => "\xE8\xBF\x93", + "\xE5\xC3" => "\xE8\xBF\x95", + "\xE5\xC4" => "\xE8\xBF\xA5", + "\xE5\xC5" => "\xE8\xBF\xAE", + "\xE5\xC6" => "\xE8\xBF\xA4", + "\xE5\xC7" => "\xE8\xBF\xA9", + "\xE5\xC8" => "\xE8\xBF\xA6", + "\xE5\xC9" => "\xE8\xBF\xB3", + "\xE5\xCA" => "\xE8\xBF\xA8", + "\xE5\xCB" => "\xE9\x80\x85", + "\xE5\xCC" => "\xE9\x80\x84", + "\xE5\xCD" => "\xE9\x80\x8B", + "\xE5\xCE" => "\xE9\x80\xA6", + "\xE5\xCF" => "\xE9\x80\x91", + "\xE5\xD0" => "\xE9\x80\x8D", + "\xE5\xD1" => "\xE9\x80\x96", + "\xE5\xD2" => "\xE9\x80\xA1", + "\xE5\xD3" => "\xE9\x80\xB5", + "\xE5\xD4" => "\xE9\x80\xB6", + "\xE5\xD5" => "\xE9\x80\xAD", + "\xE5\xD6" => "\xE9\x80\xAF", + "\xE5\xD7" => "\xE9\x81\x84", + "\xE5\xD8" => "\xE9\x81\x91", + "\xE5\xD9" => "\xE9\x81\x92", + "\xE5\xDA" => "\xE9\x81\x90", + "\xE5\xDB" => "\xE9\x81\xA8", + "\xE5\xDC" => "\xE9\x81\x98", + "\xE5\xDD" => "\xE9\x81\xA2", + "\xE5\xDE" => "\xE9\x81\x9B", + "\xE5\xDF" => "\xE6\x9A\xB9", + "\xE5\xE0" => "\xE9\x81\xB4", + "\xE5\xE1" => "\xE9\x81\xBD", + "\xE5\xE2" => "\xE9\x82\x82", + "\xE5\xE3" => "\xE9\x82\x88", + "\xE5\xE4" => "\xE9\x82\x83", + "\xE5\xE5" => "\xE9\x82\x8B", + "\xE5\xE6" => "\xE5\xBD\x90", + "\xE5\xE7" => "\xE5\xBD\x97", + "\xE5\xE8" => "\xE5\xBD\x96", + "\xE5\xE9" => "\xE5\xBD\x98", + "\xE5\xEA" => "\xE5\xB0\xBB", + "\xE5\xEB" => "\xE5\x92\xAB", + "\xE5\xEC" => "\xE5\xB1\x90", + "\xE5\xED" => "\xE5\xB1\x99", + "\xE5\xEE" => "\xE5\xAD\xB1", + "\xE5\xEF" => "\xE5\xB1\xA3", + "\xE5\xF0" => "\xE5\xB1\xA6", + "\xE5\xF1" => "\xE7\xBE\xBC", + "\xE5\xF2" => "\xE5\xBC\xAA", + "\xE5\xF3" => "\xE5\xBC\xA9", + "\xE5\xF4" => "\xE5\xBC\xAD", + "\xE5\xF5" => "\xE8\x89\xB4", + "\xE5\xF6" => "\xE5\xBC\xBC", + "\xE5\xF7" => "\xE9\xAC\xBB", + "\xE5\xF8" => "\xE5\xB1\xAE", + "\xE5\xF9" => "\xE5\xA6\x81", + "\xE5\xFA" => "\xE5\xA6\x83", + "\xE5\xFB" => "\xE5\xA6\x8D", + "\xE5\xFC" => "\xE5\xA6\xA9", + "\xE5\xFD" => "\xE5\xA6\xAA", + "\xE5\xFE" => "\xE5\xA6\xA3", + "\xE6\xA1" => "\xE5\xA6\x97", + "\xE6\xA2" => "\xE5\xA7\x8A", + "\xE6\xA3" => "\xE5\xA6\xAB", + "\xE6\xA4" => "\xE5\xA6\x9E", + "\xE6\xA5" => "\xE5\xA6\xA4", + "\xE6\xA6" => "\xE5\xA7\x92", + "\xE6\xA7" => "\xE5\xA6\xB2", + "\xE6\xA8" => "\xE5\xA6\xAF", + "\xE6\xA9" => "\xE5\xA7\x97", + "\xE6\xAA" => "\xE5\xA6\xBE", + "\xE6\xAB" => "\xE5\xA8\x85", + "\xE6\xAC" => "\xE5\xA8\x86", + "\xE6\xAD" => "\xE5\xA7\x9D", + "\xE6\xAE" => "\xE5\xA8\x88", + "\xE6\xAF" => "\xE5\xA7\xA3", + "\xE6\xB0" => "\xE5\xA7\x98", + "\xE6\xB1" => "\xE5\xA7\xB9", + "\xE6\xB2" => "\xE5\xA8\x8C", + "\xE6\xB3" => "\xE5\xA8\x89", + "\xE6\xB4" => "\xE5\xA8\xB2", + "\xE6\xB5" => "\xE5\xA8\xB4", + "\xE6\xB6" => "\xE5\xA8\x91", + "\xE6\xB7" => "\xE5\xA8\xA3", + "\xE6\xB8" => "\xE5\xA8\x93", + "\xE6\xB9" => "\xE5\xA9\x80", + "\xE6\xBA" => "\xE5\xA9\xA7", + "\xE6\xBB" => "\xE5\xA9\x8A", + "\xE6\xBC" => "\xE5\xA9\x95", + "\xE6\xBD" => "\xE5\xA8\xBC", + "\xE6\xBE" => "\xE5\xA9\xA2", + "\xE6\xBF" => "\xE5\xA9\xB5", + "\xE6\xC0" => "\xE8\x83\xAC", + "\xE6\xC1" => "\xE5\xAA\xAA", + "\xE6\xC2" => "\xE5\xAA\x9B", + "\xE6\xC3" => "\xE5\xA9\xB7", + "\xE6\xC4" => "\xE5\xA9\xBA", + "\xE6\xC5" => "\xE5\xAA\xBE", + "\xE6\xC6" => "\xE5\xAB\xAB", + "\xE6\xC7" => "\xE5\xAA\xB2", + "\xE6\xC8" => "\xE5\xAB\x92", + "\xE6\xC9" => "\xE5\xAB\x94", + "\xE6\xCA" => "\xE5\xAA\xB8", + "\xE6\xCB" => "\xE5\xAB\xA0", + "\xE6\xCC" => "\xE5\xAB\xA3", + "\xE6\xCD" => "\xE5\xAB\xB1", + "\xE6\xCE" => "\xE5\xAB\x96", + "\xE6\xCF" => "\xE5\xAB\xA6", + "\xE6\xD0" => "\xE5\xAB\x98", + "\xE6\xD1" => "\xE5\xAB\x9C", + "\xE6\xD2" => "\xE5\xAC\x89", + "\xE6\xD3" => "\xE5\xAC\x97", + "\xE6\xD4" => "\xE5\xAC\x96", + "\xE6\xD5" => "\xE5\xAC\xB2", + "\xE6\xD6" => "\xE5\xAC\xB7", + "\xE6\xD7" => "\xE5\xAD\x80", + "\xE6\xD8" => "\xE5\xB0\x95", + "\xE6\xD9" => "\xE5\xB0\x9C", + "\xE6\xDA" => "\xE5\xAD\x9A", + "\xE6\xDB" => "\xE5\xAD\xA5", + "\xE6\xDC" => "\xE5\xAD\xB3", + "\xE6\xDD" => "\xE5\xAD\x91", + "\xE6\xDE" => "\xE5\xAD\x93", + "\xE6\xDF" => "\xE5\xAD\xA2", + "\xE6\xE0" => "\xE9\xA9\xB5", + "\xE6\xE1" => "\xE9\xA9\xB7", + "\xE6\xE2" => "\xE9\xA9\xB8", + "\xE6\xE3" => "\xE9\xA9\xBA", + "\xE6\xE4" => "\xE9\xA9\xBF", + "\xE6\xE5" => "\xE9\xA9\xBD", + "\xE6\xE6" => "\xE9\xAA\x80", + "\xE6\xE7" => "\xE9\xAA\x81", + "\xE6\xE8" => "\xE9\xAA\x85", + "\xE6\xE9" => "\xE9\xAA\x88", + "\xE6\xEA" => "\xE9\xAA\x8A", + "\xE6\xEB" => "\xE9\xAA\x90", + "\xE6\xEC" => "\xE9\xAA\x92", + "\xE6\xED" => "\xE9\xAA\x93", + "\xE6\xEE" => "\xE9\xAA\x96", + "\xE6\xEF" => "\xE9\xAA\x98", + "\xE6\xF0" => "\xE9\xAA\x9B", + "\xE6\xF1" => "\xE9\xAA\x9C", + "\xE6\xF2" => "\xE9\xAA\x9D", + "\xE6\xF3" => "\xE9\xAA\x9F", + "\xE6\xF4" => "\xE9\xAA\xA0", + "\xE6\xF5" => "\xE9\xAA\xA2", + "\xE6\xF6" => "\xE9\xAA\xA3", + "\xE6\xF7" => "\xE9\xAA\xA5", + "\xE6\xF8" => "\xE9\xAA\xA7", + "\xE6\xF9" => "\xE7\xBA\x9F", + "\xE6\xFA" => "\xE7\xBA\xA1", + "\xE6\xFB" => "\xE7\xBA\xA3", + "\xE6\xFC" => "\xE7\xBA\xA5", + "\xE6\xFD" => "\xE7\xBA\xA8", + "\xE6\xFE" => "\xE7\xBA\xA9", + "\xE7\xA1" => "\xE7\xBA\xAD", + "\xE7\xA2" => "\xE7\xBA\xB0", + "\xE7\xA3" => "\xE7\xBA\xBE", + "\xE7\xA4" => "\xE7\xBB\x80", + "\xE7\xA5" => "\xE7\xBB\x81", + "\xE7\xA6" => "\xE7\xBB\x82", + "\xE7\xA7" => "\xE7\xBB\x89", + "\xE7\xA8" => "\xE7\xBB\x8B", + "\xE7\xA9" => "\xE7\xBB\x8C", + "\xE7\xAA" => "\xE7\xBB\x90", + "\xE7\xAB" => "\xE7\xBB\x94", + "\xE7\xAC" => "\xE7\xBB\x97", + "\xE7\xAD" => "\xE7\xBB\x9B", + "\xE7\xAE" => "\xE7\xBB\xA0", + "\xE7\xAF" => "\xE7\xBB\xA1", + "\xE7\xB0" => "\xE7\xBB\xA8", + "\xE7\xB1" => "\xE7\xBB\xAB", + "\xE7\xB2" => "\xE7\xBB\xAE", + "\xE7\xB3" => "\xE7\xBB\xAF", + "\xE7\xB4" => "\xE7\xBB\xB1", + "\xE7\xB5" => "\xE7\xBB\xB2", + "\xE7\xB6" => "\xE7\xBC\x8D", + "\xE7\xB7" => "\xE7\xBB\xB6", + "\xE7\xB8" => "\xE7\xBB\xBA", + "\xE7\xB9" => "\xE7\xBB\xBB", + "\xE7\xBA" => "\xE7\xBB\xBE", + "\xE7\xBB" => "\xE7\xBC\x81", + "\xE7\xBC" => "\xE7\xBC\x82", + "\xE7\xBD" => "\xE7\xBC\x83", + "\xE7\xBE" => "\xE7\xBC\x87", + "\xE7\xBF" => "\xE7\xBC\x88", + "\xE7\xC0" => "\xE7\xBC\x8B", + "\xE7\xC1" => "\xE7\xBC\x8C", + "\xE7\xC2" => "\xE7\xBC\x8F", + "\xE7\xC3" => "\xE7\xBC\x91", + "\xE7\xC4" => "\xE7\xBC\x92", + "\xE7\xC5" => "\xE7\xBC\x97", + "\xE7\xC6" => "\xE7\xBC\x99", + "\xE7\xC7" => "\xE7\xBC\x9C", + "\xE7\xC8" => "\xE7\xBC\x9B", + "\xE7\xC9" => "\xE7\xBC\x9F", + "\xE7\xCA" => "\xE7\xBC\xA1", + "\xE7\xCB" => "\xE7\xBC\xA2", + "\xE7\xCC" => "\xE7\xBC\xA3", + "\xE7\xCD" => "\xE7\xBC\xA4", + "\xE7\xCE" => "\xE7\xBC\xA5", + "\xE7\xCF" => "\xE7\xBC\xA6", + "\xE7\xD0" => "\xE7\xBC\xA7", + "\xE7\xD1" => "\xE7\xBC\xAA", + "\xE7\xD2" => "\xE7\xBC\xAB", + "\xE7\xD3" => "\xE7\xBC\xAC", + "\xE7\xD4" => "\xE7\xBC\xAD", + "\xE7\xD5" => "\xE7\xBC\xAF", + "\xE7\xD6" => "\xE7\xBC\xB0", + "\xE7\xD7" => "\xE7\xBC\xB1", + "\xE7\xD8" => "\xE7\xBC\xB2", + "\xE7\xD9" => "\xE7\xBC\xB3", + "\xE7\xDA" => "\xE7\xBC\xB5", + "\xE7\xDB" => "\xE5\xB9\xBA", + "\xE7\xDC" => "\xE7\x95\xBF", + "\xE7\xDD" => "\xE5\xB7\x9B", + "\xE7\xDE" => "\xE7\x94\xBE", + "\xE7\xDF" => "\xE9\x82\x95", + "\xE7\xE0" => "\xE7\x8E\x8E", + "\xE7\xE1" => "\xE7\x8E\x91", + "\xE7\xE2" => "\xE7\x8E\xAE", + "\xE7\xE3" => "\xE7\x8E\xA2", + "\xE7\xE4" => "\xE7\x8E\x9F", + "\xE7\xE5" => "\xE7\x8F\x8F", + "\xE7\xE6" => "\xE7\x8F\x82", + "\xE7\xE7" => "\xE7\x8F\x91", + "\xE7\xE8" => "\xE7\x8E\xB7", + "\xE7\xE9" => "\xE7\x8E\xB3", + "\xE7\xEA" => "\xE7\x8F\x80", + "\xE7\xEB" => "\xE7\x8F\x89", + "\xE7\xEC" => "\xE7\x8F\x88", + "\xE7\xED" => "\xE7\x8F\xA5", + "\xE7\xEE" => "\xE7\x8F\x99", + "\xE7\xEF" => "\xE9\xA1\xBC", + "\xE7\xF0" => "\xE7\x90\x8A", + "\xE7\xF1" => "\xE7\x8F\xA9", + "\xE7\xF2" => "\xE7\x8F\xA7", + "\xE7\xF3" => "\xE7\x8F\x9E", + "\xE7\xF4" => "\xE7\x8E\xBA", + "\xE7\xF5" => "\xE7\x8F\xB2", + "\xE7\xF6" => "\xE7\x90\x8F", + "\xE7\xF7" => "\xE7\x90\xAA", + "\xE7\xF8" => "\xE7\x91\x9B", + "\xE7\xF9" => "\xE7\x90\xA6", + "\xE7\xFA" => "\xE7\x90\xA5", + "\xE7\xFB" => "\xE7\x90\xA8", + "\xE7\xFC" => "\xE7\x90\xB0", + "\xE7\xFD" => "\xE7\x90\xAE", + "\xE7\xFE" => "\xE7\x90\xAC", + "\xE8\xA1" => "\xE7\x90\x9B", + "\xE8\xA2" => "\xE7\x90\x9A", + "\xE8\xA3" => "\xE7\x91\x81", + "\xE8\xA4" => "\xE7\x91\x9C", + "\xE8\xA5" => "\xE7\x91\x97", + "\xE8\xA6" => "\xE7\x91\x95", + "\xE8\xA7" => "\xE7\x91\x99", + "\xE8\xA8" => "\xE7\x91\xB7", + "\xE8\xA9" => "\xE7\x91\xAD", + "\xE8\xAA" => "\xE7\x91\xBE", + "\xE8\xAB" => "\xE7\x92\x9C", + "\xE8\xAC" => "\xE7\x92\x8E", + "\xE8\xAD" => "\xE7\x92\x80", + "\xE8\xAE" => "\xE7\x92\x81", + "\xE8\xAF" => "\xE7\x92\x87", + "\xE8\xB0" => "\xE7\x92\x8B", + "\xE8\xB1" => "\xE7\x92\x9E", + "\xE8\xB2" => "\xE7\x92\xA8", + "\xE8\xB3" => "\xE7\x92\xA9", + "\xE8\xB4" => "\xE7\x92\x90", + "\xE8\xB5" => "\xE7\x92\xA7", + "\xE8\xB6" => "\xE7\x93\x92", + "\xE8\xB7" => "\xE7\x92\xBA", + "\xE8\xB8" => "\xE9\x9F\xAA", + "\xE8\xB9" => "\xE9\x9F\xAB", + "\xE8\xBA" => "\xE9\x9F\xAC", + "\xE8\xBB" => "\xE6\x9D\x8C", + "\xE8\xBC" => "\xE6\x9D\x93", + "\xE8\xBD" => "\xE6\x9D\x9E", + "\xE8\xBE" => "\xE6\x9D\x88", + "\xE8\xBF" => "\xE6\x9D\xA9", + "\xE8\xC0" => "\xE6\x9E\xA5", + "\xE8\xC1" => "\xE6\x9E\x87", + "\xE8\xC2" => "\xE6\x9D\xAA", + "\xE8\xC3" => "\xE6\x9D\xB3", + "\xE8\xC4" => "\xE6\x9E\x98", + "\xE8\xC5" => "\xE6\x9E\xA7", + "\xE8\xC6" => "\xE6\x9D\xB5", + "\xE8\xC7" => "\xE6\x9E\xA8", + "\xE8\xC8" => "\xE6\x9E\x9E", + "\xE8\xC9" => "\xE6\x9E\xAD", + "\xE8\xCA" => "\xE6\x9E\x8B", + "\xE8\xCB" => "\xE6\x9D\xB7", + "\xE8\xCC" => "\xE6\x9D\xBC", + "\xE8\xCD" => "\xE6\x9F\xB0", + "\xE8\xCE" => "\xE6\xA0\x89", + "\xE8\xCF" => "\xE6\x9F\x98", + "\xE8\xD0" => "\xE6\xA0\x8A", + "\xE8\xD1" => "\xE6\x9F\xA9", + "\xE8\xD2" => "\xE6\x9E\xB0", + "\xE8\xD3" => "\xE6\xA0\x8C", + "\xE8\xD4" => "\xE6\x9F\x99", + "\xE8\xD5" => "\xE6\x9E\xB5", + "\xE8\xD6" => "\xE6\x9F\x9A", + "\xE8\xD7" => "\xE6\x9E\xB3", + "\xE8\xD8" => "\xE6\x9F\x9D", + "\xE8\xD9" => "\xE6\xA0\x80", + "\xE8\xDA" => "\xE6\x9F\x83", + "\xE8\xDB" => "\xE6\x9E\xB8", + "\xE8\xDC" => "\xE6\x9F\xA2", + "\xE8\xDD" => "\xE6\xA0\x8E", + "\xE8\xDE" => "\xE6\x9F\x81", + "\xE8\xDF" => "\xE6\x9F\xBD", + "\xE8\xE0" => "\xE6\xA0\xB2", + "\xE8\xE1" => "\xE6\xA0\xB3", + "\xE8\xE2" => "\xE6\xA1\xA0", + "\xE8\xE3" => "\xE6\xA1\xA1", + "\xE8\xE4" => "\xE6\xA1\x8E", + "\xE8\xE5" => "\xE6\xA1\xA2", + "\xE8\xE6" => "\xE6\xA1\x84", + "\xE8\xE7" => "\xE6\xA1\xA4", + "\xE8\xE8" => "\xE6\xA2\x83", + "\xE8\xE9" => "\xE6\xA0\x9D", + "\xE8\xEA" => "\xE6\xA1\x95", + "\xE8\xEB" => "\xE6\xA1\xA6", + "\xE8\xEC" => "\xE6\xA1\x81", + "\xE8\xED" => "\xE6\xA1\xA7", + "\xE8\xEE" => "\xE6\xA1\x80", + "\xE8\xEF" => "\xE6\xA0\xBE", + "\xE8\xF0" => "\xE6\xA1\x8A", + "\xE8\xF1" => "\xE6\xA1\x89", + "\xE8\xF2" => "\xE6\xA0\xA9", + "\xE8\xF3" => "\xE6\xA2\xB5", + "\xE8\xF4" => "\xE6\xA2\x8F", + "\xE8\xF5" => "\xE6\xA1\xB4", + "\xE8\xF6" => "\xE6\xA1\xB7", + "\xE8\xF7" => "\xE6\xA2\x93", + "\xE8\xF8" => "\xE6\xA1\xAB", + "\xE8\xF9" => "\xE6\xA3\x82", + "\xE8\xFA" => "\xE6\xA5\xAE", + "\xE8\xFB" => "\xE6\xA3\xBC", + "\xE8\xFC" => "\xE6\xA4\x9F", + "\xE8\xFD" => "\xE6\xA4\xA0", + "\xE8\xFE" => "\xE6\xA3\xB9", + "\xE9\xA1" => "\xE6\xA4\xA4", + "\xE9\xA2" => "\xE6\xA3\xB0", + "\xE9\xA3" => "\xE6\xA4\x8B", + "\xE9\xA4" => "\xE6\xA4\x81", + "\xE9\xA5" => "\xE6\xA5\x97", + "\xE9\xA6" => "\xE6\xA3\xA3", + "\xE9\xA7" => "\xE6\xA4\x90", + "\xE9\xA8" => "\xE6\xA5\xB1", + "\xE9\xA9" => "\xE6\xA4\xB9", + "\xE9\xAA" => "\xE6\xA5\xA0", + "\xE9\xAB" => "\xE6\xA5\x82", + "\xE9\xAC" => "\xE6\xA5\x9D", + "\xE9\xAD" => "\xE6\xA6\x84", + "\xE9\xAE" => "\xE6\xA5\xAB", + "\xE9\xAF" => "\xE6\xA6\x80", + "\xE9\xB0" => "\xE6\xA6\x98", + "\xE9\xB1" => "\xE6\xA5\xB8", + "\xE9\xB2" => "\xE6\xA4\xB4", + "\xE9\xB3" => "\xE6\xA7\x8C", + "\xE9\xB4" => "\xE6\xA6\x87", + "\xE9\xB5" => "\xE6\xA6\x88", + "\xE9\xB6" => "\xE6\xA7\x8E", + "\xE9\xB7" => "\xE6\xA6\x89", + "\xE9\xB8" => "\xE6\xA5\xA6", + "\xE9\xB9" => "\xE6\xA5\xA3", + "\xE9\xBA" => "\xE6\xA5\xB9", + "\xE9\xBB" => "\xE6\xA6\x9B", + "\xE9\xBC" => "\xE6\xA6\xA7", + "\xE9\xBD" => "\xE6\xA6\xBB", + "\xE9\xBE" => "\xE6\xA6\xAB", + "\xE9\xBF" => "\xE6\xA6\xAD", + "\xE9\xC0" => "\xE6\xA7\x94", + "\xE9\xC1" => "\xE6\xA6\xB1", + "\xE9\xC2" => "\xE6\xA7\x81", + "\xE9\xC3" => "\xE6\xA7\x8A", + "\xE9\xC4" => "\xE6\xA7\x9F", + "\xE9\xC5" => "\xE6\xA6\x95", + "\xE9\xC6" => "\xE6\xA7\xA0", + "\xE9\xC7" => "\xE6\xA6\x8D", + "\xE9\xC8" => "\xE6\xA7\xBF", + "\xE9\xC9" => "\xE6\xA8\xAF", + "\xE9\xCA" => "\xE6\xA7\xAD", + "\xE9\xCB" => "\xE6\xA8\x97", + "\xE9\xCC" => "\xE6\xA8\x98", + "\xE9\xCD" => "\xE6\xA9\xA5", + "\xE9\xCE" => "\xE6\xA7\xB2", + "\xE9\xCF" => "\xE6\xA9\x84", + "\xE9\xD0" => "\xE6\xA8\xBE", + "\xE9\xD1" => "\xE6\xAA\xA0", + "\xE9\xD2" => "\xE6\xA9\x90", + "\xE9\xD3" => "\xE6\xA9\x9B", + "\xE9\xD4" => "\xE6\xA8\xB5", + "\xE9\xD5" => "\xE6\xAA\x8E", + "\xE9\xD6" => "\xE6\xA9\xB9", + "\xE9\xD7" => "\xE6\xA8\xBD", + "\xE9\xD8" => "\xE6\xA8\xA8", + "\xE9\xD9" => "\xE6\xA9\x98", + "\xE9\xDA" => "\xE6\xA9\xBC", + "\xE9\xDB" => "\xE6\xAA\x91", + "\xE9\xDC" => "\xE6\xAA\x90", + "\xE9\xDD" => "\xE6\xAA\xA9", + "\xE9\xDE" => "\xE6\xAA\x97", + "\xE9\xDF" => "\xE6\xAA\xAB", + "\xE9\xE0" => "\xE7\x8C\xB7", + "\xE9\xE1" => "\xE7\x8D\x92", + "\xE9\xE2" => "\xE6\xAE\x81", + "\xE9\xE3" => "\xE6\xAE\x82", + "\xE9\xE4" => "\xE6\xAE\x87", + "\xE9\xE5" => "\xE6\xAE\x84", + "\xE9\xE6" => "\xE6\xAE\x92", + "\xE9\xE7" => "\xE6\xAE\x93", + "\xE9\xE8" => "\xE6\xAE\x8D", + "\xE9\xE9" => "\xE6\xAE\x9A", + "\xE9\xEA" => "\xE6\xAE\x9B", + "\xE9\xEB" => "\xE6\xAE\xA1", + "\xE9\xEC" => "\xE6\xAE\xAA", + "\xE9\xED" => "\xE8\xBD\xAB", + "\xE9\xEE" => "\xE8\xBD\xAD", + "\xE9\xEF" => "\xE8\xBD\xB1", + "\xE9\xF0" => "\xE8\xBD\xB2", + "\xE9\xF1" => "\xE8\xBD\xB3", + "\xE9\xF2" => "\xE8\xBD\xB5", + "\xE9\xF3" => "\xE8\xBD\xB6", + "\xE9\xF4" => "\xE8\xBD\xB8", + "\xE9\xF5" => "\xE8\xBD\xB7", + "\xE9\xF6" => "\xE8\xBD\xB9", + "\xE9\xF7" => "\xE8\xBD\xBA", + "\xE9\xF8" => "\xE8\xBD\xBC", + "\xE9\xF9" => "\xE8\xBD\xBE", + "\xE9\xFA" => "\xE8\xBE\x81", + "\xE9\xFB" => "\xE8\xBE\x82", + "\xE9\xFC" => "\xE8\xBE\x84", + "\xE9\xFD" => "\xE8\xBE\x87", + "\xE9\xFE" => "\xE8\xBE\x8B", + "\xEA\xA1" => "\xE8\xBE\x8D", + "\xEA\xA2" => "\xE8\xBE\x8E", + "\xEA\xA3" => "\xE8\xBE\x8F", + "\xEA\xA4" => "\xE8\xBE\x98", + "\xEA\xA5" => "\xE8\xBE\x9A", + "\xEA\xA6" => "\xE8\xBB\x8E", + "\xEA\xA7" => "\xE6\x88\x8B", + "\xEA\xA8" => "\xE6\x88\x97", + "\xEA\xA9" => "\xE6\x88\x9B", + "\xEA\xAA" => "\xE6\x88\x9F", + "\xEA\xAB" => "\xE6\x88\xA2", + "\xEA\xAC" => "\xE6\x88\xA1", + "\xEA\xAD" => "\xE6\x88\xA5", + "\xEA\xAE" => "\xE6\x88\xA4", + "\xEA\xAF" => "\xE6\x88\xAC", + "\xEA\xB0" => "\xE8\x87\xA7", + "\xEA\xB1" => "\xE7\x93\xAF", + "\xEA\xB2" => "\xE7\x93\xB4", + "\xEA\xB3" => "\xE7\x93\xBF", + "\xEA\xB4" => "\xE7\x94\x8F", + "\xEA\xB5" => "\xE7\x94\x91", + "\xEA\xB6" => "\xE7\x94\x93", + "\xEA\xB7" => "\xE6\x94\xB4", + "\xEA\xB8" => "\xE6\x97\xAE", + "\xEA\xB9" => "\xE6\x97\xAF", + "\xEA\xBA" => "\xE6\x97\xB0", + "\xEA\xBB" => "\xE6\x98\x8A", + "\xEA\xBC" => "\xE6\x98\x99", + "\xEA\xBD" => "\xE6\x9D\xB2", + "\xEA\xBE" => "\xE6\x98\x83", + "\xEA\xBF" => "\xE6\x98\x95", + "\xEA\xC0" => "\xE6\x98\x80", + "\xEA\xC1" => "\xE7\x82\x85", + "\xEA\xC2" => "\xE6\x9B\xB7", + "\xEA\xC3" => "\xE6\x98\x9D", + "\xEA\xC4" => "\xE6\x98\xB4", + "\xEA\xC5" => "\xE6\x98\xB1", + "\xEA\xC6" => "\xE6\x98\xB6", + "\xEA\xC7" => "\xE6\x98\xB5", + "\xEA\xC8" => "\xE8\x80\x86", + "\xEA\xC9" => "\xE6\x99\x9F", + "\xEA\xCA" => "\xE6\x99\x94", + "\xEA\xCB" => "\xE6\x99\x81", + "\xEA\xCC" => "\xE6\x99\x8F", + "\xEA\xCD" => "\xE6\x99\x96", + "\xEA\xCE" => "\xE6\x99\xA1", + "\xEA\xCF" => "\xE6\x99\x97", + "\xEA\xD0" => "\xE6\x99\xB7", + "\xEA\xD1" => "\xE6\x9A\x84", + "\xEA\xD2" => "\xE6\x9A\x8C", + "\xEA\xD3" => "\xE6\x9A\xA7", + "\xEA\xD4" => "\xE6\x9A\x9D", + "\xEA\xD5" => "\xE6\x9A\xBE", + "\xEA\xD6" => "\xE6\x9B\x9B", + "\xEA\xD7" => "\xE6\x9B\x9C", + "\xEA\xD8" => "\xE6\x9B\xA6", + "\xEA\xD9" => "\xE6\x9B\xA9", + "\xEA\xDA" => "\xE8\xB4\xB2", + "\xEA\xDB" => "\xE8\xB4\xB3", + "\xEA\xDC" => "\xE8\xB4\xB6", + "\xEA\xDD" => "\xE8\xB4\xBB", + "\xEA\xDE" => "\xE8\xB4\xBD", + "\xEA\xDF" => "\xE8\xB5\x80", + "\xEA\xE0" => "\xE8\xB5\x85", + "\xEA\xE1" => "\xE8\xB5\x86", + "\xEA\xE2" => "\xE8\xB5\x88", + "\xEA\xE3" => "\xE8\xB5\x89", + "\xEA\xE4" => "\xE8\xB5\x87", + "\xEA\xE5" => "\xE8\xB5\x8D", + "\xEA\xE6" => "\xE8\xB5\x95", + "\xEA\xE7" => "\xE8\xB5\x99", + "\xEA\xE8" => "\xE8\xA7\x87", + "\xEA\xE9" => "\xE8\xA7\x8A", + "\xEA\xEA" => "\xE8\xA7\x8B", + "\xEA\xEB" => "\xE8\xA7\x8C", + "\xEA\xEC" => "\xE8\xA7\x8E", + "\xEA\xED" => "\xE8\xA7\x8F", + "\xEA\xEE" => "\xE8\xA7\x90", + "\xEA\xEF" => "\xE8\xA7\x91", + "\xEA\xF0" => "\xE7\x89\xAE", + "\xEA\xF1" => "\xE7\x8A\x9F", + "\xEA\xF2" => "\xE7\x89\x9D", + "\xEA\xF3" => "\xE7\x89\xA6", + "\xEA\xF4" => "\xE7\x89\xAF", + "\xEA\xF5" => "\xE7\x89\xBE", + "\xEA\xF6" => "\xE7\x89\xBF", + "\xEA\xF7" => "\xE7\x8A\x84", + "\xEA\xF8" => "\xE7\x8A\x8B", + "\xEA\xF9" => "\xE7\x8A\x8D", + "\xEA\xFA" => "\xE7\x8A\x8F", + "\xEA\xFB" => "\xE7\x8A\x92", + "\xEA\xFC" => "\xE6\x8C\x88", + "\xEA\xFD" => "\xE6\x8C\xB2", + "\xEA\xFE" => "\xE6\x8E\xB0", + "\xEB\xA1" => "\xE6\x90\xBF", + "\xEB\xA2" => "\xE6\x93\x98", + "\xEB\xA3" => "\xE8\x80\x84", + "\xEB\xA4" => "\xE6\xAF\xAA", + "\xEB\xA5" => "\xE6\xAF\xB3", + "\xEB\xA6" => "\xE6\xAF\xBD", + "\xEB\xA7" => "\xE6\xAF\xB5", + "\xEB\xA8" => "\xE6\xAF\xB9", + "\xEB\xA9" => "\xE6\xB0\x85", + "\xEB\xAA" => "\xE6\xB0\x87", + "\xEB\xAB" => "\xE6\xB0\x86", + "\xEB\xAC" => "\xE6\xB0\x8D", + "\xEB\xAD" => "\xE6\xB0\x95", + "\xEB\xAE" => "\xE6\xB0\x98", + "\xEB\xAF" => "\xE6\xB0\x99", + "\xEB\xB0" => "\xE6\xB0\x9A", + "\xEB\xB1" => "\xE6\xB0\xA1", + "\xEB\xB2" => "\xE6\xB0\xA9", + "\xEB\xB3" => "\xE6\xB0\xA4", + "\xEB\xB4" => "\xE6\xB0\xAA", + "\xEB\xB5" => "\xE6\xB0\xB2", + "\xEB\xB6" => "\xE6\x94\xB5", + "\xEB\xB7" => "\xE6\x95\x95", + "\xEB\xB8" => "\xE6\x95\xAB", + "\xEB\xB9" => "\xE7\x89\x8D", + "\xEB\xBA" => "\xE7\x89\x92", + "\xEB\xBB" => "\xE7\x89\x96", + "\xEB\xBC" => "\xE7\x88\xB0", + "\xEB\xBD" => "\xE8\x99\xA2", + "\xEB\xBE" => "\xE5\x88\x96", + "\xEB\xBF" => "\xE8\x82\x9F", + "\xEB\xC0" => "\xE8\x82\x9C", + "\xEB\xC1" => "\xE8\x82\x93", + "\xEB\xC2" => "\xE8\x82\xBC", + "\xEB\xC3" => "\xE6\x9C\x8A", + "\xEB\xC4" => "\xE8\x82\xBD", + "\xEB\xC5" => "\xE8\x82\xB1", + "\xEB\xC6" => "\xE8\x82\xAB", + "\xEB\xC7" => "\xE8\x82\xAD", + "\xEB\xC8" => "\xE8\x82\xB4", + "\xEB\xC9" => "\xE8\x82\xB7", + "\xEB\xCA" => "\xE8\x83\xA7", + "\xEB\xCB" => "\xE8\x83\xA8", + "\xEB\xCC" => "\xE8\x83\xA9", + "\xEB\xCD" => "\xE8\x83\xAA", + "\xEB\xCE" => "\xE8\x83\x9B", + "\xEB\xCF" => "\xE8\x83\x82", + "\xEB\xD0" => "\xE8\x83\x84", + "\xEB\xD1" => "\xE8\x83\x99", + "\xEB\xD2" => "\xE8\x83\x8D", + "\xEB\xD3" => "\xE8\x83\x97", + "\xEB\xD4" => "\xE6\x9C\x90", + "\xEB\xD5" => "\xE8\x83\x9D", + "\xEB\xD6" => "\xE8\x83\xAB", + "\xEB\xD7" => "\xE8\x83\xB1", + "\xEB\xD8" => "\xE8\x83\xB4", + "\xEB\xD9" => "\xE8\x83\xAD", + "\xEB\xDA" => "\xE8\x84\x8D", + "\xEB\xDB" => "\xE8\x84\x8E", + "\xEB\xDC" => "\xE8\x83\xB2", + "\xEB\xDD" => "\xE8\x83\xBC", + "\xEB\xDE" => "\xE6\x9C\x95", + "\xEB\xDF" => "\xE8\x84\x92", + "\xEB\xE0" => "\xE8\xB1\x9A", + "\xEB\xE1" => "\xE8\x84\xB6", + "\xEB\xE2" => "\xE8\x84\x9E", + "\xEB\xE3" => "\xE8\x84\xAC", + "\xEB\xE4" => "\xE8\x84\x98", + "\xEB\xE5" => "\xE8\x84\xB2", + "\xEB\xE6" => "\xE8\x85\x88", + "\xEB\xE7" => "\xE8\x85\x8C", + "\xEB\xE8" => "\xE8\x85\x93", + "\xEB\xE9" => "\xE8\x85\xB4", + "\xEB\xEA" => "\xE8\x85\x99", + "\xEB\xEB" => "\xE8\x85\x9A", + "\xEB\xEC" => "\xE8\x85\xB1", + "\xEB\xED" => "\xE8\x85\xA0", + "\xEB\xEE" => "\xE8\x85\xA9", + "\xEB\xEF" => "\xE8\x85\xBC", + "\xEB\xF0" => "\xE8\x85\xBD", + "\xEB\xF1" => "\xE8\x85\xAD", + "\xEB\xF2" => "\xE8\x85\xA7", + "\xEB\xF3" => "\xE5\xA1\x8D", + "\xEB\xF4" => "\xE5\xAA\xB5", + "\xEB\xF5" => "\xE8\x86\x88", + "\xEB\xF6" => "\xE8\x86\x82", + "\xEB\xF7" => "\xE8\x86\x91", + "\xEB\xF8" => "\xE6\xBB\x95", + "\xEB\xF9" => "\xE8\x86\xA3", + "\xEB\xFA" => "\xE8\x86\xAA", + "\xEB\xFB" => "\xE8\x87\x8C", + "\xEB\xFC" => "\xE6\x9C\xA6", + "\xEB\xFD" => "\xE8\x87\x8A", + "\xEB\xFE" => "\xE8\x86\xBB", + "\xEC\xA1" => "\xE8\x87\x81", + "\xEC\xA2" => "\xE8\x86\xA6", + "\xEC\xA3" => "\xE6\xAC\xA4", + "\xEC\xA4" => "\xE6\xAC\xB7", + "\xEC\xA5" => "\xE6\xAC\xB9", + "\xEC\xA6" => "\xE6\xAD\x83", + "\xEC\xA7" => "\xE6\xAD\x86", + "\xEC\xA8" => "\xE6\xAD\x99", + "\xEC\xA9" => "\xE9\xA3\x91", + "\xEC\xAA" => "\xE9\xA3\x92", + "\xEC\xAB" => "\xE9\xA3\x93", + "\xEC\xAC" => "\xE9\xA3\x95", + "\xEC\xAD" => "\xE9\xA3\x99", + "\xEC\xAE" => "\xE9\xA3\x9A", + "\xEC\xAF" => "\xE6\xAE\xB3", + "\xEC\xB0" => "\xE5\xBD\x80", + "\xEC\xB1" => "\xE6\xAF\x82", + "\xEC\xB2" => "\xE8\xA7\xB3", + "\xEC\xB3" => "\xE6\x96\x90", + "\xEC\xB4" => "\xE9\xBD\x91", + "\xEC\xB5" => "\xE6\x96\x93", + "\xEC\xB6" => "\xE6\x96\xBC", + "\xEC\xB7" => "\xE6\x97\x86", + "\xEC\xB8" => "\xE6\x97\x84", + "\xEC\xB9" => "\xE6\x97\x83", + "\xEC\xBA" => "\xE6\x97\x8C", + "\xEC\xBB" => "\xE6\x97\x8E", + "\xEC\xBC" => "\xE6\x97\x92", + "\xEC\xBD" => "\xE6\x97\x96", + "\xEC\xBE" => "\xE7\x82\x80", + "\xEC\xBF" => "\xE7\x82\x9C", + "\xEC\xC0" => "\xE7\x82\x96", + "\xEC\xC1" => "\xE7\x82\x9D", + "\xEC\xC2" => "\xE7\x82\xBB", + "\xEC\xC3" => "\xE7\x83\x80", + "\xEC\xC4" => "\xE7\x82\xB7", + "\xEC\xC5" => "\xE7\x82\xAB", + "\xEC\xC6" => "\xE7\x82\xB1", + "\xEC\xC7" => "\xE7\x83\xA8", + "\xEC\xC8" => "\xE7\x83\x8A", + "\xEC\xC9" => "\xE7\x84\x90", + "\xEC\xCA" => "\xE7\x84\x93", + "\xEC\xCB" => "\xE7\x84\x96", + "\xEC\xCC" => "\xE7\x84\xAF", + "\xEC\xCD" => "\xE7\x84\xB1", + "\xEC\xCE" => "\xE7\x85\xB3", + "\xEC\xCF" => "\xE7\x85\x9C", + "\xEC\xD0" => "\xE7\x85\xA8", + "\xEC\xD1" => "\xE7\x85\x85", + "\xEC\xD2" => "\xE7\x85\xB2", + "\xEC\xD3" => "\xE7\x85\x8A", + "\xEC\xD4" => "\xE7\x85\xB8", + "\xEC\xD5" => "\xE7\x85\xBA", + "\xEC\xD6" => "\xE7\x86\x98", + "\xEC\xD7" => "\xE7\x86\xB3", + "\xEC\xD8" => "\xE7\x86\xB5", + "\xEC\xD9" => "\xE7\x86\xA8", + "\xEC\xDA" => "\xE7\x86\xA0", + "\xEC\xDB" => "\xE7\x87\xA0", + "\xEC\xDC" => "\xE7\x87\x94", + "\xEC\xDD" => "\xE7\x87\xA7", + "\xEC\xDE" => "\xE7\x87\xB9", + "\xEC\xDF" => "\xE7\x88\x9D", + "\xEC\xE0" => "\xE7\x88\xA8", + "\xEC\xE1" => "\xE7\x81\xAC", + "\xEC\xE2" => "\xE7\x84\x98", + "\xEC\xE3" => "\xE7\x85\xA6", + "\xEC\xE4" => "\xE7\x86\xB9", + "\xEC\xE5" => "\xE6\x88\xBE", + "\xEC\xE6" => "\xE6\x88\xBD", + "\xEC\xE7" => "\xE6\x89\x83", + "\xEC\xE8" => "\xE6\x89\x88", + "\xEC\xE9" => "\xE6\x89\x89", + "\xEC\xEA" => "\xE7\xA4\xBB", + "\xEC\xEB" => "\xE7\xA5\x80", + "\xEC\xEC" => "\xE7\xA5\x86", + "\xEC\xED" => "\xE7\xA5\x89", + "\xEC\xEE" => "\xE7\xA5\x9B", + "\xEC\xEF" => "\xE7\xA5\x9C", + "\xEC\xF0" => "\xE7\xA5\x93", + "\xEC\xF1" => "\xE7\xA5\x9A", + "\xEC\xF2" => "\xE7\xA5\xA2", + "\xEC\xF3" => "\xE7\xA5\x97", + "\xEC\xF4" => "\xE7\xA5\xA0", + "\xEC\xF5" => "\xE7\xA5\xAF", + "\xEC\xF6" => "\xE7\xA5\xA7", + "\xEC\xF7" => "\xE7\xA5\xBA", + "\xEC\xF8" => "\xE7\xA6\x85", + "\xEC\xF9" => "\xE7\xA6\x8A", + "\xEC\xFA" => "\xE7\xA6\x9A", + "\xEC\xFB" => "\xE7\xA6\xA7", + "\xEC\xFC" => "\xE7\xA6\xB3", + "\xEC\xFD" => "\xE5\xBF\x91", + "\xEC\xFE" => "\xE5\xBF\x90", + "\xED\xA1" => "\xE6\x80\xBC", + "\xED\xA2" => "\xE6\x81\x9D", + "\xED\xA3" => "\xE6\x81\x9A", + "\xED\xA4" => "\xE6\x81\xA7", + "\xED\xA5" => "\xE6\x81\x81", + "\xED\xA6" => "\xE6\x81\x99", + "\xED\xA7" => "\xE6\x81\xA3", + "\xED\xA8" => "\xE6\x82\xAB", + "\xED\xA9" => "\xE6\x84\x86", + "\xED\xAA" => "\xE6\x84\x8D", + "\xED\xAB" => "\xE6\x85\x9D", + "\xED\xAC" => "\xE6\x86\xA9", + "\xED\xAD" => "\xE6\x86\x9D", + "\xED\xAE" => "\xE6\x87\x8B", + "\xED\xAF" => "\xE6\x87\x91", + "\xED\xB0" => "\xE6\x88\x86", + "\xED\xB1" => "\xE8\x82\x80", + "\xED\xB2" => "\xE8\x81\xBF", + "\xED\xB3" => "\xE6\xB2\x93", + "\xED\xB4" => "\xE6\xB3\xB6", + "\xED\xB5" => "\xE6\xB7\xBC", + "\xED\xB6" => "\xE7\x9F\xB6", + "\xED\xB7" => "\xE7\x9F\xB8", + "\xED\xB8" => "\xE7\xA0\x80", + "\xED\xB9" => "\xE7\xA0\x89", + "\xED\xBA" => "\xE7\xA0\x97", + "\xED\xBB" => "\xE7\xA0\x98", + "\xED\xBC" => "\xE7\xA0\x91", + "\xED\xBD" => "\xE6\x96\xAB", + "\xED\xBE" => "\xE7\xA0\xAD", + "\xED\xBF" => "\xE7\xA0\x9C", + "\xED\xC0" => "\xE7\xA0\x9D", + "\xED\xC1" => "\xE7\xA0\xB9", + "\xED\xC2" => "\xE7\xA0\xBA", + "\xED\xC3" => "\xE7\xA0\xBB", + "\xED\xC4" => "\xE7\xA0\x9F", + "\xED\xC5" => "\xE7\xA0\xBC", + "\xED\xC6" => "\xE7\xA0\xA5", + "\xED\xC7" => "\xE7\xA0\xAC", + "\xED\xC8" => "\xE7\xA0\xA3", + "\xED\xC9" => "\xE7\xA0\xA9", + "\xED\xCA" => "\xE7\xA1\x8E", + "\xED\xCB" => "\xE7\xA1\xAD", + "\xED\xCC" => "\xE7\xA1\x96", + "\xED\xCD" => "\xE7\xA1\x97", + "\xED\xCE" => "\xE7\xA0\xA6", + "\xED\xCF" => "\xE7\xA1\x90", + "\xED\xD0" => "\xE7\xA1\x87", + "\xED\xD1" => "\xE7\xA1\x8C", + "\xED\xD2" => "\xE7\xA1\xAA", + "\xED\xD3" => "\xE7\xA2\x9B", + "\xED\xD4" => "\xE7\xA2\x93", + "\xED\xD5" => "\xE7\xA2\x9A", + "\xED\xD6" => "\xE7\xA2\x87", + "\xED\xD7" => "\xE7\xA2\x9C", + "\xED\xD8" => "\xE7\xA2\xA1", + "\xED\xD9" => "\xE7\xA2\xA3", + "\xED\xDA" => "\xE7\xA2\xB2", + "\xED\xDB" => "\xE7\xA2\xB9", + "\xED\xDC" => "\xE7\xA2\xA5", + "\xED\xDD" => "\xE7\xA3\x94", + "\xED\xDE" => "\xE7\xA3\x99", + "\xED\xDF" => "\xE7\xA3\x89", + "\xED\xE0" => "\xE7\xA3\xAC", + "\xED\xE1" => "\xE7\xA3\xB2", + "\xED\xE2" => "\xE7\xA4\x85", + "\xED\xE3" => "\xE7\xA3\xB4", + "\xED\xE4" => "\xE7\xA4\x93", + "\xED\xE5" => "\xE7\xA4\xA4", + "\xED\xE6" => "\xE7\xA4\x9E", + "\xED\xE7" => "\xE7\xA4\xB4", + "\xED\xE8" => "\xE9\xBE\x9B", + "\xED\xE9" => "\xE9\xBB\xB9", + "\xED\xEA" => "\xE9\xBB\xBB", + "\xED\xEB" => "\xE9\xBB\xBC", + "\xED\xEC" => "\xE7\x9B\xB1", + "\xED\xED" => "\xE7\x9C\x84", + "\xED\xEE" => "\xE7\x9C\x8D", + "\xED\xEF" => "\xE7\x9B\xB9", + "\xED\xF0" => "\xE7\x9C\x87", + "\xED\xF1" => "\xE7\x9C\x88", + "\xED\xF2" => "\xE7\x9C\x9A", + "\xED\xF3" => "\xE7\x9C\xA2", + "\xED\xF4" => "\xE7\x9C\x99", + "\xED\xF5" => "\xE7\x9C\xAD", + "\xED\xF6" => "\xE7\x9C\xA6", + "\xED\xF7" => "\xE7\x9C\xB5", + "\xED\xF8" => "\xE7\x9C\xB8", + "\xED\xF9" => "\xE7\x9D\x90", + "\xED\xFA" => "\xE7\x9D\x91", + "\xED\xFB" => "\xE7\x9D\x87", + "\xED\xFC" => "\xE7\x9D\x83", + "\xED\xFD" => "\xE7\x9D\x9A", + "\xED\xFE" => "\xE7\x9D\xA8", + "\xEE\xA1" => "\xE7\x9D\xA2", + "\xEE\xA2" => "\xE7\x9D\xA5", + "\xEE\xA3" => "\xE7\x9D\xBF", + "\xEE\xA4" => "\xE7\x9E\x8D", + "\xEE\xA5" => "\xE7\x9D\xBD", + "\xEE\xA6" => "\xE7\x9E\x80", + "\xEE\xA7" => "\xE7\x9E\x8C", + "\xEE\xA8" => "\xE7\x9E\x91", + "\xEE\xA9" => "\xE7\x9E\x9F", + "\xEE\xAA" => "\xE7\x9E\xA0", + "\xEE\xAB" => "\xE7\x9E\xB0", + "\xEE\xAC" => "\xE7\x9E\xB5", + "\xEE\xAD" => "\xE7\x9E\xBD", + "\xEE\xAE" => "\xE7\x94\xBA", + "\xEE\xAF" => "\xE7\x95\x80", + "\xEE\xB0" => "\xE7\x95\x8E", + "\xEE\xB1" => "\xE7\x95\x8B", + "\xEE\xB2" => "\xE7\x95\x88", + "\xEE\xB3" => "\xE7\x95\x9B", + "\xEE\xB4" => "\xE7\x95\xB2", + "\xEE\xB5" => "\xE7\x95\xB9", + "\xEE\xB6" => "\xE7\x96\x83", + "\xEE\xB7" => "\xE7\xBD\x98", + "\xEE\xB8" => "\xE7\xBD\xA1", + "\xEE\xB9" => "\xE7\xBD\x9F", + "\xEE\xBA" => "\xE8\xA9\x88", + "\xEE\xBB" => "\xE7\xBD\xA8", + "\xEE\xBC" => "\xE7\xBD\xB4", + "\xEE\xBD" => "\xE7\xBD\xB1", + "\xEE\xBE" => "\xE7\xBD\xB9", + "\xEE\xBF" => "\xE7\xBE\x81", + "\xEE\xC0" => "\xE7\xBD\xBE", + "\xEE\xC1" => "\xE7\x9B\x8D", + "\xEE\xC2" => "\xE7\x9B\xA5", + "\xEE\xC3" => "\xE8\xA0\xB2", + "\xEE\xC4" => "\xE9\x92\x85", + "\xEE\xC5" => "\xE9\x92\x86", + "\xEE\xC6" => "\xE9\x92\x87", + "\xEE\xC7" => "\xE9\x92\x8B", + "\xEE\xC8" => "\xE9\x92\x8A", + "\xEE\xC9" => "\xE9\x92\x8C", + "\xEE\xCA" => "\xE9\x92\x8D", + "\xEE\xCB" => "\xE9\x92\x8F", + "\xEE\xCC" => "\xE9\x92\x90", + "\xEE\xCD" => "\xE9\x92\x94", + "\xEE\xCE" => "\xE9\x92\x97", + "\xEE\xCF" => "\xE9\x92\x95", + "\xEE\xD0" => "\xE9\x92\x9A", + "\xEE\xD1" => "\xE9\x92\x9B", + "\xEE\xD2" => "\xE9\x92\x9C", + "\xEE\xD3" => "\xE9\x92\xA3", + "\xEE\xD4" => "\xE9\x92\xA4", + "\xEE\xD5" => "\xE9\x92\xAB", + "\xEE\xD6" => "\xE9\x92\xAA", + "\xEE\xD7" => "\xE9\x92\xAD", + "\xEE\xD8" => "\xE9\x92\xAC", + "\xEE\xD9" => "\xE9\x92\xAF", + "\xEE\xDA" => "\xE9\x92\xB0", + "\xEE\xDB" => "\xE9\x92\xB2", + "\xEE\xDC" => "\xE9\x92\xB4", + "\xEE\xDD" => "\xE9\x92\xB6", + "\xEE\xDE" => "\xE9\x92\xB7", + "\xEE\xDF" => "\xE9\x92\xB8", + "\xEE\xE0" => "\xE9\x92\xB9", + "\xEE\xE1" => "\xE9\x92\xBA", + "\xEE\xE2" => "\xE9\x92\xBC", + "\xEE\xE3" => "\xE9\x92\xBD", + "\xEE\xE4" => "\xE9\x92\xBF", + "\xEE\xE5" => "\xE9\x93\x84", + "\xEE\xE6" => "\xE9\x93\x88", + "\xEE\xE7" => "\xE9\x93\x89", + "\xEE\xE8" => "\xE9\x93\x8A", + "\xEE\xE9" => "\xE9\x93\x8B", + "\xEE\xEA" => "\xE9\x93\x8C", + "\xEE\xEB" => "\xE9\x93\x8D", + "\xEE\xEC" => "\xE9\x93\x8E", + "\xEE\xED" => "\xE9\x93\x90", + "\xEE\xEE" => "\xE9\x93\x91", + "\xEE\xEF" => "\xE9\x93\x92", + "\xEE\xF0" => "\xE9\x93\x95", + "\xEE\xF1" => "\xE9\x93\x96", + "\xEE\xF2" => "\xE9\x93\x97", + "\xEE\xF3" => "\xE9\x93\x99", + "\xEE\xF4" => "\xE9\x93\x98", + "\xEE\xF5" => "\xE9\x93\x9B", + "\xEE\xF6" => "\xE9\x93\x9E", + "\xEE\xF7" => "\xE9\x93\x9F", + "\xEE\xF8" => "\xE9\x93\xA0", + "\xEE\xF9" => "\xE9\x93\xA2", + "\xEE\xFA" => "\xE9\x93\xA4", + "\xEE\xFB" => "\xE9\x93\xA5", + "\xEE\xFC" => "\xE9\x93\xA7", + "\xEE\xFD" => "\xE9\x93\xA8", + "\xEE\xFE" => "\xE9\x93\xAA", + "\xEF\xA1" => "\xE9\x93\xA9", + "\xEF\xA2" => "\xE9\x93\xAB", + "\xEF\xA3" => "\xE9\x93\xAE", + "\xEF\xA4" => "\xE9\x93\xAF", + "\xEF\xA5" => "\xE9\x93\xB3", + "\xEF\xA6" => "\xE9\x93\xB4", + "\xEF\xA7" => "\xE9\x93\xB5", + "\xEF\xA8" => "\xE9\x93\xB7", + "\xEF\xA9" => "\xE9\x93\xB9", + "\xEF\xAA" => "\xE9\x93\xBC", + "\xEF\xAB" => "\xE9\x93\xBD", + "\xEF\xAC" => "\xE9\x93\xBF", + "\xEF\xAD" => "\xE9\x94\x83", + "\xEF\xAE" => "\xE9\x94\x82", + "\xEF\xAF" => "\xE9\x94\x86", + "\xEF\xB0" => "\xE9\x94\x87", + "\xEF\xB1" => "\xE9\x94\x89", + "\xEF\xB2" => "\xE9\x94\x8A", + "\xEF\xB3" => "\xE9\x94\x8D", + "\xEF\xB4" => "\xE9\x94\x8E", + "\xEF\xB5" => "\xE9\x94\x8F", + "\xEF\xB6" => "\xE9\x94\x92", + "\xEF\xB7" => "\xE9\x94\x93", + "\xEF\xB8" => "\xE9\x94\x94", + "\xEF\xB9" => "\xE9\x94\x95", + "\xEF\xBA" => "\xE9\x94\x96", + "\xEF\xBB" => "\xE9\x94\x98", + "\xEF\xBC" => "\xE9\x94\x9B", + "\xEF\xBD" => "\xE9\x94\x9D", + "\xEF\xBE" => "\xE9\x94\x9E", + "\xEF\xBF" => "\xE9\x94\x9F", + "\xEF\xC0" => "\xE9\x94\xA2", + "\xEF\xC1" => "\xE9\x94\xAA", + "\xEF\xC2" => "\xE9\x94\xAB", + "\xEF\xC3" => "\xE9\x94\xA9", + "\xEF\xC4" => "\xE9\x94\xAC", + "\xEF\xC5" => "\xE9\x94\xB1", + "\xEF\xC6" => "\xE9\x94\xB2", + "\xEF\xC7" => "\xE9\x94\xB4", + "\xEF\xC8" => "\xE9\x94\xB6", + "\xEF\xC9" => "\xE9\x94\xB7", + "\xEF\xCA" => "\xE9\x94\xB8", + "\xEF\xCB" => "\xE9\x94\xBC", + "\xEF\xCC" => "\xE9\x94\xBE", + "\xEF\xCD" => "\xE9\x94\xBF", + "\xEF\xCE" => "\xE9\x95\x82", + "\xEF\xCF" => "\xE9\x94\xB5", + "\xEF\xD0" => "\xE9\x95\x84", + "\xEF\xD1" => "\xE9\x95\x85", + "\xEF\xD2" => "\xE9\x95\x86", + "\xEF\xD3" => "\xE9\x95\x89", + "\xEF\xD4" => "\xE9\x95\x8C", + "\xEF\xD5" => "\xE9\x95\x8E", + "\xEF\xD6" => "\xE9\x95\x8F", + "\xEF\xD7" => "\xE9\x95\x92", + "\xEF\xD8" => "\xE9\x95\x93", + "\xEF\xD9" => "\xE9\x95\x94", + "\xEF\xDA" => "\xE9\x95\x96", + "\xEF\xDB" => "\xE9\x95\x97", + "\xEF\xDC" => "\xE9\x95\x98", + "\xEF\xDD" => "\xE9\x95\x99", + "\xEF\xDE" => "\xE9\x95\x9B", + "\xEF\xDF" => "\xE9\x95\x9E", + "\xEF\xE0" => "\xE9\x95\x9F", + "\xEF\xE1" => "\xE9\x95\x9D", + "\xEF\xE2" => "\xE9\x95\xA1", + "\xEF\xE3" => "\xE9\x95\xA2", + "\xEF\xE4" => "\xE9\x95\xA4", + "\xEF\xE5" => "\xE9\x95\xA5", + "\xEF\xE6" => "\xE9\x95\xA6", + "\xEF\xE7" => "\xE9\x95\xA7", + "\xEF\xE8" => "\xE9\x95\xA8", + "\xEF\xE9" => "\xE9\x95\xA9", + "\xEF\xEA" => "\xE9\x95\xAA", + "\xEF\xEB" => "\xE9\x95\xAB", + "\xEF\xEC" => "\xE9\x95\xAC", + "\xEF\xED" => "\xE9\x95\xAF", + "\xEF\xEE" => "\xE9\x95\xB1", + "\xEF\xEF" => "\xE9\x95\xB2", + "\xEF\xF0" => "\xE9\x95\xB3", + "\xEF\xF1" => "\xE9\x94\xBA", + "\xEF\xF2" => "\xE7\x9F\xA7", + "\xEF\xF3" => "\xE7\x9F\xAC", + "\xEF\xF4" => "\xE9\x9B\x89", + "\xEF\xF5" => "\xE7\xA7\x95", + "\xEF\xF6" => "\xE7\xA7\xAD", + "\xEF\xF7" => "\xE7\xA7\xA3", + "\xEF\xF8" => "\xE7\xA7\xAB", + "\xEF\xF9" => "\xE7\xA8\x86", + "\xEF\xFA" => "\xE5\xB5\x87", + "\xEF\xFB" => "\xE7\xA8\x83", + "\xEF\xFC" => "\xE7\xA8\x82", + "\xEF\xFD" => "\xE7\xA8\x9E", + "\xEF\xFE" => "\xE7\xA8\x94", + "\xF0\xA1" => "\xE7\xA8\xB9", + "\xF0\xA2" => "\xE7\xA8\xB7", + "\xF0\xA3" => "\xE7\xA9\x91", + "\xF0\xA4" => "\xE9\xBB\x8F", + "\xF0\xA5" => "\xE9\xA6\xA5", + "\xF0\xA6" => "\xE7\xA9\xB0", + "\xF0\xA7" => "\xE7\x9A\x88", + "\xF0\xA8" => "\xE7\x9A\x8E", + "\xF0\xA9" => "\xE7\x9A\x93", + "\xF0\xAA" => "\xE7\x9A\x99", + "\xF0\xAB" => "\xE7\x9A\xA4", + "\xF0\xAC" => "\xE7\x93\x9E", + "\xF0\xAD" => "\xE7\x93\xA0", + "\xF0\xAE" => "\xE7\x94\xAC", + "\xF0\xAF" => "\xE9\xB8\xA0", + "\xF0\xB0" => "\xE9\xB8\xA2", + "\xF0\xB1" => "\xE9\xB8\xA8", + "\xF0\xB2" => "\xE9\xB8\xA9", + "\xF0\xB3" => "\xE9\xB8\xAA", + "\xF0\xB4" => "\xE9\xB8\xAB", + "\xF0\xB5" => "\xE9\xB8\xAC", + "\xF0\xB6" => "\xE9\xB8\xB2", + "\xF0\xB7" => "\xE9\xB8\xB1", + "\xF0\xB8" => "\xE9\xB8\xB6", + "\xF0\xB9" => "\xE9\xB8\xB8", + "\xF0\xBA" => "\xE9\xB8\xB7", + "\xF0\xBB" => "\xE9\xB8\xB9", + "\xF0\xBC" => "\xE9\xB8\xBA", + "\xF0\xBD" => "\xE9\xB8\xBE", + "\xF0\xBE" => "\xE9\xB9\x81", + "\xF0\xBF" => "\xE9\xB9\x82", + "\xF0\xC0" => "\xE9\xB9\x84", + "\xF0\xC1" => "\xE9\xB9\x86", + "\xF0\xC2" => "\xE9\xB9\x87", + "\xF0\xC3" => "\xE9\xB9\x88", + "\xF0\xC4" => "\xE9\xB9\x89", + "\xF0\xC5" => "\xE9\xB9\x8B", + "\xF0\xC6" => "\xE9\xB9\x8C", + "\xF0\xC7" => "\xE9\xB9\x8E", + "\xF0\xC8" => "\xE9\xB9\x91", + "\xF0\xC9" => "\xE9\xB9\x95", + "\xF0\xCA" => "\xE9\xB9\x97", + "\xF0\xCB" => "\xE9\xB9\x9A", + "\xF0\xCC" => "\xE9\xB9\x9B", + "\xF0\xCD" => "\xE9\xB9\x9C", + "\xF0\xCE" => "\xE9\xB9\x9E", + "\xF0\xCF" => "\xE9\xB9\xA3", + "\xF0\xD0" => "\xE9\xB9\xA6", + "\xF0\xD1" => "\xE9\xB9\xA7", + "\xF0\xD2" => "\xE9\xB9\xA8", + "\xF0\xD3" => "\xE9\xB9\xA9", + "\xF0\xD4" => "\xE9\xB9\xAA", + "\xF0\xD5" => "\xE9\xB9\xAB", + "\xF0\xD6" => "\xE9\xB9\xAC", + "\xF0\xD7" => "\xE9\xB9\xB1", + "\xF0\xD8" => "\xE9\xB9\xAD", + "\xF0\xD9" => "\xE9\xB9\xB3", + "\xF0\xDA" => "\xE7\x96\x92", + "\xF0\xDB" => "\xE7\x96\x94", + "\xF0\xDC" => "\xE7\x96\x96", + "\xF0\xDD" => "\xE7\x96\xA0", + "\xF0\xDE" => "\xE7\x96\x9D", + "\xF0\xDF" => "\xE7\x96\xAC", + "\xF0\xE0" => "\xE7\x96\xA3", + "\xF0\xE1" => "\xE7\x96\xB3", + "\xF0\xE2" => "\xE7\x96\xB4", + "\xF0\xE3" => "\xE7\x96\xB8", + "\xF0\xE4" => "\xE7\x97\x84", + "\xF0\xE5" => "\xE7\x96\xB1", + "\xF0\xE6" => "\xE7\x96\xB0", + "\xF0\xE7" => "\xE7\x97\x83", + "\xF0\xE8" => "\xE7\x97\x82", + "\xF0\xE9" => "\xE7\x97\x96", + "\xF0\xEA" => "\xE7\x97\x8D", + "\xF0\xEB" => "\xE7\x97\xA3", + "\xF0\xEC" => "\xE7\x97\xA8", + "\xF0\xED" => "\xE7\x97\xA6", + "\xF0\xEE" => "\xE7\x97\xA4", + "\xF0\xEF" => "\xE7\x97\xAB", + "\xF0\xF0" => "\xE7\x97\xA7", + "\xF0\xF1" => "\xE7\x98\x83", + "\xF0\xF2" => "\xE7\x97\xB1", + "\xF0\xF3" => "\xE7\x97\xBC", + "\xF0\xF4" => "\xE7\x97\xBF", + "\xF0\xF5" => "\xE7\x98\x90", + "\xF0\xF6" => "\xE7\x98\x80", + "\xF0\xF7" => "\xE7\x98\x85", + "\xF0\xF8" => "\xE7\x98\x8C", + "\xF0\xF9" => "\xE7\x98\x97", + "\xF0\xFA" => "\xE7\x98\x8A", + "\xF0\xFB" => "\xE7\x98\xA5", + "\xF0\xFC" => "\xE7\x98\x98", + "\xF0\xFD" => "\xE7\x98\x95", + "\xF0\xFE" => "\xE7\x98\x99", + "\xF1\xA1" => "\xE7\x98\x9B", + "\xF1\xA2" => "\xE7\x98\xBC", + "\xF1\xA3" => "\xE7\x98\xA2", + "\xF1\xA4" => "\xE7\x98\xA0", + "\xF1\xA5" => "\xE7\x99\x80", + "\xF1\xA6" => "\xE7\x98\xAD", + "\xF1\xA7" => "\xE7\x98\xB0", + "\xF1\xA8" => "\xE7\x98\xBF", + "\xF1\xA9" => "\xE7\x98\xB5", + "\xF1\xAA" => "\xE7\x99\x83", + "\xF1\xAB" => "\xE7\x98\xBE", + "\xF1\xAC" => "\xE7\x98\xB3", + "\xF1\xAD" => "\xE7\x99\x8D", + "\xF1\xAE" => "\xE7\x99\x9E", + "\xF1\xAF" => "\xE7\x99\x94", + "\xF1\xB0" => "\xE7\x99\x9C", + "\xF1\xB1" => "\xE7\x99\x96", + "\xF1\xB2" => "\xE7\x99\xAB", + "\xF1\xB3" => "\xE7\x99\xAF", + "\xF1\xB4" => "\xE7\xBF\x8A", + "\xF1\xB5" => "\xE7\xAB\xA6", + "\xF1\xB6" => "\xE7\xA9\xB8", + "\xF1\xB7" => "\xE7\xA9\xB9", + "\xF1\xB8" => "\xE7\xAA\x80", + "\xF1\xB9" => "\xE7\xAA\x86", + "\xF1\xBA" => "\xE7\xAA\x88", + "\xF1\xBB" => "\xE7\xAA\x95", + "\xF1\xBC" => "\xE7\xAA\xA6", + "\xF1\xBD" => "\xE7\xAA\xA0", + "\xF1\xBE" => "\xE7\xAA\xAC", + "\xF1\xBF" => "\xE7\xAA\xA8", + "\xF1\xC0" => "\xE7\xAA\xAD", + "\xF1\xC1" => "\xE7\xAA\xB3", + "\xF1\xC2" => "\xE8\xA1\xA4", + "\xF1\xC3" => "\xE8\xA1\xA9", + "\xF1\xC4" => "\xE8\xA1\xB2", + "\xF1\xC5" => "\xE8\xA1\xBD", + "\xF1\xC6" => "\xE8\xA1\xBF", + "\xF1\xC7" => "\xE8\xA2\x82", + "\xF1\xC8" => "\xE8\xA2\xA2", + "\xF1\xC9" => "\xE8\xA3\x86", + "\xF1\xCA" => "\xE8\xA2\xB7", + "\xF1\xCB" => "\xE8\xA2\xBC", + "\xF1\xCC" => "\xE8\xA3\x89", + "\xF1\xCD" => "\xE8\xA3\xA2", + "\xF1\xCE" => "\xE8\xA3\x8E", + "\xF1\xCF" => "\xE8\xA3\xA3", + "\xF1\xD0" => "\xE8\xA3\xA5", + "\xF1\xD1" => "\xE8\xA3\xB1", + "\xF1\xD2" => "\xE8\xA4\x9A", + "\xF1\xD3" => "\xE8\xA3\xBC", + "\xF1\xD4" => "\xE8\xA3\xA8", + "\xF1\xD5" => "\xE8\xA3\xBE", + "\xF1\xD6" => "\xE8\xA3\xB0", + "\xF1\xD7" => "\xE8\xA4\xA1", + "\xF1\xD8" => "\xE8\xA4\x99", + "\xF1\xD9" => "\xE8\xA4\x93", + "\xF1\xDA" => "\xE8\xA4\x9B", + "\xF1\xDB" => "\xE8\xA4\x8A", + "\xF1\xDC" => "\xE8\xA4\xB4", + "\xF1\xDD" => "\xE8\xA4\xAB", + "\xF1\xDE" => "\xE8\xA4\xB6", + "\xF1\xDF" => "\xE8\xA5\x81", + "\xF1\xE0" => "\xE8\xA5\xA6", + "\xF1\xE1" => "\xE8\xA5\xBB", + "\xF1\xE2" => "\xE7\x96\x8B", + "\xF1\xE3" => "\xE8\x83\xA5", + "\xF1\xE4" => "\xE7\x9A\xB2", + "\xF1\xE5" => "\xE7\x9A\xB4", + "\xF1\xE6" => "\xE7\x9F\x9C", + "\xF1\xE7" => "\xE8\x80\x92", + "\xF1\xE8" => "\xE8\x80\x94", + "\xF1\xE9" => "\xE8\x80\x96", + "\xF1\xEA" => "\xE8\x80\x9C", + "\xF1\xEB" => "\xE8\x80\xA0", + "\xF1\xEC" => "\xE8\x80\xA2", + "\xF1\xED" => "\xE8\x80\xA5", + "\xF1\xEE" => "\xE8\x80\xA6", + "\xF1\xEF" => "\xE8\x80\xA7", + "\xF1\xF0" => "\xE8\x80\xA9", + "\xF1\xF1" => "\xE8\x80\xA8", + "\xF1\xF2" => "\xE8\x80\xB1", + "\xF1\xF3" => "\xE8\x80\x8B", + "\xF1\xF4" => "\xE8\x80\xB5", + "\xF1\xF5" => "\xE8\x81\x83", + "\xF1\xF6" => "\xE8\x81\x86", + "\xF1\xF7" => "\xE8\x81\x8D", + "\xF1\xF8" => "\xE8\x81\x92", + "\xF1\xF9" => "\xE8\x81\xA9", + "\xF1\xFA" => "\xE8\x81\xB1", + "\xF1\xFB" => "\xE8\xA6\x83", + "\xF1\xFC" => "\xE9\xA1\xB8", + "\xF1\xFD" => "\xE9\xA2\x80", + "\xF1\xFE" => "\xE9\xA2\x83", + "\xF2\xA1" => "\xE9\xA2\x89", + "\xF2\xA2" => "\xE9\xA2\x8C", + "\xF2\xA3" => "\xE9\xA2\x8D", + "\xF2\xA4" => "\xE9\xA2\x8F", + "\xF2\xA5" => "\xE9\xA2\x94", + "\xF2\xA6" => "\xE9\xA2\x9A", + "\xF2\xA7" => "\xE9\xA2\x9B", + "\xF2\xA8" => "\xE9\xA2\x9E", + "\xF2\xA9" => "\xE9\xA2\x9F", + "\xF2\xAA" => "\xE9\xA2\xA1", + "\xF2\xAB" => "\xE9\xA2\xA2", + "\xF2\xAC" => "\xE9\xA2\xA5", + "\xF2\xAD" => "\xE9\xA2\xA6", + "\xF2\xAE" => "\xE8\x99\x8D", + "\xF2\xAF" => "\xE8\x99\x94", + "\xF2\xB0" => "\xE8\x99\xAC", + "\xF2\xB1" => "\xE8\x99\xAE", + "\xF2\xB2" => "\xE8\x99\xBF", + "\xF2\xB3" => "\xE8\x99\xBA", + "\xF2\xB4" => "\xE8\x99\xBC", + "\xF2\xB5" => "\xE8\x99\xBB", + "\xF2\xB6" => "\xE8\x9A\xA8", + "\xF2\xB7" => "\xE8\x9A\x8D", + "\xF2\xB8" => "\xE8\x9A\x8B", + "\xF2\xB9" => "\xE8\x9A\xAC", + "\xF2\xBA" => "\xE8\x9A\x9D", + "\xF2\xBB" => "\xE8\x9A\xA7", + "\xF2\xBC" => "\xE8\x9A\xA3", + "\xF2\xBD" => "\xE8\x9A\xAA", + "\xF2\xBE" => "\xE8\x9A\x93", + "\xF2\xBF" => "\xE8\x9A\xA9", + "\xF2\xC0" => "\xE8\x9A\xB6", + "\xF2\xC1" => "\xE8\x9B\x84", + "\xF2\xC2" => "\xE8\x9A\xB5", + "\xF2\xC3" => "\xE8\x9B\x8E", + "\xF2\xC4" => "\xE8\x9A\xB0", + "\xF2\xC5" => "\xE8\x9A\xBA", + "\xF2\xC6" => "\xE8\x9A\xB1", + "\xF2\xC7" => "\xE8\x9A\xAF", + "\xF2\xC8" => "\xE8\x9B\x89", + "\xF2\xC9" => "\xE8\x9B\x8F", + "\xF2\xCA" => "\xE8\x9A\xB4", + "\xF2\xCB" => "\xE8\x9B\xA9", + "\xF2\xCC" => "\xE8\x9B\xB1", + "\xF2\xCD" => "\xE8\x9B\xB2", + "\xF2\xCE" => "\xE8\x9B\xAD", + "\xF2\xCF" => "\xE8\x9B\xB3", + "\xF2\xD0" => "\xE8\x9B\x90", + "\xF2\xD1" => "\xE8\x9C\x93", + "\xF2\xD2" => "\xE8\x9B\x9E", + "\xF2\xD3" => "\xE8\x9B\xB4", + "\xF2\xD4" => "\xE8\x9B\x9F", + "\xF2\xD5" => "\xE8\x9B\x98", + "\xF2\xD6" => "\xE8\x9B\x91", + "\xF2\xD7" => "\xE8\x9C\x83", + "\xF2\xD8" => "\xE8\x9C\x87", + "\xF2\xD9" => "\xE8\x9B\xB8", + "\xF2\xDA" => "\xE8\x9C\x88", + "\xF2\xDB" => "\xE8\x9C\x8A", + "\xF2\xDC" => "\xE8\x9C\x8D", + "\xF2\xDD" => "\xE8\x9C\x89", + "\xF2\xDE" => "\xE8\x9C\xA3", + "\xF2\xDF" => "\xE8\x9C\xBB", + "\xF2\xE0" => "\xE8\x9C\x9E", + "\xF2\xE1" => "\xE8\x9C\xA5", + "\xF2\xE2" => "\xE8\x9C\xAE", + "\xF2\xE3" => "\xE8\x9C\x9A", + "\xF2\xE4" => "\xE8\x9C\xBE", + "\xF2\xE5" => "\xE8\x9D\x88", + "\xF2\xE6" => "\xE8\x9C\xB4", + "\xF2\xE7" => "\xE8\x9C\xB1", + "\xF2\xE8" => "\xE8\x9C\xA9", + "\xF2\xE9" => "\xE8\x9C\xB7", + "\xF2\xEA" => "\xE8\x9C\xBF", + "\xF2\xEB" => "\xE8\x9E\x82", + "\xF2\xEC" => "\xE8\x9C\xA2", + "\xF2\xED" => "\xE8\x9D\xBD", + "\xF2\xEE" => "\xE8\x9D\xBE", + "\xF2\xEF" => "\xE8\x9D\xBB", + "\xF2\xF0" => "\xE8\x9D\xA0", + "\xF2\xF1" => "\xE8\x9D\xB0", + "\xF2\xF2" => "\xE8\x9D\x8C", + "\xF2\xF3" => "\xE8\x9D\xAE", + "\xF2\xF4" => "\xE8\x9E\x8B", + "\xF2\xF5" => "\xE8\x9D\x93", + "\xF2\xF6" => "\xE8\x9D\xA3", + "\xF2\xF7" => "\xE8\x9D\xBC", + "\xF2\xF8" => "\xE8\x9D\xA4", + "\xF2\xF9" => "\xE8\x9D\x99", + "\xF2\xFA" => "\xE8\x9D\xA5", + "\xF2\xFB" => "\xE8\x9E\x93", + "\xF2\xFC" => "\xE8\x9E\xAF", + "\xF2\xFD" => "\xE8\x9E\xA8", + "\xF2\xFE" => "\xE8\x9F\x92", + "\xF3\xA1" => "\xE8\x9F\x86", + "\xF3\xA2" => "\xE8\x9E\x88", + "\xF3\xA3" => "\xE8\x9E\x85", + "\xF3\xA4" => "\xE8\x9E\xAD", + "\xF3\xA5" => "\xE8\x9E\x97", + "\xF3\xA6" => "\xE8\x9E\x83", + "\xF3\xA7" => "\xE8\x9E\xAB", + "\xF3\xA8" => "\xE8\x9F\xA5", + "\xF3\xA9" => "\xE8\x9E\xAC", + "\xF3\xAA" => "\xE8\x9E\xB5", + "\xF3\xAB" => "\xE8\x9E\xB3", + "\xF3\xAC" => "\xE8\x9F\x8B", + "\xF3\xAD" => "\xE8\x9F\x93", + "\xF3\xAE" => "\xE8\x9E\xBD", + "\xF3\xAF" => "\xE8\x9F\x91", + "\xF3\xB0" => "\xE8\x9F\x80", + "\xF3\xB1" => "\xE8\x9F\x8A", + "\xF3\xB2" => "\xE8\x9F\x9B", + "\xF3\xB3" => "\xE8\x9F\xAA", + "\xF3\xB4" => "\xE8\x9F\xA0", + "\xF3\xB5" => "\xE8\x9F\xAE", + "\xF3\xB6" => "\xE8\xA0\x96", + "\xF3\xB7" => "\xE8\xA0\x93", + "\xF3\xB8" => "\xE8\x9F\xBE", + "\xF3\xB9" => "\xE8\xA0\x8A", + "\xF3\xBA" => "\xE8\xA0\x9B", + "\xF3\xBB" => "\xE8\xA0\xA1", + "\xF3\xBC" => "\xE8\xA0\xB9", + "\xF3\xBD" => "\xE8\xA0\xBC", + "\xF3\xBE" => "\xE7\xBC\xB6", + "\xF3\xBF" => "\xE7\xBD\x82", + "\xF3\xC0" => "\xE7\xBD\x84", + "\xF3\xC1" => "\xE7\xBD\x85", + "\xF3\xC2" => "\xE8\x88\x90", + "\xF3\xC3" => "\xE7\xAB\xBA", + "\xF3\xC4" => "\xE7\xAB\xBD", + "\xF3\xC5" => "\xE7\xAC\x88", + "\xF3\xC6" => "\xE7\xAC\x83", + "\xF3\xC7" => "\xE7\xAC\x84", + "\xF3\xC8" => "\xE7\xAC\x95", + "\xF3\xC9" => "\xE7\xAC\x8A", + "\xF3\xCA" => "\xE7\xAC\xAB", + "\xF3\xCB" => "\xE7\xAC\x8F", + "\xF3\xCC" => "\xE7\xAD\x87", + "\xF3\xCD" => "\xE7\xAC\xB8", + "\xF3\xCE" => "\xE7\xAC\xAA", + "\xF3\xCF" => "\xE7\xAC\x99", + "\xF3\xD0" => "\xE7\xAC\xAE", + "\xF3\xD1" => "\xE7\xAC\xB1", + "\xF3\xD2" => "\xE7\xAC\xA0", + "\xF3\xD3" => "\xE7\xAC\xA5", + "\xF3\xD4" => "\xE7\xAC\xA4", + "\xF3\xD5" => "\xE7\xAC\xB3", + "\xF3\xD6" => "\xE7\xAC\xBE", + "\xF3\xD7" => "\xE7\xAC\x9E", + "\xF3\xD8" => "\xE7\xAD\x98", + "\xF3\xD9" => "\xE7\xAD\x9A", + "\xF3\xDA" => "\xE7\xAD\x85", + "\xF3\xDB" => "\xE7\xAD\xB5", + "\xF3\xDC" => "\xE7\xAD\x8C", + "\xF3\xDD" => "\xE7\xAD\x9D", + "\xF3\xDE" => "\xE7\xAD\xA0", + "\xF3\xDF" => "\xE7\xAD\xAE", + "\xF3\xE0" => "\xE7\xAD\xBB", + "\xF3\xE1" => "\xE7\xAD\xA2", + "\xF3\xE2" => "\xE7\xAD\xB2", + "\xF3\xE3" => "\xE7\xAD\xB1", + "\xF3\xE4" => "\xE7\xAE\x90", + "\xF3\xE5" => "\xE7\xAE\xA6", + "\xF3\xE6" => "\xE7\xAE\xA7", + "\xF3\xE7" => "\xE7\xAE\xB8", + "\xF3\xE8" => "\xE7\xAE\xAC", + "\xF3\xE9" => "\xE7\xAE\x9D", + "\xF3\xEA" => "\xE7\xAE\xA8", + "\xF3\xEB" => "\xE7\xAE\x85", + "\xF3\xEC" => "\xE7\xAE\xAA", + "\xF3\xED" => "\xE7\xAE\x9C", + "\xF3\xEE" => "\xE7\xAE\xA2", + "\xF3\xEF" => "\xE7\xAE\xAB", + "\xF3\xF0" => "\xE7\xAE\xB4", + "\xF3\xF1" => "\xE7\xAF\x91", + "\xF3\xF2" => "\xE7\xAF\x81", + "\xF3\xF3" => "\xE7\xAF\x8C", + "\xF3\xF4" => "\xE7\xAF\x9D", + "\xF3\xF5" => "\xE7\xAF\x9A", + "\xF3\xF6" => "\xE7\xAF\xA5", + "\xF3\xF7" => "\xE7\xAF\xA6", + "\xF3\xF8" => "\xE7\xAF\xAA", + "\xF3\xF9" => "\xE7\xB0\x8C", + "\xF3\xFA" => "\xE7\xAF\xBE", + "\xF3\xFB" => "\xE7\xAF\xBC", + "\xF3\xFC" => "\xE7\xB0\x8F", + "\xF3\xFD" => "\xE7\xB0\x96", + "\xF3\xFE" => "\xE7\xB0\x8B", + "\xF4\xA1" => "\xE7\xB0\x9F", + "\xF4\xA2" => "\xE7\xB0\xAA", + "\xF4\xA3" => "\xE7\xB0\xA6", + "\xF4\xA4" => "\xE7\xB0\xB8", + "\xF4\xA5" => "\xE7\xB1\x81", + "\xF4\xA6" => "\xE7\xB1\x80", + "\xF4\xA7" => "\xE8\x87\xBE", + "\xF4\xA8" => "\xE8\x88\x81", + "\xF4\xA9" => "\xE8\x88\x82", + "\xF4\xAA" => "\xE8\x88\x84", + "\xF4\xAB" => "\xE8\x87\xAC", + "\xF4\xAC" => "\xE8\xA1\x84", + "\xF4\xAD" => "\xE8\x88\xA1", + "\xF4\xAE" => "\xE8\x88\xA2", + "\xF4\xAF" => "\xE8\x88\xA3", + "\xF4\xB0" => "\xE8\x88\xAD", + "\xF4\xB1" => "\xE8\x88\xAF", + "\xF4\xB2" => "\xE8\x88\xA8", + "\xF4\xB3" => "\xE8\x88\xAB", + "\xF4\xB4" => "\xE8\x88\xB8", + "\xF4\xB5" => "\xE8\x88\xBB", + "\xF4\xB6" => "\xE8\x88\xB3", + "\xF4\xB7" => "\xE8\x88\xB4", + "\xF4\xB8" => "\xE8\x88\xBE", + "\xF4\xB9" => "\xE8\x89\x84", + "\xF4\xBA" => "\xE8\x89\x89", + "\xF4\xBB" => "\xE8\x89\x8B", + "\xF4\xBC" => "\xE8\x89\x8F", + "\xF4\xBD" => "\xE8\x89\x9A", + "\xF4\xBE" => "\xE8\x89\x9F", + "\xF4\xBF" => "\xE8\x89\xA8", + "\xF4\xC0" => "\xE8\xA1\xBE", + "\xF4\xC1" => "\xE8\xA2\x85", + "\xF4\xC2" => "\xE8\xA2\x88", + "\xF4\xC3" => "\xE8\xA3\x98", + "\xF4\xC4" => "\xE8\xA3\x9F", + "\xF4\xC5" => "\xE8\xA5\x9E", + "\xF4\xC6" => "\xE7\xBE\x9D", + "\xF4\xC7" => "\xE7\xBE\x9F", + "\xF4\xC8" => "\xE7\xBE\xA7", + "\xF4\xC9" => "\xE7\xBE\xAF", + "\xF4\xCA" => "\xE7\xBE\xB0", + "\xF4\xCB" => "\xE7\xBE\xB2", + "\xF4\xCC" => "\xE7\xB1\xBC", + "\xF4\xCD" => "\xE6\x95\x89", + "\xF4\xCE" => "\xE7\xB2\x91", + "\xF4\xCF" => "\xE7\xB2\x9D", + "\xF4\xD0" => "\xE7\xB2\x9C", + "\xF4\xD1" => "\xE7\xB2\x9E", + "\xF4\xD2" => "\xE7\xB2\xA2", + "\xF4\xD3" => "\xE7\xB2\xB2", + "\xF4\xD4" => "\xE7\xB2\xBC", + "\xF4\xD5" => "\xE7\xB2\xBD", + "\xF4\xD6" => "\xE7\xB3\x81", + "\xF4\xD7" => "\xE7\xB3\x87", + "\xF4\xD8" => "\xE7\xB3\x8C", + "\xF4\xD9" => "\xE7\xB3\x8D", + "\xF4\xDA" => "\xE7\xB3\x88", + "\xF4\xDB" => "\xE7\xB3\x85", + "\xF4\xDC" => "\xE7\xB3\x97", + "\xF4\xDD" => "\xE7\xB3\xA8", + "\xF4\xDE" => "\xE8\x89\xAE", + "\xF4\xDF" => "\xE6\x9A\xA8", + "\xF4\xE0" => "\xE7\xBE\xBF", + "\xF4\xE1" => "\xE7\xBF\x8E", + "\xF4\xE2" => "\xE7\xBF\x95", + "\xF4\xE3" => "\xE7\xBF\xA5", + "\xF4\xE4" => "\xE7\xBF\xA1", + "\xF4\xE5" => "\xE7\xBF\xA6", + "\xF4\xE6" => "\xE7\xBF\xA9", + "\xF4\xE7" => "\xE7\xBF\xAE", + "\xF4\xE8" => "\xE7\xBF\xB3", + "\xF4\xE9" => "\xE7\xB3\xB8", + "\xF4\xEA" => "\xE7\xB5\xB7", + "\xF4\xEB" => "\xE7\xB6\xA6", + "\xF4\xEC" => "\xE7\xB6\xAE", + "\xF4\xED" => "\xE7\xB9\x87", + "\xF4\xEE" => "\xE7\xBA\x9B", + "\xF4\xEF" => "\xE9\xBA\xB8", + "\xF4\xF0" => "\xE9\xBA\xB4", + "\xF4\xF1" => "\xE8\xB5\xB3", + "\xF4\xF2" => "\xE8\xB6\x84", + "\xF4\xF3" => "\xE8\xB6\x94", + "\xF4\xF4" => "\xE8\xB6\x91", + "\xF4\xF5" => "\xE8\xB6\xB1", + "\xF4\xF6" => "\xE8\xB5\xA7", + "\xF4\xF7" => "\xE8\xB5\xAD", + "\xF4\xF8" => "\xE8\xB1\x87", + "\xF4\xF9" => "\xE8\xB1\x89", + "\xF4\xFA" => "\xE9\x85\x8A", + "\xF4\xFB" => "\xE9\x85\x90", + "\xF4\xFC" => "\xE9\x85\x8E", + "\xF4\xFD" => "\xE9\x85\x8F", + "\xF4\xFE" => "\xE9\x85\xA4", + "\xF5\xA1" => "\xE9\x85\xA2", + "\xF5\xA2" => "\xE9\x85\xA1", + "\xF5\xA3" => "\xE9\x85\xB0", + "\xF5\xA4" => "\xE9\x85\xA9", + "\xF5\xA5" => "\xE9\x85\xAF", + "\xF5\xA6" => "\xE9\x85\xBD", + "\xF5\xA7" => "\xE9\x85\xBE", + "\xF5\xA8" => "\xE9\x85\xB2", + "\xF5\xA9" => "\xE9\x85\xB4", + "\xF5\xAA" => "\xE9\x85\xB9", + "\xF5\xAB" => "\xE9\x86\x8C", + "\xF5\xAC" => "\xE9\x86\x85", + "\xF5\xAD" => "\xE9\x86\x90", + "\xF5\xAE" => "\xE9\x86\x8D", + "\xF5\xAF" => "\xE9\x86\x91", + "\xF5\xB0" => "\xE9\x86\xA2", + "\xF5\xB1" => "\xE9\x86\xA3", + "\xF5\xB2" => "\xE9\x86\xAA", + "\xF5\xB3" => "\xE9\x86\xAD", + "\xF5\xB4" => "\xE9\x86\xAE", + "\xF5\xB5" => "\xE9\x86\xAF", + "\xF5\xB6" => "\xE9\x86\xB5", + "\xF5\xB7" => "\xE9\x86\xB4", + "\xF5\xB8" => "\xE9\x86\xBA", + "\xF5\xB9" => "\xE8\xB1\x95", + "\xF5\xBA" => "\xE9\xB9\xBE", + "\xF5\xBB" => "\xE8\xB6\xB8", + "\xF5\xBC" => "\xE8\xB7\xAB", + "\xF5\xBD" => "\xE8\xB8\x85", + "\xF5\xBE" => "\xE8\xB9\x99", + "\xF5\xBF" => "\xE8\xB9\xA9", + "\xF5\xC0" => "\xE8\xB6\xB5", + "\xF5\xC1" => "\xE8\xB6\xBF", + "\xF5\xC2" => "\xE8\xB6\xBC", + "\xF5\xC3" => "\xE8\xB6\xBA", + "\xF5\xC4" => "\xE8\xB7\x84", + "\xF5\xC5" => "\xE8\xB7\x96", + "\xF5\xC6" => "\xE8\xB7\x97", + "\xF5\xC7" => "\xE8\xB7\x9A", + "\xF5\xC8" => "\xE8\xB7\x9E", + "\xF5\xC9" => "\xE8\xB7\x8E", + "\xF5\xCA" => "\xE8\xB7\x8F", + "\xF5\xCB" => "\xE8\xB7\x9B", + "\xF5\xCC" => "\xE8\xB7\x86", + "\xF5\xCD" => "\xE8\xB7\xAC", + "\xF5\xCE" => "\xE8\xB7\xB7", + "\xF5\xCF" => "\xE8\xB7\xB8", + "\xF5\xD0" => "\xE8\xB7\xA3", + "\xF5\xD1" => "\xE8\xB7\xB9", + "\xF5\xD2" => "\xE8\xB7\xBB", + "\xF5\xD3" => "\xE8\xB7\xA4", + "\xF5\xD4" => "\xE8\xB8\x89", + "\xF5\xD5" => "\xE8\xB7\xBD", + "\xF5\xD6" => "\xE8\xB8\x94", + "\xF5\xD7" => "\xE8\xB8\x9D", + "\xF5\xD8" => "\xE8\xB8\x9F", + "\xF5\xD9" => "\xE8\xB8\xAC", + "\xF5\xDA" => "\xE8\xB8\xAE", + "\xF5\xDB" => "\xE8\xB8\xA3", + "\xF5\xDC" => "\xE8\xB8\xAF", + "\xF5\xDD" => "\xE8\xB8\xBA", + "\xF5\xDE" => "\xE8\xB9\x80", + "\xF5\xDF" => "\xE8\xB8\xB9", + "\xF5\xE0" => "\xE8\xB8\xB5", + "\xF5\xE1" => "\xE8\xB8\xBD", + "\xF5\xE2" => "\xE8\xB8\xB1", + "\xF5\xE3" => "\xE8\xB9\x89", + "\xF5\xE4" => "\xE8\xB9\x81", + "\xF5\xE5" => "\xE8\xB9\x82", + "\xF5\xE6" => "\xE8\xB9\x91", + "\xF5\xE7" => "\xE8\xB9\x92", + "\xF5\xE8" => "\xE8\xB9\x8A", + "\xF5\xE9" => "\xE8\xB9\xB0", + "\xF5\xEA" => "\xE8\xB9\xB6", + "\xF5\xEB" => "\xE8\xB9\xBC", + "\xF5\xEC" => "\xE8\xB9\xAF", + "\xF5\xED" => "\xE8\xB9\xB4", + "\xF5\xEE" => "\xE8\xBA\x85", + "\xF5\xEF" => "\xE8\xBA\x8F", + "\xF5\xF0" => "\xE8\xBA\x94", + "\xF5\xF1" => "\xE8\xBA\x90", + "\xF5\xF2" => "\xE8\xBA\x9C", + "\xF5\xF3" => "\xE8\xBA\x9E", + "\xF5\xF4" => "\xE8\xB1\xB8", + "\xF5\xF5" => "\xE8\xB2\x82", + "\xF5\xF6" => "\xE8\xB2\x8A", + "\xF5\xF7" => "\xE8\xB2\x85", + "\xF5\xF8" => "\xE8\xB2\x98", + "\xF5\xF9" => "\xE8\xB2\x94", + "\xF5\xFA" => "\xE6\x96\x9B", + "\xF5\xFB" => "\xE8\xA7\x96", + "\xF5\xFC" => "\xE8\xA7\x9E", + "\xF5\xFD" => "\xE8\xA7\x9A", + "\xF5\xFE" => "\xE8\xA7\x9C", + "\xF6\xA1" => "\xE8\xA7\xA5", + "\xF6\xA2" => "\xE8\xA7\xAB", + "\xF6\xA3" => "\xE8\xA7\xAF", + "\xF6\xA4" => "\xE8\xA8\xBE", + "\xF6\xA5" => "\xE8\xAC\xA6", + "\xF6\xA6" => "\xE9\x9D\x93", + "\xF6\xA7" => "\xE9\x9B\xA9", + "\xF6\xA8" => "\xE9\x9B\xB3", + "\xF6\xA9" => "\xE9\x9B\xAF", + "\xF6\xAA" => "\xE9\x9C\x86", + "\xF6\xAB" => "\xE9\x9C\x81", + "\xF6\xAC" => "\xE9\x9C\x88", + "\xF6\xAD" => "\xE9\x9C\x8F", + "\xF6\xAE" => "\xE9\x9C\x8E", + "\xF6\xAF" => "\xE9\x9C\xAA", + "\xF6\xB0" => "\xE9\x9C\xAD", + "\xF6\xB1" => "\xE9\x9C\xB0", + "\xF6\xB2" => "\xE9\x9C\xBE", + "\xF6\xB3" => "\xE9\xBE\x80", + "\xF6\xB4" => "\xE9\xBE\x83", + "\xF6\xB5" => "\xE9\xBE\x85", + "\xF6\xB6" => "\xE9\xBE\x86", + "\xF6\xB7" => "\xE9\xBE\x87", + "\xF6\xB8" => "\xE9\xBE\x88", + "\xF6\xB9" => "\xE9\xBE\x89", + "\xF6\xBA" => "\xE9\xBE\x8A", + "\xF6\xBB" => "\xE9\xBE\x8C", + "\xF6\xBC" => "\xE9\xBB\xBE", + "\xF6\xBD" => "\xE9\xBC\x8B", + "\xF6\xBE" => "\xE9\xBC\x8D", + "\xF6\xBF" => "\xE9\x9A\xB9", + "\xF6\xC0" => "\xE9\x9A\xBC", + "\xF6\xC1" => "\xE9\x9A\xBD", + "\xF6\xC2" => "\xE9\x9B\x8E", + "\xF6\xC3" => "\xE9\x9B\x92", + "\xF6\xC4" => "\xE7\x9E\xBF", + "\xF6\xC5" => "\xE9\x9B\xA0", + "\xF6\xC6" => "\xE9\x8A\x8E", + "\xF6\xC7" => "\xE9\x8A\xAE", + "\xF6\xC8" => "\xE9\x8B\x88", + "\xF6\xC9" => "\xE9\x8C\xBE", + "\xF6\xCA" => "\xE9\x8D\xAA", + "\xF6\xCB" => "\xE9\x8F\x8A", + "\xF6\xCC" => "\xE9\x8E\x8F", + "\xF6\xCD" => "\xE9\x90\xBE", + "\xF6\xCE" => "\xE9\x91\xAB", + "\xF6\xCF" => "\xE9\xB1\xBF", + "\xF6\xD0" => "\xE9\xB2\x82", + "\xF6\xD1" => "\xE9\xB2\x85", + "\xF6\xD2" => "\xE9\xB2\x86", + "\xF6\xD3" => "\xE9\xB2\x87", + "\xF6\xD4" => "\xE9\xB2\x88", + "\xF6\xD5" => "\xE7\xA8\xA3", + "\xF6\xD6" => "\xE9\xB2\x8B", + "\xF6\xD7" => "\xE9\xB2\x8E", + "\xF6\xD8" => "\xE9\xB2\x90", + "\xF6\xD9" => "\xE9\xB2\x91", + "\xF6\xDA" => "\xE9\xB2\x92", + "\xF6\xDB" => "\xE9\xB2\x94", + "\xF6\xDC" => "\xE9\xB2\x95", + "\xF6\xDD" => "\xE9\xB2\x9A", + "\xF6\xDE" => "\xE9\xB2\x9B", + "\xF6\xDF" => "\xE9\xB2\x9E", + "\xF6\xE0" => "\xE9\xB2\x9F", + "\xF6\xE1" => "\xE9\xB2\xA0", + "\xF6\xE2" => "\xE9\xB2\xA1", + "\xF6\xE3" => "\xE9\xB2\xA2", + "\xF6\xE4" => "\xE9\xB2\xA3", + "\xF6\xE5" => "\xE9\xB2\xA5", + "\xF6\xE6" => "\xE9\xB2\xA6", + "\xF6\xE7" => "\xE9\xB2\xA7", + "\xF6\xE8" => "\xE9\xB2\xA8", + "\xF6\xE9" => "\xE9\xB2\xA9", + "\xF6\xEA" => "\xE9\xB2\xAB", + "\xF6\xEB" => "\xE9\xB2\xAD", + "\xF6\xEC" => "\xE9\xB2\xAE", + "\xF6\xED" => "\xE9\xB2\xB0", + "\xF6\xEE" => "\xE9\xB2\xB1", + "\xF6\xEF" => "\xE9\xB2\xB2", + "\xF6\xF0" => "\xE9\xB2\xB3", + "\xF6\xF1" => "\xE9\xB2\xB4", + "\xF6\xF2" => "\xE9\xB2\xB5", + "\xF6\xF3" => "\xE9\xB2\xB6", + "\xF6\xF4" => "\xE9\xB2\xB7", + "\xF6\xF5" => "\xE9\xB2\xBA", + "\xF6\xF6" => "\xE9\xB2\xBB", + "\xF6\xF7" => "\xE9\xB2\xBC", + "\xF6\xF8" => "\xE9\xB2\xBD", + "\xF6\xF9" => "\xE9\xB3\x84", + "\xF6\xFA" => "\xE9\xB3\x85", + "\xF6\xFB" => "\xE9\xB3\x86", + "\xF6\xFC" => "\xE9\xB3\x87", + "\xF6\xFD" => "\xE9\xB3\x8A", + "\xF6\xFE" => "\xE9\xB3\x8B", + "\xF7\xA1" => "\xE9\xB3\x8C", + "\xF7\xA2" => "\xE9\xB3\x8D", + "\xF7\xA3" => "\xE9\xB3\x8E", + "\xF7\xA4" => "\xE9\xB3\x8F", + "\xF7\xA5" => "\xE9\xB3\x90", + "\xF7\xA6" => "\xE9\xB3\x93", + "\xF7\xA7" => "\xE9\xB3\x94", + "\xF7\xA8" => "\xE9\xB3\x95", + "\xF7\xA9" => "\xE9\xB3\x97", + "\xF7\xAA" => "\xE9\xB3\x98", + "\xF7\xAB" => "\xE9\xB3\x99", + "\xF7\xAC" => "\xE9\xB3\x9C", + "\xF7\xAD" => "\xE9\xB3\x9D", + "\xF7\xAE" => "\xE9\xB3\x9F", + "\xF7\xAF" => "\xE9\xB3\xA2", + "\xF7\xB0" => "\xE9\x9D\xBC", + "\xF7\xB1" => "\xE9\x9E\x85", + "\xF7\xB2" => "\xE9\x9E\x91", + "\xF7\xB3" => "\xE9\x9E\x92", + "\xF7\xB4" => "\xE9\x9E\x94", + "\xF7\xB5" => "\xE9\x9E\xAF", + "\xF7\xB6" => "\xE9\x9E\xAB", + "\xF7\xB7" => "\xE9\x9E\xA3", + "\xF7\xB8" => "\xE9\x9E\xB2", + "\xF7\xB9" => "\xE9\x9E\xB4", + "\xF7\xBA" => "\xE9\xAA\xB1", + "\xF7\xBB" => "\xE9\xAA\xB0", + "\xF7\xBC" => "\xE9\xAA\xB7", + "\xF7\xBD" => "\xE9\xB9\x98", + "\xF7\xBE" => "\xE9\xAA\xB6", + "\xF7\xBF" => "\xE9\xAA\xBA", + "\xF7\xC0" => "\xE9\xAA\xBC", + "\xF7\xC1" => "\xE9\xAB\x81", + "\xF7\xC2" => "\xE9\xAB\x80", + "\xF7\xC3" => "\xE9\xAB\x85", + "\xF7\xC4" => "\xE9\xAB\x82", + "\xF7\xC5" => "\xE9\xAB\x8B", + "\xF7\xC6" => "\xE9\xAB\x8C", + "\xF7\xC7" => "\xE9\xAB\x91", + "\xF7\xC8" => "\xE9\xAD\x85", + "\xF7\xC9" => "\xE9\xAD\x83", + "\xF7\xCA" => "\xE9\xAD\x87", + "\xF7\xCB" => "\xE9\xAD\x89", + "\xF7\xCC" => "\xE9\xAD\x88", + "\xF7\xCD" => "\xE9\xAD\x8D", + "\xF7\xCE" => "\xE9\xAD\x91", + "\xF7\xCF" => "\xE9\xA3\xA8", + "\xF7\xD0" => "\xE9\xA4\x8D", + "\xF7\xD1" => "\xE9\xA4\xAE", + "\xF7\xD2" => "\xE9\xA5\x95", + "\xF7\xD3" => "\xE9\xA5\x94", + "\xF7\xD4" => "\xE9\xAB\x9F", + "\xF7\xD5" => "\xE9\xAB\xA1", + "\xF7\xD6" => "\xE9\xAB\xA6", + "\xF7\xD7" => "\xE9\xAB\xAF", + "\xF7\xD8" => "\xE9\xAB\xAB", + "\xF7\xD9" => "\xE9\xAB\xBB", + "\xF7\xDA" => "\xE9\xAB\xAD", + "\xF7\xDB" => "\xE9\xAB\xB9", + "\xF7\xDC" => "\xE9\xAC\x88", + "\xF7\xDD" => "\xE9\xAC\x8F", + "\xF7\xDE" => "\xE9\xAC\x93", + "\xF7\xDF" => "\xE9\xAC\x9F", + "\xF7\xE0" => "\xE9\xAC\xA3", + "\xF7\xE1" => "\xE9\xBA\xBD", + "\xF7\xE2" => "\xE9\xBA\xBE", + "\xF7\xE3" => "\xE7\xB8\xBB", + "\xF7\xE4" => "\xE9\xBA\x82", + "\xF7\xE5" => "\xE9\xBA\x87", + "\xF7\xE6" => "\xE9\xBA\x88", + "\xF7\xE7" => "\xE9\xBA\x8B", + "\xF7\xE8" => "\xE9\xBA\x92", + "\xF7\xE9" => "\xE9\x8F\x96", + "\xF7\xEA" => "\xE9\xBA\x9D", + "\xF7\xEB" => "\xE9\xBA\x9F", + "\xF7\xEC" => "\xE9\xBB\x9B", + "\xF7\xED" => "\xE9\xBB\x9C", + "\xF7\xEE" => "\xE9\xBB\x9D", + "\xF7\xEF" => "\xE9\xBB\xA0", + "\xF7\xF0" => "\xE9\xBB\x9F", + "\xF7\xF1" => "\xE9\xBB\xA2", + "\xF7\xF2" => "\xE9\xBB\xA9", + "\xF7\xF3" => "\xE9\xBB\xA7", + "\xF7\xF4" => "\xE9\xBB\xA5", + "\xF7\xF5" => "\xE9\xBB\xAA", + "\xF7\xF6" => "\xE9\xBB\xAF", + "\xF7\xF7" => "\xE9\xBC\xA2", + "\xF7\xF8" => "\xE9\xBC\xAC", + "\xF7\xF9" => "\xE9\xBC\xAF", + "\xF7\xFA" => "\xE9\xBC\xB9", + "\xF7\xFB" => "\xE9\xBC\xB7", + "\xF7\xFC" => "\xE9\xBC\xBD", + "\xF7\xFD" => "\xE9\xBC\xBE", + "\xF7\xFE" => "\xE9\xBD\x84", + ); + return strtr($string, $transform); +} + +function sjis($string) +{ + static $transform = array( + "\x5C"=>"\xC2\xA5", + "\x7E"=>"\xE2\x80\xBE", + "\x81\x40"=>"\xE3\x80\x80", + "\x81\x41"=>"\xE3\x80\x81", + "\x81\x42"=>"\xE3\x80\x82", + "\x81\x43"=>"\xEF\xBC\x8C", + "\x81\x44"=>"\xEF\xBC\x8E", + "\x81\x45"=>"\xE3\x83\xBB", + "\x81\x46"=>"\xEF\xBC\x9A", + "\x81\x47"=>"\xEF\xBC\x9B", + "\x81\x48"=>"\xEF\xBC\x9F", + "\x81\x49"=>"\xEF\xBC\x81", + "\x81\x4A"=>"\xE3\x82\x9B", + "\x81\x4B"=>"\xE3\x82\x9C", + "\x81\x4C"=>"\xC2\xB4", + "\x81\x4D"=>"\xEF\xBD\x80", + "\x81\x4E"=>"\xC2\xA8", + "\x81\x4F"=>"\xEF\xBC\xBE", + "\x81\x50"=>"\xEF\xBF\xA3", + "\x81\x51"=>"\xEF\xBC\xBF", + "\x81\x52"=>"\xE3\x83\xBD", + "\x81\x53"=>"\xE3\x83\xBE", + "\x81\x54"=>"\xE3\x82\x9D", + "\x81\x55"=>"\xE3\x82\x9E", + "\x81\x56"=>"\xE3\x80\x83", + "\x81\x57"=>"\xE4\xBB\x9D", + "\x81\x58"=>"\xE3\x80\x85", + "\x81\x59"=>"\xE3\x80\x86", + "\x81\x5A"=>"\xE3\x80\x87", + "\x81\x5B"=>"\xE3\x83\xBC", + "\x81\x5C"=>"\xE2\x80\x95", // set as U+2015 but could be U+2014 + "\x81\x5D"=>"\xE2\x80\x90", + "\x81\x5E"=>"\xEF\xBC\x8F", + "\x81\x5F"=>"\xEF\xBC\xBC", // or U+005C + "\x81\x60"=>"\xE3\x80\x9C", + "\x81\x61"=>"\xE2\x80\x96", + "\x81\x62"=>"\xEF\xBD\x9C", + "\x81\x63"=>"\xE2\x80\xA6", + "\x81\x64"=>"\xE2\x80\xA5", + "\x81\x65"=>"\xE2\x80\x98", + "\x81\x66"=>"\xE2\x80\x99", + "\x81\x67"=>"\xE2\x80\x9C", + "\x81\x68"=>"\xE2\x80\x9D", + "\x81\x69"=>"\xEF\xBC\x88", + "\x81\x6A"=>"\xEF\xBC\x89", + "\x81\x6B"=>"\xE3\x80\x94", + "\x81\x6C"=>"\xE3\x80\x95", + "\x81\x6D"=>"\xEF\xBC\xBB", + "\x81\x6E"=>"\xEF\xBC\xBD", + "\x81\x6F"=>"\xEF\xBD\x9B", + "\x81\x70"=>"\xEF\xBD\x9D", + "\x81\x71"=>"\xE3\x80\x88", + "\x81\x72"=>"\xE3\x80\x89", + "\x81\x73"=>"\xE3\x80\x8A", + "\x81\x74"=>"\xE3\x80\x8B", + "\x81\x75"=>"\xE3\x80\x8C", + "\x81\x76"=>"\xE3\x80\x8D", + "\x81\x77"=>"\xE3\x80\x8E", + "\x81\x78"=>"\xE3\x80\x8F", + "\x81\x79"=>"\xE3\x80\x90", + "\x81\x7A"=>"\xE3\x80\x91", + "\x81\x7B"=>"\xEF\xBC\x8B", + "\x81\x7C"=>"\xE2\x88\x92", + "\x81\x7D"=>"\xC2\xB1", + "\x81\x7E"=>"\xC3\x97", + "\x81\x80"=>"\xC3\xB7", + "\x81\x81"=>"\xEF\xBC\x9D", + "\x81\x82"=>"\xE2\x89\xA0", + "\x81\x83"=>"\xEF\xBC\x9C", + "\x81\x84"=>"\xEF\xBC\x9E", + "\x81\x85"=>"\xE2\x89\xA6", + "\x81\x86"=>"\xE2\x89\xA7", + "\x81\x87"=>"\xE2\x88\x9E", + "\x81\x88"=>"\xE2\x88\xB4", + "\x81\x89"=>"\xE2\x99\x82", + "\x81\x8A"=>"\xE2\x99\x80", + "\x81\x8B"=>"\xC2\xB0", + "\x81\x8C"=>"\xE2\x80\xB2", + "\x81\x8D"=>"\xE2\x80\xB3", + "\x81\x8E"=>"\xE2\x84\x83", + "\x81\x8F"=>"\xEF\xBF\xA5", + "\x81\x90"=>"\xEF\xBC\x84", + "\x81\x91"=>"\xC2\xA2", + "\x81\x92"=>"\xC2\xA3", + "\x81\x93"=>"\xEF\xBC\x85", + "\x81\x94"=>"\xEF\xBC\x83", + "\x81\x95"=>"\xEF\xBC\x86", + "\x81\x96"=>"\xEF\xBC\x8A", + "\x81\x97"=>"\xEF\xBC\xA0", + "\x81\x98"=>"\xC2\xA7", + "\x81\x99"=>"\xE2\x98\x86", + "\x81\x9A"=>"\xE2\x98\x85", + "\x81\x9B"=>"\xE2\x97\x8B", + "\x81\x9C"=>"\xE2\x97\x8F", + "\x81\x9D"=>"\xE2\x97\x8E", + "\x81\x9E"=>"\xE2\x97\x87", + "\x81\x9F"=>"\xE2\x97\x86", + "\x81\xA0"=>"\xE2\x96\xA1", + "\x81\xA1"=>"\xE2\x96\xA0", + "\x81\xA2"=>"\xE2\x96\xB3", + "\x81\xA3"=>"\xE2\x96\xB2", + "\x81\xA4"=>"\xE2\x96\xBD", + "\x81\xA5"=>"\xE2\x96\xBC", + "\x81\xA6"=>"\xE2\x80\xBB", + "\x81\xA7"=>"\xE3\x80\x92", + "\x81\xA8"=>"\xE2\x86\x92", + "\x81\xA9"=>"\xE2\x86\x90", + "\x81\xAA"=>"\xE2\x86\x91", + "\x81\xAB"=>"\xE2\x86\x93", + "\x81\xAC"=>"\xE3\x80\x93", + "\x81\xAD"=>"\xEF\xBC\x87", // extra?! + "\x81\xB8"=>"\xE2\x88\x88", + "\x81\xB9"=>"\xE2\x88\x8B", + "\x81\xBA"=>"\xE2\x8A\x86", + "\x81\xBB"=>"\xE2\x8A\x87", + "\x81\xBC"=>"\xE2\x8A\x82", + "\x81\xBD"=>"\xE2\x8A\x83", + "\x81\xBE"=>"\xE2\x88\xAA", + "\x81\xBF"=>"\xE2\x88\xA9", + "\x81\xC8"=>"\xE2\x88\xA7", + "\x81\xC9"=>"\xE2\x88\xA8", + "\x81\xCA"=>"\xC2\xAC", + "\x81\xCB"=>"\xE2\x87\x92", + "\x81\xCC"=>"\xE2\x87\x94", + "\x81\xCD"=>"\xE2\x88\x80", + "\x81\xCE"=>"\xE2\x88\x83", + "\x81\xDA"=>"\xE2\x88\xA0", + "\x81\xDB"=>"\xE2\x8A\xA5", + "\x81\xDC"=>"\xE2\x8C\x92", + "\x81\xDD"=>"\xE2\x88\x82", + "\x81\xDE"=>"\xE2\x88\x87", + "\x81\xDF"=>"\xE2\x89\xA1", + "\x81\xE0"=>"\xE2\x89\x92", + "\x81\xE1"=>"\xE2\x89\xAA", + "\x81\xE2"=>"\xE2\x89\xAB", + "\x81\xE3"=>"\xE2\x88\x9A", + "\x81\xE4"=>"\xE2\x88\xBD", + "\x81\xE5"=>"\xE2\x88\x9D", + "\x81\xE6"=>"\xE2\x88\xB5", + "\x81\xE7"=>"\xE2\x88\xAB", + "\x81\xE8"=>"\xE2\x88\xAC", + "\x81\xF0"=>"\xE2\x84\xAB", + "\x81\xF1"=>"\xE2\x80\xB0", + "\x81\xF2"=>"\xE2\x99\xAF", + "\x81\xF3"=>"\xE2\x99\xAD", + "\x81\xF4"=>"\xE2\x99\xAA", + "\x81\xF5"=>"\xE2\x80\xA0", + "\x81\xF6"=>"\xE2\x80\xA1", + "\x81\xF7"=>"\xC2\xB6", + "\x81\xFC"=>"\xE2\x97\xAF", + "\x82\x4F"=>"\xEF\xBC\x90", + "\x82\x50"=>"\xEF\xBC\x91", + "\x82\x51"=>"\xEF\xBC\x92", + "\x82\x52"=>"\xEF\xBC\x93", + "\x82\x53"=>"\xEF\xBC\x94", + "\x82\x54"=>"\xEF\xBC\x95", + "\x82\x55"=>"\xEF\xBC\x96", + "\x82\x56"=>"\xEF\xBC\x97", + "\x82\x57"=>"\xEF\xBC\x98", + "\x82\x58"=>"\xEF\xBC\x99", + "\x82\x60"=>"\xEF\xBC\xA1", + "\x82\x61"=>"\xEF\xBC\xA2", + "\x82\x62"=>"\xEF\xBC\xA3", + "\x82\x63"=>"\xEF\xBC\xA4", + "\x82\x64"=>"\xEF\xBC\xA5", + "\x82\x65"=>"\xEF\xBC\xA6", + "\x82\x66"=>"\xEF\xBC\xA7", + "\x82\x67"=>"\xEF\xBC\xA8", + "\x82\x68"=>"\xEF\xBC\xA9", + "\x82\x69"=>"\xEF\xBC\xAA", + "\x82\x6A"=>"\xEF\xBC\xAB", + "\x82\x6B"=>"\xEF\xBC\xAC", + "\x82\x6C"=>"\xEF\xBC\xAD", + "\x82\x6D"=>"\xEF\xBC\xAE", + "\x82\x6E"=>"\xEF\xBC\xAF", + "\x82\x6F"=>"\xEF\xBC\xB0", + "\x82\x70"=>"\xEF\xBC\xB1", + "\x82\x71"=>"\xEF\xBC\xB2", + "\x82\x72"=>"\xEF\xBC\xB3", + "\x82\x73"=>"\xEF\xBC\xB4", + "\x82\x74"=>"\xEF\xBC\xB5", + "\x82\x75"=>"\xEF\xBC\xB6", + "\x82\x76"=>"\xEF\xBC\xB7", + "\x82\x77"=>"\xEF\xBC\xB8", + "\x82\x78"=>"\xEF\xBC\xB9", + "\x82\x79"=>"\xEF\xBC\xBA", + "\x82\x81"=>"\xEF\xBD\x81", + "\x82\x82"=>"\xEF\xBD\x82", + "\x82\x83"=>"\xEF\xBD\x83", + "\x82\x84"=>"\xEF\xBD\x84", + "\x82\x85"=>"\xEF\xBD\x85", + "\x82\x86"=>"\xEF\xBD\x86", + "\x82\x87"=>"\xEF\xBD\x87", + "\x82\x88"=>"\xEF\xBD\x88", + "\x82\x89"=>"\xEF\xBD\x89", + "\x82\x8A"=>"\xEF\xBD\x8A", + "\x82\x8B"=>"\xEF\xBD\x8B", + "\x82\x8C"=>"\xEF\xBD\x8C", + "\x82\x8D"=>"\xEF\xBD\x8D", + "\x82\x8E"=>"\xEF\xBD\x8E", + "\x82\x8F"=>"\xEF\xBD\x8F", + "\x82\x90"=>"\xEF\xBD\x90", + "\x82\x91"=>"\xEF\xBD\x91", + "\x82\x92"=>"\xEF\xBD\x92", + "\x82\x93"=>"\xEF\xBD\x93", + "\x82\x94"=>"\xEF\xBD\x94", + "\x82\x95"=>"\xEF\xBD\x95", + "\x82\x96"=>"\xEF\xBD\x96", + "\x82\x97"=>"\xEF\xBD\x97", + "\x82\x98"=>"\xEF\xBD\x98", + "\x82\x99"=>"\xEF\xBD\x99", + "\x82\x9A"=>"\xEF\xBD\x9A", + "\x82\x9F"=>"\xE3\x81\x81", + "\x82\xA0"=>"\xE3\x81\x82", + "\x82\xA1"=>"\xE3\x81\x83", + "\x82\xA2"=>"\xE3\x81\x84", + "\x82\xA3"=>"\xE3\x81\x85", + "\x82\xA4"=>"\xE3\x81\x86", + "\x82\xA5"=>"\xE3\x81\x87", + "\x82\xA6"=>"\xE3\x81\x88", + "\x82\xA7"=>"\xE3\x81\x89", + "\x82\xA8"=>"\xE3\x81\x8A", + "\x82\xA9"=>"\xE3\x81\x8B", + "\x82\xAA"=>"\xE3\x81\x8C", + "\x82\xAB"=>"\xE3\x81\x8D", + "\x82\xAC"=>"\xE3\x81\x8E", + "\x82\xAD"=>"\xE3\x81\x8F", + "\x82\xAE"=>"\xE3\x81\x90", + "\x82\xAF"=>"\xE3\x81\x91", + "\x82\xB0"=>"\xE3\x81\x92", + "\x82\xB1"=>"\xE3\x81\x93", + "\x82\xB2"=>"\xE3\x81\x94", + "\x82\xB3"=>"\xE3\x81\x95", + "\x82\xB4"=>"\xE3\x81\x96", + "\x82\xB5"=>"\xE3\x81\x97", + "\x82\xB6"=>"\xE3\x81\x98", + "\x82\xB7"=>"\xE3\x81\x99", + "\x82\xB8"=>"\xE3\x81\x9A", + "\x82\xB9"=>"\xE3\x81\x9B", + "\x82\xBA"=>"\xE3\x81\x9C", + "\x82\xBB"=>"\xE3\x81\x9D", + "\x82\xBC"=>"\xE3\x81\x9E", + "\x82\xBD"=>"\xE3\x81\x9F", + "\x82\xBE"=>"\xE3\x81\xA0", + "\x82\xBF"=>"\xE3\x81\xA1", + "\x82\xC0"=>"\xE3\x81\xA2", + "\x82\xC1"=>"\xE3\x81\xA3", + "\x82\xC2"=>"\xE3\x81\xA4", + "\x82\xC3"=>"\xE3\x81\xA5", + "\x82\xC4"=>"\xE3\x81\xA6", + "\x82\xC5"=>"\xE3\x81\xA7", + "\x82\xC6"=>"\xE3\x81\xA8", + "\x82\xC7"=>"\xE3\x81\xA9", + "\x82\xC8"=>"\xE3\x81\xAA", + "\x82\xC9"=>"\xE3\x81\xAB", + "\x82\xCA"=>"\xE3\x81\xAC", + "\x82\xCB"=>"\xE3\x81\xAD", + "\x82\xCC"=>"\xE3\x81\xAE", + "\x82\xCD"=>"\xE3\x81\xAF", + "\x82\xCE"=>"\xE3\x81\xB0", + "\x82\xCF"=>"\xE3\x81\xB1", + "\x82\xD0"=>"\xE3\x81\xB2", + "\x82\xD1"=>"\xE3\x81\xB3", + "\x82\xD2"=>"\xE3\x81\xB4", + "\x82\xD3"=>"\xE3\x81\xB5", + "\x82\xD4"=>"\xE3\x81\xB6", + "\x82\xD5"=>"\xE3\x81\xB7", + "\x82\xD6"=>"\xE3\x81\xB8", + "\x82\xD7"=>"\xE3\x81\xB9", + "\x82\xD8"=>"\xE3\x81\xBA", + "\x82\xD9"=>"\xE3\x81\xBB", + "\x82\xDA"=>"\xE3\x81\xBC", + "\x82\xDB"=>"\xE3\x81\xBD", + "\x82\xDC"=>"\xE3\x81\xBE", + "\x82\xDD"=>"\xE3\x81\xBF", + "\x82\xDE"=>"\xE3\x82\x80", + "\x82\xDF"=>"\xE3\x82\x81", + "\x82\xE0"=>"\xE3\x82\x82", + "\x82\xE1"=>"\xE3\x82\x83", + "\x82\xE2"=>"\xE3\x82\x84", + "\x82\xE3"=>"\xE3\x82\x85", + "\x82\xE4"=>"\xE3\x82\x86", + "\x82\xE5"=>"\xE3\x82\x87", + "\x82\xE6"=>"\xE3\x82\x88", + "\x82\xE7"=>"\xE3\x82\x89", + "\x82\xE8"=>"\xE3\x82\x8A", + "\x82\xE9"=>"\xE3\x82\x8B", + "\x82\xEA"=>"\xE3\x82\x8C", + "\x82\xEB"=>"\xE3\x82\x8D", + "\x82\xEC"=>"\xE3\x82\x8E", + "\x82\xED"=>"\xE3\x82\x8F", + "\x82\xEE"=>"\xE3\x82\x90", + "\x82\xEF"=>"\xE3\x82\x91", + "\x82\xF0"=>"\xE3\x82\x92", + "\x82\xF1"=>"\xE3\x82\x93", + "\x83\x40"=>"\xE3\x82\xA1", + "\x83\x41"=>"\xE3\x82\xA2", + "\x83\x42"=>"\xE3\x82\xA3", + "\x83\x43"=>"\xE3\x82\xA4", + "\x83\x44"=>"\xE3\x82\xA5", + "\x83\x45"=>"\xE3\x82\xA6", + "\x83\x46"=>"\xE3\x82\xA7", + "\x83\x47"=>"\xE3\x82\xA8", + "\x83\x48"=>"\xE3\x82\xA9", + "\x83\x49"=>"\xE3\x82\xAA", + "\x83\x4A"=>"\xE3\x82\xAB", + "\x83\x4B"=>"\xE3\x82\xAC", + "\x83\x4C"=>"\xE3\x82\xAD", + "\x83\x4D"=>"\xE3\x82\xAE", + "\x83\x4E"=>"\xE3\x82\xAF", + "\x83\x4F"=>"\xE3\x82\xB0", + "\x83\x50"=>"\xE3\x82\xB1", + "\x83\x51"=>"\xE3\x82\xB2", + "\x83\x52"=>"\xE3\x82\xB3", + "\x83\x53"=>"\xE3\x82\xB4", + "\x83\x54"=>"\xE3\x82\xB5", + "\x83\x55"=>"\xE3\x82\xB6", + "\x83\x56"=>"\xE3\x82\xB7", + "\x83\x57"=>"\xE3\x82\xB8", + "\x83\x58"=>"\xE3\x82\xB9", + "\x83\x59"=>"\xE3\x82\xBA", + "\x83\x5A"=>"\xE3\x82\xBB", + "\x83\x5B"=>"\xE3\x82\xBC", + "\x83\x5C"=>"\xE3\x82\xBD", + "\x83\x5D"=>"\xE3\x82\xBE", + "\x83\x5E"=>"\xE3\x82\xBF", + "\x83\x5F"=>"\xE3\x83\x80", + "\x83\x60"=>"\xE3\x83\x81", + "\x83\x61"=>"\xE3\x83\x82", + "\x83\x62"=>"\xE3\x83\x83", + "\x83\x63"=>"\xE3\x83\x84", + "\x83\x64"=>"\xE3\x83\x85", + "\x83\x65"=>"\xE3\x83\x86", + "\x83\x66"=>"\xE3\x83\x87", + "\x83\x67"=>"\xE3\x83\x88", + "\x83\x68"=>"\xE3\x83\x89", + "\x83\x69"=>"\xE3\x83\x8A", + "\x83\x6A"=>"\xE3\x83\x8B", + "\x83\x6B"=>"\xE3\x83\x8C", + "\x83\x6C"=>"\xE3\x83\x8D", + "\x83\x6D"=>"\xE3\x83\x8E", + "\x83\x6E"=>"\xE3\x83\x8F", + "\x83\x6F"=>"\xE3\x83\x90", + "\x83\x70"=>"\xE3\x83\x91", + "\x83\x71"=>"\xE3\x83\x92", + "\x83\x72"=>"\xE3\x83\x93", + "\x83\x73"=>"\xE3\x83\x94", + "\x83\x74"=>"\xE3\x83\x95", + "\x83\x75"=>"\xE3\x83\x96", + "\x83\x76"=>"\xE3\x83\x97", + "\x83\x77"=>"\xE3\x83\x98", + "\x83\x78"=>"\xE3\x83\x99", + "\x83\x79"=>"\xE3\x83\x9A", + "\x83\x7A"=>"\xE3\x83\x9B", + "\x83\x7B"=>"\xE3\x83\x9C", + "\x83\x7C"=>"\xE3\x83\x9D", + "\x83\x7D"=>"\xE3\x83\x9E", + "\x83\x7E"=>"\xE3\x83\x9F", + "\x83\x80"=>"\xE3\x83\xA0", + "\x83\x81"=>"\xE3\x83\xA1", + "\x83\x82"=>"\xE3\x83\xA2", + "\x83\x83"=>"\xE3\x83\xA3", + "\x83\x84"=>"\xE3\x83\xA4", + "\x83\x85"=>"\xE3\x83\xA5", + "\x83\x86"=>"\xE3\x83\xA6", + "\x83\x87"=>"\xE3\x83\xA7", + "\x83\x88"=>"\xE3\x83\xA8", + "\x83\x89"=>"\xE3\x83\xA9", + "\x83\x8A"=>"\xE3\x83\xAA", + "\x83\x8B"=>"\xE3\x83\xAB", + "\x83\x8C"=>"\xE3\x83\xAC", + "\x83\x8D"=>"\xE3\x83\xAD", + "\x83\x8E"=>"\xE3\x83\xAE", + "\x83\x8F"=>"\xE3\x83\xAF", + "\x83\x90"=>"\xE3\x83\xB0", + "\x83\x91"=>"\xE3\x83\xB1", + "\x83\x92"=>"\xE3\x83\xB2", + "\x83\x93"=>"\xE3\x83\xB3", + "\x83\x94"=>"\xE3\x83\xB4", + "\x83\x95"=>"\xE3\x83\xB5", + "\x83\x96"=>"\xE3\x83\xB6", + "\x83\x9F"=>"\xCE\x91", + "\x83\xA0"=>"\xCE\x92", + "\x83\xA1"=>"\xCE\x93", + "\x83\xA2"=>"\xCE\x94", + "\x83\xA3"=>"\xCE\x95", + "\x83\xA4"=>"\xCE\x96", + "\x83\xA5"=>"\xCE\x97", + "\x83\xA6"=>"\xCE\x98", + "\x83\xA7"=>"\xCE\x99", + "\x83\xA8"=>"\xCE\x9A", + "\x83\xA9"=>"\xCE\x9B", + "\x83\xAA"=>"\xCE\x9C", + "\x83\xAB"=>"\xCE\x9D", + "\x83\xAC"=>"\xCE\x9E", + "\x83\xAD"=>"\xCE\x9F", + "\x83\xAE"=>"\xCE\xA0", + "\x83\xAF"=>"\xCE\xA1", + "\x83\xB0"=>"\xCE\xA3", + "\x83\xB1"=>"\xCE\xA4", + "\x83\xB2"=>"\xCE\xA5", + "\x83\xB3"=>"\xCE\xA6", + "\x83\xB4"=>"\xCE\xA7", + "\x83\xB5"=>"\xCE\xA8", + "\x83\xB6"=>"\xCE\xA9", + "\x83\xBF"=>"\xCE\xB1", + "\x83\xC0"=>"\xCE\xB2", + "\x83\xC1"=>"\xCE\xB3", + "\x83\xC2"=>"\xCE\xB4", + "\x83\xC3"=>"\xCE\xB5", + "\x83\xC4"=>"\xCE\xB6", + "\x83\xC5"=>"\xCE\xB7", + "\x83\xC6"=>"\xCE\xB8", + "\x83\xC7"=>"\xCE\xB9", + "\x83\xC8"=>"\xCE\xBA", + "\x83\xC9"=>"\xCE\xBB", + "\x83\xCA"=>"\xCE\xBC", + "\x83\xCB"=>"\xCE\xBD", + "\x83\xCC"=>"\xCE\xBE", + "\x83\xCD"=>"\xCE\xBF", + "\x83\xCE"=>"\xCF\x80", + "\x83\xCF"=>"\xCF\x81", + "\x83\xD0"=>"\xCF\x83", + "\x83\xD1"=>"\xCF\x84", + "\x83\xD2"=>"\xCF\x85", + "\x83\xD3"=>"\xCF\x86", + "\x83\xD4"=>"\xCF\x87", + "\x83\xD5"=>"\xCF\x88", + "\x83\xD6"=>"\xCF\x89", + "\x84\x40"=>"\xD0\x90", + "\x84\x41"=>"\xD0\x91", + "\x84\x42"=>"\xD0\x92", + "\x84\x43"=>"\xD0\x93", + "\x84\x44"=>"\xD0\x94", + "\x84\x45"=>"\xD0\x95", + "\x84\x46"=>"\xD0\x81", + "\x84\x47"=>"\xD0\x96", + "\x84\x48"=>"\xD0\x97", + "\x84\x49"=>"\xD0\x98", + "\x84\x4A"=>"\xD0\x99", + "\x84\x4B"=>"\xD0\x9A", + "\x84\x4C"=>"\xD0\x9B", + "\x84\x4D"=>"\xD0\x9C", + "\x84\x4E"=>"\xD0\x9D", + "\x84\x4F"=>"\xD0\x9E", + "\x84\x50"=>"\xD0\x9F", + "\x84\x51"=>"\xD0\xA0", + "\x84\x52"=>"\xD0\xA1", + "\x84\x53"=>"\xD0\xA2", + "\x84\x54"=>"\xD0\xA3", + "\x84\x55"=>"\xD0\xA4", + "\x84\x56"=>"\xD0\xA5", + "\x84\x57"=>"\xD0\xA6", + "\x84\x58"=>"\xD0\xA7", + "\x84\x59"=>"\xD0\xA8", + "\x84\x5A"=>"\xD0\xA9", + "\x84\x5B"=>"\xD0\xAA", + "\x84\x5C"=>"\xD0\xAB", + "\x84\x5D"=>"\xD0\xAC", + "\x84\x5E"=>"\xD0\xAD", + "\x84\x5F"=>"\xD0\xAE", + "\x84\x60"=>"\xD0\xAF", + "\x84\x70"=>"\xD0\xB0", + "\x84\x71"=>"\xD0\xB1", + "\x84\x72"=>"\xD0\xB2", + "\x84\x73"=>"\xD0\xB3", + "\x84\x74"=>"\xD0\xB4", + "\x84\x75"=>"\xD0\xB5", + "\x84\x76"=>"\xD1\x91", + "\x84\x77"=>"\xD0\xB6", + "\x84\x78"=>"\xD0\xB7", + "\x84\x79"=>"\xD0\xB8", + "\x84\x7A"=>"\xD0\xB9", + "\x84\x7B"=>"\xD0\xBA", + "\x84\x7C"=>"\xD0\xBB", + "\x84\x7D"=>"\xD0\xBC", + "\x84\x7E"=>"\xD0\xBD", + "\x84\x80"=>"\xD0\xBE", + "\x84\x81"=>"\xD0\xBF", + "\x84\x82"=>"\xD1\x80", + "\x84\x83"=>"\xD1\x81", + "\x84\x84"=>"\xD1\x82", + "\x84\x85"=>"\xD1\x83", + "\x84\x86"=>"\xD1\x84", + "\x84\x87"=>"\xD1\x85", + "\x84\x88"=>"\xD1\x86", + "\x84\x89"=>"\xD1\x87", + "\x84\x8A"=>"\xD1\x88", + "\x84\x8B"=>"\xD1\x89", + "\x84\x8C"=>"\xD1\x8A", + "\x84\x8D"=>"\xD1\x8B", + "\x84\x8E"=>"\xD1\x8C", + "\x84\x8F"=>"\xD1\x8D", + "\x84\x90"=>"\xD1\x8E", + "\x84\x91"=>"\xD1\x8F", + "\x84\x9F"=>"\xE2\x94\x80", + "\x84\xA0"=>"\xE2\x94\x82", + "\x84\xA1"=>"\xE2\x94\x8C", + "\x84\xA2"=>"\xE2\x94\x90", + "\x84\xA3"=>"\xE2\x94\x98", + "\x84\xA4"=>"\xE2\x94\x94", + "\x84\xA5"=>"\xE2\x94\x9C", + "\x84\xA6"=>"\xE2\x94\xAC", + "\x84\xA7"=>"\xE2\x94\xA4", + "\x84\xA8"=>"\xE2\x94\xB4", + "\x84\xA9"=>"\xE2\x94\xBC", + "\x84\xAA"=>"\xE2\x94\x81", + "\x84\xAB"=>"\xE2\x94\x83", + "\x84\xAC"=>"\xE2\x94\x8F", + "\x84\xAD"=>"\xE2\x94\x93", + "\x84\xAE"=>"\xE2\x94\x9B", + "\x84\xAF"=>"\xE2\x94\x97", + "\x84\xB0"=>"\xE2\x94\xA3", + "\x84\xB1"=>"\xE2\x94\xB3", + "\x84\xB2"=>"\xE2\x94\xAB", + "\x84\xB3"=>"\xE2\x94\xBB", + "\x84\xB4"=>"\xE2\x95\x8B", + "\x84\xB5"=>"\xE2\x94\xA0", + "\x84\xB6"=>"\xE2\x94\xAF", + "\x84\xB7"=>"\xE2\x94\xA8", + "\x84\xB8"=>"\xE2\x94\xB7", + "\x84\xB9"=>"\xE2\x94\xBF", + "\x84\xBA"=>"\xE2\x94\x9D", + "\x84\xBB"=>"\xE2\x94\xB0", + "\x84\xBC"=>"\xE2\x94\xA5", + "\x84\xBD"=>"\xE2\x94\xB8", + "\x84\xBE"=>"\xE2\x95\x82", + "\x88\x9F"=>"\xE4\xBA\x9C", + "\x88\xA0"=>"\xE5\x94\x96", + "\x88\xA1"=>"\xE5\xA8\x83", + "\x88\xA2"=>"\xE9\x98\xBF", + "\x88\xA3"=>"\xE5\x93\x80", + "\x88\xA4"=>"\xE6\x84\x9B", + "\x88\xA5"=>"\xE6\x8C\xA8", + "\x88\xA6"=>"\xE5\xA7\xB6", + "\x88\xA7"=>"\xE9\x80\xA2", + "\x88\xA8"=>"\xE8\x91\xB5", + "\x88\xA9"=>"\xE8\x8C\x9C", + "\x88\xAA"=>"\xE7\xA9\x90", + "\x88\xAB"=>"\xE6\x82\xAA", + "\x88\xAC"=>"\xE6\x8F\xA1", + "\x88\xAD"=>"\xE6\xB8\xA5", + "\x88\xAE"=>"\xE6\x97\xAD", + "\x88\xAF"=>"\xE8\x91\xA6", + "\x88\xB0"=>"\xE8\x8A\xA6", + "\x88\xB1"=>"\xE9\xAF\xB5", + "\x88\xB2"=>"\xE6\xA2\x93", + "\x88\xB3"=>"\xE5\x9C\xA7", + "\x88\xB4"=>"\xE6\x96\xA1", + "\x88\xB5"=>"\xE6\x89\xB1", + "\x88\xB6"=>"\xE5\xAE\x9B", + "\x88\xB7"=>"\xE5\xA7\x90", + "\x88\xB8"=>"\xE8\x99\xBB", + "\x88\xB9"=>"\xE9\xA3\xB4", + "\x88\xBA"=>"\xE7\xB5\xA2", + "\x88\xBB"=>"\xE7\xB6\xBE", + "\x88\xBC"=>"\xE9\xAE\x8E", + "\x88\xBD"=>"\xE6\x88\x96", + "\x88\xBE"=>"\xE7\xB2\x9F", + "\x88\xBF"=>"\xE8\xA2\xB7", + "\x88\xC0"=>"\xE5\xAE\x89", + "\x88\xC1"=>"\xE5\xBA\xB5", + "\x88\xC2"=>"\xE6\x8C\x89", + "\x88\xC3"=>"\xE6\x9A\x97", + "\x88\xC4"=>"\xE6\xA1\x88", + "\x88\xC5"=>"\xE9\x97\x87", + "\x88\xC6"=>"\xE9\x9E\x8D", + "\x88\xC7"=>"\xE6\x9D\x8F", + "\x88\xC8"=>"\xE4\xBB\xA5", + "\x88\xC9"=>"\xE4\xBC\x8A", + "\x88\xCA"=>"\xE4\xBD\x8D", + "\x88\xCB"=>"\xE4\xBE\x9D", + "\x88\xCC"=>"\xE5\x81\x89", + "\x88\xCD"=>"\xE5\x9B\xB2", + "\x88\xCE"=>"\xE5\xA4\xB7", + "\x88\xCF"=>"\xE5\xA7\x94", + "\x88\xD0"=>"\xE5\xA8\x81", + "\x88\xD1"=>"\xE5\xB0\x89", + "\x88\xD2"=>"\xE6\x83\x9F", + "\x88\xD3"=>"\xE6\x84\x8F", + "\x88\xD4"=>"\xE6\x85\xB0", + "\x88\xD5"=>"\xE6\x98\x93", + "\x88\xD6"=>"\xE6\xA4\x85", + "\x88\xD7"=>"\xE7\x82\xBA", + "\x88\xD8"=>"\xE7\x95\x8F", + "\x88\xD9"=>"\xE7\x95\xB0", + "\x88\xDA"=>"\xE7\xA7\xBB", + "\x88\xDB"=>"\xE7\xB6\xAD", + "\x88\xDC"=>"\xE7\xB7\xAF", + "\x88\xDD"=>"\xE8\x83\x83", + "\x88\xDE"=>"\xE8\x90\x8E", + "\x88\xDF"=>"\xE8\xA1\xA3", + "\x88\xE0"=>"\xE8\xAC\x82", + "\x88\xE1"=>"\xE9\x81\x95", + "\x88\xE2"=>"\xE9\x81\xBA", + "\x88\xE3"=>"\xE5\x8C\xBB", + "\x88\xE4"=>"\xE4\xBA\x95", + "\x88\xE5"=>"\xE4\xBA\xA5", + "\x88\xE6"=>"\xE5\x9F\x9F", + "\x88\xE7"=>"\xE8\x82\xB2", + "\x88\xE8"=>"\xE9\x83\x81", + "\x88\xE9"=>"\xE7\xA3\xAF", + "\x88\xEA"=>"\xE4\xB8\x80", + "\x88\xEB"=>"\xE5\xA3\xB1", + "\x88\xEC"=>"\xE6\xBA\xA2", + "\x88\xED"=>"\xE9\x80\xB8", + "\x88\xEE"=>"\xE7\xA8\xB2", + "\x88\xEF"=>"\xE8\x8C\xA8", + "\x88\xF0"=>"\xE8\x8A\x8B", + "\x88\xF1"=>"\xE9\xB0\xAF", + "\x88\xF2"=>"\xE5\x85\x81", + "\x88\xF3"=>"\xE5\x8D\xB0", + "\x88\xF4"=>"\xE5\x92\xBD", + "\x88\xF5"=>"\xE5\x93\xA1", + "\x88\xF6"=>"\xE5\x9B\xA0", + "\x88\xF7"=>"\xE5\xA7\xBB", + "\x88\xF8"=>"\xE5\xBC\x95", + "\x88\xF9"=>"\xE9\xA3\xB2", + "\x88\xFA"=>"\xE6\xB7\xAB", + "\x88\xFB"=>"\xE8\x83\xA4", + "\x88\xFC"=>"\xE8\x94\xAD", + "\x89\x40"=>"\xE9\x99\xA2", + "\x89\x41"=>"\xE9\x99\xB0", + "\x89\x42"=>"\xE9\x9A\xA0", + "\x89\x43"=>"\xE9\x9F\xBB", + "\x89\x44"=>"\xE5\x90\x8B", + "\x89\x45"=>"\xE5\x8F\xB3", + "\x89\x46"=>"\xE5\xAE\x87", + "\x89\x47"=>"\xE7\x83\x8F", + "\x89\x48"=>"\xE7\xBE\xBD", + "\x89\x49"=>"\xE8\xBF\x82", + "\x89\x4A"=>"\xE9\x9B\xA8", + "\x89\x4B"=>"\xE5\x8D\xAF", + "\x89\x4C"=>"\xE9\xB5\x9C", + "\x89\x4D"=>"\xE7\xAA\xBA", + "\x89\x4E"=>"\xE4\xB8\x91", + "\x89\x4F"=>"\xE7\xA2\x93", + "\x89\x50"=>"\xE8\x87\xBC", + "\x89\x51"=>"\xE6\xB8\xA6", + "\x89\x52"=>"\xE5\x98\x98", + "\x89\x53"=>"\xE5\x94\x84", + "\x89\x54"=>"\xE6\xAC\x9D", + "\x89\x55"=>"\xE8\x94\x9A", + "\x89\x56"=>"\xE9\xB0\xBB", + "\x89\x57"=>"\xE5\xA7\xA5", + "\x89\x58"=>"\xE5\x8E\xA9", + "\x89\x59"=>"\xE6\xB5\xA6", + "\x89\x5A"=>"\xE7\x93\x9C", + "\x89\x5B"=>"\xE9\x96\x8F", + "\x89\x5C"=>"\xE5\x99\x82", + "\x89\x5D"=>"\xE4\xBA\x91", + "\x89\x5E"=>"\xE9\x81\x8B", + "\x89\x5F"=>"\xE9\x9B\xB2", + "\x89\x60"=>"\xE8\x8D\x8F", + "\x89\x61"=>"\xE9\xA4\x8C", + "\x89\x62"=>"\xE5\x8F\xA1", + "\x89\x63"=>"\xE5\x96\xB6", + "\x89\x64"=>"\xE5\xAC\xB0", + "\x89\x65"=>"\xE5\xBD\xB1", + "\x89\x66"=>"\xE6\x98\xA0", + "\x89\x67"=>"\xE6\x9B\xB3", + "\x89\x68"=>"\xE6\xA0\x84", + "\x89\x69"=>"\xE6\xB0\xB8", + "\x89\x6A"=>"\xE6\xB3\xB3", + "\x89\x6B"=>"\xE6\xB4\xA9", + "\x89\x6C"=>"\xE7\x91\x9B", + "\x89\x6D"=>"\xE7\x9B\x88", + "\x89\x6E"=>"\xE7\xA9\x8E", + "\x89\x6F"=>"\xE9\xA0\xB4", + "\x89\x70"=>"\xE8\x8B\xB1", + "\x89\x71"=>"\xE8\xA1\x9B", + "\x89\x72"=>"\xE8\xA9\xA0", + "\x89\x73"=>"\xE9\x8B\xAD", + "\x89\x74"=>"\xE6\xB6\xB2", + "\x89\x75"=>"\xE7\x96\xAB", + "\x89\x76"=>"\xE7\x9B\x8A", + "\x89\x77"=>"\xE9\xA7\x85", + "\x89\x78"=>"\xE6\x82\xA6", + "\x89\x79"=>"\xE8\xAC\x81", + "\x89\x7A"=>"\xE8\xB6\x8A", + "\x89\x7B"=>"\xE9\x96\xB2", + "\x89\x7C"=>"\xE6\xA6\x8E", + "\x89\x7D"=>"\xE5\x8E\xAD", + "\x89\x7E"=>"\xE5\x86\x86", + "\x89\x80"=>"\xE5\x9C\x92", + "\x89\x81"=>"\xE5\xA0\xB0", + "\x89\x82"=>"\xE5\xA5\x84", + "\x89\x83"=>"\xE5\xAE\xB4", + "\x89\x84"=>"\xE5\xBB\xB6", + "\x89\x85"=>"\xE6\x80\xA8", + "\x89\x86"=>"\xE6\x8E\xA9", + "\x89\x87"=>"\xE6\x8F\xB4", + "\x89\x88"=>"\xE6\xB2\xBF", + "\x89\x89"=>"\xE6\xBC\x94", + "\x89\x8A"=>"\xE7\x82\x8E", + "\x89\x8B"=>"\xE7\x84\x94", + "\x89\x8C"=>"\xE7\x85\x99", + "\x89\x8D"=>"\xE7\x87\x95", + "\x89\x8E"=>"\xE7\x8C\xBF", + "\x89\x8F"=>"\xE7\xB8\x81", + "\x89\x90"=>"\xE8\x89\xB6", + "\x89\x91"=>"\xE8\x8B\x91", + "\x89\x92"=>"\xE8\x96\x97", + "\x89\x93"=>"\xE9\x81\xA0", + "\x89\x94"=>"\xE9\x89\x9B", + "\x89\x95"=>"\xE9\xB4\x9B", + "\x89\x96"=>"\xE5\xA1\xA9", + "\x89\x97"=>"\xE6\x96\xBC", + "\x89\x98"=>"\xE6\xB1\x9A", + "\x89\x99"=>"\xE7\x94\xA5", + "\x89\x9A"=>"\xE5\x87\xB9", + "\x89\x9B"=>"\xE5\xA4\xAE", + "\x89\x9C"=>"\xE5\xA5\xA5", + "\x89\x9D"=>"\xE5\xBE\x80", + "\x89\x9E"=>"\xE5\xBF\x9C", + "\x89\x9F"=>"\xE6\x8A\xBC", + "\x89\xA0"=>"\xE6\x97\xBA", + "\x89\xA1"=>"\xE6\xA8\xAA", + "\x89\xA2"=>"\xE6\xAC\xA7", + "\x89\xA3"=>"\xE6\xAE\xB4", + "\x89\xA4"=>"\xE7\x8E\x8B", + "\x89\xA5"=>"\xE7\xBF\x81", + "\x89\xA6"=>"\xE8\xA5\x96", + "\x89\xA7"=>"\xE9\xB4\xAC", + "\x89\xA8"=>"\xE9\xB4\x8E", + "\x89\xA9"=>"\xE9\xBB\x84", + "\x89\xAA"=>"\xE5\xB2\xA1", + "\x89\xAB"=>"\xE6\xB2\x96", + "\x89\xAC"=>"\xE8\x8D\xBB", + "\x89\xAD"=>"\xE5\x84\x84", + "\x89\xAE"=>"\xE5\xB1\x8B", + "\x89\xAF"=>"\xE6\x86\xB6", + "\x89\xB0"=>"\xE8\x87\x86", + "\x89\xB1"=>"\xE6\xA1\xB6", + "\x89\xB2"=>"\xE7\x89\xA1", + "\x89\xB3"=>"\xE4\xB9\x99", + "\x89\xB4"=>"\xE4\xBF\xBA", + "\x89\xB5"=>"\xE5\x8D\xB8", + "\x89\xB6"=>"\xE6\x81\xA9", + "\x89\xB7"=>"\xE6\xB8\xA9", + "\x89\xB8"=>"\xE7\xA9\x8F", + "\x89\xB9"=>"\xE9\x9F\xB3", + "\x89\xBA"=>"\xE4\xB8\x8B", + "\x89\xBB"=>"\xE5\x8C\x96", + "\x89\xBC"=>"\xE4\xBB\xAE", + "\x89\xBD"=>"\xE4\xBD\x95", + "\x89\xBE"=>"\xE4\xBC\xBD", + "\x89\xBF"=>"\xE4\xBE\xA1", + "\x89\xC0"=>"\xE4\xBD\xB3", + "\x89\xC1"=>"\xE5\x8A\xA0", + "\x89\xC2"=>"\xE5\x8F\xAF", + "\x89\xC3"=>"\xE5\x98\x89", + "\x89\xC4"=>"\xE5\xA4\x8F", + "\x89\xC5"=>"\xE5\xAB\x81", + "\x89\xC6"=>"\xE5\xAE\xB6", + "\x89\xC7"=>"\xE5\xAF\xA1", + "\x89\xC8"=>"\xE7\xA7\x91", + "\x89\xC9"=>"\xE6\x9A\x87", + "\x89\xCA"=>"\xE6\x9E\x9C", + "\x89\xCB"=>"\xE6\x9E\xB6", + "\x89\xCC"=>"\xE6\xAD\x8C", + "\x89\xCD"=>"\xE6\xB2\xB3", + "\x89\xCE"=>"\xE7\x81\xAB", + "\x89\xCF"=>"\xE7\x8F\x82", + "\x89\xD0"=>"\xE7\xA6\x8D", + "\x89\xD1"=>"\xE7\xA6\xBE", + "\x89\xD2"=>"\xE7\xA8\xBC", + "\x89\xD3"=>"\xE7\xAE\x87", + "\x89\xD4"=>"\xE8\x8A\xB1", + "\x89\xD5"=>"\xE8\x8B\x9B", + "\x89\xD6"=>"\xE8\x8C\x84", + "\x89\xD7"=>"\xE8\x8D\xB7", + "\x89\xD8"=>"\xE8\x8F\xAF", + "\x89\xD9"=>"\xE8\x8F\x93", + "\x89\xDA"=>"\xE8\x9D\xA6", + "\x89\xDB"=>"\xE8\xAA\xB2", + "\x89\xDC"=>"\xE5\x98\xA9", + "\x89\xDD"=>"\xE8\xB2\xA8", + "\x89\xDE"=>"\xE8\xBF\xA6", + "\x89\xDF"=>"\xE9\x81\x8E", + "\x89\xE0"=>"\xE9\x9C\x9E", + "\x89\xE1"=>"\xE8\x9A\x8A", + "\x89\xE2"=>"\xE4\xBF\x84", + "\x89\xE3"=>"\xE5\xB3\xA8", + "\x89\xE4"=>"\xE6\x88\x91", + "\x89\xE5"=>"\xE7\x89\x99", + "\x89\xE6"=>"\xE7\x94\xBB", + "\x89\xE7"=>"\xE8\x87\xA5", + "\x89\xE8"=>"\xE8\x8A\xBD", + "\x89\xE9"=>"\xE8\x9B\xBE", + "\x89\xEA"=>"\xE8\xB3\x80", + "\x89\xEB"=>"\xE9\x9B\x85", + "\x89\xEC"=>"\xE9\xA4\x93", + "\x89\xED"=>"\xE9\xA7\x95", + "\x89\xEE"=>"\xE4\xBB\x8B", + "\x89\xEF"=>"\xE4\xBC\x9A", + "\x89\xF0"=>"\xE8\xA7\xA3", + "\x89\xF1"=>"\xE5\x9B\x9E", + "\x89\xF2"=>"\xE5\xA1\x8A", + "\x89\xF3"=>"\xE5\xA3\x8A", + "\x89\xF4"=>"\xE5\xBB\xBB", + "\x89\xF5"=>"\xE5\xBF\xAB", + "\x89\xF6"=>"\xE6\x80\xAA", + "\x89\xF7"=>"\xE6\x82\x94", + "\x89\xF8"=>"\xE6\x81\xA2", + "\x89\xF9"=>"\xE6\x87\x90", + "\x89\xFA"=>"\xE6\x88\x92", + "\x89\xFB"=>"\xE6\x8B\x90", + "\x89\xFC"=>"\xE6\x94\xB9", + "\x8A\x40"=>"\xE9\xAD\x81", + "\x8A\x41"=>"\xE6\x99\xA6", + "\x8A\x42"=>"\xE6\xA2\xB0", + "\x8A\x43"=>"\xE6\xB5\xB7", + "\x8A\x44"=>"\xE7\x81\xB0", + "\x8A\x45"=>"\xE7\x95\x8C", + "\x8A\x46"=>"\xE7\x9A\x86", + "\x8A\x47"=>"\xE7\xB5\xB5", + "\x8A\x48"=>"\xE8\x8A\xA5", + "\x8A\x49"=>"\xE8\x9F\xB9", + "\x8A\x4A"=>"\xE9\x96\x8B", + "\x8A\x4B"=>"\xE9\x9A\x8E", + "\x8A\x4C"=>"\xE8\xB2\x9D", + "\x8A\x4D"=>"\xE5\x87\xB1", + "\x8A\x4E"=>"\xE5\x8A\xBE", + "\x8A\x4F"=>"\xE5\xA4\x96", + "\x8A\x50"=>"\xE5\x92\xB3", + "\x8A\x51"=>"\xE5\xAE\xB3", + "\x8A\x52"=>"\xE5\xB4\x96", + "\x8A\x53"=>"\xE6\x85\xA8", + "\x8A\x54"=>"\xE6\xA6\x82", + "\x8A\x55"=>"\xE6\xB6\xAF", + "\x8A\x56"=>"\xE7\xA2\x8D", + "\x8A\x57"=>"\xE8\x93\x8B", + "\x8A\x58"=>"\xE8\xA1\x97", + "\x8A\x59"=>"\xE8\xA9\xB2", + "\x8A\x5A"=>"\xE9\x8E\xA7", + "\x8A\x5B"=>"\xE9\xAA\xB8", + "\x8A\x5C"=>"\xE6\xB5\xAC", + "\x8A\x5D"=>"\xE9\xA6\xA8", + "\x8A\x5E"=>"\xE8\x9B\x99", + "\x8A\x5F"=>"\xE5\x9E\xA3", + "\x8A\x60"=>"\xE6\x9F\xBF", + "\x8A\x61"=>"\xE8\x9B\x8E", + "\x8A\x62"=>"\xE9\x88\x8E", + "\x8A\x63"=>"\xE5\x8A\x83", + "\x8A\x64"=>"\xE5\x9A\x87", + "\x8A\x65"=>"\xE5\x90\x84", + "\x8A\x66"=>"\xE5\xBB\x93", + "\x8A\x67"=>"\xE6\x8B\xA1", + "\x8A\x68"=>"\xE6\x92\xB9", + "\x8A\x69"=>"\xE6\xA0\xBC", + "\x8A\x6A"=>"\xE6\xA0\xB8", + "\x8A\x6B"=>"\xE6\xAE\xBB", + "\x8A\x6C"=>"\xE7\x8D\xB2", + "\x8A\x6D"=>"\xE7\xA2\xBA", + "\x8A\x6E"=>"\xE7\xA9\xAB", + "\x8A\x6F"=>"\xE8\xA6\x9A", + "\x8A\x70"=>"\xE8\xA7\x92", + "\x8A\x71"=>"\xE8\xB5\xAB", + "\x8A\x72"=>"\xE8\xBC\x83", + "\x8A\x73"=>"\xE9\x83\xAD", + "\x8A\x74"=>"\xE9\x96\xA3", + "\x8A\x75"=>"\xE9\x9A\x94", + "\x8A\x76"=>"\xE9\x9D\xA9", + "\x8A\x77"=>"\xE5\xAD\xA6", + "\x8A\x78"=>"\xE5\xB2\xB3", + "\x8A\x79"=>"\xE6\xA5\xBD", + "\x8A\x7A"=>"\xE9\xA1\x8D", + "\x8A\x7B"=>"\xE9\xA1\x8E", + "\x8A\x7C"=>"\xE6\x8E\x9B", + "\x8A\x7D"=>"\xE7\xAC\xA0", + "\x8A\x7E"=>"\xE6\xA8\xAB", + "\x8A\x80"=>"\xE6\xA9\xBF", + "\x8A\x81"=>"\xE6\xA2\xB6", + "\x8A\x82"=>"\xE9\xB0\x8D", + "\x8A\x83"=>"\xE6\xBD\x9F", + "\x8A\x84"=>"\xE5\x89\xB2", + "\x8A\x85"=>"\xE5\x96\x9D", + "\x8A\x86"=>"\xE6\x81\xB0", + "\x8A\x87"=>"\xE6\x8B\xAC", + "\x8A\x88"=>"\xE6\xB4\xBB", + "\x8A\x89"=>"\xE6\xB8\x87", + "\x8A\x8A"=>"\xE6\xBB\x91", + "\x8A\x8B"=>"\xE8\x91\x9B", + "\x8A\x8C"=>"\xE8\xA4\x90", + "\x8A\x8D"=>"\xE8\xBD\x84", + "\x8A\x8E"=>"\xE4\xB8\x94", + "\x8A\x8F"=>"\xE9\xB0\xB9", + "\x8A\x90"=>"\xE5\x8F\xB6", + "\x8A\x91"=>"\xE6\xA4\x9B", + "\x8A\x92"=>"\xE6\xA8\xBA", + "\x8A\x93"=>"\xE9\x9E\x84", + "\x8A\x94"=>"\xE6\xA0\xAA", + "\x8A\x95"=>"\xE5\x85\x9C", + "\x8A\x96"=>"\xE7\xAB\x83", + "\x8A\x97"=>"\xE8\x92\xB2", + "\x8A\x98"=>"\xE9\x87\x9C", + "\x8A\x99"=>"\xE9\x8E\x8C", + "\x8A\x9A"=>"\xE5\x99\x9B", + "\x8A\x9B"=>"\xE9\xB4\xA8", + "\x8A\x9C"=>"\xE6\xA0\xA2", + "\x8A\x9D"=>"\xE8\x8C\x85", + "\x8A\x9E"=>"\xE8\x90\xB1", + "\x8A\x9F"=>"\xE7\xB2\xA5", + "\x8A\xA0"=>"\xE5\x88\x88", + "\x8A\xA1"=>"\xE8\x8B\x85", + "\x8A\xA2"=>"\xE7\x93\xA6", + "\x8A\xA3"=>"\xE4\xB9\xBE", + "\x8A\xA4"=>"\xE4\xBE\x83", + "\x8A\xA5"=>"\xE5\x86\xA0", + "\x8A\xA6"=>"\xE5\xAF\x92", + "\x8A\xA7"=>"\xE5\x88\x8A", + "\x8A\xA8"=>"\xE5\x8B\x98", + "\x8A\xA9"=>"\xE5\x8B\xA7", + "\x8A\xAA"=>"\xE5\xB7\xBB", + "\x8A\xAB"=>"\xE5\x96\x9A", + "\x8A\xAC"=>"\xE5\xA0\xAA", + "\x8A\xAD"=>"\xE5\xA7\xA6", + "\x8A\xAE"=>"\xE5\xAE\x8C", + "\x8A\xAF"=>"\xE5\xAE\x98", + "\x8A\xB0"=>"\xE5\xAF\x9B", + "\x8A\xB1"=>"\xE5\xB9\xB2", + "\x8A\xB2"=>"\xE5\xB9\xB9", + "\x8A\xB3"=>"\xE6\x82\xA3", + "\x8A\xB4"=>"\xE6\x84\x9F", + "\x8A\xB5"=>"\xE6\x85\xA3", + "\x8A\xB6"=>"\xE6\x86\xBE", + "\x8A\xB7"=>"\xE6\x8F\x9B", + "\x8A\xB8"=>"\xE6\x95\xA2", + "\x8A\xB9"=>"\xE6\x9F\x91", + "\x8A\xBA"=>"\xE6\xA1\x93", + "\x8A\xBB"=>"\xE6\xA3\xBA", + "\x8A\xBC"=>"\xE6\xAC\xBE", + "\x8A\xBD"=>"\xE6\xAD\x93", + "\x8A\xBE"=>"\xE6\xB1\x97", + "\x8A\xBF"=>"\xE6\xBC\xA2", + "\x8A\xC0"=>"\xE6\xBE\x97", + "\x8A\xC1"=>"\xE6\xBD\x85", + "\x8A\xC2"=>"\xE7\x92\xB0", + "\x8A\xC3"=>"\xE7\x94\x98", + "\x8A\xC4"=>"\xE7\x9B\xA3", + "\x8A\xC5"=>"\xE7\x9C\x8B", + "\x8A\xC6"=>"\xE7\xAB\xBF", + "\x8A\xC7"=>"\xE7\xAE\xA1", + "\x8A\xC8"=>"\xE7\xB0\xA1", + "\x8A\xC9"=>"\xE7\xB7\xA9", + "\x8A\xCA"=>"\xE7\xBC\xB6", + "\x8A\xCB"=>"\xE7\xBF\xB0", + "\x8A\xCC"=>"\xE8\x82\x9D", + "\x8A\xCD"=>"\xE8\x89\xA6", + "\x8A\xCE"=>"\xE8\x8E\x9E", + "\x8A\xCF"=>"\xE8\xA6\xB3", + "\x8A\xD0"=>"\xE8\xAB\x8C", + "\x8A\xD1"=>"\xE8\xB2\xAB", + "\x8A\xD2"=>"\xE9\x82\x84", + "\x8A\xD3"=>"\xE9\x91\x91", + "\x8A\xD4"=>"\xE9\x96\x93", + "\x8A\xD5"=>"\xE9\x96\x91", + "\x8A\xD6"=>"\xE9\x96\xA2", + "\x8A\xD7"=>"\xE9\x99\xA5", + "\x8A\xD8"=>"\xE9\x9F\x93", + "\x8A\xD9"=>"\xE9\xA4\xA8", + "\x8A\xDA"=>"\xE8\x88\x98", + "\x8A\xDB"=>"\xE4\xB8\xB8", + "\x8A\xDC"=>"\xE5\x90\xAB", + "\x8A\xDD"=>"\xE5\xB2\xB8", + "\x8A\xDE"=>"\xE5\xB7\x8C", + "\x8A\xDF"=>"\xE7\x8E\xA9", + "\x8A\xE0"=>"\xE7\x99\x8C", + "\x8A\xE1"=>"\xE7\x9C\xBC", + "\x8A\xE2"=>"\xE5\xB2\xA9", + "\x8A\xE3"=>"\xE7\xBF\xAB", + "\x8A\xE4"=>"\xE8\xB4\x8B", + "\x8A\xE5"=>"\xE9\x9B\x81", + "\x8A\xE6"=>"\xE9\xA0\x91", + "\x8A\xE7"=>"\xE9\xA1\x94", + "\x8A\xE8"=>"\xE9\xA1\x98", + "\x8A\xE9"=>"\xE4\xBC\x81", + "\x8A\xEA"=>"\xE4\xBC\x8E", + "\x8A\xEB"=>"\xE5\x8D\xB1", + "\x8A\xEC"=>"\xE5\x96\x9C", + "\x8A\xED"=>"\xE5\x99\xA8", + "\x8A\xEE"=>"\xE5\x9F\xBA", + "\x8A\xEF"=>"\xE5\xA5\x87", + "\x8A\xF0"=>"\xE5\xAC\x89", + "\x8A\xF1"=>"\xE5\xAF\x84", + "\x8A\xF2"=>"\xE5\xB2\x90", + "\x8A\xF3"=>"\xE5\xB8\x8C", + "\x8A\xF4"=>"\xE5\xB9\xBE", + "\x8A\xF5"=>"\xE5\xBF\x8C", + "\x8A\xF6"=>"\xE6\x8F\xAE", + "\x8A\xF7"=>"\xE6\x9C\xBA", + "\x8A\xF8"=>"\xE6\x97\x97", + "\x8A\xF9"=>"\xE6\x97\xA2", + "\x8A\xFA"=>"\xE6\x9C\x9F", + "\x8A\xFB"=>"\xE6\xA3\x8B", + "\x8A\xFC"=>"\xE6\xA3\x84", + "\x8B\x40"=>"\xE6\xA9\x9F", + "\x8B\x41"=>"\xE5\xB8\xB0", + "\x8B\x42"=>"\xE6\xAF\x85", + "\x8B\x43"=>"\xE6\xB0\x97", + "\x8B\x44"=>"\xE6\xB1\xBD", + "\x8B\x45"=>"\xE7\x95\xBF", + "\x8B\x46"=>"\xE7\xA5\x88", + "\x8B\x47"=>"\xE5\xAD\xA3", + "\x8B\x48"=>"\xE7\xA8\x80", + "\x8B\x49"=>"\xE7\xB4\x80", + "\x8B\x4A"=>"\xE5\xBE\xBD", + "\x8B\x4B"=>"\xE8\xA6\x8F", + "\x8B\x4C"=>"\xE8\xA8\x98", + "\x8B\x4D"=>"\xE8\xB2\xB4", + "\x8B\x4E"=>"\xE8\xB5\xB7", + "\x8B\x4F"=>"\xE8\xBB\x8C", + "\x8B\x50"=>"\xE8\xBC\x9D", + "\x8B\x51"=>"\xE9\xA3\xA2", + "\x8B\x52"=>"\xE9\xA8\x8E", + "\x8B\x53"=>"\xE9\xAC\xBC", + "\x8B\x54"=>"\xE4\xBA\x80", + "\x8B\x55"=>"\xE5\x81\xBD", + "\x8B\x56"=>"\xE5\x84\x80", + "\x8B\x57"=>"\xE5\xA6\x93", + "\x8B\x58"=>"\xE5\xAE\x9C", + "\x8B\x59"=>"\xE6\x88\xAF", + "\x8B\x5A"=>"\xE6\x8A\x80", + "\x8B\x5B"=>"\xE6\x93\xAC", + "\x8B\x5C"=>"\xE6\xAC\xBA", + "\x8B\x5D"=>"\xE7\x8A\xA0", + "\x8B\x5E"=>"\xE7\x96\x91", + "\x8B\x5F"=>"\xE7\xA5\x87", + "\x8B\x60"=>"\xE7\xBE\xA9", + "\x8B\x61"=>"\xE8\x9F\xBB", + "\x8B\x62"=>"\xE8\xAA\xBC", + "\x8B\x63"=>"\xE8\xAD\xB0", + "\x8B\x64"=>"\xE6\x8E\xAC", + "\x8B\x65"=>"\xE8\x8F\x8A", + "\x8B\x66"=>"\xE9\x9E\xA0", + "\x8B\x67"=>"\xE5\x90\x89", + "\x8B\x68"=>"\xE5\x90\x83", + "\x8B\x69"=>"\xE5\x96\xAB", + "\x8B\x6A"=>"\xE6\xA1\x94", + "\x8B\x6B"=>"\xE6\xA9\x98", + "\x8B\x6C"=>"\xE8\xA9\xB0", + "\x8B\x6D"=>"\xE7\xA0\xA7", + "\x8B\x6E"=>"\xE6\x9D\xB5", + "\x8B\x6F"=>"\xE9\xBB\x8D", + "\x8B\x70"=>"\xE5\x8D\xB4", + "\x8B\x71"=>"\xE5\xAE\xA2", + "\x8B\x72"=>"\xE8\x84\x9A", + "\x8B\x73"=>"\xE8\x99\x90", + "\x8B\x74"=>"\xE9\x80\x86", + "\x8B\x75"=>"\xE4\xB8\x98", + "\x8B\x76"=>"\xE4\xB9\x85", + "\x8B\x77"=>"\xE4\xBB\x87", + "\x8B\x78"=>"\xE4\xBC\x91", + "\x8B\x79"=>"\xE5\x8F\x8A", + "\x8B\x7A"=>"\xE5\x90\xB8", + "\x8B\x7B"=>"\xE5\xAE\xAE", + "\x8B\x7C"=>"\xE5\xBC\x93", + "\x8B\x7D"=>"\xE6\x80\xA5", + "\x8B\x7E"=>"\xE6\x95\x91", + "\x8B\x80"=>"\xE6\x9C\xBD", + "\x8B\x81"=>"\xE6\xB1\x82", + "\x8B\x82"=>"\xE6\xB1\xB2", + "\x8B\x83"=>"\xE6\xB3\xA3", + "\x8B\x84"=>"\xE7\x81\xB8", + "\x8B\x85"=>"\xE7\x90\x83", + "\x8B\x86"=>"\xE7\xA9\xB6", + "\x8B\x87"=>"\xE7\xAA\xAE", + "\x8B\x88"=>"\xE7\xAC\x88", + "\x8B\x89"=>"\xE7\xB4\x9A", + "\x8B\x8A"=>"\xE7\xB3\xBE", + "\x8B\x8B"=>"\xE7\xB5\xA6", + "\x8B\x8C"=>"\xE6\x97\xA7", + "\x8B\x8D"=>"\xE7\x89\x9B", + "\x8B\x8E"=>"\xE5\x8E\xBB", + "\x8B\x8F"=>"\xE5\xB1\x85", + "\x8B\x90"=>"\xE5\xB7\xA8", + "\x8B\x91"=>"\xE6\x8B\x92", + "\x8B\x92"=>"\xE6\x8B\xA0", + "\x8B\x93"=>"\xE6\x8C\x99", + "\x8B\x94"=>"\xE6\xB8\xA0", + "\x8B\x95"=>"\xE8\x99\x9A", + "\x8B\x96"=>"\xE8\xA8\xB1", + "\x8B\x97"=>"\xE8\xB7\x9D", + "\x8B\x98"=>"\xE9\x8B\xB8", + "\x8B\x99"=>"\xE6\xBC\x81", + "\x8B\x9A"=>"\xE7\xA6\xA6", + "\x8B\x9B"=>"\xE9\xAD\x9A", + "\x8B\x9C"=>"\xE4\xBA\xA8", + "\x8B\x9D"=>"\xE4\xBA\xAB", + "\x8B\x9E"=>"\xE4\xBA\xAC", + "\x8B\x9F"=>"\xE4\xBE\x9B", + "\x8B\xA0"=>"\xE4\xBE\xA0", + "\x8B\xA1"=>"\xE5\x83\x91", + "\x8B\xA2"=>"\xE5\x85\x87", + "\x8B\xA3"=>"\xE7\xAB\xB6", + "\x8B\xA4"=>"\xE5\x85\xB1", + "\x8B\xA5"=>"\xE5\x87\xB6", + "\x8B\xA6"=>"\xE5\x8D\x94", + "\x8B\xA7"=>"\xE5\x8C\xA1", + "\x8B\xA8"=>"\xE5\x8D\xBF", + "\x8B\xA9"=>"\xE5\x8F\xAB", + "\x8B\xAA"=>"\xE5\x96\xAC", + "\x8B\xAB"=>"\xE5\xA2\x83", + "\x8B\xAC"=>"\xE5\xB3\xA1", + "\x8B\xAD"=>"\xE5\xBC\xB7", + "\x8B\xAE"=>"\xE5\xBD\x8A", + "\x8B\xAF"=>"\xE6\x80\xAF", + "\x8B\xB0"=>"\xE6\x81\x90", + "\x8B\xB1"=>"\xE6\x81\xAD", + "\x8B\xB2"=>"\xE6\x8C\x9F", + "\x8B\xB3"=>"\xE6\x95\x99", + "\x8B\xB4"=>"\xE6\xA9\x8B", + "\x8B\xB5"=>"\xE6\xB3\x81", + "\x8B\xB6"=>"\xE7\x8B\x82", + "\x8B\xB7"=>"\xE7\x8B\xAD", + "\x8B\xB8"=>"\xE7\x9F\xAF", + "\x8B\xB9"=>"\xE8\x83\xB8", + "\x8B\xBA"=>"\xE8\x84\x85", + "\x8B\xBB"=>"\xE8\x88\x88", + "\x8B\xBC"=>"\xE8\x95\x8E", + "\x8B\xBD"=>"\xE9\x83\xB7", + "\x8B\xBE"=>"\xE9\x8F\xA1", + "\x8B\xBF"=>"\xE9\x9F\xBF", + "\x8B\xC0"=>"\xE9\xA5\x97", + "\x8B\xC1"=>"\xE9\xA9\x9A", + "\x8B\xC2"=>"\xE4\xBB\xB0", + "\x8B\xC3"=>"\xE5\x87\x9D", + "\x8B\xC4"=>"\xE5\xB0\xAD", + "\x8B\xC5"=>"\xE6\x9A\x81", + "\x8B\xC6"=>"\xE6\xA5\xAD", + "\x8B\xC7"=>"\xE5\xB1\x80", + "\x8B\xC8"=>"\xE6\x9B\xB2", + "\x8B\xC9"=>"\xE6\xA5\xB5", + "\x8B\xCA"=>"\xE7\x8E\x89", + "\x8B\xCB"=>"\xE6\xA1\x90", + "\x8B\xCC"=>"\xE7\xB2\x81", + "\x8B\xCD"=>"\xE5\x83\x85", + "\x8B\xCE"=>"\xE5\x8B\xA4", + "\x8B\xCF"=>"\xE5\x9D\x87", + "\x8B\xD0"=>"\xE5\xB7\xBE", + "\x8B\xD1"=>"\xE9\x8C\xA6", + "\x8B\xD2"=>"\xE6\x96\xA4", + "\x8B\xD3"=>"\xE6\xAC\xA3", + "\x8B\xD4"=>"\xE6\xAC\xBD", + "\x8B\xD5"=>"\xE7\x90\xB4", + "\x8B\xD6"=>"\xE7\xA6\x81", + "\x8B\xD7"=>"\xE7\xA6\xBD", + "\x8B\xD8"=>"\xE7\xAD\x8B", + "\x8B\xD9"=>"\xE7\xB7\x8A", + "\x8B\xDA"=>"\xE8\x8A\xB9", + "\x8B\xDB"=>"\xE8\x8F\x8C", + "\x8B\xDC"=>"\xE8\xA1\xBF", + "\x8B\xDD"=>"\xE8\xA5\x9F", + "\x8B\xDE"=>"\xE8\xAC\xB9", + "\x8B\xDF"=>"\xE8\xBF\x91", + "\x8B\xE0"=>"\xE9\x87\x91", + "\x8B\xE1"=>"\xE5\x90\x9F", + "\x8B\xE2"=>"\xE9\x8A\x80", + "\x8B\xE3"=>"\xE4\xB9\x9D", + "\x8B\xE4"=>"\xE5\x80\xB6", + "\x8B\xE5"=>"\xE5\x8F\xA5", + "\x8B\xE6"=>"\xE5\x8C\xBA", + "\x8B\xE7"=>"\xE7\x8B\x97", + "\x8B\xE8"=>"\xE7\x8E\x96", + "\x8B\xE9"=>"\xE7\x9F\xA9", + "\x8B\xEA"=>"\xE8\x8B\xA6", + "\x8B\xEB"=>"\xE8\xBA\xAF", + "\x8B\xEC"=>"\xE9\xA7\x86", + "\x8B\xED"=>"\xE9\xA7\x88", + "\x8B\xEE"=>"\xE9\xA7\x92", + "\x8B\xEF"=>"\xE5\x85\xB7", + "\x8B\xF0"=>"\xE6\x84\x9A", + "\x8B\xF1"=>"\xE8\x99\x9E", + "\x8B\xF2"=>"\xE5\x96\xB0", + "\x8B\xF3"=>"\xE7\xA9\xBA", + "\x8B\xF4"=>"\xE5\x81\xB6", + "\x8B\xF5"=>"\xE5\xAF\x93", + "\x8B\xF6"=>"\xE9\x81\x87", + "\x8B\xF7"=>"\xE9\x9A\x85", + "\x8B\xF8"=>"\xE4\xB8\xB2", + "\x8B\xF9"=>"\xE6\xAB\x9B", + "\x8B\xFA"=>"\xE9\x87\xA7", + "\x8B\xFB"=>"\xE5\xB1\x91", + "\x8B\xFC"=>"\xE5\xB1\x88", + "\x8C\x40"=>"\xE6\x8E\x98", + "\x8C\x41"=>"\xE7\xAA\x9F", + "\x8C\x42"=>"\xE6\xB2\x93", + "\x8C\x43"=>"\xE9\x9D\xB4", + "\x8C\x44"=>"\xE8\xBD\xA1", + "\x8C\x45"=>"\xE7\xAA\xAA", + "\x8C\x46"=>"\xE7\x86\x8A", + "\x8C\x47"=>"\xE9\x9A\x88", + "\x8C\x48"=>"\xE7\xB2\x82", + "\x8C\x49"=>"\xE6\xA0\x97", + "\x8C\x4A"=>"\xE7\xB9\xB0", + "\x8C\x4B"=>"\xE6\xA1\x91", + "\x8C\x4C"=>"\xE9\x8D\xAC", + "\x8C\x4D"=>"\xE5\x8B\xB2", + "\x8C\x4E"=>"\xE5\x90\x9B", + "\x8C\x4F"=>"\xE8\x96\xAB", + "\x8C\x50"=>"\xE8\xA8\x93", + "\x8C\x51"=>"\xE7\xBE\xA4", + "\x8C\x52"=>"\xE8\xBB\x8D", + "\x8C\x53"=>"\xE9\x83\xA1", + "\x8C\x54"=>"\xE5\x8D\xA6", + "\x8C\x55"=>"\xE8\xA2\x88", + "\x8C\x56"=>"\xE7\xA5\x81", + "\x8C\x57"=>"\xE4\xBF\x82", + "\x8C\x58"=>"\xE5\x82\xBE", + "\x8C\x59"=>"\xE5\x88\x91", + "\x8C\x5A"=>"\xE5\x85\x84", + "\x8C\x5B"=>"\xE5\x95\x93", + "\x8C\x5C"=>"\xE5\x9C\xAD", + "\x8C\x5D"=>"\xE7\x8F\xAA", + "\x8C\x5E"=>"\xE5\x9E\x8B", + "\x8C\x5F"=>"\xE5\xA5\x91", + "\x8C\x60"=>"\xE5\xBD\xA2", + "\x8C\x61"=>"\xE5\xBE\x84", + "\x8C\x62"=>"\xE6\x81\xB5", + "\x8C\x63"=>"\xE6\x85\xB6", + "\x8C\x64"=>"\xE6\x85\xA7", + "\x8C\x65"=>"\xE6\x86\xA9", + "\x8C\x66"=>"\xE6\x8E\xB2", + "\x8C\x67"=>"\xE6\x90\xBA", + "\x8C\x68"=>"\xE6\x95\xAC", + "\x8C\x69"=>"\xE6\x99\xAF", + "\x8C\x6A"=>"\xE6\xA1\x82", + "\x8C\x6B"=>"\xE6\xB8\x93", + "\x8C\x6C"=>"\xE7\x95\xA6", + "\x8C\x6D"=>"\xE7\xA8\xBD", + "\x8C\x6E"=>"\xE7\xB3\xBB", + "\x8C\x6F"=>"\xE7\xB5\x8C", + "\x8C\x70"=>"\xE7\xB6\x99", + "\x8C\x71"=>"\xE7\xB9\x8B", + "\x8C\x72"=>"\xE7\xBD\xAB", + "\x8C\x73"=>"\xE8\x8C\x8E", + "\x8C\x74"=>"\xE8\x8D\x8A", + "\x8C\x75"=>"\xE8\x9B\x8D", + "\x8C\x76"=>"\xE8\xA8\x88", + "\x8C\x77"=>"\xE8\xA9\xA3", + "\x8C\x78"=>"\xE8\xAD\xA6", + "\x8C\x79"=>"\xE8\xBB\xBD", + "\x8C\x7A"=>"\xE9\xA0\x9A", + "\x8C\x7B"=>"\xE9\xB6\x8F", + "\x8C\x7C"=>"\xE8\x8A\xB8", + "\x8C\x7D"=>"\xE8\xBF\x8E", + "\x8C\x7E"=>"\xE9\xAF\xA8", + "\x8C\x80"=>"\xE5\x8A\x87", + "\x8C\x81"=>"\xE6\x88\x9F", + "\x8C\x82"=>"\xE6\x92\x83", + "\x8C\x83"=>"\xE6\xBF\x80", + "\x8C\x84"=>"\xE9\x9A\x99", + "\x8C\x85"=>"\xE6\xA1\x81", + "\x8C\x86"=>"\xE5\x82\x91", + "\x8C\x87"=>"\xE6\xAC\xA0", + "\x8C\x88"=>"\xE6\xB1\xBA", + "\x8C\x89"=>"\xE6\xBD\x94", + "\x8C\x8A"=>"\xE7\xA9\xB4", + "\x8C\x8B"=>"\xE7\xB5\x90", + "\x8C\x8C"=>"\xE8\xA1\x80", + "\x8C\x8D"=>"\xE8\xA8\xA3", + "\x8C\x8E"=>"\xE6\x9C\x88", + "\x8C\x8F"=>"\xE4\xBB\xB6", + "\x8C\x90"=>"\xE5\x80\xB9", + "\x8C\x91"=>"\xE5\x80\xA6", + "\x8C\x92"=>"\xE5\x81\xA5", + "\x8C\x93"=>"\xE5\x85\xBC", + "\x8C\x94"=>"\xE5\x88\xB8", + "\x8C\x95"=>"\xE5\x89\xA3", + "\x8C\x96"=>"\xE5\x96\xA7", + "\x8C\x97"=>"\xE5\x9C\x8F", + "\x8C\x98"=>"\xE5\xA0\x85", + "\x8C\x99"=>"\xE5\xAB\x8C", + "\x8C\x9A"=>"\xE5\xBB\xBA", + "\x8C\x9B"=>"\xE6\x86\xB2", + "\x8C\x9C"=>"\xE6\x87\xB8", + "\x8C\x9D"=>"\xE6\x8B\xB3", + "\x8C\x9E"=>"\xE6\x8D\xB2", + "\x8C\x9F"=>"\xE6\xA4\x9C", + "\x8C\xA0"=>"\xE6\xA8\xA9", + "\x8C\xA1"=>"\xE7\x89\xBD", + "\x8C\xA2"=>"\xE7\x8A\xAC", + "\x8C\xA3"=>"\xE7\x8C\xAE", + "\x8C\xA4"=>"\xE7\xA0\x94", + "\x8C\xA5"=>"\xE7\xA1\xAF", + "\x8C\xA6"=>"\xE7\xB5\xB9", + "\x8C\xA7"=>"\xE7\x9C\x8C", + "\x8C\xA8"=>"\xE8\x82\xA9", + "\x8C\xA9"=>"\xE8\xA6\x8B", + "\x8C\xAA"=>"\xE8\xAC\x99", + "\x8C\xAB"=>"\xE8\xB3\xA2", + "\x8C\xAC"=>"\xE8\xBB\x92", + "\x8C\xAD"=>"\xE9\x81\xA3", + "\x8C\xAE"=>"\xE9\x8D\xB5", + "\x8C\xAF"=>"\xE9\x99\xBA", + "\x8C\xB0"=>"\xE9\xA1\x95", + "\x8C\xB1"=>"\xE9\xA8\x93", + "\x8C\xB2"=>"\xE9\xB9\xB8", + "\x8C\xB3"=>"\xE5\x85\x83", + "\x8C\xB4"=>"\xE5\x8E\x9F", + "\x8C\xB5"=>"\xE5\x8E\xB3", + "\x8C\xB6"=>"\xE5\xB9\xBB", + "\x8C\xB7"=>"\xE5\xBC\xA6", + "\x8C\xB8"=>"\xE6\xB8\x9B", + "\x8C\xB9"=>"\xE6\xBA\x90", + "\x8C\xBA"=>"\xE7\x8E\x84", + "\x8C\xBB"=>"\xE7\x8F\xBE", + "\x8C\xBC"=>"\xE7\xB5\x83", + "\x8C\xBD"=>"\xE8\x88\xB7", + "\x8C\xBE"=>"\xE8\xA8\x80", + "\x8C\xBF"=>"\xE8\xAB\xBA", + "\x8C\xC0"=>"\xE9\x99\x90", + "\x8C\xC1"=>"\xE4\xB9\x8E", + "\x8C\xC2"=>"\xE5\x80\x8B", + "\x8C\xC3"=>"\xE5\x8F\xA4", + "\x8C\xC4"=>"\xE5\x91\xBC", + "\x8C\xC5"=>"\xE5\x9B\xBA", + "\x8C\xC6"=>"\xE5\xA7\x91", + "\x8C\xC7"=>"\xE5\xAD\xA4", + "\x8C\xC8"=>"\xE5\xB7\xB1", + "\x8C\xC9"=>"\xE5\xBA\xAB", + "\x8C\xCA"=>"\xE5\xBC\xA7", + "\x8C\xCB"=>"\xE6\x88\xB8", + "\x8C\xCC"=>"\xE6\x95\x85", + "\x8C\xCD"=>"\xE6\x9E\xAF", + "\x8C\xCE"=>"\xE6\xB9\x96", + "\x8C\xCF"=>"\xE7\x8B\x90", + "\x8C\xD0"=>"\xE7\xB3\x8A", + "\x8C\xD1"=>"\xE8\xA2\xB4", + "\x8C\xD2"=>"\xE8\x82\xA1", + "\x8C\xD3"=>"\xE8\x83\xA1", + "\x8C\xD4"=>"\xE8\x8F\xB0", + "\x8C\xD5"=>"\xE8\x99\x8E", + "\x8C\xD6"=>"\xE8\xAA\x87", + "\x8C\xD7"=>"\xE8\xB7\xA8", + "\x8C\xD8"=>"\xE9\x88\xB7", + "\x8C\xD9"=>"\xE9\x9B\x87", + "\x8C\xDA"=>"\xE9\xA1\xA7", + "\x8C\xDB"=>"\xE9\xBC\x93", + "\x8C\xDC"=>"\xE4\xBA\x94", + "\x8C\xDD"=>"\xE4\xBA\x92", + "\x8C\xDE"=>"\xE4\xBC\x8D", + "\x8C\xDF"=>"\xE5\x8D\x88", + "\x8C\xE0"=>"\xE5\x91\x89", + "\x8C\xE1"=>"\xE5\x90\xBE", + "\x8C\xE2"=>"\xE5\xA8\xAF", + "\x8C\xE3"=>"\xE5\xBE\x8C", + "\x8C\xE4"=>"\xE5\xBE\xA1", + "\x8C\xE5"=>"\xE6\x82\x9F", + "\x8C\xE6"=>"\xE6\xA2\xA7", + "\x8C\xE7"=>"\xE6\xAA\x8E", + "\x8C\xE8"=>"\xE7\x91\x9A", + "\x8C\xE9"=>"\xE7\xA2\x81", + "\x8C\xEA"=>"\xE8\xAA\x9E", + "\x8C\xEB"=>"\xE8\xAA\xA4", + "\x8C\xEC"=>"\xE8\xAD\xB7", + "\x8C\xED"=>"\xE9\x86\x90", + "\x8C\xEE"=>"\xE4\xB9\x9E", + "\x8C\xEF"=>"\xE9\xAF\x89", + "\x8C\xF0"=>"\xE4\xBA\xA4", + "\x8C\xF1"=>"\xE4\xBD\xBC", + "\x8C\xF2"=>"\xE4\xBE\xAF", + "\x8C\xF3"=>"\xE5\x80\x99", + "\x8C\xF4"=>"\xE5\x80\x96", + "\x8C\xF5"=>"\xE5\x85\x89", + "\x8C\xF6"=>"\xE5\x85\xAC", + "\x8C\xF7"=>"\xE5\x8A\x9F", + "\x8C\xF8"=>"\xE5\x8A\xB9", + "\x8C\xF9"=>"\xE5\x8B\xBE", + "\x8C\xFA"=>"\xE5\x8E\x9A", + "\x8C\xFB"=>"\xE5\x8F\xA3", + "\x8C\xFC"=>"\xE5\x90\x91", + "\x8D\x40"=>"\xE5\x90\x8E", + "\x8D\x41"=>"\xE5\x96\x89", + "\x8D\x42"=>"\xE5\x9D\x91", + "\x8D\x43"=>"\xE5\x9E\xA2", + "\x8D\x44"=>"\xE5\xA5\xBD", + "\x8D\x45"=>"\xE5\xAD\x94", + "\x8D\x46"=>"\xE5\xAD\x9D", + "\x8D\x47"=>"\xE5\xAE\x8F", + "\x8D\x48"=>"\xE5\xB7\xA5", + "\x8D\x49"=>"\xE5\xB7\xA7", + "\x8D\x4A"=>"\xE5\xB7\xB7", + "\x8D\x4B"=>"\xE5\xB9\xB8", + "\x8D\x4C"=>"\xE5\xBA\x83", + "\x8D\x4D"=>"\xE5\xBA\x9A", + "\x8D\x4E"=>"\xE5\xBA\xB7", + "\x8D\x4F"=>"\xE5\xBC\x98", + "\x8D\x50"=>"\xE6\x81\x92", + "\x8D\x51"=>"\xE6\x85\x8C", + "\x8D\x52"=>"\xE6\x8A\x97", + "\x8D\x53"=>"\xE6\x8B\x98", + "\x8D\x54"=>"\xE6\x8E\xA7", + "\x8D\x55"=>"\xE6\x94\xBB", + "\x8D\x56"=>"\xE6\x98\x82", + "\x8D\x57"=>"\xE6\x99\x83", + "\x8D\x58"=>"\xE6\x9B\xB4", + "\x8D\x59"=>"\xE6\x9D\xAD", + "\x8D\x5A"=>"\xE6\xA0\xA1", + "\x8D\x5B"=>"\xE6\xA2\x97", + "\x8D\x5C"=>"\xE6\xA7\x8B", + "\x8D\x5D"=>"\xE6\xB1\x9F", + "\x8D\x5E"=>"\xE6\xB4\xAA", + "\x8D\x5F"=>"\xE6\xB5\xA9", + "\x8D\x60"=>"\xE6\xB8\xAF", + "\x8D\x61"=>"\xE6\xBA\x9D", + "\x8D\x62"=>"\xE7\x94\xB2", + "\x8D\x63"=>"\xE7\x9A\x87", + "\x8D\x64"=>"\xE7\xA1\xAC", + "\x8D\x65"=>"\xE7\xA8\xBF", + "\x8D\x66"=>"\xE7\xB3\xA0", + "\x8D\x67"=>"\xE7\xB4\x85", + "\x8D\x68"=>"\xE7\xB4\x98", + "\x8D\x69"=>"\xE7\xB5\x9E", + "\x8D\x6A"=>"\xE7\xB6\xB1", + "\x8D\x6B"=>"\xE8\x80\x95", + "\x8D\x6C"=>"\xE8\x80\x83", + "\x8D\x6D"=>"\xE8\x82\xAF", + "\x8D\x6E"=>"\xE8\x82\xB1", + "\x8D\x6F"=>"\xE8\x85\x94", + "\x8D\x70"=>"\xE8\x86\x8F", + "\x8D\x71"=>"\xE8\x88\xAA", + "\x8D\x72"=>"\xE8\x8D\x92", + "\x8D\x73"=>"\xE8\xA1\x8C", + "\x8D\x74"=>"\xE8\xA1\xA1", + "\x8D\x75"=>"\xE8\xAC\x9B", + "\x8D\x76"=>"\xE8\xB2\xA2", + "\x8D\x77"=>"\xE8\xB3\xBC", + "\x8D\x78"=>"\xE9\x83\x8A", + "\x8D\x79"=>"\xE9\x85\xB5", + "\x8D\x7A"=>"\xE9\x89\xB1", + "\x8D\x7B"=>"\xE7\xA0\xBF", + "\x8D\x7C"=>"\xE9\x8B\xBC", + "\x8D\x7D"=>"\xE9\x96\xA4", + "\x8D\x7E"=>"\xE9\x99\x8D", + "\x8D\x80"=>"\xE9\xA0\x85", + "\x8D\x81"=>"\xE9\xA6\x99", + "\x8D\x82"=>"\xE9\xAB\x98", + "\x8D\x83"=>"\xE9\xB4\xBB", + "\x8D\x84"=>"\xE5\x89\x9B", + "\x8D\x85"=>"\xE5\x8A\xAB", + "\x8D\x86"=>"\xE5\x8F\xB7", + "\x8D\x87"=>"\xE5\x90\x88", + "\x8D\x88"=>"\xE5\xA3\x95", + "\x8D\x89"=>"\xE6\x8B\xB7", + "\x8D\x8A"=>"\xE6\xBF\xA0", + "\x8D\x8B"=>"\xE8\xB1\xAA", + "\x8D\x8C"=>"\xE8\xBD\x9F", + "\x8D\x8D"=>"\xE9\xBA\xB9", + "\x8D\x8E"=>"\xE5\x85\x8B", + "\x8D\x8F"=>"\xE5\x88\xBB", + "\x8D\x90"=>"\xE5\x91\x8A", + "\x8D\x91"=>"\xE5\x9B\xBD", + "\x8D\x92"=>"\xE7\xA9\x80", + "\x8D\x93"=>"\xE9\x85\xB7", + "\x8D\x94"=>"\xE9\xB5\xA0", + "\x8D\x95"=>"\xE9\xBB\x92", + "\x8D\x96"=>"\xE7\x8D\x84", + "\x8D\x97"=>"\xE6\xBC\x89", + "\x8D\x98"=>"\xE8\x85\xB0", + "\x8D\x99"=>"\xE7\x94\x91", + "\x8D\x9A"=>"\xE5\xBF\xBD", + "\x8D\x9B"=>"\xE6\x83\x9A", + "\x8D\x9C"=>"\xE9\xAA\xA8", + "\x8D\x9D"=>"\xE7\x8B\x9B", + "\x8D\x9E"=>"\xE8\xBE\xBC", + "\x8D\x9F"=>"\xE6\xAD\xA4", + "\x8D\xA0"=>"\xE9\xA0\x83", + "\x8D\xA1"=>"\xE4\xBB\x8A", + "\x8D\xA2"=>"\xE5\x9B\xB0", + "\x8D\xA3"=>"\xE5\x9D\xA4", + "\x8D\xA4"=>"\xE5\xA2\xBE", + "\x8D\xA5"=>"\xE5\xA9\x9A", + "\x8D\xA6"=>"\xE6\x81\xA8", + "\x8D\xA7"=>"\xE6\x87\x87", + "\x8D\xA8"=>"\xE6\x98\x8F", + "\x8D\xA9"=>"\xE6\x98\x86", + "\x8D\xAA"=>"\xE6\xA0\xB9", + "\x8D\xAB"=>"\xE6\xA2\xB1", + "\x8D\xAC"=>"\xE6\xB7\xB7", + "\x8D\xAD"=>"\xE7\x97\x95", + "\x8D\xAE"=>"\xE7\xB4\xBA", + "\x8D\xAF"=>"\xE8\x89\xAE", + "\x8D\xB0"=>"\xE9\xAD\x82", + "\x8D\xB1"=>"\xE4\xBA\x9B", + "\x8D\xB2"=>"\xE4\xBD\x90", + "\x8D\xB3"=>"\xE5\x8F\x89", + "\x8D\xB4"=>"\xE5\x94\x86", + "\x8D\xB5"=>"\xE5\xB5\xAF", + "\x8D\xB6"=>"\xE5\xB7\xA6", + "\x8D\xB7"=>"\xE5\xB7\xAE", + "\x8D\xB8"=>"\xE6\x9F\xBB", + "\x8D\xB9"=>"\xE6\xB2\x99", + "\x8D\xBA"=>"\xE7\x91\xB3", + "\x8D\xBB"=>"\xE7\xA0\x82", + "\x8D\xBC"=>"\xE8\xA9\x90", + "\x8D\xBD"=>"\xE9\x8E\x96", + "\x8D\xBE"=>"\xE8\xA3\x9F", + "\x8D\xBF"=>"\xE5\x9D\x90", + "\x8D\xC0"=>"\xE5\xBA\xA7", + "\x8D\xC1"=>"\xE6\x8C\xAB", + "\x8D\xC2"=>"\xE5\x82\xB5", + "\x8D\xC3"=>"\xE5\x82\xAC", + "\x8D\xC4"=>"\xE5\x86\x8D", + "\x8D\xC5"=>"\xE6\x9C\x80", + "\x8D\xC6"=>"\xE5\x93\x89", + "\x8D\xC7"=>"\xE5\xA1\x9E", + "\x8D\xC8"=>"\xE5\xA6\xBB", + "\x8D\xC9"=>"\xE5\xAE\xB0", + "\x8D\xCA"=>"\xE5\xBD\xA9", + "\x8D\xCB"=>"\xE6\x89\x8D", + "\x8D\xCC"=>"\xE6\x8E\xA1", + "\x8D\xCD"=>"\xE6\xA0\xBD", + "\x8D\xCE"=>"\xE6\xAD\xB3", + "\x8D\xCF"=>"\xE6\xB8\x88", + "\x8D\xD0"=>"\xE7\x81\xBD", + "\x8D\xD1"=>"\xE9\x87\x87", + "\x8D\xD2"=>"\xE7\x8A\x80", + "\x8D\xD3"=>"\xE7\xA0\x95", + "\x8D\xD4"=>"\xE7\xA0\xA6", + "\x8D\xD5"=>"\xE7\xA5\xAD", + "\x8D\xD6"=>"\xE6\x96\x8E", + "\x8D\xD7"=>"\xE7\xB4\xB0", + "\x8D\xD8"=>"\xE8\x8F\x9C", + "\x8D\xD9"=>"\xE8\xA3\x81", + "\x8D\xDA"=>"\xE8\xBC\x89", + "\x8D\xDB"=>"\xE9\x9A\x9B", + "\x8D\xDC"=>"\xE5\x89\xA4", + "\x8D\xDD"=>"\xE5\x9C\xA8", + "\x8D\xDE"=>"\xE6\x9D\x90", + "\x8D\xDF"=>"\xE7\xBD\xAA", + "\x8D\xE0"=>"\xE8\xB2\xA1", + "\x8D\xE1"=>"\xE5\x86\xB4", + "\x8D\xE2"=>"\xE5\x9D\x82", + "\x8D\xE3"=>"\xE9\x98\xAA", + "\x8D\xE4"=>"\xE5\xA0\xBA", + "\x8D\xE5"=>"\xE6\xA6\x8A", + "\x8D\xE6"=>"\xE8\x82\xB4", + "\x8D\xE7"=>"\xE5\x92\xB2", + "\x8D\xE8"=>"\xE5\xB4\x8E", + "\x8D\xE9"=>"\xE5\x9F\xBC", + "\x8D\xEA"=>"\xE7\xA2\x95", + "\x8D\xEB"=>"\xE9\xB7\xBA", + "\x8D\xEC"=>"\xE4\xBD\x9C", + "\x8D\xED"=>"\xE5\x89\x8A", + "\x8D\xEE"=>"\xE5\x92\x8B", + "\x8D\xEF"=>"\xE6\x90\xBE", + "\x8D\xF0"=>"\xE6\x98\xA8", + "\x8D\xF1"=>"\xE6\x9C\x94", + "\x8D\xF2"=>"\xE6\x9F\xB5", + "\x8D\xF3"=>"\xE7\xAA\x84", + "\x8D\xF4"=>"\xE7\xAD\x96", + "\x8D\xF5"=>"\xE7\xB4\xA2", + "\x8D\xF6"=>"\xE9\x8C\xAF", + "\x8D\xF7"=>"\xE6\xA1\x9C", + "\x8D\xF8"=>"\xE9\xAE\xAD", + "\x8D\xF9"=>"\xE7\xAC\xB9", + "\x8D\xFA"=>"\xE5\x8C\x99", + "\x8D\xFB"=>"\xE5\x86\x8A", + "\x8D\xFC"=>"\xE5\x88\xB7", + "\x8E\x40"=>"\xE5\xAF\x9F", + "\x8E\x41"=>"\xE6\x8B\xB6", + "\x8E\x42"=>"\xE6\x92\xAE", + "\x8E\x43"=>"\xE6\x93\xA6", + "\x8E\x44"=>"\xE6\x9C\xAD", + "\x8E\x45"=>"\xE6\xAE\xBA", + "\x8E\x46"=>"\xE8\x96\xA9", + "\x8E\x47"=>"\xE9\x9B\x91", + "\x8E\x48"=>"\xE7\x9A\x90", + "\x8E\x49"=>"\xE9\xAF\x96", + "\x8E\x4A"=>"\xE6\x8D\x8C", + "\x8E\x4B"=>"\xE9\x8C\x86", + "\x8E\x4C"=>"\xE9\xAE\xAB", + "\x8E\x4D"=>"\xE7\x9A\xBF", + "\x8E\x4E"=>"\xE6\x99\x92", + "\x8E\x4F"=>"\xE4\xB8\x89", + "\x8E\x50"=>"\xE5\x82\x98", + "\x8E\x51"=>"\xE5\x8F\x82", + "\x8E\x52"=>"\xE5\xB1\xB1", + "\x8E\x53"=>"\xE6\x83\xA8", + "\x8E\x54"=>"\xE6\x92\x92", + "\x8E\x55"=>"\xE6\x95\xA3", + "\x8E\x56"=>"\xE6\xA1\x9F", + "\x8E\x57"=>"\xE7\x87\xA6", + "\x8E\x58"=>"\xE7\x8F\x8A", + "\x8E\x59"=>"\xE7\x94\xA3", + "\x8E\x5A"=>"\xE7\xAE\x97", + "\x8E\x5B"=>"\xE7\xBA\x82", + "\x8E\x5C"=>"\xE8\x9A\x95", + "\x8E\x5D"=>"\xE8\xAE\x83", + "\x8E\x5E"=>"\xE8\xB3\x9B", + "\x8E\x5F"=>"\xE9\x85\xB8", + "\x8E\x60"=>"\xE9\xA4\x90", + "\x8E\x61"=>"\xE6\x96\xAC", + "\x8E\x62"=>"\xE6\x9A\xAB", + "\x8E\x63"=>"\xE6\xAE\x8B", + "\x8E\x64"=>"\xE4\xBB\x95", + "\x8E\x65"=>"\xE4\xBB\x94", + "\x8E\x66"=>"\xE4\xBC\xBA", + "\x8E\x67"=>"\xE4\xBD\xBF", + "\x8E\x68"=>"\xE5\x88\xBA", + "\x8E\x69"=>"\xE5\x8F\xB8", + "\x8E\x6A"=>"\xE5\x8F\xB2", + "\x8E\x6B"=>"\xE5\x97\xA3", + "\x8E\x6C"=>"\xE5\x9B\x9B", + "\x8E\x6D"=>"\xE5\xA3\xAB", + "\x8E\x6E"=>"\xE5\xA7\x8B", + "\x8E\x6F"=>"\xE5\xA7\x89", + "\x8E\x70"=>"\xE5\xA7\xBF", + "\x8E\x71"=>"\xE5\xAD\x90", + "\x8E\x72"=>"\xE5\xB1\x8D", + "\x8E\x73"=>"\xE5\xB8\x82", + "\x8E\x74"=>"\xE5\xB8\xAB", + "\x8E\x75"=>"\xE5\xBF\x97", + "\x8E\x76"=>"\xE6\x80\x9D", + "\x8E\x77"=>"\xE6\x8C\x87", + "\x8E\x78"=>"\xE6\x94\xAF", + "\x8E\x79"=>"\xE5\xAD\x9C", + "\x8E\x7A"=>"\xE6\x96\xAF", + "\x8E\x7B"=>"\xE6\x96\xBD", + "\x8E\x7C"=>"\xE6\x97\xA8", + "\x8E\x7D"=>"\xE6\x9E\x9D", + "\x8E\x7E"=>"\xE6\xAD\xA2", + "\x8E\x80"=>"\xE6\xAD\xBB", + "\x8E\x81"=>"\xE6\xB0\x8F", + "\x8E\x82"=>"\xE7\x8D\x85", + "\x8E\x83"=>"\xE7\xA5\x89", + "\x8E\x84"=>"\xE7\xA7\x81", + "\x8E\x85"=>"\xE7\xB3\xB8", + "\x8E\x86"=>"\xE7\xB4\x99", + "\x8E\x87"=>"\xE7\xB4\xAB", + "\x8E\x88"=>"\xE8\x82\xA2", + "\x8E\x89"=>"\xE8\x84\x82", + "\x8E\x8A"=>"\xE8\x87\xB3", + "\x8E\x8B"=>"\xE8\xA6\x96", + "\x8E\x8C"=>"\xE8\xA9\x9E", + "\x8E\x8D"=>"\xE8\xA9\xA9", + "\x8E\x8E"=>"\xE8\xA9\xA6", + "\x8E\x8F"=>"\xE8\xAA\x8C", + "\x8E\x90"=>"\xE8\xAB\xAE", + "\x8E\x91"=>"\xE8\xB3\x87", + "\x8E\x92"=>"\xE8\xB3\x9C", + "\x8E\x93"=>"\xE9\x9B\x8C", + "\x8E\x94"=>"\xE9\xA3\xBC", + "\x8E\x95"=>"\xE6\xAD\xAF", + "\x8E\x96"=>"\xE4\xBA\x8B", + "\x8E\x97"=>"\xE4\xBC\xBC", + "\x8E\x98"=>"\xE4\xBE\x8D", + "\x8E\x99"=>"\xE5\x85\x90", + "\x8E\x9A"=>"\xE5\xAD\x97", + "\x8E\x9B"=>"\xE5\xAF\xBA", + "\x8E\x9C"=>"\xE6\x85\x88", + "\x8E\x9D"=>"\xE6\x8C\x81", + "\x8E\x9E"=>"\xE6\x99\x82", + "\x8E\x9F"=>"\xE6\xAC\xA1", + "\x8E\xA0"=>"\xE6\xBB\x8B", + "\x8E\xA1"=>"\xE6\xB2\xBB", + "\x8E\xA2"=>"\xE7\x88\xBE", + "\x8E\xA3"=>"\xE7\x92\xBD", + "\x8E\xA4"=>"\xE7\x97\x94", + "\x8E\xA5"=>"\xE7\xA3\x81", + "\x8E\xA6"=>"\xE7\xA4\xBA", + "\x8E\xA7"=>"\xE8\x80\x8C", + "\x8E\xA8"=>"\xE8\x80\xB3", + "\x8E\xA9"=>"\xE8\x87\xAA", + "\x8E\xAA"=>"\xE8\x92\x94", + "\x8E\xAB"=>"\xE8\xBE\x9E", + "\x8E\xAC"=>"\xE6\xB1\x90", + "\x8E\xAD"=>"\xE9\xB9\xBF", + "\x8E\xAE"=>"\xE5\xBC\x8F", + "\x8E\xAF"=>"\xE8\xAD\x98", + "\x8E\xB0"=>"\xE9\xB4\xAB", + "\x8E\xB1"=>"\xE7\xAB\xBA", + "\x8E\xB2"=>"\xE8\xBB\xB8", + "\x8E\xB3"=>"\xE5\xAE\x8D", + "\x8E\xB4"=>"\xE9\x9B\xAB", + "\x8E\xB5"=>"\xE4\xB8\x83", + "\x8E\xB6"=>"\xE5\x8F\xB1", + "\x8E\xB7"=>"\xE5\x9F\xB7", + "\x8E\xB8"=>"\xE5\xA4\xB1", + "\x8E\xB9"=>"\xE5\xAB\x89", + "\x8E\xBA"=>"\xE5\xAE\xA4", + "\x8E\xBB"=>"\xE6\x82\x89", + "\x8E\xBC"=>"\xE6\xB9\xBF", + "\x8E\xBD"=>"\xE6\xBC\x86", + "\x8E\xBE"=>"\xE7\x96\xBE", + "\x8E\xBF"=>"\xE8\xB3\xAA", + "\x8E\xC0"=>"\xE5\xAE\x9F", + "\x8E\xC1"=>"\xE8\x94\x80", + "\x8E\xC2"=>"\xE7\xAF\xA0", + "\x8E\xC3"=>"\xE5\x81\xB2", + "\x8E\xC4"=>"\xE6\x9F\xB4", + "\x8E\xC5"=>"\xE8\x8A\x9D", + "\x8E\xC6"=>"\xE5\xB1\xA1", + "\x8E\xC7"=>"\xE8\x95\x8A", + "\x8E\xC8"=>"\xE7\xB8\x9E", + "\x8E\xC9"=>"\xE8\x88\x8E", + "\x8E\xCA"=>"\xE5\x86\x99", + "\x8E\xCB"=>"\xE5\xB0\x84", + "\x8E\xCC"=>"\xE6\x8D\xA8", + "\x8E\xCD"=>"\xE8\xB5\xA6", + "\x8E\xCE"=>"\xE6\x96\x9C", + "\x8E\xCF"=>"\xE7\x85\xAE", + "\x8E\xD0"=>"\xE7\xA4\xBE", + "\x8E\xD1"=>"\xE7\xB4\x97", + "\x8E\xD2"=>"\xE8\x80\x85", + "\x8E\xD3"=>"\xE8\xAC\x9D", + "\x8E\xD4"=>"\xE8\xBB\x8A", + "\x8E\xD5"=>"\xE9\x81\xAE", + "\x8E\xD6"=>"\xE8\x9B\x87", + "\x8E\xD7"=>"\xE9\x82\xAA", + "\x8E\xD8"=>"\xE5\x80\x9F", + "\x8E\xD9"=>"\xE5\x8B\xBA", + "\x8E\xDA"=>"\xE5\xB0\xBA", + "\x8E\xDB"=>"\xE6\x9D\x93", + "\x8E\xDC"=>"\xE7\x81\xBC", + "\x8E\xDD"=>"\xE7\x88\xB5", + "\x8E\xDE"=>"\xE9\x85\x8C", + "\x8E\xDF"=>"\xE9\x87\x88", + "\x8E\xE0"=>"\xE9\x8C\xAB", + "\x8E\xE1"=>"\xE8\x8B\xA5", + "\x8E\xE2"=>"\xE5\xAF\x82", + "\x8E\xE3"=>"\xE5\xBC\xB1", + "\x8E\xE4"=>"\xE6\x83\xB9", + "\x8E\xE5"=>"\xE4\xB8\xBB", + "\x8E\xE6"=>"\xE5\x8F\x96", + "\x8E\xE7"=>"\xE5\xAE\x88", + "\x8E\xE8"=>"\xE6\x89\x8B", + "\x8E\xE9"=>"\xE6\x9C\xB1", + "\x8E\xEA"=>"\xE6\xAE\x8A", + "\x8E\xEB"=>"\xE7\x8B\xA9", + "\x8E\xEC"=>"\xE7\x8F\xA0", + "\x8E\xED"=>"\xE7\xA8\xAE", + "\x8E\xEE"=>"\xE8\x85\xAB", + "\x8E\xEF"=>"\xE8\xB6\xA3", + "\x8E\xF0"=>"\xE9\x85\x92", + "\x8E\xF1"=>"\xE9\xA6\x96", + "\x8E\xF2"=>"\xE5\x84\x92", + "\x8E\xF3"=>"\xE5\x8F\x97", + "\x8E\xF4"=>"\xE5\x91\xAA", + "\x8E\xF5"=>"\xE5\xAF\xBF", + "\x8E\xF6"=>"\xE6\x8E\x88", + "\x8E\xF7"=>"\xE6\xA8\xB9", + "\x8E\xF8"=>"\xE7\xB6\xAC", + "\x8E\xF9"=>"\xE9\x9C\x80", + "\x8E\xFA"=>"\xE5\x9B\x9A", + "\x8E\xFB"=>"\xE5\x8F\x8E", + "\x8E\xFC"=>"\xE5\x91\xA8", + "\x8F\x40"=>"\xE5\xAE\x97", + "\x8F\x41"=>"\xE5\xB0\xB1", + "\x8F\x42"=>"\xE5\xB7\x9E", + "\x8F\x43"=>"\xE4\xBF\xAE", + "\x8F\x44"=>"\xE6\x84\x81", + "\x8F\x45"=>"\xE6\x8B\xBE", + "\x8F\x46"=>"\xE6\xB4\xB2", + "\x8F\x47"=>"\xE7\xA7\x80", + "\x8F\x48"=>"\xE7\xA7\x8B", + "\x8F\x49"=>"\xE7\xB5\x82", + "\x8F\x4A"=>"\xE7\xB9\x8D", + "\x8F\x4B"=>"\xE7\xBF\x92", + "\x8F\x4C"=>"\xE8\x87\xAD", + "\x8F\x4D"=>"\xE8\x88\x9F", + "\x8F\x4E"=>"\xE8\x92\x90", + "\x8F\x4F"=>"\xE8\xA1\x86", + "\x8F\x50"=>"\xE8\xA5\xB2", + "\x8F\x51"=>"\xE8\xAE\x90", + "\x8F\x52"=>"\xE8\xB9\xB4", + "\x8F\x53"=>"\xE8\xBC\xAF", + "\x8F\x54"=>"\xE9\x80\xB1", + "\x8F\x55"=>"\xE9\x85\x8B", + "\x8F\x56"=>"\xE9\x85\xAC", + "\x8F\x57"=>"\xE9\x9B\x86", + "\x8F\x58"=>"\xE9\x86\x9C", + "\x8F\x59"=>"\xE4\xBB\x80", + "\x8F\x5A"=>"\xE4\xBD\x8F", + "\x8F\x5B"=>"\xE5\x85\x85", + "\x8F\x5C"=>"\xE5\x8D\x81", + "\x8F\x5D"=>"\xE5\xBE\x93", + "\x8F\x5E"=>"\xE6\x88\x8E", + "\x8F\x5F"=>"\xE6\x9F\x94", + "\x8F\x60"=>"\xE6\xB1\x81", + "\x8F\x61"=>"\xE6\xB8\x8B", + "\x8F\x62"=>"\xE7\x8D\xA3", + "\x8F\x63"=>"\xE7\xB8\xA6", + "\x8F\x64"=>"\xE9\x87\x8D", + "\x8F\x65"=>"\xE9\x8A\x83", + "\x8F\x66"=>"\xE5\x8F\x94", + "\x8F\x67"=>"\xE5\xA4\x99", + "\x8F\x68"=>"\xE5\xAE\xBF", + "\x8F\x69"=>"\xE6\xB7\x91", + "\x8F\x6A"=>"\xE7\xA5\x9D", + "\x8F\x6B"=>"\xE7\xB8\xAE", + "\x8F\x6C"=>"\xE7\xB2\x9B", + "\x8F\x6D"=>"\xE5\xA1\xBE", + "\x8F\x6E"=>"\xE7\x86\x9F", + "\x8F\x6F"=>"\xE5\x87\xBA", + "\x8F\x70"=>"\xE8\xA1\x93", + "\x8F\x71"=>"\xE8\xBF\xB0", + "\x8F\x72"=>"\xE4\xBF\x8A", + "\x8F\x73"=>"\xE5\xB3\xBB", + "\x8F\x74"=>"\xE6\x98\xA5", + "\x8F\x75"=>"\xE7\x9E\xAC", + "\x8F\x76"=>"\xE7\xAB\xA3", + "\x8F\x77"=>"\xE8\x88\x9C", + "\x8F\x78"=>"\xE9\xA7\xBF", + "\x8F\x79"=>"\xE5\x87\x86", + "\x8F\x7A"=>"\xE5\xBE\xAA", + "\x8F\x7B"=>"\xE6\x97\xAC", + "\x8F\x7C"=>"\xE6\xA5\xAF", + "\x8F\x7D"=>"\xE6\xAE\x89", + "\x8F\x7E"=>"\xE6\xB7\xB3", + "\x8F\x80"=>"\xE6\xBA\x96", + "\x8F\x81"=>"\xE6\xBD\xA4", + "\x8F\x82"=>"\xE7\x9B\xBE", + "\x8F\x83"=>"\xE7\xB4\x94", + "\x8F\x84"=>"\xE5\xB7\xA1", + "\x8F\x85"=>"\xE9\x81\xB5", + "\x8F\x86"=>"\xE9\x86\x87", + "\x8F\x87"=>"\xE9\xA0\x86", + "\x8F\x88"=>"\xE5\x87\xA6", + "\x8F\x89"=>"\xE5\x88\x9D", + "\x8F\x8A"=>"\xE6\x89\x80", + "\x8F\x8B"=>"\xE6\x9A\x91", + "\x8F\x8C"=>"\xE6\x9B\x99", + "\x8F\x8D"=>"\xE6\xB8\x9A", + "\x8F\x8E"=>"\xE5\xBA\xB6", + "\x8F\x8F"=>"\xE7\xB7\x92", + "\x8F\x90"=>"\xE7\xBD\xB2", + "\x8F\x91"=>"\xE6\x9B\xB8", + "\x8F\x92"=>"\xE8\x96\xAF", + "\x8F\x93"=>"\xE8\x97\xB7", + "\x8F\x94"=>"\xE8\xAB\xB8", + "\x8F\x95"=>"\xE5\x8A\xA9", + "\x8F\x96"=>"\xE5\x8F\x99", + "\x8F\x97"=>"\xE5\xA5\xB3", + "\x8F\x98"=>"\xE5\xBA\x8F", + "\x8F\x99"=>"\xE5\xBE\x90", + "\x8F\x9A"=>"\xE6\x81\x95", + "\x8F\x9B"=>"\xE9\x8B\xA4", + "\x8F\x9C"=>"\xE9\x99\xA4", + "\x8F\x9D"=>"\xE5\x82\xB7", + "\x8F\x9E"=>"\xE5\x84\x9F", + "\x8F\x9F"=>"\xE5\x8B\x9D", + "\x8F\xA0"=>"\xE5\x8C\xA0", + "\x8F\xA1"=>"\xE5\x8D\x87", + "\x8F\xA2"=>"\xE5\x8F\xAC", + "\x8F\xA3"=>"\xE5\x93\xA8", + "\x8F\xA4"=>"\xE5\x95\x86", + "\x8F\xA5"=>"\xE5\x94\xB1", + "\x8F\xA6"=>"\xE5\x98\x97", + "\x8F\xA7"=>"\xE5\xA5\xA8", + "\x8F\xA8"=>"\xE5\xA6\xBE", + "\x8F\xA9"=>"\xE5\xA8\xBC", + "\x8F\xAA"=>"\xE5\xAE\xB5", + "\x8F\xAB"=>"\xE5\xB0\x86", + "\x8F\xAC"=>"\xE5\xB0\x8F", + "\x8F\xAD"=>"\xE5\xB0\x91", + "\x8F\xAE"=>"\xE5\xB0\x9A", + "\x8F\xAF"=>"\xE5\xBA\x84", + "\x8F\xB0"=>"\xE5\xBA\x8A", + "\x8F\xB1"=>"\xE5\xBB\xA0", + "\x8F\xB2"=>"\xE5\xBD\xB0", + "\x8F\xB3"=>"\xE6\x89\xBF", + "\x8F\xB4"=>"\xE6\x8A\x84", + "\x8F\xB5"=>"\xE6\x8B\x9B", + "\x8F\xB6"=>"\xE6\x8E\x8C", + "\x8F\xB7"=>"\xE6\x8D\xB7", + "\x8F\xB8"=>"\xE6\x98\x87", + "\x8F\xB9"=>"\xE6\x98\x8C", + "\x8F\xBA"=>"\xE6\x98\xAD", + "\x8F\xBB"=>"\xE6\x99\xB6", + "\x8F\xBC"=>"\xE6\x9D\xBE", + "\x8F\xBD"=>"\xE6\xA2\xA2", + "\x8F\xBE"=>"\xE6\xA8\x9F", + "\x8F\xBF"=>"\xE6\xA8\xB5", + "\x8F\xC0"=>"\xE6\xB2\xBC", + "\x8F\xC1"=>"\xE6\xB6\x88", + "\x8F\xC2"=>"\xE6\xB8\x89", + "\x8F\xC3"=>"\xE6\xB9\x98", + "\x8F\xC4"=>"\xE7\x84\xBC", + "\x8F\xC5"=>"\xE7\x84\xA6", + "\x8F\xC6"=>"\xE7\x85\xA7", + "\x8F\xC7"=>"\xE7\x97\x87", + "\x8F\xC8"=>"\xE7\x9C\x81", + "\x8F\xC9"=>"\xE7\xA1\x9D", + "\x8F\xCA"=>"\xE7\xA4\x81", + "\x8F\xCB"=>"\xE7\xA5\xA5", + "\x8F\xCC"=>"\xE7\xA7\xB0", + "\x8F\xCD"=>"\xE7\xAB\xA0", + "\x8F\xCE"=>"\xE7\xAC\x91", + "\x8F\xCF"=>"\xE7\xB2\xA7", + "\x8F\xD0"=>"\xE7\xB4\xB9", + "\x8F\xD1"=>"\xE8\x82\x96", + "\x8F\xD2"=>"\xE8\x8F\x96", + "\x8F\xD3"=>"\xE8\x92\x8B", + "\x8F\xD4"=>"\xE8\x95\x89", + "\x8F\xD5"=>"\xE8\xA1\x9D", + "\x8F\xD6"=>"\xE8\xA3\xB3", + "\x8F\xD7"=>"\xE8\xA8\x9F", + "\x8F\xD8"=>"\xE8\xA8\xBC", + "\x8F\xD9"=>"\xE8\xA9\x94", + "\x8F\xDA"=>"\xE8\xA9\xB3", + "\x8F\xDB"=>"\xE8\xB1\xA1", + "\x8F\xDC"=>"\xE8\xB3\x9E", + "\x8F\xDD"=>"\xE9\x86\xA4", + "\x8F\xDE"=>"\xE9\x89\xA6", + "\x8F\xDF"=>"\xE9\x8D\xBE", + "\x8F\xE0"=>"\xE9\x90\x98", + "\x8F\xE1"=>"\xE9\x9A\x9C", + "\x8F\xE2"=>"\xE9\x9E\x98", + "\x8F\xE3"=>"\xE4\xB8\x8A", + "\x8F\xE4"=>"\xE4\xB8\x88", + "\x8F\xE5"=>"\xE4\xB8\x9E", + "\x8F\xE6"=>"\xE4\xB9\x97", + "\x8F\xE7"=>"\xE5\x86\x97", + "\x8F\xE8"=>"\xE5\x89\xB0", + "\x8F\xE9"=>"\xE5\x9F\x8E", + "\x8F\xEA"=>"\xE5\xA0\xB4", + "\x8F\xEB"=>"\xE5\xA3\x8C", + "\x8F\xEC"=>"\xE5\xAC\xA2", + "\x8F\xED"=>"\xE5\xB8\xB8", + "\x8F\xEE"=>"\xE6\x83\x85", + "\x8F\xEF"=>"\xE6\x93\xBE", + "\x8F\xF0"=>"\xE6\x9D\xA1", + "\x8F\xF1"=>"\xE6\x9D\x96", + "\x8F\xF2"=>"\xE6\xB5\x84", + "\x8F\xF3"=>"\xE7\x8A\xB6", + "\x8F\xF4"=>"\xE7\x95\xB3", + "\x8F\xF5"=>"\xE7\xA9\xA3", + "\x8F\xF6"=>"\xE8\x92\xB8", + "\x8F\xF7"=>"\xE8\xAD\xB2", + "\x8F\xF8"=>"\xE9\x86\xB8", + "\x8F\xF9"=>"\xE9\x8C\xA0", + "\x8F\xFA"=>"\xE5\x98\xB1", + "\x8F\xFB"=>"\xE5\x9F\xB4", + "\x8F\xFC"=>"\xE9\xA3\xBE", + "\x90\x40"=>"\xE6\x8B\xAD", + "\x90\x41"=>"\xE6\xA4\x8D", + "\x90\x42"=>"\xE6\xAE\x96", + "\x90\x43"=>"\xE7\x87\xAD", + "\x90\x44"=>"\xE7\xB9\x94", + "\x90\x45"=>"\xE8\x81\xB7", + "\x90\x46"=>"\xE8\x89\xB2", + "\x90\x47"=>"\xE8\xA7\xA6", + "\x90\x48"=>"\xE9\xA3\x9F", + "\x90\x49"=>"\xE8\x9D\x95", + "\x90\x4A"=>"\xE8\xBE\xB1", + "\x90\x4B"=>"\xE5\xB0\xBB", + "\x90\x4C"=>"\xE4\xBC\xB8", + "\x90\x4D"=>"\xE4\xBF\xA1", + "\x90\x4E"=>"\xE4\xBE\xB5", + "\x90\x4F"=>"\xE5\x94\x87", + "\x90\x50"=>"\xE5\xA8\xA0", + "\x90\x51"=>"\xE5\xAF\x9D", + "\x90\x52"=>"\xE5\xAF\xA9", + "\x90\x53"=>"\xE5\xBF\x83", + "\x90\x54"=>"\xE6\x85\x8E", + "\x90\x55"=>"\xE6\x8C\xAF", + "\x90\x56"=>"\xE6\x96\xB0", + "\x90\x57"=>"\xE6\x99\x8B", + "\x90\x58"=>"\xE6\xA3\xAE", + "\x90\x59"=>"\xE6\xA6\x9B", + "\x90\x5A"=>"\xE6\xB5\xB8", + "\x90\x5B"=>"\xE6\xB7\xB1", + "\x90\x5C"=>"\xE7\x94\xB3", + "\x90\x5D"=>"\xE7\x96\xB9", + "\x90\x5E"=>"\xE7\x9C\x9F", + "\x90\x5F"=>"\xE7\xA5\x9E", + "\x90\x60"=>"\xE7\xA7\xA6", + "\x90\x61"=>"\xE7\xB4\xB3", + "\x90\x62"=>"\xE8\x87\xA3", + "\x90\x63"=>"\xE8\x8A\xAF", + "\x90\x64"=>"\xE8\x96\xAA", + "\x90\x65"=>"\xE8\xA6\xAA", + "\x90\x66"=>"\xE8\xA8\xBA", + "\x90\x67"=>"\xE8\xBA\xAB", + "\x90\x68"=>"\xE8\xBE\x9B", + "\x90\x69"=>"\xE9\x80\xB2", + "\x90\x6A"=>"\xE9\x87\x9D", + "\x90\x6B"=>"\xE9\x9C\x87", + "\x90\x6C"=>"\xE4\xBA\xBA", + "\x90\x6D"=>"\xE4\xBB\x81", + "\x90\x6E"=>"\xE5\x88\x83", + "\x90\x6F"=>"\xE5\xA1\xB5", + "\x90\x70"=>"\xE5\xA3\xAC", + "\x90\x71"=>"\xE5\xB0\x8B", + "\x90\x72"=>"\xE7\x94\x9A", + "\x90\x73"=>"\xE5\xB0\xBD", + "\x90\x74"=>"\xE8\x85\x8E", + "\x90\x75"=>"\xE8\xA8\x8A", + "\x90\x76"=>"\xE8\xBF\x85", + "\x90\x77"=>"\xE9\x99\xA3", + "\x90\x78"=>"\xE9\x9D\xAD", + "\x90\x79"=>"\xE7\xAC\xA5", + "\x90\x7A"=>"\xE8\xAB\x8F", + "\x90\x7B"=>"\xE9\xA0\x88", + "\x90\x7C"=>"\xE9\x85\xA2", + "\x90\x7D"=>"\xE5\x9B\xB3", + "\x90\x7E"=>"\xE5\x8E\xA8", + "\x90\x80"=>"\xE9\x80\x97", + "\x90\x81"=>"\xE5\x90\xB9", + "\x90\x82"=>"\xE5\x9E\x82", + "\x90\x83"=>"\xE5\xB8\xA5", + "\x90\x84"=>"\xE6\x8E\xA8", + "\x90\x85"=>"\xE6\xB0\xB4", + "\x90\x86"=>"\xE7\x82\x8A", + "\x90\x87"=>"\xE7\x9D\xA1", + "\x90\x88"=>"\xE7\xB2\x8B", + "\x90\x89"=>"\xE7\xBF\xA0", + "\x90\x8A"=>"\xE8\xA1\xB0", + "\x90\x8B"=>"\xE9\x81\x82", + "\x90\x8C"=>"\xE9\x85\x94", + "\x90\x8D"=>"\xE9\x8C\x90", + "\x90\x8E"=>"\xE9\x8C\x98", + "\x90\x8F"=>"\xE9\x9A\x8F", + "\x90\x90"=>"\xE7\x91\x9E", + "\x90\x91"=>"\xE9\xAB\x84", + "\x90\x92"=>"\xE5\xB4\x87", + "\x90\x93"=>"\xE5\xB5\xA9", + "\x90\x94"=>"\xE6\x95\xB0", + "\x90\x95"=>"\xE6\x9E\xA2", + "\x90\x96"=>"\xE8\xB6\xA8", + "\x90\x97"=>"\xE9\x9B\x9B", + "\x90\x98"=>"\xE6\x8D\xAE", + "\x90\x99"=>"\xE6\x9D\x89", + "\x90\x9A"=>"\xE6\xA4\x99", + "\x90\x9B"=>"\xE8\x8F\x85", + "\x90\x9C"=>"\xE9\xA0\x97", + "\x90\x9D"=>"\xE9\x9B\x80", + "\x90\x9E"=>"\xE8\xA3\xBE", + "\x90\x9F"=>"\xE6\xBE\x84", + "\x90\xA0"=>"\xE6\x91\xBA", + "\x90\xA1"=>"\xE5\xAF\xB8", + "\x90\xA2"=>"\xE4\xB8\x96", + "\x90\xA3"=>"\xE7\x80\xAC", + "\x90\xA4"=>"\xE7\x95\x9D", + "\x90\xA5"=>"\xE6\x98\xAF", + "\x90\xA6"=>"\xE5\x87\x84", + "\x90\xA7"=>"\xE5\x88\xB6", + "\x90\xA8"=>"\xE5\x8B\xA2", + "\x90\xA9"=>"\xE5\xA7\x93", + "\x90\xAA"=>"\xE5\xBE\x81", + "\x90\xAB"=>"\xE6\x80\xA7", + "\x90\xAC"=>"\xE6\x88\x90", + "\x90\xAD"=>"\xE6\x94\xBF", + "\x90\xAE"=>"\xE6\x95\xB4", + "\x90\xAF"=>"\xE6\x98\x9F", + "\x90\xB0"=>"\xE6\x99\xB4", + "\x90\xB1"=>"\xE6\xA3\xB2", + "\x90\xB2"=>"\xE6\xA0\x96", + "\x90\xB3"=>"\xE6\xAD\xA3", + "\x90\xB4"=>"\xE6\xB8\x85", + "\x90\xB5"=>"\xE7\x89\xB2", + "\x90\xB6"=>"\xE7\x94\x9F", + "\x90\xB7"=>"\xE7\x9B\x9B", + "\x90\xB8"=>"\xE7\xB2\xBE", + "\x90\xB9"=>"\xE8\x81\x96", + "\x90\xBA"=>"\xE5\xA3\xB0", + "\x90\xBB"=>"\xE8\xA3\xBD", + "\x90\xBC"=>"\xE8\xA5\xBF", + "\x90\xBD"=>"\xE8\xAA\xA0", + "\x90\xBE"=>"\xE8\xAA\x93", + "\x90\xBF"=>"\xE8\xAB\x8B", + "\x90\xC0"=>"\xE9\x80\x9D", + "\x90\xC1"=>"\xE9\x86\x92", + "\x90\xC2"=>"\xE9\x9D\x92", + "\x90\xC3"=>"\xE9\x9D\x99", + "\x90\xC4"=>"\xE6\x96\x89", + "\x90\xC5"=>"\xE7\xA8\x8E", + "\x90\xC6"=>"\xE8\x84\x86", + "\x90\xC7"=>"\xE9\x9A\xBB", + "\x90\xC8"=>"\xE5\xB8\xAD", + "\x90\xC9"=>"\xE6\x83\x9C", + "\x90\xCA"=>"\xE6\x88\x9A", + "\x90\xCB"=>"\xE6\x96\xA5", + "\x90\xCC"=>"\xE6\x98\x94", + "\x90\xCD"=>"\xE6\x9E\x90", + "\x90\xCE"=>"\xE7\x9F\xB3", + "\x90\xCF"=>"\xE7\xA9\x8D", + "\x90\xD0"=>"\xE7\xB1\x8D", + "\x90\xD1"=>"\xE7\xB8\xBE", + "\x90\xD2"=>"\xE8\x84\x8A", + "\x90\xD3"=>"\xE8\xB2\xAC", + "\x90\xD4"=>"\xE8\xB5\xA4", + "\x90\xD5"=>"\xE8\xB7\xA1", + "\x90\xD6"=>"\xE8\xB9\x9F", + "\x90\xD7"=>"\xE7\xA2\xA9", + "\x90\xD8"=>"\xE5\x88\x87", + "\x90\xD9"=>"\xE6\x8B\x99", + "\x90\xDA"=>"\xE6\x8E\xA5", + "\x90\xDB"=>"\xE6\x91\x82", + "\x90\xDC"=>"\xE6\x8A\x98", + "\x90\xDD"=>"\xE8\xA8\xAD", + "\x90\xDE"=>"\xE7\xAA\x83", + "\x90\xDF"=>"\xE7\xAF\x80", + "\x90\xE0"=>"\xE8\xAA\xAC", + "\x90\xE1"=>"\xE9\x9B\xAA", + "\x90\xE2"=>"\xE7\xB5\xB6", + "\x90\xE3"=>"\xE8\x88\x8C", + "\x90\xE4"=>"\xE8\x9D\x89", + "\x90\xE5"=>"\xE4\xBB\x99", + "\x90\xE6"=>"\xE5\x85\x88", + "\x90\xE7"=>"\xE5\x8D\x83", + "\x90\xE8"=>"\xE5\x8D\xA0", + "\x90\xE9"=>"\xE5\xAE\xA3", + "\x90\xEA"=>"\xE5\xB0\x82", + "\x90\xEB"=>"\xE5\xB0\x96", + "\x90\xEC"=>"\xE5\xB7\x9D", + "\x90\xED"=>"\xE6\x88\xA6", + "\x90\xEE"=>"\xE6\x89\x87", + "\x90\xEF"=>"\xE6\x92\xB0", + "\x90\xF0"=>"\xE6\xA0\x93", + "\x90\xF1"=>"\xE6\xA0\xB4", + "\x90\xF2"=>"\xE6\xB3\x89", + "\x90\xF3"=>"\xE6\xB5\x85", + "\x90\xF4"=>"\xE6\xB4\x97", + "\x90\xF5"=>"\xE6\x9F\x93", + "\x90\xF6"=>"\xE6\xBD\x9C", + "\x90\xF7"=>"\xE7\x85\x8E", + "\x90\xF8"=>"\xE7\x85\xBD", + "\x90\xF9"=>"\xE6\x97\x8B", + "\x90\xFA"=>"\xE7\xA9\xBF", + "\x90\xFB"=>"\xE7\xAE\xAD", + "\x90\xFC"=>"\xE7\xB7\x9A", + "\x91\x40"=>"\xE7\xB9\x8A", + "\x91\x41"=>"\xE7\xBE\xA8", + "\x91\x42"=>"\xE8\x85\xBA", + "\x91\x43"=>"\xE8\x88\x9B", + "\x91\x44"=>"\xE8\x88\xB9", + "\x91\x45"=>"\xE8\x96\xA6", + "\x91\x46"=>"\xE8\xA9\xAE", + "\x91\x47"=>"\xE8\xB3\x8E", + "\x91\x48"=>"\xE8\xB7\xB5", + "\x91\x49"=>"\xE9\x81\xB8", + "\x91\x4A"=>"\xE9\x81\xB7", + "\x91\x4B"=>"\xE9\x8A\xAD", + "\x91\x4C"=>"\xE9\x8A\x91", + "\x91\x4D"=>"\xE9\x96\x83", + "\x91\x4E"=>"\xE9\xAE\xAE", + "\x91\x4F"=>"\xE5\x89\x8D", + "\x91\x50"=>"\xE5\x96\x84", + "\x91\x51"=>"\xE6\xBC\xB8", + "\x91\x52"=>"\xE7\x84\xB6", + "\x91\x53"=>"\xE5\x85\xA8", + "\x91\x54"=>"\xE7\xA6\x85", + "\x91\x55"=>"\xE7\xB9\x95", + "\x91\x56"=>"\xE8\x86\xB3", + "\x91\x57"=>"\xE7\xB3\x8E", + "\x91\x58"=>"\xE5\x99\x8C", + "\x91\x59"=>"\xE5\xA1\x91", + "\x91\x5A"=>"\xE5\xB2\xA8", + "\x91\x5B"=>"\xE6\x8E\xAA", + "\x91\x5C"=>"\xE6\x9B\xBE", + "\x91\x5D"=>"\xE6\x9B\xBD", + "\x91\x5E"=>"\xE6\xA5\x9A", + "\x91\x5F"=>"\xE7\x8B\x99", + "\x91\x60"=>"\xE7\x96\x8F", + "\x91\x61"=>"\xE7\x96\x8E", + "\x91\x62"=>"\xE7\xA4\x8E", + "\x91\x63"=>"\xE7\xA5\x96", + "\x91\x64"=>"\xE7\xA7\x9F", + "\x91\x65"=>"\xE7\xB2\x97", + "\x91\x66"=>"\xE7\xB4\xA0", + "\x91\x67"=>"\xE7\xB5\x84", + "\x91\x68"=>"\xE8\x98\x87", + "\x91\x69"=>"\xE8\xA8\xB4", + "\x91\x6A"=>"\xE9\x98\xBB", + "\x91\x6B"=>"\xE9\x81\xA1", + "\x91\x6C"=>"\xE9\xBC\xA0", + "\x91\x6D"=>"\xE5\x83\xA7", + "\x91\x6E"=>"\xE5\x89\xB5", + "\x91\x6F"=>"\xE5\x8F\x8C", + "\x91\x70"=>"\xE5\x8F\xA2", + "\x91\x71"=>"\xE5\x80\x89", + "\x91\x72"=>"\xE5\x96\xAA", + "\x91\x73"=>"\xE5\xA3\xAE", + "\x91\x74"=>"\xE5\xA5\x8F", + "\x91\x75"=>"\xE7\x88\xBD", + "\x91\x76"=>"\xE5\xAE\x8B", + "\x91\x77"=>"\xE5\xB1\xA4", + "\x91\x78"=>"\xE5\x8C\x9D", + "\x91\x79"=>"\xE6\x83\xA3", + "\x91\x7A"=>"\xE6\x83\xB3", + "\x91\x7B"=>"\xE6\x8D\x9C", + "\x91\x7C"=>"\xE6\x8E\x83", + "\x91\x7D"=>"\xE6\x8C\xBF", + "\x91\x7E"=>"\xE6\x8E\xBB", + "\x91\x80"=>"\xE6\x93\x8D", + "\x91\x81"=>"\xE6\x97\xA9", + "\x91\x82"=>"\xE6\x9B\xB9", + "\x91\x83"=>"\xE5\xB7\xA3", + "\x91\x84"=>"\xE6\xA7\x8D", + "\x91\x85"=>"\xE6\xA7\xBD", + "\x91\x86"=>"\xE6\xBC\x95", + "\x91\x87"=>"\xE7\x87\xA5", + "\x91\x88"=>"\xE4\xBA\x89", + "\x91\x89"=>"\xE7\x97\xA9", + "\x91\x8A"=>"\xE7\x9B\xB8", + "\x91\x8B"=>"\xE7\xAA\x93", + "\x91\x8C"=>"\xE7\xB3\x9F", + "\x91\x8D"=>"\xE7\xB7\x8F", + "\x91\x8E"=>"\xE7\xB6\x9C", + "\x91\x8F"=>"\xE8\x81\xA1", + "\x91\x90"=>"\xE8\x8D\x89", + "\x91\x91"=>"\xE8\x8D\x98", + "\x91\x92"=>"\xE8\x91\xAC", + "\x91\x93"=>"\xE8\x92\xBC", + "\x91\x94"=>"\xE8\x97\xBB", + "\x91\x95"=>"\xE8\xA3\x85", + "\x91\x96"=>"\xE8\xB5\xB0", + "\x91\x97"=>"\xE9\x80\x81", + "\x91\x98"=>"\xE9\x81\xAD", + "\x91\x99"=>"\xE9\x8E\x97", + "\x91\x9A"=>"\xE9\x9C\x9C", + "\x91\x9B"=>"\xE9\xA8\x92", + "\x91\x9C"=>"\xE5\x83\x8F", + "\x91\x9D"=>"\xE5\xA2\x97", + "\x91\x9E"=>"\xE6\x86\x8E", + "\x91\x9F"=>"\xE8\x87\x93", + "\x91\xA0"=>"\xE8\x94\xB5", + "\x91\xA1"=>"\xE8\xB4\x88", + "\x91\xA2"=>"\xE9\x80\xA0", + "\x91\xA3"=>"\xE4\xBF\x83", + "\x91\xA4"=>"\xE5\x81\xB4", + "\x91\xA5"=>"\xE5\x89\x87", + "\x91\xA6"=>"\xE5\x8D\xB3", + "\x91\xA7"=>"\xE6\x81\xAF", + "\x91\xA8"=>"\xE6\x8D\x89", + "\x91\xA9"=>"\xE6\x9D\x9F", + "\x91\xAA"=>"\xE6\xB8\xAC", + "\x91\xAB"=>"\xE8\xB6\xB3", + "\x91\xAC"=>"\xE9\x80\x9F", + "\x91\xAD"=>"\xE4\xBF\x97", + "\x91\xAE"=>"\xE5\xB1\x9E", + "\x91\xAF"=>"\xE8\xB3\x8A", + "\x91\xB0"=>"\xE6\x97\x8F", + "\x91\xB1"=>"\xE7\xB6\x9A", + "\x91\xB2"=>"\xE5\x8D\x92", + "\x91\xB3"=>"\xE8\xA2\x96", + "\x91\xB4"=>"\xE5\x85\xB6", + "\x91\xB5"=>"\xE6\x8F\x83", + "\x91\xB6"=>"\xE5\xAD\x98", + "\x91\xB7"=>"\xE5\xAD\xAB", + "\x91\xB8"=>"\xE5\xB0\x8A", + "\x91\xB9"=>"\xE6\x90\x8D", + "\x91\xBA"=>"\xE6\x9D\x91", + "\x91\xBB"=>"\xE9\x81\x9C", + "\x91\xBC"=>"\xE4\xBB\x96", + "\x91\xBD"=>"\xE5\xA4\x9A", + "\x91\xBE"=>"\xE5\xA4\xAA", + "\x91\xBF"=>"\xE6\xB1\xB0", + "\x91\xC0"=>"\xE8\xA9\x91", + "\x91\xC1"=>"\xE5\x94\xBE", + "\x91\xC2"=>"\xE5\xA0\x95", + "\x91\xC3"=>"\xE5\xA6\xA5", + "\x91\xC4"=>"\xE6\x83\xB0", + "\x91\xC5"=>"\xE6\x89\x93", + "\x91\xC6"=>"\xE6\x9F\x81", + "\x91\xC7"=>"\xE8\x88\xB5", + "\x91\xC8"=>"\xE6\xA5\x95", + "\x91\xC9"=>"\xE9\x99\x80", + "\x91\xCA"=>"\xE9\xA7\x84", + "\x91\xCB"=>"\xE9\xA8\xA8", + "\x91\xCC"=>"\xE4\xBD\x93", + "\x91\xCD"=>"\xE5\xA0\x86", + "\x91\xCE"=>"\xE5\xAF\xBE", + "\x91\xCF"=>"\xE8\x80\x90", + "\x91\xD0"=>"\xE5\xB2\xB1", + "\x91\xD1"=>"\xE5\xB8\xAF", + "\x91\xD2"=>"\xE5\xBE\x85", + "\x91\xD3"=>"\xE6\x80\xA0", + "\x91\xD4"=>"\xE6\x85\x8B", + "\x91\xD5"=>"\xE6\x88\xB4", + "\x91\xD6"=>"\xE6\x9B\xBF", + "\x91\xD7"=>"\xE6\xB3\xB0", + "\x91\xD8"=>"\xE6\xBB\x9E", + "\x91\xD9"=>"\xE8\x83\x8E", + "\x91\xDA"=>"\xE8\x85\xBF", + "\x91\xDB"=>"\xE8\x8B\x94", + "\x91\xDC"=>"\xE8\xA2\x8B", + "\x91\xDD"=>"\xE8\xB2\xB8", + "\x91\xDE"=>"\xE9\x80\x80", + "\x91\xDF"=>"\xE9\x80\xAE", + "\x91\xE0"=>"\xE9\x9A\x8A", + "\x91\xE1"=>"\xE9\xBB\x9B", + "\x91\xE2"=>"\xE9\xAF\x9B", + "\x91\xE3"=>"\xE4\xBB\xA3", + "\x91\xE4"=>"\xE5\x8F\xB0", + "\x91\xE5"=>"\xE5\xA4\xA7", + "\x91\xE6"=>"\xE7\xAC\xAC", + "\x91\xE7"=>"\xE9\x86\x8D", + "\x91\xE8"=>"\xE9\xA1\x8C", + "\x91\xE9"=>"\xE9\xB7\xB9", + "\x91\xEA"=>"\xE6\xBB\x9D", + "\x91\xEB"=>"\xE7\x80\xA7", + "\x91\xEC"=>"\xE5\x8D\x93", + "\x91\xED"=>"\xE5\x95\x84", + "\x91\xEE"=>"\xE5\xAE\x85", + "\x91\xEF"=>"\xE6\x89\x98", + "\x91\xF0"=>"\xE6\x8A\x9E", + "\x91\xF1"=>"\xE6\x8B\x93", + "\x91\xF2"=>"\xE6\xB2\xA2", + "\x91\xF3"=>"\xE6\xBF\xAF", + "\x91\xF4"=>"\xE7\x90\xA2", + "\x91\xF5"=>"\xE8\xA8\x97", + "\x91\xF6"=>"\xE9\x90\xB8", + "\x91\xF7"=>"\xE6\xBF\x81", + "\x91\xF8"=>"\xE8\xAB\xBE", + "\x91\xF9"=>"\xE8\x8C\xB8", + "\x91\xFA"=>"\xE5\x87\xA7", + "\x91\xFB"=>"\xE8\x9B\xB8", + "\x91\xFC"=>"\xE5\x8F\xAA", + "\x92\x40"=>"\xE5\x8F\xA9", + "\x92\x41"=>"\xE4\xBD\x86", + "\x92\x42"=>"\xE9\x81\x94", + "\x92\x43"=>"\xE8\xBE\xB0", + "\x92\x44"=>"\xE5\xA5\xAA", + "\x92\x45"=>"\xE8\x84\xB1", + "\x92\x46"=>"\xE5\xB7\xBD", + "\x92\x47"=>"\xE7\xAB\xAA", + "\x92\x48"=>"\xE8\xBE\xBF", + "\x92\x49"=>"\xE6\xA3\x9A", + "\x92\x4A"=>"\xE8\xB0\xB7", + "\x92\x4B"=>"\xE7\x8B\xB8", + "\x92\x4C"=>"\xE9\xB1\x88", + "\x92\x4D"=>"\xE6\xA8\xBD", + "\x92\x4E"=>"\xE8\xAA\xB0", + "\x92\x4F"=>"\xE4\xB8\xB9", + "\x92\x50"=>"\xE5\x8D\x98", + "\x92\x51"=>"\xE5\x98\x86", + "\x92\x52"=>"\xE5\x9D\xA6", + "\x92\x53"=>"\xE6\x8B\x85", + "\x92\x54"=>"\xE6\x8E\xA2", + "\x92\x55"=>"\xE6\x97\xA6", + "\x92\x56"=>"\xE6\xAD\x8E", + "\x92\x57"=>"\xE6\xB7\xA1", + "\x92\x58"=>"\xE6\xB9\x9B", + "\x92\x59"=>"\xE7\x82\xAD", + "\x92\x5A"=>"\xE7\x9F\xAD", + "\x92\x5B"=>"\xE7\xAB\xAF", + "\x92\x5C"=>"\xE7\xAE\xAA", + "\x92\x5D"=>"\xE7\xB6\xBB", + "\x92\x5E"=>"\xE8\x80\xBD", + "\x92\x5F"=>"\xE8\x83\x86", + "\x92\x60"=>"\xE8\x9B\x8B", + "\x92\x61"=>"\xE8\xAA\x95", + "\x92\x62"=>"\xE9\x8D\x9B", + "\x92\x63"=>"\xE5\x9B\xA3", + "\x92\x64"=>"\xE5\xA3\x87", + "\x92\x65"=>"\xE5\xBC\xBE", + "\x92\x66"=>"\xE6\x96\xAD", + "\x92\x67"=>"\xE6\x9A\x96", + "\x92\x68"=>"\xE6\xAA\x80", + "\x92\x69"=>"\xE6\xAE\xB5", + "\x92\x6A"=>"\xE7\x94\xB7", + "\x92\x6B"=>"\xE8\xAB\x87", + "\x92\x6C"=>"\xE5\x80\xA4", + "\x92\x6D"=>"\xE7\x9F\xA5", + "\x92\x6E"=>"\xE5\x9C\xB0", + "\x92\x6F"=>"\xE5\xBC\x9B", + "\x92\x70"=>"\xE6\x81\xA5", + "\x92\x71"=>"\xE6\x99\xBA", + "\x92\x72"=>"\xE6\xB1\xA0", + "\x92\x73"=>"\xE7\x97\xB4", + "\x92\x74"=>"\xE7\xA8\x9A", + "\x92\x75"=>"\xE7\xBD\xAE", + "\x92\x76"=>"\xE8\x87\xB4", + "\x92\x77"=>"\xE8\x9C\x98", + "\x92\x78"=>"\xE9\x81\x85", + "\x92\x79"=>"\xE9\xA6\xB3", + "\x92\x7A"=>"\xE7\xAF\x89", + "\x92\x7B"=>"\xE7\x95\x9C", + "\x92\x7C"=>"\xE7\xAB\xB9", + "\x92\x7D"=>"\xE7\xAD\x91", + "\x92\x7E"=>"\xE8\x93\x84", + "\x92\x80"=>"\xE9\x80\x90", + "\x92\x81"=>"\xE7\xA7\xA9", + "\x92\x82"=>"\xE7\xAA\x92", + "\x92\x83"=>"\xE8\x8C\xB6", + "\x92\x84"=>"\xE5\xAB\xA1", + "\x92\x85"=>"\xE7\x9D\x80", + "\x92\x86"=>"\xE4\xB8\xAD", + "\x92\x87"=>"\xE4\xBB\xB2", + "\x92\x88"=>"\xE5\xAE\x99", + "\x92\x89"=>"\xE5\xBF\xA0", + "\x92\x8A"=>"\xE6\x8A\xBD", + "\x92\x8B"=>"\xE6\x98\xBC", + "\x92\x8C"=>"\xE6\x9F\xB1", + "\x92\x8D"=>"\xE6\xB3\xA8", + "\x92\x8E"=>"\xE8\x99\xAB", + "\x92\x8F"=>"\xE8\xA1\xB7", + "\x92\x90"=>"\xE8\xA8\xBB", + "\x92\x91"=>"\xE9\x85\x8E", + "\x92\x92"=>"\xE9\x8B\xB3", + "\x92\x93"=>"\xE9\xA7\x90", + "\x92\x94"=>"\xE6\xA8\x97", + "\x92\x95"=>"\xE7\x80\xA6", + "\x92\x96"=>"\xE7\x8C\xAA", + "\x92\x97"=>"\xE8\x8B\xA7", + "\x92\x98"=>"\xE8\x91\x97", + "\x92\x99"=>"\xE8\xB2\xAF", + "\x92\x9A"=>"\xE4\xB8\x81", + "\x92\x9B"=>"\xE5\x85\x86", + "\x92\x9C"=>"\xE5\x87\x8B", + "\x92\x9D"=>"\xE5\x96\x8B", + "\x92\x9E"=>"\xE5\xAF\xB5", + "\x92\x9F"=>"\xE5\xB8\x96", + "\x92\xA0"=>"\xE5\xB8\xB3", + "\x92\xA1"=>"\xE5\xBA\x81", + "\x92\xA2"=>"\xE5\xBC\x94", + "\x92\xA3"=>"\xE5\xBC\xB5", + "\x92\xA4"=>"\xE5\xBD\xAB", + "\x92\xA5"=>"\xE5\xBE\xB4", + "\x92\xA6"=>"\xE6\x87\xB2", + "\x92\xA7"=>"\xE6\x8C\x91", + "\x92\xA8"=>"\xE6\x9A\xA2", + "\x92\xA9"=>"\xE6\x9C\x9D", + "\x92\xAA"=>"\xE6\xBD\xAE", + "\x92\xAB"=>"\xE7\x89\x92", + "\x92\xAC"=>"\xE7\x94\xBA", + "\x92\xAD"=>"\xE7\x9C\xBA", + "\x92\xAE"=>"\xE8\x81\xB4", + "\x92\xAF"=>"\xE8\x84\xB9", + "\x92\xB0"=>"\xE8\x85\xB8", + "\x92\xB1"=>"\xE8\x9D\xB6", + "\x92\xB2"=>"\xE8\xAA\xBF", + "\x92\xB3"=>"\xE8\xAB\x9C", + "\x92\xB4"=>"\xE8\xB6\x85", + "\x92\xB5"=>"\xE8\xB7\xB3", + "\x92\xB6"=>"\xE9\x8A\x9A", + "\x92\xB7"=>"\xE9\x95\xB7", + "\x92\xB8"=>"\xE9\xA0\x82", + "\x92\xB9"=>"\xE9\xB3\xA5", + "\x92\xBA"=>"\xE5\x8B\x85", + "\x92\xBB"=>"\xE6\x8D\x97", + "\x92\xBC"=>"\xE7\x9B\xB4", + "\x92\xBD"=>"\xE6\x9C\x95", + "\x92\xBE"=>"\xE6\xB2\x88", + "\x92\xBF"=>"\xE7\x8F\x8D", + "\x92\xC0"=>"\xE8\xB3\x83", + "\x92\xC1"=>"\xE9\x8E\xAE", + "\x92\xC2"=>"\xE9\x99\xB3", + "\x92\xC3"=>"\xE6\xB4\xA5", + "\x92\xC4"=>"\xE5\xA2\x9C", + "\x92\xC5"=>"\xE6\xA4\x8E", + "\x92\xC6"=>"\xE6\xA7\x8C", + "\x92\xC7"=>"\xE8\xBF\xBD", + "\x92\xC8"=>"\xE9\x8E\x9A", + "\x92\xC9"=>"\xE7\x97\x9B", + "\x92\xCA"=>"\xE9\x80\x9A", + "\x92\xCB"=>"\xE5\xA1\x9A", + "\x92\xCC"=>"\xE6\xA0\x82", + "\x92\xCD"=>"\xE6\x8E\xB4", + "\x92\xCE"=>"\xE6\xA7\xBB", + "\x92\xCF"=>"\xE4\xBD\x83", + "\x92\xD0"=>"\xE6\xBC\xAC", + "\x92\xD1"=>"\xE6\x9F\x98", + "\x92\xD2"=>"\xE8\xBE\xBB", + "\x92\xD3"=>"\xE8\x94\xA6", + "\x92\xD4"=>"\xE7\xB6\xB4", + "\x92\xD5"=>"\xE9\x8D\x94", + "\x92\xD6"=>"\xE6\xA4\xBF", + "\x92\xD7"=>"\xE6\xBD\xB0", + "\x92\xD8"=>"\xE5\x9D\xAA", + "\x92\xD9"=>"\xE5\xA3\xB7", + "\x92\xDA"=>"\xE5\xAC\xAC", + "\x92\xDB"=>"\xE7\xB4\xAC", + "\x92\xDC"=>"\xE7\x88\xAA", + "\x92\xDD"=>"\xE5\x90\x8A", + "\x92\xDE"=>"\xE9\x87\xA3", + "\x92\xDF"=>"\xE9\xB6\xB4", + "\x92\xE0"=>"\xE4\xBA\xAD", + "\x92\xE1"=>"\xE4\xBD\x8E", + "\x92\xE2"=>"\xE5\x81\x9C", + "\x92\xE3"=>"\xE5\x81\xB5", + "\x92\xE4"=>"\xE5\x89\x83", + "\x92\xE5"=>"\xE8\xB2\x9E", + "\x92\xE6"=>"\xE5\x91\x88", + "\x92\xE7"=>"\xE5\xA0\xA4", + "\x92\xE8"=>"\xE5\xAE\x9A", + "\x92\xE9"=>"\xE5\xB8\x9D", + "\x92\xEA"=>"\xE5\xBA\x95", + "\x92\xEB"=>"\xE5\xBA\xAD", + "\x92\xEC"=>"\xE5\xBB\xB7", + "\x92\xED"=>"\xE5\xBC\x9F", + "\x92\xEE"=>"\xE6\x82\x8C", + "\x92\xEF"=>"\xE6\x8A\xB5", + "\x92\xF0"=>"\xE6\x8C\xBA", + "\x92\xF1"=>"\xE6\x8F\x90", + "\x92\xF2"=>"\xE6\xA2\xAF", + "\x92\xF3"=>"\xE6\xB1\x80", + "\x92\xF4"=>"\xE7\xA2\x87", + "\x92\xF5"=>"\xE7\xA6\x8E", + "\x92\xF6"=>"\xE7\xA8\x8B", + "\x92\xF7"=>"\xE7\xB7\xA0", + "\x92\xF8"=>"\xE8\x89\x87", + "\x92\xF9"=>"\xE8\xA8\x82", + "\x92\xFA"=>"\xE8\xAB\xA6", + "\x92\xFB"=>"\xE8\xB9\x84", + "\x92\xFC"=>"\xE9\x80\x93", + "\x93\x40"=>"\xE9\x82\xB8", + "\x93\x41"=>"\xE9\x84\xAD", + "\x93\x42"=>"\xE9\x87\x98", + "\x93\x43"=>"\xE9\xBC\x8E", + "\x93\x44"=>"\xE6\xB3\xA5", + "\x93\x45"=>"\xE6\x91\x98", + "\x93\x46"=>"\xE6\x93\xA2", + "\x93\x47"=>"\xE6\x95\xB5", + "\x93\x48"=>"\xE6\xBB\xB4", + "\x93\x49"=>"\xE7\x9A\x84", + "\x93\x4A"=>"\xE7\xAC\x9B", + "\x93\x4B"=>"\xE9\x81\xA9", + "\x93\x4C"=>"\xE9\x8F\x91", + "\x93\x4D"=>"\xE6\xBA\xBA", + "\x93\x4E"=>"\xE5\x93\xB2", + "\x93\x4F"=>"\xE5\xBE\xB9", + "\x93\x50"=>"\xE6\x92\xA4", + "\x93\x51"=>"\xE8\xBD\x8D", + "\x93\x52"=>"\xE8\xBF\xAD", + "\x93\x53"=>"\xE9\x89\x84", + "\x93\x54"=>"\xE5\x85\xB8", + "\x93\x55"=>"\xE5\xA1\xAB", + "\x93\x56"=>"\xE5\xA4\xA9", + "\x93\x57"=>"\xE5\xB1\x95", + "\x93\x58"=>"\xE5\xBA\x97", + "\x93\x59"=>"\xE6\xB7\xBB", + "\x93\x5A"=>"\xE7\xBA\x8F", + "\x93\x5B"=>"\xE7\x94\x9C", + "\x93\x5C"=>"\xE8\xB2\xBC", + "\x93\x5D"=>"\xE8\xBB\xA2", + "\x93\x5E"=>"\xE9\xA1\x9B", + "\x93\x5F"=>"\xE7\x82\xB9", + "\x93\x60"=>"\xE4\xBC\x9D", + "\x93\x61"=>"\xE6\xAE\xBF", + "\x93\x62"=>"\xE6\xBE\xB1", + "\x93\x63"=>"\xE7\x94\xB0", + "\x93\x64"=>"\xE9\x9B\xBB", + "\x93\x65"=>"\xE5\x85\x8E", + "\x93\x66"=>"\xE5\x90\x90", + "\x93\x67"=>"\xE5\xA0\xB5", + "\x93\x68"=>"\xE5\xA1\x97", + "\x93\x69"=>"\xE5\xA6\xAC", + "\x93\x6A"=>"\xE5\xB1\xA0", + "\x93\x6B"=>"\xE5\xBE\x92", + "\x93\x6C"=>"\xE6\x96\x97", + "\x93\x6D"=>"\xE6\x9D\x9C", + "\x93\x6E"=>"\xE6\xB8\xA1", + "\x93\x6F"=>"\xE7\x99\xBB", + "\x93\x70"=>"\xE8\x8F\x9F", + "\x93\x71"=>"\xE8\xB3\xAD", + "\x93\x72"=>"\xE9\x80\x94", + "\x93\x73"=>"\xE9\x83\xBD", + "\x93\x74"=>"\xE9\x8D\x8D", + "\x93\x75"=>"\xE7\xA0\xA5", + "\x93\x76"=>"\xE7\xA0\xBA", + "\x93\x77"=>"\xE5\x8A\xAA", + "\x93\x78"=>"\xE5\xBA\xA6", + "\x93\x79"=>"\xE5\x9C\x9F", + "\x93\x7A"=>"\xE5\xA5\xB4", + "\x93\x7B"=>"\xE6\x80\x92", + "\x93\x7C"=>"\xE5\x80\x92", + "\x93\x7D"=>"\xE5\x85\x9A", + "\x93\x7E"=>"\xE5\x86\xAC", + "\x93\x80"=>"\xE5\x87\x8D", + "\x93\x81"=>"\xE5\x88\x80", + "\x93\x82"=>"\xE5\x94\x90", + "\x93\x83"=>"\xE5\xA1\x94", + "\x93\x84"=>"\xE5\xA1\x98", + "\x93\x85"=>"\xE5\xA5\x97", + "\x93\x86"=>"\xE5\xAE\x95", + "\x93\x87"=>"\xE5\xB3\xB6", + "\x93\x88"=>"\xE5\xB6\x8B", + "\x93\x89"=>"\xE6\x82\xBC", + "\x93\x8A"=>"\xE6\x8A\x95", + "\x93\x8B"=>"\xE6\x90\xAD", + "\x93\x8C"=>"\xE6\x9D\xB1", + "\x93\x8D"=>"\xE6\xA1\x83", + "\x93\x8E"=>"\xE6\xA2\xBC", + "\x93\x8F"=>"\xE6\xA3\x9F", + "\x93\x90"=>"\xE7\x9B\x97", + "\x93\x91"=>"\xE6\xB7\x98", + "\x93\x92"=>"\xE6\xB9\xAF", + "\x93\x93"=>"\xE6\xB6\x9B", + "\x93\x94"=>"\xE7\x81\xAF", + "\x93\x95"=>"\xE7\x87\x88", + "\x93\x96"=>"\xE5\xBD\x93", + "\x93\x97"=>"\xE7\x97\x98", + "\x93\x98"=>"\xE7\xA5\xB7", + "\x93\x99"=>"\xE7\xAD\x89", + "\x93\x9A"=>"\xE7\xAD\x94", + "\x93\x9B"=>"\xE7\xAD\x92", + "\x93\x9C"=>"\xE7\xB3\x96", + "\x93\x9D"=>"\xE7\xB5\xB1", + "\x93\x9E"=>"\xE5\x88\xB0", + "\x93\x9F"=>"\xE8\x91\xA3", + "\x93\xA0"=>"\xE8\x95\xA9", + "\x93\xA1"=>"\xE8\x97\xA4", + "\x93\xA2"=>"\xE8\xA8\x8E", + "\x93\xA3"=>"\xE8\xAC\x84", + "\x93\xA4"=>"\xE8\xB1\x86", + "\x93\xA5"=>"\xE8\xB8\x8F", + "\x93\xA6"=>"\xE9\x80\x83", + "\x93\xA7"=>"\xE9\x80\x8F", + "\x93\xA8"=>"\xE9\x90\x99", + "\x93\xA9"=>"\xE9\x99\xB6", + "\x93\xAA"=>"\xE9\xA0\xAD", + "\x93\xAB"=>"\xE9\xA8\xB0", + "\x93\xAC"=>"\xE9\x97\x98", + "\x93\xAD"=>"\xE5\x83\x8D", + "\x93\xAE"=>"\xE5\x8B\x95", + "\x93\xAF"=>"\xE5\x90\x8C", + "\x93\xB0"=>"\xE5\xA0\x82", + "\x93\xB1"=>"\xE5\xB0\x8E", + "\x93\xB2"=>"\xE6\x86\xA7", + "\x93\xB3"=>"\xE6\x92\x9E", + "\x93\xB4"=>"\xE6\xB4\x9E", + "\x93\xB5"=>"\xE7\x9E\xB3", + "\x93\xB6"=>"\xE7\xAB\xA5", + "\x93\xB7"=>"\xE8\x83\xB4", + "\x93\xB8"=>"\xE8\x90\x84", + "\x93\xB9"=>"\xE9\x81\x93", + "\x93\xBA"=>"\xE9\x8A\x85", + "\x93\xBB"=>"\xE5\xB3\xA0", + "\x93\xBC"=>"\xE9\xB4\x87", + "\x93\xBD"=>"\xE5\x8C\xBF", + "\x93\xBE"=>"\xE5\xBE\x97", + "\x93\xBF"=>"\xE5\xBE\xB3", + "\x93\xC0"=>"\xE6\xB6\x9C", + "\x93\xC1"=>"\xE7\x89\xB9", + "\x93\xC2"=>"\xE7\x9D\xA3", + "\x93\xC3"=>"\xE7\xA6\xBF", + "\x93\xC4"=>"\xE7\xAF\xA4", + "\x93\xC5"=>"\xE6\xAF\x92", + "\x93\xC6"=>"\xE7\x8B\xAC", + "\x93\xC7"=>"\xE8\xAA\xAD", + "\x93\xC8"=>"\xE6\xA0\x83", + "\x93\xC9"=>"\xE6\xA9\xA1", + "\x93\xCA"=>"\xE5\x87\xB8", + "\x93\xCB"=>"\xE7\xAA\x81", + "\x93\xCC"=>"\xE6\xA4\xB4", + "\x93\xCD"=>"\xE5\xB1\x8A", + "\x93\xCE"=>"\xE9\xB3\xB6", + "\x93\xCF"=>"\xE8\x8B\xAB", + "\x93\xD0"=>"\xE5\xAF\x85", + "\x93\xD1"=>"\xE9\x85\x89", + "\x93\xD2"=>"\xE7\x80\x9E", + "\x93\xD3"=>"\xE5\x99\xB8", + "\x93\xD4"=>"\xE5\xB1\xAF", + "\x93\xD5"=>"\xE6\x83\x87", + "\x93\xD6"=>"\xE6\x95\xA6", + "\x93\xD7"=>"\xE6\xB2\x8C", + "\x93\xD8"=>"\xE8\xB1\x9A", + "\x93\xD9"=>"\xE9\x81\x81", + "\x93\xDA"=>"\xE9\xA0\x93", + "\x93\xDB"=>"\xE5\x91\x91", + "\x93\xDC"=>"\xE6\x9B\x87", + "\x93\xDD"=>"\xE9\x88\x8D", + "\x93\xDE"=>"\xE5\xA5\x88", + "\x93\xDF"=>"\xE9\x82\xA3", + "\x93\xE0"=>"\xE5\x86\x85", + "\x93\xE1"=>"\xE4\xB9\x8D", + "\x93\xE2"=>"\xE5\x87\xAA", + "\x93\xE3"=>"\xE8\x96\x99", + "\x93\xE4"=>"\xE8\xAC\x8E", + "\x93\xE5"=>"\xE7\x81\x98", + "\x93\xE6"=>"\xE6\x8D\xBA", + "\x93\xE7"=>"\xE9\x8D\x8B", + "\x93\xE8"=>"\xE6\xA5\xA2", + "\x93\xE9"=>"\xE9\xA6\xB4", + "\x93\xEA"=>"\xE7\xB8\x84", + "\x93\xEB"=>"\xE7\x95\xB7", + "\x93\xEC"=>"\xE5\x8D\x97", + "\x93\xED"=>"\xE6\xA5\xA0", + "\x93\xEE"=>"\xE8\xBB\x9F", + "\x93\xEF"=>"\xE9\x9B\xA3", + "\x93\xF0"=>"\xE6\xB1\x9D", + "\x93\xF1"=>"\xE4\xBA\x8C", + "\x93\xF2"=>"\xE5\xB0\xBC", + "\x93\xF3"=>"\xE5\xBC\x90", + "\x93\xF4"=>"\xE8\xBF\xA9", + "\x93\xF5"=>"\xE5\x8C\x82", + "\x93\xF6"=>"\xE8\xB3\x91", + "\x93\xF7"=>"\xE8\x82\x89", + "\x93\xF8"=>"\xE8\x99\xB9", + "\x93\xF9"=>"\xE5\xBB\xBF", + "\x93\xFA"=>"\xE6\x97\xA5", + "\x93\xFB"=>"\xE4\xB9\xB3", + "\x93\xFC"=>"\xE5\x85\xA5", + "\x94\x40"=>"\xE5\xA6\x82", + "\x94\x41"=>"\xE5\xB0\xBF", + "\x94\x42"=>"\xE9\x9F\xAE", + "\x94\x43"=>"\xE4\xBB\xBB", + "\x94\x44"=>"\xE5\xA6\x8A", + "\x94\x45"=>"\xE5\xBF\x8D", + "\x94\x46"=>"\xE8\xAA\x8D", + "\x94\x47"=>"\xE6\xBF\xA1", + "\x94\x48"=>"\xE7\xA6\xB0", + "\x94\x49"=>"\xE7\xA5\xA2", + "\x94\x4A"=>"\xE5\xAF\xA7", + "\x94\x4B"=>"\xE8\x91\xB1", + "\x94\x4C"=>"\xE7\x8C\xAB", + "\x94\x4D"=>"\xE7\x86\xB1", + "\x94\x4E"=>"\xE5\xB9\xB4", + "\x94\x4F"=>"\xE5\xBF\xB5", + "\x94\x50"=>"\xE6\x8D\xBB", + "\x94\x51"=>"\xE6\x92\x9A", + "\x94\x52"=>"\xE7\x87\x83", + "\x94\x53"=>"\xE7\xB2\x98", + "\x94\x54"=>"\xE4\xB9\x83", + "\x94\x55"=>"\xE5\xBB\xBC", + "\x94\x56"=>"\xE4\xB9\x8B", + "\x94\x57"=>"\xE5\x9F\x9C", + "\x94\x58"=>"\xE5\x9A\xA2", + "\x94\x59"=>"\xE6\x82\xA9", + "\x94\x5A"=>"\xE6\xBF\x83", + "\x94\x5B"=>"\xE7\xB4\x8D", + "\x94\x5C"=>"\xE8\x83\xBD", + "\x94\x5D"=>"\xE8\x84\xB3", + "\x94\x5E"=>"\xE8\x86\xBF", + "\x94\x5F"=>"\xE8\xBE\xB2", + "\x94\x60"=>"\xE8\xA6\x97", + "\x94\x61"=>"\xE8\x9A\xA4", + "\x94\x62"=>"\xE5\xB7\xB4", + "\x94\x63"=>"\xE6\x8A\x8A", + "\x94\x64"=>"\xE6\x92\xAD", + "\x94\x65"=>"\xE8\xA6\x87", + "\x94\x66"=>"\xE6\x9D\xB7", + "\x94\x67"=>"\xE6\xB3\xA2", + "\x94\x68"=>"\xE6\xB4\xBE", + "\x94\x69"=>"\xE7\x90\xB6", + "\x94\x6A"=>"\xE7\xA0\xB4", + "\x94\x6B"=>"\xE5\xA9\x86", + "\x94\x6C"=>"\xE7\xBD\xB5", + "\x94\x6D"=>"\xE8\x8A\xAD", + "\x94\x6E"=>"\xE9\xA6\xAC", + "\x94\x6F"=>"\xE4\xBF\xB3", + "\x94\x70"=>"\xE5\xBB\x83", + "\x94\x71"=>"\xE6\x8B\x9D", + "\x94\x72"=>"\xE6\x8E\x92", + "\x94\x73"=>"\xE6\x95\x97", + "\x94\x74"=>"\xE6\x9D\xAF", + "\x94\x75"=>"\xE7\x9B\x83", + "\x94\x76"=>"\xE7\x89\x8C", + "\x94\x77"=>"\xE8\x83\x8C", + "\x94\x78"=>"\xE8\x82\xBA", + "\x94\x79"=>"\xE8\xBC\xA9", + "\x94\x7A"=>"\xE9\x85\x8D", + "\x94\x7B"=>"\xE5\x80\x8D", + "\x94\x7C"=>"\xE5\x9F\xB9", + "\x94\x7D"=>"\xE5\xAA\x92", + "\x94\x7E"=>"\xE6\xA2\x85", + "\x94\x80"=>"\xE6\xA5\xB3", + "\x94\x81"=>"\xE7\x85\xA4", + "\x94\x82"=>"\xE7\x8B\xBD", + "\x94\x83"=>"\xE8\xB2\xB7", + "\x94\x84"=>"\xE5\xA3\xB2", + "\x94\x85"=>"\xE8\xB3\xA0", + "\x94\x86"=>"\xE9\x99\xAA", + "\x94\x87"=>"\xE9\x80\x99", + "\x94\x88"=>"\xE8\x9D\xBF", + "\x94\x89"=>"\xE7\xA7\xA4", + "\x94\x8A"=>"\xE7\x9F\xA7", + "\x94\x8B"=>"\xE8\x90\xA9", + "\x94\x8C"=>"\xE4\xBC\xAF", + "\x94\x8D"=>"\xE5\x89\xA5", + "\x94\x8E"=>"\xE5\x8D\x9A", + "\x94\x8F"=>"\xE6\x8B\x8D", + "\x94\x90"=>"\xE6\x9F\x8F", + "\x94\x91"=>"\xE6\xB3\x8A", + "\x94\x92"=>"\xE7\x99\xBD", + "\x94\x93"=>"\xE7\xAE\x94", + "\x94\x94"=>"\xE7\xB2\x95", + "\x94\x95"=>"\xE8\x88\xB6", + "\x94\x96"=>"\xE8\x96\x84", + "\x94\x97"=>"\xE8\xBF\xAB", + "\x94\x98"=>"\xE6\x9B\x9D", + "\x94\x99"=>"\xE6\xBC\xA0", + "\x94\x9A"=>"\xE7\x88\x86", + "\x94\x9B"=>"\xE7\xB8\x9B", + "\x94\x9C"=>"\xE8\x8E\xAB", + "\x94\x9D"=>"\xE9\xA7\x81", + "\x94\x9E"=>"\xE9\xBA\xA6", + "\x94\x9F"=>"\xE5\x87\xBD", + "\x94\xA0"=>"\xE7\xAE\xB1", + "\x94\xA1"=>"\xE7\xA1\xB2", + "\x94\xA2"=>"\xE7\xAE\xB8", + "\x94\xA3"=>"\xE8\x82\x87", + "\x94\xA4"=>"\xE7\xAD\x88", + "\x94\xA5"=>"\xE6\xAB\xA8", + "\x94\xA6"=>"\xE5\xB9\xA1", + "\x94\xA7"=>"\xE8\x82\x8C", + "\x94\xA8"=>"\xE7\x95\x91", + "\x94\xA9"=>"\xE7\x95\xA0", + "\x94\xAA"=>"\xE5\x85\xAB", + "\x94\xAB"=>"\xE9\x89\xA2", + "\x94\xAC"=>"\xE6\xBA\x8C", + "\x94\xAD"=>"\xE7\x99\xBA", + "\x94\xAE"=>"\xE9\x86\x97", + "\x94\xAF"=>"\xE9\xAB\xAA", + "\x94\xB0"=>"\xE4\xBC\x90", + "\x94\xB1"=>"\xE7\xBD\xB0", + "\x94\xB2"=>"\xE6\x8A\x9C", + "\x94\xB3"=>"\xE7\xAD\x8F", + "\x94\xB4"=>"\xE9\x96\xA5", + "\x94\xB5"=>"\xE9\xB3\xA9", + "\x94\xB6"=>"\xE5\x99\xBA", + "\x94\xB7"=>"\xE5\xA1\x99", + "\x94\xB8"=>"\xE8\x9B\xA4", + "\x94\xB9"=>"\xE9\x9A\xBC", + "\x94\xBA"=>"\xE4\xBC\xB4", + "\x94\xBB"=>"\xE5\x88\xA4", + "\x94\xBC"=>"\xE5\x8D\x8A", + "\x94\xBD"=>"\xE5\x8F\x8D", + "\x94\xBE"=>"\xE5\x8F\x9B", + "\x94\xBF"=>"\xE5\xB8\x86", + "\x94\xC0"=>"\xE6\x90\xAC", + "\x94\xC1"=>"\xE6\x96\x91", + "\x94\xC2"=>"\xE6\x9D\xBF", + "\x94\xC3"=>"\xE6\xB0\xBE", + "\x94\xC4"=>"\xE6\xB1\x8E", + "\x94\xC5"=>"\xE7\x89\x88", + "\x94\xC6"=>"\xE7\x8A\xAF", + "\x94\xC7"=>"\xE7\x8F\xAD", + "\x94\xC8"=>"\xE7\x95\x94", + "\x94\xC9"=>"\xE7\xB9\x81", + "\x94\xCA"=>"\xE8\x88\xAC", + "\x94\xCB"=>"\xE8\x97\xA9", + "\x94\xCC"=>"\xE8\xB2\xA9", + "\x94\xCD"=>"\xE7\xAF\x84", + "\x94\xCE"=>"\xE9\x87\x86", + "\x94\xCF"=>"\xE7\x85\xA9", + "\x94\xD0"=>"\xE9\xA0\x92", + "\x94\xD1"=>"\xE9\xA3\xAF", + "\x94\xD2"=>"\xE6\x8C\xBD", + "\x94\xD3"=>"\xE6\x99\xA9", + "\x94\xD4"=>"\xE7\x95\xAA", + "\x94\xD5"=>"\xE7\x9B\xA4", + "\x94\xD6"=>"\xE7\xA3\x90", + "\x94\xD7"=>"\xE8\x95\x83", + "\x94\xD8"=>"\xE8\x9B\xAE", + "\x94\xD9"=>"\xE5\x8C\xAA", + "\x94\xDA"=>"\xE5\x8D\x91", + "\x94\xDB"=>"\xE5\x90\xA6", + "\x94\xDC"=>"\xE5\xA6\x83", + "\x94\xDD"=>"\xE5\xBA\x87", + "\x94\xDE"=>"\xE5\xBD\xBC", + "\x94\xDF"=>"\xE6\x82\xB2", + "\x94\xE0"=>"\xE6\x89\x89", + "\x94\xE1"=>"\xE6\x89\xB9", + "\x94\xE2"=>"\xE6\x8A\xAB", + "\x94\xE3"=>"\xE6\x96\x90", + "\x94\xE4"=>"\xE6\xAF\x94", + "\x94\xE5"=>"\xE6\xB3\x8C", + "\x94\xE6"=>"\xE7\x96\xB2", + "\x94\xE7"=>"\xE7\x9A\xAE", + "\x94\xE8"=>"\xE7\xA2\x91", + "\x94\xE9"=>"\xE7\xA7\x98", + "\x94\xEA"=>"\xE7\xB7\x8B", + "\x94\xEB"=>"\xE7\xBD\xB7", + "\x94\xEC"=>"\xE8\x82\xA5", + "\x94\xED"=>"\xE8\xA2\xAB", + "\x94\xEE"=>"\xE8\xAA\xB9", + "\x94\xEF"=>"\xE8\xB2\xBB", + "\x94\xF0"=>"\xE9\x81\xBF", + "\x94\xF1"=>"\xE9\x9D\x9E", + "\x94\xF2"=>"\xE9\xA3\x9B", + "\x94\xF3"=>"\xE6\xA8\x8B", + "\x94\xF4"=>"\xE7\xB0\xB8", + "\x94\xF5"=>"\xE5\x82\x99", + "\x94\xF6"=>"\xE5\xB0\xBE", + "\x94\xF7"=>"\xE5\xBE\xAE", + "\x94\xF8"=>"\xE6\x9E\x87", + "\x94\xF9"=>"\xE6\xAF\x98", + "\x94\xFA"=>"\xE7\x90\xB5", + "\x94\xFB"=>"\xE7\x9C\x89", + "\x94\xFC"=>"\xE7\xBE\x8E", + "\x95\x40"=>"\xE9\xBC\xBB", + "\x95\x41"=>"\xE6\x9F\x8A", + "\x95\x42"=>"\xE7\xA8\x97", + "\x95\x43"=>"\xE5\x8C\xB9", + "\x95\x44"=>"\xE7\x96\x8B", + "\x95\x45"=>"\xE9\xAB\xAD", + "\x95\x46"=>"\xE5\xBD\xA6", + "\x95\x47"=>"\xE8\x86\x9D", + "\x95\x48"=>"\xE8\x8F\xB1", + "\x95\x49"=>"\xE8\x82\x98", + "\x95\x4A"=>"\xE5\xBC\xBC", + "\x95\x4B"=>"\xE5\xBF\x85", + "\x95\x4C"=>"\xE7\x95\xA2", + "\x95\x4D"=>"\xE7\xAD\x86", + "\x95\x4E"=>"\xE9\x80\xBC", + "\x95\x4F"=>"\xE6\xA1\xA7", + "\x95\x50"=>"\xE5\xA7\xAB", + "\x95\x51"=>"\xE5\xAA\x9B", + "\x95\x52"=>"\xE7\xB4\x90", + "\x95\x53"=>"\xE7\x99\xBE", + "\x95\x54"=>"\xE8\xAC\xAC", + "\x95\x55"=>"\xE4\xBF\xB5", + "\x95\x56"=>"\xE5\xBD\xAA", + "\x95\x57"=>"\xE6\xA8\x99", + "\x95\x58"=>"\xE6\xB0\xB7", + "\x95\x59"=>"\xE6\xBC\x82", + "\x95\x5A"=>"\xE7\x93\xA2", + "\x95\x5B"=>"\xE7\xA5\xA8", + "\x95\x5C"=>"\xE8\xA1\xA8", + "\x95\x5D"=>"\xE8\xA9\x95", + "\x95\x5E"=>"\xE8\xB1\xB9", + "\x95\x5F"=>"\xE5\xBB\x9F", + "\x95\x60"=>"\xE6\x8F\x8F", + "\x95\x61"=>"\xE7\x97\x85", + "\x95\x62"=>"\xE7\xA7\x92", + "\x95\x63"=>"\xE8\x8B\x97", + "\x95\x64"=>"\xE9\x8C\xA8", + "\x95\x65"=>"\xE9\x8B\xB2", + "\x95\x66"=>"\xE8\x92\x9C", + "\x95\x67"=>"\xE8\x9B\xAD", + "\x95\x68"=>"\xE9\xB0\xAD", + "\x95\x69"=>"\xE5\x93\x81", + "\x95\x6A"=>"\xE5\xBD\xAC", + "\x95\x6B"=>"\xE6\x96\x8C", + "\x95\x6C"=>"\xE6\xB5\x9C", + "\x95\x6D"=>"\xE7\x80\x95", + "\x95\x6E"=>"\xE8\xB2\xA7", + "\x95\x6F"=>"\xE8\xB3\x93", + "\x95\x70"=>"\xE9\xA0\xBB", + "\x95\x71"=>"\xE6\x95\x8F", + "\x95\x72"=>"\xE7\x93\xB6", + "\x95\x73"=>"\xE4\xB8\x8D", + "\x95\x74"=>"\xE4\xBB\x98", + "\x95\x75"=>"\xE5\x9F\xA0", + "\x95\x76"=>"\xE5\xA4\xAB", + "\x95\x77"=>"\xE5\xA9\xA6", + "\x95\x78"=>"\xE5\xAF\x8C", + "\x95\x79"=>"\xE5\x86\xA8", + "\x95\x7A"=>"\xE5\xB8\x83", + "\x95\x7B"=>"\xE5\xBA\x9C", + "\x95\x7C"=>"\xE6\x80\x96", + "\x95\x7D"=>"\xE6\x89\xB6", + "\x95\x7E"=>"\xE6\x95\xB7", + "\x95\x80"=>"\xE6\x96\xA7", + "\x95\x81"=>"\xE6\x99\xAE", + "\x95\x82"=>"\xE6\xB5\xAE", + "\x95\x83"=>"\xE7\x88\xB6", + "\x95\x84"=>"\xE7\xAC\xA6", + "\x95\x85"=>"\xE8\x85\x90", + "\x95\x86"=>"\xE8\x86\x9A", + "\x95\x87"=>"\xE8\x8A\x99", + "\x95\x88"=>"\xE8\xAD\x9C", + "\x95\x89"=>"\xE8\xB2\xA0", + "\x95\x8A"=>"\xE8\xB3\xA6", + "\x95\x8B"=>"\xE8\xB5\xB4", + "\x95\x8C"=>"\xE9\x98\x9C", + "\x95\x8D"=>"\xE9\x99\x84", + "\x95\x8E"=>"\xE4\xBE\xAE", + "\x95\x8F"=>"\xE6\x92\xAB", + "\x95\x90"=>"\xE6\xAD\xA6", + "\x95\x91"=>"\xE8\x88\x9E", + "\x95\x92"=>"\xE8\x91\xA1", + "\x95\x93"=>"\xE8\x95\xAA", + "\x95\x94"=>"\xE9\x83\xA8", + "\x95\x95"=>"\xE5\xB0\x81", + "\x95\x96"=>"\xE6\xA5\x93", + "\x95\x97"=>"\xE9\xA2\xA8", + "\x95\x98"=>"\xE8\x91\xBA", + "\x95\x99"=>"\xE8\x95\x97", + "\x95\x9A"=>"\xE4\xBC\x8F", + "\x95\x9B"=>"\xE5\x89\xAF", + "\x95\x9C"=>"\xE5\xBE\xA9", + "\x95\x9D"=>"\xE5\xB9\x85", + "\x95\x9E"=>"\xE6\x9C\x8D", + "\x95\x9F"=>"\xE7\xA6\x8F", + "\x95\xA0"=>"\xE8\x85\xB9", + "\x95\xA1"=>"\xE8\xA4\x87", + "\x95\xA2"=>"\xE8\xA6\x86", + "\x95\xA3"=>"\xE6\xB7\xB5", + "\x95\xA4"=>"\xE5\xBC\x97", + "\x95\xA5"=>"\xE6\x89\x95", + "\x95\xA6"=>"\xE6\xB2\xB8", + "\x95\xA7"=>"\xE4\xBB\x8F", + "\x95\xA8"=>"\xE7\x89\xA9", + "\x95\xA9"=>"\xE9\xAE\x92", + "\x95\xAA"=>"\xE5\x88\x86", + "\x95\xAB"=>"\xE5\x90\xBB", + "\x95\xAC"=>"\xE5\x99\xB4", + "\x95\xAD"=>"\xE5\xA2\xB3", + "\x95\xAE"=>"\xE6\x86\xA4", + "\x95\xAF"=>"\xE6\x89\xAE", + "\x95\xB0"=>"\xE7\x84\x9A", + "\x95\xB1"=>"\xE5\xA5\xAE", + "\x95\xB2"=>"\xE7\xB2\x89", + "\x95\xB3"=>"\xE7\xB3\x9E", + "\x95\xB4"=>"\xE7\xB4\x9B", + "\x95\xB5"=>"\xE9\x9B\xB0", + "\x95\xB6"=>"\xE6\x96\x87", + "\x95\xB7"=>"\xE8\x81\x9E", + "\x95\xB8"=>"\xE4\xB8\x99", + "\x95\xB9"=>"\xE4\xBD\xB5", + "\x95\xBA"=>"\xE5\x85\xB5", + "\x95\xBB"=>"\xE5\xA1\x80", + "\x95\xBC"=>"\xE5\xB9\xA3", + "\x95\xBD"=>"\xE5\xB9\xB3", + "\x95\xBE"=>"\xE5\xBC\x8A", + "\x95\xBF"=>"\xE6\x9F\x84", + "\x95\xC0"=>"\xE4\xB8\xA6", + "\x95\xC1"=>"\xE8\x94\xBD", + "\x95\xC2"=>"\xE9\x96\x89", + "\x95\xC3"=>"\xE9\x99\x9B", + "\x95\xC4"=>"\xE7\xB1\xB3", + "\x95\xC5"=>"\xE9\xA0\x81", + "\x95\xC6"=>"\xE5\x83\xBB", + "\x95\xC7"=>"\xE5\xA3\x81", + "\x95\xC8"=>"\xE7\x99\x96", + "\x95\xC9"=>"\xE7\xA2\xA7", + "\x95\xCA"=>"\xE5\x88\xA5", + "\x95\xCB"=>"\xE7\x9E\xA5", + "\x95\xCC"=>"\xE8\x94\x91", + "\x95\xCD"=>"\xE7\xAE\x86", + "\x95\xCE"=>"\xE5\x81\x8F", + "\x95\xCF"=>"\xE5\xA4\x89", + "\x95\xD0"=>"\xE7\x89\x87", + "\x95\xD1"=>"\xE7\xAF\x87", + "\x95\xD2"=>"\xE7\xB7\xA8", + "\x95\xD3"=>"\xE8\xBE\xBA", + "\x95\xD4"=>"\xE8\xBF\x94", + "\x95\xD5"=>"\xE9\x81\x8D", + "\x95\xD6"=>"\xE4\xBE\xBF", + "\x95\xD7"=>"\xE5\x8B\x89", + "\x95\xD8"=>"\xE5\xA8\xA9", + "\x95\xD9"=>"\xE5\xBC\x81", + "\x95\xDA"=>"\xE9\x9E\xAD", + "\x95\xDB"=>"\xE4\xBF\x9D", + "\x95\xDC"=>"\xE8\x88\x97", + "\x95\xDD"=>"\xE9\x8B\xAA", + "\x95\xDE"=>"\xE5\x9C\x83", + "\x95\xDF"=>"\xE6\x8D\x95", + "\x95\xE0"=>"\xE6\xAD\xA9", + "\x95\xE1"=>"\xE7\x94\xAB", + "\x95\xE2"=>"\xE8\xA3\x9C", + "\x95\xE3"=>"\xE8\xBC\x94", + "\x95\xE4"=>"\xE7\xA9\x82", + "\x95\xE5"=>"\xE5\x8B\x9F", + "\x95\xE6"=>"\xE5\xA2\x93", + "\x95\xE7"=>"\xE6\x85\x95", + "\x95\xE8"=>"\xE6\x88\x8A", + "\x95\xE9"=>"\xE6\x9A\xAE", + "\x95\xEA"=>"\xE6\xAF\x8D", + "\x95\xEB"=>"\xE7\xB0\xBF", + "\x95\xEC"=>"\xE8\x8F\xA9", + "\x95\xED"=>"\xE5\x80\xA3", + "\x95\xEE"=>"\xE4\xBF\xB8", + "\x95\xEF"=>"\xE5\x8C\x85", + "\x95\xF0"=>"\xE5\x91\x86", + "\x95\xF1"=>"\xE5\xA0\xB1", + "\x95\xF2"=>"\xE5\xA5\x89", + "\x95\xF3"=>"\xE5\xAE\x9D", + "\x95\xF4"=>"\xE5\xB3\xB0", + "\x95\xF5"=>"\xE5\xB3\xAF", + "\x95\xF6"=>"\xE5\xB4\xA9", + "\x95\xF7"=>"\xE5\xBA\x96", + "\x95\xF8"=>"\xE6\x8A\xB1", + "\x95\xF9"=>"\xE6\x8D\xA7", + "\x95\xFA"=>"\xE6\x94\xBE", + "\x95\xFB"=>"\xE6\x96\xB9", + "\x95\xFC"=>"\xE6\x9C\x8B", + "\x96\x40"=>"\xE6\xB3\x95", + "\x96\x41"=>"\xE6\xB3\xA1", + "\x96\x42"=>"\xE7\x83\xB9", + "\x96\x43"=>"\xE7\xA0\xB2", + "\x96\x44"=>"\xE7\xB8\xAB", + "\x96\x45"=>"\xE8\x83\x9E", + "\x96\x46"=>"\xE8\x8A\xB3", + "\x96\x47"=>"\xE8\x90\x8C", + "\x96\x48"=>"\xE8\x93\xAC", + "\x96\x49"=>"\xE8\x9C\x82", + "\x96\x4A"=>"\xE8\xA4\x92", + "\x96\x4B"=>"\xE8\xA8\xAA", + "\x96\x4C"=>"\xE8\xB1\x8A", + "\x96\x4D"=>"\xE9\x82\xA6", + "\x96\x4E"=>"\xE9\x8B\x92", + "\x96\x4F"=>"\xE9\xA3\xBD", + "\x96\x50"=>"\xE9\xB3\xB3", + "\x96\x51"=>"\xE9\xB5\xAC", + "\x96\x52"=>"\xE4\xB9\x8F", + "\x96\x53"=>"\xE4\xBA\xA1", + "\x96\x54"=>"\xE5\x82\x8D", + "\x96\x55"=>"\xE5\x89\x96", + "\x96\x56"=>"\xE5\x9D\x8A", + "\x96\x57"=>"\xE5\xA6\xA8", + "\x96\x58"=>"\xE5\xB8\xBD", + "\x96\x59"=>"\xE5\xBF\x98", + "\x96\x5A"=>"\xE5\xBF\x99", + "\x96\x5B"=>"\xE6\x88\xBF", + "\x96\x5C"=>"\xE6\x9A\xB4", + "\x96\x5D"=>"\xE6\x9C\x9B", + "\x96\x5E"=>"\xE6\x9F\x90", + "\x96\x5F"=>"\xE6\xA3\x92", + "\x96\x60"=>"\xE5\x86\x92", + "\x96\x61"=>"\xE7\xB4\xA1", + "\x96\x62"=>"\xE8\x82\xAA", + "\x96\x63"=>"\xE8\x86\xA8", + "\x96\x64"=>"\xE8\xAC\x80", + "\x96\x65"=>"\xE8\xB2\x8C", + "\x96\x66"=>"\xE8\xB2\xBF", + "\x96\x67"=>"\xE9\x89\xBE", + "\x96\x68"=>"\xE9\x98\xB2", + "\x96\x69"=>"\xE5\x90\xA0", + "\x96\x6A"=>"\xE9\xA0\xAC", + "\x96\x6B"=>"\xE5\x8C\x97", + "\x96\x6C"=>"\xE5\x83\x95", + "\x96\x6D"=>"\xE5\x8D\x9C", + "\x96\x6E"=>"\xE5\xA2\xA8", + "\x96\x6F"=>"\xE6\x92\xB2", + "\x96\x70"=>"\xE6\x9C\xB4", + "\x96\x71"=>"\xE7\x89\xA7", + "\x96\x72"=>"\xE7\x9D\xA6", + "\x96\x73"=>"\xE7\xA9\x86", + "\x96\x74"=>"\xE9\x87\xA6", + "\x96\x75"=>"\xE5\x8B\x83", + "\x96\x76"=>"\xE6\xB2\xA1", + "\x96\x77"=>"\xE6\xAE\x86", + "\x96\x78"=>"\xE5\xA0\x80", + "\x96\x79"=>"\xE5\xB9\x8C", + "\x96\x7A"=>"\xE5\xA5\x94", + "\x96\x7B"=>"\xE6\x9C\xAC", + "\x96\x7C"=>"\xE7\xBF\xBB", + "\x96\x7D"=>"\xE5\x87\xA1", + "\x96\x7E"=>"\xE7\x9B\x86", + "\x96\x80"=>"\xE6\x91\xA9", + "\x96\x81"=>"\xE7\xA3\xA8", + "\x96\x82"=>"\xE9\xAD\x94", + "\x96\x83"=>"\xE9\xBA\xBB", + "\x96\x84"=>"\xE5\x9F\x8B", + "\x96\x85"=>"\xE5\xA6\xB9", + "\x96\x86"=>"\xE6\x98\xA7", + "\x96\x87"=>"\xE6\x9E\x9A", + "\x96\x88"=>"\xE6\xAF\x8E", + "\x96\x89"=>"\xE5\x93\xA9", + "\x96\x8A"=>"\xE6\xA7\x99", + "\x96\x8B"=>"\xE5\xB9\x95", + "\x96\x8C"=>"\xE8\x86\x9C", + "\x96\x8D"=>"\xE6\x9E\x95", + "\x96\x8E"=>"\xE9\xAE\xAA", + "\x96\x8F"=>"\xE6\x9F\xBE", + "\x96\x90"=>"\xE9\xB1\x92", + "\x96\x91"=>"\xE6\xA1\x9D", + "\x96\x92"=>"\xE4\xBA\xA6", + "\x96\x93"=>"\xE4\xBF\xA3", + "\x96\x94"=>"\xE5\x8F\x88", + "\x96\x95"=>"\xE6\x8A\xB9", + "\x96\x96"=>"\xE6\x9C\xAB", + "\x96\x97"=>"\xE6\xB2\xAB", + "\x96\x98"=>"\xE8\xBF\x84", + "\x96\x99"=>"\xE4\xBE\xAD", + "\x96\x9A"=>"\xE7\xB9\xAD", + "\x96\x9B"=>"\xE9\xBA\xBF", + "\x96\x9C"=>"\xE4\xB8\x87", + "\x96\x9D"=>"\xE6\x85\xA2", + "\x96\x9E"=>"\xE6\xBA\x80", + "\x96\x9F"=>"\xE6\xBC\xAB", + "\x96\xA0"=>"\xE8\x94\x93", + "\x96\xA1"=>"\xE5\x91\xB3", + "\x96\xA2"=>"\xE6\x9C\xAA", + "\x96\xA3"=>"\xE9\xAD\x85", + "\x96\xA4"=>"\xE5\xB7\xB3", + "\x96\xA5"=>"\xE7\xAE\x95", + "\x96\xA6"=>"\xE5\xB2\xAC", + "\x96\xA7"=>"\xE5\xAF\x86", + "\x96\xA8"=>"\xE8\x9C\x9C", + "\x96\xA9"=>"\xE6\xB9\x8A", + "\x96\xAA"=>"\xE8\x93\x91", + "\x96\xAB"=>"\xE7\xA8\x94", + "\x96\xAC"=>"\xE8\x84\x88", + "\x96\xAD"=>"\xE5\xA6\x99", + "\x96\xAE"=>"\xE7\xB2\x8D", + "\x96\xAF"=>"\xE6\xB0\x91", + "\x96\xB0"=>"\xE7\x9C\xA0", + "\x96\xB1"=>"\xE5\x8B\x99", + "\x96\xB2"=>"\xE5\xA4\xA2", + "\x96\xB3"=>"\xE7\x84\xA1", + "\x96\xB4"=>"\xE7\x89\x9F", + "\x96\xB5"=>"\xE7\x9F\x9B", + "\x96\xB6"=>"\xE9\x9C\xA7", + "\x96\xB7"=>"\xE9\xB5\xA1", + "\x96\xB8"=>"\xE6\xA4\x8B", + "\x96\xB9"=>"\xE5\xA9\xBF", + "\x96\xBA"=>"\xE5\xA8\x98", + "\x96\xBB"=>"\xE5\x86\xA5", + "\x96\xBC"=>"\xE5\x90\x8D", + "\x96\xBD"=>"\xE5\x91\xBD", + "\x96\xBE"=>"\xE6\x98\x8E", + "\x96\xBF"=>"\xE7\x9B\x9F", + "\x96\xC0"=>"\xE8\xBF\xB7", + "\x96\xC1"=>"\xE9\x8A\x98", + "\x96\xC2"=>"\xE9\xB3\xB4", + "\x96\xC3"=>"\xE5\xA7\xAA", + "\x96\xC4"=>"\xE7\x89\x9D", + "\x96\xC5"=>"\xE6\xBB\x85", + "\x96\xC6"=>"\xE5\x85\x8D", + "\x96\xC7"=>"\xE6\xA3\x89", + "\x96\xC8"=>"\xE7\xB6\xBF", + "\x96\xC9"=>"\xE7\xB7\xAC", + "\x96\xCA"=>"\xE9\x9D\xA2", + "\x96\xCB"=>"\xE9\xBA\xBA", + "\x96\xCC"=>"\xE6\x91\xB8", + "\x96\xCD"=>"\xE6\xA8\xA1", + "\x96\xCE"=>"\xE8\x8C\x82", + "\x96\xCF"=>"\xE5\xA6\x84", + "\x96\xD0"=>"\xE5\xAD\x9F", + "\x96\xD1"=>"\xE6\xAF\x9B", + "\x96\xD2"=>"\xE7\x8C\x9B", + "\x96\xD3"=>"\xE7\x9B\xB2", + "\x96\xD4"=>"\xE7\xB6\xB2", + "\x96\xD5"=>"\xE8\x80\x97", + "\x96\xD6"=>"\xE8\x92\x99", + "\x96\xD7"=>"\xE5\x84\xB2", + "\x96\xD8"=>"\xE6\x9C\xA8", + "\x96\xD9"=>"\xE9\xBB\x99", + "\x96\xDA"=>"\xE7\x9B\xAE", + "\x96\xDB"=>"\xE6\x9D\xA2", + "\x96\xDC"=>"\xE5\x8B\xBF", + "\x96\xDD"=>"\xE9\xA4\x85", + "\x96\xDE"=>"\xE5\xB0\xA4", + "\x96\xDF"=>"\xE6\x88\xBB", + "\x96\xE0"=>"\xE7\xB1\xBE", + "\x96\xE1"=>"\xE8\xB2\xB0", + "\x96\xE2"=>"\xE5\x95\x8F", + "\x96\xE3"=>"\xE6\x82\xB6", + "\x96\xE4"=>"\xE7\xB4\x8B", + "\x96\xE5"=>"\xE9\x96\x80", + "\x96\xE6"=>"\xE5\x8C\x81", + "\x96\xE7"=>"\xE4\xB9\x9F", + "\x96\xE8"=>"\xE5\x86\xB6", + "\x96\xE9"=>"\xE5\xA4\x9C", + "\x96\xEA"=>"\xE7\x88\xBA", + "\x96\xEB"=>"\xE8\x80\xB6", + "\x96\xEC"=>"\xE9\x87\x8E", + "\x96\xED"=>"\xE5\xBC\xA5", + "\x96\xEE"=>"\xE7\x9F\xA2", + "\x96\xEF"=>"\xE5\x8E\x84", + "\x96\xF0"=>"\xE5\xBD\xB9", + "\x96\xF1"=>"\xE7\xB4\x84", + "\x96\xF2"=>"\xE8\x96\xAC", + "\x96\xF3"=>"\xE8\xA8\xB3", + "\x96\xF4"=>"\xE8\xBA\x8D", + "\x96\xF5"=>"\xE9\x9D\x96", + "\x96\xF6"=>"\xE6\x9F\xB3", + "\x96\xF7"=>"\xE8\x96\xAE", + "\x96\xF8"=>"\xE9\x91\x93", + "\x96\xF9"=>"\xE6\x84\x89", + "\x96\xFA"=>"\xE6\x84\x88", + "\x96\xFB"=>"\xE6\xB2\xB9", + "\x96\xFC"=>"\xE7\x99\x92", + "\x97\x40"=>"\xE8\xAB\xAD", + "\x97\x41"=>"\xE8\xBC\xB8", + "\x97\x42"=>"\xE5\x94\xAF", + "\x97\x43"=>"\xE4\xBD\x91", + "\x97\x44"=>"\xE5\x84\xAA", + "\x97\x45"=>"\xE5\x8B\x87", + "\x97\x46"=>"\xE5\x8F\x8B", + "\x97\x47"=>"\xE5\xAE\xA5", + "\x97\x48"=>"\xE5\xB9\xBD", + "\x97\x49"=>"\xE6\x82\xA0", + "\x97\x4A"=>"\xE6\x86\x82", + "\x97\x4B"=>"\xE6\x8F\x96", + "\x97\x4C"=>"\xE6\x9C\x89", + "\x97\x4D"=>"\xE6\x9F\x9A", + "\x97\x4E"=>"\xE6\xB9\xA7", + "\x97\x4F"=>"\xE6\xB6\x8C", + "\x97\x50"=>"\xE7\x8C\xB6", + "\x97\x51"=>"\xE7\x8C\xB7", + "\x97\x52"=>"\xE7\x94\xB1", + "\x97\x53"=>"\xE7\xA5\x90", + "\x97\x54"=>"\xE8\xA3\x95", + "\x97\x55"=>"\xE8\xAA\x98", + "\x97\x56"=>"\xE9\x81\x8A", + "\x97\x57"=>"\xE9\x82\x91", + "\x97\x58"=>"\xE9\x83\xB5", + "\x97\x59"=>"\xE9\x9B\x84", + "\x97\x5A"=>"\xE8\x9E\x8D", + "\x97\x5B"=>"\xE5\xA4\x95", + "\x97\x5C"=>"\xE4\xBA\x88", + "\x97\x5D"=>"\xE4\xBD\x99", + "\x97\x5E"=>"\xE4\xB8\x8E", + "\x97\x5F"=>"\xE8\xAA\x89", + "\x97\x60"=>"\xE8\xBC\xBF", + "\x97\x61"=>"\xE9\xA0\x90", + "\x97\x62"=>"\xE5\x82\xAD", + "\x97\x63"=>"\xE5\xB9\xBC", + "\x97\x64"=>"\xE5\xA6\x96", + "\x97\x65"=>"\xE5\xAE\xB9", + "\x97\x66"=>"\xE5\xBA\xB8", + "\x97\x67"=>"\xE6\x8F\x9A", + "\x97\x68"=>"\xE6\x8F\xBA", + "\x97\x69"=>"\xE6\x93\x81", + "\x97\x6A"=>"\xE6\x9B\x9C", + "\x97\x6B"=>"\xE6\xA5\x8A", + "\x97\x6C"=>"\xE6\xA7\x98", + "\x97\x6D"=>"\xE6\xB4\x8B", + "\x97\x6E"=>"\xE6\xBA\xB6", + "\x97\x6F"=>"\xE7\x86\x94", + "\x97\x70"=>"\xE7\x94\xA8", + "\x97\x71"=>"\xE7\xAA\xAF", + "\x97\x72"=>"\xE7\xBE\x8A", + "\x97\x73"=>"\xE8\x80\x80", + "\x97\x74"=>"\xE8\x91\x89", + "\x97\x75"=>"\xE8\x93\x89", + "\x97\x76"=>"\xE8\xA6\x81", + "\x97\x77"=>"\xE8\xAC\xA1", + "\x97\x78"=>"\xE8\xB8\x8A", + "\x97\x79"=>"\xE9\x81\xA5", + "\x97\x7A"=>"\xE9\x99\xBD", + "\x97\x7B"=>"\xE9\xA4\x8A", + "\x97\x7C"=>"\xE6\x85\xBE", + "\x97\x7D"=>"\xE6\x8A\x91", + "\x97\x7E"=>"\xE6\xAC\xB2", + "\x97\x80"=>"\xE6\xB2\x83", + "\x97\x81"=>"\xE6\xB5\xB4", + "\x97\x82"=>"\xE7\xBF\x8C", + "\x97\x83"=>"\xE7\xBF\xBC", + "\x97\x84"=>"\xE6\xB7\x80", + "\x97\x85"=>"\xE7\xBE\x85", + "\x97\x86"=>"\xE8\x9E\xBA", + "\x97\x87"=>"\xE8\xA3\xB8", + "\x97\x88"=>"\xE6\x9D\xA5", + "\x97\x89"=>"\xE8\x8E\xB1", + "\x97\x8A"=>"\xE9\xA0\xBC", + "\x97\x8B"=>"\xE9\x9B\xB7", + "\x97\x8C"=>"\xE6\xB4\x9B", + "\x97\x8D"=>"\xE7\xB5\xA1", + "\x97\x8E"=>"\xE8\x90\xBD", + "\x97\x8F"=>"\xE9\x85\xAA", + "\x97\x90"=>"\xE4\xB9\xB1", + "\x97\x91"=>"\xE5\x8D\xB5", + "\x97\x92"=>"\xE5\xB5\x90", + "\x97\x93"=>"\xE6\xAC\x84", + "\x97\x94"=>"\xE6\xBF\xAB", + "\x97\x95"=>"\xE8\x97\x8D", + "\x97\x96"=>"\xE8\x98\xAD", + "\x97\x97"=>"\xE8\xA6\xA7", + "\x97\x98"=>"\xE5\x88\xA9", + "\x97\x99"=>"\xE5\x90\x8F", + "\x97\x9A"=>"\xE5\xB1\xA5", + "\x97\x9B"=>"\xE6\x9D\x8E", + "\x97\x9C"=>"\xE6\xA2\xA8", + "\x97\x9D"=>"\xE7\x90\x86", + "\x97\x9E"=>"\xE7\x92\x83", + "\x97\x9F"=>"\xE7\x97\xA2", + "\x97\xA0"=>"\xE8\xA3\x8F", + "\x97\xA1"=>"\xE8\xA3\xA1", + "\x97\xA2"=>"\xE9\x87\x8C", + "\x97\xA3"=>"\xE9\x9B\xA2", + "\x97\xA4"=>"\xE9\x99\xB8", + "\x97\xA5"=>"\xE5\xBE\x8B", + "\x97\xA6"=>"\xE7\x8E\x87", + "\x97\xA7"=>"\xE7\xAB\x8B", + "\x97\xA8"=>"\xE8\x91\x8E", + "\x97\xA9"=>"\xE6\x8E\xA0", + "\x97\xAA"=>"\xE7\x95\xA5", + "\x97\xAB"=>"\xE5\x8A\x89", + "\x97\xAC"=>"\xE6\xB5\x81", + "\x97\xAD"=>"\xE6\xBA\x9C", + "\x97\xAE"=>"\xE7\x90\x89", + "\x97\xAF"=>"\xE7\x95\x99", + "\x97\xB0"=>"\xE7\xA1\xAB", + "\x97\xB1"=>"\xE7\xB2\x92", + "\x97\xB2"=>"\xE9\x9A\x86", + "\x97\xB3"=>"\xE7\xAB\x9C", + "\x97\xB4"=>"\xE9\xBE\x8D", + "\x97\xB5"=>"\xE4\xBE\xB6", + "\x97\xB6"=>"\xE6\x85\xAE", + "\x97\xB7"=>"\xE6\x97\x85", + "\x97\xB8"=>"\xE8\x99\x9C", + "\x97\xB9"=>"\xE4\xBA\x86", + "\x97\xBA"=>"\xE4\xBA\xAE", + "\x97\xBB"=>"\xE5\x83\x9A", + "\x97\xBC"=>"\xE4\xB8\xA1", + "\x97\xBD"=>"\xE5\x87\x8C", + "\x97\xBE"=>"\xE5\xAF\xAE", + "\x97\xBF"=>"\xE6\x96\x99", + "\x97\xC0"=>"\xE6\xA2\x81", + "\x97\xC1"=>"\xE6\xB6\xBC", + "\x97\xC2"=>"\xE7\x8C\x9F", + "\x97\xC3"=>"\xE7\x99\x82", + "\x97\xC4"=>"\xE7\x9E\xAD", + "\x97\xC5"=>"\xE7\xA8\x9C", + "\x97\xC6"=>"\xE7\xB3\xA7", + "\x97\xC7"=>"\xE8\x89\xAF", + "\x97\xC8"=>"\xE8\xAB\x92", + "\x97\xC9"=>"\xE9\x81\xBC", + "\x97\xCA"=>"\xE9\x87\x8F", + "\x97\xCB"=>"\xE9\x99\xB5", + "\x97\xCC"=>"\xE9\xA0\x98", + "\x97\xCD"=>"\xE5\x8A\x9B", + "\x97\xCE"=>"\xE7\xB7\x91", + "\x97\xCF"=>"\xE5\x80\xAB", + "\x97\xD0"=>"\xE5\x8E\x98", + "\x97\xD1"=>"\xE6\x9E\x97", + "\x97\xD2"=>"\xE6\xB7\x8B", + "\x97\xD3"=>"\xE7\x87\x90", + "\x97\xD4"=>"\xE7\x90\xB3", + "\x97\xD5"=>"\xE8\x87\xA8", + "\x97\xD6"=>"\xE8\xBC\xAA", + "\x97\xD7"=>"\xE9\x9A\xA3", + "\x97\xD8"=>"\xE9\xB1\x97", + "\x97\xD9"=>"\xE9\xBA\x9F", + "\x97\xDA"=>"\xE7\x91\xA0", + "\x97\xDB"=>"\xE5\xA1\x81", + "\x97\xDC"=>"\xE6\xB6\x99", + "\x97\xDD"=>"\xE7\xB4\xAF", + "\x97\xDE"=>"\xE9\xA1\x9E", + "\x97\xDF"=>"\xE4\xBB\xA4", + "\x97\xE0"=>"\xE4\xBC\xB6", + "\x97\xE1"=>"\xE4\xBE\x8B", + "\x97\xE2"=>"\xE5\x86\xB7", + "\x97\xE3"=>"\xE5\x8A\xB1", + "\x97\xE4"=>"\xE5\xB6\xBA", + "\x97\xE5"=>"\xE6\x80\x9C", + "\x97\xE6"=>"\xE7\x8E\xB2", + "\x97\xE7"=>"\xE7\xA4\xBC", + "\x97\xE8"=>"\xE8\x8B\x93", + "\x97\xE9"=>"\xE9\x88\xB4", + "\x97\xEA"=>"\xE9\x9A\xB7", + "\x97\xEB"=>"\xE9\x9B\xB6", + "\x97\xEC"=>"\xE9\x9C\x8A", + "\x97\xED"=>"\xE9\xBA\x97", + "\x97\xEE"=>"\xE9\xBD\xA2", + "\x97\xEF"=>"\xE6\x9A\xA6", + "\x97\xF0"=>"\xE6\xAD\xB4", + "\x97\xF1"=>"\xE5\x88\x97", + "\x97\xF2"=>"\xE5\x8A\xA3", + "\x97\xF3"=>"\xE7\x83\x88", + "\x97\xF4"=>"\xE8\xA3\x82", + "\x97\xF5"=>"\xE5\xBB\x89", + "\x97\xF6"=>"\xE6\x81\x8B", + "\x97\xF7"=>"\xE6\x86\x90", + "\x97\xF8"=>"\xE6\xBC\xA3", + "\x97\xF9"=>"\xE7\x85\x89", + "\x97\xFA"=>"\xE7\xB0\xBE", + "\x97\xFB"=>"\xE7\xB7\xB4", + "\x97\xFC"=>"\xE8\x81\xAF", + "\x98\x40"=>"\xE8\x93\xAE", + "\x98\x41"=>"\xE9\x80\xA3", + "\x98\x42"=>"\xE9\x8C\xAC", + "\x98\x43"=>"\xE5\x91\x82", + "\x98\x44"=>"\xE9\xAD\xAF", + "\x98\x45"=>"\xE6\xAB\x93", + "\x98\x46"=>"\xE7\x82\x89", + "\x98\x47"=>"\xE8\xB3\x82", + "\x98\x48"=>"\xE8\xB7\xAF", + "\x98\x49"=>"\xE9\x9C\xB2", + "\x98\x4A"=>"\xE5\x8A\xB4", + "\x98\x4B"=>"\xE5\xA9\x81", + "\x98\x4C"=>"\xE5\xBB\x8A", + "\x98\x4D"=>"\xE5\xBC\x84", + "\x98\x4E"=>"\xE6\x9C\x97", + "\x98\x4F"=>"\xE6\xA5\xBC", + "\x98\x50"=>"\xE6\xA6\x94", + "\x98\x51"=>"\xE6\xB5\xAA", + "\x98\x52"=>"\xE6\xBC\x8F", + "\x98\x53"=>"\xE7\x89\xA2", + "\x98\x54"=>"\xE7\x8B\xBC", + "\x98\x55"=>"\xE7\xAF\xAD", + "\x98\x56"=>"\xE8\x80\x81", + "\x98\x57"=>"\xE8\x81\xBE", + "\x98\x58"=>"\xE8\x9D\x8B", + "\x98\x59"=>"\xE9\x83\x8E", + "\x98\x5A"=>"\xE5\x85\xAD", + "\x98\x5B"=>"\xE9\xBA\x93", + "\x98\x5C"=>"\xE7\xA6\x84", + "\x98\x5D"=>"\xE8\x82\x8B", + "\x98\x5E"=>"\xE9\x8C\xB2", + "\x98\x5F"=>"\xE8\xAB\x96", + "\x98\x60"=>"\xE5\x80\xAD", + "\x98\x61"=>"\xE5\x92\x8C", + "\x98\x62"=>"\xE8\xA9\xB1", + "\x98\x63"=>"\xE6\xAD\xAA", + "\x98\x64"=>"\xE8\xB3\x84", + "\x98\x65"=>"\xE8\x84\x87", + "\x98\x66"=>"\xE6\x83\x91", + "\x98\x67"=>"\xE6\x9E\xA0", + "\x98\x68"=>"\xE9\xB7\xB2", + "\x98\x69"=>"\xE4\xBA\x99", + "\x98\x6A"=>"\xE4\xBA\x98", + "\x98\x6B"=>"\xE9\xB0\x90", + "\x98\x6C"=>"\xE8\xA9\xAB", + "\x98\x6D"=>"\xE8\x97\x81", + "\x98\x6E"=>"\xE8\x95\xA8", + "\x98\x6F"=>"\xE6\xA4\x80", + "\x98\x70"=>"\xE6\xB9\xBE", + "\x98\x71"=>"\xE7\xA2\x97", + "\x98\x72"=>"\xE8\x85\x95", + "\x98\x9F"=>"\xE5\xBC\x8C", + "\x98\xA0"=>"\xE4\xB8\x90", + "\x98\xA1"=>"\xE4\xB8\x95", + "\x98\xA2"=>"\xE4\xB8\xAA", + "\x98\xA3"=>"\xE4\xB8\xB1", + "\x98\xA4"=>"\xE4\xB8\xB6", + "\x98\xA5"=>"\xE4\xB8\xBC", + "\x98\xA6"=>"\xE4\xB8\xBF", + "\x98\xA7"=>"\xE4\xB9\x82", + "\x98\xA8"=>"\xE4\xB9\x96", + "\x98\xA9"=>"\xE4\xB9\x98", + "\x98\xAA"=>"\xE4\xBA\x82", + "\x98\xAB"=>"\xE4\xBA\x85", + "\x98\xAC"=>"\xE8\xB1\xAB", + "\x98\xAD"=>"\xE4\xBA\x8A", + "\x98\xAE"=>"\xE8\x88\x92", + "\x98\xAF"=>"\xE5\xBC\x8D", + "\x98\xB0"=>"\xE4\xBA\x8E", + "\x98\xB1"=>"\xE4\xBA\x9E", + "\x98\xB2"=>"\xE4\xBA\x9F", + "\x98\xB3"=>"\xE4\xBA\xA0", + "\x98\xB4"=>"\xE4\xBA\xA2", + "\x98\xB5"=>"\xE4\xBA\xB0", + "\x98\xB6"=>"\xE4\xBA\xB3", + "\x98\xB7"=>"\xE4\xBA\xB6", + "\x98\xB8"=>"\xE4\xBB\x8E", + "\x98\xB9"=>"\xE4\xBB\x8D", + "\x98\xBA"=>"\xE4\xBB\x84", + "\x98\xBB"=>"\xE4\xBB\x86", + "\x98\xBC"=>"\xE4\xBB\x82", + "\x98\xBD"=>"\xE4\xBB\x97", + "\x98\xBE"=>"\xE4\xBB\x9E", + "\x98\xBF"=>"\xE4\xBB\xAD", + "\x98\xC0"=>"\xE4\xBB\x9F", + "\x98\xC1"=>"\xE4\xBB\xB7", + "\x98\xC2"=>"\xE4\xBC\x89", + "\x98\xC3"=>"\xE4\xBD\x9A", + "\x98\xC4"=>"\xE4\xBC\xB0", + "\x98\xC5"=>"\xE4\xBD\x9B", + "\x98\xC6"=>"\xE4\xBD\x9D", + "\x98\xC7"=>"\xE4\xBD\x97", + "\x98\xC8"=>"\xE4\xBD\x87", + "\x98\xC9"=>"\xE4\xBD\xB6", + "\x98\xCA"=>"\xE4\xBE\x88", + "\x98\xCB"=>"\xE4\xBE\x8F", + "\x98\xCC"=>"\xE4\xBE\x98", + "\x98\xCD"=>"\xE4\xBD\xBB", + "\x98\xCE"=>"\xE4\xBD\xA9", + "\x98\xCF"=>"\xE4\xBD\xB0", + "\x98\xD0"=>"\xE4\xBE\x91", + "\x98\xD1"=>"\xE4\xBD\xAF", + "\x98\xD2"=>"\xE4\xBE\x86", + "\x98\xD3"=>"\xE4\xBE\x96", + "\x98\xD4"=>"\xE5\x84\x98", + "\x98\xD5"=>"\xE4\xBF\x94", + "\x98\xD6"=>"\xE4\xBF\x9F", + "\x98\xD7"=>"\xE4\xBF\x8E", + "\x98\xD8"=>"\xE4\xBF\x98", + "\x98\xD9"=>"\xE4\xBF\x9B", + "\x98\xDA"=>"\xE4\xBF\x91", + "\x98\xDB"=>"\xE4\xBF\x9A", + "\x98\xDC"=>"\xE4\xBF\x90", + "\x98\xDD"=>"\xE4\xBF\xA4", + "\x98\xDE"=>"\xE4\xBF\xA5", + "\x98\xDF"=>"\xE5\x80\x9A", + "\x98\xE0"=>"\xE5\x80\xA8", + "\x98\xE1"=>"\xE5\x80\x94", + "\x98\xE2"=>"\xE5\x80\xAA", + "\x98\xE3"=>"\xE5\x80\xA5", + "\x98\xE4"=>"\xE5\x80\x85", + "\x98\xE5"=>"\xE4\xBC\x9C", + "\x98\xE6"=>"\xE4\xBF\xB6", + "\x98\xE7"=>"\xE5\x80\xA1", + "\x98\xE8"=>"\xE5\x80\xA9", + "\x98\xE9"=>"\xE5\x80\xAC", + "\x98\xEA"=>"\xE4\xBF\xBE", + "\x98\xEB"=>"\xE4\xBF\xAF", + "\x98\xEC"=>"\xE5\x80\x91", + "\x98\xED"=>"\xE5\x80\x86", + "\x98\xEE"=>"\xE5\x81\x83", + "\x98\xEF"=>"\xE5\x81\x87", + "\x98\xF0"=>"\xE6\x9C\x83", + "\x98\xF1"=>"\xE5\x81\x95", + "\x98\xF2"=>"\xE5\x81\x90", + "\x98\xF3"=>"\xE5\x81\x88", + "\x98\xF4"=>"\xE5\x81\x9A", + "\x98\xF5"=>"\xE5\x81\x96", + "\x98\xF6"=>"\xE5\x81\xAC", + "\x98\xF7"=>"\xE5\x81\xB8", + "\x98\xF8"=>"\xE5\x82\x80", + "\x98\xF9"=>"\xE5\x82\x9A", + "\x98\xFA"=>"\xE5\x82\x85", + "\x98\xFB"=>"\xE5\x82\xB4", + "\x98\xFC"=>"\xE5\x82\xB2", + "\x99\x40"=>"\xE5\x83\x89", + "\x99\x41"=>"\xE5\x83\x8A", + "\x99\x42"=>"\xE5\x82\xB3", + "\x99\x43"=>"\xE5\x83\x82", + "\x99\x44"=>"\xE5\x83\x96", + "\x99\x45"=>"\xE5\x83\x9E", + "\x99\x46"=>"\xE5\x83\xA5", + "\x99\x47"=>"\xE5\x83\xAD", + "\x99\x48"=>"\xE5\x83\xA3", + "\x99\x49"=>"\xE5\x83\xAE", + "\x99\x4A"=>"\xE5\x83\xB9", + "\x99\x4B"=>"\xE5\x83\xB5", + "\x99\x4C"=>"\xE5\x84\x89", + "\x99\x4D"=>"\xE5\x84\x81", + "\x99\x4E"=>"\xE5\x84\x82", + "\x99\x4F"=>"\xE5\x84\x96", + "\x99\x50"=>"\xE5\x84\x95", + "\x99\x51"=>"\xE5\x84\x94", + "\x99\x52"=>"\xE5\x84\x9A", + "\x99\x53"=>"\xE5\x84\xA1", + "\x99\x54"=>"\xE5\x84\xBA", + "\x99\x55"=>"\xE5\x84\xB7", + "\x99\x56"=>"\xE5\x84\xBC", + "\x99\x57"=>"\xE5\x84\xBB", + "\x99\x58"=>"\xE5\x84\xBF", + "\x99\x59"=>"\xE5\x85\x80", + "\x99\x5A"=>"\xE5\x85\x92", + "\x99\x5B"=>"\xE5\x85\x8C", + "\x99\x5C"=>"\xE5\x85\x94", + "\x99\x5D"=>"\xE5\x85\xA2", + "\x99\x5E"=>"\xE7\xAB\xB8", + "\x99\x5F"=>"\xE5\x85\xA9", + "\x99\x60"=>"\xE5\x85\xAA", + "\x99\x61"=>"\xE5\x85\xAE", + "\x99\x62"=>"\xE5\x86\x80", + "\x99\x63"=>"\xE5\x86\x82", + "\x99\x64"=>"\xE5\x9B\x98", + "\x99\x65"=>"\xE5\x86\x8C", + "\x99\x66"=>"\xE5\x86\x89", + "\x99\x67"=>"\xE5\x86\x8F", + "\x99\x68"=>"\xE5\x86\x91", + "\x99\x69"=>"\xE5\x86\x93", + "\x99\x6A"=>"\xE5\x86\x95", + "\x99\x6B"=>"\xE5\x86\x96", + "\x99\x6C"=>"\xE5\x86\xA4", + "\x99\x6D"=>"\xE5\x86\xA6", + "\x99\x6E"=>"\xE5\x86\xA2", + "\x99\x6F"=>"\xE5\x86\xA9", + "\x99\x70"=>"\xE5\x86\xAA", + "\x99\x71"=>"\xE5\x86\xAB", + "\x99\x72"=>"\xE5\x86\xB3", + "\x99\x73"=>"\xE5\x86\xB1", + "\x99\x74"=>"\xE5\x86\xB2", + "\x99\x75"=>"\xE5\x86\xB0", + "\x99\x76"=>"\xE5\x86\xB5", + "\x99\x77"=>"\xE5\x86\xBD", + "\x99\x78"=>"\xE5\x87\x85", + "\x99\x79"=>"\xE5\x87\x89", + "\x99\x7A"=>"\xE5\x87\x9B", + "\x99\x7B"=>"\xE5\x87\xA0", + "\x99\x7C"=>"\xE8\x99\x95", + "\x99\x7D"=>"\xE5\x87\xA9", + "\x99\x7E"=>"\xE5\x87\xAD", + "\x99\x80"=>"\xE5\x87\xB0", + "\x99\x81"=>"\xE5\x87\xB5", + "\x99\x82"=>"\xE5\x87\xBE", + "\x99\x83"=>"\xE5\x88\x84", + "\x99\x84"=>"\xE5\x88\x8B", + "\x99\x85"=>"\xE5\x88\x94", + "\x99\x86"=>"\xE5\x88\x8E", + "\x99\x87"=>"\xE5\x88\xA7", + "\x99\x88"=>"\xE5\x88\xAA", + "\x99\x89"=>"\xE5\x88\xAE", + "\x99\x8A"=>"\xE5\x88\xB3", + "\x99\x8B"=>"\xE5\x88\xB9", + "\x99\x8C"=>"\xE5\x89\x8F", + "\x99\x8D"=>"\xE5\x89\x84", + "\x99\x8E"=>"\xE5\x89\x8B", + "\x99\x8F"=>"\xE5\x89\x8C", + "\x99\x90"=>"\xE5\x89\x9E", + "\x99\x91"=>"\xE5\x89\x94", + "\x99\x92"=>"\xE5\x89\xAA", + "\x99\x93"=>"\xE5\x89\xB4", + "\x99\x94"=>"\xE5\x89\xA9", + "\x99\x95"=>"\xE5\x89\xB3", + "\x99\x96"=>"\xE5\x89\xBF", + "\x99\x97"=>"\xE5\x89\xBD", + "\x99\x98"=>"\xE5\x8A\x8D", + "\x99\x99"=>"\xE5\x8A\x94", + "\x99\x9A"=>"\xE5\x8A\x92", + "\x99\x9B"=>"\xE5\x89\xB1", + "\x99\x9C"=>"\xE5\x8A\x88", + "\x99\x9D"=>"\xE5\x8A\x91", + "\x99\x9E"=>"\xE8\xBE\xA8", + "\x99\x9F"=>"\xE8\xBE\xA7", + "\x99\xA0"=>"\xE5\x8A\xAC", + "\x99\xA1"=>"\xE5\x8A\xAD", + "\x99\xA2"=>"\xE5\x8A\xBC", + "\x99\xA3"=>"\xE5\x8A\xB5", + "\x99\xA4"=>"\xE5\x8B\x81", + "\x99\xA5"=>"\xE5\x8B\x8D", + "\x99\xA6"=>"\xE5\x8B\x97", + "\x99\xA7"=>"\xE5\x8B\x9E", + "\x99\xA8"=>"\xE5\x8B\xA3", + "\x99\xA9"=>"\xE5\x8B\xA6", + "\x99\xAA"=>"\xE9\xA3\xAD", + "\x99\xAB"=>"\xE5\x8B\xA0", + "\x99\xAC"=>"\xE5\x8B\xB3", + "\x99\xAD"=>"\xE5\x8B\xB5", + "\x99\xAE"=>"\xE5\x8B\xB8", + "\x99\xAF"=>"\xE5\x8B\xB9", + "\x99\xB0"=>"\xE5\x8C\x86", + "\x99\xB1"=>"\xE5\x8C\x88", + "\x99\xB2"=>"\xE7\x94\xB8", + "\x99\xB3"=>"\xE5\x8C\x8D", + "\x99\xB4"=>"\xE5\x8C\x90", + "\x99\xB5"=>"\xE5\x8C\x8F", + "\x99\xB6"=>"\xE5\x8C\x95", + "\x99\xB7"=>"\xE5\x8C\x9A", + "\x99\xB8"=>"\xE5\x8C\xA3", + "\x99\xB9"=>"\xE5\x8C\xAF", + "\x99\xBA"=>"\xE5\x8C\xB1", + "\x99\xBB"=>"\xE5\x8C\xB3", + "\x99\xBC"=>"\xE5\x8C\xB8", + "\x99\xBD"=>"\xE5\x8D\x80", + "\x99\xBE"=>"\xE5\x8D\x86", + "\x99\xBF"=>"\xE5\x8D\x85", + "\x99\xC0"=>"\xE4\xB8\x97", + "\x99\xC1"=>"\xE5\x8D\x89", + "\x99\xC2"=>"\xE5\x8D\x8D", + "\x99\xC3"=>"\xE5\x87\x96", + "\x99\xC4"=>"\xE5\x8D\x9E", + "\x99\xC5"=>"\xE5\x8D\xA9", + "\x99\xC6"=>"\xE5\x8D\xAE", + "\x99\xC7"=>"\xE5\xA4\x98", + "\x99\xC8"=>"\xE5\x8D\xBB", + "\x99\xC9"=>"\xE5\x8D\xB7", + "\x99\xCA"=>"\xE5\x8E\x82", + "\x99\xCB"=>"\xE5\x8E\x96", + "\x99\xCC"=>"\xE5\x8E\xA0", + "\x99\xCD"=>"\xE5\x8E\xA6", + "\x99\xCE"=>"\xE5\x8E\xA5", + "\x99\xCF"=>"\xE5\x8E\xAE", + "\x99\xD0"=>"\xE5\x8E\xB0", + "\x99\xD1"=>"\xE5\x8E\xB6", + "\x99\xD2"=>"\xE5\x8F\x83", + "\x99\xD3"=>"\xE7\xB0\x92", + "\x99\xD4"=>"\xE9\x9B\x99", + "\x99\xD5"=>"\xE5\x8F\x9F", + "\x99\xD6"=>"\xE6\x9B\xBC", + "\x99\xD7"=>"\xE7\x87\xAE", + "\x99\xD8"=>"\xE5\x8F\xAE", + "\x99\xD9"=>"\xE5\x8F\xA8", + "\x99\xDA"=>"\xE5\x8F\xAD", + "\x99\xDB"=>"\xE5\x8F\xBA", + "\x99\xDC"=>"\xE5\x90\x81", + "\x99\xDD"=>"\xE5\x90\xBD", + "\x99\xDE"=>"\xE5\x91\x80", + "\x99\xDF"=>"\xE5\x90\xAC", + "\x99\xE0"=>"\xE5\x90\xAD", + "\x99\xE1"=>"\xE5\x90\xBC", + "\x99\xE2"=>"\xE5\x90\xAE", + "\x99\xE3"=>"\xE5\x90\xB6", + "\x99\xE4"=>"\xE5\x90\xA9", + "\x99\xE5"=>"\xE5\x90\x9D", + "\x99\xE6"=>"\xE5\x91\x8E", + "\x99\xE7"=>"\xE5\x92\x8F", + "\x99\xE8"=>"\xE5\x91\xB5", + "\x99\xE9"=>"\xE5\x92\x8E", + "\x99\xEA"=>"\xE5\x91\x9F", + "\x99\xEB"=>"\xE5\x91\xB1", + "\x99\xEC"=>"\xE5\x91\xB7", + "\x99\xED"=>"\xE5\x91\xB0", + "\x99\xEE"=>"\xE5\x92\x92", + "\x99\xEF"=>"\xE5\x91\xBB", + "\x99\xF0"=>"\xE5\x92\x80", + "\x99\xF1"=>"\xE5\x91\xB6", + "\x99\xF2"=>"\xE5\x92\x84", + "\x99\xF3"=>"\xE5\x92\x90", + "\x99\xF4"=>"\xE5\x92\x86", + "\x99\xF5"=>"\xE5\x93\x87", + "\x99\xF6"=>"\xE5\x92\xA2", + "\x99\xF7"=>"\xE5\x92\xB8", + "\x99\xF8"=>"\xE5\x92\xA5", + "\x99\xF9"=>"\xE5\x92\xAC", + "\x99\xFA"=>"\xE5\x93\x84", + "\x99\xFB"=>"\xE5\x93\x88", + "\x99\xFC"=>"\xE5\x92\xA8", + "\x9A\x40"=>"\xE5\x92\xAB", + "\x9A\x41"=>"\xE5\x93\x82", + "\x9A\x42"=>"\xE5\x92\xA4", + "\x9A\x43"=>"\xE5\x92\xBE", + "\x9A\x44"=>"\xE5\x92\xBC", + "\x9A\x45"=>"\xE5\x93\x98", + "\x9A\x46"=>"\xE5\x93\xA5", + "\x9A\x47"=>"\xE5\x93\xA6", + "\x9A\x48"=>"\xE5\x94\x8F", + "\x9A\x49"=>"\xE5\x94\x94", + "\x9A\x4A"=>"\xE5\x93\xBD", + "\x9A\x4B"=>"\xE5\x93\xAE", + "\x9A\x4C"=>"\xE5\x93\xAD", + "\x9A\x4D"=>"\xE5\x93\xBA", + "\x9A\x4E"=>"\xE5\x93\xA2", + "\x9A\x4F"=>"\xE5\x94\xB9", + "\x9A\x50"=>"\xE5\x95\x80", + "\x9A\x51"=>"\xE5\x95\xA3", + "\x9A\x52"=>"\xE5\x95\x8C", + "\x9A\x53"=>"\xE5\x94\xAE", + "\x9A\x54"=>"\xE5\x95\x9C", + "\x9A\x55"=>"\xE5\x95\x85", + "\x9A\x56"=>"\xE5\x95\x96", + "\x9A\x57"=>"\xE5\x95\x97", + "\x9A\x58"=>"\xE5\x94\xB8", + "\x9A\x59"=>"\xE5\x94\xB3", + "\x9A\x5A"=>"\xE5\x95\x9D", + "\x9A\x5B"=>"\xE5\x96\x99", + "\x9A\x5C"=>"\xE5\x96\x80", + "\x9A\x5D"=>"\xE5\x92\xAF", + "\x9A\x5E"=>"\xE5\x96\x8A", + "\x9A\x5F"=>"\xE5\x96\x9F", + "\x9A\x60"=>"\xE5\x95\xBB", + "\x9A\x61"=>"\xE5\x95\xBE", + "\x9A\x62"=>"\xE5\x96\x98", + "\x9A\x63"=>"\xE5\x96\x9E", + "\x9A\x64"=>"\xE5\x96\xAE", + "\x9A\x65"=>"\xE5\x95\xBC", + "\x9A\x66"=>"\xE5\x96\x83", + "\x9A\x67"=>"\xE5\x96\xA9", + "\x9A\x68"=>"\xE5\x96\x87", + "\x9A\x69"=>"\xE5\x96\xA8", + "\x9A\x6A"=>"\xE5\x97\x9A", + "\x9A\x6B"=>"\xE5\x97\x85", + "\x9A\x6C"=>"\xE5\x97\x9F", + "\x9A\x6D"=>"\xE5\x97\x84", + "\x9A\x6E"=>"\xE5\x97\x9C", + "\x9A\x6F"=>"\xE5\x97\xA4", + "\x9A\x70"=>"\xE5\x97\x94", + "\x9A\x71"=>"\xE5\x98\x94", + "\x9A\x72"=>"\xE5\x97\xB7", + "\x9A\x73"=>"\xE5\x98\x96", + "\x9A\x74"=>"\xE5\x97\xBE", + "\x9A\x75"=>"\xE5\x97\xBD", + "\x9A\x76"=>"\xE5\x98\x9B", + "\x9A\x77"=>"\xE5\x97\xB9", + "\x9A\x78"=>"\xE5\x99\x8E", + "\x9A\x79"=>"\xE5\x99\x90", + "\x9A\x7A"=>"\xE7\x87\x9F", + "\x9A\x7B"=>"\xE5\x98\xB4", + "\x9A\x7C"=>"\xE5\x98\xB6", + "\x9A\x7D"=>"\xE5\x98\xB2", + "\x9A\x7E"=>"\xE5\x98\xB8", + "\x9A\x80"=>"\xE5\x99\xAB", + "\x9A\x81"=>"\xE5\x99\xA4", + "\x9A\x82"=>"\xE5\x98\xAF", + "\x9A\x83"=>"\xE5\x99\xAC", + "\x9A\x84"=>"\xE5\x99\xAA", + "\x9A\x85"=>"\xE5\x9A\x86", + "\x9A\x86"=>"\xE5\x9A\x80", + "\x9A\x87"=>"\xE5\x9A\x8A", + "\x9A\x88"=>"\xE5\x9A\xA0", + "\x9A\x89"=>"\xE5\x9A\x94", + "\x9A\x8A"=>"\xE5\x9A\x8F", + "\x9A\x8B"=>"\xE5\x9A\xA5", + "\x9A\x8C"=>"\xE5\x9A\xAE", + "\x9A\x8D"=>"\xE5\x9A\xB6", + "\x9A\x8E"=>"\xE5\x9A\xB4", + "\x9A\x8F"=>"\xE5\x9B\x82", + "\x9A\x90"=>"\xE5\x9A\xBC", + "\x9A\x91"=>"\xE5\x9B\x81", + "\x9A\x92"=>"\xE5\x9B\x83", + "\x9A\x93"=>"\xE5\x9B\x80", + "\x9A\x94"=>"\xE5\x9B\x88", + "\x9A\x95"=>"\xE5\x9B\x8E", + "\x9A\x96"=>"\xE5\x9B\x91", + "\x9A\x97"=>"\xE5\x9B\x93", + "\x9A\x98"=>"\xE5\x9B\x97", + "\x9A\x99"=>"\xE5\x9B\xAE", + "\x9A\x9A"=>"\xE5\x9B\xB9", + "\x9A\x9B"=>"\xE5\x9C\x80", + "\x9A\x9C"=>"\xE5\x9B\xBF", + "\x9A\x9D"=>"\xE5\x9C\x84", + "\x9A\x9E"=>"\xE5\x9C\x89", + "\x9A\x9F"=>"\xE5\x9C\x88", + "\x9A\xA0"=>"\xE5\x9C\x8B", + "\x9A\xA1"=>"\xE5\x9C\x8D", + "\x9A\xA2"=>"\xE5\x9C\x93", + "\x9A\xA3"=>"\xE5\x9C\x98", + "\x9A\xA4"=>"\xE5\x9C\x96", + "\x9A\xA5"=>"\xE5\x97\x87", + "\x9A\xA6"=>"\xE5\x9C\x9C", + "\x9A\xA7"=>"\xE5\x9C\xA6", + "\x9A\xA8"=>"\xE5\x9C\xB7", + "\x9A\xA9"=>"\xE5\x9C\xB8", + "\x9A\xAA"=>"\xE5\x9D\x8E", + "\x9A\xAB"=>"\xE5\x9C\xBB", + "\x9A\xAC"=>"\xE5\x9D\x80", + "\x9A\xAD"=>"\xE5\x9D\x8F", + "\x9A\xAE"=>"\xE5\x9D\xA9", + "\x9A\xAF"=>"\xE5\x9F\x80", + "\x9A\xB0"=>"\xE5\x9E\x88", + "\x9A\xB1"=>"\xE5\x9D\xA1", + "\x9A\xB2"=>"\xE5\x9D\xBF", + "\x9A\xB3"=>"\xE5\x9E\x89", + "\x9A\xB4"=>"\xE5\x9E\x93", + "\x9A\xB5"=>"\xE5\x9E\xA0", + "\x9A\xB6"=>"\xE5\x9E\xB3", + "\x9A\xB7"=>"\xE5\x9E\xA4", + "\x9A\xB8"=>"\xE5\x9E\xAA", + "\x9A\xB9"=>"\xE5\x9E\xB0", + "\x9A\xBA"=>"\xE5\x9F\x83", + "\x9A\xBB"=>"\xE5\x9F\x86", + "\x9A\xBC"=>"\xE5\x9F\x94", + "\x9A\xBD"=>"\xE5\x9F\x92", + "\x9A\xBE"=>"\xE5\x9F\x93", + "\x9A\xBF"=>"\xE5\xA0\x8A", + "\x9A\xC0"=>"\xE5\x9F\x96", + "\x9A\xC1"=>"\xE5\x9F\xA3", + "\x9A\xC2"=>"\xE5\xA0\x8B", + "\x9A\xC3"=>"\xE5\xA0\x99", + "\x9A\xC4"=>"\xE5\xA0\x9D", + "\x9A\xC5"=>"\xE5\xA1\xB2", + "\x9A\xC6"=>"\xE5\xA0\xA1", + "\x9A\xC7"=>"\xE5\xA1\xA2", + "\x9A\xC8"=>"\xE5\xA1\x8B", + "\x9A\xC9"=>"\xE5\xA1\xB0", + "\x9A\xCA"=>"\xE6\xAF\x80", + "\x9A\xCB"=>"\xE5\xA1\x92", + "\x9A\xCC"=>"\xE5\xA0\xBD", + "\x9A\xCD"=>"\xE5\xA1\xB9", + "\x9A\xCE"=>"\xE5\xA2\x85", + "\x9A\xCF"=>"\xE5\xA2\xB9", + "\x9A\xD0"=>"\xE5\xA2\x9F", + "\x9A\xD1"=>"\xE5\xA2\xAB", + "\x9A\xD2"=>"\xE5\xA2\xBA", + "\x9A\xD3"=>"\xE5\xA3\x9E", + "\x9A\xD4"=>"\xE5\xA2\xBB", + "\x9A\xD5"=>"\xE5\xA2\xB8", + "\x9A\xD6"=>"\xE5\xA2\xAE", + "\x9A\xD7"=>"\xE5\xA3\x85", + "\x9A\xD8"=>"\xE5\xA3\x93", + "\x9A\xD9"=>"\xE5\xA3\x91", + "\x9A\xDA"=>"\xE5\xA3\x97", + "\x9A\xDB"=>"\xE5\xA3\x99", + "\x9A\xDC"=>"\xE5\xA3\x98", + "\x9A\xDD"=>"\xE5\xA3\xA5", + "\x9A\xDE"=>"\xE5\xA3\x9C", + "\x9A\xDF"=>"\xE5\xA3\xA4", + "\x9A\xE0"=>"\xE5\xA3\x9F", + "\x9A\xE1"=>"\xE5\xA3\xAF", + "\x9A\xE2"=>"\xE5\xA3\xBA", + "\x9A\xE3"=>"\xE5\xA3\xB9", + "\x9A\xE4"=>"\xE5\xA3\xBB", + "\x9A\xE5"=>"\xE5\xA3\xBC", + "\x9A\xE6"=>"\xE5\xA3\xBD", + "\x9A\xE7"=>"\xE5\xA4\x82", + "\x9A\xE8"=>"\xE5\xA4\x8A", + "\x9A\xE9"=>"\xE5\xA4\x90", + "\x9A\xEA"=>"\xE5\xA4\x9B", + "\x9A\xEB"=>"\xE6\xA2\xA6", + "\x9A\xEC"=>"\xE5\xA4\xA5", + "\x9A\xED"=>"\xE5\xA4\xAC", + "\x9A\xEE"=>"\xE5\xA4\xAD", + "\x9A\xEF"=>"\xE5\xA4\xB2", + "\x9A\xF0"=>"\xE5\xA4\xB8", + "\x9A\xF1"=>"\xE5\xA4\xBE", + "\x9A\xF2"=>"\xE7\xAB\x92", + "\x9A\xF3"=>"\xE5\xA5\x95", + "\x9A\xF4"=>"\xE5\xA5\x90", + "\x9A\xF5"=>"\xE5\xA5\x8E", + "\x9A\xF6"=>"\xE5\xA5\x9A", + "\x9A\xF7"=>"\xE5\xA5\x98", + "\x9A\xF8"=>"\xE5\xA5\xA2", + "\x9A\xF9"=>"\xE5\xA5\xA0", + "\x9A\xFA"=>"\xE5\xA5\xA7", + "\x9A\xFB"=>"\xE5\xA5\xAC", + "\x9A\xFC"=>"\xE5\xA5\xA9", + "\x9B\x40"=>"\xE5\xA5\xB8", + "\x9B\x41"=>"\xE5\xA6\x81", + "\x9B\x42"=>"\xE5\xA6\x9D", + "\x9B\x43"=>"\xE4\xBD\x9E", + "\x9B\x44"=>"\xE4\xBE\xAB", + "\x9B\x45"=>"\xE5\xA6\xA3", + "\x9B\x46"=>"\xE5\xA6\xB2", + "\x9B\x47"=>"\xE5\xA7\x86", + "\x9B\x48"=>"\xE5\xA7\xA8", + "\x9B\x49"=>"\xE5\xA7\x9C", + "\x9B\x4A"=>"\xE5\xA6\x8D", + "\x9B\x4B"=>"\xE5\xA7\x99", + "\x9B\x4C"=>"\xE5\xA7\x9A", + "\x9B\x4D"=>"\xE5\xA8\xA5", + "\x9B\x4E"=>"\xE5\xA8\x9F", + "\x9B\x4F"=>"\xE5\xA8\x91", + "\x9B\x50"=>"\xE5\xA8\x9C", + "\x9B\x51"=>"\xE5\xA8\x89", + "\x9B\x52"=>"\xE5\xA8\x9A", + "\x9B\x53"=>"\xE5\xA9\x80", + "\x9B\x54"=>"\xE5\xA9\xAC", + "\x9B\x55"=>"\xE5\xA9\x89", + "\x9B\x56"=>"\xE5\xA8\xB5", + "\x9B\x57"=>"\xE5\xA8\xB6", + "\x9B\x58"=>"\xE5\xA9\xA2", + "\x9B\x59"=>"\xE5\xA9\xAA", + "\x9B\x5A"=>"\xE5\xAA\x9A", + "\x9B\x5B"=>"\xE5\xAA\xBC", + "\x9B\x5C"=>"\xE5\xAA\xBE", + "\x9B\x5D"=>"\xE5\xAB\x8B", + "\x9B\x5E"=>"\xE5\xAB\x82", + "\x9B\x5F"=>"\xE5\xAA\xBD", + "\x9B\x60"=>"\xE5\xAB\xA3", + "\x9B\x61"=>"\xE5\xAB\x97", + "\x9B\x62"=>"\xE5\xAB\xA6", + "\x9B\x63"=>"\xE5\xAB\xA9", + "\x9B\x64"=>"\xE5\xAB\x96", + "\x9B\x65"=>"\xE5\xAB\xBA", + "\x9B\x66"=>"\xE5\xAB\xBB", + "\x9B\x67"=>"\xE5\xAC\x8C", + "\x9B\x68"=>"\xE5\xAC\x8B", + "\x9B\x69"=>"\xE5\xAC\x96", + "\x9B\x6A"=>"\xE5\xAC\xB2", + "\x9B\x6B"=>"\xE5\xAB\x90", + "\x9B\x6C"=>"\xE5\xAC\xAA", + "\x9B\x6D"=>"\xE5\xAC\xB6", + "\x9B\x6E"=>"\xE5\xAC\xBE", + "\x9B\x6F"=>"\xE5\xAD\x83", + "\x9B\x70"=>"\xE5\xAD\x85", + "\x9B\x71"=>"\xE5\xAD\x80", + "\x9B\x72"=>"\xE5\xAD\x91", + "\x9B\x73"=>"\xE5\xAD\x95", + "\x9B\x74"=>"\xE5\xAD\x9A", + "\x9B\x75"=>"\xE5\xAD\x9B", + "\x9B\x76"=>"\xE5\xAD\xA5", + "\x9B\x77"=>"\xE5\xAD\xA9", + "\x9B\x78"=>"\xE5\xAD\xB0", + "\x9B\x79"=>"\xE5\xAD\xB3", + "\x9B\x7A"=>"\xE5\xAD\xB5", + "\x9B\x7B"=>"\xE5\xAD\xB8", + "\x9B\x7C"=>"\xE6\x96\x88", + "\x9B\x7D"=>"\xE5\xAD\xBA", + "\x9B\x7E"=>"\xE5\xAE\x80", + "\x9B\x80"=>"\xE5\xAE\x83", + "\x9B\x81"=>"\xE5\xAE\xA6", + "\x9B\x82"=>"\xE5\xAE\xB8", + "\x9B\x83"=>"\xE5\xAF\x83", + "\x9B\x84"=>"\xE5\xAF\x87", + "\x9B\x85"=>"\xE5\xAF\x89", + "\x9B\x86"=>"\xE5\xAF\x94", + "\x9B\x87"=>"\xE5\xAF\x90", + "\x9B\x88"=>"\xE5\xAF\xA4", + "\x9B\x89"=>"\xE5\xAF\xA6", + "\x9B\x8A"=>"\xE5\xAF\xA2", + "\x9B\x8B"=>"\xE5\xAF\x9E", + "\x9B\x8C"=>"\xE5\xAF\xA5", + "\x9B\x8D"=>"\xE5\xAF\xAB", + "\x9B\x8E"=>"\xE5\xAF\xB0", + "\x9B\x8F"=>"\xE5\xAF\xB6", + "\x9B\x90"=>"\xE5\xAF\xB3", + "\x9B\x91"=>"\xE5\xB0\x85", + "\x9B\x92"=>"\xE5\xB0\x87", + "\x9B\x93"=>"\xE5\xB0\x88", + "\x9B\x94"=>"\xE5\xB0\x8D", + "\x9B\x95"=>"\xE5\xB0\x93", + "\x9B\x96"=>"\xE5\xB0\xA0", + "\x9B\x97"=>"\xE5\xB0\xA2", + "\x9B\x98"=>"\xE5\xB0\xA8", + "\x9B\x99"=>"\xE5\xB0\xB8", + "\x9B\x9A"=>"\xE5\xB0\xB9", + "\x9B\x9B"=>"\xE5\xB1\x81", + "\x9B\x9C"=>"\xE5\xB1\x86", + "\x9B\x9D"=>"\xE5\xB1\x8E", + "\x9B\x9E"=>"\xE5\xB1\x93", + "\x9B\x9F"=>"\xE5\xB1\x90", + "\x9B\xA0"=>"\xE5\xB1\x8F", + "\x9B\xA1"=>"\xE5\xAD\xB1", + "\x9B\xA2"=>"\xE5\xB1\xAC", + "\x9B\xA3"=>"\xE5\xB1\xAE", + "\x9B\xA4"=>"\xE4\xB9\xA2", + "\x9B\xA5"=>"\xE5\xB1\xB6", + "\x9B\xA6"=>"\xE5\xB1\xB9", + "\x9B\xA7"=>"\xE5\xB2\x8C", + "\x9B\xA8"=>"\xE5\xB2\x91", + "\x9B\xA9"=>"\xE5\xB2\x94", + "\x9B\xAA"=>"\xE5\xA6\x9B", + "\x9B\xAB"=>"\xE5\xB2\xAB", + "\x9B\xAC"=>"\xE5\xB2\xBB", + "\x9B\xAD"=>"\xE5\xB2\xB6", + "\x9B\xAE"=>"\xE5\xB2\xBC", + "\x9B\xAF"=>"\xE5\xB2\xB7", + "\x9B\xB0"=>"\xE5\xB3\x85", + "\x9B\xB1"=>"\xE5\xB2\xBE", + "\x9B\xB2"=>"\xE5\xB3\x87", + "\x9B\xB3"=>"\xE5\xB3\x99", + "\x9B\xB4"=>"\xE5\xB3\xA9", + "\x9B\xB5"=>"\xE5\xB3\xBD", + "\x9B\xB6"=>"\xE5\xB3\xBA", + "\x9B\xB7"=>"\xE5\xB3\xAD", + "\x9B\xB8"=>"\xE5\xB6\x8C", + "\x9B\xB9"=>"\xE5\xB3\xAA", + "\x9B\xBA"=>"\xE5\xB4\x8B", + "\x9B\xBB"=>"\xE5\xB4\x95", + "\x9B\xBC"=>"\xE5\xB4\x97", + "\x9B\xBD"=>"\xE5\xB5\x9C", + "\x9B\xBE"=>"\xE5\xB4\x9F", + "\x9B\xBF"=>"\xE5\xB4\x9B", + "\x9B\xC0"=>"\xE5\xB4\x91", + "\x9B\xC1"=>"\xE5\xB4\x94", + "\x9B\xC2"=>"\xE5\xB4\xA2", + "\x9B\xC3"=>"\xE5\xB4\x9A", + "\x9B\xC4"=>"\xE5\xB4\x99", + "\x9B\xC5"=>"\xE5\xB4\x98", + "\x9B\xC6"=>"\xE5\xB5\x8C", + "\x9B\xC7"=>"\xE5\xB5\x92", + "\x9B\xC8"=>"\xE5\xB5\x8E", + "\x9B\xC9"=>"\xE5\xB5\x8B", + "\x9B\xCA"=>"\xE5\xB5\xAC", + "\x9B\xCB"=>"\xE5\xB5\xB3", + "\x9B\xCC"=>"\xE5\xB5\xB6", + "\x9B\xCD"=>"\xE5\xB6\x87", + "\x9B\xCE"=>"\xE5\xB6\x84", + "\x9B\xCF"=>"\xE5\xB6\x82", + "\x9B\xD0"=>"\xE5\xB6\xA2", + "\x9B\xD1"=>"\xE5\xB6\x9D", + "\x9B\xD2"=>"\xE5\xB6\xAC", + "\x9B\xD3"=>"\xE5\xB6\xAE", + "\x9B\xD4"=>"\xE5\xB6\xBD", + "\x9B\xD5"=>"\xE5\xB6\x90", + "\x9B\xD6"=>"\xE5\xB6\xB7", + "\x9B\xD7"=>"\xE5\xB6\xBC", + "\x9B\xD8"=>"\xE5\xB7\x89", + "\x9B\xD9"=>"\xE5\xB7\x8D", + "\x9B\xDA"=>"\xE5\xB7\x93", + "\x9B\xDB"=>"\xE5\xB7\x92", + "\x9B\xDC"=>"\xE5\xB7\x96", + "\x9B\xDD"=>"\xE5\xB7\x9B", + "\x9B\xDE"=>"\xE5\xB7\xAB", + "\x9B\xDF"=>"\xE5\xB7\xB2", + "\x9B\xE0"=>"\xE5\xB7\xB5", + "\x9B\xE1"=>"\xE5\xB8\x8B", + "\x9B\xE2"=>"\xE5\xB8\x9A", + "\x9B\xE3"=>"\xE5\xB8\x99", + "\x9B\xE4"=>"\xE5\xB8\x91", + "\x9B\xE5"=>"\xE5\xB8\x9B", + "\x9B\xE6"=>"\xE5\xB8\xB6", + "\x9B\xE7"=>"\xE5\xB8\xB7", + "\x9B\xE8"=>"\xE5\xB9\x84", + "\x9B\xE9"=>"\xE5\xB9\x83", + "\x9B\xEA"=>"\xE5\xB9\x80", + "\x9B\xEB"=>"\xE5\xB9\x8E", + "\x9B\xEC"=>"\xE5\xB9\x97", + "\x9B\xED"=>"\xE5\xB9\x94", + "\x9B\xEE"=>"\xE5\xB9\x9F", + "\x9B\xEF"=>"\xE5\xB9\xA2", + "\x9B\xF0"=>"\xE5\xB9\xA4", + "\x9B\xF1"=>"\xE5\xB9\x87", + "\x9B\xF2"=>"\xE5\xB9\xB5", + "\x9B\xF3"=>"\xE5\xB9\xB6", + "\x9B\xF4"=>"\xE5\xB9\xBA", + "\x9B\xF5"=>"\xE9\xBA\xBC", + "\x9B\xF6"=>"\xE5\xB9\xBF", + "\x9B\xF7"=>"\xE5\xBA\xA0", + "\x9B\xF8"=>"\xE5\xBB\x81", + "\x9B\xF9"=>"\xE5\xBB\x82", + "\x9B\xFA"=>"\xE5\xBB\x88", + "\x9B\xFB"=>"\xE5\xBB\x90", + "\x9B\xFC"=>"\xE5\xBB\x8F", + "\x9C\x40"=>"\xE5\xBB\x96", + "\x9C\x41"=>"\xE5\xBB\xA3", + "\x9C\x42"=>"\xE5\xBB\x9D", + "\x9C\x43"=>"\xE5\xBB\x9A", + "\x9C\x44"=>"\xE5\xBB\x9B", + "\x9C\x45"=>"\xE5\xBB\xA2", + "\x9C\x46"=>"\xE5\xBB\xA1", + "\x9C\x47"=>"\xE5\xBB\xA8", + "\x9C\x48"=>"\xE5\xBB\xA9", + "\x9C\x49"=>"\xE5\xBB\xAC", + "\x9C\x4A"=>"\xE5\xBB\xB1", + "\x9C\x4B"=>"\xE5\xBB\xB3", + "\x9C\x4C"=>"\xE5\xBB\xB0", + "\x9C\x4D"=>"\xE5\xBB\xB4", + "\x9C\x4E"=>"\xE5\xBB\xB8", + "\x9C\x4F"=>"\xE5\xBB\xBE", + "\x9C\x50"=>"\xE5\xBC\x83", + "\x9C\x51"=>"\xE5\xBC\x89", + "\x9C\x52"=>"\xE5\xBD\x9D", + "\x9C\x53"=>"\xE5\xBD\x9C", + "\x9C\x54"=>"\xE5\xBC\x8B", + "\x9C\x55"=>"\xE5\xBC\x91", + "\x9C\x56"=>"\xE5\xBC\x96", + "\x9C\x57"=>"\xE5\xBC\xA9", + "\x9C\x58"=>"\xE5\xBC\xAD", + "\x9C\x59"=>"\xE5\xBC\xB8", + "\x9C\x5A"=>"\xE5\xBD\x81", + "\x9C\x5B"=>"\xE5\xBD\x88", + "\x9C\x5C"=>"\xE5\xBD\x8C", + "\x9C\x5D"=>"\xE5\xBD\x8E", + "\x9C\x5E"=>"\xE5\xBC\xAF", + "\x9C\x5F"=>"\xE5\xBD\x91", + "\x9C\x60"=>"\xE5\xBD\x96", + "\x9C\x61"=>"\xE5\xBD\x97", + "\x9C\x62"=>"\xE5\xBD\x99", + "\x9C\x63"=>"\xE5\xBD\xA1", + "\x9C\x64"=>"\xE5\xBD\xAD", + "\x9C\x65"=>"\xE5\xBD\xB3", + "\x9C\x66"=>"\xE5\xBD\xB7", + "\x9C\x67"=>"\xE5\xBE\x83", + "\x9C\x68"=>"\xE5\xBE\x82", + "\x9C\x69"=>"\xE5\xBD\xBF", + "\x9C\x6A"=>"\xE5\xBE\x8A", + "\x9C\x6B"=>"\xE5\xBE\x88", + "\x9C\x6C"=>"\xE5\xBE\x91", + "\x9C\x6D"=>"\xE5\xBE\x87", + "\x9C\x6E"=>"\xE5\xBE\x9E", + "\x9C\x6F"=>"\xE5\xBE\x99", + "\x9C\x70"=>"\xE5\xBE\x98", + "\x9C\x71"=>"\xE5\xBE\xA0", + "\x9C\x72"=>"\xE5\xBE\xA8", + "\x9C\x73"=>"\xE5\xBE\xAD", + "\x9C\x74"=>"\xE5\xBE\xBC", + "\x9C\x75"=>"\xE5\xBF\x96", + "\x9C\x76"=>"\xE5\xBF\xBB", + "\x9C\x77"=>"\xE5\xBF\xA4", + "\x9C\x78"=>"\xE5\xBF\xB8", + "\x9C\x79"=>"\xE5\xBF\xB1", + "\x9C\x7A"=>"\xE5\xBF\x9D", + "\x9C\x7B"=>"\xE6\x82\xB3", + "\x9C\x7C"=>"\xE5\xBF\xBF", + "\x9C\x7D"=>"\xE6\x80\xA1", + "\x9C\x7E"=>"\xE6\x81\xA0", + "\x9C\x80"=>"\xE6\x80\x99", + "\x9C\x81"=>"\xE6\x80\x90", + "\x9C\x82"=>"\xE6\x80\xA9", + "\x9C\x83"=>"\xE6\x80\x8E", + "\x9C\x84"=>"\xE6\x80\xB1", + "\x9C\x85"=>"\xE6\x80\x9B", + "\x9C\x86"=>"\xE6\x80\x95", + "\x9C\x87"=>"\xE6\x80\xAB", + "\x9C\x88"=>"\xE6\x80\xA6", + "\x9C\x89"=>"\xE6\x80\x8F", + "\x9C\x8A"=>"\xE6\x80\xBA", + "\x9C\x8B"=>"\xE6\x81\x9A", + "\x9C\x8C"=>"\xE6\x81\x81", + "\x9C\x8D"=>"\xE6\x81\xAA", + "\x9C\x8E"=>"\xE6\x81\xB7", + "\x9C\x8F"=>"\xE6\x81\x9F", + "\x9C\x90"=>"\xE6\x81\x8A", + "\x9C\x91"=>"\xE6\x81\x86", + "\x9C\x92"=>"\xE6\x81\x8D", + "\x9C\x93"=>"\xE6\x81\xA3", + "\x9C\x94"=>"\xE6\x81\x83", + "\x9C\x95"=>"\xE6\x81\xA4", + "\x9C\x96"=>"\xE6\x81\x82", + "\x9C\x97"=>"\xE6\x81\xAC", + "\x9C\x98"=>"\xE6\x81\xAB", + "\x9C\x99"=>"\xE6\x81\x99", + "\x9C\x9A"=>"\xE6\x82\x81", + "\x9C\x9B"=>"\xE6\x82\x8D", + "\x9C\x9C"=>"\xE6\x83\xA7", + "\x9C\x9D"=>"\xE6\x82\x83", + "\x9C\x9E"=>"\xE6\x82\x9A", + "\x9C\x9F"=>"\xE6\x82\x84", + "\x9C\xA0"=>"\xE6\x82\x9B", + "\x9C\xA1"=>"\xE6\x82\x96", + "\x9C\xA2"=>"\xE6\x82\x97", + "\x9C\xA3"=>"\xE6\x82\x92", + "\x9C\xA4"=>"\xE6\x82\xA7", + "\x9C\xA5"=>"\xE6\x82\x8B", + "\x9C\xA6"=>"\xE6\x83\xA1", + "\x9C\xA7"=>"\xE6\x82\xB8", + "\x9C\xA8"=>"\xE6\x83\xA0", + "\x9C\xA9"=>"\xE6\x83\x93", + "\x9C\xAA"=>"\xE6\x82\xB4", + "\x9C\xAB"=>"\xE5\xBF\xB0", + "\x9C\xAC"=>"\xE6\x82\xBD", + "\x9C\xAD"=>"\xE6\x83\x86", + "\x9C\xAE"=>"\xE6\x82\xB5", + "\x9C\xAF"=>"\xE6\x83\x98", + "\x9C\xB0"=>"\xE6\x85\x8D", + "\x9C\xB1"=>"\xE6\x84\x95", + "\x9C\xB2"=>"\xE6\x84\x86", + "\x9C\xB3"=>"\xE6\x83\xB6", + "\x9C\xB4"=>"\xE6\x83\xB7", + "\x9C\xB5"=>"\xE6\x84\x80", + "\x9C\xB6"=>"\xE6\x83\xB4", + "\x9C\xB7"=>"\xE6\x83\xBA", + "\x9C\xB8"=>"\xE6\x84\x83", + "\x9C\xB9"=>"\xE6\x84\xA1", + "\x9C\xBA"=>"\xE6\x83\xBB", + "\x9C\xBB"=>"\xE6\x83\xB1", + "\x9C\xBC"=>"\xE6\x84\x8D", + "\x9C\xBD"=>"\xE6\x84\x8E", + "\x9C\xBE"=>"\xE6\x85\x87", + "\x9C\xBF"=>"\xE6\x84\xBE", + "\x9C\xC0"=>"\xE6\x84\xA8", + "\x9C\xC1"=>"\xE6\x84\xA7", + "\x9C\xC2"=>"\xE6\x85\x8A", + "\x9C\xC3"=>"\xE6\x84\xBF", + "\x9C\xC4"=>"\xE6\x84\xBC", + "\x9C\xC5"=>"\xE6\x84\xAC", + "\x9C\xC6"=>"\xE6\x84\xB4", + "\x9C\xC7"=>"\xE6\x84\xBD", + "\x9C\xC8"=>"\xE6\x85\x82", + "\x9C\xC9"=>"\xE6\x85\x84", + "\x9C\xCA"=>"\xE6\x85\xB3", + "\x9C\xCB"=>"\xE6\x85\xB7", + "\x9C\xCC"=>"\xE6\x85\x98", + "\x9C\xCD"=>"\xE6\x85\x99", + "\x9C\xCE"=>"\xE6\x85\x9A", + "\x9C\xCF"=>"\xE6\x85\xAB", + "\x9C\xD0"=>"\xE6\x85\xB4", + "\x9C\xD1"=>"\xE6\x85\xAF", + "\x9C\xD2"=>"\xE6\x85\xA5", + "\x9C\xD3"=>"\xE6\x85\xB1", + "\x9C\xD4"=>"\xE6\x85\x9F", + "\x9C\xD5"=>"\xE6\x85\x9D", + "\x9C\xD6"=>"\xE6\x85\x93", + "\x9C\xD7"=>"\xE6\x85\xB5", + "\x9C\xD8"=>"\xE6\x86\x99", + "\x9C\xD9"=>"\xE6\x86\x96", + "\x9C\xDA"=>"\xE6\x86\x87", + "\x9C\xDB"=>"\xE6\x86\xAC", + "\x9C\xDC"=>"\xE6\x86\x94", + "\x9C\xDD"=>"\xE6\x86\x9A", + "\x9C\xDE"=>"\xE6\x86\x8A", + "\x9C\xDF"=>"\xE6\x86\x91", + "\x9C\xE0"=>"\xE6\x86\xAB", + "\x9C\xE1"=>"\xE6\x86\xAE", + "\x9C\xE2"=>"\xE6\x87\x8C", + "\x9C\xE3"=>"\xE6\x87\x8A", + "\x9C\xE4"=>"\xE6\x87\x89", + "\x9C\xE5"=>"\xE6\x87\xB7", + "\x9C\xE6"=>"\xE6\x87\x88", + "\x9C\xE7"=>"\xE6\x87\x83", + "\x9C\xE8"=>"\xE6\x87\x86", + "\x9C\xE9"=>"\xE6\x86\xBA", + "\x9C\xEA"=>"\xE6\x87\x8B", + "\x9C\xEB"=>"\xE7\xBD\xB9", + "\x9C\xEC"=>"\xE6\x87\x8D", + "\x9C\xED"=>"\xE6\x87\xA6", + "\x9C\xEE"=>"\xE6\x87\xA3", + "\x9C\xEF"=>"\xE6\x87\xB6", + "\x9C\xF0"=>"\xE6\x87\xBA", + "\x9C\xF1"=>"\xE6\x87\xB4", + "\x9C\xF2"=>"\xE6\x87\xBF", + "\x9C\xF3"=>"\xE6\x87\xBD", + "\x9C\xF4"=>"\xE6\x87\xBC", + "\x9C\xF5"=>"\xE6\x87\xBE", + "\x9C\xF6"=>"\xE6\x88\x80", + "\x9C\xF7"=>"\xE6\x88\x88", + "\x9C\xF8"=>"\xE6\x88\x89", + "\x9C\xF9"=>"\xE6\x88\x8D", + "\x9C\xFA"=>"\xE6\x88\x8C", + "\x9C\xFB"=>"\xE6\x88\x94", + "\x9C\xFC"=>"\xE6\x88\x9B", + "\x9D\x40"=>"\xE6\x88\x9E", + "\x9D\x41"=>"\xE6\x88\xA1", + "\x9D\x42"=>"\xE6\x88\xAA", + "\x9D\x43"=>"\xE6\x88\xAE", + "\x9D\x44"=>"\xE6\x88\xB0", + "\x9D\x45"=>"\xE6\x88\xB2", + "\x9D\x46"=>"\xE6\x88\xB3", + "\x9D\x47"=>"\xE6\x89\x81", + "\x9D\x48"=>"\xE6\x89\x8E", + "\x9D\x49"=>"\xE6\x89\x9E", + "\x9D\x4A"=>"\xE6\x89\xA3", + "\x9D\x4B"=>"\xE6\x89\x9B", + "\x9D\x4C"=>"\xE6\x89\xA0", + "\x9D\x4D"=>"\xE6\x89\xA8", + "\x9D\x4E"=>"\xE6\x89\xBC", + "\x9D\x4F"=>"\xE6\x8A\x82", + "\x9D\x50"=>"\xE6\x8A\x89", + "\x9D\x51"=>"\xE6\x89\xBE", + "\x9D\x52"=>"\xE6\x8A\x92", + "\x9D\x53"=>"\xE6\x8A\x93", + "\x9D\x54"=>"\xE6\x8A\x96", + "\x9D\x55"=>"\xE6\x8B\x94", + "\x9D\x56"=>"\xE6\x8A\x83", + "\x9D\x57"=>"\xE6\x8A\x94", + "\x9D\x58"=>"\xE6\x8B\x97", + "\x9D\x59"=>"\xE6\x8B\x91", + "\x9D\x5A"=>"\xE6\x8A\xBB", + "\x9D\x5B"=>"\xE6\x8B\x8F", + "\x9D\x5C"=>"\xE6\x8B\xBF", + "\x9D\x5D"=>"\xE6\x8B\x86", + "\x9D\x5E"=>"\xE6\x93\x94", + "\x9D\x5F"=>"\xE6\x8B\x88", + "\x9D\x60"=>"\xE6\x8B\x9C", + "\x9D\x61"=>"\xE6\x8B\x8C", + "\x9D\x62"=>"\xE6\x8B\x8A", + "\x9D\x63"=>"\xE6\x8B\x82", + "\x9D\x64"=>"\xE6\x8B\x87", + "\x9D\x65"=>"\xE6\x8A\x9B", + "\x9D\x66"=>"\xE6\x8B\x89", + "\x9D\x67"=>"\xE6\x8C\x8C", + "\x9D\x68"=>"\xE6\x8B\xAE", + "\x9D\x69"=>"\xE6\x8B\xB1", + "\x9D\x6A"=>"\xE6\x8C\xA7", + "\x9D\x6B"=>"\xE6\x8C\x82", + "\x9D\x6C"=>"\xE6\x8C\x88", + "\x9D\x6D"=>"\xE6\x8B\xAF", + "\x9D\x6E"=>"\xE6\x8B\xB5", + "\x9D\x6F"=>"\xE6\x8D\x90", + "\x9D\x70"=>"\xE6\x8C\xBE", + "\x9D\x71"=>"\xE6\x8D\x8D", + "\x9D\x72"=>"\xE6\x90\x9C", + "\x9D\x73"=>"\xE6\x8D\x8F", + "\x9D\x74"=>"\xE6\x8E\x96", + "\x9D\x75"=>"\xE6\x8E\x8E", + "\x9D\x76"=>"\xE6\x8E\x80", + "\x9D\x77"=>"\xE6\x8E\xAB", + "\x9D\x78"=>"\xE6\x8D\xB6", + "\x9D\x79"=>"\xE6\x8E\xA3", + "\x9D\x7A"=>"\xE6\x8E\x8F", + "\x9D\x7B"=>"\xE6\x8E\x89", + "\x9D\x7C"=>"\xE6\x8E\x9F", + "\x9D\x7D"=>"\xE6\x8E\xB5", + "\x9D\x7E"=>"\xE6\x8D\xAB", + "\x9D\x80"=>"\xE6\x8D\xA9", + "\x9D\x81"=>"\xE6\x8E\xBE", + "\x9D\x82"=>"\xE6\x8F\xA9", + "\x9D\x83"=>"\xE6\x8F\x80", + "\x9D\x84"=>"\xE6\x8F\x86", + "\x9D\x85"=>"\xE6\x8F\xA3", + "\x9D\x86"=>"\xE6\x8F\x89", + "\x9D\x87"=>"\xE6\x8F\x92", + "\x9D\x88"=>"\xE6\x8F\xB6", + "\x9D\x89"=>"\xE6\x8F\x84", + "\x9D\x8A"=>"\xE6\x90\x96", + "\x9D\x8B"=>"\xE6\x90\xB4", + "\x9D\x8C"=>"\xE6\x90\x86", + "\x9D\x8D"=>"\xE6\x90\x93", + "\x9D\x8E"=>"\xE6\x90\xA6", + "\x9D\x8F"=>"\xE6\x90\xB6", + "\x9D\x90"=>"\xE6\x94\x9D", + "\x9D\x91"=>"\xE6\x90\x97", + "\x9D\x92"=>"\xE6\x90\xA8", + "\x9D\x93"=>"\xE6\x90\x8F", + "\x9D\x94"=>"\xE6\x91\xA7", + "\x9D\x95"=>"\xE6\x91\xAF", + "\x9D\x96"=>"\xE6\x91\xB6", + "\x9D\x97"=>"\xE6\x91\x8E", + "\x9D\x98"=>"\xE6\x94\xAA", + "\x9D\x99"=>"\xE6\x92\x95", + "\x9D\x9A"=>"\xE6\x92\x93", + "\x9D\x9B"=>"\xE6\x92\xA5", + "\x9D\x9C"=>"\xE6\x92\xA9", + "\x9D\x9D"=>"\xE6\x92\x88", + "\x9D\x9E"=>"\xE6\x92\xBC", + "\x9D\x9F"=>"\xE6\x93\x9A", + "\x9D\xA0"=>"\xE6\x93\x92", + "\x9D\xA1"=>"\xE6\x93\x85", + "\x9D\xA2"=>"\xE6\x93\x87", + "\x9D\xA3"=>"\xE6\x92\xBB", + "\x9D\xA4"=>"\xE6\x93\x98", + "\x9D\xA5"=>"\xE6\x93\x82", + "\x9D\xA6"=>"\xE6\x93\xB1", + "\x9D\xA7"=>"\xE6\x93\xA7", + "\x9D\xA8"=>"\xE8\x88\x89", + "\x9D\xA9"=>"\xE6\x93\xA0", + "\x9D\xAA"=>"\xE6\x93\xA1", + "\x9D\xAB"=>"\xE6\x8A\xAC", + "\x9D\xAC"=>"\xE6\x93\xA3", + "\x9D\xAD"=>"\xE6\x93\xAF", + "\x9D\xAE"=>"\xE6\x94\xAC", + "\x9D\xAF"=>"\xE6\x93\xB6", + "\x9D\xB0"=>"\xE6\x93\xB4", + "\x9D\xB1"=>"\xE6\x93\xB2", + "\x9D\xB2"=>"\xE6\x93\xBA", + "\x9D\xB3"=>"\xE6\x94\x80", + "\x9D\xB4"=>"\xE6\x93\xBD", + "\x9D\xB5"=>"\xE6\x94\x98", + "\x9D\xB6"=>"\xE6\x94\x9C", + "\x9D\xB7"=>"\xE6\x94\x85", + "\x9D\xB8"=>"\xE6\x94\xA4", + "\x9D\xB9"=>"\xE6\x94\xA3", + "\x9D\xBA"=>"\xE6\x94\xAB", + "\x9D\xBB"=>"\xE6\x94\xB4", + "\x9D\xBC"=>"\xE6\x94\xB5", + "\x9D\xBD"=>"\xE6\x94\xB7", + "\x9D\xBE"=>"\xE6\x94\xB6", + "\x9D\xBF"=>"\xE6\x94\xB8", + "\x9D\xC0"=>"\xE7\x95\x8B", + "\x9D\xC1"=>"\xE6\x95\x88", + "\x9D\xC2"=>"\xE6\x95\x96", + "\x9D\xC3"=>"\xE6\x95\x95", + "\x9D\xC4"=>"\xE6\x95\x8D", + "\x9D\xC5"=>"\xE6\x95\x98", + "\x9D\xC6"=>"\xE6\x95\x9E", + "\x9D\xC7"=>"\xE6\x95\x9D", + "\x9D\xC8"=>"\xE6\x95\xB2", + "\x9D\xC9"=>"\xE6\x95\xB8", + "\x9D\xCA"=>"\xE6\x96\x82", + "\x9D\xCB"=>"\xE6\x96\x83", + "\x9D\xCC"=>"\xE8\xAE\x8A", + "\x9D\xCD"=>"\xE6\x96\x9B", + "\x9D\xCE"=>"\xE6\x96\x9F", + "\x9D\xCF"=>"\xE6\x96\xAB", + "\x9D\xD0"=>"\xE6\x96\xB7", + "\x9D\xD1"=>"\xE6\x97\x83", + "\x9D\xD2"=>"\xE6\x97\x86", + "\x9D\xD3"=>"\xE6\x97\x81", + "\x9D\xD4"=>"\xE6\x97\x84", + "\x9D\xD5"=>"\xE6\x97\x8C", + "\x9D\xD6"=>"\xE6\x97\x92", + "\x9D\xD7"=>"\xE6\x97\x9B", + "\x9D\xD8"=>"\xE6\x97\x99", + "\x9D\xD9"=>"\xE6\x97\xA0", + "\x9D\xDA"=>"\xE6\x97\xA1", + "\x9D\xDB"=>"\xE6\x97\xB1", + "\x9D\xDC"=>"\xE6\x9D\xB2", + "\x9D\xDD"=>"\xE6\x98\x8A", + "\x9D\xDE"=>"\xE6\x98\x83", + "\x9D\xDF"=>"\xE6\x97\xBB", + "\x9D\xE0"=>"\xE6\x9D\xB3", + "\x9D\xE1"=>"\xE6\x98\xB5", + "\x9D\xE2"=>"\xE6\x98\xB6", + "\x9D\xE3"=>"\xE6\x98\xB4", + "\x9D\xE4"=>"\xE6\x98\x9C", + "\x9D\xE5"=>"\xE6\x99\x8F", + "\x9D\xE6"=>"\xE6\x99\x84", + "\x9D\xE7"=>"\xE6\x99\x89", + "\x9D\xE8"=>"\xE6\x99\x81", + "\x9D\xE9"=>"\xE6\x99\x9E", + "\x9D\xEA"=>"\xE6\x99\x9D", + "\x9D\xEB"=>"\xE6\x99\xA4", + "\x9D\xEC"=>"\xE6\x99\xA7", + "\x9D\xED"=>"\xE6\x99\xA8", + "\x9D\xEE"=>"\xE6\x99\x9F", + "\x9D\xEF"=>"\xE6\x99\xA2", + "\x9D\xF0"=>"\xE6\x99\xB0", + "\x9D\xF1"=>"\xE6\x9A\x83", + "\x9D\xF2"=>"\xE6\x9A\x88", + "\x9D\xF3"=>"\xE6\x9A\x8E", + "\x9D\xF4"=>"\xE6\x9A\x89", + "\x9D\xF5"=>"\xE6\x9A\x84", + "\x9D\xF6"=>"\xE6\x9A\x98", + "\x9D\xF7"=>"\xE6\x9A\x9D", + "\x9D\xF8"=>"\xE6\x9B\x81", + "\x9D\xF9"=>"\xE6\x9A\xB9", + "\x9D\xFA"=>"\xE6\x9B\x89", + "\x9D\xFB"=>"\xE6\x9A\xBE", + "\x9D\xFC"=>"\xE6\x9A\xBC", + "\x9E\x40"=>"\xE6\x9B\x84", + "\x9E\x41"=>"\xE6\x9A\xB8", + "\x9E\x42"=>"\xE6\x9B\x96", + "\x9E\x43"=>"\xE6\x9B\x9A", + "\x9E\x44"=>"\xE6\x9B\xA0", + "\x9E\x45"=>"\xE6\x98\xBF", + "\x9E\x46"=>"\xE6\x9B\xA6", + "\x9E\x47"=>"\xE6\x9B\xA9", + "\x9E\x48"=>"\xE6\x9B\xB0", + "\x9E\x49"=>"\xE6\x9B\xB5", + "\x9E\x4A"=>"\xE6\x9B\xB7", + "\x9E\x4B"=>"\xE6\x9C\x8F", + "\x9E\x4C"=>"\xE6\x9C\x96", + "\x9E\x4D"=>"\xE6\x9C\x9E", + "\x9E\x4E"=>"\xE6\x9C\xA6", + "\x9E\x4F"=>"\xE6\x9C\xA7", + "\x9E\x50"=>"\xE9\x9C\xB8", + "\x9E\x51"=>"\xE6\x9C\xAE", + "\x9E\x52"=>"\xE6\x9C\xBF", + "\x9E\x53"=>"\xE6\x9C\xB6", + "\x9E\x54"=>"\xE6\x9D\x81", + "\x9E\x55"=>"\xE6\x9C\xB8", + "\x9E\x56"=>"\xE6\x9C\xB7", + "\x9E\x57"=>"\xE6\x9D\x86", + "\x9E\x58"=>"\xE6\x9D\x9E", + "\x9E\x59"=>"\xE6\x9D\xA0", + "\x9E\x5A"=>"\xE6\x9D\x99", + "\x9E\x5B"=>"\xE6\x9D\xA3", + "\x9E\x5C"=>"\xE6\x9D\xA4", + "\x9E\x5D"=>"\xE6\x9E\x89", + "\x9E\x5E"=>"\xE6\x9D\xB0", + "\x9E\x5F"=>"\xE6\x9E\xA9", + "\x9E\x60"=>"\xE6\x9D\xBC", + "\x9E\x61"=>"\xE6\x9D\xAA", + "\x9E\x62"=>"\xE6\x9E\x8C", + "\x9E\x63"=>"\xE6\x9E\x8B", + "\x9E\x64"=>"\xE6\x9E\xA6", + "\x9E\x65"=>"\xE6\x9E\xA1", + "\x9E\x66"=>"\xE6\x9E\x85", + "\x9E\x67"=>"\xE6\x9E\xB7", + "\x9E\x68"=>"\xE6\x9F\xAF", + "\x9E\x69"=>"\xE6\x9E\xB4", + "\x9E\x6A"=>"\xE6\x9F\xAC", + "\x9E\x6B"=>"\xE6\x9E\xB3", + "\x9E\x6C"=>"\xE6\x9F\xA9", + "\x9E\x6D"=>"\xE6\x9E\xB8", + "\x9E\x6E"=>"\xE6\x9F\xA4", + "\x9E\x6F"=>"\xE6\x9F\x9E", + "\x9E\x70"=>"\xE6\x9F\x9D", + "\x9E\x71"=>"\xE6\x9F\xA2", + "\x9E\x72"=>"\xE6\x9F\xAE", + "\x9E\x73"=>"\xE6\x9E\xB9", + "\x9E\x74"=>"\xE6\x9F\x8E", + "\x9E\x75"=>"\xE6\x9F\x86", + "\x9E\x76"=>"\xE6\x9F\xA7", + "\x9E\x77"=>"\xE6\xAA\x9C", + "\x9E\x78"=>"\xE6\xA0\x9E", + "\x9E\x79"=>"\xE6\xA1\x86", + "\x9E\x7A"=>"\xE6\xA0\xA9", + "\x9E\x7B"=>"\xE6\xA1\x80", + "\x9E\x7C"=>"\xE6\xA1\x8D", + "\x9E\x7D"=>"\xE6\xA0\xB2", + "\x9E\x7E"=>"\xE6\xA1\x8E", + "\x9E\x80"=>"\xE6\xA2\xB3", + "\x9E\x81"=>"\xE6\xA0\xAB", + "\x9E\x82"=>"\xE6\xA1\x99", + "\x9E\x83"=>"\xE6\xA1\xA3", + "\x9E\x84"=>"\xE6\xA1\xB7", + "\x9E\x85"=>"\xE6\xA1\xBF", + "\x9E\x86"=>"\xE6\xA2\x9F", + "\x9E\x87"=>"\xE6\xA2\x8F", + "\x9E\x88"=>"\xE6\xA2\xAD", + "\x9E\x89"=>"\xE6\xA2\x94", + "\x9E\x8A"=>"\xE6\xA2\x9D", + "\x9E\x8B"=>"\xE6\xA2\x9B", + "\x9E\x8C"=>"\xE6\xA2\x83", + "\x9E\x8D"=>"\xE6\xAA\xAE", + "\x9E\x8E"=>"\xE6\xA2\xB9", + "\x9E\x8F"=>"\xE6\xA1\xB4", + "\x9E\x90"=>"\xE6\xA2\xB5", + "\x9E\x91"=>"\xE6\xA2\xA0", + "\x9E\x92"=>"\xE6\xA2\xBA", + "\x9E\x93"=>"\xE6\xA4\x8F", + "\x9E\x94"=>"\xE6\xA2\x8D", + "\x9E\x95"=>"\xE6\xA1\xBE", + "\x9E\x96"=>"\xE6\xA4\x81", + "\x9E\x97"=>"\xE6\xA3\x8A", + "\x9E\x98"=>"\xE6\xA4\x88", + "\x9E\x99"=>"\xE6\xA3\x98", + "\x9E\x9A"=>"\xE6\xA4\xA2", + "\x9E\x9B"=>"\xE6\xA4\xA6", + "\x9E\x9C"=>"\xE6\xA3\xA1", + "\x9E\x9D"=>"\xE6\xA4\x8C", + "\x9E\x9E"=>"\xE6\xA3\x8D", + "\x9E\x9F"=>"\xE6\xA3\x94", + "\x9E\xA0"=>"\xE6\xA3\xA7", + "\x9E\xA1"=>"\xE6\xA3\x95", + "\x9E\xA2"=>"\xE6\xA4\xB6", + "\x9E\xA3"=>"\xE6\xA4\x92", + "\x9E\xA4"=>"\xE6\xA4\x84", + "\x9E\xA5"=>"\xE6\xA3\x97", + "\x9E\xA6"=>"\xE6\xA3\xA3", + "\x9E\xA7"=>"\xE6\xA4\xA5", + "\x9E\xA8"=>"\xE6\xA3\xB9", + "\x9E\xA9"=>"\xE6\xA3\xA0", + "\x9E\xAA"=>"\xE6\xA3\xAF", + "\x9E\xAB"=>"\xE6\xA4\xA8", + "\x9E\xAC"=>"\xE6\xA4\xAA", + "\x9E\xAD"=>"\xE6\xA4\x9A", + "\x9E\xAE"=>"\xE6\xA4\xA3", + "\x9E\xAF"=>"\xE6\xA4\xA1", + "\x9E\xB0"=>"\xE6\xA3\x86", + "\x9E\xB1"=>"\xE6\xA5\xB9", + "\x9E\xB2"=>"\xE6\xA5\xB7", + "\x9E\xB3"=>"\xE6\xA5\x9C", + "\x9E\xB4"=>"\xE6\xA5\xB8", + "\x9E\xB5"=>"\xE6\xA5\xAB", + "\x9E\xB6"=>"\xE6\xA5\x94", + "\x9E\xB7"=>"\xE6\xA5\xBE", + "\x9E\xB8"=>"\xE6\xA5\xAE", + "\x9E\xB9"=>"\xE6\xA4\xB9", + "\x9E\xBA"=>"\xE6\xA5\xB4", + "\x9E\xBB"=>"\xE6\xA4\xBD", + "\x9E\xBC"=>"\xE6\xA5\x99", + "\x9E\xBD"=>"\xE6\xA4\xB0", + "\x9E\xBE"=>"\xE6\xA5\xA1", + "\x9E\xBF"=>"\xE6\xA5\x9E", + "\x9E\xC0"=>"\xE6\xA5\x9D", + "\x9E\xC1"=>"\xE6\xA6\x81", + "\x9E\xC2"=>"\xE6\xA5\xAA", + "\x9E\xC3"=>"\xE6\xA6\xB2", + "\x9E\xC4"=>"\xE6\xA6\xAE", + "\x9E\xC5"=>"\xE6\xA7\x90", + "\x9E\xC6"=>"\xE6\xA6\xBF", + "\x9E\xC7"=>"\xE6\xA7\x81", + "\x9E\xC8"=>"\xE6\xA7\x93", + "\x9E\xC9"=>"\xE6\xA6\xBE", + "\x9E\xCA"=>"\xE6\xA7\x8E", + "\x9E\xCB"=>"\xE5\xAF\xA8", + "\x9E\xCC"=>"\xE6\xA7\x8A", + "\x9E\xCD"=>"\xE6\xA7\x9D", + "\x9E\xCE"=>"\xE6\xA6\xBB", + "\x9E\xCF"=>"\xE6\xA7\x83", + "\x9E\xD0"=>"\xE6\xA6\xA7", + "\x9E\xD1"=>"\xE6\xA8\xAE", + "\x9E\xD2"=>"\xE6\xA6\x91", + "\x9E\xD3"=>"\xE6\xA6\xA0", + "\x9E\xD4"=>"\xE6\xA6\x9C", + "\x9E\xD5"=>"\xE6\xA6\x95", + "\x9E\xD6"=>"\xE6\xA6\xB4", + "\x9E\xD7"=>"\xE6\xA7\x9E", + "\x9E\xD8"=>"\xE6\xA7\xA8", + "\x9E\xD9"=>"\xE6\xA8\x82", + "\x9E\xDA"=>"\xE6\xA8\x9B", + "\x9E\xDB"=>"\xE6\xA7\xBF", + "\x9E\xDC"=>"\xE6\xAC\x8A", + "\x9E\xDD"=>"\xE6\xA7\xB9", + "\x9E\xDE"=>"\xE6\xA7\xB2", + "\x9E\xDF"=>"\xE6\xA7\xA7", + "\x9E\xE0"=>"\xE6\xA8\x85", + "\x9E\xE1"=>"\xE6\xA6\xB1", + "\x9E\xE2"=>"\xE6\xA8\x9E", + "\x9E\xE3"=>"\xE6\xA7\xAD", + "\x9E\xE4"=>"\xE6\xA8\x94", + "\x9E\xE5"=>"\xE6\xA7\xAB", + "\x9E\xE6"=>"\xE6\xA8\x8A", + "\x9E\xE7"=>"\xE6\xA8\x92", + "\x9E\xE8"=>"\xE6\xAB\x81", + "\x9E\xE9"=>"\xE6\xA8\xA3", + "\x9E\xEA"=>"\xE6\xA8\x93", + "\x9E\xEB"=>"\xE6\xA9\x84", + "\x9E\xEC"=>"\xE6\xA8\x8C", + "\x9E\xED"=>"\xE6\xA9\xB2", + "\x9E\xEE"=>"\xE6\xA8\xB6", + "\x9E\xEF"=>"\xE6\xA9\xB8", + "\x9E\xF0"=>"\xE6\xA9\x87", + "\x9E\xF1"=>"\xE6\xA9\xA2", + "\x9E\xF2"=>"\xE6\xA9\x99", + "\x9E\xF3"=>"\xE6\xA9\xA6", + "\x9E\xF4"=>"\xE6\xA9\x88", + "\x9E\xF5"=>"\xE6\xA8\xB8", + "\x9E\xF6"=>"\xE6\xA8\xA2", + "\x9E\xF7"=>"\xE6\xAA\x90", + "\x9E\xF8"=>"\xE6\xAA\x8D", + "\x9E\xF9"=>"\xE6\xAA\xA0", + "\x9E\xFA"=>"\xE6\xAA\x84", + "\x9E\xFB"=>"\xE6\xAA\xA2", + "\x9E\xFC"=>"\xE6\xAA\xA3", + "\x9F\x40"=>"\xE6\xAA\x97", + "\x9F\x41"=>"\xE8\x98\x97", + "\x9F\x42"=>"\xE6\xAA\xBB", + "\x9F\x43"=>"\xE6\xAB\x83", + "\x9F\x44"=>"\xE6\xAB\x82", + "\x9F\x45"=>"\xE6\xAA\xB8", + "\x9F\x46"=>"\xE6\xAA\xB3", + "\x9F\x47"=>"\xE6\xAA\xAC", + "\x9F\x48"=>"\xE6\xAB\x9E", + "\x9F\x49"=>"\xE6\xAB\x91", + "\x9F\x4A"=>"\xE6\xAB\x9F", + "\x9F\x4B"=>"\xE6\xAA\xAA", + "\x9F\x4C"=>"\xE6\xAB\x9A", + "\x9F\x4D"=>"\xE6\xAB\xAA", + "\x9F\x4E"=>"\xE6\xAB\xBB", + "\x9F\x4F"=>"\xE6\xAC\x85", + "\x9F\x50"=>"\xE8\x98\x96", + "\x9F\x51"=>"\xE6\xAB\xBA", + "\x9F\x52"=>"\xE6\xAC\x92", + "\x9F\x53"=>"\xE6\xAC\x96", + "\x9F\x54"=>"\xE9\xAC\xB1", + "\x9F\x55"=>"\xE6\xAC\x9F", + "\x9F\x56"=>"\xE6\xAC\xB8", + "\x9F\x57"=>"\xE6\xAC\xB7", + "\x9F\x58"=>"\xE7\x9B\x9C", + "\x9F\x59"=>"\xE6\xAC\xB9", + "\x9F\x5A"=>"\xE9\xA3\xAE", + "\x9F\x5B"=>"\xE6\xAD\x87", + "\x9F\x5C"=>"\xE6\xAD\x83", + "\x9F\x5D"=>"\xE6\xAD\x89", + "\x9F\x5E"=>"\xE6\xAD\x90", + "\x9F\x5F"=>"\xE6\xAD\x99", + "\x9F\x60"=>"\xE6\xAD\x94", + "\x9F\x61"=>"\xE6\xAD\x9B", + "\x9F\x62"=>"\xE6\xAD\x9F", + "\x9F\x63"=>"\xE6\xAD\xA1", + "\x9F\x64"=>"\xE6\xAD\xB8", + "\x9F\x65"=>"\xE6\xAD\xB9", + "\x9F\x66"=>"\xE6\xAD\xBF", + "\x9F\x67"=>"\xE6\xAE\x80", + "\x9F\x68"=>"\xE6\xAE\x84", + "\x9F\x69"=>"\xE6\xAE\x83", + "\x9F\x6A"=>"\xE6\xAE\x8D", + "\x9F\x6B"=>"\xE6\xAE\x98", + "\x9F\x6C"=>"\xE6\xAE\x95", + "\x9F\x6D"=>"\xE6\xAE\x9E", + "\x9F\x6E"=>"\xE6\xAE\xA4", + "\x9F\x6F"=>"\xE6\xAE\xAA", + "\x9F\x70"=>"\xE6\xAE\xAB", + "\x9F\x71"=>"\xE6\xAE\xAF", + "\x9F\x72"=>"\xE6\xAE\xB2", + "\x9F\x73"=>"\xE6\xAE\xB1", + "\x9F\x74"=>"\xE6\xAE\xB3", + "\x9F\x75"=>"\xE6\xAE\xB7", + "\x9F\x76"=>"\xE6\xAE\xBC", + "\x9F\x77"=>"\xE6\xAF\x86", + "\x9F\x78"=>"\xE6\xAF\x8B", + "\x9F\x79"=>"\xE6\xAF\x93", + "\x9F\x7A"=>"\xE6\xAF\x9F", + "\x9F\x7B"=>"\xE6\xAF\xAC", + "\x9F\x7C"=>"\xE6\xAF\xAB", + "\x9F\x7D"=>"\xE6\xAF\xB3", + "\x9F\x7E"=>"\xE6\xAF\xAF", + "\x9F\x80"=>"\xE9\xBA\xBE", + "\x9F\x81"=>"\xE6\xB0\x88", + "\x9F\x82"=>"\xE6\xB0\x93", + "\x9F\x83"=>"\xE6\xB0\x94", + "\x9F\x84"=>"\xE6\xB0\x9B", + "\x9F\x85"=>"\xE6\xB0\xA4", + "\x9F\x86"=>"\xE6\xB0\xA3", + "\x9F\x87"=>"\xE6\xB1\x9E", + "\x9F\x88"=>"\xE6\xB1\x95", + "\x9F\x89"=>"\xE6\xB1\xA2", + "\x9F\x8A"=>"\xE6\xB1\xAA", + "\x9F\x8B"=>"\xE6\xB2\x82", + "\x9F\x8C"=>"\xE6\xB2\x8D", + "\x9F\x8D"=>"\xE6\xB2\x9A", + "\x9F\x8E"=>"\xE6\xB2\x81", + "\x9F\x8F"=>"\xE6\xB2\x9B", + "\x9F\x90"=>"\xE6\xB1\xBE", + "\x9F\x91"=>"\xE6\xB1\xA8", + "\x9F\x92"=>"\xE6\xB1\xB3", + "\x9F\x93"=>"\xE6\xB2\x92", + "\x9F\x94"=>"\xE6\xB2\x90", + "\x9F\x95"=>"\xE6\xB3\x84", + "\x9F\x96"=>"\xE6\xB3\xB1", + "\x9F\x97"=>"\xE6\xB3\x93", + "\x9F\x98"=>"\xE6\xB2\xBD", + "\x9F\x99"=>"\xE6\xB3\x97", + "\x9F\x9A"=>"\xE6\xB3\x85", + "\x9F\x9B"=>"\xE6\xB3\x9D", + "\x9F\x9C"=>"\xE6\xB2\xAE", + "\x9F\x9D"=>"\xE6\xB2\xB1", + "\x9F\x9E"=>"\xE6\xB2\xBE", + "\x9F\x9F"=>"\xE6\xB2\xBA", + "\x9F\xA0"=>"\xE6\xB3\x9B", + "\x9F\xA1"=>"\xE6\xB3\xAF", + "\x9F\xA2"=>"\xE6\xB3\x99", + "\x9F\xA3"=>"\xE6\xB3\xAA", + "\x9F\xA4"=>"\xE6\xB4\x9F", + "\x9F\xA5"=>"\xE8\xA1\x8D", + "\x9F\xA6"=>"\xE6\xB4\xB6", + "\x9F\xA7"=>"\xE6\xB4\xAB", + "\x9F\xA8"=>"\xE6\xB4\xBD", + "\x9F\xA9"=>"\xE6\xB4\xB8", + "\x9F\xAA"=>"\xE6\xB4\x99", + "\x9F\xAB"=>"\xE6\xB4\xB5", + "\x9F\xAC"=>"\xE6\xB4\xB3", + "\x9F\xAD"=>"\xE6\xB4\x92", + "\x9F\xAE"=>"\xE6\xB4\x8C", + "\x9F\xAF"=>"\xE6\xB5\xA3", + "\x9F\xB0"=>"\xE6\xB6\x93", + "\x9F\xB1"=>"\xE6\xB5\xA4", + "\x9F\xB2"=>"\xE6\xB5\x9A", + "\x9F\xB3"=>"\xE6\xB5\xB9", + "\x9F\xB4"=>"\xE6\xB5\x99", + "\x9F\xB5"=>"\xE6\xB6\x8E", + "\x9F\xB6"=>"\xE6\xB6\x95", + "\x9F\xB7"=>"\xE6\xBF\xA4", + "\x9F\xB8"=>"\xE6\xB6\x85", + "\x9F\xB9"=>"\xE6\xB7\xB9", + "\x9F\xBA"=>"\xE6\xB8\x95", + "\x9F\xBB"=>"\xE6\xB8\x8A", + "\x9F\xBC"=>"\xE6\xB6\xB5", + "\x9F\xBD"=>"\xE6\xB7\x87", + "\x9F\xBE"=>"\xE6\xB7\xA6", + "\x9F\xBF"=>"\xE6\xB6\xB8", + "\x9F\xC0"=>"\xE6\xB7\x86", + "\x9F\xC1"=>"\xE6\xB7\xAC", + "\x9F\xC2"=>"\xE6\xB7\x9E", + "\x9F\xC3"=>"\xE6\xB7\x8C", + "\x9F\xC4"=>"\xE6\xB7\xA8", + "\x9F\xC5"=>"\xE6\xB7\x92", + "\x9F\xC6"=>"\xE6\xB7\x85", + "\x9F\xC7"=>"\xE6\xB7\xBA", + "\x9F\xC8"=>"\xE6\xB7\x99", + "\x9F\xC9"=>"\xE6\xB7\xA4", + "\x9F\xCA"=>"\xE6\xB7\x95", + "\x9F\xCB"=>"\xE6\xB7\xAA", + "\x9F\xCC"=>"\xE6\xB7\xAE", + "\x9F\xCD"=>"\xE6\xB8\xAD", + "\x9F\xCE"=>"\xE6\xB9\xAE", + "\x9F\xCF"=>"\xE6\xB8\xAE", + "\x9F\xD0"=>"\xE6\xB8\x99", + "\x9F\xD1"=>"\xE6\xB9\xB2", + "\x9F\xD2"=>"\xE6\xB9\x9F", + "\x9F\xD3"=>"\xE6\xB8\xBE", + "\x9F\xD4"=>"\xE6\xB8\xA3", + "\x9F\xD5"=>"\xE6\xB9\xAB", + "\x9F\xD6"=>"\xE6\xB8\xAB", + "\x9F\xD7"=>"\xE6\xB9\xB6", + "\x9F\xD8"=>"\xE6\xB9\x8D", + "\x9F\xD9"=>"\xE6\xB8\x9F", + "\x9F\xDA"=>"\xE6\xB9\x83", + "\x9F\xDB"=>"\xE6\xB8\xBA", + "\x9F\xDC"=>"\xE6\xB9\x8E", + "\x9F\xDD"=>"\xE6\xB8\xA4", + "\x9F\xDE"=>"\xE6\xBB\xBF", + "\x9F\xDF"=>"\xE6\xB8\x9D", + "\x9F\xE0"=>"\xE6\xB8\xB8", + "\x9F\xE1"=>"\xE6\xBA\x82", + "\x9F\xE2"=>"\xE6\xBA\xAA", + "\x9F\xE3"=>"\xE6\xBA\x98", + "\x9F\xE4"=>"\xE6\xBB\x89", + "\x9F\xE5"=>"\xE6\xBA\xB7", + "\x9F\xE6"=>"\xE6\xBB\x93", + "\x9F\xE7"=>"\xE6\xBA\xBD", + "\x9F\xE8"=>"\xE6\xBA\xAF", + "\x9F\xE9"=>"\xE6\xBB\x84", + "\x9F\xEA"=>"\xE6\xBA\xB2", + "\x9F\xEB"=>"\xE6\xBB\x94", + "\x9F\xEC"=>"\xE6\xBB\x95", + "\x9F\xED"=>"\xE6\xBA\x8F", + "\x9F\xEE"=>"\xE6\xBA\xA5", + "\x9F\xEF"=>"\xE6\xBB\x82", + "\x9F\xF0"=>"\xE6\xBA\x9F", + "\x9F\xF1"=>"\xE6\xBD\x81", + "\x9F\xF2"=>"\xE6\xBC\x91", + "\x9F\xF3"=>"\xE7\x81\x8C", + "\x9F\xF4"=>"\xE6\xBB\xAC", + "\x9F\xF5"=>"\xE6\xBB\xB8", + "\x9F\xF6"=>"\xE6\xBB\xBE", + "\x9F\xF7"=>"\xE6\xBC\xBF", + "\x9F\xF8"=>"\xE6\xBB\xB2", + "\x9F\xF9"=>"\xE6\xBC\xB1", + "\x9F\xFA"=>"\xE6\xBB\xAF", + "\x9F\xFB"=>"\xE6\xBC\xB2", + "\x9F\xFC"=>"\xE6\xBB\x8C", + "\xA1"=>"\xEF\xBD\xA1", + "\xA2"=>"\xEF\xBD\xA2", + "\xA3"=>"\xEF\xBD\xA3", + "\xA4"=>"\xEF\xBD\xA4", + "\xA5"=>"\xEF\xBD\xA5", + "\xA6"=>"\xEF\xBD\xA6", + "\xA7"=>"\xEF\xBD\xA7", + "\xA8"=>"\xEF\xBD\xA8", + "\xA9"=>"\xEF\xBD\xA9", + "\xAA"=>"\xEF\xBD\xAA", + "\xAB"=>"\xEF\xBD\xAB", + "\xAC"=>"\xEF\xBD\xAC", + "\xAD"=>"\xEF\xBD\xAD", + "\xAE"=>"\xEF\xBD\xAE", + "\xAF"=>"\xEF\xBD\xAF", + "\xB0"=>"\xEF\xBD\xB0", + "\xB1"=>"\xEF\xBD\xB1", + "\xB2"=>"\xEF\xBD\xB2", + "\xB3"=>"\xEF\xBD\xB3", + "\xB4"=>"\xEF\xBD\xB4", + "\xB5"=>"\xEF\xBD\xB5", + "\xB6"=>"\xEF\xBD\xB6", + "\xB7"=>"\xEF\xBD\xB7", + "\xB8"=>"\xEF\xBD\xB8", + "\xB9"=>"\xEF\xBD\xB9", + "\xBA"=>"\xEF\xBD\xBA", + "\xBB"=>"\xEF\xBD\xBB", + "\xBC"=>"\xEF\xBD\xBC", + "\xBD"=>"\xEF\xBD\xBD", + "\xBE"=>"\xEF\xBD\xBE", + "\xBF"=>"\xEF\xBD\xBF", + "\xC0"=>"\xEF\xBE\x80", + "\xC1"=>"\xEF\xBE\x81", + "\xC2"=>"\xEF\xBE\x82", + "\xC3"=>"\xEF\xBE\x83", + "\xC4"=>"\xEF\xBE\x84", + "\xC5"=>"\xEF\xBE\x85", + "\xC6"=>"\xEF\xBE\x86", + "\xC7"=>"\xEF\xBE\x87", + "\xC8"=>"\xEF\xBE\x88", + "\xC9"=>"\xEF\xBE\x89", + "\xCA"=>"\xEF\xBE\x8A", + "\xCB"=>"\xEF\xBE\x8B", + "\xCC"=>"\xEF\xBE\x8C", + "\xCD"=>"\xEF\xBE\x8D", + "\xCE"=>"\xEF\xBE\x8E", + "\xCF"=>"\xEF\xBE\x8F", + "\xD0"=>"\xEF\xBE\x90", + "\xD1"=>"\xEF\xBE\x91", + "\xD2"=>"\xEF\xBE\x92", + "\xD3"=>"\xEF\xBE\x93", + "\xD4"=>"\xEF\xBE\x94", + "\xD5"=>"\xEF\xBE\x95", + "\xD6"=>"\xEF\xBE\x96", + "\xD7"=>"\xEF\xBE\x97", + "\xD8"=>"\xEF\xBE\x98", + "\xD9"=>"\xEF\xBE\x99", + "\xDA"=>"\xEF\xBE\x9A", + "\xDB"=>"\xEF\xBE\x9B", + "\xDC"=>"\xEF\xBE\x9C", + "\xDD"=>"\xEF\xBE\x9D", + "\xDE"=>"\xEF\xBE\x9E", + "\xDF"=>"\xEF\xBE\x9F", + "\xE0\x40"=>"\xE6\xBC\xBE", + "\xE0\x41"=>"\xE6\xBC\x93", + "\xE0\x42"=>"\xE6\xBB\xB7", + "\xE0\x43"=>"\xE6\xBE\x86", + "\xE0\x44"=>"\xE6\xBD\xBA", + "\xE0\x45"=>"\xE6\xBD\xB8", + "\xE0\x46"=>"\xE6\xBE\x81", + "\xE0\x47"=>"\xE6\xBE\x80", + "\xE0\x48"=>"\xE6\xBD\xAF", + "\xE0\x49"=>"\xE6\xBD\x9B", + "\xE0\x4A"=>"\xE6\xBF\xB3", + "\xE0\x4B"=>"\xE6\xBD\xAD", + "\xE0\x4C"=>"\xE6\xBE\x82", + "\xE0\x4D"=>"\xE6\xBD\xBC", + "\xE0\x4E"=>"\xE6\xBD\x98", + "\xE0\x4F"=>"\xE6\xBE\x8E", + "\xE0\x50"=>"\xE6\xBE\x91", + "\xE0\x51"=>"\xE6\xBF\x82", + "\xE0\x52"=>"\xE6\xBD\xA6", + "\xE0\x53"=>"\xE6\xBE\xB3", + "\xE0\x54"=>"\xE6\xBE\xA3", + "\xE0\x55"=>"\xE6\xBE\xA1", + "\xE0\x56"=>"\xE6\xBE\xA4", + "\xE0\x57"=>"\xE6\xBE\xB9", + "\xE0\x58"=>"\xE6\xBF\x86", + "\xE0\x59"=>"\xE6\xBE\xAA", + "\xE0\x5A"=>"\xE6\xBF\x9F", + "\xE0\x5B"=>"\xE6\xBF\x95", + "\xE0\x5C"=>"\xE6\xBF\xAC", + "\xE0\x5D"=>"\xE6\xBF\x94", + "\xE0\x5E"=>"\xE6\xBF\x98", + "\xE0\x5F"=>"\xE6\xBF\xB1", + "\xE0\x60"=>"\xE6\xBF\xAE", + "\xE0\x61"=>"\xE6\xBF\x9B", + "\xE0\x62"=>"\xE7\x80\x89", + "\xE0\x63"=>"\xE7\x80\x8B", + "\xE0\x64"=>"\xE6\xBF\xBA", + "\xE0\x65"=>"\xE7\x80\x91", + "\xE0\x66"=>"\xE7\x80\x81", + "\xE0\x67"=>"\xE7\x80\x8F", + "\xE0\x68"=>"\xE6\xBF\xBE", + "\xE0\x69"=>"\xE7\x80\x9B", + "\xE0\x6A"=>"\xE7\x80\x9A", + "\xE0\x6B"=>"\xE6\xBD\xB4", + "\xE0\x6C"=>"\xE7\x80\x9D", + "\xE0\x6D"=>"\xE7\x80\x98", + "\xE0\x6E"=>"\xE7\x80\x9F", + "\xE0\x6F"=>"\xE7\x80\xB0", + "\xE0\x70"=>"\xE7\x80\xBE", + "\xE0\x71"=>"\xE7\x80\xB2", + "\xE0\x72"=>"\xE7\x81\x91", + "\xE0\x73"=>"\xE7\x81\xA3", + "\xE0\x74"=>"\xE7\x82\x99", + "\xE0\x75"=>"\xE7\x82\x92", + "\xE0\x76"=>"\xE7\x82\xAF", + "\xE0\x77"=>"\xE7\x83\xB1", + "\xE0\x78"=>"\xE7\x82\xAC", + "\xE0\x79"=>"\xE7\x82\xB8", + "\xE0\x7A"=>"\xE7\x82\xB3", + "\xE0\x7B"=>"\xE7\x82\xAE", + "\xE0\x7C"=>"\xE7\x83\x9F", + "\xE0\x7D"=>"\xE7\x83\x8B", + "\xE0\x7E"=>"\xE7\x83\x9D", + "\xE0\x80"=>"\xE7\x83\x99", + "\xE0\x81"=>"\xE7\x84\x89", + "\xE0\x82"=>"\xE7\x83\xBD", + "\xE0\x83"=>"\xE7\x84\x9C", + "\xE0\x84"=>"\xE7\x84\x99", + "\xE0\x85"=>"\xE7\x85\xA5", + "\xE0\x86"=>"\xE7\x85\x95", + "\xE0\x87"=>"\xE7\x86\x88", + "\xE0\x88"=>"\xE7\x85\xA6", + "\xE0\x89"=>"\xE7\x85\xA2", + "\xE0\x8A"=>"\xE7\x85\x8C", + "\xE0\x8B"=>"\xE7\x85\x96", + "\xE0\x8C"=>"\xE7\x85\xAC", + "\xE0\x8D"=>"\xE7\x86\x8F", + "\xE0\x8E"=>"\xE7\x87\xBB", + "\xE0\x8F"=>"\xE7\x86\x84", + "\xE0\x90"=>"\xE7\x86\x95", + "\xE0\x91"=>"\xE7\x86\xA8", + "\xE0\x92"=>"\xE7\x86\xAC", + "\xE0\x93"=>"\xE7\x87\x97", + "\xE0\x94"=>"\xE7\x86\xB9", + "\xE0\x95"=>"\xE7\x86\xBE", + "\xE0\x96"=>"\xE7\x87\x92", + "\xE0\x97"=>"\xE7\x87\x89", + "\xE0\x98"=>"\xE7\x87\x94", + "\xE0\x99"=>"\xE7\x87\x8E", + "\xE0\x9A"=>"\xE7\x87\xA0", + "\xE0\x9B"=>"\xE7\x87\xAC", + "\xE0\x9C"=>"\xE7\x87\xA7", + "\xE0\x9D"=>"\xE7\x87\xB5", + "\xE0\x9E"=>"\xE7\x87\xBC", + "\xE0\x9F"=>"\xE7\x87\xB9", + "\xE0\xA0"=>"\xE7\x87\xBF", + "\xE0\xA1"=>"\xE7\x88\x8D", + "\xE0\xA2"=>"\xE7\x88\x90", + "\xE0\xA3"=>"\xE7\x88\x9B", + "\xE0\xA4"=>"\xE7\x88\xA8", + "\xE0\xA5"=>"\xE7\x88\xAD", + "\xE0\xA6"=>"\xE7\x88\xAC", + "\xE0\xA7"=>"\xE7\x88\xB0", + "\xE0\xA8"=>"\xE7\x88\xB2", + "\xE0\xA9"=>"\xE7\x88\xBB", + "\xE0\xAA"=>"\xE7\x88\xBC", + "\xE0\xAB"=>"\xE7\x88\xBF", + "\xE0\xAC"=>"\xE7\x89\x80", + "\xE0\xAD"=>"\xE7\x89\x86", + "\xE0\xAE"=>"\xE7\x89\x8B", + "\xE0\xAF"=>"\xE7\x89\x98", + "\xE0\xB0"=>"\xE7\x89\xB4", + "\xE0\xB1"=>"\xE7\x89\xBE", + "\xE0\xB2"=>"\xE7\x8A\x82", + "\xE0\xB3"=>"\xE7\x8A\x81", + "\xE0\xB4"=>"\xE7\x8A\x87", + "\xE0\xB5"=>"\xE7\x8A\x92", + "\xE0\xB6"=>"\xE7\x8A\x96", + "\xE0\xB7"=>"\xE7\x8A\xA2", + "\xE0\xB8"=>"\xE7\x8A\xA7", + "\xE0\xB9"=>"\xE7\x8A\xB9", + "\xE0\xBA"=>"\xE7\x8A\xB2", + "\xE0\xBB"=>"\xE7\x8B\x83", + "\xE0\xBC"=>"\xE7\x8B\x86", + "\xE0\xBD"=>"\xE7\x8B\x84", + "\xE0\xBE"=>"\xE7\x8B\x8E", + "\xE0\xBF"=>"\xE7\x8B\x92", + "\xE0\xC0"=>"\xE7\x8B\xA2", + "\xE0\xC1"=>"\xE7\x8B\xA0", + "\xE0\xC2"=>"\xE7\x8B\xA1", + "\xE0\xC3"=>"\xE7\x8B\xB9", + "\xE0\xC4"=>"\xE7\x8B\xB7", + "\xE0\xC5"=>"\xE5\x80\x8F", + "\xE0\xC6"=>"\xE7\x8C\x97", + "\xE0\xC7"=>"\xE7\x8C\x8A", + "\xE0\xC8"=>"\xE7\x8C\x9C", + "\xE0\xC9"=>"\xE7\x8C\x96", + "\xE0\xCA"=>"\xE7\x8C\x9D", + "\xE0\xCB"=>"\xE7\x8C\xB4", + "\xE0\xCC"=>"\xE7\x8C\xAF", + "\xE0\xCD"=>"\xE7\x8C\xA9", + "\xE0\xCE"=>"\xE7\x8C\xA5", + "\xE0\xCF"=>"\xE7\x8C\xBE", + "\xE0\xD0"=>"\xE7\x8D\x8E", + "\xE0\xD1"=>"\xE7\x8D\x8F", + "\xE0\xD2"=>"\xE9\xBB\x98", + "\xE0\xD3"=>"\xE7\x8D\x97", + "\xE0\xD4"=>"\xE7\x8D\xAA", + "\xE0\xD5"=>"\xE7\x8D\xA8", + "\xE0\xD6"=>"\xE7\x8D\xB0", + "\xE0\xD7"=>"\xE7\x8D\xB8", + "\xE0\xD8"=>"\xE7\x8D\xB5", + "\xE0\xD9"=>"\xE7\x8D\xBB", + "\xE0\xDA"=>"\xE7\x8D\xBA", + "\xE0\xDB"=>"\xE7\x8F\x88", + "\xE0\xDC"=>"\xE7\x8E\xB3", + "\xE0\xDD"=>"\xE7\x8F\x8E", + "\xE0\xDE"=>"\xE7\x8E\xBB", + "\xE0\xDF"=>"\xE7\x8F\x80", + "\xE0\xE0"=>"\xE7\x8F\xA5", + "\xE0\xE1"=>"\xE7\x8F\xAE", + "\xE0\xE2"=>"\xE7\x8F\x9E", + "\xE0\xE3"=>"\xE7\x92\xA2", + "\xE0\xE4"=>"\xE7\x90\x85", + "\xE0\xE5"=>"\xE7\x91\xAF", + "\xE0\xE6"=>"\xE7\x90\xA5", + "\xE0\xE7"=>"\xE7\x8F\xB8", + "\xE0\xE8"=>"\xE7\x90\xB2", + "\xE0\xE9"=>"\xE7\x90\xBA", + "\xE0\xEA"=>"\xE7\x91\x95", + "\xE0\xEB"=>"\xE7\x90\xBF", + "\xE0\xEC"=>"\xE7\x91\x9F", + "\xE0\xED"=>"\xE7\x91\x99", + "\xE0\xEE"=>"\xE7\x91\x81", + "\xE0\xEF"=>"\xE7\x91\x9C", + "\xE0\xF0"=>"\xE7\x91\xA9", + "\xE0\xF1"=>"\xE7\x91\xB0", + "\xE0\xF2"=>"\xE7\x91\xA3", + "\xE0\xF3"=>"\xE7\x91\xAA", + "\xE0\xF4"=>"\xE7\x91\xB6", + "\xE0\xF5"=>"\xE7\x91\xBE", + "\xE0\xF6"=>"\xE7\x92\x8B", + "\xE0\xF7"=>"\xE7\x92\x9E", + "\xE0\xF8"=>"\xE7\x92\xA7", + "\xE0\xF9"=>"\xE7\x93\x8A", + "\xE0\xFA"=>"\xE7\x93\x8F", + "\xE0\xFB"=>"\xE7\x93\x94", + "\xE0\xFC"=>"\xE7\x8F\xB1", + "\xE1\x40"=>"\xE7\x93\xA0", + "\xE1\x41"=>"\xE7\x93\xA3", + "\xE1\x42"=>"\xE7\x93\xA7", + "\xE1\x43"=>"\xE7\x93\xA9", + "\xE1\x44"=>"\xE7\x93\xAE", + "\xE1\x45"=>"\xE7\x93\xB2", + "\xE1\x46"=>"\xE7\x93\xB0", + "\xE1\x47"=>"\xE7\x93\xB1", + "\xE1\x48"=>"\xE7\x93\xB8", + "\xE1\x49"=>"\xE7\x93\xB7", + "\xE1\x4A"=>"\xE7\x94\x84", + "\xE1\x4B"=>"\xE7\x94\x83", + "\xE1\x4C"=>"\xE7\x94\x85", + "\xE1\x4D"=>"\xE7\x94\x8C", + "\xE1\x4E"=>"\xE7\x94\x8E", + "\xE1\x4F"=>"\xE7\x94\x8D", + "\xE1\x50"=>"\xE7\x94\x95", + "\xE1\x51"=>"\xE7\x94\x93", + "\xE1\x52"=>"\xE7\x94\x9E", + "\xE1\x53"=>"\xE7\x94\xA6", + "\xE1\x54"=>"\xE7\x94\xAC", + "\xE1\x55"=>"\xE7\x94\xBC", + "\xE1\x56"=>"\xE7\x95\x84", + "\xE1\x57"=>"\xE7\x95\x8D", + "\xE1\x58"=>"\xE7\x95\x8A", + "\xE1\x59"=>"\xE7\x95\x89", + "\xE1\x5A"=>"\xE7\x95\x9B", + "\xE1\x5B"=>"\xE7\x95\x86", + "\xE1\x5C"=>"\xE7\x95\x9A", + "\xE1\x5D"=>"\xE7\x95\xA9", + "\xE1\x5E"=>"\xE7\x95\xA4", + "\xE1\x5F"=>"\xE7\x95\xA7", + "\xE1\x60"=>"\xE7\x95\xAB", + "\xE1\x61"=>"\xE7\x95\xAD", + "\xE1\x62"=>"\xE7\x95\xB8", + "\xE1\x63"=>"\xE7\x95\xB6", + "\xE1\x64"=>"\xE7\x96\x86", + "\xE1\x65"=>"\xE7\x96\x87", + "\xE1\x66"=>"\xE7\x95\xB4", + "\xE1\x67"=>"\xE7\x96\x8A", + "\xE1\x68"=>"\xE7\x96\x89", + "\xE1\x69"=>"\xE7\x96\x82", + "\xE1\x6A"=>"\xE7\x96\x94", + "\xE1\x6B"=>"\xE7\x96\x9A", + "\xE1\x6C"=>"\xE7\x96\x9D", + "\xE1\x6D"=>"\xE7\x96\xA5", + "\xE1\x6E"=>"\xE7\x96\xA3", + "\xE1\x6F"=>"\xE7\x97\x82", + "\xE1\x70"=>"\xE7\x96\xB3", + "\xE1\x71"=>"\xE7\x97\x83", + "\xE1\x72"=>"\xE7\x96\xB5", + "\xE1\x73"=>"\xE7\x96\xBD", + "\xE1\x74"=>"\xE7\x96\xB8", + "\xE1\x75"=>"\xE7\x96\xBC", + "\xE1\x76"=>"\xE7\x96\xB1", + "\xE1\x77"=>"\xE7\x97\x8D", + "\xE1\x78"=>"\xE7\x97\x8A", + "\xE1\x79"=>"\xE7\x97\x92", + "\xE1\x7A"=>"\xE7\x97\x99", + "\xE1\x7B"=>"\xE7\x97\xA3", + "\xE1\x7C"=>"\xE7\x97\x9E", + "\xE1\x7D"=>"\xE7\x97\xBE", + "\xE1\x7E"=>"\xE7\x97\xBF", + "\xE1\x80"=>"\xE7\x97\xBC", + "\xE1\x81"=>"\xE7\x98\x81", + "\xE1\x82"=>"\xE7\x97\xB0", + "\xE1\x83"=>"\xE7\x97\xBA", + "\xE1\x84"=>"\xE7\x97\xB2", + "\xE1\x85"=>"\xE7\x97\xB3", + "\xE1\x86"=>"\xE7\x98\x8B", + "\xE1\x87"=>"\xE7\x98\x8D", + "\xE1\x88"=>"\xE7\x98\x89", + "\xE1\x89"=>"\xE7\x98\x9F", + "\xE1\x8A"=>"\xE7\x98\xA7", + "\xE1\x8B"=>"\xE7\x98\xA0", + "\xE1\x8C"=>"\xE7\x98\xA1", + "\xE1\x8D"=>"\xE7\x98\xA2", + "\xE1\x8E"=>"\xE7\x98\xA4", + "\xE1\x8F"=>"\xE7\x98\xB4", + "\xE1\x90"=>"\xE7\x98\xB0", + "\xE1\x91"=>"\xE7\x98\xBB", + "\xE1\x92"=>"\xE7\x99\x87", + "\xE1\x93"=>"\xE7\x99\x88", + "\xE1\x94"=>"\xE7\x99\x86", + "\xE1\x95"=>"\xE7\x99\x9C", + "\xE1\x96"=>"\xE7\x99\x98", + "\xE1\x97"=>"\xE7\x99\xA1", + "\xE1\x98"=>"\xE7\x99\xA2", + "\xE1\x99"=>"\xE7\x99\xA8", + "\xE1\x9A"=>"\xE7\x99\xA9", + "\xE1\x9B"=>"\xE7\x99\xAA", + "\xE1\x9C"=>"\xE7\x99\xA7", + "\xE1\x9D"=>"\xE7\x99\xAC", + "\xE1\x9E"=>"\xE7\x99\xB0", + "\xE1\x9F"=>"\xE7\x99\xB2", + "\xE1\xA0"=>"\xE7\x99\xB6", + "\xE1\xA1"=>"\xE7\x99\xB8", + "\xE1\xA2"=>"\xE7\x99\xBC", + "\xE1\xA3"=>"\xE7\x9A\x80", + "\xE1\xA4"=>"\xE7\x9A\x83", + "\xE1\xA5"=>"\xE7\x9A\x88", + "\xE1\xA6"=>"\xE7\x9A\x8B", + "\xE1\xA7"=>"\xE7\x9A\x8E", + "\xE1\xA8"=>"\xE7\x9A\x96", + "\xE1\xA9"=>"\xE7\x9A\x93", + "\xE1\xAA"=>"\xE7\x9A\x99", + "\xE1\xAB"=>"\xE7\x9A\x9A", + "\xE1\xAC"=>"\xE7\x9A\xB0", + "\xE1\xAD"=>"\xE7\x9A\xB4", + "\xE1\xAE"=>"\xE7\x9A\xB8", + "\xE1\xAF"=>"\xE7\x9A\xB9", + "\xE1\xB0"=>"\xE7\x9A\xBA", + "\xE1\xB1"=>"\xE7\x9B\x82", + "\xE1\xB2"=>"\xE7\x9B\x8D", + "\xE1\xB3"=>"\xE7\x9B\x96", + "\xE1\xB4"=>"\xE7\x9B\x92", + "\xE1\xB5"=>"\xE7\x9B\x9E", + "\xE1\xB6"=>"\xE7\x9B\xA1", + "\xE1\xB7"=>"\xE7\x9B\xA5", + "\xE1\xB8"=>"\xE7\x9B\xA7", + "\xE1\xB9"=>"\xE7\x9B\xAA", + "\xE1\xBA"=>"\xE8\x98\xAF", + "\xE1\xBB"=>"\xE7\x9B\xBB", + "\xE1\xBC"=>"\xE7\x9C\x88", + "\xE1\xBD"=>"\xE7\x9C\x87", + "\xE1\xBE"=>"\xE7\x9C\x84", + "\xE1\xBF"=>"\xE7\x9C\xA9", + "\xE1\xC0"=>"\xE7\x9C\xA4", + "\xE1\xC1"=>"\xE7\x9C\x9E", + "\xE1\xC2"=>"\xE7\x9C\xA5", + "\xE1\xC3"=>"\xE7\x9C\xA6", + "\xE1\xC4"=>"\xE7\x9C\x9B", + "\xE1\xC5"=>"\xE7\x9C\xB7", + "\xE1\xC6"=>"\xE7\x9C\xB8", + "\xE1\xC7"=>"\xE7\x9D\x87", + "\xE1\xC8"=>"\xE7\x9D\x9A", + "\xE1\xC9"=>"\xE7\x9D\xA8", + "\xE1\xCA"=>"\xE7\x9D\xAB", + "\xE1\xCB"=>"\xE7\x9D\x9B", + "\xE1\xCC"=>"\xE7\x9D\xA5", + "\xE1\xCD"=>"\xE7\x9D\xBF", + "\xE1\xCE"=>"\xE7\x9D\xBE", + "\xE1\xCF"=>"\xE7\x9D\xB9", + "\xE1\xD0"=>"\xE7\x9E\x8E", + "\xE1\xD1"=>"\xE7\x9E\x8B", + "\xE1\xD2"=>"\xE7\x9E\x91", + "\xE1\xD3"=>"\xE7\x9E\xA0", + "\xE1\xD4"=>"\xE7\x9E\x9E", + "\xE1\xD5"=>"\xE7\x9E\xB0", + "\xE1\xD6"=>"\xE7\x9E\xB6", + "\xE1\xD7"=>"\xE7\x9E\xB9", + "\xE1\xD8"=>"\xE7\x9E\xBF", + "\xE1\xD9"=>"\xE7\x9E\xBC", + "\xE1\xDA"=>"\xE7\x9E\xBD", + "\xE1\xDB"=>"\xE7\x9E\xBB", + "\xE1\xDC"=>"\xE7\x9F\x87", + "\xE1\xDD"=>"\xE7\x9F\x8D", + "\xE1\xDE"=>"\xE7\x9F\x97", + "\xE1\xDF"=>"\xE7\x9F\x9A", + "\xE1\xE0"=>"\xE7\x9F\x9C", + "\xE1\xE1"=>"\xE7\x9F\xA3", + "\xE1\xE2"=>"\xE7\x9F\xAE", + "\xE1\xE3"=>"\xE7\x9F\xBC", + "\xE1\xE4"=>"\xE7\xA0\x8C", + "\xE1\xE5"=>"\xE7\xA0\x92", + "\xE1\xE6"=>"\xE7\xA4\xA6", + "\xE1\xE7"=>"\xE7\xA0\xA0", + "\xE1\xE8"=>"\xE7\xA4\xAA", + "\xE1\xE9"=>"\xE7\xA1\x85", + "\xE1\xEA"=>"\xE7\xA2\x8E", + "\xE1\xEB"=>"\xE7\xA1\xB4", + "\xE1\xEC"=>"\xE7\xA2\x86", + "\xE1\xED"=>"\xE7\xA1\xBC", + "\xE1\xEE"=>"\xE7\xA2\x9A", + "\xE1\xEF"=>"\xE7\xA2\x8C", + "\xE1\xF0"=>"\xE7\xA2\xA3", + "\xE1\xF1"=>"\xE7\xA2\xB5", + "\xE1\xF2"=>"\xE7\xA2\xAA", + "\xE1\xF3"=>"\xE7\xA2\xAF", + "\xE1\xF4"=>"\xE7\xA3\x91", + "\xE1\xF5"=>"\xE7\xA3\x86", + "\xE1\xF6"=>"\xE7\xA3\x8B", + "\xE1\xF7"=>"\xE7\xA3\x94", + "\xE1\xF8"=>"\xE7\xA2\xBE", + "\xE1\xF9"=>"\xE7\xA2\xBC", + "\xE1\xFA"=>"\xE7\xA3\x85", + "\xE1\xFB"=>"\xE7\xA3\x8A", + "\xE1\xFC"=>"\xE7\xA3\xAC", + "\xE2\x40"=>"\xE7\xA3\xA7", + "\xE2\x41"=>"\xE7\xA3\x9A", + "\xE2\x42"=>"\xE7\xA3\xBD", + "\xE2\x43"=>"\xE7\xA3\xB4", + "\xE2\x44"=>"\xE7\xA4\x87", + "\xE2\x45"=>"\xE7\xA4\x92", + "\xE2\x46"=>"\xE7\xA4\x91", + "\xE2\x47"=>"\xE7\xA4\x99", + "\xE2\x48"=>"\xE7\xA4\xAC", + "\xE2\x49"=>"\xE7\xA4\xAB", + "\xE2\x4A"=>"\xE7\xA5\x80", + "\xE2\x4B"=>"\xE7\xA5\xA0", + "\xE2\x4C"=>"\xE7\xA5\x97", + "\xE2\x4D"=>"\xE7\xA5\x9F", + "\xE2\x4E"=>"\xE7\xA5\x9A", + "\xE2\x4F"=>"\xE7\xA5\x95", + "\xE2\x50"=>"\xE7\xA5\x93", + "\xE2\x51"=>"\xE7\xA5\xBA", + "\xE2\x52"=>"\xE7\xA5\xBF", + "\xE2\x53"=>"\xE7\xA6\x8A", + "\xE2\x54"=>"\xE7\xA6\x9D", + "\xE2\x55"=>"\xE7\xA6\xA7", + "\xE2\x56"=>"\xE9\xBD\x8B", + "\xE2\x57"=>"\xE7\xA6\xAA", + "\xE2\x58"=>"\xE7\xA6\xAE", + "\xE2\x59"=>"\xE7\xA6\xB3", + "\xE2\x5A"=>"\xE7\xA6\xB9", + "\xE2\x5B"=>"\xE7\xA6\xBA", + "\xE2\x5C"=>"\xE7\xA7\x89", + "\xE2\x5D"=>"\xE7\xA7\x95", + "\xE2\x5E"=>"\xE7\xA7\xA7", + "\xE2\x5F"=>"\xE7\xA7\xAC", + "\xE2\x60"=>"\xE7\xA7\xA1", + "\xE2\x61"=>"\xE7\xA7\xA3", + "\xE2\x62"=>"\xE7\xA8\x88", + "\xE2\x63"=>"\xE7\xA8\x8D", + "\xE2\x64"=>"\xE7\xA8\x98", + "\xE2\x65"=>"\xE7\xA8\x99", + "\xE2\x66"=>"\xE7\xA8\xA0", + "\xE2\x67"=>"\xE7\xA8\x9F", + "\xE2\x68"=>"\xE7\xA6\x80", + "\xE2\x69"=>"\xE7\xA8\xB1", + "\xE2\x6A"=>"\xE7\xA8\xBB", + "\xE2\x6B"=>"\xE7\xA8\xBE", + "\xE2\x6C"=>"\xE7\xA8\xB7", + "\xE2\x6D"=>"\xE7\xA9\x83", + "\xE2\x6E"=>"\xE7\xA9\x97", + "\xE2\x6F"=>"\xE7\xA9\x89", + "\xE2\x70"=>"\xE7\xA9\xA1", + "\xE2\x71"=>"\xE7\xA9\xA2", + "\xE2\x72"=>"\xE7\xA9\xA9", + "\xE2\x73"=>"\xE9\xBE\x9D", + "\xE2\x74"=>"\xE7\xA9\xB0", + "\xE2\x75"=>"\xE7\xA9\xB9", + "\xE2\x76"=>"\xE7\xA9\xBD", + "\xE2\x77"=>"\xE7\xAA\x88", + "\xE2\x78"=>"\xE7\xAA\x97", + "\xE2\x79"=>"\xE7\xAA\x95", + "\xE2\x7A"=>"\xE7\xAA\x98", + "\xE2\x7B"=>"\xE7\xAA\x96", + "\xE2\x7C"=>"\xE7\xAA\xA9", + "\xE2\x7D"=>"\xE7\xAB\x88", + "\xE2\x7E"=>"\xE7\xAA\xB0", + "\xE2\x80"=>"\xE7\xAA\xB6", + "\xE2\x81"=>"\xE7\xAB\x85", + "\xE2\x82"=>"\xE7\xAB\x84", + "\xE2\x83"=>"\xE7\xAA\xBF", + "\xE2\x84"=>"\xE9\x82\x83", + "\xE2\x85"=>"\xE7\xAB\x87", + "\xE2\x86"=>"\xE7\xAB\x8A", + "\xE2\x87"=>"\xE7\xAB\x8D", + "\xE2\x88"=>"\xE7\xAB\x8F", + "\xE2\x89"=>"\xE7\xAB\x95", + "\xE2\x8A"=>"\xE7\xAB\x93", + "\xE2\x8B"=>"\xE7\xAB\x99", + "\xE2\x8C"=>"\xE7\xAB\x9A", + "\xE2\x8D"=>"\xE7\xAB\x9D", + "\xE2\x8E"=>"\xE7\xAB\xA1", + "\xE2\x8F"=>"\xE7\xAB\xA2", + "\xE2\x90"=>"\xE7\xAB\xA6", + "\xE2\x91"=>"\xE7\xAB\xAD", + "\xE2\x92"=>"\xE7\xAB\xB0", + "\xE2\x93"=>"\xE7\xAC\x82", + "\xE2\x94"=>"\xE7\xAC\x8F", + "\xE2\x95"=>"\xE7\xAC\x8A", + "\xE2\x96"=>"\xE7\xAC\x86", + "\xE2\x97"=>"\xE7\xAC\xB3", + "\xE2\x98"=>"\xE7\xAC\x98", + "\xE2\x99"=>"\xE7\xAC\x99", + "\xE2\x9A"=>"\xE7\xAC\x9E", + "\xE2\x9B"=>"\xE7\xAC\xB5", + "\xE2\x9C"=>"\xE7\xAC\xA8", + "\xE2\x9D"=>"\xE7\xAC\xB6", + "\xE2\x9E"=>"\xE7\xAD\x90", + "\xE2\x9F"=>"\xE7\xAD\xBA", + "\xE2\xA0"=>"\xE7\xAC\x84", + "\xE2\xA1"=>"\xE7\xAD\x8D", + "\xE2\xA2"=>"\xE7\xAC\x8B", + "\xE2\xA3"=>"\xE7\xAD\x8C", + "\xE2\xA4"=>"\xE7\xAD\x85", + "\xE2\xA5"=>"\xE7\xAD\xB5", + "\xE2\xA6"=>"\xE7\xAD\xA5", + "\xE2\xA7"=>"\xE7\xAD\xB4", + "\xE2\xA8"=>"\xE7\xAD\xA7", + "\xE2\xA9"=>"\xE7\xAD\xB0", + "\xE2\xAA"=>"\xE7\xAD\xB1", + "\xE2\xAB"=>"\xE7\xAD\xAC", + "\xE2\xAC"=>"\xE7\xAD\xAE", + "\xE2\xAD"=>"\xE7\xAE\x9D", + "\xE2\xAE"=>"\xE7\xAE\x98", + "\xE2\xAF"=>"\xE7\xAE\x9F", + "\xE2\xB0"=>"\xE7\xAE\x8D", + "\xE2\xB1"=>"\xE7\xAE\x9C", + "\xE2\xB2"=>"\xE7\xAE\x9A", + "\xE2\xB3"=>"\xE7\xAE\x8B", + "\xE2\xB4"=>"\xE7\xAE\x92", + "\xE2\xB5"=>"\xE7\xAE\x8F", + "\xE2\xB6"=>"\xE7\xAD\x9D", + "\xE2\xB7"=>"\xE7\xAE\x99", + "\xE2\xB8"=>"\xE7\xAF\x8B", + "\xE2\xB9"=>"\xE7\xAF\x81", + "\xE2\xBA"=>"\xE7\xAF\x8C", + "\xE2\xBB"=>"\xE7\xAF\x8F", + "\xE2\xBC"=>"\xE7\xAE\xB4", + "\xE2\xBD"=>"\xE7\xAF\x86", + "\xE2\xBE"=>"\xE7\xAF\x9D", + "\xE2\xBF"=>"\xE7\xAF\xA9", + "\xE2\xC0"=>"\xE7\xB0\x91", + "\xE2\xC1"=>"\xE7\xB0\x94", + "\xE2\xC2"=>"\xE7\xAF\xA6", + "\xE2\xC3"=>"\xE7\xAF\xA5", + "\xE2\xC4"=>"\xE7\xB1\xA0", + "\xE2\xC5"=>"\xE7\xB0\x80", + "\xE2\xC6"=>"\xE7\xB0\x87", + "\xE2\xC7"=>"\xE7\xB0\x93", + "\xE2\xC8"=>"\xE7\xAF\xB3", + "\xE2\xC9"=>"\xE7\xAF\xB7", + "\xE2\xCA"=>"\xE7\xB0\x97", + "\xE2\xCB"=>"\xE7\xB0\x8D", + "\xE2\xCC"=>"\xE7\xAF\xB6", + "\xE2\xCD"=>"\xE7\xB0\xA3", + "\xE2\xCE"=>"\xE7\xB0\xA7", + "\xE2\xCF"=>"\xE7\xB0\xAA", + "\xE2\xD0"=>"\xE7\xB0\x9F", + "\xE2\xD1"=>"\xE7\xB0\xB7", + "\xE2\xD2"=>"\xE7\xB0\xAB", + "\xE2\xD3"=>"\xE7\xB0\xBD", + "\xE2\xD4"=>"\xE7\xB1\x8C", + "\xE2\xD5"=>"\xE7\xB1\x83", + "\xE2\xD6"=>"\xE7\xB1\x94", + "\xE2\xD7"=>"\xE7\xB1\x8F", + "\xE2\xD8"=>"\xE7\xB1\x80", + "\xE2\xD9"=>"\xE7\xB1\x90", + "\xE2\xDA"=>"\xE7\xB1\x98", + "\xE2\xDB"=>"\xE7\xB1\x9F", + "\xE2\xDC"=>"\xE7\xB1\xA4", + "\xE2\xDD"=>"\xE7\xB1\x96", + "\xE2\xDE"=>"\xE7\xB1\xA5", + "\xE2\xDF"=>"\xE7\xB1\xAC", + "\xE2\xE0"=>"\xE7\xB1\xB5", + "\xE2\xE1"=>"\xE7\xB2\x83", + "\xE2\xE2"=>"\xE7\xB2\x90", + "\xE2\xE3"=>"\xE7\xB2\xA4", + "\xE2\xE4"=>"\xE7\xB2\xAD", + "\xE2\xE5"=>"\xE7\xB2\xA2", + "\xE2\xE6"=>"\xE7\xB2\xAB", + "\xE2\xE7"=>"\xE7\xB2\xA1", + "\xE2\xE8"=>"\xE7\xB2\xA8", + "\xE2\xE9"=>"\xE7\xB2\xB3", + "\xE2\xEA"=>"\xE7\xB2\xB2", + "\xE2\xEB"=>"\xE7\xB2\xB1", + "\xE2\xEC"=>"\xE7\xB2\xAE", + "\xE2\xED"=>"\xE7\xB2\xB9", + "\xE2\xEE"=>"\xE7\xB2\xBD", + "\xE2\xEF"=>"\xE7\xB3\x80", + "\xE2\xF0"=>"\xE7\xB3\x85", + "\xE2\xF1"=>"\xE7\xB3\x82", + "\xE2\xF2"=>"\xE7\xB3\x98", + "\xE2\xF3"=>"\xE7\xB3\x92", + "\xE2\xF4"=>"\xE7\xB3\x9C", + "\xE2\xF5"=>"\xE7\xB3\xA2", + "\xE2\xF6"=>"\xE9\xAC\xBB", + "\xE2\xF7"=>"\xE7\xB3\xAF", + "\xE2\xF8"=>"\xE7\xB3\xB2", + "\xE2\xF9"=>"\xE7\xB3\xB4", + "\xE2\xFA"=>"\xE7\xB3\xB6", + "\xE2\xFB"=>"\xE7\xB3\xBA", + "\xE2\xFC"=>"\xE7\xB4\x86", + "\xE3\x40"=>"\xE7\xB4\x82", + "\xE3\x41"=>"\xE7\xB4\x9C", + "\xE3\x42"=>"\xE7\xB4\x95", + "\xE3\x43"=>"\xE7\xB4\x8A", + "\xE3\x44"=>"\xE7\xB5\x85", + "\xE3\x45"=>"\xE7\xB5\x8B", + "\xE3\x46"=>"\xE7\xB4\xAE", + "\xE3\x47"=>"\xE7\xB4\xB2", + "\xE3\x48"=>"\xE7\xB4\xBF", + "\xE3\x49"=>"\xE7\xB4\xB5", + "\xE3\x4A"=>"\xE7\xB5\x86", + "\xE3\x4B"=>"\xE7\xB5\xB3", + "\xE3\x4C"=>"\xE7\xB5\x96", + "\xE3\x4D"=>"\xE7\xB5\x8E", + "\xE3\x4E"=>"\xE7\xB5\xB2", + "\xE3\x4F"=>"\xE7\xB5\xA8", + "\xE3\x50"=>"\xE7\xB5\xAE", + "\xE3\x51"=>"\xE7\xB5\x8F", + "\xE3\x52"=>"\xE7\xB5\xA3", + "\xE3\x53"=>"\xE7\xB6\x93", + "\xE3\x54"=>"\xE7\xB6\x89", + "\xE3\x55"=>"\xE7\xB5\x9B", + "\xE3\x56"=>"\xE7\xB6\x8F", + "\xE3\x57"=>"\xE7\xB5\xBD", + "\xE3\x58"=>"\xE7\xB6\x9B", + "\xE3\x59"=>"\xE7\xB6\xBA", + "\xE3\x5A"=>"\xE7\xB6\xAE", + "\xE3\x5B"=>"\xE7\xB6\xA3", + "\xE3\x5C"=>"\xE7\xB6\xB5", + "\xE3\x5D"=>"\xE7\xB7\x87", + "\xE3\x5E"=>"\xE7\xB6\xBD", + "\xE3\x5F"=>"\xE7\xB6\xAB", + "\xE3\x60"=>"\xE7\xB8\xBD", + "\xE3\x61"=>"\xE7\xB6\xA2", + "\xE3\x62"=>"\xE7\xB6\xAF", + "\xE3\x63"=>"\xE7\xB7\x9C", + "\xE3\x64"=>"\xE7\xB6\xB8", + "\xE3\x65"=>"\xE7\xB6\x9F", + "\xE3\x66"=>"\xE7\xB6\xB0", + "\xE3\x67"=>"\xE7\xB7\x98", + "\xE3\x68"=>"\xE7\xB7\x9D", + "\xE3\x69"=>"\xE7\xB7\xA4", + "\xE3\x6A"=>"\xE7\xB7\x9E", + "\xE3\x6B"=>"\xE7\xB7\xBB", + "\xE3\x6C"=>"\xE7\xB7\xB2", + "\xE3\x6D"=>"\xE7\xB7\xA1", + "\xE3\x6E"=>"\xE7\xB8\x85", + "\xE3\x6F"=>"\xE7\xB8\x8A", + "\xE3\x70"=>"\xE7\xB8\xA3", + "\xE3\x71"=>"\xE7\xB8\xA1", + "\xE3\x72"=>"\xE7\xB8\x92", + "\xE3\x73"=>"\xE7\xB8\xB1", + "\xE3\x74"=>"\xE7\xB8\x9F", + "\xE3\x75"=>"\xE7\xB8\x89", + "\xE3\x76"=>"\xE7\xB8\x8B", + "\xE3\x77"=>"\xE7\xB8\xA2", + "\xE3\x78"=>"\xE7\xB9\x86", + "\xE3\x79"=>"\xE7\xB9\xA6", + "\xE3\x7A"=>"\xE7\xB8\xBB", + "\xE3\x7B"=>"\xE7\xB8\xB5", + "\xE3\x7C"=>"\xE7\xB8\xB9", + "\xE3\x7D"=>"\xE7\xB9\x83", + "\xE3\x7E"=>"\xE7\xB8\xB7", + "\xE3\x80"=>"\xE7\xB8\xB2", + "\xE3\x81"=>"\xE7\xB8\xBA", + "\xE3\x82"=>"\xE7\xB9\xA7", + "\xE3\x83"=>"\xE7\xB9\x9D", + "\xE3\x84"=>"\xE7\xB9\x96", + "\xE3\x85"=>"\xE7\xB9\x9E", + "\xE3\x86"=>"\xE7\xB9\x99", + "\xE3\x87"=>"\xE7\xB9\x9A", + "\xE3\x88"=>"\xE7\xB9\xB9", + "\xE3\x89"=>"\xE7\xB9\xAA", + "\xE3\x8A"=>"\xE7\xB9\xA9", + "\xE3\x8B"=>"\xE7\xB9\xBC", + "\xE3\x8C"=>"\xE7\xB9\xBB", + "\xE3\x8D"=>"\xE7\xBA\x83", + "\xE3\x8E"=>"\xE7\xB7\x95", + "\xE3\x8F"=>"\xE7\xB9\xBD", + "\xE3\x90"=>"\xE8\xBE\xAE", + "\xE3\x91"=>"\xE7\xB9\xBF", + "\xE3\x92"=>"\xE7\xBA\x88", + "\xE3\x93"=>"\xE7\xBA\x89", + "\xE3\x94"=>"\xE7\xBA\x8C", + "\xE3\x95"=>"\xE7\xBA\x92", + "\xE3\x96"=>"\xE7\xBA\x90", + "\xE3\x97"=>"\xE7\xBA\x93", + "\xE3\x98"=>"\xE7\xBA\x94", + "\xE3\x99"=>"\xE7\xBA\x96", + "\xE3\x9A"=>"\xE7\xBA\x8E", + "\xE3\x9B"=>"\xE7\xBA\x9B", + "\xE3\x9C"=>"\xE7\xBA\x9C", + "\xE3\x9D"=>"\xE7\xBC\xB8", + "\xE3\x9E"=>"\xE7\xBC\xBA", + "\xE3\x9F"=>"\xE7\xBD\x85", + "\xE3\xA0"=>"\xE7\xBD\x8C", + "\xE3\xA1"=>"\xE7\xBD\x8D", + "\xE3\xA2"=>"\xE7\xBD\x8E", + "\xE3\xA3"=>"\xE7\xBD\x90", + "\xE3\xA4"=>"\xE7\xBD\x91", + "\xE3\xA5"=>"\xE7\xBD\x95", + "\xE3\xA6"=>"\xE7\xBD\x94", + "\xE3\xA7"=>"\xE7\xBD\x98", + "\xE3\xA8"=>"\xE7\xBD\x9F", + "\xE3\xA9"=>"\xE7\xBD\xA0", + "\xE3\xAA"=>"\xE7\xBD\xA8", + "\xE3\xAB"=>"\xE7\xBD\xA9", + "\xE3\xAC"=>"\xE7\xBD\xA7", + "\xE3\xAD"=>"\xE7\xBD\xB8", + "\xE3\xAE"=>"\xE7\xBE\x82", + "\xE3\xAF"=>"\xE7\xBE\x86", + "\xE3\xB0"=>"\xE7\xBE\x83", + "\xE3\xB1"=>"\xE7\xBE\x88", + "\xE3\xB2"=>"\xE7\xBE\x87", + "\xE3\xB3"=>"\xE7\xBE\x8C", + "\xE3\xB4"=>"\xE7\xBE\x94", + "\xE3\xB5"=>"\xE7\xBE\x9E", + "\xE3\xB6"=>"\xE7\xBE\x9D", + "\xE3\xB7"=>"\xE7\xBE\x9A", + "\xE3\xB8"=>"\xE7\xBE\xA3", + "\xE3\xB9"=>"\xE7\xBE\xAF", + "\xE3\xBA"=>"\xE7\xBE\xB2", + "\xE3\xBB"=>"\xE7\xBE\xB9", + "\xE3\xBC"=>"\xE7\xBE\xAE", + "\xE3\xBD"=>"\xE7\xBE\xB6", + "\xE3\xBE"=>"\xE7\xBE\xB8", + "\xE3\xBF"=>"\xE8\xAD\xB1", + "\xE3\xC0"=>"\xE7\xBF\x85", + "\xE3\xC1"=>"\xE7\xBF\x86", + "\xE3\xC2"=>"\xE7\xBF\x8A", + "\xE3\xC3"=>"\xE7\xBF\x95", + "\xE3\xC4"=>"\xE7\xBF\x94", + "\xE3\xC5"=>"\xE7\xBF\xA1", + "\xE3\xC6"=>"\xE7\xBF\xA6", + "\xE3\xC7"=>"\xE7\xBF\xA9", + "\xE3\xC8"=>"\xE7\xBF\xB3", + "\xE3\xC9"=>"\xE7\xBF\xB9", + "\xE3\xCA"=>"\xE9\xA3\x9C", + "\xE3\xCB"=>"\xE8\x80\x86", + "\xE3\xCC"=>"\xE8\x80\x84", + "\xE3\xCD"=>"\xE8\x80\x8B", + "\xE3\xCE"=>"\xE8\x80\x92", + "\xE3\xCF"=>"\xE8\x80\x98", + "\xE3\xD0"=>"\xE8\x80\x99", + "\xE3\xD1"=>"\xE8\x80\x9C", + "\xE3\xD2"=>"\xE8\x80\xA1", + "\xE3\xD3"=>"\xE8\x80\xA8", + "\xE3\xD4"=>"\xE8\x80\xBF", + "\xE3\xD5"=>"\xE8\x80\xBB", + "\xE3\xD6"=>"\xE8\x81\x8A", + "\xE3\xD7"=>"\xE8\x81\x86", + "\xE3\xD8"=>"\xE8\x81\x92", + "\xE3\xD9"=>"\xE8\x81\x98", + "\xE3\xDA"=>"\xE8\x81\x9A", + "\xE3\xDB"=>"\xE8\x81\x9F", + "\xE3\xDC"=>"\xE8\x81\xA2", + "\xE3\xDD"=>"\xE8\x81\xA8", + "\xE3\xDE"=>"\xE8\x81\xB3", + "\xE3\xDF"=>"\xE8\x81\xB2", + "\xE3\xE0"=>"\xE8\x81\xB0", + "\xE3\xE1"=>"\xE8\x81\xB6", + "\xE3\xE2"=>"\xE8\x81\xB9", + "\xE3\xE3"=>"\xE8\x81\xBD", + "\xE3\xE4"=>"\xE8\x81\xBF", + "\xE3\xE5"=>"\xE8\x82\x84", + "\xE3\xE6"=>"\xE8\x82\x86", + "\xE3\xE7"=>"\xE8\x82\x85", + "\xE3\xE8"=>"\xE8\x82\x9B", + "\xE3\xE9"=>"\xE8\x82\x93", + "\xE3\xEA"=>"\xE8\x82\x9A", + "\xE3\xEB"=>"\xE8\x82\xAD", + "\xE3\xEC"=>"\xE5\x86\x90", + "\xE3\xED"=>"\xE8\x82\xAC", + "\xE3\xEE"=>"\xE8\x83\x9B", + "\xE3\xEF"=>"\xE8\x83\xA5", + "\xE3\xF0"=>"\xE8\x83\x99", + "\xE3\xF1"=>"\xE8\x83\x9D", + "\xE3\xF2"=>"\xE8\x83\x84", + "\xE3\xF3"=>"\xE8\x83\x9A", + "\xE3\xF4"=>"\xE8\x83\x96", + "\xE3\xF5"=>"\xE8\x84\x89", + "\xE3\xF6"=>"\xE8\x83\xAF", + "\xE3\xF7"=>"\xE8\x83\xB1", + "\xE3\xF8"=>"\xE8\x84\x9B", + "\xE3\xF9"=>"\xE8\x84\xA9", + "\xE3\xFA"=>"\xE8\x84\xA3", + "\xE3\xFB"=>"\xE8\x84\xAF", + "\xE3\xFC"=>"\xE8\x85\x8B", + "\xE4\x40"=>"\xE9\x9A\x8B", + "\xE4\x41"=>"\xE8\x85\x86", + "\xE4\x42"=>"\xE8\x84\xBE", + "\xE4\x43"=>"\xE8\x85\x93", + "\xE4\x44"=>"\xE8\x85\x91", + "\xE4\x45"=>"\xE8\x83\xBC", + "\xE4\x46"=>"\xE8\x85\xB1", + "\xE4\x47"=>"\xE8\x85\xAE", + "\xE4\x48"=>"\xE8\x85\xA5", + "\xE4\x49"=>"\xE8\x85\xA6", + "\xE4\x4A"=>"\xE8\x85\xB4", + "\xE4\x4B"=>"\xE8\x86\x83", + "\xE4\x4C"=>"\xE8\x86\x88", + "\xE4\x4D"=>"\xE8\x86\x8A", + "\xE4\x4E"=>"\xE8\x86\x80", + "\xE4\x4F"=>"\xE8\x86\x82", + "\xE4\x50"=>"\xE8\x86\xA0", + "\xE4\x51"=>"\xE8\x86\x95", + "\xE4\x52"=>"\xE8\x86\xA4", + "\xE4\x53"=>"\xE8\x86\xA3", + "\xE4\x54"=>"\xE8\x85\x9F", + "\xE4\x55"=>"\xE8\x86\x93", + "\xE4\x56"=>"\xE8\x86\xA9", + "\xE4\x57"=>"\xE8\x86\xB0", + "\xE4\x58"=>"\xE8\x86\xB5", + "\xE4\x59"=>"\xE8\x86\xBE", + "\xE4\x5A"=>"\xE8\x86\xB8", + "\xE4\x5B"=>"\xE8\x86\xBD", + "\xE4\x5C"=>"\xE8\x87\x80", + "\xE4\x5D"=>"\xE8\x87\x82", + "\xE4\x5E"=>"\xE8\x86\xBA", + "\xE4\x5F"=>"\xE8\x87\x89", + "\xE4\x60"=>"\xE8\x87\x8D", + "\xE4\x61"=>"\xE8\x87\x91", + "\xE4\x62"=>"\xE8\x87\x99", + "\xE4\x63"=>"\xE8\x87\x98", + "\xE4\x64"=>"\xE8\x87\x88", + "\xE4\x65"=>"\xE8\x87\x9A", + "\xE4\x66"=>"\xE8\x87\x9F", + "\xE4\x67"=>"\xE8\x87\xA0", + "\xE4\x68"=>"\xE8\x87\xA7", + "\xE4\x69"=>"\xE8\x87\xBA", + "\xE4\x6A"=>"\xE8\x87\xBB", + "\xE4\x6B"=>"\xE8\x87\xBE", + "\xE4\x6C"=>"\xE8\x88\x81", + "\xE4\x6D"=>"\xE8\x88\x82", + "\xE4\x6E"=>"\xE8\x88\x85", + "\xE4\x6F"=>"\xE8\x88\x87", + "\xE4\x70"=>"\xE8\x88\x8A", + "\xE4\x71"=>"\xE8\x88\x8D", + "\xE4\x72"=>"\xE8\x88\x90", + "\xE4\x73"=>"\xE8\x88\x96", + "\xE4\x74"=>"\xE8\x88\xA9", + "\xE4\x75"=>"\xE8\x88\xAB", + "\xE4\x76"=>"\xE8\x88\xB8", + "\xE4\x77"=>"\xE8\x88\xB3", + "\xE4\x78"=>"\xE8\x89\x80", + "\xE4\x79"=>"\xE8\x89\x99", + "\xE4\x7A"=>"\xE8\x89\x98", + "\xE4\x7B"=>"\xE8\x89\x9D", + "\xE4\x7C"=>"\xE8\x89\x9A", + "\xE4\x7D"=>"\xE8\x89\x9F", + "\xE4\x7E"=>"\xE8\x89\xA4", + "\xE4\x80"=>"\xE8\x89\xA2", + "\xE4\x81"=>"\xE8\x89\xA8", + "\xE4\x82"=>"\xE8\x89\xAA", + "\xE4\x83"=>"\xE8\x89\xAB", + "\xE4\x84"=>"\xE8\x88\xAE", + "\xE4\x85"=>"\xE8\x89\xB1", + "\xE4\x86"=>"\xE8\x89\xB7", + "\xE4\x87"=>"\xE8\x89\xB8", + "\xE4\x88"=>"\xE8\x89\xBE", + "\xE4\x89"=>"\xE8\x8A\x8D", + "\xE4\x8A"=>"\xE8\x8A\x92", + "\xE4\x8B"=>"\xE8\x8A\xAB", + "\xE4\x8C"=>"\xE8\x8A\x9F", + "\xE4\x8D"=>"\xE8\x8A\xBB", + "\xE4\x8E"=>"\xE8\x8A\xAC", + "\xE4\x8F"=>"\xE8\x8B\xA1", + "\xE4\x90"=>"\xE8\x8B\xA3", + "\xE4\x91"=>"\xE8\x8B\x9F", + "\xE4\x92"=>"\xE8\x8B\x92", + "\xE4\x93"=>"\xE8\x8B\xB4", + "\xE4\x94"=>"\xE8\x8B\xB3", + "\xE4\x95"=>"\xE8\x8B\xBA", + "\xE4\x96"=>"\xE8\x8E\x93", + "\xE4\x97"=>"\xE8\x8C\x83", + "\xE4\x98"=>"\xE8\x8B\xBB", + "\xE4\x99"=>"\xE8\x8B\xB9", + "\xE4\x9A"=>"\xE8\x8B\x9E", + "\xE4\x9B"=>"\xE8\x8C\x86", + "\xE4\x9C"=>"\xE8\x8B\x9C", + "\xE4\x9D"=>"\xE8\x8C\x89", + "\xE4\x9E"=>"\xE8\x8B\x99", + "\xE4\x9F"=>"\xE8\x8C\xB5", + "\xE4\xA0"=>"\xE8\x8C\xB4", + "\xE4\xA1"=>"\xE8\x8C\x96", + "\xE4\xA2"=>"\xE8\x8C\xB2", + "\xE4\xA3"=>"\xE8\x8C\xB1", + "\xE4\xA4"=>"\xE8\x8D\x80", + "\xE4\xA5"=>"\xE8\x8C\xB9", + "\xE4\xA6"=>"\xE8\x8D\x90", + "\xE4\xA7"=>"\xE8\x8D\x85", + "\xE4\xA8"=>"\xE8\x8C\xAF", + "\xE4\xA9"=>"\xE8\x8C\xAB", + "\xE4\xAA"=>"\xE8\x8C\x97", + "\xE4\xAB"=>"\xE8\x8C\x98", + "\xE4\xAC"=>"\xE8\x8E\x85", + "\xE4\xAD"=>"\xE8\x8E\x9A", + "\xE4\xAE"=>"\xE8\x8E\xAA", + "\xE4\xAF"=>"\xE8\x8E\x9F", + "\xE4\xB0"=>"\xE8\x8E\xA2", + "\xE4\xB1"=>"\xE8\x8E\x96", + "\xE4\xB2"=>"\xE8\x8C\xA3", + "\xE4\xB3"=>"\xE8\x8E\x8E", + "\xE4\xB4"=>"\xE8\x8E\x87", + "\xE4\xB5"=>"\xE8\x8E\x8A", + "\xE4\xB6"=>"\xE8\x8D\xBC", + "\xE4\xB7"=>"\xE8\x8E\xB5", + "\xE4\xB8"=>"\xE8\x8D\xB3", + "\xE4\xB9"=>"\xE8\x8D\xB5", + "\xE4\xBA"=>"\xE8\x8E\xA0", + "\xE4\xBB"=>"\xE8\x8E\x89", + "\xE4\xBC"=>"\xE8\x8E\xA8", + "\xE4\xBD"=>"\xE8\x8F\xB4", + "\xE4\xBE"=>"\xE8\x90\x93", + "\xE4\xBF"=>"\xE8\x8F\xAB", + "\xE4\xC0"=>"\xE8\x8F\x8E", + "\xE4\xC1"=>"\xE8\x8F\xBD", + "\xE4\xC2"=>"\xE8\x90\x83", + "\xE4\xC3"=>"\xE8\x8F\x98", + "\xE4\xC4"=>"\xE8\x90\x8B", + "\xE4\xC5"=>"\xE8\x8F\x81", + "\xE4\xC6"=>"\xE8\x8F\xB7", + "\xE4\xC7"=>"\xE8\x90\x87", + "\xE4\xC8"=>"\xE8\x8F\xA0", + "\xE4\xC9"=>"\xE8\x8F\xB2", + "\xE4\xCA"=>"\xE8\x90\x8D", + "\xE4\xCB"=>"\xE8\x90\xA2", + "\xE4\xCC"=>"\xE8\x90\xA0", + "\xE4\xCD"=>"\xE8\x8E\xBD", + "\xE4\xCE"=>"\xE8\x90\xB8", + "\xE4\xCF"=>"\xE8\x94\x86", + "\xE4\xD0"=>"\xE8\x8F\xBB", + "\xE4\xD1"=>"\xE8\x91\xAD", + "\xE4\xD2"=>"\xE8\x90\xAA", + "\xE4\xD3"=>"\xE8\x90\xBC", + "\xE4\xD4"=>"\xE8\x95\x9A", + "\xE4\xD5"=>"\xE8\x92\x84", + "\xE4\xD6"=>"\xE8\x91\xB7", + "\xE4\xD7"=>"\xE8\x91\xAB", + "\xE4\xD8"=>"\xE8\x92\xAD", + "\xE4\xD9"=>"\xE8\x91\xAE", + "\xE4\xDA"=>"\xE8\x92\x82", + "\xE4\xDB"=>"\xE8\x91\xA9", + "\xE4\xDC"=>"\xE8\x91\x86", + "\xE4\xDD"=>"\xE8\x90\xAC", + "\xE4\xDE"=>"\xE8\x91\xAF", + "\xE4\xDF"=>"\xE8\x91\xB9", + "\xE4\xE0"=>"\xE8\x90\xB5", + "\xE4\xE1"=>"\xE8\x93\x8A", + "\xE4\xE2"=>"\xE8\x91\xA2", + "\xE4\xE3"=>"\xE8\x92\xB9", + "\xE4\xE4"=>"\xE8\x92\xBF", + "\xE4\xE5"=>"\xE8\x92\x9F", + "\xE4\xE6"=>"\xE8\x93\x99", + "\xE4\xE7"=>"\xE8\x93\x8D", + "\xE4\xE8"=>"\xE8\x92\xBB", + "\xE4\xE9"=>"\xE8\x93\x9A", + "\xE4\xEA"=>"\xE8\x93\x90", + "\xE4\xEB"=>"\xE8\x93\x81", + "\xE4\xEC"=>"\xE8\x93\x86", + "\xE4\xED"=>"\xE8\x93\x96", + "\xE4\xEE"=>"\xE8\x92\xA1", + "\xE4\xEF"=>"\xE8\x94\xA1", + "\xE4\xF0"=>"\xE8\x93\xBF", + "\xE4\xF1"=>"\xE8\x93\xB4", + "\xE4\xF2"=>"\xE8\x94\x97", + "\xE4\xF3"=>"\xE8\x94\x98", + "\xE4\xF4"=>"\xE8\x94\xAC", + "\xE4\xF5"=>"\xE8\x94\x9F", + "\xE4\xF6"=>"\xE8\x94\x95", + "\xE4\xF7"=>"\xE8\x94\x94", + "\xE4\xF8"=>"\xE8\x93\xBC", + "\xE4\xF9"=>"\xE8\x95\x80", + "\xE4\xFA"=>"\xE8\x95\xA3", + "\xE4\xFB"=>"\xE8\x95\x98", + "\xE4\xFC"=>"\xE8\x95\x88", + "\xE5\x40"=>"\xE8\x95\x81", + "\xE5\x41"=>"\xE8\x98\x82", + "\xE5\x42"=>"\xE8\x95\x8B", + "\xE5\x43"=>"\xE8\x95\x95", + "\xE5\x44"=>"\xE8\x96\x80", + "\xE5\x45"=>"\xE8\x96\xA4", + "\xE5\x46"=>"\xE8\x96\x88", + "\xE5\x47"=>"\xE8\x96\x91", + "\xE5\x48"=>"\xE8\x96\x8A", + "\xE5\x49"=>"\xE8\x96\xA8", + "\xE5\x4A"=>"\xE8\x95\xAD", + "\xE5\x4B"=>"\xE8\x96\x94", + "\xE5\x4C"=>"\xE8\x96\x9B", + "\xE5\x4D"=>"\xE8\x97\xAA", + "\xE5\x4E"=>"\xE8\x96\x87", + "\xE5\x4F"=>"\xE8\x96\x9C", + "\xE5\x50"=>"\xE8\x95\xB7", + "\xE5\x51"=>"\xE8\x95\xBE", + "\xE5\x52"=>"\xE8\x96\x90", + "\xE5\x53"=>"\xE8\x97\x89", + "\xE5\x54"=>"\xE8\x96\xBA", + "\xE5\x55"=>"\xE8\x97\x8F", + "\xE5\x56"=>"\xE8\x96\xB9", + "\xE5\x57"=>"\xE8\x97\x90", + "\xE5\x58"=>"\xE8\x97\x95", + "\xE5\x59"=>"\xE8\x97\x9D", + "\xE5\x5A"=>"\xE8\x97\xA5", + "\xE5\x5B"=>"\xE8\x97\x9C", + "\xE5\x5C"=>"\xE8\x97\xB9", + "\xE5\x5D"=>"\xE8\x98\x8A", + "\xE5\x5E"=>"\xE8\x98\x93", + "\xE5\x5F"=>"\xE8\x98\x8B", + "\xE5\x60"=>"\xE8\x97\xBE", + "\xE5\x61"=>"\xE8\x97\xBA", + "\xE5\x62"=>"\xE8\x98\x86", + "\xE5\x63"=>"\xE8\x98\xA2", + "\xE5\x64"=>"\xE8\x98\x9A", + "\xE5\x65"=>"\xE8\x98\xB0", + "\xE5\x66"=>"\xE8\x98\xBF", + "\xE5\x67"=>"\xE8\x99\x8D", + "\xE5\x68"=>"\xE4\xB9\x95", + "\xE5\x69"=>"\xE8\x99\x94", + "\xE5\x6A"=>"\xE8\x99\x9F", + "\xE5\x6B"=>"\xE8\x99\xA7", + "\xE5\x6C"=>"\xE8\x99\xB1", + "\xE5\x6D"=>"\xE8\x9A\x93", + "\xE5\x6E"=>"\xE8\x9A\xA3", + "\xE5\x6F"=>"\xE8\x9A\xA9", + "\xE5\x70"=>"\xE8\x9A\xAA", + "\xE5\x71"=>"\xE8\x9A\x8B", + "\xE5\x72"=>"\xE8\x9A\x8C", + "\xE5\x73"=>"\xE8\x9A\xB6", + "\xE5\x74"=>"\xE8\x9A\xAF", + "\xE5\x75"=>"\xE8\x9B\x84", + "\xE5\x76"=>"\xE8\x9B\x86", + "\xE5\x77"=>"\xE8\x9A\xB0", + "\xE5\x78"=>"\xE8\x9B\x89", + "\xE5\x79"=>"\xE8\xA0\xA3", + "\xE5\x7A"=>"\xE8\x9A\xAB", + "\xE5\x7B"=>"\xE8\x9B\x94", + "\xE5\x7C"=>"\xE8\x9B\x9E", + "\xE5\x7D"=>"\xE8\x9B\xA9", + "\xE5\x7E"=>"\xE8\x9B\xAC", + "\xE5\x80"=>"\xE8\x9B\x9F", + "\xE5\x81"=>"\xE8\x9B\x9B", + "\xE5\x82"=>"\xE8\x9B\xAF", + "\xE5\x83"=>"\xE8\x9C\x92", + "\xE5\x84"=>"\xE8\x9C\x86", + "\xE5\x85"=>"\xE8\x9C\x88", + "\xE5\x86"=>"\xE8\x9C\x80", + "\xE5\x87"=>"\xE8\x9C\x83", + "\xE5\x88"=>"\xE8\x9B\xBB", + "\xE5\x89"=>"\xE8\x9C\x91", + "\xE5\x8A"=>"\xE8\x9C\x89", + "\xE5\x8B"=>"\xE8\x9C\x8D", + "\xE5\x8C"=>"\xE8\x9B\xB9", + "\xE5\x8D"=>"\xE8\x9C\x8A", + "\xE5\x8E"=>"\xE8\x9C\xB4", + "\xE5\x8F"=>"\xE8\x9C\xBF", + "\xE5\x90"=>"\xE8\x9C\xB7", + "\xE5\x91"=>"\xE8\x9C\xBB", + "\xE5\x92"=>"\xE8\x9C\xA5", + "\xE5\x93"=>"\xE8\x9C\xA9", + "\xE5\x94"=>"\xE8\x9C\x9A", + "\xE5\x95"=>"\xE8\x9D\xA0", + "\xE5\x96"=>"\xE8\x9D\x9F", + "\xE5\x97"=>"\xE8\x9D\xB8", + "\xE5\x98"=>"\xE8\x9D\x8C", + "\xE5\x99"=>"\xE8\x9D\x8E", + "\xE5\x9A"=>"\xE8\x9D\xB4", + "\xE5\x9B"=>"\xE8\x9D\x97", + "\xE5\x9C"=>"\xE8\x9D\xA8", + "\xE5\x9D"=>"\xE8\x9D\xAE", + "\xE5\x9E"=>"\xE8\x9D\x99", + "\xE5\x9F"=>"\xE8\x9D\x93", + "\xE5\xA0"=>"\xE8\x9D\xA3", + "\xE5\xA1"=>"\xE8\x9D\xAA", + "\xE5\xA2"=>"\xE8\xA0\x85", + "\xE5\xA3"=>"\xE8\x9E\xA2", + "\xE5\xA4"=>"\xE8\x9E\x9F", + "\xE5\xA5"=>"\xE8\x9E\x82", + "\xE5\xA6"=>"\xE8\x9E\xAF", + "\xE5\xA7"=>"\xE8\x9F\x8B", + "\xE5\xA8"=>"\xE8\x9E\xBD", + "\xE5\xA9"=>"\xE8\x9F\x80", + "\xE5\xAA"=>"\xE8\x9F\x90", + "\xE5\xAB"=>"\xE9\x9B\x96", + "\xE5\xAC"=>"\xE8\x9E\xAB", + "\xE5\xAD"=>"\xE8\x9F\x84", + "\xE5\xAE"=>"\xE8\x9E\xB3", + "\xE5\xAF"=>"\xE8\x9F\x87", + "\xE5\xB0"=>"\xE8\x9F\x86", + "\xE5\xB1"=>"\xE8\x9E\xBB", + "\xE5\xB2"=>"\xE8\x9F\xAF", + "\xE5\xB3"=>"\xE8\x9F\xB2", + "\xE5\xB4"=>"\xE8\x9F\xA0", + "\xE5\xB5"=>"\xE8\xA0\x8F", + "\xE5\xB6"=>"\xE8\xA0\x8D", + "\xE5\xB7"=>"\xE8\x9F\xBE", + "\xE5\xB8"=>"\xE8\x9F\xB6", + "\xE5\xB9"=>"\xE8\x9F\xB7", + "\xE5\xBA"=>"\xE8\xA0\x8E", + "\xE5\xBB"=>"\xE8\x9F\x92", + "\xE5\xBC"=>"\xE8\xA0\x91", + "\xE5\xBD"=>"\xE8\xA0\x96", + "\xE5\xBE"=>"\xE8\xA0\x95", + "\xE5\xBF"=>"\xE8\xA0\xA2", + "\xE5\xC0"=>"\xE8\xA0\xA1", + "\xE5\xC1"=>"\xE8\xA0\xB1", + "\xE5\xC2"=>"\xE8\xA0\xB6", + "\xE5\xC3"=>"\xE8\xA0\xB9", + "\xE5\xC4"=>"\xE8\xA0\xA7", + "\xE5\xC5"=>"\xE8\xA0\xBB", + "\xE5\xC6"=>"\xE8\xA1\x84", + "\xE5\xC7"=>"\xE8\xA1\x82", + "\xE5\xC8"=>"\xE8\xA1\x92", + "\xE5\xC9"=>"\xE8\xA1\x99", + "\xE5\xCA"=>"\xE8\xA1\x9E", + "\xE5\xCB"=>"\xE8\xA1\xA2", + "\xE5\xCC"=>"\xE8\xA1\xAB", + "\xE5\xCD"=>"\xE8\xA2\x81", + "\xE5\xCE"=>"\xE8\xA1\xBE", + "\xE5\xCF"=>"\xE8\xA2\x9E", + "\xE5\xD0"=>"\xE8\xA1\xB5", + "\xE5\xD1"=>"\xE8\xA1\xBD", + "\xE5\xD2"=>"\xE8\xA2\xB5", + "\xE5\xD3"=>"\xE8\xA1\xB2", + "\xE5\xD4"=>"\xE8\xA2\x82", + "\xE5\xD5"=>"\xE8\xA2\x97", + "\xE5\xD6"=>"\xE8\xA2\x92", + "\xE5\xD7"=>"\xE8\xA2\xAE", + "\xE5\xD8"=>"\xE8\xA2\x99", + "\xE5\xD9"=>"\xE8\xA2\xA2", + "\xE5\xDA"=>"\xE8\xA2\x8D", + "\xE5\xDB"=>"\xE8\xA2\xA4", + "\xE5\xDC"=>"\xE8\xA2\xB0", + "\xE5\xDD"=>"\xE8\xA2\xBF", + "\xE5\xDE"=>"\xE8\xA2\xB1", + "\xE5\xDF"=>"\xE8\xA3\x83", + "\xE5\xE0"=>"\xE8\xA3\x84", + "\xE5\xE1"=>"\xE8\xA3\x94", + "\xE5\xE2"=>"\xE8\xA3\x98", + "\xE5\xE3"=>"\xE8\xA3\x99", + "\xE5\xE4"=>"\xE8\xA3\x9D", + "\xE5\xE5"=>"\xE8\xA3\xB9", + "\xE5\xE6"=>"\xE8\xA4\x82", + "\xE5\xE7"=>"\xE8\xA3\xBC", + "\xE5\xE8"=>"\xE8\xA3\xB4", + "\xE5\xE9"=>"\xE8\xA3\xA8", + "\xE5\xEA"=>"\xE8\xA3\xB2", + "\xE5\xEB"=>"\xE8\xA4\x84", + "\xE5\xEC"=>"\xE8\xA4\x8C", + "\xE5\xED"=>"\xE8\xA4\x8A", + "\xE5\xEE"=>"\xE8\xA4\x93", + "\xE5\xEF"=>"\xE8\xA5\x83", + "\xE5\xF0"=>"\xE8\xA4\x9E", + "\xE5\xF1"=>"\xE8\xA4\xA5", + "\xE5\xF2"=>"\xE8\xA4\xAA", + "\xE5\xF3"=>"\xE8\xA4\xAB", + "\xE5\xF4"=>"\xE8\xA5\x81", + "\xE5\xF5"=>"\xE8\xA5\x84", + "\xE5\xF6"=>"\xE8\xA4\xBB", + "\xE5\xF7"=>"\xE8\xA4\xB6", + "\xE5\xF8"=>"\xE8\xA4\xB8", + "\xE5\xF9"=>"\xE8\xA5\x8C", + "\xE5\xFA"=>"\xE8\xA4\x9D", + "\xE5\xFB"=>"\xE8\xA5\xA0", + "\xE5\xFC"=>"\xE8\xA5\x9E", + "\xE6\x40"=>"\xE8\xA5\xA6", + "\xE6\x41"=>"\xE8\xA5\xA4", + "\xE6\x42"=>"\xE8\xA5\xAD", + "\xE6\x43"=>"\xE8\xA5\xAA", + "\xE6\x44"=>"\xE8\xA5\xAF", + "\xE6\x45"=>"\xE8\xA5\xB4", + "\xE6\x46"=>"\xE8\xA5\xB7", + "\xE6\x47"=>"\xE8\xA5\xBE", + "\xE6\x48"=>"\xE8\xA6\x83", + "\xE6\x49"=>"\xE8\xA6\x88", + "\xE6\x4A"=>"\xE8\xA6\x8A", + "\xE6\x4B"=>"\xE8\xA6\x93", + "\xE6\x4C"=>"\xE8\xA6\x98", + "\xE6\x4D"=>"\xE8\xA6\xA1", + "\xE6\x4E"=>"\xE8\xA6\xA9", + "\xE6\x4F"=>"\xE8\xA6\xA6", + "\xE6\x50"=>"\xE8\xA6\xAC", + "\xE6\x51"=>"\xE8\xA6\xAF", + "\xE6\x52"=>"\xE8\xA6\xB2", + "\xE6\x53"=>"\xE8\xA6\xBA", + "\xE6\x54"=>"\xE8\xA6\xBD", + "\xE6\x55"=>"\xE8\xA6\xBF", + "\xE6\x56"=>"\xE8\xA7\x80", + "\xE6\x57"=>"\xE8\xA7\x9A", + "\xE6\x58"=>"\xE8\xA7\x9C", + "\xE6\x59"=>"\xE8\xA7\x9D", + "\xE6\x5A"=>"\xE8\xA7\xA7", + "\xE6\x5B"=>"\xE8\xA7\xB4", + "\xE6\x5C"=>"\xE8\xA7\xB8", + "\xE6\x5D"=>"\xE8\xA8\x83", + "\xE6\x5E"=>"\xE8\xA8\x96", + "\xE6\x5F"=>"\xE8\xA8\x90", + "\xE6\x60"=>"\xE8\xA8\x8C", + "\xE6\x61"=>"\xE8\xA8\x9B", + "\xE6\x62"=>"\xE8\xA8\x9D", + "\xE6\x63"=>"\xE8\xA8\xA5", + "\xE6\x64"=>"\xE8\xA8\xB6", + "\xE6\x65"=>"\xE8\xA9\x81", + "\xE6\x66"=>"\xE8\xA9\x9B", + "\xE6\x67"=>"\xE8\xA9\x92", + "\xE6\x68"=>"\xE8\xA9\x86", + "\xE6\x69"=>"\xE8\xA9\x88", + "\xE6\x6A"=>"\xE8\xA9\xBC", + "\xE6\x6B"=>"\xE8\xA9\xAD", + "\xE6\x6C"=>"\xE8\xA9\xAC", + "\xE6\x6D"=>"\xE8\xA9\xA2", + "\xE6\x6E"=>"\xE8\xAA\x85", + "\xE6\x6F"=>"\xE8\xAA\x82", + "\xE6\x70"=>"\xE8\xAA\x84", + "\xE6\x71"=>"\xE8\xAA\xA8", + "\xE6\x72"=>"\xE8\xAA\xA1", + "\xE6\x73"=>"\xE8\xAA\x91", + "\xE6\x74"=>"\xE8\xAA\xA5", + "\xE6\x75"=>"\xE8\xAA\xA6", + "\xE6\x76"=>"\xE8\xAA\x9A", + "\xE6\x77"=>"\xE8\xAA\xA3", + "\xE6\x78"=>"\xE8\xAB\x84", + "\xE6\x79"=>"\xE8\xAB\x8D", + "\xE6\x7A"=>"\xE8\xAB\x82", + "\xE6\x7B"=>"\xE8\xAB\x9A", + "\xE6\x7C"=>"\xE8\xAB\xAB", + "\xE6\x7D"=>"\xE8\xAB\xB3", + "\xE6\x7E"=>"\xE8\xAB\xA7", + "\xE6\x80"=>"\xE8\xAB\xA4", + "\xE6\x81"=>"\xE8\xAB\xB1", + "\xE6\x82"=>"\xE8\xAC\x94", + "\xE6\x83"=>"\xE8\xAB\xA0", + "\xE6\x84"=>"\xE8\xAB\xA2", + "\xE6\x85"=>"\xE8\xAB\xB7", + "\xE6\x86"=>"\xE8\xAB\x9E", + "\xE6\x87"=>"\xE8\xAB\x9B", + "\xE6\x88"=>"\xE8\xAC\x8C", + "\xE6\x89"=>"\xE8\xAC\x87", + "\xE6\x8A"=>"\xE8\xAC\x9A", + "\xE6\x8B"=>"\xE8\xAB\xA1", + "\xE6\x8C"=>"\xE8\xAC\x96", + "\xE6\x8D"=>"\xE8\xAC\x90", + "\xE6\x8E"=>"\xE8\xAC\x97", + "\xE6\x8F"=>"\xE8\xAC\xA0", + "\xE6\x90"=>"\xE8\xAC\xB3", + "\xE6\x91"=>"\xE9\x9E\xAB", + "\xE6\x92"=>"\xE8\xAC\xA6", + "\xE6\x93"=>"\xE8\xAC\xAB", + "\xE6\x94"=>"\xE8\xAC\xBE", + "\xE6\x95"=>"\xE8\xAC\xA8", + "\xE6\x96"=>"\xE8\xAD\x81", + "\xE6\x97"=>"\xE8\xAD\x8C", + "\xE6\x98"=>"\xE8\xAD\x8F", + "\xE6\x99"=>"\xE8\xAD\x8E", + "\xE6\x9A"=>"\xE8\xAD\x89", + "\xE6\x9B"=>"\xE8\xAD\x96", + "\xE6\x9C"=>"\xE8\xAD\x9B", + "\xE6\x9D"=>"\xE8\xAD\x9A", + "\xE6\x9E"=>"\xE8\xAD\xAB", + "\xE6\x9F"=>"\xE8\xAD\x9F", + "\xE6\xA0"=>"\xE8\xAD\xAC", + "\xE6\xA1"=>"\xE8\xAD\xAF", + "\xE6\xA2"=>"\xE8\xAD\xB4", + "\xE6\xA3"=>"\xE8\xAD\xBD", + "\xE6\xA4"=>"\xE8\xAE\x80", + "\xE6\xA5"=>"\xE8\xAE\x8C", + "\xE6\xA6"=>"\xE8\xAE\x8E", + "\xE6\xA7"=>"\xE8\xAE\x92", + "\xE6\xA8"=>"\xE8\xAE\x93", + "\xE6\xA9"=>"\xE8\xAE\x96", + "\xE6\xAA"=>"\xE8\xAE\x99", + "\xE6\xAB"=>"\xE8\xAE\x9A", + "\xE6\xAC"=>"\xE8\xB0\xBA", + "\xE6\xAD"=>"\xE8\xB1\x81", + "\xE6\xAE"=>"\xE8\xB0\xBF", + "\xE6\xAF"=>"\xE8\xB1\x88", + "\xE6\xB0"=>"\xE8\xB1\x8C", + "\xE6\xB1"=>"\xE8\xB1\x8E", + "\xE6\xB2"=>"\xE8\xB1\x90", + "\xE6\xB3"=>"\xE8\xB1\x95", + "\xE6\xB4"=>"\xE8\xB1\xA2", + "\xE6\xB5"=>"\xE8\xB1\xAC", + "\xE6\xB6"=>"\xE8\xB1\xB8", + "\xE6\xB7"=>"\xE8\xB1\xBA", + "\xE6\xB8"=>"\xE8\xB2\x82", + "\xE6\xB9"=>"\xE8\xB2\x89", + "\xE6\xBA"=>"\xE8\xB2\x85", + "\xE6\xBB"=>"\xE8\xB2\x8A", + "\xE6\xBC"=>"\xE8\xB2\x8D", + "\xE6\xBD"=>"\xE8\xB2\x8E", + "\xE6\xBE"=>"\xE8\xB2\x94", + "\xE6\xBF"=>"\xE8\xB1\xBC", + "\xE6\xC0"=>"\xE8\xB2\x98", + "\xE6\xC1"=>"\xE6\x88\x9D", + "\xE6\xC2"=>"\xE8\xB2\xAD", + "\xE6\xC3"=>"\xE8\xB2\xAA", + "\xE6\xC4"=>"\xE8\xB2\xBD", + "\xE6\xC5"=>"\xE8\xB2\xB2", + "\xE6\xC6"=>"\xE8\xB2\xB3", + "\xE6\xC7"=>"\xE8\xB2\xAE", + "\xE6\xC8"=>"\xE8\xB2\xB6", + "\xE6\xC9"=>"\xE8\xB3\x88", + "\xE6\xCA"=>"\xE8\xB3\x81", + "\xE6\xCB"=>"\xE8\xB3\xA4", + "\xE6\xCC"=>"\xE8\xB3\xA3", + "\xE6\xCD"=>"\xE8\xB3\x9A", + "\xE6\xCE"=>"\xE8\xB3\xBD", + "\xE6\xCF"=>"\xE8\xB3\xBA", + "\xE6\xD0"=>"\xE8\xB3\xBB", + "\xE6\xD1"=>"\xE8\xB4\x84", + "\xE6\xD2"=>"\xE8\xB4\x85", + "\xE6\xD3"=>"\xE8\xB4\x8A", + "\xE6\xD4"=>"\xE8\xB4\x87", + "\xE6\xD5"=>"\xE8\xB4\x8F", + "\xE6\xD6"=>"\xE8\xB4\x8D", + "\xE6\xD7"=>"\xE8\xB4\x90", + "\xE6\xD8"=>"\xE9\xBD\x8E", + "\xE6\xD9"=>"\xE8\xB4\x93", + "\xE6\xDA"=>"\xE8\xB3\x8D", + "\xE6\xDB"=>"\xE8\xB4\x94", + "\xE6\xDC"=>"\xE8\xB4\x96", + "\xE6\xDD"=>"\xE8\xB5\xA7", + "\xE6\xDE"=>"\xE8\xB5\xAD", + "\xE6\xDF"=>"\xE8\xB5\xB1", + "\xE6\xE0"=>"\xE8\xB5\xB3", + "\xE6\xE1"=>"\xE8\xB6\x81", + "\xE6\xE2"=>"\xE8\xB6\x99", + "\xE6\xE3"=>"\xE8\xB7\x82", + "\xE6\xE4"=>"\xE8\xB6\xBE", + "\xE6\xE5"=>"\xE8\xB6\xBA", + "\xE6\xE6"=>"\xE8\xB7\x8F", + "\xE6\xE7"=>"\xE8\xB7\x9A", + "\xE6\xE8"=>"\xE8\xB7\x96", + "\xE6\xE9"=>"\xE8\xB7\x8C", + "\xE6\xEA"=>"\xE8\xB7\x9B", + "\xE6\xEB"=>"\xE8\xB7\x8B", + "\xE6\xEC"=>"\xE8\xB7\xAA", + "\xE6\xED"=>"\xE8\xB7\xAB", + "\xE6\xEE"=>"\xE8\xB7\x9F", + "\xE6\xEF"=>"\xE8\xB7\xA3", + "\xE6\xF0"=>"\xE8\xB7\xBC", + "\xE6\xF1"=>"\xE8\xB8\x88", + "\xE6\xF2"=>"\xE8\xB8\x89", + "\xE6\xF3"=>"\xE8\xB7\xBF", + "\xE6\xF4"=>"\xE8\xB8\x9D", + "\xE6\xF5"=>"\xE8\xB8\x9E", + "\xE6\xF6"=>"\xE8\xB8\x90", + "\xE6\xF7"=>"\xE8\xB8\x9F", + "\xE6\xF8"=>"\xE8\xB9\x82", + "\xE6\xF9"=>"\xE8\xB8\xB5", + "\xE6\xFA"=>"\xE8\xB8\xB0", + "\xE6\xFB"=>"\xE8\xB8\xB4", + "\xE6\xFC"=>"\xE8\xB9\x8A", + "\xE7\x40"=>"\xE8\xB9\x87", + "\xE7\x41"=>"\xE8\xB9\x89", + "\xE7\x42"=>"\xE8\xB9\x8C", + "\xE7\x43"=>"\xE8\xB9\x90", + "\xE7\x44"=>"\xE8\xB9\x88", + "\xE7\x45"=>"\xE8\xB9\x99", + "\xE7\x46"=>"\xE8\xB9\xA4", + "\xE7\x47"=>"\xE8\xB9\xA0", + "\xE7\x48"=>"\xE8\xB8\xAA", + "\xE7\x49"=>"\xE8\xB9\xA3", + "\xE7\x4A"=>"\xE8\xB9\x95", + "\xE7\x4B"=>"\xE8\xB9\xB6", + "\xE7\x4C"=>"\xE8\xB9\xB2", + "\xE7\x4D"=>"\xE8\xB9\xBC", + "\xE7\x4E"=>"\xE8\xBA\x81", + "\xE7\x4F"=>"\xE8\xBA\x87", + "\xE7\x50"=>"\xE8\xBA\x85", + "\xE7\x51"=>"\xE8\xBA\x84", + "\xE7\x52"=>"\xE8\xBA\x8B", + "\xE7\x53"=>"\xE8\xBA\x8A", + "\xE7\x54"=>"\xE8\xBA\x93", + "\xE7\x55"=>"\xE8\xBA\x91", + "\xE7\x56"=>"\xE8\xBA\x94", + "\xE7\x57"=>"\xE8\xBA\x99", + "\xE7\x58"=>"\xE8\xBA\xAA", + "\xE7\x59"=>"\xE8\xBA\xA1", + "\xE7\x5A"=>"\xE8\xBA\xAC", + "\xE7\x5B"=>"\xE8\xBA\xB0", + "\xE7\x5C"=>"\xE8\xBB\x86", + "\xE7\x5D"=>"\xE8\xBA\xB1", + "\xE7\x5E"=>"\xE8\xBA\xBE", + "\xE7\x5F"=>"\xE8\xBB\x85", + "\xE7\x60"=>"\xE8\xBB\x88", + "\xE7\x61"=>"\xE8\xBB\x8B", + "\xE7\x62"=>"\xE8\xBB\x9B", + "\xE7\x63"=>"\xE8\xBB\xA3", + "\xE7\x64"=>"\xE8\xBB\xBC", + "\xE7\x65"=>"\xE8\xBB\xBB", + "\xE7\x66"=>"\xE8\xBB\xAB", + "\xE7\x67"=>"\xE8\xBB\xBE", + "\xE7\x68"=>"\xE8\xBC\x8A", + "\xE7\x69"=>"\xE8\xBC\x85", + "\xE7\x6A"=>"\xE8\xBC\x95", + "\xE7\x6B"=>"\xE8\xBC\x92", + "\xE7\x6C"=>"\xE8\xBC\x99", + "\xE7\x6D"=>"\xE8\xBC\x93", + "\xE7\x6E"=>"\xE8\xBC\x9C", + "\xE7\x6F"=>"\xE8\xBC\x9F", + "\xE7\x70"=>"\xE8\xBC\x9B", + "\xE7\x71"=>"\xE8\xBC\x8C", + "\xE7\x72"=>"\xE8\xBC\xA6", + "\xE7\x73"=>"\xE8\xBC\xB3", + "\xE7\x74"=>"\xE8\xBC\xBB", + "\xE7\x75"=>"\xE8\xBC\xB9", + "\xE7\x76"=>"\xE8\xBD\x85", + "\xE7\x77"=>"\xE8\xBD\x82", + "\xE7\x78"=>"\xE8\xBC\xBE", + "\xE7\x79"=>"\xE8\xBD\x8C", + "\xE7\x7A"=>"\xE8\xBD\x89", + "\xE7\x7B"=>"\xE8\xBD\x86", + "\xE7\x7C"=>"\xE8\xBD\x8E", + "\xE7\x7D"=>"\xE8\xBD\x97", + "\xE7\x7E"=>"\xE8\xBD\x9C", + "\xE7\x80"=>"\xE8\xBD\xA2", + "\xE7\x81"=>"\xE8\xBD\xA3", + "\xE7\x82"=>"\xE8\xBD\xA4", + "\xE7\x83"=>"\xE8\xBE\x9C", + "\xE7\x84"=>"\xE8\xBE\x9F", + "\xE7\x85"=>"\xE8\xBE\xA3", + "\xE7\x86"=>"\xE8\xBE\xAD", + "\xE7\x87"=>"\xE8\xBE\xAF", + "\xE7\x88"=>"\xE8\xBE\xB7", + "\xE7\x89"=>"\xE8\xBF\x9A", + "\xE7\x8A"=>"\xE8\xBF\xA5", + "\xE7\x8B"=>"\xE8\xBF\xA2", + "\xE7\x8C"=>"\xE8\xBF\xAA", + "\xE7\x8D"=>"\xE8\xBF\xAF", + "\xE7\x8E"=>"\xE9\x82\x87", + "\xE7\x8F"=>"\xE8\xBF\xB4", + "\xE7\x90"=>"\xE9\x80\x85", + "\xE7\x91"=>"\xE8\xBF\xB9", + "\xE7\x92"=>"\xE8\xBF\xBA", + "\xE7\x93"=>"\xE9\x80\x91", + "\xE7\x94"=>"\xE9\x80\x95", + "\xE7\x95"=>"\xE9\x80\xA1", + "\xE7\x96"=>"\xE9\x80\x8D", + "\xE7\x97"=>"\xE9\x80\x9E", + "\xE7\x98"=>"\xE9\x80\x96", + "\xE7\x99"=>"\xE9\x80\x8B", + "\xE7\x9A"=>"\xE9\x80\xA7", + "\xE7\x9B"=>"\xE9\x80\xB6", + "\xE7\x9C"=>"\xE9\x80\xB5", + "\xE7\x9D"=>"\xE9\x80\xB9", + "\xE7\x9E"=>"\xE8\xBF\xB8", + "\xE7\x9F"=>"\xE9\x81\x8F", + "\xE7\xA0"=>"\xE9\x81\x90", + "\xE7\xA1"=>"\xE9\x81\x91", + "\xE7\xA2"=>"\xE9\x81\x92", + "\xE7\xA3"=>"\xE9\x80\x8E", + "\xE7\xA4"=>"\xE9\x81\x89", + "\xE7\xA5"=>"\xE9\x80\xBE", + "\xE7\xA6"=>"\xE9\x81\x96", + "\xE7\xA7"=>"\xE9\x81\x98", + "\xE7\xA8"=>"\xE9\x81\x9E", + "\xE7\xA9"=>"\xE9\x81\xA8", + "\xE7\xAA"=>"\xE9\x81\xAF", + "\xE7\xAB"=>"\xE9\x81\xB6", + "\xE7\xAC"=>"\xE9\x9A\xA8", + "\xE7\xAD"=>"\xE9\x81\xB2", + "\xE7\xAE"=>"\xE9\x82\x82", + "\xE7\xAF"=>"\xE9\x81\xBD", + "\xE7\xB0"=>"\xE9\x82\x81", + "\xE7\xB1"=>"\xE9\x82\x80", + "\xE7\xB2"=>"\xE9\x82\x8A", + "\xE7\xB3"=>"\xE9\x82\x89", + "\xE7\xB4"=>"\xE9\x82\x8F", + "\xE7\xB5"=>"\xE9\x82\xA8", + "\xE7\xB6"=>"\xE9\x82\xAF", + "\xE7\xB7"=>"\xE9\x82\xB1", + "\xE7\xB8"=>"\xE9\x82\xB5", + "\xE7\xB9"=>"\xE9\x83\xA2", + "\xE7\xBA"=>"\xE9\x83\xA4", + "\xE7\xBB"=>"\xE6\x89\x88", + "\xE7\xBC"=>"\xE9\x83\x9B", + "\xE7\xBD"=>"\xE9\x84\x82", + "\xE7\xBE"=>"\xE9\x84\x92", + "\xE7\xBF"=>"\xE9\x84\x99", + "\xE7\xC0"=>"\xE9\x84\xB2", + "\xE7\xC1"=>"\xE9\x84\xB0", + "\xE7\xC2"=>"\xE9\x85\x8A", + "\xE7\xC3"=>"\xE9\x85\x96", + "\xE7\xC4"=>"\xE9\x85\x98", + "\xE7\xC5"=>"\xE9\x85\xA3", + "\xE7\xC6"=>"\xE9\x85\xA5", + "\xE7\xC7"=>"\xE9\x85\xA9", + "\xE7\xC8"=>"\xE9\x85\xB3", + "\xE7\xC9"=>"\xE9\x85\xB2", + "\xE7\xCA"=>"\xE9\x86\x8B", + "\xE7\xCB"=>"\xE9\x86\x89", + "\xE7\xCC"=>"\xE9\x86\x82", + "\xE7\xCD"=>"\xE9\x86\xA2", + "\xE7\xCE"=>"\xE9\x86\xAB", + "\xE7\xCF"=>"\xE9\x86\xAF", + "\xE7\xD0"=>"\xE9\x86\xAA", + "\xE7\xD1"=>"\xE9\x86\xB5", + "\xE7\xD2"=>"\xE9\x86\xB4", + "\xE7\xD3"=>"\xE9\x86\xBA", + "\xE7\xD4"=>"\xE9\x87\x80", + "\xE7\xD5"=>"\xE9\x87\x81", + "\xE7\xD6"=>"\xE9\x87\x89", + "\xE7\xD7"=>"\xE9\x87\x8B", + "\xE7\xD8"=>"\xE9\x87\x90", + "\xE7\xD9"=>"\xE9\x87\x96", + "\xE7\xDA"=>"\xE9\x87\x9F", + "\xE7\xDB"=>"\xE9\x87\xA1", + "\xE7\xDC"=>"\xE9\x87\x9B", + "\xE7\xDD"=>"\xE9\x87\xBC", + "\xE7\xDE"=>"\xE9\x87\xB5", + "\xE7\xDF"=>"\xE9\x87\xB6", + "\xE7\xE0"=>"\xE9\x88\x9E", + "\xE7\xE1"=>"\xE9\x87\xBF", + "\xE7\xE2"=>"\xE9\x88\x94", + "\xE7\xE3"=>"\xE9\x88\xAC", + "\xE7\xE4"=>"\xE9\x88\x95", + "\xE7\xE5"=>"\xE9\x88\x91", + "\xE7\xE6"=>"\xE9\x89\x9E", + "\xE7\xE7"=>"\xE9\x89\x97", + "\xE7\xE8"=>"\xE9\x89\x85", + "\xE7\xE9"=>"\xE9\x89\x89", + "\xE7\xEA"=>"\xE9\x89\xA4", + "\xE7\xEB"=>"\xE9\x89\x88", + "\xE7\xEC"=>"\xE9\x8A\x95", + "\xE7\xED"=>"\xE9\x88\xBF", + "\xE7\xEE"=>"\xE9\x89\x8B", + "\xE7\xEF"=>"\xE9\x89\x90", + "\xE7\xF0"=>"\xE9\x8A\x9C", + "\xE7\xF1"=>"\xE9\x8A\x96", + "\xE7\xF2"=>"\xE9\x8A\x93", + "\xE7\xF3"=>"\xE9\x8A\x9B", + "\xE7\xF4"=>"\xE9\x89\x9A", + "\xE7\xF5"=>"\xE9\x8B\x8F", + "\xE7\xF6"=>"\xE9\x8A\xB9", + "\xE7\xF7"=>"\xE9\x8A\xB7", + "\xE7\xF8"=>"\xE9\x8B\xA9", + "\xE7\xF9"=>"\xE9\x8C\x8F", + "\xE7\xFA"=>"\xE9\x8B\xBA", + "\xE7\xFB"=>"\xE9\x8D\x84", + "\xE7\xFC"=>"\xE9\x8C\xAE", + "\xE8\x40"=>"\xE9\x8C\x99", + "\xE8\x41"=>"\xE9\x8C\xA2", + "\xE8\x42"=>"\xE9\x8C\x9A", + "\xE8\x43"=>"\xE9\x8C\xA3", + "\xE8\x44"=>"\xE9\x8C\xBA", + "\xE8\x45"=>"\xE9\x8C\xB5", + "\xE8\x46"=>"\xE9\x8C\xBB", + "\xE8\x47"=>"\xE9\x8D\x9C", + "\xE8\x48"=>"\xE9\x8D\xA0", + "\xE8\x49"=>"\xE9\x8D\xBC", + "\xE8\x4A"=>"\xE9\x8D\xAE", + "\xE8\x4B"=>"\xE9\x8D\x96", + "\xE8\x4C"=>"\xE9\x8E\xB0", + "\xE8\x4D"=>"\xE9\x8E\xAC", + "\xE8\x4E"=>"\xE9\x8E\xAD", + "\xE8\x4F"=>"\xE9\x8E\x94", + "\xE8\x50"=>"\xE9\x8E\xB9", + "\xE8\x51"=>"\xE9\x8F\x96", + "\xE8\x52"=>"\xE9\x8F\x97", + "\xE8\x53"=>"\xE9\x8F\xA8", + "\xE8\x54"=>"\xE9\x8F\xA5", + "\xE8\x55"=>"\xE9\x8F\x98", + "\xE8\x56"=>"\xE9\x8F\x83", + "\xE8\x57"=>"\xE9\x8F\x9D", + "\xE8\x58"=>"\xE9\x8F\x90", + "\xE8\x59"=>"\xE9\x8F\x88", + "\xE8\x5A"=>"\xE9\x8F\xA4", + "\xE8\x5B"=>"\xE9\x90\x9A", + "\xE8\x5C"=>"\xE9\x90\x94", + "\xE8\x5D"=>"\xE9\x90\x93", + "\xE8\x5E"=>"\xE9\x90\x83", + "\xE8\x5F"=>"\xE9\x90\x87", + "\xE8\x60"=>"\xE9\x90\x90", + "\xE8\x61"=>"\xE9\x90\xB6", + "\xE8\x62"=>"\xE9\x90\xAB", + "\xE8\x63"=>"\xE9\x90\xB5", + "\xE8\x64"=>"\xE9\x90\xA1", + "\xE8\x65"=>"\xE9\x90\xBA", + "\xE8\x66"=>"\xE9\x91\x81", + "\xE8\x67"=>"\xE9\x91\x92", + "\xE8\x68"=>"\xE9\x91\x84", + "\xE8\x69"=>"\xE9\x91\x9B", + "\xE8\x6A"=>"\xE9\x91\xA0", + "\xE8\x6B"=>"\xE9\x91\xA2", + "\xE8\x6C"=>"\xE9\x91\x9E", + "\xE8\x6D"=>"\xE9\x91\xAA", + "\xE8\x6E"=>"\xE9\x88\xA9", + "\xE8\x6F"=>"\xE9\x91\xB0", + "\xE8\x70"=>"\xE9\x91\xB5", + "\xE8\x71"=>"\xE9\x91\xB7", + "\xE8\x72"=>"\xE9\x91\xBD", + "\xE8\x73"=>"\xE9\x91\x9A", + "\xE8\x74"=>"\xE9\x91\xBC", + "\xE8\x75"=>"\xE9\x91\xBE", + "\xE8\x76"=>"\xE9\x92\x81", + "\xE8\x77"=>"\xE9\x91\xBF", + "\xE8\x78"=>"\xE9\x96\x82", + "\xE8\x79"=>"\xE9\x96\x87", + "\xE8\x7A"=>"\xE9\x96\x8A", + "\xE8\x7B"=>"\xE9\x96\x94", + "\xE8\x7C"=>"\xE9\x96\x96", + "\xE8\x7D"=>"\xE9\x96\x98", + "\xE8\x7E"=>"\xE9\x96\x99", + "\xE8\x80"=>"\xE9\x96\xA0", + "\xE8\x81"=>"\xE9\x96\xA8", + "\xE8\x82"=>"\xE9\x96\xA7", + "\xE8\x83"=>"\xE9\x96\xAD", + "\xE8\x84"=>"\xE9\x96\xBC", + "\xE8\x85"=>"\xE9\x96\xBB", + "\xE8\x86"=>"\xE9\x96\xB9", + "\xE8\x87"=>"\xE9\x96\xBE", + "\xE8\x88"=>"\xE9\x97\x8A", + "\xE8\x89"=>"\xE6\xBF\xB6", + "\xE8\x8A"=>"\xE9\x97\x83", + "\xE8\x8B"=>"\xE9\x97\x8D", + "\xE8\x8C"=>"\xE9\x97\x8C", + "\xE8\x8D"=>"\xE9\x97\x95", + "\xE8\x8E"=>"\xE9\x97\x94", + "\xE8\x8F"=>"\xE9\x97\x96", + "\xE8\x90"=>"\xE9\x97\x9C", + "\xE8\x91"=>"\xE9\x97\xA1", + "\xE8\x92"=>"\xE9\x97\xA5", + "\xE8\x93"=>"\xE9\x97\xA2", + "\xE8\x94"=>"\xE9\x98\xA1", + "\xE8\x95"=>"\xE9\x98\xA8", + "\xE8\x96"=>"\xE9\x98\xAE", + "\xE8\x97"=>"\xE9\x98\xAF", + "\xE8\x98"=>"\xE9\x99\x82", + "\xE8\x99"=>"\xE9\x99\x8C", + "\xE8\x9A"=>"\xE9\x99\x8F", + "\xE8\x9B"=>"\xE9\x99\x8B", + "\xE8\x9C"=>"\xE9\x99\xB7", + "\xE8\x9D"=>"\xE9\x99\x9C", + "\xE8\x9E"=>"\xE9\x99\x9E", + "\xE8\x9F"=>"\xE9\x99\x9D", + "\xE8\xA0"=>"\xE9\x99\x9F", + "\xE8\xA1"=>"\xE9\x99\xA6", + "\xE8\xA2"=>"\xE9\x99\xB2", + "\xE8\xA3"=>"\xE9\x99\xAC", + "\xE8\xA4"=>"\xE9\x9A\x8D", + "\xE8\xA5"=>"\xE9\x9A\x98", + "\xE8\xA6"=>"\xE9\x9A\x95", + "\xE8\xA7"=>"\xE9\x9A\x97", + "\xE8\xA8"=>"\xE9\x9A\xAA", + "\xE8\xA9"=>"\xE9\x9A\xA7", + "\xE8\xAA"=>"\xE9\x9A\xB1", + "\xE8\xAB"=>"\xE9\x9A\xB2", + "\xE8\xAC"=>"\xE9\x9A\xB0", + "\xE8\xAD"=>"\xE9\x9A\xB4", + "\xE8\xAE"=>"\xE9\x9A\xB6", + "\xE8\xAF"=>"\xE9\x9A\xB8", + "\xE8\xB0"=>"\xE9\x9A\xB9", + "\xE8\xB1"=>"\xE9\x9B\x8E", + "\xE8\xB2"=>"\xE9\x9B\x8B", + "\xE8\xB3"=>"\xE9\x9B\x89", + "\xE8\xB4"=>"\xE9\x9B\x8D", + "\xE8\xB5"=>"\xE8\xA5\x8D", + "\xE8\xB6"=>"\xE9\x9B\x9C", + "\xE8\xB7"=>"\xE9\x9C\x8D", + "\xE8\xB8"=>"\xE9\x9B\x95", + "\xE8\xB9"=>"\xE9\x9B\xB9", + "\xE8\xBA"=>"\xE9\x9C\x84", + "\xE8\xBB"=>"\xE9\x9C\x86", + "\xE8\xBC"=>"\xE9\x9C\x88", + "\xE8\xBD"=>"\xE9\x9C\x93", + "\xE8\xBE"=>"\xE9\x9C\x8E", + "\xE8\xBF"=>"\xE9\x9C\x91", + "\xE8\xC0"=>"\xE9\x9C\x8F", + "\xE8\xC1"=>"\xE9\x9C\x96", + "\xE8\xC2"=>"\xE9\x9C\x99", + "\xE8\xC3"=>"\xE9\x9C\xA4", + "\xE8\xC4"=>"\xE9\x9C\xAA", + "\xE8\xC5"=>"\xE9\x9C\xB0", + "\xE8\xC6"=>"\xE9\x9C\xB9", + "\xE8\xC7"=>"\xE9\x9C\xBD", + "\xE8\xC8"=>"\xE9\x9C\xBE", + "\xE8\xC9"=>"\xE9\x9D\x84", + "\xE8\xCA"=>"\xE9\x9D\x86", + "\xE8\xCB"=>"\xE9\x9D\x88", + "\xE8\xCC"=>"\xE9\x9D\x82", + "\xE8\xCD"=>"\xE9\x9D\x89", + "\xE8\xCE"=>"\xE9\x9D\x9C", + "\xE8\xCF"=>"\xE9\x9D\xA0", + "\xE8\xD0"=>"\xE9\x9D\xA4", + "\xE8\xD1"=>"\xE9\x9D\xA6", + "\xE8\xD2"=>"\xE9\x9D\xA8", + "\xE8\xD3"=>"\xE5\x8B\x92", + "\xE8\xD4"=>"\xE9\x9D\xAB", + "\xE8\xD5"=>"\xE9\x9D\xB1", + "\xE8\xD6"=>"\xE9\x9D\xB9", + "\xE8\xD7"=>"\xE9\x9E\x85", + "\xE8\xD8"=>"\xE9\x9D\xBC", + "\xE8\xD9"=>"\xE9\x9E\x81", + "\xE8\xDA"=>"\xE9\x9D\xBA", + "\xE8\xDB"=>"\xE9\x9E\x86", + "\xE8\xDC"=>"\xE9\x9E\x8B", + "\xE8\xDD"=>"\xE9\x9E\x8F", + "\xE8\xDE"=>"\xE9\x9E\x90", + "\xE8\xDF"=>"\xE9\x9E\x9C", + "\xE8\xE0"=>"\xE9\x9E\xA8", + "\xE8\xE1"=>"\xE9\x9E\xA6", + "\xE8\xE2"=>"\xE9\x9E\xA3", + "\xE8\xE3"=>"\xE9\x9E\xB3", + "\xE8\xE4"=>"\xE9\x9E\xB4", + "\xE8\xE5"=>"\xE9\x9F\x83", + "\xE8\xE6"=>"\xE9\x9F\x86", + "\xE8\xE7"=>"\xE9\x9F\x88", + "\xE8\xE8"=>"\xE9\x9F\x8B", + "\xE8\xE9"=>"\xE9\x9F\x9C", + "\xE8\xEA"=>"\xE9\x9F\xAD", + "\xE8\xEB"=>"\xE9\xBD\x8F", + "\xE8\xEC"=>"\xE9\x9F\xB2", + "\xE8\xED"=>"\xE7\xAB\x9F", + "\xE8\xEE"=>"\xE9\x9F\xB6", + "\xE8\xEF"=>"\xE9\x9F\xB5", + "\xE8\xF0"=>"\xE9\xA0\x8F", + "\xE8\xF1"=>"\xE9\xA0\x8C", + "\xE8\xF2"=>"\xE9\xA0\xB8", + "\xE8\xF3"=>"\xE9\xA0\xA4", + "\xE8\xF4"=>"\xE9\xA0\xA1", + "\xE8\xF5"=>"\xE9\xA0\xB7", + "\xE8\xF6"=>"\xE9\xA0\xBD", + "\xE8\xF7"=>"\xE9\xA1\x86", + "\xE8\xF8"=>"\xE9\xA1\x8F", + "\xE8\xF9"=>"\xE9\xA1\x8B", + "\xE8\xFA"=>"\xE9\xA1\xAB", + "\xE8\xFB"=>"\xE9\xA1\xAF", + "\xE8\xFC"=>"\xE9\xA1\xB0", + "\xE9\x40"=>"\xE9\xA1\xB1", + "\xE9\x41"=>"\xE9\xA1\xB4", + "\xE9\x42"=>"\xE9\xA1\xB3", + "\xE9\x43"=>"\xE9\xA2\xAA", + "\xE9\x44"=>"\xE9\xA2\xAF", + "\xE9\x45"=>"\xE9\xA2\xB1", + "\xE9\x46"=>"\xE9\xA2\xB6", + "\xE9\x47"=>"\xE9\xA3\x84", + "\xE9\x48"=>"\xE9\xA3\x83", + "\xE9\x49"=>"\xE9\xA3\x86", + "\xE9\x4A"=>"\xE9\xA3\xA9", + "\xE9\x4B"=>"\xE9\xA3\xAB", + "\xE9\x4C"=>"\xE9\xA4\x83", + "\xE9\x4D"=>"\xE9\xA4\x89", + "\xE9\x4E"=>"\xE9\xA4\x92", + "\xE9\x4F"=>"\xE9\xA4\x94", + "\xE9\x50"=>"\xE9\xA4\x98", + "\xE9\x51"=>"\xE9\xA4\xA1", + "\xE9\x52"=>"\xE9\xA4\x9D", + "\xE9\x53"=>"\xE9\xA4\x9E", + "\xE9\x54"=>"\xE9\xA4\xA4", + "\xE9\x55"=>"\xE9\xA4\xA0", + "\xE9\x56"=>"\xE9\xA4\xAC", + "\xE9\x57"=>"\xE9\xA4\xAE", + "\xE9\x58"=>"\xE9\xA4\xBD", + "\xE9\x59"=>"\xE9\xA4\xBE", + "\xE9\x5A"=>"\xE9\xA5\x82", + "\xE9\x5B"=>"\xE9\xA5\x89", + "\xE9\x5C"=>"\xE9\xA5\x85", + "\xE9\x5D"=>"\xE9\xA5\x90", + "\xE9\x5E"=>"\xE9\xA5\x8B", + "\xE9\x5F"=>"\xE9\xA5\x91", + "\xE9\x60"=>"\xE9\xA5\x92", + "\xE9\x61"=>"\xE9\xA5\x8C", + "\xE9\x62"=>"\xE9\xA5\x95", + "\xE9\x63"=>"\xE9\xA6\x97", + "\xE9\x64"=>"\xE9\xA6\x98", + "\xE9\x65"=>"\xE9\xA6\xA5", + "\xE9\x66"=>"\xE9\xA6\xAD", + "\xE9\x67"=>"\xE9\xA6\xAE", + "\xE9\x68"=>"\xE9\xA6\xBC", + "\xE9\x69"=>"\xE9\xA7\x9F", + "\xE9\x6A"=>"\xE9\xA7\x9B", + "\xE9\x6B"=>"\xE9\xA7\x9D", + "\xE9\x6C"=>"\xE9\xA7\x98", + "\xE9\x6D"=>"\xE9\xA7\x91", + "\xE9\x6E"=>"\xE9\xA7\xAD", + "\xE9\x6F"=>"\xE9\xA7\xAE", + "\xE9\x70"=>"\xE9\xA7\xB1", + "\xE9\x71"=>"\xE9\xA7\xB2", + "\xE9\x72"=>"\xE9\xA7\xBB", + "\xE9\x73"=>"\xE9\xA7\xB8", + "\xE9\x74"=>"\xE9\xA8\x81", + "\xE9\x75"=>"\xE9\xA8\x8F", + "\xE9\x76"=>"\xE9\xA8\x85", + "\xE9\x77"=>"\xE9\xA7\xA2", + "\xE9\x78"=>"\xE9\xA8\x99", + "\xE9\x79"=>"\xE9\xA8\xAB", + "\xE9\x7A"=>"\xE9\xA8\xB7", + "\xE9\x7B"=>"\xE9\xA9\x85", + "\xE9\x7C"=>"\xE9\xA9\x82", + "\xE9\x7D"=>"\xE9\xA9\x80", + "\xE9\x7E"=>"\xE9\xA9\x83", + "\xE9\x80"=>"\xE9\xA8\xBE", + "\xE9\x81"=>"\xE9\xA9\x95", + "\xE9\x82"=>"\xE9\xA9\x8D", + "\xE9\x83"=>"\xE9\xA9\x9B", + "\xE9\x84"=>"\xE9\xA9\x97", + "\xE9\x85"=>"\xE9\xA9\x9F", + "\xE9\x86"=>"\xE9\xA9\xA2", + "\xE9\x87"=>"\xE9\xA9\xA5", + "\xE9\x88"=>"\xE9\xA9\xA4", + "\xE9\x89"=>"\xE9\xA9\xA9", + "\xE9\x8A"=>"\xE9\xA9\xAB", + "\xE9\x8B"=>"\xE9\xA9\xAA", + "\xE9\x8C"=>"\xE9\xAA\xAD", + "\xE9\x8D"=>"\xE9\xAA\xB0", + "\xE9\x8E"=>"\xE9\xAA\xBC", + "\xE9\x8F"=>"\xE9\xAB\x80", + "\xE9\x90"=>"\xE9\xAB\x8F", + "\xE9\x91"=>"\xE9\xAB\x91", + "\xE9\x92"=>"\xE9\xAB\x93", + "\xE9\x93"=>"\xE9\xAB\x94", + "\xE9\x94"=>"\xE9\xAB\x9E", + "\xE9\x95"=>"\xE9\xAB\x9F", + "\xE9\x96"=>"\xE9\xAB\xA2", + "\xE9\x97"=>"\xE9\xAB\xA3", + "\xE9\x98"=>"\xE9\xAB\xA6", + "\xE9\x99"=>"\xE9\xAB\xAF", + "\xE9\x9A"=>"\xE9\xAB\xAB", + "\xE9\x9B"=>"\xE9\xAB\xAE", + "\xE9\x9C"=>"\xE9\xAB\xB4", + "\xE9\x9D"=>"\xE9\xAB\xB1", + "\xE9\x9E"=>"\xE9\xAB\xB7", + "\xE9\x9F"=>"\xE9\xAB\xBB", + "\xE9\xA0"=>"\xE9\xAC\x86", + "\xE9\xA1"=>"\xE9\xAC\x98", + "\xE9\xA2"=>"\xE9\xAC\x9A", + "\xE9\xA3"=>"\xE9\xAC\x9F", + "\xE9\xA4"=>"\xE9\xAC\xA2", + "\xE9\xA5"=>"\xE9\xAC\xA3", + "\xE9\xA6"=>"\xE9\xAC\xA5", + "\xE9\xA7"=>"\xE9\xAC\xA7", + "\xE9\xA8"=>"\xE9\xAC\xA8", + "\xE9\xA9"=>"\xE9\xAC\xA9", + "\xE9\xAA"=>"\xE9\xAC\xAA", + "\xE9\xAB"=>"\xE9\xAC\xAE", + "\xE9\xAC"=>"\xE9\xAC\xAF", + "\xE9\xAD"=>"\xE9\xAC\xB2", + "\xE9\xAE"=>"\xE9\xAD\x84", + "\xE9\xAF"=>"\xE9\xAD\x83", + "\xE9\xB0"=>"\xE9\xAD\x8F", + "\xE9\xB1"=>"\xE9\xAD\x8D", + "\xE9\xB2"=>"\xE9\xAD\x8E", + "\xE9\xB3"=>"\xE9\xAD\x91", + "\xE9\xB4"=>"\xE9\xAD\x98", + "\xE9\xB5"=>"\xE9\xAD\xB4", + "\xE9\xB6"=>"\xE9\xAE\x93", + "\xE9\xB7"=>"\xE9\xAE\x83", + "\xE9\xB8"=>"\xE9\xAE\x91", + "\xE9\xB9"=>"\xE9\xAE\x96", + "\xE9\xBA"=>"\xE9\xAE\x97", + "\xE9\xBB"=>"\xE9\xAE\x9F", + "\xE9\xBC"=>"\xE9\xAE\xA0", + "\xE9\xBD"=>"\xE9\xAE\xA8", + "\xE9\xBE"=>"\xE9\xAE\xB4", + "\xE9\xBF"=>"\xE9\xAF\x80", + "\xE9\xC0"=>"\xE9\xAF\x8A", + "\xE9\xC1"=>"\xE9\xAE\xB9", + "\xE9\xC2"=>"\xE9\xAF\x86", + "\xE9\xC3"=>"\xE9\xAF\x8F", + "\xE9\xC4"=>"\xE9\xAF\x91", + "\xE9\xC5"=>"\xE9\xAF\x92", + "\xE9\xC6"=>"\xE9\xAF\xA3", + "\xE9\xC7"=>"\xE9\xAF\xA2", + "\xE9\xC8"=>"\xE9\xAF\xA4", + "\xE9\xC9"=>"\xE9\xAF\x94", + "\xE9\xCA"=>"\xE9\xAF\xA1", + "\xE9\xCB"=>"\xE9\xB0\xBA", + "\xE9\xCC"=>"\xE9\xAF\xB2", + "\xE9\xCD"=>"\xE9\xAF\xB1", + "\xE9\xCE"=>"\xE9\xAF\xB0", + "\xE9\xCF"=>"\xE9\xB0\x95", + "\xE9\xD0"=>"\xE9\xB0\x94", + "\xE9\xD1"=>"\xE9\xB0\x89", + "\xE9\xD2"=>"\xE9\xB0\x93", + "\xE9\xD3"=>"\xE9\xB0\x8C", + "\xE9\xD4"=>"\xE9\xB0\x86", + "\xE9\xD5"=>"\xE9\xB0\x88", + "\xE9\xD6"=>"\xE9\xB0\x92", + "\xE9\xD7"=>"\xE9\xB0\x8A", + "\xE9\xD8"=>"\xE9\xB0\x84", + "\xE9\xD9"=>"\xE9\xB0\xAE", + "\xE9\xDA"=>"\xE9\xB0\x9B", + "\xE9\xDB"=>"\xE9\xB0\xA5", + "\xE9\xDC"=>"\xE9\xB0\xA4", + "\xE9\xDD"=>"\xE9\xB0\xA1", + "\xE9\xDE"=>"\xE9\xB0\xB0", + "\xE9\xDF"=>"\xE9\xB1\x87", + "\xE9\xE0"=>"\xE9\xB0\xB2", + "\xE9\xE1"=>"\xE9\xB1\x86", + "\xE9\xE2"=>"\xE9\xB0\xBE", + "\xE9\xE3"=>"\xE9\xB1\x9A", + "\xE9\xE4"=>"\xE9\xB1\xA0", + "\xE9\xE5"=>"\xE9\xB1\xA7", + "\xE9\xE6"=>"\xE9\xB1\xB6", + "\xE9\xE7"=>"\xE9\xB1\xB8", + "\xE9\xE8"=>"\xE9\xB3\xA7", + "\xE9\xE9"=>"\xE9\xB3\xAC", + "\xE9\xEA"=>"\xE9\xB3\xB0", + "\xE9\xEB"=>"\xE9\xB4\x89", + "\xE9\xEC"=>"\xE9\xB4\x88", + "\xE9\xED"=>"\xE9\xB3\xAB", + "\xE9\xEE"=>"\xE9\xB4\x83", + "\xE9\xEF"=>"\xE9\xB4\x86", + "\xE9\xF0"=>"\xE9\xB4\xAA", + "\xE9\xF1"=>"\xE9\xB4\xA6", + "\xE9\xF2"=>"\xE9\xB6\xAF", + "\xE9\xF3"=>"\xE9\xB4\xA3", + "\xE9\xF4"=>"\xE9\xB4\x9F", + "\xE9\xF5"=>"\xE9\xB5\x84", + "\xE9\xF6"=>"\xE9\xB4\x95", + "\xE9\xF7"=>"\xE9\xB4\x92", + "\xE9\xF8"=>"\xE9\xB5\x81", + "\xE9\xF9"=>"\xE9\xB4\xBF", + "\xE9\xFA"=>"\xE9\xB4\xBE", + "\xE9\xFB"=>"\xE9\xB5\x86", + "\xE9\xFC"=>"\xE9\xB5\x88", + "\xEA\x40"=>"\xE9\xB5\x9D", + "\xEA\x41"=>"\xE9\xB5\x9E", + "\xEA\x42"=>"\xE9\xB5\xA4", + "\xEA\x43"=>"\xE9\xB5\x91", + "\xEA\x44"=>"\xE9\xB5\x90", + "\xEA\x45"=>"\xE9\xB5\x99", + "\xEA\x46"=>"\xE9\xB5\xB2", + "\xEA\x47"=>"\xE9\xB6\x89", + "\xEA\x48"=>"\xE9\xB6\x87", + "\xEA\x49"=>"\xE9\xB6\xAB", + "\xEA\x4A"=>"\xE9\xB5\xAF", + "\xEA\x4B"=>"\xE9\xB5\xBA", + "\xEA\x4C"=>"\xE9\xB6\x9A", + "\xEA\x4D"=>"\xE9\xB6\xA4", + "\xEA\x4E"=>"\xE9\xB6\xA9", + "\xEA\x4F"=>"\xE9\xB6\xB2", + "\xEA\x50"=>"\xE9\xB7\x84", + "\xEA\x51"=>"\xE9\xB7\x81", + "\xEA\x52"=>"\xE9\xB6\xBB", + "\xEA\x53"=>"\xE9\xB6\xB8", + "\xEA\x54"=>"\xE9\xB6\xBA", + "\xEA\x55"=>"\xE9\xB7\x86", + "\xEA\x56"=>"\xE9\xB7\x8F", + "\xEA\x57"=>"\xE9\xB7\x82", + "\xEA\x58"=>"\xE9\xB7\x99", + "\xEA\x59"=>"\xE9\xB7\x93", + "\xEA\x5A"=>"\xE9\xB7\xB8", + "\xEA\x5B"=>"\xE9\xB7\xA6", + "\xEA\x5C"=>"\xE9\xB7\xAD", + "\xEA\x5D"=>"\xE9\xB7\xAF", + "\xEA\x5E"=>"\xE9\xB7\xBD", + "\xEA\x5F"=>"\xE9\xB8\x9A", + "\xEA\x60"=>"\xE9\xB8\x9B", + "\xEA\x61"=>"\xE9\xB8\x9E", + "\xEA\x62"=>"\xE9\xB9\xB5", + "\xEA\x63"=>"\xE9\xB9\xB9", + "\xEA\x64"=>"\xE9\xB9\xBD", + "\xEA\x65"=>"\xE9\xBA\x81", + "\xEA\x66"=>"\xE9\xBA\x88", + "\xEA\x67"=>"\xE9\xBA\x8B", + "\xEA\x68"=>"\xE9\xBA\x8C", + "\xEA\x69"=>"\xE9\xBA\x92", + "\xEA\x6A"=>"\xE9\xBA\x95", + "\xEA\x6B"=>"\xE9\xBA\x91", + "\xEA\x6C"=>"\xE9\xBA\x9D", + "\xEA\x6D"=>"\xE9\xBA\xA5", + "\xEA\x6E"=>"\xE9\xBA\xA9", + "\xEA\x6F"=>"\xE9\xBA\xB8", + "\xEA\x70"=>"\xE9\xBA\xAA", + "\xEA\x71"=>"\xE9\xBA\xAD", + "\xEA\x72"=>"\xE9\x9D\xA1", + "\xEA\x73"=>"\xE9\xBB\x8C", + "\xEA\x74"=>"\xE9\xBB\x8E", + "\xEA\x75"=>"\xE9\xBB\x8F", + "\xEA\x76"=>"\xE9\xBB\x90", + "\xEA\x77"=>"\xE9\xBB\x94", + "\xEA\x78"=>"\xE9\xBB\x9C", + "\xEA\x79"=>"\xE9\xBB\x9E", + "\xEA\x7A"=>"\xE9\xBB\x9D", + "\xEA\x7B"=>"\xE9\xBB\xA0", + "\xEA\x7C"=>"\xE9\xBB\xA5", + "\xEA\x7D"=>"\xE9\xBB\xA8", + "\xEA\x7E"=>"\xE9\xBB\xAF", + "\xEA\x80"=>"\xE9\xBB\xB4", + "\xEA\x81"=>"\xE9\xBB\xB6", + "\xEA\x82"=>"\xE9\xBB\xB7", + "\xEA\x83"=>"\xE9\xBB\xB9", + "\xEA\x84"=>"\xE9\xBB\xBB", + "\xEA\x85"=>"\xE9\xBB\xBC", + "\xEA\x86"=>"\xE9\xBB\xBD", + "\xEA\x87"=>"\xE9\xBC\x87", + "\xEA\x88"=>"\xE9\xBC\x88", + "\xEA\x89"=>"\xE7\x9A\xB7", + "\xEA\x8A"=>"\xE9\xBC\x95", + "\xEA\x8B"=>"\xE9\xBC\xA1", + "\xEA\x8C"=>"\xE9\xBC\xAC", + "\xEA\x8D"=>"\xE9\xBC\xBE", + "\xEA\x8E"=>"\xE9\xBD\x8A", + "\xEA\x8F"=>"\xE9\xBD\x92", + "\xEA\x90"=>"\xE9\xBD\x94", + "\xEA\x91"=>"\xE9\xBD\xA3", + "\xEA\x92"=>"\xE9\xBD\x9F", + "\xEA\x93"=>"\xE9\xBD\xA0", + "\xEA\x94"=>"\xE9\xBD\xA1", + "\xEA\x95"=>"\xE9\xBD\xA6", + "\xEA\x96"=>"\xE9\xBD\xA7", + "\xEA\x97"=>"\xE9\xBD\xAC", + "\xEA\x98"=>"\xE9\xBD\xAA", + "\xEA\x99"=>"\xE9\xBD\xB7", + "\xEA\x9A"=>"\xE9\xBD\xB2", + "\xEA\x9B"=>"\xE9\xBD\xB6", + "\xEA\x9C"=>"\xE9\xBE\x95", + "\xEA\x9D"=>"\xE9\xBE\x9C", + "\xEA\x9E"=>"\xE9\xBE\xA0", + "\xEA\x9F"=>"\xE5\xA0\xAF", + "\xEA\xA0"=>"\xE6\xA7\x87", + "\xEA\xA1"=>"\xE9\x81\x99", + "\xEA\xA2"=>"\xE7\x91\xA4", + "\xEA\xA3"=>"\xE5\x87\x9C", + "\xEA\xA4"=>"\xE7\x86\x99" + ); + return strtr($string, $transform); +} + +function euc_kr($string) +{ + static $transform = array( + "\x5c" => "\xE2\x82\xA9", // KX X 1001 + "\x81\x41" => "\xEA\xB0\x82", + "\x81\x42" => "\xEA\xB0\x83", + "\x81\x43" => "\xEA\xB0\x85", + "\x81\x44" => "\xEA\xB0\x86", + "\x81\x45" => "\xEA\xB0\x8B", + "\x81\x46" => "\xEA\xB0\x8C", + "\x81\x47" => "\xEA\xB0\x8D", + "\x81\x48" => "\xEA\xB0\x8E", + "\x81\x49" => "\xEA\xB0\x8F", + "\x81\x4A" => "\xEA\xB0\x98", + "\x81\x4B" => "\xEA\xB0\x9E", + "\x81\x4C" => "\xEA\xB0\x9F", + "\x81\x4D" => "\xEA\xB0\xA1", + "\x81\x4E" => "\xEA\xB0\xA2", + "\x81\x4F" => "\xEA\xB0\xA3", + "\x81\x50" => "\xEA\xB0\xA5", + "\x81\x51" => "\xEA\xB0\xA6", + "\x81\x52" => "\xEA\xB0\xA7", + "\x81\x53" => "\xEA\xB0\xA8", + "\x81\x54" => "\xEA\xB0\xA9", + "\x81\x55" => "\xEA\xB0\xAA", + "\x81\x56" => "\xEA\xB0\xAB", + "\x81\x57" => "\xEA\xB0\xAE", + "\x81\x58" => "\xEA\xB0\xB2", + "\x81\x59" => "\xEA\xB0\xB3", + "\x81\x5A" => "\xEA\xB0\xB4", + "\x81\x61" => "\xEA\xB0\xB5", + "\x81\x62" => "\xEA\xB0\xB6", + "\x81\x63" => "\xEA\xB0\xB7", + "\x81\x64" => "\xEA\xB0\xBA", + "\x81\x65" => "\xEA\xB0\xBB", + "\x81\x66" => "\xEA\xB0\xBD", + "\x81\x67" => "\xEA\xB0\xBE", + "\x81\x68" => "\xEA\xB0\xBF", + "\x81\x69" => "\xEA\xB1\x81", + "\x81\x6A" => "\xEA\xB1\x82", + "\x81\x6B" => "\xEA\xB1\x83", + "\x81\x6C" => "\xEA\xB1\x84", + "\x81\x6D" => "\xEA\xB1\x85", + "\x81\x6E" => "\xEA\xB1\x86", + "\x81\x6F" => "\xEA\xB1\x87", + "\x81\x70" => "\xEA\xB1\x88", + "\x81\x71" => "\xEA\xB1\x89", + "\x81\x72" => "\xEA\xB1\x8A", + "\x81\x73" => "\xEA\xB1\x8C", + "\x81\x74" => "\xEA\xB1\x8E", + "\x81\x75" => "\xEA\xB1\x8F", + "\x81\x76" => "\xEA\xB1\x90", + "\x81\x77" => "\xEA\xB1\x91", + "\x81\x78" => "\xEA\xB1\x92", + "\x81\x79" => "\xEA\xB1\x93", + "\x81\x7A" => "\xEA\xB1\x95", + "\x81\x81" => "\xEA\xB1\x96", + "\x81\x82" => "\xEA\xB1\x97", + "\x81\x83" => "\xEA\xB1\x99", + "\x81\x84" => "\xEA\xB1\x9A", + "\x81\x85" => "\xEA\xB1\x9B", + "\x81\x86" => "\xEA\xB1\x9D", + "\x81\x87" => "\xEA\xB1\x9E", + "\x81\x88" => "\xEA\xB1\x9F", + "\x81\x89" => "\xEA\xB1\xA0", + "\x81\x8A" => "\xEA\xB1\xA1", + "\x81\x8B" => "\xEA\xB1\xA2", + "\x81\x8C" => "\xEA\xB1\xA3", + "\x81\x8D" => "\xEA\xB1\xA4", + "\x81\x8E" => "\xEA\xB1\xA5", + "\x81\x8F" => "\xEA\xB1\xA6", + "\x81\x90" => "\xEA\xB1\xA7", + "\x81\x91" => "\xEA\xB1\xA8", + "\x81\x92" => "\xEA\xB1\xA9", + "\x81\x93" => "\xEA\xB1\xAA", + "\x81\x94" => "\xEA\xB1\xAB", + "\x81\x95" => "\xEA\xB1\xAC", + "\x81\x96" => "\xEA\xB1\xAD", + "\x81\x97" => "\xEA\xB1\xAE", + "\x81\x98" => "\xEA\xB1\xAF", + "\x81\x99" => "\xEA\xB1\xB2", + "\x81\x9A" => "\xEA\xB1\xB3", + "\x81\x9B" => "\xEA\xB1\xB5", + "\x81\x9C" => "\xEA\xB1\xB6", + "\x81\x9D" => "\xEA\xB1\xB9", + "\x81\x9E" => "\xEA\xB1\xBB", + "\x81\x9F" => "\xEA\xB1\xBC", + "\x81\xA0" => "\xEA\xB1\xBD", + "\x81\xA1" => "\xEA\xB1\xBE", + "\x81\xA2" => "\xEA\xB1\xBF", + "\x81\xA3" => "\xEA\xB2\x82", + "\x81\xA4" => "\xEA\xB2\x87", + "\x81\xA5" => "\xEA\xB2\x88", + "\x81\xA6" => "\xEA\xB2\x8D", + "\x81\xA7" => "\xEA\xB2\x8E", + "\x81\xA8" => "\xEA\xB2\x8F", + "\x81\xA9" => "\xEA\xB2\x91", + "\x81\xAA" => "\xEA\xB2\x92", + "\x81\xAB" => "\xEA\xB2\x93", + "\x81\xAC" => "\xEA\xB2\x95", + "\x81\xAD" => "\xEA\xB2\x96", + "\x81\xAE" => "\xEA\xB2\x97", + "\x81\xAF" => "\xEA\xB2\x98", + "\x81\xB0" => "\xEA\xB2\x99", + "\x81\xB1" => "\xEA\xB2\x9A", + "\x81\xB2" => "\xEA\xB2\x9B", + "\x81\xB3" => "\xEA\xB2\x9E", + "\x81\xB4" => "\xEA\xB2\xA2", + "\x81\xB5" => "\xEA\xB2\xA3", + "\x81\xB6" => "\xEA\xB2\xA4", + "\x81\xB7" => "\xEA\xB2\xA5", + "\x81\xB8" => "\xEA\xB2\xA6", + "\x81\xB9" => "\xEA\xB2\xA7", + "\x81\xBA" => "\xEA\xB2\xAB", + "\x81\xBB" => "\xEA\xB2\xAD", + "\x81\xBC" => "\xEA\xB2\xAE", + "\x81\xBD" => "\xEA\xB2\xB1", + "\x81\xBE" => "\xEA\xB2\xB2", + "\x81\xBF" => "\xEA\xB2\xB3", + "\x81\xC0" => "\xEA\xB2\xB4", + "\x81\xC1" => "\xEA\xB2\xB5", + "\x81\xC2" => "\xEA\xB2\xB6", + "\x81\xC3" => "\xEA\xB2\xB7", + "\x81\xC4" => "\xEA\xB2\xBA", + "\x81\xC5" => "\xEA\xB2\xBE", + "\x81\xC6" => "\xEA\xB2\xBF", + "\x81\xC7" => "\xEA\xB3\x80", + "\x81\xC8" => "\xEA\xB3\x82", + "\x81\xC9" => "\xEA\xB3\x83", + "\x81\xCA" => "\xEA\xB3\x85", + "\x81\xCB" => "\xEA\xB3\x86", + "\x81\xCC" => "\xEA\xB3\x87", + "\x81\xCD" => "\xEA\xB3\x89", + "\x81\xCE" => "\xEA\xB3\x8A", + "\x81\xCF" => "\xEA\xB3\x8B", + "\x81\xD0" => "\xEA\xB3\x8D", + "\x81\xD1" => "\xEA\xB3\x8E", + "\x81\xD2" => "\xEA\xB3\x8F", + "\x81\xD3" => "\xEA\xB3\x90", + "\x81\xD4" => "\xEA\xB3\x91", + "\x81\xD5" => "\xEA\xB3\x92", + "\x81\xD6" => "\xEA\xB3\x93", + "\x81\xD7" => "\xEA\xB3\x94", + "\x81\xD8" => "\xEA\xB3\x96", + "\x81\xD9" => "\xEA\xB3\x98", + "\x81\xDA" => "\xEA\xB3\x99", + "\x81\xDB" => "\xEA\xB3\x9A", + "\x81\xDC" => "\xEA\xB3\x9B", + "\x81\xDD" => "\xEA\xB3\x9C", + "\x81\xDE" => "\xEA\xB3\x9D", + "\x81\xDF" => "\xEA\xB3\x9E", + "\x81\xE0" => "\xEA\xB3\x9F", + "\x81\xE1" => "\xEA\xB3\xA2", + "\x81\xE2" => "\xEA\xB3\xA3", + "\x81\xE3" => "\xEA\xB3\xA5", + "\x81\xE4" => "\xEA\xB3\xA6", + "\x81\xE5" => "\xEA\xB3\xA9", + "\x81\xE6" => "\xEA\xB3\xAB", + "\x81\xE7" => "\xEA\xB3\xAD", + "\x81\xE8" => "\xEA\xB3\xAE", + "\x81\xE9" => "\xEA\xB3\xB2", + "\x81\xEA" => "\xEA\xB3\xB4", + "\x81\xEB" => "\xEA\xB3\xB7", + "\x81\xEC" => "\xEA\xB3\xB8", + "\x81\xED" => "\xEA\xB3\xB9", + "\x81\xEE" => "\xEA\xB3\xBA", + "\x81\xEF" => "\xEA\xB3\xBB", + "\x81\xF0" => "\xEA\xB3\xBE", + "\x81\xF1" => "\xEA\xB3\xBF", + "\x81\xF2" => "\xEA\xB4\x81", + "\x81\xF3" => "\xEA\xB4\x82", + "\x81\xF4" => "\xEA\xB4\x83", + "\x81\xF5" => "\xEA\xB4\x85", + "\x81\xF6" => "\xEA\xB4\x87", + "\x81\xF7" => "\xEA\xB4\x88", + "\x81\xF8" => "\xEA\xB4\x89", + "\x81\xF9" => "\xEA\xB4\x8A", + "\x81\xFA" => "\xEA\xB4\x8B", + "\x81\xFB" => "\xEA\xB4\x8E", + "\x81\xFC" => "\xEA\xB4\x90", + "\x81\xFD" => "\xEA\xB4\x92", + "\x81\xFE" => "\xEA\xB4\x93", + "\x82\x41" => "\xEA\xB4\x94", + "\x82\x42" => "\xEA\xB4\x95", + "\x82\x43" => "\xEA\xB4\x96", + "\x82\x44" => "\xEA\xB4\x97", + "\x82\x45" => "\xEA\xB4\x99", + "\x82\x46" => "\xEA\xB4\x9A", + "\x82\x47" => "\xEA\xB4\x9B", + "\x82\x48" => "\xEA\xB4\x9D", + "\x82\x49" => "\xEA\xB4\x9E", + "\x82\x4A" => "\xEA\xB4\x9F", + "\x82\x4B" => "\xEA\xB4\xA1", + "\x82\x4C" => "\xEA\xB4\xA2", + "\x82\x4D" => "\xEA\xB4\xA3", + "\x82\x4E" => "\xEA\xB4\xA4", + "\x82\x4F" => "\xEA\xB4\xA5", + "\x82\x50" => "\xEA\xB4\xA6", + "\x82\x51" => "\xEA\xB4\xA7", + "\x82\x52" => "\xEA\xB4\xA8", + "\x82\x53" => "\xEA\xB4\xAA", + "\x82\x54" => "\xEA\xB4\xAB", + "\x82\x55" => "\xEA\xB4\xAE", + "\x82\x56" => "\xEA\xB4\xAF", + "\x82\x57" => "\xEA\xB4\xB0", + "\x82\x58" => "\xEA\xB4\xB1", + "\x82\x59" => "\xEA\xB4\xB2", + "\x82\x5A" => "\xEA\xB4\xB3", + "\x82\x61" => "\xEA\xB4\xB6", + "\x82\x62" => "\xEA\xB4\xB7", + "\x82\x63" => "\xEA\xB4\xB9", + "\x82\x64" => "\xEA\xB4\xBA", + "\x82\x65" => "\xEA\xB4\xBB", + "\x82\x66" => "\xEA\xB4\xBD", + "\x82\x67" => "\xEA\xB4\xBE", + "\x82\x68" => "\xEA\xB4\xBF", + "\x82\x69" => "\xEA\xB5\x80", + "\x82\x6A" => "\xEA\xB5\x81", + "\x82\x6B" => "\xEA\xB5\x82", + "\x82\x6C" => "\xEA\xB5\x83", + "\x82\x6D" => "\xEA\xB5\x86", + "\x82\x6E" => "\xEA\xB5\x88", + "\x82\x6F" => "\xEA\xB5\x8A", + "\x82\x70" => "\xEA\xB5\x8B", + "\x82\x71" => "\xEA\xB5\x8C", + "\x82\x72" => "\xEA\xB5\x8D", + "\x82\x73" => "\xEA\xB5\x8E", + "\x82\x74" => "\xEA\xB5\x8F", + "\x82\x75" => "\xEA\xB5\x91", + "\x82\x76" => "\xEA\xB5\x92", + "\x82\x77" => "\xEA\xB5\x93", + "\x82\x78" => "\xEA\xB5\x95", + "\x82\x79" => "\xEA\xB5\x96", + "\x82\x7A" => "\xEA\xB5\x97", + "\x82\x81" => "\xEA\xB5\x99", + "\x82\x82" => "\xEA\xB5\x9A", + "\x82\x83" => "\xEA\xB5\x9B", + "\x82\x84" => "\xEA\xB5\x9C", + "\x82\x85" => "\xEA\xB5\x9D", + "\x82\x86" => "\xEA\xB5\x9E", + "\x82\x87" => "\xEA\xB5\x9F", + "\x82\x88" => "\xEA\xB5\xA0", + "\x82\x89" => "\xEA\xB5\xA2", + "\x82\x8A" => "\xEA\xB5\xA4", + "\x82\x8B" => "\xEA\xB5\xA5", + "\x82\x8C" => "\xEA\xB5\xA6", + "\x82\x8D" => "\xEA\xB5\xA7", + "\x82\x8E" => "\xEA\xB5\xA8", + "\x82\x8F" => "\xEA\xB5\xA9", + "\x82\x90" => "\xEA\xB5\xAA", + "\x82\x91" => "\xEA\xB5\xAB", + "\x82\x92" => "\xEA\xB5\xAE", + "\x82\x93" => "\xEA\xB5\xAF", + "\x82\x94" => "\xEA\xB5\xB1", + "\x82\x95" => "\xEA\xB5\xB2", + "\x82\x96" => "\xEA\xB5\xB7", + "\x82\x97" => "\xEA\xB5\xB8", + "\x82\x98" => "\xEA\xB5\xB9", + "\x82\x99" => "\xEA\xB5\xBA", + "\x82\x9A" => "\xEA\xB5\xBE", + "\x82\x9B" => "\xEA\xB6\x80", + "\x82\x9C" => "\xEA\xB6\x83", + "\x82\x9D" => "\xEA\xB6\x84", + "\x82\x9E" => "\xEA\xB6\x85", + "\x82\x9F" => "\xEA\xB6\x86", + "\x82\xA0" => "\xEA\xB6\x87", + "\x82\xA1" => "\xEA\xB6\x8A", + "\x82\xA2" => "\xEA\xB6\x8B", + "\x82\xA3" => "\xEA\xB6\x8D", + "\x82\xA4" => "\xEA\xB6\x8E", + "\x82\xA5" => "\xEA\xB6\x8F", + "\x82\xA6" => "\xEA\xB6\x91", + "\x82\xA7" => "\xEA\xB6\x92", + "\x82\xA8" => "\xEA\xB6\x93", + "\x82\xA9" => "\xEA\xB6\x94", + "\x82\xAA" => "\xEA\xB6\x95", + "\x82\xAB" => "\xEA\xB6\x96", + "\x82\xAC" => "\xEA\xB6\x97", + "\x82\xAD" => "\xEA\xB6\x98", + "\x82\xAE" => "\xEA\xB6\x99", + "\x82\xAF" => "\xEA\xB6\x9A", + "\x82\xB0" => "\xEA\xB6\x9B", + "\x82\xB1" => "\xEA\xB6\x9E", + "\x82\xB2" => "\xEA\xB6\x9F", + "\x82\xB3" => "\xEA\xB6\xA0", + "\x82\xB4" => "\xEA\xB6\xA1", + "\x82\xB5" => "\xEA\xB6\xA2", + "\x82\xB6" => "\xEA\xB6\xA3", + "\x82\xB7" => "\xEA\xB6\xA5", + "\x82\xB8" => "\xEA\xB6\xA6", + "\x82\xB9" => "\xEA\xB6\xA7", + "\x82\xBA" => "\xEA\xB6\xA8", + "\x82\xBB" => "\xEA\xB6\xA9", + "\x82\xBC" => "\xEA\xB6\xAA", + "\x82\xBD" => "\xEA\xB6\xAB", + "\x82\xBE" => "\xEA\xB6\xAC", + "\x82\xBF" => "\xEA\xB6\xAD", + "\x82\xC0" => "\xEA\xB6\xAE", + "\x82\xC1" => "\xEA\xB6\xAF", + "\x82\xC2" => "\xEA\xB6\xB0", + "\x82\xC3" => "\xEA\xB6\xB1", + "\x82\xC4" => "\xEA\xB6\xB2", + "\x82\xC5" => "\xEA\xB6\xB3", + "\x82\xC6" => "\xEA\xB6\xB4", + "\x82\xC7" => "\xEA\xB6\xB5", + "\x82\xC8" => "\xEA\xB6\xB6", + "\x82\xC9" => "\xEA\xB6\xB8", + "\x82\xCA" => "\xEA\xB6\xB9", + "\x82\xCB" => "\xEA\xB6\xBA", + "\x82\xCC" => "\xEA\xB6\xBB", + "\x82\xCD" => "\xEA\xB6\xBC", + "\x82\xCE" => "\xEA\xB6\xBD", + "\x82\xCF" => "\xEA\xB6\xBE", + "\x82\xD0" => "\xEA\xB6\xBF", + "\x82\xD1" => "\xEA\xB7\x82", + "\x82\xD2" => "\xEA\xB7\x83", + "\x82\xD3" => "\xEA\xB7\x85", + "\x82\xD4" => "\xEA\xB7\x86", + "\x82\xD5" => "\xEA\xB7\x87", + "\x82\xD6" => "\xEA\xB7\x89", + "\x82\xD7" => "\xEA\xB7\x8A", + "\x82\xD8" => "\xEA\xB7\x8B", + "\x82\xD9" => "\xEA\xB7\x8C", + "\x82\xDA" => "\xEA\xB7\x8D", + "\x82\xDB" => "\xEA\xB7\x8E", + "\x82\xDC" => "\xEA\xB7\x8F", + "\x82\xDD" => "\xEA\xB7\x92", + "\x82\xDE" => "\xEA\xB7\x94", + "\x82\xDF" => "\xEA\xB7\x95", + "\x82\xE0" => "\xEA\xB7\x96", + "\x82\xE1" => "\xEA\xB7\x97", + "\x82\xE2" => "\xEA\xB7\x98", + "\x82\xE3" => "\xEA\xB7\x99", + "\x82\xE4" => "\xEA\xB7\x9A", + "\x82\xE5" => "\xEA\xB7\x9B", + "\x82\xE6" => "\xEA\xB7\x9D", + "\x82\xE7" => "\xEA\xB7\x9E", + "\x82\xE8" => "\xEA\xB7\x9F", + "\x82\xE9" => "\xEA\xB7\xA1", + "\x82\xEA" => "\xEA\xB7\xA2", + "\x82\xEB" => "\xEA\xB7\xA3", + "\x82\xEC" => "\xEA\xB7\xA5", + "\x82\xED" => "\xEA\xB7\xA6", + "\x82\xEE" => "\xEA\xB7\xA7", + "\x82\xEF" => "\xEA\xB7\xA8", + "\x82\xF0" => "\xEA\xB7\xA9", + "\x82\xF1" => "\xEA\xB7\xAA", + "\x82\xF2" => "\xEA\xB7\xAB", + "\x82\xF3" => "\xEA\xB7\xAC", + "\x82\xF4" => "\xEA\xB7\xAD", + "\x82\xF5" => "\xEA\xB7\xAE", + "\x82\xF6" => "\xEA\xB7\xAF", + "\x82\xF7" => "\xEA\xB7\xB0", + "\x82\xF8" => "\xEA\xB7\xB1", + "\x82\xF9" => "\xEA\xB7\xB2", + "\x82\xFA" => "\xEA\xB7\xB3", + "\x82\xFB" => "\xEA\xB7\xB4", + "\x82\xFC" => "\xEA\xB7\xB5", + "\x82\xFD" => "\xEA\xB7\xB6", + "\x82\xFE" => "\xEA\xB7\xB7", + "\x83\x41" => "\xEA\xB7\xBA", + "\x83\x42" => "\xEA\xB7\xBB", + "\x83\x43" => "\xEA\xB7\xBD", + "\x83\x44" => "\xEA\xB7\xBE", + "\x83\x45" => "\xEA\xB8\x82", + "\x83\x46" => "\xEA\xB8\x83", + "\x83\x47" => "\xEA\xB8\x84", + "\x83\x48" => "\xEA\xB8\x85", + "\x83\x49" => "\xEA\xB8\x86", + "\x83\x4A" => "\xEA\xB8\x87", + "\x83\x4B" => "\xEA\xB8\x8A", + "\x83\x4C" => "\xEA\xB8\x8C", + "\x83\x4D" => "\xEA\xB8\x8E", + "\x83\x4E" => "\xEA\xB8\x8F", + "\x83\x4F" => "\xEA\xB8\x90", + "\x83\x50" => "\xEA\xB8\x91", + "\x83\x51" => "\xEA\xB8\x92", + "\x83\x52" => "\xEA\xB8\x93", + "\x83\x53" => "\xEA\xB8\x95", + "\x83\x54" => "\xEA\xB8\x96", + "\x83\x55" => "\xEA\xB8\x97", + "\x83\x56" => "\xEA\xB8\x98", + "\x83\x57" => "\xEA\xB8\x99", + "\x83\x58" => "\xEA\xB8\x9A", + "\x83\x59" => "\xEA\xB8\x9B", + "\x83\x5A" => "\xEA\xB8\x9C", + "\x83\x61" => "\xEA\xB8\x9D", + "\x83\x62" => "\xEA\xB8\x9E", + "\x83\x63" => "\xEA\xB8\x9F", + "\x83\x64" => "\xEA\xB8\xA0", + "\x83\x65" => "\xEA\xB8\xA1", + "\x83\x66" => "\xEA\xB8\xA2", + "\x83\x67" => "\xEA\xB8\xA3", + "\x83\x68" => "\xEA\xB8\xA4", + "\x83\x69" => "\xEA\xB8\xA5", + "\x83\x6A" => "\xEA\xB8\xA6", + "\x83\x6B" => "\xEA\xB8\xA7", + "\x83\x6C" => "\xEA\xB8\xA8", + "\x83\x6D" => "\xEA\xB8\xA9", + "\x83\x6E" => "\xEA\xB8\xAA", + "\x83\x6F" => "\xEA\xB8\xAB", + "\x83\x70" => "\xEA\xB8\xAC", + "\x83\x71" => "\xEA\xB8\xAD", + "\x83\x72" => "\xEA\xB8\xAE", + "\x83\x73" => "\xEA\xB8\xAF", + "\x83\x74" => "\xEA\xB8\xB2", + "\x83\x75" => "\xEA\xB8\xB3", + "\x83\x76" => "\xEA\xB8\xB5", + "\x83\x77" => "\xEA\xB8\xB6", + "\x83\x78" => "\xEA\xB8\xB9", + "\x83\x79" => "\xEA\xB8\xBB", + "\x83\x7A" => "\xEA\xB8\xBC", + "\x83\x81" => "\xEA\xB8\xBD", + "\x83\x82" => "\xEA\xB8\xBE", + "\x83\x83" => "\xEA\xB8\xBF", + "\x83\x84" => "\xEA\xB9\x82", + "\x83\x85" => "\xEA\xB9\x84", + "\x83\x86" => "\xEA\xB9\x87", + "\x83\x87" => "\xEA\xB9\x88", + "\x83\x88" => "\xEA\xB9\x89", + "\x83\x89" => "\xEA\xB9\x8B", + "\x83\x8A" => "\xEA\xB9\x8F", + "\x83\x8B" => "\xEA\xB9\x91", + "\x83\x8C" => "\xEA\xB9\x92", + "\x83\x8D" => "\xEA\xB9\x93", + "\x83\x8E" => "\xEA\xB9\x95", + "\x83\x8F" => "\xEA\xB9\x97", + "\x83\x90" => "\xEA\xB9\x98", + "\x83\x91" => "\xEA\xB9\x99", + "\x83\x92" => "\xEA\xB9\x9A", + "\x83\x93" => "\xEA\xB9\x9B", + "\x83\x94" => "\xEA\xB9\x9E", + "\x83\x95" => "\xEA\xB9\xA2", + "\x83\x96" => "\xEA\xB9\xA3", + "\x83\x97" => "\xEA\xB9\xA4", + "\x83\x98" => "\xEA\xB9\xA6", + "\x83\x99" => "\xEA\xB9\xA7", + "\x83\x9A" => "\xEA\xB9\xAA", + "\x83\x9B" => "\xEA\xB9\xAB", + "\x83\x9C" => "\xEA\xB9\xAD", + "\x83\x9D" => "\xEA\xB9\xAE", + "\x83\x9E" => "\xEA\xB9\xAF", + "\x83\x9F" => "\xEA\xB9\xB1", + "\x83\xA0" => "\xEA\xB9\xB2", + "\x83\xA1" => "\xEA\xB9\xB3", + "\x83\xA2" => "\xEA\xB9\xB4", + "\x83\xA3" => "\xEA\xB9\xB5", + "\x83\xA4" => "\xEA\xB9\xB6", + "\x83\xA5" => "\xEA\xB9\xB7", + "\x83\xA6" => "\xEA\xB9\xBA", + "\x83\xA7" => "\xEA\xB9\xBE", + "\x83\xA8" => "\xEA\xB9\xBF", + "\x83\xA9" => "\xEA\xBA\x80", + "\x83\xAA" => "\xEA\xBA\x81", + "\x83\xAB" => "\xEA\xBA\x82", + "\x83\xAC" => "\xEA\xBA\x83", + "\x83\xAD" => "\xEA\xBA\x86", + "\x83\xAE" => "\xEA\xBA\x87", + "\x83\xAF" => "\xEA\xBA\x88", + "\x83\xB0" => "\xEA\xBA\x89", + "\x83\xB1" => "\xEA\xBA\x8A", + "\x83\xB2" => "\xEA\xBA\x8B", + "\x83\xB3" => "\xEA\xBA\x8D", + "\x83\xB4" => "\xEA\xBA\x8E", + "\x83\xB5" => "\xEA\xBA\x8F", + "\x83\xB6" => "\xEA\xBA\x90", + "\x83\xB7" => "\xEA\xBA\x91", + "\x83\xB8" => "\xEA\xBA\x92", + "\x83\xB9" => "\xEA\xBA\x93", + "\x83\xBA" => "\xEA\xBA\x94", + "\x83\xBB" => "\xEA\xBA\x95", + "\x83\xBC" => "\xEA\xBA\x96", + "\x83\xBD" => "\xEA\xBA\x97", + "\x83\xBE" => "\xEA\xBA\x98", + "\x83\xBF" => "\xEA\xBA\x99", + "\x83\xC0" => "\xEA\xBA\x9A", + "\x83\xC1" => "\xEA\xBA\x9B", + "\x83\xC2" => "\xEA\xBA\x9C", + "\x83\xC3" => "\xEA\xBA\x9D", + "\x83\xC4" => "\xEA\xBA\x9E", + "\x83\xC5" => "\xEA\xBA\x9F", + "\x83\xC6" => "\xEA\xBA\xA0", + "\x83\xC7" => "\xEA\xBA\xA1", + "\x83\xC8" => "\xEA\xBA\xA2", + "\x83\xC9" => "\xEA\xBA\xA3", + "\x83\xCA" => "\xEA\xBA\xA4", + "\x83\xCB" => "\xEA\xBA\xA5", + "\x83\xCC" => "\xEA\xBA\xA6", + "\x83\xCD" => "\xEA\xBA\xA7", + "\x83\xCE" => "\xEA\xBA\xA8", + "\x83\xCF" => "\xEA\xBA\xA9", + "\x83\xD0" => "\xEA\xBA\xAA", + "\x83\xD1" => "\xEA\xBA\xAB", + "\x83\xD2" => "\xEA\xBA\xAC", + "\x83\xD3" => "\xEA\xBA\xAD", + "\x83\xD4" => "\xEA\xBA\xAE", + "\x83\xD5" => "\xEA\xBA\xAF", + "\x83\xD6" => "\xEA\xBA\xB0", + "\x83\xD7" => "\xEA\xBA\xB1", + "\x83\xD8" => "\xEA\xBA\xB2", + "\x83\xD9" => "\xEA\xBA\xB3", + "\x83\xDA" => "\xEA\xBA\xB4", + "\x83\xDB" => "\xEA\xBA\xB5", + "\x83\xDC" => "\xEA\xBA\xB6", + "\x83\xDD" => "\xEA\xBA\xB7", + "\x83\xDE" => "\xEA\xBA\xB8", + "\x83\xDF" => "\xEA\xBA\xB9", + "\x83\xE0" => "\xEA\xBA\xBA", + "\x83\xE1" => "\xEA\xBA\xBB", + "\x83\xE2" => "\xEA\xBA\xBF", + "\x83\xE3" => "\xEA\xBB\x81", + "\x83\xE4" => "\xEA\xBB\x82", + "\x83\xE5" => "\xEA\xBB\x83", + "\x83\xE6" => "\xEA\xBB\x85", + "\x83\xE7" => "\xEA\xBB\x86", + "\x83\xE8" => "\xEA\xBB\x87", + "\x83\xE9" => "\xEA\xBB\x88", + "\x83\xEA" => "\xEA\xBB\x89", + "\x83\xEB" => "\xEA\xBB\x8A", + "\x83\xEC" => "\xEA\xBB\x8B", + "\x83\xED" => "\xEA\xBB\x8E", + "\x83\xEE" => "\xEA\xBB\x92", + "\x83\xEF" => "\xEA\xBB\x93", + "\x83\xF0" => "\xEA\xBB\x94", + "\x83\xF1" => "\xEA\xBB\x95", + "\x83\xF2" => "\xEA\xBB\x96", + "\x83\xF3" => "\xEA\xBB\x97", + "\x83\xF4" => "\xEA\xBB\x9A", + "\x83\xF5" => "\xEA\xBB\x9B", + "\x83\xF6" => "\xEA\xBB\x9D", + "\x83\xF7" => "\xEA\xBB\x9E", + "\x83\xF8" => "\xEA\xBB\x9F", + "\x83\xF9" => "\xEA\xBB\xA0", + "\x83\xFA" => "\xEA\xBB\xA1", + "\x83\xFB" => "\xEA\xBB\xA2", + "\x83\xFC" => "\xEA\xBB\xA3", + "\x83\xFD" => "\xEA\xBB\xA4", + "\x83\xFE" => "\xEA\xBB\xA5", + "\x84\x41" => "\xEA\xBB\xA6", + "\x84\x42" => "\xEA\xBB\xA7", + "\x84\x43" => "\xEA\xBB\xA9", + "\x84\x44" => "\xEA\xBB\xAA", + "\x84\x45" => "\xEA\xBB\xAC", + "\x84\x46" => "\xEA\xBB\xAE", + "\x84\x47" => "\xEA\xBB\xAF", + "\x84\x48" => "\xEA\xBB\xB0", + "\x84\x49" => "\xEA\xBB\xB1", + "\x84\x4A" => "\xEA\xBB\xB2", + "\x84\x4B" => "\xEA\xBB\xB3", + "\x84\x4C" => "\xEA\xBB\xB5", + "\x84\x4D" => "\xEA\xBB\xB6", + "\x84\x4E" => "\xEA\xBB\xB7", + "\x84\x4F" => "\xEA\xBB\xB9", + "\x84\x50" => "\xEA\xBB\xBA", + "\x84\x51" => "\xEA\xBB\xBB", + "\x84\x52" => "\xEA\xBB\xBD", + "\x84\x53" => "\xEA\xBB\xBE", + "\x84\x54" => "\xEA\xBB\xBF", + "\x84\x55" => "\xEA\xBC\x80", + "\x84\x56" => "\xEA\xBC\x81", + "\x84\x57" => "\xEA\xBC\x82", + "\x84\x58" => "\xEA\xBC\x83", + "\x84\x59" => "\xEA\xBC\x84", + "\x84\x5A" => "\xEA\xBC\x85", + "\x84\x61" => "\xEA\xBC\x86", + "\x84\x62" => "\xEA\xBC\x89", + "\x84\x63" => "\xEA\xBC\x8A", + "\x84\x64" => "\xEA\xBC\x8B", + "\x84\x65" => "\xEA\xBC\x8C", + "\x84\x66" => "\xEA\xBC\x8E", + "\x84\x67" => "\xEA\xBC\x8F", + "\x84\x68" => "\xEA\xBC\x91", + "\x84\x69" => "\xEA\xBC\x92", + "\x84\x6A" => "\xEA\xBC\x93", + "\x84\x6B" => "\xEA\xBC\x94", + "\x84\x6C" => "\xEA\xBC\x95", + "\x84\x6D" => "\xEA\xBC\x96", + "\x84\x6E" => "\xEA\xBC\x97", + "\x84\x6F" => "\xEA\xBC\x98", + "\x84\x70" => "\xEA\xBC\x99", + "\x84\x71" => "\xEA\xBC\x9A", + "\x84\x72" => "\xEA\xBC\x9B", + "\x84\x73" => "\xEA\xBC\x9C", + "\x84\x74" => "\xEA\xBC\x9D", + "\x84\x75" => "\xEA\xBC\x9E", + "\x84\x76" => "\xEA\xBC\x9F", + "\x84\x77" => "\xEA\xBC\xA0", + "\x84\x78" => "\xEA\xBC\xA1", + "\x84\x79" => "\xEA\xBC\xA2", + "\x84\x7A" => "\xEA\xBC\xA3", + "\x84\x81" => "\xEA\xBC\xA4", + "\x84\x82" => "\xEA\xBC\xA5", + "\x84\x83" => "\xEA\xBC\xA6", + "\x84\x84" => "\xEA\xBC\xA7", + "\x84\x85" => "\xEA\xBC\xA8", + "\x84\x86" => "\xEA\xBC\xA9", + "\x84\x87" => "\xEA\xBC\xAA", + "\x84\x88" => "\xEA\xBC\xAB", + "\x84\x89" => "\xEA\xBC\xAE", + "\x84\x8A" => "\xEA\xBC\xAF", + "\x84\x8B" => "\xEA\xBC\xB1", + "\x84\x8C" => "\xEA\xBC\xB3", + "\x84\x8D" => "\xEA\xBC\xB5", + "\x84\x8E" => "\xEA\xBC\xB6", + "\x84\x8F" => "\xEA\xBC\xB7", + "\x84\x90" => "\xEA\xBC\xB8", + "\x84\x91" => "\xEA\xBC\xB9", + "\x84\x92" => "\xEA\xBC\xBA", + "\x84\x93" => "\xEA\xBC\xBB", + "\x84\x94" => "\xEA\xBC\xBE", + "\x84\x95" => "\xEA\xBD\x80", + "\x84\x96" => "\xEA\xBD\x84", + "\x84\x97" => "\xEA\xBD\x85", + "\x84\x98" => "\xEA\xBD\x86", + "\x84\x99" => "\xEA\xBD\x87", + "\x84\x9A" => "\xEA\xBD\x8A", + "\x84\x9B" => "\xEA\xBD\x8B", + "\x84\x9C" => "\xEA\xBD\x8C", + "\x84\x9D" => "\xEA\xBD\x8D", + "\x84\x9E" => "\xEA\xBD\x8E", + "\x84\x9F" => "\xEA\xBD\x8F", + "\x84\xA0" => "\xEA\xBD\x91", + "\x84\xA1" => "\xEA\xBD\x92", + "\x84\xA2" => "\xEA\xBD\x93", + "\x84\xA3" => "\xEA\xBD\x94", + "\x84\xA4" => "\xEA\xBD\x95", + "\x84\xA5" => "\xEA\xBD\x96", + "\x84\xA6" => "\xEA\xBD\x97", + "\x84\xA7" => "\xEA\xBD\x98", + "\x84\xA8" => "\xEA\xBD\x99", + "\x84\xA9" => "\xEA\xBD\x9A", + "\x84\xAA" => "\xEA\xBD\x9B", + "\x84\xAB" => "\xEA\xBD\x9E", + "\x84\xAC" => "\xEA\xBD\x9F", + "\x84\xAD" => "\xEA\xBD\xA0", + "\x84\xAE" => "\xEA\xBD\xA1", + "\x84\xAF" => "\xEA\xBD\xA2", + "\x84\xB0" => "\xEA\xBD\xA3", + "\x84\xB1" => "\xEA\xBD\xA6", + "\x84\xB2" => "\xEA\xBD\xA7", + "\x84\xB3" => "\xEA\xBD\xA8", + "\x84\xB4" => "\xEA\xBD\xA9", + "\x84\xB5" => "\xEA\xBD\xAA", + "\x84\xB6" => "\xEA\xBD\xAB", + "\x84\xB7" => "\xEA\xBD\xAC", + "\x84\xB8" => "\xEA\xBD\xAD", + "\x84\xB9" => "\xEA\xBD\xAE", + "\x84\xBA" => "\xEA\xBD\xAF", + "\x84\xBB" => "\xEA\xBD\xB0", + "\x84\xBC" => "\xEA\xBD\xB1", + "\x84\xBD" => "\xEA\xBD\xB2", + "\x84\xBE" => "\xEA\xBD\xB3", + "\x84\xBF" => "\xEA\xBD\xB4", + "\x84\xC0" => "\xEA\xBD\xB5", + "\x84\xC1" => "\xEA\xBD\xB6", + "\x84\xC2" => "\xEA\xBD\xB7", + "\x84\xC3" => "\xEA\xBD\xB8", + "\x84\xC4" => "\xEA\xBD\xBA", + "\x84\xC5" => "\xEA\xBD\xBB", + "\x84\xC6" => "\xEA\xBD\xBC", + "\x84\xC7" => "\xEA\xBD\xBD", + "\x84\xC8" => "\xEA\xBD\xBE", + "\x84\xC9" => "\xEA\xBD\xBF", + "\x84\xCA" => "\xEA\xBE\x81", + "\x84\xCB" => "\xEA\xBE\x82", + "\x84\xCC" => "\xEA\xBE\x83", + "\x84\xCD" => "\xEA\xBE\x85", + "\x84\xCE" => "\xEA\xBE\x86", + "\x84\xCF" => "\xEA\xBE\x87", + "\x84\xD0" => "\xEA\xBE\x89", + "\x84\xD1" => "\xEA\xBE\x8A", + "\x84\xD2" => "\xEA\xBE\x8B", + "\x84\xD3" => "\xEA\xBE\x8C", + "\x84\xD4" => "\xEA\xBE\x8D", + "\x84\xD5" => "\xEA\xBE\x8E", + "\x84\xD6" => "\xEA\xBE\x8F", + "\x84\xD7" => "\xEA\xBE\x92", + "\x84\xD8" => "\xEA\xBE\x93", + "\x84\xD9" => "\xEA\xBE\x94", + "\x84\xDA" => "\xEA\xBE\x96", + "\x84\xDB" => "\xEA\xBE\x97", + "\x84\xDC" => "\xEA\xBE\x98", + "\x84\xDD" => "\xEA\xBE\x99", + "\x84\xDE" => "\xEA\xBE\x9A", + "\x84\xDF" => "\xEA\xBE\x9B", + "\x84\xE0" => "\xEA\xBE\x9D", + "\x84\xE1" => "\xEA\xBE\x9E", + "\x84\xE2" => "\xEA\xBE\x9F", + "\x84\xE3" => "\xEA\xBE\xA0", + "\x84\xE4" => "\xEA\xBE\xA1", + "\x84\xE5" => "\xEA\xBE\xA2", + "\x84\xE6" => "\xEA\xBE\xA3", + "\x84\xE7" => "\xEA\xBE\xA4", + "\x84\xE8" => "\xEA\xBE\xA5", + "\x84\xE9" => "\xEA\xBE\xA6", + "\x84\xEA" => "\xEA\xBE\xA7", + "\x84\xEB" => "\xEA\xBE\xA8", + "\x84\xEC" => "\xEA\xBE\xA9", + "\x84\xED" => "\xEA\xBE\xAA", + "\x84\xEE" => "\xEA\xBE\xAB", + "\x84\xEF" => "\xEA\xBE\xAC", + "\x84\xF0" => "\xEA\xBE\xAD", + "\x84\xF1" => "\xEA\xBE\xAE", + "\x84\xF2" => "\xEA\xBE\xAF", + "\x84\xF3" => "\xEA\xBE\xB0", + "\x84\xF4" => "\xEA\xBE\xB1", + "\x84\xF5" => "\xEA\xBE\xB2", + "\x84\xF6" => "\xEA\xBE\xB3", + "\x84\xF7" => "\xEA\xBE\xB4", + "\x84\xF8" => "\xEA\xBE\xB5", + "\x84\xF9" => "\xEA\xBE\xB6", + "\x84\xFA" => "\xEA\xBE\xB7", + "\x84\xFB" => "\xEA\xBE\xBA", + "\x84\xFC" => "\xEA\xBE\xBB", + "\x84\xFD" => "\xEA\xBE\xBD", + "\x84\xFE" => "\xEA\xBE\xBE", + "\x85\x41" => "\xEA\xBE\xBF", + "\x85\x42" => "\xEA\xBF\x81", + "\x85\x43" => "\xEA\xBF\x82", + "\x85\x44" => "\xEA\xBF\x83", + "\x85\x45" => "\xEA\xBF\x84", + "\x85\x46" => "\xEA\xBF\x85", + "\x85\x47" => "\xEA\xBF\x86", + "\x85\x48" => "\xEA\xBF\x8A", + "\x85\x49" => "\xEA\xBF\x8C", + "\x85\x4A" => "\xEA\xBF\x8F", + "\x85\x4B" => "\xEA\xBF\x90", + "\x85\x4C" => "\xEA\xBF\x91", + "\x85\x4D" => "\xEA\xBF\x92", + "\x85\x4E" => "\xEA\xBF\x93", + "\x85\x4F" => "\xEA\xBF\x95", + "\x85\x50" => "\xEA\xBF\x96", + "\x85\x51" => "\xEA\xBF\x97", + "\x85\x52" => "\xEA\xBF\x98", + "\x85\x53" => "\xEA\xBF\x99", + "\x85\x54" => "\xEA\xBF\x9A", + "\x85\x55" => "\xEA\xBF\x9B", + "\x85\x56" => "\xEA\xBF\x9D", + "\x85\x57" => "\xEA\xBF\x9E", + "\x85\x58" => "\xEA\xBF\x9F", + "\x85\x59" => "\xEA\xBF\xA0", + "\x85\x5A" => "\xEA\xBF\xA1", + "\x85\x61" => "\xEA\xBF\xA2", + "\x85\x62" => "\xEA\xBF\xA3", + "\x85\x63" => "\xEA\xBF\xA4", + "\x85\x64" => "\xEA\xBF\xA5", + "\x85\x65" => "\xEA\xBF\xA6", + "\x85\x66" => "\xEA\xBF\xA7", + "\x85\x67" => "\xEA\xBF\xAA", + "\x85\x68" => "\xEA\xBF\xAB", + "\x85\x69" => "\xEA\xBF\xAC", + "\x85\x6A" => "\xEA\xBF\xAD", + "\x85\x6B" => "\xEA\xBF\xAE", + "\x85\x6C" => "\xEA\xBF\xAF", + "\x85\x6D" => "\xEA\xBF\xB2", + "\x85\x6E" => "\xEA\xBF\xB3", + "\x85\x6F" => "\xEA\xBF\xB5", + "\x85\x70" => "\xEA\xBF\xB6", + "\x85\x71" => "\xEA\xBF\xB7", + "\x85\x72" => "\xEA\xBF\xB9", + "\x85\x73" => "\xEA\xBF\xBA", + "\x85\x74" => "\xEA\xBF\xBB", + "\x85\x75" => "\xEA\xBF\xBC", + "\x85\x76" => "\xEA\xBF\xBD", + "\x85\x77" => "\xEA\xBF\xBE", + "\x85\x78" => "\xEA\xBF\xBF", + "\x85\x79" => "\xEB\x80\x82", + "\x85\x7A" => "\xEB\x80\x83", + "\x85\x81" => "\xEB\x80\x85", + "\x85\x82" => "\xEB\x80\x86", + "\x85\x83" => "\xEB\x80\x87", + "\x85\x84" => "\xEB\x80\x88", + "\x85\x85" => "\xEB\x80\x89", + "\x85\x86" => "\xEB\x80\x8A", + "\x85\x87" => "\xEB\x80\x8B", + "\x85\x88" => "\xEB\x80\x8D", + "\x85\x89" => "\xEB\x80\x8E", + "\x85\x8A" => "\xEB\x80\x8F", + "\x85\x8B" => "\xEB\x80\x91", + "\x85\x8C" => "\xEB\x80\x92", + "\x85\x8D" => "\xEB\x80\x93", + "\x85\x8E" => "\xEB\x80\x95", + "\x85\x8F" => "\xEB\x80\x96", + "\x85\x90" => "\xEB\x80\x97", + "\x85\x91" => "\xEB\x80\x98", + "\x85\x92" => "\xEB\x80\x99", + "\x85\x93" => "\xEB\x80\x9A", + "\x85\x94" => "\xEB\x80\x9B", + "\x85\x95" => "\xEB\x80\x9E", + "\x85\x96" => "\xEB\x80\x9F", + "\x85\x97" => "\xEB\x80\xA0", + "\x85\x98" => "\xEB\x80\xA1", + "\x85\x99" => "\xEB\x80\xA2", + "\x85\x9A" => "\xEB\x80\xA3", + "\x85\x9B" => "\xEB\x80\xA4", + "\x85\x9C" => "\xEB\x80\xA5", + "\x85\x9D" => "\xEB\x80\xA6", + "\x85\x9E" => "\xEB\x80\xA7", + "\x85\x9F" => "\xEB\x80\xA9", + "\x85\xA0" => "\xEB\x80\xAA", + "\x85\xA1" => "\xEB\x80\xAB", + "\x85\xA2" => "\xEB\x80\xAC", + "\x85\xA3" => "\xEB\x80\xAD", + "\x85\xA4" => "\xEB\x80\xAE", + "\x85\xA5" => "\xEB\x80\xAF", + "\x85\xA6" => "\xEB\x80\xB0", + "\x85\xA7" => "\xEB\x80\xB1", + "\x85\xA8" => "\xEB\x80\xB2", + "\x85\xA9" => "\xEB\x80\xB3", + "\x85\xAA" => "\xEB\x80\xB4", + "\x85\xAB" => "\xEB\x80\xB5", + "\x85\xAC" => "\xEB\x80\xB6", + "\x85\xAD" => "\xEB\x80\xB7", + "\x85\xAE" => "\xEB\x80\xB8", + "\x85\xAF" => "\xEB\x80\xB9", + "\x85\xB0" => "\xEB\x80\xBA", + "\x85\xB1" => "\xEB\x80\xBB", + "\x85\xB2" => "\xEB\x80\xBC", + "\x85\xB3" => "\xEB\x80\xBD", + "\x85\xB4" => "\xEB\x80\xBE", + "\x85\xB5" => "\xEB\x80\xBF", + "\x85\xB6" => "\xEB\x81\x80", + "\x85\xB7" => "\xEB\x81\x81", + "\x85\xB8" => "\xEB\x81\x82", + "\x85\xB9" => "\xEB\x81\x83", + "\x85\xBA" => "\xEB\x81\x86", + "\x85\xBB" => "\xEB\x81\x87", + "\x85\xBC" => "\xEB\x81\x89", + "\x85\xBD" => "\xEB\x81\x8B", + "\x85\xBE" => "\xEB\x81\x8D", + "\x85\xBF" => "\xEB\x81\x8F", + "\x85\xC0" => "\xEB\x81\x90", + "\x85\xC1" => "\xEB\x81\x91", + "\x85\xC2" => "\xEB\x81\x92", + "\x85\xC3" => "\xEB\x81\x96", + "\x85\xC4" => "\xEB\x81\x98", + "\x85\xC5" => "\xEB\x81\x9A", + "\x85\xC6" => "\xEB\x81\x9B", + "\x85\xC7" => "\xEB\x81\x9C", + "\x85\xC8" => "\xEB\x81\x9E", + "\x85\xC9" => "\xEB\x81\x9F", + "\x85\xCA" => "\xEB\x81\xA0", + "\x85\xCB" => "\xEB\x81\xA1", + "\x85\xCC" => "\xEB\x81\xA2", + "\x85\xCD" => "\xEB\x81\xA3", + "\x85\xCE" => "\xEB\x81\xA4", + "\x85\xCF" => "\xEB\x81\xA5", + "\x85\xD0" => "\xEB\x81\xA6", + "\x85\xD1" => "\xEB\x81\xA7", + "\x85\xD2" => "\xEB\x81\xA8", + "\x85\xD3" => "\xEB\x81\xA9", + "\x85\xD4" => "\xEB\x81\xAA", + "\x85\xD5" => "\xEB\x81\xAB", + "\x85\xD6" => "\xEB\x81\xAC", + "\x85\xD7" => "\xEB\x81\xAD", + "\x85\xD8" => "\xEB\x81\xAE", + "\x85\xD9" => "\xEB\x81\xAF", + "\x85\xDA" => "\xEB\x81\xB0", + "\x85\xDB" => "\xEB\x81\xB1", + "\x85\xDC" => "\xEB\x81\xB2", + "\x85\xDD" => "\xEB\x81\xB3", + "\x85\xDE" => "\xEB\x81\xB4", + "\x85\xDF" => "\xEB\x81\xB5", + "\x85\xE0" => "\xEB\x81\xB6", + "\x85\xE1" => "\xEB\x81\xB7", + "\x85\xE2" => "\xEB\x81\xB8", + "\x85\xE3" => "\xEB\x81\xB9", + "\x85\xE4" => "\xEB\x81\xBA", + "\x85\xE5" => "\xEB\x81\xBB", + "\x85\xE6" => "\xEB\x81\xBE", + "\x85\xE7" => "\xEB\x81\xBF", + "\x85\xE8" => "\xEB\x82\x81", + "\x85\xE9" => "\xEB\x82\x82", + "\x85\xEA" => "\xEB\x82\x83", + "\x85\xEB" => "\xEB\x82\x85", + "\x85\xEC" => "\xEB\x82\x86", + "\x85\xED" => "\xEB\x82\x87", + "\x85\xEE" => "\xEB\x82\x88", + "\x85\xEF" => "\xEB\x82\x89", + "\x85\xF0" => "\xEB\x82\x8A", + "\x85\xF1" => "\xEB\x82\x8B", + "\x85\xF2" => "\xEB\x82\x8E", + "\x85\xF3" => "\xEB\x82\x90", + "\x85\xF4" => "\xEB\x82\x92", + "\x85\xF5" => "\xEB\x82\x93", + "\x85\xF6" => "\xEB\x82\x94", + "\x85\xF7" => "\xEB\x82\x95", + "\x85\xF8" => "\xEB\x82\x96", + "\x85\xF9" => "\xEB\x82\x97", + "\x85\xFA" => "\xEB\x82\x9B", + "\x85\xFB" => "\xEB\x82\x9D", + "\x85\xFC" => "\xEB\x82\x9E", + "\x85\xFD" => "\xEB\x82\xA3", + "\x85\xFE" => "\xEB\x82\xA4", + "\x86\x41" => "\xEB\x82\xA5", + "\x86\x42" => "\xEB\x82\xA6", + "\x86\x43" => "\xEB\x82\xA7", + "\x86\x44" => "\xEB\x82\xAA", + "\x86\x45" => "\xEB\x82\xB0", + "\x86\x46" => "\xEB\x82\xB2", + "\x86\x47" => "\xEB\x82\xB6", + "\x86\x48" => "\xEB\x82\xB7", + "\x86\x49" => "\xEB\x82\xB9", + "\x86\x4A" => "\xEB\x82\xBA", + "\x86\x4B" => "\xEB\x82\xBB", + "\x86\x4C" => "\xEB\x82\xBD", + "\x86\x4D" => "\xEB\x82\xBE", + "\x86\x4E" => "\xEB\x82\xBF", + "\x86\x4F" => "\xEB\x83\x80", + "\x86\x50" => "\xEB\x83\x81", + "\x86\x51" => "\xEB\x83\x82", + "\x86\x52" => "\xEB\x83\x83", + "\x86\x53" => "\xEB\x83\x86", + "\x86\x54" => "\xEB\x83\x8A", + "\x86\x55" => "\xEB\x83\x8B", + "\x86\x56" => "\xEB\x83\x8C", + "\x86\x57" => "\xEB\x83\x8D", + "\x86\x58" => "\xEB\x83\x8E", + "\x86\x59" => "\xEB\x83\x8F", + "\x86\x5A" => "\xEB\x83\x92", + "\x86\x61" => "\xEB\x83\x93", + "\x86\x62" => "\xEB\x83\x95", + "\x86\x63" => "\xEB\x83\x96", + "\x86\x64" => "\xEB\x83\x97", + "\x86\x65" => "\xEB\x83\x99", + "\x86\x66" => "\xEB\x83\x9A", + "\x86\x67" => "\xEB\x83\x9B", + "\x86\x68" => "\xEB\x83\x9C", + "\x86\x69" => "\xEB\x83\x9D", + "\x86\x6A" => "\xEB\x83\x9E", + "\x86\x6B" => "\xEB\x83\x9F", + "\x86\x6C" => "\xEB\x83\xA1", + "\x86\x6D" => "\xEB\x83\xA2", + "\x86\x6E" => "\xEB\x83\xA3", + "\x86\x6F" => "\xEB\x83\xA4", + "\x86\x70" => "\xEB\x83\xA6", + "\x86\x71" => "\xEB\x83\xA7", + "\x86\x72" => "\xEB\x83\xA8", + "\x86\x73" => "\xEB\x83\xA9", + "\x86\x74" => "\xEB\x83\xAA", + "\x86\x75" => "\xEB\x83\xAB", + "\x86\x76" => "\xEB\x83\xAC", + "\x86\x77" => "\xEB\x83\xAD", + "\x86\x78" => "\xEB\x83\xAE", + "\x86\x79" => "\xEB\x83\xAF", + "\x86\x7A" => "\xEB\x83\xB0", + "\x86\x81" => "\xEB\x83\xB1", + "\x86\x82" => "\xEB\x83\xB2", + "\x86\x83" => "\xEB\x83\xB3", + "\x86\x84" => "\xEB\x83\xB4", + "\x86\x85" => "\xEB\x83\xB5", + "\x86\x86" => "\xEB\x83\xB6", + "\x86\x87" => "\xEB\x83\xB7", + "\x86\x88" => "\xEB\x83\xB8", + "\x86\x89" => "\xEB\x83\xB9", + "\x86\x8A" => "\xEB\x83\xBA", + "\x86\x8B" => "\xEB\x83\xBB", + "\x86\x8C" => "\xEB\x83\xBC", + "\x86\x8D" => "\xEB\x83\xBD", + "\x86\x8E" => "\xEB\x83\xBE", + "\x86\x8F" => "\xEB\x83\xBF", + "\x86\x90" => "\xEB\x84\x80", + "\x86\x91" => "\xEB\x84\x81", + "\x86\x92" => "\xEB\x84\x82", + "\x86\x93" => "\xEB\x84\x83", + "\x86\x94" => "\xEB\x84\x84", + "\x86\x95" => "\xEB\x84\x85", + "\x86\x96" => "\xEB\x84\x86", + "\x86\x97" => "\xEB\x84\x87", + "\x86\x98" => "\xEB\x84\x8A", + "\x86\x99" => "\xEB\x84\x8D", + "\x86\x9A" => "\xEB\x84\x8E", + "\x86\x9B" => "\xEB\x84\x8F", + "\x86\x9C" => "\xEB\x84\x91", + "\x86\x9D" => "\xEB\x84\x94", + "\x86\x9E" => "\xEB\x84\x95", + "\x86\x9F" => "\xEB\x84\x96", + "\x86\xA0" => "\xEB\x84\x97", + "\x86\xA1" => "\xEB\x84\x9A", + "\x86\xA2" => "\xEB\x84\x9E", + "\x86\xA3" => "\xEB\x84\x9F", + "\x86\xA4" => "\xEB\x84\xA0", + "\x86\xA5" => "\xEB\x84\xA1", + "\x86\xA6" => "\xEB\x84\xA2", + "\x86\xA7" => "\xEB\x84\xA6", + "\x86\xA8" => "\xEB\x84\xA7", + "\x86\xA9" => "\xEB\x84\xA9", + "\x86\xAA" => "\xEB\x84\xAA", + "\x86\xAB" => "\xEB\x84\xAB", + "\x86\xAC" => "\xEB\x84\xAD", + "\x86\xAD" => "\xEB\x84\xAE", + "\x86\xAE" => "\xEB\x84\xAF", + "\x86\xAF" => "\xEB\x84\xB0", + "\x86\xB0" => "\xEB\x84\xB1", + "\x86\xB1" => "\xEB\x84\xB2", + "\x86\xB2" => "\xEB\x84\xB3", + "\x86\xB3" => "\xEB\x84\xB6", + "\x86\xB4" => "\xEB\x84\xBA", + "\x86\xB5" => "\xEB\x84\xBB", + "\x86\xB6" => "\xEB\x84\xBC", + "\x86\xB7" => "\xEB\x84\xBD", + "\x86\xB8" => "\xEB\x84\xBE", + "\x86\xB9" => "\xEB\x84\xBF", + "\x86\xBA" => "\xEB\x85\x82", + "\x86\xBB" => "\xEB\x85\x83", + "\x86\xBC" => "\xEB\x85\x85", + "\x86\xBD" => "\xEB\x85\x86", + "\x86\xBE" => "\xEB\x85\x87", + "\x86\xBF" => "\xEB\x85\x89", + "\x86\xC0" => "\xEB\x85\x8A", + "\x86\xC1" => "\xEB\x85\x8B", + "\x86\xC2" => "\xEB\x85\x8C", + "\x86\xC3" => "\xEB\x85\x8D", + "\x86\xC4" => "\xEB\x85\x8E", + "\x86\xC5" => "\xEB\x85\x8F", + "\x86\xC6" => "\xEB\x85\x92", + "\x86\xC7" => "\xEB\x85\x93", + "\x86\xC8" => "\xEB\x85\x96", + "\x86\xC9" => "\xEB\x85\x97", + "\x86\xCA" => "\xEB\x85\x99", + "\x86\xCB" => "\xEB\x85\x9A", + "\x86\xCC" => "\xEB\x85\x9B", + "\x86\xCD" => "\xEB\x85\x9D", + "\x86\xCE" => "\xEB\x85\x9E", + "\x86\xCF" => "\xEB\x85\x9F", + "\x86\xD0" => "\xEB\x85\xA1", + "\x86\xD1" => "\xEB\x85\xA2", + "\x86\xD2" => "\xEB\x85\xA3", + "\x86\xD3" => "\xEB\x85\xA4", + "\x86\xD4" => "\xEB\x85\xA5", + "\x86\xD5" => "\xEB\x85\xA6", + "\x86\xD6" => "\xEB\x85\xA7", + "\x86\xD7" => "\xEB\x85\xA8", + "\x86\xD8" => "\xEB\x85\xA9", + "\x86\xD9" => "\xEB\x85\xAA", + "\x86\xDA" => "\xEB\x85\xAB", + "\x86\xDB" => "\xEB\x85\xAC", + "\x86\xDC" => "\xEB\x85\xAD", + "\x86\xDD" => "\xEB\x85\xAE", + "\x86\xDE" => "\xEB\x85\xAF", + "\x86\xDF" => "\xEB\x85\xB0", + "\x86\xE0" => "\xEB\x85\xB1", + "\x86\xE1" => "\xEB\x85\xB2", + "\x86\xE2" => "\xEB\x85\xB3", + "\x86\xE3" => "\xEB\x85\xB4", + "\x86\xE4" => "\xEB\x85\xB5", + "\x86\xE5" => "\xEB\x85\xB6", + "\x86\xE6" => "\xEB\x85\xB7", + "\x86\xE7" => "\xEB\x85\xBA", + "\x86\xE8" => "\xEB\x85\xBB", + "\x86\xE9" => "\xEB\x85\xBD", + "\x86\xEA" => "\xEB\x85\xBE", + "\x86\xEB" => "\xEB\x85\xBF", + "\x86\xEC" => "\xEB\x86\x81", + "\x86\xED" => "\xEB\x86\x83", + "\x86\xEE" => "\xEB\x86\x84", + "\x86\xEF" => "\xEB\x86\x85", + "\x86\xF0" => "\xEB\x86\x86", + "\x86\xF1" => "\xEB\x86\x87", + "\x86\xF2" => "\xEB\x86\x8A", + "\x86\xF3" => "\xEB\x86\x8C", + "\x86\xF4" => "\xEB\x86\x8E", + "\x86\xF5" => "\xEB\x86\x8F", + "\x86\xF6" => "\xEB\x86\x90", + "\x86\xF7" => "\xEB\x86\x91", + "\x86\xF8" => "\xEB\x86\x95", + "\x86\xF9" => "\xEB\x86\x96", + "\x86\xFA" => "\xEB\x86\x97", + "\x86\xFB" => "\xEB\x86\x99", + "\x86\xFC" => "\xEB\x86\x9A", + "\x86\xFD" => "\xEB\x86\x9B", + "\x86\xFE" => "\xEB\x86\x9D", + "\x87\x41" => "\xEB\x86\x9E", + "\x87\x42" => "\xEB\x86\x9F", + "\x87\x43" => "\xEB\x86\xA0", + "\x87\x44" => "\xEB\x86\xA1", + "\x87\x45" => "\xEB\x86\xA2", + "\x87\x46" => "\xEB\x86\xA3", + "\x87\x47" => "\xEB\x86\xA4", + "\x87\x48" => "\xEB\x86\xA5", + "\x87\x49" => "\xEB\x86\xA6", + "\x87\x4A" => "\xEB\x86\xA7", + "\x87\x4B" => "\xEB\x86\xA9", + "\x87\x4C" => "\xEB\x86\xAA", + "\x87\x4D" => "\xEB\x86\xAB", + "\x87\x4E" => "\xEB\x86\xAC", + "\x87\x4F" => "\xEB\x86\xAD", + "\x87\x50" => "\xEB\x86\xAE", + "\x87\x51" => "\xEB\x86\xAF", + "\x87\x52" => "\xEB\x86\xB0", + "\x87\x53" => "\xEB\x86\xB1", + "\x87\x54" => "\xEB\x86\xB2", + "\x87\x55" => "\xEB\x86\xB3", + "\x87\x56" => "\xEB\x86\xB4", + "\x87\x57" => "\xEB\x86\xB5", + "\x87\x58" => "\xEB\x86\xB6", + "\x87\x59" => "\xEB\x86\xB7", + "\x87\x5A" => "\xEB\x86\xB8", + "\x87\x61" => "\xEB\x86\xB9", + "\x87\x62" => "\xEB\x86\xBA", + "\x87\x63" => "\xEB\x86\xBB", + "\x87\x64" => "\xEB\x86\xBC", + "\x87\x65" => "\xEB\x86\xBD", + "\x87\x66" => "\xEB\x86\xBE", + "\x87\x67" => "\xEB\x86\xBF", + "\x87\x68" => "\xEB\x87\x80", + "\x87\x69" => "\xEB\x87\x81", + "\x87\x6A" => "\xEB\x87\x82", + "\x87\x6B" => "\xEB\x87\x83", + "\x87\x6C" => "\xEB\x87\x84", + "\x87\x6D" => "\xEB\x87\x85", + "\x87\x6E" => "\xEB\x87\x86", + "\x87\x6F" => "\xEB\x87\x87", + "\x87\x70" => "\xEB\x87\x88", + "\x87\x71" => "\xEB\x87\x89", + "\x87\x72" => "\xEB\x87\x8A", + "\x87\x73" => "\xEB\x87\x8B", + "\x87\x74" => "\xEB\x87\x8D", + "\x87\x75" => "\xEB\x87\x8E", + "\x87\x76" => "\xEB\x87\x8F", + "\x87\x77" => "\xEB\x87\x91", + "\x87\x78" => "\xEB\x87\x92", + "\x87\x79" => "\xEB\x87\x93", + "\x87\x7A" => "\xEB\x87\x95", + "\x87\x81" => "\xEB\x87\x96", + "\x87\x82" => "\xEB\x87\x97", + "\x87\x83" => "\xEB\x87\x98", + "\x87\x84" => "\xEB\x87\x99", + "\x87\x85" => "\xEB\x87\x9A", + "\x87\x86" => "\xEB\x87\x9B", + "\x87\x87" => "\xEB\x87\x9E", + "\x87\x88" => "\xEB\x87\xA0", + "\x87\x89" => "\xEB\x87\xA1", + "\x87\x8A" => "\xEB\x87\xA2", + "\x87\x8B" => "\xEB\x87\xA3", + "\x87\x8C" => "\xEB\x87\xA4", + "\x87\x8D" => "\xEB\x87\xA5", + "\x87\x8E" => "\xEB\x87\xA6", + "\x87\x8F" => "\xEB\x87\xA7", + "\x87\x90" => "\xEB\x87\xAA", + "\x87\x91" => "\xEB\x87\xAB", + "\x87\x92" => "\xEB\x87\xAD", + "\x87\x93" => "\xEB\x87\xAE", + "\x87\x94" => "\xEB\x87\xAF", + "\x87\x95" => "\xEB\x87\xB1", + "\x87\x96" => "\xEB\x87\xB2", + "\x87\x97" => "\xEB\x87\xB3", + "\x87\x98" => "\xEB\x87\xB4", + "\x87\x99" => "\xEB\x87\xB5", + "\x87\x9A" => "\xEB\x87\xB6", + "\x87\x9B" => "\xEB\x87\xB7", + "\x87\x9C" => "\xEB\x87\xB8", + "\x87\x9D" => "\xEB\x87\xBA", + "\x87\x9E" => "\xEB\x87\xBC", + "\x87\x9F" => "\xEB\x87\xBE", + "\x87\xA0" => "\xEB\x87\xBF", + "\x87\xA1" => "\xEB\x88\x80", + "\x87\xA2" => "\xEB\x88\x81", + "\x87\xA3" => "\xEB\x88\x82", + "\x87\xA4" => "\xEB\x88\x83", + "\x87\xA5" => "\xEB\x88\x86", + "\x87\xA6" => "\xEB\x88\x87", + "\x87\xA7" => "\xEB\x88\x89", + "\x87\xA8" => "\xEB\x88\x8A", + "\x87\xA9" => "\xEB\x88\x8D", + "\x87\xAA" => "\xEB\x88\x8E", + "\x87\xAB" => "\xEB\x88\x8F", + "\x87\xAC" => "\xEB\x88\x90", + "\x87\xAD" => "\xEB\x88\x91", + "\x87\xAE" => "\xEB\x88\x92", + "\x87\xAF" => "\xEB\x88\x93", + "\x87\xB0" => "\xEB\x88\x96", + "\x87\xB1" => "\xEB\x88\x98", + "\x87\xB2" => "\xEB\x88\x9A", + "\x87\xB3" => "\xEB\x88\x9B", + "\x87\xB4" => "\xEB\x88\x9C", + "\x87\xB5" => "\xEB\x88\x9D", + "\x87\xB6" => "\xEB\x88\x9E", + "\x87\xB7" => "\xEB\x88\x9F", + "\x87\xB8" => "\xEB\x88\xA1", + "\x87\xB9" => "\xEB\x88\xA2", + "\x87\xBA" => "\xEB\x88\xA3", + "\x87\xBB" => "\xEB\x88\xA4", + "\x87\xBC" => "\xEB\x88\xA5", + "\x87\xBD" => "\xEB\x88\xA6", + "\x87\xBE" => "\xEB\x88\xA7", + "\x87\xBF" => "\xEB\x88\xA8", + "\x87\xC0" => "\xEB\x88\xA9", + "\x87\xC1" => "\xEB\x88\xAA", + "\x87\xC2" => "\xEB\x88\xAB", + "\x87\xC3" => "\xEB\x88\xAC", + "\x87\xC4" => "\xEB\x88\xAD", + "\x87\xC5" => "\xEB\x88\xAE", + "\x87\xC6" => "\xEB\x88\xAF", + "\x87\xC7" => "\xEB\x88\xB0", + "\x87\xC8" => "\xEB\x88\xB1", + "\x87\xC9" => "\xEB\x88\xB2", + "\x87\xCA" => "\xEB\x88\xB3", + "\x87\xCB" => "\xEB\x88\xB5", + "\x87\xCC" => "\xEB\x88\xB6", + "\x87\xCD" => "\xEB\x88\xB7", + "\x87\xCE" => "\xEB\x88\xB8", + "\x87\xCF" => "\xEB\x88\xB9", + "\x87\xD0" => "\xEB\x88\xBA", + "\x87\xD1" => "\xEB\x88\xBB", + "\x87\xD2" => "\xEB\x88\xBD", + "\x87\xD3" => "\xEB\x88\xBE", + "\x87\xD4" => "\xEB\x88\xBF", + "\x87\xD5" => "\xEB\x89\x80", + "\x87\xD6" => "\xEB\x89\x81", + "\x87\xD7" => "\xEB\x89\x82", + "\x87\xD8" => "\xEB\x89\x83", + "\x87\xD9" => "\xEB\x89\x84", + "\x87\xDA" => "\xEB\x89\x85", + "\x87\xDB" => "\xEB\x89\x86", + "\x87\xDC" => "\xEB\x89\x87", + "\x87\xDD" => "\xEB\x89\x88", + "\x87\xDE" => "\xEB\x89\x89", + "\x87\xDF" => "\xEB\x89\x8A", + "\x87\xE0" => "\xEB\x89\x8B", + "\x87\xE1" => "\xEB\x89\x8C", + "\x87\xE2" => "\xEB\x89\x8D", + "\x87\xE3" => "\xEB\x89\x8E", + "\x87\xE4" => "\xEB\x89\x8F", + "\x87\xE5" => "\xEB\x89\x90", + "\x87\xE6" => "\xEB\x89\x91", + "\x87\xE7" => "\xEB\x89\x92", + "\x87\xE8" => "\xEB\x89\x93", + "\x87\xE9" => "\xEB\x89\x94", + "\x87\xEA" => "\xEB\x89\x95", + "\x87\xEB" => "\xEB\x89\x96", + "\x87\xEC" => "\xEB\x89\x97", + "\x87\xED" => "\xEB\x89\x99", + "\x87\xEE" => "\xEB\x89\x9A", + "\x87\xEF" => "\xEB\x89\x9B", + "\x87\xF0" => "\xEB\x89\x9D", + "\x87\xF1" => "\xEB\x89\x9E", + "\x87\xF2" => "\xEB\x89\x9F", + "\x87\xF3" => "\xEB\x89\xA1", + "\x87\xF4" => "\xEB\x89\xA2", + "\x87\xF5" => "\xEB\x89\xA3", + "\x87\xF6" => "\xEB\x89\xA4", + "\x87\xF7" => "\xEB\x89\xA5", + "\x87\xF8" => "\xEB\x89\xA6", + "\x87\xF9" => "\xEB\x89\xA7", + "\x87\xFA" => "\xEB\x89\xAA", + "\x87\xFB" => "\xEB\x89\xAB", + "\x87\xFC" => "\xEB\x89\xAC", + "\x87\xFD" => "\xEB\x89\xAD", + "\x87\xFE" => "\xEB\x89\xAE", + "\x88\x41" => "\xEB\x89\xAF", + "\x88\x42" => "\xEB\x89\xB0", + "\x88\x43" => "\xEB\x89\xB1", + "\x88\x44" => "\xEB\x89\xB2", + "\x88\x45" => "\xEB\x89\xB3", + "\x88\x46" => "\xEB\x89\xB6", + "\x88\x47" => "\xEB\x89\xB7", + "\x88\x48" => "\xEB\x89\xB8", + "\x88\x49" => "\xEB\x89\xB9", + "\x88\x4A" => "\xEB\x89\xBA", + "\x88\x4B" => "\xEB\x89\xBB", + "\x88\x4C" => "\xEB\x89\xBD", + "\x88\x4D" => "\xEB\x89\xBE", + "\x88\x4E" => "\xEB\x89\xBF", + "\x88\x4F" => "\xEB\x8A\x80", + "\x88\x50" => "\xEB\x8A\x81", + "\x88\x51" => "\xEB\x8A\x82", + "\x88\x52" => "\xEB\x8A\x83", + "\x88\x53" => "\xEB\x8A\x86", + "\x88\x54" => "\xEB\x8A\x87", + "\x88\x55" => "\xEB\x8A\x88", + "\x88\x56" => "\xEB\x8A\x8A", + "\x88\x57" => "\xEB\x8A\x8B", + "\x88\x58" => "\xEB\x8A\x8C", + "\x88\x59" => "\xEB\x8A\x8D", + "\x88\x5A" => "\xEB\x8A\x8E", + "\x88\x61" => "\xEB\x8A\x8F", + "\x88\x62" => "\xEB\x8A\x92", + "\x88\x63" => "\xEB\x8A\x93", + "\x88\x64" => "\xEB\x8A\x95", + "\x88\x65" => "\xEB\x8A\x96", + "\x88\x66" => "\xEB\x8A\x97", + "\x88\x67" => "\xEB\x8A\x9B", + "\x88\x68" => "\xEB\x8A\x9C", + "\x88\x69" => "\xEB\x8A\x9D", + "\x88\x6A" => "\xEB\x8A\x9E", + "\x88\x6B" => "\xEB\x8A\x9F", + "\x88\x6C" => "\xEB\x8A\xA2", + "\x88\x6D" => "\xEB\x8A\xA4", + "\x88\x6E" => "\xEB\x8A\xA7", + "\x88\x6F" => "\xEB\x8A\xA8", + "\x88\x70" => "\xEB\x8A\xA9", + "\x88\x71" => "\xEB\x8A\xAB", + "\x88\x72" => "\xEB\x8A\xAD", + "\x88\x73" => "\xEB\x8A\xAE", + "\x88\x74" => "\xEB\x8A\xAF", + "\x88\x75" => "\xEB\x8A\xB1", + "\x88\x76" => "\xEB\x8A\xB2", + "\x88\x77" => "\xEB\x8A\xB3", + "\x88\x78" => "\xEB\x8A\xB5", + "\x88\x79" => "\xEB\x8A\xB6", + "\x88\x7A" => "\xEB\x8A\xB7", + "\x88\x81" => "\xEB\x8A\xB8", + "\x88\x82" => "\xEB\x8A\xB9", + "\x88\x83" => "\xEB\x8A\xBA", + "\x88\x84" => "\xEB\x8A\xBB", + "\x88\x85" => "\xEB\x8A\xBC", + "\x88\x86" => "\xEB\x8A\xBD", + "\x88\x87" => "\xEB\x8A\xBE", + "\x88\x88" => "\xEB\x8A\xBF", + "\x88\x89" => "\xEB\x8B\x80", + "\x88\x8A" => "\xEB\x8B\x81", + "\x88\x8B" => "\xEB\x8B\x82", + "\x88\x8C" => "\xEB\x8B\x83", + "\x88\x8D" => "\xEB\x8B\x84", + "\x88\x8E" => "\xEB\x8B\x85", + "\x88\x8F" => "\xEB\x8B\x86", + "\x88\x90" => "\xEB\x8B\x87", + "\x88\x91" => "\xEB\x8B\x8A", + "\x88\x92" => "\xEB\x8B\x8B", + "\x88\x93" => "\xEB\x8B\x8D", + "\x88\x94" => "\xEB\x8B\x8E", + "\x88\x95" => "\xEB\x8B\x8F", + "\x88\x96" => "\xEB\x8B\x91", + "\x88\x97" => "\xEB\x8B\x93", + "\x88\x98" => "\xEB\x8B\x94", + "\x88\x99" => "\xEB\x8B\x95", + "\x88\x9A" => "\xEB\x8B\x96", + "\x88\x9B" => "\xEB\x8B\x97", + "\x88\x9C" => "\xEB\x8B\x9A", + "\x88\x9D" => "\xEB\x8B\x9C", + "\x88\x9E" => "\xEB\x8B\x9E", + "\x88\x9F" => "\xEB\x8B\x9F", + "\x88\xA0" => "\xEB\x8B\xA0", + "\x88\xA1" => "\xEB\x8B\xA1", + "\x88\xA2" => "\xEB\x8B\xA3", + "\x88\xA3" => "\xEB\x8B\xA7", + "\x88\xA4" => "\xEB\x8B\xA9", + "\x88\xA5" => "\xEB\x8B\xAA", + "\x88\xA6" => "\xEB\x8B\xB0", + "\x88\xA7" => "\xEB\x8B\xB1", + "\x88\xA8" => "\xEB\x8B\xB2", + "\x88\xA9" => "\xEB\x8B\xB6", + "\x88\xAA" => "\xEB\x8B\xBC", + "\x88\xAB" => "\xEB\x8B\xBD", + "\x88\xAC" => "\xEB\x8B\xBE", + "\x88\xAD" => "\xEB\x8C\x82", + "\x88\xAE" => "\xEB\x8C\x83", + "\x88\xAF" => "\xEB\x8C\x85", + "\x88\xB0" => "\xEB\x8C\x86", + "\x88\xB1" => "\xEB\x8C\x87", + "\x88\xB2" => "\xEB\x8C\x89", + "\x88\xB3" => "\xEB\x8C\x8A", + "\x88\xB4" => "\xEB\x8C\x8B", + "\x88\xB5" => "\xEB\x8C\x8C", + "\x88\xB6" => "\xEB\x8C\x8D", + "\x88\xB7" => "\xEB\x8C\x8E", + "\x88\xB8" => "\xEB\x8C\x8F", + "\x88\xB9" => "\xEB\x8C\x92", + "\x88\xBA" => "\xEB\x8C\x96", + "\x88\xBB" => "\xEB\x8C\x97", + "\x88\xBC" => "\xEB\x8C\x98", + "\x88\xBD" => "\xEB\x8C\x99", + "\x88\xBE" => "\xEB\x8C\x9A", + "\x88\xBF" => "\xEB\x8C\x9B", + "\x88\xC0" => "\xEB\x8C\x9D", + "\x88\xC1" => "\xEB\x8C\x9E", + "\x88\xC2" => "\xEB\x8C\x9F", + "\x88\xC3" => "\xEB\x8C\xA0", + "\x88\xC4" => "\xEB\x8C\xA1", + "\x88\xC5" => "\xEB\x8C\xA2", + "\x88\xC6" => "\xEB\x8C\xA3", + "\x88\xC7" => "\xEB\x8C\xA4", + "\x88\xC8" => "\xEB\x8C\xA5", + "\x88\xC9" => "\xEB\x8C\xA6", + "\x88\xCA" => "\xEB\x8C\xA7", + "\x88\xCB" => "\xEB\x8C\xA8", + "\x88\xCC" => "\xEB\x8C\xA9", + "\x88\xCD" => "\xEB\x8C\xAA", + "\x88\xCE" => "\xEB\x8C\xAB", + "\x88\xCF" => "\xEB\x8C\xAC", + "\x88\xD0" => "\xEB\x8C\xAD", + "\x88\xD1" => "\xEB\x8C\xAE", + "\x88\xD2" => "\xEB\x8C\xAF", + "\x88\xD3" => "\xEB\x8C\xB0", + "\x88\xD4" => "\xEB\x8C\xB1", + "\x88\xD5" => "\xEB\x8C\xB2", + "\x88\xD6" => "\xEB\x8C\xB3", + "\x88\xD7" => "\xEB\x8C\xB4", + "\x88\xD8" => "\xEB\x8C\xB5", + "\x88\xD9" => "\xEB\x8C\xB6", + "\x88\xDA" => "\xEB\x8C\xB7", + "\x88\xDB" => "\xEB\x8C\xB8", + "\x88\xDC" => "\xEB\x8C\xB9", + "\x88\xDD" => "\xEB\x8C\xBA", + "\x88\xDE" => "\xEB\x8C\xBB", + "\x88\xDF" => "\xEB\x8C\xBC", + "\x88\xE0" => "\xEB\x8C\xBD", + "\x88\xE1" => "\xEB\x8C\xBE", + "\x88\xE2" => "\xEB\x8C\xBF", + "\x88\xE3" => "\xEB\x8D\x80", + "\x88\xE4" => "\xEB\x8D\x81", + "\x88\xE5" => "\xEB\x8D\x82", + "\x88\xE6" => "\xEB\x8D\x83", + "\x88\xE7" => "\xEB\x8D\x84", + "\x88\xE8" => "\xEB\x8D\x85", + "\x88\xE9" => "\xEB\x8D\x86", + "\x88\xEA" => "\xEB\x8D\x87", + "\x88\xEB" => "\xEB\x8D\x88", + "\x88\xEC" => "\xEB\x8D\x89", + "\x88\xED" => "\xEB\x8D\x8A", + "\x88\xEE" => "\xEB\x8D\x8B", + "\x88\xEF" => "\xEB\x8D\x8C", + "\x88\xF0" => "\xEB\x8D\x8D", + "\x88\xF1" => "\xEB\x8D\x8E", + "\x88\xF2" => "\xEB\x8D\x8F", + "\x88\xF3" => "\xEB\x8D\x90", + "\x88\xF4" => "\xEB\x8D\x91", + "\x88\xF5" => "\xEB\x8D\x92", + "\x88\xF6" => "\xEB\x8D\x93", + "\x88\xF7" => "\xEB\x8D\x97", + "\x88\xF8" => "\xEB\x8D\x99", + "\x88\xF9" => "\xEB\x8D\x9A", + "\x88\xFA" => "\xEB\x8D\x9D", + "\x88\xFB" => "\xEB\x8D\xA0", + "\x88\xFC" => "\xEB\x8D\xA1", + "\x88\xFD" => "\xEB\x8D\xA2", + "\x88\xFE" => "\xEB\x8D\xA3", + "\x89\x41" => "\xEB\x8D\xA6", + "\x89\x42" => "\xEB\x8D\xA8", + "\x89\x43" => "\xEB\x8D\xAA", + "\x89\x44" => "\xEB\x8D\xAC", + "\x89\x45" => "\xEB\x8D\xAD", + "\x89\x46" => "\xEB\x8D\xAF", + "\x89\x47" => "\xEB\x8D\xB2", + "\x89\x48" => "\xEB\x8D\xB3", + "\x89\x49" => "\xEB\x8D\xB5", + "\x89\x4A" => "\xEB\x8D\xB6", + "\x89\x4B" => "\xEB\x8D\xB7", + "\x89\x4C" => "\xEB\x8D\xB9", + "\x89\x4D" => "\xEB\x8D\xBA", + "\x89\x4E" => "\xEB\x8D\xBB", + "\x89\x4F" => "\xEB\x8D\xBC", + "\x89\x50" => "\xEB\x8D\xBD", + "\x89\x51" => "\xEB\x8D\xBE", + "\x89\x52" => "\xEB\x8D\xBF", + "\x89\x53" => "\xEB\x8E\x82", + "\x89\x54" => "\xEB\x8E\x86", + "\x89\x55" => "\xEB\x8E\x87", + "\x89\x56" => "\xEB\x8E\x88", + "\x89\x57" => "\xEB\x8E\x89", + "\x89\x58" => "\xEB\x8E\x8A", + "\x89\x59" => "\xEB\x8E\x8B", + "\x89\x5A" => "\xEB\x8E\x8D", + "\x89\x61" => "\xEB\x8E\x8E", + "\x89\x62" => "\xEB\x8E\x8F", + "\x89\x63" => "\xEB\x8E\x91", + "\x89\x64" => "\xEB\x8E\x92", + "\x89\x65" => "\xEB\x8E\x93", + "\x89\x66" => "\xEB\x8E\x95", + "\x89\x67" => "\xEB\x8E\x96", + "\x89\x68" => "\xEB\x8E\x97", + "\x89\x69" => "\xEB\x8E\x98", + "\x89\x6A" => "\xEB\x8E\x99", + "\x89\x6B" => "\xEB\x8E\x9A", + "\x89\x6C" => "\xEB\x8E\x9B", + "\x89\x6D" => "\xEB\x8E\x9C", + "\x89\x6E" => "\xEB\x8E\x9D", + "\x89\x6F" => "\xEB\x8E\x9E", + "\x89\x70" => "\xEB\x8E\x9F", + "\x89\x71" => "\xEB\x8E\xA2", + "\x89\x72" => "\xEB\x8E\xA3", + "\x89\x73" => "\xEB\x8E\xA4", + "\x89\x74" => "\xEB\x8E\xA5", + "\x89\x75" => "\xEB\x8E\xA6", + "\x89\x76" => "\xEB\x8E\xA7", + "\x89\x77" => "\xEB\x8E\xA9", + "\x89\x78" => "\xEB\x8E\xAA", + "\x89\x79" => "\xEB\x8E\xAB", + "\x89\x7A" => "\xEB\x8E\xAD", + "\x89\x81" => "\xEB\x8E\xAE", + "\x89\x82" => "\xEB\x8E\xAF", + "\x89\x83" => "\xEB\x8E\xB0", + "\x89\x84" => "\xEB\x8E\xB1", + "\x89\x85" => "\xEB\x8E\xB2", + "\x89\x86" => "\xEB\x8E\xB3", + "\x89\x87" => "\xEB\x8E\xB4", + "\x89\x88" => "\xEB\x8E\xB5", + "\x89\x89" => "\xEB\x8E\xB6", + "\x89\x8A" => "\xEB\x8E\xB7", + "\x89\x8B" => "\xEB\x8E\xB8", + "\x89\x8C" => "\xEB\x8E\xB9", + "\x89\x8D" => "\xEB\x8E\xBA", + "\x89\x8E" => "\xEB\x8E\xBB", + "\x89\x8F" => "\xEB\x8E\xBC", + "\x89\x90" => "\xEB\x8E\xBD", + "\x89\x91" => "\xEB\x8E\xBE", + "\x89\x92" => "\xEB\x8E\xBF", + "\x89\x93" => "\xEB\x8F\x80", + "\x89\x94" => "\xEB\x8F\x81", + "\x89\x95" => "\xEB\x8F\x82", + "\x89\x96" => "\xEB\x8F\x83", + "\x89\x97" => "\xEB\x8F\x86", + "\x89\x98" => "\xEB\x8F\x87", + "\x89\x99" => "\xEB\x8F\x89", + "\x89\x9A" => "\xEB\x8F\x8A", + "\x89\x9B" => "\xEB\x8F\x8D", + "\x89\x9C" => "\xEB\x8F\x8F", + "\x89\x9D" => "\xEB\x8F\x91", + "\x89\x9E" => "\xEB\x8F\x92", + "\x89\x9F" => "\xEB\x8F\x93", + "\x89\xA0" => "\xEB\x8F\x96", + "\x89\xA1" => "\xEB\x8F\x98", + "\x89\xA2" => "\xEB\x8F\x9A", + "\x89\xA3" => "\xEB\x8F\x9C", + "\x89\xA4" => "\xEB\x8F\x9E", + "\x89\xA5" => "\xEB\x8F\x9F", + "\x89\xA6" => "\xEB\x8F\xA1", + "\x89\xA7" => "\xEB\x8F\xA2", + "\x89\xA8" => "\xEB\x8F\xA3", + "\x89\xA9" => "\xEB\x8F\xA5", + "\x89\xAA" => "\xEB\x8F\xA6", + "\x89\xAB" => "\xEB\x8F\xA7", + "\x89\xAC" => "\xEB\x8F\xA9", + "\x89\xAD" => "\xEB\x8F\xAA", + "\x89\xAE" => "\xEB\x8F\xAB", + "\x89\xAF" => "\xEB\x8F\xAC", + "\x89\xB0" => "\xEB\x8F\xAD", + "\x89\xB1" => "\xEB\x8F\xAE", + "\x89\xB2" => "\xEB\x8F\xAF", + "\x89\xB3" => "\xEB\x8F\xB0", + "\x89\xB4" => "\xEB\x8F\xB1", + "\x89\xB5" => "\xEB\x8F\xB2", + "\x89\xB6" => "\xEB\x8F\xB3", + "\x89\xB7" => "\xEB\x8F\xB4", + "\x89\xB8" => "\xEB\x8F\xB5", + "\x89\xB9" => "\xEB\x8F\xB6", + "\x89\xBA" => "\xEB\x8F\xB7", + "\x89\xBB" => "\xEB\x8F\xB8", + "\x89\xBC" => "\xEB\x8F\xB9", + "\x89\xBD" => "\xEB\x8F\xBA", + "\x89\xBE" => "\xEB\x8F\xBB", + "\x89\xBF" => "\xEB\x8F\xBD", + "\x89\xC0" => "\xEB\x8F\xBE", + "\x89\xC1" => "\xEB\x8F\xBF", + "\x89\xC2" => "\xEB\x90\x80", + "\x89\xC3" => "\xEB\x90\x81", + "\x89\xC4" => "\xEB\x90\x82", + "\x89\xC5" => "\xEB\x90\x83", + "\x89\xC6" => "\xEB\x90\x84", + "\x89\xC7" => "\xEB\x90\x85", + "\x89\xC8" => "\xEB\x90\x86", + "\x89\xC9" => "\xEB\x90\x87", + "\x89\xCA" => "\xEB\x90\x88", + "\x89\xCB" => "\xEB\x90\x89", + "\x89\xCC" => "\xEB\x90\x8A", + "\x89\xCD" => "\xEB\x90\x8B", + "\x89\xCE" => "\xEB\x90\x8C", + "\x89\xCF" => "\xEB\x90\x8D", + "\x89\xD0" => "\xEB\x90\x8E", + "\x89\xD1" => "\xEB\x90\x8F", + "\x89\xD2" => "\xEB\x90\x91", + "\x89\xD3" => "\xEB\x90\x92", + "\x89\xD4" => "\xEB\x90\x93", + "\x89\xD5" => "\xEB\x90\x94", + "\x89\xD6" => "\xEB\x90\x95", + "\x89\xD7" => "\xEB\x90\x96", + "\x89\xD8" => "\xEB\x90\x97", + "\x89\xD9" => "\xEB\x90\x99", + "\x89\xDA" => "\xEB\x90\x9A", + "\x89\xDB" => "\xEB\x90\x9B", + "\x89\xDC" => "\xEB\x90\x9D", + "\x89\xDD" => "\xEB\x90\x9E", + "\x89\xDE" => "\xEB\x90\x9F", + "\x89\xDF" => "\xEB\x90\xA1", + "\x89\xE0" => "\xEB\x90\xA2", + "\x89\xE1" => "\xEB\x90\xA3", + "\x89\xE2" => "\xEB\x90\xA4", + "\x89\xE3" => "\xEB\x90\xA5", + "\x89\xE4" => "\xEB\x90\xA6", + "\x89\xE5" => "\xEB\x90\xA7", + "\x89\xE6" => "\xEB\x90\xAA", + "\x89\xE7" => "\xEB\x90\xAC", + "\x89\xE8" => "\xEB\x90\xAD", + "\x89\xE9" => "\xEB\x90\xAE", + "\x89\xEA" => "\xEB\x90\xAF", + "\x89\xEB" => "\xEB\x90\xB0", + "\x89\xEC" => "\xEB\x90\xB1", + "\x89\xED" => "\xEB\x90\xB2", + "\x89\xEE" => "\xEB\x90\xB3", + "\x89\xEF" => "\xEB\x90\xB5", + "\x89\xF0" => "\xEB\x90\xB6", + "\x89\xF1" => "\xEB\x90\xB7", + "\x89\xF2" => "\xEB\x90\xB8", + "\x89\xF3" => "\xEB\x90\xB9", + "\x89\xF4" => "\xEB\x90\xBA", + "\x89\xF5" => "\xEB\x90\xBB", + "\x89\xF6" => "\xEB\x90\xBC", + "\x89\xF7" => "\xEB\x90\xBD", + "\x89\xF8" => "\xEB\x90\xBE", + "\x89\xF9" => "\xEB\x90\xBF", + "\x89\xFA" => "\xEB\x91\x80", + "\x89\xFB" => "\xEB\x91\x81", + "\x89\xFC" => "\xEB\x91\x82", + "\x89\xFD" => "\xEB\x91\x83", + "\x89\xFE" => "\xEB\x91\x84", + "\x8A\x41" => "\xEB\x91\x85", + "\x8A\x42" => "\xEB\x91\x86", + "\x8A\x43" => "\xEB\x91\x87", + "\x8A\x44" => "\xEB\x91\x88", + "\x8A\x45" => "\xEB\x91\x89", + "\x8A\x46" => "\xEB\x91\x8A", + "\x8A\x47" => "\xEB\x91\x8B", + "\x8A\x48" => "\xEB\x91\x8C", + "\x8A\x49" => "\xEB\x91\x8D", + "\x8A\x4A" => "\xEB\x91\x8E", + "\x8A\x4B" => "\xEB\x91\x8F", + "\x8A\x4C" => "\xEB\x91\x92", + "\x8A\x4D" => "\xEB\x91\x93", + "\x8A\x4E" => "\xEB\x91\x95", + "\x8A\x4F" => "\xEB\x91\x96", + "\x8A\x50" => "\xEB\x91\x97", + "\x8A\x51" => "\xEB\x91\x99", + "\x8A\x52" => "\xEB\x91\x9A", + "\x8A\x53" => "\xEB\x91\x9B", + "\x8A\x54" => "\xEB\x91\x9C", + "\x8A\x55" => "\xEB\x91\x9D", + "\x8A\x56" => "\xEB\x91\x9E", + "\x8A\x57" => "\xEB\x91\x9F", + "\x8A\x58" => "\xEB\x91\xA2", + "\x8A\x59" => "\xEB\x91\xA4", + "\x8A\x5A" => "\xEB\x91\xA6", + "\x8A\x61" => "\xEB\x91\xA7", + "\x8A\x62" => "\xEB\x91\xA8", + "\x8A\x63" => "\xEB\x91\xA9", + "\x8A\x64" => "\xEB\x91\xAA", + "\x8A\x65" => "\xEB\x91\xAB", + "\x8A\x66" => "\xEB\x91\xAD", + "\x8A\x67" => "\xEB\x91\xAE", + "\x8A\x68" => "\xEB\x91\xAF", + "\x8A\x69" => "\xEB\x91\xB0", + "\x8A\x6A" => "\xEB\x91\xB1", + "\x8A\x6B" => "\xEB\x91\xB2", + "\x8A\x6C" => "\xEB\x91\xB3", + "\x8A\x6D" => "\xEB\x91\xB4", + "\x8A\x6E" => "\xEB\x91\xB5", + "\x8A\x6F" => "\xEB\x91\xB6", + "\x8A\x70" => "\xEB\x91\xB7", + "\x8A\x71" => "\xEB\x91\xB8", + "\x8A\x72" => "\xEB\x91\xB9", + "\x8A\x73" => "\xEB\x91\xBA", + "\x8A\x74" => "\xEB\x91\xBB", + "\x8A\x75" => "\xEB\x91\xBC", + "\x8A\x76" => "\xEB\x91\xBD", + "\x8A\x77" => "\xEB\x91\xBE", + "\x8A\x78" => "\xEB\x91\xBF", + "\x8A\x79" => "\xEB\x92\x81", + "\x8A\x7A" => "\xEB\x92\x82", + "\x8A\x81" => "\xEB\x92\x83", + "\x8A\x82" => "\xEB\x92\x84", + "\x8A\x83" => "\xEB\x92\x85", + "\x8A\x84" => "\xEB\x92\x86", + "\x8A\x85" => "\xEB\x92\x87", + "\x8A\x86" => "\xEB\x92\x89", + "\x8A\x87" => "\xEB\x92\x8A", + "\x8A\x88" => "\xEB\x92\x8B", + "\x8A\x89" => "\xEB\x92\x8C", + "\x8A\x8A" => "\xEB\x92\x8D", + "\x8A\x8B" => "\xEB\x92\x8E", + "\x8A\x8C" => "\xEB\x92\x8F", + "\x8A\x8D" => "\xEB\x92\x90", + "\x8A\x8E" => "\xEB\x92\x91", + "\x8A\x8F" => "\xEB\x92\x92", + "\x8A\x90" => "\xEB\x92\x93", + "\x8A\x91" => "\xEB\x92\x94", + "\x8A\x92" => "\xEB\x92\x95", + "\x8A\x93" => "\xEB\x92\x96", + "\x8A\x94" => "\xEB\x92\x97", + "\x8A\x95" => "\xEB\x92\x98", + "\x8A\x96" => "\xEB\x92\x99", + "\x8A\x97" => "\xEB\x92\x9A", + "\x8A\x98" => "\xEB\x92\x9B", + "\x8A\x99" => "\xEB\x92\x9C", + "\x8A\x9A" => "\xEB\x92\x9E", + "\x8A\x9B" => "\xEB\x92\x9F", + "\x8A\x9C" => "\xEB\x92\xA0", + "\x8A\x9D" => "\xEB\x92\xA1", + "\x8A\x9E" => "\xEB\x92\xA2", + "\x8A\x9F" => "\xEB\x92\xA3", + "\x8A\xA0" => "\xEB\x92\xA5", + "\x8A\xA1" => "\xEB\x92\xA6", + "\x8A\xA2" => "\xEB\x92\xA7", + "\x8A\xA3" => "\xEB\x92\xA9", + "\x8A\xA4" => "\xEB\x92\xAA", + "\x8A\xA5" => "\xEB\x92\xAB", + "\x8A\xA6" => "\xEB\x92\xAD", + "\x8A\xA7" => "\xEB\x92\xAE", + "\x8A\xA8" => "\xEB\x92\xAF", + "\x8A\xA9" => "\xEB\x92\xB0", + "\x8A\xAA" => "\xEB\x92\xB1", + "\x8A\xAB" => "\xEB\x92\xB2", + "\x8A\xAC" => "\xEB\x92\xB3", + "\x8A\xAD" => "\xEB\x92\xB4", + "\x8A\xAE" => "\xEB\x92\xB6", + "\x8A\xAF" => "\xEB\x92\xB8", + "\x8A\xB0" => "\xEB\x92\xBA", + "\x8A\xB1" => "\xEB\x92\xBB", + "\x8A\xB2" => "\xEB\x92\xBC", + "\x8A\xB3" => "\xEB\x92\xBD", + "\x8A\xB4" => "\xEB\x92\xBE", + "\x8A\xB5" => "\xEB\x92\xBF", + "\x8A\xB6" => "\xEB\x93\x81", + "\x8A\xB7" => "\xEB\x93\x82", + "\x8A\xB8" => "\xEB\x93\x83", + "\x8A\xB9" => "\xEB\x93\x85", + "\x8A\xBA" => "\xEB\x93\x86", + "\x8A\xBB" => "\xEB\x93\x87", + "\x8A\xBC" => "\xEB\x93\x89", + "\x8A\xBD" => "\xEB\x93\x8A", + "\x8A\xBE" => "\xEB\x93\x8B", + "\x8A\xBF" => "\xEB\x93\x8C", + "\x8A\xC0" => "\xEB\x93\x8D", + "\x8A\xC1" => "\xEB\x93\x8E", + "\x8A\xC2" => "\xEB\x93\x8F", + "\x8A\xC3" => "\xEB\x93\x91", + "\x8A\xC4" => "\xEB\x93\x92", + "\x8A\xC5" => "\xEB\x93\x93", + "\x8A\xC6" => "\xEB\x93\x94", + "\x8A\xC7" => "\xEB\x93\x96", + "\x8A\xC8" => "\xEB\x93\x97", + "\x8A\xC9" => "\xEB\x93\x98", + "\x8A\xCA" => "\xEB\x93\x99", + "\x8A\xCB" => "\xEB\x93\x9A", + "\x8A\xCC" => "\xEB\x93\x9B", + "\x8A\xCD" => "\xEB\x93\x9E", + "\x8A\xCE" => "\xEB\x93\x9F", + "\x8A\xCF" => "\xEB\x93\xA1", + "\x8A\xD0" => "\xEB\x93\xA2", + "\x8A\xD1" => "\xEB\x93\xA5", + "\x8A\xD2" => "\xEB\x93\xA7", + "\x8A\xD3" => "\xEB\x93\xA8", + "\x8A\xD4" => "\xEB\x93\xA9", + "\x8A\xD5" => "\xEB\x93\xAA", + "\x8A\xD6" => "\xEB\x93\xAB", + "\x8A\xD7" => "\xEB\x93\xAE", + "\x8A\xD8" => "\xEB\x93\xB0", + "\x8A\xD9" => "\xEB\x93\xB2", + "\x8A\xDA" => "\xEB\x93\xB3", + "\x8A\xDB" => "\xEB\x93\xB4", + "\x8A\xDC" => "\xEB\x93\xB5", + "\x8A\xDD" => "\xEB\x93\xB6", + "\x8A\xDE" => "\xEB\x93\xB7", + "\x8A\xDF" => "\xEB\x93\xB9", + "\x8A\xE0" => "\xEB\x93\xBA", + "\x8A\xE1" => "\xEB\x93\xBB", + "\x8A\xE2" => "\xEB\x93\xBC", + "\x8A\xE3" => "\xEB\x93\xBD", + "\x8A\xE4" => "\xEB\x93\xBE", + "\x8A\xE5" => "\xEB\x93\xBF", + "\x8A\xE6" => "\xEB\x94\x80", + "\x8A\xE7" => "\xEB\x94\x81", + "\x8A\xE8" => "\xEB\x94\x82", + "\x8A\xE9" => "\xEB\x94\x83", + "\x8A\xEA" => "\xEB\x94\x84", + "\x8A\xEB" => "\xEB\x94\x85", + "\x8A\xEC" => "\xEB\x94\x86", + "\x8A\xED" => "\xEB\x94\x87", + "\x8A\xEE" => "\xEB\x94\x88", + "\x8A\xEF" => "\xEB\x94\x89", + "\x8A\xF0" => "\xEB\x94\x8A", + "\x8A\xF1" => "\xEB\x94\x8B", + "\x8A\xF2" => "\xEB\x94\x8C", + "\x8A\xF3" => "\xEB\x94\x8D", + "\x8A\xF4" => "\xEB\x94\x8E", + "\x8A\xF5" => "\xEB\x94\x8F", + "\x8A\xF6" => "\xEB\x94\x90", + "\x8A\xF7" => "\xEB\x94\x91", + "\x8A\xF8" => "\xEB\x94\x92", + "\x8A\xF9" => "\xEB\x94\x93", + "\x8A\xFA" => "\xEB\x94\x96", + "\x8A\xFB" => "\xEB\x94\x97", + "\x8A\xFC" => "\xEB\x94\x99", + "\x8A\xFD" => "\xEB\x94\x9A", + "\x8A\xFE" => "\xEB\x94\x9D", + "\x8B\x41" => "\xEB\x94\x9E", + "\x8B\x42" => "\xEB\x94\x9F", + "\x8B\x43" => "\xEB\x94\xA0", + "\x8B\x44" => "\xEB\x94\xA1", + "\x8B\x45" => "\xEB\x94\xA2", + "\x8B\x46" => "\xEB\x94\xA3", + "\x8B\x47" => "\xEB\x94\xA6", + "\x8B\x48" => "\xEB\x94\xAB", + "\x8B\x49" => "\xEB\x94\xAC", + "\x8B\x4A" => "\xEB\x94\xAD", + "\x8B\x4B" => "\xEB\x94\xAE", + "\x8B\x4C" => "\xEB\x94\xAF", + "\x8B\x4D" => "\xEB\x94\xB2", + "\x8B\x4E" => "\xEB\x94\xB3", + "\x8B\x4F" => "\xEB\x94\xB5", + "\x8B\x50" => "\xEB\x94\xB6", + "\x8B\x51" => "\xEB\x94\xB7", + "\x8B\x52" => "\xEB\x94\xB9", + "\x8B\x53" => "\xEB\x94\xBA", + "\x8B\x54" => "\xEB\x94\xBB", + "\x8B\x55" => "\xEB\x94\xBC", + "\x8B\x56" => "\xEB\x94\xBD", + "\x8B\x57" => "\xEB\x94\xBE", + "\x8B\x58" => "\xEB\x94\xBF", + "\x8B\x59" => "\xEB\x95\x82", + "\x8B\x5A" => "\xEB\x95\x86", + "\x8B\x61" => "\xEB\x95\x87", + "\x8B\x62" => "\xEB\x95\x88", + "\x8B\x63" => "\xEB\x95\x89", + "\x8B\x64" => "\xEB\x95\x8A", + "\x8B\x65" => "\xEB\x95\x8E", + "\x8B\x66" => "\xEB\x95\x8F", + "\x8B\x67" => "\xEB\x95\x91", + "\x8B\x68" => "\xEB\x95\x92", + "\x8B\x69" => "\xEB\x95\x93", + "\x8B\x6A" => "\xEB\x95\x95", + "\x8B\x6B" => "\xEB\x95\x96", + "\x8B\x6C" => "\xEB\x95\x97", + "\x8B\x6D" => "\xEB\x95\x98", + "\x8B\x6E" => "\xEB\x95\x99", + "\x8B\x6F" => "\xEB\x95\x9A", + "\x8B\x70" => "\xEB\x95\x9B", + "\x8B\x71" => "\xEB\x95\x9E", + "\x8B\x72" => "\xEB\x95\xA2", + "\x8B\x73" => "\xEB\x95\xA3", + "\x8B\x74" => "\xEB\x95\xA4", + "\x8B\x75" => "\xEB\x95\xA5", + "\x8B\x76" => "\xEB\x95\xA6", + "\x8B\x77" => "\xEB\x95\xA7", + "\x8B\x78" => "\xEB\x95\xA8", + "\x8B\x79" => "\xEB\x95\xA9", + "\x8B\x7A" => "\xEB\x95\xAA", + "\x8B\x81" => "\xEB\x95\xAB", + "\x8B\x82" => "\xEB\x95\xAC", + "\x8B\x83" => "\xEB\x95\xAD", + "\x8B\x84" => "\xEB\x95\xAE", + "\x8B\x85" => "\xEB\x95\xAF", + "\x8B\x86" => "\xEB\x95\xB0", + "\x8B\x87" => "\xEB\x95\xB1", + "\x8B\x88" => "\xEB\x95\xB2", + "\x8B\x89" => "\xEB\x95\xB3", + "\x8B\x8A" => "\xEB\x95\xB4", + "\x8B\x8B" => "\xEB\x95\xB5", + "\x8B\x8C" => "\xEB\x95\xB6", + "\x8B\x8D" => "\xEB\x95\xB7", + "\x8B\x8E" => "\xEB\x95\xB8", + "\x8B\x8F" => "\xEB\x95\xB9", + "\x8B\x90" => "\xEB\x95\xBA", + "\x8B\x91" => "\xEB\x95\xBB", + "\x8B\x92" => "\xEB\x95\xBC", + "\x8B\x93" => "\xEB\x95\xBD", + "\x8B\x94" => "\xEB\x95\xBE", + "\x8B\x95" => "\xEB\x95\xBF", + "\x8B\x96" => "\xEB\x96\x80", + "\x8B\x97" => "\xEB\x96\x81", + "\x8B\x98" => "\xEB\x96\x82", + "\x8B\x99" => "\xEB\x96\x83", + "\x8B\x9A" => "\xEB\x96\x84", + "\x8B\x9B" => "\xEB\x96\x85", + "\x8B\x9C" => "\xEB\x96\x86", + "\x8B\x9D" => "\xEB\x96\x87", + "\x8B\x9E" => "\xEB\x96\x88", + "\x8B\x9F" => "\xEB\x96\x89", + "\x8B\xA0" => "\xEB\x96\x8A", + "\x8B\xA1" => "\xEB\x96\x8B", + "\x8B\xA2" => "\xEB\x96\x8C", + "\x8B\xA3" => "\xEB\x96\x8D", + "\x8B\xA4" => "\xEB\x96\x8E", + "\x8B\xA5" => "\xEB\x96\x8F", + "\x8B\xA6" => "\xEB\x96\x90", + "\x8B\xA7" => "\xEB\x96\x91", + "\x8B\xA8" => "\xEB\x96\x92", + "\x8B\xA9" => "\xEB\x96\x93", + "\x8B\xAA" => "\xEB\x96\x94", + "\x8B\xAB" => "\xEB\x96\x95", + "\x8B\xAC" => "\xEB\x96\x96", + "\x8B\xAD" => "\xEB\x96\x97", + "\x8B\xAE" => "\xEB\x96\x98", + "\x8B\xAF" => "\xEB\x96\x99", + "\x8B\xB0" => "\xEB\x96\x9A", + "\x8B\xB1" => "\xEB\x96\x9B", + "\x8B\xB2" => "\xEB\x96\x9C", + "\x8B\xB3" => "\xEB\x96\x9D", + "\x8B\xB4" => "\xEB\x96\x9E", + "\x8B\xB5" => "\xEB\x96\x9F", + "\x8B\xB6" => "\xEB\x96\xA2", + "\x8B\xB7" => "\xEB\x96\xA3", + "\x8B\xB8" => "\xEB\x96\xA5", + "\x8B\xB9" => "\xEB\x96\xA6", + "\x8B\xBA" => "\xEB\x96\xA7", + "\x8B\xBB" => "\xEB\x96\xA9", + "\x8B\xBC" => "\xEB\x96\xAC", + "\x8B\xBD" => "\xEB\x96\xAD", + "\x8B\xBE" => "\xEB\x96\xAE", + "\x8B\xBF" => "\xEB\x96\xAF", + "\x8B\xC0" => "\xEB\x96\xB2", + "\x8B\xC1" => "\xEB\x96\xB6", + "\x8B\xC2" => "\xEB\x96\xB7", + "\x8B\xC3" => "\xEB\x96\xB8", + "\x8B\xC4" => "\xEB\x96\xB9", + "\x8B\xC5" => "\xEB\x96\xBA", + "\x8B\xC6" => "\xEB\x96\xBE", + "\x8B\xC7" => "\xEB\x96\xBF", + "\x8B\xC8" => "\xEB\x97\x81", + "\x8B\xC9" => "\xEB\x97\x82", + "\x8B\xCA" => "\xEB\x97\x83", + "\x8B\xCB" => "\xEB\x97\x85", + "\x8B\xCC" => "\xEB\x97\x86", + "\x8B\xCD" => "\xEB\x97\x87", + "\x8B\xCE" => "\xEB\x97\x88", + "\x8B\xCF" => "\xEB\x97\x89", + "\x8B\xD0" => "\xEB\x97\x8A", + "\x8B\xD1" => "\xEB\x97\x8B", + "\x8B\xD2" => "\xEB\x97\x8E", + "\x8B\xD3" => "\xEB\x97\x92", + "\x8B\xD4" => "\xEB\x97\x93", + "\x8B\xD5" => "\xEB\x97\x94", + "\x8B\xD6" => "\xEB\x97\x95", + "\x8B\xD7" => "\xEB\x97\x96", + "\x8B\xD8" => "\xEB\x97\x97", + "\x8B\xD9" => "\xEB\x97\x99", + "\x8B\xDA" => "\xEB\x97\x9A", + "\x8B\xDB" => "\xEB\x97\x9B", + "\x8B\xDC" => "\xEB\x97\x9C", + "\x8B\xDD" => "\xEB\x97\x9D", + "\x8B\xDE" => "\xEB\x97\x9E", + "\x8B\xDF" => "\xEB\x97\x9F", + "\x8B\xE0" => "\xEB\x97\xA0", + "\x8B\xE1" => "\xEB\x97\xA1", + "\x8B\xE2" => "\xEB\x97\xA2", + "\x8B\xE3" => "\xEB\x97\xA3", + "\x8B\xE4" => "\xEB\x97\xA4", + "\x8B\xE5" => "\xEB\x97\xA5", + "\x8B\xE6" => "\xEB\x97\xA6", + "\x8B\xE7" => "\xEB\x97\xA7", + "\x8B\xE8" => "\xEB\x97\xA8", + "\x8B\xE9" => "\xEB\x97\xA9", + "\x8B\xEA" => "\xEB\x97\xAA", + "\x8B\xEB" => "\xEB\x97\xAB", + "\x8B\xEC" => "\xEB\x97\xAD", + "\x8B\xED" => "\xEB\x97\xAE", + "\x8B\xEE" => "\xEB\x97\xAF", + "\x8B\xEF" => "\xEB\x97\xB0", + "\x8B\xF0" => "\xEB\x97\xB1", + "\x8B\xF1" => "\xEB\x97\xB2", + "\x8B\xF2" => "\xEB\x97\xB3", + "\x8B\xF3" => "\xEB\x97\xB4", + "\x8B\xF4" => "\xEB\x97\xB5", + "\x8B\xF5" => "\xEB\x97\xB6", + "\x8B\xF6" => "\xEB\x97\xB7", + "\x8B\xF7" => "\xEB\x97\xB8", + "\x8B\xF8" => "\xEB\x97\xB9", + "\x8B\xF9" => "\xEB\x97\xBA", + "\x8B\xFA" => "\xEB\x97\xBB", + "\x8B\xFB" => "\xEB\x97\xBC", + "\x8B\xFC" => "\xEB\x97\xBD", + "\x8B\xFD" => "\xEB\x97\xBE", + "\x8B\xFE" => "\xEB\x97\xBF", + "\x8C\x41" => "\xEB\x98\x80", + "\x8C\x42" => "\xEB\x98\x81", + "\x8C\x43" => "\xEB\x98\x82", + "\x8C\x44" => "\xEB\x98\x83", + "\x8C\x45" => "\xEB\x98\x84", + "\x8C\x46" => "\xEB\x98\x85", + "\x8C\x47" => "\xEB\x98\x86", + "\x8C\x48" => "\xEB\x98\x87", + "\x8C\x49" => "\xEB\x98\x88", + "\x8C\x4A" => "\xEB\x98\x89", + "\x8C\x4B" => "\xEB\x98\x8A", + "\x8C\x4C" => "\xEB\x98\x8B", + "\x8C\x4D" => "\xEB\x98\x8C", + "\x8C\x4E" => "\xEB\x98\x8D", + "\x8C\x4F" => "\xEB\x98\x8E", + "\x8C\x50" => "\xEB\x98\x8F", + "\x8C\x51" => "\xEB\x98\x92", + "\x8C\x52" => "\xEB\x98\x93", + "\x8C\x53" => "\xEB\x98\x95", + "\x8C\x54" => "\xEB\x98\x96", + "\x8C\x55" => "\xEB\x98\x97", + "\x8C\x56" => "\xEB\x98\x99", + "\x8C\x57" => "\xEB\x98\x9A", + "\x8C\x58" => "\xEB\x98\x9B", + "\x8C\x59" => "\xEB\x98\x9C", + "\x8C\x5A" => "\xEB\x98\x9D", + "\x8C\x61" => "\xEB\x98\x9E", + "\x8C\x62" => "\xEB\x98\x9F", + "\x8C\x63" => "\xEB\x98\xA0", + "\x8C\x64" => "\xEB\x98\xA1", + "\x8C\x65" => "\xEB\x98\xA2", + "\x8C\x66" => "\xEB\x98\xA3", + "\x8C\x67" => "\xEB\x98\xA4", + "\x8C\x68" => "\xEB\x98\xA6", + "\x8C\x69" => "\xEB\x98\xA7", + "\x8C\x6A" => "\xEB\x98\xA8", + "\x8C\x6B" => "\xEB\x98\xA9", + "\x8C\x6C" => "\xEB\x98\xAA", + "\x8C\x6D" => "\xEB\x98\xAB", + "\x8C\x6E" => "\xEB\x98\xAD", + "\x8C\x6F" => "\xEB\x98\xAE", + "\x8C\x70" => "\xEB\x98\xAF", + "\x8C\x71" => "\xEB\x98\xB0", + "\x8C\x72" => "\xEB\x98\xB1", + "\x8C\x73" => "\xEB\x98\xB2", + "\x8C\x74" => "\xEB\x98\xB3", + "\x8C\x75" => "\xEB\x98\xB5", + "\x8C\x76" => "\xEB\x98\xB6", + "\x8C\x77" => "\xEB\x98\xB7", + "\x8C\x78" => "\xEB\x98\xB8", + "\x8C\x79" => "\xEB\x98\xB9", + "\x8C\x7A" => "\xEB\x98\xBA", + "\x8C\x81" => "\xEB\x98\xBB", + "\x8C\x82" => "\xEB\x98\xBC", + "\x8C\x83" => "\xEB\x98\xBD", + "\x8C\x84" => "\xEB\x98\xBE", + "\x8C\x85" => "\xEB\x98\xBF", + "\x8C\x86" => "\xEB\x99\x80", + "\x8C\x87" => "\xEB\x99\x81", + "\x8C\x88" => "\xEB\x99\x82", + "\x8C\x89" => "\xEB\x99\x83", + "\x8C\x8A" => "\xEB\x99\x84", + "\x8C\x8B" => "\xEB\x99\x85", + "\x8C\x8C" => "\xEB\x99\x86", + "\x8C\x8D" => "\xEB\x99\x87", + "\x8C\x8E" => "\xEB\x99\x89", + "\x8C\x8F" => "\xEB\x99\x8A", + "\x8C\x90" => "\xEB\x99\x8B", + "\x8C\x91" => "\xEB\x99\x8C", + "\x8C\x92" => "\xEB\x99\x8D", + "\x8C\x93" => "\xEB\x99\x8E", + "\x8C\x94" => "\xEB\x99\x8F", + "\x8C\x95" => "\xEB\x99\x90", + "\x8C\x96" => "\xEB\x99\x91", + "\x8C\x97" => "\xEB\x99\x92", + "\x8C\x98" => "\xEB\x99\x93", + "\x8C\x99" => "\xEB\x99\x94", + "\x8C\x9A" => "\xEB\x99\x95", + "\x8C\x9B" => "\xEB\x99\x96", + "\x8C\x9C" => "\xEB\x99\x97", + "\x8C\x9D" => "\xEB\x99\x98", + "\x8C\x9E" => "\xEB\x99\x99", + "\x8C\x9F" => "\xEB\x99\x9A", + "\x8C\xA0" => "\xEB\x99\x9B", + "\x8C\xA1" => "\xEB\x99\x9C", + "\x8C\xA2" => "\xEB\x99\x9D", + "\x8C\xA3" => "\xEB\x99\x9E", + "\x8C\xA4" => "\xEB\x99\x9F", + "\x8C\xA5" => "\xEB\x99\xA0", + "\x8C\xA6" => "\xEB\x99\xA1", + "\x8C\xA7" => "\xEB\x99\xA2", + "\x8C\xA8" => "\xEB\x99\xA3", + "\x8C\xA9" => "\xEB\x99\xA5", + "\x8C\xAA" => "\xEB\x99\xA6", + "\x8C\xAB" => "\xEB\x99\xA7", + "\x8C\xAC" => "\xEB\x99\xA9", + "\x8C\xAD" => "\xEB\x99\xAA", + "\x8C\xAE" => "\xEB\x99\xAB", + "\x8C\xAF" => "\xEB\x99\xAC", + "\x8C\xB0" => "\xEB\x99\xAD", + "\x8C\xB1" => "\xEB\x99\xAE", + "\x8C\xB2" => "\xEB\x99\xAF", + "\x8C\xB3" => "\xEB\x99\xB0", + "\x8C\xB4" => "\xEB\x99\xB1", + "\x8C\xB5" => "\xEB\x99\xB2", + "\x8C\xB6" => "\xEB\x99\xB3", + "\x8C\xB7" => "\xEB\x99\xB4", + "\x8C\xB8" => "\xEB\x99\xB5", + "\x8C\xB9" => "\xEB\x99\xB6", + "\x8C\xBA" => "\xEB\x99\xB7", + "\x8C\xBB" => "\xEB\x99\xB8", + "\x8C\xBC" => "\xEB\x99\xB9", + "\x8C\xBD" => "\xEB\x99\xBA", + "\x8C\xBE" => "\xEB\x99\xBB", + "\x8C\xBF" => "\xEB\x99\xBC", + "\x8C\xC0" => "\xEB\x99\xBD", + "\x8C\xC1" => "\xEB\x99\xBE", + "\x8C\xC2" => "\xEB\x99\xBF", + "\x8C\xC3" => "\xEB\x9A\x80", + "\x8C\xC4" => "\xEB\x9A\x81", + "\x8C\xC5" => "\xEB\x9A\x82", + "\x8C\xC6" => "\xEB\x9A\x83", + "\x8C\xC7" => "\xEB\x9A\x84", + "\x8C\xC8" => "\xEB\x9A\x85", + "\x8C\xC9" => "\xEB\x9A\x86", + "\x8C\xCA" => "\xEB\x9A\x87", + "\x8C\xCB" => "\xEB\x9A\x88", + "\x8C\xCC" => "\xEB\x9A\x89", + "\x8C\xCD" => "\xEB\x9A\x8A", + "\x8C\xCE" => "\xEB\x9A\x8B", + "\x8C\xCF" => "\xEB\x9A\x8C", + "\x8C\xD0" => "\xEB\x9A\x8D", + "\x8C\xD1" => "\xEB\x9A\x8E", + "\x8C\xD2" => "\xEB\x9A\x8F", + "\x8C\xD3" => "\xEB\x9A\x90", + "\x8C\xD4" => "\xEB\x9A\x91", + "\x8C\xD5" => "\xEB\x9A\x92", + "\x8C\xD6" => "\xEB\x9A\x93", + "\x8C\xD7" => "\xEB\x9A\x94", + "\x8C\xD8" => "\xEB\x9A\x95", + "\x8C\xD9" => "\xEB\x9A\x96", + "\x8C\xDA" => "\xEB\x9A\x97", + "\x8C\xDB" => "\xEB\x9A\x98", + "\x8C\xDC" => "\xEB\x9A\x99", + "\x8C\xDD" => "\xEB\x9A\x9A", + "\x8C\xDE" => "\xEB\x9A\x9B", + "\x8C\xDF" => "\xEB\x9A\x9E", + "\x8C\xE0" => "\xEB\x9A\x9F", + "\x8C\xE1" => "\xEB\x9A\xA1", + "\x8C\xE2" => "\xEB\x9A\xA2", + "\x8C\xE3" => "\xEB\x9A\xA3", + "\x8C\xE4" => "\xEB\x9A\xA5", + "\x8C\xE5" => "\xEB\x9A\xA6", + "\x8C\xE6" => "\xEB\x9A\xA7", + "\x8C\xE7" => "\xEB\x9A\xA8", + "\x8C\xE8" => "\xEB\x9A\xA9", + "\x8C\xE9" => "\xEB\x9A\xAA", + "\x8C\xEA" => "\xEB\x9A\xAD", + "\x8C\xEB" => "\xEB\x9A\xAE", + "\x8C\xEC" => "\xEB\x9A\xAF", + "\x8C\xED" => "\xEB\x9A\xB0", + "\x8C\xEE" => "\xEB\x9A\xB2", + "\x8C\xEF" => "\xEB\x9A\xB3", + "\x8C\xF0" => "\xEB\x9A\xB4", + "\x8C\xF1" => "\xEB\x9A\xB5", + "\x8C\xF2" => "\xEB\x9A\xB6", + "\x8C\xF3" => "\xEB\x9A\xB7", + "\x8C\xF4" => "\xEB\x9A\xB8", + "\x8C\xF5" => "\xEB\x9A\xB9", + "\x8C\xF6" => "\xEB\x9A\xBA", + "\x8C\xF7" => "\xEB\x9A\xBB", + "\x8C\xF8" => "\xEB\x9A\xBC", + "\x8C\xF9" => "\xEB\x9A\xBD", + "\x8C\xFA" => "\xEB\x9A\xBE", + "\x8C\xFB" => "\xEB\x9A\xBF", + "\x8C\xFC" => "\xEB\x9B\x80", + "\x8C\xFD" => "\xEB\x9B\x81", + "\x8C\xFE" => "\xEB\x9B\x82", + "\x8D\x41" => "\xEB\x9B\x83", + "\x8D\x42" => "\xEB\x9B\x84", + "\x8D\x43" => "\xEB\x9B\x85", + "\x8D\x44" => "\xEB\x9B\x86", + "\x8D\x45" => "\xEB\x9B\x87", + "\x8D\x46" => "\xEB\x9B\x88", + "\x8D\x47" => "\xEB\x9B\x89", + "\x8D\x48" => "\xEB\x9B\x8A", + "\x8D\x49" => "\xEB\x9B\x8B", + "\x8D\x4A" => "\xEB\x9B\x8C", + "\x8D\x4B" => "\xEB\x9B\x8D", + "\x8D\x4C" => "\xEB\x9B\x8E", + "\x8D\x4D" => "\xEB\x9B\x8F", + "\x8D\x4E" => "\xEB\x9B\x90", + "\x8D\x4F" => "\xEB\x9B\x91", + "\x8D\x50" => "\xEB\x9B\x92", + "\x8D\x51" => "\xEB\x9B\x93", + "\x8D\x52" => "\xEB\x9B\x95", + "\x8D\x53" => "\xEB\x9B\x96", + "\x8D\x54" => "\xEB\x9B\x97", + "\x8D\x55" => "\xEB\x9B\x98", + "\x8D\x56" => "\xEB\x9B\x99", + "\x8D\x57" => "\xEB\x9B\x9A", + "\x8D\x58" => "\xEB\x9B\x9B", + "\x8D\x59" => "\xEB\x9B\x9C", + "\x8D\x5A" => "\xEB\x9B\x9D", + "\x8D\x61" => "\xEB\x9B\x9E", + "\x8D\x62" => "\xEB\x9B\x9F", + "\x8D\x63" => "\xEB\x9B\xA0", + "\x8D\x64" => "\xEB\x9B\xA1", + "\x8D\x65" => "\xEB\x9B\xA2", + "\x8D\x66" => "\xEB\x9B\xA3", + "\x8D\x67" => "\xEB\x9B\xA4", + "\x8D\x68" => "\xEB\x9B\xA5", + "\x8D\x69" => "\xEB\x9B\xA6", + "\x8D\x6A" => "\xEB\x9B\xA7", + "\x8D\x6B" => "\xEB\x9B\xA8", + "\x8D\x6C" => "\xEB\x9B\xA9", + "\x8D\x6D" => "\xEB\x9B\xAA", + "\x8D\x6E" => "\xEB\x9B\xAB", + "\x8D\x6F" => "\xEB\x9B\xAC", + "\x8D\x70" => "\xEB\x9B\xAD", + "\x8D\x71" => "\xEB\x9B\xAE", + "\x8D\x72" => "\xEB\x9B\xAF", + "\x8D\x73" => "\xEB\x9B\xB1", + "\x8D\x74" => "\xEB\x9B\xB2", + "\x8D\x75" => "\xEB\x9B\xB3", + "\x8D\x76" => "\xEB\x9B\xB5", + "\x8D\x77" => "\xEB\x9B\xB6", + "\x8D\x78" => "\xEB\x9B\xB7", + "\x8D\x79" => "\xEB\x9B\xB9", + "\x8D\x7A" => "\xEB\x9B\xBA", + "\x8D\x81" => "\xEB\x9B\xBB", + "\x8D\x82" => "\xEB\x9B\xBC", + "\x8D\x83" => "\xEB\x9B\xBD", + "\x8D\x84" => "\xEB\x9B\xBE", + "\x8D\x85" => "\xEB\x9B\xBF", + "\x8D\x86" => "\xEB\x9C\x82", + "\x8D\x87" => "\xEB\x9C\x83", + "\x8D\x88" => "\xEB\x9C\x84", + "\x8D\x89" => "\xEB\x9C\x86", + "\x8D\x8A" => "\xEB\x9C\x87", + "\x8D\x8B" => "\xEB\x9C\x88", + "\x8D\x8C" => "\xEB\x9C\x89", + "\x8D\x8D" => "\xEB\x9C\x8A", + "\x8D\x8E" => "\xEB\x9C\x8B", + "\x8D\x8F" => "\xEB\x9C\x8C", + "\x8D\x90" => "\xEB\x9C\x8D", + "\x8D\x91" => "\xEB\x9C\x8E", + "\x8D\x92" => "\xEB\x9C\x8F", + "\x8D\x93" => "\xEB\x9C\x90", + "\x8D\x94" => "\xEB\x9C\x91", + "\x8D\x95" => "\xEB\x9C\x92", + "\x8D\x96" => "\xEB\x9C\x93", + "\x8D\x97" => "\xEB\x9C\x94", + "\x8D\x98" => "\xEB\x9C\x95", + "\x8D\x99" => "\xEB\x9C\x96", + "\x8D\x9A" => "\xEB\x9C\x97", + "\x8D\x9B" => "\xEB\x9C\x98", + "\x8D\x9C" => "\xEB\x9C\x99", + "\x8D\x9D" => "\xEB\x9C\x9A", + "\x8D\x9E" => "\xEB\x9C\x9B", + "\x8D\x9F" => "\xEB\x9C\x9C", + "\x8D\xA0" => "\xEB\x9C\x9D", + "\x8D\xA1" => "\xEB\x9C\x9E", + "\x8D\xA2" => "\xEB\x9C\x9F", + "\x8D\xA3" => "\xEB\x9C\xA0", + "\x8D\xA4" => "\xEB\x9C\xA1", + "\x8D\xA5" => "\xEB\x9C\xA2", + "\x8D\xA6" => "\xEB\x9C\xA3", + "\x8D\xA7" => "\xEB\x9C\xA4", + "\x8D\xA8" => "\xEB\x9C\xA5", + "\x8D\xA9" => "\xEB\x9C\xA6", + "\x8D\xAA" => "\xEB\x9C\xA7", + "\x8D\xAB" => "\xEB\x9C\xAA", + "\x8D\xAC" => "\xEB\x9C\xAB", + "\x8D\xAD" => "\xEB\x9C\xAD", + "\x8D\xAE" => "\xEB\x9C\xAE", + "\x8D\xAF" => "\xEB\x9C\xB1", + "\x8D\xB0" => "\xEB\x9C\xB2", + "\x8D\xB1" => "\xEB\x9C\xB3", + "\x8D\xB2" => "\xEB\x9C\xB4", + "\x8D\xB3" => "\xEB\x9C\xB5", + "\x8D\xB4" => "\xEB\x9C\xB6", + "\x8D\xB5" => "\xEB\x9C\xB7", + "\x8D\xB6" => "\xEB\x9C\xBA", + "\x8D\xB7" => "\xEB\x9C\xBC", + "\x8D\xB8" => "\xEB\x9C\xBD", + "\x8D\xB9" => "\xEB\x9C\xBE", + "\x8D\xBA" => "\xEB\x9C\xBF", + "\x8D\xBB" => "\xEB\x9D\x80", + "\x8D\xBC" => "\xEB\x9D\x81", + "\x8D\xBD" => "\xEB\x9D\x82", + "\x8D\xBE" => "\xEB\x9D\x83", + "\x8D\xBF" => "\xEB\x9D\x85", + "\x8D\xC0" => "\xEB\x9D\x86", + "\x8D\xC1" => "\xEB\x9D\x87", + "\x8D\xC2" => "\xEB\x9D\x89", + "\x8D\xC3" => "\xEB\x9D\x8A", + "\x8D\xC4" => "\xEB\x9D\x8B", + "\x8D\xC5" => "\xEB\x9D\x8D", + "\x8D\xC6" => "\xEB\x9D\x8E", + "\x8D\xC7" => "\xEB\x9D\x8F", + "\x8D\xC8" => "\xEB\x9D\x90", + "\x8D\xC9" => "\xEB\x9D\x91", + "\x8D\xCA" => "\xEB\x9D\x92", + "\x8D\xCB" => "\xEB\x9D\x93", + "\x8D\xCC" => "\xEB\x9D\x96", + "\x8D\xCD" => "\xEB\x9D\x97", + "\x8D\xCE" => "\xEB\x9D\x98", + "\x8D\xCF" => "\xEB\x9D\x99", + "\x8D\xD0" => "\xEB\x9D\x9A", + "\x8D\xD1" => "\xEB\x9D\x9B", + "\x8D\xD2" => "\xEB\x9D\x9C", + "\x8D\xD3" => "\xEB\x9D\x9D", + "\x8D\xD4" => "\xEB\x9D\x9E", + "\x8D\xD5" => "\xEB\x9D\x9F", + "\x8D\xD6" => "\xEB\x9D\xA1", + "\x8D\xD7" => "\xEB\x9D\xA2", + "\x8D\xD8" => "\xEB\x9D\xA3", + "\x8D\xD9" => "\xEB\x9D\xA5", + "\x8D\xDA" => "\xEB\x9D\xA6", + "\x8D\xDB" => "\xEB\x9D\xA7", + "\x8D\xDC" => "\xEB\x9D\xA9", + "\x8D\xDD" => "\xEB\x9D\xAA", + "\x8D\xDE" => "\xEB\x9D\xAB", + "\x8D\xDF" => "\xEB\x9D\xAC", + "\x8D\xE0" => "\xEB\x9D\xAD", + "\x8D\xE1" => "\xEB\x9D\xAE", + "\x8D\xE2" => "\xEB\x9D\xAF", + "\x8D\xE3" => "\xEB\x9D\xB2", + "\x8D\xE4" => "\xEB\x9D\xB4", + "\x8D\xE5" => "\xEB\x9D\xB6", + "\x8D\xE6" => "\xEB\x9D\xB7", + "\x8D\xE7" => "\xEB\x9D\xB8", + "\x8D\xE8" => "\xEB\x9D\xB9", + "\x8D\xE9" => "\xEB\x9D\xBA", + "\x8D\xEA" => "\xEB\x9D\xBB", + "\x8D\xEB" => "\xEB\x9D\xBE", + "\x8D\xEC" => "\xEB\x9D\xBF", + "\x8D\xED" => "\xEB\x9E\x81", + "\x8D\xEE" => "\xEB\x9E\x82", + "\x8D\xEF" => "\xEB\x9E\x83", + "\x8D\xF0" => "\xEB\x9E\x85", + "\x8D\xF1" => "\xEB\x9E\x86", + "\x8D\xF2" => "\xEB\x9E\x87", + "\x8D\xF3" => "\xEB\x9E\x88", + "\x8D\xF4" => "\xEB\x9E\x89", + "\x8D\xF5" => "\xEB\x9E\x8A", + "\x8D\xF6" => "\xEB\x9E\x8B", + "\x8D\xF7" => "\xEB\x9E\x8E", + "\x8D\xF8" => "\xEB\x9E\x93", + "\x8D\xF9" => "\xEB\x9E\x94", + "\x8D\xFA" => "\xEB\x9E\x95", + "\x8D\xFB" => "\xEB\x9E\x9A", + "\x8D\xFC" => "\xEB\x9E\x9B", + "\x8D\xFD" => "\xEB\x9E\x9D", + "\x8D\xFE" => "\xEB\x9E\x9E", + "\x8E\x41" => "\xEB\x9E\x9F", + "\x8E\x42" => "\xEB\x9E\xA1", + "\x8E\x43" => "\xEB\x9E\xA2", + "\x8E\x44" => "\xEB\x9E\xA3", + "\x8E\x45" => "\xEB\x9E\xA4", + "\x8E\x46" => "\xEB\x9E\xA5", + "\x8E\x47" => "\xEB\x9E\xA6", + "\x8E\x48" => "\xEB\x9E\xA7", + "\x8E\x49" => "\xEB\x9E\xAA", + "\x8E\x4A" => "\xEB\x9E\xAE", + "\x8E\x4B" => "\xEB\x9E\xAF", + "\x8E\x4C" => "\xEB\x9E\xB0", + "\x8E\x4D" => "\xEB\x9E\xB1", + "\x8E\x4E" => "\xEB\x9E\xB2", + "\x8E\x4F" => "\xEB\x9E\xB3", + "\x8E\x50" => "\xEB\x9E\xB6", + "\x8E\x51" => "\xEB\x9E\xB7", + "\x8E\x52" => "\xEB\x9E\xB9", + "\x8E\x53" => "\xEB\x9E\xBA", + "\x8E\x54" => "\xEB\x9E\xBB", + "\x8E\x55" => "\xEB\x9E\xBC", + "\x8E\x56" => "\xEB\x9E\xBD", + "\x8E\x57" => "\xEB\x9E\xBE", + "\x8E\x58" => "\xEB\x9E\xBF", + "\x8E\x59" => "\xEB\x9F\x80", + "\x8E\x5A" => "\xEB\x9F\x81", + "\x8E\x61" => "\xEB\x9F\x82", + "\x8E\x62" => "\xEB\x9F\x83", + "\x8E\x63" => "\xEB\x9F\x84", + "\x8E\x64" => "\xEB\x9F\x85", + "\x8E\x65" => "\xEB\x9F\x86", + "\x8E\x66" => "\xEB\x9F\x88", + "\x8E\x67" => "\xEB\x9F\x8A", + "\x8E\x68" => "\xEB\x9F\x8B", + "\x8E\x69" => "\xEB\x9F\x8C", + "\x8E\x6A" => "\xEB\x9F\x8D", + "\x8E\x6B" => "\xEB\x9F\x8E", + "\x8E\x6C" => "\xEB\x9F\x8F", + "\x8E\x6D" => "\xEB\x9F\x90", + "\x8E\x6E" => "\xEB\x9F\x91", + "\x8E\x6F" => "\xEB\x9F\x92", + "\x8E\x70" => "\xEB\x9F\x93", + "\x8E\x71" => "\xEB\x9F\x94", + "\x8E\x72" => "\xEB\x9F\x95", + "\x8E\x73" => "\xEB\x9F\x96", + "\x8E\x74" => "\xEB\x9F\x97", + "\x8E\x75" => "\xEB\x9F\x98", + "\x8E\x76" => "\xEB\x9F\x99", + "\x8E\x77" => "\xEB\x9F\x9A", + "\x8E\x78" => "\xEB\x9F\x9B", + "\x8E\x79" => "\xEB\x9F\x9C", + "\x8E\x7A" => "\xEB\x9F\x9D", + "\x8E\x81" => "\xEB\x9F\x9E", + "\x8E\x82" => "\xEB\x9F\x9F", + "\x8E\x83" => "\xEB\x9F\xA0", + "\x8E\x84" => "\xEB\x9F\xA1", + "\x8E\x85" => "\xEB\x9F\xA2", + "\x8E\x86" => "\xEB\x9F\xA3", + "\x8E\x87" => "\xEB\x9F\xA4", + "\x8E\x88" => "\xEB\x9F\xA5", + "\x8E\x89" => "\xEB\x9F\xA6", + "\x8E\x8A" => "\xEB\x9F\xA7", + "\x8E\x8B" => "\xEB\x9F\xA8", + "\x8E\x8C" => "\xEB\x9F\xA9", + "\x8E\x8D" => "\xEB\x9F\xAA", + "\x8E\x8E" => "\xEB\x9F\xAB", + "\x8E\x8F" => "\xEB\x9F\xAE", + "\x8E\x90" => "\xEB\x9F\xAF", + "\x8E\x91" => "\xEB\x9F\xB1", + "\x8E\x92" => "\xEB\x9F\xB2", + "\x8E\x93" => "\xEB\x9F\xB3", + "\x8E\x94" => "\xEB\x9F\xB5", + "\x8E\x95" => "\xEB\x9F\xB6", + "\x8E\x96" => "\xEB\x9F\xB7", + "\x8E\x97" => "\xEB\x9F\xB8", + "\x8E\x98" => "\xEB\x9F\xB9", + "\x8E\x99" => "\xEB\x9F\xBA", + "\x8E\x9A" => "\xEB\x9F\xBB", + "\x8E\x9B" => "\xEB\x9F\xBE", + "\x8E\x9C" => "\xEB\xA0\x82", + "\x8E\x9D" => "\xEB\xA0\x83", + "\x8E\x9E" => "\xEB\xA0\x84", + "\x8E\x9F" => "\xEB\xA0\x85", + "\x8E\xA0" => "\xEB\xA0\x86", + "\x8E\xA1" => "\xEB\xA0\x8A", + "\x8E\xA2" => "\xEB\xA0\x8B", + "\x8E\xA3" => "\xEB\xA0\x8D", + "\x8E\xA4" => "\xEB\xA0\x8E", + "\x8E\xA5" => "\xEB\xA0\x8F", + "\x8E\xA6" => "\xEB\xA0\x91", + "\x8E\xA7" => "\xEB\xA0\x92", + "\x8E\xA8" => "\xEB\xA0\x93", + "\x8E\xA9" => "\xEB\xA0\x94", + "\x8E\xAA" => "\xEB\xA0\x95", + "\x8E\xAB" => "\xEB\xA0\x96", + "\x8E\xAC" => "\xEB\xA0\x97", + "\x8E\xAD" => "\xEB\xA0\x9A", + "\x8E\xAE" => "\xEB\xA0\x9C", + "\x8E\xAF" => "\xEB\xA0\x9E", + "\x8E\xB0" => "\xEB\xA0\x9F", + "\x8E\xB1" => "\xEB\xA0\xA0", + "\x8E\xB2" => "\xEB\xA0\xA1", + "\x8E\xB3" => "\xEB\xA0\xA2", + "\x8E\xB4" => "\xEB\xA0\xA3", + "\x8E\xB5" => "\xEB\xA0\xA6", + "\x8E\xB6" => "\xEB\xA0\xA7", + "\x8E\xB7" => "\xEB\xA0\xA9", + "\x8E\xB8" => "\xEB\xA0\xAA", + "\x8E\xB9" => "\xEB\xA0\xAB", + "\x8E\xBA" => "\xEB\xA0\xAD", + "\x8E\xBB" => "\xEB\xA0\xAE", + "\x8E\xBC" => "\xEB\xA0\xAF", + "\x8E\xBD" => "\xEB\xA0\xB0", + "\x8E\xBE" => "\xEB\xA0\xB1", + "\x8E\xBF" => "\xEB\xA0\xB2", + "\x8E\xC0" => "\xEB\xA0\xB3", + "\x8E\xC1" => "\xEB\xA0\xB6", + "\x8E\xC2" => "\xEB\xA0\xBA", + "\x8E\xC3" => "\xEB\xA0\xBB", + "\x8E\xC4" => "\xEB\xA0\xBC", + "\x8E\xC5" => "\xEB\xA0\xBD", + "\x8E\xC6" => "\xEB\xA0\xBE", + "\x8E\xC7" => "\xEB\xA0\xBF", + "\x8E\xC8" => "\xEB\xA1\x81", + "\x8E\xC9" => "\xEB\xA1\x82", + "\x8E\xCA" => "\xEB\xA1\x83", + "\x8E\xCB" => "\xEB\xA1\x85", + "\x8E\xCC" => "\xEB\xA1\x86", + "\x8E\xCD" => "\xEB\xA1\x87", + "\x8E\xCE" => "\xEB\xA1\x88", + "\x8E\xCF" => "\xEB\xA1\x89", + "\x8E\xD0" => "\xEB\xA1\x8A", + "\x8E\xD1" => "\xEB\xA1\x8B", + "\x8E\xD2" => "\xEB\xA1\x8C", + "\x8E\xD3" => "\xEB\xA1\x8D", + "\x8E\xD4" => "\xEB\xA1\x8E", + "\x8E\xD5" => "\xEB\xA1\x8F", + "\x8E\xD6" => "\xEB\xA1\x90", + "\x8E\xD7" => "\xEB\xA1\x92", + "\x8E\xD8" => "\xEB\xA1\x94", + "\x8E\xD9" => "\xEB\xA1\x95", + "\x8E\xDA" => "\xEB\xA1\x96", + "\x8E\xDB" => "\xEB\xA1\x97", + "\x8E\xDC" => "\xEB\xA1\x98", + "\x8E\xDD" => "\xEB\xA1\x99", + "\x8E\xDE" => "\xEB\xA1\x9A", + "\x8E\xDF" => "\xEB\xA1\x9B", + "\x8E\xE0" => "\xEB\xA1\x9E", + "\x8E\xE1" => "\xEB\xA1\x9F", + "\x8E\xE2" => "\xEB\xA1\xA1", + "\x8E\xE3" => "\xEB\xA1\xA2", + "\x8E\xE4" => "\xEB\xA1\xA3", + "\x8E\xE5" => "\xEB\xA1\xA5", + "\x8E\xE6" => "\xEB\xA1\xA6", + "\x8E\xE7" => "\xEB\xA1\xA7", + "\x8E\xE8" => "\xEB\xA1\xA8", + "\x8E\xE9" => "\xEB\xA1\xA9", + "\x8E\xEA" => "\xEB\xA1\xAA", + "\x8E\xEB" => "\xEB\xA1\xAB", + "\x8E\xEC" => "\xEB\xA1\xAE", + "\x8E\xED" => "\xEB\xA1\xB0", + "\x8E\xEE" => "\xEB\xA1\xB2", + "\x8E\xEF" => "\xEB\xA1\xB3", + "\x8E\xF0" => "\xEB\xA1\xB4", + "\x8E\xF1" => "\xEB\xA1\xB5", + "\x8E\xF2" => "\xEB\xA1\xB6", + "\x8E\xF3" => "\xEB\xA1\xB7", + "\x8E\xF4" => "\xEB\xA1\xB9", + "\x8E\xF5" => "\xEB\xA1\xBA", + "\x8E\xF6" => "\xEB\xA1\xBB", + "\x8E\xF7" => "\xEB\xA1\xBD", + "\x8E\xF8" => "\xEB\xA1\xBE", + "\x8E\xF9" => "\xEB\xA1\xBF", + "\x8E\xFA" => "\xEB\xA2\x80", + "\x8E\xFB" => "\xEB\xA2\x81", + "\x8E\xFC" => "\xEB\xA2\x82", + "\x8E\xFD" => "\xEB\xA2\x83", + "\x8E\xFE" => "\xEB\xA2\x84", + "\x8F\x41" => "\xEB\xA2\x85", + "\x8F\x42" => "\xEB\xA2\x86", + "\x8F\x43" => "\xEB\xA2\x87", + "\x8F\x44" => "\xEB\xA2\x88", + "\x8F\x45" => "\xEB\xA2\x89", + "\x8F\x46" => "\xEB\xA2\x8A", + "\x8F\x47" => "\xEB\xA2\x8B", + "\x8F\x48" => "\xEB\xA2\x8C", + "\x8F\x49" => "\xEB\xA2\x8E", + "\x8F\x4A" => "\xEB\xA2\x8F", + "\x8F\x4B" => "\xEB\xA2\x90", + "\x8F\x4C" => "\xEB\xA2\x91", + "\x8F\x4D" => "\xEB\xA2\x92", + "\x8F\x4E" => "\xEB\xA2\x93", + "\x8F\x4F" => "\xEB\xA2\x94", + "\x8F\x50" => "\xEB\xA2\x95", + "\x8F\x51" => "\xEB\xA2\x96", + "\x8F\x52" => "\xEB\xA2\x97", + "\x8F\x53" => "\xEB\xA2\x98", + "\x8F\x54" => "\xEB\xA2\x99", + "\x8F\x55" => "\xEB\xA2\x9A", + "\x8F\x56" => "\xEB\xA2\x9B", + "\x8F\x57" => "\xEB\xA2\x9C", + "\x8F\x58" => "\xEB\xA2\x9D", + "\x8F\x59" => "\xEB\xA2\x9E", + "\x8F\x5A" => "\xEB\xA2\x9F", + "\x8F\x61" => "\xEB\xA2\xA0", + "\x8F\x62" => "\xEB\xA2\xA1", + "\x8F\x63" => "\xEB\xA2\xA2", + "\x8F\x64" => "\xEB\xA2\xA3", + "\x8F\x65" => "\xEB\xA2\xA4", + "\x8F\x66" => "\xEB\xA2\xA5", + "\x8F\x67" => "\xEB\xA2\xA6", + "\x8F\x68" => "\xEB\xA2\xA7", + "\x8F\x69" => "\xEB\xA2\xA9", + "\x8F\x6A" => "\xEB\xA2\xAA", + "\x8F\x6B" => "\xEB\xA2\xAB", + "\x8F\x6C" => "\xEB\xA2\xAC", + "\x8F\x6D" => "\xEB\xA2\xAD", + "\x8F\x6E" => "\xEB\xA2\xAE", + "\x8F\x6F" => "\xEB\xA2\xAF", + "\x8F\x70" => "\xEB\xA2\xB1", + "\x8F\x71" => "\xEB\xA2\xB2", + "\x8F\x72" => "\xEB\xA2\xB3", + "\x8F\x73" => "\xEB\xA2\xB5", + "\x8F\x74" => "\xEB\xA2\xB6", + "\x8F\x75" => "\xEB\xA2\xB7", + "\x8F\x76" => "\xEB\xA2\xB9", + "\x8F\x77" => "\xEB\xA2\xBA", + "\x8F\x78" => "\xEB\xA2\xBB", + "\x8F\x79" => "\xEB\xA2\xBC", + "\x8F\x7A" => "\xEB\xA2\xBD", + "\x8F\x81" => "\xEB\xA2\xBE", + "\x8F\x82" => "\xEB\xA2\xBF", + "\x8F\x83" => "\xEB\xA3\x82", + "\x8F\x84" => "\xEB\xA3\x84", + "\x8F\x85" => "\xEB\xA3\x86", + "\x8F\x86" => "\xEB\xA3\x87", + "\x8F\x87" => "\xEB\xA3\x88", + "\x8F\x88" => "\xEB\xA3\x89", + "\x8F\x89" => "\xEB\xA3\x8A", + "\x8F\x8A" => "\xEB\xA3\x8B", + "\x8F\x8B" => "\xEB\xA3\x8D", + "\x8F\x8C" => "\xEB\xA3\x8E", + "\x8F\x8D" => "\xEB\xA3\x8F", + "\x8F\x8E" => "\xEB\xA3\x91", + "\x8F\x8F" => "\xEB\xA3\x92", + "\x8F\x90" => "\xEB\xA3\x93", + "\x8F\x91" => "\xEB\xA3\x95", + "\x8F\x92" => "\xEB\xA3\x96", + "\x8F\x93" => "\xEB\xA3\x97", + "\x8F\x94" => "\xEB\xA3\x98", + "\x8F\x95" => "\xEB\xA3\x99", + "\x8F\x96" => "\xEB\xA3\x9A", + "\x8F\x97" => "\xEB\xA3\x9B", + "\x8F\x98" => "\xEB\xA3\x9C", + "\x8F\x99" => "\xEB\xA3\x9E", + "\x8F\x9A" => "\xEB\xA3\xA0", + "\x8F\x9B" => "\xEB\xA3\xA2", + "\x8F\x9C" => "\xEB\xA3\xA3", + "\x8F\x9D" => "\xEB\xA3\xA4", + "\x8F\x9E" => "\xEB\xA3\xA5", + "\x8F\x9F" => "\xEB\xA3\xA6", + "\x8F\xA0" => "\xEB\xA3\xA7", + "\x8F\xA1" => "\xEB\xA3\xAA", + "\x8F\xA2" => "\xEB\xA3\xAB", + "\x8F\xA3" => "\xEB\xA3\xAD", + "\x8F\xA4" => "\xEB\xA3\xAE", + "\x8F\xA5" => "\xEB\xA3\xAF", + "\x8F\xA6" => "\xEB\xA3\xB1", + "\x8F\xA7" => "\xEB\xA3\xB2", + "\x8F\xA8" => "\xEB\xA3\xB3", + "\x8F\xA9" => "\xEB\xA3\xB4", + "\x8F\xAA" => "\xEB\xA3\xB5", + "\x8F\xAB" => "\xEB\xA3\xB6", + "\x8F\xAC" => "\xEB\xA3\xB7", + "\x8F\xAD" => "\xEB\xA3\xBA", + "\x8F\xAE" => "\xEB\xA3\xBC", + "\x8F\xAF" => "\xEB\xA3\xBE", + "\x8F\xB0" => "\xEB\xA3\xBF", + "\x8F\xB1" => "\xEB\xA4\x80", + "\x8F\xB2" => "\xEB\xA4\x81", + "\x8F\xB3" => "\xEB\xA4\x82", + "\x8F\xB4" => "\xEB\xA4\x83", + "\x8F\xB5" => "\xEB\xA4\x85", + "\x8F\xB6" => "\xEB\xA4\x86", + "\x8F\xB7" => "\xEB\xA4\x87", + "\x8F\xB8" => "\xEB\xA4\x88", + "\x8F\xB9" => "\xEB\xA4\x89", + "\x8F\xBA" => "\xEB\xA4\x8A", + "\x8F\xBB" => "\xEB\xA4\x8B", + "\x8F\xBC" => "\xEB\xA4\x8C", + "\x8F\xBD" => "\xEB\xA4\x8D", + "\x8F\xBE" => "\xEB\xA4\x8E", + "\x8F\xBF" => "\xEB\xA4\x8F", + "\x8F\xC0" => "\xEB\xA4\x90", + "\x8F\xC1" => "\xEB\xA4\x91", + "\x8F\xC2" => "\xEB\xA4\x92", + "\x8F\xC3" => "\xEB\xA4\x93", + "\x8F\xC4" => "\xEB\xA4\x94", + "\x8F\xC5" => "\xEB\xA4\x95", + "\x8F\xC6" => "\xEB\xA4\x96", + "\x8F\xC7" => "\xEB\xA4\x97", + "\x8F\xC8" => "\xEB\xA4\x99", + "\x8F\xC9" => "\xEB\xA4\x9A", + "\x8F\xCA" => "\xEB\xA4\x9B", + "\x8F\xCB" => "\xEB\xA4\x9C", + "\x8F\xCC" => "\xEB\xA4\x9D", + "\x8F\xCD" => "\xEB\xA4\x9E", + "\x8F\xCE" => "\xEB\xA4\x9F", + "\x8F\xCF" => "\xEB\xA4\xA1", + "\x8F\xD0" => "\xEB\xA4\xA2", + "\x8F\xD1" => "\xEB\xA4\xA3", + "\x8F\xD2" => "\xEB\xA4\xA4", + "\x8F\xD3" => "\xEB\xA4\xA5", + "\x8F\xD4" => "\xEB\xA4\xA6", + "\x8F\xD5" => "\xEB\xA4\xA7", + "\x8F\xD6" => "\xEB\xA4\xA8", + "\x8F\xD7" => "\xEB\xA4\xA9", + "\x8F\xD8" => "\xEB\xA4\xAA", + "\x8F\xD9" => "\xEB\xA4\xAB", + "\x8F\xDA" => "\xEB\xA4\xAC", + "\x8F\xDB" => "\xEB\xA4\xAD", + "\x8F\xDC" => "\xEB\xA4\xAE", + "\x8F\xDD" => "\xEB\xA4\xAF", + "\x8F\xDE" => "\xEB\xA4\xB0", + "\x8F\xDF" => "\xEB\xA4\xB1", + "\x8F\xE0" => "\xEB\xA4\xB2", + "\x8F\xE1" => "\xEB\xA4\xB3", + "\x8F\xE2" => "\xEB\xA4\xB4", + "\x8F\xE3" => "\xEB\xA4\xB5", + "\x8F\xE4" => "\xEB\xA4\xB6", + "\x8F\xE5" => "\xEB\xA4\xB7", + "\x8F\xE6" => "\xEB\xA4\xB8", + "\x8F\xE7" => "\xEB\xA4\xB9", + "\x8F\xE8" => "\xEB\xA4\xBA", + "\x8F\xE9" => "\xEB\xA4\xBB", + "\x8F\xEA" => "\xEB\xA4\xBE", + "\x8F\xEB" => "\xEB\xA4\xBF", + "\x8F\xEC" => "\xEB\xA5\x81", + "\x8F\xED" => "\xEB\xA5\x82", + "\x8F\xEE" => "\xEB\xA5\x83", + "\x8F\xEF" => "\xEB\xA5\x85", + "\x8F\xF0" => "\xEB\xA5\x86", + "\x8F\xF1" => "\xEB\xA5\x87", + "\x8F\xF2" => "\xEB\xA5\x88", + "\x8F\xF3" => "\xEB\xA5\x89", + "\x8F\xF4" => "\xEB\xA5\x8A", + "\x8F\xF5" => "\xEB\xA5\x8B", + "\x8F\xF6" => "\xEB\xA5\x8D", + "\x8F\xF7" => "\xEB\xA5\x8E", + "\x8F\xF8" => "\xEB\xA5\x90", + "\x8F\xF9" => "\xEB\xA5\x92", + "\x8F\xFA" => "\xEB\xA5\x93", + "\x8F\xFB" => "\xEB\xA5\x94", + "\x8F\xFC" => "\xEB\xA5\x95", + "\x8F\xFD" => "\xEB\xA5\x96", + "\x8F\xFE" => "\xEB\xA5\x97", + "\x90\x41" => "\xEB\xA5\x9A", + "\x90\x42" => "\xEB\xA5\x9B", + "\x90\x43" => "\xEB\xA5\x9D", + "\x90\x44" => "\xEB\xA5\x9E", + "\x90\x45" => "\xEB\xA5\x9F", + "\x90\x46" => "\xEB\xA5\xA1", + "\x90\x47" => "\xEB\xA5\xA2", + "\x90\x48" => "\xEB\xA5\xA3", + "\x90\x49" => "\xEB\xA5\xA4", + "\x90\x4A" => "\xEB\xA5\xA5", + "\x90\x4B" => "\xEB\xA5\xA6", + "\x90\x4C" => "\xEB\xA5\xA7", + "\x90\x4D" => "\xEB\xA5\xAA", + "\x90\x4E" => "\xEB\xA5\xAC", + "\x90\x4F" => "\xEB\xA5\xAE", + "\x90\x50" => "\xEB\xA5\xAF", + "\x90\x51" => "\xEB\xA5\xB0", + "\x90\x52" => "\xEB\xA5\xB1", + "\x90\x53" => "\xEB\xA5\xB2", + "\x90\x54" => "\xEB\xA5\xB3", + "\x90\x55" => "\xEB\xA5\xB6", + "\x90\x56" => "\xEB\xA5\xB7", + "\x90\x57" => "\xEB\xA5\xB9", + "\x90\x58" => "\xEB\xA5\xBA", + "\x90\x59" => "\xEB\xA5\xBB", + "\x90\x5A" => "\xEB\xA5\xBD", + "\x90\x61" => "\xEB\xA5\xBE", + "\x90\x62" => "\xEB\xA5\xBF", + "\x90\x63" => "\xEB\xA6\x80", + "\x90\x64" => "\xEB\xA6\x81", + "\x90\x65" => "\xEB\xA6\x82", + "\x90\x66" => "\xEB\xA6\x83", + "\x90\x67" => "\xEB\xA6\x86", + "\x90\x68" => "\xEB\xA6\x88", + "\x90\x69" => "\xEB\xA6\x8B", + "\x90\x6A" => "\xEB\xA6\x8C", + "\x90\x6B" => "\xEB\xA6\x8F", + "\x90\x6C" => "\xEB\xA6\x90", + "\x90\x6D" => "\xEB\xA6\x91", + "\x90\x6E" => "\xEB\xA6\x92", + "\x90\x6F" => "\xEB\xA6\x93", + "\x90\x70" => "\xEB\xA6\x94", + "\x90\x71" => "\xEB\xA6\x95", + "\x90\x72" => "\xEB\xA6\x96", + "\x90\x73" => "\xEB\xA6\x97", + "\x90\x74" => "\xEB\xA6\x98", + "\x90\x75" => "\xEB\xA6\x99", + "\x90\x76" => "\xEB\xA6\x9A", + "\x90\x77" => "\xEB\xA6\x9B", + "\x90\x78" => "\xEB\xA6\x9C", + "\x90\x79" => "\xEB\xA6\x9D", + "\x90\x7A" => "\xEB\xA6\x9E", + "\x90\x81" => "\xEB\xA6\x9F", + "\x90\x82" => "\xEB\xA6\xA0", + "\x90\x83" => "\xEB\xA6\xA1", + "\x90\x84" => "\xEB\xA6\xA2", + "\x90\x85" => "\xEB\xA6\xA3", + "\x90\x86" => "\xEB\xA6\xA4", + "\x90\x87" => "\xEB\xA6\xA5", + "\x90\x88" => "\xEB\xA6\xA6", + "\x90\x89" => "\xEB\xA6\xA7", + "\x90\x8A" => "\xEB\xA6\xA8", + "\x90\x8B" => "\xEB\xA6\xA9", + "\x90\x8C" => "\xEB\xA6\xAA", + "\x90\x8D" => "\xEB\xA6\xAB", + "\x90\x8E" => "\xEB\xA6\xAE", + "\x90\x8F" => "\xEB\xA6\xAF", + "\x90\x90" => "\xEB\xA6\xB1", + "\x90\x91" => "\xEB\xA6\xB2", + "\x90\x92" => "\xEB\xA6\xB3", + "\x90\x93" => "\xEB\xA6\xB5", + "\x90\x94" => "\xEB\xA6\xB6", + "\x90\x95" => "\xEB\xA6\xB7", + "\x90\x96" => "\xEB\xA6\xB8", + "\x90\x97" => "\xEB\xA6\xB9", + "\x90\x98" => "\xEB\xA6\xBA", + "\x90\x99" => "\xEB\xA6\xBB", + "\x90\x9A" => "\xEB\xA6\xBE", + "\x90\x9B" => "\xEB\xA7\x80", + "\x90\x9C" => "\xEB\xA7\x82", + "\x90\x9D" => "\xEB\xA7\x83", + "\x90\x9E" => "\xEB\xA7\x84", + "\x90\x9F" => "\xEB\xA7\x85", + "\x90\xA0" => "\xEB\xA7\x86", + "\x90\xA1" => "\xEB\xA7\x87", + "\x90\xA2" => "\xEB\xA7\x8A", + "\x90\xA3" => "\xEB\xA7\x8B", + "\x90\xA4" => "\xEB\xA7\x8D", + "\x90\xA5" => "\xEB\xA7\x93", + "\x90\xA6" => "\xEB\xA7\x94", + "\x90\xA7" => "\xEB\xA7\x95", + "\x90\xA8" => "\xEB\xA7\x96", + "\x90\xA9" => "\xEB\xA7\x97", + "\x90\xAA" => "\xEB\xA7\x9A", + "\x90\xAB" => "\xEB\xA7\x9C", + "\x90\xAC" => "\xEB\xA7\x9F", + "\x90\xAD" => "\xEB\xA7\xA0", + "\x90\xAE" => "\xEB\xA7\xA2", + "\x90\xAF" => "\xEB\xA7\xA6", + "\x90\xB0" => "\xEB\xA7\xA7", + "\x90\xB1" => "\xEB\xA7\xA9", + "\x90\xB2" => "\xEB\xA7\xAA", + "\x90\xB3" => "\xEB\xA7\xAB", + "\x90\xB4" => "\xEB\xA7\xAD", + "\x90\xB5" => "\xEB\xA7\xAE", + "\x90\xB6" => "\xEB\xA7\xAF", + "\x90\xB7" => "\xEB\xA7\xB0", + "\x90\xB8" => "\xEB\xA7\xB1", + "\x90\xB9" => "\xEB\xA7\xB2", + "\x90\xBA" => "\xEB\xA7\xB3", + "\x90\xBB" => "\xEB\xA7\xB6", + "\x90\xBC" => "\xEB\xA7\xBB", + "\x90\xBD" => "\xEB\xA7\xBC", + "\x90\xBE" => "\xEB\xA7\xBD", + "\x90\xBF" => "\xEB\xA7\xBE", + "\x90\xC0" => "\xEB\xA7\xBF", + "\x90\xC1" => "\xEB\xA8\x82", + "\x90\xC2" => "\xEB\xA8\x83", + "\x90\xC3" => "\xEB\xA8\x84", + "\x90\xC4" => "\xEB\xA8\x85", + "\x90\xC5" => "\xEB\xA8\x86", + "\x90\xC6" => "\xEB\xA8\x87", + "\x90\xC7" => "\xEB\xA8\x89", + "\x90\xC8" => "\xEB\xA8\x8A", + "\x90\xC9" => "\xEB\xA8\x8B", + "\x90\xCA" => "\xEB\xA8\x8C", + "\x90\xCB" => "\xEB\xA8\x8D", + "\x90\xCC" => "\xEB\xA8\x8E", + "\x90\xCD" => "\xEB\xA8\x8F", + "\x90\xCE" => "\xEB\xA8\x90", + "\x90\xCF" => "\xEB\xA8\x91", + "\x90\xD0" => "\xEB\xA8\x92", + "\x90\xD1" => "\xEB\xA8\x93", + "\x90\xD2" => "\xEB\xA8\x94", + "\x90\xD3" => "\xEB\xA8\x96", + "\x90\xD4" => "\xEB\xA8\x97", + "\x90\xD5" => "\xEB\xA8\x98", + "\x90\xD6" => "\xEB\xA8\x99", + "\x90\xD7" => "\xEB\xA8\x9A", + "\x90\xD8" => "\xEB\xA8\x9B", + "\x90\xD9" => "\xEB\xA8\x9C", + "\x90\xDA" => "\xEB\xA8\x9D", + "\x90\xDB" => "\xEB\xA8\x9E", + "\x90\xDC" => "\xEB\xA8\x9F", + "\x90\xDD" => "\xEB\xA8\xA0", + "\x90\xDE" => "\xEB\xA8\xA1", + "\x90\xDF" => "\xEB\xA8\xA2", + "\x90\xE0" => "\xEB\xA8\xA3", + "\x90\xE1" => "\xEB\xA8\xA4", + "\x90\xE2" => "\xEB\xA8\xA5", + "\x90\xE3" => "\xEB\xA8\xA6", + "\x90\xE4" => "\xEB\xA8\xA7", + "\x90\xE5" => "\xEB\xA8\xA8", + "\x90\xE6" => "\xEB\xA8\xA9", + "\x90\xE7" => "\xEB\xA8\xAA", + "\x90\xE8" => "\xEB\xA8\xAB", + "\x90\xE9" => "\xEB\xA8\xAC", + "\x90\xEA" => "\xEB\xA8\xAD", + "\x90\xEB" => "\xEB\xA8\xAE", + "\x90\xEC" => "\xEB\xA8\xAF", + "\x90\xED" => "\xEB\xA8\xB0", + "\x90\xEE" => "\xEB\xA8\xB1", + "\x90\xEF" => "\xEB\xA8\xB2", + "\x90\xF0" => "\xEB\xA8\xB3", + "\x90\xF1" => "\xEB\xA8\xB4", + "\x90\xF2" => "\xEB\xA8\xB5", + "\x90\xF3" => "\xEB\xA8\xB6", + "\x90\xF4" => "\xEB\xA8\xB7", + "\x90\xF5" => "\xEB\xA8\xBA", + "\x90\xF6" => "\xEB\xA8\xBB", + "\x90\xF7" => "\xEB\xA8\xBD", + "\x90\xF8" => "\xEB\xA8\xBE", + "\x90\xF9" => "\xEB\xA8\xBF", + "\x90\xFA" => "\xEB\xA9\x81", + "\x90\xFB" => "\xEB\xA9\x83", + "\x90\xFC" => "\xEB\xA9\x84", + "\x90\xFD" => "\xEB\xA9\x85", + "\x90\xFE" => "\xEB\xA9\x86", + "\x91\x41" => "\xEB\xA9\x87", + "\x91\x42" => "\xEB\xA9\x8A", + "\x91\x43" => "\xEB\xA9\x8C", + "\x91\x44" => "\xEB\xA9\x8F", + "\x91\x45" => "\xEB\xA9\x90", + "\x91\x46" => "\xEB\xA9\x91", + "\x91\x47" => "\xEB\xA9\x92", + "\x91\x48" => "\xEB\xA9\x96", + "\x91\x49" => "\xEB\xA9\x97", + "\x91\x4A" => "\xEB\xA9\x99", + "\x91\x4B" => "\xEB\xA9\x9A", + "\x91\x4C" => "\xEB\xA9\x9B", + "\x91\x4D" => "\xEB\xA9\x9D", + "\x91\x4E" => "\xEB\xA9\x9E", + "\x91\x4F" => "\xEB\xA9\x9F", + "\x91\x50" => "\xEB\xA9\xA0", + "\x91\x51" => "\xEB\xA9\xA1", + "\x91\x52" => "\xEB\xA9\xA2", + "\x91\x53" => "\xEB\xA9\xA3", + "\x91\x54" => "\xEB\xA9\xA6", + "\x91\x55" => "\xEB\xA9\xAA", + "\x91\x56" => "\xEB\xA9\xAB", + "\x91\x57" => "\xEB\xA9\xAC", + "\x91\x58" => "\xEB\xA9\xAD", + "\x91\x59" => "\xEB\xA9\xAE", + "\x91\x5A" => "\xEB\xA9\xAF", + "\x91\x61" => "\xEB\xA9\xB2", + "\x91\x62" => "\xEB\xA9\xB3", + "\x91\x63" => "\xEB\xA9\xB5", + "\x91\x64" => "\xEB\xA9\xB6", + "\x91\x65" => "\xEB\xA9\xB7", + "\x91\x66" => "\xEB\xA9\xB9", + "\x91\x67" => "\xEB\xA9\xBA", + "\x91\x68" => "\xEB\xA9\xBB", + "\x91\x69" => "\xEB\xA9\xBC", + "\x91\x6A" => "\xEB\xA9\xBD", + "\x91\x6B" => "\xEB\xA9\xBE", + "\x91\x6C" => "\xEB\xA9\xBF", + "\x91\x6D" => "\xEB\xAA\x80", + "\x91\x6E" => "\xEB\xAA\x81", + "\x91\x6F" => "\xEB\xAA\x82", + "\x91\x70" => "\xEB\xAA\x86", + "\x91\x71" => "\xEB\xAA\x88", + "\x91\x72" => "\xEB\xAA\x89", + "\x91\x73" => "\xEB\xAA\x8A", + "\x91\x74" => "\xEB\xAA\x8B", + "\x91\x75" => "\xEB\xAA\x8D", + "\x91\x76" => "\xEB\xAA\x8E", + "\x91\x77" => "\xEB\xAA\x8F", + "\x91\x78" => "\xEB\xAA\x90", + "\x91\x79" => "\xEB\xAA\x91", + "\x91\x7A" => "\xEB\xAA\x92", + "\x91\x81" => "\xEB\xAA\x93", + "\x91\x82" => "\xEB\xAA\x94", + "\x91\x83" => "\xEB\xAA\x95", + "\x91\x84" => "\xEB\xAA\x96", + "\x91\x85" => "\xEB\xAA\x97", + "\x91\x86" => "\xEB\xAA\x98", + "\x91\x87" => "\xEB\xAA\x99", + "\x91\x88" => "\xEB\xAA\x9A", + "\x91\x89" => "\xEB\xAA\x9B", + "\x91\x8A" => "\xEB\xAA\x9C", + "\x91\x8B" => "\xEB\xAA\x9D", + "\x91\x8C" => "\xEB\xAA\x9E", + "\x91\x8D" => "\xEB\xAA\x9F", + "\x91\x8E" => "\xEB\xAA\xA0", + "\x91\x8F" => "\xEB\xAA\xA1", + "\x91\x90" => "\xEB\xAA\xA2", + "\x91\x91" => "\xEB\xAA\xA3", + "\x91\x92" => "\xEB\xAA\xA4", + "\x91\x93" => "\xEB\xAA\xA5", + "\x91\x94" => "\xEB\xAA\xA6", + "\x91\x95" => "\xEB\xAA\xA7", + "\x91\x96" => "\xEB\xAA\xAA", + "\x91\x97" => "\xEB\xAA\xAD", + "\x91\x98" => "\xEB\xAA\xAE", + "\x91\x99" => "\xEB\xAA\xAF", + "\x91\x9A" => "\xEB\xAA\xB1", + "\x91\x9B" => "\xEB\xAA\xB3", + "\x91\x9C" => "\xEB\xAA\xB4", + "\x91\x9D" => "\xEB\xAA\xB5", + "\x91\x9E" => "\xEB\xAA\xB6", + "\x91\x9F" => "\xEB\xAA\xB7", + "\x91\xA0" => "\xEB\xAA\xBA", + "\x91\xA1" => "\xEB\xAA\xBC", + "\x91\xA2" => "\xEB\xAA\xBE", + "\x91\xA3" => "\xEB\xAA\xBF", + "\x91\xA4" => "\xEB\xAB\x80", + "\x91\xA5" => "\xEB\xAB\x81", + "\x91\xA6" => "\xEB\xAB\x82", + "\x91\xA7" => "\xEB\xAB\x83", + "\x91\xA8" => "\xEB\xAB\x85", + "\x91\xA9" => "\xEB\xAB\x86", + "\x91\xAA" => "\xEB\xAB\x87", + "\x91\xAB" => "\xEB\xAB\x89", + "\x91\xAC" => "\xEB\xAB\x8A", + "\x91\xAD" => "\xEB\xAB\x8B", + "\x91\xAE" => "\xEB\xAB\x8C", + "\x91\xAF" => "\xEB\xAB\x8D", + "\x91\xB0" => "\xEB\xAB\x8E", + "\x91\xB1" => "\xEB\xAB\x8F", + "\x91\xB2" => "\xEB\xAB\x90", + "\x91\xB3" => "\xEB\xAB\x91", + "\x91\xB4" => "\xEB\xAB\x92", + "\x91\xB5" => "\xEB\xAB\x93", + "\x91\xB6" => "\xEB\xAB\x94", + "\x91\xB7" => "\xEB\xAB\x95", + "\x91\xB8" => "\xEB\xAB\x96", + "\x91\xB9" => "\xEB\xAB\x97", + "\x91\xBA" => "\xEB\xAB\x9A", + "\x91\xBB" => "\xEB\xAB\x9B", + "\x91\xBC" => "\xEB\xAB\x9C", + "\x91\xBD" => "\xEB\xAB\x9D", + "\x91\xBE" => "\xEB\xAB\x9E", + "\x91\xBF" => "\xEB\xAB\x9F", + "\x91\xC0" => "\xEB\xAB\xA0", + "\x91\xC1" => "\xEB\xAB\xA1", + "\x91\xC2" => "\xEB\xAB\xA2", + "\x91\xC3" => "\xEB\xAB\xA3", + "\x91\xC4" => "\xEB\xAB\xA4", + "\x91\xC5" => "\xEB\xAB\xA5", + "\x91\xC6" => "\xEB\xAB\xA6", + "\x91\xC7" => "\xEB\xAB\xA7", + "\x91\xC8" => "\xEB\xAB\xA8", + "\x91\xC9" => "\xEB\xAB\xA9", + "\x91\xCA" => "\xEB\xAB\xAA", + "\x91\xCB" => "\xEB\xAB\xAB", + "\x91\xCC" => "\xEB\xAB\xAC", + "\x91\xCD" => "\xEB\xAB\xAD", + "\x91\xCE" => "\xEB\xAB\xAE", + "\x91\xCF" => "\xEB\xAB\xAF", + "\x91\xD0" => "\xEB\xAB\xB0", + "\x91\xD1" => "\xEB\xAB\xB1", + "\x91\xD2" => "\xEB\xAB\xB2", + "\x91\xD3" => "\xEB\xAB\xB3", + "\x91\xD4" => "\xEB\xAB\xB4", + "\x91\xD5" => "\xEB\xAB\xB5", + "\x91\xD6" => "\xEB\xAB\xB6", + "\x91\xD7" => "\xEB\xAB\xB7", + "\x91\xD8" => "\xEB\xAB\xB8", + "\x91\xD9" => "\xEB\xAB\xB9", + "\x91\xDA" => "\xEB\xAB\xBA", + "\x91\xDB" => "\xEB\xAB\xBB", + "\x91\xDC" => "\xEB\xAB\xBD", + "\x91\xDD" => "\xEB\xAB\xBE", + "\x91\xDE" => "\xEB\xAB\xBF", + "\x91\xDF" => "\xEB\xAC\x81", + "\x91\xE0" => "\xEB\xAC\x82", + "\x91\xE1" => "\xEB\xAC\x83", + "\x91\xE2" => "\xEB\xAC\x85", + "\x91\xE3" => "\xEB\xAC\x86", + "\x91\xE4" => "\xEB\xAC\x87", + "\x91\xE5" => "\xEB\xAC\x88", + "\x91\xE6" => "\xEB\xAC\x89", + "\x91\xE7" => "\xEB\xAC\x8A", + "\x91\xE8" => "\xEB\xAC\x8B", + "\x91\xE9" => "\xEB\xAC\x8C", + "\x91\xEA" => "\xEB\xAC\x8E", + "\x91\xEB" => "\xEB\xAC\x90", + "\x91\xEC" => "\xEB\xAC\x92", + "\x91\xED" => "\xEB\xAC\x93", + "\x91\xEE" => "\xEB\xAC\x94", + "\x91\xEF" => "\xEB\xAC\x95", + "\x91\xF0" => "\xEB\xAC\x96", + "\x91\xF1" => "\xEB\xAC\x97", + "\x91\xF2" => "\xEB\xAC\x99", + "\x91\xF3" => "\xEB\xAC\x9A", + "\x91\xF4" => "\xEB\xAC\x9B", + "\x91\xF5" => "\xEB\xAC\x9D", + "\x91\xF6" => "\xEB\xAC\x9E", + "\x91\xF7" => "\xEB\xAC\x9F", + "\x91\xF8" => "\xEB\xAC\xA1", + "\x91\xF9" => "\xEB\xAC\xA2", + "\x91\xFA" => "\xEB\xAC\xA3", + "\x91\xFB" => "\xEB\xAC\xA4", + "\x91\xFC" => "\xEB\xAC\xA5", + "\x91\xFD" => "\xEB\xAC\xA6", + "\x91\xFE" => "\xEB\xAC\xA7", + "\x92\x41" => "\xEB\xAC\xA8", + "\x92\x42" => "\xEB\xAC\xAA", + "\x92\x43" => "\xEB\xAC\xAC", + "\x92\x44" => "\xEB\xAC\xAD", + "\x92\x45" => "\xEB\xAC\xAE", + "\x92\x46" => "\xEB\xAC\xAF", + "\x92\x47" => "\xEB\xAC\xB0", + "\x92\x48" => "\xEB\xAC\xB1", + "\x92\x49" => "\xEB\xAC\xB2", + "\x92\x4A" => "\xEB\xAC\xB3", + "\x92\x4B" => "\xEB\xAC\xB7", + "\x92\x4C" => "\xEB\xAC\xB9", + "\x92\x4D" => "\xEB\xAC\xBA", + "\x92\x4E" => "\xEB\xAC\xBF", + "\x92\x4F" => "\xEB\xAD\x80", + "\x92\x50" => "\xEB\xAD\x81", + "\x92\x51" => "\xEB\xAD\x82", + "\x92\x52" => "\xEB\xAD\x83", + "\x92\x53" => "\xEB\xAD\x86", + "\x92\x54" => "\xEB\xAD\x88", + "\x92\x55" => "\xEB\xAD\x8A", + "\x92\x56" => "\xEB\xAD\x8B", + "\x92\x57" => "\xEB\xAD\x8C", + "\x92\x58" => "\xEB\xAD\x8E", + "\x92\x59" => "\xEB\xAD\x91", + "\x92\x5A" => "\xEB\xAD\x92", + "\x92\x61" => "\xEB\xAD\x93", + "\x92\x62" => "\xEB\xAD\x95", + "\x92\x63" => "\xEB\xAD\x96", + "\x92\x64" => "\xEB\xAD\x97", + "\x92\x65" => "\xEB\xAD\x99", + "\x92\x66" => "\xEB\xAD\x9A", + "\x92\x67" => "\xEB\xAD\x9B", + "\x92\x68" => "\xEB\xAD\x9C", + "\x92\x69" => "\xEB\xAD\x9D", + "\x92\x6A" => "\xEB\xAD\x9E", + "\x92\x6B" => "\xEB\xAD\x9F", + "\x92\x6C" => "\xEB\xAD\xA0", + "\x92\x6D" => "\xEB\xAD\xA2", + "\x92\x6E" => "\xEB\xAD\xA4", + "\x92\x6F" => "\xEB\xAD\xA5", + "\x92\x70" => "\xEB\xAD\xA6", + "\x92\x71" => "\xEB\xAD\xA7", + "\x92\x72" => "\xEB\xAD\xA8", + "\x92\x73" => "\xEB\xAD\xA9", + "\x92\x74" => "\xEB\xAD\xAA", + "\x92\x75" => "\xEB\xAD\xAB", + "\x92\x76" => "\xEB\xAD\xAD", + "\x92\x77" => "\xEB\xAD\xAE", + "\x92\x78" => "\xEB\xAD\xAF", + "\x92\x79" => "\xEB\xAD\xB0", + "\x92\x7A" => "\xEB\xAD\xB1", + "\x92\x81" => "\xEB\xAD\xB2", + "\x92\x82" => "\xEB\xAD\xB3", + "\x92\x83" => "\xEB\xAD\xB4", + "\x92\x84" => "\xEB\xAD\xB5", + "\x92\x85" => "\xEB\xAD\xB6", + "\x92\x86" => "\xEB\xAD\xB7", + "\x92\x87" => "\xEB\xAD\xB8", + "\x92\x88" => "\xEB\xAD\xB9", + "\x92\x89" => "\xEB\xAD\xBA", + "\x92\x8A" => "\xEB\xAD\xBB", + "\x92\x8B" => "\xEB\xAD\xBC", + "\x92\x8C" => "\xEB\xAD\xBD", + "\x92\x8D" => "\xEB\xAD\xBE", + "\x92\x8E" => "\xEB\xAD\xBF", + "\x92\x8F" => "\xEB\xAE\x80", + "\x92\x90" => "\xEB\xAE\x81", + "\x92\x91" => "\xEB\xAE\x82", + "\x92\x92" => "\xEB\xAE\x83", + "\x92\x93" => "\xEB\xAE\x84", + "\x92\x94" => "\xEB\xAE\x85", + "\x92\x95" => "\xEB\xAE\x86", + "\x92\x96" => "\xEB\xAE\x87", + "\x92\x97" => "\xEB\xAE\x89", + "\x92\x98" => "\xEB\xAE\x8A", + "\x92\x99" => "\xEB\xAE\x8B", + "\x92\x9A" => "\xEB\xAE\x8D", + "\x92\x9B" => "\xEB\xAE\x8E", + "\x92\x9C" => "\xEB\xAE\x8F", + "\x92\x9D" => "\xEB\xAE\x91", + "\x92\x9E" => "\xEB\xAE\x92", + "\x92\x9F" => "\xEB\xAE\x93", + "\x92\xA0" => "\xEB\xAE\x94", + "\x92\xA1" => "\xEB\xAE\x95", + "\x92\xA2" => "\xEB\xAE\x96", + "\x92\xA3" => "\xEB\xAE\x97", + "\x92\xA4" => "\xEB\xAE\x98", + "\x92\xA5" => "\xEB\xAE\x99", + "\x92\xA6" => "\xEB\xAE\x9A", + "\x92\xA7" => "\xEB\xAE\x9B", + "\x92\xA8" => "\xEB\xAE\x9C", + "\x92\xA9" => "\xEB\xAE\x9D", + "\x92\xAA" => "\xEB\xAE\x9E", + "\x92\xAB" => "\xEB\xAE\x9F", + "\x92\xAC" => "\xEB\xAE\xA0", + "\x92\xAD" => "\xEB\xAE\xA1", + "\x92\xAE" => "\xEB\xAE\xA2", + "\x92\xAF" => "\xEB\xAE\xA3", + "\x92\xB0" => "\xEB\xAE\xA5", + "\x92\xB1" => "\xEB\xAE\xA6", + "\x92\xB2" => "\xEB\xAE\xA7", + "\x92\xB3" => "\xEB\xAE\xA9", + "\x92\xB4" => "\xEB\xAE\xAA", + "\x92\xB5" => "\xEB\xAE\xAB", + "\x92\xB6" => "\xEB\xAE\xAD", + "\x92\xB7" => "\xEB\xAE\xAE", + "\x92\xB8" => "\xEB\xAE\xAF", + "\x92\xB9" => "\xEB\xAE\xB0", + "\x92\xBA" => "\xEB\xAE\xB1", + "\x92\xBB" => "\xEB\xAE\xB2", + "\x92\xBC" => "\xEB\xAE\xB3", + "\x92\xBD" => "\xEB\xAE\xB5", + "\x92\xBE" => "\xEB\xAE\xB6", + "\x92\xBF" => "\xEB\xAE\xB8", + "\x92\xC0" => "\xEB\xAE\xB9", + "\x92\xC1" => "\xEB\xAE\xBA", + "\x92\xC2" => "\xEB\xAE\xBB", + "\x92\xC3" => "\xEB\xAE\xBC", + "\x92\xC4" => "\xEB\xAE\xBD", + "\x92\xC5" => "\xEB\xAE\xBE", + "\x92\xC6" => "\xEB\xAE\xBF", + "\x92\xC7" => "\xEB\xAF\x81", + "\x92\xC8" => "\xEB\xAF\x82", + "\x92\xC9" => "\xEB\xAF\x83", + "\x92\xCA" => "\xEB\xAF\x85", + "\x92\xCB" => "\xEB\xAF\x86", + "\x92\xCC" => "\xEB\xAF\x87", + "\x92\xCD" => "\xEB\xAF\x89", + "\x92\xCE" => "\xEB\xAF\x8A", + "\x92\xCF" => "\xEB\xAF\x8B", + "\x92\xD0" => "\xEB\xAF\x8C", + "\x92\xD1" => "\xEB\xAF\x8D", + "\x92\xD2" => "\xEB\xAF\x8E", + "\x92\xD3" => "\xEB\xAF\x8F", + "\x92\xD4" => "\xEB\xAF\x91", + "\x92\xD5" => "\xEB\xAF\x92", + "\x92\xD6" => "\xEB\xAF\x94", + "\x92\xD7" => "\xEB\xAF\x95", + "\x92\xD8" => "\xEB\xAF\x96", + "\x92\xD9" => "\xEB\xAF\x97", + "\x92\xDA" => "\xEB\xAF\x98", + "\x92\xDB" => "\xEB\xAF\x99", + "\x92\xDC" => "\xEB\xAF\x9A", + "\x92\xDD" => "\xEB\xAF\x9B", + "\x92\xDE" => "\xEB\xAF\x9C", + "\x92\xDF" => "\xEB\xAF\x9D", + "\x92\xE0" => "\xEB\xAF\x9E", + "\x92\xE1" => "\xEB\xAF\x9F", + "\x92\xE2" => "\xEB\xAF\xA0", + "\x92\xE3" => "\xEB\xAF\xA1", + "\x92\xE4" => "\xEB\xAF\xA2", + "\x92\xE5" => "\xEB\xAF\xA3", + "\x92\xE6" => "\xEB\xAF\xA4", + "\x92\xE7" => "\xEB\xAF\xA5", + "\x92\xE8" => "\xEB\xAF\xA6", + "\x92\xE9" => "\xEB\xAF\xA7", + "\x92\xEA" => "\xEB\xAF\xA8", + "\x92\xEB" => "\xEB\xAF\xA9", + "\x92\xEC" => "\xEB\xAF\xAA", + "\x92\xED" => "\xEB\xAF\xAB", + "\x92\xEE" => "\xEB\xAF\xAC", + "\x92\xEF" => "\xEB\xAF\xAD", + "\x92\xF0" => "\xEB\xAF\xAE", + "\x92\xF1" => "\xEB\xAF\xAF", + "\x92\xF2" => "\xEB\xAF\xB0", + "\x92\xF3" => "\xEB\xAF\xB1", + "\x92\xF4" => "\xEB\xAF\xB2", + "\x92\xF5" => "\xEB\xAF\xB3", + "\x92\xF6" => "\xEB\xAF\xB4", + "\x92\xF7" => "\xEB\xAF\xB5", + "\x92\xF8" => "\xEB\xAF\xB6", + "\x92\xF9" => "\xEB\xAF\xB7", + "\x92\xFA" => "\xEB\xAF\xBA", + "\x92\xFB" => "\xEB\xAF\xBB", + "\x92\xFC" => "\xEB\xAF\xBD", + "\x92\xFD" => "\xEB\xAF\xBE", + "\x92\xFE" => "\xEB\xB0\x81", + "\x93\x41" => "\xEB\xB0\x83", + "\x93\x42" => "\xEB\xB0\x84", + "\x93\x43" => "\xEB\xB0\x85", + "\x93\x44" => "\xEB\xB0\x86", + "\x93\x45" => "\xEB\xB0\x87", + "\x93\x46" => "\xEB\xB0\x8A", + "\x93\x47" => "\xEB\xB0\x8E", + "\x93\x48" => "\xEB\xB0\x90", + "\x93\x49" => "\xEB\xB0\x92", + "\x93\x4A" => "\xEB\xB0\x93", + "\x93\x4B" => "\xEB\xB0\x99", + "\x93\x4C" => "\xEB\xB0\x9A", + "\x93\x4D" => "\xEB\xB0\xA0", + "\x93\x4E" => "\xEB\xB0\xA1", + "\x93\x4F" => "\xEB\xB0\xA2", + "\x93\x50" => "\xEB\xB0\xA3", + "\x93\x51" => "\xEB\xB0\xA6", + "\x93\x52" => "\xEB\xB0\xA8", + "\x93\x53" => "\xEB\xB0\xAA", + "\x93\x54" => "\xEB\xB0\xAB", + "\x93\x55" => "\xEB\xB0\xAC", + "\x93\x56" => "\xEB\xB0\xAE", + "\x93\x57" => "\xEB\xB0\xAF", + "\x93\x58" => "\xEB\xB0\xB2", + "\x93\x59" => "\xEB\xB0\xB3", + "\x93\x5A" => "\xEB\xB0\xB5", + "\x93\x61" => "\xEB\xB0\xB6", + "\x93\x62" => "\xEB\xB0\xB7", + "\x93\x63" => "\xEB\xB0\xB9", + "\x93\x64" => "\xEB\xB0\xBA", + "\x93\x65" => "\xEB\xB0\xBB", + "\x93\x66" => "\xEB\xB0\xBC", + "\x93\x67" => "\xEB\xB0\xBD", + "\x93\x68" => "\xEB\xB0\xBE", + "\x93\x69" => "\xEB\xB0\xBF", + "\x93\x6A" => "\xEB\xB1\x82", + "\x93\x6B" => "\xEB\xB1\x86", + "\x93\x6C" => "\xEB\xB1\x87", + "\x93\x6D" => "\xEB\xB1\x88", + "\x93\x6E" => "\xEB\xB1\x8A", + "\x93\x6F" => "\xEB\xB1\x8B", + "\x93\x70" => "\xEB\xB1\x8E", + "\x93\x71" => "\xEB\xB1\x8F", + "\x93\x72" => "\xEB\xB1\x91", + "\x93\x73" => "\xEB\xB1\x92", + "\x93\x74" => "\xEB\xB1\x93", + "\x93\x75" => "\xEB\xB1\x94", + "\x93\x76" => "\xEB\xB1\x95", + "\x93\x77" => "\xEB\xB1\x96", + "\x93\x78" => "\xEB\xB1\x97", + "\x93\x79" => "\xEB\xB1\x98", + "\x93\x7A" => "\xEB\xB1\x99", + "\x93\x81" => "\xEB\xB1\x9A", + "\x93\x82" => "\xEB\xB1\x9B", + "\x93\x83" => "\xEB\xB1\x9C", + "\x93\x84" => "\xEB\xB1\x9E", + "\x93\x85" => "\xEB\xB1\x9F", + "\x93\x86" => "\xEB\xB1\xA0", + "\x93\x87" => "\xEB\xB1\xA1", + "\x93\x88" => "\xEB\xB1\xA2", + "\x93\x89" => "\xEB\xB1\xA3", + "\x93\x8A" => "\xEB\xB1\xA4", + "\x93\x8B" => "\xEB\xB1\xA5", + "\x93\x8C" => "\xEB\xB1\xA6", + "\x93\x8D" => "\xEB\xB1\xA7", + "\x93\x8E" => "\xEB\xB1\xA8", + "\x93\x8F" => "\xEB\xB1\xA9", + "\x93\x90" => "\xEB\xB1\xAA", + "\x93\x91" => "\xEB\xB1\xAB", + "\x93\x92" => "\xEB\xB1\xAC", + "\x93\x93" => "\xEB\xB1\xAD", + "\x93\x94" => "\xEB\xB1\xAE", + "\x93\x95" => "\xEB\xB1\xAF", + "\x93\x96" => "\xEB\xB1\xB0", + "\x93\x97" => "\xEB\xB1\xB1", + "\x93\x98" => "\xEB\xB1\xB2", + "\x93\x99" => "\xEB\xB1\xB3", + "\x93\x9A" => "\xEB\xB1\xB4", + "\x93\x9B" => "\xEB\xB1\xB5", + "\x93\x9C" => "\xEB\xB1\xB6", + "\x93\x9D" => "\xEB\xB1\xB7", + "\x93\x9E" => "\xEB\xB1\xB8", + "\x93\x9F" => "\xEB\xB1\xB9", + "\x93\xA0" => "\xEB\xB1\xBA", + "\x93\xA1" => "\xEB\xB1\xBB", + "\x93\xA2" => "\xEB\xB1\xBC", + "\x93\xA3" => "\xEB\xB1\xBD", + "\x93\xA4" => "\xEB\xB1\xBE", + "\x93\xA5" => "\xEB\xB1\xBF", + "\x93\xA6" => "\xEB\xB2\x80", + "\x93\xA7" => "\xEB\xB2\x81", + "\x93\xA8" => "\xEB\xB2\x82", + "\x93\xA9" => "\xEB\xB2\x83", + "\x93\xAA" => "\xEB\xB2\x86", + "\x93\xAB" => "\xEB\xB2\x87", + "\x93\xAC" => "\xEB\xB2\x89", + "\x93\xAD" => "\xEB\xB2\x8A", + "\x93\xAE" => "\xEB\xB2\x8D", + "\x93\xAF" => "\xEB\xB2\x8F", + "\x93\xB0" => "\xEB\xB2\x90", + "\x93\xB1" => "\xEB\xB2\x91", + "\x93\xB2" => "\xEB\xB2\x92", + "\x93\xB3" => "\xEB\xB2\x93", + "\x93\xB4" => "\xEB\xB2\x96", + "\x93\xB5" => "\xEB\xB2\x98", + "\x93\xB6" => "\xEB\xB2\x9B", + "\x93\xB7" => "\xEB\xB2\x9C", + "\x93\xB8" => "\xEB\xB2\x9D", + "\x93\xB9" => "\xEB\xB2\x9E", + "\x93\xBA" => "\xEB\xB2\x9F", + "\x93\xBB" => "\xEB\xB2\xA2", + "\x93\xBC" => "\xEB\xB2\xA3", + "\x93\xBD" => "\xEB\xB2\xA5", + "\x93\xBE" => "\xEB\xB2\xA6", + "\x93\xBF" => "\xEB\xB2\xA9", + "\x93\xC0" => "\xEB\xB2\xAA", + "\x93\xC1" => "\xEB\xB2\xAB", + "\x93\xC2" => "\xEB\xB2\xAC", + "\x93\xC3" => "\xEB\xB2\xAD", + "\x93\xC4" => "\xEB\xB2\xAE", + "\x93\xC5" => "\xEB\xB2\xAF", + "\x93\xC6" => "\xEB\xB2\xB2", + "\x93\xC7" => "\xEB\xB2\xB6", + "\x93\xC8" => "\xEB\xB2\xB7", + "\x93\xC9" => "\xEB\xB2\xB8", + "\x93\xCA" => "\xEB\xB2\xB9", + "\x93\xCB" => "\xEB\xB2\xBA", + "\x93\xCC" => "\xEB\xB2\xBB", + "\x93\xCD" => "\xEB\xB2\xBE", + "\x93\xCE" => "\xEB\xB2\xBF", + "\x93\xCF" => "\xEB\xB3\x81", + "\x93\xD0" => "\xEB\xB3\x82", + "\x93\xD1" => "\xEB\xB3\x83", + "\x93\xD2" => "\xEB\xB3\x85", + "\x93\xD3" => "\xEB\xB3\x86", + "\x93\xD4" => "\xEB\xB3\x87", + "\x93\xD5" => "\xEB\xB3\x88", + "\x93\xD6" => "\xEB\xB3\x89", + "\x93\xD7" => "\xEB\xB3\x8A", + "\x93\xD8" => "\xEB\xB3\x8B", + "\x93\xD9" => "\xEB\xB3\x8C", + "\x93\xDA" => "\xEB\xB3\x8E", + "\x93\xDB" => "\xEB\xB3\x92", + "\x93\xDC" => "\xEB\xB3\x93", + "\x93\xDD" => "\xEB\xB3\x94", + "\x93\xDE" => "\xEB\xB3\x96", + "\x93\xDF" => "\xEB\xB3\x97", + "\x93\xE0" => "\xEB\xB3\x99", + "\x93\xE1" => "\xEB\xB3\x9A", + "\x93\xE2" => "\xEB\xB3\x9B", + "\x93\xE3" => "\xEB\xB3\x9D", + "\x93\xE4" => "\xEB\xB3\x9E", + "\x93\xE5" => "\xEB\xB3\x9F", + "\x93\xE6" => "\xEB\xB3\xA0", + "\x93\xE7" => "\xEB\xB3\xA1", + "\x93\xE8" => "\xEB\xB3\xA2", + "\x93\xE9" => "\xEB\xB3\xA3", + "\x93\xEA" => "\xEB\xB3\xA4", + "\x93\xEB" => "\xEB\xB3\xA5", + "\x93\xEC" => "\xEB\xB3\xA6", + "\x93\xED" => "\xEB\xB3\xA7", + "\x93\xEE" => "\xEB\xB3\xA8", + "\x93\xEF" => "\xEB\xB3\xA9", + "\x93\xF0" => "\xEB\xB3\xAA", + "\x93\xF1" => "\xEB\xB3\xAB", + "\x93\xF2" => "\xEB\xB3\xAC", + "\x93\xF3" => "\xEB\xB3\xAD", + "\x93\xF4" => "\xEB\xB3\xAE", + "\x93\xF5" => "\xEB\xB3\xAF", + "\x93\xF6" => "\xEB\xB3\xB0", + "\x93\xF7" => "\xEB\xB3\xB1", + "\x93\xF8" => "\xEB\xB3\xB2", + "\x93\xF9" => "\xEB\xB3\xB3", + "\x93\xFA" => "\xEB\xB3\xB7", + "\x93\xFB" => "\xEB\xB3\xB9", + "\x93\xFC" => "\xEB\xB3\xBA", + "\x93\xFD" => "\xEB\xB3\xBB", + "\x93\xFE" => "\xEB\xB3\xBD", + "\x94\x41" => "\xEB\xB3\xBE", + "\x94\x42" => "\xEB\xB3\xBF", + "\x94\x43" => "\xEB\xB4\x80", + "\x94\x44" => "\xEB\xB4\x81", + "\x94\x45" => "\xEB\xB4\x82", + "\x94\x46" => "\xEB\xB4\x83", + "\x94\x47" => "\xEB\xB4\x86", + "\x94\x48" => "\xEB\xB4\x88", + "\x94\x49" => "\xEB\xB4\x8A", + "\x94\x4A" => "\xEB\xB4\x8B", + "\x94\x4B" => "\xEB\xB4\x8C", + "\x94\x4C" => "\xEB\xB4\x8D", + "\x94\x4D" => "\xEB\xB4\x8E", + "\x94\x4E" => "\xEB\xB4\x8F", + "\x94\x4F" => "\xEB\xB4\x91", + "\x94\x50" => "\xEB\xB4\x92", + "\x94\x51" => "\xEB\xB4\x93", + "\x94\x52" => "\xEB\xB4\x95", + "\x94\x53" => "\xEB\xB4\x96", + "\x94\x54" => "\xEB\xB4\x97", + "\x94\x55" => "\xEB\xB4\x98", + "\x94\x56" => "\xEB\xB4\x99", + "\x94\x57" => "\xEB\xB4\x9A", + "\x94\x58" => "\xEB\xB4\x9B", + "\x94\x59" => "\xEB\xB4\x9C", + "\x94\x5A" => "\xEB\xB4\x9D", + "\x94\x61" => "\xEB\xB4\x9E", + "\x94\x62" => "\xEB\xB4\x9F", + "\x94\x63" => "\xEB\xB4\xA0", + "\x94\x64" => "\xEB\xB4\xA1", + "\x94\x65" => "\xEB\xB4\xA2", + "\x94\x66" => "\xEB\xB4\xA3", + "\x94\x67" => "\xEB\xB4\xA5", + "\x94\x68" => "\xEB\xB4\xA6", + "\x94\x69" => "\xEB\xB4\xA7", + "\x94\x6A" => "\xEB\xB4\xA8", + "\x94\x6B" => "\xEB\xB4\xA9", + "\x94\x6C" => "\xEB\xB4\xAA", + "\x94\x6D" => "\xEB\xB4\xAB", + "\x94\x6E" => "\xEB\xB4\xAD", + "\x94\x6F" => "\xEB\xB4\xAE", + "\x94\x70" => "\xEB\xB4\xAF", + "\x94\x71" => "\xEB\xB4\xB0", + "\x94\x72" => "\xEB\xB4\xB1", + "\x94\x73" => "\xEB\xB4\xB2", + "\x94\x74" => "\xEB\xB4\xB3", + "\x94\x75" => "\xEB\xB4\xB4", + "\x94\x76" => "\xEB\xB4\xB5", + "\x94\x77" => "\xEB\xB4\xB6", + "\x94\x78" => "\xEB\xB4\xB7", + "\x94\x79" => "\xEB\xB4\xB8", + "\x94\x7A" => "\xEB\xB4\xB9", + "\x94\x81" => "\xEB\xB4\xBA", + "\x94\x82" => "\xEB\xB4\xBB", + "\x94\x83" => "\xEB\xB4\xBC", + "\x94\x84" => "\xEB\xB4\xBD", + "\x94\x85" => "\xEB\xB4\xBE", + "\x94\x86" => "\xEB\xB4\xBF", + "\x94\x87" => "\xEB\xB5\x81", + "\x94\x88" => "\xEB\xB5\x82", + "\x94\x89" => "\xEB\xB5\x83", + "\x94\x8A" => "\xEB\xB5\x84", + "\x94\x8B" => "\xEB\xB5\x85", + "\x94\x8C" => "\xEB\xB5\x86", + "\x94\x8D" => "\xEB\xB5\x87", + "\x94\x8E" => "\xEB\xB5\x8A", + "\x94\x8F" => "\xEB\xB5\x8B", + "\x94\x90" => "\xEB\xB5\x8D", + "\x94\x91" => "\xEB\xB5\x8E", + "\x94\x92" => "\xEB\xB5\x8F", + "\x94\x93" => "\xEB\xB5\x91", + "\x94\x94" => "\xEB\xB5\x92", + "\x94\x95" => "\xEB\xB5\x93", + "\x94\x96" => "\xEB\xB5\x94", + "\x94\x97" => "\xEB\xB5\x95", + "\x94\x98" => "\xEB\xB5\x96", + "\x94\x99" => "\xEB\xB5\x97", + "\x94\x9A" => "\xEB\xB5\x9A", + "\x94\x9B" => "\xEB\xB5\x9B", + "\x94\x9C" => "\xEB\xB5\x9C", + "\x94\x9D" => "\xEB\xB5\x9D", + "\x94\x9E" => "\xEB\xB5\x9E", + "\x94\x9F" => "\xEB\xB5\x9F", + "\x94\xA0" => "\xEB\xB5\xA0", + "\x94\xA1" => "\xEB\xB5\xA1", + "\x94\xA2" => "\xEB\xB5\xA2", + "\x94\xA3" => "\xEB\xB5\xA3", + "\x94\xA4" => "\xEB\xB5\xA5", + "\x94\xA5" => "\xEB\xB5\xA6", + "\x94\xA6" => "\xEB\xB5\xA7", + "\x94\xA7" => "\xEB\xB5\xA9", + "\x94\xA8" => "\xEB\xB5\xAA", + "\x94\xA9" => "\xEB\xB5\xAB", + "\x94\xAA" => "\xEB\xB5\xAC", + "\x94\xAB" => "\xEB\xB5\xAD", + "\x94\xAC" => "\xEB\xB5\xAE", + "\x94\xAD" => "\xEB\xB5\xAF", + "\x94\xAE" => "\xEB\xB5\xB0", + "\x94\xAF" => "\xEB\xB5\xB1", + "\x94\xB0" => "\xEB\xB5\xB2", + "\x94\xB1" => "\xEB\xB5\xB3", + "\x94\xB2" => "\xEB\xB5\xB4", + "\x94\xB3" => "\xEB\xB5\xB5", + "\x94\xB4" => "\xEB\xB5\xB6", + "\x94\xB5" => "\xEB\xB5\xB7", + "\x94\xB6" => "\xEB\xB5\xB8", + "\x94\xB7" => "\xEB\xB5\xB9", + "\x94\xB8" => "\xEB\xB5\xBA", + "\x94\xB9" => "\xEB\xB5\xBB", + "\x94\xBA" => "\xEB\xB5\xBC", + "\x94\xBB" => "\xEB\xB5\xBD", + "\x94\xBC" => "\xEB\xB5\xBE", + "\x94\xBD" => "\xEB\xB5\xBF", + "\x94\xBE" => "\xEB\xB6\x82", + "\x94\xBF" => "\xEB\xB6\x83", + "\x94\xC0" => "\xEB\xB6\x85", + "\x94\xC1" => "\xEB\xB6\x86", + "\x94\xC2" => "\xEB\xB6\x8B", + "\x94\xC3" => "\xEB\xB6\x8C", + "\x94\xC4" => "\xEB\xB6\x8D", + "\x94\xC5" => "\xEB\xB6\x8E", + "\x94\xC6" => "\xEB\xB6\x8F", + "\x94\xC7" => "\xEB\xB6\x92", + "\x94\xC8" => "\xEB\xB6\x94", + "\x94\xC9" => "\xEB\xB6\x96", + "\x94\xCA" => "\xEB\xB6\x97", + "\x94\xCB" => "\xEB\xB6\x98", + "\x94\xCC" => "\xEB\xB6\x9B", + "\x94\xCD" => "\xEB\xB6\x9D", + "\x94\xCE" => "\xEB\xB6\x9E", + "\x94\xCF" => "\xEB\xB6\x9F", + "\x94\xD0" => "\xEB\xB6\xA0", + "\x94\xD1" => "\xEB\xB6\xA1", + "\x94\xD2" => "\xEB\xB6\xA2", + "\x94\xD3" => "\xEB\xB6\xA3", + "\x94\xD4" => "\xEB\xB6\xA5", + "\x94\xD5" => "\xEB\xB6\xA6", + "\x94\xD6" => "\xEB\xB6\xA7", + "\x94\xD7" => "\xEB\xB6\xA8", + "\x94\xD8" => "\xEB\xB6\xA9", + "\x94\xD9" => "\xEB\xB6\xAA", + "\x94\xDA" => "\xEB\xB6\xAB", + "\x94\xDB" => "\xEB\xB6\xAC", + "\x94\xDC" => "\xEB\xB6\xAD", + "\x94\xDD" => "\xEB\xB6\xAE", + "\x94\xDE" => "\xEB\xB6\xAF", + "\x94\xDF" => "\xEB\xB6\xB1", + "\x94\xE0" => "\xEB\xB6\xB2", + "\x94\xE1" => "\xEB\xB6\xB3", + "\x94\xE2" => "\xEB\xB6\xB4", + "\x94\xE3" => "\xEB\xB6\xB5", + "\x94\xE4" => "\xEB\xB6\xB6", + "\x94\xE5" => "\xEB\xB6\xB7", + "\x94\xE6" => "\xEB\xB6\xB9", + "\x94\xE7" => "\xEB\xB6\xBA", + "\x94\xE8" => "\xEB\xB6\xBB", + "\x94\xE9" => "\xEB\xB6\xBC", + "\x94\xEA" => "\xEB\xB6\xBD", + "\x94\xEB" => "\xEB\xB6\xBE", + "\x94\xEC" => "\xEB\xB6\xBF", + "\x94\xED" => "\xEB\xB7\x80", + "\x94\xEE" => "\xEB\xB7\x81", + "\x94\xEF" => "\xEB\xB7\x82", + "\x94\xF0" => "\xEB\xB7\x83", + "\x94\xF1" => "\xEB\xB7\x84", + "\x94\xF2" => "\xEB\xB7\x85", + "\x94\xF3" => "\xEB\xB7\x86", + "\x94\xF4" => "\xEB\xB7\x87", + "\x94\xF5" => "\xEB\xB7\x88", + "\x94\xF6" => "\xEB\xB7\x89", + "\x94\xF7" => "\xEB\xB7\x8A", + "\x94\xF8" => "\xEB\xB7\x8B", + "\x94\xF9" => "\xEB\xB7\x8C", + "\x94\xFA" => "\xEB\xB7\x8D", + "\x94\xFB" => "\xEB\xB7\x8E", + "\x94\xFC" => "\xEB\xB7\x8F", + "\x94\xFD" => "\xEB\xB7\x90", + "\x94\xFE" => "\xEB\xB7\x91", + "\x95\x41" => "\xEB\xB7\x92", + "\x95\x42" => "\xEB\xB7\x93", + "\x95\x43" => "\xEB\xB7\x96", + "\x95\x44" => "\xEB\xB7\x97", + "\x95\x45" => "\xEB\xB7\x99", + "\x95\x46" => "\xEB\xB7\x9A", + "\x95\x47" => "\xEB\xB7\x9B", + "\x95\x48" => "\xEB\xB7\x9D", + "\x95\x49" => "\xEB\xB7\x9E", + "\x95\x4A" => "\xEB\xB7\x9F", + "\x95\x4B" => "\xEB\xB7\xA0", + "\x95\x4C" => "\xEB\xB7\xA1", + "\x95\x4D" => "\xEB\xB7\xA2", + "\x95\x4E" => "\xEB\xB7\xA3", + "\x95\x4F" => "\xEB\xB7\xA4", + "\x95\x50" => "\xEB\xB7\xA5", + "\x95\x51" => "\xEB\xB7\xA6", + "\x95\x52" => "\xEB\xB7\xA7", + "\x95\x53" => "\xEB\xB7\xA8", + "\x95\x54" => "\xEB\xB7\xAA", + "\x95\x55" => "\xEB\xB7\xAB", + "\x95\x56" => "\xEB\xB7\xAC", + "\x95\x57" => "\xEB\xB7\xAD", + "\x95\x58" => "\xEB\xB7\xAE", + "\x95\x59" => "\xEB\xB7\xAF", + "\x95\x5A" => "\xEB\xB7\xB1", + "\x95\x61" => "\xEB\xB7\xB2", + "\x95\x62" => "\xEB\xB7\xB3", + "\x95\x63" => "\xEB\xB7\xB5", + "\x95\x64" => "\xEB\xB7\xB6", + "\x95\x65" => "\xEB\xB7\xB7", + "\x95\x66" => "\xEB\xB7\xB9", + "\x95\x67" => "\xEB\xB7\xBA", + "\x95\x68" => "\xEB\xB7\xBB", + "\x95\x69" => "\xEB\xB7\xBC", + "\x95\x6A" => "\xEB\xB7\xBD", + "\x95\x6B" => "\xEB\xB7\xBE", + "\x95\x6C" => "\xEB\xB7\xBF", + "\x95\x6D" => "\xEB\xB8\x81", + "\x95\x6E" => "\xEB\xB8\x82", + "\x95\x6F" => "\xEB\xB8\x84", + "\x95\x70" => "\xEB\xB8\x86", + "\x95\x71" => "\xEB\xB8\x87", + "\x95\x72" => "\xEB\xB8\x88", + "\x95\x73" => "\xEB\xB8\x89", + "\x95\x74" => "\xEB\xB8\x8A", + "\x95\x75" => "\xEB\xB8\x8B", + "\x95\x76" => "\xEB\xB8\x8E", + "\x95\x77" => "\xEB\xB8\x8F", + "\x95\x78" => "\xEB\xB8\x91", + "\x95\x79" => "\xEB\xB8\x92", + "\x95\x7A" => "\xEB\xB8\x93", + "\x95\x81" => "\xEB\xB8\x95", + "\x95\x82" => "\xEB\xB8\x96", + "\x95\x83" => "\xEB\xB8\x97", + "\x95\x84" => "\xEB\xB8\x98", + "\x95\x85" => "\xEB\xB8\x99", + "\x95\x86" => "\xEB\xB8\x9A", + "\x95\x87" => "\xEB\xB8\x9B", + "\x95\x88" => "\xEB\xB8\x9E", + "\x95\x89" => "\xEB\xB8\xA0", + "\x95\x8A" => "\xEB\xB8\xA1", + "\x95\x8B" => "\xEB\xB8\xA2", + "\x95\x8C" => "\xEB\xB8\xA3", + "\x95\x8D" => "\xEB\xB8\xA4", + "\x95\x8E" => "\xEB\xB8\xA5", + "\x95\x8F" => "\xEB\xB8\xA6", + "\x95\x90" => "\xEB\xB8\xA7", + "\x95\x91" => "\xEB\xB8\xA8", + "\x95\x92" => "\xEB\xB8\xA9", + "\x95\x93" => "\xEB\xB8\xAA", + "\x95\x94" => "\xEB\xB8\xAB", + "\x95\x95" => "\xEB\xB8\xAC", + "\x95\x96" => "\xEB\xB8\xAD", + "\x95\x97" => "\xEB\xB8\xAE", + "\x95\x98" => "\xEB\xB8\xAF", + "\x95\x99" => "\xEB\xB8\xB0", + "\x95\x9A" => "\xEB\xB8\xB1", + "\x95\x9B" => "\xEB\xB8\xB2", + "\x95\x9C" => "\xEB\xB8\xB3", + "\x95\x9D" => "\xEB\xB8\xB4", + "\x95\x9E" => "\xEB\xB8\xB5", + "\x95\x9F" => "\xEB\xB8\xB6", + "\x95\xA0" => "\xEB\xB8\xB7", + "\x95\xA1" => "\xEB\xB8\xB8", + "\x95\xA2" => "\xEB\xB8\xB9", + "\x95\xA3" => "\xEB\xB8\xBA", + "\x95\xA4" => "\xEB\xB8\xBB", + "\x95\xA5" => "\xEB\xB8\xBC", + "\x95\xA6" => "\xEB\xB8\xBD", + "\x95\xA7" => "\xEB\xB8\xBE", + "\x95\xA8" => "\xEB\xB8\xBF", + "\x95\xA9" => "\xEB\xB9\x80", + "\x95\xAA" => "\xEB\xB9\x81", + "\x95\xAB" => "\xEB\xB9\x82", + "\x95\xAC" => "\xEB\xB9\x83", + "\x95\xAD" => "\xEB\xB9\x86", + "\x95\xAE" => "\xEB\xB9\x87", + "\x95\xAF" => "\xEB\xB9\x89", + "\x95\xB0" => "\xEB\xB9\x8A", + "\x95\xB1" => "\xEB\xB9\x8B", + "\x95\xB2" => "\xEB\xB9\x8D", + "\x95\xB3" => "\xEB\xB9\x8F", + "\x95\xB4" => "\xEB\xB9\x90", + "\x95\xB5" => "\xEB\xB9\x91", + "\x95\xB6" => "\xEB\xB9\x92", + "\x95\xB7" => "\xEB\xB9\x93", + "\x95\xB8" => "\xEB\xB9\x96", + "\x95\xB9" => "\xEB\xB9\x98", + "\x95\xBA" => "\xEB\xB9\x9C", + "\x95\xBB" => "\xEB\xB9\x9D", + "\x95\xBC" => "\xEB\xB9\x9E", + "\x95\xBD" => "\xEB\xB9\x9F", + "\x95\xBE" => "\xEB\xB9\xA2", + "\x95\xBF" => "\xEB\xB9\xA3", + "\x95\xC0" => "\xEB\xB9\xA5", + "\x95\xC1" => "\xEB\xB9\xA6", + "\x95\xC2" => "\xEB\xB9\xA7", + "\x95\xC3" => "\xEB\xB9\xA9", + "\x95\xC4" => "\xEB\xB9\xAB", + "\x95\xC5" => "\xEB\xB9\xAC", + "\x95\xC6" => "\xEB\xB9\xAD", + "\x95\xC7" => "\xEB\xB9\xAE", + "\x95\xC8" => "\xEB\xB9\xAF", + "\x95\xC9" => "\xEB\xB9\xB2", + "\x95\xCA" => "\xEB\xB9\xB6", + "\x95\xCB" => "\xEB\xB9\xB7", + "\x95\xCC" => "\xEB\xB9\xB8", + "\x95\xCD" => "\xEB\xB9\xB9", + "\x95\xCE" => "\xEB\xB9\xBA", + "\x95\xCF" => "\xEB\xB9\xBE", + "\x95\xD0" => "\xEB\xB9\xBF", + "\x95\xD1" => "\xEB\xBA\x81", + "\x95\xD2" => "\xEB\xBA\x82", + "\x95\xD3" => "\xEB\xBA\x83", + "\x95\xD4" => "\xEB\xBA\x85", + "\x95\xD5" => "\xEB\xBA\x86", + "\x95\xD6" => "\xEB\xBA\x87", + "\x95\xD7" => "\xEB\xBA\x88", + "\x95\xD8" => "\xEB\xBA\x89", + "\x95\xD9" => "\xEB\xBA\x8A", + "\x95\xDA" => "\xEB\xBA\x8B", + "\x95\xDB" => "\xEB\xBA\x8E", + "\x95\xDC" => "\xEB\xBA\x92", + "\x95\xDD" => "\xEB\xBA\x93", + "\x95\xDE" => "\xEB\xBA\x94", + "\x95\xDF" => "\xEB\xBA\x95", + "\x95\xE0" => "\xEB\xBA\x96", + "\x95\xE1" => "\xEB\xBA\x97", + "\x95\xE2" => "\xEB\xBA\x9A", + "\x95\xE3" => "\xEB\xBA\x9B", + "\x95\xE4" => "\xEB\xBA\x9C", + "\x95\xE5" => "\xEB\xBA\x9D", + "\x95\xE6" => "\xEB\xBA\x9E", + "\x95\xE7" => "\xEB\xBA\x9F", + "\x95\xE8" => "\xEB\xBA\xA0", + "\x95\xE9" => "\xEB\xBA\xA1", + "\x95\xEA" => "\xEB\xBA\xA2", + "\x95\xEB" => "\xEB\xBA\xA3", + "\x95\xEC" => "\xEB\xBA\xA4", + "\x95\xED" => "\xEB\xBA\xA5", + "\x95\xEE" => "\xEB\xBA\xA6", + "\x95\xEF" => "\xEB\xBA\xA7", + "\x95\xF0" => "\xEB\xBA\xA9", + "\x95\xF1" => "\xEB\xBA\xAA", + "\x95\xF2" => "\xEB\xBA\xAB", + "\x95\xF3" => "\xEB\xBA\xAC", + "\x95\xF4" => "\xEB\xBA\xAD", + "\x95\xF5" => "\xEB\xBA\xAE", + "\x95\xF6" => "\xEB\xBA\xAF", + "\x95\xF7" => "\xEB\xBA\xB0", + "\x95\xF8" => "\xEB\xBA\xB1", + "\x95\xF9" => "\xEB\xBA\xB2", + "\x95\xFA" => "\xEB\xBA\xB3", + "\x95\xFB" => "\xEB\xBA\xB4", + "\x95\xFC" => "\xEB\xBA\xB5", + "\x95\xFD" => "\xEB\xBA\xB6", + "\x95\xFE" => "\xEB\xBA\xB7", + "\x96\x41" => "\xEB\xBA\xB8", + "\x96\x42" => "\xEB\xBA\xB9", + "\x96\x43" => "\xEB\xBA\xBA", + "\x96\x44" => "\xEB\xBA\xBB", + "\x96\x45" => "\xEB\xBA\xBC", + "\x96\x46" => "\xEB\xBA\xBD", + "\x96\x47" => "\xEB\xBA\xBE", + "\x96\x48" => "\xEB\xBA\xBF", + "\x96\x49" => "\xEB\xBB\x80", + "\x96\x4A" => "\xEB\xBB\x81", + "\x96\x4B" => "\xEB\xBB\x82", + "\x96\x4C" => "\xEB\xBB\x83", + "\x96\x4D" => "\xEB\xBB\x84", + "\x96\x4E" => "\xEB\xBB\x85", + "\x96\x4F" => "\xEB\xBB\x86", + "\x96\x50" => "\xEB\xBB\x87", + "\x96\x51" => "\xEB\xBB\x88", + "\x96\x52" => "\xEB\xBB\x89", + "\x96\x53" => "\xEB\xBB\x8A", + "\x96\x54" => "\xEB\xBB\x8B", + "\x96\x55" => "\xEB\xBB\x8C", + "\x96\x56" => "\xEB\xBB\x8D", + "\x96\x57" => "\xEB\xBB\x8E", + "\x96\x58" => "\xEB\xBB\x8F", + "\x96\x59" => "\xEB\xBB\x92", + "\x96\x5A" => "\xEB\xBB\x93", + "\x96\x61" => "\xEB\xBB\x95", + "\x96\x62" => "\xEB\xBB\x96", + "\x96\x63" => "\xEB\xBB\x99", + "\x96\x64" => "\xEB\xBB\x9A", + "\x96\x65" => "\xEB\xBB\x9B", + "\x96\x66" => "\xEB\xBB\x9C", + "\x96\x67" => "\xEB\xBB\x9D", + "\x96\x68" => "\xEB\xBB\x9E", + "\x96\x69" => "\xEB\xBB\x9F", + "\x96\x6A" => "\xEB\xBB\xA1", + "\x96\x6B" => "\xEB\xBB\xA2", + "\x96\x6C" => "\xEB\xBB\xA6", + "\x96\x6D" => "\xEB\xBB\xA7", + "\x96\x6E" => "\xEB\xBB\xA8", + "\x96\x6F" => "\xEB\xBB\xA9", + "\x96\x70" => "\xEB\xBB\xAA", + "\x96\x71" => "\xEB\xBB\xAB", + "\x96\x72" => "\xEB\xBB\xAD", + "\x96\x73" => "\xEB\xBB\xAE", + "\x96\x74" => "\xEB\xBB\xAF", + "\x96\x75" => "\xEB\xBB\xB0", + "\x96\x76" => "\xEB\xBB\xB1", + "\x96\x77" => "\xEB\xBB\xB2", + "\x96\x78" => "\xEB\xBB\xB3", + "\x96\x79" => "\xEB\xBB\xB4", + "\x96\x7A" => "\xEB\xBB\xB5", + "\x96\x81" => "\xEB\xBB\xB6", + "\x96\x82" => "\xEB\xBB\xB7", + "\x96\x83" => "\xEB\xBB\xB8", + "\x96\x84" => "\xEB\xBB\xB9", + "\x96\x85" => "\xEB\xBB\xBA", + "\x96\x86" => "\xEB\xBB\xBB", + "\x96\x87" => "\xEB\xBB\xBC", + "\x96\x88" => "\xEB\xBB\xBD", + "\x96\x89" => "\xEB\xBB\xBE", + "\x96\x8A" => "\xEB\xBB\xBF", + "\x96\x8B" => "\xEB\xBC\x80", + "\x96\x8C" => "\xEB\xBC\x82", + "\x96\x8D" => "\xEB\xBC\x83", + "\x96\x8E" => "\xEB\xBC\x84", + "\x96\x8F" => "\xEB\xBC\x85", + "\x96\x90" => "\xEB\xBC\x86", + "\x96\x91" => "\xEB\xBC\x87", + "\x96\x92" => "\xEB\xBC\x8A", + "\x96\x93" => "\xEB\xBC\x8B", + "\x96\x94" => "\xEB\xBC\x8C", + "\x96\x95" => "\xEB\xBC\x8D", + "\x96\x96" => "\xEB\xBC\x8E", + "\x96\x97" => "\xEB\xBC\x8F", + "\x96\x98" => "\xEB\xBC\x90", + "\x96\x99" => "\xEB\xBC\x91", + "\x96\x9A" => "\xEB\xBC\x92", + "\x96\x9B" => "\xEB\xBC\x93", + "\x96\x9C" => "\xEB\xBC\x94", + "\x96\x9D" => "\xEB\xBC\x95", + "\x96\x9E" => "\xEB\xBC\x96", + "\x96\x9F" => "\xEB\xBC\x97", + "\x96\xA0" => "\xEB\xBC\x9A", + "\x96\xA1" => "\xEB\xBC\x9E", + "\x96\xA2" => "\xEB\xBC\x9F", + "\x96\xA3" => "\xEB\xBC\xA0", + "\x96\xA4" => "\xEB\xBC\xA1", + "\x96\xA5" => "\xEB\xBC\xA2", + "\x96\xA6" => "\xEB\xBC\xA3", + "\x96\xA7" => "\xEB\xBC\xA4", + "\x96\xA8" => "\xEB\xBC\xA5", + "\x96\xA9" => "\xEB\xBC\xA6", + "\x96\xAA" => "\xEB\xBC\xA7", + "\x96\xAB" => "\xEB\xBC\xA8", + "\x96\xAC" => "\xEB\xBC\xA9", + "\x96\xAD" => "\xEB\xBC\xAA", + "\x96\xAE" => "\xEB\xBC\xAB", + "\x96\xAF" => "\xEB\xBC\xAC", + "\x96\xB0" => "\xEB\xBC\xAD", + "\x96\xB1" => "\xEB\xBC\xAE", + "\x96\xB2" => "\xEB\xBC\xAF", + "\x96\xB3" => "\xEB\xBC\xB0", + "\x96\xB4" => "\xEB\xBC\xB1", + "\x96\xB5" => "\xEB\xBC\xB2", + "\x96\xB6" => "\xEB\xBC\xB3", + "\x96\xB7" => "\xEB\xBC\xB4", + "\x96\xB8" => "\xEB\xBC\xB5", + "\x96\xB9" => "\xEB\xBC\xB6", + "\x96\xBA" => "\xEB\xBC\xB7", + "\x96\xBB" => "\xEB\xBC\xB8", + "\x96\xBC" => "\xEB\xBC\xB9", + "\x96\xBD" => "\xEB\xBC\xBA", + "\x96\xBE" => "\xEB\xBC\xBB", + "\x96\xBF" => "\xEB\xBC\xBC", + "\x96\xC0" => "\xEB\xBC\xBD", + "\x96\xC1" => "\xEB\xBC\xBE", + "\x96\xC2" => "\xEB\xBC\xBF", + "\x96\xC3" => "\xEB\xBD\x82", + "\x96\xC4" => "\xEB\xBD\x83", + "\x96\xC5" => "\xEB\xBD\x85", + "\x96\xC6" => "\xEB\xBD\x86", + "\x96\xC7" => "\xEB\xBD\x87", + "\x96\xC8" => "\xEB\xBD\x89", + "\x96\xC9" => "\xEB\xBD\x8A", + "\x96\xCA" => "\xEB\xBD\x8B", + "\x96\xCB" => "\xEB\xBD\x8C", + "\x96\xCC" => "\xEB\xBD\x8D", + "\x96\xCD" => "\xEB\xBD\x8E", + "\x96\xCE" => "\xEB\xBD\x8F", + "\x96\xCF" => "\xEB\xBD\x92", + "\x96\xD0" => "\xEB\xBD\x93", + "\x96\xD1" => "\xEB\xBD\x94", + "\x96\xD2" => "\xEB\xBD\x96", + "\x96\xD3" => "\xEB\xBD\x97", + "\x96\xD4" => "\xEB\xBD\x98", + "\x96\xD5" => "\xEB\xBD\x99", + "\x96\xD6" => "\xEB\xBD\x9A", + "\x96\xD7" => "\xEB\xBD\x9B", + "\x96\xD8" => "\xEB\xBD\x9C", + "\x96\xD9" => "\xEB\xBD\x9D", + "\x96\xDA" => "\xEB\xBD\x9E", + "\x96\xDB" => "\xEB\xBD\x9F", + "\x96\xDC" => "\xEB\xBD\xA0", + "\x96\xDD" => "\xEB\xBD\xA1", + "\x96\xDE" => "\xEB\xBD\xA2", + "\x96\xDF" => "\xEB\xBD\xA3", + "\x96\xE0" => "\xEB\xBD\xA4", + "\x96\xE1" => "\xEB\xBD\xA5", + "\x96\xE2" => "\xEB\xBD\xA6", + "\x96\xE3" => "\xEB\xBD\xA7", + "\x96\xE4" => "\xEB\xBD\xA8", + "\x96\xE5" => "\xEB\xBD\xA9", + "\x96\xE6" => "\xEB\xBD\xAA", + "\x96\xE7" => "\xEB\xBD\xAB", + "\x96\xE8" => "\xEB\xBD\xAC", + "\x96\xE9" => "\xEB\xBD\xAD", + "\x96\xEA" => "\xEB\xBD\xAE", + "\x96\xEB" => "\xEB\xBD\xAF", + "\x96\xEC" => "\xEB\xBD\xB0", + "\x96\xED" => "\xEB\xBD\xB1", + "\x96\xEE" => "\xEB\xBD\xB2", + "\x96\xEF" => "\xEB\xBD\xB3", + "\x96\xF0" => "\xEB\xBD\xB4", + "\x96\xF1" => "\xEB\xBD\xB5", + "\x96\xF2" => "\xEB\xBD\xB6", + "\x96\xF3" => "\xEB\xBD\xB7", + "\x96\xF4" => "\xEB\xBD\xB8", + "\x96\xF5" => "\xEB\xBD\xB9", + "\x96\xF6" => "\xEB\xBD\xBA", + "\x96\xF7" => "\xEB\xBD\xBB", + "\x96\xF8" => "\xEB\xBD\xBC", + "\x96\xF9" => "\xEB\xBD\xBD", + "\x96\xFA" => "\xEB\xBD\xBE", + "\x96\xFB" => "\xEB\xBD\xBF", + "\x96\xFC" => "\xEB\xBE\x80", + "\x96\xFD" => "\xEB\xBE\x81", + "\x96\xFE" => "\xEB\xBE\x82", + "\x97\x41" => "\xEB\xBE\x83", + "\x97\x42" => "\xEB\xBE\x84", + "\x97\x43" => "\xEB\xBE\x85", + "\x97\x44" => "\xEB\xBE\x86", + "\x97\x45" => "\xEB\xBE\x87", + "\x97\x46" => "\xEB\xBE\x88", + "\x97\x47" => "\xEB\xBE\x89", + "\x97\x48" => "\xEB\xBE\x8A", + "\x97\x49" => "\xEB\xBE\x8B", + "\x97\x4A" => "\xEB\xBE\x8C", + "\x97\x4B" => "\xEB\xBE\x8D", + "\x97\x4C" => "\xEB\xBE\x8E", + "\x97\x4D" => "\xEB\xBE\x8F", + "\x97\x4E" => "\xEB\xBE\x90", + "\x97\x4F" => "\xEB\xBE\x91", + "\x97\x50" => "\xEB\xBE\x92", + "\x97\x51" => "\xEB\xBE\x93", + "\x97\x52" => "\xEB\xBE\x95", + "\x97\x53" => "\xEB\xBE\x96", + "\x97\x54" => "\xEB\xBE\x97", + "\x97\x55" => "\xEB\xBE\x98", + "\x97\x56" => "\xEB\xBE\x99", + "\x97\x57" => "\xEB\xBE\x9A", + "\x97\x58" => "\xEB\xBE\x9B", + "\x97\x59" => "\xEB\xBE\x9C", + "\x97\x5A" => "\xEB\xBE\x9D", + "\x97\x61" => "\xEB\xBE\x9E", + "\x97\x62" => "\xEB\xBE\x9F", + "\x97\x63" => "\xEB\xBE\xA0", + "\x97\x64" => "\xEB\xBE\xA1", + "\x97\x65" => "\xEB\xBE\xA2", + "\x97\x66" => "\xEB\xBE\xA3", + "\x97\x67" => "\xEB\xBE\xA4", + "\x97\x68" => "\xEB\xBE\xA5", + "\x97\x69" => "\xEB\xBE\xA6", + "\x97\x6A" => "\xEB\xBE\xA7", + "\x97\x6B" => "\xEB\xBE\xA8", + "\x97\x6C" => "\xEB\xBE\xA9", + "\x97\x6D" => "\xEB\xBE\xAA", + "\x97\x6E" => "\xEB\xBE\xAB", + "\x97\x6F" => "\xEB\xBE\xAC", + "\x97\x70" => "\xEB\xBE\xAD", + "\x97\x71" => "\xEB\xBE\xAE", + "\x97\x72" => "\xEB\xBE\xAF", + "\x97\x73" => "\xEB\xBE\xB1", + "\x97\x74" => "\xEB\xBE\xB2", + "\x97\x75" => "\xEB\xBE\xB3", + "\x97\x76" => "\xEB\xBE\xB4", + "\x97\x77" => "\xEB\xBE\xB5", + "\x97\x78" => "\xEB\xBE\xB6", + "\x97\x79" => "\xEB\xBE\xB7", + "\x97\x7A" => "\xEB\xBE\xB8", + "\x97\x81" => "\xEB\xBE\xB9", + "\x97\x82" => "\xEB\xBE\xBA", + "\x97\x83" => "\xEB\xBE\xBB", + "\x97\x84" => "\xEB\xBE\xBC", + "\x97\x85" => "\xEB\xBE\xBD", + "\x97\x86" => "\xEB\xBE\xBE", + "\x97\x87" => "\xEB\xBE\xBF", + "\x97\x88" => "\xEB\xBF\x80", + "\x97\x89" => "\xEB\xBF\x81", + "\x97\x8A" => "\xEB\xBF\x82", + "\x97\x8B" => "\xEB\xBF\x83", + "\x97\x8C" => "\xEB\xBF\x84", + "\x97\x8D" => "\xEB\xBF\x86", + "\x97\x8E" => "\xEB\xBF\x87", + "\x97\x8F" => "\xEB\xBF\x88", + "\x97\x90" => "\xEB\xBF\x89", + "\x97\x91" => "\xEB\xBF\x8A", + "\x97\x92" => "\xEB\xBF\x8B", + "\x97\x93" => "\xEB\xBF\x8E", + "\x97\x94" => "\xEB\xBF\x8F", + "\x97\x95" => "\xEB\xBF\x91", + "\x97\x96" => "\xEB\xBF\x92", + "\x97\x97" => "\xEB\xBF\x93", + "\x97\x98" => "\xEB\xBF\x95", + "\x97\x99" => "\xEB\xBF\x96", + "\x97\x9A" => "\xEB\xBF\x97", + "\x97\x9B" => "\xEB\xBF\x98", + "\x97\x9C" => "\xEB\xBF\x99", + "\x97\x9D" => "\xEB\xBF\x9A", + "\x97\x9E" => "\xEB\xBF\x9B", + "\x97\x9F" => "\xEB\xBF\x9D", + "\x97\xA0" => "\xEB\xBF\x9E", + "\x97\xA1" => "\xEB\xBF\xA0", + "\x97\xA2" => "\xEB\xBF\xA2", + "\x97\xA3" => "\xEB\xBF\xA3", + "\x97\xA4" => "\xEB\xBF\xA4", + "\x97\xA5" => "\xEB\xBF\xA5", + "\x97\xA6" => "\xEB\xBF\xA6", + "\x97\xA7" => "\xEB\xBF\xA7", + "\x97\xA8" => "\xEB\xBF\xA8", + "\x97\xA9" => "\xEB\xBF\xA9", + "\x97\xAA" => "\xEB\xBF\xAA", + "\x97\xAB" => "\xEB\xBF\xAB", + "\x97\xAC" => "\xEB\xBF\xAC", + "\x97\xAD" => "\xEB\xBF\xAD", + "\x97\xAE" => "\xEB\xBF\xAE", + "\x97\xAF" => "\xEB\xBF\xAF", + "\x97\xB0" => "\xEB\xBF\xB0", + "\x97\xB1" => "\xEB\xBF\xB1", + "\x97\xB2" => "\xEB\xBF\xB2", + "\x97\xB3" => "\xEB\xBF\xB3", + "\x97\xB4" => "\xEB\xBF\xB4", + "\x97\xB5" => "\xEB\xBF\xB5", + "\x97\xB6" => "\xEB\xBF\xB6", + "\x97\xB7" => "\xEB\xBF\xB7", + "\x97\xB8" => "\xEB\xBF\xB8", + "\x97\xB9" => "\xEB\xBF\xB9", + "\x97\xBA" => "\xEB\xBF\xBA", + "\x97\xBB" => "\xEB\xBF\xBB", + "\x97\xBC" => "\xEB\xBF\xBC", + "\x97\xBD" => "\xEB\xBF\xBD", + "\x97\xBE" => "\xEB\xBF\xBE", + "\x97\xBF" => "\xEB\xBF\xBF", + "\x97\xC0" => "\xEC\x80\x80", + "\x97\xC1" => "\xEC\x80\x81", + "\x97\xC2" => "\xEC\x80\x82", + "\x97\xC3" => "\xEC\x80\x83", + "\x97\xC4" => "\xEC\x80\x84", + "\x97\xC5" => "\xEC\x80\x85", + "\x97\xC6" => "\xEC\x80\x86", + "\x97\xC7" => "\xEC\x80\x87", + "\x97\xC8" => "\xEC\x80\x88", + "\x97\xC9" => "\xEC\x80\x89", + "\x97\xCA" => "\xEC\x80\x8A", + "\x97\xCB" => "\xEC\x80\x8B", + "\x97\xCC" => "\xEC\x80\x8C", + "\x97\xCD" => "\xEC\x80\x8D", + "\x97\xCE" => "\xEC\x80\x8E", + "\x97\xCF" => "\xEC\x80\x8F", + "\x97\xD0" => "\xEC\x80\x90", + "\x97\xD1" => "\xEC\x80\x91", + "\x97\xD2" => "\xEC\x80\x92", + "\x97\xD3" => "\xEC\x80\x93", + "\x97\xD4" => "\xEC\x80\x94", + "\x97\xD5" => "\xEC\x80\x95", + "\x97\xD6" => "\xEC\x80\x96", + "\x97\xD7" => "\xEC\x80\x97", + "\x97\xD8" => "\xEC\x80\x98", + "\x97\xD9" => "\xEC\x80\x99", + "\x97\xDA" => "\xEC\x80\x9A", + "\x97\xDB" => "\xEC\x80\x9B", + "\x97\xDC" => "\xEC\x80\x9C", + "\x97\xDD" => "\xEC\x80\x9D", + "\x97\xDE" => "\xEC\x80\x9E", + "\x97\xDF" => "\xEC\x80\x9F", + "\x97\xE0" => "\xEC\x80\xA0", + "\x97\xE1" => "\xEC\x80\xA1", + "\x97\xE2" => "\xEC\x80\xA2", + "\x97\xE3" => "\xEC\x80\xA3", + "\x97\xE4" => "\xEC\x80\xA4", + "\x97\xE5" => "\xEC\x80\xA5", + "\x97\xE6" => "\xEC\x80\xA6", + "\x97\xE7" => "\xEC\x80\xA7", + "\x97\xE8" => "\xEC\x80\xA8", + "\x97\xE9" => "\xEC\x80\xA9", + "\x97\xEA" => "\xEC\x80\xAA", + "\x97\xEB" => "\xEC\x80\xAB", + "\x97\xEC" => "\xEC\x80\xAC", + "\x97\xED" => "\xEC\x80\xAD", + "\x97\xEE" => "\xEC\x80\xAE", + "\x97\xEF" => "\xEC\x80\xAF", + "\x97\xF0" => "\xEC\x80\xB0", + "\x97\xF1" => "\xEC\x80\xB1", + "\x97\xF2" => "\xEC\x80\xB2", + "\x97\xF3" => "\xEC\x80\xB3", + "\x97\xF4" => "\xEC\x80\xB4", + "\x97\xF5" => "\xEC\x80\xB5", + "\x97\xF6" => "\xEC\x80\xB6", + "\x97\xF7" => "\xEC\x80\xB7", + "\x97\xF8" => "\xEC\x80\xB8", + "\x97\xF9" => "\xEC\x80\xB9", + "\x97\xFA" => "\xEC\x80\xBA", + "\x97\xFB" => "\xEC\x80\xBB", + "\x97\xFC" => "\xEC\x80\xBD", + "\x97\xFD" => "\xEC\x80\xBE", + "\x97\xFE" => "\xEC\x80\xBF", + "\x98\x41" => "\xEC\x81\x80", + "\x98\x42" => "\xEC\x81\x81", + "\x98\x43" => "\xEC\x81\x82", + "\x98\x44" => "\xEC\x81\x83", + "\x98\x45" => "\xEC\x81\x84", + "\x98\x46" => "\xEC\x81\x85", + "\x98\x47" => "\xEC\x81\x86", + "\x98\x48" => "\xEC\x81\x87", + "\x98\x49" => "\xEC\x81\x88", + "\x98\x4A" => "\xEC\x81\x89", + "\x98\x4B" => "\xEC\x81\x8A", + "\x98\x4C" => "\xEC\x81\x8B", + "\x98\x4D" => "\xEC\x81\x8C", + "\x98\x4E" => "\xEC\x81\x8D", + "\x98\x4F" => "\xEC\x81\x8E", + "\x98\x50" => "\xEC\x81\x8F", + "\x98\x51" => "\xEC\x81\x90", + "\x98\x52" => "\xEC\x81\x92", + "\x98\x53" => "\xEC\x81\x93", + "\x98\x54" => "\xEC\x81\x94", + "\x98\x55" => "\xEC\x81\x95", + "\x98\x56" => "\xEC\x81\x96", + "\x98\x57" => "\xEC\x81\x97", + "\x98\x58" => "\xEC\x81\x99", + "\x98\x59" => "\xEC\x81\x9A", + "\x98\x5A" => "\xEC\x81\x9B", + "\x98\x61" => "\xEC\x81\x9D", + "\x98\x62" => "\xEC\x81\x9E", + "\x98\x63" => "\xEC\x81\x9F", + "\x98\x64" => "\xEC\x81\xA1", + "\x98\x65" => "\xEC\x81\xA2", + "\x98\x66" => "\xEC\x81\xA3", + "\x98\x67" => "\xEC\x81\xA4", + "\x98\x68" => "\xEC\x81\xA5", + "\x98\x69" => "\xEC\x81\xA6", + "\x98\x6A" => "\xEC\x81\xA7", + "\x98\x6B" => "\xEC\x81\xAA", + "\x98\x6C" => "\xEC\x81\xAB", + "\x98\x6D" => "\xEC\x81\xAC", + "\x98\x6E" => "\xEC\x81\xAD", + "\x98\x6F" => "\xEC\x81\xAE", + "\x98\x70" => "\xEC\x81\xAF", + "\x98\x71" => "\xEC\x81\xB0", + "\x98\x72" => "\xEC\x81\xB1", + "\x98\x73" => "\xEC\x81\xB2", + "\x98\x74" => "\xEC\x81\xB3", + "\x98\x75" => "\xEC\x81\xB4", + "\x98\x76" => "\xEC\x81\xB5", + "\x98\x77" => "\xEC\x81\xB6", + "\x98\x78" => "\xEC\x81\xB7", + "\x98\x79" => "\xEC\x81\xB8", + "\x98\x7A" => "\xEC\x81\xB9", + "\x98\x81" => "\xEC\x81\xBA", + "\x98\x82" => "\xEC\x81\xBB", + "\x98\x83" => "\xEC\x81\xBC", + "\x98\x84" => "\xEC\x81\xBD", + "\x98\x85" => "\xEC\x81\xBE", + "\x98\x86" => "\xEC\x81\xBF", + "\x98\x87" => "\xEC\x82\x80", + "\x98\x88" => "\xEC\x82\x81", + "\x98\x89" => "\xEC\x82\x82", + "\x98\x8A" => "\xEC\x82\x83", + "\x98\x8B" => "\xEC\x82\x84", + "\x98\x8C" => "\xEC\x82\x85", + "\x98\x8D" => "\xEC\x82\x86", + "\x98\x8E" => "\xEC\x82\x87", + "\x98\x8F" => "\xEC\x82\x88", + "\x98\x90" => "\xEC\x82\x89", + "\x98\x91" => "\xEC\x82\x8A", + "\x98\x92" => "\xEC\x82\x8B", + "\x98\x93" => "\xEC\x82\x8C", + "\x98\x94" => "\xEC\x82\x8D", + "\x98\x95" => "\xEC\x82\x8E", + "\x98\x96" => "\xEC\x82\x8F", + "\x98\x97" => "\xEC\x82\x92", + "\x98\x98" => "\xEC\x82\x93", + "\x98\x99" => "\xEC\x82\x95", + "\x98\x9A" => "\xEC\x82\x96", + "\x98\x9B" => "\xEC\x82\x97", + "\x98\x9C" => "\xEC\x82\x99", + "\x98\x9D" => "\xEC\x82\x9A", + "\x98\x9E" => "\xEC\x82\x9B", + "\x98\x9F" => "\xEC\x82\x9C", + "\x98\xA0" => "\xEC\x82\x9D", + "\x98\xA1" => "\xEC\x82\x9E", + "\x98\xA2" => "\xEC\x82\x9F", + "\x98\xA3" => "\xEC\x82\xA2", + "\x98\xA4" => "\xEC\x82\xA4", + "\x98\xA5" => "\xEC\x82\xA6", + "\x98\xA6" => "\xEC\x82\xA7", + "\x98\xA7" => "\xEC\x82\xA8", + "\x98\xA8" => "\xEC\x82\xA9", + "\x98\xA9" => "\xEC\x82\xAA", + "\x98\xAA" => "\xEC\x82\xAB", + "\x98\xAB" => "\xEC\x82\xAE", + "\x98\xAC" => "\xEC\x82\xB1", + "\x98\xAD" => "\xEC\x82\xB2", + "\x98\xAE" => "\xEC\x82\xB7", + "\x98\xAF" => "\xEC\x82\xB8", + "\x98\xB0" => "\xEC\x82\xB9", + "\x98\xB1" => "\xEC\x82\xBA", + "\x98\xB2" => "\xEC\x82\xBB", + "\x98\xB3" => "\xEC\x82\xBE", + "\x98\xB4" => "\xEC\x83\x82", + "\x98\xB5" => "\xEC\x83\x83", + "\x98\xB6" => "\xEC\x83\x84", + "\x98\xB7" => "\xEC\x83\x86", + "\x98\xB8" => "\xEC\x83\x87", + "\x98\xB9" => "\xEC\x83\x8A", + "\x98\xBA" => "\xEC\x83\x8B", + "\x98\xBB" => "\xEC\x83\x8D", + "\x98\xBC" => "\xEC\x83\x8E", + "\x98\xBD" => "\xEC\x83\x8F", + "\x98\xBE" => "\xEC\x83\x91", + "\x98\xBF" => "\xEC\x83\x92", + "\x98\xC0" => "\xEC\x83\x93", + "\x98\xC1" => "\xEC\x83\x94", + "\x98\xC2" => "\xEC\x83\x95", + "\x98\xC3" => "\xEC\x83\x96", + "\x98\xC4" => "\xEC\x83\x97", + "\x98\xC5" => "\xEC\x83\x9A", + "\x98\xC6" => "\xEC\x83\x9E", + "\x98\xC7" => "\xEC\x83\x9F", + "\x98\xC8" => "\xEC\x83\xA0", + "\x98\xC9" => "\xEC\x83\xA1", + "\x98\xCA" => "\xEC\x83\xA2", + "\x98\xCB" => "\xEC\x83\xA3", + "\x98\xCC" => "\xEC\x83\xA6", + "\x98\xCD" => "\xEC\x83\xA7", + "\x98\xCE" => "\xEC\x83\xA9", + "\x98\xCF" => "\xEC\x83\xAA", + "\x98\xD0" => "\xEC\x83\xAB", + "\x98\xD1" => "\xEC\x83\xAD", + "\x98\xD2" => "\xEC\x83\xAE", + "\x98\xD3" => "\xEC\x83\xAF", + "\x98\xD4" => "\xEC\x83\xB0", + "\x98\xD5" => "\xEC\x83\xB1", + "\x98\xD6" => "\xEC\x83\xB2", + "\x98\xD7" => "\xEC\x83\xB3", + "\x98\xD8" => "\xEC\x83\xB6", + "\x98\xD9" => "\xEC\x83\xB8", + "\x98\xDA" => "\xEC\x83\xBA", + "\x98\xDB" => "\xEC\x83\xBB", + "\x98\xDC" => "\xEC\x83\xBC", + "\x98\xDD" => "\xEC\x83\xBD", + "\x98\xDE" => "\xEC\x83\xBE", + "\x98\xDF" => "\xEC\x83\xBF", + "\x98\xE0" => "\xEC\x84\x81", + "\x98\xE1" => "\xEC\x84\x82", + "\x98\xE2" => "\xEC\x84\x83", + "\x98\xE3" => "\xEC\x84\x85", + "\x98\xE4" => "\xEC\x84\x86", + "\x98\xE5" => "\xEC\x84\x87", + "\x98\xE6" => "\xEC\x84\x89", + "\x98\xE7" => "\xEC\x84\x8A", + "\x98\xE8" => "\xEC\x84\x8B", + "\x98\xE9" => "\xEC\x84\x8C", + "\x98\xEA" => "\xEC\x84\x8D", + "\x98\xEB" => "\xEC\x84\x8E", + "\x98\xEC" => "\xEC\x84\x8F", + "\x98\xED" => "\xEC\x84\x91", + "\x98\xEE" => "\xEC\x84\x92", + "\x98\xEF" => "\xEC\x84\x93", + "\x98\xF0" => "\xEC\x84\x94", + "\x98\xF1" => "\xEC\x84\x96", + "\x98\xF2" => "\xEC\x84\x97", + "\x98\xF3" => "\xEC\x84\x98", + "\x98\xF4" => "\xEC\x84\x99", + "\x98\xF5" => "\xEC\x84\x9A", + "\x98\xF6" => "\xEC\x84\x9B", + "\x98\xF7" => "\xEC\x84\xA1", + "\x98\xF8" => "\xEC\x84\xA2", + "\x98\xF9" => "\xEC\x84\xA5", + "\x98\xFA" => "\xEC\x84\xA8", + "\x98\xFB" => "\xEC\x84\xA9", + "\x98\xFC" => "\xEC\x84\xAA", + "\x98\xFD" => "\xEC\x84\xAB", + "\x98\xFE" => "\xEC\x84\xAE", + "\x99\x41" => "\xEC\x84\xB2", + "\x99\x42" => "\xEC\x84\xB3", + "\x99\x43" => "\xEC\x84\xB4", + "\x99\x44" => "\xEC\x84\xB5", + "\x99\x45" => "\xEC\x84\xB7", + "\x99\x46" => "\xEC\x84\xBA", + "\x99\x47" => "\xEC\x84\xBB", + "\x99\x48" => "\xEC\x84\xBD", + "\x99\x49" => "\xEC\x84\xBE", + "\x99\x4A" => "\xEC\x84\xBF", + "\x99\x4B" => "\xEC\x85\x81", + "\x99\x4C" => "\xEC\x85\x82", + "\x99\x4D" => "\xEC\x85\x83", + "\x99\x4E" => "\xEC\x85\x84", + "\x99\x4F" => "\xEC\x85\x85", + "\x99\x50" => "\xEC\x85\x86", + "\x99\x51" => "\xEC\x85\x87", + "\x99\x52" => "\xEC\x85\x8A", + "\x99\x53" => "\xEC\x85\x8E", + "\x99\x54" => "\xEC\x85\x8F", + "\x99\x55" => "\xEC\x85\x90", + "\x99\x56" => "\xEC\x85\x91", + "\x99\x57" => "\xEC\x85\x92", + "\x99\x58" => "\xEC\x85\x93", + "\x99\x59" => "\xEC\x85\x96", + "\x99\x5A" => "\xEC\x85\x97", + "\x99\x61" => "\xEC\x85\x99", + "\x99\x62" => "\xEC\x85\x9A", + "\x99\x63" => "\xEC\x85\x9B", + "\x99\x64" => "\xEC\x85\x9D", + "\x99\x65" => "\xEC\x85\x9E", + "\x99\x66" => "\xEC\x85\x9F", + "\x99\x67" => "\xEC\x85\xA0", + "\x99\x68" => "\xEC\x85\xA1", + "\x99\x69" => "\xEC\x85\xA2", + "\x99\x6A" => "\xEC\x85\xA3", + "\x99\x6B" => "\xEC\x85\xA6", + "\x99\x6C" => "\xEC\x85\xAA", + "\x99\x6D" => "\xEC\x85\xAB", + "\x99\x6E" => "\xEC\x85\xAC", + "\x99\x6F" => "\xEC\x85\xAD", + "\x99\x70" => "\xEC\x85\xAE", + "\x99\x71" => "\xEC\x85\xAF", + "\x99\x72" => "\xEC\x85\xB1", + "\x99\x73" => "\xEC\x85\xB2", + "\x99\x74" => "\xEC\x85\xB3", + "\x99\x75" => "\xEC\x85\xB5", + "\x99\x76" => "\xEC\x85\xB6", + "\x99\x77" => "\xEC\x85\xB7", + "\x99\x78" => "\xEC\x85\xB9", + "\x99\x79" => "\xEC\x85\xBA", + "\x99\x7A" => "\xEC\x85\xBB", + "\x99\x81" => "\xEC\x85\xBC", + "\x99\x82" => "\xEC\x85\xBD", + "\x99\x83" => "\xEC\x85\xBE", + "\x99\x84" => "\xEC\x85\xBF", + "\x99\x85" => "\xEC\x86\x80", + "\x99\x86" => "\xEC\x86\x81", + "\x99\x87" => "\xEC\x86\x82", + "\x99\x88" => "\xEC\x86\x83", + "\x99\x89" => "\xEC\x86\x84", + "\x99\x8A" => "\xEC\x86\x86", + "\x99\x8B" => "\xEC\x86\x87", + "\x99\x8C" => "\xEC\x86\x88", + "\x99\x8D" => "\xEC\x86\x89", + "\x99\x8E" => "\xEC\x86\x8A", + "\x99\x8F" => "\xEC\x86\x8B", + "\x99\x90" => "\xEC\x86\x8F", + "\x99\x91" => "\xEC\x86\x91", + "\x99\x92" => "\xEC\x86\x92", + "\x99\x93" => "\xEC\x86\x93", + "\x99\x94" => "\xEC\x86\x95", + "\x99\x95" => "\xEC\x86\x97", + "\x99\x96" => "\xEC\x86\x98", + "\x99\x97" => "\xEC\x86\x99", + "\x99\x98" => "\xEC\x86\x9A", + "\x99\x99" => "\xEC\x86\x9B", + "\x99\x9A" => "\xEC\x86\x9E", + "\x99\x9B" => "\xEC\x86\xA0", + "\x99\x9C" => "\xEC\x86\xA2", + "\x99\x9D" => "\xEC\x86\xA3", + "\x99\x9E" => "\xEC\x86\xA4", + "\x99\x9F" => "\xEC\x86\xA6", + "\x99\xA0" => "\xEC\x86\xA7", + "\x99\xA1" => "\xEC\x86\xAA", + "\x99\xA2" => "\xEC\x86\xAB", + "\x99\xA3" => "\xEC\x86\xAD", + "\x99\xA4" => "\xEC\x86\xAE", + "\x99\xA5" => "\xEC\x86\xAF", + "\x99\xA6" => "\xEC\x86\xB1", + "\x99\xA7" => "\xEC\x86\xB2", + "\x99\xA8" => "\xEC\x86\xB3", + "\x99\xA9" => "\xEC\x86\xB4", + "\x99\xAA" => "\xEC\x86\xB5", + "\x99\xAB" => "\xEC\x86\xB6", + "\x99\xAC" => "\xEC\x86\xB7", + "\x99\xAD" => "\xEC\x86\xB8", + "\x99\xAE" => "\xEC\x86\xB9", + "\x99\xAF" => "\xEC\x86\xBA", + "\x99\xB0" => "\xEC\x86\xBB", + "\x99\xB1" => "\xEC\x86\xBC", + "\x99\xB2" => "\xEC\x86\xBE", + "\x99\xB3" => "\xEC\x86\xBF", + "\x99\xB4" => "\xEC\x87\x80", + "\x99\xB5" => "\xEC\x87\x81", + "\x99\xB6" => "\xEC\x87\x82", + "\x99\xB7" => "\xEC\x87\x83", + "\x99\xB8" => "\xEC\x87\x85", + "\x99\xB9" => "\xEC\x87\x86", + "\x99\xBA" => "\xEC\x87\x87", + "\x99\xBB" => "\xEC\x87\x89", + "\x99\xBC" => "\xEC\x87\x8A", + "\x99\xBD" => "\xEC\x87\x8B", + "\x99\xBE" => "\xEC\x87\x8D", + "\x99\xBF" => "\xEC\x87\x8E", + "\x99\xC0" => "\xEC\x87\x8F", + "\x99\xC1" => "\xEC\x87\x90", + "\x99\xC2" => "\xEC\x87\x91", + "\x99\xC3" => "\xEC\x87\x92", + "\x99\xC4" => "\xEC\x87\x93", + "\x99\xC5" => "\xEC\x87\x95", + "\x99\xC6" => "\xEC\x87\x96", + "\x99\xC7" => "\xEC\x87\x99", + "\x99\xC8" => "\xEC\x87\x9A", + "\x99\xC9" => "\xEC\x87\x9B", + "\x99\xCA" => "\xEC\x87\x9C", + "\x99\xCB" => "\xEC\x87\x9D", + "\x99\xCC" => "\xEC\x87\x9E", + "\x99\xCD" => "\xEC\x87\x9F", + "\x99\xCE" => "\xEC\x87\xA1", + "\x99\xCF" => "\xEC\x87\xA2", + "\x99\xD0" => "\xEC\x87\xA3", + "\x99\xD1" => "\xEC\x87\xA5", + "\x99\xD2" => "\xEC\x87\xA6", + "\x99\xD3" => "\xEC\x87\xA7", + "\x99\xD4" => "\xEC\x87\xA9", + "\x99\xD5" => "\xEC\x87\xAA", + "\x99\xD6" => "\xEC\x87\xAB", + "\x99\xD7" => "\xEC\x87\xAC", + "\x99\xD8" => "\xEC\x87\xAD", + "\x99\xD9" => "\xEC\x87\xAE", + "\x99\xDA" => "\xEC\x87\xAF", + "\x99\xDB" => "\xEC\x87\xB2", + "\x99\xDC" => "\xEC\x87\xB4", + "\x99\xDD" => "\xEC\x87\xB5", + "\x99\xDE" => "\xEC\x87\xB6", + "\x99\xDF" => "\xEC\x87\xB7", + "\x99\xE0" => "\xEC\x87\xB8", + "\x99\xE1" => "\xEC\x87\xB9", + "\x99\xE2" => "\xEC\x87\xBA", + "\x99\xE3" => "\xEC\x87\xBB", + "\x99\xE4" => "\xEC\x87\xBE", + "\x99\xE5" => "\xEC\x87\xBF", + "\x99\xE6" => "\xEC\x88\x81", + "\x99\xE7" => "\xEC\x88\x82", + "\x99\xE8" => "\xEC\x88\x83", + "\x99\xE9" => "\xEC\x88\x85", + "\x99\xEA" => "\xEC\x88\x86", + "\x99\xEB" => "\xEC\x88\x87", + "\x99\xEC" => "\xEC\x88\x88", + "\x99\xED" => "\xEC\x88\x89", + "\x99\xEE" => "\xEC\x88\x8A", + "\x99\xEF" => "\xEC\x88\x8B", + "\x99\xF0" => "\xEC\x88\x8E", + "\x99\xF1" => "\xEC\x88\x90", + "\x99\xF2" => "\xEC\x88\x92", + "\x99\xF3" => "\xEC\x88\x93", + "\x99\xF4" => "\xEC\x88\x94", + "\x99\xF5" => "\xEC\x88\x95", + "\x99\xF6" => "\xEC\x88\x96", + "\x99\xF7" => "\xEC\x88\x97", + "\x99\xF8" => "\xEC\x88\x9A", + "\x99\xF9" => "\xEC\x88\x9B", + "\x99\xFA" => "\xEC\x88\x9D", + "\x99\xFB" => "\xEC\x88\x9E", + "\x99\xFC" => "\xEC\x88\xA1", + "\x99\xFD" => "\xEC\x88\xA2", + "\x99\xFE" => "\xEC\x88\xA3", + "\x9A\x41" => "\xEC\x88\xA4", + "\x9A\x42" => "\xEC\x88\xA5", + "\x9A\x43" => "\xEC\x88\xA6", + "\x9A\x44" => "\xEC\x88\xA7", + "\x9A\x45" => "\xEC\x88\xAA", + "\x9A\x46" => "\xEC\x88\xAC", + "\x9A\x47" => "\xEC\x88\xAE", + "\x9A\x48" => "\xEC\x88\xB0", + "\x9A\x49" => "\xEC\x88\xB3", + "\x9A\x4A" => "\xEC\x88\xB5", + "\x9A\x4B" => "\xEC\x88\xB6", + "\x9A\x4C" => "\xEC\x88\xB7", + "\x9A\x4D" => "\xEC\x88\xB8", + "\x9A\x4E" => "\xEC\x88\xB9", + "\x9A\x4F" => "\xEC\x88\xBA", + "\x9A\x50" => "\xEC\x88\xBB", + "\x9A\x51" => "\xEC\x88\xBC", + "\x9A\x52" => "\xEC\x88\xBD", + "\x9A\x53" => "\xEC\x88\xBE", + "\x9A\x54" => "\xEC\x88\xBF", + "\x9A\x55" => "\xEC\x89\x80", + "\x9A\x56" => "\xEC\x89\x81", + "\x9A\x57" => "\xEC\x89\x82", + "\x9A\x58" => "\xEC\x89\x83", + "\x9A\x59" => "\xEC\x89\x84", + "\x9A\x5A" => "\xEC\x89\x85", + "\x9A\x61" => "\xEC\x89\x86", + "\x9A\x62" => "\xEC\x89\x87", + "\x9A\x63" => "\xEC\x89\x89", + "\x9A\x64" => "\xEC\x89\x8A", + "\x9A\x65" => "\xEC\x89\x8B", + "\x9A\x66" => "\xEC\x89\x8C", + "\x9A\x67" => "\xEC\x89\x8D", + "\x9A\x68" => "\xEC\x89\x8E", + "\x9A\x69" => "\xEC\x89\x8F", + "\x9A\x6A" => "\xEC\x89\x92", + "\x9A\x6B" => "\xEC\x89\x93", + "\x9A\x6C" => "\xEC\x89\x95", + "\x9A\x6D" => "\xEC\x89\x96", + "\x9A\x6E" => "\xEC\x89\x97", + "\x9A\x6F" => "\xEC\x89\x99", + "\x9A\x70" => "\xEC\x89\x9A", + "\x9A\x71" => "\xEC\x89\x9B", + "\x9A\x72" => "\xEC\x89\x9C", + "\x9A\x73" => "\xEC\x89\x9D", + "\x9A\x74" => "\xEC\x89\x9E", + "\x9A\x75" => "\xEC\x89\x9F", + "\x9A\x76" => "\xEC\x89\xA1", + "\x9A\x77" => "\xEC\x89\xA2", + "\x9A\x78" => "\xEC\x89\xA3", + "\x9A\x79" => "\xEC\x89\xA4", + "\x9A\x7A" => "\xEC\x89\xA6", + "\x9A\x81" => "\xEC\x89\xA7", + "\x9A\x82" => "\xEC\x89\xA8", + "\x9A\x83" => "\xEC\x89\xA9", + "\x9A\x84" => "\xEC\x89\xAA", + "\x9A\x85" => "\xEC\x89\xAB", + "\x9A\x86" => "\xEC\x89\xAE", + "\x9A\x87" => "\xEC\x89\xAF", + "\x9A\x88" => "\xEC\x89\xB1", + "\x9A\x89" => "\xEC\x89\xB2", + "\x9A\x8A" => "\xEC\x89\xB3", + "\x9A\x8B" => "\xEC\x89\xB5", + "\x9A\x8C" => "\xEC\x89\xB6", + "\x9A\x8D" => "\xEC\x89\xB7", + "\x9A\x8E" => "\xEC\x89\xB8", + "\x9A\x8F" => "\xEC\x89\xB9", + "\x9A\x90" => "\xEC\x89\xBA", + "\x9A\x91" => "\xEC\x89\xBB", + "\x9A\x92" => "\xEC\x89\xBE", + "\x9A\x93" => "\xEC\x8A\x80", + "\x9A\x94" => "\xEC\x8A\x82", + "\x9A\x95" => "\xEC\x8A\x83", + "\x9A\x96" => "\xEC\x8A\x84", + "\x9A\x97" => "\xEC\x8A\x85", + "\x9A\x98" => "\xEC\x8A\x86", + "\x9A\x99" => "\xEC\x8A\x87", + "\x9A\x9A" => "\xEC\x8A\x8A", + "\x9A\x9B" => "\xEC\x8A\x8B", + "\x9A\x9C" => "\xEC\x8A\x8C", + "\x9A\x9D" => "\xEC\x8A\x8D", + "\x9A\x9E" => "\xEC\x8A\x8E", + "\x9A\x9F" => "\xEC\x8A\x8F", + "\x9A\xA0" => "\xEC\x8A\x91", + "\x9A\xA1" => "\xEC\x8A\x92", + "\x9A\xA2" => "\xEC\x8A\x93", + "\x9A\xA3" => "\xEC\x8A\x94", + "\x9A\xA4" => "\xEC\x8A\x95", + "\x9A\xA5" => "\xEC\x8A\x96", + "\x9A\xA6" => "\xEC\x8A\x97", + "\x9A\xA7" => "\xEC\x8A\x99", + "\x9A\xA8" => "\xEC\x8A\x9A", + "\x9A\xA9" => "\xEC\x8A\x9C", + "\x9A\xAA" => "\xEC\x8A\x9E", + "\x9A\xAB" => "\xEC\x8A\x9F", + "\x9A\xAC" => "\xEC\x8A\xA0", + "\x9A\xAD" => "\xEC\x8A\xA1", + "\x9A\xAE" => "\xEC\x8A\xA2", + "\x9A\xAF" => "\xEC\x8A\xA3", + "\x9A\xB0" => "\xEC\x8A\xA6", + "\x9A\xB1" => "\xEC\x8A\xA7", + "\x9A\xB2" => "\xEC\x8A\xA9", + "\x9A\xB3" => "\xEC\x8A\xAA", + "\x9A\xB4" => "\xEC\x8A\xAB", + "\x9A\xB5" => "\xEC\x8A\xAE", + "\x9A\xB6" => "\xEC\x8A\xAF", + "\x9A\xB7" => "\xEC\x8A\xB0", + "\x9A\xB8" => "\xEC\x8A\xB1", + "\x9A\xB9" => "\xEC\x8A\xB2", + "\x9A\xBA" => "\xEC\x8A\xB3", + "\x9A\xBB" => "\xEC\x8A\xB6", + "\x9A\xBC" => "\xEC\x8A\xB8", + "\x9A\xBD" => "\xEC\x8A\xBA", + "\x9A\xBE" => "\xEC\x8A\xBB", + "\x9A\xBF" => "\xEC\x8A\xBC", + "\x9A\xC0" => "\xEC\x8A\xBD", + "\x9A\xC1" => "\xEC\x8A\xBE", + "\x9A\xC2" => "\xEC\x8A\xBF", + "\x9A\xC3" => "\xEC\x8B\x80", + "\x9A\xC4" => "\xEC\x8B\x81", + "\x9A\xC5" => "\xEC\x8B\x82", + "\x9A\xC6" => "\xEC\x8B\x83", + "\x9A\xC7" => "\xEC\x8B\x84", + "\x9A\xC8" => "\xEC\x8B\x85", + "\x9A\xC9" => "\xEC\x8B\x86", + "\x9A\xCA" => "\xEC\x8B\x87", + "\x9A\xCB" => "\xEC\x8B\x88", + "\x9A\xCC" => "\xEC\x8B\x89", + "\x9A\xCD" => "\xEC\x8B\x8A", + "\x9A\xCE" => "\xEC\x8B\x8B", + "\x9A\xCF" => "\xEC\x8B\x8C", + "\x9A\xD0" => "\xEC\x8B\x8D", + "\x9A\xD1" => "\xEC\x8B\x8E", + "\x9A\xD2" => "\xEC\x8B\x8F", + "\x9A\xD3" => "\xEC\x8B\x90", + "\x9A\xD4" => "\xEC\x8B\x91", + "\x9A\xD5" => "\xEC\x8B\x92", + "\x9A\xD6" => "\xEC\x8B\x93", + "\x9A\xD7" => "\xEC\x8B\x94", + "\x9A\xD8" => "\xEC\x8B\x95", + "\x9A\xD9" => "\xEC\x8B\x96", + "\x9A\xDA" => "\xEC\x8B\x97", + "\x9A\xDB" => "\xEC\x8B\x98", + "\x9A\xDC" => "\xEC\x8B\x99", + "\x9A\xDD" => "\xEC\x8B\x9A", + "\x9A\xDE" => "\xEC\x8B\x9B", + "\x9A\xDF" => "\xEC\x8B\x9E", + "\x9A\xE0" => "\xEC\x8B\x9F", + "\x9A\xE1" => "\xEC\x8B\xA1", + "\x9A\xE2" => "\xEC\x8B\xA2", + "\x9A\xE3" => "\xEC\x8B\xA5", + "\x9A\xE4" => "\xEC\x8B\xA6", + "\x9A\xE5" => "\xEC\x8B\xA7", + "\x9A\xE6" => "\xEC\x8B\xA8", + "\x9A\xE7" => "\xEC\x8B\xA9", + "\x9A\xE8" => "\xEC\x8B\xAA", + "\x9A\xE9" => "\xEC\x8B\xAE", + "\x9A\xEA" => "\xEC\x8B\xB0", + "\x9A\xEB" => "\xEC\x8B\xB2", + "\x9A\xEC" => "\xEC\x8B\xB3", + "\x9A\xED" => "\xEC\x8B\xB4", + "\x9A\xEE" => "\xEC\x8B\xB5", + "\x9A\xEF" => "\xEC\x8B\xB7", + "\x9A\xF0" => "\xEC\x8B\xBA", + "\x9A\xF1" => "\xEC\x8B\xBD", + "\x9A\xF2" => "\xEC\x8B\xBE", + "\x9A\xF3" => "\xEC\x8B\xBF", + "\x9A\xF4" => "\xEC\x8C\x81", + "\x9A\xF5" => "\xEC\x8C\x82", + "\x9A\xF6" => "\xEC\x8C\x83", + "\x9A\xF7" => "\xEC\x8C\x84", + "\x9A\xF8" => "\xEC\x8C\x85", + "\x9A\xF9" => "\xEC\x8C\x86", + "\x9A\xFA" => "\xEC\x8C\x87", + "\x9A\xFB" => "\xEC\x8C\x8A", + "\x9A\xFC" => "\xEC\x8C\x8B", + "\x9A\xFD" => "\xEC\x8C\x8E", + "\x9A\xFE" => "\xEC\x8C\x8F", + "\x9B\x41" => "\xEC\x8C\x90", + "\x9B\x42" => "\xEC\x8C\x91", + "\x9B\x43" => "\xEC\x8C\x92", + "\x9B\x44" => "\xEC\x8C\x96", + "\x9B\x45" => "\xEC\x8C\x97", + "\x9B\x46" => "\xEC\x8C\x99", + "\x9B\x47" => "\xEC\x8C\x9A", + "\x9B\x48" => "\xEC\x8C\x9B", + "\x9B\x49" => "\xEC\x8C\x9D", + "\x9B\x4A" => "\xEC\x8C\x9E", + "\x9B\x4B" => "\xEC\x8C\x9F", + "\x9B\x4C" => "\xEC\x8C\xA0", + "\x9B\x4D" => "\xEC\x8C\xA1", + "\x9B\x4E" => "\xEC\x8C\xA2", + "\x9B\x4F" => "\xEC\x8C\xA3", + "\x9B\x50" => "\xEC\x8C\xA6", + "\x9B\x51" => "\xEC\x8C\xA7", + "\x9B\x52" => "\xEC\x8C\xAA", + "\x9B\x53" => "\xEC\x8C\xAB", + "\x9B\x54" => "\xEC\x8C\xAC", + "\x9B\x55" => "\xEC\x8C\xAD", + "\x9B\x56" => "\xEC\x8C\xAE", + "\x9B\x57" => "\xEC\x8C\xAF", + "\x9B\x58" => "\xEC\x8C\xB0", + "\x9B\x59" => "\xEC\x8C\xB1", + "\x9B\x5A" => "\xEC\x8C\xB2", + "\x9B\x61" => "\xEC\x8C\xB3", + "\x9B\x62" => "\xEC\x8C\xB4", + "\x9B\x63" => "\xEC\x8C\xB5", + "\x9B\x64" => "\xEC\x8C\xB6", + "\x9B\x65" => "\xEC\x8C\xB7", + "\x9B\x66" => "\xEC\x8C\xB8", + "\x9B\x67" => "\xEC\x8C\xB9", + "\x9B\x68" => "\xEC\x8C\xBA", + "\x9B\x69" => "\xEC\x8C\xBB", + "\x9B\x6A" => "\xEC\x8C\xBC", + "\x9B\x6B" => "\xEC\x8C\xBD", + "\x9B\x6C" => "\xEC\x8C\xBE", + "\x9B\x6D" => "\xEC\x8C\xBF", + "\x9B\x6E" => "\xEC\x8D\x80", + "\x9B\x6F" => "\xEC\x8D\x81", + "\x9B\x70" => "\xEC\x8D\x82", + "\x9B\x71" => "\xEC\x8D\x83", + "\x9B\x72" => "\xEC\x8D\x84", + "\x9B\x73" => "\xEC\x8D\x86", + "\x9B\x74" => "\xEC\x8D\x87", + "\x9B\x75" => "\xEC\x8D\x88", + "\x9B\x76" => "\xEC\x8D\x89", + "\x9B\x77" => "\xEC\x8D\x8A", + "\x9B\x78" => "\xEC\x8D\x8B", + "\x9B\x79" => "\xEC\x8D\x8C", + "\x9B\x7A" => "\xEC\x8D\x8D", + "\x9B\x81" => "\xEC\x8D\x8E", + "\x9B\x82" => "\xEC\x8D\x8F", + "\x9B\x83" => "\xEC\x8D\x90", + "\x9B\x84" => "\xEC\x8D\x91", + "\x9B\x85" => "\xEC\x8D\x92", + "\x9B\x86" => "\xEC\x8D\x93", + "\x9B\x87" => "\xEC\x8D\x94", + "\x9B\x88" => "\xEC\x8D\x95", + "\x9B\x89" => "\xEC\x8D\x96", + "\x9B\x8A" => "\xEC\x8D\x97", + "\x9B\x8B" => "\xEC\x8D\x98", + "\x9B\x8C" => "\xEC\x8D\x99", + "\x9B\x8D" => "\xEC\x8D\x9A", + "\x9B\x8E" => "\xEC\x8D\x9B", + "\x9B\x8F" => "\xEC\x8D\x9C", + "\x9B\x90" => "\xEC\x8D\x9D", + "\x9B\x91" => "\xEC\x8D\x9E", + "\x9B\x92" => "\xEC\x8D\x9F", + "\x9B\x93" => "\xEC\x8D\xA0", + "\x9B\x94" => "\xEC\x8D\xA1", + "\x9B\x95" => "\xEC\x8D\xA2", + "\x9B\x96" => "\xEC\x8D\xA3", + "\x9B\x97" => "\xEC\x8D\xA4", + "\x9B\x98" => "\xEC\x8D\xA5", + "\x9B\x99" => "\xEC\x8D\xA6", + "\x9B\x9A" => "\xEC\x8D\xA7", + "\x9B\x9B" => "\xEC\x8D\xAA", + "\x9B\x9C" => "\xEC\x8D\xAB", + "\x9B\x9D" => "\xEC\x8D\xAD", + "\x9B\x9E" => "\xEC\x8D\xAE", + "\x9B\x9F" => "\xEC\x8D\xAF", + "\x9B\xA0" => "\xEC\x8D\xB1", + "\x9B\xA1" => "\xEC\x8D\xB3", + "\x9B\xA2" => "\xEC\x8D\xB4", + "\x9B\xA3" => "\xEC\x8D\xB5", + "\x9B\xA4" => "\xEC\x8D\xB6", + "\x9B\xA5" => "\xEC\x8D\xB7", + "\x9B\xA6" => "\xEC\x8D\xBA", + "\x9B\xA7" => "\xEC\x8D\xBB", + "\x9B\xA8" => "\xEC\x8D\xBE", + "\x9B\xA9" => "\xEC\x8D\xBF", + "\x9B\xAA" => "\xEC\x8E\x80", + "\x9B\xAB" => "\xEC\x8E\x81", + "\x9B\xAC" => "\xEC\x8E\x82", + "\x9B\xAD" => "\xEC\x8E\x83", + "\x9B\xAE" => "\xEC\x8E\x85", + "\x9B\xAF" => "\xEC\x8E\x86", + "\x9B\xB0" => "\xEC\x8E\x87", + "\x9B\xB1" => "\xEC\x8E\x89", + "\x9B\xB2" => "\xEC\x8E\x8A", + "\x9B\xB3" => "\xEC\x8E\x8B", + "\x9B\xB4" => "\xEC\x8E\x8D", + "\x9B\xB5" => "\xEC\x8E\x8E", + "\x9B\xB6" => "\xEC\x8E\x8F", + "\x9B\xB7" => "\xEC\x8E\x90", + "\x9B\xB8" => "\xEC\x8E\x91", + "\x9B\xB9" => "\xEC\x8E\x92", + "\x9B\xBA" => "\xEC\x8E\x93", + "\x9B\xBB" => "\xEC\x8E\x94", + "\x9B\xBC" => "\xEC\x8E\x95", + "\x9B\xBD" => "\xEC\x8E\x96", + "\x9B\xBE" => "\xEC\x8E\x97", + "\x9B\xBF" => "\xEC\x8E\x98", + "\x9B\xC0" => "\xEC\x8E\x99", + "\x9B\xC1" => "\xEC\x8E\x9A", + "\x9B\xC2" => "\xEC\x8E\x9B", + "\x9B\xC3" => "\xEC\x8E\x9C", + "\x9B\xC4" => "\xEC\x8E\x9D", + "\x9B\xC5" => "\xEC\x8E\x9E", + "\x9B\xC6" => "\xEC\x8E\x9F", + "\x9B\xC7" => "\xEC\x8E\xA0", + "\x9B\xC8" => "\xEC\x8E\xA1", + "\x9B\xC9" => "\xEC\x8E\xA2", + "\x9B\xCA" => "\xEC\x8E\xA3", + "\x9B\xCB" => "\xEC\x8E\xA4", + "\x9B\xCC" => "\xEC\x8E\xA5", + "\x9B\xCD" => "\xEC\x8E\xA6", + "\x9B\xCE" => "\xEC\x8E\xA7", + "\x9B\xCF" => "\xEC\x8E\xA8", + "\x9B\xD0" => "\xEC\x8E\xA9", + "\x9B\xD1" => "\xEC\x8E\xAA", + "\x9B\xD2" => "\xEC\x8E\xAB", + "\x9B\xD3" => "\xEC\x8E\xAC", + "\x9B\xD4" => "\xEC\x8E\xAD", + "\x9B\xD5" => "\xEC\x8E\xAE", + "\x9B\xD6" => "\xEC\x8E\xAF", + "\x9B\xD7" => "\xEC\x8E\xB0", + "\x9B\xD8" => "\xEC\x8E\xB1", + "\x9B\xD9" => "\xEC\x8E\xB2", + "\x9B\xDA" => "\xEC\x8E\xB3", + "\x9B\xDB" => "\xEC\x8E\xB4", + "\x9B\xDC" => "\xEC\x8E\xB5", + "\x9B\xDD" => "\xEC\x8E\xB6", + "\x9B\xDE" => "\xEC\x8E\xB7", + "\x9B\xDF" => "\xEC\x8E\xB8", + "\x9B\xE0" => "\xEC\x8E\xB9", + "\x9B\xE1" => "\xEC\x8E\xBA", + "\x9B\xE2" => "\xEC\x8E\xBB", + "\x9B\xE3" => "\xEC\x8E\xBC", + "\x9B\xE4" => "\xEC\x8E\xBD", + "\x9B\xE5" => "\xEC\x8E\xBE", + "\x9B\xE6" => "\xEC\x8E\xBF", + "\x9B\xE7" => "\xEC\x8F\x81", + "\x9B\xE8" => "\xEC\x8F\x82", + "\x9B\xE9" => "\xEC\x8F\x83", + "\x9B\xEA" => "\xEC\x8F\x84", + "\x9B\xEB" => "\xEC\x8F\x85", + "\x9B\xEC" => "\xEC\x8F\x86", + "\x9B\xED" => "\xEC\x8F\x87", + "\x9B\xEE" => "\xEC\x8F\x88", + "\x9B\xEF" => "\xEC\x8F\x89", + "\x9B\xF0" => "\xEC\x8F\x8A", + "\x9B\xF1" => "\xEC\x8F\x8B", + "\x9B\xF2" => "\xEC\x8F\x8C", + "\x9B\xF3" => "\xEC\x8F\x8D", + "\x9B\xF4" => "\xEC\x8F\x8E", + "\x9B\xF5" => "\xEC\x8F\x8F", + "\x9B\xF6" => "\xEC\x8F\x90", + "\x9B\xF7" => "\xEC\x8F\x91", + "\x9B\xF8" => "\xEC\x8F\x92", + "\x9B\xF9" => "\xEC\x8F\x93", + "\x9B\xFA" => "\xEC\x8F\x94", + "\x9B\xFB" => "\xEC\x8F\x95", + "\x9B\xFC" => "\xEC\x8F\x96", + "\x9B\xFD" => "\xEC\x8F\x97", + "\x9B\xFE" => "\xEC\x8F\x9A", + "\x9C\x41" => "\xEC\x8F\x9B", + "\x9C\x42" => "\xEC\x8F\x9D", + "\x9C\x43" => "\xEC\x8F\x9E", + "\x9C\x44" => "\xEC\x8F\xA1", + "\x9C\x45" => "\xEC\x8F\xA3", + "\x9C\x46" => "\xEC\x8F\xA4", + "\x9C\x47" => "\xEC\x8F\xA5", + "\x9C\x48" => "\xEC\x8F\xA6", + "\x9C\x49" => "\xEC\x8F\xA7", + "\x9C\x4A" => "\xEC\x8F\xAA", + "\x9C\x4B" => "\xEC\x8F\xAB", + "\x9C\x4C" => "\xEC\x8F\xAC", + "\x9C\x4D" => "\xEC\x8F\xAE", + "\x9C\x4E" => "\xEC\x8F\xAF", + "\x9C\x4F" => "\xEC\x8F\xB0", + "\x9C\x50" => "\xEC\x8F\xB1", + "\x9C\x51" => "\xEC\x8F\xB2", + "\x9C\x52" => "\xEC\x8F\xB3", + "\x9C\x53" => "\xEC\x8F\xB6", + "\x9C\x54" => "\xEC\x8F\xB7", + "\x9C\x55" => "\xEC\x8F\xB9", + "\x9C\x56" => "\xEC\x8F\xBA", + "\x9C\x57" => "\xEC\x8F\xBB", + "\x9C\x58" => "\xEC\x8F\xBC", + "\x9C\x59" => "\xEC\x8F\xBD", + "\x9C\x5A" => "\xEC\x8F\xBE", + "\x9C\x61" => "\xEC\x8F\xBF", + "\x9C\x62" => "\xEC\x90\x80", + "\x9C\x63" => "\xEC\x90\x81", + "\x9C\x64" => "\xEC\x90\x82", + "\x9C\x65" => "\xEC\x90\x83", + "\x9C\x66" => "\xEC\x90\x84", + "\x9C\x67" => "\xEC\x90\x85", + "\x9C\x68" => "\xEC\x90\x86", + "\x9C\x69" => "\xEC\x90\x87", + "\x9C\x6A" => "\xEC\x90\x89", + "\x9C\x6B" => "\xEC\x90\x8A", + "\x9C\x6C" => "\xEC\x90\x8B", + "\x9C\x6D" => "\xEC\x90\x8C", + "\x9C\x6E" => "\xEC\x90\x8D", + "\x9C\x6F" => "\xEC\x90\x8E", + "\x9C\x70" => "\xEC\x90\x8F", + "\x9C\x71" => "\xEC\x90\x91", + "\x9C\x72" => "\xEC\x90\x92", + "\x9C\x73" => "\xEC\x90\x93", + "\x9C\x74" => "\xEC\x90\x94", + "\x9C\x75" => "\xEC\x90\x95", + "\x9C\x76" => "\xEC\x90\x96", + "\x9C\x77" => "\xEC\x90\x97", + "\x9C\x78" => "\xEC\x90\x98", + "\x9C\x79" => "\xEC\x90\x99", + "\x9C\x7A" => "\xEC\x90\x9A", + "\x9C\x81" => "\xEC\x90\x9B", + "\x9C\x82" => "\xEC\x90\x9C", + "\x9C\x83" => "\xEC\x90\x9D", + "\x9C\x84" => "\xEC\x90\x9E", + "\x9C\x85" => "\xEC\x90\x9F", + "\x9C\x86" => "\xEC\x90\xA0", + "\x9C\x87" => "\xEC\x90\xA1", + "\x9C\x88" => "\xEC\x90\xA2", + "\x9C\x89" => "\xEC\x90\xA3", + "\x9C\x8A" => "\xEC\x90\xA5", + "\x9C\x8B" => "\xEC\x90\xA6", + "\x9C\x8C" => "\xEC\x90\xA7", + "\x9C\x8D" => "\xEC\x90\xA8", + "\x9C\x8E" => "\xEC\x90\xA9", + "\x9C\x8F" => "\xEC\x90\xAA", + "\x9C\x90" => "\xEC\x90\xAB", + "\x9C\x91" => "\xEC\x90\xAD", + "\x9C\x92" => "\xEC\x90\xAE", + "\x9C\x93" => "\xEC\x90\xAF", + "\x9C\x94" => "\xEC\x90\xB1", + "\x9C\x95" => "\xEC\x90\xB2", + "\x9C\x96" => "\xEC\x90\xB3", + "\x9C\x97" => "\xEC\x90\xB5", + "\x9C\x98" => "\xEC\x90\xB6", + "\x9C\x99" => "\xEC\x90\xB7", + "\x9C\x9A" => "\xEC\x90\xB8", + "\x9C\x9B" => "\xEC\x90\xB9", + "\x9C\x9C" => "\xEC\x90\xBA", + "\x9C\x9D" => "\xEC\x90\xBB", + "\x9C\x9E" => "\xEC\x90\xBE", + "\x9C\x9F" => "\xEC\x90\xBF", + "\x9C\xA0" => "\xEC\x91\x80", + "\x9C\xA1" => "\xEC\x91\x81", + "\x9C\xA2" => "\xEC\x91\x82", + "\x9C\xA3" => "\xEC\x91\x83", + "\x9C\xA4" => "\xEC\x91\x84", + "\x9C\xA5" => "\xEC\x91\x85", + "\x9C\xA6" => "\xEC\x91\x86", + "\x9C\xA7" => "\xEC\x91\x87", + "\x9C\xA8" => "\xEC\x91\x89", + "\x9C\xA9" => "\xEC\x91\x8A", + "\x9C\xAA" => "\xEC\x91\x8B", + "\x9C\xAB" => "\xEC\x91\x8C", + "\x9C\xAC" => "\xEC\x91\x8D", + "\x9C\xAD" => "\xEC\x91\x8E", + "\x9C\xAE" => "\xEC\x91\x8F", + "\x9C\xAF" => "\xEC\x91\x90", + "\x9C\xB0" => "\xEC\x91\x91", + "\x9C\xB1" => "\xEC\x91\x92", + "\x9C\xB2" => "\xEC\x91\x93", + "\x9C\xB3" => "\xEC\x91\x94", + "\x9C\xB4" => "\xEC\x91\x95", + "\x9C\xB5" => "\xEC\x91\x96", + "\x9C\xB6" => "\xEC\x91\x97", + "\x9C\xB7" => "\xEC\x91\x98", + "\x9C\xB8" => "\xEC\x91\x99", + "\x9C\xB9" => "\xEC\x91\x9A", + "\x9C\xBA" => "\xEC\x91\x9B", + "\x9C\xBB" => "\xEC\x91\x9C", + "\x9C\xBC" => "\xEC\x91\x9D", + "\x9C\xBD" => "\xEC\x91\x9E", + "\x9C\xBE" => "\xEC\x91\x9F", + "\x9C\xBF" => "\xEC\x91\xA0", + "\x9C\xC0" => "\xEC\x91\xA1", + "\x9C\xC1" => "\xEC\x91\xA2", + "\x9C\xC2" => "\xEC\x91\xA3", + "\x9C\xC3" => "\xEC\x91\xA6", + "\x9C\xC4" => "\xEC\x91\xA7", + "\x9C\xC5" => "\xEC\x91\xA9", + "\x9C\xC6" => "\xEC\x91\xAA", + "\x9C\xC7" => "\xEC\x91\xAB", + "\x9C\xC8" => "\xEC\x91\xAD", + "\x9C\xC9" => "\xEC\x91\xAE", + "\x9C\xCA" => "\xEC\x91\xAF", + "\x9C\xCB" => "\xEC\x91\xB0", + "\x9C\xCC" => "\xEC\x91\xB1", + "\x9C\xCD" => "\xEC\x91\xB2", + "\x9C\xCE" => "\xEC\x91\xB3", + "\x9C\xCF" => "\xEC\x91\xB6", + "\x9C\xD0" => "\xEC\x91\xB7", + "\x9C\xD1" => "\xEC\x91\xB8", + "\x9C\xD2" => "\xEC\x91\xBA", + "\x9C\xD3" => "\xEC\x91\xBB", + "\x9C\xD4" => "\xEC\x91\xBC", + "\x9C\xD5" => "\xEC\x91\xBD", + "\x9C\xD6" => "\xEC\x91\xBE", + "\x9C\xD7" => "\xEC\x91\xBF", + "\x9C\xD8" => "\xEC\x92\x81", + "\x9C\xD9" => "\xEC\x92\x82", + "\x9C\xDA" => "\xEC\x92\x83", + "\x9C\xDB" => "\xEC\x92\x84", + "\x9C\xDC" => "\xEC\x92\x85", + "\x9C\xDD" => "\xEC\x92\x86", + "\x9C\xDE" => "\xEC\x92\x87", + "\x9C\xDF" => "\xEC\x92\x88", + "\x9C\xE0" => "\xEC\x92\x89", + "\x9C\xE1" => "\xEC\x92\x8A", + "\x9C\xE2" => "\xEC\x92\x8B", + "\x9C\xE3" => "\xEC\x92\x8C", + "\x9C\xE4" => "\xEC\x92\x8D", + "\x9C\xE5" => "\xEC\x92\x8E", + "\x9C\xE6" => "\xEC\x92\x8F", + "\x9C\xE7" => "\xEC\x92\x90", + "\x9C\xE8" => "\xEC\x92\x91", + "\x9C\xE9" => "\xEC\x92\x92", + "\x9C\xEA" => "\xEC\x92\x93", + "\x9C\xEB" => "\xEC\x92\x95", + "\x9C\xEC" => "\xEC\x92\x96", + "\x9C\xED" => "\xEC\x92\x97", + "\x9C\xEE" => "\xEC\x92\x98", + "\x9C\xEF" => "\xEC\x92\x99", + "\x9C\xF0" => "\xEC\x92\x9A", + "\x9C\xF1" => "\xEC\x92\x9B", + "\x9C\xF2" => "\xEC\x92\x9D", + "\x9C\xF3" => "\xEC\x92\x9E", + "\x9C\xF4" => "\xEC\x92\x9F", + "\x9C\xF5" => "\xEC\x92\xA0", + "\x9C\xF6" => "\xEC\x92\xA1", + "\x9C\xF7" => "\xEC\x92\xA2", + "\x9C\xF8" => "\xEC\x92\xA3", + "\x9C\xF9" => "\xEC\x92\xA4", + "\x9C\xFA" => "\xEC\x92\xA5", + "\x9C\xFB" => "\xEC\x92\xA6", + "\x9C\xFC" => "\xEC\x92\xA7", + "\x9C\xFD" => "\xEC\x92\xA8", + "\x9C\xFE" => "\xEC\x92\xA9", + "\x9D\x41" => "\xEC\x92\xAA", + "\x9D\x42" => "\xEC\x92\xAB", + "\x9D\x43" => "\xEC\x92\xAC", + "\x9D\x44" => "\xEC\x92\xAD", + "\x9D\x45" => "\xEC\x92\xAE", + "\x9D\x46" => "\xEC\x92\xAF", + "\x9D\x47" => "\xEC\x92\xB0", + "\x9D\x48" => "\xEC\x92\xB1", + "\x9D\x49" => "\xEC\x92\xB2", + "\x9D\x4A" => "\xEC\x92\xB3", + "\x9D\x4B" => "\xEC\x92\xB4", + "\x9D\x4C" => "\xEC\x92\xB5", + "\x9D\x4D" => "\xEC\x92\xB6", + "\x9D\x4E" => "\xEC\x92\xB7", + "\x9D\x4F" => "\xEC\x92\xB9", + "\x9D\x50" => "\xEC\x92\xBA", + "\x9D\x51" => "\xEC\x92\xBB", + "\x9D\x52" => "\xEC\x92\xBD", + "\x9D\x53" => "\xEC\x92\xBE", + "\x9D\x54" => "\xEC\x92\xBF", + "\x9D\x55" => "\xEC\x93\x80", + "\x9D\x56" => "\xEC\x93\x81", + "\x9D\x57" => "\xEC\x93\x82", + "\x9D\x58" => "\xEC\x93\x83", + "\x9D\x59" => "\xEC\x93\x84", + "\x9D\x5A" => "\xEC\x93\x85", + "\x9D\x61" => "\xEC\x93\x86", + "\x9D\x62" => "\xEC\x93\x87", + "\x9D\x63" => "\xEC\x93\x88", + "\x9D\x64" => "\xEC\x93\x89", + "\x9D\x65" => "\xEC\x93\x8A", + "\x9D\x66" => "\xEC\x93\x8B", + "\x9D\x67" => "\xEC\x93\x8C", + "\x9D\x68" => "\xEC\x93\x8D", + "\x9D\x69" => "\xEC\x93\x8E", + "\x9D\x6A" => "\xEC\x93\x8F", + "\x9D\x6B" => "\xEC\x93\x90", + "\x9D\x6C" => "\xEC\x93\x91", + "\x9D\x6D" => "\xEC\x93\x92", + "\x9D\x6E" => "\xEC\x93\x93", + "\x9D\x6F" => "\xEC\x93\x94", + "\x9D\x70" => "\xEC\x93\x95", + "\x9D\x71" => "\xEC\x93\x96", + "\x9D\x72" => "\xEC\x93\x97", + "\x9D\x73" => "\xEC\x93\x98", + "\x9D\x74" => "\xEC\x93\x99", + "\x9D\x75" => "\xEC\x93\x9A", + "\x9D\x76" => "\xEC\x93\x9B", + "\x9D\x77" => "\xEC\x93\x9C", + "\x9D\x78" => "\xEC\x93\x9D", + "\x9D\x79" => "\xEC\x93\x9E", + "\x9D\x7A" => "\xEC\x93\x9F", + "\x9D\x81" => "\xEC\x93\xA0", + "\x9D\x82" => "\xEC\x93\xA1", + "\x9D\x83" => "\xEC\x93\xA2", + "\x9D\x84" => "\xEC\x93\xA3", + "\x9D\x85" => "\xEC\x93\xA4", + "\x9D\x86" => "\xEC\x93\xA5", + "\x9D\x87" => "\xEC\x93\xA6", + "\x9D\x88" => "\xEC\x93\xA7", + "\x9D\x89" => "\xEC\x93\xA8", + "\x9D\x8A" => "\xEC\x93\xAA", + "\x9D\x8B" => "\xEC\x93\xAB", + "\x9D\x8C" => "\xEC\x93\xAC", + "\x9D\x8D" => "\xEC\x93\xAD", + "\x9D\x8E" => "\xEC\x93\xAE", + "\x9D\x8F" => "\xEC\x93\xAF", + "\x9D\x90" => "\xEC\x93\xB2", + "\x9D\x91" => "\xEC\x93\xB3", + "\x9D\x92" => "\xEC\x93\xB5", + "\x9D\x93" => "\xEC\x93\xB6", + "\x9D\x94" => "\xEC\x93\xB7", + "\x9D\x95" => "\xEC\x93\xB9", + "\x9D\x96" => "\xEC\x93\xBB", + "\x9D\x97" => "\xEC\x93\xBC", + "\x9D\x98" => "\xEC\x93\xBD", + "\x9D\x99" => "\xEC\x93\xBE", + "\x9D\x9A" => "\xEC\x94\x82", + "\x9D\x9B" => "\xEC\x94\x83", + "\x9D\x9C" => "\xEC\x94\x84", + "\x9D\x9D" => "\xEC\x94\x85", + "\x9D\x9E" => "\xEC\x94\x86", + "\x9D\x9F" => "\xEC\x94\x87", + "\x9D\xA0" => "\xEC\x94\x88", + "\x9D\xA1" => "\xEC\x94\x89", + "\x9D\xA2" => "\xEC\x94\x8A", + "\x9D\xA3" => "\xEC\x94\x8B", + "\x9D\xA4" => "\xEC\x94\x8D", + "\x9D\xA5" => "\xEC\x94\x8E", + "\x9D\xA6" => "\xEC\x94\x8F", + "\x9D\xA7" => "\xEC\x94\x91", + "\x9D\xA8" => "\xEC\x94\x92", + "\x9D\xA9" => "\xEC\x94\x93", + "\x9D\xAA" => "\xEC\x94\x95", + "\x9D\xAB" => "\xEC\x94\x96", + "\x9D\xAC" => "\xEC\x94\x97", + "\x9D\xAD" => "\xEC\x94\x98", + "\x9D\xAE" => "\xEC\x94\x99", + "\x9D\xAF" => "\xEC\x94\x9A", + "\x9D\xB0" => "\xEC\x94\x9B", + "\x9D\xB1" => "\xEC\x94\x9D", + "\x9D\xB2" => "\xEC\x94\x9E", + "\x9D\xB3" => "\xEC\x94\x9F", + "\x9D\xB4" => "\xEC\x94\xA0", + "\x9D\xB5" => "\xEC\x94\xA1", + "\x9D\xB6" => "\xEC\x94\xA2", + "\x9D\xB7" => "\xEC\x94\xA3", + "\x9D\xB8" => "\xEC\x94\xA4", + "\x9D\xB9" => "\xEC\x94\xA5", + "\x9D\xBA" => "\xEC\x94\xA6", + "\x9D\xBB" => "\xEC\x94\xA7", + "\x9D\xBC" => "\xEC\x94\xAA", + "\x9D\xBD" => "\xEC\x94\xAB", + "\x9D\xBE" => "\xEC\x94\xAD", + "\x9D\xBF" => "\xEC\x94\xAE", + "\x9D\xC0" => "\xEC\x94\xAF", + "\x9D\xC1" => "\xEC\x94\xB1", + "\x9D\xC2" => "\xEC\x94\xB2", + "\x9D\xC3" => "\xEC\x94\xB3", + "\x9D\xC4" => "\xEC\x94\xB4", + "\x9D\xC5" => "\xEC\x94\xB5", + "\x9D\xC6" => "\xEC\x94\xB6", + "\x9D\xC7" => "\xEC\x94\xB7", + "\x9D\xC8" => "\xEC\x94\xBA", + "\x9D\xC9" => "\xEC\x94\xBC", + "\x9D\xCA" => "\xEC\x94\xBE", + "\x9D\xCB" => "\xEC\x94\xBF", + "\x9D\xCC" => "\xEC\x95\x80", + "\x9D\xCD" => "\xEC\x95\x81", + "\x9D\xCE" => "\xEC\x95\x82", + "\x9D\xCF" => "\xEC\x95\x83", + "\x9D\xD0" => "\xEC\x95\x86", + "\x9D\xD1" => "\xEC\x95\x87", + "\x9D\xD2" => "\xEC\x95\x8B", + "\x9D\xD3" => "\xEC\x95\x8F", + "\x9D\xD4" => "\xEC\x95\x90", + "\x9D\xD5" => "\xEC\x95\x91", + "\x9D\xD6" => "\xEC\x95\x92", + "\x9D\xD7" => "\xEC\x95\x96", + "\x9D\xD8" => "\xEC\x95\x9A", + "\x9D\xD9" => "\xEC\x95\x9B", + "\x9D\xDA" => "\xEC\x95\x9C", + "\x9D\xDB" => "\xEC\x95\x9F", + "\x9D\xDC" => "\xEC\x95\xA2", + "\x9D\xDD" => "\xEC\x95\xA3", + "\x9D\xDE" => "\xEC\x95\xA5", + "\x9D\xDF" => "\xEC\x95\xA6", + "\x9D\xE0" => "\xEC\x95\xA7", + "\x9D\xE1" => "\xEC\x95\xA9", + "\x9D\xE2" => "\xEC\x95\xAA", + "\x9D\xE3" => "\xEC\x95\xAB", + "\x9D\xE4" => "\xEC\x95\xAC", + "\x9D\xE5" => "\xEC\x95\xAD", + "\x9D\xE6" => "\xEC\x95\xAE", + "\x9D\xE7" => "\xEC\x95\xAF", + "\x9D\xE8" => "\xEC\x95\xB2", + "\x9D\xE9" => "\xEC\x95\xB6", + "\x9D\xEA" => "\xEC\x95\xB7", + "\x9D\xEB" => "\xEC\x95\xB8", + "\x9D\xEC" => "\xEC\x95\xB9", + "\x9D\xED" => "\xEC\x95\xBA", + "\x9D\xEE" => "\xEC\x95\xBB", + "\x9D\xEF" => "\xEC\x95\xBE", + "\x9D\xF0" => "\xEC\x95\xBF", + "\x9D\xF1" => "\xEC\x96\x81", + "\x9D\xF2" => "\xEC\x96\x82", + "\x9D\xF3" => "\xEC\x96\x83", + "\x9D\xF4" => "\xEC\x96\x85", + "\x9D\xF5" => "\xEC\x96\x86", + "\x9D\xF6" => "\xEC\x96\x88", + "\x9D\xF7" => "\xEC\x96\x89", + "\x9D\xF8" => "\xEC\x96\x8A", + "\x9D\xF9" => "\xEC\x96\x8B", + "\x9D\xFA" => "\xEC\x96\x8E", + "\x9D\xFB" => "\xEC\x96\x90", + "\x9D\xFC" => "\xEC\x96\x92", + "\x9D\xFD" => "\xEC\x96\x93", + "\x9D\xFE" => "\xEC\x96\x94", + "\x9E\x41" => "\xEC\x96\x96", + "\x9E\x42" => "\xEC\x96\x99", + "\x9E\x43" => "\xEC\x96\x9A", + "\x9E\x44" => "\xEC\x96\x9B", + "\x9E\x45" => "\xEC\x96\x9D", + "\x9E\x46" => "\xEC\x96\x9E", + "\x9E\x47" => "\xEC\x96\x9F", + "\x9E\x48" => "\xEC\x96\xA1", + "\x9E\x49" => "\xEC\x96\xA2", + "\x9E\x4A" => "\xEC\x96\xA3", + "\x9E\x4B" => "\xEC\x96\xA4", + "\x9E\x4C" => "\xEC\x96\xA5", + "\x9E\x4D" => "\xEC\x96\xA6", + "\x9E\x4E" => "\xEC\x96\xA7", + "\x9E\x4F" => "\xEC\x96\xA8", + "\x9E\x50" => "\xEC\x96\xAA", + "\x9E\x51" => "\xEC\x96\xAB", + "\x9E\x52" => "\xEC\x96\xAC", + "\x9E\x53" => "\xEC\x96\xAD", + "\x9E\x54" => "\xEC\x96\xAE", + "\x9E\x55" => "\xEC\x96\xAF", + "\x9E\x56" => "\xEC\x96\xB0", + "\x9E\x57" => "\xEC\x96\xB1", + "\x9E\x58" => "\xEC\x96\xB2", + "\x9E\x59" => "\xEC\x96\xB3", + "\x9E\x5A" => "\xEC\x96\xB6", + "\x9E\x61" => "\xEC\x96\xB7", + "\x9E\x62" => "\xEC\x96\xBA", + "\x9E\x63" => "\xEC\x96\xBF", + "\x9E\x64" => "\xEC\x97\x80", + "\x9E\x65" => "\xEC\x97\x81", + "\x9E\x66" => "\xEC\x97\x82", + "\x9E\x67" => "\xEC\x97\x83", + "\x9E\x68" => "\xEC\x97\x8B", + "\x9E\x69" => "\xEC\x97\x8D", + "\x9E\x6A" => "\xEC\x97\x8F", + "\x9E\x6B" => "\xEC\x97\x92", + "\x9E\x6C" => "\xEC\x97\x93", + "\x9E\x6D" => "\xEC\x97\x95", + "\x9E\x6E" => "\xEC\x97\x96", + "\x9E\x6F" => "\xEC\x97\x97", + "\x9E\x70" => "\xEC\x97\x99", + "\x9E\x71" => "\xEC\x97\x9A", + "\x9E\x72" => "\xEC\x97\x9B", + "\x9E\x73" => "\xEC\x97\x9C", + "\x9E\x74" => "\xEC\x97\x9D", + "\x9E\x75" => "\xEC\x97\x9E", + "\x9E\x76" => "\xEC\x97\x9F", + "\x9E\x77" => "\xEC\x97\xA2", + "\x9E\x78" => "\xEC\x97\xA4", + "\x9E\x79" => "\xEC\x97\xA6", + "\x9E\x7A" => "\xEC\x97\xA7", + "\x9E\x81" => "\xEC\x97\xA8", + "\x9E\x82" => "\xEC\x97\xA9", + "\x9E\x83" => "\xEC\x97\xAA", + "\x9E\x84" => "\xEC\x97\xAB", + "\x9E\x85" => "\xEC\x97\xAF", + "\x9E\x86" => "\xEC\x97\xB1", + "\x9E\x87" => "\xEC\x97\xB2", + "\x9E\x88" => "\xEC\x97\xB3", + "\x9E\x89" => "\xEC\x97\xB5", + "\x9E\x8A" => "\xEC\x97\xB8", + "\x9E\x8B" => "\xEC\x97\xB9", + "\x9E\x8C" => "\xEC\x97\xBA", + "\x9E\x8D" => "\xEC\x97\xBB", + "\x9E\x8E" => "\xEC\x98\x82", + "\x9E\x8F" => "\xEC\x98\x83", + "\x9E\x90" => "\xEC\x98\x84", + "\x9E\x91" => "\xEC\x98\x89", + "\x9E\x92" => "\xEC\x98\x8A", + "\x9E\x93" => "\xEC\x98\x8B", + "\x9E\x94" => "\xEC\x98\x8D", + "\x9E\x95" => "\xEC\x98\x8E", + "\x9E\x96" => "\xEC\x98\x8F", + "\x9E\x97" => "\xEC\x98\x91", + "\x9E\x98" => "\xEC\x98\x92", + "\x9E\x99" => "\xEC\x98\x93", + "\x9E\x9A" => "\xEC\x98\x94", + "\x9E\x9B" => "\xEC\x98\x95", + "\x9E\x9C" => "\xEC\x98\x96", + "\x9E\x9D" => "\xEC\x98\x97", + "\x9E\x9E" => "\xEC\x98\x9A", + "\x9E\x9F" => "\xEC\x98\x9D", + "\x9E\xA0" => "\xEC\x98\x9E", + "\x9E\xA1" => "\xEC\x98\x9F", + "\x9E\xA2" => "\xEC\x98\xA0", + "\x9E\xA3" => "\xEC\x98\xA1", + "\x9E\xA4" => "\xEC\x98\xA2", + "\x9E\xA5" => "\xEC\x98\xA3", + "\x9E\xA6" => "\xEC\x98\xA6", + "\x9E\xA7" => "\xEC\x98\xA7", + "\x9E\xA8" => "\xEC\x98\xA9", + "\x9E\xA9" => "\xEC\x98\xAA", + "\x9E\xAA" => "\xEC\x98\xAB", + "\x9E\xAB" => "\xEC\x98\xAF", + "\x9E\xAC" => "\xEC\x98\xB1", + "\x9E\xAD" => "\xEC\x98\xB2", + "\x9E\xAE" => "\xEC\x98\xB6", + "\x9E\xAF" => "\xEC\x98\xB8", + "\x9E\xB0" => "\xEC\x98\xBA", + "\x9E\xB1" => "\xEC\x98\xBC", + "\x9E\xB2" => "\xEC\x98\xBD", + "\x9E\xB3" => "\xEC\x98\xBE", + "\x9E\xB4" => "\xEC\x98\xBF", + "\x9E\xB5" => "\xEC\x99\x82", + "\x9E\xB6" => "\xEC\x99\x83", + "\x9E\xB7" => "\xEC\x99\x85", + "\x9E\xB8" => "\xEC\x99\x86", + "\x9E\xB9" => "\xEC\x99\x87", + "\x9E\xBA" => "\xEC\x99\x89", + "\x9E\xBB" => "\xEC\x99\x8A", + "\x9E\xBC" => "\xEC\x99\x8B", + "\x9E\xBD" => "\xEC\x99\x8C", + "\x9E\xBE" => "\xEC\x99\x8D", + "\x9E\xBF" => "\xEC\x99\x8E", + "\x9E\xC0" => "\xEC\x99\x8F", + "\x9E\xC1" => "\xEC\x99\x92", + "\x9E\xC2" => "\xEC\x99\x96", + "\x9E\xC3" => "\xEC\x99\x97", + "\x9E\xC4" => "\xEC\x99\x98", + "\x9E\xC5" => "\xEC\x99\x99", + "\x9E\xC6" => "\xEC\x99\x9A", + "\x9E\xC7" => "\xEC\x99\x9B", + "\x9E\xC8" => "\xEC\x99\x9E", + "\x9E\xC9" => "\xEC\x99\x9F", + "\x9E\xCA" => "\xEC\x99\xA1", + "\x9E\xCB" => "\xEC\x99\xA2", + "\x9E\xCC" => "\xEC\x99\xA3", + "\x9E\xCD" => "\xEC\x99\xA4", + "\x9E\xCE" => "\xEC\x99\xA5", + "\x9E\xCF" => "\xEC\x99\xA6", + "\x9E\xD0" => "\xEC\x99\xA7", + "\x9E\xD1" => "\xEC\x99\xA8", + "\x9E\xD2" => "\xEC\x99\xA9", + "\x9E\xD3" => "\xEC\x99\xAA", + "\x9E\xD4" => "\xEC\x99\xAB", + "\x9E\xD5" => "\xEC\x99\xAD", + "\x9E\xD6" => "\xEC\x99\xAE", + "\x9E\xD7" => "\xEC\x99\xB0", + "\x9E\xD8" => "\xEC\x99\xB2", + "\x9E\xD9" => "\xEC\x99\xB3", + "\x9E\xDA" => "\xEC\x99\xB4", + "\x9E\xDB" => "\xEC\x99\xB5", + "\x9E\xDC" => "\xEC\x99\xB6", + "\x9E\xDD" => "\xEC\x99\xB7", + "\x9E\xDE" => "\xEC\x99\xBA", + "\x9E\xDF" => "\xEC\x99\xBB", + "\x9E\xE0" => "\xEC\x99\xBD", + "\x9E\xE1" => "\xEC\x99\xBE", + "\x9E\xE2" => "\xEC\x99\xBF", + "\x9E\xE3" => "\xEC\x9A\x81", + "\x9E\xE4" => "\xEC\x9A\x82", + "\x9E\xE5" => "\xEC\x9A\x83", + "\x9E\xE6" => "\xEC\x9A\x84", + "\x9E\xE7" => "\xEC\x9A\x85", + "\x9E\xE8" => "\xEC\x9A\x86", + "\x9E\xE9" => "\xEC\x9A\x87", + "\x9E\xEA" => "\xEC\x9A\x8A", + "\x9E\xEB" => "\xEC\x9A\x8C", + "\x9E\xEC" => "\xEC\x9A\x8E", + "\x9E\xED" => "\xEC\x9A\x8F", + "\x9E\xEE" => "\xEC\x9A\x90", + "\x9E\xEF" => "\xEC\x9A\x91", + "\x9E\xF0" => "\xEC\x9A\x92", + "\x9E\xF1" => "\xEC\x9A\x93", + "\x9E\xF2" => "\xEC\x9A\x96", + "\x9E\xF3" => "\xEC\x9A\x97", + "\x9E\xF4" => "\xEC\x9A\x99", + "\x9E\xF5" => "\xEC\x9A\x9A", + "\x9E\xF6" => "\xEC\x9A\x9B", + "\x9E\xF7" => "\xEC\x9A\x9D", + "\x9E\xF8" => "\xEC\x9A\x9E", + "\x9E\xF9" => "\xEC\x9A\x9F", + "\x9E\xFA" => "\xEC\x9A\xA0", + "\x9E\xFB" => "\xEC\x9A\xA1", + "\x9E\xFC" => "\xEC\x9A\xA2", + "\x9E\xFD" => "\xEC\x9A\xA3", + "\x9E\xFE" => "\xEC\x9A\xA6", + "\x9F\x41" => "\xEC\x9A\xA8", + "\x9F\x42" => "\xEC\x9A\xAA", + "\x9F\x43" => "\xEC\x9A\xAB", + "\x9F\x44" => "\xEC\x9A\xAC", + "\x9F\x45" => "\xEC\x9A\xAD", + "\x9F\x46" => "\xEC\x9A\xAE", + "\x9F\x47" => "\xEC\x9A\xAF", + "\x9F\x48" => "\xEC\x9A\xB2", + "\x9F\x49" => "\xEC\x9A\xB3", + "\x9F\x4A" => "\xEC\x9A\xB5", + "\x9F\x4B" => "\xEC\x9A\xB6", + "\x9F\x4C" => "\xEC\x9A\xB7", + "\x9F\x4D" => "\xEC\x9A\xBB", + "\x9F\x4E" => "\xEC\x9A\xBC", + "\x9F\x4F" => "\xEC\x9A\xBD", + "\x9F\x50" => "\xEC\x9A\xBE", + "\x9F\x51" => "\xEC\x9A\xBF", + "\x9F\x52" => "\xEC\x9B\x82", + "\x9F\x53" => "\xEC\x9B\x84", + "\x9F\x54" => "\xEC\x9B\x86", + "\x9F\x55" => "\xEC\x9B\x87", + "\x9F\x56" => "\xEC\x9B\x88", + "\x9F\x57" => "\xEC\x9B\x89", + "\x9F\x58" => "\xEC\x9B\x8A", + "\x9F\x59" => "\xEC\x9B\x8B", + "\x9F\x5A" => "\xEC\x9B\x8E", + "\x9F\x61" => "\xEC\x9B\x8F", + "\x9F\x62" => "\xEC\x9B\x91", + "\x9F\x63" => "\xEC\x9B\x92", + "\x9F\x64" => "\xEC\x9B\x93", + "\x9F\x65" => "\xEC\x9B\x95", + "\x9F\x66" => "\xEC\x9B\x96", + "\x9F\x67" => "\xEC\x9B\x97", + "\x9F\x68" => "\xEC\x9B\x98", + "\x9F\x69" => "\xEC\x9B\x99", + "\x9F\x6A" => "\xEC\x9B\x9A", + "\x9F\x6B" => "\xEC\x9B\x9B", + "\x9F\x6C" => "\xEC\x9B\x9E", + "\x9F\x6D" => "\xEC\x9B\x9F", + "\x9F\x6E" => "\xEC\x9B\xA2", + "\x9F\x6F" => "\xEC\x9B\xA3", + "\x9F\x70" => "\xEC\x9B\xA4", + "\x9F\x71" => "\xEC\x9B\xA5", + "\x9F\x72" => "\xEC\x9B\xA6", + "\x9F\x73" => "\xEC\x9B\xA7", + "\x9F\x74" => "\xEC\x9B\xAA", + "\x9F\x75" => "\xEC\x9B\xAB", + "\x9F\x76" => "\xEC\x9B\xAD", + "\x9F\x77" => "\xEC\x9B\xAE", + "\x9F\x78" => "\xEC\x9B\xAF", + "\x9F\x79" => "\xEC\x9B\xB1", + "\x9F\x7A" => "\xEC\x9B\xB2", + "\x9F\x81" => "\xEC\x9B\xB3", + "\x9F\x82" => "\xEC\x9B\xB4", + "\x9F\x83" => "\xEC\x9B\xB5", + "\x9F\x84" => "\xEC\x9B\xB6", + "\x9F\x85" => "\xEC\x9B\xB7", + "\x9F\x86" => "\xEC\x9B\xBA", + "\x9F\x87" => "\xEC\x9B\xBB", + "\x9F\x88" => "\xEC\x9B\xBC", + "\x9F\x89" => "\xEC\x9B\xBE", + "\x9F\x8A" => "\xEC\x9B\xBF", + "\x9F\x8B" => "\xEC\x9C\x80", + "\x9F\x8C" => "\xEC\x9C\x81", + "\x9F\x8D" => "\xEC\x9C\x82", + "\x9F\x8E" => "\xEC\x9C\x83", + "\x9F\x8F" => "\xEC\x9C\x86", + "\x9F\x90" => "\xEC\x9C\x87", + "\x9F\x91" => "\xEC\x9C\x89", + "\x9F\x92" => "\xEC\x9C\x8A", + "\x9F\x93" => "\xEC\x9C\x8B", + "\x9F\x94" => "\xEC\x9C\x8D", + "\x9F\x95" => "\xEC\x9C\x8E", + "\x9F\x96" => "\xEC\x9C\x8F", + "\x9F\x97" => "\xEC\x9C\x90", + "\x9F\x98" => "\xEC\x9C\x91", + "\x9F\x99" => "\xEC\x9C\x92", + "\x9F\x9A" => "\xEC\x9C\x93", + "\x9F\x9B" => "\xEC\x9C\x96", + "\x9F\x9C" => "\xEC\x9C\x98", + "\x9F\x9D" => "\xEC\x9C\x9A", + "\x9F\x9E" => "\xEC\x9C\x9B", + "\x9F\x9F" => "\xEC\x9C\x9C", + "\x9F\xA0" => "\xEC\x9C\x9D", + "\x9F\xA1" => "\xEC\x9C\x9E", + "\x9F\xA2" => "\xEC\x9C\x9F", + "\x9F\xA3" => "\xEC\x9C\xA2", + "\x9F\xA4" => "\xEC\x9C\xA3", + "\x9F\xA5" => "\xEC\x9C\xA5", + "\x9F\xA6" => "\xEC\x9C\xA6", + "\x9F\xA7" => "\xEC\x9C\xA7", + "\x9F\xA8" => "\xEC\x9C\xA9", + "\x9F\xA9" => "\xEC\x9C\xAA", + "\x9F\xAA" => "\xEC\x9C\xAB", + "\x9F\xAB" => "\xEC\x9C\xAC", + "\x9F\xAC" => "\xEC\x9C\xAD", + "\x9F\xAD" => "\xEC\x9C\xAE", + "\x9F\xAE" => "\xEC\x9C\xAF", + "\x9F\xAF" => "\xEC\x9C\xB2", + "\x9F\xB0" => "\xEC\x9C\xB4", + "\x9F\xB1" => "\xEC\x9C\xB6", + "\x9F\xB2" => "\xEC\x9C\xB8", + "\x9F\xB3" => "\xEC\x9C\xB9", + "\x9F\xB4" => "\xEC\x9C\xBA", + "\x9F\xB5" => "\xEC\x9C\xBB", + "\x9F\xB6" => "\xEC\x9C\xBE", + "\x9F\xB7" => "\xEC\x9C\xBF", + "\x9F\xB8" => "\xEC\x9D\x81", + "\x9F\xB9" => "\xEC\x9D\x82", + "\x9F\xBA" => "\xEC\x9D\x83", + "\x9F\xBB" => "\xEC\x9D\x85", + "\x9F\xBC" => "\xEC\x9D\x86", + "\x9F\xBD" => "\xEC\x9D\x87", + "\x9F\xBE" => "\xEC\x9D\x88", + "\x9F\xBF" => "\xEC\x9D\x89", + "\x9F\xC0" => "\xEC\x9D\x8B", + "\x9F\xC1" => "\xEC\x9D\x8E", + "\x9F\xC2" => "\xEC\x9D\x90", + "\x9F\xC3" => "\xEC\x9D\x99", + "\x9F\xC4" => "\xEC\x9D\x9A", + "\x9F\xC5" => "\xEC\x9D\x9B", + "\x9F\xC6" => "\xEC\x9D\x9D", + "\x9F\xC7" => "\xEC\x9D\x9E", + "\x9F\xC8" => "\xEC\x9D\x9F", + "\x9F\xC9" => "\xEC\x9D\xA1", + "\x9F\xCA" => "\xEC\x9D\xA2", + "\x9F\xCB" => "\xEC\x9D\xA3", + "\x9F\xCC" => "\xEC\x9D\xA4", + "\x9F\xCD" => "\xEC\x9D\xA5", + "\x9F\xCE" => "\xEC\x9D\xA6", + "\x9F\xCF" => "\xEC\x9D\xA7", + "\x9F\xD0" => "\xEC\x9D\xA9", + "\x9F\xD1" => "\xEC\x9D\xAA", + "\x9F\xD2" => "\xEC\x9D\xAC", + "\x9F\xD3" => "\xEC\x9D\xAD", + "\x9F\xD4" => "\xEC\x9D\xAE", + "\x9F\xD5" => "\xEC\x9D\xAF", + "\x9F\xD6" => "\xEC\x9D\xB0", + "\x9F\xD7" => "\xEC\x9D\xB1", + "\x9F\xD8" => "\xEC\x9D\xB2", + "\x9F\xD9" => "\xEC\x9D\xB3", + "\x9F\xDA" => "\xEC\x9D\xB6", + "\x9F\xDB" => "\xEC\x9D\xB7", + "\x9F\xDC" => "\xEC\x9D\xB9", + "\x9F\xDD" => "\xEC\x9D\xBA", + "\x9F\xDE" => "\xEC\x9D\xBB", + "\x9F\xDF" => "\xEC\x9D\xBF", + "\x9F\xE0" => "\xEC\x9E\x80", + "\x9F\xE1" => "\xEC\x9E\x81", + "\x9F\xE2" => "\xEC\x9E\x82", + "\x9F\xE3" => "\xEC\x9E\x86", + "\x9F\xE4" => "\xEC\x9E\x8B", + "\x9F\xE5" => "\xEC\x9E\x8C", + "\x9F\xE6" => "\xEC\x9E\x8D", + "\x9F\xE7" => "\xEC\x9E\x8F", + "\x9F\xE8" => "\xEC\x9E\x92", + "\x9F\xE9" => "\xEC\x9E\x93", + "\x9F\xEA" => "\xEC\x9E\x95", + "\x9F\xEB" => "\xEC\x9E\x99", + "\x9F\xEC" => "\xEC\x9E\x9B", + "\x9F\xED" => "\xEC\x9E\x9C", + "\x9F\xEE" => "\xEC\x9E\x9D", + "\x9F\xEF" => "\xEC\x9E\x9E", + "\x9F\xF0" => "\xEC\x9E\x9F", + "\x9F\xF1" => "\xEC\x9E\xA2", + "\x9F\xF2" => "\xEC\x9E\xA7", + "\x9F\xF3" => "\xEC\x9E\xA8", + "\x9F\xF4" => "\xEC\x9E\xA9", + "\x9F\xF5" => "\xEC\x9E\xAA", + "\x9F\xF6" => "\xEC\x9E\xAB", + "\x9F\xF7" => "\xEC\x9E\xAE", + "\x9F\xF8" => "\xEC\x9E\xAF", + "\x9F\xF9" => "\xEC\x9E\xB1", + "\x9F\xFA" => "\xEC\x9E\xB2", + "\x9F\xFB" => "\xEC\x9E\xB3", + "\x9F\xFC" => "\xEC\x9E\xB5", + "\x9F\xFD" => "\xEC\x9E\xB6", + "\x9F\xFE" => "\xEC\x9E\xB7", + "\xA0\x41" => "\xEC\x9E\xB8", + "\xA0\x42" => "\xEC\x9E\xB9", + "\xA0\x43" => "\xEC\x9E\xBA", + "\xA0\x44" => "\xEC\x9E\xBB", + "\xA0\x45" => "\xEC\x9E\xBE", + "\xA0\x46" => "\xEC\x9F\x82", + "\xA0\x47" => "\xEC\x9F\x83", + "\xA0\x48" => "\xEC\x9F\x84", + "\xA0\x49" => "\xEC\x9F\x85", + "\xA0\x4A" => "\xEC\x9F\x86", + "\xA0\x4B" => "\xEC\x9F\x87", + "\xA0\x4C" => "\xEC\x9F\x8A", + "\xA0\x4D" => "\xEC\x9F\x8B", + "\xA0\x4E" => "\xEC\x9F\x8D", + "\xA0\x4F" => "\xEC\x9F\x8F", + "\xA0\x50" => "\xEC\x9F\x91", + "\xA0\x51" => "\xEC\x9F\x92", + "\xA0\x52" => "\xEC\x9F\x93", + "\xA0\x53" => "\xEC\x9F\x94", + "\xA0\x54" => "\xEC\x9F\x95", + "\xA0\x55" => "\xEC\x9F\x96", + "\xA0\x56" => "\xEC\x9F\x97", + "\xA0\x57" => "\xEC\x9F\x99", + "\xA0\x58" => "\xEC\x9F\x9A", + "\xA0\x59" => "\xEC\x9F\x9B", + "\xA0\x5A" => "\xEC\x9F\x9C", + "\xA0\x61" => "\xEC\x9F\x9E", + "\xA0\x62" => "\xEC\x9F\x9F", + "\xA0\x63" => "\xEC\x9F\xA0", + "\xA0\x64" => "\xEC\x9F\xA1", + "\xA0\x65" => "\xEC\x9F\xA2", + "\xA0\x66" => "\xEC\x9F\xA3", + "\xA0\x67" => "\xEC\x9F\xA5", + "\xA0\x68" => "\xEC\x9F\xA6", + "\xA0\x69" => "\xEC\x9F\xA7", + "\xA0\x6A" => "\xEC\x9F\xA9", + "\xA0\x6B" => "\xEC\x9F\xAA", + "\xA0\x6C" => "\xEC\x9F\xAB", + "\xA0\x6D" => "\xEC\x9F\xAD", + "\xA0\x6E" => "\xEC\x9F\xAE", + "\xA0\x6F" => "\xEC\x9F\xAF", + "\xA0\x70" => "\xEC\x9F\xB0", + "\xA0\x71" => "\xEC\x9F\xB1", + "\xA0\x72" => "\xEC\x9F\xB2", + "\xA0\x73" => "\xEC\x9F\xB3", + "\xA0\x74" => "\xEC\x9F\xB4", + "\xA0\x75" => "\xEC\x9F\xB5", + "\xA0\x76" => "\xEC\x9F\xB6", + "\xA0\x77" => "\xEC\x9F\xB7", + "\xA0\x78" => "\xEC\x9F\xB8", + "\xA0\x79" => "\xEC\x9F\xB9", + "\xA0\x7A" => "\xEC\x9F\xBA", + "\xA0\x81" => "\xEC\x9F\xBB", + "\xA0\x82" => "\xEC\x9F\xBC", + "\xA0\x83" => "\xEC\x9F\xBD", + "\xA0\x84" => "\xEC\x9F\xBE", + "\xA0\x85" => "\xEC\x9F\xBF", + "\xA0\x86" => "\xEC\xA0\x82", + "\xA0\x87" => "\xEC\xA0\x83", + "\xA0\x88" => "\xEC\xA0\x85", + "\xA0\x89" => "\xEC\xA0\x86", + "\xA0\x8A" => "\xEC\xA0\x87", + "\xA0\x8B" => "\xEC\xA0\x89", + "\xA0\x8C" => "\xEC\xA0\x8B", + "\xA0\x8D" => "\xEC\xA0\x8C", + "\xA0\x8E" => "\xEC\xA0\x8D", + "\xA0\x8F" => "\xEC\xA0\x8E", + "\xA0\x90" => "\xEC\xA0\x8F", + "\xA0\x91" => "\xEC\xA0\x92", + "\xA0\x92" => "\xEC\xA0\x94", + "\xA0\x93" => "\xEC\xA0\x97", + "\xA0\x94" => "\xEC\xA0\x98", + "\xA0\x95" => "\xEC\xA0\x99", + "\xA0\x96" => "\xEC\xA0\x9A", + "\xA0\x97" => "\xEC\xA0\x9B", + "\xA0\x98" => "\xEC\xA0\x9E", + "\xA0\x99" => "\xEC\xA0\x9F", + "\xA0\x9A" => "\xEC\xA0\xA1", + "\xA0\x9B" => "\xEC\xA0\xA2", + "\xA0\x9C" => "\xEC\xA0\xA3", + "\xA0\x9D" => "\xEC\xA0\xA5", + "\xA0\x9E" => "\xEC\xA0\xA6", + "\xA0\x9F" => "\xEC\xA0\xA7", + "\xA0\xA0" => "\xEC\xA0\xA8", + "\xA0\xA1" => "\xEC\xA0\xA9", + "\xA0\xA2" => "\xEC\xA0\xAA", + "\xA0\xA3" => "\xEC\xA0\xAB", + "\xA0\xA4" => "\xEC\xA0\xAE", + "\xA0\xA5" => "\xEC\xA0\xB0", + "\xA0\xA6" => "\xEC\xA0\xB2", + "\xA0\xA7" => "\xEC\xA0\xB3", + "\xA0\xA8" => "\xEC\xA0\xB4", + "\xA0\xA9" => "\xEC\xA0\xB5", + "\xA0\xAA" => "\xEC\xA0\xB6", + "\xA0\xAB" => "\xEC\xA0\xB7", + "\xA0\xAC" => "\xEC\xA0\xB9", + "\xA0\xAD" => "\xEC\xA0\xBA", + "\xA0\xAE" => "\xEC\xA0\xBB", + "\xA0\xAF" => "\xEC\xA0\xBD", + "\xA0\xB0" => "\xEC\xA0\xBE", + "\xA0\xB1" => "\xEC\xA0\xBF", + "\xA0\xB2" => "\xEC\xA1\x81", + "\xA0\xB3" => "\xEC\xA1\x82", + "\xA0\xB4" => "\xEC\xA1\x83", + "\xA0\xB5" => "\xEC\xA1\x84", + "\xA0\xB6" => "\xEC\xA1\x85", + "\xA0\xB7" => "\xEC\xA1\x86", + "\xA0\xB8" => "\xEC\xA1\x87", + "\xA0\xB9" => "\xEC\xA1\x8A", + "\xA0\xBA" => "\xEC\xA1\x8B", + "\xA0\xBB" => "\xEC\xA1\x8E", + "\xA0\xBC" => "\xEC\xA1\x8F", + "\xA0\xBD" => "\xEC\xA1\x90", + "\xA0\xBE" => "\xEC\xA1\x91", + "\xA0\xBF" => "\xEC\xA1\x92", + "\xA0\xC0" => "\xEC\xA1\x93", + "\xA0\xC1" => "\xEC\xA1\x95", + "\xA0\xC2" => "\xEC\xA1\x96", + "\xA0\xC3" => "\xEC\xA1\x97", + "\xA0\xC4" => "\xEC\xA1\x98", + "\xA0\xC5" => "\xEC\xA1\x99", + "\xA0\xC6" => "\xEC\xA1\x9A", + "\xA0\xC7" => "\xEC\xA1\x9B", + "\xA0\xC8" => "\xEC\xA1\x9C", + "\xA0\xC9" => "\xEC\xA1\x9D", + "\xA0\xCA" => "\xEC\xA1\x9E", + "\xA0\xCB" => "\xEC\xA1\x9F", + "\xA0\xCC" => "\xEC\xA1\xA0", + "\xA0\xCD" => "\xEC\xA1\xA1", + "\xA0\xCE" => "\xEC\xA1\xA2", + "\xA0\xCF" => "\xEC\xA1\xA3", + "\xA0\xD0" => "\xEC\xA1\xA4", + "\xA0\xD1" => "\xEC\xA1\xA5", + "\xA0\xD2" => "\xEC\xA1\xA6", + "\xA0\xD3" => "\xEC\xA1\xA7", + "\xA0\xD4" => "\xEC\xA1\xA8", + "\xA0\xD5" => "\xEC\xA1\xA9", + "\xA0\xD6" => "\xEC\xA1\xAA", + "\xA0\xD7" => "\xEC\xA1\xAB", + "\xA0\xD8" => "\xEC\xA1\xAC", + "\xA0\xD9" => "\xEC\xA1\xAD", + "\xA0\xDA" => "\xEC\xA1\xAE", + "\xA0\xDB" => "\xEC\xA1\xAF", + "\xA0\xDC" => "\xEC\xA1\xB2", + "\xA0\xDD" => "\xEC\xA1\xB3", + "\xA0\xDE" => "\xEC\xA1\xB5", + "\xA0\xDF" => "\xEC\xA1\xB6", + "\xA0\xE0" => "\xEC\xA1\xB7", + "\xA0\xE1" => "\xEC\xA1\xB9", + "\xA0\xE2" => "\xEC\xA1\xBB", + "\xA0\xE3" => "\xEC\xA1\xBC", + "\xA0\xE4" => "\xEC\xA1\xBD", + "\xA0\xE5" => "\xEC\xA1\xBE", + "\xA0\xE6" => "\xEC\xA1\xBF", + "\xA0\xE7" => "\xEC\xA2\x82", + "\xA0\xE8" => "\xEC\xA2\x84", + "\xA0\xE9" => "\xEC\xA2\x88", + "\xA0\xEA" => "\xEC\xA2\x89", + "\xA0\xEB" => "\xEC\xA2\x8A", + "\xA0\xEC" => "\xEC\xA2\x8E", + "\xA0\xED" => "\xEC\xA2\x8F", + "\xA0\xEE" => "\xEC\xA2\x90", + "\xA0\xEF" => "\xEC\xA2\x91", + "\xA0\xF0" => "\xEC\xA2\x92", + "\xA0\xF1" => "\xEC\xA2\x93", + "\xA0\xF2" => "\xEC\xA2\x95", + "\xA0\xF3" => "\xEC\xA2\x96", + "\xA0\xF4" => "\xEC\xA2\x97", + "\xA0\xF5" => "\xEC\xA2\x98", + "\xA0\xF6" => "\xEC\xA2\x99", + "\xA0\xF7" => "\xEC\xA2\x9A", + "\xA0\xF8" => "\xEC\xA2\x9B", + "\xA0\xF9" => "\xEC\xA2\x9C", + "\xA0\xFA" => "\xEC\xA2\x9E", + "\xA0\xFB" => "\xEC\xA2\xA0", + "\xA0\xFC" => "\xEC\xA2\xA2", + "\xA0\xFD" => "\xEC\xA2\xA3", + "\xA0\xFE" => "\xEC\xA2\xA4", + "\xA1\x41" => "\xEC\xA2\xA5", + "\xA1\x42" => "\xEC\xA2\xA6", + "\xA1\x43" => "\xEC\xA2\xA7", + "\xA1\x44" => "\xEC\xA2\xA9", + "\xA1\x45" => "\xEC\xA2\xAA", + "\xA1\x46" => "\xEC\xA2\xAB", + "\xA1\x47" => "\xEC\xA2\xAC", + "\xA1\x48" => "\xEC\xA2\xAD", + "\xA1\x49" => "\xEC\xA2\xAE", + "\xA1\x4A" => "\xEC\xA2\xAF", + "\xA1\x4B" => "\xEC\xA2\xB0", + "\xA1\x4C" => "\xEC\xA2\xB1", + "\xA1\x4D" => "\xEC\xA2\xB2", + "\xA1\x4E" => "\xEC\xA2\xB3", + "\xA1\x4F" => "\xEC\xA2\xB4", + "\xA1\x50" => "\xEC\xA2\xB5", + "\xA1\x51" => "\xEC\xA2\xB6", + "\xA1\x52" => "\xEC\xA2\xB7", + "\xA1\x53" => "\xEC\xA2\xB8", + "\xA1\x54" => "\xEC\xA2\xB9", + "\xA1\x55" => "\xEC\xA2\xBA", + "\xA1\x56" => "\xEC\xA2\xBB", + "\xA1\x57" => "\xEC\xA2\xBE", + "\xA1\x58" => "\xEC\xA2\xBF", + "\xA1\x59" => "\xEC\xA3\x80", + "\xA1\x5A" => "\xEC\xA3\x81", + "\xA1\x61" => "\xEC\xA3\x82", + "\xA1\x62" => "\xEC\xA3\x83", + "\xA1\x63" => "\xEC\xA3\x85", + "\xA1\x64" => "\xEC\xA3\x86", + "\xA1\x65" => "\xEC\xA3\x87", + "\xA1\x66" => "\xEC\xA3\x89", + "\xA1\x67" => "\xEC\xA3\x8A", + "\xA1\x68" => "\xEC\xA3\x8B", + "\xA1\x69" => "\xEC\xA3\x8D", + "\xA1\x6A" => "\xEC\xA3\x8E", + "\xA1\x6B" => "\xEC\xA3\x8F", + "\xA1\x6C" => "\xEC\xA3\x90", + "\xA1\x6D" => "\xEC\xA3\x91", + "\xA1\x6E" => "\xEC\xA3\x92", + "\xA1\x6F" => "\xEC\xA3\x93", + "\xA1\x70" => "\xEC\xA3\x96", + "\xA1\x71" => "\xEC\xA3\x98", + "\xA1\x72" => "\xEC\xA3\x9A", + "\xA1\x73" => "\xEC\xA3\x9B", + "\xA1\x74" => "\xEC\xA3\x9C", + "\xA1\x75" => "\xEC\xA3\x9D", + "\xA1\x76" => "\xEC\xA3\x9E", + "\xA1\x77" => "\xEC\xA3\x9F", + "\xA1\x78" => "\xEC\xA3\xA2", + "\xA1\x79" => "\xEC\xA3\xA3", + "\xA1\x7A" => "\xEC\xA3\xA5", + "\xA1\x81" => "\xEC\xA3\xA6", + "\xA1\x82" => "\xEC\xA3\xA7", + "\xA1\x83" => "\xEC\xA3\xA8", + "\xA1\x84" => "\xEC\xA3\xA9", + "\xA1\x85" => "\xEC\xA3\xAA", + "\xA1\x86" => "\xEC\xA3\xAB", + "\xA1\x87" => "\xEC\xA3\xAC", + "\xA1\x88" => "\xEC\xA3\xAD", + "\xA1\x89" => "\xEC\xA3\xAE", + "\xA1\x8A" => "\xEC\xA3\xAF", + "\xA1\x8B" => "\xEC\xA3\xB0", + "\xA1\x8C" => "\xEC\xA3\xB1", + "\xA1\x8D" => "\xEC\xA3\xB2", + "\xA1\x8E" => "\xEC\xA3\xB3", + "\xA1\x8F" => "\xEC\xA3\xB4", + "\xA1\x90" => "\xEC\xA3\xB6", + "\xA1\x91" => "\xEC\xA3\xB7", + "\xA1\x92" => "\xEC\xA3\xB8", + "\xA1\x93" => "\xEC\xA3\xB9", + "\xA1\x94" => "\xEC\xA3\xBA", + "\xA1\x95" => "\xEC\xA3\xBB", + "\xA1\x96" => "\xEC\xA3\xBE", + "\xA1\x97" => "\xEC\xA3\xBF", + "\xA1\x98" => "\xEC\xA4\x81", + "\xA1\x99" => "\xEC\xA4\x82", + "\xA1\x9A" => "\xEC\xA4\x83", + "\xA1\x9B" => "\xEC\xA4\x87", + "\xA1\x9C" => "\xEC\xA4\x88", + "\xA1\x9D" => "\xEC\xA4\x89", + "\xA1\x9E" => "\xEC\xA4\x8A", + "\xA1\x9F" => "\xEC\xA4\x8B", + "\xA1\xA0" => "\xEC\xA4\x8E", + "\xA1\xA1" => "\xE3\x80\x80", + "\xA1\xA2" => "\xE3\x80\x81", + "\xA1\xA3" => "\xE3\x80\x82", + "\xA1\xA4" => "\xC2\xB7", + "\xA1\xA5" => "\xE2\x80\xA5", + "\xA1\xA6" => "\xE2\x80\xA6", + "\xA1\xA7" => "\xC2\xA8", + "\xA1\xA8" => "\xE3\x80\x83", + "\xA1\xA9" => "\xC2\xAD", + "\xA1\xAA" => "\xE2\x80\x95", + "\xA1\xAB" => "\xE2\x88\xA5", + "\xA1\xAC" => "\xEF\xBC\xBC", + "\xA1\xAD" => "\xE2\x88\xBC", + "\xA1\xAE" => "\xE2\x80\x98", + "\xA1\xAF" => "\xE2\x80\x99", + "\xA1\xB0" => "\xE2\x80\x9C", + "\xA1\xB1" => "\xE2\x80\x9D", + "\xA1\xB2" => "\xE3\x80\x94", + "\xA1\xB3" => "\xE3\x80\x95", + "\xA1\xB4" => "\xE3\x80\x88", + "\xA1\xB5" => "\xE3\x80\x89", + "\xA1\xB6" => "\xE3\x80\x8A", + "\xA1\xB7" => "\xE3\x80\x8B", + "\xA1\xB8" => "\xE3\x80\x8C", + "\xA1\xB9" => "\xE3\x80\x8D", + "\xA1\xBA" => "\xE3\x80\x8E", + "\xA1\xBB" => "\xE3\x80\x8F", + "\xA1\xBC" => "\xE3\x80\x90", + "\xA1\xBD" => "\xE3\x80\x91", + "\xA1\xBE" => "\xC2\xB1", + "\xA1\xBF" => "\xC3\x97", + "\xA1\xC0" => "\xC3\xB7", + "\xA1\xC1" => "\xE2\x89\xA0", + "\xA1\xC2" => "\xE2\x89\xA4", + "\xA1\xC3" => "\xE2\x89\xA5", + "\xA1\xC4" => "\xE2\x88\x9E", + "\xA1\xC5" => "\xE2\x88\xB4", + "\xA1\xC6" => "\xC2\xB0", + "\xA1\xC7" => "\xE2\x80\xB2", + "\xA1\xC8" => "\xE2\x80\xB3", + "\xA1\xC9" => "\xE2\x84\x83", + "\xA1\xCA" => "\xE2\x84\xAB", + "\xA1\xCB" => "\xEF\xBF\xA0", + "\xA1\xCC" => "\xEF\xBF\xA1", + "\xA1\xCD" => "\xEF\xBF\xA5", + "\xA1\xCE" => "\xE2\x99\x82", + "\xA1\xCF" => "\xE2\x99\x80", + "\xA1\xD0" => "\xE2\x88\xA0", + "\xA1\xD1" => "\xE2\x8A\xA5", + "\xA1\xD2" => "\xE2\x8C\x92", + "\xA1\xD3" => "\xE2\x88\x82", + "\xA1\xD4" => "\xE2\x88\x87", + "\xA1\xD5" => "\xE2\x89\xA1", + "\xA1\xD6" => "\xE2\x89\x92", + "\xA1\xD7" => "\xC2\xA7", + "\xA1\xD8" => "\xE2\x80\xBB", + "\xA1\xD9" => "\xE2\x98\x86", + "\xA1\xDA" => "\xE2\x98\x85", + "\xA1\xDB" => "\xE2\x97\x8B", + "\xA1\xDC" => "\xE2\x97\x8F", + "\xA1\xDD" => "\xE2\x97\x8E", + "\xA1\xDE" => "\xE2\x97\x87", + "\xA1\xDF" => "\xE2\x97\x86", + "\xA1\xE0" => "\xE2\x96\xA1", + "\xA1\xE1" => "\xE2\x96\xA0", + "\xA1\xE2" => "\xE2\x96\xB3", + "\xA1\xE3" => "\xE2\x96\xB2", + "\xA1\xE4" => "\xE2\x96\xBD", + "\xA1\xE5" => "\xE2\x96\xBC", + "\xA1\xE6" => "\xE2\x86\x92", + "\xA1\xE7" => "\xE2\x86\x90", + "\xA1\xE8" => "\xE2\x86\x91", + "\xA1\xE9" => "\xE2\x86\x93", + "\xA1\xEA" => "\xE2\x86\x94", + "\xA1\xEB" => "\xE3\x80\x93", + "\xA1\xEC" => "\xE2\x89\xAA", + "\xA1\xED" => "\xE2\x89\xAB", + "\xA1\xEE" => "\xE2\x88\x9A", + "\xA1\xEF" => "\xE2\x88\xBD", + "\xA1\xF0" => "\xE2\x88\x9D", + "\xA1\xF1" => "\xE2\x88\xB5", + "\xA1\xF2" => "\xE2\x88\xAB", + "\xA1\xF3" => "\xE2\x88\xAC", + "\xA1\xF4" => "\xE2\x88\x88", + "\xA1\xF5" => "\xE2\x88\x8B", + "\xA1\xF6" => "\xE2\x8A\x86", + "\xA1\xF7" => "\xE2\x8A\x87", + "\xA1\xF8" => "\xE2\x8A\x82", + "\xA1\xF9" => "\xE2\x8A\x83", + "\xA1\xFA" => "\xE2\x88\xAA", + "\xA1\xFB" => "\xE2\x88\xA9", + "\xA1\xFC" => "\xE2\x88\xA7", + "\xA1\xFD" => "\xE2\x88\xA8", + "\xA1\xFE" => "\xEF\xBF\xA2", + "\xA2\x41" => "\xEC\xA4\x90", + "\xA2\x42" => "\xEC\xA4\x92", + "\xA2\x43" => "\xEC\xA4\x93", + "\xA2\x44" => "\xEC\xA4\x94", + "\xA2\x45" => "\xEC\xA4\x95", + "\xA2\x46" => "\xEC\xA4\x96", + "\xA2\x47" => "\xEC\xA4\x97", + "\xA2\x48" => "\xEC\xA4\x99", + "\xA2\x49" => "\xEC\xA4\x9A", + "\xA2\x4A" => "\xEC\xA4\x9B", + "\xA2\x4B" => "\xEC\xA4\x9C", + "\xA2\x4C" => "\xEC\xA4\x9D", + "\xA2\x4D" => "\xEC\xA4\x9E", + "\xA2\x4E" => "\xEC\xA4\x9F", + "\xA2\x4F" => "\xEC\xA4\xA0", + "\xA2\x50" => "\xEC\xA4\xA1", + "\xA2\x51" => "\xEC\xA4\xA2", + "\xA2\x52" => "\xEC\xA4\xA3", + "\xA2\x53" => "\xEC\xA4\xA4", + "\xA2\x54" => "\xEC\xA4\xA5", + "\xA2\x55" => "\xEC\xA4\xA6", + "\xA2\x56" => "\xEC\xA4\xA7", + "\xA2\x57" => "\xEC\xA4\xA8", + "\xA2\x58" => "\xEC\xA4\xA9", + "\xA2\x59" => "\xEC\xA4\xAA", + "\xA2\x5A" => "\xEC\xA4\xAB", + "\xA2\x61" => "\xEC\xA4\xAD", + "\xA2\x62" => "\xEC\xA4\xAE", + "\xA2\x63" => "\xEC\xA4\xAF", + "\xA2\x64" => "\xEC\xA4\xB0", + "\xA2\x65" => "\xEC\xA4\xB1", + "\xA2\x66" => "\xEC\xA4\xB2", + "\xA2\x67" => "\xEC\xA4\xB3", + "\xA2\x68" => "\xEC\xA4\xB5", + "\xA2\x69" => "\xEC\xA4\xB6", + "\xA2\x6A" => "\xEC\xA4\xB7", + "\xA2\x6B" => "\xEC\xA4\xB8", + "\xA2\x6C" => "\xEC\xA4\xB9", + "\xA2\x6D" => "\xEC\xA4\xBA", + "\xA2\x6E" => "\xEC\xA4\xBB", + "\xA2\x6F" => "\xEC\xA4\xBC", + "\xA2\x70" => "\xEC\xA4\xBD", + "\xA2\x71" => "\xEC\xA4\xBE", + "\xA2\x72" => "\xEC\xA4\xBF", + "\xA2\x73" => "\xEC\xA5\x80", + "\xA2\x74" => "\xEC\xA5\x81", + "\xA2\x75" => "\xEC\xA5\x82", + "\xA2\x76" => "\xEC\xA5\x83", + "\xA2\x77" => "\xEC\xA5\x84", + "\xA2\x78" => "\xEC\xA5\x85", + "\xA2\x79" => "\xEC\xA5\x86", + "\xA2\x7A" => "\xEC\xA5\x87", + "\xA2\x81" => "\xEC\xA5\x88", + "\xA2\x82" => "\xEC\xA5\x89", + "\xA2\x83" => "\xEC\xA5\x8A", + "\xA2\x84" => "\xEC\xA5\x8B", + "\xA2\x85" => "\xEC\xA5\x8C", + "\xA2\x86" => "\xEC\xA5\x8D", + "\xA2\x87" => "\xEC\xA5\x8E", + "\xA2\x88" => "\xEC\xA5\x8F", + "\xA2\x89" => "\xEC\xA5\x92", + "\xA2\x8A" => "\xEC\xA5\x93", + "\xA2\x8B" => "\xEC\xA5\x95", + "\xA2\x8C" => "\xEC\xA5\x96", + "\xA2\x8D" => "\xEC\xA5\x97", + "\xA2\x8E" => "\xEC\xA5\x99", + "\xA2\x8F" => "\xEC\xA5\x9A", + "\xA2\x90" => "\xEC\xA5\x9B", + "\xA2\x91" => "\xEC\xA5\x9C", + "\xA2\x92" => "\xEC\xA5\x9D", + "\xA2\x93" => "\xEC\xA5\x9E", + "\xA2\x94" => "\xEC\xA5\x9F", + "\xA2\x95" => "\xEC\xA5\xA2", + "\xA2\x96" => "\xEC\xA5\xA4", + "\xA2\x97" => "\xEC\xA5\xA5", + "\xA2\x98" => "\xEC\xA5\xA6", + "\xA2\x99" => "\xEC\xA5\xA7", + "\xA2\x9A" => "\xEC\xA5\xA8", + "\xA2\x9B" => "\xEC\xA5\xA9", + "\xA2\x9C" => "\xEC\xA5\xAA", + "\xA2\x9D" => "\xEC\xA5\xAB", + "\xA2\x9E" => "\xEC\xA5\xAD", + "\xA2\x9F" => "\xEC\xA5\xAE", + "\xA2\xA0" => "\xEC\xA5\xAF", + "\xA2\xA1" => "\xE2\x87\x92", + "\xA2\xA2" => "\xE2\x87\x94", + "\xA2\xA3" => "\xE2\x88\x80", + "\xA2\xA4" => "\xE2\x88\x83", + "\xA2\xA5" => "\xC2\xB4", + "\xA2\xA6" => "\xEF\xBD\x9E", + "\xA2\xA7" => "\xCB\x87", + "\xA2\xA8" => "\xCB\x98", + "\xA2\xA9" => "\xCB\x9D", + "\xA2\xAA" => "\xCB\x9A", + "\xA2\xAB" => "\xCB\x99", + "\xA2\xAC" => "\xC2\xB8", + "\xA2\xAD" => "\xCB\x9B", + "\xA2\xAE" => "\xC2\xA1", + "\xA2\xAF" => "\xC2\xBF", + "\xA2\xB0" => "\xCB\x90", + "\xA2\xB1" => "\xE2\x88\xAE", + "\xA2\xB2" => "\xE2\x88\x91", + "\xA2\xB3" => "\xE2\x88\x8F", + "\xA2\xB4" => "\xC2\xA4", + "\xA2\xB5" => "\xE2\x84\x89", + "\xA2\xB6" => "\xE2\x80\xB0", + "\xA2\xB7" => "\xE2\x97\x81", + "\xA2\xB8" => "\xE2\x97\x80", + "\xA2\xB9" => "\xE2\x96\xB7", + "\xA2\xBA" => "\xE2\x96\xB6", + "\xA2\xBB" => "\xE2\x99\xA4", + "\xA2\xBC" => "\xE2\x99\xA0", + "\xA2\xBD" => "\xE2\x99\xA1", + "\xA2\xBE" => "\xE2\x99\xA5", + "\xA2\xBF" => "\xE2\x99\xA7", + "\xA2\xC0" => "\xE2\x99\xA3", + "\xA2\xC1" => "\xE2\x8A\x99", + "\xA2\xC2" => "\xE2\x97\x88", + "\xA2\xC3" => "\xE2\x96\xA3", + "\xA2\xC4" => "\xE2\x97\x90", + "\xA2\xC5" => "\xE2\x97\x91", + "\xA2\xC6" => "\xE2\x96\x92", + "\xA2\xC7" => "\xE2\x96\xA4", + "\xA2\xC8" => "\xE2\x96\xA5", + "\xA2\xC9" => "\xE2\x96\xA8", + "\xA2\xCA" => "\xE2\x96\xA7", + "\xA2\xCB" => "\xE2\x96\xA6", + "\xA2\xCC" => "\xE2\x96\xA9", + "\xA2\xCD" => "\xE2\x99\xA8", + "\xA2\xCE" => "\xE2\x98\x8F", + "\xA2\xCF" => "\xE2\x98\x8E", + "\xA2\xD0" => "\xE2\x98\x9C", + "\xA2\xD1" => "\xE2\x98\x9E", + "\xA2\xD2" => "\xC2\xB6", + "\xA2\xD3" => "\xE2\x80\xA0", + "\xA2\xD4" => "\xE2\x80\xA1", + "\xA2\xD5" => "\xE2\x86\x95", + "\xA2\xD6" => "\xE2\x86\x97", + "\xA2\xD7" => "\xE2\x86\x99", + "\xA2\xD8" => "\xE2\x86\x96", + "\xA2\xD9" => "\xE2\x86\x98", + "\xA2\xDA" => "\xE2\x99\xAD", + "\xA2\xDB" => "\xE2\x99\xA9", + "\xA2\xDC" => "\xE2\x99\xAA", + "\xA2\xDD" => "\xE2\x99\xAC", + "\xA2\xDE" => "\xE3\x89\xBF", + "\xA2\xDF" => "\xE3\x88\x9C", + "\xA2\xE0" => "\xE2\x84\x96", + "\xA2\xE1" => "\xE3\x8F\x87", + "\xA2\xE2" => "\xE2\x84\xA2", + "\xA2\xE3" => "\xE3\x8F\x82", + "\xA2\xE4" => "\xE3\x8F\x98", + "\xA2\xE5" => "\xE2\x84\xA1", + "\xA3\x41" => "\xEC\xA5\xB1", + "\xA3\x42" => "\xEC\xA5\xB2", + "\xA3\x43" => "\xEC\xA5\xB3", + "\xA3\x44" => "\xEC\xA5\xB5", + "\xA3\x45" => "\xEC\xA5\xB6", + "\xA3\x46" => "\xEC\xA5\xB7", + "\xA3\x47" => "\xEC\xA5\xB8", + "\xA3\x48" => "\xEC\xA5\xB9", + "\xA3\x49" => "\xEC\xA5\xBA", + "\xA3\x4A" => "\xEC\xA5\xBB", + "\xA3\x4B" => "\xEC\xA5\xBD", + "\xA3\x4C" => "\xEC\xA5\xBE", + "\xA3\x4D" => "\xEC\xA5\xBF", + "\xA3\x4E" => "\xEC\xA6\x80", + "\xA3\x4F" => "\xEC\xA6\x81", + "\xA3\x50" => "\xEC\xA6\x82", + "\xA3\x51" => "\xEC\xA6\x83", + "\xA3\x52" => "\xEC\xA6\x84", + "\xA3\x53" => "\xEC\xA6\x85", + "\xA3\x54" => "\xEC\xA6\x86", + "\xA3\x55" => "\xEC\xA6\x87", + "\xA3\x56" => "\xEC\xA6\x8A", + "\xA3\x57" => "\xEC\xA6\x8B", + "\xA3\x58" => "\xEC\xA6\x8D", + "\xA3\x59" => "\xEC\xA6\x8E", + "\xA3\x5A" => "\xEC\xA6\x8F", + "\xA3\x61" => "\xEC\xA6\x91", + "\xA3\x62" => "\xEC\xA6\x92", + "\xA3\x63" => "\xEC\xA6\x93", + "\xA3\x64" => "\xEC\xA6\x94", + "\xA3\x65" => "\xEC\xA6\x95", + "\xA3\x66" => "\xEC\xA6\x96", + "\xA3\x67" => "\xEC\xA6\x97", + "\xA3\x68" => "\xEC\xA6\x9A", + "\xA3\x69" => "\xEC\xA6\x9C", + "\xA3\x6A" => "\xEC\xA6\x9E", + "\xA3\x6B" => "\xEC\xA6\x9F", + "\xA3\x6C" => "\xEC\xA6\xA0", + "\xA3\x6D" => "\xEC\xA6\xA1", + "\xA3\x6E" => "\xEC\xA6\xA2", + "\xA3\x6F" => "\xEC\xA6\xA3", + "\xA3\x70" => "\xEC\xA6\xA4", + "\xA3\x71" => "\xEC\xA6\xA5", + "\xA3\x72" => "\xEC\xA6\xA6", + "\xA3\x73" => "\xEC\xA6\xA7", + "\xA3\x74" => "\xEC\xA6\xA8", + "\xA3\x75" => "\xEC\xA6\xA9", + "\xA3\x76" => "\xEC\xA6\xAA", + "\xA3\x77" => "\xEC\xA6\xAB", + "\xA3\x78" => "\xEC\xA6\xAC", + "\xA3\x79" => "\xEC\xA6\xAD", + "\xA3\x7A" => "\xEC\xA6\xAE", + "\xA3\x81" => "\xEC\xA6\xAF", + "\xA3\x82" => "\xEC\xA6\xB0", + "\xA3\x83" => "\xEC\xA6\xB1", + "\xA3\x84" => "\xEC\xA6\xB2", + "\xA3\x85" => "\xEC\xA6\xB3", + "\xA3\x86" => "\xEC\xA6\xB4", + "\xA3\x87" => "\xEC\xA6\xB5", + "\xA3\x88" => "\xEC\xA6\xB6", + "\xA3\x89" => "\xEC\xA6\xB7", + "\xA3\x8A" => "\xEC\xA6\xB8", + "\xA3\x8B" => "\xEC\xA6\xB9", + "\xA3\x8C" => "\xEC\xA6\xBA", + "\xA3\x8D" => "\xEC\xA6\xBB", + "\xA3\x8E" => "\xEC\xA6\xBC", + "\xA3\x8F" => "\xEC\xA6\xBD", + "\xA3\x90" => "\xEC\xA6\xBE", + "\xA3\x91" => "\xEC\xA6\xBF", + "\xA3\x92" => "\xEC\xA7\x82", + "\xA3\x93" => "\xEC\xA7\x83", + "\xA3\x94" => "\xEC\xA7\x85", + "\xA3\x95" => "\xEC\xA7\x86", + "\xA3\x96" => "\xEC\xA7\x89", + "\xA3\x97" => "\xEC\xA7\x8B", + "\xA3\x98" => "\xEC\xA7\x8C", + "\xA3\x99" => "\xEC\xA7\x8D", + "\xA3\x9A" => "\xEC\xA7\x8E", + "\xA3\x9B" => "\xEC\xA7\x8F", + "\xA3\x9C" => "\xEC\xA7\x92", + "\xA3\x9D" => "\xEC\xA7\x94", + "\xA3\x9E" => "\xEC\xA7\x97", + "\xA3\x9F" => "\xEC\xA7\x98", + "\xA3\xA0" => "\xEC\xA7\x9B", + "\xA3\xA1" => "\xEF\xBC\x81", + "\xA3\xA2" => "\xEF\xBC\x82", + "\xA3\xA3" => "\xEF\xBC\x83", + "\xA3\xA4" => "\xEF\xBC\x84", + "\xA3\xA5" => "\xEF\xBC\x85", + "\xA3\xA6" => "\xEF\xBC\x86", + "\xA3\xA7" => "\xEF\xBC\x87", + "\xA3\xA8" => "\xEF\xBC\x88", + "\xA3\xA9" => "\xEF\xBC\x89", + "\xA3\xAA" => "\xEF\xBC\x8A", + "\xA3\xAB" => "\xEF\xBC\x8B", + "\xA3\xAC" => "\xEF\xBC\x8C", + "\xA3\xAD" => "\xEF\xBC\x8D", + "\xA3\xAE" => "\xEF\xBC\x8E", + "\xA3\xAF" => "\xEF\xBC\x8F", + "\xA3\xB0" => "\xEF\xBC\x90", + "\xA3\xB1" => "\xEF\xBC\x91", + "\xA3\xB2" => "\xEF\xBC\x92", + "\xA3\xB3" => "\xEF\xBC\x93", + "\xA3\xB4" => "\xEF\xBC\x94", + "\xA3\xB5" => "\xEF\xBC\x95", + "\xA3\xB6" => "\xEF\xBC\x96", + "\xA3\xB7" => "\xEF\xBC\x97", + "\xA3\xB8" => "\xEF\xBC\x98", + "\xA3\xB9" => "\xEF\xBC\x99", + "\xA3\xBA" => "\xEF\xBC\x9A", + "\xA3\xBB" => "\xEF\xBC\x9B", + "\xA3\xBC" => "\xEF\xBC\x9C", + "\xA3\xBD" => "\xEF\xBC\x9D", + "\xA3\xBE" => "\xEF\xBC\x9E", + "\xA3\xBF" => "\xEF\xBC\x9F", + "\xA3\xC0" => "\xEF\xBC\xA0", + "\xA3\xC1" => "\xEF\xBC\xA1", + "\xA3\xC2" => "\xEF\xBC\xA2", + "\xA3\xC3" => "\xEF\xBC\xA3", + "\xA3\xC4" => "\xEF\xBC\xA4", + "\xA3\xC5" => "\xEF\xBC\xA5", + "\xA3\xC6" => "\xEF\xBC\xA6", + "\xA3\xC7" => "\xEF\xBC\xA7", + "\xA3\xC8" => "\xEF\xBC\xA8", + "\xA3\xC9" => "\xEF\xBC\xA9", + "\xA3\xCA" => "\xEF\xBC\xAA", + "\xA3\xCB" => "\xEF\xBC\xAB", + "\xA3\xCC" => "\xEF\xBC\xAC", + "\xA3\xCD" => "\xEF\xBC\xAD", + "\xA3\xCE" => "\xEF\xBC\xAE", + "\xA3\xCF" => "\xEF\xBC\xAF", + "\xA3\xD0" => "\xEF\xBC\xB0", + "\xA3\xD1" => "\xEF\xBC\xB1", + "\xA3\xD2" => "\xEF\xBC\xB2", + "\xA3\xD3" => "\xEF\xBC\xB3", + "\xA3\xD4" => "\xEF\xBC\xB4", + "\xA3\xD5" => "\xEF\xBC\xB5", + "\xA3\xD6" => "\xEF\xBC\xB6", + "\xA3\xD7" => "\xEF\xBC\xB7", + "\xA3\xD8" => "\xEF\xBC\xB8", + "\xA3\xD9" => "\xEF\xBC\xB9", + "\xA3\xDA" => "\xEF\xBC\xBA", + "\xA3\xDB" => "\xEF\xBC\xBB", + "\xA3\xDC" => "\xEF\xBF\xA6", + "\xA3\xDD" => "\xEF\xBC\xBD", + "\xA3\xDE" => "\xEF\xBC\xBE", + "\xA3\xDF" => "\xEF\xBC\xBF", + "\xA3\xE0" => "\xEF\xBD\x80", + "\xA3\xE1" => "\xEF\xBD\x81", + "\xA3\xE2" => "\xEF\xBD\x82", + "\xA3\xE3" => "\xEF\xBD\x83", + "\xA3\xE4" => "\xEF\xBD\x84", + "\xA3\xE5" => "\xEF\xBD\x85", + "\xA3\xE6" => "\xEF\xBD\x86", + "\xA3\xE7" => "\xEF\xBD\x87", + "\xA3\xE8" => "\xEF\xBD\x88", + "\xA3\xE9" => "\xEF\xBD\x89", + "\xA3\xEA" => "\xEF\xBD\x8A", + "\xA3\xEB" => "\xEF\xBD\x8B", + "\xA3\xEC" => "\xEF\xBD\x8C", + "\xA3\xED" => "\xEF\xBD\x8D", + "\xA3\xEE" => "\xEF\xBD\x8E", + "\xA3\xEF" => "\xEF\xBD\x8F", + "\xA3\xF0" => "\xEF\xBD\x90", + "\xA3\xF1" => "\xEF\xBD\x91", + "\xA3\xF2" => "\xEF\xBD\x92", + "\xA3\xF3" => "\xEF\xBD\x93", + "\xA3\xF4" => "\xEF\xBD\x94", + "\xA3\xF5" => "\xEF\xBD\x95", + "\xA3\xF6" => "\xEF\xBD\x96", + "\xA3\xF7" => "\xEF\xBD\x97", + "\xA3\xF8" => "\xEF\xBD\x98", + "\xA3\xF9" => "\xEF\xBD\x99", + "\xA3\xFA" => "\xEF\xBD\x9A", + "\xA3\xFB" => "\xEF\xBD\x9B", + "\xA3\xFC" => "\xEF\xBD\x9C", + "\xA3\xFD" => "\xEF\xBD\x9D", + "\xA3\xFE" => "\xEF\xBF\xA3", + "\xA4\x41" => "\xEC\xA7\x9E", + "\xA4\x42" => "\xEC\xA7\x9F", + "\xA4\x43" => "\xEC\xA7\xA1", + "\xA4\x44" => "\xEC\xA7\xA3", + "\xA4\x45" => "\xEC\xA7\xA5", + "\xA4\x46" => "\xEC\xA7\xA6", + "\xA4\x47" => "\xEC\xA7\xA8", + "\xA4\x48" => "\xEC\xA7\xA9", + "\xA4\x49" => "\xEC\xA7\xAA", + "\xA4\x4A" => "\xEC\xA7\xAB", + "\xA4\x4B" => "\xEC\xA7\xAE", + "\xA4\x4C" => "\xEC\xA7\xB2", + "\xA4\x4D" => "\xEC\xA7\xB3", + "\xA4\x4E" => "\xEC\xA7\xB4", + "\xA4\x4F" => "\xEC\xA7\xB5", + "\xA4\x50" => "\xEC\xA7\xB6", + "\xA4\x51" => "\xEC\xA7\xB7", + "\xA4\x52" => "\xEC\xA7\xBA", + "\xA4\x53" => "\xEC\xA7\xBB", + "\xA4\x54" => "\xEC\xA7\xBD", + "\xA4\x55" => "\xEC\xA7\xBE", + "\xA4\x56" => "\xEC\xA7\xBF", + "\xA4\x57" => "\xEC\xA8\x81", + "\xA4\x58" => "\xEC\xA8\x82", + "\xA4\x59" => "\xEC\xA8\x83", + "\xA4\x5A" => "\xEC\xA8\x84", + "\xA4\x61" => "\xEC\xA8\x85", + "\xA4\x62" => "\xEC\xA8\x86", + "\xA4\x63" => "\xEC\xA8\x87", + "\xA4\x64" => "\xEC\xA8\x8A", + "\xA4\x65" => "\xEC\xA8\x8E", + "\xA4\x66" => "\xEC\xA8\x8F", + "\xA4\x67" => "\xEC\xA8\x90", + "\xA4\x68" => "\xEC\xA8\x91", + "\xA4\x69" => "\xEC\xA8\x92", + "\xA4\x6A" => "\xEC\xA8\x93", + "\xA4\x6B" => "\xEC\xA8\x95", + "\xA4\x6C" => "\xEC\xA8\x96", + "\xA4\x6D" => "\xEC\xA8\x97", + "\xA4\x6E" => "\xEC\xA8\x99", + "\xA4\x6F" => "\xEC\xA8\x9A", + "\xA4\x70" => "\xEC\xA8\x9B", + "\xA4\x71" => "\xEC\xA8\x9C", + "\xA4\x72" => "\xEC\xA8\x9D", + "\xA4\x73" => "\xEC\xA8\x9E", + "\xA4\x74" => "\xEC\xA8\x9F", + "\xA4\x75" => "\xEC\xA8\xA0", + "\xA4\x76" => "\xEC\xA8\xA1", + "\xA4\x77" => "\xEC\xA8\xA2", + "\xA4\x78" => "\xEC\xA8\xA3", + "\xA4\x79" => "\xEC\xA8\xA4", + "\xA4\x7A" => "\xEC\xA8\xA5", + "\xA4\x81" => "\xEC\xA8\xA6", + "\xA4\x82" => "\xEC\xA8\xA7", + "\xA4\x83" => "\xEC\xA8\xA8", + "\xA4\x84" => "\xEC\xA8\xAA", + "\xA4\x85" => "\xEC\xA8\xAB", + "\xA4\x86" => "\xEC\xA8\xAC", + "\xA4\x87" => "\xEC\xA8\xAD", + "\xA4\x88" => "\xEC\xA8\xAE", + "\xA4\x89" => "\xEC\xA8\xAF", + "\xA4\x8A" => "\xEC\xA8\xB0", + "\xA4\x8B" => "\xEC\xA8\xB1", + "\xA4\x8C" => "\xEC\xA8\xB2", + "\xA4\x8D" => "\xEC\xA8\xB3", + "\xA4\x8E" => "\xEC\xA8\xB4", + "\xA4\x8F" => "\xEC\xA8\xB5", + "\xA4\x90" => "\xEC\xA8\xB6", + "\xA4\x91" => "\xEC\xA8\xB7", + "\xA4\x92" => "\xEC\xA8\xB8", + "\xA4\x93" => "\xEC\xA8\xB9", + "\xA4\x94" => "\xEC\xA8\xBA", + "\xA4\x95" => "\xEC\xA8\xBB", + "\xA4\x96" => "\xEC\xA8\xBC", + "\xA4\x97" => "\xEC\xA8\xBD", + "\xA4\x98" => "\xEC\xA8\xBE", + "\xA4\x99" => "\xEC\xA8\xBF", + "\xA4\x9A" => "\xEC\xA9\x80", + "\xA4\x9B" => "\xEC\xA9\x81", + "\xA4\x9C" => "\xEC\xA9\x82", + "\xA4\x9D" => "\xEC\xA9\x83", + "\xA4\x9E" => "\xEC\xA9\x84", + "\xA4\x9F" => "\xEC\xA9\x85", + "\xA4\xA0" => "\xEC\xA9\x86", + "\xA4\xA1" => "\xE3\x84\xB1", + "\xA4\xA2" => "\xE3\x84\xB2", + "\xA4\xA3" => "\xE3\x84\xB3", + "\xA4\xA4" => "\xE3\x84\xB4", + "\xA4\xA5" => "\xE3\x84\xB5", + "\xA4\xA6" => "\xE3\x84\xB6", + "\xA4\xA7" => "\xE3\x84\xB7", + "\xA4\xA8" => "\xE3\x84\xB8", + "\xA4\xA9" => "\xE3\x84\xB9", + "\xA4\xAA" => "\xE3\x84\xBA", + "\xA4\xAB" => "\xE3\x84\xBB", + "\xA4\xAC" => "\xE3\x84\xBC", + "\xA4\xAD" => "\xE3\x84\xBD", + "\xA4\xAE" => "\xE3\x84\xBE", + "\xA4\xAF" => "\xE3\x84\xBF", + "\xA4\xB0" => "\xE3\x85\x80", + "\xA4\xB1" => "\xE3\x85\x81", + "\xA4\xB2" => "\xE3\x85\x82", + "\xA4\xB3" => "\xE3\x85\x83", + "\xA4\xB4" => "\xE3\x85\x84", + "\xA4\xB5" => "\xE3\x85\x85", + "\xA4\xB6" => "\xE3\x85\x86", + "\xA4\xB7" => "\xE3\x85\x87", + "\xA4\xB8" => "\xE3\x85\x88", + "\xA4\xB9" => "\xE3\x85\x89", + "\xA4\xBA" => "\xE3\x85\x8A", + "\xA4\xBB" => "\xE3\x85\x8B", + "\xA4\xBC" => "\xE3\x85\x8C", + "\xA4\xBD" => "\xE3\x85\x8D", + "\xA4\xBE" => "\xE3\x85\x8E", + "\xA4\xBF" => "\xE3\x85\x8F", + "\xA4\xC0" => "\xE3\x85\x90", + "\xA4\xC1" => "\xE3\x85\x91", + "\xA4\xC2" => "\xE3\x85\x92", + "\xA4\xC3" => "\xE3\x85\x93", + "\xA4\xC4" => "\xE3\x85\x94", + "\xA4\xC5" => "\xE3\x85\x95", + "\xA4\xC6" => "\xE3\x85\x96", + "\xA4\xC7" => "\xE3\x85\x97", + "\xA4\xC8" => "\xE3\x85\x98", + "\xA4\xC9" => "\xE3\x85\x99", + "\xA4\xCA" => "\xE3\x85\x9A", + "\xA4\xCB" => "\xE3\x85\x9B", + "\xA4\xCC" => "\xE3\x85\x9C", + "\xA4\xCD" => "\xE3\x85\x9D", + "\xA4\xCE" => "\xE3\x85\x9E", + "\xA4\xCF" => "\xE3\x85\x9F", + "\xA4\xD0" => "\xE3\x85\xA0", + "\xA4\xD1" => "\xE3\x85\xA1", + "\xA4\xD2" => "\xE3\x85\xA2", + "\xA4\xD3" => "\xE3\x85\xA3", + "\xA4\xD4" => "\xE3\x85\xA4", + "\xA4\xD5" => "\xE3\x85\xA5", + "\xA4\xD6" => "\xE3\x85\xA6", + "\xA4\xD7" => "\xE3\x85\xA7", + "\xA4\xD8" => "\xE3\x85\xA8", + "\xA4\xD9" => "\xE3\x85\xA9", + "\xA4\xDA" => "\xE3\x85\xAA", + "\xA4\xDB" => "\xE3\x85\xAB", + "\xA4\xDC" => "\xE3\x85\xAC", + "\xA4\xDD" => "\xE3\x85\xAD", + "\xA4\xDE" => "\xE3\x85\xAE", + "\xA4\xDF" => "\xE3\x85\xAF", + "\xA4\xE0" => "\xE3\x85\xB0", + "\xA4\xE1" => "\xE3\x85\xB1", + "\xA4\xE2" => "\xE3\x85\xB2", + "\xA4\xE3" => "\xE3\x85\xB3", + "\xA4\xE4" => "\xE3\x85\xB4", + "\xA4\xE5" => "\xE3\x85\xB5", + "\xA4\xE6" => "\xE3\x85\xB6", + "\xA4\xE7" => "\xE3\x85\xB7", + "\xA4\xE8" => "\xE3\x85\xB8", + "\xA4\xE9" => "\xE3\x85\xB9", + "\xA4\xEA" => "\xE3\x85\xBA", + "\xA4\xEB" => "\xE3\x85\xBB", + "\xA4\xEC" => "\xE3\x85\xBC", + "\xA4\xED" => "\xE3\x85\xBD", + "\xA4\xEE" => "\xE3\x85\xBE", + "\xA4\xEF" => "\xE3\x85\xBF", + "\xA4\xF0" => "\xE3\x86\x80", + "\xA4\xF1" => "\xE3\x86\x81", + "\xA4\xF2" => "\xE3\x86\x82", + "\xA4\xF3" => "\xE3\x86\x83", + "\xA4\xF4" => "\xE3\x86\x84", + "\xA4\xF5" => "\xE3\x86\x85", + "\xA4\xF6" => "\xE3\x86\x86", + "\xA4\xF7" => "\xE3\x86\x87", + "\xA4\xF8" => "\xE3\x86\x88", + "\xA4\xF9" => "\xE3\x86\x89", + "\xA4\xFA" => "\xE3\x86\x8A", + "\xA4\xFB" => "\xE3\x86\x8B", + "\xA4\xFC" => "\xE3\x86\x8C", + "\xA4\xFD" => "\xE3\x86\x8D", + "\xA4\xFE" => "\xE3\x86\x8E", + "\xA5\x41" => "\xEC\xA9\x87", + "\xA5\x42" => "\xEC\xA9\x88", + "\xA5\x43" => "\xEC\xA9\x89", + "\xA5\x44" => "\xEC\xA9\x8A", + "\xA5\x45" => "\xEC\xA9\x8B", + "\xA5\x46" => "\xEC\xA9\x8E", + "\xA5\x47" => "\xEC\xA9\x8F", + "\xA5\x48" => "\xEC\xA9\x91", + "\xA5\x49" => "\xEC\xA9\x92", + "\xA5\x4A" => "\xEC\xA9\x93", + "\xA5\x4B" => "\xEC\xA9\x95", + "\xA5\x4C" => "\xEC\xA9\x96", + "\xA5\x4D" => "\xEC\xA9\x97", + "\xA5\x4E" => "\xEC\xA9\x98", + "\xA5\x4F" => "\xEC\xA9\x99", + "\xA5\x50" => "\xEC\xA9\x9A", + "\xA5\x51" => "\xEC\xA9\x9B", + "\xA5\x52" => "\xEC\xA9\x9E", + "\xA5\x53" => "\xEC\xA9\xA2", + "\xA5\x54" => "\xEC\xA9\xA3", + "\xA5\x55" => "\xEC\xA9\xA4", + "\xA5\x56" => "\xEC\xA9\xA5", + "\xA5\x57" => "\xEC\xA9\xA6", + "\xA5\x58" => "\xEC\xA9\xA7", + "\xA5\x59" => "\xEC\xA9\xA9", + "\xA5\x5A" => "\xEC\xA9\xAA", + "\xA5\x61" => "\xEC\xA9\xAB", + "\xA5\x62" => "\xEC\xA9\xAC", + "\xA5\x63" => "\xEC\xA9\xAD", + "\xA5\x64" => "\xEC\xA9\xAE", + "\xA5\x65" => "\xEC\xA9\xAF", + "\xA5\x66" => "\xEC\xA9\xB0", + "\xA5\x67" => "\xEC\xA9\xB1", + "\xA5\x68" => "\xEC\xA9\xB2", + "\xA5\x69" => "\xEC\xA9\xB3", + "\xA5\x6A" => "\xEC\xA9\xB4", + "\xA5\x6B" => "\xEC\xA9\xB5", + "\xA5\x6C" => "\xEC\xA9\xB6", + "\xA5\x6D" => "\xEC\xA9\xB7", + "\xA5\x6E" => "\xEC\xA9\xB8", + "\xA5\x6F" => "\xEC\xA9\xB9", + "\xA5\x70" => "\xEC\xA9\xBA", + "\xA5\x71" => "\xEC\xA9\xBB", + "\xA5\x72" => "\xEC\xA9\xBC", + "\xA5\x73" => "\xEC\xA9\xBE", + "\xA5\x74" => "\xEC\xA9\xBF", + "\xA5\x75" => "\xEC\xAA\x80", + "\xA5\x76" => "\xEC\xAA\x81", + "\xA5\x77" => "\xEC\xAA\x82", + "\xA5\x78" => "\xEC\xAA\x83", + "\xA5\x79" => "\xEC\xAA\x85", + "\xA5\x7A" => "\xEC\xAA\x86", + "\xA5\x81" => "\xEC\xAA\x87", + "\xA5\x82" => "\xEC\xAA\x88", + "\xA5\x83" => "\xEC\xAA\x89", + "\xA5\x84" => "\xEC\xAA\x8A", + "\xA5\x85" => "\xEC\xAA\x8B", + "\xA5\x86" => "\xEC\xAA\x8C", + "\xA5\x87" => "\xEC\xAA\x8D", + "\xA5\x88" => "\xEC\xAA\x8E", + "\xA5\x89" => "\xEC\xAA\x8F", + "\xA5\x8A" => "\xEC\xAA\x90", + "\xA5\x8B" => "\xEC\xAA\x91", + "\xA5\x8C" => "\xEC\xAA\x92", + "\xA5\x8D" => "\xEC\xAA\x93", + "\xA5\x8E" => "\xEC\xAA\x94", + "\xA5\x8F" => "\xEC\xAA\x95", + "\xA5\x90" => "\xEC\xAA\x96", + "\xA5\x91" => "\xEC\xAA\x97", + "\xA5\x92" => "\xEC\xAA\x99", + "\xA5\x93" => "\xEC\xAA\x9A", + "\xA5\x94" => "\xEC\xAA\x9B", + "\xA5\x95" => "\xEC\xAA\x9C", + "\xA5\x96" => "\xEC\xAA\x9D", + "\xA5\x97" => "\xEC\xAA\x9E", + "\xA5\x98" => "\xEC\xAA\x9F", + "\xA5\x99" => "\xEC\xAA\xA0", + "\xA5\x9A" => "\xEC\xAA\xA1", + "\xA5\x9B" => "\xEC\xAA\xA2", + "\xA5\x9C" => "\xEC\xAA\xA3", + "\xA5\x9D" => "\xEC\xAA\xA4", + "\xA5\x9E" => "\xEC\xAA\xA5", + "\xA5\x9F" => "\xEC\xAA\xA6", + "\xA5\xA0" => "\xEC\xAA\xA7", + "\xA5\xA1" => "\xE2\x85\xB0", + "\xA5\xA2" => "\xE2\x85\xB1", + "\xA5\xA3" => "\xE2\x85\xB2", + "\xA5\xA4" => "\xE2\x85\xB3", + "\xA5\xA5" => "\xE2\x85\xB4", + "\xA5\xA6" => "\xE2\x85\xB5", + "\xA5\xA7" => "\xE2\x85\xB6", + "\xA5\xA8" => "\xE2\x85\xB7", + "\xA5\xA9" => "\xE2\x85\xB8", + "\xA5\xAA" => "\xE2\x85\xB9", + "\xA5\xB0" => "\xE2\x85\xA0", + "\xA5\xB1" => "\xE2\x85\xA1", + "\xA5\xB2" => "\xE2\x85\xA2", + "\xA5\xB3" => "\xE2\x85\xA3", + "\xA5\xB4" => "\xE2\x85\xA4", + "\xA5\xB5" => "\xE2\x85\xA5", + "\xA5\xB6" => "\xE2\x85\xA6", + "\xA5\xB7" => "\xE2\x85\xA7", + "\xA5\xB8" => "\xE2\x85\xA8", + "\xA5\xB9" => "\xE2\x85\xA9", + "\xA5\xC1" => "\xCE\x91", + "\xA5\xC2" => "\xCE\x92", + "\xA5\xC3" => "\xCE\x93", + "\xA5\xC4" => "\xCE\x94", + "\xA5\xC5" => "\xCE\x95", + "\xA5\xC6" => "\xCE\x96", + "\xA5\xC7" => "\xCE\x97", + "\xA5\xC8" => "\xCE\x98", + "\xA5\xC9" => "\xCE\x99", + "\xA5\xCA" => "\xCE\x9A", + "\xA5\xCB" => "\xCE\x9B", + "\xA5\xCC" => "\xCE\x9C", + "\xA5\xCD" => "\xCE\x9D", + "\xA5\xCE" => "\xCE\x9E", + "\xA5\xCF" => "\xCE\x9F", + "\xA5\xD0" => "\xCE\xA0", + "\xA5\xD1" => "\xCE\xA1", + "\xA5\xD2" => "\xCE\xA3", + "\xA5\xD3" => "\xCE\xA4", + "\xA5\xD4" => "\xCE\xA5", + "\xA5\xD5" => "\xCE\xA6", + "\xA5\xD6" => "\xCE\xA7", + "\xA5\xD7" => "\xCE\xA8", + "\xA5\xD8" => "\xCE\xA9", + "\xA5\xE1" => "\xCE\xB1", + "\xA5\xE2" => "\xCE\xB2", + "\xA5\xE3" => "\xCE\xB3", + "\xA5\xE4" => "\xCE\xB4", + "\xA5\xE5" => "\xCE\xB5", + "\xA5\xE6" => "\xCE\xB6", + "\xA5\xE7" => "\xCE\xB7", + "\xA5\xE8" => "\xCE\xB8", + "\xA5\xE9" => "\xCE\xB9", + "\xA5\xEA" => "\xCE\xBA", + "\xA5\xEB" => "\xCE\xBB", + "\xA5\xEC" => "\xCE\xBC", + "\xA5\xED" => "\xCE\xBD", + "\xA5\xEE" => "\xCE\xBE", + "\xA5\xEF" => "\xCE\xBF", + "\xA5\xF0" => "\xCF\x80", + "\xA5\xF1" => "\xCF\x81", + "\xA5\xF2" => "\xCF\x83", + "\xA5\xF3" => "\xCF\x84", + "\xA5\xF4" => "\xCF\x85", + "\xA5\xF5" => "\xCF\x86", + "\xA5\xF6" => "\xCF\x87", + "\xA5\xF7" => "\xCF\x88", + "\xA5\xF8" => "\xCF\x89", + "\xA6\x41" => "\xEC\xAA\xA8", + "\xA6\x42" => "\xEC\xAA\xA9", + "\xA6\x43" => "\xEC\xAA\xAA", + "\xA6\x44" => "\xEC\xAA\xAB", + "\xA6\x45" => "\xEC\xAA\xAC", + "\xA6\x46" => "\xEC\xAA\xAD", + "\xA6\x47" => "\xEC\xAA\xAE", + "\xA6\x48" => "\xEC\xAA\xAF", + "\xA6\x49" => "\xEC\xAA\xB0", + "\xA6\x4A" => "\xEC\xAA\xB1", + "\xA6\x4B" => "\xEC\xAA\xB2", + "\xA6\x4C" => "\xEC\xAA\xB3", + "\xA6\x4D" => "\xEC\xAA\xB4", + "\xA6\x4E" => "\xEC\xAA\xB5", + "\xA6\x4F" => "\xEC\xAA\xB6", + "\xA6\x50" => "\xEC\xAA\xB7", + "\xA6\x51" => "\xEC\xAA\xB8", + "\xA6\x52" => "\xEC\xAA\xB9", + "\xA6\x53" => "\xEC\xAA\xBA", + "\xA6\x54" => "\xEC\xAA\xBB", + "\xA6\x55" => "\xEC\xAA\xBE", + "\xA6\x56" => "\xEC\xAA\xBF", + "\xA6\x57" => "\xEC\xAB\x81", + "\xA6\x58" => "\xEC\xAB\x82", + "\xA6\x59" => "\xEC\xAB\x83", + "\xA6\x5A" => "\xEC\xAB\x85", + "\xA6\x61" => "\xEC\xAB\x86", + "\xA6\x62" => "\xEC\xAB\x87", + "\xA6\x63" => "\xEC\xAB\x88", + "\xA6\x64" => "\xEC\xAB\x89", + "\xA6\x65" => "\xEC\xAB\x8A", + "\xA6\x66" => "\xEC\xAB\x8B", + "\xA6\x67" => "\xEC\xAB\x8E", + "\xA6\x68" => "\xEC\xAB\x90", + "\xA6\x69" => "\xEC\xAB\x92", + "\xA6\x6A" => "\xEC\xAB\x94", + "\xA6\x6B" => "\xEC\xAB\x95", + "\xA6\x6C" => "\xEC\xAB\x96", + "\xA6\x6D" => "\xEC\xAB\x97", + "\xA6\x6E" => "\xEC\xAB\x9A", + "\xA6\x6F" => "\xEC\xAB\x9B", + "\xA6\x70" => "\xEC\xAB\x9C", + "\xA6\x71" => "\xEC\xAB\x9D", + "\xA6\x72" => "\xEC\xAB\x9E", + "\xA6\x73" => "\xEC\xAB\x9F", + "\xA6\x74" => "\xEC\xAB\xA1", + "\xA6\x75" => "\xEC\xAB\xA2", + "\xA6\x76" => "\xEC\xAB\xA3", + "\xA6\x77" => "\xEC\xAB\xA4", + "\xA6\x78" => "\xEC\xAB\xA5", + "\xA6\x79" => "\xEC\xAB\xA6", + "\xA6\x7A" => "\xEC\xAB\xA7", + "\xA6\x81" => "\xEC\xAB\xA8", + "\xA6\x82" => "\xEC\xAB\xA9", + "\xA6\x83" => "\xEC\xAB\xAA", + "\xA6\x84" => "\xEC\xAB\xAB", + "\xA6\x85" => "\xEC\xAB\xAD", + "\xA6\x86" => "\xEC\xAB\xAE", + "\xA6\x87" => "\xEC\xAB\xAF", + "\xA6\x88" => "\xEC\xAB\xB0", + "\xA6\x89" => "\xEC\xAB\xB1", + "\xA6\x8A" => "\xEC\xAB\xB2", + "\xA6\x8B" => "\xEC\xAB\xB3", + "\xA6\x8C" => "\xEC\xAB\xB5", + "\xA6\x8D" => "\xEC\xAB\xB6", + "\xA6\x8E" => "\xEC\xAB\xB7", + "\xA6\x8F" => "\xEC\xAB\xB8", + "\xA6\x90" => "\xEC\xAB\xB9", + "\xA6\x91" => "\xEC\xAB\xBA", + "\xA6\x92" => "\xEC\xAB\xBB", + "\xA6\x93" => "\xEC\xAB\xBC", + "\xA6\x94" => "\xEC\xAB\xBD", + "\xA6\x95" => "\xEC\xAB\xBE", + "\xA6\x96" => "\xEC\xAB\xBF", + "\xA6\x97" => "\xEC\xAC\x80", + "\xA6\x98" => "\xEC\xAC\x81", + "\xA6\x99" => "\xEC\xAC\x82", + "\xA6\x9A" => "\xEC\xAC\x83", + "\xA6\x9B" => "\xEC\xAC\x84", + "\xA6\x9C" => "\xEC\xAC\x85", + "\xA6\x9D" => "\xEC\xAC\x86", + "\xA6\x9E" => "\xEC\xAC\x87", + "\xA6\x9F" => "\xEC\xAC\x89", + "\xA6\xA0" => "\xEC\xAC\x8A", + "\xA6\xA1" => "\xE2\x94\x80", + "\xA6\xA2" => "\xE2\x94\x82", + "\xA6\xA3" => "\xE2\x94\x8C", + "\xA6\xA4" => "\xE2\x94\x90", + "\xA6\xA5" => "\xE2\x94\x98", + "\xA6\xA6" => "\xE2\x94\x94", + "\xA6\xA7" => "\xE2\x94\x9C", + "\xA6\xA8" => "\xE2\x94\xAC", + "\xA6\xA9" => "\xE2\x94\xA4", + "\xA6\xAA" => "\xE2\x94\xB4", + "\xA6\xAB" => "\xE2\x94\xBC", + "\xA6\xAC" => "\xE2\x94\x81", + "\xA6\xAD" => "\xE2\x94\x83", + "\xA6\xAE" => "\xE2\x94\x8F", + "\xA6\xAF" => "\xE2\x94\x93", + "\xA6\xB0" => "\xE2\x94\x9B", + "\xA6\xB1" => "\xE2\x94\x97", + "\xA6\xB2" => "\xE2\x94\xA3", + "\xA6\xB3" => "\xE2\x94\xB3", + "\xA6\xB4" => "\xE2\x94\xAB", + "\xA6\xB5" => "\xE2\x94\xBB", + "\xA6\xB6" => "\xE2\x95\x8B", + "\xA6\xB7" => "\xE2\x94\xA0", + "\xA6\xB8" => "\xE2\x94\xAF", + "\xA6\xB9" => "\xE2\x94\xA8", + "\xA6\xBA" => "\xE2\x94\xB7", + "\xA6\xBB" => "\xE2\x94\xBF", + "\xA6\xBC" => "\xE2\x94\x9D", + "\xA6\xBD" => "\xE2\x94\xB0", + "\xA6\xBE" => "\xE2\x94\xA5", + "\xA6\xBF" => "\xE2\x94\xB8", + "\xA6\xC0" => "\xE2\x95\x82", + "\xA6\xC1" => "\xE2\x94\x92", + "\xA6\xC2" => "\xE2\x94\x91", + "\xA6\xC3" => "\xE2\x94\x9A", + "\xA6\xC4" => "\xE2\x94\x99", + "\xA6\xC5" => "\xE2\x94\x96", + "\xA6\xC6" => "\xE2\x94\x95", + "\xA6\xC7" => "\xE2\x94\x8E", + "\xA6\xC8" => "\xE2\x94\x8D", + "\xA6\xC9" => "\xE2\x94\x9E", + "\xA6\xCA" => "\xE2\x94\x9F", + "\xA6\xCB" => "\xE2\x94\xA1", + "\xA6\xCC" => "\xE2\x94\xA2", + "\xA6\xCD" => "\xE2\x94\xA6", + "\xA6\xCE" => "\xE2\x94\xA7", + "\xA6\xCF" => "\xE2\x94\xA9", + "\xA6\xD0" => "\xE2\x94\xAA", + "\xA6\xD1" => "\xE2\x94\xAD", + "\xA6\xD2" => "\xE2\x94\xAE", + "\xA6\xD3" => "\xE2\x94\xB1", + "\xA6\xD4" => "\xE2\x94\xB2", + "\xA6\xD5" => "\xE2\x94\xB5", + "\xA6\xD6" => "\xE2\x94\xB6", + "\xA6\xD7" => "\xE2\x94\xB9", + "\xA6\xD8" => "\xE2\x94\xBA", + "\xA6\xD9" => "\xE2\x94\xBD", + "\xA6\xDA" => "\xE2\x94\xBE", + "\xA6\xDB" => "\xE2\x95\x80", + "\xA6\xDC" => "\xE2\x95\x81", + "\xA6\xDD" => "\xE2\x95\x83", + "\xA6\xDE" => "\xE2\x95\x84", + "\xA6\xDF" => "\xE2\x95\x85", + "\xA6\xE0" => "\xE2\x95\x86", + "\xA6\xE1" => "\xE2\x95\x87", + "\xA6\xE2" => "\xE2\x95\x88", + "\xA6\xE3" => "\xE2\x95\x89", + "\xA6\xE4" => "\xE2\x95\x8A", + "\xA7\x41" => "\xEC\xAC\x8B", + "\xA7\x42" => "\xEC\xAC\x8C", + "\xA7\x43" => "\xEC\xAC\x8D", + "\xA7\x44" => "\xEC\xAC\x8E", + "\xA7\x45" => "\xEC\xAC\x8F", + "\xA7\x46" => "\xEC\xAC\x91", + "\xA7\x47" => "\xEC\xAC\x92", + "\xA7\x48" => "\xEC\xAC\x93", + "\xA7\x49" => "\xEC\xAC\x95", + "\xA7\x4A" => "\xEC\xAC\x96", + "\xA7\x4B" => "\xEC\xAC\x97", + "\xA7\x4C" => "\xEC\xAC\x99", + "\xA7\x4D" => "\xEC\xAC\x9A", + "\xA7\x4E" => "\xEC\xAC\x9B", + "\xA7\x4F" => "\xEC\xAC\x9C", + "\xA7\x50" => "\xEC\xAC\x9D", + "\xA7\x51" => "\xEC\xAC\x9E", + "\xA7\x52" => "\xEC\xAC\x9F", + "\xA7\x53" => "\xEC\xAC\xA2", + "\xA7\x54" => "\xEC\xAC\xA3", + "\xA7\x55" => "\xEC\xAC\xA4", + "\xA7\x56" => "\xEC\xAC\xA5", + "\xA7\x57" => "\xEC\xAC\xA6", + "\xA7\x58" => "\xEC\xAC\xA7", + "\xA7\x59" => "\xEC\xAC\xA8", + "\xA7\x5A" => "\xEC\xAC\xA9", + "\xA7\x61" => "\xEC\xAC\xAA", + "\xA7\x62" => "\xEC\xAC\xAB", + "\xA7\x63" => "\xEC\xAC\xAC", + "\xA7\x64" => "\xEC\xAC\xAD", + "\xA7\x65" => "\xEC\xAC\xAE", + "\xA7\x66" => "\xEC\xAC\xAF", + "\xA7\x67" => "\xEC\xAC\xB0", + "\xA7\x68" => "\xEC\xAC\xB1", + "\xA7\x69" => "\xEC\xAC\xB2", + "\xA7\x6A" => "\xEC\xAC\xB3", + "\xA7\x6B" => "\xEC\xAC\xB4", + "\xA7\x6C" => "\xEC\xAC\xB5", + "\xA7\x6D" => "\xEC\xAC\xB6", + "\xA7\x6E" => "\xEC\xAC\xB7", + "\xA7\x6F" => "\xEC\xAC\xB8", + "\xA7\x70" => "\xEC\xAC\xB9", + "\xA7\x71" => "\xEC\xAC\xBA", + "\xA7\x72" => "\xEC\xAC\xBB", + "\xA7\x73" => "\xEC\xAC\xBC", + "\xA7\x74" => "\xEC\xAC\xBD", + "\xA7\x75" => "\xEC\xAC\xBE", + "\xA7\x76" => "\xEC\xAC\xBF", + "\xA7\x77" => "\xEC\xAD\x80", + "\xA7\x78" => "\xEC\xAD\x82", + "\xA7\x79" => "\xEC\xAD\x83", + "\xA7\x7A" => "\xEC\xAD\x84", + "\xA7\x81" => "\xEC\xAD\x85", + "\xA7\x82" => "\xEC\xAD\x86", + "\xA7\x83" => "\xEC\xAD\x87", + "\xA7\x84" => "\xEC\xAD\x8A", + "\xA7\x85" => "\xEC\xAD\x8B", + "\xA7\x86" => "\xEC\xAD\x8D", + "\xA7\x87" => "\xEC\xAD\x8E", + "\xA7\x88" => "\xEC\xAD\x8F", + "\xA7\x89" => "\xEC\xAD\x91", + "\xA7\x8A" => "\xEC\xAD\x92", + "\xA7\x8B" => "\xEC\xAD\x93", + "\xA7\x8C" => "\xEC\xAD\x94", + "\xA7\x8D" => "\xEC\xAD\x95", + "\xA7\x8E" => "\xEC\xAD\x96", + "\xA7\x8F" => "\xEC\xAD\x97", + "\xA7\x90" => "\xEC\xAD\x9A", + "\xA7\x91" => "\xEC\xAD\x9B", + "\xA7\x92" => "\xEC\xAD\x9C", + "\xA7\x93" => "\xEC\xAD\x9E", + "\xA7\x94" => "\xEC\xAD\x9F", + "\xA7\x95" => "\xEC\xAD\xA0", + "\xA7\x96" => "\xEC\xAD\xA1", + "\xA7\x97" => "\xEC\xAD\xA2", + "\xA7\x98" => "\xEC\xAD\xA3", + "\xA7\x99" => "\xEC\xAD\xA5", + "\xA7\x9A" => "\xEC\xAD\xA6", + "\xA7\x9B" => "\xEC\xAD\xA7", + "\xA7\x9C" => "\xEC\xAD\xA8", + "\xA7\x9D" => "\xEC\xAD\xA9", + "\xA7\x9E" => "\xEC\xAD\xAA", + "\xA7\x9F" => "\xEC\xAD\xAB", + "\xA7\xA0" => "\xEC\xAD\xAC", + "\xA7\xA1" => "\xE3\x8E\x95", + "\xA7\xA2" => "\xE3\x8E\x96", + "\xA7\xA3" => "\xE3\x8E\x97", + "\xA7\xA4" => "\xE2\x84\x93", + "\xA7\xA5" => "\xE3\x8E\x98", + "\xA7\xA6" => "\xE3\x8F\x84", + "\xA7\xA7" => "\xE3\x8E\xA3", + "\xA7\xA8" => "\xE3\x8E\xA4", + "\xA7\xA9" => "\xE3\x8E\xA5", + "\xA7\xAA" => "\xE3\x8E\xA6", + "\xA7\xAB" => "\xE3\x8E\x99", + "\xA7\xAC" => "\xE3\x8E\x9A", + "\xA7\xAD" => "\xE3\x8E\x9B", + "\xA7\xAE" => "\xE3\x8E\x9C", + "\xA7\xAF" => "\xE3\x8E\x9D", + "\xA7\xB0" => "\xE3\x8E\x9E", + "\xA7\xB1" => "\xE3\x8E\x9F", + "\xA7\xB2" => "\xE3\x8E\xA0", + "\xA7\xB3" => "\xE3\x8E\xA1", + "\xA7\xB4" => "\xE3\x8E\xA2", + "\xA7\xB5" => "\xE3\x8F\x8A", + "\xA7\xB6" => "\xE3\x8E\x8D", + "\xA7\xB7" => "\xE3\x8E\x8E", + "\xA7\xB8" => "\xE3\x8E\x8F", + "\xA7\xB9" => "\xE3\x8F\x8F", + "\xA7\xBA" => "\xE3\x8E\x88", + "\xA7\xBB" => "\xE3\x8E\x89", + "\xA7\xBC" => "\xE3\x8F\x88", + "\xA7\xBD" => "\xE3\x8E\xA7", + "\xA7\xBE" => "\xE3\x8E\xA8", + "\xA7\xBF" => "\xE3\x8E\xB0", + "\xA7\xC0" => "\xE3\x8E\xB1", + "\xA7\xC1" => "\xE3\x8E\xB2", + "\xA7\xC2" => "\xE3\x8E\xB3", + "\xA7\xC3" => "\xE3\x8E\xB4", + "\xA7\xC4" => "\xE3\x8E\xB5", + "\xA7\xC5" => "\xE3\x8E\xB6", + "\xA7\xC6" => "\xE3\x8E\xB7", + "\xA7\xC7" => "\xE3\x8E\xB8", + "\xA7\xC8" => "\xE3\x8E\xB9", + "\xA7\xC9" => "\xE3\x8E\x80", + "\xA7\xCA" => "\xE3\x8E\x81", + "\xA7\xCB" => "\xE3\x8E\x82", + "\xA7\xCC" => "\xE3\x8E\x83", + "\xA7\xCD" => "\xE3\x8E\x84", + "\xA7\xCE" => "\xE3\x8E\xBA", + "\xA7\xCF" => "\xE3\x8E\xBB", + "\xA7\xD0" => "\xE3\x8E\xBC", + "\xA7\xD1" => "\xE3\x8E\xBD", + "\xA7\xD2" => "\xE3\x8E\xBE", + "\xA7\xD3" => "\xE3\x8E\xBF", + "\xA7\xD4" => "\xE3\x8E\x90", + "\xA7\xD5" => "\xE3\x8E\x91", + "\xA7\xD6" => "\xE3\x8E\x92", + "\xA7\xD7" => "\xE3\x8E\x93", + "\xA7\xD8" => "\xE3\x8E\x94", + "\xA7\xD9" => "\xE2\x84\xA6", + "\xA7\xDA" => "\xE3\x8F\x80", + "\xA7\xDB" => "\xE3\x8F\x81", + "\xA7\xDC" => "\xE3\x8E\x8A", + "\xA7\xDD" => "\xE3\x8E\x8B", + "\xA7\xDE" => "\xE3\x8E\x8C", + "\xA7\xDF" => "\xE3\x8F\x96", + "\xA7\xE0" => "\xE3\x8F\x85", + "\xA7\xE1" => "\xE3\x8E\xAD", + "\xA7\xE2" => "\xE3\x8E\xAE", + "\xA7\xE3" => "\xE3\x8E\xAF", + "\xA7\xE4" => "\xE3\x8F\x9B", + "\xA7\xE5" => "\xE3\x8E\xA9", + "\xA7\xE6" => "\xE3\x8E\xAA", + "\xA7\xE7" => "\xE3\x8E\xAB", + "\xA7\xE8" => "\xE3\x8E\xAC", + "\xA7\xE9" => "\xE3\x8F\x9D", + "\xA7\xEA" => "\xE3\x8F\x90", + "\xA7\xEB" => "\xE3\x8F\x93", + "\xA7\xEC" => "\xE3\x8F\x83", + "\xA7\xED" => "\xE3\x8F\x89", + "\xA7\xEE" => "\xE3\x8F\x9C", + "\xA7\xEF" => "\xE3\x8F\x86", + "\xA8\x41" => "\xEC\xAD\xAD", + "\xA8\x42" => "\xEC\xAD\xAE", + "\xA8\x43" => "\xEC\xAD\xAF", + "\xA8\x44" => "\xEC\xAD\xB0", + "\xA8\x45" => "\xEC\xAD\xB1", + "\xA8\x46" => "\xEC\xAD\xB2", + "\xA8\x47" => "\xEC\xAD\xB3", + "\xA8\x48" => "\xEC\xAD\xB4", + "\xA8\x49" => "\xEC\xAD\xB5", + "\xA8\x4A" => "\xEC\xAD\xB6", + "\xA8\x4B" => "\xEC\xAD\xB7", + "\xA8\x4C" => "\xEC\xAD\xBA", + "\xA8\x4D" => "\xEC\xAD\xBB", + "\xA8\x4E" => "\xEC\xAD\xBC", + "\xA8\x4F" => "\xEC\xAD\xBD", + "\xA8\x50" => "\xEC\xAD\xBE", + "\xA8\x51" => "\xEC\xAD\xBF", + "\xA8\x52" => "\xEC\xAE\x80", + "\xA8\x53" => "\xEC\xAE\x81", + "\xA8\x54" => "\xEC\xAE\x82", + "\xA8\x55" => "\xEC\xAE\x83", + "\xA8\x56" => "\xEC\xAE\x84", + "\xA8\x57" => "\xEC\xAE\x85", + "\xA8\x58" => "\xEC\xAE\x86", + "\xA8\x59" => "\xEC\xAE\x87", + "\xA8\x5A" => "\xEC\xAE\x88", + "\xA8\x61" => "\xEC\xAE\x89", + "\xA8\x62" => "\xEC\xAE\x8A", + "\xA8\x63" => "\xEC\xAE\x8B", + "\xA8\x64" => "\xEC\xAE\x8C", + "\xA8\x65" => "\xEC\xAE\x8D", + "\xA8\x66" => "\xEC\xAE\x8E", + "\xA8\x67" => "\xEC\xAE\x8F", + "\xA8\x68" => "\xEC\xAE\x90", + "\xA8\x69" => "\xEC\xAE\x91", + "\xA8\x6A" => "\xEC\xAE\x92", + "\xA8\x6B" => "\xEC\xAE\x93", + "\xA8\x6C" => "\xEC\xAE\x94", + "\xA8\x6D" => "\xEC\xAE\x95", + "\xA8\x6E" => "\xEC\xAE\x96", + "\xA8\x6F" => "\xEC\xAE\x97", + "\xA8\x70" => "\xEC\xAE\x98", + "\xA8\x71" => "\xEC\xAE\x99", + "\xA8\x72" => "\xEC\xAE\x9A", + "\xA8\x73" => "\xEC\xAE\x9B", + "\xA8\x74" => "\xEC\xAE\x9D", + "\xA8\x75" => "\xEC\xAE\x9E", + "\xA8\x76" => "\xEC\xAE\x9F", + "\xA8\x77" => "\xEC\xAE\xA0", + "\xA8\x78" => "\xEC\xAE\xA1", + "\xA8\x79" => "\xEC\xAE\xA2", + "\xA8\x7A" => "\xEC\xAE\xA3", + "\xA8\x81" => "\xEC\xAE\xA4", + "\xA8\x82" => "\xEC\xAE\xA5", + "\xA8\x83" => "\xEC\xAE\xA6", + "\xA8\x84" => "\xEC\xAE\xA7", + "\xA8\x85" => "\xEC\xAE\xA8", + "\xA8\x86" => "\xEC\xAE\xA9", + "\xA8\x87" => "\xEC\xAE\xAA", + "\xA8\x88" => "\xEC\xAE\xAB", + "\xA8\x89" => "\xEC\xAE\xAC", + "\xA8\x8A" => "\xEC\xAE\xAD", + "\xA8\x8B" => "\xEC\xAE\xAE", + "\xA8\x8C" => "\xEC\xAE\xAF", + "\xA8\x8D" => "\xEC\xAE\xB0", + "\xA8\x8E" => "\xEC\xAE\xB1", + "\xA8\x8F" => "\xEC\xAE\xB2", + "\xA8\x90" => "\xEC\xAE\xB3", + "\xA8\x91" => "\xEC\xAE\xB4", + "\xA8\x92" => "\xEC\xAE\xB5", + "\xA8\x93" => "\xEC\xAE\xB6", + "\xA8\x94" => "\xEC\xAE\xB7", + "\xA8\x95" => "\xEC\xAE\xB9", + "\xA8\x96" => "\xEC\xAE\xBA", + "\xA8\x97" => "\xEC\xAE\xBB", + "\xA8\x98" => "\xEC\xAE\xBC", + "\xA8\x99" => "\xEC\xAE\xBD", + "\xA8\x9A" => "\xEC\xAE\xBE", + "\xA8\x9B" => "\xEC\xAE\xBF", + "\xA8\x9C" => "\xEC\xAF\x80", + "\xA8\x9D" => "\xEC\xAF\x81", + "\xA8\x9E" => "\xEC\xAF\x82", + "\xA8\x9F" => "\xEC\xAF\x83", + "\xA8\xA0" => "\xEC\xAF\x84", + "\xA8\xA1" => "\xC3\x86", + "\xA8\xA2" => "\xC3\x90", + "\xA8\xA3" => "\xC2\xAA", + "\xA8\xA4" => "\xC4\xA6", + "\xA8\xA6" => "\xC4\xB2", + "\xA8\xA8" => "\xC4\xBF", + "\xA8\xA9" => "\xC5\x81", + "\xA8\xAA" => "\xC3\x98", + "\xA8\xAB" => "\xC5\x92", + "\xA8\xAC" => "\xC2\xBA", + "\xA8\xAD" => "\xC3\x9E", + "\xA8\xAE" => "\xC5\xA6", + "\xA8\xAF" => "\xC5\x8A", + "\xA8\xB1" => "\xE3\x89\xA0", + "\xA8\xB2" => "\xE3\x89\xA1", + "\xA8\xB3" => "\xE3\x89\xA2", + "\xA8\xB4" => "\xE3\x89\xA3", + "\xA8\xB5" => "\xE3\x89\xA4", + "\xA8\xB6" => "\xE3\x89\xA5", + "\xA8\xB7" => "\xE3\x89\xA6", + "\xA8\xB8" => "\xE3\x89\xA7", + "\xA8\xB9" => "\xE3\x89\xA8", + "\xA8\xBA" => "\xE3\x89\xA9", + "\xA8\xBB" => "\xE3\x89\xAA", + "\xA8\xBC" => "\xE3\x89\xAB", + "\xA8\xBD" => "\xE3\x89\xAC", + "\xA8\xBE" => "\xE3\x89\xAD", + "\xA8\xBF" => "\xE3\x89\xAE", + "\xA8\xC0" => "\xE3\x89\xAF", + "\xA8\xC1" => "\xE3\x89\xB0", + "\xA8\xC2" => "\xE3\x89\xB1", + "\xA8\xC3" => "\xE3\x89\xB2", + "\xA8\xC4" => "\xE3\x89\xB3", + "\xA8\xC5" => "\xE3\x89\xB4", + "\xA8\xC6" => "\xE3\x89\xB5", + "\xA8\xC7" => "\xE3\x89\xB6", + "\xA8\xC8" => "\xE3\x89\xB7", + "\xA8\xC9" => "\xE3\x89\xB8", + "\xA8\xCA" => "\xE3\x89\xB9", + "\xA8\xCB" => "\xE3\x89\xBA", + "\xA8\xCC" => "\xE3\x89\xBB", + "\xA8\xCD" => "\xE2\x93\x90", + "\xA8\xCE" => "\xE2\x93\x91", + "\xA8\xCF" => "\xE2\x93\x92", + "\xA8\xD0" => "\xE2\x93\x93", + "\xA8\xD1" => "\xE2\x93\x94", + "\xA8\xD2" => "\xE2\x93\x95", + "\xA8\xD3" => "\xE2\x93\x96", + "\xA8\xD4" => "\xE2\x93\x97", + "\xA8\xD5" => "\xE2\x93\x98", + "\xA8\xD6" => "\xE2\x93\x99", + "\xA8\xD7" => "\xE2\x93\x9A", + "\xA8\xD8" => "\xE2\x93\x9B", + "\xA8\xD9" => "\xE2\x93\x9C", + "\xA8\xDA" => "\xE2\x93\x9D", + "\xA8\xDB" => "\xE2\x93\x9E", + "\xA8\xDC" => "\xE2\x93\x9F", + "\xA8\xDD" => "\xE2\x93\xA0", + "\xA8\xDE" => "\xE2\x93\xA1", + "\xA8\xDF" => "\xE2\x93\xA2", + "\xA8\xE0" => "\xE2\x93\xA3", + "\xA8\xE1" => "\xE2\x93\xA4", + "\xA8\xE2" => "\xE2\x93\xA5", + "\xA8\xE3" => "\xE2\x93\xA6", + "\xA8\xE4" => "\xE2\x93\xA7", + "\xA8\xE5" => "\xE2\x93\xA8", + "\xA8\xE6" => "\xE2\x93\xA9", + "\xA8\xE7" => "\xE2\x91\xA0", + "\xA8\xE8" => "\xE2\x91\xA1", + "\xA8\xE9" => "\xE2\x91\xA2", + "\xA8\xEA" => "\xE2\x91\xA3", + "\xA8\xEB" => "\xE2\x91\xA4", + "\xA8\xEC" => "\xE2\x91\xA5", + "\xA8\xED" => "\xE2\x91\xA6", + "\xA8\xEE" => "\xE2\x91\xA7", + "\xA8\xEF" => "\xE2\x91\xA8", + "\xA8\xF0" => "\xE2\x91\xA9", + "\xA8\xF1" => "\xE2\x91\xAA", + "\xA8\xF2" => "\xE2\x91\xAB", + "\xA8\xF3" => "\xE2\x91\xAC", + "\xA8\xF4" => "\xE2\x91\xAD", + "\xA8\xF5" => "\xE2\x91\xAE", + "\xA8\xF6" => "\xC2\xBD", + "\xA8\xF7" => "\xE2\x85\x93", + "\xA8\xF8" => "\xE2\x85\x94", + "\xA8\xF9" => "\xC2\xBC", + "\xA8\xFA" => "\xC2\xBE", + "\xA8\xFB" => "\xE2\x85\x9B", + "\xA8\xFC" => "\xE2\x85\x9C", + "\xA8\xFD" => "\xE2\x85\x9D", + "\xA8\xFE" => "\xE2\x85\x9E", + "\xA9\x41" => "\xEC\xAF\x85", + "\xA9\x42" => "\xEC\xAF\x86", + "\xA9\x43" => "\xEC\xAF\x87", + "\xA9\x44" => "\xEC\xAF\x88", + "\xA9\x45" => "\xEC\xAF\x89", + "\xA9\x46" => "\xEC\xAF\x8A", + "\xA9\x47" => "\xEC\xAF\x8B", + "\xA9\x48" => "\xEC\xAF\x8C", + "\xA9\x49" => "\xEC\xAF\x8D", + "\xA9\x4A" => "\xEC\xAF\x8E", + "\xA9\x4B" => "\xEC\xAF\x8F", + "\xA9\x4C" => "\xEC\xAF\x90", + "\xA9\x4D" => "\xEC\xAF\x91", + "\xA9\x4E" => "\xEC\xAF\x92", + "\xA9\x4F" => "\xEC\xAF\x93", + "\xA9\x50" => "\xEC\xAF\x95", + "\xA9\x51" => "\xEC\xAF\x96", + "\xA9\x52" => "\xEC\xAF\x97", + "\xA9\x53" => "\xEC\xAF\x98", + "\xA9\x54" => "\xEC\xAF\x99", + "\xA9\x55" => "\xEC\xAF\x9A", + "\xA9\x56" => "\xEC\xAF\x9B", + "\xA9\x57" => "\xEC\xAF\x9C", + "\xA9\x58" => "\xEC\xAF\x9D", + "\xA9\x59" => "\xEC\xAF\x9E", + "\xA9\x5A" => "\xEC\xAF\x9F", + "\xA9\x61" => "\xEC\xAF\xA0", + "\xA9\x62" => "\xEC\xAF\xA1", + "\xA9\x63" => "\xEC\xAF\xA2", + "\xA9\x64" => "\xEC\xAF\xA3", + "\xA9\x65" => "\xEC\xAF\xA5", + "\xA9\x66" => "\xEC\xAF\xA6", + "\xA9\x67" => "\xEC\xAF\xA8", + "\xA9\x68" => "\xEC\xAF\xAA", + "\xA9\x69" => "\xEC\xAF\xAB", + "\xA9\x6A" => "\xEC\xAF\xAC", + "\xA9\x6B" => "\xEC\xAF\xAD", + "\xA9\x6C" => "\xEC\xAF\xAE", + "\xA9\x6D" => "\xEC\xAF\xAF", + "\xA9\x6E" => "\xEC\xAF\xB0", + "\xA9\x6F" => "\xEC\xAF\xB1", + "\xA9\x70" => "\xEC\xAF\xB2", + "\xA9\x71" => "\xEC\xAF\xB3", + "\xA9\x72" => "\xEC\xAF\xB4", + "\xA9\x73" => "\xEC\xAF\xB5", + "\xA9\x74" => "\xEC\xAF\xB6", + "\xA9\x75" => "\xEC\xAF\xB7", + "\xA9\x76" => "\xEC\xAF\xB8", + "\xA9\x77" => "\xEC\xAF\xB9", + "\xA9\x78" => "\xEC\xAF\xBA", + "\xA9\x79" => "\xEC\xAF\xBB", + "\xA9\x7A" => "\xEC\xAF\xBC", + "\xA9\x81" => "\xEC\xAF\xBD", + "\xA9\x82" => "\xEC\xAF\xBE", + "\xA9\x83" => "\xEC\xAF\xBF", + "\xA9\x84" => "\xEC\xB0\x80", + "\xA9\x85" => "\xEC\xB0\x81", + "\xA9\x86" => "\xEC\xB0\x82", + "\xA9\x87" => "\xEC\xB0\x83", + "\xA9\x88" => "\xEC\xB0\x84", + "\xA9\x89" => "\xEC\xB0\x85", + "\xA9\x8A" => "\xEC\xB0\x86", + "\xA9\x8B" => "\xEC\xB0\x87", + "\xA9\x8C" => "\xEC\xB0\x88", + "\xA9\x8D" => "\xEC\xB0\x89", + "\xA9\x8E" => "\xEC\xB0\x8A", + "\xA9\x8F" => "\xEC\xB0\x8B", + "\xA9\x90" => "\xEC\xB0\x8E", + "\xA9\x91" => "\xEC\xB0\x8F", + "\xA9\x92" => "\xEC\xB0\x91", + "\xA9\x93" => "\xEC\xB0\x92", + "\xA9\x94" => "\xEC\xB0\x93", + "\xA9\x95" => "\xEC\xB0\x95", + "\xA9\x96" => "\xEC\xB0\x96", + "\xA9\x97" => "\xEC\xB0\x97", + "\xA9\x98" => "\xEC\xB0\x98", + "\xA9\x99" => "\xEC\xB0\x99", + "\xA9\x9A" => "\xEC\xB0\x9A", + "\xA9\x9B" => "\xEC\xB0\x9B", + "\xA9\x9C" => "\xEC\xB0\x9E", + "\xA9\x9D" => "\xEC\xB0\x9F", + "\xA9\x9E" => "\xEC\xB0\xA0", + "\xA9\x9F" => "\xEC\xB0\xA3", + "\xA9\xA0" => "\xEC\xB0\xA4", + "\xA9\xA1" => "\xC3\xA6", + "\xA9\xA2" => "\xC4\x91", + "\xA9\xA3" => "\xC3\xB0", + "\xA9\xA4" => "\xC4\xA7", + "\xA9\xA5" => "\xC4\xB1", + "\xA9\xA6" => "\xC4\xB3", + "\xA9\xA7" => "\xC4\xB8", + "\xA9\xA8" => "\xC5\x80", + "\xA9\xA9" => "\xC5\x82", + "\xA9\xAA" => "\xC3\xB8", + "\xA9\xAB" => "\xC5\x93", + "\xA9\xAC" => "\xC3\x9F", + "\xA9\xAD" => "\xC3\xBE", + "\xA9\xAE" => "\xC5\xA7", + "\xA9\xAF" => "\xC5\x8B", + "\xA9\xB0" => "\xC5\x89", + "\xA9\xB1" => "\xE3\x88\x80", + "\xA9\xB2" => "\xE3\x88\x81", + "\xA9\xB3" => "\xE3\x88\x82", + "\xA9\xB4" => "\xE3\x88\x83", + "\xA9\xB5" => "\xE3\x88\x84", + "\xA9\xB6" => "\xE3\x88\x85", + "\xA9\xB7" => "\xE3\x88\x86", + "\xA9\xB8" => "\xE3\x88\x87", + "\xA9\xB9" => "\xE3\x88\x88", + "\xA9\xBA" => "\xE3\x88\x89", + "\xA9\xBB" => "\xE3\x88\x8A", + "\xA9\xBC" => "\xE3\x88\x8B", + "\xA9\xBD" => "\xE3\x88\x8C", + "\xA9\xBE" => "\xE3\x88\x8D", + "\xA9\xBF" => "\xE3\x88\x8E", + "\xA9\xC0" => "\xE3\x88\x8F", + "\xA9\xC1" => "\xE3\x88\x90", + "\xA9\xC2" => "\xE3\x88\x91", + "\xA9\xC3" => "\xE3\x88\x92", + "\xA9\xC4" => "\xE3\x88\x93", + "\xA9\xC5" => "\xE3\x88\x94", + "\xA9\xC6" => "\xE3\x88\x95", + "\xA9\xC7" => "\xE3\x88\x96", + "\xA9\xC8" => "\xE3\x88\x97", + "\xA9\xC9" => "\xE3\x88\x98", + "\xA9\xCA" => "\xE3\x88\x99", + "\xA9\xCB" => "\xE3\x88\x9A", + "\xA9\xCC" => "\xE3\x88\x9B", + "\xA9\xCD" => "\xE2\x92\x9C", + "\xA9\xCE" => "\xE2\x92\x9D", + "\xA9\xCF" => "\xE2\x92\x9E", + "\xA9\xD0" => "\xE2\x92\x9F", + "\xA9\xD1" => "\xE2\x92\xA0", + "\xA9\xD2" => "\xE2\x92\xA1", + "\xA9\xD3" => "\xE2\x92\xA2", + "\xA9\xD4" => "\xE2\x92\xA3", + "\xA9\xD5" => "\xE2\x92\xA4", + "\xA9\xD6" => "\xE2\x92\xA5", + "\xA9\xD7" => "\xE2\x92\xA6", + "\xA9\xD8" => "\xE2\x92\xA7", + "\xA9\xD9" => "\xE2\x92\xA8", + "\xA9\xDA" => "\xE2\x92\xA9", + "\xA9\xDB" => "\xE2\x92\xAA", + "\xA9\xDC" => "\xE2\x92\xAB", + "\xA9\xDD" => "\xE2\x92\xAC", + "\xA9\xDE" => "\xE2\x92\xAD", + "\xA9\xDF" => "\xE2\x92\xAE", + "\xA9\xE0" => "\xE2\x92\xAF", + "\xA9\xE1" => "\xE2\x92\xB0", + "\xA9\xE2" => "\xE2\x92\xB1", + "\xA9\xE3" => "\xE2\x92\xB2", + "\xA9\xE4" => "\xE2\x92\xB3", + "\xA9\xE5" => "\xE2\x92\xB4", + "\xA9\xE6" => "\xE2\x92\xB5", + "\xA9\xE7" => "\xE2\x91\xB4", + "\xA9\xE8" => "\xE2\x91\xB5", + "\xA9\xE9" => "\xE2\x91\xB6", + "\xA9\xEA" => "\xE2\x91\xB7", + "\xA9\xEB" => "\xE2\x91\xB8", + "\xA9\xEC" => "\xE2\x91\xB9", + "\xA9\xED" => "\xE2\x91\xBA", + "\xA9\xEE" => "\xE2\x91\xBB", + "\xA9\xEF" => "\xE2\x91\xBC", + "\xA9\xF0" => "\xE2\x91\xBD", + "\xA9\xF1" => "\xE2\x91\xBE", + "\xA9\xF2" => "\xE2\x91\xBF", + "\xA9\xF3" => "\xE2\x92\x80", + "\xA9\xF4" => "\xE2\x92\x81", + "\xA9\xF5" => "\xE2\x92\x82", + "\xA9\xF6" => "\xC2\xB9", + "\xA9\xF7" => "\xC2\xB2", + "\xA9\xF8" => "\xC2\xB3", + "\xA9\xF9" => "\xE2\x81\xB4", + "\xA9\xFA" => "\xE2\x81\xBF", + "\xA9\xFB" => "\xE2\x82\x81", + "\xA9\xFC" => "\xE2\x82\x82", + "\xA9\xFD" => "\xE2\x82\x83", + "\xA9\xFE" => "\xE2\x82\x84", + "\xAA\x41" => "\xEC\xB0\xA5", + "\xAA\x42" => "\xEC\xB0\xA6", + "\xAA\x43" => "\xEC\xB0\xAA", + "\xAA\x44" => "\xEC\xB0\xAB", + "\xAA\x45" => "\xEC\xB0\xAD", + "\xAA\x46" => "\xEC\xB0\xAF", + "\xAA\x47" => "\xEC\xB0\xB1", + "\xAA\x48" => "\xEC\xB0\xB2", + "\xAA\x49" => "\xEC\xB0\xB3", + "\xAA\x4A" => "\xEC\xB0\xB4", + "\xAA\x4B" => "\xEC\xB0\xB5", + "\xAA\x4C" => "\xEC\xB0\xB6", + "\xAA\x4D" => "\xEC\xB0\xB7", + "\xAA\x4E" => "\xEC\xB0\xBA", + "\xAA\x4F" => "\xEC\xB0\xBF", + "\xAA\x50" => "\xEC\xB1\x80", + "\xAA\x51" => "\xEC\xB1\x81", + "\xAA\x52" => "\xEC\xB1\x82", + "\xAA\x53" => "\xEC\xB1\x83", + "\xAA\x54" => "\xEC\xB1\x86", + "\xAA\x55" => "\xEC\xB1\x87", + "\xAA\x56" => "\xEC\xB1\x89", + "\xAA\x57" => "\xEC\xB1\x8A", + "\xAA\x58" => "\xEC\xB1\x8B", + "\xAA\x59" => "\xEC\xB1\x8D", + "\xAA\x5A" => "\xEC\xB1\x8E", + "\xAA\x61" => "\xEC\xB1\x8F", + "\xAA\x62" => "\xEC\xB1\x90", + "\xAA\x63" => "\xEC\xB1\x91", + "\xAA\x64" => "\xEC\xB1\x92", + "\xAA\x65" => "\xEC\xB1\x93", + "\xAA\x66" => "\xEC\xB1\x96", + "\xAA\x67" => "\xEC\xB1\x9A", + "\xAA\x68" => "\xEC\xB1\x9B", + "\xAA\x69" => "\xEC\xB1\x9C", + "\xAA\x6A" => "\xEC\xB1\x9D", + "\xAA\x6B" => "\xEC\xB1\x9E", + "\xAA\x6C" => "\xEC\xB1\x9F", + "\xAA\x6D" => "\xEC\xB1\xA1", + "\xAA\x6E" => "\xEC\xB1\xA2", + "\xAA\x6F" => "\xEC\xB1\xA3", + "\xAA\x70" => "\xEC\xB1\xA5", + "\xAA\x71" => "\xEC\xB1\xA7", + "\xAA\x72" => "\xEC\xB1\xA9", + "\xAA\x73" => "\xEC\xB1\xAA", + "\xAA\x74" => "\xEC\xB1\xAB", + "\xAA\x75" => "\xEC\xB1\xAC", + "\xAA\x76" => "\xEC\xB1\xAD", + "\xAA\x77" => "\xEC\xB1\xAE", + "\xAA\x78" => "\xEC\xB1\xAF", + "\xAA\x79" => "\xEC\xB1\xB1", + "\xAA\x7A" => "\xEC\xB1\xB2", + "\xAA\x81" => "\xEC\xB1\xB3", + "\xAA\x82" => "\xEC\xB1\xB4", + "\xAA\x83" => "\xEC\xB1\xB6", + "\xAA\x84" => "\xEC\xB1\xB7", + "\xAA\x85" => "\xEC\xB1\xB8", + "\xAA\x86" => "\xEC\xB1\xB9", + "\xAA\x87" => "\xEC\xB1\xBA", + "\xAA\x88" => "\xEC\xB1\xBB", + "\xAA\x89" => "\xEC\xB1\xBC", + "\xAA\x8A" => "\xEC\xB1\xBD", + "\xAA\x8B" => "\xEC\xB1\xBE", + "\xAA\x8C" => "\xEC\xB1\xBF", + "\xAA\x8D" => "\xEC\xB2\x80", + "\xAA\x8E" => "\xEC\xB2\x81", + "\xAA\x8F" => "\xEC\xB2\x82", + "\xAA\x90" => "\xEC\xB2\x83", + "\xAA\x91" => "\xEC\xB2\x84", + "\xAA\x92" => "\xEC\xB2\x85", + "\xAA\x93" => "\xEC\xB2\x86", + "\xAA\x94" => "\xEC\xB2\x87", + "\xAA\x95" => "\xEC\xB2\x88", + "\xAA\x96" => "\xEC\xB2\x89", + "\xAA\x97" => "\xEC\xB2\x8A", + "\xAA\x98" => "\xEC\xB2\x8B", + "\xAA\x99" => "\xEC\xB2\x8C", + "\xAA\x9A" => "\xEC\xB2\x8D", + "\xAA\x9B" => "\xEC\xB2\x8E", + "\xAA\x9C" => "\xEC\xB2\x8F", + "\xAA\x9D" => "\xEC\xB2\x90", + "\xAA\x9E" => "\xEC\xB2\x91", + "\xAA\x9F" => "\xEC\xB2\x92", + "\xAA\xA0" => "\xEC\xB2\x93", + "\xAA\xA1" => "\xE3\x81\x81", + "\xAA\xA2" => "\xE3\x81\x82", + "\xAA\xA3" => "\xE3\x81\x83", + "\xAA\xA4" => "\xE3\x81\x84", + "\xAA\xA5" => "\xE3\x81\x85", + "\xAA\xA6" => "\xE3\x81\x86", + "\xAA\xA7" => "\xE3\x81\x87", + "\xAA\xA8" => "\xE3\x81\x88", + "\xAA\xA9" => "\xE3\x81\x89", + "\xAA\xAA" => "\xE3\x81\x8A", + "\xAA\xAB" => "\xE3\x81\x8B", + "\xAA\xAC" => "\xE3\x81\x8C", + "\xAA\xAD" => "\xE3\x81\x8D", + "\xAA\xAE" => "\xE3\x81\x8E", + "\xAA\xAF" => "\xE3\x81\x8F", + "\xAA\xB0" => "\xE3\x81\x90", + "\xAA\xB1" => "\xE3\x81\x91", + "\xAA\xB2" => "\xE3\x81\x92", + "\xAA\xB3" => "\xE3\x81\x93", + "\xAA\xB4" => "\xE3\x81\x94", + "\xAA\xB5" => "\xE3\x81\x95", + "\xAA\xB6" => "\xE3\x81\x96", + "\xAA\xB7" => "\xE3\x81\x97", + "\xAA\xB8" => "\xE3\x81\x98", + "\xAA\xB9" => "\xE3\x81\x99", + "\xAA\xBA" => "\xE3\x81\x9A", + "\xAA\xBB" => "\xE3\x81\x9B", + "\xAA\xBC" => "\xE3\x81\x9C", + "\xAA\xBD" => "\xE3\x81\x9D", + "\xAA\xBE" => "\xE3\x81\x9E", + "\xAA\xBF" => "\xE3\x81\x9F", + "\xAA\xC0" => "\xE3\x81\xA0", + "\xAA\xC1" => "\xE3\x81\xA1", + "\xAA\xC2" => "\xE3\x81\xA2", + "\xAA\xC3" => "\xE3\x81\xA3", + "\xAA\xC4" => "\xE3\x81\xA4", + "\xAA\xC5" => "\xE3\x81\xA5", + "\xAA\xC6" => "\xE3\x81\xA6", + "\xAA\xC7" => "\xE3\x81\xA7", + "\xAA\xC8" => "\xE3\x81\xA8", + "\xAA\xC9" => "\xE3\x81\xA9", + "\xAA\xCA" => "\xE3\x81\xAA", + "\xAA\xCB" => "\xE3\x81\xAB", + "\xAA\xCC" => "\xE3\x81\xAC", + "\xAA\xCD" => "\xE3\x81\xAD", + "\xAA\xCE" => "\xE3\x81\xAE", + "\xAA\xCF" => "\xE3\x81\xAF", + "\xAA\xD0" => "\xE3\x81\xB0", + "\xAA\xD1" => "\xE3\x81\xB1", + "\xAA\xD2" => "\xE3\x81\xB2", + "\xAA\xD3" => "\xE3\x81\xB3", + "\xAA\xD4" => "\xE3\x81\xB4", + "\xAA\xD5" => "\xE3\x81\xB5", + "\xAA\xD6" => "\xE3\x81\xB6", + "\xAA\xD7" => "\xE3\x81\xB7", + "\xAA\xD8" => "\xE3\x81\xB8", + "\xAA\xD9" => "\xE3\x81\xB9", + "\xAA\xDA" => "\xE3\x81\xBA", + "\xAA\xDB" => "\xE3\x81\xBB", + "\xAA\xDC" => "\xE3\x81\xBC", + "\xAA\xDD" => "\xE3\x81\xBD", + "\xAA\xDE" => "\xE3\x81\xBE", + "\xAA\xDF" => "\xE3\x81\xBF", + "\xAA\xE0" => "\xE3\x82\x80", + "\xAA\xE1" => "\xE3\x82\x81", + "\xAA\xE2" => "\xE3\x82\x82", + "\xAA\xE3" => "\xE3\x82\x83", + "\xAA\xE4" => "\xE3\x82\x84", + "\xAA\xE5" => "\xE3\x82\x85", + "\xAA\xE6" => "\xE3\x82\x86", + "\xAA\xE7" => "\xE3\x82\x87", + "\xAA\xE8" => "\xE3\x82\x88", + "\xAA\xE9" => "\xE3\x82\x89", + "\xAA\xEA" => "\xE3\x82\x8A", + "\xAA\xEB" => "\xE3\x82\x8B", + "\xAA\xEC" => "\xE3\x82\x8C", + "\xAA\xED" => "\xE3\x82\x8D", + "\xAA\xEE" => "\xE3\x82\x8E", + "\xAA\xEF" => "\xE3\x82\x8F", + "\xAA\xF0" => "\xE3\x82\x90", + "\xAA\xF1" => "\xE3\x82\x91", + "\xAA\xF2" => "\xE3\x82\x92", + "\xAA\xF3" => "\xE3\x82\x93", + "\xAB\x41" => "\xEC\xB2\x94", + "\xAB\x42" => "\xEC\xB2\x95", + "\xAB\x43" => "\xEC\xB2\x96", + "\xAB\x44" => "\xEC\xB2\x97", + "\xAB\x45" => "\xEC\xB2\x9A", + "\xAB\x46" => "\xEC\xB2\x9B", + "\xAB\x47" => "\xEC\xB2\x9D", + "\xAB\x48" => "\xEC\xB2\x9E", + "\xAB\x49" => "\xEC\xB2\x9F", + "\xAB\x4A" => "\xEC\xB2\xA1", + "\xAB\x4B" => "\xEC\xB2\xA2", + "\xAB\x4C" => "\xEC\xB2\xA3", + "\xAB\x4D" => "\xEC\xB2\xA4", + "\xAB\x4E" => "\xEC\xB2\xA5", + "\xAB\x4F" => "\xEC\xB2\xA6", + "\xAB\x50" => "\xEC\xB2\xA7", + "\xAB\x51" => "\xEC\xB2\xAA", + "\xAB\x52" => "\xEC\xB2\xAE", + "\xAB\x53" => "\xEC\xB2\xAF", + "\xAB\x54" => "\xEC\xB2\xB0", + "\xAB\x55" => "\xEC\xB2\xB1", + "\xAB\x56" => "\xEC\xB2\xB2", + "\xAB\x57" => "\xEC\xB2\xB3", + "\xAB\x58" => "\xEC\xB2\xB6", + "\xAB\x59" => "\xEC\xB2\xB7", + "\xAB\x5A" => "\xEC\xB2\xB9", + "\xAB\x61" => "\xEC\xB2\xBA", + "\xAB\x62" => "\xEC\xB2\xBB", + "\xAB\x63" => "\xEC\xB2\xBD", + "\xAB\x64" => "\xEC\xB2\xBE", + "\xAB\x65" => "\xEC\xB2\xBF", + "\xAB\x66" => "\xEC\xB3\x80", + "\xAB\x67" => "\xEC\xB3\x81", + "\xAB\x68" => "\xEC\xB3\x82", + "\xAB\x69" => "\xEC\xB3\x83", + "\xAB\x6A" => "\xEC\xB3\x86", + "\xAB\x6B" => "\xEC\xB3\x88", + "\xAB\x6C" => "\xEC\xB3\x8A", + "\xAB\x6D" => "\xEC\xB3\x8B", + "\xAB\x6E" => "\xEC\xB3\x8C", + "\xAB\x6F" => "\xEC\xB3\x8D", + "\xAB\x70" => "\xEC\xB3\x8E", + "\xAB\x71" => "\xEC\xB3\x8F", + "\xAB\x72" => "\xEC\xB3\x91", + "\xAB\x73" => "\xEC\xB3\x92", + "\xAB\x74" => "\xEC\xB3\x93", + "\xAB\x75" => "\xEC\xB3\x95", + "\xAB\x76" => "\xEC\xB3\x96", + "\xAB\x77" => "\xEC\xB3\x97", + "\xAB\x78" => "\xEC\xB3\x98", + "\xAB\x79" => "\xEC\xB3\x99", + "\xAB\x7A" => "\xEC\xB3\x9A", + "\xAB\x81" => "\xEC\xB3\x9B", + "\xAB\x82" => "\xEC\xB3\x9C", + "\xAB\x83" => "\xEC\xB3\x9D", + "\xAB\x84" => "\xEC\xB3\x9E", + "\xAB\x85" => "\xEC\xB3\x9F", + "\xAB\x86" => "\xEC\xB3\xA0", + "\xAB\x87" => "\xEC\xB3\xA1", + "\xAB\x88" => "\xEC\xB3\xA2", + "\xAB\x89" => "\xEC\xB3\xA3", + "\xAB\x8A" => "\xEC\xB3\xA5", + "\xAB\x8B" => "\xEC\xB3\xA6", + "\xAB\x8C" => "\xEC\xB3\xA7", + "\xAB\x8D" => "\xEC\xB3\xA8", + "\xAB\x8E" => "\xEC\xB3\xA9", + "\xAB\x8F" => "\xEC\xB3\xAA", + "\xAB\x90" => "\xEC\xB3\xAB", + "\xAB\x91" => "\xEC\xB3\xAD", + "\xAB\x92" => "\xEC\xB3\xAE", + "\xAB\x93" => "\xEC\xB3\xAF", + "\xAB\x94" => "\xEC\xB3\xB1", + "\xAB\x95" => "\xEC\xB3\xB2", + "\xAB\x96" => "\xEC\xB3\xB3", + "\xAB\x97" => "\xEC\xB3\xB4", + "\xAB\x98" => "\xEC\xB3\xB5", + "\xAB\x99" => "\xEC\xB3\xB6", + "\xAB\x9A" => "\xEC\xB3\xB7", + "\xAB\x9B" => "\xEC\xB3\xB8", + "\xAB\x9C" => "\xEC\xB3\xB9", + "\xAB\x9D" => "\xEC\xB3\xBA", + "\xAB\x9E" => "\xEC\xB3\xBB", + "\xAB\x9F" => "\xEC\xB3\xBC", + "\xAB\xA0" => "\xEC\xB3\xBD", + "\xAB\xA1" => "\xE3\x82\xA1", + "\xAB\xA2" => "\xE3\x82\xA2", + "\xAB\xA3" => "\xE3\x82\xA3", + "\xAB\xA4" => "\xE3\x82\xA4", + "\xAB\xA5" => "\xE3\x82\xA5", + "\xAB\xA6" => "\xE3\x82\xA6", + "\xAB\xA7" => "\xE3\x82\xA7", + "\xAB\xA8" => "\xE3\x82\xA8", + "\xAB\xA9" => "\xE3\x82\xA9", + "\xAB\xAA" => "\xE3\x82\xAA", + "\xAB\xAB" => "\xE3\x82\xAB", + "\xAB\xAC" => "\xE3\x82\xAC", + "\xAB\xAD" => "\xE3\x82\xAD", + "\xAB\xAE" => "\xE3\x82\xAE", + "\xAB\xAF" => "\xE3\x82\xAF", + "\xAB\xB0" => "\xE3\x82\xB0", + "\xAB\xB1" => "\xE3\x82\xB1", + "\xAB\xB2" => "\xE3\x82\xB2", + "\xAB\xB3" => "\xE3\x82\xB3", + "\xAB\xB4" => "\xE3\x82\xB4", + "\xAB\xB5" => "\xE3\x82\xB5", + "\xAB\xB6" => "\xE3\x82\xB6", + "\xAB\xB7" => "\xE3\x82\xB7", + "\xAB\xB8" => "\xE3\x82\xB8", + "\xAB\xB9" => "\xE3\x82\xB9", + "\xAB\xBA" => "\xE3\x82\xBA", + "\xAB\xBB" => "\xE3\x82\xBB", + "\xAB\xBC" => "\xE3\x82\xBC", + "\xAB\xBD" => "\xE3\x82\xBD", + "\xAB\xBE" => "\xE3\x82\xBE", + "\xAB\xBF" => "\xE3\x82\xBF", + "\xAB\xC0" => "\xE3\x83\x80", + "\xAB\xC1" => "\xE3\x83\x81", + "\xAB\xC2" => "\xE3\x83\x82", + "\xAB\xC3" => "\xE3\x83\x83", + "\xAB\xC4" => "\xE3\x83\x84", + "\xAB\xC5" => "\xE3\x83\x85", + "\xAB\xC6" => "\xE3\x83\x86", + "\xAB\xC7" => "\xE3\x83\x87", + "\xAB\xC8" => "\xE3\x83\x88", + "\xAB\xC9" => "\xE3\x83\x89", + "\xAB\xCA" => "\xE3\x83\x8A", + "\xAB\xCB" => "\xE3\x83\x8B", + "\xAB\xCC" => "\xE3\x83\x8C", + "\xAB\xCD" => "\xE3\x83\x8D", + "\xAB\xCE" => "\xE3\x83\x8E", + "\xAB\xCF" => "\xE3\x83\x8F", + "\xAB\xD0" => "\xE3\x83\x90", + "\xAB\xD1" => "\xE3\x83\x91", + "\xAB\xD2" => "\xE3\x83\x92", + "\xAB\xD3" => "\xE3\x83\x93", + "\xAB\xD4" => "\xE3\x83\x94", + "\xAB\xD5" => "\xE3\x83\x95", + "\xAB\xD6" => "\xE3\x83\x96", + "\xAB\xD7" => "\xE3\x83\x97", + "\xAB\xD8" => "\xE3\x83\x98", + "\xAB\xD9" => "\xE3\x83\x99", + "\xAB\xDA" => "\xE3\x83\x9A", + "\xAB\xDB" => "\xE3\x83\x9B", + "\xAB\xDC" => "\xE3\x83\x9C", + "\xAB\xDD" => "\xE3\x83\x9D", + "\xAB\xDE" => "\xE3\x83\x9E", + "\xAB\xDF" => "\xE3\x83\x9F", + "\xAB\xE0" => "\xE3\x83\xA0", + "\xAB\xE1" => "\xE3\x83\xA1", + "\xAB\xE2" => "\xE3\x83\xA2", + "\xAB\xE3" => "\xE3\x83\xA3", + "\xAB\xE4" => "\xE3\x83\xA4", + "\xAB\xE5" => "\xE3\x83\xA5", + "\xAB\xE6" => "\xE3\x83\xA6", + "\xAB\xE7" => "\xE3\x83\xA7", + "\xAB\xE8" => "\xE3\x83\xA8", + "\xAB\xE9" => "\xE3\x83\xA9", + "\xAB\xEA" => "\xE3\x83\xAA", + "\xAB\xEB" => "\xE3\x83\xAB", + "\xAB\xEC" => "\xE3\x83\xAC", + "\xAB\xED" => "\xE3\x83\xAD", + "\xAB\xEE" => "\xE3\x83\xAE", + "\xAB\xEF" => "\xE3\x83\xAF", + "\xAB\xF0" => "\xE3\x83\xB0", + "\xAB\xF1" => "\xE3\x83\xB1", + "\xAB\xF2" => "\xE3\x83\xB2", + "\xAB\xF3" => "\xE3\x83\xB3", + "\xAB\xF4" => "\xE3\x83\xB4", + "\xAB\xF5" => "\xE3\x83\xB5", + "\xAB\xF6" => "\xE3\x83\xB6", + "\xAC\x41" => "\xEC\xB3\xBE", + "\xAC\x42" => "\xEC\xB3\xBF", + "\xAC\x43" => "\xEC\xB4\x80", + "\xAC\x44" => "\xEC\xB4\x82", + "\xAC\x45" => "\xEC\xB4\x83", + "\xAC\x46" => "\xEC\xB4\x84", + "\xAC\x47" => "\xEC\xB4\x85", + "\xAC\x48" => "\xEC\xB4\x86", + "\xAC\x49" => "\xEC\xB4\x87", + "\xAC\x4A" => "\xEC\xB4\x8A", + "\xAC\x4B" => "\xEC\xB4\x8B", + "\xAC\x4C" => "\xEC\xB4\x8D", + "\xAC\x4D" => "\xEC\xB4\x8E", + "\xAC\x4E" => "\xEC\xB4\x8F", + "\xAC\x4F" => "\xEC\xB4\x91", + "\xAC\x50" => "\xEC\xB4\x92", + "\xAC\x51" => "\xEC\xB4\x93", + "\xAC\x52" => "\xEC\xB4\x94", + "\xAC\x53" => "\xEC\xB4\x95", + "\xAC\x54" => "\xEC\xB4\x96", + "\xAC\x55" => "\xEC\xB4\x97", + "\xAC\x56" => "\xEC\xB4\x9A", + "\xAC\x57" => "\xEC\xB4\x9C", + "\xAC\x58" => "\xEC\xB4\x9E", + "\xAC\x59" => "\xEC\xB4\x9F", + "\xAC\x5A" => "\xEC\xB4\xA0", + "\xAC\x61" => "\xEC\xB4\xA1", + "\xAC\x62" => "\xEC\xB4\xA2", + "\xAC\x63" => "\xEC\xB4\xA3", + "\xAC\x64" => "\xEC\xB4\xA5", + "\xAC\x65" => "\xEC\xB4\xA6", + "\xAC\x66" => "\xEC\xB4\xA7", + "\xAC\x67" => "\xEC\xB4\xA9", + "\xAC\x68" => "\xEC\xB4\xAA", + "\xAC\x69" => "\xEC\xB4\xAB", + "\xAC\x6A" => "\xEC\xB4\xAD", + "\xAC\x6B" => "\xEC\xB4\xAE", + "\xAC\x6C" => "\xEC\xB4\xAF", + "\xAC\x6D" => "\xEC\xB4\xB0", + "\xAC\x6E" => "\xEC\xB4\xB1", + "\xAC\x6F" => "\xEC\xB4\xB2", + "\xAC\x70" => "\xEC\xB4\xB3", + "\xAC\x71" => "\xEC\xB4\xB4", + "\xAC\x72" => "\xEC\xB4\xB5", + "\xAC\x73" => "\xEC\xB4\xB6", + "\xAC\x74" => "\xEC\xB4\xB7", + "\xAC\x75" => "\xEC\xB4\xB8", + "\xAC\x76" => "\xEC\xB4\xBA", + "\xAC\x77" => "\xEC\xB4\xBB", + "\xAC\x78" => "\xEC\xB4\xBC", + "\xAC\x79" => "\xEC\xB4\xBD", + "\xAC\x7A" => "\xEC\xB4\xBE", + "\xAC\x81" => "\xEC\xB4\xBF", + "\xAC\x82" => "\xEC\xB5\x80", + "\xAC\x83" => "\xEC\xB5\x81", + "\xAC\x84" => "\xEC\xB5\x82", + "\xAC\x85" => "\xEC\xB5\x83", + "\xAC\x86" => "\xEC\xB5\x84", + "\xAC\x87" => "\xEC\xB5\x85", + "\xAC\x88" => "\xEC\xB5\x86", + "\xAC\x89" => "\xEC\xB5\x87", + "\xAC\x8A" => "\xEC\xB5\x88", + "\xAC\x8B" => "\xEC\xB5\x89", + "\xAC\x8C" => "\xEC\xB5\x8A", + "\xAC\x8D" => "\xEC\xB5\x8B", + "\xAC\x8E" => "\xEC\xB5\x8C", + "\xAC\x8F" => "\xEC\xB5\x8D", + "\xAC\x90" => "\xEC\xB5\x8E", + "\xAC\x91" => "\xEC\xB5\x8F", + "\xAC\x92" => "\xEC\xB5\x90", + "\xAC\x93" => "\xEC\xB5\x91", + "\xAC\x94" => "\xEC\xB5\x92", + "\xAC\x95" => "\xEC\xB5\x93", + "\xAC\x96" => "\xEC\xB5\x94", + "\xAC\x97" => "\xEC\xB5\x95", + "\xAC\x98" => "\xEC\xB5\x96", + "\xAC\x99" => "\xEC\xB5\x97", + "\xAC\x9A" => "\xEC\xB5\x98", + "\xAC\x9B" => "\xEC\xB5\x99", + "\xAC\x9C" => "\xEC\xB5\x9A", + "\xAC\x9D" => "\xEC\xB5\x9B", + "\xAC\x9E" => "\xEC\xB5\x9D", + "\xAC\x9F" => "\xEC\xB5\x9E", + "\xAC\xA0" => "\xEC\xB5\x9F", + "\xAC\xA1" => "\xD0\x90", + "\xAC\xA2" => "\xD0\x91", + "\xAC\xA3" => "\xD0\x92", + "\xAC\xA4" => "\xD0\x93", + "\xAC\xA5" => "\xD0\x94", + "\xAC\xA6" => "\xD0\x95", + "\xAC\xA7" => "\xD0\x81", + "\xAC\xA8" => "\xD0\x96", + "\xAC\xA9" => "\xD0\x97", + "\xAC\xAA" => "\xD0\x98", + "\xAC\xAB" => "\xD0\x99", + "\xAC\xAC" => "\xD0\x9A", + "\xAC\xAD" => "\xD0\x9B", + "\xAC\xAE" => "\xD0\x9C", + "\xAC\xAF" => "\xD0\x9D", + "\xAC\xB0" => "\xD0\x9E", + "\xAC\xB1" => "\xD0\x9F", + "\xAC\xB2" => "\xD0\xA0", + "\xAC\xB3" => "\xD0\xA1", + "\xAC\xB4" => "\xD0\xA2", + "\xAC\xB5" => "\xD0\xA3", + "\xAC\xB6" => "\xD0\xA4", + "\xAC\xB7" => "\xD0\xA5", + "\xAC\xB8" => "\xD0\xA6", + "\xAC\xB9" => "\xD0\xA7", + "\xAC\xBA" => "\xD0\xA8", + "\xAC\xBB" => "\xD0\xA9", + "\xAC\xBC" => "\xD0\xAA", + "\xAC\xBD" => "\xD0\xAB", + "\xAC\xBE" => "\xD0\xAC", + "\xAC\xBF" => "\xD0\xAD", + "\xAC\xC0" => "\xD0\xAE", + "\xAC\xC1" => "\xD0\xAF", + "\xAC\xD1" => "\xD0\xB0", + "\xAC\xD2" => "\xD0\xB1", + "\xAC\xD3" => "\xD0\xB2", + "\xAC\xD4" => "\xD0\xB3", + "\xAC\xD5" => "\xD0\xB4", + "\xAC\xD6" => "\xD0\xB5", + "\xAC\xD7" => "\xD1\x91", + "\xAC\xD8" => "\xD0\xB6", + "\xAC\xD9" => "\xD0\xB7", + "\xAC\xDA" => "\xD0\xB8", + "\xAC\xDB" => "\xD0\xB9", + "\xAC\xDC" => "\xD0\xBA", + "\xAC\xDD" => "\xD0\xBB", + "\xAC\xDE" => "\xD0\xBC", + "\xAC\xDF" => "\xD0\xBD", + "\xAC\xE0" => "\xD0\xBE", + "\xAC\xE1" => "\xD0\xBF", + "\xAC\xE2" => "\xD1\x80", + "\xAC\xE3" => "\xD1\x81", + "\xAC\xE4" => "\xD1\x82", + "\xAC\xE5" => "\xD1\x83", + "\xAC\xE6" => "\xD1\x84", + "\xAC\xE7" => "\xD1\x85", + "\xAC\xE8" => "\xD1\x86", + "\xAC\xE9" => "\xD1\x87", + "\xAC\xEA" => "\xD1\x88", + "\xAC\xEB" => "\xD1\x89", + "\xAC\xEC" => "\xD1\x8A", + "\xAC\xED" => "\xD1\x8B", + "\xAC\xEE" => "\xD1\x8C", + "\xAC\xEF" => "\xD1\x8D", + "\xAC\xF0" => "\xD1\x8E", + "\xAC\xF1" => "\xD1\x8F", + "\xAD\x41" => "\xEC\xB5\xA1", + "\xAD\x42" => "\xEC\xB5\xA2", + "\xAD\x43" => "\xEC\xB5\xA3", + "\xAD\x44" => "\xEC\xB5\xA5", + "\xAD\x45" => "\xEC\xB5\xA6", + "\xAD\x46" => "\xEC\xB5\xA7", + "\xAD\x47" => "\xEC\xB5\xA8", + "\xAD\x48" => "\xEC\xB5\xA9", + "\xAD\x49" => "\xEC\xB5\xAA", + "\xAD\x4A" => "\xEC\xB5\xAB", + "\xAD\x4B" => "\xEC\xB5\xAE", + "\xAD\x4C" => "\xEC\xB5\xB0", + "\xAD\x4D" => "\xEC\xB5\xB2", + "\xAD\x4E" => "\xEC\xB5\xB3", + "\xAD\x4F" => "\xEC\xB5\xB4", + "\xAD\x50" => "\xEC\xB5\xB5", + "\xAD\x51" => "\xEC\xB5\xB6", + "\xAD\x52" => "\xEC\xB5\xB7", + "\xAD\x53" => "\xEC\xB5\xB9", + "\xAD\x54" => "\xEC\xB5\xBA", + "\xAD\x55" => "\xEC\xB5\xBB", + "\xAD\x56" => "\xEC\xB5\xBC", + "\xAD\x57" => "\xEC\xB5\xBD", + "\xAD\x58" => "\xEC\xB5\xBE", + "\xAD\x59" => "\xEC\xB5\xBF", + "\xAD\x5A" => "\xEC\xB6\x80", + "\xAD\x61" => "\xEC\xB6\x81", + "\xAD\x62" => "\xEC\xB6\x82", + "\xAD\x63" => "\xEC\xB6\x83", + "\xAD\x64" => "\xEC\xB6\x84", + "\xAD\x65" => "\xEC\xB6\x85", + "\xAD\x66" => "\xEC\xB6\x86", + "\xAD\x67" => "\xEC\xB6\x87", + "\xAD\x68" => "\xEC\xB6\x89", + "\xAD\x69" => "\xEC\xB6\x8A", + "\xAD\x6A" => "\xEC\xB6\x8B", + "\xAD\x6B" => "\xEC\xB6\x8C", + "\xAD\x6C" => "\xEC\xB6\x8D", + "\xAD\x6D" => "\xEC\xB6\x8E", + "\xAD\x6E" => "\xEC\xB6\x8F", + "\xAD\x6F" => "\xEC\xB6\x90", + "\xAD\x70" => "\xEC\xB6\x91", + "\xAD\x71" => "\xEC\xB6\x92", + "\xAD\x72" => "\xEC\xB6\x93", + "\xAD\x73" => "\xEC\xB6\x96", + "\xAD\x74" => "\xEC\xB6\x97", + "\xAD\x75" => "\xEC\xB6\x99", + "\xAD\x76" => "\xEC\xB6\x9A", + "\xAD\x77" => "\xEC\xB6\x9B", + "\xAD\x78" => "\xEC\xB6\x9D", + "\xAD\x79" => "\xEC\xB6\x9E", + "\xAD\x7A" => "\xEC\xB6\x9F", + "\xAD\x81" => "\xEC\xB6\xA0", + "\xAD\x82" => "\xEC\xB6\xA1", + "\xAD\x83" => "\xEC\xB6\xA2", + "\xAD\x84" => "\xEC\xB6\xA3", + "\xAD\x85" => "\xEC\xB6\xA6", + "\xAD\x86" => "\xEC\xB6\xA8", + "\xAD\x87" => "\xEC\xB6\xAA", + "\xAD\x88" => "\xEC\xB6\xAB", + "\xAD\x89" => "\xEC\xB6\xAC", + "\xAD\x8A" => "\xEC\xB6\xAD", + "\xAD\x8B" => "\xEC\xB6\xAE", + "\xAD\x8C" => "\xEC\xB6\xAF", + "\xAD\x8D" => "\xEC\xB6\xB1", + "\xAD\x8E" => "\xEC\xB6\xB2", + "\xAD\x8F" => "\xEC\xB6\xB3", + "\xAD\x90" => "\xEC\xB6\xB4", + "\xAD\x91" => "\xEC\xB6\xB5", + "\xAD\x92" => "\xEC\xB6\xB6", + "\xAD\x93" => "\xEC\xB6\xB7", + "\xAD\x94" => "\xEC\xB6\xB8", + "\xAD\x95" => "\xEC\xB6\xB9", + "\xAD\x96" => "\xEC\xB6\xBA", + "\xAD\x97" => "\xEC\xB6\xBB", + "\xAD\x98" => "\xEC\xB6\xBC", + "\xAD\x99" => "\xEC\xB6\xBD", + "\xAD\x9A" => "\xEC\xB6\xBE", + "\xAD\x9B" => "\xEC\xB6\xBF", + "\xAD\x9C" => "\xEC\xB7\x80", + "\xAD\x9D" => "\xEC\xB7\x81", + "\xAD\x9E" => "\xEC\xB7\x82", + "\xAD\x9F" => "\xEC\xB7\x83", + "\xAD\xA0" => "\xEC\xB7\x85", + "\xAE\x41" => "\xEC\xB7\x86", + "\xAE\x42" => "\xEC\xB7\x87", + "\xAE\x43" => "\xEC\xB7\x88", + "\xAE\x44" => "\xEC\xB7\x89", + "\xAE\x45" => "\xEC\xB7\x8A", + "\xAE\x46" => "\xEC\xB7\x8B", + "\xAE\x47" => "\xEC\xB7\x8D", + "\xAE\x48" => "\xEC\xB7\x8E", + "\xAE\x49" => "\xEC\xB7\x8F", + "\xAE\x4A" => "\xEC\xB7\x91", + "\xAE\x4B" => "\xEC\xB7\x92", + "\xAE\x4C" => "\xEC\xB7\x93", + "\xAE\x4D" => "\xEC\xB7\x94", + "\xAE\x4E" => "\xEC\xB7\x95", + "\xAE\x4F" => "\xEC\xB7\x96", + "\xAE\x50" => "\xEC\xB7\x97", + "\xAE\x51" => "\xEC\xB7\x98", + "\xAE\x52" => "\xEC\xB7\x99", + "\xAE\x53" => "\xEC\xB7\x9A", + "\xAE\x54" => "\xEC\xB7\x9B", + "\xAE\x55" => "\xEC\xB7\x9C", + "\xAE\x56" => "\xEC\xB7\x9D", + "\xAE\x57" => "\xEC\xB7\x9E", + "\xAE\x58" => "\xEC\xB7\x9F", + "\xAE\x59" => "\xEC\xB7\xA0", + "\xAE\x5A" => "\xEC\xB7\xA1", + "\xAE\x61" => "\xEC\xB7\xA2", + "\xAE\x62" => "\xEC\xB7\xA3", + "\xAE\x63" => "\xEC\xB7\xA4", + "\xAE\x64" => "\xEC\xB7\xA5", + "\xAE\x65" => "\xEC\xB7\xA6", + "\xAE\x66" => "\xEC\xB7\xA7", + "\xAE\x67" => "\xEC\xB7\xA9", + "\xAE\x68" => "\xEC\xB7\xAA", + "\xAE\x69" => "\xEC\xB7\xAB", + "\xAE\x6A" => "\xEC\xB7\xAD", + "\xAE\x6B" => "\xEC\xB7\xAE", + "\xAE\x6C" => "\xEC\xB7\xAF", + "\xAE\x6D" => "\xEC\xB7\xB1", + "\xAE\x6E" => "\xEC\xB7\xB2", + "\xAE\x6F" => "\xEC\xB7\xB3", + "\xAE\x70" => "\xEC\xB7\xB4", + "\xAE\x71" => "\xEC\xB7\xB5", + "\xAE\x72" => "\xEC\xB7\xB6", + "\xAE\x73" => "\xEC\xB7\xB7", + "\xAE\x74" => "\xEC\xB7\xBA", + "\xAE\x75" => "\xEC\xB7\xBC", + "\xAE\x76" => "\xEC\xB7\xBE", + "\xAE\x77" => "\xEC\xB7\xBF", + "\xAE\x78" => "\xEC\xB8\x80", + "\xAE\x79" => "\xEC\xB8\x81", + "\xAE\x7A" => "\xEC\xB8\x82", + "\xAE\x81" => "\xEC\xB8\x83", + "\xAE\x82" => "\xEC\xB8\x85", + "\xAE\x83" => "\xEC\xB8\x86", + "\xAE\x84" => "\xEC\xB8\x87", + "\xAE\x85" => "\xEC\xB8\x89", + "\xAE\x86" => "\xEC\xB8\x8A", + "\xAE\x87" => "\xEC\xB8\x8B", + "\xAE\x88" => "\xEC\xB8\x8D", + "\xAE\x89" => "\xEC\xB8\x8E", + "\xAE\x8A" => "\xEC\xB8\x8F", + "\xAE\x8B" => "\xEC\xB8\x90", + "\xAE\x8C" => "\xEC\xB8\x91", + "\xAE\x8D" => "\xEC\xB8\x92", + "\xAE\x8E" => "\xEC\xB8\x93", + "\xAE\x8F" => "\xEC\xB8\x95", + "\xAE\x90" => "\xEC\xB8\x96", + "\xAE\x91" => "\xEC\xB8\x97", + "\xAE\x92" => "\xEC\xB8\x98", + "\xAE\x93" => "\xEC\xB8\x9A", + "\xAE\x94" => "\xEC\xB8\x9B", + "\xAE\x95" => "\xEC\xB8\x9C", + "\xAE\x96" => "\xEC\xB8\x9D", + "\xAE\x97" => "\xEC\xB8\x9E", + "\xAE\x98" => "\xEC\xB8\x9F", + "\xAE\x99" => "\xEC\xB8\xA2", + "\xAE\x9A" => "\xEC\xB8\xA3", + "\xAE\x9B" => "\xEC\xB8\xA5", + "\xAE\x9C" => "\xEC\xB8\xA6", + "\xAE\x9D" => "\xEC\xB8\xA7", + "\xAE\x9E" => "\xEC\xB8\xA9", + "\xAE\x9F" => "\xEC\xB8\xAA", + "\xAE\xA0" => "\xEC\xB8\xAB", + "\xAF\x41" => "\xEC\xB8\xAC", + "\xAF\x42" => "\xEC\xB8\xAD", + "\xAF\x43" => "\xEC\xB8\xAE", + "\xAF\x44" => "\xEC\xB8\xAF", + "\xAF\x45" => "\xEC\xB8\xB2", + "\xAF\x46" => "\xEC\xB8\xB4", + "\xAF\x47" => "\xEC\xB8\xB6", + "\xAF\x48" => "\xEC\xB8\xB7", + "\xAF\x49" => "\xEC\xB8\xB8", + "\xAF\x4A" => "\xEC\xB8\xB9", + "\xAF\x4B" => "\xEC\xB8\xBA", + "\xAF\x4C" => "\xEC\xB8\xBB", + "\xAF\x4D" => "\xEC\xB8\xBC", + "\xAF\x4E" => "\xEC\xB8\xBD", + "\xAF\x4F" => "\xEC\xB8\xBE", + "\xAF\x50" => "\xEC\xB8\xBF", + "\xAF\x51" => "\xEC\xB9\x80", + "\xAF\x52" => "\xEC\xB9\x81", + "\xAF\x53" => "\xEC\xB9\x82", + "\xAF\x54" => "\xEC\xB9\x83", + "\xAF\x55" => "\xEC\xB9\x84", + "\xAF\x56" => "\xEC\xB9\x85", + "\xAF\x57" => "\xEC\xB9\x86", + "\xAF\x58" => "\xEC\xB9\x87", + "\xAF\x59" => "\xEC\xB9\x88", + "\xAF\x5A" => "\xEC\xB9\x89", + "\xAF\x61" => "\xEC\xB9\x8A", + "\xAF\x62" => "\xEC\xB9\x8B", + "\xAF\x63" => "\xEC\xB9\x8C", + "\xAF\x64" => "\xEC\xB9\x8D", + "\xAF\x65" => "\xEC\xB9\x8E", + "\xAF\x66" => "\xEC\xB9\x8F", + "\xAF\x67" => "\xEC\xB9\x90", + "\xAF\x68" => "\xEC\xB9\x91", + "\xAF\x69" => "\xEC\xB9\x92", + "\xAF\x6A" => "\xEC\xB9\x93", + "\xAF\x6B" => "\xEC\xB9\x94", + "\xAF\x6C" => "\xEC\xB9\x95", + "\xAF\x6D" => "\xEC\xB9\x96", + "\xAF\x6E" => "\xEC\xB9\x97", + "\xAF\x6F" => "\xEC\xB9\x9A", + "\xAF\x70" => "\xEC\xB9\x9B", + "\xAF\x71" => "\xEC\xB9\x9D", + "\xAF\x72" => "\xEC\xB9\x9E", + "\xAF\x73" => "\xEC\xB9\xA2", + "\xAF\x74" => "\xEC\xB9\xA3", + "\xAF\x75" => "\xEC\xB9\xA4", + "\xAF\x76" => "\xEC\xB9\xA5", + "\xAF\x77" => "\xEC\xB9\xA6", + "\xAF\x78" => "\xEC\xB9\xA7", + "\xAF\x79" => "\xEC\xB9\xAA", + "\xAF\x7A" => "\xEC\xB9\xAC", + "\xAF\x81" => "\xEC\xB9\xAE", + "\xAF\x82" => "\xEC\xB9\xAF", + "\xAF\x83" => "\xEC\xB9\xB0", + "\xAF\x84" => "\xEC\xB9\xB1", + "\xAF\x85" => "\xEC\xB9\xB2", + "\xAF\x86" => "\xEC\xB9\xB3", + "\xAF\x87" => "\xEC\xB9\xB6", + "\xAF\x88" => "\xEC\xB9\xB7", + "\xAF\x89" => "\xEC\xB9\xB9", + "\xAF\x8A" => "\xEC\xB9\xBA", + "\xAF\x8B" => "\xEC\xB9\xBB", + "\xAF\x8C" => "\xEC\xB9\xBD", + "\xAF\x8D" => "\xEC\xB9\xBE", + "\xAF\x8E" => "\xEC\xB9\xBF", + "\xAF\x8F" => "\xEC\xBA\x80", + "\xAF\x90" => "\xEC\xBA\x81", + "\xAF\x91" => "\xEC\xBA\x82", + "\xAF\x92" => "\xEC\xBA\x83", + "\xAF\x93" => "\xEC\xBA\x86", + "\xAF\x94" => "\xEC\xBA\x88", + "\xAF\x95" => "\xEC\xBA\x8A", + "\xAF\x96" => "\xEC\xBA\x8B", + "\xAF\x97" => "\xEC\xBA\x8C", + "\xAF\x98" => "\xEC\xBA\x8D", + "\xAF\x99" => "\xEC\xBA\x8E", + "\xAF\x9A" => "\xEC\xBA\x8F", + "\xAF\x9B" => "\xEC\xBA\x92", + "\xAF\x9C" => "\xEC\xBA\x93", + "\xAF\x9D" => "\xEC\xBA\x95", + "\xAF\x9E" => "\xEC\xBA\x96", + "\xAF\x9F" => "\xEC\xBA\x97", + "\xAF\xA0" => "\xEC\xBA\x99", + "\xB0\x41" => "\xEC\xBA\x9A", + "\xB0\x42" => "\xEC\xBA\x9B", + "\xB0\x43" => "\xEC\xBA\x9C", + "\xB0\x44" => "\xEC\xBA\x9D", + "\xB0\x45" => "\xEC\xBA\x9E", + "\xB0\x46" => "\xEC\xBA\x9F", + "\xB0\x47" => "\xEC\xBA\xA2", + "\xB0\x48" => "\xEC\xBA\xA6", + "\xB0\x49" => "\xEC\xBA\xA7", + "\xB0\x4A" => "\xEC\xBA\xA8", + "\xB0\x4B" => "\xEC\xBA\xA9", + "\xB0\x4C" => "\xEC\xBA\xAA", + "\xB0\x4D" => "\xEC\xBA\xAB", + "\xB0\x4E" => "\xEC\xBA\xAE", + "\xB0\x4F" => "\xEC\xBA\xAF", + "\xB0\x50" => "\xEC\xBA\xB0", + "\xB0\x51" => "\xEC\xBA\xB1", + "\xB0\x52" => "\xEC\xBA\xB2", + "\xB0\x53" => "\xEC\xBA\xB3", + "\xB0\x54" => "\xEC\xBA\xB4", + "\xB0\x55" => "\xEC\xBA\xB5", + "\xB0\x56" => "\xEC\xBA\xB6", + "\xB0\x57" => "\xEC\xBA\xB7", + "\xB0\x58" => "\xEC\xBA\xB8", + "\xB0\x59" => "\xEC\xBA\xB9", + "\xB0\x5A" => "\xEC\xBA\xBA", + "\xB0\x61" => "\xEC\xBA\xBB", + "\xB0\x62" => "\xEC\xBA\xBC", + "\xB0\x63" => "\xEC\xBA\xBD", + "\xB0\x64" => "\xEC\xBA\xBE", + "\xB0\x65" => "\xEC\xBA\xBF", + "\xB0\x66" => "\xEC\xBB\x80", + "\xB0\x67" => "\xEC\xBB\x82", + "\xB0\x68" => "\xEC\xBB\x83", + "\xB0\x69" => "\xEC\xBB\x84", + "\xB0\x6A" => "\xEC\xBB\x85", + "\xB0\x6B" => "\xEC\xBB\x86", + "\xB0\x6C" => "\xEC\xBB\x87", + "\xB0\x6D" => "\xEC\xBB\x88", + "\xB0\x6E" => "\xEC\xBB\x89", + "\xB0\x6F" => "\xEC\xBB\x8A", + "\xB0\x70" => "\xEC\xBB\x8B", + "\xB0\x71" => "\xEC\xBB\x8C", + "\xB0\x72" => "\xEC\xBB\x8D", + "\xB0\x73" => "\xEC\xBB\x8E", + "\xB0\x74" => "\xEC\xBB\x8F", + "\xB0\x75" => "\xEC\xBB\x90", + "\xB0\x76" => "\xEC\xBB\x91", + "\xB0\x77" => "\xEC\xBB\x92", + "\xB0\x78" => "\xEC\xBB\x93", + "\xB0\x79" => "\xEC\xBB\x94", + "\xB0\x7A" => "\xEC\xBB\x95", + "\xB0\x81" => "\xEC\xBB\x96", + "\xB0\x82" => "\xEC\xBB\x97", + "\xB0\x83" => "\xEC\xBB\x98", + "\xB0\x84" => "\xEC\xBB\x99", + "\xB0\x85" => "\xEC\xBB\x9A", + "\xB0\x86" => "\xEC\xBB\x9B", + "\xB0\x87" => "\xEC\xBB\x9C", + "\xB0\x88" => "\xEC\xBB\x9D", + "\xB0\x89" => "\xEC\xBB\x9E", + "\xB0\x8A" => "\xEC\xBB\x9F", + "\xB0\x8B" => "\xEC\xBB\xA0", + "\xB0\x8C" => "\xEC\xBB\xA1", + "\xB0\x8D" => "\xEC\xBB\xA2", + "\xB0\x8E" => "\xEC\xBB\xA3", + "\xB0\x8F" => "\xEC\xBB\xA6", + "\xB0\x90" => "\xEC\xBB\xA7", + "\xB0\x91" => "\xEC\xBB\xA9", + "\xB0\x92" => "\xEC\xBB\xAA", + "\xB0\x93" => "\xEC\xBB\xAD", + "\xB0\x94" => "\xEC\xBB\xAE", + "\xB0\x95" => "\xEC\xBB\xAF", + "\xB0\x96" => "\xEC\xBB\xB0", + "\xB0\x97" => "\xEC\xBB\xB1", + "\xB0\x98" => "\xEC\xBB\xB2", + "\xB0\x99" => "\xEC\xBB\xB3", + "\xB0\x9A" => "\xEC\xBB\xB6", + "\xB0\x9B" => "\xEC\xBB\xBA", + "\xB0\x9C" => "\xEC\xBB\xBB", + "\xB0\x9D" => "\xEC\xBB\xBC", + "\xB0\x9E" => "\xEC\xBB\xBD", + "\xB0\x9F" => "\xEC\xBB\xBE", + "\xB0\xA0" => "\xEC\xBB\xBF", + "\xB0\xA1" => "\xEA\xB0\x80", + "\xB0\xA2" => "\xEA\xB0\x81", + "\xB0\xA3" => "\xEA\xB0\x84", + "\xB0\xA4" => "\xEA\xB0\x87", + "\xB0\xA5" => "\xEA\xB0\x88", + "\xB0\xA6" => "\xEA\xB0\x89", + "\xB0\xA7" => "\xEA\xB0\x8A", + "\xB0\xA8" => "\xEA\xB0\x90", + "\xB0\xA9" => "\xEA\xB0\x91", + "\xB0\xAA" => "\xEA\xB0\x92", + "\xB0\xAB" => "\xEA\xB0\x93", + "\xB0\xAC" => "\xEA\xB0\x94", + "\xB0\xAD" => "\xEA\xB0\x95", + "\xB0\xAE" => "\xEA\xB0\x96", + "\xB0\xAF" => "\xEA\xB0\x97", + "\xB0\xB0" => "\xEA\xB0\x99", + "\xB0\xB1" => "\xEA\xB0\x9A", + "\xB0\xB2" => "\xEA\xB0\x9B", + "\xB0\xB3" => "\xEA\xB0\x9C", + "\xB0\xB4" => "\xEA\xB0\x9D", + "\xB0\xB5" => "\xEA\xB0\xA0", + "\xB0\xB6" => "\xEA\xB0\xA4", + "\xB0\xB7" => "\xEA\xB0\xAC", + "\xB0\xB8" => "\xEA\xB0\xAD", + "\xB0\xB9" => "\xEA\xB0\xAF", + "\xB0\xBA" => "\xEA\xB0\xB0", + "\xB0\xBB" => "\xEA\xB0\xB1", + "\xB0\xBC" => "\xEA\xB0\xB8", + "\xB0\xBD" => "\xEA\xB0\xB9", + "\xB0\xBE" => "\xEA\xB0\xBC", + "\xB0\xBF" => "\xEA\xB1\x80", + "\xB0\xC0" => "\xEA\xB1\x8B", + "\xB0\xC1" => "\xEA\xB1\x8D", + "\xB0\xC2" => "\xEA\xB1\x94", + "\xB0\xC3" => "\xEA\xB1\x98", + "\xB0\xC4" => "\xEA\xB1\x9C", + "\xB0\xC5" => "\xEA\xB1\xB0", + "\xB0\xC6" => "\xEA\xB1\xB1", + "\xB0\xC7" => "\xEA\xB1\xB4", + "\xB0\xC8" => "\xEA\xB1\xB7", + "\xB0\xC9" => "\xEA\xB1\xB8", + "\xB0\xCA" => "\xEA\xB1\xBA", + "\xB0\xCB" => "\xEA\xB2\x80", + "\xB0\xCC" => "\xEA\xB2\x81", + "\xB0\xCD" => "\xEA\xB2\x83", + "\xB0\xCE" => "\xEA\xB2\x84", + "\xB0\xCF" => "\xEA\xB2\x85", + "\xB0\xD0" => "\xEA\xB2\x86", + "\xB0\xD1" => "\xEA\xB2\x89", + "\xB0\xD2" => "\xEA\xB2\x8A", + "\xB0\xD3" => "\xEA\xB2\x8B", + "\xB0\xD4" => "\xEA\xB2\x8C", + "\xB0\xD5" => "\xEA\xB2\x90", + "\xB0\xD6" => "\xEA\xB2\x94", + "\xB0\xD7" => "\xEA\xB2\x9C", + "\xB0\xD8" => "\xEA\xB2\x9D", + "\xB0\xD9" => "\xEA\xB2\x9F", + "\xB0\xDA" => "\xEA\xB2\xA0", + "\xB0\xDB" => "\xEA\xB2\xA1", + "\xB0\xDC" => "\xEA\xB2\xA8", + "\xB0\xDD" => "\xEA\xB2\xA9", + "\xB0\xDE" => "\xEA\xB2\xAA", + "\xB0\xDF" => "\xEA\xB2\xAC", + "\xB0\xE0" => "\xEA\xB2\xAF", + "\xB0\xE1" => "\xEA\xB2\xB0", + "\xB0\xE2" => "\xEA\xB2\xB8", + "\xB0\xE3" => "\xEA\xB2\xB9", + "\xB0\xE4" => "\xEA\xB2\xBB", + "\xB0\xE5" => "\xEA\xB2\xBC", + "\xB0\xE6" => "\xEA\xB2\xBD", + "\xB0\xE7" => "\xEA\xB3\x81", + "\xB0\xE8" => "\xEA\xB3\x84", + "\xB0\xE9" => "\xEA\xB3\x88", + "\xB0\xEA" => "\xEA\xB3\x8C", + "\xB0\xEB" => "\xEA\xB3\x95", + "\xB0\xEC" => "\xEA\xB3\x97", + "\xB0\xED" => "\xEA\xB3\xA0", + "\xB0\xEE" => "\xEA\xB3\xA1", + "\xB0\xEF" => "\xEA\xB3\xA4", + "\xB0\xF0" => "\xEA\xB3\xA7", + "\xB0\xF1" => "\xEA\xB3\xA8", + "\xB0\xF2" => "\xEA\xB3\xAA", + "\xB0\xF3" => "\xEA\xB3\xAC", + "\xB0\xF4" => "\xEA\xB3\xAF", + "\xB0\xF5" => "\xEA\xB3\xB0", + "\xB0\xF6" => "\xEA\xB3\xB1", + "\xB0\xF7" => "\xEA\xB3\xB3", + "\xB0\xF8" => "\xEA\xB3\xB5", + "\xB0\xF9" => "\xEA\xB3\xB6", + "\xB0\xFA" => "\xEA\xB3\xBC", + "\xB0\xFB" => "\xEA\xB3\xBD", + "\xB0\xFC" => "\xEA\xB4\x80", + "\xB0\xFD" => "\xEA\xB4\x84", + "\xB0\xFE" => "\xEA\xB4\x86", + "\xB1\x41" => "\xEC\xBC\x82", + "\xB1\x42" => "\xEC\xBC\x83", + "\xB1\x43" => "\xEC\xBC\x85", + "\xB1\x44" => "\xEC\xBC\x86", + "\xB1\x45" => "\xEC\xBC\x87", + "\xB1\x46" => "\xEC\xBC\x89", + "\xB1\x47" => "\xEC\xBC\x8A", + "\xB1\x48" => "\xEC\xBC\x8B", + "\xB1\x49" => "\xEC\xBC\x8C", + "\xB1\x4A" => "\xEC\xBC\x8D", + "\xB1\x4B" => "\xEC\xBC\x8E", + "\xB1\x4C" => "\xEC\xBC\x8F", + "\xB1\x4D" => "\xEC\xBC\x92", + "\xB1\x4E" => "\xEC\xBC\x94", + "\xB1\x4F" => "\xEC\xBC\x96", + "\xB1\x50" => "\xEC\xBC\x97", + "\xB1\x51" => "\xEC\xBC\x98", + "\xB1\x52" => "\xEC\xBC\x99", + "\xB1\x53" => "\xEC\xBC\x9A", + "\xB1\x54" => "\xEC\xBC\x9B", + "\xB1\x55" => "\xEC\xBC\x9D", + "\xB1\x56" => "\xEC\xBC\x9E", + "\xB1\x57" => "\xEC\xBC\x9F", + "\xB1\x58" => "\xEC\xBC\xA1", + "\xB1\x59" => "\xEC\xBC\xA2", + "\xB1\x5A" => "\xEC\xBC\xA3", + "\xB1\x61" => "\xEC\xBC\xA5", + "\xB1\x62" => "\xEC\xBC\xA6", + "\xB1\x63" => "\xEC\xBC\xA7", + "\xB1\x64" => "\xEC\xBC\xA8", + "\xB1\x65" => "\xEC\xBC\xA9", + "\xB1\x66" => "\xEC\xBC\xAA", + "\xB1\x67" => "\xEC\xBC\xAB", + "\xB1\x68" => "\xEC\xBC\xAE", + "\xB1\x69" => "\xEC\xBC\xB2", + "\xB1\x6A" => "\xEC\xBC\xB3", + "\xB1\x6B" => "\xEC\xBC\xB4", + "\xB1\x6C" => "\xEC\xBC\xB5", + "\xB1\x6D" => "\xEC\xBC\xB6", + "\xB1\x6E" => "\xEC\xBC\xB7", + "\xB1\x6F" => "\xEC\xBC\xB9", + "\xB1\x70" => "\xEC\xBC\xBA", + "\xB1\x71" => "\xEC\xBC\xBB", + "\xB1\x72" => "\xEC\xBC\xBC", + "\xB1\x73" => "\xEC\xBC\xBD", + "\xB1\x74" => "\xEC\xBC\xBE", + "\xB1\x75" => "\xEC\xBC\xBF", + "\xB1\x76" => "\xEC\xBD\x80", + "\xB1\x77" => "\xEC\xBD\x81", + "\xB1\x78" => "\xEC\xBD\x82", + "\xB1\x79" => "\xEC\xBD\x83", + "\xB1\x7A" => "\xEC\xBD\x84", + "\xB1\x81" => "\xEC\xBD\x85", + "\xB1\x82" => "\xEC\xBD\x86", + "\xB1\x83" => "\xEC\xBD\x87", + "\xB1\x84" => "\xEC\xBD\x88", + "\xB1\x85" => "\xEC\xBD\x89", + "\xB1\x86" => "\xEC\xBD\x8A", + "\xB1\x87" => "\xEC\xBD\x8B", + "\xB1\x88" => "\xEC\xBD\x8C", + "\xB1\x89" => "\xEC\xBD\x8D", + "\xB1\x8A" => "\xEC\xBD\x8E", + "\xB1\x8B" => "\xEC\xBD\x8F", + "\xB1\x8C" => "\xEC\xBD\x90", + "\xB1\x8D" => "\xEC\xBD\x91", + "\xB1\x8E" => "\xEC\xBD\x92", + "\xB1\x8F" => "\xEC\xBD\x93", + "\xB1\x90" => "\xEC\xBD\x96", + "\xB1\x91" => "\xEC\xBD\x97", + "\xB1\x92" => "\xEC\xBD\x99", + "\xB1\x93" => "\xEC\xBD\x9A", + "\xB1\x94" => "\xEC\xBD\x9B", + "\xB1\x95" => "\xEC\xBD\x9D", + "\xB1\x96" => "\xEC\xBD\x9E", + "\xB1\x97" => "\xEC\xBD\x9F", + "\xB1\x98" => "\xEC\xBD\xA0", + "\xB1\x99" => "\xEC\xBD\xA1", + "\xB1\x9A" => "\xEC\xBD\xA2", + "\xB1\x9B" => "\xEC\xBD\xA3", + "\xB1\x9C" => "\xEC\xBD\xA6", + "\xB1\x9D" => "\xEC\xBD\xA8", + "\xB1\x9E" => "\xEC\xBD\xAA", + "\xB1\x9F" => "\xEC\xBD\xAB", + "\xB1\xA0" => "\xEC\xBD\xAC", + "\xB1\xA1" => "\xEA\xB4\x8C", + "\xB1\xA2" => "\xEA\xB4\x8D", + "\xB1\xA3" => "\xEA\xB4\x8F", + "\xB1\xA4" => "\xEA\xB4\x91", + "\xB1\xA5" => "\xEA\xB4\x98", + "\xB1\xA6" => "\xEA\xB4\x9C", + "\xB1\xA7" => "\xEA\xB4\xA0", + "\xB1\xA8" => "\xEA\xB4\xA9", + "\xB1\xA9" => "\xEA\xB4\xAC", + "\xB1\xAA" => "\xEA\xB4\xAD", + "\xB1\xAB" => "\xEA\xB4\xB4", + "\xB1\xAC" => "\xEA\xB4\xB5", + "\xB1\xAD" => "\xEA\xB4\xB8", + "\xB1\xAE" => "\xEA\xB4\xBC", + "\xB1\xAF" => "\xEA\xB5\x84", + "\xB1\xB0" => "\xEA\xB5\x85", + "\xB1\xB1" => "\xEA\xB5\x87", + "\xB1\xB2" => "\xEA\xB5\x89", + "\xB1\xB3" => "\xEA\xB5\x90", + "\xB1\xB4" => "\xEA\xB5\x94", + "\xB1\xB5" => "\xEA\xB5\x98", + "\xB1\xB6" => "\xEA\xB5\xA1", + "\xB1\xB7" => "\xEA\xB5\xA3", + "\xB1\xB8" => "\xEA\xB5\xAC", + "\xB1\xB9" => "\xEA\xB5\xAD", + "\xB1\xBA" => "\xEA\xB5\xB0", + "\xB1\xBB" => "\xEA\xB5\xB3", + "\xB1\xBC" => "\xEA\xB5\xB4", + "\xB1\xBD" => "\xEA\xB5\xB5", + "\xB1\xBE" => "\xEA\xB5\xB6", + "\xB1\xBF" => "\xEA\xB5\xBB", + "\xB1\xC0" => "\xEA\xB5\xBC", + "\xB1\xC1" => "\xEA\xB5\xBD", + "\xB1\xC2" => "\xEA\xB5\xBF", + "\xB1\xC3" => "\xEA\xB6\x81", + "\xB1\xC4" => "\xEA\xB6\x82", + "\xB1\xC5" => "\xEA\xB6\x88", + "\xB1\xC6" => "\xEA\xB6\x89", + "\xB1\xC7" => "\xEA\xB6\x8C", + "\xB1\xC8" => "\xEA\xB6\x90", + "\xB1\xC9" => "\xEA\xB6\x9C", + "\xB1\xCA" => "\xEA\xB6\x9D", + "\xB1\xCB" => "\xEA\xB6\xA4", + "\xB1\xCC" => "\xEA\xB6\xB7", + "\xB1\xCD" => "\xEA\xB7\x80", + "\xB1\xCE" => "\xEA\xB7\x81", + "\xB1\xCF" => "\xEA\xB7\x84", + "\xB1\xD0" => "\xEA\xB7\x88", + "\xB1\xD1" => "\xEA\xB7\x90", + "\xB1\xD2" => "\xEA\xB7\x91", + "\xB1\xD3" => "\xEA\xB7\x93", + "\xB1\xD4" => "\xEA\xB7\x9C", + "\xB1\xD5" => "\xEA\xB7\xA0", + "\xB1\xD6" => "\xEA\xB7\xA4", + "\xB1\xD7" => "\xEA\xB7\xB8", + "\xB1\xD8" => "\xEA\xB7\xB9", + "\xB1\xD9" => "\xEA\xB7\xBC", + "\xB1\xDA" => "\xEA\xB7\xBF", + "\xB1\xDB" => "\xEA\xB8\x80", + "\xB1\xDC" => "\xEA\xB8\x81", + "\xB1\xDD" => "\xEA\xB8\x88", + "\xB1\xDE" => "\xEA\xB8\x89", + "\xB1\xDF" => "\xEA\xB8\x8B", + "\xB1\xE0" => "\xEA\xB8\x8D", + "\xB1\xE1" => "\xEA\xB8\x94", + "\xB1\xE2" => "\xEA\xB8\xB0", + "\xB1\xE3" => "\xEA\xB8\xB1", + "\xB1\xE4" => "\xEA\xB8\xB4", + "\xB1\xE5" => "\xEA\xB8\xB7", + "\xB1\xE6" => "\xEA\xB8\xB8", + "\xB1\xE7" => "\xEA\xB8\xBA", + "\xB1\xE8" => "\xEA\xB9\x80", + "\xB1\xE9" => "\xEA\xB9\x81", + "\xB1\xEA" => "\xEA\xB9\x83", + "\xB1\xEB" => "\xEA\xB9\x85", + "\xB1\xEC" => "\xEA\xB9\x86", + "\xB1\xED" => "\xEA\xB9\x8A", + "\xB1\xEE" => "\xEA\xB9\x8C", + "\xB1\xEF" => "\xEA\xB9\x8D", + "\xB1\xF0" => "\xEA\xB9\x8E", + "\xB1\xF1" => "\xEA\xB9\x90", + "\xB1\xF2" => "\xEA\xB9\x94", + "\xB1\xF3" => "\xEA\xB9\x96", + "\xB1\xF4" => "\xEA\xB9\x9C", + "\xB1\xF5" => "\xEA\xB9\x9D", + "\xB1\xF6" => "\xEA\xB9\x9F", + "\xB1\xF7" => "\xEA\xB9\xA0", + "\xB1\xF8" => "\xEA\xB9\xA1", + "\xB1\xF9" => "\xEA\xB9\xA5", + "\xB1\xFA" => "\xEA\xB9\xA8", + "\xB1\xFB" => "\xEA\xB9\xA9", + "\xB1\xFC" => "\xEA\xB9\xAC", + "\xB1\xFD" => "\xEA\xB9\xB0", + "\xB1\xFE" => "\xEA\xB9\xB8", + "\xB2\x41" => "\xEC\xBD\xAD", + "\xB2\x42" => "\xEC\xBD\xAE", + "\xB2\x43" => "\xEC\xBD\xAF", + "\xB2\x44" => "\xEC\xBD\xB2", + "\xB2\x45" => "\xEC\xBD\xB3", + "\xB2\x46" => "\xEC\xBD\xB5", + "\xB2\x47" => "\xEC\xBD\xB6", + "\xB2\x48" => "\xEC\xBD\xB7", + "\xB2\x49" => "\xEC\xBD\xB9", + "\xB2\x4A" => "\xEC\xBD\xBA", + "\xB2\x4B" => "\xEC\xBD\xBB", + "\xB2\x4C" => "\xEC\xBD\xBC", + "\xB2\x4D" => "\xEC\xBD\xBD", + "\xB2\x4E" => "\xEC\xBD\xBE", + "\xB2\x4F" => "\xEC\xBD\xBF", + "\xB2\x50" => "\xEC\xBE\x81", + "\xB2\x51" => "\xEC\xBE\x82", + "\xB2\x52" => "\xEC\xBE\x83", + "\xB2\x53" => "\xEC\xBE\x84", + "\xB2\x54" => "\xEC\xBE\x86", + "\xB2\x55" => "\xEC\xBE\x87", + "\xB2\x56" => "\xEC\xBE\x88", + "\xB2\x57" => "\xEC\xBE\x89", + "\xB2\x58" => "\xEC\xBE\x8A", + "\xB2\x59" => "\xEC\xBE\x8B", + "\xB2\x5A" => "\xEC\xBE\x8D", + "\xB2\x61" => "\xEC\xBE\x8E", + "\xB2\x62" => "\xEC\xBE\x8F", + "\xB2\x63" => "\xEC\xBE\x90", + "\xB2\x64" => "\xEC\xBE\x91", + "\xB2\x65" => "\xEC\xBE\x92", + "\xB2\x66" => "\xEC\xBE\x93", + "\xB2\x67" => "\xEC\xBE\x94", + "\xB2\x68" => "\xEC\xBE\x95", + "\xB2\x69" => "\xEC\xBE\x96", + "\xB2\x6A" => "\xEC\xBE\x97", + "\xB2\x6B" => "\xEC\xBE\x98", + "\xB2\x6C" => "\xEC\xBE\x99", + "\xB2\x6D" => "\xEC\xBE\x9A", + "\xB2\x6E" => "\xEC\xBE\x9B", + "\xB2\x6F" => "\xEC\xBE\x9C", + "\xB2\x70" => "\xEC\xBE\x9D", + "\xB2\x71" => "\xEC\xBE\x9E", + "\xB2\x72" => "\xEC\xBE\x9F", + "\xB2\x73" => "\xEC\xBE\xA0", + "\xB2\x74" => "\xEC\xBE\xA2", + "\xB2\x75" => "\xEC\xBE\xA3", + "\xB2\x76" => "\xEC\xBE\xA4", + "\xB2\x77" => "\xEC\xBE\xA5", + "\xB2\x78" => "\xEC\xBE\xA6", + "\xB2\x79" => "\xEC\xBE\xA7", + "\xB2\x7A" => "\xEC\xBE\xA9", + "\xB2\x81" => "\xEC\xBE\xAA", + "\xB2\x82" => "\xEC\xBE\xAB", + "\xB2\x83" => "\xEC\xBE\xAC", + "\xB2\x84" => "\xEC\xBE\xAD", + "\xB2\x85" => "\xEC\xBE\xAE", + "\xB2\x86" => "\xEC\xBE\xAF", + "\xB2\x87" => "\xEC\xBE\xB1", + "\xB2\x88" => "\xEC\xBE\xB2", + "\xB2\x89" => "\xEC\xBE\xB3", + "\xB2\x8A" => "\xEC\xBE\xB4", + "\xB2\x8B" => "\xEC\xBE\xB5", + "\xB2\x8C" => "\xEC\xBE\xB6", + "\xB2\x8D" => "\xEC\xBE\xB7", + "\xB2\x8E" => "\xEC\xBE\xB8", + "\xB2\x8F" => "\xEC\xBE\xB9", + "\xB2\x90" => "\xEC\xBE\xBA", + "\xB2\x91" => "\xEC\xBE\xBB", + "\xB2\x92" => "\xEC\xBE\xBC", + "\xB2\x93" => "\xEC\xBE\xBD", + "\xB2\x94" => "\xEC\xBE\xBE", + "\xB2\x95" => "\xEC\xBE\xBF", + "\xB2\x96" => "\xEC\xBF\x80", + "\xB2\x97" => "\xEC\xBF\x81", + "\xB2\x98" => "\xEC\xBF\x82", + "\xB2\x99" => "\xEC\xBF\x83", + "\xB2\x9A" => "\xEC\xBF\x85", + "\xB2\x9B" => "\xEC\xBF\x86", + "\xB2\x9C" => "\xEC\xBF\x87", + "\xB2\x9D" => "\xEC\xBF\x88", + "\xB2\x9E" => "\xEC\xBF\x89", + "\xB2\x9F" => "\xEC\xBF\x8A", + "\xB2\xA0" => "\xEC\xBF\x8B", + "\xB2\xA1" => "\xEA\xB9\xB9", + "\xB2\xA2" => "\xEA\xB9\xBB", + "\xB2\xA3" => "\xEA\xB9\xBC", + "\xB2\xA4" => "\xEA\xB9\xBD", + "\xB2\xA5" => "\xEA\xBA\x84", + "\xB2\xA6" => "\xEA\xBA\x85", + "\xB2\xA7" => "\xEA\xBA\x8C", + "\xB2\xA8" => "\xEA\xBA\xBC", + "\xB2\xA9" => "\xEA\xBA\xBD", + "\xB2\xAA" => "\xEA\xBA\xBE", + "\xB2\xAB" => "\xEA\xBB\x80", + "\xB2\xAC" => "\xEA\xBB\x84", + "\xB2\xAD" => "\xEA\xBB\x8C", + "\xB2\xAE" => "\xEA\xBB\x8D", + "\xB2\xAF" => "\xEA\xBB\x8F", + "\xB2\xB0" => "\xEA\xBB\x90", + "\xB2\xB1" => "\xEA\xBB\x91", + "\xB2\xB2" => "\xEA\xBB\x98", + "\xB2\xB3" => "\xEA\xBB\x99", + "\xB2\xB4" => "\xEA\xBB\x9C", + "\xB2\xB5" => "\xEA\xBB\xA8", + "\xB2\xB6" => "\xEA\xBB\xAB", + "\xB2\xB7" => "\xEA\xBB\xAD", + "\xB2\xB8" => "\xEA\xBB\xB4", + "\xB2\xB9" => "\xEA\xBB\xB8", + "\xB2\xBA" => "\xEA\xBB\xBC", + "\xB2\xBB" => "\xEA\xBC\x87", + "\xB2\xBC" => "\xEA\xBC\x88", + "\xB2\xBD" => "\xEA\xBC\x8D", + "\xB2\xBE" => "\xEA\xBC\x90", + "\xB2\xBF" => "\xEA\xBC\xAC", + "\xB2\xC0" => "\xEA\xBC\xAD", + "\xB2\xC1" => "\xEA\xBC\xB0", + "\xB2\xC2" => "\xEA\xBC\xB2", + "\xB2\xC3" => "\xEA\xBC\xB4", + "\xB2\xC4" => "\xEA\xBC\xBC", + "\xB2\xC5" => "\xEA\xBC\xBD", + "\xB2\xC6" => "\xEA\xBC\xBF", + "\xB2\xC7" => "\xEA\xBD\x81", + "\xB2\xC8" => "\xEA\xBD\x82", + "\xB2\xC9" => "\xEA\xBD\x83", + "\xB2\xCA" => "\xEA\xBD\x88", + "\xB2\xCB" => "\xEA\xBD\x89", + "\xB2\xCC" => "\xEA\xBD\x90", + "\xB2\xCD" => "\xEA\xBD\x9C", + "\xB2\xCE" => "\xEA\xBD\x9D", + "\xB2\xCF" => "\xEA\xBD\xA4", + "\xB2\xD0" => "\xEA\xBD\xA5", + "\xB2\xD1" => "\xEA\xBD\xB9", + "\xB2\xD2" => "\xEA\xBE\x80", + "\xB2\xD3" => "\xEA\xBE\x84", + "\xB2\xD4" => "\xEA\xBE\x88", + "\xB2\xD5" => "\xEA\xBE\x90", + "\xB2\xD6" => "\xEA\xBE\x91", + "\xB2\xD7" => "\xEA\xBE\x95", + "\xB2\xD8" => "\xEA\xBE\x9C", + "\xB2\xD9" => "\xEA\xBE\xB8", + "\xB2\xDA" => "\xEA\xBE\xB9", + "\xB2\xDB" => "\xEA\xBE\xBC", + "\xB2\xDC" => "\xEA\xBF\x80", + "\xB2\xDD" => "\xEA\xBF\x87", + "\xB2\xDE" => "\xEA\xBF\x88", + "\xB2\xDF" => "\xEA\xBF\x89", + "\xB2\xE0" => "\xEA\xBF\x8B", + "\xB2\xE1" => "\xEA\xBF\x8D", + "\xB2\xE2" => "\xEA\xBF\x8E", + "\xB2\xE3" => "\xEA\xBF\x94", + "\xB2\xE4" => "\xEA\xBF\x9C", + "\xB2\xE5" => "\xEA\xBF\xA8", + "\xB2\xE6" => "\xEA\xBF\xA9", + "\xB2\xE7" => "\xEA\xBF\xB0", + "\xB2\xE8" => "\xEA\xBF\xB1", + "\xB2\xE9" => "\xEA\xBF\xB4", + "\xB2\xEA" => "\xEA\xBF\xB8", + "\xB2\xEB" => "\xEB\x80\x80", + "\xB2\xEC" => "\xEB\x80\x81", + "\xB2\xED" => "\xEB\x80\x84", + "\xB2\xEE" => "\xEB\x80\x8C", + "\xB2\xEF" => "\xEB\x80\x90", + "\xB2\xF0" => "\xEB\x80\x94", + "\xB2\xF1" => "\xEB\x80\x9C", + "\xB2\xF2" => "\xEB\x80\x9D", + "\xB2\xF3" => "\xEB\x80\xA8", + "\xB2\xF4" => "\xEB\x81\x84", + "\xB2\xF5" => "\xEB\x81\x85", + "\xB2\xF6" => "\xEB\x81\x88", + "\xB2\xF7" => "\xEB\x81\x8A", + "\xB2\xF8" => "\xEB\x81\x8C", + "\xB2\xF9" => "\xEB\x81\x8E", + "\xB2\xFA" => "\xEB\x81\x93", + "\xB2\xFB" => "\xEB\x81\x94", + "\xB2\xFC" => "\xEB\x81\x95", + "\xB2\xFD" => "\xEB\x81\x97", + "\xB2\xFE" => "\xEB\x81\x99", + "\xB3\x41" => "\xEC\xBF\x8C", + "\xB3\x42" => "\xEC\xBF\x8D", + "\xB3\x43" => "\xEC\xBF\x8E", + "\xB3\x44" => "\xEC\xBF\x8F", + "\xB3\x45" => "\xEC\xBF\x90", + "\xB3\x46" => "\xEC\xBF\x91", + "\xB3\x47" => "\xEC\xBF\x92", + "\xB3\x48" => "\xEC\xBF\x93", + "\xB3\x49" => "\xEC\xBF\x94", + "\xB3\x4A" => "\xEC\xBF\x95", + "\xB3\x4B" => "\xEC\xBF\x96", + "\xB3\x4C" => "\xEC\xBF\x97", + "\xB3\x4D" => "\xEC\xBF\x98", + "\xB3\x4E" => "\xEC\xBF\x99", + "\xB3\x4F" => "\xEC\xBF\x9A", + "\xB3\x50" => "\xEC\xBF\x9B", + "\xB3\x51" => "\xEC\xBF\x9C", + "\xB3\x52" => "\xEC\xBF\x9D", + "\xB3\x53" => "\xEC\xBF\x9E", + "\xB3\x54" => "\xEC\xBF\x9F", + "\xB3\x55" => "\xEC\xBF\xA2", + "\xB3\x56" => "\xEC\xBF\xA3", + "\xB3\x57" => "\xEC\xBF\xA5", + "\xB3\x58" => "\xEC\xBF\xA6", + "\xB3\x59" => "\xEC\xBF\xA7", + "\xB3\x5A" => "\xEC\xBF\xA9", + "\xB3\x61" => "\xEC\xBF\xAA", + "\xB3\x62" => "\xEC\xBF\xAB", + "\xB3\x63" => "\xEC\xBF\xAC", + "\xB3\x64" => "\xEC\xBF\xAD", + "\xB3\x65" => "\xEC\xBF\xAE", + "\xB3\x66" => "\xEC\xBF\xAF", + "\xB3\x67" => "\xEC\xBF\xB2", + "\xB3\x68" => "\xEC\xBF\xB4", + "\xB3\x69" => "\xEC\xBF\xB6", + "\xB3\x6A" => "\xEC\xBF\xB7", + "\xB3\x6B" => "\xEC\xBF\xB8", + "\xB3\x6C" => "\xEC\xBF\xB9", + "\xB3\x6D" => "\xEC\xBF\xBA", + "\xB3\x6E" => "\xEC\xBF\xBB", + "\xB3\x6F" => "\xEC\xBF\xBD", + "\xB3\x70" => "\xEC\xBF\xBE", + "\xB3\x71" => "\xEC\xBF\xBF", + "\xB3\x72" => "\xED\x80\x81", + "\xB3\x73" => "\xED\x80\x82", + "\xB3\x74" => "\xED\x80\x83", + "\xB3\x75" => "\xED\x80\x85", + "\xB3\x76" => "\xED\x80\x86", + "\xB3\x77" => "\xED\x80\x87", + "\xB3\x78" => "\xED\x80\x88", + "\xB3\x79" => "\xED\x80\x89", + "\xB3\x7A" => "\xED\x80\x8A", + "\xB3\x81" => "\xED\x80\x8B", + "\xB3\x82" => "\xED\x80\x8C", + "\xB3\x83" => "\xED\x80\x8D", + "\xB3\x84" => "\xED\x80\x8E", + "\xB3\x85" => "\xED\x80\x8F", + "\xB3\x86" => "\xED\x80\x90", + "\xB3\x87" => "\xED\x80\x92", + "\xB3\x88" => "\xED\x80\x93", + "\xB3\x89" => "\xED\x80\x94", + "\xB3\x8A" => "\xED\x80\x95", + "\xB3\x8B" => "\xED\x80\x96", + "\xB3\x8C" => "\xED\x80\x97", + "\xB3\x8D" => "\xED\x80\x99", + "\xB3\x8E" => "\xED\x80\x9A", + "\xB3\x8F" => "\xED\x80\x9B", + "\xB3\x90" => "\xED\x80\x9C", + "\xB3\x91" => "\xED\x80\x9D", + "\xB3\x92" => "\xED\x80\x9E", + "\xB3\x93" => "\xED\x80\x9F", + "\xB3\x94" => "\xED\x80\xA0", + "\xB3\x95" => "\xED\x80\xA1", + "\xB3\x96" => "\xED\x80\xA2", + "\xB3\x97" => "\xED\x80\xA3", + "\xB3\x98" => "\xED\x80\xA4", + "\xB3\x99" => "\xED\x80\xA5", + "\xB3\x9A" => "\xED\x80\xA6", + "\xB3\x9B" => "\xED\x80\xA7", + "\xB3\x9C" => "\xED\x80\xA8", + "\xB3\x9D" => "\xED\x80\xA9", + "\xB3\x9E" => "\xED\x80\xAA", + "\xB3\x9F" => "\xED\x80\xAB", + "\xB3\xA0" => "\xED\x80\xAC", + "\xB3\xA1" => "\xEB\x81\x9D", + "\xB3\xA2" => "\xEB\x81\xBC", + "\xB3\xA3" => "\xEB\x81\xBD", + "\xB3\xA4" => "\xEB\x82\x80", + "\xB3\xA5" => "\xEB\x82\x84", + "\xB3\xA6" => "\xEB\x82\x8C", + "\xB3\xA7" => "\xEB\x82\x8D", + "\xB3\xA8" => "\xEB\x82\x8F", + "\xB3\xA9" => "\xEB\x82\x91", + "\xB3\xAA" => "\xEB\x82\x98", + "\xB3\xAB" => "\xEB\x82\x99", + "\xB3\xAC" => "\xEB\x82\x9A", + "\xB3\xAD" => "\xEB\x82\x9C", + "\xB3\xAE" => "\xEB\x82\x9F", + "\xB3\xAF" => "\xEB\x82\xA0", + "\xB3\xB0" => "\xEB\x82\xA1", + "\xB3\xB1" => "\xEB\x82\xA2", + "\xB3\xB2" => "\xEB\x82\xA8", + "\xB3\xB3" => "\xEB\x82\xA9", + "\xB3\xB4" => "\xEB\x82\xAB", + "\xB3\xB5" => "\xEB\x82\xAC", + "\xB3\xB6" => "\xEB\x82\xAD", + "\xB3\xB7" => "\xEB\x82\xAE", + "\xB3\xB8" => "\xEB\x82\xAF", + "\xB3\xB9" => "\xEB\x82\xB1", + "\xB3\xBA" => "\xEB\x82\xB3", + "\xB3\xBB" => "\xEB\x82\xB4", + "\xB3\xBC" => "\xEB\x82\xB5", + "\xB3\xBD" => "\xEB\x82\xB8", + "\xB3\xBE" => "\xEB\x82\xBC", + "\xB3\xBF" => "\xEB\x83\x84", + "\xB3\xC0" => "\xEB\x83\x85", + "\xB3\xC1" => "\xEB\x83\x87", + "\xB3\xC2" => "\xEB\x83\x88", + "\xB3\xC3" => "\xEB\x83\x89", + "\xB3\xC4" => "\xEB\x83\x90", + "\xB3\xC5" => "\xEB\x83\x91", + "\xB3\xC6" => "\xEB\x83\x94", + "\xB3\xC7" => "\xEB\x83\x98", + "\xB3\xC8" => "\xEB\x83\xA0", + "\xB3\xC9" => "\xEB\x83\xA5", + "\xB3\xCA" => "\xEB\x84\x88", + "\xB3\xCB" => "\xEB\x84\x89", + "\xB3\xCC" => "\xEB\x84\x8B", + "\xB3\xCD" => "\xEB\x84\x8C", + "\xB3\xCE" => "\xEB\x84\x90", + "\xB3\xCF" => "\xEB\x84\x92", + "\xB3\xD0" => "\xEB\x84\x93", + "\xB3\xD1" => "\xEB\x84\x98", + "\xB3\xD2" => "\xEB\x84\x99", + "\xB3\xD3" => "\xEB\x84\x9B", + "\xB3\xD4" => "\xEB\x84\x9C", + "\xB3\xD5" => "\xEB\x84\x9D", + "\xB3\xD6" => "\xEB\x84\xA3", + "\xB3\xD7" => "\xEB\x84\xA4", + "\xB3\xD8" => "\xEB\x84\xA5", + "\xB3\xD9" => "\xEB\x84\xA8", + "\xB3\xDA" => "\xEB\x84\xAC", + "\xB3\xDB" => "\xEB\x84\xB4", + "\xB3\xDC" => "\xEB\x84\xB5", + "\xB3\xDD" => "\xEB\x84\xB7", + "\xB3\xDE" => "\xEB\x84\xB8", + "\xB3\xDF" => "\xEB\x84\xB9", + "\xB3\xE0" => "\xEB\x85\x80", + "\xB3\xE1" => "\xEB\x85\x81", + "\xB3\xE2" => "\xEB\x85\x84", + "\xB3\xE3" => "\xEB\x85\x88", + "\xB3\xE4" => "\xEB\x85\x90", + "\xB3\xE5" => "\xEB\x85\x91", + "\xB3\xE6" => "\xEB\x85\x94", + "\xB3\xE7" => "\xEB\x85\x95", + "\xB3\xE8" => "\xEB\x85\x98", + "\xB3\xE9" => "\xEB\x85\x9C", + "\xB3\xEA" => "\xEB\x85\xA0", + "\xB3\xEB" => "\xEB\x85\xB8", + "\xB3\xEC" => "\xEB\x85\xB9", + "\xB3\xED" => "\xEB\x85\xBC", + "\xB3\xEE" => "\xEB\x86\x80", + "\xB3\xEF" => "\xEB\x86\x82", + "\xB3\xF0" => "\xEB\x86\x88", + "\xB3\xF1" => "\xEB\x86\x89", + "\xB3\xF2" => "\xEB\x86\x8B", + "\xB3\xF3" => "\xEB\x86\x8D", + "\xB3\xF4" => "\xEB\x86\x92", + "\xB3\xF5" => "\xEB\x86\x93", + "\xB3\xF6" => "\xEB\x86\x94", + "\xB3\xF7" => "\xEB\x86\x98", + "\xB3\xF8" => "\xEB\x86\x9C", + "\xB3\xF9" => "\xEB\x86\xA8", + "\xB3\xFA" => "\xEB\x87\x8C", + "\xB3\xFB" => "\xEB\x87\x90", + "\xB3\xFC" => "\xEB\x87\x94", + "\xB3\xFD" => "\xEB\x87\x9C", + "\xB3\xFE" => "\xEB\x87\x9D", + "\xB4\x41" => "\xED\x80\xAE", + "\xB4\x42" => "\xED\x80\xAF", + "\xB4\x43" => "\xED\x80\xB0", + "\xB4\x44" => "\xED\x80\xB1", + "\xB4\x45" => "\xED\x80\xB2", + "\xB4\x46" => "\xED\x80\xB3", + "\xB4\x47" => "\xED\x80\xB6", + "\xB4\x48" => "\xED\x80\xB7", + "\xB4\x49" => "\xED\x80\xB9", + "\xB4\x4A" => "\xED\x80\xBA", + "\xB4\x4B" => "\xED\x80\xBB", + "\xB4\x4C" => "\xED\x80\xBD", + "\xB4\x4D" => "\xED\x80\xBE", + "\xB4\x4E" => "\xED\x80\xBF", + "\xB4\x4F" => "\xED\x81\x80", + "\xB4\x50" => "\xED\x81\x81", + "\xB4\x51" => "\xED\x81\x82", + "\xB4\x52" => "\xED\x81\x83", + "\xB4\x53" => "\xED\x81\x86", + "\xB4\x54" => "\xED\x81\x88", + "\xB4\x55" => "\xED\x81\x8A", + "\xB4\x56" => "\xED\x81\x8B", + "\xB4\x57" => "\xED\x81\x8C", + "\xB4\x58" => "\xED\x81\x8D", + "\xB4\x59" => "\xED\x81\x8E", + "\xB4\x5A" => "\xED\x81\x8F", + "\xB4\x61" => "\xED\x81\x91", + "\xB4\x62" => "\xED\x81\x92", + "\xB4\x63" => "\xED\x81\x93", + "\xB4\x64" => "\xED\x81\x95", + "\xB4\x65" => "\xED\x81\x96", + "\xB4\x66" => "\xED\x81\x97", + "\xB4\x67" => "\xED\x81\x99", + "\xB4\x68" => "\xED\x81\x9A", + "\xB4\x69" => "\xED\x81\x9B", + "\xB4\x6A" => "\xED\x81\x9C", + "\xB4\x6B" => "\xED\x81\x9D", + "\xB4\x6C" => "\xED\x81\x9E", + "\xB4\x6D" => "\xED\x81\x9F", + "\xB4\x6E" => "\xED\x81\xA1", + "\xB4\x6F" => "\xED\x81\xA2", + "\xB4\x70" => "\xED\x81\xA3", + "\xB4\x71" => "\xED\x81\xA4", + "\xB4\x72" => "\xED\x81\xA5", + "\xB4\x73" => "\xED\x81\xA6", + "\xB4\x74" => "\xED\x81\xA7", + "\xB4\x75" => "\xED\x81\xA8", + "\xB4\x76" => "\xED\x81\xA9", + "\xB4\x77" => "\xED\x81\xAA", + "\xB4\x78" => "\xED\x81\xAB", + "\xB4\x79" => "\xED\x81\xAE", + "\xB4\x7A" => "\xED\x81\xAF", + "\xB4\x81" => "\xED\x81\xB1", + "\xB4\x82" => "\xED\x81\xB2", + "\xB4\x83" => "\xED\x81\xB3", + "\xB4\x84" => "\xED\x81\xB5", + "\xB4\x85" => "\xED\x81\xB6", + "\xB4\x86" => "\xED\x81\xB7", + "\xB4\x87" => "\xED\x81\xB8", + "\xB4\x88" => "\xED\x81\xB9", + "\xB4\x89" => "\xED\x81\xBA", + "\xB4\x8A" => "\xED\x81\xBB", + "\xB4\x8B" => "\xED\x81\xBE", + "\xB4\x8C" => "\xED\x81\xBF", + "\xB4\x8D" => "\xED\x82\x80", + "\xB4\x8E" => "\xED\x82\x82", + "\xB4\x8F" => "\xED\x82\x83", + "\xB4\x90" => "\xED\x82\x84", + "\xB4\x91" => "\xED\x82\x85", + "\xB4\x92" => "\xED\x82\x86", + "\xB4\x93" => "\xED\x82\x87", + "\xB4\x94" => "\xED\x82\x88", + "\xB4\x95" => "\xED\x82\x89", + "\xB4\x96" => "\xED\x82\x8A", + "\xB4\x97" => "\xED\x82\x8B", + "\xB4\x98" => "\xED\x82\x8C", + "\xB4\x99" => "\xED\x82\x8D", + "\xB4\x9A" => "\xED\x82\x8E", + "\xB4\x9B" => "\xED\x82\x8F", + "\xB4\x9C" => "\xED\x82\x90", + "\xB4\x9D" => "\xED\x82\x91", + "\xB4\x9E" => "\xED\x82\x92", + "\xB4\x9F" => "\xED\x82\x93", + "\xB4\xA0" => "\xED\x82\x94", + "\xB4\xA1" => "\xEB\x87\x9F", + "\xB4\xA2" => "\xEB\x87\xA8", + "\xB4\xA3" => "\xEB\x87\xA9", + "\xB4\xA4" => "\xEB\x87\xAC", + "\xB4\xA5" => "\xEB\x87\xB0", + "\xB4\xA6" => "\xEB\x87\xB9", + "\xB4\xA7" => "\xEB\x87\xBB", + "\xB4\xA8" => "\xEB\x87\xBD", + "\xB4\xA9" => "\xEB\x88\x84", + "\xB4\xAA" => "\xEB\x88\x85", + "\xB4\xAB" => "\xEB\x88\x88", + "\xB4\xAC" => "\xEB\x88\x8B", + "\xB4\xAD" => "\xEB\x88\x8C", + "\xB4\xAE" => "\xEB\x88\x94", + "\xB4\xAF" => "\xEB\x88\x95", + "\xB4\xB0" => "\xEB\x88\x97", + "\xB4\xB1" => "\xEB\x88\x99", + "\xB4\xB2" => "\xEB\x88\xA0", + "\xB4\xB3" => "\xEB\x88\xB4", + "\xB4\xB4" => "\xEB\x88\xBC", + "\xB4\xB5" => "\xEB\x89\x98", + "\xB4\xB6" => "\xEB\x89\x9C", + "\xB4\xB7" => "\xEB\x89\xA0", + "\xB4\xB8" => "\xEB\x89\xA8", + "\xB4\xB9" => "\xEB\x89\xA9", + "\xB4\xBA" => "\xEB\x89\xB4", + "\xB4\xBB" => "\xEB\x89\xB5", + "\xB4\xBC" => "\xEB\x89\xBC", + "\xB4\xBD" => "\xEB\x8A\x84", + "\xB4\xBE" => "\xEB\x8A\x85", + "\xB4\xBF" => "\xEB\x8A\x89", + "\xB4\xC0" => "\xEB\x8A\x90", + "\xB4\xC1" => "\xEB\x8A\x91", + "\xB4\xC2" => "\xEB\x8A\x94", + "\xB4\xC3" => "\xEB\x8A\x98", + "\xB4\xC4" => "\xEB\x8A\x99", + "\xB4\xC5" => "\xEB\x8A\x9A", + "\xB4\xC6" => "\xEB\x8A\xA0", + "\xB4\xC7" => "\xEB\x8A\xA1", + "\xB4\xC8" => "\xEB\x8A\xA3", + "\xB4\xC9" => "\xEB\x8A\xA5", + "\xB4\xCA" => "\xEB\x8A\xA6", + "\xB4\xCB" => "\xEB\x8A\xAA", + "\xB4\xCC" => "\xEB\x8A\xAC", + "\xB4\xCD" => "\xEB\x8A\xB0", + "\xB4\xCE" => "\xEB\x8A\xB4", + "\xB4\xCF" => "\xEB\x8B\x88", + "\xB4\xD0" => "\xEB\x8B\x89", + "\xB4\xD1" => "\xEB\x8B\x8C", + "\xB4\xD2" => "\xEB\x8B\x90", + "\xB4\xD3" => "\xEB\x8B\x92", + "\xB4\xD4" => "\xEB\x8B\x98", + "\xB4\xD5" => "\xEB\x8B\x99", + "\xB4\xD6" => "\xEB\x8B\x9B", + "\xB4\xD7" => "\xEB\x8B\x9D", + "\xB4\xD8" => "\xEB\x8B\xA2", + "\xB4\xD9" => "\xEB\x8B\xA4", + "\xB4\xDA" => "\xEB\x8B\xA5", + "\xB4\xDB" => "\xEB\x8B\xA6", + "\xB4\xDC" => "\xEB\x8B\xA8", + "\xB4\xDD" => "\xEB\x8B\xAB", + "\xB4\xDE" => "\xEB\x8B\xAC", + "\xB4\xDF" => "\xEB\x8B\xAD", + "\xB4\xE0" => "\xEB\x8B\xAE", + "\xB4\xE1" => "\xEB\x8B\xAF", + "\xB4\xE2" => "\xEB\x8B\xB3", + "\xB4\xE3" => "\xEB\x8B\xB4", + "\xB4\xE4" => "\xEB\x8B\xB5", + "\xB4\xE5" => "\xEB\x8B\xB7", + "\xB4\xE6" => "\xEB\x8B\xB8", + "\xB4\xE7" => "\xEB\x8B\xB9", + "\xB4\xE8" => "\xEB\x8B\xBA", + "\xB4\xE9" => "\xEB\x8B\xBB", + "\xB4\xEA" => "\xEB\x8B\xBF", + "\xB4\xEB" => "\xEB\x8C\x80", + "\xB4\xEC" => "\xEB\x8C\x81", + "\xB4\xED" => "\xEB\x8C\x84", + "\xB4\xEE" => "\xEB\x8C\x88", + "\xB4\xEF" => "\xEB\x8C\x90", + "\xB4\xF0" => "\xEB\x8C\x91", + "\xB4\xF1" => "\xEB\x8C\x93", + "\xB4\xF2" => "\xEB\x8C\x94", + "\xB4\xF3" => "\xEB\x8C\x95", + "\xB4\xF4" => "\xEB\x8C\x9C", + "\xB4\xF5" => "\xEB\x8D\x94", + "\xB4\xF6" => "\xEB\x8D\x95", + "\xB4\xF7" => "\xEB\x8D\x96", + "\xB4\xF8" => "\xEB\x8D\x98", + "\xB4\xF9" => "\xEB\x8D\x9B", + "\xB4\xFA" => "\xEB\x8D\x9C", + "\xB4\xFB" => "\xEB\x8D\x9E", + "\xB4\xFC" => "\xEB\x8D\x9F", + "\xB4\xFD" => "\xEB\x8D\xA4", + "\xB4\xFE" => "\xEB\x8D\xA5", + "\xB5\x41" => "\xED\x82\x95", + "\xB5\x42" => "\xED\x82\x96", + "\xB5\x43" => "\xED\x82\x97", + "\xB5\x44" => "\xED\x82\x98", + "\xB5\x45" => "\xED\x82\x99", + "\xB5\x46" => "\xED\x82\x9A", + "\xB5\x47" => "\xED\x82\x9B", + "\xB5\x48" => "\xED\x82\x9C", + "\xB5\x49" => "\xED\x82\x9D", + "\xB5\x4A" => "\xED\x82\x9E", + "\xB5\x4B" => "\xED\x82\x9F", + "\xB5\x4C" => "\xED\x82\xA0", + "\xB5\x4D" => "\xED\x82\xA1", + "\xB5\x4E" => "\xED\x82\xA2", + "\xB5\x4F" => "\xED\x82\xA3", + "\xB5\x50" => "\xED\x82\xA6", + "\xB5\x51" => "\xED\x82\xA7", + "\xB5\x52" => "\xED\x82\xA9", + "\xB5\x53" => "\xED\x82\xAA", + "\xB5\x54" => "\xED\x82\xAB", + "\xB5\x55" => "\xED\x82\xAD", + "\xB5\x56" => "\xED\x82\xAE", + "\xB5\x57" => "\xED\x82\xAF", + "\xB5\x58" => "\xED\x82\xB0", + "\xB5\x59" => "\xED\x82\xB1", + "\xB5\x5A" => "\xED\x82\xB2", + "\xB5\x61" => "\xED\x82\xB3", + "\xB5\x62" => "\xED\x82\xB6", + "\xB5\x63" => "\xED\x82\xB8", + "\xB5\x64" => "\xED\x82\xBA", + "\xB5\x65" => "\xED\x82\xBB", + "\xB5\x66" => "\xED\x82\xBC", + "\xB5\x67" => "\xED\x82\xBD", + "\xB5\x68" => "\xED\x82\xBE", + "\xB5\x69" => "\xED\x82\xBF", + "\xB5\x6A" => "\xED\x83\x82", + "\xB5\x6B" => "\xED\x83\x83", + "\xB5\x6C" => "\xED\x83\x85", + "\xB5\x6D" => "\xED\x83\x86", + "\xB5\x6E" => "\xED\x83\x87", + "\xB5\x6F" => "\xED\x83\x8A", + "\xB5\x70" => "\xED\x83\x8B", + "\xB5\x71" => "\xED\x83\x8C", + "\xB5\x72" => "\xED\x83\x8D", + "\xB5\x73" => "\xED\x83\x8E", + "\xB5\x74" => "\xED\x83\x8F", + "\xB5\x75" => "\xED\x83\x92", + "\xB5\x76" => "\xED\x83\x96", + "\xB5\x77" => "\xED\x83\x97", + "\xB5\x78" => "\xED\x83\x98", + "\xB5\x79" => "\xED\x83\x99", + "\xB5\x7A" => "\xED\x83\x9A", + "\xB5\x81" => "\xED\x83\x9B", + "\xB5\x82" => "\xED\x83\x9E", + "\xB5\x83" => "\xED\x83\x9F", + "\xB5\x84" => "\xED\x83\xA1", + "\xB5\x85" => "\xED\x83\xA2", + "\xB5\x86" => "\xED\x83\xA3", + "\xB5\x87" => "\xED\x83\xA5", + "\xB5\x88" => "\xED\x83\xA6", + "\xB5\x89" => "\xED\x83\xA7", + "\xB5\x8A" => "\xED\x83\xA8", + "\xB5\x8B" => "\xED\x83\xA9", + "\xB5\x8C" => "\xED\x83\xAA", + "\xB5\x8D" => "\xED\x83\xAB", + "\xB5\x8E" => "\xED\x83\xAE", + "\xB5\x8F" => "\xED\x83\xB2", + "\xB5\x90" => "\xED\x83\xB3", + "\xB5\x91" => "\xED\x83\xB4", + "\xB5\x92" => "\xED\x83\xB5", + "\xB5\x93" => "\xED\x83\xB6", + "\xB5\x94" => "\xED\x83\xB7", + "\xB5\x95" => "\xED\x83\xB9", + "\xB5\x96" => "\xED\x83\xBA", + "\xB5\x97" => "\xED\x83\xBB", + "\xB5\x98" => "\xED\x83\xBC", + "\xB5\x99" => "\xED\x83\xBD", + "\xB5\x9A" => "\xED\x83\xBE", + "\xB5\x9B" => "\xED\x83\xBF", + "\xB5\x9C" => "\xED\x84\x80", + "\xB5\x9D" => "\xED\x84\x81", + "\xB5\x9E" => "\xED\x84\x82", + "\xB5\x9F" => "\xED\x84\x83", + "\xB5\xA0" => "\xED\x84\x84", + "\xB5\xA1" => "\xEB\x8D\xA7", + "\xB5\xA2" => "\xEB\x8D\xA9", + "\xB5\xA3" => "\xEB\x8D\xAB", + "\xB5\xA4" => "\xEB\x8D\xAE", + "\xB5\xA5" => "\xEB\x8D\xB0", + "\xB5\xA6" => "\xEB\x8D\xB1", + "\xB5\xA7" => "\xEB\x8D\xB4", + "\xB5\xA8" => "\xEB\x8D\xB8", + "\xB5\xA9" => "\xEB\x8E\x80", + "\xB5\xAA" => "\xEB\x8E\x81", + "\xB5\xAB" => "\xEB\x8E\x83", + "\xB5\xAC" => "\xEB\x8E\x84", + "\xB5\xAD" => "\xEB\x8E\x85", + "\xB5\xAE" => "\xEB\x8E\x8C", + "\xB5\xAF" => "\xEB\x8E\x90", + "\xB5\xB0" => "\xEB\x8E\x94", + "\xB5\xB1" => "\xEB\x8E\xA0", + "\xB5\xB2" => "\xEB\x8E\xA1", + "\xB5\xB3" => "\xEB\x8E\xA8", + "\xB5\xB4" => "\xEB\x8E\xAC", + "\xB5\xB5" => "\xEB\x8F\x84", + "\xB5\xB6" => "\xEB\x8F\x85", + "\xB5\xB7" => "\xEB\x8F\x88", + "\xB5\xB8" => "\xEB\x8F\x8B", + "\xB5\xB9" => "\xEB\x8F\x8C", + "\xB5\xBA" => "\xEB\x8F\x8E", + "\xB5\xBB" => "\xEB\x8F\x90", + "\xB5\xBC" => "\xEB\x8F\x94", + "\xB5\xBD" => "\xEB\x8F\x95", + "\xB5\xBE" => "\xEB\x8F\x97", + "\xB5\xBF" => "\xEB\x8F\x99", + "\xB5\xC0" => "\xEB\x8F\x9B", + "\xB5\xC1" => "\xEB\x8F\x9D", + "\xB5\xC2" => "\xEB\x8F\xA0", + "\xB5\xC3" => "\xEB\x8F\xA4", + "\xB5\xC4" => "\xEB\x8F\xA8", + "\xB5\xC5" => "\xEB\x8F\xBC", + "\xB5\xC6" => "\xEB\x90\x90", + "\xB5\xC7" => "\xEB\x90\x98", + "\xB5\xC8" => "\xEB\x90\x9C", + "\xB5\xC9" => "\xEB\x90\xA0", + "\xB5\xCA" => "\xEB\x90\xA8", + "\xB5\xCB" => "\xEB\x90\xA9", + "\xB5\xCC" => "\xEB\x90\xAB", + "\xB5\xCD" => "\xEB\x90\xB4", + "\xB5\xCE" => "\xEB\x91\x90", + "\xB5\xCF" => "\xEB\x91\x91", + "\xB5\xD0" => "\xEB\x91\x94", + "\xB5\xD1" => "\xEB\x91\x98", + "\xB5\xD2" => "\xEB\x91\xA0", + "\xB5\xD3" => "\xEB\x91\xA1", + "\xB5\xD4" => "\xEB\x91\xA3", + "\xB5\xD5" => "\xEB\x91\xA5", + "\xB5\xD6" => "\xEB\x91\xAC", + "\xB5\xD7" => "\xEB\x92\x80", + "\xB5\xD8" => "\xEB\x92\x88", + "\xB5\xD9" => "\xEB\x92\x9D", + "\xB5\xDA" => "\xEB\x92\xA4", + "\xB5\xDB" => "\xEB\x92\xA8", + "\xB5\xDC" => "\xEB\x92\xAC", + "\xB5\xDD" => "\xEB\x92\xB5", + "\xB5\xDE" => "\xEB\x92\xB7", + "\xB5\xDF" => "\xEB\x92\xB9", + "\xB5\xE0" => "\xEB\x93\x80", + "\xB5\xE1" => "\xEB\x93\x84", + "\xB5\xE2" => "\xEB\x93\x88", + "\xB5\xE3" => "\xEB\x93\x90", + "\xB5\xE4" => "\xEB\x93\x95", + "\xB5\xE5" => "\xEB\x93\x9C", + "\xB5\xE6" => "\xEB\x93\x9D", + "\xB5\xE7" => "\xEB\x93\xA0", + "\xB5\xE8" => "\xEB\x93\xA3", + "\xB5\xE9" => "\xEB\x93\xA4", + "\xB5\xEA" => "\xEB\x93\xA6", + "\xB5\xEB" => "\xEB\x93\xAC", + "\xB5\xEC" => "\xEB\x93\xAD", + "\xB5\xED" => "\xEB\x93\xAF", + "\xB5\xEE" => "\xEB\x93\xB1", + "\xB5\xEF" => "\xEB\x93\xB8", + "\xB5\xF0" => "\xEB\x94\x94", + "\xB5\xF1" => "\xEB\x94\x95", + "\xB5\xF2" => "\xEB\x94\x98", + "\xB5\xF3" => "\xEB\x94\x9B", + "\xB5\xF4" => "\xEB\x94\x9C", + "\xB5\xF5" => "\xEB\x94\xA4", + "\xB5\xF6" => "\xEB\x94\xA5", + "\xB5\xF7" => "\xEB\x94\xA7", + "\xB5\xF8" => "\xEB\x94\xA8", + "\xB5\xF9" => "\xEB\x94\xA9", + "\xB5\xFA" => "\xEB\x94\xAA", + "\xB5\xFB" => "\xEB\x94\xB0", + "\xB5\xFC" => "\xEB\x94\xB1", + "\xB5\xFD" => "\xEB\x94\xB4", + "\xB5\xFE" => "\xEB\x94\xB8", + "\xB6\x41" => "\xED\x84\x85", + "\xB6\x42" => "\xED\x84\x86", + "\xB6\x43" => "\xED\x84\x87", + "\xB6\x44" => "\xED\x84\x88", + "\xB6\x45" => "\xED\x84\x89", + "\xB6\x46" => "\xED\x84\x8A", + "\xB6\x47" => "\xED\x84\x8B", + "\xB6\x48" => "\xED\x84\x8C", + "\xB6\x49" => "\xED\x84\x8E", + "\xB6\x4A" => "\xED\x84\x8F", + "\xB6\x4B" => "\xED\x84\x90", + "\xB6\x4C" => "\xED\x84\x91", + "\xB6\x4D" => "\xED\x84\x92", + "\xB6\x4E" => "\xED\x84\x93", + "\xB6\x4F" => "\xED\x84\x94", + "\xB6\x50" => "\xED\x84\x95", + "\xB6\x51" => "\xED\x84\x96", + "\xB6\x52" => "\xED\x84\x97", + "\xB6\x53" => "\xED\x84\x98", + "\xB6\x54" => "\xED\x84\x99", + "\xB6\x55" => "\xED\x84\x9A", + "\xB6\x56" => "\xED\x84\x9B", + "\xB6\x57" => "\xED\x84\x9C", + "\xB6\x58" => "\xED\x84\x9D", + "\xB6\x59" => "\xED\x84\x9E", + "\xB6\x5A" => "\xED\x84\x9F", + "\xB6\x61" => "\xED\x84\xA0", + "\xB6\x62" => "\xED\x84\xA1", + "\xB6\x63" => "\xED\x84\xA2", + "\xB6\x64" => "\xED\x84\xA3", + "\xB6\x65" => "\xED\x84\xA4", + "\xB6\x66" => "\xED\x84\xA5", + "\xB6\x67" => "\xED\x84\xA6", + "\xB6\x68" => "\xED\x84\xA7", + "\xB6\x69" => "\xED\x84\xA8", + "\xB6\x6A" => "\xED\x84\xA9", + "\xB6\x6B" => "\xED\x84\xAA", + "\xB6\x6C" => "\xED\x84\xAB", + "\xB6\x6D" => "\xED\x84\xAC", + "\xB6\x6E" => "\xED\x84\xAD", + "\xB6\x6F" => "\xED\x84\xAE", + "\xB6\x70" => "\xED\x84\xAF", + "\xB6\x71" => "\xED\x84\xB2", + "\xB6\x72" => "\xED\x84\xB3", + "\xB6\x73" => "\xED\x84\xB5", + "\xB6\x74" => "\xED\x84\xB6", + "\xB6\x75" => "\xED\x84\xB7", + "\xB6\x76" => "\xED\x84\xB9", + "\xB6\x77" => "\xED\x84\xBB", + "\xB6\x78" => "\xED\x84\xBC", + "\xB6\x79" => "\xED\x84\xBD", + "\xB6\x7A" => "\xED\x84\xBE", + "\xB6\x81" => "\xED\x84\xBF", + "\xB6\x82" => "\xED\x85\x82", + "\xB6\x83" => "\xED\x85\x86", + "\xB6\x84" => "\xED\x85\x87", + "\xB6\x85" => "\xED\x85\x88", + "\xB6\x86" => "\xED\x85\x89", + "\xB6\x87" => "\xED\x85\x8A", + "\xB6\x88" => "\xED\x85\x8B", + "\xB6\x89" => "\xED\x85\x8E", + "\xB6\x8A" => "\xED\x85\x8F", + "\xB6\x8B" => "\xED\x85\x91", + "\xB6\x8C" => "\xED\x85\x92", + "\xB6\x8D" => "\xED\x85\x93", + "\xB6\x8E" => "\xED\x85\x95", + "\xB6\x8F" => "\xED\x85\x96", + "\xB6\x90" => "\xED\x85\x97", + "\xB6\x91" => "\xED\x85\x98", + "\xB6\x92" => "\xED\x85\x99", + "\xB6\x93" => "\xED\x85\x9A", + "\xB6\x94" => "\xED\x85\x9B", + "\xB6\x95" => "\xED\x85\x9E", + "\xB6\x96" => "\xED\x85\xA0", + "\xB6\x97" => "\xED\x85\xA2", + "\xB6\x98" => "\xED\x85\xA3", + "\xB6\x99" => "\xED\x85\xA4", + "\xB6\x9A" => "\xED\x85\xA5", + "\xB6\x9B" => "\xED\x85\xA6", + "\xB6\x9C" => "\xED\x85\xA7", + "\xB6\x9D" => "\xED\x85\xA9", + "\xB6\x9E" => "\xED\x85\xAA", + "\xB6\x9F" => "\xED\x85\xAB", + "\xB6\xA0" => "\xED\x85\xAD", + "\xB6\xA1" => "\xEB\x95\x80", + "\xB6\xA2" => "\xEB\x95\x81", + "\xB6\xA3" => "\xEB\x95\x83", + "\xB6\xA4" => "\xEB\x95\x84", + "\xB6\xA5" => "\xEB\x95\x85", + "\xB6\xA6" => "\xEB\x95\x8B", + "\xB6\xA7" => "\xEB\x95\x8C", + "\xB6\xA8" => "\xEB\x95\x8D", + "\xB6\xA9" => "\xEB\x95\x90", + "\xB6\xAA" => "\xEB\x95\x94", + "\xB6\xAB" => "\xEB\x95\x9C", + "\xB6\xAC" => "\xEB\x95\x9D", + "\xB6\xAD" => "\xEB\x95\x9F", + "\xB6\xAE" => "\xEB\x95\xA0", + "\xB6\xAF" => "\xEB\x95\xA1", + "\xB6\xB0" => "\xEB\x96\xA0", + "\xB6\xB1" => "\xEB\x96\xA1", + "\xB6\xB2" => "\xEB\x96\xA4", + "\xB6\xB3" => "\xEB\x96\xA8", + "\xB6\xB4" => "\xEB\x96\xAA", + "\xB6\xB5" => "\xEB\x96\xAB", + "\xB6\xB6" => "\xEB\x96\xB0", + "\xB6\xB7" => "\xEB\x96\xB1", + "\xB6\xB8" => "\xEB\x96\xB3", + "\xB6\xB9" => "\xEB\x96\xB4", + "\xB6\xBA" => "\xEB\x96\xB5", + "\xB6\xBB" => "\xEB\x96\xBB", + "\xB6\xBC" => "\xEB\x96\xBC", + "\xB6\xBD" => "\xEB\x96\xBD", + "\xB6\xBE" => "\xEB\x97\x80", + "\xB6\xBF" => "\xEB\x97\x84", + "\xB6\xC0" => "\xEB\x97\x8C", + "\xB6\xC1" => "\xEB\x97\x8D", + "\xB6\xC2" => "\xEB\x97\x8F", + "\xB6\xC3" => "\xEB\x97\x90", + "\xB6\xC4" => "\xEB\x97\x91", + "\xB6\xC5" => "\xEB\x97\x98", + "\xB6\xC6" => "\xEB\x97\xAC", + "\xB6\xC7" => "\xEB\x98\x90", + "\xB6\xC8" => "\xEB\x98\x91", + "\xB6\xC9" => "\xEB\x98\x94", + "\xB6\xCA" => "\xEB\x98\x98", + "\xB6\xCB" => "\xEB\x98\xA5", + "\xB6\xCC" => "\xEB\x98\xAC", + "\xB6\xCD" => "\xEB\x98\xB4", + "\xB6\xCE" => "\xEB\x99\x88", + "\xB6\xCF" => "\xEB\x99\xA4", + "\xB6\xD0" => "\xEB\x99\xA8", + "\xB6\xD1" => "\xEB\x9A\x9C", + "\xB6\xD2" => "\xEB\x9A\x9D", + "\xB6\xD3" => "\xEB\x9A\xA0", + "\xB6\xD4" => "\xEB\x9A\xA4", + "\xB6\xD5" => "\xEB\x9A\xAB", + "\xB6\xD6" => "\xEB\x9A\xAC", + "\xB6\xD7" => "\xEB\x9A\xB1", + "\xB6\xD8" => "\xEB\x9B\x94", + "\xB6\xD9" => "\xEB\x9B\xB0", + "\xB6\xDA" => "\xEB\x9B\xB4", + "\xB6\xDB" => "\xEB\x9B\xB8", + "\xB6\xDC" => "\xEB\x9C\x80", + "\xB6\xDD" => "\xEB\x9C\x81", + "\xB6\xDE" => "\xEB\x9C\x85", + "\xB6\xDF" => "\xEB\x9C\xA8", + "\xB6\xE0" => "\xEB\x9C\xA9", + "\xB6\xE1" => "\xEB\x9C\xAC", + "\xB6\xE2" => "\xEB\x9C\xAF", + "\xB6\xE3" => "\xEB\x9C\xB0", + "\xB6\xE4" => "\xEB\x9C\xB8", + "\xB6\xE5" => "\xEB\x9C\xB9", + "\xB6\xE6" => "\xEB\x9C\xBB", + "\xB6\xE7" => "\xEB\x9D\x84", + "\xB6\xE8" => "\xEB\x9D\x88", + "\xB6\xE9" => "\xEB\x9D\x8C", + "\xB6\xEA" => "\xEB\x9D\x94", + "\xB6\xEB" => "\xEB\x9D\x95", + "\xB6\xEC" => "\xEB\x9D\xA0", + "\xB6\xED" => "\xEB\x9D\xA4", + "\xB6\xEE" => "\xEB\x9D\xA8", + "\xB6\xEF" => "\xEB\x9D\xB0", + "\xB6\xF0" => "\xEB\x9D\xB1", + "\xB6\xF1" => "\xEB\x9D\xB3", + "\xB6\xF2" => "\xEB\x9D\xB5", + "\xB6\xF3" => "\xEB\x9D\xBC", + "\xB6\xF4" => "\xEB\x9D\xBD", + "\xB6\xF5" => "\xEB\x9E\x80", + "\xB6\xF6" => "\xEB\x9E\x84", + "\xB6\xF7" => "\xEB\x9E\x8C", + "\xB6\xF8" => "\xEB\x9E\x8D", + "\xB6\xF9" => "\xEB\x9E\x8F", + "\xB6\xFA" => "\xEB\x9E\x90", + "\xB6\xFB" => "\xEB\x9E\x91", + "\xB6\xFC" => "\xEB\x9E\x92", + "\xB6\xFD" => "\xEB\x9E\x96", + "\xB6\xFE" => "\xEB\x9E\x97", + "\xB7\x41" => "\xED\x85\xAE", + "\xB7\x42" => "\xED\x85\xAF", + "\xB7\x43" => "\xED\x85\xB0", + "\xB7\x44" => "\xED\x85\xB1", + "\xB7\x45" => "\xED\x85\xB2", + "\xB7\x46" => "\xED\x85\xB3", + "\xB7\x47" => "\xED\x85\xB4", + "\xB7\x48" => "\xED\x85\xB5", + "\xB7\x49" => "\xED\x85\xB6", + "\xB7\x4A" => "\xED\x85\xB7", + "\xB7\x4B" => "\xED\x85\xB8", + "\xB7\x4C" => "\xED\x85\xB9", + "\xB7\x4D" => "\xED\x85\xBA", + "\xB7\x4E" => "\xED\x85\xBB", + "\xB7\x4F" => "\xED\x85\xBD", + "\xB7\x50" => "\xED\x85\xBE", + "\xB7\x51" => "\xED\x85\xBF", + "\xB7\x52" => "\xED\x86\x80", + "\xB7\x53" => "\xED\x86\x81", + "\xB7\x54" => "\xED\x86\x82", + "\xB7\x55" => "\xED\x86\x83", + "\xB7\x56" => "\xED\x86\x85", + "\xB7\x57" => "\xED\x86\x86", + "\xB7\x58" => "\xED\x86\x87", + "\xB7\x59" => "\xED\x86\x89", + "\xB7\x5A" => "\xED\x86\x8A", + "\xB7\x61" => "\xED\x86\x8B", + "\xB7\x62" => "\xED\x86\x8C", + "\xB7\x63" => "\xED\x86\x8D", + "\xB7\x64" => "\xED\x86\x8E", + "\xB7\x65" => "\xED\x86\x8F", + "\xB7\x66" => "\xED\x86\x90", + "\xB7\x67" => "\xED\x86\x91", + "\xB7\x68" => "\xED\x86\x92", + "\xB7\x69" => "\xED\x86\x93", + "\xB7\x6A" => "\xED\x86\x94", + "\xB7\x6B" => "\xED\x86\x95", + "\xB7\x6C" => "\xED\x86\x96", + "\xB7\x6D" => "\xED\x86\x97", + "\xB7\x6E" => "\xED\x86\x98", + "\xB7\x6F" => "\xED\x86\x99", + "\xB7\x70" => "\xED\x86\x9A", + "\xB7\x71" => "\xED\x86\x9B", + "\xB7\x72" => "\xED\x86\x9C", + "\xB7\x73" => "\xED\x86\x9D", + "\xB7\x74" => "\xED\x86\x9E", + "\xB7\x75" => "\xED\x86\x9F", + "\xB7\x76" => "\xED\x86\xA2", + "\xB7\x77" => "\xED\x86\xA3", + "\xB7\x78" => "\xED\x86\xA5", + "\xB7\x79" => "\xED\x86\xA6", + "\xB7\x7A" => "\xED\x86\xA7", + "\xB7\x81" => "\xED\x86\xA9", + "\xB7\x82" => "\xED\x86\xAA", + "\xB7\x83" => "\xED\x86\xAB", + "\xB7\x84" => "\xED\x86\xAC", + "\xB7\x85" => "\xED\x86\xAD", + "\xB7\x86" => "\xED\x86\xAE", + "\xB7\x87" => "\xED\x86\xAF", + "\xB7\x88" => "\xED\x86\xB2", + "\xB7\x89" => "\xED\x86\xB4", + "\xB7\x8A" => "\xED\x86\xB6", + "\xB7\x8B" => "\xED\x86\xB7", + "\xB7\x8C" => "\xED\x86\xB8", + "\xB7\x8D" => "\xED\x86\xB9", + "\xB7\x8E" => "\xED\x86\xBB", + "\xB7\x8F" => "\xED\x86\xBD", + "\xB7\x90" => "\xED\x86\xBE", + "\xB7\x91" => "\xED\x86\xBF", + "\xB7\x92" => "\xED\x87\x81", + "\xB7\x93" => "\xED\x87\x82", + "\xB7\x94" => "\xED\x87\x83", + "\xB7\x95" => "\xED\x87\x84", + "\xB7\x96" => "\xED\x87\x85", + "\xB7\x97" => "\xED\x87\x86", + "\xB7\x98" => "\xED\x87\x87", + "\xB7\x99" => "\xED\x87\x88", + "\xB7\x9A" => "\xED\x87\x89", + "\xB7\x9B" => "\xED\x87\x8A", + "\xB7\x9C" => "\xED\x87\x8B", + "\xB7\x9D" => "\xED\x87\x8C", + "\xB7\x9E" => "\xED\x87\x8D", + "\xB7\x9F" => "\xED\x87\x8E", + "\xB7\xA0" => "\xED\x87\x8F", + "\xB7\xA1" => "\xEB\x9E\x98", + "\xB7\xA2" => "\xEB\x9E\x99", + "\xB7\xA3" => "\xEB\x9E\x9C", + "\xB7\xA4" => "\xEB\x9E\xA0", + "\xB7\xA5" => "\xEB\x9E\xA8", + "\xB7\xA6" => "\xEB\x9E\xA9", + "\xB7\xA7" => "\xEB\x9E\xAB", + "\xB7\xA8" => "\xEB\x9E\xAC", + "\xB7\xA9" => "\xEB\x9E\xAD", + "\xB7\xAA" => "\xEB\x9E\xB4", + "\xB7\xAB" => "\xEB\x9E\xB5", + "\xB7\xAC" => "\xEB\x9E\xB8", + "\xB7\xAD" => "\xEB\x9F\x87", + "\xB7\xAE" => "\xEB\x9F\x89", + "\xB7\xAF" => "\xEB\x9F\xAC", + "\xB7\xB0" => "\xEB\x9F\xAD", + "\xB7\xB1" => "\xEB\x9F\xB0", + "\xB7\xB2" => "\xEB\x9F\xB4", + "\xB7\xB3" => "\xEB\x9F\xBC", + "\xB7\xB4" => "\xEB\x9F\xBD", + "\xB7\xB5" => "\xEB\x9F\xBF", + "\xB7\xB6" => "\xEB\xA0\x80", + "\xB7\xB7" => "\xEB\xA0\x81", + "\xB7\xB8" => "\xEB\xA0\x87", + "\xB7\xB9" => "\xEB\xA0\x88", + "\xB7\xBA" => "\xEB\xA0\x89", + "\xB7\xBB" => "\xEB\xA0\x8C", + "\xB7\xBC" => "\xEB\xA0\x90", + "\xB7\xBD" => "\xEB\xA0\x98", + "\xB7\xBE" => "\xEB\xA0\x99", + "\xB7\xBF" => "\xEB\xA0\x9B", + "\xB7\xC0" => "\xEB\xA0\x9D", + "\xB7\xC1" => "\xEB\xA0\xA4", + "\xB7\xC2" => "\xEB\xA0\xA5", + "\xB7\xC3" => "\xEB\xA0\xA8", + "\xB7\xC4" => "\xEB\xA0\xAC", + "\xB7\xC5" => "\xEB\xA0\xB4", + "\xB7\xC6" => "\xEB\xA0\xB5", + "\xB7\xC7" => "\xEB\xA0\xB7", + "\xB7\xC8" => "\xEB\xA0\xB8", + "\xB7\xC9" => "\xEB\xA0\xB9", + "\xB7\xCA" => "\xEB\xA1\x80", + "\xB7\xCB" => "\xEB\xA1\x84", + "\xB7\xCC" => "\xEB\xA1\x91", + "\xB7\xCD" => "\xEB\xA1\x93", + "\xB7\xCE" => "\xEB\xA1\x9C", + "\xB7\xCF" => "\xEB\xA1\x9D", + "\xB7\xD0" => "\xEB\xA1\xA0", + "\xB7\xD1" => "\xEB\xA1\xA4", + "\xB7\xD2" => "\xEB\xA1\xAC", + "\xB7\xD3" => "\xEB\xA1\xAD", + "\xB7\xD4" => "\xEB\xA1\xAF", + "\xB7\xD5" => "\xEB\xA1\xB1", + "\xB7\xD6" => "\xEB\xA1\xB8", + "\xB7\xD7" => "\xEB\xA1\xBC", + "\xB7\xD8" => "\xEB\xA2\x8D", + "\xB7\xD9" => "\xEB\xA2\xA8", + "\xB7\xDA" => "\xEB\xA2\xB0", + "\xB7\xDB" => "\xEB\xA2\xB4", + "\xB7\xDC" => "\xEB\xA2\xB8", + "\xB7\xDD" => "\xEB\xA3\x80", + "\xB7\xDE" => "\xEB\xA3\x81", + "\xB7\xDF" => "\xEB\xA3\x83", + "\xB7\xE0" => "\xEB\xA3\x85", + "\xB7\xE1" => "\xEB\xA3\x8C", + "\xB7\xE2" => "\xEB\xA3\x90", + "\xB7\xE3" => "\xEB\xA3\x94", + "\xB7\xE4" => "\xEB\xA3\x9D", + "\xB7\xE5" => "\xEB\xA3\x9F", + "\xB7\xE6" => "\xEB\xA3\xA1", + "\xB7\xE7" => "\xEB\xA3\xA8", + "\xB7\xE8" => "\xEB\xA3\xA9", + "\xB7\xE9" => "\xEB\xA3\xAC", + "\xB7\xEA" => "\xEB\xA3\xB0", + "\xB7\xEB" => "\xEB\xA3\xB8", + "\xB7\xEC" => "\xEB\xA3\xB9", + "\xB7\xED" => "\xEB\xA3\xBB", + "\xB7\xEE" => "\xEB\xA3\xBD", + "\xB7\xEF" => "\xEB\xA4\x84", + "\xB7\xF0" => "\xEB\xA4\x98", + "\xB7\xF1" => "\xEB\xA4\xA0", + "\xB7\xF2" => "\xEB\xA4\xBC", + "\xB7\xF3" => "\xEB\xA4\xBD", + "\xB7\xF4" => "\xEB\xA5\x80", + "\xB7\xF5" => "\xEB\xA5\x84", + "\xB7\xF6" => "\xEB\xA5\x8C", + "\xB7\xF7" => "\xEB\xA5\x8F", + "\xB7\xF8" => "\xEB\xA5\x91", + "\xB7\xF9" => "\xEB\xA5\x98", + "\xB7\xFA" => "\xEB\xA5\x99", + "\xB7\xFB" => "\xEB\xA5\x9C", + "\xB7\xFC" => "\xEB\xA5\xA0", + "\xB7\xFD" => "\xEB\xA5\xA8", + "\xB7\xFE" => "\xEB\xA5\xA9", + "\xB8\x41" => "\xED\x87\x90", + "\xB8\x42" => "\xED\x87\x91", + "\xB8\x43" => "\xED\x87\x92", + "\xB8\x44" => "\xED\x87\x93", + "\xB8\x45" => "\xED\x87\x94", + "\xB8\x46" => "\xED\x87\x95", + "\xB8\x47" => "\xED\x87\x96", + "\xB8\x48" => "\xED\x87\x97", + "\xB8\x49" => "\xED\x87\x99", + "\xB8\x4A" => "\xED\x87\x9A", + "\xB8\x4B" => "\xED\x87\x9B", + "\xB8\x4C" => "\xED\x87\x9C", + "\xB8\x4D" => "\xED\x87\x9D", + "\xB8\x4E" => "\xED\x87\x9E", + "\xB8\x4F" => "\xED\x87\x9F", + "\xB8\x50" => "\xED\x87\xA0", + "\xB8\x51" => "\xED\x87\xA1", + "\xB8\x52" => "\xED\x87\xA2", + "\xB8\x53" => "\xED\x87\xA3", + "\xB8\x54" => "\xED\x87\xA4", + "\xB8\x55" => "\xED\x87\xA5", + "\xB8\x56" => "\xED\x87\xA6", + "\xB8\x57" => "\xED\x87\xA7", + "\xB8\x58" => "\xED\x87\xA8", + "\xB8\x59" => "\xED\x87\xA9", + "\xB8\x5A" => "\xED\x87\xAA", + "\xB8\x61" => "\xED\x87\xAB", + "\xB8\x62" => "\xED\x87\xAC", + "\xB8\x63" => "\xED\x87\xAD", + "\xB8\x64" => "\xED\x87\xAE", + "\xB8\x65" => "\xED\x87\xAF", + "\xB8\x66" => "\xED\x87\xB0", + "\xB8\x67" => "\xED\x87\xB1", + "\xB8\x68" => "\xED\x87\xB2", + "\xB8\x69" => "\xED\x87\xB3", + "\xB8\x6A" => "\xED\x87\xB5", + "\xB8\x6B" => "\xED\x87\xB6", + "\xB8\x6C" => "\xED\x87\xB7", + "\xB8\x6D" => "\xED\x87\xB9", + "\xB8\x6E" => "\xED\x87\xBA", + "\xB8\x6F" => "\xED\x87\xBB", + "\xB8\x70" => "\xED\x87\xBC", + "\xB8\x71" => "\xED\x87\xBD", + "\xB8\x72" => "\xED\x87\xBE", + "\xB8\x73" => "\xED\x87\xBF", + "\xB8\x74" => "\xED\x88\x80", + "\xB8\x75" => "\xED\x88\x81", + "\xB8\x76" => "\xED\x88\x82", + "\xB8\x77" => "\xED\x88\x83", + "\xB8\x78" => "\xED\x88\x84", + "\xB8\x79" => "\xED\x88\x85", + "\xB8\x7A" => "\xED\x88\x86", + "\xB8\x81" => "\xED\x88\x88", + "\xB8\x82" => "\xED\x88\x8A", + "\xB8\x83" => "\xED\x88\x8B", + "\xB8\x84" => "\xED\x88\x8C", + "\xB8\x85" => "\xED\x88\x8D", + "\xB8\x86" => "\xED\x88\x8E", + "\xB8\x87" => "\xED\x88\x8F", + "\xB8\x88" => "\xED\x88\x91", + "\xB8\x89" => "\xED\x88\x92", + "\xB8\x8A" => "\xED\x88\x93", + "\xB8\x8B" => "\xED\x88\x94", + "\xB8\x8C" => "\xED\x88\x95", + "\xB8\x8D" => "\xED\x88\x96", + "\xB8\x8E" => "\xED\x88\x97", + "\xB8\x8F" => "\xED\x88\x98", + "\xB8\x90" => "\xED\x88\x99", + "\xB8\x91" => "\xED\x88\x9A", + "\xB8\x92" => "\xED\x88\x9B", + "\xB8\x93" => "\xED\x88\x9C", + "\xB8\x94" => "\xED\x88\x9D", + "\xB8\x95" => "\xED\x88\x9E", + "\xB8\x96" => "\xED\x88\x9F", + "\xB8\x97" => "\xED\x88\xA0", + "\xB8\x98" => "\xED\x88\xA1", + "\xB8\x99" => "\xED\x88\xA2", + "\xB8\x9A" => "\xED\x88\xA3", + "\xB8\x9B" => "\xED\x88\xA4", + "\xB8\x9C" => "\xED\x88\xA5", + "\xB8\x9D" => "\xED\x88\xA6", + "\xB8\x9E" => "\xED\x88\xA7", + "\xB8\x9F" => "\xED\x88\xA8", + "\xB8\xA0" => "\xED\x88\xA9", + "\xB8\xA1" => "\xEB\xA5\xAB", + "\xB8\xA2" => "\xEB\xA5\xAD", + "\xB8\xA3" => "\xEB\xA5\xB4", + "\xB8\xA4" => "\xEB\xA5\xB5", + "\xB8\xA5" => "\xEB\xA5\xB8", + "\xB8\xA6" => "\xEB\xA5\xBC", + "\xB8\xA7" => "\xEB\xA6\x84", + "\xB8\xA8" => "\xEB\xA6\x85", + "\xB8\xA9" => "\xEB\xA6\x87", + "\xB8\xAA" => "\xEB\xA6\x89", + "\xB8\xAB" => "\xEB\xA6\x8A", + "\xB8\xAC" => "\xEB\xA6\x8D", + "\xB8\xAD" => "\xEB\xA6\x8E", + "\xB8\xAE" => "\xEB\xA6\xAC", + "\xB8\xAF" => "\xEB\xA6\xAD", + "\xB8\xB0" => "\xEB\xA6\xB0", + "\xB8\xB1" => "\xEB\xA6\xB4", + "\xB8\xB2" => "\xEB\xA6\xBC", + "\xB8\xB3" => "\xEB\xA6\xBD", + "\xB8\xB4" => "\xEB\xA6\xBF", + "\xB8\xB5" => "\xEB\xA7\x81", + "\xB8\xB6" => "\xEB\xA7\x88", + "\xB8\xB7" => "\xEB\xA7\x89", + "\xB8\xB8" => "\xEB\xA7\x8C", + "\xB8\xB9" => "\xEB\xA7\x8E", + "\xB8\xBA" => "\xEB\xA7\x8F", + "\xB8\xBB" => "\xEB\xA7\x90", + "\xB8\xBC" => "\xEB\xA7\x91", + "\xB8\xBD" => "\xEB\xA7\x92", + "\xB8\xBE" => "\xEB\xA7\x98", + "\xB8\xBF" => "\xEB\xA7\x99", + "\xB8\xC0" => "\xEB\xA7\x9B", + "\xB8\xC1" => "\xEB\xA7\x9D", + "\xB8\xC2" => "\xEB\xA7\x9E", + "\xB8\xC3" => "\xEB\xA7\xA1", + "\xB8\xC4" => "\xEB\xA7\xA3", + "\xB8\xC5" => "\xEB\xA7\xA4", + "\xB8\xC6" => "\xEB\xA7\xA5", + "\xB8\xC7" => "\xEB\xA7\xA8", + "\xB8\xC8" => "\xEB\xA7\xAC", + "\xB8\xC9" => "\xEB\xA7\xB4", + "\xB8\xCA" => "\xEB\xA7\xB5", + "\xB8\xCB" => "\xEB\xA7\xB7", + "\xB8\xCC" => "\xEB\xA7\xB8", + "\xB8\xCD" => "\xEB\xA7\xB9", + "\xB8\xCE" => "\xEB\xA7\xBA", + "\xB8\xCF" => "\xEB\xA8\x80", + "\xB8\xD0" => "\xEB\xA8\x81", + "\xB8\xD1" => "\xEB\xA8\x88", + "\xB8\xD2" => "\xEB\xA8\x95", + "\xB8\xD3" => "\xEB\xA8\xB8", + "\xB8\xD4" => "\xEB\xA8\xB9", + "\xB8\xD5" => "\xEB\xA8\xBC", + "\xB8\xD6" => "\xEB\xA9\x80", + "\xB8\xD7" => "\xEB\xA9\x82", + "\xB8\xD8" => "\xEB\xA9\x88", + "\xB8\xD9" => "\xEB\xA9\x89", + "\xB8\xDA" => "\xEB\xA9\x8B", + "\xB8\xDB" => "\xEB\xA9\x8D", + "\xB8\xDC" => "\xEB\xA9\x8E", + "\xB8\xDD" => "\xEB\xA9\x93", + "\xB8\xDE" => "\xEB\xA9\x94", + "\xB8\xDF" => "\xEB\xA9\x95", + "\xB8\xE0" => "\xEB\xA9\x98", + "\xB8\xE1" => "\xEB\xA9\x9C", + "\xB8\xE2" => "\xEB\xA9\xA4", + "\xB8\xE3" => "\xEB\xA9\xA5", + "\xB8\xE4" => "\xEB\xA9\xA7", + "\xB8\xE5" => "\xEB\xA9\xA8", + "\xB8\xE6" => "\xEB\xA9\xA9", + "\xB8\xE7" => "\xEB\xA9\xB0", + "\xB8\xE8" => "\xEB\xA9\xB1", + "\xB8\xE9" => "\xEB\xA9\xB4", + "\xB8\xEA" => "\xEB\xA9\xB8", + "\xB8\xEB" => "\xEB\xAA\x83", + "\xB8\xEC" => "\xEB\xAA\x84", + "\xB8\xED" => "\xEB\xAA\x85", + "\xB8\xEE" => "\xEB\xAA\x87", + "\xB8\xEF" => "\xEB\xAA\x8C", + "\xB8\xF0" => "\xEB\xAA\xA8", + "\xB8\xF1" => "\xEB\xAA\xA9", + "\xB8\xF2" => "\xEB\xAA\xAB", + "\xB8\xF3" => "\xEB\xAA\xAC", + "\xB8\xF4" => "\xEB\xAA\xB0", + "\xB8\xF5" => "\xEB\xAA\xB2", + "\xB8\xF6" => "\xEB\xAA\xB8", + "\xB8\xF7" => "\xEB\xAA\xB9", + "\xB8\xF8" => "\xEB\xAA\xBB", + "\xB8\xF9" => "\xEB\xAA\xBD", + "\xB8\xFA" => "\xEB\xAB\x84", + "\xB8\xFB" => "\xEB\xAB\x88", + "\xB8\xFC" => "\xEB\xAB\x98", + "\xB8\xFD" => "\xEB\xAB\x99", + "\xB8\xFE" => "\xEB\xAB\xBC", + "\xB9\x41" => "\xED\x88\xAA", + "\xB9\x42" => "\xED\x88\xAB", + "\xB9\x43" => "\xED\x88\xAE", + "\xB9\x44" => "\xED\x88\xAF", + "\xB9\x45" => "\xED\x88\xB1", + "\xB9\x46" => "\xED\x88\xB2", + "\xB9\x47" => "\xED\x88\xB3", + "\xB9\x48" => "\xED\x88\xB5", + "\xB9\x49" => "\xED\x88\xB6", + "\xB9\x4A" => "\xED\x88\xB7", + "\xB9\x4B" => "\xED\x88\xB8", + "\xB9\x4C" => "\xED\x88\xB9", + "\xB9\x4D" => "\xED\x88\xBA", + "\xB9\x4E" => "\xED\x88\xBB", + "\xB9\x4F" => "\xED\x88\xBE", + "\xB9\x50" => "\xED\x89\x80", + "\xB9\x51" => "\xED\x89\x82", + "\xB9\x52" => "\xED\x89\x83", + "\xB9\x53" => "\xED\x89\x84", + "\xB9\x54" => "\xED\x89\x85", + "\xB9\x55" => "\xED\x89\x86", + "\xB9\x56" => "\xED\x89\x87", + "\xB9\x57" => "\xED\x89\x89", + "\xB9\x58" => "\xED\x89\x8A", + "\xB9\x59" => "\xED\x89\x8B", + "\xB9\x5A" => "\xED\x89\x8C", + "\xB9\x61" => "\xED\x89\x8D", + "\xB9\x62" => "\xED\x89\x8E", + "\xB9\x63" => "\xED\x89\x8F", + "\xB9\x64" => "\xED\x89\x90", + "\xB9\x65" => "\xED\x89\x91", + "\xB9\x66" => "\xED\x89\x92", + "\xB9\x67" => "\xED\x89\x93", + "\xB9\x68" => "\xED\x89\x94", + "\xB9\x69" => "\xED\x89\x95", + "\xB9\x6A" => "\xED\x89\x96", + "\xB9\x6B" => "\xED\x89\x97", + "\xB9\x6C" => "\xED\x89\x98", + "\xB9\x6D" => "\xED\x89\x99", + "\xB9\x6E" => "\xED\x89\x9A", + "\xB9\x6F" => "\xED\x89\x9B", + "\xB9\x70" => "\xED\x89\x9D", + "\xB9\x71" => "\xED\x89\x9E", + "\xB9\x72" => "\xED\x89\x9F", + "\xB9\x73" => "\xED\x89\xA0", + "\xB9\x74" => "\xED\x89\xA1", + "\xB9\x75" => "\xED\x89\xA2", + "\xB9\x76" => "\xED\x89\xA3", + "\xB9\x77" => "\xED\x89\xA5", + "\xB9\x78" => "\xED\x89\xA6", + "\xB9\x79" => "\xED\x89\xA7", + "\xB9\x7A" => "\xED\x89\xA8", + "\xB9\x81" => "\xED\x89\xA9", + "\xB9\x82" => "\xED\x89\xAA", + "\xB9\x83" => "\xED\x89\xAB", + "\xB9\x84" => "\xED\x89\xAC", + "\xB9\x85" => "\xED\x89\xAD", + "\xB9\x86" => "\xED\x89\xAE", + "\xB9\x87" => "\xED\x89\xAF", + "\xB9\x88" => "\xED\x89\xB0", + "\xB9\x89" => "\xED\x89\xB1", + "\xB9\x8A" => "\xED\x89\xB2", + "\xB9\x8B" => "\xED\x89\xB3", + "\xB9\x8C" => "\xED\x89\xB4", + "\xB9\x8D" => "\xED\x89\xB5", + "\xB9\x8E" => "\xED\x89\xB6", + "\xB9\x8F" => "\xED\x89\xB7", + "\xB9\x90" => "\xED\x89\xB8", + "\xB9\x91" => "\xED\x89\xB9", + "\xB9\x92" => "\xED\x89\xBA", + "\xB9\x93" => "\xED\x89\xBB", + "\xB9\x94" => "\xED\x89\xBC", + "\xB9\x95" => "\xED\x89\xBD", + "\xB9\x96" => "\xED\x89\xBE", + "\xB9\x97" => "\xED\x89\xBF", + "\xB9\x98" => "\xED\x8A\x82", + "\xB9\x99" => "\xED\x8A\x83", + "\xB9\x9A" => "\xED\x8A\x85", + "\xB9\x9B" => "\xED\x8A\x86", + "\xB9\x9C" => "\xED\x8A\x87", + "\xB9\x9D" => "\xED\x8A\x89", + "\xB9\x9E" => "\xED\x8A\x8A", + "\xB9\x9F" => "\xED\x8A\x8B", + "\xB9\xA0" => "\xED\x8A\x8C", + "\xB9\xA1" => "\xEB\xAC\x80", + "\xB9\xA2" => "\xEB\xAC\x84", + "\xB9\xA3" => "\xEB\xAC\x8D", + "\xB9\xA4" => "\xEB\xAC\x8F", + "\xB9\xA5" => "\xEB\xAC\x91", + "\xB9\xA6" => "\xEB\xAC\x98", + "\xB9\xA7" => "\xEB\xAC\x9C", + "\xB9\xA8" => "\xEB\xAC\xA0", + "\xB9\xA9" => "\xEB\xAC\xA9", + "\xB9\xAA" => "\xEB\xAC\xAB", + "\xB9\xAB" => "\xEB\xAC\xB4", + "\xB9\xAC" => "\xEB\xAC\xB5", + "\xB9\xAD" => "\xEB\xAC\xB6", + "\xB9\xAE" => "\xEB\xAC\xB8", + "\xB9\xAF" => "\xEB\xAC\xBB", + "\xB9\xB0" => "\xEB\xAC\xBC", + "\xB9\xB1" => "\xEB\xAC\xBD", + "\xB9\xB2" => "\xEB\xAC\xBE", + "\xB9\xB3" => "\xEB\xAD\x84", + "\xB9\xB4" => "\xEB\xAD\x85", + "\xB9\xB5" => "\xEB\xAD\x87", + "\xB9\xB6" => "\xEB\xAD\x89", + "\xB9\xB7" => "\xEB\xAD\x8D", + "\xB9\xB8" => "\xEB\xAD\x8F", + "\xB9\xB9" => "\xEB\xAD\x90", + "\xB9\xBA" => "\xEB\xAD\x94", + "\xB9\xBB" => "\xEB\xAD\x98", + "\xB9\xBC" => "\xEB\xAD\xA1", + "\xB9\xBD" => "\xEB\xAD\xA3", + "\xB9\xBE" => "\xEB\xAD\xAC", + "\xB9\xBF" => "\xEB\xAE\x88", + "\xB9\xC0" => "\xEB\xAE\x8C", + "\xB9\xC1" => "\xEB\xAE\x90", + "\xB9\xC2" => "\xEB\xAE\xA4", + "\xB9\xC3" => "\xEB\xAE\xA8", + "\xB9\xC4" => "\xEB\xAE\xAC", + "\xB9\xC5" => "\xEB\xAE\xB4", + "\xB9\xC6" => "\xEB\xAE\xB7", + "\xB9\xC7" => "\xEB\xAF\x80", + "\xB9\xC8" => "\xEB\xAF\x84", + "\xB9\xC9" => "\xEB\xAF\x88", + "\xB9\xCA" => "\xEB\xAF\x90", + "\xB9\xCB" => "\xEB\xAF\x93", + "\xB9\xCC" => "\xEB\xAF\xB8", + "\xB9\xCD" => "\xEB\xAF\xB9", + "\xB9\xCE" => "\xEB\xAF\xBC", + "\xB9\xCF" => "\xEB\xAF\xBF", + "\xB9\xD0" => "\xEB\xB0\x80", + "\xB9\xD1" => "\xEB\xB0\x82", + "\xB9\xD2" => "\xEB\xB0\x88", + "\xB9\xD3" => "\xEB\xB0\x89", + "\xB9\xD4" => "\xEB\xB0\x8B", + "\xB9\xD5" => "\xEB\xB0\x8C", + "\xB9\xD6" => "\xEB\xB0\x8D", + "\xB9\xD7" => "\xEB\xB0\x8F", + "\xB9\xD8" => "\xEB\xB0\x91", + "\xB9\xD9" => "\xEB\xB0\x94", + "\xB9\xDA" => "\xEB\xB0\x95", + "\xB9\xDB" => "\xEB\xB0\x96", + "\xB9\xDC" => "\xEB\xB0\x97", + "\xB9\xDD" => "\xEB\xB0\x98", + "\xB9\xDE" => "\xEB\xB0\x9B", + "\xB9\xDF" => "\xEB\xB0\x9C", + "\xB9\xE0" => "\xEB\xB0\x9D", + "\xB9\xE1" => "\xEB\xB0\x9E", + "\xB9\xE2" => "\xEB\xB0\x9F", + "\xB9\xE3" => "\xEB\xB0\xA4", + "\xB9\xE4" => "\xEB\xB0\xA5", + "\xB9\xE5" => "\xEB\xB0\xA7", + "\xB9\xE6" => "\xEB\xB0\xA9", + "\xB9\xE7" => "\xEB\xB0\xAD", + "\xB9\xE8" => "\xEB\xB0\xB0", + "\xB9\xE9" => "\xEB\xB0\xB1", + "\xB9\xEA" => "\xEB\xB0\xB4", + "\xB9\xEB" => "\xEB\xB0\xB8", + "\xB9\xEC" => "\xEB\xB1\x80", + "\xB9\xED" => "\xEB\xB1\x81", + "\xB9\xEE" => "\xEB\xB1\x83", + "\xB9\xEF" => "\xEB\xB1\x84", + "\xB9\xF0" => "\xEB\xB1\x85", + "\xB9\xF1" => "\xEB\xB1\x89", + "\xB9\xF2" => "\xEB\xB1\x8C", + "\xB9\xF3" => "\xEB\xB1\x8D", + "\xB9\xF4" => "\xEB\xB1\x90", + "\xB9\xF5" => "\xEB\xB1\x9D", + "\xB9\xF6" => "\xEB\xB2\x84", + "\xB9\xF7" => "\xEB\xB2\x85", + "\xB9\xF8" => "\xEB\xB2\x88", + "\xB9\xF9" => "\xEB\xB2\x8B", + "\xB9\xFA" => "\xEB\xB2\x8C", + "\xB9\xFB" => "\xEB\xB2\x8E", + "\xB9\xFC" => "\xEB\xB2\x94", + "\xB9\xFD" => "\xEB\xB2\x95", + "\xB9\xFE" => "\xEB\xB2\x97", + "\xBA\x41" => "\xED\x8A\x8D", + "\xBA\x42" => "\xED\x8A\x8E", + "\xBA\x43" => "\xED\x8A\x8F", + "\xBA\x44" => "\xED\x8A\x92", + "\xBA\x45" => "\xED\x8A\x93", + "\xBA\x46" => "\xED\x8A\x94", + "\xBA\x47" => "\xED\x8A\x96", + "\xBA\x48" => "\xED\x8A\x97", + "\xBA\x49" => "\xED\x8A\x98", + "\xBA\x4A" => "\xED\x8A\x99", + "\xBA\x4B" => "\xED\x8A\x9A", + "\xBA\x4C" => "\xED\x8A\x9B", + "\xBA\x4D" => "\xED\x8A\x9D", + "\xBA\x4E" => "\xED\x8A\x9E", + "\xBA\x4F" => "\xED\x8A\x9F", + "\xBA\x50" => "\xED\x8A\xA1", + "\xBA\x51" => "\xED\x8A\xA2", + "\xBA\x52" => "\xED\x8A\xA3", + "\xBA\x53" => "\xED\x8A\xA5", + "\xBA\x54" => "\xED\x8A\xA6", + "\xBA\x55" => "\xED\x8A\xA7", + "\xBA\x56" => "\xED\x8A\xA8", + "\xBA\x57" => "\xED\x8A\xA9", + "\xBA\x58" => "\xED\x8A\xAA", + "\xBA\x59" => "\xED\x8A\xAB", + "\xBA\x5A" => "\xED\x8A\xAD", + "\xBA\x61" => "\xED\x8A\xAE", + "\xBA\x62" => "\xED\x8A\xAF", + "\xBA\x63" => "\xED\x8A\xB0", + "\xBA\x64" => "\xED\x8A\xB2", + "\xBA\x65" => "\xED\x8A\xB3", + "\xBA\x66" => "\xED\x8A\xB4", + "\xBA\x67" => "\xED\x8A\xB5", + "\xBA\x68" => "\xED\x8A\xB6", + "\xBA\x69" => "\xED\x8A\xB7", + "\xBA\x6A" => "\xED\x8A\xBA", + "\xBA\x6B" => "\xED\x8A\xBB", + "\xBA\x6C" => "\xED\x8A\xBD", + "\xBA\x6D" => "\xED\x8A\xBE", + "\xBA\x6E" => "\xED\x8B\x81", + "\xBA\x6F" => "\xED\x8B\x83", + "\xBA\x70" => "\xED\x8B\x84", + "\xBA\x71" => "\xED\x8B\x85", + "\xBA\x72" => "\xED\x8B\x86", + "\xBA\x73" => "\xED\x8B\x87", + "\xBA\x74" => "\xED\x8B\x8A", + "\xBA\x75" => "\xED\x8B\x8C", + "\xBA\x76" => "\xED\x8B\x8D", + "\xBA\x77" => "\xED\x8B\x8E", + "\xBA\x78" => "\xED\x8B\x8F", + "\xBA\x79" => "\xED\x8B\x90", + "\xBA\x7A" => "\xED\x8B\x91", + "\xBA\x81" => "\xED\x8B\x92", + "\xBA\x82" => "\xED\x8B\x93", + "\xBA\x83" => "\xED\x8B\x95", + "\xBA\x84" => "\xED\x8B\x96", + "\xBA\x85" => "\xED\x8B\x97", + "\xBA\x86" => "\xED\x8B\x99", + "\xBA\x87" => "\xED\x8B\x9A", + "\xBA\x88" => "\xED\x8B\x9B", + "\xBA\x89" => "\xED\x8B\x9D", + "\xBA\x8A" => "\xED\x8B\x9E", + "\xBA\x8B" => "\xED\x8B\x9F", + "\xBA\x8C" => "\xED\x8B\xA0", + "\xBA\x8D" => "\xED\x8B\xA1", + "\xBA\x8E" => "\xED\x8B\xA2", + "\xBA\x8F" => "\xED\x8B\xA3", + "\xBA\x90" => "\xED\x8B\xA6", + "\xBA\x91" => "\xED\x8B\xA7", + "\xBA\x92" => "\xED\x8B\xA8", + "\xBA\x93" => "\xED\x8B\xA9", + "\xBA\x94" => "\xED\x8B\xAA", + "\xBA\x95" => "\xED\x8B\xAB", + "\xBA\x96" => "\xED\x8B\xAC", + "\xBA\x97" => "\xED\x8B\xAD", + "\xBA\x98" => "\xED\x8B\xAE", + "\xBA\x99" => "\xED\x8B\xAF", + "\xBA\x9A" => "\xED\x8B\xB2", + "\xBA\x9B" => "\xED\x8B\xB3", + "\xBA\x9C" => "\xED\x8B\xB5", + "\xBA\x9D" => "\xED\x8B\xB6", + "\xBA\x9E" => "\xED\x8B\xB7", + "\xBA\x9F" => "\xED\x8B\xB9", + "\xBA\xA0" => "\xED\x8B\xBA", + "\xBA\xA1" => "\xEB\xB2\x99", + "\xBA\xA2" => "\xEB\xB2\x9A", + "\xBA\xA3" => "\xEB\xB2\xA0", + "\xBA\xA4" => "\xEB\xB2\xA1", + "\xBA\xA5" => "\xEB\xB2\xA4", + "\xBA\xA6" => "\xEB\xB2\xA7", + "\xBA\xA7" => "\xEB\xB2\xA8", + "\xBA\xA8" => "\xEB\xB2\xB0", + "\xBA\xA9" => "\xEB\xB2\xB1", + "\xBA\xAA" => "\xEB\xB2\xB3", + "\xBA\xAB" => "\xEB\xB2\xB4", + "\xBA\xAC" => "\xEB\xB2\xB5", + "\xBA\xAD" => "\xEB\xB2\xBC", + "\xBA\xAE" => "\xEB\xB2\xBD", + "\xBA\xAF" => "\xEB\xB3\x80", + "\xBA\xB0" => "\xEB\xB3\x84", + "\xBA\xB1" => "\xEB\xB3\x8D", + "\xBA\xB2" => "\xEB\xB3\x8F", + "\xBA\xB3" => "\xEB\xB3\x90", + "\xBA\xB4" => "\xEB\xB3\x91", + "\xBA\xB5" => "\xEB\xB3\x95", + "\xBA\xB6" => "\xEB\xB3\x98", + "\xBA\xB7" => "\xEB\xB3\x9C", + "\xBA\xB8" => "\xEB\xB3\xB4", + "\xBA\xB9" => "\xEB\xB3\xB5", + "\xBA\xBA" => "\xEB\xB3\xB6", + "\xBA\xBB" => "\xEB\xB3\xB8", + "\xBA\xBC" => "\xEB\xB3\xBC", + "\xBA\xBD" => "\xEB\xB4\x84", + "\xBA\xBE" => "\xEB\xB4\x85", + "\xBA\xBF" => "\xEB\xB4\x87", + "\xBA\xC0" => "\xEB\xB4\x89", + "\xBA\xC1" => "\xEB\xB4\x90", + "\xBA\xC2" => "\xEB\xB4\x94", + "\xBA\xC3" => "\xEB\xB4\xA4", + "\xBA\xC4" => "\xEB\xB4\xAC", + "\xBA\xC5" => "\xEB\xB5\x80", + "\xBA\xC6" => "\xEB\xB5\x88", + "\xBA\xC7" => "\xEB\xB5\x89", + "\xBA\xC8" => "\xEB\xB5\x8C", + "\xBA\xC9" => "\xEB\xB5\x90", + "\xBA\xCA" => "\xEB\xB5\x98", + "\xBA\xCB" => "\xEB\xB5\x99", + "\xBA\xCC" => "\xEB\xB5\xA4", + "\xBA\xCD" => "\xEB\xB5\xA8", + "\xBA\xCE" => "\xEB\xB6\x80", + "\xBA\xCF" => "\xEB\xB6\x81", + "\xBA\xD0" => "\xEB\xB6\x84", + "\xBA\xD1" => "\xEB\xB6\x87", + "\xBA\xD2" => "\xEB\xB6\x88", + "\xBA\xD3" => "\xEB\xB6\x89", + "\xBA\xD4" => "\xEB\xB6\x8A", + "\xBA\xD5" => "\xEB\xB6\x90", + "\xBA\xD6" => "\xEB\xB6\x91", + "\xBA\xD7" => "\xEB\xB6\x93", + "\xBA\xD8" => "\xEB\xB6\x95", + "\xBA\xD9" => "\xEB\xB6\x99", + "\xBA\xDA" => "\xEB\xB6\x9A", + "\xBA\xDB" => "\xEB\xB6\x9C", + "\xBA\xDC" => "\xEB\xB6\xA4", + "\xBA\xDD" => "\xEB\xB6\xB0", + "\xBA\xDE" => "\xEB\xB6\xB8", + "\xBA\xDF" => "\xEB\xB7\x94", + "\xBA\xE0" => "\xEB\xB7\x95", + "\xBA\xE1" => "\xEB\xB7\x98", + "\xBA\xE2" => "\xEB\xB7\x9C", + "\xBA\xE3" => "\xEB\xB7\xA9", + "\xBA\xE4" => "\xEB\xB7\xB0", + "\xBA\xE5" => "\xEB\xB7\xB4", + "\xBA\xE6" => "\xEB\xB7\xB8", + "\xBA\xE7" => "\xEB\xB8\x80", + "\xBA\xE8" => "\xEB\xB8\x83", + "\xBA\xE9" => "\xEB\xB8\x85", + "\xBA\xEA" => "\xEB\xB8\x8C", + "\xBA\xEB" => "\xEB\xB8\x8D", + "\xBA\xEC" => "\xEB\xB8\x90", + "\xBA\xED" => "\xEB\xB8\x94", + "\xBA\xEE" => "\xEB\xB8\x9C", + "\xBA\xEF" => "\xEB\xB8\x9D", + "\xBA\xF0" => "\xEB\xB8\x9F", + "\xBA\xF1" => "\xEB\xB9\x84", + "\xBA\xF2" => "\xEB\xB9\x85", + "\xBA\xF3" => "\xEB\xB9\x88", + "\xBA\xF4" => "\xEB\xB9\x8C", + "\xBA\xF5" => "\xEB\xB9\x8E", + "\xBA\xF6" => "\xEB\xB9\x94", + "\xBA\xF7" => "\xEB\xB9\x95", + "\xBA\xF8" => "\xEB\xB9\x97", + "\xBA\xF9" => "\xEB\xB9\x99", + "\xBA\xFA" => "\xEB\xB9\x9A", + "\xBA\xFB" => "\xEB\xB9\x9B", + "\xBA\xFC" => "\xEB\xB9\xA0", + "\xBA\xFD" => "\xEB\xB9\xA1", + "\xBA\xFE" => "\xEB\xB9\xA4", + "\xBB\x41" => "\xED\x8B\xBB", + "\xBB\x42" => "\xED\x8B\xBC", + "\xBB\x43" => "\xED\x8B\xBD", + "\xBB\x44" => "\xED\x8B\xBE", + "\xBB\x45" => "\xED\x8B\xBF", + "\xBB\x46" => "\xED\x8C\x82", + "\xBB\x47" => "\xED\x8C\x84", + "\xBB\x48" => "\xED\x8C\x86", + "\xBB\x49" => "\xED\x8C\x87", + "\xBB\x4A" => "\xED\x8C\x88", + "\xBB\x4B" => "\xED\x8C\x89", + "\xBB\x4C" => "\xED\x8C\x8A", + "\xBB\x4D" => "\xED\x8C\x8B", + "\xBB\x4E" => "\xED\x8C\x8F", + "\xBB\x4F" => "\xED\x8C\x91", + "\xBB\x50" => "\xED\x8C\x92", + "\xBB\x51" => "\xED\x8C\x93", + "\xBB\x52" => "\xED\x8C\x95", + "\xBB\x53" => "\xED\x8C\x97", + "\xBB\x54" => "\xED\x8C\x98", + "\xBB\x55" => "\xED\x8C\x99", + "\xBB\x56" => "\xED\x8C\x9A", + "\xBB\x57" => "\xED\x8C\x9B", + "\xBB\x58" => "\xED\x8C\x9E", + "\xBB\x59" => "\xED\x8C\xA2", + "\xBB\x5A" => "\xED\x8C\xA3", + "\xBB\x61" => "\xED\x8C\xA4", + "\xBB\x62" => "\xED\x8C\xA6", + "\xBB\x63" => "\xED\x8C\xA7", + "\xBB\x64" => "\xED\x8C\xAA", + "\xBB\x65" => "\xED\x8C\xAB", + "\xBB\x66" => "\xED\x8C\xAD", + "\xBB\x67" => "\xED\x8C\xAE", + "\xBB\x68" => "\xED\x8C\xAF", + "\xBB\x69" => "\xED\x8C\xB1", + "\xBB\x6A" => "\xED\x8C\xB2", + "\xBB\x6B" => "\xED\x8C\xB3", + "\xBB\x6C" => "\xED\x8C\xB4", + "\xBB\x6D" => "\xED\x8C\xB5", + "\xBB\x6E" => "\xED\x8C\xB6", + "\xBB\x6F" => "\xED\x8C\xB7", + "\xBB\x70" => "\xED\x8C\xBA", + "\xBB\x71" => "\xED\x8C\xBE", + "\xBB\x72" => "\xED\x8C\xBF", + "\xBB\x73" => "\xED\x8D\x80", + "\xBB\x74" => "\xED\x8D\x81", + "\xBB\x75" => "\xED\x8D\x82", + "\xBB\x76" => "\xED\x8D\x83", + "\xBB\x77" => "\xED\x8D\x86", + "\xBB\x78" => "\xED\x8D\x87", + "\xBB\x79" => "\xED\x8D\x88", + "\xBB\x7A" => "\xED\x8D\x89", + "\xBB\x81" => "\xED\x8D\x8A", + "\xBB\x82" => "\xED\x8D\x8B", + "\xBB\x83" => "\xED\x8D\x8C", + "\xBB\x84" => "\xED\x8D\x8D", + "\xBB\x85" => "\xED\x8D\x8E", + "\xBB\x86" => "\xED\x8D\x8F", + "\xBB\x87" => "\xED\x8D\x90", + "\xBB\x88" => "\xED\x8D\x91", + "\xBB\x89" => "\xED\x8D\x92", + "\xBB\x8A" => "\xED\x8D\x93", + "\xBB\x8B" => "\xED\x8D\x94", + "\xBB\x8C" => "\xED\x8D\x95", + "\xBB\x8D" => "\xED\x8D\x96", + "\xBB\x8E" => "\xED\x8D\x97", + "\xBB\x8F" => "\xED\x8D\x98", + "\xBB\x90" => "\xED\x8D\x99", + "\xBB\x91" => "\xED\x8D\x9A", + "\xBB\x92" => "\xED\x8D\x9B", + "\xBB\x93" => "\xED\x8D\x9C", + "\xBB\x94" => "\xED\x8D\x9D", + "\xBB\x95" => "\xED\x8D\x9E", + "\xBB\x96" => "\xED\x8D\x9F", + "\xBB\x97" => "\xED\x8D\xA0", + "\xBB\x98" => "\xED\x8D\xA1", + "\xBB\x99" => "\xED\x8D\xA2", + "\xBB\x9A" => "\xED\x8D\xA3", + "\xBB\x9B" => "\xED\x8D\xA4", + "\xBB\x9C" => "\xED\x8D\xA5", + "\xBB\x9D" => "\xED\x8D\xA6", + "\xBB\x9E" => "\xED\x8D\xA7", + "\xBB\x9F" => "\xED\x8D\xA8", + "\xBB\xA0" => "\xED\x8D\xA9", + "\xBB\xA1" => "\xEB\xB9\xA8", + "\xBB\xA2" => "\xEB\xB9\xAA", + "\xBB\xA3" => "\xEB\xB9\xB0", + "\xBB\xA4" => "\xEB\xB9\xB1", + "\xBB\xA5" => "\xEB\xB9\xB3", + "\xBB\xA6" => "\xEB\xB9\xB4", + "\xBB\xA7" => "\xEB\xB9\xB5", + "\xBB\xA8" => "\xEB\xB9\xBB", + "\xBB\xA9" => "\xEB\xB9\xBC", + "\xBB\xAA" => "\xEB\xB9\xBD", + "\xBB\xAB" => "\xEB\xBA\x80", + "\xBB\xAC" => "\xEB\xBA\x84", + "\xBB\xAD" => "\xEB\xBA\x8C", + "\xBB\xAE" => "\xEB\xBA\x8D", + "\xBB\xAF" => "\xEB\xBA\x8F", + "\xBB\xB0" => "\xEB\xBA\x90", + "\xBB\xB1" => "\xEB\xBA\x91", + "\xBB\xB2" => "\xEB\xBA\x98", + "\xBB\xB3" => "\xEB\xBA\x99", + "\xBB\xB4" => "\xEB\xBA\xA8", + "\xBB\xB5" => "\xEB\xBB\x90", + "\xBB\xB6" => "\xEB\xBB\x91", + "\xBB\xB7" => "\xEB\xBB\x94", + "\xBB\xB8" => "\xEB\xBB\x97", + "\xBB\xB9" => "\xEB\xBB\x98", + "\xBB\xBA" => "\xEB\xBB\xA0", + "\xBB\xBB" => "\xEB\xBB\xA3", + "\xBB\xBC" => "\xEB\xBB\xA4", + "\xBB\xBD" => "\xEB\xBB\xA5", + "\xBB\xBE" => "\xEB\xBB\xAC", + "\xBB\xBF" => "\xEB\xBC\x81", + "\xBB\xC0" => "\xEB\xBC\x88", + "\xBB\xC1" => "\xEB\xBC\x89", + "\xBB\xC2" => "\xEB\xBC\x98", + "\xBB\xC3" => "\xEB\xBC\x99", + "\xBB\xC4" => "\xEB\xBC\x9B", + "\xBB\xC5" => "\xEB\xBC\x9C", + "\xBB\xC6" => "\xEB\xBC\x9D", + "\xBB\xC7" => "\xEB\xBD\x80", + "\xBB\xC8" => "\xEB\xBD\x81", + "\xBB\xC9" => "\xEB\xBD\x84", + "\xBB\xCA" => "\xEB\xBD\x88", + "\xBB\xCB" => "\xEB\xBD\x90", + "\xBB\xCC" => "\xEB\xBD\x91", + "\xBB\xCD" => "\xEB\xBD\x95", + "\xBB\xCE" => "\xEB\xBE\x94", + "\xBB\xCF" => "\xEB\xBE\xB0", + "\xBB\xD0" => "\xEB\xBF\x85", + "\xBB\xD1" => "\xEB\xBF\x8C", + "\xBB\xD2" => "\xEB\xBF\x8D", + "\xBB\xD3" => "\xEB\xBF\x90", + "\xBB\xD4" => "\xEB\xBF\x94", + "\xBB\xD5" => "\xEB\xBF\x9C", + "\xBB\xD6" => "\xEB\xBF\x9F", + "\xBB\xD7" => "\xEB\xBF\xA1", + "\xBB\xD8" => "\xEC\x80\xBC", + "\xBB\xD9" => "\xEC\x81\x91", + "\xBB\xDA" => "\xEC\x81\x98", + "\xBB\xDB" => "\xEC\x81\x9C", + "\xBB\xDC" => "\xEC\x81\xA0", + "\xBB\xDD" => "\xEC\x81\xA8", + "\xBB\xDE" => "\xEC\x81\xA9", + "\xBB\xDF" => "\xEC\x82\x90", + "\xBB\xE0" => "\xEC\x82\x91", + "\xBB\xE1" => "\xEC\x82\x94", + "\xBB\xE2" => "\xEC\x82\x98", + "\xBB\xE3" => "\xEC\x82\xA0", + "\xBB\xE4" => "\xEC\x82\xA1", + "\xBB\xE5" => "\xEC\x82\xA3", + "\xBB\xE6" => "\xEC\x82\xA5", + "\xBB\xE7" => "\xEC\x82\xAC", + "\xBB\xE8" => "\xEC\x82\xAD", + "\xBB\xE9" => "\xEC\x82\xAF", + "\xBB\xEA" => "\xEC\x82\xB0", + "\xBB\xEB" => "\xEC\x82\xB3", + "\xBB\xEC" => "\xEC\x82\xB4", + "\xBB\xED" => "\xEC\x82\xB5", + "\xBB\xEE" => "\xEC\x82\xB6", + "\xBB\xEF" => "\xEC\x82\xBC", + "\xBB\xF0" => "\xEC\x82\xBD", + "\xBB\xF1" => "\xEC\x82\xBF", + "\xBB\xF2" => "\xEC\x83\x80", + "\xBB\xF3" => "\xEC\x83\x81", + "\xBB\xF4" => "\xEC\x83\x85", + "\xBB\xF5" => "\xEC\x83\x88", + "\xBB\xF6" => "\xEC\x83\x89", + "\xBB\xF7" => "\xEC\x83\x8C", + "\xBB\xF8" => "\xEC\x83\x90", + "\xBB\xF9" => "\xEC\x83\x98", + "\xBB\xFA" => "\xEC\x83\x99", + "\xBB\xFB" => "\xEC\x83\x9B", + "\xBB\xFC" => "\xEC\x83\x9C", + "\xBB\xFD" => "\xEC\x83\x9D", + "\xBB\xFE" => "\xEC\x83\xA4", + "\xBC\x41" => "\xED\x8D\xAA", + "\xBC\x42" => "\xED\x8D\xAB", + "\xBC\x43" => "\xED\x8D\xAC", + "\xBC\x44" => "\xED\x8D\xAD", + "\xBC\x45" => "\xED\x8D\xAE", + "\xBC\x46" => "\xED\x8D\xAF", + "\xBC\x47" => "\xED\x8D\xB0", + "\xBC\x48" => "\xED\x8D\xB1", + "\xBC\x49" => "\xED\x8D\xB2", + "\xBC\x4A" => "\xED\x8D\xB3", + "\xBC\x4B" => "\xED\x8D\xB4", + "\xBC\x4C" => "\xED\x8D\xB5", + "\xBC\x4D" => "\xED\x8D\xB6", + "\xBC\x4E" => "\xED\x8D\xB7", + "\xBC\x4F" => "\xED\x8D\xB8", + "\xBC\x50" => "\xED\x8D\xB9", + "\xBC\x51" => "\xED\x8D\xBA", + "\xBC\x52" => "\xED\x8D\xBB", + "\xBC\x53" => "\xED\x8D\xBE", + "\xBC\x54" => "\xED\x8D\xBF", + "\xBC\x55" => "\xED\x8E\x81", + "\xBC\x56" => "\xED\x8E\x82", + "\xBC\x57" => "\xED\x8E\x83", + "\xBC\x58" => "\xED\x8E\x85", + "\xBC\x59" => "\xED\x8E\x86", + "\xBC\x5A" => "\xED\x8E\x87", + "\xBC\x61" => "\xED\x8E\x88", + "\xBC\x62" => "\xED\x8E\x89", + "\xBC\x63" => "\xED\x8E\x8A", + "\xBC\x64" => "\xED\x8E\x8B", + "\xBC\x65" => "\xED\x8E\x8E", + "\xBC\x66" => "\xED\x8E\x92", + "\xBC\x67" => "\xED\x8E\x93", + "\xBC\x68" => "\xED\x8E\x94", + "\xBC\x69" => "\xED\x8E\x95", + "\xBC\x6A" => "\xED\x8E\x96", + "\xBC\x6B" => "\xED\x8E\x97", + "\xBC\x6C" => "\xED\x8E\x9A", + "\xBC\x6D" => "\xED\x8E\x9B", + "\xBC\x6E" => "\xED\x8E\x9D", + "\xBC\x6F" => "\xED\x8E\x9E", + "\xBC\x70" => "\xED\x8E\x9F", + "\xBC\x71" => "\xED\x8E\xA1", + "\xBC\x72" => "\xED\x8E\xA2", + "\xBC\x73" => "\xED\x8E\xA3", + "\xBC\x74" => "\xED\x8E\xA4", + "\xBC\x75" => "\xED\x8E\xA5", + "\xBC\x76" => "\xED\x8E\xA6", + "\xBC\x77" => "\xED\x8E\xA7", + "\xBC\x78" => "\xED\x8E\xAA", + "\xBC\x79" => "\xED\x8E\xAC", + "\xBC\x7A" => "\xED\x8E\xAE", + "\xBC\x81" => "\xED\x8E\xAF", + "\xBC\x82" => "\xED\x8E\xB0", + "\xBC\x83" => "\xED\x8E\xB1", + "\xBC\x84" => "\xED\x8E\xB2", + "\xBC\x85" => "\xED\x8E\xB3", + "\xBC\x86" => "\xED\x8E\xB5", + "\xBC\x87" => "\xED\x8E\xB6", + "\xBC\x88" => "\xED\x8E\xB7", + "\xBC\x89" => "\xED\x8E\xB9", + "\xBC\x8A" => "\xED\x8E\xBA", + "\xBC\x8B" => "\xED\x8E\xBB", + "\xBC\x8C" => "\xED\x8E\xBD", + "\xBC\x8D" => "\xED\x8E\xBE", + "\xBC\x8E" => "\xED\x8E\xBF", + "\xBC\x8F" => "\xED\x8F\x80", + "\xBC\x90" => "\xED\x8F\x81", + "\xBC\x91" => "\xED\x8F\x82", + "\xBC\x92" => "\xED\x8F\x83", + "\xBC\x93" => "\xED\x8F\x86", + "\xBC\x94" => "\xED\x8F\x87", + "\xBC\x95" => "\xED\x8F\x8A", + "\xBC\x96" => "\xED\x8F\x8B", + "\xBC\x97" => "\xED\x8F\x8C", + "\xBC\x98" => "\xED\x8F\x8D", + "\xBC\x99" => "\xED\x8F\x8E", + "\xBC\x9A" => "\xED\x8F\x8F", + "\xBC\x9B" => "\xED\x8F\x91", + "\xBC\x9C" => "\xED\x8F\x92", + "\xBC\x9D" => "\xED\x8F\x93", + "\xBC\x9E" => "\xED\x8F\x94", + "\xBC\x9F" => "\xED\x8F\x95", + "\xBC\xA0" => "\xED\x8F\x96", + "\xBC\xA1" => "\xEC\x83\xA5", + "\xBC\xA2" => "\xEC\x83\xA8", + "\xBC\xA3" => "\xEC\x83\xAC", + "\xBC\xA4" => "\xEC\x83\xB4", + "\xBC\xA5" => "\xEC\x83\xB5", + "\xBC\xA6" => "\xEC\x83\xB7", + "\xBC\xA7" => "\xEC\x83\xB9", + "\xBC\xA8" => "\xEC\x84\x80", + "\xBC\xA9" => "\xEC\x84\x84", + "\xBC\xAA" => "\xEC\x84\x88", + "\xBC\xAB" => "\xEC\x84\x90", + "\xBC\xAC" => "\xEC\x84\x95", + "\xBC\xAD" => "\xEC\x84\x9C", + "\xBC\xAE" => "\xEC\x84\x9D", + "\xBC\xAF" => "\xEC\x84\x9E", + "\xBC\xB0" => "\xEC\x84\x9F", + "\xBC\xB1" => "\xEC\x84\xA0", + "\xBC\xB2" => "\xEC\x84\xA3", + "\xBC\xB3" => "\xEC\x84\xA4", + "\xBC\xB4" => "\xEC\x84\xA6", + "\xBC\xB5" => "\xEC\x84\xA7", + "\xBC\xB6" => "\xEC\x84\xAC", + "\xBC\xB7" => "\xEC\x84\xAD", + "\xBC\xB8" => "\xEC\x84\xAF", + "\xBC\xB9" => "\xEC\x84\xB0", + "\xBC\xBA" => "\xEC\x84\xB1", + "\xBC\xBB" => "\xEC\x84\xB6", + "\xBC\xBC" => "\xEC\x84\xB8", + "\xBC\xBD" => "\xEC\x84\xB9", + "\xBC\xBE" => "\xEC\x84\xBC", + "\xBC\xBF" => "\xEC\x85\x80", + "\xBC\xC0" => "\xEC\x85\x88", + "\xBC\xC1" => "\xEC\x85\x89", + "\xBC\xC2" => "\xEC\x85\x8B", + "\xBC\xC3" => "\xEC\x85\x8C", + "\xBC\xC4" => "\xEC\x85\x8D", + "\xBC\xC5" => "\xEC\x85\x94", + "\xBC\xC6" => "\xEC\x85\x95", + "\xBC\xC7" => "\xEC\x85\x98", + "\xBC\xC8" => "\xEC\x85\x9C", + "\xBC\xC9" => "\xEC\x85\xA4", + "\xBC\xCA" => "\xEC\x85\xA5", + "\xBC\xCB" => "\xEC\x85\xA7", + "\xBC\xCC" => "\xEC\x85\xA8", + "\xBC\xCD" => "\xEC\x85\xA9", + "\xBC\xCE" => "\xEC\x85\xB0", + "\xBC\xCF" => "\xEC\x85\xB4", + "\xBC\xD0" => "\xEC\x85\xB8", + "\xBC\xD1" => "\xEC\x86\x85", + "\xBC\xD2" => "\xEC\x86\x8C", + "\xBC\xD3" => "\xEC\x86\x8D", + "\xBC\xD4" => "\xEC\x86\x8E", + "\xBC\xD5" => "\xEC\x86\x90", + "\xBC\xD6" => "\xEC\x86\x94", + "\xBC\xD7" => "\xEC\x86\x96", + "\xBC\xD8" => "\xEC\x86\x9C", + "\xBC\xD9" => "\xEC\x86\x9D", + "\xBC\xDA" => "\xEC\x86\x9F", + "\xBC\xDB" => "\xEC\x86\xA1", + "\xBC\xDC" => "\xEC\x86\xA5", + "\xBC\xDD" => "\xEC\x86\xA8", + "\xBC\xDE" => "\xEC\x86\xA9", + "\xBC\xDF" => "\xEC\x86\xAC", + "\xBC\xE0" => "\xEC\x86\xB0", + "\xBC\xE1" => "\xEC\x86\xBD", + "\xBC\xE2" => "\xEC\x87\x84", + "\xBC\xE3" => "\xEC\x87\x88", + "\xBC\xE4" => "\xEC\x87\x8C", + "\xBC\xE5" => "\xEC\x87\x94", + "\xBC\xE6" => "\xEC\x87\x97", + "\xBC\xE7" => "\xEC\x87\x98", + "\xBC\xE8" => "\xEC\x87\xA0", + "\xBC\xE9" => "\xEC\x87\xA4", + "\xBC\xEA" => "\xEC\x87\xA8", + "\xBC\xEB" => "\xEC\x87\xB0", + "\xBC\xEC" => "\xEC\x87\xB1", + "\xBC\xED" => "\xEC\x87\xB3", + "\xBC\xEE" => "\xEC\x87\xBC", + "\xBC\xEF" => "\xEC\x87\xBD", + "\xBC\xF0" => "\xEC\x88\x80", + "\xBC\xF1" => "\xEC\x88\x84", + "\xBC\xF2" => "\xEC\x88\x8C", + "\xBC\xF3" => "\xEC\x88\x8D", + "\xBC\xF4" => "\xEC\x88\x8F", + "\xBC\xF5" => "\xEC\x88\x91", + "\xBC\xF6" => "\xEC\x88\x98", + "\xBC\xF7" => "\xEC\x88\x99", + "\xBC\xF8" => "\xEC\x88\x9C", + "\xBC\xF9" => "\xEC\x88\x9F", + "\xBC\xFA" => "\xEC\x88\xA0", + "\xBC\xFB" => "\xEC\x88\xA8", + "\xBC\xFC" => "\xEC\x88\xA9", + "\xBC\xFD" => "\xEC\x88\xAB", + "\xBC\xFE" => "\xEC\x88\xAD", + "\xBD\x41" => "\xED\x8F\x97", + "\xBD\x42" => "\xED\x8F\x99", + "\xBD\x43" => "\xED\x8F\x9A", + "\xBD\x44" => "\xED\x8F\x9B", + "\xBD\x45" => "\xED\x8F\x9C", + "\xBD\x46" => "\xED\x8F\x9D", + "\xBD\x47" => "\xED\x8F\x9E", + "\xBD\x48" => "\xED\x8F\x9F", + "\xBD\x49" => "\xED\x8F\xA0", + "\xBD\x4A" => "\xED\x8F\xA2", + "\xBD\x4B" => "\xED\x8F\xA4", + "\xBD\x4C" => "\xED\x8F\xA5", + "\xBD\x4D" => "\xED\x8F\xA6", + "\xBD\x4E" => "\xED\x8F\xA7", + "\xBD\x4F" => "\xED\x8F\xA8", + "\xBD\x50" => "\xED\x8F\xA9", + "\xBD\x51" => "\xED\x8F\xAA", + "\xBD\x52" => "\xED\x8F\xAB", + "\xBD\x53" => "\xED\x8F\xAE", + "\xBD\x54" => "\xED\x8F\xAF", + "\xBD\x55" => "\xED\x8F\xB1", + "\xBD\x56" => "\xED\x8F\xB2", + "\xBD\x57" => "\xED\x8F\xB3", + "\xBD\x58" => "\xED\x8F\xB5", + "\xBD\x59" => "\xED\x8F\xB6", + "\xBD\x5A" => "\xED\x8F\xB7", + "\xBD\x61" => "\xED\x8F\xB8", + "\xBD\x62" => "\xED\x8F\xB9", + "\xBD\x63" => "\xED\x8F\xBA", + "\xBD\x64" => "\xED\x8F\xBB", + "\xBD\x65" => "\xED\x8F\xBE", + "\xBD\x66" => "\xED\x90\x80", + "\xBD\x67" => "\xED\x90\x82", + "\xBD\x68" => "\xED\x90\x83", + "\xBD\x69" => "\xED\x90\x84", + "\xBD\x6A" => "\xED\x90\x85", + "\xBD\x6B" => "\xED\x90\x86", + "\xBD\x6C" => "\xED\x90\x87", + "\xBD\x6D" => "\xED\x90\x89", + "\xBD\x6E" => "\xED\x90\x8A", + "\xBD\x6F" => "\xED\x90\x8B", + "\xBD\x70" => "\xED\x90\x8C", + "\xBD\x71" => "\xED\x90\x8D", + "\xBD\x72" => "\xED\x90\x8E", + "\xBD\x73" => "\xED\x90\x8F", + "\xBD\x74" => "\xED\x90\x90", + "\xBD\x75" => "\xED\x90\x91", + "\xBD\x76" => "\xED\x90\x92", + "\xBD\x77" => "\xED\x90\x93", + "\xBD\x78" => "\xED\x90\x94", + "\xBD\x79" => "\xED\x90\x95", + "\xBD\x7A" => "\xED\x90\x96", + "\xBD\x81" => "\xED\x90\x97", + "\xBD\x82" => "\xED\x90\x98", + "\xBD\x83" => "\xED\x90\x99", + "\xBD\x84" => "\xED\x90\x9A", + "\xBD\x85" => "\xED\x90\x9B", + "\xBD\x86" => "\xED\x90\x9C", + "\xBD\x87" => "\xED\x90\x9E", + "\xBD\x88" => "\xED\x90\x9F", + "\xBD\x89" => "\xED\x90\xA0", + "\xBD\x8A" => "\xED\x90\xA1", + "\xBD\x8B" => "\xED\x90\xA2", + "\xBD\x8C" => "\xED\x90\xA3", + "\xBD\x8D" => "\xED\x90\xA4", + "\xBD\x8E" => "\xED\x90\xA5", + "\xBD\x8F" => "\xED\x90\xA6", + "\xBD\x90" => "\xED\x90\xA7", + "\xBD\x91" => "\xED\x90\xA8", + "\xBD\x92" => "\xED\x90\xA9", + "\xBD\x93" => "\xED\x90\xAA", + "\xBD\x94" => "\xED\x90\xAB", + "\xBD\x95" => "\xED\x90\xAC", + "\xBD\x96" => "\xED\x90\xAD", + "\xBD\x97" => "\xED\x90\xAE", + "\xBD\x98" => "\xED\x90\xAF", + "\xBD\x99" => "\xED\x90\xB0", + "\xBD\x9A" => "\xED\x90\xB1", + "\xBD\x9B" => "\xED\x90\xB2", + "\xBD\x9C" => "\xED\x90\xB3", + "\xBD\x9D" => "\xED\x90\xB4", + "\xBD\x9E" => "\xED\x90\xB5", + "\xBD\x9F" => "\xED\x90\xB6", + "\xBD\xA0" => "\xED\x90\xB7", + "\xBD\xA1" => "\xEC\x88\xAF", + "\xBD\xA2" => "\xEC\x88\xB1", + "\xBD\xA3" => "\xEC\x88\xB2", + "\xBD\xA4" => "\xEC\x88\xB4", + "\xBD\xA5" => "\xEC\x89\x88", + "\xBD\xA6" => "\xEC\x89\x90", + "\xBD\xA7" => "\xEC\x89\x91", + "\xBD\xA8" => "\xEC\x89\x94", + "\xBD\xA9" => "\xEC\x89\x98", + "\xBD\xAA" => "\xEC\x89\xA0", + "\xBD\xAB" => "\xEC\x89\xA5", + "\xBD\xAC" => "\xEC\x89\xAC", + "\xBD\xAD" => "\xEC\x89\xAD", + "\xBD\xAE" => "\xEC\x89\xB0", + "\xBD\xAF" => "\xEC\x89\xB4", + "\xBD\xB0" => "\xEC\x89\xBC", + "\xBD\xB1" => "\xEC\x89\xBD", + "\xBD\xB2" => "\xEC\x89\xBF", + "\xBD\xB3" => "\xEC\x8A\x81", + "\xBD\xB4" => "\xEC\x8A\x88", + "\xBD\xB5" => "\xEC\x8A\x89", + "\xBD\xB6" => "\xEC\x8A\x90", + "\xBD\xB7" => "\xEC\x8A\x98", + "\xBD\xB8" => "\xEC\x8A\x9B", + "\xBD\xB9" => "\xEC\x8A\x9D", + "\xBD\xBA" => "\xEC\x8A\xA4", + "\xBD\xBB" => "\xEC\x8A\xA5", + "\xBD\xBC" => "\xEC\x8A\xA8", + "\xBD\xBD" => "\xEC\x8A\xAC", + "\xBD\xBE" => "\xEC\x8A\xAD", + "\xBD\xBF" => "\xEC\x8A\xB4", + "\xBD\xC0" => "\xEC\x8A\xB5", + "\xBD\xC1" => "\xEC\x8A\xB7", + "\xBD\xC2" => "\xEC\x8A\xB9", + "\xBD\xC3" => "\xEC\x8B\x9C", + "\xBD\xC4" => "\xEC\x8B\x9D", + "\xBD\xC5" => "\xEC\x8B\xA0", + "\xBD\xC6" => "\xEC\x8B\xA3", + "\xBD\xC7" => "\xEC\x8B\xA4", + "\xBD\xC8" => "\xEC\x8B\xAB", + "\xBD\xC9" => "\xEC\x8B\xAC", + "\xBD\xCA" => "\xEC\x8B\xAD", + "\xBD\xCB" => "\xEC\x8B\xAF", + "\xBD\xCC" => "\xEC\x8B\xB1", + "\xBD\xCD" => "\xEC\x8B\xB6", + "\xBD\xCE" => "\xEC\x8B\xB8", + "\xBD\xCF" => "\xEC\x8B\xB9", + "\xBD\xD0" => "\xEC\x8B\xBB", + "\xBD\xD1" => "\xEC\x8B\xBC", + "\xBD\xD2" => "\xEC\x8C\x80", + "\xBD\xD3" => "\xEC\x8C\x88", + "\xBD\xD4" => "\xEC\x8C\x89", + "\xBD\xD5" => "\xEC\x8C\x8C", + "\xBD\xD6" => "\xEC\x8C\x8D", + "\xBD\xD7" => "\xEC\x8C\x93", + "\xBD\xD8" => "\xEC\x8C\x94", + "\xBD\xD9" => "\xEC\x8C\x95", + "\xBD\xDA" => "\xEC\x8C\x98", + "\xBD\xDB" => "\xEC\x8C\x9C", + "\xBD\xDC" => "\xEC\x8C\xA4", + "\xBD\xDD" => "\xEC\x8C\xA5", + "\xBD\xDE" => "\xEC\x8C\xA8", + "\xBD\xDF" => "\xEC\x8C\xA9", + "\xBD\xE0" => "\xEC\x8D\x85", + "\xBD\xE1" => "\xEC\x8D\xA8", + "\xBD\xE2" => "\xEC\x8D\xA9", + "\xBD\xE3" => "\xEC\x8D\xAC", + "\xBD\xE4" => "\xEC\x8D\xB0", + "\xBD\xE5" => "\xEC\x8D\xB2", + "\xBD\xE6" => "\xEC\x8D\xB8", + "\xBD\xE7" => "\xEC\x8D\xB9", + "\xBD\xE8" => "\xEC\x8D\xBC", + "\xBD\xE9" => "\xEC\x8D\xBD", + "\xBD\xEA" => "\xEC\x8E\x84", + "\xBD\xEB" => "\xEC\x8E\x88", + "\xBD\xEC" => "\xEC\x8E\x8C", + "\xBD\xED" => "\xEC\x8F\x80", + "\xBD\xEE" => "\xEC\x8F\x98", + "\xBD\xEF" => "\xEC\x8F\x99", + "\xBD\xF0" => "\xEC\x8F\x9C", + "\xBD\xF1" => "\xEC\x8F\x9F", + "\xBD\xF2" => "\xEC\x8F\xA0", + "\xBD\xF3" => "\xEC\x8F\xA2", + "\xBD\xF4" => "\xEC\x8F\xA8", + "\xBD\xF5" => "\xEC\x8F\xA9", + "\xBD\xF6" => "\xEC\x8F\xAD", + "\xBD\xF7" => "\xEC\x8F\xB4", + "\xBD\xF8" => "\xEC\x8F\xB5", + "\xBD\xF9" => "\xEC\x8F\xB8", + "\xBD\xFA" => "\xEC\x90\x88", + "\xBD\xFB" => "\xEC\x90\x90", + "\xBD\xFC" => "\xEC\x90\xA4", + "\xBD\xFD" => "\xEC\x90\xAC", + "\xBD\xFE" => "\xEC\x90\xB0", + "\xBE\x41" => "\xED\x90\xB8", + "\xBE\x42" => "\xED\x90\xB9", + "\xBE\x43" => "\xED\x90\xBA", + "\xBE\x44" => "\xED\x90\xBB", + "\xBE\x45" => "\xED\x90\xBC", + "\xBE\x46" => "\xED\x90\xBD", + "\xBE\x47" => "\xED\x90\xBE", + "\xBE\x48" => "\xED\x90\xBF", + "\xBE\x49" => "\xED\x91\x81", + "\xBE\x4A" => "\xED\x91\x82", + "\xBE\x4B" => "\xED\x91\x83", + "\xBE\x4C" => "\xED\x91\x85", + "\xBE\x4D" => "\xED\x91\x86", + "\xBE\x4E" => "\xED\x91\x87", + "\xBE\x4F" => "\xED\x91\x88", + "\xBE\x50" => "\xED\x91\x89", + "\xBE\x51" => "\xED\x91\x8A", + "\xBE\x52" => "\xED\x91\x8B", + "\xBE\x53" => "\xED\x91\x8C", + "\xBE\x54" => "\xED\x91\x8D", + "\xBE\x55" => "\xED\x91\x8E", + "\xBE\x56" => "\xED\x91\x8F", + "\xBE\x57" => "\xED\x91\x90", + "\xBE\x58" => "\xED\x91\x91", + "\xBE\x59" => "\xED\x91\x92", + "\xBE\x5A" => "\xED\x91\x93", + "\xBE\x61" => "\xED\x91\x94", + "\xBE\x62" => "\xED\x91\x95", + "\xBE\x63" => "\xED\x91\x96", + "\xBE\x64" => "\xED\x91\x97", + "\xBE\x65" => "\xED\x91\x98", + "\xBE\x66" => "\xED\x91\x99", + "\xBE\x67" => "\xED\x91\x9A", + "\xBE\x68" => "\xED\x91\x9B", + "\xBE\x69" => "\xED\x91\x9D", + "\xBE\x6A" => "\xED\x91\x9E", + "\xBE\x6B" => "\xED\x91\x9F", + "\xBE\x6C" => "\xED\x91\xA1", + "\xBE\x6D" => "\xED\x91\xA2", + "\xBE\x6E" => "\xED\x91\xA3", + "\xBE\x6F" => "\xED\x91\xA5", + "\xBE\x70" => "\xED\x91\xA6", + "\xBE\x71" => "\xED\x91\xA7", + "\xBE\x72" => "\xED\x91\xA8", + "\xBE\x73" => "\xED\x91\xA9", + "\xBE\x74" => "\xED\x91\xAA", + "\xBE\x75" => "\xED\x91\xAB", + "\xBE\x76" => "\xED\x91\xAC", + "\xBE\x77" => "\xED\x91\xAE", + "\xBE\x78" => "\xED\x91\xB0", + "\xBE\x79" => "\xED\x91\xB1", + "\xBE\x7A" => "\xED\x91\xB2", + "\xBE\x81" => "\xED\x91\xB3", + "\xBE\x82" => "\xED\x91\xB4", + "\xBE\x83" => "\xED\x91\xB5", + "\xBE\x84" => "\xED\x91\xB6", + "\xBE\x85" => "\xED\x91\xB7", + "\xBE\x86" => "\xED\x91\xBA", + "\xBE\x87" => "\xED\x91\xBB", + "\xBE\x88" => "\xED\x91\xBD", + "\xBE\x89" => "\xED\x91\xBE", + "\xBE\x8A" => "\xED\x92\x81", + "\xBE\x8B" => "\xED\x92\x83", + "\xBE\x8C" => "\xED\x92\x84", + "\xBE\x8D" => "\xED\x92\x85", + "\xBE\x8E" => "\xED\x92\x86", + "\xBE\x8F" => "\xED\x92\x87", + "\xBE\x90" => "\xED\x92\x8A", + "\xBE\x91" => "\xED\x92\x8C", + "\xBE\x92" => "\xED\x92\x8E", + "\xBE\x93" => "\xED\x92\x8F", + "\xBE\x94" => "\xED\x92\x90", + "\xBE\x95" => "\xED\x92\x91", + "\xBE\x96" => "\xED\x92\x92", + "\xBE\x97" => "\xED\x92\x93", + "\xBE\x98" => "\xED\x92\x95", + "\xBE\x99" => "\xED\x92\x96", + "\xBE\x9A" => "\xED\x92\x97", + "\xBE\x9B" => "\xED\x92\x98", + "\xBE\x9C" => "\xED\x92\x99", + "\xBE\x9D" => "\xED\x92\x9A", + "\xBE\x9E" => "\xED\x92\x9B", + "\xBE\x9F" => "\xED\x92\x9C", + "\xBE\xA0" => "\xED\x92\x9D", + "\xBE\xA1" => "\xEC\x90\xB4", + "\xBE\xA2" => "\xEC\x90\xBC", + "\xBE\xA3" => "\xEC\x90\xBD", + "\xBE\xA4" => "\xEC\x91\x88", + "\xBE\xA5" => "\xEC\x91\xA4", + "\xBE\xA6" => "\xEC\x91\xA5", + "\xBE\xA7" => "\xEC\x91\xA8", + "\xBE\xA8" => "\xEC\x91\xAC", + "\xBE\xA9" => "\xEC\x91\xB4", + "\xBE\xAA" => "\xEC\x91\xB5", + "\xBE\xAB" => "\xEC\x91\xB9", + "\xBE\xAC" => "\xEC\x92\x80", + "\xBE\xAD" => "\xEC\x92\x94", + "\xBE\xAE" => "\xEC\x92\x9C", + "\xBE\xAF" => "\xEC\x92\xB8", + "\xBE\xB0" => "\xEC\x92\xBC", + "\xBE\xB1" => "\xEC\x93\xA9", + "\xBE\xB2" => "\xEC\x93\xB0", + "\xBE\xB3" => "\xEC\x93\xB1", + "\xBE\xB4" => "\xEC\x93\xB4", + "\xBE\xB5" => "\xEC\x93\xB8", + "\xBE\xB6" => "\xEC\x93\xBA", + "\xBE\xB7" => "\xEC\x93\xBF", + "\xBE\xB8" => "\xEC\x94\x80", + "\xBE\xB9" => "\xEC\x94\x81", + "\xBE\xBA" => "\xEC\x94\x8C", + "\xBE\xBB" => "\xEC\x94\x90", + "\xBE\xBC" => "\xEC\x94\x94", + "\xBE\xBD" => "\xEC\x94\x9C", + "\xBE\xBE" => "\xEC\x94\xA8", + "\xBE\xBF" => "\xEC\x94\xA9", + "\xBE\xC0" => "\xEC\x94\xAC", + "\xBE\xC1" => "\xEC\x94\xB0", + "\xBE\xC2" => "\xEC\x94\xB8", + "\xBE\xC3" => "\xEC\x94\xB9", + "\xBE\xC4" => "\xEC\x94\xBB", + "\xBE\xC5" => "\xEC\x94\xBD", + "\xBE\xC6" => "\xEC\x95\x84", + "\xBE\xC7" => "\xEC\x95\x85", + "\xBE\xC8" => "\xEC\x95\x88", + "\xBE\xC9" => "\xEC\x95\x89", + "\xBE\xCA" => "\xEC\x95\x8A", + "\xBE\xCB" => "\xEC\x95\x8C", + "\xBE\xCC" => "\xEC\x95\x8D", + "\xBE\xCD" => "\xEC\x95\x8E", + "\xBE\xCE" => "\xEC\x95\x93", + "\xBE\xCF" => "\xEC\x95\x94", + "\xBE\xD0" => "\xEC\x95\x95", + "\xBE\xD1" => "\xEC\x95\x97", + "\xBE\xD2" => "\xEC\x95\x98", + "\xBE\xD3" => "\xEC\x95\x99", + "\xBE\xD4" => "\xEC\x95\x9D", + "\xBE\xD5" => "\xEC\x95\x9E", + "\xBE\xD6" => "\xEC\x95\xA0", + "\xBE\xD7" => "\xEC\x95\xA1", + "\xBE\xD8" => "\xEC\x95\xA4", + "\xBE\xD9" => "\xEC\x95\xA8", + "\xBE\xDA" => "\xEC\x95\xB0", + "\xBE\xDB" => "\xEC\x95\xB1", + "\xBE\xDC" => "\xEC\x95\xB3", + "\xBE\xDD" => "\xEC\x95\xB4", + "\xBE\xDE" => "\xEC\x95\xB5", + "\xBE\xDF" => "\xEC\x95\xBC", + "\xBE\xE0" => "\xEC\x95\xBD", + "\xBE\xE1" => "\xEC\x96\x80", + "\xBE\xE2" => "\xEC\x96\x84", + "\xBE\xE3" => "\xEC\x96\x87", + "\xBE\xE4" => "\xEC\x96\x8C", + "\xBE\xE5" => "\xEC\x96\x8D", + "\xBE\xE6" => "\xEC\x96\x8F", + "\xBE\xE7" => "\xEC\x96\x91", + "\xBE\xE8" => "\xEC\x96\x95", + "\xBE\xE9" => "\xEC\x96\x97", + "\xBE\xEA" => "\xEC\x96\x98", + "\xBE\xEB" => "\xEC\x96\x9C", + "\xBE\xEC" => "\xEC\x96\xA0", + "\xBE\xED" => "\xEC\x96\xA9", + "\xBE\xEE" => "\xEC\x96\xB4", + "\xBE\xEF" => "\xEC\x96\xB5", + "\xBE\xF0" => "\xEC\x96\xB8", + "\xBE\xF1" => "\xEC\x96\xB9", + "\xBE\xF2" => "\xEC\x96\xBB", + "\xBE\xF3" => "\xEC\x96\xBC", + "\xBE\xF4" => "\xEC\x96\xBD", + "\xBE\xF5" => "\xEC\x96\xBE", + "\xBE\xF6" => "\xEC\x97\x84", + "\xBE\xF7" => "\xEC\x97\x85", + "\xBE\xF8" => "\xEC\x97\x86", + "\xBE\xF9" => "\xEC\x97\x87", + "\xBE\xFA" => "\xEC\x97\x88", + "\xBE\xFB" => "\xEC\x97\x89", + "\xBE\xFC" => "\xEC\x97\x8A", + "\xBE\xFD" => "\xEC\x97\x8C", + "\xBE\xFE" => "\xEC\x97\x8E", + "\xBF\x41" => "\xED\x92\x9E", + "\xBF\x42" => "\xED\x92\x9F", + "\xBF\x43" => "\xED\x92\xA0", + "\xBF\x44" => "\xED\x92\xA1", + "\xBF\x45" => "\xED\x92\xA2", + "\xBF\x46" => "\xED\x92\xA3", + "\xBF\x47" => "\xED\x92\xA4", + "\xBF\x48" => "\xED\x92\xA5", + "\xBF\x49" => "\xED\x92\xA6", + "\xBF\x4A" => "\xED\x92\xA7", + "\xBF\x4B" => "\xED\x92\xA8", + "\xBF\x4C" => "\xED\x92\xAA", + "\xBF\x4D" => "\xED\x92\xAB", + "\xBF\x4E" => "\xED\x92\xAC", + "\xBF\x4F" => "\xED\x92\xAD", + "\xBF\x50" => "\xED\x92\xAE", + "\xBF\x51" => "\xED\x92\xAF", + "\xBF\x52" => "\xED\x92\xB0", + "\xBF\x53" => "\xED\x92\xB1", + "\xBF\x54" => "\xED\x92\xB2", + "\xBF\x55" => "\xED\x92\xB3", + "\xBF\x56" => "\xED\x92\xB4", + "\xBF\x57" => "\xED\x92\xB5", + "\xBF\x58" => "\xED\x92\xB6", + "\xBF\x59" => "\xED\x92\xB7", + "\xBF\x5A" => "\xED\x92\xB8", + "\xBF\x61" => "\xED\x92\xB9", + "\xBF\x62" => "\xED\x92\xBA", + "\xBF\x63" => "\xED\x92\xBB", + "\xBF\x64" => "\xED\x92\xBC", + "\xBF\x65" => "\xED\x92\xBD", + "\xBF\x66" => "\xED\x92\xBE", + "\xBF\x67" => "\xED\x92\xBF", + "\xBF\x68" => "\xED\x93\x80", + "\xBF\x69" => "\xED\x93\x81", + "\xBF\x6A" => "\xED\x93\x82", + "\xBF\x6B" => "\xED\x93\x83", + "\xBF\x6C" => "\xED\x93\x84", + "\xBF\x6D" => "\xED\x93\x85", + "\xBF\x6E" => "\xED\x93\x86", + "\xBF\x6F" => "\xED\x93\x87", + "\xBF\x70" => "\xED\x93\x88", + "\xBF\x71" => "\xED\x93\x89", + "\xBF\x72" => "\xED\x93\x8A", + "\xBF\x73" => "\xED\x93\x8B", + "\xBF\x74" => "\xED\x93\x8D", + "\xBF\x75" => "\xED\x93\x8E", + "\xBF\x76" => "\xED\x93\x8F", + "\xBF\x77" => "\xED\x93\x91", + "\xBF\x78" => "\xED\x93\x92", + "\xBF\x79" => "\xED\x93\x93", + "\xBF\x7A" => "\xED\x93\x95", + "\xBF\x81" => "\xED\x93\x96", + "\xBF\x82" => "\xED\x93\x97", + "\xBF\x83" => "\xED\x93\x98", + "\xBF\x84" => "\xED\x93\x99", + "\xBF\x85" => "\xED\x93\x9A", + "\xBF\x86" => "\xED\x93\x9B", + "\xBF\x87" => "\xED\x93\x9D", + "\xBF\x88" => "\xED\x93\x9E", + "\xBF\x89" => "\xED\x93\xA0", + "\xBF\x8A" => "\xED\x93\xA1", + "\xBF\x8B" => "\xED\x93\xA2", + "\xBF\x8C" => "\xED\x93\xA3", + "\xBF\x8D" => "\xED\x93\xA4", + "\xBF\x8E" => "\xED\x93\xA5", + "\xBF\x8F" => "\xED\x93\xA6", + "\xBF\x90" => "\xED\x93\xA7", + "\xBF\x91" => "\xED\x93\xA9", + "\xBF\x92" => "\xED\x93\xAA", + "\xBF\x93" => "\xED\x93\xAB", + "\xBF\x94" => "\xED\x93\xAD", + "\xBF\x95" => "\xED\x93\xAE", + "\xBF\x96" => "\xED\x93\xAF", + "\xBF\x97" => "\xED\x93\xB1", + "\xBF\x98" => "\xED\x93\xB2", + "\xBF\x99" => "\xED\x93\xB3", + "\xBF\x9A" => "\xED\x93\xB4", + "\xBF\x9B" => "\xED\x93\xB5", + "\xBF\x9C" => "\xED\x93\xB6", + "\xBF\x9D" => "\xED\x93\xB7", + "\xBF\x9E" => "\xED\x93\xB9", + "\xBF\x9F" => "\xED\x93\xBA", + "\xBF\xA0" => "\xED\x93\xBC", + "\xBF\xA1" => "\xEC\x97\x90", + "\xBF\xA2" => "\xEC\x97\x91", + "\xBF\xA3" => "\xEC\x97\x94", + "\xBF\xA4" => "\xEC\x97\x98", + "\xBF\xA5" => "\xEC\x97\xA0", + "\xBF\xA6" => "\xEC\x97\xA1", + "\xBF\xA7" => "\xEC\x97\xA3", + "\xBF\xA8" => "\xEC\x97\xA5", + "\xBF\xA9" => "\xEC\x97\xAC", + "\xBF\xAA" => "\xEC\x97\xAD", + "\xBF\xAB" => "\xEC\x97\xAE", + "\xBF\xAC" => "\xEC\x97\xB0", + "\xBF\xAD" => "\xEC\x97\xB4", + "\xBF\xAE" => "\xEC\x97\xB6", + "\xBF\xAF" => "\xEC\x97\xB7", + "\xBF\xB0" => "\xEC\x97\xBC", + "\xBF\xB1" => "\xEC\x97\xBD", + "\xBF\xB2" => "\xEC\x97\xBE", + "\xBF\xB3" => "\xEC\x97\xBF", + "\xBF\xB4" => "\xEC\x98\x80", + "\xBF\xB5" => "\xEC\x98\x81", + "\xBF\xB6" => "\xEC\x98\x85", + "\xBF\xB7" => "\xEC\x98\x86", + "\xBF\xB8" => "\xEC\x98\x87", + "\xBF\xB9" => "\xEC\x98\x88", + "\xBF\xBA" => "\xEC\x98\x8C", + "\xBF\xBB" => "\xEC\x98\x90", + "\xBF\xBC" => "\xEC\x98\x98", + "\xBF\xBD" => "\xEC\x98\x99", + "\xBF\xBE" => "\xEC\x98\x9B", + "\xBF\xBF" => "\xEC\x98\x9C", + "\xBF\xC0" => "\xEC\x98\xA4", + "\xBF\xC1" => "\xEC\x98\xA5", + "\xBF\xC2" => "\xEC\x98\xA8", + "\xBF\xC3" => "\xEC\x98\xAC", + "\xBF\xC4" => "\xEC\x98\xAD", + "\xBF\xC5" => "\xEC\x98\xAE", + "\xBF\xC6" => "\xEC\x98\xB0", + "\xBF\xC7" => "\xEC\x98\xB3", + "\xBF\xC8" => "\xEC\x98\xB4", + "\xBF\xC9" => "\xEC\x98\xB5", + "\xBF\xCA" => "\xEC\x98\xB7", + "\xBF\xCB" => "\xEC\x98\xB9", + "\xBF\xCC" => "\xEC\x98\xBB", + "\xBF\xCD" => "\xEC\x99\x80", + "\xBF\xCE" => "\xEC\x99\x81", + "\xBF\xCF" => "\xEC\x99\x84", + "\xBF\xD0" => "\xEC\x99\x88", + "\xBF\xD1" => "\xEC\x99\x90", + "\xBF\xD2" => "\xEC\x99\x91", + "\xBF\xD3" => "\xEC\x99\x93", + "\xBF\xD4" => "\xEC\x99\x94", + "\xBF\xD5" => "\xEC\x99\x95", + "\xBF\xD6" => "\xEC\x99\x9C", + "\xBF\xD7" => "\xEC\x99\x9D", + "\xBF\xD8" => "\xEC\x99\xA0", + "\xBF\xD9" => "\xEC\x99\xAC", + "\xBF\xDA" => "\xEC\x99\xAF", + "\xBF\xDB" => "\xEC\x99\xB1", + "\xBF\xDC" => "\xEC\x99\xB8", + "\xBF\xDD" => "\xEC\x99\xB9", + "\xBF\xDE" => "\xEC\x99\xBC", + "\xBF\xDF" => "\xEC\x9A\x80", + "\xBF\xE0" => "\xEC\x9A\x88", + "\xBF\xE1" => "\xEC\x9A\x89", + "\xBF\xE2" => "\xEC\x9A\x8B", + "\xBF\xE3" => "\xEC\x9A\x8D", + "\xBF\xE4" => "\xEC\x9A\x94", + "\xBF\xE5" => "\xEC\x9A\x95", + "\xBF\xE6" => "\xEC\x9A\x98", + "\xBF\xE7" => "\xEC\x9A\x9C", + "\xBF\xE8" => "\xEC\x9A\xA4", + "\xBF\xE9" => "\xEC\x9A\xA5", + "\xBF\xEA" => "\xEC\x9A\xA7", + "\xBF\xEB" => "\xEC\x9A\xA9", + "\xBF\xEC" => "\xEC\x9A\xB0", + "\xBF\xED" => "\xEC\x9A\xB1", + "\xBF\xEE" => "\xEC\x9A\xB4", + "\xBF\xEF" => "\xEC\x9A\xB8", + "\xBF\xF0" => "\xEC\x9A\xB9", + "\xBF\xF1" => "\xEC\x9A\xBA", + "\xBF\xF2" => "\xEC\x9B\x80", + "\xBF\xF3" => "\xEC\x9B\x81", + "\xBF\xF4" => "\xEC\x9B\x83", + "\xBF\xF5" => "\xEC\x9B\x85", + "\xBF\xF6" => "\xEC\x9B\x8C", + "\xBF\xF7" => "\xEC\x9B\x8D", + "\xBF\xF8" => "\xEC\x9B\x90", + "\xBF\xF9" => "\xEC\x9B\x94", + "\xBF\xFA" => "\xEC\x9B\x9C", + "\xBF\xFB" => "\xEC\x9B\x9D", + "\xBF\xFC" => "\xEC\x9B\xA0", + "\xBF\xFD" => "\xEC\x9B\xA1", + "\xBF\xFE" => "\xEC\x9B\xA8", + "\xC0\x41" => "\xED\x93\xBE", + "\xC0\x42" => "\xED\x93\xBF", + "\xC0\x43" => "\xED\x94\x80", + "\xC0\x44" => "\xED\x94\x81", + "\xC0\x45" => "\xED\x94\x82", + "\xC0\x46" => "\xED\x94\x83", + "\xC0\x47" => "\xED\x94\x85", + "\xC0\x48" => "\xED\x94\x86", + "\xC0\x49" => "\xED\x94\x87", + "\xC0\x4A" => "\xED\x94\x89", + "\xC0\x4B" => "\xED\x94\x8A", + "\xC0\x4C" => "\xED\x94\x8B", + "\xC0\x4D" => "\xED\x94\x8D", + "\xC0\x4E" => "\xED\x94\x8E", + "\xC0\x4F" => "\xED\x94\x8F", + "\xC0\x50" => "\xED\x94\x90", + "\xC0\x51" => "\xED\x94\x91", + "\xC0\x52" => "\xED\x94\x92", + "\xC0\x53" => "\xED\x94\x93", + "\xC0\x54" => "\xED\x94\x96", + "\xC0\x55" => "\xED\x94\x98", + "\xC0\x56" => "\xED\x94\x99", + "\xC0\x57" => "\xED\x94\x9A", + "\xC0\x58" => "\xED\x94\x9B", + "\xC0\x59" => "\xED\x94\x9C", + "\xC0\x5A" => "\xED\x94\x9D", + "\xC0\x61" => "\xED\x94\x9E", + "\xC0\x62" => "\xED\x94\x9F", + "\xC0\x63" => "\xED\x94\xA0", + "\xC0\x64" => "\xED\x94\xA1", + "\xC0\x65" => "\xED\x94\xA2", + "\xC0\x66" => "\xED\x94\xA3", + "\xC0\x67" => "\xED\x94\xA4", + "\xC0\x68" => "\xED\x94\xA5", + "\xC0\x69" => "\xED\x94\xA6", + "\xC0\x6A" => "\xED\x94\xA7", + "\xC0\x6B" => "\xED\x94\xA8", + "\xC0\x6C" => "\xED\x94\xA9", + "\xC0\x6D" => "\xED\x94\xAA", + "\xC0\x6E" => "\xED\x94\xAB", + "\xC0\x6F" => "\xED\x94\xAC", + "\xC0\x70" => "\xED\x94\xAD", + "\xC0\x71" => "\xED\x94\xAE", + "\xC0\x72" => "\xED\x94\xAF", + "\xC0\x73" => "\xED\x94\xB0", + "\xC0\x74" => "\xED\x94\xB1", + "\xC0\x75" => "\xED\x94\xB2", + "\xC0\x76" => "\xED\x94\xB3", + "\xC0\x77" => "\xED\x94\xB4", + "\xC0\x78" => "\xED\x94\xB5", + "\xC0\x79" => "\xED\x94\xB6", + "\xC0\x7A" => "\xED\x94\xB7", + "\xC0\x81" => "\xED\x94\xB8", + "\xC0\x82" => "\xED\x94\xB9", + "\xC0\x83" => "\xED\x94\xBA", + "\xC0\x84" => "\xED\x94\xBB", + "\xC0\x85" => "\xED\x94\xBE", + "\xC0\x86" => "\xED\x94\xBF", + "\xC0\x87" => "\xED\x95\x81", + "\xC0\x88" => "\xED\x95\x82", + "\xC0\x89" => "\xED\x95\x83", + "\xC0\x8A" => "\xED\x95\x85", + "\xC0\x8B" => "\xED\x95\x86", + "\xC0\x8C" => "\xED\x95\x87", + "\xC0\x8D" => "\xED\x95\x88", + "\xC0\x8E" => "\xED\x95\x89", + "\xC0\x8F" => "\xED\x95\x8A", + "\xC0\x90" => "\xED\x95\x8B", + "\xC0\x91" => "\xED\x95\x8E", + "\xC0\x92" => "\xED\x95\x90", + "\xC0\x93" => "\xED\x95\x92", + "\xC0\x94" => "\xED\x95\x93", + "\xC0\x95" => "\xED\x95\x94", + "\xC0\x96" => "\xED\x95\x95", + "\xC0\x97" => "\xED\x95\x96", + "\xC0\x98" => "\xED\x95\x97", + "\xC0\x99" => "\xED\x95\x9A", + "\xC0\x9A" => "\xED\x95\x9B", + "\xC0\x9B" => "\xED\x95\x9D", + "\xC0\x9C" => "\xED\x95\x9E", + "\xC0\x9D" => "\xED\x95\x9F", + "\xC0\x9E" => "\xED\x95\xA1", + "\xC0\x9F" => "\xED\x95\xA2", + "\xC0\xA0" => "\xED\x95\xA3", + "\xC0\xA1" => "\xEC\x9B\xA9", + "\xC0\xA2" => "\xEC\x9B\xAC", + "\xC0\xA3" => "\xEC\x9B\xB0", + "\xC0\xA4" => "\xEC\x9B\xB8", + "\xC0\xA5" => "\xEC\x9B\xB9", + "\xC0\xA6" => "\xEC\x9B\xBD", + "\xC0\xA7" => "\xEC\x9C\x84", + "\xC0\xA8" => "\xEC\x9C\x85", + "\xC0\xA9" => "\xEC\x9C\x88", + "\xC0\xAA" => "\xEC\x9C\x8C", + "\xC0\xAB" => "\xEC\x9C\x94", + "\xC0\xAC" => "\xEC\x9C\x95", + "\xC0\xAD" => "\xEC\x9C\x97", + "\xC0\xAE" => "\xEC\x9C\x99", + "\xC0\xAF" => "\xEC\x9C\xA0", + "\xC0\xB0" => "\xEC\x9C\xA1", + "\xC0\xB1" => "\xEC\x9C\xA4", + "\xC0\xB2" => "\xEC\x9C\xA8", + "\xC0\xB3" => "\xEC\x9C\xB0", + "\xC0\xB4" => "\xEC\x9C\xB1", + "\xC0\xB5" => "\xEC\x9C\xB3", + "\xC0\xB6" => "\xEC\x9C\xB5", + "\xC0\xB7" => "\xEC\x9C\xB7", + "\xC0\xB8" => "\xEC\x9C\xBC", + "\xC0\xB9" => "\xEC\x9C\xBD", + "\xC0\xBA" => "\xEC\x9D\x80", + "\xC0\xBB" => "\xEC\x9D\x84", + "\xC0\xBC" => "\xEC\x9D\x8A", + "\xC0\xBD" => "\xEC\x9D\x8C", + "\xC0\xBE" => "\xEC\x9D\x8D", + "\xC0\xBF" => "\xEC\x9D\x8F", + "\xC0\xC0" => "\xEC\x9D\x91", + "\xC0\xC1" => "\xEC\x9D\x92", + "\xC0\xC2" => "\xEC\x9D\x93", + "\xC0\xC3" => "\xEC\x9D\x94", + "\xC0\xC4" => "\xEC\x9D\x95", + "\xC0\xC5" => "\xEC\x9D\x96", + "\xC0\xC6" => "\xEC\x9D\x97", + "\xC0\xC7" => "\xEC\x9D\x98", + "\xC0\xC8" => "\xEC\x9D\x9C", + "\xC0\xC9" => "\xEC\x9D\xA0", + "\xC0\xCA" => "\xEC\x9D\xA8", + "\xC0\xCB" => "\xEC\x9D\xAB", + "\xC0\xCC" => "\xEC\x9D\xB4", + "\xC0\xCD" => "\xEC\x9D\xB5", + "\xC0\xCE" => "\xEC\x9D\xB8", + "\xC0\xCF" => "\xEC\x9D\xBC", + "\xC0\xD0" => "\xEC\x9D\xBD", + "\xC0\xD1" => "\xEC\x9D\xBE", + "\xC0\xD2" => "\xEC\x9E\x83", + "\xC0\xD3" => "\xEC\x9E\x84", + "\xC0\xD4" => "\xEC\x9E\x85", + "\xC0\xD5" => "\xEC\x9E\x87", + "\xC0\xD6" => "\xEC\x9E\x88", + "\xC0\xD7" => "\xEC\x9E\x89", + "\xC0\xD8" => "\xEC\x9E\x8A", + "\xC0\xD9" => "\xEC\x9E\x8E", + "\xC0\xDA" => "\xEC\x9E\x90", + "\xC0\xDB" => "\xEC\x9E\x91", + "\xC0\xDC" => "\xEC\x9E\x94", + "\xC0\xDD" => "\xEC\x9E\x96", + "\xC0\xDE" => "\xEC\x9E\x97", + "\xC0\xDF" => "\xEC\x9E\x98", + "\xC0\xE0" => "\xEC\x9E\x9A", + "\xC0\xE1" => "\xEC\x9E\xA0", + "\xC0\xE2" => "\xEC\x9E\xA1", + "\xC0\xE3" => "\xEC\x9E\xA3", + "\xC0\xE4" => "\xEC\x9E\xA4", + "\xC0\xE5" => "\xEC\x9E\xA5", + "\xC0\xE6" => "\xEC\x9E\xA6", + "\xC0\xE7" => "\xEC\x9E\xAC", + "\xC0\xE8" => "\xEC\x9E\xAD", + "\xC0\xE9" => "\xEC\x9E\xB0", + "\xC0\xEA" => "\xEC\x9E\xB4", + "\xC0\xEB" => "\xEC\x9E\xBC", + "\xC0\xEC" => "\xEC\x9E\xBD", + "\xC0\xED" => "\xEC\x9E\xBF", + "\xC0\xEE" => "\xEC\x9F\x80", + "\xC0\xEF" => "\xEC\x9F\x81", + "\xC0\xF0" => "\xEC\x9F\x88", + "\xC0\xF1" => "\xEC\x9F\x89", + "\xC0\xF2" => "\xEC\x9F\x8C", + "\xC0\xF3" => "\xEC\x9F\x8E", + "\xC0\xF4" => "\xEC\x9F\x90", + "\xC0\xF5" => "\xEC\x9F\x98", + "\xC0\xF6" => "\xEC\x9F\x9D", + "\xC0\xF7" => "\xEC\x9F\xA4", + "\xC0\xF8" => "\xEC\x9F\xA8", + "\xC0\xF9" => "\xEC\x9F\xAC", + "\xC0\xFA" => "\xEC\xA0\x80", + "\xC0\xFB" => "\xEC\xA0\x81", + "\xC0\xFC" => "\xEC\xA0\x84", + "\xC0\xFD" => "\xEC\xA0\x88", + "\xC0\xFE" => "\xEC\xA0\x8A", + "\xC1\x41" => "\xED\x95\xA4", + "\xC1\x42" => "\xED\x95\xA6", + "\xC1\x43" => "\xED\x95\xA7", + "\xC1\x44" => "\xED\x95\xAA", + "\xC1\x45" => "\xED\x95\xAC", + "\xC1\x46" => "\xED\x95\xAE", + "\xC1\x47" => "\xED\x95\xAF", + "\xC1\x48" => "\xED\x95\xB0", + "\xC1\x49" => "\xED\x95\xB1", + "\xC1\x4A" => "\xED\x95\xB2", + "\xC1\x4B" => "\xED\x95\xB3", + "\xC1\x4C" => "\xED\x95\xB6", + "\xC1\x4D" => "\xED\x95\xB7", + "\xC1\x4E" => "\xED\x95\xB9", + "\xC1\x4F" => "\xED\x95\xBA", + "\xC1\x50" => "\xED\x95\xBB", + "\xC1\x51" => "\xED\x95\xBD", + "\xC1\x52" => "\xED\x95\xBE", + "\xC1\x53" => "\xED\x95\xBF", + "\xC1\x54" => "\xED\x96\x80", + "\xC1\x55" => "\xED\x96\x81", + "\xC1\x56" => "\xED\x96\x82", + "\xC1\x57" => "\xED\x96\x83", + "\xC1\x58" => "\xED\x96\x86", + "\xC1\x59" => "\xED\x96\x8A", + "\xC1\x5A" => "\xED\x96\x8B", + "\xC1\x61" => "\xED\x96\x8C", + "\xC1\x62" => "\xED\x96\x8D", + "\xC1\x63" => "\xED\x96\x8E", + "\xC1\x64" => "\xED\x96\x8F", + "\xC1\x65" => "\xED\x96\x91", + "\xC1\x66" => "\xED\x96\x92", + "\xC1\x67" => "\xED\x96\x93", + "\xC1\x68" => "\xED\x96\x94", + "\xC1\x69" => "\xED\x96\x95", + "\xC1\x6A" => "\xED\x96\x96", + "\xC1\x6B" => "\xED\x96\x97", + "\xC1\x6C" => "\xED\x96\x98", + "\xC1\x6D" => "\xED\x96\x99", + "\xC1\x6E" => "\xED\x96\x9A", + "\xC1\x6F" => "\xED\x96\x9B", + "\xC1\x70" => "\xED\x96\x9C", + "\xC1\x71" => "\xED\x96\x9D", + "\xC1\x72" => "\xED\x96\x9E", + "\xC1\x73" => "\xED\x96\x9F", + "\xC1\x74" => "\xED\x96\xA0", + "\xC1\x75" => "\xED\x96\xA1", + "\xC1\x76" => "\xED\x96\xA2", + "\xC1\x77" => "\xED\x96\xA3", + "\xC1\x78" => "\xED\x96\xA4", + "\xC1\x79" => "\xED\x96\xA6", + "\xC1\x7A" => "\xED\x96\xA7", + "\xC1\x81" => "\xED\x96\xA8", + "\xC1\x82" => "\xED\x96\xA9", + "\xC1\x83" => "\xED\x96\xAA", + "\xC1\x84" => "\xED\x96\xAB", + "\xC1\x85" => "\xED\x96\xAC", + "\xC1\x86" => "\xED\x96\xAD", + "\xC1\x87" => "\xED\x96\xAE", + "\xC1\x88" => "\xED\x96\xAF", + "\xC1\x89" => "\xED\x96\xB0", + "\xC1\x8A" => "\xED\x96\xB1", + "\xC1\x8B" => "\xED\x96\xB2", + "\xC1\x8C" => "\xED\x96\xB3", + "\xC1\x8D" => "\xED\x96\xB4", + "\xC1\x8E" => "\xED\x96\xB5", + "\xC1\x8F" => "\xED\x96\xB6", + "\xC1\x90" => "\xED\x96\xB7", + "\xC1\x91" => "\xED\x96\xB8", + "\xC1\x92" => "\xED\x96\xB9", + "\xC1\x93" => "\xED\x96\xBA", + "\xC1\x94" => "\xED\x96\xBB", + "\xC1\x95" => "\xED\x96\xBC", + "\xC1\x96" => "\xED\x96\xBD", + "\xC1\x97" => "\xED\x96\xBE", + "\xC1\x98" => "\xED\x96\xBF", + "\xC1\x99" => "\xED\x97\x80", + "\xC1\x9A" => "\xED\x97\x81", + "\xC1\x9B" => "\xED\x97\x82", + "\xC1\x9C" => "\xED\x97\x83", + "\xC1\x9D" => "\xED\x97\x84", + "\xC1\x9E" => "\xED\x97\x85", + "\xC1\x9F" => "\xED\x97\x86", + "\xC1\xA0" => "\xED\x97\x87", + "\xC1\xA1" => "\xEC\xA0\x90", + "\xC1\xA2" => "\xEC\xA0\x91", + "\xC1\xA3" => "\xEC\xA0\x93", + "\xC1\xA4" => "\xEC\xA0\x95", + "\xC1\xA5" => "\xEC\xA0\x96", + "\xC1\xA6" => "\xEC\xA0\x9C", + "\xC1\xA7" => "\xEC\xA0\x9D", + "\xC1\xA8" => "\xEC\xA0\xA0", + "\xC1\xA9" => "\xEC\xA0\xA4", + "\xC1\xAA" => "\xEC\xA0\xAC", + "\xC1\xAB" => "\xEC\xA0\xAD", + "\xC1\xAC" => "\xEC\xA0\xAF", + "\xC1\xAD" => "\xEC\xA0\xB1", + "\xC1\xAE" => "\xEC\xA0\xB8", + "\xC1\xAF" => "\xEC\xA0\xBC", + "\xC1\xB0" => "\xEC\xA1\x80", + "\xC1\xB1" => "\xEC\xA1\x88", + "\xC1\xB2" => "\xEC\xA1\x89", + "\xC1\xB3" => "\xEC\xA1\x8C", + "\xC1\xB4" => "\xEC\xA1\x8D", + "\xC1\xB5" => "\xEC\xA1\x94", + "\xC1\xB6" => "\xEC\xA1\xB0", + "\xC1\xB7" => "\xEC\xA1\xB1", + "\xC1\xB8" => "\xEC\xA1\xB4", + "\xC1\xB9" => "\xEC\xA1\xB8", + "\xC1\xBA" => "\xEC\xA1\xBA", + "\xC1\xBB" => "\xEC\xA2\x80", + "\xC1\xBC" => "\xEC\xA2\x81", + "\xC1\xBD" => "\xEC\xA2\x83", + "\xC1\xBE" => "\xEC\xA2\x85", + "\xC1\xBF" => "\xEC\xA2\x86", + "\xC1\xC0" => "\xEC\xA2\x87", + "\xC1\xC1" => "\xEC\xA2\x8B", + "\xC1\xC2" => "\xEC\xA2\x8C", + "\xC1\xC3" => "\xEC\xA2\x8D", + "\xC1\xC4" => "\xEC\xA2\x94", + "\xC1\xC5" => "\xEC\xA2\x9D", + "\xC1\xC6" => "\xEC\xA2\x9F", + "\xC1\xC7" => "\xEC\xA2\xA1", + "\xC1\xC8" => "\xEC\xA2\xA8", + "\xC1\xC9" => "\xEC\xA2\xBC", + "\xC1\xCA" => "\xEC\xA2\xBD", + "\xC1\xCB" => "\xEC\xA3\x84", + "\xC1\xCC" => "\xEC\xA3\x88", + "\xC1\xCD" => "\xEC\xA3\x8C", + "\xC1\xCE" => "\xEC\xA3\x94", + "\xC1\xCF" => "\xEC\xA3\x95", + "\xC1\xD0" => "\xEC\xA3\x97", + "\xC1\xD1" => "\xEC\xA3\x99", + "\xC1\xD2" => "\xEC\xA3\xA0", + "\xC1\xD3" => "\xEC\xA3\xA1", + "\xC1\xD4" => "\xEC\xA3\xA4", + "\xC1\xD5" => "\xEC\xA3\xB5", + "\xC1\xD6" => "\xEC\xA3\xBC", + "\xC1\xD7" => "\xEC\xA3\xBD", + "\xC1\xD8" => "\xEC\xA4\x80", + "\xC1\xD9" => "\xEC\xA4\x84", + "\xC1\xDA" => "\xEC\xA4\x85", + "\xC1\xDB" => "\xEC\xA4\x86", + "\xC1\xDC" => "\xEC\xA4\x8C", + "\xC1\xDD" => "\xEC\xA4\x8D", + "\xC1\xDE" => "\xEC\xA4\x8F", + "\xC1\xDF" => "\xEC\xA4\x91", + "\xC1\xE0" => "\xEC\xA4\x98", + "\xC1\xE1" => "\xEC\xA4\xAC", + "\xC1\xE2" => "\xEC\xA4\xB4", + "\xC1\xE3" => "\xEC\xA5\x90", + "\xC1\xE4" => "\xEC\xA5\x91", + "\xC1\xE5" => "\xEC\xA5\x94", + "\xC1\xE6" => "\xEC\xA5\x98", + "\xC1\xE7" => "\xEC\xA5\xA0", + "\xC1\xE8" => "\xEC\xA5\xA1", + "\xC1\xE9" => "\xEC\xA5\xA3", + "\xC1\xEA" => "\xEC\xA5\xAC", + "\xC1\xEB" => "\xEC\xA5\xB0", + "\xC1\xEC" => "\xEC\xA5\xB4", + "\xC1\xED" => "\xEC\xA5\xBC", + "\xC1\xEE" => "\xEC\xA6\x88", + "\xC1\xEF" => "\xEC\xA6\x89", + "\xC1\xF0" => "\xEC\xA6\x8C", + "\xC1\xF1" => "\xEC\xA6\x90", + "\xC1\xF2" => "\xEC\xA6\x98", + "\xC1\xF3" => "\xEC\xA6\x99", + "\xC1\xF4" => "\xEC\xA6\x9B", + "\xC1\xF5" => "\xEC\xA6\x9D", + "\xC1\xF6" => "\xEC\xA7\x80", + "\xC1\xF7" => "\xEC\xA7\x81", + "\xC1\xF8" => "\xEC\xA7\x84", + "\xC1\xF9" => "\xEC\xA7\x87", + "\xC1\xFA" => "\xEC\xA7\x88", + "\xC1\xFB" => "\xEC\xA7\x8A", + "\xC1\xFC" => "\xEC\xA7\x90", + "\xC1\xFD" => "\xEC\xA7\x91", + "\xC1\xFE" => "\xEC\xA7\x93", + "\xC2\x41" => "\xED\x97\x8A", + "\xC2\x42" => "\xED\x97\x8B", + "\xC2\x43" => "\xED\x97\x8D", + "\xC2\x44" => "\xED\x97\x8E", + "\xC2\x45" => "\xED\x97\x8F", + "\xC2\x46" => "\xED\x97\x91", + "\xC2\x47" => "\xED\x97\x93", + "\xC2\x48" => "\xED\x97\x94", + "\xC2\x49" => "\xED\x97\x95", + "\xC2\x4A" => "\xED\x97\x96", + "\xC2\x4B" => "\xED\x97\x97", + "\xC2\x4C" => "\xED\x97\x9A", + "\xC2\x4D" => "\xED\x97\x9C", + "\xC2\x4E" => "\xED\x97\x9E", + "\xC2\x4F" => "\xED\x97\x9F", + "\xC2\x50" => "\xED\x97\xA0", + "\xC2\x51" => "\xED\x97\xA1", + "\xC2\x52" => "\xED\x97\xA2", + "\xC2\x53" => "\xED\x97\xA3", + "\xC2\x54" => "\xED\x97\xA6", + "\xC2\x55" => "\xED\x97\xA7", + "\xC2\x56" => "\xED\x97\xA9", + "\xC2\x57" => "\xED\x97\xAA", + "\xC2\x58" => "\xED\x97\xAB", + "\xC2\x59" => "\xED\x97\xAD", + "\xC2\x5A" => "\xED\x97\xAE", + "\xC2\x61" => "\xED\x97\xAF", + "\xC2\x62" => "\xED\x97\xB0", + "\xC2\x63" => "\xED\x97\xB1", + "\xC2\x64" => "\xED\x97\xB2", + "\xC2\x65" => "\xED\x97\xB3", + "\xC2\x66" => "\xED\x97\xB6", + "\xC2\x67" => "\xED\x97\xB8", + "\xC2\x68" => "\xED\x97\xBA", + "\xC2\x69" => "\xED\x97\xBB", + "\xC2\x6A" => "\xED\x97\xBC", + "\xC2\x6B" => "\xED\x97\xBD", + "\xC2\x6C" => "\xED\x97\xBE", + "\xC2\x6D" => "\xED\x97\xBF", + "\xC2\x6E" => "\xED\x98\x82", + "\xC2\x6F" => "\xED\x98\x83", + "\xC2\x70" => "\xED\x98\x85", + "\xC2\x71" => "\xED\x98\x86", + "\xC2\x72" => "\xED\x98\x87", + "\xC2\x73" => "\xED\x98\x89", + "\xC2\x74" => "\xED\x98\x8A", + "\xC2\x75" => "\xED\x98\x8B", + "\xC2\x76" => "\xED\x98\x8C", + "\xC2\x77" => "\xED\x98\x8D", + "\xC2\x78" => "\xED\x98\x8E", + "\xC2\x79" => "\xED\x98\x8F", + "\xC2\x7A" => "\xED\x98\x92", + "\xC2\x81" => "\xED\x98\x96", + "\xC2\x82" => "\xED\x98\x97", + "\xC2\x83" => "\xED\x98\x98", + "\xC2\x84" => "\xED\x98\x99", + "\xC2\x85" => "\xED\x98\x9A", + "\xC2\x86" => "\xED\x98\x9B", + "\xC2\x87" => "\xED\x98\x9D", + "\xC2\x88" => "\xED\x98\x9E", + "\xC2\x89" => "\xED\x98\x9F", + "\xC2\x8A" => "\xED\x98\xA1", + "\xC2\x8B" => "\xED\x98\xA2", + "\xC2\x8C" => "\xED\x98\xA3", + "\xC2\x8D" => "\xED\x98\xA5", + "\xC2\x8E" => "\xED\x98\xA6", + "\xC2\x8F" => "\xED\x98\xA7", + "\xC2\x90" => "\xED\x98\xA8", + "\xC2\x91" => "\xED\x98\xA9", + "\xC2\x92" => "\xED\x98\xAA", + "\xC2\x93" => "\xED\x98\xAB", + "\xC2\x94" => "\xED\x98\xAC", + "\xC2\x95" => "\xED\x98\xAE", + "\xC2\x96" => "\xED\x98\xAF", + "\xC2\x97" => "\xED\x98\xB0", + "\xC2\x98" => "\xED\x98\xB1", + "\xC2\x99" => "\xED\x98\xB2", + "\xC2\x9A" => "\xED\x98\xB3", + "\xC2\x9B" => "\xED\x98\xB4", + "\xC2\x9C" => "\xED\x98\xB5", + "\xC2\x9D" => "\xED\x98\xB6", + "\xC2\x9E" => "\xED\x98\xB7", + "\xC2\x9F" => "\xED\x98\xBA", + "\xC2\xA0" => "\xED\x98\xBB", + "\xC2\xA1" => "\xEC\xA7\x95", + "\xC2\xA2" => "\xEC\xA7\x96", + "\xC2\xA3" => "\xEC\xA7\x99", + "\xC2\xA4" => "\xEC\xA7\x9A", + "\xC2\xA5" => "\xEC\xA7\x9C", + "\xC2\xA6" => "\xEC\xA7\x9D", + "\xC2\xA7" => "\xEC\xA7\xA0", + "\xC2\xA8" => "\xEC\xA7\xA2", + "\xC2\xA9" => "\xEC\xA7\xA4", + "\xC2\xAA" => "\xEC\xA7\xA7", + "\xC2\xAB" => "\xEC\xA7\xAC", + "\xC2\xAC" => "\xEC\xA7\xAD", + "\xC2\xAD" => "\xEC\xA7\xAF", + "\xC2\xAE" => "\xEC\xA7\xB0", + "\xC2\xAF" => "\xEC\xA7\xB1", + "\xC2\xB0" => "\xEC\xA7\xB8", + "\xC2\xB1" => "\xEC\xA7\xB9", + "\xC2\xB2" => "\xEC\xA7\xBC", + "\xC2\xB3" => "\xEC\xA8\x80", + "\xC2\xB4" => "\xEC\xA8\x88", + "\xC2\xB5" => "\xEC\xA8\x89", + "\xC2\xB6" => "\xEC\xA8\x8B", + "\xC2\xB7" => "\xEC\xA8\x8C", + "\xC2\xB8" => "\xEC\xA8\x8D", + "\xC2\xB9" => "\xEC\xA8\x94", + "\xC2\xBA" => "\xEC\xA8\x98", + "\xC2\xBB" => "\xEC\xA8\xA9", + "\xC2\xBC" => "\xEC\xA9\x8C", + "\xC2\xBD" => "\xEC\xA9\x8D", + "\xC2\xBE" => "\xEC\xA9\x90", + "\xC2\xBF" => "\xEC\xA9\x94", + "\xC2\xC0" => "\xEC\xA9\x9C", + "\xC2\xC1" => "\xEC\xA9\x9D", + "\xC2\xC2" => "\xEC\xA9\x9F", + "\xC2\xC3" => "\xEC\xA9\xA0", + "\xC2\xC4" => "\xEC\xA9\xA1", + "\xC2\xC5" => "\xEC\xA9\xA8", + "\xC2\xC6" => "\xEC\xA9\xBD", + "\xC2\xC7" => "\xEC\xAA\x84", + "\xC2\xC8" => "\xEC\xAA\x98", + "\xC2\xC9" => "\xEC\xAA\xBC", + "\xC2\xCA" => "\xEC\xAA\xBD", + "\xC2\xCB" => "\xEC\xAB\x80", + "\xC2\xCC" => "\xEC\xAB\x84", + "\xC2\xCD" => "\xEC\xAB\x8C", + "\xC2\xCE" => "\xEC\xAB\x8D", + "\xC2\xCF" => "\xEC\xAB\x8F", + "\xC2\xD0" => "\xEC\xAB\x91", + "\xC2\xD1" => "\xEC\xAB\x93", + "\xC2\xD2" => "\xEC\xAB\x98", + "\xC2\xD3" => "\xEC\xAB\x99", + "\xC2\xD4" => "\xEC\xAB\xA0", + "\xC2\xD5" => "\xEC\xAB\xAC", + "\xC2\xD6" => "\xEC\xAB\xB4", + "\xC2\xD7" => "\xEC\xAC\x88", + "\xC2\xD8" => "\xEC\xAC\x90", + "\xC2\xD9" => "\xEC\xAC\x94", + "\xC2\xDA" => "\xEC\xAC\x98", + "\xC2\xDB" => "\xEC\xAC\xA0", + "\xC2\xDC" => "\xEC\xAC\xA1", + "\xC2\xDD" => "\xEC\xAD\x81", + "\xC2\xDE" => "\xEC\xAD\x88", + "\xC2\xDF" => "\xEC\xAD\x89", + "\xC2\xE0" => "\xEC\xAD\x8C", + "\xC2\xE1" => "\xEC\xAD\x90", + "\xC2\xE2" => "\xEC\xAD\x98", + "\xC2\xE3" => "\xEC\xAD\x99", + "\xC2\xE4" => "\xEC\xAD\x9D", + "\xC2\xE5" => "\xEC\xAD\xA4", + "\xC2\xE6" => "\xEC\xAD\xB8", + "\xC2\xE7" => "\xEC\xAD\xB9", + "\xC2\xE8" => "\xEC\xAE\x9C", + "\xC2\xE9" => "\xEC\xAE\xB8", + "\xC2\xEA" => "\xEC\xAF\x94", + "\xC2\xEB" => "\xEC\xAF\xA4", + "\xC2\xEC" => "\xEC\xAF\xA7", + "\xC2\xED" => "\xEC\xAF\xA9", + "\xC2\xEE" => "\xEC\xB0\x8C", + "\xC2\xEF" => "\xEC\xB0\x8D", + "\xC2\xF0" => "\xEC\xB0\x90", + "\xC2\xF1" => "\xEC\xB0\x94", + "\xC2\xF2" => "\xEC\xB0\x9C", + "\xC2\xF3" => "\xEC\xB0\x9D", + "\xC2\xF4" => "\xEC\xB0\xA1", + "\xC2\xF5" => "\xEC\xB0\xA2", + "\xC2\xF6" => "\xEC\xB0\xA7", + "\xC2\xF7" => "\xEC\xB0\xA8", + "\xC2\xF8" => "\xEC\xB0\xA9", + "\xC2\xF9" => "\xEC\xB0\xAC", + "\xC2\xFA" => "\xEC\xB0\xAE", + "\xC2\xFB" => "\xEC\xB0\xB0", + "\xC2\xFC" => "\xEC\xB0\xB8", + "\xC2\xFD" => "\xEC\xB0\xB9", + "\xC2\xFE" => "\xEC\xB0\xBB", + "\xC3\x41" => "\xED\x98\xBD", + "\xC3\x42" => "\xED\x98\xBE", + "\xC3\x43" => "\xED\x98\xBF", + "\xC3\x44" => "\xED\x99\x81", + "\xC3\x45" => "\xED\x99\x82", + "\xC3\x46" => "\xED\x99\x83", + "\xC3\x47" => "\xED\x99\x84", + "\xC3\x48" => "\xED\x99\x86", + "\xC3\x49" => "\xED\x99\x87", + "\xC3\x4A" => "\xED\x99\x8A", + "\xC3\x4B" => "\xED\x99\x8C", + "\xC3\x4C" => "\xED\x99\x8E", + "\xC3\x4D" => "\xED\x99\x8F", + "\xC3\x4E" => "\xED\x99\x90", + "\xC3\x4F" => "\xED\x99\x92", + "\xC3\x50" => "\xED\x99\x93", + "\xC3\x51" => "\xED\x99\x96", + "\xC3\x52" => "\xED\x99\x97", + "\xC3\x53" => "\xED\x99\x99", + "\xC3\x54" => "\xED\x99\x9A", + "\xC3\x55" => "\xED\x99\x9B", + "\xC3\x56" => "\xED\x99\x9D", + "\xC3\x57" => "\xED\x99\x9E", + "\xC3\x58" => "\xED\x99\x9F", + "\xC3\x59" => "\xED\x99\xA0", + "\xC3\x5A" => "\xED\x99\xA1", + "\xC3\x61" => "\xED\x99\xA2", + "\xC3\x62" => "\xED\x99\xA3", + "\xC3\x63" => "\xED\x99\xA4", + "\xC3\x64" => "\xED\x99\xA5", + "\xC3\x65" => "\xED\x99\xA6", + "\xC3\x66" => "\xED\x99\xA8", + "\xC3\x67" => "\xED\x99\xAA", + "\xC3\x68" => "\xED\x99\xAB", + "\xC3\x69" => "\xED\x99\xAC", + "\xC3\x6A" => "\xED\x99\xAD", + "\xC3\x6B" => "\xED\x99\xAE", + "\xC3\x6C" => "\xED\x99\xAF", + "\xC3\x6D" => "\xED\x99\xB2", + "\xC3\x6E" => "\xED\x99\xB3", + "\xC3\x6F" => "\xED\x99\xB5", + "\xC3\x70" => "\xED\x99\xB6", + "\xC3\x71" => "\xED\x99\xB7", + "\xC3\x72" => "\xED\x99\xB8", + "\xC3\x73" => "\xED\x99\xB9", + "\xC3\x74" => "\xED\x99\xBA", + "\xC3\x75" => "\xED\x99\xBB", + "\xC3\x76" => "\xED\x99\xBC", + "\xC3\x77" => "\xED\x99\xBD", + "\xC3\x78" => "\xED\x99\xBE", + "\xC3\x79" => "\xED\x99\xBF", + "\xC3\x7A" => "\xED\x9A\x80", + "\xC3\x81" => "\xED\x9A\x81", + "\xC3\x82" => "\xED\x9A\x82", + "\xC3\x83" => "\xED\x9A\x84", + "\xC3\x84" => "\xED\x9A\x86", + "\xC3\x85" => "\xED\x9A\x87", + "\xC3\x86" => "\xED\x9A\x88", + "\xC3\x87" => "\xED\x9A\x89", + "\xC3\x88" => "\xED\x9A\x8A", + "\xC3\x89" => "\xED\x9A\x8B", + "\xC3\x8A" => "\xED\x9A\x8E", + "\xC3\x8B" => "\xED\x9A\x8F", + "\xC3\x8C" => "\xED\x9A\x91", + "\xC3\x8D" => "\xED\x9A\x92", + "\xC3\x8E" => "\xED\x9A\x93", + "\xC3\x8F" => "\xED\x9A\x95", + "\xC3\x90" => "\xED\x9A\x96", + "\xC3\x91" => "\xED\x9A\x97", + "\xC3\x92" => "\xED\x9A\x98", + "\xC3\x93" => "\xED\x9A\x99", + "\xC3\x94" => "\xED\x9A\x9A", + "\xC3\x95" => "\xED\x9A\x9B", + "\xC3\x96" => "\xED\x9A\x9C", + "\xC3\x97" => "\xED\x9A\x9E", + "\xC3\x98" => "\xED\x9A\xA0", + "\xC3\x99" => "\xED\x9A\xA2", + "\xC3\x9A" => "\xED\x9A\xA3", + "\xC3\x9B" => "\xED\x9A\xA4", + "\xC3\x9C" => "\xED\x9A\xA5", + "\xC3\x9D" => "\xED\x9A\xA6", + "\xC3\x9E" => "\xED\x9A\xA7", + "\xC3\x9F" => "\xED\x9A\xA9", + "\xC3\xA0" => "\xED\x9A\xAA", + "\xC3\xA1" => "\xEC\xB0\xBC", + "\xC3\xA2" => "\xEC\xB0\xBD", + "\xC3\xA3" => "\xEC\xB0\xBE", + "\xC3\xA4" => "\xEC\xB1\x84", + "\xC3\xA5" => "\xEC\xB1\x85", + "\xC3\xA6" => "\xEC\xB1\x88", + "\xC3\xA7" => "\xEC\xB1\x8C", + "\xC3\xA8" => "\xEC\xB1\x94", + "\xC3\xA9" => "\xEC\xB1\x95", + "\xC3\xAA" => "\xEC\xB1\x97", + "\xC3\xAB" => "\xEC\xB1\x98", + "\xC3\xAC" => "\xEC\xB1\x99", + "\xC3\xAD" => "\xEC\xB1\xA0", + "\xC3\xAE" => "\xEC\xB1\xA4", + "\xC3\xAF" => "\xEC\xB1\xA6", + "\xC3\xB0" => "\xEC\xB1\xA8", + "\xC3\xB1" => "\xEC\xB1\xB0", + "\xC3\xB2" => "\xEC\xB1\xB5", + "\xC3\xB3" => "\xEC\xB2\x98", + "\xC3\xB4" => "\xEC\xB2\x99", + "\xC3\xB5" => "\xEC\xB2\x9C", + "\xC3\xB6" => "\xEC\xB2\xA0", + "\xC3\xB7" => "\xEC\xB2\xA8", + "\xC3\xB8" => "\xEC\xB2\xA9", + "\xC3\xB9" => "\xEC\xB2\xAB", + "\xC3\xBA" => "\xEC\xB2\xAC", + "\xC3\xBB" => "\xEC\xB2\xAD", + "\xC3\xBC" => "\xEC\xB2\xB4", + "\xC3\xBD" => "\xEC\xB2\xB5", + "\xC3\xBE" => "\xEC\xB2\xB8", + "\xC3\xBF" => "\xEC\xB2\xBC", + "\xC3\xC0" => "\xEC\xB3\x84", + "\xC3\xC1" => "\xEC\xB3\x85", + "\xC3\xC2" => "\xEC\xB3\x87", + "\xC3\xC3" => "\xEC\xB3\x89", + "\xC3\xC4" => "\xEC\xB3\x90", + "\xC3\xC5" => "\xEC\xB3\x94", + "\xC3\xC6" => "\xEC\xB3\xA4", + "\xC3\xC7" => "\xEC\xB3\xAC", + "\xC3\xC8" => "\xEC\xB3\xB0", + "\xC3\xC9" => "\xEC\xB4\x81", + "\xC3\xCA" => "\xEC\xB4\x88", + "\xC3\xCB" => "\xEC\xB4\x89", + "\xC3\xCC" => "\xEC\xB4\x8C", + "\xC3\xCD" => "\xEC\xB4\x90", + "\xC3\xCE" => "\xEC\xB4\x98", + "\xC3\xCF" => "\xEC\xB4\x99", + "\xC3\xD0" => "\xEC\xB4\x9B", + "\xC3\xD1" => "\xEC\xB4\x9D", + "\xC3\xD2" => "\xEC\xB4\xA4", + "\xC3\xD3" => "\xEC\xB4\xA8", + "\xC3\xD4" => "\xEC\xB4\xAC", + "\xC3\xD5" => "\xEC\xB4\xB9", + "\xC3\xD6" => "\xEC\xB5\x9C", + "\xC3\xD7" => "\xEC\xB5\xA0", + "\xC3\xD8" => "\xEC\xB5\xA4", + "\xC3\xD9" => "\xEC\xB5\xAC", + "\xC3\xDA" => "\xEC\xB5\xAD", + "\xC3\xDB" => "\xEC\xB5\xAF", + "\xC3\xDC" => "\xEC\xB5\xB1", + "\xC3\xDD" => "\xEC\xB5\xB8", + "\xC3\xDE" => "\xEC\xB6\x88", + "\xC3\xDF" => "\xEC\xB6\x94", + "\xC3\xE0" => "\xEC\xB6\x95", + "\xC3\xE1" => "\xEC\xB6\x98", + "\xC3\xE2" => "\xEC\xB6\x9C", + "\xC3\xE3" => "\xEC\xB6\xA4", + "\xC3\xE4" => "\xEC\xB6\xA5", + "\xC3\xE5" => "\xEC\xB6\xA7", + "\xC3\xE6" => "\xEC\xB6\xA9", + "\xC3\xE7" => "\xEC\xB6\xB0", + "\xC3\xE8" => "\xEC\xB7\x84", + "\xC3\xE9" => "\xEC\xB7\x8C", + "\xC3\xEA" => "\xEC\xB7\x90", + "\xC3\xEB" => "\xEC\xB7\xA8", + "\xC3\xEC" => "\xEC\xB7\xAC", + "\xC3\xED" => "\xEC\xB7\xB0", + "\xC3\xEE" => "\xEC\xB7\xB8", + "\xC3\xEF" => "\xEC\xB7\xB9", + "\xC3\xF0" => "\xEC\xB7\xBB", + "\xC3\xF1" => "\xEC\xB7\xBD", + "\xC3\xF2" => "\xEC\xB8\x84", + "\xC3\xF3" => "\xEC\xB8\x88", + "\xC3\xF4" => "\xEC\xB8\x8C", + "\xC3\xF5" => "\xEC\xB8\x94", + "\xC3\xF6" => "\xEC\xB8\x99", + "\xC3\xF7" => "\xEC\xB8\xA0", + "\xC3\xF8" => "\xEC\xB8\xA1", + "\xC3\xF9" => "\xEC\xB8\xA4", + "\xC3\xFA" => "\xEC\xB8\xA8", + "\xC3\xFB" => "\xEC\xB8\xB0", + "\xC3\xFC" => "\xEC\xB8\xB1", + "\xC3\xFD" => "\xEC\xB8\xB3", + "\xC3\xFE" => "\xEC\xB8\xB5", + "\xC4\x41" => "\xED\x9A\xAB", + "\xC4\x42" => "\xED\x9A\xAD", + "\xC4\x43" => "\xED\x9A\xAE", + "\xC4\x44" => "\xED\x9A\xAF", + "\xC4\x45" => "\xED\x9A\xB1", + "\xC4\x46" => "\xED\x9A\xB2", + "\xC4\x47" => "\xED\x9A\xB3", + "\xC4\x48" => "\xED\x9A\xB4", + "\xC4\x49" => "\xED\x9A\xB5", + "\xC4\x4A" => "\xED\x9A\xB6", + "\xC4\x4B" => "\xED\x9A\xB7", + "\xC4\x4C" => "\xED\x9A\xB8", + "\xC4\x4D" => "\xED\x9A\xBA", + "\xC4\x4E" => "\xED\x9A\xBC", + "\xC4\x4F" => "\xED\x9A\xBD", + "\xC4\x50" => "\xED\x9A\xBE", + "\xC4\x51" => "\xED\x9A\xBF", + "\xC4\x52" => "\xED\x9B\x80", + "\xC4\x53" => "\xED\x9B\x81", + "\xC4\x54" => "\xED\x9B\x82", + "\xC4\x55" => "\xED\x9B\x83", + "\xC4\x56" => "\xED\x9B\x86", + "\xC4\x57" => "\xED\x9B\x87", + "\xC4\x58" => "\xED\x9B\x89", + "\xC4\x59" => "\xED\x9B\x8A", + "\xC4\x5A" => "\xED\x9B\x8B", + "\xC4\x61" => "\xED\x9B\x8D", + "\xC4\x62" => "\xED\x9B\x8E", + "\xC4\x63" => "\xED\x9B\x8F", + "\xC4\x64" => "\xED\x9B\x90", + "\xC4\x65" => "\xED\x9B\x92", + "\xC4\x66" => "\xED\x9B\x93", + "\xC4\x67" => "\xED\x9B\x95", + "\xC4\x68" => "\xED\x9B\x96", + "\xC4\x69" => "\xED\x9B\x98", + "\xC4\x6A" => "\xED\x9B\x9A", + "\xC4\x6B" => "\xED\x9B\x9B", + "\xC4\x6C" => "\xED\x9B\x9C", + "\xC4\x6D" => "\xED\x9B\x9D", + "\xC4\x6E" => "\xED\x9B\x9E", + "\xC4\x6F" => "\xED\x9B\x9F", + "\xC4\x70" => "\xED\x9B\xA1", + "\xC4\x71" => "\xED\x9B\xA2", + "\xC4\x72" => "\xED\x9B\xA3", + "\xC4\x73" => "\xED\x9B\xA5", + "\xC4\x74" => "\xED\x9B\xA6", + "\xC4\x75" => "\xED\x9B\xA7", + "\xC4\x76" => "\xED\x9B\xA9", + "\xC4\x77" => "\xED\x9B\xAA", + "\xC4\x78" => "\xED\x9B\xAB", + "\xC4\x79" => "\xED\x9B\xAC", + "\xC4\x7A" => "\xED\x9B\xAD", + "\xC4\x81" => "\xED\x9B\xAE", + "\xC4\x82" => "\xED\x9B\xAF", + "\xC4\x83" => "\xED\x9B\xB1", + "\xC4\x84" => "\xED\x9B\xB2", + "\xC4\x85" => "\xED\x9B\xB3", + "\xC4\x86" => "\xED\x9B\xB4", + "\xC4\x87" => "\xED\x9B\xB6", + "\xC4\x88" => "\xED\x9B\xB7", + "\xC4\x89" => "\xED\x9B\xB8", + "\xC4\x8A" => "\xED\x9B\xB9", + "\xC4\x8B" => "\xED\x9B\xBA", + "\xC4\x8C" => "\xED\x9B\xBB", + "\xC4\x8D" => "\xED\x9B\xBE", + "\xC4\x8E" => "\xED\x9B\xBF", + "\xC4\x8F" => "\xED\x9C\x81", + "\xC4\x90" => "\xED\x9C\x82", + "\xC4\x91" => "\xED\x9C\x83", + "\xC4\x92" => "\xED\x9C\x85", + "\xC4\x93" => "\xED\x9C\x86", + "\xC4\x94" => "\xED\x9C\x87", + "\xC4\x95" => "\xED\x9C\x88", + "\xC4\x96" => "\xED\x9C\x89", + "\xC4\x97" => "\xED\x9C\x8A", + "\xC4\x98" => "\xED\x9C\x8B", + "\xC4\x99" => "\xED\x9C\x8C", + "\xC4\x9A" => "\xED\x9C\x8D", + "\xC4\x9B" => "\xED\x9C\x8E", + "\xC4\x9C" => "\xED\x9C\x8F", + "\xC4\x9D" => "\xED\x9C\x90", + "\xC4\x9E" => "\xED\x9C\x92", + "\xC4\x9F" => "\xED\x9C\x93", + "\xC4\xA0" => "\xED\x9C\x94", + "\xC4\xA1" => "\xEC\xB9\x98", + "\xC4\xA2" => "\xEC\xB9\x99", + "\xC4\xA3" => "\xEC\xB9\x9C", + "\xC4\xA4" => "\xEC\xB9\x9F", + "\xC4\xA5" => "\xEC\xB9\xA0", + "\xC4\xA6" => "\xEC\xB9\xA1", + "\xC4\xA7" => "\xEC\xB9\xA8", + "\xC4\xA8" => "\xEC\xB9\xA9", + "\xC4\xA9" => "\xEC\xB9\xAB", + "\xC4\xAA" => "\xEC\xB9\xAD", + "\xC4\xAB" => "\xEC\xB9\xB4", + "\xC4\xAC" => "\xEC\xB9\xB5", + "\xC4\xAD" => "\xEC\xB9\xB8", + "\xC4\xAE" => "\xEC\xB9\xBC", + "\xC4\xAF" => "\xEC\xBA\x84", + "\xC4\xB0" => "\xEC\xBA\x85", + "\xC4\xB1" => "\xEC\xBA\x87", + "\xC4\xB2" => "\xEC\xBA\x89", + "\xC4\xB3" => "\xEC\xBA\x90", + "\xC4\xB4" => "\xEC\xBA\x91", + "\xC4\xB5" => "\xEC\xBA\x94", + "\xC4\xB6" => "\xEC\xBA\x98", + "\xC4\xB7" => "\xEC\xBA\xA0", + "\xC4\xB8" => "\xEC\xBA\xA1", + "\xC4\xB9" => "\xEC\xBA\xA3", + "\xC4\xBA" => "\xEC\xBA\xA4", + "\xC4\xBB" => "\xEC\xBA\xA5", + "\xC4\xBC" => "\xEC\xBA\xAC", + "\xC4\xBD" => "\xEC\xBA\xAD", + "\xC4\xBE" => "\xEC\xBB\x81", + "\xC4\xBF" => "\xEC\xBB\xA4", + "\xC4\xC0" => "\xEC\xBB\xA5", + "\xC4\xC1" => "\xEC\xBB\xA8", + "\xC4\xC2" => "\xEC\xBB\xAB", + "\xC4\xC3" => "\xEC\xBB\xAC", + "\xC4\xC4" => "\xEC\xBB\xB4", + "\xC4\xC5" => "\xEC\xBB\xB5", + "\xC4\xC6" => "\xEC\xBB\xB7", + "\xC4\xC7" => "\xEC\xBB\xB8", + "\xC4\xC8" => "\xEC\xBB\xB9", + "\xC4\xC9" => "\xEC\xBC\x80", + "\xC4\xCA" => "\xEC\xBC\x81", + "\xC4\xCB" => "\xEC\xBC\x84", + "\xC4\xCC" => "\xEC\xBC\x88", + "\xC4\xCD" => "\xEC\xBC\x90", + "\xC4\xCE" => "\xEC\xBC\x91", + "\xC4\xCF" => "\xEC\xBC\x93", + "\xC4\xD0" => "\xEC\xBC\x95", + "\xC4\xD1" => "\xEC\xBC\x9C", + "\xC4\xD2" => "\xEC\xBC\xA0", + "\xC4\xD3" => "\xEC\xBC\xA4", + "\xC4\xD4" => "\xEC\xBC\xAC", + "\xC4\xD5" => "\xEC\xBC\xAD", + "\xC4\xD6" => "\xEC\xBC\xAF", + "\xC4\xD7" => "\xEC\xBC\xB0", + "\xC4\xD8" => "\xEC\xBC\xB1", + "\xC4\xD9" => "\xEC\xBC\xB8", + "\xC4\xDA" => "\xEC\xBD\x94", + "\xC4\xDB" => "\xEC\xBD\x95", + "\xC4\xDC" => "\xEC\xBD\x98", + "\xC4\xDD" => "\xEC\xBD\x9C", + "\xC4\xDE" => "\xEC\xBD\xA4", + "\xC4\xDF" => "\xEC\xBD\xA5", + "\xC4\xE0" => "\xEC\xBD\xA7", + "\xC4\xE1" => "\xEC\xBD\xA9", + "\xC4\xE2" => "\xEC\xBD\xB0", + "\xC4\xE3" => "\xEC\xBD\xB1", + "\xC4\xE4" => "\xEC\xBD\xB4", + "\xC4\xE5" => "\xEC\xBD\xB8", + "\xC4\xE6" => "\xEC\xBE\x80", + "\xC4\xE7" => "\xEC\xBE\x85", + "\xC4\xE8" => "\xEC\xBE\x8C", + "\xC4\xE9" => "\xEC\xBE\xA1", + "\xC4\xEA" => "\xEC\xBE\xA8", + "\xC4\xEB" => "\xEC\xBE\xB0", + "\xC4\xEC" => "\xEC\xBF\x84", + "\xC4\xED" => "\xEC\xBF\xA0", + "\xC4\xEE" => "\xEC\xBF\xA1", + "\xC4\xEF" => "\xEC\xBF\xA4", + "\xC4\xF0" => "\xEC\xBF\xA8", + "\xC4\xF1" => "\xEC\xBF\xB0", + "\xC4\xF2" => "\xEC\xBF\xB1", + "\xC4\xF3" => "\xEC\xBF\xB3", + "\xC4\xF4" => "\xEC\xBF\xB5", + "\xC4\xF5" => "\xEC\xBF\xBC", + "\xC4\xF6" => "\xED\x80\x80", + "\xC4\xF7" => "\xED\x80\x84", + "\xC4\xF8" => "\xED\x80\x91", + "\xC4\xF9" => "\xED\x80\x98", + "\xC4\xFA" => "\xED\x80\xAD", + "\xC4\xFB" => "\xED\x80\xB4", + "\xC4\xFC" => "\xED\x80\xB5", + "\xC4\xFD" => "\xED\x80\xB8", + "\xC4\xFE" => "\xED\x80\xBC", + "\xC5\x41" => "\xED\x9C\x95", + "\xC5\x42" => "\xED\x9C\x96", + "\xC5\x43" => "\xED\x9C\x97", + "\xC5\x44" => "\xED\x9C\x9A", + "\xC5\x45" => "\xED\x9C\x9B", + "\xC5\x46" => "\xED\x9C\x9D", + "\xC5\x47" => "\xED\x9C\x9E", + "\xC5\x48" => "\xED\x9C\x9F", + "\xC5\x49" => "\xED\x9C\xA1", + "\xC5\x4A" => "\xED\x9C\xA2", + "\xC5\x4B" => "\xED\x9C\xA3", + "\xC5\x4C" => "\xED\x9C\xA4", + "\xC5\x4D" => "\xED\x9C\xA5", + "\xC5\x4E" => "\xED\x9C\xA6", + "\xC5\x4F" => "\xED\x9C\xA7", + "\xC5\x50" => "\xED\x9C\xAA", + "\xC5\x51" => "\xED\x9C\xAC", + "\xC5\x52" => "\xED\x9C\xAE", + "\xC5\x53" => "\xED\x9C\xAF", + "\xC5\x54" => "\xED\x9C\xB0", + "\xC5\x55" => "\xED\x9C\xB1", + "\xC5\x56" => "\xED\x9C\xB2", + "\xC5\x57" => "\xED\x9C\xB3", + "\xC5\x58" => "\xED\x9C\xB6", + "\xC5\x59" => "\xED\x9C\xB7", + "\xC5\x5A" => "\xED\x9C\xB9", + "\xC5\x61" => "\xED\x9C\xBA", + "\xC5\x62" => "\xED\x9C\xBB", + "\xC5\x63" => "\xED\x9C\xBD", + "\xC5\x64" => "\xED\x9C\xBE", + "\xC5\x65" => "\xED\x9C\xBF", + "\xC5\x66" => "\xED\x9D\x80", + "\xC5\x67" => "\xED\x9D\x81", + "\xC5\x68" => "\xED\x9D\x82", + "\xC5\x69" => "\xED\x9D\x83", + "\xC5\x6A" => "\xED\x9D\x85", + "\xC5\x6B" => "\xED\x9D\x86", + "\xC5\x6C" => "\xED\x9D\x88", + "\xC5\x6D" => "\xED\x9D\x8A", + "\xC5\x6E" => "\xED\x9D\x8B", + "\xC5\x6F" => "\xED\x9D\x8C", + "\xC5\x70" => "\xED\x9D\x8D", + "\xC5\x71" => "\xED\x9D\x8E", + "\xC5\x72" => "\xED\x9D\x8F", + "\xC5\x73" => "\xED\x9D\x92", + "\xC5\x74" => "\xED\x9D\x93", + "\xC5\x75" => "\xED\x9D\x95", + "\xC5\x76" => "\xED\x9D\x9A", + "\xC5\x77" => "\xED\x9D\x9B", + "\xC5\x78" => "\xED\x9D\x9C", + "\xC5\x79" => "\xED\x9D\x9D", + "\xC5\x7A" => "\xED\x9D\x9E", + "\xC5\x81" => "\xED\x9D\x9F", + "\xC5\x82" => "\xED\x9D\xA2", + "\xC5\x83" => "\xED\x9D\xA4", + "\xC5\x84" => "\xED\x9D\xA6", + "\xC5\x85" => "\xED\x9D\xA7", + "\xC5\x86" => "\xED\x9D\xA8", + "\xC5\x87" => "\xED\x9D\xAA", + "\xC5\x88" => "\xED\x9D\xAB", + "\xC5\x89" => "\xED\x9D\xAD", + "\xC5\x8A" => "\xED\x9D\xAE", + "\xC5\x8B" => "\xED\x9D\xAF", + "\xC5\x8C" => "\xED\x9D\xB1", + "\xC5\x8D" => "\xED\x9D\xB2", + "\xC5\x8E" => "\xED\x9D\xB3", + "\xC5\x8F" => "\xED\x9D\xB5", + "\xC5\x90" => "\xED\x9D\xB6", + "\xC5\x91" => "\xED\x9D\xB7", + "\xC5\x92" => "\xED\x9D\xB8", + "\xC5\x93" => "\xED\x9D\xB9", + "\xC5\x94" => "\xED\x9D\xBA", + "\xC5\x95" => "\xED\x9D\xBB", + "\xC5\x96" => "\xED\x9D\xBE", + "\xC5\x97" => "\xED\x9D\xBF", + "\xC5\x98" => "\xED\x9E\x80", + "\xC5\x99" => "\xED\x9E\x82", + "\xC5\x9A" => "\xED\x9E\x83", + "\xC5\x9B" => "\xED\x9E\x84", + "\xC5\x9C" => "\xED\x9E\x85", + "\xC5\x9D" => "\xED\x9E\x86", + "\xC5\x9E" => "\xED\x9E\x87", + "\xC5\x9F" => "\xED\x9E\x8A", + "\xC5\xA0" => "\xED\x9E\x8B", + "\xC5\xA1" => "\xED\x81\x84", + "\xC5\xA2" => "\xED\x81\x85", + "\xC5\xA3" => "\xED\x81\x87", + "\xC5\xA4" => "\xED\x81\x89", + "\xC5\xA5" => "\xED\x81\x90", + "\xC5\xA6" => "\xED\x81\x94", + "\xC5\xA7" => "\xED\x81\x98", + "\xC5\xA8" => "\xED\x81\xA0", + "\xC5\xA9" => "\xED\x81\xAC", + "\xC5\xAA" => "\xED\x81\xAD", + "\xC5\xAB" => "\xED\x81\xB0", + "\xC5\xAC" => "\xED\x81\xB4", + "\xC5\xAD" => "\xED\x81\xBC", + "\xC5\xAE" => "\xED\x81\xBD", + "\xC5\xAF" => "\xED\x82\x81", + "\xC5\xB0" => "\xED\x82\xA4", + "\xC5\xB1" => "\xED\x82\xA5", + "\xC5\xB2" => "\xED\x82\xA8", + "\xC5\xB3" => "\xED\x82\xAC", + "\xC5\xB4" => "\xED\x82\xB4", + "\xC5\xB5" => "\xED\x82\xB5", + "\xC5\xB6" => "\xED\x82\xB7", + "\xC5\xB7" => "\xED\x82\xB9", + "\xC5\xB8" => "\xED\x83\x80", + "\xC5\xB9" => "\xED\x83\x81", + "\xC5\xBA" => "\xED\x83\x84", + "\xC5\xBB" => "\xED\x83\x88", + "\xC5\xBC" => "\xED\x83\x89", + "\xC5\xBD" => "\xED\x83\x90", + "\xC5\xBE" => "\xED\x83\x91", + "\xC5\xBF" => "\xED\x83\x93", + "\xC5\xC0" => "\xED\x83\x94", + "\xC5\xC1" => "\xED\x83\x95", + "\xC5\xC2" => "\xED\x83\x9C", + "\xC5\xC3" => "\xED\x83\x9D", + "\xC5\xC4" => "\xED\x83\xA0", + "\xC5\xC5" => "\xED\x83\xA4", + "\xC5\xC6" => "\xED\x83\xAC", + "\xC5\xC7" => "\xED\x83\xAD", + "\xC5\xC8" => "\xED\x83\xAF", + "\xC5\xC9" => "\xED\x83\xB0", + "\xC5\xCA" => "\xED\x83\xB1", + "\xC5\xCB" => "\xED\x83\xB8", + "\xC5\xCC" => "\xED\x84\x8D", + "\xC5\xCD" => "\xED\x84\xB0", + "\xC5\xCE" => "\xED\x84\xB1", + "\xC5\xCF" => "\xED\x84\xB4", + "\xC5\xD0" => "\xED\x84\xB8", + "\xC5\xD1" => "\xED\x84\xBA", + "\xC5\xD2" => "\xED\x85\x80", + "\xC5\xD3" => "\xED\x85\x81", + "\xC5\xD4" => "\xED\x85\x83", + "\xC5\xD5" => "\xED\x85\x84", + "\xC5\xD6" => "\xED\x85\x85", + "\xC5\xD7" => "\xED\x85\x8C", + "\xC5\xD8" => "\xED\x85\x8D", + "\xC5\xD9" => "\xED\x85\x90", + "\xC5\xDA" => "\xED\x85\x94", + "\xC5\xDB" => "\xED\x85\x9C", + "\xC5\xDC" => "\xED\x85\x9D", + "\xC5\xDD" => "\xED\x85\x9F", + "\xC5\xDE" => "\xED\x85\xA1", + "\xC5\xDF" => "\xED\x85\xA8", + "\xC5\xE0" => "\xED\x85\xAC", + "\xC5\xE1" => "\xED\x85\xBC", + "\xC5\xE2" => "\xED\x86\x84", + "\xC5\xE3" => "\xED\x86\x88", + "\xC5\xE4" => "\xED\x86\xA0", + "\xC5\xE5" => "\xED\x86\xA1", + "\xC5\xE6" => "\xED\x86\xA4", + "\xC5\xE7" => "\xED\x86\xA8", + "\xC5\xE8" => "\xED\x86\xB0", + "\xC5\xE9" => "\xED\x86\xB1", + "\xC5\xEA" => "\xED\x86\xB3", + "\xC5\xEB" => "\xED\x86\xB5", + "\xC5\xEC" => "\xED\x86\xBA", + "\xC5\xED" => "\xED\x86\xBC", + "\xC5\xEE" => "\xED\x87\x80", + "\xC5\xEF" => "\xED\x87\x98", + "\xC5\xF0" => "\xED\x87\xB4", + "\xC5\xF1" => "\xED\x87\xB8", + "\xC5\xF2" => "\xED\x88\x87", + "\xC5\xF3" => "\xED\x88\x89", + "\xC5\xF4" => "\xED\x88\x90", + "\xC5\xF5" => "\xED\x88\xAC", + "\xC5\xF6" => "\xED\x88\xAD", + "\xC5\xF7" => "\xED\x88\xB0", + "\xC5\xF8" => "\xED\x88\xB4", + "\xC5\xF9" => "\xED\x88\xBC", + "\xC5\xFA" => "\xED\x88\xBD", + "\xC5\xFB" => "\xED\x88\xBF", + "\xC5\xFC" => "\xED\x89\x81", + "\xC5\xFD" => "\xED\x89\x88", + "\xC5\xFE" => "\xED\x89\x9C", + "\xC6\x41" => "\xED\x9E\x8D", + "\xC6\x42" => "\xED\x9E\x8E", + "\xC6\x43" => "\xED\x9E\x8F", + "\xC6\x44" => "\xED\x9E\x91", + "\xC6\x45" => "\xED\x9E\x92", + "\xC6\x46" => "\xED\x9E\x93", + "\xC6\x47" => "\xED\x9E\x94", + "\xC6\x48" => "\xED\x9E\x95", + "\xC6\x49" => "\xED\x9E\x96", + "\xC6\x4A" => "\xED\x9E\x97", + "\xC6\x4B" => "\xED\x9E\x9A", + "\xC6\x4C" => "\xED\x9E\x9C", + "\xC6\x4D" => "\xED\x9E\x9E", + "\xC6\x4E" => "\xED\x9E\x9F", + "\xC6\x4F" => "\xED\x9E\xA0", + "\xC6\x50" => "\xED\x9E\xA1", + "\xC6\x51" => "\xED\x9E\xA2", + "\xC6\x52" => "\xED\x9E\xA3", + "\xC6\xA1" => "\xED\x89\xA4", + "\xC6\xA2" => "\xED\x8A\x80", + "\xC6\xA3" => "\xED\x8A\x81", + "\xC6\xA4" => "\xED\x8A\x84", + "\xC6\xA5" => "\xED\x8A\x88", + "\xC6\xA6" => "\xED\x8A\x90", + "\xC6\xA7" => "\xED\x8A\x91", + "\xC6\xA8" => "\xED\x8A\x95", + "\xC6\xA9" => "\xED\x8A\x9C", + "\xC6\xAA" => "\xED\x8A\xA0", + "\xC6\xAB" => "\xED\x8A\xA4", + "\xC6\xAC" => "\xED\x8A\xAC", + "\xC6\xAD" => "\xED\x8A\xB1", + "\xC6\xAE" => "\xED\x8A\xB8", + "\xC6\xAF" => "\xED\x8A\xB9", + "\xC6\xB0" => "\xED\x8A\xBC", + "\xC6\xB1" => "\xED\x8A\xBF", + "\xC6\xB2" => "\xED\x8B\x80", + "\xC6\xB3" => "\xED\x8B\x82", + "\xC6\xB4" => "\xED\x8B\x88", + "\xC6\xB5" => "\xED\x8B\x89", + "\xC6\xB6" => "\xED\x8B\x8B", + "\xC6\xB7" => "\xED\x8B\x94", + "\xC6\xB8" => "\xED\x8B\x98", + "\xC6\xB9" => "\xED\x8B\x9C", + "\xC6\xBA" => "\xED\x8B\xA4", + "\xC6\xBB" => "\xED\x8B\xA5", + "\xC6\xBC" => "\xED\x8B\xB0", + "\xC6\xBD" => "\xED\x8B\xB1", + "\xC6\xBE" => "\xED\x8B\xB4", + "\xC6\xBF" => "\xED\x8B\xB8", + "\xC6\xC0" => "\xED\x8C\x80", + "\xC6\xC1" => "\xED\x8C\x81", + "\xC6\xC2" => "\xED\x8C\x83", + "\xC6\xC3" => "\xED\x8C\x85", + "\xC6\xC4" => "\xED\x8C\x8C", + "\xC6\xC5" => "\xED\x8C\x8D", + "\xC6\xC6" => "\xED\x8C\x8E", + "\xC6\xC7" => "\xED\x8C\x90", + "\xC6\xC8" => "\xED\x8C\x94", + "\xC6\xC9" => "\xED\x8C\x96", + "\xC6\xCA" => "\xED\x8C\x9C", + "\xC6\xCB" => "\xED\x8C\x9D", + "\xC6\xCC" => "\xED\x8C\x9F", + "\xC6\xCD" => "\xED\x8C\xA0", + "\xC6\xCE" => "\xED\x8C\xA1", + "\xC6\xCF" => "\xED\x8C\xA5", + "\xC6\xD0" => "\xED\x8C\xA8", + "\xC6\xD1" => "\xED\x8C\xA9", + "\xC6\xD2" => "\xED\x8C\xAC", + "\xC6\xD3" => "\xED\x8C\xB0", + "\xC6\xD4" => "\xED\x8C\xB8", + "\xC6\xD5" => "\xED\x8C\xB9", + "\xC6\xD6" => "\xED\x8C\xBB", + "\xC6\xD7" => "\xED\x8C\xBC", + "\xC6\xD8" => "\xED\x8C\xBD", + "\xC6\xD9" => "\xED\x8D\x84", + "\xC6\xDA" => "\xED\x8D\x85", + "\xC6\xDB" => "\xED\x8D\xBC", + "\xC6\xDC" => "\xED\x8D\xBD", + "\xC6\xDD" => "\xED\x8E\x80", + "\xC6\xDE" => "\xED\x8E\x84", + "\xC6\xDF" => "\xED\x8E\x8C", + "\xC6\xE0" => "\xED\x8E\x8D", + "\xC6\xE1" => "\xED\x8E\x8F", + "\xC6\xE2" => "\xED\x8E\x90", + "\xC6\xE3" => "\xED\x8E\x91", + "\xC6\xE4" => "\xED\x8E\x98", + "\xC6\xE5" => "\xED\x8E\x99", + "\xC6\xE6" => "\xED\x8E\x9C", + "\xC6\xE7" => "\xED\x8E\xA0", + "\xC6\xE8" => "\xED\x8E\xA8", + "\xC6\xE9" => "\xED\x8E\xA9", + "\xC6\xEA" => "\xED\x8E\xAB", + "\xC6\xEB" => "\xED\x8E\xAD", + "\xC6\xEC" => "\xED\x8E\xB4", + "\xC6\xED" => "\xED\x8E\xB8", + "\xC6\xEE" => "\xED\x8E\xBC", + "\xC6\xEF" => "\xED\x8F\x84", + "\xC6\xF0" => "\xED\x8F\x85", + "\xC6\xF1" => "\xED\x8F\x88", + "\xC6\xF2" => "\xED\x8F\x89", + "\xC6\xF3" => "\xED\x8F\x90", + "\xC6\xF4" => "\xED\x8F\x98", + "\xC6\xF5" => "\xED\x8F\xA1", + "\xC6\xF6" => "\xED\x8F\xA3", + "\xC6\xF7" => "\xED\x8F\xAC", + "\xC6\xF8" => "\xED\x8F\xAD", + "\xC6\xF9" => "\xED\x8F\xB0", + "\xC6\xFA" => "\xED\x8F\xB4", + "\xC6\xFB" => "\xED\x8F\xBC", + "\xC6\xFC" => "\xED\x8F\xBD", + "\xC6\xFD" => "\xED\x8F\xBF", + "\xC6\xFE" => "\xED\x90\x81", + "\xC7\xA1" => "\xED\x90\x88", + "\xC7\xA2" => "\xED\x90\x9D", + "\xC7\xA3" => "\xED\x91\x80", + "\xC7\xA4" => "\xED\x91\x84", + "\xC7\xA5" => "\xED\x91\x9C", + "\xC7\xA6" => "\xED\x91\xA0", + "\xC7\xA7" => "\xED\x91\xA4", + "\xC7\xA8" => "\xED\x91\xAD", + "\xC7\xA9" => "\xED\x91\xAF", + "\xC7\xAA" => "\xED\x91\xB8", + "\xC7\xAB" => "\xED\x91\xB9", + "\xC7\xAC" => "\xED\x91\xBC", + "\xC7\xAD" => "\xED\x91\xBF", + "\xC7\xAE" => "\xED\x92\x80", + "\xC7\xAF" => "\xED\x92\x82", + "\xC7\xB0" => "\xED\x92\x88", + "\xC7\xB1" => "\xED\x92\x89", + "\xC7\xB2" => "\xED\x92\x8B", + "\xC7\xB3" => "\xED\x92\x8D", + "\xC7\xB4" => "\xED\x92\x94", + "\xC7\xB5" => "\xED\x92\xA9", + "\xC7\xB6" => "\xED\x93\x8C", + "\xC7\xB7" => "\xED\x93\x90", + "\xC7\xB8" => "\xED\x93\x94", + "\xC7\xB9" => "\xED\x93\x9C", + "\xC7\xBA" => "\xED\x93\x9F", + "\xC7\xBB" => "\xED\x93\xA8", + "\xC7\xBC" => "\xED\x93\xAC", + "\xC7\xBD" => "\xED\x93\xB0", + "\xC7\xBE" => "\xED\x93\xB8", + "\xC7\xBF" => "\xED\x93\xBB", + "\xC7\xC0" => "\xED\x93\xBD", + "\xC7\xC1" => "\xED\x94\x84", + "\xC7\xC2" => "\xED\x94\x88", + "\xC7\xC3" => "\xED\x94\x8C", + "\xC7\xC4" => "\xED\x94\x94", + "\xC7\xC5" => "\xED\x94\x95", + "\xC7\xC6" => "\xED\x94\x97", + "\xC7\xC7" => "\xED\x94\xBC", + "\xC7\xC8" => "\xED\x94\xBD", + "\xC7\xC9" => "\xED\x95\x80", + "\xC7\xCA" => "\xED\x95\x84", + "\xC7\xCB" => "\xED\x95\x8C", + "\xC7\xCC" => "\xED\x95\x8D", + "\xC7\xCD" => "\xED\x95\x8F", + "\xC7\xCE" => "\xED\x95\x91", + "\xC7\xCF" => "\xED\x95\x98", + "\xC7\xD0" => "\xED\x95\x99", + "\xC7\xD1" => "\xED\x95\x9C", + "\xC7\xD2" => "\xED\x95\xA0", + "\xC7\xD3" => "\xED\x95\xA5", + "\xC7\xD4" => "\xED\x95\xA8", + "\xC7\xD5" => "\xED\x95\xA9", + "\xC7\xD6" => "\xED\x95\xAB", + "\xC7\xD7" => "\xED\x95\xAD", + "\xC7\xD8" => "\xED\x95\xB4", + "\xC7\xD9" => "\xED\x95\xB5", + "\xC7\xDA" => "\xED\x95\xB8", + "\xC7\xDB" => "\xED\x95\xBC", + "\xC7\xDC" => "\xED\x96\x84", + "\xC7\xDD" => "\xED\x96\x85", + "\xC7\xDE" => "\xED\x96\x87", + "\xC7\xDF" => "\xED\x96\x88", + "\xC7\xE0" => "\xED\x96\x89", + "\xC7\xE1" => "\xED\x96\x90", + "\xC7\xE2" => "\xED\x96\xA5", + "\xC7\xE3" => "\xED\x97\x88", + "\xC7\xE4" => "\xED\x97\x89", + "\xC7\xE5" => "\xED\x97\x8C", + "\xC7\xE6" => "\xED\x97\x90", + "\xC7\xE7" => "\xED\x97\x92", + "\xC7\xE8" => "\xED\x97\x98", + "\xC7\xE9" => "\xED\x97\x99", + "\xC7\xEA" => "\xED\x97\x9B", + "\xC7\xEB" => "\xED\x97\x9D", + "\xC7\xEC" => "\xED\x97\xA4", + "\xC7\xED" => "\xED\x97\xA5", + "\xC7\xEE" => "\xED\x97\xA8", + "\xC7\xEF" => "\xED\x97\xAC", + "\xC7\xF0" => "\xED\x97\xB4", + "\xC7\xF1" => "\xED\x97\xB5", + "\xC7\xF2" => "\xED\x97\xB7", + "\xC7\xF3" => "\xED\x97\xB9", + "\xC7\xF4" => "\xED\x98\x80", + "\xC7\xF5" => "\xED\x98\x81", + "\xC7\xF6" => "\xED\x98\x84", + "\xC7\xF7" => "\xED\x98\x88", + "\xC7\xF8" => "\xED\x98\x90", + "\xC7\xF9" => "\xED\x98\x91", + "\xC7\xFA" => "\xED\x98\x93", + "\xC7\xFB" => "\xED\x98\x94", + "\xC7\xFC" => "\xED\x98\x95", + "\xC7\xFD" => "\xED\x98\x9C", + "\xC7\xFE" => "\xED\x98\xA0", + "\xC8\xA1" => "\xED\x98\xA4", + "\xC8\xA2" => "\xED\x98\xAD", + "\xC8\xA3" => "\xED\x98\xB8", + "\xC8\xA4" => "\xED\x98\xB9", + "\xC8\xA5" => "\xED\x98\xBC", + "\xC8\xA6" => "\xED\x99\x80", + "\xC8\xA7" => "\xED\x99\x85", + "\xC8\xA8" => "\xED\x99\x88", + "\xC8\xA9" => "\xED\x99\x89", + "\xC8\xAA" => "\xED\x99\x8B", + "\xC8\xAB" => "\xED\x99\x8D", + "\xC8\xAC" => "\xED\x99\x91", + "\xC8\xAD" => "\xED\x99\x94", + "\xC8\xAE" => "\xED\x99\x95", + "\xC8\xAF" => "\xED\x99\x98", + "\xC8\xB0" => "\xED\x99\x9C", + "\xC8\xB1" => "\xED\x99\xA7", + "\xC8\xB2" => "\xED\x99\xA9", + "\xC8\xB3" => "\xED\x99\xB0", + "\xC8\xB4" => "\xED\x99\xB1", + "\xC8\xB5" => "\xED\x99\xB4", + "\xC8\xB6" => "\xED\x9A\x83", + "\xC8\xB7" => "\xED\x9A\x85", + "\xC8\xB8" => "\xED\x9A\x8C", + "\xC8\xB9" => "\xED\x9A\x8D", + "\xC8\xBA" => "\xED\x9A\x90", + "\xC8\xBB" => "\xED\x9A\x94", + "\xC8\xBC" => "\xED\x9A\x9D", + "\xC8\xBD" => "\xED\x9A\x9F", + "\xC8\xBE" => "\xED\x9A\xA1", + "\xC8\xBF" => "\xED\x9A\xA8", + "\xC8\xC0" => "\xED\x9A\xAC", + "\xC8\xC1" => "\xED\x9A\xB0", + "\xC8\xC2" => "\xED\x9A\xB9", + "\xC8\xC3" => "\xED\x9A\xBB", + "\xC8\xC4" => "\xED\x9B\x84", + "\xC8\xC5" => "\xED\x9B\x85", + "\xC8\xC6" => "\xED\x9B\x88", + "\xC8\xC7" => "\xED\x9B\x8C", + "\xC8\xC8" => "\xED\x9B\x91", + "\xC8\xC9" => "\xED\x9B\x94", + "\xC8\xCA" => "\xED\x9B\x97", + "\xC8\xCB" => "\xED\x9B\x99", + "\xC8\xCC" => "\xED\x9B\xA0", + "\xC8\xCD" => "\xED\x9B\xA4", + "\xC8\xCE" => "\xED\x9B\xA8", + "\xC8\xCF" => "\xED\x9B\xB0", + "\xC8\xD0" => "\xED\x9B\xB5", + "\xC8\xD1" => "\xED\x9B\xBC", + "\xC8\xD2" => "\xED\x9B\xBD", + "\xC8\xD3" => "\xED\x9C\x80", + "\xC8\xD4" => "\xED\x9C\x84", + "\xC8\xD5" => "\xED\x9C\x91", + "\xC8\xD6" => "\xED\x9C\x98", + "\xC8\xD7" => "\xED\x9C\x99", + "\xC8\xD8" => "\xED\x9C\x9C", + "\xC8\xD9" => "\xED\x9C\xA0", + "\xC8\xDA" => "\xED\x9C\xA8", + "\xC8\xDB" => "\xED\x9C\xA9", + "\xC8\xDC" => "\xED\x9C\xAB", + "\xC8\xDD" => "\xED\x9C\xAD", + "\xC8\xDE" => "\xED\x9C\xB4", + "\xC8\xDF" => "\xED\x9C\xB5", + "\xC8\xE0" => "\xED\x9C\xB8", + "\xC8\xE1" => "\xED\x9C\xBC", + "\xC8\xE2" => "\xED\x9D\x84", + "\xC8\xE3" => "\xED\x9D\x87", + "\xC8\xE4" => "\xED\x9D\x89", + "\xC8\xE5" => "\xED\x9D\x90", + "\xC8\xE6" => "\xED\x9D\x91", + "\xC8\xE7" => "\xED\x9D\x94", + "\xC8\xE8" => "\xED\x9D\x96", + "\xC8\xE9" => "\xED\x9D\x97", + "\xC8\xEA" => "\xED\x9D\x98", + "\xC8\xEB" => "\xED\x9D\x99", + "\xC8\xEC" => "\xED\x9D\xA0", + "\xC8\xED" => "\xED\x9D\xA1", + "\xC8\xEE" => "\xED\x9D\xA3", + "\xC8\xEF" => "\xED\x9D\xA5", + "\xC8\xF0" => "\xED\x9D\xA9", + "\xC8\xF1" => "\xED\x9D\xAC", + "\xC8\xF2" => "\xED\x9D\xB0", + "\xC8\xF3" => "\xED\x9D\xB4", + "\xC8\xF4" => "\xED\x9D\xBC", + "\xC8\xF5" => "\xED\x9D\xBD", + "\xC8\xF6" => "\xED\x9E\x81", + "\xC8\xF7" => "\xED\x9E\x88", + "\xC8\xF8" => "\xED\x9E\x89", + "\xC8\xF9" => "\xED\x9E\x8C", + "\xC8\xFA" => "\xED\x9E\x90", + "\xC8\xFB" => "\xED\x9E\x98", + "\xC8\xFC" => "\xED\x9E\x99", + "\xC8\xFD" => "\xED\x9E\x9B", + "\xC8\xFE" => "\xED\x9E\x9D", + "\xCA\xA1" => "\xE4\xBC\xBD", + "\xCA\xA2" => "\xE4\xBD\xB3", + "\xCA\xA3" => "\xE5\x81\x87", + "\xCA\xA4" => "\xE5\x83\xB9", + "\xCA\xA5" => "\xE5\x8A\xA0", + "\xCA\xA6" => "\xE5\x8F\xAF", + "\xCA\xA7" => "\xE5\x91\xB5", + "\xCA\xA8" => "\xE5\x93\xA5", + "\xCA\xA9" => "\xE5\x98\x89", + "\xCA\xAA" => "\xE5\xAB\x81", + "\xCA\xAB" => "\xE5\xAE\xB6", + "\xCA\xAC" => "\xE6\x9A\x87", + "\xCA\xAD" => "\xE6\x9E\xB6", + "\xCA\xAE" => "\xE6\x9E\xB7", + "\xCA\xAF" => "\xE6\x9F\xAF", + "\xCA\xB0" => "\xE6\xAD\x8C", + "\xCA\xB1" => "\xE7\x8F\x82", + "\xCA\xB2" => "\xE7\x97\x82", + "\xCA\xB3" => "\xE7\xA8\xBC", + "\xCA\xB4" => "\xE8\x8B\x9B", + "\xCA\xB5" => "\xE8\x8C\x84", + "\xCA\xB6" => "\xE8\xA1\x97", + "\xCA\xB7" => "\xE8\xA2\x88", + "\xCA\xB8" => "\xE8\xA8\xB6", + "\xCA\xB9" => "\xE8\xB3\x88", + "\xCA\xBA" => "\xE8\xB7\x8F", + "\xCA\xBB" => "\xE8\xBB\xBB", + "\xCA\xBC" => "\xE8\xBF\xA6", + "\xCA\xBD" => "\xE9\xA7\x95", + "\xCA\xBE" => "\xE5\x88\xBB", + "\xCA\xBF" => "\xE5\x8D\xB4", + "\xCA\xC0" => "\xE5\x90\x84", + "\xCA\xC1" => "\xE6\x81\xAA", + "\xCA\xC2" => "\xE6\x85\xA4", + "\xCA\xC3" => "\xE6\xAE\xBC", + "\xCA\xC4" => "\xE7\x8F\x8F", + "\xCA\xC5" => "\xE8\x84\x9A", + "\xCA\xC6" => "\xE8\xA6\xBA", + "\xCA\xC7" => "\xE8\xA7\x92", + "\xCA\xC8" => "\xE9\x96\xA3", + "\xCA\xC9" => "\xE4\xBE\x83", + "\xCA\xCA" => "\xE5\x88\x8A", + "\xCA\xCB" => "\xE5\xA2\xBE", + "\xCA\xCC" => "\xE5\xA5\xB8", + "\xCA\xCD" => "\xE5\xA7\xA6", + "\xCA\xCE" => "\xE5\xB9\xB2", + "\xCA\xCF" => "\xE5\xB9\xB9", + "\xCA\xD0" => "\xE6\x87\x87", + "\xCA\xD1" => "\xE6\x8F\x80", + "\xCA\xD2" => "\xE6\x9D\x86", + "\xCA\xD3" => "\xE6\x9F\xAC", + "\xCA\xD4" => "\xE6\xA1\xBF", + "\xCA\xD5" => "\xE6\xBE\x97", + "\xCA\xD6" => "\xE7\x99\x8E", + "\xCA\xD7" => "\xE7\x9C\x8B", + "\xCA\xD8" => "\xE7\xA3\xB5", + "\xCA\xD9" => "\xE7\xA8\x88", + "\xCA\xDA" => "\xE7\xAB\xBF", + "\xCA\xDB" => "\xE7\xB0\xA1", + "\xCA\xDC" => "\xE8\x82\x9D", + "\xCA\xDD" => "\xE8\x89\xAE", + "\xCA\xDE" => "\xE8\x89\xB1", + "\xCA\xDF" => "\xE8\xAB\xAB", + "\xCA\xE0" => "\xE9\x96\x93", + "\xCA\xE1" => "\xE4\xB9\xAB", + "\xCA\xE2" => "\xE5\x96\x9D", + "\xCA\xE3" => "\xE6\x9B\xB7", + "\xCA\xE4" => "\xE6\xB8\xB4", + "\xCA\xE5" => "\xE7\xA2\xA3", + "\xCA\xE6" => "\xE7\xAB\xAD", + "\xCA\xE7" => "\xE8\x91\x9B", + "\xCA\xE8" => "\xE8\xA4\x90", + "\xCA\xE9" => "\xE8\x9D\x8E", + "\xCA\xEA" => "\xE9\x9E\xA8", + "\xCA\xEB" => "\xE5\x8B\x98", + "\xCA\xEC" => "\xE5\x9D\x8E", + "\xCA\xED" => "\xE5\xA0\xAA", + "\xCA\xEE" => "\xE5\xB5\x8C", + "\xCA\xEF" => "\xE6\x84\x9F", + "\xCA\xF0" => "\xE6\x86\xBE", + "\xCA\xF1" => "\xE6\x88\xA1", + "\xCA\xF2" => "\xE6\x95\xA2", + "\xCA\xF3" => "\xE6\x9F\x91", + "\xCA\xF4" => "\xE6\xA9\x84", + "\xCA\xF5" => "\xE6\xB8\x9B", + "\xCA\xF6" => "\xE7\x94\x98", + "\xCA\xF7" => "\xE7\x96\xB3", + "\xCA\xF8" => "\xE7\x9B\xA3", + "\xCA\xF9" => "\xE7\x9E\xB0", + "\xCA\xFA" => "\xE7\xB4\xBA", + "\xCA\xFB" => "\xE9\x82\xAF", + "\xCA\xFC" => "\xE9\x91\x91", + "\xCA\xFD" => "\xE9\x91\x92", + "\xCA\xFE" => "\xE9\xBE\x95", + "\xCB\xA1" => "\xE5\x8C\xA3", + "\xCB\xA2" => "\xE5\xB2\xAC", + "\xCB\xA3" => "\xE7\x94\xB2", + "\xCB\xA4" => "\xE8\x83\x9B", + "\xCB\xA5" => "\xE9\x89\x80", + "\xCB\xA6" => "\xE9\x96\x98", + "\xCB\xA7" => "\xE5\x89\x9B", + "\xCB\xA8" => "\xE5\xA0\x88", + "\xCB\xA9" => "\xE5\xA7\x9C", + "\xCB\xAA" => "\xE5\xB2\xA1", + "\xCB\xAB" => "\xE5\xB4\x97", + "\xCB\xAC" => "\xE5\xBA\xB7", + "\xCB\xAD" => "\xE5\xBC\xBA", + "\xCB\xAE" => "\xE5\xBD\x8A", + "\xCB\xAF" => "\xE6\x85\xB7", + "\xCB\xB0" => "\xE6\xB1\x9F", + "\xCB\xB1" => "\xE7\x95\xBA", + "\xCB\xB2" => "\xE7\x96\x86", + "\xCB\xB3" => "\xE7\xB3\xA0", + "\xCB\xB4" => "\xE7\xB5\xB3", + "\xCB\xB5" => "\xE7\xB6\xB1", + "\xCB\xB6" => "\xE7\xBE\x8C", + "\xCB\xB7" => "\xE8\x85\x94", + "\xCB\xB8" => "\xE8\x88\xA1", + "\xCB\xB9" => "\xE8\x96\x91", + "\xCB\xBA" => "\xE8\xA5\x81", + "\xCB\xBB" => "\xE8\xAC\x9B", + "\xCB\xBC" => "\xE9\x8B\xBC", + "\xCB\xBD" => "\xE9\x99\x8D", + "\xCB\xBE" => "\xE9\xB1\x87", + "\xCB\xBF" => "\xE4\xBB\x8B", + "\xCB\xC0" => "\xE4\xBB\xB7", + "\xCB\xC1" => "\xE5\x80\x8B", + "\xCB\xC2" => "\xE5\x87\xB1", + "\xCB\xC3" => "\xE5\xA1\x8F", + "\xCB\xC4" => "\xE6\x84\xB7", + "\xCB\xC5" => "\xE6\x84\xBE", + "\xCB\xC6" => "\xE6\x85\xA8", + "\xCB\xC7" => "\xE6\x94\xB9", + "\xCB\xC8" => "\xE6\xA7\xAA", + "\xCB\xC9" => "\xE6\xBC\x91", + "\xCB\xCA" => "\xE7\x96\xA5", + "\xCB\xCB" => "\xE7\x9A\x86", + "\xCB\xCC" => "\xE7\x9B\x96", + "\xCB\xCD" => "\xE7\xAE\x87", + "\xCB\xCE" => "\xE8\x8A\xA5", + "\xCB\xCF" => "\xE8\x93\x8B", + "\xCB\xD0" => "\xEF\xA4\x80", + "\xCB\xD1" => "\xE9\x8E\xA7", + "\xCB\xD2" => "\xE9\x96\x8B", + "\xCB\xD3" => "\xE5\x96\x80", + "\xCB\xD4" => "\xE5\xAE\xA2", + "\xCB\xD5" => "\xE5\x9D\x91", + "\xCB\xD6" => "\xEF\xA4\x81", + "\xCB\xD7" => "\xE7\xB2\xB3", + "\xCB\xD8" => "\xE7\xBE\xB9", + "\xCB\xD9" => "\xE9\x86\xB5", + "\xCB\xDA" => "\xE5\x80\xA8", + "\xCB\xDB" => "\xE5\x8E\xBB", + "\xCB\xDC" => "\xE5\xB1\x85", + "\xCB\xDD" => "\xE5\xB7\xA8", + "\xCB\xDE" => "\xE6\x8B\x92", + "\xCB\xDF" => "\xE6\x8D\xAE", + "\xCB\xE0" => "\xE6\x93\x9A", + "\xCB\xE1" => "\xE6\x93\xA7", + "\xCB\xE2" => "\xE6\xB8\xA0", + "\xCB\xE3" => "\xE7\x82\xAC", + "\xCB\xE4" => "\xE7\xA5\x9B", + "\xCB\xE5" => "\xE8\xB7\x9D", + "\xCB\xE6" => "\xE8\xB8\x9E", + "\xCB\xE7" => "\xEF\xA4\x82", + "\xCB\xE8" => "\xE9\x81\xBD", + "\xCB\xE9" => "\xE9\x89\x85", + "\xCB\xEA" => "\xE9\x8B\xB8", + "\xCB\xEB" => "\xE4\xB9\xBE", + "\xCB\xEC" => "\xE4\xBB\xB6", + "\xCB\xED" => "\xE5\x81\xA5", + "\xCB\xEE" => "\xE5\xB7\xBE", + "\xCB\xEF" => "\xE5\xBB\xBA", + "\xCB\xF0" => "\xE6\x84\x86", + "\xCB\xF1" => "\xE6\xA5\x97", + "\xCB\xF2" => "\xE8\x85\xB1", + "\xCB\xF3" => "\xE8\x99\x94", + "\xCB\xF4" => "\xE8\xB9\x87", + "\xCB\xF5" => "\xE9\x8D\xB5", + "\xCB\xF6" => "\xE9\xA8\xAB", + "\xCB\xF7" => "\xE4\xB9\x9E", + "\xCB\xF8" => "\xE5\x82\x91", + "\xCB\xF9" => "\xE6\x9D\xB0", + "\xCB\xFA" => "\xE6\xA1\x80", + "\xCB\xFB" => "\xE5\x84\x89", + "\xCB\xFC" => "\xE5\x8A\x8D", + "\xCB\xFD" => "\xE5\x8A\x92", + "\xCB\xFE" => "\xE6\xAA\xA2", + "\xCC\xA1" => "\xE7\x9E\xBC", + "\xCC\xA2" => "\xE9\x88\x90", + "\xCC\xA3" => "\xE9\xBB\x94", + "\xCC\xA4" => "\xE5\x8A\xAB", + "\xCC\xA5" => "\xE6\x80\xAF", + "\xCC\xA6" => "\xE8\xBF\xB2", + "\xCC\xA7" => "\xE5\x81\x88", + "\xCC\xA8" => "\xE6\x86\xA9", + "\xCC\xA9" => "\xE6\x8F\xAD", + "\xCC\xAA" => "\xE6\x93\x8A", + "\xCC\xAB" => "\xE6\xA0\xBC", + "\xCC\xAC" => "\xE6\xAA\x84", + "\xCC\xAD" => "\xE6\xBF\x80", + "\xCC\xAE" => "\xE8\x86\x88", + "\xCC\xAF" => "\xE8\xA6\xA1", + "\xCC\xB0" => "\xE9\x9A\x94", + "\xCC\xB1" => "\xE5\xA0\x85", + "\xCC\xB2" => "\xE7\x89\xBD", + "\xCC\xB3" => "\xE7\x8A\xAC", + "\xCC\xB4" => "\xE7\x94\x84", + "\xCC\xB5" => "\xE7\xB5\xB9", + "\xCC\xB6" => "\xE7\xB9\xAD", + "\xCC\xB7" => "\xE8\x82\xA9", + "\xCC\xB8" => "\xE8\xA6\x8B", + "\xCC\xB9" => "\xE8\xAD\xB4", + "\xCC\xBA" => "\xE9\x81\xA3", + "\xCC\xBB" => "\xE9\xB5\x91", + "\xCC\xBC" => "\xE6\x8A\x89", + "\xCC\xBD" => "\xE6\xB1\xBA", + "\xCC\xBE" => "\xE6\xBD\x94", + "\xCC\xBF" => "\xE7\xB5\x90", + "\xCC\xC0" => "\xE7\xBC\xBA", + "\xCC\xC1" => "\xE8\xA8\xA3", + "\xCC\xC2" => "\xE5\x85\xBC", + "\xCC\xC3" => "\xE6\x85\x8A", + "\xCC\xC4" => "\xE7\xAE\x9D", + "\xCC\xC5" => "\xE8\xAC\x99", + "\xCC\xC6" => "\xE9\x89\x97", + "\xCC\xC7" => "\xE9\x8E\x8C", + "\xCC\xC8" => "\xE4\xBA\xAC", + "\xCC\xC9" => "\xE4\xBF\x93", + "\xCC\xCA" => "\xE5\x80\x9E", + "\xCC\xCB" => "\xE5\x82\xBE", + "\xCC\xCC" => "\xE5\x84\x86", + "\xCC\xCD" => "\xE5\x8B\x81", + "\xCC\xCE" => "\xE5\x8B\x8D", + "\xCC\xCF" => "\xE5\x8D\xBF", + "\xCC\xD0" => "\xE5\x9D\xB0", + "\xCC\xD1" => "\xE5\xA2\x83", + "\xCC\xD2" => "\xE5\xBA\x9A", + "\xCC\xD3" => "\xE5\xBE\x91", + "\xCC\xD4" => "\xE6\x85\xB6", + "\xCC\xD5" => "\xE6\x86\xAC", + "\xCC\xD6" => "\xE6\x93\x8E", + "\xCC\xD7" => "\xE6\x95\xAC", + "\xCC\xD8" => "\xE6\x99\xAF", + "\xCC\xD9" => "\xE6\x9A\xBB", + "\xCC\xDA" => "\xE6\x9B\xB4", + "\xCC\xDB" => "\xE6\xA2\x97", + "\xCC\xDC" => "\xE6\xB6\x87", + "\xCC\xDD" => "\xE7\x82\x85", + "\xCC\xDE" => "\xE7\x83\xB1", + "\xCC\xDF" => "\xE7\x92\x9F", + "\xCC\xE0" => "\xE7\x92\xA5", + "\xCC\xE1" => "\xE7\x93\x8A", + "\xCC\xE2" => "\xE7\x97\x99", + "\xCC\xE3" => "\xE7\xA1\xAC", + "\xCC\xE4" => "\xE7\xA3\xAC", + "\xCC\xE5" => "\xE7\xAB\x9F", + "\xCC\xE6" => "\xE7\xAB\xB6", + "\xCC\xE7" => "\xE7\xB5\x85", + "\xCC\xE8" => "\xE7\xB6\x93", + "\xCC\xE9" => "\xE8\x80\x95", + "\xCC\xEA" => "\xE8\x80\xBF", + "\xCC\xEB" => "\xE8\x84\x9B", + "\xCC\xEC" => "\xE8\x8E\x96", + "\xCC\xED" => "\xE8\xAD\xA6", + "\xCC\xEE" => "\xE8\xBC\x95", + "\xCC\xEF" => "\xE9\x80\x95", + "\xCC\xF0" => "\xE9\x8F\xA1", + "\xCC\xF1" => "\xE9\xA0\x83", + "\xCC\xF2" => "\xE9\xA0\xB8", + "\xCC\xF3" => "\xE9\xA9\x9A", + "\xCC\xF4" => "\xE9\xAF\xA8", + "\xCC\xF5" => "\xE4\xBF\x82", + "\xCC\xF6" => "\xE5\x95\x93", + "\xCC\xF7" => "\xE5\xA0\xBA", + "\xCC\xF8" => "\xE5\xA5\x91", + "\xCC\xF9" => "\xE5\xAD\xA3", + "\xCC\xFA" => "\xE5\xB1\x86", + "\xCC\xFB" => "\xE6\x82\xB8", + "\xCC\xFC" => "\xE6\x88\x92", + "\xCC\xFD" => "\xE6\xA1\x82", + "\xCC\xFE" => "\xE6\xA2\xB0", + "\xCD\xA1" => "\xE6\xA3\xA8", + "\xCD\xA2" => "\xE6\xBA\xAA", + "\xCD\xA3" => "\xE7\x95\x8C", + "\xCD\xA4" => "\xE7\x99\xB8", + "\xCD\xA5" => "\xE7\xA3\x8E", + "\xCD\xA6" => "\xE7\xA8\xBD", + "\xCD\xA7" => "\xE7\xB3\xBB", + "\xCD\xA8" => "\xE7\xB9\xAB", + "\xCD\xA9" => "\xE7\xB9\xBC", + "\xCD\xAA" => "\xE8\xA8\x88", + "\xCD\xAB" => "\xE8\xAA\xA1", + "\xCD\xAC" => "\xE8\xB0\xBF", + "\xCD\xAD" => "\xE9\x9A\x8E", + "\xCD\xAE" => "\xE9\xB7\x84", + "\xCD\xAF" => "\xE5\x8F\xA4", + "\xCD\xB0" => "\xE5\x8F\xA9", + "\xCD\xB1" => "\xE5\x91\x8A", + "\xCD\xB2" => "\xE5\x91\xB1", + "\xCD\xB3" => "\xE5\x9B\xBA", + "\xCD\xB4" => "\xE5\xA7\x91", + "\xCD\xB5" => "\xE5\xAD\xA4", + "\xCD\xB6" => "\xE5\xB0\xBB", + "\xCD\xB7" => "\xE5\xBA\xAB", + "\xCD\xB8" => "\xE6\x8B\xB7", + "\xCD\xB9" => "\xE6\x94\xB7", + "\xCD\xBA" => "\xE6\x95\x85", + "\xCD\xBB" => "\xE6\x95\xB2", + "\xCD\xBC" => "\xE6\x9A\xA0", + "\xCD\xBD" => "\xE6\x9E\xAF", + "\xCD\xBE" => "\xE6\xA7\x81", + "\xCD\xBF" => "\xE6\xB2\xBD", + "\xCD\xC0" => "\xE7\x97\xBC", + "\xCD\xC1" => "\xE7\x9A\x90", + "\xCD\xC2" => "\xE7\x9D\xBE", + "\xCD\xC3" => "\xE7\xA8\xBF", + "\xCD\xC4" => "\xE7\xBE\x94", + "\xCD\xC5" => "\xE8\x80\x83", + "\xCD\xC6" => "\xE8\x82\xA1", + "\xCD\xC7" => "\xE8\x86\x8F", + "\xCD\xC8" => "\xE8\x8B\xA6", + "\xCD\xC9" => "\xE8\x8B\xBD", + "\xCD\xCA" => "\xE8\x8F\xB0", + "\xCD\xCB" => "\xE8\x97\x81", + "\xCD\xCC" => "\xE8\xA0\xB1", + "\xCD\xCD" => "\xE8\xA2\xB4", + "\xCD\xCE" => "\xE8\xAA\xA5", + "\xCD\xCF" => "\xEF\xA4\x83", + "\xCD\xD0" => "\xE8\xBE\x9C", + "\xCD\xD1" => "\xE9\x8C\xAE", + "\xCD\xD2" => "\xE9\x9B\x87", + "\xCD\xD3" => "\xE9\xA1\xA7", + "\xCD\xD4" => "\xE9\xAB\x98", + "\xCD\xD5" => "\xE9\xBC\x93", + "\xCD\xD6" => "\xE5\x93\xAD", + "\xCD\xD7" => "\xE6\x96\x9B", + "\xCD\xD8" => "\xE6\x9B\xB2", + "\xCD\xD9" => "\xE6\xA2\x8F", + "\xCD\xDA" => "\xE7\xA9\x80", + "\xCD\xDB" => "\xE8\xB0\xB7", + "\xCD\xDC" => "\xE9\xB5\xA0", + "\xCD\xDD" => "\xE5\x9B\xB0", + "\xCD\xDE" => "\xE5\x9D\xA4", + "\xCD\xDF" => "\xE5\xB4\x91", + "\xCD\xE0" => "\xE6\x98\x86", + "\xCD\xE1" => "\xE6\xA2\xB1", + "\xCD\xE2" => "\xE6\xA3\x8D", + "\xCD\xE3" => "\xE6\xBB\xBE", + "\xCD\xE4" => "\xE7\x90\xA8", + "\xCD\xE5" => "\xE8\xA2\x9E", + "\xCD\xE6" => "\xE9\xAF\xA4", + "\xCD\xE7" => "\xE6\xB1\xA8", + "\xCD\xE8" => "\xEF\xA4\x84", + "\xCD\xE9" => "\xE9\xAA\xA8", + "\xCD\xEA" => "\xE4\xBE\x9B", + "\xCD\xEB" => "\xE5\x85\xAC", + "\xCD\xEC" => "\xE5\x85\xB1", + "\xCD\xED" => "\xE5\x8A\x9F", + "\xCD\xEE" => "\xE5\xAD\x94", + "\xCD\xEF" => "\xE5\xB7\xA5", + "\xCD\xF0" => "\xE6\x81\x90", + "\xCD\xF1" => "\xE6\x81\xAD", + "\xCD\xF2" => "\xE6\x8B\xB1", + "\xCD\xF3" => "\xE6\x8E\xA7", + "\xCD\xF4" => "\xE6\x94\xBB", + "\xCD\xF5" => "\xE7\x8F\x99", + "\xCD\xF6" => "\xE7\xA9\xBA", + "\xCD\xF7" => "\xE8\x9A\xA3", + "\xCD\xF8" => "\xE8\xB2\xA2", + "\xCD\xF9" => "\xE9\x9E\x8F", + "\xCD\xFA" => "\xE4\xB8\xB2", + "\xCD\xFB" => "\xE5\xAF\xA1", + "\xCD\xFC" => "\xE6\x88\x88", + "\xCD\xFD" => "\xE6\x9E\x9C", + "\xCD\xFE" => "\xE7\x93\x9C", + "\xCE\xA1" => "\xE7\xA7\x91", + "\xCE\xA2" => "\xE8\x8F\x93", + "\xCE\xA3" => "\xE8\xAA\x87", + "\xCE\xA4" => "\xE8\xAA\xB2", + "\xCE\xA5" => "\xE8\xB7\xA8", + "\xCE\xA6" => "\xE9\x81\x8E", + "\xCE\xA7" => "\xE9\x8D\x8B", + "\xCE\xA8" => "\xE9\xA1\x86", + "\xCE\xA9" => "\xE5\xBB\x93", + "\xCE\xAA" => "\xE6\xA7\xA8", + "\xCE\xAB" => "\xE8\x97\xBF", + "\xCE\xAC" => "\xE9\x83\xAD", + "\xCE\xAD" => "\xEF\xA4\x85", + "\xCE\xAE" => "\xE5\x86\xA0", + "\xCE\xAF" => "\xE5\xAE\x98", + "\xCE\xB0" => "\xE5\xAF\xAC", + "\xCE\xB1" => "\xE6\x85\xA3", + "\xCE\xB2" => "\xE6\xA3\xBA", + "\xCE\xB3" => "\xE6\xAC\xBE", + "\xCE\xB4" => "\xE7\x81\x8C", + "\xCE\xB5" => "\xE7\x90\xAF", + "\xCE\xB6" => "\xE7\x93\x98", + "\xCE\xB7" => "\xE7\xAE\xA1", + "\xCE\xB8" => "\xE7\xBD\x90", + "\xCE\xB9" => "\xE8\x8F\x85", + "\xCE\xBA" => "\xE8\xA7\x80", + "\xCE\xBB" => "\xE8\xB2\xAB", + "\xCE\xBC" => "\xE9\x97\x9C", + "\xCE\xBD" => "\xE9\xA4\xA8", + "\xCE\xBE" => "\xE5\x88\xAE", + "\xCE\xBF" => "\xE6\x81\x9D", + "\xCE\xC0" => "\xE6\x8B\xAC", + "\xCE\xC1" => "\xE9\x80\x82", + "\xCE\xC2" => "\xE4\xBE\x8A", + "\xCE\xC3" => "\xE5\x85\x89", + "\xCE\xC4" => "\xE5\x8C\xA1", + "\xCE\xC5" => "\xE5\xA3\x99", + "\xCE\xC6" => "\xE5\xBB\xA3", + "\xCE\xC7" => "\xE6\x9B\xA0", + "\xCE\xC8" => "\xE6\xB4\xB8", + "\xCE\xC9" => "\xE7\x82\x9A", + "\xCE\xCA" => "\xE7\x8B\x82", + "\xCE\xCB" => "\xE7\x8F\x96", + "\xCE\xCC" => "\xE7\xAD\x90", + "\xCE\xCD" => "\xE8\x83\xB1", + "\xCE\xCE" => "\xE9\x91\x9B", + "\xCE\xCF" => "\xE5\x8D\xA6", + "\xCE\xD0" => "\xE6\x8E\x9B", + "\xCE\xD1" => "\xE7\xBD\xAB", + "\xCE\xD2" => "\xE4\xB9\x96", + "\xCE\xD3" => "\xE5\x82\x80", + "\xCE\xD4" => "\xE5\xA1\x8A", + "\xCE\xD5" => "\xE5\xA3\x9E", + "\xCE\xD6" => "\xE6\x80\xAA", + "\xCE\xD7" => "\xE6\x84\xA7", + "\xCE\xD8" => "\xE6\x8B\x90", + "\xCE\xD9" => "\xE6\xA7\x90", + "\xCE\xDA" => "\xE9\xAD\x81", + "\xCE\xDB" => "\xE5\xAE\x8F", + "\xCE\xDC" => "\xE7\xB4\x98", + "\xCE\xDD" => "\xE8\x82\xB1", + "\xCE\xDE" => "\xE8\xBD\x9F", + "\xCE\xDF" => "\xE4\xBA\xA4", + "\xCE\xE0" => "\xE5\x83\x91", + "\xCE\xE1" => "\xE5\x92\xAC", + "\xCE\xE2" => "\xE5\x96\xAC", + "\xCE\xE3" => "\xE5\xAC\x8C", + "\xCE\xE4" => "\xE5\xB6\xA0", + "\xCE\xE5" => "\xE5\xB7\xA7", + "\xCE\xE6" => "\xE6\x94\xAA", + "\xCE\xE7" => "\xE6\x95\x8E", + "\xCE\xE8" => "\xE6\xA0\xA1", + "\xCE\xE9" => "\xE6\xA9\x8B", + "\xCE\xEA" => "\xE7\x8B\xA1", + "\xCE\xEB" => "\xE7\x9A\x8E", + "\xCE\xEC" => "\xE7\x9F\xAF", + "\xCE\xED" => "\xE7\xB5\x9E", + "\xCE\xEE" => "\xE7\xBF\xB9", + "\xCE\xEF" => "\xE8\x86\xA0", + "\xCE\xF0" => "\xE8\x95\x8E", + "\xCE\xF1" => "\xE8\x9B\x9F", + "\xCE\xF2" => "\xE8\xBC\x83", + "\xCE\xF3" => "\xE8\xBD\x8E", + "\xCE\xF4" => "\xE9\x83\x8A", + "\xCE\xF5" => "\xE9\xA4\x83", + "\xCE\xF6" => "\xE9\xA9\x95", + "\xCE\xF7" => "\xE9\xAE\xAB", + "\xCE\xF8" => "\xE4\xB8\x98", + "\xCE\xF9" => "\xE4\xB9\x85", + "\xCE\xFA" => "\xE4\xB9\x9D", + "\xCE\xFB" => "\xE4\xBB\x87", + "\xCE\xFC" => "\xE4\xBF\xB1", + "\xCE\xFD" => "\xE5\x85\xB7", + "\xCE\xFE" => "\xE5\x8B\xBE", + "\xCF\xA1" => "\xE5\x8D\x80", + "\xCF\xA2" => "\xE5\x8F\xA3", + "\xCF\xA3" => "\xE5\x8F\xA5", + "\xCF\xA4" => "\xE5\x92\x8E", + "\xCF\xA5" => "\xE5\x98\x94", + "\xCF\xA6" => "\xE5\x9D\xB5", + "\xCF\xA7" => "\xE5\x9E\xA2", + "\xCF\xA8" => "\xE5\xAF\x87", + "\xCF\xA9" => "\xE5\xB6\x87", + "\xCF\xAA" => "\xE5\xBB\x90", + "\xCF\xAB" => "\xE6\x87\xBC", + "\xCF\xAC" => "\xE6\x8B\x98", + "\xCF\xAD" => "\xE6\x95\x91", + "\xCF\xAE" => "\xE6\x9E\xB8", + "\xCF\xAF" => "\xE6\x9F\xA9", + "\xCF\xB0" => "\xE6\xA7\x8B", + "\xCF\xB1" => "\xE6\xAD\x90", + "\xCF\xB2" => "\xE6\xAF\x86", + "\xCF\xB3" => "\xE6\xAF\xAC", + "\xCF\xB4" => "\xE6\xB1\x82", + "\xCF\xB5" => "\xE6\xBA\x9D", + "\xCF\xB6" => "\xE7\x81\xB8", + "\xCF\xB7" => "\xE7\x8B\x97", + "\xCF\xB8" => "\xE7\x8E\x96", + "\xCF\xB9" => "\xE7\x90\x83", + "\xCF\xBA" => "\xE7\x9E\xBF", + "\xCF\xBB" => "\xE7\x9F\xA9", + "\xCF\xBC" => "\xE7\xA9\xB6", + "\xCF\xBD" => "\xE7\xB5\xBF", + "\xCF\xBE" => "\xE8\x80\x89", + "\xCF\xBF" => "\xE8\x87\xBC", + "\xCF\xC0" => "\xE8\x88\x85", + "\xCF\xC1" => "\xE8\x88\x8A", + "\xCF\xC2" => "\xE8\x8B\x9F", + "\xCF\xC3" => "\xE8\xA1\xA2", + "\xCF\xC4" => "\xE8\xAC\xB3", + "\xCF\xC5" => "\xE8\xB3\xBC", + "\xCF\xC6" => "\xE8\xBB\x80", + "\xCF\xC7" => "\xE9\x80\x91", + "\xCF\xC8" => "\xE9\x82\xB1", + "\xCF\xC9" => "\xE9\x89\xA4", + "\xCF\xCA" => "\xE9\x8A\xB6", + "\xCF\xCB" => "\xE9\xA7\x92", + "\xCF\xCC" => "\xE9\xA9\x85", + "\xCF\xCD" => "\xE9\xB3\xA9", + "\xCF\xCE" => "\xE9\xB7\x97", + "\xCF\xCF" => "\xE9\xBE\x9C", + "\xCF\xD0" => "\xE5\x9C\x8B", + "\xCF\xD1" => "\xE5\xB1\x80", + "\xCF\xD2" => "\xE8\x8F\x8A", + "\xCF\xD3" => "\xE9\x9E\xA0", + "\xCF\xD4" => "\xE9\x9E\xAB", + "\xCF\xD5" => "\xE9\xBA\xB4", + "\xCF\xD6" => "\xE5\x90\x9B", + "\xCF\xD7" => "\xE7\xAA\x98", + "\xCF\xD8" => "\xE7\xBE\xA4", + "\xCF\xD9" => "\xE8\xA3\x99", + "\xCF\xDA" => "\xE8\xBB\x8D", + "\xCF\xDB" => "\xE9\x83\xA1", + "\xCF\xDC" => "\xE5\xA0\x80", + "\xCF\xDD" => "\xE5\xB1\x88", + "\xCF\xDE" => "\xE6\x8E\x98", + "\xCF\xDF" => "\xE7\xAA\x9F", + "\xCF\xE0" => "\xE5\xAE\xAE", + "\xCF\xE1" => "\xE5\xBC\x93", + "\xCF\xE2" => "\xE7\xA9\xB9", + "\xCF\xE3" => "\xE7\xAA\xAE", + "\xCF\xE4" => "\xE8\x8A\x8E", + "\xCF\xE5" => "\xE8\xBA\xAC", + "\xCF\xE6" => "\xE5\x80\xA6", + "\xCF\xE7" => "\xE5\x88\xB8", + "\xCF\xE8" => "\xE5\x8B\xB8", + "\xCF\xE9" => "\xE5\x8D\xB7", + "\xCF\xEA" => "\xE5\x9C\x88", + "\xCF\xEB" => "\xE6\x8B\xB3", + "\xCF\xEC" => "\xE6\x8D\xB2", + "\xCF\xED" => "\xE6\xAC\x8A", + "\xCF\xEE" => "\xE6\xB7\x83", + "\xCF\xEF" => "\xE7\x9C\xB7", + "\xCF\xF0" => "\xE5\x8E\xA5", + "\xCF\xF1" => "\xE7\x8D\x97", + "\xCF\xF2" => "\xE8\x95\xA8", + "\xCF\xF3" => "\xE8\xB9\xB6", + "\xCF\xF4" => "\xE9\x97\x95", + "\xCF\xF5" => "\xE6\x9C\xBA", + "\xCF\xF6" => "\xE6\xAB\x83", + "\xCF\xF7" => "\xE6\xBD\xB0", + "\xCF\xF8" => "\xE8\xA9\xAD", + "\xCF\xF9" => "\xE8\xBB\x8C", + "\xCF\xFA" => "\xE9\xA5\x8B", + "\xCF\xFB" => "\xEF\xA4\x86", + "\xCF\xFC" => "\xE6\x99\xB7", + "\xCF\xFD" => "\xE6\xAD\xB8", + "\xCF\xFE" => "\xE8\xB2\xB4", + "\xD0\xA1" => "\xE9\xAC\xBC", + "\xD0\xA2" => "\xEF\xA4\x87", + "\xD0\xA3" => "\xE5\x8F\xAB", + "\xD0\xA4" => "\xE5\x9C\xAD", + "\xD0\xA5" => "\xE5\xA5\x8E", + "\xD0\xA6" => "\xE6\x8F\x86", + "\xD0\xA7" => "\xE6\xA7\xBB", + "\xD0\xA8" => "\xE7\x8F\xAA", + "\xD0\xA9" => "\xE7\xA1\x85", + "\xD0\xAA" => "\xE7\xAA\xBA", + "\xD0\xAB" => "\xE7\xAB\x85", + "\xD0\xAC" => "\xE7\xB3\xBE", + "\xD0\xAD" => "\xE8\x91\xB5", + "\xD0\xAE" => "\xE8\xA6\x8F", + "\xD0\xAF" => "\xE8\xB5\xB3", + "\xD0\xB0" => "\xE9\x80\xB5", + "\xD0\xB1" => "\xE9\x96\xA8", + "\xD0\xB2" => "\xE5\x8B\xBB", + "\xD0\xB3" => "\xE5\x9D\x87", + "\xD0\xB4" => "\xE7\x95\x87", + "\xD0\xB5" => "\xE7\xAD\xA0", + "\xD0\xB6" => "\xE8\x8F\x8C", + "\xD0\xB7" => "\xE9\x88\x9E", + "\xD0\xB8" => "\xEF\xA4\x88", + "\xD0\xB9" => "\xE6\xA9\x98", + "\xD0\xBA" => "\xE5\x85\x8B", + "\xD0\xBB" => "\xE5\x89\x8B", + "\xD0\xBC" => "\xE5\x8A\x87", + "\xD0\xBD" => "\xE6\x88\x9F", + "\xD0\xBE" => "\xE6\xA3\x98", + "\xD0\xBF" => "\xE6\xA5\xB5", + "\xD0\xC0" => "\xE9\x9A\x99", + "\xD0\xC1" => "\xE5\x83\x85", + "\xD0\xC2" => "\xE5\x8A\xA4", + "\xD0\xC3" => "\xE5\x8B\xA4", + "\xD0\xC4" => "\xE6\x87\x83", + "\xD0\xC5" => "\xE6\x96\xA4", + "\xD0\xC6" => "\xE6\xA0\xB9", + "\xD0\xC7" => "\xE6\xA7\xBF", + "\xD0\xC8" => "\xE7\x91\xBE", + "\xD0\xC9" => "\xE7\xAD\x8B", + "\xD0\xCA" => "\xE8\x8A\xB9", + "\xD0\xCB" => "\xE8\x8F\xAB", + "\xD0\xCC" => "\xE8\xA6\xB2", + "\xD0\xCD" => "\xE8\xAC\xB9", + "\xD0\xCE" => "\xE8\xBF\x91", + "\xD0\xCF" => "\xE9\xA5\x89", + "\xD0\xD0" => "\xEF\xA4\x89", + "\xD0\xD1" => "\xE4\xBB\x8A", + "\xD0\xD2" => "\xE5\xA6\x97", + "\xD0\xD3" => "\xE6\x93\x92", + "\xD0\xD4" => "\xE6\x98\x91", + "\xD0\xD5" => "\xE6\xAA\x8E", + "\xD0\xD6" => "\xE7\x90\xB4", + "\xD0\xD7" => "\xE7\xA6\x81", + "\xD0\xD8" => "\xE7\xA6\xBD", + "\xD0\xD9" => "\xE8\x8A\xA9", + "\xD0\xDA" => "\xE8\xA1\xBE", + "\xD0\xDB" => "\xE8\xA1\xBF", + "\xD0\xDC" => "\xE8\xA5\x9F", + "\xD0\xDD" => "\xEF\xA4\x8A", + "\xD0\xDE" => "\xE9\x8C\xA6", + "\xD0\xDF" => "\xE4\xBC\x8B", + "\xD0\xE0" => "\xE5\x8F\x8A", + "\xD0\xE1" => "\xE6\x80\xA5", + "\xD0\xE2" => "\xE6\x89\xB1", + "\xD0\xE3" => "\xE6\xB1\xB2", + "\xD0\xE4" => "\xE7\xB4\x9A", + "\xD0\xE5" => "\xE7\xB5\xA6", + "\xD0\xE6" => "\xE4\xBA\x98", + "\xD0\xE7" => "\xE5\x85\xA2", + "\xD0\xE8" => "\xE7\x9F\x9C", + "\xD0\xE9" => "\xE8\x82\xAF", + "\xD0\xEA" => "\xE4\xBC\x81", + "\xD0\xEB" => "\xE4\xBC\x8E", + "\xD0\xEC" => "\xE5\x85\xB6", + "\xD0\xED" => "\xE5\x86\x80", + "\xD0\xEE" => "\xE5\x97\x9C", + "\xD0\xEF" => "\xE5\x99\xA8", + "\xD0\xF0" => "\xE5\x9C\xBB", + "\xD0\xF1" => "\xE5\x9F\xBA", + "\xD0\xF2" => "\xE5\x9F\xBC", + "\xD0\xF3" => "\xE5\xA4\x94", + "\xD0\xF4" => "\xE5\xA5\x87", + "\xD0\xF5" => "\xE5\xA6\x93", + "\xD0\xF6" => "\xE5\xAF\x84", + "\xD0\xF7" => "\xE5\xB2\x90", + "\xD0\xF8" => "\xE5\xB4\x8E", + "\xD0\xF9" => "\xE5\xB7\xB1", + "\xD0\xFA" => "\xE5\xB9\xBE", + "\xD0\xFB" => "\xE5\xBF\x8C", + "\xD0\xFC" => "\xE6\x8A\x80", + "\xD0\xFD" => "\xE6\x97\x97", + "\xD0\xFE" => "\xE6\x97\xA3", + "\xD1\xA1" => "\xE6\x9C\x9E", + "\xD1\xA2" => "\xE6\x9C\x9F", + "\xD1\xA3" => "\xE6\x9D\x9E", + "\xD1\xA4" => "\xE6\xA3\x8B", + "\xD1\xA5" => "\xE6\xA3\x84", + "\xD1\xA6" => "\xE6\xA9\x9F", + "\xD1\xA7" => "\xE6\xAC\xBA", + "\xD1\xA8" => "\xE6\xB0\xA3", + "\xD1\xA9" => "\xE6\xB1\xBD", + "\xD1\xAA" => "\xE6\xB2\x82", + "\xD1\xAB" => "\xE6\xB7\x87", + "\xD1\xAC" => "\xE7\x8E\x98", + "\xD1\xAD" => "\xE7\x90\xA6", + "\xD1\xAE" => "\xE7\x90\xAA", + "\xD1\xAF" => "\xE7\x92\x82", + "\xD1\xB0" => "\xE7\x92\xA3", + "\xD1\xB1" => "\xE7\x95\xB8", + "\xD1\xB2" => "\xE7\x95\xBF", + "\xD1\xB3" => "\xE7\xA2\x81", + "\xD1\xB4" => "\xE7\xA3\xAF", + "\xD1\xB5" => "\xE7\xA5\x81", + "\xD1\xB6" => "\xE7\xA5\x87", + "\xD1\xB7" => "\xE7\xA5\x88", + "\xD1\xB8" => "\xE7\xA5\xBA", + "\xD1\xB9" => "\xE7\xAE\x95", + "\xD1\xBA" => "\xE7\xB4\x80", + "\xD1\xBB" => "\xE7\xB6\xBA", + "\xD1\xBC" => "\xE7\xBE\x88", + "\xD1\xBD" => "\xE8\x80\x86", + "\xD1\xBE" => "\xE8\x80\xAD", + "\xD1\xBF" => "\xE8\x82\x8C", + "\xD1\xC0" => "\xE8\xA8\x98", + "\xD1\xC1" => "\xE8\xAD\x8F", + "\xD1\xC2" => "\xE8\xB1\x88", + "\xD1\xC3" => "\xE8\xB5\xB7", + "\xD1\xC4" => "\xE9\x8C\xA1", + "\xD1\xC5" => "\xE9\x8C\xA4", + "\xD1\xC6" => "\xE9\xA3\xA2", + "\xD1\xC7" => "\xE9\xA5\x91", + "\xD1\xC8" => "\xE9\xA8\x8E", + "\xD1\xC9" => "\xE9\xA8\x8F", + "\xD1\xCA" => "\xE9\xA9\xA5", + "\xD1\xCB" => "\xE9\xBA\x92", + "\xD1\xCC" => "\xE7\xB7\x8A", + "\xD1\xCD" => "\xE4\xBD\xB6", + "\xD1\xCE" => "\xE5\x90\x89", + "\xD1\xCF" => "\xE6\x8B\xAE", + "\xD1\xD0" => "\xE6\xA1\x94", + "\xD1\xD1" => "\xE9\x87\x91", + "\xD1\xD2" => "\xE5\x96\xAB", + "\xD1\xD3" => "\xE5\x84\xBA", + "\xD1\xD4" => "\xEF\xA4\x8B", + "\xD1\xD5" => "\xEF\xA4\x8C", + "\xD1\xD6" => "\xE5\xA8\x9C", + "\xD1\xD7" => "\xE6\x87\xA6", + "\xD1\xD8" => "\xEF\xA4\x8D", + "\xD1\xD9" => "\xE6\x8B\x8F", + "\xD1\xDA" => "\xE6\x8B\xBF", + "\xD1\xDB" => "\xEF\xA4\x8E", + "\xD1\xDC" => "\xEF\xA4\x8F", + "\xD1\xDD" => "\xEF\xA4\x90", + "\xD1\xDE" => "\xEF\xA4\x91", + "\xD1\xDF" => "\xEF\xA4\x92", + "\xD1\xE0" => "\xEF\xA4\x93", + "\xD1\xE1" => "\xE9\x82\xA3", + "\xD1\xE2" => "\xEF\xA4\x94", + "\xD1\xE3" => "\xEF\xA4\x95", + "\xD1\xE4" => "\xEF\xA4\x96", + "\xD1\xE5" => "\xEF\xA4\x97", + "\xD1\xE6" => "\xEF\xA4\x98", + "\xD1\xE7" => "\xE8\xAB\xBE", + "\xD1\xE8" => "\xEF\xA4\x99", + "\xD1\xE9" => "\xEF\xA4\x9A", + "\xD1\xEA" => "\xEF\xA4\x9B", + "\xD1\xEB" => "\xEF\xA4\x9C", + "\xD1\xEC" => "\xE6\x9A\x96", + "\xD1\xED" => "\xEF\xA4\x9D", + "\xD1\xEE" => "\xE7\x85\x96", + "\xD1\xEF" => "\xEF\xA4\x9E", + "\xD1\xF0" => "\xEF\xA4\x9F", + "\xD1\xF1" => "\xE9\x9B\xA3", + "\xD1\xF2" => "\xEF\xA4\xA0", + "\xD1\xF3" => "\xE6\x8D\x8F", + "\xD1\xF4" => "\xE6\x8D\xBA", + "\xD1\xF5" => "\xE5\x8D\x97", + "\xD1\xF6" => "\xEF\xA4\xA1", + "\xD1\xF7" => "\xE6\x9E\x8F", + "\xD1\xF8" => "\xE6\xA5\xA0", + "\xD1\xF9" => "\xE6\xB9\xB3", + "\xD1\xFA" => "\xEF\xA4\xA2", + "\xD1\xFB" => "\xE7\x94\xB7", + "\xD1\xFC" => "\xEF\xA4\xA3", + "\xD1\xFD" => "\xEF\xA4\xA4", + "\xD1\xFE" => "\xEF\xA4\xA5", + "\xD2\xA1" => "\xE7\xB4\x8D", + "\xD2\xA2" => "\xEF\xA4\xA6", + "\xD2\xA3" => "\xEF\xA4\xA7", + "\xD2\xA4" => "\xE8\xA1\xB2", + "\xD2\xA5" => "\xE5\x9B\x8A", + "\xD2\xA6" => "\xE5\xA8\x98", + "\xD2\xA7" => "\xEF\xA4\xA8", + "\xD2\xA8" => "\xEF\xA4\xA9", + "\xD2\xA9" => "\xEF\xA4\xAA", + "\xD2\xAA" => "\xEF\xA4\xAB", + "\xD2\xAB" => "\xEF\xA4\xAC", + "\xD2\xAC" => "\xE4\xB9\x83", + "\xD2\xAD" => "\xEF\xA4\xAD", + "\xD2\xAE" => "\xE5\x85\xA7", + "\xD2\xAF" => "\xE5\xA5\x88", + "\xD2\xB0" => "\xE6\x9F\xB0", + "\xD2\xB1" => "\xE8\x80\x90", + "\xD2\xB2" => "\xEF\xA4\xAE", + "\xD2\xB3" => "\xE5\xA5\xB3", + "\xD2\xB4" => "\xE5\xB9\xB4", + "\xD2\xB5" => "\xE6\x92\x9A", + "\xD2\xB6" => "\xE7\xA7\x8A", + "\xD2\xB7" => "\xE5\xBF\xB5", + "\xD2\xB8" => "\xE6\x81\xAC", + "\xD2\xB9" => "\xE6\x8B\x88", + "\xD2\xBA" => "\xE6\x8D\xBB", + "\xD2\xBB" => "\xE5\xAF\xA7", + "\xD2\xBC" => "\xE5\xAF\x97", + "\xD2\xBD" => "\xE5\x8A\xAA", + "\xD2\xBE" => "\xEF\xA4\xAF", + "\xD2\xBF" => "\xE5\xA5\xB4", + "\xD2\xC0" => "\xE5\xBC\xA9", + "\xD2\xC1" => "\xE6\x80\x92", + "\xD2\xC2" => "\xEF\xA4\xB0", + "\xD2\xC3" => "\xEF\xA4\xB1", + "\xD2\xC4" => "\xEF\xA4\xB2", + "\xD2\xC5" => "\xE7\x91\x99", + "\xD2\xC6" => "\xEF\xA4\xB3", + "\xD2\xC7" => "\xEF\xA4\xB4", + "\xD2\xC8" => "\xEF\xA4\xB5", + "\xD2\xC9" => "\xEF\xA4\xB6", + "\xD2\xCA" => "\xEF\xA4\xB7", + "\xD2\xCB" => "\xEF\xA4\xB8", + "\xD2\xCC" => "\xE9\xA7\x91", + "\xD2\xCD" => "\xEF\xA4\xB9", + "\xD2\xCE" => "\xEF\xA4\xBA", + "\xD2\xCF" => "\xEF\xA4\xBB", + "\xD2\xD0" => "\xEF\xA4\xBC", + "\xD2\xD1" => "\xEF\xA4\xBD", + "\xD2\xD2" => "\xEF\xA4\xBE", + "\xD2\xD3" => "\xEF\xA4\xBF", + "\xD2\xD4" => "\xEF\xA5\x80", + "\xD2\xD5" => "\xEF\xA5\x81", + "\xD2\xD6" => "\xEF\xA5\x82", + "\xD2\xD7" => "\xEF\xA5\x83", + "\xD2\xD8" => "\xE6\xBF\x83", + "\xD2\xD9" => "\xEF\xA5\x84", + "\xD2\xDA" => "\xEF\xA5\x85", + "\xD2\xDB" => "\xE8\x86\xBF", + "\xD2\xDC" => "\xE8\xBE\xB2", + "\xD2\xDD" => "\xE6\x83\xB1", + "\xD2\xDE" => "\xEF\xA5\x86", + "\xD2\xDF" => "\xEF\xA5\x87", + "\xD2\xE0" => "\xE8\x85\xA6", + "\xD2\xE1" => "\xEF\xA5\x88", + "\xD2\xE2" => "\xEF\xA5\x89", + "\xD2\xE3" => "\xE5\xB0\xBF", + "\xD2\xE4" => "\xEF\xA5\x8A", + "\xD2\xE5" => "\xEF\xA5\x8B", + "\xD2\xE6" => "\xEF\xA5\x8C", + "\xD2\xE7" => "\xEF\xA5\x8D", + "\xD2\xE8" => "\xEF\xA5\x8E", + "\xD2\xE9" => "\xEF\xA5\x8F", + "\xD2\xEA" => "\xEF\xA5\x90", + "\xD2\xEB" => "\xEF\xA5\x91", + "\xD2\xEC" => "\xE5\xAB\xA9", + "\xD2\xED" => "\xE8\xA8\xA5", + "\xD2\xEE" => "\xE6\x9D\xBB", + "\xD2\xEF" => "\xE7\xB4\x90", + "\xD2\xF0" => "\xEF\xA5\x92", + "\xD2\xF1" => "\xEF\xA5\x93", + "\xD2\xF2" => "\xEF\xA5\x94", + "\xD2\xF3" => "\xEF\xA5\x95", + "\xD2\xF4" => "\xEF\xA5\x96", + "\xD2\xF5" => "\xEF\xA5\x97", + "\xD2\xF6" => "\xE8\x83\xBD", + "\xD2\xF7" => "\xEF\xA5\x98", + "\xD2\xF8" => "\xEF\xA5\x99", + "\xD2\xF9" => "\xE5\xB0\xBC", + "\xD2\xFA" => "\xE6\xB3\xA5", + "\xD2\xFB" => "\xE5\x8C\xBF", + "\xD2\xFC" => "\xE6\xBA\xBA", + "\xD2\xFD" => "\xE5\xA4\x9A", + "\xD2\xFE" => "\xE8\x8C\xB6", + "\xD3\xA1" => "\xE4\xB8\xB9", + "\xD3\xA2" => "\xE4\xBA\xB6", + "\xD3\xA3" => "\xE4\xBD\x86", + "\xD3\xA4" => "\xE5\x96\xAE", + "\xD3\xA5" => "\xE5\x9C\x98", + "\xD3\xA6" => "\xE5\xA3\x87", + "\xD3\xA7" => "\xE5\xBD\x96", + "\xD3\xA8" => "\xE6\x96\xB7", + "\xD3\xA9" => "\xE6\x97\xA6", + "\xD3\xAA" => "\xE6\xAA\x80", + "\xD3\xAB" => "\xE6\xAE\xB5", + "\xD3\xAC" => "\xE6\xB9\x8D", + "\xD3\xAD" => "\xE7\x9F\xAD", + "\xD3\xAE" => "\xE7\xAB\xAF", + "\xD3\xAF" => "\xE7\xB0\x9E", + "\xD3\xB0" => "\xE7\xB7\x9E", + "\xD3\xB1" => "\xE8\x9B\x8B", + "\xD3\xB2" => "\xE8\xA2\x92", + "\xD3\xB3" => "\xE9\x84\xB2", + "\xD3\xB4" => "\xE9\x8D\x9B", + "\xD3\xB5" => "\xE6\x92\xBB", + "\xD3\xB6" => "\xE6\xBE\xBE", + "\xD3\xB7" => "\xE7\x8D\xBA", + "\xD3\xB8" => "\xE7\x96\xB8", + "\xD3\xB9" => "\xE9\x81\x94", + "\xD3\xBA" => "\xE5\x95\x96", + "\xD3\xBB" => "\xE5\x9D\x8D", + "\xD3\xBC" => "\xE6\x86\xBA", + "\xD3\xBD" => "\xE6\x93\x94", + "\xD3\xBE" => "\xE6\x9B\x87", + "\xD3\xBF" => "\xE6\xB7\xA1", + "\xD3\xC0" => "\xE6\xB9\x9B", + "\xD3\xC1" => "\xE6\xBD\xAD", + "\xD3\xC2" => "\xE6\xBE\xB9", + "\xD3\xC3" => "\xE7\x97\xB0", + "\xD3\xC4" => "\xE8\x81\x83", + "\xD3\xC5" => "\xE8\x86\xBD", + "\xD3\xC6" => "\xE8\x95\x81", + "\xD3\xC7" => "\xE8\xA6\x83", + "\xD3\xC8" => "\xE8\xAB\x87", + "\xD3\xC9" => "\xE8\xAD\x9A", + "\xD3\xCA" => "\xE9\x8C\x9F", + "\xD3\xCB" => "\xE6\xB2\x93", + "\xD3\xCC" => "\xE7\x95\x93", + "\xD3\xCD" => "\xE7\xAD\x94", + "\xD3\xCE" => "\xE8\xB8\x8F", + "\xD3\xCF" => "\xE9\x81\x9D", + "\xD3\xD0" => "\xE5\x94\x90", + "\xD3\xD1" => "\xE5\xA0\x82", + "\xD3\xD2" => "\xE5\xA1\x98", + "\xD3\xD3" => "\xE5\xB9\xA2", + "\xD3\xD4" => "\xE6\x88\x87", + "\xD3\xD5" => "\xE6\x92\x9E", + "\xD3\xD6" => "\xE6\xA3\xA0", + "\xD3\xD7" => "\xE7\x95\xB6", + "\xD3\xD8" => "\xE7\xB3\x96", + "\xD3\xD9" => "\xE8\x9E\xB3", + "\xD3\xDA" => "\xE9\xBB\xA8", + "\xD3\xDB" => "\xE4\xBB\xA3", + "\xD3\xDC" => "\xE5\x9E\x88", + "\xD3\xDD" => "\xE5\x9D\xAE", + "\xD3\xDE" => "\xE5\xA4\xA7", + "\xD3\xDF" => "\xE5\xB0\x8D", + "\xD3\xE0" => "\xE5\xB2\xB1", + "\xD3\xE1" => "\xE5\xB8\xB6", + "\xD3\xE2" => "\xE5\xBE\x85", + "\xD3\xE3" => "\xE6\x88\xB4", + "\xD3\xE4" => "\xE6\x93\xA1", + "\xD3\xE5" => "\xE7\x8E\xB3", + "\xD3\xE6" => "\xE8\x87\xBA", + "\xD3\xE7" => "\xE8\xA2\x8B", + "\xD3\xE8" => "\xE8\xB2\xB8", + "\xD3\xE9" => "\xE9\x9A\x8A", + "\xD3\xEA" => "\xE9\xBB\x9B", + "\xD3\xEB" => "\xE5\xAE\x85", + "\xD3\xEC" => "\xE5\xBE\xB7", + "\xD3\xED" => "\xE6\x82\xB3", + "\xD3\xEE" => "\xE5\x80\x92", + "\xD3\xEF" => "\xE5\x88\x80", + "\xD3\xF0" => "\xE5\x88\xB0", + "\xD3\xF1" => "\xE5\x9C\x96", + "\xD3\xF2" => "\xE5\xA0\xB5", + "\xD3\xF3" => "\xE5\xA1\x97", + "\xD3\xF4" => "\xE5\xB0\x8E", + "\xD3\xF5" => "\xE5\xB1\xA0", + "\xD3\xF6" => "\xE5\xB3\xB6", + "\xD3\xF7" => "\xE5\xB6\x8B", + "\xD3\xF8" => "\xE5\xBA\xA6", + "\xD3\xF9" => "\xE5\xBE\x92", + "\xD3\xFA" => "\xE6\x82\xBC", + "\xD3\xFB" => "\xE6\x8C\x91", + "\xD3\xFC" => "\xE6\x8E\x89", + "\xD3\xFD" => "\xE6\x90\x97", + "\xD3\xFE" => "\xE6\xA1\x83", + "\xD4\xA1" => "\xE6\xA3\xB9", + "\xD4\xA2" => "\xE6\xAB\x82", + "\xD4\xA3" => "\xE6\xB7\x98", + "\xD4\xA4" => "\xE6\xB8\xA1", + "\xD4\xA5" => "\xE6\xBB\x94", + "\xD4\xA6" => "\xE6\xBF\xA4", + "\xD4\xA7" => "\xE7\x87\xBE", + "\xD4\xA8" => "\xE7\x9B\x9C", + "\xD4\xA9" => "\xE7\x9D\xB9", + "\xD4\xAA" => "\xE7\xA6\xB1", + "\xD4\xAB" => "\xE7\xA8\xBB", + "\xD4\xAC" => "\xE8\x90\x84", + "\xD4\xAD" => "\xE8\xA6\xA9", + "\xD4\xAE" => "\xE8\xB3\xAD", + "\xD4\xAF" => "\xE8\xB7\xB3", + "\xD4\xB0" => "\xE8\xB9\x88", + "\xD4\xB1" => "\xE9\x80\x83", + "\xD4\xB2" => "\xE9\x80\x94", + "\xD4\xB3" => "\xE9\x81\x93", + "\xD4\xB4" => "\xE9\x83\xBD", + "\xD4\xB5" => "\xE9\x8D\x8D", + "\xD4\xB6" => "\xE9\x99\xB6", + "\xD4\xB7" => "\xE9\x9F\x9C", + "\xD4\xB8" => "\xE6\xAF\x92", + "\xD4\xB9" => "\xE7\x80\x86", + "\xD4\xBA" => "\xE7\x89\x98", + "\xD4\xBB" => "\xE7\x8A\xA2", + "\xD4\xBC" => "\xE7\x8D\xA8", + "\xD4\xBD" => "\xE7\x9D\xA3", + "\xD4\xBE" => "\xE7\xA6\xBF", + "\xD4\xBF" => "\xE7\xAF\xA4", + "\xD4\xC0" => "\xE7\xBA\x9B", + "\xD4\xC1" => "\xE8\xAE\x80", + "\xD4\xC2" => "\xE5\xA2\xA9", + "\xD4\xC3" => "\xE6\x83\x87", + "\xD4\xC4" => "\xE6\x95\xA6", + "\xD4\xC5" => "\xE6\x97\xBD", + "\xD4\xC6" => "\xE6\x9A\xBE", + "\xD4\xC7" => "\xE6\xB2\x8C", + "\xD4\xC8" => "\xE7\x84\x9E", + "\xD4\xC9" => "\xE7\x87\x89", + "\xD4\xCA" => "\xE8\xB1\x9A", + "\xD4\xCB" => "\xE9\xA0\x93", + "\xD4\xCC" => "\xE4\xB9\xAD", + "\xD4\xCD" => "\xE7\xAA\x81", + "\xD4\xCE" => "\xE4\xBB\x9D", + "\xD4\xCF" => "\xE5\x86\xAC", + "\xD4\xD0" => "\xE5\x87\x8D", + "\xD4\xD1" => "\xE5\x8B\x95", + "\xD4\xD2" => "\xE5\x90\x8C", + "\xD4\xD3" => "\xE6\x86\xA7", + "\xD4\xD4" => "\xE6\x9D\xB1", + "\xD4\xD5" => "\xE6\xA1\x90", + "\xD4\xD6" => "\xE6\xA3\x9F", + "\xD4\xD7" => "\xE6\xB4\x9E", + "\xD4\xD8" => "\xE6\xBD\xBC", + "\xD4\xD9" => "\xE7\x96\xBC", + "\xD4\xDA" => "\xE7\x9E\xB3", + "\xD4\xDB" => "\xE7\xAB\xA5", + "\xD4\xDC" => "\xE8\x83\xB4", + "\xD4\xDD" => "\xE8\x91\xA3", + "\xD4\xDE" => "\xE9\x8A\x85", + "\xD4\xDF" => "\xE5\x85\x9C", + "\xD4\xE0" => "\xE6\x96\x97", + "\xD4\xE1" => "\xE6\x9D\x9C", + "\xD4\xE2" => "\xE6\x9E\x93", + "\xD4\xE3" => "\xE7\x97\x98", + "\xD4\xE4" => "\xE7\xAB\x87", + "\xD4\xE5" => "\xE8\x8D\xB3", + "\xD4\xE6" => "\xEF\xA5\x9A", + "\xD4\xE7" => "\xE8\xB1\x86", + "\xD4\xE8" => "\xE9\x80\x97", + "\xD4\xE9" => "\xE9\xA0\xAD", + "\xD4\xEA" => "\xE5\xB1\xAF", + "\xD4\xEB" => "\xE8\x87\x80", + "\xD4\xEC" => "\xE8\x8A\x9A", + "\xD4\xED" => "\xE9\x81\x81", + "\xD4\xEE" => "\xE9\x81\xAF", + "\xD4\xEF" => "\xE9\x88\x8D", + "\xD4\xF0" => "\xE5\xBE\x97", + "\xD4\xF1" => "\xE5\xB6\x9D", + "\xD4\xF2" => "\xE6\xA9\x99", + "\xD4\xF3" => "\xE7\x87\x88", + "\xD4\xF4" => "\xE7\x99\xBB", + "\xD4\xF5" => "\xE7\xAD\x89", + "\xD4\xF6" => "\xE8\x97\xA4", + "\xD4\xF7" => "\xE8\xAC\x84", + "\xD4\xF8" => "\xE9\x84\xA7", + "\xD4\xF9" => "\xE9\xA8\xB0", + "\xD4\xFA" => "\xE5\x96\x87", + "\xD4\xFB" => "\xE6\x87\xB6", + "\xD4\xFC" => "\xEF\xA5\x9B", + "\xD4\xFD" => "\xE7\x99\xA9", + "\xD4\xFE" => "\xE7\xBE\x85", + "\xD5\xA1" => "\xE8\x98\xBF", + "\xD5\xA2" => "\xE8\x9E\xBA", + "\xD5\xA3" => "\xE8\xA3\xB8", + "\xD5\xA4" => "\xE9\x82\x8F", + "\xD5\xA5" => "\xEF\xA5\x9C", + "\xD5\xA6" => "\xE6\xB4\x9B", + "\xD5\xA7" => "\xE7\x83\x99", + "\xD5\xA8" => "\xE7\x8F\x9E", + "\xD5\xA9" => "\xE7\xB5\xA1", + "\xD5\xAA" => "\xE8\x90\xBD", + "\xD5\xAB" => "\xEF\xA5\x9D", + "\xD5\xAC" => "\xE9\x85\xAA", + "\xD5\xAD" => "\xE9\xA7\xB1", + "\xD5\xAE" => "\xEF\xA5\x9E", + "\xD5\xAF" => "\xE4\xBA\x82", + "\xD5\xB0" => "\xE5\x8D\xB5", + "\xD5\xB1" => "\xE6\xAC\x84", + "\xD5\xB2" => "\xE6\xAC\x92", + "\xD5\xB3" => "\xE7\x80\xBE", + "\xD5\xB4" => "\xE7\x88\x9B", + "\xD5\xB5" => "\xE8\x98\xAD", + "\xD5\xB6" => "\xE9\xB8\x9E", + "\xD5\xB7" => "\xE5\x89\x8C", + "\xD5\xB8" => "\xE8\xBE\xA3", + "\xD5\xB9" => "\xE5\xB5\x90", + "\xD5\xBA" => "\xE6\x93\xA5", + "\xD5\xBB" => "\xE6\x94\xAC", + "\xD5\xBC" => "\xE6\xAC\x96", + "\xD5\xBD" => "\xE6\xBF\xAB", + "\xD5\xBE" => "\xE7\xB1\x83", + "\xD5\xBF" => "\xE7\xBA\x9C", + "\xD5\xC0" => "\xE8\x97\x8D", + "\xD5\xC1" => "\xE8\xA5\xA4", + "\xD5\xC2" => "\xE8\xA6\xBD", + "\xD5\xC3" => "\xE6\x8B\x89", + "\xD5\xC4" => "\xE8\x87\x98", + "\xD5\xC5" => "\xE8\xA0\x9F", + "\xD5\xC6" => "\xE5\xBB\x8A", + "\xD5\xC7" => "\xE6\x9C\x97", + "\xD5\xC8" => "\xE6\xB5\xAA", + "\xD5\xC9" => "\xE7\x8B\xBC", + "\xD5\xCA" => "\xE7\x90\x85", + "\xD5\xCB" => "\xE7\x91\xAF", + "\xD5\xCC" => "\xE8\x9E\x82", + "\xD5\xCD" => "\xE9\x83\x9E", + "\xD5\xCE" => "\xE4\xBE\x86", + "\xD5\xCF" => "\xE5\xB4\x8D", + "\xD5\xD0" => "\xE5\xBE\xA0", + "\xD5\xD1" => "\xE8\x90\x8A", + "\xD5\xD2" => "\xE5\x86\xB7", + "\xD5\xD3" => "\xE6\x8E\xA0", + "\xD5\xD4" => "\xE7\x95\xA5", + "\xD5\xD5" => "\xE4\xBA\xAE", + "\xD5\xD6" => "\xE5\x80\x86", + "\xD5\xD7" => "\xE5\x85\xA9", + "\xD5\xD8" => "\xE5\x87\x89", + "\xD5\xD9" => "\xE6\xA2\x81", + "\xD5\xDA" => "\xE6\xA8\x91", + "\xD5\xDB" => "\xE7\xB2\xAE", + "\xD5\xDC" => "\xE7\xB2\xB1", + "\xD5\xDD" => "\xE7\xB3\xA7", + "\xD5\xDE" => "\xE8\x89\xAF", + "\xD5\xDF" => "\xE8\xAB\x92", + "\xD5\xE0" => "\xE8\xBC\x9B", + "\xD5\xE1" => "\xE9\x87\x8F", + "\xD5\xE2" => "\xE4\xBE\xB6", + "\xD5\xE3" => "\xE5\x84\xB7", + "\xD5\xE4" => "\xE5\x8B\xB5", + "\xD5\xE5" => "\xE5\x91\x82", + "\xD5\xE6" => "\xE5\xBB\xAC", + "\xD5\xE7" => "\xE6\x85\xAE", + "\xD5\xE8" => "\xE6\x88\xBE", + "\xD5\xE9" => "\xE6\x97\x85", + "\xD5\xEA" => "\xE6\xAB\x9A", + "\xD5\xEB" => "\xE6\xBF\xBE", + "\xD5\xEC" => "\xE7\xA4\xAA", + "\xD5\xED" => "\xE8\x97\x9C", + "\xD5\xEE" => "\xE8\xA0\xA3", + "\xD5\xEF" => "\xE9\x96\xAD", + "\xD5\xF0" => "\xE9\xA9\xA2", + "\xD5\xF1" => "\xE9\xA9\xAA", + "\xD5\xF2" => "\xE9\xBA\x97", + "\xD5\xF3" => "\xE9\xBB\x8E", + "\xD5\xF4" => "\xE5\x8A\x9B", + "\xD5\xF5" => "\xE6\x9B\x86", + "\xD5\xF6" => "\xE6\xAD\xB7", + "\xD5\xF7" => "\xE7\x80\x9D", + "\xD5\xF8" => "\xE7\xA4\xAB", + "\xD5\xF9" => "\xE8\xBD\xA2", + "\xD5\xFA" => "\xE9\x9D\x82", + "\xD5\xFB" => "\xE6\x86\x90", + "\xD5\xFC" => "\xE6\x88\x80", + "\xD5\xFD" => "\xE6\x94\xA3", + "\xD5\xFE" => "\xE6\xBC\xA3", + "\xD6\xA1" => "\xE7\x85\x89", + "\xD6\xA2" => "\xE7\x92\x89", + "\xD6\xA3" => "\xE7\xB7\xB4", + "\xD6\xA4" => "\xE8\x81\xAF", + "\xD6\xA5" => "\xE8\x93\xAE", + "\xD6\xA6" => "\xE8\xBC\xA6", + "\xD6\xA7" => "\xE9\x80\xA3", + "\xD6\xA8" => "\xE9\x8D\x8A", + "\xD6\xA9" => "\xE5\x86\xBD", + "\xD6\xAA" => "\xE5\x88\x97", + "\xD6\xAB" => "\xE5\x8A\xA3", + "\xD6\xAC" => "\xE6\xB4\x8C", + "\xD6\xAD" => "\xE7\x83\x88", + "\xD6\xAE" => "\xE8\xA3\x82", + "\xD6\xAF" => "\xE5\xBB\x89", + "\xD6\xB0" => "\xE6\x96\x82", + "\xD6\xB1" => "\xE6\xAE\xAE", + "\xD6\xB2" => "\xE6\xBF\x82", + "\xD6\xB3" => "\xE7\xB0\xBE", + "\xD6\xB4" => "\xE7\x8D\xB5", + "\xD6\xB5" => "\xE4\xBB\xA4", + "\xD6\xB6" => "\xE4\xBC\xB6", + "\xD6\xB7" => "\xE5\x9B\xB9", + "\xD6\xB8" => "\xEF\xA5\x9F", + "\xD6\xB9" => "\xE5\xB2\xBA", + "\xD6\xBA" => "\xE5\xB6\xBA", + "\xD6\xBB" => "\xE6\x80\x9C", + "\xD6\xBC" => "\xE7\x8E\xB2", + "\xD6\xBD" => "\xE7\xAC\xAD", + "\xD6\xBE" => "\xE7\xBE\x9A", + "\xD6\xBF" => "\xE7\xBF\x8E", + "\xD6\xC0" => "\xE8\x81\x86", + "\xD6\xC1" => "\xE9\x80\x9E", + "\xD6\xC2" => "\xE9\x88\xB4", + "\xD6\xC3" => "\xE9\x9B\xB6", + "\xD6\xC4" => "\xE9\x9D\x88", + "\xD6\xC5" => "\xE9\xA0\x98", + "\xD6\xC6" => "\xE9\xBD\xA1", + "\xD6\xC7" => "\xE4\xBE\x8B", + "\xD6\xC8" => "\xE6\xBE\xA7", + "\xD6\xC9" => "\xE7\xA6\xAE", + "\xD6\xCA" => "\xE9\x86\xB4", + "\xD6\xCB" => "\xE9\x9A\xB7", + "\xD6\xCC" => "\xE5\x8B\x9E", + "\xD6\xCD" => "\xEF\xA5\xA0", + "\xD6\xCE" => "\xE6\x92\x88", + "\xD6\xCF" => "\xE6\x93\x84", + "\xD6\xD0" => "\xE6\xAB\x93", + "\xD6\xD1" => "\xE6\xBD\x9E", + "\xD6\xD2" => "\xE7\x80\x98", + "\xD6\xD3" => "\xE7\x88\x90", + "\xD6\xD4" => "\xE7\x9B\xA7", + "\xD6\xD5" => "\xE8\x80\x81", + "\xD6\xD6" => "\xE8\x98\x86", + "\xD6\xD7" => "\xE8\x99\x9C", + "\xD6\xD8" => "\xE8\xB7\xAF", + "\xD6\xD9" => "\xE8\xBC\x85", + "\xD6\xDA" => "\xE9\x9C\xB2", + "\xD6\xDB" => "\xE9\xAD\xAF", + "\xD6\xDC" => "\xE9\xB7\xBA", + "\xD6\xDD" => "\xE9\xB9\xB5", + "\xD6\xDE" => "\xE7\xA2\x8C", + "\xD6\xDF" => "\xE7\xA5\xBF", + "\xD6\xE0" => "\xE7\xB6\xA0", + "\xD6\xE1" => "\xE8\x8F\x89", + "\xD6\xE2" => "\xE9\x8C\x84", + "\xD6\xE3" => "\xE9\xB9\xBF", + "\xD6\xE4" => "\xE9\xBA\x93", + "\xD6\xE5" => "\xE8\xAB\x96", + "\xD6\xE6" => "\xE5\xA3\x9F", + "\xD6\xE7" => "\xE5\xBC\x84", + "\xD6\xE8" => "\xE6\x9C\xA7", + "\xD6\xE9" => "\xE7\x80\xA7", + "\xD6\xEA" => "\xE7\x93\x8F", + "\xD6\xEB" => "\xE7\xB1\xA0", + "\xD6\xEC" => "\xE8\x81\xBE", + "\xD6\xED" => "\xE5\x84\xA1", + "\xD6\xEE" => "\xE7\x80\xA8", + "\xD6\xEF" => "\xE7\x89\xA2", + "\xD6\xF0" => "\xE7\xA3\x8A", + "\xD6\xF1" => "\xE8\xB3\x82", + "\xD6\xF2" => "\xE8\xB3\x9A", + "\xD6\xF3" => "\xE8\xB3\xB4", + "\xD6\xF4" => "\xE9\x9B\xB7", + "\xD6\xF5" => "\xE4\xBA\x86", + "\xD6\xF6" => "\xE5\x83\x9A", + "\xD6\xF7" => "\xE5\xAF\xAE", + "\xD6\xF8" => "\xE5\xBB\x96", + "\xD6\xF9" => "\xE6\x96\x99", + "\xD6\xFA" => "\xE7\x87\x8E", + "\xD6\xFB" => "\xE7\x99\x82", + "\xD6\xFC" => "\xE7\x9E\xAD", + "\xD6\xFD" => "\xE8\x81\x8A", + "\xD6\xFE" => "\xE8\x93\xBC", + "\xD7\xA1" => "\xE9\x81\xBC", + "\xD7\xA2" => "\xE9\xAC\xA7", + "\xD7\xA3" => "\xE9\xBE\x8D", + "\xD7\xA4" => "\xE5\xA3\x98", + "\xD7\xA5" => "\xE5\xA9\x81", + "\xD7\xA6" => "\xE5\xB1\xA2", + "\xD7\xA7" => "\xE6\xA8\x93", + "\xD7\xA8" => "\xE6\xB7\x9A", + "\xD7\xA9" => "\xE6\xBC\x8F", + "\xD7\xAA" => "\xE7\x98\xBB", + "\xD7\xAB" => "\xE7\xB4\xAF", + "\xD7\xAC" => "\xE7\xB8\xB7", + "\xD7\xAD" => "\xE8\x94\x9E", + "\xD7\xAE" => "\xE8\xA4\xB8", + "\xD7\xAF" => "\xE9\x8F\xA4", + "\xD7\xB0" => "\xE9\x99\x8B", + "\xD7\xB1" => "\xE5\x8A\x89", + "\xD7\xB2" => "\xE6\x97\x92", + "\xD7\xB3" => "\xE6\x9F\xB3", + "\xD7\xB4" => "\xE6\xA6\xB4", + "\xD7\xB5" => "\xE6\xB5\x81", + "\xD7\xB6" => "\xE6\xBA\x9C", + "\xD7\xB7" => "\xE7\x80\x8F", + "\xD7\xB8" => "\xE7\x90\x89", + "\xD7\xB9" => "\xE7\x91\xA0", + "\xD7\xBA" => "\xE7\x95\x99", + "\xD7\xBB" => "\xE7\x98\xA4", + "\xD7\xBC" => "\xE7\xA1\xAB", + "\xD7\xBD" => "\xE8\xAC\xAC", + "\xD7\xBE" => "\xE9\xA1\x9E", + "\xD7\xBF" => "\xE5\x85\xAD", + "\xD7\xC0" => "\xE6\x88\xAE", + "\xD7\xC1" => "\xE9\x99\xB8", + "\xD7\xC2" => "\xE4\xBE\x96", + "\xD7\xC3" => "\xE5\x80\xAB", + "\xD7\xC4" => "\xE5\xB4\x99", + "\xD7\xC5" => "\xE6\xB7\xAA", + "\xD7\xC6" => "\xE7\xB6\xB8", + "\xD7\xC7" => "\xE8\xBC\xAA", + "\xD7\xC8" => "\xE5\xBE\x8B", + "\xD7\xC9" => "\xE6\x85\x84", + "\xD7\xCA" => "\xE6\xA0\x97", + "\xD7\xCB" => "\xEF\xA5\xA1", + "\xD7\xCC" => "\xE9\x9A\x86", + "\xD7\xCD" => "\xE5\x8B\x92", + "\xD7\xCE" => "\xE8\x82\x8B", + "\xD7\xCF" => "\xE5\x87\x9C", + "\xD7\xD0" => "\xE5\x87\x8C", + "\xD7\xD1" => "\xE6\xA5\x9E", + "\xD7\xD2" => "\xE7\xA8\x9C", + "\xD7\xD3" => "\xE7\xB6\xBE", + "\xD7\xD4" => "\xE8\x8F\xB1", + "\xD7\xD5" => "\xE9\x99\xB5", + "\xD7\xD6" => "\xE4\xBF\x9A", + "\xD7\xD7" => "\xE5\x88\xA9", + "\xD7\xD8" => "\xE5\x8E\x98", + "\xD7\xD9" => "\xE5\x90\x8F", + "\xD7\xDA" => "\xE5\x94\x8E", + "\xD7\xDB" => "\xE5\xB1\xA5", + "\xD7\xDC" => "\xE6\x82\xA7", + "\xD7\xDD" => "\xE6\x9D\x8E", + "\xD7\xDE" => "\xE6\xA2\xA8", + "\xD7\xDF" => "\xE6\xB5\xAC", + "\xD7\xE0" => "\xE7\x8A\x81", + "\xD7\xE1" => "\xE7\x8B\xB8", + "\xD7\xE2" => "\xE7\x90\x86", + "\xD7\xE3" => "\xE7\x92\x83", + "\xD7\xE4" => "\xEF\xA5\xA2", + "\xD7\xE5" => "\xE7\x97\xA2", + "\xD7\xE6" => "\xE7\xB1\xAC", + "\xD7\xE7" => "\xE7\xBD\xB9", + "\xD7\xE8" => "\xE7\xBE\xB8", + "\xD7\xE9" => "\xE8\x8E\x89", + "\xD7\xEA" => "\xE8\xA3\x8F", + "\xD7\xEB" => "\xE8\xA3\xA1", + "\xD7\xEC" => "\xE9\x87\x8C", + "\xD7\xED" => "\xE9\x87\x90", + "\xD7\xEE" => "\xE9\x9B\xA2", + "\xD7\xEF" => "\xE9\xAF\x89", + "\xD7\xF0" => "\xE5\x90\x9D", + "\xD7\xF1" => "\xE6\xBD\xBE", + "\xD7\xF2" => "\xE7\x87\x90", + "\xD7\xF3" => "\xE7\x92\x98", + "\xD7\xF4" => "\xE8\x97\xBA", + "\xD7\xF5" => "\xE8\xBA\xAA", + "\xD7\xF6" => "\xE9\x9A\xA3", + "\xD7\xF7" => "\xE9\xB1\x97", + "\xD7\xF8" => "\xE9\xBA\x9F", + "\xD7\xF9" => "\xE6\x9E\x97", + "\xD7\xFA" => "\xE6\xB7\x8B", + "\xD7\xFB" => "\xE7\x90\xB3", + "\xD7\xFC" => "\xE8\x87\xA8", + "\xD7\xFD" => "\xE9\x9C\x96", + "\xD7\xFE" => "\xE7\xA0\xAC", + "\xD8\xA1" => "\xE7\xAB\x8B", + "\xD8\xA2" => "\xE7\xAC\xA0", + "\xD8\xA3" => "\xE7\xB2\x92", + "\xD8\xA4" => "\xE6\x91\xA9", + "\xD8\xA5" => "\xE7\x91\xAA", + "\xD8\xA6" => "\xE7\x97\xB2", + "\xD8\xA7" => "\xE7\xA2\xBC", + "\xD8\xA8" => "\xE7\xA3\xA8", + "\xD8\xA9" => "\xE9\xA6\xAC", + "\xD8\xAA" => "\xE9\xAD\x94", + "\xD8\xAB" => "\xE9\xBA\xBB", + "\xD8\xAC" => "\xE5\xAF\x9E", + "\xD8\xAD" => "\xE5\xB9\x95", + "\xD8\xAE" => "\xE6\xBC\xA0", + "\xD8\xAF" => "\xE8\x86\x9C", + "\xD8\xB0" => "\xE8\x8E\xAB", + "\xD8\xB1" => "\xE9\x82\x88", + "\xD8\xB2" => "\xE4\xB8\x87", + "\xD8\xB3" => "\xE5\x8D\x8D", + "\xD8\xB4" => "\xE5\xA8\xA9", + "\xD8\xB5" => "\xE5\xB7\x92", + "\xD8\xB6" => "\xE5\xBD\x8E", + "\xD8\xB7" => "\xE6\x85\xA2", + "\xD8\xB8" => "\xE6\x8C\xBD", + "\xD8\xB9" => "\xE6\x99\xA9", + "\xD8\xBA" => "\xE6\x9B\xBC", + "\xD8\xBB" => "\xE6\xBB\xBF", + "\xD8\xBC" => "\xE6\xBC\xAB", + "\xD8\xBD" => "\xE7\x81\xA3", + "\xD8\xBE" => "\xE7\x9E\x9E", + "\xD8\xBF" => "\xE8\x90\xAC", + "\xD8\xC0" => "\xE8\x94\x93", + "\xD8\xC1" => "\xE8\xA0\xBB", + "\xD8\xC2" => "\xE8\xBC\x93", + "\xD8\xC3" => "\xE9\xA5\x85", + "\xD8\xC4" => "\xE9\xB0\xBB", + "\xD8\xC5" => "\xE5\x94\x9C", + "\xD8\xC6" => "\xE6\x8A\xB9", + "\xD8\xC7" => "\xE6\x9C\xAB", + "\xD8\xC8" => "\xE6\xB2\xAB", + "\xD8\xC9" => "\xE8\x8C\x89", + "\xD8\xCA" => "\xE8\xA5\xAA", + "\xD8\xCB" => "\xE9\x9D\xBA", + "\xD8\xCC" => "\xE4\xBA\xA1", + "\xD8\xCD" => "\xE5\xA6\x84", + "\xD8\xCE" => "\xE5\xBF\x98", + "\xD8\xCF" => "\xE5\xBF\x99", + "\xD8\xD0" => "\xE6\x9C\x9B", + "\xD8\xD1" => "\xE7\xB6\xB2", + "\xD8\xD2" => "\xE7\xBD\x94", + "\xD8\xD3" => "\xE8\x8A\x92", + "\xD8\xD4" => "\xE8\x8C\xAB", + "\xD8\xD5" => "\xE8\x8E\xBD", + "\xD8\xD6" => "\xE8\xBC\x9E", + "\xD8\xD7" => "\xE9\x82\x99", + "\xD8\xD8" => "\xE5\x9F\x8B", + "\xD8\xD9" => "\xE5\xA6\xB9", + "\xD8\xDA" => "\xE5\xAA\x92", + "\xD8\xDB" => "\xE5\xAF\x90", + "\xD8\xDC" => "\xE6\x98\xA7", + "\xD8\xDD" => "\xE6\x9E\x9A", + "\xD8\xDE" => "\xE6\xA2\x85", + "\xD8\xDF" => "\xE6\xAF\x8F", + "\xD8\xE0" => "\xE7\x85\xA4", + "\xD8\xE1" => "\xE7\xBD\xB5", + "\xD8\xE2" => "\xE8\xB2\xB7", + "\xD8\xE3" => "\xE8\xB3\xA3", + "\xD8\xE4" => "\xE9\x82\x81", + "\xD8\xE5" => "\xE9\xAD\x85", + "\xD8\xE6" => "\xE8\x84\x88", + "\xD8\xE7" => "\xE8\xB2\x8A", + "\xD8\xE8" => "\xE9\x99\x8C", + "\xD8\xE9" => "\xE9\xA9\x80", + "\xD8\xEA" => "\xE9\xBA\xA5", + "\xD8\xEB" => "\xE5\xAD\x9F", + "\xD8\xEC" => "\xE6\xB0\x93", + "\xD8\xED" => "\xE7\x8C\x9B", + "\xD8\xEE" => "\xE7\x9B\xB2", + "\xD8\xEF" => "\xE7\x9B\x9F", + "\xD8\xF0" => "\xE8\x90\x8C", + "\xD8\xF1" => "\xE5\x86\xAA", + "\xD8\xF2" => "\xE8\xA6\x93", + "\xD8\xF3" => "\xE5\x85\x8D", + "\xD8\xF4" => "\xE5\x86\x95", + "\xD8\xF5" => "\xE5\x8B\x89", + "\xD8\xF6" => "\xE6\xA3\x89", + "\xD8\xF7" => "\xE6\xB2\x94", + "\xD8\xF8" => "\xE7\x9C\x84", + "\xD8\xF9" => "\xE7\x9C\xA0", + "\xD8\xFA" => "\xE7\xB6\xBF", + "\xD8\xFB" => "\xE7\xB7\xAC", + "\xD8\xFC" => "\xE9\x9D\xA2", + "\xD8\xFD" => "\xE9\xBA\xB5", + "\xD8\xFE" => "\xE6\xBB\x85", + "\xD9\xA1" => "\xE8\x94\x91", + "\xD9\xA2" => "\xE5\x86\xA5", + "\xD9\xA3" => "\xE5\x90\x8D", + "\xD9\xA4" => "\xE5\x91\xBD", + "\xD9\xA5" => "\xE6\x98\x8E", + "\xD9\xA6" => "\xE6\x9A\x9D", + "\xD9\xA7" => "\xE6\xA4\xA7", + "\xD9\xA8" => "\xE6\xBA\x9F", + "\xD9\xA9" => "\xE7\x9A\xBF", + "\xD9\xAA" => "\xE7\x9E\x91", + "\xD9\xAB" => "\xE8\x8C\x97", + "\xD9\xAC" => "\xE8\x93\x82", + "\xD9\xAD" => "\xE8\x9E\x9F", + "\xD9\xAE" => "\xE9\x85\xA9", + "\xD9\xAF" => "\xE9\x8A\x98", + "\xD9\xB0" => "\xE9\xB3\xB4", + "\xD9\xB1" => "\xE8\xA2\x82", + "\xD9\xB2" => "\xE4\xBE\xAE", + "\xD9\xB3" => "\xE5\x86\x92", + "\xD9\xB4" => "\xE5\x8B\x9F", + "\xD9\xB5" => "\xE5\xA7\x86", + "\xD9\xB6" => "\xE5\xB8\xBD", + "\xD9\xB7" => "\xE6\x85\x95", + "\xD9\xB8" => "\xE6\x91\xB8", + "\xD9\xB9" => "\xE6\x91\xB9", + "\xD9\xBA" => "\xE6\x9A\xAE", + "\xD9\xBB" => "\xE6\x9F\x90", + "\xD9\xBC" => "\xE6\xA8\xA1", + "\xD9\xBD" => "\xE6\xAF\x8D", + "\xD9\xBE" => "\xE6\xAF\x9B", + "\xD9\xBF" => "\xE7\x89\x9F", + "\xD9\xC0" => "\xE7\x89\xA1", + "\xD9\xC1" => "\xE7\x91\x81", + "\xD9\xC2" => "\xE7\x9C\xB8", + "\xD9\xC3" => "\xE7\x9F\x9B", + "\xD9\xC4" => "\xE8\x80\x97", + "\xD9\xC5" => "\xE8\x8A\xBC", + "\xD9\xC6" => "\xE8\x8C\x85", + "\xD9\xC7" => "\xE8\xAC\x80", + "\xD9\xC8" => "\xE8\xAC\xA8", + "\xD9\xC9" => "\xE8\xB2\x8C", + "\xD9\xCA" => "\xE6\x9C\xA8", + "\xD9\xCB" => "\xE6\xB2\x90", + "\xD9\xCC" => "\xE7\x89\xA7", + "\xD9\xCD" => "\xE7\x9B\xAE", + "\xD9\xCE" => "\xE7\x9D\xA6", + "\xD9\xCF" => "\xE7\xA9\x86", + "\xD9\xD0" => "\xE9\xB6\xA9", + "\xD9\xD1" => "\xE6\xAD\xBF", + "\xD9\xD2" => "\xE6\xB2\x92", + "\xD9\xD3" => "\xE5\xA4\xA2", + "\xD9\xD4" => "\xE6\x9C\xA6", + "\xD9\xD5" => "\xE8\x92\x99", + "\xD9\xD6" => "\xE5\x8D\xAF", + "\xD9\xD7" => "\xE5\xA2\x93", + "\xD9\xD8" => "\xE5\xA6\x99", + "\xD9\xD9" => "\xE5\xBB\x9F", + "\xD9\xDA" => "\xE6\x8F\x8F", + "\xD9\xDB" => "\xE6\x98\xB4", + "\xD9\xDC" => "\xE6\x9D\xB3", + "\xD9\xDD" => "\xE6\xB8\xBA", + "\xD9\xDE" => "\xE7\x8C\xAB", + "\xD9\xDF" => "\xE7\xAB\x97", + "\xD9\xE0" => "\xE8\x8B\x97", + "\xD9\xE1" => "\xE9\x8C\xA8", + "\xD9\xE2" => "\xE5\x8B\x99", + "\xD9\xE3" => "\xE5\xB7\xAB", + "\xD9\xE4" => "\xE6\x86\xAE", + "\xD9\xE5" => "\xE6\x87\x8B", + "\xD9\xE6" => "\xE6\x88\x8A", + "\xD9\xE7" => "\xE6\x8B\x87", + "\xD9\xE8" => "\xE6\x92\xAB", + "\xD9\xE9" => "\xE6\x97\xA0", + "\xD9\xEA" => "\xE6\xA5\x99", + "\xD9\xEB" => "\xE6\xAD\xA6", + "\xD9\xEC" => "\xE6\xAF\x8B", + "\xD9\xED" => "\xE7\x84\xA1", + "\xD9\xEE" => "\xE7\x8F\xB7", + "\xD9\xEF" => "\xE7\x95\x9D", + "\xD9\xF0" => "\xE7\xB9\x86", + "\xD9\xF1" => "\xE8\x88\x9E", + "\xD9\xF2" => "\xE8\x8C\x82", + "\xD9\xF3" => "\xE8\x95\xAA", + "\xD9\xF4" => "\xE8\xAA\xA3", + "\xD9\xF5" => "\xE8\xB2\xBF", + "\xD9\xF6" => "\xE9\x9C\xA7", + "\xD9\xF7" => "\xE9\xB5\xA1", + "\xD9\xF8" => "\xE5\xA2\xA8", + "\xD9\xF9" => "\xE9\xBB\x98", + "\xD9\xFA" => "\xE5\x80\x91", + "\xD9\xFB" => "\xE5\x88\x8E", + "\xD9\xFC" => "\xE5\x90\xBB", + "\xD9\xFD" => "\xE5\x95\x8F", + "\xD9\xFE" => "\xE6\x96\x87", + "\xDA\xA1" => "\xE6\xB1\xB6", + "\xDA\xA2" => "\xE7\xB4\x8A", + "\xDA\xA3" => "\xE7\xB4\x8B", + "\xDA\xA4" => "\xE8\x81\x9E", + "\xDA\xA5" => "\xE8\x9A\x8A", + "\xDA\xA6" => "\xE9\x96\x80", + "\xDA\xA7" => "\xE9\x9B\xAF", + "\xDA\xA8" => "\xE5\x8B\xBF", + "\xDA\xA9" => "\xE6\xB2\x95", + "\xDA\xAA" => "\xE7\x89\xA9", + "\xDA\xAB" => "\xE5\x91\xB3", + "\xDA\xAC" => "\xE5\xAA\x9A", + "\xDA\xAD" => "\xE5\xB0\xBE", + "\xDA\xAE" => "\xE5\xB5\x8B", + "\xDA\xAF" => "\xE5\xBD\x8C", + "\xDA\xB0" => "\xE5\xBE\xAE", + "\xDA\xB1" => "\xE6\x9C\xAA", + "\xDA\xB2" => "\xE6\xA2\xB6", + "\xDA\xB3" => "\xE6\xA5\xA3", + "\xDA\xB4" => "\xE6\xB8\xBC", + "\xDA\xB5" => "\xE6\xB9\x84", + "\xDA\xB6" => "\xE7\x9C\x89", + "\xDA\xB7" => "\xE7\xB1\xB3", + "\xDA\xB8" => "\xE7\xBE\x8E", + "\xDA\xB9" => "\xE8\x96\x87", + "\xDA\xBA" => "\xE8\xAC\x8E", + "\xDA\xBB" => "\xE8\xBF\xB7", + "\xDA\xBC" => "\xE9\x9D\xA1", + "\xDA\xBD" => "\xE9\xBB\xB4", + "\xDA\xBE" => "\xE5\xB2\xB7", + "\xDA\xBF" => "\xE6\x82\xB6", + "\xDA\xC0" => "\xE6\x84\x8D", + "\xDA\xC1" => "\xE6\x86\xAB", + "\xDA\xC2" => "\xE6\x95\x8F", + "\xDA\xC3" => "\xE6\x97\xBB", + "\xDA\xC4" => "\xE6\x97\xBC", + "\xDA\xC5" => "\xE6\xB0\x91", + "\xDA\xC6" => "\xE6\xB3\xAF", + "\xDA\xC7" => "\xE7\x8E\x9F", + "\xDA\xC8" => "\xE7\x8F\x89", + "\xDA\xC9" => "\xE7\xB7\xA1", + "\xDA\xCA" => "\xE9\x96\x94", + "\xDA\xCB" => "\xE5\xAF\x86", + "\xDA\xCC" => "\xE8\x9C\x9C", + "\xDA\xCD" => "\xE8\xAC\x90", + "\xDA\xCE" => "\xE5\x89\x9D", + "\xDA\xCF" => "\xE5\x8D\x9A", + "\xDA\xD0" => "\xE6\x8B\x8D", + "\xDA\xD1" => "\xE6\x90\x8F", + "\xDA\xD2" => "\xE6\x92\xB2", + "\xDA\xD3" => "\xE6\x9C\xB4", + "\xDA\xD4" => "\xE6\xA8\xB8", + "\xDA\xD5" => "\xE6\xB3\x8A", + "\xDA\xD6" => "\xE7\x8F\x80", + "\xDA\xD7" => "\xE7\x92\x9E", + "\xDA\xD8" => "\xE7\xAE\x94", + "\xDA\xD9" => "\xE7\xB2\x95", + "\xDA\xDA" => "\xE7\xB8\x9B", + "\xDA\xDB" => "\xE8\x86\x8A", + "\xDA\xDC" => "\xE8\x88\xB6", + "\xDA\xDD" => "\xE8\x96\x84", + "\xDA\xDE" => "\xE8\xBF\xAB", + "\xDA\xDF" => "\xE9\x9B\xB9", + "\xDA\xE0" => "\xE9\xA7\x81", + "\xDA\xE1" => "\xE4\xBC\xB4", + "\xDA\xE2" => "\xE5\x8D\x8A", + "\xDA\xE3" => "\xE5\x8F\x8D", + "\xDA\xE4" => "\xE5\x8F\x9B", + "\xDA\xE5" => "\xE6\x8B\x8C", + "\xDA\xE6" => "\xE6\x90\xAC", + "\xDA\xE7" => "\xE6\x94\x80", + "\xDA\xE8" => "\xE6\x96\x91", + "\xDA\xE9" => "\xE6\xA7\x83", + "\xDA\xEA" => "\xE6\xB3\xAE", + "\xDA\xEB" => "\xE6\xBD\x98", + "\xDA\xEC" => "\xE7\x8F\xAD", + "\xDA\xED" => "\xE7\x95\x94", + "\xDA\xEE" => "\xE7\x98\xA2", + "\xDA\xEF" => "\xE7\x9B\xA4", + "\xDA\xF0" => "\xE7\x9B\xBC", + "\xDA\xF1" => "\xE7\xA3\x90", + "\xDA\xF2" => "\xE7\xA3\xBB", + "\xDA\xF3" => "\xE7\xA4\xAC", + "\xDA\xF4" => "\xE7\xB5\x86", + "\xDA\xF5" => "\xE8\x88\xAC", + "\xDA\xF6" => "\xE8\x9F\xA0", + "\xDA\xF7" => "\xE8\xBF\x94", + "\xDA\xF8" => "\xE9\xA0\x92", + "\xDA\xF9" => "\xE9\xA3\xAF", + "\xDA\xFA" => "\xE5\x8B\x83", + "\xDA\xFB" => "\xE6\x8B\x94", + "\xDA\xFC" => "\xE6\x92\xA5", + "\xDA\xFD" => "\xE6\xB8\xA4", + "\xDA\xFE" => "\xE6\xBD\x91", + "\xDB\xA1" => "\xE7\x99\xBC", + "\xDB\xA2" => "\xE8\xB7\x8B", + "\xDB\xA3" => "\xE9\x86\xB1", + "\xDB\xA4" => "\xE9\x89\xA2", + "\xDB\xA5" => "\xE9\xAB\xAE", + "\xDB\xA6" => "\xE9\xAD\x83", + "\xDB\xA7" => "\xE5\x80\xA3", + "\xDB\xA8" => "\xE5\x82\x8D", + "\xDB\xA9" => "\xE5\x9D\x8A", + "\xDB\xAA" => "\xE5\xA6\xA8", + "\xDB\xAB" => "\xE5\xB0\xA8", + "\xDB\xAC" => "\xE5\xB9\x87", + "\xDB\xAD" => "\xE5\xBD\xB7", + "\xDB\xAE" => "\xE6\x88\xBF", + "\xDB\xAF" => "\xE6\x94\xBE", + "\xDB\xB0" => "\xE6\x96\xB9", + "\xDB\xB1" => "\xE6\x97\x81", + "\xDB\xB2" => "\xE6\x98\x89", + "\xDB\xB3" => "\xE6\x9E\x8B", + "\xDB\xB4" => "\xE6\xA6\x9C", + "\xDB\xB5" => "\xE6\xBB\x82", + "\xDB\xB6" => "\xE7\xA3\x85", + "\xDB\xB7" => "\xE7\xB4\xA1", + "\xDB\xB8" => "\xE8\x82\xAA", + "\xDB\xB9" => "\xE8\x86\x80", + "\xDB\xBA" => "\xE8\x88\xAB", + "\xDB\xBB" => "\xE8\x8A\xB3", + "\xDB\xBC" => "\xE8\x92\xA1", + "\xDB\xBD" => "\xE8\x9A\x8C", + "\xDB\xBE" => "\xE8\xA8\xAA", + "\xDB\xBF" => "\xE8\xAC\x97", + "\xDB\xC0" => "\xE9\x82\xA6", + "\xDB\xC1" => "\xE9\x98\xB2", + "\xDB\xC2" => "\xE9\xBE\x90", + "\xDB\xC3" => "\xE5\x80\x8D", + "\xDB\xC4" => "\xE4\xBF\xB3", + "\xDB\xC5" => "\xEF\xA5\xA3", + "\xDB\xC6" => "\xE5\x9F\xB9", + "\xDB\xC7" => "\xE5\xBE\x98", + "\xDB\xC8" => "\xE6\x8B\x9C", + "\xDB\xC9" => "\xE6\x8E\x92", + "\xDB\xCA" => "\xE6\x9D\xAF", + "\xDB\xCB" => "\xE6\xB9\x83", + "\xDB\xCC" => "\xE7\x84\x99", + "\xDB\xCD" => "\xE7\x9B\x83", + "\xDB\xCE" => "\xE8\x83\x8C", + "\xDB\xCF" => "\xE8\x83\x9A", + "\xDB\xD0" => "\xE8\xA3\xB4", + "\xDB\xD1" => "\xE8\xA3\xB5", + "\xDB\xD2" => "\xE8\xA4\x99", + "\xDB\xD3" => "\xE8\xB3\xA0", + "\xDB\xD4" => "\xE8\xBC\xA9", + "\xDB\xD5" => "\xE9\x85\x8D", + "\xDB\xD6" => "\xE9\x99\xAA", + "\xDB\xD7" => "\xE4\xBC\xAF", + "\xDB\xD8" => "\xE4\xBD\xB0", + "\xDB\xD9" => "\xE5\xB8\x9B", + "\xDB\xDA" => "\xE6\x9F\x8F", + "\xDB\xDB" => "\xE6\xA0\xA2", + "\xDB\xDC" => "\xE7\x99\xBD", + "\xDB\xDD" => "\xE7\x99\xBE", + "\xDB\xDE" => "\xE9\xAD\x84", + "\xDB\xDF" => "\xE5\xB9\xA1", + "\xDB\xE0" => "\xE6\xA8\x8A", + "\xDB\xE1" => "\xE7\x85\xA9", + "\xDB\xE2" => "\xE7\x87\x94", + "\xDB\xE3" => "\xE7\x95\xAA", + "\xDB\xE4" => "\xEF\xA5\xA4", + "\xDB\xE5" => "\xE7\xB9\x81", + "\xDB\xE6" => "\xE8\x95\x83", + "\xDB\xE7" => "\xE8\x97\xA9", + "\xDB\xE8" => "\xE9\xA3\x9C", + "\xDB\xE9" => "\xE4\xBC\x90", + "\xDB\xEA" => "\xE7\xAD\x8F", + "\xDB\xEB" => "\xE7\xBD\xB0", + "\xDB\xEC" => "\xE9\x96\xA5", + "\xDB\xED" => "\xE5\x87\xA1", + "\xDB\xEE" => "\xE5\xB8\x86", + "\xDB\xEF" => "\xE6\xA2\xB5", + "\xDB\xF0" => "\xE6\xB0\xBE", + "\xDB\xF1" => "\xE6\xB1\x8E", + "\xDB\xF2" => "\xE6\xB3\x9B", + "\xDB\xF3" => "\xE7\x8A\xAF", + "\xDB\xF4" => "\xE7\xAF\x84", + "\xDB\xF5" => "\xE8\x8C\x83", + "\xDB\xF6" => "\xE6\xB3\x95", + "\xDB\xF7" => "\xE7\x90\xBA", + "\xDB\xF8" => "\xE5\x83\xBB", + "\xDB\xF9" => "\xE5\x8A\x88", + "\xDB\xFA" => "\xE5\xA3\x81", + "\xDB\xFB" => "\xE6\x93\x98", + "\xDB\xFC" => "\xE6\xAA\x97", + "\xDB\xFD" => "\xE7\x92\xA7", + "\xDB\xFE" => "\xE7\x99\x96", + "\xDC\xA1" => "\xE7\xA2\xA7", + "\xDC\xA2" => "\xE8\x98\x97", + "\xDC\xA3" => "\xE9\x97\xA2", + "\xDC\xA4" => "\xE9\x9C\xB9", + "\xDC\xA5" => "\xEF\xA5\xA5", + "\xDC\xA6" => "\xE5\x8D\x9E", + "\xDC\xA7" => "\xE5\xBC\x81", + "\xDC\xA8" => "\xE8\xAE\x8A", + "\xDC\xA9" => "\xE8\xBE\xA8", + "\xDC\xAA" => "\xE8\xBE\xAF", + "\xDC\xAB" => "\xE9\x82\x8A", + "\xDC\xAC" => "\xE5\x88\xA5", + "\xDC\xAD" => "\xE7\x9E\xA5", + "\xDC\xAE" => "\xE9\xB1\x89", + "\xDC\xAF" => "\xE9\xBC\x88", + "\xDC\xB0" => "\xE4\xB8\x99", + "\xDC\xB1" => "\xE5\x80\x82", + "\xDC\xB2" => "\xE5\x85\xB5", + "\xDC\xB3" => "\xE5\xB1\x9B", + "\xDC\xB4" => "\xE5\xB9\xB7", + "\xDC\xB5" => "\xE6\x98\x9E", + "\xDC\xB6" => "\xE6\x98\xBA", + "\xDC\xB7" => "\xE6\x9F\x84", + "\xDC\xB8" => "\xE6\xA3\x85", + "\xDC\xB9" => "\xE7\x82\xB3", + "\xDC\xBA" => "\xE7\x94\x81", + "\xDC\xBB" => "\xE7\x97\x85", + "\xDC\xBC" => "\xE7\xA7\x89", + "\xDC\xBD" => "\xE7\xAB\x9D", + "\xDC\xBE" => "\xE8\xBC\xA7", + "\xDC\xBF" => "\xE9\xA4\xA0", + "\xDC\xC0" => "\xE9\xA8\x88", + "\xDC\xC1" => "\xE4\xBF\x9D", + "\xDC\xC2" => "\xE5\xA0\xA1", + "\xDC\xC3" => "\xE5\xA0\xB1", + "\xDC\xC4" => "\xE5\xAF\xB6", + "\xDC\xC5" => "\xE6\x99\xAE", + "\xDC\xC6" => "\xE6\xAD\xA5", + "\xDC\xC7" => "\xE6\xB4\x91", + "\xDC\xC8" => "\xE6\xB9\xBA", + "\xDC\xC9" => "\xE6\xBD\xBD", + "\xDC\xCA" => "\xE7\x8F\xA4", + "\xDC\xCB" => "\xE7\x94\xAB", + "\xDC\xCC" => "\xE8\x8F\xA9", + "\xDC\xCD" => "\xE8\xA3\x9C", + "\xDC\xCE" => "\xE8\xA4\x93", + "\xDC\xCF" => "\xE8\xAD\x9C", + "\xDC\xD0" => "\xE8\xBC\x94", + "\xDC\xD1" => "\xE4\xBC\x8F", + "\xDC\xD2" => "\xE5\x83\x95", + "\xDC\xD3" => "\xE5\x8C\x90", + "\xDC\xD4" => "\xE5\x8D\x9C", + "\xDC\xD5" => "\xE5\xAE\x93", + "\xDC\xD6" => "\xE5\xBE\xA9", + "\xDC\xD7" => "\xE6\x9C\x8D", + "\xDC\xD8" => "\xE7\xA6\x8F", + "\xDC\xD9" => "\xE8\x85\xB9", + "\xDC\xDA" => "\xE8\x8C\xAF", + "\xDC\xDB" => "\xE8\x94\x94", + "\xDC\xDC" => "\xE8\xA4\x87", + "\xDC\xDD" => "\xE8\xA6\x86", + "\xDC\xDE" => "\xE8\xBC\xB9", + "\xDC\xDF" => "\xE8\xBC\xBB", + "\xDC\xE0" => "\xE9\xA6\xA5", + "\xDC\xE1" => "\xE9\xB0\x92", + "\xDC\xE2" => "\xE6\x9C\xAC", + "\xDC\xE3" => "\xE4\xB9\xB6", + "\xDC\xE4" => "\xE4\xBF\xB8", + "\xDC\xE5" => "\xE5\xA5\x89", + "\xDC\xE6" => "\xE5\xB0\x81", + "\xDC\xE7" => "\xE5\xB3\xAF", + "\xDC\xE8" => "\xE5\xB3\xB0", + "\xDC\xE9" => "\xE6\x8D\xA7", + "\xDC\xEA" => "\xE6\xA3\x92", + "\xDC\xEB" => "\xE7\x83\xBD", + "\xDC\xEC" => "\xE7\x86\xA2", + "\xDC\xED" => "\xE7\x90\xAB", + "\xDC\xEE" => "\xE7\xB8\xAB", + "\xDC\xEF" => "\xE8\x93\xAC", + "\xDC\xF0" => "\xE8\x9C\x82", + "\xDC\xF1" => "\xE9\x80\xA2", + "\xDC\xF2" => "\xE9\x8B\x92", + "\xDC\xF3" => "\xE9\xB3\xB3", + "\xDC\xF4" => "\xE4\xB8\x8D", + "\xDC\xF5" => "\xE4\xBB\x98", + "\xDC\xF6" => "\xE4\xBF\xAF", + "\xDC\xF7" => "\xE5\x82\x85", + "\xDC\xF8" => "\xE5\x89\x96", + "\xDC\xF9" => "\xE5\x89\xAF", + "\xDC\xFA" => "\xE5\x90\xA6", + "\xDC\xFB" => "\xE5\x92\x90", + "\xDC\xFC" => "\xE5\x9F\xA0", + "\xDC\xFD" => "\xE5\xA4\xAB", + "\xDC\xFE" => "\xE5\xA9\xA6", + "\xDD\xA1" => "\xE5\xAD\x9A", + "\xDD\xA2" => "\xE5\xAD\xB5", + "\xDD\xA3" => "\xE5\xAF\x8C", + "\xDD\xA4" => "\xE5\xBA\x9C", + "\xDD\xA5" => "\xEF\xA5\xA6", + "\xDD\xA6" => "\xE6\x89\xB6", + "\xDD\xA7" => "\xE6\x95\xB7", + "\xDD\xA8" => "\xE6\x96\xA7", + "\xDD\xA9" => "\xE6\xB5\xAE", + "\xDD\xAA" => "\xE6\xBA\xA5", + "\xDD\xAB" => "\xE7\x88\xB6", + "\xDD\xAC" => "\xE7\xAC\xA6", + "\xDD\xAD" => "\xE7\xB0\xBF", + "\xDD\xAE" => "\xE7\xBC\xB6", + "\xDD\xAF" => "\xE8\x85\x90", + "\xDD\xB0" => "\xE8\x85\x91", + "\xDD\xB1" => "\xE8\x86\x9A", + "\xDD\xB2" => "\xE8\x89\x80", + "\xDD\xB3" => "\xE8\x8A\x99", + "\xDD\xB4" => "\xE8\x8E\xA9", + "\xDD\xB5" => "\xE8\xA8\x83", + "\xDD\xB6" => "\xE8\xB2\xA0", + "\xDD\xB7" => "\xE8\xB3\xA6", + "\xDD\xB8" => "\xE8\xB3\xBB", + "\xDD\xB9" => "\xE8\xB5\xB4", + "\xDD\xBA" => "\xE8\xB6\xBA", + "\xDD\xBB" => "\xE9\x83\xA8", + "\xDD\xBC" => "\xE9\x87\x9C", + "\xDD\xBD" => "\xE9\x98\x9C", + "\xDD\xBE" => "\xE9\x99\x84", + "\xDD\xBF" => "\xE9\xA7\x99", + "\xDD\xC0" => "\xE9\xB3\xA7", + "\xDD\xC1" => "\xE5\x8C\x97", + "\xDD\xC2" => "\xE5\x88\x86", + "\xDD\xC3" => "\xE5\x90\xA9", + "\xDD\xC4" => "\xE5\x99\xB4", + "\xDD\xC5" => "\xE5\xA2\xB3", + "\xDD\xC6" => "\xE5\xA5\x94", + "\xDD\xC7" => "\xE5\xA5\xAE", + "\xDD\xC8" => "\xE5\xBF\xBF", + "\xDD\xC9" => "\xE6\x86\xA4", + "\xDD\xCA" => "\xE6\x89\xAE", + "\xDD\xCB" => "\xE6\x98\x90", + "\xDD\xCC" => "\xE6\xB1\xBE", + "\xDD\xCD" => "\xE7\x84\x9A", + "\xDD\xCE" => "\xE7\x9B\x86", + "\xDD\xCF" => "\xE7\xB2\x89", + "\xDD\xD0" => "\xE7\xB3\x9E", + "\xDD\xD1" => "\xE7\xB4\x9B", + "\xDD\xD2" => "\xE8\x8A\xAC", + "\xDD\xD3" => "\xE8\xB3\x81", + "\xDD\xD4" => "\xE9\x9B\xB0", + "\xDD\xD5" => "\xEF\xA5\xA7", + "\xDD\xD6" => "\xE4\xBD\x9B", + "\xDD\xD7" => "\xE5\xBC\x97", + "\xDD\xD8" => "\xE5\xBD\xBF", + "\xDD\xD9" => "\xE6\x8B\x82", + "\xDD\xDA" => "\xE5\xB4\xA9", + "\xDD\xDB" => "\xE6\x9C\x8B", + "\xDD\xDC" => "\xE6\xA3\x9A", + "\xDD\xDD" => "\xE7\xA1\xBC", + "\xDD\xDE" => "\xE7\xB9\x83", + "\xDD\xDF" => "\xE9\xB5\xAC", + "\xDD\xE0" => "\xE4\xB8\x95", + "\xDD\xE1" => "\xE5\x82\x99", + "\xDD\xE2" => "\xE5\x8C\x95", + "\xDD\xE3" => "\xE5\x8C\xAA", + "\xDD\xE4" => "\xE5\x8D\x91", + "\xDD\xE5" => "\xE5\xA6\x83", + "\xDD\xE6" => "\xE5\xA9\xA2", + "\xDD\xE7" => "\xE5\xBA\x87", + "\xDD\xE8" => "\xE6\x82\xB2", + "\xDD\xE9" => "\xE6\x86\x8A", + "\xDD\xEA" => "\xE6\x89\x89", + "\xDD\xEB" => "\xE6\x89\xB9", + "\xDD\xEC" => "\xE6\x96\x90", + "\xDD\xED" => "\xE6\x9E\x87", + "\xDD\xEE" => "\xE6\xA6\xA7", + "\xDD\xEF" => "\xE6\xAF\x94", + "\xDD\xF0" => "\xE6\xAF\x96", + "\xDD\xF1" => "\xE6\xAF\x97", + "\xDD\xF2" => "\xE6\xAF\x98", + "\xDD\xF3" => "\xE6\xB2\xB8", + "\xDD\xF4" => "\xEF\xA5\xA8", + "\xDD\xF5" => "\xE7\x90\xB5", + "\xDD\xF6" => "\xE7\x97\xBA", + "\xDD\xF7" => "\xE7\xA0\x92", + "\xDD\xF8" => "\xE7\xA2\x91", + "\xDD\xF9" => "\xE7\xA7\x95", + "\xDD\xFA" => "\xE7\xA7\x98", + "\xDD\xFB" => "\xE7\xB2\x83", + "\xDD\xFC" => "\xE7\xB7\x8B", + "\xDD\xFD" => "\xE7\xBF\xA1", + "\xDD\xFE" => "\xE8\x82\xA5", + "\xDE\xA1" => "\xE8\x84\xBE", + "\xDE\xA2" => "\xE8\x87\x82", + "\xDE\xA3" => "\xE8\x8F\xB2", + "\xDE\xA4" => "\xE8\x9C\x9A", + "\xDE\xA5" => "\xE8\xA3\xA8", + "\xDE\xA6" => "\xE8\xAA\xB9", + "\xDE\xA7" => "\xE8\xAD\xAC", + "\xDE\xA8" => "\xE8\xB2\xBB", + "\xDE\xA9" => "\xE9\x84\x99", + "\xDE\xAA" => "\xE9\x9D\x9E", + "\xDE\xAB" => "\xE9\xA3\x9B", + "\xDE\xAC" => "\xE9\xBC\xBB", + "\xDE\xAD" => "\xE5\x9A\xAC", + "\xDE\xAE" => "\xE5\xAC\xAA", + "\xDE\xAF" => "\xE5\xBD\xAC", + "\xDE\xB0" => "\xE6\x96\x8C", + "\xDE\xB1" => "\xE6\xAA\xB3", + "\xDE\xB2" => "\xE6\xAE\xAF", + "\xDE\xB3" => "\xE6\xB5\x9C", + "\xDE\xB4" => "\xE6\xBF\xB1", + "\xDE\xB5" => "\xE7\x80\x95", + "\xDE\xB6" => "\xE7\x89\x9D", + "\xDE\xB7" => "\xE7\x8E\xAD", + "\xDE\xB8" => "\xE8\xB2\xA7", + "\xDE\xB9" => "\xE8\xB3\x93", + "\xDE\xBA" => "\xE9\xA0\xBB", + "\xDE\xBB" => "\xE6\x86\x91", + "\xDE\xBC" => "\xE6\xB0\xB7", + "\xDE\xBD" => "\xE8\x81\x98", + "\xDE\xBE" => "\xE9\xA8\x81", + "\xDE\xBF" => "\xE4\xB9\x8D", + "\xDE\xC0" => "\xE4\xBA\x8B", + "\xDE\xC1" => "\xE4\xBA\x9B", + "\xDE\xC2" => "\xE4\xBB\x95", + "\xDE\xC3" => "\xE4\xBC\xBA", + "\xDE\xC4" => "\xE4\xBC\xBC", + "\xDE\xC5" => "\xE4\xBD\xBF", + "\xDE\xC6" => "\xE4\xBF\x9F", + "\xDE\xC7" => "\xE5\x83\xBF", + "\xDE\xC8" => "\xE5\x8F\xB2", + "\xDE\xC9" => "\xE5\x8F\xB8", + "\xDE\xCA" => "\xE5\x94\x86", + "\xDE\xCB" => "\xE5\x97\xA3", + "\xDE\xCC" => "\xE5\x9B\x9B", + "\xDE\xCD" => "\xE5\xA3\xAB", + "\xDE\xCE" => "\xE5\xA5\xA2", + "\xDE\xCF" => "\xE5\xA8\x91", + "\xDE\xD0" => "\xE5\xAF\xAB", + "\xDE\xD1" => "\xE5\xAF\xBA", + "\xDE\xD2" => "\xE5\xB0\x84", + "\xDE\xD3" => "\xE5\xB7\xB3", + "\xDE\xD4" => "\xE5\xB8\xAB", + "\xDE\xD5" => "\xE5\xBE\x99", + "\xDE\xD6" => "\xE6\x80\x9D", + "\xDE\xD7" => "\xE6\x8D\xA8", + "\xDE\xD8" => "\xE6\x96\x9C", + "\xDE\xD9" => "\xE6\x96\xAF", + "\xDE\xDA" => "\xE6\x9F\xB6", + "\xDE\xDB" => "\xE6\x9F\xBB", + "\xDE\xDC" => "\xE6\xA2\xAD", + "\xDE\xDD" => "\xE6\xAD\xBB", + "\xDE\xDE" => "\xE6\xB2\x99", + "\xDE\xDF" => "\xE6\xB3\x97", + "\xDE\xE0" => "\xE6\xB8\xA3", + "\xDE\xE1" => "\xE7\x80\x89", + "\xDE\xE2" => "\xE7\x8D\x85", + "\xDE\xE3" => "\xE7\xA0\x82", + "\xDE\xE4" => "\xE7\xA4\xBE", + "\xDE\xE5" => "\xE7\xA5\x80", + "\xDE\xE6" => "\xE7\xA5\xA0", + "\xDE\xE7" => "\xE7\xA7\x81", + "\xDE\xE8" => "\xE7\xAF\xA9", + "\xDE\xE9" => "\xE7\xB4\x97", + "\xDE\xEA" => "\xE7\xB5\xB2", + "\xDE\xEB" => "\xE8\x82\x86", + "\xDE\xEC" => "\xE8\x88\x8D", + "\xDE\xED" => "\xE8\x8E\x8E", + "\xDE\xEE" => "\xE8\x93\x91", + "\xDE\xEF" => "\xE8\x9B\x87", + "\xDE\xF0" => "\xE8\xA3\x9F", + "\xDE\xF1" => "\xE8\xA9\x90", + "\xDE\xF2" => "\xE8\xA9\x9E", + "\xDE\xF3" => "\xE8\xAC\x9D", + "\xDE\xF4" => "\xE8\xB3\x9C", + "\xDE\xF5" => "\xE8\xB5\xA6", + "\xDE\xF6" => "\xE8\xBE\xAD", + "\xDE\xF7" => "\xE9\x82\xAA", + "\xDE\xF8" => "\xE9\xA3\xBC", + "\xDE\xF9" => "\xE9\xA7\x9F", + "\xDE\xFA" => "\xE9\xBA\x9D", + "\xDE\xFB" => "\xE5\x89\x8A", + "\xDE\xFC" => "\xEF\xA5\xA9", + "\xDE\xFD" => "\xE6\x9C\x94", + "\xDE\xFE" => "\xEF\xA5\xAA", + "\xDF\xA1" => "\xE5\x82\x98", + "\xDF\xA2" => "\xE5\x88\xAA", + "\xDF\xA3" => "\xE5\xB1\xB1", + "\xDF\xA4" => "\xE6\x95\xA3", + "\xDF\xA5" => "\xE6\xB1\x95", + "\xDF\xA6" => "\xE7\x8F\x8A", + "\xDF\xA7" => "\xE7\x94\xA3", + "\xDF\xA8" => "\xE7\x96\x9D", + "\xDF\xA9" => "\xE7\xAE\x97", + "\xDF\xAA" => "\xE8\x92\x9C", + "\xDF\xAB" => "\xE9\x85\xB8", + "\xDF\xAC" => "\xE9\x9C\xB0", + "\xDF\xAD" => "\xE4\xB9\xB7", + "\xDF\xAE" => "\xE6\x92\x92", + "\xDF\xAF" => "\xE6\xAE\xBA", + "\xDF\xB0" => "\xE7\x85\x9E", + "\xDF\xB1" => "\xE8\x96\xA9", + "\xDF\xB2" => "\xE4\xB8\x89", + "\xDF\xB3" => "\xEF\xA5\xAB", + "\xDF\xB4" => "\xE6\x9D\x89", + "\xDF\xB5" => "\xE6\xA3\xAE", + "\xDF\xB6" => "\xE6\xB8\x97", + "\xDF\xB7" => "\xE8\x8A\x9F", + "\xDF\xB8" => "\xE8\x94\x98", + "\xDF\xB9" => "\xE8\xA1\xAB", + "\xDF\xBA" => "\xE6\x8F\xB7", + "\xDF\xBB" => "\xE6\xBE\x81", + "\xDF\xBC" => "\xE9\x88\x92", + "\xDF\xBD" => "\xE9\xA2\xAF", + "\xDF\xBE" => "\xE4\xB8\x8A", + "\xDF\xBF" => "\xE5\x82\xB7", + "\xDF\xC0" => "\xE5\x83\x8F", + "\xDF\xC1" => "\xE5\x84\x9F", + "\xDF\xC2" => "\xE5\x95\x86", + "\xDF\xC3" => "\xE5\x96\xAA", + "\xDF\xC4" => "\xE5\x98\x97", + "\xDF\xC5" => "\xE5\xAD\x80", + "\xDF\xC6" => "\xE5\xB0\x99", + "\xDF\xC7" => "\xE5\xB3\xA0", + "\xDF\xC8" => "\xE5\xB8\xB8", + "\xDF\xC9" => "\xE5\xBA\x8A", + "\xDF\xCA" => "\xE5\xBA\xA0", + "\xDF\xCB" => "\xE5\xBB\x82", + "\xDF\xCC" => "\xE6\x83\xB3", + "\xDF\xCD" => "\xE6\xA1\x91", + "\xDF\xCE" => "\xE6\xA9\xA1", + "\xDF\xCF" => "\xE6\xB9\x98", + "\xDF\xD0" => "\xE7\x88\xBD", + "\xDF\xD1" => "\xE7\x89\x80", + "\xDF\xD2" => "\xE7\x8B\x80", + "\xDF\xD3" => "\xE7\x9B\xB8", + "\xDF\xD4" => "\xE7\xA5\xA5", + "\xDF\xD5" => "\xE7\xAE\xB1", + "\xDF\xD6" => "\xE7\xBF\x94", + "\xDF\xD7" => "\xE8\xA3\xB3", + "\xDF\xD8" => "\xE8\xA7\xB4", + "\xDF\xD9" => "\xE8\xA9\xB3", + "\xDF\xDA" => "\xE8\xB1\xA1", + "\xDF\xDB" => "\xE8\xB3\x9E", + "\xDF\xDC" => "\xE9\x9C\x9C", + "\xDF\xDD" => "\xE5\xA1\x9E", + "\xDF\xDE" => "\xE7\x92\xBD", + "\xDF\xDF" => "\xE8\xB3\xBD", + "\xDF\xE0" => "\xE5\x97\x87", + "\xDF\xE1" => "\xEF\xA5\xAC", + "\xDF\xE2" => "\xE7\xA9\xA1", + "\xDF\xE3" => "\xE7\xB4\xA2", + "\xDF\xE4" => "\xE8\x89\xB2", + "\xDF\xE5" => "\xE7\x89\xB2", + "\xDF\xE6" => "\xE7\x94\x9F", + "\xDF\xE7" => "\xE7\x94\xA5", + "\xDF\xE8" => "\xEF\xA5\xAD", + "\xDF\xE9" => "\xE7\xAC\x99", + "\xDF\xEA" => "\xE5\xA2\x85", + "\xDF\xEB" => "\xE5\xA3\xBB", + "\xDF\xEC" => "\xE5\xB6\xBC", + "\xDF\xED" => "\xE5\xBA\x8F", + "\xDF\xEE" => "\xE5\xBA\xB6", + "\xDF\xEF" => "\xE5\xBE\x90", + "\xDF\xF0" => "\xE6\x81\x95", + "\xDF\xF1" => "\xE6\x8A\x92", + "\xDF\xF2" => "\xE6\x8D\xBF", + "\xDF\xF3" => "\xE6\x95\x8D", + "\xDF\xF4" => "\xE6\x9A\x91", + "\xDF\xF5" => "\xE6\x9B\x99", + "\xDF\xF6" => "\xE6\x9B\xB8", + "\xDF\xF7" => "\xE6\xA0\x96", + "\xDF\xF8" => "\xE6\xA3\xB2", + "\xDF\xF9" => "\xE7\x8A\x80", + "\xDF\xFA" => "\xE7\x91\x9E", + "\xDF\xFB" => "\xE7\xAD\xAE", + "\xDF\xFC" => "\xE7\xB5\xAE", + "\xDF\xFD" => "\xE7\xB7\x96", + "\xDF\xFE" => "\xE7\xBD\xB2", + "\xE0\xA1" => "\xE8\x83\xA5", + "\xE0\xA2" => "\xE8\x88\x92", + "\xE0\xA3" => "\xE8\x96\xAF", + "\xE0\xA4" => "\xE8\xA5\xBF", + "\xE0\xA5" => "\xE8\xAA\x93", + "\xE0\xA6" => "\xE9\x80\x9D", + "\xE0\xA7" => "\xE9\x8B\xA4", + "\xE0\xA8" => "\xE9\xBB\x8D", + "\xE0\xA9" => "\xE9\xBC\xA0", + "\xE0\xAA" => "\xE5\xA4\x95", + "\xE0\xAB" => "\xE5\xA5\xAD", + "\xE0\xAC" => "\xE5\xB8\xAD", + "\xE0\xAD" => "\xE6\x83\x9C", + "\xE0\xAE" => "\xE6\x98\x94", + "\xE0\xAF" => "\xE6\x99\xB3", + "\xE0\xB0" => "\xE6\x9E\x90", + "\xE0\xB1" => "\xE6\xB1\x90", + "\xE0\xB2" => "\xE6\xB7\x85", + "\xE0\xB3" => "\xE6\xBD\x9F", + "\xE0\xB4" => "\xE7\x9F\xB3", + "\xE0\xB5" => "\xE7\xA2\xA9", + "\xE0\xB6" => "\xE8\x93\x86", + "\xE0\xB7" => "\xE9\x87\x8B", + "\xE0\xB8" => "\xE9\x8C\xAB", + "\xE0\xB9" => "\xE4\xBB\x99", + "\xE0\xBA" => "\xE5\x83\x8A", + "\xE0\xBB" => "\xE5\x85\x88", + "\xE0\xBC" => "\xE5\x96\x84", + "\xE0\xBD" => "\xE5\xAC\x8B", + "\xE0\xBE" => "\xE5\xAE\xA3", + "\xE0\xBF" => "\xE6\x89\x87", + "\xE0\xC0" => "\xE6\x95\xBE", + "\xE0\xC1" => "\xE6\x97\x8B", + "\xE0\xC2" => "\xE6\xB8\xB2", + "\xE0\xC3" => "\xE7\x85\xBD", + "\xE0\xC4" => "\xE7\x90\x81", + "\xE0\xC5" => "\xE7\x91\x84", + "\xE0\xC6" => "\xE7\x92\x87", + "\xE0\xC7" => "\xE7\x92\xBF", + "\xE0\xC8" => "\xE7\x99\xAC", + "\xE0\xC9" => "\xE7\xA6\xAA", + "\xE0\xCA" => "\xE7\xB7\x9A", + "\xE0\xCB" => "\xE7\xB9\x95", + "\xE0\xCC" => "\xE7\xBE\xA8", + "\xE0\xCD" => "\xE8\x85\xBA", + "\xE0\xCE" => "\xE8\x86\xB3", + "\xE0\xCF" => "\xE8\x88\xB9", + "\xE0\xD0" => "\xE8\x98\x9A", + "\xE0\xD1" => "\xE8\x9F\xAC", + "\xE0\xD2" => "\xE8\xA9\xB5", + "\xE0\xD3" => "\xE8\xB7\xA3", + "\xE0\xD4" => "\xE9\x81\xB8", + "\xE0\xD5" => "\xE9\x8A\x91", + "\xE0\xD6" => "\xE9\x90\xA5", + "\xE0\xD7" => "\xE9\xA5\x8D", + "\xE0\xD8" => "\xE9\xAE\xAE", + "\xE0\xD9" => "\xE5\x8D\xA8", + "\xE0\xDA" => "\xE5\xB1\x91", + "\xE0\xDB" => "\xE6\xA5\x94", + "\xE0\xDC" => "\xE6\xB3\x84", + "\xE0\xDD" => "\xE6\xB4\xA9", + "\xE0\xDE" => "\xE6\xB8\xAB", + "\xE0\xDF" => "\xE8\x88\x8C", + "\xE0\xE0" => "\xE8\x96\x9B", + "\xE0\xE1" => "\xE8\xA4\xBB", + "\xE0\xE2" => "\xE8\xA8\xAD", + "\xE0\xE3" => "\xE8\xAA\xAA", + "\xE0\xE4" => "\xE9\x9B\xAA", + "\xE0\xE5" => "\xE9\xBD\xA7", + "\xE0\xE6" => "\xE5\x89\xA1", + "\xE0\xE7" => "\xE6\x9A\xB9", + "\xE0\xE8" => "\xE6\xAE\xB2", + "\xE0\xE9" => "\xE7\xBA\x96", + "\xE0\xEA" => "\xE8\x9F\xBE", + "\xE0\xEB" => "\xE8\xB4\x8D", + "\xE0\xEC" => "\xE9\x96\x83", + "\xE0\xED" => "\xE9\x99\x9D", + "\xE0\xEE" => "\xE6\x94\x9D", + "\xE0\xEF" => "\xE6\xB6\x89", + "\xE0\xF0" => "\xE7\x87\xAE", + "\xE0\xF1" => "\xEF\xA5\xAE", + "\xE0\xF2" => "\xE5\x9F\x8E", + "\xE0\xF3" => "\xE5\xA7\x93", + "\xE0\xF4" => "\xE5\xAE\xAC", + "\xE0\xF5" => "\xE6\x80\xA7", + "\xE0\xF6" => "\xE6\x83\xBA", + "\xE0\xF7" => "\xE6\x88\x90", + "\xE0\xF8" => "\xE6\x98\x9F", + "\xE0\xF9" => "\xE6\x99\x9F", + "\xE0\xFA" => "\xE7\x8C\xA9", + "\xE0\xFB" => "\xE7\x8F\xB9", + "\xE0\xFC" => "\xE7\x9B\x9B", + "\xE0\xFD" => "\xE7\x9C\x81", + "\xE0\xFE" => "\xE7\xAD\xAC", + "\xE1\xA1" => "\xE8\x81\x96", + "\xE1\xA2" => "\xE8\x81\xB2", + "\xE1\xA3" => "\xE8\x85\xA5", + "\xE1\xA4" => "\xE8\xAA\xA0", + "\xE1\xA5" => "\xE9\x86\x92", + "\xE1\xA6" => "\xE4\xB8\x96", + "\xE1\xA7" => "\xE5\x8B\xA2", + "\xE1\xA8" => "\xE6\xAD\xB2", + "\xE1\xA9" => "\xE6\xB4\x97", + "\xE1\xAA" => "\xE7\xA8\x85", + "\xE1\xAB" => "\xE7\xAC\xB9", + "\xE1\xAC" => "\xE7\xB4\xB0", + "\xE1\xAD" => "\xEF\xA5\xAF", + "\xE1\xAE" => "\xE8\xB2\xB0", + "\xE1\xAF" => "\xE5\x8F\xAC", + "\xE1\xB0" => "\xE5\x98\xAF", + "\xE1\xB1" => "\xE5\xA1\x91", + "\xE1\xB2" => "\xE5\xAE\xB5", + "\xE1\xB3" => "\xE5\xB0\x8F", + "\xE1\xB4" => "\xE5\xB0\x91", + "\xE1\xB5" => "\xE5\xB7\xA2", + "\xE1\xB6" => "\xE6\x89\x80", + "\xE1\xB7" => "\xE6\x8E\x83", + "\xE1\xB8" => "\xE6\x90\x94", + "\xE1\xB9" => "\xE6\x98\xAD", + "\xE1\xBA" => "\xE6\xA2\xB3", + "\xE1\xBB" => "\xE6\xB2\xBC", + "\xE1\xBC" => "\xE6\xB6\x88", + "\xE1\xBD" => "\xE6\xBA\xAF", + "\xE1\xBE" => "\xE7\x80\x9F", + "\xE1\xBF" => "\xE7\x82\xA4", + "\xE1\xC0" => "\xE7\x87\x92", + "\xE1\xC1" => "\xE7\x94\xA6", + "\xE1\xC2" => "\xE7\x96\x8F", + "\xE1\xC3" => "\xE7\x96\x8E", + "\xE1\xC4" => "\xE7\x98\x99", + "\xE1\xC5" => "\xE7\xAC\x91", + "\xE1\xC6" => "\xE7\xAF\xA0", + "\xE1\xC7" => "\xE7\xB0\xAB", + "\xE1\xC8" => "\xE7\xB4\xA0", + "\xE1\xC9" => "\xE7\xB4\xB9", + "\xE1\xCA" => "\xE8\x94\xAC", + "\xE1\xCB" => "\xE8\x95\xAD", + "\xE1\xCC" => "\xE8\x98\x87", + "\xE1\xCD" => "\xE8\xA8\xB4", + "\xE1\xCE" => "\xE9\x80\x8D", + "\xE1\xCF" => "\xE9\x81\xA1", + "\xE1\xD0" => "\xE9\x82\xB5", + "\xE1\xD1" => "\xE9\x8A\xB7", + "\xE1\xD2" => "\xE9\x9F\xB6", + "\xE1\xD3" => "\xE9\xA8\xB7", + "\xE1\xD4" => "\xE4\xBF\x97", + "\xE1\xD5" => "\xE5\xB1\xAC", + "\xE1\xD6" => "\xE6\x9D\x9F", + "\xE1\xD7" => "\xE6\xB6\x91", + "\xE1\xD8" => "\xE7\xB2\x9F", + "\xE1\xD9" => "\xE7\xBA\x8C", + "\xE1\xDA" => "\xE8\xAC\x96", + "\xE1\xDB" => "\xE8\xB4\x96", + "\xE1\xDC" => "\xE9\x80\x9F", + "\xE1\xDD" => "\xE5\xAD\xAB", + "\xE1\xDE" => "\xE5\xB7\xBD", + "\xE1\xDF" => "\xE6\x90\x8D", + "\xE1\xE0" => "\xE8\x93\x80", + "\xE1\xE1" => "\xE9\x81\x9C", + "\xE1\xE2" => "\xE9\xA3\xA1", + "\xE1\xE3" => "\xE7\x8E\x87", + "\xE1\xE4" => "\xE5\xAE\x8B", + "\xE1\xE5" => "\xE6\x82\x9A", + "\xE1\xE6" => "\xE6\x9D\xBE", + "\xE1\xE7" => "\xE6\xB7\x9E", + "\xE1\xE8" => "\xE8\xA8\x9F", + "\xE1\xE9" => "\xE8\xAA\xA6", + "\xE1\xEA" => "\xE9\x80\x81", + "\xE1\xEB" => "\xE9\xA0\x8C", + "\xE1\xEC" => "\xE5\x88\xB7", + "\xE1\xED" => "\xEF\xA5\xB0", + "\xE1\xEE" => "\xE7\x81\x91", + "\xE1\xEF" => "\xE7\xA2\x8E", + "\xE1\xF0" => "\xE9\x8E\x96", + "\xE1\xF1" => "\xE8\xA1\xB0", + "\xE1\xF2" => "\xE9\x87\x97", + "\xE1\xF3" => "\xE4\xBF\xAE", + "\xE1\xF4" => "\xE5\x8F\x97", + "\xE1\xF5" => "\xE5\x97\xBD", + "\xE1\xF6" => "\xE5\x9B\x9A", + "\xE1\xF7" => "\xE5\x9E\x82", + "\xE1\xF8" => "\xE5\xA3\xBD", + "\xE1\xF9" => "\xE5\xAB\x82", + "\xE1\xFA" => "\xE5\xAE\x88", + "\xE1\xFB" => "\xE5\xB2\xAB", + "\xE1\xFC" => "\xE5\xB3\x80", + "\xE1\xFD" => "\xE5\xB8\xA5", + "\xE1\xFE" => "\xE6\x84\x81", + "\xE2\xA1" => "\xE6\x88\x8D", + "\xE2\xA2" => "\xE6\x89\x8B", + "\xE2\xA3" => "\xE6\x8E\x88", + "\xE2\xA4" => "\xE6\x90\x9C", + "\xE2\xA5" => "\xE6\x94\xB6", + "\xE2\xA6" => "\xE6\x95\xB8", + "\xE2\xA7" => "\xE6\xA8\xB9", + "\xE2\xA8" => "\xE6\xAE\x8A", + "\xE2\xA9" => "\xE6\xB0\xB4", + "\xE2\xAA" => "\xE6\xB4\x99", + "\xE2\xAB" => "\xE6\xBC\xB1", + "\xE2\xAC" => "\xE7\x87\xA7", + "\xE2\xAD" => "\xE7\x8B\xA9", + "\xE2\xAE" => "\xE7\x8D\xB8", + "\xE2\xAF" => "\xE7\x90\x87", + "\xE2\xB0" => "\xE7\x92\xB2", + "\xE2\xB1" => "\xE7\x98\xA6", + "\xE2\xB2" => "\xE7\x9D\xA1", + "\xE2\xB3" => "\xE7\xA7\x80", + "\xE2\xB4" => "\xE7\xA9\x97", + "\xE2\xB5" => "\xE7\xAB\xAA", + "\xE2\xB6" => "\xE7\xB2\xB9", + "\xE2\xB7" => "\xE7\xB6\x8F", + "\xE2\xB8" => "\xE7\xB6\xAC", + "\xE2\xB9" => "\xE7\xB9\xA1", + "\xE2\xBA" => "\xE7\xBE\x9E", + "\xE2\xBB" => "\xE8\x84\xA9", + "\xE2\xBC" => "\xE8\x8C\xB1", + "\xE2\xBD" => "\xE8\x92\x90", + "\xE2\xBE" => "\xE8\x93\x9A", + "\xE2\xBF" => "\xE8\x97\xAA", + "\xE2\xC0" => "\xE8\xA2\x96", + "\xE2\xC1" => "\xE8\xAA\xB0", + "\xE2\xC2" => "\xE8\xAE\x90", + "\xE2\xC3" => "\xE8\xBC\xB8", + "\xE2\xC4" => "\xE9\x81\x82", + "\xE2\xC5" => "\xE9\x82\x83", + "\xE2\xC6" => "\xE9\x85\xAC", + "\xE2\xC7" => "\xE9\x8A\x96", + "\xE2\xC8" => "\xE9\x8A\xB9", + "\xE2\xC9" => "\xE9\x9A\x8B", + "\xE2\xCA" => "\xE9\x9A\xA7", + "\xE2\xCB" => "\xE9\x9A\xA8", + "\xE2\xCC" => "\xE9\x9B\x96", + "\xE2\xCD" => "\xE9\x9C\x80", + "\xE2\xCE" => "\xE9\xA0\x88", + "\xE2\xCF" => "\xE9\xA6\x96", + "\xE2\xD0" => "\xE9\xAB\x93", + "\xE2\xD1" => "\xE9\xAC\x9A", + "\xE2\xD2" => "\xE5\x8F\x94", + "\xE2\xD3" => "\xE5\xA1\xBE", + "\xE2\xD4" => "\xE5\xA4\x99", + "\xE2\xD5" => "\xE5\xAD\xB0", + "\xE2\xD6" => "\xE5\xAE\xBF", + "\xE2\xD7" => "\xE6\xB7\x91", + "\xE2\xD8" => "\xE6\xBD\x9A", + "\xE2\xD9" => "\xE7\x86\x9F", + "\xE2\xDA" => "\xE7\x90\xA1", + "\xE2\xDB" => "\xE7\x92\xB9", + "\xE2\xDC" => "\xE8\x82\x85", + "\xE2\xDD" => "\xE8\x8F\xBD", + "\xE2\xDE" => "\xE5\xB7\xA1", + "\xE2\xDF" => "\xE5\xBE\x87", + "\xE2\xE0" => "\xE5\xBE\xAA", + "\xE2\xE1" => "\xE6\x81\x82", + "\xE2\xE2" => "\xE6\x97\xAC", + "\xE2\xE3" => "\xE6\xA0\x92", + "\xE2\xE4" => "\xE6\xA5\xAF", + "\xE2\xE5" => "\xE6\xA9\x93", + "\xE2\xE6" => "\xE6\xAE\x89", + "\xE2\xE7" => "\xE6\xB4\xB5", + "\xE2\xE8" => "\xE6\xB7\xB3", + "\xE2\xE9" => "\xE7\x8F\xA3", + "\xE2\xEA" => "\xE7\x9B\xBE", + "\xE2\xEB" => "\xE7\x9E\xAC", + "\xE2\xEC" => "\xE7\xAD\x8D", + "\xE2\xED" => "\xE7\xB4\x94", + "\xE2\xEE" => "\xE8\x84\xA3", + "\xE2\xEF" => "\xE8\x88\x9C", + "\xE2\xF0" => "\xE8\x8D\x80", + "\xE2\xF1" => "\xE8\x93\xB4", + "\xE2\xF2" => "\xE8\x95\xA3", + "\xE2\xF3" => "\xE8\xA9\xA2", + "\xE2\xF4" => "\xE8\xAB\x84", + "\xE2\xF5" => "\xE9\x86\x87", + "\xE2\xF6" => "\xE9\x8C\x9E", + "\xE2\xF7" => "\xE9\xA0\x86", + "\xE2\xF8" => "\xE9\xA6\xB4", + "\xE2\xF9" => "\xE6\x88\x8C", + "\xE2\xFA" => "\xE8\xA1\x93", + "\xE2\xFB" => "\xE8\xBF\xB0", + "\xE2\xFC" => "\xE9\x89\xA5", + "\xE2\xFD" => "\xE5\xB4\x87", + "\xE2\xFE" => "\xE5\xB4\xA7", + "\xE3\xA1" => "\xE5\xB5\xA9", + "\xE3\xA2" => "\xE7\x91\x9F", + "\xE3\xA3" => "\xE8\x86\x9D", + "\xE3\xA4" => "\xE8\x9D\xA8", + "\xE3\xA5" => "\xE6\xBF\x95", + "\xE3\xA6" => "\xE6\x8B\xBE", + "\xE3\xA7" => "\xE7\xBF\x92", + "\xE3\xA8" => "\xE8\xA4\xB6", + "\xE3\xA9" => "\xE8\xA5\xB2", + "\xE3\xAA" => "\xE4\xB8\x9E", + "\xE3\xAB" => "\xE4\xB9\x98", + "\xE3\xAC" => "\xE5\x83\xA7", + "\xE3\xAD" => "\xE5\x8B\x9D", + "\xE3\xAE" => "\xE5\x8D\x87", + "\xE3\xAF" => "\xE6\x89\xBF", + "\xE3\xB0" => "\xE6\x98\x87", + "\xE3\xB1" => "\xE7\xB9\xA9", + "\xE3\xB2" => "\xE8\xA0\x85", + "\xE3\xB3" => "\xE9\x99\x9E", + "\xE3\xB4" => "\xE4\xBE\x8D", + "\xE3\xB5" => "\xE5\x8C\x99", + "\xE3\xB6" => "\xE5\x98\xB6", + "\xE3\xB7" => "\xE5\xA7\x8B", + "\xE3\xB8" => "\xE5\xAA\xA4", + "\xE3\xB9" => "\xE5\xB0\xB8", + "\xE3\xBA" => "\xE5\xB1\x8E", + "\xE3\xBB" => "\xE5\xB1\x8D", + "\xE3\xBC" => "\xE5\xB8\x82", + "\xE3\xBD" => "\xE5\xBC\x91", + "\xE3\xBE" => "\xE6\x81\x83", + "\xE3\xBF" => "\xE6\x96\xBD", + "\xE3\xC0" => "\xE6\x98\xAF", + "\xE3\xC1" => "\xE6\x99\x82", + "\xE3\xC2" => "\xE6\x9E\xBE", + "\xE3\xC3" => "\xE6\x9F\xB4", + "\xE3\xC4" => "\xE7\x8C\x9C", + "\xE3\xC5" => "\xE7\x9F\xA2", + "\xE3\xC6" => "\xE7\xA4\xBA", + "\xE3\xC7" => "\xE7\xBF\x85", + "\xE3\xC8" => "\xE8\x92\x94", + "\xE3\xC9" => "\xE8\x93\x8D", + "\xE3\xCA" => "\xE8\xA6\x96", + "\xE3\xCB" => "\xE8\xA9\xA6", + "\xE3\xCC" => "\xE8\xA9\xA9", + "\xE3\xCD" => "\xE8\xAB\xA1", + "\xE3\xCE" => "\xE8\xB1\x95", + "\xE3\xCF" => "\xE8\xB1\xBA", + "\xE3\xD0" => "\xE5\x9F\xB4", + "\xE3\xD1" => "\xE5\xAF\x94", + "\xE3\xD2" => "\xE5\xBC\x8F", + "\xE3\xD3" => "\xE6\x81\xAF", + "\xE3\xD4" => "\xE6\x8B\xAD", + "\xE3\xD5" => "\xE6\xA4\x8D", + "\xE3\xD6" => "\xE6\xAE\x96", + "\xE3\xD7" => "\xE6\xB9\x9C", + "\xE3\xD8" => "\xE7\x86\x84", + "\xE3\xD9" => "\xE7\xAF\x92", + "\xE3\xDA" => "\xE8\x9D\x95", + "\xE3\xDB" => "\xE8\xAD\x98", + "\xE3\xDC" => "\xE8\xBB\xBE", + "\xE3\xDD" => "\xE9\xA3\x9F", + "\xE3\xDE" => "\xE9\xA3\xBE", + "\xE3\xDF" => "\xE4\xBC\xB8", + "\xE3\xE0" => "\xE4\xBE\x81", + "\xE3\xE1" => "\xE4\xBF\xA1", + "\xE3\xE2" => "\xE5\x91\xBB", + "\xE3\xE3" => "\xE5\xA8\xA0", + "\xE3\xE4" => "\xE5\xAE\xB8", + "\xE3\xE5" => "\xE6\x84\xBC", + "\xE3\xE6" => "\xE6\x96\xB0", + "\xE3\xE7" => "\xE6\x99\xA8", + "\xE3\xE8" => "\xE7\x87\xBC", + "\xE3\xE9" => "\xE7\x94\xB3", + "\xE3\xEA" => "\xE7\xA5\x9E", + "\xE3\xEB" => "\xE7\xB4\xB3", + "\xE3\xEC" => "\xE8\x85\x8E", + "\xE3\xED" => "\xE8\x87\xA3", + "\xE3\xEE" => "\xE8\x8E\x98", + "\xE3\xEF" => "\xE8\x96\xAA", + "\xE3\xF0" => "\xE8\x97\x8E", + "\xE3\xF1" => "\xE8\x9C\x83", + "\xE3\xF2" => "\xE8\xA8\x8A", + "\xE3\xF3" => "\xE8\xBA\xAB", + "\xE3\xF4" => "\xE8\xBE\x9B", + "\xE3\xF5" => "\xEF\xA5\xB1", + "\xE3\xF6" => "\xE8\xBF\x85", + "\xE3\xF7" => "\xE5\xA4\xB1", + "\xE3\xF8" => "\xE5\xAE\xA4", + "\xE3\xF9" => "\xE5\xAF\xA6", + "\xE3\xFA" => "\xE6\x82\x89", + "\xE3\xFB" => "\xE5\xAF\xA9", + "\xE3\xFC" => "\xE5\xB0\x8B", + "\xE3\xFD" => "\xE5\xBF\x83", + "\xE3\xFE" => "\xE6\xB2\x81", + "\xE4\xA1" => "\xEF\xA5\xB2", + "\xE4\xA2" => "\xE6\xB7\xB1", + "\xE4\xA3" => "\xE7\x80\x8B", + "\xE4\xA4" => "\xE7\x94\x9A", + "\xE4\xA5" => "\xE8\x8A\xAF", + "\xE4\xA6" => "\xE8\xAB\xB6", + "\xE4\xA7" => "\xE4\xBB\x80", + "\xE4\xA8" => "\xE5\x8D\x81", + "\xE4\xA9" => "\xEF\xA5\xB3", + "\xE4\xAA" => "\xE9\x9B\x99", + "\xE4\xAB" => "\xE6\xB0\x8F", + "\xE4\xAC" => "\xE4\xBA\x9E", + "\xE4\xAD" => "\xE4\xBF\x84", + "\xE4\xAE" => "\xE5\x85\x92", + "\xE4\xAF" => "\xE5\x95\x9E", + "\xE4\xB0" => "\xE5\xA8\xA5", + "\xE4\xB1" => "\xE5\xB3\xA8", + "\xE4\xB2" => "\xE6\x88\x91", + "\xE4\xB3" => "\xE7\x89\x99", + "\xE4\xB4" => "\xE8\x8A\xBD", + "\xE4\xB5" => "\xE8\x8E\xAA", + "\xE4\xB6" => "\xE8\x9B\xBE", + "\xE4\xB7" => "\xE8\xA1\x99", + "\xE4\xB8" => "\xE8\xA8\x9D", + "\xE4\xB9" => "\xE9\x98\xBF", + "\xE4\xBA" => "\xE9\x9B\x85", + "\xE4\xBB" => "\xE9\xA4\x93", + "\xE4\xBC" => "\xE9\xB4\x89", + "\xE4\xBD" => "\xE9\xB5\x9D", + "\xE4\xBE" => "\xE5\xA0\x8A", + "\xE4\xBF" => "\xE5\xB2\xB3", + "\xE4\xC0" => "\xE5\xB6\xBD", + "\xE4\xC1" => "\xE5\xB9\x84", + "\xE4\xC2" => "\xE6\x83\xA1", + "\xE4\xC3" => "\xE6\x84\x95", + "\xE4\xC4" => "\xE6\x8F\xA1", + "\xE4\xC5" => "\xE6\xA8\x82", + "\xE4\xC6" => "\xE6\xB8\xA5", + "\xE4\xC7" => "\xE9\x84\x82", + "\xE4\xC8" => "\xE9\x8D\x94", + "\xE4\xC9" => "\xE9\xA1\x8E", + "\xE4\xCA" => "\xE9\xB0\x90", + "\xE4\xCB" => "\xE9\xBD\xB7", + "\xE4\xCC" => "\xE5\xAE\x89", + "\xE4\xCD" => "\xE5\xB2\xB8", + "\xE4\xCE" => "\xE6\x8C\x89", + "\xE4\xCF" => "\xE6\x99\x8F", + "\xE4\xD0" => "\xE6\xA1\x88", + "\xE4\xD1" => "\xE7\x9C\xBC", + "\xE4\xD2" => "\xE9\x9B\x81", + "\xE4\xD3" => "\xE9\x9E\x8D", + "\xE4\xD4" => "\xE9\xA1\x94", + "\xE4\xD5" => "\xE9\xAE\x9F", + "\xE4\xD6" => "\xE6\x96\xA1", + "\xE4\xD7" => "\xE8\xAC\x81", + "\xE4\xD8" => "\xE8\xBB\x8B", + "\xE4\xD9" => "\xE9\x96\xBC", + "\xE4\xDA" => "\xE5\x94\xB5", + "\xE4\xDB" => "\xE5\xB2\xA9", + "\xE4\xDC" => "\xE5\xB7\x96", + "\xE4\xDD" => "\xE5\xBA\xB5", + "\xE4\xDE" => "\xE6\x9A\x97", + "\xE4\xDF" => "\xE7\x99\x8C", + "\xE4\xE0" => "\xE8\x8F\xB4", + "\xE4\xE1" => "\xE9\x97\x87", + "\xE4\xE2" => "\xE5\xA3\x93", + "\xE4\xE3" => "\xE6\x8A\xBC", + "\xE4\xE4" => "\xE7\x8B\x8E", + "\xE4\xE5" => "\xE9\xB4\xA8", + "\xE4\xE6" => "\xE4\xBB\xB0", + "\xE4\xE7" => "\xE5\xA4\xAE", + "\xE4\xE8" => "\xE6\x80\x8F", + "\xE4\xE9" => "\xE6\x98\xBB", + "\xE4\xEA" => "\xE6\xAE\x83", + "\xE4\xEB" => "\xE7\xA7\xA7", + "\xE4\xEC" => "\xE9\xB4\xA6", + "\xE4\xED" => "\xE5\x8E\x93", + "\xE4\xEE" => "\xE5\x93\x80", + "\xE4\xEF" => "\xE5\x9F\x83", + "\xE4\xF0" => "\xE5\xB4\x96", + "\xE4\xF1" => "\xE6\x84\x9B", + "\xE4\xF2" => "\xE6\x9B\x96", + "\xE4\xF3" => "\xE6\xB6\xAF", + "\xE4\xF4" => "\xE7\xA2\x8D", + "\xE4\xF5" => "\xE8\x89\xBE", + "\xE4\xF6" => "\xE9\x9A\x98", + "\xE4\xF7" => "\xE9\x9D\x84", + "\xE4\xF8" => "\xE5\x8E\x84", + "\xE4\xF9" => "\xE6\x89\xBC", + "\xE4\xFA" => "\xE6\x8E\x96", + "\xE4\xFB" => "\xE6\xB6\xB2", + "\xE4\xFC" => "\xE7\xB8\x8A", + "\xE4\xFD" => "\xE8\x85\x8B", + "\xE4\xFE" => "\xE9\xA1\x8D", + "\xE5\xA1" => "\xE6\xAB\xBB", + "\xE5\xA2" => "\xE7\xBD\x8C", + "\xE5\xA3" => "\xE9\xB6\xAF", + "\xE5\xA4" => "\xE9\xB8\x9A", + "\xE5\xA5" => "\xE4\xB9\x9F", + "\xE5\xA6" => "\xE5\x80\xBB", + "\xE5\xA7" => "\xE5\x86\xB6", + "\xE5\xA8" => "\xE5\xA4\x9C", + "\xE5\xA9" => "\xE6\x83\xB9", + "\xE5\xAA" => "\xE6\x8F\xB6", + "\xE5\xAB" => "\xE6\xA4\xB0", + "\xE5\xAC" => "\xE7\x88\xBA", + "\xE5\xAD" => "\xE8\x80\xB6", + "\xE5\xAE" => "\xEF\xA5\xB4", + "\xE5\xAF" => "\xE9\x87\x8E", + "\xE5\xB0" => "\xE5\xBC\xB1", + "\xE5\xB1" => "\xEF\xA5\xB5", + "\xE5\xB2" => "\xEF\xA5\xB6", + "\xE5\xB3" => "\xE7\xB4\x84", + "\xE5\xB4" => "\xE8\x8B\xA5", + "\xE5\xB5" => "\xE8\x91\xAF", + "\xE5\xB6" => "\xE8\x92\xBB", + "\xE5\xB7" => "\xE8\x97\xA5", + "\xE5\xB8" => "\xE8\xBA\x8D", + "\xE5\xB9" => "\xEF\xA5\xB7", + "\xE5\xBA" => "\xE4\xBD\xAF", + "\xE5\xBB" => "\xEF\xA5\xB8", + "\xE5\xBC" => "\xEF\xA5\xB9", + "\xE5\xBD" => "\xE5\xA3\xA4", + "\xE5\xBE" => "\xE5\xAD\x83", + "\xE5\xBF" => "\xE6\x81\x99", + "\xE5\xC0" => "\xE6\x8F\x9A", + "\xE5\xC1" => "\xE6\x94\x98", + "\xE5\xC2" => "\xE6\x95\xAD", + "\xE5\xC3" => "\xE6\x9A\x98", + "\xE5\xC4" => "\xEF\xA5\xBA", + "\xE5\xC5" => "\xE6\xA5\x8A", + "\xE5\xC6" => "\xE6\xA8\xA3", + "\xE5\xC7" => "\xE6\xB4\x8B", + "\xE5\xC8" => "\xE7\x80\x81", + "\xE5\xC9" => "\xE7\x85\xAC", + "\xE5\xCA" => "\xE7\x97\x92", + "\xE5\xCB" => "\xE7\x98\x8D", + "\xE5\xCC" => "\xE7\xA6\xB3", + "\xE5\xCD" => "\xE7\xA9\xB0", + "\xE5\xCE" => "\xEF\xA5\xBB", + "\xE5\xCF" => "\xE7\xBE\x8A", + "\xE5\xD0" => "\xEF\xA5\xBC", + "\xE5\xD1" => "\xE8\xA5\x84", + "\xE5\xD2" => "\xEF\xA5\xBD", + "\xE5\xD3" => "\xE8\xAE\x93", + "\xE5\xD4" => "\xE9\x87\x80", + "\xE5\xD5" => "\xE9\x99\xBD", + "\xE5\xD6" => "\xEF\xA5\xBE", + "\xE5\xD7" => "\xE9\xA4\x8A", + "\xE5\xD8" => "\xE5\x9C\x84", + "\xE5\xD9" => "\xE5\xBE\xA1", + "\xE5\xDA" => "\xE6\x96\xBC", + "\xE5\xDB" => "\xE6\xBC\x81", + "\xE5\xDC" => "\xE7\x98\x80", + "\xE5\xDD" => "\xE7\xA6\xA6", + "\xE5\xDE" => "\xE8\xAA\x9E", + "\xE5\xDF" => "\xE9\xA6\xAD", + "\xE5\xE0" => "\xE9\xAD\x9A", + "\xE5\xE1" => "\xE9\xBD\xAC", + "\xE5\xE2" => "\xE5\x84\x84", + "\xE5\xE3" => "\xE6\x86\xB6", + "\xE5\xE4" => "\xE6\x8A\x91", + "\xE5\xE5" => "\xE6\xAA\x8D", + "\xE5\xE6" => "\xE8\x87\x86", + "\xE5\xE7" => "\xE5\x81\x83", + "\xE5\xE8" => "\xE5\xA0\xB0", + "\xE5\xE9" => "\xE5\xBD\xA6", + "\xE5\xEA" => "\xE7\x84\x89", + "\xE5\xEB" => "\xE8\xA8\x80", + "\xE5\xEC" => "\xE8\xAB\xBA", + "\xE5\xED" => "\xE5\xAD\xBC", + "\xE5\xEE" => "\xE8\x98\x96", + "\xE5\xEF" => "\xE4\xBF\xBA", + "\xE5\xF0" => "\xE5\x84\xBC", + "\xE5\xF1" => "\xE5\x9A\xB4", + "\xE5\xF2" => "\xE5\xA5\x84", + "\xE5\xF3" => "\xE6\x8E\xA9", + "\xE5\xF4" => "\xE6\xB7\xB9", + "\xE5\xF5" => "\xE5\xB6\xAA", + "\xE5\xF6" => "\xE6\xA5\xAD", + "\xE5\xF7" => "\xE5\x86\x86", + "\xE5\xF8" => "\xE4\xBA\x88", + "\xE5\xF9" => "\xE4\xBD\x99", + "\xE5\xFA" => "\xEF\xA5\xBF", + "\xE5\xFB" => "\xEF\xA6\x80", + "\xE5\xFC" => "\xEF\xA6\x81", + "\xE5\xFD" => "\xE5\xA6\x82", + "\xE5\xFE" => "\xEF\xA6\x82", + "\xE6\xA1" => "\xEF\xA6\x83", + "\xE6\xA2" => "\xE6\xAD\x9F", + "\xE6\xA3" => "\xE6\xB1\x9D", + "\xE6\xA4" => "\xEF\xA6\x84", + "\xE6\xA5" => "\xE7\x92\xB5", + "\xE6\xA6" => "\xE7\xA4\x96", + "\xE6\xA7" => "\xEF\xA6\x85", + "\xE6\xA8" => "\xE8\x88\x87", + "\xE6\xA9" => "\xE8\x89\x85", + "\xE6\xAA" => "\xE8\x8C\xB9", + "\xE6\xAB" => "\xE8\xBC\xBF", + "\xE6\xAC" => "\xE8\xBD\x9D", + "\xE6\xAD" => "\xEF\xA6\x86", + "\xE6\xAE" => "\xE9\xA4\x98", + "\xE6\xAF" => "\xEF\xA6\x87", + "\xE6\xB0" => "\xEF\xA6\x88", + "\xE6\xB1" => "\xEF\xA6\x89", + "\xE6\xB2" => "\xE4\xBA\xA6", + "\xE6\xB3" => "\xEF\xA6\x8A", + "\xE6\xB4" => "\xE5\x9F\x9F", + "\xE6\xB5" => "\xE5\xBD\xB9", + "\xE6\xB6" => "\xE6\x98\x93", + "\xE6\xB7" => "\xEF\xA6\x8B", + "\xE6\xB8" => "\xEF\xA6\x8C", + "\xE6\xB9" => "\xE7\x96\xAB", + "\xE6\xBA" => "\xE7\xB9\xB9", + "\xE6\xBB" => "\xE8\xAD\xAF", + "\xE6\xBC" => "\xEF\xA6\x8D", + "\xE6\xBD" => "\xE9\x80\x86", + "\xE6\xBE" => "\xE9\xA9\x9B", + "\xE6\xBF" => "\xE5\x9A\xA5", + "\xE6\xC0" => "\xE5\xA0\xA7", + "\xE6\xC1" => "\xE5\xA7\xB8", + "\xE6\xC2" => "\xE5\xA8\x9F", + "\xE6\xC3" => "\xE5\xAE\xB4", + "\xE6\xC4" => "\xEF\xA6\x8E", + "\xE6\xC5" => "\xE5\xBB\xB6", + "\xE6\xC6" => "\xEF\xA6\x8F", + "\xE6\xC7" => "\xEF\xA6\x90", + "\xE6\xC8" => "\xE6\x8D\x90", + "\xE6\xC9" => "\xE6\x8C\xBB", + "\xE6\xCA" => "\xEF\xA6\x91", + "\xE6\xCB" => "\xE6\xA4\xBD", + "\xE6\xCC" => "\xE6\xB2\x87", + "\xE6\xCD" => "\xE6\xB2\xBF", + "\xE6\xCE" => "\xE6\xB6\x8E", + "\xE6\xCF" => "\xE6\xB6\x93", + "\xE6\xD0" => "\xE6\xB7\xB5", + "\xE6\xD1" => "\xE6\xBC\x94", + "\xE6\xD2" => "\xEF\xA6\x92", + "\xE6\xD3" => "\xE7\x83\x9F", + "\xE6\xD4" => "\xE7\x84\xB6", + "\xE6\xD5" => "\xE7\x85\x99", + "\xE6\xD6" => "\xEF\xA6\x93", + "\xE6\xD7" => "\xE7\x87\x83", + "\xE6\xD8" => "\xE7\x87\x95", + "\xE6\xD9" => "\xEF\xA6\x94", + "\xE6\xDA" => "\xE7\xA1\x8F", + "\xE6\xDB" => "\xE7\xA1\xAF", + "\xE6\xDC" => "\xEF\xA6\x95", + "\xE6\xDD" => "\xE7\xAD\xB5", + "\xE6\xDE" => "\xE7\xB7\xA3", + "\xE6\xDF" => "\xEF\xA6\x96", + "\xE6\xE0" => "\xE7\xB8\xAF", + "\xE6\xE1" => "\xEF\xA6\x97", + "\xE6\xE2" => "\xE8\xA1\x8D", + "\xE6\xE3" => "\xE8\xBB\x9F", + "\xE6\xE4" => "\xEF\xA6\x98", + "\xE6\xE5" => "\xEF\xA6\x99", + "\xE6\xE6" => "\xEF\xA6\x9A", + "\xE6\xE7" => "\xE9\x89\x9B", + "\xE6\xE8" => "\xEF\xA6\x9B", + "\xE6\xE9" => "\xE9\xB3\xB6", + "\xE6\xEA" => "\xEF\xA6\x9C", + "\xE6\xEB" => "\xEF\xA6\x9D", + "\xE6\xEC" => "\xEF\xA6\x9E", + "\xE6\xED" => "\xE6\x82\x85", + "\xE6\xEE" => "\xE6\xB6\x85", + "\xE6\xEF" => "\xEF\xA6\x9F", + "\xE6\xF0" => "\xE7\x86\xB1", + "\xE6\xF1" => "\xEF\xA6\xA0", + "\xE6\xF2" => "\xEF\xA6\xA1", + "\xE6\xF3" => "\xE9\x96\xB1", + "\xE6\xF4" => "\xE5\x8E\xAD", + "\xE6\xF5" => "\xEF\xA6\xA2", + "\xE6\xF6" => "\xEF\xA6\xA3", + "\xE6\xF7" => "\xEF\xA6\xA4", + "\xE6\xF8" => "\xE6\x9F\x93", + "\xE6\xF9" => "\xEF\xA6\xA5", + "\xE6\xFA" => "\xE7\x82\x8E", + "\xE6\xFB" => "\xE7\x84\xB0", + "\xE6\xFC" => "\xE7\x90\xB0", + "\xE6\xFD" => "\xE8\x89\xB6", + "\xE6\xFE" => "\xE8\x8B\x92", + "\xE7\xA1" => "\xEF\xA6\xA6", + "\xE7\xA2" => "\xE9\x96\xBB", + "\xE7\xA3" => "\xE9\xAB\xA5", + "\xE7\xA4" => "\xE9\xB9\xBD", + "\xE7\xA5" => "\xE6\x9B\x84", + "\xE7\xA6" => "\xEF\xA6\xA7", + "\xE7\xA7" => "\xE7\x87\x81", + "\xE7\xA8" => "\xE8\x91\x89", + "\xE7\xA9" => "\xEF\xA6\xA8", + "\xE7\xAA" => "\xEF\xA6\xA9", + "\xE7\xAB" => "\xE5\xA1\x8B", + "\xE7\xAC" => "\xEF\xA6\xAA", + "\xE7\xAD" => "\xEF\xA6\xAB", + "\xE7\xAE" => "\xE5\xB6\xB8", + "\xE7\xAF" => "\xE5\xBD\xB1", + "\xE7\xB0" => "\xEF\xA6\xAC", + "\xE7\xB1" => "\xE6\x98\xA0", + "\xE7\xB2" => "\xE6\x9A\x8E", + "\xE7\xB3" => "\xE6\xA5\xB9", + "\xE7\xB4" => "\xE6\xA6\xAE", + "\xE7\xB5" => "\xE6\xB0\xB8", + "\xE7\xB6" => "\xE6\xB3\xB3", + "\xE7\xB7" => "\xE6\xB8\xB6", + "\xE7\xB8" => "\xE6\xBD\x81", + "\xE7\xB9" => "\xE6\xBF\x9A", + "\xE7\xBA" => "\xE7\x80\x9B", + "\xE7\xBB" => "\xE7\x80\xAF", + "\xE7\xBC" => "\xE7\x85\x90", + "\xE7\xBD" => "\xE7\x87\x9F", + "\xE7\xBE" => "\xE7\x8D\xB0", + "\xE7\xBF" => "\xEF\xA6\xAD", + "\xE7\xC0" => "\xE7\x91\x9B", + "\xE7\xC1" => "\xEF\xA6\xAE", + "\xE7\xC2" => "\xE7\x93\x94", + "\xE7\xC3" => "\xE7\x9B\x88", + "\xE7\xC4" => "\xE7\xA9\x8E", + "\xE7\xC5" => "\xE7\xBA\x93", + "\xE7\xC6" => "\xEF\xA6\xAF", + "\xE7\xC7" => "\xEF\xA6\xB0", + "\xE7\xC8" => "\xE8\x8B\xB1", + "\xE7\xC9" => "\xE8\xA9\xA0", + "\xE7\xCA" => "\xE8\xBF\x8E", + "\xE7\xCB" => "\xEF\xA6\xB1", + "\xE7\xCC" => "\xE9\x8D\x88", + "\xE7\xCD" => "\xEF\xA6\xB2", + "\xE7\xCE" => "\xE9\x9C\x99", + "\xE7\xCF" => "\xEF\xA6\xB3", + "\xE7\xD0" => "\xEF\xA6\xB4", + "\xE7\xD1" => "\xE4\xB9\x82", + "\xE7\xD2" => "\xE5\x80\xAA", + "\xE7\xD3" => "\xEF\xA6\xB5", + "\xE7\xD4" => "\xE5\x88\x88", + "\xE7\xD5" => "\xE5\x8F\xA1", + "\xE7\xD6" => "\xE6\x9B\xB3", + "\xE7\xD7" => "\xE6\xB1\xAD", + "\xE7\xD8" => "\xE6\xBF\x8A", + "\xE7\xD9" => "\xE7\x8C\x8A", + "\xE7\xDA" => "\xE7\x9D\xBF", + "\xE7\xDB" => "\xE7\xA9\xA2", + "\xE7\xDC" => "\xE8\x8A\xAE", + "\xE7\xDD" => "\xE8\x97\x9D", + "\xE7\xDE" => "\xE8\x98\x82", + "\xE7\xDF" => "\xEF\xA6\xB6", + "\xE7\xE0" => "\xE8\xA3\x94", + "\xE7\xE1" => "\xE8\xA9\xA3", + "\xE7\xE2" => "\xE8\xAD\xBD", + "\xE7\xE3" => "\xE8\xB1\xAB", + "\xE7\xE4" => "\xEF\xA6\xB7", + "\xE7\xE5" => "\xE9\x8A\xB3", + "\xE7\xE6" => "\xEF\xA6\xB8", + "\xE7\xE7" => "\xE9\x9C\x93", + "\xE7\xE8" => "\xE9\xA0\x90", + "\xE7\xE9" => "\xE4\xBA\x94", + "\xE7\xEA" => "\xE4\xBC\x8D", + "\xE7\xEB" => "\xE4\xBF\x89", + "\xE7\xEC" => "\xE5\x82\xB2", + "\xE7\xED" => "\xE5\x8D\x88", + "\xE7\xEE" => "\xE5\x90\xBE", + "\xE7\xEF" => "\xE5\x90\xB3", + "\xE7\xF0" => "\xE5\x97\x9A", + "\xE7\xF1" => "\xE5\xA1\xA2", + "\xE7\xF2" => "\xE5\xA2\xBA", + "\xE7\xF3" => "\xE5\xA5\xA7", + "\xE7\xF4" => "\xE5\xA8\x9B", + "\xE7\xF5" => "\xE5\xAF\xA4", + "\xE7\xF6" => "\xE6\x82\x9F", + "\xE7\xF7" => "\xEF\xA6\xB9", + "\xE7\xF8" => "\xE6\x87\x8A", + "\xE7\xF9" => "\xE6\x95\x96", + "\xE7\xFA" => "\xE6\x97\xBF", + "\xE7\xFB" => "\xE6\x99\xA4", + "\xE7\xFC" => "\xE6\xA2\xA7", + "\xE7\xFD" => "\xE6\xB1\x9A", + "\xE7\xFE" => "\xE6\xBE\xB3", + "\xE8\xA1" => "\xE7\x83\x8F", + "\xE8\xA2" => "\xE7\x86\xAC", + "\xE8\xA3" => "\xE7\x8D\x92", + "\xE8\xA4" => "\xE7\xAD\xBD", + "\xE8\xA5" => "\xE8\x9C\x88", + "\xE8\xA6" => "\xE8\xAA\xA4", + "\xE8\xA7" => "\xE9\xB0\xB2", + "\xE8\xA8" => "\xE9\xBC\x87", + "\xE8\xA9" => "\xE5\xB1\x8B", + "\xE8\xAA" => "\xE6\xB2\x83", + "\xE8\xAB" => "\xE7\x8D\x84", + "\xE8\xAC" => "\xE7\x8E\x89", + "\xE8\xAD" => "\xE9\x88\xBA", + "\xE8\xAE" => "\xE6\xBA\xAB", + "\xE8\xAF" => "\xE7\x91\xA5", + "\xE8\xB0" => "\xE7\x98\x9F", + "\xE8\xB1" => "\xE7\xA9\xA9", + "\xE8\xB2" => "\xE7\xB8\x95", + "\xE8\xB3" => "\xE8\x98\x8A", + "\xE8\xB4" => "\xE5\x85\x80", + "\xE8\xB5" => "\xE5\xA3\x85", + "\xE8\xB6" => "\xE6\x93\x81", + "\xE8\xB7" => "\xE7\x93\xAE", + "\xE8\xB8" => "\xE7\x94\x95", + "\xE8\xB9" => "\xE7\x99\xB0", + "\xE8\xBA" => "\xE7\xBF\x81", + "\xE8\xBB" => "\xE9\x82\x95", + "\xE8\xBC" => "\xE9\x9B\x8D", + "\xE8\xBD" => "\xE9\xA5\x94", + "\xE8\xBE" => "\xE6\xB8\xA6", + "\xE8\xBF" => "\xE7\x93\xA6", + "\xE8\xC0" => "\xE7\xAA\xA9", + "\xE8\xC1" => "\xE7\xAA\xAA", + "\xE8\xC2" => "\xE8\x87\xA5", + "\xE8\xC3" => "\xE8\x9B\x99", + "\xE8\xC4" => "\xE8\x9D\xB8", + "\xE8\xC5" => "\xE8\xA8\x9B", + "\xE8\xC6" => "\xE5\xA9\x89", + "\xE8\xC7" => "\xE5\xAE\x8C", + "\xE8\xC8" => "\xE5\xAE\x9B", + "\xE8\xC9" => "\xE6\xA2\xA1", + "\xE8\xCA" => "\xE6\xA4\x80", + "\xE8\xCB" => "\xE6\xB5\xA3", + "\xE8\xCC" => "\xE7\x8E\xA9", + "\xE8\xCD" => "\xE7\x90\x93", + "\xE8\xCE" => "\xE7\x90\xAC", + "\xE8\xCF" => "\xE7\xA2\x97", + "\xE8\xD0" => "\xE7\xB7\xA9", + "\xE8\xD1" => "\xE7\xBF\xAB", + "\xE8\xD2" => "\xE8\x84\x98", + "\xE8\xD3" => "\xE8\x85\x95", + "\xE8\xD4" => "\xE8\x8E\x9E", + "\xE8\xD5" => "\xE8\xB1\x8C", + "\xE8\xD6" => "\xE9\x98\xAE", + "\xE8\xD7" => "\xE9\xA0\x91", + "\xE8\xD8" => "\xE6\x9B\xB0", + "\xE8\xD9" => "\xE5\xBE\x80", + "\xE8\xDA" => "\xE6\x97\xBA", + "\xE8\xDB" => "\xE6\x9E\x89", + "\xE8\xDC" => "\xE6\xB1\xAA", + "\xE8\xDD" => "\xE7\x8E\x8B", + "\xE8\xDE" => "\xE5\x80\xAD", + "\xE8\xDF" => "\xE5\xA8\x83", + "\xE8\xE0" => "\xE6\xAD\xAA", + "\xE8\xE1" => "\xE7\x9F\xAE", + "\xE8\xE2" => "\xE5\xA4\x96", + "\xE8\xE3" => "\xE5\xB5\xAC", + "\xE8\xE4" => "\xE5\xB7\x8D", + "\xE8\xE5" => "\xE7\x8C\xA5", + "\xE8\xE6" => "\xE7\x95\x8F", + "\xE8\xE7" => "\xEF\xA6\xBA", + "\xE8\xE8" => "\xEF\xA6\xBB", + "\xE8\xE9" => "\xE5\x83\xA5", + "\xE8\xEA" => "\xE5\x87\xB9", + "\xE8\xEB" => "\xE5\xA0\xAF", + "\xE8\xEC" => "\xE5\xA4\xAD", + "\xE8\xED" => "\xE5\xA6\x96", + "\xE8\xEE" => "\xE5\xA7\x9A", + "\xE8\xEF" => "\xE5\xAF\xA5", + "\xE8\xF0" => "\xEF\xA6\xBC", + "\xE8\xF1" => "\xEF\xA6\xBD", + "\xE8\xF2" => "\xE5\xB6\xA2", + "\xE8\xF3" => "\xE6\x8B\x97", + "\xE8\xF4" => "\xE6\x90\x96", + "\xE8\xF5" => "\xE6\x92\x93", + "\xE8\xF6" => "\xE6\x93\xBE", + "\xE8\xF7" => "\xEF\xA6\xBE", + "\xE8\xF8" => "\xE6\x9B\x9C", + "\xE8\xF9" => "\xEF\xA6\xBF", + "\xE8\xFA" => "\xE6\xA9\x88", + "\xE8\xFB" => "\xEF\xA7\x80", + "\xE8\xFC" => "\xE7\x87\xBF", + "\xE8\xFD" => "\xE7\x91\xA4", + "\xE8\xFE" => "\xEF\xA7\x81", + "\xE9\xA1" => "\xE7\xAA\x88", + "\xE9\xA2" => "\xE7\xAA\xAF", + "\xE9\xA3" => "\xE7\xB9\x87", + "\xE9\xA4" => "\xE7\xB9\x9E", + "\xE9\xA5" => "\xE8\x80\x80", + "\xE9\xA6" => "\xE8\x85\xB0", + "\xE9\xA7" => "\xEF\xA7\x82", + "\xE9\xA8" => "\xE8\x9F\xAF", + "\xE9\xA9" => "\xE8\xA6\x81", + "\xE9\xAA" => "\xE8\xAC\xA0", + "\xE9\xAB" => "\xE9\x81\x99", + "\xE9\xAC" => "\xEF\xA7\x83", + "\xE9\xAD" => "\xE9\x82\x80", + "\xE9\xAE" => "\xE9\xA5\x92", + "\xE9\xAF" => "\xE6\x85\xBE", + "\xE9\xB0" => "\xE6\xAC\xB2", + "\xE9\xB1" => "\xE6\xB5\xB4", + "\xE9\xB2" => "\xE7\xB8\x9F", + "\xE9\xB3" => "\xE8\xA4\xA5", + "\xE9\xB4" => "\xE8\xBE\xB1", + "\xE9\xB5" => "\xE4\xBF\x91", + "\xE9\xB6" => "\xE5\x82\xAD", + "\xE9\xB7" => "\xE5\x86\x97", + "\xE9\xB8" => "\xE5\x8B\x87", + "\xE9\xB9" => "\xE5\x9F\x87", + "\xE9\xBA" => "\xE5\xA2\x89", + "\xE9\xBB" => "\xE5\xAE\xB9", + "\xE9\xBC" => "\xE5\xBA\xB8", + "\xE9\xBD" => "\xE6\x85\x82", + "\xE9\xBE" => "\xE6\xA6\x95", + "\xE9\xBF" => "\xE6\xB6\x8C", + "\xE9\xC0" => "\xE6\xB9\xA7", + "\xE9\xC1" => "\xE6\xBA\xB6", + "\xE9\xC2" => "\xE7\x86\x94", + "\xE9\xC3" => "\xE7\x91\xA2", + "\xE9\xC4" => "\xE7\x94\xA8", + "\xE9\xC5" => "\xE7\x94\xAC", + "\xE9\xC6" => "\xE8\x81\xB3", + "\xE9\xC7" => "\xE8\x8C\xB8", + "\xE9\xC8" => "\xE8\x93\x89", + "\xE9\xC9" => "\xE8\xB8\x8A", + "\xE9\xCA" => "\xE9\x8E\x94", + "\xE9\xCB" => "\xE9\x8F\x9E", + "\xE9\xCC" => "\xEF\xA7\x84", + "\xE9\xCD" => "\xE4\xBA\x8E", + "\xE9\xCE" => "\xE4\xBD\x91", + "\xE9\xCF" => "\xE5\x81\xB6", + "\xE9\xD0" => "\xE5\x84\xAA", + "\xE9\xD1" => "\xE5\x8F\x88", + "\xE9\xD2" => "\xE5\x8F\x8B", + "\xE9\xD3" => "\xE5\x8F\xB3", + "\xE9\xD4" => "\xE5\xAE\x87", + "\xE9\xD5" => "\xE5\xAF\x93", + "\xE9\xD6" => "\xE5\xB0\xA4", + "\xE9\xD7" => "\xE6\x84\x9A", + "\xE9\xD8" => "\xE6\x86\x82", + "\xE9\xD9" => "\xE6\x97\xB4", + "\xE9\xDA" => "\xE7\x89\x9B", + "\xE9\xDB" => "\xE7\x8E\x97", + "\xE9\xDC" => "\xE7\x91\x80", + "\xE9\xDD" => "\xE7\x9B\x82", + "\xE9\xDE" => "\xE7\xA5\x90", + "\xE9\xDF" => "\xE7\xA6\x91", + "\xE9\xE0" => "\xE7\xA6\xB9", + "\xE9\xE1" => "\xE7\xB4\x86", + "\xE9\xE2" => "\xE7\xBE\xBD", + "\xE9\xE3" => "\xE8\x8A\x8B", + "\xE9\xE4" => "\xE8\x97\x95", + "\xE9\xE5" => "\xE8\x99\x9E", + "\xE9\xE6" => "\xE8\xBF\x82", + "\xE9\xE7" => "\xE9\x81\x87", + "\xE9\xE8" => "\xE9\x83\xB5", + "\xE9\xE9" => "\xE9\x87\xAA", + "\xE9\xEA" => "\xE9\x9A\x85", + "\xE9\xEB" => "\xE9\x9B\xA8", + "\xE9\xEC" => "\xE9\x9B\xA9", + "\xE9\xED" => "\xE5\x8B\x96", + "\xE9\xEE" => "\xE5\xBD\xA7", + "\xE9\xEF" => "\xE6\x97\xAD", + "\xE9\xF0" => "\xE6\x98\xB1", + "\xE9\xF1" => "\xE6\xA0\xAF", + "\xE9\xF2" => "\xE7\x85\x9C", + "\xE9\xF3" => "\xE7\xA8\xB6", + "\xE9\xF4" => "\xE9\x83\x81", + "\xE9\xF5" => "\xE9\xA0\x8A", + "\xE9\xF6" => "\xE4\xBA\x91", + "\xE9\xF7" => "\xEF\xA7\x85", + "\xE9\xF8" => "\xE6\xA9\x92", + "\xE9\xF9" => "\xE6\xAE\x9E", + "\xE9\xFA" => "\xE6\xBE\x90", + "\xE9\xFB" => "\xE7\x86\x89", + "\xE9\xFC" => "\xE8\x80\x98", + "\xE9\xFD" => "\xE8\x8A\xB8", + "\xE9\xFE" => "\xE8\x95\x93", + "\xEA\xA1" => "\xE9\x81\x8B", + "\xEA\xA2" => "\xE9\x9A\x95", + "\xEA\xA3" => "\xE9\x9B\xB2", + "\xEA\xA4" => "\xE9\x9F\xBB", + "\xEA\xA5" => "\xE8\x94\x9A", + "\xEA\xA6" => "\xE9\xAC\xB1", + "\xEA\xA7" => "\xE4\xBA\x90", + "\xEA\xA8" => "\xE7\x86\x8A", + "\xEA\xA9" => "\xE9\x9B\x84", + "\xEA\xAA" => "\xE5\x85\x83", + "\xEA\xAB" => "\xE5\x8E\x9F", + "\xEA\xAC" => "\xE5\x93\xA1", + "\xEA\xAD" => "\xE5\x9C\x93", + "\xEA\xAE" => "\xE5\x9C\x92", + "\xEA\xAF" => "\xE5\x9E\xA3", + "\xEA\xB0" => "\xE5\xAA\x9B", + "\xEA\xB1" => "\xE5\xAB\x84", + "\xEA\xB2" => "\xE5\xAF\x83", + "\xEA\xB3" => "\xE6\x80\xA8", + "\xEA\xB4" => "\xE6\x84\xBF", + "\xEA\xB5" => "\xE6\x8F\xB4", + "\xEA\xB6" => "\xE6\xB2\x85", + "\xEA\xB7" => "\xE6\xB4\xB9", + "\xEA\xB8" => "\xE6\xB9\xB2", + "\xEA\xB9" => "\xE6\xBA\x90", + "\xEA\xBA" => "\xE7\x88\xB0", + "\xEA\xBB" => "\xE7\x8C\xBF", + "\xEA\xBC" => "\xE7\x91\x97", + "\xEA\xBD" => "\xE8\x8B\x91", + "\xEA\xBE" => "\xE8\xA2\x81", + "\xEA\xBF" => "\xE8\xBD\x85", + "\xEA\xC0" => "\xE9\x81\xA0", + "\xEA\xC1" => "\xEF\xA7\x86", + "\xEA\xC2" => "\xE9\x99\xA2", + "\xEA\xC3" => "\xE9\xA1\x98", + "\xEA\xC4" => "\xE9\xB4\x9B", + "\xEA\xC5" => "\xE6\x9C\x88", + "\xEA\xC6" => "\xE8\xB6\x8A", + "\xEA\xC7" => "\xE9\x89\x9E", + "\xEA\xC8" => "\xE4\xBD\x8D", + "\xEA\xC9" => "\xE5\x81\x89", + "\xEA\xCA" => "\xE5\x83\x9E", + "\xEA\xCB" => "\xE5\x8D\xB1", + "\xEA\xCC" => "\xE5\x9C\x8D", + "\xEA\xCD" => "\xE5\xA7\x94", + "\xEA\xCE" => "\xE5\xA8\x81", + "\xEA\xCF" => "\xE5\xB0\x89", + "\xEA\xD0" => "\xE6\x85\xB0", + "\xEA\xD1" => "\xE6\x9A\x90", + "\xEA\xD2" => "\xE6\xB8\xAD", + "\xEA\xD3" => "\xE7\x88\xB2", + "\xEA\xD4" => "\xE7\x91\x8B", + "\xEA\xD5" => "\xE7\xB7\xAF", + "\xEA\xD6" => "\xE8\x83\x83", + "\xEA\xD7" => "\xE8\x90\x8E", + "\xEA\xD8" => "\xE8\x91\xA6", + "\xEA\xD9" => "\xE8\x94\xBF", + "\xEA\xDA" => "\xE8\x9D\x9F", + "\xEA\xDB" => "\xE8\xA1\x9B", + "\xEA\xDC" => "\xE8\xA4\x98", + "\xEA\xDD" => "\xE8\xAC\x82", + "\xEA\xDE" => "\xE9\x81\x95", + "\xEA\xDF" => "\xE9\x9F\x8B", + "\xEA\xE0" => "\xE9\xAD\x8F", + "\xEA\xE1" => "\xE4\xB9\xB3", + "\xEA\xE2" => "\xE4\xBE\x91", + "\xEA\xE3" => "\xE5\x84\x92", + "\xEA\xE4" => "\xE5\x85\xAA", + "\xEA\xE5" => "\xEF\xA7\x87", + "\xEA\xE6" => "\xE5\x94\xAF", + "\xEA\xE7" => "\xE5\x96\xA9", + "\xEA\xE8" => "\xE5\xAD\xBA", + "\xEA\xE9" => "\xE5\xAE\xA5", + "\xEA\xEA" => "\xE5\xB9\xBC", + "\xEA\xEB" => "\xE5\xB9\xBD", + "\xEA\xEC" => "\xE5\xBA\xBE", + "\xEA\xED" => "\xE6\x82\xA0", + "\xEA\xEE" => "\xE6\x83\x9F", + "\xEA\xEF" => "\xE6\x84\x88", + "\xEA\xF0" => "\xE6\x84\x89", + "\xEA\xF1" => "\xE6\x8F\x84", + "\xEA\xF2" => "\xE6\x94\xB8", + "\xEA\xF3" => "\xE6\x9C\x89", + "\xEA\xF4" => "\xEF\xA7\x88", + "\xEA\xF5" => "\xE6\x9F\x94", + "\xEA\xF6" => "\xE6\x9F\x9A", + "\xEA\xF7" => "\xEF\xA7\x89", + "\xEA\xF8" => "\xE6\xA5\xA1", + "\xEA\xF9" => "\xE6\xA5\xA2", + "\xEA\xFA" => "\xE6\xB2\xB9", + "\xEA\xFB" => "\xE6\xB4\xA7", + "\xEA\xFC" => "\xEF\xA7\x8A", + "\xEA\xFD" => "\xE6\xB8\xB8", + "\xEA\xFE" => "\xEF\xA7\x8B", + "\xEB\xA1" => "\xE6\xBF\xA1", + "\xEB\xA2" => "\xE7\x8C\xB6", + "\xEB\xA3" => "\xE7\x8C\xB7", + "\xEB\xA4" => "\xEF\xA7\x8C", + "\xEB\xA5" => "\xE7\x91\x9C", + "\xEB\xA6" => "\xE7\x94\xB1", + "\xEB\xA7" => "\xEF\xA7\x8D", + "\xEB\xA8" => "\xE7\x99\x92", + "\xEB\xA9" => "\xEF\xA7\x8E", + "\xEB\xAA" => "\xEF\xA7\x8F", + "\xEB\xAB" => "\xE7\xB6\xAD", + "\xEB\xAC" => "\xE8\x87\xBE", + "\xEB\xAD" => "\xE8\x90\xB8", + "\xEB\xAE" => "\xE8\xA3\x95", + "\xEB\xAF" => "\xE8\xAA\x98", + "\xEB\xB0" => "\xE8\xAB\x9B", + "\xEB\xB1" => "\xE8\xAB\xAD", + "\xEB\xB2" => "\xE8\xB8\xB0", + "\xEB\xB3" => "\xE8\xB9\x82", + "\xEB\xB4" => "\xE9\x81\x8A", + "\xEB\xB5" => "\xE9\x80\xBE", + "\xEB\xB6" => "\xE9\x81\xBA", + "\xEB\xB7" => "\xE9\x85\x89", + "\xEB\xB8" => "\xE9\x87\x89", + "\xEB\xB9" => "\xE9\x8D\xAE", + "\xEB\xBA" => "\xEF\xA7\x90", + "\xEB\xBB" => "\xEF\xA7\x91", + "\xEB\xBC" => "\xE5\xA0\x89", + "\xEB\xBD" => "\xEF\xA7\x92", + "\xEB\xBE" => "\xE6\xAF\x93", + "\xEB\xBF" => "\xE8\x82\x89", + "\xEB\xC0" => "\xE8\x82\xB2", + "\xEB\xC1" => "\xEF\xA7\x93", + "\xEB\xC2" => "\xEF\xA7\x94", + "\xEB\xC3" => "\xE5\x85\x81", + "\xEB\xC4" => "\xE5\xA5\xAB", + "\xEB\xC5" => "\xE5\xB0\xB9", + "\xEB\xC6" => "\xEF\xA7\x95", + "\xEB\xC7" => "\xEF\xA7\x96", + "\xEB\xC8" => "\xE6\xBD\xA4", + "\xEB\xC9" => "\xE7\x8E\xA7", + "\xEB\xCA" => "\xE8\x83\xA4", + "\xEB\xCB" => "\xE8\xB4\x87", + "\xEB\xCC" => "\xEF\xA7\x97", + "\xEB\xCD" => "\xE9\x88\x97", + "\xEB\xCE" => "\xE9\x96\x8F", + "\xEB\xCF" => "\xEF\xA7\x98", + "\xEB\xD0" => "\xEF\xA7\x99", + "\xEB\xD1" => "\xEF\xA7\x9A", + "\xEB\xD2" => "\xEF\xA7\x9B", + "\xEB\xD3" => "\xE8\x81\xBF", + "\xEB\xD4" => "\xE6\x88\x8E", + "\xEB\xD5" => "\xE7\x80\x9C", + "\xEB\xD6" => "\xE7\xB5\xA8", + "\xEB\xD7" => "\xE8\x9E\x8D", + "\xEB\xD8" => "\xEF\xA7\x9C", + "\xEB\xD9" => "\xE5\x9E\xA0", + "\xEB\xDA" => "\xE6\x81\xA9", + "\xEB\xDB" => "\xE6\x85\x87", + "\xEB\xDC" => "\xE6\xAE\xB7", + "\xEB\xDD" => "\xE8\xAA\xBE", + "\xEB\xDE" => "\xE9\x8A\x80", + "\xEB\xDF" => "\xE9\x9A\xB1", + "\xEB\xE0" => "\xE4\xB9\x99", + "\xEB\xE1" => "\xE5\x90\x9F", + "\xEB\xE2" => "\xE6\xB7\xAB", + "\xEB\xE3" => "\xE8\x94\xAD", + "\xEB\xE4" => "\xE9\x99\xB0", + "\xEB\xE5" => "\xE9\x9F\xB3", + "\xEB\xE6" => "\xE9\xA3\xAE", + "\xEB\xE7" => "\xE6\x8F\x96", + "\xEB\xE8" => "\xE6\xB3\xA3", + "\xEB\xE9" => "\xE9\x82\x91", + "\xEB\xEA" => "\xE5\x87\x9D", + "\xEB\xEB" => "\xE6\x87\x89", + "\xEB\xEC" => "\xE8\x86\xBA", + "\xEB\xED" => "\xE9\xB7\xB9", + "\xEB\xEE" => "\xE4\xBE\x9D", + "\xEB\xEF" => "\xE5\x80\x9A", + "\xEB\xF0" => "\xE5\x84\x80", + "\xEB\xF1" => "\xE5\xAE\x9C", + "\xEB\xF2" => "\xE6\x84\x8F", + "\xEB\xF3" => "\xE6\x87\xBF", + "\xEB\xF4" => "\xE6\x93\xAC", + "\xEB\xF5" => "\xE6\xA4\x85", + "\xEB\xF6" => "\xE6\xAF\x85", + "\xEB\xF7" => "\xE7\x96\x91", + "\xEB\xF8" => "\xE7\x9F\xA3", + "\xEB\xF9" => "\xE7\xBE\xA9", + "\xEB\xFA" => "\xE8\x89\xA4", + "\xEB\xFB" => "\xE8\x96\x8F", + "\xEB\xFC" => "\xE8\x9F\xBB", + "\xEB\xFD" => "\xE8\xA1\xA3", + "\xEB\xFE" => "\xE8\xAA\xBC", + "\xEC\xA1" => "\xE8\xAD\xB0", + "\xEC\xA2" => "\xE9\x86\xAB", + "\xEC\xA3" => "\xE4\xBA\x8C", + "\xEC\xA4" => "\xE4\xBB\xA5", + "\xEC\xA5" => "\xE4\xBC\x8A", + "\xEC\xA6" => "\xEF\xA7\x9D", + "\xEC\xA7" => "\xEF\xA7\x9E", + "\xEC\xA8" => "\xE5\xA4\xB7", + "\xEC\xA9" => "\xE5\xA7\xA8", + "\xEC\xAA" => "\xEF\xA7\x9F", + "\xEC\xAB" => "\xE5\xB7\xB2", + "\xEC\xAC" => "\xE5\xBC\x9B", + "\xEC\xAD" => "\xE5\xBD\x9B", + "\xEC\xAE" => "\xE6\x80\xA1", + "\xEC\xAF" => "\xEF\xA7\xA0", + "\xEC\xB0" => "\xEF\xA7\xA1", + "\xEC\xB1" => "\xEF\xA7\xA2", + "\xEC\xB2" => "\xEF\xA7\xA3", + "\xEC\xB3" => "\xE7\x88\xBE", + "\xEC\xB4" => "\xE7\x8F\xA5", + "\xEC\xB5" => "\xEF\xA7\xA4", + "\xEC\xB6" => "\xE7\x95\xB0", + "\xEC\xB7" => "\xE7\x97\x8D", + "\xEC\xB8" => "\xEF\xA7\xA5", + "\xEC\xB9" => "\xE7\xA7\xBB", + "\xEC\xBA" => "\xEF\xA7\xA6", + "\xEC\xBB" => "\xE8\x80\x8C", + "\xEC\xBC" => "\xE8\x80\xB3", + "\xEC\xBD" => "\xE8\x82\x84", + "\xEC\xBE" => "\xE8\x8B\xA1", + "\xEC\xBF" => "\xE8\x8D\x91", + "\xEC\xC0" => "\xEF\xA7\xA7", + "\xEC\xC1" => "\xEF\xA7\xA8", + "\xEC\xC2" => "\xE8\xB2\xBD", + "\xEC\xC3" => "\xE8\xB2\xB3", + "\xEC\xC4" => "\xE9\x82\x87", + "\xEC\xC5" => "\xEF\xA7\xA9", + "\xEC\xC6" => "\xEF\xA7\xAA", + "\xEC\xC7" => "\xE9\xA3\xB4", + "\xEC\xC8" => "\xE9\xA4\x8C", + "\xEC\xC9" => "\xEF\xA7\xAB", + "\xEC\xCA" => "\xEF\xA7\xAC", + "\xEC\xCB" => "\xE7\x80\xB7", + "\xEC\xCC" => "\xE7\x9B\x8A", + "\xEC\xCD" => "\xE7\xBF\x8A", + "\xEC\xCE" => "\xE7\xBF\x8C", + "\xEC\xCF" => "\xE7\xBF\xBC", + "\xEC\xD0" => "\xE8\xAC\x9A", + "\xEC\xD1" => "\xE4\xBA\xBA", + "\xEC\xD2" => "\xE4\xBB\x81", + "\xEC\xD3" => "\xE5\x88\x83", + "\xEC\xD4" => "\xE5\x8D\xB0", + "\xEC\xD5" => "\xEF\xA7\xAD", + "\xEC\xD6" => "\xE5\x92\xBD", + "\xEC\xD7" => "\xE5\x9B\xA0", + "\xEC\xD8" => "\xE5\xA7\xBB", + "\xEC\xD9" => "\xE5\xAF\x85", + "\xEC\xDA" => "\xE5\xBC\x95", + "\xEC\xDB" => "\xE5\xBF\x8D", + "\xEC\xDC" => "\xE6\xB9\xAE", + "\xEC\xDD" => "\xEF\xA7\xAE", + "\xEC\xDE" => "\xEF\xA7\xAF", + "\xEC\xDF" => "\xE7\xB5\xAA", + "\xEC\xE0" => "\xE8\x8C\xB5", + "\xEC\xE1" => "\xEF\xA7\xB0", + "\xEC\xE2" => "\xE8\x9A\x93", + "\xEC\xE3" => "\xE8\xAA\x8D", + "\xEC\xE4" => "\xEF\xA7\xB1", + "\xEC\xE5" => "\xE9\x9D\xAD", + "\xEC\xE6" => "\xE9\x9D\xB7", + "\xEC\xE7" => "\xEF\xA7\xB2", + "\xEC\xE8" => "\xEF\xA7\xB3", + "\xEC\xE9" => "\xE4\xB8\x80", + "\xEC\xEA" => "\xE4\xBD\x9A", + "\xEC\xEB" => "\xE4\xBD\xBE", + "\xEC\xEC" => "\xE5\xA3\xB9", + "\xEC\xED" => "\xE6\x97\xA5", + "\xEC\xEE" => "\xE6\xBA\xA2", + "\xEC\xEF" => "\xE9\x80\xB8", + "\xEC\xF0" => "\xE9\x8E\xB0", + "\xEC\xF1" => "\xE9\xA6\xB9", + "\xEC\xF2" => "\xE4\xBB\xBB", + "\xEC\xF3" => "\xE5\xA3\xAC", + "\xEC\xF4" => "\xE5\xA6\x8A", + "\xEC\xF5" => "\xE5\xA7\x99", + "\xEC\xF6" => "\xE6\x81\x81", + "\xEC\xF7" => "\xEF\xA7\xB4", + "\xEC\xF8" => "\xEF\xA7\xB5", + "\xEC\xF9" => "\xE7\xA8\x94", + "\xEC\xFA" => "\xEF\xA7\xB6", + "\xEC\xFB" => "\xE8\x8D\x8F", + "\xEC\xFC" => "\xE8\xB3\x83", + "\xEC\xFD" => "\xE5\x85\xA5", + "\xEC\xFE" => "\xE5\x8D\x84", + "\xED\xA1" => "\xEF\xA7\xB7", + "\xED\xA2" => "\xEF\xA7\xB8", + "\xED\xA3" => "\xEF\xA7\xB9", + "\xED\xA4" => "\xE4\xBB\x8D", + "\xED\xA5" => "\xE5\x89\xA9", + "\xED\xA6" => "\xE5\xAD\x95", + "\xED\xA7" => "\xE8\x8A\xBF", + "\xED\xA8" => "\xE4\xBB\x94", + "\xED\xA9" => "\xE5\x88\xBA", + "\xED\xAA" => "\xE5\x92\xA8", + "\xED\xAB" => "\xE5\xA7\x89", + "\xED\xAC" => "\xE5\xA7\xBF", + "\xED\xAD" => "\xE5\xAD\x90", + "\xED\xAE" => "\xE5\xAD\x97", + "\xED\xAF" => "\xE5\xAD\x9C", + "\xED\xB0" => "\xE6\x81\xA3", + "\xED\xB1" => "\xE6\x85\x88", + "\xED\xB2" => "\xE6\xBB\x8B", + "\xED\xB3" => "\xE7\x82\x99", + "\xED\xB4" => "\xE7\x85\xAE", + "\xED\xB5" => "\xE7\x8E\x86", + "\xED\xB6" => "\xE7\x93\xB7", + "\xED\xB7" => "\xE7\x96\xB5", + "\xED\xB8" => "\xE7\xA3\x81", + "\xED\xB9" => "\xE7\xB4\xAB", + "\xED\xBA" => "\xE8\x80\x85", + "\xED\xBB" => "\xE8\x87\xAA", + "\xED\xBC" => "\xE8\x8C\xA8", + "\xED\xBD" => "\xE8\x94\x97", + "\xED\xBE" => "\xE8\x97\x89", + "\xED\xBF" => "\xE8\xAB\xAE", + "\xED\xC0" => "\xE8\xB3\x87", + "\xED\xC1" => "\xE9\x9B\x8C", + "\xED\xC2" => "\xE4\xBD\x9C", + "\xED\xC3" => "\xE5\x8B\xBA", + "\xED\xC4" => "\xE5\x9A\xBC", + "\xED\xC5" => "\xE6\x96\xAB", + "\xED\xC6" => "\xE6\x98\xA8", + "\xED\xC7" => "\xE7\x81\xBC", + "\xED\xC8" => "\xE7\x82\xB8", + "\xED\xC9" => "\xE7\x88\xB5", + "\xED\xCA" => "\xE7\xB6\xBD", + "\xED\xCB" => "\xE8\x8A\x8D", + "\xED\xCC" => "\xE9\x85\x8C", + "\xED\xCD" => "\xE9\x9B\x80", + "\xED\xCE" => "\xE9\xB5\xB2", + "\xED\xCF" => "\xE5\xAD\xB1", + "\xED\xD0" => "\xE6\xA3\xA7", + "\xED\xD1" => "\xE6\xAE\x98", + "\xED\xD2" => "\xE6\xBD\xBA", + "\xED\xD3" => "\xE7\x9B\x9E", + "\xED\xD4" => "\xE5\xB2\x91", + "\xED\xD5" => "\xE6\x9A\xAB", + "\xED\xD6" => "\xE6\xBD\x9B", + "\xED\xD7" => "\xE7\xAE\xB4", + "\xED\xD8" => "\xE7\xB0\xAA", + "\xED\xD9" => "\xE8\xA0\xB6", + "\xED\xDA" => "\xE9\x9B\x9C", + "\xED\xDB" => "\xE4\xB8\x88", + "\xED\xDC" => "\xE4\xBB\x97", + "\xED\xDD" => "\xE5\x8C\xA0", + "\xED\xDE" => "\xE5\xA0\xB4", + "\xED\xDF" => "\xE5\xA2\xBB", + "\xED\xE0" => "\xE5\xA3\xAF", + "\xED\xE1" => "\xE5\xA5\xAC", + "\xED\xE2" => "\xE5\xB0\x87", + "\xED\xE3" => "\xE5\xB8\xB3", + "\xED\xE4" => "\xE5\xBA\x84", + "\xED\xE5" => "\xE5\xBC\xB5", + "\xED\xE6" => "\xE6\x8E\x8C", + "\xED\xE7" => "\xE6\x9A\xB2", + "\xED\xE8" => "\xE6\x9D\x96", + "\xED\xE9" => "\xE6\xA8\x9F", + "\xED\xEA" => "\xE6\xAA\xA3", + "\xED\xEB" => "\xE6\xAC\x8C", + "\xED\xEC" => "\xE6\xBC\xBF", + "\xED\xED" => "\xE7\x89\x86", + "\xED\xEE" => "\xEF\xA7\xBA", + "\xED\xEF" => "\xE7\x8D\x90", + "\xED\xF0" => "\xE7\x92\x8B", + "\xED\xF1" => "\xE7\xAB\xA0", + "\xED\xF2" => "\xE7\xB2\xA7", + "\xED\xF3" => "\xE8\x85\xB8", + "\xED\xF4" => "\xE8\x87\x9F", + "\xED\xF5" => "\xE8\x87\xA7", + "\xED\xF6" => "\xE8\x8E\x8A", + "\xED\xF7" => "\xE8\x91\xAC", + "\xED\xF8" => "\xE8\x94\xA3", + "\xED\xF9" => "\xE8\x96\x94", + "\xED\xFA" => "\xE8\x97\x8F", + "\xED\xFB" => "\xE8\xA3\x9D", + "\xED\xFC" => "\xE8\xB4\x93", + "\xED\xFD" => "\xE9\x86\xAC", + "\xED\xFE" => "\xE9\x95\xB7", + "\xEE\xA1" => "\xE9\x9A\x9C", + "\xEE\xA2" => "\xE5\x86\x8D", + "\xEE\xA3" => "\xE5\x93\x89", + "\xEE\xA4" => "\xE5\x9C\xA8", + "\xEE\xA5" => "\xE5\xAE\xB0", + "\xEE\xA6" => "\xE6\x89\x8D", + "\xEE\xA7" => "\xE6\x9D\x90", + "\xEE\xA8" => "\xE6\xA0\xBD", + "\xEE\xA9" => "\xE6\xA2\x93", + "\xEE\xAA" => "\xE6\xB8\xBD", + "\xEE\xAB" => "\xE6\xBB\x93", + "\xEE\xAC" => "\xE7\x81\xBD", + "\xEE\xAD" => "\xE7\xB8\xA1", + "\xEE\xAE" => "\xE8\xA3\x81", + "\xEE\xAF" => "\xE8\xB2\xA1", + "\xEE\xB0" => "\xE8\xBC\x89", + "\xEE\xB1" => "\xE9\xBD\x8B", + "\xEE\xB2" => "\xE9\xBD\x8E", + "\xEE\xB3" => "\xE7\x88\xAD", + "\xEE\xB4" => "\xE7\xAE\x8F", + "\xEE\xB5" => "\xE8\xAB\x8D", + "\xEE\xB6" => "\xE9\x8C\x9A", + "\xEE\xB7" => "\xE4\xBD\x87", + "\xEE\xB8" => "\xE4\xBD\x8E", + "\xEE\xB9" => "\xE5\x84\xB2", + "\xEE\xBA" => "\xE5\x92\x80", + "\xEE\xBB" => "\xE5\xA7\x90", + "\xEE\xBC" => "\xE5\xBA\x95", + "\xEE\xBD" => "\xE6\x8A\xB5", + "\xEE\xBE" => "\xE6\x9D\xB5", + "\xEE\xBF" => "\xE6\xA5\xAE", + "\xEE\xC0" => "\xE6\xA8\x97", + "\xEE\xC1" => "\xE6\xB2\xAE", + "\xEE\xC2" => "\xE6\xB8\x9A", + "\xEE\xC3" => "\xE7\x8B\x99", + "\xEE\xC4" => "\xE7\x8C\xAA", + "\xEE\xC5" => "\xE7\x96\xBD", + "\xEE\xC6" => "\xE7\xAE\xB8", + "\xEE\xC7" => "\xE7\xB4\xB5", + "\xEE\xC8" => "\xE8\x8B\xA7", + "\xEE\xC9" => "\xE8\x8F\xB9", + "\xEE\xCA" => "\xE8\x91\x97", + "\xEE\xCB" => "\xE8\x97\xB7", + "\xEE\xCC" => "\xE8\xA9\x9B", + "\xEE\xCD" => "\xE8\xB2\xAF", + "\xEE\xCE" => "\xE8\xBA\x87", + "\xEE\xCF" => "\xE9\x80\x99", + "\xEE\xD0" => "\xE9\x82\xB8", + "\xEE\xD1" => "\xE9\x9B\x8E", + "\xEE\xD2" => "\xE9\xBD\x9F", + "\xEE\xD3" => "\xE5\x8B\xA3", + "\xEE\xD4" => "\xE5\x90\x8A", + "\xEE\xD5" => "\xE5\xAB\xA1", + "\xEE\xD6" => "\xE5\xAF\x82", + "\xEE\xD7" => "\xE6\x91\x98", + "\xEE\xD8" => "\xE6\x95\xB5", + "\xEE\xD9" => "\xE6\xBB\xB4", + "\xEE\xDA" => "\xE7\x8B\x84", + "\xEE\xDB" => "\xEF\xA7\xBB", + "\xEE\xDC" => "\xE7\x9A\x84", + "\xEE\xDD" => "\xE7\xA9\x8D", + "\xEE\xDE" => "\xE7\xAC\x9B", + "\xEE\xDF" => "\xE7\xB1\x8D", + "\xEE\xE0" => "\xE7\xB8\xBE", + "\xEE\xE1" => "\xE7\xBF\x9F", + "\xEE\xE2" => "\xE8\x8D\xBB", + "\xEE\xE3" => "\xE8\xAC\xAB", + "\xEE\xE4" => "\xE8\xB3\x8A", + "\xEE\xE5" => "\xE8\xB5\xA4", + "\xEE\xE6" => "\xE8\xB7\xA1", + "\xEE\xE7" => "\xE8\xB9\x9F", + "\xEE\xE8" => "\xE8\xBF\xAA", + "\xEE\xE9" => "\xE8\xBF\xB9", + "\xEE\xEA" => "\xE9\x81\xA9", + "\xEE\xEB" => "\xE9\x8F\x91", + "\xEE\xEC" => "\xE4\xBD\x83", + "\xEE\xED" => "\xE4\xBD\xBA", + "\xEE\xEE" => "\xE5\x82\xB3", + "\xEE\xEF" => "\xE5\x85\xA8", + "\xEE\xF0" => "\xE5\x85\xB8", + "\xEE\xF1" => "\xE5\x89\x8D", + "\xEE\xF2" => "\xE5\x89\xAA", + "\xEE\xF3" => "\xE5\xA1\xA1", + "\xEE\xF4" => "\xE5\xA1\xBC", + "\xEE\xF5" => "\xE5\xA5\xA0", + "\xEE\xF6" => "\xE5\xB0\x88", + "\xEE\xF7" => "\xE5\xB1\x95", + "\xEE\xF8" => "\xE5\xBB\x9B", + "\xEE\xF9" => "\xE6\x82\x9B", + "\xEE\xFA" => "\xE6\x88\xB0", + "\xEE\xFB" => "\xE6\xA0\x93", + "\xEE\xFC" => "\xE6\xAE\xBF", + "\xEE\xFD" => "\xE6\xB0\x88", + "\xEE\xFE" => "\xE6\xBE\xB1", + "\xEF\xA1" => "\xE7\x85\x8E", + "\xEF\xA2" => "\xE7\x90\xA0", + "\xEF\xA3" => "\xE7\x94\xB0", + "\xEF\xA4" => "\xE7\x94\xB8", + "\xEF\xA5" => "\xE7\x95\x91", + "\xEF\xA6" => "\xE7\x99\xB2", + "\xEF\xA7" => "\xE7\xAD\x8C", + "\xEF\xA8" => "\xE7\xAE\x8B", + "\xEF\xA9" => "\xE7\xAE\xAD", + "\xEF\xAA" => "\xE7\xAF\x86", + "\xEF\xAB" => "\xE7\xBA\x8F", + "\xEF\xAC" => "\xE8\xA9\xAE", + "\xEF\xAD" => "\xE8\xBC\xBE", + "\xEF\xAE" => "\xE8\xBD\x89", + "\xEF\xAF" => "\xE9\x88\xBF", + "\xEF\xB0" => "\xE9\x8A\x93", + "\xEF\xB1" => "\xE9\x8C\xA2", + "\xEF\xB2" => "\xE9\x90\xAB", + "\xEF\xB3" => "\xE9\x9B\xBB", + "\xEF\xB4" => "\xE9\xA1\x9A", + "\xEF\xB5" => "\xE9\xA1\xAB", + "\xEF\xB6" => "\xE9\xA4\x9E", + "\xEF\xB7" => "\xE5\x88\x87", + "\xEF\xB8" => "\xE6\x88\xAA", + "\xEF\xB9" => "\xE6\x8A\x98", + "\xEF\xBA" => "\xE6\xB5\x99", + "\xEF\xBB" => "\xE7\x99\xA4", + "\xEF\xBC" => "\xE7\xAB\x8A", + "\xEF\xBD" => "\xE7\xAF\x80", + "\xEF\xBE" => "\xE7\xB5\xB6", + "\xEF\xBF" => "\xE5\x8D\xA0", + "\xEF\xC0" => "\xE5\xB2\xBE", + "\xEF\xC1" => "\xE5\xBA\x97", + "\xEF\xC2" => "\xE6\xBC\xB8", + "\xEF\xC3" => "\xE7\x82\xB9", + "\xEF\xC4" => "\xE7\xB2\x98", + "\xEF\xC5" => "\xE9\x9C\x91", + "\xEF\xC6" => "\xE9\xAE\x8E", + "\xEF\xC7" => "\xE9\xBB\x9E", + "\xEF\xC8" => "\xE6\x8E\xA5", + "\xEF\xC9" => "\xE6\x91\xBA", + "\xEF\xCA" => "\xE8\x9D\xB6", + "\xEF\xCB" => "\xE4\xB8\x81", + "\xEF\xCC" => "\xE4\xBA\x95", + "\xEF\xCD" => "\xE4\xBA\xAD", + "\xEF\xCE" => "\xE5\x81\x9C", + "\xEF\xCF" => "\xE5\x81\xB5", + "\xEF\xD0" => "\xE5\x91\x88", + "\xEF\xD1" => "\xE5\xA7\x83", + "\xEF\xD2" => "\xE5\xAE\x9A", + "\xEF\xD3" => "\xE5\xB9\x80", + "\xEF\xD4" => "\xE5\xBA\xAD", + "\xEF\xD5" => "\xE5\xBB\xB7", + "\xEF\xD6" => "\xE5\xBE\x81", + "\xEF\xD7" => "\xE6\x83\x85", + "\xEF\xD8" => "\xE6\x8C\xBA", + "\xEF\xD9" => "\xE6\x94\xBF", + "\xEF\xDA" => "\xE6\x95\xB4", + "\xEF\xDB" => "\xE6\x97\x8C", + "\xEF\xDC" => "\xE6\x99\xB6", + "\xEF\xDD" => "\xE6\x99\xB8", + "\xEF\xDE" => "\xE6\x9F\xBE", + "\xEF\xDF" => "\xE6\xA5\xA8", + "\xEF\xE0" => "\xE6\xAA\x89", + "\xEF\xE1" => "\xE6\xAD\xA3", + "\xEF\xE2" => "\xE6\xB1\x80", + "\xEF\xE3" => "\xE6\xB7\x80", + "\xEF\xE4" => "\xE6\xB7\xA8", + "\xEF\xE5" => "\xE6\xB8\x9F", + "\xEF\xE6" => "\xE6\xB9\x9E", + "\xEF\xE7" => "\xE7\x80\x9E", + "\xEF\xE8" => "\xE7\x82\xA1", + "\xEF\xE9" => "\xE7\x8E\x8E", + "\xEF\xEA" => "\xE7\x8F\xBD", + "\xEF\xEB" => "\xE7\x94\xBA", + "\xEF\xEC" => "\xE7\x9D\x9B", + "\xEF\xED" => "\xE7\xA2\x87", + "\xEF\xEE" => "\xE7\xA6\x8E", + "\xEF\xEF" => "\xE7\xA8\x8B", + "\xEF\xF0" => "\xE7\xA9\xBD", + "\xEF\xF1" => "\xE7\xB2\xBE", + "\xEF\xF2" => "\xE7\xB6\x8E", + "\xEF\xF3" => "\xE8\x89\x87", + "\xEF\xF4" => "\xE8\xA8\x82", + "\xEF\xF5" => "\xE8\xAB\xAA", + "\xEF\xF6" => "\xE8\xB2\x9E", + "\xEF\xF7" => "\xE9\x84\xAD", + "\xEF\xF8" => "\xE9\x85\x8A", + "\xEF\xF9" => "\xE9\x87\x98", + "\xEF\xFA" => "\xE9\x89\xA6", + "\xEF\xFB" => "\xE9\x8B\x8C", + "\xEF\xFC" => "\xE9\x8C\xA0", + "\xEF\xFD" => "\xE9\x9C\x86", + "\xEF\xFE" => "\xE9\x9D\x96", + "\xF0\xA1" => "\xE9\x9D\x9C", + "\xF0\xA2" => "\xE9\xA0\x82", + "\xF0\xA3" => "\xE9\xBC\x8E", + "\xF0\xA4" => "\xE5\x88\xB6", + "\xF0\xA5" => "\xE5\x8A\x91", + "\xF0\xA6" => "\xE5\x95\xBC", + "\xF0\xA7" => "\xE5\xA0\xA4", + "\xF0\xA8" => "\xE5\xB8\x9D", + "\xF0\xA9" => "\xE5\xBC\x9F", + "\xF0\xAA" => "\xE6\x82\x8C", + "\xF0\xAB" => "\xE6\x8F\x90", + "\xF0\xAC" => "\xE6\xA2\xAF", + "\xF0\xAD" => "\xE6\xBF\x9F", + "\xF0\xAE" => "\xE7\xA5\xAD", + "\xF0\xAF" => "\xE7\xAC\xAC", + "\xF0\xB0" => "\xE8\x87\x8D", + "\xF0\xB1" => "\xE8\x96\xBA", + "\xF0\xB2" => "\xE8\xA3\xBD", + "\xF0\xB3" => "\xE8\xAB\xB8", + "\xF0\xB4" => "\xE8\xB9\x84", + "\xF0\xB5" => "\xE9\x86\x8D", + "\xF0\xB6" => "\xE9\x99\xA4", + "\xF0\xB7" => "\xE9\x9A\x9B", + "\xF0\xB8" => "\xE9\x9C\xBD", + "\xF0\xB9" => "\xE9\xA1\x8C", + "\xF0\xBA" => "\xE9\xBD\x8A", + "\xF0\xBB" => "\xE4\xBF\x8E", + "\xF0\xBC" => "\xE5\x85\x86", + "\xF0\xBD" => "\xE5\x87\x8B", + "\xF0\xBE" => "\xE5\x8A\xA9", + "\xF0\xBF" => "\xE5\x98\xB2", + "\xF0\xC0" => "\xE5\xBC\x94", + "\xF0\xC1" => "\xE5\xBD\xAB", + "\xF0\xC2" => "\xE6\x8E\xAA", + "\xF0\xC3" => "\xE6\x93\x8D", + "\xF0\xC4" => "\xE6\x97\xA9", + "\xF0\xC5" => "\xE6\x99\x81", + "\xF0\xC6" => "\xE6\x9B\xBA", + "\xF0\xC7" => "\xE6\x9B\xB9", + "\xF0\xC8" => "\xE6\x9C\x9D", + "\xF0\xC9" => "\xE6\xA2\x9D", + "\xF0\xCA" => "\xE6\xA3\x97", + "\xF0\xCB" => "\xE6\xA7\xBD", + "\xF0\xCC" => "\xE6\xBC\x95", + "\xF0\xCD" => "\xE6\xBD\xAE", + "\xF0\xCE" => "\xE7\x85\xA7", + "\xF0\xCF" => "\xE7\x87\xA5", + "\xF0\xD0" => "\xE7\x88\xAA", + "\xF0\xD1" => "\xE7\x92\xAA", + "\xF0\xD2" => "\xE7\x9C\xBA", + "\xF0\xD3" => "\xE7\xA5\x96", + "\xF0\xD4" => "\xE7\xA5\x9A", + "\xF0\xD5" => "\xE7\xA7\x9F", + "\xF0\xD6" => "\xE7\xA8\xA0", + "\xF0\xD7" => "\xE7\xAA\x95", + "\xF0\xD8" => "\xE7\xB2\x97", + "\xF0\xD9" => "\xE7\xB3\x9F", + "\xF0\xDA" => "\xE7\xB5\x84", + "\xF0\xDB" => "\xE7\xB9\xB0", + "\xF0\xDC" => "\xE8\x82\x87", + "\xF0\xDD" => "\xE8\x97\xBB", + "\xF0\xDE" => "\xE8\x9A\xA4", + "\xF0\xDF" => "\xE8\xA9\x94", + "\xF0\xE0" => "\xE8\xAA\xBF", + "\xF0\xE1" => "\xE8\xB6\x99", + "\xF0\xE2" => "\xE8\xBA\x81", + "\xF0\xE3" => "\xE9\x80\xA0", + "\xF0\xE4" => "\xE9\x81\xAD", + "\xF0\xE5" => "\xE9\x87\xA3", + "\xF0\xE6" => "\xE9\x98\xBB", + "\xF0\xE7" => "\xE9\x9B\x95", + "\xF0\xE8" => "\xE9\xB3\xA5", + "\xF0\xE9" => "\xE6\x97\x8F", + "\xF0\xEA" => "\xE7\xB0\x87", + "\xF0\xEB" => "\xE8\xB6\xB3", + "\xF0\xEC" => "\xE9\x8F\x83", + "\xF0\xED" => "\xE5\xAD\x98", + "\xF0\xEE" => "\xE5\xB0\x8A", + "\xF0\xEF" => "\xE5\x8D\x92", + "\xF0\xF0" => "\xE6\x8B\x99", + "\xF0\xF1" => "\xE7\x8C\x9D", + "\xF0\xF2" => "\xE5\x80\xA7", + "\xF0\xF3" => "\xE5\xAE\x97", + "\xF0\xF4" => "\xE5\xBE\x9E", + "\xF0\xF5" => "\xE6\x82\xB0", + "\xF0\xF6" => "\xE6\x85\xAB", + "\xF0\xF7" => "\xE6\xA3\x95", + "\xF0\xF8" => "\xE6\xB7\x99", + "\xF0\xF9" => "\xE7\x90\xAE", + "\xF0\xFA" => "\xE7\xA8\xAE", + "\xF0\xFB" => "\xE7\xB5\x82", + "\xF0\xFC" => "\xE7\xB6\x9C", + "\xF0\xFD" => "\xE7\xB8\xB1", + "\xF0\xFE" => "\xE8\x85\xAB", + "\xF1\xA1" => "\xE8\xB8\xAA", + "\xF1\xA2" => "\xE8\xB8\xB5", + "\xF1\xA3" => "\xE9\x8D\xBE", + "\xF1\xA4" => "\xE9\x90\x98", + "\xF1\xA5" => "\xE4\xBD\x90", + "\xF1\xA6" => "\xE5\x9D\x90", + "\xF1\xA7" => "\xE5\xB7\xA6", + "\xF1\xA8" => "\xE5\xBA\xA7", + "\xF1\xA9" => "\xE6\x8C\xAB", + "\xF1\xAA" => "\xE7\xBD\xAA", + "\xF1\xAB" => "\xE4\xB8\xBB", + "\xF1\xAC" => "\xE4\xBD\x8F", + "\xF1\xAD" => "\xE4\xBE\x8F", + "\xF1\xAE" => "\xE5\x81\x9A", + "\xF1\xAF" => "\xE5\xA7\x9D", + "\xF1\xB0" => "\xE8\x83\x84", + "\xF1\xB1" => "\xE5\x91\xAA", + "\xF1\xB2" => "\xE5\x91\xA8", + "\xF1\xB3" => "\xE5\x97\xBE", + "\xF1\xB4" => "\xE5\xA5\x8F", + "\xF1\xB5" => "\xE5\xAE\x99", + "\xF1\xB6" => "\xE5\xB7\x9E", + "\xF1\xB7" => "\xE5\xBB\x9A", + "\xF1\xB8" => "\xE6\x99\x9D", + "\xF1\xB9" => "\xE6\x9C\xB1", + "\xF1\xBA" => "\xE6\x9F\xB1", + "\xF1\xBB" => "\xE6\xA0\xAA", + "\xF1\xBC" => "\xE6\xB3\xA8", + "\xF1\xBD" => "\xE6\xB4\xB2", + "\xF1\xBE" => "\xE6\xB9\x8A", + "\xF1\xBF" => "\xE6\xBE\x8D", + "\xF1\xC0" => "\xE7\x82\xB7", + "\xF1\xC1" => "\xE7\x8F\xA0", + "\xF1\xC2" => "\xE7\x96\x87", + "\xF1\xC3" => "\xE7\xB1\x8C", + "\xF1\xC4" => "\xE7\xB4\x82", + "\xF1\xC5" => "\xE7\xB4\xAC", + "\xF1\xC6" => "\xE7\xB6\xA2", + "\xF1\xC7" => "\xE8\x88\x9F", + "\xF1\xC8" => "\xE8\x9B\x9B", + "\xF1\xC9" => "\xE8\xA8\xBB", + "\xF1\xCA" => "\xE8\xAA\x85", + "\xF1\xCB" => "\xE8\xB5\xB0", + "\xF1\xCC" => "\xE8\xBA\x8A", + "\xF1\xCD" => "\xE8\xBC\xB3", + "\xF1\xCE" => "\xE9\x80\xB1", + "\xF1\xCF" => "\xE9\x85\x8E", + "\xF1\xD0" => "\xE9\x85\x92", + "\xF1\xD1" => "\xE9\x91\x84", + "\xF1\xD2" => "\xE9\xA7\x90", + "\xF1\xD3" => "\xE7\xAB\xB9", + "\xF1\xD4" => "\xE7\xB2\xA5", + "\xF1\xD5" => "\xE4\xBF\x8A", + "\xF1\xD6" => "\xE5\x84\x81", + "\xF1\xD7" => "\xE5\x87\x86", + "\xF1\xD8" => "\xE5\x9F\x88", + "\xF1\xD9" => "\xE5\xAF\xAF", + "\xF1\xDA" => "\xE5\xB3\xBB", + "\xF1\xDB" => "\xE6\x99\x99", + "\xF1\xDC" => "\xE6\xA8\xBD", + "\xF1\xDD" => "\xE6\xB5\x9A", + "\xF1\xDE" => "\xE6\xBA\x96", + "\xF1\xDF" => "\xE6\xBF\xAC", + "\xF1\xE0" => "\xE7\x84\x8C", + "\xF1\xE1" => "\xE7\x95\xAF", + "\xF1\xE2" => "\xE7\xAB\xA3", + "\xF1\xE3" => "\xE8\xA0\xA2", + "\xF1\xE4" => "\xE9\x80\xA1", + "\xF1\xE5" => "\xE9\x81\xB5", + "\xF1\xE6" => "\xE9\x9B\x8B", + "\xF1\xE7" => "\xE9\xA7\xBF", + "\xF1\xE8" => "\xE8\x8C\x81", + "\xF1\xE9" => "\xE4\xB8\xAD", + "\xF1\xEA" => "\xE4\xBB\xB2", + "\xF1\xEB" => "\xE8\xA1\x86", + "\xF1\xEC" => "\xE9\x87\x8D", + "\xF1\xED" => "\xE5\x8D\xBD", + "\xF1\xEE" => "\xE6\xAB\x9B", + "\xF1\xEF" => "\xE6\xA5\xAB", + "\xF1\xF0" => "\xE6\xB1\x81", + "\xF1\xF1" => "\xE8\x91\xBA", + "\xF1\xF2" => "\xE5\xA2\x9E", + "\xF1\xF3" => "\xE6\x86\x8E", + "\xF1\xF4" => "\xE6\x9B\xBE", + "\xF1\xF5" => "\xE6\x8B\xAF", + "\xF1\xF6" => "\xE7\x83\x9D", + "\xF1\xF7" => "\xE7\x94\x91", + "\xF1\xF8" => "\xE7\x97\x87", + "\xF1\xF9" => "\xE7\xB9\x92", + "\xF1\xFA" => "\xE8\x92\xB8", + "\xF1\xFB" => "\xE8\xAD\x89", + "\xF1\xFC" => "\xE8\xB4\x88", + "\xF1\xFD" => "\xE4\xB9\x8B", + "\xF1\xFE" => "\xE5\x8F\xAA", + "\xF2\xA1" => "\xE5\x92\xAB", + "\xF2\xA2" => "\xE5\x9C\xB0", + "\xF2\xA3" => "\xE5\x9D\x80", + "\xF2\xA4" => "\xE5\xBF\x97", + "\xF2\xA5" => "\xE6\x8C\x81", + "\xF2\xA6" => "\xE6\x8C\x87", + "\xF2\xA7" => "\xE6\x91\xAF", + "\xF2\xA8" => "\xE6\x94\xAF", + "\xF2\xA9" => "\xE6\x97\xA8", + "\xF2\xAA" => "\xE6\x99\xBA", + "\xF2\xAB" => "\xE6\x9E\x9D", + "\xF2\xAC" => "\xE6\x9E\xB3", + "\xF2\xAD" => "\xE6\xAD\xA2", + "\xF2\xAE" => "\xE6\xB1\xA0", + "\xF2\xAF" => "\xE6\xB2\x9A", + "\xF2\xB0" => "\xE6\xBC\xAC", + "\xF2\xB1" => "\xE7\x9F\xA5", + "\xF2\xB2" => "\xE7\xA0\xA5", + "\xF2\xB3" => "\xE7\xA5\x89", + "\xF2\xB4" => "\xE7\xA5\x97", + "\xF2\xB5" => "\xE7\xB4\x99", + "\xF2\xB6" => "\xE8\x82\xA2", + "\xF2\xB7" => "\xE8\x84\x82", + "\xF2\xB8" => "\xE8\x87\xB3", + "\xF2\xB9" => "\xE8\x8A\x9D", + "\xF2\xBA" => "\xE8\x8A\xB7", + "\xF2\xBB" => "\xE8\x9C\x98", + "\xF2\xBC" => "\xE8\xAA\x8C", + "\xF2\xBD" => "\xEF\xA7\xBC", + "\xF2\xBE" => "\xE8\xB4\x84", + "\xF2\xBF" => "\xE8\xB6\xBE", + "\xF2\xC0" => "\xE9\x81\xB2", + "\xF2\xC1" => "\xE7\x9B\xB4", + "\xF2\xC2" => "\xE7\xA8\x99", + "\xF2\xC3" => "\xE7\xA8\xB7", + "\xF2\xC4" => "\xE7\xB9\x94", + "\xF2\xC5" => "\xE8\x81\xB7", + "\xF2\xC6" => "\xE5\x94\x87", + "\xF2\xC7" => "\xE5\x97\x94", + "\xF2\xC8" => "\xE5\xA1\xB5", + "\xF2\xC9" => "\xE6\x8C\xAF", + "\xF2\xCA" => "\xE6\x90\xA2", + "\xF2\xCB" => "\xE6\x99\x89", + "\xF2\xCC" => "\xE6\x99\x8B", + "\xF2\xCD" => "\xE6\xA1\xAD", + "\xF2\xCE" => "\xE6\xA6\x9B", + "\xF2\xCF" => "\xE6\xAE\x84", + "\xF2\xD0" => "\xE6\xB4\xA5", + "\xF2\xD1" => "\xE6\xBA\xB1", + "\xF2\xD2" => "\xE7\x8F\x8D", + "\xF2\xD3" => "\xE7\x91\xA8", + "\xF2\xD4" => "\xE7\x92\xA1", + "\xF2\xD5" => "\xE7\x95\x9B", + "\xF2\xD6" => "\xE7\x96\xB9", + "\xF2\xD7" => "\xE7\x9B\xA1", + "\xF2\xD8" => "\xE7\x9C\x9E", + "\xF2\xD9" => "\xE7\x9E\x8B", + "\xF2\xDA" => "\xE7\xA7\xA6", + "\xF2\xDB" => "\xE7\xB8\x89", + "\xF2\xDC" => "\xE7\xB8\x9D", + "\xF2\xDD" => "\xE8\x87\xBB", + "\xF2\xDE" => "\xE8\x94\xAF", + "\xF2\xDF" => "\xE8\xA2\x97", + "\xF2\xE0" => "\xE8\xA8\xBA", + "\xF2\xE1" => "\xE8\xB3\x91", + "\xF2\xE2" => "\xE8\xBB\xAB", + "\xF2\xE3" => "\xE8\xBE\xB0", + "\xF2\xE4" => "\xE9\x80\xB2", + "\xF2\xE5" => "\xE9\x8E\xAD", + "\xF2\xE6" => "\xE9\x99\xA3", + "\xF2\xE7" => "\xE9\x99\xB3", + "\xF2\xE8" => "\xE9\x9C\x87", + "\xF2\xE9" => "\xE4\xBE\x84", + "\xF2\xEA" => "\xE5\x8F\xB1", + "\xF2\xEB" => "\xE5\xA7\xAA", + "\xF2\xEC" => "\xE5\xAB\x89", + "\xF2\xED" => "\xE5\xB8\x99", + "\xF2\xEE" => "\xE6\xA1\x8E", + "\xF2\xEF" => "\xE7\x93\x86", + "\xF2\xF0" => "\xE7\x96\xBE", + "\xF2\xF1" => "\xE7\xA7\xA9", + "\xF2\xF2" => "\xE7\xAA\x92", + "\xF2\xF3" => "\xE8\x86\xA3", + "\xF2\xF4" => "\xE8\x9B\xAD", + "\xF2\xF5" => "\xE8\xB3\xAA", + "\xF2\xF6" => "\xE8\xB7\x8C", + "\xF2\xF7" => "\xE8\xBF\xAD", + "\xF2\xF8" => "\xE6\x96\x9F", + "\xF2\xF9" => "\xE6\x9C\x95", + "\xF2\xFA" => "\xEF\xA7\xBD", + "\xF2\xFB" => "\xE5\x9F\xB7", + "\xF2\xFC" => "\xE6\xBD\x97", + "\xF2\xFD" => "\xE7\xB7\x9D", + "\xF2\xFE" => "\xE8\xBC\xAF", + "\xF3\xA1" => "\xE9\x8F\xB6", + "\xF3\xA2" => "\xE9\x9B\x86", + "\xF3\xA3" => "\xE5\xBE\xB5", + "\xF3\xA4" => "\xE6\x87\xB2", + "\xF3\xA5" => "\xE6\xBE\x84", + "\xF3\xA6" => "\xE4\xB8\x94", + "\xF3\xA7" => "\xE4\xBE\x98", + "\xF3\xA8" => "\xE5\x80\x9F", + "\xF3\xA9" => "\xE5\x8F\x89", + "\xF3\xAA" => "\xE5\x97\x9F", + "\xF3\xAB" => "\xE5\xB5\xAF", + "\xF3\xAC" => "\xE5\xB7\xAE", + "\xF3\xAD" => "\xE6\xAC\xA1", + "\xF3\xAE" => "\xE6\xAD\xA4", + "\xF3\xAF" => "\xE7\xA3\x8B", + "\xF3\xB0" => "\xE7\xAE\x9A", + "\xF3\xB1" => "\xEF\xA7\xBE", + "\xF3\xB2" => "\xE8\xB9\x89", + "\xF3\xB3" => "\xE8\xBB\x8A", + "\xF3\xB4" => "\xE9\x81\xAE", + "\xF3\xB5" => "\xE6\x8D\x89", + "\xF3\xB6" => "\xE6\x90\xBE", + "\xF3\xB7" => "\xE7\x9D\x80", + "\xF3\xB8" => "\xE7\xAA\x84", + "\xF3\xB9" => "\xE9\x8C\xAF", + "\xF3\xBA" => "\xE9\x91\xBF", + "\xF3\xBB" => "\xE9\xBD\xAA", + "\xF3\xBC" => "\xE6\x92\xB0", + "\xF3\xBD" => "\xE6\xBE\xAF", + "\xF3\xBE" => "\xE7\x87\xA6", + "\xF3\xBF" => "\xE7\x92\xA8", + "\xF3\xC0" => "\xE7\x93\x9A", + "\xF3\xC1" => "\xE7\xAB\x84", + "\xF3\xC2" => "\xE7\xB0\x92", + "\xF3\xC3" => "\xE7\xBA\x82", + "\xF3\xC4" => "\xE7\xB2\xB2", + "\xF3\xC5" => "\xE7\xBA\x98", + "\xF3\xC6" => "\xE8\xAE\x9A", + "\xF3\xC7" => "\xE8\xB4\x8A", + "\xF3\xC8" => "\xE9\x91\xBD", + "\xF3\xC9" => "\xE9\xA4\x90", + "\xF3\xCA" => "\xE9\xA5\x8C", + "\xF3\xCB" => "\xE5\x88\xB9", + "\xF3\xCC" => "\xE5\xAF\x9F", + "\xF3\xCD" => "\xE6\x93\xA6", + "\xF3\xCE" => "\xE6\x9C\xAD", + "\xF3\xCF" => "\xE7\xB4\xAE", + "\xF3\xD0" => "\xE5\x83\xAD", + "\xF3\xD1" => "\xE5\x8F\x83", + "\xF3\xD2" => "\xE5\xA1\xB9", + "\xF3\xD3" => "\xE6\x85\x98", + "\xF3\xD4" => "\xE6\x85\x99", + "\xF3\xD5" => "\xE6\x87\xBA", + "\xF3\xD6" => "\xE6\x96\xAC", + "\xF3\xD7" => "\xE7\xAB\x99", + "\xF3\xD8" => "\xE8\xAE\x92", + "\xF3\xD9" => "\xE8\xAE\x96", + "\xF3\xDA" => "\xE5\x80\x89", + "\xF3\xDB" => "\xE5\x80\xA1", + "\xF3\xDC" => "\xE5\x89\xB5", + "\xF3\xDD" => "\xE5\x94\xB1", + "\xF3\xDE" => "\xE5\xA8\xBC", + "\xF3\xDF" => "\xE5\xBB\xA0", + "\xF3\xE0" => "\xE5\xBD\xB0", + "\xF3\xE1" => "\xE6\x84\xB4", + "\xF3\xE2" => "\xE6\x95\x9E", + "\xF3\xE3" => "\xE6\x98\x8C", + "\xF3\xE4" => "\xE6\x98\xB6", + "\xF3\xE5" => "\xE6\x9A\xA2", + "\xF3\xE6" => "\xE6\xA7\x8D", + "\xF3\xE7" => "\xE6\xBB\x84", + "\xF3\xE8" => "\xE6\xBC\xB2", + "\xF3\xE9" => "\xE7\x8C\x96", + "\xF3\xEA" => "\xE7\x98\xA1", + "\xF3\xEB" => "\xE7\xAA\x93", + "\xF3\xEC" => "\xE8\x84\xB9", + "\xF3\xED" => "\xE8\x89\x99", + "\xF3\xEE" => "\xE8\x8F\x96", + "\xF3\xEF" => "\xE8\x92\xBC", + "\xF3\xF0" => "\xE5\x82\xB5", + "\xF3\xF1" => "\xE5\x9F\xB0", + "\xF3\xF2" => "\xE5\xAF\x80", + "\xF3\xF3" => "\xE5\xAF\xA8", + "\xF3\xF4" => "\xE5\xBD\xA9", + "\xF3\xF5" => "\xE6\x8E\xA1", + "\xF3\xF6" => "\xE7\xA0\xA6", + "\xF3\xF7" => "\xE7\xB6\xB5", + "\xF3\xF8" => "\xE8\x8F\x9C", + "\xF3\xF9" => "\xE8\x94\xA1", + "\xF3\xFA" => "\xE9\x87\x87", + "\xF3\xFB" => "\xE9\x87\xB5", + "\xF3\xFC" => "\xE5\x86\x8A", + "\xF3\xFD" => "\xE6\x9F\xB5", + "\xF3\xFE" => "\xE7\xAD\x96", + "\xF4\xA1" => "\xE8\xB2\xAC", + "\xF4\xA2" => "\xE5\x87\x84", + "\xF4\xA3" => "\xE5\xA6\xBB", + "\xF4\xA4" => "\xE6\x82\xBD", + "\xF4\xA5" => "\xE8\x99\x95", + "\xF4\xA6" => "\xE5\x80\x9C", + "\xF4\xA7" => "\xEF\xA7\xBF", + "\xF4\xA8" => "\xE5\x89\x94", + "\xF4\xA9" => "\xE5\xB0\xBA", + "\xF4\xAA" => "\xE6\x85\xBD", + "\xF4\xAB" => "\xE6\x88\x9A", + "\xF4\xAC" => "\xE6\x8B\x93", + "\xF4\xAD" => "\xE6\x93\xB2", + "\xF4\xAE" => "\xE6\x96\xA5", + "\xF4\xAF" => "\xE6\xBB\x8C", + "\xF4\xB0" => "\xE7\x98\xA0", + "\xF4\xB1" => "\xE8\x84\x8A", + "\xF4\xB2" => "\xE8\xB9\xA0", + "\xF4\xB3" => "\xE9\x99\x9F", + "\xF4\xB4" => "\xE9\x9A\xBB", + "\xF4\xB5" => "\xE4\xBB\x9F", + "\xF4\xB6" => "\xE5\x8D\x83", + "\xF4\xB7" => "\xE5\x96\x98", + "\xF4\xB8" => "\xE5\xA4\xA9", + "\xF4\xB9" => "\xE5\xB7\x9D", + "\xF4\xBA" => "\xE6\x93\x85", + "\xF4\xBB" => "\xE6\xB3\x89", + "\xF4\xBC" => "\xE6\xB7\xBA", + "\xF4\xBD" => "\xE7\x8E\x94", + "\xF4\xBE" => "\xE7\xA9\xBF", + "\xF4\xBF" => "\xE8\x88\x9B", + "\xF4\xC0" => "\xE8\x96\xA6", + "\xF4\xC1" => "\xE8\xB3\xA4", + "\xF4\xC2" => "\xE8\xB8\x90", + "\xF4\xC3" => "\xE9\x81\xB7", + "\xF4\xC4" => "\xE9\x87\xA7", + "\xF4\xC5" => "\xE9\x97\xA1", + "\xF4\xC6" => "\xE9\x98\xA1", + "\xF4\xC7" => "\xE9\x9F\x86", + "\xF4\xC8" => "\xE5\x87\xB8", + "\xF4\xC9" => "\xE5\x93\xB2", + "\xF4\xCA" => "\xE5\x96\x86", + "\xF4\xCB" => "\xE5\xBE\xB9", + "\xF4\xCC" => "\xE6\x92\xA4", + "\xF4\xCD" => "\xE6\xBE\x88", + "\xF4\xCE" => "\xE7\xB6\xB4", + "\xF4\xCF" => "\xE8\xBC\x9F", + "\xF4\xD0" => "\xE8\xBD\x8D", + "\xF4\xD1" => "\xE9\x90\xB5", + "\xF4\xD2" => "\xE5\x83\x89", + "\xF4\xD3" => "\xE5\xB0\x96", + "\xF4\xD4" => "\xE6\xB2\xBE", + "\xF4\xD5" => "\xE6\xB7\xBB", + "\xF4\xD6" => "\xE7\x94\x9B", + "\xF4\xD7" => "\xE7\x9E\xBB", + "\xF4\xD8" => "\xE7\xB0\xBD", + "\xF4\xD9" => "\xE7\xB1\xA4", + "\xF4\xDA" => "\xE8\xA9\xB9", + "\xF4\xDB" => "\xE8\xAB\x82", + "\xF4\xDC" => "\xE5\xA0\x9E", + "\xF4\xDD" => "\xE5\xA6\xBE", + "\xF4\xDE" => "\xE5\xB8\x96", + "\xF4\xDF" => "\xE6\x8D\xB7", + "\xF4\xE0" => "\xE7\x89\x92", + "\xF4\xE1" => "\xE7\x96\x8A", + "\xF4\xE2" => "\xE7\x9D\xAB", + "\xF4\xE3" => "\xE8\xAB\x9C", + "\xF4\xE4" => "\xE8\xB2\xBC", + "\xF4\xE5" => "\xE8\xBC\x92", + "\xF4\xE6" => "\xE5\xBB\xB3", + "\xF4\xE7" => "\xE6\x99\xB4", + "\xF4\xE8" => "\xE6\xB7\xB8", + "\xF4\xE9" => "\xE8\x81\xBD", + "\xF4\xEA" => "\xE8\x8F\x81", + "\xF4\xEB" => "\xE8\xAB\x8B", + "\xF4\xEC" => "\xE9\x9D\x91", + "\xF4\xED" => "\xE9\xAF\x96", + "\xF4\xEE" => "\xEF\xA8\x80", + "\xF4\xEF" => "\xE5\x89\x83", + "\xF4\xF0" => "\xE6\x9B\xBF", + "\xF4\xF1" => "\xE6\xB6\x95", + "\xF4\xF2" => "\xE6\xBB\xAF", + "\xF4\xF3" => "\xE7\xB7\xA0", + "\xF4\xF4" => "\xE8\xAB\xA6", + "\xF4\xF5" => "\xE9\x80\xAE", + "\xF4\xF6" => "\xE9\x81\x9E", + "\xF4\xF7" => "\xE9\xAB\x94", + "\xF4\xF8" => "\xE5\x88\x9D", + "\xF4\xF9" => "\xE5\x89\xBF", + "\xF4\xFA" => "\xE5\x93\xA8", + "\xF4\xFB" => "\xE6\x86\x94", + "\xF4\xFC" => "\xE6\x8A\x84", + "\xF4\xFD" => "\xE6\x8B\x9B", + "\xF4\xFE" => "\xE6\xA2\xA2", + "\xF5\xA1" => "\xE6\xA4\x92", + "\xF5\xA2" => "\xE6\xA5\x9A", + "\xF5\xA3" => "\xE6\xA8\xB5", + "\xF5\xA4" => "\xE7\x82\x92", + "\xF5\xA5" => "\xE7\x84\xA6", + "\xF5\xA6" => "\xE7\xA1\x9D", + "\xF5\xA7" => "\xE7\xA4\x81", + "\xF5\xA8" => "\xE7\xA4\x8E", + "\xF5\xA9" => "\xE7\xA7\x92", + "\xF5\xAA" => "\xE7\xA8\x8D", + "\xF5\xAB" => "\xE8\x82\x96", + "\xF5\xAC" => "\xE8\x89\xB8", + "\xF5\xAD" => "\xE8\x8B\x95", + "\xF5\xAE" => "\xE8\x8D\x89", + "\xF5\xAF" => "\xE8\x95\x89", + "\xF5\xB0" => "\xE8\xB2\x82", + "\xF5\xB1" => "\xE8\xB6\x85", + "\xF5\xB2" => "\xE9\x85\xA2", + "\xF5\xB3" => "\xE9\x86\x8B", + "\xF5\xB4" => "\xE9\x86\xAE", + "\xF5\xB5" => "\xE4\xBF\x83", + "\xF5\xB6" => "\xE5\x9B\x91", + "\xF5\xB7" => "\xE7\x87\xAD", + "\xF5\xB8" => "\xE7\x9F\x97", + "\xF5\xB9" => "\xE8\x9C\x80", + "\xF5\xBA" => "\xE8\xA7\xB8", + "\xF5\xBB" => "\xE5\xAF\xB8", + "\xF5\xBC" => "\xE5\xBF\x96", + "\xF5\xBD" => "\xE6\x9D\x91", + "\xF5\xBE" => "\xE9\x82\xA8", + "\xF5\xBF" => "\xE5\x8F\xA2", + "\xF5\xC0" => "\xE5\xA1\x9A", + "\xF5\xC1" => "\xE5\xAF\xB5", + "\xF5\xC2" => "\xE6\x82\xA4", + "\xF5\xC3" => "\xE6\x86\x81", + "\xF5\xC4" => "\xE6\x91\xA0", + "\xF5\xC5" => "\xE7\xB8\xBD", + "\xF5\xC6" => "\xE8\x81\xB0", + "\xF5\xC7" => "\xE8\x94\xA5", + "\xF5\xC8" => "\xE9\x8A\x83", + "\xF5\xC9" => "\xE6\x92\xAE", + "\xF5\xCA" => "\xE5\x82\xAC", + "\xF5\xCB" => "\xE5\xB4\x94", + "\xF5\xCC" => "\xE6\x9C\x80", + "\xF5\xCD" => "\xE5\xA2\x9C", + "\xF5\xCE" => "\xE6\x8A\xBD", + "\xF5\xCF" => "\xE6\x8E\xA8", + "\xF5\xD0" => "\xE6\xA4\x8E", + "\xF5\xD1" => "\xE6\xA5\xB8", + "\xF5\xD2" => "\xE6\xA8\x9E", + "\xF5\xD3" => "\xE6\xB9\xAB", + "\xF5\xD4" => "\xE7\x9A\xBA", + "\xF5\xD5" => "\xE7\xA7\x8B", + "\xF5\xD6" => "\xE8\x8A\xBB", + "\xF5\xD7" => "\xE8\x90\xA9", + "\xF5\xD8" => "\xE8\xAB\x8F", + "\xF5\xD9" => "\xE8\xB6\xA8", + "\xF5\xDA" => "\xE8\xBF\xBD", + "\xF5\xDB" => "\xE9\x84\x92", + "\xF5\xDC" => "\xE9\x85\x8B", + "\xF5\xDD" => "\xE9\x86\x9C", + "\xF5\xDE" => "\xE9\x8C\x90", + "\xF5\xDF" => "\xE9\x8C\x98", + "\xF5\xE0" => "\xE9\x8E\x9A", + "\xF5\xE1" => "\xE9\x9B\x9B", + "\xF5\xE2" => "\xE9\xA8\xB6", + "\xF5\xE3" => "\xE9\xB0\x8D", + "\xF5\xE4" => "\xE4\xB8\x91", + "\xF5\xE5" => "\xE7\x95\x9C", + "\xF5\xE6" => "\xE7\xA5\x9D", + "\xF5\xE7" => "\xE7\xAB\xBA", + "\xF5\xE8" => "\xE7\xAD\x91", + "\xF5\xE9" => "\xE7\xAF\x89", + "\xF5\xEA" => "\xE7\xB8\xAE", + "\xF5\xEB" => "\xE8\x93\x84", + "\xF5\xEC" => "\xE8\xB9\x99", + "\xF5\xED" => "\xE8\xB9\xB4", + "\xF5\xEE" => "\xE8\xBB\xB8", + "\xF5\xEF" => "\xE9\x80\x90", + "\xF5\xF0" => "\xE6\x98\xA5", + "\xF5\xF1" => "\xE6\xA4\xBF", + "\xF5\xF2" => "\xE7\x91\x83", + "\xF5\xF3" => "\xE5\x87\xBA", + "\xF5\xF4" => "\xE6\x9C\xAE", + "\xF5\xF5" => "\xE9\xBB\x9C", + "\xF5\xF6" => "\xE5\x85\x85", + "\xF5\xF7" => "\xE5\xBF\xA0", + "\xF5\xF8" => "\xE6\xB2\x96", + "\xF5\xF9" => "\xE8\x9F\xB2", + "\xF5\xFA" => "\xE8\xA1\x9D", + "\xF5\xFB" => "\xE8\xA1\xB7", + "\xF5\xFC" => "\xE6\x82\xB4", + "\xF5\xFD" => "\xE8\x86\xB5", + "\xF5\xFE" => "\xE8\x90\x83", + "\xF6\xA1" => "\xE8\xB4\x85", + "\xF6\xA2" => "\xE5\x8F\x96", + "\xF6\xA3" => "\xE5\x90\xB9", + "\xF6\xA4" => "\xE5\x98\xB4", + "\xF6\xA5" => "\xE5\xA8\xB6", + "\xF6\xA6" => "\xE5\xB0\xB1", + "\xF6\xA7" => "\xE7\x82\x8A", + "\xF6\xA8" => "\xE7\xBF\xA0", + "\xF6\xA9" => "\xE8\x81\x9A", + "\xF6\xAA" => "\xE8\x84\x86", + "\xF6\xAB" => "\xE8\x87\xAD", + "\xF6\xAC" => "\xE8\xB6\xA3", + "\xF6\xAD" => "\xE9\x86\x89", + "\xF6\xAE" => "\xE9\xA9\x9F", + "\xF6\xAF" => "\xE9\xB7\xB2", + "\xF6\xB0" => "\xE5\x81\xB4", + "\xF6\xB1" => "\xE4\xBB\x84", + "\xF6\xB2" => "\xE5\x8E\xA0", + "\xF6\xB3" => "\xE6\x83\xBB", + "\xF6\xB4" => "\xE6\xB8\xAC", + "\xF6\xB5" => "\xE5\xB1\xA4", + "\xF6\xB6" => "\xE4\xBE\x88", + "\xF6\xB7" => "\xE5\x80\xA4", + "\xF6\xB8" => "\xE5\x97\xA4", + "\xF6\xB9" => "\xE5\xB3\x99", + "\xF6\xBA" => "\xE5\xB9\x9F", + "\xF6\xBB" => "\xE6\x81\xA5", + "\xF6\xBC" => "\xE6\xA2\x94", + "\xF6\xBD" => "\xE6\xB2\xBB", + "\xF6\xBE" => "\xE6\xB7\x84", + "\xF6\xBF" => "\xE7\x86\xBE", + "\xF6\xC0" => "\xE7\x97\x94", + "\xF6\xC1" => "\xE7\x97\xB4", + "\xF6\xC2" => "\xE7\x99\xA1", + "\xF6\xC3" => "\xE7\xA8\x9A", + "\xF6\xC4" => "\xE7\xA9\x89", + "\xF6\xC5" => "\xE7\xB7\x87", + "\xF6\xC6" => "\xE7\xB7\xBB", + "\xF6\xC7" => "\xE7\xBD\xAE", + "\xF6\xC8" => "\xE8\x87\xB4", + "\xF6\xC9" => "\xE8\x9A\xA9", + "\xF6\xCA" => "\xE8\xBC\x9C", + "\xF6\xCB" => "\xE9\x9B\x89", + "\xF6\xCC" => "\xE9\xA6\xB3", + "\xF6\xCD" => "\xE9\xBD\x92", + "\xF6\xCE" => "\xE5\x89\x87", + "\xF6\xCF" => "\xE5\x8B\x85", + "\xF6\xD0" => "\xE9\xA3\xAD", + "\xF6\xD1" => "\xE8\xA6\xAA", + "\xF6\xD2" => "\xE4\xB8\x83", + "\xF6\xD3" => "\xE6\x9F\x92", + "\xF6\xD4" => "\xE6\xBC\x86", + "\xF6\xD5" => "\xE4\xBE\xB5", + "\xF6\xD6" => "\xE5\xAF\xA2", + "\xF6\xD7" => "\xE6\x9E\x95", + "\xF6\xD8" => "\xE6\xB2\x88", + "\xF6\xD9" => "\xE6\xB5\xB8", + "\xF6\xDA" => "\xE7\x90\x9B", + "\xF6\xDB" => "\xE7\xA0\xA7", + "\xF6\xDC" => "\xE9\x87\x9D", + "\xF6\xDD" => "\xE9\x8D\xBC", + "\xF6\xDE" => "\xE8\x9F\x84", + "\xF6\xDF" => "\xE7\xA7\xA4", + "\xF6\xE0" => "\xE7\xA8\xB1", + "\xF6\xE1" => "\xE5\xBF\xAB", + "\xF6\xE2" => "\xE4\xBB\x96", + "\xF6\xE3" => "\xE5\x92\xA4", + "\xF6\xE4" => "\xE5\x94\xBE", + "\xF6\xE5" => "\xE5\xA2\xAE", + "\xF6\xE6" => "\xE5\xA6\xA5", + "\xF6\xE7" => "\xE6\x83\xB0", + "\xF6\xE8" => "\xE6\x89\x93", + "\xF6\xE9" => "\xE6\x8B\x96", + "\xF6\xEA" => "\xE6\x9C\xB6", + "\xF6\xEB" => "\xE6\xA5\x95", + "\xF6\xEC" => "\xE8\x88\xB5", + "\xF6\xED" => "\xE9\x99\x80", + "\xF6\xEE" => "\xE9\xA6\xB1", + "\xF6\xEF" => "\xE9\xA7\x9D", + "\xF6\xF0" => "\xE5\x80\xAC", + "\xF6\xF1" => "\xE5\x8D\x93", + "\xF6\xF2" => "\xE5\x95\x84", + "\xF6\xF3" => "\xE5\x9D\xBC", + "\xF6\xF4" => "\xEF\xA8\x81", + "\xF6\xF5" => "\xE6\x89\x98", + "\xF6\xF6" => "\xEF\xA8\x82", + "\xF6\xF7" => "\xE6\x93\xA2", + "\xF6\xF8" => "\xE6\x99\xAB", + "\xF6\xF9" => "\xE6\x9F\x9D", + "\xF6\xFA" => "\xE6\xBF\x81", + "\xF6\xFB" => "\xE6\xBF\xAF", + "\xF6\xFC" => "\xE7\x90\xA2", + "\xF6\xFD" => "\xE7\x90\xB8", + "\xF6\xFE" => "\xE8\xA8\x97", + "\xF7\xA1" => "\xE9\x90\xB8", + "\xF7\xA2" => "\xE5\x91\x91", + "\xF7\xA3" => "\xE5\x98\x86", + "\xF7\xA4" => "\xE5\x9D\xA6", + "\xF7\xA5" => "\xE5\xBD\x88", + "\xF7\xA6" => "\xE6\x86\x9A", + "\xF7\xA7" => "\xE6\xAD\x8E", + "\xF7\xA8" => "\xE7\x81\x98", + "\xF7\xA9" => "\xE7\x82\xAD", + "\xF7\xAA" => "\xE7\xB6\xBB", + "\xF7\xAB" => "\xE8\xAA\x95", + "\xF7\xAC" => "\xE5\xA5\xAA", + "\xF7\xAD" => "\xE8\x84\xAB", + "\xF7\xAE" => "\xE6\x8E\xA2", + "\xF7\xAF" => "\xE7\x9C\x88", + "\xF7\xB0" => "\xE8\x80\xBD", + "\xF7\xB1" => "\xE8\xB2\xAA", + "\xF7\xB2" => "\xE5\xA1\x94", + "\xF7\xB3" => "\xE6\x90\xAD", + "\xF7\xB4" => "\xE6\xA6\xBB", + "\xF7\xB5" => "\xE5\xAE\x95", + "\xF7\xB6" => "\xE5\xB8\x91", + "\xF7\xB7" => "\xE6\xB9\xAF", + "\xF7\xB8" => "\xEF\xA8\x83", + "\xF7\xB9" => "\xE8\x95\xA9", + "\xF7\xBA" => "\xE5\x85\x8C", + "\xF7\xBB" => "\xE5\x8F\xB0", + "\xF7\xBC" => "\xE5\xA4\xAA", + "\xF7\xBD" => "\xE6\x80\xA0", + "\xF7\xBE" => "\xE6\x85\x8B", + "\xF7\xBF" => "\xE6\xAE\x86", + "\xF7\xC0" => "\xE6\xB1\xB0", + "\xF7\xC1" => "\xE6\xB3\xB0", + "\xF7\xC2" => "\xE7\xAC\x9E", + "\xF7\xC3" => "\xE8\x83\x8E", + "\xF7\xC4" => "\xE8\x8B\x94", + "\xF7\xC5" => "\xE8\xB7\x86", + "\xF7\xC6" => "\xE9\x82\xB0", + "\xF7\xC7" => "\xE9\xA2\xB1", + "\xF7\xC8" => "\xEF\xA8\x84", + "\xF7\xC9" => "\xE6\x93\x87", + "\xF7\xCA" => "\xE6\xBE\xA4", + "\xF7\xCB" => "\xE6\x92\x91", + "\xF7\xCC" => "\xE6\x94\x84", + "\xF7\xCD" => "\xE5\x85\x8E", + "\xF7\xCE" => "\xE5\x90\x90", + "\xF7\xCF" => "\xE5\x9C\x9F", + "\xF7\xD0" => "\xE8\xA8\x8E", + "\xF7\xD1" => "\xE6\x85\x9F", + "\xF7\xD2" => "\xE6\xA1\xB6", + "\xF7\xD3" => "\xEF\xA8\x85", + "\xF7\xD4" => "\xE7\x97\x9B", + "\xF7\xD5" => "\xE7\xAD\x92", + "\xF7\xD6" => "\xE7\xB5\xB1", + "\xF7\xD7" => "\xE9\x80\x9A", + "\xF7\xD8" => "\xE5\xA0\x86", + "\xF7\xD9" => "\xE6\xA7\x8C", + "\xF7\xDA" => "\xE8\x85\xBF", + "\xF7\xDB" => "\xE8\xA4\xAA", + "\xF7\xDC" => "\xE9\x80\x80", + "\xF7\xDD" => "\xE9\xA0\xB9", + "\xF7\xDE" => "\xE5\x81\xB8", + "\xF7\xDF" => "\xE5\xA5\x97", + "\xF7\xE0" => "\xE5\xA6\xAC", + "\xF7\xE1" => "\xE6\x8A\x95", + "\xF7\xE2" => "\xE9\x80\x8F", + "\xF7\xE3" => "\xE9\xAC\xAA", + "\xF7\xE4" => "\xE6\x85\x9D", + "\xF7\xE5" => "\xE7\x89\xB9", + "\xF7\xE6" => "\xE9\x97\x96", + "\xF7\xE7" => "\xE5\x9D\xA1", + "\xF7\xE8" => "\xE5\xA9\x86", + "\xF7\xE9" => "\xE5\xB7\xB4", + "\xF7\xEA" => "\xE6\x8A\x8A", + "\xF7\xEB" => "\xE6\x92\xAD", + "\xF7\xEC" => "\xE6\x93\xBA", + "\xF7\xED" => "\xE6\x9D\xB7", + "\xF7\xEE" => "\xE6\xB3\xA2", + "\xF7\xEF" => "\xE6\xB4\xBE", + "\xF7\xF0" => "\xE7\x88\xAC", + "\xF7\xF1" => "\xE7\x90\xB6", + "\xF7\xF2" => "\xE7\xA0\xB4", + "\xF7\xF3" => "\xE7\xBD\xB7", + "\xF7\xF4" => "\xE8\x8A\xAD", + "\xF7\xF5" => "\xE8\xB7\x9B", + "\xF7\xF6" => "\xE9\xA0\x97", + "\xF7\xF7" => "\xE5\x88\xA4", + "\xF7\xF8" => "\xE5\x9D\x82", + "\xF7\xF9" => "\xE6\x9D\xBF", + "\xF7\xFA" => "\xE7\x89\x88", + "\xF7\xFB" => "\xE7\x93\xA3", + "\xF7\xFC" => "\xE8\xB2\xA9", + "\xF7\xFD" => "\xE8\xBE\xA6", + "\xF7\xFE" => "\xE9\x88\x91", + "\xF8\xA1" => "\xE9\x98\xAA", + "\xF8\xA2" => "\xE5\x85\xAB", + "\xF8\xA3" => "\xE5\x8F\xAD", + "\xF8\xA4" => "\xE6\x8D\x8C", + "\xF8\xA5" => "\xE4\xBD\xA9", + "\xF8\xA6" => "\xE5\x94\x84", + "\xF8\xA7" => "\xE6\x82\x96", + "\xF8\xA8" => "\xE6\x95\x97", + "\xF8\xA9" => "\xE6\xB2\x9B", + "\xF8\xAA" => "\xE6\xB5\xBF", + "\xF8\xAB" => "\xE7\x89\x8C", + "\xF8\xAC" => "\xE7\x8B\xBD", + "\xF8\xAD" => "\xE7\xA8\x97", + "\xF8\xAE" => "\xE8\xA6\x87", + "\xF8\xAF" => "\xE8\xB2\x9D", + "\xF8\xB0" => "\xE5\xBD\xAD", + "\xF8\xB1" => "\xE6\xBE\x8E", + "\xF8\xB2" => "\xE7\x83\xB9", + "\xF8\xB3" => "\xE8\x86\xA8", + "\xF8\xB4" => "\xE6\x84\x8E", + "\xF8\xB5" => "\xE4\xBE\xBF", + "\xF8\xB6" => "\xE5\x81\x8F", + "\xF8\xB7" => "\xE6\x89\x81", + "\xF8\xB8" => "\xE7\x89\x87", + "\xF8\xB9" => "\xE7\xAF\x87", + "\xF8\xBA" => "\xE7\xB7\xA8", + "\xF8\xBB" => "\xE7\xBF\xA9", + "\xF8\xBC" => "\xE9\x81\x8D", + "\xF8\xBD" => "\xE9\x9E\xAD", + "\xF8\xBE" => "\xE9\xA8\x99", + "\xF8\xBF" => "\xE8\xB2\xB6", + "\xF8\xC0" => "\xE5\x9D\xAA", + "\xF8\xC1" => "\xE5\xB9\xB3", + "\xF8\xC2" => "\xE6\x9E\xB0", + "\xF8\xC3" => "\xE8\x90\x8D", + "\xF8\xC4" => "\xE8\xA9\x95", + "\xF8\xC5" => "\xE5\x90\xA0", + "\xF8\xC6" => "\xE5\xAC\x96", + "\xF8\xC7" => "\xE5\xB9\xA3", + "\xF8\xC8" => "\xE5\xBB\xA2", + "\xF8\xC9" => "\xE5\xBC\x8A", + "\xF8\xCA" => "\xE6\x96\x83", + "\xF8\xCB" => "\xE8\x82\xBA", + "\xF8\xCC" => "\xE8\x94\xBD", + "\xF8\xCD" => "\xE9\x96\x89", + "\xF8\xCE" => "\xE9\x99\x9B", + "\xF8\xCF" => "\xE4\xBD\x88", + "\xF8\xD0" => "\xE5\x8C\x85", + "\xF8\xD1" => "\xE5\x8C\x8D", + "\xF8\xD2" => "\xE5\x8C\x8F", + "\xF8\xD3" => "\xE5\x92\x86", + "\xF8\xD4" => "\xE5\x93\xBA", + "\xF8\xD5" => "\xE5\x9C\x83", + "\xF8\xD6" => "\xE5\xB8\x83", + "\xF8\xD7" => "\xE6\x80\x96", + "\xF8\xD8" => "\xE6\x8A\x9B", + "\xF8\xD9" => "\xE6\x8A\xB1", + "\xF8\xDA" => "\xE6\x8D\x95", + "\xF8\xDB" => "\xEF\xA8\x86", + "\xF8\xDC" => "\xE6\xB3\xA1", + "\xF8\xDD" => "\xE6\xB5\xA6", + "\xF8\xDE" => "\xE7\x96\xB1", + "\xF8\xDF" => "\xE7\xA0\xB2", + "\xF8\xE0" => "\xE8\x83\x9E", + "\xF8\xE1" => "\xE8\x84\xAF", + "\xF8\xE2" => "\xE8\x8B\x9E", + "\xF8\xE3" => "\xE8\x91\xA1", + "\xF8\xE4" => "\xE8\x92\xB2", + "\xF8\xE5" => "\xE8\xA2\x8D", + "\xF8\xE6" => "\xE8\xA4\x92", + "\xF8\xE7" => "\xE9\x80\x8B", + "\xF8\xE8" => "\xE9\x8B\xAA", + "\xF8\xE9" => "\xE9\xA3\xBD", + "\xF8\xEA" => "\xE9\xAE\x91", + "\xF8\xEB" => "\xE5\xB9\x85", + "\xF8\xEC" => "\xE6\x9A\xB4", + "\xF8\xED" => "\xE6\x9B\x9D", + "\xF8\xEE" => "\xE7\x80\x91", + "\xF8\xEF" => "\xE7\x88\x86", + "\xF8\xF0" => "\xEF\xA8\x87", + "\xF8\xF1" => "\xE4\xBF\xB5", + "\xF8\xF2" => "\xE5\x89\xBD", + "\xF8\xF3" => "\xE5\xBD\xAA", + "\xF8\xF4" => "\xE6\x85\x93", + "\xF8\xF5" => "\xE6\x9D\x93", + "\xF8\xF6" => "\xE6\xA8\x99", + "\xF8\xF7" => "\xE6\xBC\x82", + "\xF8\xF8" => "\xE7\x93\xA2", + "\xF8\xF9" => "\xE7\xA5\xA8", + "\xF8\xFA" => "\xE8\xA1\xA8", + "\xF8\xFB" => "\xE8\xB1\xB9", + "\xF8\xFC" => "\xE9\xA3\x87", + "\xF8\xFD" => "\xE9\xA3\x84", + "\xF8\xFE" => "\xE9\xA9\x83", + "\xF9\xA1" => "\xE5\x93\x81", + "\xF9\xA2" => "\xE7\xA8\x9F", + "\xF9\xA3" => "\xE6\xA5\x93", + "\xF9\xA4" => "\xE8\xAB\xB7", + "\xF9\xA5" => "\xE8\xB1\x8A", + "\xF9\xA6" => "\xE9\xA2\xA8", + "\xF9\xA7" => "\xE9\xA6\xAE", + "\xF9\xA8" => "\xE5\xBD\xBC", + "\xF9\xA9" => "\xE6\x8A\xAB", + "\xF9\xAA" => "\xE7\x96\xB2", + "\xF9\xAB" => "\xE7\x9A\xAE", + "\xF9\xAC" => "\xE8\xA2\xAB", + "\xF9\xAD" => "\xE9\x81\xBF", + "\xF9\xAE" => "\xE9\x99\x82", + "\xF9\xAF" => "\xE5\x8C\xB9", + "\xF9\xB0" => "\xE5\xBC\xBC", + "\xF9\xB1" => "\xE5\xBF\x85", + "\xF9\xB2" => "\xE6\xB3\x8C", + "\xF9\xB3" => "\xE7\x8F\x8C", + "\xF9\xB4" => "\xE7\x95\xA2", + "\xF9\xB5" => "\xE7\x96\x8B", + "\xF9\xB6" => "\xE7\xAD\x86", + "\xF9\xB7" => "\xE8\x8B\xBE", + "\xF9\xB8" => "\xE9\xA6\x9D", + "\xF9\xB9" => "\xE4\xB9\x8F", + "\xF9\xBA" => "\xE9\x80\xBC", + "\xF9\xBB" => "\xE4\xB8\x8B", + "\xF9\xBC" => "\xE4\xBD\x95", + "\xF9\xBD" => "\xE5\x8E\xA6", + "\xF9\xBE" => "\xE5\xA4\x8F", + "\xF9\xBF" => "\xE5\xBB\x88", + "\xF9\xC0" => "\xE6\x98\xB0", + "\xF9\xC1" => "\xE6\xB2\xB3", + "\xF9\xC2" => "\xE7\x91\x95", + "\xF9\xC3" => "\xE8\x8D\xB7", + "\xF9\xC4" => "\xE8\x9D\xA6", + "\xF9\xC5" => "\xE8\xB3\x80", + "\xF9\xC6" => "\xE9\x81\x90", + "\xF9\xC7" => "\xE9\x9C\x9E", + "\xF9\xC8" => "\xE9\xB0\x95", + "\xF9\xC9" => "\xE5\xA3\x91", + "\xF9\xCA" => "\xE5\xAD\xB8", + "\xF9\xCB" => "\xE8\x99\x90", + "\xF9\xCC" => "\xE8\xAC\x94", + "\xF9\xCD" => "\xE9\xB6\xB4", + "\xF9\xCE" => "\xE5\xAF\x92", + "\xF9\xCF" => "\xE6\x81\xA8", + "\xF9\xD0" => "\xE6\x82\x8D", + "\xF9\xD1" => "\xE6\x97\xB1", + "\xF9\xD2" => "\xE6\xB1\x97", + "\xF9\xD3" => "\xE6\xBC\xA2", + "\xF9\xD4" => "\xE6\xBE\xA3", + "\xF9\xD5" => "\xE7\x80\x9A", + "\xF9\xD6" => "\xE7\xBD\x95", + "\xF9\xD7" => "\xE7\xBF\xB0", + "\xF9\xD8" => "\xE9\x96\x91", + "\xF9\xD9" => "\xE9\x96\x92", + "\xF9\xDA" => "\xE9\x99\x90", + "\xF9\xDB" => "\xE9\x9F\x93", + "\xF9\xDC" => "\xE5\x89\xB2", + "\xF9\xDD" => "\xE8\xBD\x84", + "\xF9\xDE" => "\xE5\x87\xBD", + "\xF9\xDF" => "\xE5\x90\xAB", + "\xF9\xE0" => "\xE5\x92\xB8", + "\xF9\xE1" => "\xE5\x95\xA3", + "\xF9\xE2" => "\xE5\x96\x8A", + "\xF9\xE3" => "\xE6\xAA\xBB", + "\xF9\xE4" => "\xE6\xB6\xB5", + "\xF9\xE5" => "\xE7\xB7\x98", + "\xF9\xE6" => "\xE8\x89\xA6", + "\xF9\xE7" => "\xE9\x8A\x9C", + "\xF9\xE8" => "\xE9\x99\xB7", + "\xF9\xE9" => "\xE9\xB9\xB9", + "\xF9\xEA" => "\xE5\x90\x88", + "\xF9\xEB" => "\xE5\x93\x88", + "\xF9\xEC" => "\xE7\x9B\x92", + "\xF9\xED" => "\xE8\x9B\xA4", + "\xF9\xEE" => "\xE9\x96\xA4", + "\xF9\xEF" => "\xE9\x97\x94", + "\xF9\xF0" => "\xE9\x99\x9C", + "\xF9\xF1" => "\xE4\xBA\xA2", + "\xF9\xF2" => "\xE4\xBC\x89", + "\xF9\xF3" => "\xE5\xA7\xAE", + "\xF9\xF4" => "\xE5\xAB\xA6", + "\xF9\xF5" => "\xE5\xB7\xB7", + "\xF9\xF6" => "\xE6\x81\x92", + "\xF9\xF7" => "\xE6\x8A\x97", + "\xF9\xF8" => "\xE6\x9D\xAD", + "\xF9\xF9" => "\xE6\xA1\x81", + "\xF9\xFA" => "\xE6\xB2\x86", + "\xF9\xFB" => "\xE6\xB8\xAF", + "\xF9\xFC" => "\xE7\xBC\xB8", + "\xF9\xFD" => "\xE8\x82\x9B", + "\xF9\xFE" => "\xE8\x88\xAA", + "\xFA\xA1" => "\xEF\xA8\x88", + "\xFA\xA2" => "\xEF\xA8\x89", + "\xFA\xA3" => "\xE9\xA0\x85", + "\xFA\xA4" => "\xE4\xBA\xA5", + "\xFA\xA5" => "\xE5\x81\x95", + "\xFA\xA6" => "\xE5\x92\xB3", + "\xFA\xA7" => "\xE5\x9E\x93", + "\xFA\xA8" => "\xE5\xA5\x9A", + "\xFA\xA9" => "\xE5\xAD\xA9", + "\xFA\xAA" => "\xE5\xAE\xB3", + "\xFA\xAB" => "\xE6\x87\x88", + "\xFA\xAC" => "\xE6\xA5\xB7", + "\xFA\xAD" => "\xE6\xB5\xB7", + "\xFA\xAE" => "\xE7\x80\xA3", + "\xFA\xAF" => "\xE8\x9F\xB9", + "\xFA\xB0" => "\xE8\xA7\xA3", + "\xFA\xB1" => "\xE8\xA9\xB2", + "\xFA\xB2" => "\xE8\xAB\xA7", + "\xFA\xB3" => "\xE9\x82\x82", + "\xFA\xB4" => "\xE9\xA7\xAD", + "\xFA\xB5" => "\xE9\xAA\xB8", + "\xFA\xB6" => "\xE5\x8A\xBE", + "\xFA\xB7" => "\xE6\xA0\xB8", + "\xFA\xB8" => "\xE5\x80\x96", + "\xFA\xB9" => "\xE5\xB9\xB8", + "\xFA\xBA" => "\xE6\x9D\x8F", + "\xFA\xBB" => "\xE8\x8D\x87", + "\xFA\xBC" => "\xE8\xA1\x8C", + "\xFA\xBD" => "\xE4\xBA\xAB", + "\xFA\xBE" => "\xE5\x90\x91", + "\xFA\xBF" => "\xE5\x9A\xAE", + "\xFA\xC0" => "\xE7\x8F\xA6", + "\xFA\xC1" => "\xE9\x84\x95", + "\xFA\xC2" => "\xE9\x9F\xBF", + "\xFA\xC3" => "\xE9\xA4\x89", + "\xFA\xC4" => "\xE9\xA5\x97", + "\xFA\xC5" => "\xE9\xA6\x99", + "\xFA\xC6" => "\xE5\x99\x93", + "\xFA\xC7" => "\xE5\xA2\x9F", + "\xFA\xC8" => "\xE8\x99\x9B", + "\xFA\xC9" => "\xE8\xA8\xB1", + "\xFA\xCA" => "\xE6\x86\xB2", + "\xFA\xCB" => "\xE6\xAB\xB6", + "\xFA\xCC" => "\xE7\x8D\xBB", + "\xFA\xCD" => "\xE8\xBB\x92", + "\xFA\xCE" => "\xE6\xAD\x87", + "\xFA\xCF" => "\xE9\x9A\xAA", + "\xFA\xD0" => "\xE9\xA9\x97", + "\xFA\xD1" => "\xE5\xA5\x95", + "\xFA\xD2" => "\xE7\x88\x80", + "\xFA\xD3" => "\xE8\xB5\xAB", + "\xFA\xD4" => "\xE9\x9D\xA9", + "\xFA\xD5" => "\xE4\xBF\x94", + "\xFA\xD6" => "\xE5\xB3\xB4", + "\xFA\xD7" => "\xE5\xBC\xA6", + "\xFA\xD8" => "\xE6\x87\xB8", + "\xFA\xD9" => "\xE6\x99\x9B", + "\xFA\xDA" => "\xE6\xB3\xAB", + "\xFA\xDB" => "\xE7\x82\xAB", + "\xFA\xDC" => "\xE7\x8E\x84", + "\xFA\xDD" => "\xE7\x8E\xB9", + "\xFA\xDE" => "\xE7\x8F\xBE", + "\xFA\xDF" => "\xE7\x9C\xA9", + "\xFA\xE0" => "\xE7\x9D\x8D", + "\xFA\xE1" => "\xE7\xB5\x83", + "\xFA\xE2" => "\xE7\xB5\xA2", + "\xFA\xE3" => "\xE7\xB8\xA3", + "\xFA\xE4" => "\xE8\x88\xB7", + "\xFA\xE5" => "\xE8\xA1\x92", + "\xFA\xE6" => "\xEF\xA8\x8A", + "\xFA\xE7" => "\xE8\xB3\xA2", + "\xFA\xE8" => "\xE9\x89\x89", + "\xFA\xE9" => "\xE9\xA1\xAF", + "\xFA\xEA" => "\xE5\xAD\x91", + "\xFA\xEB" => "\xE7\xA9\xB4", + "\xFA\xEC" => "\xE8\xA1\x80", + "\xFA\xED" => "\xE9\xA0\x81", + "\xFA\xEE" => "\xE5\xAB\x8C", + "\xFA\xEF" => "\xE4\xBF\xA0", + "\xFA\xF0" => "\xE5\x8D\x94", + "\xFA\xF1" => "\xE5\xA4\xBE", + "\xFA\xF2" => "\xE5\xB3\xBD", + "\xFA\xF3" => "\xE6\x8C\xBE", + "\xFA\xF4" => "\xE6\xB5\xB9", + "\xFA\xF5" => "\xE7\x8B\xB9", + "\xFA\xF6" => "\xE8\x84\x85", + "\xFA\xF7" => "\xE8\x84\x87", + "\xFA\xF8" => "\xE8\x8E\xA2", + "\xFA\xF9" => "\xE9\x8B\x8F", + "\xFA\xFA" => "\xE9\xA0\xB0", + "\xFA\xFB" => "\xE4\xBA\xA8", + "\xFA\xFC" => "\xE5\x85\x84", + "\xFA\xFD" => "\xE5\x88\x91", + "\xFA\xFE" => "\xE5\x9E\x8B", + "\xFB\xA1" => "\xE5\xBD\xA2", + "\xFB\xA2" => "\xE6\xB3\x82", + "\xFB\xA3" => "\xE6\xBB\x8E", + "\xFB\xA4" => "\xE7\x80\x85", + "\xFB\xA5" => "\xE7\x81\x90", + "\xFB\xA6" => "\xE7\x82\xAF", + "\xFB\xA7" => "\xE7\x86\x92", + "\xFB\xA8" => "\xE7\x8F\xA9", + "\xFB\xA9" => "\xE7\x91\xA9", + "\xFB\xAA" => "\xE8\x8D\x8A", + "\xFB\xAB" => "\xE8\x9E\xA2", + "\xFB\xAC" => "\xE8\xA1\xA1", + "\xFB\xAD" => "\xE9\x80\x88", + "\xFB\xAE" => "\xE9\x82\xA2", + "\xFB\xAF" => "\xE9\x8E\xA3", + "\xFB\xB0" => "\xE9\xA6\xA8", + "\xFB\xB1" => "\xE5\x85\xAE", + "\xFB\xB2" => "\xE5\xBD\x97", + "\xFB\xB3" => "\xE6\x83\xA0", + "\xFB\xB4" => "\xE6\x85\xA7", + "\xFB\xB5" => "\xE6\x9A\xB3", + "\xFB\xB6" => "\xE8\x95\x99", + "\xFB\xB7" => "\xE8\xB9\x8A", + "\xFB\xB8" => "\xE9\x86\xAF", + "\xFB\xB9" => "\xE9\x9E\x8B", + "\xFB\xBA" => "\xE4\xB9\x8E", + "\xFB\xBB" => "\xE4\xBA\x92", + "\xFB\xBC" => "\xE5\x91\xBC", + "\xFB\xBD" => "\xE5\xA3\x95", + "\xFB\xBE" => "\xE5\xA3\xBA", + "\xFB\xBF" => "\xE5\xA5\xBD", + "\xFB\xC0" => "\xE5\xB2\xB5", + "\xFB\xC1" => "\xE5\xBC\xA7", + "\xFB\xC2" => "\xE6\x88\xB6", + "\xFB\xC3" => "\xE6\x89\x88", + "\xFB\xC4" => "\xE6\x98\x8A", + "\xFB\xC5" => "\xE6\x99\xA7", + "\xFB\xC6" => "\xE6\xAF\xAB", + "\xFB\xC7" => "\xE6\xB5\xA9", + "\xFB\xC8" => "\xE6\xB7\x8F", + "\xFB\xC9" => "\xE6\xB9\x96", + "\xFB\xCA" => "\xE6\xBB\xB8", + "\xFB\xCB" => "\xE6\xBE\x94", + "\xFB\xCC" => "\xE6\xBF\xA0", + "\xFB\xCD" => "\xE6\xBF\xA9", + "\xFB\xCE" => "\xE7\x81\x9D", + "\xFB\xCF" => "\xE7\x8B\x90", + "\xFB\xD0" => "\xE7\x90\xA5", + "\xFB\xD1" => "\xE7\x91\x9A", + "\xFB\xD2" => "\xE7\x93\xA0", + "\xFB\xD3" => "\xE7\x9A\x93", + "\xFB\xD4" => "\xE7\xA5\x9C", + "\xFB\xD5" => "\xE7\xB3\x8A", + "\xFB\xD6" => "\xE7\xB8\x9E", + "\xFB\xD7" => "\xE8\x83\xA1", + "\xFB\xD8" => "\xE8\x8A\xA6", + "\xFB\xD9" => "\xE8\x91\xAB", + "\xFB\xDA" => "\xE8\x92\xBF", + "\xFB\xDB" => "\xE8\x99\x8E", + "\xFB\xDC" => "\xE8\x99\x9F", + "\xFB\xDD" => "\xE8\x9D\xB4", + "\xFB\xDE" => "\xE8\xAD\xB7", + "\xFB\xDF" => "\xE8\xB1\xAA", + "\xFB\xE0" => "\xE9\x8E\xAC", + "\xFB\xE1" => "\xE9\xA0\x80", + "\xFB\xE2" => "\xE9\xA1\xA5", + "\xFB\xE3" => "\xE6\x83\x91", + "\xFB\xE4" => "\xE6\x88\x96", + "\xFB\xE5" => "\xE9\x85\xB7", + "\xFB\xE6" => "\xE5\xA9\x9A", + "\xFB\xE7" => "\xE6\x98\x8F", + "\xFB\xE8" => "\xE6\xB7\xB7", + "\xFB\xE9" => "\xE6\xB8\xBE", + "\xFB\xEA" => "\xE7\x90\xBF", + "\xFB\xEB" => "\xE9\xAD\x82", + "\xFB\xEC" => "\xE5\xBF\xBD", + "\xFB\xED" => "\xE6\x83\x9A", + "\xFB\xEE" => "\xE7\xAC\x8F", + "\xFB\xEF" => "\xE5\x93\x84", + "\xFB\xF0" => "\xE5\xBC\x98", + "\xFB\xF1" => "\xE6\xB1\x9E", + "\xFB\xF2" => "\xE6\xB3\x93", + "\xFB\xF3" => "\xE6\xB4\xAA", + "\xFB\xF4" => "\xE7\x83\x98", + "\xFB\xF5" => "\xE7\xB4\x85", + "\xFB\xF6" => "\xE8\x99\xB9", + "\xFB\xF7" => "\xE8\xA8\x8C", + "\xFB\xF8" => "\xE9\xB4\xBB", + "\xFB\xF9" => "\xE5\x8C\x96", + "\xFB\xFA" => "\xE5\x92\x8C", + "\xFB\xFB" => "\xE5\xAC\x85", + "\xFB\xFC" => "\xE6\xA8\xBA", + "\xFB\xFD" => "\xE7\x81\xAB", + "\xFB\xFE" => "\xE7\x95\xB5", + "\xFC\xA1" => "\xE7\xA6\x8D", + "\xFC\xA2" => "\xE7\xA6\xBE", + "\xFC\xA3" => "\xE8\x8A\xB1", + "\xFC\xA4" => "\xE8\x8F\xAF", + "\xFC\xA5" => "\xE8\xA9\xB1", + "\xFC\xA6" => "\xE8\xAD\x81", + "\xFC\xA7" => "\xE8\xB2\xA8", + "\xFC\xA8" => "\xE9\x9D\xB4", + "\xFC\xA9" => "\xEF\xA8\x8B", + "\xFC\xAA" => "\xE6\x93\xB4", + "\xFC\xAB" => "\xE6\x94\xAB", + "\xFC\xAC" => "\xE7\xA2\xBA", + "\xFC\xAD" => "\xE7\xA2\xBB", + "\xFC\xAE" => "\xE7\xA9\xAB", + "\xFC\xAF" => "\xE4\xB8\xB8", + "\xFC\xB0" => "\xE5\x96\x9A", + "\xFC\xB1" => "\xE5\xA5\x90", + "\xFC\xB2" => "\xE5\xAE\xA6", + "\xFC\xB3" => "\xE5\xB9\xBB", + "\xFC\xB4" => "\xE6\x82\xA3", + "\xFC\xB5" => "\xE6\x8F\x9B", + "\xFC\xB6" => "\xE6\xAD\xA1", + "\xFC\xB7" => "\xE6\x99\xA5", + "\xFC\xB8" => "\xE6\xA1\x93", + "\xFC\xB9" => "\xE6\xB8\x99", + "\xFC\xBA" => "\xE7\x85\xA5", + "\xFC\xBB" => "\xE7\x92\xB0", + "\xFC\xBC" => "\xE7\xB4\x88", + "\xFC\xBD" => "\xE9\x82\x84", + "\xFC\xBE" => "\xE9\xA9\xA9", + "\xFC\xBF" => "\xE9\xB0\xA5", + "\xFC\xC0" => "\xE6\xB4\xBB", + "\xFC\xC1" => "\xE6\xBB\x91", + "\xFC\xC2" => "\xE7\x8C\xBE", + "\xFC\xC3" => "\xE8\xB1\x81", + "\xFC\xC4" => "\xE9\x97\x8A", + "\xFC\xC5" => "\xE5\x87\xB0", + "\xFC\xC6" => "\xE5\xB9\x8C", + "\xFC\xC7" => "\xE5\xBE\xA8", + "\xFC\xC8" => "\xE6\x81\x8D", + "\xFC\xC9" => "\xE6\x83\xB6", + "\xFC\xCA" => "\xE6\x84\xB0", + "\xFC\xCB" => "\xE6\x85\x8C", + "\xFC\xCC" => "\xE6\x99\x83", + "\xFC\xCD" => "\xE6\x99\x84", + "\xFC\xCE" => "\xE6\xA6\xA5", + "\xFC\xCF" => "\xE6\xB3\x81", + "\xFC\xD0" => "\xE6\xB9\x9F", + "\xFC\xD1" => "\xE6\xBB\x89", + "\xFC\xD2" => "\xE6\xBD\xA2", + "\xFC\xD3" => "\xE7\x85\x8C", + "\xFC\xD4" => "\xE7\x92\x9C", + "\xFC\xD5" => "\xE7\x9A\x87", + "\xFC\xD6" => "\xE7\xAF\x81", + "\xFC\xD7" => "\xE7\xB0\xA7", + "\xFC\xD8" => "\xE8\x8D\x92", + "\xFC\xD9" => "\xE8\x9D\x97", + "\xFC\xDA" => "\xE9\x81\x91", + "\xFC\xDB" => "\xE9\x9A\x8D", + "\xFC\xDC" => "\xE9\xBB\x83", + "\xFC\xDD" => "\xE5\x8C\xAF", + "\xFC\xDE" => "\xE5\x9B\x9E", + "\xFC\xDF" => "\xE5\xBB\xBB", + "\xFC\xE0" => "\xE5\xBE\x8A", + "\xFC\xE1" => "\xE6\x81\xA2", + "\xFC\xE2" => "\xE6\x82\x94", + "\xFC\xE3" => "\xE6\x87\xB7", + "\xFC\xE4" => "\xE6\x99\xA6", + "\xFC\xE5" => "\xE6\x9C\x83", + "\xFC\xE6" => "\xE6\xAA\x9C", + "\xFC\xE7" => "\xE6\xB7\xAE", + "\xFC\xE8" => "\xE6\xBE\xAE", + "\xFC\xE9" => "\xE7\x81\xB0", + "\xFC\xEA" => "\xE7\x8D\xAA", + "\xFC\xEB" => "\xE7\xB9\xAA", + "\xFC\xEC" => "\xE8\x86\xBE", + "\xFC\xED" => "\xE8\x8C\xB4", + "\xFC\xEE" => "\xE8\x9B\x94", + "\xFC\xEF" => "\xE8\xAA\xA8", + "\xFC\xF0" => "\xE8\xB3\x84", + "\xFC\xF1" => "\xE5\x8A\x83", + "\xFC\xF2" => "\xE7\x8D\xB2", + "\xFC\xF3" => "\xE5\xAE\x96", + "\xFC\xF4" => "\xE6\xA9\xAB", + "\xFC\xF5" => "\xE9\x90\x84", + "\xFC\xF6" => "\xE5\x93\xAE", + "\xFC\xF7" => "\xE5\x9A\x86", + "\xFC\xF8" => "\xE5\xAD\x9D", + "\xFC\xF9" => "\xE6\x95\x88", + "\xFC\xFA" => "\xE6\x96\x85", + "\xFC\xFB" => "\xE6\x9B\x89", + "\xFC\xFC" => "\xE6\xA2\x9F", + "\xFC\xFD" => "\xE6\xB6\x8D", + "\xFC\xFE" => "\xE6\xB7\x86", + "\xFD\xA1" => "\xE7\x88\xBB", + "\xFD\xA2" => "\xE8\x82\xB4", + "\xFD\xA3" => "\xE9\x85\xB5", + "\xFD\xA4" => "\xE9\xA9\x8D", + "\xFD\xA5" => "\xE4\xBE\xAF", + "\xFD\xA6" => "\xE5\x80\x99", + "\xFD\xA7" => "\xE5\x8E\x9A", + "\xFD\xA8" => "\xE5\x90\x8E", + "\xFD\xA9" => "\xE5\x90\xBC", + "\xFD\xAA" => "\xE5\x96\x89", + "\xFD\xAB" => "\xE5\x97\x85", + "\xFD\xAC" => "\xE5\xB8\xBF", + "\xFD\xAD" => "\xE5\xBE\x8C", + "\xFD\xAE" => "\xE6\x9C\xBD", + "\xFD\xAF" => "\xE7\x85\xA6", + "\xFD\xB0" => "\xE7\x8F\x9D", + "\xFD\xB1" => "\xE9\x80\x85", + "\xFD\xB2" => "\xE5\x8B\x9B", + "\xFD\xB3" => "\xE5\x8B\xB3", + "\xFD\xB4" => "\xE5\xA1\xA4", + "\xFD\xB5" => "\xE5\xA3\x8E", + "\xFD\xB6" => "\xE7\x84\x84", + "\xFD\xB7" => "\xE7\x86\x8F", + "\xFD\xB8" => "\xE7\x87\xBB", + "\xFD\xB9" => "\xE8\x96\xB0", + "\xFD\xBA" => "\xE8\xA8\x93", + "\xFD\xBB" => "\xE6\x9A\x88", + "\xFD\xBC" => "\xE8\x96\xA8", + "\xFD\xBD" => "\xE5\x96\xA7", + "\xFD\xBE" => "\xE6\x9A\x84", + "\xFD\xBF" => "\xE7\x85\x8A", + "\xFD\xC0" => "\xE8\x90\xB1", + "\xFD\xC1" => "\xE5\x8D\x89", + "\xFD\xC2" => "\xE5\x96\x99", + "\xFD\xC3" => "\xE6\xAF\x81", + "\xFD\xC4" => "\xE5\xBD\x99", + "\xFD\xC5" => "\xE5\xBE\xBD", + "\xFD\xC6" => "\xE6\x8F\xAE", + "\xFD\xC7" => "\xE6\x9A\x89", + "\xFD\xC8" => "\xE7\x85\x87", + "\xFD\xC9" => "\xE8\xAB\xB1", + "\xFD\xCA" => "\xE8\xBC\x9D", + "\xFD\xCB" => "\xE9\xBA\xBE", + "\xFD\xCC" => "\xE4\xBC\x91", + "\xFD\xCD" => "\xE6\x90\xBA", + "\xFD\xCE" => "\xE7\x83\x8B", + "\xFD\xCF" => "\xE7\x95\xA6", + "\xFD\xD0" => "\xE8\x99\xA7", + "\xFD\xD1" => "\xE6\x81\xA4", + "\xFD\xD2" => "\xE8\xAD\x8E", + "\xFD\xD3" => "\xE9\xB7\xB8", + "\xFD\xD4" => "\xE5\x85\x87", + "\xFD\xD5" => "\xE5\x87\xB6", + "\xFD\xD6" => "\xE5\x8C\x88", + "\xFD\xD7" => "\xE6\xB4\xB6", + "\xFD\xD8" => "\xE8\x83\xB8", + "\xFD\xD9" => "\xE9\xBB\x91", + "\xFD\xDA" => "\xE6\x98\x95", + "\xFD\xDB" => "\xE6\xAC\xA3", + "\xFD\xDC" => "\xE7\x82\x98", + "\xFD\xDD" => "\xE7\x97\x95", + "\xFD\xDE" => "\xE5\x90\x83", + "\xFD\xDF" => "\xE5\xB1\xB9", + "\xFD\xE0" => "\xE7\xB4\x87", + "\xFD\xE1" => "\xE8\xA8\x96", + "\xFD\xE2" => "\xE6\xAC\xA0", + "\xFD\xE3" => "\xE6\xAC\xBD", + "\xFD\xE4" => "\xE6\xAD\x86", + "\xFD\xE5" => "\xE5\x90\xB8", + "\xFD\xE6" => "\xE6\x81\xB0", + "\xFD\xE7" => "\xE6\xB4\xBD", + "\xFD\xE8" => "\xE7\xBF\x95", + "\xFD\xE9" => "\xE8\x88\x88", + "\xFD\xEA" => "\xE5\x83\x96", + "\xFD\xEB" => "\xE5\x87\x9E", + "\xFD\xEC" => "\xE5\x96\x9C", + "\xFD\xED" => "\xE5\x99\xAB", + "\xFD\xEE" => "\xE5\x9B\x8D", + "\xFD\xEF" => "\xE5\xA7\xAC", + "\xFD\xF0" => "\xE5\xAC\x89", + "\xFD\xF1" => "\xE5\xB8\x8C", + "\xFD\xF2" => "\xE6\x86\x99", + "\xFD\xF3" => "\xE6\x86\x98", + "\xFD\xF4" => "\xE6\x88\xB1", + "\xFD\xF5" => "\xE6\x99\x9E", + "\xFD\xF6" => "\xE6\x9B\xA6", + "\xFD\xF7" => "\xE7\x86\x99", + "\xFD\xF8" => "\xE7\x86\xB9", + "\xFD\xF9" => "\xE7\x86\xBA", + "\xFD\xFA" => "\xE7\x8A\xA7", + "\xFD\xFB" => "\xE7\xA6\xA7", + "\xFD\xFC" => "\xE7\xA8\x80", + "\xFD\xFD" => "\xE7\xBE\xB2", + "\xFD\xFE" => "\xE8\xA9\xB0", + ); + return strtr($string, $transform); +} + +function big5($string) +{ + static $transform = array( + "\xA1\x40" => "\xE3\x80\x80", + "\xA1\x41" => "\xEF\xBC\x8C", + "\xA1\x42" => "\xE3\x80\x81", + "\xA1\x43" => "\xE3\x80\x82", + "\xA1\x44" => "\xEF\xBC\x8E", + "\xA1\x45" => "\xE2\x80\xA2", + "\xA1\x46" => "\xEF\xBC\x9B", + "\xA1\x47" => "\xEF\xBC\x9A", + "\xA1\x48" => "\xEF\xBC\x9F", + "\xA1\x49" => "\xEF\xBC\x81", + "\xA1\x4A" => "\xEF\xB8\xB0", + "\xA1\x4B" => "\xE2\x80\xA6", + "\xA1\x4C" => "\xE2\x80\xA5", + "\xA1\x4D" => "\xEF\xB9\x90", + "\xA1\x4E" => "\xEF\xBD\xA4", + "\xA1\x4F" => "\xEF\xB9\x92", + "\xA1\x50" => "\xC2\xB7", + "\xA1\x51" => "\xEF\xB9\x94", + "\xA1\x52" => "\xEF\xB9\x95", + "\xA1\x53" => "\xEF\xB9\x96", + "\xA1\x54" => "\xEF\xB9\x97", + "\xA1\x55" => "\xEF\xBD\x9C", + "\xA1\x56" => "\xE2\x80\x93", + "\xA1\x57" => "\xEF\xB8\xB1", + "\xA1\x58" => "\xE2\x80\x94", + "\xA1\x59" => "\xEF\xB8\xB3", + "\xA1\x5A" => "\xEF\xBF\xBD", + "\xA1\x5B" => "\xEF\xB8\xB4", + "\xA1\x5C" => "\xEF\xB9\x8F", + "\xA1\x5D" => "\xEF\xBC\x88", + "\xA1\x5E" => "\xEF\xBC\x89", + "\xA1\x5F" => "\xEF\xB8\xB5", + "\xA1\x60" => "\xEF\xB8\xB6", + "\xA1\x61" => "\xEF\xBD\x9B", + "\xA1\x62" => "\xEF\xBD\x9D", + "\xA1\x63" => "\xEF\xB8\xB7", + "\xA1\x64" => "\xEF\xB8\xB8", + "\xA1\x65" => "\xE3\x80\x94", + "\xA1\x66" => "\xE3\x80\x95", + "\xA1\x67" => "\xEF\xB8\xB9", + "\xA1\x68" => "\xEF\xB8\xBA", + "\xA1\x69" => "\xE3\x80\x90", + "\xA1\x6A" => "\xE3\x80\x91", + "\xA1\x6B" => "\xEF\xB8\xBB", + "\xA1\x6C" => "\xEF\xB8\xBC", + "\xA1\x6D" => "\xE3\x80\x8A", + "\xA1\x6E" => "\xE3\x80\x8B", + "\xA1\x6F" => "\xEF\xB8\xBD", + "\xA1\x70" => "\xEF\xB8\xBE", + "\xA1\x71" => "\xE3\x80\x88", + "\xA1\x72" => "\xE3\x80\x89", + "\xA1\x73" => "\xEF\xB8\xBF", + "\xA1\x74" => "\xEF\xB9\x80", + "\xA1\x75" => "\xE3\x80\x8C", + "\xA1\x76" => "\xE3\x80\x8D", + "\xA1\x77" => "\xEF\xB9\x81", + "\xA1\x78" => "\xEF\xB9\x82", + "\xA1\x79" => "\xE3\x80\x8E", + "\xA1\x7A" => "\xE3\x80\x8F", + "\xA1\x7B" => "\xEF\xB9\x83", + "\xA1\x7C" => "\xEF\xB9\x84", + "\xA1\x7D" => "\xEF\xB9\x99", + "\xA1\x7E" => "\xEF\xB9\x9A", + "\xA1\xA1" => "\xEF\xB9\x9B", + "\xA1\xA2" => "\xEF\xB9\x9C", + "\xA1\xA3" => "\xEF\xB9\x9D", + "\xA1\xA4" => "\xEF\xB9\x9E", + "\xA1\xA5" => "\xE2\x80\x98", + "\xA1\xA6" => "\xE2\x80\x99", + "\xA1\xA7" => "\xE2\x80\x9C", + "\xA1\xA8" => "\xE2\x80\x9D", + "\xA1\xA9" => "\xE3\x80\x9D", + "\xA1\xAA" => "\xE3\x80\x9E", + "\xA1\xAB" => "\xE2\x80\xB5", + "\xA1\xAC" => "\xE2\x80\xB2", + "\xA1\xAD" => "\xEF\xBC\x83", + "\xA1\xAE" => "\xEF\xBC\x86", + "\xA1\xAF" => "\xEF\xBC\x8A", + "\xA1\xB0" => "\xE2\x80\xBB", + "\xA1\xB1" => "\xC2\xA7", + "\xA1\xB2" => "\xE3\x80\x83", + "\xA1\xB3" => "\xE2\x97\x8B", + "\xA1\xB4" => "\xE2\x97\x8F", + "\xA1\xB5" => "\xE2\x96\xB3", + "\xA1\xB6" => "\xE2\x96\xB2", + "\xA1\xB7" => "\xE2\x97\x8E", + "\xA1\xB8" => "\xE2\x98\x86", + "\xA1\xB9" => "\xE2\x98\x85", + "\xA1\xBA" => "\xE2\x97\x87", + "\xA1\xBB" => "\xE2\x97\x86", + "\xA1\xBC" => "\xE2\x96\xA1", + "\xA1\xBD" => "\xE2\x96\xA0", + "\xA1\xBE" => "\xE2\x96\xBD", + "\xA1\xBF" => "\xE2\x96\xBC", + "\xA1\xC0" => "\xE3\x8A\xA3", + "\xA1\xC1" => "\xE2\x84\x85", + "\xA1\xC2" => "\xE2\x80\xBE", + "\xA1\xC3" => "\xEF\xBF\xBD", + "\xA1\xC4" => "\xEF\xBC\xBF", + "\xA1\xC5" => "\xEF\xBF\xBD", + "\xA1\xC6" => "\xEF\xB9\x89", + "\xA1\xC7" => "\xEF\xB9\x8A", + "\xA1\xC8" => "\xEF\xB9\x8D", + "\xA1\xC9" => "\xEF\xB9\x8E", + "\xA1\xCA" => "\xEF\xB9\x8B", + "\xA1\xCB" => "\xEF\xB9\x8C", + "\xA1\xCC" => "\xEF\xB9\x9F", + "\xA1\xCD" => "\xEF\xB9\xA0", + "\xA1\xCE" => "\xEF\xB9\xA1", + "\xA1\xCF" => "\xEF\xBC\x8B", + "\xA1\xD0" => "\xEF\xBC\x8D", + "\xA1\xD1" => "\xC3\x97", + "\xA1\xD2" => "\xC3\xB7", + "\xA1\xD3" => "\xC2\xB1", + "\xA1\xD4" => "\xE2\x88\x9A", + "\xA1\xD5" => "\xEF\xBC\x9C", + "\xA1\xD6" => "\xEF\xBC\x9E", + "\xA1\xD7" => "\xEF\xBC\x9D", + "\xA1\xD8" => "\xE2\x89\xA6", + "\xA1\xD9" => "\xE2\x89\xA7", + "\xA1\xDA" => "\xE2\x89\xA0", + "\xA1\xDB" => "\xE2\x88\x9E", + "\xA1\xDC" => "\xE2\x89\x92", + "\xA1\xDD" => "\xE2\x89\xA1", + "\xA1\xDE" => "\xEF\xB9\xA2", + "\xA1\xDF" => "\xEF\xB9\xA3", + "\xA1\xE0" => "\xEF\xB9\xA4", + "\xA1\xE1" => "\xEF\xB9\xA5", + "\xA1\xE2" => "\xEF\xB9\xA6", + "\xA1\xE3" => "\xE2\x88\xBC", + "\xA1\xE4" => "\xE2\x88\xA9", + "\xA1\xE5" => "\xE2\x88\xAA", + "\xA1\xE6" => "\xE2\x8A\xA5", + "\xA1\xE7" => "\xE2\x88\xA0", + "\xA1\xE8" => "\xE2\x88\x9F", + "\xA1\xE9" => "\xE2\x8A\xBF", + "\xA1\xEA" => "\xE3\x8F\x92", + "\xA1\xEB" => "\xE3\x8F\x91", + "\xA1\xEC" => "\xE2\x88\xAB", + "\xA1\xED" => "\xE2\x88\xAE", + "\xA1\xEE" => "\xE2\x88\xB5", + "\xA1\xEF" => "\xE2\x88\xB4", + "\xA1\xF0" => "\xE2\x99\x80", + "\xA1\xF1" => "\xE2\x99\x82", + "\xA1\xF2" => "\xE2\x99\x81", + "\xA1\xF3" => "\xE2\x98\x89", + "\xA1\xF4" => "\xE2\x86\x91", + "\xA1\xF5" => "\xE2\x86\x93", + "\xA1\xF6" => "\xE2\x86\x90", + "\xA1\xF7" => "\xE2\x86\x92", + "\xA1\xF8" => "\xE2\x86\x96", + "\xA1\xF9" => "\xE2\x86\x97", + "\xA1\xFA" => "\xE2\x86\x99", + "\xA1\xFB" => "\xE2\x86\x98", + "\xA1\xFC" => "\xE2\x88\xA5", + "\xA1\xFD" => "\xE2\x88\xA3", + "\xA1\xFE" => "\xEF\xBF\xBD", + "\xA2\x40" => "\xEF\xBF\xBD", + "\xA2\x41" => "\xEF\xBC\x8F", + "\xA2\x42" => "\xEF\xBC\xBC", + "\xA2\x43" => "\xEF\xBC\x84", + "\xA2\x44" => "\xC2\xA5", + "\xA2\x45" => "\xE3\x80\x92", + "\xA2\x46" => "\xC2\xA2", + "\xA2\x47" => "\xC2\xA3", + "\xA2\x48" => "\xEF\xBC\x85", + "\xA2\x49" => "\xEF\xBC\xA0", + "\xA2\x4A" => "\xE2\x84\x83", + "\xA2\x4B" => "\xE2\x84\x89", + "\xA2\x4C" => "\xEF\xB9\xA9", + "\xA2\x4D" => "\xEF\xB9\xAA", + "\xA2\x4E" => "\xEF\xB9\xAB", + "\xA2\x4F" => "\xE3\x8F\x95", + "\xA2\x50" => "\xE3\x8E\x9C", + "\xA2\x51" => "\xE3\x8E\x9D", + "\xA2\x52" => "\xE3\x8E\x9E", + "\xA2\x53" => "\xE3\x8F\x8E", + "\xA2\x54" => "\xE3\x8E\xA1", + "\xA2\x55" => "\xE3\x8E\x8E", + "\xA2\x56" => "\xE3\x8E\x8F", + "\xA2\x57" => "\xE3\x8F\x84", + "\xA2\x58" => "\xC2\xB0", + "\xA2\x59" => "\xE5\x85\x99", + "\xA2\x5A" => "\xE5\x85\x9B", + "\xA2\x5B" => "\xE5\x85\x9E", + "\xA2\x5C" => "\xE5\x85\x9D", + "\xA2\x5D" => "\xE5\x85\xA1", + "\xA2\x5E" => "\xE5\x85\xA3", + "\xA2\x5F" => "\xE5\x97\xA7", + "\xA2\x60" => "\xE7\x93\xA9", + "\xA2\x61" => "\xE7\xB3\x8E", + "\xA2\x62" => "\xE2\x96\x81", + "\xA2\x63" => "\xE2\x96\x82", + "\xA2\x64" => "\xE2\x96\x83", + "\xA2\x65" => "\xE2\x96\x84", + "\xA2\x66" => "\xE2\x96\x85", + "\xA2\x67" => "\xE2\x96\x86", + "\xA2\x68" => "\xE2\x96\x87", + "\xA2\x69" => "\xE2\x96\x88", + "\xA2\x6A" => "\xE2\x96\x8F", + "\xA2\x6B" => "\xE2\x96\x8E", + "\xA2\x6C" => "\xE2\x96\x8D", + "\xA2\x6D" => "\xE2\x96\x8C", + "\xA2\x6E" => "\xE2\x96\x8B", + "\xA2\x6F" => "\xE2\x96\x8A", + "\xA2\x70" => "\xE2\x96\x89", + "\xA2\x71" => "\xE2\x94\xBC", + "\xA2\x72" => "\xE2\x94\xB4", + "\xA2\x73" => "\xE2\x94\xAC", + "\xA2\x74" => "\xE2\x94\xA4", + "\xA2\x75" => "\xE2\x94\x9C", + "\xA2\x76" => "\xE2\x96\x94", + "\xA2\x77" => "\xE2\x94\x80", + "\xA2\x78" => "\xE2\x94\x82", + "\xA2\x79" => "\xE2\x96\x95", + "\xA2\x7A" => "\xE2\x94\x8C", + "\xA2\x7B" => "\xE2\x94\x90", + "\xA2\x7C" => "\xE2\x94\x94", + "\xA2\x7D" => "\xE2\x94\x98", + "\xA2\x7E" => "\xE2\x95\xAD", + "\xA2\xA1" => "\xE2\x95\xAE", + "\xA2\xA2" => "\xE2\x95\xB0", + "\xA2\xA3" => "\xE2\x95\xAF", + "\xA2\xA4" => "\xE2\x95\x90", + "\xA2\xA5" => "\xE2\x95\x9E", + "\xA2\xA6" => "\xE2\x95\xAA", + "\xA2\xA7" => "\xE2\x95\xA1", + "\xA2\xA8" => "\xE2\x97\xA2", + "\xA2\xA9" => "\xE2\x97\xA3", + "\xA2\xAA" => "\xE2\x97\xA5", + "\xA2\xAB" => "\xE2\x97\xA4", + "\xA2\xAC" => "\xE2\x95\xB1", + "\xA2\xAD" => "\xE2\x95\xB2", + "\xA2\xAE" => "\xE2\x95\xB3", + "\xA2\xAF" => "\xEF\xBC\x90", + "\xA2\xB0" => "\xEF\xBC\x91", + "\xA2\xB1" => "\xEF\xBC\x92", + "\xA2\xB2" => "\xEF\xBC\x93", + "\xA2\xB3" => "\xEF\xBC\x94", + "\xA2\xB4" => "\xEF\xBC\x95", + "\xA2\xB5" => "\xEF\xBC\x96", + "\xA2\xB6" => "\xEF\xBC\x97", + "\xA2\xB7" => "\xEF\xBC\x98", + "\xA2\xB8" => "\xEF\xBC\x99", + "\xA2\xB9" => "\xE2\x85\xA0", + "\xA2\xBA" => "\xE2\x85\xA1", + "\xA2\xBB" => "\xE2\x85\xA2", + "\xA2\xBC" => "\xE2\x85\xA3", + "\xA2\xBD" => "\xE2\x85\xA4", + "\xA2\xBE" => "\xE2\x85\xA5", + "\xA2\xBF" => "\xE2\x85\xA6", + "\xA2\xC0" => "\xE2\x85\xA7", + "\xA2\xC1" => "\xE2\x85\xA8", + "\xA2\xC2" => "\xE2\x85\xA9", + "\xA2\xC3" => "\xE3\x80\xA1", + "\xA2\xC4" => "\xE3\x80\xA2", + "\xA2\xC5" => "\xE3\x80\xA3", + "\xA2\xC6" => "\xE3\x80\xA4", + "\xA2\xC7" => "\xE3\x80\xA5", + "\xA2\xC8" => "\xE3\x80\xA6", + "\xA2\xC9" => "\xE3\x80\xA7", + "\xA2\xCA" => "\xE3\x80\xA8", + "\xA2\xCB" => "\xE3\x80\xA9", + "\xA2\xCC" => "\xEF\xBF\xBD", + "\xA2\xCD" => "\xE5\x8D\x84", + "\xA2\xCE" => "\xEF\xBF\xBD", + "\xA2\xCF" => "\xEF\xBC\xA1", + "\xA2\xD0" => "\xEF\xBC\xA2", + "\xA2\xD1" => "\xEF\xBC\xA3", + "\xA2\xD2" => "\xEF\xBC\xA4", + "\xA2\xD3" => "\xEF\xBC\xA5", + "\xA2\xD4" => "\xEF\xBC\xA6", + "\xA2\xD5" => "\xEF\xBC\xA7", + "\xA2\xD6" => "\xEF\xBC\xA8", + "\xA2\xD7" => "\xEF\xBC\xA9", + "\xA2\xD8" => "\xEF\xBC\xAA", + "\xA2\xD9" => "\xEF\xBC\xAB", + "\xA2\xDA" => "\xEF\xBC\xAC", + "\xA2\xDB" => "\xEF\xBC\xAD", + "\xA2\xDC" => "\xEF\xBC\xAE", + "\xA2\xDD" => "\xEF\xBC\xAF", + "\xA2\xDE" => "\xEF\xBC\xB0", + "\xA2\xDF" => "\xEF\xBC\xB1", + "\xA2\xE0" => "\xEF\xBC\xB2", + "\xA2\xE1" => "\xEF\xBC\xB3", + "\xA2\xE2" => "\xEF\xBC\xB4", + "\xA2\xE3" => "\xEF\xBC\xB5", + "\xA2\xE4" => "\xEF\xBC\xB6", + "\xA2\xE5" => "\xEF\xBC\xB7", + "\xA2\xE6" => "\xEF\xBC\xB8", + "\xA2\xE7" => "\xEF\xBC\xB9", + "\xA2\xE8" => "\xEF\xBC\xBA", + "\xA2\xE9" => "\xEF\xBD\x81", + "\xA2\xEA" => "\xEF\xBD\x82", + "\xA2\xEB" => "\xEF\xBD\x83", + "\xA2\xEC" => "\xEF\xBD\x84", + "\xA2\xED" => "\xEF\xBD\x85", + "\xA2\xEE" => "\xEF\xBD\x86", + "\xA2\xEF" => "\xEF\xBD\x87", + "\xA2\xF0" => "\xEF\xBD\x88", + "\xA2\xF1" => "\xEF\xBD\x89", + "\xA2\xF2" => "\xEF\xBD\x8A", + "\xA2\xF3" => "\xEF\xBD\x8B", + "\xA2\xF4" => "\xEF\xBD\x8C", + "\xA2\xF5" => "\xEF\xBD\x8D", + "\xA2\xF6" => "\xEF\xBD\x8E", + "\xA2\xF7" => "\xEF\xBD\x8F", + "\xA2\xF8" => "\xEF\xBD\x90", + "\xA2\xF9" => "\xEF\xBD\x91", + "\xA2\xFA" => "\xEF\xBD\x92", + "\xA2\xFB" => "\xEF\xBD\x93", + "\xA2\xFC" => "\xEF\xBD\x94", + "\xA2\xFD" => "\xEF\xBD\x95", + "\xA2\xFE" => "\xEF\xBD\x96", + "\xA3\x40" => "\xEF\xBD\x97", + "\xA3\x41" => "\xEF\xBD\x98", + "\xA3\x42" => "\xEF\xBD\x99", + "\xA3\x43" => "\xEF\xBD\x9A", + "\xA3\x44" => "\xCE\x91", + "\xA3\x45" => "\xCE\x92", + "\xA3\x46" => "\xCE\x93", + "\xA3\x47" => "\xCE\x94", + "\xA3\x48" => "\xCE\x95", + "\xA3\x49" => "\xCE\x96", + "\xA3\x4A" => "\xCE\x97", + "\xA3\x4B" => "\xCE\x98", + "\xA3\x4C" => "\xCE\x99", + "\xA3\x4D" => "\xCE\x9A", + "\xA3\x4E" => "\xCE\x9B", + "\xA3\x4F" => "\xCE\x9C", + "\xA3\x50" => "\xCE\x9D", + "\xA3\x51" => "\xCE\x9E", + "\xA3\x52" => "\xCE\x9F", + "\xA3\x53" => "\xCE\xA0", + "\xA3\x54" => "\xCE\xA1", + "\xA3\x55" => "\xCE\xA3", + "\xA3\x56" => "\xCE\xA4", + "\xA3\x57" => "\xCE\xA5", + "\xA3\x58" => "\xCE\xA6", + "\xA3\x59" => "\xCE\xA7", + "\xA3\x5A" => "\xCE\xA8", + "\xA3\x5B" => "\xCE\xA9", + "\xA3\x5C" => "\xCE\xB1", + "\xA3\x5D" => "\xCE\xB2", + "\xA3\x5E" => "\xCE\xB3", + "\xA3\x5F" => "\xCE\xB4", + "\xA3\x60" => "\xCE\xB5", + "\xA3\x61" => "\xCE\xB6", + "\xA3\x62" => "\xCE\xB7", + "\xA3\x63" => "\xCE\xB8", + "\xA3\x64" => "\xCE\xB9", + "\xA3\x65" => "\xCE\xBA", + "\xA3\x66" => "\xCE\xBB", + "\xA3\x67" => "\xCE\xBC", + "\xA3\x68" => "\xCE\xBD", + "\xA3\x69" => "\xCE\xBE", + "\xA3\x6A" => "\xCE\xBF", + "\xA3\x6B" => "\xCF\x80", + "\xA3\x6C" => "\xCF\x81", + "\xA3\x6D" => "\xCF\x83", + "\xA3\x6E" => "\xCF\x84", + "\xA3\x6F" => "\xCF\x85", + "\xA3\x70" => "\xCF\x86", + "\xA3\x71" => "\xCF\x87", + "\xA3\x72" => "\xCF\x88", + "\xA3\x73" => "\xCF\x89", + "\xA3\x74" => "\xE3\x84\x85", + "\xA3\x75" => "\xE3\x84\x86", + "\xA3\x76" => "\xE3\x84\x87", + "\xA3\x77" => "\xE3\x84\x88", + "\xA3\x78" => "\xE3\x84\x89", + "\xA3\x79" => "\xE3\x84\x8A", + "\xA3\x7A" => "\xE3\x84\x8B", + "\xA3\x7B" => "\xE3\x84\x8C", + "\xA3\x7C" => "\xE3\x84\x8D", + "\xA3\x7D" => "\xE3\x84\x8E", + "\xA3\x7E" => "\xE3\x84\x8F", + "\xA3\xA1" => "\xE3\x84\x90", + "\xA3\xA2" => "\xE3\x84\x91", + "\xA3\xA3" => "\xE3\x84\x92", + "\xA3\xA4" => "\xE3\x84\x93", + "\xA3\xA5" => "\xE3\x84\x94", + "\xA3\xA6" => "\xE3\x84\x95", + "\xA3\xA7" => "\xE3\x84\x96", + "\xA3\xA8" => "\xE3\x84\x97", + "\xA3\xA9" => "\xE3\x84\x98", + "\xA3\xAA" => "\xE3\x84\x99", + "\xA3\xAB" => "\xE3\x84\x9A", + "\xA3\xAC" => "\xE3\x84\x9B", + "\xA3\xAD" => "\xE3\x84\x9C", + "\xA3\xAE" => "\xE3\x84\x9D", + "\xA3\xAF" => "\xE3\x84\x9E", + "\xA3\xB0" => "\xE3\x84\x9F", + "\xA3\xB1" => "\xE3\x84\xA0", + "\xA3\xB2" => "\xE3\x84\xA1", + "\xA3\xB3" => "\xE3\x84\xA2", + "\xA3\xB4" => "\xE3\x84\xA3", + "\xA3\xB5" => "\xE3\x84\xA4", + "\xA3\xB6" => "\xE3\x84\xA5", + "\xA3\xB7" => "\xE3\x84\xA6", + "\xA3\xB8" => "\xE3\x84\xA7", + "\xA3\xB9" => "\xE3\x84\xA8", + "\xA3\xBA" => "\xE3\x84\xA9", + "\xA3\xBB" => "\xCB\x99", + "\xA3\xBC" => "\xCB\x89", + "\xA3\xBD" => "\xCB\x8A", + "\xA3\xBE" => "\xCB\x87", + "\xA3\xBF" => "\xCB\x8B", + "\xA4\x40" => "\xE4\xB8\x80", + "\xA4\x41" => "\xE4\xB9\x99", + "\xA4\x42" => "\xE4\xB8\x81", + "\xA4\x43" => "\xE4\xB8\x83", + "\xA4\x44" => "\xE4\xB9\x83", + "\xA4\x45" => "\xE4\xB9\x9D", + "\xA4\x46" => "\xE4\xBA\x86", + "\xA4\x47" => "\xE4\xBA\x8C", + "\xA4\x48" => "\xE4\xBA\xBA", + "\xA4\x49" => "\xE5\x84\xBF", + "\xA4\x4A" => "\xE5\x85\xA5", + "\xA4\x4B" => "\xE5\x85\xAB", + "\xA4\x4C" => "\xE5\x87\xA0", + "\xA4\x4D" => "\xE5\x88\x80", + "\xA4\x4E" => "\xE5\x88\x81", + "\xA4\x4F" => "\xE5\x8A\x9B", + "\xA4\x50" => "\xE5\x8C\x95", + "\xA4\x51" => "\xE5\x8D\x81", + "\xA4\x52" => "\xE5\x8D\x9C", + "\xA4\x53" => "\xE5\x8F\x88", + "\xA4\x54" => "\xE4\xB8\x89", + "\xA4\x55" => "\xE4\xB8\x8B", + "\xA4\x56" => "\xE4\xB8\x88", + "\xA4\x57" => "\xE4\xB8\x8A", + "\xA4\x58" => "\xE4\xB8\xAB", + "\xA4\x59" => "\xE4\xB8\xB8", + "\xA4\x5A" => "\xE5\x87\xA1", + "\xA4\x5B" => "\xE4\xB9\x85", + "\xA4\x5C" => "\xE4\xB9\x88", + "\xA4\x5D" => "\xE4\xB9\x9F", + "\xA4\x5E" => "\xE4\xB9\x9E", + "\xA4\x5F" => "\xE4\xBA\x8E", + "\xA4\x60" => "\xE4\xBA\xA1", + "\xA4\x61" => "\xE5\x85\x80", + "\xA4\x62" => "\xE5\x88\x83", + "\xA4\x63" => "\xE5\x8B\xBA", + "\xA4\x64" => "\xE5\x8D\x83", + "\xA4\x65" => "\xE5\x8F\x89", + "\xA4\x66" => "\xE5\x8F\xA3", + "\xA4\x67" => "\xE5\x9C\x9F", + "\xA4\x68" => "\xE5\xA3\xAB", + "\xA4\x69" => "\xE5\xA4\x95", + "\xA4\x6A" => "\xE5\xA4\xA7", + "\xA4\x6B" => "\xE5\xA5\xB3", + "\xA4\x6C" => "\xE5\xAD\x90", + "\xA4\x6D" => "\xE5\xAD\x91", + "\xA4\x6E" => "\xE5\xAD\x93", + "\xA4\x6F" => "\xE5\xAF\xB8", + "\xA4\x70" => "\xE5\xB0\x8F", + "\xA4\x71" => "\xE5\xB0\xA2", + "\xA4\x72" => "\xE5\xB0\xB8", + "\xA4\x73" => "\xE5\xB1\xB1", + "\xA4\x74" => "\xE5\xB7\x9D", + "\xA4\x75" => "\xE5\xB7\xA5", + "\xA4\x76" => "\xE5\xB7\xB1", + "\xA4\x77" => "\xE5\xB7\xB2", + "\xA4\x78" => "\xE5\xB7\xB3", + "\xA4\x79" => "\xE5\xB7\xBE", + "\xA4\x7A" => "\xE5\xB9\xB2", + "\xA4\x7B" => "\xE5\xBB\xBE", + "\xA4\x7C" => "\xE5\xBC\x8B", + "\xA4\x7D" => "\xE5\xBC\x93", + "\xA4\x7E" => "\xE6\x89\x8D", + "\xA4\xA1" => "\xE4\xB8\x91", + "\xA4\xA2" => "\xE4\xB8\x90", + "\xA4\xA3" => "\xE4\xB8\x8D", + "\xA4\xA4" => "\xE4\xB8\xAD", + "\xA4\xA5" => "\xE4\xB8\xB0", + "\xA4\xA6" => "\xE4\xB8\xB9", + "\xA4\xA7" => "\xE4\xB9\x8B", + "\xA4\xA8" => "\xE5\xB0\xB9", + "\xA4\xA9" => "\xE4\xBA\x88", + "\xA4\xAA" => "\xE4\xBA\x91", + "\xA4\xAB" => "\xE4\xBA\x95", + "\xA4\xAC" => "\xE4\xBA\x92", + "\xA4\xAD" => "\xE4\xBA\x94", + "\xA4\xAE" => "\xE4\xBA\xA2", + "\xA4\xAF" => "\xE4\xBB\x81", + "\xA4\xB0" => "\xE4\xBB\x80", + "\xA4\xB1" => "\xE4\xBB\x83", + "\xA4\xB2" => "\xE4\xBB\x86", + "\xA4\xB3" => "\xE4\xBB\x87", + "\xA4\xB4" => "\xE4\xBB\x8D", + "\xA4\xB5" => "\xE4\xBB\x8A", + "\xA4\xB6" => "\xE4\xBB\x8B", + "\xA4\xB7" => "\xE4\xBB\x84", + "\xA4\xB8" => "\xE5\x85\x83", + "\xA4\xB9" => "\xE5\x85\x81", + "\xA4\xBA" => "\xE5\x85\xA7", + "\xA4\xBB" => "\xE5\x85\xAD", + "\xA4\xBC" => "\xE5\x85\xAE", + "\xA4\xBD" => "\xE5\x85\xAC", + "\xA4\xBE" => "\xE5\x86\x97", + "\xA4\xBF" => "\xE5\x87\xB6", + "\xA4\xC0" => "\xE5\x88\x86", + "\xA4\xC1" => "\xE5\x88\x87", + "\xA4\xC2" => "\xE5\x88\x88", + "\xA4\xC3" => "\xE5\x8B\xBB", + "\xA4\xC4" => "\xE5\x8B\xBE", + "\xA4\xC5" => "\xE5\x8B\xBF", + "\xA4\xC6" => "\xE5\x8C\x96", + "\xA4\xC7" => "\xE5\x8C\xB9", + "\xA4\xC8" => "\xE5\x8D\x88", + "\xA4\xC9" => "\xE5\x8D\x87", + "\xA4\xCA" => "\xE5\x8D\x85", + "\xA4\xCB" => "\xE5\x8D\x9E", + "\xA4\xCC" => "\xE5\x8E\x84", + "\xA4\xCD" => "\xE5\x8F\x8B", + "\xA4\xCE" => "\xE5\x8F\x8A", + "\xA4\xCF" => "\xE5\x8F\x8D", + "\xA4\xD0" => "\xE5\xA3\xAC", + "\xA4\xD1" => "\xE5\xA4\xA9", + "\xA4\xD2" => "\xE5\xA4\xAB", + "\xA4\xD3" => "\xE5\xA4\xAA", + "\xA4\xD4" => "\xE5\xA4\xAD", + "\xA4\xD5" => "\xE5\xAD\x94", + "\xA4\xD6" => "\xE5\xB0\x91", + "\xA4\xD7" => "\xE5\xB0\xA4", + "\xA4\xD8" => "\xE5\xB0\xBA", + "\xA4\xD9" => "\xE5\xB1\xAF", + "\xA4\xDA" => "\xE5\xB7\xB4", + "\xA4\xDB" => "\xE5\xB9\xBB", + "\xA4\xDC" => "\xE5\xBB\xBF", + "\xA4\xDD" => "\xE5\xBC\x94", + "\xA4\xDE" => "\xE5\xBC\x95", + "\xA4\xDF" => "\xE5\xBF\x83", + "\xA4\xE0" => "\xE6\x88\x88", + "\xA4\xE1" => "\xE6\x88\xB6", + "\xA4\xE2" => "\xE6\x89\x8B", + "\xA4\xE3" => "\xE6\x89\x8E", + "\xA4\xE4" => "\xE6\x94\xAF", + "\xA4\xE5" => "\xE6\x96\x87", + "\xA4\xE6" => "\xE6\x96\x97", + "\xA4\xE7" => "\xE6\x96\xA4", + "\xA4\xE8" => "\xE6\x96\xB9", + "\xA4\xE9" => "\xE6\x97\xA5", + "\xA4\xEA" => "\xE6\x9B\xB0", + "\xA4\xEB" => "\xE6\x9C\x88", + "\xA4\xEC" => "\xE6\x9C\xA8", + "\xA4\xED" => "\xE6\xAC\xA0", + "\xA4\xEE" => "\xE6\xAD\xA2", + "\xA4\xEF" => "\xE6\xAD\xB9", + "\xA4\xF0" => "\xE6\xAF\x8B", + "\xA4\xF1" => "\xE6\xAF\x94", + "\xA4\xF2" => "\xE6\xAF\x9B", + "\xA4\xF3" => "\xE6\xB0\x8F", + "\xA4\xF4" => "\xE6\xB0\xB4", + "\xA4\xF5" => "\xE7\x81\xAB", + "\xA4\xF6" => "\xE7\x88\xAA", + "\xA4\xF7" => "\xE7\x88\xB6", + "\xA4\xF8" => "\xE7\x88\xBB", + "\xA4\xF9" => "\xE7\x89\x87", + "\xA4\xFA" => "\xE7\x89\x99", + "\xA4\xFB" => "\xE7\x89\x9B", + "\xA4\xFC" => "\xE7\x8A\xAC", + "\xA4\xFD" => "\xE7\x8E\x8B", + "\xA4\xFE" => "\xE4\xB8\x99", + "\xA5\x40" => "\xE4\xB8\x96", + "\xA5\x41" => "\xE4\xB8\x95", + "\xA5\x42" => "\xE4\xB8\x94", + "\xA5\x43" => "\xE4\xB8\x98", + "\xA5\x44" => "\xE4\xB8\xBB", + "\xA5\x45" => "\xE4\xB9\x8D", + "\xA5\x46" => "\xE4\xB9\x8F", + "\xA5\x47" => "\xE4\xB9\x8E", + "\xA5\x48" => "\xE4\xBB\xA5", + "\xA5\x49" => "\xE4\xBB\x98", + "\xA5\x4A" => "\xE4\xBB\x94", + "\xA5\x4B" => "\xE4\xBB\x95", + "\xA5\x4C" => "\xE4\xBB\x96", + "\xA5\x4D" => "\xE4\xBB\x97", + "\xA5\x4E" => "\xE4\xBB\xA3", + "\xA5\x4F" => "\xE4\xBB\xA4", + "\xA5\x50" => "\xE4\xBB\x99", + "\xA5\x51" => "\xE4\xBB\x9E", + "\xA5\x52" => "\xE5\x85\x85", + "\xA5\x53" => "\xE5\x85\x84", + "\xA5\x54" => "\xE5\x86\x89", + "\xA5\x55" => "\xE5\x86\x8A", + "\xA5\x56" => "\xE5\x86\xAC", + "\xA5\x57" => "\xE5\x87\xB9", + "\xA5\x58" => "\xE5\x87\xBA", + "\xA5\x59" => "\xE5\x87\xB8", + "\xA5\x5A" => "\xE5\x88\x8A", + "\xA5\x5B" => "\xE5\x8A\xA0", + "\xA5\x5C" => "\xE5\x8A\x9F", + "\xA5\x5D" => "\xE5\x8C\x85", + "\xA5\x5E" => "\xE5\x8C\x86", + "\xA5\x5F" => "\xE5\x8C\x97", + "\xA5\x60" => "\xE5\x8C\x9D", + "\xA5\x61" => "\xE4\xBB\x9F", + "\xA5\x62" => "\xE5\x8D\x8A", + "\xA5\x63" => "\xE5\x8D\x89", + "\xA5\x64" => "\xE5\x8D\xA1", + "\xA5\x65" => "\xE5\x8D\xA0", + "\xA5\x66" => "\xE5\x8D\xAF", + "\xA5\x67" => "\xE5\x8D\xAE", + "\xA5\x68" => "\xE5\x8E\xBB", + "\xA5\x69" => "\xE5\x8F\xAF", + "\xA5\x6A" => "\xE5\x8F\xA4", + "\xA5\x6B" => "\xE5\x8F\xB3", + "\xA5\x6C" => "\xE5\x8F\xAC", + "\xA5\x6D" => "\xE5\x8F\xAE", + "\xA5\x6E" => "\xE5\x8F\xA9", + "\xA5\x6F" => "\xE5\x8F\xA8", + "\xA5\x70" => "\xE5\x8F\xBC", + "\xA5\x71" => "\xE5\x8F\xB8", + "\xA5\x72" => "\xE5\x8F\xB5", + "\xA5\x73" => "\xE5\x8F\xAB", + "\xA5\x74" => "\xE5\x8F\xA6", + "\xA5\x75" => "\xE5\x8F\xAA", + "\xA5\x76" => "\xE5\x8F\xB2", + "\xA5\x77" => "\xE5\x8F\xB1", + "\xA5\x78" => "\xE5\x8F\xB0", + "\xA5\x79" => "\xE5\x8F\xA5", + "\xA5\x7A" => "\xE5\x8F\xAD", + "\xA5\x7B" => "\xE5\x8F\xBB", + "\xA5\x7C" => "\xE5\x9B\x9B", + "\xA5\x7D" => "\xE5\x9B\x9A", + "\xA5\x7E" => "\xE5\xA4\x96", + "\xA5\xA1" => "\xE5\xA4\xAE", + "\xA5\xA2" => "\xE5\xA4\xB1", + "\xA5\xA3" => "\xE5\xA5\xB4", + "\xA5\xA4" => "\xE5\xA5\xB6", + "\xA5\xA5" => "\xE5\xAD\x95", + "\xA5\xA6" => "\xE5\xAE\x83", + "\xA5\xA7" => "\xE5\xB0\xBC", + "\xA5\xA8" => "\xE5\xB7\xA8", + "\xA5\xA9" => "\xE5\xB7\xA7", + "\xA5\xAA" => "\xE5\xB7\xA6", + "\xA5\xAB" => "\xE5\xB8\x82", + "\xA5\xAC" => "\xE5\xB8\x83", + "\xA5\xAD" => "\xE5\xB9\xB3", + "\xA5\xAE" => "\xE5\xB9\xBC", + "\xA5\xAF" => "\xE5\xBC\x81", + "\xA5\xB0" => "\xE5\xBC\x98", + "\xA5\xB1" => "\xE5\xBC\x97", + "\xA5\xB2" => "\xE5\xBF\x85", + "\xA5\xB3" => "\xE6\x88\x8A", + "\xA5\xB4" => "\xE6\x89\x93", + "\xA5\xB5" => "\xE6\x89\x94", + "\xA5\xB6" => "\xE6\x89\x92", + "\xA5\xB7" => "\xE6\x89\x91", + "\xA5\xB8" => "\xE6\x96\xA5", + "\xA5\xB9" => "\xE6\x97\xA6", + "\xA5\xBA" => "\xE6\x9C\xAE", + "\xA5\xBB" => "\xE6\x9C\xAC", + "\xA5\xBC" => "\xE6\x9C\xAA", + "\xA5\xBD" => "\xE6\x9C\xAB", + "\xA5\xBE" => "\xE6\x9C\xAD", + "\xA5\xBF" => "\xE6\xAD\xA3", + "\xA5\xC0" => "\xE6\xAF\x8D", + "\xA5\xC1" => "\xE6\xB0\x91", + "\xA5\xC2" => "\xE6\xB0\x90", + "\xA5\xC3" => "\xE6\xB0\xB8", + "\xA5\xC4" => "\xE6\xB1\x81", + "\xA5\xC5" => "\xE6\xB1\x80", + "\xA5\xC6" => "\xE6\xB0\xBE", + "\xA5\xC7" => "\xE7\x8A\xAF", + "\xA5\xC8" => "\xE7\x8E\x84", + "\xA5\xC9" => "\xE7\x8E\x89", + "\xA5\xCA" => "\xE7\x93\x9C", + "\xA5\xCB" => "\xE7\x93\xA6", + "\xA5\xCC" => "\xE7\x94\x98", + "\xA5\xCD" => "\xE7\x94\x9F", + "\xA5\xCE" => "\xE7\x94\xA8", + "\xA5\xCF" => "\xE7\x94\xA9", + "\xA5\xD0" => "\xE7\x94\xB0", + "\xA5\xD1" => "\xE7\x94\xB1", + "\xA5\xD2" => "\xE7\x94\xB2", + "\xA5\xD3" => "\xE7\x94\xB3", + "\xA5\xD4" => "\xE7\x96\x8B", + "\xA5\xD5" => "\xE7\x99\xBD", + "\xA5\xD6" => "\xE7\x9A\xAE", + "\xA5\xD7" => "\xE7\x9A\xBF", + "\xA5\xD8" => "\xE7\x9B\xAE", + "\xA5\xD9" => "\xE7\x9F\x9B", + "\xA5\xDA" => "\xE7\x9F\xA2", + "\xA5\xDB" => "\xE7\x9F\xB3", + "\xA5\xDC" => "\xE7\xA4\xBA", + "\xA5\xDD" => "\xE7\xA6\xBE", + "\xA5\xDE" => "\xE7\xA9\xB4", + "\xA5\xDF" => "\xE7\xAB\x8B", + "\xA5\xE0" => "\xE4\xB8\x9E", + "\xA5\xE1" => "\xE4\xB8\x9F", + "\xA5\xE2" => "\xE4\xB9\x92", + "\xA5\xE3" => "\xE4\xB9\x93", + "\xA5\xE4" => "\xE4\xB9\xA9", + "\xA5\xE5" => "\xE4\xBA\x99", + "\xA5\xE6" => "\xE4\xBA\xA4", + "\xA5\xE7" => "\xE4\xBA\xA6", + "\xA5\xE8" => "\xE4\xBA\xA5", + "\xA5\xE9" => "\xE4\xBB\xBF", + "\xA5\xEA" => "\xE4\xBC\x89", + "\xA5\xEB" => "\xE4\xBC\x99", + "\xA5\xEC" => "\xE4\xBC\x8A", + "\xA5\xED" => "\xE4\xBC\x95", + "\xA5\xEE" => "\xE4\xBC\x8D", + "\xA5\xEF" => "\xE4\xBC\x90", + "\xA5\xF0" => "\xE4\xBC\x91", + "\xA5\xF1" => "\xE4\xBC\x8F", + "\xA5\xF2" => "\xE4\xBB\xB2", + "\xA5\xF3" => "\xE4\xBB\xB6", + "\xA5\xF4" => "\xE4\xBB\xBB", + "\xA5\xF5" => "\xE4\xBB\xB0", + "\xA5\xF6" => "\xE4\xBB\xB3", + "\xA5\xF7" => "\xE4\xBB\xBD", + "\xA5\xF8" => "\xE4\xBC\x81", + "\xA5\xF9" => "\xE4\xBC\x8B", + "\xA5\xFA" => "\xE5\x85\x89", + "\xA5\xFB" => "\xE5\x85\x87", + "\xA5\xFC" => "\xE5\x85\x86", + "\xA5\xFD" => "\xE5\x85\x88", + "\xA5\xFE" => "\xE5\x85\xA8", + "\xA6\x40" => "\xE5\x85\xB1", + "\xA6\x41" => "\xE5\x86\x8D", + "\xA6\x42" => "\xE5\x86\xB0", + "\xA6\x43" => "\xE5\x88\x97", + "\xA6\x44" => "\xE5\x88\x91", + "\xA6\x45" => "\xE5\x88\x92", + "\xA6\x46" => "\xE5\x88\x8E", + "\xA6\x47" => "\xE5\x88\x96", + "\xA6\x48" => "\xE5\x8A\xA3", + "\xA6\x49" => "\xE5\x8C\x88", + "\xA6\x4A" => "\xE5\x8C\xA1", + "\xA6\x4B" => "\xE5\x8C\xA0", + "\xA6\x4C" => "\xE5\x8D\xB0", + "\xA6\x4D" => "\xE5\x8D\xB1", + "\xA6\x4E" => "\xE5\x90\x89", + "\xA6\x4F" => "\xE5\x90\x8F", + "\xA6\x50" => "\xE5\x90\x8C", + "\xA6\x51" => "\xE5\x90\x8A", + "\xA6\x52" => "\xE5\x90\x90", + "\xA6\x53" => "\xE5\x90\x81", + "\xA6\x54" => "\xE5\x90\x8B", + "\xA6\x55" => "\xE5\x90\x84", + "\xA6\x56" => "\xE5\x90\x91", + "\xA6\x57" => "\xE5\x90\x8D", + "\xA6\x58" => "\xE5\x90\x88", + "\xA6\x59" => "\xE5\x90\x83", + "\xA6\x5A" => "\xE5\x90\x8E", + "\xA6\x5B" => "\xE5\x90\x86", + "\xA6\x5C" => "\xE5\x90\x92", + "\xA6\x5D" => "\xE5\x9B\xA0", + "\xA6\x5E" => "\xE5\x9B\x9E", + "\xA6\x5F" => "\xE5\x9B\x9D", + "\xA6\x60" => "\xE5\x9C\xB3", + "\xA6\x61" => "\xE5\x9C\xB0", + "\xA6\x62" => "\xE5\x9C\xA8", + "\xA6\x63" => "\xE5\x9C\xAD", + "\xA6\x64" => "\xE5\x9C\xAC", + "\xA6\x65" => "\xE5\x9C\xAF", + "\xA6\x66" => "\xE5\x9C\xA9", + "\xA6\x67" => "\xE5\xA4\x99", + "\xA6\x68" => "\xE5\xA4\x9A", + "\xA6\x69" => "\xE5\xA4\xB7", + "\xA6\x6A" => "\xE5\xA4\xB8", + "\xA6\x6B" => "\xE5\xA6\x84", + "\xA6\x6C" => "\xE5\xA5\xB8", + "\xA6\x6D" => "\xE5\xA6\x83", + "\xA6\x6E" => "\xE5\xA5\xBD", + "\xA6\x6F" => "\xE5\xA5\xB9", + "\xA6\x70" => "\xE5\xA6\x82", + "\xA6\x71" => "\xE5\xA6\x81", + "\xA6\x72" => "\xE5\xAD\x97", + "\xA6\x73" => "\xE5\xAD\x98", + "\xA6\x74" => "\xE5\xAE\x87", + "\xA6\x75" => "\xE5\xAE\x88", + "\xA6\x76" => "\xE5\xAE\x85", + "\xA6\x77" => "\xE5\xAE\x89", + "\xA6\x78" => "\xE5\xAF\xBA", + "\xA6\x79" => "\xE5\xB0\x96", + "\xA6\x7A" => "\xE5\xB1\xB9", + "\xA6\x7B" => "\xE5\xB7\x9E", + "\xA6\x7C" => "\xE5\xB8\x86", + "\xA6\x7D" => "\xE5\xB9\xB6", + "\xA6\x7E" => "\xE5\xB9\xB4", + "\xA6\xA1" => "\xE5\xBC\x8F", + "\xA6\xA2" => "\xE5\xBC\x9B", + "\xA6\xA3" => "\xE5\xBF\x99", + "\xA6\xA4" => "\xE5\xBF\x96", + "\xA6\xA5" => "\xE6\x88\x8E", + "\xA6\xA6" => "\xE6\x88\x8C", + "\xA6\xA7" => "\xE6\x88\x8D", + "\xA6\xA8" => "\xE6\x88\x90", + "\xA6\xA9" => "\xE6\x89\xA3", + "\xA6\xAA" => "\xE6\x89\x9B", + "\xA6\xAB" => "\xE6\x89\x98", + "\xA6\xAC" => "\xE6\x94\xB6", + "\xA6\xAD" => "\xE6\x97\xA9", + "\xA6\xAE" => "\xE6\x97\xA8", + "\xA6\xAF" => "\xE6\x97\xAC", + "\xA6\xB0" => "\xE6\x97\xAD", + "\xA6\xB1" => "\xE6\x9B\xB2", + "\xA6\xB2" => "\xE6\x9B\xB3", + "\xA6\xB3" => "\xE6\x9C\x89", + "\xA6\xB4" => "\xE6\x9C\xBD", + "\xA6\xB5" => "\xE6\x9C\xB4", + "\xA6\xB6" => "\xE6\x9C\xB1", + "\xA6\xB7" => "\xE6\x9C\xB5", + "\xA6\xB8" => "\xE6\xAC\xA1", + "\xA6\xB9" => "\xE6\xAD\xA4", + "\xA6\xBA" => "\xE6\xAD\xBB", + "\xA6\xBB" => "\xE6\xB0\x96", + "\xA6\xBC" => "\xE6\xB1\x9D", + "\xA6\xBD" => "\xE6\xB1\x97", + "\xA6\xBE" => "\xE6\xB1\x99", + "\xA6\xBF" => "\xE6\xB1\x9F", + "\xA6\xC0" => "\xE6\xB1\xA0", + "\xA6\xC1" => "\xE6\xB1\x90", + "\xA6\xC2" => "\xE6\xB1\x95", + "\xA6\xC3" => "\xE6\xB1\xA1", + "\xA6\xC4" => "\xE6\xB1\x9B", + "\xA6\xC5" => "\xE6\xB1\x8D", + "\xA6\xC6" => "\xE6\xB1\x8E", + "\xA6\xC7" => "\xE7\x81\xB0", + "\xA6\xC8" => "\xE7\x89\x9F", + "\xA6\xC9" => "\xE7\x89\x9D", + "\xA6\xCA" => "\xE7\x99\xBE", + "\xA6\xCB" => "\xE7\xAB\xB9", + "\xA6\xCC" => "\xE7\xB1\xB3", + "\xA6\xCD" => "\xE7\xB3\xB8", + "\xA6\xCE" => "\xE7\xBC\xB6", + "\xA6\xCF" => "\xE7\xBE\x8A", + "\xA6\xD0" => "\xE7\xBE\xBD", + "\xA6\xD1" => "\xE8\x80\x81", + "\xA6\xD2" => "\xE8\x80\x83", + "\xA6\xD3" => "\xE8\x80\x8C", + "\xA6\xD4" => "\xE8\x80\x92", + "\xA6\xD5" => "\xE8\x80\xB3", + "\xA6\xD6" => "\xE8\x81\xBF", + "\xA6\xD7" => "\xE8\x82\x89", + "\xA6\xD8" => "\xE8\x82\x8B", + "\xA6\xD9" => "\xE8\x82\x8C", + "\xA6\xDA" => "\xE8\x87\xA3", + "\xA6\xDB" => "\xE8\x87\xAA", + "\xA6\xDC" => "\xE8\x87\xB3", + "\xA6\xDD" => "\xE8\x87\xBC", + "\xA6\xDE" => "\xE8\x88\x8C", + "\xA6\xDF" => "\xE8\x88\x9B", + "\xA6\xE0" => "\xE8\x88\x9F", + "\xA6\xE1" => "\xE8\x89\xAE", + "\xA6\xE2" => "\xE8\x89\xB2", + "\xA6\xE3" => "\xE8\x89\xBE", + "\xA6\xE4" => "\xE8\x99\xAB", + "\xA6\xE5" => "\xE8\xA1\x80", + "\xA6\xE6" => "\xE8\xA1\x8C", + "\xA6\xE7" => "\xE8\xA1\xA3", + "\xA6\xE8" => "\xE8\xA5\xBF", + "\xA6\xE9" => "\xE9\x98\xA1", + "\xA6\xEA" => "\xE4\xB8\xB2", + "\xA6\xEB" => "\xE4\xBA\xA8", + "\xA6\xEC" => "\xE4\xBD\x8D", + "\xA6\xED" => "\xE4\xBD\x8F", + "\xA6\xEE" => "\xE4\xBD\x87", + "\xA6\xEF" => "\xE4\xBD\x97", + "\xA6\xF0" => "\xE4\xBD\x9E", + "\xA6\xF1" => "\xE4\xBC\xB4", + "\xA6\xF2" => "\xE4\xBD\x9B", + "\xA6\xF3" => "\xE4\xBD\x95", + "\xA6\xF4" => "\xE4\xBC\xB0", + "\xA6\xF5" => "\xE4\xBD\x90", + "\xA6\xF6" => "\xE4\xBD\x91", + "\xA6\xF7" => "\xE4\xBC\xBD", + "\xA6\xF8" => "\xE4\xBC\xBA", + "\xA6\xF9" => "\xE4\xBC\xB8", + "\xA6\xFA" => "\xE4\xBD\x83", + "\xA6\xFB" => "\xE4\xBD\x94", + "\xA6\xFC" => "\xE4\xBC\xBC", + "\xA6\xFD" => "\xE4\xBD\x86", + "\xA6\xFE" => "\xE4\xBD\xA3", + "\xA7\x40" => "\xE4\xBD\x9C", + "\xA7\x41" => "\xE4\xBD\xA0", + "\xA7\x42" => "\xE4\xBC\xAF", + "\xA7\x43" => "\xE4\xBD\x8E", + "\xA7\x44" => "\xE4\xBC\xB6", + "\xA7\x45" => "\xE4\xBD\x99", + "\xA7\x46" => "\xE4\xBD\x9D", + "\xA7\x47" => "\xE4\xBD\x88", + "\xA7\x48" => "\xE4\xBD\x9A", + "\xA7\x49" => "\xE5\x85\x8C", + "\xA7\x4A" => "\xE5\x85\x8B", + "\xA7\x4B" => "\xE5\x85\x8D", + "\xA7\x4C" => "\xE5\x85\xB5", + "\xA7\x4D" => "\xE5\x86\xB6", + "\xA7\x4E" => "\xE5\x86\xB7", + "\xA7\x4F" => "\xE5\x88\xA5", + "\xA7\x50" => "\xE5\x88\xA4", + "\xA7\x51" => "\xE5\x88\xA9", + "\xA7\x52" => "\xE5\x88\xAA", + "\xA7\x53" => "\xE5\x88\xA8", + "\xA7\x54" => "\xE5\x8A\xAB", + "\xA7\x55" => "\xE5\x8A\xA9", + "\xA7\x56" => "\xE5\x8A\xAA", + "\xA7\x57" => "\xE5\x8A\xAC", + "\xA7\x58" => "\xE5\x8C\xA3", + "\xA7\x59" => "\xE5\x8D\xB3", + "\xA7\x5A" => "\xE5\x8D\xB5", + "\xA7\x5B" => "\xE5\x90\x9D", + "\xA7\x5C" => "\xE5\x90\xAD", + "\xA7\x5D" => "\xE5\x90\x9E", + "\xA7\x5E" => "\xE5\x90\xBE", + "\xA7\x5F" => "\xE5\x90\xA6", + "\xA7\x60" => "\xE5\x91\x8E", + "\xA7\x61" => "\xE5\x90\xA7", + "\xA7\x62" => "\xE5\x91\x86", + "\xA7\x63" => "\xE5\x91\x83", + "\xA7\x64" => "\xE5\x90\xB3", + "\xA7\x65" => "\xE5\x91\x88", + "\xA7\x66" => "\xE5\x91\x82", + "\xA7\x67" => "\xE5\x90\x9B", + "\xA7\x68" => "\xE5\x90\xA9", + "\xA7\x69" => "\xE5\x91\x8A", + "\xA7\x6A" => "\xE5\x90\xB9", + "\xA7\x6B" => "\xE5\x90\xBB", + "\xA7\x6C" => "\xE5\x90\xB8", + "\xA7\x6D" => "\xE5\x90\xAE", + "\xA7\x6E" => "\xE5\x90\xB5", + "\xA7\x6F" => "\xE5\x90\xB6", + "\xA7\x70" => "\xE5\x90\xA0", + "\xA7\x71" => "\xE5\x90\xBC", + "\xA7\x72" => "\xE5\x91\x80", + "\xA7\x73" => "\xE5\x90\xB1", + "\xA7\x74" => "\xE5\x90\xAB", + "\xA7\x75" => "\xE5\x90\x9F", + "\xA7\x76" => "\xE5\x90\xAC", + "\xA7\x77" => "\xE5\x9B\xAA", + "\xA7\x78" => "\xE5\x9B\xB0", + "\xA7\x79" => "\xE5\x9B\xA4", + "\xA7\x7A" => "\xE5\x9B\xAB", + "\xA7\x7B" => "\xE5\x9D\x8A", + "\xA7\x7C" => "\xE5\x9D\x91", + "\xA7\x7D" => "\xE5\x9D\x80", + "\xA7\x7E" => "\xE5\x9D\x8D", + "\xA7\xA1" => "\xE5\x9D\x87", + "\xA7\xA2" => "\xE5\x9D\x8E", + "\xA7\xA3" => "\xE5\x9C\xBE", + "\xA7\xA4" => "\xE5\x9D\x90", + "\xA7\xA5" => "\xE5\x9D\x8F", + "\xA7\xA6" => "\xE5\x9C\xBB", + "\xA7\xA7" => "\xE5\xA3\xAF", + "\xA7\xA8" => "\xE5\xA4\xBE", + "\xA7\xA9" => "\xE5\xA6\x9D", + "\xA7\xAA" => "\xE5\xA6\x92", + "\xA7\xAB" => "\xE5\xA6\xA8", + "\xA7\xAC" => "\xE5\xA6\x9E", + "\xA7\xAD" => "\xE5\xA6\xA3", + "\xA7\xAE" => "\xE5\xA6\x99", + "\xA7\xAF" => "\xE5\xA6\x96", + "\xA7\xB0" => "\xE5\xA6\x8D", + "\xA7\xB1" => "\xE5\xA6\xA4", + "\xA7\xB2" => "\xE5\xA6\x93", + "\xA7\xB3" => "\xE5\xA6\x8A", + "\xA7\xB4" => "\xE5\xA6\xA5", + "\xA7\xB5" => "\xE5\xAD\x9D", + "\xA7\xB6" => "\xE5\xAD\x9C", + "\xA7\xB7" => "\xE5\xAD\x9A", + "\xA7\xB8" => "\xE5\xAD\x9B", + "\xA7\xB9" => "\xE5\xAE\x8C", + "\xA7\xBA" => "\xE5\xAE\x8B", + "\xA7\xBB" => "\xE5\xAE\x8F", + "\xA7\xBC" => "\xE5\xB0\xAC", + "\xA7\xBD" => "\xE5\xB1\x80", + "\xA7\xBE" => "\xE5\xB1\x81", + "\xA7\xBF" => "\xE5\xB0\xBF", + "\xA7\xC0" => "\xE5\xB0\xBE", + "\xA7\xC1" => "\xE5\xB2\x90", + "\xA7\xC2" => "\xE5\xB2\x91", + "\xA7\xC3" => "\xE5\xB2\x94", + "\xA7\xC4" => "\xE5\xB2\x8C", + "\xA7\xC5" => "\xE5\xB7\xAB", + "\xA7\xC6" => "\xE5\xB8\x8C", + "\xA7\xC7" => "\xE5\xBA\x8F", + "\xA7\xC8" => "\xE5\xBA\x87", + "\xA7\xC9" => "\xE5\xBA\x8A", + "\xA7\xCA" => "\xE5\xBB\xB7", + "\xA7\xCB" => "\xE5\xBC\x84", + "\xA7\xCC" => "\xE5\xBC\x9F", + "\xA7\xCD" => "\xE5\xBD\xA4", + "\xA7\xCE" => "\xE5\xBD\xA2", + "\xA7\xCF" => "\xE5\xBD\xB7", + "\xA7\xD0" => "\xE5\xBD\xB9", + "\xA7\xD1" => "\xE5\xBF\x98", + "\xA7\xD2" => "\xE5\xBF\x8C", + "\xA7\xD3" => "\xE5\xBF\x97", + "\xA7\xD4" => "\xE5\xBF\x8D", + "\xA7\xD5" => "\xE5\xBF\xB1", + "\xA7\xD6" => "\xE5\xBF\xAB", + "\xA7\xD7" => "\xE5\xBF\xB8", + "\xA7\xD8" => "\xE5\xBF\xAA", + "\xA7\xD9" => "\xE6\x88\x92", + "\xA7\xDA" => "\xE6\x88\x91", + "\xA7\xDB" => "\xE6\x8A\x84", + "\xA7\xDC" => "\xE6\x8A\x97", + "\xA7\xDD" => "\xE6\x8A\x96", + "\xA7\xDE" => "\xE6\x8A\x80", + "\xA7\xDF" => "\xE6\x89\xB6", + "\xA7\xE0" => "\xE6\x8A\x89", + "\xA7\xE1" => "\xE6\x89\xAD", + "\xA7\xE2" => "\xE6\x8A\x8A", + "\xA7\xE3" => "\xE6\x89\xBC", + "\xA7\xE4" => "\xE6\x89\xBE", + "\xA7\xE5" => "\xE6\x89\xB9", + "\xA7\xE6" => "\xE6\x89\xB3", + "\xA7\xE7" => "\xE6\x8A\x92", + "\xA7\xE8" => "\xE6\x89\xAF", + "\xA7\xE9" => "\xE6\x8A\x98", + "\xA7\xEA" => "\xE6\x89\xAE", + "\xA7\xEB" => "\xE6\x8A\x95", + "\xA7\xEC" => "\xE6\x8A\x93", + "\xA7\xED" => "\xE6\x8A\x91", + "\xA7\xEE" => "\xE6\x8A\x86", + "\xA7\xEF" => "\xE6\x94\xB9", + "\xA7\xF0" => "\xE6\x94\xBB", + "\xA7\xF1" => "\xE6\x94\xB8", + "\xA7\xF2" => "\xE6\x97\xB1", + "\xA7\xF3" => "\xE6\x9B\xB4", + "\xA7\xF4" => "\xE6\x9D\x9F", + "\xA7\xF5" => "\xE6\x9D\x8E", + "\xA7\xF6" => "\xE6\x9D\x8F", + "\xA7\xF7" => "\xE6\x9D\x90", + "\xA7\xF8" => "\xE6\x9D\x91", + "\xA7\xF9" => "\xE6\x9D\x9C", + "\xA7\xFA" => "\xE6\x9D\x96", + "\xA7\xFB" => "\xE6\x9D\x9E", + "\xA7\xFC" => "\xE6\x9D\x89", + "\xA7\xFD" => "\xE6\x9D\x86", + "\xA7\xFE" => "\xE6\x9D\xA0", + "\xA8\x40" => "\xE6\x9D\x93", + "\xA8\x41" => "\xE6\x9D\x97", + "\xA8\x42" => "\xE6\xAD\xA5", + "\xA8\x43" => "\xE6\xAF\x8F", + "\xA8\x44" => "\xE6\xB1\x82", + "\xA8\x45" => "\xE6\xB1\x9E", + "\xA8\x46" => "\xE6\xB2\x99", + "\xA8\x47" => "\xE6\xB2\x81", + "\xA8\x48" => "\xE6\xB2\x88", + "\xA8\x49" => "\xE6\xB2\x89", + "\xA8\x4A" => "\xE6\xB2\x85", + "\xA8\x4B" => "\xE6\xB2\x9B", + "\xA8\x4C" => "\xE6\xB1\xAA", + "\xA8\x4D" => "\xE6\xB1\xBA", + "\xA8\x4E" => "\xE6\xB2\x90", + "\xA8\x4F" => "\xE6\xB1\xB0", + "\xA8\x50" => "\xE6\xB2\x8C", + "\xA8\x51" => "\xE6\xB1\xA8", + "\xA8\x52" => "\xE6\xB2\x96", + "\xA8\x53" => "\xE6\xB2\x92", + "\xA8\x54" => "\xE6\xB1\xBD", + "\xA8\x55" => "\xE6\xB2\x83", + "\xA8\x56" => "\xE6\xB1\xB2", + "\xA8\x57" => "\xE6\xB1\xBE", + "\xA8\x58" => "\xE6\xB1\xB4", + "\xA8\x59" => "\xE6\xB2\x86", + "\xA8\x5A" => "\xE6\xB1\xB6", + "\xA8\x5B" => "\xE6\xB2\x8D", + "\xA8\x5C" => "\xE6\xB2\x94", + "\xA8\x5D" => "\xE6\xB2\x98", + "\xA8\x5E" => "\xE6\xB2\x82", + "\xA8\x5F" => "\xE7\x81\xB6", + "\xA8\x60" => "\xE7\x81\xBC", + "\xA8\x61" => "\xE7\x81\xBD", + "\xA8\x62" => "\xE7\x81\xB8", + "\xA8\x63" => "\xE7\x89\xA2", + "\xA8\x64" => "\xE7\x89\xA1", + "\xA8\x65" => "\xE7\x89\xA0", + "\xA8\x66" => "\xE7\x8B\x84", + "\xA8\x67" => "\xE7\x8B\x82", + "\xA8\x68" => "\xE7\x8E\x96", + "\xA8\x69" => "\xE7\x94\xAC", + "\xA8\x6A" => "\xE7\x94\xAB", + "\xA8\x6B" => "\xE7\x94\xB7", + "\xA8\x6C" => "\xE7\x94\xB8", + "\xA8\x6D" => "\xE7\x9A\x82", + "\xA8\x6E" => "\xE7\x9B\xAF", + "\xA8\x6F" => "\xE7\x9F\xA3", + "\xA8\x70" => "\xE7\xA7\x81", + "\xA8\x71" => "\xE7\xA7\x80", + "\xA8\x72" => "\xE7\xA6\xBF", + "\xA8\x73" => "\xE7\xA9\xB6", + "\xA8\x74" => "\xE7\xB3\xBB", + "\xA8\x75" => "\xE7\xBD\x95", + "\xA8\x76" => "\xE8\x82\x96", + "\xA8\x77" => "\xE8\x82\x93", + "\xA8\x78" => "\xE8\x82\x9D", + "\xA8\x79" => "\xE8\x82\x98", + "\xA8\x7A" => "\xE8\x82\x9B", + "\xA8\x7B" => "\xE8\x82\x9A", + "\xA8\x7C" => "\xE8\x82\xB2", + "\xA8\x7D" => "\xE8\x89\xAF", + "\xA8\x7E" => "\xE8\x8A\x92", + "\xA8\xA1" => "\xE8\x8A\x8B", + "\xA8\xA2" => "\xE8\x8A\x8D", + "\xA8\xA3" => "\xE8\xA6\x8B", + "\xA8\xA4" => "\xE8\xA7\x92", + "\xA8\xA5" => "\xE8\xA8\x80", + "\xA8\xA6" => "\xE8\xB0\xB7", + "\xA8\xA7" => "\xE8\xB1\x86", + "\xA8\xA8" => "\xE8\xB1\x95", + "\xA8\xA9" => "\xE8\xB2\x9D", + "\xA8\xAA" => "\xE8\xB5\xA4", + "\xA8\xAB" => "\xE8\xB5\xB0", + "\xA8\xAC" => "\xE8\xB6\xB3", + "\xA8\xAD" => "\xE8\xBA\xAB", + "\xA8\xAE" => "\xE8\xBB\x8A", + "\xA8\xAF" => "\xE8\xBE\x9B", + "\xA8\xB0" => "\xE8\xBE\xB0", + "\xA8\xB1" => "\xE8\xBF\x82", + "\xA8\xB2" => "\xE8\xBF\x86", + "\xA8\xB3" => "\xE8\xBF\x85", + "\xA8\xB4" => "\xE8\xBF\x84", + "\xA8\xB5" => "\xE5\xB7\xA1", + "\xA8\xB6" => "\xE9\x82\x91", + "\xA8\xB7" => "\xE9\x82\xA2", + "\xA8\xB8" => "\xE9\x82\xAA", + "\xA8\xB9" => "\xE9\x82\xA6", + "\xA8\xBA" => "\xE9\x82\xA3", + "\xA8\xBB" => "\xE9\x85\x89", + "\xA8\xBC" => "\xE9\x87\x86", + "\xA8\xBD" => "\xE9\x87\x8C", + "\xA8\xBE" => "\xE9\x98\xB2", + "\xA8\xBF" => "\xE9\x98\xAE", + "\xA8\xC0" => "\xE9\x98\xB1", + "\xA8\xC1" => "\xE9\x98\xAA", + "\xA8\xC2" => "\xE9\x98\xAC", + "\xA8\xC3" => "\xE4\xB8\xA6", + "\xA8\xC4" => "\xE4\xB9\x96", + "\xA8\xC5" => "\xE4\xB9\xB3", + "\xA8\xC6" => "\xE4\xBA\x8B", + "\xA8\xC7" => "\xE4\xBA\x9B", + "\xA8\xC8" => "\xE4\xBA\x9E", + "\xA8\xC9" => "\xE4\xBA\xAB", + "\xA8\xCA" => "\xE4\xBA\xAC", + "\xA8\xCB" => "\xE4\xBD\xAF", + "\xA8\xCC" => "\xE4\xBE\x9D", + "\xA8\xCD" => "\xE4\xBE\x8D", + "\xA8\xCE" => "\xE4\xBD\xB3", + "\xA8\xCF" => "\xE4\xBD\xBF", + "\xA8\xD0" => "\xE4\xBD\xAC", + "\xA8\xD1" => "\xE4\xBE\x9B", + "\xA8\xD2" => "\xE4\xBE\x8B", + "\xA8\xD3" => "\xE4\xBE\x86", + "\xA8\xD4" => "\xE4\xBE\x83", + "\xA8\xD5" => "\xE4\xBD\xB0", + "\xA8\xD6" => "\xE4\xBD\xB5", + "\xA8\xD7" => "\xE4\xBE\x88", + "\xA8\xD8" => "\xE4\xBD\xA9", + "\xA8\xD9" => "\xE4\xBD\xBB", + "\xA8\xDA" => "\xE4\xBE\x96", + "\xA8\xDB" => "\xE4\xBD\xBE", + "\xA8\xDC" => "\xE4\xBE\x8F", + "\xA8\xDD" => "\xE4\xBE\x91", + "\xA8\xDE" => "\xE4\xBD\xBA", + "\xA8\xDF" => "\xE5\x85\x94", + "\xA8\xE0" => "\xE5\x85\x92", + "\xA8\xE1" => "\xE5\x85\x95", + "\xA8\xE2" => "\xE5\x85\xA9", + "\xA8\xE3" => "\xE5\x85\xB7", + "\xA8\xE4" => "\xE5\x85\xB6", + "\xA8\xE5" => "\xE5\x85\xB8", + "\xA8\xE6" => "\xE5\x86\xBD", + "\xA8\xE7" => "\xE5\x87\xBD", + "\xA8\xE8" => "\xE5\x88\xBB", + "\xA8\xE9" => "\xE5\x88\xB8", + "\xA8\xEA" => "\xE5\x88\xB7", + "\xA8\xEB" => "\xE5\x88\xBA", + "\xA8\xEC" => "\xE5\x88\xB0", + "\xA8\xED" => "\xE5\x88\xAE", + "\xA8\xEE" => "\xE5\x88\xB6", + "\xA8\xEF" => "\xE5\x89\x81", + "\xA8\xF0" => "\xE5\x8A\xBE", + "\xA8\xF1" => "\xE5\x8A\xBB", + "\xA8\xF2" => "\xE5\x8D\x92", + "\xA8\xF3" => "\xE5\x8D\x94", + "\xA8\xF4" => "\xE5\x8D\x93", + "\xA8\xF5" => "\xE5\x8D\x91", + "\xA8\xF6" => "\xE5\x8D\xA6", + "\xA8\xF7" => "\xE5\x8D\xB7", + "\xA8\xF8" => "\xE5\x8D\xB8", + "\xA8\xF9" => "\xE5\x8D\xB9", + "\xA8\xFA" => "\xE5\x8F\x96", + "\xA8\xFB" => "\xE5\x8F\x94", + "\xA8\xFC" => "\xE5\x8F\x97", + "\xA8\xFD" => "\xE5\x91\xB3", + "\xA8\xFE" => "\xE5\x91\xB5", + "\xA9\x40" => "\xE5\x92\x96", + "\xA9\x41" => "\xE5\x91\xB8", + "\xA9\x42" => "\xE5\x92\x95", + "\xA9\x43" => "\xE5\x92\x80", + "\xA9\x44" => "\xE5\x91\xBB", + "\xA9\x45" => "\xE5\x91\xB7", + "\xA9\x46" => "\xE5\x92\x84", + "\xA9\x47" => "\xE5\x92\x92", + "\xA9\x48" => "\xE5\x92\x86", + "\xA9\x49" => "\xE5\x91\xBC", + "\xA9\x4A" => "\xE5\x92\x90", + "\xA9\x4B" => "\xE5\x91\xB1", + "\xA9\x4C" => "\xE5\x91\xB6", + "\xA9\x4D" => "\xE5\x92\x8C", + "\xA9\x4E" => "\xE5\x92\x9A", + "\xA9\x4F" => "\xE5\x91\xA2", + "\xA9\x50" => "\xE5\x91\xA8", + "\xA9\x51" => "\xE5\x92\x8B", + "\xA9\x52" => "\xE5\x91\xBD", + "\xA9\x53" => "\xE5\x92\x8E", + "\xA9\x54" => "\xE5\x9B\xBA", + "\xA9\x55" => "\xE5\x9E\x83", + "\xA9\x56" => "\xE5\x9D\xB7", + "\xA9\x57" => "\xE5\x9D\xAA", + "\xA9\x58" => "\xE5\x9D\xA9", + "\xA9\x59" => "\xE5\x9D\xA1", + "\xA9\x5A" => "\xE5\x9D\xA6", + "\xA9\x5B" => "\xE5\x9D\xA4", + "\xA9\x5C" => "\xE5\x9D\xBC", + "\xA9\x5D" => "\xE5\xA4\x9C", + "\xA9\x5E" => "\xE5\xA5\x89", + "\xA9\x5F" => "\xE5\xA5\x87", + "\xA9\x60" => "\xE5\xA5\x88", + "\xA9\x61" => "\xE5\xA5\x84", + "\xA9\x62" => "\xE5\xA5\x94", + "\xA9\x63" => "\xE5\xA6\xBE", + "\xA9\x64" => "\xE5\xA6\xBB", + "\xA9\x65" => "\xE5\xA7\x94", + "\xA9\x66" => "\xE5\xA6\xB9", + "\xA9\x67" => "\xE5\xA6\xAE", + "\xA9\x68" => "\xE5\xA7\x91", + "\xA9\x69" => "\xE5\xA7\x86", + "\xA9\x6A" => "\xE5\xA7\x90", + "\xA9\x6B" => "\xE5\xA7\x8D", + "\xA9\x6C" => "\xE5\xA7\x8B", + "\xA9\x6D" => "\xE5\xA7\x93", + "\xA9\x6E" => "\xE5\xA7\x8A", + "\xA9\x6F" => "\xE5\xA6\xAF", + "\xA9\x70" => "\xE5\xA6\xB3", + "\xA9\x71" => "\xE5\xA7\x92", + "\xA9\x72" => "\xE5\xA7\x85", + "\xA9\x73" => "\xE5\xAD\x9F", + "\xA9\x74" => "\xE5\xAD\xA4", + "\xA9\x75" => "\xE5\xAD\xA3", + "\xA9\x76" => "\xE5\xAE\x97", + "\xA9\x77" => "\xE5\xAE\x9A", + "\xA9\x78" => "\xE5\xAE\x98", + "\xA9\x79" => "\xE5\xAE\x9C", + "\xA9\x7A" => "\xE5\xAE\x99", + "\xA9\x7B" => "\xE5\xAE\x9B", + "\xA9\x7C" => "\xE5\xB0\x9A", + "\xA9\x7D" => "\xE5\xB1\x88", + "\xA9\x7E" => "\xE5\xB1\x85", + "\xA9\xA1" => "\xE5\xB1\x86", + "\xA9\xA2" => "\xE5\xB2\xB7", + "\xA9\xA3" => "\xE5\xB2\xA1", + "\xA9\xA4" => "\xE5\xB2\xB8", + "\xA9\xA5" => "\xE5\xB2\xA9", + "\xA9\xA6" => "\xE5\xB2\xAB", + "\xA9\xA7" => "\xE5\xB2\xB1", + "\xA9\xA8" => "\xE5\xB2\xB3", + "\xA9\xA9" => "\xE5\xB8\x98", + "\xA9\xAA" => "\xE5\xB8\x9A", + "\xA9\xAB" => "\xE5\xB8\x96", + "\xA9\xAC" => "\xE5\xB8\x95", + "\xA9\xAD" => "\xE5\xB8\x9B", + "\xA9\xAE" => "\xE5\xB8\x91", + "\xA9\xAF" => "\xE5\xB9\xB8", + "\xA9\xB0" => "\xE5\xBA\x9A", + "\xA9\xB1" => "\xE5\xBA\x97", + "\xA9\xB2" => "\xE5\xBA\x9C", + "\xA9\xB3" => "\xE5\xBA\x95", + "\xA9\xB4" => "\xE5\xBA\x96", + "\xA9\xB5" => "\xE5\xBB\xB6", + "\xA9\xB6" => "\xE5\xBC\xA6", + "\xA9\xB7" => "\xE5\xBC\xA7", + "\xA9\xB8" => "\xE5\xBC\xA9", + "\xA9\xB9" => "\xE5\xBE\x80", + "\xA9\xBA" => "\xE5\xBE\x81", + "\xA9\xBB" => "\xE5\xBD\xBF", + "\xA9\xBC" => "\xE5\xBD\xBC", + "\xA9\xBD" => "\xE5\xBF\x9D", + "\xA9\xBE" => "\xE5\xBF\xA0", + "\xA9\xBF" => "\xE5\xBF\xBD", + "\xA9\xC0" => "\xE5\xBF\xB5", + "\xA9\xC1" => "\xE5\xBF\xBF", + "\xA9\xC2" => "\xE6\x80\x8F", + "\xA9\xC3" => "\xE6\x80\x94", + "\xA9\xC4" => "\xE6\x80\xAF", + "\xA9\xC5" => "\xE6\x80\xB5", + "\xA9\xC6" => "\xE6\x80\x96", + "\xA9\xC7" => "\xE6\x80\xAA", + "\xA9\xC8" => "\xE6\x80\x95", + "\xA9\xC9" => "\xE6\x80\xA1", + "\xA9\xCA" => "\xE6\x80\xA7", + "\xA9\xCB" => "\xE6\x80\xA9", + "\xA9\xCC" => "\xE6\x80\xAB", + "\xA9\xCD" => "\xE6\x80\x9B", + "\xA9\xCE" => "\xE6\x88\x96", + "\xA9\xCF" => "\xE6\x88\x95", + "\xA9\xD0" => "\xE6\x88\xBF", + "\xA9\xD1" => "\xE6\x88\xBE", + "\xA9\xD2" => "\xE6\x89\x80", + "\xA9\xD3" => "\xE6\x89\xBF", + "\xA9\xD4" => "\xE6\x8B\x89", + "\xA9\xD5" => "\xE6\x8B\x8C", + "\xA9\xD6" => "\xE6\x8B\x84", + "\xA9\xD7" => "\xE6\x8A\xBF", + "\xA9\xD8" => "\xE6\x8B\x82", + "\xA9\xD9" => "\xE6\x8A\xB9", + "\xA9\xDA" => "\xE6\x8B\x92", + "\xA9\xDB" => "\xE6\x8B\x9B", + "\xA9\xDC" => "\xE6\x8A\xAB", + "\xA9\xDD" => "\xE6\x8B\x93", + "\xA9\xDE" => "\xE6\x8B\x94", + "\xA9\xDF" => "\xE6\x8B\x8B", + "\xA9\xE0" => "\xE6\x8B\x88", + "\xA9\xE1" => "\xE6\x8A\xA8", + "\xA9\xE2" => "\xE6\x8A\xBD", + "\xA9\xE3" => "\xE6\x8A\xBC", + "\xA9\xE4" => "\xE6\x8B\x90", + "\xA9\xE5" => "\xE6\x8B\x99", + "\xA9\xE6" => "\xE6\x8B\x87", + "\xA9\xE7" => "\xE6\x8B\x8D", + "\xA9\xE8" => "\xE6\x8A\xB5", + "\xA9\xE9" => "\xE6\x8B\x9A", + "\xA9\xEA" => "\xE6\x8A\xB1", + "\xA9\xEB" => "\xE6\x8B\x98", + "\xA9\xEC" => "\xE6\x8B\x96", + "\xA9\xED" => "\xE6\x8B\x97", + "\xA9\xEE" => "\xE6\x8B\x86", + "\xA9\xEF" => "\xE6\x8A\xAC", + "\xA9\xF0" => "\xE6\x8B\x8E", + "\xA9\xF1" => "\xE6\x94\xBE", + "\xA9\xF2" => "\xE6\x96\xA7", + "\xA9\xF3" => "\xE6\x96\xBC", + "\xA9\xF4" => "\xE6\x97\xBA", + "\xA9\xF5" => "\xE6\x98\x94", + "\xA9\xF6" => "\xE6\x98\x93", + "\xA9\xF7" => "\xE6\x98\x8C", + "\xA9\xF8" => "\xE6\x98\x86", + "\xA9\xF9" => "\xE6\x98\x82", + "\xA9\xFA" => "\xE6\x98\x8E", + "\xA9\xFB" => "\xE6\x98\x80", + "\xA9\xFC" => "\xE6\x98\x8F", + "\xA9\xFD" => "\xE6\x98\x95", + "\xA9\xFE" => "\xE6\x98\x8A", + "\xAA\x40" => "\xE6\x98\x87", + "\xAA\x41" => "\xE6\x9C\x8D", + "\xAA\x42" => "\xE6\x9C\x8B", + "\xAA\x43" => "\xE6\x9D\xAD", + "\xAA\x44" => "\xE6\x9E\x8B", + "\xAA\x45" => "\xE6\x9E\x95", + "\xAA\x46" => "\xE6\x9D\xB1", + "\xAA\x47" => "\xE6\x9E\x9C", + "\xAA\x48" => "\xE6\x9D\xB3", + "\xAA\x49" => "\xE6\x9D\xB7", + "\xAA\x4A" => "\xE6\x9E\x87", + "\xAA\x4B" => "\xE6\x9E\x9D", + "\xAA\x4C" => "\xE6\x9E\x97", + "\xAA\x4D" => "\xE6\x9D\xAF", + "\xAA\x4E" => "\xE6\x9D\xB0", + "\xAA\x4F" => "\xE6\x9D\xBF", + "\xAA\x50" => "\xE6\x9E\x89", + "\xAA\x51" => "\xE6\x9D\xBE", + "\xAA\x52" => "\xE6\x9E\x90", + "\xAA\x53" => "\xE6\x9D\xB5", + "\xAA\x54" => "\xE6\x9E\x9A", + "\xAA\x55" => "\xE6\x9E\x93", + "\xAA\x56" => "\xE6\x9D\xBC", + "\xAA\x57" => "\xE6\x9D\xAA", + "\xAA\x58" => "\xE6\x9D\xB2", + "\xAA\x59" => "\xE6\xAC\xA3", + "\xAA\x5A" => "\xE6\xAD\xA6", + "\xAA\x5B" => "\xE6\xAD\xA7", + "\xAA\x5C" => "\xE6\xAD\xBF", + "\xAA\x5D" => "\xE6\xB0\x93", + "\xAA\x5E" => "\xE6\xB0\x9B", + "\xAA\x5F" => "\xE6\xB3\xA3", + "\xAA\x60" => "\xE6\xB3\xA8", + "\xAA\x61" => "\xE6\xB3\xB3", + "\xAA\x62" => "\xE6\xB2\xB1", + "\xAA\x63" => "\xE6\xB3\x8C", + "\xAA\x64" => "\xE6\xB3\xA5", + "\xAA\x65" => "\xE6\xB2\xB3", + "\xAA\x66" => "\xE6\xB2\xBD", + "\xAA\x67" => "\xE6\xB2\xBE", + "\xAA\x68" => "\xE6\xB2\xBC", + "\xAA\x69" => "\xE6\xB3\xA2", + "\xAA\x6A" => "\xE6\xB2\xAB", + "\xAA\x6B" => "\xE6\xB3\x95", + "\xAA\x6C" => "\xE6\xB3\x93", + "\xAA\x6D" => "\xE6\xB2\xB8", + "\xAA\x6E" => "\xE6\xB3\x84", + "\xAA\x6F" => "\xE6\xB2\xB9", + "\xAA\x70" => "\xE6\xB3\x81", + "\xAA\x71" => "\xE6\xB2\xAE", + "\xAA\x72" => "\xE6\xB3\x97", + "\xAA\x73" => "\xE6\xB3\x85", + "\xAA\x74" => "\xE6\xB3\xB1", + "\xAA\x75" => "\xE6\xB2\xBF", + "\xAA\x76" => "\xE6\xB2\xBB", + "\xAA\x77" => "\xE6\xB3\xA1", + "\xAA\x78" => "\xE6\xB3\x9B", + "\xAA\x79" => "\xE6\xB3\x8A", + "\xAA\x7A" => "\xE6\xB2\xAC", + "\xAA\x7B" => "\xE6\xB3\xAF", + "\xAA\x7C" => "\xE6\xB3\x9C", + "\xAA\x7D" => "\xE6\xB3\x96", + "\xAA\x7E" => "\xE6\xB3\xA0", + "\xAA\xA1" => "\xE7\x82\x95", + "\xAA\xA2" => "\xE7\x82\x8E", + "\xAA\xA3" => "\xE7\x82\x92", + "\xAA\xA4" => "\xE7\x82\x8A", + "\xAA\xA5" => "\xE7\x82\x99", + "\xAA\xA6" => "\xE7\x88\xAC", + "\xAA\xA7" => "\xE7\x88\xAD", + "\xAA\xA8" => "\xE7\x88\xB8", + "\xAA\xA9" => "\xE7\x89\x88", + "\xAA\xAA" => "\xE7\x89\xA7", + "\xAA\xAB" => "\xE7\x89\xA9", + "\xAA\xAC" => "\xE7\x8B\x80", + "\xAA\xAD" => "\xE7\x8B\x8E", + "\xAA\xAE" => "\xE7\x8B\x99", + "\xAA\xAF" => "\xE7\x8B\x97", + "\xAA\xB0" => "\xE7\x8B\x90", + "\xAA\xB1" => "\xE7\x8E\xA9", + "\xAA\xB2" => "\xE7\x8E\xA8", + "\xAA\xB3" => "\xE7\x8E\x9F", + "\xAA\xB4" => "\xE7\x8E\xAB", + "\xAA\xB5" => "\xE7\x8E\xA5", + "\xAA\xB6" => "\xE7\x94\xBD", + "\xAA\xB7" => "\xE7\x96\x9D", + "\xAA\xB8" => "\xE7\x96\x99", + "\xAA\xB9" => "\xE7\x96\x9A", + "\xAA\xBA" => "\xE7\x9A\x84", + "\xAA\xBB" => "\xE7\x9B\x82", + "\xAA\xBC" => "\xE7\x9B\xB2", + "\xAA\xBD" => "\xE7\x9B\xB4", + "\xAA\xBE" => "\xE7\x9F\xA5", + "\xAA\xBF" => "\xE7\x9F\xBD", + "\xAA\xC0" => "\xE7\xA4\xBE", + "\xAA\xC1" => "\xE7\xA5\x80", + "\xAA\xC2" => "\xE7\xA5\x81", + "\xAA\xC3" => "\xE7\xA7\x89", + "\xAA\xC4" => "\xE7\xA7\x88", + "\xAA\xC5" => "\xE7\xA9\xBA", + "\xAA\xC6" => "\xE7\xA9\xB9", + "\xAA\xC7" => "\xE7\xAB\xBA", + "\xAA\xC8" => "\xE7\xB3\xBE", + "\xAA\xC9" => "\xE7\xBD\x94", + "\xAA\xCA" => "\xE7\xBE\x8C", + "\xAA\xCB" => "\xE7\xBE\x8B", + "\xAA\xCC" => "\xE8\x80\x85", + "\xAA\xCD" => "\xE8\x82\xBA", + "\xAA\xCE" => "\xE8\x82\xA5", + "\xAA\xCF" => "\xE8\x82\xA2", + "\xAA\xD0" => "\xE8\x82\xB1", + "\xAA\xD1" => "\xE8\x82\xA1", + "\xAA\xD2" => "\xE8\x82\xAB", + "\xAA\xD3" => "\xE8\x82\xA9", + "\xAA\xD4" => "\xE8\x82\xB4", + "\xAA\xD5" => "\xE8\x82\xAA", + "\xAA\xD6" => "\xE8\x82\xAF", + "\xAA\xD7" => "\xE8\x87\xA5", + "\xAA\xD8" => "\xE8\x87\xBE", + "\xAA\xD9" => "\xE8\x88\x8D", + "\xAA\xDA" => "\xE8\x8A\xB3", + "\xAA\xDB" => "\xE8\x8A\x9D", + "\xAA\xDC" => "\xE8\x8A\x99", + "\xAA\xDD" => "\xE8\x8A\xAD", + "\xAA\xDE" => "\xE8\x8A\xBD", + "\xAA\xDF" => "\xE8\x8A\x9F", + "\xAA\xE0" => "\xE8\x8A\xB9", + "\xAA\xE1" => "\xE8\x8A\xB1", + "\xAA\xE2" => "\xE8\x8A\xAC", + "\xAA\xE3" => "\xE8\x8A\xA5", + "\xAA\xE4" => "\xE8\x8A\xAF", + "\xAA\xE5" => "\xE8\x8A\xB8", + "\xAA\xE6" => "\xE8\x8A\xA3", + "\xAA\xE7" => "\xE8\x8A\xB0", + "\xAA\xE8" => "\xE8\x8A\xBE", + "\xAA\xE9" => "\xE8\x8A\xB7", + "\xAA\xEA" => "\xE8\x99\x8E", + "\xAA\xEB" => "\xE8\x99\xB1", + "\xAA\xEC" => "\xE5\x88\x9D", + "\xAA\xED" => "\xE8\xA1\xA8", + "\xAA\xEE" => "\xE8\xBB\x8B", + "\xAA\xEF" => "\xE8\xBF\x8E", + "\xAA\xF0" => "\xE8\xBF\x94", + "\xAA\xF1" => "\xE8\xBF\x91", + "\xAA\xF2" => "\xE9\x82\xB5", + "\xAA\xF3" => "\xE9\x82\xB8", + "\xAA\xF4" => "\xE9\x82\xB1", + "\xAA\xF5" => "\xE9\x82\xB6", + "\xAA\xF6" => "\xE9\x87\x87", + "\xAA\xF7" => "\xE9\x87\x91", + "\xAA\xF8" => "\xE9\x95\xB7", + "\xAA\xF9" => "\xE9\x96\x80", + "\xAA\xFA" => "\xE9\x98\x9C", + "\xAA\xFB" => "\xE9\x99\x80", + "\xAA\xFC" => "\xE9\x98\xBF", + "\xAA\xFD" => "\xE9\x98\xBB", + "\xAA\xFE" => "\xE9\x99\x84", + "\xAB\x40" => "\xE9\x99\x82", + "\xAB\x41" => "\xE9\x9A\xB9", + "\xAB\x42" => "\xE9\x9B\xA8", + "\xAB\x43" => "\xE9\x9D\x92", + "\xAB\x44" => "\xE9\x9D\x9E", + "\xAB\x45" => "\xE4\xBA\x9F", + "\xAB\x46" => "\xE4\xBA\xAD", + "\xAB\x47" => "\xE4\xBA\xAE", + "\xAB\x48" => "\xE4\xBF\xA1", + "\xAB\x49" => "\xE4\xBE\xB5", + "\xAB\x4A" => "\xE4\xBE\xAF", + "\xAB\x4B" => "\xE4\xBE\xBF", + "\xAB\x4C" => "\xE4\xBF\xA0", + "\xAB\x4D" => "\xE4\xBF\x91", + "\xAB\x4E" => "\xE4\xBF\x8F", + "\xAB\x4F" => "\xE4\xBF\x9D", + "\xAB\x50" => "\xE4\xBF\x83", + "\xAB\x51" => "\xE4\xBE\xB6", + "\xAB\x52" => "\xE4\xBF\x98", + "\xAB\x53" => "\xE4\xBF\x9F", + "\xAB\x54" => "\xE4\xBF\x8A", + "\xAB\x55" => "\xE4\xBF\x97", + "\xAB\x56" => "\xE4\xBE\xAE", + "\xAB\x57" => "\xE4\xBF\x90", + "\xAB\x58" => "\xE4\xBF\x84", + "\xAB\x59" => "\xE4\xBF\x82", + "\xAB\x5A" => "\xE4\xBF\x9A", + "\xAB\x5B" => "\xE4\xBF\x8E", + "\xAB\x5C" => "\xE4\xBF\x9E", + "\xAB\x5D" => "\xE4\xBE\xB7", + "\xAB\x5E" => "\xE5\x85\x97", + "\xAB\x5F" => "\xE5\x86\x92", + "\xAB\x60" => "\xE5\x86\x91", + "\xAB\x61" => "\xE5\x86\xA0", + "\xAB\x62" => "\xE5\x89\x8E", + "\xAB\x63" => "\xE5\x89\x83", + "\xAB\x64" => "\xE5\x89\x8A", + "\xAB\x65" => "\xE5\x89\x8D", + "\xAB\x66" => "\xE5\x89\x8C", + "\xAB\x67" => "\xE5\x89\x8B", + "\xAB\x68" => "\xE5\x89\x87", + "\xAB\x69" => "\xE5\x8B\x87", + "\xAB\x6A" => "\xE5\x8B\x89", + "\xAB\x6B" => "\xE5\x8B\x83", + "\xAB\x6C" => "\xE5\x8B\x81", + "\xAB\x6D" => "\xE5\x8C\x8D", + "\xAB\x6E" => "\xE5\x8D\x97", + "\xAB\x6F" => "\xE5\x8D\xBB", + "\xAB\x70" => "\xE5\x8E\x9A", + "\xAB\x71" => "\xE5\x8F\x9B", + "\xAB\x72" => "\xE5\x92\xAC", + "\xAB\x73" => "\xE5\x93\x80", + "\xAB\x74" => "\xE5\x92\xA8", + "\xAB\x75" => "\xE5\x93\x8E", + "\xAB\x76" => "\xE5\x93\x89", + "\xAB\x77" => "\xE5\x92\xB8", + "\xAB\x78" => "\xE5\x92\xA6", + "\xAB\x79" => "\xE5\x92\xB3", + "\xAB\x7A" => "\xE5\x93\x87", + "\xAB\x7B" => "\xE5\x93\x82", + "\xAB\x7C" => "\xE5\x92\xBD", + "\xAB\x7D" => "\xE5\x92\xAA", + "\xAB\x7E" => "\xE5\x93\x81", + "\xAB\xA1" => "\xE5\x93\x84", + "\xAB\xA2" => "\xE5\x93\x88", + "\xAB\xA3" => "\xE5\x92\xAF", + "\xAB\xA4" => "\xE5\x92\xAB", + "\xAB\xA5" => "\xE5\x92\xB1", + "\xAB\xA6" => "\xE5\x92\xBB", + "\xAB\xA7" => "\xE5\x92\xA9", + "\xAB\xA8" => "\xE5\x92\xA7", + "\xAB\xA9" => "\xE5\x92\xBF", + "\xAB\xAA" => "\xE5\x9B\xBF", + "\xAB\xAB" => "\xE5\x9E\x82", + "\xAB\xAC" => "\xE5\x9E\x8B", + "\xAB\xAD" => "\xE5\x9E\xA0", + "\xAB\xAE" => "\xE5\x9E\xA3", + "\xAB\xAF" => "\xE5\x9E\xA2", + "\xAB\xB0" => "\xE5\x9F\x8E", + "\xAB\xB1" => "\xE5\x9E\xAE", + "\xAB\xB2" => "\xE5\x9E\x93", + "\xAB\xB3" => "\xE5\xA5\x95", + "\xAB\xB4" => "\xE5\xA5\x91", + "\xAB\xB5" => "\xE5\xA5\x8F", + "\xAB\xB6" => "\xE5\xA5\x8E", + "\xAB\xB7" => "\xE5\xA5\x90", + "\xAB\xB8" => "\xE5\xA7\x9C", + "\xAB\xB9" => "\xE5\xA7\x98", + "\xAB\xBA" => "\xE5\xA7\xBF", + "\xAB\xBB" => "\xE5\xA7\xA3", + "\xAB\xBC" => "\xE5\xA7\xA8", + "\xAB\xBD" => "\xE5\xA8\x83", + "\xAB\xBE" => "\xE5\xA7\xA5", + "\xAB\xBF" => "\xE5\xA7\xAA", + "\xAB\xC0" => "\xE5\xA7\x9A", + "\xAB\xC1" => "\xE5\xA7\xA6", + "\xAB\xC2" => "\xE5\xA8\x81", + "\xAB\xC3" => "\xE5\xA7\xBB", + "\xAB\xC4" => "\xE5\xAD\xA9", + "\xAB\xC5" => "\xE5\xAE\xA3", + "\xAB\xC6" => "\xE5\xAE\xA6", + "\xAB\xC7" => "\xE5\xAE\xA4", + "\xAB\xC8" => "\xE5\xAE\xA2", + "\xAB\xC9" => "\xE5\xAE\xA5", + "\xAB\xCA" => "\xE5\xB0\x81", + "\xAB\xCB" => "\xE5\xB1\x8E", + "\xAB\xCC" => "\xE5\xB1\x8F", + "\xAB\xCD" => "\xE5\xB1\x8D", + "\xAB\xCE" => "\xE5\xB1\x8B", + "\xAB\xCF" => "\xE5\xB3\x99", + "\xAB\xD0" => "\xE5\xB3\x92", + "\xAB\xD1" => "\xE5\xB7\xB7", + "\xAB\xD2" => "\xE5\xB8\x9D", + "\xAB\xD3" => "\xE5\xB8\xA5", + "\xAB\xD4" => "\xE5\xB8\x9F", + "\xAB\xD5" => "\xE5\xB9\xBD", + "\xAB\xD6" => "\xE5\xBA\xA0", + "\xAB\xD7" => "\xE5\xBA\xA6", + "\xAB\xD8" => "\xE5\xBB\xBA", + "\xAB\xD9" => "\xE5\xBC\x88", + "\xAB\xDA" => "\xE5\xBC\xAD", + "\xAB\xDB" => "\xE5\xBD\xA5", + "\xAB\xDC" => "\xE5\xBE\x88", + "\xAB\xDD" => "\xE5\xBE\x85", + "\xAB\xDE" => "\xE5\xBE\x8A", + "\xAB\xDF" => "\xE5\xBE\x8B", + "\xAB\xE0" => "\xE5\xBE\x87", + "\xAB\xE1" => "\xE5\xBE\x8C", + "\xAB\xE2" => "\xE5\xBE\x89", + "\xAB\xE3" => "\xE6\x80\x92", + "\xAB\xE4" => "\xE6\x80\x9D", + "\xAB\xE5" => "\xE6\x80\xA0", + "\xAB\xE6" => "\xE6\x80\xA5", + "\xAB\xE7" => "\xE6\x80\x8E", + "\xAB\xE8" => "\xE6\x80\xA8", + "\xAB\xE9" => "\xE6\x81\x8D", + "\xAB\xEA" => "\xE6\x81\xB0", + "\xAB\xEB" => "\xE6\x81\xA8", + "\xAB\xEC" => "\xE6\x81\xA2", + "\xAB\xED" => "\xE6\x81\x86", + "\xAB\xEE" => "\xE6\x81\x83", + "\xAB\xEF" => "\xE6\x81\xAC", + "\xAB\xF0" => "\xE6\x81\xAB", + "\xAB\xF1" => "\xE6\x81\xAA", + "\xAB\xF2" => "\xE6\x81\xA4", + "\xAB\xF3" => "\xE6\x89\x81", + "\xAB\xF4" => "\xE6\x8B\x9C", + "\xAB\xF5" => "\xE6\x8C\x96", + "\xAB\xF6" => "\xE6\x8C\x89", + "\xAB\xF7" => "\xE6\x8B\xBC", + "\xAB\xF8" => "\xE6\x8B\xAD", + "\xAB\xF9" => "\xE6\x8C\x81", + "\xAB\xFA" => "\xE6\x8B\xAE", + "\xAB\xFB" => "\xE6\x8B\xBD", + "\xAB\xFC" => "\xE6\x8C\x87", + "\xAB\xFD" => "\xE6\x8B\xB1", + "\xAB\xFE" => "\xE6\x8B\xB7", + "\xAC\x40" => "\xE6\x8B\xAF", + "\xAC\x41" => "\xE6\x8B\xAC", + "\xAC\x42" => "\xE6\x8B\xBE", + "\xAC\x43" => "\xE6\x8B\xB4", + "\xAC\x44" => "\xE6\x8C\x91", + "\xAC\x45" => "\xE6\x8C\x82", + "\xAC\x46" => "\xE6\x94\xBF", + "\xAC\x47" => "\xE6\x95\x85", + "\xAC\x48" => "\xE6\x96\xAB", + "\xAC\x49" => "\xE6\x96\xBD", + "\xAC\x4A" => "\xE6\x97\xA2", + "\xAC\x4B" => "\xE6\x98\xA5", + "\xAC\x4C" => "\xE6\x98\xAD", + "\xAC\x4D" => "\xE6\x98\xA0", + "\xAC\x4E" => "\xE6\x98\xA7", + "\xAC\x4F" => "\xE6\x98\xAF", + "\xAC\x50" => "\xE6\x98\x9F", + "\xAC\x51" => "\xE6\x98\xA8", + "\xAC\x52" => "\xE6\x98\xB1", + "\xAC\x53" => "\xE6\x98\xA4", + "\xAC\x54" => "\xE6\x9B\xB7", + "\xAC\x55" => "\xE6\x9F\xBF", + "\xAC\x56" => "\xE6\x9F\x93", + "\xAC\x57" => "\xE6\x9F\xB1", + "\xAC\x58" => "\xE6\x9F\x94", + "\xAC\x59" => "\xE6\x9F\x90", + "\xAC\x5A" => "\xE6\x9F\xAC", + "\xAC\x5B" => "\xE6\x9E\xB6", + "\xAC\x5C" => "\xE6\x9E\xAF", + "\xAC\x5D" => "\xE6\x9F\xB5", + "\xAC\x5E" => "\xE6\x9F\xA9", + "\xAC\x5F" => "\xE6\x9F\xAF", + "\xAC\x60" => "\xE6\x9F\x84", + "\xAC\x61" => "\xE6\x9F\x91", + "\xAC\x62" => "\xE6\x9E\xB4", + "\xAC\x63" => "\xE6\x9F\x9A", + "\xAC\x64" => "\xE6\x9F\xA5", + "\xAC\x65" => "\xE6\x9E\xB8", + "\xAC\x66" => "\xE6\x9F\x8F", + "\xAC\x67" => "\xE6\x9F\x9E", + "\xAC\x68" => "\xE6\x9F\xB3", + "\xAC\x69" => "\xE6\x9E\xB0", + "\xAC\x6A" => "\xE6\x9F\x99", + "\xAC\x6B" => "\xE6\x9F\xA2", + "\xAC\x6C" => "\xE6\x9F\x9D", + "\xAC\x6D" => "\xE6\x9F\x92", + "\xAC\x6E" => "\xE6\xAD\xAA", + "\xAC\x6F" => "\xE6\xAE\x83", + "\xAC\x70" => "\xE6\xAE\x86", + "\xAC\x71" => "\xE6\xAE\xB5", + "\xAC\x72" => "\xE6\xAF\x92", + "\xAC\x73" => "\xE6\xAF\x97", + "\xAC\x74" => "\xE6\xB0\x9F", + "\xAC\x75" => "\xE6\xB3\x89", + "\xAC\x76" => "\xE6\xB4\x8B", + "\xAC\x77" => "\xE6\xB4\xB2", + "\xAC\x78" => "\xE6\xB4\xAA", + "\xAC\x79" => "\xE6\xB5\x81", + "\xAC\x7A" => "\xE6\xB4\xA5", + "\xAC\x7B" => "\xE6\xB4\x8C", + "\xAC\x7C" => "\xE6\xB4\xB1", + "\xAC\x7D" => "\xE6\xB4\x9E", + "\xAC\x7E" => "\xE6\xB4\x97", + "\xAC\xA1" => "\xE6\xB4\xBB", + "\xAC\xA2" => "\xE6\xB4\xBD", + "\xAC\xA3" => "\xE6\xB4\xBE", + "\xAC\xA4" => "\xE6\xB4\xB6", + "\xAC\xA5" => "\xE6\xB4\x9B", + "\xAC\xA6" => "\xE6\xB3\xB5", + "\xAC\xA7" => "\xE6\xB4\xB9", + "\xAC\xA8" => "\xE6\xB4\xA7", + "\xAC\xA9" => "\xE6\xB4\xB8", + "\xAC\xAA" => "\xE6\xB4\xA9", + "\xAC\xAB" => "\xE6\xB4\xAE", + "\xAC\xAC" => "\xE6\xB4\xB5", + "\xAC\xAD" => "\xE6\xB4\x8E", + "\xAC\xAE" => "\xE6\xB4\xAB", + "\xAC\xAF" => "\xE7\x82\xAB", + "\xAC\xB0" => "\xE7\x82\xBA", + "\xAC\xB1" => "\xE7\x82\xB3", + "\xAC\xB2" => "\xE7\x82\xAC", + "\xAC\xB3" => "\xE7\x82\xAF", + "\xAC\xB4" => "\xE7\x82\xAD", + "\xAC\xB5" => "\xE7\x82\xB8", + "\xAC\xB6" => "\xE7\x82\xAE", + "\xAC\xB7" => "\xE7\x82\xA4", + "\xAC\xB8" => "\xE7\x88\xB0", + "\xAC\xB9" => "\xE7\x89\xB2", + "\xAC\xBA" => "\xE7\x89\xAF", + "\xAC\xBB" => "\xE7\x89\xB4", + "\xAC\xBC" => "\xE7\x8B\xA9", + "\xAC\xBD" => "\xE7\x8B\xA0", + "\xAC\xBE" => "\xE7\x8B\xA1", + "\xAC\xBF" => "\xE7\x8E\xB7", + "\xAC\xC0" => "\xE7\x8F\x8A", + "\xAC\xC1" => "\xE7\x8E\xBB", + "\xAC\xC2" => "\xE7\x8E\xB2", + "\xAC\xC3" => "\xE7\x8F\x8D", + "\xAC\xC4" => "\xE7\x8F\x80", + "\xAC\xC5" => "\xE7\x8E\xB3", + "\xAC\xC6" => "\xE7\x94\x9A", + "\xAC\xC7" => "\xE7\x94\xAD", + "\xAC\xC8" => "\xE7\x95\x8F", + "\xAC\xC9" => "\xE7\x95\x8C", + "\xAC\xCA" => "\xE7\x95\x8E", + "\xAC\xCB" => "\xE7\x95\x8B", + "\xAC\xCC" => "\xE7\x96\xAB", + "\xAC\xCD" => "\xE7\x96\xA4", + "\xAC\xCE" => "\xE7\x96\xA5", + "\xAC\xCF" => "\xE7\x96\xA2", + "\xAC\xD0" => "\xE7\x96\xA3", + "\xAC\xD1" => "\xE7\x99\xB8", + "\xAC\xD2" => "\xE7\x9A\x86", + "\xAC\xD3" => "\xE7\x9A\x87", + "\xAC\xD4" => "\xE7\x9A\x88", + "\xAC\xD5" => "\xE7\x9B\x88", + "\xAC\xD6" => "\xE7\x9B\x86", + "\xAC\xD7" => "\xE7\x9B\x83", + "\xAC\xD8" => "\xE7\x9B\x85", + "\xAC\xD9" => "\xE7\x9C\x81", + "\xAC\xDA" => "\xE7\x9B\xB9", + "\xAC\xDB" => "\xE7\x9B\xB8", + "\xAC\xDC" => "\xE7\x9C\x89", + "\xAC\xDD" => "\xE7\x9C\x8B", + "\xAC\xDE" => "\xE7\x9B\xBE", + "\xAC\xDF" => "\xE7\x9B\xBC", + "\xAC\xE0" => "\xE7\x9C\x87", + "\xAC\xE1" => "\xE7\x9F\x9C", + "\xAC\xE2" => "\xE7\xA0\x82", + "\xAC\xE3" => "\xE7\xA0\x94", + "\xAC\xE4" => "\xE7\xA0\x8C", + "\xAC\xE5" => "\xE7\xA0\x8D", + "\xAC\xE6" => "\xE7\xA5\x86", + "\xAC\xE7" => "\xE7\xA5\x89", + "\xAC\xE8" => "\xE7\xA5\x88", + "\xAC\xE9" => "\xE7\xA5\x87", + "\xAC\xEA" => "\xE7\xA6\xB9", + "\xAC\xEB" => "\xE7\xA6\xBA", + "\xAC\xEC" => "\xE7\xA7\x91", + "\xAC\xED" => "\xE7\xA7\x92", + "\xAC\xEE" => "\xE7\xA7\x8B", + "\xAC\xEF" => "\xE7\xA9\xBF", + "\xAC\xF0" => "\xE7\xAA\x81", + "\xAC\xF1" => "\xE7\xAB\xBF", + "\xAC\xF2" => "\xE7\xAB\xBD", + "\xAC\xF3" => "\xE7\xB1\xBD", + "\xAC\xF4" => "\xE7\xB4\x82", + "\xAC\xF5" => "\xE7\xB4\x85", + "\xAC\xF6" => "\xE7\xB4\x80", + "\xAC\xF7" => "\xE7\xB4\x89", + "\xAC\xF8" => "\xE7\xB4\x87", + "\xAC\xF9" => "\xE7\xB4\x84", + "\xAC\xFA" => "\xE7\xB4\x86", + "\xAC\xFB" => "\xE7\xBC\xB8", + "\xAC\xFC" => "\xE7\xBE\x8E", + "\xAC\xFD" => "\xE7\xBE\xBF", + "\xAC\xFE" => "\xE8\x80\x84", + "\xAD\x40" => "\xE8\x80\x90", + "\xAD\x41" => "\xE8\x80\x8D", + "\xAD\x42" => "\xE8\x80\x91", + "\xAD\x43" => "\xE8\x80\xB6", + "\xAD\x44" => "\xE8\x83\x96", + "\xAD\x45" => "\xE8\x83\xA5", + "\xAD\x46" => "\xE8\x83\x9A", + "\xAD\x47" => "\xE8\x83\x83", + "\xAD\x48" => "\xE8\x83\x84", + "\xAD\x49" => "\xE8\x83\x8C", + "\xAD\x4A" => "\xE8\x83\xA1", + "\xAD\x4B" => "\xE8\x83\x9B", + "\xAD\x4C" => "\xE8\x83\x8E", + "\xAD\x4D" => "\xE8\x83\x9E", + "\xAD\x4E" => "\xE8\x83\xA4", + "\xAD\x4F" => "\xE8\x83\x9D", + "\xAD\x50" => "\xE8\x87\xB4", + "\xAD\x51" => "\xE8\x88\xA2", + "\xAD\x52" => "\xE8\x8B\xA7", + "\xAD\x53" => "\xE8\x8C\x83", + "\xAD\x54" => "\xE8\x8C\x85", + "\xAD\x55" => "\xE8\x8B\xA3", + "\xAD\x56" => "\xE8\x8B\x9B", + "\xAD\x57" => "\xE8\x8B\xA6", + "\xAD\x58" => "\xE8\x8C\x84", + "\xAD\x59" => "\xE8\x8B\xA5", + "\xAD\x5A" => "\xE8\x8C\x82", + "\xAD\x5B" => "\xE8\x8C\x89", + "\xAD\x5C" => "\xE8\x8B\x92", + "\xAD\x5D" => "\xE8\x8B\x97", + "\xAD\x5E" => "\xE8\x8B\xB1", + "\xAD\x5F" => "\xE8\x8C\x81", + "\xAD\x60" => "\xE8\x8B\x9C", + "\xAD\x61" => "\xE8\x8B\x94", + "\xAD\x62" => "\xE8\x8B\x91", + "\xAD\x63" => "\xE8\x8B\x9E", + "\xAD\x64" => "\xE8\x8B\x93", + "\xAD\x65" => "\xE8\x8B\x9F", + "\xAD\x66" => "\xE8\x8B\xAF", + "\xAD\x67" => "\xE8\x8C\x86", + "\xAD\x68" => "\xE8\x99\x90", + "\xAD\x69" => "\xE8\x99\xB9", + "\xAD\x6A" => "\xE8\x99\xBB", + "\xAD\x6B" => "\xE8\x99\xBA", + "\xAD\x6C" => "\xE8\xA1\x8D", + "\xAD\x6D" => "\xE8\xA1\xAB", + "\xAD\x6E" => "\xE8\xA6\x81", + "\xAD\x6F" => "\xE8\xA7\x94", + "\xAD\x70" => "\xE8\xA8\x88", + "\xAD\x71" => "\xE8\xA8\x82", + "\xAD\x72" => "\xE8\xA8\x83", + "\xAD\x73" => "\xE8\xB2\x9E", + "\xAD\x74" => "\xE8\xB2\xA0", + "\xAD\x75" => "\xE8\xB5\xB4", + "\xAD\x76" => "\xE8\xB5\xB3", + "\xAD\x77" => "\xE8\xB6\xB4", + "\xAD\x78" => "\xE8\xBB\x8D", + "\xAD\x79" => "\xE8\xBB\x8C", + "\xAD\x7A" => "\xE8\xBF\xB0", + "\xAD\x7B" => "\xE8\xBF\xA6", + "\xAD\x7C" => "\xE8\xBF\xA2", + "\xAD\x7D" => "\xE8\xBF\xAA", + "\xAD\x7E" => "\xE8\xBF\xA5", + "\xAD\xA1" => "\xE8\xBF\xAD", + "\xAD\xA2" => "\xE8\xBF\xAB", + "\xAD\xA3" => "\xE8\xBF\xA4", + "\xAD\xA4" => "\xE8\xBF\xA8", + "\xAD\xA5" => "\xE9\x83\x8A", + "\xAD\xA6" => "\xE9\x83\x8E", + "\xAD\xA7" => "\xE9\x83\x81", + "\xAD\xA8" => "\xE9\x83\x83", + "\xAD\xA9" => "\xE9\x85\x8B", + "\xAD\xAA" => "\xE9\x85\x8A", + "\xAD\xAB" => "\xE9\x87\x8D", + "\xAD\xAC" => "\xE9\x96\x82", + "\xAD\xAD" => "\xE9\x99\x90", + "\xAD\xAE" => "\xE9\x99\x8B", + "\xAD\xAF" => "\xE9\x99\x8C", + "\xAD\xB0" => "\xE9\x99\x8D", + "\xAD\xB1" => "\xE9\x9D\xA2", + "\xAD\xB2" => "\xE9\x9D\xA9", + "\xAD\xB3" => "\xE9\x9F\x8B", + "\xAD\xB4" => "\xE9\x9F\xAD", + "\xAD\xB5" => "\xE9\x9F\xB3", + "\xAD\xB6" => "\xE9\xA0\x81", + "\xAD\xB7" => "\xE9\xA2\xA8", + "\xAD\xB8" => "\xE9\xA3\x9B", + "\xAD\xB9" => "\xE9\xA3\x9F", + "\xAD\xBA" => "\xE9\xA6\x96", + "\xAD\xBB" => "\xE9\xA6\x99", + "\xAD\xBC" => "\xE4\xB9\x98", + "\xAD\xBD" => "\xE4\xBA\xB3", + "\xAD\xBE" => "\xE5\x80\x8C", + "\xAD\xBF" => "\xE5\x80\x8D", + "\xAD\xC0" => "\xE5\x80\xA3", + "\xAD\xC1" => "\xE4\xBF\xAF", + "\xAD\xC2" => "\xE5\x80\xA6", + "\xAD\xC3" => "\xE5\x80\xA5", + "\xAD\xC4" => "\xE4\xBF\xB8", + "\xAD\xC5" => "\xE5\x80\xA9", + "\xAD\xC6" => "\xE5\x80\x96", + "\xAD\xC7" => "\xE5\x80\x86", + "\xAD\xC8" => "\xE5\x80\xBC", + "\xAD\xC9" => "\xE5\x80\x9F", + "\xAD\xCA" => "\xE5\x80\x9A", + "\xAD\xCB" => "\xE5\x80\x92", + "\xAD\xCC" => "\xE5\x80\x91", + "\xAD\xCD" => "\xE4\xBF\xBA", + "\xAD\xCE" => "\xE5\x80\x80", + "\xAD\xCF" => "\xE5\x80\x94", + "\xAD\xD0" => "\xE5\x80\xA8", + "\xAD\xD1" => "\xE4\xBF\xB1", + "\xAD\xD2" => "\xE5\x80\xA1", + "\xAD\xD3" => "\xE5\x80\x8B", + "\xAD\xD4" => "\xE5\x80\x99", + "\xAD\xD5" => "\xE5\x80\x98", + "\xAD\xD6" => "\xE4\xBF\xB3", + "\xAD\xD7" => "\xE4\xBF\xAE", + "\xAD\xD8" => "\xE5\x80\xAD", + "\xAD\xD9" => "\xE5\x80\xAA", + "\xAD\xDA" => "\xE4\xBF\xBE", + "\xAD\xDB" => "\xE5\x80\xAB", + "\xAD\xDC" => "\xE5\x80\x89", + "\xAD\xDD" => "\xE5\x85\xBC", + "\xAD\xDE" => "\xE5\x86\xA4", + "\xAD\xDF" => "\xE5\x86\xA5", + "\xAD\xE0" => "\xE5\x86\xA2", + "\xAD\xE1" => "\xE5\x87\x8D", + "\xAD\xE2" => "\xE5\x87\x8C", + "\xAD\xE3" => "\xE5\x87\x86", + "\xAD\xE4" => "\xE5\x87\x8B", + "\xAD\xE5" => "\xE5\x89\x96", + "\xAD\xE6" => "\xE5\x89\x9C", + "\xAD\xE7" => "\xE5\x89\x94", + "\xAD\xE8" => "\xE5\x89\x9B", + "\xAD\xE9" => "\xE5\x89\x9D", + "\xAD\xEA" => "\xE5\x8C\xAA", + "\xAD\xEB" => "\xE5\x8D\xBF", + "\xAD\xEC" => "\xE5\x8E\x9F", + "\xAD\xED" => "\xE5\x8E\x9D", + "\xAD\xEE" => "\xE5\x8F\x9F", + "\xAD\xEF" => "\xE5\x93\xA8", + "\xAD\xF0" => "\xE5\x94\x90", + "\xAD\xF1" => "\xE5\x94\x81", + "\xAD\xF2" => "\xE5\x94\xB7", + "\xAD\xF3" => "\xE5\x93\xBC", + "\xAD\xF4" => "\xE5\x93\xA5", + "\xAD\xF5" => "\xE5\x93\xB2", + "\xAD\xF6" => "\xE5\x94\x86", + "\xAD\xF7" => "\xE5\x93\xBA", + "\xAD\xF8" => "\xE5\x94\x94", + "\xAD\xF9" => "\xE5\x93\xA9", + "\xAD\xFA" => "\xE5\x93\xAD", + "\xAD\xFB" => "\xE5\x93\xA1", + "\xAD\xFC" => "\xE5\x94\x89", + "\xAD\xFD" => "\xE5\x93\xAE", + "\xAD\xFE" => "\xE5\x93\xAA", + "\xAE\x40" => "\xE5\x93\xA6", + "\xAE\x41" => "\xE5\x94\xA7", + "\xAE\x42" => "\xE5\x94\x87", + "\xAE\x43" => "\xE5\x93\xBD", + "\xAE\x44" => "\xE5\x94\x8F", + "\xAE\x45" => "\xE5\x9C\x83", + "\xAE\x46" => "\xE5\x9C\x84", + "\xAE\x47" => "\xE5\x9F\x82", + "\xAE\x48" => "\xE5\x9F\x94", + "\xAE\x49" => "\xE5\x9F\x8B", + "\xAE\x4A" => "\xE5\x9F\x83", + "\xAE\x4B" => "\xE5\xA0\x89", + "\xAE\x4C" => "\xE5\xA4\x8F", + "\xAE\x4D" => "\xE5\xA5\x97", + "\xAE\x4E" => "\xE5\xA5\x98", + "\xAE\x4F" => "\xE5\xA5\x9A", + "\xAE\x50" => "\xE5\xA8\x91", + "\xAE\x51" => "\xE5\xA8\x98", + "\xAE\x52" => "\xE5\xA8\x9C", + "\xAE\x53" => "\xE5\xA8\x9F", + "\xAE\x54" => "\xE5\xA8\x9B", + "\xAE\x55" => "\xE5\xA8\x93", + "\xAE\x56" => "\xE5\xA7\xAC", + "\xAE\x57" => "\xE5\xA8\xA0", + "\xAE\x58" => "\xE5\xA8\xA3", + "\xAE\x59" => "\xE5\xA8\xA9", + "\xAE\x5A" => "\xE5\xA8\xA5", + "\xAE\x5B" => "\xE5\xA8\x8C", + "\xAE\x5C" => "\xE5\xA8\x89", + "\xAE\x5D" => "\xE5\xAD\xAB", + "\xAE\x5E" => "\xE5\xB1\x98", + "\xAE\x5F" => "\xE5\xAE\xB0", + "\xAE\x60" => "\xE5\xAE\xB3", + "\xAE\x61" => "\xE5\xAE\xB6", + "\xAE\x62" => "\xE5\xAE\xB4", + "\xAE\x63" => "\xE5\xAE\xAE", + "\xAE\x64" => "\xE5\xAE\xB5", + "\xAE\x65" => "\xE5\xAE\xB9", + "\xAE\x66" => "\xE5\xAE\xB8", + "\xAE\x67" => "\xE5\xB0\x84", + "\xAE\x68" => "\xE5\xB1\x91", + "\xAE\x69" => "\xE5\xB1\x95", + "\xAE\x6A" => "\xE5\xB1\x90", + "\xAE\x6B" => "\xE5\xB3\xAD", + "\xAE\x6C" => "\xE5\xB3\xBD", + "\xAE\x6D" => "\xE5\xB3\xBB", + "\xAE\x6E" => "\xE5\xB3\xAA", + "\xAE\x6F" => "\xE5\xB3\xA8", + "\xAE\x70" => "\xE5\xB3\xB0", + "\xAE\x71" => "\xE5\xB3\xB6", + "\xAE\x72" => "\xE5\xB4\x81", + "\xAE\x73" => "\xE5\xB3\xB4", + "\xAE\x74" => "\xE5\xB7\xAE", + "\xAE\x75" => "\xE5\xB8\xAD", + "\xAE\x76" => "\xE5\xB8\xAB", + "\xAE\x77" => "\xE5\xBA\xAB", + "\xAE\x78" => "\xE5\xBA\xAD", + "\xAE\x79" => "\xE5\xBA\xA7", + "\xAE\x7A" => "\xE5\xBC\xB1", + "\xAE\x7B" => "\xE5\xBE\x92", + "\xAE\x7C" => "\xE5\xBE\x91", + "\xAE\x7D" => "\xE5\xBE\x90", + "\xAE\x7E" => "\xE6\x81\x99", + "\xAE\xA1" => "\xE6\x81\xA3", + "\xAE\xA2" => "\xE6\x81\xA5", + "\xAE\xA3" => "\xE6\x81\x90", + "\xAE\xA4" => "\xE6\x81\x95", + "\xAE\xA5" => "\xE6\x81\xAD", + "\xAE\xA6" => "\xE6\x81\xA9", + "\xAE\xA7" => "\xE6\x81\xAF", + "\xAE\xA8" => "\xE6\x82\x84", + "\xAE\xA9" => "\xE6\x82\x9F", + "\xAE\xAA" => "\xE6\x82\x9A", + "\xAE\xAB" => "\xE6\x82\x8D", + "\xAE\xAC" => "\xE6\x82\x94", + "\xAE\xAD" => "\xE6\x82\x8C", + "\xAE\xAE" => "\xE6\x82\x85", + "\xAE\xAF" => "\xE6\x82\x96", + "\xAE\xB0" => "\xE6\x89\x87", + "\xAE\xB1" => "\xE6\x8B\xB3", + "\xAE\xB2" => "\xE6\x8C\x88", + "\xAE\xB3" => "\xE6\x8B\xBF", + "\xAE\xB4" => "\xE6\x8D\x8E", + "\xAE\xB5" => "\xE6\x8C\xBE", + "\xAE\xB6" => "\xE6\x8C\xAF", + "\xAE\xB7" => "\xE6\x8D\x95", + "\xAE\xB8" => "\xE6\x8D\x82", + "\xAE\xB9" => "\xE6\x8D\x86", + "\xAE\xBA" => "\xE6\x8D\x8F", + "\xAE\xBB" => "\xE6\x8D\x89", + "\xAE\xBC" => "\xE6\x8C\xBA", + "\xAE\xBD" => "\xE6\x8D\x90", + "\xAE\xBE" => "\xE6\x8C\xBD", + "\xAE\xBF" => "\xE6\x8C\xAA", + "\xAE\xC0" => "\xE6\x8C\xAB", + "\xAE\xC1" => "\xE6\x8C\xA8", + "\xAE\xC2" => "\xE6\x8D\x8D", + "\xAE\xC3" => "\xE6\x8D\x8C", + "\xAE\xC4" => "\xE6\x95\x88", + "\xAE\xC5" => "\xE6\x95\x89", + "\xAE\xC6" => "\xE6\x96\x99", + "\xAE\xC7" => "\xE6\x97\x81", + "\xAE\xC8" => "\xE6\x97\x85", + "\xAE\xC9" => "\xE6\x99\x82", + "\xAE\xCA" => "\xE6\x99\x89", + "\xAE\xCB" => "\xE6\x99\x8F", + "\xAE\xCC" => "\xE6\x99\x83", + "\xAE\xCD" => "\xE6\x99\x92", + "\xAE\xCE" => "\xE6\x99\x8C", + "\xAE\xCF" => "\xE6\x99\x85", + "\xAE\xD0" => "\xE6\x99\x81", + "\xAE\xD1" => "\xE6\x9B\xB8", + "\xAE\xD2" => "\xE6\x9C\x94", + "\xAE\xD3" => "\xE6\x9C\x95", + "\xAE\xD4" => "\xE6\x9C\x97", + "\xAE\xD5" => "\xE6\xA0\xA1", + "\xAE\xD6" => "\xE6\xA0\xB8", + "\xAE\xD7" => "\xE6\xA1\x88", + "\xAE\xD8" => "\xE6\xA1\x86", + "\xAE\xD9" => "\xE6\xA1\x93", + "\xAE\xDA" => "\xE6\xA0\xB9", + "\xAE\xDB" => "\xE6\xA1\x82", + "\xAE\xDC" => "\xE6\xA1\x94", + "\xAE\xDD" => "\xE6\xA0\xA9", + "\xAE\xDE" => "\xE6\xA2\xB3", + "\xAE\xDF" => "\xE6\xA0\x97", + "\xAE\xE0" => "\xE6\xA1\x8C", + "\xAE\xE1" => "\xE6\xA1\x91", + "\xAE\xE2" => "\xE6\xA0\xBD", + "\xAE\xE3" => "\xE6\x9F\xB4", + "\xAE\xE4" => "\xE6\xA1\x90", + "\xAE\xE5" => "\xE6\xA1\x80", + "\xAE\xE6" => "\xE6\xA0\xBC", + "\xAE\xE7" => "\xE6\xA1\x83", + "\xAE\xE8" => "\xE6\xA0\xAA", + "\xAE\xE9" => "\xE6\xA1\x85", + "\xAE\xEA" => "\xE6\xA0\x93", + "\xAE\xEB" => "\xE6\xA0\x98", + "\xAE\xEC" => "\xE6\xA1\x81", + "\xAE\xED" => "\xE6\xAE\x8A", + "\xAE\xEE" => "\xE6\xAE\x89", + "\xAE\xEF" => "\xE6\xAE\xB7", + "\xAE\xF0" => "\xE6\xB0\xA3", + "\xAE\xF1" => "\xE6\xB0\xA7", + "\xAE\xF2" => "\xE6\xB0\xA8", + "\xAE\xF3" => "\xE6\xB0\xA6", + "\xAE\xF4" => "\xE6\xB0\xA4", + "\xAE\xF5" => "\xE6\xB3\xB0", + "\xAE\xF6" => "\xE6\xB5\xAA", + "\xAE\xF7" => "\xE6\xB6\x95", + "\xAE\xF8" => "\xE6\xB6\x88", + "\xAE\xF9" => "\xE6\xB6\x87", + "\xAE\xFA" => "\xE6\xB5\xA6", + "\xAE\xFB" => "\xE6\xB5\xB8", + "\xAE\xFC" => "\xE6\xB5\xB7", + "\xAE\xFD" => "\xE6\xB5\x99", + "\xAE\xFE" => "\xE6\xB6\x93", + "\xAF\x40" => "\xE6\xB5\xAC", + "\xAF\x41" => "\xE6\xB6\x89", + "\xAF\x42" => "\xE6\xB5\xAE", + "\xAF\x43" => "\xE6\xB5\x9A", + "\xAF\x44" => "\xE6\xB5\xB4", + "\xAF\x45" => "\xE6\xB5\xA9", + "\xAF\x46" => "\xE6\xB6\x8C", + "\xAF\x47" => "\xE6\xB6\x8A", + "\xAF\x48" => "\xE6\xB5\xB9", + "\xAF\x49" => "\xE6\xB6\x85", + "\xAF\x4A" => "\xE6\xB5\xA5", + "\xAF\x4B" => "\xE6\xB6\x94", + "\xAF\x4C" => "\xE7\x83\x8A", + "\xAF\x4D" => "\xE7\x83\x98", + "\xAF\x4E" => "\xE7\x83\xA4", + "\xAF\x4F" => "\xE7\x83\x99", + "\xAF\x50" => "\xE7\x83\x88", + "\xAF\x51" => "\xE7\x83\x8F", + "\xAF\x52" => "\xE7\x88\xB9", + "\xAF\x53" => "\xE7\x89\xB9", + "\xAF\x54" => "\xE7\x8B\xBC", + "\xAF\x55" => "\xE7\x8B\xB9", + "\xAF\x56" => "\xE7\x8B\xBD", + "\xAF\x57" => "\xE7\x8B\xB8", + "\xAF\x58" => "\xE7\x8B\xB7", + "\xAF\x59" => "\xE7\x8E\x86", + "\xAF\x5A" => "\xE7\x8F\xAD", + "\xAF\x5B" => "\xE7\x90\x89", + "\xAF\x5C" => "\xE7\x8F\xAE", + "\xAF\x5D" => "\xE7\x8F\xA0", + "\xAF\x5E" => "\xE7\x8F\xAA", + "\xAF\x5F" => "\xE7\x8F\x9E", + "\xAF\x60" => "\xE7\x95\x94", + "\xAF\x61" => "\xE7\x95\x9D", + "\xAF\x62" => "\xE7\x95\x9C", + "\xAF\x63" => "\xE7\x95\x9A", + "\xAF\x64" => "\xE7\x95\x99", + "\xAF\x65" => "\xE7\x96\xBE", + "\xAF\x66" => "\xE7\x97\x85", + "\xAF\x67" => "\xE7\x97\x87", + "\xAF\x68" => "\xE7\x96\xB2", + "\xAF\x69" => "\xE7\x96\xB3", + "\xAF\x6A" => "\xE7\x96\xBD", + "\xAF\x6B" => "\xE7\x96\xBC", + "\xAF\x6C" => "\xE7\x96\xB9", + "\xAF\x6D" => "\xE7\x97\x82", + "\xAF\x6E" => "\xE7\x96\xB8", + "\xAF\x6F" => "\xE7\x9A\x8B", + "\xAF\x70" => "\xE7\x9A\xB0", + "\xAF\x71" => "\xE7\x9B\x8A", + "\xAF\x72" => "\xE7\x9B\x8D", + "\xAF\x73" => "\xE7\x9B\x8E", + "\xAF\x74" => "\xE7\x9C\xA9", + "\xAF\x75" => "\xE7\x9C\x9F", + "\xAF\x76" => "\xE7\x9C\xA0", + "\xAF\x77" => "\xE7\x9C\xA8", + "\xAF\x78" => "\xE7\x9F\xA9", + "\xAF\x79" => "\xE7\xA0\xB0", + "\xAF\x7A" => "\xE7\xA0\xA7", + "\xAF\x7B" => "\xE7\xA0\xB8", + "\xAF\x7C" => "\xE7\xA0\x9D", + "\xAF\x7D" => "\xE7\xA0\xB4", + "\xAF\x7E" => "\xE7\xA0\xB7", + "\xAF\xA1" => "\xE7\xA0\xA5", + "\xAF\xA2" => "\xE7\xA0\xAD", + "\xAF\xA3" => "\xE7\xA0\xA0", + "\xAF\xA4" => "\xE7\xA0\x9F", + "\xAF\xA5" => "\xE7\xA0\xB2", + "\xAF\xA6" => "\xE7\xA5\x95", + "\xAF\xA7" => "\xE7\xA5\x90", + "\xAF\xA8" => "\xE7\xA5\xA0", + "\xAF\xA9" => "\xE7\xA5\x9F", + "\xAF\xAA" => "\xE7\xA5\x96", + "\xAF\xAB" => "\xE7\xA5\x9E", + "\xAF\xAC" => "\xE7\xA5\x9D", + "\xAF\xAD" => "\xE7\xA5\x97", + "\xAF\xAE" => "\xE7\xA5\x9A", + "\xAF\xAF" => "\xE7\xA7\xA4", + "\xAF\xB0" => "\xE7\xA7\xA3", + "\xAF\xB1" => "\xE7\xA7\xA7", + "\xAF\xB2" => "\xE7\xA7\x9F", + "\xAF\xB3" => "\xE7\xA7\xA6", + "\xAF\xB4" => "\xE7\xA7\xA9", + "\xAF\xB5" => "\xE7\xA7\x98", + "\xAF\xB6" => "\xE7\xAA\x84", + "\xAF\xB7" => "\xE7\xAA\x88", + "\xAF\xB8" => "\xE7\xAB\x99", + "\xAF\xB9" => "\xE7\xAC\x86", + "\xAF\xBA" => "\xE7\xAC\x91", + "\xAF\xBB" => "\xE7\xB2\x89", + "\xAF\xBC" => "\xE7\xB4\xA1", + "\xAF\xBD" => "\xE7\xB4\x97", + "\xAF\xBE" => "\xE7\xB4\x8B", + "\xAF\xBF" => "\xE7\xB4\x8A", + "\xAF\xC0" => "\xE7\xB4\xA0", + "\xAF\xC1" => "\xE7\xB4\xA2", + "\xAF\xC2" => "\xE7\xB4\x94", + "\xAF\xC3" => "\xE7\xB4\x90", + "\xAF\xC4" => "\xE7\xB4\x95", + "\xAF\xC5" => "\xE7\xB4\x9A", + "\xAF\xC6" => "\xE7\xB4\x9C", + "\xAF\xC7" => "\xE7\xB4\x8D", + "\xAF\xC8" => "\xE7\xB4\x99", + "\xAF\xC9" => "\xE7\xB4\x9B", + "\xAF\xCA" => "\xE7\xBC\xBA", + "\xAF\xCB" => "\xE7\xBD\x9F", + "\xAF\xCC" => "\xE7\xBE\x94", + "\xAF\xCD" => "\xE7\xBF\x85", + "\xAF\xCE" => "\xE7\xBF\x81", + "\xAF\xCF" => "\xE8\x80\x86", + "\xAF\xD0" => "\xE8\x80\x98", + "\xAF\xD1" => "\xE8\x80\x95", + "\xAF\xD2" => "\xE8\x80\x99", + "\xAF\xD3" => "\xE8\x80\x97", + "\xAF\xD4" => "\xE8\x80\xBD", + "\xAF\xD5" => "\xE8\x80\xBF", + "\xAF\xD6" => "\xE8\x83\xB1", + "\xAF\xD7" => "\xE8\x84\x82", + "\xAF\xD8" => "\xE8\x83\xB0", + "\xAF\xD9" => "\xE8\x84\x85", + "\xAF\xDA" => "\xE8\x83\xAD", + "\xAF\xDB" => "\xE8\x83\xB4", + "\xAF\xDC" => "\xE8\x84\x86", + "\xAF\xDD" => "\xE8\x83\xB8", + "\xAF\xDE" => "\xE8\x83\xB3", + "\xAF\xDF" => "\xE8\x84\x88", + "\xAF\xE0" => "\xE8\x83\xBD", + "\xAF\xE1" => "\xE8\x84\x8A", + "\xAF\xE2" => "\xE8\x83\xBC", + "\xAF\xE3" => "\xE8\x83\xAF", + "\xAF\xE4" => "\xE8\x87\xAD", + "\xAF\xE5" => "\xE8\x87\xAC", + "\xAF\xE6" => "\xE8\x88\x80", + "\xAF\xE7" => "\xE8\x88\x90", + "\xAF\xE8" => "\xE8\x88\xAA", + "\xAF\xE9" => "\xE8\x88\xAB", + "\xAF\xEA" => "\xE8\x88\xA8", + "\xAF\xEB" => "\xE8\x88\xAC", + "\xAF\xEC" => "\xE8\x8A\xBB", + "\xAF\xED" => "\xE8\x8C\xAB", + "\xAF\xEE" => "\xE8\x8D\x92", + "\xAF\xEF" => "\xE8\x8D\x94", + "\xAF\xF0" => "\xE8\x8D\x8A", + "\xAF\xF1" => "\xE8\x8C\xB8", + "\xAF\xF2" => "\xE8\x8D\x90", + "\xAF\xF3" => "\xE8\x8D\x89", + "\xAF\xF4" => "\xE8\x8C\xB5", + "\xAF\xF5" => "\xE8\x8C\xB4", + "\xAF\xF6" => "\xE8\x8D\x8F", + "\xAF\xF7" => "\xE8\x8C\xB2", + "\xAF\xF8" => "\xE8\x8C\xB9", + "\xAF\xF9" => "\xE8\x8C\xB6", + "\xAF\xFA" => "\xE8\x8C\x97", + "\xAF\xFB" => "\xE8\x8D\x80", + "\xAF\xFC" => "\xE8\x8C\xB1", + "\xAF\xFD" => "\xE8\x8C\xA8", + "\xAF\xFE" => "\xE8\x8D\x83", + "\xB0\x40" => "\xE8\x99\x94", + "\xB0\x41" => "\xE8\x9A\x8A", + "\xB0\x42" => "\xE8\x9A\xAA", + "\xB0\x43" => "\xE8\x9A\x93", + "\xB0\x44" => "\xE8\x9A\xA4", + "\xB0\x45" => "\xE8\x9A\xA9", + "\xB0\x46" => "\xE8\x9A\x8C", + "\xB0\x47" => "\xE8\x9A\xA3", + "\xB0\x48" => "\xE8\x9A\x9C", + "\xB0\x49" => "\xE8\xA1\xB0", + "\xB0\x4A" => "\xE8\xA1\xB7", + "\xB0\x4B" => "\xE8\xA2\x81", + "\xB0\x4C" => "\xE8\xA2\x82", + "\xB0\x4D" => "\xE8\xA1\xBD", + "\xB0\x4E" => "\xE8\xA1\xB9", + "\xB0\x4F" => "\xE8\xA8\x98", + "\xB0\x50" => "\xE8\xA8\x90", + "\xB0\x51" => "\xE8\xA8\x8E", + "\xB0\x52" => "\xE8\xA8\x8C", + "\xB0\x53" => "\xE8\xA8\x95", + "\xB0\x54" => "\xE8\xA8\x8A", + "\xB0\x55" => "\xE8\xA8\x97", + "\xB0\x56" => "\xE8\xA8\x93", + "\xB0\x57" => "\xE8\xA8\x96", + "\xB0\x58" => "\xE8\xA8\x8F", + "\xB0\x59" => "\xE8\xA8\x91", + "\xB0\x5A" => "\xE8\xB1\x88", + "\xB0\x5B" => "\xE8\xB1\xBA", + "\xB0\x5C" => "\xE8\xB1\xB9", + "\xB0\x5D" => "\xE8\xB2\xA1", + "\xB0\x5E" => "\xE8\xB2\xA2", + "\xB0\x5F" => "\xE8\xB5\xB7", + "\xB0\x60" => "\xE8\xBA\xAC", + "\xB0\x61" => "\xE8\xBB\x92", + "\xB0\x62" => "\xE8\xBB\x94", + "\xB0\x63" => "\xE8\xBB\x8F", + "\xB0\x64" => "\xE8\xBE\xB1", + "\xB0\x65" => "\xE9\x80\x81", + "\xB0\x66" => "\xE9\x80\x86", + "\xB0\x67" => "\xE8\xBF\xB7", + "\xB0\x68" => "\xE9\x80\x80", + "\xB0\x69" => "\xE8\xBF\xBA", + "\xB0\x6A" => "\xE8\xBF\xB4", + "\xB0\x6B" => "\xE9\x80\x83", + "\xB0\x6C" => "\xE8\xBF\xBD", + "\xB0\x6D" => "\xE9\x80\x85", + "\xB0\x6E" => "\xE8\xBF\xB8", + "\xB0\x6F" => "\xE9\x82\x95", + "\xB0\x70" => "\xE9\x83\xA1", + "\xB0\x71" => "\xE9\x83\x9D", + "\xB0\x72" => "\xE9\x83\xA2", + "\xB0\x73" => "\xE9\x85\x92", + "\xB0\x74" => "\xE9\x85\x8D", + "\xB0\x75" => "\xE9\x85\x8C", + "\xB0\x76" => "\xE9\x87\x98", + "\xB0\x77" => "\xE9\x87\x9D", + "\xB0\x78" => "\xE9\x87\x97", + "\xB0\x79" => "\xE9\x87\x9C", + "\xB0\x7A" => "\xE9\x87\x99", + "\xB0\x7B" => "\xE9\x96\x83", + "\xB0\x7C" => "\xE9\x99\xA2", + "\xB0\x7D" => "\xE9\x99\xA3", + "\xB0\x7E" => "\xE9\x99\xA1", + "\xB0\xA1" => "\xE9\x99\x9B", + "\xB0\xA2" => "\xE9\x99\x9D", + "\xB0\xA3" => "\xE9\x99\xA4", + "\xB0\xA4" => "\xE9\x99\x98", + "\xB0\xA5" => "\xE9\x99\x9E", + "\xB0\xA6" => "\xE9\x9A\xBB", + "\xB0\xA7" => "\xE9\xA3\xA2", + "\xB0\xA8" => "\xE9\xA6\xAC", + "\xB0\xA9" => "\xE9\xAA\xA8", + "\xB0\xAA" => "\xE9\xAB\x98", + "\xB0\xAB" => "\xE9\xAC\xA5", + "\xB0\xAC" => "\xE9\xAC\xB2", + "\xB0\xAD" => "\xE9\xAC\xBC", + "\xB0\xAE" => "\xE4\xB9\xBE", + "\xB0\xAF" => "\xE5\x81\xBA", + "\xB0\xB0" => "\xE5\x81\xBD", + "\xB0\xB1" => "\xE5\x81\x9C", + "\xB0\xB2" => "\xE5\x81\x87", + "\xB0\xB3" => "\xE5\x81\x83", + "\xB0\xB4" => "\xE5\x81\x8C", + "\xB0\xB5" => "\xE5\x81\x9A", + "\xB0\xB6" => "\xE5\x81\x89", + "\xB0\xB7" => "\xE5\x81\xA5", + "\xB0\xB8" => "\xE5\x81\xB6", + "\xB0\xB9" => "\xE5\x81\x8E", + "\xB0\xBA" => "\xE5\x81\x95", + "\xB0\xBB" => "\xE5\x81\xB5", + "\xB0\xBC" => "\xE5\x81\xB4", + "\xB0\xBD" => "\xE5\x81\xB7", + "\xB0\xBE" => "\xE5\x81\x8F", + "\xB0\xBF" => "\xE5\x80\x8F", + "\xB0\xC0" => "\xE5\x81\xAF", + "\xB0\xC1" => "\xE5\x81\xAD", + "\xB0\xC2" => "\xE5\x85\x9C", + "\xB0\xC3" => "\xE5\x86\x95", + "\xB0\xC4" => "\xE5\x87\xB0", + "\xB0\xC5" => "\xE5\x89\xAA", + "\xB0\xC6" => "\xE5\x89\xAF", + "\xB0\xC7" => "\xE5\x8B\x92", + "\xB0\xC8" => "\xE5\x8B\x99", + "\xB0\xC9" => "\xE5\x8B\x98", + "\xB0\xCA" => "\xE5\x8B\x95", + "\xB0\xCB" => "\xE5\x8C\x90", + "\xB0\xCC" => "\xE5\x8C\x8F", + "\xB0\xCD" => "\xE5\x8C\x99", + "\xB0\xCE" => "\xE5\x8C\xBF", + "\xB0\xCF" => "\xE5\x8D\x80", + "\xB0\xD0" => "\xE5\x8C\xBE", + "\xB0\xD1" => "\xE5\x8F\x83", + "\xB0\xD2" => "\xE6\x9B\xBC", + "\xB0\xD3" => "\xE5\x95\x86", + "\xB0\xD4" => "\xE5\x95\xAA", + "\xB0\xD5" => "\xE5\x95\xA6", + "\xB0\xD6" => "\xE5\x95\x84", + "\xB0\xD7" => "\xE5\x95\x9E", + "\xB0\xD8" => "\xE5\x95\xA1", + "\xB0\xD9" => "\xE5\x95\x83", + "\xB0\xDA" => "\xE5\x95\x8A", + "\xB0\xDB" => "\xE5\x94\xB1", + "\xB0\xDC" => "\xE5\x95\x96", + "\xB0\xDD" => "\xE5\x95\x8F", + "\xB0\xDE" => "\xE5\x95\x95", + "\xB0\xDF" => "\xE5\x94\xAF", + "\xB0\xE0" => "\xE5\x95\xA4", + "\xB0\xE1" => "\xE5\x94\xB8", + "\xB0\xE2" => "\xE5\x94\xAE", + "\xB0\xE3" => "\xE5\x95\x9C", + "\xB0\xE4" => "\xE5\x94\xAC", + "\xB0\xE5" => "\xE5\x95\xA3", + "\xB0\xE6" => "\xE5\x94\xB3", + "\xB0\xE7" => "\xE5\x95\x81", + "\xB0\xE8" => "\xE5\x95\x97", + "\xB0\xE9" => "\xE5\x9C\x88", + "\xB0\xEA" => "\xE5\x9C\x8B", + "\xB0\xEB" => "\xE5\x9C\x89", + "\xB0\xEC" => "\xE5\x9F\x9F", + "\xB0\xED" => "\xE5\xA0\x85", + "\xB0\xEE" => "\xE5\xA0\x8A", + "\xB0\xEF" => "\xE5\xA0\x86", + "\xB0\xF0" => "\xE5\x9F\xA0", + "\xB0\xF1" => "\xE5\x9F\xA4", + "\xB0\xF2" => "\xE5\x9F\xBA", + "\xB0\xF3" => "\xE5\xA0\x82", + "\xB0\xF4" => "\xE5\xA0\xB5", + "\xB0\xF5" => "\xE5\x9F\xB7", + "\xB0\xF6" => "\xE5\x9F\xB9", + "\xB0\xF7" => "\xE5\xA4\xA0", + "\xB0\xF8" => "\xE5\xA5\xA2", + "\xB0\xF9" => "\xE5\xA8\xB6", + "\xB0\xFA" => "\xE5\xA9\x81", + "\xB0\xFB" => "\xE5\xA9\x89", + "\xB0\xFC" => "\xE5\xA9\xA6", + "\xB0\xFD" => "\xE5\xA9\xAA", + "\xB0\xFE" => "\xE5\xA9\x80", + "\xB1\x40" => "\xE5\xA8\xBC", + "\xB1\x41" => "\xE5\xA9\xA2", + "\xB1\x42" => "\xE5\xA9\x9A", + "\xB1\x43" => "\xE5\xA9\x86", + "\xB1\x44" => "\xE5\xA9\x8A", + "\xB1\x45" => "\xE5\xAD\xB0", + "\xB1\x46" => "\xE5\xAF\x87", + "\xB1\x47" => "\xE5\xAF\x85", + "\xB1\x48" => "\xE5\xAF\x84", + "\xB1\x49" => "\xE5\xAF\x82", + "\xB1\x4A" => "\xE5\xAE\xBF", + "\xB1\x4B" => "\xE5\xAF\x86", + "\xB1\x4C" => "\xE5\xB0\x89", + "\xB1\x4D" => "\xE5\xB0\x88", + "\xB1\x4E" => "\xE5\xB0\x87", + "\xB1\x4F" => "\xE5\xB1\xA0", + "\xB1\x50" => "\xE5\xB1\x9C", + "\xB1\x51" => "\xE5\xB1\x9D", + "\xB1\x52" => "\xE5\xB4\x87", + "\xB1\x53" => "\xE5\xB4\x86", + "\xB1\x54" => "\xE5\xB4\x8E", + "\xB1\x55" => "\xE5\xB4\x9B", + "\xB1\x56" => "\xE5\xB4\x96", + "\xB1\x57" => "\xE5\xB4\xA2", + "\xB1\x58" => "\xE5\xB4\x91", + "\xB1\x59" => "\xE5\xB4\xA9", + "\xB1\x5A" => "\xE5\xB4\x94", + "\xB1\x5B" => "\xE5\xB4\x99", + "\xB1\x5C" => "\xE5\xB4\xA4", + "\xB1\x5D" => "\xE5\xB4\xA7", + "\xB1\x5E" => "\xE5\xB4\x97", + "\xB1\x5F" => "\xE5\xB7\xA2", + "\xB1\x60" => "\xE5\xB8\xB8", + "\xB1\x61" => "\xE5\xB8\xB6", + "\xB1\x62" => "\xE5\xB8\xB3", + "\xB1\x63" => "\xE5\xB8\xB7", + "\xB1\x64" => "\xE5\xBA\xB7", + "\xB1\x65" => "\xE5\xBA\xB8", + "\xB1\x66" => "\xE5\xBA\xB6", + "\xB1\x67" => "\xE5\xBA\xB5", + "\xB1\x68" => "\xE5\xBA\xBE", + "\xB1\x69" => "\xE5\xBC\xB5", + "\xB1\x6A" => "\xE5\xBC\xB7", + "\xB1\x6B" => "\xE5\xBD\x97", + "\xB1\x6C" => "\xE5\xBD\xAC", + "\xB1\x6D" => "\xE5\xBD\xA9", + "\xB1\x6E" => "\xE5\xBD\xAB", + "\xB1\x6F" => "\xE5\xBE\x97", + "\xB1\x70" => "\xE5\xBE\x99", + "\xB1\x71" => "\xE5\xBE\x9E", + "\xB1\x72" => "\xE5\xBE\x98", + "\xB1\x73" => "\xE5\xBE\xA1", + "\xB1\x74" => "\xE5\xBE\xA0", + "\xB1\x75" => "\xE5\xBE\x9C", + "\xB1\x76" => "\xE6\x81\xBF", + "\xB1\x77" => "\xE6\x82\xA3", + "\xB1\x78" => "\xE6\x82\x89", + "\xB1\x79" => "\xE6\x82\xA0", + "\xB1\x7A" => "\xE6\x82\xA8", + "\xB1\x7B" => "\xE6\x83\x8B", + "\xB1\x7C" => "\xE6\x82\xB4", + "\xB1\x7D" => "\xE6\x83\xA6", + "\xB1\x7E" => "\xE6\x82\xBD", + "\xB1\xA1" => "\xE6\x83\x85", + "\xB1\xA2" => "\xE6\x82\xBB", + "\xB1\xA3" => "\xE6\x82\xB5", + "\xB1\xA4" => "\xE6\x83\x9C", + "\xB1\xA5" => "\xE6\x82\xBC", + "\xB1\xA6" => "\xE6\x83\x98", + "\xB1\xA7" => "\xE6\x83\x95", + "\xB1\xA8" => "\xE6\x83\x86", + "\xB1\xA9" => "\xE6\x83\x9F", + "\xB1\xAA" => "\xE6\x82\xB8", + "\xB1\xAB" => "\xE6\x83\x9A", + "\xB1\xAC" => "\xE6\x83\x87", + "\xB1\xAD" => "\xE6\x88\x9A", + "\xB1\xAE" => "\xE6\x88\x9B", + "\xB1\xAF" => "\xE6\x89\x88", + "\xB1\xB0" => "\xE6\x8E\xA0", + "\xB1\xB1" => "\xE6\x8E\xA7", + "\xB1\xB2" => "\xE6\x8D\xB2", + "\xB1\xB3" => "\xE6\x8E\x96", + "\xB1\xB4" => "\xE6\x8E\xA2", + "\xB1\xB5" => "\xE6\x8E\xA5", + "\xB1\xB6" => "\xE6\x8D\xB7", + "\xB1\xB7" => "\xE6\x8D\xA7", + "\xB1\xB8" => "\xE6\x8E\x98", + "\xB1\xB9" => "\xE6\x8E\xAA", + "\xB1\xBA" => "\xE6\x8D\xB1", + "\xB1\xBB" => "\xE6\x8E\xA9", + "\xB1\xBC" => "\xE6\x8E\x89", + "\xB1\xBD" => "\xE6\x8E\x83", + "\xB1\xBE" => "\xE6\x8E\x9B", + "\xB1\xBF" => "\xE6\x8D\xAB", + "\xB1\xC0" => "\xE6\x8E\xA8", + "\xB1\xC1" => "\xE6\x8E\x84", + "\xB1\xC2" => "\xE6\x8E\x88", + "\xB1\xC3" => "\xE6\x8E\x99", + "\xB1\xC4" => "\xE6\x8E\xA1", + "\xB1\xC5" => "\xE6\x8E\xAC", + "\xB1\xC6" => "\xE6\x8E\x92", + "\xB1\xC7" => "\xE6\x8E\x8F", + "\xB1\xC8" => "\xE6\x8E\x80", + "\xB1\xC9" => "\xE6\x8D\xBB", + "\xB1\xCA" => "\xE6\x8D\xA9", + "\xB1\xCB" => "\xE6\x8D\xA8", + "\xB1\xCC" => "\xE6\x8D\xBA", + "\xB1\xCD" => "\xE6\x95\x9D", + "\xB1\xCE" => "\xE6\x95\x96", + "\xB1\xCF" => "\xE6\x95\x91", + "\xB1\xD0" => "\xE6\x95\x99", + "\xB1\xD1" => "\xE6\x95\x97", + "\xB1\xD2" => "\xE5\x95\x9F", + "\xB1\xD3" => "\xE6\x95\x8F", + "\xB1\xD4" => "\xE6\x95\x98", + "\xB1\xD5" => "\xE6\x95\x95", + "\xB1\xD6" => "\xE6\x95\x94", + "\xB1\xD7" => "\xE6\x96\x9C", + "\xB1\xD8" => "\xE6\x96\x9B", + "\xB1\xD9" => "\xE6\x96\xAC", + "\xB1\xDA" => "\xE6\x97\x8F", + "\xB1\xDB" => "\xE6\x97\x8B", + "\xB1\xDC" => "\xE6\x97\x8C", + "\xB1\xDD" => "\xE6\x97\x8E", + "\xB1\xDE" => "\xE6\x99\x9D", + "\xB1\xDF" => "\xE6\x99\x9A", + "\xB1\xE0" => "\xE6\x99\xA4", + "\xB1\xE1" => "\xE6\x99\xA8", + "\xB1\xE2" => "\xE6\x99\xA6", + "\xB1\xE3" => "\xE6\x99\x9E", + "\xB1\xE4" => "\xE6\x9B\xB9", + "\xB1\xE5" => "\xE5\x8B\x97", + "\xB1\xE6" => "\xE6\x9C\x9B", + "\xB1\xE7" => "\xE6\xA2\x81", + "\xB1\xE8" => "\xE6\xA2\xAF", + "\xB1\xE9" => "\xE6\xA2\xA2", + "\xB1\xEA" => "\xE6\xA2\x93", + "\xB1\xEB" => "\xE6\xA2\xB5", + "\xB1\xEC" => "\xE6\xA1\xBF", + "\xB1\xED" => "\xE6\xA1\xB6", + "\xB1\xEE" => "\xE6\xA2\xB1", + "\xB1\xEF" => "\xE6\xA2\xA7", + "\xB1\xF0" => "\xE6\xA2\x97", + "\xB1\xF1" => "\xE6\xA2\xB0", + "\xB1\xF2" => "\xE6\xA2\x83", + "\xB1\xF3" => "\xE6\xA3\x84", + "\xB1\xF4" => "\xE6\xA2\xAD", + "\xB1\xF5" => "\xE6\xA2\x86", + "\xB1\xF6" => "\xE6\xA2\x85", + "\xB1\xF7" => "\xE6\xA2\x94", + "\xB1\xF8" => "\xE6\xA2\x9D", + "\xB1\xF9" => "\xE6\xA2\xA8", + "\xB1\xFA" => "\xE6\xA2\x9F", + "\xB1\xFB" => "\xE6\xA2\xA1", + "\xB1\xFC" => "\xE6\xA2\x82", + "\xB1\xFD" => "\xE6\xAC\xB2", + "\xB1\xFE" => "\xE6\xAE\xBA", + "\xB2\x40" => "\xE6\xAF\xAB", + "\xB2\x41" => "\xE6\xAF\xAC", + "\xB2\x42" => "\xE6\xB0\xAB", + "\xB2\x43" => "\xE6\xB6\x8E", + "\xB2\x44" => "\xE6\xB6\xBC", + "\xB2\x45" => "\xE6\xB7\xB3", + "\xB2\x46" => "\xE6\xB7\x99", + "\xB2\x47" => "\xE6\xB6\xB2", + "\xB2\x48" => "\xE6\xB7\xA1", + "\xB2\x49" => "\xE6\xB7\x8C", + "\xB2\x4A" => "\xE6\xB7\xA4", + "\xB2\x4B" => "\xE6\xB7\xBB", + "\xB2\x4C" => "\xE6\xB7\xBA", + "\xB2\x4D" => "\xE6\xB8\x85", + "\xB2\x4E" => "\xE6\xB7\x87", + "\xB2\x4F" => "\xE6\xB7\x8B", + "\xB2\x50" => "\xE6\xB6\xAF", + "\xB2\x51" => "\xE6\xB7\x91", + "\xB2\x52" => "\xE6\xB6\xAE", + "\xB2\x53" => "\xE6\xB7\x9E", + "\xB2\x54" => "\xE6\xB7\xB9", + "\xB2\x55" => "\xE6\xB6\xB8", + "\xB2\x56" => "\xE6\xB7\xB7", + "\xB2\x57" => "\xE6\xB7\xB5", + "\xB2\x58" => "\xE6\xB7\x85", + "\xB2\x59" => "\xE6\xB7\x92", + "\xB2\x5A" => "\xE6\xB8\x9A", + "\xB2\x5B" => "\xE6\xB6\xB5", + "\xB2\x5C" => "\xE6\xB7\x9A", + "\xB2\x5D" => "\xE6\xB7\xAB", + "\xB2\x5E" => "\xE6\xB7\x98", + "\xB2\x5F" => "\xE6\xB7\xAA", + "\xB2\x60" => "\xE6\xB7\xB1", + "\xB2\x61" => "\xE6\xB7\xAE", + "\xB2\x62" => "\xE6\xB7\xA8", + "\xB2\x63" => "\xE6\xB7\x86", + "\xB2\x64" => "\xE6\xB7\x84", + "\xB2\x65" => "\xE6\xB6\xAA", + "\xB2\x66" => "\xE6\xB7\xAC", + "\xB2\x67" => "\xE6\xB6\xBF", + "\xB2\x68" => "\xE6\xB7\xA6", + "\xB2\x69" => "\xE7\x83\xB9", + "\xB2\x6A" => "\xE7\x84\x89", + "\xB2\x6B" => "\xE7\x84\x8A", + "\xB2\x6C" => "\xE7\x83\xBD", + "\xB2\x6D" => "\xE7\x83\xAF", + "\xB2\x6E" => "\xE7\x88\xBD", + "\xB2\x6F" => "\xE7\x89\xBD", + "\xB2\x70" => "\xE7\x8A\x81", + "\xB2\x71" => "\xE7\x8C\x9C", + "\xB2\x72" => "\xE7\x8C\x9B", + "\xB2\x73" => "\xE7\x8C\x96", + "\xB2\x74" => "\xE7\x8C\x93", + "\xB2\x75" => "\xE7\x8C\x99", + "\xB2\x76" => "\xE7\x8E\x87", + "\xB2\x77" => "\xE7\x90\x85", + "\xB2\x78" => "\xE7\x90\x8A", + "\xB2\x79" => "\xE7\x90\x83", + "\xB2\x7A" => "\xE7\x90\x86", + "\xB2\x7B" => "\xE7\x8F\xBE", + "\xB2\x7C" => "\xE7\x90\x8D", + "\xB2\x7D" => "\xE7\x93\xA0", + "\xB2\x7E" => "\xE7\x93\xB6", + "\xB2\xA1" => "\xE7\x93\xB7", + "\xB2\xA2" => "\xE7\x94\x9C", + "\xB2\xA3" => "\xE7\x94\xA2", + "\xB2\xA4" => "\xE7\x95\xA5", + "\xB2\xA5" => "\xE7\x95\xA6", + "\xB2\xA6" => "\xE7\x95\xA2", + "\xB2\xA7" => "\xE7\x95\xB0", + "\xB2\xA8" => "\xE7\x96\x8F", + "\xB2\xA9" => "\xE7\x97\x94", + "\xB2\xAA" => "\xE7\x97\x95", + "\xB2\xAB" => "\xE7\x96\xB5", + "\xB2\xAC" => "\xE7\x97\x8A", + "\xB2\xAD" => "\xE7\x97\x8D", + "\xB2\xAE" => "\xE7\x9A\x8E", + "\xB2\xAF" => "\xE7\x9B\x94", + "\xB2\xB0" => "\xE7\x9B\x92", + "\xB2\xB1" => "\xE7\x9B\x9B", + "\xB2\xB2" => "\xE7\x9C\xB7", + "\xB2\xB3" => "\xE7\x9C\xBE", + "\xB2\xB4" => "\xE7\x9C\xBC", + "\xB2\xB5" => "\xE7\x9C\xB6", + "\xB2\xB6" => "\xE7\x9C\xB8", + "\xB2\xB7" => "\xE7\x9C\xBA", + "\xB2\xB8" => "\xE7\xA1\xAB", + "\xB2\xB9" => "\xE7\xA1\x83", + "\xB2\xBA" => "\xE7\xA1\x8E", + "\xB2\xBB" => "\xE7\xA5\xA5", + "\xB2\xBC" => "\xE7\xA5\xA8", + "\xB2\xBD" => "\xE7\xA5\xAD", + "\xB2\xBE" => "\xE7\xA7\xBB", + "\xB2\xBF" => "\xE7\xAA\x92", + "\xB2\xC0" => "\xE7\xAA\x95", + "\xB2\xC1" => "\xE7\xAC\xA0", + "\xB2\xC2" => "\xE7\xAC\xA8", + "\xB2\xC3" => "\xE7\xAC\x9B", + "\xB2\xC4" => "\xE7\xAC\xAC", + "\xB2\xC5" => "\xE7\xAC\xA6", + "\xB2\xC6" => "\xE7\xAC\x99", + "\xB2\xC7" => "\xE7\xAC\x9E", + "\xB2\xC8" => "\xE7\xAC\xAE", + "\xB2\xC9" => "\xE7\xB2\x92", + "\xB2\xCA" => "\xE7\xB2\x97", + "\xB2\xCB" => "\xE7\xB2\x95", + "\xB2\xCC" => "\xE7\xB5\x86", + "\xB2\xCD" => "\xE7\xB5\x83", + "\xB2\xCE" => "\xE7\xB5\xB1", + "\xB2\xCF" => "\xE7\xB4\xAE", + "\xB2\xD0" => "\xE7\xB4\xB9", + "\xB2\xD1" => "\xE7\xB4\xBC", + "\xB2\xD2" => "\xE7\xB5\x80", + "\xB2\xD3" => "\xE7\xB4\xB0", + "\xB2\xD4" => "\xE7\xB4\xB3", + "\xB2\xD5" => "\xE7\xB5\x84", + "\xB2\xD6" => "\xE7\xB4\xAF", + "\xB2\xD7" => "\xE7\xB5\x82", + "\xB2\xD8" => "\xE7\xB4\xB2", + "\xB2\xD9" => "\xE7\xB4\xB1", + "\xB2\xDA" => "\xE7\xBC\xBD", + "\xB2\xDB" => "\xE7\xBE\x9E", + "\xB2\xDC" => "\xE7\xBE\x9A", + "\xB2\xDD" => "\xE7\xBF\x8C", + "\xB2\xDE" => "\xE7\xBF\x8E", + "\xB2\xDF" => "\xE7\xBF\x92", + "\xB2\xE0" => "\xE8\x80\x9C", + "\xB2\xE1" => "\xE8\x81\x8A", + "\xB2\xE2" => "\xE8\x81\x86", + "\xB2\xE3" => "\xE8\x84\xAF", + "\xB2\xE4" => "\xE8\x84\x96", + "\xB2\xE5" => "\xE8\x84\xA3", + "\xB2\xE6" => "\xE8\x84\xAB", + "\xB2\xE7" => "\xE8\x84\xA9", + "\xB2\xE8" => "\xE8\x84\xB0", + "\xB2\xE9" => "\xE8\x84\xA4", + "\xB2\xEA" => "\xE8\x88\x82", + "\xB2\xEB" => "\xE8\x88\xB5", + "\xB2\xEC" => "\xE8\x88\xB7", + "\xB2\xED" => "\xE8\x88\xB6", + "\xB2\xEE" => "\xE8\x88\xB9", + "\xB2\xEF" => "\xE8\x8E\x8E", + "\xB2\xF0" => "\xE8\x8E\x9E", + "\xB2\xF1" => "\xE8\x8E\x98", + "\xB2\xF2" => "\xE8\x8D\xB8", + "\xB2\xF3" => "\xE8\x8E\xA2", + "\xB2\xF4" => "\xE8\x8E\x96", + "\xB2\xF5" => "\xE8\x8E\xBD", + "\xB2\xF6" => "\xE8\x8E\xAB", + "\xB2\xF7" => "\xE8\x8E\x92", + "\xB2\xF8" => "\xE8\x8E\x8A", + "\xB2\xF9" => "\xE8\x8E\x93", + "\xB2\xFA" => "\xE8\x8E\x89", + "\xB2\xFB" => "\xE8\x8E\xA0", + "\xB2\xFC" => "\xE8\x8D\xB7", + "\xB2\xFD" => "\xE8\x8D\xBB", + "\xB2\xFE" => "\xE8\x8D\xBC", + "\xB3\x40" => "\xE8\x8E\x86", + "\xB3\x41" => "\xE8\x8E\xA7", + "\xB3\x42" => "\xE8\x99\x95", + "\xB3\x43" => "\xE5\xBD\xAA", + "\xB3\x44" => "\xE8\x9B\x87", + "\xB3\x45" => "\xE8\x9B\x80", + "\xB3\x46" => "\xE8\x9A\xB6", + "\xB3\x47" => "\xE8\x9B\x84", + "\xB3\x48" => "\xE8\x9A\xB5", + "\xB3\x49" => "\xE8\x9B\x86", + "\xB3\x4A" => "\xE8\x9B\x8B", + "\xB3\x4B" => "\xE8\x9A\xB1", + "\xB3\x4C" => "\xE8\x9A\xAF", + "\xB3\x4D" => "\xE8\x9B\x89", + "\xB3\x4E" => "\xE8\xA1\x93", + "\xB3\x4F" => "\xE8\xA2\x9E", + "\xB3\x50" => "\xE8\xA2\x88", + "\xB3\x51" => "\xE8\xA2\xAB", + "\xB3\x52" => "\xE8\xA2\x92", + "\xB3\x53" => "\xE8\xA2\x96", + "\xB3\x54" => "\xE8\xA2\x8D", + "\xB3\x55" => "\xE8\xA2\x8B", + "\xB3\x56" => "\xE8\xA6\x93", + "\xB3\x57" => "\xE8\xA6\x8F", + "\xB3\x58" => "\xE8\xA8\xAA", + "\xB3\x59" => "\xE8\xA8\x9D", + "\xB3\x5A" => "\xE8\xA8\xA3", + "\xB3\x5B" => "\xE8\xA8\xA5", + "\xB3\x5C" => "\xE8\xA8\xB1", + "\xB3\x5D" => "\xE8\xA8\xAD", + "\xB3\x5E" => "\xE8\xA8\x9F", + "\xB3\x5F" => "\xE8\xA8\x9B", + "\xB3\x60" => "\xE8\xA8\xA2", + "\xB3\x61" => "\xE8\xB1\x89", + "\xB3\x62" => "\xE8\xB1\x9A", + "\xB3\x63" => "\xE8\xB2\xA9", + "\xB3\x64" => "\xE8\xB2\xAC", + "\xB3\x65" => "\xE8\xB2\xAB", + "\xB3\x66" => "\xE8\xB2\xA8", + "\xB3\x67" => "\xE8\xB2\xAA", + "\xB3\x68" => "\xE8\xB2\xA7", + "\xB3\x69" => "\xE8\xB5\xA7", + "\xB3\x6A" => "\xE8\xB5\xA6", + "\xB3\x6B" => "\xE8\xB6\xBE", + "\xB3\x6C" => "\xE8\xB6\xBA", + "\xB3\x6D" => "\xE8\xBB\x9B", + "\xB3\x6E" => "\xE8\xBB\x9F", + "\xB3\x6F" => "\xE9\x80\x99", + "\xB3\x70" => "\xE9\x80\x8D", + "\xB3\x71" => "\xE9\x80\x9A", + "\xB3\x72" => "\xE9\x80\x97", + "\xB3\x73" => "\xE9\x80\xA3", + "\xB3\x74" => "\xE9\x80\x9F", + "\xB3\x75" => "\xE9\x80\x9D", + "\xB3\x76" => "\xE9\x80\x90", + "\xB3\x77" => "\xE9\x80\x95", + "\xB3\x78" => "\xE9\x80\x9E", + "\xB3\x79" => "\xE9\x80\xA0", + "\xB3\x7A" => "\xE9\x80\x8F", + "\xB3\x7B" => "\xE9\x80\xA2", + "\xB3\x7C" => "\xE9\x80\x96", + "\xB3\x7D" => "\xE9\x80\x9B", + "\xB3\x7E" => "\xE9\x80\x94", + "\xB3\xA1" => "\xE9\x83\xA8", + "\xB3\xA2" => "\xE9\x83\xAD", + "\xB3\xA3" => "\xE9\x83\xBD", + "\xB3\xA4" => "\xE9\x85\x97", + "\xB3\xA5" => "\xE9\x87\x8E", + "\xB3\xA6" => "\xE9\x87\xB5", + "\xB3\xA7" => "\xE9\x87\xA6", + "\xB3\xA8" => "\xE9\x87\xA3", + "\xB3\xA9" => "\xE9\x87\xA7", + "\xB3\xAA" => "\xE9\x87\xAD", + "\xB3\xAB" => "\xE9\x87\xA9", + "\xB3\xAC" => "\xE9\x96\x89", + "\xB3\xAD" => "\xE9\x99\xAA", + "\xB3\xAE" => "\xE9\x99\xB5", + "\xB3\xAF" => "\xE9\x99\xB3", + "\xB3\xB0" => "\xE9\x99\xB8", + "\xB3\xB1" => "\xE9\x99\xB0", + "\xB3\xB2" => "\xE9\x99\xB4", + "\xB3\xB3" => "\xE9\x99\xB6", + "\xB3\xB4" => "\xE9\x99\xB7", + "\xB3\xB5" => "\xE9\x99\xAC", + "\xB3\xB6" => "\xE9\x9B\x80", + "\xB3\xB7" => "\xE9\x9B\xAA", + "\xB3\xB8" => "\xE9\x9B\xA9", + "\xB3\xB9" => "\xE7\xAB\xA0", + "\xB3\xBA" => "\xE7\xAB\x9F", + "\xB3\xBB" => "\xE9\xA0\x82", + "\xB3\xBC" => "\xE9\xA0\x83", + "\xB3\xBD" => "\xE9\xAD\x9A", + "\xB3\xBE" => "\xE9\xB3\xA5", + "\xB3\xBF" => "\xE9\xB9\xB5", + "\xB3\xC0" => "\xE9\xB9\xBF", + "\xB3\xC1" => "\xE9\xBA\xA5", + "\xB3\xC2" => "\xE9\xBA\xBB", + "\xB3\xC3" => "\xE5\x82\xA2", + "\xB3\xC4" => "\xE5\x82\x8D", + "\xB3\xC5" => "\xE5\x82\x85", + "\xB3\xC6" => "\xE5\x82\x99", + "\xB3\xC7" => "\xE5\x82\x91", + "\xB3\xC8" => "\xE5\x82\x80", + "\xB3\xC9" => "\xE5\x82\x96", + "\xB3\xCA" => "\xE5\x82\x98", + "\xB3\xCB" => "\xE5\x82\x9A", + "\xB3\xCC" => "\xE6\x9C\x80", + "\xB3\xCD" => "\xE5\x87\xB1", + "\xB3\xCE" => "\xE5\x89\xB2", + "\xB3\xCF" => "\xE5\x89\xB4", + "\xB3\xD0" => "\xE5\x89\xB5", + "\xB3\xD1" => "\xE5\x89\xA9", + "\xB3\xD2" => "\xE5\x8B\x9E", + "\xB3\xD3" => "\xE5\x8B\x9D", + "\xB3\xD4" => "\xE5\x8B\x9B", + "\xB3\xD5" => "\xE5\x8D\x9A", + "\xB3\xD6" => "\xE5\x8E\xA5", + "\xB3\xD7" => "\xE5\x95\xBB", + "\xB3\xD8" => "\xE5\x96\x80", + "\xB3\xD9" => "\xE5\x96\xA7", + "\xB3\xDA" => "\xE5\x95\xBC", + "\xB3\xDB" => "\xE5\x96\x8A", + "\xB3\xDC" => "\xE5\x96\x9D", + "\xB3\xDD" => "\xE5\x96\x98", + "\xB3\xDE" => "\xE5\x96\x82", + "\xB3\xDF" => "\xE5\x96\x9C", + "\xB3\xE0" => "\xE5\x96\xAA", + "\xB3\xE1" => "\xE5\x96\x94", + "\xB3\xE2" => "\xE5\x96\x87", + "\xB3\xE3" => "\xE5\x96\x8B", + "\xB3\xE4" => "\xE5\x96\x83", + "\xB3\xE5" => "\xE5\x96\xB3", + "\xB3\xE6" => "\xE5\x96\xAE", + "\xB3\xE7" => "\xE5\x96\x9F", + "\xB3\xE8" => "\xE5\x94\xBE", + "\xB3\xE9" => "\xE5\x96\xB2", + "\xB3\xEA" => "\xE5\x96\x9A", + "\xB3\xEB" => "\xE5\x96\xBB", + "\xB3\xEC" => "\xE5\x96\xAC", + "\xB3\xED" => "\xE5\x96\xB1", + "\xB3\xEE" => "\xE5\x95\xBE", + "\xB3\xEF" => "\xE5\x96\x89", + "\xB3\xF0" => "\xE5\x96\xAB", + "\xB3\xF1" => "\xE5\x96\x99", + "\xB3\xF2" => "\xE5\x9C\x8D", + "\xB3\xF3" => "\xE5\xA0\xAF", + "\xB3\xF4" => "\xE5\xA0\xAA", + "\xB3\xF5" => "\xE5\xA0\xB4", + "\xB3\xF6" => "\xE5\xA0\xA4", + "\xB3\xF7" => "\xE5\xA0\xB0", + "\xB3\xF8" => "\xE5\xA0\xB1", + "\xB3\xF9" => "\xE5\xA0\xA1", + "\xB3\xFA" => "\xE5\xA0\x9D", + "\xB3\xFB" => "\xE5\xA0\xA0", + "\xB3\xFC" => "\xE5\xA3\xB9", + "\xB3\xFD" => "\xE5\xA3\xBA", + "\xB3\xFE" => "\xE5\xA5\xA0", + "\xB4\x40" => "\xE5\xA9\xB7", + "\xB4\x41" => "\xE5\xAA\x9A", + "\xB4\x42" => "\xE5\xA9\xBF", + "\xB4\x43" => "\xE5\xAA\x92", + "\xB4\x44" => "\xE5\xAA\x9B", + "\xB4\x45" => "\xE5\xAA\xA7", + "\xB4\x46" => "\xE5\xAD\xB3", + "\xB4\x47" => "\xE5\xAD\xB1", + "\xB4\x48" => "\xE5\xAF\x92", + "\xB4\x49" => "\xE5\xAF\x8C", + "\xB4\x4A" => "\xE5\xAF\x93", + "\xB4\x4B" => "\xE5\xAF\x90", + "\xB4\x4C" => "\xE5\xB0\x8A", + "\xB4\x4D" => "\xE5\xB0\x8B", + "\xB4\x4E" => "\xE5\xB0\xB1", + "\xB4\x4F" => "\xE5\xB5\x8C", + "\xB4\x50" => "\xE5\xB5\x90", + "\xB4\x51" => "\xE5\xB4\xB4", + "\xB4\x52" => "\xE5\xB5\x87", + "\xB4\x53" => "\xE5\xB7\xBD", + "\xB4\x54" => "\xE5\xB9\x85", + "\xB4\x55" => "\xE5\xB8\xBD", + "\xB4\x56" => "\xE5\xB9\x80", + "\xB4\x57" => "\xE5\xB9\x83", + "\xB4\x58" => "\xE5\xB9\xBE", + "\xB4\x59" => "\xE5\xBB\x8A", + "\xB4\x5A" => "\xE5\xBB\x81", + "\xB4\x5B" => "\xE5\xBB\x82", + "\xB4\x5C" => "\xE5\xBB\x84", + "\xB4\x5D" => "\xE5\xBC\xBC", + "\xB4\x5E" => "\xE5\xBD\xAD", + "\xB4\x5F" => "\xE5\xBE\xA9", + "\xB4\x60" => "\xE5\xBE\xAA", + "\xB4\x61" => "\xE5\xBE\xA8", + "\xB4\x62" => "\xE6\x83\x91", + "\xB4\x63" => "\xE6\x83\xA1", + "\xB4\x64" => "\xE6\x82\xB2", + "\xB4\x65" => "\xE6\x82\xB6", + "\xB4\x66" => "\xE6\x83\xA0", + "\xB4\x67" => "\xE6\x84\x9C", + "\xB4\x68" => "\xE6\x84\xA3", + "\xB4\x69" => "\xE6\x83\xBA", + "\xB4\x6A" => "\xE6\x84\x95", + "\xB4\x6B" => "\xE6\x83\xB0", + "\xB4\x6C" => "\xE6\x83\xBB", + "\xB4\x6D" => "\xE6\x83\xB4", + "\xB4\x6E" => "\xE6\x85\xA8", + "\xB4\x6F" => "\xE6\x83\xB1", + "\xB4\x70" => "\xE6\x84\x8E", + "\xB4\x71" => "\xE6\x83\xB6", + "\xB4\x72" => "\xE6\x84\x89", + "\xB4\x73" => "\xE6\x84\x80", + "\xB4\x74" => "\xE6\x84\x92", + "\xB4\x75" => "\xE6\x88\x9F", + "\xB4\x76" => "\xE6\x89\x89", + "\xB4\x77" => "\xE6\x8E\xA3", + "\xB4\x78" => "\xE6\x8E\x8C", + "\xB4\x79" => "\xE6\x8F\x8F", + "\xB4\x7A" => "\xE6\x8F\x80", + "\xB4\x7B" => "\xE6\x8F\xA9", + "\xB4\x7C" => "\xE6\x8F\x89", + "\xB4\x7D" => "\xE6\x8F\x86", + "\xB4\x7E" => "\xE6\x8F\x8D", + "\xB4\xA1" => "\xE6\x8F\x92", + "\xB4\xA2" => "\xE6\x8F\xA3", + "\xB4\xA3" => "\xE6\x8F\x90", + "\xB4\xA4" => "\xE6\x8F\xA1", + "\xB4\xA5" => "\xE6\x8F\x96", + "\xB4\xA6" => "\xE6\x8F\xAD", + "\xB4\xA7" => "\xE6\x8F\xAE", + "\xB4\xA8" => "\xE6\x8D\xB6", + "\xB4\xA9" => "\xE6\x8F\xB4", + "\xB4\xAA" => "\xE6\x8F\xAA", + "\xB4\xAB" => "\xE6\x8F\x9B", + "\xB4\xAC" => "\xE6\x91\x92", + "\xB4\xAD" => "\xE6\x8F\x9A", + "\xB4\xAE" => "\xE6\x8F\xB9", + "\xB4\xAF" => "\xE6\x95\x9E", + "\xB4\xB0" => "\xE6\x95\xA6", + "\xB4\xB1" => "\xE6\x95\xA2", + "\xB4\xB2" => "\xE6\x95\xA3", + "\xB4\xB3" => "\xE6\x96\x91", + "\xB4\xB4" => "\xE6\x96\x90", + "\xB4\xB5" => "\xE6\x96\xAF", + "\xB4\xB6" => "\xE6\x99\xAE", + "\xB4\xB7" => "\xE6\x99\xB0", + "\xB4\xB8" => "\xE6\x99\xB4", + "\xB4\xB9" => "\xE6\x99\xB6", + "\xB4\xBA" => "\xE6\x99\xAF", + "\xB4\xBB" => "\xE6\x9A\x91", + "\xB4\xBC" => "\xE6\x99\xBA", + "\xB4\xBD" => "\xE6\x99\xBE", + "\xB4\xBE" => "\xE6\x99\xB7", + "\xB4\xBF" => "\xE6\x9B\xBE", + "\xB4\xC0" => "\xE6\x9B\xBF", + "\xB4\xC1" => "\xE6\x9C\x9F", + "\xB4\xC2" => "\xE6\x9C\x9D", + "\xB4\xC3" => "\xE6\xA3\xBA", + "\xB4\xC4" => "\xE6\xA3\x95", + "\xB4\xC5" => "\xE6\xA3\xA0", + "\xB4\xC6" => "\xE6\xA3\x98", + "\xB4\xC7" => "\xE6\xA3\x97", + "\xB4\xC8" => "\xE6\xA4\x85", + "\xB4\xC9" => "\xE6\xA3\x9F", + "\xB4\xCA" => "\xE6\xA3\xB5", + "\xB4\xCB" => "\xE6\xA3\xAE", + "\xB4\xCC" => "\xE6\xA3\xA7", + "\xB4\xCD" => "\xE6\xA3\xB9", + "\xB4\xCE" => "\xE6\xA3\x92", + "\xB4\xCF" => "\xE6\xA3\xB2", + "\xB4\xD0" => "\xE6\xA3\xA3", + "\xB4\xD1" => "\xE6\xA3\x8B", + "\xB4\xD2" => "\xE6\xA3\x8D", + "\xB4\xD3" => "\xE6\xA4\x8D", + "\xB4\xD4" => "\xE6\xA4\x92", + "\xB4\xD5" => "\xE6\xA4\x8E", + "\xB4\xD6" => "\xE6\xA3\x89", + "\xB4\xD7" => "\xE6\xA3\x9A", + "\xB4\xD8" => "\xE6\xA5\xAE", + "\xB4\xD9" => "\xE6\xA3\xBB", + "\xB4\xDA" => "\xE6\xAC\xBE", + "\xB4\xDB" => "\xE6\xAC\xBA", + "\xB4\xDC" => "\xE6\xAC\xBD", + "\xB4\xDD" => "\xE6\xAE\x98", + "\xB4\xDE" => "\xE6\xAE\x96", + "\xB4\xDF" => "\xE6\xAE\xBC", + "\xB4\xE0" => "\xE6\xAF\xAF", + "\xB4\xE1" => "\xE6\xB0\xAE", + "\xB4\xE2" => "\xE6\xB0\xAF", + "\xB4\xE3" => "\xE6\xB0\xAC", + "\xB4\xE4" => "\xE6\xB8\xAF", + "\xB4\xE5" => "\xE6\xB8\xB8", + "\xB4\xE6" => "\xE6\xB9\x94", + "\xB4\xE7" => "\xE6\xB8\xA1", + "\xB4\xE8" => "\xE6\xB8\xB2", + "\xB4\xE9" => "\xE6\xB9\xA7", + "\xB4\xEA" => "\xE6\xB9\x8A", + "\xB4\xEB" => "\xE6\xB8\xA0", + "\xB4\xEC" => "\xE6\xB8\xA5", + "\xB4\xED" => "\xE6\xB8\xA3", + "\xB4\xEE" => "\xE6\xB8\x9B", + "\xB4\xEF" => "\xE6\xB9\x9B", + "\xB4\xF0" => "\xE6\xB9\x98", + "\xB4\xF1" => "\xE6\xB8\xA4", + "\xB4\xF2" => "\xE6\xB9\x96", + "\xB4\xF3" => "\xE6\xB9\xAE", + "\xB4\xF4" => "\xE6\xB8\xAD", + "\xB4\xF5" => "\xE6\xB8\xA6", + "\xB4\xF6" => "\xE6\xB9\xAF", + "\xB4\xF7" => "\xE6\xB8\xB4", + "\xB4\xF8" => "\xE6\xB9\x8D", + "\xB4\xF9" => "\xE6\xB8\xBA", + "\xB4\xFA" => "\xE6\xB8\xAC", + "\xB4\xFB" => "\xE6\xB9\x83", + "\xB4\xFC" => "\xE6\xB8\x9D", + "\xB4\xFD" => "\xE6\xB8\xBE", + "\xB4\xFE" => "\xE6\xBB\x8B", + "\xB5\x40" => "\xE6\xBA\x89", + "\xB5\x41" => "\xE6\xB8\x99", + "\xB5\x42" => "\xE6\xB9\x8E", + "\xB5\x43" => "\xE6\xB9\xA3", + "\xB5\x44" => "\xE6\xB9\x84", + "\xB5\x45" => "\xE6\xB9\xB2", + "\xB5\x46" => "\xE6\xB9\xA9", + "\xB5\x47" => "\xE6\xB9\x9F", + "\xB5\x48" => "\xE7\x84\x99", + "\xB5\x49" => "\xE7\x84\x9A", + "\xB5\x4A" => "\xE7\x84\xA6", + "\xB5\x4B" => "\xE7\x84\xB0", + "\xB5\x4C" => "\xE7\x84\xA1", + "\xB5\x4D" => "\xE7\x84\xB6", + "\xB5\x4E" => "\xE7\x85\xAE", + "\xB5\x4F" => "\xE7\x84\x9C", + "\xB5\x50" => "\xE7\x89\x8C", + "\xB5\x51" => "\xE7\x8A\x84", + "\xB5\x52" => "\xE7\x8A\x80", + "\xB5\x53" => "\xE7\x8C\xB6", + "\xB5\x54" => "\xE7\x8C\xA5", + "\xB5\x55" => "\xE7\x8C\xB4", + "\xB5\x56" => "\xE7\x8C\xA9", + "\xB5\x57" => "\xE7\x90\xBA", + "\xB5\x58" => "\xE7\x90\xAA", + "\xB5\x59" => "\xE7\x90\xB3", + "\xB5\x5A" => "\xE7\x90\xA2", + "\xB5\x5B" => "\xE7\x90\xA5", + "\xB5\x5C" => "\xE7\x90\xB5", + "\xB5\x5D" => "\xE7\x90\xB6", + "\xB5\x5E" => "\xE7\x90\xB4", + "\xB5\x5F" => "\xE7\x90\xAF", + "\xB5\x60" => "\xE7\x90\x9B", + "\xB5\x61" => "\xE7\x90\xA6", + "\xB5\x62" => "\xE7\x90\xA8", + "\xB5\x63" => "\xE7\x94\xA5", + "\xB5\x64" => "\xE7\x94\xA6", + "\xB5\x65" => "\xE7\x95\xAB", + "\xB5\x66" => "\xE7\x95\xAA", + "\xB5\x67" => "\xE7\x97\xA2", + "\xB5\x68" => "\xE7\x97\x9B", + "\xB5\x69" => "\xE7\x97\xA3", + "\xB5\x6A" => "\xE7\x97\x99", + "\xB5\x6B" => "\xE7\x97\x98", + "\xB5\x6C" => "\xE7\x97\x9E", + "\xB5\x6D" => "\xE7\x97\xA0", + "\xB5\x6E" => "\xE7\x99\xBB", + "\xB5\x6F" => "\xE7\x99\xBC", + "\xB5\x70" => "\xE7\x9A\x96", + "\xB5\x71" => "\xE7\x9A\x93", + "\xB5\x72" => "\xE7\x9A\xB4", + "\xB5\x73" => "\xE7\x9B\x9C", + "\xB5\x74" => "\xE7\x9D\x8F", + "\xB5\x75" => "\xE7\x9F\xAD", + "\xB5\x76" => "\xE7\xA1\x9D", + "\xB5\x77" => "\xE7\xA1\xAC", + "\xB5\x78" => "\xE7\xA1\xAF", + "\xB5\x79" => "\xE7\xA8\x8D", + "\xB5\x7A" => "\xE7\xA8\x88", + "\xB5\x7B" => "\xE7\xA8\x8B", + "\xB5\x7C" => "\xE7\xA8\x85", + "\xB5\x7D" => "\xE7\xA8\x80", + "\xB5\x7E" => "\xE7\xAA\x98", + "\xB5\xA1" => "\xE7\xAA\x97", + "\xB5\xA2" => "\xE7\xAA\x96", + "\xB5\xA3" => "\xE7\xAB\xA5", + "\xB5\xA4" => "\xE7\xAB\xA3", + "\xB5\xA5" => "\xE7\xAD\x89", + "\xB5\xA6" => "\xE7\xAD\x96", + "\xB5\xA7" => "\xE7\xAD\x86", + "\xB5\xA8" => "\xE7\xAD\x90", + "\xB5\xA9" => "\xE7\xAD\x92", + "\xB5\xAA" => "\xE7\xAD\x94", + "\xB5\xAB" => "\xE7\xAD\x8D", + "\xB5\xAC" => "\xE7\xAD\x8B", + "\xB5\xAD" => "\xE7\xAD\x8F", + "\xB5\xAE" => "\xE7\xAD\x91", + "\xB5\xAF" => "\xE7\xB2\x9F", + "\xB5\xB0" => "\xE7\xB2\xA5", + "\xB5\xB1" => "\xE7\xB5\x9E", + "\xB5\xB2" => "\xE7\xB5\x90", + "\xB5\xB3" => "\xE7\xB5\xA8", + "\xB5\xB4" => "\xE7\xB5\x95", + "\xB5\xB5" => "\xE7\xB4\xAB", + "\xB5\xB6" => "\xE7\xB5\xAE", + "\xB5\xB7" => "\xE7\xB5\xB2", + "\xB5\xB8" => "\xE7\xB5\xA1", + "\xB5\xB9" => "\xE7\xB5\xA6", + "\xB5\xBA" => "\xE7\xB5\xA2", + "\xB5\xBB" => "\xE7\xB5\xB0", + "\xB5\xBC" => "\xE7\xB5\xB3", + "\xB5\xBD" => "\xE5\x96\x84", + "\xB5\xBE" => "\xE7\xBF\x94", + "\xB5\xBF" => "\xE7\xBF\x95", + "\xB5\xC0" => "\xE8\x80\x8B", + "\xB5\xC1" => "\xE8\x81\x92", + "\xB5\xC2" => "\xE8\x82\x85", + "\xB5\xC3" => "\xE8\x85\x95", + "\xB5\xC4" => "\xE8\x85\x94", + "\xB5\xC5" => "\xE8\x85\x8B", + "\xB5\xC6" => "\xE8\x85\x91", + "\xB5\xC7" => "\xE8\x85\x8E", + "\xB5\xC8" => "\xE8\x84\xB9", + "\xB5\xC9" => "\xE8\x85\x86", + "\xB5\xCA" => "\xE8\x84\xBE", + "\xB5\xCB" => "\xE8\x85\x8C", + "\xB5\xCC" => "\xE8\x85\x93", + "\xB5\xCD" => "\xE8\x85\xB4", + "\xB5\xCE" => "\xE8\x88\x92", + "\xB5\xCF" => "\xE8\x88\x9C", + "\xB5\xD0" => "\xE8\x8F\xA9", + "\xB5\xD1" => "\xE8\x90\x83", + "\xB5\xD2" => "\xE8\x8F\xB8", + "\xB5\xD3" => "\xE8\x90\x8D", + "\xB5\xD4" => "\xE8\x8F\xA0", + "\xB5\xD5" => "\xE8\x8F\x85", + "\xB5\xD6" => "\xE8\x90\x8B", + "\xB5\xD7" => "\xE8\x8F\x81", + "\xB5\xD8" => "\xE8\x8F\xAF", + "\xB5\xD9" => "\xE8\x8F\xB1", + "\xB5\xDA" => "\xE8\x8F\xB4", + "\xB5\xDB" => "\xE8\x91\x97", + "\xB5\xDC" => "\xE8\x90\x8A", + "\xB5\xDD" => "\xE8\x8F\xB0", + "\xB5\xDE" => "\xE8\x90\x8C", + "\xB5\xDF" => "\xE8\x8F\x8C", + "\xB5\xE0" => "\xE8\x8F\xBD", + "\xB5\xE1" => "\xE8\x8F\xB2", + "\xB5\xE2" => "\xE8\x8F\x8A", + "\xB5\xE3" => "\xE8\x90\xB8", + "\xB5\xE4" => "\xE8\x90\x8E", + "\xB5\xE5" => "\xE8\x90\x84", + "\xB5\xE6" => "\xE8\x8F\x9C", + "\xB5\xE7" => "\xE8\x90\x87", + "\xB5\xE8" => "\xE8\x8F\x94", + "\xB5\xE9" => "\xE8\x8F\x9F", + "\xB5\xEA" => "\xE8\x99\x9B", + "\xB5\xEB" => "\xE8\x9B\x9F", + "\xB5\xEC" => "\xE8\x9B\x99", + "\xB5\xED" => "\xE8\x9B\xAD", + "\xB5\xEE" => "\xE8\x9B\x94", + "\xB5\xEF" => "\xE8\x9B\x9B", + "\xB5\xF0" => "\xE8\x9B\xA4", + "\xB5\xF1" => "\xE8\x9B\x90", + "\xB5\xF2" => "\xE8\x9B\x9E", + "\xB5\xF3" => "\xE8\xA1\x97", + "\xB5\xF4" => "\xE8\xA3\x81", + "\xB5\xF5" => "\xE8\xA3\x82", + "\xB5\xF6" => "\xE8\xA2\xB1", + "\xB5\xF7" => "\xE8\xA6\x83", + "\xB5\xF8" => "\xE8\xA6\x96", + "\xB5\xF9" => "\xE8\xA8\xBB", + "\xB5\xFA" => "\xE8\xA9\xA0", + "\xB5\xFB" => "\xE8\xA9\x95", + "\xB5\xFC" => "\xE8\xA9\x9E", + "\xB5\xFD" => "\xE8\xA8\xBC", + "\xB5\xFE" => "\xE8\xA9\x81", + "\xB6\x40" => "\xE8\xA9\x94", + "\xB6\x41" => "\xE8\xA9\x9B", + "\xB6\x42" => "\xE8\xA9\x90", + "\xB6\x43" => "\xE8\xA9\x86", + "\xB6\x44" => "\xE8\xA8\xB4", + "\xB6\x45" => "\xE8\xA8\xBA", + "\xB6\x46" => "\xE8\xA8\xB6", + "\xB6\x47" => "\xE8\xA9\x96", + "\xB6\x48" => "\xE8\xB1\xA1", + "\xB6\x49" => "\xE8\xB2\x82", + "\xB6\x4A" => "\xE8\xB2\xAF", + "\xB6\x4B" => "\xE8\xB2\xBC", + "\xB6\x4C" => "\xE8\xB2\xB3", + "\xB6\x4D" => "\xE8\xB2\xBD", + "\xB6\x4E" => "\xE8\xB3\x81", + "\xB6\x4F" => "\xE8\xB2\xBB", + "\xB6\x50" => "\xE8\xB3\x80", + "\xB6\x51" => "\xE8\xB2\xB4", + "\xB6\x52" => "\xE8\xB2\xB7", + "\xB6\x53" => "\xE8\xB2\xB6", + "\xB6\x54" => "\xE8\xB2\xBF", + "\xB6\x55" => "\xE8\xB2\xB8", + "\xB6\x56" => "\xE8\xB6\x8A", + "\xB6\x57" => "\xE8\xB6\x85", + "\xB6\x58" => "\xE8\xB6\x81", + "\xB6\x59" => "\xE8\xB7\x8E", + "\xB6\x5A" => "\xE8\xB7\x9D", + "\xB6\x5B" => "\xE8\xB7\x8B", + "\xB6\x5C" => "\xE8\xB7\x9A", + "\xB6\x5D" => "\xE8\xB7\x91", + "\xB6\x5E" => "\xE8\xB7\x8C", + "\xB6\x5F" => "\xE8\xB7\x9B", + "\xB6\x60" => "\xE8\xB7\x86", + "\xB6\x61" => "\xE8\xBB\xBB", + "\xB6\x62" => "\xE8\xBB\xB8", + "\xB6\x63" => "\xE8\xBB\xBC", + "\xB6\x64" => "\xE8\xBE\x9C", + "\xB6\x65" => "\xE9\x80\xAE", + "\xB6\x66" => "\xE9\x80\xB5", + "\xB6\x67" => "\xE9\x80\xB1", + "\xB6\x68" => "\xE9\x80\xB8", + "\xB6\x69" => "\xE9\x80\xB2", + "\xB6\x6A" => "\xE9\x80\xB6", + "\xB6\x6B" => "\xE9\x84\x82", + "\xB6\x6C" => "\xE9\x83\xB5", + "\xB6\x6D" => "\xE9\x84\x89", + "\xB6\x6E" => "\xE9\x83\xBE", + "\xB6\x6F" => "\xE9\x85\xA3", + "\xB6\x70" => "\xE9\x85\xA5", + "\xB6\x71" => "\xE9\x87\x8F", + "\xB6\x72" => "\xE9\x88\x94", + "\xB6\x73" => "\xE9\x88\x95", + "\xB6\x74" => "\xE9\x88\xA3", + "\xB6\x75" => "\xE9\x88\x89", + "\xB6\x76" => "\xE9\x88\x9E", + "\xB6\x77" => "\xE9\x88\x8D", + "\xB6\x78" => "\xE9\x88\x90", + "\xB6\x79" => "\xE9\x88\x87", + "\xB6\x7A" => "\xE9\x88\x91", + "\xB6\x7B" => "\xE9\x96\x94", + "\xB6\x7C" => "\xE9\x96\x8F", + "\xB6\x7D" => "\xE9\x96\x8B", + "\xB6\x7E" => "\xE9\x96\x91", + "\xB6\xA1" => "\xE9\x96\x93", + "\xB6\xA2" => "\xE9\x96\x92", + "\xB6\xA3" => "\xE9\x96\x8E", + "\xB6\xA4" => "\xE9\x9A\x8A", + "\xB6\xA5" => "\xE9\x9A\x8E", + "\xB6\xA6" => "\xE9\x9A\x8B", + "\xB6\xA7" => "\xE9\x99\xBD", + "\xB6\xA8" => "\xE9\x9A\x85", + "\xB6\xA9" => "\xE9\x9A\x86", + "\xB6\xAA" => "\xE9\x9A\x8D", + "\xB6\xAB" => "\xE9\x99\xB2", + "\xB6\xAC" => "\xE9\x9A\x84", + "\xB6\xAD" => "\xE9\x9B\x81", + "\xB6\xAE" => "\xE9\x9B\x85", + "\xB6\xAF" => "\xE9\x9B\x84", + "\xB6\xB0" => "\xE9\x9B\x86", + "\xB6\xB1" => "\xE9\x9B\x87", + "\xB6\xB2" => "\xE9\x9B\xAF", + "\xB6\xB3" => "\xE9\x9B\xB2", + "\xB6\xB4" => "\xE9\x9F\x8C", + "\xB6\xB5" => "\xE9\xA0\x85", + "\xB6\xB6" => "\xE9\xA0\x86", + "\xB6\xB7" => "\xE9\xA0\x88", + "\xB6\xB8" => "\xE9\xA3\xA7", + "\xB6\xB9" => "\xE9\xA3\xAA", + "\xB6\xBA" => "\xE9\xA3\xAF", + "\xB6\xBB" => "\xE9\xA3\xA9", + "\xB6\xBC" => "\xE9\xA3\xB2", + "\xB6\xBD" => "\xE9\xA3\xAD", + "\xB6\xBE" => "\xE9\xA6\xAE", + "\xB6\xBF" => "\xE9\xA6\xAD", + "\xB6\xC0" => "\xE9\xBB\x83", + "\xB6\xC1" => "\xE9\xBB\x8D", + "\xB6\xC2" => "\xE9\xBB\x91", + "\xB6\xC3" => "\xE4\xBA\x82", + "\xB6\xC4" => "\xE5\x82\xAD", + "\xB6\xC5" => "\xE5\x82\xB5", + "\xB6\xC6" => "\xE5\x82\xB2", + "\xB6\xC7" => "\xE5\x82\xB3", + "\xB6\xC8" => "\xE5\x83\x85", + "\xB6\xC9" => "\xE5\x82\xBE", + "\xB6\xCA" => "\xE5\x82\xAC", + "\xB6\xCB" => "\xE5\x82\xB7", + "\xB6\xCC" => "\xE5\x82\xBB", + "\xB6\xCD" => "\xE5\x82\xAF", + "\xB6\xCE" => "\xE5\x83\x87", + "\xB6\xCF" => "\xE5\x89\xBF", + "\xB6\xD0" => "\xE5\x89\xB7", + "\xB6\xD1" => "\xE5\x89\xBD", + "\xB6\xD2" => "\xE5\x8B\x9F", + "\xB6\xD3" => "\xE5\x8B\xA6", + "\xB6\xD4" => "\xE5\x8B\xA4", + "\xB6\xD5" => "\xE5\x8B\xA2", + "\xB6\xD6" => "\xE5\x8B\xA3", + "\xB6\xD7" => "\xE5\x8C\xAF", + "\xB6\xD8" => "\xE5\x97\x9F", + "\xB6\xD9" => "\xE5\x97\xA8", + "\xB6\xDA" => "\xE5\x97\x93", + "\xB6\xDB" => "\xE5\x97\xA6", + "\xB6\xDC" => "\xE5\x97\x8E", + "\xB6\xDD" => "\xE5\x97\x9C", + "\xB6\xDE" => "\xE5\x97\x87", + "\xB6\xDF" => "\xE5\x97\x91", + "\xB6\xE0" => "\xE5\x97\xA3", + "\xB6\xE1" => "\xE5\x97\xA4", + "\xB6\xE2" => "\xE5\x97\xAF", + "\xB6\xE3" => "\xE5\x97\x9A", + "\xB6\xE4" => "\xE5\x97\xA1", + "\xB6\xE5" => "\xE5\x97\x85", + "\xB6\xE6" => "\xE5\x97\x86", + "\xB6\xE7" => "\xE5\x97\xA5", + "\xB6\xE8" => "\xE5\x97\x89", + "\xB6\xE9" => "\xE5\x9C\x92", + "\xB6\xEA" => "\xE5\x9C\x93", + "\xB6\xEB" => "\xE5\xA1\x9E", + "\xB6\xEC" => "\xE5\xA1\x91", + "\xB6\xED" => "\xE5\xA1\x98", + "\xB6\xEE" => "\xE5\xA1\x97", + "\xB6\xEF" => "\xE5\xA1\x9A", + "\xB6\xF0" => "\xE5\xA1\x94", + "\xB6\xF1" => "\xE5\xA1\xAB", + "\xB6\xF2" => "\xE5\xA1\x8C", + "\xB6\xF3" => "\xE5\xA1\xAD", + "\xB6\xF4" => "\xE5\xA1\x8A", + "\xB6\xF5" => "\xE5\xA1\xA2", + "\xB6\xF6" => "\xE5\xA1\x92", + "\xB6\xF7" => "\xE5\xA1\x8B", + "\xB6\xF8" => "\xE5\xA5\xA7", + "\xB6\xF9" => "\xE5\xAB\x81", + "\xB6\xFA" => "\xE5\xAB\x89", + "\xB6\xFB" => "\xE5\xAB\x8C", + "\xB6\xFC" => "\xE5\xAA\xBE", + "\xB6\xFD" => "\xE5\xAA\xBD", + "\xB6\xFE" => "\xE5\xAA\xBC", + "\xB7\x40" => "\xE5\xAA\xB3", + "\xB7\x41" => "\xE5\xAB\x82", + "\xB7\x42" => "\xE5\xAA\xB2", + "\xB7\x43" => "\xE5\xB5\xA9", + "\xB7\x44" => "\xE5\xB5\xAF", + "\xB7\x45" => "\xE5\xB9\x8C", + "\xB7\x46" => "\xE5\xB9\xB9", + "\xB7\x47" => "\xE5\xBB\x89", + "\xB7\x48" => "\xE5\xBB\x88", + "\xB7\x49" => "\xE5\xBC\x92", + "\xB7\x4A" => "\xE5\xBD\x99", + "\xB7\x4B" => "\xE5\xBE\xAC", + "\xB7\x4C" => "\xE5\xBE\xAE", + "\xB7\x4D" => "\xE6\x84\x9A", + "\xB7\x4E" => "\xE6\x84\x8F", + "\xB7\x4F" => "\xE6\x85\x88", + "\xB7\x50" => "\xE6\x84\x9F", + "\xB7\x51" => "\xE6\x83\xB3", + "\xB7\x52" => "\xE6\x84\x9B", + "\xB7\x53" => "\xE6\x83\xB9", + "\xB7\x54" => "\xE6\x84\x81", + "\xB7\x55" => "\xE6\x84\x88", + "\xB7\x56" => "\xE6\x85\x8E", + "\xB7\x57" => "\xE6\x85\x8C", + "\xB7\x58" => "\xE6\x85\x84", + "\xB7\x59" => "\xE6\x85\x8D", + "\xB7\x5A" => "\xE6\x84\xBE", + "\xB7\x5B" => "\xE6\x84\xB4", + "\xB7\x5C" => "\xE6\x84\xA7", + "\xB7\x5D" => "\xE6\x84\x8D", + "\xB7\x5E" => "\xE6\x84\x86", + "\xB7\x5F" => "\xE6\x84\xB7", + "\xB7\x60" => "\xE6\x88\xA1", + "\xB7\x61" => "\xE6\x88\xA2", + "\xB7\x62" => "\xE6\x90\x93", + "\xB7\x63" => "\xE6\x90\xBE", + "\xB7\x64" => "\xE6\x90\x9E", + "\xB7\x65" => "\xE6\x90\xAA", + "\xB7\x66" => "\xE6\x90\xAD", + "\xB7\x67" => "\xE6\x90\xBD", + "\xB7\x68" => "\xE6\x90\xAC", + "\xB7\x69" => "\xE6\x90\x8F", + "\xB7\x6A" => "\xE6\x90\x9C", + "\xB7\x6B" => "\xE6\x90\x94", + "\xB7\x6C" => "\xE6\x90\x8D", + "\xB7\x6D" => "\xE6\x90\xB6", + "\xB7\x6E" => "\xE6\x90\x96", + "\xB7\x6F" => "\xE6\x90\x97", + "\xB7\x70" => "\xE6\x90\x86", + "\xB7\x71" => "\xE6\x95\xAC", + "\xB7\x72" => "\xE6\x96\x9F", + "\xB7\x73" => "\xE6\x96\xB0", + "\xB7\x74" => "\xE6\x9A\x97", + "\xB7\x75" => "\xE6\x9A\x89", + "\xB7\x76" => "\xE6\x9A\x87", + "\xB7\x77" => "\xE6\x9A\x88", + "\xB7\x78" => "\xE6\x9A\x96", + "\xB7\x79" => "\xE6\x9A\x84", + "\xB7\x7A" => "\xE6\x9A\x98", + "\xB7\x7B" => "\xE6\x9A\x8D", + "\xB7\x7C" => "\xE6\x9C\x83", + "\xB7\x7D" => "\xE6\xA6\x94", + "\xB7\x7E" => "\xE6\xA5\xAD", + "\xB7\xA1" => "\xE6\xA5\x9A", + "\xB7\xA2" => "\xE6\xA5\xB7", + "\xB7\xA3" => "\xE6\xA5\xA0", + "\xB7\xA4" => "\xE6\xA5\x94", + "\xB7\xA5" => "\xE6\xA5\xB5", + "\xB7\xA6" => "\xE6\xA4\xB0", + "\xB7\xA7" => "\xE6\xA6\x82", + "\xB7\xA8" => "\xE6\xA5\x8A", + "\xB7\xA9" => "\xE6\xA5\xA8", + "\xB7\xAA" => "\xE6\xA5\xAB", + "\xB7\xAB" => "\xE6\xA5\x9E", + "\xB7\xAC" => "\xE6\xA5\x93", + "\xB7\xAD" => "\xE6\xA5\xB9", + "\xB7\xAE" => "\xE6\xA6\x86", + "\xB7\xAF" => "\xE6\xA5\x9D", + "\xB7\xB0" => "\xE6\xA5\xA3", + "\xB7\xB1" => "\xE6\xA5\x9B", + "\xB7\xB2" => "\xE6\xAD\x87", + "\xB7\xB3" => "\xE6\xAD\xB2", + "\xB7\xB4" => "\xE6\xAF\x80", + "\xB7\xB5" => "\xE6\xAE\xBF", + "\xB7\xB6" => "\xE6\xAF\x93", + "\xB7\xB7" => "\xE6\xAF\xBD", + "\xB7\xB8" => "\xE6\xBA\xA2", + "\xB7\xB9" => "\xE6\xBA\xAF", + "\xB7\xBA" => "\xE6\xBB\x93", + "\xB7\xBB" => "\xE6\xBA\xB6", + "\xB7\xBC" => "\xE6\xBB\x82", + "\xB7\xBD" => "\xE6\xBA\x90", + "\xB7\xBE" => "\xE6\xBA\x9D", + "\xB7\xBF" => "\xE6\xBB\x87", + "\xB7\xC0" => "\xE6\xBB\x85", + "\xB7\xC1" => "\xE6\xBA\xA5", + "\xB7\xC2" => "\xE6\xBA\x98", + "\xB7\xC3" => "\xE6\xBA\xBC", + "\xB7\xC4" => "\xE6\xBA\xBA", + "\xB7\xC5" => "\xE6\xBA\xAB", + "\xB7\xC6" => "\xE6\xBB\x91", + "\xB7\xC7" => "\xE6\xBA\x96", + "\xB7\xC8" => "\xE6\xBA\x9C", + "\xB7\xC9" => "\xE6\xBB\x84", + "\xB7\xCA" => "\xE6\xBB\x94", + "\xB7\xCB" => "\xE6\xBA\xAA", + "\xB7\xCC" => "\xE6\xBA\xA7", + "\xB7\xCD" => "\xE6\xBA\xB4", + "\xB7\xCE" => "\xE7\x85\x8E", + "\xB7\xCF" => "\xE7\x85\x99", + "\xB7\xD0" => "\xE7\x85\xA9", + "\xB7\xD1" => "\xE7\x85\xA4", + "\xB7\xD2" => "\xE7\x85\x89", + "\xB7\xD3" => "\xE7\x85\xA7", + "\xB7\xD4" => "\xE7\x85\x9C", + "\xB7\xD5" => "\xE7\x85\xAC", + "\xB7\xD6" => "\xE7\x85\xA6", + "\xB7\xD7" => "\xE7\x85\x8C", + "\xB7\xD8" => "\xE7\x85\xA5", + "\xB7\xD9" => "\xE7\x85\x9E", + "\xB7\xDA" => "\xE7\x85\x86", + "\xB7\xDB" => "\xE7\x85\xA8", + "\xB7\xDC" => "\xE7\x85\x96", + "\xB7\xDD" => "\xE7\x88\xBA", + "\xB7\xDE" => "\xE7\x89\x92", + "\xB7\xDF" => "\xE7\x8C\xB7", + "\xB7\xE0" => "\xE7\x8D\x85", + "\xB7\xE1" => "\xE7\x8C\xBF", + "\xB7\xE2" => "\xE7\x8C\xBE", + "\xB7\xE3" => "\xE7\x91\xAF", + "\xB7\xE4" => "\xE7\x91\x9A", + "\xB7\xE5" => "\xE7\x91\x95", + "\xB7\xE6" => "\xE7\x91\x9F", + "\xB7\xE7" => "\xE7\x91\x9E", + "\xB7\xE8" => "\xE7\x91\x81", + "\xB7\xE9" => "\xE7\x90\xBF", + "\xB7\xEA" => "\xE7\x91\x99", + "\xB7\xEB" => "\xE7\x91\x9B", + "\xB7\xEC" => "\xE7\x91\x9C", + "\xB7\xED" => "\xE7\x95\xB6", + "\xB7\xEE" => "\xE7\x95\xB8", + "\xB7\xEF" => "\xE7\x98\x80", + "\xB7\xF0" => "\xE7\x97\xB0", + "\xB7\xF1" => "\xE7\x98\x81", + "\xB7\xF2" => "\xE7\x97\xB2", + "\xB7\xF3" => "\xE7\x97\xB1", + "\xB7\xF4" => "\xE7\x97\xBA", + "\xB7\xF5" => "\xE7\x97\xBF", + "\xB7\xF6" => "\xE7\x97\xB4", + "\xB7\xF7" => "\xE7\x97\xB3", + "\xB7\xF8" => "\xE7\x9B\x9E", + "\xB7\xF9" => "\xE7\x9B\x9F", + "\xB7\xFA" => "\xE7\x9D\x9B", + "\xB7\xFB" => "\xE7\x9D\xAB", + "\xB7\xFC" => "\xE7\x9D\xA6", + "\xB7\xFD" => "\xE7\x9D\x9E", + "\xB7\xFE" => "\xE7\x9D\xA3", + "\xB8\x40" => "\xE7\x9D\xB9", + "\xB8\x41" => "\xE7\x9D\xAA", + "\xB8\x42" => "\xE7\x9D\xAC", + "\xB8\x43" => "\xE7\x9D\x9C", + "\xB8\x44" => "\xE7\x9D\xA5", + "\xB8\x45" => "\xE7\x9D\xA8", + "\xB8\x46" => "\xE7\x9D\xA2", + "\xB8\x47" => "\xE7\x9F\xAE", + "\xB8\x48" => "\xE7\xA2\x8E", + "\xB8\x49" => "\xE7\xA2\xB0", + "\xB8\x4A" => "\xE7\xA2\x97", + "\xB8\x4B" => "\xE7\xA2\x98", + "\xB8\x4C" => "\xE7\xA2\x8C", + "\xB8\x4D" => "\xE7\xA2\x89", + "\xB8\x4E" => "\xE7\xA1\xBC", + "\xB8\x4F" => "\xE7\xA2\x91", + "\xB8\x50" => "\xE7\xA2\x93", + "\xB8\x51" => "\xE7\xA1\xBF", + "\xB8\x52" => "\xE7\xA5\xBA", + "\xB8\x53" => "\xE7\xA5\xBF", + "\xB8\x54" => "\xE7\xA6\x81", + "\xB8\x55" => "\xE8\x90\xAC", + "\xB8\x56" => "\xE7\xA6\xBD", + "\xB8\x57" => "\xE7\xA8\x9C", + "\xB8\x58" => "\xE7\xA8\x9A", + "\xB8\x59" => "\xE7\xA8\xA0", + "\xB8\x5A" => "\xE7\xA8\x94", + "\xB8\x5B" => "\xE7\xA8\x9F", + "\xB8\x5C" => "\xE7\xA8\x9E", + "\xB8\x5D" => "\xE7\xAA\x9F", + "\xB8\x5E" => "\xE7\xAA\xA0", + "\xB8\x5F" => "\xE7\xAD\xB7", + "\xB8\x60" => "\xE7\xAF\x80", + "\xB8\x61" => "\xE7\xAD\xA0", + "\xB8\x62" => "\xE7\xAD\xAE", + "\xB8\x63" => "\xE7\xAD\xA7", + "\xB8\x64" => "\xE7\xB2\xB1", + "\xB8\x65" => "\xE7\xB2\xB3", + "\xB8\x66" => "\xE7\xB2\xB5", + "\xB8\x67" => "\xE7\xB6\x93", + "\xB8\x68" => "\xE7\xB5\xB9", + "\xB8\x69" => "\xE7\xB6\x91", + "\xB8\x6A" => "\xE7\xB6\x81", + "\xB8\x6B" => "\xE7\xB6\x8F", + "\xB8\x6C" => "\xE7\xB5\x9B", + "\xB8\x6D" => "\xE7\xBD\xAE", + "\xB8\x6E" => "\xE7\xBD\xA9", + "\xB8\x6F" => "\xE7\xBD\xAA", + "\xB8\x70" => "\xE7\xBD\xB2", + "\xB8\x71" => "\xE7\xBE\xA9", + "\xB8\x72" => "\xE7\xBE\xA8", + "\xB8\x73" => "\xE7\xBE\xA4", + "\xB8\x74" => "\xE8\x81\x96", + "\xB8\x75" => "\xE8\x81\x98", + "\xB8\x76" => "\xE8\x82\x86", + "\xB8\x77" => "\xE8\x82\x84", + "\xB8\x78" => "\xE8\x85\xB1", + "\xB8\x79" => "\xE8\x85\xB0", + "\xB8\x7A" => "\xE8\x85\xB8", + "\xB8\x7B" => "\xE8\x85\xA5", + "\xB8\x7C" => "\xE8\x85\xAE", + "\xB8\x7D" => "\xE8\x85\xB3", + "\xB8\x7E" => "\xE8\x85\xAB", + "\xB8\xA1" => "\xE8\x85\xB9", + "\xB8\xA2" => "\xE8\x85\xBA", + "\xB8\xA3" => "\xE8\x85\xA6", + "\xB8\xA4" => "\xE8\x88\x85", + "\xB8\xA5" => "\xE8\x89\x87", + "\xB8\xA6" => "\xE8\x92\x82", + "\xB8\xA7" => "\xE8\x91\xB7", + "\xB8\xA8" => "\xE8\x90\xBD", + "\xB8\xA9" => "\xE8\x90\xB1", + "\xB8\xAA" => "\xE8\x91\xB5", + "\xB8\xAB" => "\xE8\x91\xA6", + "\xB8\xAC" => "\xE8\x91\xAB", + "\xB8\xAD" => "\xE8\x91\x89", + "\xB8\xAE" => "\xE8\x91\xAC", + "\xB8\xAF" => "\xE8\x91\x9B", + "\xB8\xB0" => "\xE8\x90\xBC", + "\xB8\xB1" => "\xE8\x90\xB5", + "\xB8\xB2" => "\xE8\x91\xA1", + "\xB8\xB3" => "\xE8\x91\xA3", + "\xB8\xB4" => "\xE8\x91\xA9", + "\xB8\xB5" => "\xE8\x91\xAD", + "\xB8\xB6" => "\xE8\x91\x86", + "\xB8\xB7" => "\xE8\x99\x9E", + "\xB8\xB8" => "\xE8\x99\x9C", + "\xB8\xB9" => "\xE8\x99\x9F", + "\xB8\xBA" => "\xE8\x9B\xB9", + "\xB8\xBB" => "\xE8\x9C\x93", + "\xB8\xBC" => "\xE8\x9C\x88", + "\xB8\xBD" => "\xE8\x9C\x87", + "\xB8\xBE" => "\xE8\x9C\x80", + "\xB8\xBF" => "\xE8\x9B\xBE", + "\xB8\xC0" => "\xE8\x9B\xBB", + "\xB8\xC1" => "\xE8\x9C\x82", + "\xB8\xC2" => "\xE8\x9C\x83", + "\xB8\xC3" => "\xE8\x9C\x86", + "\xB8\xC4" => "\xE8\x9C\x8A", + "\xB8\xC5" => "\xE8\xA1\x99", + "\xB8\xC6" => "\xE8\xA3\x9F", + "\xB8\xC7" => "\xE8\xA3\x94", + "\xB8\xC8" => "\xE8\xA3\x99", + "\xB8\xC9" => "\xE8\xA3\x9C", + "\xB8\xCA" => "\xE8\xA3\x98", + "\xB8\xCB" => "\xE8\xA3\x9D", + "\xB8\xCC" => "\xE8\xA3\xA1", + "\xB8\xCD" => "\xE8\xA3\x8A", + "\xB8\xCE" => "\xE8\xA3\x95", + "\xB8\xCF" => "\xE8\xA3\x92", + "\xB8\xD0" => "\xE8\xA6\x9C", + "\xB8\xD1" => "\xE8\xA7\xA3", + "\xB8\xD2" => "\xE8\xA9\xAB", + "\xB8\xD3" => "\xE8\xA9\xB2", + "\xB8\xD4" => "\xE8\xA9\xB3", + "\xB8\xD5" => "\xE8\xA9\xA6", + "\xB8\xD6" => "\xE8\xA9\xA9", + "\xB8\xD7" => "\xE8\xA9\xB0", + "\xB8\xD8" => "\xE8\xAA\x87", + "\xB8\xD9" => "\xE8\xA9\xBC", + "\xB8\xDA" => "\xE8\xA9\xA3", + "\xB8\xDB" => "\xE8\xAA\xA0", + "\xB8\xDC" => "\xE8\xA9\xB1", + "\xB8\xDD" => "\xE8\xAA\x85", + "\xB8\xDE" => "\xE8\xA9\xAD", + "\xB8\xDF" => "\xE8\xA9\xA2", + "\xB8\xE0" => "\xE8\xA9\xAE", + "\xB8\xE1" => "\xE8\xA9\xAC", + "\xB8\xE2" => "\xE8\xA9\xB9", + "\xB8\xE3" => "\xE8\xA9\xBB", + "\xB8\xE4" => "\xE8\xA8\xBE", + "\xB8\xE5" => "\xE8\xA9\xA8", + "\xB8\xE6" => "\xE8\xB1\xA2", + "\xB8\xE7" => "\xE8\xB2\x8A", + "\xB8\xE8" => "\xE8\xB2\x89", + "\xB8\xE9" => "\xE8\xB3\x8A", + "\xB8\xEA" => "\xE8\xB3\x87", + "\xB8\xEB" => "\xE8\xB3\x88", + "\xB8\xEC" => "\xE8\xB3\x84", + "\xB8\xED" => "\xE8\xB2\xB2", + "\xB8\xEE" => "\xE8\xB3\x83", + "\xB8\xEF" => "\xE8\xB3\x82", + "\xB8\xF0" => "\xE8\xB3\x85", + "\xB8\xF1" => "\xE8\xB7\xA1", + "\xB8\xF2" => "\xE8\xB7\x9F", + "\xB8\xF3" => "\xE8\xB7\xA8", + "\xB8\xF4" => "\xE8\xB7\xAF", + "\xB8\xF5" => "\xE8\xB7\xB3", + "\xB8\xF6" => "\xE8\xB7\xBA", + "\xB8\xF7" => "\xE8\xB7\xAA", + "\xB8\xF8" => "\xE8\xB7\xA4", + "\xB8\xF9" => "\xE8\xB7\xA6", + "\xB8\xFA" => "\xE8\xBA\xB2", + "\xB8\xFB" => "\xE8\xBC\x83", + "\xB8\xFC" => "\xE8\xBC\x89", + "\xB8\xFD" => "\xE8\xBB\xBE", + "\xB8\xFE" => "\xE8\xBC\x8A", + "\xB9\x40" => "\xE8\xBE\x9F", + "\xB9\x41" => "\xE8\xBE\xB2", + "\xB9\x42" => "\xE9\x81\x8B", + "\xB9\x43" => "\xE9\x81\x8A", + "\xB9\x44" => "\xE9\x81\x93", + "\xB9\x45" => "\xE9\x81\x82", + "\xB9\x46" => "\xE9\x81\x94", + "\xB9\x47" => "\xE9\x80\xBC", + "\xB9\x48" => "\xE9\x81\x95", + "\xB9\x49" => "\xE9\x81\x90", + "\xB9\x4A" => "\xE9\x81\x87", + "\xB9\x4B" => "\xE9\x81\x8F", + "\xB9\x4C" => "\xE9\x81\x8E", + "\xB9\x4D" => "\xE9\x81\x8D", + "\xB9\x4E" => "\xE9\x81\x91", + "\xB9\x4F" => "\xE9\x80\xBE", + "\xB9\x50" => "\xE9\x81\x81", + "\xB9\x51" => "\xE9\x84\x92", + "\xB9\x52" => "\xE9\x84\x97", + "\xB9\x53" => "\xE9\x85\xAC", + "\xB9\x54" => "\xE9\x85\xAA", + "\xB9\x55" => "\xE9\x85\xA9", + "\xB9\x56" => "\xE9\x87\x89", + "\xB9\x57" => "\xE9\x88\xB7", + "\xB9\x58" => "\xE9\x89\x97", + "\xB9\x59" => "\xE9\x88\xB8", + "\xB9\x5A" => "\xE9\x88\xBD", + "\xB9\x5B" => "\xE9\x89\x80", + "\xB9\x5C" => "\xE9\x88\xBE", + "\xB9\x5D" => "\xE9\x89\x9B", + "\xB9\x5E" => "\xE9\x89\x8B", + "\xB9\x5F" => "\xE9\x89\xA4", + "\xB9\x60" => "\xE9\x89\x91", + "\xB9\x61" => "\xE9\x88\xB4", + "\xB9\x62" => "\xE9\x89\x89", + "\xB9\x63" => "\xE9\x89\x8D", + "\xB9\x64" => "\xE9\x89\x85", + "\xB9\x65" => "\xE9\x88\xB9", + "\xB9\x66" => "\xE9\x88\xBF", + "\xB9\x67" => "\xE9\x89\x9A", + "\xB9\x68" => "\xE9\x96\x98", + "\xB9\x69" => "\xE9\x9A\x98", + "\xB9\x6A" => "\xE9\x9A\x94", + "\xB9\x6B" => "\xE9\x9A\x95", + "\xB9\x6C" => "\xE9\x9B\x8D", + "\xB9\x6D" => "\xE9\x9B\x8B", + "\xB9\x6E" => "\xE9\x9B\x89", + "\xB9\x6F" => "\xE9\x9B\x8A", + "\xB9\x70" => "\xE9\x9B\xB7", + "\xB9\x71" => "\xE9\x9B\xBB", + "\xB9\x72" => "\xE9\x9B\xB9", + "\xB9\x73" => "\xE9\x9B\xB6", + "\xB9\x74" => "\xE9\x9D\x96", + "\xB9\x75" => "\xE9\x9D\xB4", + "\xB9\x76" => "\xE9\x9D\xB6", + "\xB9\x77" => "\xE9\xA0\x90", + "\xB9\x78" => "\xE9\xA0\x91", + "\xB9\x79" => "\xE9\xA0\x93", + "\xB9\x7A" => "\xE9\xA0\x8A", + "\xB9\x7B" => "\xE9\xA0\x92", + "\xB9\x7C" => "\xE9\xA0\x8C", + "\xB9\x7D" => "\xE9\xA3\xBC", + "\xB9\x7E" => "\xE9\xA3\xB4", + "\xB9\xA1" => "\xE9\xA3\xBD", + "\xB9\xA2" => "\xE9\xA3\xBE", + "\xB9\xA3" => "\xE9\xA6\xB3", + "\xB9\xA4" => "\xE9\xA6\xB1", + "\xB9\xA5" => "\xE9\xA6\xB4", + "\xB9\xA6" => "\xE9\xAB\xA1", + "\xB9\xA7" => "\xE9\xB3\xA9", + "\xB9\xA8" => "\xE9\xBA\x82", + "\xB9\xA9" => "\xE9\xBC\x8E", + "\xB9\xAA" => "\xE9\xBC\x93", + "\xB9\xAB" => "\xE9\xBC\xA0", + "\xB9\xAC" => "\xE5\x83\xA7", + "\xB9\xAD" => "\xE5\x83\xAE", + "\xB9\xAE" => "\xE5\x83\xA5", + "\xB9\xAF" => "\xE5\x83\x96", + "\xB9\xB0" => "\xE5\x83\xAD", + "\xB9\xB1" => "\xE5\x83\x9A", + "\xB9\xB2" => "\xE5\x83\x95", + "\xB9\xB3" => "\xE5\x83\x8F", + "\xB9\xB4" => "\xE5\x83\x91", + "\xB9\xB5" => "\xE5\x83\xB1", + "\xB9\xB6" => "\xE5\x83\x8E", + "\xB9\xB7" => "\xE5\x83\xA9", + "\xB9\xB8" => "\xE5\x85\xA2", + "\xB9\xB9" => "\xE5\x87\xB3", + "\xB9\xBA" => "\xE5\x8A\x83", + "\xB9\xBB" => "\xE5\x8A\x82", + "\xB9\xBC" => "\xE5\x8C\xB1", + "\xB9\xBD" => "\xE5\x8E\xAD", + "\xB9\xBE" => "\xE5\x97\xBE", + "\xB9\xBF" => "\xE5\x98\x80", + "\xB9\xC0" => "\xE5\x98\x9B", + "\xB9\xC1" => "\xE5\x98\x97", + "\xB9\xC2" => "\xE5\x97\xBD", + "\xB9\xC3" => "\xE5\x98\x94", + "\xB9\xC4" => "\xE5\x98\x86", + "\xB9\xC5" => "\xE5\x98\x89", + "\xB9\xC6" => "\xE5\x98\x8D", + "\xB9\xC7" => "\xE5\x98\x8E", + "\xB9\xC8" => "\xE5\x97\xB7", + "\xB9\xC9" => "\xE5\x98\x96", + "\xB9\xCA" => "\xE5\x98\x9F", + "\xB9\xCB" => "\xE5\x98\x88", + "\xB9\xCC" => "\xE5\x98\x90", + "\xB9\xCD" => "\xE5\x97\xB6", + "\xB9\xCE" => "\xE5\x9C\x98", + "\xB9\xCF" => "\xE5\x9C\x96", + "\xB9\xD0" => "\xE5\xA1\xB5", + "\xB9\xD1" => "\xE5\xA1\xBE", + "\xB9\xD2" => "\xE5\xA2\x83", + "\xB9\xD3" => "\xE5\xA2\x93", + "\xB9\xD4" => "\xE5\xA2\x8A", + "\xB9\xD5" => "\xE5\xA1\xB9", + "\xB9\xD6" => "\xE5\xA2\x85", + "\xB9\xD7" => "\xE5\xA1\xBD", + "\xB9\xD8" => "\xE5\xA3\xBD", + "\xB9\xD9" => "\xE5\xA4\xA5", + "\xB9\xDA" => "\xE5\xA4\xA2", + "\xB9\xDB" => "\xE5\xA4\xA4", + "\xB9\xDC" => "\xE5\xA5\xAA", + "\xB9\xDD" => "\xE5\xA5\xA9", + "\xB9\xDE" => "\xE5\xAB\xA1", + "\xB9\xDF" => "\xE5\xAB\xA6", + "\xB9\xE0" => "\xE5\xAB\xA9", + "\xB9\xE1" => "\xE5\xAB\x97", + "\xB9\xE2" => "\xE5\xAB\x96", + "\xB9\xE3" => "\xE5\xAB\x98", + "\xB9\xE4" => "\xE5\xAB\xA3", + "\xB9\xE5" => "\xE5\xAD\xB5", + "\xB9\xE6" => "\xE5\xAF\x9E", + "\xB9\xE7" => "\xE5\xAF\xA7", + "\xB9\xE8" => "\xE5\xAF\xA1", + "\xB9\xE9" => "\xE5\xAF\xA5", + "\xB9\xEA" => "\xE5\xAF\xA6", + "\xB9\xEB" => "\xE5\xAF\xA8", + "\xB9\xEC" => "\xE5\xAF\xA2", + "\xB9\xED" => "\xE5\xAF\xA4", + "\xB9\xEE" => "\xE5\xAF\x9F", + "\xB9\xEF" => "\xE5\xB0\x8D", + "\xB9\xF0" => "\xE5\xB1\xA2", + "\xB9\xF1" => "\xE5\xB6\x84", + "\xB9\xF2" => "\xE5\xB6\x87", + "\xB9\xF3" => "\xE5\xB9\x9B", + "\xB9\xF4" => "\xE5\xB9\xA3", + "\xB9\xF5" => "\xE5\xB9\x95", + "\xB9\xF6" => "\xE5\xB9\x97", + "\xB9\xF7" => "\xE5\xB9\x94", + "\xB9\xF8" => "\xE5\xBB\x93", + "\xB9\xF9" => "\xE5\xBB\x96", + "\xB9\xFA" => "\xE5\xBC\x8A", + "\xB9\xFB" => "\xE5\xBD\x86", + "\xB9\xFC" => "\xE5\xBD\xB0", + "\xB9\xFD" => "\xE5\xBE\xB9", + "\xB9\xFE" => "\xE6\x85\x87", + "\xBA\x40" => "\xE6\x84\xBF", + "\xBA\x41" => "\xE6\x85\x8B", + "\xBA\x42" => "\xE6\x85\xB7", + "\xBA\x43" => "\xE6\x85\xA2", + "\xBA\x44" => "\xE6\x85\xA3", + "\xBA\x45" => "\xE6\x85\x9F", + "\xBA\x46" => "\xE6\x85\x9A", + "\xBA\x47" => "\xE6\x85\x98", + "\xBA\x48" => "\xE6\x85\xB5", + "\xBA\x49" => "\xE6\x88\xAA", + "\xBA\x4A" => "\xE6\x92\x87", + "\xBA\x4B" => "\xE6\x91\x98", + "\xBA\x4C" => "\xE6\x91\x94", + "\xBA\x4D" => "\xE6\x92\xA4", + "\xBA\x4E" => "\xE6\x91\xB8", + "\xBA\x4F" => "\xE6\x91\x9F", + "\xBA\x50" => "\xE6\x91\xBA", + "\xBA\x51" => "\xE6\x91\x91", + "\xBA\x52" => "\xE6\x91\xA7", + "\xBA\x53" => "\xE6\x90\xB4", + "\xBA\x54" => "\xE6\x91\xAD", + "\xBA\x55" => "\xE6\x91\xBB", + "\xBA\x56" => "\xE6\x95\xB2", + "\xBA\x57" => "\xE6\x96\xA1", + "\xBA\x58" => "\xE6\x97\x97", + "\xBA\x59" => "\xE6\x97\x96", + "\xBA\x5A" => "\xE6\x9A\xA2", + "\xBA\x5B" => "\xE6\x9A\xA8", + "\xBA\x5C" => "\xE6\x9A\x9D", + "\xBA\x5D" => "\xE6\xA6\x9C", + "\xBA\x5E" => "\xE6\xA6\xA8", + "\xBA\x5F" => "\xE6\xA6\x95", + "\xBA\x60" => "\xE6\xA7\x81", + "\xBA\x61" => "\xE6\xA6\xAE", + "\xBA\x62" => "\xE6\xA7\x93", + "\xBA\x63" => "\xE6\xA7\x8B", + "\xBA\x64" => "\xE6\xA6\x9B", + "\xBA\x65" => "\xE6\xA6\xB7", + "\xBA\x66" => "\xE6\xA6\xBB", + "\xBA\x67" => "\xE6\xA6\xAB", + "\xBA\x68" => "\xE6\xA6\xB4", + "\xBA\x69" => "\xE6\xA7\x90", + "\xBA\x6A" => "\xE6\xA7\x8D", + "\xBA\x6B" => "\xE6\xA6\xAD", + "\xBA\x6C" => "\xE6\xA7\x8C", + "\xBA\x6D" => "\xE6\xA6\xA6", + "\xBA\x6E" => "\xE6\xA7\x83", + "\xBA\x6F" => "\xE6\xA6\xA3", + "\xBA\x70" => "\xE6\xAD\x89", + "\xBA\x71" => "\xE6\xAD\x8C", + "\xBA\x72" => "\xE6\xB0\xB3", + "\xBA\x73" => "\xE6\xBC\xB3", + "\xBA\x74" => "\xE6\xBC\x94", + "\xBA\x75" => "\xE6\xBB\xBE", + "\xBA\x76" => "\xE6\xBC\x93", + "\xBA\x77" => "\xE6\xBB\xB4", + "\xBA\x78" => "\xE6\xBC\xA9", + "\xBA\x79" => "\xE6\xBC\xBE", + "\xBA\x7A" => "\xE6\xBC\xA0", + "\xBA\x7B" => "\xE6\xBC\xAC", + "\xBA\x7C" => "\xE6\xBC\x8F", + "\xBA\x7D" => "\xE6\xBC\x82", + "\xBA\x7E" => "\xE6\xBC\xA2", + "\xBA\xA1" => "\xE6\xBB\xBF", + "\xBA\xA2" => "\xE6\xBB\xAF", + "\xBA\xA3" => "\xE6\xBC\x86", + "\xBA\xA4" => "\xE6\xBC\xB1", + "\xBA\xA5" => "\xE6\xBC\xB8", + "\xBA\xA6" => "\xE6\xBC\xB2", + "\xBA\xA7" => "\xE6\xBC\xA3", + "\xBA\xA8" => "\xE6\xBC\x95", + "\xBA\xA9" => "\xE6\xBC\xAB", + "\xBA\xAA" => "\xE6\xBC\xAF", + "\xBA\xAB" => "\xE6\xBE\x88", + "\xBA\xAC" => "\xE6\xBC\xAA", + "\xBA\xAD" => "\xE6\xBB\xAC", + "\xBA\xAE" => "\xE6\xBC\x81", + "\xBA\xAF" => "\xE6\xBB\xB2", + "\xBA\xB0" => "\xE6\xBB\x8C", + "\xBA\xB1" => "\xE6\xBB\xB7", + "\xBA\xB2" => "\xE7\x86\x94", + "\xBA\xB3" => "\xE7\x86\x99", + "\xBA\xB4" => "\xE7\x85\xBD", + "\xBA\xB5" => "\xE7\x86\x8A", + "\xBA\xB6" => "\xE7\x86\x84", + "\xBA\xB7" => "\xE7\x86\x92", + "\xBA\xB8" => "\xE7\x88\xBE", + "\xBA\xB9" => "\xE7\x8A\x92", + "\xBA\xBA" => "\xE7\x8A\x96", + "\xBA\xBB" => "\xE7\x8D\x84", + "\xBA\xBC" => "\xE7\x8D\x90", + "\xBA\xBD" => "\xE7\x91\xA4", + "\xBA\xBE" => "\xE7\x91\xA3", + "\xBA\xBF" => "\xE7\x91\xAA", + "\xBA\xC0" => "\xE7\x91\xB0", + "\xBA\xC1" => "\xE7\x91\xAD", + "\xBA\xC2" => "\xE7\x94\x84", + "\xBA\xC3" => "\xE7\x96\x91", + "\xBA\xC4" => "\xE7\x98\xA7", + "\xBA\xC5" => "\xE7\x98\x8D", + "\xBA\xC6" => "\xE7\x98\x8B", + "\xBA\xC7" => "\xE7\x98\x89", + "\xBA\xC8" => "\xE7\x98\x93", + "\xBA\xC9" => "\xE7\x9B\xA1", + "\xBA\xCA" => "\xE7\x9B\xA3", + "\xBA\xCB" => "\xE7\x9E\x84", + "\xBA\xCC" => "\xE7\x9D\xBD", + "\xBA\xCD" => "\xE7\x9D\xBF", + "\xBA\xCE" => "\xE7\x9D\xA1", + "\xBA\xCF" => "\xE7\xA3\x81", + "\xBA\xD0" => "\xE7\xA2\x9F", + "\xBA\xD1" => "\xE7\xA2\xA7", + "\xBA\xD2" => "\xE7\xA2\xB3", + "\xBA\xD3" => "\xE7\xA2\xA9", + "\xBA\xD4" => "\xE7\xA2\xA3", + "\xBA\xD5" => "\xE7\xA6\x8E", + "\xBA\xD6" => "\xE7\xA6\x8F", + "\xBA\xD7" => "\xE7\xA6\x8D", + "\xBA\xD8" => "\xE7\xA8\xAE", + "\xBA\xD9" => "\xE7\xA8\xB1", + "\xBA\xDA" => "\xE7\xAA\xAA", + "\xBA\xDB" => "\xE7\xAA\xA9", + "\xBA\xDC" => "\xE7\xAB\xAD", + "\xBA\xDD" => "\xE7\xAB\xAF", + "\xBA\xDE" => "\xE7\xAE\xA1", + "\xBA\xDF" => "\xE7\xAE\x95", + "\xBA\xE0" => "\xE7\xAE\x8B", + "\xBA\xE1" => "\xE7\xAD\xB5", + "\xBA\xE2" => "\xE7\xAE\x97", + "\xBA\xE3" => "\xE7\xAE\x9D", + "\xBA\xE4" => "\xE7\xAE\x94", + "\xBA\xE5" => "\xE7\xAE\x8F", + "\xBA\xE6" => "\xE7\xAE\xB8", + "\xBA\xE7" => "\xE7\xAE\x87", + "\xBA\xE8" => "\xE7\xAE\x84", + "\xBA\xE9" => "\xE7\xB2\xB9", + "\xBA\xEA" => "\xE7\xB2\xBD", + "\xBA\xEB" => "\xE7\xB2\xBE", + "\xBA\xEC" => "\xE7\xB6\xBB", + "\xBA\xED" => "\xE7\xB6\xB0", + "\xBA\xEE" => "\xE7\xB6\x9C", + "\xBA\xEF" => "\xE7\xB6\xBD", + "\xBA\xF0" => "\xE7\xB6\xBE", + "\xBA\xF1" => "\xE7\xB6\xA0", + "\xBA\xF2" => "\xE7\xB7\x8A", + "\xBA\xF3" => "\xE7\xB6\xB4", + "\xBA\xF4" => "\xE7\xB6\xB2", + "\xBA\xF5" => "\xE7\xB6\xB1", + "\xBA\xF6" => "\xE7\xB6\xBA", + "\xBA\xF7" => "\xE7\xB6\xA2", + "\xBA\xF8" => "\xE7\xB6\xBF", + "\xBA\xF9" => "\xE7\xB6\xB5", + "\xBA\xFA" => "\xE7\xB6\xB8", + "\xBA\xFB" => "\xE7\xB6\xAD", + "\xBA\xFC" => "\xE7\xB7\x92", + "\xBA\xFD" => "\xE7\xB7\x87", + "\xBA\xFE" => "\xE7\xB6\xAC", + "\xBB\x40" => "\xE7\xBD\xB0", + "\xBB\x41" => "\xE7\xBF\xA0", + "\xBB\x42" => "\xE7\xBF\xA1", + "\xBB\x43" => "\xE7\xBF\x9F", + "\xBB\x44" => "\xE8\x81\x9E", + "\xBB\x45" => "\xE8\x81\x9A", + "\xBB\x46" => "\xE8\x82\x87", + "\xBB\x47" => "\xE8\x85\x90", + "\xBB\x48" => "\xE8\x86\x80", + "\xBB\x49" => "\xE8\x86\x8F", + "\xBB\x4A" => "\xE8\x86\x88", + "\xBB\x4B" => "\xE8\x86\x8A", + "\xBB\x4C" => "\xE8\x85\xBF", + "\xBB\x4D" => "\xE8\x86\x82", + "\xBB\x4E" => "\xE8\x87\xA7", + "\xBB\x4F" => "\xE8\x87\xBA", + "\xBB\x50" => "\xE8\x88\x87", + "\xBB\x51" => "\xE8\x88\x94", + "\xBB\x52" => "\xE8\x88\x9E", + "\xBB\x53" => "\xE8\x89\x8B", + "\xBB\x54" => "\xE8\x93\x89", + "\xBB\x55" => "\xE8\x92\xBF", + "\xBB\x56" => "\xE8\x93\x86", + "\xBB\x57" => "\xE8\x93\x84", + "\xBB\x58" => "\xE8\x92\x99", + "\xBB\x59" => "\xE8\x92\x9E", + "\xBB\x5A" => "\xE8\x92\xB2", + "\xBB\x5B" => "\xE8\x92\x9C", + "\xBB\x5C" => "\xE8\x93\x8B", + "\xBB\x5D" => "\xE8\x92\xB8", + "\xBB\x5E" => "\xE8\x93\x80", + "\xBB\x5F" => "\xE8\x93\x93", + "\xBB\x60" => "\xE8\x92\x90", + "\xBB\x61" => "\xE8\x92\xBC", + "\xBB\x62" => "\xE8\x93\x91", + "\xBB\x63" => "\xE8\x93\x8A", + "\xBB\x64" => "\xE8\x9C\xBF", + "\xBB\x65" => "\xE8\x9C\x9C", + "\xBB\x66" => "\xE8\x9C\xBB", + "\xBB\x67" => "\xE8\x9C\xA2", + "\xBB\x68" => "\xE8\x9C\xA5", + "\xBB\x69" => "\xE8\x9C\xB4", + "\xBB\x6A" => "\xE8\x9C\x98", + "\xBB\x6B" => "\xE8\x9D\x95", + "\xBB\x6C" => "\xE8\x9C\xB7", + "\xBB\x6D" => "\xE8\x9C\xA9", + "\xBB\x6E" => "\xE8\xA3\xB3", + "\xBB\x6F" => "\xE8\xA4\x82", + "\xBB\x70" => "\xE8\xA3\xB4", + "\xBB\x71" => "\xE8\xA3\xB9", + "\xBB\x72" => "\xE8\xA3\xB8", + "\xBB\x73" => "\xE8\xA3\xBD", + "\xBB\x74" => "\xE8\xA3\xA8", + "\xBB\x75" => "\xE8\xA4\x9A", + "\xBB\x76" => "\xE8\xA3\xAF", + "\xBB\x77" => "\xE8\xAA\xA6", + "\xBB\x78" => "\xE8\xAA\x8C", + "\xBB\x79" => "\xE8\xAA\x9E", + "\xBB\x7A" => "\xE8\xAA\xA3", + "\xBB\x7B" => "\xE8\xAA\x8D", + "\xBB\x7C" => "\xE8\xAA\xA1", + "\xBB\x7D" => "\xE8\xAA\x93", + "\xBB\x7E" => "\xE8\xAA\xA4", + "\xBB\xA1" => "\xE8\xAA\xAA", + "\xBB\xA2" => "\xE8\xAA\xA5", + "\xBB\xA3" => "\xE8\xAA\xA8", + "\xBB\xA4" => "\xE8\xAA\x98", + "\xBB\xA5" => "\xE8\xAA\x91", + "\xBB\xA6" => "\xE8\xAA\x9A", + "\xBB\xA7" => "\xE8\xAA\xA7", + "\xBB\xA8" => "\xE8\xB1\xAA", + "\xBB\xA9" => "\xE8\xB2\x8D", + "\xBB\xAA" => "\xE8\xB2\x8C", + "\xBB\xAB" => "\xE8\xB3\x93", + "\xBB\xAC" => "\xE8\xB3\x91", + "\xBB\xAD" => "\xE8\xB3\x92", + "\xBB\xAE" => "\xE8\xB5\xAB", + "\xBB\xAF" => "\xE8\xB6\x99", + "\xBB\xB0" => "\xE8\xB6\x95", + "\xBB\xB1" => "\xE8\xB7\xBC", + "\xBB\xB2" => "\xE8\xBC\x94", + "\xBB\xB3" => "\xE8\xBC\x92", + "\xBB\xB4" => "\xE8\xBC\x95", + "\xBB\xB5" => "\xE8\xBC\x93", + "\xBB\xB6" => "\xE8\xBE\xA3", + "\xBB\xB7" => "\xE9\x81\xA0", + "\xBB\xB8" => "\xE9\x81\x98", + "\xBB\xB9" => "\xE9\x81\x9C", + "\xBB\xBA" => "\xE9\x81\xA3", + "\xBB\xBB" => "\xE9\x81\x99", + "\xBB\xBC" => "\xE9\x81\x9E", + "\xBB\xBD" => "\xE9\x81\xA2", + "\xBB\xBE" => "\xE9\x81\x9D", + "\xBB\xBF" => "\xE9\x81\x9B", + "\xBB\xC0" => "\xE9\x84\x99", + "\xBB\xC1" => "\xE9\x84\x98", + "\xBB\xC2" => "\xE9\x84\x9E", + "\xBB\xC3" => "\xE9\x85\xB5", + "\xBB\xC4" => "\xE9\x85\xB8", + "\xBB\xC5" => "\xE9\x85\xB7", + "\xBB\xC6" => "\xE9\x85\xB4", + "\xBB\xC7" => "\xE9\x89\xB8", + "\xBB\xC8" => "\xE9\x8A\x80", + "\xBB\xC9" => "\xE9\x8A\x85", + "\xBB\xCA" => "\xE9\x8A\x98", + "\xBB\xCB" => "\xE9\x8A\x96", + "\xBB\xCC" => "\xE9\x89\xBB", + "\xBB\xCD" => "\xE9\x8A\x93", + "\xBB\xCE" => "\xE9\x8A\x9C", + "\xBB\xCF" => "\xE9\x8A\xA8", + "\xBB\xD0" => "\xE9\x89\xBC", + "\xBB\xD1" => "\xE9\x8A\x91", + "\xBB\xD2" => "\xE9\x96\xA1", + "\xBB\xD3" => "\xE9\x96\xA8", + "\xBB\xD4" => "\xE9\x96\xA9", + "\xBB\xD5" => "\xE9\x96\xA3", + "\xBB\xD6" => "\xE9\x96\xA5", + "\xBB\xD7" => "\xE9\x96\xA4", + "\xBB\xD8" => "\xE9\x9A\x99", + "\xBB\xD9" => "\xE9\x9A\x9C", + "\xBB\xDA" => "\xE9\x9A\x9B", + "\xBB\xDB" => "\xE9\x9B\x8C", + "\xBB\xDC" => "\xE9\x9B\x92", + "\xBB\xDD" => "\xE9\x9C\x80", + "\xBB\xDE" => "\xE9\x9D\xBC", + "\xBB\xDF" => "\xE9\x9E\x85", + "\xBB\xE0" => "\xE9\x9F\xB6", + "\xBB\xE1" => "\xE9\xA0\x97", + "\xBB\xE2" => "\xE9\xA0\x98", + "\xBB\xE3" => "\xE9\xA2\xAF", + "\xBB\xE4" => "\xE9\xA2\xB1", + "\xBB\xE5" => "\xE9\xA4\x83", + "\xBB\xE6" => "\xE9\xA4\x85", + "\xBB\xE7" => "\xE9\xA4\x8C", + "\xBB\xE8" => "\xE9\xA4\x89", + "\xBB\xE9" => "\xE9\xA7\x81", + "\xBB\xEA" => "\xE9\xAA\xAF", + "\xBB\xEB" => "\xE9\xAA\xB0", + "\xBB\xEC" => "\xE9\xAB\xA6", + "\xBB\xED" => "\xE9\xAD\x81", + "\xBB\xEE" => "\xE9\xAD\x82", + "\xBB\xEF" => "\xE9\xB3\xB4", + "\xBB\xF0" => "\xE9\xB3\xB6", + "\xBB\xF1" => "\xE9\xB3\xB3", + "\xBB\xF2" => "\xE9\xBA\xBC", + "\xBB\xF3" => "\xE9\xBC\xBB", + "\xBB\xF4" => "\xE9\xBD\x8A", + "\xBB\xF5" => "\xE5\x84\x84", + "\xBB\xF6" => "\xE5\x84\x80", + "\xBB\xF7" => "\xE5\x83\xBB", + "\xBB\xF8" => "\xE5\x83\xB5", + "\xBB\xF9" => "\xE5\x83\xB9", + "\xBB\xFA" => "\xE5\x84\x82", + "\xBB\xFB" => "\xE5\x84\x88", + "\xBB\xFC" => "\xE5\x84\x89", + "\xBB\xFD" => "\xE5\x84\x85", + "\xBB\xFE" => "\xE5\x87\x9C", + "\xBC\x40" => "\xE5\x8A\x87", + "\xBC\x41" => "\xE5\x8A\x88", + "\xBC\x42" => "\xE5\x8A\x89", + "\xBC\x43" => "\xE5\x8A\x8D", + "\xBC\x44" => "\xE5\x8A\x8A", + "\xBC\x45" => "\xE5\x8B\xB0", + "\xBC\x46" => "\xE5\x8E\xB2", + "\xBC\x47" => "\xE5\x98\xAE", + "\xBC\x48" => "\xE5\x98\xBB", + "\xBC\x49" => "\xE5\x98\xB9", + "\xBC\x4A" => "\xE5\x98\xB2", + "\xBC\x4B" => "\xE5\x98\xBF", + "\xBC\x4C" => "\xE5\x98\xB4", + "\xBC\x4D" => "\xE5\x98\xA9", + "\xBC\x4E" => "\xE5\x99\x93", + "\xBC\x4F" => "\xE5\x99\x8E", + "\xBC\x50" => "\xE5\x99\x97", + "\xBC\x51" => "\xE5\x99\xB4", + "\xBC\x52" => "\xE5\x98\xB6", + "\xBC\x53" => "\xE5\x98\xAF", + "\xBC\x54" => "\xE5\x98\xB0", + "\xBC\x55" => "\xE5\xA2\x80", + "\xBC\x56" => "\xE5\xA2\x9F", + "\xBC\x57" => "\xE5\xA2\x9E", + "\xBC\x58" => "\xE5\xA2\xB3", + "\xBC\x59" => "\xE5\xA2\x9C", + "\xBC\x5A" => "\xE5\xA2\xAE", + "\xBC\x5B" => "\xE5\xA2\xA9", + "\xBC\x5C" => "\xE5\xA2\xA6", + "\xBC\x5D" => "\xE5\xA5\xAD", + "\xBC\x5E" => "\xE5\xAC\x89", + "\xBC\x5F" => "\xE5\xAB\xBB", + "\xBC\x60" => "\xE5\xAC\x8B", + "\xBC\x61" => "\xE5\xAB\xB5", + "\xBC\x62" => "\xE5\xAC\x8C", + "\xBC\x63" => "\xE5\xAC\x88", + "\xBC\x64" => "\xE5\xAF\xAE", + "\xBC\x65" => "\xE5\xAF\xAC", + "\xBC\x66" => "\xE5\xAF\xA9", + "\xBC\x67" => "\xE5\xAF\xAB", + "\xBC\x68" => "\xE5\xB1\xA4", + "\xBC\x69" => "\xE5\xB1\xA5", + "\xBC\x6A" => "\xE5\xB6\x9D", + "\xBC\x6B" => "\xE5\xB6\x94", + "\xBC\x6C" => "\xE5\xB9\xA2", + "\xBC\x6D" => "\xE5\xB9\x9F", + "\xBC\x6E" => "\xE5\xB9\xA1", + "\xBC\x6F" => "\xE5\xBB\xA2", + "\xBC\x70" => "\xE5\xBB\x9A", + "\xBC\x71" => "\xE5\xBB\x9F", + "\xBC\x72" => "\xE5\xBB\x9D", + "\xBC\x73" => "\xE5\xBB\xA3", + "\xBC\x74" => "\xE5\xBB\xA0", + "\xBC\x75" => "\xE5\xBD\x88", + "\xBC\x76" => "\xE5\xBD\xB1", + "\xBC\x77" => "\xE5\xBE\xB7", + "\xBC\x78" => "\xE5\xBE\xB5", + "\xBC\x79" => "\xE6\x85\xB6", + "\xBC\x7A" => "\xE6\x85\xA7", + "\xBC\x7B" => "\xE6\x85\xAE", + "\xBC\x7C" => "\xE6\x85\x9D", + "\xBC\x7D" => "\xE6\x85\x95", + "\xBC\x7E" => "\xE6\x86\x82", + "\xBC\xA1" => "\xE6\x85\xBC", + "\xBC\xA2" => "\xE6\x85\xB0", + "\xBC\xA3" => "\xE6\x85\xAB", + "\xBC\xA4" => "\xE6\x85\xBE", + "\xBC\xA5" => "\xE6\x86\xA7", + "\xBC\xA6" => "\xE6\x86\x90", + "\xBC\xA7" => "\xE6\x86\xAB", + "\xBC\xA8" => "\xE6\x86\x8E", + "\xBC\xA9" => "\xE6\x86\xAC", + "\xBC\xAA" => "\xE6\x86\x9A", + "\xBC\xAB" => "\xE6\x86\xA4", + "\xBC\xAC" => "\xE6\x86\x94", + "\xBC\xAD" => "\xE6\x86\xAE", + "\xBC\xAE" => "\xE6\x88\xAE", + "\xBC\xAF" => "\xE6\x91\xA9", + "\xBC\xB0" => "\xE6\x91\xAF", + "\xBC\xB1" => "\xE6\x91\xB9", + "\xBC\xB2" => "\xE6\x92\x9E", + "\xBC\xB3" => "\xE6\x92\xB2", + "\xBC\xB4" => "\xE6\x92\x88", + "\xBC\xB5" => "\xE6\x92\x90", + "\xBC\xB6" => "\xE6\x92\xB0", + "\xBC\xB7" => "\xE6\x92\xA5", + "\xBC\xB8" => "\xE6\x92\x93", + "\xBC\xB9" => "\xE6\x92\x95", + "\xBC\xBA" => "\xE6\x92\xA9", + "\xBC\xBB" => "\xE6\x92\x92", + "\xBC\xBC" => "\xE6\x92\xAE", + "\xBC\xBD" => "\xE6\x92\xAD", + "\xBC\xBE" => "\xE6\x92\xAB", + "\xBC\xBF" => "\xE6\x92\x9A", + "\xBC\xC0" => "\xE6\x92\xAC", + "\xBC\xC1" => "\xE6\x92\x99", + "\xBC\xC2" => "\xE6\x92\xA2", + "\xBC\xC3" => "\xE6\x92\xB3", + "\xBC\xC4" => "\xE6\x95\xB5", + "\xBC\xC5" => "\xE6\x95\xB7", + "\xBC\xC6" => "\xE6\x95\xB8", + "\xBC\xC7" => "\xE6\x9A\xAE", + "\xBC\xC8" => "\xE6\x9A\xAB", + "\xBC\xC9" => "\xE6\x9A\xB4", + "\xBC\xCA" => "\xE6\x9A\xB1", + "\xBC\xCB" => "\xE6\xA8\xA3", + "\xBC\xCC" => "\xE6\xA8\x9F", + "\xBC\xCD" => "\xE6\xA7\xA8", + "\xBC\xCE" => "\xE6\xA8\x81", + "\xBC\xCF" => "\xE6\xA8\x9E", + "\xBC\xD0" => "\xE6\xA8\x99", + "\xBC\xD1" => "\xE6\xA7\xBD", + "\xBC\xD2" => "\xE6\xA8\xA1", + "\xBC\xD3" => "\xE6\xA8\x93", + "\xBC\xD4" => "\xE6\xA8\x8A", + "\xBC\xD5" => "\xE6\xA7\xB3", + "\xBC\xD6" => "\xE6\xA8\x82", + "\xBC\xD7" => "\xE6\xA8\x85", + "\xBC\xD8" => "\xE6\xA7\xAD", + "\xBC\xD9" => "\xE6\xA8\x91", + "\xBC\xDA" => "\xE6\xAD\x90", + "\xBC\xDB" => "\xE6\xAD\x8E", + "\xBC\xDC" => "\xE6\xAE\xA4", + "\xBC\xDD" => "\xE6\xAF\x85", + "\xBC\xDE" => "\xE6\xAF\x86", + "\xBC\xDF" => "\xE6\xBC\xBF", + "\xBC\xE0" => "\xE6\xBD\xBC", + "\xBC\xE1" => "\xE6\xBE\x84", + "\xBC\xE2" => "\xE6\xBD\x91", + "\xBC\xE3" => "\xE6\xBD\xA6", + "\xBC\xE4" => "\xE6\xBD\x94", + "\xBC\xE5" => "\xE6\xBE\x86", + "\xBC\xE6" => "\xE6\xBD\xAD", + "\xBC\xE7" => "\xE6\xBD\x9B", + "\xBC\xE8" => "\xE6\xBD\xB8", + "\xBC\xE9" => "\xE6\xBD\xAE", + "\xBC\xEA" => "\xE6\xBE\x8E", + "\xBC\xEB" => "\xE6\xBD\xBA", + "\xBC\xEC" => "\xE6\xBD\xB0", + "\xBC\xED" => "\xE6\xBD\xA4", + "\xBC\xEE" => "\xE6\xBE\x97", + "\xBC\xEF" => "\xE6\xBD\x98", + "\xBC\xF0" => "\xE6\xBB\x95", + "\xBC\xF1" => "\xE6\xBD\xAF", + "\xBC\xF2" => "\xE6\xBD\xA0", + "\xBC\xF3" => "\xE6\xBD\x9F", + "\xBC\xF4" => "\xE7\x86\x9F", + "\xBC\xF5" => "\xE7\x86\xAC", + "\xBC\xF6" => "\xE7\x86\xB1", + "\xBC\xF7" => "\xE7\x86\xA8", + "\xBC\xF8" => "\xE7\x89\x96", + "\xBC\xF9" => "\xE7\x8A\x9B", + "\xBC\xFA" => "\xE7\x8D\x8E", + "\xBC\xFB" => "\xE7\x8D\x97", + "\xBC\xFC" => "\xE7\x91\xA9", + "\xBC\xFD" => "\xE7\x92\x8B", + "\xBC\xFE" => "\xE7\x92\x83", + "\xBD\x40" => "\xE7\x91\xBE", + "\xBD\x41" => "\xE7\x92\x80", + "\xBD\x42" => "\xE7\x95\xBF", + "\xBD\x43" => "\xE7\x98\xA0", + "\xBD\x44" => "\xE7\x98\xA9", + "\xBD\x45" => "\xE7\x98\x9F", + "\xBD\x46" => "\xE7\x98\xA4", + "\xBD\x47" => "\xE7\x98\xA6", + "\xBD\x48" => "\xE7\x98\xA1", + "\xBD\x49" => "\xE7\x98\xA2", + "\xBD\x4A" => "\xE7\x9A\x9A", + "\xBD\x4B" => "\xE7\x9A\xBA", + "\xBD\x4C" => "\xE7\x9B\xA4", + "\xBD\x4D" => "\xE7\x9E\x8E", + "\xBD\x4E" => "\xE7\x9E\x87", + "\xBD\x4F" => "\xE7\x9E\x8C", + "\xBD\x50" => "\xE7\x9E\x91", + "\xBD\x51" => "\xE7\x9E\x8B", + "\xBD\x52" => "\xE7\xA3\x8B", + "\xBD\x53" => "\xE7\xA3\x85", + "\xBD\x54" => "\xE7\xA2\xBA", + "\xBD\x55" => "\xE7\xA3\x8A", + "\xBD\x56" => "\xE7\xA2\xBE", + "\xBD\x57" => "\xE7\xA3\x95", + "\xBD\x58" => "\xE7\xA2\xBC", + "\xBD\x59" => "\xE7\xA3\x90", + "\xBD\x5A" => "\xE7\xA8\xBF", + "\xBD\x5B" => "\xE7\xA8\xBC", + "\xBD\x5C" => "\xE7\xA9\x80", + "\xBD\x5D" => "\xE7\xA8\xBD", + "\xBD\x5E" => "\xE7\xA8\xB7", + "\xBD\x5F" => "\xE7\xA8\xBB", + "\xBD\x60" => "\xE7\xAA\xAF", + "\xBD\x61" => "\xE7\xAA\xAE", + "\xBD\x62" => "\xE7\xAE\xAD", + "\xBD\x63" => "\xE7\xAE\xB1", + "\xBD\x64" => "\xE7\xAF\x84", + "\xBD\x65" => "\xE7\xAE\xB4", + "\xBD\x66" => "\xE7\xAF\x86", + "\xBD\x67" => "\xE7\xAF\x87", + "\xBD\x68" => "\xE7\xAF\x81", + "\xBD\x69" => "\xE7\xAE\xA0", + "\xBD\x6A" => "\xE7\xAF\x8C", + "\xBD\x6B" => "\xE7\xB3\x8A", + "\xBD\x6C" => "\xE7\xB7\xA0", + "\xBD\x6D" => "\xE7\xB7\xB4", + "\xBD\x6E" => "\xE7\xB7\xAF", + "\xBD\x6F" => "\xE7\xB7\xBB", + "\xBD\x70" => "\xE7\xB7\x98", + "\xBD\x71" => "\xE7\xB7\xAC", + "\xBD\x72" => "\xE7\xB7\x9D", + "\xBD\x73" => "\xE7\xB7\xA8", + "\xBD\x74" => "\xE7\xB7\xA3", + "\xBD\x75" => "\xE7\xB7\x9A", + "\xBD\x76" => "\xE7\xB7\x9E", + "\xBD\x77" => "\xE7\xB7\xA9", + "\xBD\x78" => "\xE7\xB6\x9E", + "\xBD\x79" => "\xE7\xB7\x99", + "\xBD\x7A" => "\xE7\xB7\xB2", + "\xBD\x7B" => "\xE7\xB7\xB9", + "\xBD\x7C" => "\xE7\xBD\xB5", + "\xBD\x7D" => "\xE7\xBD\xB7", + "\xBD\x7E" => "\xE7\xBE\xAF", + "\xBD\xA1" => "\xE7\xBF\xA9", + "\xBD\xA2" => "\xE8\x80\xA6", + "\xBD\xA3" => "\xE8\x86\x9B", + "\xBD\xA4" => "\xE8\x86\x9C", + "\xBD\xA5" => "\xE8\x86\x9D", + "\xBD\xA6" => "\xE8\x86\xA0", + "\xBD\xA7" => "\xE8\x86\x9A", + "\xBD\xA8" => "\xE8\x86\x98", + "\xBD\xA9" => "\xE8\x94\x97", + "\xBD\xAA" => "\xE8\x94\xBD", + "\xBD\xAB" => "\xE8\x94\x9A", + "\xBD\xAC" => "\xE8\x93\xAE", + "\xBD\xAD" => "\xE8\x94\xAC", + "\xBD\xAE" => "\xE8\x94\xAD", + "\xBD\xAF" => "\xE8\x94\x93", + "\xBD\xB0" => "\xE8\x94\x91", + "\xBD\xB1" => "\xE8\x94\xA3", + "\xBD\xB2" => "\xE8\x94\xA1", + "\xBD\xB3" => "\xE8\x94\x94", + "\xBD\xB4" => "\xE8\x93\xAC", + "\xBD\xB5" => "\xE8\x94\xA5", + "\xBD\xB6" => "\xE8\x93\xBF", + "\xBD\xB7" => "\xE8\x94\x86", + "\xBD\xB8" => "\xE8\x9E\x82", + "\xBD\xB9" => "\xE8\x9D\xB4", + "\xBD\xBA" => "\xE8\x9D\xB6", + "\xBD\xBB" => "\xE8\x9D\xA0", + "\xBD\xBC" => "\xE8\x9D\xA6", + "\xBD\xBD" => "\xE8\x9D\xB8", + "\xBD\xBE" => "\xE8\x9D\xA8", + "\xBD\xBF" => "\xE8\x9D\x99", + "\xBD\xC0" => "\xE8\x9D\x97", + "\xBD\xC1" => "\xE8\x9D\x8C", + "\xBD\xC2" => "\xE8\x9D\x93", + "\xBD\xC3" => "\xE8\xA1\x9B", + "\xBD\xC4" => "\xE8\xA1\x9D", + "\xBD\xC5" => "\xE8\xA4\x90", + "\xBD\xC6" => "\xE8\xA4\x87", + "\xBD\xC7" => "\xE8\xA4\x92", + "\xBD\xC8" => "\xE8\xA4\x93", + "\xBD\xC9" => "\xE8\xA4\x95", + "\xBD\xCA" => "\xE8\xA4\x8A", + "\xBD\xCB" => "\xE8\xAA\xBC", + "\xBD\xCC" => "\xE8\xAB\x92", + "\xBD\xCD" => "\xE8\xAB\x87", + "\xBD\xCE" => "\xE8\xAB\x84", + "\xBD\xCF" => "\xE8\xAA\x95", + "\xBD\xD0" => "\xE8\xAB\x8B", + "\xBD\xD1" => "\xE8\xAB\xB8", + "\xBD\xD2" => "\xE8\xAA\xB2", + "\xBD\xD3" => "\xE8\xAB\x89", + "\xBD\xD4" => "\xE8\xAB\x82", + "\xBD\xD5" => "\xE8\xAA\xBF", + "\xBD\xD6" => "\xE8\xAA\xB0", + "\xBD\xD7" => "\xE8\xAB\x96", + "\xBD\xD8" => "\xE8\xAB\x8D", + "\xBD\xD9" => "\xE8\xAA\xB6", + "\xBD\xDA" => "\xE8\xAA\xB9", + "\xBD\xDB" => "\xE8\xAB\x9B", + "\xBD\xDC" => "\xE8\xB1\x8C", + "\xBD\xDD" => "\xE8\xB1\x8E", + "\xBD\xDE" => "\xE8\xB1\xAC", + "\xBD\xDF" => "\xE8\xB3\xA0", + "\xBD\xE0" => "\xE8\xB3\x9E", + "\xBD\xE1" => "\xE8\xB3\xA6", + "\xBD\xE2" => "\xE8\xB3\xA4", + "\xBD\xE3" => "\xE8\xB3\xAC", + "\xBD\xE4" => "\xE8\xB3\xAD", + "\xBD\xE5" => "\xE8\xB3\xA2", + "\xBD\xE6" => "\xE8\xB3\xA3", + "\xBD\xE7" => "\xE8\xB3\x9C", + "\xBD\xE8" => "\xE8\xB3\xAA", + "\xBD\xE9" => "\xE8\xB3\xA1", + "\xBD\xEA" => "\xE8\xB5\xAD", + "\xBD\xEB" => "\xE8\xB6\x9F", + "\xBD\xEC" => "\xE8\xB6\xA3", + "\xBD\xED" => "\xE8\xB8\xAB", + "\xBD\xEE" => "\xE8\xB8\x90", + "\xBD\xEF" => "\xE8\xB8\x9D", + "\xBD\xF0" => "\xE8\xB8\xA2", + "\xBD\xF1" => "\xE8\xB8\x8F", + "\xBD\xF2" => "\xE8\xB8\xA9", + "\xBD\xF3" => "\xE8\xB8\x9F", + "\xBD\xF4" => "\xE8\xB8\xA1", + "\xBD\xF5" => "\xE8\xB8\x9E", + "\xBD\xF6" => "\xE8\xBA\xBA", + "\xBD\xF7" => "\xE8\xBC\x9D", + "\xBD\xF8" => "\xE8\xBC\x9B", + "\xBD\xF9" => "\xE8\xBC\x9F", + "\xBD\xFA" => "\xE8\xBC\xA9", + "\xBD\xFB" => "\xE8\xBC\xA6", + "\xBD\xFC" => "\xE8\xBC\xAA", + "\xBD\xFD" => "\xE8\xBC\x9C", + "\xBD\xFE" => "\xE8\xBC\x9E", + "\xBE\x40" => "\xE8\xBC\xA5", + "\xBE\x41" => "\xE9\x81\xA9", + "\xBE\x42" => "\xE9\x81\xAE", + "\xBE\x43" => "\xE9\x81\xA8", + "\xBE\x44" => "\xE9\x81\xAD", + "\xBE\x45" => "\xE9\x81\xB7", + "\xBE\x46" => "\xE9\x84\xB0", + "\xBE\x47" => "\xE9\x84\xAD", + "\xBE\x48" => "\xE9\x84\xA7", + "\xBE\x49" => "\xE9\x84\xB1", + "\xBE\x4A" => "\xE9\x86\x87", + "\xBE\x4B" => "\xE9\x86\x89", + "\xBE\x4C" => "\xE9\x86\x8B", + "\xBE\x4D" => "\xE9\x86\x83", + "\xBE\x4E" => "\xE9\x8B\x85", + "\xBE\x4F" => "\xE9\x8A\xBB", + "\xBE\x50" => "\xE9\x8A\xB7", + "\xBE\x51" => "\xE9\x8B\xAA", + "\xBE\x52" => "\xE9\x8A\xAC", + "\xBE\x53" => "\xE9\x8B\xA4", + "\xBE\x54" => "\xE9\x8B\x81", + "\xBE\x55" => "\xE9\x8A\xB3", + "\xBE\x56" => "\xE9\x8A\xBC", + "\xBE\x57" => "\xE9\x8B\x92", + "\xBE\x58" => "\xE9\x8B\x87", + "\xBE\x59" => "\xE9\x8B\xB0", + "\xBE\x5A" => "\xE9\x8A\xB2", + "\xBE\x5B" => "\xE9\x96\xAD", + "\xBE\x5C" => "\xE9\x96\xB1", + "\xBE\x5D" => "\xE9\x9C\x84", + "\xBE\x5E" => "\xE9\x9C\x86", + "\xBE\x5F" => "\xE9\x9C\x87", + "\xBE\x60" => "\xE9\x9C\x89", + "\xBE\x61" => "\xE9\x9D\xA0", + "\xBE\x62" => "\xE9\x9E\x8D", + "\xBE\x63" => "\xE9\x9E\x8B", + "\xBE\x64" => "\xE9\x9E\x8F", + "\xBE\x65" => "\xE9\xA0\xA1", + "\xBE\x66" => "\xE9\xA0\xAB", + "\xBE\x67" => "\xE9\xA0\x9C", + "\xBE\x68" => "\xE9\xA2\xB3", + "\xBE\x69" => "\xE9\xA4\x8A", + "\xBE\x6A" => "\xE9\xA4\x93", + "\xBE\x6B" => "\xE9\xA4\x92", + "\xBE\x6C" => "\xE9\xA4\x98", + "\xBE\x6D" => "\xE9\xA7\x9D", + "\xBE\x6E" => "\xE9\xA7\x90", + "\xBE\x6F" => "\xE9\xA7\x9F", + "\xBE\x70" => "\xE9\xA7\x9B", + "\xBE\x71" => "\xE9\xA7\x91", + "\xBE\x72" => "\xE9\xA7\x95", + "\xBE\x73" => "\xE9\xA7\x92", + "\xBE\x74" => "\xE9\xA7\x99", + "\xBE\x75" => "\xE9\xAA\xB7", + "\xBE\x76" => "\xE9\xAB\xAE", + "\xBE\x77" => "\xE9\xAB\xAF", + "\xBE\x78" => "\xE9\xAC\xA7", + "\xBE\x79" => "\xE9\xAD\x85", + "\xBE\x7A" => "\xE9\xAD\x84", + "\xBE\x7B" => "\xE9\xAD\xB7", + "\xBE\x7C" => "\xE9\xAD\xAF", + "\xBE\x7D" => "\xE9\xB4\x86", + "\xBE\x7E" => "\xE9\xB4\x89", + "\xBE\xA1" => "\xE9\xB4\x83", + "\xBE\xA2" => "\xE9\xBA\xA9", + "\xBE\xA3" => "\xE9\xBA\xBE", + "\xBE\xA4" => "\xE9\xBB\x8E", + "\xBE\xA5" => "\xE5\xA2\xA8", + "\xBE\xA6" => "\xE9\xBD\x92", + "\xBE\xA7" => "\xE5\x84\x92", + "\xBE\xA8" => "\xE5\x84\x98", + "\xBE\xA9" => "\xE5\x84\x94", + "\xBE\xAA" => "\xE5\x84\x90", + "\xBE\xAB" => "\xE5\x84\x95", + "\xBE\xAC" => "\xE5\x86\x80", + "\xBE\xAD" => "\xE5\x86\xAA", + "\xBE\xAE" => "\xE5\x87\x9D", + "\xBE\xAF" => "\xE5\x8A\x91", + "\xBE\xB0" => "\xE5\x8A\x93", + "\xBE\xB1" => "\xE5\x8B\xB3", + "\xBE\xB2" => "\xE5\x99\x99", + "\xBE\xB3" => "\xE5\x99\xAB", + "\xBE\xB4" => "\xE5\x99\xB9", + "\xBE\xB5" => "\xE5\x99\xA9", + "\xBE\xB6" => "\xE5\x99\xA4", + "\xBE\xB7" => "\xE5\x99\xB8", + "\xBE\xB8" => "\xE5\x99\xAA", + "\xBE\xB9" => "\xE5\x99\xA8", + "\xBE\xBA" => "\xE5\x99\xA5", + "\xBE\xBB" => "\xE5\x99\xB1", + "\xBE\xBC" => "\xE5\x99\xAF", + "\xBE\xBD" => "\xE5\x99\xAC", + "\xBE\xBE" => "\xE5\x99\xA2", + "\xBE\xBF" => "\xE5\x99\xB6", + "\xBE\xC0" => "\xE5\xA3\x81", + "\xBE\xC1" => "\xE5\xA2\xBE", + "\xBE\xC2" => "\xE5\xA3\x87", + "\xBE\xC3" => "\xE5\xA3\x85", + "\xBE\xC4" => "\xE5\xA5\xAE", + "\xBE\xC5" => "\xE5\xAC\x9D", + "\xBE\xC6" => "\xE5\xAC\xB4", + "\xBE\xC7" => "\xE5\xAD\xB8", + "\xBE\xC8" => "\xE5\xAF\xB0", + "\xBE\xC9" => "\xE5\xB0\x8E", + "\xBE\xCA" => "\xE5\xBD\x8A", + "\xBE\xCB" => "\xE6\x86\xB2", + "\xBE\xCC" => "\xE6\x86\x91", + "\xBE\xCD" => "\xE6\x86\xA9", + "\xBE\xCE" => "\xE6\x86\x8A", + "\xBE\xCF" => "\xE6\x87\x8D", + "\xBE\xD0" => "\xE6\x86\xB6", + "\xBE\xD1" => "\xE6\x86\xBE", + "\xBE\xD2" => "\xE6\x87\x8A", + "\xBE\xD3" => "\xE6\x87\x88", + "\xBE\xD4" => "\xE6\x88\xB0", + "\xBE\xD5" => "\xE6\x93\x85", + "\xBE\xD6" => "\xE6\x93\x81", + "\xBE\xD7" => "\xE6\x93\x8B", + "\xBE\xD8" => "\xE6\x92\xBB", + "\xBE\xD9" => "\xE6\x92\xBC", + "\xBE\xDA" => "\xE6\x93\x9A", + "\xBE\xDB" => "\xE6\x93\x84", + "\xBE\xDC" => "\xE6\x93\x87", + "\xBE\xDD" => "\xE6\x93\x82", + "\xBE\xDE" => "\xE6\x93\x8D", + "\xBE\xDF" => "\xE6\x92\xBF", + "\xBE\xE0" => "\xE6\x93\x92", + "\xBE\xE1" => "\xE6\x93\x94", + "\xBE\xE2" => "\xE6\x92\xBE", + "\xBE\xE3" => "\xE6\x95\xB4", + "\xBE\xE4" => "\xE6\x9B\x86", + "\xBE\xE5" => "\xE6\x9B\x89", + "\xBE\xE6" => "\xE6\x9A\xB9", + "\xBE\xE7" => "\xE6\x9B\x84", + "\xBE\xE8" => "\xE6\x9B\x87", + "\xBE\xE9" => "\xE6\x9A\xB8", + "\xBE\xEA" => "\xE6\xA8\xBD", + "\xBE\xEB" => "\xE6\xA8\xB8", + "\xBE\xEC" => "\xE6\xA8\xBA", + "\xBE\xED" => "\xE6\xA9\x99", + "\xBE\xEE" => "\xE6\xA9\xAB", + "\xBE\xEF" => "\xE6\xA9\x98", + "\xBE\xF0" => "\xE6\xA8\xB9", + "\xBE\xF1" => "\xE6\xA9\x84", + "\xBE\xF2" => "\xE6\xA9\xA2", + "\xBE\xF3" => "\xE6\xA9\xA1", + "\xBE\xF4" => "\xE6\xA9\x8B", + "\xBE\xF5" => "\xE6\xA9\x87", + "\xBE\xF6" => "\xE6\xA8\xB5", + "\xBE\xF7" => "\xE6\xA9\x9F", + "\xBE\xF8" => "\xE6\xA9\x88", + "\xBE\xF9" => "\xE6\xAD\x99", + "\xBE\xFA" => "\xE6\xAD\xB7", + "\xBE\xFB" => "\xE6\xB0\x85", + "\xBE\xFC" => "\xE6\xBF\x82", + "\xBE\xFD" => "\xE6\xBE\xB1", + "\xBE\xFE" => "\xE6\xBE\xA1", + "\xBF\x40" => "\xE6\xBF\x83", + "\xBF\x41" => "\xE6\xBE\xA4", + "\xBF\x42" => "\xE6\xBF\x81", + "\xBF\x43" => "\xE6\xBE\xA7", + "\xBF\x44" => "\xE6\xBE\xB3", + "\xBF\x45" => "\xE6\xBF\x80", + "\xBF\x46" => "\xE6\xBE\xB9", + "\xBF\x47" => "\xE6\xBE\xB6", + "\xBF\x48" => "\xE6\xBE\xA6", + "\xBF\x49" => "\xE6\xBE\xA0", + "\xBF\x4A" => "\xE6\xBE\xB4", + "\xBF\x4B" => "\xE7\x86\xBE", + "\xBF\x4C" => "\xE7\x87\x89", + "\xBF\x4D" => "\xE7\x87\x90", + "\xBF\x4E" => "\xE7\x87\x92", + "\xBF\x4F" => "\xE7\x87\x88", + "\xBF\x50" => "\xE7\x87\x95", + "\xBF\x51" => "\xE7\x86\xB9", + "\xBF\x52" => "\xE7\x87\x8E", + "\xBF\x53" => "\xE7\x87\x99", + "\xBF\x54" => "\xE7\x87\x9C", + "\xBF\x55" => "\xE7\x87\x83", + "\xBF\x56" => "\xE7\x87\x84", + "\xBF\x57" => "\xE7\x8D\xA8", + "\xBF\x58" => "\xE7\x92\x9C", + "\xBF\x59" => "\xE7\x92\xA3", + "\xBF\x5A" => "\xE7\x92\x98", + "\xBF\x5B" => "\xE7\x92\x9F", + "\xBF\x5C" => "\xE7\x92\x9E", + "\xBF\x5D" => "\xE7\x93\xA2", + "\xBF\x5E" => "\xE7\x94\x8C", + "\xBF\x5F" => "\xE7\x94\x8D", + "\xBF\x60" => "\xE7\x98\xB4", + "\xBF\x61" => "\xE7\x98\xB8", + "\xBF\x62" => "\xE7\x98\xBA", + "\xBF\x63" => "\xE7\x9B\xA7", + "\xBF\x64" => "\xE7\x9B\xA5", + "\xBF\x65" => "\xE7\x9E\xA0", + "\xBF\x66" => "\xE7\x9E\x9E", + "\xBF\x67" => "\xE7\x9E\x9F", + "\xBF\x68" => "\xE7\x9E\xA5", + "\xBF\x69" => "\xE7\xA3\xA8", + "\xBF\x6A" => "\xE7\xA3\x9A", + "\xBF\x6B" => "\xE7\xA3\xAC", + "\xBF\x6C" => "\xE7\xA3\xA7", + "\xBF\x6D" => "\xE7\xA6\xA6", + "\xBF\x6E" => "\xE7\xA9\x8D", + "\xBF\x6F" => "\xE7\xA9\x8E", + "\xBF\x70" => "\xE7\xA9\x86", + "\xBF\x71" => "\xE7\xA9\x8C", + "\xBF\x72" => "\xE7\xA9\x8B", + "\xBF\x73" => "\xE7\xAA\xBA", + "\xBF\x74" => "\xE7\xAF\x99", + "\xBF\x75" => "\xE7\xB0\x91", + "\xBF\x76" => "\xE7\xAF\x89", + "\xBF\x77" => "\xE7\xAF\xA4", + "\xBF\x78" => "\xE7\xAF\x9B", + "\xBF\x79" => "\xE7\xAF\xA1", + "\xBF\x7A" => "\xE7\xAF\xA9", + "\xBF\x7B" => "\xE7\xAF\xA6", + "\xBF\x7C" => "\xE7\xB3\x95", + "\xBF\x7D" => "\xE7\xB3\x96", + "\xBF\x7E" => "\xE7\xB8\x8A", + "\xBF\xA1" => "\xE7\xB8\x91", + "\xBF\xA2" => "\xE7\xB8\x88", + "\xBF\xA3" => "\xE7\xB8\x9B", + "\xBF\xA4" => "\xE7\xB8\xA3", + "\xBF\xA5" => "\xE7\xB8\x9E", + "\xBF\xA6" => "\xE7\xB8\x9D", + "\xBF\xA7" => "\xE7\xB8\x89", + "\xBF\xA8" => "\xE7\xB8\x90", + "\xBF\xA9" => "\xE7\xBD\xB9", + "\xBF\xAA" => "\xE7\xBE\xB2", + "\xBF\xAB" => "\xE7\xBF\xB0", + "\xBF\xAC" => "\xE7\xBF\xB1", + "\xBF\xAD" => "\xE7\xBF\xAE", + "\xBF\xAE" => "\xE8\x80\xA8", + "\xBF\xAF" => "\xE8\x86\xB3", + "\xBF\xB0" => "\xE8\x86\xA9", + "\xBF\xB1" => "\xE8\x86\xA8", + "\xBF\xB2" => "\xE8\x87\xBB", + "\xBF\xB3" => "\xE8\x88\x88", + "\xBF\xB4" => "\xE8\x89\x98", + "\xBF\xB5" => "\xE8\x89\x99", + "\xBF\xB6" => "\xE8\x95\x8A", + "\xBF\xB7" => "\xE8\x95\x99", + "\xBF\xB8" => "\xE8\x95\x88", + "\xBF\xB9" => "\xE8\x95\xA8", + "\xBF\xBA" => "\xE8\x95\xA9", + "\xBF\xBB" => "\xE8\x95\x83", + "\xBF\xBC" => "\xE8\x95\x89", + "\xBF\xBD" => "\xE8\x95\xAD", + "\xBF\xBE" => "\xE8\x95\xAA", + "\xBF\xBF" => "\xE8\x95\x9E", + "\xBF\xC0" => "\xE8\x9E\x83", + "\xBF\xC1" => "\xE8\x9E\x9F", + "\xBF\xC2" => "\xE8\x9E\x9E", + "\xBF\xC3" => "\xE8\x9E\xA2", + "\xBF\xC4" => "\xE8\x9E\x8D", + "\xBF\xC5" => "\xE8\xA1\xA1", + "\xBF\xC6" => "\xE8\xA4\xAA", + "\xBF\xC7" => "\xE8\xA4\xB2", + "\xBF\xC8" => "\xE8\xA4\xA5", + "\xBF\xC9" => "\xE8\xA4\xAB", + "\xBF\xCA" => "\xE8\xA4\xA1", + "\xBF\xCB" => "\xE8\xA6\xAA", + "\xBF\xCC" => "\xE8\xA6\xA6", + "\xBF\xCD" => "\xE8\xAB\xA6", + "\xBF\xCE" => "\xE8\xAB\xBA", + "\xBF\xCF" => "\xE8\xAB\xAB", + "\xBF\xD0" => "\xE8\xAB\xB1", + "\xBF\xD1" => "\xE8\xAC\x80", + "\xBF\xD2" => "\xE8\xAB\x9C", + "\xBF\xD3" => "\xE8\xAB\xA7", + "\xBF\xD4" => "\xE8\xAB\xAE", + "\xBF\xD5" => "\xE8\xAB\xBE", + "\xBF\xD6" => "\xE8\xAC\x81", + "\xBF\xD7" => "\xE8\xAC\x82", + "\xBF\xD8" => "\xE8\xAB\xB7", + "\xBF\xD9" => "\xE8\xAB\xAD", + "\xBF\xDA" => "\xE8\xAB\xB3", + "\xBF\xDB" => "\xE8\xAB\xB6", + "\xBF\xDC" => "\xE8\xAB\xBC", + "\xBF\xDD" => "\xE8\xB1\xAB", + "\xBF\xDE" => "\xE8\xB1\xAD", + "\xBF\xDF" => "\xE8\xB2\x93", + "\xBF\xE0" => "\xE8\xB3\xB4", + "\xBF\xE1" => "\xE8\xB9\x84", + "\xBF\xE2" => "\xE8\xB8\xB1", + "\xBF\xE3" => "\xE8\xB8\xB4", + "\xBF\xE4" => "\xE8\xB9\x82", + "\xBF\xE5" => "\xE8\xB8\xB9", + "\xBF\xE6" => "\xE8\xB8\xB5", + "\xBF\xE7" => "\xE8\xBC\xBB", + "\xBF\xE8" => "\xE8\xBC\xAF", + "\xBF\xE9" => "\xE8\xBC\xB8", + "\xBF\xEA" => "\xE8\xBC\xB3", + "\xBF\xEB" => "\xE8\xBE\xA8", + "\xBF\xEC" => "\xE8\xBE\xA6", + "\xBF\xED" => "\xE9\x81\xB5", + "\xBF\xEE" => "\xE9\x81\xB4", + "\xBF\xEF" => "\xE9\x81\xB8", + "\xBF\xF0" => "\xE9\x81\xB2", + "\xBF\xF1" => "\xE9\x81\xBC", + "\xBF\xF2" => "\xE9\x81\xBA", + "\xBF\xF3" => "\xE9\x84\xB4", + "\xBF\xF4" => "\xE9\x86\x92", + "\xBF\xF5" => "\xE9\x8C\xA0", + "\xBF\xF6" => "\xE9\x8C\xB6", + "\xBF\xF7" => "\xE9\x8B\xB8", + "\xBF\xF8" => "\xE9\x8C\xB3", + "\xBF\xF9" => "\xE9\x8C\xAF", + "\xBF\xFA" => "\xE9\x8C\xA2", + "\xBF\xFB" => "\xE9\x8B\xBC", + "\xBF\xFC" => "\xE9\x8C\xAB", + "\xBF\xFD" => "\xE9\x8C\x84", + "\xBF\xFE" => "\xE9\x8C\x9A", + "\xC0\x40" => "\xE9\x8C\x90", + "\xC0\x41" => "\xE9\x8C\xA6", + "\xC0\x42" => "\xE9\x8C\xA1", + "\xC0\x43" => "\xE9\x8C\x95", + "\xC0\x44" => "\xE9\x8C\xAE", + "\xC0\x45" => "\xE9\x8C\x99", + "\xC0\x46" => "\xE9\x96\xBB", + "\xC0\x47" => "\xE9\x9A\xA7", + "\xC0\x48" => "\xE9\x9A\xA8", + "\xC0\x49" => "\xE9\x9A\xAA", + "\xC0\x4A" => "\xE9\x9B\x95", + "\xC0\x4B" => "\xE9\x9C\x8E", + "\xC0\x4C" => "\xE9\x9C\x91", + "\xC0\x4D" => "\xE9\x9C\x96", + "\xC0\x4E" => "\xE9\x9C\x8D", + "\xC0\x4F" => "\xE9\x9C\x93", + "\xC0\x50" => "\xE9\x9C\x8F", + "\xC0\x51" => "\xE9\x9D\x9B", + "\xC0\x52" => "\xE9\x9D\x9C", + "\xC0\x53" => "\xE9\x9D\xA6", + "\xC0\x54" => "\xE9\x9E\x98", + "\xC0\x55" => "\xE9\xA0\xB0", + "\xC0\x56" => "\xE9\xA0\xB8", + "\xC0\x57" => "\xE9\xA0\xBB", + "\xC0\x58" => "\xE9\xA0\xB7", + "\xC0\x59" => "\xE9\xA0\xAD", + "\xC0\x5A" => "\xE9\xA0\xB9", + "\xC0\x5B" => "\xE9\xA0\xA4", + "\xC0\x5C" => "\xE9\xA4\x90", + "\xC0\x5D" => "\xE9\xA4\xA8", + "\xC0\x5E" => "\xE9\xA4\x9E", + "\xC0\x5F" => "\xE9\xA4\x9B", + "\xC0\x60" => "\xE9\xA4\xA1", + "\xC0\x61" => "\xE9\xA4\x9A", + "\xC0\x62" => "\xE9\xA7\xAD", + "\xC0\x63" => "\xE9\xA7\xA2", + "\xC0\x64" => "\xE9\xA7\xB1", + "\xC0\x65" => "\xE9\xAA\xB8", + "\xC0\x66" => "\xE9\xAA\xBC", + "\xC0\x67" => "\xE9\xAB\xBB", + "\xC0\x68" => "\xE9\xAB\xAD", + "\xC0\x69" => "\xE9\xAC\xA8", + "\xC0\x6A" => "\xE9\xAE\x91", + "\xC0\x6B" => "\xE9\xB4\x95", + "\xC0\x6C" => "\xE9\xB4\xA3", + "\xC0\x6D" => "\xE9\xB4\xA6", + "\xC0\x6E" => "\xE9\xB4\xA8", + "\xC0\x6F" => "\xE9\xB4\x92", + "\xC0\x70" => "\xE9\xB4\x9B", + "\xC0\x71" => "\xE9\xBB\x98", + "\xC0\x72" => "\xE9\xBB\x94", + "\xC0\x73" => "\xE9\xBE\x8D", + "\xC0\x74" => "\xE9\xBE\x9C", + "\xC0\x75" => "\xE5\x84\xAA", + "\xC0\x76" => "\xE5\x84\x9F", + "\xC0\x77" => "\xE5\x84\xA1", + "\xC0\x78" => "\xE5\x84\xB2", + "\xC0\x79" => "\xE5\x8B\xB5", + "\xC0\x7A" => "\xE5\x9A\x8E", + "\xC0\x7B" => "\xE5\x9A\x80", + "\xC0\x7C" => "\xE5\x9A\x90", + "\xC0\x7D" => "\xE5\x9A\x85", + "\xC0\x7E" => "\xE5\x9A\x87", + "\xC0\xA1" => "\xE5\x9A\x8F", + "\xC0\xA2" => "\xE5\xA3\x95", + "\xC0\xA3" => "\xE5\xA3\x93", + "\xC0\xA4" => "\xE5\xA3\x91", + "\xC0\xA5" => "\xE5\xA3\x8E", + "\xC0\xA6" => "\xE5\xAC\xB0", + "\xC0\xA7" => "\xE5\xAC\xAA", + "\xC0\xA8" => "\xE5\xAC\xA4", + "\xC0\xA9" => "\xE5\xAD\xBA", + "\xC0\xAA" => "\xE5\xB0\xB7", + "\xC0\xAB" => "\xE5\xB1\xA8", + "\xC0\xAC" => "\xE5\xB6\xBC", + "\xC0\xAD" => "\xE5\xB6\xBA", + "\xC0\xAE" => "\xE5\xB6\xBD", + "\xC0\xAF" => "\xE5\xB6\xB8", + "\xC0\xB0" => "\xE5\xB9\xAB", + "\xC0\xB1" => "\xE5\xBD\x8C", + "\xC0\xB2" => "\xE5\xBE\xBD", + "\xC0\xB3" => "\xE6\x87\x89", + "\xC0\xB4" => "\xE6\x87\x82", + "\xC0\xB5" => "\xE6\x87\x87", + "\xC0\xB6" => "\xE6\x87\xA6", + "\xC0\xB7" => "\xE6\x87\x8B", + "\xC0\xB8" => "\xE6\x88\xB2", + "\xC0\xB9" => "\xE6\x88\xB4", + "\xC0\xBA" => "\xE6\x93\x8E", + "\xC0\xBB" => "\xE6\x93\x8A", + "\xC0\xBC" => "\xE6\x93\x98", + "\xC0\xBD" => "\xE6\x93\xA0", + "\xC0\xBE" => "\xE6\x93\xB0", + "\xC0\xBF" => "\xE6\x93\xA6", + "\xC0\xC0" => "\xE6\x93\xAC", + "\xC0\xC1" => "\xE6\x93\xB1", + "\xC0\xC2" => "\xE6\x93\xA2", + "\xC0\xC3" => "\xE6\x93\xAD", + "\xC0\xC4" => "\xE6\x96\x82", + "\xC0\xC5" => "\xE6\x96\x83", + "\xC0\xC6" => "\xE6\x9B\x99", + "\xC0\xC7" => "\xE6\x9B\x96", + "\xC0\xC8" => "\xE6\xAA\x80", + "\xC0\xC9" => "\xE6\xAA\x94", + "\xC0\xCA" => "\xE6\xAA\x84", + "\xC0\xCB" => "\xE6\xAA\xA2", + "\xC0\xCC" => "\xE6\xAA\x9C", + "\xC0\xCD" => "\xE6\xAB\x9B", + "\xC0\xCE" => "\xE6\xAA\xA3", + "\xC0\xCF" => "\xE6\xA9\xBE", + "\xC0\xD0" => "\xE6\xAA\x97", + "\xC0\xD1" => "\xE6\xAA\x90", + "\xC0\xD2" => "\xE6\xAA\xA0", + "\xC0\xD3" => "\xE6\xAD\x9C", + "\xC0\xD4" => "\xE6\xAE\xAE", + "\xC0\xD5" => "\xE6\xAF\x9A", + "\xC0\xD6" => "\xE6\xB0\x88", + "\xC0\xD7" => "\xE6\xBF\x98", + "\xC0\xD8" => "\xE6\xBF\xB1", + "\xC0\xD9" => "\xE6\xBF\x9F", + "\xC0\xDA" => "\xE6\xBF\xA0", + "\xC0\xDB" => "\xE6\xBF\x9B", + "\xC0\xDC" => "\xE6\xBF\xA4", + "\xC0\xDD" => "\xE6\xBF\xAB", + "\xC0\xDE" => "\xE6\xBF\xAF", + "\xC0\xDF" => "\xE6\xBE\x80", + "\xC0\xE0" => "\xE6\xBF\xAC", + "\xC0\xE1" => "\xE6\xBF\xA1", + "\xC0\xE2" => "\xE6\xBF\xA9", + "\xC0\xE3" => "\xE6\xBF\x95", + "\xC0\xE4" => "\xE6\xBF\xAE", + "\xC0\xE5" => "\xE6\xBF\xB0", + "\xC0\xE6" => "\xE7\x87\xA7", + "\xC0\xE7" => "\xE7\x87\x9F", + "\xC0\xE8" => "\xE7\x87\xAE", + "\xC0\xE9" => "\xE7\x87\xA6", + "\xC0\xEA" => "\xE7\x87\xA5", + "\xC0\xEB" => "\xE7\x87\xAD", + "\xC0\xEC" => "\xE7\x87\xAC", + "\xC0\xED" => "\xE7\x87\xB4", + "\xC0\xEE" => "\xE7\x87\xA0", + "\xC0\xEF" => "\xE7\x88\xB5", + "\xC0\xF0" => "\xE7\x89\x86", + "\xC0\xF1" => "\xE7\x8D\xB0", + "\xC0\xF2" => "\xE7\x8D\xB2", + "\xC0\xF3" => "\xE7\x92\xA9", + "\xC0\xF4" => "\xE7\x92\xB0", + "\xC0\xF5" => "\xE7\x92\xA6", + "\xC0\xF6" => "\xE7\x92\xA8", + "\xC0\xF7" => "\xE7\x99\x86", + "\xC0\xF8" => "\xE7\x99\x82", + "\xC0\xF9" => "\xE7\x99\x8C", + "\xC0\xFA" => "\xE7\x9B\xAA", + "\xC0\xFB" => "\xE7\x9E\xB3", + "\xC0\xFC" => "\xE7\x9E\xAA", + "\xC0\xFD" => "\xE7\x9E\xB0", + "\xC0\xFE" => "\xE7\x9E\xAC", + "\xC1\x40" => "\xE7\x9E\xA7", + "\xC1\x41" => "\xE7\x9E\xAD", + "\xC1\x42" => "\xE7\x9F\xAF", + "\xC1\x43" => "\xE7\xA3\xB7", + "\xC1\x44" => "\xE7\xA3\xBA", + "\xC1\x45" => "\xE7\xA3\xB4", + "\xC1\x46" => "\xE7\xA3\xAF", + "\xC1\x47" => "\xE7\xA4\x81", + "\xC1\x48" => "\xE7\xA6\xA7", + "\xC1\x49" => "\xE7\xA6\xAA", + "\xC1\x4A" => "\xE7\xA9\x97", + "\xC1\x4B" => "\xE7\xAA\xBF", + "\xC1\x4C" => "\xE7\xB0\x87", + "\xC1\x4D" => "\xE7\xB0\x8D", + "\xC1\x4E" => "\xE7\xAF\xBE", + "\xC1\x4F" => "\xE7\xAF\xB7", + "\xC1\x50" => "\xE7\xB0\x8C", + "\xC1\x51" => "\xE7\xAF\xA0", + "\xC1\x52" => "\xE7\xB3\xA0", + "\xC1\x53" => "\xE7\xB3\x9C", + "\xC1\x54" => "\xE7\xB3\x9E", + "\xC1\x55" => "\xE7\xB3\xA2", + "\xC1\x56" => "\xE7\xB3\x9F", + "\xC1\x57" => "\xE7\xB3\x99", + "\xC1\x58" => "\xE7\xB3\x9D", + "\xC1\x59" => "\xE7\xB8\xAE", + "\xC1\x5A" => "\xE7\xB8\xBE", + "\xC1\x5B" => "\xE7\xB9\x86", + "\xC1\x5C" => "\xE7\xB8\xB7", + "\xC1\x5D" => "\xE7\xB8\xB2", + "\xC1\x5E" => "\xE7\xB9\x83", + "\xC1\x5F" => "\xE7\xB8\xAB", + "\xC1\x60" => "\xE7\xB8\xBD", + "\xC1\x61" => "\xE7\xB8\xB1", + "\xC1\x62" => "\xE7\xB9\x85", + "\xC1\x63" => "\xE7\xB9\x81", + "\xC1\x64" => "\xE7\xB8\xB4", + "\xC1\x65" => "\xE7\xB8\xB9", + "\xC1\x66" => "\xE7\xB9\x88", + "\xC1\x67" => "\xE7\xB8\xB5", + "\xC1\x68" => "\xE7\xB8\xBF", + "\xC1\x69" => "\xE7\xB8\xAF", + "\xC1\x6A" => "\xE7\xBD\x84", + "\xC1\x6B" => "\xE7\xBF\xB3", + "\xC1\x6C" => "\xE7\xBF\xBC", + "\xC1\x6D" => "\xE8\x81\xB1", + "\xC1\x6E" => "\xE8\x81\xB2", + "\xC1\x6F" => "\xE8\x81\xB0", + "\xC1\x70" => "\xE8\x81\xAF", + "\xC1\x71" => "\xE8\x81\xB3", + "\xC1\x72" => "\xE8\x87\x86", + "\xC1\x73" => "\xE8\x87\x83", + "\xC1\x74" => "\xE8\x86\xBA", + "\xC1\x75" => "\xE8\x87\x82", + "\xC1\x76" => "\xE8\x87\x80", + "\xC1\x77" => "\xE8\x86\xBF", + "\xC1\x78" => "\xE8\x86\xBD", + "\xC1\x79" => "\xE8\x87\x89", + "\xC1\x7A" => "\xE8\x86\xBE", + "\xC1\x7B" => "\xE8\x87\xA8", + "\xC1\x7C" => "\xE8\x88\x89", + "\xC1\x7D" => "\xE8\x89\xB1", + "\xC1\x7E" => "\xE8\x96\xAA", + "\xC1\xA1" => "\xE8\x96\x84", + "\xC1\xA2" => "\xE8\x95\xBE", + "\xC1\xA3" => "\xE8\x96\x9C", + "\xC1\xA4" => "\xE8\x96\x91", + "\xC1\xA5" => "\xE8\x96\x94", + "\xC1\xA6" => "\xE8\x96\xAF", + "\xC1\xA7" => "\xE8\x96\x9B", + "\xC1\xA8" => "\xE8\x96\x87", + "\xC1\xA9" => "\xE8\x96\xA8", + "\xC1\xAA" => "\xE8\x96\x8A", + "\xC1\xAB" => "\xE8\x99\xA7", + "\xC1\xAC" => "\xE8\x9F\x80", + "\xC1\xAD" => "\xE8\x9F\x91", + "\xC1\xAE" => "\xE8\x9E\xB3", + "\xC1\xAF" => "\xE8\x9F\x92", + "\xC1\xB0" => "\xE8\x9F\x86", + "\xC1\xB1" => "\xE8\x9E\xAB", + "\xC1\xB2" => "\xE8\x9E\xBB", + "\xC1\xB3" => "\xE8\x9E\xBA", + "\xC1\xB4" => "\xE8\x9F\x88", + "\xC1\xB5" => "\xE8\x9F\x8B", + "\xC1\xB6" => "\xE8\xA4\xBB", + "\xC1\xB7" => "\xE8\xA4\xB6", + "\xC1\xB8" => "\xE8\xA5\x84", + "\xC1\xB9" => "\xE8\xA4\xB8", + "\xC1\xBA" => "\xE8\xA4\xBD", + "\xC1\xBB" => "\xE8\xA6\xAC", + "\xC1\xBC" => "\xE8\xAC\x8E", + "\xC1\xBD" => "\xE8\xAC\x97", + "\xC1\xBE" => "\xE8\xAC\x99", + "\xC1\xBF" => "\xE8\xAC\x9B", + "\xC1\xC0" => "\xE8\xAC\x8A", + "\xC1\xC1" => "\xE8\xAC\xA0", + "\xC1\xC2" => "\xE8\xAC\x9D", + "\xC1\xC3" => "\xE8\xAC\x84", + "\xC1\xC4" => "\xE8\xAC\x90", + "\xC1\xC5" => "\xE8\xB1\x81", + "\xC1\xC6" => "\xE8\xB0\xBF", + "\xC1\xC7" => "\xE8\xB1\xB3", + "\xC1\xC8" => "\xE8\xB3\xBA", + "\xC1\xC9" => "\xE8\xB3\xBD", + "\xC1\xCA" => "\xE8\xB3\xBC", + "\xC1\xCB" => "\xE8\xB3\xB8", + "\xC1\xCC" => "\xE8\xB3\xBB", + "\xC1\xCD" => "\xE8\xB6\xA8", + "\xC1\xCE" => "\xE8\xB9\x89", + "\xC1\xCF" => "\xE8\xB9\x8B", + "\xC1\xD0" => "\xE8\xB9\x88", + "\xC1\xD1" => "\xE8\xB9\x8A", + "\xC1\xD2" => "\xE8\xBD\x84", + "\xC1\xD3" => "\xE8\xBC\xBE", + "\xC1\xD4" => "\xE8\xBD\x82", + "\xC1\xD5" => "\xE8\xBD\x85", + "\xC1\xD6" => "\xE8\xBC\xBF", + "\xC1\xD7" => "\xE9\x81\xBF", + "\xC1\xD8" => "\xE9\x81\xBD", + "\xC1\xD9" => "\xE9\x82\x84", + "\xC1\xDA" => "\xE9\x82\x81", + "\xC1\xDB" => "\xE9\x82\x82", + "\xC1\xDC" => "\xE9\x82\x80", + "\xC1\xDD" => "\xE9\x84\xB9", + "\xC1\xDE" => "\xE9\x86\xA3", + "\xC1\xDF" => "\xE9\x86\x9E", + "\xC1\xE0" => "\xE9\x86\x9C", + "\xC1\xE1" => "\xE9\x8D\x8D", + "\xC1\xE2" => "\xE9\x8E\x82", + "\xC1\xE3" => "\xE9\x8C\xA8", + "\xC1\xE4" => "\xE9\x8D\xB5", + "\xC1\xE5" => "\xE9\x8D\x8A", + "\xC1\xE6" => "\xE9\x8D\xA5", + "\xC1\xE7" => "\xE9\x8D\x8B", + "\xC1\xE8" => "\xE9\x8C\x98", + "\xC1\xE9" => "\xE9\x8D\xBE", + "\xC1\xEA" => "\xE9\x8D\xAC", + "\xC1\xEB" => "\xE9\x8D\x9B", + "\xC1\xEC" => "\xE9\x8D\xB0", + "\xC1\xED" => "\xE9\x8D\x9A", + "\xC1\xEE" => "\xE9\x8D\x94", + "\xC1\xEF" => "\xE9\x97\x8A", + "\xC1\xF0" => "\xE9\x97\x8B", + "\xC1\xF1" => "\xE9\x97\x8C", + "\xC1\xF2" => "\xE9\x97\x88", + "\xC1\xF3" => "\xE9\x97\x86", + "\xC1\xF4" => "\xE9\x9A\xB1", + "\xC1\xF5" => "\xE9\x9A\xB8", + "\xC1\xF6" => "\xE9\x9B\x96", + "\xC1\xF7" => "\xE9\x9C\x9C", + "\xC1\xF8" => "\xE9\x9C\x9E", + "\xC1\xF9" => "\xE9\x9E\xA0", + "\xC1\xFA" => "\xE9\x9F\x93", + "\xC1\xFB" => "\xE9\xA1\x86", + "\xC1\xFC" => "\xE9\xA2\xB6", + "\xC1\xFD" => "\xE9\xA4\xB5", + "\xC1\xFE" => "\xE9\xA8\x81", + "\xC2\x40" => "\xE9\xA7\xBF", + "\xC2\x41" => "\xE9\xAE\xAE", + "\xC2\x42" => "\xE9\xAE\xAB", + "\xC2\x43" => "\xE9\xAE\xAA", + "\xC2\x44" => "\xE9\xAE\xAD", + "\xC2\x45" => "\xE9\xB4\xBB", + "\xC2\x46" => "\xE9\xB4\xBF", + "\xC2\x47" => "\xE9\xBA\x8B", + "\xC2\x48" => "\xE9\xBB\x8F", + "\xC2\x49" => "\xE9\xBB\x9E", + "\xC2\x4A" => "\xE9\xBB\x9C", + "\xC2\x4B" => "\xE9\xBB\x9D", + "\xC2\x4C" => "\xE9\xBB\x9B", + "\xC2\x4D" => "\xE9\xBC\xBE", + "\xC2\x4E" => "\xE9\xBD\x8B", + "\xC2\x4F" => "\xE5\x8F\xA2", + "\xC2\x50" => "\xE5\x9A\x95", + "\xC2\x51" => "\xE5\x9A\xAE", + "\xC2\x52" => "\xE5\xA3\x99", + "\xC2\x53" => "\xE5\xA3\x98", + "\xC2\x54" => "\xE5\xAC\xB8", + "\xC2\x55" => "\xE5\xBD\x9D", + "\xC2\x56" => "\xE6\x87\xA3", + "\xC2\x57" => "\xE6\x88\xB3", + "\xC2\x58" => "\xE6\x93\xB4", + "\xC2\x59" => "\xE6\x93\xB2", + "\xC2\x5A" => "\xE6\x93\xBE", + "\xC2\x5B" => "\xE6\x94\x86", + "\xC2\x5C" => "\xE6\x93\xBA", + "\xC2\x5D" => "\xE6\x93\xBB", + "\xC2\x5E" => "\xE6\x93\xB7", + "\xC2\x5F" => "\xE6\x96\xB7", + "\xC2\x60" => "\xE6\x9B\x9C", + "\xC2\x61" => "\xE6\x9C\xA6", + "\xC2\x62" => "\xE6\xAA\xB3", + "\xC2\x63" => "\xE6\xAA\xAC", + "\xC2\x64" => "\xE6\xAB\x83", + "\xC2\x65" => "\xE6\xAA\xBB", + "\xC2\x66" => "\xE6\xAA\xB8", + "\xC2\x67" => "\xE6\xAB\x82", + "\xC2\x68" => "\xE6\xAA\xAE", + "\xC2\x69" => "\xE6\xAA\xAF", + "\xC2\x6A" => "\xE6\xAD\x9F", + "\xC2\x6B" => "\xE6\xAD\xB8", + "\xC2\x6C" => "\xE6\xAE\xAF", + "\xC2\x6D" => "\xE7\x80\x89", + "\xC2\x6E" => "\xE7\x80\x8B", + "\xC2\x6F" => "\xE6\xBF\xBE", + "\xC2\x70" => "\xE7\x80\x86", + "\xC2\x71" => "\xE6\xBF\xBA", + "\xC2\x72" => "\xE7\x80\x91", + "\xC2\x73" => "\xE7\x80\x8F", + "\xC2\x74" => "\xE7\x87\xBB", + "\xC2\x75" => "\xE7\x87\xBC", + "\xC2\x76" => "\xE7\x87\xBE", + "\xC2\x77" => "\xE7\x87\xB8", + "\xC2\x78" => "\xE7\x8D\xB7", + "\xC2\x79" => "\xE7\x8D\xB5", + "\xC2\x7A" => "\xE7\x92\xA7", + "\xC2\x7B" => "\xE7\x92\xBF", + "\xC2\x7C" => "\xE7\x94\x95", + "\xC2\x7D" => "\xE7\x99\x96", + "\xC2\x7E" => "\xE7\x99\x98", + "\xC2\xA1" => "\xE7\x99\x92", + "\xC2\xA2" => "\xE7\x9E\xBD", + "\xC2\xA3" => "\xE7\x9E\xBF", + "\xC2\xA4" => "\xE7\x9E\xBB", + "\xC2\xA5" => "\xE7\x9E\xBC", + "\xC2\xA6" => "\xE7\xA4\x8E", + "\xC2\xA7" => "\xE7\xA6\xAE", + "\xC2\xA8" => "\xE7\xA9\xA1", + "\xC2\xA9" => "\xE7\xA9\xA2", + "\xC2\xAA" => "\xE7\xA9\xA0", + "\xC2\xAB" => "\xE7\xAB\x84", + "\xC2\xAC" => "\xE7\xAB\x85", + "\xC2\xAD" => "\xE7\xB0\xAB", + "\xC2\xAE" => "\xE7\xB0\xA7", + "\xC2\xAF" => "\xE7\xB0\xAA", + "\xC2\xB0" => "\xE7\xB0\x9E", + "\xC2\xB1" => "\xE7\xB0\xA3", + "\xC2\xB2" => "\xE7\xB0\xA1", + "\xC2\xB3" => "\xE7\xB3\xA7", + "\xC2\xB4" => "\xE7\xB9\x94", + "\xC2\xB5" => "\xE7\xB9\x95", + "\xC2\xB6" => "\xE7\xB9\x9E", + "\xC2\xB7" => "\xE7\xB9\x9A", + "\xC2\xB8" => "\xE7\xB9\xA1", + "\xC2\xB9" => "\xE7\xB9\x92", + "\xC2\xBA" => "\xE7\xB9\x99", + "\xC2\xBB" => "\xE7\xBD\x88", + "\xC2\xBC" => "\xE7\xBF\xB9", + "\xC2\xBD" => "\xE7\xBF\xBB", + "\xC2\xBE" => "\xE8\x81\xB7", + "\xC2\xBF" => "\xE8\x81\xB6", + "\xC2\xC0" => "\xE8\x87\x8D", + "\xC2\xC1" => "\xE8\x87\x8F", + "\xC2\xC2" => "\xE8\x88\x8A", + "\xC2\xC3" => "\xE8\x97\x8F", + "\xC2\xC4" => "\xE8\x96\xA9", + "\xC2\xC5" => "\xE8\x97\x8D", + "\xC2\xC6" => "\xE8\x97\x90", + "\xC2\xC7" => "\xE8\x97\x89", + "\xC2\xC8" => "\xE8\x96\xB0", + "\xC2\xC9" => "\xE8\x96\xBA", + "\xC2\xCA" => "\xE8\x96\xB9", + "\xC2\xCB" => "\xE8\x96\xA6", + "\xC2\xCC" => "\xE8\x9F\xAF", + "\xC2\xCD" => "\xE8\x9F\xAC", + "\xC2\xCE" => "\xE8\x9F\xB2", + "\xC2\xCF" => "\xE8\x9F\xA0", + "\xC2\xD0" => "\xE8\xA6\x86", + "\xC2\xD1" => "\xE8\xA6\xB2", + "\xC2\xD2" => "\xE8\xA7\xB4", + "\xC2\xD3" => "\xE8\xAC\xA8", + "\xC2\xD4" => "\xE8\xAC\xB9", + "\xC2\xD5" => "\xE8\xAC\xAC", + "\xC2\xD6" => "\xE8\xAC\xAB", + "\xC2\xD7" => "\xE8\xB1\x90", + "\xC2\xD8" => "\xE8\xB4\x85", + "\xC2\xD9" => "\xE8\xB9\x99", + "\xC2\xDA" => "\xE8\xB9\xA3", + "\xC2\xDB" => "\xE8\xB9\xA6", + "\xC2\xDC" => "\xE8\xB9\xA4", + "\xC2\xDD" => "\xE8\xB9\x9F", + "\xC2\xDE" => "\xE8\xB9\x95", + "\xC2\xDF" => "\xE8\xBB\x80", + "\xC2\xE0" => "\xE8\xBD\x89", + "\xC2\xE1" => "\xE8\xBD\x8D", + "\xC2\xE2" => "\xE9\x82\x87", + "\xC2\xE3" => "\xE9\x82\x83", + "\xC2\xE4" => "\xE9\x82\x88", + "\xC2\xE5" => "\xE9\x86\xAB", + "\xC2\xE6" => "\xE9\x86\xAC", + "\xC2\xE7" => "\xE9\x87\x90", + "\xC2\xE8" => "\xE9\x8E\x94", + "\xC2\xE9" => "\xE9\x8E\x8A", + "\xC2\xEA" => "\xE9\x8E\x96", + "\xC2\xEB" => "\xE9\x8E\xA2", + "\xC2\xEC" => "\xE9\x8E\xB3", + "\xC2\xED" => "\xE9\x8E\xAE", + "\xC2\xEE" => "\xE9\x8E\xAC", + "\xC2\xEF" => "\xE9\x8E\xB0", + "\xC2\xF0" => "\xE9\x8E\x98", + "\xC2\xF1" => "\xE9\x8E\x9A", + "\xC2\xF2" => "\xE9\x8E\x97", + "\xC2\xF3" => "\xE9\x97\x94", + "\xC2\xF4" => "\xE9\x97\x96", + "\xC2\xF5" => "\xE9\x97\x90", + "\xC2\xF6" => "\xE9\x97\x95", + "\xC2\xF7" => "\xE9\x9B\xA2", + "\xC2\xF8" => "\xE9\x9B\x9C", + "\xC2\xF9" => "\xE9\x9B\x99", + "\xC2\xFA" => "\xE9\x9B\x9B", + "\xC2\xFB" => "\xE9\x9B\x9E", + "\xC2\xFC" => "\xE9\x9C\xA4", + "\xC2\xFD" => "\xE9\x9E\xA3", + "\xC2\xFE" => "\xE9\x9E\xA6", + "\xC3\x40" => "\xE9\x9E\xAD", + "\xC3\x41" => "\xE9\x9F\xB9", + "\xC3\x42" => "\xE9\xA1\x8D", + "\xC3\x43" => "\xE9\xA1\x8F", + "\xC3\x44" => "\xE9\xA1\x8C", + "\xC3\x45" => "\xE9\xA1\x8E", + "\xC3\x46" => "\xE9\xA1\x93", + "\xC3\x47" => "\xE9\xA2\xBA", + "\xC3\x48" => "\xE9\xA4\xBE", + "\xC3\x49" => "\xE9\xA4\xBF", + "\xC3\x4A" => "\xE9\xA4\xBD", + "\xC3\x4B" => "\xE9\xA4\xAE", + "\xC3\x4C" => "\xE9\xA6\xA5", + "\xC3\x4D" => "\xE9\xA8\x8E", + "\xC3\x4E" => "\xE9\xAB\x81", + "\xC3\x4F" => "\xE9\xAC\x83", + "\xC3\x50" => "\xE9\xAC\x86", + "\xC3\x51" => "\xE9\xAD\x8F", + "\xC3\x52" => "\xE9\xAD\x8E", + "\xC3\x53" => "\xE9\xAD\x8D", + "\xC3\x54" => "\xE9\xAF\x8A", + "\xC3\x55" => "\xE9\xAF\x89", + "\xC3\x56" => "\xE9\xAF\xBD", + "\xC3\x57" => "\xE9\xAF\x88", + "\xC3\x58" => "\xE9\xAF\x80", + "\xC3\x59" => "\xE9\xB5\x91", + "\xC3\x5A" => "\xE9\xB5\x9D", + "\xC3\x5B" => "\xE9\xB5\xA0", + "\xC3\x5C" => "\xE9\xBB\xA0", + "\xC3\x5D" => "\xE9\xBC\x95", + "\xC3\x5E" => "\xE9\xBC\xAC", + "\xC3\x5F" => "\xE5\x84\xB3", + "\xC3\x60" => "\xE5\x9A\xA5", + "\xC3\x61" => "\xE5\xA3\x9E", + "\xC3\x62" => "\xE5\xA3\x9F", + "\xC3\x63" => "\xE5\xA3\xA2", + "\xC3\x64" => "\xE5\xAF\xB5", + "\xC3\x65" => "\xE9\xBE\x90", + "\xC3\x66" => "\xE5\xBB\xAC", + "\xC3\x67" => "\xE6\x87\xB2", + "\xC3\x68" => "\xE6\x87\xB7", + "\xC3\x69" => "\xE6\x87\xB6", + "\xC3\x6A" => "\xE6\x87\xB5", + "\xC3\x6B" => "\xE6\x94\x80", + "\xC3\x6C" => "\xE6\x94\x8F", + "\xC3\x6D" => "\xE6\x9B\xA0", + "\xC3\x6E" => "\xE6\x9B\x9D", + "\xC3\x6F" => "\xE6\xAB\xA5", + "\xC3\x70" => "\xE6\xAB\x9D", + "\xC3\x71" => "\xE6\xAB\x9A", + "\xC3\x72" => "\xE6\xAB\x93", + "\xC3\x73" => "\xE7\x80\x9B", + "\xC3\x74" => "\xE7\x80\x9F", + "\xC3\x75" => "\xE7\x80\xA8", + "\xC3\x76" => "\xE7\x80\x9A", + "\xC3\x77" => "\xE7\x80\x9D", + "\xC3\x78" => "\xE7\x80\x95", + "\xC3\x79" => "\xE7\x80\x98", + "\xC3\x7A" => "\xE7\x88\x86", + "\xC3\x7B" => "\xE7\x88\x8D", + "\xC3\x7C" => "\xE7\x89\x98", + "\xC3\x7D" => "\xE7\x8A\xA2", + "\xC3\x7E" => "\xE7\x8D\xB8", + "\xC3\xA1" => "\xE7\x8D\xBA", + "\xC3\xA2" => "\xE7\x92\xBD", + "\xC3\xA3" => "\xE7\x93\x8A", + "\xC3\xA4" => "\xE7\x93\xA3", + "\xC3\xA5" => "\xE7\x96\x87", + "\xC3\xA6" => "\xE7\x96\x86", + "\xC3\xA7" => "\xE7\x99\x9F", + "\xC3\xA8" => "\xE7\x99\xA1", + "\xC3\xA9" => "\xE7\x9F\x87", + "\xC3\xAA" => "\xE7\xA4\x99", + "\xC3\xAB" => "\xE7\xA6\xB1", + "\xC3\xAC" => "\xE7\xA9\xAB", + "\xC3\xAD" => "\xE7\xA9\xA9", + "\xC3\xAE" => "\xE7\xB0\xBE", + "\xC3\xAF" => "\xE7\xB0\xBF", + "\xC3\xB0" => "\xE7\xB0\xB8", + "\xC3\xB1" => "\xE7\xB0\xBD", + "\xC3\xB2" => "\xE7\xB0\xB7", + "\xC3\xB3" => "\xE7\xB1\x80", + "\xC3\xB4" => "\xE7\xB9\xAB", + "\xC3\xB5" => "\xE7\xB9\xAD", + "\xC3\xB6" => "\xE7\xB9\xB9", + "\xC3\xB7" => "\xE7\xB9\xA9", + "\xC3\xB8" => "\xE7\xB9\xAA", + "\xC3\xB9" => "\xE7\xBE\x85", + "\xC3\xBA" => "\xE7\xB9\xB3", + "\xC3\xBB" => "\xE7\xBE\xB6", + "\xC3\xBC" => "\xE7\xBE\xB9", + "\xC3\xBD" => "\xE7\xBE\xB8", + "\xC3\xBE" => "\xE8\x87\x98", + "\xC3\xBF" => "\xE8\x97\xA9", + "\xC3\xC0" => "\xE8\x97\x9D", + "\xC3\xC1" => "\xE8\x97\xAA", + "\xC3\xC2" => "\xE8\x97\x95", + "\xC3\xC3" => "\xE8\x97\xA4", + "\xC3\xC4" => "\xE8\x97\xA5", + "\xC3\xC5" => "\xE8\x97\xB7", + "\xC3\xC6" => "\xE8\x9F\xBB", + "\xC3\xC7" => "\xE8\xA0\x85", + "\xC3\xC8" => "\xE8\xA0\x8D", + "\xC3\xC9" => "\xE8\x9F\xB9", + "\xC3\xCA" => "\xE8\x9F\xBE", + "\xC3\xCB" => "\xE8\xA5\xA0", + "\xC3\xCC" => "\xE8\xA5\x9F", + "\xC3\xCD" => "\xE8\xA5\x96", + "\xC3\xCE" => "\xE8\xA5\x9E", + "\xC3\xCF" => "\xE8\xAD\x81", + "\xC3\xD0" => "\xE8\xAD\x9C", + "\xC3\xD1" => "\xE8\xAD\x98", + "\xC3\xD2" => "\xE8\xAD\x89", + "\xC3\xD3" => "\xE8\xAD\x9A", + "\xC3\xD4" => "\xE8\xAD\x8E", + "\xC3\xD5" => "\xE8\xAD\x8F", + "\xC3\xD6" => "\xE8\xAD\x86", + "\xC3\xD7" => "\xE8\xAD\x99", + "\xC3\xD8" => "\xE8\xB4\x88", + "\xC3\xD9" => "\xE8\xB4\x8A", + "\xC3\xDA" => "\xE8\xB9\xBC", + "\xC3\xDB" => "\xE8\xB9\xB2", + "\xC3\xDC" => "\xE8\xBA\x87", + "\xC3\xDD" => "\xE8\xB9\xB6", + "\xC3\xDE" => "\xE8\xB9\xAC", + "\xC3\xDF" => "\xE8\xB9\xBA", + "\xC3\xE0" => "\xE8\xB9\xB4", + "\xC3\xE1" => "\xE8\xBD\x94", + "\xC3\xE2" => "\xE8\xBD\x8E", + "\xC3\xE3" => "\xE8\xBE\xAD", + "\xC3\xE4" => "\xE9\x82\x8A", + "\xC3\xE5" => "\xE9\x82\x8B", + "\xC3\xE6" => "\xE9\x86\xB1", + "\xC3\xE7" => "\xE9\x86\xAE", + "\xC3\xE8" => "\xE9\x8F\xA1", + "\xC3\xE9" => "\xE9\x8F\x91", + "\xC3\xEA" => "\xE9\x8F\x9F", + "\xC3\xEB" => "\xE9\x8F\x83", + "\xC3\xEC" => "\xE9\x8F\x88", + "\xC3\xED" => "\xE9\x8F\x9C", + "\xC3\xEE" => "\xE9\x8F\x9D", + "\xC3\xEF" => "\xE9\x8F\x96", + "\xC3\xF0" => "\xE9\x8F\xA2", + "\xC3\xF1" => "\xE9\x8F\x8D", + "\xC3\xF2" => "\xE9\x8F\x98", + "\xC3\xF3" => "\xE9\x8F\xA4", + "\xC3\xF4" => "\xE9\x8F\x97", + "\xC3\xF5" => "\xE9\x8F\xA8", + "\xC3\xF6" => "\xE9\x97\x9C", + "\xC3\xF7" => "\xE9\x9A\xB4", + "\xC3\xF8" => "\xE9\x9B\xA3", + "\xC3\xF9" => "\xE9\x9C\xAA", + "\xC3\xFA" => "\xE9\x9C\xA7", + "\xC3\xFB" => "\xE9\x9D\xA1", + "\xC3\xFC" => "\xE9\x9F\x9C", + "\xC3\xFD" => "\xE9\x9F\xBB", + "\xC3\xFE" => "\xE9\xA1\x9E", + "\xC4\x40" => "\xE9\xA1\x98", + "\xC4\x41" => "\xE9\xA1\x9B", + "\xC4\x42" => "\xE9\xA2\xBC", + "\xC4\x43" => "\xE9\xA5\x85", + "\xC4\x44" => "\xE9\xA5\x89", + "\xC4\x45" => "\xE9\xA8\x96", + "\xC4\x46" => "\xE9\xA8\x99", + "\xC4\x47" => "\xE9\xAC\x8D", + "\xC4\x48" => "\xE9\xAF\xA8", + "\xC4\x49" => "\xE9\xAF\xA7", + "\xC4\x4A" => "\xE9\xAF\x96", + "\xC4\x4B" => "\xE9\xAF\x9B", + "\xC4\x4C" => "\xE9\xB6\x89", + "\xC4\x4D" => "\xE9\xB5\xA1", + "\xC4\x4E" => "\xE9\xB5\xB2", + "\xC4\x4F" => "\xE9\xB5\xAA", + "\xC4\x50" => "\xE9\xB5\xAC", + "\xC4\x51" => "\xE9\xBA\x92", + "\xC4\x52" => "\xE9\xBA\x97", + "\xC4\x53" => "\xE9\xBA\x93", + "\xC4\x54" => "\xE9\xBA\xB4", + "\xC4\x55" => "\xE5\x8B\xB8", + "\xC4\x56" => "\xE5\x9A\xA8", + "\xC4\x57" => "\xE5\x9A\xB7", + "\xC4\x58" => "\xE5\x9A\xB6", + "\xC4\x59" => "\xE5\x9A\xB4", + "\xC4\x5A" => "\xE5\x9A\xBC", + "\xC4\x5B" => "\xE5\xA3\xA4", + "\xC4\x5C" => "\xE5\xAD\x80", + "\xC4\x5D" => "\xE5\xAD\x83", + "\xC4\x5E" => "\xE5\xAD\xBD", + "\xC4\x5F" => "\xE5\xAF\xB6", + "\xC4\x60" => "\xE5\xB7\x89", + "\xC4\x61" => "\xE6\x87\xB8", + "\xC4\x62" => "\xE6\x87\xBA", + "\xC4\x63" => "\xE6\x94\x98", + "\xC4\x64" => "\xE6\x94\x94", + "\xC4\x65" => "\xE6\x94\x99", + "\xC4\x66" => "\xE6\x9B\xA6", + "\xC4\x67" => "\xE6\x9C\xA7", + "\xC4\x68" => "\xE6\xAB\xAC", + "\xC4\x69" => "\xE7\x80\xBE", + "\xC4\x6A" => "\xE7\x80\xB0", + "\xC4\x6B" => "\xE7\x80\xB2", + "\xC4\x6C" => "\xE7\x88\x90", + "\xC4\x6D" => "\xE7\x8D\xBB", + "\xC4\x6E" => "\xE7\x93\x8F", + "\xC4\x6F" => "\xE7\x99\xA2", + "\xC4\x70" => "\xE7\x99\xA5", + "\xC4\x71" => "\xE7\xA4\xA6", + "\xC4\x72" => "\xE7\xA4\xAA", + "\xC4\x73" => "\xE7\xA4\xAC", + "\xC4\x74" => "\xE7\xA4\xAB", + "\xC4\x75" => "\xE7\xAB\x87", + "\xC4\x76" => "\xE7\xAB\xB6", + "\xC4\x77" => "\xE7\xB1\x8C", + "\xC4\x78" => "\xE7\xB1\x83", + "\xC4\x79" => "\xE7\xB1\x8D", + "\xC4\x7A" => "\xE7\xB3\xAF", + "\xC4\x7B" => "\xE7\xB3\xB0", + "\xC4\x7C" => "\xE8\xBE\xAE", + "\xC4\x7D" => "\xE7\xB9\xBD", + "\xC4\x7E" => "\xE7\xB9\xBC", + "\xC4\xA1" => "\xE7\xBA\x82", + "\xC4\xA2" => "\xE7\xBD\x8C", + "\xC4\xA3" => "\xE8\x80\x80", + "\xC4\xA4" => "\xE8\x87\x9A", + "\xC4\xA5" => "\xE8\x89\xA6", + "\xC4\xA6" => "\xE8\x97\xBB", + "\xC4\xA7" => "\xE8\x97\xB9", + "\xC4\xA8" => "\xE8\x98\x91", + "\xC4\xA9" => "\xE8\x97\xBA", + "\xC4\xAA" => "\xE8\x98\x86", + "\xC4\xAB" => "\xE8\x98\x8B", + "\xC4\xAC" => "\xE8\x98\x87", + "\xC4\xAD" => "\xE8\x98\x8A", + "\xC4\xAE" => "\xE8\xA0\x94", + "\xC4\xAF" => "\xE8\xA0\x95", + "\xC4\xB0" => "\xE8\xA5\xA4", + "\xC4\xB1" => "\xE8\xA6\xBA", + "\xC4\xB2" => "\xE8\xA7\xB8", + "\xC4\xB3" => "\xE8\xAD\xB0", + "\xC4\xB4" => "\xE8\xAD\xAC", + "\xC4\xB5" => "\xE8\xAD\xA6", + "\xC4\xB6" => "\xE8\xAD\xAF", + "\xC4\xB7" => "\xE8\xAD\x9F", + "\xC4\xB8" => "\xE8\xAD\xAB", + "\xC4\xB9" => "\xE8\xB4\x8F", + "\xC4\xBA" => "\xE8\xB4\x8D", + "\xC4\xBB" => "\xE8\xBA\x89", + "\xC4\xBC" => "\xE8\xBA\x81", + "\xC4\xBD" => "\xE8\xBA\x85", + "\xC4\xBE" => "\xE8\xBA\x82", + "\xC4\xBF" => "\xE9\x86\xB4", + "\xC4\xC0" => "\xE9\x87\x8B", + "\xC4\xC1" => "\xE9\x90\x98", + "\xC4\xC2" => "\xE9\x90\x83", + "\xC4\xC3" => "\xE9\x8F\xBD", + "\xC4\xC4" => "\xE9\x97\xA1", + "\xC4\xC5" => "\xE9\x9C\xB0", + "\xC4\xC6" => "\xE9\xA3\x84", + "\xC4\xC7" => "\xE9\xA5\x92", + "\xC4\xC8" => "\xE9\xA5\x91", + "\xC4\xC9" => "\xE9\xA6\xA8", + "\xC4\xCA" => "\xE9\xA8\xAB", + "\xC4\xCB" => "\xE9\xA8\xB0", + "\xC4\xCC" => "\xE9\xA8\xB7", + "\xC4\xCD" => "\xE9\xA8\xB5", + "\xC4\xCE" => "\xE9\xB0\x93", + "\xC4\xCF" => "\xE9\xB0\x8D", + "\xC4\xD0" => "\xE9\xB9\xB9", + "\xC4\xD1" => "\xE9\xBA\xB5", + "\xC4\xD2" => "\xE9\xBB\xA8", + "\xC4\xD3" => "\xE9\xBC\xAF", + "\xC4\xD4" => "\xE9\xBD\x9F", + "\xC4\xD5" => "\xE9\xBD\xA3", + "\xC4\xD6" => "\xE9\xBD\xA1", + "\xC4\xD7" => "\xE5\x84\xB7", + "\xC4\xD8" => "\xE5\x84\xB8", + "\xC4\xD9" => "\xE5\x9B\x81", + "\xC4\xDA" => "\xE5\x9B\x80", + "\xC4\xDB" => "\xE5\x9B\x82", + "\xC4\xDC" => "\xE5\xA4\x94", + "\xC4\xDD" => "\xE5\xB1\xAC", + "\xC4\xDE" => "\xE5\xB7\x8D", + "\xC4\xDF" => "\xE6\x87\xBC", + "\xC4\xE0" => "\xE6\x87\xBE", + "\xC4\xE1" => "\xE6\x94\x9D", + "\xC4\xE2" => "\xE6\x94\x9C", + "\xC4\xE3" => "\xE6\x96\x95", + "\xC4\xE4" => "\xE6\x9B\xA9", + "\xC4\xE5" => "\xE6\xAB\xBB", + "\xC4\xE6" => "\xE6\xAC\x84", + "\xC4\xE7" => "\xE6\xAB\xBA", + "\xC4\xE8" => "\xE6\xAE\xB2", + "\xC4\xE9" => "\xE7\x81\x8C", + "\xC4\xEA" => "\xE7\x88\x9B", + "\xC4\xEB" => "\xE7\x8A\xA7", + "\xC4\xEC" => "\xE7\x93\x96", + "\xC4\xED" => "\xE7\x93\x94", + "\xC4\xEE" => "\xE7\x99\xA9", + "\xC4\xEF" => "\xE7\x9F\x93", + "\xC4\xF0" => "\xE7\xB1\x90", + "\xC4\xF1" => "\xE7\xBA\x8F", + "\xC4\xF2" => "\xE7\xBA\x8C", + "\xC4\xF3" => "\xE7\xBE\xBC", + "\xC4\xF4" => "\xE8\x98\x97", + "\xC4\xF5" => "\xE8\x98\xAD", + "\xC4\xF6" => "\xE8\x98\x9A", + "\xC4\xF7" => "\xE8\xA0\xA3", + "\xC4\xF8" => "\xE8\xA0\xA2", + "\xC4\xF9" => "\xE8\xA0\xA1", + "\xC4\xFA" => "\xE8\xA0\x9F", + "\xC4\xFB" => "\xE8\xA5\xAA", + "\xC4\xFC" => "\xE8\xA5\xAC", + "\xC4\xFD" => "\xE8\xA6\xBD", + "\xC4\xFE" => "\xE8\xAD\xB4", + "\xC5\x40" => "\xE8\xAD\xB7", + "\xC5\x41" => "\xE8\xAD\xBD", + "\xC5\x42" => "\xE8\xB4\x93", + "\xC5\x43" => "\xE8\xBA\x8A", + "\xC5\x44" => "\xE8\xBA\x8D", + "\xC5\x45" => "\xE8\xBA\x8B", + "\xC5\x46" => "\xE8\xBD\x9F", + "\xC5\x47" => "\xE8\xBE\xAF", + "\xC5\x48" => "\xE9\x86\xBA", + "\xC5\x49" => "\xE9\x90\xAE", + "\xC5\x4A" => "\xE9\x90\xB3", + "\xC5\x4B" => "\xE9\x90\xB5", + "\xC5\x4C" => "\xE9\x90\xBA", + "\xC5\x4D" => "\xE9\x90\xB8", + "\xC5\x4E" => "\xE9\x90\xB2", + "\xC5\x4F" => "\xE9\x90\xAB", + "\xC5\x50" => "\xE9\x97\xA2", + "\xC5\x51" => "\xE9\x9C\xB8", + "\xC5\x52" => "\xE9\x9C\xB9", + "\xC5\x53" => "\xE9\x9C\xB2", + "\xC5\x54" => "\xE9\x9F\xBF", + "\xC5\x55" => "\xE9\xA1\xA7", + "\xC5\x56" => "\xE9\xA1\xA5", + "\xC5\x57" => "\xE9\xA5\x97", + "\xC5\x58" => "\xE9\xA9\x85", + "\xC5\x59" => "\xE9\xA9\x83", + "\xC5\x5A" => "\xE9\xA9\x80", + "\xC5\x5B" => "\xE9\xA8\xBE", + "\xC5\x5C" => "\xE9\xAB\x8F", + "\xC5\x5D" => "\xE9\xAD\x94", + "\xC5\x5E" => "\xE9\xAD\x91", + "\xC5\x5F" => "\xE9\xB0\xAD", + "\xC5\x60" => "\xE9\xB0\xA5", + "\xC5\x61" => "\xE9\xB6\xAF", + "\xC5\x62" => "\xE9\xB6\xB4", + "\xC5\x63" => "\xE9\xB7\x82", + "\xC5\x64" => "\xE9\xB6\xB8", + "\xC5\x65" => "\xE9\xBA\x9D", + "\xC5\x66" => "\xE9\xBB\xAF", + "\xC5\x67" => "\xE9\xBC\x99", + "\xC5\x68" => "\xE9\xBD\x9C", + "\xC5\x69" => "\xE9\xBD\xA6", + "\xC5\x6A" => "\xE9\xBD\xA7", + "\xC5\x6B" => "\xE5\x84\xBC", + "\xC5\x6C" => "\xE5\x84\xBB", + "\xC5\x6D" => "\xE5\x9B\x88", + "\xC5\x6E" => "\xE5\x9B\x8A", + "\xC5\x6F" => "\xE5\x9B\x89", + "\xC5\x70" => "\xE5\xAD\xBF", + "\xC5\x71" => "\xE5\xB7\x94", + "\xC5\x72" => "\xE5\xB7\x92", + "\xC5\x73" => "\xE5\xBD\x8E", + "\xC5\x74" => "\xE6\x87\xBF", + "\xC5\x75" => "\xE6\x94\xA4", + "\xC5\x76" => "\xE6\xAC\x8A", + "\xC5\x77" => "\xE6\xAD\xA1", + "\xC5\x78" => "\xE7\x81\x91", + "\xC5\x79" => "\xE7\x81\x98", + "\xC5\x7A" => "\xE7\x8E\x80", + "\xC5\x7B" => "\xE7\x93\xA4", + "\xC5\x7C" => "\xE7\x96\x8A", + "\xC5\x7D" => "\xE7\x99\xAE", + "\xC5\x7E" => "\xE7\x99\xAC", + "\xC5\xA1" => "\xE7\xA6\xB3", + "\xC5\xA2" => "\xE7\xB1\xA0", + "\xC5\xA3" => "\xE7\xB1\x9F", + "\xC5\xA4" => "\xE8\x81\xBE", + "\xC5\xA5" => "\xE8\x81\xBD", + "\xC5\xA6" => "\xE8\x87\x9F", + "\xC5\xA7" => "\xE8\xA5\xB2", + "\xC5\xA8" => "\xE8\xA5\xAF", + "\xC5\xA9" => "\xE8\xA7\xBC", + "\xC5\xAA" => "\xE8\xAE\x80", + "\xC5\xAB" => "\xE8\xB4\x96", + "\xC5\xAC" => "\xE8\xB4\x97", + "\xC5\xAD" => "\xE8\xBA\x91", + "\xC5\xAE" => "\xE8\xBA\x93", + "\xC5\xAF" => "\xE8\xBD\xA1", + "\xC5\xB0" => "\xE9\x85\x88", + "\xC5\xB1" => "\xE9\x91\x84", + "\xC5\xB2" => "\xE9\x91\x91", + "\xC5\xB3" => "\xE9\x91\x92", + "\xC5\xB4" => "\xE9\x9C\xBD", + "\xC5\xB5" => "\xE9\x9C\xBE", + "\xC5\xB6" => "\xE9\x9F\x83", + "\xC5\xB7" => "\xE9\x9F\x81", + "\xC5\xB8" => "\xE9\xA1\xAB", + "\xC5\xB9" => "\xE9\xA5\x95", + "\xC5\xBA" => "\xE9\xA9\x95", + "\xC5\xBB" => "\xE9\xA9\x8D", + "\xC5\xBC" => "\xE9\xAB\x92", + "\xC5\xBD" => "\xE9\xAC\x9A", + "\xC5\xBE" => "\xE9\xB1\x89", + "\xC5\xBF" => "\xE9\xB0\xB1", + "\xC5\xC0" => "\xE9\xB0\xBE", + "\xC5\xC1" => "\xE9\xB0\xBB", + "\xC5\xC2" => "\xE9\xB7\x93", + "\xC5\xC3" => "\xE9\xB7\x97", + "\xC5\xC4" => "\xE9\xBC\xB4", + "\xC5\xC5" => "\xE9\xBD\xAC", + "\xC5\xC6" => "\xE9\xBD\xAA", + "\xC5\xC7" => "\xE9\xBE\x94", + "\xC5\xC8" => "\xE5\x9B\x8C", + "\xC5\xC9" => "\xE5\xB7\x96", + "\xC5\xCA" => "\xE6\x88\x80", + "\xC5\xCB" => "\xE6\x94\xA3", + "\xC5\xCC" => "\xE6\x94\xAB", + "\xC5\xCD" => "\xE6\x94\xAA", + "\xC5\xCE" => "\xE6\x9B\xAC", + "\xC5\xCF" => "\xE6\xAC\x90", + "\xC5\xD0" => "\xE7\x93\x9A", + "\xC5\xD1" => "\xE7\xAB\x8A", + "\xC5\xD2" => "\xE7\xB1\xA4", + "\xC5\xD3" => "\xE7\xB1\xA3", + "\xC5\xD4" => "\xE7\xB1\xA5", + "\xC5\xD5" => "\xE7\xBA\x93", + "\xC5\xD6" => "\xE7\xBA\x96", + "\xC5\xD7" => "\xE7\xBA\x94", + "\xC5\xD8" => "\xE8\x87\xA2", + "\xC5\xD9" => "\xE8\x98\xB8", + "\xC5\xDA" => "\xE8\x98\xBF", + "\xC5\xDB" => "\xE8\xA0\xB1", + "\xC5\xDC" => "\xE8\xAE\x8A", + "\xC5\xDD" => "\xE9\x82\x90", + "\xC5\xDE" => "\xE9\x82\x8F", + "\xC5\xDF" => "\xE9\x91\xA3", + "\xC5\xE0" => "\xE9\x91\xA0", + "\xC5\xE1" => "\xE9\x91\xA4", + "\xC5\xE2" => "\xE9\x9D\xA8", + "\xC5\xE3" => "\xE9\xA1\xAF", + "\xC5\xE4" => "\xE9\xA5\x9C", + "\xC5\xE5" => "\xE9\xA9\x9A", + "\xC5\xE6" => "\xE9\xA9\x9B", + "\xC5\xE7" => "\xE9\xA9\x97", + "\xC5\xE8" => "\xE9\xAB\x93", + "\xC5\xE9" => "\xE9\xAB\x94", + "\xC5\xEA" => "\xE9\xAB\x91", + "\xC5\xEB" => "\xE9\xB1\x94", + "\xC5\xEC" => "\xE9\xB1\x97", + "\xC5\xED" => "\xE9\xB1\x96", + "\xC5\xEE" => "\xE9\xB7\xA5", + "\xC5\xEF" => "\xE9\xBA\x9F", + "\xC5\xF0" => "\xE9\xBB\xB4", + "\xC5\xF1" => "\xE5\x9B\x91", + "\xC5\xF2" => "\xE5\xA3\xA9", + "\xC5\xF3" => "\xE6\x94\xAC", + "\xC5\xF4" => "\xE7\x81\x9E", + "\xC5\xF5" => "\xE7\x99\xB1", + "\xC5\xF6" => "\xE7\x99\xB2", + "\xC5\xF7" => "\xE7\x9F\x97", + "\xC5\xF8" => "\xE7\xBD\x90", + "\xC5\xF9" => "\xE7\xBE\x88", + "\xC5\xFA" => "\xE8\xA0\xB6", + "\xC5\xFB" => "\xE8\xA0\xB9", + "\xC5\xFC" => "\xE8\xA1\xA2", + "\xC5\xFD" => "\xE8\xAE\x93", + "\xC5\xFE" => "\xE8\xAE\x92", + "\xC6\x40" => "\xE8\xAE\x96", + "\xC6\x41" => "\xE8\x89\xB7", + "\xC6\x42" => "\xE8\xB4\x9B", + "\xC6\x43" => "\xE9\x87\x80", + "\xC6\x44" => "\xE9\x91\xAA", + "\xC6\x45" => "\xE9\x9D\x82", + "\xC6\x46" => "\xE9\x9D\x88", + "\xC6\x47" => "\xE9\x9D\x84", + "\xC6\x48" => "\xE9\x9F\x86", + "\xC6\x49" => "\xE9\xA1\xB0", + "\xC6\x4A" => "\xE9\xA9\x9F", + "\xC6\x4B" => "\xE9\xAC\xA2", + "\xC6\x4C" => "\xE9\xAD\x98", + "\xC6\x4D" => "\xE9\xB1\x9F", + "\xC6\x4E" => "\xE9\xB7\xB9", + "\xC6\x4F" => "\xE9\xB7\xBA", + "\xC6\x50" => "\xE9\xB9\xBC", + "\xC6\x51" => "\xE9\xB9\xBD", + "\xC6\x52" => "\xE9\xBC\x87", + "\xC6\x53" => "\xE9\xBD\xB7", + "\xC6\x54" => "\xE9\xBD\xB2", + "\xC6\x55" => "\xE5\xBB\xB3", + "\xC6\x56" => "\xE6\xAC\x96", + "\xC6\x57" => "\xE7\x81\xA3", + "\xC6\x58" => "\xE7\xB1\xAC", + "\xC6\x59" => "\xE7\xB1\xAE", + "\xC6\x5A" => "\xE8\xA0\xBB", + "\xC6\x5B" => "\xE8\xA7\x80", + "\xC6\x5C" => "\xE8\xBA\xA1", + "\xC6\x5D" => "\xE9\x87\x81", + "\xC6\x5E" => "\xE9\x91\xB2", + "\xC6\x5F" => "\xE9\x91\xB0", + "\xC6\x60" => "\xE9\xA1\xB1", + "\xC6\x61" => "\xE9\xA5\x9E", + "\xC6\x62" => "\xE9\xAB\x96", + "\xC6\x63" => "\xE9\xAC\xA3", + "\xC6\x64" => "\xE9\xBB\x8C", + "\xC6\x65" => "\xE7\x81\xA4", + "\xC6\x66" => "\xE7\x9F\x9A", + "\xC6\x67" => "\xE8\xAE\x9A", + "\xC6\x68" => "\xE9\x91\xB7", + "\xC6\x69" => "\xE9\x9F\x89", + "\xC6\x6A" => "\xE9\xA9\xA2", + "\xC6\x6B" => "\xE9\xA9\xA5", + "\xC6\x6C" => "\xE7\xBA\x9C", + "\xC6\x6D" => "\xE8\xAE\x9C", + "\xC6\x6E" => "\xE8\xBA\xAA", + "\xC6\x6F" => "\xE9\x87\x85", + "\xC6\x70" => "\xE9\x91\xBD", + "\xC6\x71" => "\xE9\x91\xBE", + "\xC6\x72" => "\xE9\x91\xBC", + "\xC6\x73" => "\xE9\xB1\xB7", + "\xC6\x74" => "\xE9\xB1\xB8", + "\xC6\x75" => "\xE9\xBB\xB7", + "\xC6\x76" => "\xE8\xB1\x94", + "\xC6\x77" => "\xE9\x91\xBF", + "\xC6\x78" => "\xE9\xB8\x9A", + "\xC6\x79" => "\xE7\x88\xA8", + "\xC6\x7A" => "\xE9\xA9\xAA", + "\xC6\x7B" => "\xE9\xAC\xB1", + "\xC6\x7C" => "\xE9\xB8\x9B", + "\xC6\x7D" => "\xE9\xB8\x9E", + "\xC6\x7E" => "\xE7\xB1\xB2", + "\xC6\xA1" => "\xE3\x83\xBE", + "\xC6\xA2" => "\xE3\x82\x9D", + "\xC6\xA3" => "\xE3\x82\x9E", + "\xC6\xA4" => "\xE3\x80\x85", + "\xC6\xA5" => "\xE3\x81\x81", + "\xC6\xA6" => "\xE3\x81\x82", + "\xC6\xA7" => "\xE3\x81\x83", + "\xC6\xA8" => "\xE3\x81\x84", + "\xC6\xA9" => "\xE3\x81\x85", + "\xC6\xAA" => "\xE3\x81\x86", + "\xC6\xAB" => "\xE3\x81\x87", + "\xC6\xAC" => "\xE3\x81\x88", + "\xC6\xAD" => "\xE3\x81\x89", + "\xC6\xAE" => "\xE3\x81\x8A", + "\xC6\xAF" => "\xE3\x81\x8B", + "\xC6\xB0" => "\xE3\x81\x8C", + "\xC6\xB1" => "\xE3\x81\x8D", + "\xC6\xB2" => "\xE3\x81\x8E", + "\xC6\xB3" => "\xE3\x81\x8F", + "\xC6\xB4" => "\xE3\x81\x90", + "\xC6\xB5" => "\xE3\x81\x91", + "\xC6\xB6" => "\xE3\x81\x92", + "\xC6\xB7" => "\xE3\x81\x93", + "\xC6\xB8" => "\xE3\x81\x94", + "\xC6\xB9" => "\xE3\x81\x95", + "\xC6\xBA" => "\xE3\x81\x96", + "\xC6\xBB" => "\xE3\x81\x97", + "\xC6\xBC" => "\xE3\x81\x98", + "\xC6\xBD" => "\xE3\x81\x99", + "\xC6\xBE" => "\xE3\x81\x9A", + "\xC6\xBF" => "\xE3\x81\x9B", + "\xC6\xC0" => "\xE3\x81\x9C", + "\xC6\xC1" => "\xE3\x81\x9D", + "\xC6\xC2" => "\xE3\x81\x9E", + "\xC6\xC3" => "\xE3\x81\x9F", + "\xC6\xC4" => "\xE3\x81\xA0", + "\xC6\xC5" => "\xE3\x81\xA1", + "\xC6\xC6" => "\xE3\x81\xA2", + "\xC6\xC7" => "\xE3\x81\xA3", + "\xC6\xC8" => "\xE3\x81\xA4", + "\xC6\xC9" => "\xE3\x81\xA5", + "\xC6\xCA" => "\xE3\x81\xA6", + "\xC6\xCB" => "\xE3\x81\xA7", + "\xC6\xCC" => "\xE3\x81\xA8", + "\xC6\xCD" => "\xE3\x81\xA9", + "\xC6\xCE" => "\xE3\x81\xAA", + "\xC6\xCF" => "\xE3\x81\xAB", + "\xC6\xD0" => "\xE3\x81\xAC", + "\xC6\xD1" => "\xE3\x81\xAD", + "\xC6\xD2" => "\xE3\x81\xAE", + "\xC6\xD3" => "\xE3\x81\xAF", + "\xC6\xD4" => "\xE3\x81\xB0", + "\xC6\xD5" => "\xE3\x81\xB1", + "\xC6\xD6" => "\xE3\x81\xB2", + "\xC6\xD7" => "\xE3\x81\xB3", + "\xC6\xD8" => "\xE3\x81\xB4", + "\xC6\xD9" => "\xE3\x81\xB5", + "\xC6\xDA" => "\xE3\x81\xB6", + "\xC6\xDB" => "\xE3\x81\xB7", + "\xC6\xDC" => "\xE3\x81\xB8", + "\xC6\xDD" => "\xE3\x81\xB9", + "\xC6\xDE" => "\xE3\x81\xBA", + "\xC6\xDF" => "\xE3\x81\xBB", + "\xC6\xE0" => "\xE3\x81\xBC", + "\xC6\xE1" => "\xE3\x81\xBD", + "\xC6\xE2" => "\xE3\x81\xBE", + "\xC6\xE3" => "\xE3\x81\xBF", + "\xC6\xE4" => "\xE3\x82\x80", + "\xC6\xE5" => "\xE3\x82\x81", + "\xC6\xE6" => "\xE3\x82\x82", + "\xC6\xE7" => "\xE3\x82\x83", + "\xC6\xE8" => "\xE3\x82\x84", + "\xC6\xE9" => "\xE3\x82\x85", + "\xC6\xEA" => "\xE3\x82\x86", + "\xC6\xEB" => "\xE3\x82\x87", + "\xC6\xEC" => "\xE3\x82\x88", + "\xC6\xED" => "\xE3\x82\x89", + "\xC6\xEE" => "\xE3\x82\x8A", + "\xC6\xEF" => "\xE3\x82\x8B", + "\xC6\xF0" => "\xE3\x82\x8C", + "\xC6\xF1" => "\xE3\x82\x8D", + "\xC6\xF2" => "\xE3\x82\x8E", + "\xC6\xF3" => "\xE3\x82\x8F", + "\xC6\xF4" => "\xE3\x82\x90", + "\xC6\xF5" => "\xE3\x82\x91", + "\xC6\xF6" => "\xE3\x82\x92", + "\xC6\xF7" => "\xE3\x82\x93", + "\xC6\xF8" => "\xE3\x82\xA1", + "\xC6\xF9" => "\xE3\x82\xA2", + "\xC6\xFA" => "\xE3\x82\xA3", + "\xC6\xFB" => "\xE3\x82\xA4", + "\xC6\xFC" => "\xE3\x82\xA5", + "\xC6\xFD" => "\xE3\x82\xA6", + "\xC6\xFE" => "\xE3\x82\xA7", + "\xC7\x40" => "\xE3\x82\xA8", + "\xC7\x41" => "\xE3\x82\xA9", + "\xC7\x42" => "\xE3\x82\xAA", + "\xC7\x43" => "\xE3\x82\xAB", + "\xC7\x44" => "\xE3\x82\xAC", + "\xC7\x45" => "\xE3\x82\xAD", + "\xC7\x46" => "\xE3\x82\xAE", + "\xC7\x47" => "\xE3\x82\xAF", + "\xC7\x48" => "\xE3\x82\xB0", + "\xC7\x49" => "\xE3\x82\xB1", + "\xC7\x4A" => "\xE3\x82\xB2", + "\xC7\x4B" => "\xE3\x82\xB3", + "\xC7\x4C" => "\xE3\x82\xB4", + "\xC7\x4D" => "\xE3\x82\xB5", + "\xC7\x4E" => "\xE3\x82\xB6", + "\xC7\x4F" => "\xE3\x82\xB7", + "\xC7\x50" => "\xE3\x82\xB8", + "\xC7\x51" => "\xE3\x82\xB9", + "\xC7\x52" => "\xE3\x82\xBA", + "\xC7\x53" => "\xE3\x82\xBB", + "\xC7\x54" => "\xE3\x82\xBC", + "\xC7\x55" => "\xE3\x82\xBD", + "\xC7\x56" => "\xE3\x82\xBE", + "\xC7\x57" => "\xE3\x82\xBF", + "\xC7\x58" => "\xE3\x83\x80", + "\xC7\x59" => "\xE3\x83\x81", + "\xC7\x5A" => "\xE3\x83\x82", + "\xC7\x5B" => "\xE3\x83\x83", + "\xC7\x5C" => "\xE3\x83\x84", + "\xC7\x5D" => "\xE3\x83\x85", + "\xC7\x5E" => "\xE3\x83\x86", + "\xC7\x5F" => "\xE3\x83\x87", + "\xC7\x60" => "\xE3\x83\x88", + "\xC7\x61" => "\xE3\x83\x89", + "\xC7\x62" => "\xE3\x83\x8A", + "\xC7\x63" => "\xE3\x83\x8B", + "\xC7\x64" => "\xE3\x83\x8C", + "\xC7\x65" => "\xE3\x83\x8D", + "\xC7\x66" => "\xE3\x83\x8E", + "\xC7\x67" => "\xE3\x83\x8F", + "\xC7\x68" => "\xE3\x83\x90", + "\xC7\x69" => "\xE3\x83\x91", + "\xC7\x6A" => "\xE3\x83\x92", + "\xC7\x6B" => "\xE3\x83\x93", + "\xC7\x6C" => "\xE3\x83\x94", + "\xC7\x6D" => "\xE3\x83\x95", + "\xC7\x6E" => "\xE3\x83\x96", + "\xC7\x6F" => "\xE3\x83\x97", + "\xC7\x70" => "\xE3\x83\x98", + "\xC7\x71" => "\xE3\x83\x99", + "\xC7\x72" => "\xE3\x83\x9A", + "\xC7\x73" => "\xE3\x83\x9B", + "\xC7\x74" => "\xE3\x83\x9C", + "\xC7\x75" => "\xE3\x83\x9D", + "\xC7\x76" => "\xE3\x83\x9E", + "\xC7\x77" => "\xE3\x83\x9F", + "\xC7\x78" => "\xE3\x83\xA0", + "\xC7\x79" => "\xE3\x83\xA1", + "\xC7\x7A" => "\xE3\x83\xA2", + "\xC7\x7B" => "\xE3\x83\xA3", + "\xC7\x7C" => "\xE3\x83\xA4", + "\xC7\x7D" => "\xE3\x83\xA5", + "\xC7\x7E" => "\xE3\x83\xA6", + "\xC7\xA1" => "\xE3\x83\xA7", + "\xC7\xA2" => "\xE3\x83\xA8", + "\xC7\xA3" => "\xE3\x83\xA9", + "\xC7\xA4" => "\xE3\x83\xAA", + "\xC7\xA5" => "\xE3\x83\xAB", + "\xC7\xA6" => "\xE3\x83\xAC", + "\xC7\xA7" => "\xE3\x83\xAD", + "\xC7\xA8" => "\xE3\x83\xAE", + "\xC7\xA9" => "\xE3\x83\xAF", + "\xC7\xAA" => "\xE3\x83\xB0", + "\xC7\xAB" => "\xE3\x83\xB1", + "\xC7\xAC" => "\xE3\x83\xB2", + "\xC7\xAD" => "\xE3\x83\xB3", + "\xC7\xAE" => "\xE3\x83\xB4", + "\xC7\xAF" => "\xE3\x83\xB5", + "\xC7\xB0" => "\xE3\x83\xB6", + "\xC7\xB1" => "\xD0\x94", + "\xC7\xB2" => "\xD0\x95", + "\xC7\xB3" => "\xD0\x81", + "\xC7\xB4" => "\xD0\x96", + "\xC7\xB5" => "\xD0\x97", + "\xC7\xB6" => "\xD0\x98", + "\xC7\xB7" => "\xD0\x99", + "\xC7\xB8" => "\xD0\x9A", + "\xC7\xB9" => "\xD0\x9B", + "\xC7\xBA" => "\xD0\x9C", + "\xC7\xBB" => "\xD0\xA3", + "\xC7\xBC" => "\xD0\xA4", + "\xC7\xBD" => "\xD0\xA5", + "\xC7\xBE" => "\xD0\xA6", + "\xC7\xBF" => "\xD0\xA7", + "\xC7\xC0" => "\xD0\xA8", + "\xC7\xC1" => "\xD0\xA9", + "\xC7\xC2" => "\xD0\xAA", + "\xC7\xC3" => "\xD0\xAB", + "\xC7\xC4" => "\xD0\xAC", + "\xC7\xC5" => "\xD0\xAD", + "\xC7\xC6" => "\xD0\xAE", + "\xC7\xC7" => "\xD0\xAF", + "\xC7\xC8" => "\xD0\xB0", + "\xC7\xC9" => "\xD0\xB1", + "\xC7\xCA" => "\xD0\xB2", + "\xC7\xCB" => "\xD0\xB3", + "\xC7\xCC" => "\xD0\xB4", + "\xC7\xCD" => "\xD0\xB5", + "\xC7\xCE" => "\xD1\x91", + "\xC7\xCF" => "\xD0\xB6", + "\xC7\xD0" => "\xD0\xB7", + "\xC7\xD1" => "\xD0\xB8", + "\xC7\xD2" => "\xD0\xB9", + "\xC7\xD3" => "\xD0\xBA", + "\xC7\xD4" => "\xD0\xBB", + "\xC7\xD5" => "\xD0\xBC", + "\xC7\xD6" => "\xD0\xBD", + "\xC7\xD7" => "\xD0\xBE", + "\xC7\xD8" => "\xD0\xBF", + "\xC7\xD9" => "\xD1\x80", + "\xC7\xDA" => "\xD1\x81", + "\xC7\xDB" => "\xD1\x82", + "\xC7\xDC" => "\xD1\x83", + "\xC7\xDD" => "\xD1\x84", + "\xC7\xDE" => "\xD1\x85", + "\xC7\xDF" => "\xD1\x86", + "\xC7\xE0" => "\xD1\x87", + "\xC7\xE1" => "\xD1\x88", + "\xC7\xE2" => "\xD1\x89", + "\xC7\xE3" => "\xD1\x8A", + "\xC7\xE4" => "\xD1\x8B", + "\xC7\xE5" => "\xD1\x8C", + "\xC7\xE6" => "\xD1\x8D", + "\xC7\xE7" => "\xD1\x8E", + "\xC7\xE8" => "\xD1\x8F", + "\xC7\xE9" => "\xE2\x91\xA0", + "\xC7\xEA" => "\xE2\x91\xA1", + "\xC7\xEB" => "\xE2\x91\xA2", + "\xC7\xEC" => "\xE2\x91\xA3", + "\xC7\xED" => "\xE2\x91\xA4", + "\xC7\xEE" => "\xE2\x91\xA5", + "\xC7\xEF" => "\xE2\x91\xA6", + "\xC7\xF0" => "\xE2\x91\xA7", + "\xC7\xF1" => "\xE2\x91\xA8", + "\xC7\xF2" => "\xE2\x91\xA9", + "\xC7\xF3" => "\xE2\x91\xB4", + "\xC7\xF4" => "\xE2\x91\xB5", + "\xC7\xF5" => "\xE2\x91\xB6", + "\xC7\xF6" => "\xE2\x91\xB7", + "\xC7\xF7" => "\xE2\x91\xB8", + "\xC7\xF8" => "\xE2\x91\xB9", + "\xC7\xF9" => "\xE2\x91\xBA", + "\xC7\xFA" => "\xE2\x91\xBB", + "\xC7\xFB" => "\xE2\x91\xBC", + "\xC7\xFC" => "\xE2\x91\xBD", + "\xC9\x40" => "\xE4\xB9\x82", + "\xC9\x41" => "\xE4\xB9\x9C", + "\xC9\x42" => "\xE5\x87\xB5", + "\xC9\x43" => "\xE5\x8C\x9A", + "\xC9\x44" => "\xE5\x8E\x82", + "\xC9\x45" => "\xE4\xB8\x87", + "\xC9\x46" => "\xE4\xB8\x8C", + "\xC9\x47" => "\xE4\xB9\x87", + "\xC9\x48" => "\xE4\xBA\x8D", + "\xC9\x49" => "\xE5\x9B\x97", + "\xC9\x4A" => "\xEF\xA8\x8C", + "\xC9\x4B" => "\xE5\xB1\xAE", + "\xC9\x4C" => "\xE5\xBD\xB3", + "\xC9\x4D" => "\xE4\xB8\x8F", + "\xC9\x4E" => "\xE5\x86\x87", + "\xC9\x4F" => "\xE4\xB8\x8E", + "\xC9\x50" => "\xE4\xB8\xAE", + "\xC9\x51" => "\xE4\xBA\x93", + "\xC9\x52" => "\xE4\xBB\x82", + "\xC9\x53" => "\xE4\xBB\x89", + "\xC9\x54" => "\xE4\xBB\x88", + "\xC9\x55" => "\xE5\x86\x98", + "\xC9\x56" => "\xE5\x8B\xBC", + "\xC9\x57" => "\xE5\x8D\xAC", + "\xC9\x58" => "\xE5\x8E\xB9", + "\xC9\x59" => "\xE5\x9C\xA0", + "\xC9\x5A" => "\xE5\xA4\x83", + "\xC9\x5B" => "\xE5\xA4\xAC", + "\xC9\x5C" => "\xE5\xB0\x90", + "\xC9\x5D" => "\xE5\xB7\xBF", + "\xC9\x5E" => "\xE6\x97\xA1", + "\xC9\x5F" => "\xE6\xAE\xB3", + "\xC9\x60" => "\xE6\xAF\x8C", + "\xC9\x61" => "\xE6\xB0\x94", + "\xC9\x62" => "\xE7\x88\xBF", + "\xC9\x63" => "\xE4\xB8\xB1", + "\xC9\x64" => "\xE4\xB8\xBC", + "\xC9\x65" => "\xE4\xBB\xA8", + "\xC9\x66" => "\xE4\xBB\x9C", + "\xC9\x67" => "\xE4\xBB\xA9", + "\xC9\x68" => "\xE4\xBB\xA1", + "\xC9\x69" => "\xE4\xBB\x9D", + "\xC9\x6A" => "\xE4\xBB\x9A", + "\xC9\x6B" => "\xE5\x88\x8C", + "\xC9\x6C" => "\xE5\x8C\x9C", + "\xC9\x6D" => "\xE5\x8D\x8C", + "\xC9\x6E" => "\xE5\x9C\xA2", + "\xC9\x6F" => "\xE5\x9C\xA3", + "\xC9\x70" => "\xE5\xA4\x97", + "\xC9\x71" => "\xE5\xA4\xAF", + "\xC9\x72" => "\xE5\xAE\x81", + "\xC9\x73" => "\xE5\xAE\x84", + "\xC9\x74" => "\xE5\xB0\x92", + "\xC9\x75" => "\xE5\xB0\xBB", + "\xC9\x76" => "\xE5\xB1\xB4", + "\xC9\x77" => "\xE5\xB1\xB3", + "\xC9\x78" => "\xE5\xB8\x84", + "\xC9\x79" => "\xE5\xBA\x80", + "\xC9\x7A" => "\xE5\xBA\x82", + "\xC9\x7B" => "\xE5\xBF\x89", + "\xC9\x7C" => "\xE6\x88\x89", + "\xC9\x7D" => "\xE6\x89\x90", + "\xC9\x7E" => "\xE6\xB0\x95", + "\xC9\xA1" => "\xE6\xB0\xB6", + "\xC9\xA2" => "\xE6\xB1\x83", + "\xC9\xA3" => "\xE6\xB0\xBF", + "\xC9\xA4" => "\xE6\xB0\xBB", + "\xC9\xA5" => "\xE7\x8A\xAE", + "\xC9\xA6" => "\xE7\x8A\xB0", + "\xC9\xA7" => "\xE7\x8E\x8A", + "\xC9\xA8" => "\xE7\xA6\xB8", + "\xC9\xA9" => "\xE8\x82\x8A", + "\xC9\xAA" => "\xE9\x98\x9E", + "\xC9\xAB" => "\xE4\xBC\x8E", + "\xC9\xAC" => "\xE4\xBC\x98", + "\xC9\xAD" => "\xE4\xBC\xAC", + "\xC9\xAE" => "\xE4\xBB\xB5", + "\xC9\xAF" => "\xE4\xBC\x94", + "\xC9\xB0" => "\xE4\xBB\xB1", + "\xC9\xB1" => "\xE4\xBC\x80", + "\xC9\xB2" => "\xE4\xBB\xB7", + "\xC9\xB3" => "\xE4\xBC\x88", + "\xC9\xB4" => "\xE4\xBC\x9D", + "\xC9\xB5" => "\xE4\xBC\x82", + "\xC9\xB6" => "\xE4\xBC\x85", + "\xC9\xB7" => "\xE4\xBC\xA2", + "\xC9\xB8" => "\xE4\xBC\x93", + "\xC9\xB9" => "\xE4\xBC\x84", + "\xC9\xBA" => "\xE4\xBB\xB4", + "\xC9\xBB" => "\xE4\xBC\x92", + "\xC9\xBC" => "\xE5\x86\xB1", + "\xC9\xBD" => "\xE5\x88\x93", + "\xC9\xBE" => "\xE5\x88\x89", + "\xC9\xBF" => "\xE5\x88\x90", + "\xC9\xC0" => "\xE5\x8A\xA6", + "\xC9\xC1" => "\xE5\x8C\xA2", + "\xC9\xC2" => "\xE5\x8C\x9F", + "\xC9\xC3" => "\xE5\x8D\x8D", + "\xC9\xC4" => "\xE5\x8E\x8A", + "\xC9\xC5" => "\xE5\x90\x87", + "\xC9\xC6" => "\xE5\x9B\xA1", + "\xC9\xC7" => "\xE5\x9B\x9F", + "\xC9\xC8" => "\xE5\x9C\xAE", + "\xC9\xC9" => "\xE5\x9C\xAA", + "\xC9\xCA" => "\xE5\x9C\xB4", + "\xC9\xCB" => "\xE5\xA4\xBC", + "\xC9\xCC" => "\xE5\xA6\x80", + "\xC9\xCD" => "\xE5\xA5\xBC", + "\xC9\xCE" => "\xE5\xA6\x85", + "\xC9\xCF" => "\xE5\xA5\xBB", + "\xC9\xD0" => "\xE5\xA5\xBE", + "\xC9\xD1" => "\xE5\xA5\xB7", + "\xC9\xD2" => "\xE5\xA5\xBF", + "\xC9\xD3" => "\xE5\xAD\x96", + "\xC9\xD4" => "\xE5\xB0\x95", + "\xC9\xD5" => "\xE5\xB0\xA5", + "\xC9\xD6" => "\xE5\xB1\xBC", + "\xC9\xD7" => "\xE5\xB1\xBA", + "\xC9\xD8" => "\xE5\xB1\xBB", + "\xC9\xD9" => "\xE5\xB1\xBE", + "\xC9\xDA" => "\xE5\xB7\x9F", + "\xC9\xDB" => "\xE5\xB9\xB5", + "\xC9\xDC" => "\xE5\xBA\x84", + "\xC9\xDD" => "\xE5\xBC\x82", + "\xC9\xDE" => "\xE5\xBC\x9A", + "\xC9\xDF" => "\xE5\xBD\xB4", + "\xC9\xE0" => "\xE5\xBF\x95", + "\xC9\xE1" => "\xE5\xBF\x94", + "\xC9\xE2" => "\xE5\xBF\x8F", + "\xC9\xE3" => "\xE6\x89\x9C", + "\xC9\xE4" => "\xE6\x89\x9E", + "\xC9\xE5" => "\xE6\x89\xA4", + "\xC9\xE6" => "\xE6\x89\xA1", + "\xC9\xE7" => "\xE6\x89\xA6", + "\xC9\xE8" => "\xE6\x89\xA2", + "\xC9\xE9" => "\xE6\x89\x99", + "\xC9\xEA" => "\xE6\x89\xA0", + "\xC9\xEB" => "\xE6\x89\x9A", + "\xC9\xEC" => "\xE6\x89\xA5", + "\xC9\xED" => "\xE6\x97\xAF", + "\xC9\xEE" => "\xE6\x97\xAE", + "\xC9\xEF" => "\xE6\x9C\xBE", + "\xC9\xF0" => "\xE6\x9C\xB9", + "\xC9\xF1" => "\xE6\x9C\xB8", + "\xC9\xF2" => "\xE6\x9C\xBB", + "\xC9\xF3" => "\xE6\x9C\xBA", + "\xC9\xF4" => "\xE6\x9C\xBF", + "\xC9\xF5" => "\xE6\x9C\xBC", + "\xC9\xF6" => "\xE6\x9C\xB3", + "\xC9\xF7" => "\xE6\xB0\x98", + "\xC9\xF8" => "\xE6\xB1\x86", + "\xC9\xF9" => "\xE6\xB1\x92", + "\xC9\xFA" => "\xE6\xB1\x9C", + "\xC9\xFB" => "\xE6\xB1\x8F", + "\xC9\xFC" => "\xE6\xB1\x8A", + "\xC9\xFD" => "\xE6\xB1\x94", + "\xC9\xFE" => "\xE6\xB1\x8B", + "\xCA\x40" => "\xE6\xB1\x8C", + "\xCA\x41" => "\xE7\x81\xB1", + "\xCA\x42" => "\xE7\x89\x9E", + "\xCA\x43" => "\xE7\x8A\xB4", + "\xCA\x44" => "\xE7\x8A\xB5", + "\xCA\x45" => "\xE7\x8E\x8E", + "\xCA\x46" => "\xE7\x94\xAA", + "\xCA\x47" => "\xE7\x99\xBF", + "\xCA\x48" => "\xE7\xA9\xB5", + "\xCA\x49" => "\xE7\xBD\x91", + "\xCA\x4A" => "\xE8\x89\xB8", + "\xCA\x4B" => "\xE8\x89\xBC", + "\xCA\x4C" => "\xE8\x8A\x80", + "\xCA\x4D" => "\xE8\x89\xBD", + "\xCA\x4E" => "\xE8\x89\xBF", + "\xCA\x4F" => "\xE8\x99\x8D", + "\xCA\x50" => "\xE8\xA5\xBE", + "\xCA\x51" => "\xE9\x82\x99", + "\xCA\x52" => "\xE9\x82\x97", + "\xCA\x53" => "\xE9\x82\x98", + "\xCA\x54" => "\xE9\x82\x9B", + "\xCA\x55" => "\xE9\x82\x94", + "\xCA\x56" => "\xE9\x98\xA2", + "\xCA\x57" => "\xE9\x98\xA4", + "\xCA\x58" => "\xE9\x98\xA0", + "\xCA\x59" => "\xE9\x98\xA3", + "\xCA\x5A" => "\xE4\xBD\x96", + "\xCA\x5B" => "\xE4\xBC\xBB", + "\xCA\x5C" => "\xE4\xBD\xA2", + "\xCA\x5D" => "\xE4\xBD\x89", + "\xCA\x5E" => "\xE4\xBD\x93", + "\xCA\x5F" => "\xE4\xBD\xA4", + "\xCA\x60" => "\xE4\xBC\xBE", + "\xCA\x61" => "\xE4\xBD\xA7", + "\xCA\x62" => "\xE4\xBD\x92", + "\xCA\x63" => "\xE4\xBD\x9F", + "\xCA\x64" => "\xE4\xBD\x81", + "\xCA\x65" => "\xE4\xBD\x98", + "\xCA\x66" => "\xE4\xBC\xAD", + "\xCA\x67" => "\xE4\xBC\xB3", + "\xCA\x68" => "\xE4\xBC\xBF", + "\xCA\x69" => "\xE4\xBD\xA1", + "\xCA\x6A" => "\xE5\x86\x8F", + "\xCA\x6B" => "\xE5\x86\xB9", + "\xCA\x6C" => "\xE5\x88\x9C", + "\xCA\x6D" => "\xE5\x88\x9E", + "\xCA\x6E" => "\xE5\x88\xA1", + "\xCA\x6F" => "\xE5\x8A\xAD", + "\xCA\x70" => "\xE5\x8A\xAE", + "\xCA\x71" => "\xE5\x8C\x89", + "\xCA\x72" => "\xE5\x8D\xA3", + "\xCA\x73" => "\xE5\x8D\xB2", + "\xCA\x74" => "\xE5\x8E\x8E", + "\xCA\x75" => "\xE5\x8E\x8F", + "\xCA\x76" => "\xE5\x90\xB0", + "\xCA\x77" => "\xE5\x90\xB7", + "\xCA\x78" => "\xE5\x90\xAA", + "\xCA\x79" => "\xE5\x91\x94", + "\xCA\x7A" => "\xE5\x91\x85", + "\xCA\x7B" => "\xE5\x90\x99", + "\xCA\x7C" => "\xE5\x90\x9C", + "\xCA\x7D" => "\xE5\x90\xA5", + "\xCA\x7E" => "\xE5\x90\x98", + "\xCA\xA1" => "\xE5\x90\xBD", + "\xCA\xA2" => "\xE5\x91\x8F", + "\xCA\xA3" => "\xE5\x91\x81", + "\xCA\xA4" => "\xE5\x90\xA8", + "\xCA\xA5" => "\xE5\x90\xA4", + "\xCA\xA6" => "\xE5\x91\x87", + "\xCA\xA7" => "\xE5\x9B\xAE", + "\xCA\xA8" => "\xE5\x9B\xA7", + "\xCA\xA9" => "\xE5\x9B\xA5", + "\xCA\xAA" => "\xE5\x9D\x81", + "\xCA\xAB" => "\xE5\x9D\x85", + "\xCA\xAC" => "\xE5\x9D\x8C", + "\xCA\xAD" => "\xE5\x9D\x89", + "\xCA\xAE" => "\xE5\x9D\x8B", + "\xCA\xAF" => "\xE5\x9D\x92", + "\xCA\xB0" => "\xE5\xA4\x86", + "\xCA\xB1" => "\xE5\xA5\x80", + "\xCA\xB2" => "\xE5\xA6\xA6", + "\xCA\xB3" => "\xE5\xA6\x98", + "\xCA\xB4" => "\xE5\xA6\xA0", + "\xCA\xB5" => "\xE5\xA6\x97", + "\xCA\xB6" => "\xE5\xA6\x8E", + "\xCA\xB7" => "\xE5\xA6\xA2", + "\xCA\xB8" => "\xE5\xA6\x90", + "\xCA\xB9" => "\xE5\xA6\x8F", + "\xCA\xBA" => "\xE5\xA6\xA7", + "\xCA\xBB" => "\xE5\xA6\xA1", + "\xCA\xBC" => "\xE5\xAE\x8E", + "\xCA\xBD" => "\xE5\xAE\x92", + "\xCA\xBE" => "\xE5\xB0\xA8", + "\xCA\xBF" => "\xE5\xB0\xAA", + "\xCA\xC0" => "\xE5\xB2\x8D", + "\xCA\xC1" => "\xE5\xB2\x8F", + "\xCA\xC2" => "\xE5\xB2\x88", + "\xCA\xC3" => "\xE5\xB2\x8B", + "\xCA\xC4" => "\xE5\xB2\x89", + "\xCA\xC5" => "\xE5\xB2\x92", + "\xCA\xC6" => "\xE5\xB2\x8A", + "\xCA\xC7" => "\xE5\xB2\x86", + "\xCA\xC8" => "\xE5\xB2\x93", + "\xCA\xC9" => "\xE5\xB2\x95", + "\xCA\xCA" => "\xE5\xB7\xA0", + "\xCA\xCB" => "\xE5\xB8\x8A", + "\xCA\xCC" => "\xE5\xB8\x8E", + "\xCA\xCD" => "\xE5\xBA\x8B", + "\xCA\xCE" => "\xE5\xBA\x89", + "\xCA\xCF" => "\xE5\xBA\x8C", + "\xCA\xD0" => "\xE5\xBA\x88", + "\xCA\xD1" => "\xE5\xBA\x8D", + "\xCA\xD2" => "\xE5\xBC\x85", + "\xCA\xD3" => "\xE5\xBC\x9D", + "\xCA\xD4" => "\xE5\xBD\xB8", + "\xCA\xD5" => "\xE5\xBD\xB6", + "\xCA\xD6" => "\xE5\xBF\x92", + "\xCA\xD7" => "\xE5\xBF\x91", + "\xCA\xD8" => "\xE5\xBF\x90", + "\xCA\xD9" => "\xE5\xBF\xAD", + "\xCA\xDA" => "\xE5\xBF\xA8", + "\xCA\xDB" => "\xE5\xBF\xAE", + "\xCA\xDC" => "\xE5\xBF\xB3", + "\xCA\xDD" => "\xE5\xBF\xA1", + "\xCA\xDE" => "\xE5\xBF\xA4", + "\xCA\xDF" => "\xE5\xBF\xA3", + "\xCA\xE0" => "\xE5\xBF\xBA", + "\xCA\xE1" => "\xE5\xBF\xAF", + "\xCA\xE2" => "\xE5\xBF\xB7", + "\xCA\xE3" => "\xE5\xBF\xBB", + "\xCA\xE4" => "\xE6\x80\x80", + "\xCA\xE5" => "\xE5\xBF\xB4", + "\xCA\xE6" => "\xE6\x88\xBA", + "\xCA\xE7" => "\xE6\x8A\x83", + "\xCA\xE8" => "\xE6\x8A\x8C", + "\xCA\xE9" => "\xE6\x8A\x8E", + "\xCA\xEA" => "\xE6\x8A\x8F", + "\xCA\xEB" => "\xE6\x8A\x94", + "\xCA\xEC" => "\xE6\x8A\x87", + "\xCA\xED" => "\xE6\x89\xB1", + "\xCA\xEE" => "\xE6\x89\xBB", + "\xCA\xEF" => "\xE6\x89\xBA", + "\xCA\xF0" => "\xE6\x89\xB0", + "\xCA\xF1" => "\xE6\x8A\x81", + "\xCA\xF2" => "\xE6\x8A\x88", + "\xCA\xF3" => "\xE6\x89\xB7", + "\xCA\xF4" => "\xE6\x89\xBD", + "\xCA\xF5" => "\xE6\x89\xB2", + "\xCA\xF6" => "\xE6\x89\xB4", + "\xCA\xF7" => "\xE6\x94\xB7", + "\xCA\xF8" => "\xE6\x97\xB0", + "\xCA\xF9" => "\xE6\x97\xB4", + "\xCA\xFA" => "\xE6\x97\xB3", + "\xCA\xFB" => "\xE6\x97\xB2", + "\xCA\xFC" => "\xE6\x97\xB5", + "\xCA\xFD" => "\xE6\x9D\x85", + "\xCA\xFE" => "\xE6\x9D\x87", + "\xCB\x40" => "\xE6\x9D\x99", + "\xCB\x41" => "\xE6\x9D\x95", + "\xCB\x42" => "\xE6\x9D\x8C", + "\xCB\x43" => "\xE6\x9D\x88", + "\xCB\x44" => "\xE6\x9D\x9D", + "\xCB\x45" => "\xE6\x9D\x8D", + "\xCB\x46" => "\xE6\x9D\x9A", + "\xCB\x47" => "\xE6\x9D\x8B", + "\xCB\x48" => "\xE6\xAF\x90", + "\xCB\x49" => "\xE6\xB0\x99", + "\xCB\x4A" => "\xE6\xB0\x9A", + "\xCB\x4B" => "\xE6\xB1\xB8", + "\xCB\x4C" => "\xE6\xB1\xA7", + "\xCB\x4D" => "\xE6\xB1\xAB", + "\xCB\x4E" => "\xE6\xB2\x84", + "\xCB\x4F" => "\xE6\xB2\x8B", + "\xCB\x50" => "\xE6\xB2\x8F", + "\xCB\x51" => "\xE6\xB1\xB1", + "\xCB\x52" => "\xE6\xB1\xAF", + "\xCB\x53" => "\xE6\xB1\xA9", + "\xCB\x54" => "\xE6\xB2\x9A", + "\xCB\x55" => "\xE6\xB1\xAD", + "\xCB\x56" => "\xE6\xB2\x87", + "\xCB\x57" => "\xE6\xB2\x95", + "\xCB\x58" => "\xE6\xB2\x9C", + "\xCB\x59" => "\xE6\xB1\xA6", + "\xCB\x5A" => "\xE6\xB1\xB3", + "\xCB\x5B" => "\xE6\xB1\xA5", + "\xCB\x5C" => "\xE6\xB1\xBB", + "\xCB\x5D" => "\xE6\xB2\x8E", + "\xCB\x5E" => "\xE7\x81\xB4", + "\xCB\x5F" => "\xE7\x81\xBA", + "\xCB\x60" => "\xE7\x89\xA3", + "\xCB\x61" => "\xE7\x8A\xBF", + "\xCB\x62" => "\xE7\x8A\xBD", + "\xCB\x63" => "\xE7\x8B\x83", + "\xCB\x64" => "\xE7\x8B\x86", + "\xCB\x65" => "\xE7\x8B\x81", + "\xCB\x66" => "\xE7\x8A\xBA", + "\xCB\x67" => "\xE7\x8B\x85", + "\xCB\x68" => "\xE7\x8E\x95", + "\xCB\x69" => "\xE7\x8E\x97", + "\xCB\x6A" => "\xE7\x8E\x93", + "\xCB\x6B" => "\xE7\x8E\x94", + "\xCB\x6C" => "\xE7\x8E\x92", + "\xCB\x6D" => "\xE7\x94\xBA", + "\xCB\x6E" => "\xE7\x94\xB9", + "\xCB\x6F" => "\xE7\x96\x94", + "\xCB\x70" => "\xE7\x96\x95", + "\xCB\x71" => "\xE7\x9A\x81", + "\xCB\x72" => "\xE7\xA4\xBD", + "\xCB\x73" => "\xE8\x80\xB4", + "\xCB\x74" => "\xE8\x82\x95", + "\xCB\x75" => "\xE8\x82\x99", + "\xCB\x76" => "\xE8\x82\x90", + "\xCB\x77" => "\xE8\x82\x92", + "\xCB\x78" => "\xE8\x82\x9C", + "\xCB\x79" => "\xE8\x8A\x90", + "\xCB\x7A" => "\xE8\x8A\x8F", + "\xCB\x7B" => "\xE8\x8A\x85", + "\xCB\x7C" => "\xE8\x8A\x8E", + "\xCB\x7D" => "\xE8\x8A\x91", + "\xCB\x7E" => "\xE8\x8A\x93", + "\xCB\xA1" => "\xE8\x8A\x8A", + "\xCB\xA2" => "\xE8\x8A\x83", + "\xCB\xA3" => "\xE8\x8A\x84", + "\xCB\xA4" => "\xE8\xB1\xB8", + "\xCB\xA5" => "\xE8\xBF\x89", + "\xCB\xA6" => "\xE8\xBE\xBF", + "\xCB\xA7" => "\xE9\x82\x9F", + "\xCB\xA8" => "\xE9\x82\xA1", + "\xCB\xA9" => "\xE9\x82\xA5", + "\xCB\xAA" => "\xE9\x82\x9E", + "\xCB\xAB" => "\xE9\x82\xA7", + "\xCB\xAC" => "\xE9\x82\xA0", + "\xCB\xAD" => "\xE9\x98\xB0", + "\xCB\xAE" => "\xE9\x98\xA8", + "\xCB\xAF" => "\xE9\x98\xAF", + "\xCB\xB0" => "\xE9\x98\xAD", + "\xCB\xB1" => "\xE4\xB8\xB3", + "\xCB\xB2" => "\xE4\xBE\x98", + "\xCB\xB3" => "\xE4\xBD\xBC", + "\xCB\xB4" => "\xE4\xBE\x85", + "\xCB\xB5" => "\xE4\xBD\xBD", + "\xCB\xB6" => "\xE4\xBE\x80", + "\xCB\xB7" => "\xE4\xBE\x87", + "\xCB\xB8" => "\xE4\xBD\xB6", + "\xCB\xB9" => "\xE4\xBD\xB4", + "\xCB\xBA" => "\xE4\xBE\x89", + "\xCB\xBB" => "\xE4\xBE\x84", + "\xCB\xBC" => "\xE4\xBD\xB7", + "\xCB\xBD" => "\xE4\xBD\x8C", + "\xCB\xBE" => "\xE4\xBE\x97", + "\xCB\xBF" => "\xE4\xBD\xAA", + "\xCB\xC0" => "\xE4\xBE\x9A", + "\xCB\xC1" => "\xE4\xBD\xB9", + "\xCB\xC2" => "\xE4\xBE\x81", + "\xCB\xC3" => "\xE4\xBD\xB8", + "\xCB\xC4" => "\xE4\xBE\x90", + "\xCB\xC5" => "\xE4\xBE\x9C", + "\xCB\xC6" => "\xE4\xBE\x94", + "\xCB\xC7" => "\xE4\xBE\x9E", + "\xCB\xC8" => "\xE4\xBE\x92", + "\xCB\xC9" => "\xE4\xBE\x82", + "\xCB\xCA" => "\xE4\xBE\x95", + "\xCB\xCB" => "\xE4\xBD\xAB", + "\xCB\xCC" => "\xE4\xBD\xAE", + "\xCB\xCD" => "\xE5\x86\x9E", + "\xCB\xCE" => "\xE5\x86\xBC", + "\xCB\xCF" => "\xE5\x86\xBE", + "\xCB\xD0" => "\xE5\x88\xB5", + "\xCB\xD1" => "\xE5\x88\xB2", + "\xCB\xD2" => "\xE5\x88\xB3", + "\xCB\xD3" => "\xE5\x89\x86", + "\xCB\xD4" => "\xE5\x88\xB1", + "\xCB\xD5" => "\xE5\x8A\xBC", + "\xCB\xD6" => "\xE5\x8C\x8A", + "\xCB\xD7" => "\xE5\x8C\x8B", + "\xCB\xD8" => "\xE5\x8C\xBC", + "\xCB\xD9" => "\xE5\x8E\x92", + "\xCB\xDA" => "\xE5\x8E\x94", + "\xCB\xDB" => "\xE5\x92\x87", + "\xCB\xDC" => "\xE5\x91\xBF", + "\xCB\xDD" => "\xE5\x92\x81", + "\xCB\xDE" => "\xE5\x92\x91", + "\xCB\xDF" => "\xE5\x92\x82", + "\xCB\xE0" => "\xE5\x92\x88", + "\xCB\xE1" => "\xE5\x91\xAB", + "\xCB\xE2" => "\xE5\x91\xBA", + "\xCB\xE3" => "\xE5\x91\xBE", + "\xCB\xE4" => "\xE5\x91\xA5", + "\xCB\xE5" => "\xE5\x91\xAC", + "\xCB\xE6" => "\xE5\x91\xB4", + "\xCB\xE7" => "\xE5\x91\xA6", + "\xCB\xE8" => "\xE5\x92\x8D", + "\xCB\xE9" => "\xE5\x91\xAF", + "\xCB\xEA" => "\xE5\x91\xA1", + "\xCB\xEB" => "\xE5\x91\xA0", + "\xCB\xEC" => "\xE5\x92\x98", + "\xCB\xED" => "\xE5\x91\xA3", + "\xCB\xEE" => "\xE5\x91\xA7", + "\xCB\xEF" => "\xE5\x91\xA4", + "\xCB\xF0" => "\xE5\x9B\xB7", + "\xCB\xF1" => "\xE5\x9B\xB9", + "\xCB\xF2" => "\xE5\x9D\xAF", + "\xCB\xF3" => "\xE5\x9D\xB2", + "\xCB\xF4" => "\xE5\x9D\xAD", + "\xCB\xF5" => "\xE5\x9D\xAB", + "\xCB\xF6" => "\xE5\x9D\xB1", + "\xCB\xF7" => "\xE5\x9D\xB0", + "\xCB\xF8" => "\xE5\x9D\xB6", + "\xCB\xF9" => "\xE5\x9E\x80", + "\xCB\xFA" => "\xE5\x9D\xB5", + "\xCB\xFB" => "\xE5\x9D\xBB", + "\xCB\xFC" => "\xE5\x9D\xB3", + "\xCB\xFD" => "\xE5\x9D\xB4", + "\xCB\xFE" => "\xE5\x9D\xA2", + "\xCC\x40" => "\xE5\x9D\xA8", + "\xCC\x41" => "\xE5\x9D\xBD", + "\xCC\x42" => "\xE5\xA4\x8C", + "\xCC\x43" => "\xE5\xA5\x85", + "\xCC\x44" => "\xE5\xA6\xB5", + "\xCC\x45" => "\xE5\xA6\xBA", + "\xCC\x46" => "\xE5\xA7\x8F", + "\xCC\x47" => "\xE5\xA7\x8E", + "\xCC\x48" => "\xE5\xA6\xB2", + "\xCC\x49" => "\xE5\xA7\x8C", + "\xCC\x4A" => "\xE5\xA7\x81", + "\xCC\x4B" => "\xE5\xA6\xB6", + "\xCC\x4C" => "\xE5\xA6\xBC", + "\xCC\x4D" => "\xE5\xA7\x83", + "\xCC\x4E" => "\xE5\xA7\x96", + "\xCC\x4F" => "\xE5\xA6\xB1", + "\xCC\x50" => "\xE5\xA6\xBD", + "\xCC\x51" => "\xE5\xA7\x80", + "\xCC\x52" => "\xE5\xA7\x88", + "\xCC\x53" => "\xE5\xA6\xB4", + "\xCC\x54" => "\xE5\xA7\x87", + "\xCC\x55" => "\xE5\xAD\xA2", + "\xCC\x56" => "\xE5\xAD\xA5", + "\xCC\x57" => "\xE5\xAE\x93", + "\xCC\x58" => "\xE5\xAE\x95", + "\xCC\x59" => "\xE5\xB1\x84", + "\xCC\x5A" => "\xE5\xB1\x87", + "\xCC\x5B" => "\xE5\xB2\xAE", + "\xCC\x5C" => "\xE5\xB2\xA4", + "\xCC\x5D" => "\xE5\xB2\xA0", + "\xCC\x5E" => "\xE5\xB2\xB5", + "\xCC\x5F" => "\xE5\xB2\xAF", + "\xCC\x60" => "\xE5\xB2\xA8", + "\xCC\x61" => "\xE5\xB2\xAC", + "\xCC\x62" => "\xE5\xB2\x9F", + "\xCC\x63" => "\xE5\xB2\xA3", + "\xCC\x64" => "\xE5\xB2\xAD", + "\xCC\x65" => "\xE5\xB2\xA2", + "\xCC\x66" => "\xE5\xB2\xAA", + "\xCC\x67" => "\xE5\xB2\xA7", + "\xCC\x68" => "\xE5\xB2\x9D", + "\xCC\x69" => "\xE5\xB2\xA5", + "\xCC\x6A" => "\xE5\xB2\xB6", + "\xCC\x6B" => "\xE5\xB2\xB0", + "\xCC\x6C" => "\xE5\xB2\xA6", + "\xCC\x6D" => "\xE5\xB8\x97", + "\xCC\x6E" => "\xE5\xB8\x94", + "\xCC\x6F" => "\xE5\xB8\x99", + "\xCC\x70" => "\xE5\xBC\xA8", + "\xCC\x71" => "\xE5\xBC\xA2", + "\xCC\x72" => "\xE5\xBC\xA3", + "\xCC\x73" => "\xE5\xBC\xA4", + "\xCC\x74" => "\xE5\xBD\x94", + "\xCC\x75" => "\xE5\xBE\x82", + "\xCC\x76" => "\xE5\xBD\xBE", + "\xCC\x77" => "\xE5\xBD\xBD", + "\xCC\x78" => "\xE5\xBF\x9E", + "\xCC\x79" => "\xE5\xBF\xA5", + "\xCC\x7A" => "\xE6\x80\xAD", + "\xCC\x7B" => "\xE6\x80\xA6", + "\xCC\x7C" => "\xE6\x80\x99", + "\xCC\x7D" => "\xE6\x80\xB2", + "\xCC\x7E" => "\xE6\x80\x8B", + "\xCC\xA1" => "\xE6\x80\xB4", + "\xCC\xA2" => "\xE6\x80\x8A", + "\xCC\xA3" => "\xE6\x80\x97", + "\xCC\xA4" => "\xE6\x80\xB3", + "\xCC\xA5" => "\xE6\x80\x9A", + "\xCC\xA6" => "\xE6\x80\x9E", + "\xCC\xA7" => "\xE6\x80\xAC", + "\xCC\xA8" => "\xE6\x80\xA2", + "\xCC\xA9" => "\xE6\x80\x8D", + "\xCC\xAA" => "\xE6\x80\x90", + "\xCC\xAB" => "\xE6\x80\xAE", + "\xCC\xAC" => "\xE6\x80\x93", + "\xCC\xAD" => "\xE6\x80\x91", + "\xCC\xAE" => "\xE6\x80\x8C", + "\xCC\xAF" => "\xE6\x80\x89", + "\xCC\xB0" => "\xE6\x80\x9C", + "\xCC\xB1" => "\xE6\x88\x94", + "\xCC\xB2" => "\xE6\x88\xBD", + "\xCC\xB3" => "\xE6\x8A\xAD", + "\xCC\xB4" => "\xE6\x8A\xB4", + "\xCC\xB5" => "\xE6\x8B\x91", + "\xCC\xB6" => "\xE6\x8A\xBE", + "\xCC\xB7" => "\xE6\x8A\xAA", + "\xCC\xB8" => "\xE6\x8A\xB6", + "\xCC\xB9" => "\xE6\x8B\x8A", + "\xCC\xBA" => "\xE6\x8A\xAE", + "\xCC\xBB" => "\xE6\x8A\xB3", + "\xCC\xBC" => "\xE6\x8A\xAF", + "\xCC\xBD" => "\xE6\x8A\xBB", + "\xCC\xBE" => "\xE6\x8A\xA9", + "\xCC\xBF" => "\xE6\x8A\xB0", + "\xCC\xC0" => "\xE6\x8A\xB8", + "\xCC\xC1" => "\xE6\x94\xBD", + "\xCC\xC2" => "\xE6\x96\xA8", + "\xCC\xC3" => "\xE6\x96\xBB", + "\xCC\xC4" => "\xE6\x98\x89", + "\xCC\xC5" => "\xE6\x97\xBC", + "\xCC\xC6" => "\xE6\x98\x84", + "\xCC\xC7" => "\xE6\x98\x92", + "\xCC\xC8" => "\xE6\x98\x88", + "\xCC\xC9" => "\xE6\x97\xBB", + "\xCC\xCA" => "\xE6\x98\x83", + "\xCC\xCB" => "\xE6\x98\x8B", + "\xCC\xCC" => "\xE6\x98\x8D", + "\xCC\xCD" => "\xE6\x98\x85", + "\xCC\xCE" => "\xE6\x97\xBD", + "\xCC\xCF" => "\xE6\x98\x91", + "\xCC\xD0" => "\xE6\x98\x90", + "\xCC\xD1" => "\xE6\x9B\xB6", + "\xCC\xD2" => "\xE6\x9C\x8A", + "\xCC\xD3" => "\xE6\x9E\x85", + "\xCC\xD4" => "\xE6\x9D\xAC", + "\xCC\xD5" => "\xE6\x9E\x8E", + "\xCC\xD6" => "\xE6\x9E\x92", + "\xCC\xD7" => "\xE6\x9D\xB6", + "\xCC\xD8" => "\xE6\x9D\xBB", + "\xCC\xD9" => "\xE6\x9E\x98", + "\xCC\xDA" => "\xE6\x9E\x86", + "\xCC\xDB" => "\xE6\x9E\x84", + "\xCC\xDC" => "\xE6\x9D\xB4", + "\xCC\xDD" => "\xE6\x9E\x8D", + "\xCC\xDE" => "\xE6\x9E\x8C", + "\xCC\xDF" => "\xE6\x9D\xBA", + "\xCC\xE0" => "\xE6\x9E\x9F", + "\xCC\xE1" => "\xE6\x9E\x91", + "\xCC\xE2" => "\xE6\x9E\x99", + "\xCC\xE3" => "\xE6\x9E\x83", + "\xCC\xE4" => "\xE6\x9D\xBD", + "\xCC\xE5" => "\xE6\x9E\x81", + "\xCC\xE6" => "\xE6\x9D\xB8", + "\xCC\xE7" => "\xE6\x9D\xB9", + "\xCC\xE8" => "\xE6\x9E\x94", + "\xCC\xE9" => "\xE6\xAC\xA5", + "\xCC\xEA" => "\xE6\xAE\x80", + "\xCC\xEB" => "\xE6\xAD\xBE", + "\xCC\xEC" => "\xE6\xAF\x9E", + "\xCC\xED" => "\xE6\xB0\x9D", + "\xCC\xEE" => "\xE6\xB2\x93", + "\xCC\xEF" => "\xE6\xB3\xAC", + "\xCC\xF0" => "\xE6\xB3\xAB", + "\xCC\xF1" => "\xE6\xB3\xAE", + "\xCC\xF2" => "\xE6\xB3\x99", + "\xCC\xF3" => "\xE6\xB2\xB6", + "\xCC\xF4" => "\xE6\xB3\x94", + "\xCC\xF5" => "\xE6\xB2\xAD", + "\xCC\xF6" => "\xE6\xB3\xA7", + "\xCC\xF7" => "\xE6\xB2\xB7", + "\xCC\xF8" => "\xE6\xB3\x90", + "\xCC\xF9" => "\xE6\xB3\x82", + "\xCC\xFA" => "\xE6\xB2\xBA", + "\xCC\xFB" => "\xE6\xB3\x83", + "\xCC\xFC" => "\xE6\xB3\x86", + "\xCC\xFD" => "\xE6\xB3\xAD", + "\xCC\xFE" => "\xE6\xB3\xB2", + "\xCD\x40" => "\xE6\xB3\x92", + "\xCD\x41" => "\xE6\xB3\x9D", + "\xCD\x42" => "\xE6\xB2\xB4", + "\xCD\x43" => "\xE6\xB2\x8A", + "\xCD\x44" => "\xE6\xB2\x9D", + "\xCD\x45" => "\xE6\xB2\x80", + "\xCD\x46" => "\xE6\xB3\x9E", + "\xCD\x47" => "\xE6\xB3\x80", + "\xCD\x48" => "\xE6\xB4\xB0", + "\xCD\x49" => "\xE6\xB3\x8D", + "\xCD\x4A" => "\xE6\xB3\x87", + "\xCD\x4B" => "\xE6\xB2\xB0", + "\xCD\x4C" => "\xE6\xB3\xB9", + "\xCD\x4D" => "\xE6\xB3\x8F", + "\xCD\x4E" => "\xE6\xB3\xA9", + "\xCD\x4F" => "\xE6\xB3\x91", + "\xCD\x50" => "\xE7\x82\x94", + "\xCD\x51" => "\xE7\x82\x98", + "\xCD\x52" => "\xE7\x82\x85", + "\xCD\x53" => "\xE7\x82\x93", + "\xCD\x54" => "\xE7\x82\x86", + "\xCD\x55" => "\xE7\x82\x84", + "\xCD\x56" => "\xE7\x82\x91", + "\xCD\x57" => "\xE7\x82\x96", + "\xCD\x58" => "\xE7\x82\x82", + "\xCD\x59" => "\xE7\x82\x9A", + "\xCD\x5A" => "\xE7\x82\x83", + "\xCD\x5B" => "\xE7\x89\xAA", + "\xCD\x5C" => "\xE7\x8B\x96", + "\xCD\x5D" => "\xE7\x8B\x8B", + "\xCD\x5E" => "\xE7\x8B\x98", + "\xCD\x5F" => "\xE7\x8B\x89", + "\xCD\x60" => "\xE7\x8B\x9C", + "\xCD\x61" => "\xE7\x8B\x92", + "\xCD\x62" => "\xE7\x8B\x94", + "\xCD\x63" => "\xE7\x8B\x9A", + "\xCD\x64" => "\xE7\x8B\x8C", + "\xCD\x65" => "\xE7\x8B\x91", + "\xCD\x66" => "\xE7\x8E\xA4", + "\xCD\x67" => "\xE7\x8E\xA1", + "\xCD\x68" => "\xE7\x8E\xAD", + "\xCD\x69" => "\xE7\x8E\xA6", + "\xCD\x6A" => "\xE7\x8E\xA2", + "\xCD\x6B" => "\xE7\x8E\xA0", + "\xCD\x6C" => "\xE7\x8E\xAC", + "\xCD\x6D" => "\xE7\x8E\x9D", + "\xCD\x6E" => "\xE7\x93\x9D", + "\xCD\x6F" => "\xE7\x93\xA8", + "\xCD\x70" => "\xE7\x94\xBF", + "\xCD\x71" => "\xE7\x95\x80", + "\xCD\x72" => "\xE7\x94\xBE", + "\xCD\x73" => "\xE7\x96\x8C", + "\xCD\x74" => "\xE7\x96\x98", + "\xCD\x75" => "\xE7\x9A\xAF", + "\xCD\x76" => "\xE7\x9B\xB3", + "\xCD\x77" => "\xE7\x9B\xB1", + "\xCD\x78" => "\xE7\x9B\xB0", + "\xCD\x79" => "\xE7\x9B\xB5", + "\xCD\x7A" => "\xE7\x9F\xB8", + "\xCD\x7B" => "\xE7\x9F\xBC", + "\xCD\x7C" => "\xE7\x9F\xB9", + "\xCD\x7D" => "\xE7\x9F\xBB", + "\xCD\x7E" => "\xE7\x9F\xBA", + "\xCD\xA1" => "\xE7\x9F\xB7", + "\xCD\xA2" => "\xE7\xA5\x82", + "\xCD\xA3" => "\xE7\xA4\xBF", + "\xCD\xA4" => "\xE7\xA7\x85", + "\xCD\xA5" => "\xE7\xA9\xB8", + "\xCD\xA6" => "\xE7\xA9\xBB", + "\xCD\xA7" => "\xE7\xAB\xBB", + "\xCD\xA8" => "\xE7\xB1\xB5", + "\xCD\xA9" => "\xE7\xB3\xBD", + "\xCD\xAA" => "\xE8\x80\xB5", + "\xCD\xAB" => "\xE8\x82\x8F", + "\xCD\xAC" => "\xE8\x82\xAE", + "\xCD\xAD" => "\xE8\x82\xA3", + "\xCD\xAE" => "\xE8\x82\xB8", + "\xCD\xAF" => "\xE8\x82\xB5", + "\xCD\xB0" => "\xE8\x82\xAD", + "\xCD\xB1" => "\xE8\x88\xA0", + "\xCD\xB2" => "\xE8\x8A\xA0", + "\xCD\xB3" => "\xE8\x8B\x80", + "\xCD\xB4" => "\xE8\x8A\xAB", + "\xCD\xB5" => "\xE8\x8A\x9A", + "\xCD\xB6" => "\xE8\x8A\x98", + "\xCD\xB7" => "\xE8\x8A\x9B", + "\xCD\xB8" => "\xE8\x8A\xB5", + "\xCD\xB9" => "\xE8\x8A\xA7", + "\xCD\xBA" => "\xE8\x8A\xAE", + "\xCD\xBB" => "\xE8\x8A\xBC", + "\xCD\xBC" => "\xE8\x8A\x9E", + "\xCD\xBD" => "\xE8\x8A\xBA", + "\xCD\xBE" => "\xE8\x8A\xB4", + "\xCD\xBF" => "\xE8\x8A\xA8", + "\xCD\xC0" => "\xE8\x8A\xA1", + "\xCD\xC1" => "\xE8\x8A\xA9", + "\xCD\xC2" => "\xE8\x8B\x82", + "\xCD\xC3" => "\xE8\x8A\xA4", + "\xCD\xC4" => "\xE8\x8B\x83", + "\xCD\xC5" => "\xE8\x8A\xB6", + "\xCD\xC6" => "\xE8\x8A\xA2", + "\xCD\xC7" => "\xE8\x99\xB0", + "\xCD\xC8" => "\xE8\x99\xAF", + "\xCD\xC9" => "\xE8\x99\xAD", + "\xCD\xCA" => "\xE8\x99\xAE", + "\xCD\xCB" => "\xE8\xB1\x96", + "\xCD\xCC" => "\xE8\xBF\x92", + "\xCD\xCD" => "\xE8\xBF\x8B", + "\xCD\xCE" => "\xE8\xBF\x93", + "\xCD\xCF" => "\xE8\xBF\x8D", + "\xCD\xD0" => "\xE8\xBF\x96", + "\xCD\xD1" => "\xE8\xBF\x95", + "\xCD\xD2" => "\xE8\xBF\x97", + "\xCD\xD3" => "\xE9\x82\xB2", + "\xCD\xD4" => "\xE9\x82\xB4", + "\xCD\xD5" => "\xE9\x82\xAF", + "\xCD\xD6" => "\xE9\x82\xB3", + "\xCD\xD7" => "\xE9\x82\xB0", + "\xCD\xD8" => "\xE9\x98\xB9", + "\xCD\xD9" => "\xE9\x98\xBD", + "\xCD\xDA" => "\xE9\x98\xBC", + "\xCD\xDB" => "\xE9\x98\xBA", + "\xCD\xDC" => "\xE9\x99\x83", + "\xCD\xDD" => "\xE4\xBF\x8D", + "\xCD\xDE" => "\xE4\xBF\x85", + "\xCD\xDF" => "\xE4\xBF\x93", + "\xCD\xE0" => "\xE4\xBE\xB2", + "\xCD\xE1" => "\xE4\xBF\x89", + "\xCD\xE2" => "\xE4\xBF\x8B", + "\xCD\xE3" => "\xE4\xBF\x81", + "\xCD\xE4" => "\xE4\xBF\x94", + "\xCD\xE5" => "\xE4\xBF\x9C", + "\xCD\xE6" => "\xE4\xBF\x99", + "\xCD\xE7" => "\xE4\xBE\xBB", + "\xCD\xE8" => "\xE4\xBE\xB3", + "\xCD\xE9" => "\xE4\xBF\x9B", + "\xCD\xEA" => "\xE4\xBF\x87", + "\xCD\xEB" => "\xE4\xBF\x96", + "\xCD\xEC" => "\xE4\xBE\xBA", + "\xCD\xED" => "\xE4\xBF\x80", + "\xCD\xEE" => "\xE4\xBE\xB9", + "\xCD\xEF" => "\xE4\xBF\xAC", + "\xCD\xF0" => "\xE5\x89\x84", + "\xCD\xF1" => "\xE5\x89\x89", + "\xCD\xF2" => "\xE5\x8B\x80", + "\xCD\xF3" => "\xE5\x8B\x82", + "\xCD\xF4" => "\xE5\x8C\xBD", + "\xCD\xF5" => "\xE5\x8D\xBC", + "\xCD\xF6" => "\xE5\x8E\x97", + "\xCD\xF7" => "\xE5\x8E\x96", + "\xCD\xF8" => "\xE5\x8E\x99", + "\xCD\xF9" => "\xE5\x8E\x98", + "\xCD\xFA" => "\xE5\x92\xBA", + "\xCD\xFB" => "\xE5\x92\xA1", + "\xCD\xFC" => "\xE5\x92\xAD", + "\xCD\xFD" => "\xE5\x92\xA5", + "\xCD\xFE" => "\xE5\x93\x8F", + "\xCE\x40" => "\xE5\x93\x83", + "\xCE\x41" => "\xE8\x8C\x8D", + "\xCE\x42" => "\xE5\x92\xB7", + "\xCE\x43" => "\xE5\x92\xAE", + "\xCE\x44" => "\xE5\x93\x96", + "\xCE\x45" => "\xE5\x92\xB6", + "\xCE\x46" => "\xE5\x93\x85", + "\xCE\x47" => "\xE5\x93\x86", + "\xCE\x48" => "\xE5\x92\xA0", + "\xCE\x49" => "\xE5\x91\xB0", + "\xCE\x4A" => "\xE5\x92\xBC", + "\xCE\x4B" => "\xE5\x92\xA2", + "\xCE\x4C" => "\xE5\x92\xBE", + "\xCE\x4D" => "\xE5\x91\xB2", + "\xCE\x4E" => "\xE5\x93\x9E", + "\xCE\x4F" => "\xE5\x92\xB0", + "\xCE\x50" => "\xE5\x9E\xB5", + "\xCE\x51" => "\xE5\x9E\x9E", + "\xCE\x52" => "\xE5\x9E\x9F", + "\xCE\x53" => "\xE5\x9E\xA4", + "\xCE\x54" => "\xE5\x9E\x8C", + "\xCE\x55" => "\xE5\x9E\x97", + "\xCE\x56" => "\xE5\x9E\x9D", + "\xCE\x57" => "\xE5\x9E\x9B", + "\xCE\x58" => "\xE5\x9E\x94", + "\xCE\x59" => "\xE5\x9E\x98", + "\xCE\x5A" => "\xE5\x9E\x8F", + "\xCE\x5B" => "\xE5\x9E\x99", + "\xCE\x5C" => "\xE5\x9E\xA5", + "\xCE\x5D" => "\xE5\x9E\x9A", + "\xCE\x5E" => "\xE5\x9E\x95", + "\xCE\x5F" => "\xE5\xA3\xB4", + "\xCE\x60" => "\xE5\xA4\x8D", + "\xCE\x61" => "\xE5\xA5\x93", + "\xCE\x62" => "\xE5\xA7\xA1", + "\xCE\x63" => "\xE5\xA7\x9E", + "\xCE\x64" => "\xE5\xA7\xAE", + "\xCE\x65" => "\xE5\xA8\x80", + "\xCE\x66" => "\xE5\xA7\xB1", + "\xCE\x67" => "\xE5\xA7\x9D", + "\xCE\x68" => "\xE5\xA7\xBA", + "\xCE\x69" => "\xE5\xA7\xBD", + "\xCE\x6A" => "\xE5\xA7\xBC", + "\xCE\x6B" => "\xE5\xA7\xB6", + "\xCE\x6C" => "\xE5\xA7\xA4", + "\xCE\x6D" => "\xE5\xA7\xB2", + "\xCE\x6E" => "\xE5\xA7\xB7", + "\xCE\x6F" => "\xE5\xA7\x9B", + "\xCE\x70" => "\xE5\xA7\xA9", + "\xCE\x71" => "\xE5\xA7\xB3", + "\xCE\x72" => "\xE5\xA7\xB5", + "\xCE\x73" => "\xE5\xA7\xA0", + "\xCE\x74" => "\xE5\xA7\xBE", + "\xCE\x75" => "\xE5\xA7\xB4", + "\xCE\x76" => "\xE5\xA7\xAD", + "\xCE\x77" => "\xE5\xAE\xA8", + "\xCE\x78" => "\xE5\xB1\x8C", + "\xCE\x79" => "\xE5\xB3\x90", + "\xCE\x7A" => "\xE5\xB3\x98", + "\xCE\x7B" => "\xE5\xB3\x8C", + "\xCE\x7C" => "\xE5\xB3\x97", + "\xCE\x7D" => "\xE5\xB3\x8B", + "\xCE\x7E" => "\xE5\xB3\x9B", + "\xCE\xA1" => "\xE5\xB3\x9E", + "\xCE\xA2" => "\xE5\xB3\x9A", + "\xCE\xA3" => "\xE5\xB3\x89", + "\xCE\xA4" => "\xE5\xB3\x87", + "\xCE\xA5" => "\xE5\xB3\x8A", + "\xCE\xA6" => "\xE5\xB3\x96", + "\xCE\xA7" => "\xE5\xB3\x93", + "\xCE\xA8" => "\xE5\xB3\x94", + "\xCE\xA9" => "\xE5\xB3\x8F", + "\xCE\xAA" => "\xE5\xB3\x88", + "\xCE\xAB" => "\xE5\xB3\x86", + "\xCE\xAC" => "\xE5\xB3\x8E", + "\xCE\xAD" => "\xE5\xB3\x9F", + "\xCE\xAE" => "\xE5\xB3\xB8", + "\xCE\xAF" => "\xE5\xB7\xB9", + "\xCE\xB0" => "\xE5\xB8\xA1", + "\xCE\xB1" => "\xE5\xB8\xA2", + "\xCE\xB2" => "\xE5\xB8\xA3", + "\xCE\xB3" => "\xE5\xB8\xA0", + "\xCE\xB4" => "\xE5\xB8\xA4", + "\xCE\xB5" => "\xE5\xBA\xB0", + "\xCE\xB6" => "\xE5\xBA\xA4", + "\xCE\xB7" => "\xE5\xBA\xA2", + "\xCE\xB8" => "\xE5\xBA\x9B", + "\xCE\xB9" => "\xE5\xBA\xA3", + "\xCE\xBA" => "\xE5\xBA\xA5", + "\xCE\xBB" => "\xE5\xBC\x87", + "\xCE\xBC" => "\xE5\xBC\xAE", + "\xCE\xBD" => "\xE5\xBD\x96", + "\xCE\xBE" => "\xE5\xBE\x86", + "\xCE\xBF" => "\xE6\x80\xB7", + "\xCE\xC0" => "\xE6\x80\xB9", + "\xCE\xC1" => "\xE6\x81\x94", + "\xCE\xC2" => "\xE6\x81\xB2", + "\xCE\xC3" => "\xE6\x81\x9E", + "\xCE\xC4" => "\xE6\x81\x85", + "\xCE\xC5" => "\xE6\x81\x93", + "\xCE\xC6" => "\xE6\x81\x87", + "\xCE\xC7" => "\xE6\x81\x89", + "\xCE\xC8" => "\xE6\x81\x9B", + "\xCE\xC9" => "\xE6\x81\x8C", + "\xCE\xCA" => "\xE6\x81\x80", + "\xCE\xCB" => "\xE6\x81\x82", + "\xCE\xCC" => "\xE6\x81\x9F", + "\xCE\xCD" => "\xE6\x80\xA4", + "\xCE\xCE" => "\xE6\x81\x84", + "\xCE\xCF" => "\xE6\x81\x98", + "\xCE\xD0" => "\xE6\x81\xA6", + "\xCE\xD1" => "\xE6\x81\xAE", + "\xCE\xD2" => "\xE6\x89\x82", + "\xCE\xD3" => "\xE6\x89\x83", + "\xCE\xD4" => "\xE6\x8B\x8F", + "\xCE\xD5" => "\xE6\x8C\x8D", + "\xCE\xD6" => "\xE6\x8C\x8B", + "\xCE\xD7" => "\xE6\x8B\xB5", + "\xCE\xD8" => "\xE6\x8C\x8E", + "\xCE\xD9" => "\xE6\x8C\x83", + "\xCE\xDA" => "\xE6\x8B\xAB", + "\xCE\xDB" => "\xE6\x8B\xB9", + "\xCE\xDC" => "\xE6\x8C\x8F", + "\xCE\xDD" => "\xE6\x8C\x8C", + "\xCE\xDE" => "\xE6\x8B\xB8", + "\xCE\xDF" => "\xE6\x8B\xB6", + "\xCE\xE0" => "\xE6\x8C\x80", + "\xCE\xE1" => "\xE6\x8C\x93", + "\xCE\xE2" => "\xE6\x8C\x94", + "\xCE\xE3" => "\xE6\x8B\xBA", + "\xCE\xE4" => "\xE6\x8C\x95", + "\xCE\xE5" => "\xE6\x8B\xBB", + "\xCE\xE6" => "\xE6\x8B\xB0", + "\xCE\xE7" => "\xE6\x95\x81", + "\xCE\xE8" => "\xE6\x95\x83", + "\xCE\xE9" => "\xE6\x96\xAA", + "\xCE\xEA" => "\xE6\x96\xBF", + "\xCE\xEB" => "\xE6\x98\xB6", + "\xCE\xEC" => "\xE6\x98\xA1", + "\xCE\xED" => "\xE6\x98\xB2", + "\xCE\xEE" => "\xE6\x98\xB5", + "\xCE\xEF" => "\xE6\x98\x9C", + "\xCE\xF0" => "\xE6\x98\xA6", + "\xCE\xF1" => "\xE6\x98\xA2", + "\xCE\xF2" => "\xE6\x98\xB3", + "\xCE\xF3" => "\xE6\x98\xAB", + "\xCE\xF4" => "\xE6\x98\xBA", + "\xCE\xF5" => "\xE6\x98\x9D", + "\xCE\xF6" => "\xE6\x98\xB4", + "\xCE\xF7" => "\xE6\x98\xB9", + "\xCE\xF8" => "\xE6\x98\xAE", + "\xCE\xF9" => "\xE6\x9C\x8F", + "\xCE\xFA" => "\xE6\x9C\x90", + "\xCE\xFB" => "\xE6\x9F\x81", + "\xCE\xFC" => "\xE6\x9F\xB2", + "\xCE\xFD" => "\xE6\x9F\x88", + "\xCE\xFE" => "\xE6\x9E\xBA", + "\xCF\x40" => "\xE6\x9F\x9C", + "\xCF\x41" => "\xE6\x9E\xBB", + "\xCF\x42" => "\xE6\x9F\xB8", + "\xCF\x43" => "\xE6\x9F\x98", + "\xCF\x44" => "\xE6\x9F\x80", + "\xCF\x45" => "\xE6\x9E\xB7", + "\xCF\x46" => "\xE6\x9F\x85", + "\xCF\x47" => "\xE6\x9F\xAB", + "\xCF\x48" => "\xE6\x9F\xA4", + "\xCF\x49" => "\xE6\x9F\x9F", + "\xCF\x4A" => "\xE6\x9E\xB5", + "\xCF\x4B" => "\xE6\x9F\x8D", + "\xCF\x4C" => "\xE6\x9E\xB3", + "\xCF\x4D" => "\xE6\x9F\xB7", + "\xCF\x4E" => "\xE6\x9F\xB6", + "\xCF\x4F" => "\xE6\x9F\xAE", + "\xCF\x50" => "\xE6\x9F\xA3", + "\xCF\x51" => "\xE6\x9F\x82", + "\xCF\x52" => "\xE6\x9E\xB9", + "\xCF\x53" => "\xE6\x9F\x8E", + "\xCF\x54" => "\xE6\x9F\xA7", + "\xCF\x55" => "\xE6\x9F\xB0", + "\xCF\x56" => "\xE6\x9E\xB2", + "\xCF\x57" => "\xE6\x9F\xBC", + "\xCF\x58" => "\xE6\x9F\x86", + "\xCF\x59" => "\xE6\x9F\xAD", + "\xCF\x5A" => "\xE6\x9F\x8C", + "\xCF\x5B" => "\xE6\x9E\xAE", + "\xCF\x5C" => "\xE6\x9F\xA6", + "\xCF\x5D" => "\xE6\x9F\x9B", + "\xCF\x5E" => "\xE6\x9F\xBA", + "\xCF\x5F" => "\xE6\x9F\x89", + "\xCF\x60" => "\xE6\x9F\x8A", + "\xCF\x61" => "\xE6\x9F\x83", + "\xCF\x62" => "\xE6\x9F\xAA", + "\xCF\x63" => "\xE6\x9F\x8B", + "\xCF\x64" => "\xE6\xAC\xA8", + "\xCF\x65" => "\xE6\xAE\x82", + "\xCF\x66" => "\xE6\xAE\x84", + "\xCF\x67" => "\xE6\xAE\xB6", + "\xCF\x68" => "\xE6\xAF\x96", + "\xCF\x69" => "\xE6\xAF\x98", + "\xCF\x6A" => "\xE6\xAF\xA0", + "\xCF\x6B" => "\xE6\xB0\xA0", + "\xCF\x6C" => "\xE6\xB0\xA1", + "\xCF\x6D" => "\xE6\xB4\xA8", + "\xCF\x6E" => "\xE6\xB4\xB4", + "\xCF\x6F" => "\xE6\xB4\xAD", + "\xCF\x70" => "\xE6\xB4\x9F", + "\xCF\x71" => "\xE6\xB4\xBC", + "\xCF\x72" => "\xE6\xB4\xBF", + "\xCF\x73" => "\xE6\xB4\x92", + "\xCF\x74" => "\xE6\xB4\x8A", + "\xCF\x75" => "\xE6\xB3\x9A", + "\xCF\x76" => "\xE6\xB4\xB3", + "\xCF\x77" => "\xE6\xB4\x84", + "\xCF\x78" => "\xE6\xB4\x99", + "\xCF\x79" => "\xE6\xB4\xBA", + "\xCF\x7A" => "\xE6\xB4\x9A", + "\xCF\x7B" => "\xE6\xB4\x91", + "\xCF\x7C" => "\xE6\xB4\x80", + "\xCF\x7D" => "\xE6\xB4\x9D", + "\xCF\x7E" => "\xE6\xB5\x82", + "\xCF\xA1" => "\xE6\xB4\x81", + "\xCF\xA2" => "\xE6\xB4\x98", + "\xCF\xA3" => "\xE6\xB4\xB7", + "\xCF\xA4" => "\xE6\xB4\x83", + "\xCF\xA5" => "\xE6\xB4\x8F", + "\xCF\xA6" => "\xE6\xB5\x80", + "\xCF\xA7" => "\xE6\xB4\x87", + "\xCF\xA8" => "\xE6\xB4\xA0", + "\xCF\xA9" => "\xE6\xB4\xAC", + "\xCF\xAA" => "\xE6\xB4\x88", + "\xCF\xAB" => "\xE6\xB4\xA2", + "\xCF\xAC" => "\xE6\xB4\x89", + "\xCF\xAD" => "\xE6\xB4\x90", + "\xCF\xAE" => "\xE7\x82\xB7", + "\xCF\xAF" => "\xE7\x82\x9F", + "\xCF\xB0" => "\xE7\x82\xBE", + "\xCF\xB1" => "\xE7\x82\xB1", + "\xCF\xB2" => "\xE7\x82\xB0", + "\xCF\xB3" => "\xE7\x82\xA1", + "\xCF\xB4" => "\xE7\x82\xB4", + "\xCF\xB5" => "\xE7\x82\xB5", + "\xCF\xB6" => "\xE7\x82\xA9", + "\xCF\xB7" => "\xE7\x89\x81", + "\xCF\xB8" => "\xE7\x89\x89", + "\xCF\xB9" => "\xE7\x89\x8A", + "\xCF\xBA" => "\xE7\x89\xAC", + "\xCF\xBB" => "\xE7\x89\xB0", + "\xCF\xBC" => "\xE7\x89\xB3", + "\xCF\xBD" => "\xE7\x89\xAE", + "\xCF\xBE" => "\xE7\x8B\x8A", + "\xCF\xBF" => "\xE7\x8B\xA4", + "\xCF\xC0" => "\xE7\x8B\xA8", + "\xCF\xC1" => "\xE7\x8B\xAB", + "\xCF\xC2" => "\xE7\x8B\x9F", + "\xCF\xC3" => "\xE7\x8B\xAA", + "\xCF\xC4" => "\xE7\x8B\xA6", + "\xCF\xC5" => "\xE7\x8B\xA3", + "\xCF\xC6" => "\xE7\x8E\x85", + "\xCF\xC7" => "\xE7\x8F\x8C", + "\xCF\xC8" => "\xE7\x8F\x82", + "\xCF\xC9" => "\xE7\x8F\x88", + "\xCF\xCA" => "\xE7\x8F\x85", + "\xCF\xCB" => "\xE7\x8E\xB9", + "\xCF\xCC" => "\xE7\x8E\xB6", + "\xCF\xCD" => "\xE7\x8E\xB5", + "\xCF\xCE" => "\xE7\x8E\xB4", + "\xCF\xCF" => "\xE7\x8F\xAB", + "\xCF\xD0" => "\xE7\x8E\xBF", + "\xCF\xD1" => "\xE7\x8F\x87", + "\xCF\xD2" => "\xE7\x8E\xBE", + "\xCF\xD3" => "\xE7\x8F\x83", + "\xCF\xD4" => "\xE7\x8F\x86", + "\xCF\xD5" => "\xE7\x8E\xB8", + "\xCF\xD6" => "\xE7\x8F\x8B", + "\xCF\xD7" => "\xE7\x93\xAC", + "\xCF\xD8" => "\xE7\x93\xAE", + "\xCF\xD9" => "\xE7\x94\xAE", + "\xCF\xDA" => "\xE7\x95\x87", + "\xCF\xDB" => "\xE7\x95\x88", + "\xCF\xDC" => "\xE7\x96\xA7", + "\xCF\xDD" => "\xE7\x96\xAA", + "\xCF\xDE" => "\xE7\x99\xB9", + "\xCF\xDF" => "\xE7\x9B\x84", + "\xCF\xE0" => "\xE7\x9C\x88", + "\xCF\xE1" => "\xE7\x9C\x83", + "\xCF\xE2" => "\xE7\x9C\x84", + "\xCF\xE3" => "\xE7\x9C\x85", + "\xCF\xE4" => "\xE7\x9C\x8A", + "\xCF\xE5" => "\xE7\x9B\xB7", + "\xCF\xE6" => "\xE7\x9B\xBB", + "\xCF\xE7" => "\xE7\x9B\xBA", + "\xCF\xE8" => "\xE7\x9F\xA7", + "\xCF\xE9" => "\xE7\x9F\xA8", + "\xCF\xEA" => "\xE7\xA0\x86", + "\xCF\xEB" => "\xE7\xA0\x91", + "\xCF\xEC" => "\xE7\xA0\x92", + "\xCF\xED" => "\xE7\xA0\x85", + "\xCF\xEE" => "\xE7\xA0\x90", + "\xCF\xEF" => "\xE7\xA0\x8F", + "\xCF\xF0" => "\xE7\xA0\x8E", + "\xCF\xF1" => "\xE7\xA0\x89", + "\xCF\xF2" => "\xE7\xA0\x83", + "\xCF\xF3" => "\xE7\xA0\x93", + "\xCF\xF4" => "\xE7\xA5\x8A", + "\xCF\xF5" => "\xE7\xA5\x8C", + "\xCF\xF6" => "\xE7\xA5\x8B", + "\xCF\xF7" => "\xE7\xA5\x85", + "\xCF\xF8" => "\xE7\xA5\x84", + "\xCF\xF9" => "\xE7\xA7\x95", + "\xCF\xFA" => "\xE7\xA7\x8D", + "\xCF\xFB" => "\xE7\xA7\x8F", + "\xCF\xFC" => "\xE7\xA7\x96", + "\xCF\xFD" => "\xE7\xA7\x8E", + "\xCF\xFE" => "\xE7\xAA\x80", + "\xD0\x40" => "\xE7\xA9\xBE", + "\xD0\x41" => "\xE7\xAB\x91", + "\xD0\x42" => "\xE7\xAC\x80", + "\xD0\x43" => "\xE7\xAC\x81", + "\xD0\x44" => "\xE7\xB1\xBA", + "\xD0\x45" => "\xE7\xB1\xB8", + "\xD0\x46" => "\xE7\xB1\xB9", + "\xD0\x47" => "\xE7\xB1\xBF", + "\xD0\x48" => "\xE7\xB2\x80", + "\xD0\x49" => "\xE7\xB2\x81", + "\xD0\x4A" => "\xE7\xB4\x83", + "\xD0\x4B" => "\xE7\xB4\x88", + "\xD0\x4C" => "\xE7\xB4\x81", + "\xD0\x4D" => "\xE7\xBD\x98", + "\xD0\x4E" => "\xE7\xBE\x91", + "\xD0\x4F" => "\xE7\xBE\x8D", + "\xD0\x50" => "\xE7\xBE\xBE", + "\xD0\x51" => "\xE8\x80\x87", + "\xD0\x52" => "\xE8\x80\x8E", + "\xD0\x53" => "\xE8\x80\x8F", + "\xD0\x54" => "\xE8\x80\x94", + "\xD0\x55" => "\xE8\x80\xB7", + "\xD0\x56" => "\xE8\x83\x98", + "\xD0\x57" => "\xE8\x83\x87", + "\xD0\x58" => "\xE8\x83\xA0", + "\xD0\x59" => "\xE8\x83\x91", + "\xD0\x5A" => "\xE8\x83\x88", + "\xD0\x5B" => "\xE8\x83\x82", + "\xD0\x5C" => "\xE8\x83\x90", + "\xD0\x5D" => "\xE8\x83\x85", + "\xD0\x5E" => "\xE8\x83\xA3", + "\xD0\x5F" => "\xE8\x83\x99", + "\xD0\x60" => "\xE8\x83\x9C", + "\xD0\x61" => "\xE8\x83\x8A", + "\xD0\x62" => "\xE8\x83\x95", + "\xD0\x63" => "\xE8\x83\x89", + "\xD0\x64" => "\xE8\x83\x8F", + "\xD0\x65" => "\xE8\x83\x97", + "\xD0\x66" => "\xE8\x83\xA6", + "\xD0\x67" => "\xE8\x83\x8D", + "\xD0\x68" => "\xE8\x87\xBF", + "\xD0\x69" => "\xE8\x88\xA1", + "\xD0\x6A" => "\xE8\x8A\x94", + "\xD0\x6B" => "\xE8\x8B\x99", + "\xD0\x6C" => "\xE8\x8B\xBE", + "\xD0\x6D" => "\xE8\x8B\xB9", + "\xD0\x6E" => "\xE8\x8C\x87", + "\xD0\x6F" => "\xE8\x8B\xA8", + "\xD0\x70" => "\xE8\x8C\x80", + "\xD0\x71" => "\xE8\x8B\x95", + "\xD0\x72" => "\xE8\x8C\xBA", + "\xD0\x73" => "\xE8\x8B\xAB", + "\xD0\x74" => "\xE8\x8B\x96", + "\xD0\x75" => "\xE8\x8B\xB4", + "\xD0\x76" => "\xE8\x8B\xAC", + "\xD0\x77" => "\xE8\x8B\xA1", + "\xD0\x78" => "\xE8\x8B\xB2", + "\xD0\x79" => "\xE8\x8B\xB5", + "\xD0\x7A" => "\xE8\x8C\x8C", + "\xD0\x7B" => "\xE8\x8B\xBB", + "\xD0\x7C" => "\xE8\x8B\xB6", + "\xD0\x7D" => "\xE8\x8B\xB0", + "\xD0\x7E" => "\xE8\x8B\xAA", + "\xD0\xA1" => "\xE8\x8B\xA4", + "\xD0\xA2" => "\xE8\x8B\xA0", + "\xD0\xA3" => "\xE8\x8B\xBA", + "\xD0\xA4" => "\xE8\x8B\xB3", + "\xD0\xA5" => "\xE8\x8B\xAD", + "\xD0\xA6" => "\xE8\x99\xB7", + "\xD0\xA7" => "\xE8\x99\xB4", + "\xD0\xA8" => "\xE8\x99\xBC", + "\xD0\xA9" => "\xE8\x99\xB3", + "\xD0\xAA" => "\xE8\xA1\x81", + "\xD0\xAB" => "\xE8\xA1\x8E", + "\xD0\xAC" => "\xE8\xA1\xA7", + "\xD0\xAD" => "\xE8\xA1\xAA", + "\xD0\xAE" => "\xE8\xA1\xA9", + "\xD0\xAF" => "\xE8\xA7\x93", + "\xD0\xB0" => "\xE8\xA8\x84", + "\xD0\xB1" => "\xE8\xA8\x87", + "\xD0\xB2" => "\xE8\xB5\xB2", + "\xD0\xB3" => "\xE8\xBF\xA3", + "\xD0\xB4" => "\xE8\xBF\xA1", + "\xD0\xB5" => "\xE8\xBF\xAE", + "\xD0\xB6" => "\xE8\xBF\xA0", + "\xD0\xB7" => "\xE9\x83\xB1", + "\xD0\xB8" => "\xE9\x82\xBD", + "\xD0\xB9" => "\xE9\x82\xBF", + "\xD0\xBA" => "\xE9\x83\x95", + "\xD0\xBB" => "\xE9\x83\x85", + "\xD0\xBC" => "\xE9\x82\xBE", + "\xD0\xBD" => "\xE9\x83\x87", + "\xD0\xBE" => "\xE9\x83\x8B", + "\xD0\xBF" => "\xE9\x83\x88", + "\xD0\xC0" => "\xE9\x87\x94", + "\xD0\xC1" => "\xE9\x87\x93", + "\xD0\xC2" => "\xE9\x99\x94", + "\xD0\xC3" => "\xE9\x99\x8F", + "\xD0\xC4" => "\xE9\x99\x91", + "\xD0\xC5" => "\xE9\x99\x93", + "\xD0\xC6" => "\xE9\x99\x8A", + "\xD0\xC7" => "\xE9\x99\x8E", + "\xD0\xC8" => "\xE5\x80\x9E", + "\xD0\xC9" => "\xE5\x80\x85", + "\xD0\xCA" => "\xE5\x80\x87", + "\xD0\xCB" => "\xE5\x80\x93", + "\xD0\xCC" => "\xE5\x80\xA2", + "\xD0\xCD" => "\xE5\x80\xB0", + "\xD0\xCE" => "\xE5\x80\x9B", + "\xD0\xCF" => "\xE4\xBF\xB5", + "\xD0\xD0" => "\xE4\xBF\xB4", + "\xD0\xD1" => "\xE5\x80\xB3", + "\xD0\xD2" => "\xE5\x80\xB7", + "\xD0\xD3" => "\xE5\x80\xAC", + "\xD0\xD4" => "\xE4\xBF\xB6", + "\xD0\xD5" => "\xE4\xBF\xB7", + "\xD0\xD6" => "\xE5\x80\x97", + "\xD0\xD7" => "\xE5\x80\x9C", + "\xD0\xD8" => "\xE5\x80\xA0", + "\xD0\xD9" => "\xE5\x80\xA7", + "\xD0\xDA" => "\xE5\x80\xB5", + "\xD0\xDB" => "\xE5\x80\xAF", + "\xD0\xDC" => "\xE5\x80\xB1", + "\xD0\xDD" => "\xE5\x80\x8E", + "\xD0\xDE" => "\xE5\x85\x9A", + "\xD0\xDF" => "\xE5\x86\x94", + "\xD0\xE0" => "\xE5\x86\x93", + "\xD0\xE1" => "\xE5\x87\x8A", + "\xD0\xE2" => "\xE5\x87\x84", + "\xD0\xE3" => "\xE5\x87\x85", + "\xD0\xE4" => "\xE5\x87\x88", + "\xD0\xE5" => "\xE5\x87\x8E", + "\xD0\xE6" => "\xE5\x89\xA1", + "\xD0\xE7" => "\xE5\x89\x9A", + "\xD0\xE8" => "\xE5\x89\x92", + "\xD0\xE9" => "\xE5\x89\x9E", + "\xD0\xEA" => "\xE5\x89\x9F", + "\xD0\xEB" => "\xE5\x89\x95", + "\xD0\xEC" => "\xE5\x89\xA2", + "\xD0\xED" => "\xE5\x8B\x8D", + "\xD0\xEE" => "\xE5\x8C\x8E", + "\xD0\xEF" => "\xE5\x8E\x9E", + "\xD0\xF0" => "\xE5\x94\xA6", + "\xD0\xF1" => "\xE5\x93\xA2", + "\xD0\xF2" => "\xE5\x94\x97", + "\xD0\xF3" => "\xE5\x94\x92", + "\xD0\xF4" => "\xE5\x93\xA7", + "\xD0\xF5" => "\xE5\x93\xB3", + "\xD0\xF6" => "\xE5\x93\xA4", + "\xD0\xF7" => "\xE5\x94\x9A", + "\xD0\xF8" => "\xE5\x93\xBF", + "\xD0\xF9" => "\xE5\x94\x84", + "\xD0\xFA" => "\xE5\x94\x88", + "\xD0\xFB" => "\xE5\x93\xAB", + "\xD0\xFC" => "\xE5\x94\x91", + "\xD0\xFD" => "\xE5\x94\x85", + "\xD0\xFE" => "\xE5\x93\xB1", + "\xD1\x40" => "\xE5\x94\x8A", + "\xD1\x41" => "\xE5\x93\xBB", + "\xD1\x42" => "\xE5\x93\xB7", + "\xD1\x43" => "\xE5\x93\xB8", + "\xD1\x44" => "\xE5\x93\xA0", + "\xD1\x45" => "\xE5\x94\x8E", + "\xD1\x46" => "\xE5\x94\x83", + "\xD1\x47" => "\xE5\x94\x8B", + "\xD1\x48" => "\xE5\x9C\x81", + "\xD1\x49" => "\xE5\x9C\x82", + "\xD1\x4A" => "\xE5\x9F\x8C", + "\xD1\x4B" => "\xE5\xA0\xB2", + "\xD1\x4C" => "\xE5\x9F\x95", + "\xD1\x4D" => "\xE5\x9F\x92", + "\xD1\x4E" => "\xE5\x9E\xBA", + "\xD1\x4F" => "\xE5\x9F\x86", + "\xD1\x50" => "\xE5\x9E\xBD", + "\xD1\x51" => "\xE5\x9E\xBC", + "\xD1\x52" => "\xE5\x9E\xB8", + "\xD1\x53" => "\xE5\x9E\xB6", + "\xD1\x54" => "\xE5\x9E\xBF", + "\xD1\x55" => "\xE5\x9F\x87", + "\xD1\x56" => "\xE5\x9F\x90", + "\xD1\x57" => "\xE5\x9E\xB9", + "\xD1\x58" => "\xE5\x9F\x81", + "\xD1\x59" => "\xE5\xA4\x8E", + "\xD1\x5A" => "\xE5\xA5\x8A", + "\xD1\x5B" => "\xE5\xA8\x99", + "\xD1\x5C" => "\xE5\xA8\x96", + "\xD1\x5D" => "\xE5\xA8\xAD", + "\xD1\x5E" => "\xE5\xA8\xAE", + "\xD1\x5F" => "\xE5\xA8\x95", + "\xD1\x60" => "\xE5\xA8\x8F", + "\xD1\x61" => "\xE5\xA8\x97", + "\xD1\x62" => "\xE5\xA8\x8A", + "\xD1\x63" => "\xE5\xA8\x9E", + "\xD1\x64" => "\xE5\xA8\xB3", + "\xD1\x65" => "\xE5\xAD\xAC", + "\xD1\x66" => "\xE5\xAE\xA7", + "\xD1\x67" => "\xE5\xAE\xAD", + "\xD1\x68" => "\xE5\xAE\xAC", + "\xD1\x69" => "\xE5\xB0\x83", + "\xD1\x6A" => "\xE5\xB1\x96", + "\xD1\x6B" => "\xE5\xB1\x94", + "\xD1\x6C" => "\xE5\xB3\xAC", + "\xD1\x6D" => "\xE5\xB3\xBF", + "\xD1\x6E" => "\xE5\xB3\xAE", + "\xD1\x6F" => "\xE5\xB3\xB1", + "\xD1\x70" => "\xE5\xB3\xB7", + "\xD1\x71" => "\xE5\xB4\x80", + "\xD1\x72" => "\xE5\xB3\xB9", + "\xD1\x73" => "\xE5\xB8\xA9", + "\xD1\x74" => "\xE5\xB8\xA8", + "\xD1\x75" => "\xE5\xBA\xA8", + "\xD1\x76" => "\xE5\xBA\xAE", + "\xD1\x77" => "\xE5\xBA\xAA", + "\xD1\x78" => "\xE5\xBA\xAC", + "\xD1\x79" => "\xE5\xBC\xB3", + "\xD1\x7A" => "\xE5\xBC\xB0", + "\xD1\x7B" => "\xE5\xBD\xA7", + "\xD1\x7C" => "\xE6\x81\x9D", + "\xD1\x7D" => "\xE6\x81\x9A", + "\xD1\x7E" => "\xE6\x81\xA7", + "\xD1\xA1" => "\xE6\x81\x81", + "\xD1\xA2" => "\xE6\x82\xA2", + "\xD1\xA3" => "\xE6\x82\x88", + "\xD1\xA4" => "\xE6\x82\x80", + "\xD1\xA5" => "\xE6\x82\x92", + "\xD1\xA6" => "\xE6\x82\x81", + "\xD1\xA7" => "\xE6\x82\x9D", + "\xD1\xA8" => "\xE6\x82\x83", + "\xD1\xA9" => "\xE6\x82\x95", + "\xD1\xAA" => "\xE6\x82\x9B", + "\xD1\xAB" => "\xE6\x82\x97", + "\xD1\xAC" => "\xE6\x82\x87", + "\xD1\xAD" => "\xE6\x82\x9C", + "\xD1\xAE" => "\xE6\x82\x8E", + "\xD1\xAF" => "\xE6\x88\x99", + "\xD1\xB0" => "\xE6\x89\x86", + "\xD1\xB1" => "\xE6\x8B\xB2", + "\xD1\xB2" => "\xE6\x8C\x90", + "\xD1\xB3" => "\xE6\x8D\x96", + "\xD1\xB4" => "\xE6\x8C\xAC", + "\xD1\xB5" => "\xE6\x8D\x84", + "\xD1\xB6" => "\xE6\x8D\x85", + "\xD1\xB7" => "\xE6\x8C\xB6", + "\xD1\xB8" => "\xE6\x8D\x83", + "\xD1\xB9" => "\xE6\x8F\xA4", + "\xD1\xBA" => "\xE6\x8C\xB9", + "\xD1\xBB" => "\xE6\x8D\x8B", + "\xD1\xBC" => "\xE6\x8D\x8A", + "\xD1\xBD" => "\xE6\x8C\xBC", + "\xD1\xBE" => "\xE6\x8C\xA9", + "\xD1\xBF" => "\xE6\x8D\x81", + "\xD1\xC0" => "\xE6\x8C\xB4", + "\xD1\xC1" => "\xE6\x8D\x98", + "\xD1\xC2" => "\xE6\x8D\x94", + "\xD1\xC3" => "\xE6\x8D\x99", + "\xD1\xC4" => "\xE6\x8C\xAD", + "\xD1\xC5" => "\xE6\x8D\x87", + "\xD1\xC6" => "\xE6\x8C\xB3", + "\xD1\xC7" => "\xE6\x8D\x9A", + "\xD1\xC8" => "\xE6\x8D\x91", + "\xD1\xC9" => "\xE6\x8C\xB8", + "\xD1\xCA" => "\xE6\x8D\x97", + "\xD1\xCB" => "\xE6\x8D\x80", + "\xD1\xCC" => "\xE6\x8D\x88", + "\xD1\xCD" => "\xE6\x95\x8A", + "\xD1\xCE" => "\xE6\x95\x86", + "\xD1\xCF" => "\xE6\x97\x86", + "\xD1\xD0" => "\xE6\x97\x83", + "\xD1\xD1" => "\xE6\x97\x84", + "\xD1\xD2" => "\xE6\x97\x82", + "\xD1\xD3" => "\xE6\x99\x8A", + "\xD1\xD4" => "\xE6\x99\x9F", + "\xD1\xD5" => "\xE6\x99\x87", + "\xD1\xD6" => "\xE6\x99\x91", + "\xD1\xD7" => "\xE6\x9C\x92", + "\xD1\xD8" => "\xE6\x9C\x93", + "\xD1\xD9" => "\xE6\xA0\x9F", + "\xD1\xDA" => "\xE6\xA0\x9A", + "\xD1\xDB" => "\xE6\xA1\x89", + "\xD1\xDC" => "\xE6\xA0\xB2", + "\xD1\xDD" => "\xE6\xA0\xB3", + "\xD1\xDE" => "\xE6\xA0\xBB", + "\xD1\xDF" => "\xE6\xA1\x8B", + "\xD1\xE0" => "\xE6\xA1\x8F", + "\xD1\xE1" => "\xE6\xA0\x96", + "\xD1\xE2" => "\xE6\xA0\xB1", + "\xD1\xE3" => "\xE6\xA0\x9C", + "\xD1\xE4" => "\xE6\xA0\xB5", + "\xD1\xE5" => "\xE6\xA0\xAB", + "\xD1\xE6" => "\xE6\xA0\xAD", + "\xD1\xE7" => "\xE6\xA0\xAF", + "\xD1\xE8" => "\xE6\xA1\x8E", + "\xD1\xE9" => "\xE6\xA1\x84", + "\xD1\xEA" => "\xE6\xA0\xB4", + "\xD1\xEB" => "\xE6\xA0\x9D", + "\xD1\xEC" => "\xE6\xA0\x92", + "\xD1\xED" => "\xE6\xA0\x94", + "\xD1\xEE" => "\xE6\xA0\xA6", + "\xD1\xEF" => "\xE6\xA0\xA8", + "\xD1\xF0" => "\xE6\xA0\xAE", + "\xD1\xF1" => "\xE6\xA1\x8D", + "\xD1\xF2" => "\xE6\xA0\xBA", + "\xD1\xF3" => "\xE6\xA0\xA5", + "\xD1\xF4" => "\xE6\xA0\xA0", + "\xD1\xF5" => "\xE6\xAC\xAC", + "\xD1\xF6" => "\xE6\xAC\xAF", + "\xD1\xF7" => "\xE6\xAC\xAD", + "\xD1\xF8" => "\xE6\xAC\xB1", + "\xD1\xF9" => "\xE6\xAC\xB4", + "\xD1\xFA" => "\xE6\xAD\xAD", + "\xD1\xFB" => "\xE8\x82\x82", + "\xD1\xFC" => "\xE6\xAE\x88", + "\xD1\xFD" => "\xE6\xAF\xA6", + "\xD1\xFE" => "\xE6\xAF\xA4", + "\xD2\x40" => "\xE6\xAF\xA8", + "\xD2\x41" => "\xE6\xAF\xA3", + "\xD2\x42" => "\xE6\xAF\xA2", + "\xD2\x43" => "\xE6\xAF\xA7", + "\xD2\x44" => "\xE6\xB0\xA5", + "\xD2\x45" => "\xE6\xB5\xBA", + "\xD2\x46" => "\xE6\xB5\xA3", + "\xD2\x47" => "\xE6\xB5\xA4", + "\xD2\x48" => "\xE6\xB5\xB6", + "\xD2\x49" => "\xE6\xB4\x8D", + "\xD2\x4A" => "\xE6\xB5\xA1", + "\xD2\x4B" => "\xE6\xB6\x92", + "\xD2\x4C" => "\xE6\xB5\x98", + "\xD2\x4D" => "\xE6\xB5\xA2", + "\xD2\x4E" => "\xE6\xB5\xAD", + "\xD2\x4F" => "\xE6\xB5\xAF", + "\xD2\x50" => "\xE6\xB6\x91", + "\xD2\x51" => "\xE6\xB6\x8D", + "\xD2\x52" => "\xE6\xB7\xAF", + "\xD2\x53" => "\xE6\xB5\xBF", + "\xD2\x54" => "\xE6\xB6\x86", + "\xD2\x55" => "\xE6\xB5\x9E", + "\xD2\x56" => "\xE6\xB5\xA7", + "\xD2\x57" => "\xE6\xB5\xA0", + "\xD2\x58" => "\xE6\xB6\x97", + "\xD2\x59" => "\xE6\xB5\xB0", + "\xD2\x5A" => "\xE6\xB5\xBC", + "\xD2\x5B" => "\xE6\xB5\x9F", + "\xD2\x5C" => "\xE6\xB6\x82", + "\xD2\x5D" => "\xE6\xB6\x98", + "\xD2\x5E" => "\xE6\xB4\xAF", + "\xD2\x5F" => "\xE6\xB5\xA8", + "\xD2\x60" => "\xE6\xB6\x8B", + "\xD2\x61" => "\xE6\xB5\xBE", + "\xD2\x62" => "\xE6\xB6\x80", + "\xD2\x63" => "\xE6\xB6\x84", + "\xD2\x64" => "\xE6\xB4\x96", + "\xD2\x65" => "\xE6\xB6\x83", + "\xD2\x66" => "\xE6\xB5\xBB", + "\xD2\x67" => "\xE6\xB5\xBD", + "\xD2\x68" => "\xE6\xB5\xB5", + "\xD2\x69" => "\xE6\xB6\x90", + "\xD2\x6A" => "\xE7\x83\x9C", + "\xD2\x6B" => "\xE7\x83\x93", + "\xD2\x6C" => "\xE7\x83\x91", + "\xD2\x6D" => "\xE7\x83\x9D", + "\xD2\x6E" => "\xE7\x83\x8B", + "\xD2\x6F" => "\xE7\xBC\xB9", + "\xD2\x70" => "\xE7\x83\xA2", + "\xD2\x71" => "\xE7\x83\x97", + "\xD2\x72" => "\xE7\x83\x92", + "\xD2\x73" => "\xE7\x83\x9E", + "\xD2\x74" => "\xE7\x83\xA0", + "\xD2\x75" => "\xE7\x83\x94", + "\xD2\x76" => "\xE7\x83\x8D", + "\xD2\x77" => "\xE7\x83\x85", + "\xD2\x78" => "\xE7\x83\x86", + "\xD2\x79" => "\xE7\x83\x87", + "\xD2\x7A" => "\xE7\x83\x9A", + "\xD2\x7B" => "\xE7\x83\x8E", + "\xD2\x7C" => "\xE7\x83\xA1", + "\xD2\x7D" => "\xE7\x89\x82", + "\xD2\x7E" => "\xE7\x89\xB8", + "\xD2\xA1" => "\xE7\x89\xB7", + "\xD2\xA2" => "\xE7\x89\xB6", + "\xD2\xA3" => "\xE7\x8C\x80", + "\xD2\xA4" => "\xE7\x8B\xBA", + "\xD2\xA5" => "\xE7\x8B\xB4", + "\xD2\xA6" => "\xE7\x8B\xBE", + "\xD2\xA7" => "\xE7\x8B\xB6", + "\xD2\xA8" => "\xE7\x8B\xB3", + "\xD2\xA9" => "\xE7\x8B\xBB", + "\xD2\xAA" => "\xE7\x8C\x81", + "\xD2\xAB" => "\xE7\x8F\x93", + "\xD2\xAC" => "\xE7\x8F\x99", + "\xD2\xAD" => "\xE7\x8F\xA5", + "\xD2\xAE" => "\xE7\x8F\x96", + "\xD2\xAF" => "\xE7\x8E\xBC", + "\xD2\xB0" => "\xE7\x8F\xA7", + "\xD2\xB1" => "\xE7\x8F\xA3", + "\xD2\xB2" => "\xE7\x8F\xA9", + "\xD2\xB3" => "\xE7\x8F\x9C", + "\xD2\xB4" => "\xE7\x8F\x92", + "\xD2\xB5" => "\xE7\x8F\x9B", + "\xD2\xB6" => "\xE7\x8F\x94", + "\xD2\xB7" => "\xE7\x8F\x9D", + "\xD2\xB8" => "\xE7\x8F\x9A", + "\xD2\xB9" => "\xE7\x8F\x97", + "\xD2\xBA" => "\xE7\x8F\x98", + "\xD2\xBB" => "\xE7\x8F\xA8", + "\xD2\xBC" => "\xE7\x93\x9E", + "\xD2\xBD" => "\xE7\x93\x9F", + "\xD2\xBE" => "\xE7\x93\xB4", + "\xD2\xBF" => "\xE7\x93\xB5", + "\xD2\xC0" => "\xE7\x94\xA1", + "\xD2\xC1" => "\xE7\x95\x9B", + "\xD2\xC2" => "\xE7\x95\x9F", + "\xD2\xC3" => "\xE7\x96\xB0", + "\xD2\xC4" => "\xE7\x97\x81", + "\xD2\xC5" => "\xE7\x96\xBB", + "\xD2\xC6" => "\xE7\x97\x84", + "\xD2\xC7" => "\xE7\x97\x80", + "\xD2\xC8" => "\xE7\x96\xBF", + "\xD2\xC9" => "\xE7\x96\xB6", + "\xD2\xCA" => "\xE7\x96\xBA", + "\xD2\xCB" => "\xE7\x9A\x8A", + "\xD2\xCC" => "\xE7\x9B\x89", + "\xD2\xCD" => "\xE7\x9C\x9D", + "\xD2\xCE" => "\xE7\x9C\x9B", + "\xD2\xCF" => "\xE7\x9C\x90", + "\xD2\xD0" => "\xE7\x9C\x93", + "\xD2\xD1" => "\xE7\x9C\x92", + "\xD2\xD2" => "\xE7\x9C\xA3", + "\xD2\xD3" => "\xE7\x9C\x91", + "\xD2\xD4" => "\xE7\x9C\x95", + "\xD2\xD5" => "\xE7\x9C\x99", + "\xD2\xD6" => "\xE7\x9C\x9A", + "\xD2\xD7" => "\xE7\x9C\xA2", + "\xD2\xD8" => "\xE7\x9C\xA7", + "\xD2\xD9" => "\xE7\xA0\xA3", + "\xD2\xDA" => "\xE7\xA0\xAC", + "\xD2\xDB" => "\xE7\xA0\xA2", + "\xD2\xDC" => "\xE7\xA0\xB5", + "\xD2\xDD" => "\xE7\xA0\xAF", + "\xD2\xDE" => "\xE7\xA0\xA8", + "\xD2\xDF" => "\xE7\xA0\xAE", + "\xD2\xE0" => "\xE7\xA0\xAB", + "\xD2\xE1" => "\xE7\xA0\xA1", + "\xD2\xE2" => "\xE7\xA0\xA9", + "\xD2\xE3" => "\xE7\xA0\xB3", + "\xD2\xE4" => "\xE7\xA0\xAA", + "\xD2\xE5" => "\xE7\xA0\xB1", + "\xD2\xE6" => "\xE7\xA5\x94", + "\xD2\xE7" => "\xE7\xA5\x9B", + "\xD2\xE8" => "\xE7\xA5\x8F", + "\xD2\xE9" => "\xE7\xA5\x9C", + "\xD2\xEA" => "\xE7\xA5\x93", + "\xD2\xEB" => "\xE7\xA5\x92", + "\xD2\xEC" => "\xE7\xA5\x91", + "\xD2\xED" => "\xE7\xA7\xAB", + "\xD2\xEE" => "\xE7\xA7\xAC", + "\xD2\xEF" => "\xE7\xA7\xA0", + "\xD2\xF0" => "\xE7\xA7\xAE", + "\xD2\xF1" => "\xE7\xA7\xAD", + "\xD2\xF2" => "\xE7\xA7\xAA", + "\xD2\xF3" => "\xE7\xA7\x9C", + "\xD2\xF4" => "\xE7\xA7\x9E", + "\xD2\xF5" => "\xE7\xA7\x9D", + "\xD2\xF6" => "\xE7\xAA\x86", + "\xD2\xF7" => "\xE7\xAA\x89", + "\xD2\xF8" => "\xE7\xAA\x85", + "\xD2\xF9" => "\xE7\xAA\x8B", + "\xD2\xFA" => "\xE7\xAA\x8C", + "\xD2\xFB" => "\xE7\xAA\x8A", + "\xD2\xFC" => "\xE7\xAA\x87", + "\xD2\xFD" => "\xE7\xAB\x98", + "\xD2\xFE" => "\xE7\xAC\x90", + "\xD3\x40" => "\xE7\xAC\x84", + "\xD3\x41" => "\xE7\xAC\x93", + "\xD3\x42" => "\xE7\xAC\x85", + "\xD3\x43" => "\xE7\xAC\x8F", + "\xD3\x44" => "\xE7\xAC\x88", + "\xD3\x45" => "\xE7\xAC\x8A", + "\xD3\x46" => "\xE7\xAC\x8E", + "\xD3\x47" => "\xE7\xAC\x89", + "\xD3\x48" => "\xE7\xAC\x92", + "\xD3\x49" => "\xE7\xB2\x84", + "\xD3\x4A" => "\xE7\xB2\x91", + "\xD3\x4B" => "\xE7\xB2\x8A", + "\xD3\x4C" => "\xE7\xB2\x8C", + "\xD3\x4D" => "\xE7\xB2\x88", + "\xD3\x4E" => "\xE7\xB2\x8D", + "\xD3\x4F" => "\xE7\xB2\x85", + "\xD3\x50" => "\xE7\xB4\x9E", + "\xD3\x51" => "\xE7\xB4\x9D", + "\xD3\x52" => "\xE7\xB4\x91", + "\xD3\x53" => "\xE7\xB4\x8E", + "\xD3\x54" => "\xE7\xB4\x98", + "\xD3\x55" => "\xE7\xB4\x96", + "\xD3\x56" => "\xE7\xB4\x93", + "\xD3\x57" => "\xE7\xB4\x9F", + "\xD3\x58" => "\xE7\xB4\x92", + "\xD3\x59" => "\xE7\xB4\x8F", + "\xD3\x5A" => "\xE7\xB4\x8C", + "\xD3\x5B" => "\xE7\xBD\x9C", + "\xD3\x5C" => "\xE7\xBD\xA1", + "\xD3\x5D" => "\xE7\xBD\x9E", + "\xD3\x5E" => "\xE7\xBD\xA0", + "\xD3\x5F" => "\xE7\xBD\x9D", + "\xD3\x60" => "\xE7\xBD\x9B", + "\xD3\x61" => "\xE7\xBE\x96", + "\xD3\x62" => "\xE7\xBE\x92", + "\xD3\x63" => "\xE7\xBF\x83", + "\xD3\x64" => "\xE7\xBF\x82", + "\xD3\x65" => "\xE7\xBF\x80", + "\xD3\x66" => "\xE8\x80\x96", + "\xD3\x67" => "\xE8\x80\xBE", + "\xD3\x68" => "\xE8\x80\xB9", + "\xD3\x69" => "\xE8\x83\xBA", + "\xD3\x6A" => "\xE8\x83\xB2", + "\xD3\x6B" => "\xE8\x83\xB9", + "\xD3\x6C" => "\xE8\x83\xB5", + "\xD3\x6D" => "\xE8\x84\x81", + "\xD3\x6E" => "\xE8\x83\xBB", + "\xD3\x6F" => "\xE8\x84\x80", + "\xD3\x70" => "\xE8\x88\x81", + "\xD3\x71" => "\xE8\x88\xAF", + "\xD3\x72" => "\xE8\x88\xA5", + "\xD3\x73" => "\xE8\x8C\xB3", + "\xD3\x74" => "\xE8\x8C\xAD", + "\xD3\x75" => "\xE8\x8D\x84", + "\xD3\x76" => "\xE8\x8C\x99", + "\xD3\x77" => "\xE8\x8D\x91", + "\xD3\x78" => "\xE8\x8C\xA5", + "\xD3\x79" => "\xE8\x8D\x96", + "\xD3\x7A" => "\xE8\x8C\xBF", + "\xD3\x7B" => "\xE8\x8D\x81", + "\xD3\x7C" => "\xE8\x8C\xA6", + "\xD3\x7D" => "\xE8\x8C\x9C", + "\xD3\x7E" => "\xE8\x8C\xA2", + "\xD3\xA1" => "\xE8\x8D\x82", + "\xD3\xA2" => "\xE8\x8D\x8E", + "\xD3\xA3" => "\xE8\x8C\x9B", + "\xD3\xA4" => "\xE8\x8C\xAA", + "\xD3\xA5" => "\xE8\x8C\x88", + "\xD3\xA6" => "\xE8\x8C\xBC", + "\xD3\xA7" => "\xE8\x8D\x8D", + "\xD3\xA8" => "\xE8\x8C\x96", + "\xD3\xA9" => "\xE8\x8C\xA4", + "\xD3\xAA" => "\xE8\x8C\xA0", + "\xD3\xAB" => "\xE8\x8C\xB7", + "\xD3\xAC" => "\xE8\x8C\xAF", + "\xD3\xAD" => "\xE8\x8C\xA9", + "\xD3\xAE" => "\xE8\x8D\x87", + "\xD3\xAF" => "\xE8\x8D\x85", + "\xD3\xB0" => "\xE8\x8D\x8C", + "\xD3\xB1" => "\xE8\x8D\x93", + "\xD3\xB2" => "\xE8\x8C\x9E", + "\xD3\xB3" => "\xE8\x8C\xAC", + "\xD3\xB4" => "\xE8\x8D\x8B", + "\xD3\xB5" => "\xE8\x8C\xA7", + "\xD3\xB6" => "\xE8\x8D\x88", + "\xD3\xB7" => "\xE8\x99\x93", + "\xD3\xB8" => "\xE8\x99\x92", + "\xD3\xB9" => "\xE8\x9A\xA2", + "\xD3\xBA" => "\xE8\x9A\xA8", + "\xD3\xBB" => "\xE8\x9A\x96", + "\xD3\xBC" => "\xE8\x9A\x8D", + "\xD3\xBD" => "\xE8\x9A\x91", + "\xD3\xBE" => "\xE8\x9A\x9E", + "\xD3\xBF" => "\xE8\x9A\x87", + "\xD3\xC0" => "\xE8\x9A\x97", + "\xD3\xC1" => "\xE8\x9A\x86", + "\xD3\xC2" => "\xE8\x9A\x8B", + "\xD3\xC3" => "\xE8\x9A\x9A", + "\xD3\xC4" => "\xE8\x9A\x85", + "\xD3\xC5" => "\xE8\x9A\xA5", + "\xD3\xC6" => "\xE8\x9A\x99", + "\xD3\xC7" => "\xE8\x9A\xA1", + "\xD3\xC8" => "\xE8\x9A\xA7", + "\xD3\xC9" => "\xE8\x9A\x95", + "\xD3\xCA" => "\xE8\x9A\x98", + "\xD3\xCB" => "\xE8\x9A\x8E", + "\xD3\xCC" => "\xE8\x9A\x9D", + "\xD3\xCD" => "\xE8\x9A\x90", + "\xD3\xCE" => "\xE8\x9A\x94", + "\xD3\xCF" => "\xE8\xA1\x83", + "\xD3\xD0" => "\xE8\xA1\x84", + "\xD3\xD1" => "\xE8\xA1\xAD", + "\xD3\xD2" => "\xE8\xA1\xB5", + "\xD3\xD3" => "\xE8\xA1\xB6", + "\xD3\xD4" => "\xE8\xA1\xB2", + "\xD3\xD5" => "\xE8\xA2\x80", + "\xD3\xD6" => "\xE8\xA1\xB1", + "\xD3\xD7" => "\xE8\xA1\xBF", + "\xD3\xD8" => "\xE8\xA1\xAF", + "\xD3\xD9" => "\xE8\xA2\x83", + "\xD3\xDA" => "\xE8\xA1\xBE", + "\xD3\xDB" => "\xE8\xA1\xB4", + "\xD3\xDC" => "\xE8\xA1\xBC", + "\xD3\xDD" => "\xE8\xA8\x92", + "\xD3\xDE" => "\xE8\xB1\x87", + "\xD3\xDF" => "\xE8\xB1\x97", + "\xD3\xE0" => "\xE8\xB1\xBB", + "\xD3\xE1" => "\xE8\xB2\xA4", + "\xD3\xE2" => "\xE8\xB2\xA3", + "\xD3\xE3" => "\xE8\xB5\xB6", + "\xD3\xE4" => "\xE8\xB5\xB8", + "\xD3\xE5" => "\xE8\xB6\xB5", + "\xD3\xE6" => "\xE8\xB6\xB7", + "\xD3\xE7" => "\xE8\xB6\xB6", + "\xD3\xE8" => "\xE8\xBB\x91", + "\xD3\xE9" => "\xE8\xBB\x93", + "\xD3\xEA" => "\xE8\xBF\xBE", + "\xD3\xEB" => "\xE8\xBF\xB5", + "\xD3\xEC" => "\xE9\x80\x82", + "\xD3\xED" => "\xE8\xBF\xBF", + "\xD3\xEE" => "\xE8\xBF\xBB", + "\xD3\xEF" => "\xE9\x80\x84", + "\xD3\xF0" => "\xE8\xBF\xBC", + "\xD3\xF1" => "\xE8\xBF\xB6", + "\xD3\xF2" => "\xE9\x83\x96", + "\xD3\xF3" => "\xE9\x83\xA0", + "\xD3\xF4" => "\xE9\x83\x99", + "\xD3\xF5" => "\xE9\x83\x9A", + "\xD3\xF6" => "\xE9\x83\xA3", + "\xD3\xF7" => "\xE9\x83\x9F", + "\xD3\xF8" => "\xE9\x83\xA5", + "\xD3\xF9" => "\xE9\x83\x98", + "\xD3\xFA" => "\xE9\x83\x9B", + "\xD3\xFB" => "\xE9\x83\x97", + "\xD3\xFC" => "\xE9\x83\x9C", + "\xD3\xFD" => "\xE9\x83\xA4", + "\xD3\xFE" => "\xE9\x85\x90", + "\xD4\x40" => "\xE9\x85\x8E", + "\xD4\x41" => "\xE9\x85\x8F", + "\xD4\x42" => "\xE9\x87\x95", + "\xD4\x43" => "\xE9\x87\xA2", + "\xD4\x44" => "\xE9\x87\x9A", + "\xD4\x45" => "\xE9\x99\x9C", + "\xD4\x46" => "\xE9\x99\x9F", + "\xD4\x47" => "\xE9\x9A\xBC", + "\xD4\x48" => "\xE9\xA3\xA3", + "\xD4\x49" => "\xE9\xAB\x9F", + "\xD4\x4A" => "\xE9\xAC\xAF", + "\xD4\x4B" => "\xE4\xB9\xBF", + "\xD4\x4C" => "\xE5\x81\xB0", + "\xD4\x4D" => "\xE5\x81\xAA", + "\xD4\x4E" => "\xE5\x81\xA1", + "\xD4\x4F" => "\xE5\x81\x9E", + "\xD4\x50" => "\xE5\x81\xA0", + "\xD4\x51" => "\xE5\x81\x93", + "\xD4\x52" => "\xE5\x81\x8B", + "\xD4\x53" => "\xE5\x81\x9D", + "\xD4\x54" => "\xE5\x81\xB2", + "\xD4\x55" => "\xE5\x81\x88", + "\xD4\x56" => "\xE5\x81\x8D", + "\xD4\x57" => "\xE5\x81\x81", + "\xD4\x58" => "\xE5\x81\x9B", + "\xD4\x59" => "\xE5\x81\x8A", + "\xD4\x5A" => "\xE5\x81\xA2", + "\xD4\x5B" => "\xE5\x80\x95", + "\xD4\x5C" => "\xE5\x81\x85", + "\xD4\x5D" => "\xE5\x81\x9F", + "\xD4\x5E" => "\xE5\x81\xA9", + "\xD4\x5F" => "\xE5\x81\xAB", + "\xD4\x60" => "\xE5\x81\xA3", + "\xD4\x61" => "\xE5\x81\xA4", + "\xD4\x62" => "\xE5\x81\x86", + "\xD4\x63" => "\xE5\x81\x80", + "\xD4\x64" => "\xE5\x81\xAE", + "\xD4\x65" => "\xE5\x81\xB3", + "\xD4\x66" => "\xE5\x81\x97", + "\xD4\x67" => "\xE5\x81\x91", + "\xD4\x68" => "\xE5\x87\x90", + "\xD4\x69" => "\xE5\x89\xAB", + "\xD4\x6A" => "\xE5\x89\xAD", + "\xD4\x6B" => "\xE5\x89\xAC", + "\xD4\x6C" => "\xE5\x89\xAE", + "\xD4\x6D" => "\xE5\x8B\x96", + "\xD4\x6E" => "\xE5\x8B\x93", + "\xD4\x6F" => "\xE5\x8C\xAD", + "\xD4\x70" => "\xE5\x8E\x9C", + "\xD4\x71" => "\xE5\x95\xB5", + "\xD4\x72" => "\xE5\x95\xB6", + "\xD4\x73" => "\xE5\x94\xBC", + "\xD4\x74" => "\xE5\x95\x8D", + "\xD4\x75" => "\xE5\x95\x90", + "\xD4\x76" => "\xE5\x94\xB4", + "\xD4\x77" => "\xE5\x94\xAA", + "\xD4\x78" => "\xE5\x95\x91", + "\xD4\x79" => "\xE5\x95\xA2", + "\xD4\x7A" => "\xE5\x94\xB6", + "\xD4\x7B" => "\xE5\x94\xB5", + "\xD4\x7C" => "\xE5\x94\xB0", + "\xD4\x7D" => "\xE5\x95\x92", + "\xD4\x7E" => "\xE5\x95\x85", + "\xD4\xA1" => "\xE5\x94\x8C", + "\xD4\xA2" => "\xE5\x94\xB2", + "\xD4\xA3" => "\xE5\x95\xA5", + "\xD4\xA4" => "\xE5\x95\x8E", + "\xD4\xA5" => "\xE5\x94\xB9", + "\xD4\xA6" => "\xE5\x95\x88", + "\xD4\xA7" => "\xE5\x94\xAD", + "\xD4\xA8" => "\xE5\x94\xBB", + "\xD4\xA9" => "\xE5\x95\x80", + "\xD4\xAA" => "\xE5\x95\x8B", + "\xD4\xAB" => "\xE5\x9C\x8A", + "\xD4\xAC" => "\xE5\x9C\x87", + "\xD4\xAD" => "\xE5\x9F\xBB", + "\xD4\xAE" => "\xE5\xA0\x94", + "\xD4\xAF" => "\xE5\x9F\xA2", + "\xD4\xB0" => "\xE5\x9F\xB6", + "\xD4\xB1" => "\xE5\x9F\x9C", + "\xD4\xB2" => "\xE5\x9F\xB4", + "\xD4\xB3" => "\xE5\xA0\x80", + "\xD4\xB4" => "\xE5\x9F\xAD", + "\xD4\xB5" => "\xE5\x9F\xBD", + "\xD4\xB6" => "\xE5\xA0\x88", + "\xD4\xB7" => "\xE5\x9F\xB8", + "\xD4\xB8" => "\xE5\xA0\x8B", + "\xD4\xB9" => "\xE5\x9F\xB3", + "\xD4\xBA" => "\xE5\x9F\x8F", + "\xD4\xBB" => "\xE5\xA0\x87", + "\xD4\xBC" => "\xE5\x9F\xAE", + "\xD4\xBD" => "\xE5\x9F\xA3", + "\xD4\xBE" => "\xE5\x9F\xB2", + "\xD4\xBF" => "\xE5\x9F\xA5", + "\xD4\xC0" => "\xE5\x9F\xAC", + "\xD4\xC1" => "\xE5\x9F\xA1", + "\xD4\xC2" => "\xE5\xA0\x8E", + "\xD4\xC3" => "\xE5\x9F\xBC", + "\xD4\xC4" => "\xE5\xA0\x90", + "\xD4\xC5" => "\xE5\x9F\xA7", + "\xD4\xC6" => "\xE5\xA0\x81", + "\xD4\xC7" => "\xE5\xA0\x8C", + "\xD4\xC8" => "\xE5\x9F\xB1", + "\xD4\xC9" => "\xE5\x9F\xA9", + "\xD4\xCA" => "\xE5\x9F\xB0", + "\xD4\xCB" => "\xE5\xA0\x8D", + "\xD4\xCC" => "\xE5\xA0\x84", + "\xD4\xCD" => "\xE5\xA5\x9C", + "\xD4\xCE" => "\xE5\xA9\xA0", + "\xD4\xCF" => "\xE5\xA9\x98", + "\xD4\xD0" => "\xE5\xA9\x95", + "\xD4\xD1" => "\xE5\xA9\xA7", + "\xD4\xD2" => "\xE5\xA9\x9E", + "\xD4\xD3" => "\xE5\xA8\xB8", + "\xD4\xD4" => "\xE5\xA8\xB5", + "\xD4\xD5" => "\xE5\xA9\xAD", + "\xD4\xD6" => "\xE5\xA9\x90", + "\xD4\xD7" => "\xE5\xA9\x9F", + "\xD4\xD8" => "\xE5\xA9\xA5", + "\xD4\xD9" => "\xE5\xA9\xAC", + "\xD4\xDA" => "\xE5\xA9\x93", + "\xD4\xDB" => "\xE5\xA9\xA4", + "\xD4\xDC" => "\xE5\xA9\x97", + "\xD4\xDD" => "\xE5\xA9\x83", + "\xD4\xDE" => "\xE5\xA9\x9D", + "\xD4\xDF" => "\xE5\xA9\x92", + "\xD4\xE0" => "\xE5\xA9\x84", + "\xD4\xE1" => "\xE5\xA9\x9B", + "\xD4\xE2" => "\xE5\xA9\x88", + "\xD4\xE3" => "\xE5\xAA\x8E", + "\xD4\xE4" => "\xE5\xA8\xBE", + "\xD4\xE5" => "\xE5\xA9\x8D", + "\xD4\xE6" => "\xE5\xA8\xB9", + "\xD4\xE7" => "\xE5\xA9\x8C", + "\xD4\xE8" => "\xE5\xA9\xB0", + "\xD4\xE9" => "\xE5\xA9\xA9", + "\xD4\xEA" => "\xE5\xA9\x87", + "\xD4\xEB" => "\xE5\xA9\x91", + "\xD4\xEC" => "\xE5\xA9\x96", + "\xD4\xED" => "\xE5\xA9\x82", + "\xD4\xEE" => "\xE5\xA9\x9C", + "\xD4\xEF" => "\xE5\xAD\xB2", + "\xD4\xF0" => "\xE5\xAD\xAE", + "\xD4\xF1" => "\xE5\xAF\x81", + "\xD4\xF2" => "\xE5\xAF\x80", + "\xD4\xF3" => "\xE5\xB1\x99", + "\xD4\xF4" => "\xE5\xB4\x9E", + "\xD4\xF5" => "\xE5\xB4\x8B", + "\xD4\xF6" => "\xE5\xB4\x9D", + "\xD4\xF7" => "\xE5\xB4\x9A", + "\xD4\xF8" => "\xE5\xB4\xA0", + "\xD4\xF9" => "\xE5\xB4\x8C", + "\xD4\xFA" => "\xE5\xB4\xA8", + "\xD4\xFB" => "\xE5\xB4\x8D", + "\xD4\xFC" => "\xE5\xB4\xA6", + "\xD4\xFD" => "\xE5\xB4\xA5", + "\xD4\xFE" => "\xE5\xB4\x8F", + "\xD5\x40" => "\xE5\xB4\xB0", + "\xD5\x41" => "\xE5\xB4\x92", + "\xD5\x42" => "\xE5\xB4\xA3", + "\xD5\x43" => "\xE5\xB4\x9F", + "\xD5\x44" => "\xE5\xB4\xAE", + "\xD5\x45" => "\xE5\xB8\xBE", + "\xD5\x46" => "\xE5\xB8\xB4", + "\xD5\x47" => "\xE5\xBA\xB1", + "\xD5\x48" => "\xE5\xBA\xB4", + "\xD5\x49" => "\xE5\xBA\xB9", + "\xD5\x4A" => "\xE5\xBA\xB2", + "\xD5\x4B" => "\xE5\xBA\xB3", + "\xD5\x4C" => "\xE5\xBC\xB6", + "\xD5\x4D" => "\xE5\xBC\xB8", + "\xD5\x4E" => "\xE5\xBE\x9B", + "\xD5\x4F" => "\xE5\xBE\x96", + "\xD5\x50" => "\xE5\xBE\x9F", + "\xD5\x51" => "\xE6\x82\x8A", + "\xD5\x52" => "\xE6\x82\x90", + "\xD5\x53" => "\xE6\x82\x86", + "\xD5\x54" => "\xE6\x82\xBE", + "\xD5\x55" => "\xE6\x82\xB0", + "\xD5\x56" => "\xE6\x82\xBA", + "\xD5\x57" => "\xE6\x83\x93", + "\xD5\x58" => "\xE6\x83\x94", + "\xD5\x59" => "\xE6\x83\x8F", + "\xD5\x5A" => "\xE6\x83\xA4", + "\xD5\x5B" => "\xE6\x83\x99", + "\xD5\x5C" => "\xE6\x83\x9D", + "\xD5\x5D" => "\xE6\x83\x88", + "\xD5\x5E" => "\xE6\x82\xB1", + "\xD5\x5F" => "\xE6\x83\x9B", + "\xD5\x60" => "\xE6\x82\xB7", + "\xD5\x61" => "\xE6\x83\x8A", + "\xD5\x62" => "\xE6\x82\xBF", + "\xD5\x63" => "\xE6\x83\x83", + "\xD5\x64" => "\xE6\x83\x8D", + "\xD5\x65" => "\xE6\x83\x80", + "\xD5\x66" => "\xE6\x8C\xB2", + "\xD5\x67" => "\xE6\x8D\xA5", + "\xD5\x68" => "\xE6\x8E\x8A", + "\xD5\x69" => "\xE6\x8E\x82", + "\xD5\x6A" => "\xE6\x8D\xBD", + "\xD5\x6B" => "\xE6\x8E\xBD", + "\xD5\x6C" => "\xE6\x8E\x9E", + "\xD5\x6D" => "\xE6\x8E\xAD", + "\xD5\x6E" => "\xE6\x8E\x9D", + "\xD5\x6F" => "\xE6\x8E\x97", + "\xD5\x70" => "\xE6\x8E\xAB", + "\xD5\x71" => "\xE6\x8E\x8E", + "\xD5\x72" => "\xE6\x8D\xAF", + "\xD5\x73" => "\xE6\x8E\x87", + "\xD5\x74" => "\xE6\x8E\x90", + "\xD5\x75" => "\xE6\x8D\xAE", + "\xD5\x76" => "\xE6\x8E\xAF", + "\xD5\x77" => "\xE6\x8D\xB5", + "\xD5\x78" => "\xE6\x8E\x9C", + "\xD5\x79" => "\xE6\x8D\xAD", + "\xD5\x7A" => "\xE6\x8E\xAE", + "\xD5\x7B" => "\xE6\x8D\xBC", + "\xD5\x7C" => "\xE6\x8E\xA4", + "\xD5\x7D" => "\xE6\x8C\xBB", + "\xD5\x7E" => "\xE6\x8E\x9F", + "\xD5\xA1" => "\xE6\x8D\xB8", + "\xD5\xA2" => "\xE6\x8E\x85", + "\xD5\xA3" => "\xE6\x8E\x81", + "\xD5\xA4" => "\xE6\x8E\x91", + "\xD5\xA5" => "\xE6\x8E\x8D", + "\xD5\xA6" => "\xE6\x8D\xB0", + "\xD5\xA7" => "\xE6\x95\x93", + "\xD5\xA8" => "\xE6\x97\x8D", + "\xD5\xA9" => "\xE6\x99\xA5", + "\xD5\xAA" => "\xE6\x99\xA1", + "\xD5\xAB" => "\xE6\x99\x9B", + "\xD5\xAC" => "\xE6\x99\x99", + "\xD5\xAD" => "\xE6\x99\x9C", + "\xD5\xAE" => "\xE6\x99\xA2", + "\xD5\xAF" => "\xE6\x9C\x98", + "\xD5\xB0" => "\xE6\xA1\xB9", + "\xD5\xB1" => "\xE6\xA2\x87", + "\xD5\xB2" => "\xE6\xA2\x90", + "\xD5\xB3" => "\xE6\xA2\x9C", + "\xD5\xB4" => "\xE6\xA1\xAD", + "\xD5\xB5" => "\xE6\xA1\xAE", + "\xD5\xB6" => "\xE6\xA2\xAE", + "\xD5\xB7" => "\xE6\xA2\xAB", + "\xD5\xB8" => "\xE6\xA5\x96", + "\xD5\xB9" => "\xE6\xA1\xAF", + "\xD5\xBA" => "\xE6\xA2\xA3", + "\xD5\xBB" => "\xE6\xA2\xAC", + "\xD5\xBC" => "\xE6\xA2\xA9", + "\xD5\xBD" => "\xE6\xA1\xB5", + "\xD5\xBE" => "\xE6\xA1\xB4", + "\xD5\xBF" => "\xE6\xA2\xB2", + "\xD5\xC0" => "\xE6\xA2\x8F", + "\xD5\xC1" => "\xE6\xA1\xB7", + "\xD5\xC2" => "\xE6\xA2\x92", + "\xD5\xC3" => "\xE6\xA1\xBC", + "\xD5\xC4" => "\xE6\xA1\xAB", + "\xD5\xC5" => "\xE6\xA1\xB2", + "\xD5\xC6" => "\xE6\xA2\xAA", + "\xD5\xC7" => "\xE6\xA2\x80", + "\xD5\xC8" => "\xE6\xA1\xB1", + "\xD5\xC9" => "\xE6\xA1\xBE", + "\xD5\xCA" => "\xE6\xA2\x9B", + "\xD5\xCB" => "\xE6\xA2\x96", + "\xD5\xCC" => "\xE6\xA2\x8B", + "\xD5\xCD" => "\xE6\xA2\xA0", + "\xD5\xCE" => "\xE6\xA2\x89", + "\xD5\xCF" => "\xE6\xA2\xA4", + "\xD5\xD0" => "\xE6\xA1\xB8", + "\xD5\xD1" => "\xE6\xA1\xBB", + "\xD5\xD2" => "\xE6\xA2\x91", + "\xD5\xD3" => "\xE6\xA2\x8C", + "\xD5\xD4" => "\xE6\xA2\x8A", + "\xD5\xD5" => "\xE6\xA1\xBD", + "\xD5\xD6" => "\xE6\xAC\xB6", + "\xD5\xD7" => "\xE6\xAC\xB3", + "\xD5\xD8" => "\xE6\xAC\xB7", + "\xD5\xD9" => "\xE6\xAC\xB8", + "\xD5\xDA" => "\xE6\xAE\x91", + "\xD5\xDB" => "\xE6\xAE\x8F", + "\xD5\xDC" => "\xE6\xAE\x8D", + "\xD5\xDD" => "\xE6\xAE\x8E", + "\xD5\xDE" => "\xE6\xAE\x8C", + "\xD5\xDF" => "\xE6\xB0\xAA", + "\xD5\xE0" => "\xE6\xB7\x80", + "\xD5\xE1" => "\xE6\xB6\xAB", + "\xD5\xE2" => "\xE6\xB6\xB4", + "\xD5\xE3" => "\xE6\xB6\xB3", + "\xD5\xE4" => "\xE6\xB9\xB4", + "\xD5\xE5" => "\xE6\xB6\xAC", + "\xD5\xE6" => "\xE6\xB7\xA9", + "\xD5\xE7" => "\xE6\xB7\xA2", + "\xD5\xE8" => "\xE6\xB6\xB7", + "\xD5\xE9" => "\xE6\xB7\xB6", + "\xD5\xEA" => "\xE6\xB7\x94", + "\xD5\xEB" => "\xE6\xB8\x80", + "\xD5\xEC" => "\xE6\xB7\x88", + "\xD5\xED" => "\xE6\xB7\xA0", + "\xD5\xEE" => "\xE6\xB7\x9F", + "\xD5\xEF" => "\xE6\xB7\x96", + "\xD5\xF0" => "\xE6\xB6\xBE", + "\xD5\xF1" => "\xE6\xB7\xA5", + "\xD5\xF2" => "\xE6\xB7\x9C", + "\xD5\xF3" => "\xE6\xB7\x9D", + "\xD5\xF4" => "\xE6\xB7\x9B", + "\xD5\xF5" => "\xE6\xB7\xB4", + "\xD5\xF6" => "\xE6\xB7\x8A", + "\xD5\xF7" => "\xE6\xB6\xBD", + "\xD5\xF8" => "\xE6\xB7\xAD", + "\xD5\xF9" => "\xE6\xB7\xB0", + "\xD5\xFA" => "\xE6\xB6\xBA", + "\xD5\xFB" => "\xE6\xB7\x95", + "\xD5\xFC" => "\xE6\xB7\x82", + "\xD5\xFD" => "\xE6\xB7\x8F", + "\xD5\xFE" => "\xE6\xB7\x89", + "\xD6\x40" => "\xE6\xB7\x90", + "\xD6\x41" => "\xE6\xB7\xB2", + "\xD6\x42" => "\xE6\xB7\x93", + "\xD6\x43" => "\xE6\xB7\xBD", + "\xD6\x44" => "\xE6\xB7\x97", + "\xD6\x45" => "\xE6\xB7\x8D", + "\xD6\x46" => "\xE6\xB7\xA3", + "\xD6\x47" => "\xE6\xB6\xBB", + "\xD6\x48" => "\xE7\x83\xBA", + "\xD6\x49" => "\xE7\x84\x8D", + "\xD6\x4A" => "\xE7\x83\xB7", + "\xD6\x4B" => "\xE7\x84\x97", + "\xD6\x4C" => "\xE7\x83\xB4", + "\xD6\x4D" => "\xE7\x84\x8C", + "\xD6\x4E" => "\xE7\x83\xB0", + "\xD6\x4F" => "\xE7\x84\x84", + "\xD6\x50" => "\xE7\x83\xB3", + "\xD6\x51" => "\xE7\x84\x90", + "\xD6\x52" => "\xE7\x83\xBC", + "\xD6\x53" => "\xE7\x83\xBF", + "\xD6\x54" => "\xE7\x84\x86", + "\xD6\x55" => "\xE7\x84\x93", + "\xD6\x56" => "\xE7\x84\x80", + "\xD6\x57" => "\xE7\x83\xB8", + "\xD6\x58" => "\xE7\x83\xB6", + "\xD6\x59" => "\xE7\x84\x8B", + "\xD6\x5A" => "\xE7\x84\x82", + "\xD6\x5B" => "\xE7\x84\x8E", + "\xD6\x5C" => "\xE7\x89\xBE", + "\xD6\x5D" => "\xE7\x89\xBB", + "\xD6\x5E" => "\xE7\x89\xBC", + "\xD6\x5F" => "\xE7\x89\xBF", + "\xD6\x60" => "\xE7\x8C\x9D", + "\xD6\x61" => "\xE7\x8C\x97", + "\xD6\x62" => "\xE7\x8C\x87", + "\xD6\x63" => "\xE7\x8C\x91", + "\xD6\x64" => "\xE7\x8C\x98", + "\xD6\x65" => "\xE7\x8C\x8A", + "\xD6\x66" => "\xE7\x8C\x88", + "\xD6\x67" => "\xE7\x8B\xBF", + "\xD6\x68" => "\xE7\x8C\x8F", + "\xD6\x69" => "\xE7\x8C\x9E", + "\xD6\x6A" => "\xE7\x8E\x88", + "\xD6\x6B" => "\xE7\x8F\xB6", + "\xD6\x6C" => "\xE7\x8F\xB8", + "\xD6\x6D" => "\xE7\x8F\xB5", + "\xD6\x6E" => "\xE7\x90\x84", + "\xD6\x6F" => "\xE7\x90\x81", + "\xD6\x70" => "\xE7\x8F\xBD", + "\xD6\x71" => "\xE7\x90\x87", + "\xD6\x72" => "\xE7\x90\x80", + "\xD6\x73" => "\xE7\x8F\xBA", + "\xD6\x74" => "\xE7\x8F\xBC", + "\xD6\x75" => "\xE7\x8F\xBF", + "\xD6\x76" => "\xE7\x90\x8C", + "\xD6\x77" => "\xE7\x90\x8B", + "\xD6\x78" => "\xE7\x8F\xB4", + "\xD6\x79" => "\xE7\x90\x88", + "\xD6\x7A" => "\xE7\x95\xA4", + "\xD6\x7B" => "\xE7\x95\xA3", + "\xD6\x7C" => "\xE7\x97\x8E", + "\xD6\x7D" => "\xE7\x97\x92", + "\xD6\x7E" => "\xE7\x97\x8F", + "\xD6\xA1" => "\xE7\x97\x8B", + "\xD6\xA2" => "\xE7\x97\x8C", + "\xD6\xA3" => "\xE7\x97\x91", + "\xD6\xA4" => "\xE7\x97\x90", + "\xD6\xA5" => "\xE7\x9A\x8F", + "\xD6\xA6" => "\xE7\x9A\x89", + "\xD6\xA7" => "\xE7\x9B\x93", + "\xD6\xA8" => "\xE7\x9C\xB9", + "\xD6\xA9" => "\xE7\x9C\xAF", + "\xD6\xAA" => "\xE7\x9C\xAD", + "\xD6\xAB" => "\xE7\x9C\xB1", + "\xD6\xAC" => "\xE7\x9C\xB2", + "\xD6\xAD" => "\xE7\x9C\xB4", + "\xD6\xAE" => "\xE7\x9C\xB3", + "\xD6\xAF" => "\xE7\x9C\xBD", + "\xD6\xB0" => "\xE7\x9C\xA5", + "\xD6\xB1" => "\xE7\x9C\xBB", + "\xD6\xB2" => "\xE7\x9C\xB5", + "\xD6\xB3" => "\xE7\xA1\x88", + "\xD6\xB4" => "\xE7\xA1\x92", + "\xD6\xB5" => "\xE7\xA1\x89", + "\xD6\xB6" => "\xE7\xA1\x8D", + "\xD6\xB7" => "\xE7\xA1\x8A", + "\xD6\xB8" => "\xE7\xA1\x8C", + "\xD6\xB9" => "\xE7\xA0\xA6", + "\xD6\xBA" => "\xE7\xA1\x85", + "\xD6\xBB" => "\xE7\xA1\x90", + "\xD6\xBC" => "\xE7\xA5\xA4", + "\xD6\xBD" => "\xE7\xA5\xA7", + "\xD6\xBE" => "\xE7\xA5\xA9", + "\xD6\xBF" => "\xE7\xA5\xAA", + "\xD6\xC0" => "\xE7\xA5\xA3", + "\xD6\xC1" => "\xE7\xA5\xAB", + "\xD6\xC2" => "\xE7\xA5\xA1", + "\xD6\xC3" => "\xE7\xA6\xBB", + "\xD6\xC4" => "\xE7\xA7\xBA", + "\xD6\xC5" => "\xE7\xA7\xB8", + "\xD6\xC6" => "\xE7\xA7\xB6", + "\xD6\xC7" => "\xE7\xA7\xB7", + "\xD6\xC8" => "\xE7\xAA\x8F", + "\xD6\xC9" => "\xE7\xAA\x94", + "\xD6\xCA" => "\xE7\xAA\x90", + "\xD6\xCB" => "\xE7\xAC\xB5", + "\xD6\xCC" => "\xE7\xAD\x87", + "\xD6\xCD" => "\xE7\xAC\xB4", + "\xD6\xCE" => "\xE7\xAC\xA5", + "\xD6\xCF" => "\xE7\xAC\xB0", + "\xD6\xD0" => "\xE7\xAC\xA2", + "\xD6\xD1" => "\xE7\xAC\xA4", + "\xD6\xD2" => "\xE7\xAC\xB3", + "\xD6\xD3" => "\xE7\xAC\x98", + "\xD6\xD4" => "\xE7\xAC\xAA", + "\xD6\xD5" => "\xE7\xAC\x9D", + "\xD6\xD6" => "\xE7\xAC\xB1", + "\xD6\xD7" => "\xE7\xAC\xAB", + "\xD6\xD8" => "\xE7\xAC\xAD", + "\xD6\xD9" => "\xE7\xAC\xAF", + "\xD6\xDA" => "\xE7\xAC\xB2", + "\xD6\xDB" => "\xE7\xAC\xB8", + "\xD6\xDC" => "\xE7\xAC\x9A", + "\xD6\xDD" => "\xE7\xAC\xA3", + "\xD6\xDE" => "\xE7\xB2\x94", + "\xD6\xDF" => "\xE7\xB2\x98", + "\xD6\xE0" => "\xE7\xB2\x96", + "\xD6\xE1" => "\xE7\xB2\xA3", + "\xD6\xE2" => "\xE7\xB4\xB5", + "\xD6\xE3" => "\xE7\xB4\xBD", + "\xD6\xE4" => "\xE7\xB4\xB8", + "\xD6\xE5" => "\xE7\xB4\xB6", + "\xD6\xE6" => "\xE7\xB4\xBA", + "\xD6\xE7" => "\xE7\xB5\x85", + "\xD6\xE8" => "\xE7\xB4\xAC", + "\xD6\xE9" => "\xE7\xB4\xA9", + "\xD6\xEA" => "\xE7\xB5\x81", + "\xD6\xEB" => "\xE7\xB5\x87", + "\xD6\xEC" => "\xE7\xB4\xBE", + "\xD6\xED" => "\xE7\xB4\xBF", + "\xD6\xEE" => "\xE7\xB5\x8A", + "\xD6\xEF" => "\xE7\xB4\xBB", + "\xD6\xF0" => "\xE7\xB4\xA8", + "\xD6\xF1" => "\xE7\xBD\xA3", + "\xD6\xF2" => "\xE7\xBE\x95", + "\xD6\xF3" => "\xE7\xBE\x9C", + "\xD6\xF4" => "\xE7\xBE\x9D", + "\xD6\xF5" => "\xE7\xBE\x9B", + "\xD6\xF6" => "\xE7\xBF\x8A", + "\xD6\xF7" => "\xE7\xBF\x8B", + "\xD6\xF8" => "\xE7\xBF\x8D", + "\xD6\xF9" => "\xE7\xBF\x90", + "\xD6\xFA" => "\xE7\xBF\x91", + "\xD6\xFB" => "\xE7\xBF\x87", + "\xD6\xFC" => "\xE7\xBF\x8F", + "\xD6\xFD" => "\xE7\xBF\x89", + "\xD6\xFE" => "\xE8\x80\x9F", + "\xD7\x40" => "\xE8\x80\x9E", + "\xD7\x41" => "\xE8\x80\x9B", + "\xD7\x42" => "\xE8\x81\x87", + "\xD7\x43" => "\xE8\x81\x83", + "\xD7\x44" => "\xE8\x81\x88", + "\xD7\x45" => "\xE8\x84\x98", + "\xD7\x46" => "\xE8\x84\xA5", + "\xD7\x47" => "\xE8\x84\x99", + "\xD7\x48" => "\xE8\x84\x9B", + "\xD7\x49" => "\xE8\x84\xAD", + "\xD7\x4A" => "\xE8\x84\x9F", + "\xD7\x4B" => "\xE8\x84\xAC", + "\xD7\x4C" => "\xE8\x84\x9E", + "\xD7\x4D" => "\xE8\x84\xA1", + "\xD7\x4E" => "\xE8\x84\x95", + "\xD7\x4F" => "\xE8\x84\xA7", + "\xD7\x50" => "\xE8\x84\x9D", + "\xD7\x51" => "\xE8\x84\xA2", + "\xD7\x52" => "\xE8\x88\x91", + "\xD7\x53" => "\xE8\x88\xB8", + "\xD7\x54" => "\xE8\x88\xB3", + "\xD7\x55" => "\xE8\x88\xBA", + "\xD7\x56" => "\xE8\x88\xB4", + "\xD7\x57" => "\xE8\x88\xB2", + "\xD7\x58" => "\xE8\x89\xB4", + "\xD7\x59" => "\xE8\x8E\x90", + "\xD7\x5A" => "\xE8\x8E\xA3", + "\xD7\x5B" => "\xE8\x8E\xA8", + "\xD7\x5C" => "\xE8\x8E\x8D", + "\xD7\x5D" => "\xE8\x8D\xBA", + "\xD7\x5E" => "\xE8\x8D\xB3", + "\xD7\x5F" => "\xE8\x8E\xA4", + "\xD7\x60" => "\xE8\x8D\xB4", + "\xD7\x61" => "\xE8\x8E\x8F", + "\xD7\x62" => "\xE8\x8E\x81", + "\xD7\x63" => "\xE8\x8E\x95", + "\xD7\x64" => "\xE8\x8E\x99", + "\xD7\x65" => "\xE8\x8D\xB5", + "\xD7\x66" => "\xE8\x8E\x94", + "\xD7\x67" => "\xE8\x8E\xA9", + "\xD7\x68" => "\xE8\x8D\xBD", + "\xD7\x69" => "\xE8\x8E\x83", + "\xD7\x6A" => "\xE8\x8E\x8C", + "\xD7\x6B" => "\xE8\x8E\x9D", + "\xD7\x6C" => "\xE8\x8E\x9B", + "\xD7\x6D" => "\xE8\x8E\xAA", + "\xD7\x6E" => "\xE8\x8E\x8B", + "\xD7\x6F" => "\xE8\x8D\xBE", + "\xD7\x70" => "\xE8\x8E\xA5", + "\xD7\x71" => "\xE8\x8E\xAF", + "\xD7\x72" => "\xE8\x8E\x88", + "\xD7\x73" => "\xE8\x8E\x97", + "\xD7\x74" => "\xE8\x8E\xB0", + "\xD7\x75" => "\xE8\x8D\xBF", + "\xD7\x76" => "\xE8\x8E\xA6", + "\xD7\x77" => "\xE8\x8E\x87", + "\xD7\x78" => "\xE8\x8E\xAE", + "\xD7\x79" => "\xE8\x8D\xB6", + "\xD7\x7A" => "\xE8\x8E\x9A", + "\xD7\x7B" => "\xE8\x99\x99", + "\xD7\x7C" => "\xE8\x99\x96", + "\xD7\x7D" => "\xE8\x9A\xBF", + "\xD7\x7E" => "\xE8\x9A\xB7", + "\xD7\xA1" => "\xE8\x9B\x82", + "\xD7\xA2" => "\xE8\x9B\x81", + "\xD7\xA3" => "\xE8\x9B\x85", + "\xD7\xA4" => "\xE8\x9A\xBA", + "\xD7\xA5" => "\xE8\x9A\xB0", + "\xD7\xA6" => "\xE8\x9B\x88", + "\xD7\xA7" => "\xE8\x9A\xB9", + "\xD7\xA8" => "\xE8\x9A\xB3", + "\xD7\xA9" => "\xE8\x9A\xB8", + "\xD7\xAA" => "\xE8\x9B\x8C", + "\xD7\xAB" => "\xE8\x9A\xB4", + "\xD7\xAC" => "\xE8\x9A\xBB", + "\xD7\xAD" => "\xE8\x9A\xBC", + "\xD7\xAE" => "\xE8\x9B\x83", + "\xD7\xAF" => "\xE8\x9A\xBD", + "\xD7\xB0" => "\xE8\x9A\xBE", + "\xD7\xB1" => "\xE8\xA1\x92", + "\xD7\xB2" => "\xE8\xA2\x89", + "\xD7\xB3" => "\xE8\xA2\x95", + "\xD7\xB4" => "\xE8\xA2\xA8", + "\xD7\xB5" => "\xE8\xA2\xA2", + "\xD7\xB6" => "\xE8\xA2\xAA", + "\xD7\xB7" => "\xE8\xA2\x9A", + "\xD7\xB8" => "\xE8\xA2\x91", + "\xD7\xB9" => "\xE8\xA2\xA1", + "\xD7\xBA" => "\xE8\xA2\x9F", + "\xD7\xBB" => "\xE8\xA2\x98", + "\xD7\xBC" => "\xE8\xA2\xA7", + "\xD7\xBD" => "\xE8\xA2\x99", + "\xD7\xBE" => "\xE8\xA2\x9B", + "\xD7\xBF" => "\xE8\xA2\x97", + "\xD7\xC0" => "\xE8\xA2\xA4", + "\xD7\xC1" => "\xE8\xA2\xAC", + "\xD7\xC2" => "\xE8\xA2\x8C", + "\xD7\xC3" => "\xE8\xA2\x93", + "\xD7\xC4" => "\xE8\xA2\x8E", + "\xD7\xC5" => "\xE8\xA6\x82", + "\xD7\xC6" => "\xE8\xA7\x96", + "\xD7\xC7" => "\xE8\xA7\x99", + "\xD7\xC8" => "\xE8\xA7\x95", + "\xD7\xC9" => "\xE8\xA8\xB0", + "\xD7\xCA" => "\xE8\xA8\xA7", + "\xD7\xCB" => "\xE8\xA8\xAC", + "\xD7\xCC" => "\xE8\xA8\x9E", + "\xD7\xCD" => "\xE8\xB0\xB9", + "\xD7\xCE" => "\xE8\xB0\xBB", + "\xD7\xCF" => "\xE8\xB1\x9C", + "\xD7\xD0" => "\xE8\xB1\x9D", + "\xD7\xD1" => "\xE8\xB1\xBD", + "\xD7\xD2" => "\xE8\xB2\xA5", + "\xD7\xD3" => "\xE8\xB5\xBD", + "\xD7\xD4" => "\xE8\xB5\xBB", + "\xD7\xD5" => "\xE8\xB5\xB9", + "\xD7\xD6" => "\xE8\xB6\xBC", + "\xD7\xD7" => "\xE8\xB7\x82", + "\xD7\xD8" => "\xE8\xB6\xB9", + "\xD7\xD9" => "\xE8\xB6\xBF", + "\xD7\xDA" => "\xE8\xB7\x81", + "\xD7\xDB" => "\xE8\xBB\x98", + "\xD7\xDC" => "\xE8\xBB\x9E", + "\xD7\xDD" => "\xE8\xBB\x9D", + "\xD7\xDE" => "\xE8\xBB\x9C", + "\xD7\xDF" => "\xE8\xBB\x97", + "\xD7\xE0" => "\xE8\xBB\xA0", + "\xD7\xE1" => "\xE8\xBB\xA1", + "\xD7\xE2" => "\xE9\x80\xA4", + "\xD7\xE3" => "\xE9\x80\x8B", + "\xD7\xE4" => "\xE9\x80\x91", + "\xD7\xE5" => "\xE9\x80\x9C", + "\xD7\xE6" => "\xE9\x80\x8C", + "\xD7\xE7" => "\xE9\x80\xA1", + "\xD7\xE8" => "\xE9\x83\xAF", + "\xD7\xE9" => "\xE9\x83\xAA", + "\xD7\xEA" => "\xE9\x83\xB0", + "\xD7\xEB" => "\xE9\x83\xB4", + "\xD7\xEC" => "\xE9\x83\xB2", + "\xD7\xED" => "\xE9\x83\xB3", + "\xD7\xEE" => "\xE9\x83\x94", + "\xD7\xEF" => "\xE9\x83\xAB", + "\xD7\xF0" => "\xE9\x83\xAC", + "\xD7\xF1" => "\xE9\x83\xA9", + "\xD7\xF2" => "\xE9\x85\x96", + "\xD7\xF3" => "\xE9\x85\x98", + "\xD7\xF4" => "\xE9\x85\x9A", + "\xD7\xF5" => "\xE9\x85\x93", + "\xD7\xF6" => "\xE9\x85\x95", + "\xD7\xF7" => "\xE9\x87\xAC", + "\xD7\xF8" => "\xE9\x87\xB4", + "\xD7\xF9" => "\xE9\x87\xB1", + "\xD7\xFA" => "\xE9\x87\xB3", + "\xD7\xFB" => "\xE9\x87\xB8", + "\xD7\xFC" => "\xE9\x87\xA4", + "\xD7\xFD" => "\xE9\x87\xB9", + "\xD7\xFE" => "\xE9\x87\xAA", + "\xD8\x40" => "\xE9\x87\xAB", + "\xD8\x41" => "\xE9\x87\xB7", + "\xD8\x42" => "\xE9\x87\xA8", + "\xD8\x43" => "\xE9\x87\xAE", + "\xD8\x44" => "\xE9\x95\xBA", + "\xD8\x45" => "\xE9\x96\x86", + "\xD8\x46" => "\xE9\x96\x88", + "\xD8\x47" => "\xE9\x99\xBC", + "\xD8\x48" => "\xE9\x99\xAD", + "\xD8\x49" => "\xE9\x99\xAB", + "\xD8\x4A" => "\xE9\x99\xB1", + "\xD8\x4B" => "\xE9\x99\xAF", + "\xD8\x4C" => "\xE9\x9A\xBF", + "\xD8\x4D" => "\xE9\x9D\xAA", + "\xD8\x4E" => "\xE9\xA0\x84", + "\xD8\x4F" => "\xE9\xA3\xA5", + "\xD8\x50" => "\xE9\xA6\x97", + "\xD8\x51" => "\xE5\x82\x9B", + "\xD8\x52" => "\xE5\x82\x95", + "\xD8\x53" => "\xE5\x82\x94", + "\xD8\x54" => "\xE5\x82\x9E", + "\xD8\x55" => "\xE5\x82\x8B", + "\xD8\x56" => "\xE5\x82\xA3", + "\xD8\x57" => "\xE5\x82\x83", + "\xD8\x58" => "\xE5\x82\x8C", + "\xD8\x59" => "\xE5\x82\x8E", + "\xD8\x5A" => "\xE5\x82\x9D", + "\xD8\x5B" => "\xE5\x81\xA8", + "\xD8\x5C" => "\xE5\x82\x9C", + "\xD8\x5D" => "\xE5\x82\x92", + "\xD8\x5E" => "\xE5\x82\x82", + "\xD8\x5F" => "\xE5\x82\x87", + "\xD8\x60" => "\xE5\x85\x9F", + "\xD8\x61" => "\xE5\x87\x94", + "\xD8\x62" => "\xE5\x8C\x92", + "\xD8\x63" => "\xE5\x8C\x91", + "\xD8\x64" => "\xE5\x8E\xA4", + "\xD8\x65" => "\xE5\x8E\xA7", + "\xD8\x66" => "\xE5\x96\x91", + "\xD8\x67" => "\xE5\x96\xA8", + "\xD8\x68" => "\xE5\x96\xA5", + "\xD8\x69" => "\xE5\x96\xAD", + "\xD8\x6A" => "\xE5\x95\xB7", + "\xD8\x6B" => "\xE5\x99\x85", + "\xD8\x6C" => "\xE5\x96\xA2", + "\xD8\x6D" => "\xE5\x96\x93", + "\xD8\x6E" => "\xE5\x96\x88", + "\xD8\x6F" => "\xE5\x96\x8F", + "\xD8\x70" => "\xE5\x96\xB5", + "\xD8\x71" => "\xE5\x96\x81", + "\xD8\x72" => "\xE5\x96\xA3", + "\xD8\x73" => "\xE5\x96\x92", + "\xD8\x74" => "\xE5\x96\xA4", + "\xD8\x75" => "\xE5\x95\xBD", + "\xD8\x76" => "\xE5\x96\x8C", + "\xD8\x77" => "\xE5\x96\xA6", + "\xD8\x78" => "\xE5\x95\xBF", + "\xD8\x79" => "\xE5\x96\x95", + "\xD8\x7A" => "\xE5\x96\xA1", + "\xD8\x7B" => "\xE5\x96\x8E", + "\xD8\x7C" => "\xE5\x9C\x8C", + "\xD8\x7D" => "\xE5\xA0\xA9", + "\xD8\x7E" => "\xE5\xA0\xB7", + "\xD8\xA1" => "\xE5\xA0\x99", + "\xD8\xA2" => "\xE5\xA0\x9E", + "\xD8\xA3" => "\xE5\xA0\xA7", + "\xD8\xA4" => "\xE5\xA0\xA3", + "\xD8\xA5" => "\xE5\xA0\xA8", + "\xD8\xA6" => "\xE5\x9F\xB5", + "\xD8\xA7" => "\xE5\xA1\x88", + "\xD8\xA8" => "\xE5\xA0\xA5", + "\xD8\xA9" => "\xE5\xA0\x9C", + "\xD8\xAA" => "\xE5\xA0\x9B", + "\xD8\xAB" => "\xE5\xA0\xB3", + "\xD8\xAC" => "\xE5\xA0\xBF", + "\xD8\xAD" => "\xE5\xA0\xB6", + "\xD8\xAE" => "\xE5\xA0\xAE", + "\xD8\xAF" => "\xE5\xA0\xB9", + "\xD8\xB0" => "\xE5\xA0\xB8", + "\xD8\xB1" => "\xE5\xA0\xAD", + "\xD8\xB2" => "\xE5\xA0\xAC", + "\xD8\xB3" => "\xE5\xA0\xBB", + "\xD8\xB4" => "\xE5\xA5\xA1", + "\xD8\xB5" => "\xE5\xAA\xAF", + "\xD8\xB6" => "\xE5\xAA\x94", + "\xD8\xB7" => "\xE5\xAA\x9F", + "\xD8\xB8" => "\xE5\xA9\xBA", + "\xD8\xB9" => "\xE5\xAA\xA2", + "\xD8\xBA" => "\xE5\xAA\x9E", + "\xD8\xBB" => "\xE5\xA9\xB8", + "\xD8\xBC" => "\xE5\xAA\xA6", + "\xD8\xBD" => "\xE5\xA9\xBC", + "\xD8\xBE" => "\xE5\xAA\xA5", + "\xD8\xBF" => "\xE5\xAA\xAC", + "\xD8\xC0" => "\xE5\xAA\x95", + "\xD8\xC1" => "\xE5\xAA\xAE", + "\xD8\xC2" => "\xE5\xA8\xB7", + "\xD8\xC3" => "\xE5\xAA\x84", + "\xD8\xC4" => "\xE5\xAA\x8A", + "\xD8\xC5" => "\xE5\xAA\x97", + "\xD8\xC6" => "\xE5\xAA\x83", + "\xD8\xC7" => "\xE5\xAA\x8B", + "\xD8\xC8" => "\xE5\xAA\xA9", + "\xD8\xC9" => "\xE5\xA9\xBB", + "\xD8\xCA" => "\xE5\xA9\xBD", + "\xD8\xCB" => "\xE5\xAA\x8C", + "\xD8\xCC" => "\xE5\xAA\x9C", + "\xD8\xCD" => "\xE5\xAA\x8F", + "\xD8\xCE" => "\xE5\xAA\x93", + "\xD8\xCF" => "\xE5\xAA\x9D", + "\xD8\xD0" => "\xE5\xAF\xAA", + "\xD8\xD1" => "\xE5\xAF\x8D", + "\xD8\xD2" => "\xE5\xAF\x8B", + "\xD8\xD3" => "\xE5\xAF\x94", + "\xD8\xD4" => "\xE5\xAF\x91", + "\xD8\xD5" => "\xE5\xAF\x8A", + "\xD8\xD6" => "\xE5\xAF\x8E", + "\xD8\xD7" => "\xE5\xB0\x8C", + "\xD8\xD8" => "\xE5\xB0\xB0", + "\xD8\xD9" => "\xE5\xB4\xB7", + "\xD8\xDA" => "\xE5\xB5\x83", + "\xD8\xDB" => "\xE5\xB5\xAB", + "\xD8\xDC" => "\xE5\xB5\x81", + "\xD8\xDD" => "\xE5\xB5\x8B", + "\xD8\xDE" => "\xE5\xB4\xBF", + "\xD8\xDF" => "\xE5\xB4\xB5", + "\xD8\xE0" => "\xE5\xB5\x91", + "\xD8\xE1" => "\xE5\xB5\x8E", + "\xD8\xE2" => "\xE5\xB5\x95", + "\xD8\xE3" => "\xE5\xB4\xB3", + "\xD8\xE4" => "\xE5\xB4\xBA", + "\xD8\xE5" => "\xE5\xB5\x92", + "\xD8\xE6" => "\xE5\xB4\xBD", + "\xD8\xE7" => "\xE5\xB4\xB1", + "\xD8\xE8" => "\xE5\xB5\x99", + "\xD8\xE9" => "\xE5\xB5\x82", + "\xD8\xEA" => "\xE5\xB4\xB9", + "\xD8\xEB" => "\xE5\xB5\x89", + "\xD8\xEC" => "\xE5\xB4\xB8", + "\xD8\xED" => "\xE5\xB4\xBC", + "\xD8\xEE" => "\xE5\xB4\xB2", + "\xD8\xEF" => "\xE5\xB4\xB6", + "\xD8\xF0" => "\xE5\xB5\x80", + "\xD8\xF1" => "\xE5\xB5\x85", + "\xD8\xF2" => "\xE5\xB9\x84", + "\xD8\xF3" => "\xE5\xB9\x81", + "\xD8\xF4" => "\xE5\xBD\x98", + "\xD8\xF5" => "\xE5\xBE\xA6", + "\xD8\xF6" => "\xE5\xBE\xA5", + "\xD8\xF7" => "\xE5\xBE\xAB", + "\xD8\xF8" => "\xE6\x83\x89", + "\xD8\xF9" => "\xE6\x82\xB9", + "\xD8\xFA" => "\xE6\x83\x8C", + "\xD8\xFB" => "\xE6\x83\xA2", + "\xD8\xFC" => "\xE6\x83\x8E", + "\xD8\xFD" => "\xE6\x83\x84", + "\xD8\xFE" => "\xE6\x84\x94", + "\xD9\x40" => "\xE6\x83\xB2", + "\xD9\x41" => "\xE6\x84\x8A", + "\xD9\x42" => "\xE6\x84\x96", + "\xD9\x43" => "\xE6\x84\x85", + "\xD9\x44" => "\xE6\x83\xB5", + "\xD9\x45" => "\xE6\x84\x93", + "\xD9\x46" => "\xE6\x83\xB8", + "\xD9\x47" => "\xE6\x83\xBC", + "\xD9\x48" => "\xE6\x83\xBE", + "\xD9\x49" => "\xE6\x83\x81", + "\xD9\x4A" => "\xE6\x84\x83", + "\xD9\x4B" => "\xE6\x84\x98", + "\xD9\x4C" => "\xE6\x84\x9D", + "\xD9\x4D" => "\xE6\x84\x90", + "\xD9\x4E" => "\xE6\x83\xBF", + "\xD9\x4F" => "\xE6\x84\x84", + "\xD9\x50" => "\xE6\x84\x8B", + "\xD9\x51" => "\xE6\x89\x8A", + "\xD9\x52" => "\xE6\x8E\x94", + "\xD9\x53" => "\xE6\x8E\xB1", + "\xD9\x54" => "\xE6\x8E\xB0", + "\xD9\x55" => "\xE6\x8F\x8E", + "\xD9\x56" => "\xE6\x8F\xA5", + "\xD9\x57" => "\xE6\x8F\xA8", + "\xD9\x58" => "\xE6\x8F\xAF", + "\xD9\x59" => "\xE6\x8F\x83", + "\xD9\x5A" => "\xE6\x92\x9D", + "\xD9\x5B" => "\xE6\x8F\xB3", + "\xD9\x5C" => "\xE6\x8F\x8A", + "\xD9\x5D" => "\xE6\x8F\xA0", + "\xD9\x5E" => "\xE6\x8F\xB6", + "\xD9\x5F" => "\xE6\x8F\x95", + "\xD9\x60" => "\xE6\x8F\xB2", + "\xD9\x61" => "\xE6\x8F\xB5", + "\xD9\x62" => "\xE6\x91\xA1", + "\xD9\x63" => "\xE6\x8F\x9F", + "\xD9\x64" => "\xE6\x8E\xBE", + "\xD9\x65" => "\xE6\x8F\x9D", + "\xD9\x66" => "\xE6\x8F\x9C", + "\xD9\x67" => "\xE6\x8F\x84", + "\xD9\x68" => "\xE6\x8F\x98", + "\xD9\x69" => "\xE6\x8F\x93", + "\xD9\x6A" => "\xE6\x8F\x82", + "\xD9\x6B" => "\xE6\x8F\x87", + "\xD9\x6C" => "\xE6\x8F\x8C", + "\xD9\x6D" => "\xE6\x8F\x8B", + "\xD9\x6E" => "\xE6\x8F\x88", + "\xD9\x6F" => "\xE6\x8F\xB0", + "\xD9\x70" => "\xE6\x8F\x97", + "\xD9\x71" => "\xE6\x8F\x99", + "\xD9\x72" => "\xE6\x94\xB2", + "\xD9\x73" => "\xE6\x95\xA7", + "\xD9\x74" => "\xE6\x95\xAA", + "\xD9\x75" => "\xE6\x95\xA4", + "\xD9\x76" => "\xE6\x95\x9C", + "\xD9\x77" => "\xE6\x95\xA8", + "\xD9\x78" => "\xE6\x95\xA5", + "\xD9\x79" => "\xE6\x96\x8C", + "\xD9\x7A" => "\xE6\x96\x9D", + "\xD9\x7B" => "\xE6\x96\x9E", + "\xD9\x7C" => "\xE6\x96\xAE", + "\xD9\x7D" => "\xE6\x97\x90", + "\xD9\x7E" => "\xE6\x97\x92", + "\xD9\xA1" => "\xE6\x99\xBC", + "\xD9\xA2" => "\xE6\x99\xAC", + "\xD9\xA3" => "\xE6\x99\xBB", + "\xD9\xA4" => "\xE6\x9A\x80", + "\xD9\xA5" => "\xE6\x99\xB1", + "\xD9\xA6" => "\xE6\x99\xB9", + "\xD9\xA7" => "\xE6\x99\xAA", + "\xD9\xA8" => "\xE6\x99\xB2", + "\xD9\xA9" => "\xE6\x9C\x81", + "\xD9\xAA" => "\xE6\xA4\x8C", + "\xD9\xAB" => "\xE6\xA3\x93", + "\xD9\xAC" => "\xE6\xA4\x84", + "\xD9\xAD" => "\xE6\xA3\x9C", + "\xD9\xAE" => "\xE6\xA4\xAA", + "\xD9\xAF" => "\xE6\xA3\xAC", + "\xD9\xB0" => "\xE6\xA3\xAA", + "\xD9\xB1" => "\xE6\xA3\xB1", + "\xD9\xB2" => "\xE6\xA4\x8F", + "\xD9\xB3" => "\xE6\xA3\x96", + "\xD9\xB4" => "\xE6\xA3\xB7", + "\xD9\xB5" => "\xE6\xA3\xAB", + "\xD9\xB6" => "\xE6\xA3\xA4", + "\xD9\xB7" => "\xE6\xA3\xB6", + "\xD9\xB8" => "\xE6\xA4\x93", + "\xD9\xB9" => "\xE6\xA4\x90", + "\xD9\xBA" => "\xE6\xA3\xB3", + "\xD9\xBB" => "\xE6\xA3\xA1", + "\xD9\xBC" => "\xE6\xA4\x87", + "\xD9\xBD" => "\xE6\xA3\x8C", + "\xD9\xBE" => "\xE6\xA4\x88", + "\xD9\xBF" => "\xE6\xA5\xB0", + "\xD9\xC0" => "\xE6\xA2\xB4", + "\xD9\xC1" => "\xE6\xA4\x91", + "\xD9\xC2" => "\xE6\xA3\xAF", + "\xD9\xC3" => "\xE6\xA3\x86", + "\xD9\xC4" => "\xE6\xA4\x94", + "\xD9\xC5" => "\xE6\xA3\xB8", + "\xD9\xC6" => "\xE6\xA3\x90", + "\xD9\xC7" => "\xE6\xA3\xBD", + "\xD9\xC8" => "\xE6\xA3\xBC", + "\xD9\xC9" => "\xE6\xA3\xA8", + "\xD9\xCA" => "\xE6\xA4\x8B", + "\xD9\xCB" => "\xE6\xA4\x8A", + "\xD9\xCC" => "\xE6\xA4\x97", + "\xD9\xCD" => "\xE6\xA3\x8E", + "\xD9\xCE" => "\xE6\xA3\x88", + "\xD9\xCF" => "\xE6\xA3\x9D", + "\xD9\xD0" => "\xE6\xA3\x9E", + "\xD9\xD1" => "\xE6\xA3\xA6", + "\xD9\xD2" => "\xE6\xA3\xB4", + "\xD9\xD3" => "\xE6\xA3\x91", + "\xD9\xD4" => "\xE6\xA4\x86", + "\xD9\xD5" => "\xE6\xA3\x94", + "\xD9\xD6" => "\xE6\xA3\xA9", + "\xD9\xD7" => "\xE6\xA4\x95", + "\xD9\xD8" => "\xE6\xA4\xA5", + "\xD9\xD9" => "\xE6\xA3\x87", + "\xD9\xDA" => "\xE6\xAC\xB9", + "\xD9\xDB" => "\xE6\xAC\xBB", + "\xD9\xDC" => "\xE6\xAC\xBF", + "\xD9\xDD" => "\xE6\xAC\xBC", + "\xD9\xDE" => "\xE6\xAE\x94", + "\xD9\xDF" => "\xE6\xAE\x97", + "\xD9\xE0" => "\xE6\xAE\x99", + "\xD9\xE1" => "\xE6\xAE\x95", + "\xD9\xE2" => "\xE6\xAE\xBD", + "\xD9\xE3" => "\xE6\xAF\xB0", + "\xD9\xE4" => "\xE6\xAF\xB2", + "\xD9\xE5" => "\xE6\xAF\xB3", + "\xD9\xE6" => "\xE6\xB0\xB0", + "\xD9\xE7" => "\xE6\xB7\xBC", + "\xD9\xE8" => "\xE6\xB9\x86", + "\xD9\xE9" => "\xE6\xB9\x87", + "\xD9\xEA" => "\xE6\xB8\x9F", + "\xD9\xEB" => "\xE6\xB9\x89", + "\xD9\xEC" => "\xE6\xBA\x88", + "\xD9\xED" => "\xE6\xB8\xBC", + "\xD9\xEE" => "\xE6\xB8\xBD", + "\xD9\xEF" => "\xE6\xB9\x85", + "\xD9\xF0" => "\xE6\xB9\xA2", + "\xD9\xF1" => "\xE6\xB8\xAB", + "\xD9\xF2" => "\xE6\xB8\xBF", + "\xD9\xF3" => "\xE6\xB9\x81", + "\xD9\xF4" => "\xE6\xB9\x9D", + "\xD9\xF5" => "\xE6\xB9\xB3", + "\xD9\xF6" => "\xE6\xB8\x9C", + "\xD9\xF7" => "\xE6\xB8\xB3", + "\xD9\xF8" => "\xE6\xB9\x8B", + "\xD9\xF9" => "\xE6\xB9\x80", + "\xD9\xFA" => "\xE6\xB9\x91", + "\xD9\xFB" => "\xE6\xB8\xBB", + "\xD9\xFC" => "\xE6\xB8\x83", + "\xD9\xFD" => "\xE6\xB8\xAE", + "\xD9\xFE" => "\xE6\xB9\x9E", + "\xDA\x40" => "\xE6\xB9\xA8", + "\xDA\x41" => "\xE6\xB9\x9C", + "\xDA\x42" => "\xE6\xB9\xA1", + "\xDA\x43" => "\xE6\xB8\xB1", + "\xDA\x44" => "\xE6\xB8\xA8", + "\xDA\x45" => "\xE6\xB9\xA0", + "\xDA\x46" => "\xE6\xB9\xB1", + "\xDA\x47" => "\xE6\xB9\xAB", + "\xDA\x48" => "\xE6\xB8\xB9", + "\xDA\x49" => "\xE6\xB8\xA2", + "\xDA\x4A" => "\xE6\xB8\xB0", + "\xDA\x4B" => "\xE6\xB9\x93", + "\xDA\x4C" => "\xE6\xB9\xA5", + "\xDA\x4D" => "\xE6\xB8\xA7", + "\xDA\x4E" => "\xE6\xB9\xB8", + "\xDA\x4F" => "\xE6\xB9\xA4", + "\xDA\x50" => "\xE6\xB9\xB7", + "\xDA\x51" => "\xE6\xB9\x95", + "\xDA\x52" => "\xE6\xB9\xB9", + "\xDA\x53" => "\xE6\xB9\x92", + "\xDA\x54" => "\xE6\xB9\xA6", + "\xDA\x55" => "\xE6\xB8\xB5", + "\xDA\x56" => "\xE6\xB8\xB6", + "\xDA\x57" => "\xE6\xB9\x9A", + "\xDA\x58" => "\xE7\x84\xA0", + "\xDA\x59" => "\xE7\x84\x9E", + "\xDA\x5A" => "\xE7\x84\xAF", + "\xDA\x5B" => "\xE7\x83\xBB", + "\xDA\x5C" => "\xE7\x84\xAE", + "\xDA\x5D" => "\xE7\x84\xB1", + "\xDA\x5E" => "\xE7\x84\xA3", + "\xDA\x5F" => "\xE7\x84\xA5", + "\xDA\x60" => "\xE7\x84\xA2", + "\xDA\x61" => "\xE7\x84\xB2", + "\xDA\x62" => "\xE7\x84\x9F", + "\xDA\x63" => "\xE7\x84\xA8", + "\xDA\x64" => "\xE7\x84\xBA", + "\xDA\x65" => "\xE7\x84\x9B", + "\xDA\x66" => "\xE7\x89\x8B", + "\xDA\x67" => "\xE7\x89\x9A", + "\xDA\x68" => "\xE7\x8A\x88", + "\xDA\x69" => "\xE7\x8A\x89", + "\xDA\x6A" => "\xE7\x8A\x86", + "\xDA\x6B" => "\xE7\x8A\x85", + "\xDA\x6C" => "\xE7\x8A\x8B", + "\xDA\x6D" => "\xE7\x8C\x92", + "\xDA\x6E" => "\xE7\x8C\x8B", + "\xDA\x6F" => "\xE7\x8C\xB0", + "\xDA\x70" => "\xE7\x8C\xA2", + "\xDA\x71" => "\xE7\x8C\xB1", + "\xDA\x72" => "\xE7\x8C\xB3", + "\xDA\x73" => "\xE7\x8C\xA7", + "\xDA\x74" => "\xE7\x8C\xB2", + "\xDA\x75" => "\xE7\x8C\xAD", + "\xDA\x76" => "\xE7\x8C\xA6", + "\xDA\x77" => "\xE7\x8C\xA3", + "\xDA\x78" => "\xE7\x8C\xB5", + "\xDA\x79" => "\xE7\x8C\x8C", + "\xDA\x7A" => "\xE7\x90\xAE", + "\xDA\x7B" => "\xE7\x90\xAC", + "\xDA\x7C" => "\xE7\x90\xB0", + "\xDA\x7D" => "\xE7\x90\xAB", + "\xDA\x7E" => "\xE7\x90\x96", + "\xDA\xA1" => "\xE7\x90\x9A", + "\xDA\xA2" => "\xE7\x90\xA1", + "\xDA\xA3" => "\xE7\x90\xAD", + "\xDA\xA4" => "\xE7\x90\xB1", + "\xDA\xA5" => "\xE7\x90\xA4", + "\xDA\xA6" => "\xE7\x90\xA3", + "\xDA\xA7" => "\xE7\x90\x9D", + "\xDA\xA8" => "\xE7\x90\xA9", + "\xDA\xA9" => "\xE7\x90\xA0", + "\xDA\xAA" => "\xE7\x90\xB2", + "\xDA\xAB" => "\xE7\x93\xBB", + "\xDA\xAC" => "\xE7\x94\xAF", + "\xDA\xAD" => "\xE7\x95\xAF", + "\xDA\xAE" => "\xE7\x95\xAC", + "\xDA\xAF" => "\xE7\x97\xA7", + "\xDA\xB0" => "\xE7\x97\x9A", + "\xDA\xB1" => "\xE7\x97\xA1", + "\xDA\xB2" => "\xE7\x97\xA6", + "\xDA\xB3" => "\xE7\x97\x9D", + "\xDA\xB4" => "\xE7\x97\x9F", + "\xDA\xB5" => "\xE7\x97\xA4", + "\xDA\xB6" => "\xE7\x97\x97", + "\xDA\xB7" => "\xE7\x9A\x95", + "\xDA\xB8" => "\xE7\x9A\x92", + "\xDA\xB9" => "\xE7\x9B\x9A", + "\xDA\xBA" => "\xE7\x9D\x86", + "\xDA\xBB" => "\xE7\x9D\x87", + "\xDA\xBC" => "\xE7\x9D\x84", + "\xDA\xBD" => "\xE7\x9D\x8D", + "\xDA\xBE" => "\xE7\x9D\x85", + "\xDA\xBF" => "\xE7\x9D\x8A", + "\xDA\xC0" => "\xE7\x9D\x8E", + "\xDA\xC1" => "\xE7\x9D\x8B", + "\xDA\xC2" => "\xE7\x9D\x8C", + "\xDA\xC3" => "\xE7\x9F\x9E", + "\xDA\xC4" => "\xE7\x9F\xAC", + "\xDA\xC5" => "\xE7\xA1\xA0", + "\xDA\xC6" => "\xE7\xA1\xA4", + "\xDA\xC7" => "\xE7\xA1\xA5", + "\xDA\xC8" => "\xE7\xA1\x9C", + "\xDA\xC9" => "\xE7\xA1\xAD", + "\xDA\xCA" => "\xE7\xA1\xB1", + "\xDA\xCB" => "\xE7\xA1\xAA", + "\xDA\xCC" => "\xE7\xA1\xAE", + "\xDA\xCD" => "\xE7\xA1\xB0", + "\xDA\xCE" => "\xE7\xA1\xA9", + "\xDA\xCF" => "\xE7\xA1\xA8", + "\xDA\xD0" => "\xE7\xA1\x9E", + "\xDA\xD1" => "\xE7\xA1\xA2", + "\xDA\xD2" => "\xE7\xA5\xB4", + "\xDA\xD3" => "\xE7\xA5\xB3", + "\xDA\xD4" => "\xE7\xA5\xB2", + "\xDA\xD5" => "\xE7\xA5\xB0", + "\xDA\xD6" => "\xE7\xA8\x82", + "\xDA\xD7" => "\xE7\xA8\x8A", + "\xDA\xD8" => "\xE7\xA8\x83", + "\xDA\xD9" => "\xE7\xA8\x8C", + "\xDA\xDA" => "\xE7\xA8\x84", + "\xDA\xDB" => "\xE7\xAA\x99", + "\xDA\xDC" => "\xE7\xAB\xA6", + "\xDA\xDD" => "\xE7\xAB\xA4", + "\xDA\xDE" => "\xE7\xAD\x8A", + "\xDA\xDF" => "\xE7\xAC\xBB", + "\xDA\xE0" => "\xE7\xAD\x84", + "\xDA\xE1" => "\xE7\xAD\x88", + "\xDA\xE2" => "\xE7\xAD\x8C", + "\xDA\xE3" => "\xE7\xAD\x8E", + "\xDA\xE4" => "\xE7\xAD\x80", + "\xDA\xE5" => "\xE7\xAD\x98", + "\xDA\xE6" => "\xE7\xAD\x85", + "\xDA\xE7" => "\xE7\xB2\xA2", + "\xDA\xE8" => "\xE7\xB2\x9E", + "\xDA\xE9" => "\xE7\xB2\xA8", + "\xDA\xEA" => "\xE7\xB2\xA1", + "\xDA\xEB" => "\xE7\xB5\x98", + "\xDA\xEC" => "\xE7\xB5\xAF", + "\xDA\xED" => "\xE7\xB5\xA3", + "\xDA\xEE" => "\xE7\xB5\x93", + "\xDA\xEF" => "\xE7\xB5\x96", + "\xDA\xF0" => "\xE7\xB5\xA7", + "\xDA\xF1" => "\xE7\xB5\xAA", + "\xDA\xF2" => "\xE7\xB5\x8F", + "\xDA\xF3" => "\xE7\xB5\xAD", + "\xDA\xF4" => "\xE7\xB5\x9C", + "\xDA\xF5" => "\xE7\xB5\xAB", + "\xDA\xF6" => "\xE7\xB5\x92", + "\xDA\xF7" => "\xE7\xB5\x94", + "\xDA\xF8" => "\xE7\xB5\xA9", + "\xDA\xF9" => "\xE7\xB5\x91", + "\xDA\xFA" => "\xE7\xB5\x9F", + "\xDA\xFB" => "\xE7\xB5\x8E", + "\xDA\xFC" => "\xE7\xBC\xBE", + "\xDA\xFD" => "\xE7\xBC\xBF", + "\xDA\xFE" => "\xE7\xBD\xA5", + "\xDB\x40" => "\xE7\xBD\xA6", + "\xDB\x41" => "\xE7\xBE\xA2", + "\xDB\x42" => "\xE7\xBE\xA0", + "\xDB\x43" => "\xE7\xBE\xA1", + "\xDB\x44" => "\xE7\xBF\x97", + "\xDB\x45" => "\xE8\x81\x91", + "\xDB\x46" => "\xE8\x81\x8F", + "\xDB\x47" => "\xE8\x81\x90", + "\xDB\x48" => "\xE8\x83\xBE", + "\xDB\x49" => "\xE8\x83\x94", + "\xDB\x4A" => "\xE8\x85\x83", + "\xDB\x4B" => "\xE8\x85\x8A", + "\xDB\x4C" => "\xE8\x85\x92", + "\xDB\x4D" => "\xE8\x85\x8F", + "\xDB\x4E" => "\xE8\x85\x87", + "\xDB\x4F" => "\xE8\x84\xBD", + "\xDB\x50" => "\xE8\x85\x8D", + "\xDB\x51" => "\xE8\x84\xBA", + "\xDB\x52" => "\xE8\x87\xA6", + "\xDB\x53" => "\xE8\x87\xAE", + "\xDB\x54" => "\xE8\x87\xB7", + "\xDB\x55" => "\xE8\x87\xB8", + "\xDB\x56" => "\xE8\x87\xB9", + "\xDB\x57" => "\xE8\x88\x84", + "\xDB\x58" => "\xE8\x88\xBC", + "\xDB\x59" => "\xE8\x88\xBD", + "\xDB\x5A" => "\xE8\x88\xBF", + "\xDB\x5B" => "\xE8\x89\xB5", + "\xDB\x5C" => "\xE8\x8C\xBB", + "\xDB\x5D" => "\xE8\x8F\x8F", + "\xDB\x5E" => "\xE8\x8F\xB9", + "\xDB\x5F" => "\xE8\x90\xA3", + "\xDB\x60" => "\xE8\x8F\x80", + "\xDB\x61" => "\xE8\x8F\xA8", + "\xDB\x62" => "\xE8\x90\x92", + "\xDB\x63" => "\xE8\x8F\xA7", + "\xDB\x64" => "\xE8\x8F\xA4", + "\xDB\x65" => "\xE8\x8F\xBC", + "\xDB\x66" => "\xE8\x8F\xB6", + "\xDB\x67" => "\xE8\x90\x90", + "\xDB\x68" => "\xE8\x8F\x86", + "\xDB\x69" => "\xE8\x8F\x88", + "\xDB\x6A" => "\xE8\x8F\xAB", + "\xDB\x6B" => "\xE8\x8F\xA3", + "\xDB\x6C" => "\xE8\x8E\xBF", + "\xDB\x6D" => "\xE8\x90\x81", + "\xDB\x6E" => "\xE8\x8F\x9D", + "\xDB\x6F" => "\xE8\x8F\xA5", + "\xDB\x70" => "\xE8\x8F\x98", + "\xDB\x71" => "\xE8\x8F\xBF", + "\xDB\x72" => "\xE8\x8F\xA1", + "\xDB\x73" => "\xE8\x8F\x8B", + "\xDB\x74" => "\xE8\x8F\x8E", + "\xDB\x75" => "\xE8\x8F\x96", + "\xDB\x76" => "\xE8\x8F\xB5", + "\xDB\x77" => "\xE8\x8F\x89", + "\xDB\x78" => "\xE8\x90\x89", + "\xDB\x79" => "\xE8\x90\x8F", + "\xDB\x7A" => "\xE8\x8F\x9E", + "\xDB\x7B" => "\xE8\x90\x91", + "\xDB\x7C" => "\xE8\x90\x86", + "\xDB\x7D" => "\xE8\x8F\x82", + "\xDB\x7E" => "\xE8\x8F\xB3", + "\xDB\xA1" => "\xE8\x8F\x95", + "\xDB\xA2" => "\xE8\x8F\xBA", + "\xDB\xA3" => "\xE8\x8F\x87", + "\xDB\xA4" => "\xE8\x8F\x91", + "\xDB\xA5" => "\xE8\x8F\xAA", + "\xDB\xA6" => "\xE8\x90\x93", + "\xDB\xA7" => "\xE8\x8F\x83", + "\xDB\xA8" => "\xE8\x8F\xAC", + "\xDB\xA9" => "\xE8\x8F\xAE", + "\xDB\xAA" => "\xE8\x8F\x84", + "\xDB\xAB" => "\xE8\x8F\xBB", + "\xDB\xAC" => "\xE8\x8F\x97", + "\xDB\xAD" => "\xE8\x8F\xA2", + "\xDB\xAE" => "\xE8\x90\x9B", + "\xDB\xAF" => "\xE8\x8F\x9B", + "\xDB\xB0" => "\xE8\x8F\xBE", + "\xDB\xB1" => "\xE8\x9B\x98", + "\xDB\xB2" => "\xE8\x9B\xA2", + "\xDB\xB3" => "\xE8\x9B\xA6", + "\xDB\xB4" => "\xE8\x9B\x93", + "\xDB\xB5" => "\xE8\x9B\xA3", + "\xDB\xB6" => "\xE8\x9B\x9A", + "\xDB\xB7" => "\xE8\x9B\xAA", + "\xDB\xB8" => "\xE8\x9B\x9D", + "\xDB\xB9" => "\xE8\x9B\xAB", + "\xDB\xBA" => "\xE8\x9B\x9C", + "\xDB\xBB" => "\xE8\x9B\xAC", + "\xDB\xBC" => "\xE8\x9B\xA9", + "\xDB\xBD" => "\xE8\x9B\x97", + "\xDB\xBE" => "\xE8\x9B\xA8", + "\xDB\xBF" => "\xE8\x9B\x91", + "\xDB\xC0" => "\xE8\xA1\x88", + "\xDB\xC1" => "\xE8\xA1\x96", + "\xDB\xC2" => "\xE8\xA1\x95", + "\xDB\xC3" => "\xE8\xA2\xBA", + "\xDB\xC4" => "\xE8\xA3\x97", + "\xDB\xC5" => "\xE8\xA2\xB9", + "\xDB\xC6" => "\xE8\xA2\xB8", + "\xDB\xC7" => "\xE8\xA3\x80", + "\xDB\xC8" => "\xE8\xA2\xBE", + "\xDB\xC9" => "\xE8\xA2\xB6", + "\xDB\xCA" => "\xE8\xA2\xBC", + "\xDB\xCB" => "\xE8\xA2\xB7", + "\xDB\xCC" => "\xE8\xA2\xBD", + "\xDB\xCD" => "\xE8\xA2\xB2", + "\xDB\xCE" => "\xE8\xA4\x81", + "\xDB\xCF" => "\xE8\xA3\x89", + "\xDB\xD0" => "\xE8\xA6\x95", + "\xDB\xD1" => "\xE8\xA6\x98", + "\xDB\xD2" => "\xE8\xA6\x97", + "\xDB\xD3" => "\xE8\xA7\x9D", + "\xDB\xD4" => "\xE8\xA7\x9A", + "\xDB\xD5" => "\xE8\xA7\x9B", + "\xDB\xD6" => "\xE8\xA9\x8E", + "\xDB\xD7" => "\xE8\xA9\x8D", + "\xDB\xD8" => "\xE8\xA8\xB9", + "\xDB\xD9" => "\xE8\xA9\x99", + "\xDB\xDA" => "\xE8\xA9\x80", + "\xDB\xDB" => "\xE8\xA9\x97", + "\xDB\xDC" => "\xE8\xA9\x98", + "\xDB\xDD" => "\xE8\xA9\x84", + "\xDB\xDE" => "\xE8\xA9\x85", + "\xDB\xDF" => "\xE8\xA9\x92", + "\xDB\xE0" => "\xE8\xA9\x88", + "\xDB\xE1" => "\xE8\xA9\x91", + "\xDB\xE2" => "\xE8\xA9\x8A", + "\xDB\xE3" => "\xE8\xA9\x8C", + "\xDB\xE4" => "\xE8\xA9\x8F", + "\xDB\xE5" => "\xE8\xB1\x9F", + "\xDB\xE6" => "\xE8\xB2\x81", + "\xDB\xE7" => "\xE8\xB2\x80", + "\xDB\xE8" => "\xE8\xB2\xBA", + "\xDB\xE9" => "\xE8\xB2\xBE", + "\xDB\xEA" => "\xE8\xB2\xB0", + "\xDB\xEB" => "\xE8\xB2\xB9", + "\xDB\xEC" => "\xE8\xB2\xB5", + "\xDB\xED" => "\xE8\xB6\x84", + "\xDB\xEE" => "\xE8\xB6\x80", + "\xDB\xEF" => "\xE8\xB6\x89", + "\xDB\xF0" => "\xE8\xB7\x98", + "\xDB\xF1" => "\xE8\xB7\x93", + "\xDB\xF2" => "\xE8\xB7\x8D", + "\xDB\xF3" => "\xE8\xB7\x87", + "\xDB\xF4" => "\xE8\xB7\x96", + "\xDB\xF5" => "\xE8\xB7\x9C", + "\xDB\xF6" => "\xE8\xB7\x8F", + "\xDB\xF7" => "\xE8\xB7\x95", + "\xDB\xF8" => "\xE8\xB7\x99", + "\xDB\xF9" => "\xE8\xB7\x88", + "\xDB\xFA" => "\xE8\xB7\x97", + "\xDB\xFB" => "\xE8\xB7\x85", + "\xDB\xFC" => "\xE8\xBB\xAF", + "\xDB\xFD" => "\xE8\xBB\xB7", + "\xDB\xFE" => "\xE8\xBB\xBA", + "\xDC\x40" => "\xE8\xBB\xB9", + "\xDC\x41" => "\xE8\xBB\xA6", + "\xDC\x42" => "\xE8\xBB\xAE", + "\xDC\x43" => "\xE8\xBB\xA5", + "\xDC\x44" => "\xE8\xBB\xB5", + "\xDC\x45" => "\xE8\xBB\xA7", + "\xDC\x46" => "\xE8\xBB\xA8", + "\xDC\x47" => "\xE8\xBB\xB6", + "\xDC\x48" => "\xE8\xBB\xAB", + "\xDC\x49" => "\xE8\xBB\xB1", + "\xDC\x4A" => "\xE8\xBB\xAC", + "\xDC\x4B" => "\xE8\xBB\xB4", + "\xDC\x4C" => "\xE8\xBB\xA9", + "\xDC\x4D" => "\xE9\x80\xAD", + "\xDC\x4E" => "\xE9\x80\xB4", + "\xDC\x4F" => "\xE9\x80\xAF", + "\xDC\x50" => "\xE9\x84\x86", + "\xDC\x51" => "\xE9\x84\xAC", + "\xDC\x52" => "\xE9\x84\x84", + "\xDC\x53" => "\xE9\x83\xBF", + "\xDC\x54" => "\xE9\x83\xBC", + "\xDC\x55" => "\xE9\x84\x88", + "\xDC\x56" => "\xE9\x83\xB9", + "\xDC\x57" => "\xE9\x83\xBB", + "\xDC\x58" => "\xE9\x84\x81", + "\xDC\x59" => "\xE9\x84\x80", + "\xDC\x5A" => "\xE9\x84\x87", + "\xDC\x5B" => "\xE9\x84\x85", + "\xDC\x5C" => "\xE9\x84\x83", + "\xDC\x5D" => "\xE9\x85\xA1", + "\xDC\x5E" => "\xE9\x85\xA4", + "\xDC\x5F" => "\xE9\x85\x9F", + "\xDC\x60" => "\xE9\x85\xA2", + "\xDC\x61" => "\xE9\x85\xA0", + "\xDC\x62" => "\xE9\x88\x81", + "\xDC\x63" => "\xE9\x88\x8A", + "\xDC\x64" => "\xE9\x88\xA5", + "\xDC\x65" => "\xE9\x88\x83", + "\xDC\x66" => "\xE9\x88\x9A", + "\xDC\x67" => "\xE9\x88\xA6", + "\xDC\x68" => "\xE9\x88\x8F", + "\xDC\x69" => "\xE9\x88\x8C", + "\xDC\x6A" => "\xE9\x88\x80", + "\xDC\x6B" => "\xE9\x88\x92", + "\xDC\x6C" => "\xE9\x87\xBF", + "\xDC\x6D" => "\xE9\x87\xBD", + "\xDC\x6E" => "\xE9\x88\x86", + "\xDC\x6F" => "\xE9\x88\x84", + "\xDC\x70" => "\xE9\x88\xA7", + "\xDC\x71" => "\xE9\x88\x82", + "\xDC\x72" => "\xE9\x88\x9C", + "\xDC\x73" => "\xE9\x88\xA4", + "\xDC\x74" => "\xE9\x88\x99", + "\xDC\x75" => "\xE9\x88\x97", + "\xDC\x76" => "\xE9\x88\x85", + "\xDC\x77" => "\xE9\x88\x96", + "\xDC\x78" => "\xE9\x95\xBB", + "\xDC\x79" => "\xE9\x96\x8D", + "\xDC\x7A" => "\xE9\x96\x8C", + "\xDC\x7B" => "\xE9\x96\x90", + "\xDC\x7C" => "\xE9\x9A\x87", + "\xDC\x7D" => "\xE9\x99\xBE", + "\xDC\x7E" => "\xE9\x9A\x88", + "\xDC\xA1" => "\xE9\x9A\x89", + "\xDC\xA2" => "\xE9\x9A\x83", + "\xDC\xA3" => "\xE9\x9A\x80", + "\xDC\xA4" => "\xE9\x9B\x82", + "\xDC\xA5" => "\xE9\x9B\x88", + "\xDC\xA6" => "\xE9\x9B\x83", + "\xDC\xA7" => "\xE9\x9B\xB1", + "\xDC\xA8" => "\xE9\x9B\xB0", + "\xDC\xA9" => "\xE9\x9D\xAC", + "\xDC\xAA" => "\xE9\x9D\xB0", + "\xDC\xAB" => "\xE9\x9D\xAE", + "\xDC\xAC" => "\xE9\xA0\x87", + "\xDC\xAD" => "\xE9\xA2\xA9", + "\xDC\xAE" => "\xE9\xA3\xAB", + "\xDC\xAF" => "\xE9\xB3\xA6", + "\xDC\xB0" => "\xE9\xBB\xB9", + "\xDC\xB1" => "\xE4\xBA\x83", + "\xDC\xB2" => "\xE4\xBA\x84", + "\xDC\xB3" => "\xE4\xBA\xB6", + "\xDC\xB4" => "\xE5\x82\xBD", + "\xDC\xB5" => "\xE5\x82\xBF", + "\xDC\xB6" => "\xE5\x83\x86", + "\xDC\xB7" => "\xE5\x82\xAE", + "\xDC\xB8" => "\xE5\x83\x84", + "\xDC\xB9" => "\xE5\x83\x8A", + "\xDC\xBA" => "\xE5\x82\xB4", + "\xDC\xBB" => "\xE5\x83\x88", + "\xDC\xBC" => "\xE5\x83\x82", + "\xDC\xBD" => "\xE5\x82\xB0", + "\xDC\xBE" => "\xE5\x83\x81", + "\xDC\xBF" => "\xE5\x82\xBA", + "\xDC\xC0" => "\xE5\x82\xB1", + "\xDC\xC1" => "\xE5\x83\x8B", + "\xDC\xC2" => "\xE5\x83\x89", + "\xDC\xC3" => "\xE5\x82\xB6", + "\xDC\xC4" => "\xE5\x82\xB8", + "\xDC\xC5" => "\xE5\x87\x97", + "\xDC\xC6" => "\xE5\x89\xBA", + "\xDC\xC7" => "\xE5\x89\xB8", + "\xDC\xC8" => "\xE5\x89\xBB", + "\xDC\xC9" => "\xE5\x89\xBC", + "\xDC\xCA" => "\xE5\x97\x83", + "\xDC\xCB" => "\xE5\x97\x9B", + "\xDC\xCC" => "\xE5\x97\x8C", + "\xDC\xCD" => "\xE5\x97\x90", + "\xDC\xCE" => "\xE5\x97\x8B", + "\xDC\xCF" => "\xE5\x97\x8A", + "\xDC\xD0" => "\xE5\x97\x9D", + "\xDC\xD1" => "\xE5\x97\x80", + "\xDC\xD2" => "\xE5\x97\x94", + "\xDC\xD3" => "\xE5\x97\x84", + "\xDC\xD4" => "\xE5\x97\xA9", + "\xDC\xD5" => "\xE5\x96\xBF", + "\xDC\xD6" => "\xE5\x97\x92", + "\xDC\xD7" => "\xE5\x96\x8D", + "\xDC\xD8" => "\xE5\x97\x8F", + "\xDC\xD9" => "\xE5\x97\x95", + "\xDC\xDA" => "\xE5\x97\xA2", + "\xDC\xDB" => "\xE5\x97\x96", + "\xDC\xDC" => "\xE5\x97\x88", + "\xDC\xDD" => "\xE5\x97\xB2", + "\xDC\xDE" => "\xE5\x97\x8D", + "\xDC\xDF" => "\xE5\x97\x99", + "\xDC\xE0" => "\xE5\x97\x82", + "\xDC\xE1" => "\xE5\x9C\x94", + "\xDC\xE2" => "\xE5\xA1\x93", + "\xDC\xE3" => "\xE5\xA1\xA8", + "\xDC\xE4" => "\xE5\xA1\xA4", + "\xDC\xE5" => "\xE5\xA1\x8F", + "\xDC\xE6" => "\xE5\xA1\x8D", + "\xDC\xE7" => "\xE5\xA1\x89", + "\xDC\xE8" => "\xE5\xA1\xAF", + "\xDC\xE9" => "\xE5\xA1\x95", + "\xDC\xEA" => "\xE5\xA1\x8E", + "\xDC\xEB" => "\xE5\xA1\x9D", + "\xDC\xEC" => "\xE5\xA1\x99", + "\xDC\xED" => "\xE5\xA1\xA5", + "\xDC\xEE" => "\xE5\xA1\x9B", + "\xDC\xEF" => "\xE5\xA0\xBD", + "\xDC\xF0" => "\xE5\xA1\xA3", + "\xDC\xF1" => "\xE5\xA1\xB1", + "\xDC\xF2" => "\xE5\xA3\xBC", + "\xDC\xF3" => "\xE5\xAB\x87", + "\xDC\xF4" => "\xE5\xAB\x84", + "\xDC\xF5" => "\xE5\xAB\x8B", + "\xDC\xF6" => "\xE5\xAA\xBA", + "\xDC\xF7" => "\xE5\xAA\xB8", + "\xDC\xF8" => "\xE5\xAA\xB1", + "\xDC\xF9" => "\xE5\xAA\xB5", + "\xDC\xFA" => "\xE5\xAA\xB0", + "\xDC\xFB" => "\xE5\xAA\xBF", + "\xDC\xFC" => "\xE5\xAB\x88", + "\xDC\xFD" => "\xE5\xAA\xBB", + "\xDC\xFE" => "\xE5\xAB\x86", + "\xDD\x40" => "\xE5\xAA\xB7", + "\xDD\x41" => "\xE5\xAB\x80", + "\xDD\x42" => "\xE5\xAB\x8A", + "\xDD\x43" => "\xE5\xAA\xB4", + "\xDD\x44" => "\xE5\xAA\xB6", + "\xDD\x45" => "\xE5\xAB\x8D", + "\xDD\x46" => "\xE5\xAA\xB9", + "\xDD\x47" => "\xE5\xAA\x90", + "\xDD\x48" => "\xE5\xAF\x96", + "\xDD\x49" => "\xE5\xAF\x98", + "\xDD\x4A" => "\xE5\xAF\x99", + "\xDD\x4B" => "\xE5\xB0\x9F", + "\xDD\x4C" => "\xE5\xB0\xB3", + "\xDD\x4D" => "\xE5\xB5\xB1", + "\xDD\x4E" => "\xE5\xB5\xA3", + "\xDD\x4F" => "\xE5\xB5\x8A", + "\xDD\x50" => "\xE5\xB5\xA5", + "\xDD\x51" => "\xE5\xB5\xB2", + "\xDD\x52" => "\xE5\xB5\xAC", + "\xDD\x53" => "\xE5\xB5\x9E", + "\xDD\x54" => "\xE5\xB5\xA8", + "\xDD\x55" => "\xE5\xB5\xA7", + "\xDD\x56" => "\xE5\xB5\xA2", + "\xDD\x57" => "\xE5\xB7\xB0", + "\xDD\x58" => "\xE5\xB9\x8F", + "\xDD\x59" => "\xE5\xB9\x8E", + "\xDD\x5A" => "\xE5\xB9\x8A", + "\xDD\x5B" => "\xE5\xB9\x8D", + "\xDD\x5C" => "\xE5\xB9\x8B", + "\xDD\x5D" => "\xE5\xBB\x85", + "\xDD\x5E" => "\xE5\xBB\x8C", + "\xDD\x5F" => "\xE5\xBB\x86", + "\xDD\x60" => "\xE5\xBB\x8B", + "\xDD\x61" => "\xE5\xBB\x87", + "\xDD\x62" => "\xE5\xBD\x80", + "\xDD\x63" => "\xE5\xBE\xAF", + "\xDD\x64" => "\xE5\xBE\xAD", + "\xDD\x65" => "\xE6\x83\xB7", + "\xDD\x66" => "\xE6\x85\x89", + "\xDD\x67" => "\xE6\x85\x8A", + "\xDD\x68" => "\xE6\x84\xAB", + "\xDD\x69" => "\xE6\x85\x85", + "\xDD\x6A" => "\xE6\x84\xB6", + "\xDD\x6B" => "\xE6\x84\xB2", + "\xDD\x6C" => "\xE6\x84\xAE", + "\xDD\x6D" => "\xE6\x85\x86", + "\xDD\x6E" => "\xE6\x84\xAF", + "\xDD\x6F" => "\xE6\x85\x8F", + "\xDD\x70" => "\xE6\x84\xA9", + "\xDD\x71" => "\xE6\x85\x80", + "\xDD\x72" => "\xE6\x88\xA0", + "\xDD\x73" => "\xE9\x85\xA8", + "\xDD\x74" => "\xE6\x88\xA3", + "\xDD\x75" => "\xE6\x88\xA5", + "\xDD\x76" => "\xE6\x88\xA4", + "\xDD\x77" => "\xE6\x8F\x85", + "\xDD\x78" => "\xE6\x8F\xB1", + "\xDD\x79" => "\xE6\x8F\xAB", + "\xDD\x7A" => "\xE6\x90\x90", + "\xDD\x7B" => "\xE6\x90\x92", + "\xDD\x7C" => "\xE6\x90\x89", + "\xDD\x7D" => "\xE6\x90\xA0", + "\xDD\x7E" => "\xE6\x90\xA4", + "\xDD\xA1" => "\xE6\x90\xB3", + "\xDD\xA2" => "\xE6\x91\x83", + "\xDD\xA3" => "\xE6\x90\x9F", + "\xDD\xA4" => "\xE6\x90\x95", + "\xDD\xA5" => "\xE6\x90\x98", + "\xDD\xA6" => "\xE6\x90\xB9", + "\xDD\xA7" => "\xE6\x90\xB7", + "\xDD\xA8" => "\xE6\x90\xA2", + "\xDD\xA9" => "\xE6\x90\xA3", + "\xDD\xAA" => "\xE6\x90\x8C", + "\xDD\xAB" => "\xE6\x90\xA6", + "\xDD\xAC" => "\xE6\x90\xB0", + "\xDD\xAD" => "\xE6\x90\xA8", + "\xDD\xAE" => "\xE6\x91\x81", + "\xDD\xAF" => "\xE6\x90\xB5", + "\xDD\xB0" => "\xE6\x90\xAF", + "\xDD\xB1" => "\xE6\x90\x8A", + "\xDD\xB2" => "\xE6\x90\x9A", + "\xDD\xB3" => "\xE6\x91\x80", + "\xDD\xB4" => "\xE6\x90\xA5", + "\xDD\xB5" => "\xE6\x90\xA7", + "\xDD\xB6" => "\xE6\x90\x8B", + "\xDD\xB7" => "\xE6\x8F\xA7", + "\xDD\xB8" => "\xE6\x90\x9B", + "\xDD\xB9" => "\xE6\x90\xAE", + "\xDD\xBA" => "\xE6\x90\xA1", + "\xDD\xBB" => "\xE6\x90\x8E", + "\xDD\xBC" => "\xE6\x95\xAF", + "\xDD\xBD" => "\xE6\x96\x92", + "\xDD\xBE" => "\xE6\x97\x93", + "\xDD\xBF" => "\xE6\x9A\x86", + "\xDD\xC0" => "\xE6\x9A\x8C", + "\xDD\xC1" => "\xE6\x9A\x95", + "\xDD\xC2" => "\xE6\x9A\x90", + "\xDD\xC3" => "\xE6\x9A\x8B", + "\xDD\xC4" => "\xE6\x9A\x8A", + "\xDD\xC5" => "\xE6\x9A\x99", + "\xDD\xC6" => "\xE6\x9A\x94", + "\xDD\xC7" => "\xE6\x99\xB8", + "\xDD\xC8" => "\xE6\x9C\xA0", + "\xDD\xC9" => "\xE6\xA5\xA6", + "\xDD\xCA" => "\xE6\xA5\x9F", + "\xDD\xCB" => "\xE6\xA4\xB8", + "\xDD\xCC" => "\xE6\xA5\x8E", + "\xDD\xCD" => "\xE6\xA5\xA2", + "\xDD\xCE" => "\xE6\xA5\xB1", + "\xDD\xCF" => "\xE6\xA4\xBF", + "\xDD\xD0" => "\xE6\xA5\x85", + "\xDD\xD1" => "\xE6\xA5\xAA", + "\xDD\xD2" => "\xE6\xA4\xB9", + "\xDD\xD3" => "\xE6\xA5\x82", + "\xDD\xD4" => "\xE6\xA5\x97", + "\xDD\xD5" => "\xE6\xA5\x99", + "\xDD\xD6" => "\xE6\xA5\xBA", + "\xDD\xD7" => "\xE6\xA5\x88", + "\xDD\xD8" => "\xE6\xA5\x89", + "\xDD\xD9" => "\xE6\xA4\xB5", + "\xDD\xDA" => "\xE6\xA5\xAC", + "\xDD\xDB" => "\xE6\xA4\xB3", + "\xDD\xDC" => "\xE6\xA4\xBD", + "\xDD\xDD" => "\xE6\xA5\xA5", + "\xDD\xDE" => "\xE6\xA3\xB0", + "\xDD\xDF" => "\xE6\xA5\xB8", + "\xDD\xE0" => "\xE6\xA4\xB4", + "\xDD\xE1" => "\xE6\xA5\xA9", + "\xDD\xE2" => "\xE6\xA5\x80", + "\xDD\xE3" => "\xE6\xA5\xAF", + "\xDD\xE4" => "\xE6\xA5\x84", + "\xDD\xE5" => "\xE6\xA5\xB6", + "\xDD\xE6" => "\xE6\xA5\x98", + "\xDD\xE7" => "\xE6\xA5\x81", + "\xDD\xE8" => "\xE6\xA5\xB4", + "\xDD\xE9" => "\xE6\xA5\x8C", + "\xDD\xEA" => "\xE6\xA4\xBB", + "\xDD\xEB" => "\xE6\xA5\x8B", + "\xDD\xEC" => "\xE6\xA4\xB7", + "\xDD\xED" => "\xE6\xA5\x9C", + "\xDD\xEE" => "\xE6\xA5\x8F", + "\xDD\xEF" => "\xE6\xA5\x91", + "\xDD\xF0" => "\xE6\xA4\xB2", + "\xDD\xF1" => "\xE6\xA5\x92", + "\xDD\xF2" => "\xE6\xA4\xAF", + "\xDD\xF3" => "\xE6\xA5\xBB", + "\xDD\xF4" => "\xE6\xA4\xBC", + "\xDD\xF5" => "\xE6\xAD\x86", + "\xDD\xF6" => "\xE6\xAD\x85", + "\xDD\xF7" => "\xE6\xAD\x83", + "\xDD\xF8" => "\xE6\xAD\x82", + "\xDD\xF9" => "\xE6\xAD\x88", + "\xDD\xFA" => "\xE6\xAD\x81", + "\xDD\xFB" => "\xE6\xAE\x9B", + "\xDD\xFC" => "\xEF\xA8\x8D", + "\xDD\xFD" => "\xE6\xAF\xBB", + "\xDD\xFE" => "\xE6\xAF\xBC", + "\xDE\x40" => "\xE6\xAF\xB9", + "\xDE\x41" => "\xE6\xAF\xB7", + "\xDE\x42" => "\xE6\xAF\xB8", + "\xDE\x43" => "\xE6\xBA\x9B", + "\xDE\x44" => "\xE6\xBB\x96", + "\xDE\x45" => "\xE6\xBB\x88", + "\xDE\x46" => "\xE6\xBA\x8F", + "\xDE\x47" => "\xE6\xBB\x80", + "\xDE\x48" => "\xE6\xBA\x9F", + "\xDE\x49" => "\xE6\xBA\x93", + "\xDE\x4A" => "\xE6\xBA\x94", + "\xDE\x4B" => "\xE6\xBA\xA0", + "\xDE\x4C" => "\xE6\xBA\xB1", + "\xDE\x4D" => "\xE6\xBA\xB9", + "\xDE\x4E" => "\xE6\xBB\x86", + "\xDE\x4F" => "\xE6\xBB\x92", + "\xDE\x50" => "\xE6\xBA\xBD", + "\xDE\x51" => "\xE6\xBB\x81", + "\xDE\x52" => "\xE6\xBA\x9E", + "\xDE\x53" => "\xE6\xBB\x89", + "\xDE\x54" => "\xE6\xBA\xB7", + "\xDE\x55" => "\xE6\xBA\xB0", + "\xDE\x56" => "\xE6\xBB\x8D", + "\xDE\x57" => "\xE6\xBA\xA6", + "\xDE\x58" => "\xE6\xBB\x8F", + "\xDE\x59" => "\xE6\xBA\xB2", + "\xDE\x5A" => "\xE6\xBA\xBE", + "\xDE\x5B" => "\xE6\xBB\x83", + "\xDE\x5C" => "\xE6\xBB\x9C", + "\xDE\x5D" => "\xE6\xBB\x98", + "\xDE\x5E" => "\xE6\xBA\x99", + "\xDE\x5F" => "\xE6\xBA\x92", + "\xDE\x60" => "\xE6\xBA\x8E", + "\xDE\x61" => "\xE6\xBA\x8D", + "\xDE\x62" => "\xE6\xBA\xA4", + "\xDE\x63" => "\xE6\xBA\xA1", + "\xDE\x64" => "\xE6\xBA\xBF", + "\xDE\x65" => "\xE6\xBA\xB3", + "\xDE\x66" => "\xE6\xBB\x90", + "\xDE\x67" => "\xE6\xBB\x8A", + "\xDE\x68" => "\xE6\xBA\x97", + "\xDE\x69" => "\xE6\xBA\xAE", + "\xDE\x6A" => "\xE6\xBA\xA3", + "\xDE\x6B" => "\xE7\x85\x87", + "\xDE\x6C" => "\xE7\x85\x94", + "\xDE\x6D" => "\xE7\x85\x92", + "\xDE\x6E" => "\xE7\x85\xA3", + "\xDE\x6F" => "\xE7\x85\xA0", + "\xDE\x70" => "\xE7\x85\x81", + "\xDE\x71" => "\xE7\x85\x9D", + "\xDE\x72" => "\xE7\x85\xA2", + "\xDE\x73" => "\xE7\x85\xB2", + "\xDE\x74" => "\xE7\x85\xB8", + "\xDE\x75" => "\xE7\x85\xAA", + "\xDE\x76" => "\xE7\x85\xA1", + "\xDE\x77" => "\xE7\x85\x82", + "\xDE\x78" => "\xE7\x85\x98", + "\xDE\x79" => "\xE7\x85\x83", + "\xDE\x7A" => "\xE7\x85\x8B", + "\xDE\x7B" => "\xE7\x85\xB0", + "\xDE\x7C" => "\xE7\x85\x9F", + "\xDE\x7D" => "\xE7\x85\x90", + "\xDE\x7E" => "\xE7\x85\x93", + "\xDE\xA1" => "\xE7\x85\x84", + "\xDE\xA2" => "\xE7\x85\x8D", + "\xDE\xA3" => "\xE7\x85\x9A", + "\xDE\xA4" => "\xE7\x89\x8F", + "\xDE\xA5" => "\xE7\x8A\x8D", + "\xDE\xA6" => "\xE7\x8A\x8C", + "\xDE\xA7" => "\xE7\x8A\x91", + "\xDE\xA8" => "\xE7\x8A\x90", + "\xDE\xA9" => "\xE7\x8A\x8E", + "\xDE\xAA" => "\xE7\x8C\xBC", + "\xDE\xAB" => "\xE7\x8D\x82", + "\xDE\xAC" => "\xE7\x8C\xBB", + "\xDE\xAD" => "\xE7\x8C\xBA", + "\xDE\xAE" => "\xE7\x8D\x80", + "\xDE\xAF" => "\xE7\x8D\x8A", + "\xDE\xB0" => "\xE7\x8D\x89", + "\xDE\xB1" => "\xE7\x91\x84", + "\xDE\xB2" => "\xE7\x91\x8A", + "\xDE\xB3" => "\xE7\x91\x8B", + "\xDE\xB4" => "\xE7\x91\x92", + "\xDE\xB5" => "\xE7\x91\x91", + "\xDE\xB6" => "\xE7\x91\x97", + "\xDE\xB7" => "\xE7\x91\x80", + "\xDE\xB8" => "\xE7\x91\x8F", + "\xDE\xB9" => "\xE7\x91\x90", + "\xDE\xBA" => "\xE7\x91\x8E", + "\xDE\xBB" => "\xE7\x91\x82", + "\xDE\xBC" => "\xE7\x91\x86", + "\xDE\xBD" => "\xE7\x91\x8D", + "\xDE\xBE" => "\xE7\x91\x94", + "\xDE\xBF" => "\xE7\x93\xA1", + "\xDE\xC0" => "\xE7\x93\xBF", + "\xDE\xC1" => "\xE7\x93\xBE", + "\xDE\xC2" => "\xE7\x93\xBD", + "\xDE\xC3" => "\xE7\x94\x9D", + "\xDE\xC4" => "\xE7\x95\xB9", + "\xDE\xC5" => "\xE7\x95\xB7", + "\xDE\xC6" => "\xE6\xA6\x83", + "\xDE\xC7" => "\xE7\x97\xAF", + "\xDE\xC8" => "\xE7\x98\x8F", + "\xDE\xC9" => "\xE7\x98\x83", + "\xDE\xCA" => "\xE7\x97\xB7", + "\xDE\xCB" => "\xE7\x97\xBE", + "\xDE\xCC" => "\xE7\x97\xBC", + "\xDE\xCD" => "\xE7\x97\xB9", + "\xDE\xCE" => "\xE7\x97\xB8", + "\xDE\xCF" => "\xE7\x98\x90", + "\xDE\xD0" => "\xE7\x97\xBB", + "\xDE\xD1" => "\xE7\x97\xB6", + "\xDE\xD2" => "\xE7\x97\xAD", + "\xDE\xD3" => "\xE7\x97\xB5", + "\xDE\xD4" => "\xE7\x97\xBD", + "\xDE\xD5" => "\xE7\x9A\x99", + "\xDE\xD6" => "\xE7\x9A\xB5", + "\xDE\xD7" => "\xE7\x9B\x9D", + "\xDE\xD8" => "\xE7\x9D\x95", + "\xDE\xD9" => "\xE7\x9D\x9F", + "\xDE\xDA" => "\xE7\x9D\xA0", + "\xDE\xDB" => "\xE7\x9D\x92", + "\xDE\xDC" => "\xE7\x9D\x96", + "\xDE\xDD" => "\xE7\x9D\x9A", + "\xDE\xDE" => "\xE7\x9D\xA9", + "\xDE\xDF" => "\xE7\x9D\xA7", + "\xDE\xE0" => "\xE7\x9D\x94", + "\xDE\xE1" => "\xE7\x9D\x99", + "\xDE\xE2" => "\xE7\x9D\xAD", + "\xDE\xE3" => "\xE7\x9F\xA0", + "\xDE\xE4" => "\xE7\xA2\x87", + "\xDE\xE5" => "\xE7\xA2\x9A", + "\xDE\xE6" => "\xE7\xA2\x94", + "\xDE\xE7" => "\xE7\xA2\x8F", + "\xDE\xE8" => "\xE7\xA2\x84", + "\xDE\xE9" => "\xE7\xA2\x95", + "\xDE\xEA" => "\xE7\xA2\x85", + "\xDE\xEB" => "\xE7\xA2\x86", + "\xDE\xEC" => "\xE7\xA2\xA1", + "\xDE\xED" => "\xE7\xA2\x83", + "\xDE\xEE" => "\xE7\xA1\xB9", + "\xDE\xEF" => "\xE7\xA2\x99", + "\xDE\xF0" => "\xE7\xA2\x80", + "\xDE\xF1" => "\xE7\xA2\x96", + "\xDE\xF2" => "\xE7\xA1\xBB", + "\xDE\xF3" => "\xE7\xA5\xBC", + "\xDE\xF4" => "\xE7\xA6\x82", + "\xDE\xF5" => "\xE7\xA5\xBD", + "\xDE\xF6" => "\xE7\xA5\xB9", + "\xDE\xF7" => "\xE7\xA8\x91", + "\xDE\xF8" => "\xE7\xA8\x98", + "\xDE\xF9" => "\xE7\xA8\x99", + "\xDE\xFA" => "\xE7\xA8\x92", + "\xDE\xFB" => "\xE7\xA8\x97", + "\xDE\xFC" => "\xE7\xA8\x95", + "\xDE\xFD" => "\xE7\xA8\xA2", + "\xDE\xFE" => "\xE7\xA8\x93", + "\xDF\x40" => "\xE7\xA8\x9B", + "\xDF\x41" => "\xE7\xA8\x90", + "\xDF\x42" => "\xE7\xAA\xA3", + "\xDF\x43" => "\xE7\xAA\xA2", + "\xDF\x44" => "\xE7\xAA\x9E", + "\xDF\x45" => "\xE7\xAB\xAB", + "\xDF\x46" => "\xE7\xAD\xA6", + "\xDF\x47" => "\xE7\xAD\xA4", + "\xDF\x48" => "\xE7\xAD\xAD", + "\xDF\x49" => "\xE7\xAD\xB4", + "\xDF\x4A" => "\xE7\xAD\xA9", + "\xDF\x4B" => "\xE7\xAD\xB2", + "\xDF\x4C" => "\xE7\xAD\xA5", + "\xDF\x4D" => "\xE7\xAD\xB3", + "\xDF\x4E" => "\xE7\xAD\xB1", + "\xDF\x4F" => "\xE7\xAD\xB0", + "\xDF\x50" => "\xE7\xAD\xA1", + "\xDF\x51" => "\xE7\xAD\xB8", + "\xDF\x52" => "\xE7\xAD\xB6", + "\xDF\x53" => "\xE7\xAD\xA3", + "\xDF\x54" => "\xE7\xB2\xB2", + "\xDF\x55" => "\xE7\xB2\xB4", + "\xDF\x56" => "\xE7\xB2\xAF", + "\xDF\x57" => "\xE7\xB6\x88", + "\xDF\x58" => "\xE7\xB6\x86", + "\xDF\x59" => "\xE7\xB6\x80", + "\xDF\x5A" => "\xE7\xB6\x8D", + "\xDF\x5B" => "\xE7\xB5\xBF", + "\xDF\x5C" => "\xE7\xB6\x85", + "\xDF\x5D" => "\xE7\xB5\xBA", + "\xDF\x5E" => "\xE7\xB6\x8E", + "\xDF\x5F" => "\xE7\xB5\xBB", + "\xDF\x60" => "\xE7\xB6\x83", + "\xDF\x61" => "\xE7\xB5\xBC", + "\xDF\x62" => "\xE7\xB6\x8C", + "\xDF\x63" => "\xE7\xB6\x94", + "\xDF\x64" => "\xE7\xB6\x84", + "\xDF\x65" => "\xE7\xB5\xBD", + "\xDF\x66" => "\xE7\xB6\x92", + "\xDF\x67" => "\xE7\xBD\xAD", + "\xDF\x68" => "\xE7\xBD\xAB", + "\xDF\x69" => "\xE7\xBD\xA7", + "\xDF\x6A" => "\xE7\xBD\xA8", + "\xDF\x6B" => "\xE7\xBD\xAC", + "\xDF\x6C" => "\xE7\xBE\xA6", + "\xDF\x6D" => "\xE7\xBE\xA5", + "\xDF\x6E" => "\xE7\xBE\xA7", + "\xDF\x6F" => "\xE7\xBF\x9B", + "\xDF\x70" => "\xE7\xBF\x9C", + "\xDF\x71" => "\xE8\x80\xA1", + "\xDF\x72" => "\xE8\x85\xA4", + "\xDF\x73" => "\xE8\x85\xA0", + "\xDF\x74" => "\xE8\x85\xB7", + "\xDF\x75" => "\xE8\x85\x9C", + "\xDF\x76" => "\xE8\x85\xA9", + "\xDF\x77" => "\xE8\x85\x9B", + "\xDF\x78" => "\xE8\x85\xA2", + "\xDF\x79" => "\xE8\x85\xB2", + "\xDF\x7A" => "\xE6\x9C\xA1", + "\xDF\x7B" => "\xE8\x85\x9E", + "\xDF\x7C" => "\xE8\x85\xB6", + "\xDF\x7D" => "\xE8\x85\xA7", + "\xDF\x7E" => "\xE8\x85\xAF", + "\xDF\xA1" => "\xE8\x85\x84", + "\xDF\xA2" => "\xE8\x85\xA1", + "\xDF\xA3" => "\xE8\x88\x9D", + "\xDF\xA4" => "\xE8\x89\x89", + "\xDF\xA5" => "\xE8\x89\x84", + "\xDF\xA6" => "\xE8\x89\x80", + "\xDF\xA7" => "\xE8\x89\x82", + "\xDF\xA8" => "\xE8\x89\x85", + "\xDF\xA9" => "\xE8\x93\xB1", + "\xDF\xAA" => "\xE8\x90\xBF", + "\xDF\xAB" => "\xE8\x91\x96", + "\xDF\xAC" => "\xE8\x91\xB6", + "\xDF\xAD" => "\xE8\x91\xB9", + "\xDF\xAE" => "\xE8\x92\x8F", + "\xDF\xAF" => "\xE8\x92\x8D", + "\xDF\xB0" => "\xE8\x91\xA5", + "\xDF\xB1" => "\xE8\x91\x91", + "\xDF\xB2" => "\xE8\x91\x80", + "\xDF\xB3" => "\xE8\x92\x86", + "\xDF\xB4" => "\xE8\x91\xA7", + "\xDF\xB5" => "\xE8\x90\xB0", + "\xDF\xB6" => "\xE8\x91\x8D", + "\xDF\xB7" => "\xE8\x91\xBD", + "\xDF\xB8" => "\xE8\x91\x9A", + "\xDF\xB9" => "\xE8\x91\x99", + "\xDF\xBA" => "\xE8\x91\xB4", + "\xDF\xBB" => "\xE8\x91\xB3", + "\xDF\xBC" => "\xE8\x91\x9D", + "\xDF\xBD" => "\xE8\x94\x87", + "\xDF\xBE" => "\xE8\x91\x9E", + "\xDF\xBF" => "\xE8\x90\xB7", + "\xDF\xC0" => "\xE8\x90\xBA", + "\xDF\xC1" => "\xE8\x90\xB4", + "\xDF\xC2" => "\xE8\x91\xBA", + "\xDF\xC3" => "\xE8\x91\x83", + "\xDF\xC4" => "\xE8\x91\xB8", + "\xDF\xC5" => "\xE8\x90\xB2", + "\xDF\xC6" => "\xE8\x91\x85", + "\xDF\xC7" => "\xE8\x90\xA9", + "\xDF\xC8" => "\xE8\x8F\x99", + "\xDF\xC9" => "\xE8\x91\x8B", + "\xDF\xCA" => "\xE8\x90\xAF", + "\xDF\xCB" => "\xE8\x91\x82", + "\xDF\xCC" => "\xE8\x90\xAD", + "\xDF\xCD" => "\xE8\x91\x9F", + "\xDF\xCE" => "\xE8\x91\xB0", + "\xDF\xCF" => "\xE8\x90\xB9", + "\xDF\xD0" => "\xE8\x91\x8E", + "\xDF\xD1" => "\xE8\x91\x8C", + "\xDF\xD2" => "\xE8\x91\x92", + "\xDF\xD3" => "\xE8\x91\xAF", + "\xDF\xD4" => "\xE8\x93\x85", + "\xDF\xD5" => "\xE8\x92\x8E", + "\xDF\xD6" => "\xE8\x90\xBB", + "\xDF\xD7" => "\xE8\x91\x87", + "\xDF\xD8" => "\xE8\x90\xB6", + "\xDF\xD9" => "\xE8\x90\xB3", + "\xDF\xDA" => "\xE8\x91\xA8", + "\xDF\xDB" => "\xE8\x91\xBE", + "\xDF\xDC" => "\xE8\x91\x84", + "\xDF\xDD" => "\xE8\x90\xAB", + "\xDF\xDE" => "\xE8\x91\xA0", + "\xDF\xDF" => "\xE8\x91\x94", + "\xDF\xE0" => "\xE8\x91\xAE", + "\xDF\xE1" => "\xE8\x91\x90", + "\xDF\xE2" => "\xE8\x9C\x8B", + "\xDF\xE3" => "\xE8\x9C\x84", + "\xDF\xE4" => "\xE8\x9B\xB7", + "\xDF\xE5" => "\xE8\x9C\x8C", + "\xDF\xE6" => "\xE8\x9B\xBA", + "\xDF\xE7" => "\xE8\x9B\x96", + "\xDF\xE8" => "\xE8\x9B\xB5", + "\xDF\xE9" => "\xE8\x9D\x8D", + "\xDF\xEA" => "\xE8\x9B\xB8", + "\xDF\xEB" => "\xE8\x9C\x8E", + "\xDF\xEC" => "\xE8\x9C\x89", + "\xDF\xED" => "\xE8\x9C\x81", + "\xDF\xEE" => "\xE8\x9B\xB6", + "\xDF\xEF" => "\xE8\x9C\x8D", + "\xDF\xF0" => "\xE8\x9C\x85", + "\xDF\xF1" => "\xE8\xA3\x96", + "\xDF\xF2" => "\xE8\xA3\x8B", + "\xDF\xF3" => "\xE8\xA3\x8D", + "\xDF\xF4" => "\xE8\xA3\x8E", + "\xDF\xF5" => "\xE8\xA3\x9E", + "\xDF\xF6" => "\xE8\xA3\x9B", + "\xDF\xF7" => "\xE8\xA3\x9A", + "\xDF\xF8" => "\xE8\xA3\x8C", + "\xDF\xF9" => "\xE8\xA3\x90", + "\xDF\xFA" => "\xE8\xA6\x85", + "\xDF\xFB" => "\xE8\xA6\x9B", + "\xDF\xFC" => "\xE8\xA7\x9F", + "\xDF\xFD" => "\xE8\xA7\xA5", + "\xDF\xFE" => "\xE8\xA7\xA4", + "\xE0\x40" => "\xE8\xA7\xA1", + "\xE0\x41" => "\xE8\xA7\xA0", + "\xE0\x42" => "\xE8\xA7\xA2", + "\xE0\x43" => "\xE8\xA7\x9C", + "\xE0\x44" => "\xE8\xA7\xA6", + "\xE0\x45" => "\xE8\xA9\xB6", + "\xE0\x46" => "\xE8\xAA\x86", + "\xE0\x47" => "\xE8\xA9\xBF", + "\xE0\x48" => "\xE8\xA9\xA1", + "\xE0\x49" => "\xE8\xA8\xBF", + "\xE0\x4A" => "\xE8\xA9\xB7", + "\xE0\x4B" => "\xE8\xAA\x82", + "\xE0\x4C" => "\xE8\xAA\x84", + "\xE0\x4D" => "\xE8\xA9\xB5", + "\xE0\x4E" => "\xE8\xAA\x83", + "\xE0\x4F" => "\xE8\xAA\x81", + "\xE0\x50" => "\xE8\xA9\xB4", + "\xE0\x51" => "\xE8\xA9\xBA", + "\xE0\x52" => "\xE8\xB0\xBC", + "\xE0\x53" => "\xE8\xB1\x8B", + "\xE0\x54" => "\xE8\xB1\x8A", + "\xE0\x55" => "\xE8\xB1\xA5", + "\xE0\x56" => "\xE8\xB1\xA4", + "\xE0\x57" => "\xE8\xB1\xA6", + "\xE0\x58" => "\xE8\xB2\x86", + "\xE0\x59" => "\xE8\xB2\x84", + "\xE0\x5A" => "\xE8\xB2\x85", + "\xE0\x5B" => "\xE8\xB3\x8C", + "\xE0\x5C" => "\xE8\xB5\xA8", + "\xE0\x5D" => "\xE8\xB5\xA9", + "\xE0\x5E" => "\xE8\xB6\x91", + "\xE0\x5F" => "\xE8\xB6\x8C", + "\xE0\x60" => "\xE8\xB6\x8E", + "\xE0\x61" => "\xE8\xB6\x8F", + "\xE0\x62" => "\xE8\xB6\x8D", + "\xE0\x63" => "\xE8\xB6\x93", + "\xE0\x64" => "\xE8\xB6\x94", + "\xE0\x65" => "\xE8\xB6\x90", + "\xE0\x66" => "\xE8\xB6\x92", + "\xE0\x67" => "\xE8\xB7\xB0", + "\xE0\x68" => "\xE8\xB7\xA0", + "\xE0\x69" => "\xE8\xB7\xAC", + "\xE0\x6A" => "\xE8\xB7\xB1", + "\xE0\x6B" => "\xE8\xB7\xAE", + "\xE0\x6C" => "\xE8\xB7\x90", + "\xE0\x6D" => "\xE8\xB7\xA9", + "\xE0\x6E" => "\xE8\xB7\xA3", + "\xE0\x6F" => "\xE8\xB7\xA2", + "\xE0\x70" => "\xE8\xB7\xA7", + "\xE0\x71" => "\xE8\xB7\xB2", + "\xE0\x72" => "\xE8\xB7\xAB", + "\xE0\x73" => "\xE8\xB7\xB4", + "\xE0\x74" => "\xE8\xBC\x86", + "\xE0\x75" => "\xE8\xBB\xBF", + "\xE0\x76" => "\xE8\xBC\x81", + "\xE0\x77" => "\xE8\xBC\x80", + "\xE0\x78" => "\xE8\xBC\x85", + "\xE0\x79" => "\xE8\xBC\x87", + "\xE0\x7A" => "\xE8\xBC\x88", + "\xE0\x7B" => "\xE8\xBC\x82", + "\xE0\x7C" => "\xE8\xBC\x8B", + "\xE0\x7D" => "\xE9\x81\x92", + "\xE0\x7E" => "\xE9\x80\xBF", + "\xE0\xA1" => "\xE9\x81\x84", + "\xE0\xA2" => "\xE9\x81\x89", + "\xE0\xA3" => "\xE9\x80\xBD", + "\xE0\xA4" => "\xE9\x84\x90", + "\xE0\xA5" => "\xE9\x84\x8D", + "\xE0\xA6" => "\xE9\x84\x8F", + "\xE0\xA7" => "\xE9\x84\x91", + "\xE0\xA8" => "\xE9\x84\x96", + "\xE0\xA9" => "\xE9\x84\x94", + "\xE0\xAA" => "\xE9\x84\x8B", + "\xE0\xAB" => "\xE9\x84\x8E", + "\xE0\xAC" => "\xE9\x85\xAE", + "\xE0\xAD" => "\xE9\x85\xAF", + "\xE0\xAE" => "\xE9\x89\x88", + "\xE0\xAF" => "\xE9\x89\x92", + "\xE0\xB0" => "\xE9\x88\xB0", + "\xE0\xB1" => "\xE9\x88\xBA", + "\xE0\xB2" => "\xE9\x89\xA6", + "\xE0\xB3" => "\xE9\x88\xB3", + "\xE0\xB4" => "\xE9\x89\xA5", + "\xE0\xB5" => "\xE9\x89\x9E", + "\xE0\xB6" => "\xE9\x8A\x83", + "\xE0\xB7" => "\xE9\x88\xAE", + "\xE0\xB8" => "\xE9\x89\x8A", + "\xE0\xB9" => "\xE9\x89\x86", + "\xE0\xBA" => "\xE9\x89\xAD", + "\xE0\xBB" => "\xE9\x89\xAC", + "\xE0\xBC" => "\xE9\x89\x8F", + "\xE0\xBD" => "\xE9\x89\xA0", + "\xE0\xBE" => "\xE9\x89\xA7", + "\xE0\xBF" => "\xE9\x89\xAF", + "\xE0\xC0" => "\xE9\x88\xB6", + "\xE0\xC1" => "\xE9\x89\xA1", + "\xE0\xC2" => "\xE9\x89\xB0", + "\xE0\xC3" => "\xE9\x88\xB1", + "\xE0\xC4" => "\xE9\x89\x94", + "\xE0\xC5" => "\xE9\x89\xA3", + "\xE0\xC6" => "\xE9\x89\x90", + "\xE0\xC7" => "\xE9\x89\xB2", + "\xE0\xC8" => "\xE9\x89\x8E", + "\xE0\xC9" => "\xE9\x89\x93", + "\xE0\xCA" => "\xE9\x89\x8C", + "\xE0\xCB" => "\xE9\x89\x96", + "\xE0\xCC" => "\xE9\x88\xB2", + "\xE0\xCD" => "\xE9\x96\x9F", + "\xE0\xCE" => "\xE9\x96\x9C", + "\xE0\xCF" => "\xE9\x96\x9E", + "\xE0\xD0" => "\xE9\x96\x9B", + "\xE0\xD1" => "\xE9\x9A\x92", + "\xE0\xD2" => "\xE9\x9A\x93", + "\xE0\xD3" => "\xE9\x9A\x91", + "\xE0\xD4" => "\xE9\x9A\x97", + "\xE0\xD5" => "\xE9\x9B\x8E", + "\xE0\xD6" => "\xE9\x9B\xBA", + "\xE0\xD7" => "\xE9\x9B\xBD", + "\xE0\xD8" => "\xE9\x9B\xB8", + "\xE0\xD9" => "\xE9\x9B\xB5", + "\xE0\xDA" => "\xE9\x9D\xB3", + "\xE0\xDB" => "\xE9\x9D\xB7", + "\xE0\xDC" => "\xE9\x9D\xB8", + "\xE0\xDD" => "\xE9\x9D\xB2", + "\xE0\xDE" => "\xE9\xA0\x8F", + "\xE0\xDF" => "\xE9\xA0\x8D", + "\xE0\xE0" => "\xE9\xA0\x8E", + "\xE0\xE1" => "\xE9\xA2\xAC", + "\xE0\xE2" => "\xE9\xA3\xB6", + "\xE0\xE3" => "\xE9\xA3\xB9", + "\xE0\xE4" => "\xE9\xA6\xAF", + "\xE0\xE5" => "\xE9\xA6\xB2", + "\xE0\xE6" => "\xE9\xA6\xB0", + "\xE0\xE7" => "\xE9\xA6\xB5", + "\xE0\xE8" => "\xE9\xAA\xAD", + "\xE0\xE9" => "\xE9\xAA\xAB", + "\xE0\xEA" => "\xE9\xAD\x9B", + "\xE0\xEB" => "\xE9\xB3\xAA", + "\xE0\xEC" => "\xE9\xB3\xAD", + "\xE0\xED" => "\xE9\xB3\xA7", + "\xE0\xEE" => "\xE9\xBA\x80", + "\xE0\xEF" => "\xE9\xBB\xBD", + "\xE0\xF0" => "\xE5\x83\xA6", + "\xE0\xF1" => "\xE5\x83\x94", + "\xE0\xF2" => "\xE5\x83\x97", + "\xE0\xF3" => "\xE5\x83\xA8", + "\xE0\xF4" => "\xE5\x83\xB3", + "\xE0\xF5" => "\xE5\x83\x9B", + "\xE0\xF6" => "\xE5\x83\xAA", + "\xE0\xF7" => "\xE5\x83\x9D", + "\xE0\xF8" => "\xE5\x83\xA4", + "\xE0\xF9" => "\xE5\x83\x93", + "\xE0\xFA" => "\xE5\x83\xAC", + "\xE0\xFB" => "\xE5\x83\xB0", + "\xE0\xFC" => "\xE5\x83\xAF", + "\xE0\xFD" => "\xE5\x83\xA3", + "\xE0\xFE" => "\xE5\x83\xA0", + "\xE1\x40" => "\xE5\x87\x98", + "\xE1\x41" => "\xE5\x8A\x80", + "\xE1\x42" => "\xE5\x8A\x81", + "\xE1\x43" => "\xE5\x8B\xA9", + "\xE1\x44" => "\xE5\x8B\xAB", + "\xE1\x45" => "\xE5\x8C\xB0", + "\xE1\x46" => "\xE5\x8E\xAC", + "\xE1\x47" => "\xE5\x98\xA7", + "\xE1\x48" => "\xE5\x98\x95", + "\xE1\x49" => "\xE5\x98\x8C", + "\xE1\x4A" => "\xE5\x98\x92", + "\xE1\x4B" => "\xE5\x97\xBC", + "\xE1\x4C" => "\xE5\x98\x8F", + "\xE1\x4D" => "\xE5\x98\x9C", + "\xE1\x4E" => "\xE5\x98\x81", + "\xE1\x4F" => "\xE5\x98\x93", + "\xE1\x50" => "\xE5\x98\x82", + "\xE1\x51" => "\xE5\x97\xBA", + "\xE1\x52" => "\xE5\x98\x9D", + "\xE1\x53" => "\xE5\x98\x84", + "\xE1\x54" => "\xE5\x97\xBF", + "\xE1\x55" => "\xE5\x97\xB9", + "\xE1\x56" => "\xE5\xA2\x89", + "\xE1\x57" => "\xE5\xA1\xBC", + "\xE1\x58" => "\xE5\xA2\x90", + "\xE1\x59" => "\xE5\xA2\x98", + "\xE1\x5A" => "\xE5\xA2\x86", + "\xE1\x5B" => "\xE5\xA2\x81", + "\xE1\x5C" => "\xE5\xA1\xBF", + "\xE1\x5D" => "\xE5\xA1\xB4", + "\xE1\x5E" => "\xE5\xA2\x8B", + "\xE1\x5F" => "\xE5\xA1\xBA", + "\xE1\x60" => "\xE5\xA2\x87", + "\xE1\x61" => "\xE5\xA2\x91", + "\xE1\x62" => "\xE5\xA2\x8E", + "\xE1\x63" => "\xE5\xA1\xB6", + "\xE1\x64" => "\xE5\xA2\x82", + "\xE1\x65" => "\xE5\xA2\x88", + "\xE1\x66" => "\xE5\xA1\xBB", + "\xE1\x67" => "\xE5\xA2\x94", + "\xE1\x68" => "\xE5\xA2\x8F", + "\xE1\x69" => "\xE5\xA3\xBE", + "\xE1\x6A" => "\xE5\xA5\xAB", + "\xE1\x6B" => "\xE5\xAB\x9C", + "\xE1\x6C" => "\xE5\xAB\xAE", + "\xE1\x6D" => "\xE5\xAB\xA5", + "\xE1\x6E" => "\xE5\xAB\x95", + "\xE1\x6F" => "\xE5\xAB\xAA", + "\xE1\x70" => "\xE5\xAB\x9A", + "\xE1\x71" => "\xE5\xAB\xAD", + "\xE1\x72" => "\xE5\xAB\xAB", + "\xE1\x73" => "\xE5\xAB\xB3", + "\xE1\x74" => "\xE5\xAB\xA2", + "\xE1\x75" => "\xE5\xAB\xA0", + "\xE1\x76" => "\xE5\xAB\x9B", + "\xE1\x77" => "\xE5\xAB\xAC", + "\xE1\x78" => "\xE5\xAB\x9E", + "\xE1\x79" => "\xE5\xAB\x9D", + "\xE1\x7A" => "\xE5\xAB\x99", + "\xE1\x7B" => "\xE5\xAB\xA8", + "\xE1\x7C" => "\xE5\xAB\x9F", + "\xE1\x7D" => "\xE5\xAD\xB7", + "\xE1\x7E" => "\xE5\xAF\xA0", + "\xE1\xA1" => "\xE5\xAF\xA3", + "\xE1\xA2" => "\xE5\xB1\xA3", + "\xE1\xA3" => "\xE5\xB6\x82", + "\xE1\xA4" => "\xE5\xB6\x80", + "\xE1\xA5" => "\xE5\xB5\xBD", + "\xE1\xA6" => "\xE5\xB6\x86", + "\xE1\xA7" => "\xE5\xB5\xBA", + "\xE1\xA8" => "\xE5\xB6\x81", + "\xE1\xA9" => "\xE5\xB5\xB7", + "\xE1\xAA" => "\xE5\xB6\x8A", + "\xE1\xAB" => "\xE5\xB6\x89", + "\xE1\xAC" => "\xE5\xB6\x88", + "\xE1\xAD" => "\xE5\xB5\xBE", + "\xE1\xAE" => "\xE5\xB5\xBC", + "\xE1\xAF" => "\xE5\xB6\x8D", + "\xE1\xB0" => "\xE5\xB5\xB9", + "\xE1\xB1" => "\xE5\xB5\xBF", + "\xE1\xB2" => "\xE5\xB9\x98", + "\xE1\xB3" => "\xE5\xB9\x99", + "\xE1\xB4" => "\xE5\xB9\x93", + "\xE1\xB5" => "\xE5\xBB\x98", + "\xE1\xB6" => "\xE5\xBB\x91", + "\xE1\xB7" => "\xE5\xBB\x97", + "\xE1\xB8" => "\xE5\xBB\x8E", + "\xE1\xB9" => "\xE5\xBB\x9C", + "\xE1\xBA" => "\xE5\xBB\x95", + "\xE1\xBB" => "\xE5\xBB\x99", + "\xE1\xBC" => "\xE5\xBB\x92", + "\xE1\xBD" => "\xE5\xBB\x94", + "\xE1\xBE" => "\xE5\xBD\x84", + "\xE1\xBF" => "\xE5\xBD\x83", + "\xE1\xC0" => "\xE5\xBD\xAF", + "\xE1\xC1" => "\xE5\xBE\xB6", + "\xE1\xC2" => "\xE6\x84\xAC", + "\xE1\xC3" => "\xE6\x84\xA8", + "\xE1\xC4" => "\xE6\x85\x81", + "\xE1\xC5" => "\xE6\x85\x9E", + "\xE1\xC6" => "\xE6\x85\xB1", + "\xE1\xC7" => "\xE6\x85\xB3", + "\xE1\xC8" => "\xE6\x85\x92", + "\xE1\xC9" => "\xE6\x85\x93", + "\xE1\xCA" => "\xE6\x85\xB2", + "\xE1\xCB" => "\xE6\x85\xAC", + "\xE1\xCC" => "\xE6\x86\x80", + "\xE1\xCD" => "\xE6\x85\xB4", + "\xE1\xCE" => "\xE6\x85\x94", + "\xE1\xCF" => "\xE6\x85\xBA", + "\xE1\xD0" => "\xE6\x85\x9B", + "\xE1\xD1" => "\xE6\x85\xA5", + "\xE1\xD2" => "\xE6\x84\xBB", + "\xE1\xD3" => "\xE6\x85\xAA", + "\xE1\xD4" => "\xE6\x85\xA1", + "\xE1\xD5" => "\xE6\x85\x96", + "\xE1\xD6" => "\xE6\x88\xA9", + "\xE1\xD7" => "\xE6\x88\xA7", + "\xE1\xD8" => "\xE6\x88\xAB", + "\xE1\xD9" => "\xE6\x90\xAB", + "\xE1\xDA" => "\xE6\x91\x8D", + "\xE1\xDB" => "\xE6\x91\x9B", + "\xE1\xDC" => "\xE6\x91\x9D", + "\xE1\xDD" => "\xE6\x91\xB4", + "\xE1\xDE" => "\xE6\x91\xB6", + "\xE1\xDF" => "\xE6\x91\xB2", + "\xE1\xE0" => "\xE6\x91\xB3", + "\xE1\xE1" => "\xE6\x91\xBD", + "\xE1\xE2" => "\xE6\x91\xB5", + "\xE1\xE3" => "\xE6\x91\xA6", + "\xE1\xE4" => "\xE6\x92\xA6", + "\xE1\xE5" => "\xE6\x91\x8E", + "\xE1\xE6" => "\xE6\x92\x82", + "\xE1\xE7" => "\xE6\x91\x9E", + "\xE1\xE8" => "\xE6\x91\x9C", + "\xE1\xE9" => "\xE6\x91\x8B", + "\xE1\xEA" => "\xE6\x91\x93", + "\xE1\xEB" => "\xE6\x91\xA0", + "\xE1\xEC" => "\xE6\x91\x90", + "\xE1\xED" => "\xE6\x91\xBF", + "\xE1\xEE" => "\xE6\x90\xBF", + "\xE1\xEF" => "\xE6\x91\xAC", + "\xE1\xF0" => "\xE6\x91\xAB", + "\xE1\xF1" => "\xE6\x91\x99", + "\xE1\xF2" => "\xE6\x91\xA5", + "\xE1\xF3" => "\xE6\x91\xB7", + "\xE1\xF4" => "\xE6\x95\xB3", + "\xE1\xF5" => "\xE6\x96\xA0", + "\xE1\xF6" => "\xE6\x9A\xA1", + "\xE1\xF7" => "\xE6\x9A\xA0", + "\xE1\xF8" => "\xE6\x9A\x9F", + "\xE1\xF9" => "\xE6\x9C\x85", + "\xE1\xFA" => "\xE6\x9C\x84", + "\xE1\xFB" => "\xE6\x9C\xA2", + "\xE1\xFC" => "\xE6\xA6\xB1", + "\xE1\xFD" => "\xE6\xA6\xB6", + "\xE1\xFE" => "\xE6\xA7\x89", + "\xE2\x40" => "\xE6\xA6\xA0", + "\xE2\x41" => "\xE6\xA7\x8E", + "\xE2\x42" => "\xE6\xA6\x96", + "\xE2\x43" => "\xE6\xA6\xB0", + "\xE2\x44" => "\xE6\xA6\xAC", + "\xE2\x45" => "\xE6\xA6\xBC", + "\xE2\x46" => "\xE6\xA6\x91", + "\xE2\x47" => "\xE6\xA6\x99", + "\xE2\x48" => "\xE6\xA6\x8E", + "\xE2\x49" => "\xE6\xA6\xA7", + "\xE2\x4A" => "\xE6\xA6\x8D", + "\xE2\x4B" => "\xE6\xA6\xA9", + "\xE2\x4C" => "\xE6\xA6\xBE", + "\xE2\x4D" => "\xE6\xA6\xAF", + "\xE2\x4E" => "\xE6\xA6\xBF", + "\xE2\x4F" => "\xE6\xA7\x84", + "\xE2\x50" => "\xE6\xA6\xBD", + "\xE2\x51" => "\xE6\xA6\xA4", + "\xE2\x52" => "\xE6\xA7\x94", + "\xE2\x53" => "\xE6\xA6\xB9", + "\xE2\x54" => "\xE6\xA7\x8A", + "\xE2\x55" => "\xE6\xA6\x9A", + "\xE2\x56" => "\xE6\xA7\x8F", + "\xE2\x57" => "\xE6\xA6\xB3", + "\xE2\x58" => "\xE6\xA6\x93", + "\xE2\x59" => "\xE6\xA6\xAA", + "\xE2\x5A" => "\xE6\xA6\xA1", + "\xE2\x5B" => "\xE6\xA6\x9E", + "\xE2\x5C" => "\xE6\xA7\x99", + "\xE2\x5D" => "\xE6\xA6\x97", + "\xE2\x5E" => "\xE6\xA6\x90", + "\xE2\x5F" => "\xE6\xA7\x82", + "\xE2\x60" => "\xE6\xA6\xB5", + "\xE2\x61" => "\xE6\xA6\xA5", + "\xE2\x62" => "\xE6\xA7\x86", + "\xE2\x63" => "\xE6\xAD\x8A", + "\xE2\x64" => "\xE6\xAD\x8D", + "\xE2\x65" => "\xE6\xAD\x8B", + "\xE2\x66" => "\xE6\xAE\x9E", + "\xE2\x67" => "\xE6\xAE\x9F", + "\xE2\x68" => "\xE6\xAE\xA0", + "\xE2\x69" => "\xE6\xAF\x83", + "\xE2\x6A" => "\xE6\xAF\x84", + "\xE2\x6B" => "\xE6\xAF\xBE", + "\xE2\x6C" => "\xE6\xBB\x8E", + "\xE2\x6D" => "\xE6\xBB\xB5", + "\xE2\x6E" => "\xE6\xBB\xB1", + "\xE2\x6F" => "\xE6\xBC\x83", + "\xE2\x70" => "\xE6\xBC\xA5", + "\xE2\x71" => "\xE6\xBB\xB8", + "\xE2\x72" => "\xE6\xBC\xB7", + "\xE2\x73" => "\xE6\xBB\xBB", + "\xE2\x74" => "\xE6\xBC\xAE", + "\xE2\x75" => "\xE6\xBC\x89", + "\xE2\x76" => "\xE6\xBD\x8E", + "\xE2\x77" => "\xE6\xBC\x99", + "\xE2\x78" => "\xE6\xBC\x9A", + "\xE2\x79" => "\xE6\xBC\xA7", + "\xE2\x7A" => "\xE6\xBC\x98", + "\xE2\x7B" => "\xE6\xBC\xBB", + "\xE2\x7C" => "\xE6\xBC\x92", + "\xE2\x7D" => "\xE6\xBB\xAD", + "\xE2\x7E" => "\xE6\xBC\x8A", + "\xE2\xA1" => "\xE6\xBC\xB6", + "\xE2\xA2" => "\xE6\xBD\xB3", + "\xE2\xA3" => "\xE6\xBB\xB9", + "\xE2\xA4" => "\xE6\xBB\xAE", + "\xE2\xA5" => "\xE6\xBC\xAD", + "\xE2\xA6" => "\xE6\xBD\x80", + "\xE2\xA7" => "\xE6\xBC\xB0", + "\xE2\xA8" => "\xE6\xBC\xBC", + "\xE2\xA9" => "\xE6\xBC\xB5", + "\xE2\xAA" => "\xE6\xBB\xAB", + "\xE2\xAB" => "\xE6\xBC\x87", + "\xE2\xAC" => "\xE6\xBC\x8E", + "\xE2\xAD" => "\xE6\xBD\x83", + "\xE2\xAE" => "\xE6\xBC\x85", + "\xE2\xAF" => "\xE6\xBB\xBD", + "\xE2\xB0" => "\xE6\xBB\xB6", + "\xE2\xB1" => "\xE6\xBC\xB9", + "\xE2\xB2" => "\xE6\xBC\x9C", + "\xE2\xB3" => "\xE6\xBB\xBC", + "\xE2\xB4" => "\xE6\xBC\xBA", + "\xE2\xB5" => "\xE6\xBC\x9F", + "\xE2\xB6" => "\xE6\xBC\x8D", + "\xE2\xB7" => "\xE6\xBC\x9E", + "\xE2\xB8" => "\xE6\xBC\x88", + "\xE2\xB9" => "\xE6\xBC\xA1", + "\xE2\xBA" => "\xE7\x86\x87", + "\xE2\xBB" => "\xE7\x86\x90", + "\xE2\xBC" => "\xE7\x86\x89", + "\xE2\xBD" => "\xE7\x86\x80", + "\xE2\xBE" => "\xE7\x86\x85", + "\xE2\xBF" => "\xE7\x86\x82", + "\xE2\xC0" => "\xE7\x86\x8F", + "\xE2\xC1" => "\xE7\x85\xBB", + "\xE2\xC2" => "\xE7\x86\x86", + "\xE2\xC3" => "\xE7\x86\x81", + "\xE2\xC4" => "\xE7\x86\x97", + "\xE2\xC5" => "\xE7\x89\x84", + "\xE2\xC6" => "\xE7\x89\x93", + "\xE2\xC7" => "\xE7\x8A\x97", + "\xE2\xC8" => "\xE7\x8A\x95", + "\xE2\xC9" => "\xE7\x8A\x93", + "\xE2\xCA" => "\xE7\x8D\x83", + "\xE2\xCB" => "\xE7\x8D\x8D", + "\xE2\xCC" => "\xE7\x8D\x91", + "\xE2\xCD" => "\xE7\x8D\x8C", + "\xE2\xCE" => "\xE7\x91\xA2", + "\xE2\xCF" => "\xE7\x91\xB3", + "\xE2\xD0" => "\xE7\x91\xB1", + "\xE2\xD1" => "\xE7\x91\xB5", + "\xE2\xD2" => "\xE7\x91\xB2", + "\xE2\xD3" => "\xE7\x91\xA7", + "\xE2\xD4" => "\xE7\x91\xAE", + "\xE2\xD5" => "\xE7\x94\x80", + "\xE2\xD6" => "\xE7\x94\x82", + "\xE2\xD7" => "\xE7\x94\x83", + "\xE2\xD8" => "\xE7\x95\xBD", + "\xE2\xD9" => "\xE7\x96\x90", + "\xE2\xDA" => "\xE7\x98\x96", + "\xE2\xDB" => "\xE7\x98\x88", + "\xE2\xDC" => "\xE7\x98\x8C", + "\xE2\xDD" => "\xE7\x98\x95", + "\xE2\xDE" => "\xE7\x98\x91", + "\xE2\xDF" => "\xE7\x98\x8A", + "\xE2\xE0" => "\xE7\x98\x94", + "\xE2\xE1" => "\xE7\x9A\xB8", + "\xE2\xE2" => "\xE7\x9E\x81", + "\xE2\xE3" => "\xE7\x9D\xBC", + "\xE2\xE4" => "\xE7\x9E\x85", + "\xE2\xE5" => "\xE7\x9E\x82", + "\xE2\xE6" => "\xE7\x9D\xAE", + "\xE2\xE7" => "\xE7\x9E\x80", + "\xE2\xE8" => "\xE7\x9D\xAF", + "\xE2\xE9" => "\xE7\x9D\xBE", + "\xE2\xEA" => "\xE7\x9E\x83", + "\xE2\xEB" => "\xE7\xA2\xB2", + "\xE2\xEC" => "\xE7\xA2\xAA", + "\xE2\xED" => "\xE7\xA2\xB4", + "\xE2\xEE" => "\xE7\xA2\xAD", + "\xE2\xEF" => "\xE7\xA2\xA8", + "\xE2\xF0" => "\xE7\xA1\xBE", + "\xE2\xF1" => "\xE7\xA2\xAB", + "\xE2\xF2" => "\xE7\xA2\x9E", + "\xE2\xF3" => "\xE7\xA2\xA5", + "\xE2\xF4" => "\xE7\xA2\xA0", + "\xE2\xF5" => "\xE7\xA2\xAC", + "\xE2\xF6" => "\xE7\xA2\xA2", + "\xE2\xF7" => "\xE7\xA2\xA4", + "\xE2\xF8" => "\xE7\xA6\x98", + "\xE2\xF9" => "\xE7\xA6\x8A", + "\xE2\xFA" => "\xE7\xA6\x8B", + "\xE2\xFB" => "\xE7\xA6\x96", + "\xE2\xFC" => "\xE7\xA6\x95", + "\xE2\xFD" => "\xE7\xA6\x94", + "\xE2\xFE" => "\xE7\xA6\x93", + "\xE3\x40" => "\xE7\xA6\x97", + "\xE3\x41" => "\xE7\xA6\x88", + "\xE3\x42" => "\xE7\xA6\x92", + "\xE3\x43" => "\xE7\xA6\x90", + "\xE3\x44" => "\xE7\xA8\xAB", + "\xE3\x45" => "\xE7\xA9\x8A", + "\xE3\x46" => "\xE7\xA8\xB0", + "\xE3\x47" => "\xE7\xA8\xAF", + "\xE3\x48" => "\xE7\xA8\xA8", + "\xE3\x49" => "\xE7\xA8\xA6", + "\xE3\x4A" => "\xE7\xAA\xA8", + "\xE3\x4B" => "\xE7\xAA\xAB", + "\xE3\x4C" => "\xE7\xAA\xAC", + "\xE3\x4D" => "\xE7\xAB\xAE", + "\xE3\x4E" => "\xE7\xAE\x88", + "\xE3\x4F" => "\xE7\xAE\x9C", + "\xE3\x50" => "\xE7\xAE\x8A", + "\xE3\x51" => "\xE7\xAE\x91", + "\xE3\x52" => "\xE7\xAE\x90", + "\xE3\x53" => "\xE7\xAE\x96", + "\xE3\x54" => "\xE7\xAE\x8D", + "\xE3\x55" => "\xE7\xAE\x8C", + "\xE3\x56" => "\xE7\xAE\x9B", + "\xE3\x57" => "\xE7\xAE\x8E", + "\xE3\x58" => "\xE7\xAE\x85", + "\xE3\x59" => "\xE7\xAE\x98", + "\xE3\x5A" => "\xE5\x8A\x84", + "\xE3\x5B" => "\xE7\xAE\x99", + "\xE3\x5C" => "\xE7\xAE\xA4", + "\xE3\x5D" => "\xE7\xAE\x82", + "\xE3\x5E" => "\xE7\xB2\xBB", + "\xE3\x5F" => "\xE7\xB2\xBF", + "\xE3\x60" => "\xE7\xB2\xBC", + "\xE3\x61" => "\xE7\xB2\xBA", + "\xE3\x62" => "\xE7\xB6\xA7", + "\xE3\x63" => "\xE7\xB6\xB7", + "\xE3\x64" => "\xE7\xB7\x82", + "\xE3\x65" => "\xE7\xB6\xA3", + "\xE3\x66" => "\xE7\xB6\xAA", + "\xE3\x67" => "\xE7\xB7\x81", + "\xE3\x68" => "\xE7\xB7\x80", + "\xE3\x69" => "\xE7\xB7\x85", + "\xE3\x6A" => "\xE7\xB6\x9D", + "\xE3\x6B" => "\xE7\xB7\x8E", + "\xE3\x6C" => "\xE7\xB7\x84", + "\xE3\x6D" => "\xE7\xB7\x86", + "\xE3\x6E" => "\xE7\xB7\x8B", + "\xE3\x6F" => "\xE7\xB7\x8C", + "\xE3\x70" => "\xE7\xB6\xAF", + "\xE3\x71" => "\xE7\xB6\xB9", + "\xE3\x72" => "\xE7\xB6\x96", + "\xE3\x73" => "\xE7\xB6\xBC", + "\xE3\x74" => "\xE7\xB6\x9F", + "\xE3\x75" => "\xE7\xB6\xA6", + "\xE3\x76" => "\xE7\xB6\xAE", + "\xE3\x77" => "\xE7\xB6\xA9", + "\xE3\x78" => "\xE7\xB6\xA1", + "\xE3\x79" => "\xE7\xB7\x89", + "\xE3\x7A" => "\xE7\xBD\xB3", + "\xE3\x7B" => "\xE7\xBF\xA2", + "\xE3\x7C" => "\xE7\xBF\xA3", + "\xE3\x7D" => "\xE7\xBF\xA5", + "\xE3\x7E" => "\xE7\xBF\x9E", + "\xE3\xA1" => "\xE8\x80\xA4", + "\xE3\xA2" => "\xE8\x81\x9D", + "\xE3\xA3" => "\xE8\x81\x9C", + "\xE3\xA4" => "\xE8\x86\x89", + "\xE3\xA5" => "\xE8\x86\x86", + "\xE3\xA6" => "\xE8\x86\x83", + "\xE3\xA7" => "\xE8\x86\x87", + "\xE3\xA8" => "\xE8\x86\x8D", + "\xE3\xA9" => "\xE8\x86\x8C", + "\xE3\xAA" => "\xE8\x86\x8B", + "\xE3\xAB" => "\xE8\x88\x95", + "\xE3\xAC" => "\xE8\x92\x97", + "\xE3\xAD" => "\xE8\x92\xA4", + "\xE3\xAE" => "\xE8\x92\xA1", + "\xE3\xAF" => "\xE8\x92\x9F", + "\xE3\xB0" => "\xE8\x92\xBA", + "\xE3\xB1" => "\xE8\x93\x8E", + "\xE3\xB2" => "\xE8\x93\x82", + "\xE3\xB3" => "\xE8\x92\xAC", + "\xE3\xB4" => "\xE8\x92\xAE", + "\xE3\xB5" => "\xE8\x92\xAB", + "\xE3\xB6" => "\xE8\x92\xB9", + "\xE3\xB7" => "\xE8\x92\xB4", + "\xE3\xB8" => "\xE8\x93\x81", + "\xE3\xB9" => "\xE8\x93\x8D", + "\xE3\xBA" => "\xE8\x92\xAA", + "\xE3\xBB" => "\xE8\x92\x9A", + "\xE3\xBC" => "\xE8\x92\xB1", + "\xE3\xBD" => "\xE8\x93\x90", + "\xE3\xBE" => "\xE8\x92\x9D", + "\xE3\xBF" => "\xE8\x92\xA7", + "\xE3\xC0" => "\xE8\x92\xBB", + "\xE3\xC1" => "\xE8\x92\xA2", + "\xE3\xC2" => "\xE8\x92\x94", + "\xE3\xC3" => "\xE8\x93\x87", + "\xE3\xC4" => "\xE8\x93\x8C", + "\xE3\xC5" => "\xE8\x92\x9B", + "\xE3\xC6" => "\xE8\x92\xA9", + "\xE3\xC7" => "\xE8\x92\xAF", + "\xE3\xC8" => "\xE8\x92\xA8", + "\xE3\xC9" => "\xE8\x93\x96", + "\xE3\xCA" => "\xE8\x92\x98", + "\xE3\xCB" => "\xE8\x92\xB6", + "\xE3\xCC" => "\xE8\x93\x8F", + "\xE3\xCD" => "\xE8\x92\xA0", + "\xE3\xCE" => "\xE8\x93\x97", + "\xE3\xCF" => "\xE8\x93\x94", + "\xE3\xD0" => "\xE8\x93\x92", + "\xE3\xD1" => "\xE8\x93\x9B", + "\xE3\xD2" => "\xE8\x92\xB0", + "\xE3\xD3" => "\xE8\x92\x91", + "\xE3\xD4" => "\xE8\x99\xA1", + "\xE3\xD5" => "\xE8\x9C\xB3", + "\xE3\xD6" => "\xE8\x9C\xA3", + "\xE3\xD7" => "\xE8\x9C\xA8", + "\xE3\xD8" => "\xE8\x9D\xAB", + "\xE3\xD9" => "\xE8\x9D\x80", + "\xE3\xDA" => "\xE8\x9C\xAE", + "\xE3\xDB" => "\xE8\x9C\x9E", + "\xE3\xDC" => "\xE8\x9C\xA1", + "\xE3\xDD" => "\xE8\x9C\x99", + "\xE3\xDE" => "\xE8\x9C\x9B", + "\xE3\xDF" => "\xE8\x9D\x83", + "\xE3\xE0" => "\xE8\x9C\xAC", + "\xE3\xE1" => "\xE8\x9D\x81", + "\xE3\xE2" => "\xE8\x9C\xBE", + "\xE3\xE3" => "\xE8\x9D\x86", + "\xE3\xE4" => "\xE8\x9C\xA0", + "\xE3\xE5" => "\xE8\x9C\xB2", + "\xE3\xE6" => "\xE8\x9C\xAA", + "\xE3\xE7" => "\xE8\x9C\xAD", + "\xE3\xE8" => "\xE8\x9C\xBC", + "\xE3\xE9" => "\xE8\x9C\x92", + "\xE3\xEA" => "\xE8\x9C\xBA", + "\xE3\xEB" => "\xE8\x9C\xB1", + "\xE3\xEC" => "\xE8\x9C\xB5", + "\xE3\xED" => "\xE8\x9D\x82", + "\xE3\xEE" => "\xE8\x9C\xA6", + "\xE3\xEF" => "\xE8\x9C\xA7", + "\xE3\xF0" => "\xE8\x9C\xB8", + "\xE3\xF1" => "\xE8\x9C\xA4", + "\xE3\xF2" => "\xE8\x9C\x9A", + "\xE3\xF3" => "\xE8\x9C\xB0", + "\xE3\xF4" => "\xE8\x9C\x91", + "\xE3\xF5" => "\xE8\xA3\xB7", + "\xE3\xF6" => "\xE8\xA3\xA7", + "\xE3\xF7" => "\xE8\xA3\xB1", + "\xE3\xF8" => "\xE8\xA3\xB2", + "\xE3\xF9" => "\xE8\xA3\xBA", + "\xE3\xFA" => "\xE8\xA3\xBE", + "\xE3\xFB" => "\xE8\xA3\xAE", + "\xE3\xFC" => "\xE8\xA3\xBC", + "\xE3\xFD" => "\xE8\xA3\xB6", + "\xE3\xFE" => "\xE8\xA3\xBB", + "\xE4\x40" => "\xE8\xA3\xB0", + "\xE4\x41" => "\xE8\xA3\xAC", + "\xE4\x42" => "\xE8\xA3\xAB", + "\xE4\x43" => "\xE8\xA6\x9D", + "\xE4\x44" => "\xE8\xA6\xA1", + "\xE4\x45" => "\xE8\xA6\x9F", + "\xE4\x46" => "\xE8\xA6\x9E", + "\xE4\x47" => "\xE8\xA7\xA9", + "\xE4\x48" => "\xE8\xA7\xAB", + "\xE4\x49" => "\xE8\xA7\xA8", + "\xE4\x4A" => "\xE8\xAA\xAB", + "\xE4\x4B" => "\xE8\xAA\x99", + "\xE4\x4C" => "\xE8\xAA\x8B", + "\xE4\x4D" => "\xE8\xAA\x92", + "\xE4\x4E" => "\xE8\xAA\x8F", + "\xE4\x4F" => "\xE8\xAA\x96", + "\xE4\x50" => "\xE8\xB0\xBD", + "\xE4\x51" => "\xE8\xB1\xA8", + "\xE4\x52" => "\xE8\xB1\xA9", + "\xE4\x53" => "\xE8\xB3\x95", + "\xE4\x54" => "\xE8\xB3\x8F", + "\xE4\x55" => "\xE8\xB3\x97", + "\xE4\x56" => "\xE8\xB6\x96", + "\xE4\x57" => "\xE8\xB8\x89", + "\xE4\x58" => "\xE8\xB8\x82", + "\xE4\x59" => "\xE8\xB7\xBF", + "\xE4\x5A" => "\xE8\xB8\x8D", + "\xE4\x5B" => "\xE8\xB7\xBD", + "\xE4\x5C" => "\xE8\xB8\x8A", + "\xE4\x5D" => "\xE8\xB8\x83", + "\xE4\x5E" => "\xE8\xB8\x87", + "\xE4\x5F" => "\xE8\xB8\x86", + "\xE4\x60" => "\xE8\xB8\x85", + "\xE4\x61" => "\xE8\xB7\xBE", + "\xE4\x62" => "\xE8\xB8\x80", + "\xE4\x63" => "\xE8\xB8\x84", + "\xE4\x64" => "\xE8\xBC\x90", + "\xE4\x65" => "\xE8\xBC\x91", + "\xE4\x66" => "\xE8\xBC\x8E", + "\xE4\x67" => "\xE8\xBC\x8D", + "\xE4\x68" => "\xE9\x84\xA3", + "\xE4\x69" => "\xE9\x84\x9C", + "\xE4\x6A" => "\xE9\x84\xA0", + "\xE4\x6B" => "\xE9\x84\xA2", + "\xE4\x6C" => "\xE9\x84\x9F", + "\xE4\x6D" => "\xE9\x84\x9D", + "\xE4\x6E" => "\xE9\x84\x9A", + "\xE4\x6F" => "\xE9\x84\xA4", + "\xE4\x70" => "\xE9\x84\xA1", + "\xE4\x71" => "\xE9\x84\x9B", + "\xE4\x72" => "\xE9\x85\xBA", + "\xE4\x73" => "\xE9\x85\xB2", + "\xE4\x74" => "\xE9\x85\xB9", + "\xE4\x75" => "\xE9\x85\xB3", + "\xE4\x76" => "\xE9\x8A\xA5", + "\xE4\x77" => "\xE9\x8A\xA4", + "\xE4\x78" => "\xE9\x89\xB6", + "\xE4\x79" => "\xE9\x8A\x9B", + "\xE4\x7A" => "\xE9\x89\xBA", + "\xE4\x7B" => "\xE9\x8A\xA0", + "\xE4\x7C" => "\xE9\x8A\x94", + "\xE4\x7D" => "\xE9\x8A\xAA", + "\xE4\x7E" => "\xE9\x8A\x8D", + "\xE4\xA1" => "\xE9\x8A\xA6", + "\xE4\xA2" => "\xE9\x8A\x9A", + "\xE4\xA3" => "\xE9\x8A\xAB", + "\xE4\xA4" => "\xE9\x89\xB9", + "\xE4\xA5" => "\xE9\x8A\x97", + "\xE4\xA6" => "\xE9\x89\xBF", + "\xE4\xA7" => "\xE9\x8A\xA3", + "\xE4\xA8" => "\xE9\x8B\xAE", + "\xE4\xA9" => "\xE9\x8A\x8E", + "\xE4\xAA" => "\xE9\x8A\x82", + "\xE4\xAB" => "\xE9\x8A\x95", + "\xE4\xAC" => "\xE9\x8A\xA2", + "\xE4\xAD" => "\xE9\x89\xBD", + "\xE4\xAE" => "\xE9\x8A\x88", + "\xE4\xAF" => "\xE9\x8A\xA1", + "\xE4\xB0" => "\xE9\x8A\x8A", + "\xE4\xB1" => "\xE9\x8A\x86", + "\xE4\xB2" => "\xE9\x8A\x8C", + "\xE4\xB3" => "\xE9\x8A\x99", + "\xE4\xB4" => "\xE9\x8A\xA7", + "\xE4\xB5" => "\xE9\x89\xBE", + "\xE4\xB6" => "\xE9\x8A\x87", + "\xE4\xB7" => "\xE9\x8A\xA9", + "\xE4\xB8" => "\xE9\x8A\x9D", + "\xE4\xB9" => "\xE9\x8A\x8B", + "\xE4\xBA" => "\xE9\x88\xAD", + "\xE4\xBB" => "\xE9\x9A\x9E", + "\xE4\xBC" => "\xE9\x9A\xA1", + "\xE4\xBD" => "\xE9\x9B\xBF", + "\xE4\xBE" => "\xE9\x9D\x98", + "\xE4\xBF" => "\xE9\x9D\xBD", + "\xE4\xC0" => "\xE9\x9D\xBA", + "\xE4\xC1" => "\xE9\x9D\xBE", + "\xE4\xC2" => "\xE9\x9E\x83", + "\xE4\xC3" => "\xE9\x9E\x80", + "\xE4\xC4" => "\xE9\x9E\x82", + "\xE4\xC5" => "\xE9\x9D\xBB", + "\xE4\xC6" => "\xE9\x9E\x84", + "\xE4\xC7" => "\xE9\x9E\x81", + "\xE4\xC8" => "\xE9\x9D\xBF", + "\xE4\xC9" => "\xE9\x9F\x8E", + "\xE4\xCA" => "\xE9\x9F\x8D", + "\xE4\xCB" => "\xE9\xA0\x96", + "\xE4\xCC" => "\xE9\xA2\xAD", + "\xE4\xCD" => "\xE9\xA2\xAE", + "\xE4\xCE" => "\xE9\xA4\x82", + "\xE4\xCF" => "\xE9\xA4\x80", + "\xE4\xD0" => "\xE9\xA4\x87", + "\xE4\xD1" => "\xE9\xA6\x9D", + "\xE4\xD2" => "\xE9\xA6\x9C", + "\xE4\xD3" => "\xE9\xA7\x83", + "\xE4\xD4" => "\xE9\xA6\xB9", + "\xE4\xD5" => "\xE9\xA6\xBB", + "\xE4\xD6" => "\xE9\xA6\xBA", + "\xE4\xD7" => "\xE9\xA7\x82", + "\xE4\xD8" => "\xE9\xA6\xBD", + "\xE4\xD9" => "\xE9\xA7\x87", + "\xE4\xDA" => "\xE9\xAA\xB1", + "\xE4\xDB" => "\xE9\xAB\xA3", + "\xE4\xDC" => "\xE9\xAB\xA7", + "\xE4\xDD" => "\xE9\xAC\xBE", + "\xE4\xDE" => "\xE9\xAC\xBF", + "\xE4\xDF" => "\xE9\xAD\xA0", + "\xE4\xE0" => "\xE9\xAD\xA1", + "\xE4\xE1" => "\xE9\xAD\x9F", + "\xE4\xE2" => "\xE9\xB3\xB1", + "\xE4\xE3" => "\xE9\xB3\xB2", + "\xE4\xE4" => "\xE9\xB3\xB5", + "\xE4\xE5" => "\xE9\xBA\xA7", + "\xE4\xE6" => "\xE5\x83\xBF", + "\xE4\xE7" => "\xE5\x84\x83", + "\xE4\xE8" => "\xE5\x84\xB0", + "\xE4\xE9" => "\xE5\x83\xB8", + "\xE4\xEA" => "\xE5\x84\x86", + "\xE4\xEB" => "\xE5\x84\x87", + "\xE4\xEC" => "\xE5\x83\xB6", + "\xE4\xED" => "\xE5\x83\xBE", + "\xE4\xEE" => "\xE5\x84\x8B", + "\xE4\xEF" => "\xE5\x84\x8C", + "\xE4\xF0" => "\xE5\x83\xBD", + "\xE4\xF1" => "\xE5\x84\x8A", + "\xE4\xF2" => "\xE5\x8A\x8B", + "\xE4\xF3" => "\xE5\x8A\x8C", + "\xE4\xF4" => "\xE5\x8B\xB1", + "\xE4\xF5" => "\xE5\x8B\xAF", + "\xE4\xF6" => "\xE5\x99\x88", + "\xE4\xF7" => "\xE5\x99\x82", + "\xE4\xF8" => "\xE5\x99\x8C", + "\xE4\xF9" => "\xE5\x98\xB5", + "\xE4\xFA" => "\xE5\x99\x81", + "\xE4\xFB" => "\xE5\x99\x8A", + "\xE4\xFC" => "\xE5\x99\x89", + "\xE4\xFD" => "\xE5\x99\x86", + "\xE4\xFE" => "\xE5\x99\x98", + "\xE5\x40" => "\xE5\x99\x9A", + "\xE5\x41" => "\xE5\x99\x80", + "\xE5\x42" => "\xE5\x98\xB3", + "\xE5\x43" => "\xE5\x98\xBD", + "\xE5\x44" => "\xE5\x98\xAC", + "\xE5\x45" => "\xE5\x98\xBE", + "\xE5\x46" => "\xE5\x98\xB8", + "\xE5\x47" => "\xE5\x98\xAA", + "\xE5\x48" => "\xE5\x98\xBA", + "\xE5\x49" => "\xE5\x9C\x9A", + "\xE5\x4A" => "\xE5\xA2\xAB", + "\xE5\x4B" => "\xE5\xA2\x9D", + "\xE5\x4C" => "\xE5\xA2\xB1", + "\xE5\x4D" => "\xE5\xA2\xA0", + "\xE5\x4E" => "\xE5\xA2\xA3", + "\xE5\x4F" => "\xE5\xA2\xAF", + "\xE5\x50" => "\xE5\xA2\xAC", + "\xE5\x51" => "\xE5\xA2\xA5", + "\xE5\x52" => "\xE5\xA2\xA1", + "\xE5\x53" => "\xE5\xA3\xBF", + "\xE5\x54" => "\xE5\xAB\xBF", + "\xE5\x55" => "\xE5\xAB\xB4", + "\xE5\x56" => "\xE5\xAB\xBD", + "\xE5\x57" => "\xE5\xAB\xB7", + "\xE5\x58" => "\xE5\xAB\xB6", + "\xE5\x59" => "\xE5\xAC\x83", + "\xE5\x5A" => "\xE5\xAB\xB8", + "\xE5\x5B" => "\xE5\xAC\x82", + "\xE5\x5C" => "\xE5\xAB\xB9", + "\xE5\x5D" => "\xE5\xAC\x81", + "\xE5\x5E" => "\xE5\xAC\x87", + "\xE5\x5F" => "\xE5\xAC\x85", + "\xE5\x60" => "\xE5\xAC\x8F", + "\xE5\x61" => "\xE5\xB1\xA7", + "\xE5\x62" => "\xE5\xB6\x99", + "\xE5\x63" => "\xE5\xB6\x97", + "\xE5\x64" => "\xE5\xB6\x9F", + "\xE5\x65" => "\xE5\xB6\x92", + "\xE5\x66" => "\xE5\xB6\xA2", + "\xE5\x67" => "\xE5\xB6\x93", + "\xE5\x68" => "\xE5\xB6\x95", + "\xE5\x69" => "\xE5\xB6\xA0", + "\xE5\x6A" => "\xE5\xB6\x9C", + "\xE5\x6B" => "\xE5\xB6\xA1", + "\xE5\x6C" => "\xE5\xB6\x9A", + "\xE5\x6D" => "\xE5\xB6\x9E", + "\xE5\x6E" => "\xE5\xB9\xA9", + "\xE5\x6F" => "\xE5\xB9\x9D", + "\xE5\x70" => "\xE5\xB9\xA0", + "\xE5\x71" => "\xE5\xB9\x9C", + "\xE5\x72" => "\xE7\xB7\xB3", + "\xE5\x73" => "\xE5\xBB\x9B", + "\xE5\x74" => "\xE5\xBB\x9E", + "\xE5\x75" => "\xE5\xBB\xA1", + "\xE5\x76" => "\xE5\xBD\x89", + "\xE5\x77" => "\xE5\xBE\xB2", + "\xE5\x78" => "\xE6\x86\x8B", + "\xE5\x79" => "\xE6\x86\x83", + "\xE5\x7A" => "\xE6\x85\xB9", + "\xE5\x7B" => "\xE6\x86\xB1", + "\xE5\x7C" => "\xE6\x86\xB0", + "\xE5\x7D" => "\xE6\x86\xA2", + "\xE5\x7E" => "\xE6\x86\x89", + "\xE5\xA1" => "\xE6\x86\x9B", + "\xE5\xA2" => "\xE6\x86\x93", + "\xE5\xA3" => "\xE6\x86\xAF", + "\xE5\xA4" => "\xE6\x86\xAD", + "\xE5\xA5" => "\xE6\x86\x9F", + "\xE5\xA6" => "\xE6\x86\x92", + "\xE5\xA7" => "\xE6\x86\xAA", + "\xE5\xA8" => "\xE6\x86\xA1", + "\xE5\xA9" => "\xE6\x86\x8D", + "\xE5\xAA" => "\xE6\x85\xA6", + "\xE5\xAB" => "\xE6\x86\xB3", + "\xE5\xAC" => "\xE6\x88\xAD", + "\xE5\xAD" => "\xE6\x91\xAE", + "\xE5\xAE" => "\xE6\x91\xB0", + "\xE5\xAF" => "\xE6\x92\x96", + "\xE5\xB0" => "\xE6\x92\xA0", + "\xE5\xB1" => "\xE6\x92\x85", + "\xE5\xB2" => "\xE6\x92\x97", + "\xE5\xB3" => "\xE6\x92\x9C", + "\xE5\xB4" => "\xE6\x92\x8F", + "\xE5\xB5" => "\xE6\x92\x8B", + "\xE5\xB6" => "\xE6\x92\x8A", + "\xE5\xB7" => "\xE6\x92\x8C", + "\xE5\xB8" => "\xE6\x92\xA3", + "\xE5\xB9" => "\xE6\x92\x9F", + "\xE5\xBA" => "\xE6\x91\xA8", + "\xE5\xBB" => "\xE6\x92\xB1", + "\xE5\xBC" => "\xE6\x92\x98", + "\xE5\xBD" => "\xE6\x95\xB6", + "\xE5\xBE" => "\xE6\x95\xBA", + "\xE5\xBF" => "\xE6\x95\xB9", + "\xE5\xC0" => "\xE6\x95\xBB", + "\xE5\xC1" => "\xE6\x96\xB2", + "\xE5\xC2" => "\xE6\x96\xB3", + "\xE5\xC3" => "\xE6\x9A\xB5", + "\xE5\xC4" => "\xE6\x9A\xB0", + "\xE5\xC5" => "\xE6\x9A\xA9", + "\xE5\xC6" => "\xE6\x9A\xB2", + "\xE5\xC7" => "\xE6\x9A\xB7", + "\xE5\xC8" => "\xE6\x9A\xAA", + "\xE5\xC9" => "\xE6\x9A\xAF", + "\xE5\xCA" => "\xE6\xA8\x80", + "\xE5\xCB" => "\xE6\xA8\x86", + "\xE5\xCC" => "\xE6\xA8\x97", + "\xE5\xCD" => "\xE6\xA7\xA5", + "\xE5\xCE" => "\xE6\xA7\xB8", + "\xE5\xCF" => "\xE6\xA8\x95", + "\xE5\xD0" => "\xE6\xA7\xB1", + "\xE5\xD1" => "\xE6\xA7\xA4", + "\xE5\xD2" => "\xE6\xA8\xA0", + "\xE5\xD3" => "\xE6\xA7\xBF", + "\xE5\xD4" => "\xE6\xA7\xAC", + "\xE5\xD5" => "\xE6\xA7\xA2", + "\xE5\xD6" => "\xE6\xA8\x9B", + "\xE5\xD7" => "\xE6\xA8\x9D", + "\xE5\xD8" => "\xE6\xA7\xBE", + "\xE5\xD9" => "\xE6\xA8\xA7", + "\xE5\xDA" => "\xE6\xA7\xB2", + "\xE5\xDB" => "\xE6\xA7\xAE", + "\xE5\xDC" => "\xE6\xA8\x94", + "\xE5\xDD" => "\xE6\xA7\xB7", + "\xE5\xDE" => "\xE6\xA7\xA7", + "\xE5\xDF" => "\xE6\xA9\x80", + "\xE5\xE0" => "\xE6\xA8\x88", + "\xE5\xE1" => "\xE6\xA7\xA6", + "\xE5\xE2" => "\xE6\xA7\xBB", + "\xE5\xE3" => "\xE6\xA8\x8D", + "\xE5\xE4" => "\xE6\xA7\xBC", + "\xE5\xE5" => "\xE6\xA7\xAB", + "\xE5\xE6" => "\xE6\xA8\x89", + "\xE5\xE7" => "\xE6\xA8\x84", + "\xE5\xE8" => "\xE6\xA8\x98", + "\xE5\xE9" => "\xE6\xA8\xA5", + "\xE5\xEA" => "\xE6\xA8\x8F", + "\xE5\xEB" => "\xE6\xA7\xB6", + "\xE5\xEC" => "\xE6\xA8\xA6", + "\xE5\xED" => "\xE6\xA8\x87", + "\xE5\xEE" => "\xE6\xA7\xB4", + "\xE5\xEF" => "\xE6\xA8\x96", + "\xE5\xF0" => "\xE6\xAD\x91", + "\xE5\xF1" => "\xE6\xAE\xA5", + "\xE5\xF2" => "\xE6\xAE\xA3", + "\xE5\xF3" => "\xE6\xAE\xA2", + "\xE5\xF4" => "\xE6\xAE\xA6", + "\xE5\xF5" => "\xE6\xB0\x81", + "\xE5\xF6" => "\xE6\xB0\x80", + "\xE5\xF7" => "\xE6\xAF\xBF", + "\xE5\xF8" => "\xE6\xB0\x82", + "\xE5\xF9" => "\xE6\xBD\x81", + "\xE5\xFA" => "\xE6\xBC\xA6", + "\xE5\xFB" => "\xE6\xBD\xBE", + "\xE5\xFC" => "\xE6\xBE\x87", + "\xE5\xFD" => "\xE6\xBF\x86", + "\xE5\xFE" => "\xE6\xBE\x92", + "\xE6\x40" => "\xE6\xBE\x8D", + "\xE6\x41" => "\xE6\xBE\x89", + "\xE6\x42" => "\xE6\xBE\x8C", + "\xE6\x43" => "\xE6\xBD\xA2", + "\xE6\x44" => "\xE6\xBD\x8F", + "\xE6\x45" => "\xE6\xBE\x85", + "\xE6\x46" => "\xE6\xBD\x9A", + "\xE6\x47" => "\xE6\xBE\x96", + "\xE6\x48" => "\xE6\xBD\xB6", + "\xE6\x49" => "\xE6\xBD\xAC", + "\xE6\x4A" => "\xE6\xBE\x82", + "\xE6\x4B" => "\xE6\xBD\x95", + "\xE6\x4C" => "\xE6\xBD\xB2", + "\xE6\x4D" => "\xE6\xBD\x92", + "\xE6\x4E" => "\xE6\xBD\x90", + "\xE6\x4F" => "\xE6\xBD\x97", + "\xE6\x50" => "\xE6\xBE\x94", + "\xE6\x51" => "\xE6\xBE\x93", + "\xE6\x52" => "\xE6\xBD\x9D", + "\xE6\x53" => "\xE6\xBC\x80", + "\xE6\x54" => "\xE6\xBD\xA1", + "\xE6\x55" => "\xE6\xBD\xAB", + "\xE6\x56" => "\xE6\xBD\xBD", + "\xE6\x57" => "\xE6\xBD\xA7", + "\xE6\x58" => "\xE6\xBE\x90", + "\xE6\x59" => "\xE6\xBD\x93", + "\xE6\x5A" => "\xE6\xBE\x8B", + "\xE6\x5B" => "\xE6\xBD\xA9", + "\xE6\x5C" => "\xE6\xBD\xBF", + "\xE6\x5D" => "\xE6\xBE\x95", + "\xE6\x5E" => "\xE6\xBD\xA3", + "\xE6\x5F" => "\xE6\xBD\xB7", + "\xE6\x60" => "\xE6\xBD\xAA", + "\xE6\x61" => "\xE6\xBD\xBB", + "\xE6\x62" => "\xE7\x86\xB2", + "\xE6\x63" => "\xE7\x86\xAF", + "\xE6\x64" => "\xE7\x86\x9B", + "\xE6\x65" => "\xE7\x86\xB0", + "\xE6\x66" => "\xE7\x86\xA0", + "\xE6\x67" => "\xE7\x86\x9A", + "\xE6\x68" => "\xE7\x86\xA9", + "\xE6\x69" => "\xE7\x86\xB5", + "\xE6\x6A" => "\xE7\x86\x9D", + "\xE6\x6B" => "\xE7\x86\xA5", + "\xE6\x6C" => "\xE7\x86\x9E", + "\xE6\x6D" => "\xE7\x86\xA4", + "\xE6\x6E" => "\xE7\x86\xA1", + "\xE6\x6F" => "\xE7\x86\xAA", + "\xE6\x70" => "\xE7\x86\x9C", + "\xE6\x71" => "\xE7\x86\xA7", + "\xE6\x72" => "\xE7\x86\xB3", + "\xE6\x73" => "\xE7\x8A\x98", + "\xE6\x74" => "\xE7\x8A\x9A", + "\xE6\x75" => "\xE7\x8D\x98", + "\xE6\x76" => "\xE7\x8D\x92", + "\xE6\x77" => "\xE7\x8D\x9E", + "\xE6\x78" => "\xE7\x8D\x9F", + "\xE6\x79" => "\xE7\x8D\xA0", + "\xE6\x7A" => "\xE7\x8D\x9D", + "\xE6\x7B" => "\xE7\x8D\x9B", + "\xE6\x7C" => "\xE7\x8D\xA1", + "\xE6\x7D" => "\xE7\x8D\x9A", + "\xE6\x7E" => "\xE7\x8D\x99", + "\xE6\xA1" => "\xE7\x8D\xA2", + "\xE6\xA2" => "\xE7\x92\x87", + "\xE6\xA3" => "\xE7\x92\x89", + "\xE6\xA4" => "\xE7\x92\x8A", + "\xE6\xA5" => "\xE7\x92\x86", + "\xE6\xA6" => "\xE7\x92\x81", + "\xE6\xA7" => "\xE7\x91\xBD", + "\xE6\xA8" => "\xE7\x92\x85", + "\xE6\xA9" => "\xE7\x92\x88", + "\xE6\xAA" => "\xE7\x91\xBC", + "\xE6\xAB" => "\xE7\x91\xB9", + "\xE6\xAC" => "\xE7\x94\x88", + "\xE6\xAD" => "\xE7\x94\x87", + "\xE6\xAE" => "\xE7\x95\xBE", + "\xE6\xAF" => "\xE7\x98\xA5", + "\xE6\xB0" => "\xE7\x98\x9E", + "\xE6\xB1" => "\xE7\x98\x99", + "\xE6\xB2" => "\xE7\x98\x9D", + "\xE6\xB3" => "\xE7\x98\x9C", + "\xE6\xB4" => "\xE7\x98\xA3", + "\xE6\xB5" => "\xE7\x98\x9A", + "\xE6\xB6" => "\xE7\x98\xA8", + "\xE6\xB7" => "\xE7\x98\x9B", + "\xE6\xB8" => "\xE7\x9A\x9C", + "\xE6\xB9" => "\xE7\x9A\x9D", + "\xE6\xBA" => "\xE7\x9A\x9E", + "\xE6\xBB" => "\xE7\x9A\x9B", + "\xE6\xBC" => "\xE7\x9E\x8D", + "\xE6\xBD" => "\xE7\x9E\x8F", + "\xE6\xBE" => "\xE7\x9E\x89", + "\xE6\xBF" => "\xE7\x9E\x88", + "\xE6\xC0" => "\xE7\xA3\x8D", + "\xE6\xC1" => "\xE7\xA2\xBB", + "\xE6\xC2" => "\xE7\xA3\x8F", + "\xE6\xC3" => "\xE7\xA3\x8C", + "\xE6\xC4" => "\xE7\xA3\x91", + "\xE6\xC5" => "\xE7\xA3\x8E", + "\xE6\xC6" => "\xE7\xA3\x94", + "\xE6\xC7" => "\xE7\xA3\x88", + "\xE6\xC8" => "\xE7\xA3\x83", + "\xE6\xC9" => "\xE7\xA3\x84", + "\xE6\xCA" => "\xE7\xA3\x89", + "\xE6\xCB" => "\xE7\xA6\x9A", + "\xE6\xCC" => "\xE7\xA6\xA1", + "\xE6\xCD" => "\xE7\xA6\xA0", + "\xE6\xCE" => "\xE7\xA6\x9C", + "\xE6\xCF" => "\xE7\xA6\xA2", + "\xE6\xD0" => "\xE7\xA6\x9B", + "\xE6\xD1" => "\xE6\xAD\xB6", + "\xE6\xD2" => "\xE7\xA8\xB9", + "\xE6\xD3" => "\xE7\xAA\xB2", + "\xE6\xD4" => "\xE7\xAA\xB4", + "\xE6\xD5" => "\xE7\xAA\xB3", + "\xE6\xD6" => "\xE7\xAE\xB7", + "\xE6\xD7" => "\xE7\xAF\x8B", + "\xE6\xD8" => "\xE7\xAE\xBE", + "\xE6\xD9" => "\xE7\xAE\xAC", + "\xE6\xDA" => "\xE7\xAF\x8E", + "\xE6\xDB" => "\xE7\xAE\xAF", + "\xE6\xDC" => "\xE7\xAE\xB9", + "\xE6\xDD" => "\xE7\xAF\x8A", + "\xE6\xDE" => "\xE7\xAE\xB5", + "\xE6\xDF" => "\xE7\xB3\x85", + "\xE6\xE0" => "\xE7\xB3\x88", + "\xE6\xE1" => "\xE7\xB3\x8C", + "\xE6\xE2" => "\xE7\xB3\x8B", + "\xE6\xE3" => "\xE7\xB7\xB7", + "\xE6\xE4" => "\xE7\xB7\x9B", + "\xE6\xE5" => "\xE7\xB7\xAA", + "\xE6\xE6" => "\xE7\xB7\xA7", + "\xE6\xE7" => "\xE7\xB7\x97", + "\xE6\xE8" => "\xE7\xB7\xA1", + "\xE6\xE9" => "\xE7\xB8\x83", + "\xE6\xEA" => "\xE7\xB7\xBA", + "\xE6\xEB" => "\xE7\xB7\xA6", + "\xE6\xEC" => "\xE7\xB7\xB6", + "\xE6\xED" => "\xE7\xB7\xB1", + "\xE6\xEE" => "\xE7\xB7\xB0", + "\xE6\xEF" => "\xE7\xB7\xAE", + "\xE6\xF0" => "\xE7\xB7\x9F", + "\xE6\xF1" => "\xE7\xBD\xB6", + "\xE6\xF2" => "\xE7\xBE\xAC", + "\xE6\xF3" => "\xE7\xBE\xB0", + "\xE6\xF4" => "\xE7\xBE\xAD", + "\xE6\xF5" => "\xE7\xBF\xAD", + "\xE6\xF6" => "\xE7\xBF\xAB", + "\xE6\xF7" => "\xE7\xBF\xAA", + "\xE6\xF8" => "\xE7\xBF\xAC", + "\xE6\xF9" => "\xE7\xBF\xA6", + "\xE6\xFA" => "\xE7\xBF\xA8", + "\xE6\xFB" => "\xE8\x81\xA4", + "\xE6\xFC" => "\xE8\x81\xA7", + "\xE6\xFD" => "\xE8\x86\xA3", + "\xE6\xFE" => "\xE8\x86\x9F", + "\xE7\x40" => "\xE8\x86\x9E", + "\xE7\x41" => "\xE8\x86\x95", + "\xE7\x42" => "\xE8\x86\xA2", + "\xE7\x43" => "\xE8\x86\x99", + "\xE7\x44" => "\xE8\x86\x97", + "\xE7\x45" => "\xE8\x88\x96", + "\xE7\x46" => "\xE8\x89\x8F", + "\xE7\x47" => "\xE8\x89\x93", + "\xE7\x48" => "\xE8\x89\x92", + "\xE7\x49" => "\xE8\x89\x90", + "\xE7\x4A" => "\xE8\x89\x8E", + "\xE7\x4B" => "\xE8\x89\x91", + "\xE7\x4C" => "\xE8\x94\xA4", + "\xE7\x4D" => "\xE8\x94\xBB", + "\xE7\x4E" => "\xE8\x94\x8F", + "\xE7\x4F" => "\xE8\x94\x80", + "\xE7\x50" => "\xE8\x94\xA9", + "\xE7\x51" => "\xE8\x94\x8E", + "\xE7\x52" => "\xE8\x94\x89", + "\xE7\x53" => "\xE8\x94\x8D", + "\xE7\x54" => "\xE8\x94\x9F", + "\xE7\x55" => "\xE8\x94\x8A", + "\xE7\x56" => "\xE8\x94\xA7", + "\xE7\x57" => "\xE8\x94\x9C", + "\xE7\x58" => "\xE8\x93\xBB", + "\xE7\x59" => "\xE8\x94\xAB", + "\xE7\x5A" => "\xE8\x93\xBA", + "\xE7\x5B" => "\xE8\x94\x88", + "\xE7\x5C" => "\xE8\x94\x8C", + "\xE7\x5D" => "\xE8\x93\xB4", + "\xE7\x5E" => "\xE8\x94\xAA", + "\xE7\x5F" => "\xE8\x93\xB2", + "\xE7\x60" => "\xE8\x94\x95", + "\xE7\x61" => "\xE8\x93\xB7", + "\xE7\x62" => "\xE8\x93\xAB", + "\xE7\x63" => "\xE8\x93\xB3", + "\xE7\x64" => "\xE8\x93\xBC", + "\xE7\x65" => "\xE8\x94\x92", + "\xE7\x66" => "\xE8\x93\xAA", + "\xE7\x67" => "\xE8\x93\xA9", + "\xE7\x68" => "\xE8\x94\x96", + "\xE7\x69" => "\xE8\x93\xBE", + "\xE7\x6A" => "\xE8\x94\xA8", + "\xE7\x6B" => "\xE8\x94\x9D", + "\xE7\x6C" => "\xE8\x94\xAE", + "\xE7\x6D" => "\xE8\x94\x82", + "\xE7\x6E" => "\xE8\x93\xBD", + "\xE7\x6F" => "\xE8\x94\x9E", + "\xE7\x70" => "\xE8\x93\xB6", + "\xE7\x71" => "\xE8\x94\xB1", + "\xE7\x72" => "\xE8\x94\xA6", + "\xE7\x73" => "\xE8\x93\xA7", + "\xE7\x74" => "\xE8\x93\xA8", + "\xE7\x75" => "\xE8\x93\xB0", + "\xE7\x76" => "\xE8\x93\xAF", + "\xE7\x77" => "\xE8\x93\xB9", + "\xE7\x78" => "\xE8\x94\x98", + "\xE7\x79" => "\xE8\x94\xA0", + "\xE7\x7A" => "\xE8\x94\xB0", + "\xE7\x7B" => "\xE8\x94\x8B", + "\xE7\x7C" => "\xE8\x94\x99", + "\xE7\x7D" => "\xE8\x94\xAF", + "\xE7\x7E" => "\xE8\x99\xA2", + "\xE7\xA1" => "\xE8\x9D\x96", + "\xE7\xA2" => "\xE8\x9D\xA3", + "\xE7\xA3" => "\xE8\x9D\xA4", + "\xE7\xA4" => "\xE8\x9D\xB7", + "\xE7\xA5" => "\xE8\x9F\xA1", + "\xE7\xA6" => "\xE8\x9D\xB3", + "\xE7\xA7" => "\xE8\x9D\x98", + "\xE7\xA8" => "\xE8\x9D\x94", + "\xE7\xA9" => "\xE8\x9D\x9B", + "\xE7\xAA" => "\xE8\x9D\x92", + "\xE7\xAB" => "\xE8\x9D\xA1", + "\xE7\xAC" => "\xE8\x9D\x9A", + "\xE7\xAD" => "\xE8\x9D\x91", + "\xE7\xAE" => "\xE8\x9D\x9E", + "\xE7\xAF" => "\xE8\x9D\xAD", + "\xE7\xB0" => "\xE8\x9D\xAA", + "\xE7\xB1" => "\xE8\x9D\x90", + "\xE7\xB2" => "\xE8\x9D\x8E", + "\xE7\xB3" => "\xE8\x9D\x9F", + "\xE7\xB4" => "\xE8\x9D\x9D", + "\xE7\xB5" => "\xE8\x9D\xAF", + "\xE7\xB6" => "\xE8\x9D\xAC", + "\xE7\xB7" => "\xE8\x9D\xBA", + "\xE7\xB8" => "\xE8\x9D\xAE", + "\xE7\xB9" => "\xE8\x9D\x9C", + "\xE7\xBA" => "\xE8\x9D\xA5", + "\xE7\xBB" => "\xE8\x9D\x8F", + "\xE7\xBC" => "\xE8\x9D\xBB", + "\xE7\xBD" => "\xE8\x9D\xB5", + "\xE7\xBE" => "\xE8\x9D\xA2", + "\xE7\xBF" => "\xE8\x9D\xA7", + "\xE7\xC0" => "\xE8\x9D\xA9", + "\xE7\xC1" => "\xE8\xA1\x9A", + "\xE7\xC2" => "\xE8\xA4\x85", + "\xE7\xC3" => "\xE8\xA4\x8C", + "\xE7\xC4" => "\xE8\xA4\x94", + "\xE7\xC5" => "\xE8\xA4\x8B", + "\xE7\xC6" => "\xE8\xA4\x97", + "\xE7\xC7" => "\xE8\xA4\x98", + "\xE7\xC8" => "\xE8\xA4\x99", + "\xE7\xC9" => "\xE8\xA4\x86", + "\xE7\xCA" => "\xE8\xA4\x96", + "\xE7\xCB" => "\xE8\xA4\x91", + "\xE7\xCC" => "\xE8\xA4\x8E", + "\xE7\xCD" => "\xE8\xA4\x89", + "\xE7\xCE" => "\xE8\xA6\xA2", + "\xE7\xCF" => "\xE8\xA6\xA4", + "\xE7\xD0" => "\xE8\xA6\xA3", + "\xE7\xD1" => "\xE8\xA7\xAD", + "\xE7\xD2" => "\xE8\xA7\xB0", + "\xE7\xD3" => "\xE8\xA7\xAC", + "\xE7\xD4" => "\xE8\xAB\x8F", + "\xE7\xD5" => "\xE8\xAB\x86", + "\xE7\xD6" => "\xE8\xAA\xB8", + "\xE7\xD7" => "\xE8\xAB\x93", + "\xE7\xD8" => "\xE8\xAB\x91", + "\xE7\xD9" => "\xE8\xAB\x94", + "\xE7\xDA" => "\xE8\xAB\x95", + "\xE7\xDB" => "\xE8\xAA\xBB", + "\xE7\xDC" => "\xE8\xAB\x97", + "\xE7\xDD" => "\xE8\xAA\xBE", + "\xE7\xDE" => "\xE8\xAB\x80", + "\xE7\xDF" => "\xE8\xAB\x85", + "\xE7\xE0" => "\xE8\xAB\x98", + "\xE7\xE1" => "\xE8\xAB\x83", + "\xE7\xE2" => "\xE8\xAA\xBA", + "\xE7\xE3" => "\xE8\xAA\xBD", + "\xE7\xE4" => "\xE8\xAB\x99", + "\xE7\xE5" => "\xE8\xB0\xBE", + "\xE7\xE6" => "\xE8\xB1\x8D", + "\xE7\xE7" => "\xE8\xB2\x8F", + "\xE7\xE8" => "\xE8\xB3\xA5", + "\xE7\xE9" => "\xE8\xB3\x9F", + "\xE7\xEA" => "\xE8\xB3\x99", + "\xE7\xEB" => "\xE8\xB3\xA8", + "\xE7\xEC" => "\xE8\xB3\x9A", + "\xE7\xED" => "\xE8\xB3\x9D", + "\xE7\xEE" => "\xE8\xB3\xA7", + "\xE7\xEF" => "\xE8\xB6\xA0", + "\xE7\xF0" => "\xE8\xB6\x9C", + "\xE7\xF1" => "\xE8\xB6\xA1", + "\xE7\xF2" => "\xE8\xB6\x9B", + "\xE7\xF3" => "\xE8\xB8\xA0", + "\xE7\xF4" => "\xE8\xB8\xA3", + "\xE7\xF5" => "\xE8\xB8\xA5", + "\xE7\xF6" => "\xE8\xB8\xA4", + "\xE7\xF7" => "\xE8\xB8\xAE", + "\xE7\xF8" => "\xE8\xB8\x95", + "\xE7\xF9" => "\xE8\xB8\x9B", + "\xE7\xFA" => "\xE8\xB8\x96", + "\xE7\xFB" => "\xE8\xB8\x91", + "\xE7\xFC" => "\xE8\xB8\x99", + "\xE7\xFD" => "\xE8\xB8\xA6", + "\xE7\xFE" => "\xE8\xB8\xA7", + "\xE8\x40" => "\xE8\xB8\x94", + "\xE8\x41" => "\xE8\xB8\x92", + "\xE8\x42" => "\xE8\xB8\x98", + "\xE8\x43" => "\xE8\xB8\x93", + "\xE8\x44" => "\xE8\xB8\x9C", + "\xE8\x45" => "\xE8\xB8\x97", + "\xE8\x46" => "\xE8\xB8\x9A", + "\xE8\x47" => "\xE8\xBC\xAC", + "\xE8\x48" => "\xE8\xBC\xA4", + "\xE8\x49" => "\xE8\xBC\x98", + "\xE8\x4A" => "\xE8\xBC\x9A", + "\xE8\x4B" => "\xE8\xBC\xA0", + "\xE8\x4C" => "\xE8\xBC\xA3", + "\xE8\x4D" => "\xE8\xBC\x96", + "\xE8\x4E" => "\xE8\xBC\x97", + "\xE8\x4F" => "\xE9\x81\xB3", + "\xE8\x50" => "\xE9\x81\xB0", + "\xE8\x51" => "\xE9\x81\xAF", + "\xE8\x52" => "\xE9\x81\xA7", + "\xE8\x53" => "\xE9\x81\xAB", + "\xE8\x54" => "\xE9\x84\xAF", + "\xE8\x55" => "\xE9\x84\xAB", + "\xE8\x56" => "\xE9\x84\xA9", + "\xE8\x57" => "\xE9\x84\xAA", + "\xE8\x58" => "\xE9\x84\xB2", + "\xE8\x59" => "\xE9\x84\xA6", + "\xE8\x5A" => "\xE9\x84\xAE", + "\xE8\x5B" => "\xE9\x86\x85", + "\xE8\x5C" => "\xE9\x86\x86", + "\xE8\x5D" => "\xE9\x86\x8A", + "\xE8\x5E" => "\xE9\x86\x81", + "\xE8\x5F" => "\xE9\x86\x82", + "\xE8\x60" => "\xE9\x86\x84", + "\xE8\x61" => "\xE9\x86\x80", + "\xE8\x62" => "\xE9\x8B\x90", + "\xE8\x63" => "\xE9\x8B\x83", + "\xE8\x64" => "\xE9\x8B\x84", + "\xE8\x65" => "\xE9\x8B\x80", + "\xE8\x66" => "\xE9\x8B\x99", + "\xE8\x67" => "\xE9\x8A\xB6", + "\xE8\x68" => "\xE9\x8B\x8F", + "\xE8\x69" => "\xE9\x8B\xB1", + "\xE8\x6A" => "\xE9\x8B\x9F", + "\xE8\x6B" => "\xE9\x8B\x98", + "\xE8\x6C" => "\xE9\x8B\xA9", + "\xE8\x6D" => "\xE9\x8B\x97", + "\xE8\x6E" => "\xE9\x8B\x9D", + "\xE8\x6F" => "\xE9\x8B\x8C", + "\xE8\x70" => "\xE9\x8B\xAF", + "\xE8\x71" => "\xE9\x8B\x82", + "\xE8\x72" => "\xE9\x8B\xA8", + "\xE8\x73" => "\xE9\x8B\x8A", + "\xE8\x74" => "\xE9\x8B\x88", + "\xE8\x75" => "\xE9\x8B\x8E", + "\xE8\x76" => "\xE9\x8B\xA6", + "\xE8\x77" => "\xE9\x8B\x8D", + "\xE8\x78" => "\xE9\x8B\x95", + "\xE8\x79" => "\xE9\x8B\x89", + "\xE8\x7A" => "\xE9\x8B\xA0", + "\xE8\x7B" => "\xE9\x8B\x9E", + "\xE8\x7C" => "\xE9\x8B\xA7", + "\xE8\x7D" => "\xE9\x8B\x91", + "\xE8\x7E" => "\xE9\x8B\x93", + "\xE8\xA1" => "\xE9\x8A\xB5", + "\xE8\xA2" => "\xE9\x8B\xA1", + "\xE8\xA3" => "\xE9\x8B\x86", + "\xE8\xA4" => "\xE9\x8A\xB4", + "\xE8\xA5" => "\xE9\x95\xBC", + "\xE8\xA6" => "\xE9\x96\xAC", + "\xE8\xA7" => "\xE9\x96\xAB", + "\xE8\xA8" => "\xE9\x96\xAE", + "\xE8\xA9" => "\xE9\x96\xB0", + "\xE8\xAA" => "\xE9\x9A\xA4", + "\xE8\xAB" => "\xE9\x9A\xA2", + "\xE8\xAC" => "\xE9\x9B\x93", + "\xE8\xAD" => "\xE9\x9C\x85", + "\xE8\xAE" => "\xE9\x9C\x88", + "\xE8\xAF" => "\xE9\x9C\x82", + "\xE8\xB0" => "\xE9\x9D\x9A", + "\xE8\xB1" => "\xE9\x9E\x8A", + "\xE8\xB2" => "\xE9\x9E\x8E", + "\xE8\xB3" => "\xE9\x9E\x88", + "\xE8\xB4" => "\xE9\x9F\x90", + "\xE8\xB5" => "\xE9\x9F\x8F", + "\xE8\xB6" => "\xE9\xA0\x9E", + "\xE8\xB7" => "\xE9\xA0\x9D", + "\xE8\xB8" => "\xE9\xA0\xA6", + "\xE8\xB9" => "\xE9\xA0\xA9", + "\xE8\xBA" => "\xE9\xA0\xA8", + "\xE8\xBB" => "\xE9\xA0\xA0", + "\xE8\xBC" => "\xE9\xA0\x9B", + "\xE8\xBD" => "\xE9\xA0\xA7", + "\xE8\xBE" => "\xE9\xA2\xB2", + "\xE8\xBF" => "\xE9\xA4\x88", + "\xE8\xC0" => "\xE9\xA3\xBA", + "\xE8\xC1" => "\xE9\xA4\x91", + "\xE8\xC2" => "\xE9\xA4\x94", + "\xE8\xC3" => "\xE9\xA4\x96", + "\xE8\xC4" => "\xE9\xA4\x97", + "\xE8\xC5" => "\xE9\xA4\x95", + "\xE8\xC6" => "\xE9\xA7\x9C", + "\xE8\xC7" => "\xE9\xA7\x8D", + "\xE8\xC8" => "\xE9\xA7\x8F", + "\xE8\xC9" => "\xE9\xA7\x93", + "\xE8\xCA" => "\xE9\xA7\x94", + "\xE8\xCB" => "\xE9\xA7\x8E", + "\xE8\xCC" => "\xE9\xA7\x89", + "\xE8\xCD" => "\xE9\xA7\x96", + "\xE8\xCE" => "\xE9\xA7\x98", + "\xE8\xCF" => "\xE9\xA7\x8B", + "\xE8\xD0" => "\xE9\xA7\x97", + "\xE8\xD1" => "\xE9\xA7\x8C", + "\xE8\xD2" => "\xE9\xAA\xB3", + "\xE8\xD3" => "\xE9\xAB\xAC", + "\xE8\xD4" => "\xE9\xAB\xAB", + "\xE8\xD5" => "\xE9\xAB\xB3", + "\xE8\xD6" => "\xE9\xAB\xB2", + "\xE8\xD7" => "\xE9\xAB\xB1", + "\xE8\xD8" => "\xE9\xAD\x86", + "\xE8\xD9" => "\xE9\xAD\x83", + "\xE8\xDA" => "\xE9\xAD\xA7", + "\xE8\xDB" => "\xE9\xAD\xB4", + "\xE8\xDC" => "\xE9\xAD\xB1", + "\xE8\xDD" => "\xE9\xAD\xA6", + "\xE8\xDE" => "\xE9\xAD\xB6", + "\xE8\xDF" => "\xE9\xAD\xB5", + "\xE8\xE0" => "\xE9\xAD\xB0", + "\xE8\xE1" => "\xE9\xAD\xA8", + "\xE8\xE2" => "\xE9\xAD\xA4", + "\xE8\xE3" => "\xE9\xAD\xAC", + "\xE8\xE4" => "\xE9\xB3\xBC", + "\xE8\xE5" => "\xE9\xB3\xBA", + "\xE8\xE6" => "\xE9\xB3\xBD", + "\xE8\xE7" => "\xE9\xB3\xBF", + "\xE8\xE8" => "\xE9\xB3\xB7", + "\xE8\xE9" => "\xE9\xB4\x87", + "\xE8\xEA" => "\xE9\xB4\x80", + "\xE8\xEB" => "\xE9\xB3\xB9", + "\xE8\xEC" => "\xE9\xB3\xBB", + "\xE8\xED" => "\xE9\xB4\x88", + "\xE8\xEE" => "\xE9\xB4\x85", + "\xE8\xEF" => "\xE9\xB4\x84", + "\xE8\xF0" => "\xE9\xBA\x83", + "\xE8\xF1" => "\xE9\xBB\x93", + "\xE8\xF2" => "\xE9\xBC\x8F", + "\xE8\xF3" => "\xE9\xBC\x90", + "\xE8\xF4" => "\xE5\x84\x9C", + "\xE8\xF5" => "\xE5\x84\x93", + "\xE8\xF6" => "\xE5\x84\x97", + "\xE8\xF7" => "\xE5\x84\x9A", + "\xE8\xF8" => "\xE5\x84\x91", + "\xE8\xF9" => "\xE5\x87\x9E", + "\xE8\xFA" => "\xE5\x8C\xB4", + "\xE8\xFB" => "\xE5\x8F\xA1", + "\xE8\xFC" => "\xE5\x99\xB0", + "\xE8\xFD" => "\xE5\x99\xA0", + "\xE8\xFE" => "\xE5\x99\xAE", + "\xE9\x40" => "\xE5\x99\xB3", + "\xE9\x41" => "\xE5\x99\xA6", + "\xE9\x42" => "\xE5\x99\xA3", + "\xE9\x43" => "\xE5\x99\xAD", + "\xE9\x44" => "\xE5\x99\xB2", + "\xE9\x45" => "\xE5\x99\x9E", + "\xE9\x46" => "\xE5\x99\xB7", + "\xE9\x47" => "\xE5\x9C\x9C", + "\xE9\x48" => "\xE5\x9C\x9B", + "\xE9\x49" => "\xE5\xA3\x88", + "\xE9\x4A" => "\xE5\xA2\xBD", + "\xE9\x4B" => "\xE5\xA3\x89", + "\xE9\x4C" => "\xE5\xA2\xBF", + "\xE9\x4D" => "\xE5\xA2\xBA", + "\xE9\x4E" => "\xE5\xA3\x82", + "\xE9\x4F" => "\xE5\xA2\xBC", + "\xE9\x50" => "\xE5\xA3\x86", + "\xE9\x51" => "\xE5\xAC\x97", + "\xE9\x52" => "\xE5\xAC\x99", + "\xE9\x53" => "\xE5\xAC\x9B", + "\xE9\x54" => "\xE5\xAC\xA1", + "\xE9\x55" => "\xE5\xAC\x94", + "\xE9\x56" => "\xE5\xAC\x93", + "\xE9\x57" => "\xE5\xAC\x90", + "\xE9\x58" => "\xE5\xAC\x96", + "\xE9\x59" => "\xE5\xAC\xA8", + "\xE9\x5A" => "\xE5\xAC\x9A", + "\xE9\x5B" => "\xE5\xAC\xA0", + "\xE9\x5C" => "\xE5\xAC\x9E", + "\xE9\x5D" => "\xE5\xAF\xAF", + "\xE9\x5E" => "\xE5\xB6\xAC", + "\xE9\x5F" => "\xE5\xB6\xB1", + "\xE9\x60" => "\xE5\xB6\xA9", + "\xE9\x61" => "\xE5\xB6\xA7", + "\xE9\x62" => "\xE5\xB6\xB5", + "\xE9\x63" => "\xE5\xB6\xB0", + "\xE9\x64" => "\xE5\xB6\xAE", + "\xE9\x65" => "\xE5\xB6\xAA", + "\xE9\x66" => "\xE5\xB6\xA8", + "\xE9\x67" => "\xE5\xB6\xB2", + "\xE9\x68" => "\xE5\xB6\xAD", + "\xE9\x69" => "\xE5\xB6\xAF", + "\xE9\x6A" => "\xE5\xB6\xB4", + "\xE9\x6B" => "\xE5\xB9\xA7", + "\xE9\x6C" => "\xE5\xB9\xA8", + "\xE9\x6D" => "\xE5\xB9\xA6", + "\xE9\x6E" => "\xE5\xB9\xAF", + "\xE9\x6F" => "\xE5\xBB\xA9", + "\xE9\x70" => "\xE5\xBB\xA7", + "\xE9\x71" => "\xE5\xBB\xA6", + "\xE9\x72" => "\xE5\xBB\xA8", + "\xE9\x73" => "\xE5\xBB\xA5", + "\xE9\x74" => "\xE5\xBD\x8B", + "\xE9\x75" => "\xE5\xBE\xBC", + "\xE9\x76" => "\xE6\x86\x9D", + "\xE9\x77" => "\xE6\x86\xA8", + "\xE9\x78" => "\xE6\x86\x96", + "\xE9\x79" => "\xE6\x87\x85", + "\xE9\x7A" => "\xE6\x86\xB4", + "\xE9\x7B" => "\xE6\x87\x86", + "\xE9\x7C" => "\xE6\x87\x81", + "\xE9\x7D" => "\xE6\x87\x8C", + "\xE9\x7E" => "\xE6\x86\xBA", + "\xE9\xA1" => "\xE6\x86\xBF", + "\xE9\xA2" => "\xE6\x86\xB8", + "\xE9\xA3" => "\xE6\x86\x8C", + "\xE9\xA4" => "\xE6\x93\x97", + "\xE9\xA5" => "\xE6\x93\x96", + "\xE9\xA6" => "\xE6\x93\x90", + "\xE9\xA7" => "\xE6\x93\x8F", + "\xE9\xA8" => "\xE6\x93\x89", + "\xE9\xA9" => "\xE6\x92\xBD", + "\xE9\xAA" => "\xE6\x92\x89", + "\xE9\xAB" => "\xE6\x93\x83", + "\xE9\xAC" => "\xE6\x93\x9B", + "\xE9\xAD" => "\xE6\x93\xB3", + "\xE9\xAE" => "\xE6\x93\x99", + "\xE9\xAF" => "\xE6\x94\xB3", + "\xE9\xB0" => "\xE6\x95\xBF", + "\xE9\xB1" => "\xE6\x95\xBC", + "\xE9\xB2" => "\xE6\x96\xA2", + "\xE9\xB3" => "\xE6\x9B\x88", + "\xE9\xB4" => "\xE6\x9A\xBE", + "\xE9\xB5" => "\xE6\x9B\x80", + "\xE9\xB6" => "\xE6\x9B\x8A", + "\xE9\xB7" => "\xE6\x9B\x8B", + "\xE9\xB8" => "\xE6\x9B\x8F", + "\xE9\xB9" => "\xE6\x9A\xBD", + "\xE9\xBA" => "\xE6\x9A\xBB", + "\xE9\xBB" => "\xE6\x9A\xBA", + "\xE9\xBC" => "\xE6\x9B\x8C", + "\xE9\xBD" => "\xE6\x9C\xA3", + "\xE9\xBE" => "\xE6\xA8\xB4", + "\xE9\xBF" => "\xE6\xA9\xA6", + "\xE9\xC0" => "\xE6\xA9\x89", + "\xE9\xC1" => "\xE6\xA9\xA7", + "\xE9\xC2" => "\xE6\xA8\xB2", + "\xE9\xC3" => "\xE6\xA9\xA8", + "\xE9\xC4" => "\xE6\xA8\xBE", + "\xE9\xC5" => "\xE6\xA9\x9D", + "\xE9\xC6" => "\xE6\xA9\xAD", + "\xE9\xC7" => "\xE6\xA9\xB6", + "\xE9\xC8" => "\xE6\xA9\x9B", + "\xE9\xC9" => "\xE6\xA9\x91", + "\xE9\xCA" => "\xE6\xA8\xA8", + "\xE9\xCB" => "\xE6\xA9\x9A", + "\xE9\xCC" => "\xE6\xA8\xBB", + "\xE9\xCD" => "\xE6\xA8\xBF", + "\xE9\xCE" => "\xE6\xA9\x81", + "\xE9\xCF" => "\xE6\xA9\xAA", + "\xE9\xD0" => "\xE6\xA9\xA4", + "\xE9\xD1" => "\xE6\xA9\x90", + "\xE9\xD2" => "\xE6\xA9\x8F", + "\xE9\xD3" => "\xE6\xA9\x94", + "\xE9\xD4" => "\xE6\xA9\xAF", + "\xE9\xD5" => "\xE6\xA9\xA9", + "\xE9\xD6" => "\xE6\xA9\xA0", + "\xE9\xD7" => "\xE6\xA8\xBC", + "\xE9\xD8" => "\xE6\xA9\x9E", + "\xE9\xD9" => "\xE6\xA9\x96", + "\xE9\xDA" => "\xE6\xA9\x95", + "\xE9\xDB" => "\xE6\xA9\x8D", + "\xE9\xDC" => "\xE6\xA9\x8E", + "\xE9\xDD" => "\xE6\xA9\x86", + "\xE9\xDE" => "\xE6\xAD\x95", + "\xE9\xDF" => "\xE6\xAD\x94", + "\xE9\xE0" => "\xE6\xAD\x96", + "\xE9\xE1" => "\xE6\xAE\xA7", + "\xE9\xE2" => "\xE6\xAE\xAA", + "\xE9\xE3" => "\xE6\xAE\xAB", + "\xE9\xE4" => "\xE6\xAF\x88", + "\xE9\xE5" => "\xE6\xAF\x87", + "\xE9\xE6" => "\xE6\xB0\x84", + "\xE9\xE7" => "\xE6\xB0\x83", + "\xE9\xE8" => "\xE6\xB0\x86", + "\xE9\xE9" => "\xE6\xBE\xAD", + "\xE9\xEA" => "\xE6\xBF\x8B", + "\xE9\xEB" => "\xE6\xBE\xA3", + "\xE9\xEC" => "\xE6\xBF\x87", + "\xE9\xED" => "\xE6\xBE\xBC", + "\xE9\xEE" => "\xE6\xBF\x8E", + "\xE9\xEF" => "\xE6\xBF\x88", + "\xE9\xF0" => "\xE6\xBD\x9E", + "\xE9\xF1" => "\xE6\xBF\x84", + "\xE9\xF2" => "\xE6\xBE\xBD", + "\xE9\xF3" => "\xE6\xBE\x9E", + "\xE9\xF4" => "\xE6\xBF\x8A", + "\xE9\xF5" => "\xE6\xBE\xA8", + "\xE9\xF6" => "\xE7\x80\x84", + "\xE9\xF7" => "\xE6\xBE\xA5", + "\xE9\xF8" => "\xE6\xBE\xAE", + "\xE9\xF9" => "\xE6\xBE\xBA", + "\xE9\xFA" => "\xE6\xBE\xAC", + "\xE9\xFB" => "\xE6\xBE\xAA", + "\xE9\xFC" => "\xE6\xBF\x8F", + "\xE9\xFD" => "\xE6\xBE\xBF", + "\xE9\xFE" => "\xE6\xBE\xB8", + "\xEA\x40" => "\xE6\xBE\xA2", + "\xEA\x41" => "\xE6\xBF\x89", + "\xEA\x42" => "\xE6\xBE\xAB", + "\xEA\x43" => "\xE6\xBF\x8D", + "\xEA\x44" => "\xE6\xBE\xAF", + "\xEA\x45" => "\xE6\xBE\xB2", + "\xEA\x46" => "\xE6\xBE\xB0", + "\xEA\x47" => "\xE7\x87\x85", + "\xEA\x48" => "\xE7\x87\x82", + "\xEA\x49" => "\xE7\x86\xBF", + "\xEA\x4A" => "\xE7\x86\xB8", + "\xEA\x4B" => "\xE7\x87\x96", + "\xEA\x4C" => "\xE7\x87\x80", + "\xEA\x4D" => "\xE7\x87\x81", + "\xEA\x4E" => "\xE7\x87\x8B", + "\xEA\x4F" => "\xE7\x87\x94", + "\xEA\x50" => "\xE7\x87\x8A", + "\xEA\x51" => "\xE7\x87\x87", + "\xEA\x52" => "\xE7\x87\x8F", + "\xEA\x53" => "\xE7\x86\xBD", + "\xEA\x54" => "\xE7\x87\x98", + "\xEA\x55" => "\xE7\x86\xBC", + "\xEA\x56" => "\xE7\x87\x86", + "\xEA\x57" => "\xE7\x87\x9A", + "\xEA\x58" => "\xE7\x87\x9B", + "\xEA\x59" => "\xE7\x8A\x9D", + "\xEA\x5A" => "\xE7\x8A\x9E", + "\xEA\x5B" => "\xE7\x8D\xA9", + "\xEA\x5C" => "\xE7\x8D\xA6", + "\xEA\x5D" => "\xE7\x8D\xA7", + "\xEA\x5E" => "\xE7\x8D\xAC", + "\xEA\x5F" => "\xE7\x8D\xA5", + "\xEA\x60" => "\xE7\x8D\xAB", + "\xEA\x61" => "\xE7\x8D\xAA", + "\xEA\x62" => "\xE7\x91\xBF", + "\xEA\x63" => "\xE7\x92\x9A", + "\xEA\x64" => "\xE7\x92\xA0", + "\xEA\x65" => "\xE7\x92\x94", + "\xEA\x66" => "\xE7\x92\x92", + "\xEA\x67" => "\xE7\x92\x95", + "\xEA\x68" => "\xE7\x92\xA1", + "\xEA\x69" => "\xE7\x94\x8B", + "\xEA\x6A" => "\xE7\x96\x80", + "\xEA\x6B" => "\xE7\x98\xAF", + "\xEA\x6C" => "\xE7\x98\xAD", + "\xEA\x6D" => "\xE7\x98\xB1", + "\xEA\x6E" => "\xE7\x98\xBD", + "\xEA\x6F" => "\xE7\x98\xB3", + "\xEA\x70" => "\xE7\x98\xBC", + "\xEA\x71" => "\xE7\x98\xB5", + "\xEA\x72" => "\xE7\x98\xB2", + "\xEA\x73" => "\xE7\x98\xB0", + "\xEA\x74" => "\xE7\x9A\xBB", + "\xEA\x75" => "\xE7\x9B\xA6", + "\xEA\x76" => "\xE7\x9E\x9A", + "\xEA\x77" => "\xE7\x9E\x9D", + "\xEA\x78" => "\xE7\x9E\xA1", + "\xEA\x79" => "\xE7\x9E\x9C", + "\xEA\x7A" => "\xE7\x9E\x9B", + "\xEA\x7B" => "\xE7\x9E\xA2", + "\xEA\x7C" => "\xE7\x9E\xA3", + "\xEA\x7D" => "\xE7\x9E\x95", + "\xEA\x7E" => "\xE7\x9E\x99", + "\xEA\xA1" => "\xE7\x9E\x97", + "\xEA\xA2" => "\xE7\xA3\x9D", + "\xEA\xA3" => "\xE7\xA3\xA9", + "\xEA\xA4" => "\xE7\xA3\xA5", + "\xEA\xA5" => "\xE7\xA3\xAA", + "\xEA\xA6" => "\xE7\xA3\x9E", + "\xEA\xA7" => "\xE7\xA3\xA3", + "\xEA\xA8" => "\xE7\xA3\x9B", + "\xEA\xA9" => "\xE7\xA3\xA1", + "\xEA\xAA" => "\xE7\xA3\xA2", + "\xEA\xAB" => "\xE7\xA3\xAD", + "\xEA\xAC" => "\xE7\xA3\x9F", + "\xEA\xAD" => "\xE7\xA3\xA0", + "\xEA\xAE" => "\xE7\xA6\xA4", + "\xEA\xAF" => "\xE7\xA9\x84", + "\xEA\xB0" => "\xE7\xA9\x88", + "\xEA\xB1" => "\xE7\xA9\x87", + "\xEA\xB2" => "\xE7\xAA\xB6", + "\xEA\xB3" => "\xE7\xAA\xB8", + "\xEA\xB4" => "\xE7\xAA\xB5", + "\xEA\xB5" => "\xE7\xAA\xB1", + "\xEA\xB6" => "\xE7\xAA\xB7", + "\xEA\xB7" => "\xE7\xAF\x9E", + "\xEA\xB8" => "\xE7\xAF\xA3", + "\xEA\xB9" => "\xE7\xAF\xA7", + "\xEA\xBA" => "\xE7\xAF\x9D", + "\xEA\xBB" => "\xE7\xAF\x95", + "\xEA\xBC" => "\xE7\xAF\xA5", + "\xEA\xBD" => "\xE7\xAF\x9A", + "\xEA\xBE" => "\xE7\xAF\xA8", + "\xEA\xBF" => "\xE7\xAF\xB9", + "\xEA\xC0" => "\xE7\xAF\x94", + "\xEA\xC1" => "\xE7\xAF\xAA", + "\xEA\xC2" => "\xE7\xAF\xA2", + "\xEA\xC3" => "\xE7\xAF\x9C", + "\xEA\xC4" => "\xE7\xAF\xAB", + "\xEA\xC5" => "\xE7\xAF\x98", + "\xEA\xC6" => "\xE7\xAF\x9F", + "\xEA\xC7" => "\xE7\xB3\x92", + "\xEA\xC8" => "\xE7\xB3\x94", + "\xEA\xC9" => "\xE7\xB3\x97", + "\xEA\xCA" => "\xE7\xB3\x90", + "\xEA\xCB" => "\xE7\xB3\x91", + "\xEA\xCC" => "\xE7\xB8\x92", + "\xEA\xCD" => "\xE7\xB8\xA1", + "\xEA\xCE" => "\xE7\xB8\x97", + "\xEA\xCF" => "\xE7\xB8\x8C", + "\xEA\xD0" => "\xE7\xB8\x9F", + "\xEA\xD1" => "\xE7\xB8\xA0", + "\xEA\xD2" => "\xE7\xB8\x93", + "\xEA\xD3" => "\xE7\xB8\x8E", + "\xEA\xD4" => "\xE7\xB8\x9C", + "\xEA\xD5" => "\xE7\xB8\x95", + "\xEA\xD6" => "\xE7\xB8\x9A", + "\xEA\xD7" => "\xE7\xB8\xA2", + "\xEA\xD8" => "\xE7\xB8\x8B", + "\xEA\xD9" => "\xE7\xB8\x8F", + "\xEA\xDA" => "\xE7\xB8\x96", + "\xEA\xDB" => "\xE7\xB8\x8D", + "\xEA\xDC" => "\xE7\xB8\x94", + "\xEA\xDD" => "\xE7\xB8\xA5", + "\xEA\xDE" => "\xE7\xB8\xA4", + "\xEA\xDF" => "\xE7\xBD\x83", + "\xEA\xE0" => "\xE7\xBD\xBB", + "\xEA\xE1" => "\xE7\xBD\xBC", + "\xEA\xE2" => "\xE7\xBD\xBA", + "\xEA\xE3" => "\xE7\xBE\xB1", + "\xEA\xE4" => "\xE7\xBF\xAF", + "\xEA\xE5" => "\xE8\x80\xAA", + "\xEA\xE6" => "\xE8\x80\xA9", + "\xEA\xE7" => "\xE8\x81\xAC", + "\xEA\xE8" => "\xE8\x86\xB1", + "\xEA\xE9" => "\xE8\x86\xA6", + "\xEA\xEA" => "\xE8\x86\xAE", + "\xEA\xEB" => "\xE8\x86\xB9", + "\xEA\xEC" => "\xE8\x86\xB5", + "\xEA\xED" => "\xE8\x86\xAB", + "\xEA\xEE" => "\xE8\x86\xB0", + "\xEA\xEF" => "\xE8\x86\xAC", + "\xEA\xF0" => "\xE8\x86\xB4", + "\xEA\xF1" => "\xE8\x86\xB2", + "\xEA\xF2" => "\xE8\x86\xB7", + "\xEA\xF3" => "\xE8\x86\xA7", + "\xEA\xF4" => "\xE8\x87\xB2", + "\xEA\xF5" => "\xE8\x89\x95", + "\xEA\xF6" => "\xE8\x89\x96", + "\xEA\xF7" => "\xE8\x89\x97", + "\xEA\xF8" => "\xE8\x95\x96", + "\xEA\xF9" => "\xE8\x95\x85", + "\xEA\xFA" => "\xE8\x95\xAB", + "\xEA\xFB" => "\xE8\x95\x8D", + "\xEA\xFC" => "\xE8\x95\x93", + "\xEA\xFD" => "\xE8\x95\xA1", + "\xEA\xFE" => "\xE8\x95\x98", + "\xEB\x40" => "\xE8\x95\x80", + "\xEB\x41" => "\xE8\x95\x86", + "\xEB\x42" => "\xE8\x95\xA4", + "\xEB\x43" => "\xE8\x95\x81", + "\xEB\x44" => "\xE8\x95\xA2", + "\xEB\x45" => "\xE8\x95\x84", + "\xEB\x46" => "\xE8\x95\x91", + "\xEB\x47" => "\xE8\x95\x87", + "\xEB\x48" => "\xE8\x95\xA3", + "\xEB\x49" => "\xE8\x94\xBE", + "\xEB\x4A" => "\xE8\x95\x9B", + "\xEB\x4B" => "\xE8\x95\xB1", + "\xEB\x4C" => "\xE8\x95\x8E", + "\xEB\x4D" => "\xE8\x95\xAE", + "\xEB\x4E" => "\xE8\x95\xB5", + "\xEB\x4F" => "\xE8\x95\x95", + "\xEB\x50" => "\xE8\x95\xA7", + "\xEB\x51" => "\xE8\x95\xA0", + "\xEB\x52" => "\xE8\x96\x8C", + "\xEB\x53" => "\xE8\x95\xA6", + "\xEB\x54" => "\xE8\x95\x9D", + "\xEB\x55" => "\xE8\x95\x94", + "\xEB\x56" => "\xE8\x95\xA5", + "\xEB\x57" => "\xE8\x95\xAC", + "\xEB\x58" => "\xE8\x99\xA3", + "\xEB\x59" => "\xE8\x99\xA5", + "\xEB\x5A" => "\xE8\x99\xA4", + "\xEB\x5B" => "\xE8\x9E\x9B", + "\xEB\x5C" => "\xE8\x9E\x8F", + "\xEB\x5D" => "\xE8\x9E\x97", + "\xEB\x5E" => "\xE8\x9E\x93", + "\xEB\x5F" => "\xE8\x9E\x92", + "\xEB\x60" => "\xE8\x9E\x88", + "\xEB\x61" => "\xE8\x9E\x81", + "\xEB\x62" => "\xE8\x9E\x96", + "\xEB\x63" => "\xE8\x9E\x98", + "\xEB\x64" => "\xE8\x9D\xB9", + "\xEB\x65" => "\xE8\x9E\x87", + "\xEB\x66" => "\xE8\x9E\xA3", + "\xEB\x67" => "\xE8\x9E\x85", + "\xEB\x68" => "\xE8\x9E\x90", + "\xEB\x69" => "\xE8\x9E\x91", + "\xEB\x6A" => "\xE8\x9E\x9D", + "\xEB\x6B" => "\xE8\x9E\x84", + "\xEB\x6C" => "\xE8\x9E\x94", + "\xEB\x6D" => "\xE8\x9E\x9C", + "\xEB\x6E" => "\xE8\x9E\x9A", + "\xEB\x6F" => "\xE8\x9E\x89", + "\xEB\x70" => "\xE8\xA4\x9E", + "\xEB\x71" => "\xE8\xA4\xA6", + "\xEB\x72" => "\xE8\xA4\xB0", + "\xEB\x73" => "\xE8\xA4\xAD", + "\xEB\x74" => "\xE8\xA4\xAE", + "\xEB\x75" => "\xE8\xA4\xA7", + "\xEB\x76" => "\xE8\xA4\xB1", + "\xEB\x77" => "\xE8\xA4\xA2", + "\xEB\x78" => "\xE8\xA4\xA9", + "\xEB\x79" => "\xE8\xA4\xA3", + "\xEB\x7A" => "\xE8\xA4\xAF", + "\xEB\x7B" => "\xE8\xA4\xAC", + "\xEB\x7C" => "\xE8\xA4\x9F", + "\xEB\x7D" => "\xE8\xA7\xB1", + "\xEB\x7E" => "\xE8\xAB\xA0", + "\xEB\xA1" => "\xE8\xAB\xA2", + "\xEB\xA2" => "\xE8\xAB\xB2", + "\xEB\xA3" => "\xE8\xAB\xB4", + "\xEB\xA4" => "\xE8\xAB\xB5", + "\xEB\xA5" => "\xE8\xAB\x9D", + "\xEB\xA6" => "\xE8\xAC\x94", + "\xEB\xA7" => "\xE8\xAB\xA4", + "\xEB\xA8" => "\xE8\xAB\x9F", + "\xEB\xA9" => "\xE8\xAB\xB0", + "\xEB\xAA" => "\xE8\xAB\x88", + "\xEB\xAB" => "\xE8\xAB\x9E", + "\xEB\xAC" => "\xE8\xAB\xA1", + "\xEB\xAD" => "\xE8\xAB\xA8", + "\xEB\xAE" => "\xE8\xAB\xBF", + "\xEB\xAF" => "\xE8\xAB\xAF", + "\xEB\xB0" => "\xE8\xAB\xBB", + "\xEB\xB1" => "\xE8\xB2\x91", + "\xEB\xB2" => "\xE8\xB2\x92", + "\xEB\xB3" => "\xE8\xB2\x90", + "\xEB\xB4" => "\xE8\xB3\xB5", + "\xEB\xB5" => "\xE8\xB3\xAE", + "\xEB\xB6" => "\xE8\xB3\xB1", + "\xEB\xB7" => "\xE8\xB3\xB0", + "\xEB\xB8" => "\xE8\xB3\xB3", + "\xEB\xB9" => "\xE8\xB5\xAC", + "\xEB\xBA" => "\xE8\xB5\xAE", + "\xEB\xBB" => "\xE8\xB6\xA5", + "\xEB\xBC" => "\xE8\xB6\xA7", + "\xEB\xBD" => "\xE8\xB8\xB3", + "\xEB\xBE" => "\xE8\xB8\xBE", + "\xEB\xBF" => "\xE8\xB8\xB8", + "\xEB\xC0" => "\xE8\xB9\x80", + "\xEB\xC1" => "\xE8\xB9\x85", + "\xEB\xC2" => "\xE8\xB8\xB6", + "\xEB\xC3" => "\xE8\xB8\xBC", + "\xEB\xC4" => "\xE8\xB8\xBD", + "\xEB\xC5" => "\xE8\xB9\x81", + "\xEB\xC6" => "\xE8\xB8\xB0", + "\xEB\xC7" => "\xE8\xB8\xBF", + "\xEB\xC8" => "\xE8\xBA\xBD", + "\xEB\xC9" => "\xE8\xBC\xB6", + "\xEB\xCA" => "\xE8\xBC\xAE", + "\xEB\xCB" => "\xE8\xBC\xB5", + "\xEB\xCC" => "\xE8\xBC\xB2", + "\xEB\xCD" => "\xE8\xBC\xB9", + "\xEB\xCE" => "\xE8\xBC\xB7", + "\xEB\xCF" => "\xE8\xBC\xB4", + "\xEB\xD0" => "\xE9\x81\xB6", + "\xEB\xD1" => "\xE9\x81\xB9", + "\xEB\xD2" => "\xE9\x81\xBB", + "\xEB\xD3" => "\xE9\x82\x86", + "\xEB\xD4" => "\xE9\x83\xBA", + "\xEB\xD5" => "\xE9\x84\xB3", + "\xEB\xD6" => "\xE9\x84\xB5", + "\xEB\xD7" => "\xE9\x84\xB6", + "\xEB\xD8" => "\xE9\x86\x93", + "\xEB\xD9" => "\xE9\x86\x90", + "\xEB\xDA" => "\xE9\x86\x91", + "\xEB\xDB" => "\xE9\x86\x8D", + "\xEB\xDC" => "\xE9\x86\x8F", + "\xEB\xDD" => "\xE9\x8C\xA7", + "\xEB\xDE" => "\xE9\x8C\x9E", + "\xEB\xDF" => "\xE9\x8C\x88", + "\xEB\xE0" => "\xE9\x8C\x9F", + "\xEB\xE1" => "\xE9\x8C\x86", + "\xEB\xE2" => "\xE9\x8C\x8F", + "\xEB\xE3" => "\xE9\x8D\xBA", + "\xEB\xE4" => "\xE9\x8C\xB8", + "\xEB\xE5" => "\xE9\x8C\xBC", + "\xEB\xE6" => "\xE9\x8C\x9B", + "\xEB\xE7" => "\xE9\x8C\xA3", + "\xEB\xE8" => "\xE9\x8C\x92", + "\xEB\xE9" => "\xE9\x8C\x81", + "\xEB\xEA" => "\xE9\x8D\x86", + "\xEB\xEB" => "\xE9\x8C\xAD", + "\xEB\xEC" => "\xE9\x8C\x8E", + "\xEB\xED" => "\xE9\x8C\x8D", + "\xEB\xEE" => "\xE9\x8B\x8B", + "\xEB\xEF" => "\xE9\x8C\x9D", + "\xEB\xF0" => "\xE9\x8B\xBA", + "\xEB\xF1" => "\xE9\x8C\xA5", + "\xEB\xF2" => "\xE9\x8C\x93", + "\xEB\xF3" => "\xE9\x8B\xB9", + "\xEB\xF4" => "\xE9\x8B\xB7", + "\xEB\xF5" => "\xE9\x8C\xB4", + "\xEB\xF6" => "\xE9\x8C\x82", + "\xEB\xF7" => "\xE9\x8C\xA4", + "\xEB\xF8" => "\xE9\x8B\xBF", + "\xEB\xF9" => "\xE9\x8C\xA9", + "\xEB\xFA" => "\xE9\x8C\xB9", + "\xEB\xFB" => "\xE9\x8C\xB5", + "\xEB\xFC" => "\xE9\x8C\xAA", + "\xEB\xFD" => "\xE9\x8C\x94", + "\xEB\xFE" => "\xE9\x8C\x8C", + "\xEC\x40" => "\xE9\x8C\x8B", + "\xEC\x41" => "\xE9\x8B\xBE", + "\xEC\x42" => "\xE9\x8C\x89", + "\xEC\x43" => "\xE9\x8C\x80", + "\xEC\x44" => "\xE9\x8B\xBB", + "\xEC\x45" => "\xE9\x8C\x96", + "\xEC\x46" => "\xE9\x96\xBC", + "\xEC\x47" => "\xE9\x97\x8D", + "\xEC\x48" => "\xE9\x96\xBE", + "\xEC\x49" => "\xE9\x96\xB9", + "\xEC\x4A" => "\xE9\x96\xBA", + "\xEC\x4B" => "\xE9\x96\xB6", + "\xEC\x4C" => "\xE9\x96\xBF", + "\xEC\x4D" => "\xE9\x96\xB5", + "\xEC\x4E" => "\xE9\x96\xBD", + "\xEC\x4F" => "\xE9\x9A\xA9", + "\xEC\x50" => "\xE9\x9B\x94", + "\xEC\x51" => "\xE9\x9C\x8B", + "\xEC\x52" => "\xE9\x9C\x92", + "\xEC\x53" => "\xE9\x9C\x90", + "\xEC\x54" => "\xE9\x9E\x99", + "\xEC\x55" => "\xE9\x9E\x97", + "\xEC\x56" => "\xE9\x9E\x94", + "\xEC\x57" => "\xE9\x9F\xB0", + "\xEC\x58" => "\xE9\x9F\xB8", + "\xEC\x59" => "\xE9\xA0\xB5", + "\xEC\x5A" => "\xE9\xA0\xAF", + "\xEC\x5B" => "\xE9\xA0\xB2", + "\xEC\x5C" => "\xE9\xA4\xA4", + "\xEC\x5D" => "\xE9\xA4\x9F", + "\xEC\x5E" => "\xE9\xA4\xA7", + "\xEC\x5F" => "\xE9\xA4\xA9", + "\xEC\x60" => "\xE9\xA6\x9E", + "\xEC\x61" => "\xE9\xA7\xAE", + "\xEC\x62" => "\xE9\xA7\xAC", + "\xEC\x63" => "\xE9\xA7\xA5", + "\xEC\x64" => "\xE9\xA7\xA4", + "\xEC\x65" => "\xE9\xA7\xB0", + "\xEC\x66" => "\xE9\xA7\xA3", + "\xEC\x67" => "\xE9\xA7\xAA", + "\xEC\x68" => "\xE9\xA7\xA9", + "\xEC\x69" => "\xE9\xA7\xA7", + "\xEC\x6A" => "\xE9\xAA\xB9", + "\xEC\x6B" => "\xE9\xAA\xBF", + "\xEC\x6C" => "\xE9\xAA\xB4", + "\xEC\x6D" => "\xE9\xAA\xBB", + "\xEC\x6E" => "\xE9\xAB\xB6", + "\xEC\x6F" => "\xE9\xAB\xBA", + "\xEC\x70" => "\xE9\xAB\xB9", + "\xEC\x71" => "\xE9\xAB\xB7", + "\xEC\x72" => "\xE9\xAC\xB3", + "\xEC\x73" => "\xE9\xAE\x80", + "\xEC\x74" => "\xE9\xAE\x85", + "\xEC\x75" => "\xE9\xAE\x87", + "\xEC\x76" => "\xE9\xAD\xBC", + "\xEC\x77" => "\xE9\xAD\xBE", + "\xEC\x78" => "\xE9\xAD\xBB", + "\xEC\x79" => "\xE9\xAE\x82", + "\xEC\x7A" => "\xE9\xAE\x93", + "\xEC\x7B" => "\xE9\xAE\x92", + "\xEC\x7C" => "\xE9\xAE\x90", + "\xEC\x7D" => "\xE9\xAD\xBA", + "\xEC\x7E" => "\xE9\xAE\x95", + "\xEC\xA1" => "\xE9\xAD\xBD", + "\xEC\xA2" => "\xE9\xAE\x88", + "\xEC\xA3" => "\xE9\xB4\xA5", + "\xEC\xA4" => "\xE9\xB4\x97", + "\xEC\xA5" => "\xE9\xB4\xA0", + "\xEC\xA6" => "\xE9\xB4\x9E", + "\xEC\xA7" => "\xE9\xB4\x94", + "\xEC\xA8" => "\xE9\xB4\xA9", + "\xEC\xA9" => "\xE9\xB4\x9D", + "\xEC\xAA" => "\xE9\xB4\x98", + "\xEC\xAB" => "\xE9\xB4\xA2", + "\xEC\xAC" => "\xE9\xB4\x90", + "\xEC\xAD" => "\xE9\xB4\x99", + "\xEC\xAE" => "\xE9\xB4\x9F", + "\xEC\xAF" => "\xE9\xBA\x88", + "\xEC\xB0" => "\xE9\xBA\x86", + "\xEC\xB1" => "\xE9\xBA\x87", + "\xEC\xB2" => "\xE9\xBA\xAE", + "\xEC\xB3" => "\xE9\xBA\xAD", + "\xEC\xB4" => "\xE9\xBB\x95", + "\xEC\xB5" => "\xE9\xBB\x96", + "\xEC\xB6" => "\xE9\xBB\xBA", + "\xEC\xB7" => "\xE9\xBC\x92", + "\xEC\xB8" => "\xE9\xBC\xBD", + "\xEC\xB9" => "\xE5\x84\xA6", + "\xEC\xBA" => "\xE5\x84\xA5", + "\xEC\xBB" => "\xE5\x84\xA2", + "\xEC\xBC" => "\xE5\x84\xA4", + "\xEC\xBD" => "\xE5\x84\xA0", + "\xEC\xBE" => "\xE5\x84\xA9", + "\xEC\xBF" => "\xE5\x8B\xB4", + "\xEC\xC0" => "\xE5\x9A\x93", + "\xEC\xC1" => "\xE5\x9A\x8C", + "\xEC\xC2" => "\xE5\x9A\x8D", + "\xEC\xC3" => "\xE5\x9A\x86", + "\xEC\xC4" => "\xE5\x9A\x84", + "\xEC\xC5" => "\xE5\x9A\x83", + "\xEC\xC6" => "\xE5\x99\xBE", + "\xEC\xC7" => "\xE5\x9A\x82", + "\xEC\xC8" => "\xE5\x99\xBF", + "\xEC\xC9" => "\xE5\x9A\x81", + "\xEC\xCA" => "\xE5\xA3\x96", + "\xEC\xCB" => "\xE5\xA3\x94", + "\xEC\xCC" => "\xE5\xA3\x8F", + "\xEC\xCD" => "\xE5\xA3\x92", + "\xEC\xCE" => "\xE5\xAC\xAD", + "\xEC\xCF" => "\xE5\xAC\xA5", + "\xEC\xD0" => "\xE5\xAC\xB2", + "\xEC\xD1" => "\xE5\xAC\xA3", + "\xEC\xD2" => "\xE5\xAC\xAC", + "\xEC\xD3" => "\xE5\xAC\xA7", + "\xEC\xD4" => "\xE5\xAC\xA6", + "\xEC\xD5" => "\xE5\xAC\xAF", + "\xEC\xD6" => "\xE5\xAC\xAE", + "\xEC\xD7" => "\xE5\xAD\xBB", + "\xEC\xD8" => "\xE5\xAF\xB1", + "\xEC\xD9" => "\xE5\xAF\xB2", + "\xEC\xDA" => "\xE5\xB6\xB7", + "\xEC\xDB" => "\xE5\xB9\xAC", + "\xEC\xDC" => "\xE5\xB9\xAA", + "\xEC\xDD" => "\xE5\xBE\xBE", + "\xEC\xDE" => "\xE5\xBE\xBB", + "\xEC\xDF" => "\xE6\x87\x83", + "\xEC\xE0" => "\xE6\x86\xB5", + "\xEC\xE1" => "\xE6\x86\xBC", + "\xEC\xE2" => "\xE6\x87\xA7", + "\xEC\xE3" => "\xE6\x87\xA0", + "\xEC\xE4" => "\xE6\x87\xA5", + "\xEC\xE5" => "\xE6\x87\xA4", + "\xEC\xE6" => "\xE6\x87\xA8", + "\xEC\xE7" => "\xE6\x87\x9E", + "\xEC\xE8" => "\xE6\x93\xAF", + "\xEC\xE9" => "\xE6\x93\xA9", + "\xEC\xEA" => "\xE6\x93\xA3", + "\xEC\xEB" => "\xE6\x93\xAB", + "\xEC\xEC" => "\xE6\x93\xA4", + "\xEC\xED" => "\xE6\x93\xA8", + "\xEC\xEE" => "\xE6\x96\x81", + "\xEC\xEF" => "\xE6\x96\x80", + "\xEC\xF0" => "\xE6\x96\xB6", + "\xEC\xF1" => "\xE6\x97\x9A", + "\xEC\xF2" => "\xE6\x9B\x92", + "\xEC\xF3" => "\xE6\xAA\x8D", + "\xEC\xF4" => "\xE6\xAA\x96", + "\xEC\xF5" => "\xE6\xAA\x81", + "\xEC\xF6" => "\xE6\xAA\xA5", + "\xEC\xF7" => "\xE6\xAA\x89", + "\xEC\xF8" => "\xE6\xAA\x9F", + "\xEC\xF9" => "\xE6\xAA\x9B", + "\xEC\xFA" => "\xE6\xAA\xA1", + "\xEC\xFB" => "\xE6\xAA\x9E", + "\xEC\xFC" => "\xE6\xAA\x87", + "\xEC\xFD" => "\xE6\xAA\x93", + "\xEC\xFE" => "\xE6\xAA\x8E", + "\xED\x40" => "\xE6\xAA\x95", + "\xED\x41" => "\xE6\xAA\x83", + "\xED\x42" => "\xE6\xAA\xA8", + "\xED\x43" => "\xE6\xAA\xA4", + "\xED\x44" => "\xE6\xAA\x91", + "\xED\x45" => "\xE6\xA9\xBF", + "\xED\x46" => "\xE6\xAA\xA6", + "\xED\x47" => "\xE6\xAA\x9A", + "\xED\x48" => "\xE6\xAA\x85", + "\xED\x49" => "\xE6\xAA\x8C", + "\xED\x4A" => "\xE6\xAA\x92", + "\xED\x4B" => "\xE6\xAD\x9B", + "\xED\x4C" => "\xE6\xAE\xAD", + "\xED\x4D" => "\xE6\xB0\x89", + "\xED\x4E" => "\xE6\xBF\x8C", + "\xED\x4F" => "\xE6\xBE\xA9", + "\xED\x50" => "\xE6\xBF\xB4", + "\xED\x51" => "\xE6\xBF\x94", + "\xED\x52" => "\xE6\xBF\xA3", + "\xED\x53" => "\xE6\xBF\x9C", + "\xED\x54" => "\xE6\xBF\xAD", + "\xED\x55" => "\xE6\xBF\xA7", + "\xED\x56" => "\xE6\xBF\xA6", + "\xED\x57" => "\xE6\xBF\x9E", + "\xED\x58" => "\xE6\xBF\xB2", + "\xED\x59" => "\xE6\xBF\x9D", + "\xED\x5A" => "\xE6\xBF\xA2", + "\xED\x5B" => "\xE6\xBF\xA8", + "\xED\x5C" => "\xE7\x87\xA1", + "\xED\x5D" => "\xE7\x87\xB1", + "\xED\x5E" => "\xE7\x87\xA8", + "\xED\x5F" => "\xE7\x87\xB2", + "\xED\x60" => "\xE7\x87\xA4", + "\xED\x61" => "\xE7\x87\xB0", + "\xED\x62" => "\xE7\x87\xA2", + "\xED\x63" => "\xE7\x8D\xB3", + "\xED\x64" => "\xE7\x8D\xAE", + "\xED\x65" => "\xE7\x8D\xAF", + "\xED\x66" => "\xE7\x92\x97", + "\xED\x67" => "\xE7\x92\xB2", + "\xED\x68" => "\xE7\x92\xAB", + "\xED\x69" => "\xE7\x92\x90", + "\xED\x6A" => "\xE7\x92\xAA", + "\xED\x6B" => "\xE7\x92\xAD", + "\xED\x6C" => "\xE7\x92\xB1", + "\xED\x6D" => "\xE7\x92\xA5", + "\xED\x6E" => "\xE7\x92\xAF", + "\xED\x6F" => "\xE7\x94\x90", + "\xED\x70" => "\xE7\x94\x91", + "\xED\x71" => "\xE7\x94\x92", + "\xED\x72" => "\xE7\x94\x8F", + "\xED\x73" => "\xE7\x96\x84", + "\xED\x74" => "\xE7\x99\x83", + "\xED\x75" => "\xE7\x99\x88", + "\xED\x76" => "\xE7\x99\x89", + "\xED\x77" => "\xE7\x99\x87", + "\xED\x78" => "\xE7\x9A\xA4", + "\xED\x79" => "\xE7\x9B\xA9", + "\xED\x7A" => "\xE7\x9E\xB5", + "\xED\x7B" => "\xE7\x9E\xAB", + "\xED\x7C" => "\xE7\x9E\xB2", + "\xED\x7D" => "\xE7\x9E\xB7", + "\xED\x7E" => "\xE7\x9E\xB6", + "\xED\xA1" => "\xE7\x9E\xB4", + "\xED\xA2" => "\xE7\x9E\xB1", + "\xED\xA3" => "\xE7\x9E\xA8", + "\xED\xA4" => "\xE7\x9F\xB0", + "\xED\xA5" => "\xE7\xA3\xB3", + "\xED\xA6" => "\xE7\xA3\xBD", + "\xED\xA7" => "\xE7\xA4\x82", + "\xED\xA8" => "\xE7\xA3\xBB", + "\xED\xA9" => "\xE7\xA3\xBC", + "\xED\xAA" => "\xE7\xA3\xB2", + "\xED\xAB" => "\xE7\xA4\x85", + "\xED\xAC" => "\xE7\xA3\xB9", + "\xED\xAD" => "\xE7\xA3\xBE", + "\xED\xAE" => "\xE7\xA4\x84", + "\xED\xAF" => "\xE7\xA6\xAB", + "\xED\xB0" => "\xE7\xA6\xA8", + "\xED\xB1" => "\xE7\xA9\x9C", + "\xED\xB2" => "\xE7\xA9\x9B", + "\xED\xB3" => "\xE7\xA9\x96", + "\xED\xB4" => "\xE7\xA9\x98", + "\xED\xB5" => "\xE7\xA9\x94", + "\xED\xB6" => "\xE7\xA9\x9A", + "\xED\xB7" => "\xE7\xAA\xBE", + "\xED\xB8" => "\xE7\xAB\x80", + "\xED\xB9" => "\xE7\xAB\x81", + "\xED\xBA" => "\xE7\xB0\x85", + "\xED\xBB" => "\xE7\xB0\x8F", + "\xED\xBC" => "\xE7\xAF\xB2", + "\xED\xBD" => "\xE7\xB0\x80", + "\xED\xBE" => "\xE7\xAF\xBF", + "\xED\xBF" => "\xE7\xAF\xBB", + "\xED\xC0" => "\xE7\xB0\x8E", + "\xED\xC1" => "\xE7\xAF\xB4", + "\xED\xC2" => "\xE7\xB0\x8B", + "\xED\xC3" => "\xE7\xAF\xB3", + "\xED\xC4" => "\xE7\xB0\x82", + "\xED\xC5" => "\xE7\xB0\x89", + "\xED\xC6" => "\xE7\xB0\x83", + "\xED\xC7" => "\xE7\xB0\x81", + "\xED\xC8" => "\xE7\xAF\xB8", + "\xED\xC9" => "\xE7\xAF\xBD", + "\xED\xCA" => "\xE7\xB0\x86", + "\xED\xCB" => "\xE7\xAF\xB0", + "\xED\xCC" => "\xE7\xAF\xB1", + "\xED\xCD" => "\xE7\xB0\x90", + "\xED\xCE" => "\xE7\xB0\x8A", + "\xED\xCF" => "\xE7\xB3\xA8", + "\xED\xD0" => "\xE7\xB8\xAD", + "\xED\xD1" => "\xE7\xB8\xBC", + "\xED\xD2" => "\xE7\xB9\x82", + "\xED\xD3" => "\xE7\xB8\xB3", + "\xED\xD4" => "\xE9\xA1\x88", + "\xED\xD5" => "\xE7\xB8\xB8", + "\xED\xD6" => "\xE7\xB8\xAA", + "\xED\xD7" => "\xE7\xB9\x89", + "\xED\xD8" => "\xE7\xB9\x80", + "\xED\xD9" => "\xE7\xB9\x87", + "\xED\xDA" => "\xE7\xB8\xA9", + "\xED\xDB" => "\xE7\xB9\x8C", + "\xED\xDC" => "\xE7\xB8\xB0", + "\xED\xDD" => "\xE7\xB8\xBB", + "\xED\xDE" => "\xE7\xB8\xB6", + "\xED\xDF" => "\xE7\xB9\x84", + "\xED\xE0" => "\xE7\xB8\xBA", + "\xED\xE1" => "\xE7\xBD\x85", + "\xED\xE2" => "\xE7\xBD\xBF", + "\xED\xE3" => "\xE7\xBD\xBE", + "\xED\xE4" => "\xE7\xBD\xBD", + "\xED\xE5" => "\xE7\xBF\xB4", + "\xED\xE6" => "\xE7\xBF\xB2", + "\xED\xE7" => "\xE8\x80\xAC", + "\xED\xE8" => "\xE8\x86\xBB", + "\xED\xE9" => "\xE8\x87\x84", + "\xED\xEA" => "\xE8\x87\x8C", + "\xED\xEB" => "\xE8\x87\x8A", + "\xED\xEC" => "\xE8\x87\x85", + "\xED\xED" => "\xE8\x87\x87", + "\xED\xEE" => "\xE8\x86\xBC", + "\xED\xEF" => "\xE8\x87\xA9", + "\xED\xF0" => "\xE8\x89\x9B", + "\xED\xF1" => "\xE8\x89\x9A", + "\xED\xF2" => "\xE8\x89\x9C", + "\xED\xF3" => "\xE8\x96\x83", + "\xED\xF4" => "\xE8\x96\x80", + "\xED\xF5" => "\xE8\x96\x8F", + "\xED\xF6" => "\xE8\x96\xA7", + "\xED\xF7" => "\xE8\x96\x95", + "\xED\xF8" => "\xE8\x96\xA0", + "\xED\xF9" => "\xE8\x96\x8B", + "\xED\xFA" => "\xE8\x96\xA3", + "\xED\xFB" => "\xE8\x95\xBB", + "\xED\xFC" => "\xE8\x96\xA4", + "\xED\xFD" => "\xE8\x96\x9A", + "\xED\xFE" => "\xE8\x96\x9E", + "\xEE\x40" => "\xE8\x95\xB7", + "\xEE\x41" => "\xE8\x95\xBC", + "\xEE\x42" => "\xE8\x96\x89", + "\xEE\x43" => "\xE8\x96\xA1", + "\xEE\x44" => "\xE8\x95\xBA", + "\xEE\x45" => "\xE8\x95\xB8", + "\xEE\x46" => "\xE8\x95\x97", + "\xEE\x47" => "\xE8\x96\x8E", + "\xEE\x48" => "\xE8\x96\x96", + "\xEE\x49" => "\xE8\x96\x86", + "\xEE\x4A" => "\xE8\x96\x8D", + "\xEE\x4B" => "\xE8\x96\x99", + "\xEE\x4C" => "\xE8\x96\x9D", + "\xEE\x4D" => "\xE8\x96\x81", + "\xEE\x4E" => "\xE8\x96\xA2", + "\xEE\x4F" => "\xE8\x96\x82", + "\xEE\x50" => "\xE8\x96\x88", + "\xEE\x51" => "\xE8\x96\x85", + "\xEE\x52" => "\xE8\x95\xB9", + "\xEE\x53" => "\xE8\x95\xB6", + "\xEE\x54" => "\xE8\x96\x98", + "\xEE\x55" => "\xE8\x96\x90", + "\xEE\x56" => "\xE8\x96\x9F", + "\xEE\x57" => "\xE8\x99\xA8", + "\xEE\x58" => "\xE8\x9E\xBE", + "\xEE\x59" => "\xE8\x9E\xAA", + "\xEE\x5A" => "\xE8\x9E\xAD", + "\xEE\x5B" => "\xE8\x9F\x85", + "\xEE\x5C" => "\xE8\x9E\xB0", + "\xEE\x5D" => "\xE8\x9E\xAC", + "\xEE\x5E" => "\xE8\x9E\xB9", + "\xEE\x5F" => "\xE8\x9E\xB5", + "\xEE\x60" => "\xE8\x9E\xBC", + "\xEE\x61" => "\xE8\x9E\xAE", + "\xEE\x62" => "\xE8\x9F\x89", + "\xEE\x63" => "\xE8\x9F\x83", + "\xEE\x64" => "\xE8\x9F\x82", + "\xEE\x65" => "\xE8\x9F\x8C", + "\xEE\x66" => "\xE8\x9E\xB7", + "\xEE\x67" => "\xE8\x9E\xAF", + "\xEE\x68" => "\xE8\x9F\x84", + "\xEE\x69" => "\xE8\x9F\x8A", + "\xEE\x6A" => "\xE8\x9E\xB4", + "\xEE\x6B" => "\xE8\x9E\xB6", + "\xEE\x6C" => "\xE8\x9E\xBF", + "\xEE\x6D" => "\xE8\x9E\xB8", + "\xEE\x6E" => "\xE8\x9E\xBD", + "\xEE\x6F" => "\xE8\x9F\x9E", + "\xEE\x70" => "\xE8\x9E\xB2", + "\xEE\x71" => "\xE8\xA4\xB5", + "\xEE\x72" => "\xE8\xA4\xB3", + "\xEE\x73" => "\xE8\xA4\xBC", + "\xEE\x74" => "\xE8\xA4\xBE", + "\xEE\x75" => "\xE8\xA5\x81", + "\xEE\x76" => "\xE8\xA5\x92", + "\xEE\x77" => "\xE8\xA4\xB7", + "\xEE\x78" => "\xE8\xA5\x82", + "\xEE\x79" => "\xE8\xA6\xAD", + "\xEE\x7A" => "\xE8\xA6\xAF", + "\xEE\x7B" => "\xE8\xA6\xAE", + "\xEE\x7C" => "\xE8\xA7\xB2", + "\xEE\x7D" => "\xE8\xA7\xB3", + "\xEE\x7E" => "\xE8\xAC\x9E", + "\xEE\xA1" => "\xE8\xAC\x98", + "\xEE\xA2" => "\xE8\xAC\x96", + "\xEE\xA3" => "\xE8\xAC\x91", + "\xEE\xA4" => "\xE8\xAC\x85", + "\xEE\xA5" => "\xE8\xAC\x8B", + "\xEE\xA6" => "\xE8\xAC\xA2", + "\xEE\xA7" => "\xE8\xAC\x8F", + "\xEE\xA8" => "\xE8\xAC\x92", + "\xEE\xA9" => "\xE8\xAC\x95", + "\xEE\xAA" => "\xE8\xAC\x87", + "\xEE\xAB" => "\xE8\xAC\x8D", + "\xEE\xAC" => "\xE8\xAC\x88", + "\xEE\xAD" => "\xE8\xAC\x86", + "\xEE\xAE" => "\xE8\xAC\x9C", + "\xEE\xAF" => "\xE8\xAC\x93", + "\xEE\xB0" => "\xE8\xAC\x9A", + "\xEE\xB1" => "\xE8\xB1\x8F", + "\xEE\xB2" => "\xE8\xB1\xB0", + "\xEE\xB3" => "\xE8\xB1\xB2", + "\xEE\xB4" => "\xE8\xB1\xB1", + "\xEE\xB5" => "\xE8\xB1\xAF", + "\xEE\xB6" => "\xE8\xB2\x95", + "\xEE\xB7" => "\xE8\xB2\x94", + "\xEE\xB8" => "\xE8\xB3\xB9", + "\xEE\xB9" => "\xE8\xB5\xAF", + "\xEE\xBA" => "\xE8\xB9\x8E", + "\xEE\xBB" => "\xE8\xB9\x8D", + "\xEE\xBC" => "\xE8\xB9\x93", + "\xEE\xBD" => "\xE8\xB9\x90", + "\xEE\xBE" => "\xE8\xB9\x8C", + "\xEE\xBF" => "\xE8\xB9\x87", + "\xEE\xC0" => "\xE8\xBD\x83", + "\xEE\xC1" => "\xE8\xBD\x80", + "\xEE\xC2" => "\xE9\x82\x85", + "\xEE\xC3" => "\xE9\x81\xBE", + "\xEE\xC4" => "\xE9\x84\xB8", + "\xEE\xC5" => "\xE9\x86\x9A", + "\xEE\xC6" => "\xE9\x86\xA2", + "\xEE\xC7" => "\xE9\x86\x9B", + "\xEE\xC8" => "\xE9\x86\x99", + "\xEE\xC9" => "\xE9\x86\x9F", + "\xEE\xCA" => "\xE9\x86\xA1", + "\xEE\xCB" => "\xE9\x86\x9D", + "\xEE\xCC" => "\xE9\x86\xA0", + "\xEE\xCD" => "\xE9\x8E\xA1", + "\xEE\xCE" => "\xE9\x8E\x83", + "\xEE\xCF" => "\xE9\x8E\xAF", + "\xEE\xD0" => "\xE9\x8D\xA4", + "\xEE\xD1" => "\xE9\x8D\x96", + "\xEE\xD2" => "\xE9\x8D\x87", + "\xEE\xD3" => "\xE9\x8D\xBC", + "\xEE\xD4" => "\xE9\x8D\x98", + "\xEE\xD5" => "\xE9\x8D\x9C", + "\xEE\xD6" => "\xE9\x8D\xB6", + "\xEE\xD7" => "\xE9\x8D\x89", + "\xEE\xD8" => "\xE9\x8D\x90", + "\xEE\xD9" => "\xE9\x8D\x91", + "\xEE\xDA" => "\xE9\x8D\xA0", + "\xEE\xDB" => "\xE9\x8D\xAD", + "\xEE\xDC" => "\xE9\x8E\x8F", + "\xEE\xDD" => "\xE9\x8D\x8C", + "\xEE\xDE" => "\xE9\x8D\xAA", + "\xEE\xDF" => "\xE9\x8D\xB9", + "\xEE\xE0" => "\xE9\x8D\x97", + "\xEE\xE1" => "\xE9\x8D\x95", + "\xEE\xE2" => "\xE9\x8D\x92", + "\xEE\xE3" => "\xE9\x8D\x8F", + "\xEE\xE4" => "\xE9\x8D\xB1", + "\xEE\xE5" => "\xE9\x8D\xB7", + "\xEE\xE6" => "\xE9\x8D\xBB", + "\xEE\xE7" => "\xE9\x8D\xA1", + "\xEE\xE8" => "\xE9\x8D\x9E", + "\xEE\xE9" => "\xE9\x8D\xA3", + "\xEE\xEA" => "\xE9\x8D\xA7", + "\xEE\xEB" => "\xE9\x8E\x80", + "\xEE\xEC" => "\xE9\x8D\x8E", + "\xEE\xED" => "\xE9\x8D\x99", + "\xEE\xEE" => "\xE9\x97\x87", + "\xEE\xEF" => "\xE9\x97\x80", + "\xEE\xF0" => "\xE9\x97\x89", + "\xEE\xF1" => "\xE9\x97\x83", + "\xEE\xF2" => "\xE9\x97\x85", + "\xEE\xF3" => "\xE9\x96\xB7", + "\xEE\xF4" => "\xE9\x9A\xAE", + "\xEE\xF5" => "\xE9\x9A\xB0", + "\xEE\xF6" => "\xE9\x9A\xAC", + "\xEE\xF7" => "\xE9\x9C\xA0", + "\xEE\xF8" => "\xE9\x9C\x9F", + "\xEE\xF9" => "\xE9\x9C\x98", + "\xEE\xFA" => "\xE9\x9C\x9D", + "\xEE\xFB" => "\xE9\x9C\x99", + "\xEE\xFC" => "\xE9\x9E\x9A", + "\xEE\xFD" => "\xE9\x9E\xA1", + "\xEE\xFE" => "\xE9\x9E\x9C", + "\xEF\x40" => "\xE9\x9E\x9E", + "\xEF\x41" => "\xE9\x9E\x9D", + "\xEF\x42" => "\xE9\x9F\x95", + "\xEF\x43" => "\xE9\x9F\x94", + "\xEF\x44" => "\xE9\x9F\xB1", + "\xEF\x45" => "\xE9\xA1\x81", + "\xEF\x46" => "\xE9\xA1\x84", + "\xEF\x47" => "\xE9\xA1\x8A", + "\xEF\x48" => "\xE9\xA1\x89", + "\xEF\x49" => "\xE9\xA1\x85", + "\xEF\x4A" => "\xE9\xA1\x83", + "\xEF\x4B" => "\xE9\xA4\xA5", + "\xEF\x4C" => "\xE9\xA4\xAB", + "\xEF\x4D" => "\xE9\xA4\xAC", + "\xEF\x4E" => "\xE9\xA4\xAA", + "\xEF\x4F" => "\xE9\xA4\xB3", + "\xEF\x50" => "\xE9\xA4\xB2", + "\xEF\x51" => "\xE9\xA4\xAF", + "\xEF\x52" => "\xE9\xA4\xAD", + "\xEF\x53" => "\xE9\xA4\xB1", + "\xEF\x54" => "\xE9\xA4\xB0", + "\xEF\x55" => "\xE9\xA6\x98", + "\xEF\x56" => "\xE9\xA6\xA3", + "\xEF\x57" => "\xE9\xA6\xA1", + "\xEF\x58" => "\xE9\xA8\x82", + "\xEF\x59" => "\xE9\xA7\xBA", + "\xEF\x5A" => "\xE9\xA7\xB4", + "\xEF\x5B" => "\xE9\xA7\xB7", + "\xEF\x5C" => "\xE9\xA7\xB9", + "\xEF\x5D" => "\xE9\xA7\xB8", + "\xEF\x5E" => "\xE9\xA7\xB6", + "\xEF\x5F" => "\xE9\xA7\xBB", + "\xEF\x60" => "\xE9\xA7\xBD", + "\xEF\x61" => "\xE9\xA7\xBE", + "\xEF\x62" => "\xE9\xA7\xBC", + "\xEF\x63" => "\xE9\xA8\x83", + "\xEF\x64" => "\xE9\xAA\xBE", + "\xEF\x65" => "\xE9\xAB\xBE", + "\xEF\x66" => "\xE9\xAB\xBD", + "\xEF\x67" => "\xE9\xAC\x81", + "\xEF\x68" => "\xE9\xAB\xBC", + "\xEF\x69" => "\xE9\xAD\x88", + "\xEF\x6A" => "\xE9\xAE\x9A", + "\xEF\x6B" => "\xE9\xAE\xA8", + "\xEF\x6C" => "\xE9\xAE\x9E", + "\xEF\x6D" => "\xE9\xAE\x9B", + "\xEF\x6E" => "\xE9\xAE\xA6", + "\xEF\x6F" => "\xE9\xAE\xA1", + "\xEF\x70" => "\xE9\xAE\xA5", + "\xEF\x71" => "\xE9\xAE\xA4", + "\xEF\x72" => "\xE9\xAE\x86", + "\xEF\x73" => "\xE9\xAE\xA2", + "\xEF\x74" => "\xE9\xAE\xA0", + "\xEF\x75" => "\xE9\xAE\xAF", + "\xEF\x76" => "\xE9\xB4\xB3", + "\xEF\x77" => "\xE9\xB5\x81", + "\xEF\x78" => "\xE9\xB5\xA7", + "\xEF\x79" => "\xE9\xB4\xB6", + "\xEF\x7A" => "\xE9\xB4\xAE", + "\xEF\x7B" => "\xE9\xB4\xAF", + "\xEF\x7C" => "\xE9\xB4\xB1", + "\xEF\x7D" => "\xE9\xB4\xB8", + "\xEF\x7E" => "\xE9\xB4\xB0", + "\xEF\xA1" => "\xE9\xB5\x85", + "\xEF\xA2" => "\xE9\xB5\x82", + "\xEF\xA3" => "\xE9\xB5\x83", + "\xEF\xA4" => "\xE9\xB4\xBE", + "\xEF\xA5" => "\xE9\xB4\xB7", + "\xEF\xA6" => "\xE9\xB5\x80", + "\xEF\xA7" => "\xE9\xB4\xBD", + "\xEF\xA8" => "\xE7\xBF\xB5", + "\xEF\xA9" => "\xE9\xB4\xAD", + "\xEF\xAA" => "\xE9\xBA\x8A", + "\xEF\xAB" => "\xE9\xBA\x89", + "\xEF\xAC" => "\xE9\xBA\x8D", + "\xEF\xAD" => "\xE9\xBA\xB0", + "\xEF\xAE" => "\xE9\xBB\x88", + "\xEF\xAF" => "\xE9\xBB\x9A", + "\xEF\xB0" => "\xE9\xBB\xBB", + "\xEF\xB1" => "\xE9\xBB\xBF", + "\xEF\xB2" => "\xE9\xBC\xA4", + "\xEF\xB3" => "\xE9\xBC\xA3", + "\xEF\xB4" => "\xE9\xBC\xA2", + "\xEF\xB5" => "\xE9\xBD\x94", + "\xEF\xB6" => "\xE9\xBE\xA0", + "\xEF\xB7" => "\xE5\x84\xB1", + "\xEF\xB8" => "\xE5\x84\xAD", + "\xEF\xB9" => "\xE5\x84\xAE", + "\xEF\xBA" => "\xE5\x9A\x98", + "\xEF\xBB" => "\xE5\x9A\x9C", + "\xEF\xBC" => "\xE5\x9A\x97", + "\xEF\xBD" => "\xE5\x9A\x9A", + "\xEF\xBE" => "\xE5\x9A\x9D", + "\xEF\xBF" => "\xE5\x9A\x99", + "\xEF\xC0" => "\xE5\xA5\xB0", + "\xEF\xC1" => "\xE5\xAC\xBC", + "\xEF\xC2" => "\xE5\xB1\xA9", + "\xEF\xC3" => "\xE5\xB1\xAA", + "\xEF\xC4" => "\xE5\xB7\x80", + "\xEF\xC5" => "\xE5\xB9\xAD", + "\xEF\xC6" => "\xE5\xB9\xAE", + "\xEF\xC7" => "\xE6\x87\x98", + "\xEF\xC8" => "\xE6\x87\x9F", + "\xEF\xC9" => "\xE6\x87\xAD", + "\xEF\xCA" => "\xE6\x87\xAE", + "\xEF\xCB" => "\xE6\x87\xB1", + "\xEF\xCC" => "\xE6\x87\xAA", + "\xEF\xCD" => "\xE6\x87\xB0", + "\xEF\xCE" => "\xE6\x87\xAB", + "\xEF\xCF" => "\xE6\x87\x96", + "\xEF\xD0" => "\xE6\x87\xA9", + "\xEF\xD1" => "\xE6\x93\xBF", + "\xEF\xD2" => "\xE6\x94\x84", + "\xEF\xD3" => "\xE6\x93\xBD", + "\xEF\xD4" => "\xE6\x93\xB8", + "\xEF\xD5" => "\xE6\x94\x81", + "\xEF\xD6" => "\xE6\x94\x83", + "\xEF\xD7" => "\xE6\x93\xBC", + "\xEF\xD8" => "\xE6\x96\x94", + "\xEF\xD9" => "\xE6\x97\x9B", + "\xEF\xDA" => "\xE6\x9B\x9A", + "\xEF\xDB" => "\xE6\x9B\x9B", + "\xEF\xDC" => "\xE6\x9B\x98", + "\xEF\xDD" => "\xE6\xAB\x85", + "\xEF\xDE" => "\xE6\xAA\xB9", + "\xEF\xDF" => "\xE6\xAA\xBD", + "\xEF\xE0" => "\xE6\xAB\xA1", + "\xEF\xE1" => "\xE6\xAB\x86", + "\xEF\xE2" => "\xE6\xAA\xBA", + "\xEF\xE3" => "\xE6\xAA\xB6", + "\xEF\xE4" => "\xE6\xAA\xB7", + "\xEF\xE5" => "\xE6\xAB\x87", + "\xEF\xE6" => "\xE6\xAA\xB4", + "\xEF\xE7" => "\xE6\xAA\xAD", + "\xEF\xE8" => "\xE6\xAD\x9E", + "\xEF\xE9" => "\xE6\xAF\x89", + "\xEF\xEA" => "\xE6\xB0\x8B", + "\xEF\xEB" => "\xE7\x80\x87", + "\xEF\xEC" => "\xE7\x80\x8C", + "\xEF\xED" => "\xE7\x80\x8D", + "\xEF\xEE" => "\xE7\x80\x81", + "\xEF\xEF" => "\xE7\x80\x85", + "\xEF\xF0" => "\xE7\x80\x94", + "\xEF\xF1" => "\xE7\x80\x8E", + "\xEF\xF2" => "\xE6\xBF\xBF", + "\xEF\xF3" => "\xE7\x80\x80", + "\xEF\xF4" => "\xE6\xBF\xBB", + "\xEF\xF5" => "\xE7\x80\xA6", + "\xEF\xF6" => "\xE6\xBF\xBC", + "\xEF\xF7" => "\xE6\xBF\xB7", + "\xEF\xF8" => "\xE7\x80\x8A", + "\xEF\xF9" => "\xE7\x88\x81", + "\xEF\xFA" => "\xE7\x87\xBF", + "\xEF\xFB" => "\xE7\x87\xB9", + "\xEF\xFC" => "\xE7\x88\x83", + "\xEF\xFD" => "\xE7\x87\xBD", + "\xEF\xFE" => "\xE7\x8D\xB6", + "\xF0\x40" => "\xE7\x92\xB8", + "\xF0\x41" => "\xE7\x93\x80", + "\xF0\x42" => "\xE7\x92\xB5", + "\xF0\x43" => "\xE7\x93\x81", + "\xF0\x44" => "\xE7\x92\xBE", + "\xF0\x45" => "\xE7\x92\xB6", + "\xF0\x46" => "\xE7\x92\xBB", + "\xF0\x47" => "\xE7\x93\x82", + "\xF0\x48" => "\xE7\x94\x94", + "\xF0\x49" => "\xE7\x94\x93", + "\xF0\x4A" => "\xE7\x99\x9C", + "\xF0\x4B" => "\xE7\x99\xA4", + "\xF0\x4C" => "\xE7\x99\x99", + "\xF0\x4D" => "\xE7\x99\x90", + "\xF0\x4E" => "\xE7\x99\x93", + "\xF0\x4F" => "\xE7\x99\x97", + "\xF0\x50" => "\xE7\x99\x9A", + "\xF0\x51" => "\xE7\x9A\xA6", + "\xF0\x52" => "\xE7\x9A\xBD", + "\xF0\x53" => "\xE7\x9B\xAC", + "\xF0\x54" => "\xE7\x9F\x82", + "\xF0\x55" => "\xE7\x9E\xBA", + "\xF0\x56" => "\xE7\xA3\xBF", + "\xF0\x57" => "\xE7\xA4\x8C", + "\xF0\x58" => "\xE7\xA4\x93", + "\xF0\x59" => "\xE7\xA4\x94", + "\xF0\x5A" => "\xE7\xA4\x89", + "\xF0\x5B" => "\xE7\xA4\x90", + "\xF0\x5C" => "\xE7\xA4\x92", + "\xF0\x5D" => "\xE7\xA4\x91", + "\xF0\x5E" => "\xE7\xA6\xAD", + "\xF0\x5F" => "\xE7\xA6\xAC", + "\xF0\x60" => "\xE7\xA9\x9F", + "\xF0\x61" => "\xE7\xB0\x9C", + "\xF0\x62" => "\xE7\xB0\xA9", + "\xF0\x63" => "\xE7\xB0\x99", + "\xF0\x64" => "\xE7\xB0\xA0", + "\xF0\x65" => "\xE7\xB0\x9F", + "\xF0\x66" => "\xE7\xB0\xAD", + "\xF0\x67" => "\xE7\xB0\x9D", + "\xF0\x68" => "\xE7\xB0\xA6", + "\xF0\x69" => "\xE7\xB0\xA8", + "\xF0\x6A" => "\xE7\xB0\xA2", + "\xF0\x6B" => "\xE7\xB0\xA5", + "\xF0\x6C" => "\xE7\xB0\xB0", + "\xF0\x6D" => "\xE7\xB9\x9C", + "\xF0\x6E" => "\xE7\xB9\x90", + "\xF0\x6F" => "\xE7\xB9\x96", + "\xF0\x70" => "\xE7\xB9\xA3", + "\xF0\x71" => "\xE7\xB9\x98", + "\xF0\x72" => "\xE7\xB9\xA2", + "\xF0\x73" => "\xE7\xB9\x9F", + "\xF0\x74" => "\xE7\xB9\x91", + "\xF0\x75" => "\xE7\xB9\xA0", + "\xF0\x76" => "\xE7\xB9\x97", + "\xF0\x77" => "\xE7\xB9\x93", + "\xF0\x78" => "\xE7\xBE\xB5", + "\xF0\x79" => "\xE7\xBE\xB3", + "\xF0\x7A" => "\xE7\xBF\xB7", + "\xF0\x7B" => "\xE7\xBF\xB8", + "\xF0\x7C" => "\xE8\x81\xB5", + "\xF0\x7D" => "\xE8\x87\x91", + "\xF0\x7E" => "\xE8\x87\x92", + "\xF0\xA1" => "\xE8\x87\x90", + "\xF0\xA2" => "\xE8\x89\x9F", + "\xF0\xA3" => "\xE8\x89\x9E", + "\xF0\xA4" => "\xE8\x96\xB4", + "\xF0\xA5" => "\xE8\x97\x86", + "\xF0\xA6" => "\xE8\x97\x80", + "\xF0\xA7" => "\xE8\x97\x83", + "\xF0\xA8" => "\xE8\x97\x82", + "\xF0\xA9" => "\xE8\x96\xB3", + "\xF0\xAA" => "\xE8\x96\xB5", + "\xF0\xAB" => "\xE8\x96\xBD", + "\xF0\xAC" => "\xE8\x97\x87", + "\xF0\xAD" => "\xE8\x97\x84", + "\xF0\xAE" => "\xE8\x96\xBF", + "\xF0\xAF" => "\xE8\x97\x8B", + "\xF0\xB0" => "\xE8\x97\x8E", + "\xF0\xB1" => "\xE8\x97\x88", + "\xF0\xB2" => "\xE8\x97\x85", + "\xF0\xB3" => "\xE8\x96\xB1", + "\xF0\xB4" => "\xE8\x96\xB6", + "\xF0\xB5" => "\xE8\x97\x92", + "\xF0\xB6" => "\xE8\x98\xA4", + "\xF0\xB7" => "\xE8\x96\xB8", + "\xF0\xB8" => "\xE8\x96\xB7", + "\xF0\xB9" => "\xE8\x96\xBE", + "\xF0\xBA" => "\xE8\x99\xA9", + "\xF0\xBB" => "\xE8\x9F\xA7", + "\xF0\xBC" => "\xE8\x9F\xA6", + "\xF0\xBD" => "\xE8\x9F\xA2", + "\xF0\xBE" => "\xE8\x9F\x9B", + "\xF0\xBF" => "\xE8\x9F\xAB", + "\xF0\xC0" => "\xE8\x9F\xAA", + "\xF0\xC1" => "\xE8\x9F\xA5", + "\xF0\xC2" => "\xE8\x9F\x9F", + "\xF0\xC3" => "\xE8\x9F\xB3", + "\xF0\xC4" => "\xE8\x9F\xA4", + "\xF0\xC5" => "\xE8\x9F\x94", + "\xF0\xC6" => "\xE8\x9F\x9C", + "\xF0\xC7" => "\xE8\x9F\x93", + "\xF0\xC8" => "\xE8\x9F\xAD", + "\xF0\xC9" => "\xE8\x9F\x98", + "\xF0\xCA" => "\xE8\x9F\xA3", + "\xF0\xCB" => "\xE8\x9E\xA4", + "\xF0\xCC" => "\xE8\x9F\x97", + "\xF0\xCD" => "\xE8\x9F\x99", + "\xF0\xCE" => "\xE8\xA0\x81", + "\xF0\xCF" => "\xE8\x9F\xB4", + "\xF0\xD0" => "\xE8\x9F\xA8", + "\xF0\xD1" => "\xE8\x9F\x9D", + "\xF0\xD2" => "\xE8\xA5\x93", + "\xF0\xD3" => "\xE8\xA5\x8B", + "\xF0\xD4" => "\xE8\xA5\x8F", + "\xF0\xD5" => "\xE8\xA5\x8C", + "\xF0\xD6" => "\xE8\xA5\x86", + "\xF0\xD7" => "\xE8\xA5\x90", + "\xF0\xD8" => "\xE8\xA5\x91", + "\xF0\xD9" => "\xE8\xA5\x89", + "\xF0\xDA" => "\xE8\xAC\xAA", + "\xF0\xDB" => "\xE8\xAC\xA7", + "\xF0\xDC" => "\xE8\xAC\xA3", + "\xF0\xDD" => "\xE8\xAC\xB3", + "\xF0\xDE" => "\xE8\xAC\xB0", + "\xF0\xDF" => "\xE8\xAC\xB5", + "\xF0\xE0" => "\xE8\xAD\x87", + "\xF0\xE1" => "\xE8\xAC\xAF", + "\xF0\xE2" => "\xE8\xAC\xBC", + "\xF0\xE3" => "\xE8\xAC\xBE", + "\xF0\xE4" => "\xE8\xAC\xB1", + "\xF0\xE5" => "\xE8\xAC\xA5", + "\xF0\xE6" => "\xE8\xAC\xB7", + "\xF0\xE7" => "\xE8\xAC\xA6", + "\xF0\xE8" => "\xE8\xAC\xB6", + "\xF0\xE9" => "\xE8\xAC\xAE", + "\xF0\xEA" => "\xE8\xAC\xA4", + "\xF0\xEB" => "\xE8\xAC\xBB", + "\xF0\xEC" => "\xE8\xAC\xBD", + "\xF0\xED" => "\xE8\xAC\xBA", + "\xF0\xEE" => "\xE8\xB1\x82", + "\xF0\xEF" => "\xE8\xB1\xB5", + "\xF0\xF0" => "\xE8\xB2\x99", + "\xF0\xF1" => "\xE8\xB2\x98", + "\xF0\xF2" => "\xE8\xB2\x97", + "\xF0\xF3" => "\xE8\xB3\xBE", + "\xF0\xF4" => "\xE8\xB4\x84", + "\xF0\xF5" => "\xE8\xB4\x82", + "\xF0\xF6" => "\xE8\xB4\x80", + "\xF0\xF7" => "\xE8\xB9\x9C", + "\xF0\xF8" => "\xE8\xB9\xA2", + "\xF0\xF9" => "\xE8\xB9\xA0", + "\xF0\xFA" => "\xE8\xB9\x97", + "\xF0\xFB" => "\xE8\xB9\x96", + "\xF0\xFC" => "\xE8\xB9\x9E", + "\xF0\xFD" => "\xE8\xB9\xA5", + "\xF0\xFE" => "\xE8\xB9\xA7", + "\xF1\x40" => "\xE8\xB9\x9B", + "\xF1\x41" => "\xE8\xB9\x9A", + "\xF1\x42" => "\xE8\xB9\xA1", + "\xF1\x43" => "\xE8\xB9\x9D", + "\xF1\x44" => "\xE8\xB9\xA9", + "\xF1\x45" => "\xE8\xB9\x94", + "\xF1\x46" => "\xE8\xBD\x86", + "\xF1\x47" => "\xE8\xBD\x87", + "\xF1\x48" => "\xE8\xBD\x88", + "\xF1\x49" => "\xE8\xBD\x8B", + "\xF1\x4A" => "\xE9\x84\xA8", + "\xF1\x4B" => "\xE9\x84\xBA", + "\xF1\x4C" => "\xE9\x84\xBB", + "\xF1\x4D" => "\xE9\x84\xBE", + "\xF1\x4E" => "\xE9\x86\xA8", + "\xF1\x4F" => "\xE9\x86\xA5", + "\xF1\x50" => "\xE9\x86\xA7", + "\xF1\x51" => "\xE9\x86\xAF", + "\xF1\x52" => "\xE9\x86\xAA", + "\xF1\x53" => "\xE9\x8E\xB5", + "\xF1\x54" => "\xE9\x8E\x8C", + "\xF1\x55" => "\xE9\x8E\x92", + "\xF1\x56" => "\xE9\x8E\xB7", + "\xF1\x57" => "\xE9\x8E\x9B", + "\xF1\x58" => "\xE9\x8E\x9D", + "\xF1\x59" => "\xE9\x8E\x89", + "\xF1\x5A" => "\xE9\x8E\xA7", + "\xF1\x5B" => "\xE9\x8E\x8E", + "\xF1\x5C" => "\xE9\x8E\xAA", + "\xF1\x5D" => "\xE9\x8E\x9E", + "\xF1\x5E" => "\xE9\x8E\xA6", + "\xF1\x5F" => "\xE9\x8E\x95", + "\xF1\x60" => "\xE9\x8E\x88", + "\xF1\x61" => "\xE9\x8E\x99", + "\xF1\x62" => "\xE9\x8E\x9F", + "\xF1\x63" => "\xE9\x8E\x8D", + "\xF1\x64" => "\xE9\x8E\xB1", + "\xF1\x65" => "\xE9\x8E\x91", + "\xF1\x66" => "\xE9\x8E\xB2", + "\xF1\x67" => "\xE9\x8E\xA4", + "\xF1\x68" => "\xE9\x8E\xA8", + "\xF1\x69" => "\xE9\x8E\xB4", + "\xF1\x6A" => "\xE9\x8E\xA3", + "\xF1\x6B" => "\xE9\x8E\xA5", + "\xF1\x6C" => "\xE9\x97\x92", + "\xF1\x6D" => "\xE9\x97\x93", + "\xF1\x6E" => "\xE9\x97\x91", + "\xF1\x6F" => "\xE9\x9A\xB3", + "\xF1\x70" => "\xE9\x9B\x97", + "\xF1\x71" => "\xE9\x9B\x9A", + "\xF1\x72" => "\xE5\xB7\x82", + "\xF1\x73" => "\xE9\x9B\x9F", + "\xF1\x74" => "\xE9\x9B\x98", + "\xF1\x75" => "\xE9\x9B\x9D", + "\xF1\x76" => "\xE9\x9C\xA3", + "\xF1\x77" => "\xE9\x9C\xA2", + "\xF1\x78" => "\xE9\x9C\xA5", + "\xF1\x79" => "\xE9\x9E\xAC", + "\xF1\x7A" => "\xE9\x9E\xAE", + "\xF1\x7B" => "\xE9\x9E\xA8", + "\xF1\x7C" => "\xE9\x9E\xAB", + "\xF1\x7D" => "\xE9\x9E\xA4", + "\xF1\x7E" => "\xE9\x9E\xAA", + "\xF1\xA1" => "\xE9\x9E\xA2", + "\xF1\xA2" => "\xE9\x9E\xA5", + "\xF1\xA3" => "\xE9\x9F\x97", + "\xF1\xA4" => "\xE9\x9F\x99", + "\xF1\xA5" => "\xE9\x9F\x96", + "\xF1\xA6" => "\xE9\x9F\x98", + "\xF1\xA7" => "\xE9\x9F\xBA", + "\xF1\xA8" => "\xE9\xA1\x90", + "\xF1\xA9" => "\xE9\xA1\x91", + "\xF1\xAA" => "\xE9\xA1\x92", + "\xF1\xAB" => "\xE9\xA2\xB8", + "\xF1\xAC" => "\xE9\xA5\x81", + "\xF1\xAD" => "\xE9\xA4\xBC", + "\xF1\xAE" => "\xE9\xA4\xBA", + "\xF1\xAF" => "\xE9\xA8\x8F", + "\xF1\xB0" => "\xE9\xA8\x8B", + "\xF1\xB1" => "\xE9\xA8\x89", + "\xF1\xB2" => "\xE9\xA8\x8D", + "\xF1\xB3" => "\xE9\xA8\x84", + "\xF1\xB4" => "\xE9\xA8\x91", + "\xF1\xB5" => "\xE9\xA8\x8A", + "\xF1\xB6" => "\xE9\xA8\x85", + "\xF1\xB7" => "\xE9\xA8\x87", + "\xF1\xB8" => "\xE9\xA8\x86", + "\xF1\xB9" => "\xE9\xAB\x80", + "\xF1\xBA" => "\xE9\xAB\x9C", + "\xF1\xBB" => "\xE9\xAC\x88", + "\xF1\xBC" => "\xE9\xAC\x84", + "\xF1\xBD" => "\xE9\xAC\x85", + "\xF1\xBE" => "\xE9\xAC\xA9", + "\xF1\xBF" => "\xE9\xAC\xB5", + "\xF1\xC0" => "\xE9\xAD\x8A", + "\xF1\xC1" => "\xE9\xAD\x8C", + "\xF1\xC2" => "\xE9\xAD\x8B", + "\xF1\xC3" => "\xE9\xAF\x87", + "\xF1\xC4" => "\xE9\xAF\x86", + "\xF1\xC5" => "\xE9\xAF\x83", + "\xF1\xC6" => "\xE9\xAE\xBF", + "\xF1\xC7" => "\xE9\xAF\x81", + "\xF1\xC8" => "\xE9\xAE\xB5", + "\xF1\xC9" => "\xE9\xAE\xB8", + "\xF1\xCA" => "\xE9\xAF\x93", + "\xF1\xCB" => "\xE9\xAE\xB6", + "\xF1\xCC" => "\xE9\xAF\x84", + "\xF1\xCD" => "\xE9\xAE\xB9", + "\xF1\xCE" => "\xE9\xAE\xBD", + "\xF1\xCF" => "\xE9\xB5\x9C", + "\xF1\xD0" => "\xE9\xB5\x93", + "\xF1\xD1" => "\xE9\xB5\x8F", + "\xF1\xD2" => "\xE9\xB5\x8A", + "\xF1\xD3" => "\xE9\xB5\x9B", + "\xF1\xD4" => "\xE9\xB5\x8B", + "\xF1\xD5" => "\xE9\xB5\x99", + "\xF1\xD6" => "\xE9\xB5\x96", + "\xF1\xD7" => "\xE9\xB5\x8C", + "\xF1\xD8" => "\xE9\xB5\x97", + "\xF1\xD9" => "\xE9\xB5\x92", + "\xF1\xDA" => "\xE9\xB5\x94", + "\xF1\xDB" => "\xE9\xB5\x9F", + "\xF1\xDC" => "\xE9\xB5\x98", + "\xF1\xDD" => "\xE9\xB5\x9A", + "\xF1\xDE" => "\xE9\xBA\x8E", + "\xF1\xDF" => "\xE9\xBA\x8C", + "\xF1\xE0" => "\xE9\xBB\x9F", + "\xF1\xE1" => "\xE9\xBC\x81", + "\xF1\xE2" => "\xE9\xBC\x80", + "\xF1\xE3" => "\xE9\xBC\x96", + "\xF1\xE4" => "\xE9\xBC\xA5", + "\xF1\xE5" => "\xE9\xBC\xAB", + "\xF1\xE6" => "\xE9\xBC\xAA", + "\xF1\xE7" => "\xE9\xBC\xA9", + "\xF1\xE8" => "\xE9\xBC\xA8", + "\xF1\xE9" => "\xE9\xBD\x8C", + "\xF1\xEA" => "\xE9\xBD\x95", + "\xF1\xEB" => "\xE5\x84\xB4", + "\xF1\xEC" => "\xE5\x84\xB5", + "\xF1\xED" => "\xE5\x8A\x96", + "\xF1\xEE" => "\xE5\x8B\xB7", + "\xF1\xEF" => "\xE5\x8E\xB4", + "\xF1\xF0" => "\xE5\x9A\xAB", + "\xF1\xF1" => "\xE5\x9A\xAD", + "\xF1\xF2" => "\xE5\x9A\xA6", + "\xF1\xF3" => "\xE5\x9A\xA7", + "\xF1\xF4" => "\xE5\x9A\xAA", + "\xF1\xF5" => "\xE5\x9A\xAC", + "\xF1\xF6" => "\xE5\xA3\x9A", + "\xF1\xF7" => "\xE5\xA3\x9D", + "\xF1\xF8" => "\xE5\xA3\x9B", + "\xF1\xF9" => "\xE5\xA4\x92", + "\xF1\xFA" => "\xE5\xAC\xBD", + "\xF1\xFB" => "\xE5\xAC\xBE", + "\xF1\xFC" => "\xE5\xAC\xBF", + "\xF1\xFD" => "\xE5\xB7\x83", + "\xF1\xFE" => "\xE5\xB9\xB0", + "\xF2\x40" => "\xE5\xBE\xBF", + "\xF2\x41" => "\xE6\x87\xBB", + "\xF2\x42" => "\xE6\x94\x87", + "\xF2\x43" => "\xE6\x94\x90", + "\xF2\x44" => "\xE6\x94\x8D", + "\xF2\x45" => "\xE6\x94\x89", + "\xF2\x46" => "\xE6\x94\x8C", + "\xF2\x47" => "\xE6\x94\x8E", + "\xF2\x48" => "\xE6\x96\x84", + "\xF2\x49" => "\xE6\x97\x9E", + "\xF2\x4A" => "\xE6\x97\x9D", + "\xF2\x4B" => "\xE6\x9B\x9E", + "\xF2\x4C" => "\xE6\xAB\xA7", + "\xF2\x4D" => "\xE6\xAB\xA0", + "\xF2\x4E" => "\xE6\xAB\x8C", + "\xF2\x4F" => "\xE6\xAB\x91", + "\xF2\x50" => "\xE6\xAB\x99", + "\xF2\x51" => "\xE6\xAB\x8B", + "\xF2\x52" => "\xE6\xAB\x9F", + "\xF2\x53" => "\xE6\xAB\x9C", + "\xF2\x54" => "\xE6\xAB\x90", + "\xF2\x55" => "\xE6\xAB\xAB", + "\xF2\x56" => "\xE6\xAB\x8F", + "\xF2\x57" => "\xE6\xAB\x8D", + "\xF2\x58" => "\xE6\xAB\x9E", + "\xF2\x59" => "\xE6\xAD\xA0", + "\xF2\x5A" => "\xE6\xAE\xB0", + "\xF2\x5B" => "\xE6\xB0\x8C", + "\xF2\x5C" => "\xE7\x80\x99", + "\xF2\x5D" => "\xE7\x80\xA7", + "\xF2\x5E" => "\xE7\x80\xA0", + "\xF2\x5F" => "\xE7\x80\x96", + "\xF2\x60" => "\xE7\x80\xAB", + "\xF2\x61" => "\xE7\x80\xA1", + "\xF2\x62" => "\xE7\x80\xA2", + "\xF2\x63" => "\xE7\x80\xA3", + "\xF2\x64" => "\xE7\x80\xA9", + "\xF2\x65" => "\xE7\x80\x97", + "\xF2\x66" => "\xE7\x80\xA4", + "\xF2\x67" => "\xE7\x80\x9C", + "\xF2\x68" => "\xE7\x80\xAA", + "\xF2\x69" => "\xE7\x88\x8C", + "\xF2\x6A" => "\xE7\x88\x8A", + "\xF2\x6B" => "\xE7\x88\x87", + "\xF2\x6C" => "\xE7\x88\x82", + "\xF2\x6D" => "\xE7\x88\x85", + "\xF2\x6E" => "\xE7\x8A\xA5", + "\xF2\x6F" => "\xE7\x8A\xA6", + "\xF2\x70" => "\xE7\x8A\xA4", + "\xF2\x71" => "\xE7\x8A\xA3", + "\xF2\x72" => "\xE7\x8A\xA1", + "\xF2\x73" => "\xE7\x93\x8B", + "\xF2\x74" => "\xE7\x93\x85", + "\xF2\x75" => "\xE7\x92\xB7", + "\xF2\x76" => "\xE7\x93\x83", + "\xF2\x77" => "\xE7\x94\x96", + "\xF2\x78" => "\xE7\x99\xA0", + "\xF2\x79" => "\xE7\x9F\x89", + "\xF2\x7A" => "\xE7\x9F\x8A", + "\xF2\x7B" => "\xE7\x9F\x84", + "\xF2\x7C" => "\xE7\x9F\xB1", + "\xF2\x7D" => "\xE7\xA4\x9D", + "\xF2\x7E" => "\xE7\xA4\x9B", + "\xF2\xA1" => "\xE7\xA4\xA1", + "\xF2\xA2" => "\xE7\xA4\x9C", + "\xF2\xA3" => "\xE7\xA4\x97", + "\xF2\xA4" => "\xE7\xA4\x9E", + "\xF2\xA5" => "\xE7\xA6\xB0", + "\xF2\xA6" => "\xE7\xA9\xA7", + "\xF2\xA7" => "\xE7\xA9\xA8", + "\xF2\xA8" => "\xE7\xB0\xB3", + "\xF2\xA9" => "\xE7\xB0\xBC", + "\xF2\xAA" => "\xE7\xB0\xB9", + "\xF2\xAB" => "\xE7\xB0\xAC", + "\xF2\xAC" => "\xE7\xB0\xBB", + "\xF2\xAD" => "\xE7\xB3\xAC", + "\xF2\xAE" => "\xE7\xB3\xAA", + "\xF2\xAF" => "\xE7\xB9\xB6", + "\xF2\xB0" => "\xE7\xB9\xB5", + "\xF2\xB1" => "\xE7\xB9\xB8", + "\xF2\xB2" => "\xE7\xB9\xB0", + "\xF2\xB3" => "\xE7\xB9\xB7", + "\xF2\xB4" => "\xE7\xB9\xAF", + "\xF2\xB5" => "\xE7\xB9\xBA", + "\xF2\xB6" => "\xE7\xB9\xB2", + "\xF2\xB7" => "\xE7\xB9\xB4", + "\xF2\xB8" => "\xE7\xB9\xA8", + "\xF2\xB9" => "\xE7\xBD\x8B", + "\xF2\xBA" => "\xE7\xBD\x8A", + "\xF2\xBB" => "\xE7\xBE\x83", + "\xF2\xBC" => "\xE7\xBE\x86", + "\xF2\xBD" => "\xE7\xBE\xB7", + "\xF2\xBE" => "\xE7\xBF\xBD", + "\xF2\xBF" => "\xE7\xBF\xBE", + "\xF2\xC0" => "\xE8\x81\xB8", + "\xF2\xC1" => "\xE8\x87\x97", + "\xF2\xC2" => "\xE8\x87\x95", + "\xF2\xC3" => "\xE8\x89\xA4", + "\xF2\xC4" => "\xE8\x89\xA1", + "\xF2\xC5" => "\xE8\x89\xA3", + "\xF2\xC6" => "\xE8\x97\xAB", + "\xF2\xC7" => "\xE8\x97\xB1", + "\xF2\xC8" => "\xE8\x97\xAD", + "\xF2\xC9" => "\xE8\x97\x99", + "\xF2\xCA" => "\xE8\x97\xA1", + "\xF2\xCB" => "\xE8\x97\xA8", + "\xF2\xCC" => "\xE8\x97\x9A", + "\xF2\xCD" => "\xE8\x97\x97", + "\xF2\xCE" => "\xE8\x97\xAC", + "\xF2\xCF" => "\xE8\x97\xB2", + "\xF2\xD0" => "\xE8\x97\xB8", + "\xF2\xD1" => "\xE8\x97\x98", + "\xF2\xD2" => "\xE8\x97\x9F", + "\xF2\xD3" => "\xE8\x97\xA3", + "\xF2\xD4" => "\xE8\x97\x9C", + "\xF2\xD5" => "\xE8\x97\x91", + "\xF2\xD6" => "\xE8\x97\xB0", + "\xF2\xD7" => "\xE8\x97\xA6", + "\xF2\xD8" => "\xE8\x97\xAF", + "\xF2\xD9" => "\xE8\x97\x9E", + "\xF2\xDA" => "\xE8\x97\xA2", + "\xF2\xDB" => "\xE8\xA0\x80", + "\xF2\xDC" => "\xE8\x9F\xBA", + "\xF2\xDD" => "\xE8\xA0\x83", + "\xF2\xDE" => "\xE8\x9F\xB6", + "\xF2\xDF" => "\xE8\x9F\xB7", + "\xF2\xE0" => "\xE8\xA0\x89", + "\xF2\xE1" => "\xE8\xA0\x8C", + "\xF2\xE2" => "\xE8\xA0\x8B", + "\xF2\xE3" => "\xE8\xA0\x86", + "\xF2\xE4" => "\xE8\x9F\xBC", + "\xF2\xE5" => "\xE8\xA0\x88", + "\xF2\xE6" => "\xE8\x9F\xBF", + "\xF2\xE7" => "\xE8\xA0\x8A", + "\xF2\xE8" => "\xE8\xA0\x82", + "\xF2\xE9" => "\xE8\xA5\xA2", + "\xF2\xEA" => "\xE8\xA5\x9A", + "\xF2\xEB" => "\xE8\xA5\x9B", + "\xF2\xEC" => "\xE8\xA5\x97", + "\xF2\xED" => "\xE8\xA5\xA1", + "\xF2\xEE" => "\xE8\xA5\x9C", + "\xF2\xEF" => "\xE8\xA5\x98", + "\xF2\xF0" => "\xE8\xA5\x9D", + "\xF2\xF1" => "\xE8\xA5\x99", + "\xF2\xF2" => "\xE8\xA6\x88", + "\xF2\xF3" => "\xE8\xA6\xB7", + "\xF2\xF4" => "\xE8\xA6\xB6", + "\xF2\xF5" => "\xE8\xA7\xB6", + "\xF2\xF6" => "\xE8\xAD\x90", + "\xF2\xF7" => "\xE8\xAD\x88", + "\xF2\xF8" => "\xE8\xAD\x8A", + "\xF2\xF9" => "\xE8\xAD\x80", + "\xF2\xFA" => "\xE8\xAD\x93", + "\xF2\xFB" => "\xE8\xAD\x96", + "\xF2\xFC" => "\xE8\xAD\x94", + "\xF2\xFD" => "\xE8\xAD\x8B", + "\xF2\xFE" => "\xE8\xAD\x95", + "\xF3\x40" => "\xE8\xAD\x91", + "\xF3\x41" => "\xE8\xAD\x82", + "\xF3\x42" => "\xE8\xAD\x92", + "\xF3\x43" => "\xE8\xAD\x97", + "\xF3\x44" => "\xE8\xB1\x83", + "\xF3\x45" => "\xE8\xB1\xB7", + "\xF3\x46" => "\xE8\xB1\xB6", + "\xF3\x47" => "\xE8\xB2\x9A", + "\xF3\x48" => "\xE8\xB4\x86", + "\xF3\x49" => "\xE8\xB4\x87", + "\xF3\x4A" => "\xE8\xB4\x89", + "\xF3\x4B" => "\xE8\xB6\xAC", + "\xF3\x4C" => "\xE8\xB6\xAA", + "\xF3\x4D" => "\xE8\xB6\xAD", + "\xF3\x4E" => "\xE8\xB6\xAB", + "\xF3\x4F" => "\xE8\xB9\xAD", + "\xF3\x50" => "\xE8\xB9\xB8", + "\xF3\x51" => "\xE8\xB9\xB3", + "\xF3\x52" => "\xE8\xB9\xAA", + "\xF3\x53" => "\xE8\xB9\xAF", + "\xF3\x54" => "\xE8\xB9\xBB", + "\xF3\x55" => "\xE8\xBB\x82", + "\xF3\x56" => "\xE8\xBD\x92", + "\xF3\x57" => "\xE8\xBD\x91", + "\xF3\x58" => "\xE8\xBD\x8F", + "\xF3\x59" => "\xE8\xBD\x90", + "\xF3\x5A" => "\xE8\xBD\x93", + "\xF3\x5B" => "\xE8\xBE\xB4", + "\xF3\x5C" => "\xE9\x85\x80", + "\xF3\x5D" => "\xE9\x84\xBF", + "\xF3\x5E" => "\xE9\x86\xB0", + "\xF3\x5F" => "\xE9\x86\xAD", + "\xF3\x60" => "\xE9\x8F\x9E", + "\xF3\x61" => "\xE9\x8F\x87", + "\xF3\x62" => "\xE9\x8F\x8F", + "\xF3\x63" => "\xE9\x8F\x82", + "\xF3\x64" => "\xE9\x8F\x9A", + "\xF3\x65" => "\xE9\x8F\x90", + "\xF3\x66" => "\xE9\x8F\xB9", + "\xF3\x67" => "\xE9\x8F\xAC", + "\xF3\x68" => "\xE9\x8F\x8C", + "\xF3\x69" => "\xE9\x8F\x99", + "\xF3\x6A" => "\xE9\x8E\xA9", + "\xF3\x6B" => "\xE9\x8F\xA6", + "\xF3\x6C" => "\xE9\x8F\x8A", + "\xF3\x6D" => "\xE9\x8F\x94", + "\xF3\x6E" => "\xE9\x8F\xAE", + "\xF3\x6F" => "\xE9\x8F\xA3", + "\xF3\x70" => "\xE9\x8F\x95", + "\xF3\x71" => "\xE9\x8F\x84", + "\xF3\x72" => "\xE9\x8F\x8E", + "\xF3\x73" => "\xE9\x8F\x80", + "\xF3\x74" => "\xE9\x8F\x92", + "\xF3\x75" => "\xE9\x8F\xA7", + "\xF3\x76" => "\xE9\x95\xBD", + "\xF3\x77" => "\xE9\x97\x9A", + "\xF3\x78" => "\xE9\x97\x9B", + "\xF3\x79" => "\xE9\x9B\xA1", + "\xF3\x7A" => "\xE9\x9C\xA9", + "\xF3\x7B" => "\xE9\x9C\xAB", + "\xF3\x7C" => "\xE9\x9C\xAC", + "\xF3\x7D" => "\xE9\x9C\xA8", + "\xF3\x7E" => "\xE9\x9C\xA6", + "\xF3\xA1" => "\xE9\x9E\xB3", + "\xF3\xA2" => "\xE9\x9E\xB7", + "\xF3\xA3" => "\xE9\x9E\xB6", + "\xF3\xA4" => "\xE9\x9F\x9D", + "\xF3\xA5" => "\xE9\x9F\x9E", + "\xF3\xA6" => "\xE9\x9F\x9F", + "\xF3\xA7" => "\xE9\xA1\x9C", + "\xF3\xA8" => "\xE9\xA1\x99", + "\xF3\xA9" => "\xE9\xA1\x9D", + "\xF3\xAA" => "\xE9\xA1\x97", + "\xF3\xAB" => "\xE9\xA2\xBF", + "\xF3\xAC" => "\xE9\xA2\xBD", + "\xF3\xAD" => "\xE9\xA2\xBB", + "\xF3\xAE" => "\xE9\xA2\xBE", + "\xF3\xAF" => "\xE9\xA5\x88", + "\xF3\xB0" => "\xE9\xA5\x87", + "\xF3\xB1" => "\xE9\xA5\x83", + "\xF3\xB2" => "\xE9\xA6\xA6", + "\xF3\xB3" => "\xE9\xA6\xA7", + "\xF3\xB4" => "\xE9\xA8\x9A", + "\xF3\xB5" => "\xE9\xA8\x95", + "\xF3\xB6" => "\xE9\xA8\xA5", + "\xF3\xB7" => "\xE9\xA8\x9D", + "\xF3\xB8" => "\xE9\xA8\xA4", + "\xF3\xB9" => "\xE9\xA8\x9B", + "\xF3\xBA" => "\xE9\xA8\xA2", + "\xF3\xBB" => "\xE9\xA8\xA0", + "\xF3\xBC" => "\xE9\xA8\xA7", + "\xF3\xBD" => "\xE9\xA8\xA3", + "\xF3\xBE" => "\xE9\xA8\x9E", + "\xF3\xBF" => "\xE9\xA8\x9C", + "\xF3\xC0" => "\xE9\xA8\x94", + "\xF3\xC1" => "\xE9\xAB\x82", + "\xF3\xC2" => "\xE9\xAC\x8B", + "\xF3\xC3" => "\xE9\xAC\x8A", + "\xF3\xC4" => "\xE9\xAC\x8E", + "\xF3\xC5" => "\xE9\xAC\x8C", + "\xF3\xC6" => "\xE9\xAC\xB7", + "\xF3\xC7" => "\xE9\xAF\xAA", + "\xF3\xC8" => "\xE9\xAF\xAB", + "\xF3\xC9" => "\xE9\xAF\xA0", + "\xF3\xCA" => "\xE9\xAF\x9E", + "\xF3\xCB" => "\xE9\xAF\xA4", + "\xF3\xCC" => "\xE9\xAF\xA6", + "\xF3\xCD" => "\xE9\xAF\xA2", + "\xF3\xCE" => "\xE9\xAF\xB0", + "\xF3\xCF" => "\xE9\xAF\x94", + "\xF3\xD0" => "\xE9\xAF\x97", + "\xF3\xD1" => "\xE9\xAF\xAC", + "\xF3\xD2" => "\xE9\xAF\x9C", + "\xF3\xD3" => "\xE9\xAF\x99", + "\xF3\xD4" => "\xE9\xAF\xA5", + "\xF3\xD5" => "\xE9\xAF\x95", + "\xF3\xD6" => "\xE9\xAF\xA1", + "\xF3\xD7" => "\xE9\xAF\x9A", + "\xF3\xD8" => "\xE9\xB5\xB7", + "\xF3\xD9" => "\xE9\xB6\x81", + "\xF3\xDA" => "\xE9\xB6\x8A", + "\xF3\xDB" => "\xE9\xB6\x84", + "\xF3\xDC" => "\xE9\xB6\x88", + "\xF3\xDD" => "\xE9\xB5\xB1", + "\xF3\xDE" => "\xE9\xB6\x80", + "\xF3\xDF" => "\xE9\xB5\xB8", + "\xF3\xE0" => "\xE9\xB6\x86", + "\xF3\xE1" => "\xE9\xB6\x8B", + "\xF3\xE2" => "\xE9\xB6\x8C", + "\xF3\xE3" => "\xE9\xB5\xBD", + "\xF3\xE4" => "\xE9\xB5\xAB", + "\xF3\xE5" => "\xE9\xB5\xB4", + "\xF3\xE6" => "\xE9\xB5\xB5", + "\xF3\xE7" => "\xE9\xB5\xB0", + "\xF3\xE8" => "\xE9\xB5\xA9", + "\xF3\xE9" => "\xE9\xB6\x85", + "\xF3\xEA" => "\xE9\xB5\xB3", + "\xF3\xEB" => "\xE9\xB5\xBB", + "\xF3\xEC" => "\xE9\xB6\x82", + "\xF3\xED" => "\xE9\xB5\xAF", + "\xF3\xEE" => "\xE9\xB5\xB9", + "\xF3\xEF" => "\xE9\xB5\xBF", + "\xF3\xF0" => "\xE9\xB6\x87", + "\xF3\xF1" => "\xE9\xB5\xA8", + "\xF3\xF2" => "\xE9\xBA\x94", + "\xF3\xF3" => "\xE9\xBA\x91", + "\xF3\xF4" => "\xE9\xBB\x80", + "\xF3\xF5" => "\xE9\xBB\xBC", + "\xF3\xF6" => "\xE9\xBC\xAD", + "\xF3\xF7" => "\xE9\xBD\x80", + "\xF3\xF8" => "\xE9\xBD\x81", + "\xF3\xF9" => "\xE9\xBD\x8D", + "\xF3\xFA" => "\xE9\xBD\x96", + "\xF3\xFB" => "\xE9\xBD\x97", + "\xF3\xFC" => "\xE9\xBD\x98", + "\xF3\xFD" => "\xE5\x8C\xB7", + "\xF3\xFE" => "\xE5\x9A\xB2", + "\xF4\x40" => "\xE5\x9A\xB5", + "\xF4\x41" => "\xE5\x9A\xB3", + "\xF4\x42" => "\xE5\xA3\xA3", + "\xF4\x43" => "\xE5\xAD\x85", + "\xF4\x44" => "\xE5\xB7\x86", + "\xF4\x45" => "\xE5\xB7\x87", + "\xF4\x46" => "\xE5\xBB\xAE", + "\xF4\x47" => "\xE5\xBB\xAF", + "\xF4\x48" => "\xE5\xBF\x80", + "\xF4\x49" => "\xE5\xBF\x81", + "\xF4\x4A" => "\xE6\x87\xB9", + "\xF4\x4B" => "\xE6\x94\x97", + "\xF4\x4C" => "\xE6\x94\x96", + "\xF4\x4D" => "\xE6\x94\x95", + "\xF4\x4E" => "\xE6\x94\x93", + "\xF4\x4F" => "\xE6\x97\x9F", + "\xF4\x50" => "\xE6\x9B\xA8", + "\xF4\x51" => "\xE6\x9B\xA3", + "\xF4\x52" => "\xE6\x9B\xA4", + "\xF4\x53" => "\xE6\xAB\xB3", + "\xF4\x54" => "\xE6\xAB\xB0", + "\xF4\x55" => "\xE6\xAB\xAA", + "\xF4\x56" => "\xE6\xAB\xA8", + "\xF4\x57" => "\xE6\xAB\xB9", + "\xF4\x58" => "\xE6\xAB\xB1", + "\xF4\x59" => "\xE6\xAB\xAE", + "\xF4\x5A" => "\xE6\xAB\xAF", + "\xF4\x5B" => "\xE7\x80\xBC", + "\xF4\x5C" => "\xE7\x80\xB5", + "\xF4\x5D" => "\xE7\x80\xAF", + "\xF4\x5E" => "\xE7\x80\xB7", + "\xF4\x5F" => "\xE7\x80\xB4", + "\xF4\x60" => "\xE7\x80\xB1", + "\xF4\x61" => "\xE7\x81\x82", + "\xF4\x62" => "\xE7\x80\xB8", + "\xF4\x63" => "\xE7\x80\xBF", + "\xF4\x64" => "\xE7\x80\xBA", + "\xF4\x65" => "\xE7\x80\xB9", + "\xF4\x66" => "\xE7\x81\x80", + "\xF4\x67" => "\xE7\x80\xBB", + "\xF4\x68" => "\xE7\x80\xB3", + "\xF4\x69" => "\xE7\x81\x81", + "\xF4\x6A" => "\xE7\x88\x93", + "\xF4\x6B" => "\xE7\x88\x94", + "\xF4\x6C" => "\xE7\x8A\xA8", + "\xF4\x6D" => "\xE7\x8D\xBD", + "\xF4\x6E" => "\xE7\x8D\xBC", + "\xF4\x6F" => "\xE7\x92\xBA", + "\xF4\x70" => "\xE7\x9A\xAB", + "\xF4\x71" => "\xE7\x9A\xAA", + "\xF4\x72" => "\xE7\x9A\xBE", + "\xF4\x73" => "\xE7\x9B\xAD", + "\xF4\x74" => "\xE7\x9F\x8C", + "\xF4\x75" => "\xE7\x9F\x8E", + "\xF4\x76" => "\xE7\x9F\x8F", + "\xF4\x77" => "\xE7\x9F\x8D", + "\xF4\x78" => "\xE7\x9F\xB2", + "\xF4\x79" => "\xE7\xA4\xA5", + "\xF4\x7A" => "\xE7\xA4\xA3", + "\xF4\x7B" => "\xE7\xA4\xA7", + "\xF4\x7C" => "\xE7\xA4\xA8", + "\xF4\x7D" => "\xE7\xA4\xA4", + "\xF4\x7E" => "\xE7\xA4\xA9", + "\xF4\xA1" => "\xE7\xA6\xB2", + "\xF4\xA2" => "\xE7\xA9\xAE", + "\xF4\xA3" => "\xE7\xA9\xAC", + "\xF4\xA4" => "\xE7\xA9\xAD", + "\xF4\xA5" => "\xE7\xAB\xB7", + "\xF4\xA6" => "\xE7\xB1\x89", + "\xF4\xA7" => "\xE7\xB1\x88", + "\xF4\xA8" => "\xE7\xB1\x8A", + "\xF4\xA9" => "\xE7\xB1\x87", + "\xF4\xAA" => "\xE7\xB1\x85", + "\xF4\xAB" => "\xE7\xB3\xAE", + "\xF4\xAC" => "\xE7\xB9\xBB", + "\xF4\xAD" => "\xE7\xB9\xBE", + "\xF4\xAE" => "\xE7\xBA\x81", + "\xF4\xAF" => "\xE7\xBA\x80", + "\xF4\xB0" => "\xE7\xBE\xBA", + "\xF4\xB1" => "\xE7\xBF\xBF", + "\xF4\xB2" => "\xE8\x81\xB9", + "\xF4\xB3" => "\xE8\x87\x9B", + "\xF4\xB4" => "\xE8\x87\x99", + "\xF4\xB5" => "\xE8\x88\x8B", + "\xF4\xB6" => "\xE8\x89\xA8", + "\xF4\xB7" => "\xE8\x89\xA9", + "\xF4\xB8" => "\xE8\x98\xA2", + "\xF4\xB9" => "\xE8\x97\xBF", + "\xF4\xBA" => "\xE8\x98\x81", + "\xF4\xBB" => "\xE8\x97\xBE", + "\xF4\xBC" => "\xE8\x98\x9B", + "\xF4\xBD" => "\xE8\x98\x80", + "\xF4\xBE" => "\xE8\x97\xB6", + "\xF4\xBF" => "\xE8\x98\x84", + "\xF4\xC0" => "\xE8\x98\x89", + "\xF4\xC1" => "\xE8\x98\x85", + "\xF4\xC2" => "\xE8\x98\x8C", + "\xF4\xC3" => "\xE8\x97\xBD", + "\xF4\xC4" => "\xE8\xA0\x99", + "\xF4\xC5" => "\xE8\xA0\x90", + "\xF4\xC6" => "\xE8\xA0\x91", + "\xF4\xC7" => "\xE8\xA0\x97", + "\xF4\xC8" => "\xE8\xA0\x93", + "\xF4\xC9" => "\xE8\xA0\x96", + "\xF4\xCA" => "\xE8\xA5\xA3", + "\xF4\xCB" => "\xE8\xA5\xA6", + "\xF4\xCC" => "\xE8\xA6\xB9", + "\xF4\xCD" => "\xE8\xA7\xB7", + "\xF4\xCE" => "\xE8\xAD\xA0", + "\xF4\xCF" => "\xE8\xAD\xAA", + "\xF4\xD0" => "\xE8\xAD\x9D", + "\xF4\xD1" => "\xE8\xAD\xA8", + "\xF4\xD2" => "\xE8\xAD\xA3", + "\xF4\xD3" => "\xE8\xAD\xA5", + "\xF4\xD4" => "\xE8\xAD\xA7", + "\xF4\xD5" => "\xE8\xAD\xAD", + "\xF4\xD6" => "\xE8\xB6\xAE", + "\xF4\xD7" => "\xE8\xBA\x86", + "\xF4\xD8" => "\xE8\xBA\x88", + "\xF4\xD9" => "\xE8\xBA\x84", + "\xF4\xDA" => "\xE8\xBD\x99", + "\xF4\xDB" => "\xE8\xBD\x96", + "\xF4\xDC" => "\xE8\xBD\x97", + "\xF4\xDD" => "\xE8\xBD\x95", + "\xF4\xDE" => "\xE8\xBD\x98", + "\xF4\xDF" => "\xE8\xBD\x9A", + "\xF4\xE0" => "\xE9\x82\x8D", + "\xF4\xE1" => "\xE9\x85\x83", + "\xF4\xE2" => "\xE9\x85\x81", + "\xF4\xE3" => "\xE9\x86\xB7", + "\xF4\xE4" => "\xE9\x86\xB5", + "\xF4\xE5" => "\xE9\x86\xB2", + "\xF4\xE6" => "\xE9\x86\xB3", + "\xF4\xE7" => "\xE9\x90\x8B", + "\xF4\xE8" => "\xE9\x90\x93", + "\xF4\xE9" => "\xE9\x8F\xBB", + "\xF4\xEA" => "\xE9\x90\xA0", + "\xF4\xEB" => "\xE9\x90\x8F", + "\xF4\xEC" => "\xE9\x90\x94", + "\xF4\xED" => "\xE9\x8F\xBE", + "\xF4\xEE" => "\xE9\x90\x95", + "\xF4\xEF" => "\xE9\x90\x90", + "\xF4\xF0" => "\xE9\x90\xA8", + "\xF4\xF1" => "\xE9\x90\x99", + "\xF4\xF2" => "\xE9\x90\x8D", + "\xF4\xF3" => "\xE9\x8F\xB5", + "\xF4\xF4" => "\xE9\x90\x80", + "\xF4\xF5" => "\xE9\x8F\xB7", + "\xF4\xF6" => "\xE9\x90\x87", + "\xF4\xF7" => "\xE9\x90\x8E", + "\xF4\xF8" => "\xE9\x90\x96", + "\xF4\xF9" => "\xE9\x90\x92", + "\xF4\xFA" => "\xE9\x8F\xBA", + "\xF4\xFB" => "\xE9\x90\x89", + "\xF4\xFC" => "\xE9\x8F\xB8", + "\xF4\xFD" => "\xE9\x90\x8A", + "\xF4\xFE" => "\xE9\x8F\xBF", + "\xF5\x40" => "\xE9\x8F\xBC", + "\xF5\x41" => "\xE9\x90\x8C", + "\xF5\x42" => "\xE9\x8F\xB6", + "\xF5\x43" => "\xE9\x90\x91", + "\xF5\x44" => "\xE9\x90\x86", + "\xF5\x45" => "\xE9\x97\x9E", + "\xF5\x46" => "\xE9\x97\xA0", + "\xF5\x47" => "\xE9\x97\x9F", + "\xF5\x48" => "\xE9\x9C\xAE", + "\xF5\x49" => "\xE9\x9C\xAF", + "\xF5\x4A" => "\xE9\x9E\xB9", + "\xF5\x4B" => "\xE9\x9E\xBB", + "\xF5\x4C" => "\xE9\x9F\xBD", + "\xF5\x4D" => "\xE9\x9F\xBE", + "\xF5\x4E" => "\xE9\xA1\xA0", + "\xF5\x4F" => "\xE9\xA1\xA2", + "\xF5\x50" => "\xE9\xA1\xA3", + "\xF5\x51" => "\xE9\xA1\x9F", + "\xF5\x52" => "\xE9\xA3\x81", + "\xF5\x53" => "\xE9\xA3\x82", + "\xF5\x54" => "\xE9\xA5\x90", + "\xF5\x55" => "\xE9\xA5\x8E", + "\xF5\x56" => "\xE9\xA5\x99", + "\xF5\x57" => "\xE9\xA5\x8C", + "\xF5\x58" => "\xE9\xA5\x8B", + "\xF5\x59" => "\xE9\xA5\x93", + "\xF5\x5A" => "\xE9\xA8\xB2", + "\xF5\x5B" => "\xE9\xA8\xB4", + "\xF5\x5C" => "\xE9\xA8\xB1", + "\xF5\x5D" => "\xE9\xA8\xAC", + "\xF5\x5E" => "\xE9\xA8\xAA", + "\xF5\x5F" => "\xE9\xA8\xB6", + "\xF5\x60" => "\xE9\xA8\xA9", + "\xF5\x61" => "\xE9\xA8\xAE", + "\xF5\x62" => "\xE9\xA8\xB8", + "\xF5\x63" => "\xE9\xA8\xAD", + "\xF5\x64" => "\xE9\xAB\x87", + "\xF5\x65" => "\xE9\xAB\x8A", + "\xF5\x66" => "\xE9\xAB\x86", + "\xF5\x67" => "\xE9\xAC\x90", + "\xF5\x68" => "\xE9\xAC\x92", + "\xF5\x69" => "\xE9\xAC\x91", + "\xF5\x6A" => "\xE9\xB0\x8B", + "\xF5\x6B" => "\xE9\xB0\x88", + "\xF5\x6C" => "\xE9\xAF\xB7", + "\xF5\x6D" => "\xE9\xB0\x85", + "\xF5\x6E" => "\xE9\xB0\x92", + "\xF5\x6F" => "\xE9\xAF\xB8", + "\xF5\x70" => "\xE9\xB1\x80", + "\xF5\x71" => "\xE9\xB0\x87", + "\xF5\x72" => "\xE9\xB0\x8E", + "\xF5\x73" => "\xE9\xB0\x86", + "\xF5\x74" => "\xE9\xB0\x97", + "\xF5\x75" => "\xE9\xB0\x94", + "\xF5\x76" => "\xE9\xB0\x89", + "\xF5\x77" => "\xE9\xB6\x9F", + "\xF5\x78" => "\xE9\xB6\x99", + "\xF5\x79" => "\xE9\xB6\xA4", + "\xF5\x7A" => "\xE9\xB6\x9D", + "\xF5\x7B" => "\xE9\xB6\x92", + "\xF5\x7C" => "\xE9\xB6\x98", + "\xF5\x7D" => "\xE9\xB6\x90", + "\xF5\x7E" => "\xE9\xB6\x9B", + "\xF5\xA1" => "\xE9\xB6\xA0", + "\xF5\xA2" => "\xE9\xB6\x94", + "\xF5\xA3" => "\xE9\xB6\x9C", + "\xF5\xA4" => "\xE9\xB6\xAA", + "\xF5\xA5" => "\xE9\xB6\x97", + "\xF5\xA6" => "\xE9\xB6\xA1", + "\xF5\xA7" => "\xE9\xB6\x9A", + "\xF5\xA8" => "\xE9\xB6\xA2", + "\xF5\xA9" => "\xE9\xB6\xA8", + "\xF5\xAA" => "\xE9\xB6\x9E", + "\xF5\xAB" => "\xE9\xB6\xA3", + "\xF5\xAC" => "\xE9\xB6\xBF", + "\xF5\xAD" => "\xE9\xB6\xA9", + "\xF5\xAE" => "\xE9\xB6\x96", + "\xF5\xAF" => "\xE9\xB6\xA6", + "\xF5\xB0" => "\xE9\xB6\xA7", + "\xF5\xB1" => "\xE9\xBA\x99", + "\xF5\xB2" => "\xE9\xBA\x9B", + "\xF5\xB3" => "\xE9\xBA\x9A", + "\xF5\xB4" => "\xE9\xBB\xA5", + "\xF5\xB5" => "\xE9\xBB\xA4", + "\xF5\xB6" => "\xE9\xBB\xA7", + "\xF5\xB7" => "\xE9\xBB\xA6", + "\xF5\xB8" => "\xE9\xBC\xB0", + "\xF5\xB9" => "\xE9\xBC\xAE", + "\xF5\xBA" => "\xE9\xBD\x9B", + "\xF5\xBB" => "\xE9\xBD\xA0", + "\xF5\xBC" => "\xE9\xBD\x9E", + "\xF5\xBD" => "\xE9\xBD\x9D", + "\xF5\xBE" => "\xE9\xBD\x99", + "\xF5\xBF" => "\xE9\xBE\x91", + "\xF5\xC0" => "\xE5\x84\xBA", + "\xF5\xC1" => "\xE5\x84\xB9", + "\xF5\xC2" => "\xE5\x8A\x98", + "\xF5\xC3" => "\xE5\x8A\x97", + "\xF5\xC4" => "\xE5\x9B\x83", + "\xF5\xC5" => "\xE5\x9A\xBD", + "\xF5\xC6" => "\xE5\x9A\xBE", + "\xF5\xC7" => "\xE5\xAD\x88", + "\xF5\xC8" => "\xE5\xAD\x87", + "\xF5\xC9" => "\xE5\xB7\x8B", + "\xF5\xCA" => "\xE5\xB7\x8F", + "\xF5\xCB" => "\xE5\xBB\xB1", + "\xF5\xCC" => "\xE6\x87\xBD", + "\xF5\xCD" => "\xE6\x94\x9B", + "\xF5\xCE" => "\xE6\xAC\x82", + "\xF5\xCF" => "\xE6\xAB\xBC", + "\xF5\xD0" => "\xE6\xAC\x83", + "\xF5\xD1" => "\xE6\xAB\xB8", + "\xF5\xD2" => "\xE6\xAC\x80", + "\xF5\xD3" => "\xE7\x81\x83", + "\xF5\xD4" => "\xE7\x81\x84", + "\xF5\xD5" => "\xE7\x81\x8A", + "\xF5\xD6" => "\xE7\x81\x88", + "\xF5\xD7" => "\xE7\x81\x89", + "\xF5\xD8" => "\xE7\x81\x85", + "\xF5\xD9" => "\xE7\x81\x86", + "\xF5\xDA" => "\xE7\x88\x9D", + "\xF5\xDB" => "\xE7\x88\x9A", + "\xF5\xDC" => "\xE7\x88\x99", + "\xF5\xDD" => "\xE7\x8D\xBE", + "\xF5\xDE" => "\xE7\x94\x97", + "\xF5\xDF" => "\xE7\x99\xAA", + "\xF5\xE0" => "\xE7\x9F\x90", + "\xF5\xE1" => "\xE7\xA4\xAD", + "\xF5\xE2" => "\xE7\xA4\xB1", + "\xF5\xE3" => "\xE7\xA4\xAF", + "\xF5\xE4" => "\xE7\xB1\x94", + "\xF5\xE5" => "\xE7\xB1\x93", + "\xF5\xE6" => "\xE7\xB3\xB2", + "\xF5\xE7" => "\xE7\xBA\x8A", + "\xF5\xE8" => "\xE7\xBA\x87", + "\xF5\xE9" => "\xE7\xBA\x88", + "\xF5\xEA" => "\xE7\xBA\x8B", + "\xF5\xEB" => "\xE7\xBA\x86", + "\xF5\xEC" => "\xE7\xBA\x8D", + "\xF5\xED" => "\xE7\xBD\x8D", + "\xF5\xEE" => "\xE7\xBE\xBB", + "\xF5\xEF" => "\xE8\x80\xB0", + "\xF5\xF0" => "\xE8\x87\x9D", + "\xF5\xF1" => "\xE8\x98\x98", + "\xF5\xF2" => "\xE8\x98\xAA", + "\xF5\xF3" => "\xE8\x98\xA6", + "\xF5\xF4" => "\xE8\x98\x9F", + "\xF5\xF5" => "\xE8\x98\xA3", + "\xF5\xF6" => "\xE8\x98\x9C", + "\xF5\xF7" => "\xE8\x98\x99", + "\xF5\xF8" => "\xE8\x98\xA7", + "\xF5\xF9" => "\xE8\x98\xAE", + "\xF5\xFA" => "\xE8\x98\xA1", + "\xF5\xFB" => "\xE8\x98\xA0", + "\xF5\xFC" => "\xE8\x98\xA9", + "\xF5\xFD" => "\xE8\x98\x9E", + "\xF5\xFE" => "\xE8\x98\xA5", + "\xF6\x40" => "\xE8\xA0\xA9", + "\xF6\x41" => "\xE8\xA0\x9D", + "\xF6\x42" => "\xE8\xA0\x9B", + "\xF6\x43" => "\xE8\xA0\xA0", + "\xF6\x44" => "\xE8\xA0\xA4", + "\xF6\x45" => "\xE8\xA0\x9C", + "\xF6\x46" => "\xE8\xA0\xAB", + "\xF6\x47" => "\xE8\xA1\x8A", + "\xF6\x48" => "\xE8\xA5\xAD", + "\xF6\x49" => "\xE8\xA5\xA9", + "\xF6\x4A" => "\xE8\xA5\xAE", + "\xF6\x4B" => "\xE8\xA5\xAB", + "\xF6\x4C" => "\xE8\xA7\xBA", + "\xF6\x4D" => "\xE8\xAD\xB9", + "\xF6\x4E" => "\xE8\xAD\xB8", + "\xF6\x4F" => "\xE8\xAD\x85", + "\xF6\x50" => "\xE8\xAD\xBA", + "\xF6\x51" => "\xE8\xAD\xBB", + "\xF6\x52" => "\xE8\xB4\x90", + "\xF6\x53" => "\xE8\xB4\x94", + "\xF6\x54" => "\xE8\xB6\xAF", + "\xF6\x55" => "\xE8\xBA\x8E", + "\xF6\x56" => "\xE8\xBA\x8C", + "\xF6\x57" => "\xE8\xBD\x9E", + "\xF6\x58" => "\xE8\xBD\x9B", + "\xF6\x59" => "\xE8\xBD\x9D", + "\xF6\x5A" => "\xE9\x85\x86", + "\xF6\x5B" => "\xE9\x85\x84", + "\xF6\x5C" => "\xE9\x85\x85", + "\xF6\x5D" => "\xE9\x86\xB9", + "\xF6\x5E" => "\xE9\x90\xBF", + "\xF6\x5F" => "\xE9\x90\xBB", + "\xF6\x60" => "\xE9\x90\xB6", + "\xF6\x61" => "\xE9\x90\xA9", + "\xF6\x62" => "\xE9\x90\xBD", + "\xF6\x63" => "\xE9\x90\xBC", + "\xF6\x64" => "\xE9\x90\xB0", + "\xF6\x65" => "\xE9\x90\xB9", + "\xF6\x66" => "\xE9\x90\xAA", + "\xF6\x67" => "\xE9\x90\xB7", + "\xF6\x68" => "\xE9\x90\xAC", + "\xF6\x69" => "\xE9\x91\x80", + "\xF6\x6A" => "\xE9\x90\xB1", + "\xF6\x6B" => "\xE9\x97\xA5", + "\xF6\x6C" => "\xE9\x97\xA4", + "\xF6\x6D" => "\xE9\x97\xA3", + "\xF6\x6E" => "\xE9\x9C\xB5", + "\xF6\x6F" => "\xE9\x9C\xBA", + "\xF6\x70" => "\xE9\x9E\xBF", + "\xF6\x71" => "\xE9\x9F\xA1", + "\xF6\x72" => "\xE9\xA1\xA4", + "\xF6\x73" => "\xE9\xA3\x89", + "\xF6\x74" => "\xE9\xA3\x86", + "\xF6\x75" => "\xE9\xA3\x80", + "\xF6\x76" => "\xE9\xA5\x98", + "\xF6\x77" => "\xE9\xA5\x96", + "\xF6\x78" => "\xE9\xA8\xB9", + "\xF6\x79" => "\xE9\xA8\xBD", + "\xF6\x7A" => "\xE9\xA9\x86", + "\xF6\x7B" => "\xE9\xA9\x84", + "\xF6\x7C" => "\xE9\xA9\x82", + "\xF6\x7D" => "\xE9\xA9\x81", + "\xF6\x7E" => "\xE9\xA8\xBA", + "\xF6\xA1" => "\xE9\xA8\xBF", + "\xF6\xA2" => "\xE9\xAB\x8D", + "\xF6\xA3" => "\xE9\xAC\x95", + "\xF6\xA4" => "\xE9\xAC\x97", + "\xF6\xA5" => "\xE9\xAC\x98", + "\xF6\xA6" => "\xE9\xAC\x96", + "\xF6\xA7" => "\xE9\xAC\xBA", + "\xF6\xA8" => "\xE9\xAD\x92", + "\xF6\xA9" => "\xE9\xB0\xAB", + "\xF6\xAA" => "\xE9\xB0\x9D", + "\xF6\xAB" => "\xE9\xB0\x9C", + "\xF6\xAC" => "\xE9\xB0\xAC", + "\xF6\xAD" => "\xE9\xB0\xA3", + "\xF6\xAE" => "\xE9\xB0\xA8", + "\xF6\xAF" => "\xE9\xB0\xA9", + "\xF6\xB0" => "\xE9\xB0\xA4", + "\xF6\xB1" => "\xE9\xB0\xA1", + "\xF6\xB2" => "\xE9\xB6\xB7", + "\xF6\xB3" => "\xE9\xB6\xB6", + "\xF6\xB4" => "\xE9\xB6\xBC", + "\xF6\xB5" => "\xE9\xB7\x81", + "\xF6\xB6" => "\xE9\xB7\x87", + "\xF6\xB7" => "\xE9\xB7\x8A", + "\xF6\xB8" => "\xE9\xB7\x8F", + "\xF6\xB9" => "\xE9\xB6\xBE", + "\xF6\xBA" => "\xE9\xB7\x85", + "\xF6\xBB" => "\xE9\xB7\x83", + "\xF6\xBC" => "\xE9\xB6\xBB", + "\xF6\xBD" => "\xE9\xB6\xB5", + "\xF6\xBE" => "\xE9\xB7\x8E", + "\xF6\xBF" => "\xE9\xB6\xB9", + "\xF6\xC0" => "\xE9\xB6\xBA", + "\xF6\xC1" => "\xE9\xB6\xAC", + "\xF6\xC2" => "\xE9\xB7\x88", + "\xF6\xC3" => "\xE9\xB6\xB1", + "\xF6\xC4" => "\xE9\xB6\xAD", + "\xF6\xC5" => "\xE9\xB7\x8C", + "\xF6\xC6" => "\xE9\xB6\xB3", + "\xF6\xC7" => "\xE9\xB7\x8D", + "\xF6\xC8" => "\xE9\xB6\xB2", + "\xF6\xC9" => "\xE9\xB9\xBA", + "\xF6\xCA" => "\xE9\xBA\x9C", + "\xF6\xCB" => "\xE9\xBB\xAB", + "\xF6\xCC" => "\xE9\xBB\xAE", + "\xF6\xCD" => "\xE9\xBB\xAD", + "\xF6\xCE" => "\xE9\xBC\x9B", + "\xF6\xCF" => "\xE9\xBC\x98", + "\xF6\xD0" => "\xE9\xBC\x9A", + "\xF6\xD1" => "\xE9\xBC\xB1", + "\xF6\xD2" => "\xE9\xBD\x8E", + "\xF6\xD3" => "\xE9\xBD\xA5", + "\xF6\xD4" => "\xE9\xBD\xA4", + "\xF6\xD5" => "\xE9\xBE\x92", + "\xF6\xD6" => "\xE4\xBA\xB9", + "\xF6\xD7" => "\xE5\x9B\x86", + "\xF6\xD8" => "\xE5\x9B\x85", + "\xF6\xD9" => "\xE5\x9B\x8B", + "\xF6\xDA" => "\xE5\xA5\xB1", + "\xF6\xDB" => "\xE5\xAD\x8B", + "\xF6\xDC" => "\xE5\xAD\x8C", + "\xF6\xDD" => "\xE5\xB7\x95", + "\xF6\xDE" => "\xE5\xB7\x91", + "\xF6\xDF" => "\xE5\xBB\xB2", + "\xF6\xE0" => "\xE6\x94\xA1", + "\xF6\xE1" => "\xE6\x94\xA0", + "\xF6\xE2" => "\xE6\x94\xA6", + "\xF6\xE3" => "\xE6\x94\xA2", + "\xF6\xE4" => "\xE6\xAC\x8B", + "\xF6\xE5" => "\xE6\xAC\x88", + "\xF6\xE6" => "\xE6\xAC\x89", + "\xF6\xE7" => "\xE6\xB0\x8D", + "\xF6\xE8" => "\xE7\x81\x95", + "\xF6\xE9" => "\xE7\x81\x96", + "\xF6\xEA" => "\xE7\x81\x97", + "\xF6\xEB" => "\xE7\x81\x92", + "\xF6\xEC" => "\xE7\x88\x9E", + "\xF6\xED" => "\xE7\x88\x9F", + "\xF6\xEE" => "\xE7\x8A\xA9", + "\xF6\xEF" => "\xE7\x8D\xBF", + "\xF6\xF0" => "\xE7\x93\x98", + "\xF6\xF1" => "\xE7\x93\x95", + "\xF6\xF2" => "\xE7\x93\x99", + "\xF6\xF3" => "\xE7\x93\x97", + "\xF6\xF4" => "\xE7\x99\xAD", + "\xF6\xF5" => "\xE7\x9A\xAD", + "\xF6\xF6" => "\xE7\xA4\xB5", + "\xF6\xF7" => "\xE7\xA6\xB4", + "\xF6\xF8" => "\xE7\xA9\xB0", + "\xF6\xF9" => "\xE7\xA9\xB1", + "\xF6\xFA" => "\xE7\xB1\x97", + "\xF6\xFB" => "\xE7\xB1\x9C", + "\xF6\xFC" => "\xE7\xB1\x99", + "\xF6\xFD" => "\xE7\xB1\x9B", + "\xF6\xFE" => "\xE7\xB1\x9A", + "\xF7\x40" => "\xE7\xB3\xB4", + "\xF7\x41" => "\xE7\xB3\xB1", + "\xF7\x42" => "\xE7\xBA\x91", + "\xF7\x43" => "\xE7\xBD\x8F", + "\xF7\x44" => "\xE7\xBE\x87", + "\xF7\x45" => "\xE8\x87\x9E", + "\xF7\x46" => "\xE8\x89\xAB", + "\xF7\x47" => "\xE8\x98\xB4", + "\xF7\x48" => "\xE8\x98\xB5", + "\xF7\x49" => "\xE8\x98\xB3", + "\xF7\x4A" => "\xE8\x98\xAC", + "\xF7\x4B" => "\xE8\x98\xB2", + "\xF7\x4C" => "\xE8\x98\xB6", + "\xF7\x4D" => "\xE8\xA0\xAC", + "\xF7\x4E" => "\xE8\xA0\xA8", + "\xF7\x4F" => "\xE8\xA0\xA6", + "\xF7\x50" => "\xE8\xA0\xAA", + "\xF7\x51" => "\xE8\xA0\xA5", + "\xF7\x52" => "\xE8\xA5\xB1", + "\xF7\x53" => "\xE8\xA6\xBF", + "\xF7\x54" => "\xE8\xA6\xBE", + "\xF7\x55" => "\xE8\xA7\xBB", + "\xF7\x56" => "\xE8\xAD\xBE", + "\xF7\x57" => "\xE8\xAE\x84", + "\xF7\x58" => "\xE8\xAE\x82", + "\xF7\x59" => "\xE8\xAE\x86", + "\xF7\x5A" => "\xE8\xAE\x85", + "\xF7\x5B" => "\xE8\xAD\xBF", + "\xF7\x5C" => "\xE8\xB4\x95", + "\xF7\x5D" => "\xE8\xBA\x95", + "\xF7\x5E" => "\xE8\xBA\x94", + "\xF7\x5F" => "\xE8\xBA\x9A", + "\xF7\x60" => "\xE8\xBA\x92", + "\xF7\x61" => "\xE8\xBA\x90", + "\xF7\x62" => "\xE8\xBA\x96", + "\xF7\x63" => "\xE8\xBA\x97", + "\xF7\x64" => "\xE8\xBD\xA0", + "\xF7\x65" => "\xE8\xBD\xA2", + "\xF7\x66" => "\xE9\x85\x87", + "\xF7\x67" => "\xE9\x91\x8C", + "\xF7\x68" => "\xE9\x91\x90", + "\xF7\x69" => "\xE9\x91\x8A", + "\xF7\x6A" => "\xE9\x91\x8B", + "\xF7\x6B" => "\xE9\x91\x8F", + "\xF7\x6C" => "\xE9\x91\x87", + "\xF7\x6D" => "\xE9\x91\x85", + "\xF7\x6E" => "\xE9\x91\x88", + "\xF7\x6F" => "\xE9\x91\x89", + "\xF7\x70" => "\xE9\x91\x86", + "\xF7\x71" => "\xE9\x9C\xBF", + "\xF7\x72" => "\xE9\x9F\xA3", + "\xF7\x73" => "\xE9\xA1\xAA", + "\xF7\x74" => "\xE9\xA1\xA9", + "\xF7\x75" => "\xE9\xA3\x8B", + "\xF7\x76" => "\xE9\xA5\x94", + "\xF7\x77" => "\xE9\xA5\x9B", + "\xF7\x78" => "\xE9\xA9\x8E", + "\xF7\x79" => "\xE9\xA9\x93", + "\xF7\x7A" => "\xE9\xA9\x94", + "\xF7\x7B" => "\xE9\xA9\x8C", + "\xF7\x7C" => "\xE9\xA9\x8F", + "\xF7\x7D" => "\xE9\xA9\x88", + "\xF7\x7E" => "\xE9\xA9\x8A", + "\xF7\xA1" => "\xE9\xA9\x89", + "\xF7\xA2" => "\xE9\xA9\x92", + "\xF7\xA3" => "\xE9\xA9\x90", + "\xF7\xA4" => "\xE9\xAB\x90", + "\xF7\xA5" => "\xE9\xAC\x99", + "\xF7\xA6" => "\xE9\xAC\xAB", + "\xF7\xA7" => "\xE9\xAC\xBB", + "\xF7\xA8" => "\xE9\xAD\x96", + "\xF7\xA9" => "\xE9\xAD\x95", + "\xF7\xAA" => "\xE9\xB1\x86", + "\xF7\xAB" => "\xE9\xB1\x88", + "\xF7\xAC" => "\xE9\xB0\xBF", + "\xF7\xAD" => "\xE9\xB1\x84", + "\xF7\xAE" => "\xE9\xB0\xB9", + "\xF7\xAF" => "\xE9\xB0\xB3", + "\xF7\xB0" => "\xE9\xB1\x81", + "\xF7\xB1" => "\xE9\xB0\xBC", + "\xF7\xB2" => "\xE9\xB0\xB7", + "\xF7\xB3" => "\xE9\xB0\xB4", + "\xF7\xB4" => "\xE9\xB0\xB2", + "\xF7\xB5" => "\xE9\xB0\xBD", + "\xF7\xB6" => "\xE9\xB0\xB6", + "\xF7\xB7" => "\xE9\xB7\x9B", + "\xF7\xB8" => "\xE9\xB7\x92", + "\xF7\xB9" => "\xE9\xB7\x9E", + "\xF7\xBA" => "\xE9\xB7\x9A", + "\xF7\xBB" => "\xE9\xB7\x8B", + "\xF7\xBC" => "\xE9\xB7\x90", + "\xF7\xBD" => "\xE9\xB7\x9C", + "\xF7\xBE" => "\xE9\xB7\x91", + "\xF7\xBF" => "\xE9\xB7\x9F", + "\xF7\xC0" => "\xE9\xB7\xA9", + "\xF7\xC1" => "\xE9\xB7\x99", + "\xF7\xC2" => "\xE9\xB7\x98", + "\xF7\xC3" => "\xE9\xB7\x96", + "\xF7\xC4" => "\xE9\xB7\xB5", + "\xF7\xC5" => "\xE9\xB7\x95", + "\xF7\xC6" => "\xE9\xB7\x9D", + "\xF7\xC7" => "\xE9\xBA\xB6", + "\xF7\xC8" => "\xE9\xBB\xB0", + "\xF7\xC9" => "\xE9\xBC\xB5", + "\xF7\xCA" => "\xE9\xBC\xB3", + "\xF7\xCB" => "\xE9\xBC\xB2", + "\xF7\xCC" => "\xE9\xBD\x82", + "\xF7\xCD" => "\xE9\xBD\xAB", + "\xF7\xCE" => "\xE9\xBE\x95", + "\xF7\xCF" => "\xE9\xBE\xA2", + "\xF7\xD0" => "\xE5\x84\xBD", + "\xF7\xD1" => "\xE5\x8A\x99", + "\xF7\xD2" => "\xE5\xA3\xA8", + "\xF7\xD3" => "\xE5\xA3\xA7", + "\xF7\xD4" => "\xE5\xA5\xB2", + "\xF7\xD5" => "\xE5\xAD\x8D", + "\xF7\xD6" => "\xE5\xB7\x98", + "\xF7\xD7" => "\xE8\xA0\xAF", + "\xF7\xD8" => "\xE5\xBD\x8F", + "\xF7\xD9" => "\xE6\x88\x81", + "\xF7\xDA" => "\xE6\x88\x83", + "\xF7\xDB" => "\xE6\x88\x84", + "\xF7\xDC" => "\xE6\x94\xA9", + "\xF7\xDD" => "\xE6\x94\xA5", + "\xF7\xDE" => "\xE6\x96\x96", + "\xF7\xDF" => "\xE6\x9B\xAB", + "\xF7\xE0" => "\xE6\xAC\x91", + "\xF7\xE1" => "\xE6\xAC\x92", + "\xF7\xE2" => "\xE6\xAC\x8F", + "\xF7\xE3" => "\xE6\xAF\x8A", + "\xF7\xE4" => "\xE7\x81\x9B", + "\xF7\xE5" => "\xE7\x81\x9A", + "\xF7\xE6" => "\xE7\x88\xA2", + "\xF7\xE7" => "\xE7\x8E\x82", + "\xF7\xE8" => "\xE7\x8E\x81", + "\xF7\xE9" => "\xE7\x8E\x83", + "\xF7\xEA" => "\xE7\x99\xB0", + "\xF7\xEB" => "\xE7\x9F\x94", + "\xF7\xEC" => "\xE7\xB1\xA7", + "\xF7\xED" => "\xE7\xB1\xA6", + "\xF7\xEE" => "\xE7\xBA\x95", + "\xF7\xEF" => "\xE8\x89\xAC", + "\xF7\xF0" => "\xE8\x98\xBA", + "\xF7\xF1" => "\xE8\x99\x80", + "\xF7\xF2" => "\xE8\x98\xB9", + "\xF7\xF3" => "\xE8\x98\xBC", + "\xF7\xF4" => "\xE8\x98\xB1", + "\xF7\xF5" => "\xE8\x98\xBB", + "\xF7\xF6" => "\xE8\x98\xBE", + "\xF7\xF7" => "\xE8\xA0\xB0", + "\xF7\xF8" => "\xE8\xA0\xB2", + "\xF7\xF9" => "\xE8\xA0\xAE", + "\xF7\xFA" => "\xE8\xA0\xB3", + "\xF7\xFB" => "\xE8\xA5\xB6", + "\xF7\xFC" => "\xE8\xA5\xB4", + "\xF7\xFD" => "\xE8\xA5\xB3", + "\xF7\xFE" => "\xE8\xA7\xBE", + "\xF8\x40" => "\xE8\xAE\x8C", + "\xF8\x41" => "\xE8\xAE\x8E", + "\xF8\x42" => "\xE8\xAE\x8B", + "\xF8\x43" => "\xE8\xAE\x88", + "\xF8\x44" => "\xE8\xB1\x85", + "\xF8\x45" => "\xE8\xB4\x99", + "\xF8\x46" => "\xE8\xBA\x98", + "\xF8\x47" => "\xE8\xBD\xA4", + "\xF8\x48" => "\xE8\xBD\xA3", + "\xF8\x49" => "\xE9\x86\xBC", + "\xF8\x4A" => "\xE9\x91\xA2", + "\xF8\x4B" => "\xE9\x91\x95", + "\xF8\x4C" => "\xE9\x91\x9D", + "\xF8\x4D" => "\xE9\x91\x97", + "\xF8\x4E" => "\xE9\x91\x9E", + "\xF8\x4F" => "\xE9\x9F\x84", + "\xF8\x50" => "\xE9\x9F\x85", + "\xF8\x51" => "\xE9\xA0\x80", + "\xF8\x52" => "\xE9\xA9\x96", + "\xF8\x53" => "\xE9\xA9\x99", + "\xF8\x54" => "\xE9\xAC\x9E", + "\xF8\x55" => "\xE9\xAC\x9F", + "\xF8\x56" => "\xE9\xAC\xA0", + "\xF8\x57" => "\xE9\xB1\x92", + "\xF8\x58" => "\xE9\xB1\x98", + "\xF8\x59" => "\xE9\xB1\x90", + "\xF8\x5A" => "\xE9\xB1\x8A", + "\xF8\x5B" => "\xE9\xB1\x8D", + "\xF8\x5C" => "\xE9\xB1\x8B", + "\xF8\x5D" => "\xE9\xB1\x95", + "\xF8\x5E" => "\xE9\xB1\x99", + "\xF8\x5F" => "\xE9\xB1\x8C", + "\xF8\x60" => "\xE9\xB1\x8E", + "\xF8\x61" => "\xE9\xB7\xBB", + "\xF8\x62" => "\xE9\xB7\xB7", + "\xF8\x63" => "\xE9\xB7\xAF", + "\xF8\x64" => "\xE9\xB7\xA3", + "\xF8\x65" => "\xE9\xB7\xAB", + "\xF8\x66" => "\xE9\xB7\xB8", + "\xF8\x67" => "\xE9\xB7\xA4", + "\xF8\x68" => "\xE9\xB7\xB6", + "\xF8\x69" => "\xE9\xB7\xA1", + "\xF8\x6A" => "\xE9\xB7\xAE", + "\xF8\x6B" => "\xE9\xB7\xA6", + "\xF8\x6C" => "\xE9\xB7\xB2", + "\xF8\x6D" => "\xE9\xB7\xB0", + "\xF8\x6E" => "\xE9\xB7\xA2", + "\xF8\x6F" => "\xE9\xB7\xAC", + "\xF8\x70" => "\xE9\xB7\xB4", + "\xF8\x71" => "\xE9\xB7\xB3", + "\xF8\x72" => "\xE9\xB7\xA8", + "\xF8\x73" => "\xE9\xB7\xAD", + "\xF8\x74" => "\xE9\xBB\x82", + "\xF8\x75" => "\xE9\xBB\x90", + "\xF8\x76" => "\xE9\xBB\xB2", + "\xF8\x77" => "\xE9\xBB\xB3", + "\xF8\x78" => "\xE9\xBC\x86", + "\xF8\x79" => "\xE9\xBC\x9C", + "\xF8\x7A" => "\xE9\xBC\xB8", + "\xF8\x7B" => "\xE9\xBC\xB7", + "\xF8\x7C" => "\xE9\xBC\xB6", + "\xF8\x7D" => "\xE9\xBD\x83", + "\xF8\x7E" => "\xE9\xBD\x8F", + "\xF8\xA1" => "\xE9\xBD\xB1", + "\xF8\xA2" => "\xE9\xBD\xB0", + "\xF8\xA3" => "\xE9\xBD\xAE", + "\xF8\xA4" => "\xE9\xBD\xAF", + "\xF8\xA5" => "\xE5\x9B\x93", + "\xF8\xA6" => "\xE5\x9B\x8D", + "\xF8\xA7" => "\xE5\xAD\x8E", + "\xF8\xA8" => "\xE5\xB1\xAD", + "\xF8\xA9" => "\xE6\x94\xAD", + "\xF8\xAA" => "\xE6\x9B\xAD", + "\xF8\xAB" => "\xE6\x9B\xAE", + "\xF8\xAC" => "\xE6\xAC\x93", + "\xF8\xAD" => "\xE7\x81\x9F", + "\xF8\xAE" => "\xE7\x81\xA1", + "\xF8\xAF" => "\xE7\x81\x9D", + "\xF8\xB0" => "\xE7\x81\xA0", + "\xF8\xB1" => "\xE7\x88\xA3", + "\xF8\xB2" => "\xE7\x93\x9B", + "\xF8\xB3" => "\xE7\x93\xA5", + "\xF8\xB4" => "\xE7\x9F\x95", + "\xF8\xB5" => "\xE7\xA4\xB8", + "\xF8\xB6" => "\xE7\xA6\xB7", + "\xF8\xB7" => "\xE7\xA6\xB6", + "\xF8\xB8" => "\xE7\xB1\xAA", + "\xF8\xB9" => "\xE7\xBA\x97", + "\xF8\xBA" => "\xE7\xBE\x89", + "\xF8\xBB" => "\xE8\x89\xAD", + "\xF8\xBC" => "\xE8\x99\x83", + "\xF8\xBD" => "\xE8\xA0\xB8", + "\xF8\xBE" => "\xE8\xA0\xB7", + "\xF8\xBF" => "\xE8\xA0\xB5", + "\xF8\xC0" => "\xE8\xA1\x8B", + "\xF8\xC1" => "\xE8\xAE\x94", + "\xF8\xC2" => "\xE8\xAE\x95", + "\xF8\xC3" => "\xE8\xBA\x9E", + "\xF8\xC4" => "\xE8\xBA\x9F", + "\xF8\xC5" => "\xE8\xBA\xA0", + "\xF8\xC6" => "\xE8\xBA\x9D", + "\xF8\xC7" => "\xE9\x86\xBE", + "\xF8\xC8" => "\xE9\x86\xBD", + "\xF8\xC9" => "\xE9\x87\x82", + "\xF8\xCA" => "\xE9\x91\xAB", + "\xF8\xCB" => "\xE9\x91\xA8", + "\xF8\xCC" => "\xE9\x91\xA9", + "\xF8\xCD" => "\xE9\x9B\xA5", + "\xF8\xCE" => "\xE9\x9D\x86", + "\xF8\xCF" => "\xE9\x9D\x83", + "\xF8\xD0" => "\xE9\x9D\x87", + "\xF8\xD1" => "\xE9\x9F\x87", + "\xF8\xD2" => "\xE9\x9F\xA5", + "\xF8\xD3" => "\xE9\xA9\x9E", + "\xF8\xD4" => "\xE9\xAB\x95", + "\xF8\xD5" => "\xE9\xAD\x99", + "\xF8\xD6" => "\xE9\xB1\xA3", + "\xF8\xD7" => "\xE9\xB1\xA7", + "\xF8\xD8" => "\xE9\xB1\xA6", + "\xF8\xD9" => "\xE9\xB1\xA2", + "\xF8\xDA" => "\xE9\xB1\x9E", + "\xF8\xDB" => "\xE9\xB1\xA0", + "\xF8\xDC" => "\xE9\xB8\x82", + "\xF8\xDD" => "\xE9\xB7\xBE", + "\xF8\xDE" => "\xE9\xB8\x87", + "\xF8\xDF" => "\xE9\xB8\x83", + "\xF8\xE0" => "\xE9\xB8\x86", + "\xF8\xE1" => "\xE9\xB8\x85", + "\xF8\xE2" => "\xE9\xB8\x80", + "\xF8\xE3" => "\xE9\xB8\x81", + "\xF8\xE4" => "\xE9\xB8\x89", + "\xF8\xE5" => "\xE9\xB7\xBF", + "\xF8\xE6" => "\xE9\xB7\xBD", + "\xF8\xE7" => "\xE9\xB8\x84", + "\xF8\xE8" => "\xE9\xBA\xA0", + "\xF8\xE9" => "\xE9\xBC\x9E", + "\xF8\xEA" => "\xE9\xBD\x86", + "\xF8\xEB" => "\xE9\xBD\xB4", + "\xF8\xEC" => "\xE9\xBD\xB5", + "\xF8\xED" => "\xE9\xBD\xB6", + "\xF8\xEE" => "\xE5\x9B\x94", + "\xF8\xEF" => "\xE6\x94\xAE", + "\xF8\xF0" => "\xE6\x96\xB8", + "\xF8\xF1" => "\xE6\xAC\x98", + "\xF8\xF2" => "\xE6\xAC\x99", + "\xF8\xF3" => "\xE6\xAC\x97", + "\xF8\xF4" => "\xE6\xAC\x9A", + "\xF8\xF5" => "\xE7\x81\xA2", + "\xF8\xF6" => "\xE7\x88\xA6", + "\xF8\xF7" => "\xE7\x8A\xAA", + "\xF8\xF8" => "\xE7\x9F\x98", + "\xF8\xF9" => "\xE7\x9F\x99", + "\xF8\xFA" => "\xE7\xA4\xB9", + "\xF8\xFB" => "\xE7\xB1\xA9", + "\xF8\xFC" => "\xE7\xB1\xAB", + "\xF8\xFD" => "\xE7\xB3\xB6", + "\xF8\xFE" => "\xE7\xBA\x9A", + "\xF9\x40" => "\xE7\xBA\x98", + "\xF9\x41" => "\xE7\xBA\x9B", + "\xF9\x42" => "\xE7\xBA\x99", + "\xF9\x43" => "\xE8\x87\xA0", + "\xF9\x44" => "\xE8\x87\xA1", + "\xF9\x45" => "\xE8\x99\x86", + "\xF9\x46" => "\xE8\x99\x87", + "\xF9\x47" => "\xE8\x99\x88", + "\xF9\x48" => "\xE8\xA5\xB9", + "\xF9\x49" => "\xE8\xA5\xBA", + "\xF9\x4A" => "\xE8\xA5\xBC", + "\xF9\x4B" => "\xE8\xA5\xBB", + "\xF9\x4C" => "\xE8\xA7\xBF", + "\xF9\x4D" => "\xE8\xAE\x98", + "\xF9\x4E" => "\xE8\xAE\x99", + "\xF9\x4F" => "\xE8\xBA\xA5", + "\xF9\x50" => "\xE8\xBA\xA4", + "\xF9\x51" => "\xE8\xBA\xA3", + "\xF9\x52" => "\xE9\x91\xAE", + "\xF9\x53" => "\xE9\x91\xAD", + "\xF9\x54" => "\xE9\x91\xAF", + "\xF9\x55" => "\xE9\x91\xB1", + "\xF9\x56" => "\xE9\x91\xB3", + "\xF9\x57" => "\xE9\x9D\x89", + "\xF9\x58" => "\xE9\xA1\xB2", + "\xF9\x59" => "\xE9\xA5\x9F", + "\xF9\x5A" => "\xE9\xB1\xA8", + "\xF9\x5B" => "\xE9\xB1\xAE", + "\xF9\x5C" => "\xE9\xB1\xAD", + "\xF9\x5D" => "\xE9\xB8\x8B", + "\xF9\x5E" => "\xE9\xB8\x8D", + "\xF9\x5F" => "\xE9\xB8\x90", + "\xF9\x60" => "\xE9\xB8\x8F", + "\xF9\x61" => "\xE9\xB8\x92", + "\xF9\x62" => "\xE9\xB8\x91", + "\xF9\x63" => "\xE9\xBA\xA1", + "\xF9\x64" => "\xE9\xBB\xB5", + "\xF9\x65" => "\xE9\xBC\x89", + "\xF9\x66" => "\xE9\xBD\x87", + "\xF9\x67" => "\xE9\xBD\xB8", + "\xF9\x68" => "\xE9\xBD\xBB", + "\xF9\x69" => "\xE9\xBD\xBA", + "\xF9\x6A" => "\xE9\xBD\xB9", + "\xF9\x6B" => "\xE5\x9C\x9E", + "\xF9\x6C" => "\xE7\x81\xA6", + "\xF9\x6D" => "\xE7\xB1\xAF", + "\xF9\x6E" => "\xE8\xA0\xBC", + "\xF9\x6F" => "\xE8\xB6\xB2", + "\xF9\x70" => "\xE8\xBA\xA6", + "\xF9\x71" => "\xE9\x87\x83", + "\xF9\x72" => "\xE9\x91\xB4", + "\xF9\x73" => "\xE9\x91\xB8", + "\xF9\x74" => "\xE9\x91\xB6", + "\xF9\x75" => "\xE9\x91\xB5", + "\xF9\x76" => "\xE9\xA9\xA0", + "\xF9\x77" => "\xE9\xB1\xB4", + "\xF9\x78" => "\xE9\xB1\xB3", + "\xF9\x79" => "\xE9\xB1\xB1", + "\xF9\x7A" => "\xE9\xB1\xB5", + "\xF9\x7B" => "\xE9\xB8\x94", + "\xF9\x7C" => "\xE9\xB8\x93", + "\xF9\x7D" => "\xE9\xBB\xB6", + "\xF9\x7E" => "\xE9\xBC\x8A", + "\xF9\xA1" => "\xE9\xBE\xA4", + "\xF9\xA2" => "\xE7\x81\xA8", + "\xF9\xA3" => "\xE7\x81\xA5", + "\xF9\xA4" => "\xE7\xB3\xB7", + "\xF9\xA5" => "\xE8\x99\xAA", + "\xF9\xA6" => "\xE8\xA0\xBE", + "\xF9\xA7" => "\xE8\xA0\xBD", + "\xF9\xA8" => "\xE8\xA0\xBF", + "\xF9\xA9" => "\xE8\xAE\x9E", + "\xF9\xAA" => "\xE8\xB2\x9C", + "\xF9\xAB" => "\xE8\xBA\xA9", + "\xF9\xAC" => "\xE8\xBB\x89", + "\xF9\xAD" => "\xE9\x9D\x8B", + "\xF9\xAE" => "\xE9\xA1\xB3", + "\xF9\xAF" => "\xE9\xA1\xB4", + "\xF9\xB0" => "\xE9\xA3\x8C", + "\xF9\xB1" => "\xE9\xA5\xA1", + "\xF9\xB2" => "\xE9\xA6\xAB", + "\xF9\xB3" => "\xE9\xA9\xA4", + "\xF9\xB4" => "\xE9\xA9\xA6", + "\xF9\xB5" => "\xE9\xA9\xA7", + "\xF9\xB6" => "\xE9\xAC\xA4", + "\xF9\xB7" => "\xE9\xB8\x95", + "\xF9\xB8" => "\xE9\xB8\x97", + "\xF9\xB9" => "\xE9\xBD\x88", + "\xF9\xBA" => "\xE6\x88\x87", + "\xF9\xBB" => "\xE6\xAC\x9E", + "\xF9\xBC" => "\xE7\x88\xA7", + "\xF9\xBD" => "\xE8\x99\x8C", + "\xF9\xBE" => "\xE8\xBA\xA8", + "\xF9\xBF" => "\xE9\x92\x82", + "\xF9\xC0" => "\xE9\x92\x80", + "\xF9\xC1" => "\xE9\x92\x81", + "\xF9\xC2" => "\xE9\xA9\xA9", + "\xF9\xC3" => "\xE9\xA9\xA8", + "\xF9\xC4" => "\xE9\xAC\xAE", + "\xF9\xC5" => "\xE9\xB8\x99", + "\xF9\xC6" => "\xE7\x88\xA9", + "\xF9\xC7" => "\xE8\x99\x8B", + "\xF9\xC8" => "\xE8\xAE\x9F", + "\xF9\xC9" => "\xE9\x92\x83", + "\xF9\xCA" => "\xE9\xB1\xB9", + "\xF9\xCB" => "\xE9\xBA\xB7", + "\xF9\xCC" => "\xE7\x99\xB5", + "\xF9\xCD" => "\xE9\xA9\xAB", + "\xF9\xCE" => "\xE9\xB1\xBA", + "\xF9\xCF" => "\xE9\xB8\x9D", + "\xF9\xD0" => "\xE7\x81\xA9", + "\xF9\xD1" => "\xE7\x81\xAA", + "\xF9\xD2" => "\xE9\xBA\xA4", + "\xF9\xD3" => "\xE9\xBD\xBE", + "\xF9\xD4" => "\xE9\xBD\x89", + "\xF9\xD5" => "\xE9\xBE\x98", + ); + return strtr($string, $transform); +} diff --git a/sources/phpBB/includes/utf/data/search_indexer_0.php b/sources/phpBB/includes/utf/data/search_indexer_0.php new file mode 100644 index 0000000..e8a087c --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_0.php @@ -0,0 +1 @@ +'0',1=>'1',2=>'2',3=>'3',4=>'4',5=>'5',6=>'6',7=>'7',8=>'8',9=>'9','A'=>'a','B'=>'b','C'=>'c','D'=>'d','E'=>'e','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','M'=>'m','N'=>'n','O'=>'o','P'=>'p','Q'=>'q','R'=>'r','S'=>'s','T'=>'t','U'=>'u','V'=>'v','W'=>'w','X'=>'x','Y'=>'y','Z'=>'z','a'=>'a','b'=>'b','c'=>'c','d'=>'d','e'=>'e','f'=>'f','g'=>'g','h'=>'h','i'=>'i','j'=>'j','k'=>'k','l'=>'l','m'=>'m','n'=>'n','o'=>'o','p'=>'p','q'=>'q','r'=>'r','s'=>'s','t'=>'t','u'=>'u','v'=>'v','w'=>'w','x'=>'x','y'=>'y','z'=>'z','ª'=>'ª','²'=>'2','³'=>'3','µ'=>'µ','¹'=>'1','º'=>'º','¼'=>'1/4','½'=>'1/2','¾'=>'3/4','À'=>'à','Ã'=>'á','Â'=>'â','Ã'=>'ã','Ä'=>'ae','Ã…'=>'Ã¥','Æ'=>'ae','Ç'=>'ç','È'=>'è','É'=>'é','Ê'=>'ê','Ë'=>'ë','ÃŒ'=>'ì','Ã'=>'í','ÃŽ'=>'î','Ã'=>'ï','Ã'=>'ð','Ñ'=>'ñ','Ã’'=>'ò','Ó'=>'ó','Ô'=>'ô','Õ'=>'õ','Ö'=>'oe','Ø'=>'ø','Ù'=>'ù','Ú'=>'ú','Û'=>'û','Ãœ'=>'ü','Ã'=>'ý','Þ'=>'þ','ß'=>'ss','à'=>'à','á'=>'á','â'=>'â','ã'=>'ã','ä'=>'ae','Ã¥'=>'Ã¥','æ'=>'ae','ç'=>'ç','è'=>'è','é'=>'é','ê'=>'ê','ë'=>'ë','ì'=>'ì','í'=>'í','î'=>'î','ï'=>'ï','ð'=>'ð','ñ'=>'ñ','ò'=>'ò','ó'=>'ó','ô'=>'ô','õ'=>'õ','ö'=>'oe','ø'=>'ø','ù'=>'ù','ú'=>'ú','û'=>'û','ü'=>'ue','ý'=>'ý','þ'=>'þ','ÿ'=>'ÿ','Ä€'=>'Ä','Ä'=>'Ä','Ä‚'=>'ă','ă'=>'ă','Ä„'=>'Ä…','Ä…'=>'Ä…','Ć'=>'ć','ć'=>'ć','Ĉ'=>'ĉ','ĉ'=>'ĉ','ÄŠ'=>'Ä‹','Ä‹'=>'Ä‹','ÄŒ'=>'Ä','Ä'=>'Ä','ÄŽ'=>'Ä','Ä'=>'Ä','Ä'=>'Ä‘','Ä‘'=>'Ä‘','Ä’'=>'Ä“','Ä“'=>'Ä“','Ä”'=>'Ä•','Ä•'=>'Ä•','Ä–'=>'Ä—','Ä—'=>'Ä—','Ę'=>'Ä™','Ä™'=>'Ä™','Äš'=>'Ä›','Ä›'=>'Ä›','Äœ'=>'Ä','Ä'=>'Ä','Äž'=>'ÄŸ','ÄŸ'=>'ÄŸ','Ä '=>'Ä¡','Ä¡'=>'Ä¡','Ä¢'=>'Ä£','Ä£'=>'Ä£','Ĥ'=>'Ä¥','Ä¥'=>'Ä¥','Ħ'=>'ħ','ħ'=>'ħ','Ĩ'=>'Ä©','Ä©'=>'Ä©','Ī'=>'Ä«','Ä«'=>'Ä«','Ĭ'=>'Ä­','Ä­'=>'Ä­','Ä®'=>'į','į'=>'į','Ä°'=>'i','ı'=>'ı','IJ'=>'ij','ij'=>'ij','Ä´'=>'ĵ','ĵ'=>'ĵ','Ķ'=>'Ä·','Ä·'=>'Ä·','ĸ'=>'ĸ','Ĺ'=>'ĺ','ĺ'=>'ĺ','Ä»'=>'ļ','ļ'=>'ļ','Ľ'=>'ľ','ľ'=>'ľ','Ä¿'=>'Å€','Å€'=>'Å€','Å'=>'Å‚','Å‚'=>'Å‚','Ń'=>'Å„','Å„'=>'Å„','Å…'=>'ņ','ņ'=>'ņ','Ň'=>'ň','ň'=>'ň','ʼn'=>'ʼn','ÅŠ'=>'Å‹','Å‹'=>'Å‹','ÅŒ'=>'Å','Å'=>'Å','ÅŽ'=>'Å','Å'=>'Å','Å'=>'Å‘','Å‘'=>'Å‘','Å’'=>'oe','Å“'=>'oe','Å”'=>'Å•','Å•'=>'Å•','Å–'=>'Å—','Å—'=>'Å—','Ř'=>'Å™','Å™'=>'Å™','Åš'=>'Å›','Å›'=>'Å›','Åœ'=>'Å','Å'=>'Å','Åž'=>'ÅŸ','ÅŸ'=>'ÅŸ','Å '=>'Å¡','Å¡'=>'Å¡','Å¢'=>'Å£','Å£'=>'Å£','Ť'=>'Å¥','Å¥'=>'Å¥','Ŧ'=>'ŧ','ŧ'=>'ŧ','Ũ'=>'Å©','Å©'=>'Å©','Ū'=>'Å«','Å«'=>'Å«','Ŭ'=>'Å­','Å­'=>'Å­','Å®'=>'ů','ů'=>'ů','Å°'=>'ű','ű'=>'ű','Ų'=>'ų','ų'=>'ų','Å´'=>'ŵ','ŵ'=>'ŵ','Ŷ'=>'Å·','Å·'=>'Å·','Ÿ'=>'ÿ','Ź'=>'ź','ź'=>'ź','Å»'=>'ż','ż'=>'ż','Ž'=>'ž','ž'=>'ž','Å¿'=>'Å¿','Æ€'=>'Æ€','Æ'=>'É“','Æ‚'=>'ƃ','ƃ'=>'ƃ','Æ„'=>'Æ…','Æ…'=>'Æ…','Ɔ'=>'É”','Ƈ'=>'ƈ','ƈ'=>'ƈ','Ɖ'=>'É–','ÆŠ'=>'É—','Æ‹'=>'ÆŒ','ÆŒ'=>'ÆŒ','Æ'=>'Æ','ÆŽ'=>'Ç','Æ'=>'É™','Æ'=>'É›','Æ‘'=>'Æ’','Æ’'=>'Æ’','Æ“'=>'É ','Æ”'=>'É£','Æ•'=>'hv','Æ–'=>'É©','Æ—'=>'ɨ','Ƙ'=>'Æ™','Æ™'=>'Æ™','Æš'=>'Æš','Æ›'=>'Æ›','Æœ'=>'ɯ','Æ'=>'ɲ','Æž'=>'Æž','ÆŸ'=>'ɵ','Æ '=>'Æ¡','Æ¡'=>'Æ¡','Æ¢'=>'oi','Æ£'=>'oi','Ƥ'=>'Æ¥','Æ¥'=>'Æ¥','Ʀ'=>'yr','Ƨ'=>'ƨ','ƨ'=>'ƨ','Æ©'=>'ʃ','ƪ'=>'ƪ','Æ«'=>'Æ«','Ƭ'=>'Æ­','Æ­'=>'Æ­','Æ®'=>'ʈ','Ư'=>'Æ°','Æ°'=>'Æ°','Ʊ'=>'ÊŠ','Ʋ'=>'Ê‹','Ƴ'=>'Æ´','Æ´'=>'Æ´','Ƶ'=>'ƶ','ƶ'=>'ƶ','Æ·'=>'Ê’','Ƹ'=>'ƹ','ƹ'=>'ƹ','ƺ'=>'ƺ','Æ»'=>'Æ»','Ƽ'=>'ƽ','ƽ'=>'ƽ','ƾ'=>'ƾ','Æ¿'=>'Æ¿','Ç€'=>'Ç€','Ç'=>'Ç','Ç‚'=>'Ç‚','ǃ'=>'ǃ','Ç„'=>'dž','Ç…'=>'dž','dž'=>'dž','LJ'=>'lj','Lj'=>'lj','lj'=>'lj','ÇŠ'=>'nj','Ç‹'=>'ÇŒ','ÇŒ'=>'nj','Ç'=>'ÇŽ','ÇŽ'=>'ÇŽ','Ç'=>'Ç','Ç'=>'Ç','Ç‘'=>'Ç’','Ç’'=>'Ç’','Ç“'=>'Ç”','Ç”'=>'Ç”','Ç•'=>'Ç–','Ç–'=>'Ç–','Ç—'=>'ǘ','ǘ'=>'ǘ','Ç™'=>'Çš','Çš'=>'Çš','Ç›'=>'Çœ','Çœ'=>'Çœ','Ç'=>'Ç','Çž'=>'ÇŸ','ÇŸ'=>'ÇŸ','Ç '=>'Ç¡','Ç¡'=>'Ç¡','Ç¢'=>'Ç£','Ç£'=>'Ç£','Ǥ'=>'Ç¥','Ç¥'=>'Ç¥','Ǧ'=>'ǧ','ǧ'=>'ǧ','Ǩ'=>'Ç©','Ç©'=>'Ç©','Ǫ'=>'Ç«','Ç«'=>'Ç«','Ǭ'=>'Ç­','Ç­'=>'Ç­','Ç®'=>'ǯ','ǯ'=>'ǯ','Ç°'=>'Ç°','DZ'=>'dz','Dz'=>'dz','dz'=>'dz','Ç´'=>'ǵ','ǵ'=>'ǵ','Ƕ'=>'Æ•','Ç·'=>'Æ¿','Ǹ'=>'ǹ','ǹ'=>'ǹ','Ǻ'=>'Ç»','Ç»'=>'Ç»','Ǽ'=>'ǽ','ǽ'=>'ǽ','Ǿ'=>'Ç¿','Ç¿'=>'Ç¿','È€'=>'È','È'=>'È','È‚'=>'ȃ','ȃ'=>'ȃ','È„'=>'È…','È…'=>'È…','Ȇ'=>'ȇ','ȇ'=>'ȇ','Ȉ'=>'ȉ','ȉ'=>'ȉ','ÈŠ'=>'È‹','È‹'=>'È‹','ÈŒ'=>'È','È'=>'È','ÈŽ'=>'È','È'=>'È','È'=>'È‘','È‘'=>'È‘','È’'=>'È“','È“'=>'È“','È”'=>'È•','È•'=>'È•','È–'=>'È—','È—'=>'È—','Ș'=>'È™','È™'=>'È™','Èš'=>'È›','È›'=>'È›','Èœ'=>'È','È'=>'È','Èž'=>'ÈŸ','ÈŸ'=>'ÈŸ','È '=>'Æž','È¡'=>'È¡','È¢'=>'ou','È£'=>'ou','Ȥ'=>'È¥','È¥'=>'È¥','Ȧ'=>'ȧ','ȧ'=>'ȧ','Ȩ'=>'È©','È©'=>'È©','Ȫ'=>'È«','È«'=>'È«','Ȭ'=>'È­','È­'=>'È­','È®'=>'ȯ','ȯ'=>'ȯ','È°'=>'ȱ','ȱ'=>'ȱ','Ȳ'=>'ȳ','ȳ'=>'ȳ','È´'=>'È´','ȵ'=>'ȵ','ȶ'=>'ȶ','È·'=>'È·','ȸ'=>'ȸ','ȹ'=>'ȹ','Ⱥ'=>'â±¥','È»'=>'ȼ','ȼ'=>'ȼ','Ƚ'=>'Æš','Ⱦ'=>'ⱦ','È¿'=>'È¿','É€'=>'É€','É'=>'É‚','É‚'=>'É‚','Ƀ'=>'Æ€','É„'=>'ʉ','É…'=>'ÊŒ','Ɇ'=>'ɇ','ɇ'=>'ɇ','Ɉ'=>'ɉ','ɉ'=>'ɉ','ÉŠ'=>'É‹','É‹'=>'É‹','ÉŒ'=>'É','É'=>'É','ÉŽ'=>'É','É'=>'É','É'=>'É','É‘'=>'É‘','É’'=>'É’','É“'=>'É“','É”'=>'É”','É•'=>'É•','É–'=>'É–','É—'=>'É—','ɘ'=>'ɘ','É™'=>'É™','Éš'=>'Éš','É›'=>'É›','Éœ'=>'Éœ','É'=>'É','Éž'=>'Éž','ÉŸ'=>'ÉŸ','É '=>'É ','É¡'=>'É¡','É¢'=>'É¢','É£'=>'É£','ɤ'=>'ɤ','É¥'=>'É¥','ɦ'=>'ɦ','ɧ'=>'ɧ','ɨ'=>'ɨ','É©'=>'É©','ɪ'=>'ɪ','É«'=>'É«','ɬ'=>'ɬ','É­'=>'É­','É®'=>'É®','ɯ'=>'ɯ','É°'=>'É°','ɱ'=>'ɱ','ɲ'=>'ɲ','ɳ'=>'ɳ','É´'=>'É´','ɵ'=>'ɵ','ɶ'=>'ɶ','É·'=>'É·','ɸ'=>'ɸ','ɹ'=>'ɹ','ɺ'=>'ɺ','É»'=>'É»','ɼ'=>'ɼ','ɽ'=>'ɽ','ɾ'=>'ɾ','É¿'=>'É¿','Ê€'=>'Ê€','Ê'=>'Ê','Ê‚'=>'Ê‚','ʃ'=>'ʃ','Ê„'=>'Ê„','Ê…'=>'Ê…','ʆ'=>'ʆ','ʇ'=>'ʇ','ʈ'=>'ʈ','ʉ'=>'ʉ','ÊŠ'=>'ÊŠ','Ê‹'=>'Ê‹','ÊŒ'=>'ÊŒ','Ê'=>'Ê','ÊŽ'=>'ÊŽ','Ê'=>'Ê','Ê'=>'Ê','Ê‘'=>'Ê‘','Ê’'=>'Ê’','Ê“'=>'Ê“','Ê”'=>'Ê”','Ê•'=>'Ê•','Ê–'=>'Ê–','Ê—'=>'Ê—','ʘ'=>'ʘ','Ê™'=>'Ê™','Êš'=>'Êš','Ê›'=>'Ê›','Êœ'=>'Êœ','Ê'=>'Ê','Êž'=>'Êž','ÊŸ'=>'ÊŸ','Ê '=>'Ê ','Ê¡'=>'Ê¡','Ê¢'=>'Ê¢','Ê£'=>'Ê£','ʤ'=>'ʤ','Ê¥'=>'Ê¥','ʦ'=>'ʦ','ʧ'=>'ʧ','ʨ'=>'ʨ','Ê©'=>'Ê©','ʪ'=>'ʪ','Ê«'=>'Ê«','ʬ'=>'ʬ','Ê­'=>'Ê­','Ê®'=>'Ê®','ʯ'=>'ʯ','Ê°'=>'Ê°','ʱ'=>'ʱ','ʲ'=>'ʲ','ʳ'=>'ʳ','Ê´'=>'Ê´','ʵ'=>'ʵ','ʶ'=>'ʶ','Ê·'=>'Ê·','ʸ'=>'ʸ','ʹ'=>'ʹ','ʺ'=>'ʺ','Ê»'=>'Ê»','ʼ'=>'ʼ','ʽ'=>'ʽ','ʾ'=>'ʾ','Ê¿'=>'Ê¿','Ë€'=>'Ë€','Ë'=>'Ë','ˆ'=>'ˆ','ˇ'=>'ˇ','ˈ'=>'ˈ','ˉ'=>'ˉ','ËŠ'=>'ËŠ','Ë‹'=>'Ë‹','ËŒ'=>'ËŒ','Ë'=>'Ë','ËŽ'=>'ËŽ','Ë'=>'Ë','Ë'=>'Ë','Ë‘'=>'Ë‘','Ë '=>'Ë ','Ë¡'=>'Ë¡','Ë¢'=>'Ë¢','Ë£'=>'Ë£','ˤ'=>'ˤ','Ë®'=>'Ë®','Ì€'=>'Ì€','Ì'=>'Ì','Ì‚'=>'Ì‚','̃'=>'̃','Ì„'=>'Ì„','Ì…'=>'Ì…','̆'=>'̆','̇'=>'̇','̈'=>'̈','̉'=>'̉','ÌŠ'=>'ÌŠ','Ì‹'=>'Ì‹','ÌŒ'=>'ÌŒ','Ì'=>'Ì','ÌŽ'=>'ÌŽ','Ì'=>'Ì','Ì'=>'Ì','Ì‘'=>'Ì‘','Ì’'=>'Ì’','Ì“'=>'Ì“','Ì”'=>'Ì”','Ì•'=>'Ì•','Ì–'=>'Ì–','Ì—'=>'Ì—','̘'=>'̘','Ì™'=>'Ì™','Ìš'=>'Ìš','Ì›'=>'Ì›','Ìœ'=>'Ìœ','Ì'=>'Ì','Ìž'=>'Ìž','ÌŸ'=>'ÌŸ','Ì '=>'Ì ','Ì¡'=>'Ì¡','Ì¢'=>'Ì¢','Ì£'=>'Ì£','̤'=>'̤','Ì¥'=>'Ì¥','̦'=>'̦','̧'=>'̧','̨'=>'̨','Ì©'=>'Ì©','̪'=>'̪','Ì«'=>'Ì«','̬'=>'̬','Ì­'=>'Ì­','Ì®'=>'Ì®','̯'=>'̯','Ì°'=>'Ì°','̱'=>'̱','̲'=>'̲','̳'=>'̳','Ì´'=>'Ì´','̵'=>'̵','̶'=>'̶','Ì·'=>'Ì·','̸'=>'̸','̹'=>'̹','̺'=>'̺','Ì»'=>'Ì»','̼'=>'̼','̽'=>'̽','̾'=>'̾','Ì¿'=>'Ì¿','Í€'=>'Í€','Í'=>'Í','Í‚'=>'Í‚','̓'=>'̓','Í„'=>'Í„','Í…'=>'Í…','͆'=>'͆','͇'=>'͇','͈'=>'͈','͉'=>'͉','ÍŠ'=>'ÍŠ','Í‹'=>'Í‹','ÍŒ'=>'ÍŒ','Í'=>'Í','ÍŽ'=>'ÍŽ','Í'=>'Í','Í'=>'Í','Í‘'=>'Í‘','Í’'=>'Í’','Í“'=>'Í“','Í”'=>'Í”','Í•'=>'Í•','Í–'=>'Í–','Í—'=>'Í—','͘'=>'͘','Í™'=>'Í™','Íš'=>'Íš','Í›'=>'Í›','Íœ'=>'Íœ','Í'=>'Í','Íž'=>'Íž','ÍŸ'=>'ÍŸ','Í '=>'Í ','Í¡'=>'Í¡','Í¢'=>'Í¢','Í£'=>'Í£','ͤ'=>'ͤ','Í¥'=>'Í¥','ͦ'=>'ͦ','ͧ'=>'ͧ','ͨ'=>'ͨ','Í©'=>'Í©','ͪ'=>'ͪ','Í«'=>'Í«','ͬ'=>'ͬ','Í­'=>'Í­','Í®'=>'Í®','ͯ'=>'ͯ','ͺ'=>'ͺ','Í»'=>'Í»','ͼ'=>'ͼ','ͽ'=>'ͽ','Ά'=>'ά','Έ'=>'έ','Ή'=>'ή','Ί'=>'ί','ÎŒ'=>'ÏŒ','ÎŽ'=>'Ï','Î'=>'ÏŽ','Î'=>'Î','Α'=>'α','Î’'=>'β','Γ'=>'γ','Δ'=>'δ','Ε'=>'ε','Ζ'=>'ζ','Η'=>'η','Θ'=>'θ','Ι'=>'ι','Κ'=>'κ','Λ'=>'λ','Îœ'=>'μ','Î'=>'ν','Ξ'=>'ξ','Ο'=>'ο','Π'=>'Ï€','Ρ'=>'Ï','Σ'=>'σ','Τ'=>'Ï„','Î¥'=>'Ï…','Φ'=>'φ','Χ'=>'χ','Ψ'=>'ψ','Ω'=>'ω','Ϊ'=>'ÏŠ','Ϋ'=>'Ï‹','ά'=>'ά','έ'=>'έ','ή'=>'ή','ί'=>'ί','ΰ'=>'ΰ','α'=>'α','β'=>'β','γ'=>'γ','δ'=>'δ','ε'=>'ε','ζ'=>'ζ','η'=>'η','θ'=>'θ','ι'=>'ι','κ'=>'κ','λ'=>'λ','μ'=>'μ','ν'=>'ν','ξ'=>'ξ','ο'=>'ο','Ï€'=>'Ï€','Ï'=>'Ï','Ï‚'=>'Ï‚','σ'=>'σ','Ï„'=>'Ï„','Ï…'=>'Ï…','φ'=>'φ','χ'=>'χ','ψ'=>'ψ','ω'=>'ω','ÏŠ'=>'ÏŠ','Ï‹'=>'Ï‹','ÏŒ'=>'ÏŒ','Ï'=>'Ï','ÏŽ'=>'ÏŽ','Ï'=>'Ï','Ï‘'=>'Ï‘','Ï’'=>'Ï’','Ï“'=>'Ï“','Ï”'=>'Ï”','Ï•'=>'Ï•','Ï–'=>'Ï–','Ï—'=>'Ï—','Ϙ'=>'Ï™','Ï™'=>'Ï™','Ïš'=>'Ï›','Ï›'=>'Ï›','Ïœ'=>'Ï','Ï'=>'Ï','Ïž'=>'ÏŸ','ÏŸ'=>'ÏŸ','Ï '=>'Ï¡','Ï¡'=>'Ï¡','Ï¢'=>'Ï£','Ï£'=>'Ï£','Ϥ'=>'Ï¥','Ï¥'=>'Ï¥','Ϧ'=>'ϧ','ϧ'=>'ϧ','Ϩ'=>'Ï©','Ï©'=>'Ï©','Ϫ'=>'Ï«','Ï«'=>'Ï«','Ϭ'=>'Ï­','Ï­'=>'Ï­','Ï®'=>'ϯ','ϯ'=>'ϯ','Ï°'=>'Ï°','ϱ'=>'ϱ','ϲ'=>'ϲ','ϳ'=>'ϳ','Ï´'=>'θ','ϵ'=>'ϵ','Ï·'=>'ϸ','ϸ'=>'ϸ','Ϲ'=>'ϲ','Ϻ'=>'Ï»','Ï»'=>'Ï»','ϼ'=>'ϼ','Ͻ'=>'Í»','Ͼ'=>'ͼ','Ï¿'=>'ͽ','Ѐ'=>'Ñ','Ð'=>'Ñ‘','Ђ'=>'Ñ’','Ѓ'=>'Ñ“','Є'=>'Ñ”','Ð…'=>'Ñ•','І'=>'Ñ–','Ї'=>'Ñ—','Ј'=>'ј','Љ'=>'Ñ™','Њ'=>'Ñš','Ћ'=>'Ñ›','ÐŒ'=>'Ñœ','Ð'=>'Ñ','ÐŽ'=>'Ñž','Ð'=>'ÑŸ','Ð'=>'а','Б'=>'б','Ð’'=>'в','Г'=>'г','Д'=>'д','Е'=>'е','Ж'=>'ж','З'=>'з','И'=>'и','Й'=>'й','К'=>'к','Л'=>'л','Ðœ'=>'м','Ð'=>'н','О'=>'о','П'=>'п','Р'=>'Ñ€','С'=>'Ñ','Т'=>'Ñ‚','У'=>'у','Ф'=>'Ñ„','Ð¥'=>'Ñ…','Ц'=>'ц','Ч'=>'ч','Ш'=>'ш','Щ'=>'щ','Ъ'=>'ÑŠ','Ы'=>'Ñ‹','Ь'=>'ÑŒ','Э'=>'Ñ','Ю'=>'ÑŽ','Я'=>'Ñ','а'=>'а','б'=>'б','в'=>'в','г'=>'г','д'=>'д','е'=>'е','ж'=>'ж','з'=>'з','и'=>'и','й'=>'й','к'=>'к','л'=>'л','м'=>'м','н'=>'н','о'=>'о','п'=>'п','Ñ€'=>'Ñ€','Ñ'=>'Ñ','Ñ‚'=>'Ñ‚','у'=>'у','Ñ„'=>'Ñ„','Ñ…'=>'Ñ…','ц'=>'ц','ч'=>'ч','ш'=>'ш','щ'=>'щ','ÑŠ'=>'ÑŠ','Ñ‹'=>'Ñ‹','ÑŒ'=>'ÑŒ','Ñ'=>'Ñ','ÑŽ'=>'ÑŽ','Ñ'=>'Ñ','Ñ'=>'Ñ','Ñ‘'=>'Ñ‘','Ñ’'=>'Ñ’','Ñ“'=>'Ñ“','Ñ”'=>'Ñ”','Ñ•'=>'Ñ•','Ñ–'=>'Ñ–','Ñ—'=>'Ñ—','ј'=>'ј','Ñ™'=>'Ñ™','Ñš'=>'Ñš','Ñ›'=>'Ñ›','Ñœ'=>'Ñœ','Ñ'=>'Ñ','Ñž'=>'Ñž','ÑŸ'=>'ÑŸ','Ñ '=>'Ñ¡','Ñ¡'=>'Ñ¡','Ñ¢'=>'Ñ£','Ñ£'=>'Ñ£','Ѥ'=>'Ñ¥','Ñ¥'=>'Ñ¥','Ѧ'=>'ѧ','ѧ'=>'ѧ','Ѩ'=>'Ñ©','Ñ©'=>'Ñ©','Ѫ'=>'Ñ«','Ñ«'=>'Ñ«','Ѭ'=>'Ñ­','Ñ­'=>'Ñ­','Ñ®'=>'ѯ','ѯ'=>'ѯ','Ñ°'=>'ѱ','ѱ'=>'ѱ','Ѳ'=>'ѳ','ѳ'=>'ѳ','Ñ´'=>'ѵ','ѵ'=>'ѵ','Ѷ'=>'Ñ·','Ñ·'=>'Ñ·','Ѹ'=>'ѹ','ѹ'=>'ѹ','Ѻ'=>'Ñ»','Ñ»'=>'Ñ»','Ѽ'=>'ѽ','ѽ'=>'ѽ','Ѿ'=>'Ñ¿','Ñ¿'=>'Ñ¿','Ò€'=>'Ò','Ò'=>'Ò','Òƒ'=>'Òƒ','Ò„'=>'Ò„','Ò…'=>'Ò…','Ò†'=>'Ò†','Òˆ'=>'Òˆ','Ò‰'=>'Ò‰','ÒŠ'=>'Ò‹','Ò‹'=>'Ò‹','ÒŒ'=>'Ò','Ò'=>'Ò','ÒŽ'=>'Ò','Ò'=>'Ò','Ò'=>'Ò‘','Ò‘'=>'Ò‘','Ò’'=>'Ò“','Ò“'=>'Ò“','Ò”'=>'Ò•','Ò•'=>'Ò•','Ò–'=>'Ò—','Ò—'=>'Ò—','Ò˜'=>'Ò™','Ò™'=>'Ò™','Òš'=>'Ò›','Ò›'=>'Ò›','Òœ'=>'Ò','Ò'=>'Ò','Òž'=>'ÒŸ','ÒŸ'=>'ÒŸ','Ò '=>'Ò¡','Ò¡'=>'Ò¡','Ò¢'=>'Ò£','Ò£'=>'Ò£','Ò¤'=>'Ò¥','Ò¥'=>'Ò¥','Ò¦'=>'Ò§','Ò§'=>'Ò§','Ò¨'=>'Ò©','Ò©'=>'Ò©','Òª'=>'Ò«','Ò«'=>'Ò«','Ò¬'=>'Ò­','Ò­'=>'Ò­','Ò®'=>'Ò¯','Ò¯'=>'Ò¯','Ò°'=>'Ò±','Ò±'=>'Ò±','Ò²'=>'Ò³','Ò³'=>'Ò³','Ò´'=>'Òµ','Òµ'=>'Òµ','Ò¶'=>'Ò·','Ò·'=>'Ò·','Ò¸'=>'Ò¹','Ò¹'=>'Ò¹','Òº'=>'Ò»','Ò»'=>'Ò»','Ò¼'=>'Ò½','Ò½'=>'Ò½','Ò¾'=>'Ò¿','Ò¿'=>'Ò¿','Ó€'=>'Ó','Ó'=>'Ó‚','Ó‚'=>'Ó‚','Óƒ'=>'Ó„','Ó„'=>'Ó„','Ó…'=>'Ó†','Ó†'=>'Ó†','Ó‡'=>'Óˆ','Óˆ'=>'Óˆ','Ó‰'=>'ÓŠ','ÓŠ'=>'ÓŠ','Ó‹'=>'ÓŒ','ÓŒ'=>'ÓŒ','Ó'=>'ÓŽ','ÓŽ'=>'ÓŽ','Ó'=>'Ó','Ó'=>'Ó‘','Ó‘'=>'Ó‘','Ó’'=>'Ó“','Ó“'=>'Ó“','Ó”'=>'Ó•','Ó•'=>'Ó•','Ó–'=>'Ó—','Ó—'=>'Ó—','Ó˜'=>'Ó™','Ó™'=>'Ó™','Óš'=>'Ó›','Ó›'=>'Ó›','Óœ'=>'Ó','Ó'=>'Ó','Óž'=>'ÓŸ','ÓŸ'=>'ÓŸ','Ó '=>'Ó¡','Ó¡'=>'Ó¡','Ó¢'=>'Ó£','Ó£'=>'Ó£','Ó¤'=>'Ó¥','Ó¥'=>'Ó¥','Ó¦'=>'Ó§','Ó§'=>'Ó§','Ó¨'=>'Ó©','Ó©'=>'Ó©','Óª'=>'Ó«','Ó«'=>'Ó«','Ó¬'=>'Ó­','Ó­'=>'Ó­','Ó®'=>'Ó¯','Ó¯'=>'Ó¯','Ó°'=>'Ó±','Ó±'=>'Ó±','Ó²'=>'Ó³','Ó³'=>'Ó³','Ó´'=>'Óµ','Óµ'=>'Óµ','Ó¶'=>'Ó·','Ó·'=>'Ó·','Ó¸'=>'Ó¹','Ó¹'=>'Ó¹','Óº'=>'Ó»','Ó»'=>'Ó»','Ó¼'=>'Ó½','Ó½'=>'Ó½','Ó¾'=>'Ó¿','Ó¿'=>'Ó¿','Ô€'=>'Ô','Ô'=>'Ô','Ô‚'=>'Ôƒ','Ôƒ'=>'Ôƒ','Ô„'=>'Ô…','Ô…'=>'Ô…','Ô†'=>'Ô‡','Ô‡'=>'Ô‡','Ôˆ'=>'Ô‰','Ô‰'=>'Ô‰','ÔŠ'=>'Ô‹','Ô‹'=>'Ô‹','ÔŒ'=>'Ô','Ô'=>'Ô','ÔŽ'=>'Ô','Ô'=>'Ô','Ô'=>'Ô‘','Ô‘'=>'Ô‘','Ô’'=>'Ô“','Ô“'=>'Ô“','Ô±'=>'Õ¡','Ô²'=>'Õ¢','Ô³'=>'Õ£','Ô´'=>'Õ¤','Ôµ'=>'Õ¥','Ô¶'=>'Õ¦','Ô·'=>'Õ§','Ô¸'=>'Õ¨','Ô¹'=>'Õ©','Ôº'=>'Õª','Ô»'=>'Õ«','Ô¼'=>'Õ¬','Ô½'=>'Õ­','Ô¾'=>'Õ®','Ô¿'=>'Õ¯','Õ€'=>'Õ°','Õ'=>'Õ±','Õ‚'=>'Õ²','Õƒ'=>'Õ³','Õ„'=>'Õ´','Õ…'=>'Õµ','Õ†'=>'Õ¶','Õ‡'=>'Õ·','Õˆ'=>'Õ¸','Õ‰'=>'Õ¹','ÕŠ'=>'Õº','Õ‹'=>'Õ»','ÕŒ'=>'Õ¼','Õ'=>'Õ½','ÕŽ'=>'Õ¾','Õ'=>'Õ¿','Õ'=>'Ö€','Õ‘'=>'Ö','Õ’'=>'Ö‚','Õ“'=>'Öƒ','Õ”'=>'Ö„','Õ•'=>'Ö…','Õ–'=>'Ö†','Õ™'=>'Õ™','Õ¡'=>'Õ¡','Õ¢'=>'Õ¢','Õ£'=>'Õ£','Õ¤'=>'Õ¤','Õ¥'=>'Õ¥','Õ¦'=>'Õ¦','Õ§'=>'Õ§','Õ¨'=>'Õ¨','Õ©'=>'Õ©','Õª'=>'Õª','Õ«'=>'Õ«','Õ¬'=>'Õ¬','Õ­'=>'Õ­','Õ®'=>'Õ®','Õ¯'=>'Õ¯','Õ°'=>'Õ°','Õ±'=>'Õ±','Õ²'=>'Õ²','Õ³'=>'Õ³','Õ´'=>'Õ´','Õµ'=>'Õµ','Õ¶'=>'Õ¶','Õ·'=>'Õ·','Õ¸'=>'Õ¸','Õ¹'=>'Õ¹','Õº'=>'Õº','Õ»'=>'Õ»','Õ¼'=>'Õ¼','Õ½'=>'Õ½','Õ¾'=>'Õ¾','Õ¿'=>'Õ¿','Ö€'=>'Ö€','Ö'=>'Ö','Ö‚'=>'Ö‚','Öƒ'=>'Öƒ','Ö„'=>'Ö„','Ö…'=>'Ö…','Ö†'=>'Ö†','Ö‡'=>'Ö‡','Ö‘'=>'Ö‘','Ö’'=>'Ö’','Ö“'=>'Ö“','Ö”'=>'Ö”','Ö•'=>'Ö•','Ö–'=>'Ö–','Ö—'=>'Ö—','Ö˜'=>'Ö˜','Ö™'=>'Ö™','Öš'=>'Öš','Ö›'=>'Ö›','Öœ'=>'Öœ','Ö'=>'Ö','Öž'=>'Öž','ÖŸ'=>'ÖŸ','Ö '=>'Ö ','Ö¡'=>'Ö¡','Ö¢'=>'Ö¢','Ö£'=>'Ö£','Ö¤'=>'Ö¤','Ö¥'=>'Ö¥','Ö¦'=>'Ö¦','Ö§'=>'Ö§','Ö¨'=>'Ö¨','Ö©'=>'Ö©','Öª'=>'Öª','Ö«'=>'Ö«','Ö¬'=>'Ö¬','Ö­'=>'Ö­','Ö®'=>'Ö®','Ö¯'=>'Ö¯','Ö°'=>'Ö°','Ö±'=>'Ö±','Ö²'=>'Ö²','Ö³'=>'Ö³','Ö´'=>'Ö´','Öµ'=>'Öµ','Ö¶'=>'Ö¶','Ö·'=>'Ö·','Ö¸'=>'Ö¸','Ö¹'=>'Ö¹','Öº'=>'Öº','Ö»'=>'Ö»','Ö¼'=>'Ö¼','Ö½'=>'Ö½','Ö¿'=>'Ö¿','×'=>'×','ׂ'=>'ׂ','ׄ'=>'ׄ','×…'=>'×…','ׇ'=>'ׇ','×'=>'×','ב'=>'ב','×’'=>'×’','ד'=>'ד','×”'=>'×”','ו'=>'ו','×–'=>'×–','×—'=>'×—','ט'=>'ט','×™'=>'×™','ך'=>'ך','×›'=>'×›','ל'=>'ל','×'=>'×','מ'=>'מ','ן'=>'ן','× '=>'× ','ס'=>'ס','×¢'=>'×¢','×£'=>'×£','פ'=>'פ','×¥'=>'×¥','צ'=>'צ','ק'=>'ק','ר'=>'ר','ש'=>'ש','ת'=>'ת','×°'=>'×°','×±'=>'×±','ײ'=>'ײ','Ø'=>'Ø','Ø‘'=>'Ø‘','Ø’'=>'Ø’','Ø“'=>'Ø“','Ø”'=>'Ø”','Ø•'=>'Ø•','Ø¡'=>'Ø¡','Ø¢'=>'Ø¢','Ø£'=>'Ø£','ؤ'=>'ؤ','Ø¥'=>'Ø¥','ئ'=>'ئ','ا'=>'ا','ب'=>'ب','Ø©'=>'Ø©','ت'=>'ت','Ø«'=>'Ø«','ج'=>'ج','Ø­'=>'Ø­','Ø®'=>'Ø®','د'=>'د','Ø°'=>'Ø°','ر'=>'ر','ز'=>'ز','س'=>'س','Ø´'=>'Ø´','ص'=>'ص','ض'=>'ض','Ø·'=>'Ø·','ظ'=>'ظ','ع'=>'ع','غ'=>'غ','Ù€'=>'Ù€','Ù'=>'Ù','Ù‚'=>'Ù‚','Ùƒ'=>'Ùƒ','Ù„'=>'Ù„','Ù…'=>'Ù…','Ù†'=>'Ù†','Ù‡'=>'Ù‡','Ùˆ'=>'Ùˆ','Ù‰'=>'Ù‰','ÙŠ'=>'ÙŠ','Ù‹'=>'Ù‹','ÙŒ'=>'ÙŒ','Ù'=>'Ù','ÙŽ'=>'ÙŽ','Ù'=>'Ù','Ù'=>'Ù','Ù‘'=>'Ù‘','Ù’'=>'Ù’','Ù“'=>'Ù“','Ù”'=>'Ù”','Ù•'=>'Ù•','Ù–'=>'Ù–','Ù—'=>'Ù—','Ù˜'=>'Ù˜','Ù™'=>'Ù™','Ùš'=>'Ùš','Ù›'=>'Ù›','Ùœ'=>'Ùœ','Ù'=>'Ù','Ùž'=>'Ùž','Ù '=>'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/sources/phpBB/includes/utf/data/search_indexer_1.php b/sources/phpBB/includes/utf/data/search_indexer_1.php new file mode 100644 index 0000000..4dd142b --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_1.php @@ -0,0 +1 @@ +'à¤','ं'=>'ं','ः'=>'ः','ऄ'=>'ऄ','अ'=>'अ','आ'=>'आ','इ'=>'इ','ई'=>'ई','उ'=>'उ','ऊ'=>'ऊ','ऋ'=>'ऋ','ऌ'=>'ऌ','à¤'=>'à¤','ऎ'=>'ऎ','à¤'=>'à¤','à¤'=>'à¤','ऑ'=>'ऑ','ऒ'=>'ऒ','ओ'=>'ओ','औ'=>'औ','क'=>'क','ख'=>'ख','ग'=>'ग','घ'=>'घ','ङ'=>'ङ','च'=>'च','छ'=>'छ','ज'=>'ज','à¤'=>'à¤','ञ'=>'ञ','ट'=>'ट','ठ'=>'ठ','ड'=>'ड','ढ'=>'ढ','ण'=>'ण','त'=>'त','थ'=>'थ','द'=>'द','ध'=>'ध','न'=>'न','ऩ'=>'ऩ','प'=>'प','फ'=>'फ','ब'=>'ब','भ'=>'भ','म'=>'म','य'=>'य','र'=>'र','ऱ'=>'ऱ','ल'=>'ल','ळ'=>'ळ','ऴ'=>'ऴ','व'=>'व','श'=>'श','ष'=>'ष','स'=>'स','ह'=>'ह','़'=>'़','ऽ'=>'ऽ','ा'=>'ा','ि'=>'ि','ी'=>'ी','à¥'=>'à¥','ू'=>'ू','ृ'=>'ृ','ॄ'=>'ॄ','ॅ'=>'ॅ','ॆ'=>'ॆ','े'=>'े','ै'=>'ै','ॉ'=>'ॉ','ॊ'=>'ॊ','ो'=>'ो','ौ'=>'ौ','à¥'=>'à¥','à¥'=>'à¥','॑'=>'॑','॒'=>'॒','॓'=>'॓','॔'=>'॔','क़'=>'क़','ख़'=>'ख़','ग़'=>'ग़','ज़'=>'ज़','ड़'=>'ड़','à¥'=>'à¥','फ़'=>'फ़','य़'=>'य़','ॠ'=>'ॠ','ॡ'=>'ॡ','ॢ'=>'ॢ','ॣ'=>'ॣ','०'=>'0','१'=>'1','२'=>'2','३'=>'3','४'=>'4','५'=>'5','६'=>'6','७'=>'7','८'=>'8','९'=>'9','ॻ'=>'ॻ','ॼ'=>'ॼ','ॽ'=>'ॽ','ॾ'=>'ॾ','ॿ'=>'ॿ','à¦'=>'à¦','ং'=>'ং','ঃ'=>'ঃ','অ'=>'অ','আ'=>'আ','ই'=>'ই','ঈ'=>'ঈ','উ'=>'উ','ঊ'=>'ঊ','ঋ'=>'ঋ','ঌ'=>'ঌ','à¦'=>'à¦','à¦'=>'à¦','ও'=>'ও','ঔ'=>'ঔ','ক'=>'ক','খ'=>'খ','গ'=>'গ','ঘ'=>'ঘ','ঙ'=>'ঙ','চ'=>'চ','ছ'=>'ছ','জ'=>'জ','à¦'=>'à¦','ঞ'=>'ঞ','ট'=>'ট','ঠ'=>'ঠ','ড'=>'ড','ঢ'=>'ঢ','ণ'=>'ণ','ত'=>'ত','থ'=>'থ','দ'=>'দ','ধ'=>'ধ','ন'=>'ন','প'=>'প','ফ'=>'ফ','ব'=>'ব','ভ'=>'ভ','ম'=>'ম','য'=>'য','র'=>'র','ল'=>'ল','শ'=>'শ','ষ'=>'ষ','স'=>'স','হ'=>'হ','়'=>'়','ঽ'=>'ঽ','া'=>'া','ি'=>'ি','ী'=>'ী','à§'=>'à§','ূ'=>'ূ','ৃ'=>'ৃ','ৄ'=>'ৄ','ে'=>'ে','ৈ'=>'ৈ','ো'=>'ো','ৌ'=>'ৌ','à§'=>'à§','ৎ'=>'ৎ','ৗ'=>'ৗ','ড়'=>'ড়','à§'=>'à§','য়'=>'য়','ৠ'=>'ৠ','ৡ'=>'ৡ','ৢ'=>'ৢ','ৣ'=>'ৣ','০'=>'0','১'=>'1','২'=>'2','৩'=>'3','৪'=>'4','৫'=>'5','৬'=>'6','৭'=>'7','৮'=>'8','৯'=>'9','ৰ'=>'ৰ','ৱ'=>'ৱ','৴'=>'1','৵'=>'2','৶'=>'3','৷'=>'4','৸'=>'৸','৹'=>'16','à¨'=>'à¨','ਂ'=>'ਂ','ਃ'=>'ਃ','ਅ'=>'ਅ','ਆ'=>'ਆ','ਇ'=>'ਇ','ਈ'=>'ਈ','ਉ'=>'ਉ','ਊ'=>'ਊ','à¨'=>'à¨','à¨'=>'à¨','ਓ'=>'ਓ','ਔ'=>'ਔ','ਕ'=>'ਕ','ਖ'=>'ਖ','ਗ'=>'ਗ','ਘ'=>'ਘ','ਙ'=>'ਙ','ਚ'=>'ਚ','ਛ'=>'ਛ','ਜ'=>'ਜ','à¨'=>'à¨','ਞ'=>'ਞ','ਟ'=>'ਟ','ਠ'=>'ਠ','ਡ'=>'ਡ','ਢ'=>'ਢ','ਣ'=>'ਣ','ਤ'=>'ਤ','ਥ'=>'ਥ','ਦ'=>'ਦ','ਧ'=>'ਧ','ਨ'=>'ਨ','ਪ'=>'ਪ','ਫ'=>'ਫ','ਬ'=>'ਬ','ਭ'=>'ਭ','ਮ'=>'ਮ','ਯ'=>'ਯ','ਰ'=>'ਰ','ਲ'=>'ਲ','ਲ਼'=>'ਲ਼','ਵ'=>'ਵ','ਸ਼'=>'ਸ਼','ਸ'=>'ਸ','ਹ'=>'ਹ','਼'=>'਼','ਾ'=>'ਾ','ਿ'=>'ਿ','à©€'=>'à©€','à©'=>'à©','à©‚'=>'à©‚','ੇ'=>'ੇ','ੈ'=>'ੈ','à©‹'=>'à©‹','à©Œ'=>'à©Œ','à©'=>'à©','à©™'=>'à©™','à©š'=>'à©š','à©›'=>'à©›','à©œ'=>'à©œ','à©ž'=>'à©ž','੦'=>'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','௰'=>'10','௱'=>'100','௲'=>'1000','à°'=>'à°','à°‚'=>'à°‚','à°ƒ'=>'à°ƒ','à°…'=>'à°…','à°†'=>'à°†','à°‡'=>'à°‡','à°ˆ'=>'à°ˆ','à°‰'=>'à°‰','à°Š'=>'à°Š','à°‹'=>'à°‹','à°Œ'=>'à°Œ','à°Ž'=>'à°Ž','à°'=>'à°','à°'=>'à°','à°’'=>'à°’','à°“'=>'à°“','à°”'=>'à°”','à°•'=>'à°•','à°–'=>'à°–','à°—'=>'à°—','à°˜'=>'à°˜','à°™'=>'à°™','à°š'=>'à°š','à°›'=>'à°›','à°œ'=>'à°œ','à°'=>'à°','à°ž'=>'à°ž','à°Ÿ'=>'à°Ÿ','à° '=>'à° ','à°¡'=>'à°¡','à°¢'=>'à°¢','à°£'=>'à°£','à°¤'=>'à°¤','à°¥'=>'à°¥','à°¦'=>'à°¦','à°§'=>'à°§','à°¨'=>'à°¨','à°ª'=>'à°ª','à°«'=>'à°«','à°¬'=>'à°¬','à°­'=>'à°­','à°®'=>'à°®','à°¯'=>'à°¯','à°°'=>'à°°','à°±'=>'à°±','à°²'=>'à°²','à°³'=>'à°³','à°µ'=>'à°µ','à°¶'=>'à°¶','à°·'=>'à°·','à°¸'=>'à°¸','à°¹'=>'à°¹','à°¾'=>'à°¾','à°¿'=>'à°¿','à±€'=>'à±€','à±'=>'à±','ూ'=>'ూ','ృ'=>'ృ','ౄ'=>'ౄ','ె'=>'ె','ే'=>'ే','ై'=>'ై','ొ'=>'ొ','ో'=>'ో','ౌ'=>'ౌ','à±'=>'à±','ౕ'=>'ౕ','à±–'=>'à±–','à± '=>'à± ','ౡ'=>'ౡ','౦'=>'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','ໜ'=>'ໜ','à»'=>'à»','ༀ'=>'ༀ','༘'=>'༘','༙'=>'༙','༠'=>'0','༡'=>'1','༢'=>'2','༣'=>'3','༤'=>'4','༥'=>'5','༦'=>'6','༧'=>'7','༨'=>'8','༩'=>'9','༪'=>'1/2','༫'=>'3/2','༬'=>'5/2','༭'=>'7/2','༮'=>'9/2','༯'=>'11/2','༰'=>'13/2','༱'=>'15/2','༲'=>'17/2','༳'=>'-1/2','༵'=>'༵','༷'=>'༷','༹'=>'༹','༾'=>'༾','༿'=>'༿','ཀ'=>'ཀ','à½'=>'à½','ག'=>'ག','གྷ'=>'གྷ','ང'=>'ང','ཅ'=>'ཅ','ཆ'=>'ཆ','ཇ'=>'ཇ','ཉ'=>'ཉ','ཊ'=>'ཊ','ཋ'=>'ཋ','ཌ'=>'ཌ','à½'=>'à½','ཎ'=>'ཎ','à½'=>'à½','à½'=>'à½','ད'=>'ད','དྷ'=>'དྷ','ན'=>'ན','པ'=>'པ','ཕ'=>'ཕ','བ'=>'བ','བྷ'=>'བྷ','མ'=>'མ','ཙ'=>'ཙ','ཚ'=>'ཚ','ཛ'=>'ཛ','ཛྷ'=>'ཛྷ','à½'=>'à½','ཞ'=>'ཞ','ཟ'=>'ཟ','འ'=>'འ','ཡ'=>'ཡ','ར'=>'ར','ལ'=>'ལ','ཤ'=>'ཤ','ཥ'=>'ཥ','ས'=>'ས','ཧ'=>'ཧ','ཨ'=>'ཨ','ཀྵ'=>'ཀྵ','ཪ'=>'ཪ','ཱ'=>'ཱ','ི'=>'ི','ཱི'=>'ཱི','ུ'=>'ུ','ཱུ'=>'ཱུ','ྲྀ'=>'ྲྀ','ཷ'=>'ཷ','ླྀ'=>'ླྀ','ཹ'=>'ཹ','ེ'=>'ེ','ཻ'=>'ཻ','ོ'=>'ོ','ཽ'=>'ཽ','ཾ'=>'ཾ','ཿ'=>'ཿ','ྀ'=>'ྀ','à¾'=>'à¾','ྂ'=>'ྂ','ྃ'=>'ྃ','྄'=>'྄','྆'=>'྆','྇'=>'྇','ྈ'=>'ྈ','ྉ'=>'ྉ','ྊ'=>'ྊ','ྋ'=>'ྋ','à¾'=>'à¾','ྑ'=>'ྑ','ྒ'=>'ྒ','ྒྷ'=>'ྒྷ','ྔ'=>'ྔ','ྕ'=>'ྕ','ྖ'=>'ྖ','ྗ'=>'ྗ','ྙ'=>'ྙ','ྚ'=>'ྚ','ྛ'=>'ྛ','ྜ'=>'ྜ','à¾'=>'à¾','ྞ'=>'ྞ','ྟ'=>'ྟ','ྠ'=>'ྠ','ྡ'=>'ྡ','ྡྷ'=>'ྡྷ','ྣ'=>'ྣ','ྤ'=>'ྤ','ྥ'=>'ྥ','ྦ'=>'ྦ','ྦྷ'=>'ྦྷ','ྨ'=>'ྨ','ྩ'=>'ྩ','ྪ'=>'ྪ','ྫ'=>'ྫ','ྫྷ'=>'ྫྷ','ྭ'=>'ྭ','ྮ'=>'ྮ','ྯ'=>'ྯ','ྰ'=>'ྰ','ྱ'=>'ྱ','ྲ'=>'ྲ','ླ'=>'ླ','ྴ'=>'ྴ','ྵ'=>'ྵ','ྶ'=>'ྶ','ྷ'=>'ྷ','ྸ'=>'ྸ','ྐྵ'=>'ྐྵ','ྺ'=>'ྺ','ྻ'=>'ྻ','ྼ'=>'ྼ','࿆'=>'࿆'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_19.php b/sources/phpBB/includes/utf/data/search_indexer_19.php new file mode 100644 index 0000000..d10d09f --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_19.php @@ -0,0 +1 @@ +'é¾»'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_2.php b/sources/phpBB/includes/utf/data/search_indexer_2.php new file mode 100644 index 0000000..5b5f034 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_2.php @@ -0,0 +1 @@ +'က','á€'=>'á€','ဂ'=>'ဂ','ဃ'=>'ဃ','င'=>'င','စ'=>'စ','ဆ'=>'ဆ','ဇ'=>'ဇ','ဈ'=>'ဈ','ဉ'=>'ဉ','ည'=>'ည','ဋ'=>'ဋ','ဌ'=>'ဌ','á€'=>'á€','ဎ'=>'ဎ','á€'=>'á€','á€'=>'á€','ထ'=>'ထ','ဒ'=>'ဒ','ဓ'=>'ဓ','န'=>'န','ပ'=>'ပ','ဖ'=>'ဖ','ဗ'=>'ဗ','ဘ'=>'ဘ','မ'=>'မ','ယ'=>'ယ','ရ'=>'ရ','လ'=>'လ','á€'=>'á€','သ'=>'သ','ဟ'=>'ဟ','ဠ'=>'ဠ','အ'=>'အ','ဣ'=>'ဣ','ဤ'=>'ဤ','ဥ'=>'ဥ','ဦ'=>'ဦ','ဧ'=>'ဧ','ဩ'=>'ဩ','ဪ'=>'ဪ','ာ'=>'ာ','ိ'=>'ိ','ီ'=>'ီ','ု'=>'ု','ူ'=>'ူ','ေ'=>'ေ','ဲ'=>'ဲ','ံ'=>'ံ','့'=>'့','း'=>'း','္'=>'္','á€'=>'0','á'=>'1','á‚'=>'2','áƒ'=>'3','á„'=>'4','á…'=>'5','á†'=>'6','á‡'=>'7','áˆ'=>'8','á‰'=>'9','á'=>'á','á‘'=>'á‘','á’'=>'á’','á“'=>'á“','á”'=>'á”','á•'=>'á•','á–'=>'á–','á—'=>'á—','á˜'=>'á˜','á™'=>'á™','á‚ '=>'â´€','á‚¡'=>'â´','á‚¢'=>'â´‚','á‚£'=>'â´ƒ','Ⴄ'=>'â´„','á‚¥'=>'â´…','Ⴆ'=>'â´†','Ⴇ'=>'â´‡','Ⴈ'=>'â´ˆ','á‚©'=>'â´‰','Ⴊ'=>'â´Š','á‚«'=>'â´‹','Ⴌ'=>'â´Œ','á‚­'=>'â´','á‚®'=>'â´Ž','Ⴏ'=>'â´','á‚°'=>'â´','Ⴑ'=>'â´‘','Ⴒ'=>'â´’','Ⴓ'=>'â´“','á‚´'=>'â´”','Ⴕ'=>'â´•','Ⴖ'=>'â´–','á‚·'=>'â´—','Ⴘ'=>'â´˜','Ⴙ'=>'â´™','Ⴚ'=>'â´š','á‚»'=>'â´›','Ⴜ'=>'â´œ','Ⴝ'=>'â´','Ⴞ'=>'â´ž','á‚¿'=>'â´Ÿ','Ⴠ'=>'â´ ','áƒ'=>'â´¡','Ⴢ'=>'â´¢','Ⴣ'=>'â´£','Ⴤ'=>'â´¤','Ⴥ'=>'â´¥','áƒ'=>'áƒ','ბ'=>'ბ','გ'=>'გ','დ'=>'დ','ე'=>'ე','ვ'=>'ვ','ზ'=>'ზ','თ'=>'თ','ი'=>'ი','კ'=>'კ','ლ'=>'ლ','მ'=>'მ','ნ'=>'ნ','áƒ'=>'áƒ','პ'=>'პ','ჟ'=>'ჟ','რ'=>'რ','ს'=>'ს','ტ'=>'ტ','უ'=>'უ','ფ'=>'ფ','ქ'=>'ქ','ღ'=>'ღ','ყ'=>'ყ','შ'=>'შ','ჩ'=>'ჩ','ც'=>'ც','ძ'=>'ძ','წ'=>'წ','ჭ'=>'ჭ','ხ'=>'ხ','ჯ'=>'ჯ','ჰ'=>'ჰ','ჱ'=>'ჱ','ჲ'=>'ჲ','ჳ'=>'ჳ','ჴ'=>'ჴ','ჵ'=>'ჵ','ჶ'=>'ჶ','ჷ'=>'ჷ','ჸ'=>'ჸ','ჹ'=>'ჹ','ჺ'=>'ჺ','ჼ'=>'ჼ','á„€'=>'á„€','á„'=>'á„','á„‚'=>'á„‚','ᄃ'=>'ᄃ','á„„'=>'á„„','á„…'=>'á„…','ᄆ'=>'ᄆ','ᄇ'=>'ᄇ','ᄈ'=>'ᄈ','ᄉ'=>'ᄉ','á„Š'=>'á„Š','á„‹'=>'á„‹','á„Œ'=>'á„Œ','á„'=>'á„','á„Ž'=>'á„Ž','á„'=>'á„','á„'=>'á„','á„‘'=>'á„‘','á„’'=>'á„’','á„“'=>'á„“','á„”'=>'á„”','á„•'=>'á„•','á„–'=>'á„–','á„—'=>'á„—','ᄘ'=>'ᄘ','á„™'=>'á„™','á„š'=>'á„š','á„›'=>'á„›','á„œ'=>'á„œ','á„'=>'á„','á„ž'=>'á„ž','á„Ÿ'=>'á„Ÿ','á„ '=>'á„ ','á„¡'=>'á„¡','á„¢'=>'á„¢','á„£'=>'á„£','ᄤ'=>'ᄤ','á„¥'=>'á„¥','ᄦ'=>'ᄦ','ᄧ'=>'ᄧ','ᄨ'=>'ᄨ','á„©'=>'á„©','ᄪ'=>'ᄪ','á„«'=>'á„«','ᄬ'=>'ᄬ','á„­'=>'á„­','á„®'=>'á„®','ᄯ'=>'ᄯ','á„°'=>'á„°','ᄱ'=>'ᄱ','ᄲ'=>'ᄲ','ᄳ'=>'ᄳ','á„´'=>'á„´','ᄵ'=>'ᄵ','ᄶ'=>'ᄶ','á„·'=>'á„·','ᄸ'=>'ᄸ','ᄹ'=>'ᄹ','ᄺ'=>'ᄺ','á„»'=>'á„»','ᄼ'=>'ᄼ','ᄽ'=>'ᄽ','ᄾ'=>'ᄾ','á„¿'=>'á„¿','á…€'=>'á…€','á…'=>'á…','á…‚'=>'á…‚','á…ƒ'=>'á…ƒ','á…„'=>'á…„','á……'=>'á……','á…†'=>'á…†','á…‡'=>'á…‡','á…ˆ'=>'á…ˆ','á…‰'=>'á…‰','á…Š'=>'á…Š','á…‹'=>'á…‹','á…Œ'=>'á…Œ','á…'=>'á…','á…Ž'=>'á…Ž','á…'=>'á…','á…'=>'á…','á…‘'=>'á…‘','á…’'=>'á…’','á…“'=>'á…“','á…”'=>'á…”','á…•'=>'á…•','á…–'=>'á…–','á…—'=>'á…—','á…˜'=>'á…˜','á…™'=>'á…™','á…Ÿ'=>'á…Ÿ','á… '=>'á… ','á…¡'=>'á…¡','á…¢'=>'á…¢','á…£'=>'á…£','á…¤'=>'á…¤','á…¥'=>'á…¥','á…¦'=>'á…¦','á…§'=>'á…§','á…¨'=>'á…¨','á…©'=>'á…©','á…ª'=>'á…ª','á…«'=>'á…«','á…¬'=>'á…¬','á…­'=>'á…­','á…®'=>'á…®','á…¯'=>'á…¯','á…°'=>'á…°','á…±'=>'á…±','á…²'=>'á…²','á…³'=>'á…³','á…´'=>'á…´','á…µ'=>'á…µ','á…¶'=>'á…¶','á…·'=>'á…·','á…¸'=>'á…¸','á…¹'=>'á…¹','á…º'=>'á…º','á…»'=>'á…»','á…¼'=>'á…¼','á…½'=>'á…½','á…¾'=>'á…¾','á…¿'=>'á…¿','ᆀ'=>'ᆀ','á†'=>'á†','ᆂ'=>'ᆂ','ᆃ'=>'ᆃ','ᆄ'=>'ᆄ','ᆅ'=>'ᆅ','ᆆ'=>'ᆆ','ᆇ'=>'ᆇ','ᆈ'=>'ᆈ','ᆉ'=>'ᆉ','ᆊ'=>'ᆊ','ᆋ'=>'ᆋ','ᆌ'=>'ᆌ','á†'=>'á†','ᆎ'=>'ᆎ','á†'=>'á†','á†'=>'á†','ᆑ'=>'ᆑ','ᆒ'=>'ᆒ','ᆓ'=>'ᆓ','ᆔ'=>'ᆔ','ᆕ'=>'ᆕ','ᆖ'=>'ᆖ','ᆗ'=>'ᆗ','ᆘ'=>'ᆘ','ᆙ'=>'ᆙ','ᆚ'=>'ᆚ','ᆛ'=>'ᆛ','ᆜ'=>'ᆜ','á†'=>'á†','ᆞ'=>'ᆞ','ᆟ'=>'ᆟ','ᆠ'=>'ᆠ','ᆡ'=>'ᆡ','ᆢ'=>'ᆢ','ᆨ'=>'ᆨ','ᆩ'=>'ᆩ','ᆪ'=>'ᆪ','ᆫ'=>'ᆫ','ᆬ'=>'ᆬ','ᆭ'=>'ᆭ','ᆮ'=>'ᆮ','ᆯ'=>'ᆯ','ᆰ'=>'ᆰ','ᆱ'=>'ᆱ','ᆲ'=>'ᆲ','ᆳ'=>'ᆳ','ᆴ'=>'ᆴ','ᆵ'=>'ᆵ','ᆶ'=>'ᆶ','ᆷ'=>'ᆷ','ᆸ'=>'ᆸ','ᆹ'=>'ᆹ','ᆺ'=>'ᆺ','ᆻ'=>'ᆻ','ᆼ'=>'ᆼ','ᆽ'=>'ᆽ','ᆾ'=>'ᆾ','ᆿ'=>'ᆿ','ᇀ'=>'ᇀ','á‡'=>'á‡','ᇂ'=>'ᇂ','ᇃ'=>'ᇃ','ᇄ'=>'ᇄ','ᇅ'=>'ᇅ','ᇆ'=>'ᇆ','ᇇ'=>'ᇇ','ᇈ'=>'ᇈ','ᇉ'=>'ᇉ','ᇊ'=>'ᇊ','ᇋ'=>'ᇋ','ᇌ'=>'ᇌ','á‡'=>'á‡','ᇎ'=>'ᇎ','á‡'=>'á‡','á‡'=>'á‡','ᇑ'=>'ᇑ','ᇒ'=>'ᇒ','ᇓ'=>'ᇓ','ᇔ'=>'ᇔ','ᇕ'=>'ᇕ','ᇖ'=>'ᇖ','ᇗ'=>'ᇗ','ᇘ'=>'ᇘ','ᇙ'=>'ᇙ','ᇚ'=>'ᇚ','ᇛ'=>'ᇛ','ᇜ'=>'ᇜ','á‡'=>'á‡','ᇞ'=>'ᇞ','ᇟ'=>'ᇟ','ᇠ'=>'ᇠ','ᇡ'=>'ᇡ','ᇢ'=>'ᇢ','ᇣ'=>'ᇣ','ᇤ'=>'ᇤ','ᇥ'=>'ᇥ','ᇦ'=>'ᇦ','ᇧ'=>'ᇧ','ᇨ'=>'ᇨ','ᇩ'=>'ᇩ','ᇪ'=>'ᇪ','ᇫ'=>'ᇫ','ᇬ'=>'ᇬ','ᇭ'=>'ᇭ','ᇮ'=>'ᇮ','ᇯ'=>'ᇯ','ᇰ'=>'ᇰ','ᇱ'=>'ᇱ','ᇲ'=>'ᇲ','ᇳ'=>'ᇳ','ᇴ'=>'ᇴ','ᇵ'=>'ᇵ','ᇶ'=>'ᇶ','ᇷ'=>'ᇷ','ᇸ'=>'ᇸ','ᇹ'=>'ᇹ','ሀ'=>'ሀ','áˆ'=>'áˆ','ሂ'=>'ሂ','ሃ'=>'ሃ','ሄ'=>'ሄ','ህ'=>'ህ','ሆ'=>'ሆ','ሇ'=>'ሇ','ለ'=>'ለ','ሉ'=>'ሉ','ሊ'=>'ሊ','ላ'=>'ላ','ሌ'=>'ሌ','áˆ'=>'áˆ','ሎ'=>'ሎ','áˆ'=>'áˆ','áˆ'=>'áˆ','ሑ'=>'ሑ','ሒ'=>'ሒ','ሓ'=>'ሓ','ሔ'=>'ሔ','ሕ'=>'ሕ','ሖ'=>'ሖ','ሗ'=>'ሗ','መ'=>'መ','ሙ'=>'ሙ','ሚ'=>'ሚ','ማ'=>'ማ','ሜ'=>'ሜ','áˆ'=>'áˆ','ሞ'=>'ሞ','ሟ'=>'ሟ','ሠ'=>'ሠ','ሡ'=>'ሡ','ሢ'=>'ሢ','ሣ'=>'ሣ','ሤ'=>'ሤ','ሥ'=>'ሥ','ሦ'=>'ሦ','ሧ'=>'ሧ','ረ'=>'ረ','ሩ'=>'ሩ','ሪ'=>'ሪ','ራ'=>'ራ','ሬ'=>'ሬ','ር'=>'ር','ሮ'=>'ሮ','ሯ'=>'ሯ','ሰ'=>'ሰ','ሱ'=>'ሱ','ሲ'=>'ሲ','ሳ'=>'ሳ','ሴ'=>'ሴ','ስ'=>'ስ','ሶ'=>'ሶ','ሷ'=>'ሷ','ሸ'=>'ሸ','ሹ'=>'ሹ','ሺ'=>'ሺ','ሻ'=>'ሻ','ሼ'=>'ሼ','ሽ'=>'ሽ','ሾ'=>'ሾ','ሿ'=>'ሿ','ቀ'=>'ቀ','á‰'=>'á‰','ቂ'=>'ቂ','ቃ'=>'ቃ','ቄ'=>'ቄ','ቅ'=>'ቅ','ቆ'=>'ቆ','ቇ'=>'ቇ','ቈ'=>'ቈ','ቊ'=>'ቊ','ቋ'=>'ቋ','ቌ'=>'ቌ','á‰'=>'á‰','á‰'=>'á‰','ቑ'=>'ቑ','ቒ'=>'ቒ','ቓ'=>'ቓ','ቔ'=>'ቔ','ቕ'=>'ቕ','ቖ'=>'ቖ','ቘ'=>'ቘ','ቚ'=>'ቚ','ቛ'=>'ቛ','ቜ'=>'ቜ','á‰'=>'á‰','በ'=>'በ','ቡ'=>'ቡ','ቢ'=>'ቢ','ባ'=>'ባ','ቤ'=>'ቤ','ብ'=>'ብ','ቦ'=>'ቦ','ቧ'=>'ቧ','ቨ'=>'ቨ','ቩ'=>'ቩ','ቪ'=>'ቪ','ቫ'=>'ቫ','ቬ'=>'ቬ','ቭ'=>'ቭ','ቮ'=>'ቮ','ቯ'=>'ቯ','ተ'=>'ተ','ቱ'=>'ቱ','ቲ'=>'ቲ','ታ'=>'ታ','ቴ'=>'ቴ','ት'=>'ት','ቶ'=>'ቶ','ቷ'=>'ቷ','ቸ'=>'ቸ','ቹ'=>'ቹ','ቺ'=>'ቺ','ቻ'=>'ቻ','ቼ'=>'ቼ','ች'=>'ች','ቾ'=>'ቾ','ቿ'=>'ቿ','ኀ'=>'ኀ','áŠ'=>'áŠ','ኂ'=>'ኂ','ኃ'=>'ኃ','ኄ'=>'ኄ','ኅ'=>'ኅ','ኆ'=>'ኆ','ኇ'=>'ኇ','ኈ'=>'ኈ','ኊ'=>'ኊ','ኋ'=>'ኋ','ኌ'=>'ኌ','áŠ'=>'áŠ','áŠ'=>'áŠ','ኑ'=>'ኑ','ኒ'=>'ኒ','ና'=>'ና','ኔ'=>'ኔ','ን'=>'ን','ኖ'=>'ኖ','ኗ'=>'ኗ','ኘ'=>'ኘ','ኙ'=>'ኙ','ኚ'=>'ኚ','ኛ'=>'ኛ','ኜ'=>'ኜ','áŠ'=>'áŠ','ኞ'=>'ኞ','ኟ'=>'ኟ','አ'=>'አ','ኡ'=>'ኡ','ኢ'=>'ኢ','ኣ'=>'ኣ','ኤ'=>'ኤ','እ'=>'እ','ኦ'=>'ኦ','ኧ'=>'ኧ','ከ'=>'ከ','ኩ'=>'ኩ','ኪ'=>'ኪ','ካ'=>'ካ','ኬ'=>'ኬ','ክ'=>'ክ','ኮ'=>'ኮ','ኯ'=>'ኯ','ኰ'=>'ኰ','ኲ'=>'ኲ','ኳ'=>'ኳ','ኴ'=>'ኴ','ኵ'=>'ኵ','ኸ'=>'ኸ','ኹ'=>'ኹ','ኺ'=>'ኺ','ኻ'=>'ኻ','ኼ'=>'ኼ','ኽ'=>'ኽ','ኾ'=>'ኾ','á‹€'=>'á‹€','á‹‚'=>'á‹‚','ዃ'=>'ዃ','á‹„'=>'á‹„','á‹…'=>'á‹…','ወ'=>'ወ','ዉ'=>'ዉ','á‹Š'=>'á‹Š','á‹‹'=>'á‹‹','á‹Œ'=>'á‹Œ','á‹'=>'á‹','á‹Ž'=>'á‹Ž','á‹'=>'á‹','á‹'=>'á‹','á‹‘'=>'á‹‘','á‹’'=>'á‹’','á‹“'=>'á‹“','á‹”'=>'á‹”','á‹•'=>'á‹•','á‹–'=>'á‹–','ዘ'=>'ዘ','á‹™'=>'á‹™','á‹š'=>'á‹š','á‹›'=>'á‹›','á‹œ'=>'á‹œ','á‹'=>'á‹','á‹ž'=>'á‹ž','á‹Ÿ'=>'á‹Ÿ','á‹ '=>'á‹ ','á‹¡'=>'á‹¡','á‹¢'=>'á‹¢','á‹£'=>'á‹£','ዤ'=>'ዤ','á‹¥'=>'á‹¥','ዦ'=>'ዦ','ዧ'=>'ዧ','የ'=>'የ','á‹©'=>'á‹©','ዪ'=>'ዪ','á‹«'=>'á‹«','ዬ'=>'ዬ','á‹­'=>'á‹­','á‹®'=>'á‹®','ዯ'=>'ዯ','á‹°'=>'á‹°','ዱ'=>'ዱ','ዲ'=>'ዲ','ዳ'=>'ዳ','á‹´'=>'á‹´','ድ'=>'ድ','ዶ'=>'ዶ','á‹·'=>'á‹·','ዸ'=>'ዸ','ዹ'=>'ዹ','ዺ'=>'ዺ','á‹»'=>'á‹»','ዼ'=>'ዼ','ዽ'=>'ዽ','ዾ'=>'ዾ','á‹¿'=>'á‹¿','ጀ'=>'ጀ','áŒ'=>'áŒ','ጂ'=>'ጂ','ጃ'=>'ጃ','ጄ'=>'ጄ','ጅ'=>'ጅ','ጆ'=>'ጆ','ጇ'=>'ጇ','ገ'=>'ገ','ጉ'=>'ጉ','ጊ'=>'ጊ','ጋ'=>'ጋ','ጌ'=>'ጌ','áŒ'=>'áŒ','ጎ'=>'ጎ','áŒ'=>'áŒ','áŒ'=>'áŒ','ጒ'=>'ጒ','ጓ'=>'ጓ','ጔ'=>'ጔ','ጕ'=>'ጕ','ጘ'=>'ጘ','ጙ'=>'ጙ','ጚ'=>'ጚ','ጛ'=>'ጛ','ጜ'=>'ጜ','áŒ'=>'áŒ','ጞ'=>'ጞ','ጟ'=>'ጟ','ጠ'=>'ጠ','ጡ'=>'ጡ','ጢ'=>'ጢ','ጣ'=>'ጣ','ጤ'=>'ጤ','ጥ'=>'ጥ','ጦ'=>'ጦ','ጧ'=>'ጧ','ጨ'=>'ጨ','ጩ'=>'ጩ','ጪ'=>'ጪ','ጫ'=>'ጫ','ጬ'=>'ጬ','ጭ'=>'ጭ','ጮ'=>'ጮ','ጯ'=>'ጯ','ጰ'=>'ጰ','ጱ'=>'ጱ','ጲ'=>'ጲ','ጳ'=>'ጳ','ጴ'=>'ጴ','ጵ'=>'ጵ','ጶ'=>'ጶ','ጷ'=>'ጷ','ጸ'=>'ጸ','ጹ'=>'ጹ','ጺ'=>'ጺ','ጻ'=>'ጻ','ጼ'=>'ጼ','ጽ'=>'ጽ','ጾ'=>'ጾ','ጿ'=>'ጿ','á€'=>'á€','á'=>'á','á‚'=>'á‚','áƒ'=>'áƒ','á„'=>'á„','á…'=>'á…','á†'=>'á†','á‡'=>'á‡','áˆ'=>'áˆ','á‰'=>'á‰','áŠ'=>'áŠ','á‹'=>'á‹','áŒ'=>'áŒ','á'=>'á','áŽ'=>'áŽ','á'=>'á','á'=>'á','á‘'=>'á‘','á’'=>'á’','á“'=>'á“','á”'=>'á”','á•'=>'á•','á–'=>'á–','á—'=>'á—','á˜'=>'á˜','á™'=>'á™','áš'=>'áš','áŸ'=>'áŸ','á©'=>'1','áª'=>'2','á«'=>'3','á¬'=>'4','á­'=>'5','á®'=>'6','á¯'=>'7','á°'=>'8','á±'=>'9','á²'=>'10','á³'=>'20','á´'=>'30','áµ'=>'40','á¶'=>'50','á·'=>'60','á¸'=>'70','á¹'=>'80','áº'=>'90','á»'=>'100','á¼'=>'10000','ᎀ'=>'ᎀ','áŽ'=>'áŽ','ᎂ'=>'ᎂ','ᎃ'=>'ᎃ','ᎄ'=>'ᎄ','ᎅ'=>'ᎅ','ᎆ'=>'ᎆ','ᎇ'=>'ᎇ','ᎈ'=>'ᎈ','ᎉ'=>'ᎉ','ᎊ'=>'ᎊ','ᎋ'=>'ᎋ','ᎌ'=>'ᎌ','áŽ'=>'áŽ','ᎎ'=>'ᎎ','áŽ'=>'áŽ','Ꭰ'=>'Ꭰ','Ꭱ'=>'Ꭱ','Ꭲ'=>'Ꭲ','Ꭳ'=>'Ꭳ','Ꭴ'=>'Ꭴ','Ꭵ'=>'Ꭵ','Ꭶ'=>'Ꭶ','Ꭷ'=>'Ꭷ','Ꭸ'=>'Ꭸ','Ꭹ'=>'Ꭹ','Ꭺ'=>'Ꭺ','Ꭻ'=>'Ꭻ','Ꭼ'=>'Ꭼ','Ꭽ'=>'Ꭽ','Ꭾ'=>'Ꭾ','Ꭿ'=>'Ꭿ','Ꮀ'=>'Ꮀ','Ꮁ'=>'Ꮁ','Ꮂ'=>'Ꮂ','Ꮃ'=>'Ꮃ','Ꮄ'=>'Ꮄ','Ꮅ'=>'Ꮅ','Ꮆ'=>'Ꮆ','Ꮇ'=>'Ꮇ','Ꮈ'=>'Ꮈ','Ꮉ'=>'Ꮉ','Ꮊ'=>'Ꮊ','Ꮋ'=>'Ꮋ','Ꮌ'=>'Ꮌ','Ꮍ'=>'Ꮍ','Ꮎ'=>'Ꮎ','Ꮏ'=>'Ꮏ','á€'=>'á€','á'=>'á','á‚'=>'á‚','áƒ'=>'áƒ','á„'=>'á„','á…'=>'á…','á†'=>'á†','á‡'=>'á‡','áˆ'=>'áˆ','á‰'=>'á‰','áŠ'=>'áŠ','á‹'=>'á‹','áŒ'=>'áŒ','á'=>'á','áŽ'=>'áŽ','á'=>'á','á'=>'á','á‘'=>'á‘','á’'=>'á’','á“'=>'á“','á”'=>'á”','á•'=>'á•','á–'=>'á–','á—'=>'á—','á˜'=>'á˜','á™'=>'á™','áš'=>'áš','á›'=>'á›','áœ'=>'áœ','á'=>'á','áž'=>'áž','áŸ'=>'áŸ','á '=>'á ','á¡'=>'á¡','á¢'=>'á¢','á£'=>'á£','á¤'=>'á¤','á¥'=>'á¥','á¦'=>'á¦','á§'=>'á§','á¨'=>'á¨','á©'=>'á©','áª'=>'áª','á«'=>'á«','á¬'=>'á¬','á­'=>'á­','á®'=>'á®','á¯'=>'á¯','á°'=>'á°','á±'=>'á±','á²'=>'á²','á³'=>'á³','á´'=>'á´','á'=>'á','á‚'=>'á‚','áƒ'=>'áƒ','á„'=>'á„','á…'=>'á…','á†'=>'á†','á‡'=>'á‡','áˆ'=>'áˆ','á‰'=>'á‰','áŠ'=>'áŠ','á‹'=>'á‹','áŒ'=>'áŒ','á'=>'á','áŽ'=>'áŽ','á'=>'á','á'=>'á','á‘'=>'á‘','á’'=>'á’','á“'=>'á“','á”'=>'á”','á•'=>'á•','á–'=>'á–','á—'=>'á—','á˜'=>'á˜','á™'=>'á™','áš'=>'áš','á›'=>'á›','áœ'=>'áœ','á'=>'á','áž'=>'áž','áŸ'=>'áŸ','á '=>'á ','á¡'=>'á¡','á¢'=>'á¢','á£'=>'á£','á¤'=>'á¤','á¥'=>'á¥','á¦'=>'á¦','á§'=>'á§','á¨'=>'á¨','á©'=>'á©','áª'=>'áª','á«'=>'á«','á¬'=>'á¬','á­'=>'á­','á®'=>'á®','á¯'=>'á¯','á°'=>'á°','á±'=>'á±','á²'=>'á²','á³'=>'á³','á´'=>'á´','áµ'=>'áµ','á¶'=>'á¶','á·'=>'á·','á¸'=>'á¸','á¹'=>'á¹','áº'=>'áº','á»'=>'á»','á¼'=>'á¼','á½'=>'á½','á¾'=>'á¾','á¿'=>'á¿','á‘€'=>'á‘€','á‘'=>'á‘','á‘‚'=>'á‘‚','ᑃ'=>'ᑃ','á‘„'=>'á‘„','á‘…'=>'á‘…','ᑆ'=>'ᑆ','ᑇ'=>'ᑇ','ᑈ'=>'ᑈ','ᑉ'=>'ᑉ','á‘Š'=>'á‘Š','á‘‹'=>'á‘‹','á‘Œ'=>'á‘Œ','á‘'=>'á‘','á‘Ž'=>'á‘Ž','á‘'=>'á‘','á‘'=>'á‘','á‘‘'=>'á‘‘','á‘’'=>'á‘’','á‘“'=>'á‘“','á‘”'=>'á‘”','á‘•'=>'á‘•','á‘–'=>'á‘–','á‘—'=>'á‘—','ᑘ'=>'ᑘ','á‘™'=>'á‘™','á‘š'=>'á‘š','á‘›'=>'á‘›','á‘œ'=>'á‘œ','á‘'=>'á‘','á‘ž'=>'á‘ž','á‘Ÿ'=>'á‘Ÿ','á‘ '=>'á‘ ','á‘¡'=>'á‘¡','á‘¢'=>'á‘¢','á‘£'=>'á‘£','ᑤ'=>'ᑤ','á‘¥'=>'á‘¥','ᑦ'=>'ᑦ','ᑧ'=>'ᑧ','ᑨ'=>'ᑨ','á‘©'=>'á‘©','ᑪ'=>'ᑪ','á‘«'=>'á‘«','ᑬ'=>'ᑬ','á‘­'=>'á‘­','á‘®'=>'á‘®','ᑯ'=>'ᑯ','á‘°'=>'á‘°','ᑱ'=>'ᑱ','ᑲ'=>'ᑲ','ᑳ'=>'ᑳ','á‘´'=>'á‘´','ᑵ'=>'ᑵ','ᑶ'=>'ᑶ','á‘·'=>'á‘·','ᑸ'=>'ᑸ','ᑹ'=>'ᑹ','ᑺ'=>'ᑺ','á‘»'=>'á‘»','ᑼ'=>'ᑼ','ᑽ'=>'ᑽ','ᑾ'=>'ᑾ','á‘¿'=>'á‘¿','á’€'=>'á’€','á’'=>'á’','á’‚'=>'á’‚','á’ƒ'=>'á’ƒ','á’„'=>'á’„','á’…'=>'á’…','á’†'=>'á’†','á’‡'=>'á’‡','á’ˆ'=>'á’ˆ','á’‰'=>'á’‰','á’Š'=>'á’Š','á’‹'=>'á’‹','á’Œ'=>'á’Œ','á’'=>'á’','á’Ž'=>'á’Ž','á’'=>'á’','á’'=>'á’','á’‘'=>'á’‘','á’’'=>'á’’','á’“'=>'á’“','á’”'=>'á’”','á’•'=>'á’•','á’–'=>'á’–','á’—'=>'á’—','á’˜'=>'á’˜','á’™'=>'á’™','á’š'=>'á’š','á’›'=>'á’›','á’œ'=>'á’œ','á’'=>'á’','á’ž'=>'á’ž','á’Ÿ'=>'á’Ÿ','á’ '=>'á’ ','á’¡'=>'á’¡','á’¢'=>'á’¢','á’£'=>'á’£','á’¤'=>'á’¤','á’¥'=>'á’¥','á’¦'=>'á’¦','á’§'=>'á’§','á’¨'=>'á’¨','á’©'=>'á’©','á’ª'=>'á’ª','á’«'=>'á’«','á’¬'=>'á’¬','á’­'=>'á’­','á’®'=>'á’®','á’¯'=>'á’¯','á’°'=>'á’°','á’±'=>'á’±','á’²'=>'á’²','á’³'=>'á’³','á’´'=>'á’´','á’µ'=>'á’µ','á’¶'=>'á’¶','á’·'=>'á’·','á’¸'=>'á’¸','á’¹'=>'á’¹','á’º'=>'á’º','á’»'=>'á’»','á’¼'=>'á’¼','á’½'=>'á’½','á’¾'=>'á’¾','á’¿'=>'á’¿','á“€'=>'á“€','á“'=>'á“','á“‚'=>'á“‚','ᓃ'=>'ᓃ','á“„'=>'á“„','á“…'=>'á“…','ᓆ'=>'ᓆ','ᓇ'=>'ᓇ','ᓈ'=>'ᓈ','ᓉ'=>'ᓉ','á“Š'=>'á“Š','á“‹'=>'á“‹','á“Œ'=>'á“Œ','á“'=>'á“','á“Ž'=>'á“Ž','á“'=>'á“','á“'=>'á“','á“‘'=>'á“‘','á“’'=>'á“’','á““'=>'á““','á“”'=>'á“”','á“•'=>'á“•','á“–'=>'á“–','á“—'=>'á“—','ᓘ'=>'ᓘ','á“™'=>'á“™','á“š'=>'á“š','á“›'=>'á“›','á“œ'=>'á“œ','á“'=>'á“','á“ž'=>'á“ž','á“Ÿ'=>'á“Ÿ','á“ '=>'á“ ','á“¡'=>'á“¡','á“¢'=>'á“¢','á“£'=>'á“£','ᓤ'=>'ᓤ','á“¥'=>'á“¥','ᓦ'=>'ᓦ','ᓧ'=>'ᓧ','ᓨ'=>'ᓨ','á“©'=>'á“©','ᓪ'=>'ᓪ','á“«'=>'á“«','ᓬ'=>'ᓬ','á“­'=>'á“­','á“®'=>'á“®','ᓯ'=>'ᓯ','á“°'=>'á“°','ᓱ'=>'ᓱ','ᓲ'=>'ᓲ','ᓳ'=>'ᓳ','á“´'=>'á“´','ᓵ'=>'ᓵ','ᓶ'=>'ᓶ','á“·'=>'á“·','ᓸ'=>'ᓸ','ᓹ'=>'ᓹ','ᓺ'=>'ᓺ','á“»'=>'á“»','ᓼ'=>'ᓼ','ᓽ'=>'ᓽ','ᓾ'=>'ᓾ','á“¿'=>'á“¿','ᔀ'=>'ᔀ','á”'=>'á”','ᔂ'=>'ᔂ','ᔃ'=>'ᔃ','ᔄ'=>'ᔄ','á”…'=>'á”…','ᔆ'=>'ᔆ','ᔇ'=>'ᔇ','ᔈ'=>'ᔈ','ᔉ'=>'ᔉ','ᔊ'=>'ᔊ','ᔋ'=>'ᔋ','ᔌ'=>'ᔌ','á”'=>'á”','ᔎ'=>'ᔎ','á”'=>'á”','á”'=>'á”','ᔑ'=>'ᔑ','á”’'=>'á”’','ᔓ'=>'ᔓ','á””'=>'á””','ᔕ'=>'ᔕ','á”–'=>'á”–','á”—'=>'á”—','ᔘ'=>'ᔘ','á”™'=>'á”™','ᔚ'=>'ᔚ','á”›'=>'á”›','ᔜ'=>'ᔜ','á”'=>'á”','ᔞ'=>'ᔞ','ᔟ'=>'ᔟ','á” '=>'á” ','ᔡ'=>'ᔡ','ᔢ'=>'ᔢ','ᔣ'=>'ᔣ','ᔤ'=>'ᔤ','ᔥ'=>'ᔥ','ᔦ'=>'ᔦ','ᔧ'=>'ᔧ','ᔨ'=>'ᔨ','ᔩ'=>'ᔩ','ᔪ'=>'ᔪ','ᔫ'=>'ᔫ','ᔬ'=>'ᔬ','á”­'=>'á”­','á”®'=>'á”®','ᔯ'=>'ᔯ','á”°'=>'á”°','á”±'=>'á”±','ᔲ'=>'ᔲ','ᔳ'=>'ᔳ','á”´'=>'á”´','ᔵ'=>'ᔵ','ᔶ'=>'ᔶ','á”·'=>'á”·','ᔸ'=>'ᔸ','ᔹ'=>'ᔹ','ᔺ'=>'ᔺ','á”»'=>'á”»','ᔼ'=>'ᔼ','ᔽ'=>'ᔽ','ᔾ'=>'ᔾ','ᔿ'=>'ᔿ','á•€'=>'á•€','á•'=>'á•','á•‚'=>'á•‚','ᕃ'=>'ᕃ','á•„'=>'á•„','á•…'=>'á•…','ᕆ'=>'ᕆ','ᕇ'=>'ᕇ','ᕈ'=>'ᕈ','ᕉ'=>'ᕉ','á•Š'=>'á•Š','á•‹'=>'á•‹','á•Œ'=>'á•Œ','á•'=>'á•','á•Ž'=>'á•Ž','á•'=>'á•','á•'=>'á•','á•‘'=>'á•‘','á•’'=>'á•’','á•“'=>'á•“','á•”'=>'á•”','á••'=>'á••','á•–'=>'á•–','á•—'=>'á•—','ᕘ'=>'ᕘ','á•™'=>'á•™','á•š'=>'á•š','á•›'=>'á•›','á•œ'=>'á•œ','á•'=>'á•','á•ž'=>'á•ž','á•Ÿ'=>'á•Ÿ','á• '=>'á• ','á•¡'=>'á•¡','á•¢'=>'á•¢','á•£'=>'á•£','ᕤ'=>'ᕤ','á•¥'=>'á•¥','ᕦ'=>'ᕦ','ᕧ'=>'ᕧ','ᕨ'=>'ᕨ','á•©'=>'á•©','ᕪ'=>'ᕪ','á•«'=>'á•«','ᕬ'=>'ᕬ','á•­'=>'á•­','á•®'=>'á•®','ᕯ'=>'ᕯ','á•°'=>'á•°','ᕱ'=>'ᕱ','ᕲ'=>'ᕲ','ᕳ'=>'ᕳ','á•´'=>'á•´','ᕵ'=>'ᕵ','ᕶ'=>'ᕶ','á•·'=>'á•·','ᕸ'=>'ᕸ','ᕹ'=>'ᕹ','ᕺ'=>'ᕺ','á•»'=>'á•»','ᕼ'=>'ᕼ','ᕽ'=>'ᕽ','ᕾ'=>'ᕾ','á•¿'=>'á•¿','á–€'=>'á–€','á–'=>'á–','á–‚'=>'á–‚','á–ƒ'=>'á–ƒ','á–„'=>'á–„','á–…'=>'á–…','á–†'=>'á–†','á–‡'=>'á–‡','á–ˆ'=>'á–ˆ','á–‰'=>'á–‰','á–Š'=>'á–Š','á–‹'=>'á–‹','á–Œ'=>'á–Œ','á–'=>'á–','á–Ž'=>'á–Ž','á–'=>'á–','á–'=>'á–','á–‘'=>'á–‘','á–’'=>'á–’','á–“'=>'á–“','á–”'=>'á–”','á–•'=>'á–•','á––'=>'á––','á–—'=>'á–—','á–˜'=>'á–˜','á–™'=>'á–™','á–š'=>'á–š','á–›'=>'á–›','á–œ'=>'á–œ','á–'=>'á–','á–ž'=>'á–ž','á–Ÿ'=>'á–Ÿ','á– '=>'á– ','á–¡'=>'á–¡','á–¢'=>'á–¢','á–£'=>'á–£','á–¤'=>'á–¤','á–¥'=>'á–¥','á–¦'=>'á–¦','á–§'=>'á–§','á–¨'=>'á–¨','á–©'=>'á–©','á–ª'=>'á–ª','á–«'=>'á–«','á–¬'=>'á–¬','á–­'=>'á–­','á–®'=>'á–®','á–¯'=>'á–¯','á–°'=>'á–°','á–±'=>'á–±','á–²'=>'á–²','á–³'=>'á–³','á–´'=>'á–´','á–µ'=>'á–µ','á–¶'=>'á–¶','á–·'=>'á–·','á–¸'=>'á–¸','á–¹'=>'á–¹','á–º'=>'á–º','á–»'=>'á–»','á–¼'=>'á–¼','á–½'=>'á–½','á–¾'=>'á–¾','á–¿'=>'á–¿','á—€'=>'á—€','á—'=>'á—','á—‚'=>'á—‚','á—ƒ'=>'á—ƒ','á—„'=>'á—„','á—…'=>'á—…','á—†'=>'á—†','á—‡'=>'á—‡','á—ˆ'=>'á—ˆ','á—‰'=>'á—‰','á—Š'=>'á—Š','á—‹'=>'á—‹','á—Œ'=>'á—Œ','á—'=>'á—','á—Ž'=>'á—Ž','á—'=>'á—','á—'=>'á—','á—‘'=>'á—‘','á—’'=>'á—’','á—“'=>'á—“','á—”'=>'á—”','á—•'=>'á—•','á—–'=>'á—–','á——'=>'á——','á—˜'=>'á—˜','á—™'=>'á—™','á—š'=>'á—š','á—›'=>'á—›','á—œ'=>'á—œ','á—'=>'á—','á—ž'=>'á—ž','á—Ÿ'=>'á—Ÿ','á— '=>'á— ','á—¡'=>'á—¡','á—¢'=>'á—¢','á—£'=>'á—£','á—¤'=>'á—¤','á—¥'=>'á—¥','á—¦'=>'á—¦','á—§'=>'á—§','á—¨'=>'á—¨','á—©'=>'á—©','á—ª'=>'á—ª','á—«'=>'á—«','á—¬'=>'á—¬','á—­'=>'á—­','á—®'=>'á—®','á—¯'=>'á—¯','á—°'=>'á—°','á—±'=>'á—±','á—²'=>'á—²','á—³'=>'á—³','á—´'=>'á—´','á—µ'=>'á—µ','á—¶'=>'á—¶','á—·'=>'á—·','á—¸'=>'á—¸','á—¹'=>'á—¹','á—º'=>'á—º','á—»'=>'á—»','á—¼'=>'á—¼','á—½'=>'á—½','á—¾'=>'á—¾','á—¿'=>'á—¿','ᘀ'=>'ᘀ','á˜'=>'á˜','ᘂ'=>'ᘂ','ᘃ'=>'ᘃ','ᘄ'=>'ᘄ','ᘅ'=>'ᘅ','ᘆ'=>'ᘆ','ᘇ'=>'ᘇ','ᘈ'=>'ᘈ','ᘉ'=>'ᘉ','ᘊ'=>'ᘊ','ᘋ'=>'ᘋ','ᘌ'=>'ᘌ','á˜'=>'á˜','ᘎ'=>'ᘎ','á˜'=>'á˜','á˜'=>'á˜','ᘑ'=>'ᘑ','ᘒ'=>'ᘒ','ᘓ'=>'ᘓ','ᘔ'=>'ᘔ','ᘕ'=>'ᘕ','ᘖ'=>'ᘖ','ᘗ'=>'ᘗ','ᘘ'=>'ᘘ','ᘙ'=>'ᘙ','ᘚ'=>'ᘚ','ᘛ'=>'ᘛ','ᘜ'=>'ᘜ','á˜'=>'á˜','ᘞ'=>'ᘞ','ᘟ'=>'ᘟ','ᘠ'=>'ᘠ','ᘡ'=>'ᘡ','ᘢ'=>'ᘢ','ᘣ'=>'ᘣ','ᘤ'=>'ᘤ','ᘥ'=>'ᘥ','ᘦ'=>'ᘦ','ᘧ'=>'ᘧ','ᘨ'=>'ᘨ','ᘩ'=>'ᘩ','ᘪ'=>'ᘪ','ᘫ'=>'ᘫ','ᘬ'=>'ᘬ','ᘭ'=>'ᘭ','ᘮ'=>'ᘮ','ᘯ'=>'ᘯ','ᘰ'=>'ᘰ','ᘱ'=>'ᘱ','ᘲ'=>'ᘲ','ᘳ'=>'ᘳ','ᘴ'=>'ᘴ','ᘵ'=>'ᘵ','ᘶ'=>'ᘶ','ᘷ'=>'ᘷ','ᘸ'=>'ᘸ','ᘹ'=>'ᘹ','ᘺ'=>'ᘺ','ᘻ'=>'ᘻ','ᘼ'=>'ᘼ','ᘽ'=>'ᘽ','ᘾ'=>'ᘾ','ᘿ'=>'ᘿ','ᙀ'=>'ᙀ','á™'=>'á™','ᙂ'=>'ᙂ','ᙃ'=>'ᙃ','ᙄ'=>'ᙄ','á™…'=>'á™…','ᙆ'=>'ᙆ','ᙇ'=>'ᙇ','ᙈ'=>'ᙈ','ᙉ'=>'ᙉ','ᙊ'=>'ᙊ','ᙋ'=>'ᙋ','ᙌ'=>'ᙌ','á™'=>'á™','ᙎ'=>'ᙎ','á™'=>'á™','á™'=>'á™','ᙑ'=>'ᙑ','á™’'=>'á™’','ᙓ'=>'ᙓ','á™”'=>'á™”','ᙕ'=>'ᙕ','á™–'=>'á™–','á™—'=>'á™—','ᙘ'=>'ᙘ','á™™'=>'á™™','ᙚ'=>'ᙚ','á™›'=>'á™›','ᙜ'=>'ᙜ','á™'=>'á™','ᙞ'=>'ᙞ','ᙟ'=>'ᙟ','á™ '=>'á™ ','ᙡ'=>'ᙡ','ᙢ'=>'ᙢ','ᙣ'=>'ᙣ','ᙤ'=>'ᙤ','ᙥ'=>'ᙥ','ᙦ'=>'ᙦ','ᙧ'=>'ᙧ','ᙨ'=>'ᙨ','ᙩ'=>'ᙩ','ᙪ'=>'ᙪ','ᙫ'=>'ᙫ','ᙬ'=>'ᙬ','ᙯ'=>'ᙯ','á™°'=>'á™°','á™±'=>'á™±','ᙲ'=>'ᙲ','ᙳ'=>'ᙳ','á™´'=>'á™´','ᙵ'=>'ᙵ','ᙶ'=>'ᙶ','áš'=>'áš','áš‚'=>'áš‚','ᚃ'=>'ᚃ','áš„'=>'áš„','áš…'=>'áš…','ᚆ'=>'ᚆ','ᚇ'=>'ᚇ','ᚈ'=>'ᚈ','ᚉ'=>'ᚉ','ᚊ'=>'ᚊ','áš‹'=>'áš‹','ᚌ'=>'ᚌ','áš'=>'áš','ᚎ'=>'ᚎ','áš'=>'áš','áš'=>'áš','áš‘'=>'áš‘','áš’'=>'áš’','áš“'=>'áš“','áš”'=>'áš”','áš•'=>'áš•','áš–'=>'áš–','áš—'=>'áš—','ᚘ'=>'ᚘ','áš™'=>'áš™','ášš'=>'ášš','áš '=>'áš ','áš¡'=>'áš¡','ᚢ'=>'ᚢ','ᚣ'=>'ᚣ','ᚤ'=>'ᚤ','ᚥ'=>'ᚥ','ᚦ'=>'ᚦ','ᚧ'=>'ᚧ','ᚨ'=>'ᚨ','áš©'=>'áš©','ᚪ'=>'ᚪ','áš«'=>'áš«','ᚬ'=>'ᚬ','áš­'=>'áš­','áš®'=>'áš®','ᚯ'=>'ᚯ','áš°'=>'áš°','áš±'=>'áš±','áš²'=>'áš²','áš³'=>'áš³','áš´'=>'áš´','ášµ'=>'ášµ','ᚶ'=>'ᚶ','áš·'=>'áš·','ᚸ'=>'ᚸ','áš¹'=>'áš¹','ᚺ'=>'ᚺ','áš»'=>'áš»','áš¼'=>'áš¼','áš½'=>'áš½','áš¾'=>'áš¾','áš¿'=>'áš¿','ᛀ'=>'ᛀ','á›'=>'á›','ᛂ'=>'ᛂ','ᛃ'=>'ᛃ','ᛄ'=>'ᛄ','á›…'=>'á›…','ᛆ'=>'ᛆ','ᛇ'=>'ᛇ','ᛈ'=>'ᛈ','ᛉ'=>'ᛉ','ᛊ'=>'ᛊ','ᛋ'=>'ᛋ','ᛌ'=>'ᛌ','á›'=>'á›','ᛎ'=>'ᛎ','á›'=>'á›','á›'=>'á›','ᛑ'=>'ᛑ','á›’'=>'á›’','ᛓ'=>'ᛓ','á›”'=>'á›”','ᛕ'=>'ᛕ','á›–'=>'á›–','á›—'=>'á›—','ᛘ'=>'ᛘ','á›™'=>'á›™','ᛚ'=>'ᛚ','á››'=>'á››','ᛜ'=>'ᛜ','á›'=>'á›','ᛞ'=>'ᛞ','ᛟ'=>'ᛟ','á› '=>'á› ','ᛡ'=>'ᛡ','ᛢ'=>'ᛢ','ᛣ'=>'ᛣ','ᛤ'=>'ᛤ','ᛥ'=>'ᛥ','ᛦ'=>'ᛦ','ᛧ'=>'ᛧ','ᛨ'=>'ᛨ','ᛩ'=>'ᛩ','ᛪ'=>'ᛪ','á›®'=>'17','ᛯ'=>'18','á›°'=>'19','ᜀ'=>'ᜀ','áœ'=>'áœ','ᜂ'=>'ᜂ','ᜃ'=>'ᜃ','ᜄ'=>'ᜄ','ᜅ'=>'ᜅ','ᜆ'=>'ᜆ','ᜇ'=>'ᜇ','ᜈ'=>'ᜈ','ᜉ'=>'ᜉ','ᜊ'=>'ᜊ','ᜋ'=>'ᜋ','ᜌ'=>'ᜌ','ᜎ'=>'ᜎ','áœ'=>'áœ','áœ'=>'áœ','ᜑ'=>'ᜑ','ᜒ'=>'ᜒ','ᜓ'=>'ᜓ','᜔'=>'᜔','ᜠ'=>'ᜠ','ᜡ'=>'ᜡ','ᜢ'=>'ᜢ','ᜣ'=>'ᜣ','ᜤ'=>'ᜤ','ᜥ'=>'ᜥ','ᜦ'=>'ᜦ','ᜧ'=>'ᜧ','ᜨ'=>'ᜨ','ᜩ'=>'ᜩ','ᜪ'=>'ᜪ','ᜫ'=>'ᜫ','ᜬ'=>'ᜬ','ᜭ'=>'ᜭ','ᜮ'=>'ᜮ','ᜯ'=>'ᜯ','ᜰ'=>'ᜰ','ᜱ'=>'ᜱ','ᜲ'=>'ᜲ','ᜳ'=>'ᜳ','᜴'=>'᜴','á€'=>'á€','á'=>'á','á‚'=>'á‚','áƒ'=>'áƒ','á„'=>'á„','á…'=>'á…','á†'=>'á†','á‡'=>'á‡','áˆ'=>'áˆ','á‰'=>'á‰','áŠ'=>'áŠ','á‹'=>'á‹','áŒ'=>'áŒ','á'=>'á','áŽ'=>'áŽ','á'=>'á','á'=>'á','á‘'=>'á‘','á’'=>'á’','á“'=>'á“','á '=>'á ','á¡'=>'á¡','á¢'=>'á¢','á£'=>'á£','á¤'=>'á¤','á¥'=>'á¥','á¦'=>'á¦','á§'=>'á§','á¨'=>'á¨','á©'=>'á©','áª'=>'áª','á«'=>'á«','á¬'=>'á¬','á®'=>'á®','á¯'=>'á¯','á°'=>'á°','á²'=>'á²','á³'=>'á³','ក'=>'ក','áž'=>'áž','áž‚'=>'áž‚','ឃ'=>'ឃ','áž„'=>'áž„','áž…'=>'áž…','ឆ'=>'ឆ','ជ'=>'ជ','ឈ'=>'ឈ','ញ'=>'ញ','ដ'=>'ដ','áž‹'=>'áž‹','ឌ'=>'ឌ','áž'=>'áž','ណ'=>'ណ','áž'=>'áž','áž'=>'áž','áž‘'=>'áž‘','áž’'=>'áž’','áž“'=>'áž“','áž”'=>'áž”','áž•'=>'áž•','áž–'=>'áž–','áž—'=>'áž—','ម'=>'ម','áž™'=>'áž™','ážš'=>'ážš','áž›'=>'áž›','ážœ'=>'ážœ','áž'=>'áž','ážž'=>'ážž','ស'=>'ស','áž '=>'áž ','áž¡'=>'áž¡','អ'=>'អ','ឣ'=>'ឣ','ឤ'=>'ឤ','ឥ'=>'ឥ','ឦ'=>'ឦ','ឧ'=>'ឧ','ឨ'=>'ឨ','áž©'=>'áž©','ឪ'=>'ឪ','áž«'=>'áž«','ឬ'=>'ឬ','áž­'=>'áž­','áž®'=>'áž®','ឯ'=>'ឯ','áž°'=>'áž°','áž±'=>'áž±','áž²'=>'áž²','áž³'=>'áž³','ា'=>'ា','áž·'=>'áž·','ី'=>'ី','áž¹'=>'áž¹','ឺ'=>'ឺ','áž»'=>'áž»','áž¼'=>'áž¼','áž½'=>'áž½','áž¾'=>'áž¾','áž¿'=>'áž¿','ៀ'=>'ៀ','áŸ'=>'áŸ','ែ'=>'ែ','ៃ'=>'ៃ','ោ'=>'ោ','ៅ'=>'ៅ','ំ'=>'ំ','ះ'=>'ះ','ៈ'=>'ៈ','៉'=>'៉','៊'=>'៊','់'=>'់','៌'=>'៌','áŸ'=>'áŸ','៎'=>'៎','áŸ'=>'áŸ','áŸ'=>'áŸ','៑'=>'៑','្'=>'្','៓'=>'៓','ៗ'=>'ៗ','ៜ'=>'ៜ','áŸ'=>'áŸ','០'=>'0','១'=>'1','២'=>'2','៣'=>'3','៤'=>'4','៥'=>'5','៦'=>'6','៧'=>'7','៨'=>'8','៩'=>'9','៰'=>'0','៱'=>'1','៲'=>'2','៳'=>'3','៴'=>'4','៵'=>'5','៶'=>'6','៷'=>'7','៸'=>'8','៹'=>'9'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_20.php b/sources/phpBB/includes/utf/data/search_indexer_20.php new file mode 100644 index 0000000..0d2dfa6 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_20.php @@ -0,0 +1 @@ +'ꀀ','ê€'=>'ê€','ꀂ'=>'ꀂ','ꀃ'=>'ꀃ','ꀄ'=>'ꀄ','ꀅ'=>'ꀅ','ꀆ'=>'ꀆ','ꀇ'=>'ꀇ','ꀈ'=>'ꀈ','ꀉ'=>'ꀉ','ꀊ'=>'ꀊ','ꀋ'=>'ꀋ','ꀌ'=>'ꀌ','ê€'=>'ê€','ꀎ'=>'ꀎ','ê€'=>'ê€','ê€'=>'ê€','ꀑ'=>'ꀑ','ꀒ'=>'ꀒ','ꀓ'=>'ꀓ','ꀔ'=>'ꀔ','ꀕ'=>'ꀕ','ꀖ'=>'ꀖ','ꀗ'=>'ꀗ','ꀘ'=>'ꀘ','ꀙ'=>'ꀙ','ꀚ'=>'ꀚ','ꀛ'=>'ꀛ','ꀜ'=>'ꀜ','ê€'=>'ê€','ꀞ'=>'ꀞ','ꀟ'=>'ꀟ','ꀠ'=>'ꀠ','ꀡ'=>'ꀡ','ꀢ'=>'ꀢ','ꀣ'=>'ꀣ','ꀤ'=>'ꀤ','ꀥ'=>'ꀥ','ꀦ'=>'ꀦ','ꀧ'=>'ꀧ','ꀨ'=>'ꀨ','ꀩ'=>'ꀩ','ꀪ'=>'ꀪ','ꀫ'=>'ꀫ','ꀬ'=>'ꀬ','ꀭ'=>'ꀭ','ꀮ'=>'ꀮ','ꀯ'=>'ꀯ','ꀰ'=>'ꀰ','ꀱ'=>'ꀱ','ꀲ'=>'ꀲ','ꀳ'=>'ꀳ','ꀴ'=>'ꀴ','ꀵ'=>'ꀵ','ꀶ'=>'ꀶ','ꀷ'=>'ꀷ','ꀸ'=>'ꀸ','ꀹ'=>'ꀹ','ꀺ'=>'ꀺ','ꀻ'=>'ꀻ','ꀼ'=>'ꀼ','ꀽ'=>'ꀽ','ꀾ'=>'ꀾ','ꀿ'=>'ꀿ','ê€'=>'ê€','ê'=>'ê','ê‚'=>'ê‚','êƒ'=>'êƒ','ê„'=>'ê„','ê…'=>'ê…','ê†'=>'ê†','ê‡'=>'ê‡','êˆ'=>'êˆ','ê‰'=>'ê‰','êŠ'=>'êŠ','ê‹'=>'ê‹','êŒ'=>'êŒ','ê'=>'ê','êŽ'=>'êŽ','ê'=>'ê','ê'=>'ê','ê‘'=>'ê‘','ê’'=>'ê’','ê“'=>'ê“','ê”'=>'ê”','ê•'=>'ê•','ê–'=>'ê–','ê—'=>'ê—','ê˜'=>'ê˜','ê™'=>'ê™','êš'=>'êš','ê›'=>'ê›','êœ'=>'êœ','ê'=>'ê','êž'=>'êž','êŸ'=>'êŸ','ê '=>'ê ','ê¡'=>'ê¡','ê¢'=>'ê¢','ê£'=>'ê£','ê¤'=>'ê¤','ê¥'=>'ê¥','ê¦'=>'ê¦','ê§'=>'ê§','ê¨'=>'ê¨','ê©'=>'ê©','êª'=>'êª','ê«'=>'ê«','ê¬'=>'ê¬','ê­'=>'ê­','ê®'=>'ê®','ê¯'=>'ê¯','ê°'=>'ê°','ê±'=>'ê±','ê²'=>'ê²','ê³'=>'ê³','ê´'=>'ê´','êµ'=>'êµ','ê¶'=>'ê¶','ê·'=>'ê·','ê¸'=>'ê¸','ê¹'=>'ê¹','êº'=>'êº','ê»'=>'ê»','ê¼'=>'ê¼','ê½'=>'ê½','ê¾'=>'ê¾','ê¿'=>'ê¿','ê‚€'=>'ê‚€','ê‚'=>'ê‚','ê‚‚'=>'ê‚‚','ꂃ'=>'ꂃ','ê‚„'=>'ê‚„','ê‚…'=>'ê‚…','ꂆ'=>'ꂆ','ꂇ'=>'ꂇ','ꂈ'=>'ꂈ','ꂉ'=>'ꂉ','ê‚Š'=>'ê‚Š','ê‚‹'=>'ê‚‹','ê‚Œ'=>'ê‚Œ','ê‚'=>'ê‚','ê‚Ž'=>'ê‚Ž','ê‚'=>'ê‚','ê‚'=>'ê‚','ê‚‘'=>'ê‚‘','ê‚’'=>'ê‚’','ê‚“'=>'ê‚“','ê‚”'=>'ê‚”','ê‚•'=>'ê‚•','ê‚–'=>'ê‚–','ê‚—'=>'ê‚—','ꂘ'=>'ꂘ','ê‚™'=>'ê‚™','ê‚š'=>'ê‚š','ê‚›'=>'ê‚›','ê‚œ'=>'ê‚œ','ê‚'=>'ê‚','ê‚ž'=>'ê‚ž','ê‚Ÿ'=>'ê‚Ÿ','ê‚ '=>'ê‚ ','ê‚¡'=>'ê‚¡','ê‚¢'=>'ê‚¢','ê‚£'=>'ê‚£','ꂤ'=>'ꂤ','ê‚¥'=>'ê‚¥','ꂦ'=>'ꂦ','ꂧ'=>'ꂧ','ꂨ'=>'ꂨ','ê‚©'=>'ê‚©','ꂪ'=>'ꂪ','ê‚«'=>'ê‚«','ꂬ'=>'ꂬ','ê‚­'=>'ê‚­','ê‚®'=>'ê‚®','ꂯ'=>'ꂯ','ê‚°'=>'ê‚°','ꂱ'=>'ꂱ','ꂲ'=>'ꂲ','ꂳ'=>'ꂳ','ê‚´'=>'ê‚´','ꂵ'=>'ꂵ','ꂶ'=>'ꂶ','ê‚·'=>'ê‚·','ꂸ'=>'ꂸ','ꂹ'=>'ꂹ','ꂺ'=>'ꂺ','ê‚»'=>'ê‚»','ꂼ'=>'ꂼ','ꂽ'=>'ꂽ','ꂾ'=>'ꂾ','ê‚¿'=>'ê‚¿','ꃀ'=>'ꃀ','êƒ'=>'êƒ','ꃂ'=>'ꃂ','ꃃ'=>'ꃃ','ꃄ'=>'ꃄ','ꃅ'=>'ꃅ','ꃆ'=>'ꃆ','ꃇ'=>'ꃇ','ꃈ'=>'ꃈ','ꃉ'=>'ꃉ','ꃊ'=>'ꃊ','ꃋ'=>'ꃋ','ꃌ'=>'ꃌ','êƒ'=>'êƒ','ꃎ'=>'ꃎ','êƒ'=>'êƒ','êƒ'=>'êƒ','ꃑ'=>'ꃑ','ꃒ'=>'ꃒ','ꃓ'=>'ꃓ','ꃔ'=>'ꃔ','ꃕ'=>'ꃕ','ꃖ'=>'ꃖ','ꃗ'=>'ꃗ','ꃘ'=>'ꃘ','ꃙ'=>'ꃙ','ꃚ'=>'ꃚ','ꃛ'=>'ꃛ','ꃜ'=>'ꃜ','êƒ'=>'êƒ','ꃞ'=>'ꃞ','ꃟ'=>'ꃟ','ꃠ'=>'ꃠ','ꃡ'=>'ꃡ','ꃢ'=>'ꃢ','ꃣ'=>'ꃣ','ꃤ'=>'ꃤ','ꃥ'=>'ꃥ','ꃦ'=>'ꃦ','ꃧ'=>'ꃧ','ꃨ'=>'ꃨ','ꃩ'=>'ꃩ','ꃪ'=>'ꃪ','ꃫ'=>'ꃫ','ꃬ'=>'ꃬ','ꃭ'=>'ꃭ','ꃮ'=>'ꃮ','ꃯ'=>'ꃯ','ꃰ'=>'ꃰ','ꃱ'=>'ꃱ','ꃲ'=>'ꃲ','ꃳ'=>'ꃳ','ꃴ'=>'ꃴ','ꃵ'=>'ꃵ','ꃶ'=>'ꃶ','ꃷ'=>'ꃷ','ꃸ'=>'ꃸ','ꃹ'=>'ꃹ','ꃺ'=>'ꃺ','ꃻ'=>'ꃻ','ꃼ'=>'ꃼ','ꃽ'=>'ꃽ','ꃾ'=>'ꃾ','ꃿ'=>'ꃿ','ê„€'=>'ê„€','ê„'=>'ê„','ê„‚'=>'ê„‚','ꄃ'=>'ꄃ','ê„„'=>'ê„„','ê„…'=>'ê„…','ꄆ'=>'ꄆ','ꄇ'=>'ꄇ','ꄈ'=>'ꄈ','ꄉ'=>'ꄉ','ê„Š'=>'ê„Š','ê„‹'=>'ê„‹','ê„Œ'=>'ê„Œ','ê„'=>'ê„','ê„Ž'=>'ê„Ž','ê„'=>'ê„','ê„'=>'ê„','ê„‘'=>'ê„‘','ê„’'=>'ê„’','ê„“'=>'ê„“','ê„”'=>'ê„”','ê„•'=>'ê„•','ê„–'=>'ê„–','ê„—'=>'ê„—','ꄘ'=>'ꄘ','ê„™'=>'ê„™','ê„š'=>'ê„š','ê„›'=>'ê„›','ê„œ'=>'ê„œ','ê„'=>'ê„','ê„ž'=>'ê„ž','ê„Ÿ'=>'ê„Ÿ','ê„ '=>'ê„ ','ê„¡'=>'ê„¡','ê„¢'=>'ê„¢','ê„£'=>'ê„£','ꄤ'=>'ꄤ','ê„¥'=>'ê„¥','ꄦ'=>'ꄦ','ꄧ'=>'ꄧ','ꄨ'=>'ꄨ','ê„©'=>'ê„©','ꄪ'=>'ꄪ','ê„«'=>'ê„«','ꄬ'=>'ꄬ','ê„­'=>'ê„­','ê„®'=>'ê„®','ꄯ'=>'ꄯ','ê„°'=>'ê„°','ꄱ'=>'ꄱ','ꄲ'=>'ꄲ','ꄳ'=>'ꄳ','ê„´'=>'ê„´','ꄵ'=>'ꄵ','ꄶ'=>'ꄶ','ê„·'=>'ê„·','ꄸ'=>'ꄸ','ꄹ'=>'ꄹ','ꄺ'=>'ꄺ','ê„»'=>'ê„»','ꄼ'=>'ꄼ','ꄽ'=>'ꄽ','ꄾ'=>'ꄾ','ê„¿'=>'ê„¿','ê…€'=>'ê…€','ê…'=>'ê…','ê…‚'=>'ê…‚','ê…ƒ'=>'ê…ƒ','ê…„'=>'ê…„','ê……'=>'ê……','ê…†'=>'ê…†','ê…‡'=>'ê…‡','ê…ˆ'=>'ê…ˆ','ê…‰'=>'ê…‰','ê…Š'=>'ê…Š','ê…‹'=>'ê…‹','ê…Œ'=>'ê…Œ','ê…'=>'ê…','ê…Ž'=>'ê…Ž','ê…'=>'ê…','ê…'=>'ê…','ê…‘'=>'ê…‘','ê…’'=>'ê…’','ê…“'=>'ê…“','ê…”'=>'ê…”','ê…•'=>'ê…•','ê…–'=>'ê…–','ê…—'=>'ê…—','ê…˜'=>'ê…˜','ê…™'=>'ê…™','ê…š'=>'ê…š','ê…›'=>'ê…›','ê…œ'=>'ê…œ','ê…'=>'ê…','ê…ž'=>'ê…ž','ê…Ÿ'=>'ê…Ÿ','ê… '=>'ê… ','ê…¡'=>'ê…¡','ê…¢'=>'ê…¢','ê…£'=>'ê…£','ê…¤'=>'ê…¤','ê…¥'=>'ê…¥','ê…¦'=>'ê…¦','ê…§'=>'ê…§','ê…¨'=>'ê…¨','ê…©'=>'ê…©','ê…ª'=>'ê…ª','ê…«'=>'ê…«','ê…¬'=>'ê…¬','ê…­'=>'ê…­','ê…®'=>'ê…®','ê…¯'=>'ê…¯','ê…°'=>'ê…°','ê…±'=>'ê…±','ê…²'=>'ê…²','ê…³'=>'ê…³','ê…´'=>'ê…´','ê…µ'=>'ê…µ','ê…¶'=>'ê…¶','ê…·'=>'ê…·','ê…¸'=>'ê…¸','ê…¹'=>'ê…¹','ê…º'=>'ê…º','ê…»'=>'ê…»','ê…¼'=>'ê…¼','ê…½'=>'ê…½','ê…¾'=>'ê…¾','ê…¿'=>'ê…¿','ꆀ'=>'ꆀ','ê†'=>'ê†','ꆂ'=>'ꆂ','ꆃ'=>'ꆃ','ꆄ'=>'ꆄ','ꆅ'=>'ꆅ','ꆆ'=>'ꆆ','ꆇ'=>'ꆇ','ꆈ'=>'ꆈ','ꆉ'=>'ꆉ','ꆊ'=>'ꆊ','ꆋ'=>'ꆋ','ꆌ'=>'ꆌ','ê†'=>'ê†','ꆎ'=>'ꆎ','ê†'=>'ê†','ê†'=>'ê†','ꆑ'=>'ꆑ','ꆒ'=>'ꆒ','ꆓ'=>'ꆓ','ꆔ'=>'ꆔ','ꆕ'=>'ꆕ','ꆖ'=>'ꆖ','ꆗ'=>'ꆗ','ꆘ'=>'ꆘ','ꆙ'=>'ꆙ','ꆚ'=>'ꆚ','ꆛ'=>'ꆛ','ꆜ'=>'ꆜ','ê†'=>'ê†','ꆞ'=>'ꆞ','ꆟ'=>'ꆟ','ꆠ'=>'ꆠ','ꆡ'=>'ꆡ','ꆢ'=>'ꆢ','ꆣ'=>'ꆣ','ꆤ'=>'ꆤ','ꆥ'=>'ꆥ','ꆦ'=>'ꆦ','ꆧ'=>'ꆧ','ꆨ'=>'ꆨ','ꆩ'=>'ꆩ','ꆪ'=>'ꆪ','ꆫ'=>'ꆫ','ꆬ'=>'ꆬ','ꆭ'=>'ꆭ','ꆮ'=>'ꆮ','ꆯ'=>'ꆯ','ꆰ'=>'ꆰ','ꆱ'=>'ꆱ','ꆲ'=>'ꆲ','ꆳ'=>'ꆳ','ꆴ'=>'ꆴ','ꆵ'=>'ꆵ','ꆶ'=>'ꆶ','ꆷ'=>'ꆷ','ꆸ'=>'ꆸ','ꆹ'=>'ꆹ','ꆺ'=>'ꆺ','ꆻ'=>'ꆻ','ꆼ'=>'ꆼ','ꆽ'=>'ꆽ','ꆾ'=>'ꆾ','ꆿ'=>'ꆿ','ꇀ'=>'ꇀ','ê‡'=>'ê‡','ꇂ'=>'ꇂ','ꇃ'=>'ꇃ','ꇄ'=>'ꇄ','ꇅ'=>'ꇅ','ꇆ'=>'ꇆ','ꇇ'=>'ꇇ','ꇈ'=>'ꇈ','ꇉ'=>'ꇉ','ꇊ'=>'ꇊ','ꇋ'=>'ꇋ','ꇌ'=>'ꇌ','ê‡'=>'ê‡','ꇎ'=>'ꇎ','ê‡'=>'ê‡','ê‡'=>'ê‡','ꇑ'=>'ꇑ','ꇒ'=>'ꇒ','ꇓ'=>'ꇓ','ꇔ'=>'ꇔ','ꇕ'=>'ꇕ','ꇖ'=>'ꇖ','ꇗ'=>'ꇗ','ꇘ'=>'ꇘ','ꇙ'=>'ꇙ','ꇚ'=>'ꇚ','ꇛ'=>'ꇛ','ꇜ'=>'ꇜ','ê‡'=>'ê‡','ꇞ'=>'ꇞ','ꇟ'=>'ꇟ','ꇠ'=>'ꇠ','ꇡ'=>'ꇡ','ꇢ'=>'ꇢ','ꇣ'=>'ꇣ','ꇤ'=>'ꇤ','ꇥ'=>'ꇥ','ꇦ'=>'ꇦ','ꇧ'=>'ꇧ','ꇨ'=>'ꇨ','ꇩ'=>'ꇩ','ꇪ'=>'ꇪ','ꇫ'=>'ꇫ','ꇬ'=>'ꇬ','ꇭ'=>'ꇭ','ꇮ'=>'ꇮ','ꇯ'=>'ꇯ','ꇰ'=>'ꇰ','ꇱ'=>'ꇱ','ꇲ'=>'ꇲ','ꇳ'=>'ꇳ','ꇴ'=>'ꇴ','ꇵ'=>'ꇵ','ꇶ'=>'ꇶ','ꇷ'=>'ꇷ','ꇸ'=>'ꇸ','ꇹ'=>'ꇹ','ꇺ'=>'ꇺ','ꇻ'=>'ꇻ','ꇼ'=>'ꇼ','ꇽ'=>'ꇽ','ꇾ'=>'ꇾ','ꇿ'=>'ꇿ','ꈀ'=>'ꈀ','êˆ'=>'êˆ','ꈂ'=>'ꈂ','ꈃ'=>'ꈃ','ꈄ'=>'ꈄ','ꈅ'=>'ꈅ','ꈆ'=>'ꈆ','ꈇ'=>'ꈇ','ꈈ'=>'ꈈ','ꈉ'=>'ꈉ','ꈊ'=>'ꈊ','ꈋ'=>'ꈋ','ꈌ'=>'ꈌ','êˆ'=>'êˆ','ꈎ'=>'ꈎ','êˆ'=>'êˆ','êˆ'=>'êˆ','ꈑ'=>'ꈑ','ꈒ'=>'ꈒ','ꈓ'=>'ꈓ','ꈔ'=>'ꈔ','ꈕ'=>'ꈕ','ꈖ'=>'ꈖ','ꈗ'=>'ꈗ','ꈘ'=>'ꈘ','ꈙ'=>'ꈙ','ꈚ'=>'ꈚ','ꈛ'=>'ꈛ','ꈜ'=>'ꈜ','êˆ'=>'êˆ','ꈞ'=>'ꈞ','ꈟ'=>'ꈟ','ꈠ'=>'ꈠ','ꈡ'=>'ꈡ','ꈢ'=>'ꈢ','ꈣ'=>'ꈣ','ꈤ'=>'ꈤ','ꈥ'=>'ꈥ','ꈦ'=>'ꈦ','ꈧ'=>'ꈧ','ꈨ'=>'ꈨ','ꈩ'=>'ꈩ','ꈪ'=>'ꈪ','ꈫ'=>'ꈫ','ꈬ'=>'ꈬ','ꈭ'=>'ꈭ','ꈮ'=>'ꈮ','ꈯ'=>'ꈯ','ꈰ'=>'ꈰ','ꈱ'=>'ꈱ','ꈲ'=>'ꈲ','ꈳ'=>'ꈳ','ꈴ'=>'ꈴ','ꈵ'=>'ꈵ','ꈶ'=>'ꈶ','ꈷ'=>'ꈷ','ꈸ'=>'ꈸ','ꈹ'=>'ꈹ','ꈺ'=>'ꈺ','ꈻ'=>'ꈻ','ꈼ'=>'ꈼ','ꈽ'=>'ꈽ','ꈾ'=>'ꈾ','ꈿ'=>'ꈿ','ꉀ'=>'ꉀ','ê‰'=>'ê‰','ꉂ'=>'ꉂ','ꉃ'=>'ꉃ','ꉄ'=>'ꉄ','ꉅ'=>'ꉅ','ꉆ'=>'ꉆ','ꉇ'=>'ꉇ','ꉈ'=>'ꉈ','ꉉ'=>'ꉉ','ꉊ'=>'ꉊ','ꉋ'=>'ꉋ','ꉌ'=>'ꉌ','ê‰'=>'ê‰','ꉎ'=>'ꉎ','ê‰'=>'ê‰','ê‰'=>'ê‰','ꉑ'=>'ꉑ','ꉒ'=>'ꉒ','ꉓ'=>'ꉓ','ꉔ'=>'ꉔ','ꉕ'=>'ꉕ','ꉖ'=>'ꉖ','ꉗ'=>'ꉗ','ꉘ'=>'ꉘ','ꉙ'=>'ꉙ','ꉚ'=>'ꉚ','ꉛ'=>'ꉛ','ꉜ'=>'ꉜ','ê‰'=>'ê‰','ꉞ'=>'ꉞ','ꉟ'=>'ꉟ','ꉠ'=>'ꉠ','ꉡ'=>'ꉡ','ꉢ'=>'ꉢ','ꉣ'=>'ꉣ','ꉤ'=>'ꉤ','ꉥ'=>'ꉥ','ꉦ'=>'ꉦ','ꉧ'=>'ꉧ','ꉨ'=>'ꉨ','ꉩ'=>'ꉩ','ꉪ'=>'ꉪ','ꉫ'=>'ꉫ','ꉬ'=>'ꉬ','ꉭ'=>'ꉭ','ꉮ'=>'ꉮ','ꉯ'=>'ꉯ','ꉰ'=>'ꉰ','ꉱ'=>'ꉱ','ꉲ'=>'ꉲ','ꉳ'=>'ꉳ','ꉴ'=>'ꉴ','ꉵ'=>'ꉵ','ꉶ'=>'ꉶ','ꉷ'=>'ꉷ','ꉸ'=>'ꉸ','ꉹ'=>'ꉹ','ꉺ'=>'ꉺ','ꉻ'=>'ꉻ','ꉼ'=>'ꉼ','ꉽ'=>'ꉽ','ꉾ'=>'ꉾ','ꉿ'=>'ꉿ','ꊀ'=>'ꊀ','êŠ'=>'êŠ','ꊂ'=>'ꊂ','ꊃ'=>'ꊃ','ꊄ'=>'ꊄ','ꊅ'=>'ꊅ','ꊆ'=>'ꊆ','ꊇ'=>'ꊇ','ꊈ'=>'ꊈ','ꊉ'=>'ꊉ','ꊊ'=>'ꊊ','ꊋ'=>'ꊋ','ꊌ'=>'ꊌ','êŠ'=>'êŠ','ꊎ'=>'ꊎ','êŠ'=>'êŠ','êŠ'=>'êŠ','ꊑ'=>'ꊑ','ꊒ'=>'ꊒ','ꊓ'=>'ꊓ','ꊔ'=>'ꊔ','ꊕ'=>'ꊕ','ꊖ'=>'ꊖ','ꊗ'=>'ꊗ','ꊘ'=>'ꊘ','ꊙ'=>'ꊙ','ꊚ'=>'ꊚ','ꊛ'=>'ꊛ','ꊜ'=>'ꊜ','êŠ'=>'êŠ','ꊞ'=>'ꊞ','ꊟ'=>'ꊟ','ꊠ'=>'ꊠ','ꊡ'=>'ꊡ','ꊢ'=>'ꊢ','ꊣ'=>'ꊣ','ꊤ'=>'ꊤ','ꊥ'=>'ꊥ','ꊦ'=>'ꊦ','ꊧ'=>'ꊧ','ꊨ'=>'ꊨ','ꊩ'=>'ꊩ','ꊪ'=>'ꊪ','ꊫ'=>'ꊫ','ꊬ'=>'ꊬ','ꊭ'=>'ꊭ','ꊮ'=>'ꊮ','ꊯ'=>'ꊯ','ꊰ'=>'ꊰ','ꊱ'=>'ꊱ','ꊲ'=>'ꊲ','ꊳ'=>'ꊳ','ꊴ'=>'ꊴ','ꊵ'=>'ꊵ','ꊶ'=>'ꊶ','ꊷ'=>'ꊷ','ꊸ'=>'ꊸ','ꊹ'=>'ꊹ','ꊺ'=>'ꊺ','ꊻ'=>'ꊻ','ꊼ'=>'ꊼ','ꊽ'=>'ꊽ','ꊾ'=>'ꊾ','ꊿ'=>'ꊿ','ê‹€'=>'ê‹€','ê‹'=>'ê‹','ê‹‚'=>'ê‹‚','ꋃ'=>'ꋃ','ê‹„'=>'ê‹„','ê‹…'=>'ê‹…','ꋆ'=>'ꋆ','ꋇ'=>'ꋇ','ꋈ'=>'ꋈ','ꋉ'=>'ꋉ','ê‹Š'=>'ê‹Š','ê‹‹'=>'ê‹‹','ê‹Œ'=>'ê‹Œ','ê‹'=>'ê‹','ê‹Ž'=>'ê‹Ž','ê‹'=>'ê‹','ê‹'=>'ê‹','ê‹‘'=>'ê‹‘','ê‹’'=>'ê‹’','ê‹“'=>'ê‹“','ê‹”'=>'ê‹”','ê‹•'=>'ê‹•','ê‹–'=>'ê‹–','ê‹—'=>'ê‹—','ꋘ'=>'ꋘ','ê‹™'=>'ê‹™','ê‹š'=>'ê‹š','ê‹›'=>'ê‹›','ê‹œ'=>'ê‹œ','ê‹'=>'ê‹','ê‹ž'=>'ê‹ž','ê‹Ÿ'=>'ê‹Ÿ','ê‹ '=>'ê‹ ','ê‹¡'=>'ê‹¡','ê‹¢'=>'ê‹¢','ê‹£'=>'ê‹£','ꋤ'=>'ꋤ','ê‹¥'=>'ê‹¥','ꋦ'=>'ꋦ','ꋧ'=>'ꋧ','ꋨ'=>'ꋨ','ê‹©'=>'ê‹©','ꋪ'=>'ꋪ','ê‹«'=>'ê‹«','ꋬ'=>'ꋬ','ê‹­'=>'ê‹­','ê‹®'=>'ê‹®','ꋯ'=>'ꋯ','ê‹°'=>'ê‹°','ꋱ'=>'ꋱ','ꋲ'=>'ꋲ','ꋳ'=>'ꋳ','ê‹´'=>'ê‹´','ꋵ'=>'ꋵ','ꋶ'=>'ꋶ','ê‹·'=>'ê‹·','ꋸ'=>'ꋸ','ꋹ'=>'ꋹ','ꋺ'=>'ꋺ','ê‹»'=>'ê‹»','ꋼ'=>'ꋼ','ꋽ'=>'ꋽ','ꋾ'=>'ꋾ','ê‹¿'=>'ê‹¿','ꌀ'=>'ꌀ','êŒ'=>'êŒ','ꌂ'=>'ꌂ','ꌃ'=>'ꌃ','ꌄ'=>'ꌄ','ꌅ'=>'ꌅ','ꌆ'=>'ꌆ','ꌇ'=>'ꌇ','ꌈ'=>'ꌈ','ꌉ'=>'ꌉ','ꌊ'=>'ꌊ','ꌋ'=>'ꌋ','ꌌ'=>'ꌌ','êŒ'=>'êŒ','ꌎ'=>'ꌎ','êŒ'=>'êŒ','êŒ'=>'êŒ','ꌑ'=>'ꌑ','ꌒ'=>'ꌒ','ꌓ'=>'ꌓ','ꌔ'=>'ꌔ','ꌕ'=>'ꌕ','ꌖ'=>'ꌖ','ꌗ'=>'ꌗ','ꌘ'=>'ꌘ','ꌙ'=>'ꌙ','ꌚ'=>'ꌚ','ꌛ'=>'ꌛ','ꌜ'=>'ꌜ','êŒ'=>'êŒ','ꌞ'=>'ꌞ','ꌟ'=>'ꌟ','ꌠ'=>'ꌠ','ꌡ'=>'ꌡ','ꌢ'=>'ꌢ','ꌣ'=>'ꌣ','ꌤ'=>'ꌤ','ꌥ'=>'ꌥ','ꌦ'=>'ꌦ','ꌧ'=>'ꌧ','ꌨ'=>'ꌨ','ꌩ'=>'ꌩ','ꌪ'=>'ꌪ','ꌫ'=>'ꌫ','ꌬ'=>'ꌬ','ꌭ'=>'ꌭ','ꌮ'=>'ꌮ','ꌯ'=>'ꌯ','ꌰ'=>'ꌰ','ꌱ'=>'ꌱ','ꌲ'=>'ꌲ','ꌳ'=>'ꌳ','ꌴ'=>'ꌴ','ꌵ'=>'ꌵ','ꌶ'=>'ꌶ','ꌷ'=>'ꌷ','ꌸ'=>'ꌸ','ꌹ'=>'ꌹ','ꌺ'=>'ꌺ','ꌻ'=>'ꌻ','ꌼ'=>'ꌼ','ꌽ'=>'ꌽ','ꌾ'=>'ꌾ','ꌿ'=>'ꌿ','ê€'=>'ê€','ê'=>'ê','ê‚'=>'ê‚','êƒ'=>'êƒ','ê„'=>'ê„','ê…'=>'ê…','ê†'=>'ê†','ê‡'=>'ê‡','êˆ'=>'êˆ','ê‰'=>'ê‰','êŠ'=>'êŠ','ê‹'=>'ê‹','êŒ'=>'êŒ','ê'=>'ê','êŽ'=>'êŽ','ê'=>'ê','ê'=>'ê','ê‘'=>'ê‘','ê’'=>'ê’','ê“'=>'ê“','ê”'=>'ê”','ê•'=>'ê•','ê–'=>'ê–','ê—'=>'ê—','ê˜'=>'ê˜','ê™'=>'ê™','êš'=>'êš','ê›'=>'ê›','êœ'=>'êœ','ê'=>'ê','êž'=>'êž','êŸ'=>'êŸ','ê '=>'ê ','ê¡'=>'ê¡','ê¢'=>'ê¢','ê£'=>'ê£','ê¤'=>'ê¤','ê¥'=>'ê¥','ê¦'=>'ê¦','ê§'=>'ê§','ê¨'=>'ê¨','ê©'=>'ê©','êª'=>'êª','ê«'=>'ê«','ê¬'=>'ê¬','ê­'=>'ê­','ê®'=>'ê®','ê¯'=>'ê¯','ê°'=>'ê°','ê±'=>'ê±','ê²'=>'ê²','ê³'=>'ê³','ê´'=>'ê´','êµ'=>'êµ','ê¶'=>'ê¶','ê·'=>'ê·','ê¸'=>'ê¸','ê¹'=>'ê¹','êº'=>'êº','ê»'=>'ê»','ê¼'=>'ê¼','ê½'=>'ê½','ê¾'=>'ê¾','ê¿'=>'ê¿','ꎀ'=>'ꎀ','êŽ'=>'êŽ','ꎂ'=>'ꎂ','ꎃ'=>'ꎃ','ꎄ'=>'ꎄ','ꎅ'=>'ꎅ','ꎆ'=>'ꎆ','ꎇ'=>'ꎇ','ꎈ'=>'ꎈ','ꎉ'=>'ꎉ','ꎊ'=>'ꎊ','ꎋ'=>'ꎋ','ꎌ'=>'ꎌ','êŽ'=>'êŽ','ꎎ'=>'ꎎ','êŽ'=>'êŽ','êŽ'=>'êŽ','ꎑ'=>'ꎑ','ꎒ'=>'ꎒ','ꎓ'=>'ꎓ','ꎔ'=>'ꎔ','ꎕ'=>'ꎕ','ꎖ'=>'ꎖ','ꎗ'=>'ꎗ','ꎘ'=>'ꎘ','ꎙ'=>'ꎙ','ꎚ'=>'ꎚ','ꎛ'=>'ꎛ','ꎜ'=>'ꎜ','êŽ'=>'êŽ','ꎞ'=>'ꎞ','ꎟ'=>'ꎟ','ꎠ'=>'ꎠ','ꎡ'=>'ꎡ','ꎢ'=>'ꎢ','ꎣ'=>'ꎣ','ꎤ'=>'ꎤ','ꎥ'=>'ꎥ','ꎦ'=>'ꎦ','ꎧ'=>'ꎧ','ꎨ'=>'ꎨ','ꎩ'=>'ꎩ','ꎪ'=>'ꎪ','ꎫ'=>'ꎫ','ꎬ'=>'ꎬ','ꎭ'=>'ꎭ','ꎮ'=>'ꎮ','ꎯ'=>'ꎯ','ꎰ'=>'ꎰ','ꎱ'=>'ꎱ','ꎲ'=>'ꎲ','ꎳ'=>'ꎳ','ꎴ'=>'ꎴ','ꎵ'=>'ꎵ','ꎶ'=>'ꎶ','ꎷ'=>'ꎷ','ꎸ'=>'ꎸ','ꎹ'=>'ꎹ','ꎺ'=>'ꎺ','ꎻ'=>'ꎻ','ꎼ'=>'ꎼ','ꎽ'=>'ꎽ','ꎾ'=>'ꎾ','ꎿ'=>'ꎿ','ê€'=>'ê€','ê'=>'ê','ê‚'=>'ê‚','êƒ'=>'êƒ','ê„'=>'ê„','ê…'=>'ê…','ê†'=>'ê†','ê‡'=>'ê‡','êˆ'=>'êˆ','ê‰'=>'ê‰','êŠ'=>'êŠ','ê‹'=>'ê‹','êŒ'=>'êŒ','ê'=>'ê','êŽ'=>'êŽ','ê'=>'ê','ê'=>'ê','ê‘'=>'ê‘','ê’'=>'ê’','ê“'=>'ê“','ê”'=>'ê”','ê•'=>'ê•','ê–'=>'ê–','ê—'=>'ê—','ê˜'=>'ê˜','ê™'=>'ê™','êš'=>'êš','ê›'=>'ê›','êœ'=>'êœ','ê'=>'ê','êž'=>'êž','êŸ'=>'êŸ','ê '=>'ê ','ê¡'=>'ê¡','ê¢'=>'ê¢','ê£'=>'ê£','ê¤'=>'ê¤','ê¥'=>'ê¥','ê¦'=>'ê¦','ê§'=>'ê§','ê¨'=>'ê¨','ê©'=>'ê©','êª'=>'êª','ê«'=>'ê«','ê¬'=>'ê¬','ê­'=>'ê­','ê®'=>'ê®','ê¯'=>'ê¯','ê°'=>'ê°','ê±'=>'ê±','ê²'=>'ê²','ê³'=>'ê³','ê´'=>'ê´','êµ'=>'êµ','ê¶'=>'ê¶','ê·'=>'ê·','ê¸'=>'ê¸','ê¹'=>'ê¹','êº'=>'êº','ê»'=>'ê»','ê¼'=>'ê¼','ê½'=>'ê½','ê¾'=>'ê¾','ê¿'=>'ê¿','ê€'=>'ê€','ê'=>'ê','ê‚'=>'ê‚','êƒ'=>'êƒ','ê„'=>'ê„','ê…'=>'ê…','ê†'=>'ê†','ê‡'=>'ê‡','êˆ'=>'êˆ','ê‰'=>'ê‰','êŠ'=>'êŠ','ê‹'=>'ê‹','êŒ'=>'êŒ','ê'=>'ê','êŽ'=>'êŽ','ê'=>'ê','ê'=>'ê','ê‘'=>'ê‘','ê’'=>'ê’','ê“'=>'ê“','ê”'=>'ê”','ê•'=>'ê•','ê–'=>'ê–','ê—'=>'ê—','ê˜'=>'ê˜','ê™'=>'ê™','êš'=>'êš','ê›'=>'ê›','êœ'=>'êœ','ê'=>'ê','êž'=>'êž','êŸ'=>'êŸ','ê '=>'ê ','ê¡'=>'ê¡','ê¢'=>'ê¢','ê£'=>'ê£','ê¤'=>'ê¤','ê¥'=>'ê¥','ê¦'=>'ê¦','ê§'=>'ê§','ê¨'=>'ê¨','ê©'=>'ê©','êª'=>'êª','ê«'=>'ê«','ê¬'=>'ê¬','ê­'=>'ê­','ê®'=>'ê®','ê¯'=>'ê¯','ê°'=>'ê°','ê±'=>'ê±','ê²'=>'ê²','ê³'=>'ê³','ê´'=>'ê´','êµ'=>'êµ','ê¶'=>'ê¶','ê·'=>'ê·','ê¸'=>'ê¸','ê¹'=>'ê¹','êº'=>'êº','ê»'=>'ê»','ê¼'=>'ê¼','ê½'=>'ê½','ê¾'=>'ê¾','ê¿'=>'ê¿','ê‘€'=>'ê‘€','ê‘'=>'ê‘','ê‘‚'=>'ê‘‚','ꑃ'=>'ꑃ','ê‘„'=>'ê‘„','ê‘…'=>'ê‘…','ꑆ'=>'ꑆ','ꑇ'=>'ꑇ','ꑈ'=>'ꑈ','ꑉ'=>'ꑉ','ê‘Š'=>'ê‘Š','ê‘‹'=>'ê‘‹','ê‘Œ'=>'ê‘Œ','ê‘'=>'ê‘','ê‘Ž'=>'ê‘Ž','ê‘'=>'ê‘','ê‘'=>'ê‘','ê‘‘'=>'ê‘‘','ê‘’'=>'ê‘’','ê‘“'=>'ê‘“','ê‘”'=>'ê‘”','ê‘•'=>'ê‘•','ê‘–'=>'ê‘–','ê‘—'=>'ê‘—','ꑘ'=>'ꑘ','ê‘™'=>'ê‘™','ê‘š'=>'ê‘š','ê‘›'=>'ê‘›','ê‘œ'=>'ê‘œ','ê‘'=>'ê‘','ê‘ž'=>'ê‘ž','ê‘Ÿ'=>'ê‘Ÿ','ê‘ '=>'ê‘ ','ê‘¡'=>'ê‘¡','ê‘¢'=>'ê‘¢','ê‘£'=>'ê‘£','ꑤ'=>'ꑤ','ê‘¥'=>'ê‘¥','ꑦ'=>'ꑦ','ꑧ'=>'ꑧ','ꑨ'=>'ꑨ','ê‘©'=>'ê‘©','ꑪ'=>'ꑪ','ê‘«'=>'ê‘«','ꑬ'=>'ꑬ','ê‘­'=>'ê‘­','ê‘®'=>'ê‘®','ꑯ'=>'ꑯ','ê‘°'=>'ê‘°','ꑱ'=>'ꑱ','ꑲ'=>'ꑲ','ꑳ'=>'ꑳ','ê‘´'=>'ê‘´','ꑵ'=>'ꑵ','ꑶ'=>'ꑶ','ê‘·'=>'ê‘·','ꑸ'=>'ꑸ','ꑹ'=>'ꑹ','ꑺ'=>'ꑺ','ê‘»'=>'ê‘»','ꑼ'=>'ꑼ','ꑽ'=>'ꑽ','ꑾ'=>'ꑾ','ê‘¿'=>'ê‘¿','ê’€'=>'ê’€','ê’'=>'ê’','ê’‚'=>'ê’‚','ê’ƒ'=>'ê’ƒ','ê’„'=>'ê’„','ê’…'=>'ê’…','ê’†'=>'ê’†','ê’‡'=>'ê’‡','ê’ˆ'=>'ê’ˆ','ê’‰'=>'ê’‰','ê’Š'=>'ê’Š','ê’‹'=>'ê’‹','ê’Œ'=>'ê’Œ','ꜗ'=>'ꜗ','ꜘ'=>'ꜘ','ꜙ'=>'ꜙ','ꜚ'=>'ꜚ'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_21.php b/sources/phpBB/includes/utf/data/search_indexer_21.php new file mode 100644 index 0000000..34994b4 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_21.php @@ -0,0 +1 @@ +'ê €','ê '=>'ê ','ê ‚'=>'ê ‚','ê ƒ'=>'ê ƒ','ê „'=>'ê „','ê …'=>'ê …','ê †'=>'ê †','ê ‡'=>'ê ‡','ê ˆ'=>'ê ˆ','ê ‰'=>'ê ‰','ê Š'=>'ê Š','ê ‹'=>'ê ‹','ê Œ'=>'ê Œ','ê '=>'ê ','ê Ž'=>'ê Ž','ê '=>'ê ','ê '=>'ê ','ê ‘'=>'ê ‘','ê ’'=>'ê ’','ê “'=>'ê “','ê ”'=>'ê ”','ê •'=>'ê •','ê –'=>'ê –','ê —'=>'ê —','ê ˜'=>'ê ˜','ê ™'=>'ê ™','ê š'=>'ê š','ê ›'=>'ê ›','ê œ'=>'ê œ','ê '=>'ê ','ê ž'=>'ê ž','ê Ÿ'=>'ê Ÿ','ê  '=>'ê  ','ê ¡'=>'ê ¡','ê ¢'=>'ê ¢','ê £'=>'ê £','ê ¤'=>'ê ¤','ê ¥'=>'ê ¥','ê ¦'=>'ê ¦','ê §'=>'ê §','ê¡€'=>'ê¡€','ê¡'=>'ê¡','ê¡‚'=>'ê¡‚','ꡃ'=>'ꡃ','ê¡„'=>'ê¡„','ê¡…'=>'ê¡…','ꡆ'=>'ꡆ','ꡇ'=>'ꡇ','ꡈ'=>'ꡈ','ꡉ'=>'ꡉ','ê¡Š'=>'ê¡Š','ê¡‹'=>'ê¡‹','ê¡Œ'=>'ê¡Œ','ê¡'=>'ê¡','ê¡Ž'=>'ê¡Ž','ê¡'=>'ê¡','ê¡'=>'ê¡','ê¡‘'=>'ê¡‘','ê¡’'=>'ê¡’','ê¡“'=>'ê¡“','ê¡”'=>'ê¡”','ê¡•'=>'ê¡•','ê¡–'=>'ê¡–','ê¡—'=>'ê¡—','ꡘ'=>'ꡘ','ê¡™'=>'ê¡™','ê¡š'=>'ê¡š','ê¡›'=>'ê¡›','ê¡œ'=>'ê¡œ','ê¡'=>'ê¡','ê¡ž'=>'ê¡ž','ê¡Ÿ'=>'ê¡Ÿ','ê¡ '=>'ê¡ ','ê¡¡'=>'ê¡¡','ê¡¢'=>'ê¡¢','ê¡£'=>'ê¡£','ꡤ'=>'ꡤ','ê¡¥'=>'ê¡¥','ꡦ'=>'ꡦ','ꡧ'=>'ꡧ','ꡨ'=>'ꡨ','ê¡©'=>'ê¡©','ꡪ'=>'ꡪ','ê¡«'=>'ê¡«','ꡬ'=>'ꡬ','ê¡­'=>'ê¡­','ê¡®'=>'ê¡®','ꡯ'=>'ꡯ','ê¡°'=>'ê¡°','ꡱ'=>'ꡱ','ꡲ'=>'ꡲ','ꡳ'=>'ꡳ','ê°€'=>'ê°€'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_26.php b/sources/phpBB/includes/utf/data/search_indexer_26.php new file mode 100644 index 0000000..444ab96 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_26.php @@ -0,0 +1 @@ +'힣'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_3.php b/sources/phpBB/includes/utf/data/search_indexer_3.php new file mode 100644 index 0000000..ceab762 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_3.php @@ -0,0 +1 @@ +'á ‹','á Œ'=>'á Œ','á '=>'á ','á '=>'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','á­«'=>'á­«','á­¬'=>'á­¬','á­­'=>'á­­','á­®'=>'á­®','á­¯'=>'á­¯','á­°'=>'á­°','á­±'=>'á­±','á­²'=>'á­²','á­³'=>'á­³','á´€'=>'á´€','á´'=>'á´','á´‚'=>'á´‚','á´ƒ'=>'á´ƒ','á´„'=>'á´„','á´…'=>'á´…','á´†'=>'á´†','á´‡'=>'á´‡','á´ˆ'=>'á´ˆ','á´‰'=>'á´‰','á´Š'=>'á´Š','á´‹'=>'á´‹','á´Œ'=>'á´Œ','á´'=>'á´','á´Ž'=>'á´Ž','á´'=>'á´','á´'=>'á´','á´‘'=>'á´‘','á´’'=>'á´’','á´“'=>'á´“','á´”'=>'á´”','á´•'=>'á´•','á´–'=>'á´–','á´—'=>'á´—','á´˜'=>'á´˜','á´™'=>'á´™','á´š'=>'á´š','á´›'=>'á´›','á´œ'=>'á´œ','á´'=>'á´','á´ž'=>'á´ž','á´Ÿ'=>'á´Ÿ','á´ '=>'á´ ','á´¡'=>'á´¡','á´¢'=>'á´¢','á´£'=>'á´£','á´¤'=>'á´¤','á´¥'=>'á´¥','á´¦'=>'á´¦','á´§'=>'á´§','á´¨'=>'á´¨','á´©'=>'á´©','á´ª'=>'á´ª','á´«'=>'á´«','á´¬'=>'á´¬','á´­'=>'á´­','á´®'=>'á´®','á´¯'=>'á´¯','á´°'=>'á´°','á´±'=>'á´±','á´²'=>'á´²','á´³'=>'á´³','á´´'=>'á´´','á´µ'=>'á´µ','á´¶'=>'á´¶','á´·'=>'á´·','á´¸'=>'á´¸','á´¹'=>'á´¹','á´º'=>'á´º','á´»'=>'á´»','á´¼'=>'á´¼','á´½'=>'á´½','á´¾'=>'á´¾','á´¿'=>'á´¿','áµ€'=>'áµ€','áµ'=>'áµ','ᵂ'=>'ᵂ','ᵃ'=>'ᵃ','ᵄ'=>'ᵄ','áµ…'=>'áµ…','ᵆ'=>'ᵆ','ᵇ'=>'ᵇ','ᵈ'=>'ᵈ','ᵉ'=>'ᵉ','ᵊ'=>'ᵊ','ᵋ'=>'ᵋ','ᵌ'=>'ᵌ','áµ'=>'áµ','ᵎ'=>'ᵎ','áµ'=>'áµ','áµ'=>'áµ','ᵑ'=>'ᵑ','áµ’'=>'áµ’','ᵓ'=>'ᵓ','áµ”'=>'áµ”','ᵕ'=>'ᵕ','áµ–'=>'áµ–','áµ—'=>'áµ—','ᵘ'=>'ᵘ','áµ™'=>'áµ™','ᵚ'=>'ᵚ','áµ›'=>'áµ›','ᵜ'=>'ᵜ','áµ'=>'áµ','ᵞ'=>'ᵞ','ᵟ'=>'ᵟ','áµ '=>'áµ ','ᵡ'=>'ᵡ','áµ¢'=>'áµ¢','áµ£'=>'áµ£','ᵤ'=>'ᵤ','áµ¥'=>'áµ¥','ᵦ'=>'ᵦ','ᵧ'=>'ᵧ','ᵨ'=>'ᵨ','ᵩ'=>'ᵩ','ᵪ'=>'ᵪ','ᵫ'=>'ue','ᵬ'=>'ᵬ','áµ­'=>'áµ­','áµ®'=>'áµ®','ᵯ'=>'ᵯ','áµ°'=>'áµ°','áµ±'=>'áµ±','áµ²'=>'áµ²','áµ³'=>'áµ³','áµ´'=>'áµ´','áµµ'=>'áµµ','ᵶ'=>'ᵶ','áµ·'=>'áµ·','ᵸ'=>'ᵸ','áµ¹'=>'áµ¹','ᵺ'=>'ᵺ','áµ»'=>'áµ»','áµ¼'=>'áµ¼','áµ½'=>'áµ½','áµ¾'=>'áµ¾','ᵿ'=>'ᵿ','ᶀ'=>'ᶀ','á¶'=>'á¶','ᶂ'=>'ᶂ','ᶃ'=>'ᶃ','ᶄ'=>'ᶄ','ᶅ'=>'ᶅ','ᶆ'=>'ᶆ','ᶇ'=>'ᶇ','ᶈ'=>'ᶈ','ᶉ'=>'ᶉ','ᶊ'=>'ᶊ','ᶋ'=>'ᶋ','ᶌ'=>'ᶌ','á¶'=>'á¶','ᶎ'=>'ᶎ','á¶'=>'á¶','á¶'=>'á¶','ᶑ'=>'ᶑ','ᶒ'=>'ᶒ','ᶓ'=>'ᶓ','ᶔ'=>'ᶔ','ᶕ'=>'ᶕ','ᶖ'=>'ᶖ','ᶗ'=>'ᶗ','ᶘ'=>'ᶘ','ᶙ'=>'ᶙ','ᶚ'=>'ᶚ','ᶛ'=>'ᶛ','ᶜ'=>'ᶜ','á¶'=>'á¶','ᶞ'=>'ᶞ','ᶟ'=>'ᶟ','ᶠ'=>'ᶠ','ᶡ'=>'ᶡ','ᶢ'=>'ᶢ','ᶣ'=>'ᶣ','ᶤ'=>'ᶤ','ᶥ'=>'ᶥ','ᶦ'=>'ᶦ','ᶧ'=>'ᶧ','ᶨ'=>'ᶨ','ᶩ'=>'ᶩ','ᶪ'=>'ᶪ','ᶫ'=>'ᶫ','ᶬ'=>'ᶬ','ᶭ'=>'ᶭ','ᶮ'=>'ᶮ','ᶯ'=>'ᶯ','ᶰ'=>'ᶰ','ᶱ'=>'ᶱ','ᶲ'=>'ᶲ','ᶳ'=>'ᶳ','ᶴ'=>'ᶴ','ᶵ'=>'ᶵ','ᶶ'=>'ᶶ','ᶷ'=>'ᶷ','ᶸ'=>'ᶸ','ᶹ'=>'ᶹ','ᶺ'=>'ᶺ','ᶻ'=>'ᶻ','ᶼ'=>'ᶼ','ᶽ'=>'ᶽ','ᶾ'=>'ᶾ','ᶿ'=>'ᶿ','á·€'=>'á·€','á·'=>'á·','á·‚'=>'á·‚','á·ƒ'=>'á·ƒ','á·„'=>'á·„','á·…'=>'á·…','á·†'=>'á·†','á·‡'=>'á·‡','á·ˆ'=>'á·ˆ','á·‰'=>'á·‰','á·Š'=>'á·Š','á·¾'=>'á·¾','á·¿'=>'á·¿','Ḁ'=>'á¸','á¸'=>'á¸','Ḃ'=>'ḃ','ḃ'=>'ḃ','Ḅ'=>'ḅ','ḅ'=>'ḅ','Ḇ'=>'ḇ','ḇ'=>'ḇ','Ḉ'=>'ḉ','ḉ'=>'ḉ','Ḋ'=>'ḋ','ḋ'=>'ḋ','Ḍ'=>'á¸','á¸'=>'á¸','Ḏ'=>'á¸','á¸'=>'á¸','á¸'=>'ḑ','ḑ'=>'ḑ','Ḓ'=>'ḓ','ḓ'=>'ḓ','Ḕ'=>'ḕ','ḕ'=>'ḕ','Ḗ'=>'ḗ','ḗ'=>'ḗ','Ḙ'=>'ḙ','ḙ'=>'ḙ','Ḛ'=>'ḛ','ḛ'=>'ḛ','Ḝ'=>'á¸','á¸'=>'á¸','Ḟ'=>'ḟ','ḟ'=>'ḟ','Ḡ'=>'ḡ','ḡ'=>'ḡ','Ḣ'=>'ḣ','ḣ'=>'ḣ','Ḥ'=>'ḥ','ḥ'=>'ḥ','Ḧ'=>'ḧ','ḧ'=>'ḧ','Ḩ'=>'ḩ','ḩ'=>'ḩ','Ḫ'=>'ḫ','ḫ'=>'ḫ','Ḭ'=>'ḭ','ḭ'=>'ḭ','Ḯ'=>'ḯ','ḯ'=>'ḯ','Ḱ'=>'ḱ','ḱ'=>'ḱ','Ḳ'=>'ḳ','ḳ'=>'ḳ','Ḵ'=>'ḵ','ḵ'=>'ḵ','Ḷ'=>'ḷ','ḷ'=>'ḷ','Ḹ'=>'ḹ','ḹ'=>'ḹ','Ḻ'=>'ḻ','ḻ'=>'ḻ','Ḽ'=>'ḽ','ḽ'=>'ḽ','Ḿ'=>'ḿ','ḿ'=>'ḿ','á¹€'=>'á¹','á¹'=>'á¹','Ṃ'=>'ṃ','ṃ'=>'ṃ','Ṅ'=>'á¹…','á¹…'=>'á¹…','Ṇ'=>'ṇ','ṇ'=>'ṇ','Ṉ'=>'ṉ','ṉ'=>'ṉ','Ṋ'=>'ṋ','ṋ'=>'ṋ','Ṍ'=>'á¹','á¹'=>'á¹','Ṏ'=>'á¹','á¹'=>'á¹','á¹'=>'ṑ','ṑ'=>'ṑ','á¹’'=>'ṓ','ṓ'=>'ṓ','á¹”'=>'ṕ','ṕ'=>'ṕ','á¹–'=>'á¹—','á¹—'=>'á¹—','Ṙ'=>'á¹™','á¹™'=>'á¹™','Ṛ'=>'á¹›','á¹›'=>'á¹›','Ṝ'=>'á¹','á¹'=>'á¹','Ṟ'=>'ṟ','ṟ'=>'ṟ','á¹ '=>'ṡ','ṡ'=>'ṡ','á¹¢'=>'á¹£','á¹£'=>'á¹£','Ṥ'=>'á¹¥','á¹¥'=>'á¹¥','Ṧ'=>'ṧ','ṧ'=>'ṧ','Ṩ'=>'ṩ','ṩ'=>'ṩ','Ṫ'=>'ṫ','ṫ'=>'ṫ','Ṭ'=>'á¹­','á¹­'=>'á¹­','á¹®'=>'ṯ','ṯ'=>'ṯ','á¹°'=>'á¹±','á¹±'=>'á¹±','á¹²'=>'á¹³','á¹³'=>'á¹³','á¹´'=>'á¹µ','á¹µ'=>'á¹µ','Ṷ'=>'á¹·','á¹·'=>'á¹·','Ṹ'=>'á¹¹','á¹¹'=>'á¹¹','Ṻ'=>'á¹»','á¹»'=>'á¹»','á¹¼'=>'á¹½','á¹½'=>'á¹½','á¹¾'=>'ṿ','ṿ'=>'ṿ','Ẁ'=>'áº','áº'=>'áº','Ẃ'=>'ẃ','ẃ'=>'ẃ','Ẅ'=>'ẅ','ẅ'=>'ẅ','Ẇ'=>'ẇ','ẇ'=>'ẇ','Ẉ'=>'ẉ','ẉ'=>'ẉ','Ẋ'=>'ẋ','ẋ'=>'ẋ','Ẍ'=>'áº','áº'=>'áº','Ẏ'=>'áº','áº'=>'áº','áº'=>'ẑ','ẑ'=>'ẑ','Ẓ'=>'ẓ','ẓ'=>'ẓ','Ẕ'=>'ẕ','ẕ'=>'ẕ','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'ẘ','ẙ'=>'ẙ','ẚ'=>'ẚ','ẛ'=>'ẛ','Ạ'=>'ạ','ạ'=>'ạ','Ả'=>'ả','ả'=>'ả','Ấ'=>'ấ','ấ'=>'ấ','Ầ'=>'ầ','ầ'=>'ầ','Ẩ'=>'ẩ','ẩ'=>'ẩ','Ẫ'=>'ẫ','ẫ'=>'ẫ','Ậ'=>'ậ','ậ'=>'ậ','Ắ'=>'ắ','ắ'=>'ắ','Ằ'=>'ằ','ằ'=>'ằ','Ẳ'=>'ẳ','ẳ'=>'ẳ','Ẵ'=>'ẵ','ẵ'=>'ẵ','Ặ'=>'ặ','ặ'=>'ặ','Ẹ'=>'ẹ','ẹ'=>'ẹ','Ẻ'=>'ẻ','ẻ'=>'ẻ','Ẽ'=>'ẽ','ẽ'=>'ẽ','Ế'=>'ế','ế'=>'ế','Ề'=>'á»','á»'=>'á»','Ể'=>'ể','ể'=>'ể','Ễ'=>'á»…','á»…'=>'á»…','Ệ'=>'ệ','ệ'=>'ệ','Ỉ'=>'ỉ','ỉ'=>'ỉ','Ị'=>'ị','ị'=>'ị','Ọ'=>'á»','á»'=>'á»','Ỏ'=>'á»','á»'=>'á»','á»'=>'ố','ố'=>'ố','á»’'=>'ồ','ồ'=>'ồ','á»”'=>'ổ','ổ'=>'ổ','á»–'=>'á»—','á»—'=>'á»—','Ộ'=>'á»™','á»™'=>'á»™','Ớ'=>'á»›','á»›'=>'á»›','Ờ'=>'á»','á»'=>'á»','Ở'=>'ở','ở'=>'ở','á» '=>'ỡ','ỡ'=>'ỡ','Ợ'=>'ợ','ợ'=>'ợ','Ụ'=>'ụ','ụ'=>'ụ','Ủ'=>'ủ','ủ'=>'ủ','Ứ'=>'ứ','ứ'=>'ứ','Ừ'=>'ừ','ừ'=>'ừ','Ử'=>'á»­','á»­'=>'á»­','á»®'=>'ữ','ữ'=>'ữ','á»°'=>'á»±','á»±'=>'á»±','Ỳ'=>'ỳ','ỳ'=>'ỳ','á»´'=>'ỵ','ỵ'=>'ỵ','Ỷ'=>'á»·','á»·'=>'á»·','Ỹ'=>'ỹ','ỹ'=>'ỹ','á¼€'=>'á¼€','á¼'=>'á¼','ἂ'=>'ἂ','ἃ'=>'ἃ','ἄ'=>'ἄ','á¼…'=>'á¼…','ἆ'=>'ἆ','ἇ'=>'ἇ','Ἀ'=>'á¼€','Ἁ'=>'á¼','Ἂ'=>'ἂ','Ἃ'=>'ἃ','Ἄ'=>'ἄ','á¼'=>'á¼…','Ἆ'=>'ἆ','á¼'=>'ἇ','á¼'=>'á¼','ἑ'=>'ἑ','á¼’'=>'á¼’','ἓ'=>'ἓ','á¼”'=>'á¼”','ἕ'=>'ἕ','Ἐ'=>'á¼','á¼™'=>'ἑ','Ἒ'=>'á¼’','á¼›'=>'ἓ','Ἔ'=>'á¼”','á¼'=>'ἕ','á¼ '=>'á¼ ','ἡ'=>'ἡ','á¼¢'=>'á¼¢','á¼£'=>'á¼£','ἤ'=>'ἤ','á¼¥'=>'á¼¥','ἦ'=>'ἦ','ἧ'=>'ἧ','Ἠ'=>'á¼ ','Ἡ'=>'ἡ','Ἢ'=>'á¼¢','Ἣ'=>'á¼£','Ἤ'=>'ἤ','á¼­'=>'á¼¥','á¼®'=>'ἦ','Ἧ'=>'ἧ','á¼°'=>'á¼°','á¼±'=>'á¼±','á¼²'=>'á¼²','á¼³'=>'á¼³','á¼´'=>'á¼´','á¼µ'=>'á¼µ','ἶ'=>'ἶ','á¼·'=>'á¼·','Ἰ'=>'á¼°','á¼¹'=>'á¼±','Ἲ'=>'á¼²','á¼»'=>'á¼³','á¼¼'=>'á¼´','á¼½'=>'á¼µ','á¼¾'=>'ἶ','Ἷ'=>'á¼·','á½€'=>'á½€','á½'=>'á½','ὂ'=>'ὂ','ὃ'=>'ὃ','ὄ'=>'ὄ','á½…'=>'á½…','Ὀ'=>'á½€','Ὁ'=>'á½','Ὂ'=>'ὂ','Ὃ'=>'ὃ','Ὄ'=>'ὄ','á½'=>'á½…','á½'=>'á½','ὑ'=>'ὑ','á½’'=>'á½’','ὓ'=>'ὓ','á½”'=>'á½”','ὕ'=>'ὕ','á½–'=>'á½–','á½—'=>'á½—','á½™'=>'ὑ','á½›'=>'ὓ','á½'=>'ὕ','Ὗ'=>'á½—','á½ '=>'á½ ','ὡ'=>'ὡ','á½¢'=>'á½¢','á½£'=>'á½£','ὤ'=>'ὤ','á½¥'=>'á½¥','ὦ'=>'ὦ','ὧ'=>'ὧ','Ὠ'=>'á½ ','Ὡ'=>'ὡ','Ὢ'=>'á½¢','Ὣ'=>'á½£','Ὤ'=>'ὤ','á½­'=>'á½¥','á½®'=>'ὦ','Ὧ'=>'ὧ','á½°'=>'á½°','á½±'=>'á½±','á½²'=>'á½²','á½³'=>'á½³','á½´'=>'á½´','á½µ'=>'á½µ','ὶ'=>'ὶ','á½·'=>'á½·','ὸ'=>'ὸ','á½¹'=>'á½¹','ὺ'=>'ὺ','á½»'=>'á½»','á½¼'=>'á½¼','á½½'=>'á½½','á¾€'=>'á¾€','á¾'=>'á¾','ᾂ'=>'ᾂ','ᾃ'=>'ᾃ','ᾄ'=>'ᾄ','á¾…'=>'á¾…','ᾆ'=>'ᾆ','ᾇ'=>'ᾇ','ᾈ'=>'á¾€','ᾉ'=>'á¾','ᾊ'=>'ᾂ','ᾋ'=>'ᾃ','ᾌ'=>'ᾄ','á¾'=>'á¾…','ᾎ'=>'ᾆ','á¾'=>'ᾇ','á¾'=>'á¾','ᾑ'=>'ᾑ','á¾’'=>'á¾’','ᾓ'=>'ᾓ','á¾”'=>'á¾”','ᾕ'=>'ᾕ','á¾–'=>'á¾–','á¾—'=>'á¾—','ᾘ'=>'á¾','á¾™'=>'ᾑ','ᾚ'=>'á¾’','á¾›'=>'ᾓ','ᾜ'=>'á¾”','á¾'=>'ᾕ','ᾞ'=>'á¾–','ᾟ'=>'á¾—','á¾ '=>'á¾ ','ᾡ'=>'ᾡ','á¾¢'=>'á¾¢','á¾£'=>'á¾£','ᾤ'=>'ᾤ','á¾¥'=>'á¾¥','ᾦ'=>'ᾦ','ᾧ'=>'ᾧ','ᾨ'=>'á¾ ','ᾩ'=>'ᾡ','ᾪ'=>'á¾¢','ᾫ'=>'á¾£','ᾬ'=>'ᾤ','á¾­'=>'á¾¥','á¾®'=>'ᾦ','ᾯ'=>'ᾧ','á¾°'=>'á¾°','á¾±'=>'á¾±','á¾²'=>'á¾²','á¾³'=>'á¾³','á¾´'=>'á¾´','ᾶ'=>'ᾶ','á¾·'=>'á¾·','Ᾰ'=>'á¾°','á¾¹'=>'á¾±','Ὰ'=>'á½°','á¾»'=>'á½±','á¾¼'=>'á¾³','á¾¾'=>'á¾¾','á¿‚'=>'á¿‚','ῃ'=>'ῃ','á¿„'=>'á¿„','ῆ'=>'ῆ','ῇ'=>'ῇ','Ὲ'=>'á½²','Έ'=>'á½³','á¿Š'=>'á½´','á¿‹'=>'á½µ','á¿Œ'=>'ῃ','á¿'=>'á¿','á¿‘'=>'á¿‘','á¿’'=>'á¿’','á¿“'=>'á¿“','á¿–'=>'á¿–','á¿—'=>'á¿—','Ῐ'=>'á¿','á¿™'=>'á¿‘','á¿š'=>'ὶ','á¿›'=>'á½·','á¿ '=>'á¿ ','á¿¡'=>'á¿¡','á¿¢'=>'á¿¢','á¿£'=>'á¿£','ῤ'=>'ῤ','á¿¥'=>'á¿¥','ῦ'=>'ῦ','ῧ'=>'ῧ','Ῠ'=>'á¿ ','á¿©'=>'á¿¡','Ὺ'=>'ὺ','á¿«'=>'á½»','Ῥ'=>'á¿¥','ῲ'=>'ῲ','ῳ'=>'ῳ','á¿´'=>'á¿´','ῶ'=>'ῶ','á¿·'=>'á¿·','Ὸ'=>'ὸ','Ό'=>'á½¹','Ὼ'=>'á½¼','á¿»'=>'á½½','ῼ'=>'ῳ'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_31.php b/sources/phpBB/includes/utf/data/search_indexer_31.php new file mode 100644 index 0000000..85961d3 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_31.php @@ -0,0 +1 @@ +'豈','ï¤'=>'ï¤','車'=>'車','賈'=>'賈','滑'=>'滑','串'=>'串','句'=>'句','龜'=>'龜','龜'=>'龜','契'=>'契','金'=>'金','喇'=>'喇','奈'=>'奈','ï¤'=>'ï¤','癩'=>'癩','ï¤'=>'ï¤','ï¤'=>'ï¤','螺'=>'螺','裸'=>'裸','邏'=>'邏','樂'=>'樂','洛'=>'洛','烙'=>'烙','珞'=>'珞','落'=>'落','酪'=>'酪','駱'=>'駱','亂'=>'亂','卵'=>'卵','ï¤'=>'ï¤','爛'=>'爛','蘭'=>'蘭','鸞'=>'鸞','嵐'=>'嵐','濫'=>'濫','藍'=>'藍','襤'=>'襤','拉'=>'拉','臘'=>'臘','蠟'=>'蠟','廊'=>'廊','朗'=>'朗','浪'=>'浪','狼'=>'狼','郎'=>'郎','來'=>'來','冷'=>'冷','勞'=>'勞','擄'=>'擄','櫓'=>'櫓','爐'=>'爐','盧'=>'盧','老'=>'老','蘆'=>'蘆','虜'=>'虜','路'=>'路','露'=>'露','魯'=>'魯','鷺'=>'鷺','碌'=>'碌','祿'=>'祿','綠'=>'綠','菉'=>'菉','錄'=>'錄','鹿'=>'鹿','ï¥'=>'ï¥','壟'=>'壟','弄'=>'弄','籠'=>'籠','聾'=>'聾','牢'=>'牢','磊'=>'磊','賂'=>'賂','雷'=>'雷','壘'=>'壘','屢'=>'屢','樓'=>'樓','ï¥'=>'ï¥','漏'=>'漏','ï¥'=>'ï¥','ï¥'=>'ï¥','陋'=>'陋','勒'=>'勒','肋'=>'肋','凜'=>'凜','凌'=>'凌','稜'=>'稜','綾'=>'綾','菱'=>'菱','陵'=>'陵','讀'=>'讀','拏'=>'拏','樂'=>'樂','ï¥'=>'ï¥','丹'=>'丹','寧'=>'寧','怒'=>'怒','率'=>'率','異'=>'異','北'=>'北','磻'=>'磻','便'=>'便','復'=>'復','不'=>'不','泌'=>'泌','數'=>'數','索'=>'索','參'=>'參','塞'=>'塞','省'=>'省','葉'=>'葉','說'=>'說','殺'=>'殺','辰'=>'辰','沈'=>'沈','拾'=>'拾','若'=>'若','掠'=>'掠','略'=>'略','亮'=>'亮','兩'=>'兩','凉'=>'凉','梁'=>'梁','糧'=>'糧','良'=>'良','諒'=>'諒','量'=>'量','勵'=>'勵','呂'=>'呂','ï¦'=>'ï¦','廬'=>'廬','旅'=>'旅','濾'=>'濾','礪'=>'礪','閭'=>'閭','驪'=>'驪','麗'=>'麗','黎'=>'黎','力'=>'力','曆'=>'曆','歷'=>'歷','ï¦'=>'ï¦','年'=>'年','ï¦'=>'ï¦','ï¦'=>'ï¦','撚'=>'撚','漣'=>'漣','煉'=>'煉','璉'=>'璉','秊'=>'秊','練'=>'練','聯'=>'聯','輦'=>'輦','蓮'=>'蓮','連'=>'連','鍊'=>'鍊','列'=>'列','ï¦'=>'ï¦','咽'=>'咽','烈'=>'烈','裂'=>'裂','說'=>'說','廉'=>'廉','念'=>'念','捻'=>'捻','殮'=>'殮','簾'=>'簾','獵'=>'獵','令'=>'令','囹'=>'囹','寧'=>'寧','嶺'=>'嶺','怜'=>'怜','玲'=>'玲','瑩'=>'瑩','羚'=>'羚','聆'=>'聆','鈴'=>'鈴','零'=>'零','靈'=>'靈','領'=>'領','例'=>'例','禮'=>'禮','醴'=>'醴','隸'=>'隸','惡'=>'惡','了'=>'了','僚'=>'僚','寮'=>'寮','尿'=>'尿','料'=>'料','樂'=>'樂','燎'=>'燎','ï§'=>'ï§','蓼'=>'蓼','遼'=>'遼','龍'=>'龍','暈'=>'暈','阮'=>'阮','劉'=>'劉','杻'=>'杻','柳'=>'柳','流'=>'流','溜'=>'溜','琉'=>'琉','ï§'=>'ï§','硫'=>'硫','ï§'=>'ï§','ï§'=>'ï§','六'=>'六','戮'=>'戮','陸'=>'陸','倫'=>'倫','崙'=>'崙','淪'=>'淪','輪'=>'輪','律'=>'律','慄'=>'慄','栗'=>'栗','率'=>'率','隆'=>'隆','ï§'=>'ï§','吏'=>'吏','履'=>'履','易'=>'易','李'=>'李','梨'=>'梨','泥'=>'泥','理'=>'理','痢'=>'痢','罹'=>'罹','裏'=>'裏','裡'=>'裡','里'=>'里','離'=>'離','匿'=>'匿','溺'=>'溺','吝'=>'吝','燐'=>'燐','璘'=>'璘','藺'=>'藺','隣'=>'隣','鱗'=>'鱗','麟'=>'麟','林'=>'林','淋'=>'淋','臨'=>'臨','立'=>'立','笠'=>'笠','粒'=>'粒','狀'=>'狀','炙'=>'炙','識'=>'識','什'=>'什','茶'=>'茶','刺'=>'刺','切'=>'切','ï¨'=>'ï¨','拓'=>'拓','糖'=>'糖','宅'=>'宅','洞'=>'洞','暴'=>'暴','輻'=>'輻','行'=>'行','降'=>'降','見'=>'見','廓'=>'廓','兀'=>'兀','ï¨'=>'ï¨','﨎'=>'﨎','ï¨'=>'ï¨','ï¨'=>'ï¨','﨑'=>'﨑','晴'=>'晴','﨓'=>'﨓','﨔'=>'﨔','凞'=>'凞','猪'=>'猪','益'=>'益','礼'=>'礼','神'=>'神','祥'=>'祥','福'=>'福','靖'=>'靖','ï¨'=>'ï¨','羽'=>'羽','﨟'=>'﨟','蘒'=>'蘒','﨡'=>'﨡','諸'=>'諸','﨣'=>'﨣','﨤'=>'﨤','逸'=>'逸','都'=>'都','﨧'=>'﨧','﨨'=>'﨨','﨩'=>'﨩','飯'=>'飯','飼'=>'飼','館'=>'館','鶴'=>'鶴','侮'=>'侮','僧'=>'僧','免'=>'免','勉'=>'勉','勤'=>'勤','卑'=>'卑','喝'=>'喝','嘆'=>'嘆','器'=>'器','塀'=>'塀','墨'=>'墨','層'=>'層','屮'=>'屮','悔'=>'悔','慨'=>'慨','憎'=>'憎','ï©€'=>'ï©€','ï©'=>'ï©','ï©‚'=>'ï©‚','暑'=>'暑','ï©„'=>'ï©„','ï©…'=>'ï©…','渚'=>'渚','漢'=>'漢','煮'=>'煮','爫'=>'爫','ï©Š'=>'ï©Š','ï©‹'=>'ï©‹','ï©Œ'=>'ï©Œ','ï©'=>'ï©','ï©Ž'=>'ï©Ž','ï©'=>'ï©','ï©'=>'ï©','ï©‘'=>'ï©‘','ï©’'=>'ï©’','ï©“'=>'ï©“','ï©”'=>'ï©”','ï©•'=>'ï©•','ï©–'=>'ï©–','ï©—'=>'ï©—','縉'=>'縉','ï©™'=>'ï©™','ï©š'=>'ï©š','ï©›'=>'ï©›','ï©œ'=>'ï©œ','ï©'=>'ï©','ï©ž'=>'ï©ž','ï©Ÿ'=>'ï©Ÿ','ï© '=>'ï© ','ï©¡'=>'ï©¡','ï©¢'=>'ï©¢','ï©£'=>'ï©£','賓'=>'賓','ï©¥'=>'ï©¥','辶'=>'辶','逸'=>'逸','難'=>'難','ï©©'=>'ï©©','頻'=>'頻','ï©°'=>'ï©°','况'=>'况','全'=>'全','侀'=>'侀','ï©´'=>'ï©´','冀'=>'冀','勇'=>'勇','ï©·'=>'ï©·','喝'=>'喝','啕'=>'啕','喙'=>'喙','ï©»'=>'ï©»','塚'=>'塚','墳'=>'墳','奄'=>'奄','ï©¿'=>'ï©¿','婢'=>'婢','ïª'=>'ïª','廒'=>'廒','廙'=>'廙','彩'=>'彩','徭'=>'徭','惘'=>'惘','慎'=>'慎','愈'=>'愈','憎'=>'憎','慠'=>'慠','懲'=>'懲','戴'=>'戴','ïª'=>'ïª','搜'=>'搜','ïª'=>'ïª','ïª'=>'ïª','晴'=>'晴','朗'=>'朗','望'=>'望','杖'=>'杖','歹'=>'歹','殺'=>'殺','流'=>'流','滛'=>'滛','滋'=>'滋','漢'=>'漢','瀞'=>'瀞','煮'=>'煮','ïª'=>'ïª','爵'=>'爵','犯'=>'犯','猪'=>'猪','瑱'=>'瑱','甆'=>'甆','画'=>'画','瘝'=>'瘝','瘟'=>'瘟','益'=>'益','盛'=>'盛','直'=>'直','睊'=>'睊','着'=>'着','磌'=>'磌','窱'=>'窱','節'=>'節','类'=>'类','絛'=>'絛','練'=>'練','缾'=>'缾','者'=>'者','荒'=>'荒','華'=>'華','蝹'=>'蝹','襁'=>'襁','覆'=>'覆','視'=>'視','調'=>'調','諸'=>'諸','請'=>'請','謁'=>'謁','諾'=>'諾','諭'=>'諭','謹'=>'謹','ï«€'=>'ï«€','ï«'=>'ï«','ï«‚'=>'ï«‚','遲'=>'遲','ï«„'=>'ï«„','ï«…'=>'ï«…','陼'=>'陼','難'=>'難','靖'=>'靖','韛'=>'韛','ï«Š'=>'ï«Š','ï«‹'=>'ï«‹','ï«Œ'=>'ï«Œ','ï«'=>'ï«','ï«Ž'=>'ï«Ž','ï«'=>'ï«','ï«'=>'ï«','ï«‘'=>'ï«‘','ï«’'=>'ï«’','ï«“'=>'ï«“','ï«”'=>'ï«”','ï«•'=>'ï«•','ï«–'=>'ï«–','ï«—'=>'ï«—','齃'=>'齃','ï«™'=>'ï«™','ff'=>'ff','ï¬'=>'fi','fl'=>'fl','ffi'=>'ffi','ffl'=>'ffl','ſt'=>'ſt','st'=>'st','ﬓ'=>'ﬓ','ﬔ'=>'ﬔ','ﬕ'=>'ﬕ','ﬖ'=>'ﬖ','ﬗ'=>'ﬗ','ï¬'=>'ï¬','ﬞ'=>'ﬞ','ײַ'=>'ײַ','ﬠ'=>'ﬠ','ﬡ'=>'ﬡ','ﬢ'=>'ﬢ','ﬣ'=>'ﬣ','ﬤ'=>'ﬤ','ﬥ'=>'ﬥ','ﬦ'=>'ﬦ','ﬧ'=>'ﬧ','ﬨ'=>'ﬨ','שׁ'=>'שׁ','שׂ'=>'שׂ','שּׁ'=>'שּׁ','שּׂ'=>'שּׂ','אַ'=>'אַ','אָ'=>'אָ','אּ'=>'אּ','בּ'=>'בּ','גּ'=>'גּ','דּ'=>'דּ','הּ'=>'הּ','וּ'=>'וּ','זּ'=>'זּ','טּ'=>'טּ','יּ'=>'יּ','ךּ'=>'ךּ','כּ'=>'כּ','לּ'=>'לּ','מּ'=>'מּ','ï­€'=>'ï­€','ï­'=>'ï­','ï­ƒ'=>'ï­ƒ','ï­„'=>'ï­„','ï­†'=>'ï­†','ï­‡'=>'ï­‡','ï­ˆ'=>'ï­ˆ','ï­‰'=>'ï­‰','ï­Š'=>'ï­Š','ï­‹'=>'ï­‹','ï­Œ'=>'ï­Œ','ï­'=>'ï­','ï­Ž'=>'ï­Ž','ï­'=>'ï­','ï­'=>'ï­','ï­‘'=>'ï­‘','ï­’'=>'ï­’','ï­“'=>'ï­“','ï­”'=>'ï­”','ï­•'=>'ï­•','ï­–'=>'ï­–','ï­—'=>'ï­—','ï­˜'=>'ï­˜','ï­™'=>'ï­™','ï­š'=>'ï­š','ï­›'=>'ï­›','ï­œ'=>'ï­œ','ï­'=>'ï­','ï­ž'=>'ï­ž','ï­Ÿ'=>'ï­Ÿ','ï­ '=>'ï­ ','ï­¡'=>'ï­¡','ï­¢'=>'ï­¢','ï­£'=>'ï­£','ï­¤'=>'ï­¤','ï­¥'=>'ï­¥','ï­¦'=>'ï­¦','ï­§'=>'ï­§','ï­¨'=>'ï­¨','ï­©'=>'ï­©','ï­ª'=>'ï­ª','ï­«'=>'ï­«','ï­¬'=>'ï­¬','ï­­'=>'ï­­','ï­®'=>'ï­®','ï­¯'=>'ï­¯','ï­°'=>'ï­°','ï­±'=>'ï­±','ï­²'=>'ï­²','ï­³'=>'ï­³','ï­´'=>'ï­´','ï­µ'=>'ï­µ','ï­¶'=>'ï­¶','ï­·'=>'ï­·','ï­¸'=>'ï­¸','ï­¹'=>'ï­¹','ï­º'=>'ï­º','ï­»'=>'ï­»','ï­¼'=>'ï­¼','ï­½'=>'ï­½','ï­¾'=>'ï­¾','ï­¿'=>'ï­¿','ﮀ'=>'ﮀ','ï®'=>'ï®','ﮂ'=>'ﮂ','ﮃ'=>'ﮃ','ﮄ'=>'ﮄ','ï®…'=>'ï®…','ﮆ'=>'ﮆ','ﮇ'=>'ﮇ','ﮈ'=>'ﮈ','ﮉ'=>'ﮉ','ﮊ'=>'ﮊ','ﮋ'=>'ﮋ','ﮌ'=>'ﮌ','ï®'=>'ï®','ﮎ'=>'ﮎ','ï®'=>'ï®','ï®'=>'ï®','ﮑ'=>'ﮑ','ï®’'=>'ï®’','ﮓ'=>'ﮓ','ï®”'=>'ï®”','ﮕ'=>'ﮕ','ï®–'=>'ï®–','ï®—'=>'ï®—','ﮘ'=>'ﮘ','ï®™'=>'ï®™','ﮚ'=>'ﮚ','ï®›'=>'ï®›','ﮜ'=>'ﮜ','ï®'=>'ï®','ﮞ'=>'ﮞ','ﮟ'=>'ﮟ','ï® '=>'ï® ','ﮡ'=>'ﮡ','ﮢ'=>'ﮢ','ﮣ'=>'ﮣ','ﮤ'=>'ﮤ','ﮥ'=>'ﮥ','ﮦ'=>'ﮦ','ﮧ'=>'ﮧ','ﮨ'=>'ﮨ','ﮩ'=>'ﮩ','ﮪ'=>'ﮪ','ﮫ'=>'ﮫ','ﮬ'=>'ﮬ','ï®­'=>'ï®­','ï®®'=>'ï®®','ﮯ'=>'ﮯ','ï®°'=>'ï®°','ï®±'=>'ï®±','ﯓ'=>'ﯓ','ﯔ'=>'ﯔ','ﯕ'=>'ﯕ','ﯖ'=>'ﯖ','ﯗ'=>'ﯗ','ﯘ'=>'ﯘ','ﯙ'=>'ﯙ','ﯚ'=>'ﯚ','ﯛ'=>'ﯛ','ﯜ'=>'ﯜ','ï¯'=>'ï¯','ﯞ'=>'ﯞ','ﯟ'=>'ﯟ','ﯠ'=>'ﯠ','ﯡ'=>'ﯡ','ﯢ'=>'ﯢ','ﯣ'=>'ﯣ','ﯤ'=>'ﯤ','ﯥ'=>'ﯥ','ﯦ'=>'ﯦ','ﯧ'=>'ﯧ','ﯨ'=>'ﯨ','ﯩ'=>'ﯩ','ﯪ'=>'ﯪ','ﯫ'=>'ﯫ','ﯬ'=>'ﯬ','ﯭ'=>'ﯭ','ﯮ'=>'ﯮ','ﯯ'=>'ﯯ','ﯰ'=>'ﯰ','ﯱ'=>'ﯱ','ﯲ'=>'ﯲ','ﯳ'=>'ﯳ','ﯴ'=>'ﯴ','ﯵ'=>'ﯵ','ﯶ'=>'ﯶ','ﯷ'=>'ﯷ','ﯸ'=>'ﯸ','ﯹ'=>'ﯹ','ﯺ'=>'ﯺ','ﯻ'=>'ﯻ','ﯼ'=>'ﯼ','ﯽ'=>'ﯽ','ﯾ'=>'ﯾ','ﯿ'=>'ﯿ','ï°€'=>'ï°€','ï°'=>'ï°','ï°‚'=>'ï°‚','ï°ƒ'=>'ï°ƒ','ï°„'=>'ï°„','ï°…'=>'ï°…','ï°†'=>'ï°†','ï°‡'=>'ï°‡','ï°ˆ'=>'ï°ˆ','ï°‰'=>'ï°‰','ï°Š'=>'ï°Š','ï°‹'=>'ï°‹','ï°Œ'=>'ï°Œ','ï°'=>'ï°','ï°Ž'=>'ï°Ž','ï°'=>'ï°','ï°'=>'ï°','ï°‘'=>'ï°‘','ï°’'=>'ï°’','ï°“'=>'ï°“','ï°”'=>'ï°”','ï°•'=>'ï°•','ï°–'=>'ï°–','ï°—'=>'ï°—','ï°˜'=>'ï°˜','ï°™'=>'ï°™','ï°š'=>'ï°š','ï°›'=>'ï°›','ï°œ'=>'ï°œ','ï°'=>'ï°','ï°ž'=>'ï°ž','ï°Ÿ'=>'ï°Ÿ','ï° '=>'ï° ','ï°¡'=>'ï°¡','ï°¢'=>'ï°¢','ï°£'=>'ï°£','ï°¤'=>'ï°¤','ï°¥'=>'ï°¥','ï°¦'=>'ï°¦','ï°§'=>'ï°§','ï°¨'=>'ï°¨','ï°©'=>'ï°©','ï°ª'=>'ï°ª','ï°«'=>'ï°«','ï°¬'=>'ï°¬','ï°­'=>'ï°­','ï°®'=>'ï°®','ï°¯'=>'ï°¯','ï°°'=>'ï°°','ï°±'=>'ï°±','ï°²'=>'ï°²','ï°³'=>'ï°³','ï°´'=>'ï°´','ï°µ'=>'ï°µ','ï°¶'=>'ï°¶','ï°·'=>'ï°·','ï°¸'=>'ï°¸','ï°¹'=>'ï°¹','ï°º'=>'ï°º','ï°»'=>'ï°»','ï°¼'=>'ï°¼','ï°½'=>'ï°½','ï°¾'=>'ï°¾','ï°¿'=>'ï°¿','ï±€'=>'ï±€','ï±'=>'ï±','ﱂ'=>'ﱂ','ﱃ'=>'ﱃ','ﱄ'=>'ﱄ','ï±…'=>'ï±…','ﱆ'=>'ﱆ','ﱇ'=>'ﱇ','ﱈ'=>'ﱈ','ﱉ'=>'ﱉ','ﱊ'=>'ﱊ','ﱋ'=>'ﱋ','ﱌ'=>'ﱌ','ï±'=>'ï±','ﱎ'=>'ﱎ','ï±'=>'ï±','ï±'=>'ï±','ﱑ'=>'ﱑ','ï±’'=>'ï±’','ﱓ'=>'ﱓ','ï±”'=>'ï±”','ﱕ'=>'ﱕ','ï±–'=>'ï±–','ï±—'=>'ï±—','ﱘ'=>'ﱘ','ï±™'=>'ï±™','ﱚ'=>'ﱚ','ï±›'=>'ï±›','ﱜ'=>'ﱜ','ï±'=>'ï±','ﱞ'=>'ﱞ','ﱟ'=>'ﱟ','ï± '=>'ï± ','ﱡ'=>'ﱡ','ï±¢'=>'ï±¢','ï±£'=>'ï±£','ﱤ'=>'ﱤ','ï±¥'=>'ï±¥','ﱦ'=>'ﱦ','ﱧ'=>'ﱧ','ﱨ'=>'ﱨ','ﱩ'=>'ﱩ','ﱪ'=>'ﱪ','ﱫ'=>'ﱫ','ﱬ'=>'ﱬ','ï±­'=>'ï±­','ï±®'=>'ï±®','ﱯ'=>'ﱯ','ï±°'=>'ï±°','ï±±'=>'ï±±','ï±²'=>'ï±²','ï±³'=>'ï±³','ï±´'=>'ï±´','ï±µ'=>'ï±µ','ﱶ'=>'ﱶ','ï±·'=>'ï±·','ﱸ'=>'ﱸ','ï±¹'=>'ï±¹','ﱺ'=>'ﱺ','ï±»'=>'ï±»','ï±¼'=>'ï±¼','ï±½'=>'ï±½','ï±¾'=>'ï±¾','ﱿ'=>'ﱿ','ï²€'=>'ï²€','ï²'=>'ï²','ﲂ'=>'ﲂ','ﲃ'=>'ﲃ','ﲄ'=>'ﲄ','ï²…'=>'ï²…','ﲆ'=>'ﲆ','ﲇ'=>'ﲇ','ﲈ'=>'ﲈ','ﲉ'=>'ﲉ','ﲊ'=>'ﲊ','ﲋ'=>'ﲋ','ﲌ'=>'ﲌ','ï²'=>'ï²','ﲎ'=>'ﲎ','ï²'=>'ï²','ï²'=>'ï²','ﲑ'=>'ﲑ','ï²’'=>'ï²’','ﲓ'=>'ﲓ','ï²”'=>'ï²”','ﲕ'=>'ﲕ','ï²–'=>'ï²–','ï²—'=>'ï²—','ﲘ'=>'ﲘ','ï²™'=>'ï²™','ﲚ'=>'ﲚ','ï²›'=>'ï²›','ﲜ'=>'ﲜ','ï²'=>'ï²','ﲞ'=>'ﲞ','ﲟ'=>'ﲟ','ï² '=>'ï² ','ﲡ'=>'ﲡ','ï²¢'=>'ï²¢','ï²£'=>'ï²£','ﲤ'=>'ﲤ','ï²¥'=>'ï²¥','ﲦ'=>'ﲦ','ﲧ'=>'ﲧ','ﲨ'=>'ﲨ','ﲩ'=>'ﲩ','ﲪ'=>'ﲪ','ﲫ'=>'ﲫ','ﲬ'=>'ﲬ','ï²­'=>'ï²­','ï²®'=>'ï²®','ﲯ'=>'ﲯ','ï²°'=>'ï²°','ï²±'=>'ï²±','ï²²'=>'ï²²','ï²³'=>'ï²³','ï²´'=>'ï²´','ï²µ'=>'ï²µ','ﲶ'=>'ﲶ','ï²·'=>'ï²·','ﲸ'=>'ﲸ','ï²¹'=>'ï²¹','ﲺ'=>'ﲺ','ï²»'=>'ï²»','ï²¼'=>'ï²¼','ï²½'=>'ï²½','ï²¾'=>'ï²¾','ﲿ'=>'ﲿ','ï³€'=>'ï³€','ï³'=>'ï³','ﳂ'=>'ﳂ','ﳃ'=>'ﳃ','ﳄ'=>'ﳄ','ï³…'=>'ï³…','ﳆ'=>'ﳆ','ﳇ'=>'ﳇ','ﳈ'=>'ﳈ','ﳉ'=>'ﳉ','ﳊ'=>'ﳊ','ﳋ'=>'ﳋ','ﳌ'=>'ﳌ','ï³'=>'ï³','ﳎ'=>'ﳎ','ï³'=>'ï³','ï³'=>'ï³','ﳑ'=>'ﳑ','ï³’'=>'ï³’','ﳓ'=>'ﳓ','ï³”'=>'ï³”','ﳕ'=>'ﳕ','ï³–'=>'ï³–','ï³—'=>'ï³—','ﳘ'=>'ﳘ','ï³™'=>'ï³™','ﳚ'=>'ﳚ','ï³›'=>'ï³›','ﳜ'=>'ﳜ','ï³'=>'ï³','ﳞ'=>'ﳞ','ﳟ'=>'ﳟ','ï³ '=>'ï³ ','ﳡ'=>'ﳡ','ï³¢'=>'ï³¢','ï³£'=>'ï³£','ﳤ'=>'ﳤ','ï³¥'=>'ï³¥','ﳦ'=>'ﳦ','ﳧ'=>'ﳧ','ﳨ'=>'ﳨ','ﳩ'=>'ﳩ','ﳪ'=>'ﳪ','ﳫ'=>'ﳫ','ﳬ'=>'ﳬ','ï³­'=>'ï³­','ï³®'=>'ï³®','ﳯ'=>'ﳯ','ï³°'=>'ï³°','ï³±'=>'ï³±','ï³²'=>'ï³²','ï³³'=>'ï³³','ï³´'=>'ï³´','ï³µ'=>'ï³µ','ﳶ'=>'ﳶ','ï³·'=>'ï³·','ﳸ'=>'ﳸ','ï³¹'=>'ï³¹','ﳺ'=>'ﳺ','ï³»'=>'ï³»','ï³¼'=>'ï³¼','ï³½'=>'ï³½','ï³¾'=>'ï³¾','ﳿ'=>'ﳿ','ï´€'=>'ï´€','ï´'=>'ï´','ï´‚'=>'ï´‚','ï´ƒ'=>'ï´ƒ','ï´„'=>'ï´„','ï´…'=>'ï´…','ï´†'=>'ï´†','ï´‡'=>'ï´‡','ï´ˆ'=>'ï´ˆ','ï´‰'=>'ï´‰','ï´Š'=>'ï´Š','ï´‹'=>'ï´‹','ï´Œ'=>'ï´Œ','ï´'=>'ï´','ï´Ž'=>'ï´Ž','ï´'=>'ï´','ï´'=>'ï´','ï´‘'=>'ï´‘','ï´’'=>'ï´’','ï´“'=>'ï´“','ï´”'=>'ï´”','ï´•'=>'ï´•','ï´–'=>'ï´–','ï´—'=>'ï´—','ï´˜'=>'ï´˜','ï´™'=>'ï´™','ï´š'=>'ï´š','ï´›'=>'ï´›','ï´œ'=>'ï´œ','ï´'=>'ï´','ï´ž'=>'ï´ž','ï´Ÿ'=>'ï´Ÿ','ï´ '=>'ï´ ','ï´¡'=>'ï´¡','ï´¢'=>'ï´¢','ï´£'=>'ï´£','ï´¤'=>'ï´¤','ï´¥'=>'ï´¥','ï´¦'=>'ï´¦','ï´§'=>'ï´§','ï´¨'=>'ï´¨','ï´©'=>'ï´©','ï´ª'=>'ï´ª','ï´«'=>'ï´«','ï´¬'=>'ï´¬','ï´­'=>'ï´­','ï´®'=>'ï´®','ï´¯'=>'ï´¯','ï´°'=>'ï´°','ï´±'=>'ï´±','ï´²'=>'ï´²','ï´³'=>'ï´³','ï´´'=>'ï´´','ï´µ'=>'ï´µ','ï´¶'=>'ï´¶','ï´·'=>'ï´·','ï´¸'=>'ï´¸','ï´¹'=>'ï´¹','ï´º'=>'ï´º','ï´»'=>'ï´»','ï´¼'=>'ï´¼','ï´½'=>'ï´½','ïµ'=>'ïµ','ﵑ'=>'ﵑ','ïµ’'=>'ïµ’','ﵓ'=>'ﵓ','ïµ”'=>'ïµ”','ﵕ'=>'ﵕ','ïµ–'=>'ïµ–','ïµ—'=>'ïµ—','ﵘ'=>'ﵘ','ïµ™'=>'ïµ™','ﵚ'=>'ﵚ','ïµ›'=>'ïµ›','ﵜ'=>'ﵜ','ïµ'=>'ïµ','ﵞ'=>'ﵞ','ﵟ'=>'ﵟ','ïµ '=>'ïµ ','ﵡ'=>'ﵡ','ïµ¢'=>'ïµ¢','ïµ£'=>'ïµ£','ﵤ'=>'ﵤ','ïµ¥'=>'ïµ¥','ﵦ'=>'ﵦ','ﵧ'=>'ﵧ','ﵨ'=>'ﵨ','ﵩ'=>'ﵩ','ﵪ'=>'ﵪ','ﵫ'=>'ﵫ','ﵬ'=>'ﵬ','ïµ­'=>'ïµ­','ïµ®'=>'ïµ®','ﵯ'=>'ﵯ','ïµ°'=>'ïµ°','ïµ±'=>'ïµ±','ïµ²'=>'ïµ²','ïµ³'=>'ïµ³','ïµ´'=>'ïµ´','ïµµ'=>'ïµµ','ﵶ'=>'ﵶ','ïµ·'=>'ïµ·','ﵸ'=>'ﵸ','ïµ¹'=>'ïµ¹','ﵺ'=>'ﵺ','ïµ»'=>'ïµ»','ïµ¼'=>'ïµ¼','ïµ½'=>'ïµ½','ïµ¾'=>'ïµ¾','ﵿ'=>'ﵿ','ﶀ'=>'ﶀ','ï¶'=>'ï¶','ﶂ'=>'ﶂ','ﶃ'=>'ﶃ','ﶄ'=>'ﶄ','ﶅ'=>'ﶅ','ﶆ'=>'ﶆ','ﶇ'=>'ﶇ','ﶈ'=>'ﶈ','ﶉ'=>'ﶉ','ﶊ'=>'ﶊ','ﶋ'=>'ﶋ','ﶌ'=>'ﶌ','ï¶'=>'ï¶','ﶎ'=>'ﶎ','ï¶'=>'ï¶','ﶒ'=>'ﶒ','ﶓ'=>'ﶓ','ﶔ'=>'ﶔ','ﶕ'=>'ﶕ','ﶖ'=>'ﶖ','ﶗ'=>'ﶗ','ﶘ'=>'ﶘ','ﶙ'=>'ﶙ','ﶚ'=>'ﶚ','ﶛ'=>'ﶛ','ﶜ'=>'ﶜ','ï¶'=>'ï¶','ﶞ'=>'ﶞ','ﶟ'=>'ﶟ','ﶠ'=>'ﶠ','ﶡ'=>'ﶡ','ﶢ'=>'ﶢ','ﶣ'=>'ﶣ','ﶤ'=>'ﶤ','ﶥ'=>'ﶥ','ﶦ'=>'ﶦ','ﶧ'=>'ﶧ','ﶨ'=>'ﶨ','ﶩ'=>'ﶩ','ﶪ'=>'ﶪ','ﶫ'=>'ﶫ','ﶬ'=>'ﶬ','ﶭ'=>'ﶭ','ﶮ'=>'ﶮ','ﶯ'=>'ﶯ','ﶰ'=>'ﶰ','ﶱ'=>'ﶱ','ﶲ'=>'ﶲ','ﶳ'=>'ﶳ','ﶴ'=>'ﶴ','ﶵ'=>'ﶵ','ﶶ'=>'ﶶ','ﶷ'=>'ﶷ','ﶸ'=>'ﶸ','ﶹ'=>'ﶹ','ﶺ'=>'ﶺ','ﶻ'=>'ﶻ','ﶼ'=>'ﶼ','ﶽ'=>'ﶽ','ﶾ'=>'ﶾ','ﶿ'=>'ﶿ','ï·€'=>'ï·€','ï·'=>'ï·','ï·‚'=>'ï·‚','ï·ƒ'=>'ï·ƒ','ï·„'=>'ï·„','ï·…'=>'ï·…','ï·†'=>'ï·†','ï·‡'=>'ï·‡','ï·°'=>'ï·°','ï·±'=>'ï·±','ï·²'=>'ï·²','ï·³'=>'ï·³','ï·´'=>'ï·´','ï·µ'=>'ï·µ','ï·¶'=>'ï·¶','ï··'=>'ï··','ï·¸'=>'ï·¸','ï·¹'=>'ï·¹','ï·º'=>'ï·º','ï·»'=>'ï·»','︀'=>'︀','ï¸'=>'ï¸','︂'=>'︂','︃'=>'︃','︄'=>'︄','︅'=>'︅','︆'=>'︆','︇'=>'︇','︈'=>'︈','︉'=>'︉','︊'=>'︊','︋'=>'︋','︌'=>'︌','ï¸'=>'ï¸','︎'=>'︎','ï¸'=>'ï¸','︠'=>'︠','︡'=>'︡','︢'=>'︢','︣'=>'︣','ï¹°'=>'ï¹°','ï¹±'=>'ï¹±','ï¹²'=>'ï¹²','ï¹³'=>'ï¹³','ï¹´'=>'ï¹´','ﹶ'=>'ﹶ','ï¹·'=>'ï¹·','ﹸ'=>'ﹸ','ï¹¹'=>'ï¹¹','ﹺ'=>'ﹺ','ï¹»'=>'ï¹»','ï¹¼'=>'ï¹¼','ï¹½'=>'ï¹½','ï¹¾'=>'ï¹¾','ﹿ'=>'ﹿ','ﺀ'=>'ﺀ','ïº'=>'ïº','ﺂ'=>'ﺂ','ﺃ'=>'ﺃ','ﺄ'=>'ﺄ','ﺅ'=>'ﺅ','ﺆ'=>'ﺆ','ﺇ'=>'ﺇ','ﺈ'=>'ﺈ','ﺉ'=>'ﺉ','ﺊ'=>'ﺊ','ﺋ'=>'ﺋ','ﺌ'=>'ﺌ','ïº'=>'ïº','ﺎ'=>'ﺎ','ïº'=>'ïº','ïº'=>'ïº','ﺑ'=>'ﺑ','ﺒ'=>'ﺒ','ﺓ'=>'ﺓ','ﺔ'=>'ﺔ','ﺕ'=>'ﺕ','ﺖ'=>'ﺖ','ﺗ'=>'ﺗ','ﺘ'=>'ﺘ','ﺙ'=>'ﺙ','ﺚ'=>'ﺚ','ﺛ'=>'ﺛ','ﺜ'=>'ﺜ','ïº'=>'ïº','ﺞ'=>'ﺞ','ﺟ'=>'ﺟ','ﺠ'=>'ﺠ','ﺡ'=>'ﺡ','ﺢ'=>'ﺢ','ﺣ'=>'ﺣ','ﺤ'=>'ﺤ','ﺥ'=>'ﺥ','ﺦ'=>'ﺦ','ﺧ'=>'ﺧ','ﺨ'=>'ﺨ','ﺩ'=>'ﺩ','ﺪ'=>'ﺪ','ﺫ'=>'ﺫ','ﺬ'=>'ﺬ','ﺭ'=>'ﺭ','ﺮ'=>'ﺮ','ﺯ'=>'ﺯ','ﺰ'=>'ﺰ','ﺱ'=>'ﺱ','ﺲ'=>'ﺲ','ﺳ'=>'ﺳ','ﺴ'=>'ﺴ','ﺵ'=>'ﺵ','ﺶ'=>'ﺶ','ﺷ'=>'ﺷ','ﺸ'=>'ﺸ','ﺹ'=>'ﺹ','ﺺ'=>'ﺺ','ﺻ'=>'ﺻ','ﺼ'=>'ﺼ','ﺽ'=>'ﺽ','ﺾ'=>'ﺾ','ﺿ'=>'ﺿ','ﻀ'=>'ﻀ','ï»'=>'ï»','ﻂ'=>'ﻂ','ﻃ'=>'ﻃ','ﻄ'=>'ﻄ','ï»…'=>'ï»…','ﻆ'=>'ﻆ','ﻇ'=>'ﻇ','ﻈ'=>'ﻈ','ﻉ'=>'ﻉ','ﻊ'=>'ﻊ','ﻋ'=>'ﻋ','ﻌ'=>'ﻌ','ï»'=>'ï»','ﻎ'=>'ﻎ','ï»'=>'ï»','ï»'=>'ï»','ﻑ'=>'ﻑ','ï»’'=>'ï»’','ﻓ'=>'ﻓ','ï»”'=>'ï»”','ﻕ'=>'ﻕ','ï»–'=>'ï»–','ï»—'=>'ï»—','ﻘ'=>'ﻘ','ï»™'=>'ï»™','ﻚ'=>'ﻚ','ï»›'=>'ï»›','ﻜ'=>'ﻜ','ï»'=>'ï»','ﻞ'=>'ﻞ','ﻟ'=>'ﻟ','ï» '=>'ï» ','ﻡ'=>'ﻡ','ﻢ'=>'ﻢ','ﻣ'=>'ﻣ','ﻤ'=>'ﻤ','ﻥ'=>'ﻥ','ﻦ'=>'ﻦ','ﻧ'=>'ﻧ','ﻨ'=>'ﻨ','ﻩ'=>'ﻩ','ﻪ'=>'ﻪ','ﻫ'=>'ﻫ','ﻬ'=>'ﻬ','ï»­'=>'ï»­','ï»®'=>'ï»®','ﻯ'=>'ﻯ','ï»°'=>'ï»°','ï»±'=>'ï»±','ﻲ'=>'ﻲ','ﻳ'=>'ﻳ','ï»´'=>'ï»´','ﻵ'=>'ﻵ','ﻶ'=>'ﻶ','ï»·'=>'ï»·','ﻸ'=>'ﻸ','ﻹ'=>'ﻹ','ﻺ'=>'ﻺ','ï»»'=>'ï»»','ﻼ'=>'ﻼ','ï¼'=>'0','1'=>'1','ï¼’'=>'2','3'=>'3','ï¼”'=>'4','5'=>'5','ï¼–'=>'6','ï¼—'=>'7','8'=>'8','ï¼™'=>'9','A'=>'ï½','ï¼¢'=>'b','ï¼£'=>'c','D'=>'d','ï¼¥'=>'ï½…','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','ï¼­'=>'ï½','ï¼®'=>'n','O'=>'ï½','ï¼°'=>'ï½','ï¼±'=>'q','ï¼²'=>'ï½’','ï¼³'=>'s','ï¼´'=>'ï½”','ï¼µ'=>'u','V'=>'ï½–','ï¼·'=>'ï½—','X'=>'x','ï¼¹'=>'ï½™','Z'=>'z','ï½'=>'ï½','b'=>'b','c'=>'c','d'=>'d','ï½…'=>'ï½…','f'=>'f','g'=>'g','h'=>'h','i'=>'i','j'=>'j','k'=>'k','l'=>'l','ï½'=>'ï½','n'=>'n','ï½'=>'ï½','ï½'=>'ï½','q'=>'q','ï½’'=>'ï½’','s'=>'s','ï½”'=>'ï½”','u'=>'u','ï½–'=>'ï½–','ï½—'=>'ï½—','x'=>'x','ï½™'=>'ï½™','z'=>'z','ヲ'=>'ヲ','ァ'=>'ァ','ィ'=>'ィ','ゥ'=>'ゥ','ェ'=>'ェ','ォ'=>'ォ','ャ'=>'ャ','ï½­'=>'ï½­','ï½®'=>'ï½®','ッ'=>'ッ','ï½°'=>'ï½°','ï½±'=>'ï½±','ï½²'=>'ï½²','ï½³'=>'ï½³','ï½´'=>'ï½´','ï½µ'=>'ï½µ','カ'=>'カ','ï½·'=>'ï½·','ク'=>'ク','ï½¹'=>'ï½¹','コ'=>'コ','ï½»'=>'ï½»','ï½¼'=>'ï½¼','ï½½'=>'ï½½','ï½¾'=>'ï½¾','ソ'=>'ソ','ï¾€'=>'ï¾€','ï¾'=>'ï¾','ツ'=>'ツ','テ'=>'テ','ト'=>'ト','ï¾…'=>'ï¾…','ニ'=>'ニ','ヌ'=>'ヌ','ネ'=>'ネ','ノ'=>'ノ','ハ'=>'ハ','ヒ'=>'ヒ','フ'=>'フ','ï¾'=>'ï¾','ホ'=>'ホ','ï¾'=>'ï¾','ï¾'=>'ï¾','ム'=>'ム','ï¾’'=>'ï¾’','モ'=>'モ','ï¾”'=>'ï¾”','ユ'=>'ユ','ï¾–'=>'ï¾–','ï¾—'=>'ï¾—','リ'=>'リ','ï¾™'=>'ï¾™','レ'=>'レ','ï¾›'=>'ï¾›','ワ'=>'ワ','ï¾'=>'ï¾','゙'=>'゙','゚'=>'゚','ï¾ '=>'ï¾ ','ᄀ'=>'ᄀ','ï¾¢'=>'ï¾¢','ï¾£'=>'ï¾£','ᄂ'=>'ᄂ','ï¾¥'=>'ï¾¥','ᆭ'=>'ᆭ','ᄃ'=>'ᄃ','ᄄ'=>'ᄄ','ᄅ'=>'ᄅ','ᆰ'=>'ᆰ','ᆱ'=>'ᆱ','ᆲ'=>'ᆲ','ï¾­'=>'ï¾­','ï¾®'=>'ï¾®','ᆵ'=>'ᆵ','ï¾°'=>'ï¾°','ï¾±'=>'ï¾±','ï¾²'=>'ï¾²','ï¾³'=>'ï¾³','ï¾´'=>'ï¾´','ï¾µ'=>'ï¾µ','ᄊ'=>'ᄊ','ï¾·'=>'ï¾·','ᄌ'=>'ᄌ','ï¾¹'=>'ï¾¹','ᄎ'=>'ᄎ','ï¾»'=>'ï¾»','ï¾¼'=>'ï¾¼','ï¾½'=>'ï¾½','ï¾¾'=>'ï¾¾','ï¿‚'=>'ï¿‚','ᅢ'=>'ᅢ','ï¿„'=>'ï¿„','ï¿…'=>'ï¿…','ᅥ'=>'ᅥ','ᅦ'=>'ᅦ','ï¿Š'=>'ï¿Š','ï¿‹'=>'ï¿‹','ï¿Œ'=>'ï¿Œ','ï¿'=>'ï¿','ï¿Ž'=>'ï¿Ž','ï¿'=>'ï¿','ï¿’'=>'ï¿’','ï¿“'=>'ï¿“','ï¿”'=>'ï¿”','ï¿•'=>'ï¿•','ï¿–'=>'ï¿–','ï¿—'=>'ï¿—','ï¿š'=>'ï¿š','ï¿›'=>'ï¿›','ï¿œ'=>'ï¿œ'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_32.php b/sources/phpBB/includes/utf/data/search_indexer_32.php new file mode 100644 index 0000000..cea5eba --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_32.php @@ -0,0 +1 @@ +'ð€€','ð€'=>'ð€','ð€‚'=>'ð€‚','ð€ƒ'=>'ð€ƒ','ð€„'=>'ð€„','ð€…'=>'ð€…','ð€†'=>'ð€†','ð€‡'=>'ð€‡','ð€ˆ'=>'ð€ˆ','ð€‰'=>'ð€‰','ð€Š'=>'ð€Š','ð€‹'=>'ð€‹','ð€'=>'ð€','ð€Ž'=>'ð€Ž','ð€'=>'ð€','ð€'=>'ð€','ð€‘'=>'ð€‘','ð€’'=>'ð€’','ð€“'=>'ð€“','ð€”'=>'ð€”','ð€•'=>'ð€•','ð€–'=>'ð€–','ð€—'=>'ð€—','ð€˜'=>'ð€˜','ð€™'=>'ð€™','ð€š'=>'ð€š','ð€›'=>'ð€›','ð€œ'=>'ð€œ','ð€'=>'ð€','ð€ž'=>'ð€ž','ð€Ÿ'=>'ð€Ÿ','ð€ '=>'ð€ ','ð€¡'=>'ð€¡','ð€¢'=>'ð€¢','ð€£'=>'ð€£','ð€¤'=>'ð€¤','ð€¥'=>'ð€¥','ð€¦'=>'ð€¦','ð€¨'=>'ð€¨','ð€©'=>'ð€©','ð€ª'=>'ð€ª','ð€«'=>'ð€«','ð€¬'=>'ð€¬','ð€­'=>'ð€­','ð€®'=>'ð€®','ð€¯'=>'ð€¯','ð€°'=>'ð€°','ð€±'=>'ð€±','ð€²'=>'ð€²','ð€³'=>'ð€³','ð€´'=>'ð€´','ð€µ'=>'ð€µ','ð€¶'=>'ð€¶','ð€·'=>'ð€·','ð€¸'=>'ð€¸','ð€¹'=>'ð€¹','ð€º'=>'ð€º','ð€¼'=>'ð€¼','ð€½'=>'ð€½','ð€¿'=>'ð€¿','ð€'=>'ð€','ð'=>'ð','ð‚'=>'ð‚','ðƒ'=>'ðƒ','ð„'=>'ð„','ð…'=>'ð…','ð†'=>'ð†','ð‡'=>'ð‡','ðˆ'=>'ðˆ','ð‰'=>'ð‰','ðŠ'=>'ðŠ','ð‹'=>'ð‹','ðŒ'=>'ðŒ','ð'=>'ð','ð'=>'ð','ð‘'=>'ð‘','ð’'=>'ð’','ð“'=>'ð“','ð”'=>'ð”','ð•'=>'ð•','ð–'=>'ð–','ð—'=>'ð—','ð˜'=>'ð˜','ð™'=>'ð™','ðš'=>'ðš','ð›'=>'ð›','ðœ'=>'ðœ','ð'=>'ð','ð‚€'=>'ð‚€','ð‚'=>'ð‚','ð‚‚'=>'ð‚‚','ð‚ƒ'=>'ð‚ƒ','ð‚„'=>'ð‚„','ð‚…'=>'ð‚…','ð‚†'=>'ð‚†','ð‚‡'=>'ð‚‡','ð‚ˆ'=>'ð‚ˆ','ð‚‰'=>'ð‚‰','ð‚Š'=>'ð‚Š','ð‚‹'=>'ð‚‹','ð‚Œ'=>'ð‚Œ','ð‚'=>'ð‚','ð‚Ž'=>'ð‚Ž','ð‚'=>'ð‚','ð‚'=>'ð‚','ð‚‘'=>'ð‚‘','ð‚’'=>'ð‚’','ð‚“'=>'ð‚“','ð‚”'=>'ð‚”','ð‚•'=>'ð‚•','ð‚–'=>'ð‚–','ð‚—'=>'ð‚—','ð‚˜'=>'ð‚˜','ð‚™'=>'ð‚™','ð‚š'=>'ð‚š','ð‚›'=>'ð‚›','ð‚œ'=>'ð‚œ','ð‚'=>'ð‚','ð‚ž'=>'ð‚ž','ð‚Ÿ'=>'ð‚Ÿ','ð‚ '=>'ð‚ ','ð‚¡'=>'ð‚¡','ð‚¢'=>'ð‚¢','ð‚£'=>'ð‚£','ð‚¤'=>'ð‚¤','ð‚¥'=>'ð‚¥','ð‚¦'=>'ð‚¦','ð‚§'=>'ð‚§','ð‚¨'=>'ð‚¨','ð‚©'=>'ð‚©','ð‚ª'=>'ð‚ª','ð‚«'=>'ð‚«','ð‚¬'=>'ð‚¬','ð‚­'=>'ð‚­','ð‚®'=>'ð‚®','ð‚¯'=>'ð‚¯','ð‚°'=>'ð‚°','ð‚±'=>'ð‚±','ð‚²'=>'ð‚²','ð‚³'=>'ð‚³','ð‚´'=>'ð‚´','ð‚µ'=>'ð‚µ','ð‚¶'=>'ð‚¶','ð‚·'=>'ð‚·','ð‚¸'=>'ð‚¸','ð‚¹'=>'ð‚¹','ð‚º'=>'ð‚º','ð‚»'=>'ð‚»','ð‚¼'=>'ð‚¼','ð‚½'=>'ð‚½','ð‚¾'=>'ð‚¾','ð‚¿'=>'ð‚¿','ðƒ€'=>'ðƒ€','ðƒ'=>'ðƒ','ðƒ‚'=>'ðƒ‚','ðƒƒ'=>'ðƒƒ','ðƒ„'=>'ðƒ„','ðƒ…'=>'ðƒ…','ðƒ†'=>'ðƒ†','ðƒ‡'=>'ðƒ‡','ðƒˆ'=>'ðƒˆ','ðƒ‰'=>'ðƒ‰','ðƒŠ'=>'ðƒŠ','ðƒ‹'=>'ðƒ‹','ðƒŒ'=>'ðƒŒ','ðƒ'=>'ðƒ','ðƒŽ'=>'ðƒŽ','ðƒ'=>'ðƒ','ðƒ'=>'ðƒ','ðƒ‘'=>'ðƒ‘','ðƒ’'=>'ðƒ’','ðƒ“'=>'ðƒ“','ðƒ”'=>'ðƒ”','ðƒ•'=>'ðƒ•','ðƒ–'=>'ðƒ–','ðƒ—'=>'ðƒ—','ðƒ˜'=>'ðƒ˜','ðƒ™'=>'ðƒ™','ðƒš'=>'ðƒš','ðƒ›'=>'ðƒ›','ðƒœ'=>'ðƒœ','ðƒ'=>'ðƒ','ðƒž'=>'ðƒž','ðƒŸ'=>'ðƒŸ','ðƒ '=>'ðƒ ','ðƒ¡'=>'ðƒ¡','ðƒ¢'=>'ðƒ¢','ðƒ£'=>'ðƒ£','ðƒ¤'=>'ðƒ¤','ðƒ¥'=>'ðƒ¥','ðƒ¦'=>'ðƒ¦','ðƒ§'=>'ðƒ§','ðƒ¨'=>'ðƒ¨','ðƒ©'=>'ðƒ©','ðƒª'=>'ðƒª','ðƒ«'=>'ðƒ«','ðƒ¬'=>'ðƒ¬','ðƒ­'=>'ðƒ­','ðƒ®'=>'ðƒ®','ðƒ¯'=>'ðƒ¯','ðƒ°'=>'ðƒ°','ðƒ±'=>'ðƒ±','ðƒ²'=>'ðƒ²','ðƒ³'=>'ðƒ³','ðƒ´'=>'ðƒ´','ðƒµ'=>'ðƒµ','ðƒ¶'=>'ðƒ¶','ðƒ·'=>'ðƒ·','ðƒ¸'=>'ðƒ¸','ðƒ¹'=>'ðƒ¹','ðƒº'=>'ðƒº','ð„‡'=>'1','ð„ˆ'=>'2','ð„‰'=>'3','ð„Š'=>'4','ð„‹'=>'5','ð„Œ'=>'6','ð„'=>'7','ð„Ž'=>'8','ð„'=>'9','ð„'=>'10','ð„‘'=>'20','ð„’'=>'30','ð„“'=>'40','ð„”'=>'50','ð„•'=>'60','ð„–'=>'70','ð„—'=>'80','ð„˜'=>'90','ð„™'=>'100','ð„š'=>'200','ð„›'=>'300','ð„œ'=>'400','ð„'=>'500','ð„ž'=>'600','ð„Ÿ'=>'700','ð„ '=>'800','ð„¡'=>'900','ð„¢'=>'1000','ð„£'=>'2000','ð„¤'=>'3000','ð„¥'=>'4000','ð„¦'=>'5000','ð„§'=>'6000','ð„¨'=>'7000','ð„©'=>'8000','ð„ª'=>'9000','ð„«'=>'10000','ð„¬'=>'20000','ð„­'=>'30000','ð„®'=>'40000','ð„¯'=>'50000','ð„°'=>'60000','ð„±'=>'70000','ð„²'=>'80000','ð„³'=>'90000','ð…€'=>'1/4','ð…'=>'1/2','ð…‚'=>'1','ð…ƒ'=>'5','ð…„'=>'50','ð……'=>'500','ð…†'=>'5000','ð…‡'=>'50000','ð…ˆ'=>'5','ð…‰'=>'10','ð…Š'=>'50','ð…‹'=>'100','ð…Œ'=>'500','ð…'=>'1000','ð…Ž'=>'5000','ð…'=>'5','ð…'=>'10','ð…‘'=>'50','ð…’'=>'100','ð…“'=>'500','ð…”'=>'1000','ð…•'=>'10000','ð…–'=>'50000','ð…—'=>'10','ð…˜'=>'1','ð…™'=>'1','ð…š'=>'1','ð…›'=>'2','ð…œ'=>'2','ð…'=>'2','ð…ž'=>'2','ð…Ÿ'=>'5','ð… '=>'10','ð…¡'=>'10','ð…¢'=>'10','ð…£'=>'10','ð…¤'=>'10','ð…¥'=>'30','ð…¦'=>'50','ð…§'=>'50','ð…¨'=>'50','ð…©'=>'50','ð…ª'=>'100','ð…«'=>'300','ð…¬'=>'500','ð…­'=>'500','ð…®'=>'500','ð…¯'=>'500','ð…°'=>'500','ð…±'=>'1000','ð…²'=>'5000','ð…³'=>'5','ð…´'=>'50','ð…µ'=>'1/2','ð…¶'=>'1/2','ð…·'=>'2/3','ð…¸'=>'3/4','ð†Š'=>'0','ðŒ€'=>'ðŒ€','ðŒ'=>'ðŒ','ðŒ‚'=>'ðŒ‚','ðŒƒ'=>'ðŒƒ','ðŒ„'=>'ðŒ„','ðŒ…'=>'ðŒ…','ðŒ†'=>'ðŒ†','ðŒ‡'=>'ðŒ‡','ðŒˆ'=>'ðŒˆ','ðŒ‰'=>'ðŒ‰','ðŒŠ'=>'ðŒŠ','ðŒ‹'=>'ðŒ‹','ðŒŒ'=>'ðŒŒ','ðŒ'=>'ðŒ','ðŒŽ'=>'ðŒŽ','ðŒ'=>'ðŒ','ðŒ'=>'ðŒ','ðŒ‘'=>'ðŒ‘','ðŒ’'=>'ðŒ’','ðŒ“'=>'ðŒ“','ðŒ”'=>'ðŒ”','ðŒ•'=>'ðŒ•','ðŒ–'=>'ðŒ–','ðŒ—'=>'ðŒ—','ðŒ˜'=>'ðŒ˜','ðŒ™'=>'ðŒ™','ðŒš'=>'ðŒš','ðŒ›'=>'ðŒ›','ðŒœ'=>'ðŒœ','ðŒ'=>'ðŒ','ðŒž'=>'ðŒž','ðŒ '=>'1','ðŒ¡'=>'5','ðŒ¢'=>'10','ðŒ£'=>'50','ðŒ°'=>'ðŒ°','ðŒ±'=>'ðŒ±','ðŒ²'=>'ðŒ²','ðŒ³'=>'ðŒ³','ðŒ´'=>'ðŒ´','ðŒµ'=>'ðŒµ','ðŒ¶'=>'ðŒ¶','ðŒ·'=>'ðŒ·','ðŒ¸'=>'ðŒ¸','ðŒ¹'=>'ðŒ¹','ðŒº'=>'ðŒº','ðŒ»'=>'ðŒ»','ðŒ¼'=>'ðŒ¼','ðŒ½'=>'ðŒ½','ðŒ¾'=>'ðŒ¾','ðŒ¿'=>'ðŒ¿','ð€'=>'ð€','ð'=>'90','ð‚'=>'ð‚','ðƒ'=>'ðƒ','ð„'=>'ð„','ð…'=>'ð…','ð†'=>'ð†','ð‡'=>'ð‡','ðˆ'=>'ðˆ','ð‰'=>'ð‰','ðŠ'=>'900','ðŽ€'=>'ðŽ€','ðŽ'=>'ðŽ','ðŽ‚'=>'ðŽ‚','ðŽƒ'=>'ðŽƒ','ðŽ„'=>'ðŽ„','ðŽ…'=>'ðŽ…','ðŽ†'=>'ðŽ†','ðŽ‡'=>'ðŽ‡','ðŽˆ'=>'ðŽˆ','ðŽ‰'=>'ðŽ‰','ðŽŠ'=>'ðŽŠ','ðŽ‹'=>'ðŽ‹','ðŽŒ'=>'ðŽŒ','ðŽ'=>'ðŽ','ðŽŽ'=>'ðŽŽ','ðŽ'=>'ðŽ','ðŽ'=>'ðŽ','ðŽ‘'=>'ðŽ‘','ðŽ’'=>'ðŽ’','ðŽ“'=>'ðŽ“','ðŽ”'=>'ðŽ”','ðŽ•'=>'ðŽ•','ðŽ–'=>'ðŽ–','ðŽ—'=>'ðŽ—','ðŽ˜'=>'ðŽ˜','ðŽ™'=>'ðŽ™','ðŽš'=>'ðŽš','ðŽ›'=>'ðŽ›','ðŽœ'=>'ðŽœ','ðŽ'=>'ðŽ','ðŽ '=>'ðŽ ','ðŽ¡'=>'ðŽ¡','ðŽ¢'=>'ðŽ¢','ðŽ£'=>'ðŽ£','ðŽ¤'=>'ðŽ¤','ðŽ¥'=>'ðŽ¥','ðŽ¦'=>'ðŽ¦','ðŽ§'=>'ðŽ§','ðŽ¨'=>'ðŽ¨','ðŽ©'=>'ðŽ©','ðŽª'=>'ðŽª','ðŽ«'=>'ðŽ«','ðŽ¬'=>'ðŽ¬','ðŽ­'=>'ðŽ­','ðŽ®'=>'ðŽ®','ðŽ¯'=>'ðŽ¯','ðŽ°'=>'ðŽ°','ðŽ±'=>'ðŽ±','ðŽ²'=>'ðŽ²','ðŽ³'=>'ðŽ³','ðŽ´'=>'ðŽ´','ðŽµ'=>'ðŽµ','ðŽ¶'=>'ðŽ¶','ðŽ·'=>'ðŽ·','ðŽ¸'=>'ðŽ¸','ðŽ¹'=>'ðŽ¹','ðŽº'=>'ðŽº','ðŽ»'=>'ðŽ»','ðŽ¼'=>'ðŽ¼','ðŽ½'=>'ðŽ½','ðŽ¾'=>'ðŽ¾','ðŽ¿'=>'ðŽ¿','ð€'=>'ð€','ð'=>'ð','ð‚'=>'ð‚','ðƒ'=>'ðƒ','ðˆ'=>'ðˆ','ð‰'=>'ð‰','ðŠ'=>'ðŠ','ð‹'=>'ð‹','ðŒ'=>'ðŒ','ð'=>'ð','ðŽ'=>'ðŽ','ð'=>'ð','ð‘'=>'1','ð’'=>'2','ð“'=>'10','ð”'=>'20','ð•'=>'100','ð€'=>'ð¨','ð'=>'ð©','ð‚'=>'ðª','ðƒ'=>'ð«','ð„'=>'ð¬','ð…'=>'ð­','ð†'=>'ð®','ð‡'=>'ð¯','ðˆ'=>'ð°','ð‰'=>'ð±','ðŠ'=>'ð²','ð‹'=>'ð³','ðŒ'=>'ð´','ð'=>'ðµ','ðŽ'=>'ð¶','ð'=>'ð·','ð'=>'ð¸','ð‘'=>'ð¹','ð’'=>'ðº','ð“'=>'ð»','ð”'=>'ð¼','ð•'=>'ð½','ð–'=>'ð¾','ð—'=>'ð¿','ð˜'=>'ð‘€','ð™'=>'ð‘','ðš'=>'ð‘‚','ð›'=>'ð‘ƒ','ðœ'=>'ð‘„','ð'=>'ð‘…','ðž'=>'ð‘†','ðŸ'=>'ð‘‡','ð '=>'ð‘ˆ','ð¡'=>'ð‘‰','ð¢'=>'ð‘Š','ð£'=>'ð‘‹','ð¤'=>'ð‘Œ','ð¥'=>'ð‘','ð¦'=>'ð‘Ž','ð§'=>'ð‘','ð¨'=>'ð¨','ð©'=>'ð©','ðª'=>'ðª','ð«'=>'ð«','ð¬'=>'ð¬','ð­'=>'ð­','ð®'=>'ð®','ð¯'=>'ð¯','ð°'=>'ð°','ð±'=>'ð±','ð²'=>'ð²','ð³'=>'ð³','ð´'=>'ð´','ðµ'=>'ðµ','ð¶'=>'ð¶','ð·'=>'ð·','ð¸'=>'ð¸','ð¹'=>'ð¹','ðº'=>'ðº','ð»'=>'ð»','ð¼'=>'ð¼','ð½'=>'ð½','ð¾'=>'ð¾','ð¿'=>'ð¿','ð‘€'=>'ð‘€','ð‘'=>'ð‘','ð‘‚'=>'ð‘‚','ð‘ƒ'=>'ð‘ƒ','ð‘„'=>'ð‘„','ð‘…'=>'ð‘…','ð‘†'=>'ð‘†','ð‘‡'=>'ð‘‡','ð‘ˆ'=>'ð‘ˆ','ð‘‰'=>'ð‘‰','ð‘Š'=>'ð‘Š','ð‘‹'=>'ð‘‹','ð‘Œ'=>'ð‘Œ','ð‘'=>'ð‘','ð‘Ž'=>'ð‘Ž','ð‘'=>'ð‘','ð‘'=>'ð‘','ð‘‘'=>'ð‘‘','ð‘’'=>'ð‘’','ð‘“'=>'ð‘“','ð‘”'=>'ð‘”','ð‘•'=>'ð‘•','ð‘–'=>'ð‘–','ð‘—'=>'ð‘—','ð‘˜'=>'ð‘˜','ð‘™'=>'ð‘™','ð‘š'=>'ð‘š','ð‘›'=>'ð‘›','ð‘œ'=>'ð‘œ','ð‘'=>'ð‘','ð‘ž'=>'ð‘ž','ð‘Ÿ'=>'ð‘Ÿ','ð‘ '=>'ð‘ ','ð‘¡'=>'ð‘¡','ð‘¢'=>'ð‘¢','ð‘£'=>'ð‘£','ð‘¤'=>'ð‘¤','ð‘¥'=>'ð‘¥','ð‘¦'=>'ð‘¦','ð‘§'=>'ð‘§','ð‘¨'=>'ð‘¨','ð‘©'=>'ð‘©','ð‘ª'=>'ð‘ª','ð‘«'=>'ð‘«','ð‘¬'=>'ð‘¬','ð‘­'=>'ð‘­','ð‘®'=>'ð‘®','ð‘¯'=>'ð‘¯','ð‘°'=>'ð‘°','ð‘±'=>'ð‘±','ð‘²'=>'ð‘²','ð‘³'=>'ð‘³','ð‘´'=>'ð‘´','ð‘µ'=>'ð‘µ','ð‘¶'=>'ð‘¶','ð‘·'=>'ð‘·','ð‘¸'=>'ð‘¸','ð‘¹'=>'ð‘¹','ð‘º'=>'ð‘º','ð‘»'=>'ð‘»','ð‘¼'=>'ð‘¼','ð‘½'=>'ð‘½','ð‘¾'=>'ð‘¾','ð‘¿'=>'ð‘¿','ð’€'=>'ð’€','ð’'=>'ð’','ð’‚'=>'ð’‚','ð’ƒ'=>'ð’ƒ','ð’„'=>'ð’„','ð’…'=>'ð’…','ð’†'=>'ð’†','ð’‡'=>'ð’‡','ð’ˆ'=>'ð’ˆ','ð’‰'=>'ð’‰','ð’Š'=>'ð’Š','ð’‹'=>'ð’‹','ð’Œ'=>'ð’Œ','ð’'=>'ð’','ð’Ž'=>'ð’Ž','ð’'=>'ð’','ð’'=>'ð’','ð’‘'=>'ð’‘','ð’’'=>'ð’’','ð’“'=>'ð’“','ð’”'=>'ð’”','ð’•'=>'ð’•','ð’–'=>'ð’–','ð’—'=>'ð’—','ð’˜'=>'ð’˜','ð’™'=>'ð’™','ð’š'=>'ð’š','ð’›'=>'ð’›','ð’œ'=>'ð’œ','ð’'=>'ð’','ð’ '=>'0','ð’¡'=>'1','ð’¢'=>'2','ð’£'=>'3','ð’¤'=>'4','ð’¥'=>'5','ð’¦'=>'6','ð’§'=>'7','ð’¨'=>'8','ð’©'=>'9'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_33.php b/sources/phpBB/includes/utf/data/search_indexer_33.php new file mode 100644 index 0000000..3b77ca2 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_33.php @@ -0,0 +1 @@ +'ð €','ð '=>'ð ','ð ‚'=>'ð ‚','ð ƒ'=>'ð ƒ','ð „'=>'ð „','ð …'=>'ð …','ð ˆ'=>'ð ˆ','ð Š'=>'ð Š','ð ‹'=>'ð ‹','ð Œ'=>'ð Œ','ð '=>'ð ','ð Ž'=>'ð Ž','ð '=>'ð ','ð '=>'ð ','ð ‘'=>'ð ‘','ð ’'=>'ð ’','ð “'=>'ð “','ð ”'=>'ð ”','ð •'=>'ð •','ð –'=>'ð –','ð —'=>'ð —','ð ˜'=>'ð ˜','ð ™'=>'ð ™','ð š'=>'ð š','ð ›'=>'ð ›','ð œ'=>'ð œ','ð '=>'ð ','ð ž'=>'ð ž','ð Ÿ'=>'ð Ÿ','ð  '=>'ð  ','ð ¡'=>'ð ¡','ð ¢'=>'ð ¢','ð £'=>'ð £','ð ¤'=>'ð ¤','ð ¥'=>'ð ¥','ð ¦'=>'ð ¦','ð §'=>'ð §','ð ¨'=>'ð ¨','ð ©'=>'ð ©','ð ª'=>'ð ª','ð «'=>'ð «','ð ¬'=>'ð ¬','ð ­'=>'ð ­','ð ®'=>'ð ®','ð ¯'=>'ð ¯','ð °'=>'ð °','ð ±'=>'ð ±','ð ²'=>'ð ²','ð ³'=>'ð ³','ð ´'=>'ð ´','ð µ'=>'ð µ','ð ·'=>'ð ·','ð ¸'=>'ð ¸','ð ¼'=>'ð ¼','ð ¿'=>'ð ¿','ð¤€'=>'ð¤€','ð¤'=>'ð¤','ð¤‚'=>'ð¤‚','ð¤ƒ'=>'ð¤ƒ','ð¤„'=>'ð¤„','ð¤…'=>'ð¤…','ð¤†'=>'ð¤†','ð¤‡'=>'ð¤‡','ð¤ˆ'=>'ð¤ˆ','ð¤‰'=>'ð¤‰','ð¤Š'=>'ð¤Š','ð¤‹'=>'ð¤‹','ð¤Œ'=>'ð¤Œ','ð¤'=>'ð¤','ð¤Ž'=>'ð¤Ž','ð¤'=>'ð¤','ð¤'=>'ð¤','ð¤‘'=>'ð¤‘','ð¤’'=>'ð¤’','ð¤“'=>'ð¤“','ð¤”'=>'ð¤”','ð¤•'=>'ð¤•','ð¤–'=>'1','ð¤—'=>'10','ð¤˜'=>'20','ð¤™'=>'100','ð¨€'=>'ð¨€','ð¨'=>'ð¨','ð¨‚'=>'ð¨‚','ð¨ƒ'=>'ð¨ƒ','ð¨…'=>'ð¨…','ð¨†'=>'ð¨†','ð¨Œ'=>'ð¨Œ','ð¨'=>'ð¨','ð¨Ž'=>'ð¨Ž','ð¨'=>'ð¨','ð¨'=>'ð¨','ð¨‘'=>'ð¨‘','ð¨’'=>'ð¨’','ð¨“'=>'ð¨“','ð¨•'=>'ð¨•','ð¨–'=>'ð¨–','ð¨—'=>'ð¨—','ð¨™'=>'ð¨™','ð¨š'=>'ð¨š','ð¨›'=>'ð¨›','ð¨œ'=>'ð¨œ','ð¨'=>'ð¨','ð¨ž'=>'ð¨ž','ð¨Ÿ'=>'ð¨Ÿ','ð¨ '=>'ð¨ ','ð¨¡'=>'ð¨¡','ð¨¢'=>'ð¨¢','ð¨£'=>'ð¨£','ð¨¤'=>'ð¨¤','ð¨¥'=>'ð¨¥','ð¨¦'=>'ð¨¦','ð¨§'=>'ð¨§','ð¨¨'=>'ð¨¨','ð¨©'=>'ð¨©','ð¨ª'=>'ð¨ª','ð¨«'=>'ð¨«','ð¨¬'=>'ð¨¬','ð¨­'=>'ð¨­','ð¨®'=>'ð¨®','ð¨¯'=>'ð¨¯','ð¨°'=>'ð¨°','ð¨±'=>'ð¨±','ð¨²'=>'ð¨²','ð¨³'=>'ð¨³','ð¨¸'=>'ð¨¸','ð¨¹'=>'ð¨¹','ð¨º'=>'ð¨º','ð¨¿'=>'ð¨¿','ð©€'=>'1','ð©'=>'2','ð©‚'=>'3','ð©ƒ'=>'4','ð©„'=>'10','ð©…'=>'20','ð©†'=>'100','ð©‡'=>'1000'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_36.php b/sources/phpBB/includes/utf/data/search_indexer_36.php new file mode 100644 index 0000000..a970fa2 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_36.php @@ -0,0 +1 @@ +'ð’€€','ð’€'=>'ð’€','𒀂'=>'𒀂','𒀃'=>'𒀃','𒀄'=>'𒀄','ð’€…'=>'ð’€…','𒀆'=>'𒀆','𒀇'=>'𒀇','𒀈'=>'𒀈','𒀉'=>'𒀉','𒀊'=>'𒀊','𒀋'=>'𒀋','𒀌'=>'𒀌','ð’€'=>'ð’€','𒀎'=>'𒀎','ð’€'=>'ð’€','ð’€'=>'ð’€','𒀑'=>'𒀑','ð’€’'=>'ð’€’','𒀓'=>'𒀓','ð’€”'=>'ð’€”','𒀕'=>'𒀕','ð’€–'=>'ð’€–','ð’€—'=>'ð’€—','𒀘'=>'𒀘','ð’€™'=>'ð’€™','𒀚'=>'𒀚','ð’€›'=>'ð’€›','𒀜'=>'𒀜','ð’€'=>'ð’€','𒀞'=>'𒀞','𒀟'=>'𒀟','ð’€ '=>'ð’€ ','𒀡'=>'𒀡','ð’€¢'=>'ð’€¢','ð’€£'=>'ð’€£','𒀤'=>'𒀤','ð’€¥'=>'ð’€¥','𒀦'=>'𒀦','𒀧'=>'𒀧','𒀨'=>'𒀨','𒀩'=>'𒀩','𒀪'=>'𒀪','𒀫'=>'𒀫','𒀬'=>'𒀬','ð’€­'=>'ð’€­','ð’€®'=>'ð’€®','𒀯'=>'𒀯','ð’€°'=>'ð’€°','ð’€±'=>'ð’€±','ð’€²'=>'ð’€²','ð’€³'=>'ð’€³','ð’€´'=>'ð’€´','ð’€µ'=>'ð’€µ','𒀶'=>'𒀶','ð’€·'=>'ð’€·','𒀸'=>'𒀸','ð’€¹'=>'ð’€¹','𒀺'=>'𒀺','ð’€»'=>'ð’€»','ð’€¼'=>'ð’€¼','ð’€½'=>'ð’€½','ð’€¾'=>'ð’€¾','𒀿'=>'𒀿','ð’€'=>'ð’€','ð’'=>'ð’','ð’‚'=>'ð’‚','ð’ƒ'=>'ð’ƒ','ð’„'=>'ð’„','ð’…'=>'ð’…','ð’†'=>'ð’†','ð’‡'=>'ð’‡','ð’ˆ'=>'ð’ˆ','ð’‰'=>'ð’‰','ð’Š'=>'ð’Š','ð’‹'=>'ð’‹','ð’Œ'=>'ð’Œ','ð’'=>'ð’','ð’Ž'=>'ð’Ž','ð’'=>'ð’','ð’'=>'ð’','ð’‘'=>'ð’‘','ð’’'=>'ð’’','ð’“'=>'ð’“','ð’”'=>'ð’”','ð’•'=>'ð’•','ð’–'=>'ð’–','ð’—'=>'ð’—','ð’˜'=>'ð’˜','ð’™'=>'ð’™','ð’š'=>'ð’š','ð’›'=>'ð’›','ð’œ'=>'ð’œ','ð’'=>'ð’','ð’ž'=>'ð’ž','ð’Ÿ'=>'ð’Ÿ','ð’ '=>'ð’ ','ð’¡'=>'ð’¡','ð’¢'=>'ð’¢','ð’£'=>'ð’£','ð’¤'=>'ð’¤','ð’¥'=>'ð’¥','ð’¦'=>'ð’¦','ð’§'=>'ð’§','ð’¨'=>'ð’¨','ð’©'=>'ð’©','ð’ª'=>'ð’ª','ð’«'=>'ð’«','ð’¬'=>'ð’¬','ð’­'=>'ð’­','ð’®'=>'ð’®','ð’¯'=>'ð’¯','ð’°'=>'ð’°','ð’±'=>'ð’±','ð’²'=>'ð’²','ð’³'=>'ð’³','ð’´'=>'ð’´','ð’µ'=>'ð’µ','ð’¶'=>'ð’¶','ð’·'=>'ð’·','ð’¸'=>'ð’¸','ð’¹'=>'ð’¹','ð’º'=>'ð’º','ð’»'=>'ð’»','ð’¼'=>'ð’¼','ð’½'=>'ð’½','ð’¾'=>'ð’¾','ð’¿'=>'ð’¿','ð’‚€'=>'ð’‚€','ð’‚'=>'ð’‚','ð’‚‚'=>'ð’‚‚','𒂃'=>'𒂃','ð’‚„'=>'ð’‚„','ð’‚…'=>'ð’‚…','𒂆'=>'𒂆','𒂇'=>'𒂇','𒂈'=>'𒂈','𒂉'=>'𒂉','ð’‚Š'=>'ð’‚Š','ð’‚‹'=>'ð’‚‹','ð’‚Œ'=>'ð’‚Œ','ð’‚'=>'ð’‚','ð’‚Ž'=>'ð’‚Ž','ð’‚'=>'ð’‚','ð’‚'=>'ð’‚','ð’‚‘'=>'ð’‚‘','ð’‚’'=>'ð’‚’','ð’‚“'=>'ð’‚“','ð’‚”'=>'ð’‚”','ð’‚•'=>'ð’‚•','ð’‚–'=>'ð’‚–','ð’‚—'=>'ð’‚—','𒂘'=>'𒂘','ð’‚™'=>'ð’‚™','ð’‚š'=>'ð’‚š','ð’‚›'=>'ð’‚›','ð’‚œ'=>'ð’‚œ','ð’‚'=>'ð’‚','ð’‚ž'=>'ð’‚ž','ð’‚Ÿ'=>'ð’‚Ÿ','ð’‚ '=>'ð’‚ ','ð’‚¡'=>'ð’‚¡','ð’‚¢'=>'ð’‚¢','ð’‚£'=>'ð’‚£','𒂤'=>'𒂤','ð’‚¥'=>'ð’‚¥','𒂦'=>'𒂦','𒂧'=>'𒂧','𒂨'=>'𒂨','ð’‚©'=>'ð’‚©','𒂪'=>'𒂪','ð’‚«'=>'ð’‚«','𒂬'=>'𒂬','ð’‚­'=>'ð’‚­','ð’‚®'=>'ð’‚®','𒂯'=>'𒂯','ð’‚°'=>'ð’‚°','ð’‚±'=>'ð’‚±','ð’‚²'=>'ð’‚²','ð’‚³'=>'ð’‚³','ð’‚´'=>'ð’‚´','ð’‚µ'=>'ð’‚µ','𒂶'=>'𒂶','ð’‚·'=>'ð’‚·','𒂸'=>'𒂸','ð’‚¹'=>'ð’‚¹','𒂺'=>'𒂺','ð’‚»'=>'ð’‚»','ð’‚¼'=>'ð’‚¼','ð’‚½'=>'ð’‚½','ð’‚¾'=>'ð’‚¾','ð’‚¿'=>'ð’‚¿','𒃀'=>'𒃀','ð’ƒ'=>'ð’ƒ','𒃂'=>'𒃂','𒃃'=>'𒃃','𒃄'=>'𒃄','ð’ƒ…'=>'ð’ƒ…','𒃆'=>'𒃆','𒃇'=>'𒃇','𒃈'=>'𒃈','𒃉'=>'𒃉','𒃊'=>'𒃊','𒃋'=>'𒃋','𒃌'=>'𒃌','ð’ƒ'=>'ð’ƒ','𒃎'=>'𒃎','ð’ƒ'=>'ð’ƒ','ð’ƒ'=>'ð’ƒ','𒃑'=>'𒃑','ð’ƒ’'=>'ð’ƒ’','𒃓'=>'𒃓','𒃔'=>'𒃔','𒃕'=>'𒃕','ð’ƒ–'=>'ð’ƒ–','ð’ƒ—'=>'ð’ƒ—','𒃘'=>'𒃘','𒃙'=>'𒃙','𒃚'=>'𒃚','𒃛'=>'𒃛','𒃜'=>'𒃜','ð’ƒ'=>'ð’ƒ','𒃞'=>'𒃞','𒃟'=>'𒃟','ð’ƒ '=>'ð’ƒ ','𒃡'=>'𒃡','𒃢'=>'𒃢','𒃣'=>'𒃣','𒃤'=>'𒃤','𒃥'=>'𒃥','𒃦'=>'𒃦','𒃧'=>'𒃧','𒃨'=>'𒃨','𒃩'=>'𒃩','𒃪'=>'𒃪','𒃫'=>'𒃫','𒃬'=>'𒃬','ð’ƒ­'=>'ð’ƒ­','𒃮'=>'𒃮','𒃯'=>'𒃯','ð’ƒ°'=>'ð’ƒ°','𒃱'=>'𒃱','𒃲'=>'𒃲','𒃳'=>'𒃳','ð’ƒ´'=>'ð’ƒ´','𒃵'=>'𒃵','𒃶'=>'𒃶','ð’ƒ·'=>'ð’ƒ·','𒃸'=>'𒃸','𒃹'=>'𒃹','𒃺'=>'𒃺','𒃻'=>'𒃻','𒃼'=>'𒃼','𒃽'=>'𒃽','𒃾'=>'𒃾','𒃿'=>'𒃿','ð’„€'=>'ð’„€','ð’„'=>'ð’„','ð’„‚'=>'ð’„‚','𒄃'=>'𒄃','ð’„„'=>'ð’„„','ð’„…'=>'ð’„…','𒄆'=>'𒄆','𒄇'=>'𒄇','𒄈'=>'𒄈','𒄉'=>'𒄉','ð’„Š'=>'ð’„Š','ð’„‹'=>'ð’„‹','ð’„Œ'=>'ð’„Œ','ð’„'=>'ð’„','ð’„Ž'=>'ð’„Ž','ð’„'=>'ð’„','ð’„'=>'ð’„','ð’„‘'=>'ð’„‘','ð’„’'=>'ð’„’','ð’„“'=>'ð’„“','ð’„”'=>'ð’„”','ð’„•'=>'ð’„•','ð’„–'=>'ð’„–','ð’„—'=>'ð’„—','𒄘'=>'𒄘','ð’„™'=>'ð’„™','ð’„š'=>'ð’„š','ð’„›'=>'ð’„›','ð’„œ'=>'ð’„œ','ð’„'=>'ð’„','ð’„ž'=>'ð’„ž','ð’„Ÿ'=>'ð’„Ÿ','ð’„ '=>'ð’„ ','ð’„¡'=>'ð’„¡','ð’„¢'=>'ð’„¢','ð’„£'=>'ð’„£','𒄤'=>'𒄤','ð’„¥'=>'ð’„¥','𒄦'=>'𒄦','𒄧'=>'𒄧','𒄨'=>'𒄨','ð’„©'=>'ð’„©','𒄪'=>'𒄪','ð’„«'=>'ð’„«','𒄬'=>'𒄬','ð’„­'=>'ð’„­','ð’„®'=>'ð’„®','𒄯'=>'𒄯','ð’„°'=>'ð’„°','ð’„±'=>'ð’„±','ð’„²'=>'ð’„²','ð’„³'=>'ð’„³','ð’„´'=>'ð’„´','ð’„µ'=>'ð’„µ','𒄶'=>'𒄶','ð’„·'=>'ð’„·','𒄸'=>'𒄸','ð’„¹'=>'ð’„¹','𒄺'=>'𒄺','ð’„»'=>'ð’„»','ð’„¼'=>'ð’„¼','ð’„½'=>'ð’„½','ð’„¾'=>'ð’„¾','ð’„¿'=>'ð’„¿','ð’…€'=>'ð’…€','ð’…'=>'ð’…','ð’…‚'=>'ð’…‚','ð’…ƒ'=>'ð’…ƒ','ð’…„'=>'ð’…„','ð’……'=>'ð’……','ð’…†'=>'ð’…†','ð’…‡'=>'ð’…‡','ð’…ˆ'=>'ð’…ˆ','ð’…‰'=>'ð’…‰','ð’…Š'=>'ð’…Š','ð’…‹'=>'ð’…‹','ð’…Œ'=>'ð’…Œ','ð’…'=>'ð’…','ð’…Ž'=>'ð’…Ž','ð’…'=>'ð’…','ð’…'=>'ð’…','ð’…‘'=>'ð’…‘','ð’…’'=>'ð’…’','ð’…“'=>'ð’…“','ð’…”'=>'ð’…”','ð’…•'=>'ð’…•','ð’…–'=>'ð’…–','ð’…—'=>'ð’…—','ð’…˜'=>'ð’…˜','ð’…™'=>'ð’…™','ð’…š'=>'ð’…š','ð’…›'=>'ð’…›','ð’…œ'=>'ð’…œ','ð’…'=>'ð’…','ð’…ž'=>'ð’…ž','ð’…Ÿ'=>'ð’…Ÿ','ð’… '=>'ð’… ','ð’…¡'=>'ð’…¡','ð’…¢'=>'ð’…¢','ð’…£'=>'ð’…£','ð’…¤'=>'ð’…¤','ð’…¥'=>'ð’…¥','ð’…¦'=>'ð’…¦','ð’…§'=>'ð’…§','ð’…¨'=>'ð’…¨','ð’…©'=>'ð’…©','ð’…ª'=>'ð’…ª','ð’…«'=>'ð’…«','ð’…¬'=>'ð’…¬','ð’…­'=>'ð’…­','ð’…®'=>'ð’…®','ð’…¯'=>'ð’…¯','ð’…°'=>'ð’…°','ð’…±'=>'ð’…±','ð’…²'=>'ð’…²','ð’…³'=>'ð’…³','ð’…´'=>'ð’…´','ð’…µ'=>'ð’…µ','ð’…¶'=>'ð’…¶','ð’…·'=>'ð’…·','ð’…¸'=>'ð’…¸','ð’…¹'=>'ð’…¹','ð’…º'=>'ð’…º','ð’…»'=>'ð’…»','ð’…¼'=>'ð’…¼','ð’…½'=>'ð’…½','ð’…¾'=>'ð’…¾','ð’…¿'=>'ð’…¿','𒆀'=>'𒆀','ð’†'=>'ð’†','𒆂'=>'𒆂','𒆃'=>'𒆃','𒆄'=>'𒆄','ð’†…'=>'ð’†…','𒆆'=>'𒆆','𒆇'=>'𒆇','𒆈'=>'𒆈','𒆉'=>'𒆉','𒆊'=>'𒆊','𒆋'=>'𒆋','𒆌'=>'𒆌','ð’†'=>'ð’†','𒆎'=>'𒆎','ð’†'=>'ð’†','ð’†'=>'ð’†','𒆑'=>'𒆑','ð’†’'=>'ð’†’','𒆓'=>'𒆓','𒆔'=>'𒆔','𒆕'=>'𒆕','ð’†–'=>'ð’†–','ð’†—'=>'ð’†—','𒆘'=>'𒆘','𒆙'=>'𒆙','𒆚'=>'𒆚','𒆛'=>'𒆛','𒆜'=>'𒆜','ð’†'=>'ð’†','𒆞'=>'𒆞','𒆟'=>'𒆟','ð’† '=>'ð’† ','𒆡'=>'𒆡','𒆢'=>'𒆢','𒆣'=>'𒆣','𒆤'=>'𒆤','𒆥'=>'𒆥','𒆦'=>'𒆦','𒆧'=>'𒆧','𒆨'=>'𒆨','𒆩'=>'𒆩','𒆪'=>'𒆪','𒆫'=>'𒆫','𒆬'=>'𒆬','ð’†­'=>'ð’†­','𒆮'=>'𒆮','𒆯'=>'𒆯','ð’†°'=>'ð’†°','𒆱'=>'𒆱','𒆲'=>'𒆲','𒆳'=>'𒆳','ð’†´'=>'ð’†´','𒆵'=>'𒆵','𒆶'=>'𒆶','ð’†·'=>'ð’†·','𒆸'=>'𒆸','𒆹'=>'𒆹','𒆺'=>'𒆺','𒆻'=>'𒆻','𒆼'=>'𒆼','𒆽'=>'𒆽','𒆾'=>'𒆾','𒆿'=>'𒆿','𒇀'=>'𒇀','ð’‡'=>'ð’‡','𒇂'=>'𒇂','𒇃'=>'𒇃','𒇄'=>'𒇄','ð’‡…'=>'ð’‡…','𒇆'=>'𒇆','𒇇'=>'𒇇','𒇈'=>'𒇈','𒇉'=>'𒇉','𒇊'=>'𒇊','𒇋'=>'𒇋','𒇌'=>'𒇌','ð’‡'=>'ð’‡','𒇎'=>'𒇎','ð’‡'=>'ð’‡','ð’‡'=>'ð’‡','𒇑'=>'𒇑','ð’‡’'=>'ð’‡’','𒇓'=>'𒇓','𒇔'=>'𒇔','𒇕'=>'𒇕','ð’‡–'=>'ð’‡–','ð’‡—'=>'ð’‡—','𒇘'=>'𒇘','𒇙'=>'𒇙','𒇚'=>'𒇚','𒇛'=>'𒇛','𒇜'=>'𒇜','ð’‡'=>'ð’‡','𒇞'=>'𒇞','𒇟'=>'𒇟','ð’‡ '=>'ð’‡ ','𒇡'=>'𒇡','𒇢'=>'𒇢','𒇣'=>'𒇣','𒇤'=>'𒇤','𒇥'=>'𒇥','𒇦'=>'𒇦','𒇧'=>'𒇧','𒇨'=>'𒇨','𒇩'=>'𒇩','𒇪'=>'𒇪','𒇫'=>'𒇫','𒇬'=>'𒇬','ð’‡­'=>'ð’‡­','𒇮'=>'𒇮','𒇯'=>'𒇯','ð’‡°'=>'ð’‡°','𒇱'=>'𒇱','𒇲'=>'𒇲','𒇳'=>'𒇳','ð’‡´'=>'ð’‡´','𒇵'=>'𒇵','𒇶'=>'𒇶','ð’‡·'=>'ð’‡·','𒇸'=>'𒇸','𒇹'=>'𒇹','𒇺'=>'𒇺','𒇻'=>'𒇻','𒇼'=>'𒇼','𒇽'=>'𒇽','𒇾'=>'𒇾','𒇿'=>'𒇿','𒈀'=>'𒈀','ð’ˆ'=>'ð’ˆ','𒈂'=>'𒈂','𒈃'=>'𒈃','𒈄'=>'𒈄','ð’ˆ…'=>'ð’ˆ…','𒈆'=>'𒈆','𒈇'=>'𒈇','𒈈'=>'𒈈','𒈉'=>'𒈉','𒈊'=>'𒈊','𒈋'=>'𒈋','𒈌'=>'𒈌','ð’ˆ'=>'ð’ˆ','𒈎'=>'𒈎','ð’ˆ'=>'ð’ˆ','ð’ˆ'=>'ð’ˆ','𒈑'=>'𒈑','ð’ˆ’'=>'ð’ˆ’','𒈓'=>'𒈓','𒈔'=>'𒈔','𒈕'=>'𒈕','ð’ˆ–'=>'ð’ˆ–','ð’ˆ—'=>'ð’ˆ—','𒈘'=>'𒈘','𒈙'=>'𒈙','𒈚'=>'𒈚','𒈛'=>'𒈛','𒈜'=>'𒈜','ð’ˆ'=>'ð’ˆ','𒈞'=>'𒈞','𒈟'=>'𒈟','ð’ˆ '=>'ð’ˆ ','𒈡'=>'𒈡','𒈢'=>'𒈢','𒈣'=>'𒈣','𒈤'=>'𒈤','𒈥'=>'𒈥','𒈦'=>'𒈦','𒈧'=>'𒈧','𒈨'=>'𒈨','𒈩'=>'𒈩','𒈪'=>'𒈪','𒈫'=>'𒈫','𒈬'=>'𒈬','ð’ˆ­'=>'ð’ˆ­','𒈮'=>'𒈮','𒈯'=>'𒈯','ð’ˆ°'=>'ð’ˆ°','𒈱'=>'𒈱','𒈲'=>'𒈲','𒈳'=>'𒈳','ð’ˆ´'=>'ð’ˆ´','𒈵'=>'𒈵','𒈶'=>'𒈶','ð’ˆ·'=>'ð’ˆ·','𒈸'=>'𒈸','𒈹'=>'𒈹','𒈺'=>'𒈺','𒈻'=>'𒈻','𒈼'=>'𒈼','𒈽'=>'𒈽','𒈾'=>'𒈾','𒈿'=>'𒈿','𒉀'=>'𒉀','ð’‰'=>'ð’‰','𒉂'=>'𒉂','𒉃'=>'𒉃','𒉄'=>'𒉄','ð’‰…'=>'ð’‰…','𒉆'=>'𒉆','𒉇'=>'𒉇','𒉈'=>'𒉈','𒉉'=>'𒉉','𒉊'=>'𒉊','𒉋'=>'𒉋','𒉌'=>'𒉌','ð’‰'=>'ð’‰','𒉎'=>'𒉎','ð’‰'=>'ð’‰','ð’‰'=>'ð’‰','𒉑'=>'𒉑','ð’‰’'=>'ð’‰’','𒉓'=>'𒉓','𒉔'=>'𒉔','𒉕'=>'𒉕','ð’‰–'=>'ð’‰–','ð’‰—'=>'ð’‰—','𒉘'=>'𒉘','𒉙'=>'𒉙','𒉚'=>'𒉚','𒉛'=>'𒉛','𒉜'=>'𒉜','ð’‰'=>'ð’‰','𒉞'=>'𒉞','𒉟'=>'𒉟','ð’‰ '=>'ð’‰ ','𒉡'=>'𒉡','𒉢'=>'𒉢','𒉣'=>'𒉣','𒉤'=>'𒉤','𒉥'=>'𒉥','𒉦'=>'𒉦','𒉧'=>'𒉧','𒉨'=>'𒉨','𒉩'=>'𒉩','𒉪'=>'𒉪','𒉫'=>'𒉫','𒉬'=>'𒉬','ð’‰­'=>'ð’‰­','𒉮'=>'𒉮','𒉯'=>'𒉯','ð’‰°'=>'ð’‰°','𒉱'=>'𒉱','𒉲'=>'𒉲','𒉳'=>'𒉳','ð’‰´'=>'ð’‰´','𒉵'=>'𒉵','𒉶'=>'𒉶','ð’‰·'=>'ð’‰·','𒉸'=>'𒉸','𒉹'=>'𒉹','𒉺'=>'𒉺','𒉻'=>'𒉻','𒉼'=>'𒉼','𒉽'=>'𒉽','𒉾'=>'𒉾','𒉿'=>'𒉿','ð’Š€'=>'ð’Š€','ð’Š'=>'ð’Š','ð’Š‚'=>'ð’Š‚','𒊃'=>'𒊃','ð’Š„'=>'ð’Š„','ð’Š…'=>'ð’Š…','𒊆'=>'𒊆','𒊇'=>'𒊇','𒊈'=>'𒊈','𒊉'=>'𒊉','ð’ŠŠ'=>'ð’ŠŠ','ð’Š‹'=>'ð’Š‹','ð’ŠŒ'=>'ð’ŠŒ','ð’Š'=>'ð’Š','ð’ŠŽ'=>'ð’ŠŽ','ð’Š'=>'ð’Š','ð’Š'=>'ð’Š','ð’Š‘'=>'ð’Š‘','ð’Š’'=>'ð’Š’','ð’Š“'=>'ð’Š“','ð’Š”'=>'ð’Š”','ð’Š•'=>'ð’Š•','ð’Š–'=>'ð’Š–','ð’Š—'=>'ð’Š—','𒊘'=>'𒊘','ð’Š™'=>'ð’Š™','ð’Šš'=>'ð’Šš','ð’Š›'=>'ð’Š›','ð’Šœ'=>'ð’Šœ','ð’Š'=>'ð’Š','ð’Šž'=>'ð’Šž','ð’ŠŸ'=>'ð’ŠŸ','ð’Š '=>'ð’Š ','ð’Š¡'=>'ð’Š¡','ð’Š¢'=>'ð’Š¢','ð’Š£'=>'ð’Š£','𒊤'=>'𒊤','ð’Š¥'=>'ð’Š¥','𒊦'=>'𒊦','𒊧'=>'𒊧','𒊨'=>'𒊨','ð’Š©'=>'ð’Š©','𒊪'=>'𒊪','ð’Š«'=>'ð’Š«','𒊬'=>'𒊬','ð’Š­'=>'ð’Š­','ð’Š®'=>'ð’Š®','𒊯'=>'𒊯','ð’Š°'=>'ð’Š°','𒊱'=>'𒊱','𒊲'=>'𒊲','𒊳'=>'𒊳','ð’Š´'=>'ð’Š´','𒊵'=>'𒊵','𒊶'=>'𒊶','ð’Š·'=>'ð’Š·','𒊸'=>'𒊸','𒊹'=>'𒊹','𒊺'=>'𒊺','ð’Š»'=>'ð’Š»','𒊼'=>'𒊼','𒊽'=>'𒊽','𒊾'=>'𒊾','ð’Š¿'=>'ð’Š¿','ð’‹€'=>'ð’‹€','ð’‹'=>'ð’‹','ð’‹‚'=>'ð’‹‚','𒋃'=>'𒋃','ð’‹„'=>'ð’‹„','ð’‹…'=>'ð’‹…','𒋆'=>'𒋆','𒋇'=>'𒋇','𒋈'=>'𒋈','𒋉'=>'𒋉','ð’‹Š'=>'ð’‹Š','ð’‹‹'=>'ð’‹‹','ð’‹Œ'=>'ð’‹Œ','ð’‹'=>'ð’‹','ð’‹Ž'=>'ð’‹Ž','ð’‹'=>'ð’‹','ð’‹'=>'ð’‹','ð’‹‘'=>'ð’‹‘','ð’‹’'=>'ð’‹’','ð’‹“'=>'ð’‹“','ð’‹”'=>'ð’‹”','ð’‹•'=>'ð’‹•','ð’‹–'=>'ð’‹–','ð’‹—'=>'ð’‹—','𒋘'=>'𒋘','ð’‹™'=>'ð’‹™','ð’‹š'=>'ð’‹š','ð’‹›'=>'ð’‹›','ð’‹œ'=>'ð’‹œ','ð’‹'=>'ð’‹','ð’‹ž'=>'ð’‹ž','ð’‹Ÿ'=>'ð’‹Ÿ','ð’‹ '=>'ð’‹ ','ð’‹¡'=>'ð’‹¡','ð’‹¢'=>'ð’‹¢','ð’‹£'=>'ð’‹£','𒋤'=>'𒋤','ð’‹¥'=>'ð’‹¥','𒋦'=>'𒋦','𒋧'=>'𒋧','𒋨'=>'𒋨','ð’‹©'=>'ð’‹©','𒋪'=>'𒋪','ð’‹«'=>'ð’‹«','𒋬'=>'𒋬','ð’‹­'=>'ð’‹­','ð’‹®'=>'ð’‹®','𒋯'=>'𒋯','ð’‹°'=>'ð’‹°','ð’‹±'=>'ð’‹±','ð’‹²'=>'ð’‹²','ð’‹³'=>'ð’‹³','ð’‹´'=>'ð’‹´','ð’‹µ'=>'ð’‹µ','𒋶'=>'𒋶','ð’‹·'=>'ð’‹·','𒋸'=>'𒋸','ð’‹¹'=>'ð’‹¹','𒋺'=>'𒋺','ð’‹»'=>'ð’‹»','ð’‹¼'=>'ð’‹¼','ð’‹½'=>'ð’‹½','ð’‹¾'=>'ð’‹¾','ð’‹¿'=>'ð’‹¿','𒌀'=>'𒌀','ð’Œ'=>'ð’Œ','𒌂'=>'𒌂','𒌃'=>'𒌃','𒌄'=>'𒌄','𒌅'=>'𒌅','𒌆'=>'𒌆','𒌇'=>'𒌇','𒌈'=>'𒌈','𒌉'=>'𒌉','𒌊'=>'𒌊','𒌋'=>'𒌋','𒌌'=>'𒌌','ð’Œ'=>'ð’Œ','𒌎'=>'𒌎','ð’Œ'=>'ð’Œ','ð’Œ'=>'ð’Œ','𒌑'=>'𒌑','𒌒'=>'𒌒','𒌓'=>'𒌓','𒌔'=>'𒌔','𒌕'=>'𒌕','𒌖'=>'𒌖','𒌗'=>'𒌗','𒌘'=>'𒌘','𒌙'=>'𒌙','𒌚'=>'𒌚','𒌛'=>'𒌛','𒌜'=>'𒌜','ð’Œ'=>'ð’Œ','𒌞'=>'𒌞','𒌟'=>'𒌟','𒌠'=>'𒌠','𒌡'=>'𒌡','𒌢'=>'𒌢','𒌣'=>'𒌣','𒌤'=>'𒌤','𒌥'=>'𒌥','𒌦'=>'𒌦','𒌧'=>'𒌧','𒌨'=>'𒌨','𒌩'=>'𒌩','𒌪'=>'𒌪','𒌫'=>'𒌫','𒌬'=>'𒌬','𒌭'=>'𒌭','𒌮'=>'𒌮','𒌯'=>'𒌯','𒌰'=>'𒌰','𒌱'=>'𒌱','𒌲'=>'𒌲','𒌳'=>'𒌳','𒌴'=>'𒌴','𒌵'=>'𒌵','𒌶'=>'𒌶','𒌷'=>'𒌷','𒌸'=>'𒌸','𒌹'=>'𒌹','𒌺'=>'𒌺','𒌻'=>'𒌻','𒌼'=>'𒌼','𒌽'=>'𒌽','𒌾'=>'𒌾','𒌿'=>'𒌿','ð’€'=>'ð’€','ð’'=>'ð’','ð’‚'=>'ð’‚','ð’ƒ'=>'ð’ƒ','ð’„'=>'ð’„','ð’…'=>'ð’…','ð’†'=>'ð’†','ð’‡'=>'ð’‡','ð’ˆ'=>'ð’ˆ','ð’‰'=>'ð’‰','ð’Š'=>'ð’Š','ð’‹'=>'ð’‹','ð’Œ'=>'ð’Œ','ð’'=>'ð’','ð’Ž'=>'ð’Ž','ð’'=>'ð’','ð’'=>'ð’','ð’‘'=>'ð’‘','ð’’'=>'ð’’','ð’“'=>'ð’“','ð’”'=>'ð’”','ð’•'=>'ð’•','ð’–'=>'ð’–','ð’—'=>'ð’—','ð’˜'=>'ð’˜','ð’™'=>'ð’™','ð’š'=>'ð’š','ð’›'=>'ð’›','ð’œ'=>'ð’œ','ð’'=>'ð’','ð’ž'=>'ð’ž','ð’Ÿ'=>'ð’Ÿ','ð’ '=>'ð’ ','ð’¡'=>'ð’¡','ð’¢'=>'ð’¢','ð’£'=>'ð’£','ð’¤'=>'ð’¤','ð’¥'=>'ð’¥','ð’¦'=>'ð’¦','ð’§'=>'ð’§','ð’¨'=>'ð’¨','ð’©'=>'ð’©','ð’ª'=>'ð’ª','ð’«'=>'ð’«','ð’¬'=>'ð’¬','ð’­'=>'ð’­','ð’®'=>'ð’®','ð’€'=>'2','ð’'=>'3','ð’‚'=>'4','ð’ƒ'=>'5','ð’„'=>'6','ð’…'=>'7','ð’†'=>'8','ð’‡'=>'9','ð’ˆ'=>'3','ð’‰'=>'4','ð’Š'=>'5','ð’‹'=>'6','ð’Œ'=>'7','ð’'=>'8','ð’Ž'=>'9','ð’'=>'4','ð’'=>'5','ð’‘'=>'6','ð’’'=>'7','ð’“'=>'8','ð’”'=>'9','ð’•'=>'1','ð’–'=>'2','ð’—'=>'3','ð’˜'=>'4','ð’™'=>'5','ð’š'=>'6','ð’›'=>'7','ð’œ'=>'8','ð’'=>'9','ð’ž'=>'1','ð’Ÿ'=>'2','ð’ '=>'3','ð’¡'=>'4','ð’¢'=>'5','ð’£'=>'2','ð’¤'=>'3','ð’¥'=>'3','ð’¦'=>'4','ð’§'=>'5','ð’¨'=>'6','ð’©'=>'7','ð’ª'=>'8','ð’«'=>'9','ð’¬'=>'1','ð’­'=>'2','ð’®'=>'3','ð’¯'=>'3','ð’°'=>'4','ð’±'=>'5','ð’²'=>'ð’²','ð’³'=>'ð’³','ð’´'=>'1','ð’µ'=>'2','ð’¶'=>'3','ð’·'=>'3','ð’¸'=>'4','ð’¹'=>'5','ð’º'=>'3','ð’»'=>'3','ð’¼'=>'4','ð’½'=>'4','ð’¾'=>'4','ð’¿'=>'4','ð’‘€'=>'6','ð’‘'=>'7','ð’‘‚'=>'7','𒑃'=>'7','ð’‘„'=>'8','ð’‘…'=>'8','𒑆'=>'9','𒑇'=>'9','𒑈'=>'9','𒑉'=>'9','ð’‘Š'=>'2','ð’‘‹'=>'3','ð’‘Œ'=>'4','ð’‘'=>'5','ð’‘Ž'=>'6','ð’‘'=>'1','ð’‘'=>'2','ð’‘‘'=>'3','ð’‘’'=>'4','ð’‘“'=>'4','ð’‘”'=>'5','ð’‘•'=>'5','ð’‘–'=>'ð’‘–','ð’‘—'=>'ð’‘—','𒑘'=>'1','ð’‘™'=>'2','ð’‘š'=>'1/3','ð’‘›'=>'2/3','ð’‘œ'=>'5/6','ð’‘'=>'1/3','ð’‘ž'=>'2/3','ð’‘Ÿ'=>'1/8','ð’‘ '=>'1/4','ð’‘¡'=>'1/6','ð’‘¢'=>'1/4'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_4.php b/sources/phpBB/includes/utf/data/search_indexer_4.php new file mode 100644 index 0000000..6697501 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_4.php @@ -0,0 +1 @@ +'0','â±'=>'â±','â´'=>'4','âµ'=>'5','â¶'=>'6','â·'=>'7','â¸'=>'8','â¹'=>'9','â¿'=>'â¿','â‚€'=>'0','â‚'=>'1','â‚‚'=>'2','₃'=>'3','â‚„'=>'4','â‚…'=>'5','₆'=>'6','₇'=>'7','₈'=>'8','₉'=>'9','â‚'=>'â‚','â‚‘'=>'â‚‘','â‚’'=>'â‚’','â‚“'=>'â‚“','â‚”'=>'â‚”','âƒ'=>'âƒ','⃑'=>'⃑','⃒'=>'⃒','⃓'=>'⃓','⃔'=>'⃔','⃕'=>'⃕','⃖'=>'⃖','⃗'=>'⃗','⃘'=>'⃘','⃙'=>'⃙','⃚'=>'⃚','⃛'=>'⃛','⃜'=>'⃜','âƒ'=>'âƒ','⃞'=>'⃞','⃟'=>'⃟','⃠'=>'⃠','⃡'=>'⃡','⃢'=>'⃢','⃣'=>'⃣','⃤'=>'⃤','⃥'=>'⃥','⃦'=>'⃦','⃧'=>'⃧','⃨'=>'⃨','⃩'=>'⃩','⃪'=>'⃪','⃫'=>'⃫','⃬'=>'⃬','⃭'=>'⃭','⃮'=>'⃮','⃯'=>'⃯','â„‚'=>'â„‚','ℇ'=>'ℇ','â„Š'=>'â„Š','â„‹'=>'â„‹','â„Œ'=>'â„Œ','â„'=>'â„','â„Ž'=>'â„Ž','â„'=>'â„','â„'=>'â„','â„‘'=>'â„‘','â„’'=>'â„’','â„“'=>'â„“','â„•'=>'â„•','â„™'=>'â„™','â„š'=>'â„š','â„›'=>'â„›','â„œ'=>'â„œ','â„'=>'â„','ℤ'=>'ℤ','Ω'=>'ω','ℨ'=>'ℨ','K'=>'k','â„«'=>'Ã¥','ℬ'=>'ℬ','â„­'=>'â„­','ℯ'=>'ℯ','â„°'=>'â„°','ℱ'=>'ℱ','Ⅎ'=>'â…Ž','ℳ'=>'ℳ','â„´'=>'â„´','ℵ'=>'ℵ','ℶ'=>'ℶ','â„·'=>'â„·','ℸ'=>'ℸ','ℹ'=>'ℹ','ℼ'=>'ℼ','ℽ'=>'ℽ','ℾ'=>'ℾ','â„¿'=>'â„¿','â……'=>'â……','â…†'=>'â…†','â…‡'=>'â…‡','â…ˆ'=>'â…ˆ','â…‰'=>'â…‰','â…Ž'=>'â…Ž','â…“'=>'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','â… '=>'1','â…¡'=>'2','â…¢'=>'3','â…£'=>'4','â…¤'=>'5','â…¥'=>'6','â…¦'=>'7','â…§'=>'8','â…¨'=>'9','â…©'=>'10','â…ª'=>'11','â…«'=>'12','â…¬'=>'50','â…­'=>'100','â…®'=>'500','â…¯'=>'1000','â…°'=>'1','â…±'=>'2','â…²'=>'3','â…³'=>'4','â…´'=>'5','â…µ'=>'6','â…¶'=>'7','â…·'=>'8','â…¸'=>'9','â…¹'=>'10','â…º'=>'11','â…»'=>'12','â…¼'=>'50','â…½'=>'100','â…¾'=>'500','â…¿'=>'1000','ↀ'=>'1000','â†'=>'5000','ↂ'=>'10000','Ↄ'=>'ↄ','ↄ'=>'ↄ','â‘ '=>'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','⓪'=>'0','â“«'=>'11','⓬'=>'12','â“­'=>'13','â“®'=>'14','⓯'=>'15','â“°'=>'16','⓱'=>'17','⓲'=>'18','⓳'=>'19','â“´'=>'20','⓵'=>'1','⓶'=>'2','â“·'=>'3','⓸'=>'4','⓹'=>'5','⓺'=>'6','â“»'=>'7','⓼'=>'8','⓽'=>'9','⓾'=>'10','â“¿'=>'0','â¶'=>'1','â·'=>'2','â¸'=>'3','â¹'=>'4','âº'=>'5','â»'=>'6','â¼'=>'7','â½'=>'8','â¾'=>'9','â¿'=>'10','➀'=>'1','âž'=>'2','âž‚'=>'3','➃'=>'4','âž„'=>'5','âž…'=>'6','➆'=>'7','➇'=>'8','➈'=>'9','➉'=>'10','➊'=>'1','âž‹'=>'2','➌'=>'3','âž'=>'4','➎'=>'5','âž'=>'6','âž'=>'7','âž‘'=>'8','âž’'=>'9','âž“'=>'10'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_448.php b/sources/phpBB/includes/utf/data/search_indexer_448.php new file mode 100644 index 0000000..6cbf664 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_448.php @@ -0,0 +1 @@ +'ó „€','ó „'=>'ó „','ó „‚'=>'ó „‚','󠄃'=>'󠄃','ó „„'=>'ó „„','ó „…'=>'ó „…','󠄆'=>'󠄆','󠄇'=>'󠄇','󠄈'=>'󠄈','󠄉'=>'󠄉','ó „Š'=>'ó „Š','ó „‹'=>'ó „‹','ó „Œ'=>'ó „Œ','ó „'=>'ó „','ó „Ž'=>'ó „Ž','ó „'=>'ó „','ó „'=>'ó „','ó „‘'=>'ó „‘','ó „’'=>'ó „’','ó „“'=>'ó „“','ó „”'=>'ó „”','ó „•'=>'ó „•','ó „–'=>'ó „–','ó „—'=>'ó „—','󠄘'=>'󠄘','ó „™'=>'ó „™','ó „š'=>'ó „š','ó „›'=>'ó „›','ó „œ'=>'ó „œ','ó „'=>'ó „','ó „ž'=>'ó „ž','ó „Ÿ'=>'ó „Ÿ','ó „ '=>'ó „ ','ó „¡'=>'ó „¡','ó „¢'=>'ó „¢','ó „£'=>'ó „£','󠄤'=>'󠄤','ó „¥'=>'ó „¥','󠄦'=>'󠄦','󠄧'=>'󠄧','󠄨'=>'󠄨','ó „©'=>'ó „©','󠄪'=>'󠄪','ó „«'=>'ó „«','󠄬'=>'󠄬','ó „­'=>'ó „­','ó „®'=>'ó „®','󠄯'=>'󠄯','ó „°'=>'ó „°','ó „±'=>'ó „±','ó „²'=>'ó „²','ó „³'=>'ó „³','ó „´'=>'ó „´','ó „µ'=>'ó „µ','󠄶'=>'󠄶','ó „·'=>'ó „·','󠄸'=>'󠄸','ó „¹'=>'ó „¹','󠄺'=>'󠄺','ó „»'=>'ó „»','ó „¼'=>'ó „¼','ó „½'=>'ó „½','ó „¾'=>'ó „¾','ó „¿'=>'ó „¿','ó …€'=>'ó …€','ó …'=>'ó …','ó …‚'=>'ó …‚','ó …ƒ'=>'ó …ƒ','ó …„'=>'ó …„','ó ……'=>'ó ……','ó …†'=>'ó …†','ó …‡'=>'ó …‡','ó …ˆ'=>'ó …ˆ','ó …‰'=>'ó …‰','ó …Š'=>'ó …Š','ó …‹'=>'ó …‹','ó …Œ'=>'ó …Œ','ó …'=>'ó …','ó …Ž'=>'ó …Ž','ó …'=>'ó …','ó …'=>'ó …','ó …‘'=>'ó …‘','ó …’'=>'ó …’','ó …“'=>'ó …“','ó …”'=>'ó …”','ó …•'=>'ó …•','ó …–'=>'ó …–','ó …—'=>'ó …—','ó …˜'=>'ó …˜','ó …™'=>'ó …™','ó …š'=>'ó …š','ó …›'=>'ó …›','ó …œ'=>'ó …œ','ó …'=>'ó …','ó …ž'=>'ó …ž','ó …Ÿ'=>'ó …Ÿ','ó … '=>'ó … ','ó …¡'=>'ó …¡','ó …¢'=>'ó …¢','ó …£'=>'ó …£','ó …¤'=>'ó …¤','ó …¥'=>'ó …¥','ó …¦'=>'ó …¦','ó …§'=>'ó …§','ó …¨'=>'ó …¨','ó …©'=>'ó …©','ó …ª'=>'ó …ª','ó …«'=>'ó …«','ó …¬'=>'ó …¬','ó …­'=>'ó …­','ó …®'=>'ó …®','ó …¯'=>'ó …¯','ó …°'=>'ó …°','ó …±'=>'ó …±','ó …²'=>'ó …²','ó …³'=>'ó …³','ó …´'=>'ó …´','ó …µ'=>'ó …µ','ó …¶'=>'ó …¶','ó …·'=>'ó …·','ó …¸'=>'ó …¸','ó …¹'=>'ó …¹','ó …º'=>'ó …º','ó …»'=>'ó …»','ó …¼'=>'ó …¼','ó …½'=>'ó …½','ó …¾'=>'ó …¾','ó …¿'=>'ó …¿','󠆀'=>'󠆀','ó †'=>'ó †','󠆂'=>'󠆂','󠆃'=>'󠆃','󠆄'=>'󠆄','ó †…'=>'ó †…','󠆆'=>'󠆆','󠆇'=>'󠆇','󠆈'=>'󠆈','󠆉'=>'󠆉','󠆊'=>'󠆊','󠆋'=>'󠆋','󠆌'=>'󠆌','ó †'=>'ó †','󠆎'=>'󠆎','ó †'=>'ó †','ó †'=>'ó †','󠆑'=>'󠆑','ó †’'=>'ó †’','󠆓'=>'󠆓','󠆔'=>'󠆔','󠆕'=>'󠆕','ó †–'=>'ó †–','ó †—'=>'ó †—','󠆘'=>'󠆘','󠆙'=>'󠆙','󠆚'=>'󠆚','󠆛'=>'󠆛','󠆜'=>'󠆜','ó †'=>'ó †','󠆞'=>'󠆞','󠆟'=>'󠆟','ó † '=>'ó † ','󠆡'=>'󠆡','󠆢'=>'󠆢','󠆣'=>'󠆣','󠆤'=>'󠆤','󠆥'=>'󠆥','󠆦'=>'󠆦','󠆧'=>'󠆧','󠆨'=>'󠆨','󠆩'=>'󠆩','󠆪'=>'󠆪','󠆫'=>'󠆫','󠆬'=>'󠆬','ó †­'=>'ó †­','󠆮'=>'󠆮','󠆯'=>'󠆯','ó †°'=>'ó †°','󠆱'=>'󠆱','󠆲'=>'󠆲','󠆳'=>'󠆳','ó †´'=>'ó †´','󠆵'=>'󠆵','󠆶'=>'󠆶','ó †·'=>'ó †·','󠆸'=>'󠆸','󠆹'=>'󠆹','󠆺'=>'󠆺','󠆻'=>'󠆻','󠆼'=>'󠆼','󠆽'=>'󠆽','󠆾'=>'󠆾','󠆿'=>'󠆿','󠇀'=>'󠇀','ó ‡'=>'ó ‡','󠇂'=>'󠇂','󠇃'=>'󠇃','󠇄'=>'󠇄','ó ‡…'=>'ó ‡…','󠇆'=>'󠇆','󠇇'=>'󠇇','󠇈'=>'󠇈','󠇉'=>'󠇉','󠇊'=>'󠇊','󠇋'=>'󠇋','󠇌'=>'󠇌','ó ‡'=>'ó ‡','󠇎'=>'󠇎','ó ‡'=>'ó ‡','ó ‡'=>'ó ‡','󠇑'=>'󠇑','ó ‡’'=>'ó ‡’','󠇓'=>'󠇓','󠇔'=>'󠇔','󠇕'=>'󠇕','ó ‡–'=>'ó ‡–','ó ‡—'=>'ó ‡—','󠇘'=>'󠇘','󠇙'=>'󠇙','󠇚'=>'󠇚','󠇛'=>'󠇛','󠇜'=>'󠇜','ó ‡'=>'ó ‡','󠇞'=>'󠇞','󠇟'=>'󠇟','ó ‡ '=>'ó ‡ ','󠇡'=>'󠇡','󠇢'=>'󠇢','󠇣'=>'󠇣','󠇤'=>'󠇤','󠇥'=>'󠇥','󠇦'=>'󠇦','󠇧'=>'󠇧','󠇨'=>'󠇨','󠇩'=>'󠇩','󠇪'=>'󠇪','󠇫'=>'󠇫','󠇬'=>'󠇬','ó ‡­'=>'ó ‡­','󠇮'=>'󠇮','󠇯'=>'󠇯'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_5.php b/sources/phpBB/includes/utf/data/search_indexer_5.php new file mode 100644 index 0000000..cef8fe9 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_5.php @@ -0,0 +1 @@ +'â°°','â°'=>'â°±','â°‚'=>'â°²','â°ƒ'=>'â°³','â°„'=>'â°´','â°…'=>'â°µ','â°†'=>'â°¶','â°‡'=>'â°·','â°ˆ'=>'â°¸','â°‰'=>'â°¹','â°Š'=>'â°º','â°‹'=>'â°»','â°Œ'=>'â°¼','â°'=>'â°½','â°Ž'=>'â°¾','â°'=>'â°¿','â°'=>'â±€','â°‘'=>'â±','â°’'=>'ⱂ','â°“'=>'ⱃ','â°”'=>'ⱄ','â°•'=>'â±…','â°–'=>'ⱆ','â°—'=>'ⱇ','â°˜'=>'ⱈ','â°™'=>'ⱉ','â°š'=>'ⱊ','â°›'=>'ⱋ','â°œ'=>'ⱌ','â°'=>'â±','â°ž'=>'ⱎ','â°Ÿ'=>'â±','â° '=>'â±','â°¡'=>'ⱑ','â°¢'=>'â±’','â°£'=>'ⱓ','â°¤'=>'â±”','â°¥'=>'ⱕ','â°¦'=>'â±–','â°§'=>'â±—','â°¨'=>'ⱘ','â°©'=>'â±™','â°ª'=>'ⱚ','â°«'=>'â±›','â°¬'=>'ⱜ','â°­'=>'â±','â°®'=>'ⱞ','â°°'=>'â°°','â°±'=>'â°±','â°²'=>'â°²','â°³'=>'â°³','â°´'=>'â°´','â°µ'=>'â°µ','â°¶'=>'â°¶','â°·'=>'â°·','â°¸'=>'â°¸','â°¹'=>'â°¹','â°º'=>'â°º','â°»'=>'â°»','â°¼'=>'â°¼','â°½'=>'â°½','â°¾'=>'â°¾','â°¿'=>'â°¿','â±€'=>'â±€','â±'=>'â±','ⱂ'=>'ⱂ','ⱃ'=>'ⱃ','ⱄ'=>'ⱄ','â±…'=>'â±…','ⱆ'=>'ⱆ','ⱇ'=>'ⱇ','ⱈ'=>'ⱈ','ⱉ'=>'ⱉ','ⱊ'=>'ⱊ','ⱋ'=>'ⱋ','ⱌ'=>'ⱌ','â±'=>'â±','ⱎ'=>'ⱎ','â±'=>'â±','â±'=>'â±','ⱑ'=>'ⱑ','â±’'=>'â±’','ⱓ'=>'ⱓ','â±”'=>'â±”','ⱕ'=>'ⱕ','â±–'=>'â±–','â±—'=>'â±—','ⱘ'=>'ⱘ','â±™'=>'â±™','ⱚ'=>'ⱚ','â±›'=>'â±›','ⱜ'=>'ⱜ','â±'=>'â±','ⱞ'=>'ⱞ','â± '=>'ⱡ','ⱡ'=>'ⱡ','â±¢'=>'É«','â±£'=>'áµ½','Ɽ'=>'ɽ','â±¥'=>'â±¥','ⱦ'=>'ⱦ','Ⱨ'=>'ⱨ','ⱨ'=>'ⱨ','Ⱪ'=>'ⱪ','ⱪ'=>'ⱪ','Ⱬ'=>'ⱬ','ⱬ'=>'ⱬ','â±´'=>'â±´','â±µ'=>'ⱶ','ⱶ'=>'ⱶ','â±·'=>'â±·','â²€'=>'â²','â²'=>'â²','Ⲃ'=>'ⲃ','ⲃ'=>'ⲃ','Ⲅ'=>'â²…','â²…'=>'â²…','Ⲇ'=>'ⲇ','ⲇ'=>'ⲇ','Ⲉ'=>'ⲉ','ⲉ'=>'ⲉ','Ⲋ'=>'ⲋ','ⲋ'=>'ⲋ','Ⲍ'=>'â²','â²'=>'â²','Ⲏ'=>'â²','â²'=>'â²','â²'=>'ⲑ','ⲑ'=>'ⲑ','â²’'=>'ⲓ','ⲓ'=>'ⲓ','â²”'=>'ⲕ','ⲕ'=>'ⲕ','â²–'=>'â²—','â²—'=>'â²—','Ⲙ'=>'â²™','â²™'=>'â²™','Ⲛ'=>'â²›','â²›'=>'â²›','Ⲝ'=>'â²','â²'=>'â²','Ⲟ'=>'ⲟ','ⲟ'=>'ⲟ','â² '=>'ⲡ','ⲡ'=>'ⲡ','â²¢'=>'â²£','â²£'=>'â²£','Ⲥ'=>'â²¥','â²¥'=>'â²¥','Ⲧ'=>'ⲧ','ⲧ'=>'ⲧ','Ⲩ'=>'ⲩ','ⲩ'=>'ⲩ','Ⲫ'=>'ⲫ','ⲫ'=>'ⲫ','Ⲭ'=>'â²­','â²­'=>'â²­','â²®'=>'ⲯ','ⲯ'=>'ⲯ','â²°'=>'â²±','â²±'=>'â²±','â²²'=>'â²³','â²³'=>'â²³','â²´'=>'â²µ','â²µ'=>'â²µ','Ⲷ'=>'â²·','â²·'=>'â²·','Ⲹ'=>'â²¹','â²¹'=>'â²¹','Ⲻ'=>'â²»','â²»'=>'â²»','â²¼'=>'â²½','â²½'=>'â²½','â²¾'=>'ⲿ','ⲿ'=>'ⲿ','â³€'=>'â³','â³'=>'â³','Ⳃ'=>'ⳃ','ⳃ'=>'ⳃ','Ⳅ'=>'â³…','â³…'=>'â³…','Ⳇ'=>'ⳇ','ⳇ'=>'ⳇ','Ⳉ'=>'ⳉ','ⳉ'=>'ⳉ','Ⳋ'=>'ⳋ','ⳋ'=>'ⳋ','Ⳍ'=>'â³','â³'=>'â³','Ⳏ'=>'â³','â³'=>'â³','â³'=>'ⳑ','ⳑ'=>'ⳑ','â³’'=>'ⳓ','ⳓ'=>'ⳓ','â³”'=>'ⳕ','ⳕ'=>'ⳕ','â³–'=>'â³—','â³—'=>'â³—','Ⳙ'=>'â³™','â³™'=>'â³™','Ⳛ'=>'â³›','â³›'=>'â³›','Ⳝ'=>'â³','â³'=>'â³','Ⳟ'=>'ⳟ','ⳟ'=>'ⳟ','â³ '=>'ⳡ','ⳡ'=>'ⳡ','â³¢'=>'â³£','â³£'=>'â³£','ⳤ'=>'ⳤ','â³½'=>'1/2','â´€'=>'â´€','â´'=>'â´','â´‚'=>'â´‚','â´ƒ'=>'â´ƒ','â´„'=>'â´„','â´…'=>'â´…','â´†'=>'â´†','â´‡'=>'â´‡','â´ˆ'=>'â´ˆ','â´‰'=>'â´‰','â´Š'=>'â´Š','â´‹'=>'â´‹','â´Œ'=>'â´Œ','â´'=>'â´','â´Ž'=>'â´Ž','â´'=>'â´','â´'=>'â´','â´‘'=>'â´‘','â´’'=>'â´’','â´“'=>'â´“','â´”'=>'â´”','â´•'=>'â´•','â´–'=>'â´–','â´—'=>'â´—','â´˜'=>'â´˜','â´™'=>'â´™','â´š'=>'â´š','â´›'=>'â´›','â´œ'=>'â´œ','â´'=>'â´','â´ž'=>'â´ž','â´Ÿ'=>'â´Ÿ','â´ '=>'â´ ','â´¡'=>'â´¡','â´¢'=>'â´¢','â´£'=>'â´£','â´¤'=>'â´¤','â´¥'=>'â´¥','â´°'=>'â´°','â´±'=>'â´±','â´²'=>'â´²','â´³'=>'â´³','â´´'=>'â´´','â´µ'=>'â´µ','â´¶'=>'â´¶','â´·'=>'â´·','â´¸'=>'â´¸','â´¹'=>'â´¹','â´º'=>'â´º','â´»'=>'â´»','â´¼'=>'â´¼','â´½'=>'â´½','â´¾'=>'â´¾','â´¿'=>'â´¿','âµ€'=>'âµ€','âµ'=>'âµ','ⵂ'=>'ⵂ','ⵃ'=>'ⵃ','ⵄ'=>'ⵄ','âµ…'=>'âµ…','ⵆ'=>'ⵆ','ⵇ'=>'ⵇ','ⵈ'=>'ⵈ','ⵉ'=>'ⵉ','ⵊ'=>'ⵊ','ⵋ'=>'ⵋ','ⵌ'=>'ⵌ','âµ'=>'âµ','ⵎ'=>'ⵎ','âµ'=>'âµ','âµ'=>'âµ','ⵑ'=>'ⵑ','âµ’'=>'âµ’','ⵓ'=>'ⵓ','âµ”'=>'âµ”','ⵕ'=>'ⵕ','âµ–'=>'âµ–','âµ—'=>'âµ—','ⵘ'=>'ⵘ','âµ™'=>'âµ™','ⵚ'=>'ⵚ','âµ›'=>'âµ›','ⵜ'=>'ⵜ','âµ'=>'âµ','ⵞ'=>'ⵞ','ⵟ'=>'ⵟ','âµ '=>'âµ ','ⵡ'=>'ⵡ','âµ¢'=>'âµ¢','âµ£'=>'âµ£','ⵤ'=>'ⵤ','âµ¥'=>'âµ¥','ⵯ'=>'ⵯ','ⶀ'=>'ⶀ','â¶'=>'â¶','ⶂ'=>'ⶂ','ⶃ'=>'ⶃ','ⶄ'=>'ⶄ','ⶅ'=>'ⶅ','ⶆ'=>'ⶆ','ⶇ'=>'ⶇ','ⶈ'=>'ⶈ','ⶉ'=>'ⶉ','ⶊ'=>'ⶊ','ⶋ'=>'ⶋ','ⶌ'=>'ⶌ','â¶'=>'â¶','ⶎ'=>'ⶎ','â¶'=>'â¶','â¶'=>'â¶','ⶑ'=>'ⶑ','ⶒ'=>'ⶒ','ⶓ'=>'ⶓ','ⶔ'=>'ⶔ','ⶕ'=>'ⶕ','ⶖ'=>'ⶖ','ⶠ'=>'ⶠ','ⶡ'=>'ⶡ','ⶢ'=>'ⶢ','ⶣ'=>'ⶣ','ⶤ'=>'ⶤ','ⶥ'=>'ⶥ','ⶦ'=>'ⶦ','ⶨ'=>'ⶨ','ⶩ'=>'ⶩ','ⶪ'=>'ⶪ','ⶫ'=>'ⶫ','ⶬ'=>'ⶬ','ⶭ'=>'ⶭ','ⶮ'=>'ⶮ','ⶰ'=>'ⶰ','ⶱ'=>'ⶱ','ⶲ'=>'ⶲ','ⶳ'=>'ⶳ','ⶴ'=>'ⶴ','ⶵ'=>'ⶵ','ⶶ'=>'ⶶ','ⶸ'=>'ⶸ','ⶹ'=>'ⶹ','ⶺ'=>'ⶺ','ⶻ'=>'ⶻ','ⶼ'=>'ⶼ','ⶽ'=>'ⶽ','ⶾ'=>'ⶾ','â·€'=>'â·€','â·'=>'â·','â·‚'=>'â·‚','â·ƒ'=>'â·ƒ','â·„'=>'â·„','â·…'=>'â·…','â·†'=>'â·†','â·ˆ'=>'â·ˆ','â·‰'=>'â·‰','â·Š'=>'â·Š','â·‹'=>'â·‹','â·Œ'=>'â·Œ','â·'=>'â·','â·Ž'=>'â·Ž','â·'=>'â·','â·‘'=>'â·‘','â·’'=>'â·’','â·“'=>'â·“','â·”'=>'â·”','â·•'=>'â·•','â·–'=>'â·–','â·˜'=>'â·˜','â·™'=>'â·™','â·š'=>'â·š','â·›'=>'â·›','â·œ'=>'â·œ','â·'=>'â·','â·ž'=>'â·ž'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_58.php b/sources/phpBB/includes/utf/data/search_indexer_58.php new file mode 100644 index 0000000..ec86a4b --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_58.php @@ -0,0 +1 @@ +'ð…¥','ð…¦'=>'ð…¦','ð…§'=>'ð…§','ð…¨'=>'ð…¨','ð…©'=>'ð…©','ð…­'=>'ð…­','ð…®'=>'ð…®','ð…¯'=>'ð…¯','ð…°'=>'ð…°','ð…±'=>'ð…±','ð…²'=>'ð…²','ð…»'=>'ð…»','ð…¼'=>'ð…¼','ð…½'=>'ð…½','ð…¾'=>'ð…¾','ð…¿'=>'ð…¿','ð†€'=>'ð†€','ð†'=>'ð†','ð†‚'=>'ð†‚','ð†…'=>'ð†…','ð††'=>'ð††','ð†‡'=>'ð†‡','ð†ˆ'=>'ð†ˆ','ð†‰'=>'ð†‰','ð†Š'=>'ð†Š','ð†‹'=>'ð†‹','ð†ª'=>'ð†ª','ð†«'=>'ð†«','ð†¬'=>'ð†¬','ð†­'=>'ð†­','ð‰‚'=>'ð‰‚','ð‰ƒ'=>'ð‰ƒ','ð‰„'=>'ð‰„','ð '=>'1','ð¡'=>'2','ð¢'=>'3','ð£'=>'4','ð¤'=>'5','ð¥'=>'6','ð¦'=>'7','ð§'=>'8','ð¨'=>'9','ð©'=>'10','ðª'=>'20','ð«'=>'30','ð¬'=>'40','ð­'=>'50','ð®'=>'60','ð¯'=>'70','ð°'=>'80','ð±'=>'90','ð€'=>'ð€','ð'=>'ð','ð‚'=>'ð‚','ðƒ'=>'ðƒ','ð„'=>'ð„','ð…'=>'ð…','ð†'=>'ð†','ð‡'=>'ð‡','ðˆ'=>'ðˆ','ð‰'=>'ð‰','ðŠ'=>'ðŠ','ð‹'=>'ð‹','ðŒ'=>'ðŒ','ð'=>'ð','ðŽ'=>'ðŽ','ð'=>'ð','ð'=>'ð','ð‘'=>'ð‘','ð’'=>'ð’','ð“'=>'ð“','ð”'=>'ð”','ð•'=>'ð•','ð–'=>'ð–','ð—'=>'ð—','ð˜'=>'ð˜','ð™'=>'ð™','ðš'=>'ðš','ð›'=>'ð›','ðœ'=>'ðœ','ð'=>'ð','ðž'=>'ðž','ðŸ'=>'ðŸ','ð '=>'ð ','ð¡'=>'ð¡','ð¢'=>'ð¢','ð£'=>'ð£','ð¤'=>'ð¤','ð¥'=>'ð¥','ð¦'=>'ð¦','ð§'=>'ð§','ð¨'=>'ð¨','ð©'=>'ð©','ðª'=>'ðª','ð«'=>'ð«','ð¬'=>'ð¬','ð­'=>'ð­','ð®'=>'ð®','ð¯'=>'ð¯','ð°'=>'ð°','ð±'=>'ð±','ð²'=>'ð²','ð³'=>'ð³','ð´'=>'ð´','ðµ'=>'ðµ','ð¶'=>'ð¶','ð·'=>'ð·','ð¸'=>'ð¸','ð¹'=>'ð¹','ðº'=>'ðº','ð»'=>'ð»','ð¼'=>'ð¼','ð½'=>'ð½','ð¾'=>'ð¾','ð¿'=>'ð¿','ð‘€'=>'ð‘€','ð‘'=>'ð‘','ð‘‚'=>'ð‘‚','ð‘ƒ'=>'ð‘ƒ','ð‘„'=>'ð‘„','ð‘…'=>'ð‘…','ð‘†'=>'ð‘†','ð‘‡'=>'ð‘‡','ð‘ˆ'=>'ð‘ˆ','ð‘‰'=>'ð‘‰','ð‘Š'=>'ð‘Š','ð‘‹'=>'ð‘‹','ð‘Œ'=>'ð‘Œ','ð‘'=>'ð‘','ð‘Ž'=>'ð‘Ž','ð‘'=>'ð‘','ð‘'=>'ð‘','ð‘‘'=>'ð‘‘','ð‘’'=>'ð‘’','ð‘“'=>'ð‘“','ð‘”'=>'ð‘”','ð‘–'=>'ð‘–','ð‘—'=>'ð‘—','ð‘˜'=>'ð‘˜','ð‘™'=>'ð‘™','ð‘š'=>'ð‘š','ð‘›'=>'ð‘›','ð‘œ'=>'ð‘œ','ð‘'=>'ð‘','ð‘ž'=>'ð‘ž','ð‘Ÿ'=>'ð‘Ÿ','ð‘ '=>'ð‘ ','ð‘¡'=>'ð‘¡','ð‘¢'=>'ð‘¢','ð‘£'=>'ð‘£','ð‘¤'=>'ð‘¤','ð‘¥'=>'ð‘¥','ð‘¦'=>'ð‘¦','ð‘§'=>'ð‘§','ð‘¨'=>'ð‘¨','ð‘©'=>'ð‘©','ð‘ª'=>'ð‘ª','ð‘«'=>'ð‘«','ð‘¬'=>'ð‘¬','ð‘­'=>'ð‘­','ð‘®'=>'ð‘®','ð‘¯'=>'ð‘¯','ð‘°'=>'ð‘°','ð‘±'=>'ð‘±','ð‘²'=>'ð‘²','ð‘³'=>'ð‘³','ð‘´'=>'ð‘´','ð‘µ'=>'ð‘µ','ð‘¶'=>'ð‘¶','ð‘·'=>'ð‘·','ð‘¸'=>'ð‘¸','ð‘¹'=>'ð‘¹','ð‘º'=>'ð‘º','ð‘»'=>'ð‘»','ð‘¼'=>'ð‘¼','ð‘½'=>'ð‘½','ð‘¾'=>'ð‘¾','ð‘¿'=>'ð‘¿','ð’€'=>'ð’€','ð’'=>'ð’','ð’‚'=>'ð’‚','ð’ƒ'=>'ð’ƒ','ð’„'=>'ð’„','ð’…'=>'ð’…','ð’†'=>'ð’†','ð’‡'=>'ð’‡','ð’ˆ'=>'ð’ˆ','ð’‰'=>'ð’‰','ð’Š'=>'ð’Š','ð’‹'=>'ð’‹','ð’Œ'=>'ð’Œ','ð’'=>'ð’','ð’Ž'=>'ð’Ž','ð’'=>'ð’','ð’'=>'ð’','ð’‘'=>'ð’‘','ð’’'=>'ð’’','ð’“'=>'ð’“','ð’”'=>'ð’”','ð’•'=>'ð’•','ð’–'=>'ð’–','ð’—'=>'ð’—','ð’˜'=>'ð’˜','ð’™'=>'ð’™','ð’š'=>'ð’š','ð’›'=>'ð’›','ð’œ'=>'ð’œ','ð’ž'=>'ð’ž','ð’Ÿ'=>'ð’Ÿ','ð’¢'=>'ð’¢','ð’¥'=>'ð’¥','ð’¦'=>'ð’¦','ð’©'=>'ð’©','ð’ª'=>'ð’ª','ð’«'=>'ð’«','ð’¬'=>'ð’¬','ð’®'=>'ð’®','ð’¯'=>'ð’¯','ð’°'=>'ð’°','ð’±'=>'ð’±','ð’²'=>'ð’²','ð’³'=>'ð’³','ð’´'=>'ð’´','ð’µ'=>'ð’µ','ð’¶'=>'ð’¶','ð’·'=>'ð’·','ð’¸'=>'ð’¸','ð’¹'=>'ð’¹','ð’»'=>'ð’»','ð’½'=>'ð’½','ð’¾'=>'ð’¾','ð’¿'=>'ð’¿','ð“€'=>'ð“€','ð“'=>'ð“','ð“‚'=>'ð“‚','ð“ƒ'=>'ð“ƒ','ð“…'=>'ð“…','ð“†'=>'ð“†','ð“‡'=>'ð“‡','ð“ˆ'=>'ð“ˆ','ð“‰'=>'ð“‰','ð“Š'=>'ð“Š','ð“‹'=>'ð“‹','ð“Œ'=>'ð“Œ','ð“'=>'ð“','ð“Ž'=>'ð“Ž','ð“'=>'ð“','ð“'=>'ð“','ð“‘'=>'ð“‘','ð“’'=>'ð“’','ð““'=>'ð““','ð“”'=>'ð“”','ð“•'=>'ð“•','ð“–'=>'ð“–','ð“—'=>'ð“—','ð“˜'=>'ð“˜','ð“™'=>'ð“™','ð“š'=>'ð“š','ð“›'=>'ð“›','ð“œ'=>'ð“œ','ð“'=>'ð“','ð“ž'=>'ð“ž','ð“Ÿ'=>'ð“Ÿ','ð“ '=>'ð“ ','ð“¡'=>'ð“¡','ð“¢'=>'ð“¢','ð“£'=>'ð“£','ð“¤'=>'ð“¤','ð“¥'=>'ð“¥','ð“¦'=>'ð“¦','ð“§'=>'ð“§','ð“¨'=>'ð“¨','ð“©'=>'ð“©','ð“ª'=>'ð“ª','ð“«'=>'ð“«','ð“¬'=>'ð“¬','ð“­'=>'ð“­','ð“®'=>'ð“®','ð“¯'=>'ð“¯','ð“°'=>'ð“°','ð“±'=>'ð“±','ð“²'=>'ð“²','ð“³'=>'ð“³','ð“´'=>'ð“´','ð“µ'=>'ð“µ','ð“¶'=>'ð“¶','ð“·'=>'ð“·','ð“¸'=>'ð“¸','ð“¹'=>'ð“¹','ð“º'=>'ð“º','ð“»'=>'ð“»','ð“¼'=>'ð“¼','ð“½'=>'ð“½','ð“¾'=>'ð“¾','ð“¿'=>'ð“¿','ð”€'=>'ð”€','ð”'=>'ð”','ð”‚'=>'ð”‚','ð”ƒ'=>'ð”ƒ','ð”„'=>'ð”„','ð”…'=>'ð”…','ð”‡'=>'ð”‡','ð”ˆ'=>'ð”ˆ','ð”‰'=>'ð”‰','ð”Š'=>'ð”Š','ð”'=>'ð”','ð”Ž'=>'ð”Ž','ð”'=>'ð”','ð”'=>'ð”','ð”‘'=>'ð”‘','ð”’'=>'ð”’','ð”“'=>'ð”“','ð””'=>'ð””','ð”–'=>'ð”–','ð”—'=>'ð”—','ð”˜'=>'ð”˜','ð”™'=>'ð”™','ð”š'=>'ð”š','ð”›'=>'ð”›','ð”œ'=>'ð”œ','ð”ž'=>'ð”ž','ð”Ÿ'=>'ð”Ÿ','ð” '=>'ð” ','ð”¡'=>'ð”¡','ð”¢'=>'ð”¢','ð”£'=>'ð”£','ð”¤'=>'ð”¤','ð”¥'=>'ð”¥','ð”¦'=>'ð”¦','ð”§'=>'ð”§','ð”¨'=>'ð”¨','ð”©'=>'ð”©','ð”ª'=>'ð”ª','ð”«'=>'ð”«','ð”¬'=>'ð”¬','ð”­'=>'ð”­','ð”®'=>'ð”®','ð”¯'=>'ð”¯','ð”°'=>'ð”°','ð”±'=>'ð”±','ð”²'=>'ð”²','ð”³'=>'ð”³','ð”´'=>'ð”´','ð”µ'=>'ð”µ','ð”¶'=>'ð”¶','ð”·'=>'ð”·','ð”¸'=>'ð”¸','ð”¹'=>'ð”¹','ð”»'=>'ð”»','ð”¼'=>'ð”¼','ð”½'=>'ð”½','ð”¾'=>'ð”¾','ð•€'=>'ð•€','ð•'=>'ð•','ð•‚'=>'ð•‚','ð•ƒ'=>'ð•ƒ','ð•„'=>'ð•„','ð•†'=>'ð•†','ð•Š'=>'ð•Š','ð•‹'=>'ð•‹','ð•Œ'=>'ð•Œ','ð•'=>'ð•','ð•Ž'=>'ð•Ž','ð•'=>'ð•','ð•'=>'ð•','ð•’'=>'ð•’','ð•“'=>'ð•“','ð•”'=>'ð•”','ð••'=>'ð••','ð•–'=>'ð•–','ð•—'=>'ð•—','ð•˜'=>'ð•˜','ð•™'=>'ð•™','ð•š'=>'ð•š','ð•›'=>'ð•›','ð•œ'=>'ð•œ','ð•'=>'ð•','ð•ž'=>'ð•ž','ð•Ÿ'=>'ð•Ÿ','ð• '=>'ð• ','ð•¡'=>'ð•¡','ð•¢'=>'ð•¢','ð•£'=>'ð•£','ð•¤'=>'ð•¤','ð•¥'=>'ð•¥','ð•¦'=>'ð•¦','ð•§'=>'ð•§','ð•¨'=>'ð•¨','ð•©'=>'ð•©','ð•ª'=>'ð•ª','ð•«'=>'ð•«','ð•¬'=>'ð•¬','ð•­'=>'ð•­','ð•®'=>'ð•®','ð•¯'=>'ð•¯','ð•°'=>'ð•°','ð•±'=>'ð•±','ð•²'=>'ð•²','ð•³'=>'ð•³','ð•´'=>'ð•´','ð•µ'=>'ð•µ','ð•¶'=>'ð•¶','ð•·'=>'ð•·','ð•¸'=>'ð•¸','ð•¹'=>'ð•¹','ð•º'=>'ð•º','ð•»'=>'ð•»','ð•¼'=>'ð•¼','ð•½'=>'ð•½','ð•¾'=>'ð•¾','ð•¿'=>'ð•¿','ð–€'=>'ð–€','ð–'=>'ð–','ð–‚'=>'ð–‚','ð–ƒ'=>'ð–ƒ','ð–„'=>'ð–„','ð–…'=>'ð–…','ð–†'=>'ð–†','ð–‡'=>'ð–‡','ð–ˆ'=>'ð–ˆ','ð–‰'=>'ð–‰','ð–Š'=>'ð–Š','ð–‹'=>'ð–‹','ð–Œ'=>'ð–Œ','ð–'=>'ð–','ð–Ž'=>'ð–Ž','ð–'=>'ð–','ð–'=>'ð–','ð–‘'=>'ð–‘','ð–’'=>'ð–’','ð–“'=>'ð–“','ð–”'=>'ð–”','ð–•'=>'ð–•','ð––'=>'ð––','ð–—'=>'ð–—','ð–˜'=>'ð–˜','ð–™'=>'ð–™','ð–š'=>'ð–š','ð–›'=>'ð–›','ð–œ'=>'ð–œ','ð–'=>'ð–','ð–ž'=>'ð–ž','ð–Ÿ'=>'ð–Ÿ','ð– '=>'ð– ','ð–¡'=>'ð–¡','ð–¢'=>'ð–¢','ð–£'=>'ð–£','ð–¤'=>'ð–¤','ð–¥'=>'ð–¥','ð–¦'=>'ð–¦','ð–§'=>'ð–§','ð–¨'=>'ð–¨','ð–©'=>'ð–©','ð–ª'=>'ð–ª','ð–«'=>'ð–«','ð–¬'=>'ð–¬','ð–­'=>'ð–­','ð–®'=>'ð–®','ð–¯'=>'ð–¯','ð–°'=>'ð–°','ð–±'=>'ð–±','ð–²'=>'ð–²','ð–³'=>'ð–³','ð–´'=>'ð–´','ð–µ'=>'ð–µ','ð–¶'=>'ð–¶','ð–·'=>'ð–·','ð–¸'=>'ð–¸','ð–¹'=>'ð–¹','ð–º'=>'ð–º','ð–»'=>'ð–»','ð–¼'=>'ð–¼','ð–½'=>'ð–½','ð–¾'=>'ð–¾','ð–¿'=>'ð–¿','ð—€'=>'ð—€','ð—'=>'ð—','ð—‚'=>'ð—‚','ð—ƒ'=>'ð—ƒ','ð—„'=>'ð—„','ð—…'=>'ð—…','ð—†'=>'ð—†','ð—‡'=>'ð—‡','ð—ˆ'=>'ð—ˆ','ð—‰'=>'ð—‰','ð—Š'=>'ð—Š','ð—‹'=>'ð—‹','ð—Œ'=>'ð—Œ','ð—'=>'ð—','ð—Ž'=>'ð—Ž','ð—'=>'ð—','ð—'=>'ð—','ð—‘'=>'ð—‘','ð—’'=>'ð—’','ð—“'=>'ð—“','ð—”'=>'ð—”','ð—•'=>'ð—•','ð—–'=>'ð—–','ð——'=>'ð——','ð—˜'=>'ð—˜','ð—™'=>'ð—™','ð—š'=>'ð—š','ð—›'=>'ð—›','ð—œ'=>'ð—œ','ð—'=>'ð—','ð—ž'=>'ð—ž','ð—Ÿ'=>'ð—Ÿ','ð— '=>'ð— ','ð—¡'=>'ð—¡','ð—¢'=>'ð—¢','ð—£'=>'ð—£','ð—¤'=>'ð—¤','ð—¥'=>'ð—¥','ð—¦'=>'ð—¦','ð—§'=>'ð—§','ð—¨'=>'ð—¨','ð—©'=>'ð—©','ð—ª'=>'ð—ª','ð—«'=>'ð—«','ð—¬'=>'ð—¬','ð—­'=>'ð—­','ð—®'=>'ð—®','ð—¯'=>'ð—¯','ð—°'=>'ð—°','ð—±'=>'ð—±','ð—²'=>'ð—²','ð—³'=>'ð—³','ð—´'=>'ð—´','ð—µ'=>'ð—µ','ð—¶'=>'ð—¶','ð—·'=>'ð—·','ð—¸'=>'ð—¸','ð—¹'=>'ð—¹','ð—º'=>'ð—º','ð—»'=>'ð—»','ð—¼'=>'ð—¼','ð—½'=>'ð—½','ð—¾'=>'ð—¾','ð—¿'=>'ð—¿','ð˜€'=>'ð˜€','ð˜'=>'ð˜','ð˜‚'=>'ð˜‚','ð˜ƒ'=>'ð˜ƒ','ð˜„'=>'ð˜„','ð˜…'=>'ð˜…','ð˜†'=>'ð˜†','ð˜‡'=>'ð˜‡','ð˜ˆ'=>'ð˜ˆ','ð˜‰'=>'ð˜‰','ð˜Š'=>'ð˜Š','ð˜‹'=>'ð˜‹','ð˜Œ'=>'ð˜Œ','ð˜'=>'ð˜','ð˜Ž'=>'ð˜Ž','ð˜'=>'ð˜','ð˜'=>'ð˜','ð˜‘'=>'ð˜‘','ð˜’'=>'ð˜’','ð˜“'=>'ð˜“','ð˜”'=>'ð˜”','ð˜•'=>'ð˜•','ð˜–'=>'ð˜–','ð˜—'=>'ð˜—','ð˜˜'=>'ð˜˜','ð˜™'=>'ð˜™','ð˜š'=>'ð˜š','ð˜›'=>'ð˜›','ð˜œ'=>'ð˜œ','ð˜'=>'ð˜','ð˜ž'=>'ð˜ž','ð˜Ÿ'=>'ð˜Ÿ','ð˜ '=>'ð˜ ','ð˜¡'=>'ð˜¡','ð˜¢'=>'ð˜¢','ð˜£'=>'ð˜£','ð˜¤'=>'ð˜¤','ð˜¥'=>'ð˜¥','ð˜¦'=>'ð˜¦','ð˜§'=>'ð˜§','ð˜¨'=>'ð˜¨','ð˜©'=>'ð˜©','ð˜ª'=>'ð˜ª','ð˜«'=>'ð˜«','ð˜¬'=>'ð˜¬','ð˜­'=>'ð˜­','ð˜®'=>'ð˜®','ð˜¯'=>'ð˜¯','ð˜°'=>'ð˜°','ð˜±'=>'ð˜±','ð˜²'=>'ð˜²','ð˜³'=>'ð˜³','ð˜´'=>'ð˜´','ð˜µ'=>'ð˜µ','ð˜¶'=>'ð˜¶','ð˜·'=>'ð˜·','ð˜¸'=>'ð˜¸','ð˜¹'=>'ð˜¹','ð˜º'=>'ð˜º','ð˜»'=>'ð˜»','ð˜¼'=>'ð˜¼','ð˜½'=>'ð˜½','ð˜¾'=>'ð˜¾','ð˜¿'=>'ð˜¿','ð™€'=>'ð™€','ð™'=>'ð™','ð™‚'=>'ð™‚','ð™ƒ'=>'ð™ƒ','ð™„'=>'ð™„','ð™…'=>'ð™…','ð™†'=>'ð™†','ð™‡'=>'ð™‡','ð™ˆ'=>'ð™ˆ','ð™‰'=>'ð™‰','ð™Š'=>'ð™Š','ð™‹'=>'ð™‹','ð™Œ'=>'ð™Œ','ð™'=>'ð™','ð™Ž'=>'ð™Ž','ð™'=>'ð™','ð™'=>'ð™','ð™‘'=>'ð™‘','ð™’'=>'ð™’','ð™“'=>'ð™“','ð™”'=>'ð™”','ð™•'=>'ð™•','ð™–'=>'ð™–','ð™—'=>'ð™—','ð™˜'=>'ð™˜','ð™™'=>'ð™™','ð™š'=>'ð™š','ð™›'=>'ð™›','ð™œ'=>'ð™œ','ð™'=>'ð™','ð™ž'=>'ð™ž','ð™Ÿ'=>'ð™Ÿ','ð™ '=>'ð™ ','ð™¡'=>'ð™¡','ð™¢'=>'ð™¢','ð™£'=>'ð™£','ð™¤'=>'ð™¤','ð™¥'=>'ð™¥','ð™¦'=>'ð™¦','ð™§'=>'ð™§','ð™¨'=>'ð™¨','ð™©'=>'ð™©','ð™ª'=>'ð™ª','ð™«'=>'ð™«','ð™¬'=>'ð™¬','ð™­'=>'ð™­','ð™®'=>'ð™®','ð™¯'=>'ð™¯','ð™°'=>'ð™°','ð™±'=>'ð™±','ð™²'=>'ð™²','ð™³'=>'ð™³','ð™´'=>'ð™´','ð™µ'=>'ð™µ','ð™¶'=>'ð™¶','ð™·'=>'ð™·','ð™¸'=>'ð™¸','ð™¹'=>'ð™¹','ð™º'=>'ð™º','ð™»'=>'ð™»','ð™¼'=>'ð™¼','ð™½'=>'ð™½','ð™¾'=>'ð™¾','ð™¿'=>'ð™¿','ðš€'=>'ðš€','ðš'=>'ðš','ðš‚'=>'ðš‚','ðšƒ'=>'ðšƒ','ðš„'=>'ðš„','ðš…'=>'ðš…','ðš†'=>'ðš†','ðš‡'=>'ðš‡','ðšˆ'=>'ðšˆ','ðš‰'=>'ðš‰','ðšŠ'=>'ðšŠ','ðš‹'=>'ðš‹','ðšŒ'=>'ðšŒ','ðš'=>'ðš','ðšŽ'=>'ðšŽ','ðš'=>'ðš','ðš'=>'ðš','ðš‘'=>'ðš‘','ðš’'=>'ðš’','ðš“'=>'ðš“','ðš”'=>'ðš”','ðš•'=>'ðš•','ðš–'=>'ðš–','ðš—'=>'ðš—','ðš˜'=>'ðš˜','ðš™'=>'ðš™','ðšš'=>'ðšš','ðš›'=>'ðš›','ðšœ'=>'ðšœ','ðš'=>'ðš','ðšž'=>'ðšž','ðšŸ'=>'ðšŸ','ðš '=>'ðš ','ðš¡'=>'ðš¡','ðš¢'=>'ðš¢','ðš£'=>'ðš£','ðš¤'=>'ðš¤','ðš¥'=>'ðš¥','ðš¨'=>'ðš¨','ðš©'=>'ðš©','ðšª'=>'ðšª','ðš«'=>'ðš«','ðš¬'=>'ðš¬','ðš­'=>'ðš­','ðš®'=>'ðš®','ðš¯'=>'ðš¯','ðš°'=>'ðš°','ðš±'=>'ðš±','ðš²'=>'ðš²','ðš³'=>'ðš³','ðš´'=>'ðš´','ðšµ'=>'ðšµ','ðš¶'=>'ðš¶','ðš·'=>'ðš·','ðš¸'=>'ðš¸','ðš¹'=>'ðš¹','ðšº'=>'ðšº','ðš»'=>'ðš»','ðš¼'=>'ðš¼','ðš½'=>'ðš½','ðš¾'=>'ðš¾','ðš¿'=>'ðš¿','ð›€'=>'ð›€','ð›‚'=>'ð›‚','ð›ƒ'=>'ð›ƒ','ð›„'=>'ð›„','ð›…'=>'ð›…','ð›†'=>'ð›†','ð›‡'=>'ð›‡','ð›ˆ'=>'ð›ˆ','ð›‰'=>'ð›‰','ð›Š'=>'ð›Š','ð›‹'=>'ð›‹','ð›Œ'=>'ð›Œ','ð›'=>'ð›','ð›Ž'=>'ð›Ž','ð›'=>'ð›','ð›'=>'ð›','ð›‘'=>'ð›‘','ð›’'=>'ð›’','ð›“'=>'ð›“','ð›”'=>'ð›”','ð›•'=>'ð›•','ð›–'=>'ð›–','ð›—'=>'ð›—','ð›˜'=>'ð›˜','ð›™'=>'ð›™','ð›š'=>'ð›š','ð›œ'=>'ð›œ','ð›'=>'ð›','ð›ž'=>'ð›ž','ð›Ÿ'=>'ð›Ÿ','ð› '=>'ð› ','ð›¡'=>'ð›¡','ð›¢'=>'ð›¢','ð›£'=>'ð›£','ð›¤'=>'ð›¤','ð›¥'=>'ð›¥','ð›¦'=>'ð›¦','ð›§'=>'ð›§','ð›¨'=>'ð›¨','ð›©'=>'ð›©','ð›ª'=>'ð›ª','ð›«'=>'ð›«','ð›¬'=>'ð›¬','ð›­'=>'ð›­','ð›®'=>'ð›®','ð›¯'=>'ð›¯','ð›°'=>'ð›°','ð›±'=>'ð›±','ð›²'=>'ð›²','ð›³'=>'ð›³','ð›´'=>'ð›´','ð›µ'=>'ð›µ','ð›¶'=>'ð›¶','ð›·'=>'ð›·','ð›¸'=>'ð›¸','ð›¹'=>'ð›¹','ð›º'=>'ð›º','ð›¼'=>'ð›¼','ð›½'=>'ð›½','ð›¾'=>'ð›¾','ð›¿'=>'ð›¿','ðœ€'=>'ðœ€','ðœ'=>'ðœ','ðœ‚'=>'ðœ‚','ðœƒ'=>'ðœƒ','ðœ„'=>'ðœ„','ðœ…'=>'ðœ…','ðœ†'=>'ðœ†','ðœ‡'=>'ðœ‡','ðœˆ'=>'ðœˆ','ðœ‰'=>'ðœ‰','ðœŠ'=>'ðœŠ','ðœ‹'=>'ðœ‹','ðœŒ'=>'ðœŒ','ðœ'=>'ðœ','ðœŽ'=>'ðœŽ','ðœ'=>'ðœ','ðœ'=>'ðœ','ðœ‘'=>'ðœ‘','ðœ’'=>'ðœ’','ðœ“'=>'ðœ“','ðœ”'=>'ðœ”','ðœ–'=>'ðœ–','ðœ—'=>'ðœ—','ðœ˜'=>'ðœ˜','ðœ™'=>'ðœ™','ðœš'=>'ðœš','ðœ›'=>'ðœ›','ðœœ'=>'ðœœ','ðœ'=>'ðœ','ðœž'=>'ðœž','ðœŸ'=>'ðœŸ','ðœ '=>'ðœ ','ðœ¡'=>'ðœ¡','ðœ¢'=>'ðœ¢','ðœ£'=>'ðœ£','ðœ¤'=>'ðœ¤','ðœ¥'=>'ðœ¥','ðœ¦'=>'ðœ¦','ðœ§'=>'ðœ§','ðœ¨'=>'ðœ¨','ðœ©'=>'ðœ©','ðœª'=>'ðœª','ðœ«'=>'ðœ«','ðœ¬'=>'ðœ¬','ðœ­'=>'ðœ­','ðœ®'=>'ðœ®','ðœ¯'=>'ðœ¯','ðœ°'=>'ðœ°','ðœ±'=>'ðœ±','ðœ²'=>'ðœ²','ðœ³'=>'ðœ³','ðœ´'=>'ðœ´','ðœ¶'=>'ðœ¶','ðœ·'=>'ðœ·','ðœ¸'=>'ðœ¸','ðœ¹'=>'ðœ¹','ðœº'=>'ðœº','ðœ»'=>'ðœ»','ðœ¼'=>'ðœ¼','ðœ½'=>'ðœ½','ðœ¾'=>'ðœ¾','ðœ¿'=>'ðœ¿','ð€'=>'ð€','ð'=>'ð','ð‚'=>'ð‚','ðƒ'=>'ðƒ','ð„'=>'ð„','ð…'=>'ð…','ð†'=>'ð†','ð‡'=>'ð‡','ðˆ'=>'ðˆ','ð‰'=>'ð‰','ðŠ'=>'ðŠ','ð‹'=>'ð‹','ðŒ'=>'ðŒ','ð'=>'ð','ðŽ'=>'ðŽ','ð'=>'ð','ð‘'=>'ð‘','ð’'=>'ð’','ð“'=>'ð“','ð”'=>'ð”','ð•'=>'ð•','ð–'=>'ð–','ð—'=>'ð—','ð˜'=>'ð˜','ð™'=>'ð™','ðš'=>'ðš','ð›'=>'ð›','ðœ'=>'ðœ','ð'=>'ð','ðž'=>'ðž','ðŸ'=>'ðŸ','ð '=>'ð ','ð¡'=>'ð¡','ð¢'=>'ð¢','ð£'=>'ð£','ð¤'=>'ð¤','ð¥'=>'ð¥','ð¦'=>'ð¦','ð§'=>'ð§','ð¨'=>'ð¨','ð©'=>'ð©','ðª'=>'ðª','ð«'=>'ð«','ð¬'=>'ð¬','ð­'=>'ð­','ð®'=>'ð®','ð°'=>'ð°','ð±'=>'ð±','ð²'=>'ð²','ð³'=>'ð³','ð´'=>'ð´','ðµ'=>'ðµ','ð¶'=>'ð¶','ð·'=>'ð·','ð¸'=>'ð¸','ð¹'=>'ð¹','ðº'=>'ðº','ð»'=>'ð»','ð¼'=>'ð¼','ð½'=>'ð½','ð¾'=>'ð¾','ð¿'=>'ð¿','ðž€'=>'ðž€','ðž'=>'ðž','ðž‚'=>'ðž‚','ðžƒ'=>'ðžƒ','ðž„'=>'ðž„','ðž…'=>'ðž…','ðž†'=>'ðž†','ðž‡'=>'ðž‡','ðžˆ'=>'ðžˆ','ðžŠ'=>'ðžŠ','ðž‹'=>'ðž‹','ðžŒ'=>'ðžŒ','ðž'=>'ðž','ðžŽ'=>'ðžŽ','ðž'=>'ðž','ðž'=>'ðž','ðž‘'=>'ðž‘','ðž’'=>'ðž’','ðž“'=>'ðž“','ðž”'=>'ðž”','ðž•'=>'ðž•','ðž–'=>'ðž–','ðž—'=>'ðž—','ðž˜'=>'ðž˜','ðž™'=>'ðž™','ðžš'=>'ðžš','ðž›'=>'ðž›','ðžœ'=>'ðžœ','ðž'=>'ðž','ðžž'=>'ðžž','ðžŸ'=>'ðžŸ','ðž '=>'ðž ','ðž¡'=>'ðž¡','ðž¢'=>'ðž¢','ðž£'=>'ðž£','ðž¤'=>'ðž¤','ðž¥'=>'ðž¥','ðž¦'=>'ðž¦','ðž§'=>'ðž§','ðž¨'=>'ðž¨','ðžª'=>'ðžª','ðž«'=>'ðž«','ðž¬'=>'ðž¬','ðž­'=>'ðž­','ðž®'=>'ðž®','ðž¯'=>'ðž¯','ðž°'=>'ðž°','ðž±'=>'ðž±','ðž²'=>'ðž²','ðž³'=>'ðž³','ðž´'=>'ðž´','ðžµ'=>'ðžµ','ðž¶'=>'ðž¶','ðž·'=>'ðž·','ðž¸'=>'ðž¸','ðž¹'=>'ðž¹','ðžº'=>'ðžº','ðž»'=>'ðž»','ðž¼'=>'ðž¼','ðž½'=>'ðž½','ðž¾'=>'ðž¾','ðž¿'=>'ðž¿','ðŸ€'=>'ðŸ€','ðŸ'=>'ðŸ','ðŸ‚'=>'ðŸ‚','ðŸ„'=>'ðŸ„','ðŸ…'=>'ðŸ…','ðŸ†'=>'ðŸ†','ðŸ‡'=>'ðŸ‡','ðŸˆ'=>'ðŸˆ','ðŸ‰'=>'ðŸ‰','ðŸŠ'=>'ðŸŠ','ðŸ‹'=>'ðŸ‹','ðŸŽ'=>'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/sources/phpBB/includes/utf/data/search_indexer_6.php b/sources/phpBB/includes/utf/data/search_indexer_6.php new file mode 100644 index 0000000..1ccce03 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_6.php @@ -0,0 +1 @@ +'々','〆'=>'〆','〇'=>'0','〡'=>'1','〢'=>'2','〣'=>'3','〤'=>'4','〥'=>'5','〦'=>'6','〧'=>'7','〨'=>'8','〩'=>'9','〪'=>'〪','〫'=>'〫','〬'=>'〬','〭'=>'〭','〮'=>'〮','〯'=>'〯','〱'=>'〱','〲'=>'〲','〳'=>'〳','〴'=>'〴','〵'=>'〵','〸'=>'10','〹'=>'20','〺'=>'30','〻'=>'〻','〼'=>'〼','ã'=>'ã','ã‚'=>'ã‚','ãƒ'=>'ãƒ','ã„'=>'ã„','ã…'=>'ã…','ã†'=>'ã†','ã‡'=>'ã‡','ãˆ'=>'ãˆ','ã‰'=>'ã‰','ãŠ'=>'ãŠ','ã‹'=>'ã‹','ãŒ'=>'ãŒ','ã'=>'ã','ãŽ'=>'ãŽ','ã'=>'ã','ã'=>'ã','ã‘'=>'ã‘','ã’'=>'ã’','ã“'=>'ã“','ã”'=>'ã”','ã•'=>'ã•','ã–'=>'ã–','ã—'=>'ã—','ã˜'=>'ã˜','ã™'=>'ã™','ãš'=>'ãš','ã›'=>'ã›','ãœ'=>'ãœ','ã'=>'ã','ãž'=>'ãž','ãŸ'=>'ãŸ','ã '=>'ã ','ã¡'=>'ã¡','ã¢'=>'ã¢','ã£'=>'ã£','ã¤'=>'ã¤','ã¥'=>'ã¥','ã¦'=>'ã¦','ã§'=>'ã§','ã¨'=>'ã¨','ã©'=>'ã©','ãª'=>'ãª','ã«'=>'ã«','ã¬'=>'ã¬','ã­'=>'ã­','ã®'=>'ã®','ã¯'=>'ã¯','ã°'=>'ã°','ã±'=>'ã±','ã²'=>'ã²','ã³'=>'ã³','ã´'=>'ã´','ãµ'=>'ãµ','ã¶'=>'ã¶','ã·'=>'ã·','ã¸'=>'ã¸','ã¹'=>'ã¹','ãº'=>'ãº','ã»'=>'ã»','ã¼'=>'ã¼','ã½'=>'ã½','ã¾'=>'ã¾','ã¿'=>'ã¿','ã‚€'=>'ã‚€','ã‚'=>'ã‚','ã‚‚'=>'ã‚‚','ゃ'=>'ゃ','ã‚„'=>'ã‚„','ã‚…'=>'ã‚…','ゆ'=>'ゆ','ょ'=>'ょ','よ'=>'よ','ら'=>'ら','ã‚Š'=>'ã‚Š','ã‚‹'=>'ã‚‹','ã‚Œ'=>'ã‚Œ','ã‚'=>'ã‚','ã‚Ž'=>'ã‚Ž','ã‚'=>'ã‚','ã‚'=>'ã‚','ã‚‘'=>'ã‚‘','ã‚’'=>'ã‚’','ã‚“'=>'ã‚“','ã‚”'=>'ã‚”','ã‚•'=>'ã‚•','ã‚–'=>'ã‚–','ã‚™'=>'ã‚™','ã‚š'=>'ã‚š','ã‚'=>'ã‚','ã‚ž'=>'ã‚ž','ã‚Ÿ'=>'ã‚Ÿ','ã‚¡'=>'ã‚¡','ã‚¢'=>'ã‚¢','ã‚£'=>'ã‚£','イ'=>'イ','ã‚¥'=>'ã‚¥','ウ'=>'ウ','ェ'=>'ェ','エ'=>'エ','ã‚©'=>'ã‚©','オ'=>'オ','ã‚«'=>'ã‚«','ガ'=>'ガ','ã‚­'=>'ã‚­','ã‚®'=>'ã‚®','ク'=>'ク','ã‚°'=>'ã‚°','ケ'=>'ケ','ゲ'=>'ゲ','コ'=>'コ','ã‚´'=>'ã‚´','サ'=>'サ','ザ'=>'ザ','ã‚·'=>'ã‚·','ジ'=>'ジ','ス'=>'ス','ズ'=>'ズ','ã‚»'=>'ã‚»','ゼ'=>'ゼ','ソ'=>'ソ','ゾ'=>'ゾ','ã‚¿'=>'ã‚¿','ダ'=>'ダ','ãƒ'=>'ãƒ','ヂ'=>'ヂ','ッ'=>'ッ','ツ'=>'ツ','ヅ'=>'ヅ','テ'=>'テ','デ'=>'デ','ト'=>'ト','ド'=>'ド','ナ'=>'ナ','ニ'=>'ニ','ヌ'=>'ヌ','ãƒ'=>'ãƒ','ノ'=>'ノ','ãƒ'=>'ãƒ','ãƒ'=>'ãƒ','パ'=>'パ','ヒ'=>'ヒ','ビ'=>'ビ','ピ'=>'ピ','フ'=>'フ','ブ'=>'ブ','プ'=>'プ','ヘ'=>'ヘ','ベ'=>'ベ','ペ'=>'ペ','ホ'=>'ホ','ボ'=>'ボ','ãƒ'=>'ãƒ','マ'=>'マ','ミ'=>'ミ','ム'=>'ム','メ'=>'メ','モ'=>'モ','ャ'=>'ャ','ヤ'=>'ヤ','ュ'=>'ュ','ユ'=>'ユ','ョ'=>'ョ','ヨ'=>'ヨ','ラ'=>'ラ','リ'=>'リ','ル'=>'ル','レ'=>'レ','ロ'=>'ロ','ヮ'=>'ヮ','ワ'=>'ワ','ヰ'=>'ヰ','ヱ'=>'ヱ','ヲ'=>'ヲ','ン'=>'ン','ヴ'=>'ヴ','ヵ'=>'ヵ','ヶ'=>'ヶ','ヷ'=>'ヷ','ヸ'=>'ヸ','ヹ'=>'ヹ','ヺ'=>'ヺ','ー'=>'ー','ヽ'=>'ヽ','ヾ'=>'ヾ','ヿ'=>'ヿ','ã„…'=>'ã„…','ㄆ'=>'ㄆ','ㄇ'=>'ㄇ','ㄈ'=>'ㄈ','ㄉ'=>'ㄉ','ã„Š'=>'ã„Š','ã„‹'=>'ã„‹','ã„Œ'=>'ã„Œ','ã„'=>'ã„','ã„Ž'=>'ã„Ž','ã„'=>'ã„','ã„'=>'ã„','ã„‘'=>'ã„‘','ã„’'=>'ã„’','ã„“'=>'ã„“','ã„”'=>'ã„”','ã„•'=>'ã„•','ã„–'=>'ã„–','ã„—'=>'ã„—','ㄘ'=>'ㄘ','ã„™'=>'ã„™','ã„š'=>'ã„š','ã„›'=>'ã„›','ã„œ'=>'ã„œ','ã„'=>'ã„','ã„ž'=>'ã„ž','ã„Ÿ'=>'ã„Ÿ','ã„ '=>'ã„ ','ã„¡'=>'ã„¡','ã„¢'=>'ã„¢','ã„£'=>'ã„£','ㄤ'=>'ㄤ','ã„¥'=>'ã„¥','ㄦ'=>'ㄦ','ㄧ'=>'ㄧ','ㄨ'=>'ㄨ','ã„©'=>'ã„©','ㄪ'=>'ㄪ','ã„«'=>'ã„«','ㄬ'=>'ㄬ','ㄱ'=>'ㄱ','ㄲ'=>'ㄲ','ㄳ'=>'ㄳ','ã„´'=>'ã„´','ㄵ'=>'ㄵ','ㄶ'=>'ㄶ','ã„·'=>'ã„·','ㄸ'=>'ㄸ','ㄹ'=>'ㄹ','ㄺ'=>'ㄺ','ã„»'=>'ã„»','ㄼ'=>'ㄼ','ㄽ'=>'ㄽ','ㄾ'=>'ㄾ','ã„¿'=>'ã„¿','ã…€'=>'ã…€','ã…'=>'ã…','ã…‚'=>'ã…‚','ã…ƒ'=>'ã…ƒ','ã…„'=>'ã…„','ã……'=>'ã……','ã…†'=>'ã…†','ã…‡'=>'ã…‡','ã…ˆ'=>'ã…ˆ','ã…‰'=>'ã…‰','ã…Š'=>'ã…Š','ã…‹'=>'ã…‹','ã…Œ'=>'ã…Œ','ã…'=>'ã…','ã…Ž'=>'ã…Ž','ã…'=>'ã…','ã…'=>'ã…','ã…‘'=>'ã…‘','ã…’'=>'ã…’','ã…“'=>'ã…“','ã…”'=>'ã…”','ã…•'=>'ã…•','ã…–'=>'ã…–','ã…—'=>'ã…—','ã…˜'=>'ã…˜','ã…™'=>'ã…™','ã…š'=>'ã…š','ã…›'=>'ã…›','ã…œ'=>'ã…œ','ã…'=>'ã…','ã…ž'=>'ã…ž','ã…Ÿ'=>'ã…Ÿ','ã… '=>'ã… ','ã…¡'=>'ã…¡','ã…¢'=>'ã…¢','ã…£'=>'ã…£','ã…¤'=>'ã…¤','ã…¥'=>'ã…¥','ã…¦'=>'ã…¦','ã…§'=>'ã…§','ã…¨'=>'ã…¨','ã…©'=>'ã…©','ã…ª'=>'ã…ª','ã…«'=>'ã…«','ã…¬'=>'ã…¬','ã…­'=>'ã…­','ã…®'=>'ã…®','ã…¯'=>'ã…¯','ã…°'=>'ã…°','ã…±'=>'ã…±','ã…²'=>'ã…²','ã…³'=>'ã…³','ã…´'=>'ã…´','ã…µ'=>'ã…µ','ã…¶'=>'ã…¶','ã…·'=>'ã…·','ã…¸'=>'ã…¸','ã…¹'=>'ã…¹','ã…º'=>'ã…º','ã…»'=>'ã…»','ã…¼'=>'ã…¼','ã…½'=>'ã…½','ã…¾'=>'ã…¾','ã…¿'=>'ã…¿','ㆀ'=>'ㆀ','ã†'=>'ã†','ㆂ'=>'ㆂ','ㆃ'=>'ㆃ','ㆄ'=>'ㆄ','ㆅ'=>'ㆅ','ㆆ'=>'ㆆ','ㆇ'=>'ㆇ','ㆈ'=>'ㆈ','ㆉ'=>'ㆉ','ㆊ'=>'ㆊ','ㆋ'=>'ㆋ','ㆌ'=>'ㆌ','ã†'=>'ã†','ㆎ'=>'ㆎ','㆒'=>'1','㆓'=>'2','㆔'=>'3','㆕'=>'4','ㆠ'=>'ㆠ','ㆡ'=>'ㆡ','ㆢ'=>'ㆢ','ㆣ'=>'ㆣ','ㆤ'=>'ㆤ','ㆥ'=>'ㆥ','ㆦ'=>'ㆦ','ㆧ'=>'ㆧ','ㆨ'=>'ㆨ','ㆩ'=>'ㆩ','ㆪ'=>'ㆪ','ㆫ'=>'ㆫ','ㆬ'=>'ㆬ','ㆭ'=>'ㆭ','ㆮ'=>'ㆮ','ㆯ'=>'ㆯ','ㆰ'=>'ㆰ','ㆱ'=>'ㆱ','ㆲ'=>'ㆲ','ㆳ'=>'ㆳ','ㆴ'=>'ㆴ','ㆵ'=>'ㆵ','ㆶ'=>'ㆶ','ㆷ'=>'ㆷ','ㇰ'=>'ㇰ','ㇱ'=>'ㇱ','ㇲ'=>'ㇲ','ㇳ'=>'ㇳ','ㇴ'=>'ㇴ','ㇵ'=>'ㇵ','ㇶ'=>'ㇶ','ㇷ'=>'ㇷ','ㇸ'=>'ㇸ','ㇹ'=>'ㇹ','ㇺ'=>'ㇺ','ㇻ'=>'ㇻ','ㇼ'=>'ㇼ','ㇽ'=>'ㇽ','ㇾ'=>'ㇾ','ㇿ'=>'ㇿ','㈠'=>'1','㈡'=>'2','㈢'=>'3','㈣'=>'4','㈤'=>'5','㈥'=>'6','㈦'=>'7','㈧'=>'8','㈨'=>'9','㈩'=>'10','㉑'=>'21','㉒'=>'22','㉓'=>'23','㉔'=>'24','㉕'=>'25','㉖'=>'26','㉗'=>'27','㉘'=>'28','㉙'=>'29','㉚'=>'30','㉛'=>'31','㉜'=>'32','ã‰'=>'33','㉞'=>'34','㉟'=>'35','㊀'=>'1','ãŠ'=>'2','㊂'=>'3','㊃'=>'4','㊄'=>'5','㊅'=>'6','㊆'=>'7','㊇'=>'8','㊈'=>'9','㊉'=>'10','㊱'=>'36','㊲'=>'37','㊳'=>'38','㊴'=>'39','㊵'=>'40','㊶'=>'41','㊷'=>'42','㊸'=>'43','㊹'=>'44','㊺'=>'45','㊻'=>'46','㊼'=>'47','㊽'=>'48','㊾'=>'49','㊿'=>'50','ã€'=>'ã€'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_64.php b/sources/phpBB/includes/utf/data/search_indexer_64.php new file mode 100644 index 0000000..b5002d4 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_64.php @@ -0,0 +1 @@ +'ð €€'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_84.php b/sources/phpBB/includes/utf/data/search_indexer_84.php new file mode 100644 index 0000000..c038215 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_84.php @@ -0,0 +1 @@ +'𪛖'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_9.php b/sources/phpBB/includes/utf/data/search_indexer_9.php new file mode 100644 index 0000000..a358f78 --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_9.php @@ -0,0 +1 @@ +'䶵','一'=>'一'); diff --git a/sources/phpBB/includes/utf/data/search_indexer_95.php b/sources/phpBB/includes/utf/data/search_indexer_95.php new file mode 100644 index 0000000..63d27fb --- /dev/null +++ b/sources/phpBB/includes/utf/data/search_indexer_95.php @@ -0,0 +1 @@ +'丽','ð¯ '=>'ð¯ ','乁'=>'乁','𠄢'=>'𠄢','你'=>'你','侮'=>'侮','侻'=>'侻','倂'=>'倂','偺'=>'偺','備'=>'備','僧'=>'僧','像'=>'像','㒞'=>'㒞','ð¯ '=>'ð¯ ','免'=>'免','ð¯ '=>'ð¯ ','ð¯ '=>'ð¯ ','具'=>'具','𠔜'=>'𠔜','㒹'=>'㒹','內'=>'內','再'=>'再','𠕋'=>'𠕋','冗'=>'冗','冤'=>'冤','仌'=>'仌','冬'=>'冬','况'=>'况','𩇟'=>'𩇟','ð¯ '=>'ð¯ ','刃'=>'刃','㓟'=>'㓟','刻'=>'刻','剆'=>'剆','割'=>'割','剷'=>'剷','㔕'=>'㔕','勇'=>'勇','勉'=>'勉','勤'=>'勤','勺'=>'勺','包'=>'包','匆'=>'匆','北'=>'北','卉'=>'卉','卑'=>'卑','博'=>'博','即'=>'即','卽'=>'卽','卿'=>'卿','卿'=>'卿','卿'=>'卿','𠨬'=>'𠨬','灰'=>'灰','及'=>'及','叟'=>'叟','𠭣'=>'𠭣','叫'=>'叫','叱'=>'叱','吆'=>'吆','咞'=>'咞','吸'=>'吸','呈'=>'呈','周'=>'周','咢'=>'咢','ð¯¡'=>'ð¯¡','唐'=>'唐','啓'=>'啓','啣'=>'啣','善'=>'善','善'=>'善','喙'=>'喙','喫'=>'喫','喳'=>'喳','嗂'=>'嗂','圖'=>'圖','嘆'=>'嘆','ð¯¡'=>'ð¯¡','噑'=>'噑','ð¯¡'=>'ð¯¡','ð¯¡'=>'ð¯¡','壮'=>'壮','城'=>'城','埴'=>'埴','堍'=>'堍','型'=>'型','堲'=>'堲','報'=>'報','墬'=>'墬','𡓤'=>'𡓤','売'=>'売','壷'=>'壷','夆'=>'夆','ð¯¡'=>'ð¯¡','夢'=>'夢','奢'=>'奢','𡚨'=>'𡚨','𡛪'=>'𡛪','姬'=>'姬','娛'=>'娛','娧'=>'娧','姘'=>'姘','婦'=>'婦','㛮'=>'㛮','㛼'=>'㛼','嬈'=>'嬈','嬾'=>'嬾','嬾'=>'嬾','𡧈'=>'𡧈','寃'=>'寃','寘'=>'寘','寧'=>'寧','寳'=>'寳','𡬘'=>'𡬘','寿'=>'寿','将'=>'将','当'=>'当','尢'=>'尢','㞁'=>'㞁','屠'=>'屠','屮'=>'屮','峀'=>'峀','岍'=>'岍','𡷤'=>'𡷤','嵃'=>'嵃','𡷦'=>'𡷦','嵮'=>'嵮','嵫'=>'嵫','嵼'=>'嵼','ð¯¢'=>'ð¯¢','巢'=>'巢','㠯'=>'㠯','巽'=>'巽','帨'=>'帨','帽'=>'帽','幩'=>'幩','㡢'=>'㡢','𢆃'=>'𢆃','㡼'=>'㡼','庰'=>'庰','庳'=>'庳','ð¯¢'=>'ð¯¢','廊'=>'廊','ð¯¢'=>'ð¯¢','ð¯¢'=>'ð¯¢','𢌱'=>'𢌱','𢌱'=>'𢌱','舁'=>'舁','弢'=>'弢','弢'=>'弢','㣇'=>'㣇','𣊸'=>'𣊸','𦇚'=>'𦇚','形'=>'形','彫'=>'彫','㣣'=>'㣣','徚'=>'徚','ð¯¢'=>'ð¯¢','志'=>'志','忹'=>'忹','悁'=>'悁','㤺'=>'㤺','㤜'=>'㤜','悔'=>'悔','𢛔'=>'𢛔','惇'=>'惇','慈'=>'慈','慌'=>'慌','慎'=>'慎','慌'=>'慌','慺'=>'慺','憎'=>'憎','憲'=>'憲','憤'=>'憤','憯'=>'憯','懞'=>'懞','懲'=>'懲','懶'=>'懶','成'=>'成','戛'=>'戛','扝'=>'扝','抱'=>'抱','拔'=>'拔','捐'=>'捐','𢬌'=>'𢬌','挽'=>'挽','拼'=>'拼','捨'=>'捨','掃'=>'掃','揤'=>'揤','𢯱'=>'𢯱','搢'=>'搢','揅'=>'揅','ð¯£'=>'ð¯£','㨮'=>'㨮','摩'=>'摩','摾'=>'摾','撝'=>'撝','摷'=>'摷','㩬'=>'㩬','敏'=>'敏','敬'=>'敬','𣀊'=>'𣀊','旣'=>'旣','書'=>'書','ð¯£'=>'ð¯£','㬙'=>'㬙','ð¯£'=>'ð¯£','ð¯£'=>'ð¯£','㫤'=>'㫤','冒'=>'冒','冕'=>'冕','最'=>'最','暜'=>'暜','肭'=>'肭','䏙'=>'䏙','朗'=>'朗','望'=>'望','朡'=>'朡','杞'=>'杞','杓'=>'杓','ð¯£'=>'ð¯£','㭉'=>'㭉','柺'=>'柺','枅'=>'枅','桒'=>'桒','梅'=>'梅','𣑭'=>'𣑭','梎'=>'梎','栟'=>'栟','椔'=>'椔','㮝'=>'㮝','楂'=>'楂','榣'=>'榣','槪'=>'槪','檨'=>'檨','𣚣'=>'𣚣','櫛'=>'櫛','㰘'=>'㰘','次'=>'次','𣢧'=>'𣢧','歔'=>'歔','㱎'=>'㱎','歲'=>'歲','殟'=>'殟','殺'=>'殺','殻'=>'殻','𣪍'=>'𣪍','𡴋'=>'𡴋','𣫺'=>'𣫺','汎'=>'汎','𣲼'=>'𣲼','沿'=>'沿','泍'=>'泍','汧'=>'汧','洖'=>'洖','派'=>'派','ð¯¤'=>'ð¯¤','流'=>'流','浩'=>'浩','浸'=>'浸','涅'=>'涅','𣴞'=>'𣴞','洴'=>'洴','港'=>'港','湮'=>'湮','㴳'=>'㴳','滋'=>'滋','滇'=>'滇','ð¯¤'=>'ð¯¤','淹'=>'淹','ð¯¤'=>'ð¯¤','ð¯¤'=>'ð¯¤','𣾎'=>'𣾎','濆'=>'濆','瀹'=>'瀹','瀞'=>'瀞','瀛'=>'瀛','㶖'=>'㶖','灊'=>'灊','災'=>'災','灷'=>'灷','炭'=>'炭','𠔥'=>'𠔥','煅'=>'煅','ð¯¤'=>'ð¯¤','熜'=>'熜','𤎫'=>'𤎫','爨'=>'爨','爵'=>'爵','牐'=>'牐','𤘈'=>'𤘈','犀'=>'犀','犕'=>'犕','𤜵'=>'𤜵','𤠔'=>'𤠔','獺'=>'獺','王'=>'王','㺬'=>'㺬','玥'=>'玥','㺸'=>'㺸','㺸'=>'㺸','瑇'=>'瑇','瑜'=>'瑜','瑱'=>'瑱','璅'=>'璅','瓊'=>'瓊','㼛'=>'㼛','甤'=>'甤','𤰶'=>'𤰶','甾'=>'甾','𤲒'=>'𤲒','異'=>'異','𢆟'=>'𢆟','瘐'=>'瘐','𤾡'=>'𤾡','𤾸'=>'𤾸','𥁄'=>'𥁄','㿼'=>'㿼','䀈'=>'䀈','直'=>'直','ð¯¥'=>'ð¯¥','𥃲'=>'𥃲','𥄙'=>'𥄙','𥄳'=>'𥄳','眞'=>'眞','真'=>'真','真'=>'真','睊'=>'睊','䀹'=>'䀹','瞋'=>'瞋','䁆'=>'䁆','䂖'=>'䂖','ð¯¥'=>'ð¯¥','硎'=>'硎','ð¯¥'=>'ð¯¥','ð¯¥'=>'ð¯¥','䃣'=>'䃣','𥘦'=>'𥘦','祖'=>'祖','𥚚'=>'𥚚','𥛅'=>'𥛅','福'=>'福','秫'=>'秫','䄯'=>'䄯','穀'=>'穀','穊'=>'穊','穏'=>'穏','𥥼'=>'𥥼','ð¯¥'=>'ð¯¥','𥪧'=>'𥪧','竮'=>'竮','䈂'=>'䈂','𥮫'=>'𥮫','篆'=>'篆','築'=>'築','䈧'=>'䈧','𥲀'=>'𥲀','糒'=>'糒','䊠'=>'䊠','糨'=>'糨','糣'=>'糣','紀'=>'紀','𥾆'=>'𥾆','絣'=>'絣','䌁'=>'䌁','緇'=>'緇','縂'=>'縂','繅'=>'繅','䌴'=>'䌴','𦈨'=>'𦈨','𦉇'=>'𦉇','䍙'=>'䍙','𦋙'=>'𦋙','罺'=>'罺','𦌾'=>'𦌾','羕'=>'羕','翺'=>'翺','者'=>'者','𦓚'=>'𦓚','𦔣'=>'𦔣','聠'=>'聠','𦖨'=>'𦖨','聰'=>'聰','𣍟'=>'𣍟','ð¯¦'=>'ð¯¦','育'=>'育','脃'=>'脃','䐋'=>'䐋','脾'=>'脾','媵'=>'媵','𦞧'=>'𦞧','𦞵'=>'𦞵','𣎓'=>'𣎓','𣎜'=>'𣎜','舁'=>'舁','舄'=>'舄','ð¯¦'=>'ð¯¦','䑫'=>'䑫','ð¯¦'=>'ð¯¦','ð¯¦'=>'ð¯¦','芝'=>'芝','劳'=>'劳','花'=>'花','芳'=>'芳','芽'=>'芽','苦'=>'苦','𦬼'=>'𦬼','若'=>'若','茝'=>'茝','荣'=>'荣','莭'=>'莭','茣'=>'茣','ð¯¦'=>'ð¯¦','菧'=>'菧','著'=>'著','荓'=>'荓','菊'=>'菊','菌'=>'菌','菜'=>'菜','𦰶'=>'𦰶','𦵫'=>'𦵫','𦳕'=>'𦳕','䔫'=>'䔫','蓱'=>'蓱','蓳'=>'蓳','蔖'=>'蔖','𧏊'=>'𧏊','蕤'=>'蕤','𦼬'=>'𦼬','䕝'=>'䕝','䕡'=>'䕡','𦾱'=>'𦾱','𧃒'=>'𧃒','䕫'=>'䕫','虐'=>'虐','虜'=>'虜','虧'=>'虧','虩'=>'虩','蚩'=>'蚩','蚈'=>'蚈','蜎'=>'蜎','蛢'=>'蛢','蝹'=>'蝹','蜨'=>'蜨','蝫'=>'蝫','螆'=>'螆','䗗'=>'䗗','蟡'=>'蟡','ð¯§'=>'ð¯§','䗹'=>'䗹','衠'=>'衠','衣'=>'衣','𧙧'=>'𧙧','裗'=>'裗','裞'=>'裞','䘵'=>'䘵','裺'=>'裺','㒻'=>'㒻','𧢮'=>'𧢮','𧥦'=>'𧥦','ð¯§'=>'ð¯§','䛇'=>'䛇','ð¯§'=>'ð¯§','ð¯§'=>'ð¯§','變'=>'變','豕'=>'豕','𧲨'=>'𧲨','貫'=>'貫','賁'=>'賁','贛'=>'贛','起'=>'起','𧼯'=>'𧼯','𠠄'=>'𠠄','跋'=>'跋','趼'=>'趼','跰'=>'跰','ð¯§'=>'ð¯§','軔'=>'軔','輸'=>'輸','𨗒'=>'𨗒','𨗭'=>'𨗭','邔'=>'邔','郱'=>'郱','鄑'=>'鄑','𨜮'=>'𨜮','鄛'=>'鄛','鈸'=>'鈸','鋗'=>'鋗','鋘'=>'鋘','鉼'=>'鉼','鏹'=>'鏹','鐕'=>'鐕','𨯺'=>'𨯺','開'=>'開','䦕'=>'䦕','閷'=>'閷','𨵷'=>'𨵷','䧦'=>'䧦','雃'=>'雃','嶲'=>'嶲','霣'=>'霣','𩅅'=>'𩅅','𩈚'=>'𩈚','䩮'=>'䩮','䩶'=>'䩶','韠'=>'韠','𩐊'=>'𩐊','䪲'=>'䪲','𩒖'=>'𩒖','頋'=>'頋','頋'=>'頋','頩'=>'頩','ð¯¨'=>'ð¯¨','飢'=>'飢','䬳'=>'䬳','餩'=>'餩','馧'=>'馧','駂'=>'駂','駾'=>'駾','䯎'=>'䯎','𩬰'=>'𩬰','鬒'=>'鬒','鱀'=>'鱀','鳽'=>'鳽','ð¯¨'=>'ð¯¨','䳭'=>'䳭','ð¯¨'=>'ð¯¨','ð¯¨'=>'ð¯¨','䳸'=>'䳸','𪄅'=>'𪄅','𪈎'=>'𪈎','𪊑'=>'𪊑','麻'=>'麻','䵖'=>'䵖','黹'=>'黹','黾'=>'黾','鼅'=>'鼅','鼏'=>'鼏','鼖'=>'鼖','鼻'=>'鼻','ð¯¨'=>'ð¯¨'); diff --git a/sources/phpBB/includes/utf/data/utf_canonical_comp.php b/sources/phpBB/includes/utf/data/utf_canonical_comp.php new file mode 100644 index 0000000..2de3149 --- /dev/null +++ b/sources/phpBB/includes/utf/data/utf_canonical_comp.php @@ -0,0 +1,2 @@ +'À','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/sources/phpBB/includes/utf/data/utf_canonical_decomp.php b/sources/phpBB/includes/utf/data/utf_canonical_decomp.php new file mode 100644 index 0000000..9fb9080 --- /dev/null +++ b/sources/phpBB/includes/utf/data/utf_canonical_decomp.php @@ -0,0 +1,2 @@ +'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/sources/phpBB/includes/utf/data/utf_compatibility_decomp.php b/sources/phpBB/includes/utf/data/utf_compatibility_decomp.php new file mode 100644 index 0000000..c62948e --- /dev/null +++ b/sources/phpBB/includes/utf/data/utf_compatibility_decomp.php @@ -0,0 +1,2 @@ +' ','¨'=>' ̈','ª'=>'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/sources/phpBB/includes/utf/data/utf_nfc_qc.php b/sources/phpBB/includes/utf/data/utf_nfc_qc.php new file mode 100644 index 0000000..ff56357 --- /dev/null +++ b/sources/phpBB/includes/utf/data/utf_nfc_qc.php @@ -0,0 +1,2 @@ +1,'Í'=>1,'̓'=>1,'Í„'=>1,'Í´'=>1,';'=>1,'·'=>1,'क़'=>1,'ख़'=>1,'ग़'=>1,'ज़'=>1,'ड़'=>1,'à¥'=>1,'फ़'=>1,'य़'=>1,'ড়'=>1,'à§'=>1,'য়'=>1,'ਲ਼'=>1,'ਸ਼'=>1,'à©™'=>1,'à©š'=>1,'à©›'=>1,'à©ž'=>1,'à­œ'=>1,'à­'=>1,'གྷ'=>1,'à½'=>1,'དྷ'=>1,'བྷ'=>1,'ཛྷ'=>1,'ཀྵ'=>1,'ཱི'=>1,'ཱུ'=>1,'ྲྀ'=>1,'ླྀ'=>1,'à¾'=>1,'ྒྷ'=>1,'à¾'=>1,'ྡྷ'=>1,'ྦྷ'=>1,'ྫྷ'=>1,'ྐྵ'=>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/sources/phpBB/includes/utf/data/utf_nfkc_qc.php b/sources/phpBB/includes/utf/data/utf_nfkc_qc.php new file mode 100644 index 0000000..181a07b --- /dev/null +++ b/sources/phpBB/includes/utf/data/utf_nfkc_qc.php @@ -0,0 +1,2 @@ +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/sources/phpBB/includes/utf/data/utf_normalizer_common.php b/sources/phpBB/includes/utf/data/utf_normalizer_common.php new file mode 100644 index 0000000..2eb7fea --- /dev/null +++ b/sources/phpBB/includes/utf/data/utf_normalizer_common.php @@ -0,0 +1,4 @@ +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/sources/phpBB/includes/utf/utf_normalizer.php b/sources/phpBB/includes/utf/utf_normalizer.php new file mode 100644 index 0000000..bbb23a6 --- /dev/null +++ b/sources/phpBB/includes/utf/utf_normalizer.php @@ -0,0 +1,1509 @@ + +* @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/sources/phpBB/includes/utf/utf_tools.php b/sources/phpBB/includes/utf/utf_tools.php new file mode 100644 index 0000000..e60a40a --- /dev/null +++ b/sources/phpBB/includes/utf/utf_tools.php @@ -0,0 +1,2008 @@ + +* @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; +} + +// Enforce ASCII only string handling +setlocale(LC_CTYPE, 'C'); + +/** +* UTF-8 tools +* +* Whenever possible, these functions will try to use PHP's built-in functions or +* extensions, otherwise they will default to custom routines. +* +*/ + +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')) +{ + 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)) + { + 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); + } + } + + /** + * UTF-8 aware alternative to strtolower + * @ignore + */ + function utf8_strtolower($str) + { + return mb_strtolower($str); + } + + /** + * UTF-8 aware alternative to strtoupper + * @ignore + */ + function utf8_strtoupper($str) + { + return mb_strtoupper($str); + } + + /** + * UTF-8 aware alternative to substr + * @ignore + */ + function utf8_substr($str, $offset, $length = null) + { + if (is_null($length)) + { + return mb_substr($str, $offset); + } + else + { + return mb_substr($str, $offset, $length); + } + } + + /** + * Return the length (in characters) of a UTF-8 string + * @ignore + */ + function utf8_strlen($text) + { + return mb_strlen($text, 'utf-8'); + } +} +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; + } + + return false; + } + } + + /** + * 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) + { + 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); + } + + /** + * 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) + { + 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 + * @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 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)); + } +} + +/** +* UTF-8 aware alternative to str_split +* Convert a string to an array +* +* @author Harry Fuecks +* @param string $str UTF-8 encoded +* @param int $split_len number to characters to split string by +* @return array characters in string reverses +*/ +function utf8_str_split($str, $split_len = 1) +{ + if (!is_int($split_len) || $split_len < 1) + { + return false; + } + + $len = utf8_strlen($str); + if ($len <= $split_len) + { + return array($str); + } + + preg_match_all('/.{' . $split_len . '}|[^\x00]{1,' . $split_len . '}$/us', $str, $ar); + return $ar[0]; +} + +/** +* UTF-8 aware alternative to strspn +* Find length of initial segment matching the mask +* +* @author Harry Fuecks +*/ +function utf8_strspn($str, $mask, $start = null, $length = null) +{ + if ($start !== null || $length !== null) + { + $str = utf8_substr($str, $start, $length); + } + + preg_match('/^[' . $mask . ']+/u', $str, $matches); + + if (isset($matches[0])) + { + return utf8_strlen($matches[0]); + } + + return 0; +} + +/** +* UTF-8 aware alternative to ucfirst +* Make a string's first character uppercase +* +* @author Harry Fuecks +* @param string +* @return string with first character as upper case (if applicable) +*/ +function utf8_ucfirst($str) +{ + switch (utf8_strlen($str)) + { + case 0: + return ''; + break; + + case 1: + return utf8_strtoupper($str); + break; + + default: + preg_match('/^(.{1})(.*)$/us', $str, $matches); + return utf8_strtoupper($matches[1]) . $matches[2]; + break; + } +} + +/** +* Recode a string to UTF-8 +* +* If the encoding is not supported, the string is returned as-is +* +* @param string $string Original string +* @param string $encoding Original encoding (lowered) +* @return string The string, encoded in UTF-8 +*/ +function utf8_recode($string, $encoding) +{ + $encoding = strtolower($encoding); + + if ($encoding == 'utf-8' || !is_string($string) || empty($string)) + { + return $string; + } + + // we force iso-8859-1 to be cp1252 + if ($encoding == 'iso-8859-1') + { + $encoding = 'cp1252'; + } + // convert iso-8859-8-i to iso-8859-8 + else if ($encoding == 'iso-8859-8-i') + { + $encoding = 'iso-8859-8'; + $string = hebrev($string); + } + + // First, try iconv() + if (function_exists('iconv')) + { + $ret = @iconv($encoding, 'utf-8', $string); + + if (!empty($ret)) + { + return $ret; + } + } + + // Try the mb_string extension + if (function_exists('mb_convert_encoding')) + { + // mbstring is nasty on PHP4, we must make *sure* that we send a good encoding + switch ($encoding) + { + case 'iso-8859-1': + case 'iso-8859-2': + case 'iso-8859-4': + case 'iso-8859-7': + case 'iso-8859-9': + case 'iso-8859-15': + case 'windows-1251': + case 'windows-1252': + case 'cp1252': + case 'shift_jis': + case 'euc-kr': + case 'big5': + case 'gb2312': + $ret = @mb_convert_encoding($string, 'utf-8', $encoding); + + if (!empty($ret)) + { + return $ret; + } + } + } + + // Try the recode extension + if (function_exists('recode_string')) + { + $ret = @recode_string($encoding . '..utf-8', $string); + + if (!empty($ret)) + { + return $ret; + } + } + + // If nothing works, check if we have a custom transcoder available + if (!preg_match('#^[a-z0-9_ \\-]+$#', $encoding)) + { + // Make sure the encoding name is alphanumeric, we don't want it to be abused into loading arbitrary files + trigger_error('Unknown encoding: ' . $encoding, E_USER_ERROR); + } + + global $phpbb_root_path, $phpEx; + + // iso-8859-* character encoding + if (preg_match('/iso[_ -]?8859[_ -]?(\\d+)/', $encoding, $array)) + { + switch ($array[1]) + { + case '1': + case '2': + case '4': + case '7': + case '8': + case '9': + case '15': + if (!function_exists('iso_8859_' . $array[1])) + { + if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx)) + { + trigger_error('Basic reencoder file is missing', E_USER_ERROR); + } + include($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx); + } + return call_user_func('iso_8859_' . $array[1], $string); + break; + + default: + trigger_error('Unknown encoding: ' . $encoding, E_USER_ERROR); + break; + } + } + + // CP/WIN character encoding + if (preg_match('/(?:cp|windows)[_\- ]?(\\d+)/', $encoding, $array)) + { + switch ($array[1]) + { + case '932': + break; + case '1250': + case '1251': + case '1252': + case '1254': + case '1255': + case '1256': + case '1257': + case '874': + if (!function_exists('cp' . $array[1])) + { + if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx)) + { + trigger_error('Basic reencoder file is missing', E_USER_ERROR); + } + include($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx); + } + return call_user_func('cp' . $array[1], $string); + break; + + default: + trigger_error('Unknown encoding: ' . $encoding, E_USER_ERROR); + break; + } + } + + // TIS-620 + if (preg_match('/tis[_ -]?620/', $encoding)) + { + if (!function_exists('tis_620')) + { + if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx)) + { + trigger_error('Basic reencoder file is missing', E_USER_ERROR); + } + include($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx); + } + return tis_620($string); + } + + // SJIS + if (preg_match('/sjis(?:[_ -]?win)?|(?:cp|ibm)[_ -]?932|shift[_ -]?jis/', $encoding)) + { + if (!function_exists('sjis')) + { + if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx)) + { + trigger_error('CJK reencoder file is missing', E_USER_ERROR); + } + include($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx); + } + return sjis($string); + } + + // EUC_KR + if (preg_match('/euc[_ -]?kr/', $encoding)) + { + if (!function_exists('euc_kr')) + { + if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx)) + { + trigger_error('CJK reencoder file is missing', E_USER_ERROR); + } + include($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx); + } + return euc_kr($string); + } + + // BIG-5 + if (preg_match('/big[_ -]?5/', $encoding)) + { + if (!function_exists('big5')) + { + if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx)) + { + trigger_error('CJK reencoder file is missing', E_USER_ERROR); + } + include($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx); + } + return big5($string); + } + + // GB2312 + if (preg_match('/gb[_ -]?2312/', $encoding)) + { + if (!function_exists('gb2312')) + { + if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx)) + { + trigger_error('CJK reencoder file is missing', E_USER_ERROR); + } + include($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx); + } + return gb2312($string); + } + + // Trigger an error?! Fow now just give bad data :-( + trigger_error('Unknown encoding: ' . $encoding, E_USER_ERROR); + //return $string; // use utf_normalizer::cleanup() ? +} + +/** +* Replace all UTF-8 chars that are not in ASCII with their NCR +* +* @param string $text UTF-8 string in NFC +* @return string ASCII string using NCRs for non-ASCII chars +*/ +function utf8_encode_ncr($text) +{ + return preg_replace_callback('#[\\xC2-\\xF4][\\x80-\\xBF]{1,3}#', 'utf8_encode_ncr_callback', $text); +} + +/** +* Callback used in encode_ncr() +* +* Takes a UTF-8 char and replaces it with its NCR. Attention, $m is an array +* +* @param array $m 0-based numerically indexed array passed by preg_replace_callback() +* @return string A HTML NCR if the character is valid, or the original string otherwise +*/ +function utf8_encode_ncr_callback($m) +{ + return '&#' . utf8_ord($m[0]) . ';'; +} + +/** +* Converts a UTF-8 char to an NCR +* +* @param string $chr UTF-8 char +* @return integer UNICODE code point +*/ +function utf8_ord($chr) +{ + switch (strlen($chr)) + { + case 1: + return ord($chr); + break; + + case 2: + return ((ord($chr[0]) & 0x1F) << 6) | (ord($chr[1]) & 0x3F); + break; + + case 3: + return ((ord($chr[0]) & 0x0F) << 12) | ((ord($chr[1]) & 0x3F) << 6) | (ord($chr[2]) & 0x3F); + break; + + case 4: + return ((ord($chr[0]) & 0x07) << 18) | ((ord($chr[1]) & 0x3F) << 12) | ((ord($chr[2]) & 0x3F) << 6) | (ord($chr[3]) & 0x3F); + break; + + default: + return $chr; + } +} + +/** +* Converts an NCR to a UTF-8 char +* +* @param int $cp UNICODE code point +* @return string UTF-8 char +*/ +function utf8_chr($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); + } +} + +/** +* Convert Numeric Character References to UTF-8 chars +* +* Notes: +* - we do not convert NCRs recursively, if you pass &#38; it will return & +* - we DO NOT check for the existence of the Unicode characters, therefore an entity may be converted to an inexistent codepoint +* +* @param string $text String to convert, encoded in UTF-8 (no normal form required) +* @return string UTF-8 string where NCRs have been replaced with the actual chars +*/ +function utf8_decode_ncr($text) +{ + return preg_replace_callback('/&#([0-9]{1,6}|x[0-9A-F]{1,5});/i', 'utf8_decode_ncr_callback', $text); +} + +/** +* Callback used in decode_ncr() +* +* Takes a NCR (in decimal or hexadecimal) and returns a UTF-8 char. Attention, $m is an array. +* It will ignore most of invalid NCRs, but not all! +* +* @param array $m 0-based numerically indexed array passed by preg_replace_callback() +* @return string UTF-8 char +*/ +function utf8_decode_ncr_callback($m) +{ + $cp = (strncasecmp($m[1], 'x', 1)) ? $m[1] : hexdec(substr($m[1], 1)); + + return utf8_chr($cp); +} + +/** +* Case folds a unicode string as per Unicode 5.0, section 3.13 +* +* @param string $text text to be case folded +* @param string $option determines how we will fold the cases +* @return string case folded text +*/ +function utf8_case_fold($text, $option = 'full') +{ + static $uniarray = array(); + global $phpbb_root_path, $phpEx; + + // common is always set + if (!isset($uniarray['c'])) + { + $uniarray['c'] = include($phpbb_root_path . 'includes/utf/data/case_fold_c.' . $phpEx); + } + + // only set full if we need to + if ($option === 'full' && !isset($uniarray['f'])) + { + $uniarray['f'] = include($phpbb_root_path . 'includes/utf/data/case_fold_f.' . $phpEx); + } + + // only set simple if we need to + if ($option !== 'full' && !isset($uniarray['s'])) + { + $uniarray['s'] = include($phpbb_root_path . 'includes/utf/data/case_fold_s.' . $phpEx); + } + + // common is always replaced + $text = strtr($text, $uniarray['c']); + + if ($option === 'full') + { + // full replaces a character with multiple characters + $text = strtr($text, $uniarray['f']); + } + else + { + // simple replaces a character with another character + $text = strtr($text, $uniarray['s']); + } + + return $text; +} + +/** +* Takes the input and does a "special" case fold. It does minor normalization +* and returns NFKC compatable text +* +* @param string $text text to be case folded +* @param string $option determines how we will fold the cases +* @return string case folded text +*/ +function utf8_case_fold_nfkc($text, $option = 'full') +{ + static $fc_nfkc_closure = array( + "\xCD\xBA" => "\x20\xCE\xB9", + "\xCF\x92" => "\xCF\x85", + "\xCF\x93" => "\xCF\x8D", + "\xCF\x94" => "\xCF\x8B", + "\xCF\xB2" => "\xCF\x83", + "\xCF\xB9" => "\xCF\x83", + "\xE1\xB4\xAC" => "\x61", + "\xE1\xB4\xAD" => "\xC3\xA6", + "\xE1\xB4\xAE" => "\x62", + "\xE1\xB4\xB0" => "\x64", + "\xE1\xB4\xB1" => "\x65", + "\xE1\xB4\xB2" => "\xC7\x9D", + "\xE1\xB4\xB3" => "\x67", + "\xE1\xB4\xB4" => "\x68", + "\xE1\xB4\xB5" => "\x69", + "\xE1\xB4\xB6" => "\x6A", + "\xE1\xB4\xB7" => "\x6B", + "\xE1\xB4\xB8" => "\x6C", + "\xE1\xB4\xB9" => "\x6D", + "\xE1\xB4\xBA" => "\x6E", + "\xE1\xB4\xBC" => "\x6F", + "\xE1\xB4\xBD" => "\xC8\xA3", + "\xE1\xB4\xBE" => "\x70", + "\xE1\xB4\xBF" => "\x72", + "\xE1\xB5\x80" => "\x74", + "\xE1\xB5\x81" => "\x75", + "\xE1\xB5\x82" => "\x77", + "\xE2\x82\xA8" => "\x72\x73", + "\xE2\x84\x82" => "\x63", + "\xE2\x84\x83" => "\xC2\xB0\x63", + "\xE2\x84\x87" => "\xC9\x9B", + "\xE2\x84\x89" => "\xC2\xB0\x66", + "\xE2\x84\x8B" => "\x68", + "\xE2\x84\x8C" => "\x68", + "\xE2\x84\x8D" => "\x68", + "\xE2\x84\x90" => "\x69", + "\xE2\x84\x91" => "\x69", + "\xE2\x84\x92" => "\x6C", + "\xE2\x84\x95" => "\x6E", + "\xE2\x84\x96" => "\x6E\x6F", + "\xE2\x84\x99" => "\x70", + "\xE2\x84\x9A" => "\x71", + "\xE2\x84\x9B" => "\x72", + "\xE2\x84\x9C" => "\x72", + "\xE2\x84\x9D" => "\x72", + "\xE2\x84\xA0" => "\x73\x6D", + "\xE2\x84\xA1" => "\x74\x65\x6C", + "\xE2\x84\xA2" => "\x74\x6D", + "\xE2\x84\xA4" => "\x7A", + "\xE2\x84\xA8" => "\x7A", + "\xE2\x84\xAC" => "\x62", + "\xE2\x84\xAD" => "\x63", + "\xE2\x84\xB0" => "\x65", + "\xE2\x84\xB1" => "\x66", + "\xE2\x84\xB3" => "\x6D", + "\xE2\x84\xBB" => "\x66\x61\x78", + "\xE2\x84\xBE" => "\xCE\xB3", + "\xE2\x84\xBF" => "\xCF\x80", + "\xE2\x85\x85" => "\x64", + "\xE3\x89\x90" => "\x70\x74\x65", + "\xE3\x8B\x8C" => "\x68\x67", + "\xE3\x8B\x8E" => "\x65\x76", + "\xE3\x8B\x8F" => "\x6C\x74\x64", + "\xE3\x8D\xB1" => "\x68\x70\x61", + "\xE3\x8D\xB3" => "\x61\x75", + "\xE3\x8D\xB5" => "\x6F\x76", + "\xE3\x8D\xBA" => "\x69\x75", + "\xE3\x8E\x80" => "\x70\x61", + "\xE3\x8E\x81" => "\x6E\x61", + "\xE3\x8E\x82" => "\xCE\xBC\x61", + "\xE3\x8E\x83" => "\x6D\x61", + "\xE3\x8E\x84" => "\x6B\x61", + "\xE3\x8E\x85" => "\x6B\x62", + "\xE3\x8E\x86" => "\x6D\x62", + "\xE3\x8E\x87" => "\x67\x62", + "\xE3\x8E\x8A" => "\x70\x66", + "\xE3\x8E\x8B" => "\x6E\x66", + "\xE3\x8E\x8C" => "\xCE\xBC\x66", + "\xE3\x8E\x90" => "\x68\x7A", + "\xE3\x8E\x91" => "\x6B\x68\x7A", + "\xE3\x8E\x92" => "\x6D\x68\x7A", + "\xE3\x8E\x93" => "\x67\x68\x7A", + "\xE3\x8E\x94" => "\x74\x68\x7A", + "\xE3\x8E\xA9" => "\x70\x61", + "\xE3\x8E\xAA" => "\x6B\x70\x61", + "\xE3\x8E\xAB" => "\x6D\x70\x61", + "\xE3\x8E\xAC" => "\x67\x70\x61", + "\xE3\x8E\xB4" => "\x70\x76", + "\xE3\x8E\xB5" => "\x6E\x76", + "\xE3\x8E\xB6" => "\xCE\xBC\x76", + "\xE3\x8E\xB7" => "\x6D\x76", + "\xE3\x8E\xB8" => "\x6B\x76", + "\xE3\x8E\xB9" => "\x6D\x76", + "\xE3\x8E\xBA" => "\x70\x77", + "\xE3\x8E\xBB" => "\x6E\x77", + "\xE3\x8E\xBC" => "\xCE\xBC\x77", + "\xE3\x8E\xBD" => "\x6D\x77", + "\xE3\x8E\xBE" => "\x6B\x77", + "\xE3\x8E\xBF" => "\x6D\x77", + "\xE3\x8F\x80" => "\x6B\xCF\x89", + "\xE3\x8F\x81" => "\x6D\xCF\x89", + "\xE3\x8F\x83" => "\x62\x71", + "\xE3\x8F\x86" => "\x63\xE2\x88\x95\x6B\x67", + "\xE3\x8F\x87" => "\x63\x6F\x2E", + "\xE3\x8F\x88" => "\x64\x62", + "\xE3\x8F\x89" => "\x67\x79", + "\xE3\x8F\x8B" => "\x68\x70", + "\xE3\x8F\x8D" => "\x6B\x6B", + "\xE3\x8F\x8E" => "\x6B\x6D", + "\xE3\x8F\x97" => "\x70\x68", + "\xE3\x8F\x99" => "\x70\x70\x6D", + "\xE3\x8F\x9A" => "\x70\x72", + "\xE3\x8F\x9C" => "\x73\x76", + "\xE3\x8F\x9D" => "\x77\x62", + "\xE3\x8F\x9E" => "\x76\xE2\x88\x95\x6D", + "\xE3\x8F\x9F" => "\x61\xE2\x88\x95\x6D", + "\xF0\x9D\x90\x80" => "\x61", + "\xF0\x9D\x90\x81" => "\x62", + "\xF0\x9D\x90\x82" => "\x63", + "\xF0\x9D\x90\x83" => "\x64", + "\xF0\x9D\x90\x84" => "\x65", + "\xF0\x9D\x90\x85" => "\x66", + "\xF0\x9D\x90\x86" => "\x67", + "\xF0\x9D\x90\x87" => "\x68", + "\xF0\x9D\x90\x88" => "\x69", + "\xF0\x9D\x90\x89" => "\x6A", + "\xF0\x9D\x90\x8A" => "\x6B", + "\xF0\x9D\x90\x8B" => "\x6C", + "\xF0\x9D\x90\x8C" => "\x6D", + "\xF0\x9D\x90\x8D" => "\x6E", + "\xF0\x9D\x90\x8E" => "\x6F", + "\xF0\x9D\x90\x8F" => "\x70", + "\xF0\x9D\x90\x90" => "\x71", + "\xF0\x9D\x90\x91" => "\x72", + "\xF0\x9D\x90\x92" => "\x73", + "\xF0\x9D\x90\x93" => "\x74", + "\xF0\x9D\x90\x94" => "\x75", + "\xF0\x9D\x90\x95" => "\x76", + "\xF0\x9D\x90\x96" => "\x77", + "\xF0\x9D\x90\x97" => "\x78", + "\xF0\x9D\x90\x98" => "\x79", + "\xF0\x9D\x90\x99" => "\x7A", + "\xF0\x9D\x90\xB4" => "\x61", + "\xF0\x9D\x90\xB5" => "\x62", + "\xF0\x9D\x90\xB6" => "\x63", + "\xF0\x9D\x90\xB7" => "\x64", + "\xF0\x9D\x90\xB8" => "\x65", + "\xF0\x9D\x90\xB9" => "\x66", + "\xF0\x9D\x90\xBA" => "\x67", + "\xF0\x9D\x90\xBB" => "\x68", + "\xF0\x9D\x90\xBC" => "\x69", + "\xF0\x9D\x90\xBD" => "\x6A", + "\xF0\x9D\x90\xBE" => "\x6B", + "\xF0\x9D\x90\xBF" => "\x6C", + "\xF0\x9D\x91\x80" => "\x6D", + "\xF0\x9D\x91\x81" => "\x6E", + "\xF0\x9D\x91\x82" => "\x6F", + "\xF0\x9D\x91\x83" => "\x70", + "\xF0\x9D\x91\x84" => "\x71", + "\xF0\x9D\x91\x85" => "\x72", + "\xF0\x9D\x91\x86" => "\x73", + "\xF0\x9D\x91\x87" => "\x74", + "\xF0\x9D\x91\x88" => "\x75", + "\xF0\x9D\x91\x89" => "\x76", + "\xF0\x9D\x91\x8A" => "\x77", + "\xF0\x9D\x91\x8B" => "\x78", + "\xF0\x9D\x91\x8C" => "\x79", + "\xF0\x9D\x91\x8D" => "\x7A", + "\xF0\x9D\x91\xA8" => "\x61", + "\xF0\x9D\x91\xA9" => "\x62", + "\xF0\x9D\x91\xAA" => "\x63", + "\xF0\x9D\x91\xAB" => "\x64", + "\xF0\x9D\x91\xAC" => "\x65", + "\xF0\x9D\x91\xAD" => "\x66", + "\xF0\x9D\x91\xAE" => "\x67", + "\xF0\x9D\x91\xAF" => "\x68", + "\xF0\x9D\x91\xB0" => "\x69", + "\xF0\x9D\x91\xB1" => "\x6A", + "\xF0\x9D\x91\xB2" => "\x6B", + "\xF0\x9D\x91\xB3" => "\x6C", + "\xF0\x9D\x91\xB4" => "\x6D", + "\xF0\x9D\x91\xB5" => "\x6E", + "\xF0\x9D\x91\xB6" => "\x6F", + "\xF0\x9D\x91\xB7" => "\x70", + "\xF0\x9D\x91\xB8" => "\x71", + "\xF0\x9D\x91\xB9" => "\x72", + "\xF0\x9D\x91\xBA" => "\x73", + "\xF0\x9D\x91\xBB" => "\x74", + "\xF0\x9D\x91\xBC" => "\x75", + "\xF0\x9D\x91\xBD" => "\x76", + "\xF0\x9D\x91\xBE" => "\x77", + "\xF0\x9D\x91\xBF" => "\x78", + "\xF0\x9D\x92\x80" => "\x79", + "\xF0\x9D\x92\x81" => "\x7A", + "\xF0\x9D\x92\x9C" => "\x61", + "\xF0\x9D\x92\x9E" => "\x63", + "\xF0\x9D\x92\x9F" => "\x64", + "\xF0\x9D\x92\xA2" => "\x67", + "\xF0\x9D\x92\xA5" => "\x6A", + "\xF0\x9D\x92\xA6" => "\x6B", + "\xF0\x9D\x92\xA9" => "\x6E", + "\xF0\x9D\x92\xAA" => "\x6F", + "\xF0\x9D\x92\xAB" => "\x70", + "\xF0\x9D\x92\xAC" => "\x71", + "\xF0\x9D\x92\xAE" => "\x73", + "\xF0\x9D\x92\xAF" => "\x74", + "\xF0\x9D\x92\xB0" => "\x75", + "\xF0\x9D\x92\xB1" => "\x76", + "\xF0\x9D\x92\xB2" => "\x77", + "\xF0\x9D\x92\xB3" => "\x78", + "\xF0\x9D\x92\xB4" => "\x79", + "\xF0\x9D\x92\xB5" => "\x7A", + "\xF0\x9D\x93\x90" => "\x61", + "\xF0\x9D\x93\x91" => "\x62", + "\xF0\x9D\x93\x92" => "\x63", + "\xF0\x9D\x93\x93" => "\x64", + "\xF0\x9D\x93\x94" => "\x65", + "\xF0\x9D\x93\x95" => "\x66", + "\xF0\x9D\x93\x96" => "\x67", + "\xF0\x9D\x93\x97" => "\x68", + "\xF0\x9D\x93\x98" => "\x69", + "\xF0\x9D\x93\x99" => "\x6A", + "\xF0\x9D\x93\x9A" => "\x6B", + "\xF0\x9D\x93\x9B" => "\x6C", + "\xF0\x9D\x93\x9C" => "\x6D", + "\xF0\x9D\x93\x9D" => "\x6E", + "\xF0\x9D\x93\x9E" => "\x6F", + "\xF0\x9D\x93\x9F" => "\x70", + "\xF0\x9D\x93\xA0" => "\x71", + "\xF0\x9D\x93\xA1" => "\x72", + "\xF0\x9D\x93\xA2" => "\x73", + "\xF0\x9D\x93\xA3" => "\x74", + "\xF0\x9D\x93\xA4" => "\x75", + "\xF0\x9D\x93\xA5" => "\x76", + "\xF0\x9D\x93\xA6" => "\x77", + "\xF0\x9D\x93\xA7" => "\x78", + "\xF0\x9D\x93\xA8" => "\x79", + "\xF0\x9D\x93\xA9" => "\x7A", + "\xF0\x9D\x94\x84" => "\x61", + "\xF0\x9D\x94\x85" => "\x62", + "\xF0\x9D\x94\x87" => "\x64", + "\xF0\x9D\x94\x88" => "\x65", + "\xF0\x9D\x94\x89" => "\x66", + "\xF0\x9D\x94\x8A" => "\x67", + "\xF0\x9D\x94\x8D" => "\x6A", + "\xF0\x9D\x94\x8E" => "\x6B", + "\xF0\x9D\x94\x8F" => "\x6C", + "\xF0\x9D\x94\x90" => "\x6D", + "\xF0\x9D\x94\x91" => "\x6E", + "\xF0\x9D\x94\x92" => "\x6F", + "\xF0\x9D\x94\x93" => "\x70", + "\xF0\x9D\x94\x94" => "\x71", + "\xF0\x9D\x94\x96" => "\x73", + "\xF0\x9D\x94\x97" => "\x74", + "\xF0\x9D\x94\x98" => "\x75", + "\xF0\x9D\x94\x99" => "\x76", + "\xF0\x9D\x94\x9A" => "\x77", + "\xF0\x9D\x94\x9B" => "\x78", + "\xF0\x9D\x94\x9C" => "\x79", + "\xF0\x9D\x94\xB8" => "\x61", + "\xF0\x9D\x94\xB9" => "\x62", + "\xF0\x9D\x94\xBB" => "\x64", + "\xF0\x9D\x94\xBC" => "\x65", + "\xF0\x9D\x94\xBD" => "\x66", + "\xF0\x9D\x94\xBE" => "\x67", + "\xF0\x9D\x95\x80" => "\x69", + "\xF0\x9D\x95\x81" => "\x6A", + "\xF0\x9D\x95\x82" => "\x6B", + "\xF0\x9D\x95\x83" => "\x6C", + "\xF0\x9D\x95\x84" => "\x6D", + "\xF0\x9D\x95\x86" => "\x6F", + "\xF0\x9D\x95\x8A" => "\x73", + "\xF0\x9D\x95\x8B" => "\x74", + "\xF0\x9D\x95\x8C" => "\x75", + "\xF0\x9D\x95\x8D" => "\x76", + "\xF0\x9D\x95\x8E" => "\x77", + "\xF0\x9D\x95\x8F" => "\x78", + "\xF0\x9D\x95\x90" => "\x79", + "\xF0\x9D\x95\xAC" => "\x61", + "\xF0\x9D\x95\xAD" => "\x62", + "\xF0\x9D\x95\xAE" => "\x63", + "\xF0\x9D\x95\xAF" => "\x64", + "\xF0\x9D\x95\xB0" => "\x65", + "\xF0\x9D\x95\xB1" => "\x66", + "\xF0\x9D\x95\xB2" => "\x67", + "\xF0\x9D\x95\xB3" => "\x68", + "\xF0\x9D\x95\xB4" => "\x69", + "\xF0\x9D\x95\xB5" => "\x6A", + "\xF0\x9D\x95\xB6" => "\x6B", + "\xF0\x9D\x95\xB7" => "\x6C", + "\xF0\x9D\x95\xB8" => "\x6D", + "\xF0\x9D\x95\xB9" => "\x6E", + "\xF0\x9D\x95\xBA" => "\x6F", + "\xF0\x9D\x95\xBB" => "\x70", + "\xF0\x9D\x95\xBC" => "\x71", + "\xF0\x9D\x95\xBD" => "\x72", + "\xF0\x9D\x95\xBE" => "\x73", + "\xF0\x9D\x95\xBF" => "\x74", + "\xF0\x9D\x96\x80" => "\x75", + "\xF0\x9D\x96\x81" => "\x76", + "\xF0\x9D\x96\x82" => "\x77", + "\xF0\x9D\x96\x83" => "\x78", + "\xF0\x9D\x96\x84" => "\x79", + "\xF0\x9D\x96\x85" => "\x7A", + "\xF0\x9D\x96\xA0" => "\x61", + "\xF0\x9D\x96\xA1" => "\x62", + "\xF0\x9D\x96\xA2" => "\x63", + "\xF0\x9D\x96\xA3" => "\x64", + "\xF0\x9D\x96\xA4" => "\x65", + "\xF0\x9D\x96\xA5" => "\x66", + "\xF0\x9D\x96\xA6" => "\x67", + "\xF0\x9D\x96\xA7" => "\x68", + "\xF0\x9D\x96\xA8" => "\x69", + "\xF0\x9D\x96\xA9" => "\x6A", + "\xF0\x9D\x96\xAA" => "\x6B", + "\xF0\x9D\x96\xAB" => "\x6C", + "\xF0\x9D\x96\xAC" => "\x6D", + "\xF0\x9D\x96\xAD" => "\x6E", + "\xF0\x9D\x96\xAE" => "\x6F", + "\xF0\x9D\x96\xAF" => "\x70", + "\xF0\x9D\x96\xB0" => "\x71", + "\xF0\x9D\x96\xB1" => "\x72", + "\xF0\x9D\x96\xB2" => "\x73", + "\xF0\x9D\x96\xB3" => "\x74", + "\xF0\x9D\x96\xB4" => "\x75", + "\xF0\x9D\x96\xB5" => "\x76", + "\xF0\x9D\x96\xB6" => "\x77", + "\xF0\x9D\x96\xB7" => "\x78", + "\xF0\x9D\x96\xB8" => "\x79", + "\xF0\x9D\x96\xB9" => "\x7A", + "\xF0\x9D\x97\x94" => "\x61", + "\xF0\x9D\x97\x95" => "\x62", + "\xF0\x9D\x97\x96" => "\x63", + "\xF0\x9D\x97\x97" => "\x64", + "\xF0\x9D\x97\x98" => "\x65", + "\xF0\x9D\x97\x99" => "\x66", + "\xF0\x9D\x97\x9A" => "\x67", + "\xF0\x9D\x97\x9B" => "\x68", + "\xF0\x9D\x97\x9C" => "\x69", + "\xF0\x9D\x97\x9D" => "\x6A", + "\xF0\x9D\x97\x9E" => "\x6B", + "\xF0\x9D\x97\x9F" => "\x6C", + "\xF0\x9D\x97\xA0" => "\x6D", + "\xF0\x9D\x97\xA1" => "\x6E", + "\xF0\x9D\x97\xA2" => "\x6F", + "\xF0\x9D\x97\xA3" => "\x70", + "\xF0\x9D\x97\xA4" => "\x71", + "\xF0\x9D\x97\xA5" => "\x72", + "\xF0\x9D\x97\xA6" => "\x73", + "\xF0\x9D\x97\xA7" => "\x74", + "\xF0\x9D\x97\xA8" => "\x75", + "\xF0\x9D\x97\xA9" => "\x76", + "\xF0\x9D\x97\xAA" => "\x77", + "\xF0\x9D\x97\xAB" => "\x78", + "\xF0\x9D\x97\xAC" => "\x79", + "\xF0\x9D\x97\xAD" => "\x7A", + "\xF0\x9D\x98\x88" => "\x61", + "\xF0\x9D\x98\x89" => "\x62", + "\xF0\x9D\x98\x8A" => "\x63", + "\xF0\x9D\x98\x8B" => "\x64", + "\xF0\x9D\x98\x8C" => "\x65", + "\xF0\x9D\x98\x8D" => "\x66", + "\xF0\x9D\x98\x8E" => "\x67", + "\xF0\x9D\x98\x8F" => "\x68", + "\xF0\x9D\x98\x90" => "\x69", + "\xF0\x9D\x98\x91" => "\x6A", + "\xF0\x9D\x98\x92" => "\x6B", + "\xF0\x9D\x98\x93" => "\x6C", + "\xF0\x9D\x98\x94" => "\x6D", + "\xF0\x9D\x98\x95" => "\x6E", + "\xF0\x9D\x98\x96" => "\x6F", + "\xF0\x9D\x98\x97" => "\x70", + "\xF0\x9D\x98\x98" => "\x71", + "\xF0\x9D\x98\x99" => "\x72", + "\xF0\x9D\x98\x9A" => "\x73", + "\xF0\x9D\x98\x9B" => "\x74", + "\xF0\x9D\x98\x9C" => "\x75", + "\xF0\x9D\x98\x9D" => "\x76", + "\xF0\x9D\x98\x9E" => "\x77", + "\xF0\x9D\x98\x9F" => "\x78", + "\xF0\x9D\x98\xA0" => "\x79", + "\xF0\x9D\x98\xA1" => "\x7A", + "\xF0\x9D\x98\xBC" => "\x61", + "\xF0\x9D\x98\xBD" => "\x62", + "\xF0\x9D\x98\xBE" => "\x63", + "\xF0\x9D\x98\xBF" => "\x64", + "\xF0\x9D\x99\x80" => "\x65", + "\xF0\x9D\x99\x81" => "\x66", + "\xF0\x9D\x99\x82" => "\x67", + "\xF0\x9D\x99\x83" => "\x68", + "\xF0\x9D\x99\x84" => "\x69", + "\xF0\x9D\x99\x85" => "\x6A", + "\xF0\x9D\x99\x86" => "\x6B", + "\xF0\x9D\x99\x87" => "\x6C", + "\xF0\x9D\x99\x88" => "\x6D", + "\xF0\x9D\x99\x89" => "\x6E", + "\xF0\x9D\x99\x8A" => "\x6F", + "\xF0\x9D\x99\x8B" => "\x70", + "\xF0\x9D\x99\x8C" => "\x71", + "\xF0\x9D\x99\x8D" => "\x72", + "\xF0\x9D\x99\x8E" => "\x73", + "\xF0\x9D\x99\x8F" => "\x74", + "\xF0\x9D\x99\x90" => "\x75", + "\xF0\x9D\x99\x91" => "\x76", + "\xF0\x9D\x99\x92" => "\x77", + "\xF0\x9D\x99\x93" => "\x78", + "\xF0\x9D\x99\x94" => "\x79", + "\xF0\x9D\x99\x95" => "\x7A", + "\xF0\x9D\x99\xB0" => "\x61", + "\xF0\x9D\x99\xB1" => "\x62", + "\xF0\x9D\x99\xB2" => "\x63", + "\xF0\x9D\x99\xB3" => "\x64", + "\xF0\x9D\x99\xB4" => "\x65", + "\xF0\x9D\x99\xB5" => "\x66", + "\xF0\x9D\x99\xB6" => "\x67", + "\xF0\x9D\x99\xB7" => "\x68", + "\xF0\x9D\x99\xB8" => "\x69", + "\xF0\x9D\x99\xB9" => "\x6A", + "\xF0\x9D\x99\xBA" => "\x6B", + "\xF0\x9D\x99\xBB" => "\x6C", + "\xF0\x9D\x99\xBC" => "\x6D", + "\xF0\x9D\x99\xBD" => "\x6E", + "\xF0\x9D\x99\xBE" => "\x6F", + "\xF0\x9D\x99\xBF" => "\x70", + "\xF0\x9D\x9A\x80" => "\x71", + "\xF0\x9D\x9A\x81" => "\x72", + "\xF0\x9D\x9A\x82" => "\x73", + "\xF0\x9D\x9A\x83" => "\x74", + "\xF0\x9D\x9A\x84" => "\x75", + "\xF0\x9D\x9A\x85" => "\x76", + "\xF0\x9D\x9A\x86" => "\x77", + "\xF0\x9D\x9A\x87" => "\x78", + "\xF0\x9D\x9A\x88" => "\x79", + "\xF0\x9D\x9A\x89" => "\x7A", + "\xF0\x9D\x9A\xA8" => "\xCE\xB1", + "\xF0\x9D\x9A\xA9" => "\xCE\xB2", + "\xF0\x9D\x9A\xAA" => "\xCE\xB3", + "\xF0\x9D\x9A\xAB" => "\xCE\xB4", + "\xF0\x9D\x9A\xAC" => "\xCE\xB5", + "\xF0\x9D\x9A\xAD" => "\xCE\xB6", + "\xF0\x9D\x9A\xAE" => "\xCE\xB7", + "\xF0\x9D\x9A\xAF" => "\xCE\xB8", + "\xF0\x9D\x9A\xB0" => "\xCE\xB9", + "\xF0\x9D\x9A\xB1" => "\xCE\xBA", + "\xF0\x9D\x9A\xB2" => "\xCE\xBB", + "\xF0\x9D\x9A\xB3" => "\xCE\xBC", + "\xF0\x9D\x9A\xB4" => "\xCE\xBD", + "\xF0\x9D\x9A\xB5" => "\xCE\xBE", + "\xF0\x9D\x9A\xB6" => "\xCE\xBF", + "\xF0\x9D\x9A\xB7" => "\xCF\x80", + "\xF0\x9D\x9A\xB8" => "\xCF\x81", + "\xF0\x9D\x9A\xB9" => "\xCE\xB8", + "\xF0\x9D\x9A\xBA" => "\xCF\x83", + "\xF0\x9D\x9A\xBB" => "\xCF\x84", + "\xF0\x9D\x9A\xBC" => "\xCF\x85", + "\xF0\x9D\x9A\xBD" => "\xCF\x86", + "\xF0\x9D\x9A\xBE" => "\xCF\x87", + "\xF0\x9D\x9A\xBF" => "\xCF\x88", + "\xF0\x9D\x9B\x80" => "\xCF\x89", + "\xF0\x9D\x9B\x93" => "\xCF\x83", + "\xF0\x9D\x9B\xA2" => "\xCE\xB1", + "\xF0\x9D\x9B\xA3" => "\xCE\xB2", + "\xF0\x9D\x9B\xA4" => "\xCE\xB3", + "\xF0\x9D\x9B\xA5" => "\xCE\xB4", + "\xF0\x9D\x9B\xA6" => "\xCE\xB5", + "\xF0\x9D\x9B\xA7" => "\xCE\xB6", + "\xF0\x9D\x9B\xA8" => "\xCE\xB7", + "\xF0\x9D\x9B\xA9" => "\xCE\xB8", + "\xF0\x9D\x9B\xAA" => "\xCE\xB9", + "\xF0\x9D\x9B\xAB" => "\xCE\xBA", + "\xF0\x9D\x9B\xAC" => "\xCE\xBB", + "\xF0\x9D\x9B\xAD" => "\xCE\xBC", + "\xF0\x9D\x9B\xAE" => "\xCE\xBD", + "\xF0\x9D\x9B\xAF" => "\xCE\xBE", + "\xF0\x9D\x9B\xB0" => "\xCE\xBF", + "\xF0\x9D\x9B\xB1" => "\xCF\x80", + "\xF0\x9D\x9B\xB2" => "\xCF\x81", + "\xF0\x9D\x9B\xB3" => "\xCE\xB8", + "\xF0\x9D\x9B\xB4" => "\xCF\x83", + "\xF0\x9D\x9B\xB5" => "\xCF\x84", + "\xF0\x9D\x9B\xB6" => "\xCF\x85", + "\xF0\x9D\x9B\xB7" => "\xCF\x86", + "\xF0\x9D\x9B\xB8" => "\xCF\x87", + "\xF0\x9D\x9B\xB9" => "\xCF\x88", + "\xF0\x9D\x9B\xBA" => "\xCF\x89", + "\xF0\x9D\x9C\x8D" => "\xCF\x83", + "\xF0\x9D\x9C\x9C" => "\xCE\xB1", + "\xF0\x9D\x9C\x9D" => "\xCE\xB2", + "\xF0\x9D\x9C\x9E" => "\xCE\xB3", + "\xF0\x9D\x9C\x9F" => "\xCE\xB4", + "\xF0\x9D\x9C\xA0" => "\xCE\xB5", + "\xF0\x9D\x9C\xA1" => "\xCE\xB6", + "\xF0\x9D\x9C\xA2" => "\xCE\xB7", + "\xF0\x9D\x9C\xA3" => "\xCE\xB8", + "\xF0\x9D\x9C\xA4" => "\xCE\xB9", + "\xF0\x9D\x9C\xA5" => "\xCE\xBA", + "\xF0\x9D\x9C\xA6" => "\xCE\xBB", + "\xF0\x9D\x9C\xA7" => "\xCE\xBC", + "\xF0\x9D\x9C\xA8" => "\xCE\xBD", + "\xF0\x9D\x9C\xA9" => "\xCE\xBE", + "\xF0\x9D\x9C\xAA" => "\xCE\xBF", + "\xF0\x9D\x9C\xAB" => "\xCF\x80", + "\xF0\x9D\x9C\xAC" => "\xCF\x81", + "\xF0\x9D\x9C\xAD" => "\xCE\xB8", + "\xF0\x9D\x9C\xAE" => "\xCF\x83", + "\xF0\x9D\x9C\xAF" => "\xCF\x84", + "\xF0\x9D\x9C\xB0" => "\xCF\x85", + "\xF0\x9D\x9C\xB1" => "\xCF\x86", + "\xF0\x9D\x9C\xB2" => "\xCF\x87", + "\xF0\x9D\x9C\xB3" => "\xCF\x88", + "\xF0\x9D\x9C\xB4" => "\xCF\x89", + "\xF0\x9D\x9D\x87" => "\xCF\x83", + "\xF0\x9D\x9D\x96" => "\xCE\xB1", + "\xF0\x9D\x9D\x97" => "\xCE\xB2", + "\xF0\x9D\x9D\x98" => "\xCE\xB3", + "\xF0\x9D\x9D\x99" => "\xCE\xB4", + "\xF0\x9D\x9D\x9A" => "\xCE\xB5", + "\xF0\x9D\x9D\x9B" => "\xCE\xB6", + "\xF0\x9D\x9D\x9C" => "\xCE\xB7", + "\xF0\x9D\x9D\x9D" => "\xCE\xB8", + "\xF0\x9D\x9D\x9E" => "\xCE\xB9", + "\xF0\x9D\x9D\x9F" => "\xCE\xBA", + "\xF0\x9D\x9D\xA0" => "\xCE\xBB", + "\xF0\x9D\x9D\xA1" => "\xCE\xBC", + "\xF0\x9D\x9D\xA2" => "\xCE\xBD", + "\xF0\x9D\x9D\xA3" => "\xCE\xBE", + "\xF0\x9D\x9D\xA4" => "\xCE\xBF", + "\xF0\x9D\x9D\xA5" => "\xCF\x80", + "\xF0\x9D\x9D\xA6" => "\xCF\x81", + "\xF0\x9D\x9D\xA7" => "\xCE\xB8", + "\xF0\x9D\x9D\xA8" => "\xCF\x83", + "\xF0\x9D\x9D\xA9" => "\xCF\x84", + "\xF0\x9D\x9D\xAA" => "\xCF\x85", + "\xF0\x9D\x9D\xAB" => "\xCF\x86", + "\xF0\x9D\x9D\xAC" => "\xCF\x87", + "\xF0\x9D\x9D\xAD" => "\xCF\x88", + "\xF0\x9D\x9D\xAE" => "\xCF\x89", + "\xF0\x9D\x9E\x81" => "\xCF\x83", + "\xF0\x9D\x9E\x90" => "\xCE\xB1", + "\xF0\x9D\x9E\x91" => "\xCE\xB2", + "\xF0\x9D\x9E\x92" => "\xCE\xB3", + "\xF0\x9D\x9E\x93" => "\xCE\xB4", + "\xF0\x9D\x9E\x94" => "\xCE\xB5", + "\xF0\x9D\x9E\x95" => "\xCE\xB6", + "\xF0\x9D\x9E\x96" => "\xCE\xB7", + "\xF0\x9D\x9E\x97" => "\xCE\xB8", + "\xF0\x9D\x9E\x98" => "\xCE\xB9", + "\xF0\x9D\x9E\x99" => "\xCE\xBA", + "\xF0\x9D\x9E\x9A" => "\xCE\xBB", + "\xF0\x9D\x9E\x9B" => "\xCE\xBC", + "\xF0\x9D\x9E\x9C" => "\xCE\xBD", + "\xF0\x9D\x9E\x9D" => "\xCE\xBE", + "\xF0\x9D\x9E\x9E" => "\xCE\xBF", + "\xF0\x9D\x9E\x9F" => "\xCF\x80", + "\xF0\x9D\x9E\xA0" => "\xCF\x81", + "\xF0\x9D\x9E\xA1" => "\xCE\xB8", + "\xF0\x9D\x9E\xA2" => "\xCF\x83", + "\xF0\x9D\x9E\xA3" => "\xCF\x84", + "\xF0\x9D\x9E\xA4" => "\xCF\x85", + "\xF0\x9D\x9E\xA5" => "\xCF\x86", + "\xF0\x9D\x9E\xA6" => "\xCF\x87", + "\xF0\x9D\x9E\xA7" => "\xCF\x88", + "\xF0\x9D\x9E\xA8" => "\xCF\x89", + "\xF0\x9D\x9E\xBB" => "\xCF\x83", + "\xF0\x9D\x9F\x8A" => "\xCF\x9D", + ); + global $phpbb_root_path, $phpEx; + + // 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); + + // FC_NFKC_Closure, http://www.unicode.org/Public/5.0.0/ucd/DerivedNormalizationProps.txt + $text = strtr($text, $fc_nfkc_closure); + + return $text; +} + +/** +* Assume the input is NFC: +* Takes the input and does a "special" case fold. It does minor normalization as well. +* +* @param string $text text to be case folded +* @param string $option determines how we will fold the cases +* @return string case folded text +*/ +function utf8_case_fold_nfc($text, $option = 'full') +{ + static $uniarray = array(); + static $ypogegrammeni = array( + "\xCD\xBA" => "\x20\xCD\x85", + "\xE1\xBE\x80" => "\xE1\xBC\x80\xCD\x85", + "\xE1\xBE\x81" => "\xE1\xBC\x81\xCD\x85", + "\xE1\xBE\x82" => "\xE1\xBC\x82\xCD\x85", + "\xE1\xBE\x83" => "\xE1\xBC\x83\xCD\x85", + "\xE1\xBE\x84" => "\xE1\xBC\x84\xCD\x85", + "\xE1\xBE\x85" => "\xE1\xBC\x85\xCD\x85", + "\xE1\xBE\x86" => "\xE1\xBC\x86\xCD\x85", + "\xE1\xBE\x87" => "\xE1\xBC\x87\xCD\x85", + "\xE1\xBE\x88" => "\xE1\xBC\x88\xCD\x85", + "\xE1\xBE\x89" => "\xE1\xBC\x89\xCD\x85", + "\xE1\xBE\x8A" => "\xE1\xBC\x8A\xCD\x85", + "\xE1\xBE\x8B" => "\xE1\xBC\x8B\xCD\x85", + "\xE1\xBE\x8C" => "\xE1\xBC\x8C\xCD\x85", + "\xE1\xBE\x8D" => "\xE1\xBC\x8D\xCD\x85", + "\xE1\xBE\x8E" => "\xE1\xBC\x8E\xCD\x85", + "\xE1\xBE\x8F" => "\xE1\xBC\x8F\xCD\x85", + "\xE1\xBE\x90" => "\xE1\xBC\xA0\xCD\x85", + "\xE1\xBE\x91" => "\xE1\xBC\xA1\xCD\x85", + "\xE1\xBE\x92" => "\xE1\xBC\xA2\xCD\x85", + "\xE1\xBE\x93" => "\xE1\xBC\xA3\xCD\x85", + "\xE1\xBE\x94" => "\xE1\xBC\xA4\xCD\x85", + "\xE1\xBE\x95" => "\xE1\xBC\xA5\xCD\x85", + "\xE1\xBE\x96" => "\xE1\xBC\xA6\xCD\x85", + "\xE1\xBE\x97" => "\xE1\xBC\xA7\xCD\x85", + "\xE1\xBE\x98" => "\xE1\xBC\xA8\xCD\x85", + "\xE1\xBE\x99" => "\xE1\xBC\xA9\xCD\x85", + "\xE1\xBE\x9A" => "\xE1\xBC\xAA\xCD\x85", + "\xE1\xBE\x9B" => "\xE1\xBC\xAB\xCD\x85", + "\xE1\xBE\x9C" => "\xE1\xBC\xAC\xCD\x85", + "\xE1\xBE\x9D" => "\xE1\xBC\xAD\xCD\x85", + "\xE1\xBE\x9E" => "\xE1\xBC\xAE\xCD\x85", + "\xE1\xBE\x9F" => "\xE1\xBC\xAF\xCD\x85", + "\xE1\xBE\xA0" => "\xE1\xBD\xA0\xCD\x85", + "\xE1\xBE\xA1" => "\xE1\xBD\xA1\xCD\x85", + "\xE1\xBE\xA2" => "\xE1\xBD\xA2\xCD\x85", + "\xE1\xBE\xA3" => "\xE1\xBD\xA3\xCD\x85", + "\xE1\xBE\xA4" => "\xE1\xBD\xA4\xCD\x85", + "\xE1\xBE\xA5" => "\xE1\xBD\xA5\xCD\x85", + "\xE1\xBE\xA6" => "\xE1\xBD\xA6\xCD\x85", + "\xE1\xBE\xA7" => "\xE1\xBD\xA7\xCD\x85", + "\xE1\xBE\xA8" => "\xE1\xBD\xA8\xCD\x85", + "\xE1\xBE\xA9" => "\xE1\xBD\xA9\xCD\x85", + "\xE1\xBE\xAA" => "\xE1\xBD\xAA\xCD\x85", + "\xE1\xBE\xAB" => "\xE1\xBD\xAB\xCD\x85", + "\xE1\xBE\xAC" => "\xE1\xBD\xAC\xCD\x85", + "\xE1\xBE\xAD" => "\xE1\xBD\xAD\xCD\x85", + "\xE1\xBE\xAE" => "\xE1\xBD\xAE\xCD\x85", + "\xE1\xBE\xAF" => "\xE1\xBD\xAF\xCD\x85", + "\xE1\xBE\xB2" => "\xE1\xBD\xB0\xCD\x85", + "\xE1\xBE\xB3" => "\xCE\xB1\xCD\x85", + "\xE1\xBE\xB4" => "\xCE\xAC\xCD\x85", + "\xE1\xBE\xB7" => "\xE1\xBE\xB6\xCD\x85", + "\xE1\xBE\xBC" => "\xCE\x91\xCD\x85", + "\xE1\xBF\x82" => "\xE1\xBD\xB4\xCD\x85", + "\xE1\xBF\x83" => "\xCE\xB7\xCD\x85", + "\xE1\xBF\x84" => "\xCE\xAE\xCD\x85", + "\xE1\xBF\x87" => "\xE1\xBF\x86\xCD\x85", + "\xE1\xBF\x8C" => "\xCE\x97\xCD\x85", + "\xE1\xBF\xB2" => "\xE1\xBD\xBC\xCD\x85", + "\xE1\xBF\xB3" => "\xCF\x89\xCD\x85", + "\xE1\xBF\xB4" => "\xCF\x8E\xCD\x85", + "\xE1\xBF\xB7" => "\xE1\xBF\xB6\xCD\x85", + "\xE1\xBF\xBC" => "\xCE\xA9\xCD\x85", + ); + global $phpbb_root_path, $phpEx; + + // perform a small trick, avoid further normalization on composed points that contain U+0345 in their decomposition + $text = strtr($text, $ypogegrammeni); + + // do the case fold + $text = utf8_case_fold($text, $option); + + 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) + { + 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 (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::nfc($strings); + } + else if (is_array($strings)) + { + foreach ($strings as $key => $string) + { + if (is_array($string)) + { + foreach ($string as $_key => $_string) + { + utf_normalizer::nfc($strings[$key][$_key]); + } + } + else + { + utf_normalizer::nfc($strings[$key]); + } + } + } + + return $strings; + } +} + +/** +* This function is used to generate a "clean" version of a string. +* Clean means that it is a case insensitive form (case folding) and that it is normalized (NFC). +* Additionally a homographs of one character are transformed into one specific character (preferably ASCII +* if it is an ASCII character). +* +* Please be aware that if you change something within this function or within +* functions used here you need to rebuild/update the username_clean column in the users table. And all other +* columns that store a clean string otherwise you will break this functionality. +* +* @param string $text An unclean string, mabye user input (has to be valid UTF-8!) +* @return string Cleaned up version of the input string +*/ +function utf8_clean_string($text) +{ + global $phpbb_root_path, $phpEx; + + static $homographs = array(); + if (empty($homographs)) + { + $homographs = include($phpbb_root_path . 'includes/utf/data/confusables.' . $phpEx); + } + + $text = utf8_case_fold_nfkc($text); + $text = strtr($text, $homographs); + // Other control characters + $text = preg_replace('#(?:[\x00-\x1F\x7F]+|(?:\xC2[\x80-\x9F])+)#', '', $text); + + // we need to reduce multiple spaces to a single one + $text = preg_replace('# {2,}#', ' ', $text); + + // we can use trim here as all the other space characters should have been turned + // into normal ASCII spaces by now + return trim($text); +} + +/** +* A wrapper for htmlspecialchars($value, ENT_COMPAT, 'UTF-8') +*/ +function utf8_htmlspecialchars($value) +{ + return htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); +} + +/** +* Trying to convert returned system message to utf8 +* +* PHP assumes such messages are ISO-8859-1 so we'll do that too +* and if it breaks messages we'll blame it on them ;-) +*/ +function utf8_convert_message($message) +{ + // First of all check if conversion is neded at all, as there is no point + // in converting ASCII messages from ISO-8859-1 to UTF-8 + if (!preg_match('/[\x80-\xFF]/', $message)) + { + return utf8_htmlspecialchars($message); + } + + // else we need to convert some part of the message + return utf8_htmlspecialchars(utf8_recode($message, 'ISO-8859-1')); +} + +/** +* UTF8-compatible wordwrap replacement +* +* @param string $string The input string +* @param int $width The column width. Defaults to 75. +* @param string $break The line is broken using the optional break parameter. Defaults to '\n'. +* @param bool $cut If the cut is set to TRUE, the string is always wrapped at the specified width. So if you have a word that is larger than the given width, it is broken apart. +* +* @return string the given string wrapped at the specified column. +* +*/ +function utf8_wordwrap($string, $width = 75, $break = "\n", $cut = false) +{ + // We first need to explode on $break, not destroying existing (intended) breaks + $lines = explode($break, $string); + $new_lines = array(0 => ''); + $index = 0; + + foreach ($lines as $line) + { + $words = explode(' ', $line); + + for ($i = 0, $size = sizeof($words); $i < $size; $i++) + { + $word = $words[$i]; + + // If cut is true we need to cut the word if it is > width chars + if ($cut && utf8_strlen($word) > $width) + { + $words[$i] = utf8_substr($word, $width); + $word = utf8_substr($word, 0, $width); + $i--; + } + + if (utf8_strlen($new_lines[$index] . $word) > $width) + { + $new_lines[$index] = substr($new_lines[$index], 0, -1); + $index++; + $new_lines[$index] = ''; + } + + $new_lines[$index] .= $word . ' '; + } + + $new_lines[$index] = substr($new_lines[$index], 0, -1); + $index++; + $new_lines[$index] = ''; + } + + unset($new_lines[$index]); + return implode($break, $new_lines); +} + +/** +* UTF8-safe basename() function +* +* basename() has some limitations and is dependent on the locale setting +* according to the PHP manual. Therefore we provide our own locale independent +* basename function. +* +* @param string $filename The filename basename() should be applied to +* @return string The basenamed filename +*/ +function utf8_basename($filename) +{ + // We always check for forward slash AND backward slash + // because they could be mixed or "sneaked" in. ;) + // You know, never trust user input... + if (strpos($filename, '/') !== false) + { + $filename = utf8_substr($filename, utf8_strrpos($filename, '/') + 1); + } + + if (strpos($filename, '\\') !== false) + { + $filename = utf8_substr($filename, utf8_strrpos($filename, '\\') + 1); + } + + 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/sources/phpBB/index.php b/sources/phpBB/index.php new file mode 100644 index 0000000..df6932f --- /dev/null +++ b/sources/phpBB/index.php @@ -0,0 +1,207 @@ + +* @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); +$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('viewforum'); + +// Mark notifications read +if (($mark_notification = $request->variable('mark_notification', 0))) +{ + if ($user->data['user_id'] == ANONYMOUS) + { + if ($request->is_ajax()) + { + trigger_error('LOGIN_REQUIRED'); + } + login_box('', $user->lang['LOGIN_REQUIRED']); + } + + if (check_link_hash($request->variable('hash', ''), 'mark_notification_read')) + { + $phpbb_notifications = $phpbb_container->get('notification_manager'); + + $notification = $phpbb_notifications->load_notifications(array( + 'notification_id' => $mark_notification, + )); + + if (isset($notification['notifications'][$mark_notification])) + { + $notification = $notification['notifications'][$mark_notification]; + + $notification->mark_read(); + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response(); + $json_response->send(array( + 'success' => true, + )); + } + + if (($redirect = $request->variable('redirect', ''))) + { + redirect(append_sid($phpbb_root_path . $redirect)); + } + + redirect($notification->get_redirect_url()); + } + } +} + +display_forums('', $config['load_moderators']); + +$order_legend = ($config['legend_sort_groupname']) ? 'group_name' : 'group_legend'; +// Grab group details for legend display +if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) +{ + $sql = 'SELECT group_id, group_name, group_colour, group_type, group_legend + FROM ' . GROUPS_TABLE . ' + WHERE group_legend > 0 + ORDER BY ' . $order_legend . ' ASC'; +} +else +{ + $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_legend + FROM ' . GROUPS_TABLE . ' g + LEFT JOIN ' . USER_GROUP_TABLE . ' ug + ON ( + g.group_id = ug.group_id + AND ug.user_id = ' . $user->data['user_id'] . ' + AND ug.user_pending = 0 + ) + WHERE g.group_legend > 0 + AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ') + ORDER BY g.' . $order_legend . ' ASC'; +} +$result = $db->sql_query($sql); + +$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']; + + if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile'))) + { + $legend[] = '' . $group_name . '
'; + } + else + { + $legend[] = '' . $group_name . ''; + } +} +$db->sql_freeresult($result); + +$legend = implode($user->lang['COMMA_SEPARATOR'], $legend); + +// Generate birthday list if required ... +$birthday_list = array(); +if ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) +{ + $time = $user->create_datetime(); + $now = phpbb_gmgetdate($time->getTimestamp() + $time->getOffset()); + + // Display birthdays of 29th february on 28th february in non-leap-years + $leap_year_birthdays = ''; + if ($now['mday'] == 28 && $now['mon'] == 2 && !$time->format('L')) + { + $leap_year_birthdays = " OR u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', 29, 2)) . "%'"; + } + + $sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday + FROM ' . USERS_TABLE . ' u + LEFT JOIN ' . BANLIST_TABLE . " b ON (u.user_id = b.ban_userid) + WHERE (b.ban_id IS NULL + OR b.ban_exclude = 1) + AND (u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' $leap_year_birthdays) + AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $birthday_username = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']); + $birthday_year = (int) substr($row['user_birthday'], -4); + $birthday_age = ($birthday_year) ? max(0, $now['year'] - $birthday_year) : ''; + + $template->assign_block_vars('birthdays', array( + 'USERNAME' => $birthday_username, + 'AGE' => $birthday_age, + )); + + // For 3.0 compatibility + if ($age = (int) substr($row['user_birthday'], -4)) + { + $birthday_list[] = $birthday_username . (($birthday_year) ? ' (' . $birthday_age . ')' : ''); + } + } + $db->sql_freeresult($result); +} + +// Assign index specific vars +$template->assign_vars(array( + 'TOTAL_POSTS' => $user->lang('TOTAL_POSTS_COUNT', (int) $config['num_posts']), + 'TOTAL_TOPICS' => $user->lang('TOTAL_TOPICS', (int) $config['num_topics']), + 'TOTAL_USERS' => $user->lang('TOTAL_USERS', (int) $config['num_users']), + 'NEWEST_USER' => $user->lang('NEWEST_USER', get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])), + + 'LEGEND' => $legend, + 'BIRTHDAY_LIST' => (empty($birthday_list)) ? '' : implode($user->lang['COMMA_SEPARATOR'], $birthday_list), + + 'FORUM_IMG' => $user->img('forum_read', 'NO_UNREAD_POSTS'), + 'FORUM_UNREAD_IMG' => $user->img('forum_unread', 'UNREAD_POSTS'), + 'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_UNREAD_POSTS_LOCKED'), + 'FORUM_UNREAD_LOCKED_IMG' => $user->img('forum_unread_locked', 'UNREAD_POSTS_LOCKED'), + + 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), + 'U_SEND_PASSWORD' => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '', + 'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false, + 'S_INDEX' => true, + + 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums&mark_time=' . time()) : '', + 'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '') +); + +$page_title = ($config['board_index_text'] !== '') ? $config['board_index_text'] : $user->lang['INDEX']; + +/** +* You can use this event to modify the page title and load data for the index +* +* @event core.index_modify_page_title +* @var string page_title Title of the index page +* @since 3.1.0-a1 +*/ +$vars = array('page_title'); +extract($phpbb_dispatcher->trigger_event('core.index_modify_page_title', compact($vars))); + +// Output page +page_header($page_title, true); + +$template->set_filenames(array( + 'body' => 'index_body.html') +); + +page_footer(); diff --git a/sources/phpBB/install/convertors/convert_phpbb20.php b/sources/phpBB/install/convertors/convert_phpbb20.php new file mode 100644 index 0000000..511f850 --- /dev/null +++ b/sources/phpBB/install/convertors/convert_phpbb20.php @@ -0,0 +1,975 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +/** +* NOTE to potential convertor authors. Please use this file to get +* familiar with the structure since we added some bare explanations here. +* +* Since this file gets included more than once on one page you are not able to add functions to it. +* Instead use a functions_ file. +* +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx); +extract($phpbb_config_php_file->get_all()); +unset($dbpasswd); + +$dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms); + +/** +* $convertor_data provides some basic information about this convertor which is +* used on the initial list of convertors and to populate the default settings +*/ +$convertor_data = array( + 'forum_name' => 'phpBB 2.0.x', + 'version' => '1.0.3', + 'phpbb_version' => '3.1.3', + 'author' => 'phpBB Limited', + 'dbms' => $dbms, + 'dbhost' => $dbhost, + 'dbport' => $dbport, + 'dbuser' => $dbuser, + 'dbpasswd' => '', + 'dbname' => $dbname, + 'table_prefix' => 'phpbb_', + 'forum_path' => '../forums', + 'author_notes' => '', +); + +/** +* $tables is a list of the tables (minus prefix) which we expect to find in the +* source forum. It is used to guess the prefix if the specified prefix is incorrect +*/ +$tables = array( + 'auth_access', + 'banlist', + 'categories', + 'disallow', + 'forum_prune', + 'forums', + 'groups', + 'posts', + 'posts_text', + 'privmsgs', + 'privmsgs_text', + 'ranks', + 'smilies', + 'topics', + 'topics_watch', + 'user_group', + 'users', + 'vote_desc', + 'vote_results', + 'vote_voters', + 'words' +); + +/** +* $config_schema details how the board configuration information is stored in the source forum. +* +* 'table_format' can take the value 'file' to indicate a config file. In this case array_name +* is set to indicate the name of the array the config values are stored in +* Example of using a file: +* $config_schema = array( +* 'table_format' => 'file', +* 'filename' => 'NAME OF FILE', // If the file is not in the root directory, the path needs to be added with no leading slash +* 'array_name' => 'NAME OF ARRAY', // Only used if the configuration file stores the setting in an array. +* 'settings' => array( +* 'board_email' => 'SUPPORT_EMAIL', // target config name => source target name +* ) +* ); +* 'table_format' can be an array if the values are stored in a table which is an assosciative array +* (as per phpBB 2.0.x) +* If left empty, values are assumed to be stored in a table where each config setting is +* a column (as per phpBB 1.x) +* +* In either of the latter cases 'table_name' indicates the name of the table in the database +* +* 'settings' is an array which maps the name of the config directive in the source forum +* to the config directive in phpBB3. It can either be a direct mapping or use a function. +* Please note that the contents of the old config value are passed to the function, therefore +* an in-built function requiring the variable passed by reference is not able to be used. Since +* empty() is such a function we created the function is_empty() to be used instead. +*/ +$config_schema = array( + 'table_name' => 'config', + 'table_format' => array('config_name' => 'config_value'), + 'settings' => array( + 'allow_bbcode' => 'allow_bbcode', + 'allow_smilies' => 'allow_smilies', + 'allow_sig' => 'allow_sig', + 'allow_namechange' => 'allow_namechange', + 'allow_avatar_local' => 'allow_avatar_local', + 'allow_avatar_remote' => 'allow_avatar_remote', + 'allow_avatar_upload' => 'allow_avatar_upload', + 'board_disable' => 'board_disable', + 'sitename' => 'phpbb_set_encoding(sitename)', + 'site_desc' => 'phpbb_set_encoding(site_desc)', + 'session_length' => 'session_length', + 'board_email_sig' => 'phpbb_set_encoding(board_email_sig)', + 'posts_per_page' => 'posts_per_page', + 'topics_per_page' => 'topics_per_page', + 'enable_confirm' => 'enable_confirm', + 'board_email_form' => 'board_email_form', + 'override_user_style' => 'override_user_style', + 'hot_threshold' => 'hot_threshold', + 'max_poll_options' => 'max_poll_options', + 'max_sig_chars' => 'max_sig_chars', + 'pm_max_msgs' => 'max_inbox_privmsgs', + 'smtp_delivery' => 'smtp_delivery', + 'smtp_host' => 'smtp_host', + 'smtp_username' => 'smtp_username', + 'smtp_password' => 'smtp_password', + 'require_activation' => 'require_activation', + 'flood_interval' => 'flood_interval', + 'avatar_filesize' => 'avatar_filesize', + 'avatar_max_width' => 'avatar_max_width', + 'avatar_max_height' => 'avatar_max_height', + 'default_dateformat' => 'phpbb_set_encoding(default_dateformat)', + 'board_timezone' => 'phpbb_convert_timezone(board_timezone)', + 'allow_privmsg' => 'not(privmsg_disable)', + 'gzip_compress' => 'gzip_compress', + 'coppa_enable' => '!is_empty(coppa_mail)', + 'coppa_fax' => 'coppa_fax', + 'coppa_mail' => 'coppa_mail', + 'record_online_users' => 'record_online_users', + 'record_online_date' => 'record_online_date', + 'board_startdate' => 'board_startdate', + ) +); + +/** +* $test_file is the name of a file which is present on the source +* forum which can be used to check that the path specified by the +* user was correct +*/ +$test_file = 'modcp.php'; + +/** +* If this is set then we are not generating the first page of information but getting the conversion information. +*/ +if (!$get_info) +{ + // Test to see if the birthday MOD is installed on the source forum + // Niels' birthday mod + if (get_config_value('birthday_required') !== false || get_config_value('bday_require') !== false) + { + define('MOD_BIRTHDAY', true); + } + + // TerraFrost's validated birthday mod + if (get_config_value('bday_require') !== false) + { + define('MOD_BIRTHDAY_TERRA', true); + } + + // Test to see if the attachment MOD is installed on the source forum + // If it is, we will convert this data as well + $src_db->sql_return_on_error(true); + + $sql = "SELECT config_value + FROM {$convert->src_table_prefix}attachments_config + WHERE config_name = 'upload_dir'"; + $result = $src_db->sql_query($sql); + + if ($result && $row = $src_db->sql_fetchrow($result)) + { + // Here the constant is defined + define('MOD_ATTACHMENT', true); + + // Here i add more tables to be checked in the old forum + $tables += array( + 'attachments', + 'attachments_desc', + 'extensions', + 'extension_groups' + ); + + $src_db->sql_freeresult($result); + } + else if ($result) + { + $src_db->sql_freeresult($result); + } + + + /** + * Tests for further MODs can be included here. + * Please use constants for this, prefixing them with MOD_ + */ + + $src_db->sql_return_on_error(false); + + // Now let us set a temporary config variable for user id incrementing + $sql = "SELECT user_id + FROM {$convert->src_table_prefix}users + WHERE user_id = 1"; + $result = $src_db->sql_query($sql); + $user_id = (int) $src_db->sql_fetchfield('user_id'); + $src_db->sql_freeresult($result); + + // If there is a user id 1, we need to increment user ids. :/ + if ($user_id === 1) + { + // Try to get the maximum user id possible... + $sql = "SELECT MAX(user_id) AS max_user_id + FROM {$convert->src_table_prefix}users"; + $result = $src_db->sql_query($sql); + $user_id = (int) $src_db->sql_fetchfield('max_user_id'); + $src_db->sql_freeresult($result); + + set_config('increment_user_id', ($user_id + 1), true); + } + else + { + set_config('increment_user_id', 0, true); + } + + // Overwrite maximum avatar width/height + @define('DEFAULT_AVATAR_X_CUSTOM', get_config_value('avatar_max_width')); + @define('DEFAULT_AVATAR_Y_CUSTOM', get_config_value('avatar_max_height')); + + // additional table used only during conversion + @define('USERCONV_TABLE', $table_prefix . 'userconv'); + +/** +* Description on how to use the convertor framework. +* +* 'schema' Syntax Description +* -> 'target' => Target Table. If not specified the next table will be handled +* -> 'primary' => Primary Key. If this is specified then this table is processed in batches +* -> 'query_first' => array('target' or 'src', Query to execute before beginning the process +* (if more than one then specified as array)) +* -> 'function_first' => Function to execute before beginning the process (if more than one then specified as array) +* (This is mostly useful if variables need to be given to the converting process) +* -> 'test_file' => This is not used at the moment but should be filled with a file from the old installation +* +* // DB Functions +* 'distinct' => Add DISTINCT to the select query +* 'where' => Add WHERE to the select query +* 'group_by' => Add GROUP BY to the select query +* 'left_join' => Add LEFT JOIN to the select query (if more than one joins specified as array) +* 'having' => Add HAVING to the select query +* +* // DB INSERT array +* This one consist of three parameters +* First Parameter: +* The key need to be filled within the target table +* If this is empty, the target table gets not assigned the source value +* Second Parameter: +* Source value. If the first parameter is specified, it will be assigned this value. +* If the first parameter is empty, this only gets added to the select query +* Third Parameter: +* Custom Function. Function to execute while storing source value into target table. +* The functions return value get stored. +* The function parameter consist of the value of the second parameter. +* +* types: +* - empty string == execute nothing +* - string == function to execute +* - array == complex execution instructions +* +* Complex execution instructions: +* @todo test complex execution instructions - in theory they will work fine +* +* By defining an array as the third parameter you are able to define some statements to be executed. The key +* is defining what to execute, numbers can be appended... +* +* 'function' => execute function +* 'execute' => run code, whereby all occurrences of {VALUE} get replaced by the last returned value. +* The result *must* be assigned/stored to {RESULT}. +* 'typecast' => typecast value +* +* The returned variables will be made always available to the next function to continue to work with. +* +* example (variable inputted is an integer of 1): +* +* array( +* 'function1' => 'increment_by_one', // returned variable is 2 +* 'typecast' => 'string', // typecast variable to be a string +* 'execute' => '{RESULT} = {VALUE} . ' is good';', // returned variable is '2 is good' +* 'function2' => 'replace_good_with_bad', // returned variable is '2 is bad' +* ), +* +*/ + + $convertor = array( + 'test_file' => 'viewtopic.php', + + 'avatar_path' => get_config_value('avatar_path') . '/', + 'avatar_gallery_path' => get_config_value('avatar_gallery_path') . '/', + 'smilies_path' => get_config_value('smilies_path') . '/', + 'upload_path' => (defined('MOD_ATTACHMENT')) ? phpbb_get_files_dir() . '/' : '', + 'thumbnails' => (defined('MOD_ATTACHMENT')) ? array('thumbs/', 't_') : '', + 'ranks_path' => false, // phpBB 2.0.x had no config value for a ranks path + + // We empty some tables to have clean data available + 'query_first' => array( + array('target', $convert->truncate_statement . SEARCH_RESULTS_TABLE), + array('target', $convert->truncate_statement . SEARCH_WORDLIST_TABLE), + array('target', $convert->truncate_statement . SEARCH_WORDMATCH_TABLE), + array('target', $convert->truncate_statement . LOG_TABLE), + ), + +// with this you are able to import all attachment files on the fly. For large boards this is not an option, therefore commented out by default. +// Instead every file gets copied while processing the corresponding attachment entry. +// if (defined("MOD_ATTACHMENT")) { import_attachment_files(); phpbb_copy_thumbnails(); } + + // phpBB2 allowed some similar usernames to coexist which would have the same + // username_clean in phpBB3 which is not possible, so we'll give the admin a list + // of user ids and usernames and let him deicde what he wants to do with them + 'execute_first' => ' + phpbb_create_userconv_table(); + import_avatar_gallery(); + if (defined("MOD_ATTACHMENT")) phpbb_import_attach_config(); + phpbb_insert_forums(); + ', + + 'execute_last' => array(' + add_bots(); + ', ' + update_folder_pm_count(); + ', ' + update_unread_count(); + ', (defined('MOD_ATTACHMENT')) ? ' + phpbb_attachment_extension_group_name(); + ' : ' + ', ' + phpbb_convert_authentication(\'start\'); + ', ' + phpbb_convert_authentication(\'first\'); + ', ' + phpbb_convert_authentication(\'second\'); + ', ' + phpbb_convert_authentication(\'third\'); + '), + + 'schema' => array( + array( + 'target' => USERCONV_TABLE, + 'query_first' => array('target', $convert->truncate_statement . USERCONV_TABLE), + + + array('user_id', 'users.user_id', ''), + array('username_clean', 'users.username', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_clean_string')), + ), + + array( + 'target' => (defined('MOD_ATTACHMENT')) ? ATTACHMENTS_TABLE : '', + 'primary' => 'attachments.attach_id', + 'query_first' => (defined('MOD_ATTACHMENT')) ? array('target', $convert->truncate_statement . ATTACHMENTS_TABLE) : '', + 'autoincrement' => 'attach_id', + + array('attach_id', 'attachments.attach_id', ''), + array('post_msg_id', 'attachments.post_id', ''), + array('topic_id', 'posts.topic_id', ''), + array('in_message', 0, ''), + array('is_orphan', 0, ''), + array('poster_id', 'attachments.user_id_1 AS poster_id', 'phpbb_user_id'), + array('physical_filename', 'attachments_desc.physical_filename', 'import_attachment'), + array('real_filename', 'attachments_desc.real_filename', 'phpbb_set_encoding'), + array('download_count', 'attachments_desc.download_count', ''), + array('attach_comment', 'attachments_desc.comment', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')), + array('extension', 'attachments_desc.extension', ''), + array('mimetype', 'attachments_desc.mimetype', ''), + array('filesize', 'attachments_desc.filesize', ''), + array('filetime', 'attachments_desc.filetime', ''), + array('thumbnail', 'attachments_desc.thumbnail', ''), + + 'where' => 'attachments_desc.attach_id = attachments.attach_id AND attachments.privmsgs_id = 0 AND posts.post_id = attachments.post_id', + 'group_by' => 'attachments.attach_id' + ), + + array( + 'target' => (defined('MOD_ATTACHMENT')) ? ATTACHMENTS_TABLE : '', + 'primary' => 'attachments.attach_id', + 'autoincrement' => 'attach_id', + + array('attach_id', 'attachments.attach_id', ''), + array('post_msg_id', 'attachments.privmsgs_id', ''), + array('topic_id', 0, ''), + array('in_message', 1, ''), + array('is_orphan', 0, ''), + array('poster_id', 'attachments.user_id_1 AS poster_id', 'phpbb_user_id'), + array('physical_filename', 'attachments_desc.physical_filename', 'import_attachment'), + array('real_filename', 'attachments_desc.real_filename', 'phpbb_set_encoding'), + array('download_count', 'attachments_desc.download_count', ''), + array('attach_comment', 'attachments_desc.comment', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')), + array('extension', 'attachments_desc.extension', ''), + array('mimetype', 'attachments_desc.mimetype', ''), + array('filesize', 'attachments_desc.filesize', ''), + array('filetime', 'attachments_desc.filetime', ''), + array('thumbnail', 'attachments_desc.thumbnail', ''), + + 'where' => 'attachments_desc.attach_id = attachments.attach_id AND attachments.post_id = 0', + 'group_by' => 'attachments.attach_id' + ), + + array( + 'target' => (defined('MOD_ATTACHMENT')) ? EXTENSIONS_TABLE : '', + 'query_first' => (defined('MOD_ATTACHMENT')) ? array('target', $convert->truncate_statement . EXTENSIONS_TABLE) : '', + 'autoincrement' => 'extension_id', + + array('extension_id', 'extensions.ext_id', ''), + array('group_id', 'extensions.group_id', ''), + array('extension', 'extensions.extension', ''), + ), + + array( + 'target' => (defined('MOD_ATTACHMENT')) ? EXTENSION_GROUPS_TABLE : '', + 'query_first' => (defined('MOD_ATTACHMENT')) ? array('target', $convert->truncate_statement . EXTENSION_GROUPS_TABLE) : '', + 'autoincrement' => 'group_id', + + array('group_id', 'extension_groups.group_id', ''), + array('group_name', 'extension_groups.group_name', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')), + array('cat_id', 'extension_groups.cat_id', 'phpbb_attachment_category'), + array('allow_group', 'extension_groups.allow_group', ''), + array('download_mode', 1, ''), + array('upload_icon', '', ''), + array('max_filesize', 'extension_groups.max_filesize', ''), + array('allowed_forums', 'extension_groups.forum_permissions', 'phpbb_attachment_forum_perms'), + array('allow_in_pm', 1, ''), + ), + + array( + 'target' => BANLIST_TABLE, + 'execute_first' => 'phpbb_check_username_collisions();', + 'query_first' => array('target', $convert->truncate_statement . BANLIST_TABLE), + + array('ban_ip', 'banlist.ban_ip', 'decode_ban_ip'), + array('ban_userid', 'banlist.ban_userid', 'phpbb_user_id'), + array('ban_email', 'banlist.ban_email', ''), + array('ban_reason', '', ''), + array('ban_give_reason', '', ''), + + 'where' => "banlist.ban_ip NOT LIKE '%.%'", + ), + + array( + 'target' => BANLIST_TABLE, + + array('ban_ip', 'banlist.ban_ip', ''), + array('ban_userid', 0, ''), + array('ban_email', '', ''), + array('ban_reason', '', ''), + array('ban_give_reason', '', ''), + + 'where' => "banlist.ban_ip LIKE '%.%'", + ), + + array( + 'target' => DISALLOW_TABLE, + 'query_first' => array('target', $convert->truncate_statement . DISALLOW_TABLE), + + array('disallow_username', 'disallow.disallow_username', 'phpbb_disallowed_username'), + ), + + array( + 'target' => RANKS_TABLE, + 'query_first' => array('target', $convert->truncate_statement . RANKS_TABLE), + 'autoincrement' => 'rank_id', + + array('rank_id', 'ranks.rank_id', ''), + array('rank_title', 'ranks.rank_title', array('function1' => 'phpbb_set_default_encoding', 'function2' => 'utf8_htmlspecialchars')), + array('rank_min', 'ranks.rank_min', array('typecast' => 'int', 'execute' => '{RESULT} = ({VALUE}[0] < 0) ? 0 : {VALUE}[0];')), + array('rank_special', 'ranks.rank_special', ''), + array('rank_image', 'ranks.rank_image', 'import_rank'), + ), + + array( + 'target' => TOPICS_TABLE, + 'query_first' => array('target', $convert->truncate_statement . TOPICS_TABLE), + 'primary' => 'topics.topic_id', + 'autoincrement' => 'topic_id', + + array('topic_id', 'topics.topic_id', ''), + array('forum_id', 'topics.forum_id', ''), + array('icon_id', 0, ''), + array('topic_poster', 'topics.topic_poster AS poster_id', 'phpbb_user_id'), + array('topic_attachment', ((defined('MOD_ATTACHMENT')) ? 'topics.topic_attachment' : 0), ''), + array('topic_title', 'topics.topic_title', 'phpbb_set_encoding'), + array('topic_time', 'topics.topic_time', ''), + array('topic_views', 'topics.topic_views', ''), + array('topic_posts_approved', 'topics.topic_replies', 'phpbb_topic_replies_to_posts'), + array('topic_posts_unapproved', 0, ''), + array('topic_posts_softdeleted',0, ''), + array('topic_last_post_id', 'topics.topic_last_post_id', ''), + array('topic_status', 'topics.topic_status', 'is_topic_locked'), + array('topic_moved_id', 0, ''), + array('topic_type', 'topics.topic_type', 'phpbb_convert_topic_type'), + array('topic_first_post_id', 'topics.topic_first_post_id', ''), + array('topic_last_view_time', 'posts.post_time', 'intval'), + array('topic_visibility', ITEM_APPROVED, ''), + + array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'htmlspecialchars_decode', 'function4' => 'utf8_htmlspecialchars')), + array('poll_start', 'vote_desc.vote_start', 'null_to_zero'), + array('poll_length', 'vote_desc.vote_length', 'null_to_zero'), + array('poll_max_options', 1, ''), + array('poll_vote_change', 0, ''), + + 'left_join' => array ( 'topics LEFT JOIN vote_desc ON topics.topic_id = vote_desc.topic_id AND topics.topic_vote = 1', + 'topics LEFT JOIN posts ON topics.topic_last_post_id = posts.post_id', + ), + 'where' => 'topics.topic_moved_id = 0', + ), + + array( + 'target' => TOPICS_TABLE, + 'primary' => 'topics.topic_id', + 'autoincrement' => 'topic_id', + + array('topic_id', 'topics.topic_id', ''), + array('forum_id', 'topics.forum_id', ''), + array('icon_id', 0, ''), + array('topic_poster', 'topics.topic_poster AS poster_id', 'phpbb_user_id'), + array('topic_attachment', ((defined('MOD_ATTACHMENT')) ? 'topics.topic_attachment' : 0), ''), + array('topic_title', 'topics.topic_title', 'phpbb_set_encoding'), + array('topic_time', 'topics.topic_time', ''), + array('topic_views', 'topics.topic_views', ''), + array('topic_posts_approved', 'topics.topic_replies', 'phpbb_topic_replies_to_posts'), + array('topic_posts_unapproved', 0, ''), + array('topic_posts_softdeleted',0, ''), + array('topic_last_post_id', 'topics.topic_last_post_id', ''), + array('topic_status', ITEM_MOVED, ''), + array('topic_moved_id', 'topics.topic_moved_id', ''), + array('topic_type', 'topics.topic_type', 'phpbb_convert_topic_type'), + array('topic_first_post_id', 'topics.topic_first_post_id', ''), + array('topic_visibility', ITEM_APPROVED, ''), + + array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'htmlspecialchars_decode', 'function4' => 'utf8_htmlspecialchars')), + array('poll_start', 'vote_desc.vote_start', 'null_to_zero'), + array('poll_length', 'vote_desc.vote_length', 'null_to_zero'), + array('poll_max_options', 1, ''), + array('poll_vote_change', 0, ''), + + 'left_join' => 'topics LEFT JOIN vote_desc ON topics.topic_id = vote_desc.topic_id AND topics.topic_vote = 1', + 'where' => 'topics.topic_moved_id <> 0', + ), + + array( + 'target' => TOPICS_WATCH_TABLE, + 'primary' => 'topics_watch.topic_id', + 'query_first' => array('target', $convert->truncate_statement . TOPICS_WATCH_TABLE), + + array('topic_id', 'topics_watch.topic_id', ''), + array('user_id', 'topics_watch.user_id', 'phpbb_user_id'), + array('notify_status', 'topics_watch.notify_status', ''), + ), + + array( + 'target' => SMILIES_TABLE, + 'query_first' => array('target', $convert->truncate_statement . SMILIES_TABLE), + 'autoincrement' => 'smiley_id', + + array('smiley_id', 'smilies.smilies_id', ''), + array('code', 'smilies.code', array('function1' => 'phpbb_smilie_html_decode', 'function2' => 'phpbb_set_encoding', 'function3' => 'utf8_htmlspecialchars')), + array('emotion', 'smilies.emoticon', 'phpbb_set_encoding'), + array('smiley_url', 'smilies.smile_url', 'import_smiley'), + array('smiley_width', 'smilies.smile_url', 'get_smiley_width'), + array('smiley_height', 'smilies.smile_url', 'get_smiley_height'), + array('smiley_order', 'smilies.smilies_id', ''), + array('display_on_posting', 'smilies.smilies_id', 'get_smiley_display'), + + 'order_by' => 'smilies.smilies_id ASC', + ), + + array( + 'target' => POLL_OPTIONS_TABLE, + 'primary' => 'vote_results.vote_option_id', + 'query_first' => array('target', $convert->truncate_statement . POLL_OPTIONS_TABLE), + + array('poll_option_id', 'vote_results.vote_option_id', ''), + array('topic_id', 'vote_desc.topic_id', ''), + array('', 'topics.topic_poster AS poster_id', 'phpbb_user_id'), + array('poll_option_text', 'vote_results.vote_option_text', array('function1' => 'phpbb_set_encoding', 'function2' => 'htmlspecialchars_decode', 'function3' => 'utf8_htmlspecialchars')), + array('poll_option_total', 'vote_results.vote_result', ''), + + 'where' => 'vote_results.vote_id = vote_desc.vote_id', + 'left_join' => 'vote_desc LEFT JOIN topics ON topics.topic_id = vote_desc.topic_id', + ), + + array( + 'target' => POLL_VOTES_TABLE, + 'primary' => 'vote_desc.topic_id', + 'query_first' => array('target', $convert->truncate_statement . POLL_VOTES_TABLE), + + array('poll_option_id', VOTE_CONVERTED, ''), + array('topic_id', 'vote_desc.topic_id', ''), + array('vote_user_id', 'vote_voters.vote_user_id', 'phpbb_user_id'), + array('vote_user_ip', 'vote_voters.vote_user_ip', 'decode_ip'), + + 'where' => 'vote_voters.vote_id = vote_desc.vote_id', + ), + + array( + 'target' => WORDS_TABLE, + 'primary' => 'words.word_id', + 'query_first' => array('target', $convert->truncate_statement . WORDS_TABLE), + 'autoincrement' => 'word_id', + + array('word_id', 'words.word_id', ''), + array('word', 'words.word', 'phpbb_set_encoding'), + array('replacement', 'words.replacement', 'phpbb_set_encoding'), + ), + + array( + 'target' => POSTS_TABLE, + 'primary' => 'posts.post_id', + 'autoincrement' => 'post_id', + 'query_first' => array('target', $convert->truncate_statement . POSTS_TABLE), + 'execute_first' => ' + $config["max_post_chars"] = 0; + $config["min_post_chars"] = 0; + $config["max_quote_depth"] = 0; + ', + + array('post_id', 'posts.post_id', ''), + array('topic_id', 'posts.topic_id', ''), + array('forum_id', 'posts.forum_id', ''), + array('poster_id', 'posts.poster_id', 'phpbb_user_id'), + array('icon_id', 0, ''), + array('poster_ip', 'posts.poster_ip', 'decode_ip'), + array('post_time', 'posts.post_time', ''), + array('enable_bbcode', 'posts.enable_bbcode', ''), + array('', 'posts.enable_html', ''), + array('enable_smilies', 'posts.enable_smilies', ''), + array('enable_sig', 'posts.enable_sig', ''), + array('enable_magic_url', 1, ''), + array('post_username', 'posts.post_username', 'phpbb_set_encoding'), + array('post_subject', 'posts_text.post_subject', 'phpbb_set_encoding'), + array('post_attachment', ((defined('MOD_ATTACHMENT')) ? 'posts.post_attachment' : 0), ''), + array('post_edit_time', 'posts.post_edit_time', array('typecast' => 'int')), + array('post_edit_count', 'posts.post_edit_count', ''), + array('post_edit_reason', '', ''), + array('post_edit_user', '', 'phpbb_post_edit_user'), + array('post_visibility', ITEM_APPROVED, ''), + + array('bbcode_uid', 'posts.post_time', 'make_uid'), + array('post_text', 'posts_text.post_text', 'phpbb_prepare_message'), + array('', 'posts_text.bbcode_uid AS old_bbcode_uid', ''), + array('bbcode_bitfield', '', 'get_bbcode_bitfield'), + array('post_checksum', '', ''), + + // Commented out inline search indexing, this takes up a LOT of time. :D + // @todo We either need to enable this or call the rebuild search functionality post convert +/* array('', '', 'search_indexing'), + array('', 'posts_text.post_text AS message', ''), + array('', 'posts_text.post_subject AS title', ''),*/ + + 'where' => 'posts.post_id = posts_text.post_id' + ), + + array( + 'target' => PRIVMSGS_TABLE, + 'primary' => 'privmsgs.privmsgs_id', + 'autoincrement' => 'msg_id', + 'query_first' => array( + array('target', $convert->truncate_statement . PRIVMSGS_TABLE), + array('target', $convert->truncate_statement . PRIVMSGS_RULES_TABLE), + ), + + 'execute_first' => ' + $config["max_post_chars"] = 0; + $config["min_post_chars"] = 0; + $config["max_quote_depth"] = 0; + ', + + array('msg_id', 'privmsgs.privmsgs_id', ''), + array('root_level', 0, ''), + array('author_id', 'privmsgs.privmsgs_from_userid AS poster_id', 'phpbb_user_id'), + array('icon_id', 0, ''), + array('author_ip', 'privmsgs.privmsgs_ip', 'decode_ip'), + array('message_time', 'privmsgs.privmsgs_date', ''), + array('enable_bbcode', 'privmsgs.privmsgs_enable_bbcode AS enable_bbcode', ''), + array('', 'privmsgs.privmsgs_enable_html AS enable_html', ''), + array('enable_smilies', 'privmsgs.privmsgs_enable_smilies AS enable_smilies', ''), + array('enable_magic_url', 1, ''), + array('enable_sig', 'privmsgs.privmsgs_attach_sig', ''), + array('message_subject', 'privmsgs.privmsgs_subject', 'phpbb_set_encoding'), // Already specialchared in 2.0.x + array('message_attachment', ((defined('MOD_ATTACHMENT')) ? 'privmsgs.privmsgs_attachment' : 0), ''), + array('message_edit_reason', '', ''), + array('message_edit_user', 0, ''), + array('message_edit_time', 0, ''), + array('message_edit_count', 0, ''), + + array('bbcode_uid', 'privmsgs.privmsgs_date AS post_time', 'make_uid'), + array('message_text', 'privmsgs_text.privmsgs_text', 'phpbb_prepare_message'), + array('', 'privmsgs_text.privmsgs_bbcode_uid AS old_bbcode_uid', ''), + array('bbcode_bitfield', '', 'get_bbcode_bitfield'), + array('to_address', 'privmsgs.privmsgs_to_userid', 'phpbb_privmsgs_to_userid'), + array('bcc_address', '', ''), + + 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id' + ), + + array( + 'target' => PRIVMSGS_FOLDER_TABLE, + 'primary' => 'users.user_id', + 'query_first' => array('target', $convert->truncate_statement . PRIVMSGS_FOLDER_TABLE), + + array('user_id', 'users.user_id', 'phpbb_user_id'), + array('folder_name', $user->lang['CONV_SAVED_MESSAGES'], ''), + array('pm_count', 0, ''), + + 'where' => 'users.user_id <> -1', + ), + + // Inbox + array( + 'target' => PRIVMSGS_TO_TABLE, + 'primary' => 'privmsgs.privmsgs_id', + 'query_first' => array('target', $convert->truncate_statement . PRIVMSGS_TO_TABLE), + + array('msg_id', 'privmsgs.privmsgs_id', ''), + array('user_id', 'privmsgs.privmsgs_to_userid', 'phpbb_user_id'), + array('author_id', 'privmsgs.privmsgs_from_userid', 'phpbb_user_id'), + array('pm_deleted', 0, ''), + array('pm_new', 'privmsgs.privmsgs_type', 'phpbb_new_pm'), + array('pm_unread', 'privmsgs.privmsgs_type', 'phpbb_unread_pm'), + array('pm_replied', 0, ''), + array('pm_marked', 0, ''), + array('pm_forwarded', 0, ''), + array('folder_id', PRIVMSGS_INBOX, ''), + + 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id + AND (privmsgs.privmsgs_type = 0 OR privmsgs.privmsgs_type = 1 OR privmsgs.privmsgs_type = 5)', + ), + + // Outbox + array( + 'target' => PRIVMSGS_TO_TABLE, + 'primary' => 'privmsgs.privmsgs_id', + + array('msg_id', 'privmsgs.privmsgs_id', ''), + array('user_id', 'privmsgs.privmsgs_from_userid', 'phpbb_user_id'), + array('author_id', 'privmsgs.privmsgs_from_userid', 'phpbb_user_id'), + array('pm_deleted', 0, ''), + array('pm_new', 0, ''), + array('pm_unread', 0, ''), + array('pm_replied', 0, ''), + array('pm_marked', 0, ''), + array('pm_forwarded', 0, ''), + array('folder_id', PRIVMSGS_OUTBOX, ''), + + 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id + AND (privmsgs.privmsgs_type = 1 OR privmsgs.privmsgs_type = 5)', + ), + + // Sentbox + array( + 'target' => PRIVMSGS_TO_TABLE, + 'primary' => 'privmsgs.privmsgs_id', + + array('msg_id', 'privmsgs.privmsgs_id', ''), + array('user_id', 'privmsgs.privmsgs_from_userid', 'phpbb_user_id'), + array('author_id', 'privmsgs.privmsgs_from_userid', 'phpbb_user_id'), + array('pm_deleted', 0, ''), + array('pm_new', 'privmsgs.privmsgs_type', 'phpbb_new_pm'), + array('pm_unread', 'privmsgs.privmsgs_type', 'phpbb_unread_pm'), + array('pm_replied', 0, ''), + array('pm_marked', 0, ''), + array('pm_forwarded', 0, ''), + array('folder_id', PRIVMSGS_SENTBOX, ''), + + 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id + AND privmsgs.privmsgs_type = 2', + ), + + // Savebox (SAVED IN) + array( + 'target' => PRIVMSGS_TO_TABLE, + 'primary' => 'privmsgs.privmsgs_id', + + array('msg_id', 'privmsgs.privmsgs_id', ''), + array('user_id', 'privmsgs.privmsgs_to_userid', 'phpbb_user_id'), + array('author_id', 'privmsgs.privmsgs_from_userid', 'phpbb_user_id'), + array('pm_deleted', 0, ''), + array('pm_new', 'privmsgs.privmsgs_type', 'phpbb_new_pm'), + array('pm_unread', 'privmsgs.privmsgs_type', 'phpbb_unread_pm'), + array('pm_replied', 0, ''), + array('pm_marked', 0, ''), + array('pm_forwarded', 0, ''), + array('folder_id', 'privmsgs.privmsgs_to_userid', 'phpbb_get_savebox_id'), + + 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id + AND privmsgs.privmsgs_type = 3', + ), + + // Savebox (SAVED OUT) + array( + 'target' => PRIVMSGS_TO_TABLE, + 'primary' => 'privmsgs.privmsgs_id', + + array('msg_id', 'privmsgs.privmsgs_id', ''), + array('user_id', 'privmsgs.privmsgs_from_userid', 'phpbb_user_id'), + array('author_id', 'privmsgs.privmsgs_from_userid', 'phpbb_user_id'), + array('pm_deleted', 0, ''), + array('pm_new', 'privmsgs.privmsgs_type', 'phpbb_new_pm'), + array('pm_unread', 'privmsgs.privmsgs_type', 'phpbb_unread_pm'), + array('pm_replied', 0, ''), + array('pm_marked', 0, ''), + array('pm_forwarded', 0, ''), + array('folder_id', 'privmsgs.privmsgs_from_userid', 'phpbb_get_savebox_id'), + + 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id + AND privmsgs.privmsgs_type = 4', + ), + + array( + 'target' => GROUPS_TABLE, + 'autoincrement' => 'group_id', + 'query_first' => array( + array('target', $convert->truncate_statement . GROUPS_TABLE), + array('target', $convert->truncate_statement . TEAMPAGE_TABLE), + ), + + array('group_id', 'groups.group_id', ''), + array('group_type', 'groups.group_type', 'phpbb_convert_group_type'), + array('group_display', 0, ''), + array('group_legend', 0, ''), + array('group_name', 'groups.group_name', 'phpbb_convert_group_name'), // phpbb_set_encoding called in phpbb_convert_group_name + array('group_desc', 'groups.group_description', 'phpbb_set_encoding'), + + 'where' => 'groups.group_single_user = 0', + ), + + array( + 'target' => USER_GROUP_TABLE, + 'query_first' => array('target', $convert->truncate_statement . USER_GROUP_TABLE), + 'execute_first' => ' + add_default_groups(); + add_groups_to_teampage(); + ', + + array('group_id', 'groups.group_id', ''), + array('user_id', 'groups.group_moderator', 'phpbb_user_id'), + array('group_leader', 1, ''), + array('user_pending', 0, ''), + + 'where' => 'groups.group_single_user = 0 AND groups.group_moderator <> 0', + ), + + array( + 'target' => USER_GROUP_TABLE, + + array('group_id', 'user_group.group_id', ''), + array('user_id', 'user_group.user_id', 'phpbb_user_id'), + array('group_leader', 0, ''), + array('user_pending', 'user_group.user_pending', ''), + + 'where' => 'user_group.group_id = groups.group_id AND groups.group_single_user = 0 AND groups.group_moderator <> user_group.user_id', + ), + + array( + 'target' => USERS_TABLE, + 'primary' => 'users.user_id', + 'autoincrement' => 'user_id', + 'query_first' => array( + array('target', 'DELETE FROM ' . USERS_TABLE . ' WHERE user_id <> ' . ANONYMOUS), + array('target', $convert->truncate_statement . BOTS_TABLE), + array('target', $convert->truncate_statement . USER_NOTIFICATIONS_TABLE), + ), + + 'execute_last' => ' + remove_invalid_users(); + ', + + array('user_id', 'users.user_id', 'phpbb_user_id'), + array('', 'users.user_id AS poster_id', 'phpbb_user_id'), + array('user_type', 'users.user_active', 'set_user_type'), + array('group_id', 'users.user_level', 'phpbb_set_primary_group'), + array('user_regdate', 'users.user_regdate', ''), + array('username', 'users.username', 'phpbb_set_default_encoding'), // recode to utf8 with default lang + array('username_clean', 'users.username', array('function1' => 'phpbb_set_default_encoding', 'function2' => 'utf8_clean_string')), + array('user_password', 'users.user_password', 'phpbb_convert_password_hash'), + array('user_posts', 'users.user_posts', 'intval'), + array('user_email', 'users.user_email', 'strtolower'), + array('user_email_hash', 'users.user_email', 'gen_email_hash'), + array('user_birthday', ((defined('MOD_BIRTHDAY')) ? 'users.user_birthday' : ''), 'phpbb_get_birthday'), + array('user_lastvisit', 'users.user_lastvisit', 'intval'), + array('user_lastmark', 'users.user_lastvisit', 'intval'), + array('user_lang', $config['default_lang'], ''), + array('', 'users.user_lang', ''), + array('user_timezone', 'users.user_timezone', 'phpbb_convert_timezone'), + array('user_dateformat', 'users.user_dateformat', array('function1' => 'phpbb_set_encoding', 'function2' => 'fill_dateformat')), + array('user_inactive_reason', '', 'phpbb_inactive_reason'), + array('user_inactive_time', '', 'phpbb_inactive_time'), + + array('user_jabber', '', ''), + array('user_rank', 'users.user_rank', 'intval'), + array('user_permissions', '', ''), + + array('user_avatar', 'users.user_avatar', 'phpbb_import_avatar'), + array('user_avatar_type', 'users.user_avatar_type', 'phpbb_avatar_type'), + array('user_avatar_width', 'users.user_avatar', 'phpbb_get_avatar_width'), + array('user_avatar_height', 'users.user_avatar', 'phpbb_get_avatar_height'), + + array('user_new_privmsg', 'users.user_new_privmsg', ''), + array('user_unread_privmsg', 0, ''), //'users.user_unread_privmsg' + array('user_last_privmsg', 'users.user_last_privmsg', 'intval'), + array('user_emailtime', 'users.user_emailtime', 'null_to_zero'), + array('user_notify', 'users.user_notify', 'intval'), + array('user_notify_pm', 'users.user_notify_pm', 'intval'), + array('user_notify_type', NOTIFY_EMAIL, ''), + array('user_allow_pm', 'users.user_allow_pm', 'intval'), + array('user_allow_viewonline', 'users.user_allow_viewonline', 'intval'), + array('user_allow_viewemail', 'users.user_viewemail', 'intval'), + array('user_actkey', 'users.user_actkey', ''), + array('user_newpasswd', '', ''), // Users need to re-request their password... + array('user_style', $config['default_style'], ''), + + array('user_options', '', 'set_user_options'), + array('', 'users.user_popup_pm AS popuppm', ''), + array('', 'users.user_allowhtml AS html', ''), + array('', 'users.user_allowbbcode AS bbcode', ''), + array('', 'users.user_allowsmile AS smile', ''), + array('', 'users.user_attachsig AS attachsig',''), + + array('user_sig_bbcode_uid', 'users.user_regdate', 'make_uid'), + array('user_sig', 'users.user_sig', 'phpbb_prepare_message'), + array('', 'users.user_sig_bbcode_uid AS old_bbcode_uid', ''), + array('user_sig_bbcode_bitfield', '', 'get_bbcode_bitfield'), + array('', 'users.user_regdate AS post_time', ''), + + array('', 'users.user_notify_pm', 'phpbb_add_notification_options'), + + 'where' => 'users.user_id <> -1', + ), + + array( + 'target' => PROFILE_FIELDS_DATA_TABLE, + 'primary' => 'users.user_id', + 'query_first' => array( + array('target', $convert->truncate_statement . PROFILE_FIELDS_DATA_TABLE), + ), + + array('user_id', 'users.user_id', 'phpbb_user_id'), + array('pf_phpbb_occupation', 'users.user_occ', array('function1' => 'phpbb_set_encoding')), + array('pf_phpbb_interests', 'users.user_interests', array('function1' => 'phpbb_set_encoding')), + array('pf_phpbb_location', 'users.user_from', array('function1' => 'phpbb_set_encoding')), + array('pf_phpbb_icq', 'users.user_icq', array('function1' => 'phpbb_set_encoding')), + array('pf_phpbb_wlm', 'users.user_msnm', array('function1' => 'phpbb_set_encoding')), + array('pf_phpbb_yahoo', 'users.user_yim', array('function1' => 'phpbb_set_encoding')), + array('pf_phpbb_aol', 'users.user_aim', array('function1' => 'phpbb_set_encoding')), + array('pf_phpbb_website', 'users.user_website', 'validate_website'), + + 'where' => 'users.user_id <> -1', + ), + ), + ); +} diff --git a/sources/phpBB/install/convertors/functions_phpbb20.php b/sources/phpBB/install/convertors/functions_phpbb20.php new file mode 100644 index 0000000..817c007 --- /dev/null +++ b/sources/phpBB/install/convertors/functions_phpbb20.php @@ -0,0 +1,1981 @@ + +* @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; +} + +/** +* Helper functions for phpBB 2.0.x to phpBB 3.1.x conversion +*/ + +/** +* Set forum flags - only prune old polls by default +*/ +function phpbb_forum_flags() +{ + // Set forum flags + $forum_flags = 0; + + // FORUM_FLAG_LINK_TRACK + $forum_flags += 0; + + // FORUM_FLAG_PRUNE_POLL + $forum_flags += FORUM_FLAG_PRUNE_POLL; + + // FORUM_FLAG_PRUNE_ANNOUNCE + $forum_flags += 0; + + // FORUM_FLAG_PRUNE_STICKY + $forum_flags += 0; + + // FORUM_FLAG_ACTIVE_TOPICS + $forum_flags += 0; + + // FORUM_FLAG_POST_REVIEW + $forum_flags += FORUM_FLAG_POST_REVIEW; + + return $forum_flags; +} + +/** +* Insert/Convert forums +*/ +function phpbb_insert_forums() +{ + global $db, $src_db, $same_db, $convert, $user, $config; + + $db->sql_query($convert->truncate_statement . FORUMS_TABLE); + + // Determine the highest id used within the old forums table (we add the categories after the forum ids) + $sql = 'SELECT MAX(forum_id) AS max_forum_id + FROM ' . $convert->src_table_prefix . 'forums'; + $result = $src_db->sql_query($sql); + $max_forum_id = (int) $src_db->sql_fetchfield('max_forum_id'); + $src_db->sql_freeresult($result); + + $max_forum_id++; + + // pruning disabled globally? + $sql = "SELECT config_value + FROM {$convert->src_table_prefix}config + WHERE config_name = 'prune_enable'"; + $result = $src_db->sql_query($sql); + $prune_enabled = (int) $src_db->sql_fetchfield('config_value'); + $src_db->sql_freeresult($result); + + // Insert categories + $sql = 'SELECT cat_id, cat_title + FROM ' . $convert->src_table_prefix . 'categories + ORDER BY cat_order'; + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'binary'"); + } + + $result = $src_db->sql_query($sql); + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'utf8'"); + } + + switch ($db->get_sql_layer()) + { + case 'mssql': + case 'mssql_odbc': + case 'mssqlnative': + $db->sql_query('SET IDENTITY_INSERT ' . FORUMS_TABLE . ' ON'); + break; + } + + $cats_added = array(); + while ($row = $src_db->sql_fetchrow($result)) + { + $sql_ary = array( + 'forum_id' => (int) $max_forum_id, + 'forum_name' => ($row['cat_title']) ? htmlspecialchars(phpbb_set_default_encoding($row['cat_title']), ENT_COMPAT, 'UTF-8') : $user->lang['CATEGORY'], + 'parent_id' => 0, + 'forum_parents' => '', + 'forum_desc' => '', + 'forum_type' => FORUM_CAT, + 'forum_status' => ITEM_UNLOCKED, + 'forum_rules' => '', + ); + + $sql = 'SELECT MAX(right_id) AS right_id + FROM ' . FORUMS_TABLE; + $_result = $db->sql_query($sql); + $cat_row = $db->sql_fetchrow($_result); + $db->sql_freeresult($_result); + + $sql_ary['left_id'] = (int) ($cat_row['right_id'] + 1); + $sql_ary['right_id'] = (int) ($cat_row['right_id'] + 2); + + $sql = 'INSERT INTO ' . FORUMS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + + $cats_added[$row['cat_id']] = $max_forum_id; + $max_forum_id++; + } + $src_db->sql_freeresult($result); + + // There may be installations having forums with non-existant category ids. + // We try to catch them and add them to an "unknown" category instead of leaving them out. + $sql = 'SELECT cat_id + FROM ' . $convert->src_table_prefix . 'forums + GROUP BY cat_id'; + $result = $src_db->sql_query($sql); + + $unknown_cat_id = false; + while ($row = $src_db->sql_fetchrow($result)) + { + // Catch those categories not been added before + if (!isset($cats_added[$row['cat_id']])) + { + $unknown_cat_id = true; + } + } + $src_db->sql_freeresult($result); + + // Is there at least one category not known? + if ($unknown_cat_id === true) + { + $unknown_cat_id = 'ghost'; + + $sql_ary = array( + 'forum_id' => (int) $max_forum_id, + 'forum_name' => (string) $user->lang['CATEGORY'], + 'parent_id' => 0, + 'forum_parents' => '', + 'forum_desc' => '', + 'forum_type' => FORUM_CAT, + 'forum_status' => ITEM_UNLOCKED, + 'forum_rules' => '', + ); + + $sql = 'SELECT MAX(right_id) AS right_id + FROM ' . FORUMS_TABLE; + $_result = $db->sql_query($sql); + $cat_row = $db->sql_fetchrow($_result); + $db->sql_freeresult($_result); + + $sql_ary['left_id'] = (int) ($cat_row['right_id'] + 1); + $sql_ary['right_id'] = (int) ($cat_row['right_id'] + 2); + + $sql = 'INSERT INTO ' . FORUMS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + + $cats_added[$unknown_cat_id] = $max_forum_id; + $max_forum_id++; + } + + // Now insert the forums + $sql = 'SELECT f.forum_id, f.forum_name, f.cat_id, f.forum_desc, f.forum_status, f.prune_enable, f.prune_next, fp.prune_days, fp.prune_freq FROM ' . $convert->src_table_prefix . 'forums f + LEFT JOIN ' . $convert->src_table_prefix . 'forum_prune fp ON f.forum_id = fp.forum_id + GROUP BY f.forum_id, f.forum_name, f.cat_id, f.forum_desc, f.forum_status, f.prune_enable, f.prune_next, f.forum_order, fp.prune_days, fp.prune_freq + ORDER BY f.cat_id, f.forum_order'; + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'binary'"); + } + + $result = $src_db->sql_query($sql); + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'utf8'"); + } + + while ($row = $src_db->sql_fetchrow($result)) + { + // Some might have forums here with an id not being "possible"... + // To be somewhat friendly we "change" the category id for those to a previously created ghost category + if (!isset($cats_added[$row['cat_id']]) && $unknown_cat_id !== false) + { + $row['cat_id'] = $unknown_cat_id; + } + + if (!isset($cats_added[$row['cat_id']])) + { + continue; + } + + // Define the new forums sql ary + $sql_ary = array( + 'forum_id' => (int) $row['forum_id'], + 'forum_name' => htmlspecialchars(phpbb_set_default_encoding($row['forum_name']), ENT_COMPAT, 'UTF-8'), + 'parent_id' => (int) $cats_added[$row['cat_id']], + 'forum_parents' => '', + 'forum_desc' => htmlspecialchars(phpbb_set_default_encoding($row['forum_desc']), ENT_COMPAT, 'UTF-8'), + 'forum_type' => FORUM_POST, + 'forum_status' => is_item_locked($row['forum_status']), + 'enable_prune' => ($prune_enabled) ? (int) $row['prune_enable'] : 0, + 'prune_next' => (int) null_to_zero($row['prune_next']), + 'prune_days' => (int) null_to_zero($row['prune_days']), + 'prune_viewed' => 0, + 'prune_freq' => (int) null_to_zero($row['prune_freq']), + + 'forum_flags' => phpbb_forum_flags(), + 'forum_options' => 0, + + // Default values + 'forum_desc_bitfield' => '', + 'forum_desc_options' => 7, + 'forum_desc_uid' => '', + 'forum_link' => '', + 'forum_password' => '', + 'forum_style' => 0, + 'forum_image' => '', + 'forum_rules' => '', + 'forum_rules_link' => '', + 'forum_rules_bitfield' => '', + 'forum_rules_options' => 7, + 'forum_rules_uid' => '', + 'forum_topics_per_page' => 0, + 'forum_posts_approved' => 0, + 'forum_posts_unapproved' => 0, + 'forum_posts_softdeleted' => 0, + 'forum_topics_approved' => 0, + 'forum_topics_unapproved' => 0, + 'forum_topics_softdeleted' => 0, + 'forum_last_post_id' => 0, + 'forum_last_poster_id' => 0, + 'forum_last_post_subject' => '', + 'forum_last_post_time' => 0, + 'forum_last_poster_name' => '', + 'forum_last_poster_colour' => '', + 'display_on_index' => 1, + 'enable_indexing' => 1, + 'enable_icons' => 0, + ); + + // Now add the forums with proper left/right ids + $sql = 'SELECT left_id, right_id + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $cats_added[$row['cat_id']]; + $_result = $db->sql_query($sql); + $cat_row = $db->sql_fetchrow($_result); + $db->sql_freeresult($_result); + + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET left_id = left_id + 2, right_id = right_id + 2 + WHERE left_id > ' . $cat_row['right_id']; + $db->sql_query($sql); + + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET right_id = right_id + 2 + WHERE ' . $cat_row['left_id'] . ' BETWEEN left_id AND right_id'; + $db->sql_query($sql); + + $sql_ary['left_id'] = (int) $cat_row['right_id']; + $sql_ary['right_id'] = (int) ($cat_row['right_id'] + 1); + + $sql = 'INSERT INTO ' . FORUMS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + } + $src_db->sql_freeresult($result); + + switch ($db->get_sql_layer()) + { + case 'postgres': + $db->sql_query("SELECT SETVAL('" . FORUMS_TABLE . "_seq',(select case when max(forum_id)>0 then max(forum_id)+1 else 1 end from " . FORUMS_TABLE . '));'); + break; + + case 'mssql': + case 'mssql_odbc': + case 'mssqlnative': + $db->sql_query('SET IDENTITY_INSERT ' . FORUMS_TABLE . ' OFF'); + break; + + case 'oracle': + $result = $db->sql_query('SELECT MAX(forum_id) as max_id FROM ' . FORUMS_TABLE); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $largest_id = (int) $row['max_id']; + + if ($largest_id) + { + $db->sql_query('DROP SEQUENCE ' . FORUMS_TABLE . '_seq'); + $db->sql_query('CREATE SEQUENCE ' . FORUMS_TABLE . '_seq START WITH ' . ($largest_id + 1)); + } + break; + } +} + +/** +* Function for recoding text with the default language +* +* @param string $text text to recode to utf8 +* @param bool $grab_user_lang if set to true the function tries to use $convert_row['user_lang'] (and falls back to $convert_row['poster_id']) instead of the boards default language +*/ +function phpbb_set_encoding($text, $grab_user_lang = true) +{ + global $lang_enc_array, $convert_row; + global $convert, $phpEx; + + /*static $lang_enc_array = array( + 'korean' => 'euc-kr', + 'serbian' => 'windows-1250', + 'polish' => 'iso-8859-2', + 'kurdish' => 'windows-1254', + 'slovak' => 'Windows-1250', + 'russian' => 'windows-1251', + 'estonian' => 'iso-8859-4', + 'chinese_simplified' => 'gb2312', + 'macedonian' => 'windows-1251', + 'azerbaijani' => 'UTF-8', + 'romanian' => 'iso-8859-2', + 'romanian_diacritice' => 'iso-8859-2', + 'lithuanian' => 'windows-1257', + 'turkish' => 'iso-8859-9', + 'ukrainian' => 'windows-1251', + 'japanese' => 'shift_jis', + 'hungarian' => 'ISO-8859-2', + 'romanian_no_diacritics' => 'iso-8859-2', + 'mongolian' => 'UTF-8', + 'slovenian' => 'windows-1250', + 'bosnian' => 'windows-1250', + 'czech' => 'Windows-1250', + 'farsi' => 'Windows-1256', + 'croatian' => 'windows-1250', + 'greek' => 'iso-8859-7', + 'russian_tu' => 'windows-1251', + 'sakha' => 'UTF-8', + 'serbian_cyrillic' => 'windows-1251', + 'bulgarian' => 'windows-1251', + 'chinese_traditional_taiwan' => 'big5', + 'chinese_traditional' => 'big5', + 'arabic' => 'windows-1256', + 'hebrew' => 'WINDOWS-1255', + 'thai' => 'windows-874', + //'chinese_traditional_taiwan' => 'utf-8' // custom modified, we may have to do an include :-( + );*/ + + if (empty($lang_enc_array)) + { + $lang_enc_array = array(); + } + + $get_lang = trim(get_config_value('default_lang')); + + // Do we need the users language encoding? + if ($grab_user_lang && !empty($convert_row)) + { + if (!empty($convert_row['user_lang'])) + { + $get_lang = trim($convert_row['user_lang']); + } + else if (!empty($convert_row['poster_id'])) + { + global $src_db, $same_db; + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'binary'"); + } + + $sql = 'SELECT user_lang + FROM ' . $convert->src_table_prefix . 'users + WHERE user_id = ' . (int) $convert_row['poster_id']; + $result = $src_db->sql_query($sql); + $get_lang = (string) $src_db->sql_fetchfield('user_lang'); + $src_db->sql_freeresult($result); + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'utf8'"); + } + + $get_lang = (!trim($get_lang)) ? trim(get_config_value('default_lang')) : trim($get_lang); + } + } + + if (!isset($lang_enc_array[$get_lang])) + { + $filename = $convert->options['forum_path'] . '/language/lang_' . $get_lang . '/lang_main.' . $phpEx; + + if (!file_exists($filename)) + { + $get_lang = trim(get_config_value('default_lang')); + } + + if (!isset($lang_enc_array[$get_lang])) + { + include($convert->options['forum_path'] . '/language/lang_' . $get_lang . '/lang_main.' . $phpEx); + $lang_enc_array[$get_lang] = $lang['ENCODING']; + unset($lang); + } + } + + $encoding = $lang_enc_array[$get_lang]; + + return utf8_recode($text, $lang_enc_array[$get_lang]); +} + +/** +* Same as phpbb_set_encoding, but forcing boards default language +*/ +function phpbb_set_default_encoding($text) +{ + return phpbb_set_encoding($text, false); +} + +/** +* Convert Birthday from Birthday MOD to phpBB Format +*/ +function phpbb_get_birthday($birthday = '') +{ + if (defined('MOD_BIRTHDAY_TERRA')) + { + $birthday = (string) $birthday; + + // stored as month, day, year + if (!$birthday) + { + return ' 0- 0- 0'; + } + + // We use the original mod code to retrieve the birthday (not ideal) + preg_match('/(..)(..)(....)/', sprintf('%08d', $birthday), $birthday_parts); + + $month = $birthday_parts[1]; + $day = $birthday_parts[2]; + $year = $birthday_parts[3]; + + return sprintf('%2d-%2d-%4d', $day, $month, $year); + } + else + { + $birthday = (int) $birthday; + + if (!$birthday || $birthday == 999999) + { + return ' 0- 0- 0'; + } + + // The birthday mod from niels is using this code to transform to day/month/year + return sprintf('%2d-%2d-%4d', gmdate('j', $birthday * 86400 + 1), gmdate('n', $birthday * 86400 + 1), gmdate('Y', $birthday * 86400 + 1)); + } +} + +/** +* Return correct user id value +* Everyone's id will be one higher to allow the guest/anonymous user to have a positive id as well +*/ +function phpbb_user_id($user_id) +{ + global $config; + + // Increment user id if the old forum is having a user with the id 1 + if (!isset($config['increment_user_id'])) + { + global $src_db, $same_db, $convert; + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'binary'"); + } + + // Now let us set a temporary config variable for user id incrementing + $sql = "SELECT user_id + FROM {$convert->src_table_prefix}users + WHERE user_id = 1"; + $result = $src_db->sql_query($sql); + $id = (int) $src_db->sql_fetchfield('user_id'); + $src_db->sql_freeresult($result); + + // Try to get the maximum user id possible... + $sql = "SELECT MAX(user_id) AS max_user_id + FROM {$convert->src_table_prefix}users"; + $result = $src_db->sql_query($sql); + $max_id = (int) $src_db->sql_fetchfield('max_user_id'); + $src_db->sql_freeresult($result); + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'utf8'"); + } + + // 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['increment_user_id'] = $max_id + 1; + } + else + { + set_config('increment_user_id', 0, true); + $config['increment_user_id'] = 0; + } + } + + // If the old user id is -1 in 2.0.x it is the anonymous user... + if ($user_id == -1) + { + return ANONYMOUS; + } + + if (!empty($config['increment_user_id']) && $user_id == 1) + { + return $config['increment_user_id']; + } + + // A user id of 0 can happen, for example within the ban table if no user is banned... + // Within the posts and topics table this can be "dangerous" but is the fault of the user + // having mods installed (a poster id of 0 is not possible in 2.0.x). + // Therefore, we return the user id "as is". + + return (int) $user_id; +} + +/** +* Return correct user id value +* Everyone's id will be one higher to allow the guest/anonymous user to have a positive id as well +*/ +function phpbb_topic_replies_to_posts($num_replies) +{ + return (int) $num_replies + 1; +} + +/* Copy additional table fields from old forum to new forum if user wants this (for Mod compatibility for example) +function phpbb_copy_table_fields() +{ +} +*/ + +/** +* Convert authentication +* user, group and forum table has to be filled in order to work +*/ +function phpbb_convert_authentication($mode) +{ + global $db, $src_db, $same_db, $convert, $user, $config, $cache; + + if ($mode == 'start') + { + $db->sql_query($convert->truncate_statement . ACL_USERS_TABLE); + $db->sql_query($convert->truncate_statement . ACL_GROUPS_TABLE); + + // What we will do is handling all 2.0.x admins as founder to replicate what is common in 2.0.x. + // After conversion the main admin need to make sure he is removing permissions and the founder status if wanted. + + // Grab user ids of users with user_level of ADMIN + $sql = "SELECT user_id + FROM {$convert->src_table_prefix}users + WHERE user_level = 1 + ORDER BY user_regdate ASC"; + $result = $src_db->sql_query($sql); + + while ($row = $src_db->sql_fetchrow($result)) + { + $user_id = (int) phpbb_user_id($row['user_id']); + // Set founder admin... + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_type = ' . USER_FOUNDER . " + WHERE user_id = $user_id"; + $db->sql_query($sql); + } + $src_db->sql_freeresult($result); + + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = '" . $db->sql_escape('BOTS') . "'"; + $result = $db->sql_query($sql); + $bot_group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); + } + + // Grab forum auth information + $sql = "SELECT * + FROM {$convert->src_table_prefix}forums"; + $result = $src_db->sql_query($sql); + + $forum_access = array(); + while ($row = $src_db->sql_fetchrow($result)) + { + $forum_access[$row['forum_id']] = $row; + } + $src_db->sql_freeresult($result); + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'binary'"); + } + // Grab user auth information from 2.0.x board + $sql = "SELECT ug.user_id, aa.* + FROM {$convert->src_table_prefix}auth_access aa, {$convert->src_table_prefix}user_group ug, {$convert->src_table_prefix}groups g, {$convert->src_table_prefix}forums f + WHERE g.group_id = aa.group_id + AND g.group_single_user = 1 + AND ug.group_id = g.group_id + AND f.forum_id = aa.forum_id"; + $result = $src_db->sql_query($sql); + + $user_access = array(); + while ($row = $src_db->sql_fetchrow($result)) + { + $user_access[$row['forum_id']][] = $row; + } + $src_db->sql_freeresult($result); + + // Grab group auth information + $sql = "SELECT g.group_id, aa.* + FROM {$convert->src_table_prefix}auth_access aa, {$convert->src_table_prefix}groups g + WHERE g.group_id = aa.group_id + AND g.group_single_user <> 1"; + $result = $src_db->sql_query($sql); + + $group_access = array(); + while ($row = $src_db->sql_fetchrow($result)) + { + $group_access[$row['forum_id']][] = $row; + } + $src_db->sql_freeresult($result); + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'utf8'"); + } + + // Add Forum Access List + $auth_map = array( + 'auth_view' => array('f_', 'f_list'), + 'auth_read' => array('f_read', 'f_search'), + 'auth_post' => array('f_post', 'f_bbcode', 'f_smilies', 'f_img', 'f_sigs', 'f_postcount', 'f_report', 'f_subscribe', 'f_print', 'f_email'), + 'auth_reply' => 'f_reply', + 'auth_edit' => 'f_edit', + 'auth_delete' => 'f_delete', + 'auth_pollcreate' => 'f_poll', + 'auth_vote' => 'f_vote', + 'auth_announce' => 'f_announce', + 'auth_sticky' => 'f_sticky', + 'auth_attachments' => array('f_attach', 'f_download'), + 'auth_download' => 'f_download', + ); + + // Define the ACL constants used in 2.0 to make the code slightly more readable + define('AUTH_ALL', 0); + define('AUTH_REG', 1); + define('AUTH_ACL', 2); + define('AUTH_MOD', 3); + define('AUTH_ADMIN', 5); + + // A mapping of the simple permissions used by 2.0 + $simple_auth_ary = array( + 'public' => array( + 'auth_view' => AUTH_ALL, + 'auth_read' => AUTH_ALL, + 'auth_post' => AUTH_ALL, + 'auth_reply' => AUTH_ALL, + 'auth_edit' => AUTH_REG, + 'auth_delete' => AUTH_REG, + 'auth_sticky' => AUTH_MOD, + 'auth_announce' => AUTH_MOD, + 'auth_vote' => AUTH_REG, + 'auth_pollcreate' => AUTH_REG, + ), + 'registered' => array( + 'auth_view' => AUTH_ALL, + 'auth_read' => AUTH_ALL, + 'auth_post' => AUTH_REG, + 'auth_reply' => AUTH_REG, + 'auth_edit' => AUTH_REG, + 'auth_delete' => AUTH_REG, + 'auth_sticky' => AUTH_MOD, + 'auth_announce' => AUTH_MOD, + 'auth_vote' => AUTH_REG, + 'auth_pollcreate' => AUTH_REG, + ), + 'registered_hidden' => array( + 'auth_view' => AUTH_REG, + 'auth_read' => AUTH_REG, + 'auth_post' => AUTH_REG, + 'auth_reply' => AUTH_REG, + 'auth_edit' => AUTH_REG, + 'auth_delete' => AUTH_REG, + 'auth_sticky' => AUTH_MOD, + 'auth_announce' => AUTH_MOD, + 'auth_vote' => AUTH_REG, + 'auth_pollcreate' => AUTH_REG, + ), + 'private' => array( + 'auth_view' => AUTH_ALL, + 'auth_read' => AUTH_ACL, + 'auth_post' => AUTH_ACL, + 'auth_reply' => AUTH_ACL, + 'auth_edit' => AUTH_ACL, + 'auth_delete' => AUTH_ACL, + 'auth_sticky' => AUTH_ACL, + 'auth_announce' => AUTH_MOD, + 'auth_vote' => AUTH_ACL, + 'auth_pollcreate' => AUTH_ACL, + ), + 'private_hidden' => array( + 'auth_view' => AUTH_ACL, + 'auth_read' => AUTH_ACL, + 'auth_post' => AUTH_ACL, + 'auth_reply' => AUTH_ACL, + 'auth_edit' => AUTH_ACL, + 'auth_delete' => AUTH_ACL, + 'auth_sticky' => AUTH_ACL, + 'auth_announce' => AUTH_MOD, + 'auth_vote' => AUTH_ACL, + 'auth_pollcreate' => AUTH_ACL, + ), + 'moderator' => array( + 'auth_view' => AUTH_ALL, + 'auth_read' => AUTH_MOD, + 'auth_post' => AUTH_MOD, + 'auth_reply' => AUTH_MOD, + 'auth_edit' => AUTH_MOD, + 'auth_delete' => AUTH_MOD, + 'auth_sticky' => AUTH_MOD, + 'auth_announce' => AUTH_MOD, + 'auth_vote' => AUTH_MOD, + 'auth_pollcreate' => AUTH_MOD, + ), + 'moderator_hidden' => array( + 'auth_view' => AUTH_MOD, + 'auth_read' => AUTH_MOD, + 'auth_post' => AUTH_MOD, + 'auth_reply' => AUTH_MOD, + 'auth_edit' => AUTH_MOD, + 'auth_delete' => AUTH_MOD, + 'auth_sticky' => AUTH_MOD, + 'auth_announce' => AUTH_MOD, + 'auth_vote' => AUTH_MOD, + 'auth_pollcreate' => AUTH_MOD, + ), + ); + + if ($mode == 'start') + { + user_group_auth('guests', 'SELECT user_id, {GUESTS} FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS, false); + user_group_auth('registered', 'SELECT user_id, {REGISTERED} FROM ' . USERS_TABLE . ' WHERE user_id <> ' . ANONYMOUS . " AND group_id <> $bot_group_id", false); + + // Selecting from old table + if (!empty($config['increment_user_id'])) + { + $auth_sql = 'SELECT user_id, {ADMINISTRATORS} FROM ' . $convert->src_table_prefix . 'users WHERE user_level = 1 AND user_id <> 1'; + user_group_auth('administrators', $auth_sql, true); + + $auth_sql = 'SELECT ' . $config['increment_user_id'] . ' as user_id, {ADMINISTRATORS} FROM ' . $convert->src_table_prefix . 'users WHERE user_level = 1 AND user_id = 1'; + user_group_auth('administrators', $auth_sql, true); + } + else + { + $auth_sql = 'SELECT user_id, {ADMINISTRATORS} FROM ' . $convert->src_table_prefix . 'users WHERE user_level = 1'; + user_group_auth('administrators', $auth_sql, true); + } + + if (!empty($config['increment_user_id'])) + { + $auth_sql = 'SELECT user_id, {GLOBAL_MODERATORS} FROM ' . $convert->src_table_prefix . 'users WHERE user_level = 1 AND user_id <> 1'; + user_group_auth('global_moderators', $auth_sql, true); + + $auth_sql = 'SELECT ' . $config['increment_user_id'] . ' as user_id, {GLOBAL_MODERATORS} FROM ' . $convert->src_table_prefix . 'users WHERE user_level = 1 AND user_id = 1'; + user_group_auth('global_moderators', $auth_sql, true); + } + else + { + $auth_sql = 'SELECT user_id, {GLOBAL_MODERATORS} FROM ' . $convert->src_table_prefix . 'users WHERE user_level = 1'; + user_group_auth('global_moderators', $auth_sql, true); + } + } + else if ($mode == 'first') + { + // Go through all 2.0.x forums + foreach ($forum_access as $forum) + { + $new_forum_id = (int) $forum['forum_id']; + + // Administrators have full access to all forums whatever happens + mass_auth('group_role', $new_forum_id, 'administrators', 'FORUM_FULL'); + + $matched_type = ''; + foreach ($simple_auth_ary as $key => $auth_levels) + { + $matched = 1; + foreach ($auth_levels as $k => $level) + { + if ($forum[$k] != $auth_levels[$k]) + { + $matched = 0; + } + } + + if ($matched) + { + $matched_type = $key; + break; + } + } + + switch ($matched_type) + { + case 'public': + mass_auth('group_role', $new_forum_id, 'guests', 'FORUM_LIMITED'); + mass_auth('group_role', $new_forum_id, 'registered', 'FORUM_LIMITED_POLLS'); + mass_auth('group_role', $new_forum_id, 'bots', 'FORUM_BOT'); + break; + + case 'registered': + mass_auth('group_role', $new_forum_id, 'guests', 'FORUM_READONLY'); + mass_auth('group_role', $new_forum_id, 'bots', 'FORUM_BOT'); + + // no break; + + case 'registered_hidden': + mass_auth('group_role', $new_forum_id, 'registered', 'FORUM_POLLS'); + break; + + case 'private': + case 'private_hidden': + case 'moderator': + case 'moderator_hidden': + default: + // The permissions don't match a simple set, so we're going to have to map them directly + + // No post approval for all, in 2.0.x this feature does not exist + mass_auth('group', $new_forum_id, 'guests', 'f_noapprove', ACL_YES); + mass_auth('group', $new_forum_id, 'registered', 'f_noapprove', ACL_YES); + + // Go through authentication map + foreach ($auth_map as $old_auth_key => $new_acl) + { + // If old authentication key does not exist we continue + // This is helpful for mods adding additional authentication fields, we need to add them to the auth_map array + if (!isset($forum[$old_auth_key])) + { + continue; + } + + // Now set the new ACL correctly + switch ($forum[$old_auth_key]) + { + // AUTH_ALL + case AUTH_ALL: + mass_auth('group', $new_forum_id, 'guests', $new_acl, ACL_YES); + mass_auth('group', $new_forum_id, 'bots', $new_acl, ACL_YES); + mass_auth('group', $new_forum_id, 'registered', $new_acl, ACL_YES); + break; + + // AUTH_REG + case AUTH_REG: + mass_auth('group', $new_forum_id, 'registered', $new_acl, ACL_YES); + break; + + // AUTH_ACL + case AUTH_ACL: + // Go through the old group access list for this forum + if (isset($group_access[$forum['forum_id']])) + { + foreach ($group_access[$forum['forum_id']] as $index => $access) + { + // We only check for ACL_YES equivalence entry + if (isset($access[$old_auth_key]) && $access[$old_auth_key] == 1) + { + mass_auth('group', $new_forum_id, (int) $access['group_id'], $new_acl, ACL_YES); + } + } + } + + if (isset($user_access[$forum['forum_id']])) + { + foreach ($user_access[$forum['forum_id']] as $index => $access) + { + // We only check for ACL_YES equivalence entry + if (isset($access[$old_auth_key]) && $access[$old_auth_key] == 1) + { + mass_auth('user', $new_forum_id, (int) phpbb_user_id($access['user_id']), $new_acl, ACL_YES); + } + } + } + break; + + // AUTH_MOD + case AUTH_MOD: + if (isset($group_access[$forum['forum_id']])) + { + foreach ($group_access[$forum['forum_id']] as $index => $access) + { + // We only check for ACL_YES equivalence entry + if (isset($access[$old_auth_key]) && $access[$old_auth_key] == 1) + { + mass_auth('group', $new_forum_id, (int) $access['group_id'], $new_acl, ACL_YES); + } + } + } + + if (isset($user_access[$forum['forum_id']])) + { + foreach ($user_access[$forum['forum_id']] as $index => $access) + { + // We only check for ACL_YES equivalence entry + if (isset($access[$old_auth_key]) && $access[$old_auth_key] == 1) + { + mass_auth('user', $new_forum_id, (int) phpbb_user_id($access['user_id']), $new_acl, ACL_YES); + } + } + } + break; + } + } + break; + } + } + } + else if ($mode == 'second') + { + // Assign permission roles and other default permissions + + // guests having u_download and u_search ability + $db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) SELECT ' . get_group_id('guests') . ', 0, auth_option_id, 0, 1 FROM ' . ACL_OPTIONS_TABLE . " WHERE auth_option IN ('u_', 'u_download', 'u_search')"); + + // administrators/global mods having full user features + mass_auth('group_role', 0, 'administrators', 'USER_FULL'); + mass_auth('group_role', 0, 'global_moderators', 'USER_FULL'); + + // By default all converted administrators are given full access + mass_auth('group_role', 0, 'administrators', 'ADMIN_FULL'); + + // All registered users are assigned the standard user role + mass_auth('group_role', 0, 'registered', 'USER_STANDARD'); + mass_auth('group_role', 0, 'registered_coppa', 'USER_STANDARD'); + + // Instead of administrators being global moderators we give the MOD_FULL role to global mods (admins already assigned to this group) + mass_auth('group_role', 0, 'global_moderators', 'MOD_FULL'); + + // And now those who have had their avatar rights removed get assigned a more restrictive role + $sql = 'SELECT user_id FROM ' . $convert->src_table_prefix . 'users + WHERE user_allowavatar = 0 + AND user_id > 0'; + $result = $src_db->sql_query($sql); + + while ($row = $src_db->sql_fetchrow($result)) + { + mass_auth('user_role', 0, (int) phpbb_user_id($row['user_id']), 'USER_NOAVATAR'); + } + $src_db->sql_freeresult($result); + + // And the same for those who have had their PM rights removed + $sql = 'SELECT user_id FROM ' . $convert->src_table_prefix . 'users + WHERE user_allow_pm = 0 + AND user_id > 0'; + $result = $src_db->sql_query($sql); + + while ($row = $src_db->sql_fetchrow($result)) + { + mass_auth('user_role', 0, (int) phpbb_user_id($row['user_id']), 'USER_NOPM'); + } + $src_db->sql_freeresult($result); + } + else if ($mode == 'third') + { + // And now the moderators + // 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_sticky' => 'f_sticky' + ); + + foreach ($user_access as $forum_id => $access_map) + { + $forum_id = (int) $forum_id; + + foreach ($access_map as $access) + { + if (isset($access['auth_mod']) && $access['auth_mod'] == 1) + { + mass_auth('user_role', $forum_id, (int) phpbb_user_id($access['user_id']), 'MOD_STANDARD'); + mass_auth('user_role', $forum_id, (int) phpbb_user_id($access['user_id']), 'FORUM_STANDARD'); + foreach ($mod_post_map as $old => $new) + { + if (isset($forum_access[$forum_id]) && isset($forum_access[$forum_id][$old]) && $forum_access[$forum_id][$old] == AUTH_MOD) + { + mass_auth('user', $forum_id, (int) phpbb_user_id($access['user_id']), $new, ACL_YES); + } + } + } + } + } + + foreach ($group_access as $forum_id => $access_map) + { + $forum_id = (int) $forum_id; + + foreach ($access_map as $access) + { + if (isset($access['auth_mod']) && $access['auth_mod'] == 1) + { + mass_auth('group_role', $forum_id, (int) $access['group_id'], 'MOD_STANDARD'); + mass_auth('group_role', $forum_id, (int) $access['group_id'], 'FORUM_STANDARD'); + foreach ($mod_post_map as $old => $new) + { + if (isset($forum_access[$forum_id]) && isset($forum_access[$forum_id][$old]) && $forum_access[$forum_id][$old] == AUTH_MOD) + { + mass_auth('group', $forum_id, (int) $access['group_id'], $new, ACL_YES); + } + } + } + } + } + + // We grant everyone readonly access to the categories to ensure that the forums are visible + $sql = 'SELECT forum_id, forum_name, parent_id, left_id, right_id + FROM ' . FORUMS_TABLE . ' + ORDER BY left_id ASC'; + $result = $db->sql_query($sql); + + $parent_forums = $forums = array(); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['parent_id'] == 0) + { + mass_auth('group_role', $row['forum_id'], 'administrators', 'FORUM_FULL'); + mass_auth('group_role', $row['forum_id'], 'global_moderators', 'FORUM_FULL'); + $parent_forums[] = $row; + } + else + { + $forums[] = $row; + } + } + $db->sql_freeresult($result); + + global $auth; + + // Let us see which groups have access to these forums... + foreach ($parent_forums as $row) + { + // Get the children + $branch = $forum_ids = array(); + + foreach ($forums as $key => $_row) + { + if ($_row['left_id'] > $row['left_id'] && $_row['left_id'] < $row['right_id']) + { + $branch[] = $_row; + $forum_ids[] = $_row['forum_id']; + continue; + } + } + + if (sizeof($forum_ids)) + { + // Now make sure the user is able to read these forums + $hold_ary = $auth->acl_group_raw_data(false, 'f_list', $forum_ids); + + if (empty($hold_ary)) + { + continue; + } + + foreach ($hold_ary as $g_id => $f_id_ary) + { + $set_group = false; + + foreach ($f_id_ary as $f_id => $auth_ary) + { + foreach ($auth_ary as $auth_option => $setting) + { + if ($setting == ACL_YES) + { + $set_group = true; + break 2; + } + } + } + + if ($set_group) + { + mass_auth('group', $row['forum_id'], $g_id, 'f_list', ACL_YES); + } + } + } + } + } +} + +/** +* Set primary group. +* Really simple and only based on user_level (remaining groups will be assigned later) +*/ +function phpbb_set_primary_group($user_level) +{ + global $convert_row; + + if ($user_level == 1) + { + return get_group_id('administrators'); + } +/* else if ($user_level == 2) + { + return get_group_id('global_moderators'); + } + else if ($user_level == 0 && $convert_row['user_active'])*/ + else if ($convert_row['user_active']) + { + return get_group_id('registered'); + } + + return 0; +} + +/** +* Convert the group name, making sure to avoid conflicts with 3.0 special groups +*/ +function phpbb_convert_group_name($group_name) +{ + $default_groups = array( + 'GUESTS', + 'REGISTERED', + 'REGISTERED_COPPA', + 'GLOBAL_MODERATORS', + 'ADMINISTRATORS', + 'BOTS', + ); + + if (in_array(strtoupper($group_name), $default_groups)) + { + return 'phpBB2 - ' . $group_name; + } + + return phpbb_set_default_encoding($group_name); +} + +/** +* Convert the group type constants +*/ +function phpbb_convert_group_type($group_type) +{ + switch ($group_type) + { + case 0: + return GROUP_OPEN; + break; + + case 1: + return GROUP_CLOSED; + break; + + case 2: + return GROUP_HIDDEN; + break; + } + + // Never return GROUP_SPECIAL here, because only phpBB3's default groups are allowed to have this type set. + return GROUP_HIDDEN; +} + +/** +* Convert the topic type constants +*/ +function phpbb_convert_topic_type($topic_type) +{ + switch ($topic_type) + { + case 0: + return POST_NORMAL; + break; + + case 1: + return POST_STICKY; + break; + + case 2: + return POST_ANNOUNCE; + break; + + case 3: + return POST_GLOBAL; + break; + } + + return POST_NORMAL; +} + +function phpbb_replace_size($matches) +{ + return '[size=' . min(200, ceil(100.0 * (((double) $matches[1])/12.0))) . ':' . $matches[2] . ']'; +} + +/** +* Reparse the message stripping out the bbcode_uid values and adding new ones and setting the bitfield +* @todo What do we want to do about HTML in messages - currently it gets converted to the entities, but there may be some objections to this +*/ +function phpbb_prepare_message($message) +{ + global $phpbb_root_path, $phpEx, $db, $convert, $user, $config, $cache, $convert_row, $message_parser; + + if (!$message) + { + $convert->row['mp_bbcode_bitfield'] = $convert_row['mp_bbcode_bitfield'] = 0; + return ''; + } + + // Decode phpBB 2.0.x Message + if (isset($convert->row['old_bbcode_uid']) && $convert->row['old_bbcode_uid'] != '') + { + // Adjust size... + if (strpos($message, '[size=') !== false) + { + $message = preg_replace_callback('/\[size=(\d*):(' . $convert->row['old_bbcode_uid'] . ')\]/', 'phpbb_replace_size', $message); + } + + $message = preg_replace('/\:(([a-z0-9]:)?)' . $convert->row['old_bbcode_uid'] . '/s', '', $message); + } + + if (strpos($message, '[quote=') !== false) + { + $message = preg_replace('/\[quote="(.*?)"\]/s', '[quote="\1"]', $message); + $message = preg_replace('/\[quote=\\\"(.*?)\\\"\]/s', '[quote="\1"]', $message); + + // let's hope that this solves more problems than it causes. Deal with escaped quotes. + $message = str_replace('\"', '"', $message); + $message = str_replace('\"', '"', $message); + } + + // Already the new user id ;) + $user_id = $convert->row['poster_id']; + + $message = str_replace('
', "\n", $message); + $message = str_replace('<', '<', $message); + $message = str_replace('>', '>', $message); + + // make the post UTF-8 + $message = phpbb_set_encoding($message); + + $message_parser->warn_msg = array(); // Reset the errors from the previous message + $message_parser->bbcode_uid = make_uid($convert->row['post_time']); + $message_parser->message = $message; + unset($message); + + // Make sure options are set. +// $enable_html = (!isset($row['enable_html'])) ? false : $row['enable_html']; + $enable_bbcode = (!isset($convert->row['enable_bbcode'])) ? true : $convert->row['enable_bbcode']; + $enable_smilies = (!isset($convert->row['enable_smilies'])) ? true : $convert->row['enable_smilies']; + $enable_magic_url = (!isset($convert->row['enable_magic_url'])) ? true : $convert->row['enable_magic_url']; + + // 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') + $message_parser->parse($enable_bbcode, $enable_magic_url, $enable_smilies); + + if (sizeof($message_parser->warn_msg)) + { + $msg_id = isset($convert->row['post_id']) ? $convert->row['post_id'] : $convert->row['privmsgs_id']; + $convert->p_master->error('' . $user->lang['POST_ID'] . ': ' . $msg_id . ' ' . $user->lang['CONV_ERROR_MESSAGE_PARSER'] . ':

' . implode('
', $message_parser->warn_msg), __LINE__, __FILE__, true); + } + + $convert->row['mp_bbcode_bitfield'] = $convert_row['mp_bbcode_bitfield'] = $message_parser->bbcode_bitfield; + + $message = $message_parser->message; + unset($message_parser->message); + + return $message; +} + +/** +* Return the bitfield calculated by the previous function +*/ +function get_bbcode_bitfield() +{ + global $convert_row; + + return $convert_row['mp_bbcode_bitfield']; +} + +/** +* Determine the last user to edit a post +* In practice we only tracked edits by the original poster in 2.0.x so this will only be set if they had edited their own post +*/ +function phpbb_post_edit_user() +{ + global $convert_row, $config; + + if (isset($convert_row['post_edit_count'])) + { + return phpbb_user_id($convert_row['poster_id']); + } + + return 0; +} + +/** +* Obtain the path to uploaded files on the 2.0.x forum +* This is only used if the Attachment MOD was installed +*/ +function phpbb_get_files_dir() +{ + if (!defined('MOD_ATTACHMENT')) + { + return; + } + + global $src_db, $same_db, $convert, $user, $config, $cache; + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'binary'"); + } + $sql = 'SELECT config_value AS upload_dir + FROM ' . $convert->src_table_prefix . "attachments_config + WHERE config_name = 'upload_dir'"; + $result = $src_db->sql_query($sql); + $upload_path = $src_db->sql_fetchfield('upload_dir'); + $src_db->sql_freeresult($result); + + $sql = 'SELECT config_value AS ftp_upload + FROM ' . $convert->src_table_prefix . "attachments_config + WHERE config_name = 'allow_ftp_upload'"; + $result = $src_db->sql_query($sql); + $ftp_upload = (int) $src_db->sql_fetchfield('ftp_upload'); + $src_db->sql_freeresult($result); + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'utf8'"); + } + + if ($ftp_upload) + { + $convert->p_master->error($user->lang['CONV_ERROR_ATTACH_FTP_DIR'], __LINE__, __FILE__); + } + + return $upload_path; +} + +/** +* Copy thumbnails of uploaded images from the 2.0.x forum +* This is only used if the Attachment MOD was installed +*/ +function phpbb_copy_thumbnails() +{ + global $db, $convert, $user, $config, $cache, $phpbb_root_path; + + $src_path = $convert->options['forum_path'] . '/' . phpbb_get_files_dir() . '/thumbs/'; + + if ($handle = @opendir($src_path)) + { + while ($entry = readdir($handle)) + { + if ($entry[0] == '.') + { + continue; + } + + if (is_dir($src_path . $entry)) + { + continue; + } + else + { + copy_file($src_path . $entry, $config['upload_path'] . '/' . preg_replace('/^t_/', 'thumb_', $entry)); + @unlink($phpbb_root_path . $config['upload_path'] . '/thumbs/' . $entry); + } + } + closedir($handle); + } +} + +/** +* Convert the attachment category constants +* This is only used if the Attachment MOD was installed +*/ +function phpbb_attachment_category($cat_id) +{ + switch ($cat_id) + { + case 1: + return ATTACHMENT_CATEGORY_IMAGE; + break; + + case 2: + return ATTACHMENT_CATEGORY_WM; + break; + + case 3: + return ATTACHMENT_CATEGORY_FLASH; + break; + } + + return ATTACHMENT_CATEGORY_NONE; +} + +/** +* Convert the attachment extension names +* This is only used if the Attachment MOD was installed +*/ +function phpbb_attachment_extension_group_name() +{ + global $db, $phpbb_root_path, $phpEx; + + // Update file extension group names to use language strings. + $sql = 'SELECT lang_dir + FROM ' . LANG_TABLE; + $result = $db->sql_query($sql); + + $extension_groups_updated = array(); + while ($lang_dir = $db->sql_fetchfield('lang_dir')) + { + $lang_dir = basename($lang_dir); + $lang_file = $phpbb_root_path . 'language/' . $lang_dir . '/acp/attachments.' . $phpEx; + + if (!file_exists($lang_file)) + { + continue; + } + + $lang = array(); + include($lang_file); + + foreach ($lang as $lang_key => $lang_val) + { + if (isset($extension_groups_updated[$lang_key]) || strpos($lang_key, 'EXT_GROUP_') !== 0) + { + continue; + } + + $sql_ary = array( + 'group_name' => substr($lang_key, 10), // Strip off 'EXT_GROUP_' + ); + + $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE group_name = '" . $db->sql_escape($lang_val) . "'"; + $db->sql_query($sql); + + $extension_groups_updated[$lang_key] = true; + } + } + $db->sql_freeresult($result); +} + +/** +* Obtain list of forums in which different attachment categories can be used +*/ +function phpbb_attachment_forum_perms($forum_permissions) +{ + if (empty($forum_permissions)) + { + return ''; + } + + // Decode forum permissions + $forum_ids = array(); + + $one_char_encoding = '#'; + $two_char_encoding = '.'; + + $auth_len = 1; + for ($pos = 0; $pos < strlen($forum_permissions); $pos += $auth_len) + { + $forum_auth = substr($forum_permissions, $pos, 1); + if ($forum_auth == $one_char_encoding) + { + $auth_len = 1; + continue; + } + else if ($forum_auth == $two_char_encoding) + { + $auth_len = 2; + $pos--; + continue; + } + + $forum_auth = substr($forum_permissions, $pos, $auth_len); + $forum_id = base64_unpack($forum_auth); + + $forum_ids[] = (int) $forum_id; + } + + if (sizeof($forum_ids)) + { + return attachment_forum_perms($forum_ids); + } + + return ''; +} + +/** +* Convert the avatar type constants +*/ +function phpbb_avatar_type($type) +{ + switch ($type) + { + case 1: + return AVATAR_UPLOAD; + break; + + case 2: + return AVATAR_REMOTE; + break; + + case 3: + return AVATAR_GALLERY; + break; + } + + return 0; +} + + +/** +* Just undos the replacing of '<' and '>' +*/ +function phpbb_smilie_html_decode($code) +{ + $code = str_replace('<', '<', $code); + return str_replace('>', '>', $code); +} + +/** +* Transfer avatars, copying the image if it was uploaded +*/ +function phpbb_import_avatar($user_avatar) +{ + global $convert_row; + + if (!$convert_row['user_avatar_type']) + { + return ''; + } + else if ($convert_row['user_avatar_type'] == 1) + { + // Uploaded avatar + return import_avatar($user_avatar, false, $convert_row['user_id']); + } + else if ($convert_row['user_avatar_type'] == 2) + { + // Remote avatar + return $user_avatar; + } + else if ($convert_row['user_avatar_type'] == 3) + { + // Gallery avatar + return $user_avatar; + } + + return ''; +} + + +/** +* Find out about the avatar's dimensions +*/ +function phpbb_get_avatar_height($user_avatar) +{ + global $convert_row; + + if (empty($convert_row['user_avatar_type'])) + { + return 0; + } + return get_avatar_height($user_avatar, 'phpbb_avatar_type', $convert_row['user_avatar_type']); +} + + +/** +* Find out about the avatar's dimensions +*/ +function phpbb_get_avatar_width($user_avatar) +{ + global $convert_row; + + if (empty($convert_row['user_avatar_type'])) + { + return 0; + } + + return get_avatar_width($user_avatar, 'phpbb_avatar_type', $convert_row['user_avatar_type']); +} + + +/** +* Calculate the correct to_address field for private messages +*/ +function phpbb_privmsgs_to_userid($to_userid) +{ + global $config; + + return 'u_' . phpbb_user_id($to_userid); +} + +/** +* Calculate whether a private message was unread using the bitfield +*/ +function phpbb_unread_pm($pm_type) +{ + return ($pm_type == 5) ? 1 : 0; +} + +/** +* Calculate whether a private message was new using the bitfield +*/ +function phpbb_new_pm($pm_type) +{ + return ($pm_type == 1) ? 1 : 0; +} + +/** +* Obtain the folder_id for the custom folder created to replace the savebox from 2.0.x (used to store saved private messages) +*/ +function phpbb_get_savebox_id($user_id) +{ + global $db; + + $user_id = phpbb_user_id($user_id); + + // Only one custom folder, check only one + $sql = 'SELECT folder_id + FROM ' . PRIVMSGS_FOLDER_TABLE . ' + WHERE user_id = ' . $user_id; + $result = $db->sql_query_limit($sql, 1); + $folder_id = (int) $db->sql_fetchfield('folder_id'); + $db->sql_freeresult($result); + + return $folder_id; +} + +/** +* Transfer attachment specific configuration options +* These were not stored in the main config table on 2.0.x +* This is only used if the Attachment MOD was installed +*/ +function phpbb_import_attach_config() +{ + global $db, $src_db, $same_db, $convert, $config; + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'binary'"); + } + + $sql = 'SELECT * + FROM ' . $convert->src_table_prefix . 'attachments_config'; + $result = $src_db->sql_query($sql); + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'utf8'"); + } + + $attach_config = array(); + while ($row = $src_db->sql_fetchrow($result)) + { + $attach_config[$row['config_name']] = $row['config_value']; + } + $src_db->sql_freeresult($result); + + set_config('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']); +} + +/** +* Calculate the date a user became inactive +*/ +function phpbb_inactive_time() +{ + global $convert_row; + + if ($convert_row['user_active']) + { + return 0; + } + + if ($convert_row['user_lastvisit']) + { + return $convert_row['user_lastvisit']; + } + + return $convert_row['user_regdate']; +} + +/** +* Calculate the reason a user became inactive +* We can't actually tell the difference between a manual deactivation and one for profile changes +* from the data available to assume the latter +*/ +function phpbb_inactive_reason() +{ + global $convert_row; + + if ($convert_row['user_active']) + { + return 0; + } + + if ($convert_row['user_lastvisit']) + { + return INACTIVE_PROFILE; + } + + return INACTIVE_REGISTER; +} + +/** +* Adjust 2.0.x disallowed names to 3.0.x format +*/ +function phpbb_disallowed_username($username) +{ + // Replace * with % + $username = phpbb_set_default_encoding(str_replace('*', '%', $username)); + return utf8_htmlspecialchars($username); +} + +/** +* Checks whether there are any usernames on the old board that would map to the same +* username_clean on phpBB3. Prints out a list if any exist and exits. +*/ +function phpbb_create_userconv_table() +{ + global $db, $src_db, $convert, $table_prefix, $user, $lang; + + $map_dbms = ''; + switch ($db->get_sql_layer()) + { + case 'mysql': + $map_dbms = 'mysql_40'; + break; + + case 'mysql4': + if (version_compare($db->sql_server_info(true), '4.1.3', '>=')) + { + $map_dbms = 'mysql_41'; + } + else + { + $map_dbms = 'mysql_40'; + } + break; + + case 'mysqli': + $map_dbms = 'mysql_41'; + break; + + case 'mssql': + case 'mssql_odbc': + case 'mssqlnative': + $map_dbms = 'mssql'; + break; + + default: + $map_dbms = $db->get_sql_layer(); + break; + } + + // create a temporary table in which we store the clean usernames + $drop_sql = 'DROP TABLE ' . USERCONV_TABLE; + switch ($map_dbms) + { + case 'mssql': + $create_sql = 'CREATE TABLE [' . USERCONV_TABLE . '] ( + [user_id] [int] NOT NULL , + [username_clean] [varchar] (255) DEFAULT (\'\') NOT NULL + )'; + break; + + case 'mysql_40': + $create_sql = 'CREATE TABLE ' . USERCONV_TABLE . ' ( + user_id mediumint(8) NOT NULL, + username_clean blob NOT NULL + )'; + break; + + case 'mysql_41': + $create_sql = 'CREATE TABLE ' . USERCONV_TABLE . ' ( + user_id mediumint(8) NOT NULL, + username_clean varchar(255) DEFAULT \'\' NOT NULL + ) CHARACTER SET `utf8` COLLATE `utf8_bin`'; + break; + + case 'oracle': + $create_sql = 'CREATE TABLE ' . USERCONV_TABLE . ' ( + user_id number(8) NOT NULL, + username_clean varchar2(255) DEFAULT \'\' + )'; + break; + + case 'postgres': + $create_sql = 'CREATE TABLE ' . USERCONV_TABLE . ' ( + user_id INT4 DEFAULT \'0\', + username_clean varchar_ci DEFAULT \'\' NOT NULL + )'; + break; + + case 'sqlite': + case 'sqlite3': + $create_sql = 'CREATE TABLE ' . USERCONV_TABLE . ' ( + user_id INTEGER NOT NULL DEFAULT \'0\', + username_clean varchar(255) NOT NULL DEFAULT \'\' + )'; + break; + } + + $db->sql_return_on_error(true); + $db->sql_query($drop_sql); + $db->sql_return_on_error(false); + $db->sql_query($create_sql); +} + +function phpbb_check_username_collisions() +{ + global $db, $src_db, $convert, $table_prefix, $user, $lang; + + // now find the clean version of the usernames that collide + $sql = 'SELECT username_clean + FROM ' . USERCONV_TABLE .' + GROUP BY username_clean + HAVING COUNT(user_id) > 1'; + $result = $db->sql_query($sql); + + $colliding_names = array(); + while ($row = $db->sql_fetchrow($result)) + { + $colliding_names[] = $row['username_clean']; + } + $db->sql_freeresult($result); + + // there was at least one collision, the admin will have to solve it before conversion can continue + if (sizeof($colliding_names)) + { + $sql = 'SELECT user_id, username_clean + FROM ' . USERCONV_TABLE . ' + WHERE ' . $db->sql_in_set('username_clean', $colliding_names); + $result = $db->sql_query($sql); + unset($colliding_names); + + $colliding_user_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $colliding_user_ids[(int) $row['user_id']] = $row['username_clean']; + } + $db->sql_freeresult($result); + + $sql = 'SELECT username, user_id, user_posts + FROM ' . $convert->src_table_prefix . 'users + WHERE ' . $src_db->sql_in_set('user_id', array_keys($colliding_user_ids)); + $result = $src_db->sql_query($sql); + + $colliding_users = array(); + while ($row = $src_db->sql_fetchrow($result)) + { + $row['user_id'] = (int) $row['user_id']; + if (isset($colliding_user_ids[$row['user_id']])) + { + $colliding_users[$colliding_user_ids[$row['user_id']]][] = $row; + } + } + $src_db->sql_freeresult($result); + unset($colliding_user_ids); + + $list = ''; + foreach ($colliding_users as $username_clean => $users) + { + $list .= sprintf($user->lang['COLLIDING_CLEAN_USERNAME'], $username_clean) . "
\n"; + foreach ($users as $i => $row) + { + $list .= sprintf($user->lang['COLLIDING_USER'], $row['user_id'], phpbb_set_default_encoding($row['username']), $row['user_posts']) . "
\n"; + } + } + + $lang['INST_ERR_FATAL'] = $user->lang['CONV_ERR_FATAL']; + $convert->p_master->error('' . $user->lang['COLLIDING_USERNAMES_FOUND'] . '

' . $list . '', __LINE__, __FILE__); + } + + $drop_sql = 'DROP TABLE ' . USERCONV_TABLE; + $db->sql_query($drop_sql); +} + +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); + return $timezone_migration->convert_phpbb30_timezone($timezone, 0); +} + +function phpbb_add_notification_options($user_notify_pm) +{ + global $convert_row, $db; + + $user_id = phpbb_user_id($convert_row['user_id']); + if ($user_id == ANONYMOUS) + { + return; + } + + $rows = array(); + + $rows[] = array( + 'item_type' => 'post', + 'item_id' => 0, + 'user_id' => (int) $user_id, + 'notify' => 1, + 'method' => 'email', + ); + $rows[] = array( + 'item_type' => 'topic', + 'item_id' => 0, + 'user_id' => (int) $user_id, + 'notify' => 1, + 'method' => 'email', + ); + if ($user_notify_pm) + { + $rows[] = array( + 'item_type' => 'pm', + 'item_id' => 0, + 'user_id' => (int) $user_id, + 'notify' => 1, + 'method' => 'email', + ); + } + + $sql = $db->sql_multi_insert(USER_NOTIFICATIONS_TABLE, $rows); +} + +function phpbb_convert_password_hash($hash) +{ + global $phpbb_container; + + $manager = $phpbb_container->get('passwords.manager'); + $hash = $manager->hash($hash, '$H$'); + + return '$CP$' . $hash; +} diff --git a/sources/phpBB/install/database_update.php b/sources/phpBB/install/database_update.php new file mode 100644 index 0000000..80fd40a --- /dev/null +++ b/sources/phpBB/install/database_update.php @@ -0,0 +1,252 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +$update_start_time = time(); + +/** +* @ignore +*/ +define('IN_PHPBB', true); +define('IN_INSTALL', true); +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); + +function phpbb_end_update($cache, $config) +{ + $cache->purge(); + + $config->increment('assets_version', 1); + +?> +

+ + + + + + + + + + + + +register(); + +$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx); +extract($phpbb_config_php_file->get_all()); + +if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type)) +{ + die("Please read: INSTALL.html before attempting to update."); +} + +// 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); + +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(); + +// set up caching +$cache = $phpbb_container->get('cache'); + +// 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'); +$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 + +// 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); + +if (!isset($config['version_update_from'])) +{ + $config->set('version_update_from', $config['version']); +} + +$orig_version = $config['version_update_from']; + +$user->add_lang(array('common', 'acp/common', 'install', 'migrator')); + +// Add own hook handler, if present. :o +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'))); + + $phpbb_hook_finder = $phpbb_container->get('hook_finder'); + foreach ($phpbb_hook_finder->find() as $hook) + { + @include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx); + } +} +else +{ + $phpbb_hook = false; +} + +header('Content-type: text/html; charset=UTF-8'); +?> + + + + + +<?php echo $user->lang['UPDATING_TO_LATEST_STABLE']; ?> + + + + + + +
+ + +
+
+
+ +
+
+ +

lang['UPDATING_TO_LATEST_STABLE']; ?>

+ +
+ +

lang['DATABASE_TYPE']; ?> :: get_sql_layer(); ?>
+ lang['PREVIOUS_VERSION']; ?> ::
+ +get('migrator'); +$migrator->set_output_handler(new \phpbb\db\log_wrapper_migrator_output_handler($user, new \phpbb\db\html_migrator_output_handler($user), $phpbb_root_path . 'store/migrations_' . time() . '.log')); + +$migrator->create_migrations_table(); + +$phpbb_extension_manager = $phpbb_container->get('ext.manager'); + +$migrations = $phpbb_extension_manager + ->get_finder() + ->core_path('phpbb/db/migration/data/') + ->extension_directory('/migrations') + ->get_classes(); + +$migrator->set_migrations($migrations); + +// What is a safe limit of execution time? Half the max execution time should be safe. +// No more than 15 seconds so the user isn't sitting and waiting for a very long time +$phpbb_ini = new \phpbb\php\ini(); +$safe_time_limit = min(15, ($phpbb_ini->get_int('max_execution_time') / 2)); + +// While we're going to try limit this to half the max execution time, +// we want to try and take additional measures to prevent hitting the +// max execution time (if, say, one migration step takes much longer +// than the max execution time) +@set_time_limit(0); + +while (!$migrator->finished()) +{ + try + { + $migrator->update(); + } + catch (\phpbb\db\migration\exception $e) + { + echo $e->getLocalisedMessage($user); + + phpbb_end_update($cache, $config); + } + + $state = array_merge(array( + 'migration_schema_done' => false, + 'migration_data_done' => false, + ), + $migrator->last_run_migration['state'] + ); + + // Are we approaching the time limit? If so we want to pause the update and continue after refreshing + if ((time() - $update_start_time) >= $safe_time_limit) + { + echo '
' . $user->lang['DATABASE_UPDATE_NOT_COMPLETED'] . '

'; + echo '' . $user->lang['DATABASE_UPDATE_CONTINUE'] . ''; + + phpbb_end_update($cache, $config); + } +} + +if ($orig_version != $config['version']) +{ + add_log('admin', 'LOG_UPDATE_DATABASE', $orig_version, $config['version']); +} + +echo $user->lang['DATABASE_UPDATE_COMPLETE'] . '
'; + +if ($request->variable('type', 0)) +{ + echo $user->lang['INLINE_UPDATE_SUCCESSFUL'] . '

'; + echo '' . $user->lang['CONTINUE_UPDATE_NOW'] . ''; +} +else +{ + echo '

' . $user->lang['UPDATE_FILES_NOTICE'] . '
'; + echo $user->lang['COMPLETE_LOGIN_TO_BOARD']; +} + +$config->delete('version_update_from'); + +phpbb_end_update($cache, $config); diff --git a/sources/phpBB/install/index.php b/sources/phpBB/install/index.php new file mode 100644 index 0000000..5c16421 --- /dev/null +++ b/sources/phpBB/install/index.php @@ -0,0 +1,833 @@ + +* @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); +/**#@-*/ + +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); + +if (version_compare(PHP_VERSION, '5.3.3') < 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'); +} + +function phpbb_require_updated($path, $optional = false) +{ + global $phpbb_root_path, $table_prefix; + + $new_path = $phpbb_root_path . 'install/update/new/' . $path; + $old_path = $phpbb_root_path . $path; + + if (file_exists($new_path)) + { + require($new_path); + } + else if (!$optional || file_exists($old_path)) + { + require($old_path); + } +} + +function phpbb_include_updated($path, $optional = false) +{ + global $phpbb_root_path; + + $new_path = $phpbb_root_path . 'install/update/new/' . $path; + $old_path = $phpbb_root_path . $path; + + if (file_exists($new_path)) + { + include($new_path); + } + else if (!$optional || file_exists($old_path)) + { + include($old_path); + } +} + +phpbb_require_updated('includes/startup.' . $phpEx); + +// Try to override some limits - maybe it helps some... +@set_time_limit(0); +$mem_limit = @ini_get('memory_limit'); +if (!empty($mem_limit)) +{ + $unit = strtolower(substr($mem_limit, -1, 1)); + $mem_limit = (int) $mem_limit; + + if ($unit == 'k') + { + $mem_limit = floor($mem_limit / 1024); + } + else if ($unit == 'g') + { + $mem_limit *= 1024; + } + else if (is_numeric($unit)) + { + $mem_limit = floor((int) ($mem_limit . $unit) / 1048576); + } + $mem_limit = max(128, $mem_limit) . 'M'; +} +else +{ + $mem_limit = '128M'; +} +@ini_set('memory_limit', $mem_limit); + +// 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 essential scripts +phpbb_require_updated('phpbb/class_loader.' . $phpEx); + +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); + +// Setup class loader first +$phpbb_class_loader_new = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}install/update/new/phpbb/", $phpEx); +$phpbb_class_loader_new->register(); +$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx); +$phpbb_class_loader->register(); +$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx); +$phpbb_class_loader_ext->register(); + +// Set up container +$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx); +$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx); +$phpbb_container_builder->set_use_extensions(false); +$phpbb_container_builder->set_dump_container(false); +$phpbb_container_builder->set_use_custom_pass(false); +$phpbb_container_builder->set_inject_config(false); +$phpbb_container_builder->set_compile_container(false); + +$other_config_path = $phpbb_root_path . 'install/update/new/config/'; +$config_path = file_exists($other_config_path . 'services.yml') ? $other_config_path : $phpbb_root_path . 'config/'; +$phpbb_container_builder->set_config_path($config_path); + +$phpbb_container_builder->set_custom_parameters(array( + 'core.root_path' => $phpbb_root_path, + 'core.adm_relative_path' => $phpbb_adm_relative_path, + 'core.php_ext' => $phpEx, + 'core.table_prefix' => '', + 'cache.driver.class' => 'phpbb\cache\driver\file', +)); + +$phpbb_container = $phpbb_container_builder->get_container(); +$phpbb_container->register('dbal.conn.driver')->setSynthetic(true); +$phpbb_container->compile(); + +$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver')); +$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver')); + +$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 + +// Try and load an appropriate language if required +$language = basename($request->variable('language', '')); + +if ($request->header('Accept-Language') && !$language) +{ + $accept_lang_ary = explode(',', strtolower($request->header('Accept-Language'))); + foreach ($accept_lang_ary as $accept_lang) + { + // Set correct format ... guess full xx_yy form + $accept_lang = substr($accept_lang, 0, 2) . '_' . substr($accept_lang, 3, 2); + + if (file_exists($phpbb_root_path . 'language/' . $accept_lang) && is_dir($phpbb_root_path . 'language/' . $accept_lang)) + { + $language = $accept_lang; + break; + } + else + { + // No match on xx_yy so try xx + $accept_lang = substr($accept_lang, 0, 2); + if (file_exists($phpbb_root_path . 'language/' . $accept_lang) && is_dir($phpbb_root_path . 'language/' . $accept_lang)) + { + $language = $accept_lang; + break; + } + } + } +} + +// No appropriate language found ... so let's use the first one in the language +// dir, this may or may not be English +if (!$language) +{ + $dir = @opendir($phpbb_root_path . 'language'); + + if (!$dir) + { + die('Unable to access the language directory'); + exit; + } + + while (($file = readdir($dir)) !== false) + { + $path = $phpbb_root_path . 'language/' . $file; + + if (!is_file($path) && !is_link($path) && file_exists($path . '/iso.txt')) + { + $language = $file; + break; + } + } + closedir($dir); +} + +if (!file_exists($phpbb_root_path . 'language/' . $language) || !is_dir($phpbb_root_path . 'language/' . $language)) +{ + die('No language found!'); +} + +// And finally, load the relevant language files +$load_lang_files = array('common', 'acp/common', 'acp/board', 'install', 'posting'); +$new_path = $phpbb_root_path . 'install/update/new/language/' . $language . '/'; +$old_path = $phpbb_root_path . 'language/' . $language . '/'; + +// NOTE: we can not use "phpbb_include_updated" as the files uses vars which would be required +// to be global while loading. +foreach ($load_lang_files as $lang_file) +{ + if (file_exists($new_path . $lang_file . '.' . $phpEx)) + { + include($new_path . $lang_file . '.' . $phpEx); + } + else + { + include($old_path . $lang_file . '.' . $phpEx); + } +} + +// usually we would need every single constant here - and it would be consistent. For 3.0.x, use a dirty hack... :( + +// Define needed constants +define('CHMOD_ALL', 7); +define('CHMOD_READ', 4); +define('CHMOD_WRITE', 2); +define('CHMOD_EXECUTE', 1); + +$mode = $request->variable('mode', 'overview'); +$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'); +$auth = new \phpbb\auth\auth(); + +// Add own hook handler, if present. :o +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'))); + + $phpbb_hook_finder = $phpbb_container->get('hook_finder'); + foreach ($phpbb_hook_finder->find() as $hook) + { + @include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx); + } +} +else +{ + $phpbb_hook = false; +} + +// Set some standard variables we want to force +$config = new \phpbb\config\config(array( + 'load_tplcompile' => '1' +)); + +$symfony_request = $phpbb_container->get('symfony_request'); +$phpbb_filesystem = $phpbb_container->get('filesystem'); +$phpbb_path_helper = $phpbb_container->get('path_helper'); +$template = new \phpbb\template\twig\twig($phpbb_path_helper, $config, $user, new \phpbb\template\context()); +$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( + array( + 'name' => 'adm', + 'ext_path' => 'adm/style/', + ), +), $paths); + +$path = array_shift($paths); + +$template->assign_var('T_ASSETS_PATH', $path . '/../../assets'); +$template->assign_var('T_TEMPLATE_PATH', $path); + +$install = new module(); + +$install->create('install', "index.$phpEx", $mode, $sub); +$install->load(); + +// Generate the page +$install->page_header(); +$install->generate_navigation(); + +$template->set_filenames(array( + 'body' => $install->get_tpl_name()) +); + +$install->page_footer(); + +class module +{ + var $id = 0; + var $type = 'install'; + var $module_ary = array(); + var $filename; + var $module_url = ''; + var $tpl_name = ''; + var $mode; + var $sub; + + /** + * Private methods, should not be overwritten + */ + function create($module_type, $module_url, $selected_mod = false, $selected_submod = false) + { + global $db, $config, $phpEx, $phpbb_root_path; + + $module = array(); + + // Grab module information using Bart's "neat-o-module" system (tm) + $dir = @opendir('.'); + + if (!$dir) + { + $this->error('Unable to access the installation directory', __LINE__, __FILE__); + } + + $setmodules = 1; + while (($file = readdir($dir)) !== false) + { + if (preg_match('#^install_(.*?)\.' . $phpEx . '$#', $file)) + { + include($file); + } + } + closedir($dir); + + unset($setmodules); + + if (!sizeof($module)) + { + $this->error('No installation modules found', __LINE__, __FILE__); + } + + // Order to use and count further if modules get assigned to the same position or not having an order + $max_module_order = 1000; + + foreach ($module as $row) + { + // Module order not specified or module already assigned at this position? + if (!isset($row['module_order']) || isset($this->module_ary[$row['module_order']])) + { + $row['module_order'] = $max_module_order; + $max_module_order++; + } + + $this->module_ary[$row['module_order']]['name'] = $row['module_title']; + $this->module_ary[$row['module_order']]['filename'] = $row['module_filename']; + $this->module_ary[$row['module_order']]['subs'] = $row['module_subs']; + $this->module_ary[$row['module_order']]['stages'] = $row['module_stages']; + + if (strtolower($selected_mod) == strtolower($row['module_title'])) + { + $this->id = (int) $row['module_order']; + $this->filename = (string) $row['module_filename']; + $this->module_url = (string) $module_url; + $this->mode = (string) $selected_mod; + // Check that the sub-mode specified is valid or set a default if not + if (is_array($row['module_subs'])) + { + $this->sub = strtolower((in_array(strtoupper($selected_submod), $row['module_subs'])) ? $selected_submod : $row['module_subs'][0]); + } + else if (is_array($row['module_stages'])) + { + $this->sub = strtolower((in_array(strtoupper($selected_submod), $row['module_stages'])) ? $selected_submod : $row['module_stages'][0]); + } + else + { + $this->sub = ''; + } + } + } // END foreach + } // END create + + /** + * Load and run the relevant module if applicable + */ + function load($mode = false, $run = true) + { + global $phpbb_root_path, $phpEx; + + if ($run) + { + if (!empty($mode)) + { + $this->mode = $mode; + } + + $module = $this->filename; + if (!class_exists($module)) + { + $this->error('Module "' . htmlspecialchars($module) . '" not accessible.', __LINE__, __FILE__); + } + $this->module = new $module($this); + + if (method_exists($this->module, 'main')) + { + $this->module->main($this->mode, $this->sub); + } + } + } + + /** + * Output the standard page header + */ + function page_header() + { + if (defined('HEADER_INC')) + { + return; + } + + define('HEADER_INC', true); + global $template, $lang, $stage, $phpbb_admin_path, $path; + + $template->assign_vars(array( + 'L_CHANGE' => $lang['CHANGE'], + 'L_COLON' => $lang['COLON'], + 'L_INSTALL_PANEL' => $lang['INSTALL_PANEL'], + 'L_SELECT_LANG' => $lang['SELECT_LANG'], + 'L_SKIP' => $lang['SKIP'], + 'PAGE_TITLE' => $this->get_page_title(), + 'T_IMAGE_PATH' => htmlspecialchars($phpbb_admin_path) . 'images/', + 'T_JQUERY_LINK' => $path . '/../../assets/javascript/jquery.min.js', + + 'S_CONTENT_DIRECTION' => $lang['DIRECTION'], + 'S_CONTENT_FLOW_BEGIN' => ($lang['DIRECTION'] == 'ltr') ? 'left' : 'right', + 'S_CONTENT_FLOW_END' => ($lang['DIRECTION'] == 'ltr') ? 'right' : 'left', + 'S_CONTENT_ENCODING' => 'UTF-8', + + 'S_USER_LANG' => $lang['USER_LANG'], + ) + ); + + 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'); + + return; + } + + /** + * Output the standard page footer + */ + function page_footer() + { + global $db, $template; + + $template->display('body'); + + // Close our DB connection. + if (!empty($db) && is_object($db)) + { + $db->sql_close(); + } + + if (function_exists('exit_handler')) + { + exit_handler(); + } + } + + /** + * Returns desired template name + */ + function get_tpl_name() + { + return $this->module->tpl_name . '.html'; + } + + /** + * Returns the desired page title + */ + function get_page_title() + { + global $lang; + + if (!isset($this->module->page_title)) + { + return ''; + } + + return (isset($lang[$this->module->page_title])) ? $lang[$this->module->page_title] : $this->module->page_title; + } + + /** + * Generate an HTTP/1.1 header to redirect the user to another page + * This is used during the installation when we do not have a database available to call the normal redirect function + * @param string $page The page to redirect to relative to the installer root path + */ + function redirect($page) + { + global $request; + + // HTTP_HOST is having the correct browser url in most cases... + $server_name = strtolower(htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME')))); + $server_port = $request->server('SERVER_PORT', 0); + $secure = $request->is_secure() ? 1 : 0; + + $script_name = htmlspecialchars_decode($request->server('PHP_SELF')); + if (!$script_name) + { + $script_name = htmlspecialchars_decode($request->server('REQUEST_URI')); + } + + // Replace backslashes and doubled slashes (could happen on some proxy setups) + $script_name = str_replace(array('\\', '//'), '/', $script_name); + $script_path = trim(dirname($script_name)); + + $url = (($secure) ? 'https://' : 'http://') . $server_name; + + if ($server_port && (($secure && $server_port <> 443) || (!$secure && $server_port <> 80))) + { + // HTTP HOST can carry a port number... + if (strpos($server_name, ':') === false) + { + $url .= ':' . $server_port; + } + } + + $url .= $script_path . '/' . $page; + header('Location: ' . $url); + exit; + } + + /** + * Generate the navigation tabs + */ + function generate_navigation() + { + global $lang, $template, $phpEx, $language; + + if (is_array($this->module_ary)) + { + @ksort($this->module_ary); + foreach ($this->module_ary as $cat_ary) + { + $cat = $cat_ary['name']; + $l_cat = (!empty($lang['CAT_' . $cat])) ? $lang['CAT_' . $cat] : preg_replace('#_#', ' ', $cat); + $cat = strtolower($cat); + $url = $this->module_url . "?mode=$cat&language=$language"; + + if ($this->mode == $cat) + { + $template->assign_block_vars('t_block1', array( + 'L_TITLE' => $l_cat, + 'S_SELECTED' => true, + 'U_TITLE' => $url, + )); + + if (is_array($this->module_ary[$this->id]['subs'])) + { + $subs = $this->module_ary[$this->id]['subs']; + foreach ($subs as $option) + { + $l_option = (!empty($lang['SUB_' . $option])) ? $lang['SUB_' . $option] : preg_replace('#_#', ' ', $option); + $option = strtolower($option); + $url = $this->module_url . '?mode=' . $this->mode . "&sub=$option&language=$language"; + + $template->assign_block_vars('l_block1', array( + 'L_TITLE' => $l_option, + 'S_SELECTED' => ($this->sub == $option), + 'U_TITLE' => $url, + )); + } + } + + if (is_array($this->module_ary[$this->id]['stages'])) + { + $subs = $this->module_ary[$this->id]['stages']; + $matched = false; + foreach ($subs as $option) + { + $l_option = (!empty($lang['STAGE_' . $option])) ? $lang['STAGE_' . $option] : preg_replace('#_#', ' ', $option); + $option = strtolower($option); + $matched = ($this->sub == $option) ? true : $matched; + + $template->assign_block_vars('l_block2', array( + 'L_TITLE' => $l_option, + 'S_SELECTED' => ($this->sub == $option), + 'S_COMPLETE' => !$matched, + )); + } + } + } + else + { + $template->assign_block_vars('t_block1', array( + 'L_TITLE' => $l_cat, + 'S_SELECTED' => false, + 'U_TITLE' => $url, + )); + } + } + } + } + + /** + * Output an error message + * If skip is true, return and continue execution, else exit + */ + function error($error, $line, $file, $skip = false) + { + global $lang, $db, $template, $phpbb_admin_path; + + if ($skip) + { + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['INST_ERR'], + )); + + $template->assign_block_vars('checks', array( + 'TITLE' => basename($file) . ' [ ' . $line . ' ]', + 'RESULT' => '' . $error . '', + )); + + return; + } + + echo ''; + echo ''; + echo ''; + echo ''; + echo '' . $lang['INST_ERR_FATAL'] . ''; + echo ''; + echo ''; + echo ''; + echo '
'; + echo ' '; + echo '
'; + echo '
'; + echo '
'; + echo ' '; + echo '
'; + echo '

' . $lang['INST_ERR_FATAL'] . '

'; + echo '

' . $lang['INST_ERR_FATAL'] . "

\n"; + echo '

' . basename($file) . ' [ ' . $line . " ]

\n"; + echo '

' . $error . "

\n"; + echo '
'; + echo ' '; + echo '
'; + echo '
'; + echo '
'; + echo ' '; + echo '
'; + echo ''; + echo ''; + + if (!empty($db) && is_object($db)) + { + $db->sql_close(); + } + + exit_handler(); + } + + /** + * Output an error message for a database related problem + * If skip is true, return and continue execution, else exit + */ + function db_error($error, $sql, $line, $file, $skip = false) + { + global $lang, $db, $template; + + if ($skip) + { + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['INST_ERR_FATAL'], + )); + + $template->assign_block_vars('checks', array( + 'TITLE' => basename($file) . ' [ ' . $line . ' ]', + 'RESULT' => '' . $error . '
» SQL:' . $sql, + )); + + return; + } + + $template->set_filenames(array( + 'body' => 'install_error.html') + ); + $this->page_header(); + $this->generate_navigation(); + + $template->assign_vars(array( + 'MESSAGE_TITLE' => $lang['INST_ERR_FATAL_DB'], + 'MESSAGE_TEXT' => '

' . basename($file) . ' [ ' . $line . ' ]

SQL : ' . $sql . '

' . $error . '

', + )); + + // Rollback if in transaction + if ($db->get_transaction()) + { + $db->sql_transaction('rollback'); + } + + $this->page_footer(); + } + + /** + * Generate the relevant HTML for an input field and the associated label and explanatory text + */ + function input_field($name, $type, $value = '', $options = '') + { + global $lang; + $tpl_type = explode(':', $type); + $tpl = ''; + + switch ($tpl_type[0]) + { + case 'text': + case 'password': + // HTML5 text-like input types + case 'color': + case 'date': + case 'time': + case 'datetime': + case 'datetime-local': + case 'email': + case 'month': + case 'number': + case 'range': + case 'search': + case 'tel': + case 'url': + case 'week': + + $size = (int) $tpl_type[1]; + $maxlength = (int) $tpl_type[2]; + $autocomplete = (isset($options['autocomplete']) && $options['autocomplete'] == 'off') ? ' autocomplete="off"' : ''; + + $tpl = ''; + break; + + case 'textarea': + $rows = (int) $tpl_type[1]; + $cols = (int) $tpl_type[2]; + + $tpl = ''; + break; + + case 'radio': + $key_yes = ($value) ? ' checked="checked" id="' . $name . '"' : ''; + $key_no = (!$value) ? ' checked="checked" id="' . $name . '"' : ''; + + $tpl_type_cond = explode('_', $tpl_type[1]); + $type_no = ($tpl_type_cond[0] == 'disabled' || $tpl_type_cond[0] == 'enabled') ? false : true; + + $tpl_no = ''; + $tpl_yes = ''; + + $tpl = ($tpl_type_cond[0] == 'yes' || $tpl_type_cond[0] == 'enabled') ? $tpl_yes . '  ' . $tpl_no : $tpl_no . '  ' . $tpl_yes; + break; + + case 'select': + // @codingStandardsIgnoreStart + eval('$s_options = ' . str_replace('{VALUE}', $value, $options) . ';'); + // @codingStandardsIgnoreEnd + $tpl = ''; + break; + + case 'custom': + // @codingStandardsIgnoreStart + eval('$tpl = ' . str_replace('{VALUE}', $value, $options) . ';'); + // @codingStandardsIgnoreEnd + break; + + default: + break; + } + + return $tpl; + } + + /** + * Generate the drop down of available language packs + */ + function inst_language_select($default = '') + { + global $phpbb_root_path, $phpEx; + + $dir = @opendir($phpbb_root_path . 'language'); + + if (!$dir) + { + $this->error('Unable to access the language directory', __LINE__, __FILE__); + } + + while ($file = readdir($dir)) + { + $path = $phpbb_root_path . 'language/' . $file; + + if ($file == '.' || $file == '..' || is_link($path) || is_file($path) || $file == 'CVS') + { + continue; + } + + if (file_exists($path . '/iso.txt')) + { + list($displayname, $localname) = @file($path . '/iso.txt'); + $lang[$localname] = $file; + } + } + closedir($dir); + + @asort($lang); + @reset($lang); + + $user_select = ''; + foreach ($lang as $displayname => $filename) + { + $selected = (strtolower($default) == strtolower($filename)) ? ' selected="selected"' : ''; + $user_select .= ''; + } + + return $user_select; + } +} diff --git a/sources/phpBB/install/install_convert.php b/sources/phpBB/install/install_convert.php new file mode 100644 index 0000000..6a892a7 --- /dev/null +++ b/sources/phpBB/install/install_convert.php @@ -0,0 +1,2150 @@ + +* @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_INSTALL')) +{ + // Someone has tried to access the file direct. This is not a good idea, so exit + exit; +} + +if (!empty($setmodules)) +{ + $module[] = array( + 'module_type' => 'install', + 'module_title' => 'CONVERT', + 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1), + 'module_order' => 20, + 'module_subs' => '', + 'module_stages' => array('INTRO', 'SETTINGS', 'IN_PROGRESS', 'FINAL'), + 'module_reqs' => '' + ); +} + +/** +* Class holding all convertor-specific details. +*/ +class convert +{ + var $options = array(); + + var $convertor_tag = ''; + var $src_dbms = ''; + var $src_dbhost = ''; + var $src_dbport = ''; + var $src_dbuser = ''; + var $src_dbpasswd = ''; + var $src_dbname = ''; + var $src_table_prefix = ''; + + var $convertor_data = array(); + var $tables = array(); + var $config_schema = array(); + var $convertor = array(); + var $src_truncate_statement = 'DELETE FROM '; + var $truncate_statement = 'DELETE FROM '; + + var $fulltext_search; + + // Batch size, can be adjusted by the conversion file + // For big boards a value of 6000 seems to be optimal + var $batch_size = 2000; + // Number of rows to be inserted at once (extended insert) if supported + // For installations having enough memory a value of 60 may be good. + var $num_wait_rows = 20; + + // Mysqls internal recoding engine messing up with our (better) functions? We at least support more encodings than mysql so should use it in favor. + var $mysql_convert = false; + + var $p_master; + + function convert(&$p_master) + { + $this->p_master = &$p_master; + } +} + +/** +* Convert class for conversions +*/ +class install_convert extends module +{ + /** @var array */ + protected $lang; + + /** @var string */ + protected $language; + + /** @var \phpbb\template\template */ + protected $template; + + /** @var string */ + protected $phpbb_root_path; + + /** @var string */ + protected $php_ext; + + /** + * Variables used while converting, they are accessible from the global variable $convert + */ + function install_convert(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($mode, $sub) + { + global $lang, $template, $phpbb_root_path, $phpEx, $cache, $config, $language, $table_prefix; + global $convert, $request, $phpbb_container, $phpbb_config_php_file; + + $this->tpl_name = 'install_convert'; + $this->mode = $mode; + $this->lang = $lang; + $this->language = $language; + $this->template = $template; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $phpEx; + + if (!$this->check_phpbb_installed()) + { + return; + } + + $convert = new convert($this->p_master); + + // 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(); + + // Create cache + $cache = $phpbb_container->get('cache'); + + switch ($sub) + { + case 'intro': + extract($phpbb_config_php_file->get_all()); + + require($phpbb_root_path . 'includes/constants.' . $phpEx); + require($phpbb_root_path . 'includes/functions_convert.' . $phpEx); + + $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms); + + $db = new $dbms(); + $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true); + 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); + + // 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); + + if ($new_conversion) + { + $config['convert_progress'] = ''; + $config['convert_db_server'] = ''; + $config['convert_db_user'] = ''; + $db->sql_query('DELETE FROM ' . CONFIG_TABLE . " + WHERE config_name = 'convert_progress' + OR config_name = 'convert_db_server' + OR config_name = 'convert_db_user'" + ); + } + + // Let's see if there is a conversion in the works... + $options = array(); + if (!empty($config['convert_progress']) && !empty($config['convert_db_server']) && !empty($config['convert_db_user']) && !empty($config['convert_options'])) + { + $options = unserialize($config['convert_progress']); + $options = array_merge($options, unserialize($config['convert_db_server']), unserialize($config['convert_db_user']), unserialize($config['convert_options'])); + } + + // This information should have already been checked once, but do it again for safety + if (!empty($options) && !empty($options['tag']) && + isset($options['dbms']) && + isset($options['dbhost']) && + isset($options['dbport']) && + isset($options['dbuser']) && + isset($options['dbpasswd']) && + isset($options['dbname']) && + isset($options['table_prefix'])) + { + $this->page_title = $lang['CONTINUE_CONVERT']; + + $template->assign_vars(array( + 'TITLE' => $lang['CONTINUE_CONVERT'], + 'BODY' => $lang['CONTINUE_CONVERT_BODY'], + 'L_NEW' => $lang['CONVERT_NEW_CONVERSION'], + 'L_CONTINUE' => $lang['CONTINUE_OLD_CONVERSION'], + 'S_CONTINUE' => true, + + 'U_NEW_ACTION' => $this->p_master->module_url . "?mode={$this->mode}&sub=intro&new_conv=1&language=$language", + 'U_CONTINUE_ACTION' => $this->p_master->module_url . "?mode={$this->mode}&sub=in_progress&tag={$options['tag']}{$options['step']}&language=$language", + )); + + return; + } + + $this->list_convertors($sub); + + break; + + case 'settings': + $this->get_convert_settings($sub); + break; + + case 'in_progress': + $this->convert_data($sub); + break; + + case 'final': + $this->page_title = $lang['CONVERT_COMPLETE']; + + $template->assign_vars(array( + 'TITLE' => $lang['CONVERT_COMPLETE'], + 'BODY' => $lang['CONVERT_COMPLETE_EXPLAIN'], + )); + + // If we reached this step (conversion completed) we want to purge the cache and log the user out. + // This is for making sure the session get not screwed due to the 3.0.x users table being completely new. + $cache->purge(); + + extract($phpbb_config_php_file->get_all()); + + require($phpbb_root_path . 'includes/constants.' . $phpEx); + require($phpbb_root_path . 'includes/functions_convert.' . $phpEx); + + $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms); + + $db = new $dbms(); + $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true); + unset($dbpasswd); + + $sql = 'SELECT config_value + FROM ' . CONFIG_TABLE . ' + WHERE config_name = \'search_type\''; + $result = $db->sql_query($sql); + + if ($db->sql_fetchfield('config_value') != 'fulltext_mysql') + { + $template->assign_vars(array( + 'S_ERROR_BOX' => true, + 'ERROR_TITLE' => $lang['SEARCH_INDEX_UNCONVERTED'], + 'ERROR_MSG' => $lang['SEARCH_INDEX_UNCONVERTED_EXPLAIN'], + )); + } + + switch ($db->get_sql_layer()) + { + case 'sqlite': + case 'sqlite3': + $db->sql_query('DELETE FROM ' . SESSIONS_KEYS_TABLE); + $db->sql_query('DELETE FROM ' . SESSIONS_TABLE); + break; + + default: + $db->sql_query('TRUNCATE TABLE ' . SESSIONS_KEYS_TABLE); + $db->sql_query('TRUNCATE TABLE ' . SESSIONS_TABLE); + break; + } + + break; + } + } + + /** + * Check whether phpBB is installed. + * Assigns error template vars if not installed. + * + * @return bool Returns true if phpBB is installed. + */ + public function check_phpbb_installed() + { + if (phpbb_check_installation_exists($this->phpbb_root_path, $this->php_ext)) + { + return true; + } + + $this->page_title = 'BOARD_NOT_INSTALLED'; + $install_url = append_sid($this->phpbb_root_path . 'install/index.' . $this->php_ext, 'mode=install&language=' . $this->language); + + $this->template->assign_vars(array( + 'S_NOT_INSTALLED' => true, + 'BODY' => sprintf($this->lang['BOARD_NOT_INSTALLED_EXPLAIN'], $install_url), + )); + + return false; + } + + /** + * Generate a list of all available conversion modules + */ + function list_convertors($sub) + { + global $lang, $language, $template, $phpbb_root_path, $phpEx; + + $this->page_title = $lang['SUB_INTRO']; + + $template->assign_vars(array( + 'TITLE' => $lang['CONVERT_INTRO'], + 'BODY' => $lang['CONVERT_INTRO_BODY'], + + 'L_AUTHOR' => $lang['AUTHOR'], + 'L_AVAILABLE_CONVERTORS' => $lang['AVAILABLE_CONVERTORS'], + 'L_CONVERT' => $lang['CONVERT'], + 'L_NO_CONVERTORS' => $lang['NO_CONVERTORS'], + 'L_OPTIONS' => $lang['CONVERT_OPTIONS'], + 'L_SOFTWARE' => $lang['SOFTWARE'], + 'L_VERSION' => $lang['VERSION'], + + 'S_LIST' => true, + )); + + $convertors = $sort = array(); + $get_info = true; + + $handle = @opendir('./convertors/'); + + if (!$handle) + { + $this->error('Unable to access the convertors directory', __LINE__, __FILE__); + } + + while ($entry = readdir($handle)) + { + if (preg_match('/^convert_([a-z0-9_]+).' . $phpEx . '$/i', $entry, $m)) + { + include('./convertors/' . $entry); + if (isset($convertor_data)) + { + $sort[strtolower($convertor_data['forum_name'])] = sizeof($convertors); + + $convertors[] = array( + 'tag' => $m[1], + 'forum_name' => $convertor_data['forum_name'], + 'version' => $convertor_data['version'], + 'dbms' => $convertor_data['dbms'], + 'dbhost' => $convertor_data['dbhost'], + 'dbport' => $convertor_data['dbport'], + 'dbuser' => $convertor_data['dbuser'], + 'dbpasswd' => $convertor_data['dbpasswd'], + 'dbname' => $convertor_data['dbname'], + 'table_prefix' => $convertor_data['table_prefix'], + 'author' => $convertor_data['author'] + ); + } + unset($convertor_data); + } + } + closedir($handle); + + @ksort($sort); + + foreach ($sort as $void => $index) + { + $template->assign_block_vars('convertors', array( + 'AUTHOR' => $convertors[$index]['author'], + 'SOFTWARE' => $convertors[$index]['forum_name'], + 'VERSION' => $convertors[$index]['version'], + + 'U_CONVERT' => $this->p_master->module_url . "?mode={$this->mode}&language=$language&sub=settings&tag=" . $convertors[$index]['tag'], + )); + } + } + + /** + */ + function get_convert_settings($sub) + { + global $lang, $language, $template, $db, $phpbb_root_path, $phpEx, $config, $cache, $phpbb_config_php_file; + + extract($phpbb_config_php_file->get_all()); + + require($phpbb_root_path . 'includes/constants.' . $phpEx); + require($phpbb_root_path . 'includes/functions_convert.' . $phpEx); + + $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms); + + $db = new $dbms(); + $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true); + unset($dbpasswd); + + $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); + + $convertor_tag = request_var('tag', ''); + + if (empty($convertor_tag)) + { + $this->p_master->error($lang['NO_CONVERT_SPECIFIED'], __LINE__, __FILE__); + } + $get_info = true; + + // check security implications of direct inclusion + $convertor_tag = basename($convertor_tag); + if (!file_exists('./convertors/convert_' . $convertor_tag . '.' . $phpEx)) + { + $this->p_master->error($lang['CONVERT_NOT_EXIST'], __LINE__, __FILE__); + } + + include('./convertors/convert_' . $convertor_tag . '.' . $phpEx); + + // The test_file is a file that should be present in the location of the old board. + if (!isset($test_file)) + { + $this->p_master->error($lang['DEV_NO_TEST_FILE'], __LINE__, __FILE__); + } + + $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); + + // 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'); + + // 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; + + $error = array(); + if ($submit) + { + if (!@file_exists('./../' . $forum_path . '/' . $test_file)) + { + $error[] = sprintf($lang['COULD_NOT_FIND_PATH'], $forum_path); + } + + $connect_test = false; + $available_dbms = get_available_dbms(false, true, true); + + if (!isset($available_dbms[$src_dbms]) || !$available_dbms[$src_dbms]['AVAILABLE']) + { + $error[] = $lang['INST_ERR_NO_DB']; + $connect_test = false; + } + else + { + $connect_test = connect_check_db(true, $error, $available_dbms[$src_dbms], $src_table_prefix, $src_dbhost, $src_dbuser, htmlspecialchars_decode($src_dbpasswd), $src_dbname, $src_dbport, true, ($src_dbms == $dbms) ? false : true, false); + } + + // The forum prefix of the old and the new forum can only be the same if two different databases are used. + if ($src_table_prefix == $table_prefix && $src_dbms == $dbms && $src_dbhost == $dbhost && $src_dbport == $dbport && $src_dbname == $dbname) + { + $error[] = sprintf($lang['TABLE_PREFIX_SAME'], $src_table_prefix); + } + + $src_dbms = $phpbb_config_php_file->convert_30_dbms_to_31($src_dbms); + + // Check table prefix + if (!sizeof($error)) + { + // initiate database connection to old db if old and new db differ + global $src_db, $same_db; + $src_db = $same_db = false; + + if ($src_dbms != $dbms || $src_dbhost != $dbhost || $src_dbport != $dbport || $src_dbname != $dbname || $src_dbuser != $dbuser) + { + $src_db = new $src_dbms(); + $src_db->sql_connect($src_dbhost, $src_dbuser, htmlspecialchars_decode($src_dbpasswd), $src_dbname, $src_dbport, false, true); + $same_db = false; + } + else + { + $src_db = $db; + $same_db = true; + } + + $src_db->sql_return_on_error(true); + $db->sql_return_on_error(true); + + // Try to select one row from the first table to see if the prefix is OK + $result = $src_db->sql_query_limit('SELECT * FROM ' . $src_table_prefix . $tables[0], 1); + + if (!$result) + { + $prefixes = array(); + + $tables_existing = get_tables($src_db); + $tables_existing = array_map('strtolower', $tables_existing); + foreach ($tables_existing as $table_name) + { + compare_table($tables, $table_name, $prefixes); + } + unset($tables_existing); + + foreach ($prefixes as $prefix => $count) + { + if ($count >= sizeof($tables)) + { + $possible_prefix = $prefix; + break; + } + } + + $msg = ''; + if (!empty($convertor_data['table_prefix'])) + { + $msg .= sprintf($lang['DEFAULT_PREFIX_IS'], $convertor_data['forum_name'], $convertor_data['table_prefix']); + } + + if (!empty($possible_prefix)) + { + $msg .= '
'; + $msg .= ($possible_prefix == '*') ? $lang['BLANK_PREFIX_FOUND'] : sprintf($lang['PREFIX_FOUND'], $possible_prefix); + $src_table_prefix = ($possible_prefix == '*') ? '' : $possible_prefix; + } + + $error[] = $msg; + } + $src_db->sql_freeresult($result); + $src_db->sql_return_on_error(false); + } + + if (!sizeof($error)) + { + // Save convertor Status + set_config('convert_progress', serialize(array( + 'step' => '', + 'table_prefix' => $src_table_prefix, + 'tag' => $convertor_tag, + )), true); + set_config('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( + 'dbuser' => $src_dbuser, + 'dbpasswd' => $src_dbpasswd, + )), true); + + // Save options + set_config('convert_options', serialize(array('forum_path' => './../' . $forum_path, 'refresh' => $refresh)), true); + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['VERIFY_OPTIONS'], + 'RESULT' => $lang['CONVERT_SETTINGS_VERIFIED'], + )); + + $template->assign_vars(array( + 'L_SUBMIT' => $lang['BEGIN_CONVERT'], +// 'S_HIDDEN' => $s_hidden_fields, + 'U_ACTION' => $this->p_master->module_url . "?mode={$this->mode}&sub=in_progress&tag=$convertor_tag&language=$language", + )); + + return; + } + else + { + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['VERIFY_OPTIONS'], + 'RESULT' => '' . implode('
', $error) . '
', + )); + } + } // end submit + + foreach ($this->convert_options as $config_key => $vars) + { + if (!is_array($vars) && strpos($config_key, 'legend') === false) + { + continue; + } + + if (strpos($config_key, 'legend') !== false) + { + $template->assign_block_vars('options', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang[$vars]) + ); + + continue; + } + + $options = isset($vars['options']) ? $vars['options'] : ''; + + $template->assign_block_vars('options', array( + 'KEY' => $config_key, + 'TITLE' => $lang[$vars['lang']], + 'S_EXPLAIN' => $vars['explain'], + 'S_LEGEND' => false, + 'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '', + 'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], $$config_key, $options), + ) + ); + } + + $template->assign_vars(array( + 'TITLE' => $lang['STAGE_SETTINGS'], + 'BODY' => $lang['CONV_OPTIONS_BODY'], + 'L_SUBMIT' => $lang['BEGIN_CONVERT'], + 'U_ACTION' => $this->p_master->module_url . "?mode={$this->mode}&sub=settings&tag=$convertor_tag&language=$language", + )); + } + + /** + * The function which does the actual work (or dispatches it to the relevant places) + */ + function convert_data($sub) + { + global $template, $user, $phpbb_root_path, $phpEx, $db, $lang, $config, $cache, $auth; + global $convert, $convert_row, $message_parser, $skip_rows, $language; + global $request, $phpbb_config_php_file; + + extract($phpbb_config_php_file->get_all()); + + require($phpbb_root_path . 'includes/constants.' . $phpEx); + require($phpbb_root_path . 'includes/functions_convert.' . $phpEx); + + $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms); + + $db = new $dbms(); + $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true); + 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); + + // Override a couple of config variables for the duration + $config['max_quote_depth'] = 0; + + // @todo Need to confirm that max post length in source is <= max post length in destination or there may be interesting formatting issues + $config['max_post_chars'] = $config['min_post_chars'] = 0; + + // Set up a user as well. We _should_ have enough of a database here at this point to do this + // and it helps for any core code we call + $user->session_begin(); + $user->page = $user->extract_current_page($phpbb_root_path); + + // This is a little bit of a fudge, but it allows the language entries to be available to the + // core code without us loading them again + $user->lang = &$lang; + + $this->page_title = $user->lang['STAGE_IN_PROGRESS']; + + $convert->options = array(); + if (isset($config['convert_progress'])) + { + $convert->options = unserialize($config['convert_progress']); + $convert->options = array_merge($convert->options, unserialize($config['convert_db_server']), unserialize($config['convert_db_user']), unserialize($config['convert_options'])); + } + + // This information should have already been checked once, but do it again for safety + if (empty($convert->options) || empty($convert->options['tag']) || + !isset($convert->options['dbms']) || + !isset($convert->options['dbhost']) || + !isset($convert->options['dbport']) || + !isset($convert->options['dbuser']) || + !isset($convert->options['dbpasswd']) || + !isset($convert->options['dbname']) || + !isset($convert->options['table_prefix'])) + { + $this->p_master->error($user->lang['NO_CONVERT_SPECIFIED'], __LINE__, __FILE__); + } + + // Make some short variables accessible, for easier referencing + $convert->convertor_tag = basename($convert->options['tag']); + $convert->src_dbms = $convert->options['dbms']; + $convert->src_dbhost = $convert->options['dbhost']; + $convert->src_dbport = $convert->options['dbport']; + $convert->src_dbuser = $convert->options['dbuser']; + $convert->src_dbpasswd = $convert->options['dbpasswd']; + $convert->src_dbname = $convert->options['dbname']; + $convert->src_table_prefix = $convert->options['table_prefix']; + + // initiate database connection to old db if old and new db differ + global $src_db, $same_db; + $src_db = $same_db = null; + if ($convert->src_dbms != $dbms || $convert->src_dbhost != $dbhost || $convert->src_dbport != $dbport || $convert->src_dbname != $dbname || $convert->src_dbuser != $dbuser) + { + $dbms = $convert->src_dbms; + $src_db = new $dbms(); + $src_db->sql_connect($convert->src_dbhost, $convert->src_dbuser, htmlspecialchars_decode($convert->src_dbpasswd), $convert->src_dbname, $convert->src_dbport, false, true); + $same_db = false; + } + else + { + $src_db = $db; + $same_db = true; + } + + $convert->mysql_convert = false; + switch ($src_db->sql_layer) + { + case 'sqlite': + case 'sqlite3': + $convert->src_truncate_statement = 'DELETE FROM '; + break; + + // Thanks MySQL, for silently converting... + case 'mysql': + case 'mysql4': + if (version_compare($src_db->sql_server_info(true, false), '4.1.3', '>=')) + { + $convert->mysql_convert = true; + } + $convert->src_truncate_statement = 'TRUNCATE TABLE '; + break; + + case 'mysqli': + $convert->mysql_convert = true; + $convert->src_truncate_statement = 'TRUNCATE TABLE '; + break; + + default: + $convert->src_truncate_statement = 'TRUNCATE TABLE '; + break; + } + + if ($convert->mysql_convert && !$same_db) + { + $src_db->sql_query("SET NAMES 'binary'"); + } + + switch ($db->get_sql_layer()) + { + case 'sqlite': + case 'sqlite3': + $convert->truncate_statement = 'DELETE FROM '; + break; + + default: + $convert->truncate_statement = 'TRUNCATE TABLE '; + break; + } + + $get_info = false; + + // check security implications of direct inclusion + if (!file_exists('./convertors/convert_' . $convert->convertor_tag . '.' . $phpEx)) + { + $this->p_master->error($user->lang['CONVERT_NOT_EXIST'], __LINE__, __FILE__); + } + + if (file_exists('./convertors/functions_' . $convert->convertor_tag . '.' . $phpEx)) + { + include('./convertors/functions_' . $convert->convertor_tag . '.' . $phpEx); + } + + $get_info = true; + include('./convertors/convert_' . $convert->convertor_tag . '.' . $phpEx); + + // Map some variables... + $convert->convertor_data = $convertor_data; + $convert->tables = $tables; + $convert->config_schema = $config_schema; + + // Now include the real data + $get_info = false; + include('./convertors/convert_' . $convert->convertor_tag . '.' . $phpEx); + + $convert->convertor_data = $convertor_data; + $convert->tables = $tables; + $convert->config_schema = $config_schema; + $convert->convertor = $convertor; + + // The test_file is a file that should be present in the location of the old board. + if (!file_exists($convert->options['forum_path'] . '/' . $test_file)) + { + $this->p_master->error(sprintf($user->lang['COULD_NOT_FIND_PATH'], $convert->options['forum_path']), __LINE__, __FILE__); + } + + $search_type = $config['search_type']; + + // For conversions we are a bit less strict and set to a search backend we know exist... + if (!class_exists($search_type)) + { + $search_type = '\phpbb\search\fulltext_native'; + set_config('search_type', $search_type); + } + + if (!class_exists($search_type)) + { + trigger_error('NO_SUCH_SEARCH_MODULE'); + } + + $error = false; + $convert->fulltext_search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); + + if ($error) + { + trigger_error($error); + } + + 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); + + // We are running sync... + if ($sync_batch >= 0) + { + $this->sync_forums($sync_batch); + return; + } + + if ($jump) + { + $this->jump($jump, $last_statement); + return; + } + + if ($final_jump) + { + $this->final_jump($final_jump); + return; + } + + $current_table = request_var('current_table', 0); + $old_current_table = min(-1, $current_table - 1); + $skip_rows = request_var('skip_rows', 0); + + if (!$current_table && !$skip_rows) + { + if (!$request->variable('confirm', false)) + { + // If avatars / ranks / smilies folders are specified make sure they are writable + $bad_folders = array(); + + $local_paths = array( + 'avatar_path' => path($config['avatar_path']), + 'avatar_gallery_path' => path($config['avatar_gallery_path']), + 'icons_path' => path($config['icons_path']), + 'ranks_path' => path($config['ranks_path']), + 'smilies_path' => path($config['smilies_path']) + ); + + foreach ($local_paths as $folder => $local_path) + { + if (isset($convert->convertor[$folder])) + { + if (empty($convert->convertor['test_file'])) + { + // test_file is mandantory at the moment so this should never be reached, but just in case... + $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) + { + $bad_folders[] = sprintf($user->lang['CONFIG_PHPBB_EMPTY'], $folder); + } + else + { + $bad_folders[] = $local_path; + } + } + } + } + + if (sizeof($bad_folders)) + { + $msg = (sizeof($bad_folders) == 1) ? $user->lang['MAKE_FOLDER_WRITABLE'] : $user->lang['MAKE_FOLDERS_WRITABLE']; + sort($bad_folders); + $this->p_master->error(sprintf($msg, implode('
', $bad_folders)), __LINE__, __FILE__, true); + + $template->assign_vars(array( + 'L_SUBMIT' => $user->lang['INSTALL_TEST'], + 'U_ACTION' => $this->p_master->module_url . "?mode={$this->mode}&sub=in_progress&tag={$convert->convertor_tag}&language=$language", + )); + return; + } + + // Grab all the tables used in convertor + $missing_tables = $tables_list = $aliases = array(); + + foreach ($convert->convertor['schema'] as $schema) + { + // Skip those not used (because of addons/plugins not detected) + if (!$schema['target']) + { + continue; + } + + foreach ($schema as $key => $val) + { + // we're dealing with an array like: + // array('forum_status', 'forums.forum_status', 'is_item_locked') + if (is_int($key) && !empty($val[1])) + { + $temp_data = $val[1]; + if (!is_array($temp_data)) + { + $temp_data = array($temp_data); + } + + foreach ($temp_data as $val) + { + if (preg_match('/([a-z0-9_]+)\.([a-z0-9_]+)\)* ?A?S? ?([a-z0-9_]*?)\.?([a-z0-9_]*)$/i', $val, $m)) + { + $table = $convert->src_table_prefix . $m[1]; + $tables_list[$table] = $table; + + if (!empty($m[3])) + { + $aliases[] = $convert->src_table_prefix . $m[3]; + } + } + } + } + // 'left_join' => 'topics LEFT JOIN vote_desc ON topics.topic_id = vote_desc.topic_id AND topics.topic_vote = 1' + else if ($key == 'left_join') + { + // Convert the value if it wasn't an array already. + if (!is_array($val)) + { + $val = array($val); + } + + for ($j = 0; $j < sizeof($val); ++$j) + { + if (preg_match('/LEFT JOIN ([a-z0-9_]+) AS ([a-z0-9_]+)/i', $val[$j], $m)) + { + $table = $convert->src_table_prefix . $m[1]; + $tables_list[$table] = $table; + + if (!empty($m[2])) + { + $aliases[] = $convert->src_table_prefix . $m[2]; + } + } + } + } + } + } + + // Remove aliased tables from $tables_list + foreach ($aliases as $alias) + { + unset($tables_list[$alias]); + } + + // Check if the tables that we need exist + $src_db->sql_return_on_error(true); + foreach ($tables_list as $table => $null) + { + $sql = 'SELECT 1 FROM ' . $table; + $_result = $src_db->sql_query_limit($sql, 1); + + if (!$_result) + { + $missing_tables[] = $table; + } + $src_db->sql_freeresult($_result); + } + $src_db->sql_return_on_error(false); + + // Throw an error if some tables are missing + // We used to do some guessing here, but since we have a suggestion of possible values earlier, I don't see it adding anything here to do it again + + if (sizeof($missing_tables) == sizeof($tables_list)) + { + $this->p_master->error($user->lang['NO_TABLES_FOUND'] . ' ' . $user->lang['CHECK_TABLE_PREFIX'], __LINE__, __FILE__); + } + else if (sizeof($missing_tables)) + { + $this->p_master->error(sprintf($user->lang['TABLES_MISSING'], implode($user->lang['COMMA_SEPARATOR'], $missing_tables)) . '

' . $user->lang['CHECK_TABLE_PREFIX'], __LINE__, __FILE__); + } + + $url = $this->save_convert_progress('&confirm=1'); + $msg = $user->lang['PRE_CONVERT_COMPLETE']; + + if ($convert->convertor_data['author_notes']) + { + $msg .= '

' . sprintf($user->lang['AUTHOR_NOTES'], $convert->convertor_data['author_notes']); + } + + $template->assign_vars(array( + 'L_SUBMIT' => $user->lang['CONTINUE_CONVERT'], + 'L_MESSAGE' => $msg, + 'U_ACTION' => $url, + )); + + return; + } // if (!$request->variable('confirm', false))) + + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $user->lang['STARTING_CONVERT'], + )); + + // Convert the config table and load the settings of the old board + if (!empty($convert->config_schema)) + { + restore_config($convert->config_schema); + + // Override a couple of config variables for the duration + $config['max_quote_depth'] = 0; + + // @todo Need to confirm that max post length in source is <= max post length in destination or there may be interesting formatting issues + $config['max_post_chars'] = $config['min_post_chars'] = 0; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $user->lang['CONFIG_CONVERT'], + 'RESULT' => $user->lang['DONE'], + )); + + // Now process queries and execute functions that have to be executed prior to the conversion + if (!empty($convert->convertor['execute_first'])) + { + // @codingStandardsIgnoreStart + eval($convert->convertor['execute_first']); + // @codingStandardsIgnoreEnd + } + + if (!empty($convert->convertor['query_first'])) + { + if (!is_array($convert->convertor['query_first'])) + { + $convert->convertor['query_first'] = array('target', array($convert->convertor['query_first'])); + } + else if (!is_array($convert->convertor['query_first'][0])) + { + $convert->convertor['query_first'] = array(array($convert->convertor['query_first'][0], $convert->convertor['query_first'][1])); + } + + foreach ($convert->convertor['query_first'] as $query_first) + { + if ($query_first[0] == 'src') + { + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'binary'"); + } + + $src_db->sql_query($query_first[1]); + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'utf8'"); + } + } + else + { + $db->sql_query($query_first[1]); + } + } + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $user->lang['PREPROCESS_STEP'], + 'RESULT' => $user->lang['DONE'], + )); + } // if (!$current_table && !$skip_rows) + + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $user->lang['FILLING_TABLES'], + )); + + // This loop takes one target table and processes it + while ($current_table < sizeof($convert->convertor['schema'])) + { + $schema = $convert->convertor['schema'][$current_table]; + + // The target table isn't set, this can be because a module (for example the attachement mod) is taking care of this. + if (empty($schema['target'])) + { + $current_table++; + continue; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => sprintf($user->lang['FILLING_TABLE'], $schema['target']), + )); + + // This is only the case when we first start working on the tables. + if (!$skip_rows) + { + // process execute_first and query_first for this table... + if (!empty($schema['execute_first'])) + { + // @codingStandardsIgnoreStart + eval($schema['execute_first']); + // @codingStandardsIgnoreEnd + } + + if (!empty($schema['query_first'])) + { + if (!is_array($schema['query_first'])) + { + $schema['query_first'] = array('target', array($schema['query_first'])); + } + else if (!is_array($schema['query_first'][0])) + { + $schema['query_first'] = array(array($schema['query_first'][0], $schema['query_first'][1])); + } + + foreach ($schema['query_first'] as $query_first) + { + if ($query_first[0] == 'src') + { + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'binary'"); + } + $src_db->sql_query($query_first[1]); + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'utf8'"); + } + } + else + { + $db->sql_query($query_first[1]); + } + } + } + + if (!empty($schema['autoincrement'])) + { + switch ($db->get_sql_layer()) + { + case 'postgres': + $db->sql_query("SELECT SETVAL('" . $schema['target'] . "_seq',(select case when max(" . $schema['autoincrement'] . ")>0 then max(" . $schema['autoincrement'] . ")+1 else 1 end from " . $schema['target'] . '));'); + break; + + case 'oracle': + $result = $db->sql_query('SELECT MAX(' . $schema['autoincrement'] . ') as max_id FROM ' . $schema['target']); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $largest_id = (int) $row['max_id']; + + if ($largest_id) + { + $db->sql_query('DROP SEQUENCE ' . $schema['target'] . '_seq'); + $db->sql_query('CREATE SEQUENCE ' . $schema['target'] . '_seq START WITH ' . ($largest_id + 1)); + } + break; + } + } + } + + // Process execute_always for this table + // This is for code which needs to be executed on every pass of this table if + // it gets split because of time restrictions + if (!empty($schema['execute_always'])) + { + // @codingStandardsIgnoreStart + eval($schema['execute_always']); + // @codingStandardsIgnoreEnd + } + + // + // Set up some variables + // + // $waiting_rows holds rows for multirows insertion (MySQL only) + // $src_tables holds unique tables with aliases to select from + // $src_fields will quickly refer source fields (or aliases) corresponding to the current index + // $select_fields holds the names of the fields to retrieve + // + + $sql_data = array( + 'source_fields' => array(), + 'target_fields' => array(), + 'source_tables' => array(), + 'select_fields' => array(), + ); + + // This statement is building the keys for later insertion. + $insert_query = $this->build_insert_query($schema, $sql_data, $current_table); + + // If no source table is affected, we skip the table + if (empty($sql_data['source_tables'])) + { + $skip_rows = 0; + $current_table++; + continue; + } + + $distinct = (!empty($schema['distinct'])) ? 'DISTINCT ' : ''; + + $sql = 'SELECT ' . $distinct . implode(', ', $sql_data['select_fields']) . " \nFROM " . implode(', ', $sql_data['source_tables']); + + // Where + $sql .= (!empty($schema['where'])) ? "\nWHERE (" . $schema['where'] . ')' : ''; + + // Group By + if (!empty($schema['group_by'])) + { + $schema['group_by'] = array($schema['group_by']); + foreach ($sql_data['select_fields'] as $select) + { + $alias = strpos(strtolower($select), ' as '); + $select = ($alias) ? substr($select, 0, $alias) : $select; + if (!in_array($select, $schema['group_by'])) + { + $schema['group_by'][] = $select; + } + } + } + $sql .= (!empty($schema['group_by'])) ? "\nGROUP BY " . implode(', ', $schema['group_by']) : ''; + + // Having + $sql .= (!empty($schema['having'])) ? "\nHAVING " . $schema['having'] : ''; + + // Order By + if (empty($schema['order_by']) && !empty($schema['primary'])) + { + $schema['order_by'] = $schema['primary']; + } + $sql .= (!empty($schema['order_by'])) ? "\nORDER BY " . $schema['order_by'] : ''; + + // Counting basically holds the amount of rows processed. + $counting = -1; + $batch_time = 0; + + while ($counting === -1 || ($counting >= $convert->batch_size && still_on_time())) + { + $old_current_table = $current_table; + + $rows = ''; + $waiting_rows = array(); + + if (!empty($batch_time)) + { + $mtime = explode(' ', microtime()); + $mtime = $mtime[0] + $mtime[1]; + $rows = ceil($counting/($mtime - $batch_time)) . " rows/s ($counting rows) | "; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => "skip_rows = $skip_rows", + 'RESULT' => $rows . ((defined('DEBUG') && function_exists('memory_get_usage')) ? ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] : ''), + )); + + $mtime = explode(' ', microtime()); + $batch_time = $mtime[0] + $mtime[1]; + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'binary'"); + } + + // Take skip rows into account and only fetch batch_size amount of rows + $___result = $src_db->sql_query_limit($sql, $convert->batch_size, $skip_rows); + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'utf8'"); + } + + // This loop processes each row + $counting = 0; + + $convert->row = $convert_row = array(); + + if (!empty($schema['autoincrement'])) + { + switch ($db->get_sql_layer()) + { + case 'mssql': + case 'mssql_odbc': + case 'mssqlnative': + $db->sql_query('SET IDENTITY_INSERT ' . $schema['target'] . ' ON'); + break; + } + } + + // Now handle the rows until time is over or no more rows to process... + while ($counting === 0 || still_on_time()) + { + $convert_row = $src_db->sql_fetchrow($___result); + + if (!$convert_row) + { + // move to the next batch or table + break; + } + + // With this we are able to always save the last state + $convert->row = $convert_row; + + // Increment the counting variable, it stores the number of rows we have processed + $counting++; + + $insert_values = array(); + + $sql_flag = $this->process_row($schema, $sql_data, $insert_values); + + if ($sql_flag === true) + { + switch ($db->get_sql_layer()) + { + // If MySQL, we'll wait to have num_wait_rows rows to submit at once + case 'mysql': + case 'mysql4': + case 'mysqli': + $waiting_rows[] = '(' . implode(', ', $insert_values) . ')'; + + if (sizeof($waiting_rows) >= $convert->num_wait_rows) + { + $errored = false; + + $db->sql_return_on_error(true); + + if (!$db->sql_query($insert_query . implode(', ', $waiting_rows))) + { + $errored = true; + } + $db->sql_return_on_error(false); + + if ($errored) + { + $db->sql_return_on_error(true); + + // Because it errored out we will try to insert the rows one by one... most of the time this + // is caused by duplicate entries - but we also do not want to miss one... + foreach ($waiting_rows as $waiting_sql) + { + if (!$db->sql_query($insert_query . $waiting_sql)) + { + $this->p_master->db_error($user->lang['DB_ERR_INSERT'], htmlspecialchars($insert_query . $waiting_sql) . '

' . htmlspecialchars(print_r($db->_sql_error(), true)), __LINE__, __FILE__, true); + } + } + + $db->sql_return_on_error(false); + } + + $waiting_rows = array(); + } + + break; + + default: + $insert_sql = $insert_query . '(' . implode(', ', $insert_values) . ')'; + + $db->sql_return_on_error(true); + + if (!$db->sql_query($insert_sql)) + { + $this->p_master->db_error($user->lang['DB_ERR_INSERT'], htmlspecialchars($insert_sql) . '

' . htmlspecialchars(print_r($db->_sql_error(), true)), __LINE__, __FILE__, true); + } + $db->sql_return_on_error(false); + + $waiting_rows = array(); + + break; + } + } + + $skip_rows++; + } + $src_db->sql_freeresult($___result); + + // We might still have some rows waiting + if (sizeof($waiting_rows)) + { + $errored = false; + $db->sql_return_on_error(true); + + if (!$db->sql_query($insert_query . implode(', ', $waiting_rows))) + { + $errored = true; + } + $db->sql_return_on_error(false); + + if ($errored) + { + $db->sql_return_on_error(true); + + // Because it errored out we will try to insert the rows one by one... most of the time this + // is caused by duplicate entries - but we also do not want to miss one... + foreach ($waiting_rows as $waiting_sql) + { + $db->sql_query($insert_query . $waiting_sql); + $this->p_master->db_error($user->lang['DB_ERR_INSERT'], htmlspecialchars($insert_query . $waiting_sql) . '

' . htmlspecialchars(print_r($db->_sql_error(), true)), __LINE__, __FILE__, true); + } + + $db->sql_return_on_error(false); + } + + $waiting_rows = array(); + } + + if (!empty($schema['autoincrement'])) + { + switch ($db->get_sql_layer()) + { + case 'mssql': + case 'mssql_odbc': + case 'mssqlnative': + $db->sql_query('SET IDENTITY_INSERT ' . $schema['target'] . ' OFF'); + break; + + case 'postgres': + $db->sql_query("SELECT SETVAL('" . $schema['target'] . "_seq',(select case when max(" . $schema['autoincrement'] . ")>0 then max(" . $schema['autoincrement'] . ")+1 else 1 end from " . $schema['target'] . '));'); + break; + + case 'oracle': + $result = $db->sql_query('SELECT MAX(' . $schema['autoincrement'] . ') as max_id FROM ' . $schema['target']); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $largest_id = (int) $row['max_id']; + + if ($largest_id) + { + $db->sql_query('DROP SEQUENCE ' . $schema['target'] . '_seq'); + $db->sql_query('CREATE SEQUENCE ' . $schema['target'] . '_seq START WITH ' . ($largest_id + 1)); + } + break; + } + } + } + + // When we reach this point, either the current table has been processed or we're running out of time. + if (still_on_time() && $counting < $convert->batch_size/* && !defined('DEBUG')*/) + { + $skip_rows = 0; + $current_table++; + } + else + {/* + if (still_on_time() && $counting < $convert->batch_size) + { + $skip_rows = 0; + $current_table++; + }*/ + + // Looks like we ran out of time. + $url = $this->save_convert_progress('&current_table=' . $current_table . '&skip_rows=' . $skip_rows); + + $current_table++; +// $percentage = ($skip_rows == 0) ? 0 : floor(100 / ($total_rows / $skip_rows)); + + $msg = sprintf($user->lang['STEP_PERCENT_COMPLETED'], $current_table, sizeof($convert->convertor['schema'])); + + $template->assign_vars(array( + 'L_MESSAGE' => $msg, + 'L_SUBMIT' => $user->lang['CONTINUE_CONVERT'], + 'U_ACTION' => $url, + )); + + $this->meta_refresh($url); + return; + } + } + + // Process execute_last then we'll be done + $url = $this->save_convert_progress('&jump=1'); + + $template->assign_vars(array( + 'L_SUBMIT' => $user->lang['FINAL_STEP'], + 'U_ACTION' => $url, + )); + + $this->meta_refresh($url); + return; + } + + /** + * Sync function being executed at the middle, some functions need to be executed after a successful sync. + */ + function sync_forums($sync_batch) + { + global $template, $user, $db, $phpbb_root_path, $phpEx, $config, $cache; + global $convert; + + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $user->lang['SYNC_TOPICS'], + )); + + $batch_size = $convert->batch_size; + + $sql = 'SELECT MIN(topic_id) as min_value, MAX(topic_id) AS max_value + FROM ' . TOPICS_TABLE; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + // Set values of minimum/maximum primary value for this table. + $primary_min = $row['min_value']; + $primary_max = $row['max_value']; + + if ($sync_batch == 0) + { + $sync_batch = (int) $primary_min; + } + + if ($sync_batch == 0) + { + $sync_batch = 1; + } + + // Fetch a batch of rows, process and insert them. + while ($sync_batch <= $primary_max && still_on_time()) + { + $end = ($sync_batch + $batch_size - 1); + + // Sync all topics in batch mode... + sync('topic', 'range', 'topic_id BETWEEN ' . $sync_batch . ' AND ' . $end, true, true); + + $template->assign_block_vars('checks', array( + 'TITLE' => sprintf($user->lang['SYNC_TOPIC_ID'], $sync_batch, ($sync_batch + $batch_size)) . ((defined('DEBUG') && function_exists('memory_get_usage')) ? ' [' . ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] . ']' : ''), + 'RESULT' => $user->lang['DONE'], + )); + + $sync_batch += $batch_size; + } + + if ($sync_batch >= $primary_max) + { + $url = $this->save_convert_progress('&final_jump=1'); + + $template->assign_vars(array( + 'L_SUBMIT' => $user->lang['CONTINUE_CONVERT'], + 'U_ACTION' => $url, + )); + + $this->meta_refresh($url); + return; + } + else + { + $sync_batch--; + } + + $url = $this->save_convert_progress('&sync_batch=' . $sync_batch); + + $template->assign_vars(array( + 'L_SUBMIT' => $user->lang['CONTINUE_CONVERT'], + 'U_ACTION' => $url, + )); + + $this->meta_refresh($url); + return; + } + + /** + * Save the convertor status + */ + function save_convert_progress($step) + { + global $convert, $language; + + // Save convertor Status + set_config('convert_progress', serialize(array( + 'step' => $step, + 'table_prefix' => $convert->src_table_prefix, + 'tag' => $convert->convertor_tag, + )), true); + + set_config('convert_db_server', serialize(array( + 'dbms' => $convert->src_dbms, + 'dbhost' => $convert->src_dbhost, + 'dbport' => $convert->src_dbport, + 'dbname' => $convert->src_dbname, + )), true); + + set_config('convert_db_user', serialize(array( + 'dbuser' => $convert->src_dbuser, + 'dbpasswd' => $convert->src_dbpasswd, + )), true); + + return $this->p_master->module_url . "?mode={$this->mode}&sub=in_progress&tag={$convert->convertor_tag}$step&language=$language"; + } + + /** + * Finish conversion, the last function to be called. + */ + function finish_conversion() + { + global $db, $phpbb_root_path, $phpEx, $convert, $config, $language, $user, $template; + global $cache, $auth, $phpbb_container, $phpbb_log; + + $db->sql_query('DELETE FROM ' . CONFIG_TABLE . " + WHERE config_name = 'convert_progress' + OR config_name = 'convert_options' + OR config_name = 'convert_db_server' + OR config_name = 'convert_db_user'"); + $db->sql_query('DELETE FROM ' . SESSIONS_TABLE); + + @unlink($phpbb_root_path . 'cache/data_global.' . $phpEx); + 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']); + + $url = $this->p_master->module_url . "?mode={$this->mode}&sub=final&language=$language"; + + $template->assign_vars(array( + 'L_SUBMIT' => $user->lang['FINAL_STEP'], + 'U_ACTION' => $url, + )); + + $this->meta_refresh($url); + return; + } + + /** + * This function marks the steps after syncing + */ + function final_jump($final_jump) + { + global $template, $user, $src_db, $same_db, $db, $phpbb_root_path, $phpEx, $config, $cache; + global $convert; + + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $user->lang['PROCESS_LAST'], + )); + + if ($final_jump == 1) + { + $db->sql_return_on_error(true); + + update_topics_posted(); + + $template->assign_block_vars('checks', array( + 'TITLE' => $user->lang['UPDATE_TOPICS_POSTED'], + 'RESULT' => $user->lang['DONE'], + )); + + if ($db->get_sql_error_triggered()) + { + $template->assign_vars(array( + 'S_ERROR_BOX' => true, + 'ERROR_TITLE' => $user->lang['UPDATE_TOPICS_POSTED'], + 'ERROR_MSG' => $user->lang['UPDATE_TOPICS_POSTED_ERR'], + )); + } + $db->sql_return_on_error(false); + + $this->finish_conversion(); + return; + } + } + + /** + * This function marks the steps before syncing (jump=1) + */ + function jump($jump, $last_statement) + { + global $template, $user, $src_db, $same_db, $db, $phpbb_root_path, $phpEx, $config, $cache; + global $convert; + + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $user->lang['PROCESS_LAST'], + )); + + if ($jump == 1) + { + // Execute 'last' statements/queries + if (!empty($convert->convertor['execute_last'])) + { + if (!is_array($convert->convertor['execute_last'])) + { + // @codingStandardsIgnoreStart + eval($convert->convertor['execute_last']); + // @codingStandardsIgnoreEnd + } + else + { + while ($last_statement < sizeof($convert->convertor['execute_last'])) + { + // @codingStandardsIgnoreStart + eval($convert->convertor['execute_last'][$last_statement]); + // @codingStandardsIgnoreEnd + + $template->assign_block_vars('checks', array( + 'TITLE' => $convert->convertor['execute_last'][$last_statement], + 'RESULT' => $user->lang['DONE'], + )); + + $last_statement++; + $url = $this->save_convert_progress('&jump=1&last=' . $last_statement); + + $percentage = ($last_statement == 0) ? 0 : floor(100 / (sizeof($convert->convertor['execute_last']) / $last_statement)); + $msg = sprintf($user->lang['STEP_PERCENT_COMPLETED'], $last_statement, sizeof($convert->convertor['execute_last']), $percentage); + + $template->assign_vars(array( + 'L_SUBMIT' => $user->lang['CONTINUE_LAST'], + 'L_MESSAGE' => $msg, + 'U_ACTION' => $url, + )); + + $this->meta_refresh($url); + return; + } + } + } + + if (!empty($convert->convertor['query_last'])) + { + if (!is_array($convert->convertor['query_last'])) + { + $convert->convertor['query_last'] = array('target', array($convert->convertor['query_last'])); + } + else if (!is_array($convert->convertor['query_last'][0])) + { + $convert->convertor['query_last'] = array(array($convert->convertor['query_last'][0], $convert->convertor['query_last'][1])); + } + + foreach ($convert->convertor['query_last'] as $query_last) + { + if ($query_last[0] == 'src') + { + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'binary'"); + } + + $src_db->sql_query($query_last[1]); + + if ($convert->mysql_convert && $same_db) + { + $src_db->sql_query("SET NAMES 'utf8'"); + } + } + else + { + $db->sql_query($query_last[1]); + } + } + } + + // Sanity check + $db->sql_return_on_error(false); + $src_db->sql_return_on_error(false); + + fix_empty_primary_groups(); + + $sql = 'SELECT MIN(user_regdate) AS board_startdate + FROM ' . USERS_TABLE; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!isset($config['board_startdate']) || ($row['board_startdate'] < $config['board_startdate'] && $row['board_startdate'] > 0)) + { + set_config('board_startdate', $row['board_startdate']); + $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_regdate = ' . $row['board_startdate'] . ' WHERE user_id = ' . ANONYMOUS); + } + + update_dynamic_config(); + + $template->assign_block_vars('checks', array( + 'TITLE' => $user->lang['CLEAN_VERIFY'], + 'RESULT' => $user->lang['DONE'], + )); + + $url = $this->save_convert_progress('&jump=2'); + + $template->assign_vars(array( + 'L_SUBMIT' => $user->lang['CONTINUE_CONVERT'], + 'U_ACTION' => $url, + )); + + $this->meta_refresh($url); + return; + } + + if ($jump == 2) + { + $db->sql_query('UPDATE ' . USERS_TABLE . " SET user_permissions = ''"); + + // TODO: sync() is likely going to bomb out on forums with a considerable amount of topics. + // TODO: the sync function is able to handle FROM-TO values, we should use them here (batch processing) + sync('forum', '', '', false, true); + $cache->destroy('sql', FORUMS_TABLE); + + $template->assign_block_vars('checks', array( + 'TITLE' => $user->lang['SYNC_FORUMS'], + 'RESULT' => $user->lang['DONE'], + )); + + // Continue with synchronizing the forums... + $url = $this->save_convert_progress('&sync_batch=0'); + + $template->assign_vars(array( + 'L_SUBMIT' => $user->lang['CONTINUE_CONVERT'], + 'U_ACTION' => $url, + )); + + $this->meta_refresh($url); + return; + } + } + + function build_insert_query(&$schema, &$sql_data, $current_table) + { + global $db, $user; + global $convert; + + // Can we use IGNORE with this DBMS? + $sql_ignore = (strpos($db->get_sql_layer(), 'mysql') === 0 && !defined('DEBUG')) ? 'IGNORE ' : ''; + $insert_query = 'INSERT ' . $sql_ignore . 'INTO ' . $schema['target'] . ' ('; + + $aliases = array(); + + $sql_data = array( + 'source_fields' => array(), + 'target_fields' => array(), + 'source_tables' => array(), + 'select_fields' => array(), + ); + + foreach ($schema as $key => $val) + { + // Example: array('group_name', 'extension_groups.group_name', 'htmlspecialchars'), + if (is_int($key)) + { + if (!empty($val[0])) + { + // Target fields + $sql_data['target_fields'][$val[0]] = $key; + $insert_query .= $val[0] . ', '; + } + + if (!is_array($val[1])) + { + $val[1] = array($val[1]); + } + + foreach ($val[1] as $valkey => $value_1) + { + // This should cover about any case: + // + // table.field => SELECT table.field FROM table + // table.field AS alias => SELECT table.field AS alias FROM table + // table.field AS table2.alias => SELECT table2.field AS alias FROM table table2 + // table.field AS table2.field => SELECT table2.field FROM table table2 + // + if (preg_match('/^([a-z0-9_]+)\.([a-z0-9_]+)( +AS +(([a-z0-9_]+?)\.)?([a-z0-9_]+))?$/i', $value_1, $m)) + { + // There is 'AS ...' in the field names + if (!empty($m[3])) + { + $value_1 = ($m[2] == $m[6]) ? $m[1] . '.' . $m[2] : $m[1] . '.' . $m[2] . ' AS ' . $m[6]; + + // Table alias: store it then replace the source table with it + if (!empty($m[5]) && $m[5] != $m[1]) + { + $aliases[$m[5]] = $m[1]; + $value_1 = str_replace($m[1] . '.' . $m[2], $m[5] . '.' . $m[2], $value_1); + } + } + else + { + // No table alias + $sql_data['source_tables'][$m[1]] = (empty($convert->src_table_prefix)) ? $m[1] : $convert->src_table_prefix . $m[1] . ' ' . $m[1]; + } + + $sql_data['select_fields'][$value_1] = $value_1; + $sql_data['source_fields'][$key][$valkey] = (!empty($m[6])) ? $m[6] : $m[2]; + } + } + } + else if ($key == 'where' || $key == 'group_by' || $key == 'order_by' || $key == 'having') + { + if (@preg_match_all('/([a-z0-9_]+)\.([a-z0-9_]+)/i', $val, $m)) + { + foreach ($m[1] as $value) + { + $sql_data['source_tables'][$value] = (empty($convert->src_table_prefix)) ? $value : $convert->src_table_prefix . $value . ' ' . $value; + } + } + } + } + + // Add the aliases to the list of tables + foreach ($aliases as $alias => $table) + { + $sql_data['source_tables'][$alias] = $convert->src_table_prefix . $table . ' ' . $alias; + } + + // 'left_join' => 'forums LEFT JOIN forum_prune ON forums.forum_id = forum_prune.forum_id', + if (!empty($schema['left_join'])) + { + if (!is_array($schema['left_join'])) + { + $schema['left_join'] = array($schema['left_join']); + } + + foreach ($schema['left_join'] as $left_join) + { + // This won't handle concatened LEFT JOINs + if (!preg_match('/([a-z0-9_]+) LEFT JOIN ([a-z0-9_]+) A?S? ?([a-z0-9_]*?) ?(ON|USING)(.*)/i', $left_join, $m)) + { + $this->p_master->error(sprintf($user->lang['NOT_UNDERSTAND'], 'LEFT JOIN', $left_join, $current_table, $schema['target']), __LINE__, __FILE__); + } + + if (!empty($aliases[$m[2]])) + { + if (!empty($m[3])) + { + $this->p_master->error(sprintf($user->lang['NAMING_CONFLICT'], $m[2], $m[3], $schema['left_join']), __LINE__, __FILE__); + } + + $m[2] = $aliases[$m[2]]; + $m[3] = $m[2]; + } + + $right_table = $convert->src_table_prefix . $m[2]; + if (!empty($m[3])) + { + unset($sql_data['source_tables'][$m[3]]); + } + else if ($m[2] != $m[1]) + { + unset($sql_data['source_tables'][$m[2]]); + } + + if (strpos($sql_data['source_tables'][$m[1]], "\nLEFT JOIN") !== false) + { + $sql_data['source_tables'][$m[1]] = '(' . $sql_data['source_tables'][$m[1]] . ")\nLEFT JOIN $right_table"; + } + else + { + $sql_data['source_tables'][$m[1]] .= "\nLEFT JOIN $right_table"; + } + + if (!empty($m[3])) + { + unset($sql_data['source_tables'][$m[3]]); + $sql_data['source_tables'][$m[1]] .= ' AS ' . $m[3]; + } + else if (!empty($convert->src_table_prefix)) + { + $sql_data['source_tables'][$m[1]] .= ' AS ' . $m[2]; + } + $sql_data['source_tables'][$m[1]] .= ' ' . $m[4] . $m[5]; + } + } + + // Remove ", " from the end of the insert query + $insert_query = substr($insert_query, 0, -2) . ') VALUES '; + + return $insert_query; + } + + /** + * Function for processing the currently handled row + */ + function process_row(&$schema, &$sql_data, &$insert_values) + { + global $template, $user, $phpbb_root_path, $phpEx, $db, $lang, $config, $cache; + global $convert, $convert_row; + + $sql_flag = false; + + foreach ($schema as $key => $fields) + { + // We are only interested in the lines with: + // array('comment', 'attachments_desc.comment', 'htmlspecialchars'), + if (is_int($key)) + { + if (!is_array($fields[1])) + { + $fields[1] = array($fields[1]); + } + + $firstkey_set = false; + $firstkey = 0; + + foreach ($fields[1] as $inner_key => $inner_value) + { + if (!$firstkey_set) + { + $firstkey = $inner_key; + $firstkey_set = true; + } + + $src_field = isset($sql_data['source_fields'][$key][$inner_key]) ? $sql_data['source_fields'][$key][$inner_key] : ''; + + if (!empty($src_field)) + { + $fields[1][$inner_key] = $convert->row[$src_field]; + } + } + + if (!empty($fields[0])) + { + // We have a target field, if we haven't set $sql_flag yet it will be set to TRUE. + // If a function has already set it to FALSE it won't change it. + if ($sql_flag === false) + { + $sql_flag = true; + } + + // No function assigned? + if (empty($fields[2])) + { + $value = $fields[1][$firstkey]; + } + else if (is_array($fields[2]) && !is_callable($fields[2])) + { + // Execute complex function/eval/typecast + $value = $fields[1]; + + foreach ($fields[2] as $type => $execution) + { + if (strpos($type, 'typecast') === 0) + { + if (!is_array($value)) + { + $value = array($value); + } + $value = $value[0]; + settype($value, $execution); + } + else if (strpos($type, 'function') === 0) + { + if (!is_array($value)) + { + $value = array($value); + } + + $value = call_user_func_array($execution, $value); + } + else if (strpos($type, 'execute') === 0) + { + if (!is_array($value)) + { + $value = array($value); + } + + $execution = str_replace('{RESULT}', '$value', $execution); + $execution = str_replace('{VALUE}', '$value', $execution); + // @codingStandardsIgnoreStart + eval($execution); + // @codingStandardsIgnoreEnd + } + } + } + else + { + $value = call_user_func_array($fields[2], $fields[1]); + } + + if (is_null($value)) + { + $value = ''; + } + + $insert_values[] = $db->_sql_validate_value($value); + } + else if (!empty($fields[2])) + { + if (is_array($fields[2])) + { + // Execute complex function/eval/typecast + $value = ''; + + foreach ($fields[2] as $type => $execution) + { + if (strpos($type, 'typecast') === 0) + { + $value = settype($value, $execution); + } + else if (strpos($type, 'function') === 0) + { + if (!is_array($value)) + { + $value = array($value); + } + + $value = call_user_func_array($execution, $value); + } + else if (strpos($type, 'execute') === 0) + { + if (!is_array($value)) + { + $value = array($value); + } + + $execution = str_replace('{RESULT}', '$value', $execution); + $execution = str_replace('{VALUE}', '$value', $execution); + // @codingStandardsIgnoreStart + eval($execution); + // @codingStandardsIgnoreEnd + } + } + } + else + { + call_user_func_array($fields[2], $fields[1]); + } + } + } + } + + return $sql_flag; + } + + /** + * Own meta refresh function to be able to change the global time used + */ + function meta_refresh($url) + { + global $convert, $template; + + if ($convert->options['refresh']) + { + // Because we should not rely on correct settings, we simply use the relative path here directly. + $template->assign_vars(array( + 'S_REFRESH' => true, + 'META' => '') + ); + } + } + + /** + * The information below will be used to build the input fields presented to the user + */ + var $convert_options = array( + 'legend1' => 'SPECIFY_OPTIONS', + 'src_dbms' => array('lang' => 'DBMS', 'type' => 'select', 'options' => 'dbms_select(\'{VALUE}\', true)', 'explain' => false), + 'src_dbhost' => array('lang' => 'DB_HOST', 'type' => 'text:25:100', 'explain' => true), + 'src_dbport' => array('lang' => 'DB_PORT', 'type' => 'text:25:100', 'explain' => true), + 'src_dbname' => array('lang' => 'DB_NAME', 'type' => 'text:25:100', 'explain' => false), + 'src_dbuser' => array('lang' => 'DB_USERNAME', 'type' => 'text:25:100', 'explain' => false), + 'src_dbpasswd' => array('lang' => 'DB_PASSWORD', 'type' => 'password:25:100', 'explain' => false), + 'src_table_prefix' => array('lang' => 'TABLE_PREFIX', 'type' => 'text:25:100', 'explain' => false), + //'src_url' => array('lang' => 'FORUM_ADDRESS', 'type' => 'text:50:100', 'explain' => true), + 'forum_path' => array('lang' => 'FORUM_PATH', 'type' => 'text:25:100', 'explain' => true), + 'refresh' => array('lang' => 'REFRESH_PAGE', 'type' => 'radio:yes_no', 'explain' => true), + ); +} diff --git a/sources/phpBB/install/install_install.php b/sources/phpBB/install/install_install.php new file mode 100644 index 0000000..3bcf5c4 --- /dev/null +++ b/sources/phpBB/install/install_install.php @@ -0,0 +1,2333 @@ + +* @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_INSTALL')) +{ + // Someone has tried to access the file direct. This is not a good idea, so exit + exit; +} + +if (!empty($setmodules)) +{ + // If phpBB is already installed we do not include this module + if (phpbb_check_installation_exists($phpbb_root_path, $phpEx) && !file_exists($phpbb_root_path . 'cache/install_lock')) + { + return; + } + + $module[] = array( + 'module_type' => 'install', + 'module_title' => 'INSTALL', + 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1), + 'module_order' => 10, + 'module_subs' => '', + 'module_stages' => array('INTRO', 'REQUIREMENTS', 'DATABASE', 'ADMINISTRATOR', 'CONFIG_FILE', 'ADVANCED', 'CREATE_TABLE', 'FINAL'), + 'module_reqs' => '' + ); +} + +/** +* Installation +*/ +class install_install extends module +{ + function install_install(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($mode, $sub) + { + global $lang, $template, $language, $phpbb_root_path, $phpEx; + global $phpbb_container, $cache, $phpbb_log, $request, $phpbb_config_php_file; + + switch ($sub) + { + case 'intro': + $phpbb_container->get('cache.driver')->purge(); + + $this->page_title = $lang['SUB_INTRO']; + + $template->assign_vars(array( + 'TITLE' => $lang['INSTALL_INTRO'], + 'BODY' => $lang['INSTALL_INTRO_BODY'], + 'L_SUBMIT' => $lang['NEXT_STEP'], + 'S_LANG_SELECT' => '', + 'U_ACTION' => $this->p_master->module_url . "?mode=$mode&sub=requirements&language=$language", + )); + + break; + + case 'requirements': + $this->check_server_requirements($mode, $sub); + + break; + + case 'database': + $this->obtain_database_settings($mode, $sub); + + break; + + case 'administrator': + $this->obtain_admin_settings($mode, $sub); + + break; + + case 'config_file': + $this->create_config_file($mode, $sub); + + break; + + case 'advanced': + $this->obtain_advanced_settings($mode, $sub); + + break; + + case 'create_table': + $this->load_schema($mode, $sub); + break; + + case 'final': + // 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(); + + // Sets the global variables + $cache = $phpbb_container->get('cache'); + $phpbb_log = $phpbb_container->get('log'); + + $this->build_search_index($mode, $sub); + $this->add_modules($mode, $sub); + $this->add_language($mode, $sub); + $this->add_bots($mode, $sub); + $this->email_admin($mode, $sub); + $this->disable_avatars_if_unwritable(); + $this->populate_migrations($phpbb_container->get('ext.manager'), $phpbb_container->get('migrator')); + + // Remove the lock file + @unlink($phpbb_root_path . 'cache/install_lock'); + + break; + } + + $this->tpl_name = 'install_install'; + } + + /** + * Checks that the server we are installing on meets the requirements for running phpBB + */ + function check_server_requirements($mode, $sub) + { + global $lang, $template, $phpbb_root_path, $phpEx, $language; + + $this->page_title = $lang['STAGE_REQUIREMENTS']; + + $template->assign_vars(array( + 'TITLE' => $lang['REQUIREMENTS_TITLE'], + 'BODY' => $lang['REQUIREMENTS_EXPLAIN'], + )); + + $passed = array('php' => false, 'db' => false, 'files' => false, 'pcre' => false, 'imagesize' => false, 'json' => false,); + + // Test for basic PHP settings + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['PHP_SETTINGS'], + 'LEGEND_EXPLAIN' => $lang['PHP_SETTINGS_EXPLAIN'], + )); + + // Test the minimum PHP version + $php_version = PHP_VERSION; + + if (version_compare($php_version, '5.3.3') < 0) + { + $result = '' . $lang['NO'] . ''; + } + else + { + $passed['php'] = true; + + // We also give feedback on whether we're running in safe mode + $result = '' . $lang['YES']; + if (@ini_get('safe_mode') == '1' || strtolower(@ini_get('safe_mode')) == 'on') + { + $result .= ', ' . $lang['PHP_SAFE_MODE']; + } + $result .= ''; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['PHP_VERSION_REQD'], + 'RESULT' => $result, + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + + // Don't check for register_globals on 5.4+ + if (version_compare($php_version, '5.4.0-dev') < 0) + { + // Check for register_globals being enabled + if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') + { + $result = '' . $lang['NO'] . ''; + } + else + { + $result = '' . $lang['YES'] . ''; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['PHP_REGISTER_GLOBALS'], + 'TITLE_EXPLAIN' => $lang['PHP_REGISTER_GLOBALS_EXPLAIN'], + 'RESULT' => $result, + + 'S_EXPLAIN' => true, + 'S_LEGEND' => false, + )); + } + + // Check for url_fopen + if (@ini_get('allow_url_fopen') == '1' || strtolower(@ini_get('allow_url_fopen')) == 'on') + { + $result = '' . $lang['YES'] . ''; + } + else + { + $result = '' . $lang['NO'] . ''; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['PHP_URL_FOPEN_SUPPORT'], + 'TITLE_EXPLAIN' => $lang['PHP_URL_FOPEN_SUPPORT_EXPLAIN'], + 'RESULT' => $result, + + 'S_EXPLAIN' => true, + 'S_LEGEND' => false, + )); + + // Check for getimagesize + if (@function_exists('getimagesize')) + { + $passed['imagesize'] = true; + $result = '' . $lang['YES'] . ''; + } + else + { + $result = '' . $lang['NO'] . ''; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['PHP_GETIMAGESIZE_SUPPORT'], + 'TITLE_EXPLAIN' => $lang['PHP_GETIMAGESIZE_SUPPORT_EXPLAIN'], + 'RESULT' => $result, + + 'S_EXPLAIN' => true, + 'S_LEGEND' => false, + )); + + // Check for PCRE UTF-8 support + if (@preg_match('//u', '')) + { + $passed['pcre'] = true; + $result = '' . $lang['YES'] . ''; + } + else + { + $result = '' . $lang['NO'] . ''; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['PCRE_UTF_SUPPORT'], + 'TITLE_EXPLAIN' => $lang['PCRE_UTF_SUPPORT_EXPLAIN'], + 'RESULT' => $result, + + 'S_EXPLAIN' => true, + 'S_LEGEND' => false, + )); + + // Check for php json support + if (@extension_loaded('json')) + { + $passed['json'] = true; + $result = '' . $lang['YES'] . ''; + } + else + { + $result = '' . $lang['NO'] . ''; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['PHP_JSON_SUPPORT'], + 'TITLE_EXPLAIN' => $lang['PHP_JSON_SUPPORT_EXPLAIN'], + 'RESULT' => $result, + + 'S_EXPLAIN' => true, + 'S_LEGEND' => false, + )); + + $passed['mbstring'] = true; + if (@extension_loaded('mbstring')) + { + // Test for available database modules + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['MBSTRING_CHECK'], + 'LEGEND_EXPLAIN' => $lang['MBSTRING_CHECK_EXPLAIN'], + )); + + $checks = array( + array('func_overload', '&', MB_OVERLOAD_MAIL|MB_OVERLOAD_STRING), + array('encoding_translation', '!=', 0), + array('http_input', '!=', array('pass', '')), + array('http_output', '!=', array('pass', '')) + ); + + foreach ($checks as $mb_checks) + { + $ini_val = @ini_get('mbstring.' . $mb_checks[0]); + switch ($mb_checks[1]) + { + case '&': + if (intval($ini_val) & $mb_checks[2]) + { + $result = '' . $lang['NO'] . ''; + $passed['mbstring'] = false; + } + else + { + $result = '' . $lang['YES'] . ''; + } + break; + + case '!=': + if (!is_array($mb_checks[2]) && $ini_val != $mb_checks[2] || + is_array($mb_checks[2]) && !in_array($ini_val, $mb_checks[2])) + { + $result = '' . $lang['NO'] . ''; + $passed['mbstring'] = false; + } + else + { + $result = '' . $lang['YES'] . ''; + } + break; + } + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['MBSTRING_' . strtoupper($mb_checks[0])], + 'TITLE_EXPLAIN' => $lang['MBSTRING_' . strtoupper($mb_checks[0]) . '_EXPLAIN'], + 'RESULT' => $result, + + 'S_EXPLAIN' => true, + 'S_LEGEND' => false, + )); + } + } + + // Test for available database modules + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['PHP_SUPPORTED_DB'], + 'LEGEND_EXPLAIN' => $lang['PHP_SUPPORTED_DB_EXPLAIN'], + )); + + $available_dbms = get_available_dbms(false, true); + $passed['db'] = $available_dbms['ANY_DB_SUPPORT']; + unset($available_dbms['ANY_DB_SUPPORT']); + + foreach ($available_dbms as $db_name => $db_ary) + { + if (!$db_ary['AVAILABLE']) + { + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['DLL_' . strtoupper($db_name)], + 'RESULT' => '' . $lang['UNAVAILABLE'] . '', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + else + { + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['DLL_' . strtoupper($db_name)], + 'RESULT' => '' . $lang['AVAILABLE'] . '', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + } + + // Test for other modules + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['PHP_OPTIONAL_MODULE'], + 'LEGEND_EXPLAIN' => $lang['PHP_OPTIONAL_MODULE_EXPLAIN'], + )); + + foreach ($this->php_dlls_other as $dll) + { + if (!@extension_loaded($dll)) + { + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['DLL_' . strtoupper($dll)], + 'RESULT' => '' . $lang['UNAVAILABLE'] . '', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + continue; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['DLL_' . strtoupper($dll)], + 'RESULT' => '' . $lang['AVAILABLE'] . '', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + + // 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); + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['APP_MAGICK'], + 'RESULT' => ($img_imagick) ? '' . $lang['AVAILABLE'] . ', ' . $img_imagick . '' : '' . $lang['NO_LOCATION'] . '', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + + // Check permissions on files/directories we need access to + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['FILES_REQUIRED'], + 'LEGEND_EXPLAIN' => $lang['FILES_REQUIRED_EXPLAIN'], + )); + + $directories = array('cache/', 'files/', 'store/'); + + umask(0); + + $passed['files'] = true; + foreach ($directories as $dir) + { + $exists = $write = false; + + // Try to create the directory if it does not exist + if (!file_exists($phpbb_root_path . $dir)) + { + @mkdir($phpbb_root_path . $dir, 0777); + phpbb_chmod($phpbb_root_path . $dir, CHMOD_READ | CHMOD_WRITE); + } + + // 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); + $exists = true; + } + + // Now check if it is writable by storing a simple file + $fp = @fopen($phpbb_root_path . $dir . 'test_lock', 'wb'); + if ($fp !== false) + { + $write = true; + } + @fclose($fp); + + @unlink($phpbb_root_path . $dir . 'test_lock'); + + $passed['files'] = ($exists && $write && $passed['files']) ? true : false; + + $exists = ($exists) ? '' . $lang['FOUND'] . '' : '' . $lang['NOT_FOUND'] . ''; + $write = ($write) ? ', ' . $lang['WRITABLE'] . '' : (($exists) ? ', ' . $lang['UNWRITABLE'] . '' : ''); + + $template->assign_block_vars('checks', array( + 'TITLE' => $dir, + 'RESULT' => $exists . $write, + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + + // Check permissions on files/directories it would be useful access to + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['FILES_OPTIONAL'], + 'LEGEND_EXPLAIN' => $lang['FILES_OPTIONAL_EXPLAIN'], + )); + + $directories = array('config.' . $phpEx, 'images/avatars/upload/'); + + foreach ($directories as $dir) + { + $write = $exists = true; + if (file_exists($phpbb_root_path . $dir)) + { + if (!phpbb_is_writable($phpbb_root_path . $dir)) + { + $write = false; + } + } + else + { + $write = $exists = false; + } + + $exists_str = ($exists) ? '' . $lang['FOUND'] . '' : '' . $lang['NOT_FOUND'] . ''; + $write_str = ($write) ? ', ' . $lang['WRITABLE'] . '' : (($exists) ? ', ' . $lang['UNWRITABLE'] . '' : ''); + + $template->assign_block_vars('checks', array( + 'TITLE' => $dir, + 'RESULT' => $exists_str . $write_str, + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + + // And finally where do we want to go next (well today is taken isn't it :P) + $s_hidden_fields = ($img_imagick) ? '' : ''; + + $url = (!in_array(false, $passed)) ? $this->p_master->module_url . "?mode=$mode&sub=database&language=$language" : $this->p_master->module_url . "?mode=$mode&sub=requirements&language=$language "; + $submit = (!in_array(false, $passed)) ? $lang['INSTALL_START'] : $lang['INSTALL_TEST']; + + $template->assign_vars(array( + 'L_SUBMIT' => $submit, + 'S_HIDDEN' => $s_hidden_fields, + 'U_ACTION' => $url, + )); + } + + /** + * Obtain the information required to connect to the database + */ + function obtain_database_settings($mode, $sub) + { + global $lang, $template, $phpEx; + + $this->page_title = $lang['STAGE_DATABASE']; + + // Obtain any submitted data + $data = $this->get_submitted_data(); + + $connect_test = false; + $error = array(); + $available_dbms = get_available_dbms(false, true); + + // Has the user opted to test the connection? + if (isset($_POST['testdb'])) + { + if (!isset($available_dbms[$data['dbms']]) || !$available_dbms[$data['dbms']]['AVAILABLE']) + { + $error[] = $lang['INST_ERR_NO_DB']; + $connect_test = false; + } + else if (!preg_match(get_preg_expression('table_prefix'), $data['table_prefix'])) + { + $error[] = $lang['INST_ERR_DB_INVALID_PREFIX']; + $connect_test = false; + } + else + { + $connect_test = connect_check_db(true, $error, $available_dbms[$data['dbms']], $data['table_prefix'], $data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport']); + } + + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['DB_CONNECTION'], + 'LEGEND_EXPLAIN' => false, + )); + + if ($connect_test) + { + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['DB_TEST'], + 'RESULT' => '' . $lang['SUCCESSFUL_CONNECT'] . '', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + else + { + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['DB_TEST'], + 'RESULT' => '' . implode('
', $error) . '
', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + } + + if (!$connect_test) + { + // Update the list of available DBMS modules to only contain those which can be used + $available_dbms_temp = array(); + foreach ($available_dbms as $type => $dbms_ary) + { + if (!$dbms_ary['AVAILABLE']) + { + continue; + } + + $available_dbms_temp[$type] = $dbms_ary; + } + + $available_dbms = &$available_dbms_temp; + + // And now for the main part of this page + $data['table_prefix'] = (!empty($data['table_prefix']) ? $data['table_prefix'] : 'phpbb_'); + + foreach ($this->db_config_options as $config_key => $vars) + { + if (!is_array($vars) && strpos($config_key, 'legend') === false) + { + continue; + } + + if (strpos($config_key, 'legend') !== false) + { + $template->assign_block_vars('options', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang[$vars]) + ); + + continue; + } + + $options = isset($vars['options']) ? $vars['options'] : ''; + + $template->assign_block_vars('options', array( + 'KEY' => $config_key, + 'TITLE' => $lang[$vars['lang']], + 'S_EXPLAIN' => $vars['explain'], + 'S_LEGEND' => false, + 'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '', + 'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], $data[$config_key], $options), + ) + ); + } + } + + // And finally where do we want to go next (well today is taken isn't it :P) + $s_hidden_fields = ($data['img_imagick']) ? '' : ''; + $s_hidden_fields .= ''; + if ($connect_test) + { + foreach ($this->db_config_options as $config_key => $vars) + { + if (!is_array($vars)) + { + continue; + } + $s_hidden_fields .= ''; + } + } + + $url = ($connect_test) ? $this->p_master->module_url . "?mode=$mode&sub=administrator" : $this->p_master->module_url . "?mode=$mode&sub=database"; + $s_hidden_fields .= ($connect_test) ? '' : ''; + + $submit = $lang['NEXT_STEP']; + + $template->assign_vars(array( + 'L_SUBMIT' => $submit, + 'S_HIDDEN' => $s_hidden_fields, + 'U_ACTION' => $url, + )); + } + + /** + * Obtain the administrator's name, password and email address + */ + function obtain_admin_settings($mode, $sub) + { + global $lang, $template, $phpEx; + + $this->page_title = $lang['STAGE_ADMINISTRATOR']; + + // Obtain any submitted data + $data = $this->get_submitted_data(); + + if ($data['dbms'] == '') + { + // Someone's been silly and tried calling this page direct + // So we send them back to the start to do it again properly + $this->p_master->redirect("index.$phpEx?mode=install"); + } + + $s_hidden_fields = ($data['img_imagick']) ? '' : ''; + $passed = false; + + $data['default_lang'] = ($data['default_lang'] !== '') ? $data['default_lang'] : $data['language']; + + if (isset($_POST['check'])) + { + $error = array(); + + // Check the entered email address and password + if ($data['admin_name'] == '' || $data['admin_pass1'] == '' || $data['admin_pass2'] == '' || $data['board_email'] == '') + { + $error[] = $lang['INST_ERR_MISSING_DATA']; + } + + if ($data['admin_pass1'] != $data['admin_pass2'] && $data['admin_pass1'] != '') + { + $error[] = $lang['INST_ERR_PASSWORD_MISMATCH']; + } + + // Test against the default username rules + if ($data['admin_name'] != '' && utf8_strlen($data['admin_name']) < 3) + { + $error[] = $lang['INST_ERR_USER_TOO_SHORT']; + } + + if ($data['admin_name'] != '' && utf8_strlen($data['admin_name']) > 20) + { + $error[] = $lang['INST_ERR_USER_TOO_LONG']; + } + + // Test against the default password rules + if ($data['admin_pass1'] != '' && utf8_strlen($data['admin_pass1']) < 6) + { + $error[] = $lang['INST_ERR_PASSWORD_TOO_SHORT']; + } + + if ($data['admin_pass1'] != '' && utf8_strlen($data['admin_pass1']) > 30) + { + $error[] = $lang['INST_ERR_PASSWORD_TOO_LONG']; + } + + if ($data['board_email'] != '' && !preg_match('/^' . get_preg_expression('email') . '$/i', $data['board_email'])) + { + $error[] = $lang['INST_ERR_EMAIL_INVALID']; + } + + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['STAGE_ADMINISTRATOR'], + 'LEGEND_EXPLAIN' => false, + )); + + if (!sizeof($error)) + { + $passed = true; + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['ADMIN_TEST'], + 'RESULT' => '' . $lang['TESTS_PASSED'] . '', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + else + { + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['ADMIN_TEST'], + 'RESULT' => '' . implode('
', $error) . '
', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + } + + if (!$passed) + { + foreach ($this->admin_config_options as $config_key => $vars) + { + if (!is_array($vars) && strpos($config_key, 'legend') === false) + { + continue; + } + + if (strpos($config_key, 'legend') !== false) + { + $template->assign_block_vars('options', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang[$vars]) + ); + + continue; + } + + $options = isset($vars['options']) ? $vars['options'] : ''; + + $template->assign_block_vars('options', array( + 'KEY' => $config_key, + 'TITLE' => $lang[$vars['lang']], + 'S_EXPLAIN' => $vars['explain'], + 'S_LEGEND' => false, + 'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '', + 'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], $data[$config_key], $options), + ) + ); + } + } + else + { + foreach ($this->admin_config_options as $config_key => $vars) + { + if (!is_array($vars)) + { + continue; + } + $s_hidden_fields .= ''; + } + } + + $s_hidden_fields .= ($data['img_imagick']) ? '' : ''; + $s_hidden_fields .= ''; + + foreach ($this->db_config_options as $config_key => $vars) + { + if (!is_array($vars)) + { + continue; + } + $s_hidden_fields .= ''; + } + + $submit = $lang['NEXT_STEP']; + + $url = ($passed) ? $this->p_master->module_url . "?mode=$mode&sub=config_file" : $this->p_master->module_url . "?mode=$mode&sub=administrator"; + $s_hidden_fields .= ($passed) ? '' : ''; + + $template->assign_vars(array( + 'L_SUBMIT' => $submit, + 'S_HIDDEN' => $s_hidden_fields, + 'U_ACTION' => $url, + )); + } + + /** + * Writes the config file to disk, or if unable to do so offers alternative methods + */ + function create_config_file($mode, $sub) + { + global $lang, $template, $phpbb_root_path, $phpEx; + + $this->page_title = $lang['STAGE_CONFIG_FILE']; + + // Obtain any submitted data + $data = $this->get_submitted_data(); + + if ($data['dbms'] == '') + { + // Someone's been silly and tried calling this page direct + // So we send them back to the start to do it again properly + $this->p_master->redirect("index.$phpEx?mode=install"); + } + + $s_hidden_fields = ($data['img_imagick']) ? '' : ''; + $s_hidden_fields .= ''; + $written = false; + + // Create a list of any PHP modules we wish to have loaded + $available_dbms = get_available_dbms($data['dbms']); + + // Create a lock file to indicate that there is an install in progress + $fp = @fopen($phpbb_root_path . 'cache/install_lock', 'wb'); + if ($fp === false) + { + // We were unable to create the lock file - abort + $this->p_master->error($lang['UNABLE_WRITE_LOCK'], __LINE__, __FILE__); + } + @fclose($fp); + + @chmod($phpbb_root_path . 'cache/install_lock', 0777); + + // Time to convert the data provided into a config file + $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)) + { + // Assume it will work ... if nothing goes wrong below + $written = true; + + if (!($fp = @fopen($phpbb_root_path . 'config.' . $phpEx, 'w'))) + { + // Something went wrong ... so let's try another method + $written = false; + } + + if (!(@fwrite($fp, $config_data))) + { + // Something went wrong ... so let's try another method + $written = false; + } + + @fclose($fp); + + 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); + } + } + + if (isset($_POST['dldone'])) + { + // Do a basic check to make sure that the file has been uploaded + // Note that all we check is that the file has _something_ in it + // We don't compare the contents exactly - if they can't upload + // a single file correctly, it's likely they will have other problems.... + if (filesize($phpbb_root_path . 'config.' . $phpEx) > 10) + { + $written = true; + } + } + + $config_options = array_merge($this->db_config_options, $this->admin_config_options); + + foreach ($config_options as $config_key => $vars) + { + if (!is_array($vars)) + { + continue; + } + $s_hidden_fields .= ''; + } + + if (!$written) + { + // OK, so it didn't work let's try the alternatives + + if (isset($_POST['dlconfig'])) + { + // They want a copy of the file to download, so send the relevant headers and dump out the data + header("Content-Type: text/x-delimtext; name=\"config.$phpEx\""); + header("Content-disposition: attachment; filename=config.$phpEx"); + echo $config_data; + exit; + } + + // The option to download the config file is always available, so output it here + $template->assign_vars(array( + 'BODY' => $lang['CONFIG_FILE_UNABLE_WRITE'], + 'L_DL_CONFIG' => $lang['DL_CONFIG'], + 'L_DL_CONFIG_EXPLAIN' => $lang['DL_CONFIG_EXPLAIN'], + 'L_DL_DONE' => $lang['DONE'], + 'L_DL_DOWNLOAD' => $lang['DL_DOWNLOAD'], + 'S_HIDDEN' => $s_hidden_fields, + 'S_SHOW_DOWNLOAD' => true, + 'U_ACTION' => $this->p_master->module_url . "?mode=$mode&sub=config_file", + )); + return; + } + else + { + $template->assign_vars(array( + 'BODY' => $lang['CONFIG_FILE_WRITTEN'], + 'L_SUBMIT' => $lang['NEXT_STEP'], + 'S_HIDDEN' => $s_hidden_fields, + 'U_ACTION' => $this->p_master->module_url . "?mode=$mode&sub=advanced", + )); + return; + } + } + + /** + * Provide an opportunity to customise some advanced settings during the install + * in case it is necessary for them to be set to access later + */ + function obtain_advanced_settings($mode, $sub) + { + global $lang, $template, $phpEx, $request; + + $this->page_title = $lang['STAGE_ADVANCED']; + + // Obtain any submitted data + $data = $this->get_submitted_data(); + + if ($data['dbms'] == '') + { + // Someone's been silly and tried calling this page direct + // So we send them back to the start to do it again properly + $this->p_master->redirect("index.$phpEx?mode=install"); + } + + $s_hidden_fields = ($data['img_imagick']) ? '' : ''; + $s_hidden_fields .= ''; + + // HTTP_HOST is having the correct browser url in most cases... + $server_name = strtolower(htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME')))); + + // HTTP HOST can carry a port number... + if (strpos($server_name, ':') !== false) + { + $server_name = substr($server_name, 0, strpos($server_name, ':')); + } + + $data['email_enable'] = ($data['email_enable'] !== '') ? $data['email_enable'] : true; + $data['server_name'] = ($data['server_name'] !== '') ? $data['server_name'] : $server_name; + $data['server_port'] = ($data['server_port'] !== '') ? $data['server_port'] : $request->server('SERVER_PORT', 0); + $data['server_protocol'] = ($data['server_protocol'] !== '') ? $data['server_protocol'] : ($request->is_secure() ? 'https://' : 'http://'); + $data['cookie_secure'] = ($data['cookie_secure'] !== '') ? $data['cookie_secure'] : $request->is_secure(); + + if ($data['script_path'] === '') + { + $name = htmlspecialchars_decode($request->server('PHP_SELF')); + if (!$name) + { + $name = htmlspecialchars_decode($request->server('REQUEST_URI')); + } + + // Replace backslashes and doubled slashes (could happen on some proxy setups) + $name = str_replace(array('\\', '//'), '/', $name); + $data['script_path'] = trim(dirname(dirname($name))); + } + + foreach ($this->advanced_config_options as $config_key => $vars) + { + if (!is_array($vars) && strpos($config_key, 'legend') === false) + { + continue; + } + + if (strpos($config_key, 'legend') !== false) + { + $template->assign_block_vars('options', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang[$vars]) + ); + + continue; + } + + $options = isset($vars['options']) ? $vars['options'] : ''; + + $template->assign_block_vars('options', array( + 'KEY' => $config_key, + 'TITLE' => $lang[$vars['lang']], + 'S_EXPLAIN' => $vars['explain'], + 'S_LEGEND' => false, + 'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '', + 'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], $data[$config_key], $options), + ) + ); + } + + $config_options = array_merge($this->db_config_options, $this->admin_config_options); + foreach ($config_options as $config_key => $vars) + { + if (!is_array($vars)) + { + continue; + } + $s_hidden_fields .= ''; + } + + $submit = $lang['NEXT_STEP']; + + $url = $this->p_master->module_url . "?mode=$mode&sub=create_table"; + + $template->assign_vars(array( + 'BODY' => $lang['STAGE_ADVANCED_EXPLAIN'], + 'L_SUBMIT' => $submit, + 'S_HIDDEN' => $s_hidden_fields, + 'U_ACTION' => $url, + )); + } + + /** + * Load the contents of the schema into the database and then alter it based on what has been input during the installation + */ + function load_schema($mode, $sub) + { + global $db, $lang, $template, $phpbb_root_path, $phpEx, $request; + + $this->page_title = $lang['STAGE_CREATE_TABLE']; + $s_hidden_fields = ''; + + // Obtain any submitted data + $data = $this->get_submitted_data(); + + if ($data['dbms'] == '') + { + // Someone's been silly and tried calling this page direct + // So we send them back to the start to do it again properly + $this->p_master->redirect("index.$phpEx?mode=install"); + } + + // HTTP_HOST is having the correct browser url in most cases... + $server_name = strtolower(htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME')))); + $referer = strtolower($request->header('Referer')); + + // HTTP HOST can carry a port number... + if (strpos($server_name, ':') !== false) + { + $server_name = substr($server_name, 0, strpos($server_name, ':')); + } + + $cookie_domain = ($data['server_name'] != '') ? $data['server_name'] : $server_name; + + // Try to come up with the best solution for cookie domain... + if (strpos($cookie_domain, 'www.') === 0) + { + $cookie_domain = str_replace('www.', '.', $cookie_domain); + } + + // If we get here and the extension isn't loaded it should be safe to just go ahead and load it + $available_dbms = get_available_dbms($data['dbms']); + + if (!isset($available_dbms[$data['dbms']])) + { + // Someone's been silly and tried providing a non-existant dbms + $this->p_master->redirect("index.$phpEx?mode=install"); + } + + $dbms = $available_dbms[$data['dbms']]['DRIVER']; + + // Instantiate the database + $db = new $dbms(); + $db->sql_connect($data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport'], false, false); + + // NOTE: trigger_error does not work here. + $db->sql_return_on_error(true); + + // If mysql is chosen, we need to adjust the schema filename slightly to reflect the correct version. ;) + if ($data['dbms'] == 'mysql') + { + if (version_compare($db->sql_server_info(true), '4.1.3', '>=')) + { + $available_dbms[$data['dbms']]['SCHEMA'] .= '_41'; + } + else + { + $available_dbms[$data['dbms']]['SCHEMA'] .= '_40'; + } + } + + // Ok we have the db info go ahead and read in the relevant schema + // and work on building the table + $dbms_schema = 'schemas/' . $available_dbms[$data['dbms']]['SCHEMA'] . '_schema.sql'; + + // How should we treat this schema? + $delimiter = $available_dbms[$data['dbms']]['DELIM']; + + if (file_exists($dbms_schema)) + { + $sql_query = @file_get_contents($dbms_schema); + $sql_query = preg_replace('#phpbb_#i', $data['table_prefix'], $sql_query); + $sql_query = phpbb_remove_comments($sql_query); + $sql_query = split_sql_file($sql_query, $delimiter); + + foreach ($sql_query as $sql) + { + //$sql = trim(str_replace('|', ';', $sql)); + if (!$db->sql_query($sql)) + { + $error = $db->sql_error(); + $this->p_master->db_error($error['message'], $sql, __LINE__, __FILE__); + } + } + unset($sql_query); + } + + // Ok we have the db info go ahead and work on building the table + if (file_exists('schemas/schema.json')) + { + $db_table_schema = @file_get_contents('schemas/schema.json'); + $db_table_schema = json_decode($db_table_schema, true); + } + else + { + global $phpbb_root_path, $phpEx, $table_prefix; + $table_prefix = 'phpbb_'; + + if (!defined('CONFIG_TABLE')) + { + // We need to include the constants file for the table constants + // when we generate the schema from the migration files. + include($phpbb_root_path . 'includes/constants.' . $phpEx); + } + + $finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path, null, $phpEx); + $classes = $finder->core_path('phpbb/db/migration/data/') + ->get_classes(); + + $sqlite_db = new \phpbb\db\driver\sqlite(); + $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $sqlite_db, new \phpbb\db\tools($sqlite_db, true), $phpbb_root_path, $phpEx, $table_prefix); + $db_table_schema = $schema_generator->get_schema(); + } + + if (!defined('CONFIG_TABLE')) + { + // 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', $data['table_prefix'] . 'config'); + } + + $db_tools = new \phpbb\db\tools($db); + foreach ($db_table_schema as $table_name => $table_data) + { + $db_tools->sql_create_table( + $data['table_prefix'] . substr($table_name, 6), + $table_data + ); + } + + // Ok tables have been built, let's fill in the basic information + $sql_query = file_get_contents('schemas/schema_data.sql'); + + // Deal with any special comments and characters + switch ($data['dbms']) + { + case 'mssql': + case 'mssql_odbc': + case 'mssqlnative': + $sql_query = preg_replace('#\# MSSQL IDENTITY (phpbb_[a-z_]+) (ON|OFF) \##s', 'SET IDENTITY_INSERT \1 \2;', $sql_query); + break; + + case 'postgres': + $sql_query = preg_replace('#\# POSTGRES (BEGIN|COMMIT) \##s', '\1; ', $sql_query); + break; + + case 'mysql': + case 'mysqli': + $sql_query = str_replace('\\', '\\\\', $sql_query); + break; + } + + // Change prefix + $sql_query = preg_replace('# phpbb_([^\s]*) #i', ' ' . $data['table_prefix'] . '\1 ', $sql_query); + + // Change language strings... + $sql_query = preg_replace_callback('#\{L_([A-Z0-9\-_]*)\}#s', 'adjust_language_keys_callback', $sql_query); + + $sql_query = phpbb_remove_comments($sql_query); + $sql_query = split_sql_file($sql_query, ';'); + + foreach ($sql_query as $sql) + { + //$sql = trim(str_replace('|', ';', $sql)); + if (!$db->sql_query($sql)) + { + $error = $db->sql_error(); + $this->p_master->db_error($error['message'], $sql, __LINE__, __FILE__); + } + } + unset($sql_query); + + $current_time = time(); + + $user_ip = $request->server('REMOTE_ADDR') ? phpbb_ip_normalise($request->server('REMOTE_ADDR')) : ''; + + if ($data['script_path'] !== '/') + { + // Adjust destination path (no trailing slash) + if (substr($data['script_path'], -1) == '/') + { + $data['script_path'] = substr($data['script_path'], 0, -1); + } + + $data['script_path'] = str_replace(array('../', './'), '', $data['script_path']); + + if ($data['script_path'][0] != '/') + { + $data['script_path'] = '/' . $data['script_path']; + } + } + + // Set default config and post data, this applies to all DB's + $sql_ary = array( + 'INSERT INTO ' . $data['table_prefix'] . "config (config_name, config_value) + VALUES ('board_startdate', '$current_time')", + + 'INSERT INTO ' . $data['table_prefix'] . "config (config_name, config_value) + VALUES ('default_lang', '" . $db->sql_escape($data['default_lang']) . "')", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['img_imagick']) . "' + WHERE config_name = 'img_imagick'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['server_name']) . "' + WHERE config_name = 'server_name'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['server_port']) . "' + WHERE config_name = 'server_port'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['board_email']) . "' + WHERE config_name = 'board_email'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['board_email']) . "' + WHERE config_name = 'board_contact'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($cookie_domain) . "' + WHERE config_name = 'cookie_domain'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($lang['default_dateformat']) . "' + WHERE config_name = 'default_dateformat'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['email_enable']) . "' + WHERE config_name = 'email_enable'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['smtp_delivery']) . "' + WHERE config_name = 'smtp_delivery'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['smtp_host']) . "' + WHERE config_name = 'smtp_host'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['smtp_auth']) . "' + WHERE config_name = 'smtp_auth_method'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['smtp_user']) . "' + WHERE config_name = 'smtp_username'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['smtp_pass']) . "' + WHERE config_name = 'smtp_password'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['cookie_secure']) . "' + WHERE config_name = 'cookie_secure'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['force_server_vars']) . "' + WHERE config_name = 'force_server_vars'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['script_path']) . "' + WHERE config_name = 'script_path'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['server_protocol']) . "' + WHERE config_name = 'server_protocol'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['admin_name']) . "' + WHERE config_name = 'newest_username'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . md5(mt_rand()) . "' + WHERE config_name = 'avatar_salt'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . md5(mt_rand()) . "' + WHERE config_name = 'plupload_salt'", + + 'UPDATE ' . $data['table_prefix'] . "users + SET username = '" . $db->sql_escape($data['admin_name']) . "', user_password='" . $db->sql_escape(md5($data['admin_pass1'])) . "', user_ip = '" . $db->sql_escape($user_ip) . "', user_lang = '" . $db->sql_escape($data['default_lang']) . "', user_email='" . $db->sql_escape($data['board_email']) . "', user_dateformat='" . $db->sql_escape($lang['default_dateformat']) . "', user_email_hash = " . $db->sql_escape(phpbb_email_hash($data['board_email'])) . ", username_clean = '" . $db->sql_escape(utf8_clean_string($data['admin_name'])) . "' + WHERE username = 'Admin'", + + 'UPDATE ' . $data['table_prefix'] . "moderator_cache + SET username = '" . $db->sql_escape($data['admin_name']) . "' + WHERE username = 'Admin'", + + 'UPDATE ' . $data['table_prefix'] . "forums + SET forum_last_poster_name = '" . $db->sql_escape($data['admin_name']) . "' + WHERE forum_last_poster_name = 'Admin'", + + 'UPDATE ' . $data['table_prefix'] . "topics + SET topic_first_poster_name = '" . $db->sql_escape($data['admin_name']) . "', topic_last_poster_name = '" . $db->sql_escape($data['admin_name']) . "' + WHERE topic_first_poster_name = 'Admin' + OR topic_last_poster_name = 'Admin'", + + 'UPDATE ' . $data['table_prefix'] . "users + SET user_regdate = $current_time", + + 'UPDATE ' . $data['table_prefix'] . "posts + SET post_time = $current_time, poster_ip = '" . $db->sql_escape($user_ip) . "'", + + 'UPDATE ' . $data['table_prefix'] . "topics + SET topic_time = $current_time, topic_last_post_time = $current_time", + + 'UPDATE ' . $data['table_prefix'] . "forums + SET forum_last_post_time = $current_time", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($db->sql_server_info(true)) . "' + WHERE config_name = 'dbms_version'", + ); + + if (@extension_loaded('gd')) + { + $sql_ary[] = 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = 'core.captcha.plugins.gd' + WHERE config_name = 'captcha_plugin'"; + + $sql_ary[] = 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '1' + WHERE config_name = 'captcha_gd'"; + } + + $ref = substr($referer, strpos($referer, '://') + 3); + + if (!(stripos($ref, $server_name) === 0)) + { + $sql_ary[] = 'UPDATE ' . $data['table_prefix'] . "config + 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 ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($cookie_name) . "' + WHERE config_name = 'cookie_name'"; + + foreach ($sql_ary as $sql) + { + //$sql = trim(str_replace('|', ';', $sql)); + + if (!$db->sql_query($sql)) + { + $error = $db->sql_error(); + $this->p_master->db_error($error['message'], $sql, __LINE__, __FILE__); + } + } + + $submit = $lang['NEXT_STEP']; + + $url = $this->p_master->module_url . "?mode=$mode&sub=final"; + + $template->assign_vars(array( + 'BODY' => $lang['STAGE_CREATE_TABLE_EXPLAIN'], + 'L_SUBMIT' => $submit, + 'S_HIDDEN' => build_hidden_fields($data), + 'U_ACTION' => $url, + )); + } + + /** + * Build the search index... + */ + function build_search_index($mode, $sub) + { + global $db, $lang, $phpbb_root_path, $phpEx, $config, $auth, $user; + + // Obtain any submitted data + $data = $this->get_submitted_data(); + $table_prefix = $data['table_prefix']; + + // If we get here and the extension isn't loaded it should be safe to just go ahead and load it + $available_dbms = get_available_dbms($data['dbms']); + + if (!isset($available_dbms[$data['dbms']])) + { + // Someone's been silly and tried providing a non-existant dbms + $this->p_master->redirect("index.$phpEx?mode=install"); + } + + $dbms = $available_dbms[$data['dbms']]['DRIVER']; + + // Instantiate the database + $db = new $dbms(); + $db->sql_connect($data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport'], false, false); + + // NOTE: trigger_error does not work here. + $db->sql_return_on_error(true); + + include_once($phpbb_root_path . 'includes/constants.' . $phpEx); + 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); + + $error = false; + $search = new \phpbb\search\fulltext_native($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); + + $sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id + FROM ' . POSTS_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id'], $row['forum_id']); + } + $db->sql_freeresult($result); + } + + /** + * Populate the module tables + */ + function add_modules($mode, $sub) + { + global $db, $lang, $phpbb_root_path, $phpEx, $phpbb_extension_manager, $config, $phpbb_container; + + // modules require an extension manager + if (empty($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_classes = array('acp', 'mcp', 'ucp'); + + // Add categories + foreach ($module_classes as $module_class) + { + $categories = array(); + + // Set the module class + $_module->module_class = $module_class; + + foreach ($this->module_categories[$module_class] as $cat_name => $subs) + { + $basename = ''; + // Check if this sub-category has a basename. If it has, use it. + if (isset($this->module_categories_basenames[$cat_name])) + { + $basename = $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' => '', + ); + + // Add category + $_module->update_module_data($module_data, true); + + // Check for last sql error happened + if ($db->get_sql_error_triggered()) + { + $error = $db->sql_error($db->get_sql_error_sql()); + $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__); + } + + $categories[$cat_name]['id'] = (int) $module_data['module_id']; + $categories[$cat_name]['parent_id'] = 0; + + // Create sub-categories... + if (is_array($subs)) + { + foreach ($subs as $level2_name) + { + $basename = ''; + // Check if this sub-category has a basename. If it has, use it. + if (isset($this->module_categories_basenames[$level2_name])) + { + $basename = $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' => '', + ); + + $_module->update_module_data($module_data, true); + + // Check for last sql error happened + if ($db->get_sql_error_triggered()) + { + $error = $db->sql_error($db->get_sql_error_sql()); + $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__); + } + + $categories[$level2_name]['id'] = (int) $module_data['module_id']; + $categories[$level2_name]['parent_id'] = (int) $categories[$cat_name]['id']; + } + } + } + + // Get the modules we want to add... returned sorted by name + $module_info = $_module->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'], + ); + + $_module->update_module_data($module_data, true); + + // Check for last sql error happened + if ($db->get_sql_error_triggered()) + { + $error = $db->sql_error($db->get_sql_error_sql()); + $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__); + } + } + } + } + + // 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 = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, '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 = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, '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 = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_up', 5); + + // Move extension management module 1 up... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_langname = 'ACP_EXTENSION_MANAGEMENT' + AND module_class = 'acp' + AND module_mode = '' + AND module_basename = ''"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_up', 1); + } + + if ($module_class == 'mcp') + { + // Move pm report details module 3 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'mcp_pm_reports' + AND module_class = 'mcp' + AND module_mode = 'pm_report_details'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_down', 3); + + // Move closed pm reports module 3 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'mcp_pm_reports' + AND module_class = 'mcp' + AND module_mode = 'pm_reports_closed'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_down', 3); + + // Move open pm reports module 3 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'mcp_pm_reports' + AND module_class = 'mcp' + AND module_mode = 'pm_reports'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_down', 3); + } + + if ($module_class == 'ucp') + { + // Move attachment module 4 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'ucp_attachments' + AND module_class = 'ucp' + AND module_mode = 'attachments'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_down', 4); + + // Move notification options module 4 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'ucp_notifications' + AND module_class = 'ucp' + AND module_mode = 'notification_options'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_down', 4); + + // Move OAuth module 5 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'ucp_auth_link' + AND module_class = 'ucp' + AND module_mode = 'auth_link'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_down', 5); + } + + // And now for the special ones + // (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 = '" . $db->sql_escape($cat_name) . "' + AND module_class = '" . $db->sql_escape($module_class) . "'"; + $result = $db->sql_query_limit($sql, 1); + $row2 = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + foreach ($mods as $mod_name) + { + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_langname = '" . $db->sql_escape($mod_name) . "' + AND module_class = '" . $db->sql_escape($module_class) . "' + AND module_basename <> ''"; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $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'], + ); + + $_module->update_module_data($module_data, true); + + // Check for last sql error happened + if ($db->get_sql_error_triggered()) + { + $error = $db->sql_error($db->get_sql_error_sql()); + $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__); + } + } + } + } + + $_module->remove_cache_file(); + } + } + + /** + * Populate the language tables + */ + function add_language($mode, $sub) + { + global $db, $lang, $phpbb_root_path, $phpEx; + + $dir = @opendir($phpbb_root_path . 'language'); + + if (!$dir) + { + $this->error('Unable to access the language directory', __LINE__, __FILE__); + } + + $installed_languages = array(); + while (($file = readdir($dir)) !== false) + { + $path = $phpbb_root_path . 'language/' . $file; + + if ($file == '.' || $file == '..' || is_link($path) || is_file($path) || $file == 'CVS') + { + continue; + } + + if (is_dir($path) && file_exists($path . '/iso.txt')) + { + $lang_file = file("$path/iso.txt"); + + $lang_pack = array( + 'lang_iso' => basename($path), + 'lang_dir' => basename($path), + 'lang_english_name' => trim(htmlspecialchars($lang_file[0])), + 'lang_local_name' => trim(htmlspecialchars($lang_file[1], ENT_COMPAT, 'UTF-8')), + 'lang_author' => trim(htmlspecialchars($lang_file[2], ENT_COMPAT, 'UTF-8')), + ); + + $db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $lang_pack)); + + $installed_languages[] = (int) $db->sql_nextid(); + if ($db->get_sql_error_triggered()) + { + $error = $db->sql_error($db->get_sql_error_sql()); + $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__); + } + } + } + closedir($dir); + + $sql = 'SELECT * + FROM ' . PROFILE_FIELDS_TABLE; + $result = $db->sql_query($sql); + + $profile_fields = array(); + $insert_buffer = new \phpbb\db\sql_insert_buffer($db, PROFILE_LANG_TABLE); + while ($row = $db->sql_fetchrow($result)) + { + foreach ($installed_languages as $lang_id) + { + $insert_buffer->insert(array( + 'field_id' => $row['field_id'], + 'lang_id' => $lang_id, + 'lang_name' => strtoupper(substr($row['field_name'], 6)),// Remove phpbb_ from field name + 'lang_explain' => '', + 'lang_default_value' => '', + )); + } + } + $db->sql_freeresult($result); + + $insert_buffer->flush(); + } + + /** + * Add search robots to the database + */ + function add_bots($mode, $sub) + { + global $db, $lang, $phpbb_root_path, $phpEx, $config; + + // Obtain any submitted data + $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); + + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = 'BOTS'"; + $result = $db->sql_query($sql); + $group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); + + if (!$group_id) + { + // If we reach this point then something has gone very wrong + $this->p_master->error($lang['NO_GROUP'], __LINE__, __FILE__); + } + + if (!function_exists('user_add')) + { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + } + + 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' => $data['default_lang'], + 'user_style' => 1, + 'user_timezone' => 'UTC', + 'user_dateformat' => $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->p_master->db_error('Unable to insert bot into users table', $db->get_sql_error_sql(), __LINE__, __FILE__, true); + continue; + } + + $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $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], + )); + + $result = $db->sql_query($sql); + } + } + + /** + * Sends an email to the board administrator with their password and some useful links + */ + function email_admin($mode, $sub) + { + global $auth, $config, $db, $lang, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $this->page_title = $lang['STAGE_FINAL']; + + // Obtain any submitted data + $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); + + $user->session_begin(); + $auth->login($data['admin_name'], $data['admin_pass1'], false, true, true); + + // OK, Now that we've reached this point we can be confident that everything + // is installed and working......I hope :) + // So it's time to send an email to the administrator confirming the details + // they entered + + if ($config['email_enable']) + { + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $messenger = new messenger(false); + + $messenger->template('installed', $data['language']); + + $messenger->to($data['board_email'], $data['admin_name']); + + $messenger->anti_abuse_headers($config, $user); + + $messenger->assign_vars(array( + 'USERNAME' => htmlspecialchars_decode($data['admin_name']), + 'PASSWORD' => htmlspecialchars_decode($data['admin_pass1'])) + ); + + $messenger->send(NOTIFY_EMAIL); + } + + // And finally, add a note to the log + add_log('admin', 'LOG_INSTALL_INSTALLED', $config['version']); + + $template->assign_vars(array( + 'TITLE' => $lang['INSTALL_CONGRATS'], + 'BODY' => sprintf($lang['INSTALL_CONGRATS_EXPLAIN'], $config['version'], append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=convert&language=' . $data['language']), '../docs/README.html'), + 'L_SUBMIT' => $lang['INSTALL_LOGIN'], + 'U_ACTION' => append_sid($phpbb_admin_path . 'index.' . $phpEx, 'i=send_statistics&mode=send_statistics'), + )); + } + + /** + * Check if the avatar directory is writable and disable avatars + * if it isn't writable. + */ + function disable_avatars_if_unwritable() + { + global $phpbb_root_path; + + if (!phpbb_is_writable($phpbb_root_path . 'images/avatars/upload/')) + { + set_config('allow_avatar', 0); + set_config('allow_avatar_upload', 0); + } + } + + /** + * Populate migrations for the installation + * + * This "installs" all migrations from (root path)/phpbb/db/migrations/data. + * "installs" means it adds all migrations to the migrations table, but does not + * perform any of the actions in the migrations. + * + * @param \phpbb\extension\manager $extension_manager + * @param \phpbb\db\migrator $migrator + */ + function populate_migrations($extension_manager, $migrator) + { + $finder = $extension_manager->get_finder(); + + $migrations = $finder + ->core_path('phpbb/db/migration/data/') + ->get_classes(); + $migrator->populate_migrations($migrations); + } + + /** + * Generate a list of available mail server authentication methods + */ + function mail_auth_select($selected_method) + { + global $lang; + + $auth_methods = array('PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5', 'POP-BEFORE-SMTP'); + $s_smtp_auth_options = ''; + + foreach ($auth_methods as $method) + { + $s_smtp_auth_options .= ''; + } + + return $s_smtp_auth_options; + } + + /** + * Get submitted data + */ + function get_submitted_data() + { + 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', ''), + ); + } + + /** + * The information below will be used to build the input fields presented to the user + */ + var $db_config_options = array( + 'legend1' => 'DB_CONFIG', + 'dbms' => array('lang' => 'DBMS', 'type' => 'select', 'options' => 'dbms_select(\'{VALUE}\')', 'explain' => false), + 'dbhost' => array('lang' => 'DB_HOST', 'type' => 'text:25:100', 'explain' => true), + 'dbport' => array('lang' => 'DB_PORT', 'type' => 'text:25:100', 'explain' => true), + 'dbname' => array('lang' => 'DB_NAME', 'type' => 'text:25:100', 'explain' => false), + 'dbuser' => array('lang' => 'DB_USERNAME', 'type' => 'text:25:100', 'explain' => false), + 'dbpasswd' => array('lang' => 'DB_PASSWORD', 'type' => 'password:25:100', 'explain' => false), + 'table_prefix' => array('lang' => 'TABLE_PREFIX', 'type' => 'text:25:100', 'explain' => true), + ); + var $admin_config_options = array( + 'legend1' => 'ADMIN_CONFIG', + 'default_lang' => array('lang' => 'DEFAULT_LANG', 'type' => 'select', 'options' => '$this->module->inst_language_select(\'{VALUE}\')', 'explain' => false), + 'admin_name' => array('lang' => 'ADMIN_USERNAME', 'type' => 'text:25:100', 'explain' => true), + 'admin_pass1' => array('lang' => 'ADMIN_PASSWORD', 'type' => 'password:25:100', 'explain' => true), + 'admin_pass2' => array('lang' => 'ADMIN_PASSWORD_CONFIRM', 'type' => 'password:25:100', 'explain' => false), + 'board_email' => array('lang' => 'CONTACT_EMAIL', 'type' => 'email:25:100', 'explain' => false), + ); + var $advanced_config_options = array( + 'legend1' => 'ACP_EMAIL_SETTINGS', + 'email_enable' => array('lang' => 'ENABLE_EMAIL', 'type' => 'radio:enabled_disabled', 'explain' => true), + 'smtp_delivery' => array('lang' => 'USE_SMTP', 'type' => 'radio:yes_no', 'explain' => true), + 'smtp_host' => array('lang' => 'SMTP_SERVER', 'type' => 'text:25:50', 'explain' => false), + 'smtp_auth' => array('lang' => 'SMTP_AUTH_METHOD', 'type' => 'select', 'options' => '$this->module->mail_auth_select(\'{VALUE}\')', 'explain' => true), + 'smtp_user' => array('lang' => 'SMTP_USERNAME', 'type' => 'text:25:255', 'explain' => true, 'options' => array('autocomplete' => 'off')), + 'smtp_pass' => array('lang' => 'SMTP_PASSWORD', 'type' => 'password:25:255', 'explain' => true, 'options' => array('autocomplete' => 'off')), + + 'legend2' => 'SERVER_URL_SETTINGS', + 'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'type' => 'radio:enabled_disabled', 'explain' => true), + 'force_server_vars' => array('lang' => 'FORCE_SERVER_VARS', 'type' => 'radio:yes_no', 'explain' => true), + 'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'type' => 'text:10:10', 'explain' => true), + 'server_name' => array('lang' => 'SERVER_NAME', 'type' => 'text:40:255', 'explain' => true), + 'server_port' => array('lang' => 'SERVER_PORT', 'type' => 'text:5:5', 'explain' => true), + 'script_path' => array('lang' => 'SCRIPT_PATH', 'type' => 'text::255', 'explain' => true), + ); + + /** + * Specific PHP modules we may require for certain optional or extended features + */ + var $php_dlls_other = array('zlib', 'ftp', 'gd', 'xml'); + + /** + * 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 $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/', ''), + ); + + /** + * Define the module structure so that we can populate the database without + * needing to hard-code module_id values + */ + var $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 $module_categories_basenames = array( + 'UCP_PM' => 'ucp_pm', + ); + + var $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', + ), + ), + ); +} diff --git a/sources/phpBB/install/install_main.php b/sources/phpBB/install/install_main.php new file mode 100644 index 0000000..d5874da --- /dev/null +++ b/sources/phpBB/install/install_main.php @@ -0,0 +1,78 @@ + +* @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_INSTALL') ) +{ + // Someone has tried to access the file direct. This is not a good idea, so exit + exit; +} + +if (!empty($setmodules)) +{ + $module[] = array( + 'module_type' => 'install', + 'module_title' => 'OVERVIEW', + 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1), + 'module_order' => 0, + 'module_subs' => array('INTRO', 'LICENSE', 'SUPPORT'), + 'module_stages' => '', + 'module_reqs' => '' + ); +} + +/** +* Main Tab - Installation +*/ +class install_main extends module +{ + function install_main(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($mode, $sub) + { + global $lang, $template, $language; + + switch ($sub) + { + case 'intro' : + $title = $lang['SUB_INTRO']; + $body = $lang['OVERVIEW_BODY']; + break; + + case 'license' : + $title = $lang['GPL']; + $body = implode("
\n", file(__DIR__ . '/../docs/LICENSE.txt')); + break; + + case 'support' : + $title = $lang['SUB_SUPPORT']; + $body = $lang['SUPPORT_BODY']; + break; + } + + $this->tpl_name = 'install_main'; + $this->page_title = $title; + + $template->assign_vars(array( + 'TITLE' => $title, + 'BODY' => $body, + + 'S_LANG_SELECT' => '', + )); + } +} diff --git a/sources/phpBB/install/phpinfo.php b/sources/phpBB/install/phpinfo.php new file mode 100644 index 0000000..1512b00 --- /dev/null +++ b/sources/phpBB/install/phpinfo.php @@ -0,0 +1,14 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +phpinfo(); diff --git a/sources/phpBB/install/schemas/index.htm b/sources/phpBB/install/schemas/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/install/schemas/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/install/schemas/oracle_schema.sql b/sources/phpBB/install/schemas/oracle_schema.sql new file mode 100644 index 0000000..2473d31 --- /dev/null +++ b/sources/phpBB/install/schemas/oracle_schema.sql @@ -0,0 +1,37 @@ +/* + This first section is optional, however its probably the best method + of running phpBB on Oracle. If you already have a tablespace and user created + for phpBB you can leave this section commented out! + + The first set of statements create a phpBB tablespace and a phpBB user, + make sure you change the password of the phpBB user before you run this script!! +*/ + +/* +CREATE TABLESPACE "PHPBB" + LOGGING + DATAFILE 'E:\ORACLE\ORADATA\LOCAL\PHPBB.ora' + SIZE 10M + AUTOEXTEND ON NEXT 10M + MAXSIZE 100M; + +CREATE USER "PHPBB" + PROFILE "DEFAULT" + IDENTIFIED BY "phpbb_password" + DEFAULT TABLESPACE "PHPBB" + QUOTA UNLIMITED ON "PHPBB" + ACCOUNT UNLOCK; + +GRANT ANALYZE ANY TO "PHPBB"; +GRANT CREATE SEQUENCE TO "PHPBB"; +GRANT CREATE SESSION TO "PHPBB"; +GRANT CREATE TABLE TO "PHPBB"; +GRANT CREATE TRIGGER TO "PHPBB"; +GRANT CREATE VIEW TO "PHPBB"; +GRANT "CONNECT" TO "PHPBB"; + +COMMIT; +DISCONNECT; + +CONNECT phpbb/phpbb_password; +*/ diff --git a/sources/phpBB/install/schemas/postgres_schema.sql b/sources/phpBB/install/schemas/postgres_schema.sql new file mode 100644 index 0000000..65caba8 --- /dev/null +++ b/sources/phpBB/install/schemas/postgres_schema.sql @@ -0,0 +1,80 @@ + +BEGIN; + +/* + Domain definition +*/ +CREATE DOMAIN varchar_ci AS varchar(255) NOT NULL DEFAULT ''::character varying; + +/* + Operation Functions +*/ +CREATE FUNCTION _varchar_ci_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) = LOWER($2)' LANGUAGE SQL STRICT; +CREATE FUNCTION _varchar_ci_not_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) != LOWER($2)' LANGUAGE SQL STRICT; +CREATE FUNCTION _varchar_ci_less_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) < LOWER($2)' LANGUAGE SQL STRICT; +CREATE FUNCTION _varchar_ci_less_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) <= LOWER($2)' LANGUAGE SQL STRICT; +CREATE FUNCTION _varchar_ci_greater_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) > LOWER($2)' LANGUAGE SQL STRICT; +CREATE FUNCTION _varchar_ci_greater_equals(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) >= LOWER($2)' LANGUAGE SQL STRICT; + +/* + Operators +*/ +CREATE OPERATOR <( + PROCEDURE = _varchar_ci_less_than, + LEFTARG = varchar_ci, + RIGHTARG = varchar_ci, + COMMUTATOR = >, + NEGATOR = >=, + RESTRICT = scalarltsel, + JOIN = scalarltjoinsel); + +CREATE OPERATOR <=( + PROCEDURE = _varchar_ci_less_equal, + LEFTARG = varchar_ci, + RIGHTARG = varchar_ci, + COMMUTATOR = >=, + NEGATOR = >, + RESTRICT = scalarltsel, + JOIN = scalarltjoinsel); + +CREATE OPERATOR >( + PROCEDURE = _varchar_ci_greater_than, + LEFTARG = varchar_ci, + RIGHTARG = varchar_ci, + COMMUTATOR = <, + NEGATOR = <=, + RESTRICT = scalargtsel, + JOIN = scalargtjoinsel); + +CREATE OPERATOR >=( + PROCEDURE = _varchar_ci_greater_equals, + LEFTARG = varchar_ci, + RIGHTARG = varchar_ci, + COMMUTATOR = <=, + NEGATOR = <, + RESTRICT = scalargtsel, + JOIN = scalargtjoinsel); + +CREATE OPERATOR <>( + PROCEDURE = _varchar_ci_not_equal, + LEFTARG = varchar_ci, + RIGHTARG = varchar_ci, + COMMUTATOR = <>, + NEGATOR = =, + RESTRICT = neqsel, + JOIN = neqjoinsel); + +CREATE OPERATOR =( + PROCEDURE = _varchar_ci_equal, + LEFTARG = varchar_ci, + RIGHTARG = varchar_ci, + COMMUTATOR = =, + NEGATOR = <>, + RESTRICT = eqsel, + JOIN = eqjoinsel, + HASHES, + MERGES, + SORT1= <); + +COMMIT; + diff --git a/sources/phpBB/install/schemas/schema_data.sql b/sources/phpBB/install/schemas/schema_data.sql new file mode 100644 index 0000000..3a0b71f --- /dev/null +++ b/sources/phpBB/install/schemas/schema_data.sql @@ -0,0 +1,821 @@ +# +# $Id$ +# + +# POSTGRES BEGIN # + +# -- Config +INSERT INTO phpbb_config (config_name, config_value) VALUES ('active_sessions', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_attachments', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_autologin', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_gravatar', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_local', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remote', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_upload', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remote_upload', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bbcode', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_birthdays', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bookmarks', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_cdn', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_emailreuse', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_password_reset', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_forum_notify', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_live_searches', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_mass_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_name_chars', 'USERNAME_CHARS_ANY'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_namechange', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_nocensors', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_pm_attach', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_pm_report', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_post_flash', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_post_links', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_privmsg', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_quick_reply', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_bbcode', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_flash', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_img', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_links', '1'); +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 ('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'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_flash_pm', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_img_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_method', 'db'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_smilies_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_filesize', '6144'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_gallery_path', 'images/avatars/gallery'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_max_height', '90'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_max_width', '90'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_min_height', '20'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_min_width', '20'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_path', 'images/avatars/upload'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_salt', 'phpbb_avatar'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_contact', 'contact@yourdomain.tld'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_contact_name', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable_msg', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email', 'address@yourdomain.tld'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_form', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_sig', '{L_CONFIG_BOARD_EMAIL_SIG}'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_hide_emails', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_index_text', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone', 'UTC'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('browser_check', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_interval', '10'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_type', 'd'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('cache_gc', '7200'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_plugin', 'core.captcha.plugins.nogd'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_foreground_noise', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_x_grid', '25'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_y_grid', '25'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_wave', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_3d_noise', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_fonts', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('confirm_refresh', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('check_attachment_content', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('check_dnsbl', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('chg_passforce', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('contact_admin_form_enable', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_domain', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_name', 'phpbb3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_path', '/'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_secure', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_enable', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_fax', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_mail', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('database_gc', '604800'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('dbms_version', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_dateformat', 'D M d, Y g:i a'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_style', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_edited', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_subject', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_order', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('extension_force_unstable', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('delete_time', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_check_mx', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_function_name', 'mail'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_max_chunk_size', '50'); +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 ('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'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_http_auth', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_limit_post', '15'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_limit_topic', '10'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall_forums', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_forum', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_topic', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_topics_new', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_topics_active', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_item_statistics', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('flood_interval', '15'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('force_server_vars', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('form_token_lifetime', '7200'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('form_token_mintime', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('form_token_sid_guests', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('forward_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('forwarded_for_check', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('full_folder_action', '2'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_mysql_max_word_len', '254'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_mysql_min_word_len', '4'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_common_thres', '5'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_load_upd', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_max_chars', '14'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_min_chars', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_max_word_len', '254'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_min_word_len', '4'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_ts_name', 'simple'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_sphinx_indexer_mem_limit', '512'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_sphinx_stopwords', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_compress', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('hot_threshold', '25'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('icons_path', 'images/icons'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_create_thumbnail', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_display_inlined', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_imagick', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_link_height', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_link_width', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_height', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_thumb_width', '400'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_width', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_min_thumb_filesize', '12000'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_check', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_login_limit_max', '50'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_login_limit_time', '21600'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_login_limit_use_forwarded', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_enable', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_host', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_password', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_package_size', '20'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_port', '5222'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_use_ssl', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_username', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_base_dn', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_email', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_password', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_port', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_server', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_uid', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_user', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_user_filter', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('legend_sort_groupname', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_load', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_search_load', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_anon_lastread', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_birthdays', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_memberlist', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewprofile', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewtopic', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_lastread', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_track', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jumpbox', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_moderators', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_notifications', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_guests', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_time', '5'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_onlinetrack', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_search', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_tplcompile', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_unreads_search', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_user_activity', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_autologin_time', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_filesize', '262144'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_filesize_pm', '262144'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_login_attempts', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_name_chars', '20'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_num_search_keywords', '10'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_pass_chars', '100'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_poll_options', '10'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_chars', '60000'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_font_size', '200'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_img_height', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_img_width', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_smilies', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_urls', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_quote_depth', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_reg_attempts', '5'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_chars', '255'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_font_size', '200'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_img_height', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_img_width', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_smilies', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_urls', '5'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_name_chars', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_pass_chars', '6'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_post_chars', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_search_author_chars', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('new_member_post_limit', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('new_member_group_default', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('override_user_style', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('pass_complex', 'PASS_TYPE_ANY'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('plupload_salt', 'phpbb_plupload'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_edit_time', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_boxes', '4'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_msgs', '50'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_recipients', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('posts_per_page', '10'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('print_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('queue_interval', '60'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ranks_path', 'images/ranks'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('read_notification_expire_days', '30'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('read_notification_gc', '86400'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('require_activation', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('referer_validation', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_block_size', '250'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_gc', '7200'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_interval', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_anonymous_interval', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_type', '\phpbb\search\fulltext_native'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_store_results', '1800'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_deny', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_empty_referer', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_downloads', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_protocol', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_gc', '3600'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_length', '3600'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_desc', '{L_CONFIG_SITE_DESC}'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_home_url', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_home_text', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('sitename', '{L_CONFIG_SITENAME}'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_path', 'images/smilies'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_per_page', '50'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_auth_method', 'PLAIN'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_delivery', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_host', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_password', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_port', '25'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_username', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_memberships', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_forums', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', '25'); +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.3'); +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'); + +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('cache_last_gc', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('cron_lock', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('database_last_gc', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('last_queue_run', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest_user_colour', 'AA0000', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest_user_id', '2', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest_username', '', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_files', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_posts', '1', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_topics', '1', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_users', '1', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('plupload_last_gc', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('rand_seed', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('rand_seed_last_update', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('read_notification_last_gc', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_date', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_users', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_indexing_state', '', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_last_gc', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('session_last_gc', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('upload_dir_size', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('warnings_last_gc', '0', 1); + +# Config text +INSERT INTO phpbb_config_text (config_name, config_value) VALUES ('contact_admin_info', ''); +INSERT INTO phpbb_config_text (config_name, config_value) VALUES ('contact_admin_info_uid', ''); +INSERT INTO phpbb_config_text (config_name, config_value) VALUES ('contact_admin_info_bitfield', ''); +INSERT INTO phpbb_config_text (config_name, config_value) VALUES ('contact_admin_info_flags', '7'); + +# -- 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_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); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_delete', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_download', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_edit', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_email', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_flash', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_icons', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_ignoreflood', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_img', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_list', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_noapprove', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_poll', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_post', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_postcount', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_print', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_read', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_reply', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_report', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_search', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_sigs', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_smilies', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_sticky', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_subscribe', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_user_lock', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_vote', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_votechg', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_softdelete', 1); + +# -- Moderator related auth options +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_approve', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_chgposter', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_delete', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_edit', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_info', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_lock', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_merge', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_move', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_report', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_split', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_softdelete', 1, 1); + +# -- Global moderator auth option (not a local option) +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_ban', 0, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_warn', 0, 1); + +# -- Admin related auth options +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_aauth', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_attach', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_authgroups', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_authusers', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_backup', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_ban', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_bbcode', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_board', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_bots', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_clearlogs', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_email', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_extensions', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_fauth', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_forum', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_forumadd', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_forumdel', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_group', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_groupadd', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_groupdel', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_icons', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_jabber', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_language', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_mauth', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_modules', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_names', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_phpinfo', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_profile', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_prune', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_ranks', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_reasons', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_roles', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_search', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_server', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_styles', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_switchperm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_uauth', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_user', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_userdel', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_viewauth', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_viewlogs', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_words', 1); + +# -- User related auth options +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_attach', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgavatar', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgcensors', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgemail', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chggrp', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgname', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgpasswd', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgprofileinfo', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_download', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_hideonline', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_ignoreflood', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_masspm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_masspm_group', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_attach', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_bbcode', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_delete', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_download', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_edit', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_emailpm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_flash', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_forward', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_img', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_printpm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_smilies', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_readpm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_savedrafts', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_search', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sendemail', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sendim', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sendpm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sig', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_viewonline', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_viewprofile', 1); + + +# -- standard auth roles +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_ADMIN_STANDARD', 'ROLE_DESCRIPTION_ADMIN_STANDARD', 'a_', 1); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_ADMIN_FORUM', 'ROLE_DESCRIPTION_ADMIN_FORUM', 'a_', 3); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_ADMIN_USERGROUP', 'ROLE_DESCRIPTION_ADMIN_USERGROUP', 'a_', 4); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_ADMIN_FULL', 'ROLE_DESCRIPTION_ADMIN_FULL', 'a_', 2); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_FULL', 'ROLE_DESCRIPTION_USER_FULL', 'u_', 3); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_STANDARD', 'ROLE_DESCRIPTION_USER_STANDARD', 'u_', 1); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_LIMITED', 'ROLE_DESCRIPTION_USER_LIMITED', 'u_', 2); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_NOPM', 'ROLE_DESCRIPTION_USER_NOPM', 'u_', 4); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_NOAVATAR', 'ROLE_DESCRIPTION_USER_NOAVATAR', 'u_', 5); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_MOD_FULL', 'ROLE_DESCRIPTION_MOD_FULL', 'm_', 3); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_MOD_STANDARD', 'ROLE_DESCRIPTION_MOD_STANDARD', 'm_', 1); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_MOD_SIMPLE', 'ROLE_DESCRIPTION_MOD_SIMPLE', 'm_', 2); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_MOD_QUEUE', 'ROLE_DESCRIPTION_MOD_QUEUE', 'm_', 4); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_FULL', 'ROLE_DESCRIPTION_FORUM_FULL', 'f_', 7); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_STANDARD', 'ROLE_DESCRIPTION_FORUM_STANDARD', 'f_', 5); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_NOACCESS', 'ROLE_DESCRIPTION_FORUM_NOACCESS', 'f_', 1); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_READONLY', 'ROLE_DESCRIPTION_FORUM_READONLY', 'f_', 2); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_LIMITED', 'ROLE_DESCRIPTION_FORUM_LIMITED', 'f_', 3); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_BOT', 'ROLE_DESCRIPTION_FORUM_BOT', 'f_', 9); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_ONQUEUE', 'ROLE_DESCRIPTION_FORUM_ONQUEUE', 'f_', 8); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_POLLS', 'ROLE_DESCRIPTION_FORUM_POLLS', 'f_', 6); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_LIMITED_POLLS', 'ROLE_DESCRIPTION_FORUM_LIMITED_POLLS', 'f_', 4); + +# 23 +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_NEW_MEMBER', 'ROLE_DESCRIPTION_USER_NEW_MEMBER', 'u_', 6); + +# 24 +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_NEW_MEMBER', 'ROLE_DESCRIPTION_FORUM_NEW_MEMBER', 'f_', 10); + +# -- phpbb_styles +INSERT INTO phpbb_styles (style_name, style_copyright, style_active, style_path, bbcode_bitfield, style_parent_id, style_parent_tree) VALUES ('prosilver', '© phpBB Limited', 1, 'prosilver', 'kNg=', 0, ''); + +# -- Forums +INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts_approved, forum_posts_unapproved, forum_posts_softdeleted, forum_topics_approved, forum_topics_unapproved, forum_topics_softdeleted, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents) VALUES ('{L_FORUMS_FIRST_CATEGORY}', '', 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 'Admin', 'AA0000', 972086460, '', '', '', '', '', '', '', 0, 0, ''); + +INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts_approved, forum_posts_unapproved, forum_posts_softdeleted, forum_topics_approved, forum_topics_unapproved, forum_topics_softdeleted, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_subject, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents, forum_flags) VALUES ('{L_FORUMS_TEST_FORUM_TITLE}', '{L_FORUMS_TEST_FORUM_DESC}', 2, 3, 1, 1, 1, 0, 0, 1, 0, 0, 1, 2, 'Admin', 'AA0000', '{L_TOPICS_TOPIC_TITLE}', 972086460, '', '', '', '', '', '', '', 0, 0, '', 48); + +# -- Users / Anonymous user +INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_jabber, user_actkey, user_newpasswd, user_allow_massemail) VALUES (2, 1, 'Anonymous', 'anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', 0); + +# -- username: Admin password: admin (change this or remove it once everything is working!) +INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_jabber, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 'admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', ''); + +# -- Groups +INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GUESTS', 3, 0, '', 0, '', '', '', 5); +INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED', 3, 0, '', 0, '', '', '', 5); +INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED_COPPA', 3, 0, '', 0, '', '', '', 5); +INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GLOBAL_MODERATORS', 3, 0, '00AA00', 2, '', '', '', 0); +INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('ADMINISTRATORS', 3, 1, 'AA0000', 1, '', '', '', 0); +INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('BOTS', 3, 0, '9E8DA7', 0, '', '', '', 5); +INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('NEWLY_REGISTERED', 3, 0, '', 0, '', '', '', 5); + +# -- Teampage +INSERT INTO phpbb_teampage (group_id, teampage_name, teampage_position, teampage_parent) VALUES (5, '', 1, 0); +INSERT INTO phpbb_teampage (group_id, teampage_name, teampage_position, teampage_parent) VALUES (4, '', 2, 0); + +# -- User -> Group +INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (1, 1, 0, 0); +INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (2, 2, 0, 0); +INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (4, 2, 0, 0); +INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (5, 2, 0, 1); + +# -- Ranks +INSERT INTO phpbb_ranks (rank_title, rank_min, rank_special, rank_image) VALUES ('{L_RANKS_SITE_ADMIN_TITLE}', 0, 1, ''); + +# -- Roles data + +# Standard Admin (a_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 1, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'a_%' AND auth_option NOT IN ('a_switchperm', 'a_jabber', 'a_phpinfo', 'a_server', 'a_backup', 'a_styles', 'a_clearlogs', 'a_modules', 'a_language', 'a_email', 'a_bots', 'a_search', 'a_aauth', 'a_roles'); + +# Forum admin (a_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 2, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'a_%' AND auth_option IN ('a_', 'a_authgroups', 'a_authusers', 'a_fauth', 'a_forum', 'a_forumadd', 'a_forumdel', 'a_mauth', 'a_prune', 'a_uauth', 'a_viewauth', 'a_viewlogs'); + +# User and Groups Admin (a_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 3, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'a_%' AND auth_option IN ('a_', 'a_authgroups', 'a_authusers', 'a_ban', 'a_group', 'a_groupadd', 'a_groupdel', 'a_ranks', 'a_uauth', 'a_user', 'a_viewauth', 'a_viewlogs'); + +# Full Admin (a_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 4, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'a_%'; + +# All Features (u_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 5, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%'; + +# Standard Features (u_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 6, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option NOT IN ('u_viewonline', 'u_chggrp', 'u_chgname', 'u_ignoreflood', 'u_pm_flash', 'u_pm_forward'); + +# Limited Features (u_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 7, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option NOT IN ('u_attach', 'u_viewonline', 'u_chggrp', 'u_chgname', 'u_ignoreflood', 'u_pm_attach', 'u_pm_emailpm', 'u_pm_flash', 'u_savedrafts', 'u_search', 'u_sendemail', 'u_sendim', 'u_masspm', 'u_masspm_group'); + +# No Private Messages (u_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 8, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_', 'u_chgavatar', 'u_chgcensors', 'u_chgemail', 'u_chgpasswd', 'u_download', 'u_hideonline', 'u_sig', 'u_viewprofile'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 8, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_readpm', 'u_sendpm', 'u_masspm', 'u_masspm_group'); + +# No Avatar (u_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 9, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option NOT IN ('u_attach', 'u_chgavatar', 'u_viewonline', 'u_chggrp', 'u_chgname', 'u_ignoreflood', 'u_pm_attach', 'u_pm_emailpm', 'u_pm_flash', 'u_savedrafts', 'u_search', 'u_sendemail', 'u_sendim', 'u_masspm', 'u_masspm_group'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 9, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_chgavatar'); + +# Full Moderator (m_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 10, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%'; + +# Standard Moderator (m_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 11, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option NOT IN ('m_ban', 'm_chgposter'); + +# Simple Moderator (m_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 12, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option IN ('m_', 'm_delete', 'm_softdelete', 'm_edit', 'm_info', 'm_report'); + +# Queue Moderator (m_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 13, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option IN ('m_', 'm_approve', 'm_edit'); + +# Full Access (f_) +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'); + +# 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_'; + +# Read Only Access (f_) +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'); + +# 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, 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'); + +# 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'); + +# 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'); + +# New Member (f_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 24, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove'); + + +# Permissions + +# GUESTS - u_download and u_search ability +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) SELECT 1, 0, auth_option_id, 0, 1 FROM phpbb_acl_options WHERE auth_option IN ('u_', 'u_download', 'u_search'); + +# Admin user - full user features +INSERT INTO phpbb_acl_users (user_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 0, 0, 5, 0); + +# ADMINISTRATOR Group - full user features +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 0, 0, 5, 0); + +# ADMINISTRATOR Group - standard admin +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 0, 0, 1, 0); + +# REGISTERED and REGISTERED_COPPA having standard user features +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 0, 0, 6, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (3, 0, 0, 6, 0); + +# GLOBAL_MODERATORS having full user features +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 0, 0, 5, 0); + +# GLOBAL_MODERATORS having full global moderator access +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 0, 0, 10, 0); + +# Giving all groups read only access to the first category +# since administrators and moderators are already within the registered users group we do not need to set them here +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (1, 1, 0, 17, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 1, 0, 17, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (3, 1, 0, 17, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (6, 1, 0, 17, 0); + +# Giving access to the first forum + +# guests having read only access +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (1, 2, 0, 17, 0); + +# registered and registered_coppa having standard access +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 2, 0, 15, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (3, 2, 0, 15, 0); + +# global moderators having standard access + polls +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 2, 0, 21, 0); + +# administrators having full forum and full moderator access +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 2, 0, 14, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 2, 0, 10, 0); + +# Bots having bot access +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (6, 2, 0, 19, 0); + +# NEW MEMBERS are not allowed to send private messages +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (7, 0, 0, 23, 0); + +# NEW MEMBERS on the queue +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (7, 2, 0, 24, 0); + + +# -- Demo Topic +INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, topic_views, topic_posts_approved, topic_posts_unapproved, topic_posts_softdeleted, forum_id, topic_status, topic_type, topic_first_post_id, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour, topic_last_post_subject, topic_last_post_time, topic_last_view_time, poll_title, topic_visibility) VALUES ('{L_TOPICS_TOPIC_TITLE}', 2, 972086460, 0, 1, 0, 0, 2, 0, 0, 1, 'Admin', 'AA0000', 1, 2, 'Admin', 'AA0000', '{L_TOPICS_TOPIC_TITLE}', 972086460, 972086460, '', 1); + +# -- Demo Post +INSERT INTO phpbb_posts (topic_id, forum_id, poster_id, icon_id, post_time, post_username, poster_ip, post_subject, post_text, post_checksum, bbcode_uid, post_visibility) VALUES (1, 2, 2, 0, 972086460, '', '127.0.0.1', '{L_TOPICS_TOPIC_TITLE}', '{L_DEFAULT_INSTALL_POST}', '5dd683b17f641daf84c040bfefc58ce9', '', 1); + +# -- Admin posted to the demo topic +INSERT INTO phpbb_topics_posted (user_id, topic_id, topic_posted) VALUES (2, 1, 1); + +# -- Smilies +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':D', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 1); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-D', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 2); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':grin:', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 3); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':)', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 4); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-)', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 5); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':smile:', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 6); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (';)', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 7); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (';-)', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 8); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':wink:', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 9); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':(', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 10); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-(', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 11); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':sad:', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 12); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 17, 13); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 17, 14); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':eek:', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 17, 15); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':shock:', 'icon_eek.gif', '{L_SMILIES_SHOCKED}', 15, 17, 16); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':?', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 17); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-?', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 18); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':???:', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 19); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES ('8-)', 'icon_cool.gif', '{L_SMILIES_COOL}', 15, 17, 20); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':cool:', 'icon_cool.gif', '{L_SMILIES_COOL}', 15, 17, 21); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':lol:', 'icon_lol.gif', '{L_SMILIES_LAUGHING}', 15, 17, 22); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':x', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 17, 23); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-x', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 17, 24); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':mad:', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 17, 25); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':P', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 17, 26); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-P', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 17, 27); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':razz:', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 17, 28); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':oops:', 'icon_redface.gif', '{L_SMILIES_EMARRASSED}', 15, 17, 29); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':cry:', 'icon_cry.gif', '{L_SMILIES_CRYING}', 15, 17, 30); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':evil:', 'icon_evil.gif', '{L_SMILIES_EVIL}', 15, 17, 31); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':twisted:', 'icon_twisted.gif', '{L_SMILIES_TWISTED_EVIL}', 15, 17, 32); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':roll:', 'icon_rolleyes.gif', '{L_SMILIES_ROLLING_EYES}', 15, 17, 33); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':!:', 'icon_exclaim.gif', '{L_SMILIES_EXCLAMATION}', 15, 17, 34); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':?:', 'icon_question.gif', '{L_SMILIES_QUESTION}', 15, 17, 35); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':idea:', 'icon_idea.gif', '{L_SMILIES_IDEA}', 15, 17, 36); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':arrow:', 'icon_arrow.gif', '{L_SMILIES_ARROW}', 15, 17, 37); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':|', 'icon_neutral.gif', '{L_SMILIES_NEUTRAL}', 15, 17, 38); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-|', 'icon_neutral.gif', '{L_SMILIES_NEUTRAL}', 15, 17, 39); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':mrgreen:', 'icon_mrgreen.gif', '{L_SMILIES_MR_GREEN}', 15, 17, 40); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':geek:', 'icon_e_geek.gif', '{L_SMILIES_GEEK}', 17, 17, 41); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':ugeek:', 'icon_e_ugeek.gif', '{L_SMILIES_UBER_GEEK}', 17, 18, 42); + +# -- icons +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/fire.gif', 16, 16, 1, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/redface.gif', 16, 16, 9, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/mrgreen.gif', 16, 16, 10, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/heart.gif', 16, 16, 4, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/star.gif', 16, 16, 2, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/radioactive.gif', 16, 16, 3, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/thinking.gif', 16, 16, 5, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/info.gif', 16, 16, 8, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/question.gif', 16, 16, 6, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/alert.gif', 16, 16, 7, 1); + +# -- reasons +INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('warez', '{L_REPORT_WAREZ}', 1); +INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('spam', '{L_REPORT_SPAM}', 2); +INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('off_topic', '{L_REPORT_OFF_TOPIC}', 3); +INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('other', '{L_REPORT_OTHER}', 4); + +# -- extension_groups +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('IMAGES', 1, 1, 1, '', 0, ''); +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 +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'gif'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'png'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'jpeg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'jpg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'tif'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'tiff'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'tga'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'gtar'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'gz'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'tar'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'zip'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'rar'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'ace'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'torrent'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'tgz'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'bz2'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, '7z'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'txt'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'c'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'h'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'cpp'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'hpp'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'diz'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'csv'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'ini'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'log'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'js'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'xml'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'xls'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'xlsx'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'xlsm'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'xlsb'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'doc'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'docx'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'docm'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'dot'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'dotx'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'dotm'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'pdf'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ai'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ps'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ppt'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'pptx'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'pptm'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odp'); +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 (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'); + +# 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, '', ''); +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_website', 'profilefields.type.url', 'phpbb_website', '40', '12', '255', '', '', '', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 2, 1, 'VISIT_WEBSITE', '%s'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_interests', 'profilefields.type.text', 'phpbb_interests', '3|30', '2', '500', '', '', '.*', 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, '', ''); +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_occupation', 'profilefields.type.text', 'phpbb_occupation', '3|30', '2', '500', '', '', '.*', 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, '', ''); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_aol', 'profilefields.type.string', 'phpbb_aol', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 5, 1, '', ''); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_icq', 'profilefields.type.string', 'phpbb_icq', '20', '3', '15', '', '', '[0-9]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 6, 1, 'SEND_ICQ_MESSAGE', 'https://www.icq.com/people/%s/'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_wlm', 'profilefields.type.string', 'phpbb_wlm', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 7, 1, '', ''); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_yahoo', 'profilefields.type.string', 'phpbb_yahoo', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 8, 1, 'SEND_YIM_MESSAGE', 'ymsgr:sendim?%s'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_facebook', 'profilefields.type.string', 'phpbb_facebook', '20', '5', '50', '', '', '[\w.]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 9, 1, 'VIEW_FACEBOOK_PROFILE', 'http://facebook.com/%s/'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_twitter', 'profilefields.type.string', 'phpbb_twitter', '20', '1', '15', '', '', '[\w_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 10, 1, 'VIEW_TWITTER_PROFILE', 'http://twitter.com/%s'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_skype', 'profilefields.type.string', 'phpbb_skype', '20', '6', '32', '', '', '[a-zA-Z][\w\.,\-_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 11, 1, 'VIEW_SKYPE_PROFILE', 'skype:%s?userinfo'); +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_youtube', 'profilefields.type.string', 'phpbb_youtube', '20', '3', '60', '', '', '[a-zA-Z][\w\.,\-_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 12, 1, 'VIEW_YOUTUBE_CHANNEL', 'http://youtube.com/user/%s'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_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.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.email'); + +# POSTGRES COMMIT # diff --git a/sources/phpBB/language/en/acp/attachments.php b/sources/phpBB/language/en/acp/attachments.php new file mode 100644 index 0000000..cf2f0a4 --- /dev/null +++ b/sources/phpBB/language/en/acp/attachments.php @@ -0,0 +1,179 @@ + +* @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 + +$lang = array_merge($lang, array( + 'ACP_ATTACHMENT_SETTINGS_EXPLAIN' => 'Here you can configure the main settings for attachments and the associated special categories.', + 'ACP_EXTENSION_GROUPS_EXPLAIN' => 'Here you can add, delete, modify or disable your extension groups. Further options include the assignment of a special category to them, changing the download mechanism and defining an upload icon which will be displayed in front of the attachment which belongs to the group.', + 'ACP_MANAGE_EXTENSIONS_EXPLAIN' => 'Here you can manage your allowed extensions. To activate your extensions, please refer to the extension groups management panel. We strongly recommend not to allow scripting extensions (such as php, php3, php4, phtml, pl, cgi, py, rb, asp, aspx, and so forth…).', + 'ACP_ORPHAN_ATTACHMENTS_EXPLAIN' => 'Here you are able to see orphaned files. This happens mostly if users are attaching files but not submitting the post. You are able to delete the files or attach them to existing posts. Attaching to posts requires a valid post ID, you have to determine this ID by yourself. This will assign the already uploaded attachment to the post you entered.', + 'ADD_EXTENSION' => 'Add extension', + 'ADD_EXTENSION_GROUP' => 'Add extension group', + 'ADMIN_UPLOAD_ERROR' => 'Errors while trying to attach file: “%sâ€.', + 'ALLOWED_FORUMS' => 'Allowed forums', + 'ALLOWED_FORUMS_EXPLAIN' => 'Able to post the assigned extensions at the selected (or all if selected) forums.', + 'ALLOWED_IN_PM_POST' => 'Allowed', + 'ALLOW_ATTACHMENTS' => 'Allow attachments', + 'ALLOW_ALL_FORUMS' => 'Allow all forums', + 'ALLOW_IN_PM' => 'Allowed in private messaging', + 'ALLOW_PM_ATTACHMENTS' => 'Allow attachments in private messages', + 'ALLOW_SELECTED_FORUMS' => 'Only forums selected below', + 'ASSIGNED_EXTENSIONS' => 'Assigned extensions', + 'ASSIGNED_GROUP' => 'Assigned extension group', + 'ATTACH_EXTENSIONS_URL' => 'Extensions', + 'ATTACH_EXT_GROUPS_URL' => 'Extension groups', + 'ATTACH_ID' => 'ID', + 'ATTACH_MAX_FILESIZE' => 'Maximum file size', + 'ATTACH_MAX_FILESIZE_EXPLAIN' => 'Maximum size of each file. If this value is 0, the uploadable filesize is only limited by your PHP configuration.', + 'ATTACH_MAX_PM_FILESIZE' => 'Maximum file size messaging', + 'ATTACH_MAX_PM_FILESIZE_EXPLAIN' => 'Maximum size of each file, with 0 being unlimited, attached to a private message.', + 'ATTACH_ORPHAN_URL' => 'Orphan attachments', + 'ATTACH_POST_ID' => 'Post ID', + 'ATTACH_POST_TYPE' => 'Post type', + 'ATTACH_QUOTA' => 'Total attachment quota', + 'ATTACH_QUOTA_EXPLAIN' => 'Maximum drive space available for attachments for the whole board, with 0 being unlimited.', + 'ATTACH_TO_POST' => 'Attach file to post', + + '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', + 'CREATE_THUMBNAIL' => 'Create thumbnail', + 'CREATE_THUMBNAIL_EXPLAIN' => 'Create a thumbnail in all possible situations.', + + 'DEFINE_ALLOWED_IPS' => 'Define allowed IPs/hostnames', + 'DEFINE_DISALLOWED_IPS' => 'Define disallowed IPs/hostnames', + 'DOWNLOAD_ADD_IPS_EXPLAIN' => 'To specify several different IPs or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use “*â€.', + 'DOWNLOAD_REMOVE_IPS_EXPLAIN' => 'You can remove (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IPs have a blue background.', + 'DISPLAY_INLINED' => 'Display images inline', + 'DISPLAY_INLINED_EXPLAIN' => 'If set to No image attachments will show as a link.', + 'DISPLAY_ORDER' => 'Attachment display order', + 'DISPLAY_ORDER_EXPLAIN' => 'Display attachments ordered by time.', + + 'EDIT_EXTENSION_GROUP' => 'Edit extension group', + 'EXCLUDE_ENTERED_IP' => 'Enable this to exclude the entered IP/hostname.', + 'EXCLUDE_FROM_ALLOWED_IP' => 'Exclude IP from allowed IPs/hostnames', + 'EXCLUDE_FROM_DISALLOWED_IP' => 'Exclude IP from disallowed IPs/hostnames', + 'EXTENSIONS_UPDATED' => 'Extensions successfully updated.', + 'EXTENSION_EXIST' => 'The extension %s already exists.', + 'EXTENSION_GROUP' => 'Extension group', + 'EXTENSION_GROUPS' => 'Extension groups', + 'EXTENSION_GROUP_DELETED' => 'Extension group successfully deleted.', + 'EXTENSION_GROUP_EXIST' => 'The extension group %s already exists.', + + 'EXT_GROUP_ARCHIVES' => 'Archives', + 'EXT_GROUP_DOCUMENTS' => 'Documents', + 'EXT_GROUP_DOWNLOADABLE_FILES' => 'Downloadable Files', + '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.
Click %3$shere%4$s to resynchronise them.', + + 'GO_TO_EXTENSIONS' => 'Go to extension management screen', + 'GROUP_NAME' => 'Group name', + + 'IMAGE_LINK_SIZE' => 'Image link dimensions', + 'IMAGE_LINK_SIZE_EXPLAIN' => 'Display image attachment as an inline text link if image is larger than this. To disable this behaviour, set the values to 0px by 0px.', + 'IMAGICK_PATH' => 'Imagemagick path', + 'IMAGICK_PATH_EXPLAIN' => 'Full path to the imagemagick convert application, e.g. /usr/bin/.', + + 'MAX_ATTACHMENTS' => 'Maximum number of attachments per post', + 'MAX_ATTACHMENTS_PM' => 'Maximum number of attachments per private message', + 'MAX_EXTGROUP_FILESIZE' => 'Maximum file size', + 'MAX_IMAGE_SIZE' => 'Maximum image dimensions', + 'MAX_IMAGE_SIZE_EXPLAIN' => 'Maximum size of image attachments. Set both values to 0px by 0px to disable dimension checking.', + 'MAX_THUMB_WIDTH' => 'Maximum thumbnail width in pixel', + 'MAX_THUMB_WIDTH_EXPLAIN' => 'A generated thumbnail will not exceed the width set here.', + 'MIN_THUMB_FILESIZE' => 'Minimum thumbnail file size', + 'MIN_THUMB_FILESIZE_EXPLAIN' => 'Do not create a thumbnail for images smaller than this.', + 'MODE_INLINE' => 'Inline', + 'MODE_PHYSICAL' => 'Physical', + + 'NOT_ALLOWED_IN_PM' => 'Only allowed in posts', + 'NOT_ALLOWED_IN_PM_POST' => 'Not allowed', + 'NOT_ASSIGNED' => 'Not assigned', + 'NO_ATTACHMENTS' => 'No attachments found for this period.', + 'NO_EXT_GROUP' => 'None', + 'NO_EXT_GROUP_NAME' => 'No group name entered', + 'NO_EXT_GROUP_SPECIFIED' => 'No extension group specified.', + 'NO_FILE_CAT' => 'None', + 'NO_IMAGE' => 'No image', + 'NO_THUMBNAIL_SUPPORT' => 'Thumbnail support has been disabled. For proper functionality either the GD extension need to be available or imagemagick being installed. Both were not found.', + 'NO_UPLOAD_DIR' => 'The upload directory you specified does not exist.', + 'NO_WRITE_UPLOAD' => 'The upload directory you specified cannot be written to. Please alter the permissions to allow the webserver to write to it.', + + 'ONLY_ALLOWED_IN_PM' => 'Only allowed in private messages', + 'ORDER_ALLOW_DENY' => 'Allow', + 'ORDER_DENY_ALLOW' => 'Deny', + + 'REMOVE_ALLOWED_IPS' => 'Remove or un-exclude allowed IPs/hostnames', + 'REMOVE_DISALLOWED_IPS' => 'Remove or un-exclude disallowed IPs/hostnames', + 'RESYNC_FILES_STATS_CONFIRM' => 'Are you sure you wish to resynchronise file statistics?', + + 'SEARCH_IMAGICK' => 'Search for Imagemagick', + 'SECURE_ALLOW_DENY' => 'Allow/Deny list', + 'SECURE_ALLOW_DENY_EXPLAIN' => 'Change the default behaviour when secure downloads are enabled of the Allow/Deny list to that of a whitelist (Allow) or a blacklist (Deny).', + 'SECURE_DOWNLOADS' => 'Enable secure downloads', + 'SECURE_DOWNLOADS_EXPLAIN' => 'With this option enabled, downloads are limited to IP’s/hostnames you define.', + 'SECURE_DOWNLOAD_NOTICE' => 'Secure Downloads are not enabled. The settings below will be applied after enabling secure downloads.', + 'SECURE_DOWNLOAD_UPDATE_SUCCESS'=> 'The IP list has been updated successfully.', + 'SECURE_EMPTY_REFERRER' => 'Allow empty referrer', + 'SECURE_EMPTY_REFERRER_EXPLAIN' => 'Secure downloads are based on referrers. Do you want to allow downloads for those omitting the referrer?', + 'SETTINGS_CAT_IMAGES' => 'Image category settings', + 'SPECIAL_CATEGORY' => 'Special category', + 'SPECIAL_CATEGORY_EXPLAIN' => 'Special categories differ between the way presented within posts.', + 'SUCCESSFULLY_UPLOADED' => 'Successfully uploaded.', + 'SUCCESS_EXTENSION_GROUP_ADD' => 'Extension group successfully added.', + 'SUCCESS_EXTENSION_GROUP_EDIT' => 'Extension group successfully updated.', + + 'UPLOADING_FILES' => 'Uploading files', + 'UPLOADING_FILE_TO' => 'Uploading file “%1$s†to post number %2$d…', + 'UPLOAD_DENIED_FORUM' => 'You do not have the permission to upload files to forum “%sâ€.', + 'UPLOAD_DIR' => 'Upload directory', + 'UPLOAD_DIR_EXPLAIN' => 'Storage path for attachments. Please note that if you change this directory while already having uploaded attachments you need to manually copy the files to their new location.', + 'UPLOAD_ICON' => 'Upload icon', + 'UPLOAD_NOT_DIR' => 'The upload location you specified does not appear to be a directory.', +)); diff --git a/sources/phpBB/language/en/acp/ban.php b/sources/phpBB/language/en/acp/ban.php new file mode 100644 index 0000000..93d5cf9 --- /dev/null +++ b/sources/phpBB/language/en/acp/ban.php @@ -0,0 +1,84 @@ + +* @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 + +// Banning +$lang = array_merge($lang, array( + '1_HOUR' => '1 hour', + '30_MINS' => '30 minutes', + '6_HOURS' => '6 hours', + + 'ACP_BAN_EXPLAIN' => 'Here you can control the banning of users by name, IP or email address. These methods prevent a user reaching any part of the board. You can give a short (maximum 3000 characters) reason for the ban if you wish. This will be displayed in the admin log. The duration of a ban can also be specified. If you want the ban to end on a specific date rather than after a set time period select Until -> for the ban length and enter a date in YYYY-MM-DD format.', + + 'BAN_EXCLUDE' => 'Exclude from banning', + 'BAN_LENGTH' => 'Length of ban', + 'BAN_REASON' => 'Reason for ban', + 'BAN_GIVE_REASON' => 'Reason shown to the banned', + 'BAN_UPDATE_SUCCESSFUL' => 'The banlist has been updated successfully.', + 'BANNED_UNTIL_DATE' => 'until %s', // Example: "until Mon 13.Jul.2009, 14:44" + 'BANNED_UNTIL_DURATION' => '%1$s (until %2$s)', // Example: "7 days (until Tue 14.Jul.2009, 14:44)" + + 'EMAIL_BAN' => 'Ban one or more email addresses', + 'EMAIL_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered email address from all current bans.', + 'EMAIL_BAN_EXPLAIN' => 'To specify more than one email address enter each on a new line. To match partial addresses use * as the wildcard, e.g. *@hotmail.com, *@*.domain.tld, etc.', + 'EMAIL_NO_BANNED' => 'No banned email addresses', + 'EMAIL_UNBAN' => 'Un-ban or un-exclude emails', + 'EMAIL_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple email addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded email addresses are emphasised.', + + 'IP_BAN' => 'Ban one or more IPs', + 'IP_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered IP from all current bans.', + 'IP_BAN_EXPLAIN' => 'To specify several different IPs or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use “*â€.', + 'IP_HOSTNAME' => 'IP addresses or hostnames', + 'IP_NO_BANNED' => 'No banned IP addresses', + 'IP_UNBAN' => 'Un-ban or un-exclude IPs', + 'IP_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IPs are emphasised.', + + 'LENGTH_BAN_INVALID' => 'The date has to be formatted YYYY-MM-DD.', + + 'OPTIONS_BANNED' => 'Banned', + 'OPTIONS_EXCLUDED' => 'Excluded', + + 'PERMANENT' => 'Permanent', + + 'UNTIL' => 'Until', + 'USER_BAN' => 'Ban one or more users by username', + 'USER_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered users from all current bans.', + 'USER_BAN_EXPLAIN' => 'You can ban multiple users in one go by entering each name on a new line. Use the Find a member facility to look up and add one or more users automatically.', + 'USER_NO_BANNED' => 'No banned usernames', + 'USER_UNBAN' => 'Un-ban or un-exclude users by username', + 'USER_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple users in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded users are emphasised.', +)); diff --git a/sources/phpBB/language/en/acp/board.php b/sources/phpBB/language/en/acp/board.php new file mode 100644 index 0000000..8d6c1c1 --- /dev/null +++ b/sources/phpBB/language/en/acp/board.php @@ -0,0 +1,600 @@ + +* @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 + +// Board Settings +$lang = array_merge($lang, array( + 'ACP_BOARD_SETTINGS_EXPLAIN' => 'Here you can determine the basic operation of your board, give it a fitting name and description, and among other settings adjust the default values for timezone and language.', + 'BOARD_INDEX_TEXT' => 'Board index text', + 'BOARD_INDEX_TEXT_EXPLAIN' => 'This text is displayed as the board index in the board’s breadcrumbs. If not specified, it will default to “Board indexâ€.', + 'BOARD_STYLE' => 'Board style', + 'CUSTOM_DATEFORMAT' => 'Custom…', + 'DEFAULT_DATE_FORMAT' => 'Date format', + 'DEFAULT_DATE_FORMAT_EXPLAIN' => 'The date format is the same as the PHP date function.', + 'DEFAULT_LANGUAGE' => 'Default language', + 'DEFAULT_STYLE' => 'Default style', + 'DEFAULT_STYLE_EXPLAIN' => 'The default style for new users.', + 'DISABLE_BOARD' => 'Disable board', + 'DISABLE_BOARD_EXPLAIN' => 'This will make the board unavailable to users who are neither administrators nor moderators. You can also enter a short (255 character) message to display if you wish.', + 'DISPLAY_LAST_SUBJECT' => 'Display subject of last added post on forum list', + 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'The subject of the last added post will be displayed in the forum list with a hyperlink to the post. Subjects from password protected forums and forums in which user doesn’t have read access are not shown.', + 'GUEST_STYLE' => 'Guest style', + 'GUEST_STYLE_EXPLAIN' => 'The board style for guests.', + 'OVERRIDE_STYLE' => 'Override user style', + 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces user’s (and guest’s) style with the style as defined under "Default style".', + 'SITE_DESC' => 'Site description', + 'SITE_HOME_TEXT' => 'Main website text', + 'SITE_HOME_TEXT_EXPLAIN' => 'This text will be displayed as a link to your website homepage in the board’s breadcrumbs. If not specified, it will default to “Homeâ€.', + 'SITE_HOME_URL' => 'Main website URL', + 'SITE_HOME_URL_EXPLAIN' => 'If specified, a link to this URL will be prepended to your board’s breadcrumbs and the board logo will link to this URL instead of the forum index. An absolute URL is required, e.g. http://www.phpbb.com.', + 'SITE_NAME' => 'Site name', + 'SYSTEM_TIMEZONE' => 'Guest timezone', + 'SYSTEM_TIMEZONE_EXPLAIN' => 'Timezone to use for displaying times to users who are not logged in (guests, bots). Logged in users set their timezone during registration and can change it in their user control panel.', + 'WARNINGS_EXPIRE' => 'Warning duration', + 'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days that will elapse before a warning will automatically expire from a user’s record. Set this value to 0 to make warnings permanent.', +)); + +// Board Features +$lang = array_merge($lang, array( + 'ACP_BOARD_FEATURES_EXPLAIN' => 'Here you can enable/disable several board features.', + + 'ALLOW_ATTACHMENTS' => 'Allow attachments', + 'ALLOW_BIRTHDAYS' => 'Allow birthdays', + 'ALLOW_BIRTHDAYS_EXPLAIN' => 'Allow birthdays to be entered and age being displayed in profiles. Please note the birthday list within the board index is controlled by a separate load setting.', + 'ALLOW_BOOKMARKS' => 'Allow bookmarking topics', + 'ALLOW_BOOKMARKS_EXPLAIN' => 'User is able to store personal bookmarks.', + 'ALLOW_BBCODE' => 'Allow BBCode', + 'ALLOW_FORUM_NOTIFY' => 'Allow subscribing to forums', + 'ALLOW_NAME_CHANGE' => 'Allow username changes', + 'ALLOW_NO_CENSORS' => 'Allow disabling of word censoring', + 'ALLOW_NO_CENSORS_EXPLAIN' => 'Users can choose to disable the automatic word censoring of posts and private messages.', + 'ALLOW_PM_ATTACHMENTS' => 'Allow attachments in private messages', + 'ALLOW_PM_REPORT' => 'Allow users to report private messages', + 'ALLOW_PM_REPORT_EXPLAIN' => 'If this setting is enabled, users have the option of reporting a private message they have received or sent to the board’s moderators. These private messages will then be visible in the Moderator Control Panel.', + 'ALLOW_QUICK_REPLY' => 'Allow quick reply', + 'ALLOW_QUICK_REPLY_EXPLAIN' => 'This switch allows for the quick reply to be disabled board-wide. When enabled, forum specific settings will be used to determine whether the quick reply is displayed in individual forums.', + 'ALLOW_QUICK_REPLY_BUTTON' => 'Submit and enable quick reply in all forums', + 'ALLOW_SIG' => 'Allow signatures', + 'ALLOW_SIG_BBCODE' => 'Allow BBCode in user signatures', + 'ALLOW_SIG_FLASH' => 'Allow use of [FLASH] BBCode tag in user signatures', + 'ALLOW_SIG_IMG' => 'Allow use of [IMG] BBCode tag in user signatures', + 'ALLOW_SIG_LINKS' => 'Allow use of links in user signatures', + 'ALLOW_SIG_LINKS_EXPLAIN' => 'If disallowed the [URL] BBCode tag and automatic/magic URLs are disabled.', + 'ALLOW_SIG_SMILIES' => 'Allow use of smilies in user signatures', + 'ALLOW_SMILIES' => 'Allow smilies', + 'ALLOW_TOPIC_NOTIFY' => 'Allow subscribing to topics', + 'BOARD_PM' => 'Private messaging', + 'BOARD_PM_EXPLAIN' => 'Enable private messaging for all users.', +)); + +// Avatar Settings +$lang = array_merge($lang, array( + 'ACP_AVATAR_SETTINGS_EXPLAIN' => 'Avatars are generally small, unique images a user can associate with themselves. Depending on the style they are usually displayed below the username when viewing topics. Here you can determine how users can define their avatars. Please note that in order to upload avatars you need to have created the directory you name below and ensure it can be written to by the web server. Please also note that file size limits are only imposed on uploaded avatars, they do not apply to remotely linked images.', + + 'ALLOW_AVATARS' => 'Enable avatars', + 'ALLOW_AVATARS_EXPLAIN' => 'Allow general usage of avatars;
If you disable avatars in general or avatars of a certain mode, the disabled avatars will no longer be shown on the board, but users will still be able to download their own avatars in the User Control Panel.', + 'ALLOW_GRAVATAR' => 'Enable gravatar avatars', + 'ALLOW_LOCAL' => 'Enable gallery avatars', + 'ALLOW_REMOTE' => 'Enable remote avatars', + 'ALLOW_REMOTE_EXPLAIN' => 'Avatars linked to from another website.', + 'ALLOW_REMOTE_UPLOAD' => 'Enable remote avatar uploading', + 'ALLOW_REMOTE_UPLOAD_EXPLAIN' => 'Allow uploading of avatars from another website.', + 'ALLOW_UPLOAD' => 'Enable avatar uploading', + 'AVATAR_GALLERY_PATH' => 'Avatar gallery path', + 'AVATAR_GALLERY_PATH_EXPLAIN' => 'Path under your phpBB root directory for pre-loaded images, e.g. images/avatars/gallery.
Double dots like ../ will be stripped from the path for security reasons.', + 'AVATAR_STORAGE_PATH' => 'Avatar storage path', + 'AVATAR_STORAGE_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. images/avatars/upload.
Avatar uploading will not be available if this path is not writable.
Double dots like ../ will be stripped from the path for security reasons.', + 'MAX_AVATAR_SIZE' => 'Maximum avatar dimensions', + 'MAX_AVATAR_SIZE_EXPLAIN' => 'Width x Height in pixels.', + 'MAX_FILESIZE' => 'Maximum avatar file size', + 'MAX_FILESIZE_EXPLAIN' => 'For uploaded avatar files. If this value is 0, the uploaded filesize is only limited by your PHP configuration.', + 'MIN_AVATAR_SIZE' => 'Minimum avatar dimensions', + 'MIN_AVATAR_SIZE_EXPLAIN' => 'Width x Height in pixels.', +)); + +// Message Settings +$lang = array_merge($lang, array( + 'ACP_MESSAGE_SETTINGS_EXPLAIN' => 'Here you can set all default settings for private messaging.', + + 'ALLOW_BBCODE_PM' => 'Allow BBCode in private messages', + 'ALLOW_FLASH_PM' => 'Allow use of [FLASH] BBCode tag', + 'ALLOW_FLASH_PM_EXPLAIN' => 'Note that the ability to use flash in private messages, if enabled here, also depends on the permissions.', + 'ALLOW_FORWARD_PM' => 'Allow forwarding of private messages', + 'ALLOW_IMG_PM' => 'Allow use of [IMG] BBCode tag', + 'ALLOW_MASS_PM' => 'Allow sending of private messages to multiple users and groups', + 'ALLOW_MASS_PM_EXPLAIN' => 'Sending to groups can be adjusted per group within the group settings page.', + 'ALLOW_PRINT_PM' => 'Allow print view in private messaging', + 'ALLOW_QUOTE_PM' => 'Allow quotes in private messages', + 'ALLOW_SIG_PM' => 'Allow signature in private messages', + 'ALLOW_SMILIES_PM' => 'Allow smilies in private messages', + 'BOXES_LIMIT' => 'Maximum private messages per box', + 'BOXES_LIMIT_EXPLAIN' => 'Users may receive no more than this many messages in each of their private message boxes. Set this value to 0 to allow unlimited messages.', + 'BOXES_MAX' => 'Maximum private message folders', + 'BOXES_MAX_EXPLAIN' => 'By default users may create this many personal folders for private messages.', + 'ENABLE_PM_ICONS' => 'Enable use of topic icons in private messages', + 'FULL_FOLDER_ACTION' => 'Full folder default action', + 'FULL_FOLDER_ACTION_EXPLAIN'=> 'Default action to take if a user’s folder is full assuming the user’s folder action, if set at all, is not applicable. The only exception is for the “Sent messages†folder where the default action is always to delete old messages.', + 'HOLD_NEW_MESSAGES' => 'Hold new messages', + 'PM_EDIT_TIME' => 'Limit editing time', + 'PM_EDIT_TIME_EXPLAIN' => 'Limits the time available to edit a private message not already delivered. Setting the value to 0 disables this behaviour.', + 'PM_MAX_RECIPIENTS' => 'Maximum number of allowed recipients', + 'PM_MAX_RECIPIENTS_EXPLAIN' => 'The maximum number of allowed recipients in a private message. If 0 is entered, an unlimited number is allowed. This setting can be adjusted for every group within the group settings page.', +)); + +// Post Settings +$lang = array_merge($lang, array( + 'ACP_POST_SETTINGS_EXPLAIN' => 'Here you can set all default settings for posting.', + 'ALLOW_POST_LINKS' => 'Allow links in posts/private messages', + 'ALLOW_POST_LINKS_EXPLAIN' => 'If disallowed the [URL] BBCode tag and automatic/magic URLs are disabled.', + 'ALLOW_POST_FLASH' => 'Allow use of [FLASH] BBCode tag in posts', + 'ALLOW_POST_FLASH_EXPLAIN' => 'If disallowed the [FLASH] BBCode tag is disabled in posts. Otherwise the permission system controls which users can use the [FLASH] BBCode tag.', + + 'BUMP_INTERVAL' => 'Bump interval', + 'BUMP_INTERVAL_EXPLAIN' => 'Number of minutes, hours or days between the last post to a topic and the ability to bump that topic. Setting the value to 0 disables bumping entirely.', + 'CHAR_LIMIT' => 'Maximum characters per post/message', + 'CHAR_LIMIT_EXPLAIN' => 'The number of characters allowed within a post/private message. Set to 0 for unlimited characters.', + 'DELETE_TIME' => 'Limit deleting time', + 'DELETE_TIME_EXPLAIN' => 'Limits the time available to delete a new post. Setting the value to 0 disables this behaviour.', + 'DISPLAY_LAST_EDITED' => 'Display last edited time information', + 'DISPLAY_LAST_EDITED_EXPLAIN' => 'Choose if the last edited by information to be displayed on posts.', + 'EDIT_TIME' => 'Limit editing time', + 'EDIT_TIME_EXPLAIN' => 'Limits the time available to edit a new post. Setting the value to 0 disables this behaviour.', + 'FLOOD_INTERVAL' => 'Flood interval', + 'FLOOD_INTERVAL_EXPLAIN' => 'Number of seconds a user must wait between posting new messages. To enable users to ignore this alter their permissions.', + 'HOT_THRESHOLD' => 'Popular topic threshold', + 'HOT_THRESHOLD_EXPLAIN' => 'Posts per topic threshold required for the popular topic annotation. Set to 0 to disable popular topics.', + 'MAX_POLL_OPTIONS' => 'Maximum number of poll options', + 'MAX_POST_FONT_SIZE' => 'Maximum font size per post', + 'MAX_POST_FONT_SIZE_EXPLAIN' => 'Maximum font size allowed in a post. Set to 0 for unlimited font size.', + 'MAX_POST_IMG_HEIGHT' => 'Maximum image height per post', + 'MAX_POST_IMG_HEIGHT_EXPLAIN' => 'Maximum height of an image/flash file in postings. Set to 0 for unlimited size.', + 'MAX_POST_IMG_WIDTH' => 'Maximum image width per post', + 'MAX_POST_IMG_WIDTH_EXPLAIN' => 'Maximum width of an image/flash file in postings. Set to 0 for unlimited size.', + 'MAX_POST_URLS' => 'Maximum links per post', + 'MAX_POST_URLS_EXPLAIN' => 'Maximum number of URLs in a post. Set to 0 for unlimited links.', + 'MIN_CHAR_LIMIT' => 'Minimum characters per post/message', + 'MIN_CHAR_LIMIT_EXPLAIN' => 'The minimum number of characters the user need to enter within a post/private message. The minimum for this setting is 1.', + 'POSTING' => 'Posting', + 'POSTS_PER_PAGE' => 'Posts per page', + 'QUOTE_DEPTH_LIMIT' => 'Maximum nesting depth for quotes', + 'QUOTE_DEPTH_LIMIT_EXPLAIN' => 'Maximum quote nesting depth in a post. Set to 0 for unlimited depth.', + 'SMILIES_LIMIT' => 'Maximum smilies per post', + 'SMILIES_LIMIT_EXPLAIN' => 'Maximum number of smilies in a post. Set to 0 for unlimited smilies.', + 'SMILIES_PER_PAGE' => 'Smilies per page', + 'TOPICS_PER_PAGE' => 'Topics per page', +)); + +// Signature Settings +$lang = array_merge($lang, array( + 'ACP_SIGNATURE_SETTINGS_EXPLAIN' => 'Here you can set all default settings for signatures.', + + 'MAX_SIG_FONT_SIZE' => 'Maximum signature font size', + 'MAX_SIG_FONT_SIZE_EXPLAIN' => 'Maximum font size allowed in user signatures. Set to 0 for unlimited size.', + 'MAX_SIG_IMG_HEIGHT' => 'Maximum signature image height', + 'MAX_SIG_IMG_HEIGHT_EXPLAIN' => 'Maximum height of an image/flash file in user signatures. Set to 0 for unlimited height.', + 'MAX_SIG_IMG_WIDTH' => 'Maximum signature image width', + 'MAX_SIG_IMG_WIDTH_EXPLAIN' => 'Maximum width of an image/flash file in user signatures. Set to 0 for unlimited width.', + 'MAX_SIG_LENGTH' => 'Maximum signature length', + 'MAX_SIG_LENGTH_EXPLAIN' => 'Maximum number of characters in user signatures.', + 'MAX_SIG_SMILIES' => 'Maximum smilies per signature', + 'MAX_SIG_SMILIES_EXPLAIN' => 'Maximum smilies allowed in user signatures. Set to 0 for unlimited smilies.', + 'MAX_SIG_URLS' => 'Maximum signature links', + 'MAX_SIG_URLS_EXPLAIN' => 'Maximum number of links in user signatures. Set to 0 for unlimited links.', +)); + +// Registration Settings +$lang = array_merge($lang, array( + 'ACP_REGISTER_SETTINGS_EXPLAIN' => 'Here you are able to define registration and profile related settings.', + + 'ACC_ACTIVATION' => 'Account activation', + 'ACC_ACTIVATION_EXPLAIN' => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations. “Board-wide email†must be enabled in order to use user or admin activation.', + 'ACC_ACTIVATION_WARNING' => 'Please note that the currently selected activation method requires emails to be enabled, otherwise registration will be disabled. We recommend to either select a different activation method or reenable emails.', + 'NEW_MEMBER_POST_LIMIT' => 'New member post limit', + 'NEW_MEMBER_POST_LIMIT_EXPLAIN' => 'New members are within the Newly Registered Users group until they reach this number of posts. You can use this group to keep them from using the PM system or to review their posts. A value of 0 disables this feature.', + 'NEW_MEMBER_GROUP_DEFAULT' => 'Set Newly Registered Users group to default', + 'NEW_MEMBER_GROUP_DEFAULT_EXPLAIN' => 'If set to yes, and a new member post limit is specified, newly registered users will not only be put into the Newly Registered Users group, but this group will also be their default one. This may come in handy if you want to assign a group default rank and/or avatar the user then inherits.', + + 'ACC_ADMIN' => 'By admin', + 'ACC_DISABLE' => 'Disable registration', + 'ACC_NONE' => 'No activation (immediate access)', + 'ACC_USER' => 'By user (email verification)', +// 'ACC_USER_ADMIN' => 'User + Admin', + 'ALLOW_EMAIL_REUSE' => 'Allow email address re-use', + 'ALLOW_EMAIL_REUSE_EXPLAIN' => 'Different users can register with the same email address.', + 'COPPA' => 'COPPA', + 'COPPA_FAX' => 'COPPA fax number', + 'COPPA_MAIL' => 'COPPA mailing address', + 'COPPA_MAIL_EXPLAIN' => 'This is the mailing address where parents will send COPPA registration forms.', + 'ENABLE_COPPA' => 'Enable COPPA', + 'ENABLE_COPPA_EXPLAIN' => 'This requires users to declare whether they are 13 or over for compliance with the U.S. COPPA. If this is disabled the COPPA specific groups will no longer be displayed.', + 'MAX_CHARS' => 'Max', + 'MIN_CHARS' => 'Min', + 'NO_AUTH_PLUGIN' => 'No suitable auth plugin found.', + 'PASSWORD_LENGTH' => 'Password length', + 'PASSWORD_LENGTH_EXPLAIN' => 'Minimum and maximum number of characters in passwords.', + 'REG_LIMIT' => 'Registration attempts', + 'REG_LIMIT_EXPLAIN' => 'Number of attempts users can make at solving the anti-spambot task before being locked out of that session.', + 'USERNAME_ALPHA_ONLY' => 'Alphanumeric only', + 'USERNAME_ALPHA_SPACERS' => 'Alphanumeric and spacers', + 'USERNAME_ASCII' => 'ASCII (no international unicode)', + 'USERNAME_LETTER_NUM' => 'Any letter and number', + 'USERNAME_LETTER_NUM_SPACERS' => 'Any letter, number, and spacer', + 'USERNAME_CHARS' => 'Limit username chars', + 'USERNAME_CHARS_ANY' => 'Any character', + 'USERNAME_CHARS_EXPLAIN' => 'Restrict type of characters that may be used in usernames, spacers are: space, -, +, _, [ and ].', + 'USERNAME_LENGTH' => 'Username length', + 'USERNAME_LENGTH_EXPLAIN' => 'Minimum and maximum number of characters in usernames.', +)); + +// Feeds +$lang = array_merge($lang, array( + 'ACP_FEED_MANAGEMENT' => 'General syndication feeds settings', + 'ACP_FEED_MANAGEMENT_EXPLAIN' => 'This module makes available various ATOM feeds, parsing any BBCode in posts to make them readable in external feeds.', + + 'ACP_FEED_GENERAL' => 'General feed settings', + 'ACP_FEED_POST_BASED' => 'Post-based feed settings', + 'ACP_FEED_TOPIC_BASED' => 'Topic-based feed settings', + 'ACP_FEED_SETTINGS_OTHER' => 'Other feeds and settings', + + 'ACP_FEED_ENABLE' => 'Enable feeds', + 'ACP_FEED_ENABLE_EXPLAIN' => 'Turns on or off ATOM feeds for the entire board.
Disabling this switches off all feeds, no matter how the options below are set.', + 'ACP_FEED_LIMIT' => 'Number of items', + 'ACP_FEED_LIMIT_EXPLAIN' => 'The maximum number of feed items to display.', + + 'ACP_FEED_OVERALL' => 'Enable board-wide feed', + 'ACP_FEED_OVERALL_EXPLAIN' => 'Board-wide new posts.', + 'ACP_FEED_FORUM' => 'Enable per-forum feeds', + 'ACP_FEED_FORUM_EXPLAIN' => 'Single forum and subforums new posts.', + 'ACP_FEED_TOPIC' => 'Enable per-topic feeds', + 'ACP_FEED_TOPIC_EXPLAIN' => 'Single topics new posts.', + + 'ACP_FEED_TOPICS_NEW' => 'Enable new topics feed', + 'ACP_FEED_TOPICS_NEW_EXPLAIN' => 'Enables the “New Topics†feed, which displays the last created topics including the first post.', + 'ACP_FEED_TOPICS_ACTIVE' => 'Enable active topics feed', + 'ACP_FEED_TOPICS_ACTIVE_EXPLAIN' => 'Enables the “Active Topics†feed, which displays the last active topics including the last post.', + 'ACP_FEED_NEWS' => 'News feed', + 'ACP_FEED_NEWS_EXPLAIN' => 'Pull the first post from these forums. Select no forums to disable news feed.
Select multiple forums by holding CTRL and clicking.', + + 'ACP_FEED_OVERALL_FORUMS' => 'Enable forums feed', + 'ACP_FEED_OVERALL_FORUMS_EXPLAIN' => 'Enables the “All forums†feed, which displays a list of forums.', + + 'ACP_FEED_HTTP_AUTH' => 'Allow HTTP Authentication', + 'ACP_FEED_HTTP_AUTH_EXPLAIN' => 'Enables HTTP authentication, which allows users to receive content that is hidden to guest users by adding the auth=http parameter to the feed URL. Please note that some PHP setups require additional changes to the .htaccess file. Instructions can be found in that file.', + 'ACP_FEED_ITEM_STATISTICS' => 'Item statistics', + 'ACP_FEED_ITEM_STATISTICS_EXPLAIN' => 'Display individual statistics underneath feed items
(e.g. posted by, date and time, replies, views)', + 'ACP_FEED_EXCLUDE_ID' => 'Exclude these forums', + 'ACP_FEED_EXCLUDE_ID_EXPLAIN' => 'Content from these will be not included in feeds. Select no forum to pull data from all forums.
Select/Deselect multiple forums by holding CTRL and clicking.', +)); + +// Visual Confirmation Settings +$lang = array_merge($lang, array( + 'ACP_VC_SETTINGS_EXPLAIN' => 'Here you can select and configure plugins, which are designed to block automated form submissions by spambots. These plugins typically work by challenging the user with a CAPTCHA, a test which is designed to be difficult for computers to solve.', + 'ACP_VC_EXT_GET_MORE' => 'For additional (and possibly better) anti-spam plugins, visit the phpBB.com Extensions Database. For more information on preventing spam on your board, visit the phpBB.com Knowledge Base.', + 'AVAILABLE_CAPTCHAS' => 'Available plugins', + 'CAPTCHA_UNAVAILABLE' => 'The plugin cannot be selected as its requirements are not met.', + 'CAPTCHA_GD' => 'GD image', + 'CAPTCHA_GD_3D' => 'GD 3D image', + 'CAPTCHA_GD_FOREGROUND_NOISE' => 'Foreground noise', + 'CAPTCHA_GD_EXPLAIN' => 'Uses GD to make a more advanced anti-spambot image.', + 'CAPTCHA_GD_FOREGROUND_NOISE_EXPLAIN' => 'Use foreground noise to make the image harder to read.', + 'CAPTCHA_GD_X_GRID' => 'Background noise x-axis', + 'CAPTCHA_GD_X_GRID_EXPLAIN' => 'Use lower settings of this to make the image harder to read. 0 will disable x-axis background noise.', + 'CAPTCHA_GD_Y_GRID' => 'Background noise y-axis', + 'CAPTCHA_GD_Y_GRID_EXPLAIN' => 'Use lower settings of this to make the image harder to read. 0 will disable y-axis background noise.', + 'CAPTCHA_GD_WAVE' => 'Wave distortion', + 'CAPTCHA_GD_WAVE_EXPLAIN' => 'This applies a wave distortion to the image.', + 'CAPTCHA_GD_3D_NOISE' => 'Add 3D-noise objects', + 'CAPTCHA_GD_3D_NOISE_EXPLAIN' => 'This adds additional objects to the image, over the letters.', + 'CAPTCHA_GD_FONTS' => 'Use different fonts', + 'CAPTCHA_GD_FONTS_EXPLAIN' => 'This setting controls how many different letter shapes are used. You can just use the default shapes or introduce altered letters. Adding lowercase letters is also possible.', + 'CAPTCHA_FONT_DEFAULT' => 'Default', + 'CAPTCHA_FONT_NEW' => 'New Shapes', + 'CAPTCHA_FONT_LOWER' => 'Also use lowercase', + 'CAPTCHA_NO_GD' => 'Simple image', + 'CAPTCHA_PREVIEW_MSG' => 'Your changes have not been saved, this is just a preview.', + 'CAPTCHA_PREVIEW_EXPLAIN' => 'The plugin as it would look like using the current selection.', + + 'CAPTCHA_SELECT' => 'Installed plugins', + 'CAPTCHA_SELECT_EXPLAIN' => 'The dropdown holds the plugins recognised by the board. Grey entries are not available right now and might need configuration prior to use.', + 'CAPTCHA_CONFIGURE' => 'Configure plugins', + 'CAPTCHA_CONFIGURE_EXPLAIN' => 'Change the settings for the selected plugin.', + 'CONFIGURE' => 'Configure', + 'CAPTCHA_NO_OPTIONS' => 'This plugin has no configuration options.', + + 'VISUAL_CONFIRM_POST' => 'Enable spambot countermeasures for guest postings', + 'VISUAL_CONFIRM_POST_EXPLAIN' => 'Requires guest users to pass the anti-spambot task to help prevent automated postings.', + 'VISUAL_CONFIRM_REG' => 'Enable spambot countermeasures for registrations', + 'VISUAL_CONFIRM_REG_EXPLAIN' => 'Requires new users to pass the anti-spambot task to help prevent automated registrations.', + 'VISUAL_CONFIRM_REFRESH' => 'Allow users to refresh the anti-spambot task', + 'VISUAL_CONFIRM_REFRESH_EXPLAIN' => 'Allows users to request a new anti-spambot task if they are unable to solve the current task during registration. Some plugins might not support this option.', +)); + +// Cookie Settings +$lang = array_merge($lang, array( + 'ACP_COOKIE_SETTINGS_EXPLAIN' => 'These details define the data used to send cookies to your users browsers. In most cases the default values for the cookie settings should be sufficient. If you do need to change any do so with care, incorrect settings can prevent users logging in.', + + 'COOKIE_DOMAIN' => 'Cookie domain', + 'COOKIE_NAME' => 'Cookie name', + 'COOKIE_PATH' => 'Cookie path', + 'COOKIE_SECURE' => 'Cookie secure', + 'COOKIE_SECURE_EXPLAIN' => 'If your server is running via SSL set this to enabled else leave as disabled. Having this enabled and not running via SSL will result in server errors during redirects.', + 'ONLINE_LENGTH' => 'View online time span', + 'ONLINE_LENGTH_EXPLAIN' => 'Number of minutes after which inactive users will not appear in “Who is online†listings. The higher this value the greater is the processing required to generate the listing.', + 'SESSION_LENGTH' => 'Session length', + 'SESSION_LENGTH_EXPLAIN' => 'Sessions will expire after this time, in seconds.', +)); + +// Contact Settings +$lang = array_merge($lang, array( + 'ACP_CONTACT_SETTINGS_EXPLAIN' => 'Here you can enable and disable the contact page and also add a text that is displayed on the page.', + + 'CONTACT_US_ENABLE' => 'Enable contact page', + 'CONTACT_US_ENABLE_EXPLAIN' => 'This page allows users to send emails to board administrators', + + 'CONTACT_US_INFO' => 'Contact information', + 'CONTACT_US_INFO_EXPLAIN' => 'The message is displayed on the contact page', + 'CONTACT_US_INFO_PREVIEW' => 'Contact page information - Preview', + 'CONTACT_US_INFO_UPDATED' => 'Contact page information has been updated.', +)); + +// Load Settings +$lang = array_merge($lang, array( + 'ACP_LOAD_SETTINGS_EXPLAIN' => 'Here you can enable and disable certain board functions to reduce the amount of processing required. On most servers there is no need to disable any functions. However on certain systems or in shared hosting environments it may be beneficial to disable capabilities you do not really need. You can also specify limits for system load and active sessions beyond which the board will go offline.', + + 'ALLOW_CDN' => 'Allow usage of third party content delivery networks', + 'ALLOW_CDN_EXPLAIN' => 'If this setting is enabled, some files will be served from external third party servers instead of your server. This reduces the network bandwidth required by your server, but may present a privacy issue for some board administrators. In a default phpBB installation, this includes loading “jQuery†and the font “Open Sans†from Google’s content delivery network.', + 'ALLOW_LIVE_SEARCHES' => 'Allow live searches', + 'ALLOW_LIVE_SEARCHES_EXPLAIN' => 'If this setting is enabled, users are provided with keyword suggestions as they type in certain fields throughout the board.', + 'CUSTOM_PROFILE_FIELDS' => 'Custom profile fields', + 'LIMIT_LOAD' => 'Limit system load', + 'LIMIT_LOAD_EXPLAIN' => 'If the system’s 1-minute load average exceeds this value the board will automatically go offline. A value of 1.0 equals ~100% utilisation of one processor. This only functions on UNIX based servers and where this information is accessible. The value here resets itself to 0 if phpBB was unable to get the load limit.', + 'LIMIT_SESSIONS' => 'Limit sessions', + 'LIMIT_SESSIONS_EXPLAIN' => 'If the number of sessions exceeds this value within a one minute period the board will go offline. Set to 0 for unlimited sessions.', + 'LOAD_CPF_MEMBERLIST' => 'Allow styles to display custom profile fields in memberlist', + 'LOAD_CPF_PM' => 'Display custom profile fields in private messages', + 'LOAD_CPF_VIEWPROFILE' => 'Display custom profile fields in user profiles', + 'LOAD_CPF_VIEWTOPIC' => 'Display custom profile fields on topic pages', + 'LOAD_USER_ACTIVITY' => 'Show user’s activity', + 'LOAD_USER_ACTIVITY_EXPLAIN' => 'Displays active topic/forum in user profiles and user control panel. It is recommended to disable this on boards with more than one million posts.', + 'READ_NOTIFICATION_EXPIRE_DAYS' => 'Read Notification Expiration', + 'READ_NOTIFICATION_EXPIRE_DAYS_EXPLAIN' => 'Number of days that will elapse before a read notification will automatically be deleted. Set this value to 0 to make notifications permanent.', + 'RECOMPILE_STYLES' => 'Recompile stale style components', + 'RECOMPILE_STYLES_EXPLAIN' => 'Check for updated style components on filesystem and recompile.', + 'YES_ANON_READ_MARKING' => 'Enable topic marking for guests', + 'YES_ANON_READ_MARKING_EXPLAIN' => 'Stores read/unread status information for guests. If disabled, posts are always marked read for guests.', + 'YES_BIRTHDAYS' => 'Enable birthday listing', + 'YES_BIRTHDAYS_EXPLAIN' => 'If disabled the birthday listing is no longer displayed. To let this setting take effect the birthday feature needs to be enabled too.', + 'YES_JUMPBOX' => 'Enable display of jumpbox', + 'YES_MODERATORS' => 'Enable display of moderators', + 'YES_ONLINE' => 'Enable online user listings', + 'YES_ONLINE_EXPLAIN' => 'Display online user information on index, forum and topic pages.', + 'YES_ONLINE_GUESTS' => 'Enable online guest listings in viewonline', + 'YES_ONLINE_GUESTS_EXPLAIN' => 'Allow display of guest user information in viewonline.', + 'YES_ONLINE_TRACK' => 'Enable display of user online/offline information', + 'YES_ONLINE_TRACK_EXPLAIN' => 'Display online information for user in profiles and topic pages.', + 'YES_POST_MARKING' => 'Enable dotted topics', + 'YES_POST_MARKING_EXPLAIN' => 'Indicates whether user has posted to a topic.', + 'YES_READ_MARKING' => 'Enable server-side topic marking', + 'YES_READ_MARKING_EXPLAIN' => 'Stores read/unread status information in the database rather than a cookie.', + 'YES_UNREAD_SEARCH' => 'Enable search for unread posts', +)); + +// Auth settings +$lang = array_merge($lang, array( + 'ACP_AUTH_SETTINGS_EXPLAIN' => 'phpBB supports authentication plug-ins, or modules. These allow you determine how users are authenticated when they log into the board. By default four plug-ins are provided: DB, LDAP, Apache, and OAuth. Not all methods require additional information so only fill out fields if they are relevant to the selected method.', + + 'AUTH_METHOD' => 'Select an authentication method', + + 'AUTH_PROVIDER_OAUTH_ERROR_ELEMENT_MISSING' => 'Both the key and secret of each enabled OAuth service provider must be provided. Only one was provided for an OAuth service provider.', + 'AUTH_PROVIDER_OAUTH_EXPLAIN' => 'Each OAuth provider requires a unique secret and key in order to authenticate with the external server. These should be supplied by the OAuth service when you register your website with them and should be entered exactly as provided to you.
Any service that does not have both a key and a secret entered here will not be available for use by the forum users. Also note, that user can still register and login using the DB authentication plug-in.', + 'AUTH_PROVIDER_OAUTH_KEY' => 'Key', + 'AUTH_PROVIDER_OAUTH_TITLE' => 'OAuth', + 'AUTH_PROVIDER_OAUTH_SECRET' => 'Secret', + + 'APACHE_SETUP_BEFORE_USE' => 'You have to setup apache authentication before you switch phpBB to this authentication method. Keep in mind that the username you use for apache authentication has to be the same as your phpBB username. Apache authentication can only be used with mod_php (not with a CGI version) and safe_mode disabled.', + + 'LDAP' => 'LDAP', + 'LDAP_DN' => 'LDAP base dn', + 'LDAP_DN_EXPLAIN' => 'This is the Distinguished Name, locating the user information, e.g. o=My Company,c=US.', + 'LDAP_EMAIL' => 'LDAP email attribute', + 'LDAP_EMAIL_EXPLAIN' => 'Set this to the name of your user entry email attribute (if one exists) in order to automatically set the email address for new users. Leaving this empty results in empty email address for users who log in for the first time.', + 'LDAP_INCORRECT_USER_PASSWORD' => 'Binding to LDAP server failed with specified user/password.', + 'LDAP_NO_EMAIL' => 'The specified email attribute does not exist.', + 'LDAP_NO_IDENTITY' => 'Could not find a login identity for %s.', + 'LDAP_PASSWORD' => 'LDAP password', + 'LDAP_PASSWORD_EXPLAIN' => 'Leave blank to use anonymous binding, otherwise fill in the password for the above user. Required for Active Directory Servers.
Warning: This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.', + 'LDAP_PORT' => 'LDAP server port', + 'LDAP_PORT_EXPLAIN' => 'Optionally you can specify a port which should be used to connect to the LDAP server instead of the default port 389.', + 'LDAP_SERVER' => 'LDAP server name', + 'LDAP_SERVER_EXPLAIN' => 'If using LDAP this is the hostname or IP address of the LDAP server. Alternatively you can specify an URL like ldap://hostname:port/', + 'LDAP_UID' => 'LDAP uid', + 'LDAP_UID_EXPLAIN' => 'This is the key under which to search for a given login identity, e.g. uid, sn, etc.', + 'LDAP_USER' => 'LDAP user dn', + 'LDAP_USER_EXPLAIN' => 'Leave blank to use anonymous binding. If filled in phpBB uses the specified distinguished name on login attempts to find the correct user, e.g. uid=Username,ou=MyUnit,o=MyCompany,c=US. Required for Active Directory Servers.', + 'LDAP_USER_FILTER' => 'LDAP user filter', + 'LDAP_USER_FILTER_EXPLAIN' => 'Optionally you can further limit the searched objects with additional filters. For example objectClass=posixGroup would result in the use of (&(uid=$username)(objectClass=posixGroup))', +)); + +// Server Settings +$lang = array_merge($lang, array( + 'ACP_SERVER_SETTINGS_EXPLAIN' => 'Here you define server and domain dependent settings. Please ensure the data you enter is accurate, errors will result in emails containing incorrect information. When entering the domain name remember it does include http:// or other protocol term. Only alter the port number if you know your server uses a different value, port 80 is correct in most cases.', + + 'ENABLE_GZIP' => 'Enable GZip compression', + 'ENABLE_GZIP_EXPLAIN' => 'Generated content will be compressed prior to sending it to the user. This can reduce network traffic but will also increase CPU usage on both server and client side. Requires zlib PHP extension to be loaded.', + 'FORCE_SERVER_VARS' => 'Force server URL settings', + 'FORCE_SERVER_VARS_EXPLAIN' => 'If set to yes the server settings defined here will be used in favour of the automatically determined values.', + 'ICONS_PATH' => 'Post icons storage path', + 'ICONS_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. images/icons.', + 'MOD_REWRITE_ENABLE' => 'Enable URL Rewriting', + 'MOD_REWRITE_ENABLE_EXPLAIN' => 'When enabled, URLs containing ’app.php’ will be rewritten to remove the filename (i.e. app.php/foo will become /foo). Apache server’s mod_rewrite module is required for this functionality to work; if this option is enabled without mod_rewrite support, URLs on your board may be broken.', + 'MOD_REWRITE_DISABLED' => 'The mod_rewrite module on your Apache web server is disabled. Enable the module or contact your web hosting provider if you wish to enable this feature.', + 'MOD_REWRITE_INFORMATION_UNAVAILABLE' => 'We are unable to determine whether or not this server supports URL rewriting. This setting may be enabled but if URL rewriting is not available, paths generated by this board (such as for use in links) may be broken. Contact your web hosting provider if you are unsure whether or not you can safely enable this feature.', + 'PATH_SETTINGS' => 'Path settings', + 'RANKS_PATH' => 'Rank image storage path', + 'RANKS_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. images/ranks.', + 'SCRIPT_PATH' => 'Script path', + 'SCRIPT_PATH_EXPLAIN' => 'The path where phpBB is located relative to the domain name, e.g. /phpBB3.', + 'SERVER_NAME' => 'Domain name', + 'SERVER_NAME_EXPLAIN' => 'The domain name this board runs from (for example: www.example.com).', + 'SERVER_PORT' => 'Server port', + 'SERVER_PORT_EXPLAIN' => 'The port your server is running on, usually 80, only change if different.', + 'SERVER_PROTOCOL' => 'Server protocol', + 'SERVER_PROTOCOL_EXPLAIN' => 'This is used as the server protocol if these settings are forced. If empty or not forced the protocol is determined by the cookie secure settings (http:// or https://).', + 'SERVER_URL_SETTINGS' => 'Server URL settings', + 'SMILIES_PATH' => 'Smilies storage path', + 'SMILIES_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. images/smilies.', + 'UPLOAD_ICONS_PATH' => 'Extension group icons storage path', + 'UPLOAD_ICONS_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. images/upload_icons.', + 'USE_SYSTEM_CRON' => 'Run periodic tasks from system cron', + 'USE_SYSTEM_CRON_EXPLAIN' => 'When off, phpBB will arrange for periodic tasks to be run automatically. When on, phpBB will not schedule any periodic tasks by itself; a system administrator must arrange for bin/phpbbcli.php cron:run to be run by the system cron facility at regular intervals (e.g. every 5 minutes).', +)); + +// Security Settings +$lang = array_merge($lang, array( + 'ACP_SECURITY_SETTINGS_EXPLAIN' => 'Here you are able to define session and login related settings.', + + 'ALL' => 'All', + 'ALLOW_AUTOLOGIN' => 'Allow "Remember Me" logins', + 'ALLOW_AUTOLOGIN_EXPLAIN' => 'Determines whether users are given "Remember Me" option when they visit the board.', + 'ALLOW_PASSWORD_RESET' => 'Allow password reset ("Forgot Password")', + 'ALLOW_PASSWORD_RESET_EXPLAIN' => 'Determines whether or not users are able to use the "I forgot my password" link on the login page to recover their account. If you use an external authentication mechanism you may wish to disable this feature.', + 'AUTOLOGIN_LENGTH' => '"Remember Me" login key expiration length (in days)', + 'AUTOLOGIN_LENGTH_EXPLAIN' => 'Number of days after which "Remember Me" login keys are removed or zero to disable.', + 'BROWSER_VALID' => 'Validate browser', + 'BROWSER_VALID_EXPLAIN' => 'Enables browser validation for each session improving security.', + 'CHECK_DNSBL' => 'Check IP against DNS Blackhole List', + 'CHECK_DNSBL_EXPLAIN' => 'If enabled the user’s IP address is checked against the following DNSBL services on registration and posting: spamcop.net and www.spamhaus.org. This lookup may take a while, depending on the server’s configuration. If slowdowns are experienced or too many false positives reported it is recommended to disable this check.', + 'CLASS_B' => 'A.B', + 'CLASS_C' => 'A.B.C', + 'EMAIL_CHECK_MX' => 'Check email domain for valid MX record', + 'EMAIL_CHECK_MX_EXPLAIN' => 'If enabled, the email domain provided on registration and profile changes is checked for a valid MX record.', + 'FORCE_PASS_CHANGE' => 'Force password change', + 'FORCE_PASS_CHANGE_EXPLAIN' => 'Require user to change their password after a set number of days. Setting this value to 0 disables this behaviour.', + 'FORM_TIME_MAX' => 'Maximum time to submit forms', + 'FORM_TIME_MAX_EXPLAIN' => 'The time a user has to submit a form. Use -1 to disable. Note that a form might become invalid if the session expires, regardless of this setting.', + 'FORM_SID_GUESTS' => 'Tie forms to guest sessions', + 'FORM_SID_GUESTS_EXPLAIN' => 'If enabled, the form token issued to guests will be session-exclusive. This can cause problems with some ISPs.', + 'FORWARDED_FOR_VALID' => 'Validate X_FORWARDED_FOR header', + 'FORWARDED_FOR_VALID_EXPLAIN' => 'Sessions will only be continued if the sent X_FORWARDED_FOR header equals the one sent with the previous request. Bans will be checked against IPs in X_FORWARDED_FOR too.', + 'IP_VALID' => 'Session IP validation', + 'IP_VALID_EXPLAIN' => 'Determines how much of the users IP is used to validate a session; All compares the complete address, A.B.C the first x.x.x, A.B the first x.x, None disables checking. On IPv6 addresses A.B.C compares the first 4 blocks and A.B the first 3 blocks.', + 'IP_LOGIN_LIMIT_MAX' => 'Maximum number of login attempts per IP address', + 'IP_LOGIN_LIMIT_MAX_EXPLAIN' => 'The threshold of login attempts allowed from a single IP address before an anti-spambot task is triggered. Enter 0 to prevent the anti-spambot task from being triggered by IP addresses.', + 'IP_LOGIN_LIMIT_TIME' => 'IP address login attempt expiration time', + 'IP_LOGIN_LIMIT_TIME_EXPLAIN' => 'Login attempts expire after this period.', + 'IP_LOGIN_LIMIT_USE_FORWARDED' => 'Limit login attempts by X_FORWARDED_FOR header', + 'IP_LOGIN_LIMIT_USE_FORWARDED_EXPLAIN' => 'Instead of limiting login attempts by IP address they are limited by X_FORWARDED_FOR values.
Warning: Only enable this if you are operating a proxy server that sets X_FORWARDED_FOR to trustworthy values.', + 'MAX_LOGIN_ATTEMPTS' => 'Maximum number of login attempts per username', + 'MAX_LOGIN_ATTEMPTS_EXPLAIN' => 'The number of login attempts allowed for a single account before the anti-spambot task is triggered. Enter 0 to prevent the anti-spambot task from being triggered for distinct user accounts.', + 'NO_IP_VALIDATION' => 'None', + 'NO_REF_VALIDATION' => 'None', + 'PASSWORD_TYPE' => 'Password complexity', + 'PASSWORD_TYPE_EXPLAIN' => 'Determines how complex a password needs to be when set or altered, subsequent options include the previous ones.', + 'PASS_TYPE_ALPHA' => 'Must contain letters and numbers', + 'PASS_TYPE_ANY' => 'No requirements', + 'PASS_TYPE_CASE' => 'Must be mixed case', + 'PASS_TYPE_SYMBOL' => 'Must contain symbols', + 'REF_HOST' => 'Only validate host', + 'REF_PATH' => 'Also validate path', + 'REFERRER_VALID' => 'Validate Referrer', + 'REFERRER_VALID_EXPLAIN' => 'If enabled, the referrer of POST requests will be checked against the host/script path settings. This may cause issues with boards using several domains and or external logins.', + 'TPL_ALLOW_PHP' => 'Allow php in templates', + 'TPL_ALLOW_PHP_EXPLAIN' => 'If this option is enabled, PHP and INCLUDEPHP statements will be recognised and parsed in templates.', +)); + +// Email Settings +$lang = array_merge($lang, array( + 'ACP_EMAIL_SETTINGS_EXPLAIN' => 'This information is used when the board sends emails to your users. Please ensure the email address you specify is valid, any bounced or undeliverable messages will likely be sent to that address. If your host does not provide a native (PHP based) email service you can instead send messages directly using SMTP. This requires the address of an appropriate server (ask your provider if necessary). If the server requires authentication (and only if it does) enter the necessary username, password and authentication method.', + + 'ADMIN_EMAIL' => 'Return email address', + 'ADMIN_EMAIL_EXPLAIN' => 'This will be used as the return address on all emails, the technical contact email address. It will always be used as the Return-Path and Sender address in emails.', + 'BOARD_EMAIL_FORM' => 'Users send email via board', + 'BOARD_EMAIL_FORM_EXPLAIN' => 'Instead of showing the users email address users are able to send emails via the board.', + 'BOARD_HIDE_EMAILS' => 'Hide email addresses', + 'BOARD_HIDE_EMAILS_EXPLAIN' => 'This function keeps email addresses completely private.', + 'CONTACT_EMAIL' => 'Contact email address', + 'CONTACT_EMAIL_EXPLAIN' => 'This address will be used whenever a specific contact point is needed, e.g. spam, error output, etc. It will always be used as the From and Reply-To address in emails.', + 'CONTACT_EMAIL_NAME' => 'Contact name', + 'CONTACT_EMAIL_NAME_EXPLAIN' => 'This is the contact name that e-mail recipients will see. If you don’t want to have a contact name, leave this field empty.', + 'EMAIL_FUNCTION_NAME' => 'Email function name', + 'EMAIL_FUNCTION_NAME_EXPLAIN' => 'The email function used to send mails through PHP.', + 'EMAIL_PACKAGE_SIZE' => 'Email package size', + 'EMAIL_PACKAGE_SIZE_EXPLAIN' => 'This is the number of maximum emails sent out in one package. This setting is applied to the internal message queue; set this value to 0 if you have problems with non-delivered notification emails.', + 'EMAIL_SIG' => 'Email signature', + 'EMAIL_SIG_EXPLAIN' => 'This text will be attached to all emails the board sends.', + 'ENABLE_EMAIL' => 'Enable board-wide emails', + 'ENABLE_EMAIL_EXPLAIN' => 'If this is set to disabled no emails will be sent by the board at all. Note the user and admin account activation settings require this setting to be enabled. If currently using “user†or “admin†activation in the activation settings, disabling this setting will disable registration.', + 'SMTP_AUTH_METHOD' => 'Authentication method for SMTP', + 'SMTP_AUTH_METHOD_EXPLAIN' => 'Only used if a username/password is set, ask your provider if you are unsure which method to use.', + 'SMTP_CRAM_MD5' => 'CRAM-MD5', + 'SMTP_DIGEST_MD5' => 'DIGEST-MD5', + 'SMTP_LOGIN' => 'LOGIN', + 'SMTP_PASSWORD' => 'SMTP password', + 'SMTP_PASSWORD_EXPLAIN' => 'Only enter a password if your SMTP server requires it.
Warning: This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.', + 'SMTP_PLAIN' => 'PLAIN', + 'SMTP_POP_BEFORE_SMTP' => 'POP-BEFORE-SMTP', + 'SMTP_PORT' => 'SMTP server port', + 'SMTP_PORT_EXPLAIN' => 'Only change this if you know your SMTP server is on a different port.', + 'SMTP_SERVER' => 'SMTP server address', + 'SMTP_SETTINGS' => 'SMTP settings', + 'SMTP_USERNAME' => 'SMTP username', + 'SMTP_USERNAME_EXPLAIN' => 'Only enter a username if your SMTP server requires it.', + 'USE_SMTP' => 'Use SMTP server for email', + 'USE_SMTP_EXPLAIN' => 'Select “Yes†if you want or have to send email via a named server instead of the local mail function.', +)); + +// Jabber settings +$lang = array_merge($lang, array( + 'ACP_JABBER_SETTINGS_EXPLAIN' => 'Here you can enable and control the use of Jabber for instant messaging and board notifications. Jabber is an open source protocol and therefore available for use by anyone. Some Jabber servers include gateways or transports which allow you to contact users on other networks. Not all servers offer all transports and changes in protocols can prevent transports from operating. Please be sure to enter already registered account details - phpBB will use the details you enter here as is.', + + 'JAB_ENABLE' => 'Enable Jabber', + 'JAB_ENABLE_EXPLAIN' => 'Enables use of Jabber messaging and notifications.', + 'JAB_GTALK_NOTE' => 'Please note that GTalk will not work because the dns_get_record function could not be found. This function is not available in PHP4, and is not implemented on Windows platforms. It currently does not work on BSD-based systems, including Mac OS.', + 'JAB_PACKAGE_SIZE' => 'Jabber package size', + 'JAB_PACKAGE_SIZE_EXPLAIN' => 'This is the number of messages sent in one package. If set to 0 the message is sent immediately and will not be queued for later sending.', + 'JAB_PASSWORD' => 'Jabber password', + 'JAB_PASSWORD_EXPLAIN' => 'Warning: This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.', + 'JAB_PORT' => 'Jabber port', + 'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not port 5222.', + 'JAB_SERVER' => 'Jabber server', + 'JAB_SERVER_EXPLAIN' => 'See %sjabber.org%s for a list of servers.', + 'JAB_SETTINGS_CHANGED' => 'Jabber settings changed successfully.', + 'JAB_USE_SSL' => 'Use SSL to connect', + 'JAB_USE_SSL_EXPLAIN' => 'If enabled a secure connection is tried to be established. The Jabber port will be modified to 5223 if port 5222 is specified.', + 'JAB_USERNAME' => 'Jabber username or JID', + 'JAB_USERNAME_EXPLAIN' => 'Specify a registered username or a valid JID. The username will not be checked for validity. If you only specify a username, then your JID will be the username and the server you specified above. Else, specify a valid JID, for example user@jabber.org.', +)); diff --git a/sources/phpBB/language/en/acp/bots.php b/sources/phpBB/language/en/acp/bots.php new file mode 100644 index 0000000..1429228 --- /dev/null +++ b/sources/phpBB/language/en/acp/bots.php @@ -0,0 +1,72 @@ + +* @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 + +// Bot settings +$lang = array_merge($lang, array( + 'BOTS' => 'Manage bots', + 'BOTS_EXPLAIN' => '“Botsâ€, “spiders†or “crawlers†are automated agents most commonly used by search engines to update their databases. Since they rarely make proper use of sessions they can distort visitor counts, increase load and sometimes fail to index sites correctly. Here you can define a special type of user to overcome these problems.', + 'BOT_ACTIVATE' => 'Activate', + 'BOT_ACTIVE' => 'Bot active', + 'BOT_ADD' => 'Add bot', + 'BOT_ADDED' => 'New bot successfully added.', + 'BOT_AGENT' => 'Agent match', + 'BOT_AGENT_EXPLAIN' => 'A string matching the bots browser agent, partial matches are allowed.', + 'BOT_DEACTIVATE' => 'Deactivate', + 'BOT_DELETED' => 'Bot deleted successfully.', + 'BOT_EDIT' => 'Edit bots', + 'BOT_EDIT_EXPLAIN' => 'Here you can add or edit an existing bot entry. You may define an agent string and/or one or more IP addresses (or range of addresses) to match. Be careful when defining matching agent strings or addresses. You may also specify a style and language that the bot will view the board using. This may allow you to reduce bandwidth use by setting a simple style for bots. Remember to set appropriate permissions for the special Bot usergroup.', + 'BOT_LANG' => 'Bot language', + 'BOT_LANG_EXPLAIN' => 'The language presented to the bot as it browses.', + 'BOT_LAST_VISIT' => 'Last visit', + 'BOT_IP' => 'Bot IP address', + 'BOT_IP_EXPLAIN' => 'Partial matches are allowed, separate addresses with a comma.', + 'BOT_NAME' => 'Bot name', + 'BOT_NAME_EXPLAIN' => 'Used only for your own information.', + 'BOT_NAME_TAKEN' => 'The name is already in use on your board and can’t be used for the Bot.', + 'BOT_NEVER' => 'Never', + 'BOT_STYLE' => 'Bot style', + 'BOT_STYLE_EXPLAIN' => 'The style used for the board by the bot.', + 'BOT_UPDATED' => 'Existing bot updated successfully.', + + 'ERR_BOT_AGENT_MATCHES_UA' => 'The bot agent you supplied is similar to the one you are currently using. Please adjust the agent for this bot.', + 'ERR_BOT_NO_IP' => 'The IP addresses you supplied were invalid or the hostname could not be resolved.', + 'ERR_BOT_NO_MATCHES' => 'You must supply at least one of an agent or IP for this bot match.', + + 'NO_BOT' => 'Found no bot with the specified ID.', + 'NO_BOT_GROUP' => 'Unable to find special bot group.', +)); diff --git a/sources/phpBB/language/en/acp/common.php b/sources/phpBB/language/en/acp/common.php new file mode 100644 index 0000000..fdbc4ae --- /dev/null +++ b/sources/phpBB/language/en/acp/common.php @@ -0,0 +1,796 @@ + +* @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 +$lang = array_merge($lang, array( + 'ACP_ADMINISTRATORS' => 'Administrators', + 'ACP_ADMIN_LOGS' => 'Admin log', + 'ACP_ADMIN_ROLES' => 'Admin roles', + 'ACP_ATTACHMENTS' => 'Attachments', + 'ACP_ATTACHMENT_SETTINGS' => 'Attachment settings', + 'ACP_AUTH_SETTINGS' => 'Authentication', + 'ACP_AUTOMATION' => 'Automation', + 'ACP_AVATAR_SETTINGS' => 'Avatar settings', + + 'ACP_BACKUP' => 'Backup', + 'ACP_BAN' => 'Banning', + 'ACP_BAN_EMAILS' => 'Ban emails', + 'ACP_BAN_IPS' => 'Ban IPs', + 'ACP_BAN_USERNAMES' => 'Ban users', + 'ACP_BBCODES' => 'BBCodes', + 'ACP_BOARD_CONFIGURATION' => 'Board configuration', + 'ACP_BOARD_FEATURES' => 'Board features', + 'ACP_BOARD_MANAGEMENT' => 'Board management', + 'ACP_BOARD_SETTINGS' => 'Board settings', + 'ACP_BOTS' => 'Spiders/Robots', + + 'ACP_CAPTCHA' => 'CAPTCHA', + + 'ACP_CAT_CUSTOMISE' => 'Customise', + 'ACP_CAT_DATABASE' => 'Database', + 'ACP_CAT_DOT_MODS' => 'Extensions', + 'ACP_CAT_FORUMS' => 'Forums', + 'ACP_CAT_GENERAL' => 'General', + 'ACP_CAT_MAINTENANCE' => 'Maintenance', + 'ACP_CAT_PERMISSIONS' => 'Permissions', + 'ACP_CAT_POSTING' => 'Posting', + 'ACP_CAT_STYLES' => 'Styles', + 'ACP_CAT_SYSTEM' => 'System', + 'ACP_CAT_USERGROUP' => 'Users and Groups', + 'ACP_CAT_USERS' => 'Users', + 'ACP_CLIENT_COMMUNICATION' => 'Client communication', + 'ACP_COOKIE_SETTINGS' => 'Cookie settings', + 'ACP_CONTACT' => 'Contact page', + 'ACP_CONTACT_SETTINGS' => 'Contact page settings', + 'ACP_CRITICAL_LOGS' => 'Error log', + 'ACP_CUSTOM_PROFILE_FIELDS' => 'Custom profile fields', + + 'ACP_DATABASE' => 'Database management', + 'ACP_DISALLOW' => 'Disallow', + 'ACP_DISALLOW_USERNAMES' => 'Disallow usernames', + + 'ACP_EMAIL_SETTINGS' => 'Email settings', + 'ACP_EXTENSION_GROUPS' => 'Manage attachment extension groups', + 'ACP_EXTENSION_MANAGEMENT' => 'Extension management', + 'ACP_EXTENSIONS' => 'Manage extensions', + + 'ACP_FORUM_BASED_PERMISSIONS' => 'Forum based permissions', + 'ACP_FORUM_LOGS' => 'Forum logs', + 'ACP_FORUM_MANAGEMENT' => 'Forum management', + 'ACP_FORUM_MODERATORS' => 'Forum moderators', + 'ACP_FORUM_PERMISSIONS' => 'Forum permissions', + 'ACP_FORUM_PERMISSIONS_COPY' => 'Copy forum permissions', + 'ACP_FORUM_ROLES' => 'Forum roles', + + 'ACP_GENERAL_CONFIGURATION' => 'General configuration', + 'ACP_GENERAL_TASKS' => 'General tasks', + 'ACP_GLOBAL_MODERATORS' => 'Global moderators', + 'ACP_GLOBAL_PERMISSIONS' => 'Global permissions', + 'ACP_GROUPS' => 'Groups', + 'ACP_GROUPS_FORUM_PERMISSIONS' => 'Group forum permissions', + 'ACP_GROUPS_MANAGE' => 'Manage groups', + 'ACP_GROUPS_MANAGEMENT' => 'Group management', + 'ACP_GROUPS_PERMISSIONS' => 'Group permissions', + 'ACP_GROUPS_POSITION' => 'Manage group positions', + + 'ACP_ICONS' => 'Topic icons', + 'ACP_ICONS_SMILIES' => 'Topic icons/smilies', + 'ACP_INACTIVE_USERS' => 'Inactive users', + 'ACP_INDEX' => 'ACP index', + + 'ACP_JABBER_SETTINGS' => 'Jabber settings', + + 'ACP_LANGUAGE' => 'Language management', + 'ACP_LANGUAGE_PACKS' => 'Language packs', + 'ACP_LOAD_SETTINGS' => 'Load settings', + 'ACP_LOGGING' => 'Logging', + + 'ACP_MAIN' => 'ACP index', + + 'ACP_MANAGE_ATTACHMENTS' => 'Manage attachments', + 'ACP_MANAGE_ATTACHMENTS_EXPLAIN' => 'Here you can list and delete files attached to posts and private messages.', + + 'ACP_MANAGE_EXTENSIONS' => 'Manage attachment extensions', + 'ACP_MANAGE_FORUMS' => 'Manage forums', + 'ACP_MANAGE_RANKS' => 'Manage ranks', + 'ACP_MANAGE_REASONS' => 'Manage report/denial reasons', + 'ACP_MANAGE_USERS' => 'Manage users', + 'ACP_MASS_EMAIL' => 'Mass email', + 'ACP_MESSAGES' => 'Messages', + 'ACP_MESSAGE_SETTINGS' => 'Private message settings', + 'ACP_MODULE_MANAGEMENT' => 'Module management', + 'ACP_MOD_LOGS' => 'Moderator log', + 'ACP_MOD_ROLES' => 'Moderator roles', + + 'ACP_NO_ITEMS' => 'There are no items yet.', + + 'ACP_ORPHAN_ATTACHMENTS' => 'Orphaned attachments', + + 'ACP_PERMISSIONS' => 'Permissions', + 'ACP_PERMISSION_MASKS' => 'Permission masks', + 'ACP_PERMISSION_ROLES' => 'Permission roles', + 'ACP_PERMISSION_TRACE' => 'Permission trace', + 'ACP_PHP_INFO' => 'PHP information', + 'ACP_POST_SETTINGS' => 'Post settings', + 'ACP_PRUNE_FORUMS' => 'Prune forums', + 'ACP_PRUNE_USERS' => 'Prune users', + 'ACP_PRUNING' => 'Pruning', + + 'ACP_QUICK_ACCESS' => 'Quick access', + + 'ACP_RANKS' => 'Ranks', + 'ACP_REASONS' => 'Report/denial reasons', + 'ACP_REGISTER_SETTINGS' => 'User registration settings', + + 'ACP_RESTORE' => 'Restore', + + 'ACP_FEED' => 'Feed management', + 'ACP_FEED_SETTINGS' => 'Feed settings', + + 'ACP_SEARCH' => 'Search configuration', + 'ACP_SEARCH_INDEX' => 'Search index', + 'ACP_SEARCH_SETTINGS' => 'Search settings', + + 'ACP_SECURITY_SETTINGS' => 'Security settings', + 'ACP_SEND_STATISTICS' => 'Send statistical information', + 'ACP_SERVER_CONFIGURATION' => 'Server configuration', + 'ACP_SERVER_SETTINGS' => 'Server settings', + 'ACP_SIGNATURE_SETTINGS' => 'Signature settings', + 'ACP_SMILIES' => 'Smilies', + 'ACP_STYLE_MANAGEMENT' => 'Style management', + 'ACP_STYLES' => 'Styles', + 'ACP_STYLES_CACHE' => 'Purge Cache', + 'ACP_STYLES_INSTALL' => 'Install Styles', + + 'ACP_SUBMIT_CHANGES' => 'Submit changes', + + 'ACP_TEMPLATES' => 'Templates', + 'ACP_THEMES' => 'Themes', + + 'ACP_UPDATE' => 'Updating', + 'ACP_USERS_FORUM_PERMISSIONS' => 'User forum permissions', + 'ACP_USERS_LOGS' => 'User logs', + 'ACP_USERS_PERMISSIONS' => 'User permissions', + 'ACP_USER_ATTACH' => 'Attachments', + 'ACP_USER_AVATAR' => 'Avatar', + 'ACP_USER_FEEDBACK' => 'Feedback', + 'ACP_USER_GROUPS' => 'Groups', + 'ACP_USER_MANAGEMENT' => 'User management', + 'ACP_USER_OVERVIEW' => 'Overview', + 'ACP_USER_PERM' => 'Permissions', + 'ACP_USER_PREFS' => 'Preferences', + 'ACP_USER_PROFILE' => 'Profile', + 'ACP_USER_RANK' => 'Rank', + 'ACP_USER_ROLES' => 'User roles', + 'ACP_USER_SECURITY' => 'User security', + 'ACP_USER_SIG' => 'Signature', + 'ACP_USER_WARNINGS' => 'Warnings', + + 'ACP_VC_SETTINGS' => 'Spambot countermeasures', + 'ACP_VC_CAPTCHA_DISPLAY' => 'CAPTCHA image preview', + 'ACP_VERSION_CHECK' => 'Check for updates', + 'ACP_VIEW_ADMIN_PERMISSIONS' => 'View administrative permissions', + 'ACP_VIEW_FORUM_MOD_PERMISSIONS' => 'View forum moderation permissions', + 'ACP_VIEW_FORUM_PERMISSIONS' => 'View forum-based permissions', + 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS' => 'View global moderation permissions', + 'ACP_VIEW_USER_PERMISSIONS' => 'View user-based permissions', + + 'ACP_WORDS' => 'Word censoring', + + 'ACTION' => 'Action', + 'ACTIONS' => 'Actions', + 'ACTIVATE' => 'Activate', + 'ADD' => 'Add', + 'ADMIN' => 'Administration', + 'ADMIN_INDEX' => 'Admin index', + 'ADMIN_PANEL' => 'Administration Control Panel', + + 'ADM_LOGOUT' => 'ACP Logout', + 'ADM_LOGGED_OUT' => 'Successfully logged out from Administration Control Panel', + + 'BACK' => 'Back', + + 'COLOUR_SWATCH' => 'Web-safe colour swatch', + 'CONFIG_UPDATED' => 'Configuration updated successfully.', + 'CRON_LOCK_ERROR' => 'Could not obtain cron lock.', + 'CRON_NO_SUCH_TASK' => 'Could not find cron task “%sâ€.', + 'CRON_NO_TASK' => 'No cron tasks need to be run right now.', + 'CRON_NO_TASKS' => 'No cron tasks could be found.', + + 'DEACTIVATE' => 'Deactivate', + 'DIRECTORY_DOES_NOT_EXIST' => 'The entered path “%s†does not exist.', + 'DIRECTORY_NOT_DIR' => 'The entered path “%s†is not a directory.', + 'DIRECTORY_NOT_WRITABLE' => 'The entered path “%s†is not writable.', + 'DISABLE' => 'Disable', + 'DOWNLOAD' => 'Download', + 'DOWNLOAD_AS' => 'Download as', + 'DOWNLOAD_STORE' => 'Download or store file', + 'DOWNLOAD_STORE_EXPLAIN' => 'You may directly download the file or save it in your store/ folder.', + 'DOWNLOADS' => 'Downloads', + + 'EDIT' => 'Edit', + 'ENABLE' => 'Enable', + 'EXPORT_DOWNLOAD' => 'Download', + 'EXPORT_STORE' => 'Store', + + 'GENERAL_OPTIONS' => 'General options', + 'GENERAL_SETTINGS' => 'General settings', + 'GLOBAL_MASK' => 'Global permission mask', + + 'INSTALL' => 'Install', + 'IP' => 'User IP', + 'IP_HOSTNAME' => 'IP addresses or hostnames', + + 'LOAD_NOTIFICATIONS' => 'Display Notifications', + 'LOAD_NOTIFICATIONS_EXPLAIN' => 'Display the notifications list on every page (typically in the header).', + 'LOGGED_IN_AS' => 'You are logged in as:', + 'LOGIN_ADMIN' => 'To administer the board you must be an authenticated user.', + 'LOGIN_ADMIN_CONFIRM' => 'To administer the board you must re-authenticate yourself.', + 'LOGIN_ADMIN_SUCCESS' => 'You have successfully authenticated and will now be redirected to the Administration Control Panel.', + 'LOOK_UP_FORUM' => 'Select a forum', + 'LOOK_UP_FORUMS_EXPLAIN'=> 'You are able to select more than one forum.', + + 'MANAGE' => 'Manage', + 'MENU_TOGGLE' => 'Hide or display the side menu', + 'MORE' => 'More', // Not used at the moment + 'MORE_INFORMATION' => 'More information »', + 'MOVE_DOWN' => 'Move down', + 'MOVE_UP' => 'Move up', + + 'NOTIFY' => 'Notification', + 'NO_ADMIN' => 'You are not authorised to administer this board.', + 'NO_EMAILS_DEFINED' => 'No valid email addresses found.', + 'NO_FILES_TO_DELETE' => 'Attachments you selected for deletion do not exist.', + 'NO_PASSWORD_SUPPLIED' => 'You need to enter your password to access the Administration Control Panel.', + + 'OFF' => 'Off', + 'ON' => 'On', + + 'PARSE_BBCODE' => 'Parse BBCode', + 'PARSE_SMILIES' => 'Parse smilies', + 'PARSE_URLS' => 'Parse links', + 'PERMISSIONS_TRANSFERRED' => 'Permissions transferred', + 'PERMISSIONS_TRANSFERRED_EXPLAIN' => 'You currently have the permissions from %1$s. You are able to browse the board with this user’s permissions, but not access the administration control panel since admin permissions were not transferred. You can revert to your permission set at any time.', + 'PROCEED_TO_ACP' => '%sProceed to the ACP%s', + + 'REMIND' => 'Remind', + 'RESYNC' => 'Resynchronise', + + 'RUNNING_TASK' => 'Running task: %s.', + 'SELECT_ANONYMOUS' => 'Select anonymous user', + 'SELECT_OPTION' => 'Select option', + + 'SETTING_TOO_LOW' => 'The provided value for the setting “%1$s†is too low. The minimum acceptable value is %2$d.', + 'SETTING_TOO_BIG' => 'The provided value for the setting “%1$s†is too high. The maximum acceptable value is %2$d.', + 'SETTING_TOO_LONG' => 'The provided value for the setting “%1$s†is too long. The maximum acceptable length is %2$d.', + 'SETTING_TOO_SHORT' => 'The provided value for the setting “%1$s†is too short. The minimum acceptable length is %2$d.', + + 'SHOW_ALL_OPERATIONS' => 'Show all operations', + + 'TASKS_NOT_READY' => 'Not ready tasks:', + 'TASKS_READY' => 'Ready tasks:', + 'TOTAL_SIZE' => 'Total size', + + 'UCP' => 'User Control Panel', + 'USERNAMES_EXPLAIN' => 'Place each username on a separate line.', + 'USER_CONTROL_PANEL' => 'User Control Panel', + + 'WARNING' => 'Warning', +)); + +// PHP info +$lang = array_merge($lang, array( + 'ACP_PHP_INFO_EXPLAIN' => 'This page lists information on the version of PHP installed on this server. It includes details of loaded modules, available variables and default settings. This information may be useful when diagnosing problems. Please be aware that some hosting companies will limit what information is displayed here for security reasons. You are advised to not give out any details on this page except when asked by official team members on the support forums.', + + 'NO_PHPINFO_AVAILABLE' => 'Information about your PHP configuration is unable to be determined. Phpinfo() has been disabled for security reasons.', +)); + +// Logs +$lang = array_merge($lang, array( + 'ACP_ADMIN_LOGS_EXPLAIN' => 'This lists all the actions carried out by board administrators. You can sort by username, date, IP or action. If you have appropriate permissions you can also clear individual operations or the log as a whole.', + 'ACP_CRITICAL_LOGS_EXPLAIN' => 'This lists the actions carried out by the board itself. This log provides you with information you are able to use for solving specific problems, for example non-delivery of emails. You can sort by username, date, IP or action. If you have appropriate permissions you can also clear individual operations or the log as a whole.', + 'ACP_MOD_LOGS_EXPLAIN' => 'This lists all actions done on forums, topics and posts as well as actions carried out on users by moderators, including banning. You can sort by username, date, IP or action. If you have appropriate permissions you can also clear individual operations or the log as a whole.', + 'ACP_USERS_LOGS_EXPLAIN' => 'This lists all actions carried out by users or on users (reports, warnings and user notes).', + 'ALL_ENTRIES' => 'All entries', + + 'DISPLAY_LOG' => 'Display entries from previous', + + 'NO_ENTRIES' => 'No log entries for this period.', + + 'SORT_IP' => 'IP address', + 'SORT_DATE' => 'Date', + 'SORT_ACTION' => 'Log action', +)); + +// Index page +$lang = array_merge($lang, array( + 'ADMIN_INTRO' => 'Thank you for choosing phpBB as your board solution. This screen will give you a quick overview of all the various statistics of your board. The links on the left hand side of this screen allow you to control every aspect of your board experience. Each page will have instructions on how to use the tools.', + 'ADMIN_LOG' => 'Logged administrator actions', + 'ADMIN_LOG_INDEX_EXPLAIN' => 'This gives an overview of the last five actions carried out by board administrators. A full copy of the log can be viewed from the appropriate menu item or following the link below.', + 'AVATAR_DIR_SIZE' => 'Avatar directory size', + + 'BOARD_STARTED' => 'Board started', + 'BOARD_VERSION' => 'Board version', + + 'DATABASE_SERVER_INFO' => 'Database server', + 'DATABASE_SIZE' => 'Database size', + + // Enviroment configuration checks, mbstring related + 'ERROR_MBSTRING_FUNC_OVERLOAD' => 'Function overloading is improperly configured', + 'ERROR_MBSTRING_FUNC_OVERLOAD_EXPLAIN' => 'mbstring.func_overload must be set to either 0 or 4. You can check the current value on the PHP information page.', + 'ERROR_MBSTRING_ENCODING_TRANSLATION' => 'Transparent character encoding is improperly configured', + 'ERROR_MBSTRING_ENCODING_TRANSLATION_EXPLAIN' => 'mbstring.encoding_translation must be set to 0. You can check the current value on the PHP information page.', + 'ERROR_MBSTRING_HTTP_INPUT' => 'HTTP input character conversion is improperly configured', + 'ERROR_MBSTRING_HTTP_INPUT_EXPLAIN' => 'mbstring.http_input must be set to pass. You can check the current value on the PHP information page.', + 'ERROR_MBSTRING_HTTP_OUTPUT' => 'HTTP output character conversion is improperly configured', + 'ERROR_MBSTRING_HTTP_OUTPUT_EXPLAIN' => 'mbstring.http_output must be set to pass. You can check the current value on the PHP information page.', + + 'FILES_PER_DAY' => 'Attachments per day', + 'FORUM_STATS' => 'Board statistics', + + 'GZIP_COMPRESSION' => 'GZip compression', + + 'NO_SEARCH_INDEX' => 'The selected search backend does not have a search index.
Please create the index for “%1$s†in the %2$ssearch index%3$s section.', + 'NOT_AVAILABLE' => 'Not available', + 'NUMBER_FILES' => 'Number of attachments', + 'NUMBER_POSTS' => 'Number of posts', + 'NUMBER_TOPICS' => 'Number of topics', + 'NUMBER_USERS' => 'Number of users', + 'NUMBER_ORPHAN' => 'Orphan attachments', + + 'PHP_VERSION_OLD' => 'The version of PHP on this server will no longer be supported by future versions of phpBB. %sDetails%s', + + 'POSTS_PER_DAY' => 'Posts per day', + + 'PURGE_CACHE' => 'Purge the cache', + 'PURGE_CACHE_CONFIRM' => 'Are you sure you wish to purge the cache?', + 'PURGE_CACHE_EXPLAIN' => 'Purge all cache related items, this includes any cached template files or queries.', + 'PURGE_CACHE_SUCCESS' => 'Cache successfully purged.', + + 'PURGE_SESSIONS' => 'Purge all sessions', + 'PURGE_SESSIONS_CONFIRM' => 'Are you sure you wish to purge all sessions? This will log out all users.', + 'PURGE_SESSIONS_EXPLAIN' => 'Purge all sessions. This will log out all users by truncating the session table.', + 'PURGE_SESSIONS_SUCCESS' => 'Sessions successfully purged.', + + 'RESET_DATE' => 'Reset board’s start date', + 'RESET_DATE_CONFIRM' => 'Are you sure you wish to reset the board’s start date?', + 'RESET_DATE_SUCCESS' => 'Board’s start date reset', + 'RESET_ONLINE' => 'Reset most users ever online', + 'RESET_ONLINE_CONFIRM' => 'Are you sure you wish to reset the most users ever online counter?', + 'RESET_ONLINE_SUCCESS' => 'Most users ever online reset', + 'RESYNC_POSTCOUNTS' => 'Resynchronise post counts', + 'RESYNC_POSTCOUNTS_EXPLAIN' => 'Only existing posts will be taken into consideration. Pruned posts will not be counted.', + 'RESYNC_POSTCOUNTS_CONFIRM' => 'Are you sure you wish to resynchronise post counts?', + 'RESYNC_POSTCOUNTS_SUCCESS' => 'Resynchronised post counts', + 'RESYNC_POST_MARKING' => 'Resynchronise dotted topics', + 'RESYNC_POST_MARKING_CONFIRM' => 'Are you sure you wish to resynchronise dotted topics?', + 'RESYNC_POST_MARKING_EXPLAIN' => 'First unmarks all topics and then correctly marks topics that have seen any activity during the past six months.', + 'RESYNC_POST_MARKING_SUCCESS' => 'Resynchronised dotted topics', + 'RESYNC_STATS' => 'Resynchronise statistics', + 'RESYNC_STATS_CONFIRM' => 'Are you sure you wish to resynchronise statistics?', + 'RESYNC_STATS_EXPLAIN' => 'Recalculates the total number of posts, topics, users and files.', + 'RESYNC_STATS_SUCCESS' => 'Resynchronised statistics', + 'RUN' => 'Run now', + + 'STATISTIC' => 'Statistic', + 'STATISTIC_RESYNC_OPTIONS' => 'Resynchronise or reset statistics', + + 'TIMEZONE_INVALID' => 'The timezone you selected is invalid.', + 'TIMEZONE_SELECTED' => '(currently selected)', + 'TOPICS_PER_DAY' => 'Topics per day', + + 'UPLOAD_DIR_SIZE' => 'Size of posted attachments', + 'USERS_PER_DAY' => 'Users per day', + + 'VALUE' => 'Value', + 'VERSIONCHECK_FAIL' => 'Failed to obtain latest version information.', + 'VERSIONCHECK_FORCE_UPDATE' => 'Re-Check version', + 'VIEW_ADMIN_LOG' => 'View administrator log', + 'VIEW_INACTIVE_USERS' => 'View inactive users', + + 'WELCOME_PHPBB' => 'Welcome to phpBB', + 'WRITABLE_CONFIG' => 'Your config file (config.php) is currently world-writable. We strongly encourage you to change the permissions to 640 or at least to 644 (for example: chmod 640 config.php).', +)); + +// Inactive Users +$lang = array_merge($lang, array( + 'INACTIVE_DATE' => 'Inactive date', + 'INACTIVE_REASON' => 'Reason', + 'INACTIVE_REASON_MANUAL' => 'Account deactivated by administrator', + 'INACTIVE_REASON_PROFILE' => 'Profile details changed', + 'INACTIVE_REASON_REGISTER' => 'Newly registered account', + 'INACTIVE_REASON_REMIND' => 'Forced user account reactivation', + 'INACTIVE_REASON_UNKNOWN' => 'Unknown', + 'INACTIVE_USERS' => 'Inactive users', + 'INACTIVE_USERS_EXPLAIN' => 'This is a list of users who have registered but whose accounts are inactive. You can activate, delete or remind (by sending an email) these users if you wish.', + 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. Accounts are inactive either because account activation was enabled in user registration settings and these users’ accounts have not yet been activated, or because these accounts have been deactivated. A full list is available by following the link below from where you can activate, delete or remind (by sending an email) these users if you wish.', + + 'NO_INACTIVE_USERS' => 'No inactive users', + + 'SORT_INACTIVE' => 'Inactive date', + 'SORT_LAST_VISIT' => 'Last visit', + 'SORT_REASON' => 'Reason', + 'SORT_REG_DATE' => 'Registration date', + 'SORT_LAST_REMINDER'=> 'Last reminded', + 'SORT_REMINDER' => 'Reminder sent', + + 'USER_IS_INACTIVE' => 'User is inactive', +)); + +// Send statistics page +$lang = array_merge($lang, array( + 'EXPLAIN_SEND_STATISTICS' => 'Please send information about your server and board configurations to phpBB for statistical analysis. All information that could identify you or your website has been removed - the data is entirely anonymous. We base decisions about future phpBB versions on this information. The statistics are made available publically. We also share this data with the PHP project, the programming language phpBB is made with.', + 'EXPLAIN_SHOW_STATISTICS' => 'Using the button below you can preview all variables that will be transmitted.', + 'DONT_SEND_STATISTICS' => 'Return to the ACP if you do not wish to send statistical information to phpBB.', + 'GO_ACP_MAIN' => 'Go to the ACP start page', + 'HIDE_STATISTICS' => 'Hide details', + 'SEND_STATISTICS' => 'Send statistical information', + 'SHOW_STATISTICS' => 'Show details', + 'THANKS_SEND_STATISTICS' => 'Thank you for submitting your information.', +)); + +// Log Entries +$lang = array_merge($lang, array( + 'LOG_ACL_ADD_USER_GLOBAL_U_' => 'Added or edited users’ user permissions
» %s', + 'LOG_ACL_ADD_GROUP_GLOBAL_U_' => 'Added or edited groups’ user permissions
» %s', + 'LOG_ACL_ADD_USER_GLOBAL_M_' => 'Added or edited users’ global moderator permissions
» %s', + 'LOG_ACL_ADD_GROUP_GLOBAL_M_' => 'Added or edited groups’ global moderator permissions
» %s', + 'LOG_ACL_ADD_USER_GLOBAL_A_' => 'Added or edited users’ administrator permissions
» %s', + 'LOG_ACL_ADD_GROUP_GLOBAL_A_' => 'Added or edited groups’ administrator permissions
» %s', + + 'LOG_ACL_ADD_ADMIN_GLOBAL_A_' => 'Added or edited Administrators
» %s', + 'LOG_ACL_ADD_MOD_GLOBAL_M_' => 'Added or edited Global Moderators
» %s', + + 'LOG_ACL_ADD_USER_LOCAL_F_' => 'Added or edited users’ forum access from %1$s
» %2$s', + 'LOG_ACL_ADD_USER_LOCAL_M_' => 'Added or edited users’ forum moderator access from %1$s
» %2$s', + 'LOG_ACL_ADD_GROUP_LOCAL_F_' => 'Added or edited groups’ forum access from %1$s
» %2$s', + 'LOG_ACL_ADD_GROUP_LOCAL_M_' => 'Added or edited groups’ forum moderator access from %1$s
» %2$s', + + 'LOG_ACL_ADD_MOD_LOCAL_M_' => 'Added or edited Moderators from %1$s
» %2$s', + 'LOG_ACL_ADD_FORUM_LOCAL_F_' => 'Added or edited forum permissions from %1$s
» %2$s', + + 'LOG_ACL_DEL_ADMIN_GLOBAL_A_' => 'Removed Administrators
» %s', + 'LOG_ACL_DEL_MOD_GLOBAL_M_' => 'Removed Global Moderators
» %s', + 'LOG_ACL_DEL_MOD_LOCAL_M_' => 'Removed Moderators from %1$s
» %2$s', + 'LOG_ACL_DEL_FORUM_LOCAL_F_' => 'Removed User/Group forum permissions from %1$s
» %2$s', + + 'LOG_ACL_TRANSFER_PERMISSIONS' => 'Permissions transferred from
» %s', + 'LOG_ACL_RESTORE_PERMISSIONS' => 'Own permissions restored after using permissions from
» %s', + + 'LOG_ADMIN_AUTH_FAIL' => 'Failed administration login attempt', + 'LOG_ADMIN_AUTH_SUCCESS' => 'Successful administration login', + + 'LOG_ATTACHMENTS_DELETED' => 'Removed user attachments
» %s', + + 'LOG_ATTACH_EXT_ADD' => 'Added or edited attachment extension
» %s', + 'LOG_ATTACH_EXT_DEL' => 'Removed attachment extension
» %s', + 'LOG_ATTACH_EXT_UPDATE' => 'Updated attachment extension
» %s', + 'LOG_ATTACH_EXTGROUP_ADD' => 'Added extension group
» %s', + 'LOG_ATTACH_EXTGROUP_EDIT' => 'Edited extension group
» %s', + 'LOG_ATTACH_EXTGROUP_DEL' => 'Removed extension group
» %s', + 'LOG_ATTACH_FILEUPLOAD' => 'Orphan File uploaded to Post
» ID %1$d - %2$s', + 'LOG_ATTACH_ORPHAN_DEL' => 'Orphan Files deleted
» %s', + + 'LOG_BAN_EXCLUDE_USER' => 'Excluded user from ban for reason “%1$sâ€
» %2$s', + 'LOG_BAN_EXCLUDE_IP' => 'Excluded IP from ban for reason “%1$sâ€
» %2$s', + 'LOG_BAN_EXCLUDE_EMAIL' => 'Excluded email from ban for reason “%1$sâ€
» %2$s', + 'LOG_BAN_USER' => 'Banned user for reason “%1$sâ€
» %2$s', + 'LOG_BAN_IP' => 'Banned IP for reason “%1$sâ€
» %2$s', + 'LOG_BAN_EMAIL' => 'Banned email for reason “%1$sâ€
» %2$s', + 'LOG_UNBAN_USER' => 'Unbanned user
» %s', + 'LOG_UNBAN_IP' => 'Unbanned IP
» %s', + 'LOG_UNBAN_EMAIL' => 'Unbanned email
» %s', + + 'LOG_BBCODE_ADD' => 'Added new BBCode
» %s', + 'LOG_BBCODE_EDIT' => 'Edited BBCode
» %s', + 'LOG_BBCODE_DELETE' => 'Deleted BBCode
» %s', + + 'LOG_BOT_ADDED' => 'New bot added
» %s', + 'LOG_BOT_DELETE' => 'Deleted bot
» %s', + 'LOG_BOT_UPDATED' => 'Existing bot updated
» %s', + + 'LOG_CLEAR_ADMIN' => 'Cleared admin log', + 'LOG_CLEAR_CRITICAL' => 'Cleared error log', + 'LOG_CLEAR_MOD' => 'Cleared moderator log', + 'LOG_CLEAR_USER' => 'Cleared user log
» %s', + 'LOG_CLEAR_USERS' => 'Cleared user logs', + + 'LOG_CONFIG_ATTACH' => 'Altered attachment settings', + 'LOG_CONFIG_AUTH' => 'Altered authentication settings', + 'LOG_CONFIG_AVATAR' => 'Altered avatar settings', + 'LOG_CONFIG_COOKIE' => 'Altered cookie settings', + 'LOG_CONFIG_EMAIL' => 'Altered email settings', + 'LOG_CONFIG_FEATURES' => 'Altered board features', + 'LOG_CONFIG_LOAD' => 'Altered load settings', + 'LOG_CONFIG_MESSAGE' => 'Altered private message settings', + 'LOG_CONFIG_POST' => 'Altered post settings', + 'LOG_CONFIG_REGISTRATION' => 'Altered user registration settings', + 'LOG_CONFIG_FEED' => 'Altered syndication feeds settings', + 'LOG_CONFIG_SEARCH' => 'Altered search settings', + 'LOG_CONFIG_SECURITY' => 'Altered security settings', + 'LOG_CONFIG_SERVER' => 'Altered server settings', + 'LOG_CONFIG_SETTINGS' => 'Altered board settings', + 'LOG_CONFIG_SIGNATURE' => 'Altered signature settings', + 'LOG_CONFIG_VISUAL' => 'Altered anti-spambot settings', + + 'LOG_APPROVE_TOPIC' => 'Approved topic
» %s', + 'LOG_BUMP_TOPIC' => 'User bumped topic
» %s', + 'LOG_DELETE_POST' => 'Deleted post “%1$s†written by “%2$s†for the following reason
» %3$s', + 'LOG_DELETE_SHADOW_TOPIC' => 'Deleted shadow topic
» %s', + 'LOG_DELETE_TOPIC' => 'Deleted topic “%1$s†written by “%2$s†for the following reason
» %3$s', + 'LOG_FORK' => 'Copied topic
» from %s', + 'LOG_LOCK' => 'Locked topic
» %s', + 'LOG_LOCK_POST' => 'Locked post
» %s', + 'LOG_MERGE' => 'Merged posts into topic
» %s', + 'LOG_MOVE' => 'Moved topic
» from %1$s to %2$s', + 'LOG_MOVED_TOPIC' => 'Moved topic
» %s', + 'LOG_PM_REPORT_CLOSED' => 'Closed PM report
» %s', + 'LOG_PM_REPORT_DELETED' => 'Deleted PM report
» %s', + 'LOG_POST_APPROVED' => 'Approved post
» %s', + 'LOG_POST_DISAPPROVED' => 'Disapproved post “%1$s†written by “%3$s†for the following reason
» %2$s', + 'LOG_POST_EDITED' => 'Edited post “%1$s†written by “%2$s†for the following reason
» %3$s', + 'LOG_POST_RESTORED' => 'Restored post
» %s', + 'LOG_REPORT_CLOSED' => 'Closed report
» %s', + 'LOG_REPORT_DELETED' => 'Deleted report
» %s', + 'LOG_RESTORE_TOPIC' => 'Restored topic “%1$s†written by
» %2$s', + 'LOG_SOFTDELETE_POST' => 'Soft deleted post “%1$s†written by “%2$s†for the following reason
» %3$s', + 'LOG_SOFTDELETE_TOPIC' => 'Soft deleted topic “%1$s†written by “%2$s†for the following reason
» %3$s', + 'LOG_SPLIT_DESTINATION' => 'Moved split posts
» to %s', + 'LOG_SPLIT_SOURCE' => 'Split posts
» from %s', + + 'LOG_TOPIC_APPROVED' => 'Approved topic
» %s', + 'LOG_TOPIC_RESTORED' => 'Restored topic
» %s', + 'LOG_TOPIC_DISAPPROVED' => 'Disapproved topic “%1$s†written by “%3$s†for the following reason
» %2$s', + 'LOG_TOPIC_RESYNC' => 'Resynchronised topic counters
» %s', + 'LOG_TOPIC_TYPE_CHANGED' => 'Changed topic type
» %s', + 'LOG_UNLOCK' => 'Unlocked topic
» %s', + 'LOG_UNLOCK_POST' => 'Unlocked post
» %s', + + 'LOG_DISALLOW_ADD' => 'Added disallowed username
» %s', + 'LOG_DISALLOW_DELETE' => 'Deleted disallowed username', + + 'LOG_DB_BACKUP' => 'Database backup', + 'LOG_DB_DELETE' => 'Deleted database backup', + 'LOG_DB_RESTORE' => 'Restored database backup', + + 'LOG_DOWNLOAD_EXCLUDE_IP' => 'Excluded IP/hostname from download list
» %s', + 'LOG_DOWNLOAD_IP' => 'Added IP/hostname to download list
» %s', + 'LOG_DOWNLOAD_REMOVE_IP' => 'Removed IP/hostname from download list
» %s', + + 'LOG_ERROR_JABBER' => 'Jabber error
» %s', + 'LOG_ERROR_EMAIL' => 'Email error
» %s', + + 'LOG_FORUM_ADD' => 'Created new forum
» %s', + 'LOG_FORUM_COPIED_PERMISSIONS' => 'Copied forum permissions from %1$s
» %2$s', + 'LOG_FORUM_DEL_FORUM' => 'Deleted forum
» %s', + 'LOG_FORUM_DEL_FORUMS' => 'Deleted forum and its subforums
» %s', + 'LOG_FORUM_DEL_MOVE_FORUMS' => 'Deleted forum and moved subforums to %1$s
» %2$s', + 'LOG_FORUM_DEL_MOVE_POSTS' => 'Deleted forum and moved posts to %1$s
» %2$s', + 'LOG_FORUM_DEL_MOVE_POSTS_FORUMS' => 'Deleted forum and its subforums, moved posts to %1$s
» %2$s', + 'LOG_FORUM_DEL_MOVE_POSTS_MOVE_FORUMS' => 'Deleted forum, moved posts to %1$s and subforums to %2$s
» %3$s', + 'LOG_FORUM_DEL_POSTS' => 'Deleted forum and its posts
» %s', + 'LOG_FORUM_DEL_POSTS_FORUMS' => 'Deleted forum, its posts and subforums
» %s', + 'LOG_FORUM_DEL_POSTS_MOVE_FORUMS' => 'Deleted forum and its posts, moved subforums to %1$s
» %2$s', + 'LOG_FORUM_EDIT' => 'Edited forum details
» %s', + 'LOG_FORUM_MOVE_DOWN' => 'Moved forum %1$s below %2$s', + 'LOG_FORUM_MOVE_UP' => 'Moved forum %1$s above %2$s', + 'LOG_FORUM_SYNC' => 'Re-synchronised forum
» %s', + + 'LOG_GENERAL_ERROR' => 'A general error occurred: %1$s
» %2$s', + + 'LOG_GROUP_CREATED' => 'New usergroup created
» %s', + 'LOG_GROUP_DEFAULTS' => 'Group “%1$s†made default for members
» %2$s', + 'LOG_GROUP_DELETE' => 'Usergroup deleted
» %s', + 'LOG_GROUP_DEMOTED' => 'Leaders demoted in usergroup %1$s
» %2$s', + 'LOG_GROUP_PROMOTED' => 'Members promoted to leader in usergroup %1$s
» %2$s', + 'LOG_GROUP_REMOVE' => 'Members removed from usergroup %1$s
» %2$s', + 'LOG_GROUP_UPDATED' => 'Usergroup details updated
» %s', + 'LOG_MODS_ADDED' => 'Added new leaders to usergroup %1$s
» %2$s', + 'LOG_USERS_ADDED' => 'Added new members to usergroup %1$s
» %2$s', + 'LOG_USERS_APPROVED' => 'Users approved in usergroup %1$s
» %2$s', + 'LOG_USERS_PENDING' => 'Users requested to join group “%1$s†and need to be approved
» %2$s', + + 'LOG_IMAGE_GENERATION_ERROR' => 'Error while creating image
» Error in %1$s on line %2$s: %3$s', + + 'LOG_INACTIVE_ACTIVATE' => 'Activated inactive users
» %s', + 'LOG_INACTIVE_DELETE' => 'Deleted inactive users
» %s', + 'LOG_INACTIVE_REMIND' => 'Sent reminder emails to inactive users
» %s', + 'LOG_INSTALL_CONVERTED' => 'Converted from %1$s to phpBB %2$s', + 'LOG_INSTALL_INSTALLED' => 'Installed phpBB %s', + + 'LOG_IP_BROWSER_FORWARDED_CHECK' => 'Session IP/browser/X_FORWARDED_FOR check failed
»User IP “%1$s†checked against session IP “%2$sâ€, user browser string “%3$s†checked against session browser string “%4$s†and user X_FORWARDED_FOR string “%5$s†checked against session X_FORWARDED_FOR string “%6$sâ€.', + + 'LOG_JAB_CHANGED' => 'Jabber account changed', + 'LOG_JAB_PASSCHG' => 'Jabber password changed', + 'LOG_JAB_REGISTER' => 'Jabber account registered', + 'LOG_JAB_SETTINGS_CHANGED' => 'Jabber settings changed', + + 'LOG_LANGUAGE_PACK_DELETED' => 'Deleted language pack
» %s', + 'LOG_LANGUAGE_PACK_INSTALLED' => 'Installed language pack
» %s', + 'LOG_LANGUAGE_PACK_UPDATED' => 'Updated language pack details
» %s', + 'LOG_LANGUAGE_FILE_REPLACED' => 'Replaced language file
» %s', + 'LOG_LANGUAGE_FILE_SUBMITTED' => 'Submitted language file and placed in store folder
» %s', + + 'LOG_MASS_EMAIL' => 'Sent mass email
» %s', + + 'LOG_MCP_CHANGE_POSTER' => 'Changed poster in topic “%1$sâ€
» from %2$s to %3$s', + + 'LOG_MODULE_DISABLE' => 'Module disabled
» %s', + 'LOG_MODULE_ENABLE' => 'Module enabled
» %s', + 'LOG_MODULE_MOVE_DOWN' => 'Module moved down
» %1$s below %2$s', + 'LOG_MODULE_MOVE_UP' => 'Module moved up
» %1$s above %2$s', + 'LOG_MODULE_REMOVED' => 'Module removed
» %s', + 'LOG_MODULE_ADD' => 'Module added
» %s', + 'LOG_MODULE_EDIT' => 'Module edited
» %s', + + 'LOG_A_ROLE_ADD' => 'Admin role added
» %s', + 'LOG_A_ROLE_EDIT' => 'Admin role edited
» %s', + 'LOG_A_ROLE_REMOVED' => 'Admin role removed
» %s', + 'LOG_F_ROLE_ADD' => 'Forum role added
» %s', + 'LOG_F_ROLE_EDIT' => 'Forum role edited
» %s', + 'LOG_F_ROLE_REMOVED' => 'Forum role removed
» %s', + 'LOG_M_ROLE_ADD' => 'Moderator role added
» %s', + 'LOG_M_ROLE_EDIT' => 'Moderator role edited
» %s', + 'LOG_M_ROLE_REMOVED' => 'Moderator role removed
» %s', + 'LOG_U_ROLE_ADD' => 'User role added
» %s', + 'LOG_U_ROLE_EDIT' => 'User role edited
» %s', + 'LOG_U_ROLE_REMOVED' => 'User role removed
» %s', + + 'LOG_PLUPLOAD_TIDY_FAILED' => 'Unable to open %1$s for tidying, check permissions.
Exception: %2$s
Trace: %3$s', + + 'LOG_PROFILE_FIELD_ACTIVATE' => 'Profile field activated
» %s', + 'LOG_PROFILE_FIELD_CREATE' => 'Profile field added
» %s', + 'LOG_PROFILE_FIELD_DEACTIVATE' => 'Profile field deactivated
» %s', + 'LOG_PROFILE_FIELD_EDIT' => 'Profile field changed
» %s', + 'LOG_PROFILE_FIELD_REMOVED' => 'Profile field removed
» %s', + + 'LOG_PRUNE' => 'Pruned forums
» %s', + 'LOG_AUTO_PRUNE' => 'Auto-pruned forums
» %s', + 'LOG_PRUNE_SHADOW' => 'Auto-pruned shadow topics
» %s', + 'LOG_PRUNE_USER_DEAC' => 'Users deactivated
» %s', + 'LOG_PRUNE_USER_DEL_DEL' => 'Users pruned and posts deleted
» %s', + 'LOG_PRUNE_USER_DEL_ANON' => 'Users pruned and posts retained
» %s', + + 'LOG_PURGE_CACHE' => 'Purged cache', + 'LOG_PURGE_SESSIONS' => 'Purged sessions', + + 'LOG_RANK_ADDED' => 'Added new rank
» %s', + 'LOG_RANK_REMOVED' => 'Removed rank
» %s', + 'LOG_RANK_UPDATED' => 'Updated rank
» %s', + + 'LOG_REASON_ADDED' => 'Added report/denial reason
» %s', + 'LOG_REASON_REMOVED' => 'Removed report/denial reason
» %s', + 'LOG_REASON_UPDATED' => 'Updated report/denial reason
» %s', + + 'LOG_REFERER_INVALID' => 'Referrer validation failed
»Referrer was “%1$sâ€. The request was rejected and the session killed.', + 'LOG_RESET_DATE' => 'Board start date reset', + 'LOG_RESET_ONLINE' => 'Most users online reset', + 'LOG_RESYNC_FILES_STATS' => 'File statistics resynchronised', + 'LOG_RESYNC_POSTCOUNTS' => 'User post counts resynchronised', + 'LOG_RESYNC_POST_MARKING' => 'Dotted topics resynchronised', + 'LOG_RESYNC_STATS' => 'Post, topic and user statistics resynchronised', + + 'LOG_SEARCH_INDEX_CREATED' => 'Created search index for
» %s', + 'LOG_SEARCH_INDEX_REMOVED' => 'Removed search index for
» %s', + 'LOG_SPHINX_ERROR' => 'Sphinx Error
» %s', + 'LOG_STYLE_ADD' => 'Added new style
» %s', + 'LOG_STYLE_DELETE' => 'Deleted style
» %s', + 'LOG_STYLE_EDIT_DETAILS' => 'Edited style
» %s', + 'LOG_STYLE_EXPORT' => 'Exported style
» %s', + + // @deprecated 3.1 + 'LOG_TEMPLATE_ADD_DB' => 'Added new template set to database
» %s', + // @deprecated 3.1 + 'LOG_TEMPLATE_ADD_FS' => 'Add new template set on filesystem
» %s', + 'LOG_TEMPLATE_CACHE_CLEARED' => 'Deleted cached versions of template files in template set %1$s
» %2$s', + 'LOG_TEMPLATE_DELETE' => 'Deleted template set
» %s', + 'LOG_TEMPLATE_EDIT' => 'Edited template set %1$s
» %2$s', + 'LOG_TEMPLATE_EDIT_DETAILS' => 'Edited template details
» %s', + 'LOG_TEMPLATE_EXPORT' => 'Exported template set
» %s', + // @deprecated 3.1 + 'LOG_TEMPLATE_REFRESHED' => 'Refreshed template set
» %s', + + // @deprecated 3.1 + 'LOG_THEME_ADD_DB' => 'Added new theme to database
» %s', + // @deprecated 3.1 + 'LOG_THEME_ADD_FS' => 'Add new theme on filesystem
» %s', + 'LOG_THEME_DELETE' => 'Theme deleted
» %s', + 'LOG_THEME_EDIT_DETAILS' => 'Edited theme details
» %s', + 'LOG_THEME_EDIT' => 'Edited theme %1$s', + 'LOG_THEME_EDIT_FILE' => 'Edited theme %1$s
» Modified file %2$s', + 'LOG_THEME_EXPORT' => 'Exported theme
» %s', + // @deprecated 3.1 + 'LOG_THEME_REFRESHED' => 'Refreshed theme
» %s', + + 'LOG_UPDATE_DATABASE' => 'Updated Database from version %1$s to version %2$s', + 'LOG_UPDATE_PHPBB' => 'Updated phpBB from version %1$s to version %2$s', + + 'LOG_USER_ACTIVE' => 'User activated
» %s', + 'LOG_USER_BAN_USER' => 'Banned User via user management for reason “%1$sâ€
» %2$s', + 'LOG_USER_BAN_IP' => 'Banned IP via user management for reason “%1$sâ€
» %2$s', + 'LOG_USER_BAN_EMAIL' => 'Banned email via user management for reason “%1$sâ€
» %2$s', + 'LOG_USER_DELETED' => 'Deleted user
» %s', + 'LOG_USER_DEL_ATTACH' => 'Removed all attachments made by the user
» %s', + 'LOG_USER_DEL_AVATAR' => 'Removed user avatar
» %s', + 'LOG_USER_DEL_OUTBOX' => 'Emptied user outbox
» %s', + 'LOG_USER_DEL_POSTS' => 'Removed all posts made by the user
» %s', + 'LOG_USER_DEL_SIG' => 'Removed user signature
» %s', + 'LOG_USER_INACTIVE' => 'User deactivated
» %s', + 'LOG_USER_MOVE_POSTS' => 'Moved user posts
» posts by “%1$s†to forum “%2$sâ€', + 'LOG_USER_NEW_PASSWORD' => 'Changed user password
» %s', + 'LOG_USER_REACTIVATE' => 'Forced user account reactivation
» %s', + 'LOG_USER_REMOVED_NR' => 'Removed newly registered flag from user
» %s', + + 'LOG_USER_UPDATE_EMAIL' => 'User “%1$s†changed email
» from “%2$s†to “%3$sâ€', + 'LOG_USER_UPDATE_NAME' => 'Changed username
» from “%1$s†to “%2$sâ€', + 'LOG_USER_USER_UPDATE' => 'Updated user details
» %s', + + 'LOG_USER_ACTIVE_USER' => 'User account activated', + 'LOG_USER_DEL_AVATAR_USER' => 'User avatar removed', + 'LOG_USER_DEL_SIG_USER' => 'User signature removed', + 'LOG_USER_FEEDBACK' => 'Added user feedback
» %s', + 'LOG_USER_GENERAL' => 'Entry added:
» %s', + 'LOG_USER_INACTIVE_USER' => 'User account de-activated', + 'LOG_USER_LOCK' => 'User locked own topic
» %s', + 'LOG_USER_MOVE_POSTS_USER' => 'Moved all posts to forum» %s', + 'LOG_USER_REACTIVATE_USER' => 'Forced user account reactivation', + 'LOG_USER_UNLOCK' => 'User unlocked own topic
» %s', + 'LOG_USER_WARNING' => 'Added user warning
» %s', + 'LOG_USER_WARNING_BODY' => 'The following warning was issued to this user
» %s', + + 'LOG_USER_GROUP_CHANGE' => 'User changed default group
» %s', + 'LOG_USER_GROUP_DEMOTE' => 'User demoted as leaders from usergroup
» %s', + 'LOG_USER_GROUP_JOIN' => 'User joined group
» %s', + 'LOG_USER_GROUP_JOIN_PENDING' => 'User joined group and needs to be approved
» %s', + 'LOG_USER_GROUP_RESIGN' => 'User resigned membership from group
» %s', + + 'LOG_WARNING_DELETED' => 'Deleted user warning
» %s', + 'LOG_WARNINGS_DELETED' => array( + 1 => 'Deleted user warning
» %1$s', + 2 => 'Deleted %2$d user warnings
» %1$s', // Example: 'Deleted 2 user warnings
» username' + ), + 'LOG_WARNINGS_DELETED_ALL' => 'Deleted all user warnings
» %s', + + 'LOG_WORD_ADD' => 'Added word censor
» %s', + 'LOG_WORD_DELETE' => 'Deleted word censor
» %s', + 'LOG_WORD_EDIT' => 'Edited word censor
» %s', + + 'LOG_EXT_ENABLE' => 'Extension enabled
» %s', + 'LOG_EXT_DISABLE' => 'Extension disabled
» %s', + 'LOG_EXT_PURGE' => 'Extension’s data deleted
» %s', +)); diff --git a/sources/phpBB/language/en/acp/database.php b/sources/phpBB/language/en/acp/database.php new file mode 100644 index 0000000..ab85701 --- /dev/null +++ b/sources/phpBB/language/en/acp/database.php @@ -0,0 +1,76 @@ + +* @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 + +// Database Backup/Restore +$lang = array_merge($lang, array( + 'ACP_BACKUP_EXPLAIN' => 'Here you can backup all your phpBB related data. You may store the resulting archive in your store/ folder or download it directly. Depending on your server configuration you may be able to compress the file in a number of formats.', + 'ACP_RESTORE_EXPLAIN' => 'This will perform a full restore of all phpBB tables from a saved file. If your server supports it you may use a gzip or bzip2 compressed text file and it will automatically be decompressed. WARNING This will overwrite any existing data. The restore may take a long time to process please do not move from this page till it is complete. Backups are stored in the store/ folder and are assumed to be generated by phpBB’s backup functionality. Restoring backups that were not created by the built in system may or may not work.', + + 'BACKUP_DELETE' => 'The backup file has been deleted successfully.', + 'BACKUP_INVALID' => 'The selected file to backup is invalid.', + 'BACKUP_OPTIONS' => 'Backup options', + 'BACKUP_SUCCESS' => 'The backup file has been created successfully.', + 'BACKUP_TYPE' => 'Backup type', + + 'DATABASE' => 'Database utilities', + 'DATA_ONLY' => 'Data only', + 'DELETE_BACKUP' => 'Delete backup', + 'DELETE_SELECTED_BACKUP' => 'Are you sure you want to delete the selected backup?', + 'DESELECT_ALL' => 'Deselect all', + 'DOWNLOAD_BACKUP' => 'Download backup', + + 'FILE_TYPE' => 'File type', + 'FILE_WRITE_FAIL' => 'Unable to write file to storage folder.', + 'FULL_BACKUP' => 'Full', + + 'RESTORE_FAILURE' => 'The backup file may be corrupt.', + 'RESTORE_OPTIONS' => 'Restore options', + 'RESTORE_SELECTED_BACKUP' => 'Are you sure you want to restore the selected backup?', + 'RESTORE_SUCCESS' => 'The database has been successfully restored.

Your board should be back to the state it was when the backup was made.', + + 'SELECT_ALL' => 'Select all', + 'SELECT_FILE' => 'Select a file', + 'START_BACKUP' => 'Start backup', + 'START_RESTORE' => 'Start restore', + 'STORE_AND_DOWNLOAD' => 'Store and download', + 'STORE_LOCAL' => 'Store file locally', + 'STRUCTURE_ONLY' => 'Structure only', + + 'TABLE_SELECT' => 'Table select', + 'TABLE_SELECT_ERROR'=> 'You must select at least one table.', +)); diff --git a/sources/phpBB/language/en/acp/email.php b/sources/phpBB/language/en/acp/email.php new file mode 100644 index 0000000..0d47e37 --- /dev/null +++ b/sources/phpBB/language/en/acp/email.php @@ -0,0 +1,68 @@ + +* @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 + +// Email settings +$lang = array_merge($lang, array( + 'ACP_MASS_EMAIL_EXPLAIN' => 'Here you can email a message to either all of your users or all users of a specific group having the option to receive mass emails enabled. To achieve this an email will be sent out to the administrative email address supplied, with a blind carbon copy sent to all recipients. The default setting is to only include 20 recipients in such an email, for more recipients more emails will be sent. If you are emailing a large group of people please be patient after submitting and do not stop the page halfway through. It is normal for a mass emailing to take a long time, you will be notified when the script has completed.', + 'ALL_USERS' => 'All users', + + 'COMPOSE' => 'Compose', + + 'EMAIL_SEND_ERROR' => 'There were one or more errors while sending the email. Please check the %sError log%s for detailed error messages.', + 'EMAIL_SENT' => 'This message has been sent.', + 'EMAIL_SENT_QUEUE' => 'This message has been queued for sending.', + + 'LOG_SESSION' => 'Log mail session to critical log', + + 'SEND_IMMEDIATELY' => 'Send immediately', + 'SEND_TO_GROUP' => 'Send to group', + 'SEND_TO_USERS' => 'Send to users', + 'SEND_TO_USERS_EXPLAIN' => 'Entering names here will override any group selected above. Enter each username on a new line.', + + 'MAIL_BANNED' => 'Mail banned users', + 'MAIL_BANNED_EXPLAIN' => 'When sending a mass email to a group you can select here whether banned users will also receive the email.', + 'MAIL_HIGH_PRIORITY' => 'High', + 'MAIL_LOW_PRIORITY' => 'Low', + 'MAIL_NORMAL_PRIORITY' => 'Normal', + 'MAIL_PRIORITY' => 'Mail priority', + 'MASS_MESSAGE' => 'Your message', + 'MASS_MESSAGE_EXPLAIN' => 'Please note that you may enter only plain text. All markup will be removed before sending.', + + 'NO_EMAIL_MESSAGE' => 'You must enter a message.', + 'NO_EMAIL_SUBJECT' => 'You must specify a subject for your message.', +)); diff --git a/sources/phpBB/language/en/acp/extensions.php b/sources/phpBB/language/en/acp/extensions.php new file mode 100644 index 0000000..28cdc88 --- /dev/null +++ b/sources/phpBB/language/en/acp/extensions.php @@ -0,0 +1,124 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* DO NOT CHANGE +*/ +if (empty($lang) || !is_array($lang)) +{ + $lang = array(); +} + +// DEVELOPERS PLEASE NOTE +// +// Placeholders can now contain order information, e.g. instead of +// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows +// translators to re-order the output of data while ensuring it remains correct +// +// You do not need this where single placeholders are used, e.g. 'Message %d' is fine +// equally where a string contains only two placeholders which are used to wrap text +// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine + +$lang = array_merge($lang, array( + 'EXTENSION' => 'Extension', + 'EXTENSIONS' => 'Extensions', + 'EXTENSIONS_ADMIN' => 'Extensions Manager', + 'EXTENSIONS_EXPLAIN' => 'The Extensions Manager is a tool in your phpBB Board which allows you to manage all of your extensions statuses and view information about them.', + 'EXTENSION_INVALID_LIST' => 'The “%s†extension is not valid.
%s

', + 'EXTENSION_NOT_AVAILABLE' => 'The selected extension is not available for this board, please verify your phpBB and PHP versions are allowed (see the details page).', + 'EXTENSION_DIR_INVALID' => 'The selected extension has an invalid directory structure and cannot be enabled.', + 'EXTENSION_NOT_ENABLEABLE' => 'The selected extension cannot be enabled, please verify the extension’s requirements.', + + 'DETAILS' => 'Details', + + 'EXTENSIONS_DISABLED' => 'Disabled Extensions', + 'EXTENSIONS_ENABLED' => 'Enabled Extensions', + + 'EXTENSION_DELETE_DATA' => 'Delete data', + 'EXTENSION_DISABLE' => 'Disable', + 'EXTENSION_ENABLE' => 'Enable', + + 'EXTENSION_DELETE_DATA_EXPLAIN' => 'Deleting an extension’s data removes all of its data and settings. The extension files are retained so it can be enabled again.', + 'EXTENSION_DISABLE_EXPLAIN' => 'Disabling an extension retains its files, data and settings but removes any functionality added by the extension.', + 'EXTENSION_ENABLE_EXPLAIN' => 'Enabling an extension allows you to use it on your board.', + + 'EXTENSION_DELETE_DATA_IN_PROGRESS' => 'The extension’s data is currently being deleted. Please do not leave or refresh this page until it is completed.', + 'EXTENSION_DISABLE_IN_PROGRESS' => 'The extension is currently being disabled. Please do not leave or refresh this page until it is completed.', + 'EXTENSION_ENABLE_IN_PROGRESS' => 'The extension is currently being enabled. Please do not leave or refresh this page until it is completed.', + + 'EXTENSION_DELETE_DATA_SUCCESS' => 'The extension’s data was deleted successfully', + 'EXTENSION_DISABLE_SUCCESS' => 'The extension was disabled successfully', + 'EXTENSION_ENABLE_SUCCESS' => 'The extension was enabled successfully', + + 'EXTENSION_NAME' => 'Extension Name', + 'EXTENSION_ACTIONS' => 'Actions', + 'EXTENSION_OPTIONS' => 'Options', + 'EXTENSION_UPDATE_HEADLINE' => 'Updating an extension', + 'EXTENSION_UPDATE_EXPLAIN' => '

    +
  1. Disable the extension
  2. +
  3. Delete the extension’s files from the filesystem
  4. +
  5. Upload the new files
  6. +
  7. Enable the extension
  8. +
', + 'EXTENSION_REMOVE_HEADLINE' => 'Completly removing an extension from your board', + 'EXTENSION_REMOVE_EXPLAIN' => '
    +
  1. Disable the extension
  2. +
  3. Delete the extension’s data
  4. +
  5. Delete the extension’s files from the filesystem
  6. +
', + + 'EXTENSION_DELETE_DATA_CONFIRM' => 'Are you sure that you wish to delete the data associated with “%s�

This removes all of its data and settings and cannot be undone!', + 'EXTENSION_DISABLE_CONFIRM' => 'Are you sure that you wish to disable the “%s†extension?', + 'EXTENSION_ENABLE_CONFIRM' => 'Are you sure that you wish to enable the “%s†extension?', + 'EXTENSION_FORCE_UNSTABLE_CONFIRM' => 'Are you sure that you wish to force the use of unstable version?', + + 'RETURN_TO_EXTENSION_LIST' => 'Return to the extension list', + + 'EXT_DETAILS' => 'Extension Details', + 'DISPLAY_NAME' => 'Display Name', + 'CLEAN_NAME' => 'Clean Name', + 'TYPE' => 'Type', + 'DESCRIPTION' => 'Description', + 'VERSION' => 'Version', + 'HOMEPAGE' => 'Homepage', + 'PATH' => 'File Path', + 'TIME' => 'Release Time', + 'LICENSE' => 'Licence', + + 'REQUIREMENTS' => 'Requirements', + 'PHPBB_VERSION' => 'phpBB Version', + 'PHP_VERSION' => 'PHP Version', + 'AUTHOR_INFORMATION' => 'Author Information', + 'AUTHOR_NAME' => 'Name', + 'AUTHOR_EMAIL' => 'Email', + 'AUTHOR_HOMEPAGE' => 'Homepage', + 'AUTHOR_ROLE' => 'Role', + + 'NOT_UP_TO_DATE' => '%s is not up to date', + 'UP_TO_DATE' => '%s is up to date', + 'ANNOUNCEMENT_TOPIC' => 'Release Announcement', + 'DOWNLOAD_LATEST' => 'Download Version', + 'NO_VERSIONCHECK' => 'No version check information given.', + + 'VERSIONCHECK_FORCE_UPDATE_ALL' => 'Re-Check all versions', + 'FORCE_UNSTABLE' => 'Always check for unstable versions', + 'EXTENSIONS_VERSION_CHECK_SETTINGS' => 'Version check settings', + + 'META_FIELD_NOT_SET' => 'Required meta field %s has not been set.', + 'META_FIELD_INVALID' => 'Meta field %s is invalid.', +)); diff --git a/sources/phpBB/language/en/acp/forums.php b/sources/phpBB/language/en/acp/forums.php new file mode 100644 index 0000000..541d05c --- /dev/null +++ b/sources/phpBB/language/en/acp/forums.php @@ -0,0 +1,165 @@ + +* @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 + +// Forum Admin +$lang = array_merge($lang, array( + 'AUTO_PRUNE_DAYS' => 'Auto-prune post age', + 'AUTO_PRUNE_DAYS_EXPLAIN' => 'Number of days since last post after which topic is removed.', + 'AUTO_PRUNE_FREQ' => 'Auto-prune frequency', + 'AUTO_PRUNE_FREQ_EXPLAIN' => 'Time in days between pruning events.', + 'AUTO_PRUNE_VIEWED' => 'Auto-prune post viewed age', + 'AUTO_PRUNE_VIEWED_EXPLAIN' => 'Number of days since topic was viewed after which topic is removed.', + 'AUTO_PRUNE_SHADOW_FREQ' => 'Auto-prune shadow topics frequency', + 'AUTO_PRUNE_SHADOW_DAYS' => 'Auto-prune shadow topics age', + 'AUTO_PRUNE_SHADOW_DAYS_EXPLAIN' => 'Number of days after which shadow topic is removed.', + 'AUTO_PRUNE_SHADOW_FREQ_EXPLAIN' => 'Time in days between pruning events.', + + 'CONTINUE' => 'Continue', + 'COPY_PERMISSIONS' => 'Copy permissions from', + 'COPY_PERMISSIONS_EXPLAIN' => 'To ease up the permission setup for your new forum, you can copy the permissions of an existing forum.', + 'COPY_PERMISSIONS_ADD_EXPLAIN' => 'Once created, the forum will have the same permissions as the one you select here. If no forum is selected the newly created forum will not be visible until permissions had been set.', + 'COPY_PERMISSIONS_EDIT_EXPLAIN' => 'If you select to copy permissions, the forum will have the same permissions as the one you select here. This will overwrite any permissions you have previously set for this forum with the permissions of the forum you select here. If no forum is selected the current permissions will be kept.', + 'COPY_TO_ACL' => 'Alternatively, you are also able to %sset up new permissions%s for this forum.', + 'CREATE_FORUM' => 'Create new forum', + + 'DECIDE_MOVE_DELETE_CONTENT' => 'Delete content or move to forum', + 'DECIDE_MOVE_DELETE_SUBFORUMS' => 'Delete subforums or move to forum', + 'DEFAULT_STYLE' => 'Default style', + 'DELETE_ALL_POSTS' => 'Delete posts', + 'DELETE_SUBFORUMS' => 'Delete subforums and posts', + 'DISPLAY_ACTIVE_TOPICS' => 'Enable active topics', + 'DISPLAY_ACTIVE_TOPICS_EXPLAIN' => 'If set to yes active topics in selected subforums will be displayed under this category.', + + 'EDIT_FORUM' => 'Edit forum', + 'ENABLE_INDEXING' => 'Enable search indexing', + 'ENABLE_INDEXING_EXPLAIN' => 'If set to yes posts made to this forum will be indexed for searching.', + 'ENABLE_POST_REVIEW' => 'Enable post review', + 'ENABLE_POST_REVIEW_EXPLAIN' => 'If set to yes users are able to review their post if new posts were made to the topic while users wrote theirs. This should be disabled for chat forums.', + 'ENABLE_QUICK_REPLY' => 'Enable quick reply', + 'ENABLE_QUICK_REPLY_EXPLAIN' => 'Enables the quick reply in this forum. This setting is not considered if the quick reply is disabled board wide. The quick reply will only be displayed for users who have permission to post in this forum.', + 'ENABLE_RECENT' => 'Display active topics', + 'ENABLE_RECENT_EXPLAIN' => 'If set to yes topics made to this forum will be shown in the active topics list.', + 'ENABLE_TOPIC_ICONS' => 'Enable topic icons', + + 'FORUM_ADMIN' => 'Forum administration', + 'FORUM_ADMIN_EXPLAIN' => 'In phpBB3 everything is forum based. A category is just a special type of forum. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category). Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum. You need to copy or set appropriate permissions for newly created forums to have them displayed.', + 'FORUM_AUTO_PRUNE' => 'Enable auto-pruning', + 'FORUM_AUTO_PRUNE_EXPLAIN' => 'Prunes the forum of topics, set the frequency/age parameters below.', + 'FORUM_CREATED' => 'Forum created successfully.', + 'FORUM_DATA_NEGATIVE' => 'Pruning parameters cannot be negative.', + 'FORUM_DESC_TOO_LONG' => 'The forum description is too long, it must be less than 4000 characters.', + 'FORUM_DELETE' => 'Delete forum', + 'FORUM_DELETE_EXPLAIN' => 'The form below will allow you to delete a forum. If the forum is postable you are able to decide where you want to put all topics (or forums) it contained.', + 'FORUM_DELETED' => 'Forum successfully deleted.', + 'FORUM_DESC' => 'Description', + 'FORUM_DESC_EXPLAIN' => 'Any HTML markup entered here will be displayed as is.', + 'FORUM_EDIT_EXPLAIN' => 'The form below will allow you to customise this forum. Please note that moderation and post count controls are set via forum permissions for each user or usergroup.', + 'FORUM_IMAGE' => 'Forum image', + 'FORUM_IMAGE_EXPLAIN' => 'Location, relative to the phpBB root directory, of an additional image to associate with this forum.', + 'FORUM_IMAGE_NO_EXIST' => 'The specified forum image does not exist', + 'FORUM_LINK_EXPLAIN' => 'Full URL (including the protocol, i.e.: http://) to the destination location that clicking this forum will take the user, e.g.: http://www.phpbb.com/.', + 'FORUM_LINK_TRACK' => 'Track link redirects', + 'FORUM_LINK_TRACK_EXPLAIN' => 'Records the number of times a forum link was clicked.', + 'FORUM_NAME' => 'Forum name', + 'FORUM_NAME_EMPTY' => 'You must enter a name for this forum.', + 'FORUM_PARENT' => 'Parent forum', + 'FORUM_PASSWORD' => 'Forum password', + 'FORUM_PASSWORD_CONFIRM' => 'Confirm forum password', + 'FORUM_PASSWORD_CONFIRM_EXPLAIN' => 'Only needs to be set if a forum password is entered.', + 'FORUM_PASSWORD_EXPLAIN' => 'Defines a password for this forum, use the permission system in preference.', + 'FORUM_PASSWORD_UNSET' => 'Remove forum password', + 'FORUM_PASSWORD_UNSET_EXPLAIN' => 'Check here if you want to remove the forum password.', + 'FORUM_PASSWORD_OLD' => 'The forum password is using an old hashing method and should be changed.', + 'FORUM_PASSWORD_MISMATCH' => 'The passwords you entered did not match.', + 'FORUM_PRUNE_SETTINGS' => 'Forum prune settings', + 'FORUM_PRUNE_SHADOW' => 'Enable auto-pruning of shadow topics', + 'FORUM_PRUNE_SHADOW_EXPLAIN' => 'Prunes the forum of shadow topics, set the frequency/age parameters below.', + 'FORUM_RESYNCED' => 'Forum “%s†successfully resynced', + 'FORUM_RULES_EXPLAIN' => 'Forum rules are displayed at any page within the given forum.', + 'FORUM_RULES_LINK' => 'Link to forum rules', + 'FORUM_RULES_LINK_EXPLAIN' => 'You are able to enter the URL of the page/post containing your forum rules here. This setting will override the forum rules text you specified.', + 'FORUM_RULES_PREVIEW' => 'Forum rules preview', + 'FORUM_RULES_TOO_LONG' => 'The forum rules must be less than 4000 characters.', + 'FORUM_SETTINGS' => 'Forum settings', + 'FORUM_STATUS' => 'Forum status', + 'FORUM_STYLE' => 'Forum style', + 'FORUM_TOPICS_PAGE' => 'Topics per page', + 'FORUM_TOPICS_PAGE_EXPLAIN' => 'If non-zero this value will override the default topics per page setting.', + 'FORUM_TYPE' => 'Forum type', + 'FORUM_UPDATED' => 'Forum information updated successfully.', + + 'FORUM_WITH_SUBFORUMS_NOT_TO_LINK' => 'You want to change a postable forum having subforums to a link. Please move all subforums out of this forum before you proceed, because after changing to a link you are no longer able to see the subforums currently connected to this forum.', + + 'GENERAL_FORUM_SETTINGS' => 'General forum settings', + + 'LINK' => 'Link', + 'LIST_INDEX' => 'List subforum in parent-forum’s legend', + 'LIST_INDEX_EXPLAIN' => 'Displays this forum on the index and elsewhere as a link within the legend of its parent-forum if the parent-forum’s “List subforums in legend†option is enabled.', + 'LIST_SUBFORUMS' => 'List subforums in legend', + 'LIST_SUBFORUMS_EXPLAIN' => 'Displays this forum’s subforums on the index and elsewhere as a link within the legend if their “List subforum in parent-forum’s legend†option is enabled.', + 'LOCKED' => 'Locked', + + 'MOVE_POSTS_NO_POSTABLE_FORUM' => 'The forum you selected for moving the posts to is not postable. Please select a postable forum.', + 'MOVE_POSTS_TO' => 'Move posts to', + 'MOVE_SUBFORUMS_TO' => 'Move subforums to', + + 'NO_DESTINATION_FORUM' => 'You have not specified a forum to move content to.', + 'NO_FORUM_ACTION' => 'No action defined for what happens with the forum content.', + 'NO_PARENT' => 'No parent', + 'NO_PERMISSIONS' => 'Do not copy permissions', + 'NO_PERMISSION_FORUM_ADD' => 'You do not have the necessary permissions to add forums.', + 'NO_PERMISSION_FORUM_DELETE' => 'You do not have the necessary permissions to delete forums.', + + 'PARENT_IS_LINK_FORUM' => 'The parent you specified is a forum link. Link forums are not able to hold other forums, please specify a category or forum as the parent forum.', + 'PARENT_NOT_EXIST' => 'Parent does not exist.', + 'PRUNE_ANNOUNCEMENTS' => 'Prune announcements', + 'PRUNE_STICKY' => 'Prune stickies', + 'PRUNE_OLD_POLLS' => 'Prune old polls', + 'PRUNE_OLD_POLLS_EXPLAIN' => 'Removes topics with polls not voted in for post age days.', + + 'REDIRECT_ACL' => 'Now you are able to %sset permissions%s for this forum.', + + 'SYNC_IN_PROGRESS' => 'Synchronizing forum', + 'SYNC_IN_PROGRESS_EXPLAIN' => 'Currently resyncing topic range %1$d/%2$d.', + + 'TYPE_CAT' => 'Category', + 'TYPE_FORUM' => 'Forum', + 'TYPE_LINK' => 'Link', + + 'UNLOCKED' => 'Unlocked', +)); diff --git a/sources/phpBB/language/en/acp/groups.php b/sources/phpBB/language/en/acp/groups.php new file mode 100644 index 0000000..a7700ed --- /dev/null +++ b/sources/phpBB/language/en/acp/groups.php @@ -0,0 +1,155 @@ + +* @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 + +$lang = array_merge($lang, array( + 'ACP_GROUPS_MANAGE_EXPLAIN' => 'From this panel you can administer all your usergroups. You can delete, create and edit existing groups. Furthermore, you may choose group leaders, toggle open/hidden/closed group status and set the group name and description.', + 'ADD_GROUP_CATEGORY' => 'Add category', + 'ADD_USERS' => 'Add users', + 'ADD_USERS_EXPLAIN' => 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Additionally you can define them as group leaders. Please enter each username on a separate line.', + + 'COPY_PERMISSIONS' => 'Copy permissions from', + 'COPY_PERMISSIONS_EXPLAIN' => 'Once created, the group will have the same permissions as the one you select here.', + 'CREATE_GROUP' => 'Create new group', + + 'GROUPS_NO_MEMBERS' => 'This group has no members', + 'GROUPS_NO_MODS' => 'No group leaders defined', + + 'GROUP_APPROVE' => 'Approve member', + 'GROUP_APPROVED' => 'Approved members', + 'GROUP_AVATAR' => 'Group avatar', + 'GROUP_AVATAR_EXPLAIN' => 'This image will be displayed in the Group Control Panel.', + 'GROUP_CATEGORY_NAME' => 'Category name', + 'GROUP_CLOSED' => 'Closed', + 'GROUP_COLOR' => 'Group colour', + 'GROUP_COLOR_EXPLAIN' => 'Defines the colour members’ usernames will appear in, leave blank for user default.', + 'GROUP_CONFIRM_ADD_USERS' => array( + 1 => 'Are you sure that you want to add the user %2$s to the group?', + 2 => 'Are you sure that you want to add the users %2$s to the group?', + ), + 'GROUP_CREATED' => 'Group has been created successfully.', + 'GROUP_DEFAULT' => 'Make group default for member', + 'GROUP_DEFS_UPDATED' => 'Default group set for all selected members.', + 'GROUP_DELETE' => 'Remove member from group', + 'GROUP_DELETED' => 'Group deleted and user default groups set successfully.', + 'GROUP_DEMOTE' => 'Demote group leader', + 'GROUP_DESC' => 'Group description', + 'GROUP_DETAILS' => 'Group details', + 'GROUP_EDIT_EXPLAIN' => 'Here you can edit an existing group. You can change its name, description and type (open, closed, etc.). You can also set certain group wide options such as colouration, rank, etc. Changes made here override users’ current settings. Please note that group members can override group-avatar settings, unless you set appropriate user permissions.', + 'GROUP_ERR_USERS_EXIST' => 'The specified users are already members of this group.', + 'GROUP_FOUNDER_MANAGE' => 'Founder manage only', + 'GROUP_FOUNDER_MANAGE_EXPLAIN' => 'Restrict management of this group to founders only. Users having group permissions are still able to see this group as well as this group’s members.', + 'GROUP_HIDDEN' => 'Hidden', + 'GROUP_LANG' => 'Group language', + 'GROUP_LEAD' => 'Group leaders', + 'GROUP_LEADERS_ADDED' => 'New leaders added to group successfully.', + 'GROUP_LEGEND' => 'Display group in legend', + 'GROUP_LIST' => 'Current members', + 'GROUP_LIST_EXPLAIN' => 'This is a complete list of all the current users with membership of this group. You can delete members (except in certain special groups) or add new ones as you see fit.', + '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_MODS_ADDED' => 'New group leaders added successfully.', + 'GROUP_MODS_DEMOTED' => 'Group leaders demoted successfully.', + 'GROUP_MODS_PROMOTED' => 'Group members promoted successfully.', + 'GROUP_NAME' => 'Group name', + 'GROUP_NAME_TAKEN' => 'The group name you entered is already in use, please select an alternative.', + '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_OPTIONS_SAVE' => 'Group wide options', + 'GROUP_PROMOTE' => 'Promote to group leader', + 'GROUP_RANK' => 'Group rank', + 'GROUP_RECEIVE_PM' => 'Group able to receive private messages', + 'GROUP_RECEIVE_PM_EXPLAIN' => 'Please note that hidden groups are not able to be messaged, regardless of this setting.', + 'GROUP_REQUEST' => 'Request', + 'GROUP_SETTINGS_SAVE' => 'Group wide settings', + 'GROUP_SKIP_AUTH' => 'Exempt group leader from permissions', + 'GROUP_SKIP_AUTH_EXPLAIN' => 'If enabled group leader no longer inherit permissions from the group.', + 'GROUP_SPECIAL' => 'Pre-defined', + 'GROUP_TEAMPAGE' => 'Display group on teampage', + 'GROUP_TYPE' => 'Group type', + 'GROUP_TYPE_EXPLAIN' => 'This determines which users can join or view this group.', + 'GROUP_UPDATED' => 'Group preferences updated successfully.', + + 'GROUP_USERS_ADDED' => 'New users added to group successfully.', + 'GROUP_USERS_EXIST' => 'The selected users are already members.', + 'GROUP_USERS_REMOVE' => 'Users removed from group and new defaults set successfully.', + + 'LEGEND_EXPLAIN' => 'These are the groups which are displayed in the group legend:', + 'LEGEND_SETTINGS' => 'Legend settings', + 'LEGEND_SORT_GROUPNAME' => 'Sort legend by group name', + 'LEGEND_SORT_GROUPNAME_EXPLAIN' => 'The order below is ignored when this option is enabled.', + + 'MANAGE_LEGEND' => 'Manage group legend', + 'MANAGE_TEAMPAGE' => 'Manage teampage', + 'MAKE_DEFAULT_FOR_ALL' => 'Make default group for every member', + 'MEMBERS' => 'Members', + + 'NO_GROUP' => 'No group specified.', + 'NO_GROUPS_ADDED' => 'No groups added yet.', + 'NO_GROUPS_CREATED' => 'No groups created yet.', + 'NO_PERMISSIONS' => 'Do not copy permissions', + 'NO_USERS' => 'You haven’t entered any users.', + 'NO_USERS_ADDED' => 'No users were added to the group.', + 'NO_VALID_USERS' => 'You haven’t entered any users eligible for that action.', + + 'SELECT_GROUP' => 'Select a group', + 'SPECIAL_GROUPS' => 'Pre-defined groups', + 'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings.', + + 'TEAMPAGE' => 'Teampage', + 'TEAMPAGE_DISP_ALL' => 'All memberships', + 'TEAMPAGE_DISP_DEFAULT' => 'User’s default group only', + 'TEAMPAGE_DISP_FIRST' => 'First membership only', + 'TEAMPAGE_EXPLAIN' => 'These are the groups which are displayed on the teampage:', + 'TEAMPAGE_FORUMS' => 'Display moderated forums', + 'TEAMPAGE_FORUMS_EXPLAIN' => 'If set to yes, moderators will have a list with all of the forums where they have moderator permissions displayed in their row. This can be very database intensive for big boards.', + 'TEAMPAGE_MEMBERSHIPS' => 'Display user memberships', + 'TEAMPAGE_SETTINGS' => 'Teampage settings', + 'TOTAL_MEMBERS' => 'Members', + + 'USERS_APPROVED' => 'Users approved successfully.', + 'USER_DEFAULT' => 'User default', + 'USER_DEF_GROUPS' => 'User defined groups', + 'USER_DEF_GROUPS_EXPLAIN' => 'These are groups created by you or another admin on this board. You can manage memberships as well as edit group properties or even delete the group.', + 'USER_GROUP_DEFAULT' => 'Set as default group', + 'USER_GROUP_DEFAULT_EXPLAIN' => 'Saying yes here will set this group as the default group for the added users.', + 'USER_GROUP_LEADER' => 'Set as group leader', +)); diff --git a/sources/phpBB/language/en/acp/index.htm b/sources/phpBB/language/en/acp/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/language/en/acp/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/language/en/acp/language.php b/sources/phpBB/language/en/acp/language.php new file mode 100644 index 0000000..f46e78e --- /dev/null +++ b/sources/phpBB/language/en/acp/language.php @@ -0,0 +1,76 @@ + +* @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 + +$lang = array_merge($lang, array( + 'ACP_FILES' => 'Admin language files', + 'ACP_LANGUAGE_PACKS_EXPLAIN' => 'Here you are able to install/remove language packs. The default language pack is marked with an asterisk (*).', + + 'DELETE_LANGUAGE_CONFIRM' => 'Are you sure you wish to delete “%s�', + + 'INSTALLED_LANGUAGE_PACKS' => 'Installed language packs', + + 'LANGUAGE_DETAILS_UPDATED' => 'Language details successfully updated.', + 'LANGUAGE_PACK_ALREADY_INSTALLED' => 'This language pack is already installed.', + 'LANGUAGE_PACK_DELETED' => 'The language pack “%s†has been removed successfully. All users using this language have been reset to the board’s default language.', + 'LANGUAGE_PACK_DETAILS' => 'Language pack details', + 'LANGUAGE_PACK_INSTALLED' => 'The language pack “%s†has been successfully installed.', + 'LANGUAGE_PACK_CPF_UPDATE' => 'The custom profile fields’ language strings were copied from the default language. Please change them if necessary.', + 'LANGUAGE_PACK_ISO' => 'ISO', + 'LANGUAGE_PACK_LOCALNAME' => 'Local name', + 'LANGUAGE_PACK_NAME' => 'Name', + 'LANGUAGE_PACK_NOT_EXIST' => 'The selected language pack does not exist.', + 'LANGUAGE_PACK_USED_BY' => 'Used by (including robots)', + 'LANGUAGE_VARIABLE' => 'Language variable', + 'LANG_AUTHOR' => 'Language pack author', + 'LANG_ENGLISH_NAME' => 'English name', + 'LANG_ISO_CODE' => 'ISO code', + 'LANG_LOCAL_NAME' => 'Local name', + + 'MISSING_LANG_FILES' => 'Missing language files', + 'MISSING_LANG_VARIABLES' => 'Missing language variables', + + 'NO_FILE_SELECTED' => 'You haven’t specified a language file.', + 'NO_LANG_ID' => 'You haven’t specified a language pack.', + 'NO_REMOVE_DEFAULT_LANG' => 'You are not able to remove the default language pack.
If you want to remove this language pack, change your board’s default language first.', + 'NO_UNINSTALLED_LANGUAGE_PACKS' => 'No uninstalled language packs', + + 'THOSE_MISSING_LANG_FILES' => 'The following language files are missing from the “%s†language folder', + 'THOSE_MISSING_LANG_VARIABLES' => 'The following language variables are missing from the “%s†language pack', + + 'UNINSTALLED_LANGUAGE_PACKS' => 'Uninstalled language packs', +)); diff --git a/sources/phpBB/language/en/acp/modules.php b/sources/phpBB/language/en/acp/modules.php new file mode 100644 index 0000000..1213641 --- /dev/null +++ b/sources/phpBB/language/en/acp/modules.php @@ -0,0 +1,83 @@ + +* @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 + +$lang = array_merge($lang, array( + 'ACP_MODULE_MANAGEMENT_EXPLAIN' => 'Here you are able to manage all kind of modules. Please note that the ACP has a three-level menu structure (Category -> Category -> Module) whereby the others having a two-level menu structure (Category -> Module) which must be kept. Please also be aware that you may lock out yourself if you disable or delete the modules responsible for the module management itself.', + 'ADD_MODULE' => 'Add module', + 'ADD_MODULE_CONFIRM' => 'Are you sure you want to add the selected module with the selected mode?', + 'ADD_MODULE_TITLE' => 'Add module', + + 'CANNOT_REMOVE_MODULE' => 'Unable to remove module, it has assigned children. Please remove or move all children before performing this action.', + 'CATEGORY' => 'Category', + 'CHOOSE_MODE' => 'Choose module mode', + 'CHOOSE_MODE_EXPLAIN' => 'Choose the modules mode being used.', + 'CHOOSE_MODULE' => 'Choose module', + 'CHOOSE_MODULE_EXPLAIN' => 'Choose the file being called by this module.', + 'CREATE_MODULE' => 'Create new module', + + 'DEACTIVATED_MODULE' => 'Deactivated module', + 'DELETE_MODULE' => 'Delete module', + 'DELETE_MODULE_CONFIRM' => 'Are you sure you want to remove this module?', + + 'EDIT_MODULE' => 'Edit module', + 'EDIT_MODULE_EXPLAIN' => 'Here you are able to enter module specific settings.', + + 'HIDDEN_MODULE' => 'Hidden module', + + 'MODULE' => 'Module', + 'MODULE_ADDED' => 'Module successfully added.', + 'MODULE_DELETED' => 'Module successfully removed.', + 'MODULE_DISPLAYED' => 'Module displayed', + 'MODULE_DISPLAYED_EXPLAIN' => 'If you do not wish to display this module, but want to use it, set this to no.', + 'MODULE_EDITED' => 'Module successfully edited.', + 'MODULE_ENABLED' => 'Module enabled', + 'MODULE_LANGNAME' => 'Module language name', + 'MODULE_LANGNAME_EXPLAIN' => 'Enter the displayed module name. Use language constant if name is served from language file.', + 'MODULE_TYPE' => 'Module type', + + 'NO_CATEGORY_TO_MODULE' => 'Unable to turn category into module. Please remove/move all children before performing this action.', + 'NO_MODULE' => 'No module found.', + 'NO_MODULE_ID' => 'No module id specified.', + 'NO_MODULE_LANGNAME' => 'No module language name specified.', + 'NO_PARENT' => 'No Parent', + + 'PARENT' => 'Parent', + 'PARENT_NO_EXIST' => 'Parent does not exist.', + + 'SELECT_MODULE' => 'Select a module', +)); diff --git a/sources/phpBB/language/en/acp/permissions.php b/sources/phpBB/language/en/acp/permissions.php new file mode 100644 index 0000000..1ade2d6 --- /dev/null +++ b/sources/phpBB/language/en/acp/permissions.php @@ -0,0 +1,287 @@ + +* @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 + +$lang = array_merge($lang, array( + 'ACP_PERMISSIONS_EXPLAIN' => ' +

Permissions are highly granular and grouped into four major sections, which are:

+ +

Global Permissions

+

These are used to control access on a global level and apply to the entire bulletin board. They are further divided into User Permissions, Group Permissions, Administrators and Global Moderators.

+ +

Forum Based Permissions

+

These are used to control access on a per forum basis. They are further divided into Forum Permissions, Forum Moderators, User Forum Permissions and Group Forum Permissions.

+ +

Permission Roles

+

These are used to create different sets of permissions for the different permission types later being able to be assigned on a role-based basis. The default roles should cover the administration of bulletin boards large and small, though within each of the four divisions, you can add/edit/delete roles as you see fit.

+ +

Permission Masks

+

These are used to view the effective permissions assigned to Users, Moderators (Local and Global), Administrators or Forums.

+ +
+ +

For further information on setting up and managing permissions on your phpBB3 board, please see the section on Setting permissions of our Quick Start Guide.

+ ', + + 'ACL_NEVER' => 'Never', + 'ACL_SET' => 'Setting permissions', + 'ACL_SET_EXPLAIN' => 'Permissions are based on a simple YES/NO system. Setting an option to NEVER for a user or usergroup overrides any other value assigned to it. If you do not wish to assign a value for an option for this user or group select NO. If values are assigned for this option elsewhere they will be used in preference, else NEVER is assumed. All objects marked (with the checkbox in front of them) will copy the permission set you defined.', + 'ACL_SETTING' => 'Setting', + + 'ACL_TYPE_A_' => 'Administrative permissions', + 'ACL_TYPE_F_' => 'Forum permissions', + 'ACL_TYPE_M_' => 'Moderative permissions', + 'ACL_TYPE_U_' => 'User permissions', + + 'ACL_TYPE_GLOBAL_A_' => 'Administrative permissions', + 'ACL_TYPE_GLOBAL_U_' => 'User permissions', + 'ACL_TYPE_GLOBAL_M_' => 'Global Moderator permissions', + 'ACL_TYPE_LOCAL_M_' => 'Forum Moderator permissions', + 'ACL_TYPE_LOCAL_F_' => 'Forum permissions', + + 'ACL_NO' => 'No', + 'ACL_VIEW' => 'Viewing permissions', + 'ACL_VIEW_EXPLAIN' => 'Here you can see the effective permissions the user/group is having. A red square indicates that the user/group does not have the permission, a green square indicates that the user/group does have the permission.', + 'ACL_YES' => 'Yes', + + 'ACP_ADMINISTRATORS_EXPLAIN' => 'Here you can assign administrator permissions to users or groups. All users with administrator permissions can view the administration control panel.', + 'ACP_FORUM_MODERATORS_EXPLAIN' => 'Here you can assign users and groups as forum moderators. To assign users access to forums, to define global moderative permissions or administrators please use the appropriate page.', + 'ACP_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can alter which users and groups can access which forums. To assign moderators or define administrators please use the appropriate page.', + 'ACP_FORUM_PERMISSIONS_COPY_EXPLAIN' => 'Here you can copy forum permissions from one forum to one or more other forums.', + 'ACP_GLOBAL_MODERATORS_EXPLAIN' => 'Here you can assign global moderator permissions to users or groups. These moderators are like ordinary moderators except they have access to every forum on your board.', + 'ACP_GROUPS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to groups.', + 'ACP_GROUPS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to groups - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. Individual user permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group permissions.', + 'ACP_ADMIN_ROLES_EXPLAIN' => 'Here you are able to manage the roles for administrative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', + 'ACP_FORUM_ROLES_EXPLAIN' => 'Here you are able to manage the roles for forum permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', + 'ACP_MOD_ROLES_EXPLAIN' => 'Here you are able to manage the roles for moderative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', + 'ACP_USER_ROLES_EXPLAIN' => 'Here you are able to manage the roles for user permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', + 'ACP_USERS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to users.', + 'ACP_USERS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to users - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. To alter these settings for large numbers of users the Group permissions system is the preferred method. User permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group permissions.', + 'ACP_VIEW_ADMIN_PERMISSIONS_EXPLAIN' => 'Here you can view the effective administrative permissions assigned to the selected users/groups.', + 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS_EXPLAIN' => 'Here you can view the global moderative permissions assigned to the selected users/groups.', + 'ACP_VIEW_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can view the forum permissions assigned to the selected users/groups and forums.', + 'ACP_VIEW_FORUM_MOD_PERMISSIONS_EXPLAIN' => 'Here you can view the forum moderator permissions assigned to the selected users/groups and forums.', + 'ACP_VIEW_USER_PERMISSIONS_EXPLAIN' => 'Here you can view the effective user permissions assigned to the selected users/groups.', + + 'ADD_GROUPS' => 'Add groups', + 'ADD_PERMISSIONS' => 'Add permissions', + 'ADD_USERS' => 'Add users', + 'ADVANCED_PERMISSIONS' => 'Advanced Permissions', + 'ALL_GROUPS' => 'Select all groups', + 'ALL_NEVER' => 'All NEVER', + 'ALL_NO' => 'All NO', + 'ALL_USERS' => 'Select all users', + 'ALL_YES' => 'All YES', + 'APPLY_ALL_PERMISSIONS' => 'Apply all permissions', + 'APPLY_PERMISSIONS' => 'Apply permissions', + 'APPLY_PERMISSIONS_EXPLAIN' => 'The permissions and role defined for this item will only be applied to this item and all checked items.', + 'AUTH_UPDATED' => 'Permissions have been updated.', + + 'COPY_PERMISSIONS_CONFIRM' => 'Are you sure you wish to carry out this operation? Please be aware that this will overwrite any existing permissions on the selected targets.', + 'COPY_PERMISSIONS_FORUM_FROM_EXPLAIN' => 'The source forum you want to copy permissions from.', + 'COPY_PERMISSIONS_FORUM_TO_EXPLAIN' => 'The destination forums you want the copied permissions applied to.', + 'COPY_PERMISSIONS_FROM' => 'Copy permissions from', + 'COPY_PERMISSIONS_TO' => 'Apply permissions to', + + 'CREATE_ROLE' => 'Create role', + 'CREATE_ROLE_FROM' => 'Use settings from…', + 'CUSTOM' => 'Custom…', + + 'DEFAULT' => 'Default', + 'DELETE_ROLE' => 'Delete role', + 'DELETE_ROLE_CONFIRM' => 'Are you sure you want to remove this role? Items having this role assigned will not lose their permission settings.', + 'DISPLAY_ROLE_ITEMS' => 'View items using this role', + + 'EDIT_PERMISSIONS' => 'Edit permissions', + 'EDIT_ROLE' => 'Edit role', + + 'GROUPS_NOT_ASSIGNED' => 'No group assigned to this role', + + 'LOOK_UP_GROUP' => 'Look up usergroup', + 'LOOK_UP_USER' => 'Look up user', + + 'MANAGE_GROUPS' => 'Manage groups', + 'MANAGE_USERS' => 'Manage users', + + 'NO_AUTH_SETTING_FOUND' => 'Permission settings not defined.', + 'NO_ROLE_ASSIGNED' => 'No role assigned…', + 'NO_ROLE_ASSIGNED_EXPLAIN' => 'Setting to this role does not change permissions on the right. If you want to unset/remove all permissions you should use the “All NO†link.', + 'NO_ROLE_AVAILABLE' => 'No role available', + 'NO_ROLE_NAME_SPECIFIED' => 'Please give the role a name.', + 'NO_ROLE_SELECTED' => 'Role could not be found.', + 'NO_USER_GROUP_SELECTED' => 'You haven’t selected any user or group.', + + 'ONLY_FORUM_DEFINED' => 'You only defined forums in your selection. Please also select at least one user or one group.', + + 'PERMISSION_APPLIED_TO_ALL' => 'Permissions and role will also be applied to all checked objects', + 'PLUS_SUBFORUMS' => '+Subforums', + + 'REMOVE_PERMISSIONS' => 'Remove permissions', + 'REMOVE_ROLE' => 'Remove role', + 'RESULTING_PERMISSION' => 'Resulting permission', + 'ROLE' => 'Role', + 'ROLE_ADD_SUCCESS' => 'Role successfully added.', + 'ROLE_ASSIGNED_TO' => 'Users/Groups assigned to %s', + 'ROLE_DELETED' => 'Role successfully removed.', + 'ROLE_DESCRIPTION' => 'Role description', + + 'ROLE_ADMIN_FORUM' => 'Forum Admin', + 'ROLE_ADMIN_FULL' => 'Full Admin', + 'ROLE_ADMIN_STANDARD' => 'Standard Admin', + 'ROLE_ADMIN_USERGROUP' => 'User and Groups Admin', + 'ROLE_FORUM_BOT' => 'Bot Access', + 'ROLE_FORUM_FULL' => 'Full Access', + 'ROLE_FORUM_LIMITED' => 'Limited Access', + 'ROLE_FORUM_LIMITED_POLLS' => 'Limited Access + Polls', + 'ROLE_FORUM_NOACCESS' => 'No Access', + 'ROLE_FORUM_ONQUEUE' => 'On Moderation Queue', + 'ROLE_FORUM_POLLS' => 'Standard Access + Polls', + 'ROLE_FORUM_READONLY' => 'Read Only Access', + 'ROLE_FORUM_STANDARD' => 'Standard Access', + 'ROLE_FORUM_NEW_MEMBER' => 'Newly Registered User Access', + 'ROLE_MOD_FULL' => 'Full Moderator', + 'ROLE_MOD_QUEUE' => 'Queue Moderator', + 'ROLE_MOD_SIMPLE' => 'Simple Moderator', + 'ROLE_MOD_STANDARD' => 'Standard Moderator', + 'ROLE_USER_FULL' => 'All Features', + 'ROLE_USER_LIMITED' => 'Limited Features', + 'ROLE_USER_NOAVATAR' => 'No Avatar', + 'ROLE_USER_NOPM' => 'No Private Messages', + 'ROLE_USER_STANDARD' => 'Standard Features', + 'ROLE_USER_NEW_MEMBER' => 'Newly Registered User Features', + + 'ROLE_DESCRIPTION_ADMIN_FORUM' => 'Can access the forum management and forum permission settings.', + 'ROLE_DESCRIPTION_ADMIN_FULL' => 'Has access to all administrative functions of this board.
Not recommended.', + 'ROLE_DESCRIPTION_ADMIN_STANDARD' => 'Has access to most administrative features but is not allowed to use server or system related tools.', + 'ROLE_DESCRIPTION_ADMIN_USERGROUP' => 'Can manage groups and users: Able to change permissions, settings, manage bans, and manage ranks.', + 'ROLE_DESCRIPTION_FORUM_BOT' => 'This role is recommended for bots and search spiders.', + 'ROLE_DESCRIPTION_FORUM_FULL' => 'Can use all forum features, including posting of announcements and stickies. Can also ignore the flood limit.
Not recommended for normal users.', + 'ROLE_DESCRIPTION_FORUM_LIMITED' => 'Can use some forum features, but cannot attach files or use post icons.', + 'ROLE_DESCRIPTION_FORUM_LIMITED_POLLS' => 'As per Limited Access but can also create polls.', + 'ROLE_DESCRIPTION_FORUM_NOACCESS' => 'Can neither see nor access the forum.', + 'ROLE_DESCRIPTION_FORUM_ONQUEUE' => 'Can use most forum features including attachments, but posts and topics need to be approved by a moderator.', + 'ROLE_DESCRIPTION_FORUM_POLLS' => 'Like Standard Access but can also create polls.', + 'ROLE_DESCRIPTION_FORUM_READONLY' => 'Can read the forum, but cannot create new topics or reply to posts.', + 'ROLE_DESCRIPTION_FORUM_STANDARD' => 'Can use most forum features including attachments and deleting own topics, but cannot lock own topics, and cannot create polls.', + 'ROLE_DESCRIPTION_FORUM_NEW_MEMBER' => 'A role for members of the special newly registered users group; contains NEVER permissions to lock features for new users.', + 'ROLE_DESCRIPTION_MOD_FULL' => 'Can use all moderating features, including banning.', + 'ROLE_DESCRIPTION_MOD_QUEUE' => 'Can use the Moderation Queue to validate and edit posts, but nothing else.', + 'ROLE_DESCRIPTION_MOD_SIMPLE' => 'Can only use basic topic actions. Cannot send warnings or use moderation queue.', + 'ROLE_DESCRIPTION_MOD_STANDARD' => 'Can use most moderating tools, but cannot ban users or change the post author.', + 'ROLE_DESCRIPTION_USER_FULL' => 'Can use all available forum features for users, including changing the user name or ignoring the flood limit.
Not recommended.', + 'ROLE_DESCRIPTION_USER_LIMITED' => 'Can access some of the user features. Attachments, emails, or instant messages are not allowed.', + 'ROLE_DESCRIPTION_USER_NOAVATAR' => 'Has a limited feature set and is not allowed to use the Avatar feature.', + 'ROLE_DESCRIPTION_USER_NOPM' => 'Has a limited feature set, and is not allowed to use Private Messages.', + 'ROLE_DESCRIPTION_USER_STANDARD' => 'Can access most but not all user features. Cannot change user name or ignore the flood limit, for instance.', + 'ROLE_DESCRIPTION_USER_NEW_MEMBER' => 'A role for members of the special newly registered users group; contains NEVER permissions to lock features for new users.', + + 'ROLE_DESCRIPTION_EXPLAIN' => 'You are able to enter a short explanation of what the role is doing or for what it is meant for. The text you enter here will be displayed within the permissions screens too.', + 'ROLE_DESCRIPTION_LONG' => 'The role description is too long, please limit it to 4000 characters.', + 'ROLE_DETAILS' => 'Role details', + 'ROLE_EDIT_SUCCESS' => 'Role successfully edited.', + 'ROLE_NAME' => 'Role name', + 'ROLE_NAME_ALREADY_EXIST' => 'A role named %s already exist for the specified permission type.', + 'ROLE_NOT_ASSIGNED' => 'Role has not been assigned yet.', + + 'SELECTED_FORUM_NOT_EXIST' => 'The selected forum(s) do not exist.', + 'SELECTED_GROUP_NOT_EXIST' => 'The selected group(s) do not exist.', + 'SELECTED_USER_NOT_EXIST' => 'The selected user(s) do not exist.', + 'SELECT_FORUM_SUBFORUM_EXPLAIN' => 'The forum you select here will include all subforums into the selection.', + 'SELECT_ROLE' => 'Select role…', + 'SELECT_TYPE' => 'Select type', + 'SET_PERMISSIONS' => 'Set permissions', + 'SET_ROLE_PERMISSIONS' => 'Set role permissions', + 'SET_USERS_PERMISSIONS' => 'Set user permissions', + 'SET_USERS_FORUM_PERMISSIONS' => 'Set user forum permissions', + + 'TRACE_DEFAULT' => 'By default every permission is NO (unset). So the permission can be overwritten by other settings.', + 'TRACE_FOR' => 'Trace for', + 'TRACE_GLOBAL_SETTING' => '%s (global)', + 'TRACE_GROUP_NEVER_TOTAL_NEVER' => 'This group’s permission is set to NEVER like the total result so the old result is kept.', + 'TRACE_GROUP_NEVER_TOTAL_NEVER_LOCAL' => 'This group’s permission for this forum is set to NEVER like the total result so the old result is kept.', + 'TRACE_GROUP_NEVER_TOTAL_NO' => 'This group’s permission is set to NEVER which becomes the new total value because it wasn’t set yet (set to NO).', + 'TRACE_GROUP_NEVER_TOTAL_NO_LOCAL' => 'This group’s permission for this forum is set to NEVER which becomes the new total value because it wasn’t set yet (set to NO).', + 'TRACE_GROUP_NEVER_TOTAL_YES' => 'This group’s permission is set to NEVER which overwrites the total YES to a NEVER for this user.', + 'TRACE_GROUP_NEVER_TOTAL_YES_LOCAL' => 'This group’s permission for this forum is set to NEVER which overwrites the total YES to a NEVER for this user.', + 'TRACE_GROUP_NO' => 'The permission is NO for this group so the old total value is kept.', + 'TRACE_GROUP_NO_LOCAL' => 'The permission is NO for this group within this forum so the old total value is kept.', + 'TRACE_GROUP_YES_TOTAL_NEVER' => 'This group’s permission is set to YES but the total NEVER cannot be overwritten.', + 'TRACE_GROUP_YES_TOTAL_NEVER_LOCAL' => 'This group’s permission for this forum is set to YES but the total NEVER cannot be overwritten.', + 'TRACE_GROUP_YES_TOTAL_NO' => 'This group’s permission is set to YES which becomes the new total value because it wasn’t set yet (set to NO).', + 'TRACE_GROUP_YES_TOTAL_NO_LOCAL' => 'This group’s permission for this forum is set to YES which becomes the new total value because it wasn’t set yet (set to NO).', + 'TRACE_GROUP_YES_TOTAL_YES' => 'This group’s permission is set to YES and the total permission is already set to YES, so the total result is kept.', + 'TRACE_GROUP_YES_TOTAL_YES_LOCAL' => 'This group’s permission for this forum is set to YES and the total permission is already set to YES, so the total result is kept.', + 'TRACE_PERMISSION' => 'Trace permission - %s', + 'TRACE_RESULT' => 'Trace result', + 'TRACE_SETTING' => 'Trace setting', + + 'TRACE_USER_GLOBAL_YES_TOTAL_YES' => 'The forum independent user permission evaluates to YES but the total permission is already set to YES, so the total result is kept. %sTrace global permission%s', + 'TRACE_USER_GLOBAL_YES_TOTAL_NEVER' => 'The forum independent user permission evaluates to YES which overwrites the current local result NEVER. %sTrace global permission%s', + 'TRACE_USER_GLOBAL_NEVER_TOTAL_KEPT' => 'The forum independent user permission evaluates to NEVER which doesn’t influence the local permission. %sTrace global permission%s', + + 'TRACE_USER_FOUNDER' => 'The user is a founder, therefore admin permissions are always set to YES.', + 'TRACE_USER_KEPT' => 'The user’s permission is NO so the old total value is kept.', + 'TRACE_USER_KEPT_LOCAL' => 'The user’s permission for this forum is NO so the old total value is kept.', + 'TRACE_USER_NEVER_TOTAL_NEVER' => 'The user’s permission is set to NEVER and the total value is set to NEVER, so nothing is changed.', + 'TRACE_USER_NEVER_TOTAL_NEVER_LOCAL' => 'The user’s permission for this forum is set to NEVER and the total value is set to NEVER, so nothing is changed.', + 'TRACE_USER_NEVER_TOTAL_NO' => 'The user’s permission is set to NEVER which becomes the total value because it was set to NO.', + 'TRACE_USER_NEVER_TOTAL_NO_LOCAL' => 'The user’s permission for this forum is set to NEVER which becomes the total value because it was set to NO.', + 'TRACE_USER_NEVER_TOTAL_YES' => 'The user’s permission is set to NEVER and overwrites the previous YES.', + 'TRACE_USER_NEVER_TOTAL_YES_LOCAL' => 'The user’s permission for this forum is set to NEVER and overwrites the previous YES.', + 'TRACE_USER_NO_TOTAL_NO' => 'The user’s permission is NO and the total value was set to NO so it defaults to NEVER.', + 'TRACE_USER_NO_TOTAL_NO_LOCAL' => 'The user’s permission for this forum is NO and the total value was set to NO so it defaults to NEVER.', + 'TRACE_USER_YES_TOTAL_NEVER' => 'The user’s permission is set to YES but the total NEVER cannot be overwritten.', + 'TRACE_USER_YES_TOTAL_NEVER_LOCAL' => 'The user’s permission for this forum is set to YES but the total NEVER cannot be overwritten.', + 'TRACE_USER_YES_TOTAL_NO' => 'The user’s permission is set to YES which becomes the total value because it was set to NO.', + 'TRACE_USER_YES_TOTAL_NO_LOCAL' => 'The user’s permission for this forum is set to YES which becomes the total value because it was set to NO.', + 'TRACE_USER_YES_TOTAL_YES' => 'The user’s permission is set to YES and the total value is set to YES, so nothing is changed.', + 'TRACE_USER_YES_TOTAL_YES_LOCAL' => 'The user’s permission for this forum is set to YES and the total value is set to YES, so nothing is changed.', + 'TRACE_WHO' => 'Who', + 'TRACE_TOTAL' => 'Total', + + 'USERS_NOT_ASSIGNED' => 'No users are assigned to this role', + 'USER_IS_MEMBER_OF_DEFAULT' => 'is a member of the following pre-defined groups', + 'USER_IS_MEMBER_OF_CUSTOM' => 'is a member of the following user defined groups', + + 'VIEW_ASSIGNED_ITEMS' => 'View assigned items', + 'VIEW_LOCAL_PERMS' => 'Local permissions', + 'VIEW_GLOBAL_PERMS' => 'Global permissions', + 'VIEW_PERMISSIONS' => 'View permissions', + + 'WRONG_PERMISSION_TYPE' => 'Wrong permission type selected.', + 'WRONG_PERMISSION_SETTING_FORMAT' => 'The permission settings are in a wrong format, phpBB is not able to process them correctly.', +)); diff --git a/sources/phpBB/language/en/acp/permissions_phpbb.php b/sources/phpBB/language/en/acp/permissions_phpbb.php new file mode 100644 index 0000000..b9aeed8 --- /dev/null +++ b/sources/phpBB/language/en/acp/permissions_phpbb.php @@ -0,0 +1,211 @@ + +* @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 + +/** +* EXTENSION-DEVELOPERS PLEASE NOTE +* +* You are able to put your permission sets into your extension. +* The permissions logic should be added via the 'core.permissions' event. +* You can easily add new permission categories, types and permissions, by +* simply merging them into the respective arrays. +* The respective language strings should be added into a language file, that +* start with 'permissions_', so they are automatically loaded within the ACP. +*/ + +$lang = array_merge($lang, array( + 'ACL_CAT_ACTIONS' => 'Actions', + 'ACL_CAT_CONTENT' => 'Content', + 'ACL_CAT_FORUMS' => 'Forums', + 'ACL_CAT_MISC' => 'Misc', + 'ACL_CAT_PERMISSIONS' => 'Permissions', + 'ACL_CAT_PM' => 'Private messages', + 'ACL_CAT_POLLS' => 'Polls', + 'ACL_CAT_POST' => 'Post', + 'ACL_CAT_POST_ACTIONS' => 'Post actions', + 'ACL_CAT_POSTING' => 'Posting', + 'ACL_CAT_PROFILE' => 'Profile', + 'ACL_CAT_SETTINGS' => 'Settings', + 'ACL_CAT_TOPIC_ACTIONS' => 'Topic actions', + 'ACL_CAT_USER_GROUP' => 'Users & Groups', +)); + +// User Permissions +$lang = array_merge($lang, array( + 'ACL_U_VIEWPROFILE' => 'Can view profiles, memberlist and online list', + 'ACL_U_CHGNAME' => 'Can change username', + 'ACL_U_CHGPASSWD' => 'Can change password', + 'ACL_U_CHGEMAIL' => 'Can change email address', + 'ACL_U_CHGAVATAR' => 'Can change avatar', + 'ACL_U_CHGGRP' => 'Can change default usergroup', + 'ACL_U_CHGPROFILEINFO' => 'Can change profile field information', + + 'ACL_U_ATTACH' => 'Can attach files', + 'ACL_U_DOWNLOAD' => 'Can download files', + 'ACL_U_SAVEDRAFTS' => 'Can save drafts', + 'ACL_U_CHGCENSORS' => 'Can disable word censors', + 'ACL_U_SIG' => 'Can use signature', + + 'ACL_U_SENDPM' => 'Can send private messages', + 'ACL_U_MASSPM' => 'Can send messages to multiple users', + 'ACL_U_MASSPM_GROUP'=> 'Can send messages to groups', + 'ACL_U_READPM' => 'Can read private messages', + 'ACL_U_PM_EDIT' => 'Can edit own private messages', + 'ACL_U_PM_DELETE' => 'Can remove private messages from own folder', + 'ACL_U_PM_FORWARD' => 'Can forward private messages', + 'ACL_U_PM_EMAILPM' => 'Can email private messages', + 'ACL_U_PM_PRINTPM' => 'Can print private messages', + 'ACL_U_PM_ATTACH' => 'Can attach files in private messages', + 'ACL_U_PM_DOWNLOAD' => 'Can download files in private messages', + 'ACL_U_PM_BBCODE' => 'Can use BBCode in private messages', + 'ACL_U_PM_SMILIES' => 'Can use smilies in private messages', + 'ACL_U_PM_IMG' => 'Can use [img] BBCode tag in private messages', + 'ACL_U_PM_FLASH' => 'Can use [flash] BBCode tag in private messages', + + 'ACL_U_SENDEMAIL' => 'Can send emails', + 'ACL_U_SENDIM' => 'Can send instant messages', + 'ACL_U_IGNOREFLOOD' => 'Can ignore flood limit', + 'ACL_U_HIDEONLINE' => 'Can hide online status', + 'ACL_U_VIEWONLINE' => 'Can view hidden online users', + 'ACL_U_SEARCH' => 'Can search board', +)); + +// Forum Permissions +$lang = array_merge($lang, array( + 'ACL_F_LIST' => 'Can see forum', + 'ACL_F_READ' => 'Can read forum', + 'ACL_F_SEARCH' => 'Can search the forum', + 'ACL_F_SUBSCRIBE' => 'Can subscribe forum', + 'ACL_F_PRINT' => 'Can print topics', + 'ACL_F_EMAIL' => 'Can email topics', + 'ACL_F_BUMP' => 'Can bump topics', + 'ACL_F_USER_LOCK' => 'Can lock own topics', + 'ACL_F_DOWNLOAD' => 'Can download files', + 'ACL_F_REPORT' => 'Can report posts', + + 'ACL_F_POST' => 'Can start new topics', + 'ACL_F_STICKY' => 'Can post stickies', + 'ACL_F_ANNOUNCE' => 'Can post announcements', + 'ACL_F_REPLY' => 'Can reply to topics', + 'ACL_F_EDIT' => 'Can edit own posts', + 'ACL_F_DELETE' => 'Can permanently delete own posts', + 'ACL_F_SOFTDELETE' => 'Can soft delete own posts
Moderators, who have the approve posts permission, can restore soft deleted posts.', + 'ACL_F_IGNOREFLOOD' => 'Can ignore flood limit', + 'ACL_F_POSTCOUNT' => 'Increment post counter
Please note that this setting only affects new posts.', + 'ACL_F_NOAPPROVE' => 'Can post without approval', + + 'ACL_F_ATTACH' => 'Can attach files', + 'ACL_F_ICONS' => 'Can use topic/post icons', + 'ACL_F_BBCODE' => 'Can use BBCode', + 'ACL_F_FLASH' => 'Can use [flash] BBCode tag', + 'ACL_F_IMG' => 'Can use [img] BBCode tag', + 'ACL_F_SIGS' => 'Can use signatures', + 'ACL_F_SMILIES' => 'Can use smilies', + + 'ACL_F_POLL' => 'Can create polls', + 'ACL_F_VOTE' => 'Can vote in polls', + 'ACL_F_VOTECHG' => 'Can change existing vote', +)); + +// Moderator Permissions +$lang = array_merge($lang, array( + 'ACL_M_EDIT' => 'Can edit posts', + 'ACL_M_DELETE' => 'Can permanently delete posts', + 'ACL_M_SOFTDELETE' => 'Can soft delete posts
Moderators, who have the approve posts permission, can restore soft deleted posts.', + 'ACL_M_APPROVE' => 'Can approve and restore posts', + 'ACL_M_REPORT' => 'Can close and delete reports', + 'ACL_M_CHGPOSTER' => 'Can change post author', + + 'ACL_M_MOVE' => 'Can move topics', + 'ACL_M_LOCK' => 'Can lock topics', + 'ACL_M_SPLIT' => 'Can split topics', + 'ACL_M_MERGE' => 'Can merge topics', + + 'ACL_M_INFO' => 'Can view post details', + 'ACL_M_WARN' => 'Can issue warnings
This setting is only assigned globally. It is not forum based.', // This moderator setting is only global (and not local) + 'ACL_M_BAN' => 'Can manage bans
This setting is only assigned globally. It is not forum based.', // This moderator setting is only global (and not local) +)); + +// Admin Permissions +$lang = array_merge($lang, array( + 'ACL_A_BOARD' => 'Can alter board settings/check for updates', + 'ACL_A_SERVER' => 'Can alter server/communication settings', + 'ACL_A_JABBER' => 'Can alter Jabber settings', + 'ACL_A_PHPINFO' => 'Can view php settings', + + 'ACL_A_FORUM' => 'Can manage forums', + 'ACL_A_FORUMADD' => 'Can add new forums', + 'ACL_A_FORUMDEL' => 'Can delete forums', + 'ACL_A_PRUNE' => 'Can prune forums', + + 'ACL_A_ICONS' => 'Can alter topic/post icons and smilies', + 'ACL_A_WORDS' => 'Can alter word censors', + 'ACL_A_BBCODE' => 'Can define BBCode tags', + 'ACL_A_ATTACH' => 'Can alter attachment related settings', + + 'ACL_A_USER' => 'Can manage users
This also includes seeing the users browser agent within the viewonline list.', + 'ACL_A_USERDEL' => 'Can delete/prune users', + 'ACL_A_GROUP' => 'Can manage groups', + 'ACL_A_GROUPADD' => 'Can add new groups', + 'ACL_A_GROUPDEL' => 'Can delete groups', + 'ACL_A_RANKS' => 'Can manage ranks', + 'ACL_A_PROFILE' => 'Can manage custom profile fields', + 'ACL_A_NAMES' => 'Can manage disallowed names', + 'ACL_A_BAN' => 'Can manage bans', + + 'ACL_A_VIEWAUTH' => 'Can view permission masks', + 'ACL_A_AUTHGROUPS' => 'Can alter permissions for individual groups', + 'ACL_A_AUTHUSERS' => 'Can alter permissions for individual users', + 'ACL_A_FAUTH' => 'Can alter forum permission class', + 'ACL_A_MAUTH' => 'Can alter moderator permission class', + 'ACL_A_AAUTH' => 'Can alter admin permission class', + 'ACL_A_UAUTH' => 'Can alter user permission class', + 'ACL_A_ROLES' => 'Can manage roles', + 'ACL_A_SWITCHPERM' => 'Can use others permissions', + + 'ACL_A_STYLES' => 'Can manage styles', + 'ACL_A_EXTENSIONS' => 'Can manage extensions', + 'ACL_A_VIEWLOGS' => 'Can view logs', + 'ACL_A_CLEARLOGS' => 'Can clear logs', + 'ACL_A_MODULES' => 'Can manage modules', + 'ACL_A_LANGUAGE' => 'Can manage language packs', + 'ACL_A_EMAIL' => 'Can send mass email', + 'ACL_A_BOTS' => 'Can manage bots', + 'ACL_A_REASONS' => 'Can manage report/denial reasons', + 'ACL_A_BACKUP' => 'Can backup/restore database', + 'ACL_A_SEARCH' => 'Can manage search backends and settings', +)); diff --git a/sources/phpBB/language/en/acp/posting.php b/sources/phpBB/language/en/acp/posting.php new file mode 100644 index 0000000..119ad2d --- /dev/null +++ b/sources/phpBB/language/en/acp/posting.php @@ -0,0 +1,291 @@ + +* @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 + +// BBCodes +// Note to translators: you can translate everything but what's between { and } +$lang = array_merge($lang, array( + 'ACP_BBCODES_EXPLAIN' => 'BBCode is a special implementation of HTML offering greater control over what and how something is displayed. From this page you can add, remove and edit custom BBCodes.', + 'ADD_BBCODE' => 'Add a new BBCode', + + 'BBCODE_DANGER' => 'The BBCode you are trying to add seems to use a {TEXT} token inside a HTML attribute. This is a possible XSS security issue. Try using the more restrictive {SIMPLETEXT} or {INTTEXT} types instead. Only proceed if you understand the risks involved and you consider the use of {TEXT} absolutely unavoidable.', + 'BBCODE_DANGER_PROCEED' => 'Proceed', //'I understand the risk', + + 'BBCODE_ADDED' => 'BBCode added successfully.', + 'BBCODE_EDITED' => 'BBCode edited successfully.', + 'BBCODE_DELETED' => 'The BBCode has been removed successfully.', + 'BBCODE_NOT_EXIST' => 'The BBCode you selected does not exist.', + 'BBCODE_HELPLINE' => 'Help line', + 'BBCODE_HELPLINE_EXPLAIN' => 'This field contains the mouse over text of the BBCode.', + 'BBCODE_HELPLINE_TEXT' => 'Help line text', + 'BBCODE_HELPLINE_TOO_LONG' => 'The help line you entered is too long.', + + 'BBCODE_INVALID_TAG_NAME' => 'The BBCode tag name that you selected already exists.', + 'BBCODE_INVALID' => 'Your BBCode is constructed in an invalid form.', + 'BBCODE_OPEN_ENDED_TAG' => 'Your custom BBCode must contain both an opening and a closing tag.', + 'BBCODE_TAG' => 'Tag', + 'BBCODE_TAG_TOO_LONG' => 'The tag name you selected is too long.', + 'BBCODE_TAG_DEF_TOO_LONG' => 'The tag definition that you have entered is too long, please shorten your tag definition.', + 'BBCODE_USAGE' => 'BBCode usage', + 'BBCODE_USAGE_EXAMPLE' => '[highlight={COLOR}]{TEXT}[/highlight]

[font={SIMPLETEXT1}]{SIMPLETEXT2}[/font]', + 'BBCODE_USAGE_EXPLAIN' => 'Here you define how to use the BBCode. Replace any variable input by the corresponding token (%ssee below%s).', + + 'EXAMPLE' => 'Example:', + 'EXAMPLES' => 'Examples:', + + 'HTML_REPLACEMENT' => 'HTML replacement', + 'HTML_REPLACEMENT_EXAMPLE' => '<span style="background-color: {COLOR};">{TEXT}</span>

<span style="font-family: {SIMPLETEXT1};">{SIMPLETEXT2}</span>', + 'HTML_REPLACEMENT_EXPLAIN' => 'Here you define the default HTML replacement. Do not forget to put back tokens you used above!', + + 'TOKEN' => 'Token', + 'TOKENS' => 'Tokens', + 'TOKENS_EXPLAIN' => 'Tokens are placeholders for user input. The input will be validated only if it matches the corresponding definition. If needed, you can number them by adding a number as the last character between the braces, e.g. {TEXT1}, {TEXT2}.

Within the HTML replacement you can also use any language string present in your language/ directory like this: {L_<STRINGNAME>} where <STRINGNAME> is the name of the translated string you want to add. For example, {L_WROTE} will be displayed as “wrote†or its translation according to user’s locale.

Please note that only tokens listed below are able to be used within custom BBCodes.', + 'TOKEN_DEFINITION' => 'What can it be?', + 'TOO_MANY_BBCODES' => 'You cannot create any more BBCodes. Please remove one or more BBCodes then try again.', + + 'tokens' => array( + 'TEXT' => 'Any text, including foreign characters, numbers, etc… You should not use this token in HTML tags. Instead try to use IDENTIFIER, INTTEXT or SIMPLETEXT.', + 'SIMPLETEXT' => 'Characters from the latin alphabet (A-Z), numbers, spaces, commas, dots, minus, plus, hyphen and underscore', + 'INTTEXT' => 'Unicode letter characters, numbers, spaces, commas, dots, minus, plus, hyphen, underscore and whitespaces.', + 'IDENTIFIER' => 'Characters from the latin alphabet (A-Z), numbers, hyphen and underscore', + 'NUMBER' => 'Any series of digits', + 'EMAIL' => 'A valid email address', + 'URL' => 'A valid URL using any protocol (http, ftp, etc… cannot be used for javascript exploits). If none is given, “http://†is prefixed to the string.', + 'LOCAL_URL' => 'A local URL. The URL must be relative to the topic page and cannot contain a server name or protocol, as links are prefixed with “%sâ€', + 'RELATIVE_URL' => 'A relative URL. You can use this to match parts of a URL, but be careful: a full URL is a valid relative URL. When you want to use relative URLs of your board, use the LOCAL_URL token.', + 'COLOR' => 'A HTML colour, can be either in the numeric form #FF1234 or a CSS colour keyword such as fuchsia or InactiveBorder', + ), +)); + +// Smilies and topic icons +$lang = array_merge($lang, array( + 'ACP_ICONS_EXPLAIN' => 'From this page you can add, remove and edit the icons users may add to their topics or posts. These icons are generally displayed next to topic titles on the forum listing, or the post subjects in topic listings. You can also install and create new packages of icons.', + 'ACP_SMILIES_EXPLAIN' => 'Smilies or emoticons are typically small, sometimes animated images used to convey an emotion or feeling. From this page you can add, remove and edit the emoticons users can use in their posts and private messages. You can also install and create new packages of smilies.', + 'ADD_SMILIES' => 'Add multiple smilies', + 'ADD_SMILEY_CODE' => 'Add additional smiley code', + 'ADD_ICONS' => 'Add multiple icons', + 'AFTER_ICONS' => 'After %s', + 'AFTER_SMILIES' => 'After %s', + + 'CODE' => 'Code', + 'CURRENT_ICONS' => 'Current icons', + 'CURRENT_ICONS_EXPLAIN' => 'Choose what to do with the currently installed icons.', + 'CURRENT_SMILIES' => 'Current smilies', + 'CURRENT_SMILIES_EXPLAIN' => 'Choose what to do with the currently installed smilies.', + + 'DISPLAY_ON_POSTING' => 'Display on posting page', + 'DISPLAY_POSTING' => 'On posting page', + 'DISPLAY_POSTING_NO' => 'Not on posting page', + + 'EDIT_ICONS' => 'Edit icons', + 'EDIT_SMILIES' => 'Edit smilies', + 'EMOTION' => 'Emotion', + 'EXPORT_ICONS' => 'Export and download icons.pak', + 'EXPORT_ICONS_EXPLAIN' => '%sOn clicking this link, the configuration for your installed icons will be packaged into icons.pak which once downloaded can be used to create a .zip or .tgz file containing all of your icons plus this icons.pak configuration file%s.', + 'EXPORT_SMILIES' => 'Export and download smilies.pak', + 'EXPORT_SMILIES_EXPLAIN' => '%sOn clicking this link, the configuration for your installed smilies will be packaged into smilies.pak which once downloaded can be used to create a .zip or .tgz file containing all of your smilies plus this smilies.pak configuration file%s.', + + 'FIRST' => 'First', + + 'ICONS_ADD' => 'Add a new icon', + 'ICONS_ADDED' => array( + 0 => 'No icons were added.', + 1 => 'The icon has been added successfully.', + 2 => 'The icons have been added successfully.', + ), + 'ICONS_CONFIG' => 'Icon configuration', + 'ICONS_DELETED' => 'The icon has been removed successfully.', + 'ICONS_EDIT' => 'Edit icon', + 'ICONS_EDITED' => array( + 0 => 'No icons were updated.', + 1 => 'The icon has been updated successfully.', + 2 => 'The icons have been updated successfully.', + ), + 'ICONS_HEIGHT' => 'Icon height', + 'ICONS_IMAGE' => 'Icon image', + 'ICONS_IMPORTED' => 'The icons pack has been installed successfully.', + 'ICONS_IMPORT_SUCCESS' => 'The icons pack was imported successfully.', + 'ICONS_LOCATION' => 'Icon location', + 'ICONS_NOT_DISPLAYED' => 'The following icons are not displayed on the posting page', + 'ICONS_ORDER' => 'Icon order', + 'ICONS_URL' => 'Icon image file', + 'ICONS_WIDTH' => 'Icon width', + 'IMPORT_ICONS' => 'Install icons package', + 'IMPORT_SMILIES' => 'Install smilies package', + + 'KEEP_ALL' => 'Keep all', + + 'MASS_ADD_SMILIES' => 'Add multiple smilies', + + 'NO_ICONS_ADD' => 'There are no icons available for adding.', + 'NO_ICONS_EDIT' => 'There are no icons available for modifying.', + 'NO_ICONS_EXPORT' => 'You have no icons with which to create a package.', + 'NO_ICONS_PAK' => 'No icon packages found.', + 'NO_SMILIES_ADD' => 'There are no smilies available for adding.', + 'NO_SMILIES_EDIT' => 'There are no smilies available for modifying.', + 'NO_SMILIES_EXPORT' => 'You have no smilies with which to create a package.', + 'NO_SMILIES_PAK' => 'No smiley packages found.', + + 'PAK_FILE_NOT_READABLE' => 'Could not read .pak file.', + + 'REPLACE_MATCHES' => 'Replace matches', + + 'SELECT_PACKAGE' => 'Select a package file', + 'SMILIES_ADD' => 'Add a new smiley', + 'SMILIES_ADDED' => array( + 0 => 'No smilies were added.', + 1 => 'The smiley has been added successfully.', + 2 => 'The smilies have been added successfully.', + ), + 'SMILIES_CODE' => 'Smiley code', + 'SMILIES_CONFIG' => 'Smiley configuration', + 'SMILIES_DELETED' => 'The smiley has been removed successfully.', + 'SMILIES_EDIT' => 'Edit smiley', + 'SMILIE_NO_CODE' => 'The smiley “%s†was ignored, as there was no code entered.', + 'SMILIE_NO_EMOTION' => 'The smiley “%s†was ignored, as there was no emotion entered.', + 'SMILIE_NO_FILE' => 'The smiley “%s†was ignored, as the file is missing.', + 'SMILIES_EDITED' => array( + 0 => 'No smilies were updated.', + 1 => 'The smiley has been updated successfully.', + 2 => 'The smilies have been updated successfully.', + ), + 'SMILIES_EMOTION' => 'Emotion', + 'SMILIES_HEIGHT' => 'Smiley height', + 'SMILIES_IMAGE' => 'Smiley image', + 'SMILIES_IMPORTED' => 'The smilies pack has been installed successfully.', + 'SMILIES_IMPORT_SUCCESS' => 'The smilies pack was imported successfully.', + 'SMILIES_LOCATION' => 'Smiley location', + 'SMILIES_NOT_DISPLAYED' => 'The following smilies are not displayed on the posting page', + 'SMILIES_ORDER' => 'Smiley order', + 'SMILIES_URL' => 'Smiley image file', + 'SMILIES_WIDTH' => 'Smiley width', + + 'TOO_MANY_SMILIES' => array( + 1 => 'Limit of %d smiley reached.', + 2 => 'Limit of %d smilies reached.', + ), + + 'WRONG_PAK_TYPE' => 'The specified package does not contain the appropriate data.', +)); + +// Word censors +$lang = array_merge($lang, array( + 'ACP_WORDS_EXPLAIN' => 'From this control panel you can add, edit, and remove words that will be automatically censored on your forums. People are still allowed to register with usernames containing these words. Wildcards (*) are accepted in the word field, e.g. *test* will match detestable, test* would match testing, *test would match detest.', + 'ADD_WORD' => 'Add new word', + + 'EDIT_WORD' => 'Edit word censor', + 'ENTER_WORD' => 'You must enter a word and its replacement.', + + 'NO_WORD' => 'No word selected for editing.', + + 'REPLACEMENT' => 'Replacement', + + 'UPDATE_WORD' => 'Update word censor', + + 'WORD' => 'Word', + 'WORD_ADDED' => 'The word censor has been successfully added.', + 'WORD_REMOVED' => 'The selected word censor has been successfully removed.', + 'WORD_UPDATED' => 'The selected word censor has been successfully updated.', +)); + +// Ranks +$lang = array_merge($lang, array( + 'ACP_RANKS_EXPLAIN' => 'Using this form you can add, edit, view and delete ranks. You can also create special ranks which can be applied to a user via the user management facility.', + 'ADD_RANK' => 'Add new rank', + + 'MUST_SELECT_RANK' => 'You must select a rank.', + + 'NO_ASSIGNED_RANK' => 'No special rank assigned.', + 'NO_RANK_TITLE' => 'You haven’t specified a title for the rank.', + 'NO_UPDATE_RANKS' => 'The rank was successfully deleted. However user accounts using this rank were not updated. You will need to manually reset the rank on these accounts.', + + 'RANK_ADDED' => 'The rank was successfully added.', + 'RANK_IMAGE' => 'Rank image', + 'RANK_IMAGE_EXPLAIN' => 'Use this to define a small image associated with the rank. The path is relative to the root phpBB directory.', + 'RANK_IMAGE_IN_USE' => '(In use)', + 'RANK_MINIMUM' => 'Minimum posts', + 'RANK_REMOVED' => 'The rank was successfully deleted.', + 'RANK_SPECIAL' => 'Set as special rank', + 'RANK_TITLE' => 'Rank title', + 'RANK_UPDATED' => 'The rank was successfully updated.', +)); + +// Disallow Usernames +$lang = array_merge($lang, array( + 'ACP_DISALLOW_EXPLAIN' => 'Here you can control usernames which will not be allowed to be used. Disallowed usernames are allowed to contain a wildcard character of *.', + 'ADD_DISALLOW_EXPLAIN' => 'You can disallow a username using the wildcard character * to match any character.', + 'ADD_DISALLOW_TITLE' => 'Add a disallowed username', + + 'DELETE_DISALLOW_EXPLAIN' => 'You can remove a disallowed username by selecting the username from this list and clicking submit.', + 'DELETE_DISALLOW_TITLE' => 'Remove a disallowed username', + 'DISALLOWED_ALREADY' => 'The name you entered is already disallowed.', + 'DISALLOWED_DELETED' => 'The disallowed username has been successfully removed.', + 'DISALLOW_SUCCESSFUL' => 'The disallowed username has been successfully added.', + + 'NO_DISALLOWED' => 'No disallowed usernames', + 'NO_USERNAME_SPECIFIED' => 'You haven’t selected or entered a username to operate with.', +)); + +// Reasons +$lang = array_merge($lang, array( + 'ACP_REASONS_EXPLAIN' => 'Here you can manage the reasons used in reports and denial messages when disapproving posts. There is one default reason (marked with a *) you are not able to remove, this reason is normally used for custom messages if no reason fits.', + 'ADD_NEW_REASON' => 'Add new reason', + 'AVAILABLE_TITLES' => 'Available localised reason titles', + + 'IS_NOT_TRANSLATED' => 'Reason has not been localised.', + 'IS_NOT_TRANSLATED_EXPLAIN' => 'Reason has not been localised. If you want to provide the localised form, specify the correct key from the language files report reasons section.', + 'IS_TRANSLATED' => 'Reason has been localised.', + 'IS_TRANSLATED_EXPLAIN' => 'Reason has been localised. If the title you enter here is specified within the language files report reasons section, the localised form of the title and description will be used.', + + 'NO_REASON' => 'Reason could not be found.', + 'NO_REASON_INFO' => 'You have to specify a title and a description for this reason.', + 'NO_REMOVE_DEFAULT_REASON' => 'You are not able to remove the default reason “Otherâ€.', + + 'REASON_ADD' => 'Add report/denial reason', + 'REASON_ADDED' => 'Report/denial reason successfully added.', + 'REASON_ALREADY_EXIST' => 'A reason with this title already exist, please enter another title for this reason.', + 'REASON_DESCRIPTION' => 'Reason description', + 'REASON_DESC_TRANSLATED' => 'Displayed reason description', + 'REASON_EDIT' => 'Edit report/denial reason', + 'REASON_EDIT_EXPLAIN' => 'Here you are able to add or edit a reason. If the reason is translated the localised version is used instead of the description entered here.', + 'REASON_REMOVED' => 'Report/denial reason successfully removed.', + 'REASON_TITLE' => 'Reason title', + 'REASON_TITLE_TRANSLATED' => 'Displayed reason title', + 'REASON_UPDATED' => 'Report/denial reason successfully updated.', + + 'USED_IN_REPORTS' => 'Used in reports', +)); diff --git a/sources/phpBB/language/en/acp/profile.php b/sources/phpBB/language/en/acp/profile.php new file mode 100644 index 0000000..d365aeb --- /dev/null +++ b/sources/phpBB/language/en/acp/profile.php @@ -0,0 +1,176 @@ + +* @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 + +// Custom profile fields +$lang = array_merge($lang, array( + 'ADDED_PROFILE_FIELD' => 'Successfully added custom profile field.', + 'ALPHA_DOTS' => 'Alphanumeric and dots (periods)', + 'ALPHA_ONLY' => 'Alphanumeric only', + 'ALPHA_SPACERS' => 'Alphanumeric and spacers', + 'ALPHA_UNDERSCORE' => 'Alphanumeric and underscores', + 'ALPHA_PUNCTUATION' => 'Alphanumeric with comma, dots, underscore and dashes beginning with a letter', + 'ALWAYS_TODAY' => 'Always the current date', + + 'BOOL_ENTRIES_EXPLAIN' => 'Enter your options now', + 'BOOL_TYPE_EXPLAIN' => 'Define the type, either a checkbox or radio buttons. A checkbox will only be displayed if it is checked for a given user. In that case the second language option will be used. Radio buttons will display regardless of their value.', + + 'CHANGED_PROFILE_FIELD' => 'Successfully changed profile field.', + 'CHARS_ANY' => 'Any character', + 'CHECKBOX' => 'Checkbox', + 'COLUMNS' => 'Columns', + 'CP_LANG_DEFAULT_VALUE' => 'Default value', + 'CP_LANG_EXPLAIN' => 'Field description', + 'CP_LANG_EXPLAIN_EXPLAIN' => 'The explanation for this field presented to the user.', + 'CP_LANG_NAME' => 'Field name/title presented to the user', + 'CP_LANG_OPTIONS' => 'Options', + 'CREATE_NEW_FIELD' => 'Create new field', + 'CUSTOM_FIELDS_NOT_TRANSLATED' => 'At least one custom profile field has not yet been translated. Please enter the required information by clicking on the “Translate†link.', + + 'DEFAULT_ISO_LANGUAGE' => 'Default language [%s]', + 'DEFAULT_LANGUAGE_NOT_FILLED' => 'The language entries for the default language are not filled for this profile field.', + 'DEFAULT_VALUE' => 'Default value', + 'DELETE_PROFILE_FIELD' => 'Remove profile field', + 'DELETE_PROFILE_FIELD_CONFIRM' => 'Are you sure you want to delete this profile field?', + 'DISPLAY_AT_PROFILE' => 'Display in user control panel', + 'DISPLAY_AT_PROFILE_EXPLAIN' => 'The user is able to change this profile field within the user control panel.', + 'DISPLAY_AT_REGISTER' => 'Display on registration screen', + 'DISPLAY_AT_REGISTER_EXPLAIN' => 'If this option is enabled, the field will be displayed on registration.', + 'DISPLAY_ON_MEMBERLIST' => 'Display on memberlist screen', + 'DISPLAY_ON_MEMBERLIST_EXPLAIN' => 'If this option is enabled, the field will be displayed in the user rows on the memberlist screen.', + 'DISPLAY_ON_PM' => 'Display on view private message screen', + 'DISPLAY_ON_PM_EXPLAIN' => 'If this option is enabled, the field will be displayed in the mini-profile on the private message screen.', + 'DISPLAY_ON_VT' => 'Display on viewtopic screen', + 'DISPLAY_ON_VT_EXPLAIN' => 'If this option is enabled, the field will be displayed in the mini-profile on the topic screen.', + 'DISPLAY_PROFILE_FIELD' => 'Publicly display profile field', + 'DISPLAY_PROFILE_FIELD_EXPLAIN' => 'The profile field will be shown in all locations allowed within the load settings. Setting this to “no†will hide the field from topic pages, profiles and the memberlist.', + 'DROPDOWN_ENTRIES_EXPLAIN' => 'Enter your options now, every option in one line.', + + 'EDIT_DROPDOWN_LANG_EXPLAIN' => 'Please note that you are able to change your options text and also able to add new options to the end. It is not advised to add new options between existing options - this could result in wrong options assigned to your users. This can also happen if you remove options in-between. Removing options from the end result in users having assigned this item now reverting back to the default one.', + 'EMPTY_FIELD_IDENT' => 'Empty field identification', + 'EMPTY_USER_FIELD_NAME' => 'Please enter a field name/title', + 'ENTRIES' => 'Entries', + 'EVERYTHING_OK' => 'Everything OK', + + 'FIELD_BOOL' => 'Boolean (Yes/No)', + 'FIELD_CONTACT_DESC' => 'Contact description', + 'FIELD_CONTACT_URL' => 'Contact link', + 'FIELD_DATE' => 'Date', + 'FIELD_DESCRIPTION' => 'Field description', + 'FIELD_DESCRIPTION_EXPLAIN' => 'The explanation for this field presented to the user.', + 'FIELD_DROPDOWN' => 'Dropdown box', + 'FIELD_GOOGLEPLUS' => 'Google+', + 'FIELD_IDENT' => 'Field identification', + 'FIELD_IDENT_ALREADY_EXIST' => 'The chosen field identification already exist. Please choose another name.', + 'FIELD_IDENT_EXPLAIN' => 'The field identification is a name to identify the profile field within the database and the templates.', + 'FIELD_INT' => 'Numbers', + 'FIELD_IS_CONTACT' => 'Display field as a contact field', + 'FIELD_IS_CONTACT_EXPLAIN' => 'Contact fields are displayed within the contact section of the user profile and are displayed differently in the mini profile next to posts and private messages. You can use %s as a placeholder variable which will be replaced by a value provided by the user.', + 'FIELD_LENGTH' => 'Length of input box', + 'FIELD_NOT_FOUND' => 'Profile field not found.', + 'FIELD_STRING' => 'Single text field', + 'FIELD_TEXT' => 'Textarea', + 'FIELD_TYPE' => 'Field type', + 'FIELD_TYPE_EXPLAIN' => 'You are not able to change the field type later.', + 'FIELD_URL' => 'URL (Link)', + 'FIELD_VALIDATION' => 'Field validation', + 'FIRST_OPTION' => 'First option', + + 'HIDE_PROFILE_FIELD' => 'Hide profile field', + 'HIDE_PROFILE_FIELD_EXPLAIN' => 'Hide the profile field from all other users except the user, administrators and moderators who are still able to see this field. If the Display in user control panel option is disabled, the user will not be able to see or change this field and the field can only be changed by administrators.', + + 'INVALID_CHARS_FIELD_IDENT' => 'Field identification can only contain lowercase a-z and _', + 'INVALID_FIELD_IDENT_LEN' => 'Field identification can only be 17 characters long', + 'ISO_LANGUAGE' => 'Language [%s]', + + 'LANG_SPECIFIC_OPTIONS' => 'Language specific options [%s]', + + 'LETTER_NUM_DOTS' => 'Any letters, numbers and dots (periods)', + 'LETTER_NUM_ONLY' => 'Any letters and numbers', + 'LETTER_NUM_PUNCTUATION' => 'Any letters, numbers, comma, dots, underscores and dashes beginning with any letter', + 'LETTER_NUM_SPACERS' => 'Any letters, numbers and spacers', + 'LETTER_NUM_UNDERSCORE' => 'Any letters, numbers and underscores', + + 'MAX_FIELD_CHARS' => 'Maximum number of characters', + 'MAX_FIELD_NUMBER' => 'Highest allowed number', + 'MIN_FIELD_CHARS' => 'Minimum number of characters', + 'MIN_FIELD_NUMBER' => 'Lowest allowed number', + + 'NO_FIELD_ENTRIES' => 'No entries defined', + 'NO_FIELD_ID' => 'No field id specified.', + 'NO_FIELD_TYPE' => 'No Field type specified.', + 'NO_VALUE_OPTION' => 'Option equal to non entered value', + 'NO_VALUE_OPTION_EXPLAIN' => 'Value for a non-entry. If the field is required, the user gets an error if he choose the option selected here.', + 'NUMBERS_ONLY' => 'Only numbers (0-9)', + + 'PROFILE_BASIC_OPTIONS' => 'Basic options', + 'PROFILE_FIELD_ACTIVATED' => 'Profile field successfully activated.', + 'PROFILE_FIELD_DEACTIVATED' => 'Profile field successfully deactivated.', + 'PROFILE_LANG_OPTIONS' => 'Language specific options', + 'PROFILE_TYPE_OPTIONS' => 'Profile type specific options', + + 'RADIO_BUTTONS' => 'Radio buttons', + 'REMOVED_PROFILE_FIELD' => 'Successfully removed profile field.', + 'REQUIRED_FIELD' => 'Required field', + 'REQUIRED_FIELD_EXPLAIN' => 'Force profile field to be filled out or specified by user or administrator. If display at registration screen option is disabled, the field will only be required when the user edits their profile.', + 'ROWS' => 'Rows', + + 'SAVE' => 'Save', + 'SECOND_OPTION' => 'Second option', + 'SHOW_NOVALUE_FIELD' => 'Show field if no value was selected', + 'SHOW_NOVALUE_FIELD_EXPLAIN' => 'Determines if the profile field should be displayed if no value was selected for optional fields or if no value has been selected yet for required fields.', + 'STEP_1_EXPLAIN_CREATE' => 'Here you can enter the first basic parameters of your new profile field. This information is needed for the second step where you’ll be able to set remaining options and tweak your profile field further.', + 'STEP_1_EXPLAIN_EDIT' => 'Here you can change the basic parameters of your profile field. The relevant options are re-calculated within the second step.', + 'STEP_1_TITLE_CREATE' => 'Add profile field', + 'STEP_1_TITLE_EDIT' => 'Edit profile field', + 'STEP_2_EXPLAIN_CREATE' => 'Here you are able to define some common options you may want to adjust.', + 'STEP_2_EXPLAIN_EDIT' => 'Here you are able to change some common options.
Please note that changes to profile fields will not affect existing profile fields entered by your users.', + 'STEP_2_TITLE_CREATE' => 'Profile type specific options', + 'STEP_2_TITLE_EDIT' => 'Profile type specific options', + 'STEP_3_EXPLAIN_CREATE' => 'Since you have more than one board language installed, you have to fill out the remaining language items too. The profile field will work with the default language enabled, you are able to fill out the remaining language items later too.', + 'STEP_3_EXPLAIN_EDIT' => 'Since you have more than one board language installed, you now can change or add the remaining language items too. The profile field will work with the default language enabled.', + 'STEP_3_TITLE_CREATE' => 'Remaining language definitions', + 'STEP_3_TITLE_EDIT' => 'Language definitions', + 'STRING_DEFAULT_VALUE_EXPLAIN' => 'Enter a default phrase to be displayed, a default value. Leave empty if you want to show it empty at the first place.', + + 'TEXT_DEFAULT_VALUE_EXPLAIN' => 'Enter a default text to be displayed, a default value. Leave empty if you want to show it empty at the first place.', + 'TRANSLATE' => 'Translate', + + 'USER_FIELD_NAME' => 'Field name/title presented to the user', + + 'VISIBILITY_OPTION' => 'Visibility options', +)); diff --git a/sources/phpBB/language/en/acp/prune.php b/sources/phpBB/language/en/acp/prune.php new file mode 100644 index 0000000..130d1db --- /dev/null +++ b/sources/phpBB/language/en/acp/prune.php @@ -0,0 +1,95 @@ + +* @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 + +// User pruning +$lang = array_merge($lang, array( + 'ACP_PRUNE_USERS_EXPLAIN' => 'This section allows you to delete or deactivate users on your board. Accounts can be filtered in a variety of ways; by post count, most recent activity, etc. Criteria may be combined to narrow down which accounts are affected. For example, you can prune users with fewer than 10 posts, who were also inactive after 2002-01-01. Use * as a wildcard for text fields. Alternatively, you may skip the criteria selection completely by entering a list of users (each on a separate line) into the text field. Take care with this facility! Once a user is deleted, there is no way to reverse the action.', + + 'CRITERIA' => 'Criteria', + + 'DEACTIVATE_DELETE' => 'Deactivate or delete', + 'DEACTIVATE_DELETE_EXPLAIN' => 'Choose whether to deactivate users or delete them entirely. Please note that deleted users cannot be restored!', + 'DELETE_USERS' => 'Delete', + 'DELETE_USER_POSTS' => 'Delete pruned user posts', + 'DELETE_USER_POSTS_EXPLAIN' => 'Removes posts made by deleted users, has no effect if users are deactivated.', + + 'JOINED_EXPLAIN' => 'Enter a date in YYYY-MM-DD format. You may use both fields to specify an interval, or leave one blank for an open date range.', + + 'LAST_ACTIVE_EXPLAIN' => 'Enter a date in YYYY-MM-DD format. Enter 0000-00-00 to prune users who never logged in, Before and After conditions will be ignored.', + + 'POSTS_ON_QUEUE' => 'Posts Awaiting Approval', + 'PRUNE_USERS_GROUP_EXPLAIN' => 'Limit to users within the selected group.', + 'PRUNE_USERS_GROUP_NONE' => 'All groups', + 'PRUNE_USERS_LIST' => 'Users to be pruned', + 'PRUNE_USERS_LIST_DELETE' => 'With the selected critera for pruning users the following accounts will be removed. You can remove individual users from the deletion list by unchecking the box next to their username.', + 'PRUNE_USERS_LIST_DEACTIVATE' => 'With the selected critera for pruning users the following accounts will be deactivated. You can remove individual users from the deactivation list by unchecking the box next to their username.', + + 'SELECT_USERS_EXPLAIN' => 'Enter specific usernames here. They will be used in preference to the criteria above. Founders cannot be pruned.', + + 'USER_DEACTIVATE_SUCCESS' => 'The selected users have been deactivated successfully.', + 'USER_DELETE_SUCCESS' => 'The selected users have been deleted successfully.', + 'USER_PRUNE_FAILURE' => 'No users fit the selected criteria.', + + 'WRONG_ACTIVE_JOINED_DATE' => 'The date entered is wrong, it is expected in YYYY-MM-DD format.', +)); + +// Forum Pruning +$lang = array_merge($lang, array( + 'ACP_PRUNE_FORUMS_EXPLAIN' => 'This will delete any topic which has not been posted to or viewed within the number of days you select. If you do not enter a number then all topics will be deleted. By default, it will not remove topics in which polls are still running nor will it remove stickies and announcements.', + + 'FORUM_PRUNE' => 'Forum prune', + + 'NO_PRUNE' => 'No forums pruned.', + + 'SELECTED_FORUM' => 'Selected forum', + 'SELECTED_FORUMS' => 'Selected forums', + + 'POSTS_PRUNED' => 'Posts pruned', + 'PRUNE_ANNOUNCEMENTS' => 'Prune announcements', + 'PRUNE_FINISHED_POLLS' => 'Prune closed polls', + 'PRUNE_FINISHED_POLLS_EXPLAIN' => 'Removes topics with polls which have ended.', + 'PRUNE_FORUM_CONFIRM' => 'Are you sure you want to prune the selected forums with the settings specified? Once removed, there is no way to recover the pruned posts and topics.', + 'PRUNE_NOT_POSTED' => 'Days since last posted', + 'PRUNE_NOT_VIEWED' => 'Days since last viewed', + 'PRUNE_OLD_POLLS' => 'Prune old polls', + 'PRUNE_OLD_POLLS_EXPLAIN' => 'Removes topics with polls not voted in for post age days.', + 'PRUNE_STICKY' => 'Prune stickies', + 'PRUNE_SUCCESS' => 'Pruning of forums was successful.', + + 'TOPICS_PRUNED' => 'Topics pruned', +)); diff --git a/sources/phpBB/language/en/acp/search.php b/sources/phpBB/language/en/acp/search.php new file mode 100644 index 0000000..bda965b --- /dev/null +++ b/sources/phpBB/language/en/acp/search.php @@ -0,0 +1,138 @@ + +* @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 + +$lang = array_merge($lang, array( + 'ACP_SEARCH_INDEX_EXPLAIN' => 'Here you can manage the search backend’s indexes. Since you normally use only one backend you should delete all indexes that you do not make use of. After altering some of the search settings (e.g. the number of minimum/maximum chars) it might be worth recreating the index so it reflects those changes.', + 'ACP_SEARCH_SETTINGS_EXPLAIN' => 'Here you can define what search backend will be used for indexing posts and performing searches. You can set various options that can influence how much processing these actions require. Some of these settings are the same for all search engine backends.', + + 'COMMON_WORD_THRESHOLD' => 'Common word threshold', + 'COMMON_WORD_THRESHOLD_EXPLAIN' => 'Words which are contained in a greater percentage of all posts will be regarded as common. Common words are ignored in search queries. Set to zero to disable. Only takes effect if there are more than 100 posts. If you want words that are currently regarded as common to be reconsidered you have to recreate the index.', + 'CONFIRM_SEARCH_BACKEND' => 'Are you sure you wish to switch to a different search backend? After changing the search backend you will have to create an index for the new search backend. If you don’t plan on switching back to the old search backend you can also delete the old backend’s index in order to free system resources.', + 'CONTINUE_DELETING_INDEX' => 'Continue previous index removal process', + 'CONTINUE_DELETING_INDEX_EXPLAIN' => 'An index removal process has been started. In order to access the search index page you will have to complete it or cancel it.', + 'CONTINUE_INDEXING' => 'Continue previous indexing process', + 'CONTINUE_INDEXING_EXPLAIN' => 'An indexing process has been started. In order to access the search index page you will have to complete it or cancel it.', + 'CREATE_INDEX' => 'Create index', + + 'DELETE_INDEX' => 'Delete index', + 'DELETING_INDEX_IN_PROGRESS' => 'Deleting the index in progress', + 'DELETING_INDEX_IN_PROGRESS_EXPLAIN' => 'The search backend is currently cleaning its index. This can take a few minutes.', + + 'FULLTEXT_MYSQL_INCOMPATIBLE_DATABASE' => 'The MySQL fulltext backend can only be used with MySQL4 and above.', + 'FULLTEXT_MYSQL_NOT_SUPPORTED' => 'MySQL fulltext indexes can only be used with MyISAM or InnoDB tables. MySQL 5.6.4 or later is required for fulltext indexes on InnoDB tables.', + 'FULLTEXT_MYSQL_TOTAL_POSTS' => 'Total number of indexed posts', + 'FULLTEXT_MYSQL_MIN_SEARCH_CHARS_EXPLAIN' => 'Words with at least this many characters will be indexed for searching. You or your host can only change this setting by changing the mysql configuration.', + 'FULLTEXT_MYSQL_MAX_SEARCH_CHARS_EXPLAIN' => 'Words with no more than this many characters will be indexed for searching. You or your host can only change this setting by changing the mysql configuration.', + + 'FULLTEXT_POSTGRES_INCOMPATIBLE_DATABASE' => 'The PostgreSQL fulltext backend can only be used with PostgreSQL.', + 'FULLTEXT_POSTGRES_TOTAL_POSTS' => 'Total number of indexed posts', + 'FULLTEXT_POSTGRES_VERSION_CHECK' => 'PostgreSQL version', + 'FULLTEXT_POSTGRES_TS_NAME' => 'Text search Configuration Profile:', + 'FULLTEXT_POSTGRES_MIN_WORD_LEN' => 'Minimum word length for keywords', + 'FULLTEXT_POSTGRES_MAX_WORD_LEN' => 'Maximum word length for keywords', + 'FULLTEXT_POSTGRES_VERSION_CHECK_EXPLAIN' => 'This search backend requires PostgreSQL version 8.3 and above.', + 'FULLTEXT_POSTGRES_TS_NAME_EXPLAIN' => 'The Text search configuration profile used to determine the parser and dictionary.', + 'FULLTEXT_POSTGRES_MIN_WORD_LEN_EXPLAIN' => 'Words with at least this many characters will be included in the query to the database.', + 'FULLTEXT_POSTGRES_MAX_WORD_LEN_EXPLAIN' => 'Words with no more than this many characters will be included in the query to the database.', + + 'FULLTEXT_SPHINX_CONFIGURE' => 'Configure the following settings to generate sphinx config file', + 'FULLTEXT_SPHINX_DATA_PATH' => 'Path to data directory', + 'FULLTEXT_SPHINX_DATA_PATH_EXPLAIN' => 'It will be used to store the indexes and log files. You should create this directory outside the web accessible directories. (should have a trailing slash)', + 'FULLTEXT_SPHINX_DELTA_POSTS' => 'Number of posts in frequently updated delta index', + 'FULLTEXT_SPHINX_HOST' => 'Sphinx search daemon host', + 'FULLTEXT_SPHINX_HOST_EXPLAIN' => 'Host on which the sphinx search daemon (searchd) listens. Leave empty to use the default localhost', + 'FULLTEXT_SPHINX_INDEXER_MEM_LIMIT' => 'Indexer memory limit', + 'FULLTEXT_SPHINX_INDEXER_MEM_LIMIT_EXPLAIN' => 'This number should at all times be lower than the RAM available on your machine. If you experience periodic performance problems this might be due to the indexer consuming too many resources. It might help to lower the amount of memory available to the indexer.', + 'FULLTEXT_SPHINX_MAIN_POSTS' => 'Number of posts in main index', + 'FULLTEXT_SPHINX_PORT' => 'Sphinx search daemon port', + 'FULLTEXT_SPHINX_PORT_EXPLAIN' => 'Port on which the sphinx search daemon (searchd) listens. Leave empty to use the default Sphinx API port 9312', + 'FULLTEXT_SPHINX_WRONG_DATABASE' => 'The sphinx search for phpBB supports MySQL and PostgreSQL only.', + 'FULLTEXT_SPHINX_CONFIG_FILE' => 'Sphinx config file', + 'FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN' => 'The generated content of the sphinx config file. This data needs to be pasted into the sphinx.conf which is used by sphinx search daemon. Replace the [dbuser] and [dbpassword] placeholders with your database credentials.', + 'FULLTEXT_SPHINX_NO_CONFIG_DATA' => 'The sphinx data directory path is not defined. Please define the path and submit to generate the config file.', + + 'GENERAL_SEARCH_SETTINGS' => 'General search settings', + 'GO_TO_SEARCH_INDEX' => 'Go to search index page', + + 'INDEX_STATS' => 'Index statistics', + 'INDEXING_IN_PROGRESS' => 'Indexing in progress', + 'INDEXING_IN_PROGRESS_EXPLAIN' => 'The search backend is currently indexing all posts on the board. This can take from a few minutes to a few hours depending on your board’s size.', + + 'LIMIT_SEARCH_LOAD' => 'Search page system load limit', + 'LIMIT_SEARCH_LOAD_EXPLAIN' => 'If the 1 minute system load exceeds this value the search page will go offline, 1.0 equals ~100% utilisation of one processor. This only functions on UNIX based servers.', + + 'MAX_SEARCH_CHARS' => 'Max characters indexed by search', + 'MAX_SEARCH_CHARS_EXPLAIN' => 'Words with no more than this many characters will be indexed for searching.', + 'MAX_NUM_SEARCH_KEYWORDS' => 'Maximum number of allowed keywords', + 'MAX_NUM_SEARCH_KEYWORDS_EXPLAIN' => 'Maximum number of words the user is able to search for. A value of 0 allows an unlimited number of words.', + 'MIN_SEARCH_CHARS' => 'Min characters indexed by search', + 'MIN_SEARCH_CHARS_EXPLAIN' => 'Words with at least this many characters will be indexed for searching.', + 'MIN_SEARCH_AUTHOR_CHARS' => 'Min author name characters', + 'MIN_SEARCH_AUTHOR_CHARS_EXPLAIN' => 'Users have to enter at least this many characters of the name when performing a wildcard author search. If the author’s username is shorter than this number you can still search for the author’s posts by entering the complete username.', + + 'PROGRESS_BAR' => 'Progress bar', + + 'SEARCH_GUEST_INTERVAL' => 'Guest search flood interval', + 'SEARCH_GUEST_INTERVAL_EXPLAIN' => 'Number of seconds guests must wait between searches. If one guest searches all others have to wait until the time interval passed.', + 'SEARCH_INDEX_CREATE_REDIRECT' => array( + 2 => 'All posts up to post id %2$d have now been indexed, of which %1$d posts were within this step.
', + ), + 'SEARCH_INDEX_CREATE_REDIRECT_RATE' => array( + 2 => 'The current rate of indexing is approximately %1$.1f posts per second.
Indexing in progress…', + ), + 'SEARCH_INDEX_DELETE_REDIRECT' => array( + 2 => 'All posts up to post id %2$d have been removed from the search index.
Deleting in progress…', + ), + 'SEARCH_INDEX_CREATED' => 'Successfully indexed all posts in the board database.', + 'SEARCH_INDEX_REMOVED' => 'Successfully deleted the search index for this backend.', + 'SEARCH_INTERVAL' => 'User search flood interval', + 'SEARCH_INTERVAL_EXPLAIN' => 'Number of seconds users must wait between searches. This interval is checked independently for each user.', + 'SEARCH_STORE_RESULTS' => 'Search result cache length', + 'SEARCH_STORE_RESULTS_EXPLAIN' => 'Cached search results will expire after this time, in seconds. Set to 0 if you want to disable search cache.', + 'SEARCH_TYPE' => 'Search backend', + 'SEARCH_TYPE_EXPLAIN' => 'phpBB allows you to choose the backend that is used for searching text in post contents. By default the search will use phpBB’s own fulltext search.', + 'SWITCHED_SEARCH_BACKEND' => 'You switched the search backend. In order to use the new search backend you should make sure that there is an index for the backend you chose.', + + 'TOTAL_WORDS' => 'Total number of indexed words', + 'TOTAL_MATCHES' => 'Total number of word to post relations indexed', + + 'YES_SEARCH' => 'Enable search facilities', + 'YES_SEARCH_EXPLAIN' => 'Enables user facing search functionality including member search.', + 'YES_SEARCH_UPDATE' => 'Enable fulltext updating', + 'YES_SEARCH_UPDATE_EXPLAIN' => 'Updating of fulltext indexes when posting, overridden if search is disabled.', +)); diff --git a/sources/phpBB/language/en/acp/styles.php b/sources/phpBB/language/en/acp/styles.php new file mode 100644 index 0000000..e6b05c8 --- /dev/null +++ b/sources/phpBB/language/en/acp/styles.php @@ -0,0 +1,86 @@ + +* @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 + +$lang = array_merge($lang, array( + 'ACP_STYLES_EXPLAIN' => 'Here you can manage the available styles on your board. You may alter existing styles, delete, deactivate, reactivate, install new ones. You can also see what a style will look like using the preview function. Also listed is the total user count for each style, note that overriding user styles will not be reflected here.', + + 'CANNOT_BE_INSTALLED' => 'Cannot be installed', + 'CONFIRM_UNINSTALL_STYLES' => 'Are you sure you wish to uninstall selected styles?', + 'COPYRIGHT' => 'Copyright', + + 'DEACTIVATE_DEFAULT' => 'You cannot deactivate the default style.', + 'DELETE_FROM_FS' => 'Delete from filesystem', + 'DELETE_STYLE_FILES_FAILED' => 'Error deleting files for style "%s".', + 'DELETE_STYLE_FILES_SUCCESS' => 'Files for style "%s" have been deleted.', + 'DETAILS' => 'Details', + + 'INHERITING_FROM' => 'Inherits from', + 'INSTALL_STYLE' => 'Install style', + 'INSTALL_STYLES' => 'Install styles', + 'INSTALL_STYLES_EXPLAIN' => 'Here you can install new styles.
If you cannot find a specific style in list below, check to make sure style is already installed. If it is not installed, check if it was uploaded correctly.', + 'INVALID_STYLE_ID' => 'Invalid style ID.', + + 'NO_MATCHING_STYLES_FOUND' => 'No styles match your query.', + 'NO_UNINSTALLED_STYLE' => 'No uninstalled styles detected.', + + 'PURGED_CACHE' => 'Cache was purged.', + + 'REQUIRES_STYLE' => 'This style requires the style "%s" to be installed.', + + 'STYLE_ACTIVATE' => 'Activate', + 'STYLE_ACTIVE' => 'Active', + 'STYLE_DEACTIVATE' => 'Deactivate', + 'STYLE_DEFAULT' => 'Make default style', + 'STYLE_DEFAULT_CHANGE_INACTIVE' => 'You must activate style before making it default style.', + 'STYLE_ERR_INVALID_PARENT' => 'Invalid parent style.', + 'STYLE_ERR_NAME_EXIST' => 'A style with that name already exists.', + 'STYLE_ERR_STYLE_NAME' => 'You must supply a name for this style.', + 'STYLE_INSTALLED' => 'Style "%s" has been installed.', + 'STYLE_INSTALLED_RETURN_INSTALLED_STYLES' => 'Return to installed styles list', + 'STYLE_INSTALLED_RETURN_UNINSTALLED_STYLES' => 'Install more styles', + 'STYLE_NAME' => 'Style name', + 'STYLE_NAME_RESERVED' => 'Style "%s" can not be installed, because the name is reserved.', + 'STYLE_NOT_INSTALLED' => 'Style "%s" was not installed.', + 'STYLE_PATH' => 'Style path', + 'STYLE_UNINSTALL' => 'Uninstall', + 'STYLE_UNINSTALL_DEPENDENT' => 'Style "%s" cannot be uninstalled because it has one or more child styles.', + 'STYLE_UNINSTALLED' => 'Style "%s" uninstalled successfully.', + 'STYLE_USED_BY' => 'Used by (including robots)', + + 'UNINSTALL_DEFAULT' => 'You cannot uninstall the default style.', +)); diff --git a/sources/phpBB/language/en/acp/users.php b/sources/phpBB/language/en/acp/users.php new file mode 100644 index 0000000..980e73a --- /dev/null +++ b/sources/phpBB/language/en/acp/users.php @@ -0,0 +1,143 @@ + +* @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 + +$lang = array_merge($lang, array( + 'ADMIN_SIG_PREVIEW' => 'Signature preview', + 'AT_LEAST_ONE_FOUNDER' => 'You are not able to change this founder to a normal user. There needs to be at least one founder enabled for this board. If you want to change this users founder status, promote another user to be a founder first.', + + 'BAN_ALREADY_ENTERED' => 'The ban had been previously entered successfully. The ban list has not been updated.', + 'BAN_SUCCESSFUL' => 'Ban entered successfully.', + + 'CANNOT_BAN_ANONYMOUS' => 'You are not allowed to ban the anonymous account. Permissions for anonymous users can be set under the Permissions tab.', + 'CANNOT_BAN_FOUNDER' => 'You are not allowed to ban founder accounts.', + 'CANNOT_BAN_YOURSELF' => 'You are not allowed to ban yourself.', + 'CANNOT_DEACTIVATE_BOT' => 'You are not allowed to deactivate bot accounts. Please deactivate the bot within the bots page instead.', + 'CANNOT_DEACTIVATE_FOUNDER' => 'You are not allowed to deactivate founder accounts.', + 'CANNOT_DEACTIVATE_YOURSELF' => 'You are not allowed to deactivate your own account.', + 'CANNOT_FORCE_REACT_BOT' => 'You are not allowed to force reactivation on bot accounts. Please reactivate the bot within the bots page instead.', + 'CANNOT_FORCE_REACT_FOUNDER' => 'You are not allowed to force reactivation on founder accounts.', + 'CANNOT_FORCE_REACT_YOURSELF' => 'You are not allowed to force reactivation of your own account.', + 'CANNOT_REMOVE_ANONYMOUS' => 'You are not able to remove the guest user account.', + 'CANNOT_REMOVE_FOUNDER' => 'You are not allowed to remove founder accounts.', + 'CANNOT_REMOVE_YOURSELF' => 'You are not allowed to remove your own user account.', + 'CANNOT_SET_FOUNDER_IGNORED' => 'You are not able to promote ignored users to be founders.', + 'CANNOT_SET_FOUNDER_INACTIVE' => 'You need to activate users before you promote them to founders, only activated users are able to be promoted.', + 'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing the users email address.', + + 'DELETE_POSTS' => 'Delete posts', + 'DELETE_USER' => 'Delete user', + 'DELETE_USER_EXPLAIN' => 'Please note that deleting a user is final, they cannot be recovered. Unread private messages sent by this user will be deleted and will not be available to their recipients.', + + 'FORCE_REACTIVATION_SUCCESS' => 'Successfully forced reactivation.', + 'FOUNDER' => 'Founder', + 'FOUNDER_EXPLAIN' => 'Founders have all administrative permissions and can never be banned, deleted or altered by non-founder members.', + + 'GROUP_APPROVE' => 'Approve member', + 'GROUP_DEFAULT' => 'Make group default for member', + 'GROUP_DELETE' => 'Remove member from group', + 'GROUP_DEMOTE' => 'Demote group leader', + 'GROUP_PROMOTE' => 'Promote to group leader', + + 'IP_WHOIS_FOR' => 'IP whois for %s', + + 'LAST_ACTIVE' => 'Last active', + + 'MOVE_POSTS_EXPLAIN' => 'Please select the forum to which you wish to move all the posts this user has made.', + + 'NO_SPECIAL_RANK' => 'No special rank assigned', + 'NO_WARNINGS' => 'No warnings.', + 'NOT_MANAGE_FOUNDER' => 'You tried to manage a user with founder status. Only founders are allowed to manage other founders.', + + 'QUICK_TOOLS' => 'Quick tools', + + 'REGISTERED' => 'Registered', + 'REGISTERED_IP' => 'Registered from IP', + 'RETAIN_POSTS' => 'Retain posts', + + 'SELECT_FORM' => 'Select form', + 'SELECT_USER' => 'Select user', + + 'USER_ADMIN' => 'User administration', + 'USER_ADMIN_ACTIVATE' => 'Activate account', + 'USER_ADMIN_ACTIVATED' => 'User activated successfully.', + 'USER_ADMIN_AVATAR_REMOVED' => 'Successfully removed avatar from user account.', + 'USER_ADMIN_BAN_EMAIL' => 'Ban by email', + 'USER_ADMIN_BAN_EMAIL_REASON' => 'Email address banned via user management', + 'USER_ADMIN_BAN_IP' => 'Ban by IP', + 'USER_ADMIN_BAN_IP_REASON' => 'IP banned via user management', + 'USER_ADMIN_BAN_NAME_REASON' => 'Username banned via user management', + 'USER_ADMIN_BAN_USER' => 'Ban by username', + 'USER_ADMIN_DEACTIVATE' => 'Deactivate account', + 'USER_ADMIN_DEACTIVED' => 'User deactivated successfully.', + 'USER_ADMIN_DEL_ATTACH' => 'Delete all attachments', + 'USER_ADMIN_DEL_AVATAR' => 'Delete avatar', + 'USER_ADMIN_DEL_OUTBOX' => 'Empty PM outbox', + 'USER_ADMIN_DEL_POSTS' => 'Delete all posts', + 'USER_ADMIN_DEL_SIG' => 'Delete signature', + 'USER_ADMIN_EXPLAIN' => 'Here you can change your users information and certain specific options.', + 'USER_ADMIN_FORCE' => 'Force reactivation', + 'USER_ADMIN_LEAVE_NR' => 'Remove from Newly Registered', + 'USER_ADMIN_MOVE_POSTS' => 'Move all posts', + 'USER_ADMIN_SIG_REMOVED' => 'Successfully removed signature from user account.', + 'USER_ATTACHMENTS_REMOVED' => 'Successfully removed all attachments made by this user.', + 'USER_AVATAR_NOT_ALLOWED' => 'The avatar cannot be displayed because avatars have been disallowed.', + 'USER_AVATAR_UPDATED' => 'Successfully updated user avatars details.', + 'USER_AVATAR_TYPE_NOT_ALLOWED' => 'The current avatar cannot be displayed because its type has been disallowed.', + 'USER_CUSTOM_PROFILE_FIELDS' => 'Custom profile fields', + 'USER_DELETED' => 'User deleted successfully.', + 'USER_GROUP_ADD' => 'Add user to group', + 'USER_GROUP_NORMAL' => 'User defined groups user is a member of', + 'USER_GROUP_PENDING' => 'Groups user is in pending mode', + 'USER_GROUP_SPECIAL' => 'Pre-defined groups user is a member of', + 'USER_LIFTED_NR' => 'Successfully removed the user’s newly registered status.', + 'USER_NO_ATTACHMENTS' => 'There are no attached files to display.', + 'USER_NO_POSTS_TO_DELETE' => 'The user has no posts to retain or delete.', + 'USER_OUTBOX_EMPTIED' => 'Successfully emptied user’s private message outbox.', + 'USER_OUTBOX_EMPTY' => 'The user’s private message outbox was already empty.', + 'USER_OVERVIEW_UPDATED' => 'User details updated.', + 'USER_POSTS_DELETED' => 'Successfully removed all posts made by this user.', + 'USER_POSTS_MOVED' => 'Successfully moved users posts to target forum.', + 'USER_PREFS_UPDATED' => 'User preferences updated.', + 'USER_PROFILE' => 'User profile', + 'USER_PROFILE_UPDATED' => 'User profile updated.', + 'USER_RANK' => 'User rank', + 'USER_RANK_UPDATED' => 'User rank updated.', + 'USER_SIG_UPDATED' => 'User signature successfully updated.', + 'USER_WARNING_LOG_DELETED' => 'No information available. Possibly the log entry has been deleted.', + 'USER_TOOLS' => 'Basic tools', +)); diff --git a/sources/phpBB/language/en/app.php b/sources/phpBB/language/en/app.php new file mode 100644 index 0000000..2da0f09 --- /dev/null +++ b/sources/phpBB/language/en/app.php @@ -0,0 +1,48 @@ + +* @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 +// +// Some characters you may want to copy&paste: +// ’ » “ †… +// + +$lang = array_merge($lang, array( + 'CONTROLLER_ARGUMENT_VALUE_MISSING' => 'Missing value for argument #%1$s: %3$s in class %2$s', + 'CONTROLLER_NOT_SPECIFIED' => 'No controller has been specified.', + 'CONTROLLER_METHOD_NOT_SPECIFIED' => 'No method was specified for the controller.', + 'CONTROLLER_SERVICE_UNDEFINED' => 'The service for controller "%s" is not defined in ./config/services.yml.', +)); diff --git a/sources/phpBB/language/en/captcha_qa.php b/sources/phpBB/language/en/captcha_qa.php new file mode 100644 index 0000000..f764a83 --- /dev/null +++ b/sources/phpBB/language/en/captcha_qa.php @@ -0,0 +1,64 @@ + +* @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 + +$lang = array_merge($lang, array( + 'CAPTCHA_QA' => 'Q&A', + 'CONFIRM_QUESTION_EXPLAIN' => 'This question is a means of preventing automated form submissions by spambots.', + 'CONFIRM_QUESTION_WRONG' => 'You have provided an invalid answer to the question.', + + 'QUESTION_ANSWERS' => 'Answers', + 'ANSWERS_EXPLAIN' => 'Please enter valid answers to the question, one per line.', + 'CONFIRM_QUESTION' => 'Question', + + 'ANSWER' => 'Answer', + 'EDIT_QUESTION' => 'Edit Question', + 'QUESTIONS' => 'Questions', + 'QUESTIONS_EXPLAIN' => 'For every form submission where you have enabled the Q&A plugin, users will be asked one of the questions specified here. To use this plugin at least one question must be set in the default language. These questions should be easy for your target audience to answer but beyond the ability of a bot capable of running a Google™ search. Using a large and regularly changed set of questions will yield the best results. Enable the strict setting if your question relies on mixed case, punctuation or whitespace.', + 'QUESTION_DELETED' => 'Question deleted', + 'QUESTION_LANG' => 'Language', + 'QUESTION_LANG_EXPLAIN' => 'The language this question and its answers are written in.', + 'QUESTION_STRICT' => 'Strict check', + 'QUESTION_STRICT_EXPLAIN' => 'Enable to enforce mixed case, punctuation and whitespace.', + + 'QUESTION_TEXT' => 'Question', + 'QUESTION_TEXT_EXPLAIN' => 'The question presented to the user.', + + 'QA_ERROR_MSG' => 'Please fill in all fields and enter at least one answer.', + 'QA_LAST_QUESTION' => 'You cannot delete all questions while the plugin is active.', + +)); diff --git a/sources/phpBB/language/en/captcha_recaptcha.php b/sources/phpBB/language/en/captcha_recaptcha.php new file mode 100644 index 0000000..18438ab --- /dev/null +++ b/sources/phpBB/language/en/captcha_recaptcha.php @@ -0,0 +1,52 @@ + +* @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 + +$lang = array_merge($lang, array( + 'RECAPTCHA_LANG' => 'en', + 'RECAPTCHA_NOT_AVAILABLE' => 'In order to use reCaptcha, you must create an account on www.google.com/recaptcha.', + 'CAPTCHA_RECAPTCHA' => 'reCaptcha', + 'RECAPTCHA_INCORRECT' => 'The visual confirmation code you submitted was incorrect', + + 'RECAPTCHA_PUBLIC' => 'Public reCaptcha key', + 'RECAPTCHA_PUBLIC_EXPLAIN' => 'Your public reCaptcha key. Keys can be obtained on www.google.com/recaptcha.', + 'RECAPTCHA_PRIVATE' => 'Private reCaptcha key', + 'RECAPTCHA_PRIVATE_EXPLAIN' => 'Your private reCaptcha key. Keys can be obtained on www.google.com/recaptcha.', + + 'RECAPTCHA_EXPLAIN' => 'In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.', + 'RECAPTCHA_SOCKET_ERROR' => 'There was a problem connecting to the RECAPTCHA service: could not open socket. Try again later.', +)); diff --git a/sources/phpBB/language/en/cli.php b/sources/phpBB/language/en/cli.php new file mode 100644 index 0000000..0e7dc39 --- /dev/null +++ b/sources/phpBB/language/en/cli.php @@ -0,0 +1,81 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* DO NOT CHANGE +*/ +if (empty($lang) || !is_array($lang)) +{ + $lang = array(); +} + +// DEVELOPERS PLEASE NOTE +// +// Placeholders can now contain order information, e.g. instead of +// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows +// translators to re-order the output of data while ensuring it remains correct +// +// You do not need this where single placeholders are used, e.g. 'Message %d' is fine +// equally where a string contains only two placeholders which are used to wrap text +// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine + +$lang = array_merge($lang, array( + 'CLI_CONFIG_CANNOT_CACHED' => 'Set this option if the configuration option changes too frequently to be efficiently cached.', + 'CLI_CONFIG_CURRENT' => 'Current configuration value, use 0 and 1 to specify boolean values', + 'CLI_CONFIG_DELETE_SUCCESS' => 'Successfully deleted config %s.', + 'CLI_CONFIG_NEW' => 'New configuration value, use 0 and 1 to specify boolean values', + 'CLI_CONFIG_NOT_EXISTS' => 'Config %s does not exist', + 'CLI_CONFIG_OPTION_NAME' => 'The configuration option’s name', + 'CLI_CONFIG_PRINT_WITHOUT_NEWLINE' => 'Set this option if the value should be printed without a new line at the end.', + 'CLI_CONFIG_INCREMENT_BY' => 'Amount to increment by', + 'CLI_CONFIG_INCREMENT_SUCCESS' => 'Successfully incremented config %s', + 'CLI_CONFIG_SET_FAILURE' => 'Could not set config %s', + 'CLI_CONFIG_SET_SUCCESS' => 'Successfully set config %s', + + 'CLI_DESCRIPTION_CRON_LIST' => 'Prints a list of ready and unready cron jobs.', + 'CLI_DESCRIPTION_CRON_RUN' => 'Runs all ready cron tasks.', + 'CLI_DESCRIPTION_CRON_RUN_ARGUMENT_1' => 'Name of the task to be run', + 'CLI_DESCRIPTION_DB_MIGRATE' => 'Updates the database by applying migrations.', + 'CLI_DESCRIPTION_DELETE_CONFIG' => 'Deletes a configuration option', + 'CLI_DESCRIPTION_DISABLE_EXTENSION' => 'Disables the specified extension.', + 'CLI_DESCRIPTION_ENABLE_EXTENSION' => 'Enables the specified extension.', + 'CLI_DESCRIPTION_FIND_MIGRATIONS' => 'Finds migrations that are not depended on.', + 'CLI_DESCRIPTION_GET_CONFIG' => 'Gets a configuration option’s value', + 'CLI_DESCRIPTION_INCREMENT_CONFIG' => 'Increments a configuration option’s value', + 'CLI_DESCRIPTION_LIST_EXTENSIONS' => 'Lists all extensions in the database and on the filesystem.', + '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_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_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', + 'CLI_EXTENSION_ENABLE_SUCCESS' => 'Successfully enabled extension %s', + 'CLI_EXTENSION_NAME' => 'Name of the extension', + 'CLI_EXTENSION_PURGE_FAILURE' => 'Could not purge extension %s', + 'CLI_EXTENSION_PURGE_SUCCESS' => 'Successfully purged extension %s', + 'CLI_EXTENSION_NOT_FOUND' => 'No extensions were found.', + 'CLI_EXTENSIONS_AVAILABLE' => 'Available', + 'CLI_EXTENSIONS_DISABLED' => 'Disabled', + 'CLI_EXTENSIONS_ENABLED' => 'Enabled', + + 'CLI_FIXUP_RECALCULATE_EMAIL_HASH_SUCCESS' => 'Successfully recalculated all email hashes.', +)); diff --git a/sources/phpBB/language/en/common.php b/sources/phpBB/language/en/common.php new file mode 100644 index 0000000..79d504a --- /dev/null +++ b/sources/phpBB/language/en/common.php @@ -0,0 +1,1415 @@ + +* @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 +// +// Some characters you may want to copy&paste: +// ’ » “ †… +// + +$lang = array_merge($lang, array( + 'TRANSLATION_INFO' => '', + 'DIRECTION' => 'ltr', + 'DATE_FORMAT' => '|d M Y|', // 01 Jan 2007 (with Relative days enabled) + 'DATETIME_FORMAT' => '|d M Y, H:i|', // 01 Jan 2007, 13:37 (with Relative days enabled) + 'USER_LANG' => 'en-gb', + + // You can define different rules for the determination of plural forms here. + // See http://wiki.phpbb.com/Plural_Rules for more information + // or ask the translation manager for help. + 'PLURAL_RULE' => 1, + + '1_DAY' => '1 day', + '1_MONTH' => '1 month', + '1_YEAR' => '1 year', + '2_WEEKS' => '2 weeks', + '3_MONTHS' => '3 months', + '6_MONTHS' => '6 months', + '7_DAYS' => '7 days', + + 'ACCOUNT_ALREADY_ACTIVATED' => 'Your account has already been activated.', + 'ACCOUNT_DEACTIVATED' => 'Your account has been manually deactivated and is only able to be reactivated by an administrator.', + 'ACCOUNT_NOT_ACTIVATED' => 'Your account has not been activated yet.', + 'ACP' => 'Administration Control Panel', + 'ACP_SHORT' => 'ACP', + 'ACTIVE' => 'active', + 'ACTIVE_ERROR' => 'The specified username is currently inactive. If you have problems activating your account, please contact a board administrator.', + 'ADMINISTRATOR' => 'Administrator', + 'ADMINISTRATORS' => 'Administrators', + 'AGE' => 'Age', + 'AIM' => 'AIM', + 'AJAX_ERROR_TITLE' => 'AJAX error', + 'AJAX_ERROR_TEXT' => 'Something went wrong when processing your request.', + 'AJAX_ERROR_TEXT_ABORT' => 'User aborted request.', + 'AJAX_ERROR_TEXT_TIMEOUT' => 'Your request timed out; please try again.', + 'AJAX_ERROR_TEXT_PARSERERROR' => 'Something went wrong with the request and the server returned an invalid reply.', + 'ALLOWED' => 'Allowed', + 'ALL_FILES' => 'All files', + 'ALL_FORUMS' => 'All forums', + 'ALL_MESSAGES' => 'All messages', + 'ALL_POSTS' => 'All posts', + 'ALL_TIMES' => 'All times are %1$s', + 'ALL_TOPICS' => 'All Topics', + 'AND' => 'And', + 'ARE_WATCHING_FORUM' => 'You have subscribed to be notified of new posts in this forum.', + 'ARE_WATCHING_TOPIC' => 'You have subscribed to be notified of new posts in this topic.', + 'ASCENDING' => 'Ascending', + 'ATTACHMENTS' => 'Attachments', + 'ATTACHED_IMAGE_NOT_IMAGE' => 'The image file you tried to attach is invalid.', + 'AUTHOR' => 'Author', + 'AUTH_NO_PROFILE_CREATED' => 'The creation of a user profile was unsuccessful.', + 'AUTH_PROVIDER_OAUTH_ERROR_INVALID_ENTRY' => 'Invalid database entry.', + 'AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE' => 'Invalid service type provided to OAuth service handler.', + 'AUTH_PROVIDER_OAUTH_ERROR_SERVICE_NOT_CREATED' => 'OAuth service not created', + 'AUTH_PROVIDER_OAUTH_SERVICE_BITLY' => 'Bitly', + 'AUTH_PROVIDER_OAUTH_SERVICE_FACEBOOK' => 'Facebook', + 'AUTH_PROVIDER_OAUTH_SERVICE_GOOGLE' => 'Google', + 'AUTH_PROVIDER_OAUTH_TOKEN_ERROR_NOT_STORED' => 'OAuth token not stored.', + 'AUTH_PROVIDER_OAUTH_TOKEN_ERROR_INCORRECTLY_STORED' => 'OAuth token incorrectly stored.', + 'AVATAR_DISALLOWED_CONTENT' => 'The upload was rejected because the uploaded file was identified as a possible attack vector.', + 'AVATAR_DISALLOWED_EXTENSION' => 'This file cannot be displayed because the extension %s is not allowed.', + 'AVATAR_EMPTY_REMOTE_DATA' => 'The specified avatar could not be uploaded because the remote data appears to be invalid or corrupted.', + 'AVATAR_EMPTY_FILEUPLOAD' => 'The uploaded avatar file is empty.', + 'AVATAR_INVALID_FILENAME' => '%s is an invalid filename.', + 'AVATAR_NOT_UPLOADED' => 'Avatar could not be uploaded.', + 'AVATAR_NO_SIZE' => 'The width or height of the linked avatar could not be determined. Please enter them manually.', + 'AVATAR_PARTIAL_UPLOAD' => 'The specified file was only partially uploaded.', + 'AVATAR_PHP_SIZE_NA' => 'The avatar’s filesize is too large.
The maximum allowed filesize set in php.ini could not be determined.', + 'AVATAR_PHP_SIZE_OVERRUN' => 'The avatar’s filesize is too large. The maximum allowed upload size is %1$d %2$s.
Please note this is set in php.ini and cannot be overridden.', + 'AVATAR_REMOTE_UPLOAD_TIMEOUT' => 'The specified avatar could not be uploaded because the request timed out.', + 'AVATAR_URL_INVALID' => 'The URL you specified is invalid.', + 'AVATAR_URL_NOT_FOUND' => 'The file specified could not be found.', + 'AVATAR_WRONG_FILESIZE' => 'The avatar’s filesize must be between 0 and %1$d %2$s.', + 'AVATAR_WRONG_SIZE' => 'The submitted avatar is %5$s wide and %6$s high. Avatars must be at least %1$s wide and %2$s high, but no larger than %3$s wide and %4$s high.', + + 'BACK_TO_TOP' => 'Top', + 'BACK_TO_PREV' => 'Back to previous page', + 'BAN_TRIGGERED_BY_EMAIL'=> 'A ban has been issued on your email address.', + 'BAN_TRIGGERED_BY_IP' => 'A ban has been issued on your IP address.', + 'BAN_TRIGGERED_BY_USER' => 'A ban has been issued on your username.', + 'BBCODE_GUIDE' => 'BBCode guide', + 'BCC' => 'BCC', + 'BIRTHDAYS' => 'Birthdays', + 'BOARD_BAN_PERM' => 'You have been permanently banned from this board.

Please contact the %2$sBoard Administrator%3$s for more information.', + 'BOARD_BAN_REASON' => 'Reason given for ban: %s', + 'BOARD_BAN_TIME' => 'You have been banned from this board until %1$s.

Please contact the %2$sBoard Administrator%3$s for more information.', + 'BOARD_DISABLE' => 'Sorry but this board is currently unavailable.', + 'BOARD_DISABLED' => 'This board is currently disabled.', + 'BOARD_UNAVAILABLE' => 'Sorry but the board is temporarily unavailable, please try again in a few minutes.', + 'BROWSING_FORUM' => 'Users browsing this forum: %1$s', + 'BROWSING_FORUM_GUESTS' => array( + 1 => 'Users browsing this forum: %2$s and %1$d guest', + 2 => 'Users browsing this forum: %2$s and %1$d guests', + ), + 'BUTTON_EDIT' => 'Edit', + 'BUTTON_FORUM_LOCKED' => 'Locked', + 'BUTTON_NEW_TOPIC' => 'New Topic', + 'BUTTON_PM' => 'PM', + 'BUTTON_PM_FORWARD' => 'Forward', + 'BUTTON_PM_NEW' => 'New PM', + 'BUTTON_PM_REPLY' => 'Send Reply', + 'BUTTON_PM_REPLY_ALL' => 'Reply All', + 'BUTTON_POST_REPLY' => 'Post Reply', + 'BUTTON_QUOTE' => 'Quote', + 'BUTTON_TOPIC_LOCKED' => 'Locked', + 'BYTES' => 'Bytes', + 'BYTES_SHORT' => 'B', + + 'CANCEL' => 'Cancel', + 'CHANGE' => 'Change', + 'CHANGE_FONT_SIZE' => 'Change font size', + 'CHANGING_PREFERENCES' => 'Changing board preferences', + 'CHANGING_PROFILE' => 'Changing profile settings', + 'CHARACTERS' => array( + 1 => '%d character', + 2 => '%d characters', + ), + 'COLLAPSE_VIEW' => 'Collapse view', + 'CLOSE_WINDOW' => 'Close window', + 'COLOUR_SWATCH' => 'Colour swatch', + 'COLON' => ':', + 'COMMA_SEPARATOR' => ', ', // Comma used to join lists into a single string, use localised comma if appropriate, eg: Ideographic or Arabic + 'CONFIRM' => 'Confirm', + 'CONFIRM_CODE' => 'Confirmation code', + 'CONFIRM_CODE_EXPLAIN' => 'Enter the code exactly as it appears. All letters are case insensitive.', + 'CONFIRM_CODE_WRONG' => 'The confirmation code you entered was incorrect.', + 'CONFIRM_OPERATION' => 'Are you sure you wish to carry out this operation?', + 'CONFIRM_AVATAR_DELETE' => 'Are you sure you wish to delete this avatar?', + 'CONGRATULATIONS' => 'Congratulations to', + 'CONNECTION_FAILED' => 'Connection failed.', + 'CONNECTION_SUCCESS' => 'Connection was successful!', + 'CONTACT' => 'Contact', + 'CONTACT_USER' => 'Contact %s', + 'CONTACT_US' => 'Contact us', + 'COOKIES_DELETED' => 'All board cookies successfully deleted.', + 'CURRENT_TIME' => 'It is currently %s', + + 'DAY' => 'Day', + 'DAYS' => 'Days', + 'DELETE' => 'Delete', + 'DELETE_ALL' => 'Delete all', + 'DELETE_COOKIES' => 'Delete all board cookies', + 'DELETE_MARKED' => 'Delete marked', + 'DELETE_POST' => 'Delete post', + 'DELIMITER' => 'Delimiter', + 'DESCENDING' => 'Descending', + 'DISABLED' => 'Disabled', + 'DISPLAY' => 'Display', + 'DISPLAY_GUESTS' => 'Display guests', + 'DISPLAY_MESSAGES' => 'Display messages from previous', + 'DISPLAY_POSTS' => 'Display posts from previous', + 'DISPLAY_TOPICS' => 'Display topics from previous', + 'DOWNLOADED' => 'Downloaded', + 'DOWNLOADING_FILE' => 'Downloading file', + 'DOWNLOAD_COUNTS' => array( + 0 => 'Not downloaded yet', + 1 => 'Downloaded %d time', + 2 => 'Downloaded %d times', + ), + + 'EDIT_POST' => 'Edit post', + 'ELLIPSIS' => '…', + 'EMAIL' => 'Email', // Short form for EMAIL_ADDRESS + 'EMAIL_ADDRESS' => 'Email address', + 'EMAIL_INVALID_EMAIL' => 'The email address you entered is invalid.', + 'EMAIL_SMTP_ERROR_RESPONSE' => 'Ran into problems sending email at Line %1$s. Response: %2$s.', + 'EMPTY_SUBJECT' => 'You must specify a subject when posting a new topic.', + 'EMPTY_MESSAGE_SUBJECT' => 'You must specify a subject when composing a new message.', + 'ENABLED' => 'Enabled', + 'ENCLOSURE' => 'Enclosure', + 'ENTER_USERNAME' => 'Enter username', + 'ERR_CHANGING_DIRECTORY' => 'Unable to change directory.', + 'ERR_CONNECTING_SERVER' => 'Error connecting to the server.', + 'ERR_JAB_AUTH' => 'Could not authorise on Jabber server.', + 'ERR_JAB_CONNECT' => 'Could not connect to Jabber server.', + 'ERR_UNABLE_TO_LOGIN' => 'The specified username or password is incorrect.', + 'ERR_UNWATCHING' => 'An error occurred while trying to unsubscribe.', + 'ERR_WATCHING' => 'An error occurred while trying to subscribe.', + 'ERR_WRONG_PATH_TO_PHPBB' => 'The phpBB path specified appears to be invalid.', + 'ERROR' => 'Error', + 'EXPAND_VIEW' => 'Expand view', + 'EXTENSION' => 'Extension', + 'EXTENSION_DISABLED' => 'The extension %s is not enabled.', + 'EXTENSION_DISABLED_AFTER_POSTING' => 'The extension %s has been deactivated and can no longer be displayed.', + 'EXTENSION_DOES_NOT_EXIST' => 'The extension %s does not exist.', + + 'FACEBOOK' => 'Facebook', + 'FAQ' => 'FAQ', + 'FAQ_EXPLAIN' => 'Frequently Asked Questions', + 'FILENAME' => 'Filename', + 'FILESIZE' => 'File size', + 'FILEDATE' => 'File date', + 'FILE_COMMENT' => 'File comment', + 'FILE_CONTENT_ERR' => 'Could not read the contents of file: %s', + 'FILE_JSON_DECODE_ERR' => 'Failed to decode json file: %s', + 'FILE_NOT_FOUND' => 'The requested file could not be found: %s', + 'FIND_USERNAME' => 'Find a member', + 'FOLDER' => 'Folder', + 'FORGOT_PASS' => 'I forgot my password', + 'FORM_INVALID' => 'The submitted form was invalid. Try submitting again.', + 'FORUM' => 'Forum', + 'FORUMS' => 'Forums', + 'FORUMS_MARKED' => 'Forums have been marked read.', + 'FORUM_CAT' => 'Forum category', + 'FORUM_INDEX' => 'Board index', + 'FORUM_LINK' => 'Forum link', + 'FORUM_LOCATION' => 'Forum location', + 'FORUM_LOCKED' => 'Forum locked', + 'FORUM_RULES' => 'Forum rules', + 'FORUM_RULES_LINK' => 'Please click here to view the forum rules', + 'FROM' => 'from', + 'FSOCK_DISABLED' => 'The operation could not be completed because the fsockopen function has been disabled or the server being queried could not be found.', + 'FSOCK_TIMEOUT' => 'A timeout occurred while reading from the network stream.', + + 'FTP_FSOCK_HOST' => 'FTP host', + 'FTP_FSOCK_HOST_EXPLAIN' => 'FTP server used to connect your site.', + 'FTP_FSOCK_PASSWORD' => 'FTP password', + 'FTP_FSOCK_PASSWORD_EXPLAIN' => 'Password for your FTP username.', + 'FTP_FSOCK_PORT' => 'FTP port', + 'FTP_FSOCK_PORT_EXPLAIN' => 'Port used to connect to your server.', + 'FTP_FSOCK_ROOT_PATH' => 'Path to phpBB', + 'FTP_FSOCK_ROOT_PATH_EXPLAIN' => 'Path from the root to your phpBB board.', + 'FTP_FSOCK_TIMEOUT' => 'FTP timeout', + 'FTP_FSOCK_TIMEOUT_EXPLAIN' => 'The amount of time, in seconds, that the system will wait for a reply from your server.', + 'FTP_FSOCK_USERNAME' => 'FTP username', + 'FTP_FSOCK_USERNAME_EXPLAIN' => 'Username used to connect to your server.', + + 'FTP_HOST' => 'FTP host', + 'FTP_HOST_EXPLAIN' => 'FTP server used to connect your site.', + 'FTP_PASSWORD' => 'FTP password', + 'FTP_PASSWORD_EXPLAIN' => 'Password for your FTP username.', + 'FTP_PORT' => 'FTP port', + 'FTP_PORT_EXPLAIN' => 'Port used to connect to your server.', + 'FTP_ROOT_PATH' => 'Path to phpBB', + 'FTP_ROOT_PATH_EXPLAIN' => 'Path from the root to your phpBB board.', + 'FTP_TIMEOUT' => 'FTP timeout', + 'FTP_TIMEOUT_EXPLAIN' => 'The amount of time, in seconds, that the system will wait for a reply from your server.', + 'FTP_USERNAME' => 'FTP username', + 'FTP_USERNAME_EXPLAIN' => 'Username used to connect to your server.', + + 'GENERAL_ERROR' => 'General Error', + 'GB' => 'GB', + 'GIB' => 'GiB', + 'GO' => 'Go', + 'GOOGLEPLUS' => 'Google+', + 'GOTO_FIRST_POST' => 'Go to first post', + 'GOTO_LAST_POST' => 'Go to last post', + 'GOTO_PAGE' => 'Go to page', + 'GROUP' => 'Group', + 'GROUPS' => 'Groups', + 'GROUP_ERR_TYPE' => 'Inappropriate group type specified.', + 'GROUP_ERR_USERNAME' => 'No group name specified.', + 'GROUP_ERR_USER_LONG' => 'Group names cannot exceed 60 characters. The specified group name is too long.', + 'GUEST' => 'Guest', + 'GUEST_USERS_ONLINE' => array( + 1 => 'There is %d guest user online', + 2 => 'There are %d guest users online', + ), + 'GUEST_USERS_TOTAL' => array( + 1 => '%d guest', + 2 => '%d guests', + ), + 'G_ADMINISTRATORS' => 'Administrators', + 'G_BOTS' => 'Bots', + 'G_GUESTS' => 'Guests', + 'G_REGISTERED' => 'Registered users', + 'G_REGISTERED_COPPA' => 'Registered COPPA users', + 'G_GLOBAL_MODERATORS' => 'Global moderators', + 'G_NEWLY_REGISTERED' => 'Newly registered users', + + 'HIDDEN_USERS_ONLINE' => array( + 1 => '%d hidden user', + 2 => '%d hidden users', + ), + 'HIDDEN_USERS_TOTAL' => array( + 1 => '%d hidden', + 2 => '%d hidden', + ), + 'HIDE_GUESTS' => 'Hide guests', + 'HIDE_ME' => 'Hide my online status this session', + 'HOURS' => 'Hours', + 'HOME' => 'Home', + + 'ICQ' => 'ICQ', + 'IF' => 'If', + 'IMAGE' => 'Image', + 'IMAGE_FILETYPE_INVALID' => 'Image file type %d for mimetype %s not supported.', + 'IMAGE_FILETYPE_MISMATCH' => 'Image file type mismatch: expected extension %1$s but extension %2$s given.', + 'IN' => 'in', + 'INDEX' => 'Index page', + 'INFORMATION' => 'Information', + 'INSECURE_REDIRECT' => 'Tried to redirect to potentially insecure url.', + 'INTERESTS' => 'Interests', + 'INVALID_DIGEST_CHALLENGE' => 'Invalid digest challenge.', + 'INVALID_EMAIL_LOG' => '%s possibly an invalid email address?', + 'INVALID_PLURAL_RULE' => 'The chosen plural rule is invalid. Valid values are integers between 0 and 15.', + 'IP' => 'IP', + 'IP_BLACKLISTED' => 'Your IP %1$s has been blocked because it is blacklisted. For details please see %2$s.', + + 'JABBER' => 'Jabber', + 'JOINED' => 'Joined', + 'JUMP_PAGE' => 'Enter the page number you wish to go to', + 'JUMP_TO' => 'Jump to', + 'JUMP_TO_PAGE' => 'Jump to page', + 'JUMP_TO_PAGE_CLICK' => 'Click to jump to page…', + + 'KB' => 'KB', + 'KIB' => 'KiB', + + 'LAST_POST' => 'Last post', + 'LAST_UPDATED' => 'Last updated', + 'LAST_VISIT' => 'Last visit', + 'LDAP_NO_LDAP_EXTENSION' => 'LDAP extension not available.', + 'LDAP_NO_SERVER_CONNECTION' => 'Could not connect to LDAP server.', + 'LDAP_SEARCH_FAILED' => 'An error occurred while searching the LDAP directory.', + 'LEGEND' => 'Legend', + 'LIVE_SEARCHES_NOT_ALLOWED' => 'Live searches are not allowed.', + 'LOADING' => 'Loading', + 'LOCATION' => 'Location', + 'LOCK_POST' => 'Lock post', + 'LOCK_POST_EXPLAIN' => 'Prevent editing', + 'LOCK_TOPIC' => 'Lock topic', + 'LOGIN' => 'Login', + 'LOGIN_CHECK_PM' => 'Log in to check your private messages.', + 'LOGIN_CONFIRMATION' => 'Confirmation of login', + 'LOGIN_CONFIRM_EXPLAIN' => 'To prevent brute forcing accounts the board requires you to enter a confirmation code after a maximum amount of failed logins. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.', // unused + 'LOGIN_ERROR_ATTEMPTS' => 'You exceeded the maximum allowed number of login attempts. In addition to your username and password you now also have to solve the CAPTCHA below.', + 'LOGIN_ERROR_EXTERNAL_AUTH_APACHE' => 'You have not been authenticated by Apache.', + 'LOGIN_ERROR_OAUTH_SERVICE_DOES_NOT_EXIST' => 'A non-existant OAuth service has been requested.', + 'LOGIN_ERROR_PASSWORD' => 'You have specified an incorrect password. Please check your password and try again. If you continue to have problems please contact the %sBoard Administrator%s.', + 'LOGIN_ERROR_PASSWORD_CONVERT' => 'It was not possible to convert your password when updating this bulletin board’s software. Please %srequest a new password%s. If you continue to have problems please contact the %sBoard Administrator%s.', + 'LOGIN_ERROR_USERNAME' => 'You have specified an incorrect username. Please check your username and try again. If you continue to have problems please contact the %sBoard Administrator%s.', + 'LOGIN_FORUM' => 'To view or post in this forum you must enter its password.', + 'LOGIN_INFO' => 'In order to login you must be registered. Registering takes only a few moments but gives you increased capabilities. The board administrator may also grant additional permissions to registered users. Before you register please ensure you are familiar with our terms of use and related policies. Please ensure you read any forum rules as you navigate around the board.', + 'LOGIN_VIEWFORUM' => 'The board requires you to be registered and logged in to view this forum.', + 'LOGIN_EXPLAIN_EDIT' => 'In order to edit posts in this forum you have to be registered and logged in.', + 'LOGIN_EXPLAIN_VIEWONLINE' => 'In order to view the online list you have to be registered and logged in.', + 'LOGIN_REQUIRED' => 'You need to login to perform this action.', + 'LOGOUT' => 'Logout', + 'LOGOUT_USER' => 'Logout [ %s ]', + 'LOG_ME_IN' => 'Remember me', + + 'MAIN' => 'Main', + 'MARK' => 'Mark', + 'MARK_ALL' => 'Mark all', + 'MARK_ALL_READ' => 'Mark all read', + 'MARK_FORUMS_READ' => 'Mark forums read', + 'MARK_READ' => 'Mark read', + 'MARK_SUBFORUMS_READ' => 'Mark subforums read', + 'MB' => 'MB', + 'MIB' => 'MiB', + 'MCP' => 'Moderator Control Panel', + 'MCP_SHORT' => 'MCP', + 'MEMBERLIST' => 'Members', + 'MEMBERLIST_EXPLAIN' => 'View complete list of members', + 'MERGE' => 'Merge', + 'MERGE_POSTS' => 'Move posts', + 'MERGE_TOPIC' => 'Merge topic', + 'MESSAGE' => 'Message', + 'MESSAGES' => 'Messages', + 'MESSAGES_COUNT' => array( + 1 => '%d message', + 2 => '%d messages', + ), + 'MESSAGE_BODY' => 'Message body', + 'MINUTES' => 'Minutes', + 'MODERATE' => 'Moderate', + 'MODERATOR' => 'Moderator', + 'MODERATORS' => 'Moderators', + 'MODULE_NOT_ACCESS' => 'Module not accessible', + 'MODULE_NOT_FIND' => 'Cannot find module %s', + 'MODULE_FILE_INCORRECT_CLASS' => 'Module file %s does not contain correct class [%s]', + 'MONTH' => 'Month', + 'MOVE' => 'Move', + + 'NA' => 'N/A', + 'NEWEST_USER' => 'Our newest member %s', + 'NEW_MESSAGE' => 'New message', + 'NEW_MESSAGES' => 'New messages', + 'NEW_POST' => 'New post', // Not used anymore + 'NEW_POSTS' => 'New posts', // Not used anymore + 'NEXT' => 'Next', // Used in pagination + 'NEXT_STEP' => 'Next', + 'NEVER' => 'Never', + 'NO' => 'No', + 'NO_NOTIFICATIONS' => 'You have no notifications', + 'NOT_ALLOWED_MANAGE_GROUP' => 'You are not allowed to manage this group.', + 'NOT_AUTHORISED' => 'You are not authorised to access this area.', + 'NOT_WATCHING_FORUM' => 'You are no longer subscribed to updates on this forum.', + 'NOT_WATCHING_TOPIC' => 'You are no longer subscribed to this topic.', + 'NOTIFICATIONS' => 'Notifications', + // This applies for NOTIFICATION_BOOKMARK and NOTIFICATION_POST. + // %1$s will return a list of users that's concatenated using "," and "and" - see STRING_LIST + // Once the user count reaches 5 users or more, the list is trimmed using NOTIFICATION_X_OTHERS + // Once the user count reaches 20 users or more, the list is trimmed using NOTIFICATION_MANY_OTHERS + // Examples: + // A replied... + // A and B replied... + // A, B and C replied... + // A, B, C and 2 others replied... + // A, B, C and others replied... + 'NOTIFICATION_BOOKMARK' => array( + 1 => 'Reply from %1$s in bookmarked topic:', + ), + 'NOTIFICATION_FORUM' => 'Forum: %1$s', + 'NOTIFICATION_GROUP_REQUEST' => 'Group request from %1$s to join the group %2$s.', + 'NOTIFICATION_GROUP_REQUEST_APPROVED' => 'Group request approved to join the group %1$s.', + 'NOTIFICATION_PM' => 'Private Message from %1$s:', + 'NOTIFICATION_POST' => array( + 1 => 'Reply from %1$s in topic:', + ), + 'NOTIFICATION_POST_APPROVED' => 'Post approved:', + 'NOTIFICATION_POST_DISAPPROVED' => 'Post disapproved:', + 'NOTIFICATION_POST_IN_QUEUE' => 'Post approval request by %1$s:', + 'NOTIFICATION_QUOTE' => array( + 1 => 'Quoted by %1$s in:', + ), + 'NOTIFICATION_REFERENCE' => '"%1$s"', + 'NOTIFICATION_REASON' => 'Reason: %1$s.', + 'NOTIFICATION_REPORT_PM' => 'Private Message reported by %1$s:', + 'NOTIFICATION_REPORT_POST' => 'Post reported by %1$s:', + 'NOTIFICATION_REPORT_CLOSED' => 'Report closed by %1$s for:', + 'NOTIFICATION_TOPIC' => 'New topic by %1$s:', + 'NOTIFICATION_TOPIC_APPROVED' => 'Topic approved:', + 'NOTIFICATION_TOPIC_DISAPPROVED' => 'Topic disapproved:', + 'NOTIFICATION_TOPIC_IN_QUEUE' => 'Topic approval request by %1$s:', + 'NOTIFICATION_TYPE_NOT_EXIST' => 'The notification type "%s" is missing from the file system.', + 'NOTIFICATION_ADMIN_ACTIVATE_USER' => 'Activation required for newly registered user: “%1$sâ€', + // Used in conjuction with NOTIFICATION_BOOKMARK and NOTIFICATION_POST. + 'NOTIFICATION_MANY_OTHERS' => 'others', + 'NOTIFICATION_X_OTHERS' => array( + 2 => '%d others', + ), + 'NOTIFY_ADMIN' => 'Please notify the board administrator or webmaster.', + 'NOTIFY_ADMIN_EMAIL' => 'Please notify the board administrator or webmaster: %1$s', + 'NO_ACCESS_ATTACHMENT' => 'You are not allowed to access this file.', + 'NO_ACTION' => 'No action specified.', + 'NO_ADMINISTRATORS' => 'There are no administrators.', + 'NO_AUTH_ADMIN' => 'Access to the Administration Control Panel is not allowed as you do not have administrative permissions.', + 'NO_AUTH_ADMIN_USER_DIFFER' => 'You are not able to re-authenticate as a different user.', + 'NO_AUTH_OPERATION' => 'You do not have the necessary permissions to complete this operation.', + 'NO_AVATARS' => 'No avatars currently available', + 'NO_CONNECT_TO_SMTP_HOST' => 'Could not connect to smtp host : %1$s : %2$s', + 'NO_BIRTHDAYS' => 'No birthdays today', + 'NO_EMAIL_MESSAGE' => 'Email message was blank.', + 'NO_EMAIL_RESPONSE_CODE' => 'Could not get mail server response codes.', + 'NO_EMAIL_SUBJECT' => 'No email subject specified.', + 'NO_FORUM' => 'The forum you selected does not exist.', + 'NO_FORUMS' => 'This board has no forums.', + 'NO_GROUP' => 'The requested usergroup does not exist.', + 'NO_GROUP_MEMBERS' => 'This group currently has no members.', + 'NO_IPS_DEFINED' => 'No IP addresses or hostnames defined', + 'NO_MEMBERS' => 'No members found for this search criterion.', + 'NO_MESSAGES' => 'No messages', + 'NO_MODE' => 'No mode specified.', + 'NO_MODERATORS' => 'There are no moderators.', + 'NO_NEW_MESSAGES' => 'No new messages', + 'NO_NEW_POSTS' => 'No new posts', // Not used anymore + 'NO_ONLINE_USERS' => 'No registered users', + 'NO_POSTS' => 'No posts', + 'NO_POSTS_TIME_FRAME' => 'No posts exist inside this topic for the selected time frame.', + 'NO_FEED_ENABLED' => 'Feeds are not available on this board.', + 'NO_FEED' => 'The requested feed is not available.', + 'NO_STYLE_DATA' => 'Could not get style data', + 'NO_SUBJECT' => 'No subject specified', // Used for posts having no subject defined but displayed within management pages. + 'NO_SUCH_SEARCH_MODULE' => 'The specified search backend doesn’t exist.', + 'NO_SUPPORTED_AUTH_METHODS' => 'No supported authentication methods.', + 'NO_TOPIC' => 'The requested topic does not exist.', + 'NO_TOPIC_FORUM' => 'The topic or forum no longer exists.', + 'NO_TOPICS' => 'There are no topics or posts in this forum.', + 'NO_TOPICS_TIME_FRAME' => 'No topics exist inside this forum for the selected time frame.', + 'NO_UNREAD_POSTS' => 'No unread posts', + 'NO_UPLOAD_FORM_FOUND' => 'Upload initiated but no valid file upload form found.', + 'NO_USER' => 'The requested user does not exist.', + 'NO_USERS' => 'The requested users do not exist.', + 'NO_USER_SPECIFIED' => 'No username was specified.', + + // Nullar/Singular/Plural language entry. The key numbers define the number range in which a certain grammatical expression is valid. + 'NUM_ATTACHMENTS' => array( + 1 => '%d attachment', + 2 => '%d attachments', + ), + 'NUM_POSTS_IN_QUEUE' => array( + 0 => 'No posts in queue', // 0 + 1 => '1 post in queue', // 1 + 2 => '%d posts in queue', // 2+ + ), + + 'OCCUPATION' => 'Occupation', + 'OFFLINE' => 'Offline', + 'ONLINE' => 'Online', + 'ONLINE_BUDDIES' => 'Online friends', + // "... :: x registered and y hidden" + 'ONLINE_USERS_TOTAL' => array( + 1 => 'In total there is %1$d user online :: %2$s and %3$s', + 2 => 'In total there are %1$d users online :: %2$s and %3$s', + ), + // "... :: x registered, y hidden and z guests" + 'ONLINE_USERS_TOTAL_GUESTS' => array( + 1 => 'In total there is %1$d user online :: %2$s, %3$s and %4$s', + 2 => 'In total there are %1$d users online :: %2$s, %3$s and %4$s', + ), + 'OPTIONS' => 'Options', + + 'PAGE_OF' => 'Page %1$d of %2$d', + 'PAGE_TITLE_NUMBER' => 'Page %s', + 'PASSWORD' => 'Password', + 'PIXEL' => 'px', + 'PIXELS' => 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', + 'POSTING_MESSAGE' => 'Posting message in %s', + 'POSTING_PRIVATE_MESSAGE' => 'Composing private message', + 'POST' => 'Post', + 'POST_ANNOUNCEMENT' => 'Announce', + 'POST_STICKY' => 'Sticky', + 'POSTED' => 'Posted', + 'POSTED_IN_FORUM' => 'in', + 'POSTED_ON_DATE' => 'on', + 'POSTS' => 'Posts', + 'POSTS_UNAPPROVED' => 'At least one post in this topic has not been approved.', + 'POSTS_UNAPPROVED_FORUM'=> 'At least one post in this forum has not been approved.', + 'POST_BY_AUTHOR' => 'by', + 'POST_BY_FOE' => '%1$s, who is currently on your ignore list, made this post.', + 'POST_DISPLAY' => '%1$sDisplay this post%2$s.', + 'POST_DAY' => '%.2f posts per day', + 'POST_DELETED_ACTION' => 'Deleted post:', + 'POST_DELETED' => 'This post has been deleted.', + 'POST_DELETED_BY' => '%2$s deleted the post by %1$s on %3$s.', + 'POST_DELETED_BY_REASON'=> '%2$s deleted the post by %1$s on %3$s for the following reason: %4$s', + 'POST_DETAILS' => 'Post details', + 'POST_NEW_TOPIC' => 'Post new topic', + 'POST_PCT' => '%.2f%% of all posts', + 'POST_PCT_ACTIVE' => '%.2f%% of user’s posts', + 'POST_PCT_ACTIVE_OWN' => '%.2f%% of your posts', + 'POST_REPLY' => 'Post a reply', + 'POST_REPORTED' => 'Click to view report', + 'POST_SUBJECT' => 'Post subject', + 'POST_TIME' => 'Post time', + 'POST_TOPIC' => 'Post a new topic', + 'POST_UNAPPROVED_ACTION' => 'Post awaiting approval:', + 'POST_UNAPPROVED' => 'This post has not been approved.', + 'POWERED_BY' => 'Powered by %s', + 'PREVIEW' => 'Preview', + 'PREVIOUS' => 'Previous', // Used in pagination + 'PREVIOUS_STEP' => 'Previous', + 'PRIVACY' => 'Privacy policy', + 'PRIVATE_MESSAGE' => 'Private message', + 'PRIVATE_MESSAGES' => 'Private messages', + 'PRIVATE_MESSAGING' => 'Private messaging', + 'PROFILE' => 'User Control Panel', + + 'QUICK_LINKS' => 'Quick links', + + 'RANK' => 'Rank', + 'READING_FORUM' => 'Viewing topics in %s', + 'READING_GLOBAL_ANNOUNCE' => 'Reading global announcement', + 'READING_LINK' => 'Following forum link %s', + 'READING_TOPIC' => 'Reading topic in %s', + 'READ_PROFILE' => 'Profile', + 'REASON' => 'Reason', + 'RECORD_ONLINE_USERS' => 'Most users ever online was %1$s on %2$s', + 'REDIRECT' => 'Redirect', + 'REDIRECTS' => 'Total redirects', + 'REGISTER' => 'Register', + 'REGISTERED_USERS' => 'Registered users:', + // "... and 2 hidden users online" + 'REG_USERS_ONLINE' => array( + 1 => 'There is %1$d registered user and %2$s online', + 2 => 'There are %1$d registered users and %2$s online', + ), + 'REG_USERS_TOTAL' => array( + 1 => '%d registered', + 2 => '%d registered', + ), + 'REMOVE' => 'Remove', + 'REMOVE_INSTALL' => 'Please delete, move or rename the install directory before you use your board. If this directory is still present, only the Administration Control Panel (ACP) will be accessible.', + 'REPLIES' => 'Replies', + 'REPLY_WITH_QUOTE' => 'Reply with quote', + 'REPLYING_GLOBAL_ANNOUNCE' => 'Replying to global announcement', + 'REPLYING_MESSAGE' => 'Replying to message in %s', + 'REPORT_BY' => 'Report by', + 'REPORT_POST' => 'Report this post', + 'REPORTING_POST' => 'Reporting post', + 'RESEND_ACTIVATION' => 'Resend activation email', + 'RESET' => 'Reset', + 'RESTORE_PERMISSIONS' => 'Restore permissions', + 'RETURN_INDEX' => '%sReturn to the index page%s', + 'RETURN_FORUM' => '%sReturn to the forum last visited%s', + 'RETURN_PAGE' => '%sReturn to the previous page%s', + 'RETURN_TOPIC' => '%sReturn to the topic last visited%s', + 'RETURN_TO' => 'Return to “%sâ€', + 'RETURN_TO_INDEX' => 'Return to Board Index', + 'FEED' => 'Feed', + 'FEED_NEWS' => 'News', + 'FEED_TOPICS_ACTIVE' => 'Active Topics', + 'FEED_TOPICS_NEW' => 'New Topics', + 'RULES_ATTACH_CAN' => 'You can post attachments in this forum', + 'RULES_ATTACH_CANNOT' => 'You cannot post attachments in this forum', + 'RULES_DELETE_CAN' => 'You can delete your posts in this forum', + 'RULES_DELETE_CANNOT' => 'You cannot delete your posts in this forum', + 'RULES_DOWNLOAD_CAN' => 'You can download attachments in this forum', + 'RULES_DOWNLOAD_CANNOT' => 'You cannot download attachments in this forum', + 'RULES_EDIT_CAN' => 'You can edit your posts in this forum', + 'RULES_EDIT_CANNOT' => 'You cannot edit your posts in this forum', + 'RULES_LOCK_CAN' => 'You can lock your topics in this forum', + 'RULES_LOCK_CANNOT' => 'You cannot lock your topics in this forum', + 'RULES_POST_CAN' => 'You can post new topics in this forum', + 'RULES_POST_CANNOT' => 'You cannot post new topics in this forum', + 'RULES_REPLY_CAN' => 'You can reply to topics in this forum', + 'RULES_REPLY_CANNOT' => 'You cannot reply to topics in this forum', + 'RULES_VOTE_CAN' => 'You can vote in polls in this forum', + 'RULES_VOTE_CANNOT' => 'You cannot vote in polls in this forum', + + 'SEARCH' => 'Search', + 'SEARCH_MINI' => 'Search…', + 'SEARCH_ADV' => 'Advanced search', + 'SEARCH_ADV_EXPLAIN' => 'View the advanced search options', + 'SEARCH_KEYWORDS' => 'Search for keywords', + 'SEARCHING_FORUMS' => 'Searching forums', + 'SEARCH_ACTIVE_TOPICS' => 'Active topics', + 'SEARCH_FOR' => 'Search for', + 'SEARCH_FORUM' => 'Search this forum…', + 'SEARCH_NEW' => 'New posts', + 'SEARCH_POSTS_BY' => 'Search posts by', + 'SEARCH_SELF' => 'Your posts', + 'SEARCH_TOPIC' => 'Search this topic…', + 'SEARCH_UNANSWERED' => 'Unanswered posts', + 'SEARCH_UNREAD' => 'Unread posts', + 'SEARCH_USER_POSTS' => 'Search user’s posts', + 'SECONDS' => 'Seconds', + 'SEE_ALL' => 'See All', + 'SELECT' => 'Select', + 'SELECT_ALL_CODE' => 'Select all', + 'SELECT_DESTINATION_FORUM' => 'Please select a destination forum', + 'SELECT_FORUM' => 'Select a forum', + 'SEND_EMAIL' => 'Send email', // Used for submit buttons + 'SEND_EMAIL_USER' => 'Send email to %s', + 'SEND_PRIVATE_MESSAGE' => 'Send private message', + 'SETTINGS' => 'Settings', + 'SIGNATURE' => 'Signature', + 'SKIP' => 'Skip to content', + '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_VIEW_ATTACH' => 'You are not authorised to download this attachment.', + 'SORT_BY' => 'Sort by', + 'SORT_JOINED' => 'Joined date', + 'SORT_LOCATION' => 'Location', + 'SORT_RANK' => 'Rank', + 'SORT_POSTS' => 'Posts', + 'SORT_TOPIC_TITLE' => 'Topic title', + 'SORT_USERNAME' => 'Username', + 'SPLIT_TOPIC' => 'Split topic', + 'SQL_ERROR_OCCURRED' => 'An SQL error occurred while fetching this page. Please contact the %sBoard Administrator%s if this problem persists.', + 'STATISTICS' => 'Statistics', + 'START_WATCHING_FORUM' => 'Subscribe forum', + 'START_WATCHING_TOPIC' => 'Subscribe topic', + 'STOP_WATCHING_FORUM' => 'Unsubscribe forum', + 'STOP_WATCHING_TOPIC' => 'Unsubscribe topic', + 'STRING_LIST_MULTI' => '%1$s, and %2$s', + 'STRING_LIST_SIMPLE' => '%1$s and %2$s', + 'SUBFORUM' => 'Subforum', + 'SUBFORUMS' => 'Subforums', + 'SUBJECT' => 'Subject', + 'SUBMIT' => 'Submit', + + 'TB' => 'TB', + 'TERMS_USE' => 'Terms of use', + 'TEST_CONNECTION' => 'Test connection', + 'THE_TEAM' => 'The team', + 'TIB' => 'TiB', + 'TIME' => 'Time', + 'TIMEOUT_PROCESSING_REQ' => 'Request timed out.', + + 'TOO_LARGE' => 'The value you entered is too large.', + 'TOO_LARGE_MAX_RECIPIENTS' => 'The value of Maximum number of allowed recipients per private message setting you entered is too large.', + + 'TOO_LONG' => 'The value you entered is too long.', + + 'TOO_LONG_CONFIRM_CODE' => 'The confirm code you entered is too long.', + 'TOO_LONG_DATEFORMAT' => 'The date format you entered is too long.', + 'TOO_LONG_JABBER' => 'The Jabber account name you entered is too long.', + 'TOO_LONG_NEW_PASSWORD' => 'The password you entered is too long.', + 'TOO_LONG_PASSWORD_CONFIRM' => 'The password confirmation you entered is too long.', + 'TOO_LONG_USER_PASSWORD' => 'The password you entered is too long.', + 'TOO_LONG_USERNAME' => 'The username you entered is too long.', + 'TOO_LONG_EMAIL' => 'The email address you entered is too long.', + + 'TOO_MANY_VOTE_OPTIONS' => 'You have tried to vote for too many options.', + + 'TOO_SHORT' => 'The value you entered is too short.', + + 'TOO_SHORT_CONFIRM_CODE' => 'The confirm code you entered is too short.', + 'TOO_SHORT_DATEFORMAT' => 'The date format you entered is too short.', + 'TOO_SHORT_JABBER' => 'The Jabber account name you entered is too short.', + 'TOO_SHORT_NEW_PASSWORD' => 'The password you entered is too short.', + 'TOO_SHORT_PASSWORD_CONFIRM' => 'The password confirmation you entered is too short.', + 'TOO_SHORT_USER_PASSWORD' => 'The password you entered is too short.', + 'TOO_SHORT_USERNAME' => 'The username you entered is too short.', + 'TOO_SHORT_EMAIL' => 'The email address you entered is too short.', + 'TOO_SHORT_EMAIL_CONFIRM' => 'The email address confirmation you entered is too short.', + 'TOO_SMALL' => 'The value you entered is too small.', + 'TOO_SMALL_MAX_RECIPIENTS' => 'The value of Maximum number of allowed recipients per private message setting you entered is too small.', + + 'TOPIC' => 'Topic', + 'TOPICS' => 'Topics', + 'TOPICS_UNAPPROVED' => 'At least one topic in this forum has not been approved.', + 'TOPIC_ICON' => 'Topic icon', + 'TOPIC_LOCKED' => 'This topic is locked, you cannot edit posts or make further replies.', + 'TOPIC_LOCKED_SHORT'=> 'Topic locked', + 'TOPIC_MOVED' => 'Moved topic', + 'TOPIC_REVIEW' => 'Topic review', + 'TOPIC_TITLE' => 'Topic title', + 'TOPIC_UNAPPROVED' => 'This topic has not been approved.', + 'TOPIC_DELETED' => 'This topic has been deleted.', + 'TOTAL_ATTACHMENTS' => 'Attachment(s)', + 'TOTAL_LOGS' => array( + 1 => '%d log', + 2 => '%d logs', + ), + 'TOTAL_PMS' => array( + 1 => '%d private message in total', + 2 => '%d private messages in total', + ), + 'TOPIC_POLL' => 'This topic has a poll.', + 'TOTAL_POSTS' => 'Total posts', + 'TOTAL_POSTS_COUNT' => array( + 2 => 'Total posts %d', + ), + 'TOPIC_REPORTED' => 'This topic has been reported', + 'TOTAL_TOPICS' => array( + 2 => 'Total topics %d', + ), + 'TOTAL_USERS' => array( + 2 => 'Total members %d', + ), + 'TRACKED_PHP_ERROR' => 'Tracked PHP errors: %s', + 'TWITTER' => 'Twitter', + + 'UNABLE_GET_IMAGE_SIZE' => 'It was not possible to determine the dimensions of the image. Please verify that the URL you entered is correct.', + 'UNABLE_TO_DELIVER_FILE'=> 'Unable to deliver file.', + 'UNKNOWN_BROWSER' => 'Unknown browser', + 'UNMARK_ALL' => 'Unmark all', + 'UNREAD_MESSAGES' => 'Unread messages', + 'UNREAD_POST' => 'Unread post', + 'UNREAD_POSTS' => 'Unread posts', + 'UNWATCH_FORUM_CONFIRM' => 'Are you sure you wish to unsubscribe from this forum?', + 'UNWATCH_FORUM_DETAILED' => 'Are you sure you wish to unsubscribe from the forum “%sâ€?', + 'UNWATCH_TOPIC_CONFIRM' => 'Are you sure you wish to unsubscribe from this topic?', + 'UNWATCH_TOPIC_DETAILED' => 'Are you sure you wish to unsubscribe from the topic “%sâ€?', + 'UNWATCHED_FORUMS' => 'You are no longer subscribed to the selected forums.', + 'UNWATCHED_TOPICS' => 'You are no longer subscribed to the selected topics.', + 'UNWATCHED_FORUMS_TOPICS' => 'You are no longer subscribed to the selected entries.', + 'UPDATE' => 'Update', + 'UPLOAD_IN_PROGRESS' => 'The upload is currently in progress.', + 'URL_REDIRECT' => 'If your browser does not support meta redirection %splease click HERE to be redirected%s.', + 'USERGROUPS' => 'Groups', + 'USERNAME' => 'Username', + 'USERNAMES' => 'Usernames', + 'USER_AVATAR' => 'User avatar', + 'USER_CANNOT_READ' => 'You cannot read posts in this forum.', + 'USER_POSTS' => array( + 1 => '%d Post', + 2 => '%d Posts', + ), + 'USERS' => 'Users', + 'USE_PERMISSIONS' => 'Test out user’s permissions', + + 'USER_NEW_PERMISSION_DISALLOWED' => 'We are sorry, but you are not authorised to use this feature. You may have just registered here and may need to participate more to be able to use this feature.', + + 'VARIANT_DATE_SEPARATOR' => ' / ', // Used in date format dropdown, eg: "Today, 13:37 / 01 Jan 2007, 13:37" ... to join a relative date with calendar date + 'VIEWED' => 'Viewed', + 'VIEWED_COUNTS' => array( + 0 => 'Not viewed yet', + 1 => 'Viewed %d time', + 2 => 'Viewed %d times', + ), + 'VIEWING_CONTACT_ADMIN' => 'Viewing contact page', + 'VIEWING_FAQ' => 'Viewing FAQ', + 'VIEWING_MEMBERS' => 'Viewing member details', + 'VIEWING_ONLINE' => 'Viewing who is online', + 'VIEWING_MCP' => 'Viewing moderator control panel', + 'VIEWING_MEMBER_PROFILE' => 'Viewing member profile', + 'VIEWING_PRIVATE_MESSAGES' => 'Viewing private messages', + 'VIEWING_REGISTER' => 'Registering account', + 'VIEWING_UCP' => 'Viewing user control panel', + 'VIEWS' => 'Views', + 'VIEW_BOOKMARKS' => 'View bookmarks', + 'VIEW_FORUM_LOGS' => 'View Logs', + 'VIEW_LATEST_POST' => 'View the latest post', + 'VIEW_NEWEST_POST' => 'View first unread post', + 'VIEW_NOTES' => 'View user notes', + 'VIEW_ONLINE_TIMES' => array( + 1 => 'based on users active over the past %d minute', + 2 => 'based on users active over the past %d minutes', + ), + 'VIEW_TOPIC' => 'View topic', + 'VIEW_TOPIC_ANNOUNCEMENT' => 'Announcement: ', + 'VIEW_TOPIC_GLOBAL' => 'Global Announcement: ', + 'VIEW_TOPIC_LOCKED' => 'Locked: ', + 'VIEW_TOPIC_LOGS' => 'View logs', + 'VIEW_TOPIC_MOVED' => 'Moved: ', + 'VIEW_TOPIC_POLL' => 'Poll: ', + 'VIEW_TOPIC_STICKY' => 'Sticky: ', + 'VISIT_WEBSITE' => 'Visit website', + + 'WARNINGS' => 'Warnings', + 'WARN_USER' => 'Warn user', + 'WATCH_FORUM_CONFIRM' => 'Are you sure you wish to subscribe to this forum?', + 'WATCH_FORUM_DETAILED' => 'Are you sure you wish to subscribe to the forum “%sâ€?', + 'WATCH_TOPIC_CONFIRM' => 'Are you sure you wish to subscribe to this topic?', + 'WATCH_TOPIC_DETAILED' => 'Are you sure you wish to subscribe to the topic “%sâ€?', + 'WELCOME_SUBJECT' => 'Welcome to %s forums', + 'WEBSITE' => 'Website', + 'WHOIS' => 'Whois', + 'WHO_IS_ONLINE' => 'Who is online', + 'WLM' => 'WLM', + 'WRONG_PASSWORD' => 'You entered an incorrect password.', + + 'WRONG_DATA_COLOUR' => 'The colour value you entered is invalid.', + 'WRONG_DATA_JABBER' => 'The name you entered is not a valid Jabber account name.', + 'WRONG_DATA_LANG' => 'The language you specified is not valid.', + 'WRONG_DATA_POST_SD' => 'The post sort direction you specified is not valid.', + 'WRONG_DATA_POST_SK' => 'The post sort option you specified is not valid.', + 'WRONG_DATA_TOPIC_SD' => 'The topic sort direction you specified is not valid.', + 'WRONG_DATA_TOPIC_SK' => 'The topic sort option you specified is not valid.', + 'WROTE' => 'wrote', + + 'YAHOO' => 'Yahoo Messenger', + 'YOUTUBE' => 'YouTube', + 'YEAR' => 'Year', + 'YEAR_MONTH_DAY' => '(YYYY-MM-DD)', + 'YES' => 'Yes', + 'YOU_LAST_VISIT' => 'Last visit was: %s', + + 'datetime' => array( + 'TODAY' => 'Today', + 'TOMORROW' => 'Tomorrow', + 'YESTERDAY' => 'Yesterday', + 'AGO' => array( + 0 => 'less than a minute ago', + 1 => '%d minute ago', + 2 => '%d minutes ago', + ), + + 'Sunday' => 'Sunday', + 'Monday' => 'Monday', + 'Tuesday' => 'Tuesday', + 'Wednesday' => 'Wednesday', + 'Thursday' => 'Thursday', + 'Friday' => 'Friday', + 'Saturday' => 'Saturday', + + 'Sun' => 'Sun', + 'Mon' => 'Mon', + 'Tue' => 'Tue', + 'Wed' => 'Wed', + 'Thu' => 'Thu', + 'Fri' => 'Fri', + 'Sat' => 'Sat', + + 'January' => 'January', + 'February' => 'February', + 'March' => 'March', + 'April' => 'April', + 'May' => 'May', + 'June' => 'June', + 'July' => 'July', + 'August' => 'August', + 'September' => 'September', + 'October' => 'October', + 'November' => 'November', + 'December' => 'December', + + 'Jan' => 'Jan', + 'Feb' => 'Feb', + 'Mar' => 'Mar', + 'Apr' => 'Apr', + 'May_short' => 'May', // Short representation of "May". May_short used because in English the short and long date are the same for May. + 'Jun' => 'Jun', + 'Jul' => 'Jul', + 'Aug' => 'Aug', + 'Sep' => 'Sep', + 'Oct' => 'Oct', + 'Nov' => 'Nov', + 'Dec' => 'Dec', + ), + + // Timezones can be translated. We use this for the Etc/GMT timezones here, + // because they are named invers to their offset. + 'timezones' => array( + 'UTC' => 'UTC', + 'UTC_OFFSET' => 'UTC%1$s', + 'UTC_OFFSET_CURRENT' => 'UTC%1$s - %2$s', + + 'Etc/GMT-12' => 'UTC+12', + 'Etc/GMT-11' => 'UTC+11', + 'Etc/GMT-10' => 'UTC+10', + 'Etc/GMT-9' => 'UTC+9', + 'Etc/GMT-8' => 'UTC+8', + 'Etc/GMT-7' => 'UTC+7', + 'Etc/GMT-6' => 'UTC+6', + 'Etc/GMT-5' => 'UTC+5', + 'Etc/GMT-4' => 'UTC+4', + 'Etc/GMT-3' => 'UTC+3', + 'Etc/GMT-2' => 'UTC+2', + 'Etc/GMT-1' => 'UTC+1', + 'Etc/GMT+1' => 'UTC-1', + 'Etc/GMT+2' => 'UTC-2', + 'Etc/GMT+3' => 'UTC-3', + 'Etc/GMT+4' => 'UTC-4', + 'Etc/GMT+5' => 'UTC-5', + 'Etc/GMT+6' => 'UTC-6', + 'Etc/GMT+7' => 'UTC-7', + 'Etc/GMT+8' => 'UTC-8', + 'Etc/GMT+9' => 'UTC-9', + 'Etc/GMT+10' => 'UTC-10', + 'Etc/GMT+11' => 'UTC-11', + 'Etc/GMT+12' => 'UTC-12', + + 'Africa/Abidjan' => 'Africa/Abidjan', + 'Africa/Accra' => 'Africa/Accra', + 'Africa/Addis_Ababa' => 'Africa/Addis Ababa', + 'Africa/Algiers' => 'Africa/Algiers', + 'Africa/Asmara' => 'Africa/Asmara', + 'Africa/Bamako' => 'Africa/Bamako', + 'Africa/Bangui' => 'Africa/Bangui', + 'Africa/Banjul' => 'Africa/Banjul', + 'Africa/Bissau' => 'Africa/Bissau', + 'Africa/Blantyre' => 'Africa/Blantyre', + 'Africa/Brazzaville' => 'Africa/Brazzaville', + 'Africa/Bujumbura' => 'Africa/Bujumbura', + 'Africa/Cairo' => 'Africa/Cairo', + 'Africa/Casablanca' => 'Africa/Casablanca', + 'Africa/Ceuta' => 'Africa/Ceuta', + 'Africa/Conakry' => 'Africa/Conakry', + 'Africa/Dakar' => 'Africa/Dakar', + 'Africa/Dar_es_Salaam' => 'Africa/Dar es Salaam', + 'Africa/Djibouti' => 'Africa/Djibouti', + 'Africa/Douala' => 'Africa/Douala', + 'Africa/El_Aaiun' => 'Africa/El Aaiun', + 'Africa/Freetown' => 'Africa/Freetown', + 'Africa/Gaborone' => 'Africa/Gaborone', + 'Africa/Harare' => 'Africa/Harare', + 'Africa/Johannesburg' => 'Africa/Johannesburg', + 'Africa/Juba' => 'Africa/Juba', + 'Africa/Kampala' => 'Africa/Kampala', + 'Africa/Khartoum' => 'Africa/Khartoum', + 'Africa/Kigali' => 'Africa/Kigali', + 'Africa/Kinshasa' => 'Africa/Kinshasa', + 'Africa/Lagos' => 'Africa/Lagos', + 'Africa/Libreville' => 'Africa/Libreville', + 'Africa/Lome' => 'Africa/Lome', + 'Africa/Luanda' => 'Africa/Luanda', + 'Africa/Lubumbashi' => 'Africa/Lubumbashi', + 'Africa/Lusaka' => 'Africa/Lusaka', + 'Africa/Malabo' => 'Africa/Malabo', + 'Africa/Maputo' => 'Africa/Maputo', + 'Africa/Maseru' => 'Africa/Maseru', + 'Africa/Mbabane' => 'Africa/Mbabane', + 'Africa/Mogadishu' => 'Africa/Mogadishu', + 'Africa/Monrovia' => 'Africa/Monrovia', + 'Africa/Nairobi' => 'Africa/Nairobi', + 'Africa/Ndjamena' => 'Africa/Ndjamena', + 'Africa/Niamey' => 'Africa/Niamey', + 'Africa/Nouakchott' => 'Africa/Nouakchott', + 'Africa/Ouagadougou' => 'Africa/Ouagadougou', + 'Africa/Porto-Novo' => 'Africa/Porto-Novo', + 'Africa/Sao_Tome' => 'Africa/Sao Tome', + 'Africa/Tripoli' => 'Africa/Tripoli', + 'Africa/Tunis' => 'Africa/Tunis', + 'Africa/Windhoek' => 'Africa/Windhoek', + + 'America/Adak' => 'America/Adak', + 'America/Anchorage' => 'America/Anchorage', + 'America/Anguilla' => 'America/Anguilla', + 'America/Antigua' => 'America/Antigua', + 'America/Araguaina' => 'America/Araguaina', + + 'America/Argentina/Buenos_Aires' => 'America/Argentina/Buenos Aires', + 'America/Argentina/Catamarca' => 'America/Argentina/Catamarca', + 'America/Argentina/Cordoba' => 'America/Argentina/Cordoba', + 'America/Argentina/Jujuy' => 'America/Argentina/Jujuy', + 'America/Argentina/La_Rioja' => 'America/Argentina/La Rioja', + 'America/Argentina/Mendoza' => 'America/Argentina/Mendoza', + 'America/Argentina/Rio_Gallegos' => 'America/Argentina/Rio Gallegos', + 'America/Argentina/Salta' => 'America/Argentina/Salta', + 'America/Argentina/San_Juan' => 'America/Argentina/San Juan', + 'America/Argentina/San_Luis' => 'America/Argentina/San Luis', + 'America/Argentina/Tucuman' => 'America/Argentina/Tucuman', + 'America/Argentina/Ushuaia' => 'America/Argentina/Ushuaia', + + 'America/Aruba' => 'America/Aruba', + 'America/Asuncion' => 'America/Asuncion', + 'America/Atikokan' => 'America/Atikokan', + 'America/Bahia' => 'America/Bahia', + 'America/Bahia_Banderas' => 'America/Bahia Banderas', + 'America/Barbados' => 'America/Barbados', + 'America/Belem' => 'America/Belem', + 'America/Belize' => 'America/Belize', + 'America/Blanc-Sablon' => 'America/Blanc-Sablon', + 'America/Boa_Vista' => 'America/Boa Vista', + 'America/Bogota' => 'America/Bogota', + 'America/Boise' => 'America/Boise', + 'America/Cambridge_Bay' => 'America/Cambridge Bay', + 'America/Campo_Grande' => 'America/Campo Grande', + 'America/Cancun' => 'America/Cancun', + 'America/Caracas' => 'America/Caracas', + 'America/Cayenne' => 'America/Cayenne', + 'America/Cayman' => 'America/Cayman', + 'America/Chicago' => 'America/Chicago', + 'America/Chihuahua' => 'America/Chihuahua', + 'America/Costa_Rica' => 'America/Costa Rica', + 'America/Creston' => 'America/Creston', + 'America/Cuiaba' => 'America/Cuiaba', + 'America/Curacao' => 'America/Curacao', + 'America/Danmarkshavn' => 'America/Danmarkshavn', + 'America/Dawson' => 'America/Dawson', + 'America/Dawson_Creek' => 'America/Dawson Creek', + 'America/Denver' => 'America/Denver', + 'America/Detroit' => 'America/Detroit', + 'America/Dominica' => 'America/Dominica', + 'America/Edmonton' => 'America/Edmonton', + 'America/Eirunepe' => 'America/Eirunepe', + 'America/El_Salvador' => 'America/El Salvador', + 'America/Fortaleza' => 'America/Fortaleza', + 'America/Glace_Bay' => 'America/Glace Bay', + 'America/Godthab' => 'America/Godthab', + 'America/Goose_Bay' => 'America/Goose Bay', + 'America/Grand_Turk' => 'America/Grand Turk', + 'America/Grenada' => 'America/Grenada', + 'America/Guadeloupe' => 'America/Guadeloupe', + 'America/Guatemala' => 'America/Guatemala', + 'America/Guayaquil' => 'America/Guayaquil', + 'America/Guyana' => 'America/Guyana', + 'America/Halifax' => 'America/Halifax', + 'America/Havana' => 'America/Havana', + 'America/Hermosillo' => 'America/Hermosillo', + 'America/Indiana/Indianapolis' => 'America/Indiana/Indianapolis', + 'America/Indiana/Knox' => 'America/Indiana/Knox', + 'America/Indiana/Marengo' => 'America/Indiana/Marengo', + 'America/Indiana/Petersburg' => 'America/Indiana/Petersburg', + 'America/Indiana/Tell_City' => 'America/Indiana/Tell City', + 'America/Indiana/Vevay' => 'America/Indiana/Vevay', + 'America/Indiana/Vincennes' => 'America/Indiana/Vincennes', + 'America/Indiana/Winamac' => 'America/Indiana/Winamac', + 'America/Inuvik' => 'America/Inuvik', + 'America/Iqaluit' => 'America/Iqaluit', + 'America/Jamaica' => 'America/Jamaica', + 'America/Juneau' => 'America/Juneau', + 'America/Kentucky/Louisville' => 'America/Kentucky/Louisville', + 'America/Kentucky/Monticello' => 'America/Kentucky/Monticello', + 'America/Kralendijk' => 'America/Kralendijk', + 'America/La_Paz' => 'America/La Paz', + 'America/Lima' => 'America/Lima', + 'America/Los_Angeles' => 'America/Los Angeles', + 'America/Lower_Princes' => 'America/Lower Princes', + 'America/Maceio' => 'America/Maceio', + 'America/Managua' => 'America/Managua', + 'America/Manaus' => 'America/Manaus', + 'America/Marigot' => 'America/Marigot', + 'America/Martinique' => 'America/Martinique', + 'America/Matamoros' => 'America/Matamoros', + 'America/Mazatlan' => 'America/Mazatlan', + 'America/Menominee' => 'America/Menominee', + 'America/Merida' => 'America/Merida', + 'America/Metlakatla' => 'America/Metlakatla', + 'America/Mexico_City' => 'America/Mexico City', + 'America/Miquelon' => 'America/Miquelon', + 'America/Moncton' => 'America/Moncton', + 'America/Monterrey' => 'America/Monterrey', + 'America/Montevideo' => 'America/Montevideo', + 'America/Montreal' => 'America/Montreal', + 'America/Montserrat' => 'America/Montserrat', + 'America/Nassau' => 'America/Nassau', + 'America/New_York' => 'America/New York', + 'America/Nipigon' => 'America/Nipigon', + 'America/Nome' => 'America/Nome', + 'America/Noronha' => 'America/Noronha', + 'America/North_Dakota/Beulah' => 'America/North Dakota/Beulah', + 'America/North_Dakota/Center' => 'America/North Dakota/Center', + 'America/North_Dakota/New_Salem' => 'America/North Dakota/New Salem', + 'America/Ojinaga' => 'America/Ojinaga', + 'America/Panama' => 'America/Panama', + 'America/Pangnirtung' => 'America/Pangnirtung', + 'America/Paramaribo' => 'America/Paramaribo', + 'America/Phoenix' => 'America/Phoenix', + 'America/Port-au-Prince' => 'America/Port-au-Prince', + 'America/Port_of_Spain' => 'America/Port of Spain', + 'America/Porto_Velho' => 'America/Porto Velho', + 'America/Puerto_Rico' => 'America/Puerto Rico', + 'America/Rainy_River' => 'America/Rainy River', + 'America/Rankin_Inlet' => 'America/Rankin Inlet', + 'America/Recife' => 'America/Recife', + 'America/Regina' => 'America/Regina', + 'America/Resolute' => 'America/Resolute', + 'America/Rio_Branco' => 'America/Rio Branco', + 'America/Santa_Isabel' => 'America/Santa Isabel', + 'America/Santarem' => 'America/Santarem', + 'America/Santiago' => 'America/Santiago', + 'America/Santo_Domingo' => 'America/Santo Domingo', + 'America/Sao_Paulo' => 'America/Sao Paulo', + 'America/Scoresbysund' => 'America/Scoresbysund', + 'America/Shiprock' => 'America/Shiprock', + 'America/Sitka' => 'America/Sitka', + 'America/St_Barthelemy' => 'America/St. Barthelemy', + 'America/St_Johns' => 'America/St. Johns', + 'America/St_Kitts' => 'America/St. Kitts', + 'America/St_Lucia' => 'America/St. Lucia', + 'America/St_Thomas' => 'America/St. Thomas', + 'America/St_Vincent' => 'America/St. Vincent', + 'America/Swift_Current' => 'America/Swift Current', + 'America/Tegucigalpa' => 'America/Tegucigalpa', + 'America/Thule' => 'America/Thule', + 'America/Thunder_Bay' => 'America/Thunder Bay', + 'America/Tijuana' => 'America/Tijuana', + 'America/Toronto' => 'America/Toronto', + 'America/Tortola' => 'America/Tortola', + 'America/Vancouver' => 'America/Vancouver', + 'America/Whitehorse' => 'America/Whitehorse', + 'America/Winnipeg' => 'America/Winnipeg', + 'America/Yakutat' => 'America/Yakutat', + 'America/Yellowknife' => 'America/Yellowknife', + + 'Antarctica/Casey' => 'Antarctica/Casey', + 'Antarctica/Davis' => 'Antarctica/Davis', + 'Antarctica/DumontDUrville' => 'Antarctica/DumontDUrville', + 'Antarctica/Macquarie' => 'Antarctica/Macquarie', + 'Antarctica/Mawson' => 'Antarctica/Mawson', + 'Antarctica/McMurdo' => 'Antarctica/McMurdo', + 'Antarctica/Palmer' => 'Antarctica/Palmer', + 'Antarctica/Rothera' => 'Antarctica/Rothera', + 'Antarctica/South_Pole' => 'Antarctica/South Pole', + 'Antarctica/Syowa' => 'Antarctica/Syowa', + 'Antarctica/Vostok' => 'Antarctica/Vostok', + + 'Arctic/Longyearbyen' => 'Arctic/Longyearbyen', + + 'Asia/Aden' => 'Asia/Aden', + 'Asia/Almaty' => 'Asia/Almaty', + 'Asia/Amman' => 'Asia/Amman', + 'Asia/Anadyr' => 'Asia/Anadyr', + 'Asia/Aqtau' => 'Asia/Aqtau', + 'Asia/Aqtobe' => 'Asia/Aqtobe', + 'Asia/Ashgabat' => 'Asia/Ashgabat', + 'Asia/Baghdad' => 'Asia/Baghdad', + 'Asia/Bahrain' => 'Asia/Bahrain', + 'Asia/Baku' => 'Asia/Baku', + 'Asia/Bangkok' => 'Asia/Bangkok', + 'Asia/Beirut' => 'Asia/Beirut', + 'Asia/Bishkek' => 'Asia/Bishkek', + 'Asia/Brunei' => 'Asia/Brunei', + 'Asia/Choibalsan' => 'Asia/Choibalsan', + 'Asia/Chongqing' => 'Asia/Chongqing', + 'Asia/Colombo' => 'Asia/Colombo', + 'Asia/Damascus' => 'Asia/Damascus', + 'Asia/Dhaka' => 'Asia/Dhaka', + 'Asia/Dili' => 'Asia/Dili', + 'Asia/Dubai' => 'Asia/Dubai', + 'Asia/Dushanbe' => 'Asia/Dushanbe', + 'Asia/Gaza' => 'Asia/Gaza', + 'Asia/Harbin' => 'Asia/Harbin', + 'Asia/Hebron' => 'Asia/Hebron', + 'Asia/Ho_Chi_Minh' => 'Asia/Ho Chi Minh', + 'Asia/Hong_Kong' => 'Asia/Hong Kong', + 'Asia/Hovd' => 'Asia/Hovd', + 'Asia/Irkutsk' => 'Asia/Irkutsk', + 'Asia/Jakarta' => 'Asia/Jakarta', + 'Asia/Jayapura' => 'Asia/Jayapura', + 'Asia/Jerusalem' => 'Asia/Jerusalem', + 'Asia/Kabul' => 'Asia/Kabul', + 'Asia/Kamchatka' => 'Asia/Kamchatka', + 'Asia/Karachi' => 'Asia/Karachi', + 'Asia/Kashgar' => 'Asia/Kashgar', + 'Asia/Kathmandu' => 'Asia/Kathmandu', + 'Asia/Khandyga' => 'Asia/Khandyga', + 'Asia/Kolkata' => 'Asia/Kolkata', + 'Asia/Krasnoyarsk' => 'Asia/Krasnoyarsk', + 'Asia/Kuala_Lumpur' => 'Asia/Kuala Lumpur', + 'Asia/Kuching' => 'Asia/Kuching', + 'Asia/Kuwait' => 'Asia/Kuwait', + 'Asia/Macau' => 'Asia/Macau', + 'Asia/Magadan' => 'Asia/Magadan', + 'Asia/Makassar' => 'Asia/Makassar', + 'Asia/Manila' => 'Asia/Manila', + 'Asia/Muscat' => 'Asia/Muscat', + 'Asia/Nicosia' => 'Asia/Nicosia', + 'Asia/Novokuznetsk' => 'Asia/Novokuznetsk', + 'Asia/Novosibirsk' => 'Asia/Novosibirsk', + 'Asia/Omsk' => 'Asia/Omsk', + 'Asia/Oral' => 'Asia/Oral', + 'Asia/Phnom_Penh' => 'Asia/Phnom Penh', + 'Asia/Pontianak' => 'Asia/Pontianak', + 'Asia/Pyongyang' => 'Asia/Pyongyang', + 'Asia/Qatar' => 'Asia/Qatar', + 'Asia/Qyzylorda' => 'Asia/Qyzylorda', + 'Asia/Rangoon' => 'Asia/Rangoon', + 'Asia/Riyadh' => 'Asia/Riyadh', + 'Asia/Sakhalin' => 'Asia/Sakhalin', + 'Asia/Samarkand' => 'Asia/Samarkand', + 'Asia/Seoul' => 'Asia/Seoul', + 'Asia/Shanghai' => 'Asia/Shanghai', + 'Asia/Singapore' => 'Asia/Singapore', + 'Asia/Taipei' => 'Asia/Taipei', + 'Asia/Tashkent' => 'Asia/Tashkent', + 'Asia/Tbilisi' => 'Asia/Tbilisi', + 'Asia/Tehran' => 'Asia/Tehran', + 'Asia/Thimphu' => 'Asia/Thimphu', + 'Asia/Tokyo' => 'Asia/Tokyo', + 'Asia/Ulaanbaatar' => 'Asia/Ulaanbaatar', + 'Asia/Urumqi' => 'Asia/Urumqi', + 'Asia/Ust-Nera' => 'Asia/Ust-Nera', + 'Asia/Vientiane' => 'Asia/Vientiane', + 'Asia/Vladivostok' => 'Asia/Vladivostok', + 'Asia/Yakutsk' => 'Asia/Yakutsk', + 'Asia/Yekaterinburg' => 'Asia/Yekaterinburg', + 'Asia/Yerevan' => 'Asia/Yerevan', + + 'Atlantic/Azores' => 'Atlantic/Azores', + 'Atlantic/Bermuda' => 'Atlantic/Bermuda', + 'Atlantic/Canary' => 'Atlantic/Canary', + 'Atlantic/Cape_Verde' => 'Atlantic/Cape Verde', + 'Atlantic/Faroe' => 'Atlantic/Faroe', + 'Atlantic/Madeira' => 'Atlantic/Madeira', + 'Atlantic/Reykjavik' => 'Atlantic/Reykjavik', + 'Atlantic/South_Georgia' => 'Atlantic/South Georgia', + 'Atlantic/St_Helena' => 'Atlantic/St. Helena', + 'Atlantic/Stanley' => 'Atlantic/Stanley', + + 'Australia/Adelaide' => 'Australia/Adelaide', + 'Australia/Brisbane' => 'Australia/Brisbane', + 'Australia/Broken_Hill' => 'Australia/Broken Hill', + 'Australia/Currie' => 'Australia/Currie', + 'Australia/Darwin' => 'Australia/Darwin', + 'Australia/Eucla' => 'Australia/Eucla', + 'Australia/Hobart' => 'Australia/Hobart', + 'Australia/Lindeman' => 'Australia/Lindeman', + 'Australia/Lord_Howe' => 'Australia/Lord Howe', + 'Australia/Melbourne' => 'Australia/Melbourne', + 'Australia/Perth' => 'Australia/Perth', + 'Australia/Sydney' => 'Australia/Sydney', + + 'Europe/Amsterdam' => 'Europe/Amsterdam', + 'Europe/Andorra' => 'Europe/Andorra', + 'Europe/Athens' => 'Europe/Athens', + 'Europe/Belgrade' => 'Europe/Belgrade', + 'Europe/Berlin' => 'Europe/Berlin', + 'Europe/Bratislava' => 'Europe/Bratislava', + 'Europe/Brussels' => 'Europe/Brussels', + 'Europe/Bucharest' => 'Europe/Bucharest', + 'Europe/Budapest' => 'Europe/Budapest', + 'Europe/Busingen' => 'Europe/Busingen', + 'Europe/Chisinau' => 'Europe/Chisinau', + 'Europe/Copenhagen' => 'Europe/Copenhagen', + 'Europe/Dublin' => 'Europe/Dublin', + 'Europe/Gibraltar' => 'Europe/Gibraltar', + 'Europe/Guernsey' => 'Europe/Guernsey', + 'Europe/Helsinki' => 'Europe/Helsinki', + 'Europe/Isle_of_Man' => 'Europe/Isle of Man', + 'Europe/Istanbul' => 'Europe/Istanbul', + 'Europe/Jersey' => 'Europe/Jersey', + 'Europe/Kaliningrad' => 'Europe/Kaliningrad', + 'Europe/Kiev' => 'Europe/Kiev', + 'Europe/Lisbon' => 'Europe/Lisbon', + 'Europe/Ljubljana' => 'Europe/Ljubljana', + 'Europe/London' => 'Europe/London', + 'Europe/Luxembourg' => 'Europe/Luxembourg', + 'Europe/Madrid' => 'Europe/Madrid', + 'Europe/Malta' => 'Europe/Malta', + 'Europe/Mariehamn' => 'Europe/Mariehamn', + 'Europe/Minsk' => 'Europe/Minsk', + 'Europe/Monaco' => 'Europe/Monaco', + 'Europe/Moscow' => 'Europe/Moscow', + 'Europe/Oslo' => 'Europe/Oslo', + 'Europe/Paris' => 'Europe/Paris', + 'Europe/Podgorica' => 'Europe/Podgorica', + 'Europe/Prague' => 'Europe/Prague', + 'Europe/Riga' => 'Europe/Riga', + 'Europe/Rome' => 'Europe/Rome', + 'Europe/Samara' => 'Europe/Samara', + 'Europe/San_Marino' => 'Europe/San Marino', + 'Europe/Sarajevo' => 'Europe/Sarajevo', + 'Europe/Simferopol' => 'Europe/Simferopol', + 'Europe/Skopje' => 'Europe/Skopje', + 'Europe/Sofia' => 'Europe/Sofia', + 'Europe/Stockholm' => 'Europe/Stockholm', + 'Europe/Tallinn' => 'Europe/Tallinn', + 'Europe/Tirane' => 'Europe/Tirane', + 'Europe/Uzhgorod' => 'Europe/Uzhgorod', + 'Europe/Vaduz' => 'Europe/Vaduz', + 'Europe/Vatican' => 'Europe/Vatican', + 'Europe/Vienna' => 'Europe/Vienna', + 'Europe/Vilnius' => 'Europe/Vilnius', + 'Europe/Volgograd' => 'Europe/Volgograd', + 'Europe/Warsaw' => 'Europe/Warsaw', + 'Europe/Zagreb' => 'Europe/Zagreb', + 'Europe/Zaporozhye' => 'Europe/Zaporozhye', + 'Europe/Zurich' => 'Europe/Zurich', + + 'Indian/Antananarivo' => 'Indian/Antananarivo', + 'Indian/Chagos' => 'Indian/Chagos', + 'Indian/Christmas' => 'Indian/Christmas', + 'Indian/Cocos' => 'Indian/Cocos', + 'Indian/Comoro' => 'Indian/Comoro', + 'Indian/Kerguelen' => 'Indian/Kerguelen', + 'Indian/Mahe' => 'Indian/Mahe', + 'Indian/Maldives' => 'Indian/Maldives', + 'Indian/Mauritius' => 'Indian/Mauritius', + 'Indian/Mayotte' => 'Indian/Mayotte', + 'Indian/Reunion' => 'Indian/Reunion', + + 'Pacific/Apia' => 'Pacific/Apia', + 'Pacific/Auckland' => 'Pacific/Auckland', + 'Pacific/Chatham' => 'Pacific/Chatham', + 'Pacific/Chuuk' => 'Pacific/Chuuk', + 'Pacific/Easter' => 'Pacific/Easter', + 'Pacific/Efate' => 'Pacific/Efate', + 'Pacific/Enderbury' => 'Pacific/Enderbury', + 'Pacific/Fakaofo' => 'Pacific/Fakaofo', + 'Pacific/Fiji' => 'Pacific/Fiji', + 'Pacific/Funafuti' => 'Pacific/Funafuti', + 'Pacific/Galapagos' => 'Pacific/Galapagos', + 'Pacific/Gambier' => 'Pacific/Gambier', + 'Pacific/Guadalcanal' => 'Pacific/Guadalcanal', + 'Pacific/Guam' => 'Pacific/Guam', + 'Pacific/Honolulu' => 'Pacific/Honolulu', + 'Pacific/Johnston' => 'Pacific/Johnston', + 'Pacific/Kiritimati' => 'Pacific/Kiritimati', + 'Pacific/Kosrae' => 'Pacific/Kosrae', + 'Pacific/Kwajalein' => 'Pacific/Kwajalein', + 'Pacific/Majuro' => 'Pacific/Majuro', + 'Pacific/Marquesas' => 'Pacific/Marquesas', + 'Pacific/Midway' => 'Pacific/Midway', + 'Pacific/Nauru' => 'Pacific/Nauru', + 'Pacific/Niue' => 'Pacific/Niue', + 'Pacific/Norfolk' => 'Pacific/Norfolk', + 'Pacific/Noumea' => 'Pacific/Noumea', + 'Pacific/Pago_Pago' => 'Pacific/Pago Pago', + 'Pacific/Palau' => 'Pacific/Palau', + 'Pacific/Pitcairn' => 'Pacific/Pitcairn', + 'Pacific/Pohnpei' => 'Pacific/Pohnpei', + 'Pacific/Port_Moresby' => 'Pacific/Port Moresby', + 'Pacific/Rarotonga' => 'Pacific/Rarotonga', + 'Pacific/Saipan' => 'Pacific/Saipan', + 'Pacific/Tahiti' => 'Pacific/Tahiti', + 'Pacific/Tarawa' => 'Pacific/Tarawa', + 'Pacific/Tongatapu' => 'Pacific/Tongatapu', + 'Pacific/Wake' => 'Pacific/Wake', + 'Pacific/Wallis' => 'Pacific/Wallis', + ), + + // The value is only an example and will get replaced by the current time on view + 'dateformats' => array( + 'd M Y, H:i' => '01 Jan 2007, 13:37', + 'd M Y H:i' => '01 Jan 2007 13:37', + 'M jS, \'y, H:i' => 'Jan 1st, \'07, 13:37', + 'D M d, Y g:i a' => 'Mon Jan 01, 2007 1:37 pm', + 'F jS, Y, g:i a' => 'January 1st, 2007, 1:37 pm', + '|d M Y|, H:i' => 'Today, 13:37 / 01 Jan 2007, 13:37', + '|F jS, Y|, g:i a' => 'Today, 1:37 pm / January 1st, 2007, 1:37 pm', + ), + + // The default dateformat which will be used on new installs in this language + // Translators should change this if a the usual date format is different + 'default_dateformat' => 'D M d, Y g:i a', // Mon Jan 01, 2007 1:37 pm + +)); diff --git a/sources/phpBB/language/en/email/admin_activate.txt b/sources/phpBB/language/en/email/admin_activate.txt new file mode 100644 index 0000000..a53ab12 --- /dev/null +++ b/sources/phpBB/language/en/email/admin_activate.txt @@ -0,0 +1,13 @@ +Subject: Activate user account + +Hello, + +The account owned by "{USERNAME}" has been deactivated or newly created, you should check the details of this user (if required) and handle it appropriately. + +Use this link to view the user's profile: +{U_USER_DETAILS} + +Use this link to activate the account: +{U_ACTIVATE} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/admin_send_email.txt b/sources/phpBB/language/en/email/admin_send_email.txt new file mode 100644 index 0000000..7345a04 --- /dev/null +++ b/sources/phpBB/language/en/email/admin_send_email.txt @@ -0,0 +1,13 @@ + +The following is an email sent to you by an administrator of "{SITENAME}". If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address: + +{CONTACT_EMAIL} + +Include this full email (particularly the headers). + +Message sent to you follows: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +{MESSAGE} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/admin_welcome_activated.txt b/sources/phpBB/language/en/email/admin_welcome_activated.txt new file mode 100644 index 0000000..2e136ac --- /dev/null +++ b/sources/phpBB/language/en/email/admin_welcome_activated.txt @@ -0,0 +1,9 @@ +Subject: Account activated + +Hello {USERNAME}, + +Your account on "{SITENAME}" has been activated by an administrator, you may login now. + +Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/admin_welcome_inactive.txt b/sources/phpBB/language/en/email/admin_welcome_inactive.txt new file mode 100644 index 0000000..f9a57b9 --- /dev/null +++ b/sources/phpBB/language/en/email/admin_welcome_inactive.txt @@ -0,0 +1,19 @@ +Subject: Welcome to "{SITENAME}" + +{WELCOME_MSG} + +Please keep this email for your records. Your account information is as follows: + +---------------------------- +Username: {USERNAME} + +Board URL: {U_BOARD} +---------------------------- + +Your account is currently inactive and will need to be approved by an administrator before you can log in. Another email will be sent when this has occurred. + +Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account. + +Thank you for registering. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/bookmark.txt b/sources/phpBB/language/en/email/bookmark.txt new file mode 100644 index 0000000..95f17b5 --- /dev/null +++ b/sources/phpBB/language/en/email/bookmark.txt @@ -0,0 +1,20 @@ +Subject: Topic reply notification - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because a topic you bookmarked, "{TOPIC_TITLE}" at "{SITENAME}", has received a reply since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic. + +If you want to view the newest post made since your last visit, click the following link: +{U_NEWEST_POST} + +If you want to view the topic, click the following link: +{U_TOPIC} + +If you want to view the forum, click the following link: +{U_FORUM} + +If you no longer wish to receive updates about replies to bookmarks, please update your notification settings here: + +{U_NOTIFICATION_SETTINGS} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/contact_admin.txt b/sources/phpBB/language/en/email/contact_admin.txt new file mode 100644 index 0000000..c895c4d --- /dev/null +++ b/sources/phpBB/language/en/email/contact_admin.txt @@ -0,0 +1,23 @@ + +Hello {TO_USERNAME}, + +The following is an e-mail sent to you through the administration contact page on "{SITENAME}". + + +The message has been sent from an account on the site. +Username: {FROM_USERNAME} +E-mail address: {FROM_EMAIL_ADDRESS} +IP Address: {FROM_IP_ADDRESS} +Profile: {U_FROM_PROFILE} + +The message was sent from a guest who specified the following contact information: +Name: {FROM_USERNAME} +E-mail address: {FROM_EMAIL_ADDRESS} +IP Address: {FROM_IP_ADDRESS} + + + +Message sent to you follows +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +{MESSAGE} diff --git a/sources/phpBB/language/en/email/coppa_resend_inactive.txt b/sources/phpBB/language/en/email/coppa_resend_inactive.txt new file mode 100644 index 0000000..915534a --- /dev/null +++ b/sources/phpBB/language/en/email/coppa_resend_inactive.txt @@ -0,0 +1,42 @@ +Subject: Welcome to "{SITENAME}" + +{WELCOME_MSG} + +In compliance with the COPPA, your account is currently inactive. + +Please print this message and have your parent or guardian sign and date it. Then fax it to: + +{FAX_INFO} + +OR mail it to: + +{MAIL_INFO} + +------------------------------ CUT HERE ------------------------------ +Permission to participate at "{SITENAME}" - {U_BOARD} + +Username: {USERNAME} +Email: {EMAIL_ADDRESS} + +I HAVE REVIEWED THE INFORMATION PROVIDED BY MY CHILD AND HEREBY GRANT PERMISSION TO "{SITENAME}" TO STORE THIS INFORMATION. +I UNDERSTAND THIS INFORMATION CAN BE CHANGED AT ANY TIME BY ENTERING A PASSWORD. +I UNDERSTAND THAT I MAY REQUEST FOR THIS INFORMATION TO BE REMOVED FROM "{SITENAME}" AT ANY TIME. + + +Parent or guardian +(print your name here): _____________________ + +(sign here): __________________ + +Date: _______________ + +------------------------------ CUT HERE ------------------------------ + + +Once the administrator has received the above form via fax or regular mail, your account will be activated. + +Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account. + +Thank you for registering. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/coppa_welcome_inactive.txt b/sources/phpBB/language/en/email/coppa_welcome_inactive.txt new file mode 100644 index 0000000..915534a --- /dev/null +++ b/sources/phpBB/language/en/email/coppa_welcome_inactive.txt @@ -0,0 +1,42 @@ +Subject: Welcome to "{SITENAME}" + +{WELCOME_MSG} + +In compliance with the COPPA, your account is currently inactive. + +Please print this message and have your parent or guardian sign and date it. Then fax it to: + +{FAX_INFO} + +OR mail it to: + +{MAIL_INFO} + +------------------------------ CUT HERE ------------------------------ +Permission to participate at "{SITENAME}" - {U_BOARD} + +Username: {USERNAME} +Email: {EMAIL_ADDRESS} + +I HAVE REVIEWED THE INFORMATION PROVIDED BY MY CHILD AND HEREBY GRANT PERMISSION TO "{SITENAME}" TO STORE THIS INFORMATION. +I UNDERSTAND THIS INFORMATION CAN BE CHANGED AT ANY TIME BY ENTERING A PASSWORD. +I UNDERSTAND THAT I MAY REQUEST FOR THIS INFORMATION TO BE REMOVED FROM "{SITENAME}" AT ANY TIME. + + +Parent or guardian +(print your name here): _____________________ + +(sign here): __________________ + +Date: _______________ + +------------------------------ CUT HERE ------------------------------ + + +Once the administrator has received the above form via fax or regular mail, your account will be activated. + +Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account. + +Thank you for registering. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/email_notify.txt b/sources/phpBB/language/en/email/email_notify.txt new file mode 100644 index 0000000..43c9098 --- /dev/null +++ b/sources/phpBB/language/en/email/email_notify.txt @@ -0,0 +1,17 @@ +Subject: "{SITENAME}" - Email a friend + +Hello {TO_USERNAME}, + +This email was sent from "{SITENAME}" by {FROM_USERNAME} who thought you may be interested in the following topic: + +{TOPIC_NAME} + +You can find it at: + +{U_TOPIC} + +A message from {FROM_USERNAME} may also be included below. Please note that this message has not been seen or approved by the board administrators. If you wish to complain about having received this email please contact the board administrator at {BOARD_CONTACT}. Please quote the message headers when contacting this address. + +---------- + +{MESSAGE} diff --git a/sources/phpBB/language/en/email/forum_notify.txt b/sources/phpBB/language/en/email/forum_notify.txt new file mode 100644 index 0000000..a05be5f --- /dev/null +++ b/sources/phpBB/language/en/email/forum_notify.txt @@ -0,0 +1,19 @@ +Subject: Forum post notification - "{FORUM_NAME}" + +Hello {USERNAME}, + +You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new reply to the topic "{TOPIC_TITLE}" by {AUTHOR_NAME} since your last visit. You can use the following link to view the last unread reply, no more notifications will be sent until you visit the topic. + +{U_NEWEST_POST} + +If you want to view the topic, click the following link: +{U_TOPIC} + +If you want to view the forum, click the following link: +{U_FORUM} + +If you no longer wish to watch this forum you can either click the "Unsubscribe forum" link found in the forum above, or by clicking the following link: + +{U_STOP_WATCHING_FORUM} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/group_added.txt b/sources/phpBB/language/en/email/group_added.txt new file mode 100644 index 0000000..9464aae --- /dev/null +++ b/sources/phpBB/language/en/email/group_added.txt @@ -0,0 +1,11 @@ +Subject: You have been added to this usergroup + +Congratulations, + +You have been added to the "{GROUP_NAME}" group on "{SITENAME}". +This action was done by a group leader or the site administrator, contact them for more information. + +You can view your groups information here: +{U_GROUP} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/group_request.txt b/sources/phpBB/language/en/email/group_request.txt new file mode 100644 index 0000000..7584083 --- /dev/null +++ b/sources/phpBB/language/en/email/group_request.txt @@ -0,0 +1,10 @@ +Subject: A request to join your group has been made + +Dear {USERNAME}, + +The user "{REQUEST_USERNAME}" has requested to join the group "{GROUP_NAME}" you moderate on "{SITENAME}". +To approve or deny this request for group membership please visit the following link: + +{U_PENDING} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/index.htm b/sources/phpBB/language/en/email/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/language/en/email/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/language/en/email/installed.txt b/sources/phpBB/language/en/email/installed.txt new file mode 100644 index 0000000..9344458 --- /dev/null +++ b/sources/phpBB/language/en/email/installed.txt @@ -0,0 +1,19 @@ +Subject: phpBB installed + +Congratulations, + +You have successfully installed phpBB on your server. + +This email contains important information regarding your installation and should be kept for reference. Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account. + +---------------------------- +Username: {USERNAME} + +Board URL: {U_BOARD} +---------------------------- + +Useful information regarding the phpBB software can be found in the docs folder of your installation and on phpBB.com's support page - https://www.phpbb.com/support/ + +In order to keep your board safe and secure, we highly recommended keeping current with software releases. For your convenience, a mailing list is available at the page referenced above. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/newtopic_notify.txt b/sources/phpBB/language/en/email/newtopic_notify.txt new file mode 100644 index 0000000..5089e7d --- /dev/null +++ b/sources/phpBB/language/en/email/newtopic_notify.txt @@ -0,0 +1,13 @@ +Subject: New topic notification - "{FORUM_NAME}" + +Hello {USERNAME}, + +You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic by {AUTHOR_NAME} since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum. + +{U_FORUM} + +If you no longer wish to watch this forum you can either click the "Unsubscribe forum" link found in the forum above, or by clicking the following link: + +{U_STOP_WATCHING_FORUM} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/pm_report_closed.txt b/sources/phpBB/language/en/email/pm_report_closed.txt new file mode 100644 index 0000000..0202b9d --- /dev/null +++ b/sources/phpBB/language/en/email/pm_report_closed.txt @@ -0,0 +1,7 @@ +Subject: Report closed - "{PM_SUBJECT}" + +Hello {USERNAME}, + +You are receiving this notification because the report you filed regarding the private message "{PM_SUBJECT}" at "{SITENAME}" has been tended to by a moderator or administrator. The report is now closed. If you have further questions, please contact {CLOSER_NAME} by private message. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/pm_report_deleted.txt b/sources/phpBB/language/en/email/pm_report_deleted.txt new file mode 100644 index 0000000..991ed59 --- /dev/null +++ b/sources/phpBB/language/en/email/pm_report_deleted.txt @@ -0,0 +1,7 @@ +Subject: Report deleted - "{PM_SUBJECT}" + +Hello {USERNAME}, + +You are receiving this notification because the report you filed regarding the private message "{PM_SUBJECT}" at "{SITENAME}" was deleted by a moderator or administrator. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/post_approved.txt b/sources/phpBB/language/en/email/post_approved.txt new file mode 100644 index 0000000..854d785 --- /dev/null +++ b/sources/phpBB/language/en/email/post_approved.txt @@ -0,0 +1,13 @@ +Subject: Post approved - "{POST_SUBJECT}" + +Hello {USERNAME}, + +You are receiving this notification because your post "{POST_SUBJECT}" at "{SITENAME}" was approved by a moderator or administrator. + +If you want to view the post, click the following link: +{U_VIEW_POST} + +If you want to view the topic, click the following link: +{U_VIEW_TOPIC} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/post_disapproved.txt b/sources/phpBB/language/en/email/post_disapproved.txt new file mode 100644 index 0000000..9b2ee64 --- /dev/null +++ b/sources/phpBB/language/en/email/post_disapproved.txt @@ -0,0 +1,11 @@ +Subject: Post disapproved - "{POST_SUBJECT}" + +Hello {USERNAME}, + +You are receiving this notification because your post "{POST_SUBJECT}" at "{SITENAME}" was disapproved by a moderator or administrator. + +The following reason was given for the disapproval: + +{REASON} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/post_in_queue.txt b/sources/phpBB/language/en/email/post_in_queue.txt new file mode 100644 index 0000000..941f070 --- /dev/null +++ b/sources/phpBB/language/en/email/post_in_queue.txt @@ -0,0 +1,13 @@ +Subject: Post moderation notification - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because the post "{POST_SUBJECT}" at "{SITENAME}" needs approval. + +If you want to view the post, click the following link: +{U_VIEW_POST} + +If you want to view the topic, click the following link: +{U_TOPIC} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/privmsg_notify.txt b/sources/phpBB/language/en/email/privmsg_notify.txt new file mode 100644 index 0000000..41fdbb7 --- /dev/null +++ b/sources/phpBB/language/en/email/privmsg_notify.txt @@ -0,0 +1,15 @@ +Subject: New private message has arrived + +Hello {USERNAME}, + +You have received a new private message from "{AUTHOR_NAME}" to your account on "{SITENAME}" with the following subject: + +{SUBJECT} + +You can view your new message by clicking on the following link: + +{U_VIEW_MESSAGE} + +You have requested that you be notified on this event, remember that you can always choose not to be notified of new messages by changing the appropriate setting in your profile. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/profile_send_email.txt b/sources/phpBB/language/en/email/profile_send_email.txt new file mode 100644 index 0000000..3e63777 --- /dev/null +++ b/sources/phpBB/language/en/email/profile_send_email.txt @@ -0,0 +1,13 @@ + +Hello {TO_USERNAME}, + +The following is an email sent to you by {FROM_USERNAME} via your account on "{SITENAME}". If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address: + +{BOARD_CONTACT} + +Include this full email (particularly the headers). Please note that the reply address to this email has been set to that of {FROM_USERNAME}. + +Message sent to you follows +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +{MESSAGE} diff --git a/sources/phpBB/language/en/email/profile_send_im.txt b/sources/phpBB/language/en/email/profile_send_im.txt new file mode 100644 index 0000000..02c820c --- /dev/null +++ b/sources/phpBB/language/en/email/profile_send_im.txt @@ -0,0 +1,13 @@ + +Hello {TO_USERNAME}, + +The following is a message sent to you by {FROM_USERNAME} via your account on "{SITENAME}". If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address: + +{BOARD_CONTACT} + +Include this full message. Please note that the sender address has been set to the boards IM account. + +Message sent to you follows +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +{MESSAGE} diff --git a/sources/phpBB/language/en/email/quote.txt b/sources/phpBB/language/en/email/quote.txt new file mode 100644 index 0000000..2b95258 --- /dev/null +++ b/sources/phpBB/language/en/email/quote.txt @@ -0,0 +1,20 @@ +Subject: Topic reply notification - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because "{AUTHOR_NAME}" quoted you in the topic "{TOPIC_TITLE}" at "{SITENAME}". You can use the following link to view the reply made. + +If you want to view the quoted post, click the following link: +{U_VIEW_POST} + +If you want to view the topic, click the following link: +{U_TOPIC} + +If you want to view the forum, click the following link: +{U_FORUM} + +If you no longer wish to receive updates about replies quoting you, please update your notification settings here: + +{U_NOTIFICATION_SETTINGS} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/report_closed.txt b/sources/phpBB/language/en/email/report_closed.txt new file mode 100644 index 0000000..f248018 --- /dev/null +++ b/sources/phpBB/language/en/email/report_closed.txt @@ -0,0 +1,7 @@ +Subject: Report closed - "{POST_SUBJECT}" + +Hello {USERNAME}, + +You are receiving this notification because the report you filed on the post "{POST_SUBJECT}" in "{TOPIC_TITLE}" at "{SITENAME}" was handled by a moderator or by an administrator. The report was afterwards closed. If you have further questions contact {CLOSER_NAME} with a personal message. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/report_deleted.txt b/sources/phpBB/language/en/email/report_deleted.txt new file mode 100644 index 0000000..9a30ea2 --- /dev/null +++ b/sources/phpBB/language/en/email/report_deleted.txt @@ -0,0 +1,7 @@ +Subject: Report deleted - "{POST_SUBJECT}" + +Hello {USERNAME}, + +You are receiving this notification because the report you filed on the post "{POST_SUBJECT}" in "{TOPIC_TITLE}" at "{SITENAME}" was deleted by a moderator or by an administrator. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/report_pm.txt b/sources/phpBB/language/en/email/report_pm.txt new file mode 100644 index 0000000..a101a01 --- /dev/null +++ b/sources/phpBB/language/en/email/report_pm.txt @@ -0,0 +1,10 @@ +Subject: Private Message report - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because a Private Message titled "{SUBJECT}" by "{AUTHOR_NAME}" at "{SITENAME}" was reported. + +If you want to view the report, click the following link: +{U_VIEW_REPORT} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/report_post.txt b/sources/phpBB/language/en/email/report_post.txt new file mode 100644 index 0000000..8eb24ec --- /dev/null +++ b/sources/phpBB/language/en/email/report_post.txt @@ -0,0 +1,13 @@ +Subject: Post report - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because the post "{POST_SUBJECT}" at "{SITENAME}" was reported. + +If you want to view the report, click the following link: +{U_VIEW_REPORT} + +If you want to view the post, click the following link: +{U_VIEW_POST} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/short/bookmark.txt b/sources/phpBB/language/en/email/short/bookmark.txt new file mode 100644 index 0000000..95f17b5 --- /dev/null +++ b/sources/phpBB/language/en/email/short/bookmark.txt @@ -0,0 +1,20 @@ +Subject: Topic reply notification - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because a topic you bookmarked, "{TOPIC_TITLE}" at "{SITENAME}", has received a reply since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic. + +If you want to view the newest post made since your last visit, click the following link: +{U_NEWEST_POST} + +If you want to view the topic, click the following link: +{U_TOPIC} + +If you want to view the forum, click the following link: +{U_FORUM} + +If you no longer wish to receive updates about replies to bookmarks, please update your notification settings here: + +{U_NOTIFICATION_SETTINGS} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/short/newtopic_notify.txt b/sources/phpBB/language/en/email/short/newtopic_notify.txt new file mode 100644 index 0000000..bf6799e --- /dev/null +++ b/sources/phpBB/language/en/email/short/newtopic_notify.txt @@ -0,0 +1,13 @@ +Subject: New topic notification - "{FORUM_NAME}" + +Hello {USERNAME}, + +You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic by {AUTHOR_NAME} since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum. + +{U_FORUM} + +If you no longer wish to watch this forum you can either click the "Unsubscribe forum" link found in the forum above, or by clicking the following link: + +{U_STOP_WATCHING_FORUM} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/short/post_approved.txt b/sources/phpBB/language/en/email/short/post_approved.txt new file mode 100644 index 0000000..854d785 --- /dev/null +++ b/sources/phpBB/language/en/email/short/post_approved.txt @@ -0,0 +1,13 @@ +Subject: Post approved - "{POST_SUBJECT}" + +Hello {USERNAME}, + +You are receiving this notification because your post "{POST_SUBJECT}" at "{SITENAME}" was approved by a moderator or administrator. + +If you want to view the post, click the following link: +{U_VIEW_POST} + +If you want to view the topic, click the following link: +{U_VIEW_TOPIC} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/short/post_disapproved.txt b/sources/phpBB/language/en/email/short/post_disapproved.txt new file mode 100644 index 0000000..9b2ee64 --- /dev/null +++ b/sources/phpBB/language/en/email/short/post_disapproved.txt @@ -0,0 +1,11 @@ +Subject: Post disapproved - "{POST_SUBJECT}" + +Hello {USERNAME}, + +You are receiving this notification because your post "{POST_SUBJECT}" at "{SITENAME}" was disapproved by a moderator or administrator. + +The following reason was given for the disapproval: + +{REASON} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/short/post_in_queue.txt b/sources/phpBB/language/en/email/short/post_in_queue.txt new file mode 100644 index 0000000..941f070 --- /dev/null +++ b/sources/phpBB/language/en/email/short/post_in_queue.txt @@ -0,0 +1,13 @@ +Subject: Post moderation notification - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because the post "{POST_SUBJECT}" at "{SITENAME}" needs approval. + +If you want to view the post, click the following link: +{U_VIEW_POST} + +If you want to view the topic, click the following link: +{U_TOPIC} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/short/privmsg_notify.txt b/sources/phpBB/language/en/email/short/privmsg_notify.txt new file mode 100644 index 0000000..41fdbb7 --- /dev/null +++ b/sources/phpBB/language/en/email/short/privmsg_notify.txt @@ -0,0 +1,15 @@ +Subject: New private message has arrived + +Hello {USERNAME}, + +You have received a new private message from "{AUTHOR_NAME}" to your account on "{SITENAME}" with the following subject: + +{SUBJECT} + +You can view your new message by clicking on the following link: + +{U_VIEW_MESSAGE} + +You have requested that you be notified on this event, remember that you can always choose not to be notified of new messages by changing the appropriate setting in your profile. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/short/quote.txt b/sources/phpBB/language/en/email/short/quote.txt new file mode 100644 index 0000000..2b95258 --- /dev/null +++ b/sources/phpBB/language/en/email/short/quote.txt @@ -0,0 +1,20 @@ +Subject: Topic reply notification - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because "{AUTHOR_NAME}" quoted you in the topic "{TOPIC_TITLE}" at "{SITENAME}". You can use the following link to view the reply made. + +If you want to view the quoted post, click the following link: +{U_VIEW_POST} + +If you want to view the topic, click the following link: +{U_TOPIC} + +If you want to view the forum, click the following link: +{U_FORUM} + +If you no longer wish to receive updates about replies quoting you, please update your notification settings here: + +{U_NOTIFICATION_SETTINGS} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/short/report_pm.txt b/sources/phpBB/language/en/email/short/report_pm.txt new file mode 100644 index 0000000..a101a01 --- /dev/null +++ b/sources/phpBB/language/en/email/short/report_pm.txt @@ -0,0 +1,10 @@ +Subject: Private Message report - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because a Private Message titled "{SUBJECT}" by "{AUTHOR_NAME}" at "{SITENAME}" was reported. + +If you want to view the report, click the following link: +{U_VIEW_REPORT} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/short/report_post.txt b/sources/phpBB/language/en/email/short/report_post.txt new file mode 100644 index 0000000..8eb24ec --- /dev/null +++ b/sources/phpBB/language/en/email/short/report_post.txt @@ -0,0 +1,13 @@ +Subject: Post report - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because the post "{POST_SUBJECT}" at "{SITENAME}" was reported. + +If you want to view the report, click the following link: +{U_VIEW_REPORT} + +If you want to view the post, click the following link: +{U_VIEW_POST} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/short/topic_approved.txt b/sources/phpBB/language/en/email/short/topic_approved.txt new file mode 100644 index 0000000..60c7ef4 --- /dev/null +++ b/sources/phpBB/language/en/email/short/topic_approved.txt @@ -0,0 +1,10 @@ +Subject: Topic approved - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because your topic "{TOPIC_TITLE}" at "{SITENAME}" was approved by a moderator or administrator. + +If you want to view the topic, click the following link: +{U_VIEW_TOPIC} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/short/topic_disapproved.txt b/sources/phpBB/language/en/email/short/topic_disapproved.txt new file mode 100644 index 0000000..9c821e2 --- /dev/null +++ b/sources/phpBB/language/en/email/short/topic_disapproved.txt @@ -0,0 +1,11 @@ +Subject: Topic disapproved - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because your topic "{TOPIC_TITLE}" at "{SITENAME}" was disapproved by a moderator or administrator. + +The following reason was given for the disapproval: + +{REASON} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/short/topic_in_queue.txt b/sources/phpBB/language/en/email/short/topic_in_queue.txt new file mode 100644 index 0000000..706dddf --- /dev/null +++ b/sources/phpBB/language/en/email/short/topic_in_queue.txt @@ -0,0 +1,13 @@ +Subject: Topic moderation notification - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because the topic "{TOPIC_TITLE}" at "{SITENAME}" needs approval. + +If you want to view the topic, click the following link: +{U_VIEW_TOPIC} + +If you want to view the forum, click the following link: +{U_FORUM} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/short/topic_notify.txt b/sources/phpBB/language/en/email/short/topic_notify.txt new file mode 100644 index 0000000..472375f --- /dev/null +++ b/sources/phpBB/language/en/email/short/topic_notify.txt @@ -0,0 +1,20 @@ +Subject: Topic reply notification - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply by {AUTHOR_NAME} since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic. + +If you want to view the newest post made since your last visit, click the following link: +{U_NEWEST_POST} + +If you want to view the topic, click the following link: +{U_TOPIC} + +If you want to view the forum, click the following link: +{U_FORUM} + +If you no longer wish to watch this topic you can either click the "Unsubscribe topic" link found at the bottom of the topic above, or by clicking the following link: + +{U_STOP_WATCHING_TOPIC} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/topic_approved.txt b/sources/phpBB/language/en/email/topic_approved.txt new file mode 100644 index 0000000..60c7ef4 --- /dev/null +++ b/sources/phpBB/language/en/email/topic_approved.txt @@ -0,0 +1,10 @@ +Subject: Topic approved - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because your topic "{TOPIC_TITLE}" at "{SITENAME}" was approved by a moderator or administrator. + +If you want to view the topic, click the following link: +{U_VIEW_TOPIC} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/topic_disapproved.txt b/sources/phpBB/language/en/email/topic_disapproved.txt new file mode 100644 index 0000000..9c821e2 --- /dev/null +++ b/sources/phpBB/language/en/email/topic_disapproved.txt @@ -0,0 +1,11 @@ +Subject: Topic disapproved - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because your topic "{TOPIC_TITLE}" at "{SITENAME}" was disapproved by a moderator or administrator. + +The following reason was given for the disapproval: + +{REASON} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/topic_in_queue.txt b/sources/phpBB/language/en/email/topic_in_queue.txt new file mode 100644 index 0000000..706dddf --- /dev/null +++ b/sources/phpBB/language/en/email/topic_in_queue.txt @@ -0,0 +1,13 @@ +Subject: Topic moderation notification - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because the topic "{TOPIC_TITLE}" at "{SITENAME}" needs approval. + +If you want to view the topic, click the following link: +{U_VIEW_TOPIC} + +If you want to view the forum, click the following link: +{U_FORUM} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/topic_notify.txt b/sources/phpBB/language/en/email/topic_notify.txt new file mode 100644 index 0000000..d5272d7 --- /dev/null +++ b/sources/phpBB/language/en/email/topic_notify.txt @@ -0,0 +1,19 @@ +Subject: Topic reply notification - "{TOPIC_TITLE}" + +Hello {USERNAME}, + +You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply by {AUTHOR_NAME} since your last visit. No more notifications will be sent until you visit the topic. + +If you want to view the newest post made since your last visit, click the following link: +{U_NEWEST_POST} + +If you want to view the topic, click the following link: +{U_TOPIC} + +If you want to view the forum, click the following link: +{U_FORUM} + +If you no longer wish to watch this topic you can either click the "Unsubscribe topic" link found at the bottom of the topic above, or by clicking the following link: +{U_STOP_WATCHING_TOPIC} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/user_activate.txt b/sources/phpBB/language/en/email/user_activate.txt new file mode 100644 index 0000000..b949b68 --- /dev/null +++ b/sources/phpBB/language/en/email/user_activate.txt @@ -0,0 +1,9 @@ +Subject: Reactivate your account + +Hello {USERNAME}, + +Your account on "{SITENAME}" has been deactivated, most likely due to changes made to your profile. In order to reactivate your account you must click on the link below: + +{U_ACTIVATE} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/user_activate_inactive.txt b/sources/phpBB/language/en/email/user_activate_inactive.txt new file mode 100644 index 0000000..7743420 --- /dev/null +++ b/sources/phpBB/language/en/email/user_activate_inactive.txt @@ -0,0 +1,7 @@ +Subject: Your account has been deactivated + +Hello {USERNAME}, + +Your account on "{SITENAME}" has been deactivated, most likely due to changes made to your profile. The administrator of the board will need to activate it before you can log in. You will receive another notification when this has occurred. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/user_activate_passwd.txt b/sources/phpBB/language/en/email/user_activate_passwd.txt new file mode 100644 index 0000000..965d5a5 --- /dev/null +++ b/sources/phpBB/language/en/email/user_activate_passwd.txt @@ -0,0 +1,17 @@ +Subject: New password activation + +Hello {USERNAME} + +You are receiving this notification because you have (or someone pretending to be you has) requested a new password be sent for your account on "{SITENAME}". If you did not request this notification then please ignore it, if you keep receiving it please contact the board administrator. + +To use the new password you need to activate it. To do this click the link provided below. + +{U_ACTIVATE} + +If successful you will be able to login using the following password: + +Password: {PASSWORD} + +You can of course change this password yourself via the profile page. If you have any difficulties please contact the board administrator. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/user_reactivate_account.txt b/sources/phpBB/language/en/email/user_reactivate_account.txt new file mode 100644 index 0000000..7564b0a --- /dev/null +++ b/sources/phpBB/language/en/email/user_reactivate_account.txt @@ -0,0 +1,18 @@ +Subject: Reactivate your account on "{SITENAME}" + +A board administrator requested that your account be reactivated. Your account is currently inactive. +Please follow the steps listed here to reactivate your account. + +Please keep this email for your records. Your account information is as follows: + +---------------------------- +Username: {USERNAME} +---------------------------- + +Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account. + +Please visit the following link to reactivate your account: + +{U_ACTIVATE} + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/user_remind_inactive.txt b/sources/phpBB/language/en/email/user_remind_inactive.txt new file mode 100644 index 0000000..1f136b5 --- /dev/null +++ b/sources/phpBB/language/en/email/user_remind_inactive.txt @@ -0,0 +1,11 @@ +Subject: Inactive account reminder + +Hello {USERNAME}, + +This notification is a reminder that your account at "{SITENAME}", created on {REGISTER_DATE}, remains inactive. If you would like to activate this account, please visit the following link: + +{U_ACTIVATE} + +Thank you for registering at "{SITENAME}", we look forward to your participation. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/user_resend_inactive.txt b/sources/phpBB/language/en/email/user_resend_inactive.txt new file mode 100644 index 0000000..d975a07 --- /dev/null +++ b/sources/phpBB/language/en/email/user_resend_inactive.txt @@ -0,0 +1,19 @@ +Subject: Welcome to "{SITENAME}" + +{WELCOME_MSG} + +Please keep this email for your records. Your account information is as follows: + +---------------------------- +Username: {USERNAME} +---------------------------- + +Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account. + +Please visit the following link in order to activate your account: + +{U_ACTIVATE} + +Thank you for registering. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/user_welcome.txt b/sources/phpBB/language/en/email/user_welcome.txt new file mode 100644 index 0000000..f299b7b --- /dev/null +++ b/sources/phpBB/language/en/email/user_welcome.txt @@ -0,0 +1,17 @@ +Subject: Welcome to "{SITENAME}" + +{WELCOME_MSG} + +Please keep this email for your records. Your account information is as follows: + +---------------------------- +Username: {USERNAME} + +Board URL: {U_BOARD} +---------------------------- + +Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account. + +Thank you for registering. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/email/user_welcome_inactive.txt b/sources/phpBB/language/en/email/user_welcome_inactive.txt new file mode 100644 index 0000000..b4300d0 --- /dev/null +++ b/sources/phpBB/language/en/email/user_welcome_inactive.txt @@ -0,0 +1,21 @@ +Subject: Welcome to "{SITENAME}" + +{WELCOME_MSG} + +Please keep this email for your records. Your account information is as follows: + +---------------------------- +Username: {USERNAME} + +Board URL: {U_BOARD} +---------------------------- + +Please visit the following link in order to activate your account: + +{U_ACTIVATE} + +Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account. + +Thank you for registering. + +{EMAIL_SIG} diff --git a/sources/phpBB/language/en/groups.php b/sources/phpBB/language/en/groups.php new file mode 100644 index 0000000..6d25fea --- /dev/null +++ b/sources/phpBB/language/en/groups.php @@ -0,0 +1,95 @@ + +* @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 + +$lang = array_merge($lang, array( + 'ALREADY_DEFAULT_GROUP' => 'The selected group is already your default group.', + 'ALREADY_IN_GROUP' => 'You are already a member of the selected group.', + 'ALREADY_IN_GROUP_PENDING' => 'You already requested joining the selected group.', + + 'CANNOT_JOIN_GROUP' => 'You are not able to join this group. You are only able to join open and freely open groups.', + 'CANNOT_RESIGN_GROUP' => 'You are not able to resign from this group. You are only able to resign from open and freely open groups.', + 'CHANGED_DEFAULT_GROUP' => 'Successfully changed default group.', + + 'GROUP_AVATAR' => 'Group avatar', + 'GROUP_CHANGE_DEFAULT' => 'Are you sure you want to change your default membership to the group “%sâ€?', + 'GROUP_CLOSED' => 'Closed', + 'GROUP_DESC' => 'Group description', + 'GROUP_HIDDEN' => 'Hidden', + 'GROUP_INFORMATION' => 'Usergroup information', + 'GROUP_IS_CLOSED' => 'This is a closed group, new members can only join upon invitation of a group leader.', + 'GROUP_IS_FREE' => 'This is a freely open group, all new members are welcome.', + 'GROUP_IS_HIDDEN' => 'This is a hidden group, only members of this group can view its membership.', + 'GROUP_IS_OPEN' => 'This is an open group, members can apply to join.', + 'GROUP_IS_SPECIAL' => 'This is a special group, special groups are managed by the board administrators.', + 'GROUP_JOIN' => 'Join group', + 'GROUP_JOIN_CONFIRM' => 'Are you sure you want to join the selected group?', + 'GROUP_JOIN_PENDING' => 'Request to join group', + 'GROUP_JOIN_PENDING_CONFIRM' => 'Are you sure you want to request joining the selected group?', + 'GROUP_JOINED' => 'Successfully joined selected group.', + 'GROUP_JOINED_PENDING' => 'Successfully requested group membership. Please wait for a group leader to approve your membership.', + 'GROUP_LIST' => 'Manage users', + 'GROUP_MEMBERS' => 'Group members', + 'GROUP_NAME' => 'Group name', + 'GROUP_OPEN' => 'Open', + 'GROUP_RANK' => 'Group rank', + 'GROUP_RESIGN_MEMBERSHIP' => 'Resign group membership', + 'GROUP_RESIGN_MEMBERSHIP_CONFIRM' => 'Are you sure you want to resign your membership from the selected group?', + 'GROUP_RESIGN_PENDING' => 'Resign a pending group membership', + 'GROUP_RESIGN_PENDING_CONFIRM' => 'Are you sure you want to resign your pending membership from the selected group?', + 'GROUP_RESIGNED_MEMBERSHIP' => 'You were successfully removed from the selected group.', + 'GROUP_RESIGNED_PENDING' => 'Your pending membership was successfully removed from the selected group.', + 'GROUP_TYPE' => 'Group type', + 'GROUP_UNDISCLOSED' => 'Hidden group', + 'FORUM_UNDISCLOSED' => 'Moderating hidden forum(s)', + + 'LOGIN_EXPLAIN_GROUP' => 'You need to login to view group details.', + + 'NO_LEADERS' => 'You are not a leader of any group.', + 'NOT_LEADER_OF_GROUP' => 'The requested operation cannot be taken because you are not a leader of the selected group.', + 'NOT_MEMBER_OF_GROUP' => 'The requested operation cannot be taken because you are not a member of the selected group or your membership has not been approved yet.', + 'NOT_RESIGN_FROM_DEFAULT_GROUP' => 'You are not allowed to resign from your default group.', + + 'PRIMARY_GROUP' => 'Primary group', + + 'REMOVE_SELECTED' => 'Remove selected', + + 'USER_GROUP_CHANGE' => 'From “%1$s†group to “%2$sâ€', + 'USER_GROUP_DEMOTE' => 'Demote leadership', + 'USER_GROUP_DEMOTE_CONFIRM' => 'Are you sure you want to demote as group leader from the selected group?', + 'USER_GROUP_DEMOTED' => 'Successfully demoted your leadership.', +)); diff --git a/sources/phpBB/language/en/help_bbcode.php b/sources/phpBB/language/en/help_bbcode.php new file mode 100644 index 0000000..0a8d305 --- /dev/null +++ b/sources/phpBB/language/en/help_bbcode.php @@ -0,0 +1,115 @@ + +* @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; +} + +// 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 + +$help = array( + array( + 0 => '--', + 1 => 'Introduction' + ), + array( + 0 => 'What is BBCode?', + 1 => '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 < and > 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.' + ), + array( + 0 => '--', + 1 => 'Text Formatting' + ), + array( + 0 => 'How to create bold, italic and underlined text', + 1 => 'BBCode includes tags to allow you to quickly change the basic style of your text. This is achieved in the following ways:
  • To make a piece of text bold enclose it in [b][/b], e.g.

    [b]Hello[/b]

    will become Hello
  • For underlining use [u][/u], for example:

    [u]Good Morning[/u]

    becomes Good Morning
  • To italicise text use [i][/i], e.g.

    This is [i]Great![/i]

    would give This is Great!
' + ), + array( + 0 => 'How to change the text colour or size', + 1 => '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:
  • Changing the colour of text is achieved by wrapping it in [color=][/color]. 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:

    [color=red]Hello![/color]

    or

    [color=#FF0000]Hello![/color]

    Both will output Hello!
  • Changing the text size is achieved in a similar way using [size=][/size]. 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:

    [size=30]SMALL[/size]

    will generally be SMALL

    whereas:

    [size=200]HUGE![/size]

    will be HUGE!
' + ), + array( + 0 => 'Can I combine formatting tags?', + 1 => 'Yes, of course you can, for example to get someones attention you may write:

[size=200][color=red][b]LOOK AT ME![/b][/color][/size]

this would output LOOK AT ME!

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:

[b][u]This is wrong[/b][/u]' + ), + array( + 0 => '--', + 1 => 'Quoting and outputting fixed-width text' + ), + array( + 0 => 'Quoting text in replies', + 1 => 'There are two ways you can quote text, with a reference or without.
  • 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 [quote=""][/quote] 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:

    [quote="Mr. Blobby"]The text Mr. Blobby wrote would go here[/quote]

    The resulting output will automatically add "Mr. Blobby wrote:" before the actual text. Remember you must include the quotation marks "" around the name you are quoting, they are not optional.
  • The second method allows you to blindly quote something. To utilise this enclose the text in [quote][/quote] tags. When you view the message it will simply show the text within a quotation block.
' + ), + array( + 0 => 'Outputting code or fixed width data', + 1 => '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 [code][/code] tags, e.g.

[code]echo "This is some code";[/code]

All formatting used within [code][/code] tags is retained when you later view it. PHP syntax highlighting can be enabled using [code=php][/code] and is recommended when posting PHP code samples as it improves readability.' + ), + array( + 0 => '--', + 1 => 'Generating lists' + ), + array( + 0 => 'Creating an Unordered list', + 1 => '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 [list][/list] and define each item within the list using [*]. For example to list your favourite colours you could use:

[list]
[*]Red
[*]Blue
[*]Yellow
[/list]

This would generate the following list:
  • Red
  • Blue
  • Yellow
' + ), + array( + 0 => 'Creating an Ordered list', + 1 => '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 [list=1][/list] to create a numbered list or alternatively [list=a][/list] for an alphabetical list. As with the unordered list, items are specified using [*]. For example:

[list=1]
[*]Go to the shops
[*]Buy a new computer
[*]Swear at computer when it crashes
[/list]

will generate the following:
  1. Go to the shops
  2. Buy a new computer
  3. Swear at computer when it crashes
Whereas for an alphabetical list you would use:

[list=a]
[*]The first possible answer
[*]The second possible answer
[*]The third possible answer
[/list]

giving
  1. The first possible answer
  2. The second possible answer
  3. The third possible answer
' + ), + // This block will switch the FAQ-Questions to the second template column + array( + 0 => '--', + 1 => '--' + ), + array( + 0 => '--', + 1 => 'Creating Links' + ), + array( + 0 => 'Linking to another site', + 1 => 'phpBB BBCode supports a number of ways of creating URIs (Uniform Resource Indicators) better known as URLs.
  • The first of these uses the [url=][/url] 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:

    [url=http://www.phpbb.com/]Visit phpBB![/url]

    This would generate the following link, Visit phpBB! Please notice that the link opens in the same window or a new window depending on the users browser preferences.
  • If you want the URL itself displayed as the link you can do this by simply using:

    [url]http://www.phpbb.com/[/url]

    This would generate the following link, http://www.phpbb.com/
  • Additionally, phpBB features something called Magic Links, 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 www.phpbb.com being output when you view the message.
  • The same thing applies equally to email addresses, you can either specify an address explicitly for example:

    [email]no.one@domain.adr[/email]

    which will output no.one@domain.adr or you can just type no.one@domain.adr into your message and it will be automatically converted when you view.
As with all the BBCode tags you can wrap URLs around any of the other tags such as [img][/img] (see next entry), [b][/b], etc. As with the formatting tags it is up to you to ensure the correct open and close order is following, for example:

[url=http://www.phpbb.com/][img]http://www.phpbb.com/theme/images/logos/blue/160x52.png[/url][/img]

is not correct which may lead to your post being deleted so take care.' + ), + array( + 0 => '--', + 1 => 'Showing images in posts' + ), + array( + 0 => 'Adding an image to a post', + 1 => '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 [img][/img] tags. For example:

[img]http://www.phpbb.com/theme/images/logos/blue/160x52.png[/img]

As noted in the URL section above you can wrap an image in a [url][/url] tag if you wish, e.g.

[url=http://www.phpbb.com/][img]http://www.phpbb.com/theme/images/logos/blue/160x52.png[/img][/url]

would generate:

' + ), + array( + 0 => 'Adding attachments into a post', + 1 => 'Attachments can now be placed in any part of a post by using the new [attachment=][/attachment] 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.' + ), + array( + 0 => '--', + 1 => 'Other matters' + ), + array( + 0 => 'Can I add my own tags?', + 1 => 'If you are an administrator on this board and have the proper permissions, you can add further BBCodes through the Custom BBCodes section.' + ), +); diff --git a/sources/phpBB/language/en/help_faq.php b/sources/phpBB/language/en/help_faq.php new file mode 100644 index 0000000..69cb70d --- /dev/null +++ b/sources/phpBB/language/en/help_faq.php @@ -0,0 +1,355 @@ + +* @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; +} + +// 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 + +$help = array( + array( + 0 => '--', + 1 => 'Login and Registration Issues' + ), + array( + 0 => 'Why do I need to register?', + 1 => 'You may not have to, it is up to the administrator of the board as to whether you need to register in order to post messages. However; registration will give you access to additional features not available to guest users such as definable avatar images, private messaging, emailing of fellow users, usergroup subscription, etc. It only takes a few moments to register so it is recommended you do so.' + ), + array( + 0 => 'What is COPPA?', + 1 => 'COPPA, or the Children’s Online Privacy Protection Act of 1998, is a law in the United States requiring websites which can potentially collect information from minors under the age of 13 to have written parental consent or some other method of legal guardian acknowledgment, allowing the collection of personally identifiable information from a minor under the age of 13. If you are unsure if this applies to you as someone trying to register or to the website you are trying to register on, contact legal counsel for assistance. Please note that phpBB Limited and the owner’s of this board cannot provide legal advice and is not a point of contact for legal concerns of any kind, except as outlined in question “Who do I contact about abusive and/or legal matters related to this board?â€.', + ), + array( + 0 => 'Why can’t I register?', + 1 => 'It is possible a board administrator has disabled registration to prevent new visitors from signing up. A board administrator could have also banned your IP address or disallowed the username you are attempting to register. Contact a board administrator for assistance.', + ), + array( + 0 => 'I registered but cannot login!', + 1 => 'First, check your username and password. If they are correct, then one of two things may have happened. If COPPA support is enabled and you specified being under 13 years old during registration, you will have to follow the instructions you received. Some boards will also require new registrations to be activated, either by yourself or by an administrator before you can logon; this information was present during registration. If you were sent an email, follow the instructions. If you did not receive an email, you may have provided an incorrect email address or the email may have been picked up by a spam filer. If you are sure the email address you provided is correct, try contacting an administrator.' + ), + array( + 0 => 'Why can’t I login?', + 1 => 'There are several reasons why this could occur. First, ensure your username and password are correct. If they are, contact a board administrator to make sure you haven’t been banned. It is also possible the website owner has a configuration error on their end, and they would need to fix it.', + ), + array( + 0 => 'I registered in the past but cannot login any more?!', + 1 => 'It is possible an administrator has deactivated or deleted your account for some reason. Also, many boards periodically remove users who have not posted for a long time to reduce the size of the database. If this has happened, try registering again and being more involved in discussions.' + ), + array( + 0 => 'I’ve lost my password!', + 1 => 'Don’t panic! While your password cannot be retrieved, it can easily be reset. Visit the login page and click I forgot my password. Follow the instructions and you should be able to log in again shortly.
However, if you are not able to reset your password, contact a board administrator.', + ), + array( + 0 => 'Why do I get logged off automatically?', + 1 => 'If you do not check the Remember me 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 Remember me box during login. This is not recommended if you access the board from a shared computer, e.g. library, internet cafe, university computer lab, etc. If you do not see this checkbox, it means a board administrator has disabled this feature.', + ), + array( + 0 => 'What does the “Delete all board cookies†do?', + 1 => '“Delete all board cookies†deletes the cookies created by phpBB which keep you authenticated and logged into the board. Cookies also provide functions such as read tracking if they have been enabled by a board administrator. If you are having login or logout problems, deleting board cookies may help.', + ), + array( + 0 => '--', + 1 => 'User Preferences and settings' + ), + array( + 0 => 'How do I change my settings?', + 1 => 'If you are a registered user, all your settings are stored in the board database. To alter them, visit your User Control Panel; a link can usually be found by clicking on your username at the top of board pages. This system will allow you to change all your settings and preferences.', + ), + array( + 0 => 'How do I prevent my username appearing in the online user listings?', + 1 => 'Within your User Control Panel, under “Board preferencesâ€, you will find the option Hide your online status. Enable this option and you will only appear to the administrators, moderators and yourself. You will be counted as a hidden user.' + ), + array( + 0 => 'The times are not correct!', + 1 => '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.' + ), + array( + 0 => 'I changed the timezone and the time is still wrong!', + 1 => '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.' + ), + array( + 0 => 'My language is not in the list!', + 1 => 'Either the administrator has not installed your language or nobody has translated this board into your language. Try asking 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 phpBB® website.', + ), + array( + 0 => 'What are the images next to my username?', + 1 => 'There are two images which may appear along with a username when viewing posts. One of them may be an image associated with your rank, generally in the form of stars, blocks or dots, indicating how many posts you have made or your status on the board. Another, usually larger, image is known as an avatar and is generally unique or personal to each user.', + ), + array( + 0 => 'How do I display an avatar?', + 1 => 'Within your User Control Panel, under “Profile†you can add an avatar by using one of the four following methods: Gravatar, Gallery, Remote or Upload. It is up to the board administrator to enable avatars and to choose the way in which avatars can be made available. If you are unable to use avatars, contact a board administrator.', + ), + array( + 0 => 'What is my rank and how do I change it?', + 1 => '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.' + ), + array( + 0 => 'When I click the email link for a user it asks me to login?', + 1 => '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.' + ), + array( + 0 => '--', + 1 => 'Posting Issues' + ), + array( + 0 => 'How do I create a new topic or post a reply?', + 1 => 'To post a new topic in a forum, click "New Topic". To post a reply to a topic, click "Post Reply". You may need to register before you can post a message. A list of your permissions in each forum is available at the bottom of the forum and topic screens. Example: You can post new topics, You can post attachments, etc.', + ), + array( + 0 => 'How do I edit or delete a post?', + 1 => '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.' + ), + array( + 0 => 'How do I add a signature to my post?', + 1 => 'To add a signature to a post you must first create one via your User Control Panel. Once created, you can check the Attach a signature box on the posting form to add your signature. You can also add a signature by default to all your posts by checking the appropriate radio button in the User Control Panel. If you do so, you can still prevent a signature being added to individual posts by un-checking the add signature box within the posting form.' + ), + array( + 0 => 'How do I create a poll?', + 1 => '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.' + ), + array( + 0 => 'Why can’t I add more poll options?', + 1 => '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.' + ), + array( + 0 => 'How do I edit or delete a poll?', + 1 => '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.' + ), + array( + 0 => 'Why can’t I access a forum?', + 1 => '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.' + ), + array( + 0 => 'Why can’t I add attachments?', + 1 => '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.' + ), + array( + 0 => 'Why did I receive a warning?', + 1 => '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.' + ), + array( + 0 => 'How can I report posts to a moderator?', + 1 => '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.' + ), + array( + 0 => 'What is the “Save†button for in topic posting?', + 1 => 'This allows you to save drafts to be completed and submitted at a later date. To reload a saved draft, visit the User Control Panel.' + ), + array( + 0 => 'Why does my post need to be approved?', + 1 => '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.' + ), + array( + 0 => 'How do I bump my topic?', + 1 => '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.' + ), + array( + 0 => '--', + 1 => 'Formatting and Topic Types' + ), + array( + 0 => 'What is BBCode?', + 1 => '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 < and >. For more information on BBCode see the guide which can be accessed from the posting page.' + ), + array( + 0 => 'Can I use HTML?', + 1 => '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.' + ), + array( + 0 => 'What are Smilies?', + 1 => '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.' + ), + array( + 0 => 'Can I post images?', + 1 => '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.' + ), + array( + 0 => 'What are global announcements?', + 1 => '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.' + ), + array( + 0 => 'What are announcements?', + 1 => '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.' + ), + array( + 0 => 'What are sticky topics?', + 1 => '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.' + ), + array( + 0 => 'What are locked topics?', + 1 => '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.' + ), + array( + 0 => 'What are topic icons?', + 1 => '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.' + ), + // This block will switch the FAQ-Questions to the second template column + array( + 0 => '--', + 1 => '--' + ), + array( + 0 => '--', + 1 => 'User Levels and Groups' + ), + array( + 0 => 'What are Administrators?', + 1 => '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.' + ), + array( + 0 => 'What are Moderators?', + 1 => '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.' + ), + array( + 0 => 'What are usergroups?', + 1 => '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.' + ), + array( + 0 => 'Where are the usergroups and how do I join one?', + 1 => '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.' + ), + array( + 0 => 'How do I become a usergroup leader?', + 1 => '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.', + ), + array( + 0 => 'Why do some usergroups appear in a different colour?', + 1 => '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.' + ), + array( + 0 => 'What is a “Default usergroupâ€?', + 1 => '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.' + ), + array( + 0 => 'What is “The team†link?', + 1 => 'This page provides you with a list of board staff, including board administrators and moderators and other details such as the forums they moderate.' + ), + array( + 0 => '--', + 1 => 'Private Messaging' + ), + array( + 0 => 'I cannot send private messages!', + 1 => '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.' + ), + array( + 0 => 'I keep getting unwanted private messages!', + 1 => 'You can automatically delete private messages from a user by using message rules within your User Control Panel. If you are receiving abusive private messages from a particular user, report the messages to the moderators; they have the power to prevent a user from sending private messages.' + ), + array( + 0 => 'I have received a spamming or abusive email from someone on this board!', + 1 => '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.' + ), + array( + 0 => '--', + 1 => 'Friends and Foes' + ), + array( + 0 => 'What are my Friends and Foes lists?', + 1 => '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.' + ), + array( + 0 => 'How can I add / remove users to my Friends or Foes list?', + 1 => '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.' + ), + array( + 0 => '--', + 1 => 'Searching the Forums' + ), + array( + 0 => 'How can I search a forum or forums?', + 1 => '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.' + ), + array( + 0 => 'Why does my search return no results?', + 1 => 'Your search was probably too vague and included many common terms which are not indexed by phpBB. Be more specific and use the options available within Advanced search.', + ), + array( + 0 => 'Why does my search return a blank page!?', + 1 => '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.' + ), + array( + 0 => 'How do I search for members?', + 1 => 'Visit to the “Members†page and click the “Find a member†link.' + ), + array( + 0 => 'How can I find my own posts and topics?', + 1 => 'Your own posts can be retrieved either by clicking the “Show your posts†link within the User Control Panel or by clicking the “Search user’s posts†link via your own profile page or by clicking the “Quick links†menu at the top of the board. To search for your topics, use the Advanced search page and fill in the various options appropriately.', + ), + array( + 0 => '--', + 1 => 'Subscriptions and Bookmarks', + ), + array( + 0 => 'What is the difference between bookmarking and subscribing?', + 1 => 'In phpBB 3.0, bookmarking topics worked much like bookmarking in a web browser. You were not alerted when there was an update. As of phpBB 3.1, bookmarking is more like subscribing to a topic. You can be notified when a bookmarked topic is updated. Subscribing, however, will notify you when there is an update to a topic or forum on the board. Notification options for bookmarks and subscriptions can be configured in the User Control Panel, under “Board preferencesâ€.', + ), + array( + 0 => 'How do I bookmark or subscribe to specific topics?', + 1 => 'You can bookmark or subscribe to a specific topic by clicking the appropriate link in the “Topic tools†menu, conveniently located near the top and bottom of a topic discussion.
Replying to a topic with the “Notify me when a reply is posted†option checked will also subscribe you to the topic.', + ), + array( + 0 => 'How do I subscribe to specific forums?', + 1 => 'To subscribe to a specific forum, click the “Subscribe forum†link, at the bottom of page, upon entering the forum.', + ), + array( + 0 => 'How do I remove my subscriptions?', + 1 => 'To remove your subscriptions, go to your User Control Panel and follow the links to your subscriptions.' + ), + array( + 0 => '--', + 1 => 'Attachments' + ), + array( + 0 => 'What attachments are allowed on this board?', + 1 => '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.' + ), + array( + 0 => 'How do I find all my attachments?', + 1 => 'To find your list of attachments that you have uploaded, go to your User Control Panel and follow the links to the attachments section.' + ), + array( + 0 => '--', + 1 => 'phpBB Issues', + ), + array( + 0 => 'Who wrote this bulletin board?', + 1 => 'This software (in its unmodified form) is produced, released and is copyright phpBB Limited. It is made available under the GNU General Public License, version 2 (GPL-2.0) and may be freely distributed. See About phpBB for more details.', + ), + array( + 0 => 'Why isn’t X feature available?', + 1 => 'This software was written by and licensed through phpBB Limited. If you believe a feature needs to be added please visit the phpBB Ideas Centre, where you can upvote existing ideas or suggest new features.' + ), + array( + 0 => 'Who do I contact about abusive and/or legal matters related to this board?', + 1 => 'Any of the administrators listed on the “The team†page should be an appropriate point of contact for your complaints. If this still gets no response then you should contact the owner of the domain (do a whois lookup) 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 absolutely no jurisdiction 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 not directly related to the phpBB.com website or the discrete software of phpBB itself. If you do email phpBB Limited about any third party use of this software then you should expect a terse response or no response at all.' + ), + array( + 0 => 'How do I contact a board administrator?', + 1 => 'All users of the board can use the “Contact us†form, if the option was enabled by the board administrator.
Members of the board can also use the “The team†link.', + ), +); diff --git a/sources/phpBB/language/en/index.htm b/sources/phpBB/language/en/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/language/en/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/language/en/install.php b/sources/phpBB/language/en/install.php new file mode 100644 index 0000000..dd22e84 --- /dev/null +++ b/sources/phpBB/language/en/install.php @@ -0,0 +1,632 @@ + +* @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 + +$lang = array_merge($lang, array( + '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_TEST' => 'Check administrator settings', + 'ADMIN_USERNAME' => 'Administrator username', + 'ADMIN_USERNAME_EXPLAIN' => 'Please enter a username between 3 and 20 characters in length.', + 'APP_MAGICK' => 'Imagemagick support [ Attachments ]', + 'AUTHOR_NOTES' => 'Author notes
» %s', + 'AVAILABLE' => 'Available', + 'AVAILABLE_CONVERTORS' => 'Available convertors', + + 'BEGIN_CONVERT' => 'Begin conversion', + 'BLANK_PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using no table prefix.', + 'BOARD_NOT_INSTALLED' => 'No installation found', + 'BOARD_NOT_INSTALLED_EXPLAIN' => 'The phpBB Unified Convertor Framework requires a default installation of phpBB3 to function, please proceed by first installing phpBB3.', + 'BACKUP_NOTICE' => 'Please backup your board before updating in case any problems arise during the update process.', + + 'CATEGORY' => 'Category', + 'CACHE_STORE' => 'Cache type', + 'CACHE_STORE_EXPLAIN' => 'The physical location where data is cached, filesystem is preferred.', + 'CAT_CONVERT' => 'Convert', + 'CAT_INSTALL' => 'Install', + 'CAT_OVERVIEW' => 'Overview', + 'CAT_UPDATE' => 'Update', + 'CHANGE' => 'Change', + 'CHECK_TABLE_PREFIX' => 'Please check your table prefix and try again.', + 'CLEAN_VERIFY' => 'Cleaning up and verifying the final structure', + 'CLEANING_USERNAMES' => 'Cleaning usernames', + 'COLLIDING_CLEAN_USERNAME' => '%s is the clean username for:', + 'COLLIDING_USERNAMES_FOUND' => 'Colliding usernames were found on your old board. In order to complete the conversion please delete or rename these users so that there is only one user on your old board for each clean username.', + 'COLLIDING_USER' => '» user id: %d username: %s (%d posts)', + 'CONFIG_CONVERT' => 'Converting the configuration', + 'CONFIG_FILE_UNABLE_WRITE' => 'It was not possible to write the configuration file. Alternative methods for this file to be created are presented below.', + 'CONFIG_FILE_WRITTEN' => 'The configuration file has been written. You may now proceed to the next step of the installation.', + 'CONFIG_PHPBB_EMPTY' => 'The phpBB3 config variable for “%s†is empty.', + 'CONFIG_RETRY' => 'Retry', + 'CONTINUE_CONVERT' => 'Continue conversion', + 'CONTINUE_CONVERT_BODY' => 'A previous conversion attempt has been determined. You are now able to choose between starting a new conversion or continuing the conversion.', + 'CONTINUE_LAST' => 'Continue last statements', + 'CONTINUE_OLD_CONVERSION' => 'Continue previously started conversion', + 'CONVERT' => 'Convert', + 'CONVERT_COMPLETE' => 'Conversion completed', + 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.1. You can now login and access your board. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the Documentation and the support forums.', + 'CONVERT_INTRO' => 'Welcome to the phpBB Unified Convertor Framework', + 'CONVERT_INTRO_BODY' => 'From here, you are able to import data from other (installed) board systems. The list below shows all the conversion modules currently available. If there is no convertor shown in this list for the board software you wish to convert from, please check our website where further conversion modules may be available for download.', + 'CONVERT_NEW_CONVERSION' => 'New conversion', + 'CONVERT_NOT_EXIST' => 'The specified convertor does not exist.', + 'CONVERT_OPTIONS' => 'Options', + 'CONVERT_SETTINGS_VERIFIED' => 'The information you entered has been verified. To start the conversion process, please push the button below.', + 'CONV_ERR_FATAL' => 'Fatal conversion error', + + 'CONV_ERROR_ATTACH_FTP_DIR' => 'FTP upload for attachments is enabled at the old board. Please disable the FTP upload option and make sure a valid upload directory is specified, then copy all attachment files to this new web accessible directory. Once you have done this, restart the convertor.', + 'CONV_ERROR_CONFIG_EMPTY' => 'There is no configuration information available for the conversion.', + 'CONV_ERROR_FORUM_ACCESS' => 'Unable to get forum access information.', + 'CONV_ERROR_GET_CATEGORIES' => 'Unable to get categories.', + 'CONV_ERROR_GET_CONFIG' => 'Could not retrieve your board configuration.', + 'CONV_ERROR_COULD_NOT_READ' => 'Unable to access/read “%sâ€.', + 'CONV_ERROR_GROUP_ACCESS' => 'Unable to get group authentication information.', + 'CONV_ERROR_INCONSISTENT_GROUPS' => 'Inconsistency in groups table detected in add_bots() - you need to add all special groups if you do it manually.', + 'CONV_ERROR_INSERT_BOT' => 'Unable to insert bot into users table.', + 'CONV_ERROR_INSERT_BOTGROUP' => 'Unable to insert bot into bots table.', + 'CONV_ERROR_INSERT_USER_GROUP' => 'Unable to insert user into user_group table.', + 'CONV_ERROR_MESSAGE_PARSER' => 'Message parser error', + 'CONV_ERROR_NO_AVATAR_PATH' => 'Note to developer: you must specify $convertor[\'avatar_path\'] to use %s.', + 'CONV_ERROR_NO_FORUM_PATH' => 'The relative path to the source board has not been specified.', + 'CONV_ERROR_NO_GALLERY_PATH' => 'Note to developer: you must specify $convertor[\'avatar_gallery_path\'] to use %s.', + 'CONV_ERROR_NO_GROUP' => 'Group “%1$s†could not be found in %2$s.', + 'CONV_ERROR_NO_RANKS_PATH' => 'Note to developer: you must specify $convertor[\'ranks_path\'] to use %s.', + 'CONV_ERROR_NO_SMILIES_PATH' => 'Note to developer: you must specify $convertor[\'smilies_path\'] to use %s.', + 'CONV_ERROR_NO_UPLOAD_DIR' => 'Note to developer: you must specify $convertor[\'upload_path\'] to use %s.', + 'CONV_ERROR_PERM_SETTING' => 'Unable to insert/update permission setting.', + 'CONV_ERROR_PM_COUNT' => 'Unable to select folder pm count.', + 'CONV_ERROR_REPLACE_CATEGORY' => 'Unable to insert new forum replacing old category.', + 'CONV_ERROR_REPLACE_FORUM' => 'Unable to insert new forum replacing old forum.', + 'CONV_ERROR_USER_ACCESS' => 'Unable to get user authentication information.', + 'CONV_ERROR_WRONG_GROUP' => 'Wrong group “%1$s†defined in %2$s.', + 'CONV_OPTIONS_BODY' => 'This page collects the data required to access the source board. Enter the database details of your former board; the converter will not change anything in the database given below. The source board should be disabled to allow a consistent conversion.', + 'CONV_SAVED_MESSAGES' => 'Saved messages', + + 'COULD_NOT_COPY' => 'Could not copy file %1$s to %2$s

Please check that the target directory exists and is writable by the webserver.', + 'COULD_NOT_FIND_PATH' => 'Could not find path to your former board. Please check your settings and try again.
» %s was specified as the source path.', + + 'DBMS' => 'Database type', + 'DB_CONFIG' => 'Database configuration', + 'DB_CONNECTION' => 'Database connection', + 'DB_ERR_INSERT' => 'Error while processing INSERT query.', + 'DB_ERR_LAST' => 'Error while processing query_last.', + 'DB_ERR_QUERY_FIRST' => 'Error while executing query_first.', + 'DB_ERR_QUERY_FIRST_TABLE' => 'Error while executing query_first, %s (“%sâ€).', + 'DB_ERR_SELECT' => 'Error while running SELECT query.', + '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_NAME' => 'Database name', + 'DB_PASSWORD' => 'Database password', + 'DB_PORT' => 'Database server port', + 'DB_PORT_EXPLAIN' => 'Leave this blank unless you know the server operates on a non-standard port.', + 'DB_UPDATE_NOT_SUPPORTED' => 'We are sorry, but this script does not support updating from versions of phpBB prior to “%1$sâ€. The version you currently have installed is “%2$sâ€. Please update to a previous version before running this script. Assistance with this is available in the Support Forum on phpBB.com.', + 'DB_USERNAME' => 'Database username', + 'DB_TEST' => 'Test connection', + 'DEFAULT_LANG' => 'Default board language', + 'DEFAULT_PREFIX_IS' => 'The convertor was not able to find tables with the specified prefix. Please make sure you have entered the correct details for the board you are converting from. The default table prefix for %1$s is %2$s.', + 'DEV_NO_TEST_FILE' => 'No value has been specified for the test_file variable in the convertor. If you are a user of this convertor, you should not be seeing this error, please report this message to the convertor author. If you are a convertor author, you must specify the name of a file which exists in the source board to allow the path to it to be verified.', + 'DIRECTORIES_AND_FILES' => 'Directory and file setup', + 'DISABLE_KEYS' => 'Disabling keys', + 'DLL_FTP' => 'Remote FTP support [ Installation ]', + 'DLL_GD' => 'GD graphics support [ Visual Confirmation ]', + 'DLL_MBSTRING' => 'Multi-byte character support', + 'DLL_MSSQL' => 'MSSQL Server 2000+', + 'DLL_MSSQL_ODBC' => 'MSSQL Server 2000+ via ODBC', + 'DLL_MSSQLNATIVE' => 'MSSQL Server 2005+ [ Native ]', + 'DLL_MYSQL' => 'MySQL', + 'DLL_MYSQLI' => 'MySQL with MySQLi Extension', + 'DLL_ORACLE' => 'Oracle', + 'DLL_POSTGRES' => 'PostgreSQL', + 'DLL_SQLITE' => 'SQLite 2', + 'DLL_SQLITE3' => 'SQLite 3', + 'DLL_XML' => 'XML support [ Jabber ]', + 'DLL_ZLIB' => 'zlib compression support [ gz, .tar.gz, .zip ]', + 'DL_CONFIG' => 'Download config', + 'DL_CONFIG_EXPLAIN' => 'You may download the complete config.php to your own PC. You will then need to upload the file manually, replacing any existing config.php in your phpBB 3.1 root directory. Please remember to upload the file in ASCII format (see your FTP application documentation if you are unsure how to achieve this). When you have uploaded the config.php please click “Done†to move to the next stage.', + 'DL_DOWNLOAD' => 'Download', + 'DONE' => 'Done', + + 'ENABLE_KEYS' => 'Re-enabling keys. This can take a while.', + + 'FILES_OPTIONAL' => 'Optional files and directories', + 'FILES_OPTIONAL_EXPLAIN' => 'Optional - These files, directories or permission settings are not required. The installation system will attempt to use various techniques to create them if they do not exist or cannot be written to. However, the presence of these will speed installation.', + 'FILES_REQUIRED' => 'Files and Directories', + 'FILES_REQUIRED_EXPLAIN' => 'Required - In order to function correctly phpBB needs to be able to access or write to certain files or directories. If you see “Not Found†you need to create the relevant file or directory. If you see “Unwritable†you need to change the permissions on the file or directory to allow phpBB to write to it.', + 'FILLING_TABLE' => 'Filling table %s', + 'FILLING_TABLES' => 'Filling tables', + + 'FINAL_STEP' => 'Process final step', + 'FORUM_ADDRESS' => 'Board address', + 'FORUM_ADDRESS_EXPLAIN' => 'This is the URL of your former board, for example http://www.example.com/phpBB2/. If an address is entered here and not left empty every instance of this address will be replaced by your new board address within messages, private messages and signatures.', + 'FORUM_PATH' => 'Board path', + 'FORUM_PATH_EXPLAIN' => 'This is the relative path on disk to your former board from the root of this phpBB3 installation.', + 'FOUND' => 'Found', + 'FTP_CONFIG' => 'Transfer config by FTP', + 'FTP_CONFIG_EXPLAIN' => 'phpBB has detected the presence of the FTP module on this server. You may attempt to install your config.php via this if you wish. You will need to supply the information listed below. Remember your username and password are those to your server! (ask your hosting provider for details if you are unsure what these are).', + 'FTP_PATH' => 'FTP path', + 'FTP_PATH_EXPLAIN' => 'This is the path from your root directory to that of phpBB, e.g. htdocs/phpBB3/.', + 'FTP_UPLOAD' => 'Upload', + + 'GPL' => 'General Public License', + + 'INITIAL_CONFIG' => 'Basic configuration', + 'INITIAL_CONFIG_EXPLAIN' => 'Now that install has determined your server can run phpBB you need to supply some specific information. If you do not know how to connect to your database please contact your hosting provider (in the first instance) or use the phpBB support forums. When entering data please ensure you check it thoroughly before continuing.', + 'INSTALL_CONGRATS' => 'Congratulations!', + 'INSTALL_CONGRATS_EXPLAIN' => ' + You have successfully installed phpBB %1$s. Please proceed by choosing one of the following options:

+

Convert an existing board to phpBB3

+

The phpBB Unified Convertor Framework supports the conversion of phpBB 2.0.x and other board systems to phpBB3. If you have an existing board that you wish to convert, please proceed to the convertor.

+

Go live with your phpBB3!

+

Clicking the button below will take you to a form for submitting statistical data to phpBB in your Administration Control Panel (ACP). We would appreciate it if you could help us by sending that information. Afterwards you should take some time to examine the options available to you. Remember that help is available online via the Documentation, README and the Support Forums.

Please delete, move or rename the install directory before using your board. While this directory exists, only the Administration Control Panel (ACP) will be accessible.', + 'INSTALL_INTRO' => 'Welcome to Installation', + + 'INSTALL_INTRO_BODY' => 'With this option, it is possible to install phpBB3 onto your server.

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:

+ +
    +
  • The Database Type - the database you will be using.
  • +
  • The Database server hostname or DSN - the address of the database server.
  • +
  • The Database server port - the port of the database server (most of the time this is not needed).
  • +
  • The Database name - the name of the database on the server.
  • +
  • The Database username and Database password - the login data to access the database.
  • +
+ +

Note: 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.

+ +

phpBB3 supports the following databases:

+
    +
  • MySQL 3.23 or above (MySQLi supported)
  • +
  • PostgreSQL 8.3+
  • +
  • SQLite 2.8.2+
  • +
  • SQLite 3.6.15+
  • +
  • MS SQL Server 2000 or above (directly or via ODBC)
  • +
  • MS SQL Server 2005 or above (native)
  • +
  • Oracle
  • +
+ +

Only those databases supported on your server will be displayed.', + 'INSTALL_INTRO_NEXT' => 'To commence the installation, please press the button below.', + 'INSTALL_LOGIN' => 'Login', + 'INSTALL_NEXT' => 'Next stage', + 'INSTALL_NEXT_FAIL' => 'Some tests failed and you should correct these problems before proceeding to the next stage. Failure to do so may result in an incomplete installation.', + 'INSTALL_NEXT_PASS' => 'All the basic tests have been passed and you may proceed to the next stage of installation. If you have changed any permissions, modules, etc. and wish to re-test you can do so if you wish.', + 'INSTALL_PANEL' => 'Installation Panel', + 'INSTALL_SEND_CONFIG' => 'Unfortunately phpBB could not write the configuration information directly to your config.php. This may be because the file does not exist or is not writable. A number of options will be listed below enabling you to complete installation of config.php.', + 'INSTALL_START' => 'Start install', + 'INSTALL_TEST' => 'Test again', + 'INST_ERR' => 'Installation error', + 'INST_ERR_DB_CONNECT' => 'Could not connect to the database, see error message below.', + '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_INVALID_PREFIX'=> 'The prefix you entered is invalid. It must start with a letter and must only contain letters, numbers and underscores.', + 'INST_ERR_DB_NO_ERROR' => 'No error message given.', + '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 NLS_CHARACTERSET parameter to UTF8. 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 UNICODE or UTF8 encoding. Try installing with a database in UNICODE or UTF8 encoding.', + 'INST_ERR_DB_NO_NAME' => 'No database name specified.', + 'INST_ERR_EMAIL_INVALID' => 'The email address you entered is invalid.', + 'INST_ERR_EMAIL_MISMATCH' => 'The emails you entered did not match.', + 'INST_ERR_FATAL' => 'Fatal installation error', + 'INST_ERR_FATAL_DB' => 'A fatal and unrecoverable database error has occurred. This may be because the specified user does not have appropriate permissions to CREATE TABLES or INSERT data, etc. Further information may be given below. Please contact your hosting provider in the first instance or the support forums of phpBB for further assistance.', + 'INST_ERR_FTP_PATH' => 'Could not change to the given directory, please check the path.', + 'INST_ERR_FTP_LOGIN' => 'Could not login to FTP server, check your username and password.', + 'INST_ERR_MISSING_DATA' => 'You must fill out all fields in this block.', + 'INST_ERR_NO_DB' => 'Cannot load the PHP module for the selected database type.', + '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_PREFIX' => 'Tables with the specified prefix already exist, please choose an alternative.', + 'INST_ERR_PREFIX_INVALID' => 'The table prefix you have specified is invalid for your database. Please try another, removing characters such as the hyphen.', + 'INST_ERR_PREFIX_TOO_LONG' => 'The table prefix you have specified is too long. The maximum length is %d 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.', + 'INVALID_PRIMARY_KEY' => 'Invalid primary key : %s', + + 'LONG_SCRIPT_EXECUTION' => 'Please note that this can take a while... Please do not stop the script.', + + // mbstring + 'MBSTRING_CHECK' => 'mbstring extension check', + 'MBSTRING_CHECK_EXPLAIN' => 'Required - mbstring is a PHP extension that provides multibyte string functions. Certain features of mbstring are not compatible with phpBB and must be disabled.', + 'MBSTRING_FUNC_OVERLOAD' => 'Function overloading', + 'MBSTRING_FUNC_OVERLOAD_EXPLAIN' => 'mbstring.func_overload must be set to either 0 or 4.', + 'MBSTRING_ENCODING_TRANSLATION' => 'Transparent character encoding', + 'MBSTRING_ENCODING_TRANSLATION_EXPLAIN' => 'mbstring.encoding_translation must be set to 0.', + 'MBSTRING_HTTP_INPUT' => 'HTTP input character conversion', + 'MBSTRING_HTTP_INPUT_EXPLAIN' => 'mbstring.http_input must be set to pass.', + 'MBSTRING_HTTP_OUTPUT' => 'HTTP output character conversion', + 'MBSTRING_HTTP_OUTPUT_EXPLAIN' => 'mbstring.http_output must be set to pass.', + + 'MAKE_FOLDER_WRITABLE' => 'Please make sure that this folder exists and is writable by the webserver then try again:
»%s.', + 'MAKE_FOLDERS_WRITABLE' => 'Please make sure that these folders exist and are writable by the webserver then try again:
»%s.', + + 'MYSQL_SCHEMA_UPDATE_REQUIRED' => 'Your MySQL database schema for phpBB is outdated. phpBB detected a schema for MySQL 3.x/4.x, but the server runs on MySQL %2$s.
Before you proceed the update, you need to upgrade the schema.

Please refer to the Knowledge Base article about upgrading the MySQL schema. If you encounter problems, please use our support forums.', + + 'NAMING_CONFLICT' => 'Naming conflict: %s and %s are both aliases

%s', + 'NEXT_STEP' => 'Proceed to next step', + 'NOT_FOUND' => 'Cannot find', + 'NOT_UNDERSTAND' => 'Could not understand %s #%d, table %s (“%sâ€)', + 'NO_CONVERTORS' => 'No convertors are available for use.', + 'NO_CONVERT_SPECIFIED' => 'No convertor specified.', + 'NO_LOCATION' => 'Cannot determine location. If you know Imagemagick is installed, you may specify the location later within your administration control panel', + 'NO_TABLES_FOUND' => 'No tables found.', + + 'OVERVIEW_BODY' => 'Welcome to phpBB3!

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.

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 the installation guide.

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.', + + '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_GETIMAGESIZE_SUPPORT' => 'PHP function getimagesize() is available', + 'PHP_GETIMAGESIZE_SUPPORT_EXPLAIN' => 'Required - In order for phpBB to function correctly, the getimagesize function needs to be available.', + 'PHP_JSON_SUPPORT' => 'PHP JSON support', + 'PHP_JSON_SUPPORT_EXPLAIN' => 'Required - In order for phpBB to function correctly, the PHP JSON extension needs to be available.', + 'PHP_OPTIONAL_MODULE' => 'Optional modules', + 'PHP_OPTIONAL_MODULE_EXPLAIN' => 'Optional - These modules or applications are optional. However, if they are available they will enable extra features.', + 'PHP_SUPPORTED_DB' => 'Supported databases', + 'PHP_SUPPORTED_DB_EXPLAIN' => 'Required - 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.', + 'PHP_REGISTER_GLOBALS' => 'PHP setting register_globals is disabled', + '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' => 'Required - You must be running at least version 5.3.3 of PHP in order to install phpBB. If safe mode 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 allow_url_fopen is enabled', + 'PHP_URL_FOPEN_SUPPORT_EXPLAIN' => 'Optional - 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', + 'POST_ID' => 'Post ID', + 'PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using %s as table prefix.', + 'PREPROCESS_STEP' => 'Executing pre-processing functions/queries', + 'PRE_CONVERT_COMPLETE' => 'All pre-conversion steps have successfully been completed. You may now begin the actual conversion process. Please note that you may have to manually do and adjust several things. After conversion, especially check the permissions assigned, rebuild your search index which is not converted and also make sure files got copied correctly, for example avatars and smilies.', + 'PROCESS_LAST' => 'Processing last statements', + + 'REFRESH_PAGE' => 'Refresh page to continue conversion', + 'REFRESH_PAGE_EXPLAIN' => 'If set to yes, the convertor will refresh the page to continue the conversion after having finished a step. If this is your first conversion for testing purposes and to determine any errors in advance, we suggest to set this to No.', + 'REQUIREMENTS_TITLE' => 'Installation compatibility', + 'REQUIREMENTS_EXPLAIN' => 'Before proceeding with the full installation phpBB will carry out some tests on your server configuration and files to ensure that you are able to install and run phpBB. Please ensure you read through the results thoroughly and do not proceed until all the required tests are passed. If you wish to use any of the features depending on the optional tests, you should ensure that these tests are passed also.', + '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. /phpBB3.', + '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):', + 'SOFTWARE' => 'Board software', + 'SPECIFY_OPTIONS' => 'Specify conversion options', + 'STAGE_ADMINISTRATOR' => 'Administrator details', + 'STAGE_ADVANCED' => 'Advanced settings', + 'STAGE_ADVANCED_EXPLAIN' => 'The settings on this page are only necessary to set if you know that you require something different from the default. If you are unsure, just proceed to the next page, as these settings can be altered from the Administration Control Panel later.', + 'STAGE_CONFIG_FILE' => 'Configuration file', + 'STAGE_CREATE_TABLE' => 'Create database tables', + 'STAGE_CREATE_TABLE_EXPLAIN' => 'The database tables used by phpBB 3.1 have been created and populated with some initial data. Proceed to the next screen to finish installing phpBB.', + 'STAGE_DATABASE' => 'Database settings', + 'STAGE_FINAL' => 'Final stage', + 'STAGE_INTRO' => 'Introduction', + 'STAGE_IN_PROGRESS' => 'Conversion in progress', + 'STAGE_REQUIREMENTS' => 'Requirements', + 'STAGE_SETTINGS' => 'Settings', + 'STARTING_CONVERT' => 'Starting conversion process', + 'STEP_PERCENT_COMPLETED' => 'Step %d of %d', + 'SUB_INTRO' => 'Introduction', + 'SUB_LICENSE' => 'License', + 'SUB_SUPPORT' => 'Support', + 'SUCCESSFUL_CONNECT' => 'Successful connection', + 'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB3, free of charge. This includes:

  • installation
  • configuration
  • technical questions
  • problems relating to potential bugs in the software
  • updating from Release Candidate (RC) versions to the latest stable version
  • converting from phpBB 2.0.x to phpBB3
  • converting from other discussion board software to phpBB3 (please see the Convertors Forum)

We encourage users still running beta versions of phpBB3 to replace their installation with a fresh copy of the latest version.

Extensions / Styles

For issues relating to Extensions, please post in the appropriate Extensions Forum.
For issues relating to styles, templates and themes, please post in the appropriate Styles Forum.

If your question relates to a specific package, please post directly in the topic dedicated to the package.

Obtaining Support

The phpBB Welcome Package
Support Section
Quick Start Guide

To ensure you stay up to date with the latest news and releases, why not subscribe to our mailing list?

', + 'SYNC_FORUMS' => 'Starting to synchronise forums', + 'SYNC_POST_COUNT' => 'Synchronising post_counts', + 'SYNC_POST_COUNT_ID' => 'Synchronising post_counts from entry %1$s to %2$s.', + 'SYNC_TOPICS' => 'Starting to synchronise topics', + 'SYNC_TOPIC_ID' => 'Synchronising topics from topic_id %1$s to %2$s.', + + 'TABLES_MISSING' => 'Could not find these tables
» %s.', + '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.', + 'TABLE_PREFIX_SAME' => 'The table prefix needs to be the one used by the software you are converting from.
» Specified table prefix was %s.', + 'TESTS_PASSED' => 'Tests passed', + 'TESTS_FAILED' => 'Tests failed', + + 'UNABLE_WRITE_LOCK' => 'Unable to write lock file.', + 'UNAVAILABLE' => 'Unavailable', + 'UNWRITABLE' => 'Unwritable', + 'UPDATE_TOPICS_POSTED' => 'Generating topics posted information', + 'UPDATE_TOPICS_POSTED_ERR' => 'An error occurred while generating topics posted information. You can retry this step in the ACP after the conversion process is completed.', + 'VERIFY_OPTIONS' => 'Verifying conversion options', + 'VERSION' => 'Version', + + 'WELCOME_INSTALL' => 'Welcome to phpBB3 Installation', + 'WRITABLE' => 'Writable', +)); + +// Updater +$lang = array_merge($lang, array( + 'ALL_FILES_UP_TO_DATE' => 'All files are up to date with the latest phpBB version.', + 'ARCHIVE_FILE' => 'Source file within archive', + + 'BACK' => 'Back', + 'BINARY_FILE' => 'Binary file', + 'BOT' => 'Spider/Robot', + + 'CHANGE_CLEAN_NAMES' => 'The method used to make sure a username is not used by multiple users has been changed. There are some users which have the same name when compared with the new method. You have to delete or rename these users to make sure that each name is only used by one user before you can proceed.', + 'CHECK_FILES' => 'Check files', + 'CHECK_FILES_AGAIN' => 'Check files again', + 'CHECK_FILES_EXPLAIN' => 'Within the next step all files will be checked against the update files - this can take a while if this is the first file check.', + 'CHECK_FILES_UP_TO_DATE' => 'According to your database your version is up to date. You may want to proceed with the file check to make sure all files are really up to date with the latest phpBB version.', + 'CHECK_UPDATE_DATABASE' => 'Continue update process', + 'COLLECTED_INFORMATION' => 'File information', + 'COLLECTED_INFORMATION_EXPLAIN' => 'The list below shows information about the files needing an update. Please read the information in front of every status block to see what they mean and what you may need to do to perform a successful update.', + 'COLLECTING_FILE_DIFFS' => 'Collecting file differences', + 'COMPLETE_LOGIN_TO_BOARD' => 'You should now login to your board and check if everything is working fine. Do not forget to delete, rename or move your install directory!', + 'CONTINUE_UPDATE_NOW' => 'Continue the update process now', // Shown within the database update script at the end if called from the updater + 'CONTINUE_UPDATE' => 'Continue update now', // Shown after file upload to indicate the update process is not yet finished + 'CURRENT_FILE' => 'Begin of Conflict - Original File code before update', + 'CURRENT_VERSION' => 'Current version', + + 'DATABASE_TYPE' => 'Database type', + 'DATABASE_UPDATE_COMPLETE' => 'Database updater has completed!', + 'DATABASE_UPDATE_CONTINUE' => 'Continue database update', + 'DATABASE_UPDATE_INFO_OLD' => 'The database update file within the install directory is outdated. Please make sure you uploaded the correct version of the file.', + 'DATABASE_UPDATE_NOT_COMPLETED' => 'The database update has not yet completed.', + 'DELETE_USER_REMOVE' => 'Delete user and remove posts', + 'DELETE_USER_RETAIN' => 'Delete user but keep posts', + 'DESTINATION' => 'Destination file', + 'DIFF_INLINE' => 'Inline', + 'DIFF_RAW' => 'Raw unified diff', + 'DIFF_SEP_EXPLAIN' => 'Code block used within the updated/new file', + 'DIFF_SIDE_BY_SIDE' => 'Side by Side', + 'DIFF_UNIFIED' => 'Unified diff', + 'DO_NOT_UPDATE' => 'Do not update this file', + 'DONE' => 'Done', + 'DOWNLOAD' => 'Download', + 'DOWNLOAD_AS' => 'Download as', + 'DOWNLOAD_UPDATE_METHOD_BUTTON' => 'Download modified files archive (recommended)', + 'DOWNLOAD_CONFLICTS' => 'Download conflicts for this file', + 'DOWNLOAD_CONFLICTS_EXPLAIN' => 'Search for <<< to spot conflicts', + 'DOWNLOAD_UPDATE_METHOD' => 'Download modified files archive', + 'DOWNLOAD_UPDATE_METHOD_EXPLAIN' => 'Once downloaded you should unpack the archive. You will find the modified files you need to upload to your phpBB root directory within it. Please upload the files to their respective locations then. After you have uploaded all files, please check the files again with the other button below.', + + 'EDIT_USERNAME' => 'Edit username', + 'ERROR' => 'Error', + 'EVERYTHING_UP_TO_DATE' => 'Everything is up to date with the latest phpBB version. You should now login to your board and check if everything is working fine. Do not forget to delete, rename or move your install directory! Please send us updated information about your server and board configurations from the Send statistics module in your ACP.', + + 'FILE_ALREADY_UP_TO_DATE' => 'File is already up to date.', + 'FILE_DIFF_NOT_ALLOWED' => 'File not allowed to be diffed.', + 'FILE_USED' => 'Information used from', // Single file + 'FILES_CONFLICT' => 'Conflict files', + 'FILES_CONFLICT_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. phpBB determined that these files create conflicts if they are tried to be merged. Please investigate the conflicts and try to manually resolve them or continue the update choosing the preferred merging method. If you resolve the conflicts manually check the files again after you modified them. You are also able to choose between the preferred merge method for every file. The first one will result in a file where the conflicting lines from your old file will be lost, the other one will result in losing the changes from the newer file.', + 'FILES_DELETED' => 'Deleted files', + 'FILES_DELETED_EXPLAIN' => 'The following files do not exist in the new version. These files have to be deleted from your installation.', + 'FILES_MODIFIED' => 'Modified files', + 'FILES_MODIFIED_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. The updated file will be a merge between your modifications and the new file.', + 'FILES_NEW' => 'New files', + 'FILES_NEW_EXPLAIN' => 'The following files currently do not exist within your installation. These files will be added to your installation.', + 'FILES_NEW_CONFLICT' => 'New conflicting files', + 'FILES_NEW_CONFLICT_EXPLAIN' => 'The following files are new within the latest version but it has been determined that there is already a file with the same name within the same position. This file will be overwritten by the new file.', + 'FILES_NOT_MODIFIED' => 'Not modified files', + 'FILES_NOT_MODIFIED_EXPLAIN' => 'The following files are not modified and represent the original phpBB files from the version you want to update from.', + 'FILES_UP_TO_DATE' => 'Already updated files', + 'FILES_UP_TO_DATE_EXPLAIN' => 'The following files are already up to date and do not need to be updated.', + 'FTP_SETTINGS' => 'FTP settings', + 'FTP_UPDATE_METHOD' => 'FTP upload', + + 'INCOMPATIBLE_UPDATE_FILES' => 'The update files found are incompatible with your installed version. Your installed version is %1$s and the update file is for updating phpBB %2$s to %3$s.', + 'INCOMPLETE_UPDATE_FILES' => 'The update files are incomplete.', + 'INLINE_UPDATE_SUCCESSFUL' => 'The database update was successful. Now you need to continue the update process.', + + 'KEEP_OLD_NAME' => 'Keep username', + + 'LATEST_VERSION' => 'Latest version', + 'LINE' => 'Line', + 'LINE_ADDED' => 'Added', + 'LINE_MODIFIED' => 'Modified', + 'LINE_REMOVED' => 'Removed', + 'LINE_UNMODIFIED' => 'Unmodified', + 'LOGIN_UPDATE_EXPLAIN' => 'In order to update your installation you need to login first.', + + 'MAPPING_FILE_STRUCTURE' => 'To ease the upload here are the file locations which map your phpBB installation.', + + 'MERGE_MODIFICATIONS_OPTION' => 'Merge modifications', + + 'MERGE_NO_MERGE_NEW_OPTION' => 'Do not merge - use new file', + 'MERGE_NO_MERGE_MOD_OPTION' => 'Do not merge - use currently installed file', + 'MERGE_MOD_FILE_OPTION' => 'Merge modifications (removes new phpBB code within conflicting block)', + 'MERGE_NEW_FILE_OPTION' => 'Merge modifications (removes modified code within conflicting block)', + 'MERGE_SELECT_ERROR' => 'Conflicting file merge modes are not correctly selected.', + 'MERGING_FILES' => 'Merging differences', + 'MERGING_FILES_EXPLAIN' => 'Currently collecting final file changes.

Please wait until phpBB has completed all operations on changed files.', + + 'NEW_FILE' => 'End of Conflict', + 'NEW_USERNAME' => 'New username', + 'NO_AUTH_UPDATE' => 'Not authorised to update', + 'NO_ERRORS' => 'No errors', + 'NO_UPDATE_FILES' => 'Not updating the following files', + 'NO_UPDATE_FILES_EXPLAIN' => 'The following files are new or modified but the directory they normally reside in could not be found on your installation. If this list contains files to other directories than language/ or styles/ than you may have modified your directory structure and the update may be incomplete.', + 'NO_UPDATE_FILES_OUTDATED' => 'No valid update directory was found, please make sure you uploaded the relevant files.

Your installation does not seem to be up to date. Updates are available for your version of phpBB %1$s, please visit https://www.phpbb.com/downloads/ to obtain the correct package to update from Version %2$s to Version %3$s.', + 'NO_UPDATE_FILES_UP_TO_DATE' => 'Your version is up to date. There is no need to run the update tool. If you want to make an integrity check on your files make sure you uploaded the correct update files.', + 'NO_UPDATE_INFO' => 'Update file information could not be found.', + 'NO_UPDATES_REQUIRED' => 'No updates required', + 'NO_VISIBLE_CHANGES' => 'No visible changes', + 'NOTICE' => 'Notice', + 'NUM_CONFLICTS' => 'Number of conflicts', + 'NUMBER_OF_FILES_COLLECTED' => 'Currently differences from %1$d of %2$d files have been checked.
Please wait until all files are checked.', + + 'OLD_UPDATE_FILES' => 'Update files are out of date. The update files found are for updating from phpBB %1$s to phpBB %2$s but the latest version of phpBB is %3$s.', + + 'PACKAGE_UPDATES_TO' => 'Current package updates to version', + 'PERFORM_DATABASE_UPDATE' => 'Perform database update', + 'PERFORM_DATABASE_UPDATE_EXPLAIN' => 'Below you will find a button to the database update script. The database update can take a while, so please do not stop the execution if it seems to hang. After the database update has been performed just follow the instructions to continue the update process.', + 'PREVIOUS_VERSION' => 'Previous version', + 'PROGRESS' => 'Progress', + + 'RELEASE_ANNOUNCEMENT' => 'Announcement', + 'RESULT' => 'Result', + 'RUN_DATABASE_SCRIPT' => 'Update my database now', + + 'SELECT_DIFF_MODE' => 'Select diff mode', + 'SELECT_DOWNLOAD_FORMAT' => 'Select download archive format', + 'SELECT_FTP_SETTINGS' => 'Select FTP settings', + 'SHOW_DIFF_CONFLICT' => 'Show differences/conflicts', + 'SHOW_DIFF_DELETED' => 'Show file contents', + 'SHOW_DIFF_FINAL' => 'Show resulting file', + 'SHOW_DIFF_MODIFIED' => 'Show merged differences', + 'SHOW_DIFF_NEW' => 'Show file contents', + 'SHOW_DIFF_NEW_CONFLICT' => 'Show differences', + 'SHOW_DIFF_NOT_MODIFIED' => 'Show differences', + 'SOME_QUERIES_FAILED' => 'Some queries failed, the statements and errors are listed below.', + 'SQL' => 'SQL', + 'SQL_FAILURE_EXPLAIN' => 'This is probably nothing to worry about, update will continue. Should this fail to complete you may need to seek help at our support forums. See README for details on how to obtain advice.', + 'STAGE_FILE_CHECK' => 'Check files', + 'STAGE_UPDATE_DB' => 'Update database', + 'STAGE_UPDATE_FILES' => 'Update files', + 'STAGE_VERSION_CHECK' => 'Version check', + 'STATUS_CONFLICT' => 'Modified file producing conflicts', + 'STATUS_DELETED' => 'Deleted file', + 'STATUS_MODIFIED' => 'Modified file', + 'STATUS_NEW' => 'New file', + 'STATUS_NEW_CONFLICT' => 'Conflicting new file', + 'STATUS_NOT_MODIFIED' => 'Not modified file', + 'STATUS_UP_TO_DATE' => 'Already updated file', + + 'TOGGLE_DISPLAY' => 'View/Hide file list', + 'TRY_DOWNLOAD_METHOD' => 'You may want to try the download modified files method.
This method always works and is also the recommended update path.', + 'TRY_DOWNLOAD_METHOD_BUTTON'=> 'Try this method now', + + 'UPDATE_COMPLETED' => 'Update completed', + 'UPDATE_DATABASE' => 'Update database', + 'UPDATE_DATABASE_EXPLAIN' => 'Within the next step the database will be updated.', + 'UPDATE_DATABASE_SCHEMA' => 'Updating database schema', + 'UPDATE_FILES' => 'Update files', + 'UPDATE_FILES_NOTICE' => 'Please make sure you have updated your board files too, this file is only updating your database.', + 'UPDATE_INSTALLATION' => 'Update phpBB installation', + 'UPDATE_INSTALLATION_EXPLAIN' => 'With this option, it is possible to update your phpBB installation to the latest version.
During the process all of your files will be checked for their integrity. You are able to review all differences and files before the update.

The file update itself can be done in two different ways.

Manual Update

With this update you only download your personal set of changed files to make sure you do not lose your file modifications you may have done. After you downloaded this package you need to manually upload the files to their correct position under your phpBB root directory. Once done, you are able to do the file check stage again to see if you moved the files to their correct location.

Automatic Update with FTP

This method is similar to the first one but without the need to download the changed files and uploading them on your own. This will be done for you. In order to use this method you need to know your FTP login details since you will be asked for them. Once finished you will be redirected to the file check again to make sure everything got updated correctly.

', + 'UPDATE_INSTRUCTIONS' => ' + +

Release announcement

+ +

Please read the release announcement for the latest version before you continue your update process, it may contain useful information. It also contains full download links as well as the change log.

+ +
+ +

How to update your installation with the Automatic Update Package

+ +

The recommended way of updating your installation listed here is only valid for the automatic update package. You are also able to update your installation using the methods listed within the INSTALL.html document. The steps for updating phpBB3 automatically are:

+ +
    +
  • Go to the phpBB.com downloads page and download the "Automatic Update Package" archive.

  • +
  • Unpack the archive.

  • +
  • Upload the complete uncompressed "install" and "vendor" folders to your phpBB root directory (where your config.php file is).

  • +
+ +

Once uploaded your board will be offline for normal users due to the install directory you uploaded now present.

+ Now start the update process by pointing your browser to the install folder.
+
+ You will then be guided through the update process. You will be notified once the update is complete. +

+ ', + 'UPDATE_METHOD' => 'Update method', + 'UPDATE_METHOD_EXPLAIN' => 'You are now able to choose your preferred update method. Using the FTP upload will present you with a form you need to enter your FTP account details into. With this method the files will be automatically moved to the new location and backups of the old files being created by appending .bak to the filename. If you choose to download the modified files you are able to unpack and upload them to their correct location manually later.', + 'UPDATE_REQUIRES_FILE' => 'The updater requires that the following file is present: %s', + 'UPDATE_SUCCESS' => 'Update was successful', + 'UPDATE_SUCCESS_EXPLAIN' => 'Successfully updated all files. The next step involves checking all files again to make sure the files got updated correctly.', + 'UPDATE_VERSION_OPTIMIZE' => 'Updating version and optimising tables', + 'UPDATING_DATA' => 'Updating data', + 'UPDATING_TO_LATEST_STABLE' => 'Updating database to latest stable release', + 'UPDATED_VERSION' => 'Updated version', + 'UPLOAD_METHOD' => 'Upload method', + + 'UPDATE_DB_SUCCESS' => 'Database update was successful.', + 'UPDATE_FILE_SUCCESS' => 'File update was successful.', + 'USER_ACTIVE' => 'Active user', + 'USER_INACTIVE' => 'Inactive user', + + 'VERSION_CHECK' => 'Version check', + 'VERSION_CHECK_EXPLAIN' => 'Checks to see if your phpBB installation is up to date.', + 'VERSION_NOT_UP_TO_DATE' => 'Your phpBB installation is not up to date. Please continue the update process.', + 'VERSION_NOT_UP_TO_DATE_ACP' => 'Your phpBB installation is not up to date.
Below is a link to the release announcement, which contains more information as well as instructions on updating.', + 'VERSION_NOT_UP_TO_DATE_TITLE' => 'Your phpBB installation is not up to date.', + 'VERSION_UP_TO_DATE' => 'Your phpBB installation is up to date. Although there are no updates available at this time, you may continue in order to perform a file validity check.', + 'VERSION_UP_TO_DATE_ACP' => 'Your phpBB installation is up to date. There are no updates available at this time.', + 'VIEWING_FILE_CONTENTS' => 'Viewing file contents', + 'VIEWING_FILE_DIFF' => 'Viewing file differences', + + 'WRONG_INFO_FILE_FORMAT' => 'Wrong info file format', +)); + +// 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', +)); diff --git a/sources/phpBB/language/en/iso.txt b/sources/phpBB/language/en/iso.txt new file mode 100644 index 0000000..2e45cc5 --- /dev/null +++ b/sources/phpBB/language/en/iso.txt @@ -0,0 +1,3 @@ +British English +British English +phpBB Limited \ No newline at end of file diff --git a/sources/phpBB/language/en/mcp.php b/sources/phpBB/language/en/mcp.php new file mode 100644 index 0000000..a961068 --- /dev/null +++ b/sources/phpBB/language/en/mcp.php @@ -0,0 +1,433 @@ + +* @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 + +$lang = array_merge($lang, array( + 'ACTION' => 'Action', + 'ACTION_NOTE' => 'Action/Note', + 'ADD_FEEDBACK' => 'Add feedback', + 'ADD_FEEDBACK_EXPLAIN' => 'If you would like to add a report on this please fill out the following form. Only use plain text; HTML, BBCode, etc. are not permitted.', + 'ADD_WARNING' => 'Add warning', + 'ADD_WARNING_EXPLAIN' => 'To send a warning to this user please fill out the following form. Only use plain text; HTML, BBCode, etc. are not permitted.', + 'ALL_ENTRIES' => 'All entries', + 'ALL_NOTES_DELETED' => 'Successfully removed all user notes.', + 'ALL_REPORTS' => 'All reports', + 'ALREADY_REPORTED' => 'This post has already been reported.', + 'ALREADY_REPORTED_PM' => 'This private message has already been reported.', + 'ALREADY_WARNED' => 'A warning has already been issued for this post.', + 'APPROVE' => 'Approve', + 'APPROVE_POST' => 'Approve post', + 'APPROVE_POST_CONFIRM' => 'Are you sure you want to approve this post?', + 'APPROVE_POSTS' => 'Approve posts', + 'APPROVE_POSTS_CONFIRM' => 'Are you sure you want to approve the selected posts?', + 'APPROVE_TOPIC' => 'Approve topic', + 'APPROVE_TOPIC_CONFIRM' => 'Are you sure you want to approve this topic?', + 'APPROVE_TOPICS' => 'Approve topics', + 'APPROVE_TOPICS_CONFIRM'=> 'Are you sure you want to approve the selected topics?', + + 'CANNOT_MOVE_SAME_FORUM'=> 'You cannot move a topic to the forum it’s already in.', + 'CANNOT_WARN_ANONYMOUS' => 'You cannot warn unregistered guest users.', + 'CANNOT_WARN_SELF' => 'You cannot warn yourself.', + 'CAN_LEAVE_BLANK' => 'This can be left blank.', + 'CHANGE_POSTER' => 'Change poster', + 'CLOSE_PM_REPORT' => 'Close PM report', + 'CLOSE_PM_REPORT_CONFIRM' => 'Are you sure you want to close the selected PM report?', + 'CLOSE_PM_REPORTS' => 'Close PM reports', + 'CLOSE_PM_REPORTS_CONFIRM' => 'Are you sure you want to close the selected PM reports?', + 'CLOSE_REPORT' => 'Close report', + 'CLOSE_REPORT_CONFIRM' => 'Are you sure you want to close the selected report?', + 'CLOSE_REPORTS' => 'Close reports', + 'CLOSE_REPORTS_CONFIRM' => 'Are you sure you want to close the selected reports?', + + 'DELETE_PM_REPORT' => 'Delete PM report', + 'DELETE_PM_REPORT_CONFIRM' => 'Are you sure you want to delete the selected PM report?', + 'DELETE_PM_REPORTS' => 'Delete PM reports', + 'DELETE_PM_REPORTS_CONFIRM' => 'Are you sure you want to delete the selected PM reports?', + 'DELETE_POSTS' => 'Delete posts', + 'DELETE_REPORT' => 'Delete report', + 'DELETE_REPORT_CONFIRM' => 'Are you sure you want to delete the selected report?', + 'DELETE_REPORTS' => 'Delete reports', + 'DELETE_REPORTS_CONFIRM' => 'Are you sure you want to delete the selected reports?', + 'DELETE_SHADOW_TOPIC' => 'Delete shadow topic', + 'DELETE_TOPICS' => 'Delete selected topics', + 'DISAPPROVE' => 'Disapprove', + 'DISAPPROVE_REASON' => 'Reason for disapproval', + 'DISAPPROVE_POST' => 'Disapprove post', + 'DISAPPROVE_POST_CONFIRM' => 'Are you sure you want to disapprove this post?', + 'DISAPPROVE_POSTS' => 'Disapprove posts', + 'DISAPPROVE_POSTS_CONFIRM' => 'Are you sure you want to disapprove the selected posts?', + 'DISPLAY_LOG' => 'Display entries from previous', + 'DISPLAY_OPTIONS' => 'Display options', + + 'EMPTY_REPORT' => 'You must enter a description when selecting this reason.', + 'EMPTY_TOPICS_REMOVED_WARNING' => 'Please note that one or several topics have been removed from the database because they were or become empty.', + + 'FEEDBACK' => 'Feedback', + 'FORK' => 'Copy', + 'FORK_TOPIC' => 'Copy topic', + 'FORK_TOPIC_CONFIRM' => 'Are you sure you want to copy this topic?', + 'FORK_TOPICS' => 'Copy selected topics', + 'FORK_TOPICS_CONFIRM' => 'Are you sure you want to copy the selected topics?', + 'FORUM_DESC' => 'Description', + 'FORUM_NAME' => 'Forum name', + 'FORUM_NOT_EXIST' => 'The forum you selected does not exist.', + 'FORUM_NOT_POSTABLE' => 'The forum you selected cannot be posted to.', + 'FORUM_STATUS' => 'Forum status', + 'FORUM_STYLE' => 'Forum style', + + 'GLOBAL_ANNOUNCEMENT' => 'Global announcement', + + 'IP_INFO' => 'IP address information', + 'IPS_POSTED_FROM' => 'IP addresses this user has posted from', + + 'LATEST_LOGS' => 'Latest 5 logged actions', + 'LATEST_REPORTED' => 'Latest 5 reports', + 'LATEST_REPORTED_PMS' => 'Latest 5 PM reports', + 'LATEST_UNAPPROVED' => 'Latest 5 posts awaiting approval', + 'LATEST_WARNING_TIME' => 'Latest warning issued', + 'LATEST_WARNINGS' => 'Latest 5 warnings', + 'LEAVE_SHADOW' => 'Leave shadow topic in place', + 'LIST_REPORTS' => array( + 1 => '%d report', + 2 => '%d reports', + ), + 'LOCK' => 'Lock', + 'LOCK_POST_POST' => 'Lock post', + 'LOCK_POST_POST_CONFIRM' => 'Are you sure you want to prevent editing this post?', + 'LOCK_POST_POSTS' => 'Lock selected posts', + 'LOCK_POST_POSTS_CONFIRM' => 'Are you sure you want to prevent editing the selected posts?', + 'LOCK_TOPIC_CONFIRM' => 'Are you sure you want to lock this topic?', + 'LOCK_TOPICS' => 'Lock selected topics', + '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_VIEWTOPIC' => 'View topic', + 'LOGVIEW_VIEWLOGS' => 'View topic log', + 'LOGVIEW_VIEWFORUM' => 'View forum', + 'LOOKUP_ALL' => 'Look up all IPs', + 'LOOKUP_IP' => 'Look up IP', + + 'MARKED_NOTES_DELETED' => 'Successfully removed all marked user notes.', + + 'MCP_ADD' => 'Add a warning', + + 'MCP_BAN' => 'Banning', + 'MCP_BAN_EMAILS' => 'Ban emails', + 'MCP_BAN_IPS' => 'Ban IPs', + 'MCP_BAN_USERNAMES' => 'Ban Usernames', + + 'MCP_LOGS' => 'Moderator logs', + 'MCP_LOGS_FRONT' => 'Front page', + 'MCP_LOGS_FORUM_VIEW' => 'Forum logs', + 'MCP_LOGS_TOPIC_VIEW' => 'Topic logs', + + 'MCP_MAIN' => 'Main', + 'MCP_MAIN_FORUM_VIEW' => 'View forum', + 'MCP_MAIN_FRONT' => 'Front page', + 'MCP_MAIN_POST_DETAILS' => 'Post details', + 'MCP_MAIN_TOPIC_VIEW' => 'View topic', + 'MCP_MAKE_ANNOUNCEMENT' => 'Modify to “Announcementâ€', + 'MCP_MAKE_ANNOUNCEMENT_CONFIRM' => 'Are you sure you want to change this topic to an “Announcementâ€?', + 'MCP_MAKE_ANNOUNCEMENTS' => 'Modify to “Announcementsâ€', + 'MCP_MAKE_ANNOUNCEMENTS_CONFIRM'=> 'Are you sure you want to change the selected topics to “Announcementsâ€?', + 'MCP_MAKE_GLOBAL' => 'Modify to “Global announcementâ€', + 'MCP_MAKE_GLOBAL_CONFIRM' => 'Are you sure you want to change this topic to a “Global announcementâ€?', + 'MCP_MAKE_GLOBALS' => 'Modify to “Global announcementsâ€', + 'MCP_MAKE_GLOBALS_CONFIRM' => 'Are you sure you want to change the selected topics to “Global announcementsâ€?', + 'MCP_MAKE_STICKY' => 'Modify to “Stickyâ€', + 'MCP_MAKE_STICKY_CONFIRM' => 'Are you sure you want to change this topic to a “Stickyâ€?', + 'MCP_MAKE_STICKIES' => 'Modify to “Stickiesâ€', + 'MCP_MAKE_STICKIES_CONFIRM' => 'Are you sure you want to change the selected topics to “Stickiesâ€?', + 'MCP_MAKE_NORMAL' => 'Modify to “Standard Topicâ€', + 'MCP_MAKE_NORMAL_CONFIRM' => 'Are you sure you want to change this topic to a “Standard Topicâ€?', + 'MCP_MAKE_NORMALS' => 'Modify to “Standard Topicsâ€', + 'MCP_MAKE_NORMALS_CONFIRM' => 'Are you sure you want to change the selected topics to “Standard Topicsâ€?', + + 'MCP_NOTES' => 'User notes', + 'MCP_NOTES_FRONT' => 'Front page', + 'MCP_NOTES_USER' => 'User details', + + 'MCP_POST_REPORTS' => 'Reports issued on this post', + + 'MCP_PM_REPORTS' => 'Reported PMs', + 'MCP_PM_REPORT_DETAILS' => 'PM Report details', + 'MCP_PM_REPORTS_CLOSED' => 'Closed PM reports', + 'MCP_PM_REPORTS_CLOSED_EXPLAIN' => 'This is a list of all reports about private messages which have previously been resolved.', + 'MCP_PM_REPORTS_OPEN' => 'Open PM reports', + 'MCP_PM_REPORTS_OPEN_EXPLAIN' => 'This is a list of all reported private messages which are still to be handled.', + + 'MCP_REPORTS' => 'Reported messages', + 'MCP_REPORT_DETAILS' => 'Report details', + 'MCP_REPORTS_CLOSED' => 'Closed reports', + 'MCP_REPORTS_CLOSED_EXPLAIN' => 'This is a list of all reports about posts which have previously been resolved.', + 'MCP_REPORTS_OPEN' => 'Open reports', + 'MCP_REPORTS_OPEN_EXPLAIN' => 'This is a list of all reported posts which are still to be handled.', + + 'MCP_QUEUE' => 'Moderation queue', + 'MCP_QUEUE_APPROVE_DETAILS' => 'Approve details', + 'MCP_QUEUE_UNAPPROVED_POSTS' => 'Posts awaiting approval', + 'MCP_QUEUE_UNAPPROVED_POSTS_EXPLAIN' => 'This is a list of all posts which require approving before they will be visible to users.', + 'MCP_QUEUE_UNAPPROVED_TOPICS' => 'Topics awaiting approval', + 'MCP_QUEUE_UNAPPROVED_TOPICS_EXPLAIN' => 'This is a list of all topics which require approving before they will be visible to users.', + 'MCP_QUEUE_DELETED_POSTS' => 'Deleted posts', + 'MCP_QUEUE_DELETED_POSTS_EXPLAIN' => 'This is a list of all soft deleted posts. You can restore or permanently delete the posts from this screen.', + 'MCP_QUEUE_DELETED_TOPICS' => 'Deleted topics', + 'MCP_QUEUE_DELETED_TOPICS_EXPLAIN' => 'This is a list of all soft deleted topics. You can restore or permanently delete the topics from this screen.', + + 'MCP_VIEW_USER' => 'View warnings for a specific user', + + 'MCP_WARN' => 'Warnings', + 'MCP_WARN_FRONT' => 'Front page', + 'MCP_WARN_LIST' => 'List warnings', + 'MCP_WARN_POST' => 'Warn for specific post', + 'MCP_WARN_USER' => 'Warn user', + + 'MERGE_POSTS_CONFIRM' => 'Are you sure you want to move the selected posts?', + 'MERGE_TOPIC_EXPLAIN' => 'Using the form below you can move selected posts into another topic. The posts will be split from this topic and merged into the other topic. These posts will not be reordered and will appear as if the users posted them to the new topic.
Please enter the destination topic id or click on “Select topic†to search for one.', + 'MERGE_TOPIC_ID' => 'Destination topic identification number', + 'MERGE_TOPICS' => 'Merge topics', + 'MERGE_TOPICS_CONFIRM' => 'Are you sure you want to merge the selected topics?', + 'MODERATE_FORUM' => 'Moderate forum', + 'MODERATE_TOPIC' => 'Moderate topic', + 'MODERATE_POST' => 'Moderate post', + 'MOD_OPTIONS' => 'Moderator options', + 'MORE_INFO' => 'Further information', + 'MOST_WARNINGS' => 'Users with most warnings', + 'MOVE_TOPIC_CONFIRM' => 'Are you sure you want to move the topic into a new forum?', + 'MOVE_TOPICS' => 'Move selected topics', + 'MOVE_TOPICS_CONFIRM' => 'Are you sure you want to move the selected topics into a new forum?', + + 'NOTIFY_POSTER_APPROVAL' => 'Notify poster about approval?', + 'NOTIFY_POSTER_DISAPPROVAL' => 'Notify poster about disapproval?', + 'NOTIFY_USER_WARN' => 'Notify user about warning?', + 'NOT_MODERATOR' => 'You are not a moderator of this forum.', + 'NO_DESTINATION_FORUM' => 'Please select a forum for destination.', + 'NO_DESTINATION_FORUM_FOUND' => 'There is no destination forum available.', + 'NO_ENTRIES' => 'No log entries.', + 'NO_FEEDBACK' => 'No feedback exists for this user.', + 'NO_FINAL_TOPIC_SELECTED' => 'You have to select a destination topic for merging posts.', + 'NO_MATCHES_FOUND' => 'No matches found.', + 'NO_POST' => 'You have to select a post in order to warn the user for a post.', + 'NO_POST_REPORT' => 'This post was not reported.', + 'NO_POST_SELECTED' => 'You must select at least one post to perform this action.', + 'NO_POSTS_DELETED' => 'There are no deleted posts.', + 'NO_POSTS_QUEUE' => 'There are no posts waiting for approval.', + 'NO_REASON_DISAPPROVAL' => 'Please give an appropriate reason for disapproval.', + 'NO_REPORT' => 'No report found', + 'NO_REPORTS' => 'No reports found', + 'NO_REPORT_SELECTED' => 'You must select at least one report to perform this action.', + 'NO_TOPIC_ICON' => 'None', + 'NO_TOPIC_SELECTED' => 'You must select at least one topic to perform this action.', + 'NO_TOPICS_DELETED' => 'There are no deleted topics.', + 'NO_TOPICS_QUEUE' => 'There are no topics waiting for approval.', + + 'ONLY_TOPIC' => 'Only topic “%sâ€', + 'OTHER_USERS' => 'Other users posting from this IP', + + 'QUICKMOD_ACTION_NOT_ALLOWED' => "%s not allowed as quickmod", + + 'PM_REPORT_CLOSED_SUCCESS' => 'The selected PM report has been closed successfully.', + 'PM_REPORT_DELETED_SUCCESS' => 'The selected PM report has been deleted successfully.', + 'PM_REPORTED_SUCCESS' => 'This private message has been successfully reported.', + 'PM_REPORTS_CLOSED_SUCCESS' => 'The selected PM reports have been closed successfully.', + 'PM_REPORTS_DELETED_SUCCESS'=> 'The selected PM reports have been deleted successfully.', + 'PM_REPORTS_TOTAL' => array( + 0 => 'There are no PM reports to review.', + 1 => 'In total there is 1 PM report to review.', + 2 => 'In total there are %d PM reports to review.', + ), + 'PM_REPORT_DETAILS' => 'Private message report details', + 'POSTER' => 'Poster', + 'POSTS_APPROVED_SUCCESS' => 'The selected posts have been approved.', + 'POSTS_DELETED_SUCCESS' => 'The selected posts have been successfully removed from the database.', + 'POSTS_DISAPPROVED_SUCCESS' => 'The selected posts have been disapproved.', + 'POSTS_LOCKED_SUCCESS' => 'The selected posts have been locked successfully.', + 'POSTS_MERGED_SUCCESS' => 'The selected posts have been merged.', + 'POSTS_PER_PAGE' => 'Posts per page', + 'POSTS_PER_PAGE_EXPLAIN' => '(Set to 0 to view all posts.)', + 'POSTS_RESTORED_SUCCESS' => 'The selected posts have been restored successfully.', + 'POSTS_UNLOCKED_SUCCESS' => 'The selected posts have been unlocked successfully.', + 'POST_APPROVED_SUCCESS' => 'The selected post has been approved.', + 'POST_DELETED_SUCCESS' => 'The selected post has been successfully removed from the database.', + 'POST_DISAPPROVED_SUCCESS' => 'The selected post has been disapproved.', + 'POST_LOCKED_SUCCESS' => 'Post locked successfully.', + 'POST_NOT_EXIST' => 'The post you requested does not exist.', + 'POST_REPORTED_SUCCESS' => 'This post has been successfully reported.', + 'POST_RESTORED_SUCCESS' => 'This post has been restored successfully.', + 'POST_UNLOCKED_SUCCESS' => 'Post unlocked successfully.', + + 'READ_USERNOTES' => 'User notes', + 'READ_WARNINGS' => 'User warnings', + 'REPORTER' => 'Reporter', + 'REPORTED' => 'Reported', + 'REPORTED_BY' => 'Reported by', + 'REPORTED_ON_DATE' => 'on', + 'REPORTS_CLOSED_SUCCESS' => 'The selected reports have been closed successfully.', + 'REPORTS_DELETED_SUCCESS' => 'The selected reports have been deleted successfully.', + 'REPORTS_TOTAL' => array( + 0 => 'There are no reports to review.', + 1 => 'In total there is 1 report to review.', + 2 => 'In total there are %d reports to review.', + ), + 'REPORT_CLOSED' => 'This report has already been closed.', + 'REPORT_CLOSED_SUCCESS' => 'The selected report has been closed successfully.', + 'REPORT_DELETED_SUCCESS' => 'The selected report has been deleted successfully.', + 'REPORT_DETAILS' => 'Report details', + 'REPORT_MESSAGE' => 'Report this message', + 'REPORT_MESSAGE_EXPLAIN' => 'Use this form to report the selected private message. Reporting should generally be used only if the message breaks forum rules. Reporting a private message will make its contents visible to all moderators.', + 'REPORT_NOTIFY' => 'Notify me', + 'REPORT_NOTIFY_EXPLAIN' => 'Informs you when your report is dealt with.', + 'REPORT_POST_EXPLAIN' => 'Use this form to report the selected post to the forum moderators and board administrators. Reporting should generally be used only if the post breaks forum rules.', + 'REPORT_REASON' => 'Report reason', + 'REPORT_TIME' => 'Report time', + 'RESTORE' => 'Restore', + 'RESTORE_POST' => 'Restore post', + 'RESTORE_POST_CONFIRM' => 'Are you sure you want to restore this post?', + 'RESTORE_POSTS' => 'Restore posts', + 'RESTORE_POSTS_CONFIRM' => 'Are you sure you want to restore the selected posts?', + 'RESTORE_TOPIC' => 'Restore topic', + 'RESTORE_TOPIC_CONFIRM' => 'Are you sure you want to restore this topic?', + 'RESTORE_TOPICS' => 'Restore topics', + 'RESTORE_TOPICS_CONFIRM' => 'Are you sure you want to restore the selected topics?', + 'RESYNC' => 'Resync', + 'RETURN_MESSAGE' => '%sReturn to the message%s', + 'RETURN_NEW_FORUM' => '%sGo to the new forum%s', + 'RETURN_NEW_TOPIC' => '%sGo to the new topic%s', + 'RETURN_PM' => '%sReturn to the private message%s', + 'RETURN_POST' => '%sReturn to the post%s', + 'RETURN_QUEUE' => '%sReturn to the queue%s', + 'RETURN_REPORTS' => '%sReturn to the reports%s', + 'RETURN_TOPIC_SIMPLE' => '%sReturn to the topic%s', + + 'SEARCH_POSTS_BY_USER' => 'Search posts by', + 'SELECT_ACTION' => 'Select desired action', + 'SELECT_FORUM_GLOBAL_ANNOUNCEMENT' => 'Please select the forum you wish this global announcement to be displayed.', + 'SELECT_FORUM_GLOBAL_ANNOUNCEMENTS' => 'One or more of the selected topics are global announcements. Please select the forum you wish these to be displayed.', + 'SELECT_MERGE' => 'Select for merge', + 'SELECT_TOPICS_FROM' => 'Select topics from', + 'SELECT_TOPIC' => 'Select topic', + 'SELECT_USER' => 'Select user', + 'SORT_ACTION' => 'Log action', + 'SORT_DATE' => 'Date', + 'SORT_IP' => 'IP address', + 'SORT_WARNINGS' => 'Warnings', + 'SPLIT_AFTER' => 'Split topic from selected post onwards', + 'SPLIT_FORUM' => 'Forum for new topic', + 'SPLIT_POSTS' => 'Split selected posts', + 'SPLIT_SUBJECT' => 'New topic title', + 'SPLIT_TOPIC_ALL' => 'Split topic from selected posts', + 'SPLIT_TOPIC_ALL_CONFIRM' => 'Are you sure you want to split this topic?', + 'SPLIT_TOPIC_BEYOND' => 'Split topic at selected post', + 'SPLIT_TOPIC_BEYOND_CONFIRM' => 'Are you sure you want to split this topic at the selected post?', + 'SPLIT_TOPIC_EXPLAIN' => 'Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post.', + + 'THIS_PM_IP' => 'IP for this private message', + 'THIS_POST_IP' => 'IP for this post', + 'TOPICS_APPROVED_SUCCESS' => 'The selected topics have been approved.', + 'TOPICS_DELETED_SUCCESS' => 'The selected topics have been successfully removed from the database.', + 'TOPICS_DISAPPROVED_SUCCESS'=> 'The selected topics have been disapproved.', + 'TOPICS_FORKED_SUCCESS' => 'The selected topics have been copied successfully.', + 'TOPICS_LOCKED_SUCCESS' => 'The selected topics have been locked.', + 'TOPICS_MOVED_SUCCESS' => 'The selected topics have been moved successfully.', + 'TOPICS_RESTORED_SUCCESS' => 'The selected topics have been restored successfully.', + 'TOPICS_RESYNC_SUCCESS' => 'The selected topics have been resynchronised.', + 'TOPICS_TYPE_CHANGED' => 'Topic types changed successfully.', + 'TOPICS_UNLOCKED_SUCCESS' => 'The selected topics have been unlocked.', + 'TOPIC_APPROVED_SUCCESS' => 'The selected topic has been approved.', + 'TOPIC_DELETED_SUCCESS' => 'The selected topic has been successfully removed from the database.', + 'TOPIC_DISAPPROVED_SUCCESS' => 'The selected topic has been disapproved.', + 'TOPIC_FORKED_SUCCESS' => 'The selected topic has been copied successfully.', + 'TOPIC_LOCKED_SUCCESS' => 'The selected topic has been locked.', + 'TOPIC_MOVED_SUCCESS' => 'The selected topic has been moved successfully.', + 'TOPIC_NOT_EXIST' => 'The topic you selected does not exist.', + 'TOPIC_RESTORED_SUCCESS' => 'The selected topic has been restored successfully.', + 'TOPIC_RESYNC_SUCCESS' => 'The selected topic has been resynchronised.', + 'TOPIC_SPLIT_SUCCESS' => 'The selected topic has been split successfully.', + 'TOPIC_TIME' => 'Topic time', + 'TOPIC_TYPE_CHANGED' => 'Topic type changed successfully.', + 'TOPIC_UNLOCKED_SUCCESS' => 'The selected topic has been unlocked.', + 'TOTAL_WARNINGS' => 'Total Warnings', + + 'UNAPPROVED_POSTS_TOTAL' => array( + 0 => 'There are no posts waiting for approval.', + 1 => 'In total there is 1 post waiting for approval.', + 2 => 'In total there are %d posts waiting for approval.', + ), + 'UNLOCK' => 'Unlock', + 'UNLOCK_POST' => 'Unlock post', + 'UNLOCK_POST_EXPLAIN' => 'Allow editing', + 'UNLOCK_POST_POST' => 'Unlock post', + 'UNLOCK_POST_POST_CONFIRM' => 'Are you sure you want to allow editing this post?', + 'UNLOCK_POST_POSTS' => 'Unlock selected posts', + 'UNLOCK_POST_POSTS_CONFIRM' => 'Are you sure you want to allow editing the selected posts?', + 'UNLOCK_TOPIC' => 'Unlock topic', + 'UNLOCK_TOPIC_CONFIRM' => 'Are you sure you want to unlock this topic?', + 'UNLOCK_TOPICS' => 'Unlock selected topics', + 'UNLOCK_TOPICS_CONFIRM' => 'Are you sure you want to unlock all selected topics?', + 'USER_CANNOT_POST' => 'You cannot post in this forum.', + 'USER_CANNOT_REPORT' => 'You cannot report posts in this forum.', + 'USER_FEEDBACK_ADDED' => 'User feedback added successfully.', + 'USER_WARNING_ADDED' => 'User warned successfully.', + + 'VIEW_DETAILS' => 'View details', + 'VIEW_PM' => 'View private message', + 'VIEW_POST' => 'View post', + + 'WARNED_USERS' => 'Warned users', + 'WARNED_USERS_EXPLAIN' => 'This is a list of users with unexpired warnings issued to them.', + 'WARNING_PM_BODY' => 'The following is a warning which has been issued to you by an administrator or moderator of this site.[quote]%s[/quote]', + 'WARNING_PM_SUBJECT' => 'Board warning issued', + 'WARNING_POST_DEFAULT' => 'This is a warning regarding the following post made by you: %s .', + 'NO_WARNINGS' => 'No warnings exist.', + + 'YOU_SELECTED_TOPIC' => 'You selected topic number %d: %s.', + + 'report_reasons' => array( + 'TITLE' => array( + 'WAREZ' => 'Warez', + 'SPAM' => 'Spam', + 'OFF_TOPIC' => 'Off-topic', + 'OTHER' => 'Other', + ), + 'DESCRIPTION' => array( + 'WAREZ' => 'The message contains links to illegal or pirated software.', + 'SPAM' => 'The reported message has the only purpose to advertise for a website or another product.', + 'OFF_TOPIC' => 'The reported message is off topic.', + 'OTHER' => 'The reported message does not fit into any other category, please use the further information field.', + ), + ), +)); diff --git a/sources/phpBB/language/en/memberlist.php b/sources/phpBB/language/en/memberlist.php new file mode 100644 index 0000000..5605f8f --- /dev/null +++ b/sources/phpBB/language/en/memberlist.php @@ -0,0 +1,153 @@ + +* @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 + +$lang = array_merge($lang, array( + 'ABOUT_USER' => 'Profile', + 'ACTIVE_IN_FORUM' => 'Most active forum', + 'ACTIVE_IN_TOPIC' => 'Most active topic', + 'ADD_FOE' => 'Add foe', + 'ADD_FRIEND' => 'Add friend', + 'AFTER' => 'After', + + 'ALL' => 'All', + + 'BEFORE' => 'Before', + + 'CC_SENDER' => 'Send a copy of this email to yourself.', + 'CONTACT_ADMIN' => 'Contact a Board Administrator', + + 'DEST_LANG' => 'Language', + 'DEST_LANG_EXPLAIN' => 'Select an appropriate language (if available) for the recipient of this message.', + + 'EDIT_PROFILE' => 'Edit profile', + + 'EMAIL_BODY_EXPLAIN' => 'This message will be sent as plain text, do not include any HTML or BBCode. The return address for this message will be set to your email address.', + 'EMAIL_DISABLED' => 'Sorry but all email related functions have been disabled.', + 'EMAIL_SENT' => 'The email has been sent.', + 'EMAIL_TOPIC_EXPLAIN' => 'This message will be sent as plain text, do not include any HTML or BBCode. Please note that the topic information is already included in the message. The return address for this message will be set to your email address.', + 'EMPTY_ADDRESS_EMAIL' => 'You must provide a valid email address for the recipient.', + 'EMPTY_MESSAGE_EMAIL' => 'You must enter a message to be emailed.', + 'EMPTY_MESSAGE_IM' => 'You must enter a message to be send.', + 'EMPTY_NAME_EMAIL' => 'You must enter the real name of the recipient.', + 'EMPTY_SENDER_EMAIL' => 'You must provide a valid email address.', + 'EMPTY_SENDER_NAME' => 'You must provide a name.', + 'EMPTY_SUBJECT_EMAIL' => 'You must specify a subject for the email.', + 'EQUAL_TO' => 'Equal to', + + 'FIND_USERNAME_EXPLAIN' => 'Use this form to search for specific members. You do not need to fill out all fields. To match partial data use * as a wildcard. When entering dates use the format YYYY-MM-DD, e.g. 2004-02-29. Use the mark checkboxes to select one or more usernames (several usernames may be accepted depending on the form itself) and click the Select Marked button to return to the previous form.', + 'FLOOD_EMAIL_LIMIT' => 'You cannot send another email at this time. Please try again later.', + + 'GROUP_LEADER' => 'Group leader', + + 'HIDE_MEMBER_SEARCH' => 'Hide member search', + + 'IM_ADD_CONTACT' => 'Add Contact', + 'IM_DOWNLOAD_APP' => 'Download application', + 'IM_JABBER' => 'Please note that users may have selected to not receive unsolicited instant messages.', + 'IM_JABBER_SUBJECT' => 'This is an automated message please do not reply! Message from user %1$s at %2$s.', + 'IM_MESSAGE' => 'Your message', + 'IM_NAME' => 'Your Name', + 'IM_NO_DATA' => 'There is no suitable contact information for this user.', + 'IM_NO_JABBER' => 'Sorry, direct messaging of Jabber users is not supported on this board. You will need a Jabber client installed on your system to contact the recipient above.', + 'IM_RECIPIENT' => 'Recipient', + 'IM_SEND' => 'Send message', + 'IM_SEND_MESSAGE' => 'Send message', + 'IM_SENT_JABBER' => 'Your message to %1$s has been sent successfully.', + 'IM_USER' => 'Send an instant message', + + 'LAST_ACTIVE' => 'Last active', + 'LESS_THAN' => 'Less than', + 'LIST_USERS' => array( + 1 => '%d user', + 2 => '%d users', + ), + 'LOGIN_EXPLAIN_TEAM' => 'The board requires you to be registered and logged in to view the team listing.', + 'LOGIN_EXPLAIN_MEMBERLIST' => 'The board requires you to be registered and logged in to access the memberlist.', + 'LOGIN_EXPLAIN_SEARCHUSER' => 'The board requires you to be registered and logged in to search users.', + 'LOGIN_EXPLAIN_VIEWPROFILE' => 'The board requires you to be registered and logged in to view profiles.', + + 'MORE_THAN' => 'More than', + + 'NO_CONTACT_FORM' => 'The board administrator contact form has been disabled.', + 'NO_CONTACT_PAGE' => 'The board administrator contact page has been disabled.', + 'NO_EMAIL' => 'You are not permitted to send email to this user.', + 'NO_VIEW_USERS' => 'You are not authorised to view the member list or profiles.', + + 'ORDER' => 'Order', + 'OTHER' => 'Other', + + 'POST_IP' => 'Posted from IP/domain', + + 'REAL_NAME' => 'Recipient name', + 'RECIPIENT' => 'Recipient', + 'REMOVE_FOE' => 'Remove foe', + 'REMOVE_FRIEND' => 'Remove friend', + + 'SELECT_MARKED' => 'Select marked', + 'SELECT_SORT_METHOD' => 'Select sort method', + 'SENDER_EMAIL_ADDRESS' => 'Your email address', + 'SENDER_NAME' => 'Your name', + 'SEND_ICQ_MESSAGE' => 'Send ICQ message', + 'SEND_IM' => 'Instant messaging', + 'SEND_JABBER_MESSAGE' => 'Send Jabber message', + 'SEND_MESSAGE' => 'Message', + 'SEND_YIM_MESSAGE' => 'Send YIM message', + 'SORT_EMAIL' => 'Email', + 'SORT_LAST_ACTIVE' => 'Last active', + 'SORT_POST_COUNT' => 'Post count', + + 'USERNAME_BEGINS_WITH' => 'Username begins with', + 'USER_ADMIN' => 'Administer user', + 'USER_BAN' => 'Banning', + 'USER_FORUM' => 'User statistics', + 'USER_LAST_REMINDED' => array( + 0 => 'No reminder sent at this time', + 1 => '%1$d reminder sent
» %2$s', + 2 => '%1$d reminder sent
» %2$s', + ), + 'USER_ONLINE' => 'Online', + 'USER_PRESENCE' => 'Board presence', + 'USERS_PER_PAGE' => 'Users per page', + + 'VIEWING_PROFILE' => 'Viewing profile - %s', + 'VIEW_FACEBOOK_PROFILE' => 'View Facebook Profile', + 'VIEW_SKYPE_PROFILE' => 'View Skype Profile', + 'VIEW_TWITTER_PROFILE' => 'View Twitter Profile', + 'VIEW_YOUTUBE_CHANNEL' => 'View YouTube Channel', + 'VIEW_GOOGLEPLUS_PROFILE' => 'View Google+ Profile', +)); diff --git a/sources/phpBB/language/en/migrator.php b/sources/phpBB/language/en/migrator.php new file mode 100644 index 0000000..f5a5681 --- /dev/null +++ b/sources/phpBB/language/en/migrator.php @@ -0,0 +1,62 @@ + +* @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 + +$lang = array_merge($lang, array( + 'CONFIG_NOT_EXIST' => 'The config setting "%s" unexpectedly does not exist.', + + 'GROUP_NOT_EXIST' => 'The group "%s" unexpectedly does not exist.', + + 'MIGRATION_APPLY_DEPENDENCIES' => 'Apply dependencies of %s.', + 'MIGRATION_DATA_DONE' => 'Installed Data: %1$s; Time: %2$.2f seconds', + 'MIGRATION_DATA_IN_PROGRESS' => 'Installing Data: %1$s; Time: %2$.2f seconds', + 'MIGRATION_DATA_RUNNING' => 'Installing Data: %s.', + 'MIGRATION_EFFECTIVELY_INSTALLED' => 'Migration already effectively installed (skipped): %s', + 'MIGRATION_EXCEPTION_ERROR' => 'Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors.', + 'MIGRATION_NOT_FULFILLABLE' => 'The migration "%1$s" is not fulfillable, missing migration "%2$s".', + 'MIGRATION_NOT_VALID' => '%s is not a valid migration.', + 'MIGRATION_SCHEMA_DONE' => 'Installed Schema: %1$s; Time: %2$.2f seconds', + 'MIGRATION_SCHEMA_RUNNING' => 'Installing Schema: %s.', + + 'MODULE_ERROR' => 'An error occurred while creating a module: %s', + 'MODULE_INFO_FILE_NOT_EXIST' => 'A required module info file is missing: %2$s', + 'MODULE_NOT_EXIST' => 'A required module does not exist: %s', + + 'PERMISSION_NOT_EXIST' => 'The permission setting "%s" unexpectedly does not exist.', + + 'ROLE_NOT_EXIST' => 'The permission role "%s" unexpectedly does not exist.', +)); diff --git a/sources/phpBB/language/en/plupload.php b/sources/phpBB/language/en/plupload.php new file mode 100644 index 0000000..15c3955 --- /dev/null +++ b/sources/phpBB/language/en/plupload.php @@ -0,0 +1,79 @@ + +* @copyright (c) 2010-2013 Moxiecode Systems AB +* @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 + +$lang = array_merge($lang, array( + 'PLUPLOAD_ADD_FILES' => 'Add files', + 'PLUPLOAD_ADD_FILES_TO_QUEUE' => 'Add files to the upload queue and click the start button.', + 'PLUPLOAD_ALREADY_QUEUED' => '%s already present in the queue.', + 'PLUPLOAD_CLOSE' => 'Close', + 'PLUPLOAD_DRAG' => 'Drag files here.', + 'PLUPLOAD_DUPLICATE_ERROR' => 'Duplicate file error.', + 'PLUPLOAD_DRAG_TEXTAREA' => 'You may also attach files by dragging and dropping them in the message box.', + 'PLUPLOAD_ERR_INPUT' => 'Failed to open input stream.', + 'PLUPLOAD_ERR_MOVE_UPLOADED' => 'Failed to move uploaded file.', + 'PLUPLOAD_ERR_OUTPUT' => 'Failed to open output stream.', + 'PLUPLOAD_ERR_FILE_TOO_LARGE' => 'File too large:', + 'PLUPLOAD_ERR_FILE_COUNT' => 'File count error.', + 'PLUPLOAD_ERR_FILE_INVALID_EXT' => 'Invalid file extension:', + 'PLUPLOAD_ERR_RUNTIME_MEMORY' => 'Runtime ran out of available memory.', + 'PLUPLOAD_ERR_UPLOAD_URL' => 'Upload URL might be wrong or does not exist.', + 'PLUPLOAD_EXTENSION_ERROR' => 'File extension error.', + 'PLUPLOAD_FILE' => 'File: %s', + 'PLUPLOAD_FILE_DETAILS' => 'File: %s, size: %d, max file size: %d', + 'PLUPLOAD_FILENAME' => 'Filename', + 'PLUPLOAD_FILES_QUEUED' => '%d files queued', + 'PLUPLOAD_GENERIC_ERROR' => 'Generic error.', + 'PLUPLOAD_HTTP_ERROR' => 'HTTP error.', + 'PLUPLOAD_IMAGE_FORMAT' => 'Image format either wrong or not supported.', + 'PLUPLOAD_INIT_ERROR' => 'Init error.', + 'PLUPLOAD_IO_ERROR' => 'IO error.', + 'PLUPLOAD_NOT_APPLICABLE' => 'N/A', + 'PLUPLOAD_SECURITY_ERROR' => 'Security error.', + 'PLUPLOAD_SELECT_FILES' => 'Select files', + 'PLUPLOAD_SIZE' => 'Size', + 'PLUPLOAD_SIZE_ERROR' => 'File size error.', + 'PLUPLOAD_STATUS' => 'Status', + 'PLUPLOAD_START_UPLOAD' => 'Start upload', + 'PLUPLOAD_START_CURRENT_UPLOAD' => 'Start uploading queue', + 'PLUPLOAD_STOP_UPLOAD' => 'Stop upload', + 'PLUPLOAD_STOP_CURRENT_UPLOAD' => 'Stop current upload', + // Note: This string is formatted independently by plupload and so does not + // use the same formatting rules as normal phpBB translation strings + 'PLUPLOAD_UPLOADED' => 'Uploaded %d/%d files', +)); diff --git a/sources/phpBB/language/en/posting.php b/sources/phpBB/language/en/posting.php new file mode 100644 index 0000000..924395e --- /dev/null +++ b/sources/phpBB/language/en/posting.php @@ -0,0 +1,278 @@ + +* @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 + +$lang = array_merge($lang, array( + 'ADD_ATTACHMENT' => 'Upload attachment', + 'ADD_ATTACHMENT_EXPLAIN' => 'If you wish to attach one or more files enter the details below.', + 'ADD_FILE' => 'Add the file', + 'ADD_POLL' => 'Poll creation', + 'ADD_POLL_EXPLAIN' => 'If you do not want to add a poll to your topic leave the fields blank.', + 'ALREADY_DELETED' => 'Sorry but this message is already deleted.', + 'ATTACH_DISK_FULL' => 'There is not enough free disk space to post this attachment.', + 'ATTACH_QUOTA_REACHED' => 'Sorry, the board attachment quota has been reached.', + 'ATTACH_SIG' => 'Attach a signature (signatures can be altered via the UCP)', + + 'BBCODE_A_HELP' => 'Inline uploaded attachment: [attachment=]filename.ext[/attachment]', + 'BBCODE_B_HELP' => 'Bold text: [b]text[/b]', + 'BBCODE_C_HELP' => 'Code display: [code]code[/code]', + 'BBCODE_D_HELP' => 'Flash: [flash=width,height]http://url[/flash]', + 'BBCODE_F_HELP' => 'Font size: [size=85]small text[/size]', + 'BBCODE_IS_OFF' => '%sBBCode%s is OFF', + 'BBCODE_IS_ON' => '%sBBCode%s is ON', + 'BBCODE_I_HELP' => 'Italic text: [i]text[/i]', + 'BBCODE_L_HELP' => 'List: [list][*]text[/list]', + 'BBCODE_LISTITEM_HELP' => 'List item: [*]text', + 'BBCODE_O_HELP' => 'Ordered list: e.g. [list=1][*]First point[/list] or [list=a][*]Point a[/list]', + 'BBCODE_P_HELP' => 'Insert image: [img]http://image_url[/img]', + 'BBCODE_Q_HELP' => 'Quote text: [quote]text[/quote]', + 'BBCODE_S_HELP' => 'Font colour: [color=red]text[/color] or [color=#FF0000]text[/color]', + 'BBCODE_U_HELP' => 'Underline text: [u]text[/u]', + 'BBCODE_W_HELP' => 'Insert URL: [url]http://url[/url] or [url=http://url]URL text[/url]', + 'BBCODE_Y_HELP' => 'List: Add list element', + 'BUMP_ERROR' => 'You cannot bump this topic so soon after the last post.', + + 'CANNOT_DELETE_REPLIED' => 'Sorry but you may only delete posts which have not been replied to.', + 'CANNOT_EDIT_POST_LOCKED' => 'This post has been locked. You can no longer edit that post.', + 'CANNOT_EDIT_TIME' => 'You can no longer edit or delete that post.', + 'CANNOT_POST_ANNOUNCE' => 'Sorry but you cannot post announcements.', + 'CANNOT_POST_STICKY' => 'Sorry but you cannot post sticky topics.', + 'CHANGE_TOPIC_TO' => 'Change topic type to', + 'CHARS_POST_CONTAINS' => array( + 1 => 'Your message contains %1$d character.', + 2 => 'Your message contains %1$d characters.', + ), + 'CHARS_SIG_CONTAINS' => array( + 1 => 'Your signature contains %1$d character.', + 2 => 'Your signature contains %1$d characters.', + ), + 'CLOSE_TAGS' => 'Close tags', + 'CURRENT_TOPIC' => 'Current topic', + + 'DELETE_FILE' => 'Delete file', + 'DELETE_MESSAGE' => 'Delete message', + 'DELETE_MESSAGE_CONFIRM' => 'Are you sure you want to delete this message?', + 'DELETE_OWN_POSTS' => 'Sorry but you can only delete your own posts.', + 'DELETE_PERMANENTLY' => 'Delete permanently', + 'DELETE_POST_CONFIRM' => 'Are you sure you want to delete this post?', + 'DELETE_POST_PERMANENTLY_CONFIRM' => 'Are you sure you want to permanently delete this post?', + 'DELETE_POST_PERMANENTLY' => 'Permanently delete this post so it can not be recovered', + 'DELETE_POSTS_CONFIRM' => 'Are you sure you want to delete these posts?', + 'DELETE_POSTS_PERMANENTLY_CONFIRM' => 'Are you sure you want to permanently delete these posts?', + 'DELETE_REASON' => 'Reason for deletion', + 'DELETE_REASON_EXPLAIN' => 'The specified reason for deletion will be visible to moderators.', + 'DELETE_POST_WARN' => 'Delete this post', + 'DELETE_TOPIC_CONFIRM' => 'Are you sure you want to delete this topic?', + 'DELETE_TOPIC_PERMANENTLY' => 'Permanently delete this topic so it can not be recovered', + 'DELETE_TOPIC_PERMANENTLY_CONFIRM' => 'Are you sure you want to permanently delete this topic?', + 'DELETE_TOPICS_CONFIRM' => 'Are you sure you want to delete these topics?', + 'DELETE_TOPICS_PERMANENTLY_CONFIRM' => 'Are you sure you want to permanently delete these topics?', + 'DISABLE_BBCODE' => 'Disable BBCode', + 'DISABLE_MAGIC_URL' => 'Do not automatically parse URLs', + 'DISABLE_SMILIES' => 'Disable smilies', + 'DISALLOWED_CONTENT' => 'The upload was rejected because the uploaded file was identified as a possible attack vector.', + 'DISALLOWED_EXTENSION' => 'The extension %s is not allowed.', + 'DRAFT_LOADED' => 'Draft loaded into posting area, you may want to finish your post now.
Your draft will be deleted after submitting this post.', + 'DRAFT_LOADED_PM' => 'Draft loaded into message area, you may want to finish your private message now.
Your draft will be deleted after submitting this private message.', + 'DRAFT_SAVED' => 'Draft successfully saved.', + 'DRAFT_TITLE' => 'Draft title', + + 'EDIT_REASON' => 'Reason for editing this post', + 'EMPTY_FILEUPLOAD' => 'The uploaded file is empty.', + 'EMPTY_MESSAGE' => 'You must enter a message when posting.', + 'EMPTY_REMOTE_DATA' => 'File could not be uploaded, please try uploading the file manually.', + + 'FLASH_IS_OFF' => '[flash] is OFF', + 'FLASH_IS_ON' => '[flash] is ON', + 'FLOOD_ERROR' => 'You cannot make another post so soon after your last.', + 'FONT_COLOR' => 'Font colour', + 'FONT_COLOR_HIDE' => 'Hide font colour', + 'FONT_HUGE' => 'Huge', + 'FONT_LARGE' => 'Large', + 'FONT_NORMAL' => 'Normal', + 'FONT_SIZE' => 'Font size', + 'FONT_SMALL' => 'Small', + 'FONT_TINY' => 'Tiny', + + 'GENERAL_UPLOAD_ERROR' => 'Could not upload attachment to %s.', + + 'IMAGES_ARE_OFF' => '[img] is OFF', + 'IMAGES_ARE_ON' => '[img] is ON', + 'INVALID_FILENAME' => '%s is an invalid filename.', + + 'LOAD' => 'Load', + 'LOAD_DRAFT' => 'Load draft', + 'LOAD_DRAFT_EXPLAIN' => 'Here you are able to select the draft you want to continue writing. Your current post will be cancelled, all current post contents will be deleted. View, edit and delete drafts within your User Control Panel.', + 'LOGIN_EXPLAIN_BUMP' => 'You need to login in order to bump topics within this forum.', + 'LOGIN_EXPLAIN_DELETE' => 'You need to login in order to delete posts within this forum.', + 'LOGIN_EXPLAIN_POST' => 'You need to login in order to post within this forum.', + 'LOGIN_EXPLAIN_QUOTE' => 'You need to login in order to quote posts within this forum.', + 'LOGIN_EXPLAIN_REPLY' => 'You need to login in order to reply to topics within this forum.', + + 'MAX_FONT_SIZE_EXCEEDED' => 'You may only use fonts up to size %d.', + 'MAX_FLASH_HEIGHT_EXCEEDED' => array( + 1 => 'Your flash files may only be up to %d pixel high.', + 2 => 'Your flash files may only be up to %d pixels high.', + ), + 'MAX_FLASH_WIDTH_EXCEEDED' => array( + 1 => 'Your flash files may only be up to %d pixel wide.', + 2 => 'Your flash files may only be up to %d pixels wide.', + ), + 'MAX_IMG_HEIGHT_EXCEEDED' => array( + 1 => 'Your images may only be up to %1$d pixel high.', + 2 => 'Your images may only be up to %1$d pixels high.', + ), + 'MAX_IMG_WIDTH_EXCEEDED' => array( + 1 => 'Your images may only be up to %d pixel wide.', + 2 => 'Your images may only be up to %d pixels wide.', + ), + + 'MESSAGE_BODY_EXPLAIN' => array( + 0 => '', // zero means no limit, so we don't view a message here. + 1 => 'Enter your message here, it may contain no more than %d character.', + 2 => 'Enter your message here, it may contain no more than %d characters.', + ), + 'MESSAGE_DELETED' => 'This message has been deleted successfully.', + 'MORE_SMILIES' => 'View more smilies', + + 'NOTIFY_REPLY' => 'Notify me when a reply is posted', + 'NOT_UPLOADED' => 'File could not be uploaded.', + 'NO_DELETE_POLL_OPTIONS' => 'You cannot delete existing poll options.', + 'NO_PM_ICON' => 'No PM icon', + 'NO_POLL_TITLE' => 'You have to enter a poll title.', + 'NO_POST' => 'The requested post does not exist.', + 'NO_POST_MODE' => 'No post mode specified.', + + 'PARTIAL_UPLOAD' => 'The uploaded file was only partially uploaded.', + 'PHP_SIZE_NA' => 'The attachment’s file size is too large.
Could not determine the maximum size defined by PHP in php.ini.', + 'PHP_SIZE_OVERRUN' => 'The attachment’s file size is too large, the maximum upload size is %1$d %2$s.
Please note this is set in php.ini and cannot be overridden.', + 'PLACE_INLINE' => 'Place inline', + 'POLL_DELETE' => 'Delete poll', + 'POLL_FOR' => 'Run poll for', + 'POLL_FOR_EXPLAIN' => 'Enter 0 for a never ending poll.', + 'POLL_MAX_OPTIONS' => 'Options per user', + 'POLL_MAX_OPTIONS_EXPLAIN' => 'This is the number of options each user may select when voting.', + 'POLL_OPTIONS' => 'Poll options', + 'POLL_OPTIONS_EXPLAIN' => array( + 1 => 'Place each option on a new line. You may enter %d option.', + 2 => 'Place each option on a new line. You may enter up to %d options.', + ), + 'POLL_OPTIONS_EDIT_EXPLAIN' => array( + 1 => 'Place each option on a new line. You may enter %d option. If you remove or add options all previous votes will be reset.', + 2 => 'Place each option on a new line. You may enter up to %d options. If you remove or add options all previous votes will be reset.', + ), + 'POLL_QUESTION' => 'Poll question', + 'POLL_TITLE_TOO_LONG' => 'The poll title must contain fewer than 100 characters.', + 'POLL_TITLE_COMP_TOO_LONG' => 'The parsed size of your poll title is too large, consider removing BBCodes or smilies.', + 'POLL_VOTE_CHANGE' => 'Allow re-voting', + 'POLL_VOTE_CHANGE_EXPLAIN' => 'If enabled users are able to change their vote.', + 'POSTED_ATTACHMENTS' => 'Posted attachments', + 'POST_APPROVAL_NOTIFY' => 'You will be notified when your post has been approved.', + 'POST_CONFIRMATION' => 'Confirmation of post', + 'POST_CONFIRM_EXPLAIN' => 'To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.', + 'POST_DELETED' => 'This post has been deleted successfully.', + 'POST_EDITED' => 'This post has been edited successfully.', + 'POST_EDITED_MOD' => 'This post has been edited successfully, but it will need to be approved by a moderator before it is publicly viewable.', + 'POST_GLOBAL' => 'Global', + 'POST_ICON' => 'Post icon', + 'POST_NORMAL' => 'Normal', + 'POST_REVIEW' => 'Post review', + 'POST_REVIEW_EDIT' => 'Post review', + 'POST_REVIEW_EDIT_EXPLAIN' => 'This post has been altered by another user while you were editing it. You may wish to review the current version of this post and adjust your edits.', + 'POST_REVIEW_EXPLAIN' => 'At least one new post has been made to this topic. You may wish to review your post in light of this.', + 'POST_STORED' => 'This message has been posted successfully.', + 'POST_STORED_MOD' => 'This message has been submitted successfully, but it will need to be approved by a moderator before it is publicly viewable.', + 'POST_TOPIC_AS' => 'Post topic as', + 'PROGRESS_BAR' => 'Progress bar', + + 'QUOTE_DEPTH_EXCEEDED' => array( + 1 => 'You may embed only %d quote within each other.', + 2 => 'You may embed only %d quotes within each other.', + ), + 'QUOTE_NO_NESTING' => 'You may not embed quotes within each other.', + + 'REMOTE_UPLOAD_TIMEOUT' => 'The specified file could not be uploaded because the request timed out.', + 'SAVE' => 'Save', + 'SAVE_DATE' => 'Saved at', + 'SAVE_DRAFT' => 'Save draft', + 'SAVE_DRAFT_CONFIRM' => 'Please note that saved drafts only include the subject and the message, any other element will be removed. Do you want to save your draft now?', + 'SMILIES' => 'Smilies', + 'SMILIES_ARE_OFF' => 'Smilies are OFF', + 'SMILIES_ARE_ON' => 'Smilies are ON', + 'STICKY_ANNOUNCE_TIME_LIMIT'=> 'Sticky/Announcement time limit', + 'STICK_TOPIC_FOR' => 'Stick topic for', + 'STICK_TOPIC_FOR_EXPLAIN' => 'Enter 0 for a never ending Sticky/Announcement. Please note that this number is relative to the date of the post.', + 'STYLES_TIP' => 'Tip: Styles can be applied quickly to selected text.', + + 'TOO_FEW_CHARS' => 'Your message contains too few characters.', + 'TOO_FEW_CHARS_LIMIT' => array( + 1 => 'You need to enter at least %1$d character.', + 2 => 'You need to enter at least %1$d characters.', + ), + 'TOO_FEW_POLL_OPTIONS' => 'You must enter at least two poll options.', + 'TOO_MANY_ATTACHMENTS' => 'Cannot add another attachment, %d is the maximum.', + 'TOO_MANY_CHARS' => 'Your message contains too many characters.', + 'TOO_MANY_CHARS_LIMIT' => array( + 2 => 'The maximum number of allowed characters is %1$d.', + ), + 'TOO_MANY_POLL_OPTIONS' => 'You have tried to enter too many poll options.', + 'TOO_MANY_SMILIES' => 'Your message contains too many smilies. The maximum number of smilies allowed is %d.', + 'TOO_MANY_URLS' => 'Your message contains too many URLs. The maximum number of URLs allowed is %d.', + 'TOO_MANY_USER_OPTIONS' => 'You cannot specify more options per user than existing poll options.', + 'TOPIC_BUMPED' => 'Topic has been bumped successfully.', + + 'UNAUTHORISED_BBCODE' => 'You cannot use certain BBCodes: %s.', + 'UNGLOBALISE_EXPLAIN' => 'To switch this topic back from being global to a normal topic, you need to select the forum you wish this topic to be displayed.', + 'UNSUPPORTED_CHARACTERS_MESSAGE' => 'Your message contains the following unsupported characters:
%s', + 'UNSUPPORTED_CHARACTERS_SUBJECT' => 'Your subject contains the following unsupported characters:
%s', + 'UPDATE_COMMENT' => 'Update comment', + 'URL_INVALID' => 'The URL you specified is invalid.', + 'URL_NOT_FOUND' => 'The file specified could not be found.', + 'URL_IS_OFF' => '[url] is OFF', + 'URL_IS_ON' => '[url] is ON', + 'USER_CANNOT_BUMP' => 'You cannot bump topics in this forum.', + 'USER_CANNOT_DELETE' => 'You cannot delete posts in this forum.', + 'USER_CANNOT_EDIT' => 'You cannot edit posts in this forum.', + 'USER_CANNOT_REPLY' => 'You cannot reply in this forum.', + 'USER_CANNOT_FORUM_POST' => 'You are not able to do posting operations on this forum due to the forum type not supporting it.', + + 'VIEW_MESSAGE' => '%sView your submitted message%s', + 'VIEW_PRIVATE_MESSAGE' => '%sView your submitted private message%s', + + 'WRONG_FILESIZE' => 'The file is too big, maximum allowed size is %1$d %2$s.', + 'WRONG_SIZE' => 'The image must be at least %1$s wide, %2$s high and at most %3$s wide and %4$s high. The submitted image is %5$s wide and %6$s high.', +)); diff --git a/sources/phpBB/language/en/search.php b/sources/phpBB/language/en/search.php new file mode 100644 index 0000000..13e5bf7 --- /dev/null +++ b/sources/phpBB/language/en/search.php @@ -0,0 +1,124 @@ + +* @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 + +$lang = array_merge($lang, array( + 'ALL_AVAILABLE' => 'All available', + 'ALL_RESULTS' => 'All results', + + 'DISPLAY_RESULTS' => 'Display results as', + + 'FOUND_SEARCH_MATCHES' => array( + 1 => 'Search found %d match', + 2 => 'Search found %d matches', + ), + 'FOUND_MORE_SEARCH_MATCHES' => array( + 1 => 'Search found more than %d match', + 2 => 'Search found more than %d matches', + ), + + 'GLOBAL' => 'Global announcement', + + 'IGNORED_TERMS' => 'ignored', + 'IGNORED_TERMS_EXPLAIN' => 'The following words in your search query were ignored because they are too common words: %s.', + + 'JUMP_TO_POST' => 'Jump to post', + + 'LOGIN_EXPLAIN_EGOSEARCH' => 'The board requires you to be registered and logged in to view your own posts.', + 'LOGIN_EXPLAIN_UNREADSEARCH'=> 'The board requires you to be registered and logged in to view your unread posts.', + 'LOGIN_EXPLAIN_NEWPOSTS' => 'The board requires you to be registered and logged in to view new posts since your last visit.', + + 'MAX_NUM_SEARCH_KEYWORDS_REFINE' => array( + 1 => 'You specified too many words to search for. Please do not enter more than %1$d word.', + 2 => 'You specified too many words to search for. Please do not enter more than %1$d words.', + ), + + 'NO_KEYWORDS' => 'You must specify at least one word to search for. Each word must consist of at least %s and must not contain more than %s excluding wildcards.', + 'NO_RECENT_SEARCHES' => 'No searches have been carried out recently.', + 'NO_SEARCH' => 'Sorry but you are not permitted to use the search system.', + 'NO_SEARCH_RESULTS' => 'No suitable matches were found.', + 'NO_SEARCH_LOAD' => 'Sorry but you cannot use search at this time. The server has high load. Please try again later.', + 'NO_SEARCH_TIME' => array( + 1 => 'Sorry but you cannot use search at this time. Please try again in %d second.', + 2 => 'Sorry but you cannot use search at this time. Please try again in %d seconds.', + ), + 'NO_SEARCH_UNREADS' => 'Sorry but searching for unread posts has been disabled on this board.', + 'WORD_IN_NO_POST' => 'No posts were found because the word %s is not contained in any post.', + 'WORDS_IN_NO_POST' => 'No posts were found because the words %s are not contained in any post.', + + 'POST_CHARACTERS' => 'characters of posts', + 'PHRASE_SEARCH_DISABLED' => 'Searching by exact phrase is not supported on this board.', + + 'RECENT_SEARCHES' => 'Recent searches', + 'RESULT_DAYS' => 'Limit results to previous', + 'RESULT_SORT' => 'Sort results by', + 'RETURN_FIRST' => 'Return first', + 'GO_TO_SEARCH_ADV' => 'Go to advanced search', + + 'SEARCHED_FOR' => 'Search term used', + 'SEARCHED_TOPIC' => 'Searched topic', + 'SEARCHED_QUERY' => 'Searched query', + 'SEARCH_ALL_TERMS' => 'Search for all terms or use query as entered', + 'SEARCH_ANY_TERMS' => 'Search for any terms', + 'SEARCH_AUTHOR' => 'Search for author', + 'SEARCH_AUTHOR_EXPLAIN' => 'Use * as a wildcard for partial matches.', + 'SEARCH_FIRST_POST' => 'First post of topics only', + 'SEARCH_FORUMS' => 'Search in forums', + 'SEARCH_FORUMS_EXPLAIN' => 'Select the forum or forums you wish to search in. Subforums are searched automatically if you do not disable “search subforums“ below.', + 'SEARCH_IN_RESULTS' => 'Search these results', + 'SEARCH_KEYWORDS_EXPLAIN' => 'Place + in front of a word which must be found and - in front of a word which must not be found. Put a list of words separated by | into brackets if only one of the words must be found. Use * as a wildcard for partial matches.', + 'SEARCH_MSG_ONLY' => 'Message text only', + 'SEARCH_OPTIONS' => 'Search options', + 'SEARCH_QUERY' => 'Search query', + 'SEARCH_SUBFORUMS' => 'Search subforums', + 'SEARCH_TITLE_MSG' => 'Post subjects and message text', + 'SEARCH_TITLE_ONLY' => 'Topic titles only', + 'SEARCH_WITHIN' => 'Search within', + 'SORT_ASCENDING' => 'Ascending', + 'SORT_AUTHOR' => 'Author', + 'SORT_DESCENDING' => 'Descending', + 'SORT_FORUM' => 'Forum', + 'SORT_POST_SUBJECT' => 'Post subject', + 'SORT_TIME' => 'Post time', + 'SPHINX_SEARCH_FAILED' => 'Search failed: %s', + 'SPHINX_SEARCH_FAILED_LOG' => 'Sorry, search could not be performed. More information about this failure has been logged in the error log.', + + 'TOO_FEW_AUTHOR_CHARS' => array( + 1 => 'You must specify at least %d character of the authors name.', + 2 => 'You must specify at least %d characters of the authors name.', + ), +)); diff --git a/sources/phpBB/language/en/search_ignore_words.php b/sources/phpBB/language/en/search_ignore_words.php new file mode 100644 index 0000000..3db209d --- /dev/null +++ b/sources/phpBB/language/en/search_ignore_words.php @@ -0,0 +1,271 @@ + +* @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; +} + +$words = array( + 'a', + 'about', + 'after', + 'ago', + 'all', + 'almost', + 'along', + 'alot', + 'also', + 'am', + 'an', + 'and', + 'answer', + 'any', + 'anybody', + 'anybodys', + 'anywhere', + 'are', + 'arent', + 'around', + 'as', + 'ask', + 'askd', + 'at', + 'bad', + 'be', + 'because', + 'been', + 'before', + 'being', + 'best', + 'better', + 'between', + 'big', + 'btw', + 'but', + 'by', + 'can', + 'cant', + 'come', + 'could', + 'couldnt', + 'day', + 'days', + 'days', + 'did', + 'didnt', + 'do', + 'does', + 'doesnt', + 'dont', + 'down', + 'each', + 'etc', + 'either', + 'else', + 'even', + 'ever', + 'every', + 'everybody', + 'everybodys', + 'everyone', + 'far', + 'find', + 'for', + 'found', + 'from', + 'get', + 'go', + 'going', + 'gone', + 'good', + 'got', + 'gotten', + 'had', + 'has', + 'have', + 'havent', + 'having', + 'her', + 'here', + 'hers', + 'him', + 'his', + 'home', + 'how', + 'hows', + 'href', + 'I', + 'Ive', + 'if', + 'in', + 'ini', + 'into', + 'is', + 'isnt', + 'it', + 'its', + 'its', + 'just', + 'know', + 'large', + 'less', + 'like', + 'liked', + 'little', + 'looking', + 'look', + 'looked', + 'looking', + 'lot', + 'maybe', + 'many', + 'me', + 'more', + 'most', + 'much', + 'must', + 'mustnt', + 'my', + 'near', + 'need', + 'never', + 'new', + 'news', + 'no', + 'none', + 'not', + 'nothing', + 'now', + 'of', + 'off', + 'often', + 'old', + 'on', + 'once', + 'only', + 'oops', + 'or', + 'other', + 'our', + 'ours', + 'out', + 'over', + 'page', + 'please', + 'put', + 'question', + 'questions', + 'questioned', + 'quote', + 'rather', + 'really', + 'recent', + 'said', + 'saw', + 'say', + 'says', + 'she', + 'see', + 'sees', + 'should', + 'sites', + 'small', + 'so', + 'some', + 'something', + 'sometime', + 'somewhere', + 'soon', + 'take', + 'than', + 'true', + 'thank', + 'that', + 'thatd', + 'thats', + 'the', + 'their', + 'theirs', + 'theres', + 'theirs', + 'them', + 'then', + 'there', + 'these', + 'they', + 'theyll', + 'theyd', + 'theyre', + 'this', + 'those', + 'though', + 'through', + 'thus', + 'time', + 'times', + 'to', + 'too', + 'under', + 'until', + 'untrue', + 'up', + 'upon', + 'use', + 'users', + 'version', + 'very', + 'via', + 'want', + 'was', + 'way', + 'we', + 'well', + 'went', + 'were', + 'werent', + 'what', + 'when', + 'where', + 'which', + 'who', + 'whom', + 'whose', + 'why', + 'wide', + 'will', + 'with', + 'within', + 'without', + 'wont', + 'world', + 'worse', + 'worst', + 'would', + 'wrote', + 'www', + 'yes', + 'yet', + 'you', + 'youd', + 'youll', + 'your', + 'youre', + 'yours', + 'AFAIK', + 'IIRC', + 'LOL', + 'ROTF', + 'ROTFLMAO', + 'YMMV', +); diff --git a/sources/phpBB/language/en/search_synonyms.php b/sources/phpBB/language/en/search_synonyms.php new file mode 100644 index 0000000..6a8c257 --- /dev/null +++ b/sources/phpBB/language/en/search_synonyms.php @@ -0,0 +1,191 @@ + +* @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; +} + +$synonyms = array( + 'abcense' => 'absence', + 'abridgement' => 'abridgment', + 'accomodate' => 'accommodate', + 'acknowledgment' => 'acknowledgement', + 'airplane' => 'aeroplane', + 'allright' => 'alright ', + 'andy' => 'andrew', + 'anemia' => 'anaemia', + 'anemic' => 'anaemic', + 'anesthesia' => 'anaesthesia', + 'apologize' => 'apologise', + 'archean' => 'archaean', + 'archeology' => 'archaeology', + 'archeozoic' => 'archaeozoic', + 'armor' => 'armour', + 'artic' => 'arctic', + 'attachment' => 'attachement', + 'attendence' => 'attendance', + + 'barbecue' => 'barbeque', + 'behavior' => 'behaviour', + 'biassed' => 'biased', + 'biol' => 'biology', + 'buletin' => 'bulletin', + + 'calender' => 'calendar', + 'canceled' => 'cancelled', + 'car' => 'automobile', + 'catalog' => 'catalogue', + 'cenozoic' => 'caenozoic', + 'center' => 'centre', + 'check' => 'cheque', + 'color' => 'colour', + 'comission' => 'commission', + 'comittee' => 'committee', + 'commitee' => 'committee', + 'conceed' => 'concede', + 'creating' => 'createing', + 'curiculum' => 'curriculum', + + 'defense' => 'defence', + 'develope' => 'develop', + 'discription' => 'description', + 'dulness' => 'dullness', + + 'encyclopedia' => 'encyclopaedia', + 'enroll' => 'enrol', + 'esthetic' => 'aesthetic', + 'etiology' => 'aetiology', + 'exhorbitant' => 'exorbitant', + 'exhuberant' => 'exuberant', + 'existance' => 'existence', + + 'favorite' => 'favourite', + 'fetus' => 'foetus', + 'ficticious' => 'fictitious', + 'flavor' => 'flavour', + 'flourescent' => 'fluorescent', + 'foriegn' => 'foreign', + 'fourty' => 'forty', + + 'gage' => 'gauge', + 'geneology' => 'genealogy', + 'grammer' => 'grammar', + 'gray' => 'grey', + 'guerilla' => 'guerrilla', + 'gynecology' => 'gynaecology', + + 'harbor' => 'harbour', + 'heighth' => 'height', + 'hemaglobin' => 'haemaglobin', + 'hematin' => 'haematin', + 'hematite' => 'haematite', + 'hematology' => 'haematology', + 'honor' => 'honour', + + 'innoculate' => 'inoculate', + 'installment' => 'instalment', + 'irrelevent' => 'irrelevant', + 'irrevelant' => 'irrelevant', + + 'jeweler' => 'jeweller', + 'judgment' => 'judgement', + + 'labeled' => 'labelled', + 'labor' => 'labour', + 'laborer' => 'labourer', + 'laborers' => 'labourers', + 'laboring' => 'labouring', + 'licence' => 'license', + 'liesure' => 'leisure', + 'liquify' => 'liquefy', + + 'maintainance' => 'maintenance', + 'maintenence' => 'maintenance', + 'medieval' => 'mediaeval', + 'meter' => 'metre', + 'milage' => 'mileage', + 'millipede' => 'millepede', + 'miscelaneous' => 'miscellaneous', + 'morgage' => 'mortgage', + + 'noticable' => 'noticeable', + + 'occurence' => 'occurrence', + 'offense' => 'offence', + 'ommision' => 'omission', + 'ommission' => 'omission', + 'optimize' => 'optimise', + 'organize' => 'organise', + + 'pajamas' => 'pyjamas', + 'paleography' => 'palaeography', + 'paleolithic' => 'palaeolithic', + 'paleontological' => 'palaeontological', + 'paleontologist' => 'palaeontologist', + 'paleontology' => 'palaeontology', + 'paleozoic' => 'palaeozoic', + 'pamplet' => 'pamphlet', + 'paralell' => 'parallel', + 'parl' => 'parliament', + 'parlt' => 'parliament', + 'pediatric' => 'paediatric', + 'pediatrician' => 'paediatrician', + 'pediatrics' => 'paediatrics', + 'pedodontia' => 'paedodontia', + 'pedodontics' => 'paedodontics', + 'personel' => 'personnel', + 'practise' => 'practice', + 'program' => 'programme', + 'psych' => 'psychology', + + 'questionaire' => 'questionnaire', + + 'rarify' => 'rarefy', + 'reccomend' => 'recommend', + 'recieve' => 'receive', + 'resistence' => 'resistance', + 'restaraunt' => 'restaurant', + + 'savior' => 'saviour', + 'sep' => 'september', + 'seperate' => 'separate', + 'sept' => 'september', + 'sieze' => 'seize', + 'summarize' => 'summarise', + 'summerize' => 'summarise', + 'superceed' => 'supercede', + 'superintendant' => 'superintendent', + 'supersede' => 'supercede', + 'suprise' => 'surprise', + 'surprize' => 'surprise', + 'synchronise' => 'synchronize', + + 'temperary' => 'temporary', + 'theater' => 'theatre', + 'threshhold' => 'threshold', + 'transfered' => 'transferred', + 'truely' => 'truly', + 'truley' => 'truly', + + 'useable' => 'usable', + + 'valor' => 'valour', + 'vigor' => 'vigour', + 'vol' => 'volume', + + 'whack' => 'wack', + 'withold' => 'withhold', + + 'yeild' => 'yield', +); diff --git a/sources/phpBB/language/en/ucp.php b/sources/phpBB/language/en/ucp.php new file mode 100644 index 0000000..07751d1 --- /dev/null +++ b/sources/phpBB/language/en/ucp.php @@ -0,0 +1,657 @@ + +* @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 + +// Privacy policy and T&C +$lang = array_merge($lang, array( + 'TERMS_OF_USE_CONTENT' => 'By accessing “%1$s†(hereinafter “weâ€, “usâ€, “ourâ€, “%1$sâ€, “%2$sâ€), you agree to be legally bound by the following terms. If you do not agree to be legally bound by all of the following terms then please do not access and/or use “%1$sâ€. We may change these at any time and we’ll do our utmost in informing you, though it would be prudent to review this regularly yourself as your continued usage of “%1$s†after changes mean you agree to be legally bound by these terms as they are updated and/or amended.
+
+ Our forums are powered by phpBB (hereinafter “theyâ€, “themâ€, “theirâ€, “phpBB softwareâ€, “www.phpbb.comâ€, “phpBB Limitedâ€, “phpBB Teamsâ€) which is a bulletin board solution released under the “GNU General Public License v2†(hereinafter “GPLâ€) and can be downloaded from www.phpbb.com. The phpBB software only facilitates internet based discussions; phpBB Limited is not responsible for what we allow and/or disallow as permissible content and/or conduct. For further information about phpBB, please see: https://www.phpbb.com/.
+
+ You agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate any laws be it of your country, the country where “%1$s†is hosted or International Law. Doing so may lead to you being immediately and permanently banned, with notification of your Internet Service Provider if deemed required by us. The IP address of all posts are recorded to aid in enforcing these conditions. You agree that “%1$s†have the right to remove, edit, move or close any topic at any time should we see fit. As a user you agree to any information you have entered to being stored in a database. While this information will not be disclosed to any third party without your consent, neither “%1$s†nor phpBB shall be held responsible for any hacking attempt that may lead to the data being compromised. + ', + + 'PRIVACY_POLICY' => 'This policy explains in detail how “%1$s†along with its affiliated companies (hereinafter “weâ€, “usâ€, “ourâ€, “%1$sâ€, “%2$sâ€) and phpBB (hereinafter “theyâ€, “themâ€, “theirâ€, “phpBB softwareâ€, “www.phpbb.comâ€, “phpBB Limitedâ€, “phpBB Teamsâ€) use any information collected during any session of usage by you (hereinafter “your informationâ€).
+
+ Your information is collected via two ways. Firstly, by browsing “%1$s†will cause the phpBB software to create a number of cookies, which are small text files that are downloaded on to your computer’s web browser temporary files. The first two cookies just contain a user identifier (hereinafter “user-idâ€) and an anonymous session identifier (hereinafter “session-idâ€), automatically assigned to you by the phpBB software. A third cookie will be created once you have browsed topics within “%1$s†and is used to store which topics have been read, thereby improving your user experience.
+
+ We may also create cookies external to the phpBB software whilst browsing “%1$sâ€, though these are outside the scope of this document which is intended to only cover the pages created by the phpBB software. The second way in which we collect your information is by what you submit to us. This can be, and is not limited to: posting as an anonymous user (hereinafter “anonymous postsâ€), registering on “%1$s†(hereinafter “your accountâ€) and posts submitted by you after registration and whilst logged in (hereinafter “your postsâ€).
+
+ Your account will at a bare minimum contain a uniquely identifiable name (hereinafter “your user nameâ€), a personal password used for logging into your account (hereinafter “your passwordâ€) and a personal, valid email address (hereinafter “your emailâ€). Your information for your account at “%1$s†is protected by data-protection laws applicable in the country that hosts us. Any information beyond your user name, your password, and your email address required by “%1$s†during the registration process is either mandatory or optional, at the discretion of “%1$sâ€. In all cases, you have the option of what information in your account is publicly displayed. Furthermore, within your account, you have the option to opt-in or opt-out of automatically generated emails from the phpBB software.
+
+ Your password is ciphered (a one-way hash) so that it is secure. However, it is recommended that you do not reuse the same password across a number of different websites. Your password is the means of accessing your account at “%1$sâ€, so please guard it carefully and under no circumstance will anyone affiliated with “%1$sâ€, phpBB or another 3rd party, legitimately ask you for your password. Should you forget your password for your account, you can use the “I forgot my password†feature provided by the phpBB software. This process will ask you to submit your user name and your email, then the phpBB software will generate a new password to reclaim your account.
+ ', +)); + +// Common language entries +$lang = array_merge($lang, array( + 'ACCOUNT_ACTIVE' => 'Your account has now been activated. Thank you for registering.', + 'ACCOUNT_ACTIVE_ADMIN' => 'The account has now been activated.', + 'ACCOUNT_ACTIVE_PROFILE' => 'Your account has now been successfully reactivated.', + 'ACCOUNT_ADDED' => 'Thank you for registering, your account has been created. You may now login with your username and password.', + 'ACCOUNT_COPPA' => 'Your account has been created but has to be approved, please check your email for details.', + 'ACCOUNT_EMAIL_CHANGED' => 'Your account has been updated. However, this board requires account reactivation on email changes. An activation key has been sent to the new email address you provided. Please check your email for further information.', + 'ACCOUNT_EMAIL_CHANGED_ADMIN' => 'Your account has been updated. However, this board requires account reactivation by the administrators on email changes. An email has been sent to them and you will be informed when your account has been reactivated.', + 'ACCOUNT_INACTIVE' => 'Your account has been created. However, this board requires account activation, an activation key has been sent to the email address you provided. Please check your email for further information.', + 'ACCOUNT_INACTIVE_ADMIN' => 'Your account has been created. However, this board requires account activation by the administrator group. An email has been sent to them and you will be informed when your account has been activated.', + 'ACTIVATION_EMAIL_SENT' => 'The activation email has been sent to your email address.', + 'ACTIVATION_EMAIL_SENT_ADMIN' => 'The activation email has been sent to the administrators email addresses.', + 'ADD' => 'Add', + 'ADD_BCC' => 'Add [BCC]', + 'ADD_FOES' => 'Add new foes', + 'ADD_FOES_EXPLAIN' => 'You may enter several usernames each on a different line.', + 'ADD_FOLDER' => 'Add folder', + 'ADD_FRIENDS' => 'Add new friends', + 'ADD_FRIENDS_EXPLAIN' => 'You may enter several usernames each on a different line.', + 'ADD_NEW_RULE' => 'Add new rule', + 'ADD_RULE' => 'Add rule', + 'ADD_TO' => 'Add [To]', + 'ADD_USERS_UCP_EXPLAIN' => 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Please enter each username on a separate line.', + 'ADMIN_EMAIL' => 'Administrators can email me information', + 'AGREE' => 'I agree to these terms', + 'ALLOW_PM' => 'Allow users to send you private messages', + 'ALLOW_PM_EXPLAIN' => 'Note that administrators and moderators will always be able to send you messages.', + 'ALREADY_ACTIVATED' => 'You have already activated your account.', + 'ATTACHMENTS_EXPLAIN' => 'This is a list of attachments you have made in posts to this board.', + 'ATTACHMENTS_DELETED' => 'Attachments successfully deleted.', + 'ATTACHMENT_DELETED' => 'Attachment successfully deleted.', + 'AUTOLOGIN_SESSION_KEYS_DELETED'=> 'The selected "Remember Me" login keys were successfully deleted.', + 'AVATAR_CATEGORY' => 'Category', + 'AVATAR_DRIVER_GRAVATAR_TITLE' => 'Gravatar', + 'AVATAR_DRIVER_GRAVATAR_EXPLAIN'=> 'Gravatar is a service that allows you to maintain the same avatar across multiple websites. Visit Gravatar for more information.', + 'AVATAR_DRIVER_LOCAL_TITLE' => 'Gallery avatar', + 'AVATAR_DRIVER_LOCAL_EXPLAIN' => 'You can choose your avatar from a locally available set of avatars.', + 'AVATAR_DRIVER_REMOTE_TITLE' => 'Remote avatar', + 'AVATAR_DRIVER_REMOTE_EXPLAIN' => 'Link to avatar images from another website.', + 'AVATAR_DRIVER_UPLOAD_TITLE' => 'Upload avatar', + 'AVATAR_DRIVER_UPLOAD_EXPLAIN' => 'Upload your own custom avatar.', + 'AVATAR_EXPLAIN' => 'Maximum dimensions; width: %1$s, height: %2$s, file size: %3$.2f KiB.', + 'AVATAR_FEATURES_DISABLED' => 'The avatar functionality is currently disabled.', + 'AVATAR_GALLERY' => 'Local gallery', + 'AVATAR_GENERAL_UPLOAD_ERROR' => 'Could not upload avatar to %s.', + 'AVATAR_NOT_ALLOWED' => 'Your avatar cannot be displayed because avatars have been disallowed.', + 'AVATAR_PAGE' => 'Page', + 'AVATAR_SELECT' => 'Select your avatar', + 'AVATAR_TYPE' => 'Avatar type', + 'AVATAR_TYPE_NOT_ALLOWED' => 'Your current avatar cannot be displayed because its type has been disallowed.', + + 'BACK_TO_DRAFTS' => 'Back to saved drafts', + 'BACK_TO_LOGIN' => 'Back to login screen', + 'BIRTHDAY' => 'Birthday', + 'BIRTHDAY_EXPLAIN' => 'Setting a year will list your age when it is your birthday.', + 'BOARD_DATE_FORMAT' => 'My date format', + 'BOARD_DATE_FORMAT_EXPLAIN' => 'The syntax used is identical to the PHP date() function.', + 'BOARD_LANGUAGE' => 'My language', + 'BOARD_STYLE' => 'My board style', + 'BOARD_TIMEZONE' => 'My timezone', + 'BOOKMARKS' => 'Bookmarks', + 'BOOKMARKS_EXPLAIN' => 'You can bookmark topics for future reference. Select the checkbox for any bookmark you wish to delete, then press the Remove marked bookmarks button.', + 'BOOKMARKS_DISABLED' => 'Bookmarks are disabled on this board.', + 'BOOKMARKS_REMOVED' => 'Bookmarks removed successfully.', + + 'CANNOT_EDIT_MESSAGE_TIME' => 'You can no longer edit or delete that message.', + 'CANNOT_MOVE_TO_SAME_FOLDER'=> 'Messages cannot be moved to the folder you want to remove.', + 'CANNOT_MOVE_FROM_SPECIAL' => 'Messages cannot be moved from the outbox.', + 'CANNOT_RENAME_FOLDER' => 'This folder cannot be renamed.', + 'CANNOT_REMOVE_FOLDER' => 'This folder cannot be removed.', + 'CHANGE_DEFAULT_GROUP' => 'Change default group', + 'CHANGE_PASSWORD' => 'Change password', + 'CLICK_GOTO_FOLDER' => '%1$sGo to your “%3$s†folder%2$s', + 'CLICK_RETURN_FOLDER' => '%1$sReturn to your “%3$s†folder%2$s', + 'CONFIRMATION' => 'Confirmation of registration', + 'CONFIRM_CHANGES' => 'Confirm changes', + 'CONFIRM_EXPLAIN' => 'To prevent automated registrations the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.', + 'VC_REFRESH' => 'Refresh confirmation code', + 'VC_REFRESH_EXPLAIN' => 'If you cannot read the code you can request a new one by clicking the button.', + + 'CONFIRM_PASSWORD' => 'Confirm password', + 'CONFIRM_PASSWORD_EXPLAIN' => 'You only need to confirm your password if you changed it above.', + 'COPPA_BIRTHDAY' => 'To continue with the registration procedure please tell us when you were born.', + 'COPPA_COMPLIANCE' => 'COPPA compliance', + 'COPPA_EXPLAIN' => 'Please note that clicking submit will create your account. However it cannot be activated until a parent or guardian approves your registration. You will be emailed a copy of the necessary form with details of where to send it.', + 'CREATE_FOLDER' => 'Add folder…', + 'CURRENT_IMAGE' => 'Current image', + 'CURRENT_PASSWORD' => 'Current password', + 'CURRENT_PASSWORD_EXPLAIN' => 'You must enter your current password if you wish to alter your email address or username.', + 'CURRENT_CHANGE_PASSWORD_EXPLAIN' => 'To change your password, your email address, or your username, you must enter your current password.', + 'CUR_PASSWORD_EMPTY' => 'You did not enter your current password.', + 'CUR_PASSWORD_ERROR' => 'The current password you entered is incorrect.', + 'CUSTOM_DATEFORMAT' => 'Custom…', + + 'DEFAULT_ACTION' => 'Default action', + 'DEFAULT_ACTION_EXPLAIN' => 'This action will be triggered if none of the above is applicable.', + 'DEFAULT_ADD_SIG' => 'Attach my signature by default', + 'DEFAULT_BBCODE' => 'Enable BBCode by default', + 'DEFAULT_NOTIFY' => 'Notify me upon replies by default', + 'DEFAULT_SMILIES' => 'Enable smilies by default', + 'DEFINED_RULES' => 'Defined rules', + 'DELETED_TOPIC' => 'Topic has been removed.', + 'DELETE_ATTACHMENT' => 'Delete attachment', + 'DELETE_ATTACHMENTS' => 'Delete attachments', + 'DELETE_ATTACHMENT_CONFIRM' => 'Are you sure you want to delete this attachment?', + 'DELETE_ATTACHMENTS_CONFIRM'=> 'Are you sure you want to delete these attachments?', + 'DELETE_AVATAR' => 'Delete image', + 'DELETE_COOKIES_CONFIRM' => 'Are you sure you want to delete all cookies set by this board?', + 'DELETE_MARKED_PM' => 'Delete marked messages', + 'DELETE_MARKED_PM_CONFIRM' => 'Are you sure you want to delete all marked messages?', + 'DELETE_OLDEST_MESSAGES' => 'Delete oldest messages', + 'DELETE_MESSAGE' => 'Delete message', + 'DELETE_MESSAGE_CONFIRM' => 'Are you sure you want to delete this private message?', + 'DELETE_MESSAGES_IN_FOLDER' => 'Delete all messages within removed folder', + 'DELETE_RULE' => 'Delete rule', + 'DELETE_RULE_CONFIRM' => 'Are you sure you want to delete this rule?', + 'DEMOTE_SELECTED' => 'Demote selected', + 'DISABLE_CENSORS' => 'Enable word censoring', + 'DISPLAY_GALLERY' => 'Display gallery', + 'DOMAIN_NO_MX_RECORD_EMAIL' => 'The entered email domain has no valid MX record.', + 'DOWNLOADS' => 'Downloads', + 'DRAFTS_DELETED' => 'All selected drafts were successfully deleted.', + 'DRAFTS_EXPLAIN' => 'Here you can view, edit and delete your saved drafts.', + 'DRAFT_UPDATED' => 'Draft successfully updated.', + + 'EDIT_DRAFT_EXPLAIN' => 'Here you are able to edit your draft. Drafts do not contain attachment and poll information.', + 'EMAIL_BANNED_EMAIL' => 'The email address you entered is not allowed to be used.', + 'EMAIL_REMIND' => 'This must be the email address associated with your account. If you have not changed this via your user control panel then it is the email address you registered your account with.', + 'EMAIL_TAKEN_EMAIL' => 'The entered email address is already in use.', + 'EMPTY_DRAFT' => 'You must enter a message to submit your changes.', + 'EMPTY_DRAFT_TITLE' => 'You must enter a draft title.', + 'EXPORT_AS_XML' => 'Export as XML', + 'EXPORT_AS_CSV' => 'Export as CSV', + 'EXPORT_AS_CSV_EXCEL' => 'Export as CSV (Excel)', + 'EXPORT_AS_TXT' => 'Export as TXT', + 'EXPORT_AS_MSG' => 'Export as MSG', + 'EXPORT_FOLDER' => 'Export this view', + + 'FIELD_REQUIRED' => 'The field “%s†must be completed.', + 'FIELD_TOO_SHORT' => array( + 1 => 'The field “%2$s†is too short, a minimum of %1$d character is required.', + 2 => 'The field “%2$s†is too short, a minimum of %1$d characters is required.', + ), + 'FIELD_TOO_LONG' => array( + 1 => 'The field “%2$s†is too long, a maximum of %1$d character is allowed.', + 2 => 'The field “%2$s†is too long, a maximum of %1$d characters is allowed.', + ), + 'FIELD_TOO_SMALL' => 'The value of “%2$s†is too small, a minimum value of %1$d is required.', + 'FIELD_TOO_LARGE' => 'The value of “%2$s†is too large, a maximum value of %1$d is allowed.', + 'FIELD_INVALID_CHARS_INVALID' => 'The field “%s†has invalid characters.', + 'FIELD_INVALID_CHARS_NUMBERS_ONLY' => 'The field “%s†has invalid characters, only numbers are allowed.', + 'FIELD_INVALID_CHARS_ALPHA_DOTS' => 'The field “%s†has invalid characters, only alphanumeric or . characters are allowed.', + 'FIELD_INVALID_CHARS_ALPHA_ONLY' => 'The field “%s†has invalid characters, only alphanumeric characters are allowed.', + 'FIELD_INVALID_CHARS_ALPHA_PUNCTUATION' => 'The field “%s†has invalid characters, only alphanumeric or _,-. characters are allowed and the first character must be alphabetic.', + 'FIELD_INVALID_CHARS_ALPHA_SPACERS' => 'The field “%s†has invalid characters, only alphanumeric, space or -+_[] characters are allowed.', + 'FIELD_INVALID_CHARS_ALPHA_UNDERSCORE' => 'The field “%s†has invalid characters, only alphanumeric or _ characters are allowed.', + 'FIELD_INVALID_CHARS_LETTER_NUM_DOTS' => 'The field “%s†has invalid characters, only letter, number or . characters are allowed.', + 'FIELD_INVALID_CHARS_LETTER_NUM_ONLY' => 'The field “%s†has invalid characters, only letter and number characters are allowed.', + 'FIELD_INVALID_CHARS_LETTER_NUM_PUNCTUATION' => 'The field “%s†has invalid characters, only letter, number or _,-. characters are allowed and the first character must be alphabetic.', + 'FIELD_INVALID_CHARS_LETTER_NUM_SPACERS' => 'The field “%s†has invalid characters, only letter, number, space or -+_[] characters are allowed.', + 'FIELD_INVALID_CHARS_LETTER_NUM_UNDERSCORE' => 'The field “%s†has invalid characters, only letter, number or _ characters are allowed.', + 'FIELD_INVALID_DATE' => 'The field “%s†has an invalid date.', + 'FIELD_INVALID_URL' => 'The field “%s†has an invalid url.', + 'FIELD_INVALID_VALUE' => 'The field “%s†has an invalid value.', + + 'FOE_MESSAGE' => 'Message from foe', + 'FOES_EXPLAIN' => 'Foes are users which will be ignored by default. Posts by these users will not be fully visible. Personal messages from foes are still permitted. Please note that you cannot ignore moderators or administrators.', + 'FOES_UPDATED' => 'Your foes list has been updated successfully.', + 'FOLDER_ADDED' => 'Folder successfully added.', + 'FOLDER_MESSAGE_STATUS' => array( + 1 => '%2$d out of %1$s stored', + 2 => '%2$d out of %1$s stored', + ), + 'FOLDER_NAME_EMPTY' => 'You must enter a name for this folder.', + 'FOLDER_NAME_EXIST' => 'Folder %s already exists.', + 'FOLDER_OPTIONS' => 'Folder options', + 'FOLDER_RENAMED' => 'Folder successfully renamed.', + 'FOLDER_REMOVED' => 'Folder successfully removed.', + 'FOLDER_STATUS_MSG' => array( + 1 => 'Folder is %3$d%% full (%2$d out of %1$s stored)', + 2 => 'Folder is %3$d%% full (%2$d out of %1$s stored)', + ), + 'FORWARD_PM' => 'Forward PM', + 'FORCE_PASSWORD_EXPLAIN' => 'Before you may continue browsing the board you are required to change your password.', + 'FRIEND_MESSAGE' => 'Message from friend', + 'FRIENDS' => 'Friends', + 'FRIENDS_EXPLAIN' => 'Friends enable you quick access to members you communicate with frequently. If the template has relevant support any posts made by a friend may be highlighted.', + 'FRIENDS_OFFLINE' => 'Offline', + 'FRIENDS_ONLINE' => 'Online', + 'FRIENDS_UPDATED' => 'Your friends list has been updated successfully.', + 'FULL_FOLDER_OPTION_CHANGED'=> 'The action to take when a folder is full has been changed successfully.', + 'FWD_ORIGINAL_MESSAGE' => '-------- Original Message --------', + 'FWD_SUBJECT' => 'Subject: %s', + 'FWD_DATE' => 'Date: %s', + 'FWD_FROM' => 'From: %s', + 'FWD_TO' => 'To: %s', + + 'GLOBAL_ANNOUNCEMENT' => 'Global announcement', + + 'GRAVATAR_AVATAR_EMAIL' => 'Gravatar email', + 'GRAVATAR_AVATAR_EMAIL_EXPLAIN' => 'Enter the email address you used for registering your account on Gravatar.', + 'GRAVATAR_AVATAR_SIZE' => 'Avatar dimensions', + 'GRAVATAR_AVATAR_SIZE_EXPLAIN' => 'Specify the width and height of the avatar, leave blank to attempt automatic verification.', + + 'HIDE_ONLINE' => 'Hide my online status', + 'HIDE_ONLINE_EXPLAIN' => 'Changing this setting won’t become effective until your next visit to the board.', + 'HOLD_NEW_MESSAGES' => 'Do not accept new messages (New messages will be held back until enough space is available)', + 'HOLD_NEW_MESSAGES_SHORT' => 'New messages will be held back', + + 'IF_FOLDER_FULL' => 'If folder is full', + 'IMPORTANT_NEWS' => 'Important announcements', + 'INVALID_USER_BIRTHDAY' => 'The entered birthday is not a valid date.', + 'INVALID_CHARS_USERNAME' => 'The username contains forbidden characters.', + 'INVALID_CHARS_NEW_PASSWORD'=> 'The password does not contain the required characters.', + 'ITEMS_REQUIRED' => 'The items marked with * are required profile fields and need to be filled out.', + + 'JOIN_SELECTED' => 'Join selected', + + 'LANGUAGE' => 'Language', + 'LINK_REMOTE_AVATAR' => 'Link off-site', + 'LINK_REMOTE_AVATAR_EXPLAIN'=> 'Enter the URL of the location containing the avatar image you wish to link to.', + 'LINK_REMOTE_SIZE' => 'Avatar dimensions', + 'LINK_REMOTE_SIZE_EXPLAIN' => 'Specify the width and height of the avatar, leave blank to attempt automatic verification.', + 'LOGIN_EXPLAIN_UCP' => 'Please login in order to access the User Control Panel.', + 'LOGIN_LINK' => 'Link or register your account on an external service with your board account', + 'LOGIN_LINK_EXPLAIN' => 'You have attempted to login with an external service that is not yet connected to an account on this board. You must now either link this account to an existing account or create a new account.', + 'LOGIN_LINK_MISSING_DATA' => 'Data that is necessary to link your account with an external service is not available. Please restart the login process.', + 'LOGIN_LINK_NO_DATA_PROVIDED' => 'No data has been provided to this page to link an external account to a forum account. Please contact the board administrator if you continue to experience problems.', + 'LOGIN_KEY' => 'Login Key', + 'LOGIN_TIME' => 'Login Time', + 'LOGIN_REDIRECT' => 'You have been successfully logged in.', + 'LOGOUT_FAILED' => 'You were not logged out, as the request did not match your session. Please contact the board administrator if you continue to experience problems.', + 'LOGOUT_REDIRECT' => 'You have been successfully logged out.', + + 'MARK_IMPORTANT' => 'Mark/Unmark as important', + 'MARKED_MESSAGE' => 'Marked message', + 'MAX_FOLDER_REACHED' => 'Maximum number of allowed user defined folders reached.', + 'MESSAGE_BY_AUTHOR' => 'by', + 'MESSAGE_COLOURS' => 'Message colours', + 'MESSAGE_DELETED' => 'Message successfully deleted.', + 'MESSAGE_EDITED' => 'Message successfully edited.', + 'MESSAGE_HISTORY' => 'Message history', + 'MESSAGE_REMOVED_FROM_OUTBOX' => 'This message was deleted by its author.', + 'MESSAGE_SENT_ON' => 'on', + 'MESSAGE_STORED' => 'This message has been sent successfully.', + 'MESSAGE_TO' => 'To', + 'MESSAGES_DELETED' => 'Messages successfully deleted', + 'MOVE_DELETED_MESSAGES_TO' => 'Move messages from removed folder to', + 'MOVE_DOWN' => 'Move down', + 'MOVE_MARKED_TO_FOLDER' => 'Move marked to %s', + 'MOVE_PM_ERROR' => array( + 1 => 'An error occurred while moving the messages to the new folder, only %2$d out of %1$s was moved.', + 2 => 'An error occurred while moving the messages to the new folder, only %2$d out of %1$s were moved.', + ), + 'MOVE_TO_FOLDER' => 'Move to folder', + 'MOVE_UP' => 'Move up', + + 'NEW_FOLDER_NAME' => 'New folder name', + 'NEW_PASSWORD' => 'New password', + 'NEW_PASSWORD_CONFIRM_EMPTY' => 'You did not enter a confirm password.', + 'NEW_PASSWORD_ERROR' => 'The passwords you entered do not match.', + + 'NOTIFICATIONS_MARK_ALL_READ' => 'Mark all notifications read', + 'NOTIFICATIONS_MARK_ALL_READ_CONFIRM' => 'Are you sure you want to mark all notifications read?', + 'NOTIFICATIONS_MARK_ALL_READ_SUCCESS' => 'All notifications have been marked read.', + 'NOTIFICATION_GROUP_MISCELLANEOUS' => 'Miscellaneous Notifications', + 'NOTIFICATION_GROUP_MODERATION' => 'Moderation Notifications', + 'NOTIFICATION_GROUP_ADMINISTRATION' => 'Administration Notifications', + 'NOTIFICATION_GROUP_POSTING' => 'Posting Notifications', + 'NOTIFICATION_METHOD_EMAIL' => 'Email', + 'NOTIFICATION_METHOD_JABBER' => 'Jabber', + 'NOTIFICATION_TYPE' => 'Notification type', + 'NOTIFICATION_TYPE_BOOKMARK' => 'Someone replies to a topic you have bookmarked', + 'NOTIFICATION_TYPE_GROUP_REQUEST' => 'Someone requests to join a group you lead', + 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE' => 'A post or topic needs approval', + 'NOTIFICATION_TYPE_MODERATION_QUEUE' => 'Your topics/posts are approved or disapproved by a moderator', + 'NOTIFICATION_TYPE_PM' => 'Someone sends you a private message', + 'NOTIFICATION_TYPE_POST' => 'Someone replies to a topic to which you are subscribed', + 'NOTIFICATION_TYPE_QUOTE' => 'Someone quotes you in a post', + 'NOTIFICATION_TYPE_REPORT' => 'Someone reports a post', + 'NOTIFICATION_TYPE_TOPIC' => 'Someone creates a topic in a forum to which you are subscribed', + 'NOTIFICATION_TYPE_ADMIN_ACTIVATE_USER' => 'Newly registered user requiring activation', + + 'NOTIFY_METHOD' => 'Notification method', + 'NOTIFY_METHOD_BOTH' => 'Both', + 'NOTIFY_METHOD_EMAIL' => 'Email only', + 'NOTIFY_METHOD_EXPLAIN' => 'Method for sending messages sent via this board.', + 'NOTIFY_METHOD_IM' => 'Jabber only', + 'NOTIFY_ON_PM' => 'Notify me on new private messages', + 'NOT_ADDED_FRIENDS_ANONYMOUS' => 'You cannot add the anonymous user to your friends list.', + 'NOT_ADDED_FRIENDS_BOTS' => 'You cannot add bots to your friends list.', + 'NOT_ADDED_FRIENDS_FOES' => 'You cannot add users to your friends list who are on your foes list.', + 'NOT_ADDED_FRIENDS_SELF' => 'You cannot add yourself to the friends list.', + 'NOT_ADDED_FOES_MOD_ADMIN' => 'You cannot add administrators and moderators to your foes list.', + 'NOT_ADDED_FOES_ANONYMOUS' => 'You cannot add the anonymous user to your foes list.', + 'NOT_ADDED_FOES_BOTS' => 'You cannot add bots to your foes list.', + 'NOT_ADDED_FOES_FRIENDS' => 'You cannot add users to your foes list who are on your friends list.', + 'NOT_ADDED_FOES_SELF' => 'You cannot add yourself to the foes list.', + 'NOT_AGREE' => 'I do not agree to these terms', + 'NOT_ENOUGH_SPACE_FOLDER' => 'The destination folder “%s†seems to be full. The requested action has not been taken.', + 'NOT_MOVED_MESSAGES' => array( + 1 => 'You have %d private message currently on hold because of full folder.', + 2 => 'You have %d private messages currently on hold because of full folder.', + ), + 'NO_ACTION_MODE' => 'No message action specified.', + 'NO_AUTHOR' => 'No author defined for this message', + 'NO_AVATAR' => 'No avatar selected', + 'NO_AVATAR_CATEGORY' => 'None', + + 'NO_AUTH_DELETE_MESSAGE' => 'You are not authorised to delete private messages.', + 'NO_AUTH_EDIT_MESSAGE' => 'You are not authorised to edit private messages.', + 'NO_AUTH_FORWARD_MESSAGE' => 'You are not authorised to forward private messages.', + 'NO_AUTH_GROUP_MESSAGE' => 'You are not authorised to send private messages to groups.', + 'NO_AUTH_PASSWORD_REMINDER' => 'You are not authorised to request a new password.', + 'NO_AUTH_PROFILEINFO' => 'You are not authorised to change your profile information.', + 'NO_AUTH_READ_HOLD_MESSAGE' => 'You are not authorised to read private messages that are on hold.', + 'NO_AUTH_READ_MESSAGE' => 'You are not authorised to read private messages.', + 'NO_AUTH_READ_REMOVED_MESSAGE' => 'You are not able to read this message because it was removed by the author.', + 'NO_AUTH_SEND_MESSAGE' => 'You are not authorised to send private messages.', + 'NO_AUTH_SIGNATURE' => 'You are not authorised to define a signature.', + + 'NO_BCC_RECIPIENT' => 'None', + 'NO_BOOKMARKS' => 'You have no bookmarks.', + 'NO_BOOKMARKS_SELECTED' => 'You have selected no bookmarks.', + 'NO_EDIT_READ_MESSAGE' => 'Private message cannot be edited because it has already been read.', + 'NO_EMAIL_USER' => 'The email/username information submitted could not be found.', + 'NO_FOES' => 'No foes currently defined', + 'NO_FRIENDS' => 'No friends currently defined', + 'NO_FRIENDS_OFFLINE' => 'No friends offline', + 'NO_FRIENDS_ONLINE' => 'No friends online', + 'NO_GROUP_SELECTED' => 'No group specified.', + 'NO_IMPORTANT_NEWS' => 'No important announcements present.', + 'NO_MESSAGE' => 'Private message could not be found.', + 'NO_NEW_FOLDER_NAME' => 'You have to specify a new folder name.', + 'NO_NEWER_PM' => 'No newer messages.', + 'NO_OLDER_PM' => 'No older messages.', + 'NO_PASSWORD_SUPPLIED' => 'You cannot login without a password.', + 'NO_RECIPIENT' => 'No recipient defined.', + 'NO_RULES_DEFINED' => 'No rules defined.', + 'NO_SAVED_DRAFTS' => 'No drafts saved.', + 'NO_TO_RECIPIENT' => 'None', + 'NO_WATCHED_FORUMS' => 'You are not subscribed to any forums.', + 'NO_WATCHED_SELECTED' => 'You have not selected any subscribed topics or forums.', + 'NO_WATCHED_TOPICS' => 'You are not subscribed to any topics.', + + 'PASS_TYPE_ALPHA_EXPLAIN' => 'Password must be between %1$s and %2$s long, must contain letters in mixed case and must contain numbers.', + 'PASS_TYPE_ANY_EXPLAIN' => 'Must be between %1$s and %2$s.', + 'PASS_TYPE_CASE_EXPLAIN' => 'Password must be between %1$s and %2$s long and must contain letters in mixed case.', + 'PASS_TYPE_SYMBOL_EXPLAIN' => 'Password must be between %1$s and %2$s long, must contain letters in mixed case, must contain numbers and must contain symbols.', + 'PASSWORD' => 'Password', + 'PASSWORD_ACTIVATED' => 'Your new password has been activated.', + 'PASSWORD_UPDATED' => 'A new password was sent to your registered email address.', + 'PERMISSIONS_RESTORED' => 'Successfully restored original permissions.', + 'PERMISSIONS_TRANSFERRED' => 'Successfully transferred permissions from %s, you are now able to browse the board with this user’s permissions.
Please note that admin permissions were not transferred. You are able to revert to your permission set at any time.', + 'PM_DISABLED' => 'Private messaging has been disabled on this board.', + 'PM_FROM' => 'From', + 'PM_FROM_REMOVED_AUTHOR' => 'This message was sent by a user no longer registered.', + 'PM_ICON' => 'PM icon', + 'PM_INBOX' => 'Inbox', + 'PM_MARK_ALL_READ' => 'Mark all messages read', + 'PM_MARK_ALL_READ_SUCCESS' => 'All private messages in this folder have been marked read', + 'PM_NO_USERS' => 'The requested users to be added do not exist.', + 'PM_OUTBOX' => 'Outbox', + 'PM_SENTBOX' => 'Sent messages', + 'PM_SUBJECT' => 'Message subject', + 'PM_TO' => 'Send to', + 'PM_TOOLS' => 'Message tools', + 'PM_USERS_REMOVED_NO_PERMISSION' => 'Some users couldn’t be added as they do not have permission to read private messages.', + 'PM_USERS_REMOVED_NO_PM' => 'Some users couldn’t be added as they have disabled private message receipt.', + 'POST_EDIT_PM' => 'Edit message', + 'POST_FORWARD_PM' => 'Forward message', + 'POST_NEW_PM' => 'Compose message', + 'POST_PM_LOCKED' => 'Private messaging is locked.', + 'POST_PM_POST' => 'Quote post', + 'POST_QUOTE_PM' => 'Quote message', + 'POST_REPLY_PM' => 'Reply to message', + 'PRINT_PM' => 'Print view', + 'PREFERENCES_UPDATED' => 'Your preferences have been updated.', + 'PROFILE_INFO_NOTICE' => 'Please note that this information may be viewable to other members. Be careful when including any personal details. Any fields marked with a * must be completed.', + 'PROFILE_UPDATED' => 'Your profile has been updated.', + 'PROFILE_AUTOLOGIN_KEYS' => 'The "Remember Me" login keys automatically log you in when you visit the board. If you logout, the remember me login key is deleted only on the computer you are using to logout. Here you can see remember login keys created on other computers you used to access this site.', + 'PROFILE_NO_AUTOLOGIN_KEYS' => 'There are no saved "Remember Me" login keys.', + + 'RECIPIENT' => 'Recipient', + 'RECIPIENTS' => 'Recipients', + 'REGISTRATION' => 'Registration', + 'RELEASE_MESSAGES' => '%sRelease all on-hold messages%s… they will be re-sorted into the appropriate folder if enough space is made available.', + 'REMOVE_ADDRESS' => 'Remove address', + 'REMOVE_SELECTED_BOOKMARKS' => 'Remove selected bookmarks', + 'REMOVE_SELECTED_BOOKMARKS_CONFIRM' => 'Are you sure you want to delete all selected bookmarks?', + 'REMOVE_BOOKMARK_MARKED' => 'Remove marked bookmarks', + 'REMOVE_FOLDER' => 'Remove folder', + 'REMOVE_FOLDER_CONFIRM' => 'Are you sure you want to remove this folder?', + 'RENAME' => 'Rename', + 'RENAME_FOLDER' => 'Rename folder', + 'REPLIED_MESSAGE' => 'Replied to message', + 'REPLY_TO_ALL' => 'Reply to sender and all recipients.', + 'REPORT_PM' => 'Report private message', + 'RESIGN_SELECTED' => 'Resign selected', + 'RETURN_FOLDER' => '%1$sReturn to previous folder%2$s', + 'RETURN_UCP' => '%sReturn to the User Control Panel%s', + 'RULE_ADDED' => 'Rule successfully added.', + 'RULE_ALREADY_DEFINED' => 'This rule was defined previously.', + 'RULE_DELETED' => 'Rule successfully removed.', + 'RULE_LIMIT_REACHED' => 'You cannot add more PM rules. You have reached the maximum number of rules.', + 'RULE_NOT_DEFINED' => 'Rule not correctly specified.', + 'RULE_REMOVED_MESSAGES' => array( + 1 => '%d private message was removed due to private message filters.', + 2 => '%d private messages were removed due to private message filters.', + ), + + 'SAME_PASSWORD_ERROR' => 'The new password you entered is the same as your current password.', + 'SEARCH_YOUR_POSTS' => 'Show your posts', + 'SEND_PASSWORD' => 'Send password', + 'SENT_AT' => 'Sent', // Used before dates in private messages + 'SHOW_EMAIL' => 'Users can contact me by email', + 'SIGNATURE_EXPLAIN' => 'This is a block of text that can be added to posts you make. There is a %d character limit.', + 'SIGNATURE_PREVIEW' => 'Your signature will appear like this in posts', + 'SIGNATURE_TOO_LONG' => 'Your signature is too long.', + 'SELECT_CURRENT_TIME' => 'Select current time', + 'SELECT_TIMEZONE' => 'Select timezone', + 'SORT' => 'Sort', + 'SORT_COMMENT' => 'File comment', + 'SORT_DOWNLOADS' => 'Downloads', + 'SORT_EXTENSION' => 'Extension', + 'SORT_FILENAME' => 'Filename', + 'SORT_POST_TIME' => 'Post time', + 'SORT_SIZE' => 'File size', + + 'TIMEZONE' => 'Timezone', + 'TIMEZONE_DATE_SUGGESTION' => 'Suggestion: %s', + 'TIMEZONE_INVALID' => 'The timezone you selected is invalid.', + 'TO' => 'Recipient', + 'TO_MASS' => 'Recipients', + 'TO_ADD' => 'Add recipient', + 'TO_ADD_MASS' => 'Add recipients', + 'TO_ADD_GROUPS' => 'Add groups', + 'TOO_MANY_RECIPIENTS' => 'You tried to send a private message to too many recipients.', + 'TOO_MANY_REGISTERS' => 'You have exceeded the maximum number of registration attempts for this session. Please try again later.', + + 'UCP' => 'User Control Panel', + 'UCP_ACTIVATE' => 'Activate account', + 'UCP_ADMIN_ACTIVATE' => 'Please note that you will need to enter a valid email address before your account is activated. The administrator will review your account and if approved you will receive an email at the address you specified.', + 'UCP_ATTACHMENTS' => 'Attachments', + 'UCP_AUTH_LINK' => 'External accounts', + 'UCP_AUTH_LINK_ASK' => 'You currently have no account associated with this external service. Click the button below to link your board account to an account with this external service.', + 'UCP_AUTH_LINK_ID' => 'Unique identifier', + 'UCP_AUTH_LINK_LINK' => 'Link', + 'UCP_AUTH_LINK_MANAGE' => 'Manage external account associations', + 'UCP_AUTH_LINK_NOT_SUPPORTED' => 'Linking board accounts to external services is not supported by this board’s current authentication method.', + 'UCP_AUTH_LINK_TITLE' => 'Manage your external account associations', + 'UCP_AUTH_LINK_UNLINK' => 'Unlink', + 'UCP_COPPA_BEFORE' => 'Before %s', + 'UCP_COPPA_ON_AFTER' => 'On or after %s', + 'UCP_EMAIL_ACTIVATE' => 'Please note that you will need to enter a valid email address before your account is activated. You will receive an email at the address you provide that contains an account activation link.', + 'UCP_JABBER' => 'Jabber address', + 'UCP_LOGIN_LINK' => 'Set up an external account association', + + 'UCP_MAIN' => 'Overview', + 'UCP_MAIN_ATTACHMENTS' => 'Manage attachments', + 'UCP_MAIN_BOOKMARKS' => 'Manage bookmarks', + 'UCP_MAIN_DRAFTS' => 'Manage drafts', + 'UCP_MAIN_FRONT' => 'Front page', + 'UCP_MAIN_SUBSCRIBED' => 'Manage subscriptions', + + 'UCP_NO_ATTACHMENTS' => 'You have posted no files.', + + 'UCP_NOTIFICATION_LIST' => 'Manage notifications', + 'UCP_NOTIFICATION_LIST_EXPLAIN' => 'Here you may view all past notifications.', + 'UCP_NOTIFICATION_OPTIONS' => 'Edit notification options', + 'UCP_NOTIFICATION_OPTIONS_EXPLAIN' => 'Here you can set your preferred notification methods for the board.', + + 'UCP_PREFS' => 'Board preferences', + 'UCP_PREFS_PERSONAL' => 'Edit global settings', + 'UCP_PREFS_POST' => 'Edit posting defaults', + 'UCP_PREFS_VIEW' => 'Edit display options', + + 'UCP_PM' => 'Private messages', + 'UCP_PM_COMPOSE' => 'Compose message', + 'UCP_PM_DRAFTS' => 'Manage PM drafts', + 'UCP_PM_OPTIONS' => 'Rules, folders & settings', + 'UCP_PM_UNREAD' => 'Unread messages', + 'UCP_PM_VIEW' => 'View messages', + + 'UCP_PROFILE' => 'Profile', + 'UCP_PROFILE_AVATAR' => 'Edit avatar', + 'UCP_PROFILE_PROFILE_INFO' => 'Edit profile', + 'UCP_PROFILE_REG_DETAILS' => 'Edit account settings', + 'UCP_PROFILE_SIGNATURE' => 'Edit signature', + 'UCP_PROFILE_AUTOLOGIN_KEYS'=> 'Manage “Remember Me†login keys', + + 'UCP_USERGROUPS' => 'Usergroups', + 'UCP_USERGROUPS_MEMBER' => 'Edit memberships', + 'UCP_USERGROUPS_MANAGE' => 'Manage groups', + + 'UCP_PASSWORD_RESET_DISABLED' => 'The password reset functionality has been disabled. If you need help accessing your account, please contact the %sBoard Administrator%s', + 'UCP_REGISTER_DISABLE' => 'Creating a new account is currently not possible.', + 'UCP_REMIND' => 'Send password', + 'UCP_RESEND' => 'Send activation email', + 'UCP_WELCOME' => 'Welcome to the User Control Panel. From here you can monitor, view and update your profile, preferences, subscribed forums and topics. You can also send messages to other users (if permitted). Please ensure you read any announcements before continuing.', + 'UCP_ZEBRA' => 'Friends & Foes', + 'UCP_ZEBRA_FOES' => 'Manage foes', + 'UCP_ZEBRA_FRIENDS' => 'Manage friends', + 'UNDISCLOSED_RECIPIENT' => 'Undisclosed Recipient', + 'UNKNOWN_FOLDER' => 'Unknown folder', + 'UNWATCH_MARKED' => 'Unwatch marked', + 'UPLOAD_AVATAR_FILE' => 'Upload from your machine', + 'UPLOAD_AVATAR_URL' => 'Upload from a URL', + 'UPLOAD_AVATAR_URL_EXPLAIN' => 'Enter the URL of the location containing the image. The image will be copied to this site.', + 'USERNAME_ALPHA_ONLY_EXPLAIN' => 'Username must be between %1$s and %2$s long and use only alphanumeric characters.', + 'USERNAME_ALPHA_SPACERS_EXPLAIN'=> 'Username must be between %1$s and %2$s long and use alphanumeric, space or -+_[] characters.', + 'USERNAME_ASCII_EXPLAIN' => 'Username must be between %1$s and %2$s long and use only ASCII characters, so no special symbols.', + 'USERNAME_LETTER_NUM_EXPLAIN' => 'Username must be between %1$s and %2$s long and use only letter or number characters.', + 'USERNAME_LETTER_NUM_SPACERS_EXPLAIN'=> 'Username must be between %1$s and %2$s long and use letter, number, space or -+_[] characters.', + 'USERNAME_CHARS_ANY_EXPLAIN' => 'Length must be between %1$s and %2$s.', + 'USERNAME_TAKEN_USERNAME' => 'The username you entered is already in use, please select an alternative.', + 'USERNAME_DISALLOWED_USERNAME' => 'The username you entered has been disallowed or contains a disallowed word. Please choose a different name.', + 'USER_NOT_FOUND_OR_INACTIVE' => 'The usernames you specified could either not be found or are not activated users.', + + 'VIEW_AVATARS' => 'Display avatars', + 'VIEW_EDIT' => 'View/Edit', + 'VIEW_FLASH' => 'Display Flash animations', + 'VIEW_IMAGES' => 'Display images within posts', + 'VIEW_NEXT_HISTORY' => 'Next PM in history', + 'VIEW_NEXT_PM' => 'Next PM', + 'VIEW_PM' => 'View message', + 'VIEW_PM_INFO' => 'Message details', + 'VIEW_PM_MESSAGES' => array( + 1 => '%d message', + 2 => '%d messages', + ), + 'VIEW_PREVIOUS_HISTORY' => 'Previous PM in history', + 'VIEW_PREVIOUS_PM' => 'Previous PM', + 'VIEW_PROFILE' => 'View profile', + 'VIEW_SIGS' => 'Display signatures', + 'VIEW_SMILIES' => 'Display smilies as images', + 'VIEW_TOPICS_DAYS' => 'Display topics from previous days', + 'VIEW_TOPICS_DIR' => 'Display topic order direction', + 'VIEW_TOPICS_KEY' => 'Display topics ordering by', + 'VIEW_POSTS_DAYS' => 'Display posts from previous days', + 'VIEW_POSTS_DIR' => 'Display post order direction', + 'VIEW_POSTS_KEY' => 'Display posts ordering by', + + 'WATCHED_EXPLAIN' => 'Below is a list of forums and topics you are subscribed to. You will be notified of new posts in either. To unsubscribe mark the forum or topic and then press the Unwatch marked button.', + 'WATCHED_FORUMS' => 'Watched forums', + 'WATCHED_TOPICS' => 'Watched topics', + 'WRONG_ACTIVATION' => 'The activation key you supplied does not match any in the database.', + + 'YOUR_DETAILS' => 'Your activity', + 'YOUR_FOES' => 'Your foes', + 'YOUR_FOES_EXPLAIN' => 'To remove usernames select them and click submit.', + 'YOUR_FRIENDS' => 'Your friends', + 'YOUR_FRIENDS_EXPLAIN' => 'To remove usernames select them and click submit.', + 'YOUR_WARNINGS' => 'Your warning level', + + 'PM_ACTION' => array( + 'PLACE_INTO_FOLDER' => 'Place into folder', + 'MARK_AS_READ' => 'Mark as read', + 'MARK_AS_IMPORTANT' => 'Mark message', + 'DELETE_MESSAGE' => 'Delete message', + ), + 'PM_CHECK' => array( + 'SUBJECT' => 'Subject', + 'SENDER' => 'Sender', + 'MESSAGE' => 'Message', + 'STATUS' => 'Message status', + 'TO' => 'Sent To', + ), + 'PM_RULE' => array( + 'IS_LIKE' => 'is like', + 'IS_NOT_LIKE' => 'is not like', + 'IS' => 'is', + 'IS_NOT' => 'is not', + 'BEGINS_WITH' => 'begins with', + 'ENDS_WITH' => 'ends with', + 'IS_FRIEND' => 'is friend', + 'IS_FOE' => 'is foe', + 'IS_USER' => 'is user', + 'IS_GROUP' => 'is in usergroup', + 'ANSWERED' => 'answered', + 'FORWARDED' => 'forwarded', + 'TO_GROUP' => 'to my default usergroup', + 'TO_ME' => 'to me', + ), + + 'GROUPS_EXPLAIN' => 'Usergroups enable board admins to better administer users. By default you will be placed in a specific group, this is your default group. This group defines how you may appear to other users, for example your username colouration, avatar, rank, etc. Depending on whether the administrator allows it you may be allowed to change your default group. You may also be placed in or allowed to join other groups. Some groups may give you additional permissions to view content or increase your capabilities in other areas.', + 'GROUP_LEADER' => 'Leaderships', + 'GROUP_MEMBER' => 'Memberships', + 'GROUP_PENDING' => 'Pending memberships', + 'GROUP_NONMEMBER' => 'Non-memberships', + 'GROUP_DETAILS' => 'Group details', + + 'NO_LEADER' => 'No group leaderships', + 'NO_MEMBER' => 'No group memberships', + 'NO_PENDING' => 'No pending memberships', + 'NO_NONMEMBER' => 'No non-member groups', +)); diff --git a/sources/phpBB/language/en/viewforum.php b/sources/phpBB/language/en/viewforum.php new file mode 100644 index 0000000..9946a3e --- /dev/null +++ b/sources/phpBB/language/en/viewforum.php @@ -0,0 +1,72 @@ + +* @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 + +$lang = array_merge($lang, array( + 'ACTIVE_TOPICS' => 'Active topics', + 'ANNOUNCEMENTS' => 'Announcements', + + 'FORUM_PERMISSIONS' => 'Forum permissions', + + 'ICON_ANNOUNCEMENT' => 'Announcement', + 'ICON_STICKY' => 'Sticky', + + 'LOGIN_NOTIFY_FORUM' => 'You have been notified about this forum, please login to view it.', + + 'MARK_TOPICS_READ' => 'Mark topics read', + + 'NEW_POSTS_HOT' => 'New posts [ Popular ]', // Not used anymore + 'NEW_POSTS_LOCKED' => 'New posts [ Locked ]', // Not used anymore + 'NO_NEW_POSTS_HOT' => 'No new posts [ Popular ]', // Not used anymore + 'NO_NEW_POSTS_LOCKED' => 'No new posts [ Locked ]', // Not used anymore + 'NO_READ_ACCESS' => 'You do not have the required permissions to read topics within this forum.', + 'NO_UNREAD_POSTS_HOT' => 'No unread posts [ Popular ]', + 'NO_UNREAD_POSTS_LOCKED' => 'No unread posts [ Locked ]', + + 'POST_FORUM_LOCKED' => 'Forum is locked', + + 'TOPICS_MARKED' => 'The topics for this forum have now been marked read.', + + 'UNREAD_POSTS_HOT' => 'Unread posts [ Popular ]', + 'UNREAD_POSTS_LOCKED' => 'Unread posts [ Locked ]', + + 'VIEW_FORUM' => 'View forum', + 'VIEW_FORUM_TOPICS' => array( + 1 => '%d topic', + 2 => '%d topics', + ), +)); diff --git a/sources/phpBB/language/en/viewtopic.php b/sources/phpBB/language/en/viewtopic.php new file mode 100644 index 0000000..5890eec --- /dev/null +++ b/sources/phpBB/language/en/viewtopic.php @@ -0,0 +1,126 @@ + +* @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 + +$lang = array_merge($lang, array( + 'APPROVE' => 'Approve', + 'ATTACHMENT' => 'Attachment', + 'ATTACHMENT_FUNCTIONALITY_DISABLED' => 'The attachments feature has been disabled.', + + 'BOOKMARK_ADDED' => 'Bookmarked topic successfully.', + 'BOOKMARK_ERR' => 'Bookmarking the topic failed. Please try again.', + 'BOOKMARK_REMOVED' => 'Removed bookmarked topic successfully.', + 'BOOKMARK_TOPIC' => 'Bookmark topic', + 'BOOKMARK_TOPIC_REMOVE' => 'Remove from bookmarks', + 'BUMPED_BY' => 'Last bumped by %1$s on %2$s.', + 'BUMP_TOPIC' => 'Bump topic', + + 'CODE' => 'Code', + + 'DELETE_TOPIC' => 'Delete topic', + 'DELETED_INFORMATION' => 'Deleted by %1$s on %2$s', + 'DISAPPROVE' => 'Disapprove', + 'DOWNLOAD_NOTICE' => 'You do not have the required permissions to view the files attached to this post.', + + 'EDITED_TIMES_TOTAL' => array( + 1 => 'Last edited by %2$s on %3$s, edited %1$d time in total.', + 2 => 'Last edited by %2$s on %3$s, edited %1$d times in total.', + ), + 'EMAIL_TOPIC' => 'Email topic', + 'ERROR_NO_ATTACHMENT' => 'The selected attachment does not exist anymore.', + + 'FILE_NOT_FOUND_404' => 'The file %s does not exist.', + 'FORK_TOPIC' => 'Copy topic', + 'FULL_EDITOR' => 'Full Editor & Preview', + + 'LINKAGE_FORBIDDEN' => 'You are not authorised to view, download or link from/to this site.', + 'LOGIN_NOTIFY_TOPIC' => 'You have been notified about this topic, please login to view it.', + 'LOGIN_VIEWTOPIC' => 'The board requires you to be registered and logged in to view this topic.', + + 'MAKE_ANNOUNCE' => 'Change to “Announcementâ€', + 'MAKE_GLOBAL' => 'Change to “Globalâ€', + 'MAKE_NORMAL' => 'Change to “Standard Topicâ€', + 'MAKE_STICKY' => 'Change to “Stickyâ€', + 'MAX_OPTIONS_SELECT' => array( + 1 => 'You may select %d option', + 2 => 'You may select up to %d options', + ), + 'MISSING_INLINE_ATTACHMENT' => 'The attachment %s is no longer available', + 'MOVE_TOPIC' => 'Move topic', + + 'NO_ATTACHMENT_SELECTED'=> 'You haven’t selected an attachment to download or view.', + 'NO_NEWER_TOPICS' => 'There are no newer topics in this forum.', + 'NO_OLDER_TOPICS' => 'There are no older topics in this forum.', + 'NO_UNREAD_POSTS' => 'There are no new unread posts for this topic.', + 'NO_VOTE_OPTION' => 'You must specify an option when voting.', + 'NO_VOTES' => 'No votes', + + 'POLL_ENDED_AT' => 'Poll ended at %s', + 'POLL_RUN_TILL' => 'Poll runs till %s', + 'POLL_VOTED_OPTION' => 'You voted for this option', + 'POST_DELETED_RESTORE' => 'This post has been deleted. It can be restored.', + 'PRINT_TOPIC' => 'Print view', + + 'QUICK_MOD' => 'Quick-mod tools', + 'QUICKREPLY' => 'Quick Reply', + 'QUOTE' => 'Quote', + + 'REPLY_TO_TOPIC' => 'Reply to topic', + 'RESTORE' => 'Restore', + 'RESTORE_TOPIC' => 'Restore topic', + 'RETURN_POST' => '%sReturn to the post%s', + + 'SUBMIT_VOTE' => 'Submit vote', + + 'TOPIC_TOOLS' => 'Topic tools', + 'TOTAL_VOTES' => 'Total votes', + + 'UNLOCK_TOPIC' => 'Unlock topic', + + 'VIEW_INFO' => 'Post details', + 'VIEW_NEXT_TOPIC' => 'Next topic', + 'VIEW_PREVIOUS_TOPIC' => 'Previous topic', + 'VIEW_RESULTS' => 'View results', + 'VIEW_TOPIC_POSTS' => array( + 1 => '%d post', + 2 => '%d posts', + ), + 'VIEW_UNREAD_POST' => 'First unread post', + 'VOTE_SUBMITTED' => 'Your vote has been cast.', + 'VOTE_CONVERTED' => 'Changing votes is not supported for converted polls.', + +)); diff --git a/sources/phpBB/language/index.htm b/sources/phpBB/language/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/language/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/mcp.php b/sources/phpBB/mcp.php new file mode 100644 index 0000000..f9d46db --- /dev/null +++ b/sources/phpBB/mcp.php @@ -0,0 +1,324 @@ + +* @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); +$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_admin.' . $phpEx); +include($phpbb_root_path . 'includes/functions_mcp.' . $phpEx); +require($phpbb_root_path . 'includes/functions_module.' . $phpEx); + +// Start session management +$user->session_begin(); +$auth->acl($user->data); +$user->setup('mcp'); + +$module = new p_master(); + +// Setting a variable to let the style designer know where he is... +$template->assign_var('S_IN_MCP', true); + +// Basic parameter data +$id = request_var('i', ''); + +$mode = request_var('mode', array('')); +$mode = sizeof($mode) ? array_shift($mode) : request_var('mode', ''); + +// Only Moderators can go beyond this point +if (!$user->data['is_registered']) +{ + if ($user->data['is_bot']) + { + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); + } + + login_box('', $user->lang['LOGIN_EXPLAIN_MCP']); +} + +$quickmod = (isset($_REQUEST['quickmod'])) ? true : false; +$action = request_var('action', ''); +$action_ary = request_var('action', array('' => 0)); + +$forum_action = request_var('forum_action', ''); +if ($forum_action !== '' && $request->variable('sort', false, false, \phpbb\request\request_interface::POST)) +{ + $action = $forum_action; +} + +if (sizeof($action_ary)) +{ + list($action, ) = each($action_ary); +} +unset($action_ary); + +if ($mode == 'topic_logs') +{ + $id = '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)); + +if ($post_id) +{ + // We determine the topic and forum id here, to make sure the moderator really has moderative rights on this post + $sql = 'SELECT topic_id, forum_id + FROM ' . POSTS_TABLE . " + WHERE post_id = $post_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $topic_id = (int) $row['topic_id']; + $forum_id = (int) $row['forum_id']; +} +else if ($topic_id) +{ + $sql = 'SELECT forum_id + FROM ' . TOPICS_TABLE . " + WHERE topic_id = $topic_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $forum_id = (int) $row['forum_id']; +} + +// If the user doesn't have any moderator powers (globally or locally) he can't access the mcp +if (!$auth->acl_getf_global('m_')) +{ + // Except he is using one of the quickmod tools for users + $user_quickmod_actions = array( + 'lock' => 'f_user_lock', + 'make_sticky' => 'f_sticky', + 'make_announce' => 'f_announce', + 'make_global' => 'f_announce', + 'make_normal' => array('f_announce', 'f_sticky') + ); + + $allow_user = false; + if ($quickmod && isset($user_quickmod_actions[$action]) && $user->data['is_registered'] && $auth->acl_gets($user_quickmod_actions[$action], $forum_id)) + { + $topic_info = phpbb_get_topic_data(array($topic_id)); + if ($topic_info[$topic_id]['topic_poster'] == $user->data['user_id']) + { + $allow_user = true; + } + } + + if (!$allow_user) + { + trigger_error('NOT_AUTHORISED'); + } +} + +// if the user cannot read the forum he tries to access then we won't allow mcp access either +if ($forum_id && !$auth->acl_get('f_read', $forum_id)) +{ + trigger_error('NOT_AUTHORISED'); +} + +/** +* Allow applying additional permissions to MCP access besides f_read +* +* @event core.mcp_global_f_read_auth_after +* @var string action The action the user tried to execute +* @var int forum_id The forum the user tried to access +* @var string mode The MCP module the user is trying to access +* @var p_master module Module system class +* @var bool quickmod True if the user is accessing using quickmod tools +* @var int topic_id The topic the user tried to access +* @since 3.1.3-RC1 +*/ +$vars = array( + 'action', + 'forum_id', + 'mode', + 'module', + 'quickmod', + 'topic_id', +); +extract($phpbb_dispatcher->trigger_event('core.mcp_global_f_read_auth_after', compact($vars))); + +if ($forum_id) +{ + $module->acl_forum_id = $forum_id; +} + +// Instantiate module system and generate list of available modules +$module->list_modules('mcp'); + +if ($quickmod) +{ + $mode = 'quickmod'; + + switch ($action) + { + case 'lock': + case 'unlock': + case 'lock_post': + case 'unlock_post': + case 'make_sticky': + case 'make_announce': + case 'make_global': + case 'make_normal': + case 'fork': + case 'move': + case 'delete_post': + case 'delete_topic': + case 'restore_topic': + $module->load('mcp', 'main', 'quickmod'); + return; + break; + + case 'topic_logs': + // Reset start parameter if we jumped from the quickmod dropdown + if (request_var('start', 0)) + { + $request->overwrite('start', 0); + } + + $module->set_active('logs', 'topic_logs'); + break; + + case 'merge_topic': + $module->set_active('main', 'forum_view'); + break; + + case 'split': + case 'merge': + $module->set_active('main', 'topic_view'); + break; + + default: + // If needed, the flag can be set to true within event listener + // to indicate that the action was handled properly + // and to pass by the trigger_error() call below + $is_valid_action = false; + + /** + * This event allows you to add custom quickmod options + * + * @event core.modify_quickmod_options + * @var object module Instance of module system class + * @var string action Quickmod option + * @var bool is_valid_action Flag indicating if the action was handled properly + * @since 3.1.0-a4 + */ + $vars = array('module', 'action', 'is_valid_action'); + extract($phpbb_dispatcher->trigger_event('core.modify_quickmod_options', compact($vars))); + + if (!$is_valid_action) + { + trigger_error($user->lang('QUICKMOD_ACTION_NOT_ALLOWED', $action), E_USER_ERROR); + } + break; + } +} +else +{ + // Select the active module + $module->set_active($id, $mode); +} + +// Hide some of the options if we don't have the relevant information to use them +if (!$post_id) +{ + $module->set_display('main', 'post_details', false); + $module->set_display('warn', 'warn_post', false); +} + +if ($mode == '' || $mode == 'unapproved_topics' || $mode == 'unapproved_posts' || $mode == 'deleted_topics' || $mode == 'deleted_posts') +{ + $module->set_display('queue', 'approve_details', false); +} + +if ($mode == '' || $mode == 'reports' || $mode == 'reports_closed' || $mode == 'pm_reports' || $mode == 'pm_reports_closed' || $mode == 'pm_report_details') +{ + $module->set_display('reports', 'report_details', false); +} + +if ($mode == '' || $mode == 'reports' || $mode == 'reports_closed' || $mode == 'pm_reports' || $mode == 'pm_reports_closed' || $mode == 'report_details') +{ + $module->set_display('pm_reports', 'pm_report_details', false); +} + +if (!$topic_id) +{ + $module->set_display('main', 'topic_view', false); + $module->set_display('logs', 'topic_logs', false); +} + +if (!$forum_id) +{ + $module->set_display('main', 'forum_view', false); + $module->set_display('logs', 'forum_logs', false); +} + +if (!$user_id && $username == '') +{ + $module->set_display('notes', 'user_notes', false); + $module->set_display('warn', 'warn_user', false); +} + +/** +* This event allows you to set display option for custom MCP modules +* +* @event core.modify_mcp_modules_display_option +* @var p_master module Module system class +* @var string mode MCP mode +* @var int user_id User id +* @var int forum_id Forum id +* @var int topic_id Topic id +* @var int post_id Post id +* @var string username User name +* @var int id Parent module id +* @since 3.1.0-b2 +*/ +$vars = array( + 'module', + 'mode', + 'user_id', + 'forum_id', + 'topic_id', + 'post_id', + 'username', + 'id', +); +extract($phpbb_dispatcher->trigger_event('core.modify_mcp_modules_display_option', compact($vars))); + +// Load and execute the relevant module +$module->load_active(); + +// Assign data to the template engine for the list of modules +$module->assign_tpl_vars(append_sid("{$phpbb_root_path}mcp.$phpEx")); + +// Generate urls for letting the moderation control panel being accessed in different modes +$template->assign_vars(array( + 'U_MCP' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main'), + 'U_MCP_FORUM' => ($forum_id) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=forum_view&f=$forum_id") : '', + 'U_MCP_TOPIC' => ($forum_id && $topic_id) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=topic_view&t=$topic_id") : '', + 'U_MCP_POST' => ($forum_id && $topic_id && $post_id) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&t=$topic_id&p=$post_id") : '', +)); + +// Generate the page, do not display/query online list +$module->display($module->get_page_title()); diff --git a/sources/phpBB/memberlist.php b/sources/phpBB/memberlist.php new file mode 100644 index 0000000..e64dab6 --- /dev/null +++ b/sources/phpBB/memberlist.php @@ -0,0 +1,1532 @@ + +* @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); +$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); + +$mode = request_var('mode', ''); + +if ($mode === 'contactadmin') +{ + define('SKIP_CHECK_BAN', true); + define('SKIP_CHECK_DISABLED', true); +} + +// Start session management +$user->session_begin(); +$auth->acl($user->data); +$user->setup(array('memberlist', 'groups')); + +// Setting a variable to let the style designer know where he is... +$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); + +// Redirect when old mode is used +if ($mode == 'leaders') +{ + send_status_line(301, 'Moved Permanently'); + redirect(append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=team')); +} + +// Check our mode... +if (!in_array($mode, array('', 'group', 'viewprofile', 'email', 'contact', 'contactadmin', 'searchuser', 'team', 'livesearch'))) +{ + trigger_error('NO_MODE'); +} + +switch ($mode) +{ + case 'email': + case 'contactadmin': + break; + + case 'livesearch': + if (!$config['allow_live_searches']) + { + trigger_error('LIVE_SEARCHES_NOT_ALLOWED'); + } + // No break + + default: + // Can this user view profiles/memberlist? + if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) + { + if ($user->data['user_id'] != ANONYMOUS) + { + trigger_error('NO_VIEW_USERS'); + } + + login_box('', ((isset($user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)])) ? $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)] : $user->lang['LOGIN_EXPLAIN_MEMBERLIST'])); + } + break; +} + +$start = request_var('start', 0); +$submit = (isset($_POST['submit'])) ? true : false; + +$default_key = 'c'; +$sort_key = request_var('sk', $default_key); +$sort_dir = request_var('sd', 'a'); + +// What do you want to do today? ... oops, I think that line is taken ... +switch ($mode) +{ + case 'team': + // Display a listing of board admins, moderators + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + $page_title = $user->lang['THE_TEAM']; + $template_html = 'memberlist_team.html'; + + $sql = 'SELECT * + FROM ' . TEAMPAGE_TABLE . ' + ORDER BY teampage_position ASC'; + $result = $db->sql_query($sql, 3600); + $teampage_data = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + $sql_ary = array( + 'SELECT' => 'g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id, t.teampage_id', + + 'FROM' => array(GROUPS_TABLE => 'g'), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(TEAMPAGE_TABLE => 't'), + 'ON' => 't.group_id = g.group_id', + ), + array( + 'FROM' => array(USER_GROUP_TABLE => 'ug'), + 'ON' => 'ug.group_id = g.group_id AND ug.user_pending = 0 AND ug.user_id = ' . (int) $user->data['user_id'], + ), + ), + ); + + $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); + + $group_ids = $groups_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['group_type'] == GROUP_HIDDEN && !$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $user->data['user_id']) + { + $row['group_name'] = $user->lang['GROUP_UNDISCLOSED']; + $row['u_group'] = ''; + } + else + { + $row['group_name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']; + $row['u_group'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']); + } + + if ($row['teampage_id']) + { + // Only put groups into the array we want to display. + // We are fetching all groups, to ensure we got all data for default groups. + $group_ids[] = (int) $row['group_id']; + } + $groups_ary[(int) $row['group_id']] = $row; + } + $db->sql_freeresult($result); + + $sql_ary = array( + 'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id', + + 'FROM' => array( + USER_GROUP_TABLE => 'ug', + ), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(USERS_TABLE => 'u'), + 'ON' => 'ug.user_id = u.user_id AND ug.user_pending = 0', + ), + array( + 'FROM' => array(GROUPS_TABLE => 'g'), + 'ON' => 'ug.group_id = g.group_id', + ), + ), + + 'WHERE' => $db->sql_in_set('g.group_id', $group_ids, false, true), + + 'ORDER_BY' => 'u.username_clean ASC', + ); + + /** + * Modify the query used to get the users for the team page + * + * @event core.memberlist_team_modify_query + * @var array sql_ary Array containing the query + * @var array group_ids Array of group ids + * @var array teampage_data The teampage data + * @since 3.1.3-RC1 + */ + $vars = array( + 'sql_ary', + 'group_ids', + 'teampage_data', + ); + extract($phpbb_dispatcher->trigger_event('core.memberlist_team_modify_query', compact($vars))); + + $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); + + $user_ary = $user_ids = $group_users = array(); + while ($row = $db->sql_fetchrow($result)) + { + $row['forums'] = ''; + $row['forums_ary'] = array(); + $user_ary[(int) $row['user_id']] = $row; + $user_ids[] = (int) $row['user_id']; + $group_users[(int) $row['group_id']][] = (int) $row['user_id']; + } + $db->sql_freeresult($result); + + $user_ids = array_unique($user_ids); + + if (!empty($user_ids) && $config['teampage_forums']) + { + $template->assign_var('S_DISPLAY_MODERATOR_FORUMS', true); + // Get all moderators + $perm_ary = $auth->acl_get_list($user_ids, array('m_'), false); + + foreach ($perm_ary as $forum_id => $forum_ary) + { + foreach ($forum_ary as $auth_option => $id_ary) + { + foreach ($id_ary as $id) + { + if (!$forum_id) + { + $user_ary[$id]['forums'] = $user->lang['ALL_FORUMS']; + } + else + { + $user_ary[$id]['forums_ary'][] = $forum_id; + } + } + } + } + + $sql = 'SELECT forum_id, forum_name + FROM ' . FORUMS_TABLE; + $result = $db->sql_query($sql); + + $forums = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forums[$row['forum_id']] = $row['forum_name']; + } + $db->sql_freeresult($result); + + foreach ($user_ary as $user_id => $user_data) + { + if (!$user_data['forums']) + { + foreach ($user_data['forums_ary'] as $forum_id) + { + $user_ary[$user_id]['forums_options'] = true; + if (isset($forums[$forum_id])) + { + if ($auth->acl_get('f_list', $forum_id)) + { + $user_ary[$user_id]['forums'] .= ''; + } + } + } + } + } + } + + $parent_team = 0; + foreach ($teampage_data as $team_data) + { + // If this team entry has no group, it's a category + if (!$team_data['group_id']) + { + $template->assign_block_vars('group', array( + 'GROUP_NAME' => $team_data['teampage_name'], + )); + + $parent_team = (int) $team_data['teampage_id']; + continue; + } + + $group_data = $groups_ary[(int) $team_data['group_id']]; + $group_id = (int) $team_data['group_id']; + + if (!$team_data['teampage_parent']) + { + // If the group does not have a parent category, we display the groupname as category + $template->assign_block_vars('group', array( + 'GROUP_NAME' => $group_data['group_name'], + 'GROUP_COLOR' => $group_data['group_colour'], + 'U_GROUP' => $group_data['u_group'], + )); + } + + // Display group members. + if (!empty($group_users[$group_id])) + { + foreach ($group_users[$group_id] as $user_id) + { + if (isset($user_ary[$user_id])) + { + $row = $user_ary[$user_id]; + if ($config['teampage_memberships'] == 1 && ($group_id != $groups_ary[$row['default_group']]['group_id']) && $groups_ary[$row['default_group']]['teampage_id']) + { + // Display users in their primary group, instead of the first group, when it is displayed on the teampage. + continue; + } + + $user_rank_data = phpbb_get_user_rank($row, (($row['user_id'] == ANONYMOUS) ? false : $row['user_posts'])); + + $template_vars = array( + 'USER_ID' => $row['user_id'], + 'FORUMS' => $row['forums'], + 'FORUM_OPTIONS' => (isset($row['forums_options'])) ? true : false, + 'RANK_TITLE' => $user_rank_data['title'], + + 'GROUP_NAME' => $groups_ary[$row['default_group']]['group_name'], + 'GROUP_COLOR' => $groups_ary[$row['default_group']]['group_colour'], + 'U_GROUP' => $groups_ary[$row['default_group']]['u_group'], + + 'RANK_IMG' => $user_rank_data['img'], + 'RANK_IMG_SRC' => $user_rank_data['img_src'], + + 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $row['user_id']) : '', + + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), + 'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), + 'U_VIEW_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), + ); + + /** + * Modify the template vars for displaying the user in the groups on the teampage + * + * @event core.memberlist_team_modify_template_vars + * @var array template_vars Array containing the query + * @var array row Array containing the action user row + * @var array groups_ary Array of groups with all users that should be displayed + * @since 3.1.3-RC1 + */ + $vars = array( + 'template_vars', + 'row', + 'groups_ary', + ); + extract($phpbb_dispatcher->trigger_event('core.memberlist_team_modify_template_vars', compact($vars))); + + $template->assign_block_vars('group.user', $template_vars); + + if ($config['teampage_memberships'] != 2) + { + unset($user_ary[$user_id]); + } + } + } + } + } + + $template->assign_vars(array( + 'PM_IMG' => $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE'])) + ); + break; + + case 'contact': + + $page_title = $user->lang['IM_USER']; + $template_html = 'memberlist_im.html'; + + if (!$auth->acl_get('u_sendim')) + { + trigger_error('NOT_AUTHORISED'); + } + + $presence_img = ''; + switch ($action) + { + case 'jabber': + $lang = 'JABBER'; + $sql_field = 'user_jabber'; + $s_select = (@extension_loaded('xml') && $config['jab_enable']) ? 'S_SEND_JABBER' : 'S_NO_SEND_JABBER'; + $s_action = append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=$action&u=$user_id"); + break; + + default: + trigger_error('NO_MODE', E_USER_ERROR); + break; + } + + // Grab relevant data + $sql = "SELECT user_id, username, user_email, user_lang, $sql_field + FROM " . USERS_TABLE . " + WHERE user_id = $user_id + AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')'; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + trigger_error('NO_USER'); + } + else if (empty($row[$sql_field])) + { + trigger_error('IM_NO_DATA'); + } + + // Post data grab actions + switch ($action) + { + case 'jabber': + add_form_key('memberlist_messaging'); + + if ($submit && @extension_loaded('xml') && $config['jab_enable']) + { + if (check_form_key('memberlist_messaging')) + { + + 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)); + + if (empty($message)) + { + trigger_error('EMPTY_MESSAGE_IM'); + } + + $messenger = new messenger(false); + + $messenger->template('profile_send_im', $row['user_lang']); + $messenger->subject(htmlspecialchars_decode($subject)); + + $messenger->replyto($user->data['user_email']); + $messenger->set_addresses($row); + + $messenger->assign_vars(array( + 'BOARD_CONTACT' => phpbb_get_board_contact($config, $phpEx), + 'FROM_USERNAME' => htmlspecialchars_decode($user->data['username']), + 'TO_USERNAME' => htmlspecialchars_decode($row['username']), + 'MESSAGE' => htmlspecialchars_decode($message)) + ); + + $messenger->send(NOTIFY_IM); + + $s_select = 'S_SENT_JABBER'; + } + else + { + trigger_error('FORM_INVALID'); + } + } + break; + } + + // Send vars to the template + $template->assign_vars(array( + 'IM_CONTACT' => $row[$sql_field], + 'A_IM_CONTACT' => addslashes($row[$sql_field]), + + 'USERNAME' => $row['username'], + 'CONTACT_NAME' => $row[$sql_field], + 'SITENAME' => $config['sitename'], + + 'PRESENCE_IMG' => $presence_img, + + 'L_SEND_IM_EXPLAIN' => $user->lang['IM_' . $lang], + 'L_IM_SENT_JABBER' => sprintf($user->lang['IM_SENT_JABBER'], $row['username']), + + $s_select => true, + 'S_IM_ACTION' => $s_action) + ); + + break; + + case 'viewprofile': + // Display a profile + if ($user_id == ANONYMOUS && !$username) + { + trigger_error('NO_USER'); + } + + // Get user... + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE ' . (($username) ? "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'" : "user_id = $user_id"); + $result = $db->sql_query($sql); + $member = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$member) + { + trigger_error('NO_USER'); + } + + // a_user admins and founder are able to view inactive users and bots to be able to manage them more easily + // Normal users are able to see at least users having only changed their profile settings but not yet reactivated. + if (!$auth->acl_get('a_user') && $user->data['user_type'] != USER_FOUNDER) + { + if ($member['user_type'] == USER_IGNORE) + { + trigger_error('NO_USER'); + } + else if ($member['user_type'] == USER_INACTIVE && $member['user_inactive_reason'] != INACTIVE_PROFILE) + { + trigger_error('NO_USER'); + } + } + + $user_id = (int) $member['user_id']; + + // Get group memberships + // Also get visiting user's groups to determine hidden group memberships if necessary. + $auth_hidden_groups = ($user_id === (int) $user->data['user_id'] || $auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? true : false; + $sql_uid_ary = ($auth_hidden_groups) ? array($user_id) : array($user_id, (int) $user->data['user_id']); + + // Do the SQL thang + $sql = 'SELECT g.group_id, g.group_name, g.group_type, ug.user_id + FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug + WHERE ' . $db->sql_in_set('ug.user_id', $sql_uid_ary) . ' + AND g.group_id = ug.group_id + AND ug.user_pending = 0'; + $result = $db->sql_query($sql); + + // Divide data into profile data and current user data + $profile_groups = $user_groups = array(); + while ($row = $db->sql_fetchrow($result)) + { + $row['user_id'] = (int) $row['user_id']; + $row['group_id'] = (int) $row['group_id']; + + if ($row['user_id'] == $user_id) + { + $profile_groups[] = $row; + } + else + { + $user_groups[$row['group_id']] = $row['group_id']; + } + } + $db->sql_freeresult($result); + + // Filter out hidden groups and sort groups by name + $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']])) + { + // Skip over hidden groups the user cannot see + continue; + } + + $group_sort[$row['group_id']] = utf8_clean_string($row['group_name']); + $group_data[$row['group_id']] = $row; + } + unset($profile_groups); + unset($user_groups); + asort($group_sort); + + $group_options = ''; + foreach ($group_sort as $group_id => $null) + { + $row = $group_data[$group_id]; + + $group_options .= ''; + } + unset($group_data); + unset($group_sort); + + // What colour is the zebra + $sql = 'SELECT friend, foe + FROM ' . ZEBRA_TABLE . " + WHERE zebra_id = $user_id + AND user_id = {$user->data['user_id']}"; + + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $foe = ($row['foe']) ? true : false; + $friend = ($row['friend']) ? true : false; + $db->sql_freeresult($result); + + if ($config['load_onlinetrack']) + { + $sql = 'SELECT MAX(session_time) AS session_time, MIN(session_viewonline) AS session_viewonline + FROM ' . SESSIONS_TABLE . " + WHERE session_user_id = $user_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $member['session_time'] = (isset($row['session_time'])) ? $row['session_time'] : 0; + $member['session_viewonline'] = (isset($row['session_viewonline'])) ? $row['session_viewonline'] : 0; + unset($row); + } + + if ($config['load_user_activity']) + { + display_user_activity($member); + } + + // Do the relevant calculations + $memberdays = max(1, round((time() - $member['user_regdate']) / 86400)); + $posts_per_day = $member['user_posts'] / $memberdays; + $percentage = ($config['num_posts']) ? min(100, ($member['user_posts'] / $config['num_posts']) * 100) : 0; + + + if ($member['user_sig']) + { + $parse_flags = ($member['user_sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; + $member['user_sig'] = generate_text_for_display($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield'], $parse_flags, true); + } + + // We need to check if the modules 'zebra' ('friends' & 'foes' mode), 'notes' ('user_notes' mode) and 'warn' ('warn_user' mode) are accessible to decide if we can display appropriate links + $zebra_enabled = $friends_enabled = $foes_enabled = $user_notes_enabled = $warn_user_enabled = false; + + // Only check if the user is logged in + if ($user->data['is_registered']) + { + if (!class_exists('p_master')) + { + include($phpbb_root_path . 'includes/functions_module.' . $phpEx); + } + $module = new p_master(); + + $module->list_modules('ucp'); + $module->list_modules('mcp'); + + $user_notes_enabled = ($module->loaded('mcp_notes', 'user_notes')) ? true : false; + $warn_user_enabled = ($module->loaded('mcp_warn', 'warn_user')) ? true : false; + $zebra_enabled = ($module->loaded('ucp_zebra')) ? true : false; + $friends_enabled = ($module->loaded('ucp_zebra', 'friends')) ? true : false; + $foes_enabled = ($module->loaded('ucp_zebra', 'foes')) ? true : false; + + unset($module); + } + + // Custom Profile Fields + $profile_fields = array(); + if ($config['load_cpf_viewprofile']) + { + $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(); + } + + /** + * Modify user data before we display the profile + * + * @event core.memberlist_view_profile + * @var array member Array with user's data + * @var bool user_notes_enabled Is the mcp user notes module enabled? + * @var bool warn_user_enabled Is the mcp warnings module enabled? + * @var bool zebra_enabled Is the ucp zebra module enabled? + * @var bool friends_enabled Is the ucp friends module enabled? + * @var bool foes_enabled Is the ucp foes module enabled? + * @var bool friend Is the user friend? + * @var bool foe Is the user foe? + * @var array profile_fields Array with user's profile field data + * @since 3.1.0-a1 + * @changed 3.1.0-b2 Added friend and foe status + * @changed 3.1.0-b3 Added profile fields data + */ + $vars = array( + 'member', + 'user_notes_enabled', + 'warn_user_enabled', + 'zebra_enabled', + 'friends_enabled', + 'foes_enabled', + 'friend', + 'foe', + 'profile_fields', + ); + extract($phpbb_dispatcher->trigger_event('core.memberlist_view_profile', compact($vars))); + + $template->assign_vars(phpbb_show_profile($member, $user_notes_enabled, $warn_user_enabled)); + + // If the user has m_approve permission or a_user permission, then list then display unapproved posts + if ($auth->acl_getf_global('m_approve') || $auth->acl_get('a_user')) + { + $sql = 'SELECT COUNT(post_id) as posts_in_queue + FROM ' . POSTS_TABLE . ' + WHERE poster_id = ' . $user_id . ' + AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)); + $result = $db->sql_query($sql); + $member['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue'); + $db->sql_freeresult($result); + } + else + { + $member['posts_in_queue'] = 0; + } + + $template->assign_vars(array( + 'L_POSTS_IN_QUEUE' => $user->lang('NUM_POSTS_IN_QUEUE', $member['posts_in_queue']), + + 'POSTS_DAY' => $user->lang('POST_DAY', $posts_per_day), + 'POSTS_PCT' => $user->lang('POST_PCT', $percentage), + + 'SIGNATURE' => $member['user_sig'], + 'POSTS_IN_QUEUE'=> $member['posts_in_queue'], + + 'PM_IMG' => $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE']), + 'L_SEND_EMAIL_USER' => $user->lang('SEND_EMAIL_USER', $member['username']), + 'EMAIL_IMG' => $user->img('icon_contact_email', $user->lang['EMAIL']), + 'JABBER_IMG' => $user->img('icon_contact_jabber', $user->lang['JABBER']), + 'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']), + + 'S_PROFILE_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group'), + 'S_GROUP_OPTIONS' => $group_options, + 'S_CUSTOM_FIELDS' => (isset($profile_fields['row']) && sizeof($profile_fields['row'])) ? true : false, + + 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview&u=' . $user_id, true, $user->session_id) : '', + 'U_USER_BAN' => ($auth->acl_get('m_ban') && $user_id != $user->data['user_id']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=ban&mode=user&u=' . $user_id, true, $user->session_id) : '', + 'U_MCP_QUEUE' => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '', + + 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_id}&hash=" . generate_link_hash('switchperm')) : '', + 'U_EDIT_SELF' => ($user_id == $user->data['user_id'] && $auth->acl_get('u_chgprofileinfo')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_profile&mode=profile_info') : '', + + 'S_USER_NOTES' => ($user_notes_enabled) ? true : false, + 'S_WARN_USER' => ($warn_user_enabled) ? true : false, + 'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false, + 'U_ADD_FRIEND' => (!$friend && !$foe && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '', + 'U_ADD_FOE' => (!$friend && !$foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&mode=foes&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '', + 'U_REMOVE_FRIEND' => ($friend && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&usernames[]=' . $user_id) : '', + 'U_REMOVE_FOE' => ($foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&mode=foes&usernames[]=' . $user_id) : '', + + 'U_CANONICAL' => generate_board_url() . '/' . append_sid("memberlist.$phpEx", 'mode=viewprofile&u=' . $user_id, true, ''), + )); + + if (!empty($profile_fields['row'])) + { + $template->assign_vars($profile_fields['row']); + } + + if (!empty($profile_fields['blockrow'])) + { + foreach ($profile_fields['blockrow'] as $field_data) + { + $template->assign_block_vars('custom_fields', $field_data); + } + } + + // Inactive reason/account? + if ($member['user_type'] == USER_INACTIVE) + { + $user->add_lang('acp/common'); + + $inactive_reason = $user->lang['INACTIVE_REASON_UNKNOWN']; + + switch ($member['user_inactive_reason']) + { + case INACTIVE_REGISTER: + $inactive_reason = $user->lang['INACTIVE_REASON_REGISTER']; + break; + + case INACTIVE_PROFILE: + $inactive_reason = $user->lang['INACTIVE_REASON_PROFILE']; + break; + + case INACTIVE_MANUAL: + $inactive_reason = $user->lang['INACTIVE_REASON_MANUAL']; + break; + + case INACTIVE_REMIND: + $inactive_reason = $user->lang['INACTIVE_REASON_REMIND']; + break; + } + + $template->assign_vars(array( + 'S_USER_INACTIVE' => true, + 'USER_INACTIVE_REASON' => $inactive_reason) + ); + } + + // Now generate page title + $page_title = sprintf($user->lang['VIEWING_PROFILE'], $member['username']); + $template_html = 'memberlist_view.html'; + + break; + + case 'contactadmin': + case 'email': + if (!class_exists('messenger')) + { + include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + } + + $user_id = request_var('u', 0); + $topic_id = request_var('t', 0); + + if ($user_id) + { + $form_name = 'user'; + } + else if ($topic_id) + { + $form_name = 'topic'; + } + else if ($mode === 'contactadmin') + { + $form_name = 'admin'; + } + else + { + trigger_error('NO_EMAIL'); + } + $form = $phpbb_container->get('message.form.' . $form_name); + + $form->bind($request); + $error = $form->check_allow(); + if ($error) + { + trigger_error($error); + } + + if ($request->is_set_post('submit')) + { + $messenger = new messenger(false); + $form->submit($messenger); + } + + $page_title = $form->get_page_title(); + $template_html = $form->get_template_file(); + $form->render($template); + + break; + + case 'livesearch': + + $username_chars = $request->variable('username', '', true); + + $sql = 'SELECT username, user_id, user_colour + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_type', array(USER_NORMAL, USER_FOUNDER)) . ' + AND username_clean ' . $db->sql_like_expression(utf8_clean_string($username_chars) . $db->get_any_char()); + $result = $db->sql_query_limit($sql, 10); + $user_list = array(); + + while ($row = $db->sql_fetchrow($result)) + { + $user_list[] = array( + 'user_id' => (int) $row['user_id'], + 'result' => $row['username'], + 'username_full' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'display' => get_username_string('no_profile', $row['user_id'], $row['username'], $row['user_colour']), + ); + } + $db->sql_freeresult($result); + $json_response = new \phpbb\json_response(); + $json_response->send(array( + 'keyword' => $username_chars, + 'results' => $user_list, + )); + + break; + + case 'group': + default: + // The basic memberlist + $page_title = $user->lang['MEMBERLIST']; + $template_html = 'memberlist_body.html'; + $pagination = $phpbb_container->get('pagination'); + + // Sorting + $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT']); + $sort_key_sql = array('a' => 'u.username_clean', 'c' => 'u.user_regdate', 'd' => 'u.user_posts'); + + if ($config['jab_enable']) + { + $sort_key_text['k'] = $user->lang['JABBER']; + $sort_key_sql['k'] = 'u.user_jabber'; + } + + if ($auth->acl_get('a_user')) + { + $sort_key_text['e'] = $user->lang['SORT_EMAIL']; + $sort_key_sql['e'] = 'u.user_email'; + } + + if ($auth->acl_get('u_viewonline')) + { + $sort_key_text['l'] = $user->lang['SORT_LAST_ACTIVE']; + $sort_key_sql['l'] = 'u.user_lastvisit'; + } + + $sort_key_text['m'] = $user->lang['SORT_RANK']; + $sort_key_sql['m'] = 'u.user_rank'; + + $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); + + $s_sort_key = ''; + foreach ($sort_key_text as $key => $value) + { + $selected = ($sort_key == $key) ? ' selected="selected"' : ''; + $s_sort_key .= ''; + } + + $s_sort_dir = ''; + foreach ($sort_dir_text as $key => $value) + { + $selected = ($sort_dir == $key) ? ' selected="selected"' : ''; + $s_sort_dir .= ''; + } + + // Additional sorting options for user search ... if search is enabled, if not + // then only admins can make use of this (for ACP functionality) + $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); + + // 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'); + + // We validate form and field here, only id/class allowed + $form = (!preg_match('/^[a-z0-9_-]+$/i', $form)) ? '' : $form; + $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); + + // 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 = explode('-', request_var('joined', '')); + $active = explode('-', request_var('active', '')); + $count = (request_var('count', '') !== '') ? request_var('count', 0) : ''; + $ipdomain = request_var('ip', ''); + + $find_key_match = array('lt' => '<', 'gt' => '>', 'eq' => '='); + + $find_count = array('lt' => $user->lang['LESS_THAN'], 'eq' => $user->lang['EQUAL_TO'], 'gt' => $user->lang['MORE_THAN']); + $s_find_count = ''; + foreach ($find_count as $key => $value) + { + $selected = ($count_select == $key) ? ' selected="selected"' : ''; + $s_find_count .= ''; + } + + $find_time = array('lt' => $user->lang['BEFORE'], 'gt' => $user->lang['AFTER']); + $s_find_join_time = ''; + foreach ($find_time as $key => $value) + { + $selected = ($joined_select == $key) ? ' selected="selected"' : ''; + $s_find_join_time .= ''; + } + + $s_find_active_time = ''; + foreach ($find_time as $key => $value) + { + $selected = ($active_select == $key) ? ' selected="selected"' : ''; + $s_find_active_time .= ''; + } + + $sql_where .= ($username) ? ' AND u.username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($username))) : ''; + $sql_where .= ($auth->acl_get('a_user') && $email) ? ' AND u.user_email ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), $email)) . ' ' : ''; + $sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), $jabber)) . ' ' : ''; + $sql_where .= (is_numeric($count) && isset($find_key_match[$count_select])) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : ''; + + if (isset($find_key_match[$joined_select]) && sizeof($joined) == 3) + { + $joined_time = gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]); + + if ($joined_time !== false) + { + $sql_where .= " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . $joined_time; + } + } + + if (isset($find_key_match[$active_select]) && sizeof($active) == 3 && $auth->acl_get('u_viewonline')) + { + $active_time = gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]); + + if ($active_time !== false) + { + $sql_where .= " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . $active_time; + } + } + + $sql_where .= ($search_group_id) ? " AND u.user_id = ug.user_id AND ug.group_id = $search_group_id AND ug.user_pending = 0 " : ''; + + if ($search_group_id) + { + $sql_from = ', ' . USER_GROUP_TABLE . ' ug '; + } + + if ($ipdomain && $auth->acl_getf_global('m_info')) + { + if (strspn($ipdomain, 'abcdefghijklmnopqrstuvwxyz')) + { + $hostnames = gethostbynamel($ipdomain); + + if ($hostnames !== false) + { + $ips = "'" . implode('\', \'', array_map(array($db, 'sql_escape'), preg_replace('#([0-9]{1,3}\.[0-9]{1,3}[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})#', "\\1", gethostbynamel($ipdomain)))) . "'"; + } + else + { + $ips = false; + } + } + else + { + $ips = "'" . str_replace('*', '%', $db->sql_escape($ipdomain)) . "'"; + } + + if ($ips === false) + { + // A minor fudge but it does the job :D + $sql_where .= " AND u.user_id = 0"; + } + else + { + $ip_forums = array_keys($auth->acl_getf('m_info', true)); + + $sql = 'SELECT DISTINCT poster_id + FROM ' . POSTS_TABLE . ' + WHERE poster_ip ' . ((strpos($ips, '%') !== false) ? 'LIKE' : 'IN') . " ($ips) + AND " . $db->sql_in_set('forum_id', $ip_forums); + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $ip_sql = array(); + do + { + $ip_sql[] = $row['poster_id']; + } + while ($row = $db->sql_fetchrow($result)); + + $sql_where .= ' AND ' . $db->sql_in_set('u.user_id', $ip_sql); + } + else + { + // A minor fudge but it does the job :D + $sql_where .= " AND u.user_id = 0"; + } + unset($ip_forums); + + $db->sql_freeresult($result); + } + } + } + + $first_char = request_var('first_char', ''); + + if ($first_char == 'other') + { + for ($i = 97; $i < 123; $i++) + { + $sql_where .= ' AND u.username_clean NOT ' . $db->sql_like_expression(chr($i) . $db->get_any_char()); + } + } + else if ($first_char) + { + $sql_where .= ' AND u.username_clean ' . $db->sql_like_expression(substr($first_char, 0, 1) . $db->get_any_char()); + } + + // Are we looking at a usergroup? If so, fetch additional info + // and further restrict the user info query + if ($mode == 'group') + { + // We JOIN here to save a query for determining membership for hidden groups. ;) + $sql = 'SELECT g.*, ug.user_id + FROM ' . GROUPS_TABLE . ' g + LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (ug.user_pending = 0 AND ug.user_id = ' . $user->data['user_id'] . " AND ug.group_id = $group_id) + WHERE g.group_id = $group_id"; + $result = $db->sql_query($sql); + $group_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$group_row) + { + trigger_error('NO_GROUP'); + } + + switch ($group_row['group_type']) + { + case GROUP_OPEN: + $group_row['l_group_type'] = 'OPEN'; + break; + + case GROUP_CLOSED: + $group_row['l_group_type'] = 'CLOSED'; + break; + + case GROUP_HIDDEN: + $group_row['l_group_type'] = 'HIDDEN'; + + // Check for membership or special permissions + if (!$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $group_row['user_id'] != $user->data['user_id']) + { + trigger_error('NO_GROUP'); + } + break; + + case GROUP_SPECIAL: + $group_row['l_group_type'] = 'SPECIAL'; + break; + + case GROUP_FREE: + $group_row['l_group_type'] = 'FREE'; + break; + } + + $avatar_img = phpbb_get_group_avatar($group_row); + + // ... same for group rank + $user_rank_data = array( + 'title' => null, + 'img' => null, + 'img_src' => null, + ); + if ($group_row['group_rank']) + { + $user_rank_data = phpbb_get_user_rank($group_row, false); + + if ($user_rank_data['img']) + { + $user_rank_data['img'] .= '
'; + } + } + + $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_COLOR' => $group_row['group_colour'], + 'GROUP_TYPE' => $user->lang['GROUP_IS_' . $group_row['l_group_type']], + 'GROUP_RANK' => $user_rank_data['title'], + + 'AVATAR_IMG' => $avatar_img, + 'RANK_IMG' => $user_rank_data['img'], + 'RANK_IMG_SRC' => $user_rank_data['img_src'], + + 'U_PM' => ($auth->acl_get('u_sendpm') && $auth->acl_get('u_masspm_group') && $group_row['group_receive_pm'] && $config['allow_privmsg'] && $config['allow_mass_pm']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&g=' . $group_id) : '',) + ); + + $sql_select = ', ug.group_leader'; + $sql_from = ', ' . USER_GROUP_TABLE . ' ug '; + $order_by = 'ug.group_leader DESC, '; + + $sql_where .= " AND ug.user_pending = 0 AND u.user_id = ug.user_id AND ug.group_id = $group_id"; + $sql_where_data = " AND u.user_id = ug.user_id AND ug.group_id = $group_id"; + } + + // Sorting and order + if (!isset($sort_key_sql[$sort_key])) + { + $sort_key = $default_key; + } + + $order_by .= $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); + + // Unfortunately we must do this here for sorting by rank, else the sort order is applied wrongly + if ($sort_key == 'm') + { + $order_by .= ', u.user_posts DESC'; + } + + // Count the users ... + if ($sql_where) + { + $sql = 'SELECT COUNT(u.user_id) AS total_users + FROM ' . USERS_TABLE . " u$sql_from + WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ") + $sql_where"; + $result = $db->sql_query($sql); + $total_users = (int) $db->sql_fetchfield('total_users'); + $db->sql_freeresult($result); + } + else + { + $total_users = $config['num_users']; + } + + // 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) + $check_params = array( + 'g' => array('g', 0), + 'sk' => array('sk', $default_key), + 'sd' => array('sd', 'a'), + 'form' => array('form', ''), + 'field' => array('field', ''), + 'select_single' => array('select_single', $select_single), + 'username' => array('username', '', true), + 'email' => array('email', ''), + 'jabber' => array('jabber', ''), + 'search_group_id' => array('search_group_id', 0), + 'joined_select' => array('joined_select', 'lt'), + 'active_select' => array('active_select', 'lt'), + 'count_select' => array('count_select', 'eq'), + 'joined' => array('joined', ''), + 'active' => array('active', ''), + 'count' => (request_var('count', '') !== '') ? array('count', 0) : array('count', ''), + 'ip' => array('ip', ''), + 'first_char' => array('first_char', ''), + ); + + $u_first_char_params = array(); + foreach ($check_params as $key => $call) + { + if (!isset($_REQUEST[$key])) + { + continue; + } + + $param = call_user_func_array('request_var', $call); + $param = urlencode($key) . '=' . ((is_string($param)) ? urlencode($param) : $param); + $params[] = $param; + + if ($key != 'first_char') + { + $u_first_char_params[] = $param; + } + if ($key != 'sk' && $key != 'sd') + { + $sort_params[] = $param; + } + } + + $u_hide_find_member = append_sid("{$phpbb_root_path}memberlist.$phpEx", "start=$start" . (!empty($params) ? '&' . implode('&', $params) : '')); + + if ($mode) + { + $params[] = "mode=$mode"; + $u_first_char_params[] = "mode=$mode"; + } + $sort_params[] = "mode=$mode"; + + $pagination_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", implode('&', $params)); + $sort_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", implode('&', $sort_params)); + + unset($search_params, $sort_params); + + $u_first_char_params = implode('&', $u_first_char_params); + $u_first_char_params .= ($u_first_char_params) ? '&' : ''; + + $first_characters = array(); + $first_characters[''] = $user->lang['ALL']; + for ($i = 97; $i < 123; $i++) + { + $first_characters[chr($i)] = chr($i - 32); + } + $first_characters['other'] = $user->lang['OTHER']; + + foreach ($first_characters as $char => $desc) + { + $template->assign_block_vars('first_char', array( + 'DESC' => $desc, + 'VALUE' => $char, + 'S_SELECTED' => ($first_char == $char) ? true : false, + 'U_SORT' => append_sid("{$phpbb_root_path}memberlist.$phpEx", $u_first_char_params . 'first_char=' . $char) . '#memberlist', + )); + } + + // Some search user specific data + if (($mode == '' || $mode == 'searchuser') && ($config['load_search'] || $auth->acl_get('a_'))) + { + $group_selected = request_var('search_group_id', 0); + $s_group_select = ''; + $group_ids = array(); + + /** + * @todo add this to a separate function (function is responsible for returning the groups the user is able to see based on the users group membership) + */ + + if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) + { + $sql = 'SELECT group_id, group_name, group_type + FROM ' . GROUPS_TABLE; + + if (!$config['coppa_enable']) + { + $sql .= " WHERE group_name <> 'REGISTERED_COPPA'"; + } + + $sql .= ' ORDER BY group_name ASC'; + } + else + { + $sql = 'SELECT g.group_id, g.group_name, g.group_type + FROM ' . GROUPS_TABLE . ' g + LEFT JOIN ' . USER_GROUP_TABLE . ' ug + ON ( + g.group_id = ug.group_id + AND ug.user_id = ' . $user->data['user_id'] . ' + AND ug.user_pending = 0 + ) + WHERE (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')'; + + if (!$config['coppa_enable']) + { + $sql .= " AND g.group_name <> 'REGISTERED_COPPA'"; + } + + $sql .= ' ORDER BY g.group_name ASC'; + } + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $group_ids[] = $row['group_id']; + $s_group_select .= ''; + } + $db->sql_freeresult($result); + + if ($group_selected !== 0 && !in_array($group_selected, $group_ids)) + { + trigger_error('NO_GROUP'); + } + + $template->assign_vars(array( + 'USERNAME' => $username, + 'EMAIL' => $email, + 'JABBER' => $jabber, + 'JOINED' => implode('-', $joined), + 'ACTIVE' => implode('-', $active), + 'COUNT' => $count, + 'IP' => $ipdomain, + + 'S_IP_SEARCH_ALLOWED' => ($auth->acl_getf_global('m_info')) ? true : false, + 'S_EMAIL_SEARCH_ALLOWED'=> ($auth->acl_get('a_user')) ? true : false, + 'S_JABBER_ENABLED' => $config['jab_enable'], + 'S_IN_SEARCH_POPUP' => ($form && $field) ? true : false, + 'S_SEARCH_USER' => ($mode == 'searchuser' || ($mode == '' && $submit)), + 'S_FORM_NAME' => $form, + 'S_FIELD_NAME' => $field, + 'S_SELECT_SINGLE' => $select_single, + 'S_COUNT_OPTIONS' => $s_find_count, + 'S_SORT_OPTIONS' => $s_sort_key, + 'S_JOINED_TIME_OPTIONS' => $s_find_join_time, + 'S_ACTIVE_TIME_OPTIONS' => $s_find_active_time, + 'S_GROUP_SELECT' => $s_group_select, + 'S_USER_SEARCH_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&form=$form&field=$field")) + ); + } + + $start = $pagination->validate_start($start, $config['topics_per_page'], $config['num_users']); + + // Get us some users :D + $sql = "SELECT u.user_id + FROM " . USERS_TABLE . " u + $sql_from + WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ") + $sql_where + ORDER BY $order_by"; + $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); + + $user_list = array(); + while ($row = $db->sql_fetchrow($result)) + { + $user_list[] = (int) $row['user_id']; + } + $db->sql_freeresult($result); + + // Load custom profile fields + if ($config['load_cpf_memberlist']) + { + $cp = $phpbb_container->get('profilefields.manager'); + + $cp_row = $cp->generate_profile_fields_template_headlines('field_show_on_ml'); + foreach ($cp_row as $profile_field) + { + $template->assign_block_vars('custom_fields', $profile_field); + } + } + + $leaders_set = false; + // So, did we get any users? + if (sizeof($user_list)) + { + // Session time?! Session time... + $sql = 'SELECT session_user_id, MAX(session_time) AS session_time + FROM ' . SESSIONS_TABLE . ' + WHERE session_time >= ' . (time() - $config['session_length']) . ' + AND ' . $db->sql_in_set('session_user_id', $user_list) . ' + GROUP BY session_user_id'; + $result = $db->sql_query($sql); + + $session_times = array(); + while ($row = $db->sql_fetchrow($result)) + { + $session_times[$row['session_user_id']] = $row['session_time']; + } + $db->sql_freeresult($result); + + // Do the SQL thang + if ($mode == 'group') + { + $sql = "SELECT u.* + $sql_select + FROM " . USERS_TABLE . " u + $sql_from + WHERE " . $db->sql_in_set('u.user_id', $user_list) . " + $sql_where_data"; + } + else + { + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $user_list); + } + $result = $db->sql_query($sql); + + $id_cache = array(); + while ($row = $db->sql_fetchrow($result)) + { + $row['session_time'] = (!empty($session_times[$row['user_id']])) ? $session_times[$row['user_id']] : 0; + $row['last_visit'] = (!empty($row['session_time'])) ? $row['session_time'] : $row['user_lastvisit']; + + $id_cache[$row['user_id']] = $row; + } + $db->sql_freeresult($result); + + // Load custom profile fields + if ($config['load_cpf_memberlist']) + { + // Grab all profile fields from users in id cache for later use - similar to the poster cache + $profile_fields_cache = $cp->grab_profile_fields_data($user_list); + + // Filter the fields we don't want to show + foreach ($profile_fields_cache as $user_id => $user_profile_fields) + { + foreach ($user_profile_fields as $field_ident => $profile_field) + { + if (!$profile_field['data']['field_show_on_ml']) + { + unset($profile_fields_cache[$user_id][$field_ident]); + } + } + } + } + + // If we sort by last active date we need to adjust the id cache due to user_lastvisit not being the last active date... + if ($sort_key == 'l') + { +// uasort($id_cache, create_function('$first, $second', "return (\$first['last_visit'] == \$second['last_visit']) ? 0 : ((\$first['last_visit'] < \$second['last_visit']) ? $lesser_than : ($lesser_than * -1));")); + usort($user_list, 'phpbb_sort_last_active'); + } + + for ($i = 0, $end = sizeof($user_list); $i < $end; ++$i) + { + $user_id = $user_list[$i]; + $row = $id_cache[$user_id]; + $is_leader = (isset($row['group_leader']) && $row['group_leader']) ? true : false; + $leaders_set = ($leaders_set || $is_leader); + + $cp_row = array(); + if ($config['load_cpf_memberlist']) + { + $cp_row = (isset($profile_fields_cache[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields_cache[$user_id], false) : array(); + } + + $memberrow = array_merge(phpbb_show_profile($row, false, false, false), array( + 'ROW_NUMBER' => $i + ($start + 1), + + 'S_CUSTOM_PROFILE' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false, + 'S_GROUP_LEADER' => $is_leader, + + 'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $row['username']), + )); + + if (isset($cp_row['row']) && sizeof($cp_row['row'])) + { + $memberrow = array_merge($memberrow, $cp_row['row']); + } + + $template->assign_block_vars('memberrow', $memberrow); + + if (isset($cp_row['blockrow']) && sizeof($cp_row['blockrow'])) + { + foreach ($cp_row['blockrow'] as $field_data) + { + $template->assign_block_vars('memberrow.custom_fields', $field_data); + } + } + + unset($id_cache[$user_id]); + } + } + + $pagination->generate_template_pagination($pagination_url, 'pagination', 'start', $total_users, $config['topics_per_page'], $start); + + // Generate page + $template->assign_vars(array( + 'TOTAL_USERS' => $user->lang('LIST_USERS', (int) $total_users), + + 'PROFILE_IMG' => $user->img('icon_user_profile', $user->lang['PROFILE']), + 'PM_IMG' => $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE']), + 'EMAIL_IMG' => $user->img('icon_contact_email', $user->lang['EMAIL']), + 'JABBER_IMG' => $user->img('icon_contact_jabber', $user->lang['JABBER']), + 'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']), + + 'U_FIND_MEMBER' => ($config['load_search'] || $auth->acl_get('a_')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser' . (($start) ? "&start=$start" : '') . (!empty($params) ? '&' . implode('&', $params) : '')) : '', + 'U_HIDE_FIND_MEMBER' => ($mode == 'searchuser' || ($mode == '' && $submit)) ? $u_hide_find_member : '', + 'U_LIVE_SEARCH' => ($config['allow_live_searches']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=livesearch') : false, + 'U_SORT_USERNAME' => $sort_url . '&sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_JOINED' => $sort_url . '&sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_POSTS' => $sort_url . '&sk=d&sd=' . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_EMAIL' => $sort_url . '&sk=e&sd=' . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_ACTIVE' => ($auth->acl_get('u_viewonline')) ? $sort_url . '&sk=l&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a') : '', + 'U_SORT_RANK' => $sort_url . '&sk=m&sd=' . (($sort_key == 'm' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_LIST_CHAR' => $sort_url . '&sk=a&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'), + + 'S_SHOW_GROUP' => ($mode == 'group') ? true : false, + 'S_VIEWONLINE' => $auth->acl_get('u_viewonline'), + 'S_LEADERS_SET' => $leaders_set, + 'S_MODE_SELECT' => $s_sort_key, + 'S_ORDER_SELECT' => $s_sort_dir, + 'S_MODE_ACTION' => $pagination_url) + ); +} + +// Output the page +page_header($page_title); + +$template->set_filenames(array( + 'body' => $template_html) +); +make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); + +page_footer(); diff --git a/sources/phpBB/phpbb/auth/auth.php b/sources/phpBB/phpbb/auth/auth.php new file mode 100644 index 0000000..b59f0e6 --- /dev/null +++ b/sources/phpBB/phpbb/auth/auth.php @@ -0,0 +1,1092 @@ + +* @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\auth; + +/** +* Permission/Auth class +*/ +class auth +{ + var $acl = array(); + var $cache = array(); + var $acl_options = array(); + var $acl_forum_ids = false; + + /** + * Init permissions + */ + function acl(&$userdata) + { + global $db, $cache; + + $this->acl = $this->cache = $this->acl_options = array(); + $this->acl_forum_ids = false; + + if (($this->acl_options = $cache->get('_acl_options')) === false) + { + $sql = 'SELECT auth_option_id, auth_option, is_global, is_local + FROM ' . ACL_OPTIONS_TABLE . ' + ORDER BY auth_option_id'; + $result = $db->sql_query($sql); + + $global = $local = 0; + $this->acl_options = array(); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['is_global']) + { + $this->acl_options['global'][$row['auth_option']] = $global++; + } + + if ($row['is_local']) + { + $this->acl_options['local'][$row['auth_option']] = $local++; + } + + $this->acl_options['id'][$row['auth_option']] = (int) $row['auth_option_id']; + $this->acl_options['option'][(int) $row['auth_option_id']] = $row['auth_option']; + } + $db->sql_freeresult($result); + + $cache->put('_acl_options', $this->acl_options); + } + + if (!trim($userdata['user_permissions'])) + { + $this->acl_cache($userdata); + } + + // Fill ACL array + $this->_fill_acl($userdata['user_permissions']); + + // Verify bitstring length with options provided... + $renew = false; + $global_length = sizeof($this->acl_options['global']); + $local_length = sizeof($this->acl_options['local']); + + // Specify comparing length (bitstring is padded to 31 bits) + $global_length = ($global_length % 31) ? ($global_length - ($global_length % 31) + 31) : $global_length; + $local_length = ($local_length % 31) ? ($local_length - ($local_length % 31) + 31) : $local_length; + + // You thought we are finished now? Noooo... now compare them. + foreach ($this->acl as $forum_id => $bitstring) + { + if (($forum_id && strlen($bitstring) != $local_length) || (!$forum_id && strlen($bitstring) != $global_length)) + { + $renew = true; + break; + } + } + + // If a bitstring within the list does not match the options, we have a user with incorrect permissions set and need to renew them + if ($renew) + { + $this->acl_cache($userdata); + $this->_fill_acl($userdata['user_permissions']); + } + + return; + } + + /** + * Retrieves data wanted by acl function from the database for the + * specified user. + * + * @param int $user_id User ID + * @return array User attributes + */ + public function obtain_user_data($user_id) + { + global $db; + + $sql = 'SELECT user_id, username, user_permissions, user_type + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . $user_id; + $result = $db->sql_query($sql); + $user_data = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + return $user_data; + } + + /** + * Fill ACL array with relevant bitstrings from user_permissions column + * @access private + */ + function _fill_acl($user_permissions) + { + $seq_cache = array(); + $this->acl = array(); + $user_permissions = explode("\n", $user_permissions); + + foreach ($user_permissions as $f => $seq) + { + if ($seq) + { + $i = 0; + + if (!isset($this->acl[$f])) + { + $this->acl[$f] = ''; + } + + while ($subseq = substr($seq, $i, 6)) + { + if (isset($seq_cache[$subseq])) + { + $converted = $seq_cache[$subseq]; + } + else + { + $converted = $seq_cache[$subseq] = str_pad(base_convert($subseq, 36, 2), 31, 0, STR_PAD_LEFT); + } + + // We put the original bitstring into the acl array + $this->acl[$f] .= $converted; + $i += 6; + } + } + } + } + + /** + * Look up an option + * if the option is prefixed with !, then the result becomes negated + * + * If a forum id is specified the local option will be combined with a global option if one exist. + * If a forum id is not specified, only the global option will be checked. + */ + function acl_get($opt, $f = 0) + { + $negate = false; + + if (strpos($opt, '!') === 0) + { + $negate = true; + $opt = substr($opt, 1); + } + + if (!isset($this->cache[$f][$opt])) + { + // We combine the global/local option with an OR because some options are global and local. + // If the user has the global permission the local one is true too and vice versa + $this->cache[$f][$opt] = false; + + // Is this option a global permission setting? + if (isset($this->acl_options['global'][$opt])) + { + if (isset($this->acl[0])) + { + $this->cache[$f][$opt] = $this->acl[0][$this->acl_options['global'][$opt]]; + } + } + + // Is this option a local permission setting? + // But if we check for a global option only, we won't combine the options... + if ($f != 0 && isset($this->acl_options['local'][$opt])) + { + if (isset($this->acl[$f]) && isset($this->acl[$f][$this->acl_options['local'][$opt]])) + { + $this->cache[$f][$opt] |= $this->acl[$f][$this->acl_options['local'][$opt]]; + } + } + } + + // Founder always has all global options set to true... + return ($negate) ? !$this->cache[$f][$opt] : $this->cache[$f][$opt]; + } + + /** + * Get forums with the specified permission setting + * + * @param string $opt The permission name to lookup. If prefixed with !, the result is negated. + * @param bool $clean set to true if only values needs to be returned which are set/unset + * + * @return array Contains the forum ids with the specified permission set to true. + This is a nested array: array => forum_id => permission => true + */ + function acl_getf($opt, $clean = false) + { + $acl_f = array(); + $negate = false; + + if (strpos($opt, '!') === 0) + { + $negate = true; + $opt = substr($opt, 1); + } + + // If we retrieve a list of forums not having permissions in, we need to get every forum_id + if ($negate) + { + if ($this->acl_forum_ids === false) + { + global $db; + + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE; + + if (sizeof($this->acl)) + { + $sql .= ' WHERE ' . $db->sql_in_set('forum_id', array_keys($this->acl), true); + } + $result = $db->sql_query($sql); + + $this->acl_forum_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $this->acl_forum_ids[] = $row['forum_id']; + } + $db->sql_freeresult($result); + } + } + + if (isset($this->acl_options['local'][$opt])) + { + foreach ($this->acl as $f => $bitstring) + { + // Skip global settings + if (!$f) + { + continue; + } + + $allowed = (!isset($this->cache[$f][$opt])) ? $this->acl_get($opt, $f) : $this->cache[$f][$opt]; + + if (!$clean) + { + $acl_f[$f][$opt] = ($negate) ? !$allowed : $allowed; + } + else + { + if (($negate && !$allowed) || (!$negate && $allowed)) + { + $acl_f[$f][$opt] = 1; + } + } + } + } + + // If we get forum_ids not having this permission, we need to fill the remaining parts + if ($negate && sizeof($this->acl_forum_ids)) + { + foreach ($this->acl_forum_ids as $f) + { + $acl_f[$f][$opt] = 1; + } + } + + return $acl_f; + } + + /** + * Get local permission state for any forum. + * + * Returns true if user has the permission in one or more forums, false if in no forum. + * If global option is checked it returns the global state (same as acl_get($opt)) + * Local option has precedence... + */ + function acl_getf_global($opt) + { + if (is_array($opt)) + { + // evaluates to true as soon as acl_getf_global is true for one option + foreach ($opt as $check_option) + { + if ($this->acl_getf_global($check_option)) + { + return true; + } + } + + return false; + } + + if (isset($this->acl_options['local'][$opt])) + { + foreach ($this->acl as $f => $bitstring) + { + // Skip global settings + if (!$f) + { + continue; + } + + // as soon as the user has any permission we're done so return true + if ((!isset($this->cache[$f][$opt])) ? $this->acl_get($opt, $f) : $this->cache[$f][$opt]) + { + return true; + } + } + } + else if (isset($this->acl_options['global'][$opt])) + { + return $this->acl_get($opt); + } + + return false; + } + + /** + * Get permission settings (more than one) + */ + function acl_gets() + { + $args = func_get_args(); + $f = array_pop($args); + + if (!is_numeric($f)) + { + $args[] = $f; + $f = 0; + } + + // alternate syntax: acl_gets(array('m_', 'a_'), $forum_id) + if (is_array($args[0])) + { + $args = $args[0]; + } + + $acl = 0; + foreach ($args as $opt) + { + $acl |= $this->acl_get($opt, $f); + } + + return $acl; + } + + /** + * Get permission listing based on user_id/options/forum_ids + * + * Be careful when using this function with permissions a_, m_, u_ and f_ ! + * It may not work correctly. When a user group grants an a_* permission, + * e.g. a_foo, but the user's a_foo permission is set to "Never", then + * the user does not in fact have the a_ permission. + * But the user will still be listed as having the a_ permission. + * + * For more information see: http://tracker.phpbb.com/browse/PHPBB3-10252 + */ + function acl_get_list($user_id = false, $opts = false, $forum_id = false) + { + if ($user_id !== false && !is_array($user_id) && $opts === false && $forum_id === false) + { + $hold_ary = array($user_id => $this->acl_raw_data_single_user($user_id)); + } + else + { + $hold_ary = $this->acl_raw_data($user_id, $opts, $forum_id); + } + + $auth_ary = array(); + foreach ($hold_ary as $user_id => $forum_ary) + { + foreach ($forum_ary as $forum_id => $auth_option_ary) + { + foreach ($auth_option_ary as $auth_option => $auth_setting) + { + if ($auth_setting) + { + $auth_ary[$forum_id][$auth_option][] = $user_id; + } + } + } + } + + return $auth_ary; + } + + /** + * Cache data to user_permissions row + */ + function acl_cache(&$userdata) + { + global $db; + + // Empty user_permissions + $userdata['user_permissions'] = ''; + + $hold_ary = $this->acl_raw_data_single_user($userdata['user_id']); + + // Key 0 in $hold_ary are global options, all others are forum_ids + + // If this user is founder we're going to force fill the admin options ... + if ($userdata['user_type'] == USER_FOUNDER) + { + foreach ($this->acl_options['global'] as $opt => $id) + { + if (strpos($opt, 'a_') === 0) + { + $hold_ary[0][$this->acl_options['id'][$opt]] = ACL_YES; + } + } + } + + $hold_str = $this->build_bitstring($hold_ary); + + if ($hold_str) + { + $userdata['user_permissions'] = $hold_str; + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_permissions = '" . $db->sql_escape($userdata['user_permissions']) . "', + user_perm_from = 0 + WHERE user_id = " . $userdata['user_id']; + $db->sql_query($sql); + } + + return; + } + + /** + * Build bitstring from permission set + */ + function build_bitstring(&$hold_ary) + { + $hold_str = ''; + + if (sizeof($hold_ary)) + { + ksort($hold_ary); + + $last_f = 0; + + foreach ($hold_ary as $f => $auth_ary) + { + $ary_key = (!$f) ? 'global' : 'local'; + + $bitstring = array(); + foreach ($this->acl_options[$ary_key] as $opt => $id) + { + if (isset($auth_ary[$this->acl_options['id'][$opt]])) + { + $bitstring[$id] = $auth_ary[$this->acl_options['id'][$opt]]; + + $option_key = substr($opt, 0, strpos($opt, '_') + 1); + + // If one option is allowed, the global permission for this option has to be allowed too + // example: if the user has the a_ permission this means he has one or more a_* permissions + if ($auth_ary[$this->acl_options['id'][$opt]] == ACL_YES && (!isset($bitstring[$this->acl_options[$ary_key][$option_key]]) || $bitstring[$this->acl_options[$ary_key][$option_key]] == ACL_NEVER)) + { + $bitstring[$this->acl_options[$ary_key][$option_key]] = ACL_YES; + } + } + else + { + $bitstring[$id] = ACL_NEVER; + } + } + + // Now this bitstring defines the permission setting for the current forum $f (or global setting) + $bitstring = implode('', $bitstring); + + // The line number indicates the id, therefore we have to add empty lines for those ids not present + $hold_str .= str_repeat("\n", $f - $last_f); + + // Convert bitstring for storage - we do not use binary/bytes because PHP's string functions are not fully binary safe + for ($i = 0, $bit_length = strlen($bitstring); $i < $bit_length; $i += 31) + { + $hold_str .= str_pad(base_convert(str_pad(substr($bitstring, $i, 31), 31, 0, STR_PAD_RIGHT), 2, 36), 6, 0, STR_PAD_LEFT); + } + + $last_f = $f; + } + unset($bitstring); + + $hold_str = rtrim($hold_str); + } + + return $hold_str; + } + + /** + * Clear one or all users cached permission settings + */ + function acl_clear_prefetch($user_id = false) + { + global $db, $cache; + + // Rebuild options cache + $cache->destroy('_role_cache'); + + $sql = 'SELECT * + FROM ' . ACL_ROLES_DATA_TABLE . ' + ORDER BY role_id ASC'; + $result = $db->sql_query($sql); + + $this->role_cache = array(); + while ($row = $db->sql_fetchrow($result)) + { + $this->role_cache[$row['role_id']][$row['auth_option_id']] = (int) $row['auth_setting']; + } + $db->sql_freeresult($result); + + foreach ($this->role_cache as $role_id => $role_options) + { + $this->role_cache[$role_id] = serialize($role_options); + } + + $cache->put('_role_cache', $this->role_cache); + + // Now empty user permissions + $where_sql = ''; + + if ($user_id !== false) + { + $user_id = (!is_array($user_id)) ? $user_id = array((int) $user_id) : array_map('intval', $user_id); + $where_sql = ' WHERE ' . $db->sql_in_set('user_id', $user_id); + } + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_permissions = '', + user_perm_from = 0 + $where_sql"; + $db->sql_query($sql); + + return; + } + + /** + * Get assigned roles + */ + function acl_role_data($user_type, $role_type, $ug_id = false, $forum_id = false) + { + global $db; + + $roles = array(); + + $sql_id = ($user_type == 'user') ? 'user_id' : 'group_id'; + + $sql_ug = ($ug_id !== false) ? ((!is_array($ug_id)) ? "AND a.$sql_id = $ug_id" : 'AND ' . $db->sql_in_set("a.$sql_id", $ug_id)) : ''; + $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : ''; + + // Grab assigned roles... + $sql = 'SELECT a.auth_role_id, a.' . $sql_id . ', a.forum_id + FROM ' . (($user_type == 'user') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE) . ' a, ' . ACL_ROLES_TABLE . " r + WHERE a.auth_role_id = r.role_id + AND r.role_type = '" . $db->sql_escape($role_type) . "' + $sql_ug + $sql_forum + ORDER BY r.role_order ASC"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $roles[$row[$sql_id]][$row['forum_id']] = $row['auth_role_id']; + } + $db->sql_freeresult($result); + + return $roles; + } + + /** + * Get raw acl data based on user/option/forum + */ + function acl_raw_data($user_id = false, $opts = false, $forum_id = false) + { + global $db; + + $sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? 'user_id = ' . (int) $user_id : $db->sql_in_set('user_id', array_map('intval', $user_id))) : ''; + $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? 'AND a.forum_id = ' . (int) $forum_id : 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id))) : ''; + + $sql_opts = $sql_opts_select = $sql_opts_from = ''; + $hold_ary = array(); + + if ($opts !== false) + { + $sql_opts_select = ', ao.auth_option'; + $sql_opts_from = ', ' . ACL_OPTIONS_TABLE . ' ao'; + $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts); + } + + $sql_ary = array(); + + // Grab non-role settings - user-specific + $sql_ary[] = 'SELECT a.user_id, a.forum_id, a.auth_setting, a.auth_option_id' . $sql_opts_select . ' + FROM ' . ACL_USERS_TABLE . ' a' . $sql_opts_from . ' + WHERE a.auth_role_id = 0 ' . + (($sql_opts_from) ? 'AND a.auth_option_id = ao.auth_option_id ' : '') . + (($sql_user) ? 'AND a.' . $sql_user : '') . " + $sql_forum + $sql_opts"; + + // Now the role settings - user-specific + $sql_ary[] = 'SELECT a.user_id, a.forum_id, r.auth_option_id, r.auth_setting, r.auth_option_id' . $sql_opts_select . ' + FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r' . $sql_opts_from . ' + WHERE a.auth_role_id = r.role_id ' . + (($sql_opts_from) ? 'AND r.auth_option_id = ao.auth_option_id ' : '') . + (($sql_user) ? 'AND a.' . $sql_user : '') . " + $sql_forum + $sql_opts"; + + foreach ($sql_ary as $sql) + { + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $option = ($sql_opts_select) ? $row['auth_option'] : $this->acl_options['option'][$row['auth_option_id']]; + $hold_ary[$row['user_id']][$row['forum_id']][$option] = $row['auth_setting']; + } + $db->sql_freeresult($result); + } + + $sql_ary = array(); + + // Now grab group settings - non-role specific... + $sql_ary[] = 'SELECT ug.user_id, a.forum_id, a.auth_setting, a.auth_option_id' . $sql_opts_select . ' + FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g' . $sql_opts_from . ' + WHERE a.auth_role_id = 0 ' . + (($sql_opts_from) ? 'AND a.auth_option_id = ao.auth_option_id ' : '') . ' + AND a.group_id = ug.group_id + AND g.group_id = ug.group_id + AND ug.user_pending = 0 + AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1) + ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . " + $sql_forum + $sql_opts"; + + // Now grab group settings - role specific... + $sql_ary[] = 'SELECT ug.user_id, a.forum_id, r.auth_setting, r.auth_option_id' . $sql_opts_select . ' + FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g, ' . ACL_ROLES_DATA_TABLE . ' r' . $sql_opts_from . ' + WHERE a.auth_role_id = r.role_id ' . + (($sql_opts_from) ? 'AND r.auth_option_id = ao.auth_option_id ' : '') . ' + AND a.group_id = ug.group_id + AND g.group_id = ug.group_id + AND ug.user_pending = 0 + AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1) + ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . " + $sql_forum + $sql_opts"; + + foreach ($sql_ary as $sql) + { + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $option = ($sql_opts_select) ? $row['auth_option'] : $this->acl_options['option'][$row['auth_option_id']]; + + if (!isset($hold_ary[$row['user_id']][$row['forum_id']][$option]) || (isset($hold_ary[$row['user_id']][$row['forum_id']][$option]) && $hold_ary[$row['user_id']][$row['forum_id']][$option] != ACL_NEVER)) + { + $hold_ary[$row['user_id']][$row['forum_id']][$option] = $row['auth_setting']; + + // If we detect ACL_NEVER, we will unset the flag option (within building the bitstring it is correctly set again) + if ($row['auth_setting'] == ACL_NEVER) + { + $flag = substr($option, 0, strpos($option, '_') + 1); + + if (isset($hold_ary[$row['user_id']][$row['forum_id']][$flag]) && $hold_ary[$row['user_id']][$row['forum_id']][$flag] == ACL_YES) + { + unset($hold_ary[$row['user_id']][$row['forum_id']][$flag]); + +/* if (in_array(ACL_YES, $hold_ary[$row['user_id']][$row['forum_id']])) + { + $hold_ary[$row['user_id']][$row['forum_id']][$flag] = ACL_YES; + } +*/ + } + } + } + } + $db->sql_freeresult($result); + } + + return $hold_ary; + } + + /** + * Get raw user based permission settings + */ + function acl_user_raw_data($user_id = false, $opts = false, $forum_id = false) + { + global $db; + + $sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? 'user_id = ' . (int) $user_id : $db->sql_in_set('user_id', array_map('intval', $user_id))) : ''; + $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? 'AND a.forum_id = ' . (int) $forum_id : 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id))) : ''; + + $sql_opts = ''; + $hold_ary = $sql_ary = array(); + + if ($opts !== false) + { + $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts); + } + + // Grab user settings - non-role specific... + $sql_ary[] = 'SELECT a.user_id, a.forum_id, a.auth_setting, a.auth_option_id, ao.auth_option + FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . ' ao + WHERE a.auth_role_id = 0 + AND a.auth_option_id = ao.auth_option_id ' . + (($sql_user) ? 'AND a.' . $sql_user : '') . " + $sql_forum + $sql_opts + ORDER BY a.forum_id, ao.auth_option"; + + // Now the role settings - user-specific + $sql_ary[] = 'SELECT a.user_id, a.forum_id, r.auth_option_id, r.auth_setting, r.auth_option_id, ao.auth_option + FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' ao + WHERE a.auth_role_id = r.role_id + AND r.auth_option_id = ao.auth_option_id ' . + (($sql_user) ? 'AND a.' . $sql_user : '') . " + $sql_forum + $sql_opts + ORDER BY a.forum_id, ao.auth_option"; + + foreach ($sql_ary as $sql) + { + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + } + + return $hold_ary; + } + + /** + * Get raw group based permission settings + */ + function acl_group_raw_data($group_id = false, $opts = false, $forum_id = false) + { + global $db; + + $sql_group = ($group_id !== false) ? ((!is_array($group_id)) ? 'group_id = ' . (int) $group_id : $db->sql_in_set('group_id', array_map('intval', $group_id))) : ''; + $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? 'AND a.forum_id = ' . (int) $forum_id : 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id))) : ''; + + $sql_opts = ''; + $hold_ary = $sql_ary = array(); + + if ($opts !== false) + { + $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts); + } + + // Grab group settings - non-role specific... + $sql_ary[] = 'SELECT a.group_id, a.forum_id, a.auth_setting, a.auth_option_id, ao.auth_option + FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . ' ao + WHERE a.auth_role_id = 0 + AND a.auth_option_id = ao.auth_option_id ' . + (($sql_group) ? 'AND a.' . $sql_group : '') . " + $sql_forum + $sql_opts + ORDER BY a.forum_id, ao.auth_option"; + + // Now grab group settings - role specific... + $sql_ary[] = 'SELECT a.group_id, a.forum_id, r.auth_setting, r.auth_option_id, ao.auth_option + FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' ao + WHERE a.auth_role_id = r.role_id + AND r.auth_option_id = ao.auth_option_id ' . + (($sql_group) ? 'AND a.' . $sql_group : '') . " + $sql_forum + $sql_opts + ORDER BY a.forum_id, ao.auth_option"; + + foreach ($sql_ary as $sql) + { + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $hold_ary[$row['group_id']][$row['forum_id']][$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + } + + return $hold_ary; + } + + /** + * Get raw acl data based on user for caching user_permissions + * This function returns the same data as acl_raw_data(), but without the user id as the first key within the array. + */ + function acl_raw_data_single_user($user_id) + { + global $db, $cache; + + // Check if the role-cache is there + if (($this->role_cache = $cache->get('_role_cache')) === false) + { + $this->role_cache = array(); + + // We pre-fetch roles + $sql = 'SELECT * + FROM ' . ACL_ROLES_DATA_TABLE . ' + ORDER BY role_id ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $this->role_cache[$row['role_id']][$row['auth_option_id']] = (int) $row['auth_setting']; + } + $db->sql_freeresult($result); + + foreach ($this->role_cache as $role_id => $role_options) + { + $this->role_cache[$role_id] = serialize($role_options); + } + + $cache->put('_role_cache', $this->role_cache); + } + + $hold_ary = array(); + + // Grab user-specific permission settings + $sql = 'SELECT forum_id, auth_option_id, auth_role_id, auth_setting + FROM ' . ACL_USERS_TABLE . ' + WHERE user_id = ' . $user_id; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + // If a role is assigned, assign all options included within this role. Else, only set this one option. + if ($row['auth_role_id']) + { + $hold_ary[$row['forum_id']] = (empty($hold_ary[$row['forum_id']])) ? unserialize($this->role_cache[$row['auth_role_id']]) : $hold_ary[$row['forum_id']] + unserialize($this->role_cache[$row['auth_role_id']]); + } + else + { + $hold_ary[$row['forum_id']][$row['auth_option_id']] = $row['auth_setting']; + } + } + $db->sql_freeresult($result); + + // Now grab group-specific permission settings + $sql = 'SELECT a.forum_id, a.auth_option_id, a.auth_role_id, a.auth_setting + FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g + WHERE a.group_id = ug.group_id + AND g.group_id = ug.group_id + AND ug.user_pending = 0 + AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1) + AND ug.user_id = ' . $user_id; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (!$row['auth_role_id']) + { + $this->_set_group_hold_ary($hold_ary[$row['forum_id']], $row['auth_option_id'], $row['auth_setting']); + } + else if (!empty($this->role_cache[$row['auth_role_id']])) + { + foreach (unserialize($this->role_cache[$row['auth_role_id']]) as $option_id => $setting) + { + $this->_set_group_hold_ary($hold_ary[$row['forum_id']], $option_id, $setting); + } + } + } + $db->sql_freeresult($result); + + return $hold_ary; + } + + /** + * Private function snippet for setting a specific piece of the hold_ary + */ + function _set_group_hold_ary(&$hold_ary, $option_id, $setting) + { + if (!isset($hold_ary[$option_id]) || (isset($hold_ary[$option_id]) && $hold_ary[$option_id] != ACL_NEVER)) + { + $hold_ary[$option_id] = $setting; + + // If we detect ACL_NEVER, we will unset the flag option (within building the bitstring it is correctly set again) + if ($setting == ACL_NEVER) + { + $flag = substr($this->acl_options['option'][$option_id], 0, strpos($this->acl_options['option'][$option_id], '_') + 1); + $flag = (int) $this->acl_options['id'][$flag]; + + if (isset($hold_ary[$flag]) && $hold_ary[$flag] == ACL_YES) + { + unset($hold_ary[$flag]); + +/* This is uncommented, because i suspect this being slightly wrong due to mixed permission classes being possible + if (in_array(ACL_YES, $hold_ary)) + { + $hold_ary[$flag] = ACL_YES; + }*/ + } + } + } + } + + /** + * Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him. + */ + function login($username, $password, $autologin = false, $viewonline = 1, $admin = 0) + { + global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container; + + $provider_collection = $phpbb_container->get('auth.provider_collection'); + + $provider = $provider_collection->get_provider(); + if ($provider) + { + $login = $provider->login($username, $password); + + // If the auth module wants us to create an empty profile do so and then treat the status as LOGIN_SUCCESS + if ($login['status'] == LOGIN_SUCCESS_CREATE_PROFILE) + { + // we are going to use the user_add function so include functions_user.php if it wasn't defined yet + if (!function_exists('user_add')) + { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + } + + user_add($login['user_row'], (isset($login['cp_data'])) ? $login['cp_data'] : false); + + $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type + FROM ' . USERS_TABLE . " + WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + return array( + 'status' => LOGIN_ERROR_EXTERNAL_AUTH, + 'error_msg' => 'AUTH_NO_PROFILE_CREATED', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + $login = array( + 'status' => LOGIN_SUCCESS, + 'error_msg' => false, + 'user_row' => $row, + ); + } + + // If the auth provider wants us to link an empty account do so and redirect + if ($login['status'] == LOGIN_SUCCESS_LINK_PROFILE) + { + // If this status exists a fourth field is in the $login array called 'redirect_data' + // This data is passed along as GET data to the next page allow the account to be linked + + $params = array('mode' => 'login_link'); + $url = append_sid($phpbb_root_path . 'ucp.' . $phpEx, array_merge($params, $login['redirect_data'])); + + redirect($url); + } + + // If login succeeded, we will log the user in... else we pass the login array through... + if ($login['status'] == LOGIN_SUCCESS) + { + $old_session_id = $user->session_id; + + if ($admin) + { + global $SID, $_SID; + + $cookie_expire = time() - 31536000; + $user->set_cookie('u', '', $cookie_expire); + $user->set_cookie('sid', '', $cookie_expire); + unset($cookie_expire); + + $SID = '?sid='; + $user->session_id = $_SID = ''; + } + + $result = $user->session_create($login['user_row']['user_id'], $admin, $autologin, $viewonline); + + // Successful session creation + if ($result === true) + { + // If admin re-authentication we remove the old session entry because a new one has been created... + if ($admin) + { + // the login array is used because the user ids do not differ for re-authentication + $sql = 'DELETE FROM ' . SESSIONS_TABLE . " + WHERE session_id = '" . $db->sql_escape($old_session_id) . "' + AND session_user_id = {$login['user_row']['user_id']}"; + $db->sql_query($sql); + } + + return array( + 'status' => LOGIN_SUCCESS, + 'error_msg' => false, + 'user_row' => $login['user_row'], + ); + } + + return array( + 'status' => LOGIN_BREAK, + 'error_msg' => $result, + 'user_row' => $login['user_row'], + ); + } + + return $login; + } + + trigger_error('Authentication method not found', E_USER_ERROR); + } + + /** + * Fill auth_option statement for later querying based on the supplied options + */ + function build_auth_option_statement($key, $auth_options, &$sql_opts) + { + global $db; + + if (!is_array($auth_options)) + { + if (strpos($auth_options, '%') !== false) + { + $sql_opts = "AND $key " . $db->sql_like_expression(str_replace('%', $db->get_any_char(), $auth_options)); + } + else + { + $sql_opts = "AND $key = '" . $db->sql_escape($auth_options) . "'"; + } + } + else + { + $is_like_expression = false; + + foreach ($auth_options as $option) + { + if (strpos($option, '%') !== false) + { + $is_like_expression = true; + } + } + + if (!$is_like_expression) + { + $sql_opts = 'AND ' . $db->sql_in_set($key, $auth_options); + } + else + { + $sql = array(); + + foreach ($auth_options as $option) + { + if (strpos($option, '%') !== false) + { + $sql[] = $key . ' ' . $db->sql_like_expression(str_replace('%', $db->get_any_char(), $option)); + } + else + { + $sql[] = $key . " = '" . $db->sql_escape($option) . "'"; + } + } + + $sql_opts = 'AND (' . implode(' OR ', $sql) . ')'; + } + } + } +} diff --git a/sources/phpBB/phpbb/auth/index.htm b/sources/phpBB/phpbb/auth/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/phpbb/auth/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/phpbb/auth/provider/apache.php b/sources/phpBB/phpbb/auth/provider/apache.php new file mode 100644 index 0000000..aa5bf64 --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider/apache.php @@ -0,0 +1,264 @@ + +* @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\auth\provider; + +/** +* Apache authentication provider for phpBB3 +*/ +class apache extends \phpbb\auth\provider\base +{ + /** + * phpBB passwords manager + * + * @var \phpbb\passwords\manager + */ + protected $passwords_manager; + + /** + * Apache Authentication Constructor + * + * @param \phpbb\db\driver\driver_interface $db Database object + * @param \phpbb\config\config $config Config object + * @param \phpbb\passwords\manager $passwords_manager Passwords Manager object + * @param \phpbb\request\request $request Request object + * @param \phpbb\user $user User object + * @param string $phpbb_root_path Relative path to phpBB root + * @param string $php_ext PHP file extension + */ + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\request\request $request, \phpbb\user $user, $phpbb_root_path, $php_ext) + { + $this->db = $db; + $this->config = $config; + $this->passwords_manager = $passwords_manager; + $this->request = $request; + $this->user = $user; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + } + + /** + * {@inheritdoc} + */ + public function init() + { + if (!$this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER) || $this->user->data['username'] !== htmlspecialchars_decode($this->request->server('PHP_AUTH_USER'))) + { + return $this->user->lang['APACHE_SETUP_BEFORE_USE']; + } + return false; + } + + /** + * {@inheritdoc} + */ + public function login($username, $password) + { + // do not allow empty password + if (!$password) + { + return array( + 'status' => LOGIN_ERROR_PASSWORD, + 'error_msg' => 'NO_PASSWORD_SUPPLIED', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + if (!$username) + { + return array( + 'status' => LOGIN_ERROR_USERNAME, + 'error_msg' => 'LOGIN_ERROR_USERNAME', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + if (!$this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER)) + { + return array( + 'status' => LOGIN_ERROR_EXTERNAL_AUTH, + 'error_msg' => 'LOGIN_ERROR_EXTERNAL_AUTH_APACHE', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + $php_auth_user = htmlspecialchars_decode($this->request->server('PHP_AUTH_USER')); + $php_auth_pw = htmlspecialchars_decode($this->request->server('PHP_AUTH_PW')); + + if (!empty($php_auth_user) && !empty($php_auth_pw)) + { + if ($php_auth_user !== $username) + { + return array( + 'status' => LOGIN_ERROR_USERNAME, + 'error_msg' => 'LOGIN_ERROR_USERNAME', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type + FROM ' . USERS_TABLE . " + WHERE username = '" . $this->db->sql_escape($php_auth_user) . "'"; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if ($row) + { + // User inactive... + if ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) + { + return array( + 'status' => LOGIN_ERROR_ACTIVE, + 'error_msg' => 'ACTIVE_ERROR', + 'user_row' => $row, + ); + } + + // Successful login... + return array( + 'status' => LOGIN_SUCCESS, + 'error_msg' => false, + 'user_row' => $row, + ); + } + + // this is the user's first login so create an empty profile + return array( + 'status' => LOGIN_SUCCESS_CREATE_PROFILE, + 'error_msg' => false, + 'user_row' => $this->user_row($php_auth_user, $php_auth_pw), + ); + } + + // Not logged into apache + return array( + 'status' => LOGIN_ERROR_EXTERNAL_AUTH, + 'error_msg' => 'LOGIN_ERROR_EXTERNAL_AUTH_APACHE', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + /** + * {@inheritdoc} + */ + public function autologin() + { + if (!$this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER)) + { + return array(); + } + + $php_auth_user = htmlspecialchars_decode($this->request->server('PHP_AUTH_USER')); + $php_auth_pw = htmlspecialchars_decode($this->request->server('PHP_AUTH_PW')); + + if (!empty($php_auth_user) && !empty($php_auth_pw)) + { + set_var($php_auth_user, $php_auth_user, 'string', true); + set_var($php_auth_pw, $php_auth_pw, 'string', true); + + $sql = 'SELECT * + FROM ' . USERS_TABLE . " + WHERE username = '" . $this->db->sql_escape($php_auth_user) . "'"; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if ($row) + { + return ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) ? array() : $row; + } + + if (!function_exists('user_add')) + { + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + } + + // create the user if he does not exist yet + user_add($this->user_row($php_auth_user, $php_auth_pw)); + + $sql = 'SELECT * + FROM ' . USERS_TABLE . " + WHERE username_clean = '" . $this->db->sql_escape(utf8_clean_string($php_auth_user)) . "'"; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if ($row) + { + return $row; + } + } + + return array(); + } + + /** + * This function generates an array which can be passed to the user_add + * function in order to create a user + * + * @param string $username The username of the new user. + * @param string $password The password of the new user. + * @return array Contains data that can be passed directly to + * the user_add function. + */ + private function user_row($username, $password) + { + // first retrieve default group id + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = '" . $this->db->sql_escape('REGISTERED') . "' + AND group_type = " . GROUP_SPECIAL; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (!$row) + { + trigger_error('NO_GROUP'); + } + + // generate user account data + return array( + 'username' => $username, + 'user_password' => $this->passwords_manager->hash($password), + 'user_email' => '', + 'group_id' => (int) $row['group_id'], + 'user_type' => USER_NORMAL, + 'user_ip' => $this->user->ip, + 'user_new' => ($this->config['new_member_post_limit']) ? 1 : 0, + ); + } + + /** + * {@inheritdoc} + */ + public function validate_session($user) + { + // Check if PHP_AUTH_USER is set and handle this case + if ($this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER)) + { + $php_auth_user = $this->request->server('PHP_AUTH_USER'); + + return ($php_auth_user === $user['username']) ? true : false; + } + + // PHP_AUTH_USER is not set. A valid session is now determined by the user type (anonymous/bot or not) + if ($user['user_type'] == USER_IGNORE) + { + return true; + } + + return false; + } +} diff --git a/sources/phpBB/phpbb/auth/provider/base.php b/sources/phpBB/phpbb/auth/provider/base.php new file mode 100644 index 0000000..4c49070 --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider/base.php @@ -0,0 +1,108 @@ + +* @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\auth\provider; + +/** +* Base authentication provider class that all other providers should implement +*/ +abstract class base implements \phpbb\auth\provider\provider_interface +{ + /** + * {@inheritdoc} + */ + public function init() + { + return; + } + + /** + * {@inheritdoc} + */ + public function autologin() + { + return; + } + + /** + * {@inheritdoc} + */ + public function acp() + { + return; + } + + /** + * {@inheritdoc} + */ + public function get_acp_template($new_config) + { + return; + } + + /** + * {@inheritdoc} + */ + public function get_login_data() + { + return; + } + + /** + * {@inheritdoc} + */ + public function get_auth_link_data() + { + return; + } + + /** + * {@inheritdoc} + */ + public function logout($data, $new_session) + { + return; + } + + /** + * {@inheritdoc} + */ + public function validate_session($user) + { + return; + } + + /** + * {@inheritdoc} + */ + public function login_link_has_necessary_data($login_link_data) + { + return; + } + + /** + * {@inheritdoc} + */ + public function link_account(array $link_data) + { + return; + } + + /** + * {@inheritdoc} + */ + public function unlink_account(array $link_data) + { + return; + } +} diff --git a/sources/phpBB/phpbb/auth/provider/db.php b/sources/phpBB/phpbb/auth/provider/db.php new file mode 100644 index 0000000..d8c5fb7 --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider/db.php @@ -0,0 +1,239 @@ + +* @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\auth\provider; + +/** + * Database authentication provider for phpBB3 + * This is for authentication via the integrated user table + */ +class db extends \phpbb\auth\provider\base +{ + /** + * phpBB passwords manager + * + * @var \phpbb\passwords\manager + */ + protected $passwords_manager; + + /** + * DI container + * + * @var \Symfony\Component\DependencyInjection\ContainerInterface + */ + protected $phpbb_container; + + /** + * Database Authentication Constructor + * + * @param \phpbb\db\driver\driver_interface $db + * @param \phpbb\config\config $config + * @param \phpbb\passwords\manager $passwords_manager + * @param \phpbb\request\request $request + * @param \phpbb\user $user + * @param \Symfony\Component\DependencyInjection\ContainerInterface $phpbb_container DI container + * @param string $phpbb_root_path + * @param string $php_ext + */ + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\request\request $request, \phpbb\user $user, \Symfony\Component\DependencyInjection\ContainerInterface $phpbb_container, $phpbb_root_path, $php_ext) + { + $this->db = $db; + $this->config = $config; + $this->passwords_manager = $passwords_manager; + $this->request = $request; + $this->user = $user; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->phpbb_container = $phpbb_container; + } + + /** + * {@inheritdoc} + */ + public function login($username, $password) + { + // Auth plugins get the password untrimmed. + // For compatibility we trim() here. + $password = trim($password); + + // do not allow empty password + if (!$password) + { + return array( + 'status' => LOGIN_ERROR_PASSWORD, + 'error_msg' => 'NO_PASSWORD_SUPPLIED', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + if (!$username) + { + return array( + 'status' => LOGIN_ERROR_USERNAME, + 'error_msg' => 'LOGIN_ERROR_USERNAME', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + $username_clean = utf8_clean_string($username); + + $sql = 'SELECT * + FROM ' . USERS_TABLE . " + WHERE username_clean = '" . $this->db->sql_escape($username_clean) . "'"; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (($this->user->ip && !$this->config['ip_login_limit_use_forwarded']) || + ($this->user->forwarded_for && $this->config['ip_login_limit_use_forwarded'])) + { + $sql = 'SELECT COUNT(*) AS attempts + FROM ' . LOGIN_ATTEMPT_TABLE . ' + WHERE attempt_time > ' . (time() - (int) $this->config['ip_login_limit_time']); + if ($this->config['ip_login_limit_use_forwarded']) + { + $sql .= " AND attempt_forwarded_for = '" . $this->db->sql_escape($this->user->forwarded_for) . "'"; + } + else + { + $sql .= " AND attempt_ip = '" . $this->db->sql_escape($this->user->ip) . "' "; + } + + $result = $this->db->sql_query($sql); + $attempts = (int) $this->db->sql_fetchfield('attempts'); + $this->db->sql_freeresult($result); + + $attempt_data = array( + 'attempt_ip' => $this->user->ip, + 'attempt_browser' => trim(substr($this->user->browser, 0, 149)), + 'attempt_forwarded_for' => $this->user->forwarded_for, + 'attempt_time' => time(), + 'user_id' => ($row) ? (int) $row['user_id'] : 0, + 'username' => $username, + 'username_clean' => $username_clean, + ); + $sql = 'INSERT INTO ' . LOGIN_ATTEMPT_TABLE . $this->db->sql_build_array('INSERT', $attempt_data); + $this->db->sql_query($sql); + } + else + { + $attempts = 0; + } + + if (!$row) + { + if ($this->config['ip_login_limit_max'] && $attempts >= $this->config['ip_login_limit_max']) + { + return array( + 'status' => LOGIN_ERROR_ATTEMPTS, + 'error_msg' => 'LOGIN_ERROR_ATTEMPTS', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + return array( + 'status' => LOGIN_ERROR_USERNAME, + 'error_msg' => 'LOGIN_ERROR_USERNAME', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + $show_captcha = ($this->config['max_login_attempts'] && $row['user_login_attempts'] >= $this->config['max_login_attempts']) || + ($this->config['ip_login_limit_max'] && $attempts >= $this->config['ip_login_limit_max']); + + // If there are too many login attempts, we need to check for a confirm image + // Every auth module is able to define what to do by itself... + if ($show_captcha) + { + $captcha_factory = $this->phpbb_container->get('captcha.factory'); + $captcha = $captcha_factory->get_instance($this->config['captcha_plugin']); + $captcha->init(CONFIRM_LOGIN); + $vc_response = $captcha->validate($row); + if ($vc_response) + { + return array( + 'status' => LOGIN_ERROR_ATTEMPTS, + 'error_msg' => 'LOGIN_ERROR_ATTEMPTS', + 'user_row' => $row, + ); + } + else + { + $captcha->reset(); + } + + } + + // Check password ... + if ($this->passwords_manager->check($password, $row['user_password'], $row)) + { + // Check for old password hash... + if ($this->passwords_manager->convert_flag || strlen($row['user_password']) == 32) + { + $hash = $this->passwords_manager->hash($password); + + // Update the password in the users table to the new format + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_password = '" . $this->db->sql_escape($hash) . "' + WHERE user_id = {$row['user_id']}"; + $this->db->sql_query($sql); + + $row['user_password'] = $hash; + } + + $sql = 'DELETE FROM ' . LOGIN_ATTEMPT_TABLE . ' + WHERE user_id = ' . $row['user_id']; + $this->db->sql_query($sql); + + if ($row['user_login_attempts'] != 0) + { + // Successful, reset login attempts (the user passed all stages) + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_login_attempts = 0 + WHERE user_id = ' . $row['user_id']; + $this->db->sql_query($sql); + } + + // User inactive... + if ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) + { + return array( + 'status' => LOGIN_ERROR_ACTIVE, + 'error_msg' => 'ACTIVE_ERROR', + 'user_row' => $row, + ); + } + + // Successful login... set user_login_attempts to zero... + return array( + 'status' => LOGIN_SUCCESS, + 'error_msg' => false, + 'user_row' => $row, + ); + } + + // Password incorrect - increase login attempts + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_login_attempts = user_login_attempts + 1 + WHERE user_id = ' . (int) $row['user_id'] . ' + AND user_login_attempts < ' . LOGIN_ATTEMPTS_MAX; + $this->db->sql_query($sql); + + // Give status about wrong password... + return array( + 'status' => ($show_captcha) ? LOGIN_ERROR_ATTEMPTS : LOGIN_ERROR_PASSWORD, + 'error_msg' => 'LOGIN_ERROR_PASSWORD', + 'user_row' => $row, + ); + } +} diff --git a/sources/phpBB/phpbb/auth/provider/index.htm b/sources/phpBB/phpbb/auth/provider/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/phpbb/auth/provider/ldap.php b/sources/phpBB/phpbb/auth/provider/ldap.php new file mode 100644 index 0000000..d32e750 --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider/ldap.php @@ -0,0 +1,349 @@ + +* @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\auth\provider; + +/** + * Database authentication provider for phpBB3 + * This is for authentication via the integrated user table + */ +class ldap extends \phpbb\auth\provider\base +{ + /** + * phpBB passwords manager + * + * @var \phpbb\passwords\manager + */ + protected $passwords_manager; + + /** + * LDAP Authentication Constructor + * + * @param \phpbb\db\driver\driver_interface $db Database object + * @param \phpbb\config\config $config Config object + * @param \phpbb\passwords\manager $passwords_manager Passwords manager object + * @param \phpbb\user $user User object + */ + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\user $user) + { + $this->db = $db; + $this->config = $config; + $this->passwords_manager = $passwords_manager; + $this->user = $user; + } + + /** + * {@inheritdoc} + */ + public function init() + { + if (!@extension_loaded('ldap')) + { + return $this->user->lang['LDAP_NO_LDAP_EXTENSION']; + } + + $this->config['ldap_port'] = (int) $this->config['ldap_port']; + if ($this->config['ldap_port']) + { + $ldap = @ldap_connect($this->config['ldap_server'], $this->config['ldap_port']); + } + else + { + $ldap = @ldap_connect($this->config['ldap_server']); + } + + if (!$ldap) + { + return $this->user->lang['LDAP_NO_SERVER_CONNECTION']; + } + + @ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3); + @ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0); + + if ($this->config['ldap_user'] || $this->config['ldap_password']) + { + if (!@ldap_bind($ldap, htmlspecialchars_decode($this->config['ldap_user']), htmlspecialchars_decode($this->config['ldap_password']))) + { + return $this->user->lang['LDAP_INCORRECT_USER_PASSWORD']; + } + } + + // ldap_connect only checks whether the specified server is valid, so the connection might still fail + $search = @ldap_search( + $ldap, + htmlspecialchars_decode($this->config['ldap_base_dn']), + $this->ldap_user_filter($this->user->data['username']), + (empty($this->config['ldap_email'])) ? + array(htmlspecialchars_decode($this->config['ldap_uid'])) : + array(htmlspecialchars_decode($this->config['ldap_uid']), htmlspecialchars_decode($this->config['ldap_email'])), + 0, + 1 + ); + + if ($search === false) + { + return $this->user->lang['LDAP_SEARCH_FAILED']; + } + + $result = @ldap_get_entries($ldap, $search); + + @ldap_close($ldap); + + if (!is_array($result) || sizeof($result) < 2) + { + return sprintf($this->user->lang['LDAP_NO_IDENTITY'], $this->user->data['username']); + } + + if (!empty($this->config['ldap_email']) && !isset($result[0][htmlspecialchars_decode($this->config['ldap_email'])])) + { + return $this->user->lang['LDAP_NO_EMAIL']; + } + + return false; + } + + /** + * {@inheritdoc} + */ + public function login($username, $password) + { + // do not allow empty password + if (!$password) + { + return array( + 'status' => LOGIN_ERROR_PASSWORD, + 'error_msg' => 'NO_PASSWORD_SUPPLIED', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + if (!$username) + { + return array( + 'status' => LOGIN_ERROR_USERNAME, + 'error_msg' => 'LOGIN_ERROR_USERNAME', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + if (!@extension_loaded('ldap')) + { + return array( + 'status' => LOGIN_ERROR_EXTERNAL_AUTH, + 'error_msg' => 'LDAP_NO_LDAP_EXTENSION', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + $this->config['ldap_port'] = (int) $this->config['ldap_port']; + if ($this->config['ldap_port']) + { + $ldap = @ldap_connect($this->config['ldap_server'], $this->config['ldap_port']); + } + else + { + $ldap = @ldap_connect($this->config['ldap_server']); + } + + if (!$ldap) + { + return array( + 'status' => LOGIN_ERROR_EXTERNAL_AUTH, + 'error_msg' => 'LDAP_NO_SERVER_CONNECTION', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + @ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3); + @ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0); + + if ($this->config['ldap_user'] || $this->config['ldap_password']) + { + if (!@ldap_bind($ldap, htmlspecialchars_decode($this->config['ldap_user']), htmlspecialchars_decode($this->config['ldap_password']))) + { + return array( + 'status' => LOGIN_ERROR_EXTERNAL_AUTH, + 'error_msg' => 'LDAP_NO_SERVER_CONNECTION', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + } + + $search = @ldap_search( + $ldap, + htmlspecialchars_decode($this->config['ldap_base_dn']), + $this->ldap_user_filter($username), + (empty($this->config['ldap_email'])) ? + array(htmlspecialchars_decode($this->config['ldap_uid'])) : + array(htmlspecialchars_decode($this->config['ldap_uid']), htmlspecialchars_decode($this->config['ldap_email'])), + 0, + 1 + ); + + $ldap_result = @ldap_get_entries($ldap, $search); + + if (is_array($ldap_result) && sizeof($ldap_result) > 1) + { + if (@ldap_bind($ldap, $ldap_result[0]['dn'], htmlspecialchars_decode($password))) + { + @ldap_close($ldap); + + $sql ='SELECT user_id, username, user_password, user_passchg, user_email, user_type + FROM ' . USERS_TABLE . " + WHERE username_clean = '" . $this->db->sql_escape(utf8_clean_string($username)) . "'"; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if ($row) + { + unset($ldap_result); + + // User inactive... + if ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) + { + return array( + 'status' => LOGIN_ERROR_ACTIVE, + 'error_msg' => 'ACTIVE_ERROR', + 'user_row' => $row, + ); + } + + // Successful login... set user_login_attempts to zero... + return array( + 'status' => LOGIN_SUCCESS, + 'error_msg' => false, + 'user_row' => $row, + ); + } + else + { + // retrieve default group id + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = '" . $this->db->sql_escape('REGISTERED') . "' + AND group_type = " . GROUP_SPECIAL; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (!$row) + { + trigger_error('NO_GROUP'); + } + + // generate user account data + $ldap_user_row = array( + 'username' => $username, + 'user_password' => $this->passwords_manager->hash($password), + 'user_email' => (!empty($this->config['ldap_email'])) ? utf8_htmlspecialchars($ldap_result[0][htmlspecialchars_decode($this->config['ldap_email'])][0]) : '', + 'group_id' => (int) $row['group_id'], + 'user_type' => USER_NORMAL, + 'user_ip' => $this->user->ip, + 'user_new' => ($this->config['new_member_post_limit']) ? 1 : 0, + ); + + unset($ldap_result); + + // this is the user's first login so create an empty profile + return array( + 'status' => LOGIN_SUCCESS_CREATE_PROFILE, + 'error_msg' => false, + 'user_row' => $ldap_user_row, + ); + } + } + else + { + unset($ldap_result); + @ldap_close($ldap); + + // Give status about wrong password... + return array( + 'status' => LOGIN_ERROR_PASSWORD, + 'error_msg' => 'LOGIN_ERROR_PASSWORD', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + } + + @ldap_close($ldap); + + return array( + 'status' => LOGIN_ERROR_USERNAME, + 'error_msg' => 'LOGIN_ERROR_USERNAME', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + /** + * {@inheritdoc} + */ + + public function acp() + { + // These are fields required in the config table + return array( + 'ldap_server', 'ldap_port', 'ldap_base_dn', 'ldap_uid', 'ldap_user_filter', 'ldap_email', 'ldap_user', 'ldap_password', + ); + } + + /** + * {@inheritdoc} + */ + public function get_acp_template($new_config) + { + return array( + 'TEMPLATE_FILE' => 'auth_provider_ldap.html', + 'TEMPLATE_VARS' => array( + 'AUTH_LDAP_DN' => $new_config['ldap_base_dn'], + 'AUTH_LDAP_EMAIL' => $new_config['ldap_email'], + 'AUTH_LDAP_PASSORD' => $new_config['ldap_password'], + 'AUTH_LDAP_PORT' => $new_config['ldap_port'], + 'AUTH_LDAP_SERVER' => $new_config['ldap_server'], + 'AUTH_LDAP_UID' => $new_config['ldap_uid'], + 'AUTH_LDAP_USER' => $new_config['ldap_user'], + 'AUTH_LDAP_USER_FILTER' => $new_config['ldap_user_filter'], + ), + ); + } + + /** + * Generates a filter string for ldap_search to find a user + * + * @param $username string Username identifying the searched user + * + * @return string A filter string for ldap_search + */ + private function ldap_user_filter($username) + { + $filter = '(' . $this->config['ldap_uid'] . '=' . $this->ldap_escape(htmlspecialchars_decode($username)) . ')'; + if ($this->config['ldap_user_filter']) + { + $_filter = ($this->config['ldap_user_filter'][0] == '(' && substr($this->config['ldap_user_filter'], -1) == ')') ? $this->config['ldap_user_filter'] : "({$this->config['ldap_user_filter']})"; + $filter = "(&{$filter}{$_filter})"; + } + return $filter; + } + + /** + * Escapes an LDAP AttributeValue + * + * @param string $string The string to be escaped + * @return string The escaped string + */ + private function ldap_escape($string) + { + return str_replace(array('*', '\\', '(', ')'), array('\\*', '\\\\', '\\(', '\\)'), $string); + } +} diff --git a/sources/phpBB/phpbb/auth/provider/oauth/oauth.php b/sources/phpBB/phpbb/auth/provider/oauth/oauth.php new file mode 100644 index 0000000..c0ce3f1 --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -0,0 +1,630 @@ + +* @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\auth\provider\oauth; + +use OAuth\Common\Consumer\Credentials; + +/** +* OAuth authentication provider for phpBB3 +*/ +class oauth extends \phpbb\auth\provider\base +{ + /** + * Database driver + * + * @var \phpbb\db\driver\driver_interface + */ + protected $db; + + /** + * phpBB config + * + * @var \phpbb\config\config + */ + protected $config; + + /** + * phpBB passwords manager + * + * @var \phpbb\passwords\manager + */ + protected $passwords_manager; + + /** + * phpBB request object + * + * @var \phpbb\request\request_interface + */ + protected $request; + + /** + * phpBB user + * + * @var \phpbb\user + */ + protected $user; + + /** + * OAuth token table + * + * @var string + */ + protected $auth_provider_oauth_token_storage_table; + + /** + * OAuth account association table + * + * @var string + */ + protected $auth_provider_oauth_token_account_assoc; + + /** + * All OAuth service providers + * + * @var \phpbb\di\service_collection Contains \phpbb\auth\provider\oauth\service_interface + */ + protected $service_providers; + + /** + * Users table + * + * @var string + */ + protected $users_table; + + /** + * Cached current uri object + * + * @var \OAuth\Common\Http\Uri\UriInterface|null + */ + protected $current_uri; + + /** + * DI container + * + * @var \Symfony\Component\DependencyInjection\ContainerInterface + */ + protected $phpbb_container; + + /** + * phpBB root path + * + * @var string + */ + protected $phpbb_root_path; + + /** + * PHP file extension + * + * @var string + */ + protected $php_ext; + + /** + * OAuth Authentication Constructor + * + * @param \phpbb\db\driver\driver_interface $db + * @param \phpbb\config\config $config + * @param \phpbb\passwords\manager $passwords_manager + * @param \phpbb\request\request_interface $request + * @param \phpbb\user $user + * @param string $auth_provider_oauth_token_storage_table + * @param string $auth_provider_oauth_token_account_assoc + * @param \phpbb\di\service_collection $service_providers Contains \phpbb\auth\provider\oauth\service_interface + * @param string $users_table + * @param \Symfony\Component\DependencyInjection\ContainerInterface $phpbb_container DI container + * @param string $phpbb_root_path + * @param string $php_ext + */ + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\request\request_interface $request, \phpbb\user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_token_account_assoc, \phpbb\di\service_collection $service_providers, $users_table, \Symfony\Component\DependencyInjection\ContainerInterface $phpbb_container, $phpbb_root_path, $php_ext) + { + $this->db = $db; + $this->config = $config; + $this->passwords_manager = $passwords_manager; + $this->request = $request; + $this->user = $user; + $this->auth_provider_oauth_token_storage_table = $auth_provider_oauth_token_storage_table; + $this->auth_provider_oauth_token_account_assoc = $auth_provider_oauth_token_account_assoc; + $this->service_providers = $service_providers; + $this->users_table = $users_table; + $this->phpbb_container = $phpbb_container; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + } + + /** + * {@inheritdoc} + */ + public function init() + { + // This does not test whether or not the key and secret provided are valid. + foreach ($this->service_providers as $service_provider) + { + $credentials = $service_provider->get_service_credentials(); + + if (($credentials['key'] && !$credentials['secret']) || (!$credentials['key'] && $credentials['secret'])) + { + return $this->user->lang['AUTH_PROVIDER_OAUTH_ERROR_ELEMENT_MISSING']; + } + } + return false; + } + + /** + * {@inheritdoc} + */ + public function login($username, $password) + { + // Temporary workaround for only having one authentication provider available + if (!$this->request->is_set('oauth_service')) + { + $provider = new \phpbb\auth\provider\db($this->db, $this->config, $this->passwords_manager, $this->request, $this->user, $this->phpbb_container, $this->phpbb_root_path, $this->php_ext); + return $provider->login($username, $password); + } + + // Requst the name of the OAuth service + $service_name_original = $this->request->variable('oauth_service', '', false); + $service_name = 'auth.provider.oauth.service.' . strtolower($service_name_original); + if ($service_name_original === '' || !array_key_exists($service_name, $this->service_providers)) + { + return array( + 'status' => LOGIN_ERROR_EXTERNAL_AUTH, + 'error_msg' => 'LOGIN_ERROR_OAUTH_SERVICE_DOES_NOT_EXIST', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + // Get the service credentials for the given service + $service_credentials = $this->service_providers[$service_name]->get_service_credentials(); + + $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table); + $query = 'mode=login&login=external&oauth_service=' . $service_name_original; + $service = $this->get_service($service_name_original, $storage, $service_credentials, $query, $this->service_providers[$service_name]->get_auth_scope()); + + if ($this->request->is_set('code', \phpbb\request\request_interface::GET)) + { + $this->service_providers[$service_name]->set_external_service_provider($service); + $unique_id = $this->service_providers[$service_name]->perform_auth_login(); + + // Check to see if this provider is already assosciated with an account + $data = array( + 'provider' => $service_name_original, + 'oauth_provider_id' => $unique_id + ); + $sql = 'SELECT user_id FROM ' . $this->auth_provider_oauth_token_account_assoc . ' + WHERE ' . $this->db->sql_build_array('SELECT', $data); + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (!$row) + { + // The user does not yet exist, ask to link or create profile + return array( + 'status' => LOGIN_SUCCESS_LINK_PROFILE, + 'error_msg' => 'LOGIN_OAUTH_ACCOUNT_NOT_LINKED', + 'user_row' => array(), + 'redirect_data' => array( + 'auth_provider' => 'oauth', + 'login_link_oauth_service' => $service_name_original, + ), + ); + } + + // Retrieve the user's account + $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type, user_login_attempts + FROM ' . $this->users_table . ' + WHERE user_id = ' . (int) $row['user_id']; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (!$row) + { + throw new \Exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_ENTRY'); + } + + // Update token storage to store the user_id + $storage->set_user_id($row['user_id']); + + // The user is now authenticated and can be logged in + return array( + 'status' => LOGIN_SUCCESS, + 'error_msg' => false, + 'user_row' => $row, + ); + } + else + { + $url = $service->getAuthorizationUri(); + header('Location: ' . $url); + } + } + + /** + * Returns the cached current_uri object or creates and caches it if it is + * not already created. In each case the query string is updated based on + * the $query parameter. + * + * @param string $service_name The name of the service + * @param string $query The query string of the current_uri + * used in redirects + * @return \OAuth\Common\Http\Uri\UriInterface + */ + protected function get_current_uri($service_name, $query) + { + if ($this->current_uri) + { + $this->current_uri->setQuery($query); + return $this->current_uri; + } + + $uri_factory = new \OAuth\Common\Http\Uri\UriFactory(); + $current_uri = $uri_factory->createFromSuperGlobalArray($this->request->get_super_global(\phpbb\request\request_interface::SERVER)); + $current_uri->setQuery($query); + + $this->current_uri = $current_uri; + return $current_uri; + } + + /** + * Returns a new service object + * + * @param string $service_name The name of the service + * @param \phpbb\auth\provider\oauth\token_storage $storage + * @param array $service_credentials {@see \phpbb\auth\provider\oauth\oauth::get_service_credentials} + * @param string $query The query string of the + * current_uri used in redirection + * @param array $scopes The scope of the request against + * the api. + * @return \OAuth\Common\Service\ServiceInterface + * @throws \Exception + */ + protected function get_service($service_name, \phpbb\auth\provider\oauth\token_storage $storage, array $service_credentials, $query, array $scopes = array()) + { + $current_uri = $this->get_current_uri($service_name, $query); + + // Setup the credentials for the requests + $credentials = new Credentials( + $service_credentials['key'], + $service_credentials['secret'], + $current_uri->getAbsoluteUri() + ); + + $service_factory = new \OAuth\ServiceFactory(); + $service = $service_factory->createService($service_name, $credentials, $storage, $scopes); + + if (!$service) + { + throw new \Exception('AUTH_PROVIDER_OAUTH_ERROR_SERVICE_NOT_CREATED'); + } + + return $service; + } + + /** + * {@inheritdoc} + */ + public function get_login_data() + { + $login_data = array( + 'TEMPLATE_FILE' => 'login_body_oauth.html', + 'BLOCK_VAR_NAME' => 'oauth', + 'BLOCK_VARS' => array(), + ); + + foreach ($this->service_providers as $service_name => $service_provider) + { + // Only include data if the credentials are set + $credentials = $service_provider->get_service_credentials(); + if ($credentials['key'] && $credentials['secret']) + { + $actual_name = str_replace('auth.provider.oauth.service.', '', $service_name); + $redirect_url = build_url(false) . '&login=external&oauth_service=' . $actual_name; + $login_data['BLOCK_VARS'][$service_name] = array( + 'REDIRECT_URL' => redirect($redirect_url, true), + 'SERVICE_NAME' => $this->user->lang['AUTH_PROVIDER_OAUTH_SERVICE_' . strtoupper($actual_name)], + ); + } + } + + return $login_data; + } + + /** + * {@inheritdoc} + */ + public function acp() + { + $ret = array(); + + foreach ($this->service_providers as $service_name => $service_provider) + { + $actual_name = str_replace('auth.provider.oauth.service.', '', $service_name); + $ret[] = 'auth_oauth_' . $actual_name . '_key'; + $ret[] = 'auth_oauth_' . $actual_name . '_secret'; + } + + return $ret; + } + + /** + * {@inheritdoc} + */ + public function get_acp_template($new_config) + { + $ret = array( + 'BLOCK_VAR_NAME' => 'oauth_services', + 'BLOCK_VARS' => array(), + 'TEMPLATE_FILE' => 'auth_provider_oauth.html', + 'TEMPLATE_VARS' => array(), + ); + + foreach ($this->service_providers as $service_name => $service_provider) + { + $actual_name = str_replace('auth.provider.oauth.service.', '', $service_name); + $ret['BLOCK_VARS'][$actual_name] = array( + 'ACTUAL_NAME' => $this->user->lang['AUTH_PROVIDER_OAUTH_SERVICE_' . strtoupper($actual_name)], + 'KEY' => $new_config['auth_oauth_' . $actual_name . '_key'], + 'NAME' => $actual_name, + 'SECRET' => $new_config['auth_oauth_' . $actual_name . '_secret'], + ); + } + + return $ret; + } + + /** + * {@inheritdoc} + */ + public function login_link_has_necessary_data($login_link_data) + { + if (empty($login_link_data)) + { + return 'LOGIN_LINK_NO_DATA_PROVIDED'; + } + + if (!array_key_exists('oauth_service', $login_link_data) || !$login_link_data['oauth_service'] || + !array_key_exists('link_method', $login_link_data) || !$login_link_data['link_method']) + { + return 'LOGIN_LINK_MISSING_DATA'; + } + + return null; + } + + /** + * {@inheritdoc} + */ + public function link_account(array $link_data) + { + // Check for a valid link method (auth_link or login_link) + if (!array_key_exists('link_method', $link_data) || + !in_array($link_data['link_method'], array( + 'auth_link', + 'login_link', + ))) + { + return 'LOGIN_LINK_MISSING_DATA'; + } + + // We must have an oauth_service listed, check for it two ways + if (!array_key_exists('oauth_service', $link_data) || !$link_data['oauth_service']) + { + $link_data['oauth_service'] = $this->request->variable('oauth_service', ''); + + if (!$link_data['oauth_service']) + { + return 'LOGIN_LINK_MISSING_DATA'; + } + } + + $service_name = 'auth.provider.oauth.service.' . strtolower($link_data['oauth_service']); + if (!array_key_exists($service_name, $this->service_providers)) + { + return 'LOGIN_ERROR_OAUTH_SERVICE_DOES_NOT_EXIST'; + } + + switch ($link_data['link_method']) + { + case 'auth_link': + return $this->link_account_auth_link($link_data, $service_name); + case 'login_link': + return $this->link_account_login_link($link_data, $service_name); + } + } + + /** + * Performs the account linking for login_link + * + * @param array $link_data The same variable given to {@see \phpbb\auth\provider\provider_interface::link_account} + * @param string $service_name The name of the service being used in + * linking. + * @return string|null Returns a language constant (string) if an error is + * encountered, or null on success. + */ + protected function link_account_login_link(array $link_data, $service_name) + { + $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table); + + // Check for an access token, they should have one + if (!$storage->has_access_token_by_session($service_name)) + { + return 'LOGIN_LINK_ERROR_OAUTH_NO_ACCESS_TOKEN'; + } + + // Prepare the query string + $query = 'mode=login_link&login_link_oauth_service=' . strtolower($link_data['oauth_service']); + + // Prepare for an authentication request + $service_credentials = $this->service_providers[$service_name]->get_service_credentials(); + $scopes = $this->service_providers[$service_name]->get_auth_scope(); + $service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $query, $scopes); + $this->service_providers[$service_name]->set_external_service_provider($service); + + // The user has already authenticated successfully, request to authenticate again + $unique_id = $this->service_providers[$service_name]->perform_token_auth(); + + // Insert into table, they will be able to log in after this + $data = array( + 'user_id' => $link_data['user_id'], + 'provider' => strtolower($link_data['oauth_service']), + 'oauth_provider_id' => $unique_id, + ); + + $this->link_account_perform_link($data); + // Update token storage to store the user_id + $storage->set_user_id($link_data['user_id']); + } + + /** + * Performs the account linking for auth_link + * + * @param array $link_data The same variable given to {@see \phpbb\auth\provider\provider_interface::link_account} + * @param string $service_name The name of the service being used in + * linking. + * @return string|null Returns a language constant (string) if an error is + * encountered, or null on success. + */ + protected function link_account_auth_link(array $link_data, $service_name) + { + $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table); + $query = 'i=ucp_auth_link&mode=auth_link&link=1&oauth_service=' . strtolower($link_data['oauth_service']); + $service_credentials = $this->service_providers[$service_name]->get_service_credentials(); + $scopes = $this->service_providers[$service_name]->get_auth_scope(); + $service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $query, $scopes); + + if ($this->request->is_set('code', \phpbb\request\request_interface::GET)) + { + $this->service_providers[$service_name]->set_external_service_provider($service); + $unique_id = $this->service_providers[$service_name]->perform_auth_login(); + + // Insert into table, they will be able to log in after this + $data = array( + 'user_id' => $this->user->data['user_id'], + 'provider' => strtolower($link_data['oauth_service']), + 'oauth_provider_id' => $unique_id, + ); + + $this->link_account_perform_link($data); + } + else + { + $url = $service->getAuthorizationUri(); + header('Location: ' . $url); + } + } + + /** + * Performs the query that inserts an account link + * + * @param array $data This array is passed to db->sql_build_array + */ + protected function link_account_perform_link(array $data) + { + $sql = 'INSERT INTO ' . $this->auth_provider_oauth_token_account_assoc . ' + ' . $this->db->sql_build_array('INSERT', $data); + $this->db->sql_query($sql); + } + + /** + * {@inheritdoc} + */ + public function logout($data, $new_session) + { + // Clear all tokens belonging to the user + $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table); + $storage->clearAllTokens(); + + return; + } + + /** + * {@inheritdoc} + */ + public function get_auth_link_data() + { + $block_vars = array(); + + // Get all external accounts tied to the current user + $data = array( + 'user_id' => (int) $this->user->data['user_id'], + ); + $sql = 'SELECT oauth_provider_id, provider FROM ' . $this->auth_provider_oauth_token_account_assoc . ' + WHERE ' . $this->db->sql_build_array('SELECT', $data); + $result = $this->db->sql_query($sql); + $rows = $this->db->sql_fetchrowset($result); + $this->db->sql_freeresult($result); + + $oauth_user_ids = array(); + + if ($rows !== false && sizeof($rows)) + { + foreach ($rows as $row) + { + $oauth_user_ids[$row['provider']] = $row['oauth_provider_id']; + } + } + unset($rows); + + foreach ($this->service_providers as $service_name => $service_provider) + { + // Only include data if the credentials are set + $credentials = $service_provider->get_service_credentials(); + if ($credentials['key'] && $credentials['secret']) + { + $actual_name = str_replace('auth.provider.oauth.service.', '', $service_name); + + $block_vars[$service_name] = array( + 'HIDDEN_FIELDS' => array( + 'link' => (!isset($oauth_user_ids[$actual_name])), + 'oauth_service' => $actual_name, + ), + + 'SERVICE_NAME' => $this->user->lang['AUTH_PROVIDER_OAUTH_SERVICE_' . strtoupper($actual_name)], + 'UNIQUE_ID' => (isset($oauth_user_ids[$actual_name])) ? $oauth_user_ids[$actual_name] : null, + ); + } + } + + return array( + 'BLOCK_VAR_NAME' => 'oauth', + 'BLOCK_VARS' => $block_vars, + + 'TEMPLATE_FILE' => 'ucp_auth_link_oauth.html', + ); + } + + /** + * {@inheritdoc} + */ + public function unlink_account(array $link_data) + { + if (!array_key_exists('oauth_service', $link_data) || !$link_data['oauth_service']) + { + return 'LOGIN_LINK_MISSING_DATA'; + } + + // Remove the link + $sql = 'DELETE FROM ' . $this->auth_provider_oauth_token_account_assoc . " + WHERE provider = '" . $this->db->sql_escape($link_data['oauth_service']) . "' + AND user_id = " . (int) $this->user->data['user_id']; + $this->db->sql_query($sql); + + // Clear all tokens belonging to the user on this servce + $service_name = 'auth.provider.oauth.service.' . strtolower($link_data['oauth_service']); + $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table); + $storage->clearToken($service_name); + } +} diff --git a/sources/phpBB/phpbb/auth/provider/oauth/service/base.php b/sources/phpBB/phpbb/auth/provider/oauth/service/base.php new file mode 100644 index 0000000..6adf64a --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider/oauth/service/base.php @@ -0,0 +1,51 @@ + +* @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\auth\provider\oauth\service; + +/** +* Base OAuth abstract class that all OAuth services should implement +*/ +abstract class base implements \phpbb\auth\provider\oauth\service\service_interface +{ + /** + * External OAuth service provider + * + * @var \OAuth\Common\Service\ServiceInterface + */ + protected $service_provider; + + /** + * {@inheritdoc} + */ + public function get_external_service_provider() + { + return $this->service_provider; + } + + /** + * {@inheritdoc} + */ + public function get_auth_scope() + { + return array(); + } + + /** + * {@inheritdoc} + */ + public function set_external_service_provider(\OAuth\Common\Service\ServiceInterface $service_provider) + { + $this->service_provider = $service_provider; + } +} diff --git a/sources/phpBB/phpbb/auth/provider/oauth/service/bitly.php b/sources/phpBB/phpbb/auth/provider/oauth/service/bitly.php new file mode 100644 index 0000000..25e731a --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider/oauth/service/bitly.php @@ -0,0 +1,94 @@ + +* @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\auth\provider\oauth\service; + +/** +* Bitly OAuth service +*/ +class bitly extends \phpbb\auth\provider\oauth\service\base +{ + /** + * phpBB config + * + * @var \phpbb\config\config + */ + protected $config; + + /** + * phpBB request + * + * @var \phpbb\request\request_interface + */ + protected $request; + + /** + * Constructor + * + * @param \phpbb\config\config $config + * @param \phpbb\request\request_interface $request + */ + public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request) + { + $this->config = $config; + $this->request = $request; + } + + /** + * {@inheritdoc} + */ + public function get_service_credentials() + { + return array( + 'key' => $this->config['auth_oauth_bitly_key'], + 'secret' => $this->config['auth_oauth_bitly_secret'], + ); + } + + /** + * {@inheritdoc} + */ + public function perform_auth_login() + { + if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Bitly)) + { + throw new \phpbb\auth\provider\oauth\service\exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); + } + + // This was a callback request from bitly, get the token + $this->service_provider->requestAccessToken($this->request->variable('code', '')); + + // Send a request with it + $result = json_decode($this->service_provider->request('user/info'), true); + + // Return the unique identifier returned from bitly + return $result['data']['login']; + } + + /** + * {@inheritdoc} + */ + public function perform_token_auth() + { + if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Bitly)) + { + throw new \phpbb\auth\provider\oauth\service\exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); + } + + // Send a request with it + $result = json_decode($this->service_provider->request('user/info'), true); + + // Return the unique identifier returned from bitly + return $result['data']['login']; + } +} diff --git a/sources/phpBB/phpbb/auth/provider/oauth/service/exception.php b/sources/phpBB/phpbb/auth/provider/oauth/service/exception.php new file mode 100644 index 0000000..d3e95be --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider/oauth/service/exception.php @@ -0,0 +1,21 @@ + +* @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\auth\provider\oauth\service; + +/** +* OAuth service exception class +*/ +class exception extends \RuntimeException +{ +} diff --git a/sources/phpBB/phpbb/auth/provider/oauth/service/facebook.php b/sources/phpBB/phpbb/auth/provider/oauth/service/facebook.php new file mode 100644 index 0000000..bb98835 --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider/oauth/service/facebook.php @@ -0,0 +1,94 @@ + +* @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\auth\provider\oauth\service; + +/** +* Facebook OAuth service +*/ +class facebook extends base +{ + /** + * phpBB config + * + * @var \phpbb\config\config + */ + protected $config; + + /** + * phpBB request + * + * @var \phpbb\request\request_interface + */ + protected $request; + + /** + * Constructor + * + * @param \phpbb\config\config $config + * @param \phpbb\request\request_interface $request + */ + public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request) + { + $this->config = $config; + $this->request = $request; + } + + /** + * {@inheritdoc} + */ + public function get_service_credentials() + { + return array( + 'key' => $this->config['auth_oauth_facebook_key'], + 'secret' => $this->config['auth_oauth_facebook_secret'], + ); + } + + /** + * {@inheritdoc} + */ + public function perform_auth_login() + { + if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook)) + { + throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); + } + + // This was a callback request, get the token + $this->service_provider->requestAccessToken($this->request->variable('code', '')); + + // Send a request with it + $result = json_decode($this->service_provider->request('/me'), true); + + // Return the unique identifier + return $result['id']; + } + + /** + * {@inheritdoc} + */ + public function perform_token_auth() + { + if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook)) + { + throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); + } + + // Send a request with it + $result = json_decode($this->service_provider->request('/me'), true); + + // Return the unique identifier + return $result['id']; + } +} diff --git a/sources/phpBB/phpbb/auth/provider/oauth/service/google.php b/sources/phpBB/phpbb/auth/provider/oauth/service/google.php new file mode 100644 index 0000000..cb9f83a --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider/oauth/service/google.php @@ -0,0 +1,105 @@ + +* @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\auth\provider\oauth\service; + +/** +* Google OAuth service +*/ +class google extends base +{ + /** + * phpBB config + * + * @var \phpbb\config\config + */ + protected $config; + + /** + * phpBB request + * + * @var \phpbb\request\request_interface + */ + protected $request; + + /** + * Constructor + * + * @param \phpbb\config\config $config + * @param \phpbb\request\request_interface $request + */ + public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request) + { + $this->config = $config; + $this->request = $request; + } + + /** + * {@inheritdoc} + */ + public function get_auth_scope() + { + return array( + 'userinfo_email', + 'userinfo_profile', + ); + } + + /** + * {@inheritdoc} + */ + public function get_service_credentials() + { + return array( + 'key' => $this->config['auth_oauth_google_key'], + 'secret' => $this->config['auth_oauth_google_secret'], + ); + } + + /** + * {@inheritdoc} + */ + public function perform_auth_login() + { + if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Google)) + { + throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); + } + + // This was a callback request, get the token + $this->service_provider->requestAccessToken($this->request->variable('code', '')); + + // Send a request with it + $result = json_decode($this->service_provider->request('https://www.googleapis.com/oauth2/v1/userinfo'), true); + + // Return the unique identifier + return $result['id']; + } + + /** + * {@inheritdoc} + */ + public function perform_token_auth() + { + if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Google)) + { + throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); + } + + // Send a request with it + $result = json_decode($this->service_provider->request('https://www.googleapis.com/oauth2/v1/userinfo'), true); + + // Return the unique identifier + return $result['id']; + } +} diff --git a/sources/phpBB/phpbb/auth/provider/oauth/service/service_interface.php b/sources/phpBB/phpbb/auth/provider/oauth/service/service_interface.php new file mode 100644 index 0000000..e84eb24 --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider/oauth/service/service_interface.php @@ -0,0 +1,73 @@ + +* @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\auth\provider\oauth\service; + +/** +* OAuth service interface +*/ +interface service_interface +{ + /** + * Returns an array of the scopes necessary for auth + * + * @return array An array of the required scopes + */ + public function get_auth_scope(); + + /** + * Returns the external library service provider once it has been set + * + * @param \OAuth\Common\Service\ServiceInterface|null + */ + public function get_external_service_provider(); + + /** + * Returns an array containing the service credentials belonging to requested + * service. + * + * @return array An array containing the 'key' and the 'secret' of the + * service in the form: + * array( + * 'key' => string + * 'secret' => string + * ) + */ + public function get_service_credentials(); + + /** + * Returns the results of the authentication in json format + * + * @throws \phpbb\auth\provider\oauth\service\exception + * @return string The unique identifier returned by the service provider + * that is used to authenticate the user with phpBB. + */ + public function perform_auth_login(); + + /** + * Returns the results of the authentication in json format + * Use this function when the user already has an access token + * + * @throws \phpbb\auth\provider\oauth\service\exception + * @return string The unique identifier returned by the service provider + * that is used to authenticate the user with phpBB. + */ + public function perform_token_auth(); + + /** + * Sets the external library service provider + * + * @param \OAuth\Common\Service\ServiceInterface $service_provider + */ + public function set_external_service_provider(\OAuth\Common\Service\ServiceInterface $service_provider); +} diff --git a/sources/phpBB/phpbb/auth/provider/oauth/token_storage.php b/sources/phpBB/phpbb/auth/provider/oauth/token_storage.php new file mode 100644 index 0000000..023cf40 --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider/oauth/token_storage.php @@ -0,0 +1,363 @@ + +* @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\auth\provider\oauth; + + +use OAuth\OAuth1\Token\StdOAuth1Token; +use OAuth\Common\Token\TokenInterface; +use OAuth\Common\Storage\TokenStorageInterface; +use OAuth\Common\Storage\Exception\TokenNotFoundException; + +/** +* OAuth storage wrapper for phpbb's cache +*/ +class token_storage implements TokenStorageInterface +{ + /** + * Cache driver. + * + * @var \phpbb\db\driver\driver_interface + */ + protected $db; + + /** + * phpBB user + * + * @var \phpbb\user + */ + protected $user; + + /** + * OAuth token table + * + * @var string + */ + protected $auth_provider_oauth_table; + + /** + * @var object|TokenInterface + */ + protected $cachedToken; + + /** + * Creates token storage for phpBB. + * + * @param \phpbb\db\driver\driver_interface $db + * @param \phpbb\user $user + * @param string $auth_provider_oauth_table + */ + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, $auth_provider_oauth_table) + { + $this->db = $db; + $this->user = $user; + $this->auth_provider_oauth_table = $auth_provider_oauth_table; + } + + /** + * {@inheritdoc} + */ + public function retrieveAccessToken($service) + { + $service = $this->get_service_name_for_db($service); + + if ($this->cachedToken instanceof TokenInterface) + { + return $this->cachedToken; + } + + $data = array( + 'user_id' => (int) $this->user->data['user_id'], + 'provider' => $service, + ); + + if ((int) $this->user->data['user_id'] === ANONYMOUS) + { + $data['session_id'] = $this->user->data['session_id']; + } + + return $this->_retrieve_access_token($data); + } + + /** + * {@inheritdoc} + */ + public function storeAccessToken($service, TokenInterface $token) + { + $service = $this->get_service_name_for_db($service); + + $this->cachedToken = $token; + + $data = array( + 'user_id' => (int) $this->user->data['user_id'], + 'provider' => $service, + 'oauth_token' => $this->json_encode_token($token), + 'session_id' => $this->user->data['session_id'], + ); + + $sql = 'INSERT INTO ' . $this->auth_provider_oauth_table . ' + ' . $this->db->sql_build_array('INSERT', $data); + $this->db->sql_query($sql); + } + + /** + * {@inheritdoc} + */ + public function hasAccessToken($service) + { + $service = $this->get_service_name_for_db($service); + + if ($this->cachedToken) { + return true; + } + + $data = array( + 'user_id' => (int) $this->user->data['user_id'], + 'provider' => $service, + ); + + if ((int) $this->user->data['user_id'] === ANONYMOUS) + { + $data['session_id'] = $this->user->data['session_id']; + } + + return $this->_has_acess_token($data); + } + + /** + * {@inheritdoc} + */ + public function clearToken($service) + { + $service = $this->get_service_name_for_db($service); + + $this->cachedToken = null; + + $sql = 'DELETE FROM ' . $this->auth_provider_oauth_table . ' + WHERE user_id = ' . (int) $this->user->data['user_id'] . " + AND provider = '" . $this->db->sql_escape($service) . "'"; + + if ((int) $this->user->data['user_id'] === ANONYMOUS) + { + $sql .= " AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'"; + } + + $this->db->sql_query($sql); + } + + /** + * {@inheritdoc} + */ + public function clearAllTokens() + { + $this->cachedToken = null; + + $sql = 'DELETE FROM ' . $this->auth_provider_oauth_table . ' + WHERE user_id = ' . (int) $this->user->data['user_id']; + + if ((int) $this->user->data['user_id'] === ANONYMOUS) + { + $sql .= " AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'"; + } + + $this->db->sql_query($sql); + } + + /** + * Updates the user_id field in the database assosciated with the token + * + * @param int $user_id + */ + public function set_user_id($user_id) + { + if (!$this->cachedToken) + { + return; + } + + $sql = 'UPDATE ' . $this->auth_provider_oauth_table . ' + SET ' . $this->db->sql_build_array('UPDATE', array( + 'user_id' => (int) $user_id + )) . ' + WHERE user_id = ' . (int) $this->user->data['user_id'] . " + AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'"; + $this->db->sql_query($sql); + } + + /** + * Checks to see if an access token exists solely by the session_id of the user + * + * @param string $service The name of the OAuth service + * @return bool true if they have token, false if they don't + */ + public function has_access_token_by_session($service) + { + $service = $this->get_service_name_for_db($service); + + if ($this->cachedToken) + { + return true; + } + + $data = array( + 'session_id' => $this->user->data['session_id'], + 'provider' => $service, + ); + + return $this->_has_acess_token($data); + } + + /** + * A helper function that performs the query for has access token functions + * + * @param array $data + * @return bool + */ + protected function _has_acess_token($data) + { + return (bool) $this->get_access_token_row($data); + } + + public function retrieve_access_token_by_session($service) + { + $service = $this->get_service_name_for_db($service); + + if ($this->cachedToken instanceof TokenInterface) { + return $this->cachedToken; + } + + $data = array( + 'session_id' => $this->user->data['session_id'], + 'provider' => $service, + ); + + return $this->_retrieve_access_token($data); + } + + /** + * A helper function that performs the query for retrieve access token functions + * Also checks if the token is a valid token + * + * @param array $data + * @return mixed + * @throws \OAuth\Common\Storage\Exception\TokenNotFoundException + */ + protected function _retrieve_access_token($data) + { + $row = $this->get_access_token_row($data); + + if (!$row) + { + throw new TokenNotFoundException('AUTH_PROVIDER_OAUTH_TOKEN_ERROR_NOT_STORED'); + } + + $token = $this->json_decode_token($row['oauth_token']); + + // Ensure that the token was serialized/unserialized correctly + if (!($token instanceof TokenInterface)) + { + $this->clearToken($data['provider']); + throw new TokenNotFoundException('AUTH_PROVIDER_OAUTH_TOKEN_ERROR_INCORRECTLY_STORED'); + } + + $this->cachedToken = $token; + return $token; + } + + /** + * A helper function that performs the query for retrieving an access token + * + * @param array $data + * @return mixed + */ + protected function get_access_token_row($data) + { + $sql = 'SELECT oauth_token FROM ' . $this->auth_provider_oauth_table . ' + WHERE ' . $this->db->sql_build_array('SELECT', $data); + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + return $row; + } + + public function json_encode_token(TokenInterface $token) + { + $members = array( + 'accessToken' => $token->getAccessToken(), + 'endOfLife' => $token->getEndOfLife(), + 'extraParams' => $token->getExtraParams(), + 'refreshToken' => $token->getRefreshToken(), + + 'token_class' => get_class($token), + ); + + // Handle additional data needed for OAuth1 tokens + if ($token instanceof StdOAuth1Token) + { + $members['requestToken'] = $token->getRequestToken(); + $members['requestTokenSecret'] = $token->getRequestTokenSecret(); + $members['accessTokenSecret'] = $token->getAccessTokenSecret(); + } + + return json_encode($members); + } + + public function json_decode_token($json) + { + $token_data = json_decode($json, true); + + if ($token_data === null) + { + throw new TokenNotFoundException('AUTH_PROVIDER_OAUTH_TOKEN_ERROR_INCORRECTLY_STORED'); + } + + $token_class = $token_data['token_class']; + $access_token = $token_data['accessToken']; + $refresh_token = $token_data['refreshToken']; + $endOfLife = $token_data['endOfLife']; + $extra_params = $token_data['extraParams']; + + // Create the token + $token = new $token_class($access_token, $refresh_token, TokenInterface::EOL_NEVER_EXPIRES, $extra_params); + $token->setEndOfLife($endOfLife); + + // Handle OAuth 1.0 specific elements + if ($token instanceof StdOAuth1Token) + { + $token->setRequestToken($token_data['requestToken']); + $token->setRequestTokenSecret($token_data['requestTokenSecret']); + $token->setAccessTokenSecret($token_data['accessTokenSecret']); + } + + return $token; + } + + /** + * Returns the name of the service as it must be stored in the database. + * + * @param string $service The name of the OAuth service + * @return string The name of the OAuth service as it needs to be stored + * in the database. + */ + protected function get_service_name_for_db($service) + { + // Enforce the naming convention for oauth services + if (strpos($service, 'auth.provider.oauth.service.') !== 0) + { + $service = 'auth.provider.oauth.service.' . strtolower($service); + } + + return $service; + } +} diff --git a/sources/phpBB/phpbb/auth/provider/provider_interface.php b/sources/phpBB/phpbb/auth/provider/provider_interface.php new file mode 100644 index 0000000..613297c --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider/provider_interface.php @@ -0,0 +1,193 @@ + +* @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\auth\provider; + +/** +* The interface authentication provider classes have to implement. +*/ +interface provider_interface +{ + /** + * Checks whether the user is currently identified to the authentication + * provider. + * Called in acp_board while setting authentication plugins. + * Changing to an authentication provider will not be permitted in acp_board + * if there is an error. + * + * @return boolean|string False if the user is identified, otherwise an + * error message, or null if not implemented. + */ + public function init(); + + /** + * Performs login. + * + * @param string $username The name of the user being authenticated. + * @param string $password The password of the user. + * @return array An associative array of the format: + * array( + * 'status' => status constant + * 'error_msg' => string + * 'user_row' => array + * ) + * A fourth key of the array may be present: + * 'redirect_data' This key is only used when 'status' is + * equal to LOGIN_SUCCESS_LINK_PROFILE and its value is an + * associative array that is turned into GET variables on + * the redirect url. + */ + public function login($username, $password); + + /** + * Autologin function + * + * @return array|null containing the user row, empty if no auto login + * should take place, or null if not impletmented. + */ + public function autologin(); + + /** + * This function is used to output any required fields in the authentication + * admin panel. It also defines any required configuration table fields. + * + * @return array|null Returns null if not implemented or an array of the + * configuration fields of the provider. + */ + public function acp(); + + /** + * This function updates the template with variables related to the acp + * options with whatever configuraton values are passed to it as an array. + * It then returns the name of the acp file related to this authentication + * provider. + * @param array $new_config Contains the new configuration values that + * have been set in acp_board. + * @return array|null Returns null if not implemented or an array with + * the template file name and an array of the vars + * that the template needs that must conform to the + * following example: + * array( + * 'TEMPLATE_FILE' => string, + * 'TEMPLATE_VARS' => array(...), + * ) + * An optional third element may be added to this + * array: 'BLOCK_VAR_NAME'. If this is present, + * then its value should be a string that is used + * to designate the name of the loop used in the + * ACP template file. When this is present, an + * additional key named 'BLOCK_VARS' is required. + * This must be an array containing at least one + * array of variables that will be assigned during + * the loop in the template. An example of this is + * presented below: + * array( + * 'BLOCK_VAR_NAME' => string, + * 'BLOCK_VARS' => array( + * 'KEY IS UNIMPORTANT' => array(...), + * ), + * 'TEMPLATE_FILE' => string, + * 'TEMPLATE_VARS' => array(...), + * ) + */ + public function get_acp_template($new_config); + + /** + * Returns an array of data necessary to build custom elements on the login + * form. + * + * @return array|null If this function is not implemented on an auth + * provider then it returns null. If it is implemented + * it will return an array of up to four elements of + * which only 'TEMPLATE_FILE'. If 'BLOCK_VAR_NAME' is + * present then 'BLOCK_VARS' must also be present in + * the array. The fourth element 'VARS' is also + * optional. The array, with all four elements present + * looks like the following: + * array( + * 'TEMPLATE_FILE' => string, + * 'BLOCK_VAR_NAME' => string, + * 'BLOCK_VARS' => array(...), + * 'VARS' => array(...), + * ) + */ + public function get_login_data(); + + /** + * Performs additional actions during logout. + * + * @param array $data An array corresponding to + * \phpbb\session::data + * @param boolean $new_session True for a new session, false for no new + * session. + */ + public function logout($data, $new_session); + + /** + * The session validation function checks whether the user is still logged + * into phpBB. + * + * @param array $user + * @return boolean true if the given user is authenticated, false if the + * session should be closed, or null if not implemented. + */ + public function validate_session($user); + + /** + * Checks to see if $login_link_data contains all information except for the + * user_id of an account needed to successfully link an external account to + * a forum account. + * + * @param array $login_link_data Any data needed to link a phpBB account to + * an external account. + * @return string|null Returns a string with a language constant if there + * is data missing or null if there is no error. + */ + public function login_link_has_necessary_data($login_link_data); + + /** + * Links an external account to a phpBB account. + * + * @param array $link_data Any data needed to link a phpBB account to + * an external account. + */ + public function link_account(array $link_data); + + /** + * Returns an array of data necessary to build the ucp_auth_link page + * + * @return array|null If this function is not implemented on an auth + * provider then it returns null. If it is implemented + * it will return an array of up to four elements of + * which only 'TEMPLATE_FILE'. If 'BLOCK_VAR_NAME' is + * present then 'BLOCK_VARS' must also be present in + * the array. The fourth element 'VARS' is also + * optional. The array, with all four elements present + * looks like the following: + * array( + * 'TEMPLATE_FILE' => string, + * 'BLOCK_VAR_NAME' => string, + * 'BLOCK_VARS' => array(...), + * 'VARS' => array(...), + * ) + */ + public function get_auth_link_data(); + + /** + * Unlinks an external account from a phpBB account. + * + * @param array $link_data Any data needed to unlink a phpBB account + * from a phpbb account. + */ + public function unlink_account(array $link_data); +} diff --git a/sources/phpBB/phpbb/auth/provider_collection.php b/sources/phpBB/phpbb/auth/provider_collection.php new file mode 100644 index 0000000..8e7e9e2 --- /dev/null +++ b/sources/phpBB/phpbb/auth/provider_collection.php @@ -0,0 +1,67 @@ + +* @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\auth; + +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** +* Collection of auth providers to be configured at container compile time. +*/ +class provider_collection extends \phpbb\di\service_collection +{ + /** @var \phpbb\config\config phpBB Config */ + protected $config; + + /** + * Constructor + * + * @param ContainerInterface $container Container object + * @param \phpbb\config\config $config phpBB config + */ + public function __construct(ContainerInterface $container, \phpbb\config\config $config) + { + $this->container = $container; + $this->config = $config; + } + + /** + * Get an auth provider. + * + * @param string $provider_name The name of the auth provider + * @return object Default auth provider selected in config if it + * does exist. Otherwise the standard db auth + * provider. + * @throws \RuntimeException If neither the auth provider that + * is specified by the phpBB config nor the db + * auth provider exist. The db auth provider + * should always exist in a phpBB installation. + */ + public function get_provider($provider_name = '') + { + $provider_name = ($provider_name !== '') ? $provider_name : basename(trim($this->config['auth_method'])); + if ($this->offsetExists('auth.provider.' . $provider_name)) + { + return $this->offsetGet('auth.provider.' . $provider_name); + } + // Revert to db auth provider if selected method does not exist + else if ($this->offsetExists('auth.provider.db')) + { + return $this->offsetGet('auth.provider.db'); + } + else + { + throw new \RuntimeException(sprintf('The authentication provider for the authentication method "%1$s" does not exist. It was not possible to recover from this by reverting to the database authentication provider.', $this->config['auth_method'])); + } + } +} diff --git a/sources/phpBB/phpbb/avatar/driver/driver.php b/sources/phpBB/phpbb/avatar/driver/driver.php new file mode 100644 index 0000000..b3ced7e --- /dev/null +++ b/sources/phpBB/phpbb/avatar/driver/driver.php @@ -0,0 +1,131 @@ + +* @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\avatar\driver; + +/** +* Base class for avatar drivers +*/ +abstract class driver implements \phpbb\avatar\driver\driver_interface +{ + /** + * Avatar driver name + * @var string + */ + protected $name; + + /** + * Current board configuration + * @var \phpbb\config\config + */ + protected $config; + + /** + * Current $phpbb_root_path + * @var string + */ + protected $phpbb_root_path; + + /** + * Current $php_ext + * @var string + */ + protected $php_ext; + + /** + * Path Helper + * @var \phpbb\path_helper + */ + protected $path_helper; + + /** + * Cache driver + * @var \phpbb\cache\driver\driver_interface + */ + protected $cache; + + /** + * Array of allowed avatar image extensions + * Array is used for setting the allowed extensions in the fileupload class + * and as a base for a regex of allowed extensions, which will be formed by + * imploding the array with a "|". + * + * @var array + */ + protected $allowed_extensions = array( + 'gif', + 'jpg', + 'jpeg', + 'png', + ); + + /** + * Construct a driver object + * + * @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\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) + { + $this->config = $config; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->path_helper = $path_helper; + $this->cache = $cache; + } + + /** + * {@inheritdoc} + */ + public function get_custom_html($user, $row, $alt = '') + { + return ''; + } + + /** + * {@inheritdoc} + */ + public function prepare_form_acp($user) + { + return array(); + } + + /** + * {@inheritdoc} + */ + public function delete($row) + { + return true; + } + + /** + * {@inheritdoc} + */ + public function get_name() + { + return $this->name; + } + + /** + * Sets the name of the driver. + * + * @param string $name Driver name + */ + public function set_name($name) + { + $this->name = $name; + } +} diff --git a/sources/phpBB/phpbb/avatar/driver/driver_interface.php b/sources/phpBB/phpbb/avatar/driver/driver_interface.php new file mode 100644 index 0000000..8356097 --- /dev/null +++ b/sources/phpBB/phpbb/avatar/driver/driver_interface.php @@ -0,0 +1,113 @@ + +* @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\avatar\driver; + +/** +* Interface for avatar drivers +*/ +interface driver_interface +{ + /** + * Returns the name of the driver. + * + * @return string Name of driver. + */ + public function get_name(); + + /** + * Get the avatar url and dimensions + * + * @param array $row User data or group data that has been cleaned with + * \phpbb\avatar\manager::clean_row + * @return array Avatar data, must have keys src, width and height, e.g. + * ['src' => '', 'width' => 0, 'height' => 0] + */ + public function get_data($row); + + /** + * Returns custom html if it is needed for displaying this avatar + * + * @param \phpbb\user $user phpBB user object + * @param array $row User data or group data that has been cleaned with + * \phpbb\avatar\manager::clean_row + * @param string $alt Alternate text for avatar image + * + * @return string HTML + */ + public function get_custom_html($user, $row, $alt = ''); + + /** + * Prepare form for changing the settings of this avatar + * + * @param \phpbb\request\request $request Request object + * @param \phpbb\template\template $template Template object + * @param \phpbb\user $user User object + * @param array $row User data or group data that has been cleaned with + * \phpbb\avatar\manager::clean_row + * @param array &$error Reference to an error array that is filled by this + * function. Key values can either be a string with a language key or + * an array that will be passed to vsprintf() with the language key in + * the first array key. + * + * @return bool True if form has been successfully prepared + */ + public function prepare_form($request, $template, $user, $row, &$error); + + /** + * Prepare form for changing the acp settings of this avatar + * + * @param \phpbb\user $user phpBB user object + * + * @return array Array of configuration options as consumed by acp_board. + * The setting for enabling/disabling the avatar will be handled by + * the avatar manager. + */ + public function prepare_form_acp($user); + + /** + * Process form data + * + * @param \phpbb\request\request $request Request object + * @param \phpbb\template\template $template Template object + * @param \phpbb\user $user User object + * @param array $row User data or group data that has been cleaned with + * \phpbb\avatar\manager::clean_row + * @param array &$error Reference to an error array that is filled by this + * function. Key values can either be a string with a language key or + * an array that will be passed to vsprintf() with the language key in + * the first array key. + * + * @return array Array containing the avatar data as follows: + * ['avatar'], ['avatar_width'], ['avatar_height'] + */ + public function process_form($request, $template, $user, $row, &$error); + + /** + * Delete avatar + * + * @param array $row User data or group data that has been cleaned with + * \phpbb\avatar\manager::clean_row + * + * @return bool True if avatar has been deleted or there is no need to delete, + * i.e. when the avatar is not hosted locally. + */ + public function delete($row); + + /** + * Get the avatar driver's template name + * + * @return string Avatar driver's template name + */ + public function get_template_name(); +} diff --git a/sources/phpBB/phpbb/avatar/driver/gravatar.php b/sources/phpBB/phpbb/avatar/driver/gravatar.php new file mode 100644 index 0000000..2082e0f --- /dev/null +++ b/sources/phpBB/phpbb/avatar/driver/gravatar.php @@ -0,0 +1,185 @@ + +* @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\avatar\driver; + +/** +* Handles avatars hosted at gravatar.com +*/ +class gravatar extends \phpbb\avatar\driver\driver +{ + /** + * The URL for the gravatar service + */ + const GRAVATAR_URL = '//secure.gravatar.com/avatar/'; + + /** + * {@inheritdoc} + */ + public function get_data($row) + { + return array( + 'src' => $row['avatar'], + 'width' => $row['avatar_width'], + 'height' => $row['avatar_height'], + ); + } + + /** + * {@inheritdoc} + */ + public function get_custom_html($user, $row, $alt = '') + { + return ''; + } + + /** + * {@inheritdoc} + */ + public function prepare_form($request, $template, $user, $row, &$error) + { + $template->assign_vars(array( + 'AVATAR_GRAVATAR_WIDTH' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar_width']) ? $row['avatar_width'] : $request->variable('avatar_gravatar_width', 0), + 'AVATAR_GRAVATAR_HEIGHT' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar_height']) ? $row['avatar_height'] : $request->variable('avatar_gravatar_width', 0), + 'AVATAR_GRAVATAR_EMAIL' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar']) ? $row['avatar'] : '', + )); + + return true; + } + + /** + * {@inheritdoc} + */ + public function process_form($request, $template, $user, $row, &$error) + { + $row['avatar'] = $request->variable('avatar_gravatar_email', ''); + $row['avatar_width'] = $request->variable('avatar_gravatar_width', 0); + $row['avatar_height'] = $request->variable('avatar_gravatar_height', 0); + + if (empty($row['avatar'])) + { + return false; + } + + if (!function_exists('validate_data')) + { + require($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + } + + $validate_array = validate_data( + array( + 'email' => $row['avatar'], + ), + array( + 'email' => array( + array('string', false, 6, 60), + array('email'), + ), + ) + ); + + $error = array_merge($error, $validate_array); + + if (!empty($error)) + { + return false; + } + + // Make sure getimagesize works... + if (function_exists('getimagesize') && ($row['avatar_width'] <= 0 || $row['avatar_height'] <= 0)) + { + /** + * default to the minimum of the maximum allowed avatar size if the size + * is not or only partially entered + */ + $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)) + { + $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; + } + + $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]; + } + + if ($row['avatar_width'] <= 0 || $row['avatar_height'] <= 0) + { + $error[] = 'AVATAR_NO_SIZE'; + return false; + } + + if ($this->config['avatar_max_width'] || $this->config['avatar_max_height']) + { + if ($row['avatar_width'] > $this->config['avatar_max_width'] || $row['avatar_height'] > $this->config['avatar_max_height']) + { + $error[] = array('AVATAR_WRONG_SIZE', $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], $row['avatar_width'], $row['avatar_height']); + return false; + } + } + + if ($this->config['avatar_min_width'] || $this->config['avatar_min_height']) + { + if ($row['avatar_width'] < $this->config['avatar_min_width'] || $row['avatar_height'] < $this->config['avatar_min_height']) + { + $error[] = array('AVATAR_WRONG_SIZE', $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], $row['avatar_width'], $row['avatar_height']); + return false; + } + } + + return array( + 'avatar' => $row['avatar'], + 'avatar_width' => $row['avatar_width'], + 'avatar_height' => $row['avatar_height'], + ); + } + + /** + * {@inheritdoc} + */ + public function get_template_name() + { + return 'ucp_avatar_options_gravatar.html'; + } + + /** + * Build gravatar URL for output on page + * + * @param array $row User data or group data that has been cleaned with + * \phpbb\avatar\manager::clean_row + * @return string Gravatar URL + */ + protected function get_gravatar_url($row) + { + $url = self::GRAVATAR_URL; + $url .= md5(strtolower(trim($row['avatar']))); + + if ($row['avatar_width'] || $row['avatar_height']) + { + $url .= '?s=' . max($row['avatar_width'], $row['avatar_height']); + } + + return $url; + } +} diff --git a/sources/phpBB/phpbb/avatar/driver/local.php b/sources/phpBB/phpbb/avatar/driver/local.php new file mode 100644 index 0000000..8888686 --- /dev/null +++ b/sources/phpBB/phpbb/avatar/driver/local.php @@ -0,0 +1,201 @@ + +* @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\avatar\driver; + +/** +* Handles avatars selected from the board gallery +*/ +class local extends \phpbb\avatar\driver\driver +{ + /** + * {@inheritdoc} + */ + public function get_data($row) + { + return array( + 'src' => $this->path_helper->get_web_root_path() . $this->config['avatar_gallery_path'] . '/' . $row['avatar'], + 'width' => $row['avatar_width'], + 'height' => $row['avatar_height'], + ); + } + + /** + * {@inheritdoc} + */ + public function prepare_form($request, $template, $user, $row, &$error) + { + $avatar_list = $this->get_avatar_list($user); + $category = $request->variable('avatar_local_cat', key($avatar_list)); + + foreach ($avatar_list as $cat => $null) + { + if (!empty($avatar_list[$cat])) + { + $template->assign_block_vars('avatar_local_cats', array( + 'NAME' => $cat, + 'SELECTED' => ($cat == $category), + )); + } + + if ($cat != $category) + { + unset($avatar_list[$cat]); + } + } + + if (!empty($avatar_list[$category])) + { + $template->assign_vars(array( + 'AVATAR_LOCAL_SHOW' => true, + )); + + $table_cols = isset($row['avatar_gallery_cols']) ? $row['avatar_gallery_cols'] : 4; + $row_count = $col_count = $avatar_pos = 0; + $avatar_count = sizeof($avatar_list[$category]); + + reset($avatar_list[$category]); + + while ($avatar_pos < $avatar_count) + { + $img = current($avatar_list[$category]); + next($avatar_list[$category]); + + if ($col_count == 0) + { + ++$row_count; + $template->assign_block_vars('avatar_local_row', array( + )); + } + + $template->assign_block_vars('avatar_local_row.avatar_local_col', array( + 'AVATAR_IMAGE' => $this->phpbb_root_path . $this->config['avatar_gallery_path'] . '/' . $img['file'], + 'AVATAR_NAME' => $img['name'], + 'AVATAR_FILE' => $img['filename'], + )); + + $template->assign_block_vars('avatar_local_row.avatar_local_option', array( + 'AVATAR_FILE' => $img['filename'], + 'S_OPTIONS_AVATAR' => $img['filename'] + )); + + $col_count = ($col_count + 1) % $table_cols; + + ++$avatar_pos; + } + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function prepare_form_acp($user) + { + return array( + 'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true), + ); + } + + /** + * {@inheritdoc} + */ + public function process_form($request, $template, $user, $row, &$error) + { + $avatar_list = $this->get_avatar_list($user); + $category = $request->variable('avatar_local_cat', ''); + + $file = $request->variable('avatar_local_file', ''); + + if (empty($category) || empty($file)) + { + return false; + } + + if (!isset($avatar_list[$category][urldecode($file)])) + { + $error[] = 'AVATAR_URL_NOT_FOUND'; + return false; + } + + return array( + 'avatar' => ($category != $user->lang['NO_AVATAR_CATEGORY']) ? $category . '/' . $file : $file, + 'avatar_width' => $avatar_list[$category][urldecode($file)]['width'], + 'avatar_height' => $avatar_list[$category][urldecode($file)]['height'], + ); + } + + /** + * {@inheritdoc} + */ + public function get_template_name() + { + return 'ucp_avatar_options_local.html'; + } + + /** + * Get a list of avatars that are locally available + * Results get cached for 24 hours (86400 seconds) + * + * @param \phpbb\user $user User object + * + * @return array Array containing the locally available avatars + */ + protected function get_avatar_list($user) + { + $avatar_list = ($this->cache == null) ? false : $this->cache->get('_avatar_local_list'); + + if ($avatar_list === false) + { + $avatar_list = array(); + $path = $this->phpbb_root_path . $this->config['avatar_gallery_path']; + + $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS), \RecursiveIteratorIterator::SELF_FIRST); + foreach ($iterator as $file_info) + { + $file_path = $file_info->getPath(); + $image = $file_info->getFilename(); + + // 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 = getimagesize($file_path . '/' . $image); + } + else + { + $dims = array(0, 0); + } + $cat = ($path == $file_path) ? $user->lang['NO_AVATAR_CATEGORY'] : str_replace("$path/", '', $file_path); + $avatar_list[$cat][$image] = array( + 'file' => ($cat != $user->lang['NO_AVATAR_CATEGORY']) ? rawurlencode($cat) . '/' . rawurlencode($image) : rawurlencode($image), + 'filename' => rawurlencode($image), + 'name' => ucfirst(str_replace('_', ' ', preg_replace('#^(.*)\..*$#', '\1', $image))), + 'width' => $dims[0], + 'height' => $dims[1], + ); + } + } + ksort($avatar_list); + + if ($this->cache != null) + { + $this->cache->put('_avatar_local_list', $avatar_list, 86400); + } + } + + return $avatar_list; + } +} diff --git a/sources/phpBB/phpbb/avatar/driver/remote.php b/sources/phpBB/phpbb/avatar/driver/remote.php new file mode 100644 index 0000000..4b0ee3f --- /dev/null +++ b/sources/phpBB/phpbb/avatar/driver/remote.php @@ -0,0 +1,221 @@ + +* @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\avatar\driver; + +/** +* Handles avatars hosted remotely +*/ +class remote extends \phpbb\avatar\driver\driver +{ + /** + * {@inheritdoc} + */ + public function get_data($row) + { + return array( + 'src' => $row['avatar'], + 'width' => $row['avatar_width'], + 'height' => $row['avatar_height'], + ); + } + + /** + * {@inheritdoc} + */ + public function prepare_form($request, $template, $user, $row, &$error) + { + $template->assign_vars(array( + 'AVATAR_REMOTE_WIDTH' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar_width']) ? $row['avatar_width'] : $request->variable('avatar_remote_width', 0), + 'AVATAR_REMOTE_HEIGHT' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar_height']) ? $row['avatar_height'] : $request->variable('avatar_remote_width', 0), + 'AVATAR_REMOTE_URL' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar']) ? $row['avatar'] : '', + )); + + return true; + } + + /** + * {@inheritdoc} + */ + public function process_form($request, $template, $user, $row, &$error) + { + $url = $request->variable('avatar_remote_url', ''); + $width = $request->variable('avatar_remote_width', 0); + $height = $request->variable('avatar_remote_height', 0); + + if (empty($url)) + { + return false; + } + + if (!preg_match('#^(http|https|ftp)://#i', $url)) + { + $url = 'http://' . $url; + } + + if (!function_exists('validate_data')) + { + require($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + } + + $validate_array = validate_data( + array( + 'url' => $url, + ), + array( + 'url' => array('string', true, 5, 255), + ) + ); + + $error = array_merge($error, $validate_array); + + if (!empty($error)) + { + return false; + } + + // Check if this url looks alright + // This isn't perfect, but it's what phpBB 3.0 did, and might as well make sure everything is compatible + if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.('. implode('|', $this->allowed_extensions) . ')$#i', $url)) + { + $error[] = 'AVATAR_URL_INVALID'; + return false; + } + + // Make sure getimagesize works... + if (function_exists('getimagesize')) + { + 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; + } + + $width = ($width && $height) ? $width : $image_data[0]; + $height = ($width && $height) ? $height : $image_data[1]; + } + + if ($width <= 0 || $height <= 0) + { + $error[] = 'AVATAR_NO_SIZE'; + return false; + } + + if (!class_exists('fileupload')) + { + include($this->phpbb_root_path . 'includes/functions_upload.' . $this->php_ext); + } + + $types = \fileupload::image_types(); + $extension = strtolower(\filespec::get_extension($url)); + + // Check if this is actually an image + if ($file_stream = @fopen($url, 'r')) + { + // Timeout after 1 second + stream_set_timeout($file_stream, 1); + // read some data to ensure headers are present + fread($file_stream, 1024); + $meta = stream_get_meta_data($file_stream); + + if (isset($meta['wrapper_data']['headers']) && is_array($meta['wrapper_data']['headers'])) + { + $headers = $meta['wrapper_data']['headers']; + } + else if (isset($meta['wrapper_data']) && is_array($meta['wrapper_data'])) + { + $headers = $meta['wrapper_data']; + } + else + { + $headers = array(); + } + + foreach ($headers as $header) + { + $header = preg_split('/ /', $header, 2); + if (strtr(strtolower(trim($header[0], ':')), '_', '-') === 'content-type') + { + if (strpos($header[1], 'image/') !== 0) + { + $error[] = 'AVATAR_URL_INVALID'; + fclose($file_stream); + return false; + } + else + { + fclose($file_stream); + break; + } + } + } + } + else + { + $error[] = 'AVATAR_URL_INVALID'; + return false; + } + + if (!empty($image_data) && (!isset($types[$image_data[2]]) || !in_array($extension, $types[$image_data[2]]))) + { + if (!isset($types[$image_data[2]])) + { + $error[] = 'UNABLE_GET_IMAGE_SIZE'; + } + else + { + $error[] = array('IMAGE_FILETYPE_MISMATCH', $types[$image_data[2]][0], $extension); + } + + return false; + } + + if ($this->config['avatar_max_width'] || $this->config['avatar_max_height']) + { + if ($width > $this->config['avatar_max_width'] || $height > $this->config['avatar_max_height']) + { + $error[] = array('AVATAR_WRONG_SIZE', $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], $width, $height); + return false; + } + } + + if ($this->config['avatar_min_width'] || $this->config['avatar_min_height']) + { + if ($width < $this->config['avatar_min_width'] || $height < $this->config['avatar_min_height']) + { + $error[] = array('AVATAR_WRONG_SIZE', $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], $width, $height); + return false; + } + } + + return array( + 'avatar' => $url, + 'avatar_width' => $width, + 'avatar_height' => $height, + ); + } + + /** + * {@inheritdoc} + */ + public function get_template_name() + { + return 'ucp_avatar_options_remote.html'; + } +} diff --git a/sources/phpBB/phpbb/avatar/driver/upload.php b/sources/phpBB/phpbb/avatar/driver/upload.php new file mode 100644 index 0000000..003b236 --- /dev/null +++ b/sources/phpBB/phpbb/avatar/driver/upload.php @@ -0,0 +1,214 @@ + +* @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\avatar\driver; + +/** +* Handles avatars uploaded to the board +*/ +class upload extends \phpbb\avatar\driver\driver +{ + /** + * @var \phpbb\mimetype\guesser + */ + protected $mimetype_guesser; + + /** + * Construct a driver object + * + * @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\mimetype\guesser $mimetype_guesser Mimetype guesser + * @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\cache\driver\driver_interface $cache = null) + { + $this->config = $config; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->path_helper = $path_helper; + $this->mimetype_guesser = $mimetype_guesser; + $this->cache = $cache; + } + + /** + * {@inheritdoc} + */ + public function get_data($row, $ignore_config = false) + { + return array( + 'src' => $this->path_helper->get_web_root_path() . 'download/file.' . $this->php_ext . '?avatar=' . $row['avatar'], + 'width' => $row['avatar_width'], + 'height' => $row['avatar_height'], + ); + } + + /** + * {@inheritdoc} + */ + public function prepare_form($request, $template, $user, $row, &$error) + { + if (!$this->can_upload()) + { + return false; + } + + $template->assign_vars(array( + 'S_UPLOAD_AVATAR_URL' => ($this->config['allow_avatar_remote_upload']) ? true : false, + 'AVATAR_UPLOAD_SIZE' => $this->config['avatar_filesize'], + )); + + return true; + } + + /** + * {@inheritdoc} + */ + public function process_form($request, $template, $user, $row, &$error) + { + if (!$this->can_upload()) + { + return false; + } + + if (!class_exists('fileupload')) + { + 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)); + + $url = $request->variable('avatar_upload_url', ''); + $upload_file = $request->file('avatar_upload_file'); + + if (!empty($upload_file['name'])) + { + $file = $upload->form_upload('avatar_upload_file', $this->mimetype_guesser); + } + else if (!empty($this->config['allow_avatar_remote_upload']) && !empty($url)) + { + if (!preg_match('#^(http|https|ftp)://#i', $url)) + { + $url = 'http://' . $url; + } + + if (!function_exists('validate_data')) + { + require($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + } + + $validate_array = validate_data( + array( + 'url' => $url, + ), + array( + 'url' => array('string', true, 5, 255), + ) + ); + + $error = array_merge($error, $validate_array); + + if (!empty($error)) + { + return false; + } + + $file = $upload->remote_upload($url, $this->mimetype_guesser); + } + else + { + return false; + } + + $prefix = $this->config['avatar_salt'] . '_'; + $file->clean_filename('avatar', $prefix, $row['id']); + + $destination = $this->config['avatar_path']; + + // Adjust destination path (no trailing slash) + if (substr($destination, -1, 1) == '/' || substr($destination, -1, 1) == '\\') + { + $destination = substr($destination, 0, -1); + } + + $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination); + if ($destination && ($destination[0] == '/' || $destination[0] == "\\")) + { + $destination = ''; + } + + // Move file and overwrite any existing image + $file->move_file($destination, true); + + if (sizeof($file->error)) + { + $file->remove(); + $error = array_merge($error, $file->error); + return false; + } + + return array( + 'avatar' => $row['id'] . '_' . time() . '.' . $file->get('extension'), + 'avatar_width' => $file->get('width'), + 'avatar_height' => $file->get('height'), + ); + } + + /** + * {@inheritdoc} + */ + public function prepare_form_acp($user) + { + return array( + 'allow_avatar_remote_upload'=> array('lang' => 'ALLOW_REMOTE_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int:0', 'type' => 'number:0', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), + 'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true), + ); + } + + /** + * {@inheritdoc} + */ + public function delete($row) + { + $ext = substr(strrchr($row['avatar'], '.'), 1); + $filename = $this->phpbb_root_path . $this->config['avatar_path'] . '/' . $this->config['avatar_salt'] . '_' . $row['id'] . '.' . $ext; + + if (file_exists($filename)) + { + @unlink($filename); + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function get_template_name() + { + return 'ucp_avatar_options_upload.html'; + } + + /** + * Check if user is able to upload an avatar + * + * @return bool True if user can upload, false if not + */ + 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')); + } +} diff --git a/sources/phpBB/phpbb/avatar/manager.php b/sources/phpBB/phpbb/avatar/manager.php new file mode 100644 index 0000000..8d83152 --- /dev/null +++ b/sources/phpBB/phpbb/avatar/manager.php @@ -0,0 +1,366 @@ + +* @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\avatar; + +class manager +{ + /** + * phpBB configuration + * @var \phpbb\config\config + */ + protected $config; + + /** + * Array that contains a list of enabled drivers + * @var array + */ + static protected $enabled_drivers = false; + + /** + * Array that contains all available avatar drivers which are passed via the + * service container + * @var array + */ + protected $avatar_drivers; + + /** + * Default avatar data row + * @var array + */ + static protected $default_row = array( + 'avatar' => '', + 'avatar_type' => '', + 'avatar_width' => 0, + 'avatar_height' => 0, + ); + + /** + * Construct an avatar manager object + * + * @param \phpbb\config\config $config phpBB configuration + * @param array $avatar_drivers Avatar drivers passed via the service container + */ + public function __construct(\phpbb\config\config $config, $avatar_drivers) + { + $this->config = $config; + $this->register_avatar_drivers($avatar_drivers); + } + + /** + * Register avatar drivers + * + * @param array $avatar_drivers Service collection of avatar drivers + */ + protected function register_avatar_drivers($avatar_drivers) + { + if (!empty($avatar_drivers)) + { + foreach ($avatar_drivers as $driver) + { + $this->avatar_drivers[$driver->get_name()] = $driver; + } + } + } + + /** + * Get the driver object specified by the avatar type + * + * @param string $avatar_type Avatar type; by default an avatar's service container name + * @param bool $load_enabled Load only enabled avatars + * + * @return object Avatar driver object + */ + public function get_driver($avatar_type, $load_enabled = true) + { + if (self::$enabled_drivers === false) + { + $this->load_enabled_drivers(); + } + + $avatar_drivers = ($load_enabled) ? self::$enabled_drivers : $this->get_all_drivers(); + + // Legacy stuff... + switch ($avatar_type) + { + case AVATAR_GALLERY: + $avatar_type = 'avatar.driver.local'; + break; + case AVATAR_UPLOAD: + $avatar_type = 'avatar.driver.upload'; + break; + case AVATAR_REMOTE: + $avatar_type = 'avatar.driver.remote'; + break; + } + + if (!isset($avatar_drivers[$avatar_type])) + { + return null; + } + + /* + * There is no need to handle invalid avatar types as the following code + * will cause a ServiceNotFoundException if the type does not exist + */ + $driver = $this->avatar_drivers[$avatar_type]; + + return $driver; + } + + /** + * Load the list of enabled drivers + * This is executed once and fills self::$enabled_drivers + */ + protected function load_enabled_drivers() + { + if (!empty($this->avatar_drivers)) + { + self::$enabled_drivers = array(); + foreach ($this->avatar_drivers as $driver) + { + if ($this->is_enabled($driver)) + { + self::$enabled_drivers[$driver->get_name()] = $driver->get_name(); + } + } + asort(self::$enabled_drivers); + } + } + + /** + * Get a list of all avatar drivers + * + * As this function will only be called in the ACP avatar settings page, it + * doesn't make much sense to cache the list of all avatar drivers like the + * list of the enabled drivers. + * + * @return array Array containing a list of all avatar drivers + */ + public function get_all_drivers() + { + $drivers = array(); + + if (!empty($this->avatar_drivers)) + { + foreach ($this->avatar_drivers as $driver) + { + $drivers[$driver->get_name()] = $driver->get_name(); + } + asort($drivers); + } + + return $drivers; + } + + /** + * Get a list of enabled avatar drivers + * + * @return array Array containing a list of the enabled avatar drivers + */ + public function get_enabled_drivers() + { + if (self::$enabled_drivers === false) + { + $this->load_enabled_drivers(); + } + + return self::$enabled_drivers; + } + + /** + * Strip out user_, group_, or other prefixes from array keys + * + * @param array $row User data or group data + * @param string $prefix Prefix of data keys (e.g. user), should not include the trailing underscore + * + * @return array User or group data with keys that have been + * stripped from the preceding "user_" or "group_" + * Also the group id is prefixed with g, when the prefix group is removed. + */ + static public function clean_row($row, $prefix = '') + { + // Upon creation of a user/group $row might be empty + if (empty($row)) + { + return self::$default_row; + } + + $output = array(); + foreach ($row as $key => $value) + { + $key = preg_replace("#^(?:{$prefix}_)#", '', $key); + $output[$key] = $value; + } + + if ($prefix === 'group' && isset($output['id'])) + { + $output['id'] = 'g' . $output['id']; + } + + return $output; + } + + /** + * Clean driver names that are returned from template files + * Underscores are replaced with dots + * + * @param string $name Driver name + * + * @return string Cleaned driver name + */ + static public function clean_driver_name($name) + { + return str_replace(array('\\', '_'), '.', $name); + } + + /** + * Prepare driver names for use in template files + * Dots are replaced with underscores + * + * @param string $name Clean driver name + * + * @return string Prepared driver name + */ + static public function prepare_driver_name($name) + { + return str_replace('.', '_', $name); + } + + /** + * Check if avatar is enabled + * + * @param object $driver Avatar driver object + * + * @return bool True if avatar is enabled, false if it's disabled + */ + public function is_enabled($driver) + { + $config_name = $this->get_driver_config_name($driver); + + return $this->config["allow_avatar_{$config_name}"]; + } + + /** + * Get the settings array for enabling/disabling an avatar driver + * + * @param object $driver Avatar driver object + * + * @return array Array of configuration options as consumed by acp_board + */ + public function get_avatar_settings($driver) + { + $config_name = $this->get_driver_config_name($driver); + + return array( + 'allow_avatar_' . $config_name => array('lang' => 'ALLOW_' . strtoupper(str_replace('\\', '_', $config_name)), 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + ); + } + + /** + * Get the config name of an avatar driver + * + * @param object $driver Avatar driver object + * + * @return string Avatar driver config name + */ + public function get_driver_config_name($driver) + { + return preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($driver)); + } + + /** + * Replace "error" strings with their real, localized form + * + * @param \phpbb\user phpBB User object + * @param array $error Array containing error strings + * Key values can either be a string with a language key or an array + * that will be passed to vsprintf() with the language key in the + * first array key. + * + * @return array Array containing the localized error strings + */ + public function localize_errors(\phpbb\user $user, $error) + { + foreach ($error as $key => $lang) + { + if (is_array($lang)) + { + $lang_key = array_shift($lang); + $error[$key] = vsprintf($user->lang($lang_key), $lang); + } + else + { + $error[$key] = $user->lang("$lang"); + } + } + + return $error; + } + + /** + * Handle deleting avatars + * + * @param \phpbb\db\driver\driver_interface $db phpBB dbal + * @param \phpbb\user $user phpBB user object + * @param array $avatar_data Cleaned user data containing the user's + * avatar data + * @param string $table Database table from which the avatar should be deleted + * @param string $prefix Prefix of user data columns in database + * @return null + */ + public function handle_avatar_delete(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, $avatar_data, $table, $prefix) + { + if ($driver = $this->get_driver($avatar_data['avatar_type'])) + { + $driver->delete($avatar_data); + } + + $result = $this->prefix_avatar_columns($prefix, self::$default_row); + + $sql = 'UPDATE ' . $table . ' + SET ' . $db->sql_build_array('UPDATE', $result) . ' + WHERE ' . $prefix . 'id = ' . (int) $avatar_data['id']; + $db->sql_query($sql); + + // Make sure we also delete this avatar from the users + if ($prefix === 'group_') + { + $result = $this->prefix_avatar_columns('user_', self::$default_row); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $result) . " + WHERE user_avatar = '" . $db->sql_escape($avatar_data['avatar']) . "'"; + $db->sql_query($sql); + } + } + + /** + * Prefix avatar columns + * + * @param string $prefix Column prefix + * @param array $data Column data + * + * @return array Column data with prefixed column names + */ + public function prefix_avatar_columns($prefix, $data) + { + foreach ($data as $key => $value) + { + $data[$prefix . $key] = $value; + unset($data[$key]); + } + + return $data; + } +} diff --git a/sources/phpBB/phpbb/cache/driver/apc.php b/sources/phpBB/phpbb/cache/driver/apc.php new file mode 100644 index 0000000..521d5d4 --- /dev/null +++ b/sources/phpBB/phpbb/cache/driver/apc.php @@ -0,0 +1,70 @@ + +* @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\cache\driver; + +/** +* ACM for APC +*/ +class apc extends \phpbb\cache\driver\memory +{ + var $extension = 'apc'; + + /** + * {@inheritDoc} + */ + function purge() + { + apc_clear_cache('user'); + + parent::purge(); + } + + /** + * Fetch an item from the cache + * + * @access protected + * @param string $var Cache key + * @return mixed Cached data + */ + function _read($var) + { + return apc_fetch($this->key_prefix . $var); + } + + /** + * Store data in the cache + * + * @access protected + * @param string $var Cache key + * @param mixed $data Data to store + * @param int $ttl Time-to-live of cached data + * @return bool True if the operation succeeded + */ + function _write($var, $data, $ttl = 2592000) + { + return apc_store($this->key_prefix . $var, $data, $ttl); + } + + /** + * Remove an item from the cache + * + * @access protected + * @param string $var Cache key + * @return bool True if the operation succeeded + */ + function _delete($var) + { + return apc_delete($this->key_prefix . $var); + } +} diff --git a/sources/phpBB/phpbb/cache/driver/base.php b/sources/phpBB/phpbb/cache/driver/base.php new file mode 100644 index 0000000..4c20ad9 --- /dev/null +++ b/sources/phpBB/phpbb/cache/driver/base.php @@ -0,0 +1,231 @@ + +* @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\cache\driver; + +abstract class base implements \phpbb\cache\driver\driver_interface +{ + var $vars = array(); + var $is_modified = false; + + var $sql_rowset = array(); + var $sql_row_pointer = array(); + var $cache_dir = ''; + + /** + * {@inheritDoc} + */ + function purge() + { + // Purge all phpbb cache files + try + { + $iterator = new \DirectoryIterator($this->cache_dir); + } + catch (\Exception $e) + { + return; + } + + foreach ($iterator as $fileInfo) + { + if ($fileInfo->isDot()) + { + continue; + } + $filename = $fileInfo->getFilename(); + if ($fileInfo->isDir()) + { + $this->remove_dir($fileInfo->getPathname()); + } + else if (strpos($filename, 'container_') === 0 || + strpos($filename, 'url_matcher') === 0 || + strpos($filename, 'sql_') === 0 || + strpos($filename, 'data_') === 0) + { + $this->remove_file($fileInfo->getPathname()); + } + } + + unset($this->vars); + unset($this->sql_rowset); + unset($this->sql_row_pointer); + + $this->vars = array(); + $this->sql_rowset = array(); + $this->sql_row_pointer = array(); + + $this->is_modified = false; + } + + /** + * {@inheritDoc} + */ + function unload() + { + $this->save(); + unset($this->vars); + unset($this->sql_rowset); + unset($this->sql_row_pointer); + + $this->vars = array(); + $this->sql_rowset = array(); + $this->sql_row_pointer = array(); + } + + /** + * {@inheritDoc} + */ + function sql_load($query) + { + // Remove extra spaces and tabs + $query = preg_replace('/[\n\r\s\t]+/', ' ', $query); + + if (($rowset = $this->_read('sql_' . md5($query))) === false) + { + return false; + } + + $query_id = sizeof($this->sql_rowset); + $this->sql_rowset[$query_id] = $rowset; + $this->sql_row_pointer[$query_id] = 0; + + return $query_id; + } + + /** + * {@inheritDoc} + */ + function sql_exists($query_id) + { + return isset($this->sql_rowset[$query_id]); + } + + /** + * {@inheritDoc} + */ + function sql_fetchrow($query_id) + { + if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id])) + { + return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++]; + } + + return false; + } + + /** + * {@inheritDoc} + */ + function sql_fetchfield($query_id, $field) + { + if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id])) + { + return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++][$field] : false; + } + + return false; + } + + /** + * {@inheritDoc} + */ + function sql_rowseek($rownum, $query_id) + { + if ($rownum >= sizeof($this->sql_rowset[$query_id])) + { + return false; + } + + $this->sql_row_pointer[$query_id] = $rownum; + return true; + } + + /** + * {@inheritDoc} + */ + function sql_freeresult($query_id) + { + if (!isset($this->sql_rowset[$query_id])) + { + return false; + } + + unset($this->sql_rowset[$query_id]); + unset($this->sql_row_pointer[$query_id]); + + return true; + } + + /** + * Removes/unlinks file + * + * @param string $filename Filename to remove + * @param bool $check Check file permissions + * @return bool True if the file was successfully removed, otherwise false + */ + function remove_file($filename, $check = false) + { + if (!function_exists('phpbb_is_writable')) + { + global $phpbb_root_path, $phpEx; + include($phpbb_root_path . 'includes/functions.' . $phpEx); + } + + if ($check && !phpbb_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); + } + + return @unlink($filename); + } + + /** + * Remove directory + * + * @param string $dir Directory to remove + * + * @return null + */ + protected function remove_dir($dir) + { + try + { + $iterator = new \DirectoryIterator($dir); + } + catch (\Exception $e) + { + return; + } + + foreach ($iterator as $fileInfo) + { + if ($fileInfo->isDot()) + { + continue; + } + + if ($fileInfo->isDir()) + { + $this->remove_dir($fileInfo->getPathname()); + } + else + { + $this->remove_file($fileInfo->getPathname()); + } + } + + @rmdir($dir); + } +} diff --git a/sources/phpBB/phpbb/cache/driver/driver_interface.php b/sources/phpBB/phpbb/cache/driver/driver_interface.php new file mode 100644 index 0000000..9ac9ca0 --- /dev/null +++ b/sources/phpBB/phpbb/cache/driver/driver_interface.php @@ -0,0 +1,167 @@ + +* @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\cache\driver; + +/** +* An interface that all cache drivers must implement +*/ +interface driver_interface +{ + /** + * Load global cache + * + * @return mixed False if an error was encountered, otherwise the data type of the cached data + */ + public function load(); + + /** + * Unload cache object + * + * @return null + */ + public function unload(); + + /** + * Save modified objects + * + * @return null + */ + public function save(); + + /** + * Tidy cache + * + * @return null + */ + public function tidy(); + + /** + * Get saved cache object + * + * @param string $var_name Cache key + * @return mixed False if an error was encountered, otherwise the saved cached object + */ + public function get($var_name); + + /** + * Put data into cache + * + * @param string $var_name Cache key + * @param mixed $var Cached data to store + * @param int $ttl Time-to-live of cached data + * @return null + */ + public function put($var_name, $var, $ttl = 0); + + /** + * Purge cache data + * + * @return null + */ + public function purge(); + + /** + * Destroy cache data + * + * @param string $var_name Cache key + * @param string $table Table name + * @return null + */ + public function destroy($var_name, $table = ''); + + /** + * Check if a given cache entry exists + * + * @param string $var_name Cache key + * + * @return bool True if cache file exists and has not expired. + * False otherwise. + */ + public function _exists($var_name); + + /** + * Load result of an SQL query from cache. + * + * @param string $query SQL query + * + * @return int|bool Query ID (integer) if cache contains a rowset + * for the specified query. + * False otherwise. + */ + public function sql_load($query); + + /** + * Save result of an SQL query in cache. + * + * In persistent cache stores, this function stores the query + * result to persistent storage. In other words, there is no need + * to call save() afterwards. + * + * @param \phpbb\db\driver\driver_interface $db Database connection + * @param string $query SQL query, should be used for generating storage key + * @param mixed $query_result The result from \dbal::sql_query, to be passed to + * \dbal::sql_fetchrow to get all rows and store them + * in cache. + * @param int $ttl Time to live, after this timeout the query should + * expire from the cache. + * @return int|mixed If storing in cache succeeded, an integer $query_id + * representing the query should be returned. Otherwise + * the original $query_result should be returned. + */ + public function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl); + + /** + * Check if result for a given SQL query exists in cache. + * + * @param int $query_id + * @return bool + */ + public function sql_exists($query_id); + + /** + * Fetch row from cache (database) + * + * @param int $query_id + * @return array|bool The query result if found in the cache, otherwise + * false. + */ + public function sql_fetchrow($query_id); + + /** + * Fetch a field from the current row of a cached database result (database) + * + * @param int $query_id + * @param string $field The name of the column. + * @return string|bool The field of the query result if found in the cache, + * otherwise false. + */ + public function sql_fetchfield($query_id, $field); + + /** + * Seek a specific row in an a cached database result (database) + * + * @param int $rownum Row to seek to. + * @param int $query_id + * @return bool + */ + public function sql_rowseek($rownum, $query_id); + + /** + * Free memory used for a cached database result (database) + * + * @param int $query_id + * @return bool + */ + public function sql_freeresult($query_id); +} diff --git a/sources/phpBB/phpbb/cache/driver/eaccelerator.php b/sources/phpBB/phpbb/cache/driver/eaccelerator.php new file mode 100644 index 0000000..1697758 --- /dev/null +++ b/sources/phpBB/phpbb/cache/driver/eaccelerator.php @@ -0,0 +1,105 @@ + +* @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\cache\driver; + +/** +* ACM for eAccelerator +* @todo Missing locks from destroy() talk with David +*/ +class eaccelerator extends \phpbb\cache\driver\memory +{ + var $extension = 'eaccelerator'; + var $function = 'eaccelerator_get'; + + var $serialize_header = '#phpbb-serialized#'; + + /** + * {@inheritDoc} + */ + function purge() + { + foreach (eaccelerator_list_keys() as $var) + { + // @todo Check why the substr() + // @todo Only unset vars matching $this->key_prefix + eaccelerator_rm(substr($var['name'], 1)); + } + + parent::purge(); + } + + /** + * {@inheritDoc} + */ + function tidy() + { + eaccelerator_gc(); + + set_config('cache_last_gc', time(), true); + } + + /** + * Fetch an item from the cache + * + * @access protected + * @param string $var Cache key + * @return mixed Cached data + */ + function _read($var) + { + $result = eaccelerator_get($this->key_prefix . $var); + + if ($result === null) + { + return false; + } + + // Handle serialized objects + if (is_string($result) && strpos($result, $this->serialize_header . 'O:') === 0) + { + $result = unserialize(substr($result, strlen($this->serialize_header))); + } + + return $result; + } + + /** + * Store data in the cache + * + * @access protected + * @param string $var Cache key + * @param mixed $data Data to store + * @param int $ttl Time-to-live of cached data + * @return bool True if the operation succeeded + */ + function _write($var, $data, $ttl = 2592000) + { + // Serialize objects and make them easy to detect + $data = (is_object($data)) ? $this->serialize_header . serialize($data) : $data; + + return eaccelerator_put($this->key_prefix . $var, $data, $ttl); + } + + /** + * Remove an item from the cache + * + * @access protected + * @param string $var Cache key + * @return bool True if the operation succeeded + */ + function _delete($var) + { + return eaccelerator_rm($this->key_prefix . $var); + } +} diff --git a/sources/phpBB/phpbb/cache/driver/file.php b/sources/phpBB/phpbb/cache/driver/file.php new file mode 100644 index 0000000..fd5bce4 --- /dev/null +++ b/sources/phpBB/phpbb/cache/driver/file.php @@ -0,0 +1,587 @@ + +* @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\cache\driver; + +/** +* ACM File Based Caching +*/ +class file extends \phpbb\cache\driver\base +{ + var $var_expires = array(); + + /** + * 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/'; + } + + /** + * {@inheritDoc} + */ + function load() + { + return $this->_read('data_global'); + } + + /** + * {@inheritDoc} + */ + function unload() + { + parent::unload(); + unset($this->var_expires); + $this->var_expires = array(); + } + + /** + * {@inheritDoc} + */ + function save() + { + if (!$this->is_modified) + { + return; + } + + global $phpEx; + + 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)) + { + // 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.'); + exit; + } + + die('Fatal: Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx); + exit; + } + + $this->is_modified = false; + } + + /** + * {@inheritDoc} + */ + function tidy() + { + global $phpEx; + + $dir = @opendir($this->cache_dir); + + if (!$dir) + { + return; + } + + $time = time(); + + while (($entry = readdir($dir)) !== false) + { + if (!preg_match('/^(sql_|data_(?!global))/', $entry)) + { + continue; + } + + if (!($handle = @fopen($this->cache_dir . $entry, 'rb'))) + { + continue; + } + + // Skip the PHP header + fgets($handle); + + // Skip expiration + $expires = (int) fgets($handle); + + fclose($handle); + + if ($time >= $expires) + { + $this->remove_file($this->cache_dir . $entry); + } + } + closedir($dir); + + if (file_exists($this->cache_dir . 'data_global.' . $phpEx)) + { + if (!sizeof($this->vars)) + { + $this->load(); + } + + foreach ($this->var_expires as $var_name => $expires) + { + if ($time >= $expires) + { + $this->destroy($var_name); + } + } + } + + set_config('cache_last_gc', time(), true); + } + + /** + * {@inheritDoc} + */ + function get($var_name) + { + if ($var_name[0] == '_') + { + if (!$this->_exists($var_name)) + { + return false; + } + + return $this->_read('data' . $var_name); + } + else + { + return ($this->_exists($var_name)) ? $this->vars[$var_name] : false; + } + } + + /** + * {@inheritDoc} + */ + function put($var_name, $var, $ttl = 31536000) + { + if ($var_name[0] == '_') + { + $this->_write('data' . $var_name, $var, time() + $ttl); + } + else + { + $this->vars[$var_name] = $var; + $this->var_expires[$var_name] = time() + $ttl; + $this->is_modified = true; + } + } + + /** + * {@inheritDoc} + */ + function purge() + { + parent::purge(); + $this->var_expires = array(); + } + + /** + * {@inheritDoc} + */ + function destroy($var_name, $table = '') + { + global $phpEx; + + if ($var_name == 'sql' && !empty($table)) + { + if (!is_array($table)) + { + $table = array($table); + } + + $dir = @opendir($this->cache_dir); + + if (!$dir) + { + return; + } + + while (($entry = readdir($dir)) !== false) + { + if (strpos($entry, 'sql_') !== 0) + { + continue; + } + + if (!($handle = @fopen($this->cache_dir . $entry, 'rb'))) + { + continue; + } + + // Skip the PHP header + fgets($handle); + + // Skip expiration + fgets($handle); + + // Grab the query, remove the LF + $query = substr(fgets($handle), 0, -1); + + fclose($handle); + + foreach ($table as $check_table) + { + // Better catch partial table names than no table names. ;) + if (strpos($query, $check_table) !== false) + { + $this->remove_file($this->cache_dir . $entry); + break; + } + } + } + closedir($dir); + + return; + } + + if (!$this->_exists($var_name)) + { + return; + } + + if ($var_name[0] == '_') + { + $this->remove_file($this->cache_dir . 'data' . $var_name . ".$phpEx", true); + } + else if (isset($this->vars[$var_name])) + { + $this->is_modified = true; + unset($this->vars[$var_name]); + unset($this->var_expires[$var_name]); + + // We save here to let the following cache hits succeed + $this->save(); + } + } + + /** + * {@inheritDoc} + */ + function _exists($var_name) + { + if ($var_name[0] == '_') + { + global $phpEx; + return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx"); + } + else + { + if (!sizeof($this->vars)) + { + $this->load(); + } + + if (!isset($this->var_expires[$var_name])) + { + return false; + } + + return (time() > $this->var_expires[$var_name]) ? false : isset($this->vars[$var_name]); + } + } + + /** + * {@inheritDoc} + */ + function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl) + { + // Remove extra spaces and tabs + $query = preg_replace('/[\n\r\s\t]+/', ' ', $query); + + $query_id = sizeof($this->sql_rowset); + $this->sql_rowset[$query_id] = array(); + $this->sql_row_pointer[$query_id] = 0; + + while ($row = $db->sql_fetchrow($query_result)) + { + $this->sql_rowset[$query_id][] = $row; + } + $db->sql_freeresult($query_result); + + if ($this->_write('sql_' . md5($query), $this->sql_rowset[$query_id], $ttl + time(), $query)) + { + return $query_id; + } + + return $query_result; + } + + /** + * Read cached data from a specified file + * + * @access private + * @param string $filename Filename to write + * @return mixed False if an error was encountered, otherwise the data type of the cached data + */ + function _read($filename) + { + global $phpEx; + + $file = "{$this->cache_dir}$filename.$phpEx"; + + $type = substr($filename, 0, strpos($filename, '_')); + + if (!file_exists($file)) + { + return false; + } + + if (!($handle = @fopen($file, 'rb'))) + { + return false; + } + + // Skip the PHP header + fgets($handle); + + if ($filename == 'data_global') + { + $this->vars = $this->var_expires = array(); + + $time = time(); + + while (($expires = (int) fgets($handle)) && !feof($handle)) + { + // Number of bytes of data + $bytes = substr(fgets($handle), 0, -1); + + if (!is_numeric($bytes) || ($bytes = (int) $bytes) === 0) + { + // We cannot process the file without a valid number of bytes + // so we discard it + fclose($handle); + + $this->vars = $this->var_expires = array(); + $this->is_modified = false; + + $this->remove_file($file); + + return false; + } + + if ($time >= $expires) + { + fseek($handle, $bytes, SEEK_CUR); + + continue; + } + + $var_name = substr(fgets($handle), 0, -1); + + // Read the length of bytes that consists of data. + $data = fread($handle, $bytes - strlen($var_name)); + $data = @unserialize($data); + + // Don't use the data if it was invalid + if ($data !== false) + { + $this->vars[$var_name] = $data; + $this->var_expires[$var_name] = $expires; + } + + // Absorb the LF + fgets($handle); + } + + fclose($handle); + + $this->is_modified = false; + + return true; + } + else + { + $data = false; + $line = 0; + + while (($buffer = fgets($handle)) && !feof($handle)) + { + $buffer = substr($buffer, 0, -1); // Remove the LF + + // $buffer is only used to read integers + // if it is non numeric we have an invalid + // cache file, which we will now remove. + if (!is_numeric($buffer)) + { + break; + } + + if ($line == 0) + { + $expires = (int) $buffer; + + if (time() >= $expires) + { + break; + } + + if ($type == 'sql') + { + // Skip the query + fgets($handle); + } + } + else if ($line == 1) + { + $bytes = (int) $buffer; + + // Never should have 0 bytes + if (!$bytes) + { + break; + } + + // Grab the serialized data + $data = fread($handle, $bytes); + + // Read 1 byte, to trigger EOF + fread($handle, 1); + + if (!feof($handle)) + { + // Somebody tampered with our data + $data = false; + } + break; + } + else + { + // Something went wrong + break; + } + $line++; + } + fclose($handle); + + // unserialize if we got some data + $data = ($data !== false) ? @unserialize($data) : $data; + + if ($data === false) + { + $this->remove_file($file); + return false; + } + + return $data; + } + } + + /** + * Write cache data to a specified file + * + * 'data_global' is a special case and the generated format is different for this file: + * + * + * (expiration) + * (length of var and serialised data) + * (var) + * (serialised data) + * ... (repeat) + * + * + * The other files have a similar format: + * + * + * (expiration) + * (query) [SQL files only] + * (length of serialised data) + * (serialised data) + * + * + * @access private + * @param string $filename Filename to write + * @param mixed $data Data to store + * @param int $expires Timestamp when the data expires + * @param string $query Query when caching SQL queries + * @return bool True if the file was successfully created, otherwise false + */ + function _write($filename, $data = null, $expires = 0, $query = '') + { + global $phpEx; + + $file = "{$this->cache_dir}$filename.$phpEx"; + + $lock = new \phpbb\lock\flock($file); + $lock->acquire(); + + if ($handle = @fopen($file, 'wb')) + { + // File header + fwrite($handle, '<' . '?php exit; ?' . '>'); + + if ($filename == 'data_global') + { + // Global data is a different format + foreach ($this->vars as $var => $data) + { + if (strpos($var, "\r") !== false || strpos($var, "\n") !== false) + { + // CR/LF would cause fgets() to read the cache file incorrectly + // do not cache test entries, they probably won't be read back + // the cache keys should really be alphanumeric with a few symbols. + continue; + } + $data = serialize($data); + + // Write out the expiration time + fwrite($handle, "\n" . $this->var_expires[$var] . "\n"); + + // Length of the remaining data for this var (ignoring two LF's) + fwrite($handle, strlen($data . $var) . "\n"); + fwrite($handle, $var . "\n"); + fwrite($handle, $data); + } + } + else + { + fwrite($handle, "\n" . $expires . "\n"); + + if (strpos($filename, 'sql_') === 0) + { + fwrite($handle, $query . "\n"); + } + $data = serialize($data); + + fwrite($handle, strlen($data) . "\n"); + fwrite($handle, $data); + } + + fclose($handle); + + if (!function_exists('phpbb_chmod')) + { + global $phpbb_root_path; + include($phpbb_root_path . 'includes/functions.' . $phpEx); + } + + phpbb_chmod($file, CHMOD_READ | CHMOD_WRITE); + + $return_value = true; + } + else + { + $return_value = false; + } + + $lock->release(); + + return $return_value; + } +} diff --git a/sources/phpBB/phpbb/cache/driver/memcache.php b/sources/phpBB/phpbb/cache/driver/memcache.php new file mode 100644 index 0000000..406ab11 --- /dev/null +++ b/sources/phpBB/phpbb/cache/driver/memcache.php @@ -0,0 +1,122 @@ + +* @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\cache\driver; + +if (!defined('PHPBB_ACM_MEMCACHE_PORT')) +{ + define('PHPBB_ACM_MEMCACHE_PORT', 11211); +} + +if (!defined('PHPBB_ACM_MEMCACHE_COMPRESS')) +{ + define('PHPBB_ACM_MEMCACHE_COMPRESS', false); +} + +if (!defined('PHPBB_ACM_MEMCACHE_HOST')) +{ + define('PHPBB_ACM_MEMCACHE_HOST', 'localhost'); +} + +if (!defined('PHPBB_ACM_MEMCACHE')) +{ + //can define multiple servers with host1/port1,host2/port2 format + define('PHPBB_ACM_MEMCACHE', PHPBB_ACM_MEMCACHE_HOST . '/' . PHPBB_ACM_MEMCACHE_PORT); +} + +/** +* ACM for Memcached +*/ +class memcache extends \phpbb\cache\driver\memory +{ + var $extension = 'memcache'; + + var $memcache; + var $flags = 0; + + function __construct() + { + // Call the parent constructor + parent::__construct(); + + $this->memcache = new \Memcache; + foreach(explode(',', PHPBB_ACM_MEMCACHE) as $u) + { + $parts = explode('/', $u); + $this->memcache->addServer(trim($parts[0]), trim($parts[1])); + } + $this->flags = (PHPBB_ACM_MEMCACHE_COMPRESS) ? MEMCACHE_COMPRESSED : 0; + } + + /** + * {@inheritDoc} + */ + function unload() + { + parent::unload(); + + $this->memcache->close(); + } + + /** + * {@inheritDoc} + */ + function purge() + { + $this->memcache->flush(); + + parent::purge(); + } + + /** + * Fetch an item from the cache + * + * @access protected + * @param string $var Cache key + * @return mixed Cached data + */ + function _read($var) + { + return $this->memcache->get($this->key_prefix . $var); + } + + /** + * Store data in the cache + * + * @access protected + * @param string $var Cache key + * @param mixed $data Data to store + * @param int $ttl Time-to-live of cached data + * @return bool True if the operation succeeded + */ + function _write($var, $data, $ttl = 2592000) + { + if (!$this->memcache->replace($this->key_prefix . $var, $data, $this->flags, $ttl)) + { + return $this->memcache->set($this->key_prefix . $var, $data, $this->flags, $ttl); + } + return true; + } + + /** + * Remove an item from the cache + * + * @access protected + * @param string $var Cache key + * @return bool True if the operation succeeded + */ + function _delete($var) + { + return $this->memcache->delete($this->key_prefix . $var); + } +} diff --git a/sources/phpBB/phpbb/cache/driver/memory.php b/sources/phpBB/phpbb/cache/driver/memory.php new file mode 100644 index 0000000..0b0e323 --- /dev/null +++ b/sources/phpBB/phpbb/cache/driver/memory.php @@ -0,0 +1,281 @@ + +* @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\cache\driver; + +/** +* ACM Abstract Memory Class +*/ +abstract class memory extends \phpbb\cache\driver\base +{ + var $key_prefix; + + /** + * Set cache path + */ + function __construct() + { + global $phpbb_root_path, $dbname, $table_prefix; + + $this->cache_dir = $phpbb_root_path . 'cache/'; + $this->key_prefix = substr(md5($dbname . $table_prefix), 0, 8) . '_'; + + if (!isset($this->extension) || !extension_loaded($this->extension)) + { + global $acm_type; + + trigger_error("Could not find required extension [{$this->extension}] for the ACM module $acm_type.", E_USER_ERROR); + } + + if (isset($this->function) && !function_exists($this->function)) + { + global $acm_type; + + trigger_error("The required function [{$this->function}] is not available for the ACM module $acm_type.", E_USER_ERROR); + } + } + + /** + * {@inheritDoc} + */ + function load() + { + // grab the global cache + $this->vars = $this->_read('global'); + + if ($this->vars !== false) + { + return true; + } + + return false; + } + + /** + * {@inheritDoc} + */ + function save() + { + if (!$this->is_modified) + { + return; + } + + $this->_write('global', $this->vars, 2592000); + + $this->is_modified = false; + } + + /** + * {@inheritDoc} + */ + function tidy() + { + // cache has auto GC, no need to have any code here :) + + set_config('cache_last_gc', time(), true); + } + + /** + * {@inheritDoc} + */ + function get($var_name) + { + if ($var_name[0] == '_') + { + if (!$this->_exists($var_name)) + { + return false; + } + + return $this->_read($var_name); + } + else + { + return ($this->_exists($var_name)) ? $this->vars[$var_name] : false; + } + } + + /** + * {@inheritDoc} + */ + function put($var_name, $var, $ttl = 2592000) + { + if ($var_name[0] == '_') + { + $this->_write($var_name, $var, $ttl); + } + else + { + $this->vars[$var_name] = $var; + $this->is_modified = true; + } + } + + /** + * {@inheritDoc} + */ + function destroy($var_name, $table = '') + { + if ($var_name == 'sql' && !empty($table)) + { + if (!is_array($table)) + { + $table = array($table); + } + + foreach ($table as $table_name) + { + // gives us the md5s that we want + $temp = $this->_read('sql_' . $table_name); + + if ($temp === false) + { + continue; + } + + // delete each query ref + foreach ($temp as $md5_id => $void) + { + $this->_delete('sql_' . $md5_id); + } + + // delete the table ref + $this->_delete('sql_' . $table_name); + } + + return; + } + + if (!$this->_exists($var_name)) + { + return; + } + + if ($var_name[0] == '_') + { + $this->_delete($var_name); + } + else if (isset($this->vars[$var_name])) + { + $this->is_modified = true; + unset($this->vars[$var_name]); + + // We save here to let the following cache hits succeed + $this->save(); + } + } + + /** + * {@inheritDoc} + */ + function _exists($var_name) + { + if ($var_name[0] == '_') + { + return $this->_isset($var_name); + } + else + { + if (!sizeof($this->vars)) + { + $this->load(); + } + + return isset($this->vars[$var_name]); + } + } + + /** + * {@inheritDoc} + */ + function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl) + { + // Remove extra spaces and tabs + $query = preg_replace('/[\n\r\s\t]+/', ' ', $query); + $hash = md5($query); + + // determine which tables this query belongs to + // Some queries use backticks, namely the get_database_size() query + // don't check for conformity, the SQL would error and not reach here. + if (!preg_match_all('/(?:FROM \\(?(`?\\w+`?(?: \\w+)?(?:, ?`?\\w+`?(?: \\w+)?)*)\\)?)|(?:JOIN (`?\\w+`?(?: \\w+)?))/', $query, $regs, PREG_SET_ORDER)) + { + // Bail out if the match fails. + return $query_result; + } + + $tables = array(); + foreach ($regs as $match) + { + if ($match[0][0] == 'F') + { + $tables = array_merge($tables, array_map('trim', explode(',', $match[1]))); + } + else + { + $tables[] = $match[2]; + } + } + + foreach ($tables as $table_name) + { + // Remove backticks + $table_name = ($table_name[0] == '`') ? substr($table_name, 1, -1) : $table_name; + + if (($pos = strpos($table_name, ' ')) !== false) + { + $table_name = substr($table_name, 0, $pos); + } + + $temp = $this->_read('sql_' . $table_name); + + if ($temp === false) + { + $temp = array(); + } + + $temp[$hash] = 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; + + while ($row = $db->sql_fetchrow($query_result)) + { + $this->sql_rowset[$query_id][] = $row; + } + $db->sql_freeresult($query_result); + + $this->_write('sql_' . $hash, $this->sql_rowset[$query_id], $ttl); + + return $query_id; + } + + /** + * Check if a cache var exists + * + * @access protected + * @param string $var Cache key + * @return bool True if it exists, otherwise false + */ + function _isset($var) + { + // Most caches don't need to check + return true; + } +} diff --git a/sources/phpBB/phpbb/cache/driver/null.php b/sources/phpBB/phpbb/cache/driver/null.php new file mode 100644 index 0000000..a45cf97 --- /dev/null +++ b/sources/phpBB/phpbb/cache/driver/null.php @@ -0,0 +1,151 @@ + +* @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\cache\driver; + +/** +* ACM Null Caching +*/ +class null extends \phpbb\cache\driver\base +{ + /** + * Set cache path + */ + function __construct() + { + } + + /** + * {@inheritDoc} + */ + function load() + { + return true; + } + + /** + * {@inheritDoc} + */ + function unload() + { + } + + /** + * {@inheritDoc} + */ + function save() + { + } + + /** + * {@inheritDoc} + */ + function tidy() + { + // This cache always has a tidy room. + set_config('cache_last_gc', time(), true); + } + + /** + * {@inheritDoc} + */ + function get($var_name) + { + return false; + } + + /** + * {@inheritDoc} + */ + function put($var_name, $var, $ttl = 0) + { + } + + /** + * {@inheritDoc} + */ + function purge() + { + } + + /** + * {@inheritDoc} + */ + function destroy($var_name, $table = '') + { + } + + /** + * {@inheritDoc} + */ + function _exists($var_name) + { + return false; + } + + /** + * {@inheritDoc} + */ + function sql_load($query) + { + return false; + } + + /** + * {@inheritDoc} + */ + function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl) + { + return $query_result; + } + + /** + * {@inheritDoc} + */ + function sql_exists($query_id) + { + return false; + } + + /** + * {@inheritDoc} + */ + function sql_fetchrow($query_id) + { + return false; + } + + /** + * {@inheritDoc} + */ + function sql_fetchfield($query_id, $field) + { + return false; + } + + /** + * {@inheritDoc} + */ + function sql_rowseek($rownum, $query_id) + { + return false; + } + + /** + * {@inheritDoc} + */ + function sql_freeresult($query_id) + { + return false; + } +} diff --git a/sources/phpBB/phpbb/cache/driver/redis.php b/sources/phpBB/phpbb/cache/driver/redis.php new file mode 100644 index 0000000..eda7744 --- /dev/null +++ b/sources/phpBB/phpbb/cache/driver/redis.php @@ -0,0 +1,158 @@ + +* @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\cache\driver; + +if (!defined('PHPBB_ACM_REDIS_PORT')) +{ + define('PHPBB_ACM_REDIS_PORT', 6379); +} + +if (!defined('PHPBB_ACM_REDIS_HOST')) +{ + define('PHPBB_ACM_REDIS_HOST', 'localhost'); +} + +/** +* ACM for Redis +* +* Compatible with the php extension phpredis available +* at https://github.com/nicolasff/phpredis +* +*/ +class redis extends \phpbb\cache\driver\memory +{ + var $extension = 'redis'; + + var $redis; + + /** + * Creates a redis cache driver. + * + * The following global constants affect operation: + * + * PHPBB_ACM_REDIS_HOST + * PHPBB_ACM_REDIS_PORT + * PHPBB_ACM_REDIS_PASSWORD + * PHPBB_ACM_REDIS_DB + * + * There are no publicly documented constructor parameters. + */ + function __construct() + { + // Call the parent constructor + parent::__construct(); + + $this->redis = new \Redis(); + + $args = func_get_args(); + if (!empty($args)) + { + $ok = call_user_func_array(array($this->redis, 'connect'), $args); + } + else + { + $ok = $this->redis->connect(PHPBB_ACM_REDIS_HOST, PHPBB_ACM_REDIS_PORT); + } + + if (!$ok) + { + trigger_error('Could not connect to redis server'); + } + + if (defined('PHPBB_ACM_REDIS_PASSWORD')) + { + if (!$this->redis->auth(PHPBB_ACM_REDIS_PASSWORD)) + { + global $acm_type; + + trigger_error("Incorrect password for the ACM module $acm_type.", E_USER_ERROR); + } + } + + $this->redis->setOption(\Redis::OPT_SERIALIZER, \Redis::SERIALIZER_PHP); + $this->redis->setOption(\Redis::OPT_PREFIX, $this->key_prefix); + + if (defined('PHPBB_ACM_REDIS_DB')) + { + if (!$this->redis->select(PHPBB_ACM_REDIS_DB)) + { + global $acm_type; + + trigger_error("Incorrect database for the ACM module $acm_type.", E_USER_ERROR); + } + } + } + + /** + * {@inheritDoc} + */ + function unload() + { + parent::unload(); + + $this->redis->close(); + } + + /** + * {@inheritDoc} + */ + function purge() + { + $this->redis->flushDB(); + + parent::purge(); + } + + /** + * Fetch an item from the cache + * + * @access protected + * @param string $var Cache key + * @return mixed Cached data + */ + function _read($var) + { + return $this->redis->get($var); + } + + /** + * Store data in the cache + * + * @access protected + * @param string $var Cache key + * @param mixed $data Data to store + * @param int $ttl Time-to-live of cached data + * @return bool True if the operation succeeded + */ + function _write($var, $data, $ttl = 2592000) + { + return $this->redis->setex($var, $ttl, $data); + } + + /** + * Remove an item from the cache + * + * @access protected + * @param string $var Cache key + * @return bool True if the operation succeeded + */ + function _delete($var) + { + if ($this->redis->delete($var) > 0) + { + return true; + } + return false; + } +} diff --git a/sources/phpBB/phpbb/cache/driver/wincache.php b/sources/phpBB/phpbb/cache/driver/wincache.php new file mode 100644 index 0000000..632b534 --- /dev/null +++ b/sources/phpBB/phpbb/cache/driver/wincache.php @@ -0,0 +1,73 @@ + +* @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\cache\driver; + +/** +* ACM for WinCache +*/ +class wincache extends \phpbb\cache\driver\memory +{ + var $extension = 'wincache'; + + /** + * {@inheritDoc} + */ + function purge() + { + wincache_ucache_clear(); + + parent::purge(); + } + + /** + * Fetch an item from the cache + * + * @access protected + * @param string $var Cache key + * @return mixed Cached data + */ + function _read($var) + { + $success = false; + $result = wincache_ucache_get($this->key_prefix . $var, $success); + + return ($success) ? $result : false; + } + + /** + * Store data in the cache + * + * @access protected + * @param string $var Cache key + * @param mixed $data Data to store + * @param int $ttl Time-to-live of cached data + * @return bool True if the operation succeeded + */ + function _write($var, $data, $ttl = 2592000) + { + return wincache_ucache_set($this->key_prefix . $var, $data, $ttl); + } + + /** + * Remove an item from the cache + * + * @access protected + * @param string $var Cache key + * @return bool True if the operation succeeded + */ + function _delete($var) + { + return wincache_ucache_delete($this->key_prefix . $var); + } +} diff --git a/sources/phpBB/phpbb/cache/driver/xcache.php b/sources/phpBB/phpbb/cache/driver/xcache.php new file mode 100644 index 0000000..0c845a6 --- /dev/null +++ b/sources/phpBB/phpbb/cache/driver/xcache.php @@ -0,0 +1,107 @@ + +* @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\cache\driver; + +/** +* ACM for XCache +* +* To use this module you need ini_get() enabled and the following INI settings configured as follows: +* - xcache.var_size > 0 +* - xcache.admin.enable_auth = off (or xcache.admin.user and xcache.admin.password set) +* +*/ +class xcache extends \phpbb\cache\driver\memory +{ + var $extension = 'XCache'; + + function __construct() + { + parent::__construct(); + + if (!function_exists('ini_get') || (int) ini_get('xcache.var_size') <= 0) + { + trigger_error('Increase xcache.var_size setting above 0 or enable ini_get() to use this ACM module.', E_USER_ERROR); + } + } + + /** + * {@inheritDoc} + */ + function purge() + { + // Run before for XCache, if admin functions are disabled it will terminate execution + parent::purge(); + + // If the admin authentication is enabled but not set up, this will cause a nasty error. + // Not much we can do about it though. + $n = xcache_count(XC_TYPE_VAR); + + for ($i = 0; $i < $n; $i++) + { + xcache_clear_cache(XC_TYPE_VAR, $i); + } + } + + /** + * Fetch an item from the cache + * + * @access protected + * @param string $var Cache key + * @return mixed Cached data + */ + function _read($var) + { + $result = xcache_get($this->key_prefix . $var); + + return ($result !== null) ? $result : false; + } + + /** + * Store data in the cache + * + * @access protected + * @param string $var Cache key + * @param mixed $data Data to store + * @param int $ttl Time-to-live of cached data + * @return bool True if the operation succeeded + */ + function _write($var, $data, $ttl = 2592000) + { + return xcache_set($this->key_prefix . $var, $data, $ttl); + } + + /** + * Remove an item from the cache + * + * @access protected + * @param string $var Cache key + * @return bool True if the operation succeeded + */ + function _delete($var) + { + return xcache_unset($this->key_prefix . $var); + } + + /** + * Check if a cache var exists + * + * @access protected + * @param string $var Cache key + * @return bool True if it exists, otherwise false + */ + function _isset($var) + { + return xcache_isset($this->key_prefix . $var); + } +} diff --git a/sources/phpBB/phpbb/cache/service.php b/sources/phpBB/phpbb/cache/service.php new file mode 100644 index 0000000..56727c2 --- /dev/null +++ b/sources/phpBB/phpbb/cache/service.php @@ -0,0 +1,390 @@ + +* @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\cache; + +/** +* Class for grabbing/handling cached entries +*/ +class service +{ + /** + * Cache driver. + * + * @var \phpbb\cache\driver\driver_interface + */ + protected $driver; + + /** + * The config. + * + * @var \phpbb\config\config + */ + protected $config; + + /** + * Database connection. + * + * @var \phpbb\db\driver\driver_interface + */ + protected $db; + + /** + * Root path. + * + * @var string + */ + protected $phpbb_root_path; + + /** + * PHP file extension. + * + * @var string + */ + protected $php_ext; + + /** + * Creates a cache service around a cache driver + * + * @param \phpbb\cache\driver\driver_interface $driver The cache driver + * @param \phpbb\config\config $config The config + * @param \phpbb\db\driver\driver_interface $db Database connection + * @param string $phpbb_root_path Root path + * @param string $php_ext PHP file extension + */ + public function __construct(\phpbb\cache\driver\driver_interface $driver, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, $phpbb_root_path, $php_ext) + { + $this->set_driver($driver); + $this->config = $config; + $this->db = $db; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + } + + /** + * Returns the cache driver used by this cache service. + * + * @return \phpbb\cache\driver\driver_interface The cache driver + */ + public function get_driver() + { + return $this->driver; + } + + /** + * Replaces the cache driver used by this cache service. + * + * @param \phpbb\cache\driver\driver_interface $driver The cache driver + */ + public function set_driver(\phpbb\cache\driver\driver_interface $driver) + { + $this->driver = $driver; + } + + public function __call($method, $arguments) + { + return call_user_func_array(array($this->driver, $method), $arguments); + } + + /** + * Obtain list of naughty words and build preg style replacement arrays for use by the + * calling script + */ + function obtain_word_list() + { + if (($censors = $this->driver->get('_word_censors')) === false) + { + $sql = 'SELECT word, replacement + FROM ' . WORDS_TABLE; + $result = $this->db->sql_query($sql); + + $censors = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $censors['match'][] = get_censor_preg_expression($row['word']); + $censors['replace'][] = $row['replacement']; + } + $this->db->sql_freeresult($result); + + $this->driver->put('_word_censors', $censors); + } + + return $censors; + } + + /** + * Obtain currently listed icons + */ + function obtain_icons() + { + if (($icons = $this->driver->get('_icons')) === false) + { + // Topic icons + $sql = 'SELECT * + FROM ' . ICONS_TABLE . ' + ORDER BY icons_order'; + $result = $this->db->sql_query($sql); + + $icons = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $icons[$row['icons_id']]['img'] = $row['icons_url']; + $icons[$row['icons_id']]['width'] = (int) $row['icons_width']; + $icons[$row['icons_id']]['height'] = (int) $row['icons_height']; + $icons[$row['icons_id']]['display'] = (bool) $row['display_on_posting']; + } + $this->db->sql_freeresult($result); + + $this->driver->put('_icons', $icons); + } + + return $icons; + } + + /** + * Obtain ranks + */ + function obtain_ranks() + { + if (($ranks = $this->driver->get('_ranks')) === false) + { + $sql = 'SELECT * + FROM ' . RANKS_TABLE . ' + ORDER BY rank_min DESC'; + $result = $this->db->sql_query($sql); + + $ranks = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + if ($row['rank_special']) + { + unset($row['rank_min']); + $ranks['special'][$row['rank_id']] = $row; + } + else + { + $ranks['normal'][$row['rank_id']] = $row; + } + } + $this->db->sql_freeresult($result); + + $this->driver->put('_ranks', $ranks); + } + + return $ranks; + } + + /** + * Obtain allowed extensions + * + * @param mixed $forum_id If false then check for private messaging, if int then check for forum id. If true, then only return extension informations. + * + * @return array allowed extensions array. + */ + function obtain_attach_extensions($forum_id) + { + if (($extensions = $this->driver->get('_extensions')) === false) + { + $extensions = array( + '_allowed_post' => array(), + '_allowed_pm' => array(), + ); + + // The rule is to only allow those extensions defined. ;) + $sql = 'SELECT e.extension, g.* + FROM ' . EXTENSIONS_TABLE . ' e, ' . EXTENSION_GROUPS_TABLE . ' g + WHERE e.group_id = g.group_id + AND (g.allow_group = 1 OR g.allow_in_pm = 1)'; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $extension = strtolower(trim($row['extension'])); + + $extensions[$extension] = array( + 'display_cat' => (int) $row['cat_id'], + 'download_mode' => (int) $row['download_mode'], + 'upload_icon' => trim($row['upload_icon']), + 'max_filesize' => (int) $row['max_filesize'], + 'allow_group' => $row['allow_group'], + 'allow_in_pm' => $row['allow_in_pm'], + 'group_name' => $row['group_name'], + ); + + $allowed_forums = ($row['allowed_forums']) ? unserialize(trim($row['allowed_forums'])) : array(); + + // Store allowed extensions forum wise + if ($row['allow_group']) + { + $extensions['_allowed_post'][$extension] = (!sizeof($allowed_forums)) ? 0 : $allowed_forums; + } + + if ($row['allow_in_pm']) + { + $extensions['_allowed_pm'][$extension] = 0; + } + } + $this->db->sql_freeresult($result); + + $this->driver->put('_extensions', $extensions); + } + + // Forum post + if ($forum_id === false) + { + // We are checking for private messages, therefore we only need to get the pm extensions... + $return = array('_allowed_' => array()); + + foreach ($extensions['_allowed_pm'] as $extension => $check) + { + $return['_allowed_'][$extension] = 0; + $return[$extension] = $extensions[$extension]; + } + + $extensions = $return; + } + else if ($forum_id === true) + { + return $extensions; + } + else + { + $forum_id = (int) $forum_id; + $return = array('_allowed_' => array()); + + foreach ($extensions['_allowed_post'] as $extension => $check) + { + // Check for allowed forums + if (is_array($check)) + { + $allowed = (!in_array($forum_id, $check)) ? false : true; + } + else + { + $allowed = true; + } + + if ($allowed) + { + $return['_allowed_'][$extension] = 0; + $return[$extension] = $extensions[$extension]; + } + } + + $extensions = $return; + } + + if (!isset($extensions['_allowed_'])) + { + $extensions['_allowed_'] = array(); + } + + return $extensions; + } + + /** + * Obtain active bots + */ + function obtain_bots() + { + if (($bots = $this->driver->get('_bots')) === false) + { + switch ($this->db->get_sql_layer()) + { + case 'mssql': + case 'mssql_odbc': + case 'mssqlnative': + $sql = 'SELECT user_id, bot_agent, bot_ip + FROM ' . BOTS_TABLE . ' + WHERE bot_active = 1 + ORDER BY LEN(bot_agent) DESC'; + break; + + // LENGTH supported by MySQL, IBM DB2 and Oracle for sure... + default: + $sql = 'SELECT user_id, bot_agent, bot_ip + FROM ' . BOTS_TABLE . ' + WHERE bot_active = 1 + ORDER BY LENGTH(bot_agent) DESC'; + break; + } + $result = $this->db->sql_query($sql); + + $bots = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $bots[] = $row; + } + $this->db->sql_freeresult($result); + + $this->driver->put('_bots', $bots); + } + + return $bots; + } + + /** + * Obtain cfg file data + */ + function obtain_cfg_items($style) + { + $parsed_array = $this->driver->get('_cfg_' . $style['style_path']); + + if ($parsed_array === false) + { + $parsed_array = array(); + } + + $filename = $this->phpbb_root_path . 'styles/' . $style['style_path'] . '/style.cfg'; + + if (!file_exists($filename)) + { + return $parsed_array; + } + + if (!isset($parsed_array['filetime']) || (($this->config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime']))) + { + // Re-parse cfg file + $parsed_array = parse_cfg_file($filename); + $parsed_array['filetime'] = @filemtime($filename); + + $this->driver->put('_cfg_' . $style['style_path'], $parsed_array); + } + + return $parsed_array; + } + + /** + * Obtain disallowed usernames + */ + function obtain_disallowed_usernames() + { + if (($usernames = $this->driver->get('_disallowed_usernames')) === false) + { + $sql = 'SELECT disallow_username + FROM ' . DISALLOW_TABLE; + $result = $this->db->sql_query($sql); + + $usernames = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $usernames[] = str_replace('%', '.*?', preg_quote(utf8_clean_string($row['disallow_username']), '#')); + } + $this->db->sql_freeresult($result); + + $this->driver->put('_disallowed_usernames', $usernames); + } + + return $usernames; + } +} diff --git a/sources/phpBB/phpbb/captcha/char_cube3d.php b/sources/phpBB/phpbb/captcha/char_cube3d.php new file mode 100644 index 0000000..a712b16 --- /dev/null +++ b/sources/phpBB/phpbb/captcha/char_cube3d.php @@ -0,0 +1,277 @@ + +* @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\captcha; + +class char_cube3d +{ + var $bitmap; + var $bitmap_width; + var $bitmap_height; + + var $basis_matrix = array(array(1, 0, 0), array(0, 1, 0), array(0, 0, 1)); + var $abs_x = array(1, 0); + var $abs_y = array(0, 1); + var $x = 0; + var $y = 1; + var $z = 2; + var $letter = ''; + + /** + */ + function __construct(&$bitmaps, $letter) + { + $this->bitmap = $bitmaps['data'][$letter]; + $this->bitmap_width = $bitmaps['width']; + $this->bitmap_height = $bitmaps['height']; + + $this->basis_matrix[0][0] = mt_rand(-600, 600); + $this->basis_matrix[0][1] = mt_rand(-600, 600); + $this->basis_matrix[0][2] = (mt_rand(0, 1) * 2000) - 1000; + $this->basis_matrix[1][0] = mt_rand(-1000, 1000); + $this->basis_matrix[1][1] = mt_rand(-1000, 1000); + $this->basis_matrix[1][2] = mt_rand(-1000, 1000); + + $this->normalize($this->basis_matrix[0]); + $this->normalize($this->basis_matrix[1]); + $this->basis_matrix[2] = $this->cross_product($this->basis_matrix[0], $this->basis_matrix[1]); + $this->normalize($this->basis_matrix[2]); + + // $this->basis_matrix[1] might not be (probably isn't) orthogonal to $basis_matrix[0] + $this->basis_matrix[1] = $this->cross_product($this->basis_matrix[0], $this->basis_matrix[2]); + $this->normalize($this->basis_matrix[1]); + + // Make sure our cube is facing into the canvas (assuming +z == in) + for ($i = 0; $i < 3; ++$i) + { + if ($this->basis_matrix[$i][2] < 0) + { + $this->basis_matrix[$i][0] *= -1; + $this->basis_matrix[$i][1] *= -1; + $this->basis_matrix[$i][2] *= -1; + } + } + + // Force our "z" basis vector to be the one with greatest absolute z value + $this->x = 0; + $this->y = 1; + $this->z = 2; + + // Swap "y" with "z" + if ($this->basis_matrix[1][2] > $this->basis_matrix[2][2]) + { + $this->z = 1; + $this->y = 2; + } + + // Swap "x" with "z" + if ($this->basis_matrix[0][2] > $this->basis_matrix[$this->z][2]) + { + $this->x = $this->z; + $this->z = 0; + } + + // Still need to determine which of $x,$y are which. + // wrong orientation if y's y-component is less than it's x-component + // likewise if x's x-component is less than it's y-component + // if they disagree, go with the one with the greater weight difference. + // rotate if positive + $weight = (abs($this->basis_matrix[$this->x][1]) - abs($this->basis_matrix[$this->x][0])) + (abs($this->basis_matrix[$this->y][0]) - abs($this->basis_matrix[$this->y][1])); + + // Swap "x" with "y" + if ($weight > 0) + { + list($this->x, $this->y) = array($this->y, $this->x); + } + + $this->abs_x = array($this->basis_matrix[$this->x][0], $this->basis_matrix[$this->x][1]); + $this->abs_y = array($this->basis_matrix[$this->y][0], $this->basis_matrix[$this->y][1]); + + if ($this->abs_x[0] < 0) + { + $this->abs_x[0] *= -1; + $this->abs_x[1] *= -1; + } + + if ($this->abs_y[1] > 0) + { + $this->abs_y[0] *= -1; + $this->abs_y[1] *= -1; + } + + $this->letter = $letter; + } + + /** + * Draw a character + */ + function drawchar($scale, $xoff, $yoff, $img, $background, $colours) + { + $width = $this->bitmap_width; + $height = $this->bitmap_height; + $bitmap = $this->bitmap; + + $colour1 = $colours[array_rand($colours)]; + $colour2 = $colours[array_rand($colours)]; + + $swapx = ($this->basis_matrix[$this->x][0] > 0); + $swapy = ($this->basis_matrix[$this->y][1] < 0); + + for ($y = 0; $y < $height; ++$y) + { + for ($x = 0; $x < $width; ++$x) + { + $xp = ($swapx) ? ($width - $x - 1) : $x; + $yp = ($swapy) ? ($height - $y - 1) : $y; + + if ($bitmap[$height - $yp - 1][$xp]) + { + $dx = $this->scale($this->abs_x, ($xp - ($swapx ? ($width / 2) : ($width / 2) - 1)) * $scale); + $dy = $this->scale($this->abs_y, ($yp - ($swapy ? ($height / 2) : ($height / 2) - 1)) * $scale); + $xo = $xoff + $dx[0] + $dy[0]; + $yo = $yoff + $dx[1] + $dy[1]; + + $origin = array(0, 0, 0); + $xvec = $this->scale($this->basis_matrix[$this->x], $scale); + $yvec = $this->scale($this->basis_matrix[$this->y], $scale); + $face_corner = $this->sum2($xvec, $yvec); + + $zvec = $this->scale($this->basis_matrix[$this->z], $scale); + $x_corner = $this->sum2($xvec, $zvec); + $y_corner = $this->sum2($yvec, $zvec); + + imagefilledpolygon($img, $this->gen_poly($xo, $yo, $origin, $xvec, $x_corner,$zvec), 4, $colour1); + imagefilledpolygon($img, $this->gen_poly($xo, $yo, $origin, $yvec, $y_corner,$zvec), 4, $colour2); + + $face = $this->gen_poly($xo, $yo, $origin, $xvec, $face_corner, $yvec); + + imagefilledpolygon($img, $face, 4, $background); + imagepolygon($img, $face, 4, $colour1); + } + } + } + } + + /* + * return a roughly acceptable range of sizes for rendering with this texttype + */ + function range() + { + return array(3, 4); + } + + /** + * Vector length + */ + function vectorlen($vector) + { + return sqrt(pow($vector[0], 2) + pow($vector[1], 2) + pow($vector[2], 2)); + } + + /** + * Normalize + */ + function normalize(&$vector, $length = 1) + { + $length = (( $length < 1) ? 1 : $length); + $length /= $this->vectorlen($vector); + $vector[0] *= $length; + $vector[1] *= $length; + $vector[2] *= $length; + } + + /** + */ + function cross_product($vector1, $vector2) + { + $retval = array(0, 0, 0); + $retval[0] = (($vector1[1] * $vector2[2]) - ($vector1[2] * $vector2[1])); + $retval[1] = -(($vector1[0] * $vector2[2]) - ($vector1[2] * $vector2[0])); + $retval[2] = (($vector1[0] * $vector2[1]) - ($vector1[1] * $vector2[0])); + + return $retval; + } + + /** + */ + function sum($vector1, $vector2) + { + return array($vector1[0] + $vector2[0], $vector1[1] + $vector2[1], $vector1[2] + $vector2[2]); + } + + /** + */ + function sum2($vector1, $vector2) + { + return array($vector1[0] + $vector2[0], $vector1[1] + $vector2[1]); + } + + /** + */ + function scale($vector, $length) + { + if (sizeof($vector) == 2) + { + return array($vector[0] * $length, $vector[1] * $length); + } + + return array($vector[0] * $length, $vector[1] * $length, $vector[2] * $length); + } + + /** + */ + function gen_poly($xoff, $yoff, &$vec1, &$vec2, &$vec3, &$vec4) + { + $poly = array(); + $poly[0] = $xoff + $vec1[0]; + $poly[1] = $yoff + $vec1[1]; + $poly[2] = $xoff + $vec2[0]; + $poly[3] = $yoff + $vec2[1]; + $poly[4] = $xoff + $vec3[0]; + $poly[5] = $yoff + $vec3[1]; + $poly[6] = $xoff + $vec4[0]; + $poly[7] = $yoff + $vec4[1]; + + return $poly; + } + + /** + * dimensions + */ + function dimensions($size) + { + $xn = $this->scale($this->basis_matrix[$this->x], -($this->bitmap_width / 2) * $size); + $xp = $this->scale($this->basis_matrix[$this->x], ($this->bitmap_width / 2) * $size); + $yn = $this->scale($this->basis_matrix[$this->y], -($this->bitmap_height / 2) * $size); + $yp = $this->scale($this->basis_matrix[$this->y], ($this->bitmap_height / 2) * $size); + + $p = array(); + $p[0] = $this->sum2($xn, $yn); + $p[1] = $this->sum2($xp, $yn); + $p[2] = $this->sum2($xp, $yp); + $p[3] = $this->sum2($xn, $yp); + + $min_x = $max_x = $p[0][0]; + $min_y = $max_y = $p[0][1]; + + for ($i = 1; $i < 4; ++$i) + { + $min_x = ($min_x > $p[$i][0]) ? $p[$i][0] : $min_x; + $min_y = ($min_y > $p[$i][1]) ? $p[$i][1] : $min_y; + $max_x = ($max_x < $p[$i][0]) ? $p[$i][0] : $max_x; + $max_y = ($max_y < $p[$i][1]) ? $p[$i][1] : $max_y; + } + + return array($min_x, $min_y, $max_x, $max_y); + } +} diff --git a/sources/phpBB/phpbb/captcha/colour_manager.php b/sources/phpBB/phpbb/captcha/colour_manager.php new file mode 100644 index 0000000..6ca3c3f --- /dev/null +++ b/sources/phpBB/phpbb/captcha/colour_manager.php @@ -0,0 +1,527 @@ + +* @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\captcha; + +class colour_manager +{ + var $img; + var $mode; + var $colours; + var $named_colours; + + /** + * Create the colour manager, link it to the image resource + */ + function __construct($img, $background = false, $mode = 'ahsv') + { + $this->img = $img; + $this->mode = $mode; + $this->colours = array(); + $this->named_colours = array(); + + if ($background !== false) + { + $bg = $this->allocate_named('background', $background); + imagefill($this->img, 0, 0, $bg); + } + } + + /** + * Lookup a named colour resource + */ + function get_resource($named_colour) + { + if (isset($this->named_colours[$named_colour])) + { + return $this->named_colours[$named_colour]; + } + + if (isset($this->named_rgb[$named_colour])) + { + return $this->allocate_named($named_colour, $this->named_rgb[$named_colour], 'rgb'); + } + + return false; + } + + /** + * Assign a name to a colour resource + */ + function name_colour($name, $resource) + { + $this->named_colours[$name] = $resource; + } + + /** + * names and allocates a colour resource + */ + function allocate_named($name, $colour, $mode = false) + { + $resource = $this->allocate($colour, $mode); + + if ($resource !== false) + { + $this->name_colour($name, $resource); + } + return $resource; + } + + /** + * allocates a specified colour into the image + */ + function allocate($colour, $mode = false) + { + if ($mode === false) + { + $mode = $this->mode; + } + + if (!is_array($colour)) + { + if (isset($this->named_rgb[$colour])) + { + return $this->allocate_named($colour, $this->named_rgb[$colour], 'rgb'); + } + + if (!is_int($colour)) + { + return false; + } + + $mode = 'rgb'; + $colour = array(255 & ($colour >> 16), 255 & ($colour >> 8), 255 & $colour); + } + + if (isset($colour['mode'])) + { + $mode = $colour['mode']; + unset($colour['mode']); + } + + if (isset($colour['random'])) + { + unset($colour['random']); + // everything else is params + return $this->random_colour($colour, $mode); + } + + $rgb = $this->model_convert($colour, $mode, 'rgb'); + $store = ($this->mode == 'rgb') ? $rgb : $this->model_convert($colour, $mode, $this->mode); + $resource = imagecolorallocate($this->img, $rgb[0], $rgb[1], $rgb[2]); + $this->colours[$resource] = $store; + + return $resource; + } + + /** + * randomly generates a colour, with optional params + */ + function random_colour($params = array(), $mode = false) + { + if ($mode === false) + { + $mode = $this->mode; + } + + switch ($mode) + { + case 'rgb': + // @TODO random rgb generation. do we intend to do this, or is it just too tedious? + break; + + case 'ahsv': + case 'hsv': + default: + + $default_params = array( + 'hue_bias' => false, // degree / 'r'/'g'/'b'/'c'/'m'/'y' /'o' + 'hue_range' => false, // if hue bias, then difference range +/- from bias + 'min_saturation' => 30, // 0 - 100 + 'max_saturation' => 80, // 0 - 100 + 'min_value' => 30, // 0 - 100 + 'max_value' => 80, // 0 - 100 + ); + + $alt = ($mode == 'ahsv') ? true : false; + $params = array_merge($default_params, $params); + + $min_hue = 0; + $max_hue = 359; + $min_saturation = max(0, $params['min_saturation']); + $max_saturation = min(100, $params['max_saturation']); + $min_value = max(0, $params['min_value']); + $max_value = min(100, $params['max_value']); + + if ($params['hue_bias'] !== false) + { + if (is_numeric($params['hue_bias'])) + { + $h = intval($params['hue_bias']) % 360; + } + else + { + switch ($params['hue_bias']) + { + case 'o': + $h = $alt ? 60 : 30; + break; + + case 'y': + $h = $alt ? 120 : 60; + break; + + case 'g': + $h = $alt ? 180 : 120; + break; + + case 'c': + $h = $alt ? 210 : 180; + break; + + case 'b': + $h = 240; + break; + + case 'm': + $h = 300; + break; + + case 'r': + default: + $h = 0; + break; + } + } + + $min_hue = $h + 360; + $max_hue = $h + 360; + + if ($params['hue_range']) + { + $min_hue -= min(180, $params['hue_range']); + $max_hue += min(180, $params['hue_range']); + } + } + + $h = mt_rand($min_hue, $max_hue); + $s = mt_rand($min_saturation, $max_saturation); + $v = mt_rand($min_value, $max_value); + + return $this->allocate(array($h, $s, $v), $mode); + + break; + } + } + + /** + */ + function colour_scheme($resource, $include_original = true) + { + $mode = 'hsv'; + + if (($pre = $this->get_resource($resource)) !== false) + { + $resource = $pre; + } + + $colour = $this->model_convert($this->colours[$resource], $this->mode, $mode); + $results = ($include_original) ? array($resource) : array(); + $colour2 = $colour3 = $colour4 = $colour; + $colour2[0] += 150; + $colour3[0] += 180; + $colour4[0] += 210; + + $results[] = $this->allocate($colour2, $mode); + $results[] = $this->allocate($colour3, $mode); + $results[] = $this->allocate($colour4, $mode); + + return $results; + } + + /** + */ + function mono_range($resource, $count = 5, $include_original = true) + { + if (is_array($resource)) + { + $results = array(); + for ($i = 0, $size = sizeof($resource); $i < $size; ++$i) + { + $results = array_merge($results, $this->mono_range($resource[$i], $count, $include_original)); + } + return $results; + } + + $mode = (in_array($this->mode, array('hsv', 'ahsv'), true) ? $this->mode : 'ahsv'); + if (($pre = $this->get_resource($resource)) !== false) + { + $resource = $pre; + } + + $colour = $this->model_convert($this->colours[$resource], $this->mode, $mode); + + $results = array(); + if ($include_original) + { + $results[] = $resource; + $count--; + } + + // This is a hard problem. I chicken out and try to maintain readability at the cost of less randomness. + + while ($count > 0) + { + $colour[1] = ($colour[1] + mt_rand(40,60)) % 99; + $colour[2] = ($colour[2] + mt_rand(40,60)); + $results[] = $this->allocate($colour, $mode); + $count--; + } + return $results; + } + + /** + * Convert from one colour model to another + */ + function model_convert($colour, $from_model, $to_model) + { + if ($from_model == $to_model) + { + return $colour; + } + + switch ($to_model) + { + case 'hsv': + + switch ($from_model) + { + case 'ahsv': + return $this->ah2h($colour); + break; + + case 'rgb': + return $this->rgb2hsv($colour); + break; + } + break; + + case 'ahsv': + + switch ($from_model) + { + case 'hsv': + return $this->h2ah($colour); + break; + + case 'rgb': + return $this->h2ah($this->rgb2hsv($colour)); + break; + } + break; + + case 'rgb': + switch ($from_model) + { + case 'hsv': + return $this->hsv2rgb($colour); + break; + + case 'ahsv': + return $this->hsv2rgb($this->ah2h($colour)); + break; + } + break; + } + return false; + } + + /** + * Slightly altered from wikipedia's algorithm + */ + function hsv2rgb($hsv) + { + $this->normalize_hue($hsv[0]); + + $h = $hsv[0]; + $s = min(1, max(0, $hsv[1] / 100)); + $v = min(1, max(0, $hsv[2] / 100)); + + // calculate hue sector + $hi = floor($hsv[0] / 60); + + // calculate opposite colour + $p = $v * (1 - $s); + + // calculate distance between hex vertices + $f = ($h / 60) - $hi; + + // coming in or going out? + if (!($hi & 1)) + { + $f = 1 - $f; + } + + // calculate adjacent colour + $q = $v * (1 - ($f * $s)); + + switch ($hi) + { + case 0: + $rgb = array($v, $q, $p); + break; + + case 1: + $rgb = array($q, $v, $p); + break; + + case 2: + $rgb = array($p, $v, $q); + break; + + case 3: + $rgb = array($p, $q, $v); + break; + + case 4: + $rgb = array($q, $p, $v); + break; + + case 5: + $rgb = array($v, $p, $q); + break; + + default: + return array(0, 0, 0); + break; + } + + return array(255 * $rgb[0], 255 * $rgb[1], 255 * $rgb[2]); + } + + /** + * (more than) Slightly altered from wikipedia's algorithm + */ + function rgb2hsv($rgb) + { + $r = min(255, max(0, $rgb[0])); + $g = min(255, max(0, $rgb[1])); + $b = min(255, max(0, $rgb[2])); + $max = max($r, $g, $b); + $min = min($r, $g, $b); + + $v = $max / 255; + $s = (!$max) ? 0 : 1 - ($min / $max); + + // if max - min is 0, we want hue to be 0 anyway. + $h = $max - $min; + + if ($h) + { + switch ($max) + { + case $g: + $h = 120 + (60 * ($b - $r) / $h); + break; + + case $b: + $h = 240 + (60 * ($r - $g) / $h); + break; + + case $r: + $h = 360 + (60 * ($g - $b) / $h); + break; + } + } + $this->normalize_hue($h); + + return array($h, $s * 100, $v * 100); + } + + /** + */ + function normalize_hue(&$hue) + { + $hue %= 360; + + if ($hue < 0) + { + $hue += 360; + } + } + + /** + * Alternate hue to hue + */ + function ah2h($ahue) + { + if (is_array($ahue)) + { + $ahue[0] = $this->ah2h($ahue[0]); + return $ahue; + } + $this->normalize_hue($ahue); + + // blue through red is already ok + if ($ahue >= 240) + { + return $ahue; + } + + // ahue green is at 180 + if ($ahue >= 180) + { + // return (240 - (2 * (240 - $ahue))); + return (2 * $ahue) - 240; // equivalent + } + + // ahue yellow is at 120 (RYB rather than RGB) + if ($ahue >= 120) + { + return $ahue - 60; + } + + return $ahue / 2; + } + + /** + * hue to Alternate hue + */ + function h2ah($hue) + { + if (is_array($hue)) + { + $hue[0] = $this->h2ah($hue[0]); + return $hue; + } + $this->normalize_hue($hue); + + // blue through red is already ok + if ($hue >= 240) + { + return $hue; + } + else if ($hue <= 60) + { + return $hue * 2; + } + else if ($hue <= 120) + { + return $hue + 60; + } + else + { + return ($hue + 240) / 2; + } + } +} diff --git a/sources/phpBB/phpbb/captcha/factory.php b/sources/phpBB/phpbb/captcha/factory.php new file mode 100644 index 0000000..dd44aca --- /dev/null +++ b/sources/phpBB/phpbb/captcha/factory.php @@ -0,0 +1,88 @@ + +* @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\captcha; + +class factory +{ + /** + * @var \Symfony\Component\DependencyInjection\ContainerInterface + */ + private $container; + + /** + * @var \phpbb\di\service_collection + */ + private $plugins; + + /** + * Constructor + * + * @param \Symfony\Component\DependencyInjection\ContainerInterface $container + * @param \phpbb\di\service_collection $plugins + */ + public function __construct(\Symfony\Component\DependencyInjection\ContainerInterface $container, \phpbb\di\service_collection $plugins) + { + $this->container = $container; + $this->plugins = $plugins; + } + + /** + * Return a new instance of a given plugin + * + * @param $name + * @return object + */ + public function get_instance($name) + { + return $this->container->get($name); + } + + /** + * Call the garbage collector + * + * @param string $name The name to the captcha service. + */ + function garbage_collect($name) + { + $captcha = $this->get_instance($name); + $captcha->garbage_collect(0); + } + + /** + * Return a list of all registered CAPTCHA plugins + * + * @returns array + */ + function get_captcha_types() + { + $captchas = array( + 'available' => array(), + 'unavailable' => array(), + ); + + foreach ($this->plugins as $plugin => $plugin_instance) + { + if ($plugin_instance->is_available()) + { + $captchas['available'][$plugin] = $plugin_instance->get_name(); + } + else + { + $captchas['unavailable'][$plugin] = $plugin_instance->get_name(); + } + } + + return $captchas; + } +} diff --git a/sources/phpBB/phpbb/captcha/gd.php b/sources/phpBB/phpbb/captcha/gd.php new file mode 100644 index 0000000..652df28 --- /dev/null +++ b/sources/phpBB/phpbb/captcha/gd.php @@ -0,0 +1,1847 @@ + +* @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\captcha; + +class gd +{ + var $width = 360; + var $height = 96; + + /** + * Create the image containing $code with a seed of $seed + */ + function execute($code, $seed) + { + global $config; + + mt_srand($seed); + + // Create image + $img = imagecreatetruecolor($this->width, $this->height); + + // Generate colours + $colour = new colour_manager($img, array( + 'random' => true, + 'min_value' => 60, + ), 'hsv'); + + $scheme = $colour->colour_scheme('background', false); + $scheme = $colour->mono_range($scheme, 10, false); + shuffle($scheme); + + $bg_colours = array_splice($scheme, mt_rand(6, 12)); + + // Generate code characters + $characters = $sizes = $bounding_boxes = $noise = array(); + $width_avail = $this->width - 15; + $code_len = strlen($code); + $captcha_bitmaps = $this->captcha_bitmaps(); + + for ($i = 0; $i < $code_len; ++$i) + { + $characters[$i] = new char_cube3d($captcha_bitmaps, $code[$i]); + + list($min, $max) = $characters[$i]->range(); + $sizes[$i] = mt_rand($min, $max); + + $box = $characters[$i]->dimensions($sizes[$i]); + $width_avail -= ($box[2] - $box[0]); + $bounding_boxes[$i] = $box; + } + + // Redistribute leftover x-space + $offset = array(); + for ($i = 0; $i < $code_len; ++$i) + { + $denom = ($code_len - $i); + $denom = max(1.3, $denom); + $offset[$i] = phpbb_mt_rand(0, (int) round((1.5 * $width_avail) / $denom)); + $width_avail -= $offset[$i]; + } + + if ($config['captcha_gd_x_grid']) + { + $grid = (int) $config['captcha_gd_x_grid']; + for ($y = 0; $y < $this->height; $y += mt_rand($grid - 2, $grid + 2)) + { + $current_colour = $scheme[array_rand($scheme)]; + imageline($img, mt_rand(0,4), mt_rand($y - 3, $y), mt_rand($this->width - 5, $this->width), mt_rand($y - 3, $y), $current_colour); + } + } + + if ($config['captcha_gd_y_grid']) + { + $grid = (int) $config['captcha_gd_y_grid']; + for ($x = 0; $x < $this->width; $x += mt_rand($grid - 2, $grid + 2)) + { + $current_colour = $scheme[array_rand($scheme)]; + imagedashedline($img, mt_rand($x -3, $x + 3), mt_rand(0, 4), mt_rand($x -3, $x + 3), mt_rand($this->height - 5, $this->height), $current_colour); + } + } + + if ($config['captcha_gd_wave'] && ($config['captcha_gd_y_grid'] || $config['captcha_gd_y_grid'])) + { + $this->wave($img); + } + + if ($config['captcha_gd_3d_noise']) + { + $xoffset = mt_rand(0,9); + $noise_bitmaps = $this->captcha_noise_bg_bitmaps(); + for ($i = 0; $i < $code_len; ++$i) + { + $noise[$i] = new char_cube3d($noise_bitmaps, mt_rand(1, sizeof($noise_bitmaps['data']))); + + list($min, $max) = $noise[$i]->range(); + //$box = $noise[$i]->dimensions($sizes[$i]); + } + $xoffset = 0; + for ($i = 0; $i < $code_len; ++$i) + { + $dimm = $bounding_boxes[$i]; + $xoffset += ($offset[$i] - $dimm[0]); + $yoffset = mt_rand(-$dimm[1], $this->height - $dimm[3]); + + $noise[$i]->drawchar($sizes[$i], $xoffset, $yoffset, $img, $colour->get_resource('background'), $scheme); + $xoffset += $dimm[2]; + } + } + + $xoffset = 5; + for ($i = 0; $i < $code_len; ++$i) + { + $dimm = $bounding_boxes[$i]; + $xoffset += ($offset[$i] - $dimm[0]); + $yoffset = mt_rand(-$dimm[1], $this->height - $dimm[3]); + + $characters[$i]->drawchar($sizes[$i], $xoffset, $yoffset, $img, $colour->get_resource('background'), $scheme); + $xoffset += $dimm[2]; + } + + if ($config['captcha_gd_wave']) + { + $this->wave($img); + } + + if ($config['captcha_gd_foreground_noise']) + { + $this->noise_line($img, 0, 0, $this->width, $this->height, $colour->get_resource('background'), $scheme, $bg_colours); + } + + // Send image + header('Content-Type: image/png'); + header('Cache-control: no-cache, no-store'); + imagepng($img); + imagedestroy($img); + } + + /** + * Sinus + */ + function wave($img) + { + global $config; + + $period_x = mt_rand(12,18); + $period_y = mt_rand(7,14); + $amp_x = mt_rand(5,10); + $amp_y = mt_rand(2,4); + $socket = mt_rand(0,100); + + $dampen_x = mt_rand($this->width/5, $this->width/2); + $dampen_y = mt_rand($this->height/5, $this->height/2); + $direction_x = (mt_rand (0, 1)); + $direction_y = (mt_rand (0, 1)); + + for ($i = 0; $i < $this->width; $i++) + { + $dir = ($direction_x) ? $i : ($this->width - $i); + imagecopy($img, $img, $i-1, sin($socket+ $i/($period_x + $dir/$dampen_x)) * $amp_x, $i, 0, 1, $this->height); + } + $socket = mt_rand(0,100); + for ($i = 0; $i < $this->height; $i++) + { + $dir = ($direction_y) ? $i : ($this->height - $i); + imagecopy($img, $img ,sin($socket + $i/($period_y + ($dir)/$dampen_y)) * $amp_y, $i-1, 0, $i, $this->width, 1); + } + return $img; + } + + /** + * Noise line + */ + function noise_line($img, $min_x, $min_y, $max_x, $max_y, $bg, $font, $non_font) + { + imagesetthickness($img, 2); + + $x1 = $min_x; + $x2 = $max_x; + $y1 = $min_y; + $y2 = $min_y; + + do + { + $line = array_merge( + array_fill(0, mt_rand(30, 60), $non_font[array_rand($non_font)]), + array_fill(0, mt_rand(30, 60), $bg) + ); + + imagesetstyle($img, $line); + imageline($img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED); + + $y1 += mt_rand(12, 35); + $y2 += mt_rand(12, 35); + } + while ($y1 < $max_y && $y2 < $max_y); + + $x1 = $min_x; + $x2 = $min_x; + $y1 = $min_y; + $y2 = $max_y; + + do + { + $line = array_merge( + array_fill(0, mt_rand(30, 60), $non_font[array_rand($non_font)]), + array_fill(0, mt_rand(30, 60), $bg) + ); + + imagesetstyle($img, $line); + imageline($img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED); + + $x1 += mt_rand(20, 35); + $x2 += mt_rand(20, 35); + } + while ($x1 < $max_x && $x2 < $max_x); + imagesetthickness($img, 1); + } + + function captcha_noise_bg_bitmaps() + { + return array( + 'width' => 15, + 'height' => 5, + 'data' => array( + + 1 => array( + array(1,0,0,0,1,0,0,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,1,0,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,1,0,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0,0,0,1,0,0,0), + ), + 2 => array( + array(1,1,mt_rand(0,1),1,0,1,1,1,1,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,1,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1), + ), + 3 => array( + array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,0,0,0,0,0,1,0), + array(0,0,0,0,1,0,0,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,1), + ), + 4 => array( + array(1,0,1,0,1,0,0,1,1,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,1,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), + array(1,0,1,0,0,0,0,0,0,0,0,0,0,0,0), + ), + 5 => array( + array(1,1,1,1,0,0,0,1,1,1,0,0,1,0,1), + array(0,0,0,0,0,0,0,1,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), + array(1,0,1,0,0,0,0,0,0,0,0,0,0,0,0), + ), + 6 => array( + array(mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),0,mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),0,mt_rand(0,1),mt_rand(0,1),mt_rand(0,1)), + array(0,0,0,0,0,0,0,mt_rand(0,1),0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), + array(mt_rand(0,1),0,mt_rand(0,1),0,0,0,0,0,0,0,0,0,0,0,0), + ), + 7 => array( + array(0,0,0,0,0,0,0,0,0,0,1,1,0,1,1), + array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), + array(0,0,1,1,0,0,0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,1,0,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,0), + ), + )); + } + + /** + * Return bitmaps + */ + function captcha_bitmaps() + { + global $config; + + $chars = array( + 'A' => array( + array( + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,1,1,1,1,1,1,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,1,1,0,1,1,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,1,1,1,1,1,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(1,1,1,0,0,0,1,1,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,1,1,1,1,1,0,0), + array(0,1,1,0,0,0,1,1,0), + array(1,1,0,0,0,0,0,1,1), + array(1,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,1,1), + array(0,0,0,0,0,1,1,1,1), + array(0,0,0,1,1,1,0,0,1), + array(0,1,1,1,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,1,0,0,0,0,1,1,1), + array(0,1,1,1,1,1,1,0,1), + ), + ), + 'B' => array( + array( + array(1,1,1,1,1,1,1,0,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,1,0), + array(1,1,1,1,1,1,1,0,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,1,0), + array(1,1,1,1,1,1,1,0,0), + ), + array( + array(1,1,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,1,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(1,1,1,1,1,1,1,0,0), + ), + array( + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,1,1,1,1,1,1,0,0), + ), + ), + 'C' => array( + array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + ), + array( + array(0,0,1,1,1,1,1,0,1), + array(0,1,0,0,0,0,0,1,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,1), + array(0,0,1,1,1,1,1,0,1), + ), + ), + 'D' => array( + array( + array(1,1,1,1,1,1,1,0,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,1,0), + array(1,1,1,1,1,1,1,0,0), + ), + array( + array(1,1,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(1,1,1,1,1,1,1,0,0), + ), + array( + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,1,1,1,1,1,0,1), + array(0,1,1,0,0,0,1,1,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,1,0,0,0,1,1,1), + array(0,0,1,1,1,1,1,0,1), + ), + ), + 'E' => array( + array( + array(1,1,1,1,1,1,1,1,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,1,1,1,1,1,1,1,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,1,1,1,1,1,1,1,1), + ), + array( + array(1,1,1,1,1,1,1,1,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,1,1,1,1,1,1,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,1), + array(1,1,1,1,1,1,1,1,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,1,1,1,1,1,0,0), + array(0,1,1,0,0,0,1,1,0), + array(1,1,0,0,0,0,0,1,1), + array(1,1,1,1,1,1,1,1,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,1), + array(1,1,0,0,0,0,0,1,1), + array(0,1,1,1,1,1,1,1,0), + ), + ), + 'F' => array( + array( + array(1,1,1,1,1,1,1,1,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,1,1,1,1,1,1,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + ), + array( + array(0,1,1,1,1,1,1,1,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(1,1,1,0,0,0,0,0,0), + ), + array( + array(0,0,0,1,1,0,0,0,0), + array(0,0,1,1,0,0,0,0,0), + array(0,1,1,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(1,1,1,1,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + ), + ), + 'G' => array( + array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,1,1,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + ), + array( + array(0,0,1,1,1,1,1,0,1), + array(0,1,0,0,0,0,0,1,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,1,1,1,1,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,1), + array(0,0,1,1,1,1,1,0,1), + ), + array( + array(0,0,1,1,1,1,1,0,1), + array(0,1,1,0,0,0,0,1,1), + array(1,1,0,0,0,0,0,1,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,1,1,0,0,0,0,0,1), + array(0,0,1,1,1,1,1,1,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,1,1), + array(1,1,1,1,1,1,1,1,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + ), + 'H' => array( + array( + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,1,1,1,1,1,1,1,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + ), + array( + array(1,1,1,0,0,0,1,1,1), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,1,1,1,1,1,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(1,1,1,0,0,0,1,1,1), + ), + array( + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,1,1,1,0,0,0), + array(1,1,1,1,0,1,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + ), + ), + 'I' => array( + array( + array(1,1,1,1,1,1,1,1,1), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(1,1,1,1,1,1,1,1,1), + ), + array( + array(0,0,0,1,1,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,1,1,0,0,0), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,1,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,1,1,0,0,0), + ), + ), + 'J' => array( + array( + array(1,1,1,1,1,1,1,1,1), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(1,0,0,0,0,1,0,0,0), + array(1,0,0,0,0,1,0,0,0), + array(0,1,0,0,1,0,0,0,0), + array(0,0,1,1,0,0,0,0,0), + ), + array( + array(1,1,1,1,1,1,1,1,1), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(1,0,0,0,0,1,0,0,0), + array(1,0,0,0,0,1,0,0,0), + array(1,1,0,0,1,0,0,0,0), + array(1,0,1,1,0,0,0,0,0), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(1,0,0,0,0,1,0,0,0), + array(1,0,0,0,0,1,0,0,0), + array(0,1,0,0,1,0,0,0,0), + array(0,0,1,1,0,0,0,0,0), + ), + ), + 'K' => array( + array( // New 'K', supplied by NeoThermic + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,1,0,0,0), + array(1,0,0,0,1,0,0,0,0), + array(1,0,0,1,0,0,0,0,0), + array(1,0,1,0,0,0,0,0,0), + array(1,1,0,0,0,0,0,0,0), + array(1,0,1,0,0,0,0,0,0), + array(1,0,0,1,0,0,0,0,0), + array(1,0,0,0,1,0,0,0,0), + array(1,0,0,0,0,1,0,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + ), + array( + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,1,0,0), + array(0,1,0,0,0,1,0,0,0), + array(0,1,0,0,1,0,0,0,0), + array(0,1,0,1,0,0,0,0,0), + array(0,1,1,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,1,0,0,0,0,0,0), + array(0,1,0,1,0,0,0,0,0), + array(0,1,0,0,1,0,0,0,0), + array(0,1,0,0,0,1,0,0,0), + array(0,1,0,0,0,0,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,1,1,0,0,0,1,1,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,1,0,0,0), + array(0,1,0,0,1,0,0,0,0), + array(0,1,0,1,0,0,0,0,0), + array(0,1,1,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,1,0,0,0,0,0,0), + array(0,1,0,1,0,0,0,0,0), + array(0,1,0,0,1,0,0,0,0), + array(0,1,0,0,0,1,0,0,0), + array(0,1,0,0,0,0,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + ), + ), + 'L' => array( + array( + array(0,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,1,1,1,1,1,1,1,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,1), + array(1,1,1,1,1,1,1,1,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,1,0,0,0,0,0,0), + array(0,0,1,1,1,0,0,0,0), + ), + ), + 'M' => array( + array( + array(1,1,0,0,0,0,0,1,1), + array(1,1,0,0,0,0,0,1,1), + array(1,0,1,0,0,0,1,0,1), + array(1,0,1,0,0,0,1,0,1), + array(1,0,1,0,0,0,1,0,1), + array(1,0,0,1,0,1,0,0,1), + array(1,0,0,1,0,1,0,0,1), + array(1,0,0,1,0,1,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,1,0,0,0,1,1,0), + array(0,1,1,0,0,0,1,1,0), + array(0,1,1,0,0,0,1,1,0), + array(0,1,0,1,0,1,0,1,0), + array(0,1,0,1,0,1,0,1,0), + array(0,1,0,1,0,1,0,1,0), + array(0,1,0,0,1,0,0,1,0), + array(0,1,0,0,1,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(1,1,1,0,0,0,1,1,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,1,1,1,0,1,1,1,0), + array(1,1,0,1,1,1,0,1,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + ), + ), + 'N' => array( + array( + array(1,1,0,0,0,0,0,0,1), + array(1,1,0,0,0,0,0,0,1), + array(1,0,1,0,0,0,0,0,1), + array(1,0,1,0,0,0,0,0,1), + array(1,0,0,1,0,0,0,0,1), + array(1,0,0,1,0,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,0,1,0,0,1), + array(1,0,0,0,0,1,0,0,1), + array(1,0,0,0,0,0,1,0,1), + array(1,0,0,0,0,0,1,0,1), + array(1,0,0,0,0,0,0,1,1), + array(1,0,0,0,0,0,0,1,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,1,0,0,0,0,1,0), + array(0,1,1,0,0,0,0,1,0), + array(0,1,1,0,0,0,0,1,0), + array(0,1,0,1,0,0,0,1,0), + array(0,1,0,1,0,0,0,1,0), + array(0,1,0,1,0,0,0,1,0), + array(0,1,0,0,1,0,0,1,0), + array(0,1,0,0,1,1,0,1,0), + array(0,1,0,0,0,1,0,1,0), + array(0,1,0,0,0,1,1,1,0), + array(0,1,0,0,0,0,1,1,0), + array(0,1,0,0,0,0,0,1,0), + array(1,1,1,0,0,0,1,1,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(1,0,1,1,1,1,0,0,0), + array(1,1,1,0,0,1,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + ), + ), + 'O' => array( + array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + ), + array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,1,0,0,0,0,0,1,1), + array(1,1,0,0,0,0,0,1,1), + array(1,1,0,0,0,0,0,1,1), + array(1,1,0,0,0,0,0,1,1), + array(1,1,0,0,0,0,0,1,1), + array(1,1,0,0,0,0,0,1,1), + array(1,1,0,0,0,0,0,1,1), + array(1,1,0,0,0,0,0,1,1), + array(1,1,0,0,0,0,0,1,1), + array(1,1,0,0,0,0,0,1,1), + array(1,1,0,0,0,0,0,1,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,1,1,1,1,1,0,0,0), + array(1,1,1,0,0,1,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,1,0,0,0,1,1,0,0), + array(0,1,1,1,1,1,0,0,0), + ), + ), + 'P' => array( + array( + array(1,1,1,1,1,1,1,0,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,1,0), + array(1,1,1,1,1,1,1,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + ), + array( + array(1,1,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(1,1,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(1,1,1,0,0,0,0,0,0), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,1,1,0,0,0,0,0), + array(1,1,0,1,1,0,0,0,0), + array(1,0,0,0,1,0,0,0,0), + array(1,0,0,0,1,0,0,0,0), + array(1,0,0,1,1,0,0,0,0), + array(1,1,1,1,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + ), + ), + 'Q' => array( + array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,1,0,0,1), + array(1,0,0,0,0,0,1,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,1), + ), + array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,1,0,0,1,1,0,1,1), + array(0,1,1,1,1,1,1,1,0), + array(0,0,0,0,0,0,1,1,0), + array(0,0,0,0,0,0,0,1,1), + array(0,0,0,0,0,0,0,0,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,1,1,1,1), + array(0,0,0,0,1,1,0,0,1), + array(0,0,0,0,1,0,0,0,1), + array(0,0,0,0,1,0,0,0,1), + array(0,0,0,0,1,1,0,1,1), + array(0,0,0,0,0,1,1,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + ), + ), + 'R' => array( + array( + array(1,1,1,1,1,1,1,0,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,1,0), + array(1,1,1,1,1,1,1,0,0), + array(1,1,1,0,0,0,0,0,0), + array(1,0,0,1,0,0,0,0,0), + array(1,0,0,0,1,0,0,0,0), + array(1,0,0,0,0,1,0,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + ), + array( + array(1,1,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(1,1,1,1,1,1,1,0,0), + array(0,1,1,0,0,0,0,0,0), + array(0,1,1,1,0,0,0,0,0), + array(0,1,0,1,1,0,0,0,0), + array(0,1,0,0,1,1,0,0,0), + array(0,1,0,0,0,1,1,0,0), + array(0,1,0,0,0,0,1,1,0), + array(1,1,1,0,0,0,1,1,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,1,1,1,1,0,0,0,0), + array(1,1,0,0,1,1,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + ), + ), + 'S' => array( + array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,0,1,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + ), + array( + array(0,0,1,1,1,1,1,0,1), + array(0,1,0,0,0,0,0,1,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,0,1,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,1,0,0,0,0,0,1,0), + array(1,0,1,1,1,1,1,0,0), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,1,1,1,1,0,0,0,0), + array(1,0,0,0,0,1,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,1,0,0,0,0,0,0,0), + array(0,1,1,1,1,0,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(1,0,0,0,1,1,0,0,0), + array(0,1,1,1,1,0,0,0,0), + ), + ), + 'T' => array( + array( + array(1,1,1,1,1,1,1,1,1), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + ), + array( + array(1,1,1,1,1,1,1,1,1), + array(1,0,0,0,1,0,0,0,1), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,1,1,0,0,0), + ), + array( + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,1,1,1,1,1,1,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,1,0,0,0), + array(0,0,0,0,0,1,1,1,0), + ), + ), + 'U' => array( + array( + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + ), + array( + array(1,0,0,0,0,0,0,0,0), + array(1,1,1,0,0,0,1,1,1), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,1,0,0,0,1,1,0), + array(0,0,1,1,1,1,1,0,0), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,1,0,0,0,0,0,1), + array(0,0,1,0,0,0,0,0,1), + array(0,0,1,0,0,0,0,0,1), + array(0,0,1,0,0,0,0,0,1), + array(0,0,1,0,0,0,0,0,1), + array(0,0,1,0,0,0,0,1,1), + array(0,0,1,1,0,0,1,1,1), + array(0,0,0,1,1,1,1,0,1), + ), + ), + 'V' => array( + array( + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(1,1,1,0,0,0,1,1,1), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + ), + ), + 'W' => array( + array( + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,1,0,1,0,0,1), + array(1,0,0,1,0,1,0,0,1), + array(1,0,0,1,0,1,0,0,1), + array(1,0,1,0,0,0,1,0,1), + array(1,0,1,0,0,0,1,0,1), + array(1,0,1,0,0,0,1,0,1), + array(1,1,0,0,0,0,0,1,1), + array(1,1,0,0,0,0,0,1,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(1,1,1,0,0,0,1,1,1), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,1,0,0,1,0), + array(0,1,0,0,1,0,0,1,0), + array(0,1,0,1,1,1,0,1,0), + array(0,1,0,1,0,1,0,1,0), + array(0,1,1,1,0,1,1,1,0), + array(0,1,1,0,0,0,1,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,0,0), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,1,0,0,1,0), + array(0,1,0,0,1,0,0,1,0), + array(0,1,0,1,1,1,0,1,0), + array(0,1,0,1,0,1,0,1,0), + array(0,1,1,1,0,1,1,1,0), + array(0,1,1,0,0,0,1,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,0,0), + ), + ), + 'X' => array( + array( + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,1,0,0,0,0,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(1,1,1,0,0,0,1,1,1), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,1,0,0,0,0,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,1,1,0,0,0,1,1,1), + array(0,0,0,0,0,0,0,0,0), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,1,0,0,0,1,1,0), + array(0,0,1,1,0,1,1,0,0), + array(0,0,0,1,1,1,0,0,0), + array(0,0,0,1,1,1,0,0,0), + array(0,0,1,1,0,1,1,0,0), + array(0,1,1,0,0,0,1,1,0), + array(0,0,0,0,0,0,0,0,0), + ), + ), + 'Y' => array( + array( + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(1,1,1,0,0,0,1,1,1), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,1,1,0,0,0), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,1,0,0,0,0,1), + array(0,0,0,1,1,0,0,0,1), + array(0,0,0,0,1,0,0,1,1), + array(0,0,0,0,1,1,0,1,0), + array(0,0,0,0,0,1,1,1,0), + array(0,0,0,0,0,0,1,0,0), + array(0,0,0,0,0,1,1,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,1,1,0,0,0), + array(0,0,1,1,1,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + ), + 'Z' => array( + array( + array(1,1,1,1,1,1,1,1,1), + array(1,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,1,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,0,0,0,0,0), + array(0,0,0,1,0,0,0,0,0), + array(0,0,1,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,1), + array(1,1,1,1,1,1,1,1,1), + ), + array( + array(1,1,1,1,1,1,1,1,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,1,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,1,1,1,1,1,0,0), + array(0,0,0,1,0,0,0,0,0), + array(0,0,0,1,0,0,0,0,0), + array(0,0,1,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,1,1,1,1,1,1,1,1), + ), + array( + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,1,1,1,1,1,1,1,0), + array(0,0,0,0,0,1,1,0,0), + array(0,0,0,0,1,1,0,0,0), + array(0,0,0,1,1,0,0,0,0), + array(0,0,1,1,0,0,0,0,0), + array(0,0,1,0,0,0,0,0,0), + array(0,1,1,1,1,1,1,1,0), + ), + ), + ); + return array( + 'width' => 9, + 'height' => 15, + 'data' => array( + + 'A' => $chars['A'][mt_rand(0, min(sizeof($chars['A']), $config['captcha_gd_fonts']) -1)], + 'B' => $chars['B'][mt_rand(0, min(sizeof($chars['B']), $config['captcha_gd_fonts']) -1)], + 'C' => $chars['C'][mt_rand(0, min(sizeof($chars['C']), $config['captcha_gd_fonts']) -1)], + 'D' => $chars['D'][mt_rand(0, min(sizeof($chars['D']), $config['captcha_gd_fonts']) -1)], + 'E' => $chars['E'][mt_rand(0, min(sizeof($chars['E']), $config['captcha_gd_fonts']) -1)], + 'F' => $chars['F'][mt_rand(0, min(sizeof($chars['F']), $config['captcha_gd_fonts']) -1)], + 'G' => $chars['G'][mt_rand(0, min(sizeof($chars['G']), $config['captcha_gd_fonts']) -1)], + 'H' => $chars['H'][mt_rand(0, min(sizeof($chars['H']), $config['captcha_gd_fonts']) -1)], + 'I' => $chars['I'][mt_rand(0, min(sizeof($chars['I']), $config['captcha_gd_fonts']) -1)], + 'J' => $chars['J'][mt_rand(0, min(sizeof($chars['J']), $config['captcha_gd_fonts']) -1)], + 'K' => $chars['K'][mt_rand(0, min(sizeof($chars['K']), $config['captcha_gd_fonts']) -1)], + 'L' => $chars['L'][mt_rand(0, min(sizeof($chars['L']), $config['captcha_gd_fonts']) -1)], + 'M' => $chars['M'][mt_rand(0, min(sizeof($chars['M']), $config['captcha_gd_fonts']) -1)], + 'N' => $chars['N'][mt_rand(0, min(sizeof($chars['N']), $config['captcha_gd_fonts']) -1)], + 'O' => $chars['O'][mt_rand(0, min(sizeof($chars['O']), $config['captcha_gd_fonts']) -1)], + 'P' => $chars['P'][mt_rand(0, min(sizeof($chars['P']), $config['captcha_gd_fonts']) -1)], + 'Q' => $chars['Q'][mt_rand(0, min(sizeof($chars['Q']), $config['captcha_gd_fonts']) -1)], + 'R' => $chars['R'][mt_rand(0, min(sizeof($chars['R']), $config['captcha_gd_fonts']) -1)], + 'S' => $chars['S'][mt_rand(0, min(sizeof($chars['S']), $config['captcha_gd_fonts']) -1)], + 'T' => $chars['T'][mt_rand(0, min(sizeof($chars['T']), $config['captcha_gd_fonts']) -1)], + 'U' => $chars['U'][mt_rand(0, min(sizeof($chars['U']), $config['captcha_gd_fonts']) -1)], + 'V' => $chars['V'][mt_rand(0, min(sizeof($chars['V']), $config['captcha_gd_fonts']) -1)], + 'W' => $chars['W'][mt_rand(0, min(sizeof($chars['W']), $config['captcha_gd_fonts']) -1)], + 'X' => $chars['X'][mt_rand(0, min(sizeof($chars['X']), $config['captcha_gd_fonts']) -1)], + 'Y' => $chars['Y'][mt_rand(0, min(sizeof($chars['Y']), $config['captcha_gd_fonts']) -1)], + 'Z' => $chars['Z'][mt_rand(0, min(sizeof($chars['Z']), $config['captcha_gd_fonts']) -1)], + + '1' => array( + array(0,0,0,1,1,0,0,0,0), + array(0,0,1,0,1,0,0,0,0), + array(0,1,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,1,1,1,1,1,1,1,0), + ), + '2' => array( // New '2' supplied by Anon + array(0,0,0,1,1,1,0,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,1,0,0,0,0,1,1,0), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,1,1), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,1,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,0,0,0,0,0), + array(0,0,1,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(1,1,1,1,1,1,1,1,1), + array(0,0,0,0,0,0,0,0,0), + ), + '3' => array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,1,1,0,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + ), + '4' => array( + array(0,0,0,0,0,0,1,1,0), + array(0,0,0,0,0,1,0,1,0), + array(0,0,0,0,1,0,0,1,0), + array(0,0,0,1,0,0,0,1,0), + array(0,0,1,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,1,1,1,1,1,1,1,1), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,1,0), + ), + '5' => array( + array(1,1,1,1,1,1,1,1,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,0,1,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + ), + '6' => array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,1,1,1,1,0,0), + array(1,0,1,0,0,0,0,1,0), + array(1,1,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + ), + '7' => array( + array(1,1,1,1,1,1,1,1,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,1,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,0,0,0,0,0), + array(0,0,0,1,0,0,0,0,0), + array(0,0,1,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + ), + '8' => array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + ), + '9' => array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,1,1), + array(0,1,0,0,0,0,1,0,1), + array(0,0,1,1,1,1,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + ), + ) + ); + } +} diff --git a/sources/phpBB/phpbb/captcha/gd_wave.php b/sources/phpBB/phpbb/captcha/gd_wave.php new file mode 100644 index 0000000..d48fc75 --- /dev/null +++ b/sources/phpBB/phpbb/captcha/gd_wave.php @@ -0,0 +1,845 @@ + +* @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\captcha; + +/** +* Wave3D CAPTCHA +*/ +class gd_wave +{ + var $width = 360; + var $height = 96; + + function execute($code, $seed) + { + global $starttime; + + // seed the random generator + mt_srand($seed); + + // set height and width + $img_x = $this->width; + $img_y = $this->height; + + // Generate image + $img = imagecreatetruecolor($img_x, $img_y); + $x_grid = mt_rand(6, 10); + $y_grid = mt_rand(6, 10); + + // Ok, so lets cut to the chase. We could accurately represent this in 3d and + // do all the appropriate linear transforms. my questions is... why bother? + // The computational overhead is unnecessary when you consider the simple fact: + // we're not here to accurately represent a model, but to just show off some random-ish + // polygons + + // Conceive of 3 spaces. + // 1) planar-space (discrete "pixel" grid) + // 2) 3-space. (planar-space with z/height aspect) + // 3) image space (pixels on the screen) + // resolution of the planar-space we're embedding the text code in + $plane_x = 100; + $plane_y = 30; + + $subdivision_factor = 3; + + // $box is the 4 points in img_space that correspond to the corners of the plane in 3-space + $box = array( + 'upper_left' => array( + 'x' => mt_rand(5, 15), + 'y' => mt_rand(10, 15) + ), + 'upper_right' => array( + 'x' => mt_rand($img_x - 35, $img_x - 19), + 'y' => mt_rand(10, 17) + ), + 'lower_left' => array( + 'x' => mt_rand($img_x - 45, $img_x - 5), + 'y' => mt_rand($img_y - 15, $img_y - 0), + ), + ); + + $box['lower_right'] = array( + 'x' => $box['lower_left']['x'] + $box['upper_left']['x'] - $box['upper_right']['x'], + 'y' => $box['lower_left']['y'] + $box['upper_left']['y'] - $box['upper_right']['y'], + ); + + // TODO + $background = imagecolorallocate($img, mt_rand(155, 255), mt_rand(155, 255), mt_rand(155, 255)); + imagefill($img, 0, 0, $background); + $black = imagecolorallocate($img, 0, 0, 0); + + $random = array(); + $fontcolors = array(); + + for ($i = 0; $i < 15; ++$i) + { + $random[$i] = imagecolorallocate($img, mt_rand(120, 255), mt_rand(120, 255), mt_rand(120, 255)); + } + + $fontcolors[0] = imagecolorallocate($img, mt_rand(0, 120), mt_rand(0, 120), mt_rand(0, 120)); + + $colors = array(); + + $minr = mt_rand(20, 30); + $ming = mt_rand(20, 30); + $minb = mt_rand(20, 30); + + $maxr = mt_rand(150, 230); + $maxg = mt_rand(150, 230); + $maxb = mt_rand(150, 230); + + for ($i = -30; $i <= 30; ++$i) + { + $coeff1 = ($i + 12) / 45; + $coeff2 = 1 - $coeff1; + $colors[$i] = imagecolorallocate($img, ($coeff2 * $maxr) + ($coeff1 * $minr), ($coeff2 * $maxg) + ($coeff1 * $ming), ($coeff2 * $maxb) + ($coeff1 * $minb)); + } + + // $img_buffer is the last row of 3-space positions (converted to img-space), cached + // (using this means we don't need to recalculate all 4 positions for each new polygon, + // merely the newest point that we're adding, which is then cached. + $img_buffer = array(array(), array()); + + // In image-space, the x- and y-offset necessary to move one unit in the x-direction in planar-space + $dxx = ($box['upper_right']['x'] - $box['upper_left']['x']) / ($subdivision_factor * $plane_x); + $dxy = ($box['upper_right']['y'] - $box['upper_left']['y']) / ($subdivision_factor * $plane_x); + + // In image-space, the x- and y-offset necessary to move one unit in the y-direction in planar-space + $dyx = ($box['lower_right']['x'] - $box['upper_left']['x']) / ($subdivision_factor * $plane_y); + $dyy = ($box['lower_right']['y'] - $box['upper_left']['y']) / ($subdivision_factor * $plane_y); + + // Initial captcha-letter offset in planar-space + $plane_offset_x = mt_rand(3, 8); + $plane_offset_y = mt_rand( 12, 15); + + // character map + $map = $this->captcha_bitmaps(); + + // matrix + $plane = array(); + + // for each character, we'll silkscreen it into our boolean pixel plane + for ($c = 0, $code_num = strlen($code); $c < $code_num; ++$c) + { + $letter = $code[$c]; + + for ($x = $map['width'] - 1; $x >= 0; --$x) + { + for ($y = $map['height'] - 1; $y >= 0; --$y) + { + if ($map['data'][$letter][$y][$x]) + { + $plane[$y + $plane_offset_y + (($c & 1) ? 1 : -1)][$x + $plane_offset_x] = true; + } + } + } + $plane_offset_x += 11; + } + + // calculate our first buffer, we can't actually draw polys with these yet + // img_pos_prev == screen x,y location to our immediate left. + // img_pos_cur == current screen x,y location + // we calculate screen position of our + // current cell based on the difference from the previous cell + // rather than recalculating from absolute coordinates + // What we cache into the $img_buffer contains the raised text coordinates. + $img_pos_prev = $img_buffer[0][0] = array($box['upper_left']['x'], $box['upper_left']['y']); + $cur_height = $prev_height = $this->wave_height(0, 0, $subdivision_factor); + $full_x = $plane_x * $subdivision_factor; + $full_y = $plane_y * $subdivision_factor; + + for ($x = 1; $x <= $full_x; ++$x) + { + $cur_height = $this->wave_height($x, 0, $subdivision_factor); + $offset = $cur_height - $prev_height; + $img_pos_cur = array($img_pos_prev[0] + $dxx, $img_pos_prev[1] + $dxy + $offset); + + $img_buffer[0][$x] = $img_pos_cur; + $img_pos_prev = $img_pos_cur; + $prev_height = $cur_height; + } + + for ($y = 1; $y <= $full_y; ++$y) + { + // swap buffers + $buffer_cur = $y & 1; + $buffer_prev = 1 - $buffer_cur; + + $prev_height = $this->wave_height(0, $y, $subdivision_factor); + $offset = $prev_height - $this->wave_height(0, $y - 1, $subdivision_factor); + $img_pos_cur = array($img_buffer[$buffer_prev][0][0] + $dyx, min($img_buffer[$buffer_prev][0][1] + $dyy + $offset, $img_y - 1)); + + // make sure we don't try to write off the page + $img_pos_prev = $img_pos_cur; + + $img_buffer[$buffer_cur][0] = $img_pos_cur; + + for ($x = 1; $x <= $full_x; ++$x) + { + $cur_height = $this->wave_height($x, $y, $subdivision_factor) + $this->grid_height($x, $y, $x_grid, $y_grid, 1); + + // height is a z-factor, not a y-factor + $offset = $cur_height - $prev_height; + $img_pos_cur = array($img_pos_prev[0] + $dxx, $img_pos_prev[1] + $dxy + $offset); + + // height is float, index it to an int, get closest color + $color = $colors[intval($cur_height)]; + $img_pos_prev = $img_pos_cur; + $prev_height = $cur_height; + + $y_index_old = intval(($y - 1) / $subdivision_factor); + $y_index_new = intval($y / $subdivision_factor); + $x_index_old = intval(($x - 1) / $subdivision_factor); + $x_index_new = intval($x / $subdivision_factor); + + if (!empty($plane[$y_index_new][$x_index_new])) + { + $img_pos_cur[1] += $this->wave_height($x, $y, $subdivision_factor, 1) - 30 - $cur_height; + $color = $colors[20]; + } + $img_pos_cur[1] = min($img_pos_cur[1], $img_y - 1); + $img_buffer[$buffer_cur][$x] = $img_pos_cur; + + // Smooth the edges as much as possible by having not more than one low<->high traingle per square + // Otherwise, just + $diag_down = (empty($plane[$y_index_old][$x_index_old]) == empty($plane[$y_index_new][$x_index_new])); + $diag_up = (empty($plane[$y_index_old][$x_index_new]) == empty($plane[$y_index_new][$x_index_old])); + + // natural switching + $mode = ($x + $y) & 1; + + // override if it requires it + if ($diag_down != $diag_up) + { + $mode = $diag_up; + } + + if ($mode) + { + // +-/ / + // 1 |/ 2 /| + // / /-+ + $poly1 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_prev][$x]); + $poly2 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_cur][$x], $img_buffer[$buffer_prev][$x]); + } + else + { + // \ \-+ + // 1 |\ 2 \| + // +-\ \ + $poly1 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_cur][$x]); + $poly2 = array_merge($img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_prev][$x], $img_buffer[$buffer_cur][$x]); + } + + imagefilledpolygon($img, $poly1, 3, $color); + imagefilledpolygon($img, $poly2, 3, $color); + } + } + + // Output image + header('Content-Type: image/png'); + header('Cache-control: no-cache, no-store'); + //$mtime = explode(' ', microtime()); + //$totaltime = $mtime[0] + $mtime[1] - $starttime; + + //echo $totaltime . "
\n"; + //echo memory_get_usage() - $tmp; + imagepng($img); + imagedestroy($img); + } + + function wave_height($x, $y, $factor = 1, $tweak = 0.7) + { + // stretch the wave. TODO: pretty it up + $x = $x/5 + 180; + $y = $y/4; + return ((sin($x / (3 * $factor)) + sin($y / (3 * $factor))) * 10 * $tweak); + } + + function grid_height($x, $y, $x_grid, $y_grid, $factor = 1) + { + return ((!($x % ($x_grid * $factor)) || !($y % ($y_grid * $factor))) ? 3 : 0); + } + + function captcha_bitmaps() + { + return array( + 'width' => 9, + 'height' => 13, + 'data' => array( + 'A' => array( + array(0,0,1,1,1,1,0,0,0), + array(0,1,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,1,1,1,1,1,1,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'B' => array( + array(1,1,1,1,1,1,0,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,1,0,0), + array(1,1,1,1,1,1,0,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,1,0,0), + array(1,1,1,1,1,1,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'C' => array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'D' => array( + array(1,1,1,1,1,1,1,0,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,1,0), + array(1,1,1,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'E' => array( + array(0,0,1,1,1,1,1,1,1), + array(0,1,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,1,1,1,1,1,1,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,0,1,1,1,1,1,1,1), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'F' => array( + array(0,0,1,1,1,1,1,1,0), + array(0,1,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,1,1,1,1,1,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'G' => array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,1,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'H' => array( + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,1,1,1,1,1,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,1,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'I' => array( + array(0,1,1,1,1,1,1,1,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,1,1,1,1,1,1,1,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'J' => array( + array(0,0,0,0,0,0,1,1,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,0,1,0,0,0,0,1,0), + array(0,0,0,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'K' => array( + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,1,0,0,0), + array(1,0,0,0,1,0,0,0,0), + array(1,0,0,1,0,0,0,0,0), + array(1,0,1,0,0,0,0,0,0), + array(1,1,0,0,0,0,0,0,0), + array(1,0,1,0,0,0,0,0,0), + array(1,0,0,1,0,0,0,0,0), + array(1,0,0,0,1,0,0,0,0), + array(1,0,0,0,0,1,0,0,0), + array(1,0,0,0,0,0,1,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'L' => array( + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,0,1,1,1,1,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'M' => array( + array(0,1,0,0,0,0,0,1,0), + array(0,1,1,0,0,0,1,1,0), + array(0,1,0,1,0,1,0,1,0), + array(0,1,0,0,1,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'N' => array( + array(1,0,0,0,0,0,0,0,1), + array(1,1,0,0,0,0,0,0,1), + array(1,0,1,0,0,0,0,0,1), + array(1,0,0,1,0,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,0,0,1,0,0,1), + array(1,0,0,0,0,0,1,0,1), + array(1,0,0,0,0,0,0,1,1), + array(1,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'O' => array( + array(0,0,0,1,1,1,0,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,0,1,1,1,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'P' => array( + array(1,1,1,1,1,1,0,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,1,0,0), + array(1,1,1,1,1,1,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'Q' => array( + array(0,0,1,1,1,1,0,0,0), + array(0,1,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,1,0,0,1,0), + array(1,0,0,0,0,1,0,1,0), + array(0,1,0,0,0,0,1,0,0), + array(0,0,1,1,1,1,0,1,0), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'R' => array( + array(1,1,1,1,1,1,0,0,0), + array(1,0,0,0,0,0,1,0,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,1,0,0), + array(1,1,1,1,1,1,0,0,0), + array(1,0,1,0,0,0,0,0,0), + array(1,0,0,1,0,0,0,0,0), + array(1,0,0,0,1,0,0,0,0), + array(1,0,0,0,0,1,0,0,0), + array(1,0,0,0,0,0,1,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'S' => array( + array(0,0,1,1,1,1,1,1,1), + array(0,1,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,0,1,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,1,0), + array(1,1,1,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'T' => array( + array(1,1,1,1,1,1,1,1,1), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'U' => array( + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'V' => array( + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'W' => array( + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,1,0,0,0,1), + array(1,0,0,1,0,1,0,0,1), + array(1,0,1,0,0,0,1,0,1), + array(1,1,0,0,0,0,0,1,1), + array(1,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'X' => array( + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'Y' => array( + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,0,0,0,1,0,0), + array(0,0,0,1,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + 'Z' => array( + array(1,1,1,1,1,1,1,1,1), + array(1,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,1,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,0,0,0,0,0), + array(0,0,1,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,1), + array(1,1,1,1,1,1,1,1,1), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + '1' => array( + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,1,0,0,0,0), + array(0,0,1,0,1,0,0,0,0), + array(0,1,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,1,1,1,1,1,1,1,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + '2' => array( + array(0,0,0,1,1,1,0,0,0), + array(0,0,1,0,0,0,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,1,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,1,0,0,0,0,0), + array(0,0,1,0,0,0,0,0,0), + array(0,1,1,1,1,1,1,1,1), + array(0,0,0,0,0,0,0,0,0), + ), + '3' => array( + array(0,0,0,1,1,1,1,0,0), + array(0,0,1,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,1,1,0,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,0,1,0,0,0,0,1,0), + array(0,0,0,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + '4' => array( + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,1,1,0), + array(0,0,0,0,0,1,0,1,0), + array(0,0,0,0,1,0,0,1,0), + array(0,0,0,1,0,0,0,1,0), + array(0,0,1,0,0,0,0,1,0), + array(0,1,1,1,1,1,1,1,1), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + '5' => array( + array(1,1,1,1,1,1,1,1,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(0,1,0,0,0,0,0,0,0), + array(0,0,1,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + '6' => array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,0,0,0,0,0,0), + array(1,0,0,1,1,1,1,0,0), + array(1,0,1,0,0,0,0,1,0), + array(1,1,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + '7' => array( + array(1,1,1,1,1,1,1,1,1), + array(1,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,1,0), + array(0,0,0,0,0,0,1,0,0), + array(0,0,0,0,0,1,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,1,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + '8' => array( + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + array(0,1,0,0,0,0,0,1,0), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(1,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,0), + array(0,0,1,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + '9' => array( + array(0,0,0,1,1,1,1,0,0), + array(0,0,1,0,0,0,0,1,0), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,1,1), + array(0,0,1,1,1,1,1,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,0,0,0,0,0,0,0,1), + array(0,1,0,0,0,0,0,0,1), + array(0,0,1,0,0,0,0,1,0), + array(0,0,0,1,1,1,1,0,0), + array(0,0,0,0,0,0,0,0,0), + array(0,0,0,0,0,0,0,0,0), + ), + ) + ); + } +} diff --git a/sources/phpBB/phpbb/captcha/non_gd.php b/sources/phpBB/phpbb/captcha/non_gd.php new file mode 100644 index 0000000..3818672 --- /dev/null +++ b/sources/phpBB/phpbb/captcha/non_gd.php @@ -0,0 +1,386 @@ + +* @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\captcha; + +/** +* Main non-gd captcha class +* @ignore +*/ +class non_gd +{ + var $filtered_pngs; + var $width = 320; + var $height = 50; + + /** + * Define filtered pngs on init + */ + function __construct() + { + // If we can we will generate a single filtered png, we avoid nastiness via emulation of some Zlib stuff + $this->define_filtered_pngs(); + } + + /** + * Create the image containing $code with a seed of $seed + */ + function execute($code, $seed) + { + $img_height = $this->height - 10; + $img_width = 0; + + mt_srand($seed); + + $char_widths = $hold_chars = array(); + $code_len = strlen($code); + + for ($i = 0; $i < $code_len; $i++) + { + $char = $code[$i]; + + $width = mt_rand(0, 4); + $raw_width = $this->filtered_pngs[$char]['width']; + $char_widths[$i] = $width; + $img_width += $raw_width - $width; + + // Split the char into chunks of $raw_width + 1 length + if (empty($hold_chars[$char])) + { + $hold_chars[$char] = str_split(base64_decode($this->filtered_pngs[$char]['data']), $raw_width + 1); + } + } + + $offset_x = mt_rand(0, $this->width - $img_width); + $offset_y = mt_rand(0, $this->height - $img_height); + + $image = ''; + for ($i = 0; $i < $this->height; $i++) + { + $image .= chr(0); + + if ($i > $offset_y && $i < $offset_y + $img_height) + { + for ($j = 0; $j < $offset_x; $j++) + { + $image .= chr(mt_rand(140, 255)); + } + + for ($j = 0; $j < $code_len; $j++) + { + $image .= $this->randomise(substr($hold_chars[$code{$j}][$i - $offset_y - 1], 1), $char_widths[$j]); + } + + for ($j = $offset_x + $img_width; $j < $this->width; $j++) + { + $image .= chr(mt_rand(140, 255)); + } + } + else + { + for ($j = 0; $j < $this->width; $j++) + { + $image .= chr(mt_rand(140, 255)); + } + } + } + unset($hold_chars); + + $image = $this->create_png($image, $this->width, $this->height); + + // Output image + header('Content-Type: image/png'); + header('Cache-control: no-cache, no-store'); + echo $image; + exit; + } + + /** + * This is designed to randomise the pixels of the image data within + * certain limits so as to keep it readable. It also varies the image + * width a little + */ + function randomise($scanline, $width) + { + $new_line = ''; + + $end = strlen($scanline) - ceil($width/2); + for ($i = (int) floor($width / 2); $i < $end; $i++) + { + $pixel = ord($scanline{$i}); + + if ($pixel < 190) + { + $new_line .= chr(mt_rand(0, 205)); + } + else if ($pixel > 190) + { + $new_line .= chr(mt_rand(145, 255)); + } + else + { + $new_line .= $scanline{$i}; + } + } + + return $new_line; + } + + /** + * This creates a chunk of the given type, with the given data + * of the given length adding the relevant crc + */ + function png_chunk($length, $type, $data) + { + $raw = $type . $data; + + return pack('N', $length) . $raw . pack('N', crc32($raw)); + } + + /** + * Creates greyscale 8bit png - The PNG spec can be found at + * http://www.libpng.org/pub/png/spec/PNG-Contents.html we use + * png because it's a fully recognised open standard and supported + * by practically all modern browsers and OSs + */ + function create_png($raw_image, $width, $height) + { + // SIG + $image = pack('C8', 137, 80, 78, 71, 13, 10, 26, 10); + + // IHDR + $raw = pack('N2', $width, $height); + $raw .= pack('C5', 8, 0, 0, 0, 0); + $image .= $this->png_chunk(13, 'IHDR', $raw); + + // IDAT + if (@extension_loaded('zlib')) + { + $raw_image = gzcompress($raw_image); + $length = strlen($raw_image); + } + else + { + // The total length of this image, uncompressed, is just a calculation of pixels + $length = ($width + 1) * $height; + + // Adler-32 hash generation + // Note: The hash is _backwards_ so we must reverse it + + if (@extension_loaded('hash')) + { + $adler_hash = strrev(hash('adler32', $raw_image, true)); + } + else if (@extension_loaded('mhash')) + { + $adler_hash = strrev(mhash(MHASH_ADLER32, $raw_image)); + } + else + { + // Optimized Adler-32 loop ported from the GNU Classpath project + $temp_length = $length; + $s1 = 1; + $s2 = $index = 0; + + while ($temp_length > 0) + { + // We can defer the modulo operation: + // s1 maximally grows from 65521 to 65521 + 255 * 3800 + // s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31 + $substract_value = ($temp_length < 3800) ? $temp_length : 3800; + $temp_length -= $substract_value; + + while (--$substract_value >= 0) + { + $s1 += ord($raw_image[$index]); + $s2 += $s1; + + $index++; + } + + $s1 %= 65521; + $s2 %= 65521; + } + $adler_hash = pack('N', ($s2 << 16) | $s1); + } + + // This is the same thing as gzcompress($raw_image, 0) but does not need zlib + $raw_image = pack('C3v2', 0x78, 0x01, 0x01, $length, ~$length) . $raw_image . $adler_hash; + + // The Zlib header + Adler hash make us add on 11 + $length += 11; + } + + // IDAT + $image .= $this->png_chunk($length, 'IDAT', $raw_image); + + // IEND + $image .= $this->png_chunk(0, 'IEND', ''); + + return $image; + } + + /** + * png image data + * Each 'data' element is base64_encoded uncompressed IDAT + */ + function define_filtered_pngs() + { + $this->filtered_pngs = array( + '0' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A///////////////////olFAkBAAAGDyA4P///M31/////////////wD////////////////0dAgAAAAAAAAAAAAEcPipFGHn////////////AP//////////////6DAAAAAAAAAAAAAAAAAALSEAN+T///////////8A//////////////xAAAAAAAAAAAAAAAAAAAAAACPA/////////////wD/////////////oAAAAAAAAAAAAAAAAAAAAAAAev//////////////AP////////////8oAAAAAAAAPNj/zDAAAAAAAABD//////////////8A////////////1AAAAAAAABjw////5BAAAAAAAADo/////////////wD///////////+QAAAAAAAAbP//////QgAAAAAAAKj/////////////AP///////////1wAAAAAAACs/////8AXAAAAAAAAcP////////////8A////////////OAAAAAAAAND////dNwAAAAAAAABI/////////////wD///////////8gAAAAAAAA4P//7koACwAAAAAAACT/////////////AP///////////wgAAAAAAAD///VqAwaPAAAAAAAAEP////////////8A////////////AAAAAAAAAP/8kQYDavUAAAAAAAAA/////////////wD///////////8AAAAAAAAA/6kNAEru/wAAAAAAAAD/////////////AP///////////wAAAAAAAADAIwA33f//AAAAAAAAAP////////////8A////////////FAAAAAAAADYAI8D///8AAAAAAAAQ/////////////wD///////////8kAAAAAAAAAA2p////5AAAAAAAACD/////////////AP///////////0gAAAAAAAAFkfz////UAAAAAAAAQP////////////8A////////////cAAAAAAAAET1/////7AAAAAAAABo/////////////wD///////////+oAAAAAAAAXfX/////sAAAAAAAAGj/////////////AAAAALgAAAAAAAAwAAAAAAAAAAAAAAD////////////oAAAAAAAACOT////oEAAAAAAAAOD/////////////AP////////////8+AAAAAAAAKMz/zDQAAAAAAAA0//////////////8A////////////7jgAAAAAAAAAAAAAAAAAAAAAAKT//////////////wD///////////VqAwIAAAAAAAAAAAAAAAAAAAA8////////////////AP//////////rQcDaVEAAAAAAAAAAAAAAAAAKOj///////////////8A///////////nblnu/IAIAAAAAAAAAAAAAFzw/////////////////wD////////////79////+iITCAAAAAgSITg////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////w==', + 'width' => 40 + ), + '1' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////8BAAAAAAAP//////////////////AP////////////////////////9sAAAAAAAA//////////////////8A////////////////////////pAAAAAAAAAD//////////////////wD//////////////////////6wEAAAAAAAAAP//////////////////AP////////////////////h4AAAAAAAAAAAA//////////////////8A//////////////////ygJAAAAAAAAAAAAAD//////////////////wD//////////////9x8HAAAAAAAAAAAAAAAAP//////////////////AP//////////////AAAAAAAAAAAAAAAAAAAA//////////////////8A//////////////8AAAAAAAAAAAAAAAAAAAD//////////////////wD//////////////wAAAAAAAAR4AAAAAAAAAP//////////////////AP//////////////AAAAAAA4zP8AAAAAAAAA//////////////////8A//////////////8AAAA4sP///wAAAAAAAAD//////////////////wD//////////////yR80P//////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + '2' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP/////////////////okFAkCAAABCBIfNT///////////////////8A///////////////8hAgAAAAAAAAAAAAAAFTo/////////////////wD//////////////1QAAAAAAAAAAAAAAAAAACjo////////////////AP////////////+MAAAAAAAAAAAAAAAAAAAAADj///////////////8A////////////9BAAAAAAAAAAAAAAAAAAAAAAALD//////////////wD///////////+gAAAAAAAAAHjs+KwMAAAAAAAAVP//////////////AP///////////1gAAAAAAABM/////6QAAAAAAAAU//////////////8A////////////KAAAAAAAALj/////+AAAAAAAAAD//////////////wD///////////+MfGBMOCAI8P/////wAAAAAAAACP//////////////AP///////////////////////////5wAAAAAAAAw//////////////8A///////////////////////////oFAAAAAAAAHz//////////////wD/////////////////////////6CgAAAAAAAAE3P//////////////AP///////////////////////9ggAAAAAAAAAHT///////////////8A//////////////////////+0DAAAAAAAAAA8+P///////////////wD/////////////////////gAAAAAAAAAAAKOj/////////////////AP//////////////////9FAAAAAAAAAAADzw//////////////////8A/////////////////+g4AAAAAAAAAABk/P///////////////////wD////////////////oKAAAAAAAAAAMqP//////////////////////AP//////////////6CgAAAAAAAAAMNz///////////////////////8A//////////////g4AAAAAAAAAFT0/////////////////////////wD/////////////bAAAAAAAAABU/P//////////////////////////AP///////////8wAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A////////////SAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////9wAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////hAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////9AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////xAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + '3' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD////////////////8sGg0FAAAACA4cLz8////////////////////AP//////////////rBgAAAAAAAAAAAAAACTA//////////////////8A/////////////3QAAAAAAAAAAAAAAAAAAASs/////////////////wD///////////+YAAAAAAAAAAAAAAAAAAAAAAjc////////////////AP//////////6AwAAAAAAAAAAAAAAAAAAAAAAGT///////////////8A//////////94AAAAAAAABJDw/8g4AAAAAAAAHP///////////////wD//////////yAAAAAAAACE/////9gAAAAAAAAA////////////////AP///////////NSwiGQ4FOT//////AAAAAAAABD///////////////8A//////////////////////////+YAAAAAAAAVP///////////////wD//////////////////////P/ggAQAAAAAAATM////////////////AP////////////////////9gAAAAAAAAAAAElP////////////////8A/////////////////////0AAAAAAAAAAHLj//////////////////wD/////////////////////OAAAAAAAAAAwkPj/////////////////AP////////////////////8gAAAAAAAAAAAAINj///////////////8A/////////////////////xAAAAAAAAAAAAAAIPD//////////////wD/////////////////////uOz/4HgEAAAAAAAAhP//////////////AP///////////////////////////3wAAAAAAAAw//////////////8A////////////////////////////6AAAAAAAAAj//////////////wD/////////////////////////////AAAAAAAAAP//////////////AP//////////tJh8YEQoDNz//////+AAAAAAAAAY//////////////8A//////////88AAAAAAAAaP//////dAAAAAAAAEz//////////////wD//////////6QAAAAAAAAAdOD/5HQAAAAAAAAApP//////////////AP///////////CgAAAAAAAAAAAAAAAAAAAAAACD4//////////////8A////////////yAQAAAAAAAAAAAAAAAAAAAAEuP///////////////wD/////////////rAQAAAAAAAAAAAAAAAAABJD/////////////////AP//////////////zDQAAAAAAAAAAAAAACTA//////////////////8A/////////////////8BwOCAAAAAUNGi0/P///////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + '4' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP//////////////////////////nAAAAAAAAAD///////////////8A/////////////////////////8AEAAAAAAAAAP///////////////wD////////////////////////gGAAAAAAAAAAA////////////////AP//////////////////////9DAAAAAAAAAAAAD///////////////8A//////////////////////9UAAAAAAAAAAAAAP///////////////wD/////////////////////hAAAAAAAAAAAAAAA////////////////AP///////////////////7QAAAAAAAAAAAAAAAD///////////////8A///////////////////UDAAAAAAUAAAAAAAAAP///////////////wD/////////////////7CQAAAAABMAAAAAAAAAA////////////////AP////////////////xEAAAAAACU/wAAAAAAAAD///////////////8A////////////////cAAAAAAAZP//AAAAAAAAAP///////////////wD//////////////6AAAAAAADz8//8AAAAAAAAA////////////////AP/////////////IBAAAAAAc6P///wAAAAAAAAD///////////////8A////////////5BgAAAAADMz/////AAAAAAAAAP///////////////wD///////////g0AAAAAACk//////8AAAAAAAAA////////////////AP//////////XAAAAAAAfP///////wAAAAAAAAD///////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A////////////////////////////AAAAAAAAAP///////////////wD///////////////////////////8AAAAAAAAA////////////////AP///////////////////////////wAAAAAAAAD///////////////8A////////////////////////////AAAAAAAAAP///////////////wD///////////////////////////8AAAAAAAAA////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + '5' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP//////////////8AAAAAAAAAAAAAAAAAAAAAAA//////////////8A///////////////MAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////////6wAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////////iAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////////9kAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////////0QAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////////IAAAAAAAYP////////////////////////////8A//////////////wAAAAAAAB8/////////////////////////////wD/////////////3AAAAAAAAIj/////////////////////////////AP////////////+4AAAAAAAAoLRYHAAEKGTE//////////////////8A/////////////5QAAAAAAAAQAAAAAAAAAABY9P///////////////wD/////////////dAAAAAAAAAAAAAAAAAAAAAA89P//////////////AP////////////9QAAAAAAAAAAAAAAAAAAAAAABg//////////////8A/////////////zAAAAAAAAAAAAAAAAAAAAAAAADQ/////////////wD/////////////IAAAAAAAAGjY/+h4BAAAAAAAAGz/////////////AP//////////////9NS0lHSc//////90AAAAAAAALP////////////8A/////////////////////////////9QAAAAAAAAE/////////////wD//////////////////////////////wAAAAAAAAD/////////////AP/////////////////////////////8AAAAAAAAEP////////////8A////////////pIRwWEAgDOD//////8wAAAAAAAA8/////////////wD///////////9EAAAAAAAAaP//////ZAAAAAAAAHz/////////////AP///////////6QAAAAAAAAAaOD/4GQAAAAAAAAE4P////////////8A/////////////CQAAAAAAAAAAAAAAAAAAAAAAGD//////////////wD/////////////yAQAAAAAAAAAAAAAAAAAAAAc7P//////////////AP//////////////rAwAAAAAAAAAAAAAAAAAGNj///////////////8A////////////////0EAAAAAAAAAAAAAAAFTo/////////////////wD//////////////////8h4QCAAAAAcQHzU////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + '6' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////////////////+0ZCwMAAAUNGjI////////////////////AP/////////////////EMAAAAAAAAAAAAABM6P////////////////8A////////////////lAQAAAAAAAAAAAAAAAAo6P///////////////wD//////////////6wAAAAAAAAAAAAAAAAAAABI////////////////AP/////////////oEAAAAAAAAAAAAAAAAAAAAACw//////////////8A/////////////3AAAAAAAAAoxP/YPAAAAAAAAEj//////////////wD////////////4EAAAAAAACOD////YDCBAVGiAoP//////////////AP///////////7gAAAAAAABY//////////////////////////////8A////////////eAAAAAAAAJT//////////////////////////////wD///////////9MAAAAAAAAvP/IXBgABCx03P//////////////////AP///////////ygAAAAAAADcdAAAAAAAAAAEiP////////////////8A////////////FAAAAAAAAFAAAAAAAAAAAAAAcP///////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAlP//////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAQ8P////////////8A////////////AAAAAAAAAABAyP/kZAAAAAAAAACQ/////////////wD///////////8MAAAAAAAALPj/////WAAAAAAAAET/////////////AP///////////yQAAAAAAACY///////MAAAAAAAAFP////////////8A////////////SAAAAAAAAMD///////wAAAAAAAAA/////////////wD///////////9wAAAAAAAAvP///////wAAAAAAAAD/////////////AP///////////7QAAAAAAACI///////UAAAAAAAAJP////////////8A////////////+AwAAAAAACDw/////2wAAAAAAABY/////////////wD/////////////cAAAAAAAADC8/Ox4AAAAAAAAAKj/////////////AP/////////////oEAAAAAAAAAAAAAAAAAAAAAAk/P////////////8A//////////////+oAAAAAAAAAAAAAAAAAAAABLj//////////////wD///////////////+QAAAAAAAAAAAAAAAAAACQ////////////////AP////////////////+0JAAAAAAAAAAAAAAkuP////////////////8A///////////////////8sGg0FAAADCxgqPz//////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + '7' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAABP////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAy4/////////////wD//////////////////////////+QUAAAAAAAEuP//////////////AP/////////////////////////8QAAAAAAAAKT///////////////8A/////////////////////////4wAAAAAAAB0/////////////////wD////////////////////////cCAAAAAAANPz/////////////////AP///////////////////////0QAAAAAAATY//////////////////8A//////////////////////+0AAAAAAAAeP///////////////////wD//////////////////////CQAAAAAABTw////////////////////AP////////////////////+gAAAAAAAAkP////////////////////8A/////////////////////ywAAAAAABDw/////////////////////wD///////////////////+4AAAAAAAAbP//////////////////////AP///////////////////1wAAAAAAADQ//////////////////////8A///////////////////4DAAAAAAAMP///////////////////////wD//////////////////7QAAAAAAAB8////////////////////////AP//////////////////aAAAAAAAAMj///////////////////////8A//////////////////8oAAAAAAAM/P///////////////////////wD/////////////////8AAAAAAAAET/////////////////////////AP////////////////+0AAAAAAAAcP////////////////////////8A/////////////////4wAAAAAAACY/////////////////////////wD/////////////////WAAAAAAAAMD/////////////////////////AP////////////////80AAAAAAAA4P////////////////////////8A/////////////////xAAAAAAAAD4/////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + '8' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD////////////////////IdDQUAAAEIEiA1P//////////////////AP/////////////////gRAAAAAAAAAAAAAAAROD///////////////8A////////////////0BgAAAAAAAAAAAAAAAAAEMj//////////////wD///////////////AcAAAAAAAAAAAAAAAAAAAAHPD/////////////AP//////////////hAAAAAAAAAAAAAAAAAAAAAAAhP////////////8A//////////////8sAAAAAAAAKMz/zCgAAAAAAAAs/////////////wD//////////////wAAAAAAAADM////zAAAAAAAAAD/////////////AP//////////////BAAAAAAAAP//////AAAAAAAABP////////////8A//////////////8sAAAAAAAAzP///9QAAAAAAAAw/////////////wD//////////////3wAAAAAAAAoyP/YNAAAAAAAAIT/////////////AP//////////////7BgAAAAAAAAAAAAAAAAAAAAc8P////////////8A////////////////xBgAAAAAAAAAAAAAAAAAGNj//////////////wD/////////////////tAQAAAAAAAAAAAAAAACo////////////////AP///////////////HAAAAAAAAAAAAAAAAAAAAB8//////////////8A//////////////9gAAAAAAAAAAAAAAAAAAAAAAB8/////////////wD/////////////wAAAAAAAAABk4P/UWAAAAAAAAATQ////////////AP////////////9UAAAAAAAAaP//////XAAAAAAAAGT///////////8A/////////////xgAAAAAAADg///////cAAAAAAAAJP///////////wD/////////////AAAAAAAAAP////////8AAAAAAAAA////////////AP////////////8AAAAAAAAA4P//////3AAAAAAAAAT///////////8A/////////////ygAAAAAAABg//////9cAAAAAAAALP///////////wD/////////////ZAAAAAAAAABY1P/cXAAAAAAAAABw////////////AP/////////////QAAAAAAAAAAAAAAAAAAAAAAAABNz///////////8A//////////////9gAAAAAAAAAAAAAAAAAAAAAAB0/////////////wD///////////////Q8AAAAAAAAAAAAAAAAAAAAUPz/////////////AP////////////////x4CAAAAAAAAAAAAAAAEIT8//////////////8A///////////////////smFQwGAAAABg0ZKT0/////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + '9' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////////////////ysYCwMAAAUNGiw/P//////////////////AP////////////////+4JAAAAAAAAAAAAAAkuP////////////////8A////////////////lAQAAAAAAAAAAAAAAAAAkP///////////////wD//////////////8AEAAAAAAAAAAAAAAAAAAAAqP//////////////AP/////////////8JAAAAAAAAAAAAAAAAAAAAAAQ7P////////////8A/////////////6wAAAAAAAAAfOz8vCwAAAAAAABw/////////////wD/////////////WAAAAAAAAHD/////7BgAAAAAAAz4////////////AP////////////8kAAAAAAAA1P//////hAAAAAAAALT///////////8A/////////////wAAAAAAAAD///////+4AAAAAAAAcP///////////wD/////////////AAAAAAAAAPz//////8AAAAAAAABI////////////AP////////////8UAAAAAAAAzP//////lAAAAAAAACT///////////8A/////////////0QAAAAAAABY//////gsAAAAAAAADP///////////wD/////////////kAAAAAAAAABw5P/IPAAAAAAAAAAA////////////AP/////////////wEAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A//////////////+UAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD///////////////9wAAAAAAAAAAAAAFAAAAAAAAAU////////////AP////////////////+IBAAAAAAAAABw3AAAAAAAACj///////////8A///////////////////cdCwEABhcxP+8AAAAAAAATP///////////wD//////////////////////////////5AAAAAAAAB4////////////AP//////////////////////////////UAAAAAAAALj///////////8A//////////////+kgGxUQCAM2P///+AIAAAAAAAQ+P///////////wD//////////////0gAAAAAAAA42P/EKAAAAAAAAHD/////////////AP//////////////sAAAAAAAAAAAAAAAAAAAAAAQ6P////////////8A////////////////TAAAAAAAAAAAAAAAAAAAAKz//////////////wD////////////////oKAAAAAAAAAAAAAAAAASU////////////////AP/////////////////sUAAAAAAAAAAAAAAwxP////////////////8A////////////////////yHA0FAAADCxktP///////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'A' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD//////////////////+QAAAAAAAAAAAAAAOT/////////////////AP//////////////////kAAAAAAAAAAAAAAAkP////////////////8A//////////////////88AAAAAAAAAAAAAAA8/////////////////wD/////////////////5AAAAAAAAAAAAAAAAADk////////////////AP////////////////+QAAAAAAAAAAAAAAAAAJD///////////////8A/////////////////zwAAAAAAAAAAAAAAAAAPP///////////////wD////////////////kAAAAAAAAAAgAAAAAAAAA5P//////////////AP///////////////5AAAAAAAAAAgAAAAAAAAACQ//////////////8A////////////////PAAAAAAAAAz8HAAAAAAAADz//////////////wD//////////////+QAAAAAAAAAWP9kAAAAAAAAANz/////////////AP//////////////kAAAAAAAAACk/7wAAAAAAAAAhP////////////8A//////////////88AAAAAAAABOz//BQAAAAAAAAw/////////////wD/////////////4AAAAAAAAAA8////ZAAAAAAAAADc////////////AP////////////+EAAAAAAAAAIj///+8AAAAAAAAAIT///////////8A/////////////zAAAAAAAAAA2P////wQAAAAAAAAMP///////////wD////////////cAAAAAAAAACT//////1wAAAAAAAAA3P//////////AP///////////4QAAAAAAAAAAAAAAAAAAAAAAAAAAACE//////////8A////////////MAAAAAAAAAAAAAAAAAAAAAAAAAAAADD//////////wD//////////9wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANz/////////AP//////////hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhP////////8A//////////8wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAw/////////wD/////////3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADc////////AP////////+EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIT///////8A/////////zAAAAAAAAAAhP///////////2QAAAAAAAAAMP///////wD////////cAAAAAAAAAADM////////////vAAAAAAAAAAA3P//////AP///////4QAAAAAAAAAHP/////////////4DAAAAAAAAACE//////8A////////MAAAAAAAAABk//////////////9cAAAAAAAAADD//////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'B' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAEDh83P///////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAEhP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAeP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAxP///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAABY////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAABT///////////8A//////////8AAAAAAAAAAP/////4zEwAAAAAAAAAAP///////////wD//////////wAAAAAAAAAA////////7AAAAAAAAAAQ////////////AP//////////AAAAAAAAAAD////////sAAAAAAAAAEj///////////8A//////////8AAAAAAAAAAP/////4zEQAAAAAAAAAtP///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAFz/////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAiA/P////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAIjPj//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAGKz/////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAJT///////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAABNz//////////wD//////////wAAAAAAAAAA///////sqCAAAAAAAAAAbP//////////AP//////////AAAAAAAAAAD/////////yAAAAAAAAAAs//////////8A//////////8AAAAAAAAAAP//////////AAAAAAAAAAT//////////wD//////////wAAAAAAAAAA/////////7wAAAAAAAAAAP//////////AP//////////AAAAAAAAAAD//////+ikGAAAAAAAAAAY//////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFT//////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsP//////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAADj///////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAc6P///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAATOj/////////////AP//////////AAAAAAAAAAAAAAAAAAAEIEBkkNj///////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'C' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP//////////////////5JRULBAAAAgkTIDQ//////////////////8A////////////////1FAAAAAAAAAAAAAAAABAyP///////////////wD//////////////4gEAAAAAAAAAAAAAAAAAAAElP//////////////AP////////////9wAAAAAAAAAAAAAAAAAAAAAAAAlP////////////8A////////////kAAAAAAAAAAAAAAAAAAAAAAAAAAEyP///////////wD//////////9wIAAAAAAAAAAAAAAAAAAAAAAAAAAAw////////////AP//////////WAAAAAAAAAAAWMz/8JwQAAAAAAAAAACw//////////8A/////////+wEAAAAAAAAAID//////9QMAAAAAAAAAET//////////wD/////////nAAAAAAAAAAo/P///////3wAAAAABDBspP//////////AP////////9gAAAAAAAAAIz/////////3BxQjMT0//////////////8A/////////zQAAAAAAAAAzP///////////////////////////////wD/////////GAAAAAAAAADo////////////////////////////////AP////////8AAAAAAAAAAP////////////////////////////////8A/////////wAAAAAAAAAA/////////////////////////////////wD/////////AAAAAAAAAAD/////////////////////////////////AP////////8cAAAAAAAAAOj///////////////////////////////8A/////////zgAAAAAAAAA0P/////////kIGio7P///////////////wD/////////bAAAAAAAAACg/////////5wAAAAAMHS49P//////////AP////////+oAAAAAAAAAEz/////////PAAAAAAAAAAc//////////8A//////////QIAAAAAAAAALz//////6QAAAAAAAAAAGT//////////wD//////////3AAAAAAAAAADIzo/+SEBAAAAAAAAAAAyP//////////AP//////////7BAAAAAAAAAAAAAAAAAAAAAAAAAAAED///////////8A////////////rAAAAAAAAAAAAAAAAAAAAAAAAAAE0P///////////wD/////////////fAAAAAAAAAAAAAAAAAAAAAAAAJz/////////////AP//////////////iAQAAAAAAAAAAAAAAAAAAASY//////////////8A////////////////yEAAAAAAAAAAAAAAAAA8yP///////////////wD//////////////////9yIUCwQAAAAIEB4yP//////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'D' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////////8AAAAAAAAAAAAAAAAADChQkOT/////////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAABGjw//////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAACDY/////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAABjk////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAED///////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAKj//////////wD///////////8AAAAAAAAAAP///+isSAAAAAAAAAAANP//////////AP///////////wAAAAAAAAAA////////hAAAAAAAAAAA2P////////8A////////////AAAAAAAAAAD/////////MAAAAAAAAACQ/////////wD///////////8AAAAAAAAAAP////////+MAAAAAAAAAFj/////////AP///////////wAAAAAAAAAA/////////8gAAAAAAAAAMP////////8A////////////AAAAAAAAAAD/////////5AAAAAAAAAAY/////////wD///////////8AAAAAAAAAAP//////////AAAAAAAAAAD/////////AP///////////wAAAAAAAAAA//////////8AAAAAAAAAAP////////8A////////////AAAAAAAAAAD//////////wAAAAAAAAAA/////////wD///////////8AAAAAAAAAAP/////////wAAAAAAAAABD/////////AP///////////wAAAAAAAAAA/////////9QAAAAAAAAAJP////////8A////////////AAAAAAAAAAD/////////qAAAAAAAAABI/////////wD///////////8AAAAAAAAAAP////////9QAAAAAAAAAHj/////////AP///////////wAAAAAAAAAA////////uAAAAAAAAAAAvP////////8A////////////AAAAAAAAAAD////w0HwEAAAAAAAAACT8/////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAoP//////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAADz8//////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAY6P///////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAKNz/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAACHT0//////////////8A////////////AAAAAAAAAAAAAAAAABg4bKj0/////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'E' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP//////////AAAAAAAAAAD///////////////////////////////8A//////////8AAAAAAAAAAP///////////////////////////////wD//////////wAAAAAAAAAA////////////////////////////////AP//////////AAAAAAAAAAD///////////////////////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////8AAAAAAAAAAP///////////////////////////////wD//////////wAAAAAAAAAA////////////////////////////////AP//////////AAAAAAAAAAD///////////////////////////////8A//////////8AAAAAAAAAAP///////////////////////////////wD//////////wAAAAAAAAAA////////////////////////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'F' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'G' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD//////////////////MB8TCgQAAAACCA4YJzs////////////////AP///////////////JQcAAAAAAAAAAAAAAAAAAhw8P////////////8A/////////////9gwAAAAAAAAAAAAAAAAAAAAAAAk2P///////////wD////////////EDAAAAAAAAAAAAAAAAAAAAAAAAAAc7P//////////AP//////////2AwAAAAAAAAAAAAAAAAAAAAAAAAAAABY//////////8A//////////wwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQ/////////wD/////////kAAAAAAAAAAAEHzQ/P/gmCAAAAAAAAAAAFz/////////AP////////wcAAAAAAAAACjg////////8CwAAAAAAAAgWP////////8A////////vAAAAAAAAAAI2P//////////yBRAcJjI8P///////////wD///////94AAAAAAAAAGD/////////////////////////////////AP///////0AAAAAAAAAAsP////////////////////////////////8A////////IAAAAAAAAADc/////////////////////////////////wD///////8AAAAAAAAAAP///////wAAAAAAAAAAAAAAAAD/////////AP///////wAAAAAAAAAA////////AAAAAAAAAAAAAAAAAP////////8A////////AAAAAAAAAAD///////8AAAAAAAAAAAAAAAAA/////////wD///////8gAAAAAAAAAOD//////wAAAAAAAAAAAAAAAAD/////////AP///////0AAAAAAAAAAtP//////AAAAAAAAAAAAAAAAAP////////8A////////cAAAAAAAAABw//////8AAAAAAAAAAAAAAAAA/////////wD///////+8AAAAAAAAABDs////////////AAAAAAAAAAD/////////AP////////wYAAAAAAAAADz0//////////AAAAAAAAAAAP////////8A/////////5AAAAAAAAAAACCY4P//3KhcCAAAAAAAAAAA/////////wD/////////+CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////AP//////////xAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIP////////8A////////////rAQAAAAAAAAAAAAAAAAAAAAAAAAAAGTw/////////wD/////////////vBQAAAAAAAAAAAAAAAAAAAAAADjI////////////AP//////////////8HAQAAAAAAAAAAAAAAAAAEiw//////////////8A//////////////////iwcEAgBAAABCA4aKDk/////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'H' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'I' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'J' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAj//////////////wD//////////+zMrIxwUDAQ//////wAAAAAAAAAIP//////////////AP//////////DAAAAAAAAADo////2AAAAAAAAAA0//////////////8A//////////8wAAAAAAAAAKj///+YAAAAAAAAAFj//////////////wD//////////2gAAAAAAAAAIND/yBgAAAAAAAAAkP//////////////AP//////////vAAAAAAAAAAAAAAAAAAAAAAAAADc//////////////8A////////////MAAAAAAAAAAAAAAAAAAAAAAAUP///////////////wD////////////EBAAAAAAAAAAAAAAAAAAAABjk////////////////AP////////////+sBAAAAAAAAAAAAAAAAAAY2P////////////////8A///////////////EMAAAAAAAAAAAAAAAVOj//////////////////wD/////////////////vHBAIAAAABg8fNT/////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'K' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////8AAAAAAAAAAP//////////wAQAAAAAAAAAAABw////////AP///////wAAAAAAAAAA/////////9AMAAAAAAAAAAAAcP////////8A////////AAAAAAAAAAD////////cGAAAAAAAAAAAAHD//////////wD///////8AAAAAAAAAAP//////6CgAAAAAAAAAAABs////////////AP///////wAAAAAAAAAA//////Q0AAAAAAAAAAAAVPz///////////8A////////AAAAAAAAAAD////8RAAAAAAAAAAAAFT8/////////////wD///////8AAAAAAAAAAP///1gAAAAAAAAAAABU/P//////////////AP///////wAAAAAAAAAA//9wAAAAAAAAAAAASPz///////////////8A////////AAAAAAAAAAD/jAAAAAAAAAAAADz0/////////////////wD///////8AAAAAAAAAAKQAAAAAAAAAAAA89P//////////////////AP///////wAAAAAAAAAABAAAAAAAAAAAFPT///////////////////8A////////AAAAAAAAAAAAAAAAAAAAAAAApP///////////////////wD///////8AAAAAAAAAAAAAAAAAAAAAAAAU8P//////////////////AP///////wAAAAAAAAAAAAAAAAAAAAAAAABk//////////////////8A////////AAAAAAAAAAAAAAAAAAAAAAAAAADE/////////////////wD///////8AAAAAAAAAAAAAAAAoEAAAAAAAACz8////////////////AP///////wAAAAAAAAAAAAAAGNiAAAAAAAAAAIj///////////////8A////////AAAAAAAAAAAAABjY//gYAAAAAAAACOD//////////////wD///////8AAAAAAAAAAAAY2P///5wAAAAAAAAASP//////////////AP///////wAAAAAAAAAAGNj//////CgAAAAAAAAAqP////////////8A////////AAAAAAAAAADI////////sAAAAAAAAAAc8P///////////wD///////8AAAAAAAAAAP//////////QAAAAAAAAABs////////////AP///////wAAAAAAAAAA///////////IAAAAAAAAAATI//////////8A////////AAAAAAAAAAD///////////9YAAAAAAAAADD8/////////wD///////8AAAAAAAAAAP///////////9wEAAAAAAAAAJD/////////AP///////wAAAAAAAAAA/////////////3AAAAAAAAAADOT///////8A////////AAAAAAAAAAD/////////////7BAAAAAAAAAAUP///////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'L' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'M' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A//////8AAAAAAAAAAAAAAHz//////3wAAAAAAAAAAAAAAP///////wD//////wAAAAAAAAAAAAAATP//////UAAAAAAAAAAAAAAA////////AP//////AAAAAAAAAAAAAAAc//////8cAAAAAAAAAAAAAAD///////8A//////8AAAAAAAAAAAAAAADw////8AAAAAAAAAAAAAAAAP///////wD//////wAAAAAAAAAAAAAAALz////AAAAAAAAAAAAAAAAA////////AP//////AAAAAAAAAAAAAAAAkP///5AAAAAAAAAAAAAAAAD///////8A//////8AAAAAAAAAAAAAAABc////ZAAAAAAAAAAAAAAAAP///////wD//////wAAAAAAAAAoAAAAADD///8wAAAAACQAAAAAAAAA////////AP//////AAAAAAAAAFwAAAAABPz//AgAAAAAXAAAAAAAAAD///////8A//////8AAAAAAAAAkAAAAAAA0P/UAAAAAACQAAAAAAAAAP///////wD//////wAAAAAAAADMAAAAAACg/6gAAAAAAMQAAAAAAAAA////////AP//////AAAAAAAAAPgEAAAAAHD/dAAAAAAE+AAAAAAAAAD///////8A//////8AAAAAAAAA/zQAAAAAQP9IAAAAADD/AAAAAAAAAP///////wD//////wAAAAAAAAD/bAAAAAAQ/xQAAAAAaP8AAAAAAAAA////////AP//////AAAAAAAAAP+gAAAAAADQAAAAAACc/wAAAAAAAAD///////8A//////8AAAAAAAAA/9QAAAAAAGgAAAAAAND/AAAAAAAAAP///////wD//////wAAAAAAAAD//wwAAAAAFAAAAAAM/P8AAAAAAAAA////////AP//////AAAAAAAAAP//RAAAAAAAAAAAADz//wAAAAAAAAD///////8A//////8AAAAAAAAA//94AAAAAAAAAAAAcP//AAAAAAAAAP///////wD//////wAAAAAAAAD//7AAAAAAAAAAAACo//8AAAAAAAAA////////AP//////AAAAAAAAAP//5AAAAAAAAAAAANz//wAAAAAAAAD///////8A//////8AAAAAAAAA////HAAAAAAAAAAQ////AAAAAAAAAP///////wD//////wAAAAAAAAD///9QAAAAAAAAAEz///8AAAAAAAAA////////AP//////AAAAAAAAAP///4gAAAAAAAAAfP///wAAAAAAAAD///////8A//////8AAAAAAAAA////vAAAAAAAAACw////AAAAAAAAAP///////wD//////wAAAAAAAAD////wAAAAAAAAAOz///8AAAAAAAAA////////AP//////AAAAAAAAAP////8sAAAAAAAc/////wAAAAAAAAD///////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'N' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////AAAAAAAAALD/////////////AAAAAAAAAP//////////AP////////8AAAAAAAAAFOj///////////8AAAAAAAAA//////////8A/////////wAAAAAAAAAASP///////////wAAAAAAAAD//////////wD/////////AAAAAAAAAAAAkP//////////AAAAAAAAAP//////////AP////////8AAAAAAAAAAAAI1P////////8AAAAAAAAA//////////8A/////////wAAAAAAAAAAAAAw+P///////wAAAAAAAAD//////////wD/////////AAAAAAAAAAAAAABw////////AAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAC8//////8AAAAAAAAA//////////8A/////////wAAAAAAAAAAAAAAABzs/////wAAAAAAAAD//////////wD/////////AAAAAAAAAAAAAAAAAFD/////AAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAAAAJz///8AAAAAAAAA//////////8A/////////wAAAAAAAAAUAAAAAAAADNz//wAAAAAAAAD//////////wD/////////AAAAAAAAALQAAAAAAAAANPz/AAAAAAAAAP//////////AP////////8AAAAAAAAA/2wAAAAAAAAAfP8AAAAAAAAA//////////8A/////////wAAAAAAAAD/+CwAAAAAAAAExAAAAAAAAAD//////////wD/////////AAAAAAAAAP//0AQAAAAAAAAgAAAAAAAAAP//////////AP////////8AAAAAAAAA////jAAAAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAD/////RAAAAAAAAAAAAAAAAAD//////////wD/////////AAAAAAAAAP/////kFAAAAAAAAAAAAAAAAP//////////AP////////8AAAAAAAAA//////+sAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAD///////9kAAAAAAAAAAAAAAD//////////wD/////////AAAAAAAAAP////////QkAAAAAAAAAAAAAP//////////AP////////8AAAAAAAAA/////////8wEAAAAAAAAAAAA//////////8A/////////wAAAAAAAAD//////////4QAAAAAAAAAAAD//////////wD/////////AAAAAAAAAP///////////DwAAAAAAAAAAP//////////AP////////8AAAAAAAAA////////////4BAAAAAAAAAA//////////8A/////////wAAAAAAAAD/////////////qAAAAAAAAAD//////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'O' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A///////////////////0qGw4HAAAABw4aKT0/////////////////wD////////////////wcAwAAAAAAAAAAAAAAAho6P//////////////AP//////////////uBQAAAAAAAAAAAAAAAAAAAAMoP////////////8A/////////////6AEAAAAAAAAAAAAAAAAAAAAAAAAkP///////////wD///////////+4BAAAAAAAAAAAAAAAAAAAAAAAAAAAoP//////////AP//////////8BQAAAAAAAAAAAAAAAAAAAAAAAAAAAAM5P////////8A//////////9wAAAAAAAAAAAsrPD/7KQsAAAAAAAAAABg/////////wD/////////+BAAAAAAAAAAUPj///////hQAAAAAAAAAAjs////////AP////////+sAAAAAAAAABDw//////////AYAAAAAAAAAKD///////8A/////////2wAAAAAAAAAdP///////////3wAAAAAAAAAYP///////wD/////////OAAAAAAAAAC4////////////xAAAAAAAAAAw////////AP////////8cAAAAAAAAAOD////////////oAAAAAAAAABT///////8A/////////wAAAAAAAAAA//////////////8AAAAAAAAAAP///////wD/////////AAAAAAAAAAD//////////////wAAAAAAAAAA////////AP////////8AAAAAAAAAAP/////////////8AAAAAAAAAAD///////8A/////////xwAAAAAAAAA5P///////////+AAAAAAAAAAHP///////wD/////////NAAAAAAAAAC8////////////uAAAAAAAAAA4////////AP////////9oAAAAAAAAAHj///////////98AAAAAAAAAGT///////8A/////////6gAAAAAAAAAGPD/////////+BgAAAAAAAAApP///////wD/////////9AwAAAAAAAAAUPz///////xcAAAAAAAAAAjs////////AP//////////cAAAAAAAAAAALKjs//CwOAAAAAAAAAAAYP////////8A///////////wFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzk/////////wD///////////+4BAAAAAAAAAAAAAAAAAAAAAAAAAAAoP//////////AP////////////+QAAAAAAAAAAAAAAAAAAAAAAAAAJD///////////8A//////////////+sEAAAAAAAAAAAAAAAAAAAAAyg/////////////wD////////////////oZAgAAAAAAAAAAAAAAARg4P//////////////AP//////////////////9KhsOCAAAAAUMFyc7P////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'P' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP///////////wAAAAAAAAAAAAAAAAAACCxguP////////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAOOD//////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAGOD/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAARP////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAxP///////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAABo////////////AP///////////wAAAAAAAAAA////6JwMAAAAAAAAADD///////////8A////////////AAAAAAAAAAD//////6AAAAAAAAAADP///////////wD///////////8AAAAAAAAAAP//////9AAAAAAAAAAA////////////AP///////////wAAAAAAAAAA///////0AAAAAAAAAAD///////////8A////////////AAAAAAAAAAD//////5gAAAAAAAAAHP///////////wD///////////8AAAAAAAAAAP///9iICAAAAAAAAABI////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAJD///////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAI6P///////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAIT/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAABU/P////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAIhPz//////////////wD///////////8AAAAAAAAAAAAAAAAABCRMkOz/////////////////AP///////////wAAAAAAAAAA//////////////////////////////8A////////////AAAAAAAAAAD//////////////////////////////wD///////////8AAAAAAAAAAP//////////////////////////////AP///////////wAAAAAAAAAA//////////////////////////////8A////////////AAAAAAAAAAD//////////////////////////////wD///////////8AAAAAAAAAAP//////////////////////////////AP///////////wAAAAAAAAAA//////////////////////////////8A////////////AAAAAAAAAAD//////////////////////////////wD///////////8AAAAAAAAAAP//////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'Q' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////SoaDQcAAAAHDhoqPT///////////////////8A//////////////BwDAAAAAAAAAAAAAAACHDo/////////////////wD///////////+4FAAAAAAAAAAAAAAAAAAAABCo////////////////AP//////////nAQAAAAAAAAAAAAAAAAAAAAAAACQ//////////////8A/////////7gEAAAAAAAAAAAAAAAAAAAAAAAAAACg/////////////wD////////wFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzo////////////AP///////3AAAAAAAAAAACyo8P/sqCwAAAAAAAAAAGT///////////8A///////4EAAAAAAAAABM+P///////FQAAAAAAAAACPT//////////wD//////7AAAAAAAAAAFPD/////////9BgAAAAAAAAApP//////////AP//////bAAAAAAAAAB4////////////fAAAAAAAAABk//////////8A//////84AAAAAAAAALz///////////+8AAAAAAAAADT//////////wD//////xwAAAAAAAAA6P///////////+QAAAAAAAAAHP//////////AP//////AAAAAAAAAAD//////////////wAAAAAAAAAA//////////8A//////8AAAAAAAAAAP//////////////AAAAAAAAAAD//////////wD//////wAAAAAAAAAA/P////////////8AAAAAAAAAAP//////////AP//////GAAAAAAAAADg////////////4AAAAAAAAAAc//////////8A//////84AAAAAAAAALT////MJHTo//+8AAAAAAAAADT//////////wD//////2wAAAAAAAAAdP///2AAABCg/3wAAAAAAAAAZP//////////AP//////rAAAAAAAAAAY9P/sCAAAAABMGAAAAAAAAACk//////////8A///////4EAAAAAAAAABU/P+0OAAAAAAAAAAAAAAACPT//////////wD///////94AAAAAAAAAAA4sPD/gAAAAAAAAAAAAABk////////////AP////////AcAAAAAAAAAAAAAAAAAAAAAAAAAAAADOT///////////8A/////////7wEAAAAAAAAAAAAAAAAAAAAAAAAAACQ/////////////wD//////////6wEAAAAAAAAAAAAAAAAAAAAAAAAABSs////////////AP///////////7gUAAAAAAAAAAAAAAAAAAAAAAAAAABAwP////////8A//////////////BwDAAAAAAAAAAAAAAABAgAAAAAAAA8/////////wD////////////////0qGg0GAAAABgwXJjkxBgAAAAAALD/////////AP//////////////////////////////////5DQAAAAk/P////////8A////////////////////////////////////+GwAAJD//////////wD//////////////////////////////////////8A49P//////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'R' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////wAAAAAAAAAAAAAAAAAAAAQgOGSk+P///////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAcuP//////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAEsP////////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ6P///////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB8////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAADD///////////8A/////////wAAAAAAAAAA///////svDgAAAAAAAAACP///////////wD/////////AAAAAAAAAAD/////////7AAAAAAAAAAA////////////AP////////8AAAAAAAAAAP/////////cAAAAAAAAABD///////////8A/////////wAAAAAAAAAA//////DQoCQAAAAAAAAAQP///////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACU////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAIPj///////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAzU/////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAA02P//////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAxctPz///////////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAEDY/////////////////wD/////////AAAAAAAAAAD/9LAsAAAAAAAAAAzc////////////////AP////////8AAAAAAAAAAP///+wkAAAAAAAAADD8//////////////8A/////////wAAAAAAAAAA/////8QAAAAAAAAAAJD//////////////wD/////////AAAAAAAAAAD//////1QAAAAAAAAAFPD/////////////AP////////8AAAAAAAAAAP//////3AQAAAAAAAAAgP////////////8A/////////wAAAAAAAAAA////////aAAAAAAAAAAM6P///////////wD/////////AAAAAAAAAAD////////oCAAAAAAAAABs////////////AP////////8AAAAAAAAAAP////////+AAAAAAAAAAATc//////////8A/////////wAAAAAAAAAA//////////AUAAAAAAAAAFj//////////wD/////////AAAAAAAAAAD//////////5AAAAAAAAAAAND/////////AP////////8AAAAAAAAAAP//////////+CQAAAAAAAAAQP////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'S' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP/////////////////8vHBEIAgAAAQgQHC8/P////////////////8A////////////////pCQAAAAAAAAAAAAAAAAcoP///////////////wD//////////////FwAAAAAAAAAAAAAAAAAAAAAXP//////////////AP////////////9oAAAAAAAAAAAAAAAAAAAAAAAAhP////////////8A////////////zAAAAAAAAAAAAAAAAAAAAAAAAAAI6P///////////wD///////////9cAAAAAAAAAAAAAAAAAAAAAAAAAACA////////////AP///////////xgAAAAAAAAAUOD/8KwkAAAAAAAAADj///////////8A////////////AAAAAAAAAAD0/////8wABCAgICxASP///////////wD///////////8MAAAAAAAAAMz/////////////////////////////AP///////////0AAAAAAAAAACFiQxPT///////////////////////8A////////////oAAAAAAAAAAAAAAAADBwtPT//////////////////wD////////////8QAAAAAAAAAAAAAAAAAAACFTA////////////////AP/////////////oOAAAAAAAAAAAAAAAAAAAAABM6P////////////8A///////////////4fAgAAAAAAAAAAAAAAAAAAAAY2P///////////wD/////////////////7IwwAAAAAAAAAAAAAAAAAAAo+P//////////AP/////////////////////koGw0BAAAAAAAAAAAAACU//////////8A///////////////////////////4uFgAAAAAAAAAADz//////////wD//////////2BgSEA0IBwA6P///////5QAAAAAAAAADP//////////AP//////////JAAAAAAAAACc/////////AAAAAAAAAAA//////////8A//////////9YAAAAAAAAACDo///////AAAAAAAAAABT//////////wD//////////6QAAAAAAAAAACCk7P/snBQAAAAAAAAAUP//////////AP//////////+BAAAAAAAAAAAAAAAAAAAAAAAAAAAACs//////////8A////////////kAAAAAAAAAAAAAAAAAAAAAAAAAAAOP///////////wD////////////8RAAAAAAAAAAAAAAAAAAAAAAAABjc////////////AP/////////////0PAAAAAAAAAAAAAAAAAAAAAAg2P////////////8A///////////////8hBQAAAAAAAAAAAAAAAAMdPT//////////////wD/////////////////+LRwSCAMAAAAHDhoqPT/////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'T' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'U' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////JAAAAAAAAADk/////////+gAAAAAAAAAHP//////////AP////////9MAAAAAAAAAJz/////////nAAAAAAAAABE//////////8A/////////4gAAAAAAAAAHOj//////+ggAAAAAAAAAHz//////////wD/////////0AAAAAAAAAAAIJzs/+ykIAAAAAAAAAAA0P//////////AP//////////QAAAAAAAAAAAAAAAAAAAAAAAAAAAAED///////////8A///////////IBAAAAAAAAAAAAAAAAAAAAAAAAAAE0P///////////wD///////////+YAAAAAAAAAAAAAAAAAAAAAAAAAJj/////////////AP////////////+UBAAAAAAAAAAAAAAAAAAAAASU//////////////8A///////////////IPAAAAAAAAAAAAAAAAAAwyP///////////////wD/////////////////0IxYOCAIAAAEIEiAyP//////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'V' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD//////zAAAAAAAAAAYP//////////////ZAAAAAAAAAAw////////AP//////kAAAAAAAAAAU/P////////////8UAAAAAAAAAJD///////8A///////oBAAAAAAAAADE////////////xAAAAAAAAAAE7P///////wD///////9MAAAAAAAAAHD///////////94AAAAAAAAAEz/////////AP///////6gAAAAAAAAAJP///////////yQAAAAAAAAArP////////8A////////+BAAAAAAAAAA1P/////////YAAAAAAAAABT4/////////wD/////////aAAAAAAAAACE/////////4QAAAAAAAAAbP//////////AP/////////EAAAAAAAAADT/////////OAAAAAAAAADM//////////8A//////////8kAAAAAAAAAOT//////+QAAAAAAAAAKP///////////wD//////////4QAAAAAAAAAmP//////nAAAAAAAAACI////////////AP//////////5AAAAAAAAABE//////9EAAAAAAAABOT///////////8A////////////QAAAAAAAAAT0////9AgAAAAAAABI/////////////wD///////////+gAAAAAAAAAKT///+kAAAAAAAAAKj/////////////AP////////////QIAAAAAAAAXP///1wAAAAAAAAM+P////////////8A/////////////1wAAAAAAAAM+P/8DAAAAAAAAGT//////////////wD/////////////vAAAAAAAAAC8/7wAAAAAAAAAxP//////////////AP//////////////HAAAAAAAAGj/aAAAAAAAACT///////////////8A//////////////94AAAAAAAAHP8cAAAAAAAAhP///////////////wD//////////////9gAAAAAAAAAkAAAAAAAAADk////////////////AP///////////////zgAAAAAAAAQAAAAAAAAQP////////////////8A////////////////lAAAAAAAAAAAAAAAAACg/////////////////wD////////////////sCAAAAAAAAAAAAAAADPT/////////////////AP////////////////9QAAAAAAAAAAAAAABg//////////////////8A/////////////////7AAAAAAAAAAAAAAAMD//////////////////wD//////////////////BQAAAAAAAAAAAAc////////////////////AP//////////////////cAAAAAAAAAAAAHz///////////////////8A///////////////////MAAAAAAAAAAAA3P///////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'W' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A//8cAAAAAAAAALz/////4AAAAAAAAAAA6P////+8AAAAAAAAABz//wD//1QAAAAAAAAAjP////+gAAAAAAAAAACo/////4wAAAAAAAAAUP//AP//jAAAAAAAAABU/////2AAAAAAAAAAAGj/////VAAAAAAAAACM//8A///EAAAAAAAAACT/////IAAAAAAAAAAAKP////8kAAAAAAAAAMT//wD///gEAAAAAAAAAPD//+AAAAAAAAAAAAAA6P//8AAAAAAAAAAE9P//AP///zAAAAAAAAAAvP//oAAAAAAAAAAAAACo//+8AAAAAAAAADD///8A////bAAAAAAAAACM//9gAAAAAAAAAAAAAGT//4wAAAAAAAAAaP///wD///+kAAAAAAAAAFT//yAAAAAAAAAAAAAAIP//VAAAAAAAAACc////AP///9gAAAAAAAAAJP/gAAAAAAAAAAAAAAAA4P8kAAAAAAAAANT///8A/////xAAAAAAAAAA8KAAAAAAAAAAAAAAAACg8AAAAAAAAAAQ/////wD/////TAAAAAAAAAC8YAAAAAAAAAAAAAAAAGC8AAAAAAAAAET/////AP////+AAAAAAAAAAIwgAAAAAAAAAAAAAAAAIIwAAAAAAAAAfP////8A/////7gAAAAAAAAANAAAAAAAACwwAAAAAAAANAAAAAAAAACw/////wD/////8AAAAAAAAAAAAAAAAAAAdHgAAAAAAAAAAAAAAAAAAOz/////AP//////KAAAAAAAAAAAAAAAAAC4vAAAAAAAAAAAAAAAAAAg//////8A//////9gAAAAAAAAAAAAAAAACPj4CAAAAAAAAAAAAAAAAFj//////wD//////5QAAAAAAAAAAAAAAABE//9IAAAAAAAAAAAAAAAAkP//////AP//////0AAAAAAAAAAAAAAAAIj//4wAAAAAAAAAAAAAAADI//////8A///////8DAAAAAAAAAAAAAAAzP//1AAAAAAAAAAAAAAABPj//////wD///////88AAAAAAAAAAAAABT/////GAAAAAAAAAAAAAA0////////AP///////3QAAAAAAAAAAAAAWP////9gAAAAAAAAAAAAAHD///////8A////////sAAAAAAAAAAAAACg/////6QAAAAAAAAAAAAApP///////wD////////kAAAAAAAAAAAAAOT/////6AAAAAAAAAAAAADc////////AP////////8cAAAAAAAAAAAo////////MAAAAAAAAAAAEP////////8A/////////1QAAAAAAAAAAHD///////94AAAAAAAAAABM/////////wD/////////jAAAAAAAAAAAtP///////7wAAAAAAAAAAID/////////AP/////////EAAAAAAAAAAT0////////+AgAAAAAAAAAuP////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'X' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////9UAAAAAAAAAKz///////////+sAAAAAAAAAFD/////////AP///////+QQAAAAAAAAFOT/////////8BwAAAAAAAAM5P////////8A/////////5gAAAAAAAAATP////////9kAAAAAAAAAJD//////////wD//////////0AAAAAAAAAAoP//////wAAAAAAAAAA0/P//////////AP//////////2AgAAAAAAAAQ4P////gkAAAAAAAABMz///////////8A////////////iAAAAAAAAABA////dAAAAAAAAABw/////////////wD////////////8MAAAAAAAAACU/9AEAAAAAAAAHPD/////////////AP/////////////IBAAAAAAAAAzYMAAAAAAAAACs//////////////8A//////////////90AAAAAAAAABAAAAAAAAAATP///////////////wD///////////////QgAAAAAAAAAAAAAAAAAAzg////////////////AP///////////////7wAAAAAAAAAAAAAAAAAjP////////////////8A/////////////////2AAAAAAAAAAAAAAADD8/////////////////wD/////////////////7BQAAAAAAAAAAAAEyP//////////////////AP/////////////////gDAAAAAAAAAAAAAjY//////////////////8A/////////////////0AAAAAAAAAAAAAAADj8/////////////////wD///////////////+UAAAAAAAAAAAAAAAAAJD/////////////////AP//////////////4AwAAAAAAAAAAAAAAAAADOD///////////////8A//////////////9AAAAAAAAAAAAAAAAAAAAAQP///////////////wD/////////////nAAAAAAAAAAAWAAAAAAAAAAAlP//////////////AP///////////+QQAAAAAAAAAGD/YAAAAAAAAAAM4P////////////8A////////////TAAAAAAAAAAs9P/0LAAAAAAAAABM/////////////wD//////////6AAAAAAAAAADNT////UDAAAAAAAAACg////////////AP/////////kEAAAAAAAAACg//////+gAAAAAAAAABDk//////////8A/////////0wAAAAAAAAAYP////////9gAAAAAAAAAEz//////////wD///////+oAAAAAAAAACz0//////////QsAAAAAAAAAKT/////////AP//////7BQAAAAAAAAM1P///////////9QMAAAAAAAAFOz///////8A//////9UAAAAAAAAAKD//////////////6AAAAAAAAAAVP///////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'Y' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP///////1QAAAAAAAAAAGj//////////2gAAAAAAAAAAFT///////8A////////5BAAAAAAAAAAAMT////////EAAAAAAAAAAAQ5P///////wD/////////mAAAAAAAAAAAKPj/////+CgAAAAAAAAAAJj/////////AP//////////PAAAAAAAAAAAgP////+AAAAAAAAAAAA8//////////8A///////////YCAAAAAAAAAAE2P//2AQAAAAAAAAACNj//////////wD///////////+AAAAAAAAAAAA4//84AAAAAAAAAACA////////////AP////////////woAAAAAAAAAACUlAAAAAAAAAAAKPz///////////8A/////////////8gAAAAAAAAAABAQAAAAAAAAAADI/////////////wD//////////////2wAAAAAAAAAAAAAAAAAAAAAbP//////////////AP//////////////8BwAAAAAAAAAAAAAAAAAABzw//////////////8A////////////////tAAAAAAAAAAAAAAAAAAAtP///////////////wD/////////////////VAAAAAAAAAAAAAAAAFT/////////////////AP/////////////////oEAAAAAAAAAAAAAAQ6P////////////////8A//////////////////+cAAAAAAAAAAAAAJz//////////////////wD///////////////////9AAAAAAAAAAABA////////////////////AP///////////////////9gAAAAAAAAAANj///////////////////8A/////////////////////wAAAAAAAAAA/////////////////////wD/////////////////////AAAAAAAAAAD/////////////////////AP////////////////////8AAAAAAAAAAP////////////////////8A/////////////////////wAAAAAAAAAA/////////////////////wD/////////////////////AAAAAAAAAAD/////////////////////AP////////////////////8AAAAAAAAAAP////////////////////8A/////////////////////wAAAAAAAAAA/////////////////////wD/////////////////////AAAAAAAAAAD/////////////////////AP////////////////////8AAAAAAAAAAP////////////////////8A/////////////////////wAAAAAAAAAA/////////////////////wD/////////////////////AAAAAAAAAAD/////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + 'Z' => array( + 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAQ//////////////8A/////////////////////////1AAAAAAAAAABLz//////////////wD///////////////////////98AAAAAAAAAACY////////////////AP//////////////////////pAAAAAAAAAAAaP////////////////8A/////////////////////8QIAAAAAAAAAET8/////////////////wD////////////////////gGAAAAAAAAAAo9P//////////////////AP//////////////////9CwAAAAAAAAAFNz///////////////////8A//////////////////xMAAAAAAAAAATA/////////////////////wD/////////////////eAAAAAAAAAAAnP//////////////////////AP///////////////5wAAAAAAAAAAHT///////////////////////8A///////////////ABAAAAAAAAABM/P///////////////////////wD/////////////3BQAAAAAAAAALPT/////////////////////////AP////////////QoAAAAAAAAABjg//////////////////////////8A///////////8SAAAAAAAAAAExP///////////////////////////wD//////////2wAAAAAAAAAAKD/////////////////////////////AP////////+YAAAAAAAAAAB8//////////////////////////////8A/////////wQAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=', + 'width' => 40 + ), + ); + } +} diff --git a/sources/phpBB/phpbb/captcha/plugins/captcha_abstract.php b/sources/phpBB/phpbb/captcha/plugins/captcha_abstract.php new file mode 100644 index 0000000..24ed7f9 --- /dev/null +++ b/sources/phpBB/phpbb/captcha/plugins/captcha_abstract.php @@ -0,0 +1,390 @@ + +* @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\captcha\plugins; + +/** +* This class holds the code shared by the two default 3.0.x CAPTCHAs. +*/ +abstract class captcha_abstract +{ + var $confirm_id; + var $confirm_code; + var $code; + var $seed; + var $attempts = 0; + var $type; + var $solved = 0; + var $captcha_vars = false; + + /** + * @var string name of the service. + */ + protected $service_name; + + function init($type) + { + global $config, $db, $user; + + // 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->type = (int) $type; + + if (!strlen($this->confirm_id) || !$this->load_code()) + { + // we have no confirm ID, better get ready to display something + $this->generate_code(); + } + else if ($refresh) + { + $this->regenerate_code(); + } + } + + function execute_demo() + { + global $user; + + $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)); + $this->seed = hexdec(substr(unique_id(), 4, 10)); + + // compute $seed % 0x7fffffff + $this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff); + + $generator = $this->get_generator_class(); + $captcha = new $generator(); + define('IMAGE_OUTPUT', 1); + $captcha->execute($this->code, $this->seed); + } + + function execute() + { + if (empty($this->code)) + { + if (!$this->load_code()) + { + // invalid request, bail out + return false; + } + } + $generator = $this->get_generator_class(); + $captcha = new $generator(); + define('IMAGE_OUTPUT', 1); + $captcha->execute($this->code, $this->seed); + } + + function get_template() + { + global $config, $user, $template, $phpEx, $phpbb_root_path; + + if ($this->is_solved()) + { + return false; + } + else + { + $link = append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=confirm&confirm_id=' . $this->confirm_id . '&type=' . $this->type); + $contact_link = phpbb_get_board_contact_link($config, $phpbb_root_path, $phpEx); + $explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '', ''); + + $template->assign_vars(array( + 'CONFIRM_IMAGE_LINK' => $link, + 'CONFIRM_IMAGE' => '', + 'CONFIRM_IMG' => '', + 'CONFIRM_ID' => $this->confirm_id, + 'S_CONFIRM_CODE' => true, + 'S_TYPE' => $this->type, + 'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh'] && $this->type == CONFIRM_REG) ? true : false, + 'L_CONFIRM_EXPLAIN' => $explain, + )); + + return 'captcha_default.html'; + } + } + + function get_demo_template($id) + { + global $config, $user, $template, $phpbb_admin_path, $phpEx; + + $variables = ''; + + if (is_array($this->captcha_vars)) + { + foreach ($this->captcha_vars as $captcha_var => $template_var) + { + $variables .= '&' . rawurlencode($captcha_var) . '=' . request_var($captcha_var, (int) $config[$captcha_var]); + } + } + + // acp_captcha has a delivery function; let's use it + $template->assign_vars(array( + 'CONFIRM_IMAGE' => append_sid($phpbb_admin_path . 'index.' . $phpEx, 'captcha_demo=1&mode=visual&i=' . $id . '&select_captcha=' . $this->get_service_name()) . $variables, + 'CONFIRM_ID' => $this->confirm_id, + )); + + return 'captcha_default_acp_demo.html'; + } + + function get_hidden_fields() + { + $hidden_fields = array(); + + // this is required for posting.php - otherwise we would forget about the captcha being already solved + if ($this->solved) + { + $hidden_fields['confirm_code'] = $this->confirm_code; + } + $hidden_fields['confirm_id'] = $this->confirm_id; + return $hidden_fields; + } + + function garbage_collect($type) + { + global $db, $config; + + $sql = 'SELECT DISTINCT c.session_id + FROM ' . CONFIRM_TABLE . ' c + LEFT JOIN ' . SESSIONS_TABLE . ' s ON (c.session_id = s.session_id) + WHERE s.session_id IS NULL' . + ((empty($type)) ? '' : ' AND c.confirm_type = ' . (int) $type); + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $sql_in = array(); + do + { + $sql_in[] = (string) $row['session_id']; + } + while ($row = $db->sql_fetchrow($result)); + + if (sizeof($sql_in)) + { + $sql = 'DELETE FROM ' . CONFIRM_TABLE . ' + WHERE ' . $db->sql_in_set('session_id', $sql_in); + $db->sql_query($sql); + } + } + $db->sql_freeresult($result); + } + + function uninstall() + { + $this->garbage_collect(0); + } + + function install() + { + return; + } + + function validate() + { + global $config, $db, $user; + + if (empty($user->lang)) + { + $user->setup(); + } + + $error = ''; + if (!$this->confirm_id) + { + $error = $user->lang['CONFIRM_CODE_WRONG']; + } + else + { + if ($this->check_code()) + { + $this->solved = true; + } + else + { + $error = $user->lang['CONFIRM_CODE_WRONG']; + } + } + + if (strlen($error)) + { + // okay, incorrect answer. Let's ask a new question. + $this->new_attempt(); + return $error; + } + else + { + return false; + } + } + + /** + * The old way to generate code, suitable for GD and non-GD. Resets the internal state. + */ + function generate_code() + { + global $db, $user; + + $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)); + $this->confirm_id = md5(unique_id($user->ip)); + $this->seed = hexdec(substr(unique_id(), 4, 10)); + $this->solved = 0; + // compute $seed % 0x7fffffff + $this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff); + + $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'confirm_id' => (string) $this->confirm_id, + 'session_id' => (string) $user->session_id, + 'confirm_type' => (int) $this->type, + 'code' => (string) $this->code, + 'seed' => (int) $this->seed) + ); + $db->sql_query($sql); + } + + /** + * New Question, if desired. + */ + function regenerate_code() + { + global $db, $user; + + $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)); + $this->seed = hexdec(substr(unique_id(), 4, 10)); + $this->solved = 0; + // compute $seed % 0x7fffffff + $this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff); + + $sql = 'UPDATE ' . CONFIRM_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( + 'code' => (string) $this->code, + 'seed' => (int) $this->seed)) . ' + WHERE + confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\' + AND session_id = \'' . $db->sql_escape($user->session_id) . '\''; + $db->sql_query($sql); + } + + /** + * New Question, if desired. + */ + function new_attempt() + { + global $db, $user; + + $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)); + $this->seed = hexdec(substr(unique_id(), 4, 10)); + $this->solved = 0; + // compute $seed % 0x7fffffff + $this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff); + + $sql = 'UPDATE ' . CONFIRM_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( + 'code' => (string) $this->code, + 'seed' => (int) $this->seed)) . ' + , attempts = attempts + 1 + WHERE + confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\' + AND session_id = \'' . $db->sql_escape($user->session_id) . '\''; + $db->sql_query($sql); + } + + /** + * Look up everything we need for painting&checking. + */ + function load_code() + { + global $db, $user; + + $sql = 'SELECT code, seed, attempts + FROM ' . CONFIRM_TABLE . " + WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "' + AND session_id = '" . $db->sql_escape($user->session_id) . "' + AND confirm_type = " . $this->type; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $this->code = $row['code']; + $this->seed = $row['seed']; + $this->attempts = $row['attempts']; + return true; + } + + return false; + } + + function check_code() + { + return (strcasecmp($this->code, $this->confirm_code) === 0); + } + + function get_attempt_count() + { + return $this->attempts; + } + + function reset() + { + global $db, $user; + + $sql = 'DELETE FROM ' . CONFIRM_TABLE . " + WHERE session_id = '" . $db->sql_escape($user->session_id) . "' + AND confirm_type = " . (int) $this->type; + $db->sql_query($sql); + + // we leave the class usable by generating a new question + $this->generate_code(); + } + + function is_solved() + { + if (request_var('confirm_code', false) && $this->solved === 0) + { + $this->validate(); + } + return (bool) $this->solved; + } + + /** + * API function + */ + function has_config() + { + return false; + } + + /** + * @return string the name of the service corresponding to the plugin + */ + function get_service_name() + { + return $this->service_name; + } + + /** + * Set the name of the plugin + * + * @param string $name + */ + public function set_name($name) + { + $this->service_name = $name; + } + + /** + * @return string the name of the class used to generate the captcha + */ + abstract function get_generator_class(); +} diff --git a/sources/phpBB/phpbb/captcha/plugins/gd.php b/sources/phpBB/phpbb/captcha/plugins/gd.php new file mode 100644 index 0000000..f6200b5 --- /dev/null +++ b/sources/phpBB/phpbb/captcha/plugins/gd.php @@ -0,0 +1,130 @@ + +* @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\captcha\plugins; + +class gd extends captcha_abstract +{ + var $captcha_vars = array( + 'captcha_gd_x_grid' => 'CAPTCHA_GD_X_GRID', + 'captcha_gd_y_grid' => 'CAPTCHA_GD_Y_GRID', + 'captcha_gd_foreground_noise' => 'CAPTCHA_GD_FOREGROUND_NOISE', +// 'captcha_gd' => 'CAPTCHA_GD_PREVIEWED', + 'captcha_gd_wave' => 'CAPTCHA_GD_WAVE', + 'captcha_gd_3d_noise' => 'CAPTCHA_GD_3D_NOISE', + 'captcha_gd_fonts' => 'CAPTCHA_GD_FONTS', + ); + + public function is_available() + { + return @extension_loaded('gd'); + } + + /** + * @return string the name of the class used to generate the captcha + */ + function get_generator_class() + { + return '\\phpbb\\captcha\\gd'; + } + + /** + * API function + */ + function has_config() + { + return true; + } + + public function get_name() + { + return 'CAPTCHA_GD'; + } + + function acp_page($id, &$module) + { + global $db, $user, $auth, $template; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $user->add_lang('acp/board'); + + $config_vars = array( + 'enable_confirm' => 'REG_ENABLE', + 'enable_post_confirm' => 'POST_ENABLE', + 'confirm_refresh' => 'CONFIRM_REFRESH', + 'captcha_gd' => 'CAPTCHA_GD', + ); + + $module->tpl_name = 'captcha_gd_acp'; + $module->page_title = 'ACP_VC_SETTINGS'; + $form_key = 'acp_captcha'; + add_form_key($form_key); + + $submit = request_var('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); + if ($value >= 0) + { + set_config($captcha_var, $value); + } + } + + add_log('admin', 'LOG_CONFIG_VISUAL'); + trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action)); + } + else if ($submit) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($module->u_action)); + } + else + { + foreach ($this->captcha_vars as $captcha_var => $template_var) + { + $var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var]; + $template->assign_var($template_var, $var); + } + + $template->assign_vars(array( + 'CAPTCHA_PREVIEW' => $this->get_demo_template($id), + 'CAPTCHA_NAME' => $this->get_service_name(), + 'U_ACTION' => $module->u_action, + )); + } + } + + function execute_demo() + { + global $config; + + $config_old = $config; + + $config = new \phpbb\config\config(array()); + foreach ($config_old as $key => $value) + { + $config->set($key, $value); + } + + foreach ($this->captcha_vars as $captcha_var => $template_var) + { + $config->set($captcha_var, request_var($captcha_var, (int) $config[$captcha_var])); + } + parent::execute_demo(); + $config = $config_old; + } + +} diff --git a/sources/phpBB/phpbb/captcha/plugins/gd_wave.php b/sources/phpBB/phpbb/captcha/plugins/gd_wave.php new file mode 100644 index 0000000..e1d44df --- /dev/null +++ b/sources/phpBB/phpbb/captcha/plugins/gd_wave.php @@ -0,0 +1,42 @@ + +* @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\captcha\plugins; + +class gd_wave extends captcha_abstract +{ + public function is_available() + { + return @extension_loaded('gd'); + } + + public function get_name() + { + return 'CAPTCHA_GD_3D'; + } + + /** + * @return string the name of the class used to generate the captcha + */ + function get_generator_class() + { + return '\\phpbb\\captcha\\gd_wave'; + } + + function acp_page($id, &$module) + { + global $config, $db, $template, $user; + + trigger_error($user->lang['CAPTCHA_NO_OPTIONS'] . adm_back_link($module->u_action)); + } +} diff --git a/sources/phpBB/phpbb/captcha/plugins/nogd.php b/sources/phpBB/phpbb/captcha/plugins/nogd.php new file mode 100644 index 0000000..6845e59 --- /dev/null +++ b/sources/phpBB/phpbb/captcha/plugins/nogd.php @@ -0,0 +1,42 @@ + +* @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\captcha\plugins; + +class nogd extends captcha_abstract +{ + public function is_available() + { + return true; + } + + public function get_name() + { + return 'CAPTCHA_NO_GD'; + } + + /** + * @return string the name of the class used to generate the captcha + */ + function get_generator_class() + { + return '\\phpbb\\captcha\\non_gd'; + } + + function acp_page($id, &$module) + { + global $user; + + trigger_error($user->lang['CAPTCHA_NO_OPTIONS'] . adm_back_link($module->u_action)); + } +} diff --git a/sources/phpBB/phpbb/captcha/plugins/qa.php b/sources/phpBB/phpbb/captcha/plugins/qa.php new file mode 100644 index 0000000..a7ba994 --- /dev/null +++ b/sources/phpBB/phpbb/captcha/plugins/qa.php @@ -0,0 +1,1009 @@ + +* @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\captcha\plugins; + +/** +* And now to something completely different. Let's make a captcha without extending the abstract class. +* QA CAPTCHA sample implementation +*/ +class qa +{ + var $confirm_id; + var $answer; + var $question_ids; + var $question_text; + var $question_lang; + var $question_strict; + var $attempts = 0; + var $type; + // dirty trick: 0 is false, but can still encode that the captcha is not yet validated + var $solved = 0; + + protected $table_captcha_questions; + protected $table_captcha_answers; + protected $table_qa_confirm; + + /** + * @var string name of the service. + */ + protected $service_name; + + /** + * Constructor + * + * @param string $table_captcha_questions + * @param string $table_captcha_answers + * @param string $table_qa_confirm + */ + function __construct($table_captcha_questions, $table_captcha_answers, $table_qa_confirm) + { + $this->table_captcha_questions = $table_captcha_questions; + $this->table_captcha_answers = $table_captcha_answers; + $this->table_qa_confirm = $table_qa_confirm; + } + + /** + * @param int $type as per the CAPTCHA API docs, the type + */ + function init($type) + { + global $config, $db, $user; + + // 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->type = (int) $type; + $this->question_lang = $user->lang_name; + + // we need all defined questions - shouldn't be too many, so we can just grab them + // try the user's lang first + $sql = 'SELECT question_id + FROM ' . $this->table_captcha_questions . " + WHERE lang_iso = '" . $db->sql_escape($user->lang_name) . "'"; + $result = $db->sql_query($sql, 3600); + + while ($row = $db->sql_fetchrow($result)) + { + $this->question_ids[$row['question_id']] = $row['question_id']; + } + $db->sql_freeresult($result); + + // fallback to the board default lang + if (!sizeof($this->question_ids)) + { + $this->question_lang = $config['default_lang']; + + $sql = 'SELECT question_id + FROM ' . $this->table_captcha_questions . " + WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'"; + $result = $db->sql_query($sql, 7200); + + while ($row = $db->sql_fetchrow($result)) + { + $this->question_ids[$row['question_id']] = $row['question_id']; + } + $db->sql_freeresult($result); + } + + // okay, if there is a confirm_id, we try to load that confirm's state. If not, we try to find one + if (!$this->load_answer() && (!$this->load_confirm_id() || !$this->load_answer())) + { + // we have no valid confirm ID, better get ready to ask something + $this->select_question(); + } + } + + /** + * See if the captcha has created its tables. + */ + public function is_installed() + { + global $db; + + $db_tool = new \phpbb\db\tools($db); + + return $db_tool->sql_table_exists($this->table_captcha_questions); + } + + /** + * API function - for the captcha to be available, it must have installed itself and there has to be at least one question in the board's default lang + */ + public function is_available() + { + global $config, $db, $phpbb_root_path, $phpEx, $user; + + // load language file for pretty display in the ACP dropdown + $user->add_lang('captcha_qa'); + + if (!$this->is_installed()) + { + return false; + } + + $sql = 'SELECT COUNT(question_id) AS question_count + FROM ' . $this->table_captcha_questions . " + WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + return ((bool) $row['question_count']); + } + + /** + * API function + */ + function has_config() + { + return true; + } + + /** + * API function + */ + static public function get_name() + { + return 'CAPTCHA_QA'; + } + + /** + * @return string the name of the service corresponding to the plugin + */ + function get_service_name() + { + return $this->service_name; + } + + /** + * Set the name of the plugin + * + * @param string $name + */ + public function set_name($name) + { + $this->service_name = $name; + } + + /** + * API function - not needed as we don't display an image + */ + function execute_demo() + { + } + + /** + * API function - not needed as we don't display an image + */ + function execute() + { + } + + /** + * API function - send the question to the template + */ + function get_template() + { + global $template; + + if ($this->is_solved()) + { + return false; + } + else + { + $template->assign_vars(array( + 'QA_CONFIRM_QUESTION' => $this->question_text, + 'QA_CONFIRM_ID' => $this->confirm_id, + 'S_CONFIRM_CODE' => true, + 'S_TYPE' => $this->type, + )); + + return 'captcha_qa.html'; + } + } + + /** + * API function - we just display a mockup so that the captcha doesn't need to be installed + */ + function get_demo_template() + { + global $config, $db, $template; + + if ($this->is_available()) + { + $sql = 'SELECT question_text + FROM ' . $this->table_captcha_questions . " + WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'"; + $result = $db->sql_query_limit($sql, 1); + if ($row = $db->sql_fetchrow($result)) + { + $template->assign_vars(array( + 'QA_CONFIRM_QUESTION' => $row['question_text'], + )); + } + $db->sql_freeresult($result); + } + return 'captcha_qa_acp_demo.html'; + } + + /** + * API function + */ + function get_hidden_fields() + { + $hidden_fields = array(); + + // this is required - otherwise we would forget about the captcha being already solved + if ($this->solved) + { + $hidden_fields['qa_answer'] = $this->answer; + } + $hidden_fields['qa_confirm_id'] = $this->confirm_id; + + return $hidden_fields; + } + + /** + * API function + */ + function garbage_collect($type = 0) + { + global $db, $config; + + $sql = 'SELECT c.confirm_id + FROM ' . $this->table_qa_confirm . ' c + LEFT JOIN ' . SESSIONS_TABLE . ' s + ON (c.session_id = s.session_id) + WHERE s.session_id IS NULL' . + ((empty($type)) ? '' : ' AND c.confirm_type = ' . (int) $type); + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $sql_in = array(); + + do + { + $sql_in[] = (string) $row['confirm_id']; + } + while ($row = $db->sql_fetchrow($result)); + + if (sizeof($sql_in)) + { + $sql = 'DELETE FROM ' . $this->table_qa_confirm . ' + WHERE ' . $db->sql_in_set('confirm_id', $sql_in); + $db->sql_query($sql); + } + } + $db->sql_freeresult($result); + } + + /** + * API function - we don't drop the tables here, as that would cause the loss of all entered questions. + */ + function uninstall() + { + $this->garbage_collect(0); + } + + /** + * API function - set up shop + */ + function install() + { + global $db; + + $db_tool = new \phpbb\db\tools($db); + + $tables = array($this->table_captcha_questions, $this->table_captcha_answers, $this->table_qa_confirm); + + $schemas = array( + $this->table_captcha_questions => array ( + 'COLUMNS' => array( + 'question_id' => array('UINT', null, 'auto_increment'), + 'strict' => array('BOOL', 0), + 'lang_id' => array('UINT', 0), + 'lang_iso' => array('VCHAR:30', ''), + 'question_text' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'question_id', + 'KEYS' => array( + 'lang' => array('INDEX', 'lang_iso'), + ), + ), + $this->table_captcha_answers => array ( + 'COLUMNS' => array( + 'question_id' => array('UINT', 0), + 'answer_text' => array('STEXT_UNI', ''), + ), + 'KEYS' => array( + 'qid' => array('INDEX', 'question_id'), + ), + ), + $this->table_qa_confirm => array ( + 'COLUMNS' => array( + 'session_id' => array('CHAR:32', ''), + 'confirm_id' => array('CHAR:32', ''), + 'lang_iso' => array('VCHAR:30', ''), + 'question_id' => array('UINT', 0), + 'attempts' => array('UINT', 0), + 'confirm_type' => array('USINT', 0), + ), + 'KEYS' => array( + 'session_id' => array('INDEX', 'session_id'), + 'lookup' => array('INDEX', array('confirm_id', 'session_id', 'lang_iso')), + ), + 'PRIMARY_KEY' => 'confirm_id', + ), + ); + + foreach($schemas as $table => $schema) + { + if (!$db_tool->sql_table_exists($table)) + { + $db_tool->sql_create_table($table, $schema); + } + } + } + + /** + * API function - see what has to be done to validate + */ + function validate() + { + global $config, $db, $user; + + $error = ''; + + if (!sizeof($this->question_ids)) + { + return false; + } + + if (!$this->confirm_id) + { + $error = $user->lang['CONFIRM_QUESTION_WRONG']; + } + else + { + if ($this->check_answer()) + { + $this->solved = true; + } + else + { + $error = $user->lang['CONFIRM_QUESTION_WRONG']; + } + } + + if (strlen($error)) + { + // okay, incorrect answer. Let's ask a new question. + $this->new_attempt(); + $this->solved = false; + + return $error; + } + else + { + return false; + } + } + + /** + * Select a question + */ + function select_question() + { + global $db, $user; + + if (!sizeof($this->question_ids)) + { + return false; + } + $this->confirm_id = md5(unique_id($user->ip)); + $this->question = (int) array_rand($this->question_ids); + + $sql = 'INSERT INTO ' . $this->table_qa_confirm . ' ' . $db->sql_build_array('INSERT', array( + 'confirm_id' => (string) $this->confirm_id, + 'session_id' => (string) $user->session_id, + 'lang_iso' => (string) $this->question_lang, + 'confirm_type' => (int) $this->type, + 'question_id' => (int) $this->question, + )); + $db->sql_query($sql); + + $this->load_answer(); + } + + /** + * New Question, if desired. + */ + function reselect_question() + { + global $db, $user; + + if (!sizeof($this->question_ids)) + { + return false; + } + + $this->question = (int) array_rand($this->question_ids); + $this->solved = 0; + + $sql = 'UPDATE ' . $this->table_qa_confirm . ' + SET question_id = ' . (int) $this->question . " + WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "' + AND session_id = '" . $db->sql_escape($user->session_id) . "'"; + $db->sql_query($sql); + + $this->load_answer(); + } + + /** + * Wrong answer, so we increase the attempts and use a different question. + */ + function new_attempt() + { + global $db, $user; + + // yah, I would prefer a stronger rand, but this should work + $this->question = (int) array_rand($this->question_ids); + $this->solved = 0; + + $sql = 'UPDATE ' . $this->table_qa_confirm . ' + SET question_id = ' . (int) $this->question . ", + attempts = attempts + 1 + WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "' + AND session_id = '" . $db->sql_escape($user->session_id) . "'"; + $db->sql_query($sql); + + $this->load_answer(); + } + + + /** + * See if there is already an entry for the current session. + */ + function load_confirm_id() + { + global $db, $user; + + $sql = 'SELECT confirm_id + FROM ' . $this->table_qa_confirm . " + WHERE + session_id = '" . $db->sql_escape($user->session_id) . "' + AND lang_iso = '" . $db->sql_escape($this->question_lang) . "' + AND confirm_type = " . $this->type; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $this->confirm_id = $row['confirm_id']; + return true; + } + return false; + } + + /** + * Look up everything we need and populate the instance variables. + */ + function load_answer() + { + global $db, $user; + + if (!strlen($this->confirm_id) || !sizeof($this->question_ids)) + { + return false; + } + + $sql = 'SELECT con.question_id, attempts, question_text, strict + FROM ' . $this->table_qa_confirm . ' con, ' . $this->table_captcha_questions . " qes + WHERE con.question_id = qes.question_id + AND confirm_id = '" . $db->sql_escape($this->confirm_id) . "' + AND session_id = '" . $db->sql_escape($user->session_id) . "' + AND qes.lang_iso = '" . $db->sql_escape($this->question_lang) . "' + AND confirm_type = " . $this->type; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $this->question = $row['question_id']; + + $this->attempts = $row['attempts']; + $this->question_strict = $row['strict']; + $this->question_text = $row['question_text']; + + return true; + } + + return false; + } + + /** + * The actual validation + */ + function check_answer() + { + global $db; + + $answer = ($this->question_strict) ? utf8_normalize_nfc(request_var('qa_answer', '', true)) : utf8_clean_string(utf8_normalize_nfc(request_var('qa_answer', '', true))); + + $sql = 'SELECT answer_text + FROM ' . $this->table_captcha_answers . ' + WHERE question_id = ' . (int) $this->question; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $solution = ($this->question_strict) ? $row['answer_text'] : utf8_clean_string($row['answer_text']); + + if ($solution === $answer) + { + $this->solved = true; + + break; + } + } + $db->sql_freeresult($result); + + return $this->solved; + } + + /** + * API function + */ + function get_attempt_count() + { + return $this->attempts; + } + + /** + * API function + */ + function reset() + { + global $db, $user; + + $sql = 'DELETE FROM ' . $this->table_qa_confirm . " + WHERE session_id = '" . $db->sql_escape($user->session_id) . "' + AND confirm_type = " . (int) $this->type; + $db->sql_query($sql); + + // we leave the class usable by generating a new question + $this->select_question(); + } + + /** + * API function + */ + function is_solved() + { + if (request_var('qa_answer', false) && $this->solved === 0) + { + $this->validate(); + } + + return (bool) $this->solved; + } + + /** + * API function - The ACP backend, this marks the end of the easy methods + */ + function acp_page($id, &$module) + { + global $db, $user, $auth, $template; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $user->add_lang('acp/board'); + $user->add_lang('captcha_qa'); + + if (!self::is_installed()) + { + $this->install(); + } + + $module->tpl_name = 'captcha_qa_acp'; + $module->page_title = 'ACP_VC_SETTINGS'; + $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', ''); + + // we have two pages, so users might want to navigate from one to the other + $list_url = $module->u_action . "&configure=1&select_captcha=" . $this->get_service_name(); + + $template->assign_vars(array( + 'U_ACTION' => $module->u_action, + 'QUESTION_ID' => $question_id , + 'CLASS' => $this->get_service_name(), + )); + + // show the list? + if (!$question_id && $action != 'add') + { + $this->acp_question_list($module); + } + else if ($question_id && $action == 'delete') + { + if ($this->get_service_name() !== $config['captcha_plugin'] || !$this->acp_is_last($question_id)) + { + if (confirm_box(true)) + { + $this->acp_delete_question($question_id); + + trigger_error($user->lang['QUESTION_DELETED'] . adm_back_link($list_url)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'question_id' => $question_id, + 'action' => $action, + 'configure' => 1, + 'select_captcha' => $this->get_service_name(), + )) + ); + } + } + else + { + trigger_error($user->lang['QA_LAST_QUESTION'] . adm_back_link($list_url), E_USER_WARNING); + } + } + else + { + // okay, show the editor + $error = false; + $input_question = request_var('question_text', '', true); + $input_answers = request_var('answers', '', true); + $input_lang = request_var('lang_iso', '', true); + $input_strict = request_var('strict', false); + $langs = $this->get_languages(); + + foreach ($langs as $lang => $entry) + { + $template->assign_block_vars('langs', array( + 'ISO' => $lang, + 'NAME' => $entry['name'], + )); + } + + $template->assign_vars(array( + 'U_LIST' => $list_url, + )); + + if ($question_id) + { + if ($question = $this->acp_get_question_data($question_id)) + { + $answers = (isset($input_answers[$lang])) ? $input_answers[$lang] : implode("\n", $question['answers']); + + $template->assign_vars(array( + 'QUESTION_TEXT' => ($input_question) ? $input_question : $question['question_text'], + 'LANG_ISO' => ($input_lang) ? $input_lang : $question['lang_iso'], + 'STRICT' => (isset($_REQUEST['strict'])) ? $input_strict : $question['strict'], + 'ANSWERS' => $answers, + )); + } + else + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($list_url)); + } + } + else + { + $template->assign_vars(array( + 'QUESTION_TEXT' => $input_question, + 'LANG_ISO' => $input_lang, + 'STRICT' => $input_strict, + 'ANSWERS' => $input_answers, + )); + } + + if ($submit && check_form_key($form_key)) + { + $data = $this->acp_get_question_input(); + + if (!$this->validate_input($data)) + { + $template->assign_vars(array( + 'S_ERROR' => true, + )); + } + else + { + if ($question_id) + { + $this->acp_update_question($data, $question_id); + } + else + { + $this->acp_add_question($data); + } + + add_log('admin', 'LOG_CONFIG_VISUAL'); + trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($list_url)); + } + } + else if ($submit) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($list_url), E_USER_WARNING); + } + } + } + + /** + * This handles the list overview + */ + function acp_question_list(&$module) + { + global $db, $template; + + $sql = 'SELECT * + FROM ' . $this->table_captcha_questions; + $result = $db->sql_query($sql); + + $template->assign_vars(array( + 'S_LIST' => true, + )); + + while ($row = $db->sql_fetchrow($result)) + { + $url = $module->u_action . "&question_id={$row['question_id']}&configure=1&select_captcha=" . $this->get_service_name() . '&'; + + $template->assign_block_vars('questions', array( + 'QUESTION_TEXT' => $row['question_text'], + 'QUESTION_ID' => $row['question_id'], + 'QUESTION_LANG' => $row['lang_iso'], + 'U_DELETE' => "{$url}action=delete", + 'U_EDIT' => "{$url}action=edit", + )); + } + $db->sql_freeresult($result); + } + + /** + * Grab a question and bring it into a format the editor understands + */ + function acp_get_question_data($question_id) + { + global $db; + + if ($question_id) + { + $sql = 'SELECT * + FROM ' . $this->table_captcha_questions . ' + WHERE question_id = ' . $question_id; + $result = $db->sql_query($sql); + $question = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$question) + { + return false; + } + + $question['answers'] = array(); + + $sql = 'SELECT * + FROM ' . $this->table_captcha_answers . ' + WHERE question_id = ' . $question_id; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $question['answers'][] = $row['answer_text']; + } + $db->sql_freeresult($result); + + return $question; + } + } + + /** + * Grab a question from input and bring it into a format the editor understands + */ + function acp_get_question_input() + { + $answers = utf8_normalize_nfc(request_var('answers', '', true)); + $question = array( + 'question_text' => request_var('question_text', '', true), + 'strict' => request_var('strict', false), + 'lang_iso' => request_var('lang_iso', ''), + 'answers' => (strlen($answers)) ? explode("\n", $answers) : '', + ); + + return $question; + } + + /** + * Update a question. + * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data + */ + function acp_update_question($data, $question_id) + { + global $db, $cache; + + // easier to delete all answers than to figure out which to update + $sql = 'DELETE FROM ' . $this->table_captcha_answers . " WHERE question_id = $question_id"; + $db->sql_query($sql); + + $langs = $this->get_languages(); + $question_ary = $data; + $question_ary['lang_id'] = $langs[$question_ary['lang_iso']]['id']; + unset($question_ary['answers']); + + $sql = 'UPDATE ' . $this->table_captcha_questions . ' + SET ' . $db->sql_build_array('UPDATE', $question_ary) . " + WHERE question_id = $question_id"; + $db->sql_query($sql); + + $this->acp_insert_answers($data, $question_id); + + $cache->destroy('sql', $this->table_captcha_questions); + } + + /** + * Insert a question. + * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data + */ + function acp_add_question($data) + { + global $db, $cache; + + $langs = $this->get_languages(); + $question_ary = $data; + + $question_ary['lang_id'] = $langs[$data['lang_iso']]['id']; + unset($question_ary['answers']); + + $sql = 'INSERT INTO ' . $this->table_captcha_questions . ' ' . $db->sql_build_array('INSERT', $question_ary); + $db->sql_query($sql); + + $question_id = $db->sql_nextid(); + + $this->acp_insert_answers($data, $question_id); + + $cache->destroy('sql', $this->table_captcha_questions); + } + + /** + * Insert the answers. + * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data + */ + function acp_insert_answers($data, $question_id) + { + global $db, $cache; + + foreach ($data['answers'] as $answer) + { + $answer_ary = array( + 'question_id' => $question_id, + 'answer_text' => $answer, + ); + + $sql = 'INSERT INTO ' . $this->table_captcha_answers . ' ' . $db->sql_build_array('INSERT', $answer_ary); + $db->sql_query($sql); + } + + $cache->destroy('sql', $this->table_captcha_answers); + } + + /** + * Delete a question. + */ + function acp_delete_question($question_id) + { + global $db, $cache; + + $tables = array($this->table_captcha_questions, $this->table_captcha_answers); + + foreach ($tables as $table) + { + $sql = "DELETE FROM $table + WHERE question_id = $question_id"; + $db->sql_query($sql); + } + + $cache->destroy('sql', $tables); + } + + /** + * Check if the entered data can be inserted/used + * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data + */ + function validate_input($question_data) + { + $langs = $this->get_languages(); + + if (!isset($question_data['lang_iso']) || + !isset($question_data['question_text']) || + !isset($question_data['strict']) || + !isset($question_data['answers'])) + { + return false; + } + + if (!isset($langs[$question_data['lang_iso']]) || + !strlen($question_data['question_text']) || + !sizeof($question_data['answers']) || + !is_array($question_data['answers'])) + { + return false; + } + + return true; + } + + /** + * List the installed language packs + */ + function get_languages() + { + global $db; + + $sql = 'SELECT * + FROM ' . LANG_TABLE; + $result = $db->sql_query($sql); + + $langs = array(); + while ($row = $db->sql_fetchrow($result)) + { + $langs[$row['lang_iso']] = array( + 'name' => $row['lang_local_name'], + 'id' => (int) $row['lang_id'], + ); + } + $db->sql_freeresult($result); + + return $langs; + } + + + + /** + * See if there is a question other than the one we have + */ + function acp_is_last($question_id) + { + global $config, $db; + + if ($question_id) + { + $sql = 'SELECT question_id + FROM ' . $this->table_captcha_questions . " + WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "' + AND question_id <> " . (int) $question_id; + $result = $db->sql_query_limit($sql, 1); + $question = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$question) + { + return true; + } + return false; + } + } +} diff --git a/sources/phpBB/phpbb/captcha/plugins/recaptcha.php b/sources/phpBB/phpbb/captcha/plugins/recaptcha.php new file mode 100644 index 0000000..584f3af --- /dev/null +++ b/sources/phpBB/phpbb/captcha/plugins/recaptcha.php @@ -0,0 +1,332 @@ + +* @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\captcha\plugins; + +class recaptcha extends captcha_abstract +{ + var $recaptcha_server = 'http://www.google.com/recaptcha/api'; + var $recaptcha_server_secure = 'https://www.google.com/recaptcha/api'; // class constants :( + + // We are opening a socket to port 80 of this host and send + // the POST request asking for verification to the path specified here. + var $recaptcha_verify_server = 'www.google.com'; + var $recaptcha_verify_path = '/recaptcha/api/verify'; + + var $challenge; + var $response; + + /** + * Constructor + */ + public function __construct() + { + global $request; + $this->recaptcha_server = $request->is_secure() ? $this->recaptcha_server_secure : $this->recaptcha_server; + } + + function init($type) + { + global $config, $db, $user; + + $user->add_lang('captcha_recaptcha'); + parent::init($type); + $this->challenge = request_var('recaptcha_challenge_field', ''); + $this->response = request_var('recaptcha_response_field', ''); + } + + public function is_available() + { + global $config, $user; + $user->add_lang('captcha_recaptcha'); + return (isset($config['recaptcha_pubkey']) && !empty($config['recaptcha_pubkey'])); + } + + /** + * API function + */ + function has_config() + { + return true; + } + + static public function get_name() + { + return 'CAPTCHA_RECAPTCHA'; + } + + /** + * This function is implemented because required by the upper class, but is never used for reCaptcha. + */ + function get_generator_class() + { + throw new \Exception('No generator class given.'); + } + + function acp_page($id, &$module) + { + global $config, $db, $template, $user; + + $captcha_vars = array( + 'recaptcha_pubkey' => 'RECAPTCHA_PUBKEY', + 'recaptcha_privkey' => 'RECAPTCHA_PRIVKEY', + ); + + $module->tpl_name = 'captcha_recaptcha_acp'; + $module->page_title = 'ACP_VC_SETTINGS'; + $form_key = 'acp_captcha'; + add_form_key($form_key); + + $submit = request_var('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, ''); + if ($value) + { + set_config($captcha_var, $value); + } + } + + add_log('admin', 'LOG_CONFIG_VISUAL'); + trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action)); + } + else if ($submit) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($module->u_action)); + } + else + { + foreach ($captcha_vars as $captcha_var => $template_var) + { + $var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, '') : ((isset($config[$captcha_var])) ? $config[$captcha_var] : ''); + $template->assign_var($template_var, $var); + } + + $template->assign_vars(array( + 'CAPTCHA_PREVIEW' => $this->get_demo_template($id), + 'CAPTCHA_NAME' => $this->get_service_name(), + 'U_ACTION' => $module->u_action, + )); + + } + } + + // not needed + function execute_demo() + { + } + + // not needed + function execute() + { + } + + function get_template() + { + global $config, $user, $template, $phpbb_root_path, $phpEx; + + if ($this->is_solved()) + { + return false; + } + else + { + $contact_link = phpbb_get_board_contact_link($config, $phpbb_root_path, $phpEx); + $explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '', ''); + + $template->assign_vars(array( + 'RECAPTCHA_SERVER' => $this->recaptcha_server, + 'RECAPTCHA_PUBKEY' => isset($config['recaptcha_pubkey']) ? $config['recaptcha_pubkey'] : '', + 'RECAPTCHA_ERRORGET' => '', + 'S_RECAPTCHA_AVAILABLE' => self::is_available(), + 'S_CONFIRM_CODE' => true, + 'S_TYPE' => $this->type, + 'L_CONFIRM_EXPLAIN' => $explain, + )); + + return 'captcha_recaptcha.html'; + } + } + + function get_demo_template($id) + { + return $this->get_template(); + } + + function get_hidden_fields() + { + $hidden_fields = array(); + + // this is required for posting.php - otherwise we would forget about the captcha being already solved + if ($this->solved) + { + $hidden_fields['confirm_code'] = $this->code; + } + $hidden_fields['confirm_id'] = $this->confirm_id; + return $hidden_fields; + } + + function uninstall() + { + $this->garbage_collect(0); + } + + function install() + { + return; + } + + function validate() + { + if (!parent::validate()) + { + return false; + } + else + { + return $this->recaptcha_check_answer(); + } + } + +// Code from here on is based on recaptchalib.php +/* + * This is a PHP library that handles calling reCAPTCHA. + * - Documentation and latest version + * http://recaptcha.net/plugins/php/ + * - Get a reCAPTCHA API Key + * http://recaptcha.net/api/getkey + * - Discussion group + * http://groups.google.com/group/recaptcha + * + * Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net + * AUTHORS: + * Mike Crawford + * Ben Maurer + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + /** + * Submits an HTTP POST to a reCAPTCHA server + * @param string $host + * @param string $path + * @param array $data + * @param int port + * @return array response + */ + function _recaptcha_http_post($host, $path, $data, $port = 80) + { + $req = $this->_recaptcha_qsencode ($data); + + $http_request = "POST $path HTTP/1.0\r\n"; + $http_request .= "Host: $host\r\n"; + $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n"; + $http_request .= "Content-Length: " . strlen($req) . "\r\n"; + $http_request .= "User-Agent: reCAPTCHA/PHP/phpBB\r\n"; + $http_request .= "\r\n"; + $http_request .= $req; + + $response = ''; + if (false == ($fs = @fsockopen($host, $port, $errno, $errstr, 10))) + { + trigger_error('RECAPTCHA_SOCKET_ERROR', E_USER_ERROR); + } + + fwrite($fs, $http_request); + + while (!feof($fs)) + { + // One TCP-IP packet + $response .= fgets($fs, 1160); + } + fclose($fs); + $response = explode("\r\n\r\n", $response, 2); + + return $response; + } + + /** + * Calls an HTTP POST function to verify if the user's guess was correct + * @param array $extra_params an array of extra variables to post to the server + * @return ReCaptchaResponse + */ + function recaptcha_check_answer($extra_params = array()) + { + global $config, $user; + + //discard spam submissions + if ($this->challenge == null || strlen($this->challenge) == 0 || $this->response == null || strlen($this->response) == 0) + { + return $user->lang['RECAPTCHA_INCORRECT']; + } + + $response = $this->_recaptcha_http_post($this->recaptcha_verify_server, $this->recaptcha_verify_path, + array( + 'privatekey' => $config['recaptcha_privkey'], + 'remoteip' => $user->ip, + 'challenge' => $this->challenge, + 'response' => $this->response + ) + $extra_params + ); + + $answers = explode("\n", $response[1]); + + if (trim($answers[0]) === 'true') + { + $this->solved = true; + return false; + } + else + { + return $user->lang['RECAPTCHA_INCORRECT']; + } + } + + /** + * Encodes the given data into a query string format + * @param $data - array of string elements to be encoded + * @return string - encoded request + */ + function _recaptcha_qsencode($data) + { + $req = ''; + foreach ($data as $key => $value) + { + $req .= $key . '=' . urlencode(stripslashes($value)) . '&'; + } + + // Cut the last '&' + $req = substr($req, 0, strlen($req) - 1); + return $req; + } +} diff --git a/sources/phpBB/phpbb/class_loader.php b/sources/phpBB/phpbb/class_loader.php new file mode 100644 index 0000000..cfdcc2a --- /dev/null +++ b/sources/phpBB/phpbb/class_loader.php @@ -0,0 +1,164 @@ + +* @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; + +/** +* The class loader resolves class names to file system paths and loads them if +* necessary. +* +* Classes have to be of the form phpbb_(dir_)*(classpart_)*, so directory names +* must never contain underscores. Example: phpbb_dir_subdir_class_name is a +* valid class name, while phpbb_dir_sub_dir_class_name is not. +* +* If every part of the class name is a directory, the last directory name is +* also used as the filename, e.g. phpbb_dir would resolve to dir/dir.php. +*/ +class class_loader +{ + private $namespace; + private $path; + private $php_ext; + private $cache; + + /** + * A map of looked up class names to paths relative to $this->path. + * This map is stored in cache and looked up if the cache is available. + * + * @var array + */ + private $cached_paths = array(); + + /** + * Creates a new \phpbb\class_loader, which loads files with the given + * file extension from the given path. + * + * @param string $namespace Required namespace for files to be loaded + * @param string $path Directory to load files from + * @param string $php_ext The file extension for PHP files + * @param \phpbb\cache\driver\driver_interface $cache An implementation of the phpBB cache interface. + */ + public function __construct($namespace, $path, $php_ext = 'php', \phpbb\cache\driver\driver_interface $cache = null) + { + if ($namespace[0] !== '\\') + { + $namespace = '\\' . $namespace; + } + + $this->namespace = $namespace; + $this->path = $path; + $this->php_ext = $php_ext; + + $this->set_cache($cache); + } + + /** + * Provide the class loader with a cache to store paths. If set to null, the + * the class loader will resolve paths by checking for the existance of every + * directory in the class name every time. + * + * @param \phpbb\cache\driver\driver_interface $cache An implementation of the phpBB cache interface. + */ + public function set_cache(\phpbb\cache\driver\driver_interface $cache = null) + { + if ($cache) + { + $this->cached_paths = $cache->get('class_loader_' . str_replace('\\', '__', $this->namespace)); + + if ($this->cached_paths === false) + { + $this->cached_paths = array(); + } + } + + $this->cache = $cache; + } + + /** + * Registers the class loader as an autoloader using SPL. + */ + public function register() + { + spl_autoload_register(array($this, 'load_class')); + } + + /** + * Removes the class loader from the SPL autoloader stack. + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'load_class')); + } + + /** + * Resolves a phpBB class name to a relative path which can be included. + * + * @param string $class The class name to resolve, must be in the + * namespace the loader was constructed with. + * Has to begin with \ + * @return string|bool A relative path to the file containing the + * class or false if looking it up failed. + */ + public function resolve_path($class) + { + if (isset($this->cached_paths[$class])) + { + return $this->path . $this->cached_paths[$class] . '.' . $this->php_ext; + } + + if (!preg_match('/^' . preg_quote($this->namespace, '/') . '[a-zA-Z0-9_\\\\]+$/', $class)) + { + return false; + } + + $relative_path = str_replace('\\', '/', substr($class, strlen($this->namespace))); + + if (!file_exists($this->path . $relative_path . '.' . $this->php_ext)) + { + return false; + } + + if ($this->cache) + { + $this->cached_paths[$class] = $relative_path; + $this->cache->put('class_loader_' . str_replace('\\', '__', $this->namespace), $this->cached_paths); + } + + return $this->path . $relative_path . '.' . $this->php_ext; + } + + /** + * Resolves a class name to a path and then includes it. + * + * @param string $class The class name which is being loaded. + */ + public function load_class($class) + { + // In general $class is not supposed to contain a leading backslash, + // but sometimes it does. See tickets PHP-50731 and HHVM-1840. + if ($class[0] !== '\\') + { + $class = '\\' . $class; + } + + if (substr($class, 0, strlen($this->namespace)) === $this->namespace) + { + $path = $this->resolve_path($class); + + if ($path) + { + require $path; + } + } + } +} diff --git a/sources/phpBB/phpbb/composer.json b/sources/phpBB/phpbb/composer.json new file mode 100644 index 0000000..513d7e4 --- /dev/null +++ b/sources/phpBB/phpbb/composer.json @@ -0,0 +1,27 @@ +{ + "name": "phpbb/phpbb-core", + "description": "Collection of core phpBB libraries", + "type": "library", + "keywords": ["phpbb", "forum"], + "homepage": "https://www.phpbb.com", + "license": "GPL-2.0", + "authors": [ + { + "name": "phpBB Limited", + "email": "operations@phpbb.com", + "homepage": "https://www.phpbb.com/go/authors" + } + ], + "support": { + "issues": "https://tracker.phpbb.com", + "forum": "https://www.phpbb.com/community/", + "wiki": "https://wiki.phpbb.com", + "irc": "irc://irc.freenode.org/phpbb" + }, + "autoload": { + "classmap": [""] + }, + "require": { + "php": ">=5.3.3" + } +} diff --git a/sources/phpBB/phpbb/config/config.php b/sources/phpBB/phpbb/config/config.php new file mode 100644 index 0000000..aaad333 --- /dev/null +++ b/sources/phpBB/phpbb/config/config.php @@ -0,0 +1,167 @@ + +* @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\config; + +/** +* Configuration container class +*/ +class config implements \ArrayAccess, \IteratorAggregate, \Countable +{ + /** + * The configuration data + * @var array(string => string) + */ + protected $config; + + /** + * Creates a configuration container with a default set of values + * + * @param array(string => string) $config The configuration data. + */ + public function __construct(array $config) + { + $this->config = $config; + } + + /** + * Retrieves an ArrayIterator over the configuration values. + * + * @return \ArrayIterator An iterator over all config data + */ + public function getIterator() + { + return new \ArrayIterator($this->config); + } + + /** + * Checks if the specified config value exists. + * + * @param string $key The configuration option's name. + * @return bool Whether the configuration option exists. + */ + public function offsetExists($key) + { + return isset($this->config[$key]); + } + + /** + * Retrieves a configuration value. + * + * @param string $key The configuration option's name. + * @return string The configuration value + */ + public function offsetGet($key) + { + return (isset($this->config[$key])) ? $this->config[$key] : ''; + } + + /** + * Temporarily overwrites the value of a configuration variable. + * + * The configuration change will not persist. It will be lost + * after the request. + * + * @param string $key The configuration option's name. + * @param string $value The temporary value. + */ + public function offsetSet($key, $value) + { + $this->config[$key] = $value; + } + + /** + * Called when deleting a configuration value directly, triggers an error. + * + * @param string $key The configuration option's name. + */ + public function offsetUnset($key) + { + trigger_error('Config values have to be deleted explicitly with the \phpbb\config\config::delete($key) method.', E_USER_ERROR); + } + + /** + * Retrieves the number of configuration options currently set. + * + * @return int Number of config options + */ + public function count() + { + return count($this->config); + } + + /** + * Removes a configuration option + * + * @param String $key The configuration option's name + * @param bool $use_cache Whether this variable should be cached or if it + * changes too frequently to be efficiently cached + * @return null + */ + public function delete($key, $use_cache = true) + { + unset($this->config[$key]); + } + + /** + * Sets a configuration option's value + * + * @param string $key The configuration option's name + * @param string $value New configuration value + * @param bool $use_cache Whether this variable should be cached or if it + * changes too frequently to be efficiently cached. + */ + public function set($key, $value, $use_cache = true) + { + $this->config[$key] = $value; + } + + /** + * Sets a configuration option's value only if the old_value matches the + * current configuration value or the configuration value does not exist yet. + * + * @param string $key The configuration option's name + * @param string $old_value Current configuration value + * @param string $new_value New configuration value + * @param bool $use_cache Whether this variable should be cached or if it + * changes too frequently to be efficiently cached. + * @return bool True if the value was changed, false otherwise. + */ + public function set_atomic($key, $old_value, $new_value, $use_cache = true) + { + if (!isset($this->config[$key]) || $this->config[$key] == $old_value) + { + $this->config[$key] = $new_value; + return true; + } + return false; + } + + /** + * Increments an integer configuration value. + * + * @param string $key The configuration option's name + * @param int $increment Amount to increment by + * @param bool $use_cache Whether this variable should be cached or if it + * changes too frequently to be efficiently cached. + */ + function increment($key, $increment, $use_cache = true) + { + if (!isset($this->config[$key])) + { + $this->config[$key] = 0; + } + + $this->config[$key] += $increment; + } +} diff --git a/sources/phpBB/phpbb/config/db.php b/sources/phpBB/phpbb/config/db.php new file mode 100644 index 0000000..26489bd --- /dev/null +++ b/sources/phpBB/phpbb/config/db.php @@ -0,0 +1,204 @@ + +* @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\config; + +/** +* Configuration container class +*/ +class db extends \phpbb\config\config +{ + /** + * Cache instance + * @var \phpbb\cache\driver\driver_interface + */ + protected $cache; + + /** + * Database connection + * @var \phpbb\db\driver\driver_interface + */ + protected $db; + + /** + * Name of the database table used for configuration. + * @var string + */ + protected $table; + + /** + * Creates a configuration container with a default set of values + * + * @param \phpbb\db\driver\driver_interface $db Database connection + * @param \phpbb\cache\driver\driver_interface $cache Cache instance + * @param string $table Configuration table name + */ + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, $table) + { + $this->db = $db; + $this->cache = $cache; + $this->table = $table; + + if (($config = $cache->get('config')) !== false) + { + $sql = 'SELECT config_name, config_value + FROM ' . $this->table . ' + WHERE is_dynamic = 1'; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $config[$row['config_name']] = $row['config_value']; + } + $this->db->sql_freeresult($result); + } + else + { + $config = $cached_config = array(); + + $sql = 'SELECT config_name, config_value, is_dynamic + FROM ' . $this->table; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + if (!$row['is_dynamic']) + { + $cached_config[$row['config_name']] = $row['config_value']; + } + + $config[$row['config_name']] = $row['config_value']; + } + $this->db->sql_freeresult($result); + + $cache->put('config', $cached_config); + } + + parent::__construct($config); + } + + /** + * Removes a configuration option + * + * @param String $key The configuration option's name + * @param bool $use_cache Whether this variable should be cached or if it + * changes too frequently to be efficiently cached + * @return null + */ + public function delete($key, $use_cache = true) + { + $sql = 'DELETE FROM ' . $this->table . " + WHERE config_name = '" . $this->db->sql_escape($key) . "'"; + $this->db->sql_query($sql); + + unset($this->config[$key]); + + if ($use_cache) + { + $this->cache->destroy('config'); + } + } + + /** + * Sets a configuration option's value + * + * @param string $key The configuration option's name + * @param string $value New configuration value + * @param bool $use_cache Whether this variable should be cached or if it + * changes too frequently to be efficiently cached. + */ + public function set($key, $value, $use_cache = true) + { + $this->set_atomic($key, false, $value, $use_cache); + } + + /** + * Sets a configuration option's value only if the old_value matches the + * current configuration value or the configuration value does not exist yet. + * + * @param string $key The configuration option's name + * @param mixed $old_value Current configuration value or false to ignore + * the old value + * @param string $new_value New configuration value + * @param bool $use_cache Whether this variable should be cached or if it + * changes too frequently to be efficiently cached + * @return bool True if the value was changed, false otherwise + */ + public function set_atomic($key, $old_value, $new_value, $use_cache = true) + { + $sql = 'UPDATE ' . $this->table . " + SET config_value = '" . $this->db->sql_escape($new_value) . "' + WHERE config_name = '" . $this->db->sql_escape($key) . "'"; + + if ($old_value !== false) + { + $sql .= " AND config_value = '" . $this->db->sql_escape($old_value) . "'"; + } + + $this->db->sql_query($sql); + + if (!$this->db->sql_affectedrows() && isset($this->config[$key])) + { + return false; + } + + if (!isset($this->config[$key])) + { + $sql = 'INSERT INTO ' . $this->table . ' ' . $this->db->sql_build_array('INSERT', array( + 'config_name' => $key, + 'config_value' => $new_value, + 'is_dynamic' => ($use_cache) ? 0 : 1)); + $this->db->sql_query($sql); + } + + if ($use_cache) + { + $this->cache->destroy('config'); + } + + $this->config[$key] = $new_value; + return true; + } + + /** + * Increments an integer config value directly in the database. + * + * Using this method instead of setting the new value directly avoids race + * conditions and unlike set_atomic it cannot fail. + * + * @param string $key The configuration option's name + * @param int $increment Amount to increment by + * @param bool $use_cache Whether this variable should be cached or if it + * changes too frequently to be efficiently cached. + */ + function increment($key, $increment, $use_cache = true) + { + if (!isset($this->config[$key])) + { + $this->set($key, '0', $use_cache); + } + + $sql_update = $this->db->cast_expr_to_string($this->db->cast_expr_to_bigint('config_value') . ' + ' . (int) $increment); + + $this->db->sql_query('UPDATE ' . $this->table . ' + SET config_value = ' . $sql_update . " + WHERE config_name = '" . $this->db->sql_escape($key) . "'"); + + if ($use_cache) + { + $this->cache->destroy('config'); + } + + $this->config[$key] += $increment; + } +} diff --git a/sources/phpBB/phpbb/config/db_text.php b/sources/phpBB/phpbb/config/db_text.php new file mode 100644 index 0000000..b1e3ef5 --- /dev/null +++ b/sources/phpBB/phpbb/config/db_text.php @@ -0,0 +1,159 @@ + +* @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\config; + +/** +* Manages configuration options with an arbitrary length value stored in a TEXT +* column. In constrast to class \phpbb\config\db, values are never cached and +* prefetched, but every get operation sends a query to the database. +*/ +class db_text +{ + /** + * Database connection + * @var \phpbb\db\driver\driver_interface + */ + protected $db; + + /** + * Name of the database table used. + * @var string + */ + protected $table; + + /** + * @param \phpbb\db\driver\driver_interface $db Database connection + * @param string $table Table name + */ + public function __construct(\phpbb\db\driver\driver_interface $db, $table) + { + $this->db = $db; + $this->table = $this->db->sql_escape($table); + } + + /** + * Sets the configuration option with the name $key to $value. + * + * @param string $key The configuration option's name + * @param string $value New configuration value + * + * @return null + */ + public function set($key, $value) + { + $this->set_array(array($key => $value)); + } + + /** + * Gets the configuration value for the name $key. + * + * @param string $key The configuration option's name + * + * @return string|null String result on success + * null if there is no such option + */ + public function get($key) + { + $map = $this->get_array(array($key)); + + return isset($map[$key]) ? $map[$key] : null; + } + + /** + * Removes the configuration option with the name $key. + * + * @param string $key The configuration option's name + * + * @return null + */ + public function delete($key) + { + $this->delete_array(array($key)); + } + + /** + * Mass set configuration options: Receives an associative array, + * treats array keys as configuration option names and associated + * array values as their configuration option values. + * + * @param array $map Map from configuration names to values + * + * @return null + */ + public function set_array(array $map) + { + $this->db->sql_transaction('begin'); + + foreach ($map as $key => $value) + { + $sql = 'UPDATE ' . $this->table . " + SET config_value = '" . $this->db->sql_escape($value) . "' + WHERE config_name = '" . $this->db->sql_escape($key) . "'"; + $result = $this->db->sql_query($sql); + + if (!$this->db->sql_affectedrows($result)) + { + $sql = 'INSERT INTO ' . $this->table . ' ' . $this->db->sql_build_array('INSERT', array( + 'config_name' => (string) $key, + 'config_value' => (string) $value, + )); + $this->db->sql_query($sql); + } + } + + $this->db->sql_transaction('commit'); + } + + /** + * Mass get configuration options: Receives a set of configuration + * option names and returns the result as a key => value map where + * array keys are configuration option names and array values are + * associated config option values. + * + * @param array $keys Set of configuration option names + * + * @return array Map from configuration names to values + */ + public function get_array(array $keys) + { + $sql = 'SELECT * + FROM ' . $this->table . ' + WHERE ' . $this->db->sql_in_set('config_name', $keys, false, true); + $result = $this->db->sql_query($sql); + + $map = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $map[$row['config_name']] = $row['config_value']; + } + $this->db->sql_freeresult($result); + + return $map; + } + + /** + * Mass delete configuration options. + * + * @param array $keys Set of configuration option names + * + * @return null + */ + public function delete_array(array $keys) + { + $sql = 'DELETE + FROM ' . $this->table . ' + WHERE ' . $this->db->sql_in_set('config_name', $keys, false, true); + $result = $this->db->sql_query($sql); + } +} diff --git a/sources/phpBB/phpbb/config_php_file.php b/sources/phpBB/phpbb/config_php_file.php new file mode 100644 index 0000000..7445e7d --- /dev/null +++ b/sources/phpBB/phpbb/config_php_file.php @@ -0,0 +1,160 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb; + +class config_php_file +{ + /** @var string phpBB Root Path */ + protected $phpbb_root_path; + + /** @var string php file extension */ + protected $php_ext; + + /** + * Indicates whether the php config file has been loaded. + * + * @var bool + */ + protected $config_loaded = false; + + /** + * The content of the php config file + * + * @var array + */ + protected $config_data = array(); + + /** + * The path to the config file. (Default: $phpbb_root_path . 'config.' . $php_ext) + * + * @var string + */ + protected $config_file; + + private $defined_vars; + + /** + * Constructor + * + * @param string $phpbb_root_path phpBB Root Path + * @param string $php_ext php file extension + */ + function __construct($phpbb_root_path, $php_ext) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->config_file = $this->phpbb_root_path . 'config.' . $this->php_ext; + } + + /** + * Set the path to the config file. + * + * @param string $config_file + */ + public function set_config_file($config_file) + { + $this->config_file = $config_file; + $this->config_loaded = false; + } + + /** + * Returns an associative array containing the variables defined by the config file. + * + * @return array Return the content of the config file or an empty array if the file does not exists. + */ + public function get_all() + { + $this->load_config_file(); + + return $this->config_data; + } + + /** + * Return the value of a variable defined into the config.php file or null if the variable does not exist. + * + * @param string $variable The name of the variable + * @return mixed Value of the variable or null if the variable is not defined. + */ + public function get($variable) + { + $this->load_config_file(); + + return isset($this->config_data[$variable]) ? $this->config_data[$variable] : null; + } + + /** + * Load the config file and store the information. + * + * @return null + */ + protected function load_config_file() + { + if (!$this->config_loaded && file_exists($this->config_file)) + { + $this->defined_vars = get_defined_vars(); + + require($this->config_file); + $this->config_data = array_diff_key(get_defined_vars(), $this->defined_vars); + + $this->config_loaded = true; + } + } + + /** + * Convert either 3.0 dbms or 3.1 db driver class name to 3.1 db driver class name. + * + * If $dbms is a valid 3.1 db driver class name, returns it unchanged. + * Otherwise prepends phpbb\db\driver\ to the dbms to convert a 3.0 dbms + * to 3.1 db driver class name. + * + * @param string $dbms dbms parameter + * @return string driver class + * @throws \RuntimeException + */ + public function convert_30_dbms_to_31($dbms) + { + // Note: this check is done first because mysqli extension + // supplies a mysqli class, and class_exists($dbms) would return + // true for mysqli class. + // However, per the docblock any valid 3.1 driver name should be + // recognized by this function, and have priority over 3.0 dbms. + if (strpos($dbms, 'phpbb\db\driver') === false && class_exists('phpbb\db\driver\\' . $dbms)) + { + return 'phpbb\db\driver\\' . $dbms; + } + + if (class_exists($dbms)) + { + // Additionally we could check that $dbms extends phpbb\db\driver\driver. + // http://php.net/manual/en/class.reflectionclass.php + // Beware of possible performance issues: + // http://stackoverflow.com/questions/294582/php-5-reflection-api-performance + // We could check for interface implementation in all paths or + // only when we do not prepend phpbb\db\driver\. + + /* + $reflection = new \ReflectionClass($dbms); + + if ($reflection->isSubclassOf('phpbb\db\driver\driver')) + { + return $dbms; + } + */ + + return $dbms; + } + + throw new \RuntimeException("You have specified an invalid dbms driver: $dbms"); + } +} diff --git a/sources/phpBB/phpbb/console/application.php b/sources/phpBB/phpbb/console/application.php new file mode 100644 index 0000000..bc4897a --- /dev/null +++ b/sources/phpBB/phpbb/console/application.php @@ -0,0 +1,120 @@ + +* @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; + +use Symfony\Component\Console\Shell; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class application extends \Symfony\Component\Console\Application +{ + /** + * @var bool Indicates whether or not we are in a shell + */ + protected $in_shell = false; + + /** + * @var \phpbb\user User object + */ + protected $user; + + /** + * @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) + */ + public function __construct($name, $version, \phpbb\user $user) + { + $this->user = $user; + + parent::__construct($name, $version); + } + + /** + * {@inheritdoc} + */ + protected function getDefaultInputDefinition() + { + $input_definition = parent::getDefaultInputDefinition(); + + $input_definition->addOption(new InputOption( + 'safe-mode', + null, + InputOption::VALUE_NONE, + $this->user->lang('CLI_DESCRIPTION_OPTION_SAFE_MODE') + )); + + return $input_definition; + } + + /** + * Gets the help message. + * + * It's a hack of the default help message to display the --shell + * option only for the application and not for all the commands. + * + * @return string A help message. + */ + public function getHelp() + { + // If we are already in a shell + // we do not want to have the --shell option available + if ($this->in_shell) + { + return parent::getHelp(); + } + + $this->getDefinition()->addOption(new InputOption( + '--shell', + '-s', + InputOption::VALUE_NONE, + $this->user->lang('CLI_DESCRIPTION_OPTION_SHELL') + )); + + return parent::getHelp(); + } + + /** + * Register a set of commands from the container + * + * @param \phpbb\di\service_collection $command_collection The console service collection + */ + public function register_container_commands(\phpbb\di\service_collection $command_collection) + { + foreach ($command_collection as $service_command) + { + $this->add($service_command); + } + } + + /** + * {@inheritdoc} + */ + public function doRun(InputInterface $input, OutputInterface $output) + { + // Run a shell if the --shell (or -s) option is set and if no command name is specified + // Also, we do not want to have the --shell option available if we are already in a shell + if (!$this->in_shell && $this->getCommandName($input) === null && $input->hasParameterOption(array('--shell', '-s'))) + { + $shell = new Shell($this); + $this->in_shell = true; + $shell->run(); + + return 0; + } + + return parent::doRun($input, $output); + } +} diff --git a/sources/phpBB/phpbb/console/command/cache/purge.php b/sources/phpBB/phpbb/console/command/cache/purge.php new file mode 100644 index 0000000..d0c2ef6 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/cache/purge.php @@ -0,0 +1,89 @@ + +* @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\cache; + +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class purge extends \phpbb\console\command\command +{ + /** @var \phpbb\cache\driver\driver_interface */ + protected $cache; + + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + /** @var \phpbb\auth\auth */ + protected $auth; + + /** @var \phpbb\log\log_interface */ + protected $log; + + /** @var \phpbb\config\config */ + protected $config; + + /** + * Constructor + * + * @param \phpbb\user $user User instance + * @param \phpbb\cache\driver\driver_interface $cache Cache instance + * @param \phpbb\db\driver\driver_interface $db Database connection + * @param \phpbb\auth\auth $auth Auth instance + * @param \phpbb\log\log $log Logger instance + * @param \phpbb\config\config $config Config instance + */ + public function __construct(\phpbb\user $user, \phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log_interface $log, \phpbb\config\config $config) + { + $this->cache = $cache; + $this->db = $db; + $this->auth = $auth; + $this->log = $log; + $this->config = $config; + parent::__construct($user); + } + + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('cache:purge') + ->setDescription($this->user->lang('PURGE_CACHE')) + ; + } + + /** + * Executes the command cache:purge. + * + * Purge the cache (including permissions) and increment the asset_version number + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->config->increment('assets_version', 1); + $this->cache->purge(); + + // Clear permissions + $this->auth->acl_clear_prefetch(); + phpbb_cache_moderators($this->db, $this->cache, $this->auth); + + $this->log->add('admin', ANONYMOUS, '', 'LOG_PURGE_CACHE', time(), array()); + + $output->writeln($this->user->lang('PURGE_CACHE_SUCCESS')); + } +} diff --git a/sources/phpBB/phpbb/console/command/command.php b/sources/phpBB/phpbb/console/command/command.php new file mode 100644 index 0000000..638c989 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/command.php @@ -0,0 +1,31 @@ + +* @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; + +abstract class command extends \Symfony\Component\Console\Command\Command +{ + /** @var \phpbb\user */ + protected $user; + + /** + * Constructor + * + * @param \phpbb\user $user User instance (mostly for translation) + */ + public function __construct(\phpbb\user $user) + { + $this->user = $user; + parent::__construct(); + } +} diff --git a/sources/phpBB/phpbb/console/command/config/command.php b/sources/phpBB/phpbb/console/command/config/command.php new file mode 100644 index 0000000..f0ad5d4 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/config/command.php @@ -0,0 +1,26 @@ + +* @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\config; + +abstract class command extends \phpbb\console\command\command +{ + /** @var \phpbb\config\config */ + protected $config; + + function __construct(\phpbb\user $user, \phpbb\config\config $config) + { + $this->config = $config; + + parent::__construct($user); + } +} diff --git a/sources/phpBB/phpbb/console/command/config/delete.php b/sources/phpBB/phpbb/console/command/config/delete.php new file mode 100644 index 0000000..efd276d --- /dev/null +++ b/sources/phpBB/phpbb/console/command/config/delete.php @@ -0,0 +1,63 @@ + +* @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\config; + +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class delete extends command +{ + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('config:delete') + ->setDescription($this->user->lang('CLI_DESCRIPTION_DELETE_CONFIG')) + ->addArgument( + 'key', + InputArgument::REQUIRED, + $this->user->lang('CLI_CONFIG_OPTION_NAME') + ) + ; + } + + /** + * Executes the command config:delete. + * + * Removes a configuration option + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + * @see \phpbb\config\config::delete() + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $key = $input->getArgument('key'); + + if (isset($this->config[$key])) + { + $this->config->delete($key); + + $output->writeln('' . $this->user->lang('CLI_CONFIG_DELETE_SUCCESS', $key) . ''); + } + else + { + $output->writeln('' . $this->user->lang('CLI_CONFIG_NOT_EXISTS', $key) . ''); + } + } +} diff --git a/sources/phpBB/phpbb/console/command/config/get.php b/sources/phpBB/phpbb/console/command/config/get.php new file mode 100644 index 0000000..9c03b49 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/config/get.php @@ -0,0 +1,72 @@ + +* @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\config; + +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class get extends command +{ + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('config:get') + ->setDescription($this->user->lang('CLI_DESCRIPTION_GET_CONFIG')) + ->addArgument( + 'key', + InputArgument::REQUIRED, + $this->user->lang('CLI_CONFIG_OPTION_NAME') + ) + ->addOption( + 'no-newline', + null, + InputOption::VALUE_NONE, + $this->user->lang('CLI_CONFIG_PRINT_WITHOUT_NEWLINE') + ) + ; + } + + /** + * Executes the command config:get. + * + * Retrieves a configuration value. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + * @see \phpbb\config\config::offsetGet() + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $key = $input->getArgument('key'); + + if (isset($this->config[$key]) && $input->getOption('no-newline')) + { + $output->write($this->config[$key]); + } + else if (isset($this->config[$key])) + { + $output->writeln($this->config[$key]); + } + else + { + $output->writeln('' . $this->user->lang('CLI_CONFIG_NOT_EXISTS', $key) . ''); + } + } +} diff --git a/sources/phpBB/phpbb/console/command/config/increment.php b/sources/phpBB/phpbb/console/command/config/increment.php new file mode 100644 index 0000000..b4d7438 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/config/increment.php @@ -0,0 +1,70 @@ + +* @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\config; + +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class increment extends command +{ + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('config:increment') + ->setDescription($this->user->lang('CLI_DESCRIPTION_INCREMENT_CONFIG')) + ->addArgument( + 'key', + InputArgument::REQUIRED, + $this->user->lang('CLI_CONFIG_OPTION_NAME') + ) + ->addArgument( + 'increment', + InputArgument::REQUIRED, + $this->user->lang('CLI_CONFIG_INCREMENT_BY') + ) + ->addOption( + 'dynamic', + 'd', + InputOption::VALUE_NONE, + $this->user->lang('CLI_CONFIG_CANNOT_CACHED') + ) + ; + } + + /** + * Executes the command config:increment. + * + * Increments an integer configuration value. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + * @see \phpbb\config\config::increment() + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $key = $input->getArgument('key'); + $increment = $input->getArgument('increment'); + $use_cache = !$input->getOption('dynamic'); + + $this->config->increment($key, $increment, $use_cache); + + $output->writeln('' . $this->user->lang('CLI_CONFIG_INCREMENT_SUCCESS', $key) . ''); + } +} diff --git a/sources/phpBB/phpbb/console/command/config/set.php b/sources/phpBB/phpbb/console/command/config/set.php new file mode 100644 index 0000000..695de31 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/config/set.php @@ -0,0 +1,70 @@ + +* @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\config; + +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class set extends command +{ + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('config:set') + ->setDescription($this->user->lang('CLI_DESCRIPTION_SET_CONFIG')) + ->addArgument( + 'key', + InputArgument::REQUIRED, + $this->user->lang('CLI_CONFIG_OPTION_NAME') + ) + ->addArgument( + 'value', + InputArgument::REQUIRED, + $this->user->lang('CLI_CONFIG_NEW') + ) + ->addOption( + 'dynamic', + 'd', + InputOption::VALUE_NONE, + $this->user->lang('CLI_CONFIG_CANNOT_CACHED') + ) + ; + } + + /** + * Executes the command config:set. + * + * Sets a configuration option's value. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + * @see \phpbb\config\config::set() + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $key = $input->getArgument('key'); + $value = $input->getArgument('value'); + $use_cache = !$input->getOption('dynamic'); + + $this->config->set($key, $value, $use_cache); + + $output->writeln('' . $this->user->lang('CLI_CONFIG_SET_SUCCESS', $key) . ''); + } +} diff --git a/sources/phpBB/phpbb/console/command/config/set_atomic.php b/sources/phpBB/phpbb/console/command/config/set_atomic.php new file mode 100644 index 0000000..e8c69a0 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/config/set_atomic.php @@ -0,0 +1,84 @@ + +* @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\config; + +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class set_atomic extends command +{ + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('config:set-atomic') + ->setDescription($this->user->lang('CLI_DESCRIPTION_SET_ATOMIC_CONFIG')) + ->addArgument( + 'key', + InputArgument::REQUIRED, + $this->user->lang('CLI_CONFIG_OPTION_NAME') + ) + ->addArgument( + 'old', + InputArgument::REQUIRED, + $this->user->lang('CLI_CONFIG_CURRENT') + ) + ->addArgument( + 'new', + InputArgument::REQUIRED, + $this->user->lang('CLI_CONFIG_NEW') + ) + ->addOption( + 'dynamic', + 'd', + InputOption::VALUE_NONE, + $this->user->lang('CLI_CONFIG_CANNOT_CACHED') + ) + ; + } + + /** + * Executes the command config:set-atomic. + * + * Sets a configuration option's value only if the old_value matches the + * current configuration value or the configuration value does not exist yet. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return bool True if the value was changed, false otherwise. + * @see \phpbb\config\config::set_atomic() + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $key = $input->getArgument('key'); + $old_value = $input->getArgument('old'); + $new_value = $input->getArgument('new'); + $use_cache = !$input->getOption('dynamic'); + + if ($this->config->set_atomic($key, $old_value, $new_value, $use_cache)) + { + $output->writeln('' . $this->user->lang('CLI_CONFIG_SET_SUCCESS', $key) . ''); + return 0; + } + else + { + $output->writeln('' . $this->user->lang('CLI_CONFIG_SET_FAILURE', $key) . ''); + return 1; + } + } +} diff --git a/sources/phpBB/phpbb/console/command/cron/cron_list.php b/sources/phpBB/phpbb/console/command/cron/cron_list.php new file mode 100644 index 0000000..c515fd9 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/cron/cron_list.php @@ -0,0 +1,111 @@ + +* @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\cron; + +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class cron_list extends \phpbb\console\command\command +{ + /** @var \phpbb\cron\manager */ + protected $cron_manager; + + /** + * Constructor + * + * @param \phpbb\user $user User instance + * @param \phpbb\cron\manager $cron_manager Cron manager + */ + public function __construct(\phpbb\user $user, \phpbb\cron\manager $cron_manager) + { + $this->cron_manager = $cron_manager; + parent::__construct($user); + } + + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('cron:list') + ->setDescription($this->user->lang('CLI_DESCRIPTION_CRON_LIST')) + ; + } + + /** + * Executes the command cron:list. + * + * Prints a list of ready and unready cron jobs. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $tasks = $this->cron_manager->get_tasks(); + + if (empty($tasks)) + { + $output->writeln($this->user->lang('CRON_NO_TASKS')); + return; + } + + $ready_tasks = array(); + $not_ready_tasks = array(); + foreach ($tasks as $task) + { + if ($task->is_ready()) + { + $ready_tasks[] = $task; + } + else + { + $not_ready_tasks[] = $task; + } + } + + if (!empty($ready_tasks)) + { + $output->writeln('' . $this->user->lang('TASKS_READY') . ''); + $this->print_tasks_names($ready_tasks, $output); + } + + if (!empty($ready_tasks) && !empty($not_ready_tasks)) + { + $output->writeln(''); + } + + if (!empty($not_ready_tasks)) + { + $output->writeln('' . $this->user->lang('TASKS_NOT_READY') . ''); + $this->print_tasks_names($not_ready_tasks, $output); + } + } + + /** + * Print a list of cron jobs + * + * @param array $tasks A list of task to display + * @param OutputInterface $output An OutputInterface instance + */ + protected function print_tasks_names(array $tasks, OutputInterface $output) + { + foreach ($tasks as $task) + { + $output->writeln($task->get_name()); + } + } +} diff --git a/sources/phpBB/phpbb/console/command/cron/run.php b/sources/phpBB/phpbb/console/command/cron/run.php new file mode 100644 index 0000000..72ad120 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/cron/run.php @@ -0,0 +1,171 @@ + +* @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\cron; + +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Output\OutputInterface; + +class run extends \phpbb\console\command\command +{ + /** @var \phpbb\cron\manager */ + protected $cron_manager; + + /** @var \phpbb\lock\db */ + protected $lock_db; + + /** + * Construct method + * + * @param \phpbb\user $user The user object (used to get language information) + * @param \phpbb\cron\manager $cron_manager The cron manager containing + * the cron tasks to be executed. + * @param \phpbb\lock\db $lock_db The lock for accessing database. + */ + public function __construct(\phpbb\user $user, \phpbb\cron\manager $cron_manager, \phpbb\lock\db $lock_db) + { + $this->cron_manager = $cron_manager; + $this->lock_db = $lock_db; + parent::__construct($user); + } + + /** + * Sets the command name and description + * + * @return null + */ + protected function configure() + { + $this + ->setName('cron:run') + ->setDescription($this->user->lang('CLI_DESCRIPTION_CRON_RUN')) + ->addArgument('name', InputArgument::OPTIONAL, $this->user->lang('CLI_DESCRIPTION_CRON_RUN_ARGUMENT_1')) + ; + } + + /** + * Executes the command cron:run. + * + * Tries to acquire the cron lock, then if no argument has been given runs all ready cron tasks. + * If the cron lock can not be obtained, an error message is printed + * and the exit status is set to 1. + * If the verbose option is specified, each start of a task is printed. + * Otherwise there is no output. + * If an argument is given to the command, only the task whose name matches the + * argument will be started. If verbose option is specified, + * an info message containing the name of the task is printed. + * If no task matches the argument given, an error message is printed + * and the exit status is set to 2. + * + * @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 lock error occured and 2 if no task matching the argument was found. + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + if ($this->lock_db->acquire()) + { + $task_name = $input->getArgument('name'); + if ($task_name) + { + $exit_status = $this->run_one($input, $output, $task_name); + } + else + { + $exit_status = $this->run_all($input, $output); + } + + $this->lock_db->release(); + return $exit_status; + } + else + { + $output->writeln('' . $this->user->lang('CRON_LOCK_ERROR') . ''); + return 1; + } + } + + /** + * Executes all ready cron tasks. + * + * If verbose mode is set, an info message will be printed if there is no task to + * be run, or else for each starting task. + * + * @see execute + * @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 + */ + protected function run_all(InputInterface $input, OutputInterface $output) + { + $run_tasks = $this->cron_manager->find_all_ready_tasks(); + + if ($run_tasks) + { + foreach ($run_tasks as $task) + { + if ($input->getOption('verbose')) + { + $output->writeln('' . $this->user->lang('RUNNING_TASK', $task->get_name()) . ''); + } + + $task->run(); + } + } + else + { + if ($input->getOption('verbose')) + { + $output->writeln('' . $this->user->lang('CRON_NO_TASK') . ''); + } + } + + return 0; + } + + /** + * Executes a given cron task, if it is ready. + * + * If there is a task whose name matches $task_name, it is run and 0 is returned. + * and if verbose mode is set, print an info message with the name of the task. + * If there is no task matching $task_name, the function prints an error message + * and returns with status 2. + * + * @see execute + * @param string $task_name The name of the task that should be run. + * @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 well, 2 if no task matches $task_name. + */ + protected function run_one(InputInterface $input, OutputInterface $output, $task_name) + { + $task = $this->cron_manager->find_task($task_name); + if ($task) + { + if ($input->getOption('verbose')) + { + $output->writeln('' . $this->user->lang('RUNNING_TASK', $task_name) . ''); + } + + $task->run(); + return 0; + } + else + { + $output->writeln('' . $this->user->lang('CRON_NO_SUCH_TASK', $task_name) . ''); + return 2; + } + } +} diff --git a/sources/phpBB/phpbb/console/command/db/console_migrator_output_handler.php b/sources/phpBB/phpbb/console/command/db/console_migrator_output_handler.php new file mode 100644 index 0000000..b9741a3 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/db/console_migrator_output_handler.php @@ -0,0 +1,69 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\console\command\db; + +use phpbb\user; +use phpbb\db\migrator_output_handler_interface; +use Symfony\Component\Console\Output\OutputInterface; + +class console_migrator_output_handler implements migrator_output_handler_interface +{ + /** + * User object. + * + * @var user + */ + private $user; + + /** + * Console output object. + * + * @var OutputInterface + */ + private $output; + + /** + * Constructor + * + * @param user $user User object + * @param OutputInterface $output Console output object + */ + public function __construct(user $user, OutputInterface $output) + { + $this->user = $user; + $this->output = $output; + } + + /** + * {@inheritdoc} + */ + public function write($message, $verbosity) + { + if ($verbosity <= $this->output->getVerbosity()) + { + $translated_message = call_user_func_array(array($this->user, 'lang'), $message); + + if ($verbosity === migrator_output_handler_interface::VERBOSITY_NORMAL) + { + $translated_message = '' . $translated_message . ''; + } + else if ($verbosity === migrator_output_handler_interface::VERBOSITY_VERBOSE) + { + $translated_message = '' . $translated_message . ''; + } + + $this->output->writeln($translated_message); + } + } +} diff --git a/sources/phpBB/phpbb/console/command/db/migrate.php b/sources/phpBB/phpbb/console/command/db/migrate.php new file mode 100644 index 0000000..87c2a05 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/db/migrate.php @@ -0,0 +1,107 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ +namespace phpbb\console\command\db; + +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class migrate extends \phpbb\console\command\command +{ + /** @var \phpbb\db\migrator */ + protected $migrator; + + /** @var \phpbb\extension\manager */ + protected $extension_manager; + + /** @var \phpbb\config\config */ + protected $config; + + /** @var \phpbb\cache\service */ + protected $cache; + + /** @var \phpbb\log\log */ + protected $log; + + /** @var string phpBB root path */ + protected $phpbb_root_path; + + function __construct(\phpbb\user $user, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache, \phpbb\log\log $log, $phpbb_root_path) + { + $this->migrator = $migrator; + $this->extension_manager = $extension_manager; + $this->config = $config; + $this->cache = $cache; + $this->log = $log; + $this->phpbb_root_path = $phpbb_root_path; + parent::__construct($user); + $this->user->add_lang(array('common', 'install', 'migrator')); + } + + protected function configure() + { + $this + ->setName('db:migrate') + ->setDescription($this->user->lang('CLI_DESCRIPTION_DB_MIGRATE')) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->migrator->set_output_handler(new \phpbb\db\log_wrapper_migrator_output_handler($this->user, new console_migrator_output_handler($this->user, $output), $this->phpbb_root_path . 'store/migrations_' . time() . '.log')); + + $this->migrator->create_migrations_table(); + + $this->cache->purge(); + + $this->load_migrations(); + $orig_version = $this->config['version']; + while (!$this->migrator->finished()) + { + try + { + $this->migrator->update(); + } + catch (\phpbb\db\migration\exception $e) + { + $output->writeln('' . $e->getLocalisedMessage($this->user) . ''); + $this->finalise_update(); + return 1; + } + } + + if ($orig_version != $this->config['version']) + { + $this->log->add('admin', ANONYMOUS, '', 'LOG_UPDATE_DATABASE', time(), array($orig_version, $this->config['version'])); + } + + $this->finalise_update(); + $output->writeln($this->user->lang['DATABASE_UPDATE_COMPLETE']); + } + + protected function load_migrations() + { + $migrations = $this->extension_manager + ->get_finder() + ->core_path('phpbb/db/migration/data/') + ->extension_directory('/migrations') + ->get_classes(); + + $this->migrator->set_migrations($migrations); + } + + protected function finalise_update() + { + $this->cache->purge(); + $this->config->increment('assets_version', 1); + } +} diff --git a/sources/phpBB/phpbb/console/command/dev/migration_tips.php b/sources/phpBB/phpbb/console/command/dev/migration_tips.php new file mode 100644 index 0000000..f9047bd --- /dev/null +++ b/sources/phpBB/phpbb/console/command/dev/migration_tips.php @@ -0,0 +1,64 @@ + +* @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\dev; + +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class migration_tips extends \phpbb\console\command\command +{ + /** @var \phpbb\extension\manager */ + protected $extension_manager; + + function __construct(\phpbb\user $user, \phpbb\extension\manager $extension_manager) + { + $this->extension_manager = $extension_manager; + parent::__construct($user); + } + + protected function configure() + { + $this + ->setName('dev:migration-tips') + ->setDescription($this->user->lang('CLI_DESCRIPTION_FIND_MIGRATIONS')) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $migrations = $this->extension_manager->get_finder() + ->set_extensions(array()) + ->core_path('phpbb/db/migration/data/') + ->get_classes(); + $tips = $migrations; + + foreach ($migrations as $migration_class) + { + foreach ($migration_class::depends_on() as $dependency) + { + $tips_key = array_search($dependency, $tips); + if ($tips_key !== false) + { + unset($tips[$tips_key]); + } + } + } + + $output->writeln("\t\tarray("); + foreach ($tips as $migration) + { + $output->writeln("\t\t\t'{$migration}',"); + } + $output->writeln("\t\t);"); + } +} diff --git a/sources/phpBB/phpbb/console/command/extension/command.php b/sources/phpBB/phpbb/console/command/extension/command.php new file mode 100644 index 0000000..364d954 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/extension/command.php @@ -0,0 +1,30 @@ + +* @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\extension; + +abstract class command extends \phpbb\console\command\command +{ + /** @var \phpbb\extension\manager */ + protected $manager; + + /** @var \phpbb\log\log */ + protected $log; + + public function __construct(\phpbb\user $user, \phpbb\extension\manager $manager, \phpbb\log\log $log) + { + $this->manager = $manager; + $this->log = $log; + + parent::__construct($user); + } +} diff --git a/sources/phpBB/phpbb/console/command/extension/disable.php b/sources/phpBB/phpbb/console/command/extension/disable.php new file mode 100644 index 0000000..1eee16c --- /dev/null +++ b/sources/phpBB/phpbb/console/command/extension/disable.php @@ -0,0 +1,52 @@ + +* @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\extension; + +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class disable extends command +{ + protected function configure() + { + $this + ->setName('extension:disable') + ->setDescription($this->user->lang('CLI_DESCRIPTION_DISABLE_EXTENSION')) + ->addArgument( + 'extension-name', + InputArgument::REQUIRED, + $this->user->lang('CLI_EXTENSION_NAME') + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $name = $input->getArgument('extension-name'); + $this->manager->disable($name); + $this->manager->load_extensions(); + + if ($this->manager->is_enabled($name)) + { + $output->writeln('' . $this->user->lang('CLI_EXTENSION_DISABLE_FAILURE', $name) . ''); + return 1; + } + else + { + $this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_DISABLE', time(), array($name)); + $output->writeln('' . $this->user->lang('CLI_EXTENSION_DISABLE_SUCCESS', $name) . ''); + return 0; + } + } +} diff --git a/sources/phpBB/phpbb/console/command/extension/enable.php b/sources/phpBB/phpbb/console/command/extension/enable.php new file mode 100644 index 0000000..59ff11e --- /dev/null +++ b/sources/phpBB/phpbb/console/command/extension/enable.php @@ -0,0 +1,52 @@ + +* @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\extension; + +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class enable extends command +{ + protected function configure() + { + $this + ->setName('extension:enable') + ->setDescription($this->user->lang('CLI_DESCRIPTION_ENABLE_EXTENSION')) + ->addArgument( + 'extension-name', + InputArgument::REQUIRED, + $this->user->lang('CLI_EXTENSION_NAME') + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $name = $input->getArgument('extension-name'); + $this->manager->enable($name); + $this->manager->load_extensions(); + + if ($this->manager->is_enabled($name)) + { + $this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_ENABLE', time(), array($name)); + $output->writeln('' . $this->user->lang('CLI_EXTENSION_ENABLE_SUCCESS', $name) . ''); + return 0; + } + else + { + $output->writeln('' . $this->user->lang('CLI_EXTENSION_ENABLE_FAILURE', $name) . ''); + return 1; + } + } +} diff --git a/sources/phpBB/phpbb/console/command/extension/purge.php b/sources/phpBB/phpbb/console/command/extension/purge.php new file mode 100644 index 0000000..517e9a7 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/extension/purge.php @@ -0,0 +1,52 @@ + +* @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\extension; + +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class purge extends command +{ + protected function configure() + { + $this + ->setName('extension:purge') + ->setDescription($this->user->lang('CLI_DESCRIPTION_PURGE_EXTENSION')) + ->addArgument( + 'extension-name', + InputArgument::REQUIRED, + $this->user->lang('CLI_EXTENSION_NAME') + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $name = $input->getArgument('extension-name'); + $this->manager->purge($name); + $this->manager->load_extensions(); + + if ($this->manager->is_enabled($name)) + { + $output->writeln('' . $this->user->lang('CLI_EXTENSION_PURGE_FAILURE', $name) . ''); + return 1; + } + else + { + $this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_PURGE', time(), array($name)); + $output->writeln('' . $this->user->lang('CLI_EXTENSION_PURGE_SUCCESS', $name) . ''); + return 0; + } + } +} diff --git a/sources/phpBB/phpbb/console/command/extension/show.php b/sources/phpBB/phpbb/console/command/extension/show.php new file mode 100644 index 0000000..f932203 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/extension/show.php @@ -0,0 +1,62 @@ + +* @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\extension; + +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class show extends command +{ + protected function configure() + { + $this + ->setName('extension:show') + ->setDescription($this->user->lang('CLI_DESCRIPTION_LIST_EXTENSIONS')) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->manager->load_extensions(); + $all = array_keys($this->manager->all_available()); + + if (empty($all)) + { + $output->writeln('' . $this->user->lang('CLI_EXTENSION_NOT_FOUND') . ''); + return 3; + } + + $enabled = array_keys($this->manager->all_enabled()); + $this->print_extension_list($output, $this->user->lang('CLI_EXTENSIONS_ENABLED') . $this->user->lang('COLON'), $enabled); + + $output->writeln(''); + + $disabled = array_keys($this->manager->all_disabled()); + $this->print_extension_list($output, $this->user->lang('CLI_EXTENSIONS_DISABLED') . $this->user->lang('COLON'), $disabled); + + $output->writeln(''); + + $purged = array_diff($all, $enabled, $disabled); + $this->print_extension_list($output, $this->user->lang('CLI_EXTENSIONS_AVAILABLE') . $this->user->lang('COLON'), $purged); + } + + protected function print_extension_list(OutputInterface $output, $type, array $extensions) + { + $output->writeln("$type"); + + foreach ($extensions as $extension) + { + $output->writeln(" - $extension"); + } + } +} diff --git a/sources/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php b/sources/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php new file mode 100644 index 0000000..ec4e1b0 --- /dev/null +++ b/sources/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php @@ -0,0 +1,75 @@ + +* @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\fixup; + +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class recalculate_email_hash extends \phpbb\console\command\command +{ + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db) + { + $this->db = $db; + + parent::__construct($user); + } + + protected function configure() + { + $this + ->setName('fixup:recalculate-email-hash') + ->setDescription($this->user->lang('CLI_DESCRIPTION_RECALCULATE_EMAIL_HASH')) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $sql = 'SELECT user_id, user_email, user_email_hash + FROM ' . USERS_TABLE . ' + WHERE user_type <> ' . USER_IGNORE . " + AND user_email <> ''"; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $user_email_hash = phpbb_email_hash($row['user_email']); + if ($user_email_hash !== $row['user_email_hash']) + { + $sql_ary = array( + 'user_email_hash' => $user_email_hash, + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . (int) $row['user_id']; + $this->db->sql_query($sql); + + if ($output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG) + { + $output->writeln(sprintf( + 'user_id %d, email %s => %s', + $row['user_id'], + $row['user_email'], + $user_email_hash + )); + } + } + } + $this->db->sql_freeresult($result); + + $output->writeln('' . $this->user->lang('CLI_FIXUP_RECALCULATE_EMAIL_HASH_SUCCESS') . ''); + } +} diff --git a/sources/phpBB/phpbb/content_visibility.php b/sources/phpBB/phpbb/content_visibility.php new file mode 100644 index 0000000..c8516d6 --- /dev/null +++ b/sources/phpBB/phpbb/content_visibility.php @@ -0,0 +1,718 @@ + +* @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; + +/** +* phpbb_visibility +* Handle fetching and setting the visibility for topics and posts +*/ +class content_visibility +{ + /** + * Database object + * @var \phpbb\db\driver\driver_interface + */ + protected $db; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Auth object + * @var \phpbb\auth\auth + */ + protected $auth; + + /** + * config object + * @var \phpbb\config\config + */ + protected $config; + + /** + * Event dispatcher object + * @var \phpbb\event\dispatcher + */ + protected $phpbb_dispatcher; + + /** + * phpBB root path + * @var string + */ + protected $phpbb_root_path; + + /** + * PHP Extension + * @var string + */ + protected $php_ext; + + /** + * Constructor + * + * @param \phpbb\auth\auth $auth Auth object + * @param \phpbb\config\config $config Config object + * @param \phpbb\event\dispatcher $phpbb_dispatcher Event dispatcher object + * @param \phpbb\db\driver\driver_interface $db Database object + * @param \phpbb\user $user User object + * @param string $phpbb_root_path Root path + * @param string $php_ext PHP Extension + * @param string $forums_table Forums table name + * @param string $posts_table Posts table name + * @param string $topics_table Topics table name + * @param string $users_table Users table name + */ + public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\event\dispatcher $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $php_ext, $forums_table, $posts_table, $topics_table, $users_table) + { + $this->auth = $auth; + $this->config = $config; + $this->phpbb_dispatcher = $phpbb_dispatcher; + $this->db = $db; + $this->user = $user; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->forums_table = $forums_table; + $this->posts_table = $posts_table; + $this->topics_table = $topics_table; + $this->users_table = $users_table; + } + + /** + * Can the current logged-in user soft-delete posts? + * + * @param $forum_id int Forum ID whose permissions to check + * @param $poster_id int Poster ID of the post in question + * @param $post_locked bool Is the post locked? + * @return bool + */ + public function can_soft_delete($forum_id, $poster_id, $post_locked) + { + if ($this->auth->acl_get('m_softdelete', $forum_id)) + { + return true; + } + else if ($this->auth->acl_get('f_softdelete', $forum_id) && $poster_id == $this->user->data['user_id'] && !$post_locked) + { + return true; + } + + return false; + } + + /** + * Get the topics post count or the forums post/topic count based on permissions + * + * @param $mode string One of topic_posts, forum_posts or forum_topics + * @param $data array Array with the topic/forum data to calculate from + * @param $forum_id int The forum id is used for permission checks + * @return int Number of posts/topics the user can see in the topic/forum + */ + public function get_count($mode, $data, $forum_id) + { + if (!$this->auth->acl_get('m_approve', $forum_id)) + { + return (int) $data[$mode . '_approved']; + } + + return (int) $data[$mode . '_approved'] + (int) $data[$mode . '_unapproved'] + (int) $data[$mode . '_softdeleted']; + } + + /** + * Create topic/post visibility SQL for a given forum ID + * + * Note: Read permissions are not checked. + * + * @param $mode string Either "topic" or "post" + * @param $forum_id int The forum id is used for permission checks + * @param $table_alias string Table alias to prefix in SQL queries + * @return string The appropriate combination SQL logic for topic/post_visibility + */ + public function get_visibility_sql($mode, $forum_id, $table_alias = '') + { + if ($this->auth->acl_get('m_approve', $forum_id)) + { + return '1 = 1'; + } + + return $table_alias . $mode . '_visibility = ' . ITEM_APPROVED; + } + + /** + * Create topic/post visibility SQL for a set of forums + * + * Note: Read permissions are not checked. Forums without read permissions + * should not be in $forum_ids + * + * @param $mode string Either "topic" or "post" + * @param $forum_ids array Array of forum ids which the posts/topics are limited to + * @param $table_alias string Table alias to prefix in SQL queries + * @return string The appropriate combination SQL logic for topic/post_visibility + */ + public function get_forums_visibility_sql($mode, $forum_ids = array(), $table_alias = '') + { + $where_sql = '('; + + $approve_forums = array_intersect($forum_ids, array_keys($this->auth->acl_getf('m_approve', true))); + + $get_forums_visibility_sql_overwrite = false; + /** + * Allow changing the result of calling get_forums_visibility_sql + * + * @event core.phpbb_content_visibility_get_forums_visibility_before + * @var string where_sql The action the user tried to execute + * @var string mode Either "topic" or "post" depending on the query this is being used in + * @var array forum_ids Array of forum ids which the posts/topics are limited to + * @var string table_alias Table alias to prefix in SQL queries + * @var array approve_forums Array of forums where the user has m_approve permissions + * @var mixed get_forums_visibility_sql_overwrite If a string, forces the function to return get_forums_visibility_sql_overwrite after executing the event + * If false, get_forums_visibility_sql continues normally + * It must be either boolean or string + * @since 3.1.3-RC1 + */ + $vars = array( + 'where_sql', + 'mode', + 'forum_ids', + 'table_alias', + 'approve_forums', + 'get_forums_visibility_sql_overwrite', + ); + extract($this->phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_forums_visibility_before', compact($vars))); + + if ($get_forums_visibility_sql_overwrite !== false) + { + return $get_forums_visibility_sql_overwrite; + } + + if (sizeof($approve_forums)) + { + // Remove moderator forums from the rest + $forum_ids = array_diff($forum_ids, $approve_forums); + + if (!sizeof($forum_ids)) + { + // The user can see all posts/topics in all specified forums + return $this->db->sql_in_set($table_alias . 'forum_id', $approve_forums); + } + else + { + // Moderator can view all posts/topics in some forums + $where_sql .= $this->db->sql_in_set($table_alias . 'forum_id', $approve_forums) . ' OR '; + } + } + else + { + // The user is just a normal user + return $table_alias . $mode . '_visibility = ' . ITEM_APPROVED . ' + AND ' . $this->db->sql_in_set($table_alias . 'forum_id', $forum_ids, false, true); + } + + $where_sql .= '(' . $table_alias . $mode . '_visibility = ' . ITEM_APPROVED . ' + AND ' . $this->db->sql_in_set($table_alias . 'forum_id', $forum_ids) . '))'; + + return $where_sql; + } + + /** + * Create topic/post visibility SQL for all forums on the board + * + * Note: Read permissions are not checked. Forums without read permissions + * should be in $exclude_forum_ids + * + * @param $mode string Either "topic" or "post" + * @param $exclude_forum_ids array Array of forum ids which are excluded + * @param $table_alias string Table alias to prefix in SQL queries + * @return string The appropriate combination SQL logic for topic/post_visibility + */ + public function get_global_visibility_sql($mode, $exclude_forum_ids = array(), $table_alias = '') + { + $where_sqls = array(); + + $approve_forums = array_diff(array_keys($this->auth->acl_getf('m_approve', true)), $exclude_forum_ids); + + $visibility_sql_overwrite = null; + + /** + * Allow changing the result of calling get_global_visibility_sql + * + * @event core.phpbb_content_visibility_get_global_visibility_before + * @var array where_sqls The action the user tried to execute + * @var string mode Either "topic" or "post" depending on the query this is being used in + * @var array forum_ids Array of forum ids which the posts/topics are limited to + * @var string table_alias Table alias to prefix in SQL queries + * @var array approve_forums Array of forums where the user has m_approve permissions + * @var string visibility_sql_overwrite Forces the function to return an implosion of where_sqls (joined by "OR") + * @since 3.1.3-RC1 + */ + $vars = array( + 'where_sqls', + 'mode', + 'forum_ids', + 'table_alias', + 'approve_forums', + 'visibility_sql_overwrite', + ); + extract($this->phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_global_visibility_before', compact($vars))); + + if ($visibility_sql_overwrite) + { + return $visibility_sql_overwrite; + } + + if (sizeof($exclude_forum_ids)) + { + $where_sqls[] = '(' . $this->db->sql_in_set($table_alias . 'forum_id', $exclude_forum_ids, true) . ' + AND ' . $table_alias . $mode . '_visibility = ' . ITEM_APPROVED . ')'; + } + else + { + $where_sqls[] = $table_alias . $mode . '_visibility = ' . ITEM_APPROVED; + } + + if (sizeof($approve_forums)) + { + $where_sqls[] = $this->db->sql_in_set($table_alias . 'forum_id', $approve_forums); + return '(' . implode(' OR ', $where_sqls) . ')'; + } + + // There is only one element, so we just return that one + return $where_sqls[0]; + } + + /** + * Change visibility status of one post or all posts of a topic + * + * @param $visibility int Element of {ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE} + * @param $post_id mixed Post ID or array of post IDs to act on, + * if it is empty, all posts of topic_id will be modified + * @param $topic_id int Topic where $post_id is found + * @param $forum_id int Forum where $topic_id is found + * @param $user_id int User performing the action + * @param $time int Timestamp when the action is performed + * @param $reason string Reason why the visibility was changed. + * @param $is_starter bool Is this the first post of the topic changed? + * @param $is_latest bool Is this the last post of the topic changed? + * @param $limit_visibility mixed Limit updating per topic_id to a certain visibility + * @param $limit_delete_time mixed Limit updating per topic_id to a certain deletion time + * @return array Changed post data, empty array if an error occurred. + */ + public function set_post_visibility($visibility, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest, $limit_visibility = false, $limit_delete_time = false) + { + if (!in_array($visibility, array(ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE))) + { + return array(); + } + + if ($post_id) + { + if (is_array($post_id)) + { + $where_sql = $this->db->sql_in_set('post_id', array_map('intval', $post_id)); + } + else + { + $where_sql = 'post_id = ' . (int) $post_id; + } + $where_sql .= ' AND topic_id = ' . (int) $topic_id; + } + else + { + $where_sql = 'topic_id = ' . (int) $topic_id; + + // Limit the posts to a certain visibility and deletion time + // This allows us to only restore posts, that were approved + // when the topic got soft deleted. So previous soft deleted + // and unapproved posts are still soft deleted/unapproved + if ($limit_visibility !== false) + { + $where_sql .= ' AND post_visibility = ' . (int) $limit_visibility; + } + + if ($limit_delete_time !== false) + { + $where_sql .= ' AND post_delete_time = ' . (int) $limit_delete_time; + } + } + + $sql = 'SELECT poster_id, post_id, post_postcount, post_visibility + FROM ' . $this->posts_table . ' + WHERE ' . $where_sql; + $result = $this->db->sql_query($sql); + + $post_ids = $poster_postcounts = $postcounts = $postcount_visibility = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $post_ids[] = (int) $row['post_id']; + + if ($row['post_visibility'] != $visibility) + { + if ($row['post_postcount'] && !isset($poster_postcounts[(int) $row['poster_id']])) + { + $poster_postcounts[(int) $row['poster_id']] = 1; + } + else if ($row['post_postcount']) + { + $poster_postcounts[(int) $row['poster_id']]++; + } + + if (!isset($postcount_visibility[$row['post_visibility']])) + { + $postcount_visibility[$row['post_visibility']] = 1; + } + else + { + $postcount_visibility[$row['post_visibility']]++; + } + } + } + $this->db->sql_freeresult($result); + + if (empty($post_ids)) + { + return array(); + } + + $data = array( + 'post_visibility' => (int) $visibility, + 'post_delete_user' => (int) $user_id, + 'post_delete_time' => ((int) $time) ?: time(), + 'post_delete_reason' => truncate_string($reason, 255, 255, false), + ); + + $sql = 'UPDATE ' . $this->posts_table . ' + SET ' . $this->db->sql_build_array('UPDATE', $data) . ' + WHERE ' . $this->db->sql_in_set('post_id', $post_ids); + $this->db->sql_query($sql); + + // Group the authors by post count, to reduce the number of queries + foreach ($poster_postcounts as $poster_id => $num_posts) + { + $postcounts[$num_posts][] = $poster_id; + } + + // Update users postcounts + foreach ($postcounts as $num_posts => $poster_ids) + { + if (in_array($visibility, array(ITEM_REAPPROVE, ITEM_DELETED))) + { + $sql = 'UPDATE ' . $this->users_table . ' + SET user_posts = 0 + WHERE ' . $this->db->sql_in_set('user_id', $poster_ids) . ' + AND user_posts < ' . $num_posts; + $this->db->sql_query($sql); + + $sql = 'UPDATE ' . $this->users_table . ' + SET user_posts = user_posts - ' . $num_posts . ' + WHERE ' . $this->db->sql_in_set('user_id', $poster_ids) . ' + AND user_posts >= ' . $num_posts; + $this->db->sql_query($sql); + } + else + { + $sql = 'UPDATE ' . $this->users_table . ' + SET user_posts = user_posts + ' . $num_posts . ' + WHERE ' . $this->db->sql_in_set('user_id', $poster_ids); + $this->db->sql_query($sql); + } + } + + $update_topic_postcount = true; + + // Sync the first/last topic information if needed + if (!$is_starter && $is_latest) + { + if (!function_exists('update_post_information')) + { + include($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext); + } + + // update_post_information can only update the last post info ... + if ($topic_id) + { + update_post_information('topic', $topic_id, false); + } + if ($forum_id) + { + update_post_information('forum', $forum_id, false); + } + } + else if ($is_starter && $topic_id) + { + if (!function_exists('sync')) + { + include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext); + } + + // ... so we need to use sync, if the first post is changed. + // The forum is resynced recursive by sync() itself. + sync('topic', 'topic_id', $topic_id, true); + + // sync recalculates the topic replies and forum posts by itself, so we don't do that. + $update_topic_postcount = false; + } + + $topic_update_array = array(); + // Update the topic's reply count and the forum's post count + if ($update_topic_postcount) + { + $field_alias = array( + ITEM_APPROVED => 'posts_approved', + ITEM_UNAPPROVED => 'posts_unapproved', + ITEM_DELETED => 'posts_softdeleted', + ITEM_REAPPROVE => 'posts_unapproved', + ); + $cur_posts = array_fill_keys($field_alias, 0); + + foreach ($postcount_visibility as $post_visibility => $visibility_posts) + { + $cur_posts[$field_alias[(int) $post_visibility]] += $visibility_posts; + } + + $sql_ary = array(); + $recipient_field = $field_alias[$visibility]; + + foreach ($cur_posts as $field => $count) + { + // Decrease the count for the old statuses. + if ($count && $field != $recipient_field) + { + $sql_ary[$field] = " - $count"; + } + } + // Add up the count from all statuses excluding the recipient status. + $count_increase = array_sum(array_diff($cur_posts, array($recipient_field))); + + if ($count_increase) + { + $sql_ary[$recipient_field] = " + $count_increase"; + } + + if (sizeof($sql_ary)) + { + $forum_sql = array(); + + foreach ($sql_ary as $field => $value_change) + { + $topic_update_array[] = 'topic_' . $field . ' = topic_' . $field . $value_change; + $forum_sql[] = 'forum_' . $field . ' = forum_' . $field . $value_change; + } + + $sql = 'UPDATE ' . $this->forums_table . ' + SET ' . implode(', ', $forum_sql) . ' + WHERE forum_id = ' . (int) $forum_id; + $this->db->sql_query($sql); + } + } + + if ($post_id) + { + $sql = 'SELECT 1 AS has_attachments + FROM ' . POSTS_TABLE . ' + WHERE topic_id = ' . (int) $topic_id . ' + AND post_attachment = 1 + AND post_visibility = ' . ITEM_APPROVED . ' + AND ' . $this->db->sql_in_set('post_id', $post_id, true); + $result = $this->db->sql_query_limit($sql, 1); + + $has_attachment = (bool) $this->db->sql_fetchfield('has_attachments'); + $this->db->sql_freeresult($result); + + if ($has_attachment && $visibility == ITEM_APPROVED) + { + $topic_update_array[] = 'topic_attachment = 1'; + } + else if (!$has_attachment && $visibility != ITEM_APPROVED) + { + $topic_update_array[] = 'topic_attachment = 0'; + } + } + + if (!empty($topic_update_array)) + { + // Update the number for replies and posts, and update the attachments flag + $sql = 'UPDATE ' . $this->topics_table . ' + SET ' . implode(', ', $topic_update_array) . ' + WHERE topic_id = ' . (int) $topic_id; + $this->db->sql_query($sql); + } + + return $data; + } + + /** + * Set topic visibility + * + * Allows approving (which is akin to undeleting/restore) or soft deleting an entire topic. + * Calls set_post_visibility as needed. + * + * Note: By default, when a soft deleted topic is restored. Only posts that + * were approved at the time of soft deleting, are being restored. + * Same applies to soft deleting. Only approved posts will be marked + * as soft deleted. + * If you want to update all posts, use the force option. + * + * @param $visibility int Element of {ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE} + * @param $topic_id mixed Topic ID to act on + * @param $forum_id int Forum where $topic_id is found + * @param $user_id int User performing the action + * @param $time int Timestamp when the action is performed + * @param $reason string Reason why the visibilty was changed. + * @param $force_update_all bool Force to update all posts within the topic + * @return array Changed topic data, empty array if an error occured. + */ + public function set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all = false) + { + if (!in_array($visibility, array(ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE))) + { + return array(); + } + + if (!$force_update_all) + { + $sql = 'SELECT topic_visibility, topic_delete_time + FROM ' . $this->topics_table . ' + WHERE topic_id = ' . (int) $topic_id; + $result = $this->db->sql_query($sql); + $original_topic_data = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (!$original_topic_data) + { + // The topic does not exist... + return array(); + } + } + + // Note, we do not set a reason for the posts, just for the topic + $data = array( + 'topic_visibility' => (int) $visibility, + 'topic_delete_user' => (int) $user_id, + 'topic_delete_time' => ((int) $time) ?: time(), + 'topic_delete_reason' => truncate_string($reason, 255, 255, false), + ); + + $sql = 'UPDATE ' . $this->topics_table . ' + SET ' . $this->db->sql_build_array('UPDATE', $data) . ' + WHERE topic_id = ' . (int) $topic_id; + $this->db->sql_query($sql); + + if (!$this->db->sql_affectedrows()) + { + return array(); + } + + if (!$force_update_all && $original_topic_data['topic_delete_time'] && $original_topic_data['topic_visibility'] == ITEM_DELETED && $visibility == ITEM_APPROVED) + { + // If we're restoring a topic we only restore posts, that were soft deleted through the topic soft deletion. + $this->set_post_visibility($visibility, false, $topic_id, $forum_id, $user_id, $time, '', true, true, $original_topic_data['topic_visibility'], $original_topic_data['topic_delete_time']); + } + else if (!$force_update_all && $original_topic_data['topic_visibility'] == ITEM_APPROVED && $visibility == ITEM_DELETED) + { + // If we're soft deleting a topic we only mark approved posts as soft deleted. + $this->set_post_visibility($visibility, false, $topic_id, $forum_id, $user_id, $time, '', true, true, $original_topic_data['topic_visibility']); + } + else + { + $this->set_post_visibility($visibility, false, $topic_id, $forum_id, $user_id, $time, '', true, true); + } + + return $data; + } + + /** + * Add post to topic and forum statistics + * + * @param $data array Contains information from the topics table about given topic + * @param &$sql_data array Populated with the SQL changes, may be empty at call time + * @return null + */ + public function add_post_to_statistic($data, &$sql_data) + { + $sql_data[$this->topics_table] = (($sql_data[$this->topics_table]) ? $sql_data[$this->topics_table] . ', ' : '') . 'topic_posts_approved = topic_posts_approved + 1'; + + $sql_data[$this->forums_table] = (($sql_data[$this->forums_table]) ? $sql_data[$this->forums_table] . ', ' : '') . 'forum_posts_approved = forum_posts_approved + 1'; + + if ($data['post_postcount']) + { + $sql_data[$this->users_table] = (($sql_data[$this->users_table]) ? $sql_data[$this->users_table] . ', ' : '') . 'user_posts = user_posts + 1'; + } + + $this->config->increment('num_posts', 1, false); + } + + /** + * Remove post from topic and forum statistics + * + * @param $data array Contains information from the topics table about given topic + * @param &$sql_data array Populated with the SQL changes, may be empty at call time + * @return null + */ + public function remove_post_from_statistic($data, &$sql_data) + { + if ($data['post_visibility'] == ITEM_APPROVED) + { + $sql_data[$this->topics_table] = ((!empty($sql_data[$this->topics_table])) ? $sql_data[$this->topics_table] . ', ' : '') . 'topic_posts_approved = topic_posts_approved - 1'; + $sql_data[$this->forums_table] = ((!empty($sql_data[$this->forums_table])) ? $sql_data[$this->forums_table] . ', ' : '') . 'forum_posts_approved = forum_posts_approved - 1'; + + if ($data['post_postcount']) + { + $sql_data[$this->users_table] = ((!empty($sql_data[$this->users_table])) ? $sql_data[$this->users_table] . ', ' : '') . 'user_posts = user_posts - 1'; + } + + $this->config->increment('num_posts', -1, false); + } + else if ($data['post_visibility'] == ITEM_UNAPPROVED || $data['post_visibility'] == ITEM_REAPPROVE) + { + $sql_data[FORUMS_TABLE] = (($sql_data[FORUMS_TABLE]) ? $sql_data[FORUMS_TABLE] . ', ' : '') . 'forum_posts_unapproved = forum_posts_unapproved - 1'; + $sql_data[TOPICS_TABLE] = (($sql_data[TOPICS_TABLE]) ? $sql_data[TOPICS_TABLE] . ', ' : '') . 'topic_posts_unapproved = topic_posts_unapproved - 1'; + } + else if ($data['post_visibility'] == ITEM_DELETED) + { + $sql_data[FORUMS_TABLE] = (($sql_data[FORUMS_TABLE]) ? $sql_data[FORUMS_TABLE] . ', ' : '') . 'forum_posts_softdeleted = forum_posts_softdeleted - 1'; + $sql_data[TOPICS_TABLE] = (($sql_data[TOPICS_TABLE]) ? $sql_data[TOPICS_TABLE] . ', ' : '') . 'topic_posts_softdeleted = topic_posts_softdeleted - 1'; + } + } + + /** + * Remove topic from forum statistics + * + * @param $data array Post and topic data + * @param &$sql_data array Populated with the SQL changes, may be empty at call time + * @return null + */ + public function remove_topic_from_statistic($data, &$sql_data) + { + if ($data['topic_visibility'] == ITEM_APPROVED) + { + $sql_data[FORUMS_TABLE] .= 'forum_posts_approved = forum_posts_approved - 1, forum_topics_approved = forum_topics_approved - 1'; + + if ($data['post_postcount']) + { + $sql_data[$this->users_table] = ((!empty($sql_data[$this->users_table])) ? $sql_data[$this->users_table] . ', ' : '') . 'user_posts = user_posts - 1'; + } + } + else if ($data['topic_visibility'] == ITEM_UNAPPROVED || $data['post_visibility'] == ITEM_REAPPROVE) + { + $sql_data[FORUMS_TABLE] .= 'forum_posts_unapproved = forum_posts_unapproved - 1, forum_topics_unapproved = forum_topics_unapproved - 1'; + } + else if ($data['topic_visibility'] == ITEM_DELETED) + { + $sql_data[FORUMS_TABLE] .= 'forum_posts_softdeleted = forum_posts_softdeleted - 1, forum_topics_softdeleted = forum_topics_softdeleted - 1'; + } + + } +} diff --git a/sources/phpBB/phpbb/controller/exception.php b/sources/phpBB/phpbb/controller/exception.php new file mode 100644 index 0000000..437558b --- /dev/null +++ b/sources/phpBB/phpbb/controller/exception.php @@ -0,0 +1,21 @@ + +* @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; + +/** +* Controller exception class +*/ +class exception extends \RuntimeException +{ +} diff --git a/sources/phpBB/phpbb/controller/helper.php b/sources/phpBB/phpbb/controller/helper.php new file mode 100644 index 0000000..c6c470e --- /dev/null +++ b/sources/phpBB/phpbb/controller/helper.php @@ -0,0 +1,226 @@ + +* @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\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 +*/ +class helper +{ + /** + * Template object + * @var \phpbb\template\template + */ + protected $template; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * config object + * @var \phpbb\config\config + */ + protected $config; + + /* @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\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 + */ + public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, \phpbb\symfony_request $symfony_request, \phpbb\request\request_interface $request, \phpbb\filesystem $filesystem, $phpbb_root_path, $php_ext) + { + $this->template = $template; + $this->user = $user; + $this->config = $config; + $this->symfony_request = $symfony_request; + $this->request = $request; + $this->filesystem = $filesystem; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $provider->find_routing_files($manager->get_finder()); + $this->route_collection = $provider->find($phpbb_root_path)->get_routes(); + } + + /** + * 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 int $status_code The status code to be sent to the page header + * @param bool $display_online_list Do we display online users list + * + * @return Response object containing rendered page + */ + public function render($template_file, $page_title = '', $status_code = 200, $display_online_list = false) + { + page_header($page_title, $display_online_list); + + $this->template->set_filenames(array( + 'body' => $template_file, + )); + + page_footer(true, false, false); + + return new Response($this->template->assign_display('body'), $status_code); + } + + /** + * 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 & (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(); + + // 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('&', '&'), array('&', '&'), $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); + } + + /** + * Output an error, effectively the same thing as trigger_error + * + * @param string $message The error message + * @param int $code The error code (e.g. 404, 500, 503, etc.) + * @return Response A Response instance + * + * @deprecated 3.1.3 (To be removed: 3.3.0) Use exceptions instead. + */ + public function error($message, $code = 500) + { + return $this->message($message, array(), 'INFORMATION', $code); + } + + /** + * Output a message + * + * In case of an error, please throw an exception instead + * + * @param string $message The message to display (must be a language variable) + * @param array $parameters The parameters to use with the language var + * @param string $title Title for the message (must be a language variable) + * @param int $code The HTTP status code (e.g. 404, 500, 503, etc.) + * @return Response A Response instance + */ + public function message($message, array $parameters = array(), $title = 'INFORMATION', $code = 200) + { + array_unshift($parameters, $message); + $this->template->assign_vars(array( + 'MESSAGE_TEXT' => call_user_func_array(array($this->user, 'lang'), $parameters), + 'MESSAGE_TITLE' => $this->user->lang($title), + )); + + return $this->render('message_body.html', $this->user->lang($title), $code); + } + + /** + * Return the current url + * + * @return string + */ + public function get_current_url() + { + return generate_board_url(true) . $this->request->escape($this->symfony_request->getRequestUri(), true); + } +} diff --git a/sources/phpBB/phpbb/controller/provider.php b/sources/phpBB/phpbb/controller/provider.php new file mode 100644 index 0000000..7e26848 --- /dev/null +++ b/sources/phpBB/phpbb/controller/provider.php @@ -0,0 +1,92 @@ + +* @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/sources/phpBB/phpbb/controller/resolver.php b/sources/phpBB/phpbb/controller/resolver.php new file mode 100644 index 0000000..948a6a2 --- /dev/null +++ b/sources/phpBB/phpbb/controller/resolver.php @@ -0,0 +1,175 @@ + +* @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\HttpKernel\Controller\ControllerResolverInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\HttpFoundation\Request; + +/** +* Controller manager class +*/ +class resolver implements ControllerResolverInterface +{ + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * ContainerInterface object + * @var ContainerInterface + */ + protected $container; + + /** + * phpbb\template\template object + * @var \phpbb\template\template + */ + protected $template; + + /** + * Request type cast helper object + * @var \phpbb\request\type_cast_helper + */ + protected $type_cast_helper; + + /** + * phpBB root path + * @var string + */ + protected $phpbb_root_path; + + /** + * 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) + { + $this->user = $user; + $this->container = $container; + $this->template = $template; + $this->type_cast_helper = new \phpbb\request\type_cast_helper(); + $this->phpbb_root_path = $phpbb_root_path; + } + + /** + * Load a controller callable + * + * @param \Symfony\Component\HttpFoundation\Request $request Symfony Request object + * @return bool|Callable Callable or false + * @throws \phpbb\controller\exception + */ + public function getController(Request $request) + { + $controller = $request->attributes->get('_controller'); + + if (!$controller) + { + throw new \phpbb\controller\exception($this->user->lang['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']); + } + + list($service, $method) = explode(':', $controller); + + if (!$this->container->has($service)) + { + throw new \phpbb\controller\exception($this->user->lang('CONTROLLER_SERVICE_UNDEFINED', $service)); + } + + $controller_object = $this->container->get($service); + + /* + * If this is an extension controller, we'll try to automatically set + * the style paths for the extension (the ext author can change them + * if necessary). + */ + $controller_dir = explode('\\', get_class($controller_object)); + + // 0 vendor, 1 extension name, ... + if (!is_null($this->template) && isset($controller_dir[1])) + { + $controller_style_dir = 'ext/' . $controller_dir[0] . '/' . $controller_dir[1] . '/styles'; + + if (is_dir($this->phpbb_root_path . $controller_style_dir)) + { + $this->template->set_style(array($controller_style_dir, 'styles')); + } + } + + return array($controller_object, $method); + } + + /** + * Dependencies should be specified in the service definition and can be + * then accessed in __construct(). Arguments are sent through the URL path + * and should match the parameters of the method you are using as your + * controller. + * + * @param \Symfony\Component\HttpFoundation\Request $request Symfony Request object + * @param mixed $controller A callable (controller class, method) + * @return array An array of arguments to pass to the controller + * @throws \phpbb\controller\exception + */ + public function getArguments(Request $request, $controller) + { + // At this point, $controller contains the object and method name + list($object, $method) = $controller; + $mirror = new \ReflectionMethod($object, $method); + + $arguments = array(); + $parameters = $mirror->getParameters(); + $attributes = $request->attributes->all(); + foreach ($parameters as $param) + { + if (array_key_exists($param->name, $attributes)) + { + if (is_string($attributes[$param->name])) + { + $value = $attributes[$param->name]; + $this->type_cast_helper->set_var($value, $attributes[$param->name], 'string', true, false); + $arguments[] = $value; + } + else + { + $arguments[] = $attributes[$param->name]; + } + } + else if ($param->getClass() && $param->getClass()->isInstance($request)) + { + $arguments[] = $request; + } + else if ($param->isDefaultValueAvailable()) + { + $arguments[] = $param->getDefaultValue(); + } + else + { + throw new \phpbb\controller\exception($this->user->lang('CONTROLLER_ARGUMENT_VALUE_MISSING', $param->getPosition() + 1, get_class($object) . ':' . $method, $param->name)); + } + } + + return $arguments; + } +} diff --git a/sources/phpBB/phpbb/cron/manager.php b/sources/phpBB/phpbb/cron/manager.php new file mode 100644 index 0000000..079ce81 --- /dev/null +++ b/sources/phpBB/phpbb/cron/manager.php @@ -0,0 +1,147 @@ + +* @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\cron; + +/** +* Cron manager class. +* +* Finds installed cron tasks, stores task objects, provides task selection. +*/ +class manager +{ + /** + * Set of \phpbb\cron\task\wrapper objects. + * Array holding all tasks that have been found. + * + * @var array + */ + protected $tasks = array(); + + protected $phpbb_root_path; + protected $php_ext; + + /** + * Constructor. Loads all available tasks. + * + * @param array|\Traversable $tasks Provides an iterable set of task names + * @param string $phpbb_root_path Relative path to phpBB root + * @param string $php_ext PHP file extension + */ + public function __construct($tasks, $phpbb_root_path, $php_ext) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + + $this->load_tasks($tasks); + } + + /** + * Loads tasks given by name, wraps them + * and puts them into $this->tasks. + * + * @param array|\Traversable $tasks Array of instances of \phpbb\cron\task\task + * + * @return null + */ + public function load_tasks($tasks) + { + foreach ($tasks as $task) + { + $this->tasks[] = $this->wrap_task($task); + } + } + + /** + * Finds a task that is ready to run. + * + * If several tasks are ready, any one of them could be returned. + * + * If no tasks are ready, null is returned. + * + * @return \phpbb\cron\task\wrapper|null + */ + public function find_one_ready_task() + { + shuffle($this->tasks); + foreach ($this->tasks as $task) + { + if ($task->is_ready()) + { + return $task; + } + } + return null; + } + + /** + * Finds all tasks that are ready to run. + * + * @return array List of tasks which are ready to run (wrapped in \phpbb\cron\task\wrapper). + */ + public function find_all_ready_tasks() + { + $tasks = array(); + foreach ($this->tasks as $task) + { + if ($task->is_ready()) + { + $tasks[] = $task; + } + } + return $tasks; + } + + /** + * Finds a task by name. + * + * If there is no task with the specified name, null is returned. + * + * Web runner uses this method to resolve names to tasks. + * + * @param string $name Name of the task to look up. + * @return \phpbb\cron\task\task A task corresponding to the given name, or null. + */ + public function find_task($name) + { + foreach ($this->tasks as $task) + { + if ($task->get_name() == $name) + { + return $task; + } + } + return null; + } + + /** + * Find all tasks and return them. + * + * @return array List of all tasks. + */ + public function get_tasks() + { + return $this->tasks; + } + + /** + * Wraps a task inside an instance of \phpbb\cron\task\wrapper. + * + * @param \phpbb\cron\task\task $task The task. + * @return \phpbb\cron\task\wrapper The wrapped task. + */ + public function wrap_task(\phpbb\cron\task\task $task) + { + return new \phpbb\cron\task\wrapper($task, $this->phpbb_root_path, $this->php_ext); + } +} diff --git a/sources/phpBB/phpbb/cron/task/base.php b/sources/phpBB/phpbb/cron/task/base.php new file mode 100644 index 0000000..57c9912 --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/base.php @@ -0,0 +1,72 @@ + +* @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\cron\task; + +/** +* Cron task base class. Provides sensible defaults for cron tasks +* and partially implements cron task interface, making writing cron tasks easier. +* +* At a minimum, subclasses must override the run() method. +* +* Cron tasks need not inherit from this base class. If desired, +* they may implement cron task interface directly. +*/ +abstract class base implements \phpbb\cron\task\task +{ + private $name; + + /** + * Returns the name of the task. + * + * @return string Name of wrapped task. + */ + public function get_name() + { + return $this->name; + } + + /** + * Sets the name of the task. + * + * @param string $name The task name + */ + public function set_name($name) + { + $this->name = $name; + } + + /** + * Returns whether this cron task can run, given current board configuration. + * + * For example, a cron task that prunes forums can only run when + * forum pruning is enabled. + * + * @return bool + */ + public function is_runnable() + { + return true; + } + + /** + * Returns whether this cron task should run now, because enough time + * has passed since it was last run. + * + * @return bool + */ + public function should_run() + { + return true; + } +} diff --git a/sources/phpBB/phpbb/cron/task/core/prune_all_forums.php b/sources/phpBB/phpbb/cron/task/core/prune_all_forums.php new file mode 100644 index 0000000..b47939c --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/core/prune_all_forums.php @@ -0,0 +1,89 @@ + +* @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\cron\task\core; + +/** +* Prune all forums cron task. +* +* It is intended to be invoked from system cron. +* This task will find all forums for which pruning is enabled, and will +* prune all forums as necessary. +*/ +class prune_all_forums extends \phpbb\cron\task\base +{ + protected $phpbb_root_path; + protected $php_ext; + protected $config; + protected $db; + + /** + * Constructor. + * + * @param string $phpbb_root_path The root path + * @param string $php_ext The PHP file extension + * @param \phpbb\config\config $config The config + * @param \phpbb\db\driver\driver_interface $db The db connection + */ + public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->config = $config; + $this->db = $db; + } + + /** + * Runs this cron task. + * + * @return null + */ + public function run() + { + if (!function_exists('auto_prune')) + { + include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext); + } + + $sql = 'SELECT forum_id, prune_next, enable_prune, prune_days, prune_viewed, forum_flags, prune_freq + FROM ' . FORUMS_TABLE . " + WHERE enable_prune = 1 + AND prune_next < " . time(); + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + if ($row['prune_days']) + { + auto_prune($row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']); + } + + if ($row['prune_viewed']) + { + auto_prune($row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']); + } + } + $this->db->sql_freeresult($result); + } + + /** + * Returns whether this cron task can run, given current board configuration. + * + * This cron task will only run when system cron is utilised. + * + * @return bool + */ + public function is_runnable() + { + return (bool) $this->config['use_system_cron']; + } +} diff --git a/sources/phpBB/phpbb/cron/task/core/prune_forum.php b/sources/phpBB/phpbb/cron/task/core/prune_forum.php new file mode 100644 index 0000000..ba68565 --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/core/prune_forum.php @@ -0,0 +1,159 @@ + +* @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\cron\task\core; + +/** +* Prune one forum cron task. +* +* It is intended to be used when cron is invoked via web. +* This task can decide whether it should be run using data obtained by viewforum +* code, without making additional database queries. +*/ +class prune_forum extends \phpbb\cron\task\base implements \phpbb\cron\task\parametrized +{ + protected $phpbb_root_path; + protected $php_ext; + protected $config; + protected $db; + + /** + * 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 + * and a database query will be performed to load the necessary information + * about the forum. + */ + protected $forum_data; + + /** + * Constructor. + * + * @param string $phpbb_root_path The root path + * @param string $php_ext PHP file extension + * @param \phpbb\config\config $config The config + * @param \phpbb\db\driver\driver_interface $db The db connection + */ + public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->config = $config; + $this->db = $db; + } + + /** + * Manually set forum data. + * + * @param array $forum_data Information about a forum to be pruned. + */ + public function set_forum_data($forum_data) + { + $this->forum_data = $forum_data; + } + + /** + * Runs this cron task. + * + * @return null + */ + public function run() + { + if (!function_exists('auto_prune')) + { + include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext); + } + + if ($this->forum_data['prune_days']) + { + auto_prune($this->forum_data['forum_id'], 'posted', $this->forum_data['forum_flags'], $this->forum_data['prune_days'], $this->forum_data['prune_freq']); + } + + if ($this->forum_data['prune_viewed']) + { + auto_prune($this->forum_data['forum_id'], 'viewed', $this->forum_data['forum_flags'], $this->forum_data['prune_viewed'], $this->forum_data['prune_freq']); + } + } + + /** + * Returns whether this cron task can run, given current board configuration. + * + * This cron task will not run when system cron is utilised, as in + * such cases prune_all_forums task would run instead. + * + * Additionally, this task must be given the forum data, either via + * the constructor or parse_parameters method. + * + * @return bool + */ + public function is_runnable() + { + return !$this->config['use_system_cron'] && $this->forum_data; + } + + /** + * Returns whether this cron task should run now, because enough time + * has passed since it was last run. + * + * Forum pruning interval is specified in the forum data. + * + * @return bool + */ + public function should_run() + { + return $this->forum_data['enable_prune'] && $this->forum_data['prune_next'] < time(); + } + + /** + * Returns parameters of this cron task as an array. + * The array has one key, f, whose value is id of the forum to be pruned. + * + * @return array + */ + public function get_parameters() + { + return array('f' => $this->forum_data['forum_id']); + } + + /** + * Parses parameters found in $request, which is an instance of + * \phpbb\request\request_interface. + * + * It is expected to have a key f whose value is id of the forum to be pruned. + * + * @param \phpbb\request\request_interface $request Request object. + * + * @return null + */ + public function parse_parameters(\phpbb\request\request_interface $request) + { + $this->forum_data = null; + if ($request->is_set('f')) + { + $forum_id = $request->variable('f', 0); + + $sql = 'SELECT forum_id, prune_next, enable_prune, prune_days, prune_viewed, forum_flags, prune_freq + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if ($row) + { + $this->forum_data = $row; + } + } + } +} diff --git a/sources/phpBB/phpbb/cron/task/core/prune_notifications.php b/sources/phpBB/phpbb/cron/task/core/prune_notifications.php new file mode 100644 index 0000000..ffa7e17 --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/core/prune_notifications.php @@ -0,0 +1,61 @@ + +* @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\cron\task\core; + +/** +* Prune notifications cron task. +*/ +class prune_notifications extends \phpbb\cron\task\base +{ + protected $config; + protected $notification_manager; + + /** + * Constructor. + * + * @param \phpbb\config\config $config The config + * @param \phpbb\notification\manager $notification_manager Notification manager + */ + public function __construct(\phpbb\config\config $config, \phpbb\notification\manager $notification_manager) + { + $this->config = $config; + $this->notification_manager = $notification_manager; + } + + /** + * {@inheritdoc} + */ + public function run() + { + // time minus expire days in seconds + $timestamp = time() - ($this->config['read_notification_expire_days'] * 60 * 60 * 24); + $this->notification_manager->prune_notifications($timestamp); + } + + /** + * {@inheritdoc} + */ + public function is_runnable() + { + return (bool) $this->config['read_notification_expire_days']; + } + + /** + * {@inheritdoc} + */ + public function should_run() + { + return $this->config['read_notification_last_gc'] < time() - $this->config['read_notification_gc']; + } +} diff --git a/sources/phpBB/phpbb/cron/task/core/prune_shadow_topics.php b/sources/phpBB/phpbb/cron/task/core/prune_shadow_topics.php new file mode 100644 index 0000000..97a4b0e --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/core/prune_shadow_topics.php @@ -0,0 +1,200 @@ + +* @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\cron\task\core; + +/** +* Prune one forum of its shadow topics cron task. +* +* It is intended to be used when cron is invoked via web. +* This task can decide whether it should be run using data obtained by viewforum +* code, without making additional database queries. +*/ +class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\task\parametrized +{ + protected $phpbb_root_path; + protected $php_ext; + protected $config; + protected $db; + protected $log; + protected $user; + + /** + * 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 + * and a database query will be performed to load the necessary information + * about the forum. + */ + protected $forum_data; + + /** + * Constructor. + * + * @param string $phpbb_root_path The root path + * @param string $php_ext PHP file extension + * @param \phpbb\config\config $config The config + * @param \phpbb\db\driver\driver_interface $db The db connection + * @param \phpbb\log\log $log The phpBB log system + * @param \phpbb\user $user The phpBB user object + */ + public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\log\log $log, \phpbb\user $user) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->config = $config; + $this->db = $db; + $this->log = $log; + $this->user = $user; + } + + /** + * Manually set forum data. + * + * @param array $forum_data Information about a forum to be pruned. + */ + public function set_forum_data($forum_data) + { + $this->forum_data = $forum_data; + } + + /** + * Runs this cron task. + * + * @return null + */ + public function run() + { + if (!function_exists('auto_prune')) + { + include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext); + } + + if ($this->forum_data['prune_shadow_days']) + { + $this->auto_prune_shadow_topics($this->forum_data['forum_id'], 'shadow', $this->forum_data['forum_flags'], $this->forum_data['prune_shadow_days'], $this->forum_data['prune_shadow_freq']); + } + } + + /** + * Returns whether this cron task can run, given current board configuration. + * + * This cron task will not run when system cron is utilised, as in + * such cases prune_all_forums task would run instead. + * + * Additionally, this task must be given the forum data, either via + * the constructor or parse_parameters method. + * + * @return bool + */ + public function is_runnable() + { + return !$this->config['use_system_cron'] && $this->forum_data; + } + + /** + * Returns whether this cron task should run now, because enough time + * has passed since it was last run. + * + * Forum pruning interval is specified in the forum data. + * + * @return bool + */ + public function should_run() + { + return $this->forum_data['enable_shadow_prune'] && $this->forum_data['prune_shadow_next'] < time(); + } + + /** + * Returns parameters of this cron task as an array. + * The array has one key, f, whose value is id of the forum to be pruned. + * + * @return array + */ + public function get_parameters() + { + return array('f' => $this->forum_data['forum_id']); + } + + /** + * Parses parameters found in $request, which is an instance of + * \phpbb\request\request_interface. + * + * It is expected to have a key f whose value is id of the forum to be pruned. + * + * @param \phpbb\request\request_interface $request Request object. + * + * @return null + */ + public function parse_parameters(\phpbb\request\request_interface $request) + { + $this->forum_data = null; + if ($request->is_set('f')) + { + $forum_id = $request->variable('f', 0); + + $sql = 'SELECT forum_id, prune_shadow_next, enable_shadow_prune, prune_shadow_days, forum_flags, prune_shadow_freq + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if ($row) + { + $this->forum_data = $row; + } + } + } + + /** + * Automatically prune shadow topics + * Based on fuunction auto_prune() + * @param int $forum_id Forum ID of forum that should be pruned + * @param string $prune_mode Prune mode + * @param int $prune_flags Prune flags + * @param int $prune_days Prune date in days + * @param int $prune_freq Prune frequency + * @return null + */ + protected function auto_prune_shadow_topics($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_freq) + { + $sql = 'SELECT forum_name + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $this->db->sql_query($sql, 3600); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if ($row) + { + $prune_date = time() - ($prune_days * 86400); + $next_prune = time() + ($prune_freq * 86400); + + prune($forum_id, $prune_mode, $prune_date, $prune_flags, true); + + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET prune_shadow_next = $next_prune + WHERE forum_id = $forum_id"; + $this->db->sql_query($sql); + + $user_id = (empty($this->user->data)) ? ANONYMOUS : $this->user->data['user_id']; + $user_ip = (empty($this->user->ip)) ? '' : $this->user->ip; + + $this->log->add('admin', $user_id, $user_ip, 'LOG_PRUNE_SHADOW', false, array($row['forum_name'])); + } + + return; + } +} diff --git a/sources/phpBB/phpbb/cron/task/core/queue.php b/sources/phpBB/phpbb/cron/task/core/queue.php new file mode 100644 index 0000000..a9345a4 --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/core/queue.php @@ -0,0 +1,78 @@ + +* @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\cron\task\core; + +/** +* Queue cron task. Sends email and jabber messages queued by other scripts. +*/ +class queue extends \phpbb\cron\task\base +{ + protected $phpbb_root_path; + protected $php_ext; + protected $config; + + /** + * Constructor. + * + * @param string $phpbb_root_path The root path + * @param string $php_ext PHP file extension + * @param \phpbb\config\config $config The config + */ + public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->config = $config; + } + + /** + * Runs this cron task. + * + * @return null + */ + public function run() + { + if (!class_exists('queue')) + { + include($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext); + } + $queue = new \queue(); + $queue->process(); + } + + /** + * Returns whether this cron task can run, given current board configuration. + * + * Queue task is only run if the email queue (file) exists. + * + * @return bool + */ + public function is_runnable() + { + return file_exists($this->phpbb_root_path . 'cache/queue.' . $this->php_ext); + } + + /** + * Returns whether this cron task should run now, because enough time + * has passed since it was last run. + * + * The interval between queue runs is specified in board configuration. + * + * @return bool + */ + public function should_run() + { + return $this->config['last_queue_run'] < time() - $this->config['queue_interval']; + } +} diff --git a/sources/phpBB/phpbb/cron/task/core/tidy_cache.php b/sources/phpBB/phpbb/cron/task/core/tidy_cache.php new file mode 100644 index 0000000..506a245 --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/core/tidy_cache.php @@ -0,0 +1,72 @@ + +* @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\cron\task\core; + +/** +* Tidy cache cron task. +*/ +class tidy_cache extends \phpbb\cron\task\base +{ + protected $config; + protected $cache; + + /** + * Constructor. + * + * @param \phpbb\config\config $config The config + * @param \phpbb\cache\driver\driver_interface $cache The cache driver + */ + public function __construct(\phpbb\config\config $config, \phpbb\cache\driver\driver_interface $cache) + { + $this->config = $config; + $this->cache = $cache; + } + + /** + * Runs this cron task. + * + * @return null + */ + public function run() + { + $this->cache->tidy(); + } + + /** + * Returns whether this cron task can run, given current board configuration. + * + * Tidy cache cron task runs if the cache implementation in use + * supports tidying. + * + * @return bool + */ + public function is_runnable() + { + return true; + } + + /** + * Returns whether this cron task should run now, because enough time + * has passed since it was last run. + * + * The interval between cache tidying is specified in board + * configuration. + * + * @return bool + */ + public function should_run() + { + return $this->config['cache_last_gc'] < time() - $this->config['cache_gc']; + } +} diff --git a/sources/phpBB/phpbb/cron/task/core/tidy_database.php b/sources/phpBB/phpbb/cron/task/core/tidy_database.php new file mode 100644 index 0000000..949bba8 --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/core/tidy_database.php @@ -0,0 +1,66 @@ + +* @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\cron\task\core; + +/** +* Tidy database cron task. +*/ +class tidy_database extends \phpbb\cron\task\base +{ + protected $phpbb_root_path; + protected $php_ext; + protected $config; + + /** + * Constructor. + * + * @param string $phpbb_root_path The root path + * @param string $php_ext The PHP file extension + * @param \phpbb\config\config $config The config + */ + public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->config = $config; + } + + /** + * Runs this cron task. + * + * @return null + */ + public function run() + { + if (!function_exists('tidy_database')) + { + include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext); + } + tidy_database(); + } + + /** + * Returns whether this cron task should run now, because enough time + * has passed since it was last run. + * + * The interval between database tidying is specified in board + * configuration. + * + * @return bool + */ + public function should_run() + { + return $this->config['database_last_gc'] < time() - $this->config['database_gc']; + } +} diff --git a/sources/phpBB/phpbb/cron/task/core/tidy_plupload.php b/sources/phpBB/phpbb/cron/task/core/tidy_plupload.php new file mode 100644 index 0000000..b6aeecf --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/core/tidy_plupload.php @@ -0,0 +1,118 @@ + +* @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\cron\task\core; + +/** +* Cron task for cleaning plupload's temporary upload directory. +*/ +class tidy_plupload extends \phpbb\cron\task\base +{ + /** + * How old a file must be (in seconds) before it is deleted. + * @var int + */ + protected $max_file_age = 86400; + + /** + * How often we run the cron (in seconds). + * @var int + */ + protected $cron_frequency = 86400; + + /** + * phpBB root path + * @var string + */ + protected $phpbb_root_path; + + /** + * Config object + * @var \phpbb\config\config + */ + protected $config; + + /** + * Directory where plupload stores temporary files. + * @var string + */ + protected $plupload_upload_path; + + /** + * Constructor. + * + * @param string $phpbb_root_path The root path + * @param \phpbb\config\config $config The config + */ + public function __construct($phpbb_root_path, \phpbb\config\config $config) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->config = $config; + + $this->plupload_upload_path = $this->phpbb_root_path . $this->config['upload_path'] . '/plupload'; + } + + /** + * {@inheritDoc} + */ + public function run() + { + // Remove old temporary file (perhaps failed uploads?) + $last_valid_timestamp = time() - $this->max_file_age; + try + { + $iterator = new \DirectoryIterator($this->plupload_upload_path); + foreach ($iterator as $file) + { + if (strpos($file->getBasename(), $this->config['plupload_salt']) !== 0) + { + // Skip over any non-plupload files. + continue; + } + + if ($file->getMTime() < $last_valid_timestamp) + { + @unlink($file->getPathname()); + } + } + } + catch (\UnexpectedValueException $e) + { + add_log( + 'critical', + 'LOG_PLUPLOAD_TIDY_FAILED', + $this->plupload_upload_path, + $e->getMessage(), + $e->getTraceAsString() + ); + } + + $this->config->set('plupload_last_gc', time(), true); + } + + /** + * {@inheritDoc} + */ + public function is_runnable() + { + return !empty($this->config['plupload_salt']) && is_dir($this->plupload_upload_path); + } + + /** + * {@inheritDoc} + */ + public function should_run() + { + return $this->config['plupload_last_gc'] < time() - $this->cron_frequency; + } +} diff --git a/sources/phpBB/phpbb/cron/task/core/tidy_search.php b/sources/phpBB/phpbb/cron/task/core/tidy_search.php new file mode 100644 index 0000000..ce16b3f --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/core/tidy_search.php @@ -0,0 +1,96 @@ + +* @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\cron\task\core; + +/** +* Tidy search cron task. +* +* Will only run when the currently selected search backend supports tidying. +*/ +class tidy_search extends \phpbb\cron\task\base +{ + protected $phpbb_root_path; + protected $php_ext; + protected $auth; + protected $config; + protected $db; + protected $user; + + /** + * Constructor. + * + * @param string $phpbb_root_path The root path + * @param string $php_ext The PHP file extension + * @param \phpbb\auth\auth $auth The auth + * @param \phpbb\config\config $config The config + * @param \phpbb\db\driver\driver_interface $db The db connection + * @param \phpbb\user $user The user + */ + public function __construct($phpbb_root_path, $php_ext, \phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\user $user) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->auth = $auth; + $this->config = $config; + $this->db = $db; + $this->user = $user; + } + + /** + * Runs this cron task. + * + * @return null + */ + public function run() + { + $search_type = $this->config['search_type']; + + // We do some additional checks in the module to ensure it can actually be utilised + $error = false; + $search = new $search_type($error, $this->phpbb_root_path, $this->php_ext, $this->auth, $this->config, $this->db, $this->user); + + if (!$error) + { + $search->tidy(); + } + } + + /** + * Returns whether this cron task can run, given current board configuration. + * + * Search cron task is runnable in all normal use. It may not be + * runnable if the search backend implementation selected in board + * configuration does not exist. + * + * @return bool + */ + public function is_runnable() + { + return class_exists($this->config['search_type']); + } + + /** + * Returns whether this cron task should run now, because enough time + * has passed since it was last run. + * + * The interval between search tidying is specified in board + * configuration. + * + * @return bool + */ + public function should_run() + { + return $this->config['search_last_gc'] < time() - $this->config['search_gc']; + } +} diff --git a/sources/phpBB/phpbb/cron/task/core/tidy_sessions.php b/sources/phpBB/phpbb/cron/task/core/tidy_sessions.php new file mode 100644 index 0000000..5e6dabd --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/core/tidy_sessions.php @@ -0,0 +1,59 @@ + +* @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\cron\task\core; + +/** +* Tidy sessions cron task. +*/ +class tidy_sessions extends \phpbb\cron\task\base +{ + protected $config; + protected $user; + + /** + * Constructor. + * + * @param \phpbb\config\config $config The config + * @param \phpbb\user $user The user + */ + public function __construct(\phpbb\config\config $config, \phpbb\user $user) + { + $this->config = $config; + $this->user = $user; + } + + /** + * Runs this cron task. + * + * @return null + */ + public function run() + { + $this->user->session_gc(); + } + + /** + * Returns whether this cron task should run now, because enough time + * has passed since it was last run. + * + * The interval between session tidying is specified in board + * configuration. + * + * @return bool + */ + public function should_run() + { + return $this->config['session_last_gc'] < time() - $this->config['session_gc']; + } +} diff --git a/sources/phpBB/phpbb/cron/task/core/tidy_warnings.php b/sources/phpBB/phpbb/cron/task/core/tidy_warnings.php new file mode 100644 index 0000000..7b67eae --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/core/tidy_warnings.php @@ -0,0 +1,80 @@ + +* @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\cron\task\core; + +/** +* Tidy warnings cron task. +* +* Will only run when warnings are configured to expire. +*/ +class tidy_warnings extends \phpbb\cron\task\base +{ + protected $phpbb_root_path; + protected $php_ext; + protected $config; + + /** + * Constructor. + * + * @param string $phpbb_root_path The root path + * @param string $php_ext PHP file extension + * @param \phpbb\config\config $config The config + */ + public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->config = $config; + } + + /** + * Runs this cron task. + * + * @return null + */ + public function run() + { + if (!function_exists('tidy_warnings')) + { + include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext); + } + tidy_warnings(); + } + + /** + * Returns whether this cron task can run, given current board configuration. + * + * If warnings are set to never expire, this cron task will not run. + * + * @return bool + */ + public function is_runnable() + { + return (bool) $this->config['warnings_expire_days']; + } + + /** + * Returns whether this cron task should run now, because enough time + * has passed since it was last run. + * + * The interval between warnings tidying is specified in board + * configuration. + * + * @return bool + */ + public function should_run() + { + return $this->config['warnings_last_gc'] < time() - $this->config['warnings_gc']; + } +} diff --git a/sources/phpBB/phpbb/cron/task/parametrized.php b/sources/phpBB/phpbb/cron/task/parametrized.php new file mode 100644 index 0000000..7e190b9 --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/parametrized.php @@ -0,0 +1,48 @@ + +* @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\cron\task; + +/** +* Parametrized cron task interface. +* +* Parametrized cron tasks are somewhat of a cross between regular cron tasks and +* delayed jobs. Whereas regular cron tasks perform some action globally, +* parametrized cron tasks perform actions on a particular object (or objects). +* Parametrized cron tasks do not make sense and are not usable without +* specifying these objects. +*/ +interface parametrized extends \phpbb\cron\task\task +{ + /** + * Returns parameters of this cron task as an array. + * + * The array must map string keys to string values. + * + * @return array + */ + public function get_parameters(); + + /** + * Parses parameters found in $request, which is an instance of + * \phpbb\request\request_interface. + * + * $request contains user input and must not be trusted. + * Cron task must validate all data before using it. + * + * @param \phpbb\request\request_interface $request Request object. + * + * @return null + */ + public function parse_parameters(\phpbb\request\request_interface $request); +} diff --git a/sources/phpBB/phpbb/cron/task/task.php b/sources/phpBB/phpbb/cron/task/task.php new file mode 100644 index 0000000..6d5a383 --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/task.php @@ -0,0 +1,52 @@ + +* @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\cron\task; + +/** +* Cron task interface +*/ +interface task +{ + /** + * Returns the name of the task. + * + * @return string Name of wrapped task. + */ + public function get_name(); + + /** + * Runs this cron task. + * + * @return null + */ + public function run(); + + /** + * Returns whether this cron task can run, given current board configuration. + * + * For example, a cron task that prunes forums can only run when + * forum pruning is enabled. + * + * @return bool + */ + public function is_runnable(); + + /** + * Returns whether this cron task should run now, because enough time + * has passed since it was last run. + * + * @return bool + */ + public function should_run(); +} diff --git a/sources/phpBB/phpbb/cron/task/wrapper.php b/sources/phpBB/phpbb/cron/task/wrapper.php new file mode 100644 index 0000000..8a4a8b1 --- /dev/null +++ b/sources/phpBB/phpbb/cron/task/wrapper.php @@ -0,0 +1,106 @@ + +* @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\cron\task; + +/** +* Cron task wrapper class. +* Enhances cron tasks with convenience methods that work identically for all tasks. +*/ +class wrapper +{ + protected $task; + protected $phpbb_root_path; + protected $php_ext; + + /** + * Constructor. + * + * Wraps a task $task, which must implement cron_task interface. + * + * @param \phpbb\cron\task\task $task The cron task to wrap. + * @param string $phpbb_root_path Relative path to phpBB root + * @param string $php_ext PHP file extension + */ + public function __construct(\phpbb\cron\task\task $task, $phpbb_root_path, $php_ext) + { + $this->task = $task; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + } + + /** + * Returns whether the wrapped task is parametrised. + * + * Parametrized tasks accept parameters during initialization and must + * normally be scheduled with parameters. + * + * @return bool Whether or not this task is parametrized. + */ + public function is_parametrized() + { + return $this->task instanceof \phpbb\cron\task\parametrized; + } + + /** + * Returns whether the wrapped task is ready to run. + * + * A task is ready to run when it is runnable according to current configuration + * and enough time has passed since it was last run. + * + * @return bool Whether the wrapped task is ready to run. + */ + public function is_ready() + { + return $this->task->is_runnable() && $this->task->should_run(); + } + + /** + * Returns a url through which this task may be invoked via web. + * + * When system cron is not in use, running a cron task is accomplished + * by outputting an image with the url returned by this function as + * source. + * + * @return string URL through which this task may be invoked. + */ + public function get_url() + { + $name = $this->get_name(); + if ($this->is_parametrized()) + { + $params = $this->task->get_parameters(); + $extra = ''; + foreach ($params as $key => $value) + { + $extra .= '&' . $key . '=' . urlencode($value); + } + } + else + { + $extra = ''; + } + $url = append_sid($this->phpbb_root_path . 'cron.' . $this->php_ext, 'cron_type=' . $name . $extra); + return $url; + } + + /** + * Forwards all other method calls to the wrapped task implementation. + * + * @return mixed + */ + public function __call($name, $args) + { + return call_user_func_array(array($this->task, $name), $args); + } +} diff --git a/sources/phpBB/phpbb/datetime.php b/sources/phpBB/phpbb/datetime.php new file mode 100644 index 0000000..63cdba9 --- /dev/null +++ b/sources/phpBB/phpbb/datetime.php @@ -0,0 +1,168 @@ + +* @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; + +/** +* phpBB custom extensions to the PHP DateTime class +* This handles the relative formats phpBB employs +*/ +class datetime extends \DateTime +{ + /** + * String used to wrap the date segment which should be replaced by today/tomorrow/yesterday + */ + const RELATIVE_WRAPPER = '|'; + + /** + * @var user User who is the context for this DateTime instance + */ + protected $user; + + /** + * @var array Date formats are preprocessed by phpBB, to save constant recalculation they are cached. + */ + static protected $format_cache = array(); + + /** + * Constructs a new instance of \phpbb\datetime, expanded to include an argument to inject + * the user context and modify the timezone to the users selected timezone if one is not set. + * + * @param user $user object for context. + * @param string $time String in a format accepted by strtotime(). + * @param \DateTimeZone $timezone Time zone of the time. + */ + public function __construct($user, $time = 'now', \DateTimeZone $timezone = null) + { + $this->user = $user; + $timezone = $timezone ?: $this->user->timezone; + + parent::__construct($time, $timezone); + } + + /** + * Formats the current date time into the specified format + * + * @param string $format Optional format to use for output, defaults to users chosen format + * @param boolean $force_absolute Force output of a non relative date + * @return string Formatted date time + */ + public function format($format = '', $force_absolute = false) + { + $format = $format ? $format : $this->user->date_format; + $format = self::format_cache($format, $this->user); + $relative = ($format['is_short'] && !$force_absolute); + $now = new self($this->user, 'now', $this->user->timezone); + + $timestamp = $this->getTimestamp(); + $now_ts = $now->getTimeStamp(); + + $delta = $now_ts - $timestamp; + + if ($relative) + { + /* + * Check the delta is less than or equal to 1 hour + * and the delta not more than a minute in the past + * and the delta is either greater than -5 seconds or timestamp + * and current time are of the same minute (they must be in the same hour already) + * finally check that relative dates are supported by the language pack + */ + if ($delta <= 3600 && $delta > -60 && + ($delta >= -5 || (($now_ts / 60) % 60) == (($timestamp / 60) % 60)) + && isset($this->user->lang['datetime']['AGO'])) + { + return $this->user->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60))); + } + else + { + $midnight = clone $now; + $midnight->setTime(0, 0, 0); + + $midnight = $midnight->getTimestamp(); + + if ($timestamp <= $midnight + 2 * 86400) + { + $day = false; + + if ($timestamp > $midnight + 86400) + { + $day = 'TOMORROW'; + } + else if ($timestamp > $midnight) + { + $day = 'TODAY'; + } + else if ($timestamp > $midnight - 86400) + { + $day = 'YESTERDAY'; + } + + if ($day !== false) + { + // Format using the short formatting and finally swap out the relative token placeholder with the correct value + return str_replace(self::RELATIVE_WRAPPER . self::RELATIVE_WRAPPER, $this->user->lang['datetime'][$day], strtr(parent::format($format['format_short']), $format['lang'])); + } + } + } + } + + return strtr(parent::format($format['format_long']), $format['lang']); + } + + /** + * Magic method to convert DateTime object to string + * + * @return string Formatted date time, according to the users default settings. + */ + public function __toString() + { + return $this->format(); + } + + /** + * Pre-processes the specified date format + * + * @param string $format Output format + * @param user $user User object to use for localisation + * @return array Processed date format + */ + static protected function format_cache($format, $user) + { + $lang = $user->lang_name; + + if (!isset(self::$format_cache[$lang])) + { + self::$format_cache[$lang] = array(); + } + + if (!isset(self::$format_cache[$lang][$format])) + { + // Is the user requesting a friendly date format (i.e. 'Today 12:42')? + self::$format_cache[$lang][$format] = array( + 'is_short' => strpos($format, self::RELATIVE_WRAPPER) !== false, + 'format_short' => substr($format, 0, strpos($format, self::RELATIVE_WRAPPER)) . self::RELATIVE_WRAPPER . self::RELATIVE_WRAPPER . substr(strrchr($format, self::RELATIVE_WRAPPER), 1), + 'format_long' => str_replace(self::RELATIVE_WRAPPER, '', $format), + 'lang' => array_filter($user->lang['datetime'], 'is_string'), + ); + + // Short representation of month in format? Some languages use different terms for the long and short format of May + if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false)) + { + self::$format_cache[$lang][$format]['lang']['May'] = $user->lang['datetime']['May_short']; + } + } + + return self::$format_cache[$lang][$format]; + } +} diff --git a/sources/phpBB/phpbb/db/driver/driver.php b/sources/phpBB/phpbb/db/driver/driver.php new file mode 100644 index 0000000..9fc04d4 --- /dev/null +++ b/sources/phpBB/phpbb/db/driver/driver.php @@ -0,0 +1,1077 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\driver; + +/** +* Database Abstraction Layer +*/ +abstract class driver implements driver_interface +{ + var $db_connect_id; + var $query_result; + var $return_on_error = false; + var $transaction = false; + var $sql_time = 0; + var $num_queries = array(); + var $open_queries = array(); + + var $curtime = 0; + var $query_hold = ''; + var $html_hold = ''; + var $sql_report = ''; + + var $persistency = false; + var $user = ''; + var $server = ''; + var $dbname = ''; + + // Set to true if error triggered + var $sql_error_triggered = false; + + // Holding the last sql query on sql error + var $sql_error_sql = ''; + // Holding the error information - only populated if sql_error_triggered is set + var $sql_error_returned = array(); + + // Holding transaction count + var $transactions = 0; + + // Supports multi inserts? + var $multi_insert = false; + + /** + * Current sql layer + */ + var $sql_layer = ''; + + /** + * Wildcards for matching any (%) or exactly one (_) character within LIKE expressions + */ + var $any_char; + var $one_char; + + /** + * Exact version of the DBAL, directly queried + */ + var $sql_server_version = false; + + /** + * Constructor + */ + function __construct() + { + $this->num_queries = array( + 'cached' => 0, + 'normal' => 0, + 'total' => 0, + ); + + // Fill default sql layer based on the class being called. + // This can be changed by the specified layer itself later if needed. + $this->sql_layer = substr(get_class($this), strlen('phpbb\db\driver\\')); + + // Do not change this please! This variable is used to easy the use of it - and is hardcoded. + $this->any_char = chr(0) . '%'; + $this->one_char = chr(0) . '_'; + } + + /** + * {@inheritdoc} + */ + public function get_sql_layer() + { + return $this->sql_layer; + } + + /** + * {@inheritdoc} + */ + public function get_db_name() + { + return $this->dbname; + } + + /** + * {@inheritdoc} + */ + public function get_any_char() + { + return $this->any_char; + } + + /** + * {@inheritdoc} + */ + public function get_one_char() + { + return $this->one_char; + } + + /** + * {@inheritdoc} + */ + public function get_db_connect_id() + { + return $this->db_connect_id; + } + + /** + * {@inheritdoc} + */ + public function get_sql_error_triggered() + { + return $this->sql_error_triggered; + } + + /** + * {@inheritdoc} + */ + public function get_sql_error_sql() + { + return $this->sql_error_sql; + } + + /** + * {@inheritdoc} + */ + public function get_transaction() + { + return $this->transaction; + } + + /** + * {@inheritdoc} + */ + public function get_sql_time() + { + return $this->sql_time; + } + + /** + * {@inheritdoc} + */ + public function get_sql_error_returned() + { + return $this->sql_error_returned; + } + + /** + * {@inheritdoc} + */ + public function get_multi_insert() + { + return $this->multi_insert; + } + + /** + * {@inheritdoc} + */ + public function set_multi_insert($multi_insert) + { + $this->multi_insert = $multi_insert; + } + + /** + * {@inheritDoc} + */ + function sql_return_on_error($fail = false) + { + $this->sql_error_triggered = false; + $this->sql_error_sql = ''; + + $this->return_on_error = $fail; + } + + /** + * {@inheritDoc} + */ + function sql_num_queries($cached = false) + { + return ($cached) ? $this->num_queries['cached'] : $this->num_queries['normal']; + } + + /** + * {@inheritDoc} + */ + function sql_add_num_queries($cached = false) + { + $this->num_queries['cached'] += ($cached !== false) ? 1 : 0; + $this->num_queries['normal'] += ($cached !== false) ? 0 : 1; + $this->num_queries['total'] += 1; + } + + /** + * {@inheritDoc} + */ + function sql_close() + { + if (!$this->db_connect_id) + { + return false; + } + + if ($this->transaction) + { + do + { + $this->sql_transaction('commit'); + } + while ($this->transaction); + } + + foreach ($this->open_queries as $query_id) + { + $this->sql_freeresult($query_id); + } + + // Connection closed correctly. Set db_connect_id to false to prevent errors + if ($result = $this->_sql_close()) + { + $this->db_connect_id = false; + } + + return $result; + } + + /** + * {@inheritDoc} + */ + function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + { + if (empty($query)) + { + return false; + } + + // Never use a negative total or offset + $total = ($total < 0) ? 0 : $total; + $offset = ($offset < 0) ? 0 : $offset; + + return $this->_sql_query_limit($query, $total, $offset, $cache_ttl); + } + + /** + * {@inheritDoc} + */ + function sql_fetchrowset($query_id = false) + { + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($query_id !== false) + { + $result = array(); + while ($row = $this->sql_fetchrow($query_id)) + { + $result[] = $row; + } + + return $result; + } + + return false; + } + + /** + * {@inheritDoc} + */ + function sql_rowseek($rownum, &$query_id) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && $cache->sql_exists($query_id)) + { + return $cache->sql_rowseek($rownum, $query_id); + } + + if ($query_id === false) + { + return false; + } + + $this->sql_freeresult($query_id); + $query_id = $this->sql_query($this->last_query_text); + + if ($query_id === false) + { + return false; + } + + // We do not fetch the row for rownum == 0 because then the next resultset would be the second row + for ($i = 0; $i < $rownum; $i++) + { + if (!$this->sql_fetchrow($query_id)) + { + return false; + } + } + + return true; + } + + /** + * {@inheritDoc} + */ + function sql_fetchfield($field, $rownum = false, $query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($query_id !== false) + { + if ($rownum !== false) + { + $this->sql_rowseek($rownum, $query_id); + } + + if ($cache && !is_object($query_id) && $cache->sql_exists($query_id)) + { + return $cache->sql_fetchfield($query_id, $field); + } + + $row = $this->sql_fetchrow($query_id); + return (isset($row[$field])) ? $row[$field] : false; + } + + return false; + } + + /** + * {@inheritDoc} + */ + function sql_like_expression($expression) + { + $expression = utf8_str_replace(array('_', '%'), array("\_", "\%"), $expression); + $expression = utf8_str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression); + + return $this->_sql_like_expression('LIKE \'' . $this->sql_escape($expression) . '\''); + } + + /** + * {@inheritDoc} + */ + function sql_not_like_expression($expression) + { + $expression = utf8_str_replace(array('_', '%'), array("\_", "\%"), $expression); + $expression = utf8_str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression); + + return $this->_sql_not_like_expression('NOT LIKE \'' . $this->sql_escape($expression) . '\''); + } + + /** + * {@inheritDoc} + */ + public function sql_case($condition, $action_true, $action_false = false) + { + $sql_case = 'CASE WHEN ' . $condition; + $sql_case .= ' THEN ' . $action_true; + $sql_case .= ($action_false !== false) ? ' ELSE ' . $action_false : ''; + $sql_case .= ' END'; + return $sql_case; + } + + /** + * {@inheritDoc} + */ + public function sql_concatenate($expr1, $expr2) + { + return $expr1 . ' || ' . $expr2; + } + + /** + * {@inheritDoc} + */ + function sql_buffer_nested_transactions() + { + return false; + } + + /** + * {@inheritDoc} + */ + function sql_transaction($status = 'begin') + { + switch ($status) + { + case 'begin': + // If we are within a transaction we will not open another one, but enclose the current one to not loose data (preventing auto commit) + if ($this->transaction) + { + $this->transactions++; + return true; + } + + $result = $this->_sql_transaction('begin'); + + if (!$result) + { + $this->sql_error(); + } + + $this->transaction = true; + break; + + case 'commit': + // If there was a previously opened transaction we do not commit yet... + // but count back the number of inner transactions + if ($this->transaction && $this->transactions) + { + $this->transactions--; + return true; + } + + // Check if there is a transaction (no transaction can happen if + // there was an error, with a combined rollback and error returning enabled) + // This implies we have transaction always set for autocommit db's + if (!$this->transaction) + { + return false; + } + + $result = $this->_sql_transaction('commit'); + + if (!$result) + { + $this->sql_error(); + } + + $this->transaction = false; + $this->transactions = 0; + break; + + case 'rollback': + $result = $this->_sql_transaction('rollback'); + $this->transaction = false; + $this->transactions = 0; + break; + + default: + $result = $this->_sql_transaction($status); + break; + } + + return $result; + } + + /** + * {@inheritDoc} + */ + function sql_build_array($query, $assoc_ary = false) + { + if (!is_array($assoc_ary)) + { + return false; + } + + $fields = $values = array(); + + if ($query == 'INSERT' || $query == 'INSERT_SELECT') + { + foreach ($assoc_ary as $key => $var) + { + $fields[] = $key; + + if (is_array($var) && is_string($var[0])) + { + // This is used for INSERT_SELECT(s) + $values[] = $var[0]; + } + else + { + $values[] = $this->_sql_validate_value($var); + } + } + + $query = ($query == 'INSERT') ? ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')' : ' (' . implode(', ', $fields) . ') SELECT ' . implode(', ', $values) . ' '; + } + else if ($query == 'MULTI_INSERT') + { + trigger_error('The MULTI_INSERT query value is no longer supported. Please use sql_multi_insert() instead.', E_USER_ERROR); + } + else if ($query == 'UPDATE' || $query == 'SELECT' || $query == 'DELETE') + { + $values = array(); + foreach ($assoc_ary as $key => $var) + { + $values[] = "$key = " . $this->_sql_validate_value($var); + } + $query = implode(($query == 'UPDATE') ? ', ' : ' AND ', $values); + } + + return $query; + } + + /** + * {@inheritDoc} + */ + function sql_in_set($field, $array, $negate = false, $allow_empty_set = false) + { + if (!sizeof($array)) + { + if (!$allow_empty_set) + { + // Print the backtrace to help identifying the location of the problematic code + $this->sql_error('No values specified for SQL IN comparison'); + } + else + { + // NOT IN () actually means everything so use a tautology + if ($negate) + { + return '1=1'; + } + // IN () actually means nothing so use a contradiction + else + { + return '1=0'; + } + } + } + + if (!is_array($array)) + { + $array = array($array); + } + + if (sizeof($array) == 1) + { + @reset($array); + $var = current($array); + + return $field . ($negate ? ' <> ' : ' = ') . $this->_sql_validate_value($var); + } + else + { + return $field . ($negate ? ' NOT IN ' : ' IN ') . '(' . implode(', ', array_map(array($this, '_sql_validate_value'), $array)) . ')'; + } + } + + /** + * {@inheritDoc} + */ + function sql_bit_and($column_name, $bit, $compare = '') + { + if (method_exists($this, '_sql_bit_and')) + { + return $this->_sql_bit_and($column_name, $bit, $compare); + } + + return $column_name . ' & ' . (1 << $bit) . (($compare) ? ' ' . $compare : ''); + } + + /** + * {@inheritDoc} + */ + function sql_bit_or($column_name, $bit, $compare = '') + { + if (method_exists($this, '_sql_bit_or')) + { + return $this->_sql_bit_or($column_name, $bit, $compare); + } + + return $column_name . ' | ' . (1 << $bit) . (($compare) ? ' ' . $compare : ''); + } + + /** + * {@inheritDoc} + */ + function cast_expr_to_bigint($expression) + { + return $expression; + } + + /** + * {@inheritDoc} + */ + function cast_expr_to_string($expression) + { + return $expression; + } + + /** + * {@inheritDoc} + */ + function sql_lower_text($column_name) + { + return "LOWER($column_name)"; + } + + /** + * {@inheritDoc} + */ + function sql_multi_insert($table, $sql_ary) + { + if (!sizeof($sql_ary)) + { + return false; + } + + if ($this->multi_insert) + { + $ary = array(); + foreach ($sql_ary as $id => $_sql_ary) + { + // If by accident the sql array is only one-dimensional we build a normal insert statement + if (!is_array($_sql_ary)) + { + return $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $sql_ary)); + } + + $values = array(); + foreach ($_sql_ary as $key => $var) + { + $values[] = $this->_sql_validate_value($var); + } + $ary[] = '(' . implode(', ', $values) . ')'; + } + + return $this->sql_query('INSERT INTO ' . $table . ' ' . ' (' . implode(', ', array_keys($sql_ary[0])) . ') VALUES ' . implode(', ', $ary)); + } + else + { + foreach ($sql_ary as $ary) + { + if (!is_array($ary)) + { + return false; + } + + $result = $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $ary)); + + if (!$result) + { + return false; + } + } + } + + return true; + } + + /** + * Function for validating values + * @access private + */ + function _sql_validate_value($var) + { + if (is_null($var)) + { + return 'NULL'; + } + else if (is_string($var)) + { + return "'" . $this->sql_escape($var) . "'"; + } + else + { + return (is_bool($var)) ? intval($var) : $var; + } + } + + /** + * {@inheritDoc} + */ + function sql_build_query($query, $array) + { + $sql = ''; + switch ($query) + { + case 'SELECT': + case 'SELECT_DISTINCT'; + + $sql = str_replace('_', ' ', $query) . ' ' . $array['SELECT'] . ' FROM '; + + // Build table array. We also build an alias array for later checks. + $table_array = $aliases = array(); + $used_multi_alias = false; + + foreach ($array['FROM'] as $table_name => $alias) + { + if (is_array($alias)) + { + $used_multi_alias = true; + + foreach ($alias as $multi_alias) + { + $table_array[] = $table_name . ' ' . $multi_alias; + $aliases[] = $multi_alias; + } + } + else + { + $table_array[] = $table_name . ' ' . $alias; + $aliases[] = $alias; + } + } + + // We run the following code to determine if we need to re-order the table array. ;) + // The reason for this is that for multi-aliased tables (two equal tables) in the FROM statement the last table need to match the first comparison. + // DBMS who rely on this: Oracle, PostgreSQL and MSSQL. For all other DBMS it makes absolutely no difference in which order the table is. + if (!empty($array['LEFT_JOIN']) && sizeof($array['FROM']) > 1 && $used_multi_alias !== false) + { + // Take first LEFT JOIN + $join = current($array['LEFT_JOIN']); + + // Determine the table used there (even if there are more than one used, we only want to have one + preg_match('/(' . implode('|', $aliases) . ')\.[^\s]+/U', str_replace(array('(', ')', 'AND', 'OR', ' '), '', $join['ON']), $matches); + + // If there is a first join match, we need to make sure the table order is correct + if (!empty($matches[1])) + { + $first_join_match = trim($matches[1]); + $table_array = $last = array(); + + foreach ($array['FROM'] as $table_name => $alias) + { + if (is_array($alias)) + { + foreach ($alias as $multi_alias) + { + ($multi_alias === $first_join_match) ? $last[] = $table_name . ' ' . $multi_alias : $table_array[] = $table_name . ' ' . $multi_alias; + } + } + else + { + ($alias === $first_join_match) ? $last[] = $table_name . ' ' . $alias : $table_array[] = $table_name . ' ' . $alias; + } + } + + $table_array = array_merge($table_array, $last); + } + } + + $sql .= $this->_sql_custom_build('FROM', implode(' CROSS JOIN ', $table_array)); + + if (!empty($array['LEFT_JOIN'])) + { + foreach ($array['LEFT_JOIN'] as $join) + { + $sql .= ' LEFT JOIN ' . key($join['FROM']) . ' ' . current($join['FROM']) . ' ON (' . $join['ON'] . ')'; + } + } + + if (!empty($array['WHERE'])) + { + $sql .= ' WHERE ' . $this->_sql_custom_build('WHERE', $array['WHERE']); + } + + if (!empty($array['GROUP_BY'])) + { + $sql .= ' GROUP BY ' . $array['GROUP_BY']; + } + + if (!empty($array['ORDER_BY'])) + { + $sql .= ' ORDER BY ' . $array['ORDER_BY']; + } + + break; + } + + return $sql; + } + + /** + * {@inheritDoc} + */ + function sql_error($sql = '') + { + global $auth, $user, $config; + + // Set var to retrieve errored status + $this->sql_error_triggered = true; + $this->sql_error_sql = $sql; + + $this->sql_error_returned = $this->_sql_error(); + + if (!$this->return_on_error) + { + $message = 'SQL ERROR [ ' . $this->sql_layer . ' ]

' . $this->sql_error_returned['message'] . ' [' . $this->sql_error_returned['code'] . ']'; + + // Show complete SQL error and path to administrators only + // Additionally show complete error on installation or if extended debug mode is enabled + // The DEBUG constant is for development only! + if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG')) + { + $message .= ($sql) ? '

SQL

' . htmlspecialchars($sql) : ''; + } + else + { + // If error occurs in initiating the session we need to use a pre-defined language string + // This could happen if the connection could not be established for example (then we are not able to grab the default language) + if (!isset($user->lang['SQL_ERROR_OCCURRED'])) + { + $message .= '

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.'; + } + else + { + if (!empty($config['board_contact'])) + { + $message .= '

' . sprintf($user->lang['SQL_ERROR_OCCURRED'], '', ''); + } + else + { + $message .= '

' . sprintf($user->lang['SQL_ERROR_OCCURRED'], '', ''); + } + } + } + + if ($this->transaction) + { + $this->sql_transaction('rollback'); + } + + if (strlen($message) > 1024) + { + // We need to define $msg_long_text here to circumvent text stripping. + global $msg_long_text; + $msg_long_text = $message; + + trigger_error(false, E_USER_ERROR); + } + + trigger_error($message, E_USER_ERROR); + } + + if ($this->transaction) + { + $this->sql_transaction('rollback'); + } + + return $this->sql_error_returned; + } + + /** + * {@inheritDoc} + */ + function sql_report($mode, $query = '') + { + global $cache, $starttime, $phpbb_root_path, $phpbb_path_helper, $user; + global $request; + + if (is_object($request) && !$request->variable('explain', false)) + { + return false; + } + + if (!$query && $this->query_hold != '') + { + $query = $this->query_hold; + } + + switch ($mode) + { + case 'display': + if (!empty($cache)) + { + $cache->unload(); + } + $this->sql_close(); + + $mtime = explode(' ', microtime()); + $totaltime = $mtime[0] + $mtime[1] - $starttime; + + echo ' + + + + SQL Report + + + +
+ +
+
+
+ +
+

SQL Report

+
+

Page generated in ' . round($totaltime, 4) . " seconds with {$this->num_queries['normal']} queries" . (($this->num_queries['cached']) ? " + {$this->num_queries['cached']} " . (($this->num_queries['cached'] == 1) ? 'query' : 'queries') . ' returning data from cache' : '') . '

+ +

Time spent on ' . $this->sql_layer . ' queries: ' . round($this->sql_time, 5) . 's | Time spent on PHP: ' . round($totaltime - $this->sql_time, 5) . 's

+ +

+ ' . $this->sql_report . ' +
+ +
+
+
+ +
+ + '; + + exit_handler(); + + break; + + case 'stop': + $endtime = explode(' ', microtime()); + $endtime = $endtime[0] + $endtime[1]; + + $this->sql_report .= ' + + + + + + + + + + + + +
Query #' . $this->num_queries['total'] . '
+ + ' . $this->html_hold . ' + +

+ '; + + if ($this->query_result) + { + if (preg_match('/^(UPDATE|DELETE|REPLACE)/', $query)) + { + $this->sql_report .= 'Affected rows: ' . $this->sql_affectedrows($this->query_result) . ' | '; + } + $this->sql_report .= 'Before: ' . sprintf('%.5f', $this->curtime - $starttime) . 's | After: ' . sprintf('%.5f', $endtime - $starttime) . 's | Elapsed: ' . sprintf('%.5f', $endtime - $this->curtime) . 's'; + } + else + { + $error = $this->sql_error(); + $this->sql_report .= 'FAILED - ' . $this->sql_layer . ' Error ' . $error['code'] . ': ' . htmlspecialchars($error['message']); + } + + $this->sql_report .= '



'; + + $this->sql_time += $endtime - $this->curtime; + break; + + case 'start': + $this->query_hold = $query; + $this->html_hold = ''; + + $this->_sql_report($mode, $query); + + $this->curtime = explode(' ', microtime()); + $this->curtime = $this->curtime[0] + $this->curtime[1]; + + break; + + case 'add_select_row': + + $html_table = func_get_arg(2); + $row = func_get_arg(3); + + if (!$html_table && sizeof($row)) + { + $html_table = true; + $this->html_hold .= ''; + + foreach (array_keys($row) as $val) + { + $this->html_hold .= ''; + } + $this->html_hold .= ''; + } + $this->html_hold .= ''; + + $class = 'row1'; + foreach (array_values($row) as $val) + { + $class = ($class == 'row1') ? 'row2' : 'row1'; + $this->html_hold .= ''; + } + $this->html_hold .= ''; + + return $html_table; + + break; + + case 'fromcache': + + $this->_sql_report($mode, $query); + + break; + + case 'record_fromcache': + + $endtime = func_get_arg(2); + $splittime = func_get_arg(3); + + $time_cache = $endtime - $this->curtime; + $time_db = $splittime - $endtime; + $color = ($time_db > $time_cache) ? 'green' : 'red'; + + $this->sql_report .= '
' . (($val) ? ucwords(str_replace('_', ' ', $val)) : ' ') . '
' . (($val) ? $val : ' ') . '
'; + $this->sql_report .= '
Query results obtained from the cache
'; + $this->sql_report .= '

'; + $this->sql_report .= 'Before: ' . sprintf('%.5f', $this->curtime - $starttime) . 's | After: ' . sprintf('%.5f', $endtime - $starttime) . 's | Elapsed [cache]: ' . sprintf('%.5f', ($time_cache)) . 's | Elapsed [db]: ' . sprintf('%.5f', $time_db) . 's



'; + + // Pad the start time to not interfere with page timing + $starttime += $time_db; + + break; + + default: + + $this->_sql_report($mode, $query); + + break; + } + + return true; + } + + /** + * {@inheritDoc} + */ + function get_estimated_row_count($table_name) + { + return $this->get_row_count($table_name); + } + + /** + * {@inheritDoc} + */ + function get_row_count($table_name) + { + $sql = 'SELECT COUNT(*) AS rows_total + FROM ' . $this->sql_escape($table_name); + $result = $this->sql_query($sql); + $rows_total = $this->sql_fetchfield('rows_total'); + $this->sql_freeresult($result); + + return $rows_total; + } +} diff --git a/sources/phpBB/phpbb/db/driver/driver_interface.php b/sources/phpBB/phpbb/db/driver/driver_interface.php new file mode 100644 index 0000000..8b487c5 --- /dev/null +++ b/sources/phpBB/phpbb/db/driver/driver_interface.php @@ -0,0 +1,453 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\driver; + +interface driver_interface +{ + /** + * Gets the name of the sql layer. + * + * @return string + */ + public function get_sql_layer(); + + /** + * Gets the name of the database. + * + * @return string + */ + public function get_db_name(); + + /** + * Wildcards for matching any (%) character within LIKE expressions + * + * @return string + */ + public function get_any_char(); + + /** + * Wildcards for matching exactly one (_) character within LIKE expressions + * + * @return string + */ + public function get_one_char(); + + /** + * Gets the time spent into the queries + * + * @return int + */ + public function get_sql_time(); + + /** + * Gets the connect ID. + * + * @return mixed + */ + public function get_db_connect_id(); + + /** + * Indicates if an error was triggered. + * + * @return bool + */ + public function get_sql_error_triggered(); + + /** + * Gets the last faulty query + * + * @return string + */ + public function get_sql_error_sql(); + + /** + * Indicates if we are in a transaction. + * + * @return bool + */ + public function get_transaction(); + + /** + * Gets the returned error. + * + * @return array + */ + public function get_sql_error_returned(); + + /** + * Indicates if multiple insertion can be used + * + * @return bool + */ + public function get_multi_insert(); + + /** + * Set if multiple insertion can be used + * + * @param bool $multi_insert + */ + public function set_multi_insert($multi_insert); + + /** + * Gets the exact number of rows in a specified table. + * + * @param string $table_name Table name + * @return string Exact number of rows in $table_name. + */ + public function get_row_count($table_name); + + /** + * Gets the estimated number of rows in a specified table. + * + * @param string $table_name Table name + * @return string Number of rows in $table_name. + * Prefixed with ~ if estimated (otherwise exact). + */ + public function get_estimated_row_count($table_name); + + /** + * Run LOWER() on DB column of type text (i.e. neither varchar nor char). + * + * @param string $column_name The column name to use + * @return string A SQL statement like "LOWER($column_name)" + */ + public function sql_lower_text($column_name); + + /** + * Display sql error page + * + * @param string $sql The SQL query causing the error + * @return mixed Returns the full error message, if $this->return_on_error + * is set, null otherwise + */ + public function sql_error($sql = ''); + + /** + * Returns whether results of a query need to be buffered to run a + * transaction while iterating over them. + * + * @return bool Whether buffering is required. + */ + public function sql_buffer_nested_transactions(); + + /** + * Run binary OR operator on DB column. + * + * @param string $column_name The column name to use + * @param int $bit The value to use for the OR operator, + * will be converted to (1 << $bit). Is used by options, + * using the number schema... 0, 1, 2...29 + * @param string $compare Any custom SQL code after the check (e.g. "= 0") + * @return string A SQL statement like "$column | (1 << $bit) {$compare}" + */ + public function sql_bit_or($column_name, $bit, $compare = ''); + + /** + * Version information about used database + * + * @param bool $raw Only return the fetched sql_server_version + * @param bool $use_cache Is it safe to retrieve the value from the cache + * @return string sql server version + */ + public function sql_server_info($raw = false, $use_cache = true); + + /** + * Return on error or display error message + * + * @param bool $fail Should we return on errors, or stop + * @return null + */ + public function sql_return_on_error($fail = false); + + /** + * Build sql statement from an array + * + * @param string $query Should be on of the following strings: + * INSERT, INSERT_SELECT, UPDATE, SELECT, DELETE + * @param array $assoc_ary Array with "column => value" pairs + * @return string A SQL statement like "c1 = 'a' AND c2 = 'b'" + */ + public function sql_build_array($query, $assoc_ary = array()); + + /** + * Fetch all rows + * + * @param mixed $query_id Already executed query to get the rows from, + * if false, the last query will be used. + * @return mixed Nested array if the query had rows, false otherwise + */ + public function sql_fetchrowset($query_id = false); + + /** + * SQL Transaction + * + * @param string $status Should be one of the following strings: + * begin, commit, rollback + * @return mixed Buffered, seekable result handle, false on error + */ + public function sql_transaction($status = 'begin'); + + /** + * Build a concatenated expression + * + * @param string $expr1 Base SQL expression where we append the second one + * @param string $expr2 SQL expression that is appended to the first expression + * @return string Concatenated string + */ + public function sql_concatenate($expr1, $expr2); + + /** + * Build a case expression + * + * Note: The two statements action_true and action_false must have the same + * data type (int, vchar, ...) in the database! + * + * @param string $condition The condition which must be true, + * to use action_true rather then action_else + * @param string $action_true SQL expression that is used, if the condition is true + * @param mixed $action_false SQL expression that is used, if the condition is false + * @return string CASE expression including the condition and statements + */ + public function sql_case($condition, $action_true, $action_false = false); + + /** + * Build sql statement from array for select and select distinct statements + * + * Possible query values: SELECT, SELECT_DISTINCT + * + * @param string $query Should be one of: SELECT, SELECT_DISTINCT + * @param array $array Array with the query data: + * SELECT A comma imploded list of columns to select + * FROM Array with "table => alias" pairs, + * (alias can also be an array) + * Optional: LEFT_JOIN Array of join entries: + * FROM Table that should be joined + * ON Condition for the join + * Optional: WHERE Where SQL statement + * Optional: GROUP_BY Group by SQL statement + * Optional: ORDER_BY Order by SQL statement + * @return string A SQL statement ready for execution + */ + public function sql_build_query($query, $array); + + /** + * Fetch field + * if rownum is false, the current row is used, else it is pointing to the row (zero-based) + * + * @param string $field Name of the column + * @param mixed $rownum Row number, if false the current row will be used + * and the row curser will point to the next row + * Note: $rownum is 0 based + * @param mixed $query_id Already executed query to get the rows from, + * if false, the last query will be used. + * @return mixed String value of the field in the selected row, + * false, if the row does not exist + */ + public function sql_fetchfield($field, $rownum = false, $query_id = false); + + /** + * Fetch current row + * + * @param mixed $query_id Already executed query to get the rows from, + * if false, the last query will be used. + * @return mixed Array with the current row, + * false, if the row does not exist + */ + public function sql_fetchrow($query_id = false); + + /** + * Returns SQL string to cast a string expression to an int. + * + * @param string $expression An expression evaluating to string + * @return string Expression returning an int + */ + public function cast_expr_to_bigint($expression); + + /** + * Get last inserted id after insert statement + * + * @return string Autoincrement value of the last inserted row + */ + public function sql_nextid(); + + /** + * Add to query count + * + * @param bool $cached Is this query cached? + * @return null + */ + public function sql_add_num_queries($cached = false); + + /** + * Build LIMIT query + * + * @param string $query The SQL query to execute + * @param int $total The number of rows to select + * @param int $offset + * @param int $cache_ttl Either 0 to avoid caching or + * the time in seconds which the result shall be kept in cache + * @return mixed Buffered, seekable result handle, false on error + */ + public function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0); + + /** + * Base query method + * + * @param string $query The SQL query to execute + * @param int $cache_ttl Either 0 to avoid caching or + * the time in seconds which the result shall be kept in cache + * @return mixed Buffered, seekable result handle, false on error + */ + public function sql_query($query = '', $cache_ttl = 0); + + /** + * Returns SQL string to cast an integer expression to a string. + * + * @param string $expression An expression evaluating to int + * @return string Expression returning a string + */ + public function cast_expr_to_string($expression); + + /** + * Connect to server + * + * @param string $sqlserver Address of the database server + * @param string $sqluser User name of the SQL user + * @param string $sqlpassword Password of the SQL user + * @param string $database Name of the database + * @param mixed $port Port of the database server + * @param bool $persistency + * @param bool $new_link Should a new connection be established + * @return mixed Connection ID on success, string error message otherwise + */ + public function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false); + + /** + * Run binary AND operator on DB column. + * Results in sql statement: "{$column_name} & (1 << {$bit}) {$compare}" + * + * @param string $column_name The column name to use + * @param int $bit The value to use for the AND operator, + * will be converted to (1 << $bit). Is used by + * options, using the number schema: 0, 1, 2...29 + * @param string $compare Any custom SQL code after the check (for example "= 0") + * @return string A SQL statement like: "{$column} & (1 << {$bit}) {$compare}" + */ + public function sql_bit_and($column_name, $bit, $compare = ''); + + /** + * Free sql result + * + * @param mixed $query_id Already executed query result, + * if false, the last query will be used. + * @return null + */ + public function sql_freeresult($query_id = false); + + /** + * Return number of sql queries and cached sql queries used + * + * @param bool $cached Should we return the number of cached or normal queries? + * @return int Number of queries that have been executed + */ + public function sql_num_queries($cached = false); + + /** + * Run more than one insert statement. + * + * @param string $table Table name to run the statements on + * @param array $sql_ary Multi-dimensional array holding the statement data + * @return bool false if no statements were executed. + */ + public function sql_multi_insert($table, $sql_ary); + + /** + * Return number of affected rows + * + * @return mixed Number of the affected rows by the last query + * false if no query has been run before + */ + public function sql_affectedrows(); + + /** + * DBAL garbage collection, close SQL connection + * + * @return mixed False if no connection was opened before, + * Server response otherwise + */ + public function sql_close(); + + /** + * Seek to given row number + * + * @param mixed $rownum Row number the curser should point to + * Note: $rownum is 0 based + * @param mixed $query_id ID of the query to set the row cursor on + * if false, the last query will be used. + * $query_id will then be set correctly + * @return bool False if something went wrong + */ + public function sql_rowseek($rownum, &$query_id); + + /** + * Escape string used in sql query + * + * @param string $msg String to be escaped + * @return string Escaped version of $msg + */ + public function sql_escape($msg); + + /** + * Correctly adjust LIKE expression for special characters + * Some DBMS are handling them in a different way + * + * @param string $expression The expression to use. Every wildcard is + * escaped, except $this->any_char and $this->one_char + * @return string A SQL statement like: "LIKE 'bertie_%'" + */ + public function sql_like_expression($expression); + + /** + * Correctly adjust NOT LIKE expression for special characters + * Some DBMS are handling them in a different way + * + * @param string $expression The expression to use. Every wildcard is + * escaped, except $this->any_char and $this->one_char + * @return string A SQL statement like: "NOT LIKE 'bertie_%'" + */ + public function sql_not_like_expression($expression); + + /** + * Explain queries + * + * @param string $mode Available modes: display, start, stop, + * add_select_row, fromcache, record_fromcache + * @param string $query The Query that should be explained + * @return mixed Either a full HTML page, boolean or null + */ + public function sql_report($mode, $query = ''); + + /** + * Build IN or NOT IN sql comparison string, uses <> or = on single element + * arrays to improve comparison speed + * + * @param string $field Name of the sql column that shall be compared + * @param array $array Array of values that are (not) allowed + * @param bool $negate true for NOT IN (), false for IN () + * @param bool $allow_empty_set If true, allow $array to be empty, + * this function will return 1=1 or 1=0 then. + * @return string A SQL statement like: "IN (1, 2, 3, 4)" or "= 1" + */ + public function sql_in_set($field, $array, $negate = false, $allow_empty_set = false); +} diff --git a/sources/phpBB/phpbb/db/driver/factory.php b/sources/phpBB/phpbb/db/driver/factory.php new file mode 100644 index 0000000..fb3a826 --- /dev/null +++ b/sources/phpBB/phpbb/db/driver/factory.php @@ -0,0 +1,443 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\driver; + +use \Symfony\Component\DependencyInjection\ContainerInterface; + +/** +* Database Abstraction Layer +*/ +class factory implements driver_interface +{ + /** + * @var driver_interface + */ + protected $driver = null; + + /** + * @var ContainerInterface + */ + protected $container; + + /** + * Constructor. + * + * @param ContainerInterface $container A ContainerInterface instance + */ + public function __construct(ContainerInterface $container) + { + $this->container = $container; + } + + /** + * Return the current driver (and retrieved it from the container if necessary) + * + * @return driver_interface + */ + protected function get_driver() + { + if ($this->driver === null) + { + $this->driver = $this->container->get('dbal.conn.driver'); + } + + return $this->driver; + } + + /** + * Set the current driver + * + * @param driver_interface $driver + */ + public function set_driver(driver_interface $driver) + { + $this->driver = $driver; + } + + /** + * {@inheritdoc} + */ + public function get_sql_layer() + { + return $this->get_driver()->get_sql_layer(); + } + + /** + * {@inheritdoc} + */ + public function get_db_name() + { + return $this->get_driver()->get_db_name(); + } + + /** + * {@inheritdoc} + */ + public function get_any_char() + { + return $this->get_driver()->get_any_char(); + } + + /** + * {@inheritdoc} + */ + public function get_one_char() + { + return $this->get_driver()->get_one_char(); + } + + /** + * {@inheritdoc} + */ + public function get_db_connect_id() + { + return $this->get_driver()->get_db_connect_id(); + } + + /** + * {@inheritdoc} + */ + public function get_sql_error_triggered() + { + return $this->get_driver()->get_sql_error_triggered(); + } + + /** + * {@inheritdoc} + */ + public function get_sql_error_sql() + { + return $this->get_driver()->get_sql_error_sql(); + } + + /** + * {@inheritdoc} + */ + public function get_transaction() + { + return $this->get_driver()->get_transaction(); + } + + /** + * {@inheritdoc} + */ + public function get_sql_time() + { + return $this->get_driver()->get_sql_time(); + } + + /** + * {@inheritdoc} + */ + public function get_sql_error_returned() + { + return $this->get_driver()->get_sql_error_returned(); + } + + /** + * {@inheritdoc} + */ + public function get_multi_insert() + { + return $this->get_driver()->get_multi_insert(); + } + + /** + * {@inheritdoc} + */ + public function set_multi_insert($multi_insert) + { + $this->get_driver()->set_multi_insert($multi_insert); + } + + /** + * {@inheritdoc} + */ + public function get_row_count($table_name) + { + return $this->get_driver()->get_row_count($table_name); + } + + /** + * {@inheritdoc} + */ + public function get_estimated_row_count($table_name) + { + return $this->get_driver()->get_estimated_row_count($table_name); + } + + /** + * {@inheritdoc} + */ + public function sql_lower_text($column_name) + { + return $this->get_driver()->sql_lower_text($column_name); + } + + /** + * {@inheritdoc} + */ + public function sql_error($sql = '') + { + return $this->get_driver()->sql_error($sql); + } + + /** + * {@inheritdoc} + */ + public function sql_buffer_nested_transactions() + { + return $this->get_driver()->sql_buffer_nested_transactions(); + } + + /** + * {@inheritdoc} + */ + public function sql_bit_or($column_name, $bit, $compare = '') + { + return $this->get_driver()->sql_bit_or($column_name, $bit, $compare); + } + + /** + * {@inheritdoc} + */ + public function sql_server_info($raw = false, $use_cache = true) + { + return $this->get_driver()->sql_server_info($raw, $use_cache); + } + + /** + * {@inheritdoc} + */ + public function sql_return_on_error($fail = false) + { + return $this->get_driver()->sql_return_on_error($fail); + } + + /** + * {@inheritdoc} + */ + public function sql_build_array($query, $assoc_ary = array()) + { + return $this->get_driver()->sql_build_array($query, $assoc_ary); + } + + /** + * {@inheritdoc} + */ + public function sql_fetchrowset($query_id = false) + { + return $this->get_driver()->sql_fetchrowset($query_id); + } + + /** + * {@inheritdoc} + */ + public function sql_transaction($status = 'begin') + { + return $this->get_driver()->sql_transaction($status); + } + + /** + * {@inheritdoc} + */ + public function sql_concatenate($expr1, $expr2) + { + return $this->get_driver()->sql_concatenate($expr1, $expr2); + } + + /** + * {@inheritdoc} + */ + public function sql_case($condition, $action_true, $action_false = false) + { + return $this->get_driver()->sql_case($condition, $action_true, $action_false); + } + + /** + * {@inheritdoc} + */ + public function sql_build_query($query, $array) + { + return $this->get_driver()->sql_build_query($query, $array); + } + + /** + * {@inheritdoc} + */ + public function sql_fetchfield($field, $rownum = false, $query_id = false) + { + return $this->get_driver()->sql_fetchfield($field, $rownum, $query_id); + } + + /** + * {@inheritdoc} + */ + public function sql_fetchrow($query_id = false) + { + return $this->get_driver()->sql_fetchrow($query_id); + } + + /** + * {@inheritdoc} + */ + public function cast_expr_to_bigint($expression) + { + return $this->get_driver()->cast_expr_to_bigint($expression); + } + + /** + * {@inheritdoc} + */ + public function sql_nextid() + { + return $this->get_driver()->sql_nextid(); + } + + /** + * {@inheritdoc} + */ + public function sql_add_num_queries($cached = false) + { + return $this->get_driver()->sql_add_num_queries($cached); + } + + /** + * {@inheritdoc} + */ + public function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + { + return $this->get_driver()->sql_query_limit($query, $total, $offset, $cache_ttl); + } + + /** + * {@inheritdoc} + */ + public function sql_query($query = '', $cache_ttl = 0) + { + return $this->get_driver()->sql_query($query, $cache_ttl); + } + + /** + * {@inheritdoc} + */ + public function cast_expr_to_string($expression) + { + return $this->get_driver()->cast_expr_to_string($expression); + } + + /** + * {@inheritdoc} + */ + public function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) + { + throw new \Exception('Disabled method.'); + } + + /** + * {@inheritdoc} + */ + public function sql_bit_and($column_name, $bit, $compare = '') + { + return $this->get_driver()->sql_bit_and($column_name, $bit, $compare); + } + + /** + * {@inheritdoc} + */ + public function sql_freeresult($query_id = false) + { + return $this->get_driver()->sql_freeresult($query_id); + } + + /** + * {@inheritdoc} + */ + public function sql_num_queries($cached = false) + { + return $this->get_driver()->sql_num_queries($cached); + } + + /** + * {@inheritdoc} + */ + public function sql_multi_insert($table, $sql_ary) + { + return $this->get_driver()->sql_multi_insert($table, $sql_ary); + } + + /** + * {@inheritdoc} + */ + public function sql_affectedrows() + { + return $this->get_driver()->sql_affectedrows(); + } + + /** + * {@inheritdoc} + */ + public function sql_close() + { + return $this->get_driver()->sql_close(); + } + + /** + * {@inheritdoc} + */ + public function sql_rowseek($rownum, &$query_id) + { + return $this->get_driver()->sql_rowseek($rownum, $query_id); + } + + /** + * {@inheritdoc} + */ + public function sql_escape($msg) + { + return $this->get_driver()->sql_escape($msg); + } + + /** + * {@inheritdoc} + */ + public function sql_like_expression($expression) + { + return $this->get_driver()->sql_like_expression($expression); + } + + /** + * {@inheritdoc} + */ + public function sql_not_like_expression($expression) + { + return $this->get_driver()->sql_not_like_expression($expression); + } + + /** + * {@inheritdoc} + */ + public function sql_report($mode, $query = '') + { + return $this->get_driver()->sql_report($mode, $query); + } + + /** + * {@inheritdoc} + */ + public function sql_in_set($field, $array, $negate = false, $allow_empty_set = false) + { + return $this->get_driver()->sql_in_set($field, $array, $negate, $allow_empty_set); + } +} diff --git a/sources/phpBB/phpbb/db/driver/mssql.php b/sources/phpBB/phpbb/db/driver/mssql.php new file mode 100644 index 0000000..f9ea884 --- /dev/null +++ b/sources/phpBB/phpbb/db/driver/mssql.php @@ -0,0 +1,476 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\driver; + +/** +* MSSQL Database Abstraction Layer +* Minimum Requirement is MSSQL 2000+ +*/ +class mssql extends \phpbb\db\driver\driver +{ + var $connect_error = ''; + + /** + * {@inheritDoc} + */ + function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) + { + if (!function_exists('mssql_connect')) + { + $this->connect_error = 'mssql_connect function does not exist, is mssql extension installed?'; + return $this->sql_error(''); + } + + $this->persistency = $persistency; + $this->user = $sqluser; + $this->dbname = $database; + + $port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':'; + $this->server = $sqlserver . (($port) ? $port_delimiter . $port : ''); + + @ini_set('mssql.charset', 'UTF-8'); + @ini_set('mssql.textlimit', 2147483647); + @ini_set('mssql.textsize', 2147483647); + + $this->db_connect_id = ($this->persistency) ? @mssql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mssql_connect($this->server, $this->user, $sqlpassword, $new_link); + + if ($this->db_connect_id && $this->dbname != '') + { + if (!@mssql_select_db($this->dbname, $this->db_connect_id)) + { + @mssql_close($this->db_connect_id); + return false; + } + } + + return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); + } + + /** + * {@inheritDoc} + */ + function sql_server_info($raw = false, $use_cache = true) + { + global $cache; + + if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false) + { + $result_id = @mssql_query("SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')", $this->db_connect_id); + + $row = false; + if ($result_id) + { + $row = @mssql_fetch_assoc($result_id); + @mssql_free_result($result_id); + } + + $this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0; + + if (!empty($cache) && $use_cache) + { + $cache->put('mssql_version', $this->sql_server_version); + } + } + + if ($raw) + { + return $this->sql_server_version; + } + + return ($this->sql_server_version) ? 'MSSQL
' . $this->sql_server_version : 'MSSQL'; + } + + /** + * {@inheritDoc} + */ + public function sql_concatenate($expr1, $expr2) + { + return $expr1 . ' + ' . $expr2; + } + + /** + * SQL Transaction + * @access private + */ + function _sql_transaction($status = 'begin') + { + switch ($status) + { + case 'begin': + return @mssql_query('BEGIN TRANSACTION', $this->db_connect_id); + break; + + case 'commit': + return @mssql_query('COMMIT TRANSACTION', $this->db_connect_id); + break; + + case 'rollback': + return @mssql_query('ROLLBACK TRANSACTION', $this->db_connect_id); + break; + } + + return true; + } + + /** + * {@inheritDoc} + */ + function sql_query($query = '', $cache_ttl = 0) + { + if ($query != '') + { + global $cache; + + // EXPLAIN only in extra debug mode + if (defined('DEBUG')) + { + $this->sql_report('start', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->curtime = microtime(true); + } + + $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false; + $this->sql_add_num_queries($this->query_result); + + if ($this->query_result === false) + { + if (($this->query_result = @mssql_query($query, $this->db_connect_id)) === false) + { + $this->sql_error($query); + } + + if (defined('DEBUG')) + { + $this->sql_report('stop', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->sql_time += microtime(true) - $this->curtime; + } + + 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) + { + $this->open_queries[(int) $this->query_result] = $this->query_result; + } + } + else if (defined('DEBUG')) + { + $this->sql_report('fromcache', $query); + } + } + else + { + return false; + } + + return $this->query_result; + } + + /** + * Build LIMIT query + */ + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + { + $this->query_result = false; + + // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows) + if ($total) + { + // We need to grab the total number of rows + the offset number of rows to get the correct result + if (strpos($query, 'SELECT DISTINCT') === 0) + { + $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15); + } + else + { + $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6); + } + } + + $result = $this->sql_query($query, $cache_ttl); + + // Seek by $offset rows + if ($offset) + { + $this->sql_rowseek($offset, $result); + } + + return $result; + } + + /** + * {@inheritDoc} + */ + function sql_affectedrows() + { + return ($this->db_connect_id) ? @mssql_rows_affected($this->db_connect_id) : false; + } + + /** + * {@inheritDoc} + */ + function sql_fetchrow($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && $cache->sql_exists($query_id)) + { + return $cache->sql_fetchrow($query_id); + } + + if ($query_id === false) + { + return false; + } + + $row = @mssql_fetch_assoc($query_id); + + // I hope i am able to remove this later... hopefully only a PHP or MSSQL bug + if ($row) + { + foreach ($row as $key => $value) + { + $row[$key] = ($value === ' ' || $value === null) ? '' : $value; + } + } + + return $row; + } + + /** + * {@inheritDoc} + */ + function sql_rowseek($rownum, &$query_id) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + 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; + } + + /** + * {@inheritDoc} + */ + function sql_nextid() + { + $result_id = @mssql_query('SELECT SCOPE_IDENTITY()', $this->db_connect_id); + if ($result_id) + { + if ($row = @mssql_fetch_assoc($result_id)) + { + @mssql_free_result($result_id); + return $row['computed']; + } + @mssql_free_result($result_id); + } + + return false; + } + + /** + * {@inheritDoc} + */ + function sql_freeresult($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && !is_object($query_id) && $cache->sql_exists($query_id)) + { + return $cache->sql_freeresult($query_id); + } + + if (isset($this->open_queries[(int) $query_id])) + { + unset($this->open_queries[(int) $query_id]); + return @mssql_free_result($query_id); + } + + return false; + } + + /** + * {@inheritDoc} + */ + function sql_escape($msg) + { + return str_replace(array("'", "\0"), array("''", ''), $msg); + } + + /** + * {@inheritDoc} + */ + function sql_lower_text($column_name) + { + return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))"; + } + + /** + * Build LIKE expression + * @access private + */ + function _sql_like_expression($expression) + { + return $expression . " ESCAPE '\\'"; + } + + /** + * Build NOT LIKE expression + * @access private + */ + function _sql_not_like_expression($expression) + { + return $expression . " ESCAPE '\\'"; + } + + /** + * return sql error array + * @access private + */ + function _sql_error() + { + if (function_exists('mssql_get_last_message')) + { + $error = array( + 'message' => @mssql_get_last_message(), + 'code' => '', + ); + + // Get error code number + $result_id = @mssql_query('SELECT @@ERROR as code', $this->db_connect_id); + if ($result_id) + { + $row = @mssql_fetch_assoc($result_id); + $error['code'] = $row['code']; + @mssql_free_result($result_id); + } + + // Get full error message if possible + $sql = 'SELECT CAST(description as varchar(255)) as message + FROM master.dbo.sysmessages + WHERE error = ' . $error['code']; + $result_id = @mssql_query($sql); + + if ($result_id) + { + $row = @mssql_fetch_assoc($result_id); + if (!empty($row['message'])) + { + $error['message'] .= '
' . $row['message']; + } + @mssql_free_result($result_id); + } + } + else + { + $error = array( + 'message' => $this->connect_error, + 'code' => '', + ); + } + + return $error; + } + + /** + * Build db-specific query data + * @access private + */ + function _sql_custom_build($stage, $data) + { + return $data; + } + + /** + * Close sql connection + * @access private + */ + function _sql_close() + { + return @mssql_close($this->db_connect_id); + } + + /** + * Build db-specific report + * @access private + */ + function _sql_report($mode, $query = '') + { + switch ($mode) + { + case 'start': + $html_table = false; + @mssql_query('SET SHOWPLAN_TEXT ON;', $this->db_connect_id); + if ($result = @mssql_query($query, $this->db_connect_id)) + { + @mssql_next_result($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); + + if ($html_table) + { + $this->html_hold .= '
'; + } + break; + + case 'fromcache': + $endtime = explode(' ', microtime()); + $endtime = $endtime[0] + $endtime[1]; + + $result = @mssql_query($query, $this->db_connect_id); + while ($void = @mssql_fetch_assoc($result)) + { + // Take the time spent on parsing rows into account + } + @mssql_free_result($result); + + $splittime = explode(' ', microtime()); + $splittime = $splittime[0] + $splittime[1]; + + $this->sql_report('record_fromcache', $query, $endtime, $splittime); + + break; + } + } +} diff --git a/sources/phpBB/phpbb/db/driver/mssql_base.php b/sources/phpBB/phpbb/db/driver/mssql_base.php new file mode 100644 index 0000000..514df9e --- /dev/null +++ b/sources/phpBB/phpbb/db/driver/mssql_base.php @@ -0,0 +1,71 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\driver; + +/** +* MSSQL Database Base Abstraction Layer + */ +abstract class mssql_base extends \phpbb\db\driver\driver +{ + /** + * {@inheritDoc} + */ + public function sql_concatenate($expr1, $expr2) + { + return $expr1 . ' + ' . $expr2; + } + + /** + * {@inheritDoc} + */ + function sql_escape($msg) + { + return str_replace(array("'", "\0"), array("''", ''), $msg); + } + + /** + * {@inheritDoc} + */ + function sql_lower_text($column_name) + { + return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))"; + } + + /** + * Build LIKE expression + * @access private + */ + function _sql_like_expression($expression) + { + return $expression . " ESCAPE '\\'"; + } + + /** + * Build NOT LIKE expression + * @access private + */ + function _sql_not_like_expression($expression) + { + return $expression . " ESCAPE '\\'"; + } + + /** + * Build db-specific query data + * @access private + */ + function _sql_custom_build($stage, $data) + { + return $data; + } +} diff --git a/sources/phpBB/phpbb/db/driver/mssql_odbc.php b/sources/phpBB/phpbb/db/driver/mssql_odbc.php new file mode 100644 index 0000000..8e5d4c7 --- /dev/null +++ b/sources/phpBB/phpbb/db/driver/mssql_odbc.php @@ -0,0 +1,377 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\driver; + +/** +* Unified ODBC functions +* Unified ODBC functions support any database having ODBC driver, for example Adabas D, IBM DB2, iODBC, Solid, Sybase SQL Anywhere... +* Here we only support MSSQL Server 2000+ because of the provided schema +* +* @note number of bytes returned for returning data depends on odbc.defaultlrl php.ini setting. +* If it is limited to 4K for example only 4K of data is returned max, resulting in incomplete theme data for example. +* @note odbc.defaultbinmode may affect UTF8 characters +*/ +class mssql_odbc extends \phpbb\db\driver\mssql_base +{ + var $last_query_text = ''; + var $connect_error = ''; + + /** + * {@inheritDoc} + */ + function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) + { + $this->persistency = $persistency; + $this->user = $sqluser; + $this->dbname = $database; + + $port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':'; + $this->server = $sqlserver . (($port) ? $port_delimiter . $port : ''); + + $max_size = @ini_get('odbc.defaultlrl'); + if (!empty($max_size)) + { + $unit = strtolower(substr($max_size, -1, 1)); + $max_size = (int) $max_size; + + if ($unit == 'k') + { + $max_size = floor($max_size / 1024); + } + else if ($unit == 'g') + { + $max_size *= 1024; + } + else if (is_numeric($unit)) + { + $max_size = floor((int) ($max_size . $unit) / 1048576); + } + $max_size = max(8, $max_size) . 'M'; + + @ini_set('odbc.defaultlrl', $max_size); + } + + if ($this->persistency) + { + if (!function_exists('odbc_pconnect')) + { + $this->connect_error = 'odbc_pconnect function does not exist, is odbc extension installed?'; + return $this->sql_error(''); + } + $this->db_connect_id = @odbc_pconnect($this->server, $this->user, $sqlpassword); + } + else + { + if (!function_exists('odbc_connect')) + { + $this->connect_error = 'odbc_connect function does not exist, is odbc extension installed?'; + return $this->sql_error(''); + } + $this->db_connect_id = @odbc_connect($this->server, $this->user, $sqlpassword); + } + + return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); + } + + /** + * {@inheritDoc} + */ + function sql_server_info($raw = false, $use_cache = true) + { + global $cache; + + if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssqlodbc_version')) === false) + { + $result_id = @odbc_exec($this->db_connect_id, "SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')"); + + $row = false; + if ($result_id) + { + $row = @odbc_fetch_array($result_id); + @odbc_free_result($result_id); + } + + $this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0; + + if (!empty($cache) && $use_cache) + { + $cache->put('mssqlodbc_version', $this->sql_server_version); + } + } + + if ($raw) + { + return $this->sql_server_version; + } + + return ($this->sql_server_version) ? 'MSSQL (ODBC)
' . $this->sql_server_version : 'MSSQL (ODBC)'; + } + + /** + * SQL Transaction + * @access private + */ + function _sql_transaction($status = 'begin') + { + switch ($status) + { + case 'begin': + return @odbc_exec($this->db_connect_id, 'BEGIN TRANSACTION'); + break; + + case 'commit': + return @odbc_exec($this->db_connect_id, 'COMMIT TRANSACTION'); + break; + + case 'rollback': + return @odbc_exec($this->db_connect_id, 'ROLLBACK TRANSACTION'); + break; + } + + return true; + } + + /** + * {@inheritDoc} + */ + function sql_query($query = '', $cache_ttl = 0) + { + if ($query != '') + { + global $cache; + + // EXPLAIN only in extra debug mode + if (defined('DEBUG')) + { + $this->sql_report('start', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->curtime = microtime(true); + } + + $this->last_query_text = $query; + $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false; + $this->sql_add_num_queries($this->query_result); + + if ($this->query_result === false) + { + if (($this->query_result = @odbc_exec($this->db_connect_id, $query)) === false) + { + $this->sql_error($query); + } + + if (defined('DEBUG')) + { + $this->sql_report('stop', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->sql_time += microtime(true) - $this->curtime; + } + + 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) + { + $this->open_queries[(int) $this->query_result] = $this->query_result; + } + } + else if (defined('DEBUG')) + { + $this->sql_report('fromcache', $query); + } + } + else + { + return false; + } + + return $this->query_result; + } + + /** + * Build LIMIT query + */ + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + { + $this->query_result = false; + + // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows) + if ($total) + { + // We need to grab the total number of rows + the offset number of rows to get the correct result + if (strpos($query, 'SELECT DISTINCT') === 0) + { + $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15); + } + else + { + $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6); + } + } + + $result = $this->sql_query($query, $cache_ttl); + + // Seek by $offset rows + if ($offset) + { + $this->sql_rowseek($offset, $result); + } + + return $result; + } + + /** + * {@inheritDoc} + */ + function sql_affectedrows() + { + return ($this->db_connect_id) ? @odbc_num_rows($this->query_result) : false; + } + + /** + * {@inheritDoc} + */ + function sql_fetchrow($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && $cache->sql_exists($query_id)) + { + return $cache->sql_fetchrow($query_id); + } + + return ($query_id !== false) ? @odbc_fetch_array($query_id) : false; + } + + /** + * {@inheritDoc} + */ + function sql_nextid() + { + $result_id = @odbc_exec($this->db_connect_id, 'SELECT @@IDENTITY'); + + if ($result_id) + { + if (@odbc_fetch_array($result_id)) + { + $id = @odbc_result($result_id, 1); + @odbc_free_result($result_id); + return $id; + } + @odbc_free_result($result_id); + } + + return false; + } + + /** + * {@inheritDoc} + */ + function sql_freeresult($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && !is_object($query_id) && $cache->sql_exists($query_id)) + { + return $cache->sql_freeresult($query_id); + } + + if (isset($this->open_queries[(int) $query_id])) + { + unset($this->open_queries[(int) $query_id]); + return @odbc_free_result($query_id); + } + + return false; + } + + /** + * return sql error array + * @access private + */ + function _sql_error() + { + if (function_exists('odbc_errormsg')) + { + $error = array( + 'message' => @odbc_errormsg(), + 'code' => @odbc_error(), + ); + } + else + { + $error = array( + 'message' => $this->connect_error, + 'code' => '', + ); + } + + return $error; + } + + /** + * Close sql connection + * @access private + */ + function _sql_close() + { + return @odbc_close($this->db_connect_id); + } + + /** + * Build db-specific report + * @access private + */ + function _sql_report($mode, $query = '') + { + switch ($mode) + { + case 'start': + break; + + case 'fromcache': + $endtime = explode(' ', microtime()); + $endtime = $endtime[0] + $endtime[1]; + + $result = @odbc_exec($this->db_connect_id, $query); + while ($void = @odbc_fetch_array($result)) + { + // Take the time spent on parsing rows into account + } + @odbc_free_result($result); + + $splittime = explode(' ', microtime()); + $splittime = $splittime[0] + $splittime[1]; + + $this->sql_report('record_fromcache', $query, $endtime, $splittime); + + break; + } + } +} diff --git a/sources/phpBB/phpbb/db/driver/mssqlnative.php b/sources/phpBB/phpbb/db/driver/mssqlnative.php new file mode 100644 index 0000000..46a9b3a --- /dev/null +++ b/sources/phpBB/phpbb/db/driver/mssqlnative.php @@ -0,0 +1,442 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +/** +* This is the MS SQL Server Native database abstraction layer. +* PHP mssql native driver required. +* @author Chris Pucci +* +*/ + +namespace phpbb\db\driver; + +class mssqlnative extends \phpbb\db\driver\mssql_base +{ + var $m_insert_id = null; + var $last_query_text = ''; + var $query_options = array(); + var $connect_error = ''; + + /** + * {@inheritDoc} + */ + function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) + { + // Test for driver support, to avoid suppressed fatal error + if (!function_exists('sqlsrv_connect')) + { + $this->connect_error = 'Native MS SQL Server driver for PHP is missing or needs to be updated. Version 1.1 or later is required to install phpBB3. You can download the driver from: http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx'; + return $this->sql_error(''); + } + + //set up connection variables + $this->persistency = $persistency; + $this->user = $sqluser; + $this->dbname = $database; + $port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':'; + $this->server = $sqlserver . (($port) ? $port_delimiter . $port : ''); + + //connect to database + $this->db_connect_id = sqlsrv_connect($this->server, array( + 'Database' => $this->dbname, + 'UID' => $this->user, + 'PWD' => $sqlpassword + )); + + return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); + } + + /** + * {@inheritDoc} + */ + function sql_server_info($raw = false, $use_cache = true) + { + global $cache; + + if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false) + { + $arr_server_info = sqlsrv_server_info($this->db_connect_id); + $this->sql_server_version = $arr_server_info['SQLServerVersion']; + + if (!empty($cache) && $use_cache) + { + $cache->put('mssql_version', $this->sql_server_version); + } + } + + if ($raw) + { + return $this->sql_server_version; + } + + return ($this->sql_server_version) ? 'MSSQL
' . $this->sql_server_version : 'MSSQL'; + } + + /** + * {@inheritDoc} + */ + function sql_buffer_nested_transactions() + { + return true; + } + + /** + * SQL Transaction + * @access private + */ + function _sql_transaction($status = 'begin') + { + switch ($status) + { + case 'begin': + return sqlsrv_begin_transaction($this->db_connect_id); + break; + + case 'commit': + return sqlsrv_commit($this->db_connect_id); + break; + + case 'rollback': + return sqlsrv_rollback($this->db_connect_id); + break; + } + return true; + } + + /** + * {@inheritDoc} + */ + function sql_query($query = '', $cache_ttl = 0) + { + if ($query != '') + { + global $cache; + + // EXPLAIN only in extra debug mode + if (defined('DEBUG')) + { + $this->sql_report('start', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->curtime = microtime(true); + } + + $this->last_query_text = $query; + $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false; + $this->sql_add_num_queries($this->query_result); + + if ($this->query_result === false) + { + if (($this->query_result = @sqlsrv_query($this->db_connect_id, $query, array(), $this->query_options)) === false) + { + $this->sql_error($query); + } + // reset options for next query + $this->query_options = array(); + + if (defined('DEBUG')) + { + $this->sql_report('stop', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->sql_time += microtime(true) - $this->curtime; + } + + 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) + { + $this->open_queries[(int) $this->query_result] = $this->query_result; + } + } + else if (defined('DEBUG')) + { + $this->sql_report('fromcache', $query); + } + } + else + { + return false; + } + return $this->query_result; + } + + /** + * Build LIMIT query + */ + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + { + $this->query_result = false; + + // total == 0 means all results - not zero results + if ($offset == 0 && $total !== 0) + { + if (strpos($query, "SELECT") === false) + { + $query = "TOP {$total} " . $query; + } + else + { + $query = preg_replace('/SELECT(\s*DISTINCT)?/Dsi', 'SELECT$1 TOP '.$total, $query); + } + } + else if ($offset > 0) + { + $query = preg_replace('/SELECT(\s*DISTINCT)?/Dsi', 'SELECT$1 TOP(10000000) ', $query); + $query = 'SELECT * + FROM (SELECT sub2.*, ROW_NUMBER() OVER(ORDER BY sub2.line2) AS line3 + FROM (SELECT 1 AS line2, sub1.* FROM (' . $query . ') AS sub1) as sub2) AS sub3'; + + if ($total > 0) + { + $query .= ' WHERE line3 BETWEEN ' . ($offset+1) . ' AND ' . ($offset + $total); + } + else + { + $query .= ' WHERE line3 > ' . $offset; + } + } + + $result = $this->sql_query($query, $cache_ttl); + + return $result; + } + + /** + * {@inheritDoc} + */ + function sql_affectedrows() + { + return ($this->db_connect_id) ? @sqlsrv_rows_affected($this->query_result) : false; + } + + /** + * {@inheritDoc} + */ + function sql_fetchrow($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && $cache->sql_exists($query_id)) + { + return $cache->sql_fetchrow($query_id); + } + + if ($query_id === false) + { + return false; + } + + $row = @sqlsrv_fetch_array($query_id, SQLSRV_FETCH_ASSOC); + + if ($row) + { + foreach ($row as $key => $value) + { + $row[$key] = ($value === ' ' || $value === null) ? '' : $value; + } + + // remove helper values from LIMIT queries + if (isset($row['line2'])) + { + unset($row['line2'], $row['line3']); + } + } + return (sizeof($row)) ? $row : false; + } + + /** + * {@inheritDoc} + */ + function sql_nextid() + { + $result_id = @sqlsrv_query($this->db_connect_id, 'SELECT @@IDENTITY'); + + if ($result_id !== false) + { + $row = @sqlsrv_fetch_array($result_id); + $id = $row[0]; + @sqlsrv_free_stmt($result_id); + return $id; + } + else + { + return false; + } + } + + /** + * {@inheritDoc} + */ + function sql_freeresult($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && !is_object($query_id) && $cache->sql_exists($query_id)) + { + return $cache->sql_freeresult($query_id); + } + + if (isset($this->open_queries[(int) $query_id])) + { + unset($this->open_queries[(int) $query_id]); + return @sqlsrv_free_stmt($query_id); + } + + return false; + } + + /** + * return sql error array + * @access private + */ + function _sql_error() + { + if (function_exists('sqlsrv_errors')) + { + $errors = @sqlsrv_errors(SQLSRV_ERR_ERRORS); + $error_message = ''; + $code = 0; + + if ($errors != null) + { + foreach ($errors as $error) + { + $error_message .= "SQLSTATE: " . $error['SQLSTATE'] . "\n"; + $error_message .= "code: " . $error['code'] . "\n"; + $code = $error['code']; + $error_message .= "message: " . $error['message'] . "\n"; + } + $this->last_error_result = $error_message; + $error = $this->last_error_result; + } + else + { + $error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array(); + } + + $error = array( + 'message' => $error, + 'code' => $code, + ); + } + else + { + $error = array( + 'message' => $this->connect_error, + 'code' => '', + ); + } + + return $error; + } + + /** + * Close sql connection + * @access private + */ + function _sql_close() + { + return @sqlsrv_close($this->db_connect_id); + } + + /** + * Build db-specific report + * @access private + */ + function _sql_report($mode, $query = '') + { + switch ($mode) + { + case 'start': + $html_table = false; + @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)) + { + $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); + } + } + @sqlsrv_query($this->db_connect_id, 'SET SHOWPLAN_TEXT OFF;'); + @sqlsrv_free_stmt($result); + + if ($html_table) + { + $this->html_hold .= ''; + } + break; + + case 'fromcache': + $endtime = explode(' ', microtime()); + $endtime = $endtime[0] + $endtime[1]; + + $result = @sqlsrv_query($this->db_connect_id, $query); + while ($void = @sqlsrv_fetch_array($result)) + { + // Take the time spent on parsing rows into account + } + @sqlsrv_free_stmt($result); + + $splittime = explode(' ', microtime()); + $splittime = $splittime[0] + $splittime[1]; + + $this->sql_report('record_fromcache', $query, $endtime, $splittime); + + break; + } + } + + /** + * Utility method used to retrieve number of rows + * Emulates mysql_num_rows + * Used in acp_database.php -> write_data_mssqlnative() + * Requires a static or keyset cursor to be definde via + * mssqlnative_set_query_options() + */ + function mssqlnative_num_rows($res) + { + if ($res !== false) + { + return sqlsrv_num_rows($res); + } + else + { + return false; + } + } + + /** + * Allows setting mssqlnative specific query options passed to sqlsrv_query as 4th parameter. + */ + function mssqlnative_set_query_options($options) + { + $this->query_options = $options; + } +} diff --git a/sources/phpBB/phpbb/db/driver/mysql.php b/sources/phpBB/phpbb/db/driver/mysql.php new file mode 100644 index 0000000..e93c723 --- /dev/null +++ b/sources/phpBB/phpbb/db/driver/mysql.php @@ -0,0 +1,485 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\driver; + +/** +* MySQL4 Database Abstraction Layer +* Compatible with: +* MySQL 3.23+ +* MySQL 4.0+ +* MySQL 4.1+ +* MySQL 5.0+ +*/ +class mysql extends \phpbb\db\driver\mysql_base +{ + var $multi_insert = true; + var $connect_error = ''; + + /** + * {@inheritDoc} + */ + function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) + { + $this->persistency = $persistency; + $this->user = $sqluser; + $this->server = $sqlserver . (($port) ? ':' . $port : ''); + $this->dbname = $database; + + $this->sql_layer = 'mysql4'; + + if ($this->persistency) + { + if (!function_exists('mysql_pconnect')) + { + $this->connect_error = 'mysql_pconnect function does not exist, is mysql extension installed?'; + return $this->sql_error(''); + } + $this->db_connect_id = @mysql_pconnect($this->server, $this->user, $sqlpassword); + } + else + { + if (!function_exists('mysql_connect')) + { + $this->connect_error = 'mysql_connect function does not exist, is mysql extension installed?'; + return $this->sql_error(''); + } + $this->db_connect_id = @mysql_connect($this->server, $this->user, $sqlpassword, $new_link); + } + + if ($this->db_connect_id && $this->dbname != '') + { + if (@mysql_select_db($this->dbname, $this->db_connect_id)) + { + // Determine what version we are using and if it natively supports UNICODE + if (version_compare($this->sql_server_info(true), '4.1.0', '>=')) + { + @mysql_query("SET NAMES 'utf8'", $this->db_connect_id); + + // enforce strict mode on databases that support it + 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'])); + + // TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES + if (!in_array('TRADITIONAL', $modes)) + { + if (!in_array('STRICT_ALL_TABLES', $modes)) + { + $modes[] = 'STRICT_ALL_TABLES'; + } + + if (!in_array('STRICT_TRANS_TABLES', $modes)) + { + $modes[] = 'STRICT_TRANS_TABLES'; + } + } + + $mode = implode(',', $modes); + @mysql_query("SET SESSION sql_mode='{$mode}'", $this->db_connect_id); + } + } + else if (version_compare($this->sql_server_info(true), '4.0.0', '<')) + { + $this->sql_layer = 'mysql'; + } + + return $this->db_connect_id; + } + } + + return $this->sql_error(''); + } + + /** + * {@inheritDoc} + */ + function sql_server_info($raw = false, $use_cache = true) + { + global $cache; + + 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); + + $this->sql_server_version = $row['version']; + + if (!empty($cache) && $use_cache) + { + $cache->put('mysql_version', $this->sql_server_version); + } + } + + return ($raw) ? $this->sql_server_version : 'MySQL ' . $this->sql_server_version; + } + + /** + * SQL Transaction + * @access private + */ + function _sql_transaction($status = 'begin') + { + switch ($status) + { + case 'begin': + return @mysql_query('BEGIN', $this->db_connect_id); + break; + + case 'commit': + return @mysql_query('COMMIT', $this->db_connect_id); + break; + + case 'rollback': + return @mysql_query('ROLLBACK', $this->db_connect_id); + break; + } + + return true; + } + + /** + * {@inheritDoc} + */ + function sql_query($query = '', $cache_ttl = 0) + { + if ($query != '') + { + global $cache; + + // EXPLAIN only in extra debug mode + if (defined('DEBUG')) + { + $this->sql_report('start', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->curtime = microtime(true); + } + + $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false; + $this->sql_add_num_queries($this->query_result); + + if ($this->query_result === false) + { + if (($this->query_result = @mysql_query($query, $this->db_connect_id)) === false) + { + $this->sql_error($query); + } + + if (defined('DEBUG')) + { + $this->sql_report('stop', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->sql_time += microtime(true) - $this->curtime; + } + + 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) + { + $this->open_queries[(int) $this->query_result] = $this->query_result; + } + } + else if (defined('DEBUG')) + { + $this->sql_report('fromcache', $query); + } + } + else + { + return false; + } + + return $this->query_result; + } + + /** + * {@inheritDoc} + */ + function sql_affectedrows() + { + if ($this->db_connect_id) + { + // We always want the number of matched rows + // instead of changed rows, when running an update. + // So when mysql_info() returns the number of matched rows + // we return that one instead of mysql_affected_rows() + $mysql_info = @mysql_info($this->db_connect_id); + if ($mysql_info !== false) + { + $match = array(); + preg_match('#^Rows matched: (\d)+ Changed: (\d)+ Warnings: (\d)+$#', $mysql_info, $match); + if (isset($match[1])) + { + return $match[1]; + } + } + + return @mysql_affected_rows($this->db_connect_id); + } + return false; + } + + /** + * {@inheritDoc} + */ + function sql_fetchrow($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && $cache->sql_exists($query_id)) + { + return $cache->sql_fetchrow($query_id); + } + + return ($query_id !== false) ? @mysql_fetch_assoc($query_id) : false; + } + + /** + * {@inheritDoc} + */ + function sql_rowseek($rownum, &$query_id) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && $cache->sql_exists($query_id)) + { + return $cache->sql_rowseek($rownum, $query_id); + } + + return ($query_id !== false) ? @mysql_data_seek($query_id, $rownum) : false; + } + + /** + * {@inheritDoc} + */ + function sql_nextid() + { + return ($this->db_connect_id) ? @mysql_insert_id($this->db_connect_id) : false; + } + + /** + * {@inheritDoc} + */ + function sql_freeresult($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && !is_object($query_id) && $cache->sql_exists($query_id)) + { + return $cache->sql_freeresult($query_id); + } + + if (isset($this->open_queries[(int) $query_id])) + { + unset($this->open_queries[(int) $query_id]); + return @mysql_free_result($query_id); + } + + return false; + } + + /** + * {@inheritDoc} + */ + function sql_escape($msg) + { + if (!$this->db_connect_id) + { + return @mysql_real_escape_string($msg); + } + + return @mysql_real_escape_string($msg, $this->db_connect_id); + } + + /** + * return sql error array + * @access private + */ + function _sql_error() + { + if ($this->db_connect_id) + { + $error = array( + 'message' => @mysql_error($this->db_connect_id), + 'code' => @mysql_errno($this->db_connect_id), + ); + } + else if (function_exists('mysql_error')) + { + $error = array( + 'message' => @mysql_error(), + 'code' => @mysql_errno(), + ); + } + else + { + $error = array( + 'message' => $this->connect_error, + 'code' => '', + ); + } + + return $error; + } + + /** + * Close sql connection + * @access private + */ + function _sql_close() + { + return @mysql_close($this->db_connect_id); + } + + /** + * Build db-specific report + * @access private + */ + function _sql_report($mode, $query = '') + { + static $test_prof; + + // current detection method, might just switch to see the existance of INFORMATION_SCHEMA.PROFILING + if ($test_prof === null) + { + $test_prof = false; + if (version_compare($this->sql_server_info(true), '5.0.37', '>=') && version_compare($this->sql_server_info(true), '5.1', '<')) + { + $test_prof = true; + } + } + + switch ($mode) + { + case 'start': + + $explain_query = $query; + if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) + { + $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; + } + else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) + { + $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; + } + + if (preg_match('/^SELECT/', $explain_query)) + { + $html_table = false; + + // begin profiling + if ($test_prof) + { + @mysql_query('SET profiling = 1;', $this->db_connect_id); + } + + if ($result = @mysql_query("EXPLAIN $explain_query", $this->db_connect_id)) + { + while ($row = @mysql_fetch_assoc($result)) + { + $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); + } + } + @mysql_free_result($result); + + if ($html_table) + { + $this->html_hold .= ''; + } + + if ($test_prof) + { + $html_table = false; + + // get the last profile + if ($result = @mysql_query('SHOW PROFILE ALL;', $this->db_connect_id)) + { + $this->html_hold .= '
'; + while ($row = @mysql_fetch_assoc($result)) + { + // make HTML safe + if (!empty($row['Source_function'])) + { + $row['Source_function'] = str_replace(array('<', '>'), array('<', '>'), $row['Source_function']); + } + + // remove unsupported features + foreach ($row as $key => $val) + { + if ($val === null) + { + unset($row[$key]); + } + } + $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); + } + } + @mysql_free_result($result); + + if ($html_table) + { + $this->html_hold .= ''; + } + + @mysql_query('SET profiling = 0;', $this->db_connect_id); + } + } + + break; + + case 'fromcache': + $endtime = explode(' ', microtime()); + $endtime = $endtime[0] + $endtime[1]; + + $result = @mysql_query($query, $this->db_connect_id); + while ($void = @mysql_fetch_assoc($result)) + { + // Take the time spent on parsing rows into account + } + @mysql_free_result($result); + + $splittime = explode(' ', microtime()); + $splittime = $splittime[0] + $splittime[1]; + + $this->sql_report('record_fromcache', $query, $endtime, $splittime); + + break; + } + } +} diff --git a/sources/phpBB/phpbb/db/driver/mysql_base.php b/sources/phpBB/phpbb/db/driver/mysql_base.php new file mode 100644 index 0000000..5e0b359 --- /dev/null +++ b/sources/phpBB/phpbb/db/driver/mysql_base.php @@ -0,0 +1,138 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\driver; + +/** +* Abstract MySQL Database Base Abstraction Layer +*/ +abstract class mysql_base extends \phpbb\db\driver\driver +{ + /** + * {@inheritDoc} + */ + public function sql_concatenate($expr1, $expr2) + { + return 'CONCAT(' . $expr1 . ', ' . $expr2 . ')'; + } + + /** + * Build LIMIT query + */ + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + { + $this->query_result = false; + + // if $total is set to 0 we do not want to limit the number of rows + if ($total == 0) + { + // MySQL 4.1+ no longer supports -1 in limit queries + $total = '18446744073709551615'; + } + + $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total); + + return $this->sql_query($query, $cache_ttl); + } + + /** + * {@inheritDoc} + */ + function get_estimated_row_count($table_name) + { + $table_status = $this->get_table_status($table_name); + + if (isset($table_status['Engine'])) + { + if ($table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000) + { + return '~' . $table_status['Rows']; + } + } + + return parent::get_row_count($table_name); + } + + /** + * {@inheritDoc} + */ + function get_row_count($table_name) + { + $table_status = $this->get_table_status($table_name); + + if (isset($table_status['Engine']) && $table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + + return parent::get_row_count($table_name); + } + + /** + * Gets some information about the specified table. + * + * @param string $table_name Table name + * + * @return array + * + * @access protected + */ + function get_table_status($table_name) + { + $sql = "SHOW TABLE STATUS + LIKE '" . $this->sql_escape($table_name) . "'"; + $result = $this->sql_query($sql); + $table_status = $this->sql_fetchrow($result); + $this->sql_freeresult($result); + + return $table_status; + } + + /** + * Build LIKE expression + * @access private + */ + function _sql_like_expression($expression) + { + return $expression; + } + + /** + * Build NOT LIKE expression + * @access private + */ + function _sql_not_like_expression($expression) + { + return $expression; + } + + /** + * Build db-specific query data + * @access private + */ + function _sql_custom_build($stage, $data) + { + switch ($stage) + { + case 'FROM': + $data = '(' . $data . ')'; + break; + } + + return $data; + } +} diff --git a/sources/phpBB/phpbb/db/driver/mysqli.php b/sources/phpBB/phpbb/db/driver/mysqli.php new file mode 100644 index 0000000..2ed0821 --- /dev/null +++ b/sources/phpBB/phpbb/db/driver/mysqli.php @@ -0,0 +1,476 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\driver; + +/** +* MySQLi Database Abstraction Layer +* mysqli-extension has to be compiled with: +* MySQL 4.1+ or MySQL 5.0+ +*/ +class mysqli extends \phpbb\db\driver\mysql_base +{ + var $multi_insert = true; + var $connect_error = ''; + + /** + * {@inheritDoc} + */ + function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) + { + if (!function_exists('mysqli_connect')) + { + $this->connect_error = 'mysqli_connect function does not exist, is mysqli extension installed?'; + return $this->sql_error(''); + } + + // Mysqli extension supports persistent connection since PHP 5.3.0 + $this->persistency = (version_compare(PHP_VERSION, '5.3.0', '>=')) ? $persistency : false; + $this->user = $sqluser; + + // If persistent connection, set dbhost to localhost when empty and prepend it with 'p:' prefix + $this->server = ($this->persistency) ? 'p:' . (($sqlserver) ? $sqlserver : 'localhost') : $sqlserver; + + $this->dbname = $database; + $port = (!$port) ? null : $port; + + // If port is set and it is not numeric, most likely mysqli socket is set. + // Try to map it to the $socket parameter. + $socket = null; + if ($port) + { + if (is_numeric($port)) + { + $port = (int) $port; + } + else + { + $socket = $port; + $port = null; + } + } + + $this->db_connect_id = mysqli_init(); + + if (!@mysqli_real_connect($this->db_connect_id, $this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket, MYSQLI_CLIENT_FOUND_ROWS)) + { + $this->db_connect_id = ''; + } + + if ($this->db_connect_id && $this->dbname != '') + { + @mysqli_query($this->db_connect_id, "SET NAMES 'utf8'"); + + // enforce strict mode on databases that support it + 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) + { + $row = @mysqli_fetch_assoc($result); + + $modes = array_map('trim', explode(',', $row['sql_mode'])); + } + else + { + $modes = array(); + } + @mysqli_free_result($result); + + // TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES + if (!in_array('TRADITIONAL', $modes)) + { + if (!in_array('STRICT_ALL_TABLES', $modes)) + { + $modes[] = 'STRICT_ALL_TABLES'; + } + + if (!in_array('STRICT_TRANS_TABLES', $modes)) + { + $modes[] = 'STRICT_TRANS_TABLES'; + } + } + + $mode = implode(',', $modes); + @mysqli_query($this->db_connect_id, "SET SESSION sql_mode='{$mode}'"); + } + return $this->db_connect_id; + } + + return $this->sql_error(''); + } + + /** + * {@inheritDoc} + */ + function sql_server_info($raw = false, $use_cache = true) + { + global $cache; + + 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) + { + $row = @mysqli_fetch_assoc($result); + + $this->sql_server_version = $row['version']; + + if (!empty($cache) && $use_cache) + { + $cache->put('mysqli_version', $this->sql_server_version); + } + } + @mysqli_free_result($result); + } + + return ($raw) ? $this->sql_server_version : 'MySQL(i) ' . $this->sql_server_version; + } + + /** + * SQL Transaction + * @access private + */ + function _sql_transaction($status = 'begin') + { + switch ($status) + { + case 'begin': + return @mysqli_autocommit($this->db_connect_id, false); + break; + + case 'commit': + $result = @mysqli_commit($this->db_connect_id); + @mysqli_autocommit($this->db_connect_id, true); + return $result; + break; + + case 'rollback': + $result = @mysqli_rollback($this->db_connect_id); + @mysqli_autocommit($this->db_connect_id, true); + return $result; + break; + } + + return true; + } + + /** + * {@inheritDoc} + */ + function sql_query($query = '', $cache_ttl = 0) + { + if ($query != '') + { + global $cache; + + // EXPLAIN only in extra debug mode + if (defined('DEBUG')) + { + $this->sql_report('start', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->curtime = microtime(true); + } + + $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false; + $this->sql_add_num_queries($this->query_result); + + if ($this->query_result === false) + { + if (($this->query_result = @mysqli_query($this->db_connect_id, $query)) === false) + { + $this->sql_error($query); + } + + if (defined('DEBUG')) + { + $this->sql_report('stop', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->sql_time += microtime(true) - $this->curtime; + } + + if ($cache && $cache_ttl) + { + $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl); + } + } + else if (defined('DEBUG')) + { + $this->sql_report('fromcache', $query); + } + } + else + { + return false; + } + + return $this->query_result; + } + + /** + * {@inheritDoc} + */ + function sql_affectedrows() + { + return ($this->db_connect_id) ? @mysqli_affected_rows($this->db_connect_id) : false; + } + + /** + * {@inheritDoc} + */ + function sql_fetchrow($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && !is_object($query_id) && $cache->sql_exists($query_id)) + { + return $cache->sql_fetchrow($query_id); + } + + if ($query_id !== false && $query_id !== null) + { + $result = @mysqli_fetch_assoc($query_id); + return $result !== null ? $result : false; + } + + return false; + } + + /** + * {@inheritDoc} + */ + function sql_rowseek($rownum, &$query_id) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && !is_object($query_id) && $cache->sql_exists($query_id)) + { + return $cache->sql_rowseek($rownum, $query_id); + } + + return ($query_id !== false) ? @mysqli_data_seek($query_id, $rownum) : false; + } + + /** + * {@inheritDoc} + */ + function sql_nextid() + { + return ($this->db_connect_id) ? @mysqli_insert_id($this->db_connect_id) : false; + } + + /** + * {@inheritDoc} + */ + function sql_freeresult($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && !is_object($query_id) && $cache->sql_exists($query_id)) + { + return $cache->sql_freeresult($query_id); + } + + return @mysqli_free_result($query_id); + } + + /** + * {@inheritDoc} + */ + function sql_escape($msg) + { + return @mysqli_real_escape_string($this->db_connect_id, $msg); + } + + /** + * return sql error array + * @access private + */ + function _sql_error() + { + if ($this->db_connect_id) + { + $error = array( + 'message' => @mysqli_error($this->db_connect_id), + 'code' => @mysqli_errno($this->db_connect_id) + ); + } + else if (function_exists('mysqli_connect_error')) + { + $error = array( + 'message' => @mysqli_connect_error(), + 'code' => @mysqli_connect_errno(), + ); + } + else + { + $error = array( + 'message' => $this->connect_error, + 'code' => '', + ); + } + + return $error; + } + + /** + * Close sql connection + * @access private + */ + function _sql_close() + { + return @mysqli_close($this->db_connect_id); + } + + /** + * Build db-specific report + * @access private + */ + function _sql_report($mode, $query = '') + { + static $test_prof; + + // current detection method, might just switch to see the existance of INFORMATION_SCHEMA.PROFILING + if ($test_prof === null) + { + $test_prof = false; + if (strpos(mysqli_get_server_info($this->db_connect_id), 'community') !== false) + { + $ver = mysqli_get_server_version($this->db_connect_id); + if ($ver >= 50037 && $ver < 50100) + { + $test_prof = true; + } + } + } + + switch ($mode) + { + case 'start': + + $explain_query = $query; + if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) + { + $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; + } + else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) + { + $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; + } + + if (preg_match('/^SELECT/', $explain_query)) + { + $html_table = false; + + // begin profiling + if ($test_prof) + { + @mysqli_query($this->db_connect_id, 'SET profiling = 1;'); + } + + if ($result = @mysqli_query($this->db_connect_id, "EXPLAIN $explain_query")) + { + while ($row = @mysqli_fetch_assoc($result)) + { + $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); + } + } + @mysqli_free_result($result); + + if ($html_table) + { + $this->html_hold .= ''; + } + + if ($test_prof) + { + $html_table = false; + + // get the last profile + if ($result = @mysqli_query($this->db_connect_id, 'SHOW PROFILE ALL;')) + { + $this->html_hold .= '
'; + while ($row = @mysqli_fetch_assoc($result)) + { + // make HTML safe + if (!empty($row['Source_function'])) + { + $row['Source_function'] = str_replace(array('<', '>'), array('<', '>'), $row['Source_function']); + } + + // remove unsupported features + foreach ($row as $key => $val) + { + if ($val === null) + { + unset($row[$key]); + } + } + $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); + } + } + @mysqli_free_result($result); + + if ($html_table) + { + $this->html_hold .= ''; + } + + @mysqli_query($this->db_connect_id, 'SET profiling = 0;'); + } + } + + break; + + case 'fromcache': + $endtime = explode(' ', microtime()); + $endtime = $endtime[0] + $endtime[1]; + + $result = @mysqli_query($this->db_connect_id, $query); + if ($result !== null) + { + while ($void = @mysqli_fetch_assoc($result)) + { + // Take the time spent on parsing rows into account + } + } + @mysqli_free_result($result); + + $splittime = explode(' ', microtime()); + $splittime = $splittime[0] + $splittime[1]; + + $this->sql_report('record_fromcache', $query, $endtime, $splittime); + + break; + } + } +} diff --git a/sources/phpBB/phpbb/db/driver/oracle.php b/sources/phpBB/phpbb/db/driver/oracle.php new file mode 100644 index 0000000..6dcab5d --- /dev/null +++ b/sources/phpBB/phpbb/db/driver/oracle.php @@ -0,0 +1,807 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\driver; + +/** +* Oracle Database Abstraction Layer +*/ +class oracle extends \phpbb\db\driver\driver +{ + var $last_query_text = ''; + var $connect_error = ''; + + /** + * {@inheritDoc} + */ + function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) + { + $this->persistency = $persistency; + $this->user = $sqluser; + $this->server = $sqlserver . (($port) ? ':' . $port : ''); + $this->dbname = $database; + + $connect = $database; + + // support for "easy connect naming" + if ($sqlserver !== '' && $sqlserver !== '/') + { + if (substr($sqlserver, -1, 1) == '/') + { + $sqlserver == substr($sqlserver, 0, -1); + } + $connect = $sqlserver . (($port) ? ':' . $port : '') . '/' . $database; + } + + if ($new_link) + { + if (!function_exists('ocinlogon')) + { + $this->connect_error = 'ocinlogon function does not exist, is oci extension installed?'; + return $this->sql_error(''); + } + $this->db_connect_id = @ocinlogon($this->user, $sqlpassword, $connect, 'UTF8'); + } + else if ($this->persistency) + { + if (!function_exists('ociplogon')) + { + $this->connect_error = 'ociplogon function does not exist, is oci extension installed?'; + return $this->sql_error(''); + } + $this->db_connect_id = @ociplogon($this->user, $sqlpassword, $connect, 'UTF8'); + } + else + { + if (!function_exists('ocilogon')) + { + $this->connect_error = 'ocilogon function does not exist, is oci extension installed?'; + return $this->sql_error(''); + } + $this->db_connect_id = @ocilogon($this->user, $sqlpassword, $connect, 'UTF8'); + } + + return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); + } + + /** + * {@inheritDoc} + */ + function sql_server_info($raw = false, $use_cache = true) + { + /** + * force $use_cache false. I didn't research why the caching code below is commented out + * but I assume its because the Oracle extension provides a direct method to access it + * without a query. + */ + + $use_cache = false; +/* + global $cache; + + if (empty($cache) || ($this->sql_server_version = $cache->get('oracle_version')) === false) + { + $result = @ociparse($this->db_connect_id, 'SELECT * FROM v$version WHERE banner LIKE \'Oracle%\''); + @ociexecute($result, OCI_DEFAULT); + @ocicommit($this->db_connect_id); + + $row = array(); + @ocifetchinto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS); + @ocifreestatement($result); + $this->sql_server_version = trim($row['BANNER']); + + $cache->put('oracle_version', $this->sql_server_version); + } +*/ + $this->sql_server_version = @ociserverversion($this->db_connect_id); + + return $this->sql_server_version; + } + + /** + * SQL Transaction + * @access private + */ + function _sql_transaction($status = 'begin') + { + switch ($status) + { + case 'begin': + return true; + break; + + case 'commit': + return @ocicommit($this->db_connect_id); + break; + + case 'rollback': + return @ocirollback($this->db_connect_id); + break; + } + + return true; + } + + /** + * Oracle specific code to handle the fact that it does not compare columns properly + * @access private + */ + function _rewrite_col_compare($args) + { + if (sizeof($args) == 4) + { + if ($args[2] == '=') + { + return '(' . $args[0] . ' OR (' . $args[1] . ' is NULL AND ' . $args[3] . ' is NULL))'; + } + else if ($args[2] == '<>') + { + // really just a fancy way of saying foo <> bar or (foo is NULL XOR bar is NULL) but SQL has no XOR :P + return '(' . $args[0] . ' OR ((' . $args[1] . ' is NULL AND ' . $args[3] . ' is NOT NULL) OR (' . $args[1] . ' is NOT NULL AND ' . $args[3] . ' is NULL)))'; + } + } + else + { + return $this->_rewrite_where($args[0]); + } + } + + /** + * Oracle specific code to handle it's lack of sanity + * @access private + */ + function _rewrite_where($where_clause) + { + preg_match_all('/\s*(AND|OR)?\s*([\w_.()]++)\s*(?:(=|<[=>]?|>=?|LIKE)\s*((?>\'(?>[^\']++|\'\')*+\'|[\d-.()]+))|((NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))/', $where_clause, $result, PREG_SET_ORDER); + $out = ''; + foreach ($result as $val) + { + if (!isset($val[5])) + { + if ($val[4] !== "''") + { + $out .= $val[0]; + } + else + { + $out .= ' ' . $val[1] . ' ' . $val[2]; + if ($val[3] == '=') + { + $out .= ' is NULL'; + } + else if ($val[3] == '<>') + { + $out .= ' is NOT NULL'; + } + } + } + else + { + $in_clause = array(); + $sub_exp = substr($val[5], strpos($val[5], '(') + 1, -1); + $extra = false; + preg_match_all('/\'(?>[^\']++|\'\')*+\'|[\d-.]++/', $sub_exp, $sub_vals, PREG_PATTERN_ORDER); + $i = 0; + foreach ($sub_vals[0] as $sub_val) + { + // two things: + // 1) This determines if an empty string was in the IN clausing, making us turn it into a NULL comparison + // 2) This fixes the 1000 list limit that Oracle has (ORA-01795) + if ($sub_val !== "''") + { + $in_clause[(int) $i++/1000][] = $sub_val; + } + else + { + $extra = true; + } + } + if (!$extra && $i < 1000) + { + $out .= $val[0]; + } + else + { + $out .= ' ' . $val[1] . '('; + $in_array = array(); + + // constuct each IN() clause + foreach ($in_clause as $in_values) + { + $in_array[] = $val[2] . ' ' . (isset($val[6]) ? $val[6] : '') . 'IN(' . implode(', ', $in_values) . ')'; + } + + // Join the IN() clauses against a few ORs (IN is just a nicer OR anyway) + $out .= implode(' OR ', $in_array); + + // handle the empty string case + if ($extra) + { + $out .= ' OR ' . $val[2] . ' is ' . (isset($val[6]) ? $val[6] : '') . 'NULL'; + } + $out .= ')'; + + unset($in_array, $in_clause); + } + } + } + + return $out; + } + + /** + * {@inheritDoc} + */ + function sql_query($query = '', $cache_ttl = 0) + { + if ($query != '') + { + global $cache; + + // EXPLAIN only in extra debug mode + if (defined('DEBUG')) + { + $this->sql_report('start', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->curtime = microtime(true); + } + + $this->last_query_text = $query; + $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false; + $this->sql_add_num_queries($this->query_result); + + if ($this->query_result === false) + { + $in_transaction = false; + if (!$this->transaction) + { + $this->sql_transaction('begin'); + } + else + { + $in_transaction = true; + } + + $array = array(); + + // We overcome Oracle's 4000 char limit by binding vars + if (strlen($query) > 4000) + { + if (preg_match('/^(INSERT INTO[^(]++)\\(([^()]+)\\) VALUES[^(]++\\((.*?)\\)$/sU', $query, $regs)) + { + if (strlen($regs[3]) > 4000) + { + $cols = explode(', ', $regs[2]); + + preg_match_all('/\'(?:[^\']++|\'\')*+\'|[\d-.]+/', $regs[3], $vals, PREG_PATTERN_ORDER); + +/* The code inside this comment block breaks clob handling, but does allow the + database restore script to work. If you want to allow no posts longer than 4KB + and/or need the db restore script, uncomment this. + + + if (sizeof($cols) !== sizeof($vals)) + { + // Try to replace some common data we know is from our restore script or from other sources + $regs[3] = str_replace("'||chr(47)||'", '/', $regs[3]); + $_vals = explode(', ', $regs[3]); + + $vals = array(); + $is_in_val = false; + $i = 0; + $string = ''; + + foreach ($_vals as $value) + { + if (strpos($value, "'") === false && !$is_in_val) + { + $vals[$i++] = $value; + continue; + } + + if (substr($value, -1) === "'") + { + $vals[$i] = $string . (($is_in_val) ? ', ' : '') . $value; + $string = ''; + $is_in_val = false; + + if ($vals[$i][0] !== "'") + { + $vals[$i] = "''" . $vals[$i]; + } + $i++; + continue; + } + else + { + $string .= (($is_in_val) ? ', ' : '') . $value; + $is_in_val = true; + } + } + + if ($string) + { + // New value if cols != value + $vals[(sizeof($cols) !== sizeof($vals)) ? $i : $i - 1] .= $string; + } + + $vals = array(0 => $vals); + } +*/ + + $inserts = $vals[0]; + unset($vals); + + foreach ($inserts as $key => $value) + { + if (!empty($value) && $value[0] === "'" && strlen($value) > 4002) // check to see if this thing is greater than the max + 'x2 + { + $inserts[$key] = ':' . strtoupper($cols[$key]); + $array[$inserts[$key]] = str_replace("''", "'", substr($value, 1, -1)); + } + } + + $query = $regs[1] . '(' . $regs[2] . ') VALUES (' . implode(', ', $inserts) . ')'; + } + } + else if (preg_match_all('/^(UPDATE [\\w_]++\\s+SET )([\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+)(?:,\\s*[\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+))*+)\\s+(WHERE.*)$/s', $query, $data, PREG_SET_ORDER)) + { + if (strlen($data[0][2]) > 4000) + { + $update = $data[0][1]; + $where = $data[0][3]; + preg_match_all('/([\\w_]++)\\s*=\\s*(\'(?:[^\']++|\'\')*+\'|[\d-.]++)/', $data[0][2], $temp, PREG_SET_ORDER); + unset($data); + + $cols = array(); + foreach ($temp as $value) + { + if (!empty($value[2]) && $value[2][0] === "'" && strlen($value[2]) > 4002) // check to see if this thing is greater than the max + 'x2 + { + $cols[] = $value[1] . '=:' . strtoupper($value[1]); + $array[$value[1]] = str_replace("''", "'", substr($value[2], 1, -1)); + } + else + { + $cols[] = $value[1] . '=' . $value[2]; + } + } + + $query = $update . implode(', ', $cols) . ' ' . $where; + unset($cols); + } + } + } + + switch (substr($query, 0, 6)) + { + case 'DELETE': + if (preg_match('/^(DELETE FROM [\w_]++ WHERE)((?:\s*(?:AND|OR)?\s*[\w_]+\s*(?:(?:=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|[\d-.]+)|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))*+)$/', $query, $regs)) + { + $query = $regs[1] . $this->_rewrite_where($regs[2]); + unset($regs); + } + break; + + case 'UPDATE': + if (preg_match('/^(UPDATE [\\w_]++\\s+SET [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]++|:\w++)(?:, [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]++|:\w++))*+\\s+WHERE)(.*)$/s', $query, $regs)) + { + $query = $regs[1] . $this->_rewrite_where($regs[2]); + unset($regs); + } + break; + + case 'SELECT': + $query = preg_replace_callback('/([\w_.]++)\s*(?:(=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|[\d-.]++|([\w_.]++))|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]++,? ?)*+\))/', array($this, '_rewrite_col_compare'), $query); + break; + } + + $this->query_result = @ociparse($this->db_connect_id, $query); + + foreach ($array as $key => $value) + { + @ocibindbyname($this->query_result, $key, $array[$key], -1); + } + + $success = @ociexecute($this->query_result, OCI_DEFAULT); + + if (!$success) + { + $this->sql_error($query); + $this->query_result = false; + } + else + { + if (!$in_transaction) + { + $this->sql_transaction('commit'); + } + } + + if (defined('DEBUG')) + { + $this->sql_report('stop', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->sql_time += microtime(true) - $this->curtime; + } + + 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) + { + $this->open_queries[(int) $this->query_result] = $this->query_result; + } + } + else if (defined('DEBUG')) + { + $this->sql_report('fromcache', $query); + } + } + else + { + return false; + } + + return $this->query_result; + } + + /** + * Build LIMIT query + */ + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + { + $this->query_result = false; + + $query = 'SELECT * FROM (SELECT /*+ FIRST_ROWS */ rownum AS xrownum, a.* FROM (' . $query . ') a WHERE rownum <= ' . ($offset + $total) . ') WHERE xrownum >= ' . $offset; + + return $this->sql_query($query, $cache_ttl); + } + + /** + * {@inheritDoc} + */ + function sql_affectedrows() + { + return ($this->query_result) ? @ocirowcount($this->query_result) : false; + } + + /** + * {@inheritDoc} + */ + function sql_fetchrow($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && $cache->sql_exists($query_id)) + { + return $cache->sql_fetchrow($query_id); + } + + if ($query_id !== false) + { + $row = array(); + $result = @ocifetchinto($query_id, $row, OCI_ASSOC + OCI_RETURN_NULLS); + + if (!$result || !$row) + { + return false; + } + + $result_row = array(); + foreach ($row as $key => $value) + { + // Oracle treats empty strings as null + if (is_null($value)) + { + $value = ''; + } + + // OCI->CLOB? + if (is_object($value)) + { + $value = $value->load(); + } + + $result_row[strtolower($key)] = $value; + } + + return $result_row; + } + + return false; + } + + /** + * {@inheritDoc} + */ + function sql_rowseek($rownum, &$query_id) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && $cache->sql_exists($query_id)) + { + return $cache->sql_rowseek($rownum, $query_id); + } + + if ($query_id === false) + { + return false; + } + + // Reset internal pointer + @ociexecute($query_id, OCI_DEFAULT); + + // We do not fetch the row for rownum == 0 because then the next resultset would be the second row + for ($i = 0; $i < $rownum; $i++) + { + if (!$this->sql_fetchrow($query_id)) + { + return false; + } + } + + return true; + } + + /** + * {@inheritDoc} + */ + function sql_nextid() + { + $query_id = $this->query_result; + + if ($query_id !== false && $this->last_query_text != '') + { + if (preg_match('#^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)#is', $this->last_query_text, $tablename)) + { + $query = 'SELECT ' . $tablename[1] . '_seq.currval FROM DUAL'; + $stmt = @ociparse($this->db_connect_id, $query); + @ociexecute($stmt, OCI_DEFAULT); + + $temp_result = @ocifetchinto($stmt, $temp_array, OCI_ASSOC + OCI_RETURN_NULLS); + @ocifreestatement($stmt); + + if ($temp_result) + { + return $temp_array['CURRVAL']; + } + else + { + return false; + } + } + } + + return false; + } + + /** + * {@inheritDoc} + */ + function sql_freeresult($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && !is_object($query_id) && $cache->sql_exists($query_id)) + { + return $cache->sql_freeresult($query_id); + } + + if (isset($this->open_queries[(int) $query_id])) + { + unset($this->open_queries[(int) $query_id]); + return @ocifreestatement($query_id); + } + + return false; + } + + /** + * {@inheritDoc} + */ + function sql_escape($msg) + { + return str_replace(array("'", "\0"), array("''", ''), $msg); + } + + /** + * Build LIKE expression + * @access private + */ + function _sql_like_expression($expression) + { + return $expression . " ESCAPE '\\'"; + } + + /** + * Build NOT LIKE expression + * @access private + */ + function _sql_not_like_expression($expression) + { + return $expression . " ESCAPE '\\'"; + } + + function _sql_custom_build($stage, $data) + { + return $data; + } + + function _sql_bit_and($column_name, $bit, $compare = '') + { + return 'BITAND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : ''); + } + + function _sql_bit_or($column_name, $bit, $compare = '') + { + return 'BITOR(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : ''); + } + + /** + * return sql error array + * @access private + */ + function _sql_error() + { + if (function_exists('ocierror')) + { + $error = @ocierror(); + $error = (!$error) ? @ocierror($this->query_result) : $error; + $error = (!$error) ? @ocierror($this->db_connect_id) : $error; + + if ($error) + { + $this->last_error_result = $error; + } + else + { + $error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array(); + } + } + else + { + $error = array( + 'message' => $this->connect_error, + 'code' => '', + ); + } + + return $error; + } + + /** + * Close sql connection + * @access private + */ + function _sql_close() + { + return @ocilogoff($this->db_connect_id); + } + + /** + * Build db-specific report + * @access private + */ + function _sql_report($mode, $query = '') + { + switch ($mode) + { + case 'start': + + $html_table = false; + + // Grab a plan table, any will do + $sql = "SELECT table_name + FROM USER_TABLES + WHERE table_name LIKE '%PLAN_TABLE%'"; + $stmt = ociparse($this->db_connect_id, $sql); + ociexecute($stmt); + $result = array(); + + if (ocifetchinto($stmt, $result, OCI_ASSOC + OCI_RETURN_NULLS)) + { + $table = $result['TABLE_NAME']; + + // This is the statement_id that will allow us to track the plan + $statement_id = substr(md5($query), 0, 30); + + // Remove any stale plans + $stmt2 = ociparse($this->db_connect_id, "DELETE FROM $table WHERE statement_id='$statement_id'"); + ociexecute($stmt2); + ocifreestatement($stmt2); + + // Explain the plan + $sql = "EXPLAIN PLAN + SET STATEMENT_ID = '$statement_id' + FOR $query"; + $stmt2 = ociparse($this->db_connect_id, $sql); + ociexecute($stmt2); + ocifreestatement($stmt2); + + // Get the data from the plan + $sql = "SELECT operation, options, object_name, object_type, cardinality, cost + FROM plan_table + START WITH id = 0 AND statement_id = '$statement_id' + CONNECT BY PRIOR id = parent_id + AND statement_id = '$statement_id'"; + $stmt2 = ociparse($this->db_connect_id, $sql); + ociexecute($stmt2); + + $row = array(); + while (ocifetchinto($stmt2, $row, OCI_ASSOC + OCI_RETURN_NULLS)) + { + $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); + } + + ocifreestatement($stmt2); + + // Remove the plan we just made, we delete them on request anyway + $stmt2 = ociparse($this->db_connect_id, "DELETE FROM $table WHERE statement_id='$statement_id'"); + ociexecute($stmt2); + ocifreestatement($stmt2); + } + + ocifreestatement($stmt); + + if ($html_table) + { + $this->html_hold .= ''; + } + + break; + + case 'fromcache': + $endtime = explode(' ', microtime()); + $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)) + { + // Take the time spent on parsing rows into account + } + @ocifreestatement($result); + + $splittime = explode(' ', microtime()); + $splittime = $splittime[0] + $splittime[1]; + + $this->sql_report('record_fromcache', $query, $endtime, $splittime); + + break; + } + } +} diff --git a/sources/phpBB/phpbb/db/driver/postgres.php b/sources/phpBB/phpbb/db/driver/postgres.php new file mode 100644 index 0000000..a3b9aa4 --- /dev/null +++ b/sources/phpBB/phpbb/db/driver/postgres.php @@ -0,0 +1,490 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\driver; + +/** +* PostgreSQL Database Abstraction Layer +* Minimum Requirement is Version 8.3+ +*/ +class postgres extends \phpbb\db\driver\driver +{ + var $multi_insert = true; + var $last_query_text = ''; + var $connect_error = ''; + + /** + * {@inheritDoc} + */ + function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) + { + $connect_string = ''; + + if ($sqluser) + { + $connect_string .= "user=$sqluser "; + } + + if ($sqlpassword) + { + $connect_string .= "password=$sqlpassword "; + } + + if ($sqlserver) + { + // $sqlserver can carry a port separated by : for compatibility reasons + // If $sqlserver has more than one : it's probably an IPv6 address. + // In this case we only allow passing a port via the $port variable. + if (substr_count($sqlserver, ':') === 1) + { + list($sqlserver, $port) = explode(':', $sqlserver); + } + + if ($sqlserver !== 'localhost') + { + $connect_string .= "host=$sqlserver "; + } + + if ($port) + { + $connect_string .= "port=$port "; + } + } + + $schema = ''; + + if ($database) + { + $this->dbname = $database; + if (strpos($database, '.') !== false) + { + list($database, $schema) = explode('.', $database); + } + $connect_string .= "dbname=$database"; + } + + $this->persistency = $persistency; + + if ($this->persistency) + { + if (!function_exists('pg_pconnect')) + { + $this->connect_error = 'pg_pconnect function does not exist, is pgsql extension installed?'; + return $this->sql_error(''); + } + $collector = new \phpbb\error_collector; + $collector->install(); + $this->db_connect_id = (!$new_link) ? @pg_pconnect($connect_string) : @pg_pconnect($connect_string, PGSQL_CONNECT_FORCE_NEW); + } + else + { + if (!function_exists('pg_connect')) + { + $this->connect_error = 'pg_connect function does not exist, is pgsql extension installed?'; + return $this->sql_error(''); + } + $collector = new \phpbb\error_collector; + $collector->install(); + $this->db_connect_id = (!$new_link) ? @pg_connect($connect_string) : @pg_connect($connect_string, PGSQL_CONNECT_FORCE_NEW); + } + + $collector->uninstall(); + + if ($this->db_connect_id) + { + if ($schema !== '') + { + @pg_query($this->db_connect_id, 'SET search_path TO ' . $schema); + } + return $this->db_connect_id; + } + + $this->connect_error = $collector->format_errors(); + return $this->sql_error(''); + } + + /** + * {@inheritDoc} + */ + function sql_server_info($raw = false, $use_cache = true) + { + global $cache; + + 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); + + $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); + } + } + + return ($raw) ? $this->sql_server_version : 'PostgreSQL ' . $this->sql_server_version; + } + + /** + * SQL Transaction + * @access private + */ + function _sql_transaction($status = 'begin') + { + switch ($status) + { + case 'begin': + return @pg_query($this->db_connect_id, 'BEGIN'); + break; + + case 'commit': + return @pg_query($this->db_connect_id, 'COMMIT'); + break; + + case 'rollback': + return @pg_query($this->db_connect_id, 'ROLLBACK'); + break; + } + + return true; + } + + /** + * {@inheritDoc} + */ + function sql_query($query = '', $cache_ttl = 0) + { + if ($query != '') + { + global $cache; + + // EXPLAIN only in extra debug mode + if (defined('DEBUG')) + { + $this->sql_report('start', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->curtime = microtime(true); + } + + $this->last_query_text = $query; + $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false; + $this->sql_add_num_queries($this->query_result); + + if ($this->query_result === false) + { + if (($this->query_result = @pg_query($this->db_connect_id, $query)) === false) + { + $this->sql_error($query); + } + + if (defined('DEBUG')) + { + $this->sql_report('stop', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->sql_time += microtime(true) - $this->curtime; + } + + 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) + { + $this->open_queries[(int) $this->query_result] = $this->query_result; + } + } + else if (defined('DEBUG')) + { + $this->sql_report('fromcache', $query); + } + } + else + { + return false; + } + + return $this->query_result; + } + + /** + * Build db-specific query data + * @access private + */ + function _sql_custom_build($stage, $data) + { + return $data; + } + + /** + * Build LIMIT query + */ + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + { + $this->query_result = false; + + // if $total is set to 0 we do not want to limit the number of rows + if ($total == 0) + { + $total = 'ALL'; + } + + $query .= "\n LIMIT $total OFFSET $offset"; + + return $this->sql_query($query, $cache_ttl); + } + + /** + * {@inheritDoc} + */ + function sql_affectedrows() + { + return ($this->query_result) ? @pg_affected_rows($this->query_result) : false; + } + + /** + * {@inheritDoc} + */ + function sql_fetchrow($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && $cache->sql_exists($query_id)) + { + return $cache->sql_fetchrow($query_id); + } + + return ($query_id !== false) ? @pg_fetch_assoc($query_id, null) : false; + } + + /** + * {@inheritDoc} + */ + function sql_rowseek($rownum, &$query_id) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && $cache->sql_exists($query_id)) + { + return $cache->sql_rowseek($rownum, $query_id); + } + + return ($query_id !== false) ? @pg_result_seek($query_id, $rownum) : false; + } + + /** + * {@inheritDoc} + */ + function sql_nextid() + { + $query_id = $this->query_result; + + if ($query_id !== false && $this->last_query_text != '') + { + if (preg_match("/^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)/is", $this->last_query_text, $tablename)) + { + $query = "SELECT currval('" . $tablename[1] . "_seq') AS last_value"; + $temp_q_id = @pg_query($this->db_connect_id, $query); + + if (!$temp_q_id) + { + return false; + } + + $temp_result = @pg_fetch_assoc($temp_q_id, null); + @pg_free_result($query_id); + + return ($temp_result) ? $temp_result['last_value'] : false; + } + } + + return false; + } + + /** + * {@inheritDoc} + */ + function sql_freeresult($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && !is_object($query_id) && $cache->sql_exists($query_id)) + { + return $cache->sql_freeresult($query_id); + } + + if (isset($this->open_queries[(int) $query_id])) + { + unset($this->open_queries[(int) $query_id]); + return @pg_free_result($query_id); + } + + return false; + } + + /** + * {@inheritDoc} + */ + function sql_escape($msg) + { + return @pg_escape_string($msg); + } + + /** + * Build LIKE expression + * @access private + */ + function _sql_like_expression($expression) + { + return $expression; + } + + /** + * Build NOT LIKE expression + * @access private + */ + function _sql_not_like_expression($expression) + { + return $expression; + } + + /** + * {@inheritDoc} + */ + function cast_expr_to_bigint($expression) + { + return 'CAST(' . $expression . ' as DECIMAL(255, 0))'; + } + + /** + * {@inheritDoc} + */ + function cast_expr_to_string($expression) + { + return 'CAST(' . $expression . ' as VARCHAR(255))'; + } + + /** + * return sql error array + * @access private + */ + function _sql_error() + { + // pg_last_error only works when there is an established connection. + // Connection errors have to be tracked by us manually. + if ($this->db_connect_id) + { + $message = @pg_last_error($this->db_connect_id); + } + else + { + $message = $this->connect_error; + } + + return array( + 'message' => $message, + 'code' => '' + ); + } + + /** + * Close sql connection + * @access private + */ + function _sql_close() + { + return @pg_close($this->db_connect_id); + } + + /** + * Build db-specific report + * @access private + */ + function _sql_report($mode, $query = '') + { + switch ($mode) + { + case 'start': + + $explain_query = $query; + if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) + { + $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; + } + else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) + { + $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; + } + + if (preg_match('/^SELECT/', $explain_query)) + { + $html_table = false; + + if ($result = @pg_query($this->db_connect_id, "EXPLAIN $explain_query")) + { + while ($row = @pg_fetch_assoc($result, null)) + { + $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); + } + } + @pg_free_result($result); + + if ($html_table) + { + $this->html_hold .= ''; + } + } + + break; + + case 'fromcache': + $endtime = explode(' ', microtime()); + $endtime = $endtime[0] + $endtime[1]; + + $result = @pg_query($this->db_connect_id, $query); + while ($void = @pg_fetch_assoc($result, null)) + { + // Take the time spent on parsing rows into account + } + @pg_free_result($result); + + $splittime = explode(' ', microtime()); + $splittime = $splittime[0] + $splittime[1]; + + $this->sql_report('record_fromcache', $query, $endtime, $splittime); + + break; + } + } +} diff --git a/sources/phpBB/phpbb/db/driver/sqlite.php b/sources/phpBB/phpbb/db/driver/sqlite.php new file mode 100644 index 0000000..d5da0e2 --- /dev/null +++ b/sources/phpBB/phpbb/db/driver/sqlite.php @@ -0,0 +1,378 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\driver; + +/** +* Sqlite Database Abstraction Layer +* Minimum Requirement: 2.8.2+ +*/ +class sqlite extends \phpbb\db\driver\driver +{ + var $connect_error = ''; + + /** + * {@inheritDoc} + */ + function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) + { + $this->persistency = $persistency; + $this->user = $sqluser; + $this->server = $sqlserver . (($port) ? ':' . $port : ''); + $this->dbname = $database; + + $error = ''; + if ($this->persistency) + { + if (!function_exists('sqlite_popen')) + { + $this->connect_error = 'sqlite_popen function does not exist, is sqlite extension installed?'; + return $this->sql_error(''); + } + $this->db_connect_id = @sqlite_popen($this->server, 0666, $error); + } + else + { + if (!function_exists('sqlite_open')) + { + $this->connect_error = 'sqlite_open function does not exist, is sqlite extension installed?'; + return $this->sql_error(''); + } + $this->db_connect_id = @sqlite_open($this->server, 0666, $error); + } + + if ($this->db_connect_id) + { + @sqlite_query('PRAGMA short_column_names = 1', $this->db_connect_id); +// @sqlite_query('PRAGMA encoding = "UTF-8"', $this->db_connect_id); + } + + return ($this->db_connect_id) ? true : array('message' => $error); + } + + /** + * {@inheritDoc} + */ + function sql_server_info($raw = false, $use_cache = true) + { + global $cache; + + 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); + + $this->sql_server_version = (!empty($row['version'])) ? $row['version'] : 0; + + if (!empty($cache) && $use_cache) + { + $cache->put('sqlite_version', $this->sql_server_version); + } + } + + return ($raw) ? $this->sql_server_version : 'SQLite ' . $this->sql_server_version; + } + + /** + * SQL Transaction + * @access private + */ + function _sql_transaction($status = 'begin') + { + switch ($status) + { + case 'begin': + return @sqlite_query('BEGIN', $this->db_connect_id); + break; + + case 'commit': + return @sqlite_query('COMMIT', $this->db_connect_id); + break; + + case 'rollback': + return @sqlite_query('ROLLBACK', $this->db_connect_id); + break; + } + + return true; + } + + /** + * {@inheritDoc} + */ + function sql_query($query = '', $cache_ttl = 0) + { + if ($query != '') + { + global $cache; + + // EXPLAIN only in extra debug mode + if (defined('DEBUG')) + { + $this->sql_report('start', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->curtime = microtime(true); + } + + $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false; + $this->sql_add_num_queries($this->query_result); + + if ($this->query_result === false) + { + if (($this->query_result = @sqlite_query($query, $this->db_connect_id)) === false) + { + $this->sql_error($query); + } + + if (defined('DEBUG')) + { + $this->sql_report('stop', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->sql_time += microtime(true) - $this->curtime; + } + + 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) + { + $this->open_queries[(int) $this->query_result] = $this->query_result; + } + } + else if (defined('DEBUG')) + { + $this->sql_report('fromcache', $query); + } + } + else + { + return false; + } + + return $this->query_result; + } + + /** + * Build LIMIT query + */ + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + { + $this->query_result = false; + + // if $total is set to 0 we do not want to limit the number of rows + if ($total == 0) + { + $total = -1; + } + + $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total); + + return $this->sql_query($query, $cache_ttl); + } + + /** + * {@inheritDoc} + */ + function sql_affectedrows() + { + return ($this->db_connect_id) ? @sqlite_changes($this->db_connect_id) : false; + } + + /** + * {@inheritDoc} + */ + function sql_fetchrow($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && $cache->sql_exists($query_id)) + { + return $cache->sql_fetchrow($query_id); + } + + return ($query_id !== false) ? @sqlite_fetch_array($query_id, SQLITE_ASSOC) : false; + } + + /** + * {@inheritDoc} + */ + function sql_rowseek($rownum, &$query_id) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && $cache->sql_exists($query_id)) + { + return $cache->sql_rowseek($rownum, $query_id); + } + + return ($query_id !== false) ? @sqlite_seek($query_id, $rownum) : false; + } + + /** + * {@inheritDoc} + */ + function sql_nextid() + { + return ($this->db_connect_id) ? @sqlite_last_insert_rowid($this->db_connect_id) : false; + } + + /** + * {@inheritDoc} + */ + function sql_freeresult($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && !is_object($query_id) && $cache->sql_exists($query_id)) + { + return $cache->sql_freeresult($query_id); + } + + return true; + } + + /** + * {@inheritDoc} + */ + function sql_escape($msg) + { + return @sqlite_escape_string($msg); + } + + /** + * {@inheritDoc} + * + * For SQLite an underscore is a not-known character... this may change with SQLite3 + */ + function sql_like_expression($expression) + { + // Unlike LIKE, GLOB is unfortunately case sensitive. + // We only catch * and ? here, not the character map possible on file globbing. + $expression = str_replace(array(chr(0) . '_', chr(0) . '%'), array(chr(0) . '?', chr(0) . '*'), $expression); + + $expression = str_replace(array('?', '*'), array("\?", "\*"), $expression); + $expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression); + + return 'GLOB \'' . $this->sql_escape($expression) . '\''; + } + + /** + * {@inheritDoc} + * + * For SQLite an underscore is a not-known character... + */ + function sql_not_like_expression($expression) + { + // Unlike NOT LIKE, NOT GLOB is unfortunately case sensitive. + // We only catch * and ? here, not the character map possible on file globbing. + $expression = str_replace(array(chr(0) . '_', chr(0) . '%'), array(chr(0) . '?', chr(0) . '*'), $expression); + + $expression = str_replace(array('?', '*'), array("\?", "\*"), $expression); + $expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression); + + return 'NOT GLOB \'' . $this->sql_escape($expression) . '\''; + } + + /** + * return sql error array + * @access private + */ + function _sql_error() + { + if (function_exists('sqlite_error_string')) + { + $error = array( + 'message' => @sqlite_error_string(@sqlite_last_error($this->db_connect_id)), + 'code' => @sqlite_last_error($this->db_connect_id), + ); + } + else + { + $error = array( + 'message' => $this->connect_error, + 'code' => '', + ); + } + + return $error; + } + + /** + * Build db-specific query data + * @access private + */ + function _sql_custom_build($stage, $data) + { + return $data; + } + + /** + * Close sql connection + * @access private + */ + function _sql_close() + { + return @sqlite_close($this->db_connect_id); + } + + /** + * Build db-specific report + * @access private + */ + function _sql_report($mode, $query = '') + { + switch ($mode) + { + case 'start': + break; + + case 'fromcache': + $endtime = explode(' ', microtime()); + $endtime = $endtime[0] + $endtime[1]; + + $result = @sqlite_query($query, $this->db_connect_id); + while ($void = @sqlite_fetch_array($result, SQLITE_ASSOC)) + { + // Take the time spent on parsing rows into account + } + + $splittime = explode(' ', microtime()); + $splittime = $splittime[0] + $splittime[1]; + + $this->sql_report('record_fromcache', $query, $endtime, $splittime); + + break; + } + } +} diff --git a/sources/phpBB/phpbb/db/driver/sqlite3.php b/sources/phpBB/phpbb/db/driver/sqlite3.php new file mode 100644 index 0000000..4e3e0d3 --- /dev/null +++ b/sources/phpBB/phpbb/db/driver/sqlite3.php @@ -0,0 +1,404 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\driver; + +/** +* SQLite3 Database Abstraction Layer +* Minimum Requirement: 3.6.15+ +*/ +class sqlite3 extends \phpbb\db\driver\driver +{ + /** + * @var string Stores errors during connection setup in case the driver is not available + */ + protected $connect_error = ''; + + /** + * @var \SQLite3 The SQLite3 database object to operate against + */ + protected $dbo = null; + + /** + * {@inheritDoc} + */ + public function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) + { + $this->persistency = false; + $this->user = $sqluser; + $this->server = $sqlserver . (($port) ? ':' . $port : ''); + $this->dbname = $database; + + if (!class_exists('SQLite3', false)) + { + $this->connect_error = 'SQLite3 not found, is the extension installed?'; + return $this->sql_error(''); + } + + try + { + $this->dbo = new \SQLite3($this->server, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE); + $this->db_connect_id = true; + } + catch (\Exception $e) + { + $this->connect_error = $e->getMessage(); + return array('message' => $this->connect_error); + } + + return true; + } + + /** + * {@inheritDoc} + */ + public function sql_server_info($raw = false, $use_cache = true) + { + global $cache; + + if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('sqlite_version')) === false) + { + $version = \SQLite3::version(); + + $this->sql_server_version = $version['versionString']; + + if (!empty($cache) && $use_cache) + { + $cache->put('sqlite_version', $this->sql_server_version); + } + } + + return ($raw) ? $this->sql_server_version : 'SQLite ' . $this->sql_server_version; + } + + /** + * SQL Transaction + * + * @param string $status Should be one of the following strings: + * begin, commit, rollback + * @return bool Success/failure of the transaction query + */ + protected function _sql_transaction($status = 'begin') + { + switch ($status) + { + case 'begin': + return $this->dbo->exec('BEGIN IMMEDIATE'); + break; + + case 'commit': + return $this->dbo->exec('COMMIT'); + break; + + case 'rollback': + return $this->dbo->exec('ROLLBACK'); + break; + } + + return true; + } + + /** + * {@inheritDoc} + */ + public function sql_query($query = '', $cache_ttl = 0) + { + if ($query != '') + { + global $cache; + + // EXPLAIN only in extra debug mode + if (defined('DEBUG')) + { + $this->sql_report('start', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->curtime = microtime(true); + } + + $this->last_query_text = $query; + $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false; + $this->sql_add_num_queries($this->query_result); + + if ($this->query_result === false) + { + if (($this->query_result = @$this->dbo->query($query)) === false) + { + $this->sql_error($query); + } + + if (defined('DEBUG')) + { + $this->sql_report('stop', $query); + } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->sql_time += microtime(true) - $this->curtime; + } + + if ($cache && $cache_ttl) + { + $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl); + } + } + else if (defined('DEBUG')) + { + $this->sql_report('fromcache', $query); + } + } + else + { + return false; + } + + return $this->query_result; + } + + /** + * Build LIMIT query + * + * @param string $query The SQL query to execute + * @param int $total The number of rows to select + * @param int $offset + * @param int $cache_ttl Either 0 to avoid caching or + * the time in seconds which the result shall be kept in cache + * @return mixed Buffered, seekable result handle, false on error + */ + protected function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + { + $this->query_result = false; + + // if $total is set to 0 we do not want to limit the number of rows + if ($total == 0) + { + $total = -1; + } + + $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total); + + return $this->sql_query($query, $cache_ttl); + } + + /** + * {@inheritDoc} + */ + public function sql_affectedrows() + { + return ($this->db_connect_id) ? $this->dbo->changes() : false; + } + + /** + * {@inheritDoc} + */ + public function sql_fetchrow($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && !is_object($query_id) && $cache->sql_exists($query_id)) + { + return $cache->sql_fetchrow($query_id); + } + + return is_object($query_id) ? $query_id->fetchArray(SQLITE3_ASSOC) : false; + } + + /** + * {@inheritDoc} + */ + public function sql_nextid() + { + return ($this->db_connect_id) ? $this->dbo->lastInsertRowID() : false; + } + + /** + * {@inheritDoc} + */ + public function sql_freeresult($query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($cache && !is_object($query_id) && $cache->sql_exists($query_id)) + { + return $cache->sql_freeresult($query_id); + } + + if ($query_id) + { + return @$query_id->finalize(); + } + } + + /** + * {@inheritDoc} + */ + public function sql_escape($msg) + { + return \SQLite3::escapeString($msg); + } + + /** + * {@inheritDoc} + * + * For SQLite an underscore is an unknown character. + */ + public function sql_like_expression($expression) + { + // Unlike LIKE, GLOB is unfortunately case sensitive. + // We only catch * and ? here, not the character map possible on file globbing. + $expression = str_replace(array(chr(0) . '_', chr(0) . '%'), array(chr(0) . '?', chr(0) . '*'), $expression); + + $expression = str_replace(array('?', '*'), array("\?", "\*"), $expression); + $expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression); + + return 'GLOB \'' . $this->sql_escape($expression) . '\''; + } + + /** + * {@inheritDoc} + * + * For SQLite an underscore is an unknown character. + */ + public function sql_not_like_expression($expression) + { + // Unlike NOT LIKE, NOT GLOB is unfortunately case sensitive + // We only catch * and ? here, not the character map possible on file globbing. + $expression = str_replace(array(chr(0) . '_', chr(0) . '%'), array(chr(0) . '?', chr(0) . '*'), $expression); + + $expression = str_replace(array('?', '*'), array("\?", "\*"), $expression); + $expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression); + + return 'NOT GLOB \'' . $this->sql_escape($expression) . '\''; + } + + /** + * return sql error array + * + * @return array + */ + protected function _sql_error() + { + if (class_exists('SQLite3', false) && isset($this->dbo)) + { + $error = array( + 'message' => $this->dbo->lastErrorMsg(), + 'code' => $this->dbo->lastErrorCode(), + ); + } + else + { + $error = array( + 'message' => $this->connect_error, + 'code' => '', + ); + } + + return $error; + } + + /** + * Build db-specific query data + * + * @param string $stage Available stages: FROM, WHERE + * @param mixed $data A string containing the CROSS JOIN query or an array of WHERE clauses + * + * @return string The db-specific query fragment + */ + protected function _sql_custom_build($stage, $data) + { + return $data; + } + + /** + * Close sql connection + * + * @return bool False if failure + */ + protected function _sql_close() + { + return $this->dbo->close(); + } + + /** + * Build db-specific report + * + * @param string $mode Available modes: display, start, stop, + * add_select_row, fromcache, record_fromcache + * @param string $query The Query that should be explained + * @return mixed Either a full HTML page, boolean or null + */ + protected function _sql_report($mode, $query = '') + { + switch ($mode) + { + case 'start': + + $explain_query = $query; + if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) + { + $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; + } + else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) + { + $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; + } + + if (preg_match('/^SELECT/', $explain_query)) + { + $html_table = false; + + if ($result = $this->dbo->query("EXPLAIN QUERY PLAN $explain_query")) + { + while ($row = $result->fetchArray(SQLITE3_ASSOC)) + { + $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); + } + } + + if ($html_table) + { + $this->html_hold .= ''; + } + } + + break; + + case 'fromcache': + $endtime = explode(' ', microtime()); + $endtime = $endtime[0] + $endtime[1]; + + $result = $this->dbo->query($query); + while ($void = $result->fetchArray(SQLITE3_ASSOC)) + { + // Take the time spent on parsing rows into account + } + + $splittime = explode(' ', microtime()); + $splittime = $splittime[0] + $splittime[1]; + + $this->sql_report('record_fromcache', $query, $endtime, $splittime); + + break; + } + } +} diff --git a/sources/phpBB/phpbb/db/html_migrator_output_handler.php b/sources/phpBB/phpbb/db/html_migrator_output_handler.php new file mode 100644 index 0000000..e37c667 --- /dev/null +++ b/sources/phpBB/phpbb/db/html_migrator_output_handler.php @@ -0,0 +1,48 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db; + +use phpbb\user; + +class html_migrator_output_handler implements migrator_output_handler_interface +{ + /** + * User object. + * + * @var user + */ + private $user; + + /** + * Constructor + * + * @param user $user User object + */ + public function __construct(user $user) + { + $this->user = $user; + } + + /** + * {@inheritdoc} + */ + public function write($message, $verbosity) + { + if ($verbosity <= migrator_output_handler_interface::VERBOSITY_VERBOSE) + { + $final_message = call_user_func_array(array($this->user, 'lang'), $message); + echo $final_message . "
\n"; + } + } +} diff --git a/sources/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php b/sources/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php new file mode 100644 index 0000000..94c293d --- /dev/null +++ b/sources/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php @@ -0,0 +1,95 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db; + +use phpbb\user; + +class log_wrapper_migrator_output_handler implements migrator_output_handler_interface +{ + /** + * User object. + * + * @var user + */ + protected $user; + + /** + * A migrator output handler + * + * @var migrator_output_handler_interface + */ + protected $migrator; + + /** + * Log file handle + * @var resource + */ + protected $file_handle = false; + + /** + * Constructor + * + * @param user $user User object + * @param migrator_output_handler_interface $migrator Migrator output handler + * @param string $log_file File to log to + */ + public function __construct(user $user, migrator_output_handler_interface $migrator, $log_file) + { + $this->user = $user; + $this->migrator = $migrator; + $this->file_open($log_file); + } + + /** + * Open file for logging + * + * @param string $file File to open + */ + protected function file_open($file) + { + if (phpbb_is_writable(dirname($file))) + { + $this->file_handle = fopen($file, 'w'); + } + else + { + throw new \RuntimeException('Unable to write to migrator log file'); + } + } + + /** + * {@inheritdoc} + */ + public function write($message, $verbosity) + { + $this->migrator->write($message, $verbosity); + + if ($this->file_handle !== false) + { + $translated_message = call_user_func_array(array($this->user, 'lang'), $message) . "\n"; + + if ($verbosity <= migrator_output_handler_interface::VERBOSITY_NORMAL) + { + $translated_message = '[INFO] ' . $translated_message; + } + else + { + $translated_message = '[DEBUG] ' . $translated_message; + } + + fwrite($this->file_handle, $translated_message); + fflush($this->file_handle); + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/container_aware_migration.php b/sources/phpBB/phpbb/db/migration/container_aware_migration.php new file mode 100644 index 0000000..3b4b49b --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/container_aware_migration.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration; + +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** +* Abstract base class for container aware database migrations. +*/ +abstract class container_aware_migration extends migration implements ContainerAwareInterface +{ + /** + * @var ContainerInterface + */ + protected $container; + + /** + * {@inheritdoc} + */ + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php b/sources/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php new file mode 100644 index 0000000..648ae9c --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php @@ -0,0 +1,70 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class local_url_bbcode extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_12_rc1'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_local_url_bbcode'))), + ); + } + + /** + * Update BBCodes that currently use the LOCAL_URL tag + * + * To fix http://tracker.phpbb.com/browse/PHPBB3-8319 we changed + * the second_pass_replace value, so that needs updating for existing ones + */ + public function update_local_url_bbcode() + { + $sql = 'SELECT * + FROM ' . BBCODES_TABLE . ' + WHERE bbcode_match ' . $this->db->sql_like_expression($this->db->get_any_char() . 'LOCAL_URL' . $this->db->get_any_char()); + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + if (!class_exists('acp_bbcodes')) + { + if (function_exists('phpbb_require_updated')) + { + phpbb_require_updated('includes/acp/acp_bbcodes.' . $this->php_ext); + } + else + { + require($this->phpbb_root_path . 'includes/acp/acp_bbcodes.' . $this->php_ext); + } + } + + $bbcode_match = $row['bbcode_match']; + $bbcode_tpl = $row['bbcode_tpl']; + + $acp_bbcodes = new \acp_bbcodes(); + $sql_ary = $acp_bbcodes->build_regexp($bbcode_match, $bbcode_tpl); + + $sql = 'UPDATE ' . BBCODES_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE bbcode_id = ' . (int) $row['bbcode_id']; + $this->sql_query($sql); + } + $this->db->sql_freeresult($result); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_0.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_0.php new file mode 100644 index 0000000..26937d6 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_0.php @@ -0,0 +1,1181 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_0 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.0', '>='); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'attachments' => array( + 'COLUMNS' => array( + 'attach_id' => array('UINT', NULL, 'auto_increment'), + 'post_msg_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + 'in_message' => array('BOOL', 0), + 'poster_id' => array('UINT', 0), + 'is_orphan' => array('BOOL', 1), + 'physical_filename' => array('VCHAR', ''), + 'real_filename' => array('VCHAR', ''), + 'download_count' => array('UINT', 0), + 'attach_comment' => array('TEXT_UNI', ''), + 'extension' => array('VCHAR:100', ''), + 'mimetype' => array('VCHAR:100', ''), + 'filesize' => array('UINT:20', 0), + 'filetime' => array('TIMESTAMP', 0), + 'thumbnail' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'attach_id', + 'KEYS' => array( + 'filetime' => array('INDEX', 'filetime'), + 'post_msg_id' => array('INDEX', 'post_msg_id'), + 'topic_id' => array('INDEX', 'topic_id'), + 'poster_id' => array('INDEX', 'poster_id'), + 'is_orphan' => array('INDEX', 'is_orphan'), + ), + ), + + $this->table_prefix . 'acl_groups' => array( + 'COLUMNS' => array( + 'group_id' => array('UINT', 0), + 'forum_id' => array('UINT', 0), + 'auth_option_id' => array('UINT', 0), + 'auth_role_id' => array('UINT', 0), + 'auth_setting' => array('TINT:2', 0), + ), + 'KEYS' => array( + 'group_id' => array('INDEX', 'group_id'), + 'auth_opt_id' => array('INDEX', 'auth_option_id'), + 'auth_role_id' => array('INDEX', 'auth_role_id'), + ), + ), + + $this->table_prefix . 'acl_options' => array( + 'COLUMNS' => array( + 'auth_option_id' => array('UINT', NULL, 'auto_increment'), + 'auth_option' => array('VCHAR:50', ''), + 'is_global' => array('BOOL', 0), + 'is_local' => array('BOOL', 0), + 'founder_only' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'auth_option_id', + 'KEYS' => array( + 'auth_option' => array('INDEX', 'auth_option'), + ), + ), + + $this->table_prefix . 'acl_roles' => array( + 'COLUMNS' => array( + 'role_id' => array('UINT', NULL, 'auto_increment'), + 'role_name' => array('VCHAR_UNI', ''), + 'role_description' => array('TEXT_UNI', ''), + 'role_type' => array('VCHAR:10', ''), + 'role_order' => array('USINT', 0), + ), + 'PRIMARY_KEY' => 'role_id', + 'KEYS' => array( + 'role_type' => array('INDEX', 'role_type'), + 'role_order' => array('INDEX', 'role_order'), + ), + ), + + $this->table_prefix . 'acl_roles_data' => array( + 'COLUMNS' => array( + 'role_id' => array('UINT', 0), + 'auth_option_id' => array('UINT', 0), + 'auth_setting' => array('TINT:2', 0), + ), + 'PRIMARY_KEY' => array('role_id', 'auth_option_id'), + 'KEYS' => array( + 'ath_op_id' => array('INDEX', 'auth_option_id'), + ), + ), + + $this->table_prefix . 'acl_users' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'forum_id' => array('UINT', 0), + 'auth_option_id' => array('UINT', 0), + 'auth_role_id' => array('UINT', 0), + 'auth_setting' => array('TINT:2', 0), + ), + 'KEYS' => array( + 'user_id' => array('INDEX', 'user_id'), + 'auth_option_id' => array('INDEX', 'auth_option_id'), + 'auth_role_id' => array('INDEX', 'auth_role_id'), + ), + ), + + $this->table_prefix . 'banlist' => array( + 'COLUMNS' => array( + 'ban_id' => array('UINT', NULL, 'auto_increment'), + 'ban_userid' => array('UINT', 0), + 'ban_ip' => array('VCHAR:40', ''), + 'ban_email' => array('VCHAR_UNI:100', ''), + 'ban_start' => array('TIMESTAMP', 0), + 'ban_end' => array('TIMESTAMP', 0), + 'ban_exclude' => array('BOOL', 0), + 'ban_reason' => array('VCHAR_UNI', ''), + 'ban_give_reason' => array('VCHAR_UNI', ''), + ), + 'PRIMARY_KEY' => 'ban_id', + 'KEYS' => array( + 'ban_end' => array('INDEX', 'ban_end'), + 'ban_user' => array('INDEX', array('ban_userid', 'ban_exclude')), + 'ban_email' => array('INDEX', array('ban_email', 'ban_exclude')), + 'ban_ip' => array('INDEX', array('ban_ip', 'ban_exclude')), + ), + ), + + $this->table_prefix . 'bbcodes' => array( + 'COLUMNS' => array( + 'bbcode_id' => array('TINT:3', 0), + 'bbcode_tag' => array('VCHAR:16', ''), + 'bbcode_helpline' => array('VCHAR_UNI', ''), + 'display_on_posting' => array('BOOL', 0), + 'bbcode_match' => array('TEXT_UNI', ''), + 'bbcode_tpl' => array('MTEXT_UNI', ''), + 'first_pass_match' => array('MTEXT_UNI', ''), + 'first_pass_replace' => array('MTEXT_UNI', ''), + 'second_pass_match' => array('MTEXT_UNI', ''), + 'second_pass_replace' => array('MTEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'bbcode_id', + 'KEYS' => array( + 'display_on_post' => array('INDEX', 'display_on_posting'), + ), + ), + + $this->table_prefix . 'bookmarks' => array( + 'COLUMNS' => array( + 'topic_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + ), + 'PRIMARY_KEY' => array('topic_id', 'user_id'), + ), + + $this->table_prefix . 'bots' => array( + 'COLUMNS' => array( + 'bot_id' => array('UINT', NULL, 'auto_increment'), + 'bot_active' => array('BOOL', 1), + 'bot_name' => array('STEXT_UNI', ''), + 'user_id' => array('UINT', 0), + 'bot_agent' => array('VCHAR', ''), + 'bot_ip' => array('VCHAR', ''), + ), + 'PRIMARY_KEY' => 'bot_id', + 'KEYS' => array( + 'bot_active' => array('INDEX', 'bot_active'), + ), + ), + + $this->table_prefix . 'config' => array( + 'COLUMNS' => array( + 'config_name' => array('VCHAR', ''), + 'config_value' => array('VCHAR_UNI', ''), + 'is_dynamic' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'config_name', + 'KEYS' => array( + 'is_dynamic' => array('INDEX', 'is_dynamic'), + ), + ), + + $this->table_prefix . 'confirm' => array( + 'COLUMNS' => array( + 'confirm_id' => array('CHAR:32', ''), + 'session_id' => array('CHAR:32', ''), + 'confirm_type' => array('TINT:3', 0), + 'code' => array('VCHAR:8', ''), + 'seed' => array('UINT:10', 0), + ), + 'PRIMARY_KEY' => array('session_id', 'confirm_id'), + 'KEYS' => array( + 'confirm_type' => array('INDEX', 'confirm_type'), + ), + ), + + $this->table_prefix . 'disallow' => array( + 'COLUMNS' => array( + 'disallow_id' => array('UINT', NULL, 'auto_increment'), + 'disallow_username' => array('VCHAR_UNI:255', ''), + ), + 'PRIMARY_KEY' => 'disallow_id', + ), + + $this->table_prefix . 'drafts' => array( + 'COLUMNS' => array( + 'draft_id' => array('UINT', NULL, 'auto_increment'), + 'user_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + 'forum_id' => array('UINT', 0), + 'save_time' => array('TIMESTAMP', 0), + 'draft_subject' => array('XSTEXT_UNI', ''), + 'draft_message' => array('MTEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'draft_id', + 'KEYS' => array( + 'save_time' => array('INDEX', 'save_time'), + ), + ), + + $this->table_prefix . 'extensions' => array( + 'COLUMNS' => array( + 'extension_id' => array('UINT', NULL, 'auto_increment'), + 'group_id' => array('UINT', 0), + 'extension' => array('VCHAR:100', ''), + ), + 'PRIMARY_KEY' => 'extension_id', + ), + + $this->table_prefix . 'extension_groups' => array( + 'COLUMNS' => array( + 'group_id' => array('UINT', NULL, 'auto_increment'), + 'group_name' => array('VCHAR_UNI', ''), + 'cat_id' => array('TINT:2', 0), + 'allow_group' => array('BOOL', 0), + 'download_mode' => array('BOOL', 1), + 'upload_icon' => array('VCHAR', ''), + 'max_filesize' => array('UINT:20', 0), + 'allowed_forums' => array('TEXT', ''), + 'allow_in_pm' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'group_id', + ), + + $this->table_prefix . 'forums' => array( + 'COLUMNS' => array( + 'forum_id' => array('UINT', NULL, 'auto_increment'), + 'parent_id' => array('UINT', 0), + 'left_id' => array('UINT', 0), + 'right_id' => array('UINT', 0), + 'forum_parents' => array('MTEXT', ''), + 'forum_name' => array('STEXT_UNI', ''), + 'forum_desc' => array('TEXT_UNI', ''), + 'forum_desc_bitfield' => array('VCHAR:255', ''), + 'forum_desc_options' => array('UINT:11', 7), + 'forum_desc_uid' => array('VCHAR:8', ''), + 'forum_link' => array('VCHAR_UNI', ''), + 'forum_password' => array('VCHAR_UNI:40', ''), + 'forum_style' => array('USINT', 0), + 'forum_image' => array('VCHAR', ''), + 'forum_rules' => array('TEXT_UNI', ''), + 'forum_rules_link' => array('VCHAR_UNI', ''), + 'forum_rules_bitfield' => array('VCHAR:255', ''), + 'forum_rules_options' => array('UINT:11', 7), + 'forum_rules_uid' => array('VCHAR:8', ''), + 'forum_topics_per_page' => array('TINT:4', 0), + 'forum_type' => array('TINT:4', 0), + 'forum_status' => array('TINT:4', 0), + 'forum_posts' => array('UINT', 0), + 'forum_topics' => array('UINT', 0), + 'forum_topics_real' => array('UINT', 0), + 'forum_last_post_id' => array('UINT', 0), + 'forum_last_poster_id' => array('UINT', 0), + 'forum_last_post_subject' => array('XSTEXT_UNI', ''), + 'forum_last_post_time' => array('TIMESTAMP', 0), + 'forum_last_poster_name'=> array('VCHAR_UNI', ''), + 'forum_last_poster_colour'=> array('VCHAR:6', ''), + 'forum_flags' => array('TINT:4', 32), + 'display_on_index' => array('BOOL', 1), + 'enable_indexing' => array('BOOL', 1), + 'enable_icons' => array('BOOL', 1), + 'enable_prune' => array('BOOL', 0), + 'prune_next' => array('TIMESTAMP', 0), + 'prune_days' => array('UINT', 0), + 'prune_viewed' => array('UINT', 0), + 'prune_freq' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'forum_id', + 'KEYS' => array( + 'left_right_id' => array('INDEX', array('left_id', 'right_id')), + 'forum_lastpost_id' => array('INDEX', 'forum_last_post_id'), + ), + ), + + $this->table_prefix . 'forums_access' => array( + 'COLUMNS' => array( + 'forum_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'session_id' => array('CHAR:32', ''), + ), + 'PRIMARY_KEY' => array('forum_id', 'user_id', 'session_id'), + ), + + $this->table_prefix . 'forums_track' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'forum_id' => array('UINT', 0), + 'mark_time' => array('TIMESTAMP', 0), + ), + 'PRIMARY_KEY' => array('user_id', 'forum_id'), + ), + + $this->table_prefix . 'forums_watch' => array( + 'COLUMNS' => array( + 'forum_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'notify_status' => array('BOOL', 0), + ), + 'KEYS' => array( + 'forum_id' => array('INDEX', 'forum_id'), + 'user_id' => array('INDEX', 'user_id'), + 'notify_stat' => array('INDEX', 'notify_status'), + ), + ), + + $this->table_prefix . 'groups' => array( + 'COLUMNS' => array( + 'group_id' => array('UINT', NULL, 'auto_increment'), + 'group_type' => array('TINT:4', 1), + 'group_founder_manage' => array('BOOL', 0), + 'group_name' => array('VCHAR_CI', ''), + 'group_desc' => array('TEXT_UNI', ''), + 'group_desc_bitfield' => array('VCHAR:255', ''), + 'group_desc_options' => array('UINT:11', 7), + 'group_desc_uid' => array('VCHAR:8', ''), + 'group_display' => array('BOOL', 0), + 'group_avatar' => array('VCHAR', ''), + 'group_avatar_type' => array('TINT:2', 0), + 'group_avatar_width' => array('USINT', 0), + 'group_avatar_height' => array('USINT', 0), + 'group_rank' => array('UINT', 0), + 'group_colour' => array('VCHAR:6', ''), + 'group_sig_chars' => array('UINT', 0), + 'group_receive_pm' => array('BOOL', 0), + 'group_message_limit' => array('UINT', 0), + 'group_legend' => array('BOOL', 1), + ), + 'PRIMARY_KEY' => 'group_id', + 'KEYS' => array( + 'group_legend' => array('INDEX', 'group_legend'), + ), + ), + + $this->table_prefix . 'icons' => array( + 'COLUMNS' => array( + 'icons_id' => array('UINT', NULL, 'auto_increment'), + 'icons_url' => array('VCHAR', ''), + 'icons_width' => array('TINT:4', 0), + 'icons_height' => array('TINT:4', 0), + 'icons_order' => array('UINT', 0), + 'display_on_posting' => array('BOOL', 1), + ), + 'PRIMARY_KEY' => 'icons_id', + 'KEYS' => array( + 'display_on_posting' => array('INDEX', 'display_on_posting'), + ), + ), + + $this->table_prefix . 'lang' => array( + 'COLUMNS' => array( + 'lang_id' => array('TINT:4', NULL, 'auto_increment'), + 'lang_iso' => array('VCHAR:30', ''), + 'lang_dir' => array('VCHAR:30', ''), + 'lang_english_name' => array('VCHAR_UNI:100', ''), + 'lang_local_name' => array('VCHAR_UNI:255', ''), + 'lang_author' => array('VCHAR_UNI:255', ''), + ), + 'PRIMARY_KEY' => 'lang_id', + 'KEYS' => array( + 'lang_iso' => array('INDEX', 'lang_iso'), + ), + ), + + $this->table_prefix . 'log' => array( + 'COLUMNS' => array( + 'log_id' => array('UINT', NULL, 'auto_increment'), + 'log_type' => array('TINT:4', 0), + 'user_id' => array('UINT', 0), + 'forum_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + 'reportee_id' => array('UINT', 0), + 'log_ip' => array('VCHAR:40', ''), + 'log_time' => array('TIMESTAMP', 0), + 'log_operation' => array('TEXT_UNI', ''), + 'log_data' => array('MTEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'log_id', + 'KEYS' => array( + 'log_type' => array('INDEX', 'log_type'), + 'forum_id' => array('INDEX', 'forum_id'), + 'topic_id' => array('INDEX', 'topic_id'), + 'reportee_id' => array('INDEX', 'reportee_id'), + 'user_id' => array('INDEX', 'user_id'), + ), + ), + + $this->table_prefix . 'moderator_cache' => array( + 'COLUMNS' => array( + 'forum_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'username' => array('VCHAR_UNI:255', ''), + 'group_id' => array('UINT', 0), + 'group_name' => array('VCHAR_UNI', ''), + 'display_on_index' => array('BOOL', 1), + ), + 'KEYS' => array( + 'disp_idx' => array('INDEX', 'display_on_index'), + 'forum_id' => array('INDEX', 'forum_id'), + ), + ), + + $this->table_prefix . 'modules' => array( + 'COLUMNS' => array( + 'module_id' => array('UINT', NULL, 'auto_increment'), + 'module_enabled' => array('BOOL', 1), + 'module_display' => array('BOOL', 1), + 'module_basename' => array('VCHAR', ''), + 'module_class' => array('VCHAR:10', ''), + 'parent_id' => array('UINT', 0), + 'left_id' => array('UINT', 0), + 'right_id' => array('UINT', 0), + 'module_langname' => array('VCHAR', ''), + 'module_mode' => array('VCHAR', ''), + 'module_auth' => array('VCHAR', ''), + ), + 'PRIMARY_KEY' => 'module_id', + 'KEYS' => array( + 'left_right_id' => array('INDEX', array('left_id', 'right_id')), + 'module_enabled' => array('INDEX', 'module_enabled'), + 'class_left_id' => array('INDEX', array('module_class', 'left_id')), + ), + ), + + $this->table_prefix . 'poll_options' => array( + 'COLUMNS' => array( + 'poll_option_id' => array('TINT:4', 0), + 'topic_id' => array('UINT', 0), + 'poll_option_text' => array('TEXT_UNI', ''), + 'poll_option_total' => array('UINT', 0), + ), + 'KEYS' => array( + 'poll_opt_id' => array('INDEX', 'poll_option_id'), + 'topic_id' => array('INDEX', 'topic_id'), + ), + ), + + $this->table_prefix . 'poll_votes' => array( + 'COLUMNS' => array( + 'topic_id' => array('UINT', 0), + 'poll_option_id' => array('TINT:4', 0), + 'vote_user_id' => array('UINT', 0), + 'vote_user_ip' => array('VCHAR:40', ''), + ), + 'KEYS' => array( + 'topic_id' => array('INDEX', 'topic_id'), + 'vote_user_id' => array('INDEX', 'vote_user_id'), + 'vote_user_ip' => array('INDEX', 'vote_user_ip'), + ), + ), + + $this->table_prefix . 'posts' => array( + 'COLUMNS' => array( + 'post_id' => array('UINT', NULL, 'auto_increment'), + 'topic_id' => array('UINT', 0), + 'forum_id' => array('UINT', 0), + 'poster_id' => array('UINT', 0), + 'icon_id' => array('UINT', 0), + 'poster_ip' => array('VCHAR:40', ''), + 'post_time' => array('TIMESTAMP', 0), + 'post_approved' => array('BOOL', 1), + 'post_reported' => array('BOOL', 0), + 'enable_bbcode' => array('BOOL', 1), + 'enable_smilies' => array('BOOL', 1), + 'enable_magic_url' => array('BOOL', 1), + 'enable_sig' => array('BOOL', 1), + 'post_username' => array('VCHAR_UNI:255', ''), + 'post_subject' => array('XSTEXT_UNI', '', 'true_sort'), + 'post_text' => array('MTEXT_UNI', ''), + 'post_checksum' => array('VCHAR:32', ''), + 'post_attachment' => array('BOOL', 0), + 'bbcode_bitfield' => array('VCHAR:255', ''), + 'bbcode_uid' => array('VCHAR:8', ''), + 'post_postcount' => array('BOOL', 1), + 'post_edit_time' => array('TIMESTAMP', 0), + 'post_edit_reason' => array('STEXT_UNI', ''), + 'post_edit_user' => array('UINT', 0), + 'post_edit_count' => array('USINT', 0), + 'post_edit_locked' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'post_id', + 'KEYS' => array( + 'forum_id' => array('INDEX', 'forum_id'), + 'topic_id' => array('INDEX', 'topic_id'), + 'poster_ip' => array('INDEX', 'poster_ip'), + 'poster_id' => array('INDEX', 'poster_id'), + 'post_approved' => array('INDEX', 'post_approved'), + 'tid_post_time' => array('INDEX', array('topic_id', 'post_time')), + ), + ), + + $this->table_prefix . 'privmsgs' => array( + 'COLUMNS' => array( + 'msg_id' => array('UINT', NULL, 'auto_increment'), + 'root_level' => array('UINT', 0), + 'author_id' => array('UINT', 0), + 'icon_id' => array('UINT', 0), + 'author_ip' => array('VCHAR:40', ''), + 'message_time' => array('TIMESTAMP', 0), + 'enable_bbcode' => array('BOOL', 1), + 'enable_smilies' => array('BOOL', 1), + 'enable_magic_url' => array('BOOL', 1), + 'enable_sig' => array('BOOL', 1), + 'message_subject' => array('XSTEXT_UNI', ''), + 'message_text' => array('MTEXT_UNI', ''), + 'message_edit_reason' => array('STEXT_UNI', ''), + 'message_edit_user' => array('UINT', 0), + 'message_attachment' => array('BOOL', 0), + 'bbcode_bitfield' => array('VCHAR:255', ''), + 'bbcode_uid' => array('VCHAR:8', ''), + 'message_edit_time' => array('TIMESTAMP', 0), + 'message_edit_count' => array('USINT', 0), + 'to_address' => array('TEXT_UNI', ''), + 'bcc_address' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'msg_id', + 'KEYS' => array( + 'author_ip' => array('INDEX', 'author_ip'), + 'message_time' => array('INDEX', 'message_time'), + 'author_id' => array('INDEX', 'author_id'), + 'root_level' => array('INDEX', 'root_level'), + ), + ), + + $this->table_prefix . 'privmsgs_folder' => array( + 'COLUMNS' => array( + 'folder_id' => array('UINT', NULL, 'auto_increment'), + 'user_id' => array('UINT', 0), + 'folder_name' => array('VCHAR_UNI', ''), + 'pm_count' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'folder_id', + 'KEYS' => array( + 'user_id' => array('INDEX', 'user_id'), + ), + ), + + $this->table_prefix . 'privmsgs_rules' => array( + 'COLUMNS' => array( + 'rule_id' => array('UINT', NULL, 'auto_increment'), + 'user_id' => array('UINT', 0), + 'rule_check' => array('UINT', 0), + 'rule_connection' => array('UINT', 0), + 'rule_string' => array('VCHAR_UNI', ''), + 'rule_user_id' => array('UINT', 0), + 'rule_group_id' => array('UINT', 0), + 'rule_action' => array('UINT', 0), + 'rule_folder_id' => array('INT:11', 0), + ), + 'PRIMARY_KEY' => 'rule_id', + 'KEYS' => array( + 'user_id' => array('INDEX', 'user_id'), + ), + ), + + $this->table_prefix . 'privmsgs_to' => array( + 'COLUMNS' => array( + 'msg_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'author_id' => array('UINT', 0), + 'pm_deleted' => array('BOOL', 0), + 'pm_new' => array('BOOL', 1), + 'pm_unread' => array('BOOL', 1), + 'pm_replied' => array('BOOL', 0), + 'pm_marked' => array('BOOL', 0), + 'pm_forwarded' => array('BOOL', 0), + 'folder_id' => array('INT:11', 0), + ), + 'KEYS' => array( + 'msg_id' => array('INDEX', 'msg_id'), + 'author_id' => array('INDEX', 'author_id'), + 'usr_flder_id' => array('INDEX', array('user_id', 'folder_id')), + ), + ), + + $this->table_prefix . 'profile_fields' => array( + 'COLUMNS' => array( + 'field_id' => array('UINT', NULL, 'auto_increment'), + 'field_name' => array('VCHAR_UNI', ''), + 'field_type' => array('TINT:4', 0), + 'field_ident' => array('VCHAR:20', ''), + 'field_length' => array('VCHAR:20', ''), + 'field_minlen' => array('VCHAR', ''), + 'field_maxlen' => array('VCHAR', ''), + 'field_novalue' => array('VCHAR_UNI', ''), + 'field_default_value' => array('VCHAR_UNI', ''), + 'field_validation' => array('VCHAR_UNI:20', ''), + 'field_required' => array('BOOL', 0), + 'field_show_on_reg' => array('BOOL', 0), + 'field_hide' => array('BOOL', 0), + 'field_no_view' => array('BOOL', 0), + 'field_active' => array('BOOL', 0), + 'field_order' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'field_id', + 'KEYS' => array( + 'fld_type' => array('INDEX', 'field_type'), + 'fld_ordr' => array('INDEX', 'field_order'), + ), + ), + + $this->table_prefix . 'profile_fields_data' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'user_id', + ), + + $this->table_prefix . 'profile_fields_lang' => array( + 'COLUMNS' => array( + 'field_id' => array('UINT', 0), + 'lang_id' => array('UINT', 0), + 'option_id' => array('UINT', 0), + 'field_type' => array('TINT:4', 0), + 'lang_value' => array('VCHAR_UNI', ''), + ), + 'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'), + ), + + $this->table_prefix . 'profile_lang' => array( + 'COLUMNS' => array( + 'field_id' => array('UINT', 0), + 'lang_id' => array('UINT', 0), + 'lang_name' => array('VCHAR_UNI', ''), + 'lang_explain' => array('TEXT_UNI', ''), + 'lang_default_value' => array('VCHAR_UNI', ''), + ), + 'PRIMARY_KEY' => array('field_id', 'lang_id'), + ), + + $this->table_prefix . 'ranks' => array( + 'COLUMNS' => array( + 'rank_id' => array('UINT', NULL, 'auto_increment'), + 'rank_title' => array('VCHAR_UNI', ''), + 'rank_min' => array('UINT', 0), + 'rank_special' => array('BOOL', 0), + 'rank_image' => array('VCHAR', ''), + ), + 'PRIMARY_KEY' => 'rank_id', + ), + + $this->table_prefix . 'reports' => array( + 'COLUMNS' => array( + 'report_id' => array('UINT', NULL, 'auto_increment'), + 'reason_id' => array('USINT', 0), + 'post_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'user_notify' => array('BOOL', 0), + 'report_closed' => array('BOOL', 0), + 'report_time' => array('TIMESTAMP', 0), + 'report_text' => array('MTEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'report_id', + ), + + $this->table_prefix . 'reports_reasons' => array( + 'COLUMNS' => array( + 'reason_id' => array('USINT', NULL, 'auto_increment'), + 'reason_title' => array('VCHAR_UNI', ''), + 'reason_description' => array('MTEXT_UNI', ''), + 'reason_order' => array('USINT', 0), + ), + 'PRIMARY_KEY' => 'reason_id', + ), + + $this->table_prefix . 'search_results' => array( + 'COLUMNS' => array( + 'search_key' => array('VCHAR:32', ''), + 'search_time' => array('TIMESTAMP', 0), + 'search_keywords' => array('MTEXT_UNI', ''), + 'search_authors' => array('MTEXT', ''), + ), + 'PRIMARY_KEY' => 'search_key', + ), + + $this->table_prefix . 'search_wordlist' => array( + 'COLUMNS' => array( + 'word_id' => array('UINT', NULL, 'auto_increment'), + 'word_text' => array('VCHAR_UNI', ''), + 'word_common' => array('BOOL', 0), + 'word_count' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'word_id', + 'KEYS' => array( + 'wrd_txt' => array('UNIQUE', 'word_text'), + 'wrd_cnt' => array('INDEX', 'word_count'), + ), + ), + + $this->table_prefix . 'search_wordmatch' => array( + 'COLUMNS' => array( + 'post_id' => array('UINT', 0), + 'word_id' => array('UINT', 0), + 'title_match' => array('BOOL', 0), + ), + 'KEYS' => array( + 'unq_mtch' => array('UNIQUE', array('word_id', 'post_id', 'title_match')), + 'word_id' => array('INDEX', 'word_id'), + 'post_id' => array('INDEX', 'post_id'), + ), + ), + + $this->table_prefix . 'sessions' => array( + 'COLUMNS' => array( + 'session_id' => array('CHAR:32', ''), + 'session_user_id' => array('UINT', 0), + 'session_last_visit' => array('TIMESTAMP', 0), + 'session_start' => array('TIMESTAMP', 0), + 'session_time' => array('TIMESTAMP', 0), + 'session_ip' => array('VCHAR:40', ''), + 'session_browser' => array('VCHAR:150', ''), + 'session_forwarded_for' => array('VCHAR:255', ''), + 'session_page' => array('VCHAR_UNI', ''), + 'session_viewonline' => array('BOOL', 1), + 'session_autologin' => array('BOOL', 0), + 'session_admin' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'session_id', + 'KEYS' => array( + 'session_time' => array('INDEX', 'session_time'), + 'session_user_id' => array('INDEX', 'session_user_id'), + ), + ), + + $this->table_prefix . 'sessions_keys' => array( + 'COLUMNS' => array( + 'key_id' => array('CHAR:32', ''), + 'user_id' => array('UINT', 0), + 'last_ip' => array('VCHAR:40', ''), + 'last_login' => array('TIMESTAMP', 0), + ), + 'PRIMARY_KEY' => array('key_id', 'user_id'), + 'KEYS' => array( + 'last_login' => array('INDEX', 'last_login'), + ), + ), + + $this->table_prefix . 'sitelist' => array( + 'COLUMNS' => array( + 'site_id' => array('UINT', NULL, 'auto_increment'), + 'site_ip' => array('VCHAR:40', ''), + 'site_hostname' => array('VCHAR', ''), + 'ip_exclude' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'site_id', + ), + + $this->table_prefix . 'smilies' => array( + 'COLUMNS' => array( + 'smiley_id' => array('UINT', NULL, 'auto_increment'), +// We may want to set 'code' to VCHAR:50 or check if unicode support is possible... at the moment only ASCII characters are allowed. + 'code' => array('VCHAR_UNI:50', ''), + 'emotion' => array('VCHAR_UNI:50', ''), + 'smiley_url' => array('VCHAR:50', ''), + 'smiley_width' => array('USINT', 0), + 'smiley_height' => array('USINT', 0), + 'smiley_order' => array('UINT', 0), + 'display_on_posting'=> array('BOOL', 1), + ), + 'PRIMARY_KEY' => 'smiley_id', + 'KEYS' => array( + 'display_on_post' => array('INDEX', 'display_on_posting'), + ), + ), + + $this->table_prefix . 'styles' => array( + 'COLUMNS' => array( + 'style_id' => array('USINT', NULL, 'auto_increment'), + 'style_name' => array('VCHAR_UNI:255', ''), + 'style_copyright' => array('VCHAR_UNI', ''), + 'style_active' => array('BOOL', 1), + 'template_id' => array('USINT', 0), + 'theme_id' => array('USINT', 0), + 'imageset_id' => array('USINT', 0), + ), + 'PRIMARY_KEY' => 'style_id', + 'KEYS' => array( + 'style_name' => array('UNIQUE', 'style_name'), + 'template_id' => array('INDEX', 'template_id'), + 'theme_id' => array('INDEX', 'theme_id'), + 'imageset_id' => array('INDEX', 'imageset_id'), + ), + ), + + $this->table_prefix . 'styles_template' => array( + 'COLUMNS' => array( + 'template_id' => array('USINT', NULL, 'auto_increment'), + 'template_name' => array('VCHAR_UNI:255', ''), + 'template_copyright' => array('VCHAR_UNI', ''), + 'template_path' => array('VCHAR:100', ''), + 'bbcode_bitfield' => array('VCHAR:255', 'kNg='), + 'template_storedb' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'template_id', + 'KEYS' => array( + 'tmplte_nm' => array('UNIQUE', 'template_name'), + ), + ), + + $this->table_prefix . 'styles_template_data' => array( + 'COLUMNS' => array( + 'template_id' => array('USINT', 0), + 'template_filename' => array('VCHAR:100', ''), + 'template_included' => array('TEXT', ''), + 'template_mtime' => array('TIMESTAMP', 0), + 'template_data' => array('MTEXT_UNI', ''), + ), + 'KEYS' => array( + 'tid' => array('INDEX', 'template_id'), + 'tfn' => array('INDEX', 'template_filename'), + ), + ), + + $this->table_prefix . 'styles_theme' => array( + 'COLUMNS' => array( + 'theme_id' => array('USINT', NULL, 'auto_increment'), + 'theme_name' => array('VCHAR_UNI:255', ''), + 'theme_copyright' => array('VCHAR_UNI', ''), + 'theme_path' => array('VCHAR:100', ''), + 'theme_storedb' => array('BOOL', 0), + 'theme_mtime' => array('TIMESTAMP', 0), + 'theme_data' => array('MTEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'theme_id', + 'KEYS' => array( + 'theme_name' => array('UNIQUE', 'theme_name'), + ), + ), + + $this->table_prefix . 'styles_imageset' => array( + 'COLUMNS' => array( + 'imageset_id' => array('USINT', NULL, 'auto_increment'), + 'imageset_name' => array('VCHAR_UNI:255', ''), + 'imageset_copyright' => array('VCHAR_UNI', ''), + 'imageset_path' => array('VCHAR:100', ''), + ), + 'PRIMARY_KEY' => 'imageset_id', + 'KEYS' => array( + 'imgset_nm' => array('UNIQUE', 'imageset_name'), + ), + ), + + $this->table_prefix . 'styles_imageset_data' => array( + 'COLUMNS' => array( + 'image_id' => array('USINT', NULL, 'auto_increment'), + 'image_name' => array('VCHAR:200', ''), + 'image_filename' => array('VCHAR:200', ''), + 'image_lang' => array('VCHAR:30', ''), + 'image_height' => array('USINT', 0), + 'image_width' => array('USINT', 0), + 'imageset_id' => array('USINT', 0), + ), + 'PRIMARY_KEY' => 'image_id', + 'KEYS' => array( + 'i_d' => array('INDEX', 'imageset_id'), + ), + ), + + $this->table_prefix . 'topics' => array( + 'COLUMNS' => array( + 'topic_id' => array('UINT', NULL, 'auto_increment'), + 'forum_id' => array('UINT', 0), + 'icon_id' => array('UINT', 0), + 'topic_attachment' => array('BOOL', 0), + 'topic_approved' => array('BOOL', 1), + 'topic_reported' => array('BOOL', 0), + 'topic_title' => array('XSTEXT_UNI', '', 'true_sort'), + 'topic_poster' => array('UINT', 0), + 'topic_time' => array('TIMESTAMP', 0), + 'topic_time_limit' => array('TIMESTAMP', 0), + 'topic_views' => array('UINT', 0), + 'topic_replies' => array('UINT', 0), + 'topic_replies_real' => array('UINT', 0), + 'topic_status' => array('TINT:3', 0), + 'topic_type' => array('TINT:3', 0), + 'topic_first_post_id' => array('UINT', 0), + 'topic_first_poster_name' => array('VCHAR_UNI', ''), + 'topic_first_poster_colour' => array('VCHAR:6', ''), + 'topic_last_post_id' => array('UINT', 0), + 'topic_last_poster_id' => array('UINT', 0), + 'topic_last_poster_name' => array('VCHAR_UNI', ''), + 'topic_last_poster_colour' => array('VCHAR:6', ''), + 'topic_last_post_subject' => array('XSTEXT_UNI', ''), + 'topic_last_post_time' => array('TIMESTAMP', 0), + 'topic_last_view_time' => array('TIMESTAMP', 0), + 'topic_moved_id' => array('UINT', 0), + 'topic_bumped' => array('BOOL', 0), + 'topic_bumper' => array('UINT', 0), + 'poll_title' => array('STEXT_UNI', ''), + 'poll_start' => array('TIMESTAMP', 0), + 'poll_length' => array('TIMESTAMP', 0), + 'poll_max_options' => array('TINT:4', 1), + 'poll_last_vote' => array('TIMESTAMP', 0), + 'poll_vote_change' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'topic_id', + 'KEYS' => array( + 'forum_id' => array('INDEX', 'forum_id'), + 'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')), + 'last_post_time' => array('INDEX', 'topic_last_post_time'), + 'topic_approved' => array('INDEX', 'topic_approved'), + 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_approved', 'topic_last_post_id')), + 'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')), + ), + ), + + $this->table_prefix . 'topics_track' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + 'forum_id' => array('UINT', 0), + 'mark_time' => array('TIMESTAMP', 0), + ), + 'PRIMARY_KEY' => array('user_id', 'topic_id'), + 'KEYS' => array( + 'forum_id' => array('INDEX', 'forum_id'), + ), + ), + + $this->table_prefix . 'topics_posted' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + 'topic_posted' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => array('user_id', 'topic_id'), + ), + + $this->table_prefix . 'topics_watch' => array( + 'COLUMNS' => array( + 'topic_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'notify_status' => array('BOOL', 0), + ), + 'KEYS' => array( + 'topic_id' => array('INDEX', 'topic_id'), + 'user_id' => array('INDEX', 'user_id'), + 'notify_stat' => array('INDEX', 'notify_status'), + ), + ), + + $this->table_prefix . 'user_group' => array( + 'COLUMNS' => array( + 'group_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'group_leader' => array('BOOL', 0), + 'user_pending' => array('BOOL', 1), + ), + 'KEYS' => array( + 'group_id' => array('INDEX', 'group_id'), + 'user_id' => array('INDEX', 'user_id'), + 'group_leader' => array('INDEX', 'group_leader'), + ), + ), + + $this->table_prefix . 'users' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', NULL, 'auto_increment'), + 'user_type' => array('TINT:2', 0), + 'group_id' => array('UINT', 3), + 'user_permissions' => array('MTEXT', ''), + 'user_perm_from' => array('UINT', 0), + 'user_ip' => array('VCHAR:40', ''), + 'user_regdate' => array('TIMESTAMP', 0), + 'username' => array('VCHAR_CI', ''), + 'username_clean' => array('VCHAR_CI', ''), + 'user_password' => array('VCHAR_UNI:40', ''), + 'user_passchg' => array('TIMESTAMP', 0), + 'user_pass_convert' => array('BOOL', 0), + 'user_email' => array('VCHAR_UNI:100', ''), + 'user_email_hash' => array('BINT', 0), + 'user_birthday' => array('VCHAR:10', ''), + 'user_lastvisit' => array('TIMESTAMP', 0), + 'user_lastmark' => array('TIMESTAMP', 0), + 'user_lastpost_time' => array('TIMESTAMP', 0), + 'user_lastpage' => array('VCHAR_UNI:200', ''), + 'user_last_confirm_key' => array('VCHAR:10', ''), + 'user_last_search' => array('TIMESTAMP', 0), + 'user_warnings' => array('TINT:4', 0), + 'user_last_warning' => array('TIMESTAMP', 0), + 'user_login_attempts' => array('TINT:4', 0), + 'user_inactive_reason' => array('TINT:2', 0), + 'user_inactive_time' => array('TIMESTAMP', 0), + 'user_posts' => array('UINT', 0), + 'user_lang' => array('VCHAR:30', ''), + 'user_timezone' => array('DECIMAL', 0), + 'user_dst' => array('BOOL', 0), + 'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'), + 'user_style' => array('USINT', 0), + 'user_rank' => array('UINT', 0), + 'user_colour' => array('VCHAR:6', ''), + 'user_new_privmsg' => array('INT:4', 0), + 'user_unread_privmsg' => array('INT:4', 0), + 'user_last_privmsg' => array('TIMESTAMP', 0), + 'user_message_rules' => array('BOOL', 0), + 'user_full_folder' => array('INT:11', -3), + 'user_emailtime' => array('TIMESTAMP', 0), + 'user_topic_show_days' => array('USINT', 0), + 'user_topic_sortby_type' => array('VCHAR:1', 't'), + 'user_topic_sortby_dir' => array('VCHAR:1', 'd'), + 'user_post_show_days' => array('USINT', 0), + 'user_post_sortby_type' => array('VCHAR:1', 't'), + 'user_post_sortby_dir' => array('VCHAR:1', 'a'), + 'user_notify' => array('BOOL', 0), + 'user_notify_pm' => array('BOOL', 1), + 'user_notify_type' => array('TINT:4', 0), + 'user_allow_pm' => array('BOOL', 1), + 'user_allow_viewonline' => array('BOOL', 1), + 'user_allow_viewemail' => array('BOOL', 1), + 'user_allow_massemail' => array('BOOL', 1), + 'user_options' => array('UINT:11', 895), + 'user_avatar' => array('VCHAR', ''), + 'user_avatar_type' => array('TINT:2', 0), + 'user_avatar_width' => array('USINT', 0), + 'user_avatar_height' => array('USINT', 0), + 'user_sig' => array('MTEXT_UNI', ''), + 'user_sig_bbcode_uid' => array('VCHAR:8', ''), + 'user_sig_bbcode_bitfield' => array('VCHAR:255', ''), + 'user_from' => array('VCHAR_UNI:100', ''), + 'user_icq' => array('VCHAR:15', ''), + 'user_aim' => array('VCHAR_UNI', ''), + 'user_yim' => array('VCHAR_UNI', ''), + 'user_msnm' => array('VCHAR_UNI', ''), + 'user_jabber' => array('VCHAR_UNI', ''), + 'user_website' => array('VCHAR_UNI:200', ''), + 'user_occ' => array('TEXT_UNI', ''), + 'user_interests' => array('TEXT_UNI', ''), + 'user_actkey' => array('VCHAR:32', ''), + 'user_newpasswd' => array('VCHAR_UNI:40', ''), + 'user_form_salt' => array('VCHAR_UNI:32', ''), + + ), + 'PRIMARY_KEY' => 'user_id', + 'KEYS' => array( + 'user_birthday' => array('INDEX', 'user_birthday'), + 'user_email_hash' => array('INDEX', 'user_email_hash'), + 'user_type' => array('INDEX', 'user_type'), + 'username_clean' => array('UNIQUE', 'username_clean'), + ), + ), + + $this->table_prefix . 'warnings' => array( + 'COLUMNS' => array( + 'warning_id' => array('UINT', NULL, 'auto_increment'), + 'user_id' => array('UINT', 0), + 'post_id' => array('UINT', 0), + 'log_id' => array('UINT', 0), + 'warning_time' => array('TIMESTAMP', 0), + ), + 'PRIMARY_KEY' => 'warning_id', + ), + + $this->table_prefix . 'words' => array( + 'COLUMNS' => array( + 'word_id' => array('UINT', NULL, 'auto_increment'), + 'word' => array('VCHAR_UNI', ''), + 'replacement' => array('VCHAR_UNI', ''), + ), + 'PRIMARY_KEY' => 'word_id', + ), + + $this->table_prefix . 'zebra' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'zebra_id' => array('UINT', 0), + 'friend' => array('BOOL', 0), + 'foe' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => array('user_id', 'zebra_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'attachments', + $this->table_prefix . 'acl_groups', + $this->table_prefix . 'acl_options', + $this->table_prefix . 'acl_roles', + $this->table_prefix . 'acl_roles_data', + $this->table_prefix . 'acl_users', + $this->table_prefix . 'banlist', + $this->table_prefix . 'bbcodes', + $this->table_prefix . 'bookmarks', + $this->table_prefix . 'bots', + $this->table_prefix . 'config', + $this->table_prefix . 'confirm', + $this->table_prefix . 'disallow', + $this->table_prefix . 'drafts', + $this->table_prefix . 'extensions', + $this->table_prefix . 'extension_groups', + $this->table_prefix . 'forums', + $this->table_prefix . 'forums_access', + $this->table_prefix . 'forums_track', + $this->table_prefix . 'forums_watch', + $this->table_prefix . 'groups', + $this->table_prefix . 'icons', + $this->table_prefix . 'lang', + $this->table_prefix . 'log', + $this->table_prefix . 'moderator_cache', + $this->table_prefix . 'modules', + $this->table_prefix . 'poll_options', + $this->table_prefix . 'poll_votes', + $this->table_prefix . 'posts', + $this->table_prefix . 'privmsgs', + $this->table_prefix . 'privmsgs_folder', + $this->table_prefix . 'privmsgs_rules', + $this->table_prefix . 'privmsgs_to', + $this->table_prefix . 'profile_fields', + $this->table_prefix . 'profile_fields_data', + $this->table_prefix . 'profile_fields_lang', + $this->table_prefix . 'profile_lang', + $this->table_prefix . 'ranks', + $this->table_prefix . 'reports', + $this->table_prefix . 'reports_reasons', + $this->table_prefix . 'search_results', + $this->table_prefix . 'search_wordlist', + $this->table_prefix . 'search_wordmatch', + $this->table_prefix . 'sessions', + $this->table_prefix . 'sessions_keys', + $this->table_prefix . 'sitelist', + $this->table_prefix . 'smilies', + $this->table_prefix . 'styles', + $this->table_prefix . 'styles_template', + $this->table_prefix . 'styles_template_data', + $this->table_prefix . 'styles_theme', + $this->table_prefix . 'styles_imageset', + $this->table_prefix . 'styles_imageset_data', + $this->table_prefix . 'topics', + $this->table_prefix . 'topics_track', + $this->table_prefix . 'topics_posted', + $this->table_prefix . 'topics_watch', + $this->table_prefix . 'user_group', + $this->table_prefix . 'users', + $this->table_prefix . 'warnings', + $this->table_prefix . 'words', + $this->table_prefix . 'zebra', + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php new file mode 100644 index 0000000..f5c7e56 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_1_rc1'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.1')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php new file mode 100644 index 0000000..0d3a1ca --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_10 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.10', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_10_rc3'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.10')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php new file mode 100644 index 0000000..293c46c --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_10_rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.10-RC1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_9'); + } + + public function update_data() + { + return array( + array('config.add', array('email_max_chunk_size', 50)), + + array('config.update', array('version', '3.0.10-RC1')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php new file mode 100644 index 0000000..f288912 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_10_rc2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.10-RC2', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_10_rc1'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.10-RC2')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php new file mode 100644 index 0000000..9d6697a --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_10_rc3 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.10-RC3', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_10_rc2'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.10-RC3')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php new file mode 100644 index 0000000..e77b54a --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_11 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.11', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11_rc2'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.11')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php new file mode 100644 index 0000000..ed2dabf --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php @@ -0,0 +1,101 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_11_rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.11-RC1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_10'); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'cleanup_deactivated_styles'))), + array('custom', array(array(&$this, 'delete_orphan_private_messages'))), + + array('config.update', array('version', '3.0.11-RC1')), + ); + } + + public function cleanup_deactivated_styles() + { + // Updates users having current style a deactivated one + $sql = 'SELECT style_id + FROM ' . STYLES_TABLE . ' + WHERE style_active = 0'; + $result = $this->sql_query($sql); + + $deactivated_style_ids = array(); + while ($style_id = $this->db->sql_fetchfield('style_id', false, $result)) + { + $deactivated_style_ids[] = (int) $style_id; + } + $this->db->sql_freeresult($result); + + if (!empty($deactivated_style_ids)) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_style = ' . (int) $this->config['default_style'] .' + WHERE ' . $this->db->sql_in_set('user_style', $deactivated_style_ids); + $this->sql_query($sql); + } + } + + public function delete_orphan_private_messages() + { + // Delete orphan private messages + $batch_size = 500; + + $sql_array = array( + 'SELECT' => 'p.msg_id', + 'FROM' => array( + PRIVMSGS_TABLE => 'p', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(PRIVMSGS_TO_TABLE => 't'), + 'ON' => 'p.msg_id = t.msg_id', + ), + ), + 'WHERE' => 't.user_id IS NULL', + ); + $sql = $this->db->sql_build_query('SELECT', $sql_array); + + $result = $this->db->sql_query_limit($sql, $batch_size); + + $delete_pms = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $delete_pms[] = (int) $row['msg_id']; + } + $this->db->sql_freeresult($result); + + if (!empty($delete_pms)) + { + $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' + WHERE ' . $this->db->sql_in_set('msg_id', $delete_pms); + $this->sql_query($sql); + + // Return false to have the Migrator call this function again + return false; + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php new file mode 100644 index 0000000..45d8870 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php @@ -0,0 +1,56 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_11_rc2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.11-RC2', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11_rc1'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_show_novalue' => array('BOOL', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_show_novalue', + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.11-RC2')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12.php new file mode 100644 index 0000000..c489c0c --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_12 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.12', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_12_rc3'); + } + + public function update_data() + { + return array( + array('if', array( + phpbb_version_compare($this->config['version'], '3.0.12', '<'), + array('config.update', array('version', '3.0.12')), + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php new file mode 100644 index 0000000..f9f6d9f --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php @@ -0,0 +1,72 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +/** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.12-RC1 **/ + +class release_3_0_12_rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.12-RC1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'update_module_auth'))), + array('custom', array(array(&$this, 'disable_bots_from_receiving_pms'))), + + array('config.update', array('version', '3.0.12-RC1')), + ); + } + + public function disable_bots_from_receiving_pms() + { + // Disable receiving pms for bots + $sql = 'SELECT user_id + FROM ' . BOTS_TABLE; + $result = $this->db->sql_query($sql); + + $bot_user_ids = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $bot_user_ids[] = (int) $row['user_id']; + } + $this->db->sql_freeresult($result); + + if (!empty($bot_user_ids)) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_allow_pm = 0 + WHERE ' . $this->db->sql_in_set('user_id', $bot_user_ids); + $this->sql_query($sql); + } + } + + public function update_module_auth() + { + $sql = 'UPDATE ' . MODULES_TABLE . ' + SET module_auth = \'acl_u_sig\' + WHERE module_class = \'ucp\' + AND module_basename = \'profile\' + AND module_mode = \'signature\''; + $this->sql_query($sql); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc2.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc2.php new file mode 100644 index 0000000..8fac273 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc2.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_12_rc2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.12-RC2', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_12_rc1'); + } + + public function update_data() + { + return array( + array('if', array( + phpbb_version_compare($this->config['version'], '3.0.12-RC2', '<'), + array('config.update', array('version', '3.0.12-RC2')), + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc3.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc3.php new file mode 100644 index 0000000..fb1b801 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc3.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_12_rc3 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.12-RC3', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_12_rc2'); + } + + public function update_data() + { + return array( + array('if', array( + phpbb_version_compare($this->config['version'], '3.0.12-RC3', '<'), + array('config.update', array('version', '3.0.12-RC3')), + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php new file mode 100644 index 0000000..310fcc7 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_13 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.13', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_13_rc1'); + } + + public function update_data() + { + return array( + array('if', array( + phpbb_version_compare($this->config['version'], '3.0.13', '<'), + array('config.update', array('version', '3.0.13')), + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php new file mode 100644 index 0000000..b12a96a --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_13_pl1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.13-PL1', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_13'); + } + + public function update_data() + { + return array( + array('if', array( + phpbb_version_compare($this->config['version'], '3.0.13-PL1', '<'), + array('config.update', array('version', '3.0.13-PL1')), + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_rc1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_rc1.php new file mode 100644 index 0000000..9ea68fa --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_rc1.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_13_rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.13-RC1', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_12'); + } + + public function update_data() + { + return array( + array('if', array( + phpbb_version_compare($this->config['version'], '3.0.13-RC1', '<'), + array('config.update', array('version', '3.0.13-RC1')), + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php new file mode 100644 index 0000000..d1ae0b9 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php @@ -0,0 +1,119 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_1_rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.1-RC1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_0'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'forums' => array( + 'display_subforum_list' => array('BOOL', 1), + ), + $this->table_prefix . 'sessions' => array( + 'session_forum_id' => array('UINT', 0), + ), + ), + 'drop_keys' => array( + $this->table_prefix . 'groups' => array( + 'group_legend', + ), + ), + 'add_index' => array( + $this->table_prefix . 'sessions' => array( + 'session_forum_id' => array('session_forum_id'), + ), + $this->table_prefix . 'groups' => array( + 'group_legend_name' => array('group_legend', 'group_name'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'forums' => array( + 'display_subforum_list', + ), + $this->table_prefix . 'sessions' => array( + 'session_forum_id', + ), + ), + 'add_index' => array( + $this->table_prefix . 'groups' => array( + 'group_legend' => array('group_legend'), + ), + ), + 'drop_keys' => array( + $this->table_prefix . 'sessions' => array( + 'session_forum_id', + ), + $this->table_prefix . 'groups' => array( + 'group_legend_name', + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'fix_unset_last_view_time'))), + array('custom', array(array(&$this, 'reset_smiley_size'))), + + array('config.update', array('version', '3.0.1-RC1')), + ); + } + + public function fix_unset_last_view_time() + { + $sql = 'UPDATE ' . $this->table_prefix . "topics + SET topic_last_view_time = topic_last_post_time + WHERE topic_last_view_time = 0"; + $this->sql_query($sql); + } + + public function reset_smiley_size() + { + // Update smiley sizes + $smileys = array('icon_e_surprised.gif', 'icon_eek.gif', 'icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif'); + + foreach ($smileys as $smiley) + { + if (file_exists($this->phpbb_root_path . 'images/smilies/' . $smiley)) + { + list($width, $height) = getimagesize($this->phpbb_root_path . 'images/smilies/' . $smiley); + + $sql = 'UPDATE ' . SMILIES_TABLE . ' + SET smiley_width = ' . $width . ', smiley_height = ' . $height . " + WHERE smiley_url = '" . $this->db->sql_escape($smiley) . "'"; + + $this->sql_query($sql); + } + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php new file mode 100644 index 0000000..c08f01d --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.2', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_2_rc2'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.2')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php new file mode 100644 index 0000000..2e7f141 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php @@ -0,0 +1,38 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_2_rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.2-RC1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_1'); + } + + public function update_data() + { + return array( + array('config.add', array('referer_validation', '1')), + array('config.add', array('check_attachment_content', '1')), + array('config.add', array('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title')), + + array('config.update', array('version', '3.0.2-RC1')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php new file mode 100644 index 0000000..bde5feb --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php @@ -0,0 +1,86 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_2_rc2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.2-RC2', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_2_rc1'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'drafts' => array( + 'draft_subject' => array('STEXT_UNI', ''), + ), + $this->table_prefix . 'forums' => array( + 'forum_last_post_subject' => array('STEXT_UNI', ''), + ), + $this->table_prefix . 'posts' => array( + 'post_subject' => array('STEXT_UNI', '', 'true_sort'), + ), + $this->table_prefix . 'privmsgs' => array( + 'message_subject' => array('STEXT_UNI', ''), + ), + $this->table_prefix . 'topics' => array( + 'topic_title' => array('STEXT_UNI', '', 'true_sort'), + 'topic_last_post_subject' => array('STEXT_UNI', ''), + ), + ), + 'drop_keys' => array( + $this->table_prefix . 'sessions' => array( + 'session_forum_id', + ), + ), + 'add_index' => array( + $this->table_prefix . 'sessions' => array( + 'session_fid' => array('session_forum_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_index' => array( + $this->table_prefix . 'sessions' => array( + 'session_forum_id' => array( + 'session_forum_id', + ), + ), + ), + 'drop_keys' => array( + $this->table_prefix . 'sessions' => array( + 'session_fid', + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.2-RC2')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php new file mode 100644 index 0000000..c277da2 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_3 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.3', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_3_rc1'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.3')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php new file mode 100644 index 0000000..530eaf4 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php @@ -0,0 +1,89 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_3_rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.3-RC1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_2'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'styles_template' => array( + 'template_inherits_id' => array('UINT:4', 0), + 'template_inherit_path' => array('VCHAR', ''), + ), + $this->table_prefix . 'groups' => array( + 'group_max_recipients' => array('UINT', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'styles_template' => array( + 'template_inherits_id', + 'template_inherit_path', + ), + $this->table_prefix . 'groups' => array( + 'group_max_recipients', + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.add', array('enable_queue_trigger', '0')), + array('config.add', array('queue_trigger_posts', '3')), + array('config.add', array('pm_max_recipients', '0')), + array('custom', array(array(&$this, 'set_group_default_max_recipients'))), + array('config.add', array('dbms_version', $this->db->sql_server_info(true))), + array('permission.add', array('u_masspm_group', true, 'u_masspm')), + array('custom', array(array(&$this, 'correct_acp_email_permissions'))), + + array('config.update', array('version', '3.0.3-RC1')), + ); + } + + public function correct_acp_email_permissions() + { + $sql = 'UPDATE ' . $this->table_prefix . 'modules + SET module_auth = \'acl_a_email && cfg_email_enable\' + WHERE module_class = \'acp\' + AND module_basename = \'email\''; + $this->sql_query($sql); + } + + public function set_group_default_max_recipients() + { + // Set maximum number of recipients for the registered users, bots, guests group + $sql = 'UPDATE ' . GROUPS_TABLE . ' SET group_max_recipients = 5 + WHERE ' . $this->db->sql_in_set('group_name', array('GUESTS', 'REGISTERED', 'REGISTERED_COPPA', 'BOTS')); + $this->sql_query($sql); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php new file mode 100644 index 0000000..9b08da0 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php @@ -0,0 +1,55 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_4 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.4', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_4_rc1'); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'rename_log_delete_topic'))), + + array('config.update', array('version', '3.0.4')), + ); + } + + public function rename_log_delete_topic() + { + if ($this->db->get_sql_layer() == 'oracle') + { + // log_operation is CLOB - but we can change this later + $sql = 'UPDATE ' . $this->table_prefix . "log + SET log_operation = 'LOG_DELETE_TOPIC' + WHERE log_operation LIKE 'LOG_TOPIC_DELETED'"; + $this->sql_query($sql); + } + else + { + $sql = 'UPDATE ' . $this->table_prefix . "log + SET log_operation = 'LOG_DELETE_TOPIC' + WHERE log_operation = 'LOG_TOPIC_DELETED'"; + $this->sql_query($sql); + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php new file mode 100644 index 0000000..1034343 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php @@ -0,0 +1,129 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_4_rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.4-RC1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_3'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_show_profile' => array('BOOL', 0), + ), + ), + 'change_columns' => array( + $this->table_prefix . 'styles' => array( + 'style_id' => array('UINT', NULL, 'auto_increment'), + 'template_id' => array('UINT', 0), + 'theme_id' => array('UINT', 0), + 'imageset_id' => array('UINT', 0), + ), + $this->table_prefix . 'styles_imageset' => array( + 'imageset_id' => array('UINT', NULL, 'auto_increment'), + ), + $this->table_prefix . 'styles_imageset_data' => array( + 'image_id' => array('UINT', NULL, 'auto_increment'), + 'imageset_id' => array('UINT', 0), + ), + $this->table_prefix . 'styles_theme' => array( + 'theme_id' => array('UINT', NULL, 'auto_increment'), + ), + $this->table_prefix . 'styles_template' => array( + 'template_id' => array('UINT', NULL, 'auto_increment'), + ), + $this->table_prefix . 'styles_template_data' => array( + 'template_id' => array('UINT', 0), + ), + $this->table_prefix . 'forums' => array( + 'forum_style' => array('UINT', 0), + ), + $this->table_prefix . 'users' => array( + 'user_style' => array('UINT', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_show_profile', + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'update_custom_profile_fields'))), + + array('config.update', array('version', '3.0.4-RC1')), + ); + } + + public function update_custom_profile_fields() + { + // Update the Custom Profile Fields based on previous settings to the new \format + $sql = 'SELECT field_id, field_required, field_show_on_reg, field_hide + FROM ' . PROFILE_FIELDS_TABLE; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $sql_ary = array( + 'field_required' => 0, + 'field_show_on_reg' => 0, + 'field_hide' => 0, + 'field_show_profile'=> 0, + ); + + if ($row['field_required']) + { + $sql_ary['field_required'] = $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1; + } + else if ($row['field_show_on_reg']) + { + $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1; + } + else if ($row['field_hide']) + { + // Only administrators and moderators can see this CPF, if the view is enabled, they can see it, otherwise just admins in the acp_users module + $sql_ary['field_hide'] = 1; + } + else + { + // equivelant to "none", which is the "Display in user control panel" option + $sql_ary['field_show_profile'] = 1; + } + + $this->sql_query('UPDATE ' . $this->table_prefix . 'profile_fields SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE field_id = ' . $row['field_id'], $errored, $error_ary); + } + + $this->db->sql_freeresult($result); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php new file mode 100644 index 0000000..09c2bfe --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_5 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.5', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_5_rc1part2'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.5')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php new file mode 100644 index 0000000..003ccf8 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php @@ -0,0 +1,133 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +use phpbb\db\migration\container_aware_migration; + +class release_3_0_5_rc1 extends container_aware_migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.5-RC1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_4'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'forums' => array( + 'forum_style' => array('UINT', 0), + ), + ), + ); + } + + public function update_data() + { + $search_indexing_state = $this->config['search_indexing_state']; + + return array( + array('config.add', array('captcha_gd_wave', 0)), + array('config.add', array('captcha_gd_3d_noise', 1)), + array('config.add', array('captcha_gd_fonts', 1)), + array('config.add', array('confirm_refresh', 1)), + array('config.add', array('max_num_search_keywords', 10)), + array('config.remove', array('search_indexing_state')), + array('config.add', array('search_indexing_state', $search_indexing_state, true)), + array('custom', array(array(&$this, 'hash_old_passwords'))), + array('custom', array(array(&$this, 'update_ichiro_bot'))), + ); + } + + public function hash_old_passwords() + { + $passwords_manager = $this->container->get('passwords.manager'); + $sql = 'SELECT user_id, user_password + FROM ' . $this->table_prefix . 'users + WHERE user_pass_convert = 1'; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + if (strlen($row['user_password']) == 32) + { + $sql_ary = array( + 'user_password' => '$CP$' . $passwords_manager->hash($row['user_password'], 'passwords.driver.salted_md5'), + ); + + $this->sql_query('UPDATE ' . $this->table_prefix . 'users SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $row['user_id']); + } + } + $this->db->sql_freeresult($result); + } + + public function update_ichiro_bot() + { + // Adjust bot entry + $sql = 'UPDATE ' . $this->table_prefix . "bots + SET bot_agent = 'ichiro/' + WHERE bot_agent = 'ichiro/2'"; + $this->sql_query($sql); + } + + public function remove_duplicate_auth_options() + { + // Before we are able to add a unique key to auth_option, we need to remove duplicate entries + $sql = 'SELECT auth_option + FROM ' . $this->table_prefix . 'acl_options + GROUP BY auth_option + HAVING COUNT(*) >= 2'; + $result = $this->db->sql_query($sql); + + $auth_options = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $auth_options[] = $row['auth_option']; + } + $this->db->sql_freeresult($result); + + // Remove specific auth options + if (!empty($auth_options)) + { + foreach ($auth_options as $option) + { + // Select auth_option_ids... the largest id will be preserved + $sql = 'SELECT auth_option_id + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option = '" . $this->db->sql_escape($option) . "' + ORDER BY auth_option_id DESC"; + // sql_query_limit not possible here, due to bug in postgresql layer + $result = $this->db->sql_query($sql); + + // Skip first row, this is our original auth option we want to preserve + $row = $this->db->sql_fetchrow($result); + + while ($row = $this->db->sql_fetchrow($result)) + { + // Ok, remove this auth option... + $this->sql_query('DELETE FROM ' . ACL_OPTIONS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']); + $this->sql_query('DELETE FROM ' . ACL_ROLES_DATA_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']); + $this->sql_query('DELETE FROM ' . ACL_GROUPS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']); + $this->sql_query('DELETE FROM ' . ACL_USERS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']); + } + $this->db->sql_freeresult($result); + } + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php new file mode 100644 index 0000000..a9041ef --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php @@ -0,0 +1,48 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_5_rc1part2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.5-RC1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_5_rc1'); + } + + public function update_schema() + { + return array( + 'drop_keys' => array( + $this->table_prefix . 'acl_options' => array('auth_option'), + ), + 'add_unique_index' => array( + $this->table_prefix . 'acl_options' => array( + 'auth_option' => array('auth_option'), + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.5-RC1')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php new file mode 100644 index 0000000..74c338a --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_6 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.6', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_6_rc4'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.6')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php new file mode 100644 index 0000000..faef681 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php @@ -0,0 +1,330 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_6_rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.6-RC1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_5'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'confirm' => array( + 'attempts' => array('UINT', 0), + ), + $this->table_prefix . 'users' => array( + 'user_new' => array('BOOL', 1), + 'user_reminded' => array('TINT:4', 0), + 'user_reminded_time' => array('TIMESTAMP', 0), + ), + $this->table_prefix . 'groups' => array( + 'group_skip_auth' => array('BOOL', 0, 'after' => 'group_founder_manage'), + ), + $this->table_prefix . 'privmsgs' => array( + 'message_reported' => array('BOOL', 0), + ), + $this->table_prefix . 'reports' => array( + 'pm_id' => array('UINT', 0), + ), + $this->table_prefix . 'profile_fields' => array( + 'field_show_on_vt' => array('BOOL', 0), + ), + $this->table_prefix . 'forums' => array( + 'forum_options' => array('UINT:20', 0), + ), + ), + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_options' => array('UINT:11', 230271), + ), + ), + 'add_index' => array( + $this->table_prefix . 'reports' => array( + 'post_id' => array('post_id'), + 'pm_id' => array('pm_id'), + ), + $this->table_prefix . 'posts' => array( + 'post_username' => array('post_username:255'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'confirm' => array( + 'attempts', + ), + $this->table_prefix . 'users' => array( + 'user_new', + 'user_reminded', + 'user_reminded_time', + ), + $this->table_prefix . 'groups' => array( + 'group_skip_auth', + ), + $this->table_prefix . 'privmsgs' => array( + 'message_reported', + ), + $this->table_prefix . 'reports' => array( + 'pm_id', + ), + $this->table_prefix . 'profile_fields' => array( + 'field_show_on_vt', + ), + $this->table_prefix . 'forums' => array( + 'forum_options', + ), + ), + 'drop_keys' => array( + $this->table_prefix . 'reports' => array( + 'post_id', + 'pm_id', + ), + $this->table_prefix . 'posts' => array( + 'post_username', + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.add', array('captcha_plugin', 'phpbb_captcha_nogd')), + array('if', array( + ($this->config['captcha_gd']), + array('config.update', array('captcha_plugin', 'phpbb_captcha_gd')), + )), + + array('config.add', array('feed_enable', 0)), + array('config.add', array('feed_limit', 10)), + array('config.add', array('feed_overall_forums', 1)), + array('config.add', array('feed_overall_forums_limit', 15)), + array('config.add', array('feed_overall_topics', 0)), + array('config.add', array('feed_overall_topics_limit', 15)), + array('config.add', array('feed_forum', 1)), + array('config.add', array('feed_topic', 1)), + array('config.add', array('feed_item_statistics', 1)), + + array('config.add', array('smilies_per_page', 50)), + array('config.add', array('allow_pm_report', 1)), + array('config.add', array('min_post_chars', 1)), + array('config.add', array('allow_quick_reply', 1)), + array('config.add', array('new_member_post_limit', 0)), + array('config.add', array('new_member_group_default', 0)), + array('config.add', array('delete_time', $this->config['edit_time'])), + + array('config.add', array('allow_avatar', 0)), + array('if', array( + ($this->config['allow_avatar_upload'] || $this->config['allow_avatar_local'] || $this->config['allow_avatar_remote']), + array('config.update', array('allow_avatar', 1)), + )), + array('config.add', array('allow_avatar_remote_upload', 0)), + array('if', array( + ($this->config['allow_avatar_remote'] && $this->config['allow_avatar_upload']), + array('config.update', array('allow_avatar_remote_upload', 1)), + )), + + array('module.add', array( + 'acp', + 'ACP_BOARD_CONFIGURATION', + array( + 'module_basename' => 'acp_board', + 'modes' => array('feed'), + ), + )), + array('module.add', array( + 'acp', + 'ACP_CAT_USERS', + array( + 'module_basename' => 'acp_users', + 'modes' => array('warnings'), + ), + )), + array('module.add', array( + 'acp', + 'ACP_SERVER_CONFIGURATION', + array( + 'module_basename' => 'acp_send_statistics', + 'modes' => array('send_statistics'), + ), + )), + array('module.add', array( + 'acp', + 'ACP_FORUM_BASED_PERMISSIONS', + array( + 'module_basename' => 'acp_permissions', + 'modes' => array('setting_forum_copy'), + ), + )), + array('module.add', array( + 'mcp', + 'MCP_REPORTS', + array( + 'module_basename' => 'mcp_pm_reports', + 'modes' => array('pm_reports','pm_reports_closed','pm_report_details'), + ), + )), + array('custom', array(array(&$this, 'add_newly_registered_group'))), + array('custom', array(array(&$this, 'set_user_options_default'))), + + array('config.update', array('version', '3.0.6-RC1')), + ); + } + + public function set_user_options_default() + { + // 229376 is the added value to enable all three signature options + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_options = user_options + 229376'; + $this->sql_query($sql); + } + + public function add_newly_registered_group() + { + // Add newly_registered group... but check if it already exists (we always supported running the updater on any schema) + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = 'NEWLY_REGISTERED'"; + $result = $this->db->sql_query($sql); + $group_id = (int) $this->db->sql_fetchfield('group_id'); + $this->db->sql_freeresult($result); + + if (!$group_id) + { + $sql = 'INSERT INTO ' . GROUPS_TABLE . " (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('NEWLY_REGISTERED', 3, 0, '', 0, '', '', '', 5)"; + $this->sql_query($sql); + + $group_id = $this->db->sql_nextid(); + } + + // Insert new user role... at the end of the chain + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_name = 'ROLE_USER_NEW_MEMBER' + AND role_type = 'u_'"; + $result = $this->db->sql_query($sql); + $u_role = (int) $this->db->sql_fetchfield('role_id'); + $this->db->sql_freeresult($result); + + if (!$u_role) + { + $sql = 'SELECT MAX(role_order) as max_order_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = 'u_'"; + $result = $this->db->sql_query($sql); + $next_order_id = (int) $this->db->sql_fetchfield('max_order_id'); + $this->db->sql_freeresult($result); + + $next_order_id++; + + $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . " (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_NEW_MEMBER', 'ROLE_DESCRIPTION_USER_NEW_MEMBER', 'u_', $next_order_id)"; + $this->sql_query($sql); + $u_role = $this->db->sql_nextid(); + + // Now add the correct data to the roles... + // The standard role says that new users are not able to send a PM, Mass PM, are not able to PM groups + $sql = 'INSERT INTO ' . ACL_ROLES_DATA_TABLE . " (role_id, auth_option_id, auth_setting) SELECT $u_role, auth_option_id, 0 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group')"; + $this->sql_query($sql); + + // Add user role to group + $sql = 'INSERT INTO ' . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES ($group_id, 0, 0, $u_role, 0)"; + $this->sql_query($sql); + } + + // Insert new forum role + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_name = 'ROLE_FORUM_NEW_MEMBER' + AND role_type = 'f_'"; + $result = $this->db->sql_query($sql); + $f_role = (int) $this->db->sql_fetchfield('role_id'); + $this->db->sql_freeresult($result); + + if (!$f_role) + { + $sql = 'SELECT MAX(role_order) as max_order_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = 'f_'"; + $result = $this->db->sql_query($sql); + $next_order_id = (int) $this->db->sql_fetchfield('max_order_id'); + $this->db->sql_freeresult($result); + + $next_order_id++; + + $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . " (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_NEW_MEMBER', 'ROLE_DESCRIPTION_FORUM_NEW_MEMBER', 'f_', $next_order_id)"; + $this->sql_query($sql); + $f_role = $this->db->sql_nextid(); + + $sql = 'INSERT INTO ' . ACL_ROLES_DATA_TABLE . " (role_id, auth_option_id, auth_setting) SELECT $f_role, auth_option_id, 0 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove')"; + $this->sql_query($sql); + } + + // Set every members user_new column to 0 (old users) only if there is no one yet (this makes sure we do not execute this more than once) + $sql = 'SELECT 1 + FROM ' . USERS_TABLE . ' + WHERE user_new = 0'; + $result = $this->db->sql_query_limit($sql, 1); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (!$row) + { + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new = 0'; + $this->sql_query($sql); + } + + // To mimick the old "feature" we will assign the forum role to every forum, regardless of the setting (this makes sure there are no "this does not work!!!! YUO!!!" posts... + // Check if the role is already assigned... + $sql = 'SELECT forum_id + FROM ' . ACL_GROUPS_TABLE . ' + WHERE group_id = ' . $group_id . ' + AND auth_role_id = ' . $f_role; + $result = $this->db->sql_query($sql); + $is_options = (int) $this->db->sql_fetchfield('forum_id'); + $this->db->sql_freeresult($result); + + // Not assigned at all... :/ + if (!$is_options) + { + // Get postable forums + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + WHERE forum_type != ' . FORUM_LINK; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $this->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (' . $group_id . ', ' . (int) $row['forum_id'] . ', 0, ' . $f_role . ', 0)'); + } + $this->db->sql_freeresult($result); + } + + // Clear permissions... + include_once($this->phpbb_root_path . 'includes/acp/auth.' . $this->php_ext); + $auth_admin = new \auth_admin(); + $auth_admin->acl_clear_prefetch(); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php new file mode 100644 index 0000000..c52b71d --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_6_rc2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.6-RC2', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_6_rc1'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.6-RC2')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php new file mode 100644 index 0000000..2db3341 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php @@ -0,0 +1,46 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_6_rc3 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.6-RC3', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_6_rc2'); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'update_cp_fields'))), + + array('config.update', array('version', '3.0.6-RC3')), + ); + } + + public function update_cp_fields() + { + // Update the Custom Profile Fields based on previous settings to the new \format + $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . ' + SET field_show_on_vt = 1 + WHERE field_hide = 0 + AND (field_required = 1 OR field_show_on_reg = 1 OR field_show_profile = 1)'; + $this->sql_query($sql); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php new file mode 100644 index 0000000..5734db2 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_6_rc4 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.6-RC4', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_6_rc3'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.6-RC4')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php new file mode 100644 index 0000000..d1d6028 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_7 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.7', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_7_rc2'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.7')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php new file mode 100644 index 0000000..784e810 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_7_pl1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.7-pl1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_7'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.7-pl1')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php new file mode 100644 index 0000000..1843c3f --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php @@ -0,0 +1,82 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_7_rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.7-RC1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_6'); + } + + public function update_schema() + { + return array( + 'drop_keys' => array( + $this->table_prefix . 'log' => array( + 'log_time', + ), + ), + 'add_index' => array( + $this->table_prefix . 'topics_track' => array( + 'topic_id' => array('topic_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_index' => array( + $this->table_prefix . 'log' => array( + 'log_time' => array('log_time'), + ), + ), + 'drop_keys' => array( + $this->table_prefix . 'topics_track' => array( + 'topic_id', + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.add', array('feed_overall', 1)), + array('config.add', array('feed_http_auth', 0)), + array('config.add', array('feed_limit_post', $this->config['feed_limit'])), + array('config.add', array('feed_limit_topic', $this->config['feed_overall_topics_limit'])), + array('config.add', array('feed_topics_new', $this->config['feed_overall_topics'])), + array('config.add', array('feed_topics_active', $this->config['feed_overall_topics'])), + array('custom', array(array(&$this, 'delete_text_templates'))), + + array('config.update', array('version', '3.0.7-RC1')), + ); + } + + public function delete_text_templates() + { + // Delete all text-templates from the template_data + $sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . ' + WHERE template_filename ' . $this->db->sql_like_expression($this->db->get_any_char() . '.txt'); + $this->sql_query($sql); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php new file mode 100644 index 0000000..e497a38 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php @@ -0,0 +1,79 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_7_rc2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.7-RC2', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_7_rc1'); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'update_email_hash'))), + + array('config.update', array('version', '3.0.7-RC2')), + ); + } + + public function update_email_hash($start = 0) + { + $limit = 1000; + + $sql = 'SELECT user_id, user_email, user_email_hash + FROM ' . USERS_TABLE . ' + WHERE user_type <> ' . USER_IGNORE . " + AND user_email <> ''"; + $result = $this->db->sql_query_limit($sql, $limit, $start); + + $i = 0; + while ($row = $this->db->sql_fetchrow($result)) + { + $i++; + + // Snapshot of the phpbb_email_hash() function + // We cannot call it directly because the auto updater updates the DB first. :/ + $user_email_hash = sprintf('%u', crc32(strtolower($row['user_email']))) . strlen($row['user_email']); + + if ($user_email_hash != $row['user_email_hash']) + { + $sql_ary = array( + 'user_email_hash' => $user_email_hash, + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . (int) $row['user_id']; + $this->sql_query($sql); + } + } + $this->db->sql_freeresult($result); + + if ($i < $limit) + { + // Completed + return; + } + + // Return the next start, will be sent to $start when this function is called again + return $start + $limit; + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php new file mode 100644 index 0000000..04b5bd4 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_8 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.8', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_8_rc1'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.8')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php new file mode 100644 index 0000000..22fd515 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php @@ -0,0 +1,162 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_8_rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.8-RC1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_7_pl1'); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'update_file_extension_group_names'))), + array('custom', array(array(&$this, 'update_module_auth'))), + array('custom', array(array(&$this, 'delete_orphan_shadow_topics'))), + array('module.add', array( + 'acp', + 'ACP_MESSAGES', + array( + 'module_basename' => 'acp_board', + 'modes' => array('post'), + ), + )), + array('config.add', array('load_unreads_search', 1)), + array('config.update_if_equals', array(600, 'queue_interval', 60)), + array('config.update_if_equals', array(50, 'email_package_size', 20)), + + array('config.update', array('version', '3.0.8-RC1')), + ); + } + + public function update_file_extension_group_names() + { + // Update file extension group names to use language strings. + $sql = 'SELECT lang_dir + FROM ' . LANG_TABLE; + $result = $this->db->sql_query($sql); + + $extension_groups_updated = array(); + while ($lang_dir = $this->db->sql_fetchfield('lang_dir')) + { + $lang_dir = basename($lang_dir); + + // The language strings we need are either in language/.../acp/attachments.php + // in the update package if we're updating to 3.0.8-RC1 or later, + // or they are in language/.../install.php when we're updating from 3.0.7-PL1 or earlier. + // On an already updated board, they can also already be in language/.../acp/attachments.php + // in the board root. + $lang_files = array( + "{$this->phpbb_root_path}install/update/new/language/$lang_dir/acp/attachments.{$this->php_ext}", + "{$this->phpbb_root_path}language/$lang_dir/install.{$this->php_ext}", + "{$this->phpbb_root_path}language/$lang_dir/acp/attachments.{$this->php_ext}", + ); + + foreach ($lang_files as $lang_file) + { + if (!file_exists($lang_file)) + { + continue; + } + + $lang = array(); + include($lang_file); + + foreach($lang as $lang_key => $lang_val) + { + if (isset($extension_groups_updated[$lang_key]) || strpos($lang_key, 'EXT_GROUP_') !== 0) + { + continue; + } + + $sql_ary = array( + 'group_name' => substr($lang_key, 10), // Strip off 'EXT_GROUP_' + ); + + $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . " + WHERE group_name = '" . $this->db->sql_escape($lang_val) . "'"; + $this->sql_query($sql); + + $extension_groups_updated[$lang_key] = true; + } + } + } + $this->db->sql_freeresult($result); + } + + public function update_module_auth() + { + $sql = 'UPDATE ' . MODULES_TABLE . ' + SET module_auth = \'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)\' + WHERE module_class = \'ucp\' + AND module_basename = \'profile\' + AND module_mode = \'avatar\''; + $this->sql_query($sql); + } + + public function delete_orphan_shadow_topics() + { + // Delete shadow topics pointing to not existing topics + $batch_size = 500; + + // Set of affected forums we have to resync + $sync_forum_ids = array(); + + $sql_array = array( + 'SELECT' => 't1.topic_id, t1.forum_id', + 'FROM' => array( + TOPICS_TABLE => 't1', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(TOPICS_TABLE => 't2'), + 'ON' => 't1.topic_moved_id = t2.topic_id', + ), + ), + 'WHERE' => 't1.topic_moved_id <> 0 + AND t2.topic_id IS NULL', + ); + $sql = $this->db->sql_build_query('SELECT', $sql_array); + $result = $this->db->sql_query_limit($sql, $batch_size); + + $topic_ids = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $topic_ids[] = (int) $row['topic_id']; + + $sync_forum_ids[(int) $row['forum_id']] = (int) $row['forum_id']; + } + $this->db->sql_freeresult($result); + + if (!empty($topic_ids)) + { + $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + WHERE ' . $this->db->sql_in_set('topic_id', $topic_ids); + $this->db->sql_query($sql); + + // Sync the forums we have deleted shadow topics from. + sync('forum', 'forum_id', $sync_forum_ids, true, true); + + return false; + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php new file mode 100644 index 0000000..e69134c --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_9 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.9', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_9_rc4'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.9')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php new file mode 100644 index 0000000..06e46d5 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php @@ -0,0 +1,130 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_9_rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.9-RC1', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_8'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'login_attempts' => array( + 'COLUMNS' => array( + // 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 + // removing a primary key. + // 'attempt_id' => array('UINT', NULL, 'auto_increment'), + 'attempt_ip' => array('VCHAR:40', ''), + 'attempt_browser' => array('VCHAR:150', ''), + 'attempt_forwarded_for' => array('VCHAR:255', ''), + 'attempt_time' => array('TIMESTAMP', 0), + 'user_id' => array('UINT', 0), + 'username' => array('VCHAR_UNI:255', 0), + 'username_clean' => array('VCHAR_CI', 0), + ), + //'PRIMARY_KEY' => 'attempt_id', + 'KEYS' => array( + 'att_ip' => array('INDEX', array('attempt_ip', 'attempt_time')), + 'att_for' => array('INDEX', array('attempt_forwarded_for', 'attempt_time')), + 'att_time' => array('INDEX', array('attempt_time')), + 'user_id' => array('INDEX', 'user_id'), + ), + ), + ), + 'change_columns' => array( + $this->table_prefix . 'bbcodes' => array( + 'bbcode_id' => array('USINT', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'login_attempts', + ), + ); + } + + public function update_data() + { + return array( + array('config.add', array('ip_login_limit_max', 50)), + array('config.add', array('ip_login_limit_time', 21600)), + array('config.add', array('ip_login_limit_use_forwarded', 0)), + array('custom', array(array(&$this, 'update_file_extension_group_names'))), + array('custom', array(array(&$this, 'fix_firebird_qa_captcha'))), + + array('config.update', array('version', '3.0.9-RC1')), + ); + } + + public function update_file_extension_group_names() + { + // Update file extension group names to use language strings, again. + $sql = 'SELECT group_id, group_name + FROM ' . EXTENSION_GROUPS_TABLE . ' + WHERE group_name ' . $this->db->sql_like_expression('EXT_GROUP_' . $this->db->get_any_char()); + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $sql_ary = array( + 'group_name' => substr($row['group_name'], 10), // Strip off 'EXT_GROUP_' + ); + + $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE group_id = ' . $row['group_id']; + $this->sql_query($sql); + } + $this->db->sql_freeresult($result); + } + + public function fix_firebird_qa_captcha() + { + // Recover from potentially broken Q&A CAPTCHA table on firebird + // Q&A CAPTCHA was uninstallable, so it's safe to remove these + // without data loss + if ($this->db_tools->sql_layer == 'firebird') + { + $tables = array( + $this->table_prefix . 'captcha_questions', + $this->table_prefix . 'captcha_answers', + $this->table_prefix . 'qa_confirm', + ); + foreach ($tables as $table) + { + if ($this->db_tools->sql_table_exists($table)) + { + $this->db_tools->sql_table_drop($table); + } + } + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php new file mode 100644 index 0000000..46fd51e --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_9_rc2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.9-RC2', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_9_rc1'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.9-RC2')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php new file mode 100644 index 0000000..1696060 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_9_rc3 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.9-RC3', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_9_rc2'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.9-RC3')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php new file mode 100644 index 0000000..fdc92b5 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php @@ -0,0 +1,34 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_9_rc4 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.9-RC4', '>='); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_9_rc3'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.9-RC4')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php b/sources/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php new file mode 100644 index 0000000..0ca4f2f --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php @@ -0,0 +1,81 @@ + +* @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 acp_prune_users_module extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_CAT_USERS'"; + $result = $this->db->sql_query($sql); + $acp_cat_users_id = (int) $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + $sql = 'SELECT parent_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_basename = 'acp_prune' + AND module_mode = 'users'"; + $result = $this->db->sql_query($sql); + $acp_prune_users_parent = (int) $this->db->sql_fetchfield('parent_id'); + $this->db->sql_freeresult($result); + + // Skip migration if "Users" category has been deleted + // or the module has already been moved to that category + return !$acp_cat_users_id || $acp_cat_users_id === $acp_prune_users_parent; + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\beta1'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'move_prune_users_module'))), + ); + } + + public function move_prune_users_module() + { + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_basename = 'acp_prune' + AND module_mode = 'users'"; + $result = $this->db->sql_query($sql); + $acp_prune_users_id = (int) $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_CAT_USERS'"; + $result = $this->db->sql_query($sql); + $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); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/acp_style_components_module.php b/sources/phpBB/phpbb/db/migration/data/v310/acp_style_components_module.php new file mode 100644 index 0000000..4bd29f8 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/acp_style_components_module.php @@ -0,0 +1,46 @@ + +* @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 acp_style_components_module extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_STYLE_COMPONENTS'"; + $result = $this->db->sql_query($sql); + $module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + return $module_id == false; + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_data() + { + return array( + array('module.remove', array( + 'acp', + false, + 'ACP_STYLE_COMPONENTS', + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/allow_cdn.php b/sources/phpBB/phpbb/db/migration/data/v310/allow_cdn.php new file mode 100644 index 0000000..286d20e --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/allow_cdn.php @@ -0,0 +1,37 @@ + +* @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 allow_cdn extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return isset($this->config['allow_cdn']); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\jquery_update', + ); + } + + public function update_data() + { + return array( + array('config.add', array('allow_cdn', (int) $this->config['load_jquery_cdn'])), + array('config.remove', array('load_jquery_cdn')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/alpha1.php b/sources/phpBB/phpbb/db/migration/data/v310/alpha1.php new file mode 100644 index 0000000..1df85bc --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/alpha1.php @@ -0,0 +1,48 @@ + +* @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 alpha1 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v30x\local_url_bbcode', + '\phpbb\db\migration\data\v30x\release_3_0_12', + '\phpbb\db\migration\data\v310\acp_style_components_module', + '\phpbb\db\migration\data\v310\allow_cdn', + '\phpbb\db\migration\data\v310\auth_provider_oauth', + '\phpbb\db\migration\data\v310\avatars', + '\phpbb\db\migration\data\v310\boardindex', + '\phpbb\db\migration\data\v310\config_db_text', + '\phpbb\db\migration\data\v310\forgot_password', + '\phpbb\db\migration\data\v310\mod_rewrite', + '\phpbb\db\migration\data\v310\mysql_fulltext_drop', + '\phpbb\db\migration\data\v310\namespaces', + '\phpbb\db\migration\data\v310\notifications_cron', + '\phpbb\db\migration\data\v310\notification_options_reconvert', + '\phpbb\db\migration\data\v310\plupload', + '\phpbb\db\migration\data\v310\signature_module_auth', + '\phpbb\db\migration\data\v310\softdelete_mcp_modules', + '\phpbb\db\migration\data\v310\teampage', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-a1')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/alpha2.php b/sources/phpBB/phpbb/db/migration/data/v310/alpha2.php new file mode 100644 index 0000000..78bc755 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/alpha2.php @@ -0,0 +1,32 @@ + +* @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 alpha2 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\alpha1', + '\phpbb\db\migration\data\v310\notifications_cron_p2', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-a2')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/alpha3.php b/sources/phpBB/phpbb/db/migration/data/v310/alpha3.php new file mode 100644 index 0000000..574d19d --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/alpha3.php @@ -0,0 +1,34 @@ + +* @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 alpha3 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\alpha2', + '\phpbb\db\migration\data\v310\avatar_types', + '\phpbb\db\migration\data\v310\passwords', + '\phpbb\db\migration\data\v310\profilefield_types', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-a3')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php b/sources/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php new file mode 100644 index 0000000..2d51bd5 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php @@ -0,0 +1,77 @@ + +* @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 auth_provider_oauth extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'oauth_tokens' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), // phpbb_users.user_id + 'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set + 'provider' => array('VCHAR', ''), // Name of the OAuth provider + 'oauth_token' => array('MTEXT', ''), // Serialized token + ), + 'KEYS' => array( + 'user_id' => array('INDEX', 'user_id'), + 'provider' => array('INDEX', 'provider'), + ), + ), + $this->table_prefix . 'oauth_accounts' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'provider' => array('VCHAR', ''), + 'oauth_provider_id' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => array( + 'user_id', + 'provider', + ), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'oauth_tokens', + $this->table_prefix . 'oauth_accounts', + ), + ); + } + + public function update_data() + { + return array( + array('module.add', array( + 'ucp', + 'UCP_PROFILE', + array( + 'module_basename' => 'ucp_auth_link', + 'modes' => array('auth_link'), + ), + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth2.php b/sources/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth2.php new file mode 100644 index 0000000..e9e726a --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth2.php @@ -0,0 +1,44 @@ + +* @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 auth_provider_oauth2 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\auth_provider_oauth', + ); + } + + public function update_data() + { + return array( + array('custom', array( + array($this, 'update_auth_link_module_auth'), + )), + ); + } + + public function update_auth_link_module_auth() + { + $sql = 'UPDATE ' . MODULES_TABLE . " + SET module_auth = 'authmethod_oauth' + WHERE module_class = 'ucp' + AND module_basename = 'ucp_auth_link' + AND module_mode = 'auth_link' + AND module_auth = ''"; + $this->db->sql_query($sql); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/avatar_types.php b/sources/phpBB/phpbb/db/migration/data/v310/avatar_types.php new file mode 100644 index 0000000..117e932 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/avatar_types.php @@ -0,0 +1,64 @@ + +* @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 avatar_types extends \phpbb\db\migration\migration +{ + /** + * @var avatar type map + */ + protected $avatar_type_map = array( + AVATAR_UPLOAD => 'avatar.driver.upload', + AVATAR_REMOTE => 'avatar.driver.remote', + AVATAR_GALLERY => 'avatar.driver.local', + ); + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\dev', + '\phpbb\db\migration\data\v310\avatars', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_user_avatar_type'))), + array('custom', array(array($this, 'update_group_avatar_type'))), + ); + } + + public function update_user_avatar_type() + { + foreach ($this->avatar_type_map as $old => $new) + { + $sql = 'UPDATE ' . $this->table_prefix . "users + SET user_avatar_type = '$new' + WHERE user_avatar_type = '$old'"; + $this->db->sql_query($sql); + } + } + + public function update_group_avatar_type() + { + foreach ($this->avatar_type_map as $old => $new) + { + $sql = 'UPDATE ' . $this->table_prefix . "groups + SET group_avatar_type = '$new' + WHERE group_avatar_type = '$old'"; + $this->db->sql_query($sql); + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/avatars.php b/sources/phpBB/phpbb/db/migration/data/v310/avatars.php new file mode 100644 index 0000000..2698ade --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/avatars.php @@ -0,0 +1,73 @@ + +* @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 avatars extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return isset($this->config['allow_avatar_gravatar']); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_avatar_type' => array('VCHAR:255', ''), + ), + $this->table_prefix . 'groups' => array( + 'group_avatar_type' => array('VCHAR:255', ''), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_avatar_type' => array('TINT:2', ''), + ), + $this->table_prefix . 'groups' => array( + 'group_avatar_type' => array('TINT:2', ''), + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.add', array('allow_avatar_gravatar', 0)), + array('custom', array(array($this, 'update_module_auth'))), + ); + } + + public function update_module_auth() + { + $sql = 'UPDATE ' . $this->table_prefix . "modules + SET module_auth = 'cfg_allow_avatar' + WHERE module_class = 'ucp' + AND module_basename = 'ucp_profile' + AND module_mode = 'avatar'"; + $this->db->sql_query($sql); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/beta1.php b/sources/phpBB/phpbb/db/migration/data/v310/beta1.php new file mode 100644 index 0000000..84887bd --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/beta1.php @@ -0,0 +1,37 @@ + +* @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 beta1 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\alpha3', + '\phpbb\db\migration\data\v310\passwords_p2', + '\phpbb\db\migration\data\v310\postgres_fulltext_drop', + '\phpbb\db\migration\data\v310\profilefield_change_load_settings', + '\phpbb\db\migration\data\v310\profilefield_location', + '\phpbb\db\migration\data\v310\soft_delete_mod_convert2', + '\phpbb\db\migration\data\v310\ucp_popuppm_module', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-b1')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/beta2.php b/sources/phpBB/phpbb/db/migration/data/v310/beta2.php new file mode 100644 index 0000000..458e305 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/beta2.php @@ -0,0 +1,33 @@ + +* @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 beta2 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\beta1', + '\phpbb\db\migration\data\v310\acp_prune_users_module', + '\phpbb\db\migration\data\v310\profilefield_location_cleanup', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-b2')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/beta3.php b/sources/phpBB/phpbb/db/migration/data/v310/beta3.php new file mode 100644 index 0000000..a6c62bf --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/beta3.php @@ -0,0 +1,36 @@ + +* @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 beta3 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\beta2', + '\phpbb\db\migration\data\v310\auth_provider_oauth2', + '\phpbb\db\migration\data\v310\board_contact_name', + '\phpbb\db\migration\data\v310\jquery_update2', + '\phpbb\db\migration\data\v310\live_searches_config', + '\phpbb\db\migration\data\v310\prune_shadow_topics', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-b3')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/beta4.php b/sources/phpBB/phpbb/db/migration/data/v310/beta4.php new file mode 100644 index 0000000..3e91d95 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/beta4.php @@ -0,0 +1,33 @@ + +* @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 beta4 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\beta3', + '\phpbb\db\migration\data\v310\extensions_version_check_force_unstable', + '\phpbb\db\migration\data\v310\reset_missing_captcha_plugin', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-b4')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/board_contact_name.php b/sources/phpBB/phpbb/db/migration/data/v310/board_contact_name.php new file mode 100644 index 0000000..6f51887 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/board_contact_name.php @@ -0,0 +1,34 @@ + +* @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 board_contact_name extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return isset($this->config['board_contact_name']); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\beta2'); + } + + public function update_data() + { + return array( + array('config.add', array('board_contact_name', '')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/boardindex.php b/sources/phpBB/phpbb/db/migration/data/v310/boardindex.php new file mode 100644 index 0000000..77a8558 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/boardindex.php @@ -0,0 +1,29 @@ + +* @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 boardindex extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return isset($this->config['board_index_text']); + } + + public function update_data() + { + return array( + array('config.add', array('board_index_text', '')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/bot_update.php b/sources/phpBB/phpbb/db/migration/data/v310/bot_update.php new file mode 100644 index 0000000..39b16c6 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/bot_update.php @@ -0,0 +1,150 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v310; + +class bot_update extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\rc6'); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'update_bing_bot'))), + array('custom', array(array(&$this, 'update_bots'))), + ); + } + + public function update_bing_bot() + { + $bot_name = 'Bing [Bot]'; + $bot_name_clean = utf8_clean_string($bot_name); + + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . " + WHERE username_clean = '" . $this->db->sql_escape($bot_name_clean) . "'"; + $result = $this->db->sql_query($sql); + $bing_already_added = (bool) $this->db->sql_fetchfield('user_id'); + $this->db->sql_freeresult($result); + + if (!$bing_already_added) + { + $bot_agent = 'bingbot/'; + $bot_ip = ''; + $sql = 'SELECT group_id, group_colour + FROM ' . GROUPS_TABLE . " + WHERE group_name = 'BOTS'"; + $result = $this->db->sql_query($sql); + $group_row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (!$group_row) + { + // default fallback, should never get here + $group_row['group_id'] = 6; + $group_row['group_colour'] = '9E8DA7'; + } + + if (!function_exists('user_add')) + { + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + } + + $user_row = array( + 'user_type' => USER_IGNORE, + 'group_id' => $group_row['group_id'], + 'username' => $bot_name, + 'user_regdate' => time(), + 'user_password' => '', + 'user_colour' => $group_row['group_colour'], + 'user_email' => '', + 'user_lang' => $this->config['default_lang'], + 'user_style' => $this->config['default_style'], + 'user_timezone' => 0, + 'user_dateformat' => $this->config['default_dateformat'], + 'user_allow_massemail' => 0, + ); + + $user_id = user_add($user_row); + + $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $this->db->sql_build_array('INSERT', array( + 'bot_active' => 1, + 'bot_name' => (string) $bot_name, + 'user_id' => (int) $user_id, + 'bot_agent' => (string) $bot_agent, + 'bot_ip' => (string) $bot_ip, + )); + + $this->sql_query($sql); + } + } + + public function update_bots() + { + // Update bots + if (!function_exists('user_delete')) + { + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + } + + $bots_updates = array( + // Bot Deletions + 'NG-Search [Bot]' => false, + 'Nutch/CVS [Bot]' => false, + 'OmniExplorer [Bot]' => false, + 'Seekport [Bot]' => false, + 'Synoo [Bot]' => false, + 'WiseNut [Bot]' => false, + + // Bot Updates + // Bot name to bot user agent map + 'Baidu [Spider]' => 'Baiduspider', + 'Exabot [Bot]' => 'Exabot', + 'Voyager [Bot]' => 'voyager/', + 'W3C [Validator]' => 'W3C_Validator', + ); + + foreach ($bots_updates as $bot_name => $bot_agent) + { + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_IGNORE . " + AND username_clean = '" . $this->db->sql_escape(utf8_clean_string($bot_name)) . "'"; + $result = $this->db->sql_query($sql); + $bot_user_id = (int) $this->db->sql_fetchfield('user_id'); + $this->db->sql_freeresult($result); + + if ($bot_user_id) + { + if ($bot_agent === false) + { + $sql = 'DELETE FROM ' . BOTS_TABLE . " + WHERE user_id = $bot_user_id"; + $this->sql_query($sql); + + user_delete('retain', $bot_user_id); + } + else + { + $sql = 'UPDATE ' . BOTS_TABLE . " + SET bot_agent = '" . $this->db->sql_escape($bot_agent) . "' + WHERE user_id = $bot_user_id"; + $this->sql_query($sql); + } + } + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php b/sources/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php new file mode 100644 index 0000000..328c08f --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php @@ -0,0 +1,48 @@ + +* @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 captcha_plugins extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\rc2', + ); + } + + public function update_data() + { + $captcha_plugin = $this->config['captcha_plugin']; + if (strpos($captcha_plugin, 'phpbb_captcha_') === 0) + { + $captcha_plugin = substr($captcha_plugin, strlen('phpbb_captcha_')); + } + else if (strpos($captcha_plugin, 'phpbb_') === 0) + { + $captcha_plugin = substr($captcha_plugin, strlen('phpbb_')); + } + + return array( + array('if', array( + (is_file($this->phpbb_root_path . 'phpbb/captcha/plugins/' . $captcha_plugin . '.' . $this->php_ext)), + array('config.update', array('captcha_plugin', 'core.captcha.plugins.' . $captcha_plugin)), + )), + array('if', array( + (!is_file($this->phpbb_root_path . 'phpbb/captcha/plugins/' . $captcha_plugin . '.' . $this->php_ext)), + array('config.update', array('captcha_plugin', 'core.captcha.plugins.nogd')), + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/config_db_text.php b/sources/phpBB/phpbb/db/migration/data/v310/config_db_text.php new file mode 100644 index 0000000..438883c --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/config_db_text.php @@ -0,0 +1,51 @@ + +* @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 config_db_text extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_table_exists($this->table_prefix . 'config_text'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'config_text' => array( + 'COLUMNS' => array( + 'config_name' => array('VCHAR', ''), + 'config_value' => array('MTEXT', ''), + ), + 'PRIMARY_KEY' => 'config_name', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'config_text', + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php b/sources/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php new file mode 100644 index 0000000..20bd547 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php @@ -0,0 +1,31 @@ + +* @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 contact_admin_acp_module extends \phpbb\db\migration\migration +{ + public function update_data() + { + return array( + array('module.add', array( + 'acp', + 'ACP_BOARD_CONFIGURATION', + array( + 'module_basename' => 'acp_contact', + 'modes' => array('contact'), + ), + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/contact_admin_form.php b/sources/phpBB/phpbb/db/migration/data/v310/contact_admin_form.php new file mode 100644 index 0000000..5736369 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/contact_admin_form.php @@ -0,0 +1,46 @@ + +* @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 contact_admin_form extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return isset($this->config['contact_admin_form_enable']); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\config_db_text'); + } + + public function update_data() + { + return array( + array('config.add', array('contact_admin_form_enable', 1)), + array('custom', array(array($this, 'contact_admin_info'))), + ); + } + + public function contact_admin_info() + { + $text_config = new \phpbb\config\db_text($this->db, $this->table_prefix . 'config_text'); + $text_config->set_array(array( + 'contact_admin_info' => '', + 'contact_admin_info_uid' => '', + 'contact_admin_info_bitfield' => '', + 'contact_admin_info_flags' => OPTION_FLAG_BBCODE + OPTION_FLAG_SMILIES + OPTION_FLAG_LINKS, + )); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/dev.php b/sources/phpBB/phpbb/db/migration/data/v310/dev.php new file mode 100644 index 0000000..f037191 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/dev.php @@ -0,0 +1,415 @@ + +* @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 dev extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.1.0-dev', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\extensions', + '\phpbb\db\migration\data\v310\style_update_p2', + '\phpbb\db\migration\data\v310\timezone_p2', + '\phpbb\db\migration\data\v310\reported_posts_display', + '\phpbb\db\migration\data\v310\migrations_table', + ); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'groups' => array( + 'group_teampage' => array('UINT', 0, 'after' => 'group_legend'), + ), + $this->table_prefix . 'profile_fields' => array( + 'field_show_on_pm' => array('BOOL', 0), + ), + $this->table_prefix . 'styles' => array( + 'style_path' => array('VCHAR:100', ''), + 'bbcode_bitfield' => array('VCHAR:255', 'kNg='), + 'style_parent_id' => array('UINT:4', 0), + 'style_parent_tree' => array('TEXT', ''), + ), + $this->table_prefix . 'reports' => array( + 'reported_post_text' => array('MTEXT_UNI', ''), + 'reported_post_uid' => array('VCHAR:8', ''), + 'reported_post_bitfield' => array('VCHAR:255', ''), + ), + ), + 'change_columns' => array( + $this->table_prefix . 'groups' => array( + 'group_legend' => array('UINT', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'groups' => array( + 'group_teampage', + ), + $this->table_prefix . 'profile_fields' => array( + 'field_show_on_pm', + ), + $this->table_prefix . 'styles' => array( + 'style_path', + 'bbcode_bitfield', + 'style_parent_id', + 'style_parent_tree', + ), + $this->table_prefix . 'reports' => array( + 'reported_post_text', + 'reported_post_uid', + 'reported_post_bitfield', + ), + ), + ); + } + + public function update_data() + { + return array( + array('if', array( + (strpos('phpbb_search_', $this->config['search_type']) !== 0), + array('config.update', array('search_type', 'phpbb_search_' . $this->config['search_type'])), + )), + + array('config.add', array('fulltext_postgres_ts_name', 'simple')), + array('config.add', array('fulltext_postgres_min_word_len', 4)), + array('config.add', array('fulltext_postgres_max_word_len', 254)), + array('config.add', array('fulltext_sphinx_stopwords', 0)), + array('config.add', array('fulltext_sphinx_indexer_mem_limit', 512)), + + array('config.add', array('load_jquery_cdn', 0)), + array('config.add', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js')), + + array('config.add', array('use_system_cron', 0)), + + array('config.add', array('legend_sort_groupname', 0)), + array('config.add', array('teampage_forums', 1)), + array('config.add', array('teampage_memberships', 1)), + + array('config.add', array('load_cpf_pm', 0)), + + array('config.add', array('display_last_subject', 1)), + + array('config.add', array('assets_version', 1)), + + array('config.add', array('site_home_url', '')), + array('config.add', array('site_home_text', '')), + + array('permission.add', array('u_chgprofileinfo', true, 'u_sig')), + + array('module.add', array( + 'acp', + 'ACP_GROUPS', + array( + 'module_basename' => 'acp_groups', + 'modes' => array('position'), + ), + )), + array('module.add', array( + 'acp', + 'ACP_ATTACHMENTS', + array( + 'module_basename' => 'acp_attachments', + 'modes' => array('manage'), + ), + )), + array('module.add', array( + 'acp', + 'ACP_STYLE_MANAGEMENT', + array( + 'module_basename' => 'acp_styles', + 'modes' => array('install', 'cache'), + ), + )), + array('module.add', array( + 'ucp', + 'UCP_PROFILE', + array( + 'module_basename' => 'ucp_profile', + 'modes' => array('autologin_keys'), + ), + )), + // Module will be renamed later + array('module.add', array( + 'acp', + 'ACP_CAT_STYLES', + 'ACP_LANGUAGE' + )), + + array('module.remove', array( + 'acp', + false, + 'ACP_TEMPLATES', + )), + array('module.remove', array( + 'acp', + false, + 'ACP_THEMES', + )), + array('module.remove', array( + 'acp', + false, + 'ACP_IMAGESETS', + )), + + array('custom', array(array($this, 'rename_module_basenames'))), + array('custom', array(array($this, 'rename_styles_module'))), + array('custom', array(array($this, 'add_group_teampage'))), + array('custom', array(array($this, 'update_group_legend'))), + array('custom', array(array($this, 'localise_global_announcements'))), + array('custom', array(array($this, 'update_ucp_pm_basename'))), + array('custom', array(array($this, 'update_ucp_profile_auth'))), + array('custom', array(array($this, 'move_customise_modules'))), + + array('config.update', array('version', '3.1.0-dev')), + ); + } + + public function move_customise_modules() + { + // Move language management to new location in the Customise tab + // First get language module id + $sql = 'SELECT module_id FROM ' . MODULES_TABLE . " + WHERE module_basename = 'acp_language'"; + $result = $this->db->sql_query($sql); + $language_module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + // Next get language management module id of the one just created + $sql = 'SELECT module_id FROM ' . MODULES_TABLE . " + WHERE module_langname = 'ACP_LANGUAGE'"; + $result = $this->db->sql_query($sql); + $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); + } + + public function update_ucp_pm_basename() + { + $sql = 'SELECT module_id, module_basename + FROM ' . MODULES_TABLE . " + WHERE module_basename <> 'ucp_pm' AND + module_langname='UCP_PM'"; + $result = $this->db->sql_query_limit($sql, 1); + + if ($row = $this->db->sql_fetchrow($result)) + { + // This update is still not applied. Applying it + + $sql = 'UPDATE ' . MODULES_TABLE . " + SET module_basename = 'ucp_pm' + WHERE module_id = " . (int) $row['module_id']; + + $this->sql_query($sql); + } + $this->db->sql_freeresult($result); + } + + public function update_ucp_profile_auth() + { + // Update the auth setting for the module + $sql = 'UPDATE ' . MODULES_TABLE . " + SET module_auth = 'acl_u_chgprofileinfo' + WHERE module_class = 'ucp' + AND module_basename = 'ucp_profile' + AND module_mode = 'profile_info'"; + $this->sql_query($sql); + } + + public function rename_styles_module() + { + // Rename styles module to Customise + $sql = 'UPDATE ' . MODULES_TABLE . " + SET module_langname = 'ACP_CAT_CUSTOMISE' + WHERE module_langname = 'ACP_CAT_STYLES'"; + $this->sql_query($sql); + } + + public function rename_module_basenames() + { + // rename all module basenames to full classname + $sql = 'SELECT module_id, module_basename, module_class + FROM ' . MODULES_TABLE; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $module_id = (int) $row['module_id']; + unset($row['module_id']); + + if (!empty($row['module_basename']) && !empty($row['module_class'])) + { + // all the class names start with class name or with phpbb_ for auto loading + if (strpos($row['module_basename'], $row['module_class'] . '_') !== 0 && + strpos($row['module_basename'], 'phpbb_') !== 0) + { + $row['module_basename'] = $row['module_class'] . '_' . $row['module_basename']; + + $sql_update = $this->db->sql_build_array('UPDATE', $row); + + $sql = 'UPDATE ' . MODULES_TABLE . ' + SET ' . $sql_update . ' + WHERE module_id = ' . $module_id; + $this->sql_query($sql); + } + } + } + + $this->db->sql_freeresult($result); + } + + public function add_group_teampage() + { + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_teampage = 1 + WHERE group_type = ' . GROUP_SPECIAL . " + AND group_name = 'ADMINISTRATORS'"; + $this->sql_query($sql); + + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_teampage = 2 + WHERE group_type = ' . GROUP_SPECIAL . " + AND group_name = 'GLOBAL_MODERATORS'"; + $this->sql_query($sql); + } + + public function update_group_legend() + { + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . ' + WHERE group_legend = 1 + ORDER BY group_name ASC'; + $result = $this->db->sql_query($sql); + + $next_legend = 1; + while ($row = $this->db->sql_fetchrow($result)) + { + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_legend = ' . $next_legend . ' + WHERE group_id = ' . (int) $row['group_id']; + $this->sql_query($sql); + + $next_legend++; + } + $this->db->sql_freeresult($result); + } + + public function localise_global_announcements() + { + // Localise Global Announcements + $sql = 'SELECT topic_id, topic_approved, (topic_replies + 1) AS topic_posts, topic_last_post_id, topic_last_post_subject, topic_last_post_time, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour + FROM ' . TOPICS_TABLE . ' + WHERE forum_id = 0 + AND topic_type = ' . POST_GLOBAL; + $result = $this->db->sql_query($sql); + + $global_announcements = $update_lastpost_data = array(); + $update_lastpost_data['forum_last_post_time'] = 0; + $update_forum_data = array( + 'forum_posts' => 0, + 'forum_topics' => 0, + 'forum_topics_real' => 0, + ); + + while ($row = $this->db->sql_fetchrow($result)) + { + $global_announcements[] = (int) $row['topic_id']; + + $update_forum_data['forum_posts'] += (int) $row['topic_posts']; + $update_forum_data['forum_topics_real']++; + if ($row['topic_approved']) + { + $update_forum_data['forum_topics']++; + } + + if ($update_lastpost_data['forum_last_post_time'] < $row['topic_last_post_time']) + { + $update_lastpost_data = array( + 'forum_last_post_id' => (int) $row['topic_last_post_id'], + 'forum_last_post_subject' => $row['topic_last_post_subject'], + 'forum_last_post_time' => (int) $row['topic_last_post_time'], + 'forum_last_poster_id' => (int) $row['topic_last_poster_id'], + 'forum_last_poster_name' => $row['topic_last_poster_name'], + 'forum_last_poster_colour' => $row['topic_last_poster_colour'], + ); + } + } + $this->db->sql_freeresult($result); + + if (!empty($global_announcements)) + { + // Update the post/topic-count for the forum and the last-post if needed + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + WHERE forum_type = ' . FORUM_POST; + $result = $this->db->sql_query_limit($sql, 1); + $ga_forum_id = $this->db->sql_fetchfield('forum_id'); + $this->db->sql_freeresult($result); + + $sql = 'SELECT forum_last_post_time + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $ga_forum_id; + $result = $this->db->sql_query($sql); + $lastpost = (int) $this->db->sql_fetchfield('forum_last_post_time'); + $this->db->sql_freeresult($result); + + $sql_update = 'forum_posts = forum_posts + ' . $update_forum_data['forum_posts'] . ', '; + $sql_update .= 'forum_topics_real = forum_topics_real + ' . $update_forum_data['forum_topics_real'] . ', '; + $sql_update .= 'forum_topics = forum_topics + ' . $update_forum_data['forum_topics']; + if ($lastpost < $update_lastpost_data['forum_last_post_time']) + { + $sql_update .= ', ' . $this->db->sql_build_array('UPDATE', $update_lastpost_data); + } + + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET ' . $sql_update . ' + WHERE forum_id = ' . $ga_forum_id; + $this->sql_query($sql); + + // Update some forum_ids + $table_ary = array(TOPICS_TABLE, POSTS_TABLE, LOG_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE); + foreach ($table_ary as $table) + { + $sql = "UPDATE $table + SET forum_id = $ga_forum_id + WHERE " . $this->db->sql_in_set('topic_id', $global_announcements); + $this->sql_query($sql); + } + unset($table_ary); + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/extensions.php b/sources/phpBB/phpbb/db/migration/data/v310/extensions.php new file mode 100644 index 0000000..3171435 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/extensions.php @@ -0,0 +1,75 @@ + +* @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 extensions extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_table_exists($this->table_prefix . 'ext'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'ext' => array( + 'COLUMNS' => array( + 'ext_name' => array('VCHAR', ''), + 'ext_active' => array('BOOL', 0), + 'ext_state' => array('TEXT', ''), + ), + 'KEYS' => array( + 'ext_name' => array('UNIQUE', 'ext_name'), + ), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'ext', + ), + ); + } + + public function update_data() + { + return array( + // Module will be renamed later + array('module.add', array( + 'acp', + 'ACP_CAT_STYLES', + 'ACP_EXTENSION_MANAGEMENT' + )), + array('module.add', array( + 'acp', + 'ACP_EXTENSION_MANAGEMENT', + array( + 'module_basename' => 'acp_extensions', + 'modes' => array('main'), + ), + )), + array('permission.add', array('a_extensions', true, 'a_styles')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/extensions_version_check_force_unstable.php b/sources/phpBB/phpbb/db/migration/data/v310/extensions_version_check_force_unstable.php new file mode 100644 index 0000000..1d6276f --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/extensions_version_check_force_unstable.php @@ -0,0 +1,29 @@ + +* @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 extensions_version_check_force_unstable extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_data() + { + return array( + array('config.add', array('extension_force_unstable', false)), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/forgot_password.php b/sources/phpBB/phpbb/db/migration/data/v310/forgot_password.php new file mode 100644 index 0000000..362457c --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/forgot_password.php @@ -0,0 +1,34 @@ + +* @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 forgot_password extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return isset($this->config['allow_password_reset']); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_data() + { + return array( + array('config.add', array('allow_password_reset', 1)), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/gold.php b/sources/phpBB/phpbb/db/migration/data/v310/gold.php new file mode 100644 index 0000000..e84c7ee --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/gold.php @@ -0,0 +1,32 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v310; + +class gold extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\rc6', + '\phpbb\db\migration\data\v310\bot_update', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/jquery_update.php b/sources/phpBB/phpbb/db/migration/data/v310/jquery_update.php new file mode 100644 index 0000000..8011331 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/jquery_update.php @@ -0,0 +1,37 @@ + +* @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 jquery_update extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->config['load_jquery_url'] !== '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'; + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\dev', + ); + } + + public function update_data() + { + return array( + array('config.update', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js')), + ); + } + +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/jquery_update2.php b/sources/phpBB/phpbb/db/migration/data/v310/jquery_update2.php new file mode 100644 index 0000000..4061be5 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/jquery_update2.php @@ -0,0 +1,37 @@ + +* @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 jquery_update2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->config['load_jquery_url'] !== '//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'; + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\jquery_update', + ); + } + + public function update_data() + { + return array( + array('config.update', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js')), + ); + } + +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/live_searches_config.php b/sources/phpBB/phpbb/db/migration/data/v310/live_searches_config.php new file mode 100644 index 0000000..3d87e04 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/live_searches_config.php @@ -0,0 +1,29 @@ + +* @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 live_searches_config extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return isset($this->config['allow_live_searches']); + } + + public function update_data() + { + return array( + array('config.add', array('allow_live_searches', '1')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/migrations_table.php b/sources/phpBB/phpbb/db/migration/data/v310/migrations_table.php new file mode 100644 index 0000000..48508b0 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/migrations_table.php @@ -0,0 +1,51 @@ + +* @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 migrations_table extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_table_exists($this->table_prefix . 'migrations'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'migrations' => array( + 'COLUMNS' => array( + 'migration_name' => array('VCHAR', ''), + 'migration_depends_on' => array('TEXT', ''), + 'migration_schema_done' => array('BOOL', 0), + 'migration_data_done' => array('BOOL', 0), + 'migration_data_state' => array('TEXT', ''), + 'migration_start_time' => array('TIMESTAMP', 0), + 'migration_end_time' => array('TIMESTAMP', 0), + ), + 'PRIMARY_KEY' => 'migration_name', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'migrations', + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php b/sources/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php new file mode 100644 index 0000000..85e479d --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php @@ -0,0 +1,31 @@ + +* @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 mod_rewrite extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\dev', + ); + } + + public function update_data() + { + return array( + array('config.add', array('enable_mod_rewrite', '0')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php b/sources/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php new file mode 100644 index 0000000..e04a705 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php @@ -0,0 +1,80 @@ + +* @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 mysql_fulltext_drop extends \phpbb\db\migration\migration +{ + protected $indexes; + + public function effectively_installed() + { + // This migration is irrelevant for all non-MySQL DBMSes. + if (strpos($this->db->get_sql_layer(), 'mysql') === false) + { + return true; + } + + $this->find_indexes_to_drop(); + return empty($this->indexes); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\dev', + ); + } + + public function update_schema() + { + if (empty($this->indexes)) + { + return array(); + } + + /* + * Drop FULLTEXT indexes related to MySQL fulltext search. + * Doing so is equivalent to dropping the search index from the ACP. + * Possibly time-consuming recreation of the search index (i.e. + * FULLTEXT indexes) is left as a task to the admin to not + * unnecessarily stall the upgrade process. The new search index will + * then require about 40% less table space (also see PHPBB3-11621). + */ + return array( + 'drop_keys' => array( + $this->table_prefix . 'posts' => $this->indexes, + ), + ); + } + + public function find_indexes_to_drop() + { + if ($this->indexes !== null) + { + return $this->indexes; + } + + $this->indexes = array(); + $potential_keys = array('post_subject', 'post_text', 'post_content'); + foreach ($potential_keys as $key) + { + if ($this->db_tools->sql_index_exists($this->table_prefix . 'posts', $key)) + { + $this->indexes[] = $key; + } + } + + return $this->indexes; + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/namespaces.php b/sources/phpBB/phpbb/db/migration/data/v310/namespaces.php new file mode 100644 index 0000000..2a49353 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/namespaces.php @@ -0,0 +1,34 @@ + +* @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 namespaces extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\dev', + ); + } + + public function update_data() + { + return array( + array('if', array( + (preg_match('#^phpbb_search_#', $this->config['search_type'])), + array('config.update', array('search_type', str_replace('phpbb_search_', '\\phpbb\\search\\', $this->config['search_type']))), + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php b/sources/phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php new file mode 100644 index 0000000..2d4d26a --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php @@ -0,0 +1,141 @@ + +* @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 notification_options_reconvert extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\notifications_schema_fix'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'purge_notifications'))), + array('custom', array(array($this, 'convert_notifications'))), + ); + } + + public function purge_notifications() + { + $sql = 'DELETE FROM ' . $this->table_prefix . 'user_notifications'; + $this->sql_query($sql); + } + + public function convert_notifications($start) + { + $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $this->table_prefix . 'user_notifications'); + + return $this->perform_conversion($insert_buffer, $start); + } + + /** + * Perform the conversion (separate for testability) + * + * @param \phpbb\db\sql_insert_buffer $insert_buffer + * @param int $start Start of staggering step + * @return mixed int start of the next step, null if the end was reached + */ + public function perform_conversion(\phpbb\db\sql_insert_buffer $insert_buffer, $start) + { + $limit = 250; + $converted_users = 0; + + $sql = 'SELECT user_id, user_notify_type, user_notify_pm + FROM ' . $this->table_prefix . 'users + ORDER BY user_id'; + $result = $this->db->sql_query_limit($sql, $limit, $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $converted_users++; + $notification_methods = array(); + + // In-board notification + $notification_methods[] = ''; + + if ($row['user_notify_type'] == NOTIFY_EMAIL || $row['user_notify_type'] == NOTIFY_BOTH) + { + $notification_methods[] = 'email'; + } + + if ($row['user_notify_type'] == NOTIFY_IM || $row['user_notify_type'] == NOTIFY_BOTH) + { + $notification_methods[] = 'jabber'; + } + + // Notifications for posts + foreach (array('post', 'topic') as $item_type) + { + $this->add_method_rows( + $insert_buffer, + $item_type, + 0, + $row['user_id'], + $notification_methods + ); + } + + if ($row['user_notify_pm']) + { + // Notifications for private messages + // User either gets all methods or no method + $this->add_method_rows( + $insert_buffer, + 'pm', + 0, + $row['user_id'], + $notification_methods + ); + } + } + $this->db->sql_freeresult($result); + + $insert_buffer->flush(); + + if ($converted_users < $limit) + { + // No more users left, we are done... + return; + } + + return $start + $limit; + } + + /** + * Insert method rows to DB + * + * @param \phpbb\db\sql_insert_buffer $insert_buffer + * @param string $item_type + * @param int $item_id + * @param int $user_id + * @param string $methods + */ + protected function add_method_rows(\phpbb\db\sql_insert_buffer $insert_buffer, $item_type, $item_id, $user_id, array $methods) + { + $row_base = array( + 'item_type' => $item_type, + 'item_id' => (int) $item_id, + 'user_id' => (int) $user_id, + 'notify' => 1 + ); + + foreach ($methods as $method) + { + $row_base['method'] = $method; + $insert_buffer->insert($row_base); + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/notifications.php b/sources/phpBB/phpbb/db/migration/data/v310/notifications.php new file mode 100644 index 0000000..f4d012b --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/notifications.php @@ -0,0 +1,102 @@ + +* @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 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_table_exists($this->table_prefix . 'notifications'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'notification_types' => array( + 'COLUMNS' => array( + 'notification_type' => array('VCHAR:255', ''), + 'notification_type_enabled' => array('BOOL', 1), + ), + 'PRIMARY_KEY' => array('notification_type', 'notification_type_enabled'), + ), + $this->table_prefix . 'notifications' => array( + 'COLUMNS' => array( + 'notification_id' => array('UINT', null, 'auto_increment'), + 'item_type' => array('VCHAR:255', ''), + 'item_id' => array('UINT', 0), + 'item_parent_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'notification_read' => array('BOOL', 0), + 'notification_time' => array('TIMESTAMP', 1), + 'notification_data' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'notification_id', + 'KEYS' => array( + 'item_ident' => array('INDEX', array('item_type', 'item_id')), + 'user' => array('INDEX', array('user_id', 'notification_read')), + ), + ), + $this->table_prefix . 'user_notifications' => array( + 'COLUMNS' => array( + 'item_type' => array('VCHAR:255', ''), + 'item_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'method' => array('VCHAR:255', ''), + 'notify' => array('BOOL', 1), + ), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'notification_types', + $this->table_prefix . 'notifications', + $this->table_prefix . 'user_notifications', + ), + ); + } + + public function update_data() + { + return array( + array('module.add', array( + 'ucp', + 'UCP_MAIN', + array( + 'module_basename' => 'ucp_notifications', + 'modes' => array('notification_list'), + ), + )), + array('module.add', array( + 'ucp', + 'UCP_PREFS', + array( + 'module_basename' => 'ucp_notifications', + 'modes' => array('notification_options'), + ), + )), + array('config.add', array('load_notifications', 1)), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/notifications_cron.php b/sources/phpBB/phpbb/db/migration/data/v310/notifications_cron.php new file mode 100644 index 0000000..ba600f7 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/notifications_cron.php @@ -0,0 +1,31 @@ + +* @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_cron 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('read_notification_expire_days', 30)), + array('config.add', array('read_notification_last_gc', 0)), // last run + array('config.add', array('read_notification_gc', (60 * 60 * 24))), // seconds between run; 1 day + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php b/sources/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php new file mode 100644 index 0000000..263584b --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php @@ -0,0 +1,31 @@ + +* @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_cron_p2 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\notifications_cron'); + } + + public function update_data() + { + return array( + // Make read_notification_last_gc dynamic. + array('config.remove', array('read_notification_last_gc')), + array('config.add', array('read_notification_last_gc', 0, 1)), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php b/sources/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php new file mode 100644 index 0000000..21a39a7 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php @@ -0,0 +1,98 @@ + +* @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_schema_fix extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\notifications'); + } + + public function update_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'notification_types', + $this->table_prefix . 'notifications', + ), + 'add_tables' => array( + $this->table_prefix . 'notification_types' => array( + 'COLUMNS' => array( + 'notification_type_id' => array('USINT', null, 'auto_increment'), + 'notification_type_name' => array('VCHAR:255', ''), + 'notification_type_enabled' => array('BOOL', 1), + ), + 'PRIMARY_KEY' => array('notification_type_id'), + 'KEYS' => array( + 'type' => array('UNIQUE', array('notification_type_name')), + ), + ), + $this->table_prefix . 'notifications' => array( + 'COLUMNS' => array( + 'notification_id' => array('UINT:10', null, 'auto_increment'), + 'notification_type_id' => array('USINT', 0), + 'item_id' => array('UINT', 0), + 'item_parent_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'notification_read' => array('BOOL', 0), + 'notification_time' => array('TIMESTAMP', 1), + 'notification_data' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'notification_id', + 'KEYS' => array( + 'item_ident' => array('INDEX', array('notification_type_id', 'item_id')), + 'user' => array('INDEX', array('user_id', 'notification_read')), + ), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'notification_types', + $this->table_prefix . 'notifications', + ), + 'add_tables' => array( + $this->table_prefix . 'notification_types' => array( + 'COLUMNS' => array( + 'notification_type' => array('VCHAR:255', ''), + 'notification_type_enabled' => array('BOOL', 1), + ), + 'PRIMARY_KEY' => array('notification_type', 'notification_type_enabled'), + ), + $this->table_prefix . 'notifications' => array( + 'COLUMNS' => array( + 'notification_id' => array('UINT', null, 'auto_increment'), + 'item_type' => array('VCHAR:255', ''), + 'item_id' => array('UINT', 0), + 'item_parent_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'notification_read' => array('BOOL', 0), + 'notification_time' => array('TIMESTAMP', 1), + 'notification_data' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'notification_id', + 'KEYS' => array( + 'item_ident' => array('INDEX', array('item_type', 'item_id')), + 'user' => array('INDEX', array('user_id', 'notification_read')), + ), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php b/sources/phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php new file mode 100644 index 0000000..112c1e8 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php @@ -0,0 +1,184 @@ + +* @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_use_full_name extends \phpbb\db\migration\migration +{ + protected $notification_types = array( + 'admin_activate_user', + 'approve_post', + 'approve_topic', + 'bookmark', + 'disapprove_post', + 'disapprove_topic', + 'group_request', + 'group_request_approved', + 'pm', + 'post', + 'post_in_queue', + 'quote', + 'report_pm', + 'report_pm_closed', + 'report_post', + 'report_post_closed', + 'topic', + 'topic_in_queue'); + + protected $notification_methods = array( + 'email', + 'jabber', + ); + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\rc3'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_notifications_name'))), + array('custom', array(array($this, 'update_notifications_method_name'))), + ); + } + + public function revert_data() + { + return array( + array('custom', array(array($this, 'revert_notifications_name'))), + array('custom', array(array($this, 'revert_notifications_method_name'))), + ); + } + + public function update_notifications_method_name() + { + foreach ($this->notification_methods as $notification_method) + { + $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " + SET method = 'notification.method.{$notification_method}' + WHERE method = '{$notification_method}'"; + $this->db->sql_query($sql); + } + } + + public function revert_notifications_method_name() + { + foreach ($this->notification_methods as $notification_method) + { + $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " + SET method = '{$notification_method}' + WHERE method = 'notification.method.{$notification_method}'"; + $this->db->sql_query($sql); + } + } + + public function update_notifications_name() + { + $sql = 'UPDATE ' . NOTIFICATION_TYPES_TABLE . ' + SET notification_type_enabled = 0 + WHERE ' . $this->db->sql_in_set('notification_type_name', $this->notification_types, true); + $this->db->sql_query($sql); + + foreach ($this->notification_types as $notification_type) + { + $sql = 'SELECT notification_type_id + FROM ' . NOTIFICATION_TYPES_TABLE . " + WHERE notification_type_name = 'notification.type.{$notification_type}'"; + $result = $this->db->sql_query($sql); + $new_type_id = (int) $this->db->sql_fetchfield('notification_type_id'); + $this->db->sql_freeresult($result); + + if ($new_type_id) + { + // New type name already exists, + // so we delete the old type and update the type id of existing entries. + $sql = 'SELECT notification_type_id + FROM ' . NOTIFICATION_TYPES_TABLE . " + WHERE notification_type_name = '{$notification_type}'"; + $result = $this->db->sql_query($sql); + $old_type_id = (int) $this->db->sql_fetchfield('notification_type_id'); + $this->db->sql_freeresult($result); + + $sql = 'UPDATE ' . NOTIFICATIONS_TABLE . ' + SET notification_type_id = ' . (int) $new_type_id . ' + WHERE notification_type_id = ' . (int) $old_type_id; + $this->db->sql_query($sql); + + $sql = 'DELETE FROM ' . NOTIFICATION_TYPES_TABLE . " + WHERE notification_type_name = '{$notification_type}'"; + $this->db->sql_query($sql); + } + else + { + // Otherwise we just update the name + $sql = 'UPDATE ' . NOTIFICATION_TYPES_TABLE . " + SET notification_type_name = 'notification.type.{$notification_type}' + WHERE notification_type_name = '{$notification_type}'"; + $this->db->sql_query($sql); + } + + $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " + SET item_type = 'notification.type.{$notification_type}' + WHERE item_type = '{$notification_type}'"; + $this->db->sql_query($sql); + } + } + + public function revert_notifications_name() + { + foreach ($this->notification_types as $notification_type) + { + $sql = 'SELECT notification_type_id + FROM ' . NOTIFICATION_TYPES_TABLE . " + WHERE notification_type_name = '{$notification_type}'"; + $result = $this->db->sql_query($sql); + $new_type_id = (int) $this->db->sql_fetchfield('notification_type_id'); + $this->db->sql_freeresult($result); + + if ($new_type_id) + { + // New type name already exists, + // so we delete the old type and update the type id of existing entries. + $sql = 'SELECT notification_type_id + FROM ' . NOTIFICATION_TYPES_TABLE . " + WHERE notification_type_name = 'notification.type.{$notification_type}'"; + $result = $this->db->sql_query($sql); + $old_type_id = (int) $this->db->sql_fetchfield('notification_type_id'); + $this->db->sql_freeresult($result); + + $sql = 'UPDATE ' . NOTIFICATIONS_TABLE . ' + SET notification_type_id = ' . (int) $new_type_id . ' + WHERE notification_type_id = ' . (int) $old_type_id; + $this->db->sql_query($sql); + + $sql = 'DELETE FROM ' . NOTIFICATION_TYPES_TABLE . " + WHERE notification_type_name = 'notification.type.{$notification_type}'"; + $this->db->sql_query($sql); + } + else + { + // Otherwise we just update the name + $sql = 'UPDATE ' . NOTIFICATION_TYPES_TABLE . " + SET notification_type_name = '{$notification_type}' + WHERE notification_type_name = 'notification.type.{$notification_type}'"; + $this->db->sql_query($sql); + } + + $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " + SET item_type = '{$notification_type}' + WHERE item_type = 'notification.type.{$notification_type}'"; + $this->db->sql_query($sql); + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/passwords.php b/sources/phpBB/phpbb/db/migration/data/v310/passwords.php new file mode 100644 index 0000000..adee441 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/passwords.php @@ -0,0 +1,50 @@ + +* @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 passwords extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_password' => array('VCHAR:255', ''), + ), + $this->table_prefix . 'forums' => array( + 'forum_password' => array('VCHAR:255', ''), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_password' => array('VCHAR:40', ''), + ), + $this->table_prefix . 'forums' => array( + 'forum_password' => array('VCHAR:40', ''), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php b/sources/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php new file mode 100644 index 0000000..aad8e44 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php @@ -0,0 +1,84 @@ + +* @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 passwords_convert_p1 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\passwords_p2'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_passwords'))), + ); + } + + public function update_passwords($start) + { + // Nothing to do if user_pass_convert column doesn't exist + if (!$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_pass_convert')) + { + return; + } + + $start = (int) $start; + $limit = 1000; + $converted_users = 0; + + $sql = 'SELECT user_password, user_id + FROM ' . $this->table_prefix . 'users + WHERE user_pass_convert = 1 + ORDER BY user_id'; + $result = $this->db->sql_query_limit($sql, $limit, $start); + + $update_users = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $converted_users++; + + $user_id = (int) $row['user_id']; + // Only prefix passwords without proper prefix + if (!isset($update_users[$user_id]) && !preg_match('#^\$([a-zA-Z0-9\\\]*?)\$#', $row['user_password'])) + { + // Use $CP$ prefix for passwords that need to + // be converted and set pass convert to false. + $update_users[$user_id] = array( + 'user_password' => '$CP$' . $row['user_password'], + 'user_pass_convert' => 0, + ); + } + } + $this->db->sql_freeresult($result); + + foreach ($update_users as $user_id => $user_data) + { + $sql = 'UPDATE ' . $this->table_prefix . 'users + SET ' . $this->db->sql_build_array('UPDATE', $user_data) . ' + WHERE user_id = ' . $user_id; + $this->sql_query($sql); + } + + if ($converted_users < $limit) + { + // There are no more users to be converted + return; + } + + // There are still more users to query, return the next start value + return $start + $limit; + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/passwords_convert_p2.php b/sources/phpBB/phpbb/db/migration/data/v310/passwords_convert_p2.php new file mode 100644 index 0000000..26a9918 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/passwords_convert_p2.php @@ -0,0 +1,49 @@ + +* @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 passwords_convert_p2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_pass_convert'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\passwords_convert_p1'); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'users' => array( + 'user_pass_convert', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'users' => array( + 'user_pass_convert' => array('BOOL', 0, 'after' => 'user_passchg'), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/passwords_p2.php b/sources/phpBB/phpbb/db/migration/data/v310/passwords_p2.php new file mode 100644 index 0000000..afc7ba2 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/passwords_p2.php @@ -0,0 +1,44 @@ + +* @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 passwords_p2 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\passwords'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_newpasswd' => array('VCHAR:255', ''), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_newpasswd' => array('VCHAR:40', ''), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/plupload.php b/sources/phpBB/phpbb/db/migration/data/v310/plupload.php new file mode 100644 index 0000000..69367f8 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/plupload.php @@ -0,0 +1,36 @@ + +* @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 plupload extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return isset($this->config['plupload_last_gc']) && + isset($this->config['plupload_salt']); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_data() + { + return array( + array('config.add', array('plupload_last_gc', 0)), + array('config.add', array('plupload_salt', unique_id())), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php b/sources/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php new file mode 100644 index 0000000..3457c19 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php @@ -0,0 +1,80 @@ + +* @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 postgres_fulltext_drop extends \phpbb\db\migration\migration +{ + protected $indexes; + + public function effectively_installed() + { + // This migration is irrelevant for all non-PostgreSQL DBMSes. + if (strpos($this->db->get_sql_layer(), 'postgres') === false) + { + return true; + } + + $this->find_indexes_to_drop(); + return empty($this->indexes); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\dev', + ); + } + + public function update_schema() + { + if (empty($this->indexes)) + { + return array(); + } + + /* + * Drop FULLTEXT indexes related to PostgreSQL fulltext search. + * Doing so is equivalent to dropping the search index from the ACP. + * Possibly time-consuming recreation of the search index (i.e. + * FULLTEXT indexes) is left as a task to the admin to not + * unnecessarily stall the upgrade process. The new search index will + * then require about 40% less table space (also see PHPBB3-11040). + */ + return array( + 'drop_keys' => array( + $this->table_prefix . 'posts' => $this->indexes, + ), + ); + } + + public function find_indexes_to_drop() + { + if ($this->indexes !== null) + { + return $this->indexes; + } + + $this->indexes = array(); + $potential_keys = array('post_subject', 'post_text', 'post_content'); + foreach ($potential_keys as $key) + { + if ($this->db_tools->sql_index_exists($this->table_prefix . 'posts', $key)) + { + $this->indexes[] = $key; + } + } + + return $this->indexes; + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_aol.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_aol.php new file mode 100644 index 0000000..65d4fe1 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_aol.php @@ -0,0 +1,55 @@ + +* @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 profilefield_aol extends \phpbb\db\migration\profilefield_base_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_yahoo_cleanup', + ); + } + + protected $profilefield_name = 'phpbb_aol'; + + protected $profilefield_database_type = array('VCHAR', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_aol', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_aol', + 'field_length' => '40', + 'field_minlen' => '5', + 'field_maxlen' => '255', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '.*', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_on_ml' => 0, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 1, + 'field_contact_desc' => '', + 'field_contact_url' => '', + ); + + protected $user_column_name = 'user_aim'; +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_aol_cleanup.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_aol_cleanup.php new file mode 100644 index 0000000..f884d83 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_aol_cleanup.php @@ -0,0 +1,51 @@ + +* @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 profilefield_aol_cleanup extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_aim'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_aol', + ); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'users' => array( + 'user_aim', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'users' => array( + 'user_aim' => array('VCHAR_UNI', ''), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_change_load_settings.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_change_load_settings.php new file mode 100644 index 0000000..7cc4fd8 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_change_load_settings.php @@ -0,0 +1,34 @@ + +* @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 profilefield_change_load_settings extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_aol_cleanup', + ); + } + + public function update_data() + { + return array( + array('config.update', array('load_cpf_memberlist', '1')), + array('config.update', array('load_cpf_pm', '1')), + array('config.update', array('load_cpf_viewprofile', '1')), + array('config.update', array('load_cpf_viewtopic', '1')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_cleanup.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_cleanup.php new file mode 100644 index 0000000..c44167d --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_cleanup.php @@ -0,0 +1,55 @@ + +* @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 profilefield_cleanup extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_occ') && + !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_interests'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_interests', + '\phpbb\db\migration\data\v310\profilefield_occupation', + ); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'users' => array( + 'user_occ', + 'user_interests', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'users' => array( + 'user_occ' => array('MTEXT', ''), + 'user_interests' => array('MTEXT', ''), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_contact_field.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_contact_field.php new file mode 100644 index 0000000..02cd420 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_contact_field.php @@ -0,0 +1,55 @@ + +* @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 profilefield_contact_field extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_column_exists($this->table_prefix . 'profile_fields', 'field_is_contact'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_on_memberlist', + ); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_is_contact' => array('BOOL', 0), + 'field_contact_desc' => array('VCHAR', ''), + 'field_contact_url' => array('VCHAR', ''), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_is_contact', + 'field_contact_desc', + 'field_contact_url', + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_facebook.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_facebook.php new file mode 100644 index 0000000..7324b89 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_facebook.php @@ -0,0 +1,61 @@ + +* @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 profilefield_facebook extends \phpbb\db\migration\profilefield_base_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_contact_field', + '\phpbb\db\migration\data\v310\profilefield_show_novalue', + '\phpbb\db\migration\data\v310\profilefield_types', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'create_custom_field'))), + ); + } + + protected $profilefield_name = 'phpbb_facebook'; + + protected $profilefield_database_type = array('VCHAR', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_facebook', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_facebook', + 'field_length' => '20', + 'field_minlen' => '5', + 'field_maxlen' => '50', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '[\w.]+', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 1, + 'field_contact_desc' => 'VIEW_FACEBOOK_PROFILE', + 'field_contact_url' => 'http://facebook.com/%s/', + ); +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_field_validation_length.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_field_validation_length.php new file mode 100644 index 0000000..c7d8b2d --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_field_validation_length.php @@ -0,0 +1,90 @@ + +* @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 profilefield_field_validation_length extends \phpbb\db\migration\migration +{ + protected $validation_options_old = array( + 'ALPHA_SPACERS' => '[\w_\+\. \-\[\]]+', + ); + + protected $validation_options_new = array( + 'ALPHA_SPACERS' => '[\w\x20_+\-\[\]]+', + ); + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\rc3', + ); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_validation' => array('VCHAR_UNI:64', ''), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_validation' => array('VCHAR_UNI:20', ''), + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_profile_fields_validation'))), + ); + } + + public function revert_data() + { + return array( + array('custom', array(array($this, 'revert_profile_fields_validation'))), + ); + } + + public function update_profile_fields_validation() + { + foreach ($this->validation_options_new as $validation_type => $regex) + { + $sql = 'UPDATE ' . $this->table_prefix . "profile_fields + SET field_validation = '" . $this->db->sql_escape($this->validation_options_new[$validation_type]) . "' + WHERE field_validation = '" . $this->db->sql_escape($this->validation_options_old[$validation_type]) . "'"; + $this->sql_query($sql); + } + } + + public function revert_profile_fields_validation() + { + foreach ($this->validation_options_new as $validation_type => $regex) + { + $sql = 'UPDATE ' . $this->table_prefix . "profile_fields + SET field_validation = '" . $this->db->sql_escape($this->validation_options_old[$validation_type]) . "' + WHERE field_validation = '" . $this->db->sql_escape($this->validation_options_new[$validation_type]) . "'"; + $this->sql_query($sql); + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php new file mode 100644 index 0000000..3b0963f --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php @@ -0,0 +1,61 @@ + +* @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 profilefield_googleplus extends \phpbb\db\migration\profilefield_base_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_contact_field', + '\phpbb\db\migration\data\v310\profilefield_show_novalue', + '\phpbb\db\migration\data\v310\profilefield_types', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'create_custom_field'))), + ); + } + + protected $profilefield_name = 'phpbb_googleplus'; + + protected $profilefield_database_type = array('VCHAR', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_googleplus', + 'field_type' => 'profilefields.type.googleplus', + 'field_ident' => 'phpbb_googleplus', + 'field_length' => '20', + 'field_minlen' => '3', + 'field_maxlen' => '255', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '[\w]+', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 1, + 'field_contact_desc' => 'VIEW_GOOGLEPLUS_PROFILE', + 'field_contact_url' => 'http://plus.google.com/%s', + ); +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_icq.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_icq.php new file mode 100644 index 0000000..e61653f --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_icq.php @@ -0,0 +1,54 @@ + +* @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 profilefield_icq extends \phpbb\db\migration\profilefield_base_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_contact_field', + ); + } + + protected $profilefield_name = 'phpbb_icq'; + + protected $profilefield_database_type = array('VCHAR', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_icq', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_icq', + 'field_length' => '20', + 'field_minlen' => '3', + 'field_maxlen' => '15', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '[0-9]+', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 1, + 'field_contact_desc' => 'SEND_ICQ_MESSAGE', + 'field_contact_url' => 'https://www.icq.com/people/%s/', + ); + + protected $user_column_name = 'user_icq'; +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_icq_cleanup.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_icq_cleanup.php new file mode 100644 index 0000000..516c690 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_icq_cleanup.php @@ -0,0 +1,51 @@ + +* @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 profilefield_icq_cleanup extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_icq'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_icq', + ); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'users' => array( + 'user_icq', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'users' => array( + 'user_icq' => array('VCHAR:20', ''), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_interests.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_interests.php new file mode 100644 index 0000000..33a5ba1 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_interests.php @@ -0,0 +1,52 @@ + +* @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 profilefield_interests extends \phpbb\db\migration\profilefield_base_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_types', + '\phpbb\db\migration\data\v310\profilefield_show_novalue', + ); + } + + protected $profilefield_name = 'phpbb_interests'; + + protected $profilefield_database_type = array('MTEXT', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_interests', + 'field_type' => 'profilefields.type.text', + 'field_ident' => 'phpbb_interests', + 'field_length' => '3|30', + 'field_minlen' => '2', + 'field_maxlen' => '500', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '.*', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 0, + 'field_show_on_vt' => 0, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + ); + + protected $user_column_name = 'user_interests'; +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_location.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_location.php new file mode 100644 index 0000000..2d27c09 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_location.php @@ -0,0 +1,52 @@ + +* @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 profilefield_location extends \phpbb\db\migration\profilefield_base_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_types', + '\phpbb\db\migration\data\v310\profilefield_on_memberlist', + ); + } + + protected $profilefield_name = 'phpbb_location'; + + protected $profilefield_database_type = array('VCHAR', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_location', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_location', + 'field_length' => '20', + 'field_minlen' => '2', + 'field_maxlen' => '100', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '.*', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + ); + + protected $user_column_name = 'user_from'; +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_location_cleanup.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_location_cleanup.php new file mode 100644 index 0000000..b824e34 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_location_cleanup.php @@ -0,0 +1,51 @@ + +* @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 profilefield_location_cleanup extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_from'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_location', + ); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'users' => array( + 'user_from', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'users' => array( + 'user_from' => array('VCHAR_UNI:100', ''), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_occupation.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_occupation.php new file mode 100644 index 0000000..75df2bc --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_occupation.php @@ -0,0 +1,51 @@ + +* @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 profilefield_occupation extends \phpbb\db\migration\profilefield_base_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_interests', + ); + } + + protected $profilefield_name = 'phpbb_occupation'; + + protected $profilefield_database_type = array('MTEXT', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_occupation', + 'field_type' => 'profilefields.type.text', + 'field_ident' => 'phpbb_occupation', + 'field_length' => '3|30', + 'field_minlen' => '2', + 'field_maxlen' => '500', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '.*', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 0, + 'field_show_on_vt' => 0, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + ); + + protected $user_column_name = 'user_occ'; +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_on_memberlist.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_on_memberlist.php new file mode 100644 index 0000000..7ce5de0 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_on_memberlist.php @@ -0,0 +1,51 @@ + +* @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 profilefield_on_memberlist extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_column_exists($this->table_prefix . 'profile_fields', 'field_show_on_ml'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_cleanup', + ); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_show_on_ml' => array('BOOL', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_show_on_ml', + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_show_novalue.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_show_novalue.php new file mode 100644 index 0000000..5fc88b6 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_show_novalue.php @@ -0,0 +1,49 @@ + +* @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 profilefield_show_novalue extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_column_exists($this->table_prefix . 'profile_fields', 'field_show_novalue'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\profilefield_types'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_show_novalue' => array('BOOL', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_show_novalue', + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_skype.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_skype.php new file mode 100644 index 0000000..0dbe904 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_skype.php @@ -0,0 +1,61 @@ + +* @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 profilefield_skype extends \phpbb\db\migration\profilefield_base_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_contact_field', + '\phpbb\db\migration\data\v310\profilefield_show_novalue', + '\phpbb\db\migration\data\v310\profilefield_types', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'create_custom_field'))), + ); + } + + protected $profilefield_name = 'phpbb_skype'; + + protected $profilefield_database_type = array('VCHAR', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_skype', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_skype', + 'field_length' => '20', + 'field_minlen' => '6', + 'field_maxlen' => '32', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '[a-zA-Z][\w\.,\-_]+', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 1, + 'field_contact_desc' => 'VIEW_SKYPE_PROFILE', + 'field_contact_url' => 'skype:%s?userinfo', + ); +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_twitter.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_twitter.php new file mode 100644 index 0000000..850e096 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_twitter.php @@ -0,0 +1,61 @@ + +* @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 profilefield_twitter extends \phpbb\db\migration\profilefield_base_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_contact_field', + '\phpbb\db\migration\data\v310\profilefield_show_novalue', + '\phpbb\db\migration\data\v310\profilefield_types', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'create_custom_field'))), + ); + } + + protected $profilefield_name = 'phpbb_twitter'; + + protected $profilefield_database_type = array('VCHAR', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_twitter', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_twitter', + 'field_length' => '20', + 'field_minlen' => '1', + 'field_maxlen' => '15', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '[\w_]+', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 1, + 'field_contact_desc' => 'VIEW_TWITTER_PROFILE', + 'field_contact_url' => 'http://twitter.com/%s', + ); +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_types.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_types.php new file mode 100644 index 0000000..5045eb8 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_types.php @@ -0,0 +1,110 @@ + +* @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 profilefield_types extends \phpbb\db\migration\migration +{ + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\alpha2', + ); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_type' => array('VCHAR:100', ''), + ), + $this->table_prefix . 'profile_fields_lang' => array( + 'field_type' => array('VCHAR:100', ''), + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_profile_fields_type'))), + array('custom', array(array($this, 'update_profile_fields_lang_type'))), + ); + } + + public function update_profile_fields_type() + { + // Update profile field types + $sql = 'SELECT field_type + FROM ' . $this->table_prefix . 'profile_fields + GROUP BY field_type'; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $sql = 'UPDATE ' . $this->table_prefix . "profile_fields + SET field_type = '" . $this->db->sql_escape($this->convert_phpbb30_field_type($row['field_type'])) . "' + WHERE field_type = '" . $this->db->sql_escape($row['field_type']) . "'"; + $this->sql_query($sql); + } + $this->db->sql_freeresult($result); + } + + public function update_profile_fields_lang_type() + { + // Update profile field language types + $sql = 'SELECT field_type + FROM ' . $this->table_prefix . 'profile_fields_lang + GROUP BY field_type'; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $sql = 'UPDATE ' . $this->table_prefix . "profile_fields_lang + SET field_type = '" . $this->db->sql_escape($this->convert_phpbb30_field_type($row['field_type'])) . "' + WHERE field_type = '" . $this->db->sql_escape($row['field_type']) . "'"; + $this->sql_query($sql); + } + $this->db->sql_freeresult($result); + } + + /** + * Determine the new field type for a given phpBB 3.0 field type + * + * @param $field_type string Field type in 3.0 + * @return string Field new type which is used since 3.1 + */ + public function convert_phpbb30_field_type($field_type) + { + switch ($field_type) + { + case FIELD_INT: + return 'profilefields.type.int'; + case FIELD_STRING: + return 'profilefields.type.string'; + case FIELD_TEXT: + return 'profilefields.type.text'; + case FIELD_BOOL: + return 'profilefields.type.bool'; + case FIELD_DROPDOWN: + return 'profilefields.type.dropdown'; + case FIELD_DATE: + return 'profilefields.type.date'; + default: + return $field_type; + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_website.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_website.php new file mode 100644 index 0000000..e1e10f0 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_website.php @@ -0,0 +1,56 @@ + +* @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 profilefield_website extends \phpbb\db\migration\profilefield_base_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_on_memberlist', + '\phpbb\db\migration\data\v310\profilefield_icq_cleanup', + ); + } + + protected $profilefield_name = 'phpbb_website'; + + protected $profilefield_database_type = array('VCHAR', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_website', + 'field_type' => 'profilefields.type.url', + 'field_ident' => 'phpbb_website', + 'field_length' => '40', + 'field_minlen' => '12', + 'field_maxlen' => '255', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_on_ml' => 1, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 1, + 'field_contact_desc' => 'VISIT_WEBSITE', + 'field_contact_url' => '%s', + ); + + protected $user_column_name = 'user_website'; +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_website_cleanup.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_website_cleanup.php new file mode 100644 index 0000000..94442f0 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_website_cleanup.php @@ -0,0 +1,51 @@ + +* @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 profilefield_website_cleanup extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_website'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_website', + ); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'users' => array( + 'user_website', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'users' => array( + 'user_website' => array('VCHAR_UNI:200', ''), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_wlm.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_wlm.php new file mode 100644 index 0000000..2cd333f --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_wlm.php @@ -0,0 +1,55 @@ + +* @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 profilefield_wlm extends \phpbb\db\migration\profilefield_base_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_website_cleanup', + ); + } + + protected $profilefield_name = 'phpbb_wlm'; + + protected $profilefield_database_type = array('VCHAR', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_wlm', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_wlm', + 'field_length' => '40', + 'field_minlen' => '5', + 'field_maxlen' => '255', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '.*', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_on_ml' => 0, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 1, + 'field_contact_desc' => '', + 'field_contact_url' => '', + ); + + protected $user_column_name = 'user_msnm'; +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_wlm_cleanup.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_wlm_cleanup.php new file mode 100644 index 0000000..7ef9e44 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_wlm_cleanup.php @@ -0,0 +1,51 @@ + +* @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 profilefield_wlm_cleanup extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_msnm'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_wlm', + ); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'users' => array( + 'user_msnm', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'users' => array( + 'user_msnm' => array('VCHAR_UNI', ''), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo.php new file mode 100644 index 0000000..e269f88 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo.php @@ -0,0 +1,55 @@ + +* @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 profilefield_yahoo extends \phpbb\db\migration\profilefield_base_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_wlm_cleanup', + ); + } + + protected $profilefield_name = 'phpbb_yahoo'; + + protected $profilefield_database_type = array('VCHAR', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_yahoo', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_yahoo', + 'field_length' => '40', + 'field_minlen' => '5', + 'field_maxlen' => '255', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '.*', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_on_ml' => 0, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 1, + 'field_contact_desc' => 'SEND_YIM_MESSAGE', + 'field_contact_url' => 'http://edit.yahoo.com/config/send_webmesg?.target=%s&.src=pg', + ); + + protected $user_column_name = 'user_yim'; +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo_cleanup.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo_cleanup.php new file mode 100644 index 0000000..bd724ff --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo_cleanup.php @@ -0,0 +1,51 @@ + +* @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 profilefield_yahoo_cleanup extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_yim'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_yahoo', + ); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'users' => array( + 'user_yim', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'users' => array( + 'user_yim' => array('VCHAR_UNI', ''), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/profilefield_youtube.php b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_youtube.php new file mode 100644 index 0000000..40a569d --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/profilefield_youtube.php @@ -0,0 +1,61 @@ + +* @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 profilefield_youtube extends \phpbb\db\migration\profilefield_base_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_contact_field', + '\phpbb\db\migration\data\v310\profilefield_show_novalue', + '\phpbb\db\migration\data\v310\profilefield_types', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'create_custom_field'))), + ); + } + + protected $profilefield_name = 'phpbb_youtube'; + + protected $profilefield_database_type = array('VCHAR', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_youtube', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_youtube', + 'field_length' => '20', + 'field_minlen' => '3', + 'field_maxlen' => '60', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '[a-zA-Z][\w\.,\-_]+', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 1, + 'field_contact_desc' => 'VIEW_YOUTUBE_CHANNEL', + 'field_contact_url' => 'http://youtube.com/user/%s', + ); +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php b/sources/phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php new file mode 100644 index 0000000..f6d27d3 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php @@ -0,0 +1,50 @@ + +* @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 prune_shadow_topics 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 . 'forums' => array( + 'enable_shadow_prune' => array('BOOL', 0), + 'prune_shadow_days' => array('UINT', 7), + 'prune_shadow_freq' => array('UINT', 1), + 'prune_shadow_next' => array('INT:11', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'forums' => array( + 'enable_shadow_prune', + 'prune_shadow_days', + 'prune_shadow_freq', + 'prune_shadow_next', + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/rc1.php b/sources/phpBB/phpbb/db/migration/data/v310/rc1.php new file mode 100644 index 0000000..10ba7fe --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/rc1.php @@ -0,0 +1,39 @@ + +* @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 rc1 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\beta4', + '\phpbb\db\migration\data\v310\contact_admin_acp_module', + '\phpbb\db\migration\data\v310\contact_admin_form', + '\phpbb\db\migration\data\v310\passwords_convert_p2', + '\phpbb\db\migration\data\v310\profilefield_facebook', + '\phpbb\db\migration\data\v310\profilefield_googleplus', + '\phpbb\db\migration\data\v310\profilefield_skype', + '\phpbb\db\migration\data\v310\profilefield_twitter', + '\phpbb\db\migration\data\v310\profilefield_youtube', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-RC1')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/rc2.php b/sources/phpBB/phpbb/db/migration/data/v310/rc2.php new file mode 100644 index 0000000..e132365 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/rc2.php @@ -0,0 +1,31 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v310; + +class rc2 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-RC2')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/rc3.php b/sources/phpBB/phpbb/db/migration/data/v310/rc3.php new file mode 100644 index 0000000..0e6a452 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/rc3.php @@ -0,0 +1,35 @@ + +* @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 rc3 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\rc2', + '\phpbb\db\migration\data\v310\captcha_plugins', + '\phpbb\db\migration\data\v310\rename_too_long_indexes', + '\phpbb\db\migration\data\v310\search_type', + '\phpbb\db\migration\data\v310\topic_sort_username', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-RC3')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/rc4.php b/sources/phpBB/phpbb/db/migration/data/v310/rc4.php new file mode 100644 index 0000000..47de829 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/rc4.php @@ -0,0 +1,32 @@ + +* @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 rc4 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\rc3', + '\phpbb\db\migration\data\v310\notifications_use_full_name', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-RC4')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/rc5.php b/sources/phpBB/phpbb/db/migration/data/v310/rc5.php new file mode 100644 index 0000000..5b6f70e --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/rc5.php @@ -0,0 +1,33 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v310; + +class rc5 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\rc4', + '\phpbb\db\migration\data\v310\profilefield_field_validation_length', + '\phpbb\db\migration\data\v310\remove_acp_styles_cache', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-RC5')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/rc6.php b/sources/phpBB/phpbb/db/migration/data/v310/rc6.php new file mode 100644 index 0000000..b84f2ed --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/rc6.php @@ -0,0 +1,31 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v310; + +class rc6 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\rc5', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-RC6')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/remove_acp_styles_cache.php b/sources/phpBB/phpbb/db/migration/data/v310/remove_acp_styles_cache.php new file mode 100644 index 0000000..7b84539 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/remove_acp_styles_cache.php @@ -0,0 +1,51 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v310; + +class remove_acp_styles_cache extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_STYLES_CACHE'"; + $result = $this->db->sql_query($sql); + $module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + return !$module_id; + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\rc4'); + } + + public function update_data() + { + return array( + array('module.remove', array( + 'acp', + 'ACP_STYLE_MANAGEMENT', + array( + 'module_basename' => 'acp_styles', + 'module_langname' => 'ACP_STYLES_CACHE', + 'module_mode' => 'cache', + 'module_auth' => 'acl_a_styles', + ), + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/rename_too_long_indexes.php b/sources/phpBB/phpbb/db/migration/data/v310/rename_too_long_indexes.php new file mode 100644 index 0000000..8d2a15d --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/rename_too_long_indexes.php @@ -0,0 +1,38 @@ + +* @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 rename_too_long_indexes extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_0'); + } + + public function update_schema() + { + return array( + 'drop_keys' => array( + $this->table_prefix . 'search_wordmatch' => array( + 'unq_mtch', + ), + ), + 'add_unique_index' => array( + $this->table_prefix . 'search_wordmatch' => array( + 'un_mtch' => array('word_id', 'post_id', 'title_match'), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/reported_posts_display.php b/sources/phpBB/phpbb/db/migration/data/v310/reported_posts_display.php new file mode 100644 index 0000000..575a65d --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/reported_posts_display.php @@ -0,0 +1,53 @@ + +* @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 reported_posts_display extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_column_exists($this->table_prefix . 'reports', 'reported_post_enable_bbcode'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'reports' => array( + 'reported_post_enable_bbcode' => array('BOOL', 1), + 'reported_post_enable_smilies' => array('BOOL', 1), + 'reported_post_enable_magic_url' => array('BOOL', 1), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'reports' => array( + 'reported_post_enable_bbcode', + 'reported_post_enable_smilies', + 'reported_post_enable_magic_url', + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php b/sources/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php new file mode 100644 index 0000000..8211457 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php @@ -0,0 +1,38 @@ + +* @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 captcha_plugin +* +* Reset the captcha setting to the default plugin if the defined 'captcha_plugin' is missing. +*/ +class reset_missing_captcha_plugin extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_data() + { + return array( + array('if', array( + (is_dir($this->phpbb_root_path . 'includes/captcha/plugins/') && + !is_file($this->phpbb_root_path . "includes/captcha/plugins/{$this->config['captcha_plugin']}_plugin." . $this->php_ext)), + array('config.update', array('captcha_plugin', 'phpbb_captcha_nogd')), + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/search_type.php b/sources/phpBB/phpbb/db/migration/data/v310/search_type.php new file mode 100644 index 0000000..f89456a --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/search_type.php @@ -0,0 +1,34 @@ + +* @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 search_type extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\dev', + ); + } + + public function update_data() + { + return array( + array('if', array( + (is_file($this->phpbb_root_path . 'phpbb/search/' . $this->config['search_type'] . $this->php_ext)), + array('config.update', array('search_type', '\\phpbb\\search\\' . $this->config['search_type'])), + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php b/sources/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php new file mode 100644 index 0000000..e50f5e5 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php @@ -0,0 +1,57 @@ + +* @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 signature_module_auth extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + $sql = 'SELECT module_auth + FROM ' . MODULES_TABLE . " + WHERE module_class = 'ucp' + AND module_basename = 'ucp_profile' + AND module_mode = 'signature'"; + $result = $this->db->sql_query($sql); + $module_auth = $this->db->sql_fetchfield('module_auth'); + $this->db->sql_freeresult($result); + + return $module_auth === 'acl_u_sig' || $module_auth === false; + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_data() + { + return array( + array('custom', array( + array($this, 'update_signature_module_auth'), + ), + ), + ); + } + + public function update_signature_module_auth() + { + $sql = 'UPDATE ' . MODULES_TABLE . " + SET module_auth = 'acl_u_sig' + WHERE module_class = 'ucp' + AND module_basename = 'ucp_profile' + AND module_mode = 'signature' + AND module_auth = ''"; + $this->db->sql_query($sql); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php b/sources/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php new file mode 100644 index 0000000..85b90da --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php @@ -0,0 +1,127 @@ + +* @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; + +use phpbb\db\migration\container_aware_migration; + +/** + * Migration to convert the Soft Delete MOD for 3.0 + * + * https://www.phpbb.com/customise/db/mod/soft_delete/ + */ +class soft_delete_mod_convert extends container_aware_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\alpha3', + ); + } + + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_deleted'); + } + + public function update_data() + { + return array( + array('permission.remove', array('m_harddelete', true)), + array('permission.remove', array('m_harddelete', false)), + + array('custom', array(array($this, 'convert_posts'))), + array('custom', array(array($this, 'convert_topics'))), + ); + } + + public function convert_posts($start) + { + $content_visibility = $this->get_content_visibility(); + + $limit = 250; + $i = 0; + + $sql = 'SELECT p.*, t.topic_first_post_id, t.topic_last_post_id + FROM ' . $this->table_prefix . 'posts p, ' . $this->table_prefix . 'topics t + WHERE p.post_deleted > 0 + AND t.topic_id = p.topic_id'; + $result = $this->db->sql_query_limit($sql, $limit, $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $content_visibility->set_post_visibility( + ITEM_DELETED, + $row['post_id'], + $row['topic_id'], + $row['forum_id'], + $row['post_deleted'], + $row['post_deleted_time'], + '', + ($row['post_id'] == $row['topic_first_post_id']) ? true : false, + ($row['post_id'] == $row['topic_last_post_id']) ? true : false + ); + + $i++; + } + + $this->db->sql_freeresult($result); + + if ($i == $limit) + { + return $start + $i; + } + } + + public function convert_topics($start) + { + $content_visibility = $this->get_content_visibility(); + + $limit = 100; + $i = 0; + + $sql = 'SELECT * + FROM ' . $this->table_prefix . 'topics + WHERE topic_deleted > 0'; + $result = $this->db->sql_query_limit($sql, $limit, $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $content_visibility->set_topic_visibility( + ITEM_DELETED, + $row['topic_id'], + $row['forum_id'], + $row['topic_deleted'], + $row['topic_deleted_time'], + '' + ); + + $i++; + } + + $this->db->sql_freeresult($result); + + if ($i == $limit) + { + return $start + $i; + } + } + + /** + * @return \phpbb\content_visibility + */ + protected function get_content_visibility() + { + return $this->container->get('content.visibility'); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert2.php b/sources/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert2.php new file mode 100644 index 0000000..246a267 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert2.php @@ -0,0 +1,66 @@ + +* @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; + +/** + * Migration to convert the Soft Delete MOD for 3.0 + * + * https://www.phpbb.com/customise/db/mod/soft_delete/ + */ +class soft_delete_mod_convert2 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\soft_delete_mod_convert', + ); + } + + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_deleted'); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'forums' => array('forum_deleted_topic_count', 'forum_deleted_reply_count'), + $this->table_prefix . 'posts' => array('post_deleted', 'post_deleted_time'), + $this->table_prefix . 'topics' => array('topic_deleted', 'topic_deleted_time', 'topic_deleted_reply_count'), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'forums' => array( + 'forum_deleted_topic_count' => array('UINT', 0), + 'forum_deleted_reply_count' => array('UINT', 0), + ), + $this->table_prefix . 'posts' => array( + 'post_deleted' => array('UINT', 0), + 'post_deleted_time' => array('TIMESTAMP', 0), + ), + $this->table_prefix . 'topics' => array( + 'topic_deleted' => array('UINT', 0), + 'topic_deleted_time' => array('TIMESTAMP', 0), + 'topic_deleted_reply_count' => array('UINT', 0), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php b/sources/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php new file mode 100644 index 0000000..5e68db5 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php @@ -0,0 +1,61 @@ + +* @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 softdelete_mcp_modules extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'mcp' + AND module_basename = 'mcp_queue' + AND module_mode = 'deleted_topics'"; + $result = $this->db->sql_query($sql); + $module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + return $module_id !== false; + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\dev', + '\phpbb\db\migration\data\v310\softdelete_p2', + ); + } + + public function update_data() + { + return array( + array('module.add', array( + 'mcp', + 'MCP_QUEUE', + array( + 'module_basename' => 'mcp_queue', + 'modes' => array('deleted_topics'), + ), + )), + array('module.add', array( + 'mcp', + 'MCP_QUEUE', + array( + 'module_basename' => 'mcp_queue', + 'modes' => array('deleted_posts'), + ), + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php b/sources/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php new file mode 100644 index 0000000..b1e7486 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php @@ -0,0 +1,211 @@ + +* @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 softdelete_p1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_visibility'); + } + + 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 . 'forums' => array( + 'forum_posts_approved' => array('UINT', 0), + 'forum_posts_unapproved' => array('UINT', 0), + 'forum_posts_softdeleted' => array('UINT', 0), + 'forum_topics_approved' => array('UINT', 0), + 'forum_topics_unapproved' => array('UINT', 0), + 'forum_topics_softdeleted' => array('UINT', 0), + ), + $this->table_prefix . 'posts' => array( + 'post_visibility' => array('TINT:3', 0), + 'post_delete_time' => array('TIMESTAMP', 0), + 'post_delete_reason' => array('STEXT_UNI', ''), + 'post_delete_user' => array('UINT', 0), + ), + $this->table_prefix . 'topics' => array( + 'topic_visibility' => array('TINT:3', 0), + 'topic_delete_time' => array('TIMESTAMP', 0), + 'topic_delete_reason' => array('STEXT_UNI', ''), + 'topic_delete_user' => array('UINT', 0), + 'topic_posts_approved' => array('UINT', 0), + 'topic_posts_unapproved' => array('UINT', 0), + 'topic_posts_softdeleted' => array('UINT', 0), + ), + ), + 'add_index' => array( + $this->table_prefix . 'posts' => array( + 'post_visibility' => array('post_visibility'), + ), + $this->table_prefix . 'topics' => array( + 'topic_visibility' => array('topic_visibility'), + 'forum_vis_last' => array('forum_id', 'topic_visibility', 'topic_last_post_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'forums' => array( + 'forum_posts_approved', + 'forum_posts_unapproved', + 'forum_posts_softdeleted', + 'forum_topics_approved', + 'forum_topics_unapproved', + 'forum_topics_softdeleted', + ), + $this->table_prefix . 'posts' => array( + 'post_visibility', + 'post_delete_time', + 'post_delete_reason', + 'post_delete_user', + ), + $this->table_prefix . 'topics' => array( + 'topic_visibility', + 'topic_delete_time', + 'topic_delete_reason', + 'topic_delete_user', + 'topic_posts_approved', + 'topic_posts_unapproved', + 'topic_posts_softdeleted', + ), + ), + 'drop_keys' => array( + $this->table_prefix . 'posts' => array('post_visibility'), + $this->table_prefix . 'topics' => array('topic_visibility', 'forum_vis_last'), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_post_visibility'))), + array('custom', array(array($this, 'update_topic_visibility'))), + array('custom', array(array($this, 'update_topics_post_counts'))), + array('custom', array(array($this, 'update_forums_topic_and_post_counts'))), + + array('permission.add', array('f_softdelete', false)), + array('permission.add', array('m_softdelete', false)), + ); + } + + public function update_post_visibility() + { + $sql = 'UPDATE ' . $this->table_prefix . 'posts + SET post_visibility = post_approved'; + $this->sql_query($sql); + } + + public function update_topic_visibility() + { + $sql = 'UPDATE ' . $this->table_prefix . 'topics + SET topic_visibility = topic_approved'; + $this->sql_query($sql); + } + + public function update_topics_post_counts() + { + /* + * Using sql_case here to avoid "BIGINT UNSIGNED value is out of range" errors. + * As we update all topics in 2 queries, one broken topic would stop the conversion + * for all topics and the surpressed error will cause the admin to not even notice it. + */ + $sql = 'UPDATE ' . $this->table_prefix . 'topics + SET topic_posts_approved = topic_replies + 1, + topic_posts_unapproved = ' . $this->db->sql_case('topic_replies_real > topic_replies', 'topic_replies_real - topic_replies', '0') . ' + WHERE topic_visibility = ' . ITEM_APPROVED; + $this->sql_query($sql); + + $sql = 'UPDATE ' . $this->table_prefix . 'topics + SET topic_posts_approved = 0, + topic_posts_unapproved = (' . $this->db->sql_case('topic_replies_real > topic_replies', 'topic_replies_real - topic_replies', '0') . ') + 1 + WHERE topic_visibility = ' . ITEM_UNAPPROVED; + $this->sql_query($sql); + } + + public function update_forums_topic_and_post_counts($start) + { + $start = (int) $start; + $limit = 10; + $converted_forums = 0; + + if (!$start) + { + // Preserve the forum_posts value for link forums as it represents redirects. + $sql = 'UPDATE ' . $this->table_prefix . 'forums + SET forum_posts_approved = forum_posts + WHERE forum_type = ' . FORUM_LINK; + $this->db->sql_query($sql); + } + + $sql = 'SELECT forum_id, topic_visibility, COUNT(topic_id) AS sum_topics, SUM(topic_posts_approved) AS sum_posts_approved, SUM(topic_posts_unapproved) AS sum_posts_unapproved + FROM ' . $this->table_prefix . 'topics + GROUP BY forum_id, topic_visibility + ORDER BY forum_id, topic_visibility'; + $result = $this->db->sql_query_limit($sql, $limit, $start); + + $update_forums = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $converted_forums++; + + $forum_id = (int) $row['forum_id']; + if (!isset($update_forums[$forum_id])) + { + $update_forums[$forum_id] = array( + 'forum_posts_approved' => 0, + 'forum_posts_unapproved' => 0, + 'forum_topics_approved' => 0, + 'forum_topics_unapproved' => 0, + ); + } + + $update_forums[$forum_id]['forum_posts_approved'] += (int) $row['sum_posts_approved']; + $update_forums[$forum_id]['forum_posts_unapproved'] += (int) $row['sum_posts_unapproved']; + + $update_forums[$forum_id][(($row['topic_visibility'] == ITEM_APPROVED) ? 'forum_topics_approved' : 'forum_topics_unapproved')] += (int) $row['sum_topics']; + } + $this->db->sql_freeresult($result); + + foreach ($update_forums as $forum_id => $forum_data) + { + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $forum_data) . ' + WHERE forum_id = ' . $forum_id; + $this->sql_query($sql); + } + + if ($converted_forums < $limit) + { + // There are no more topics, we are done + return; + } + + // There are still more topics to query, return the next start value + return $start + $limit; + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php b/sources/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php new file mode 100644 index 0000000..849a996 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php @@ -0,0 +1,78 @@ + +* @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 softdelete_p2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_approved'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\dev', + '\phpbb\db\migration\data\v310\softdelete_p1', + ); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'forums' => array('forum_posts', 'forum_topics', 'forum_topics_real'), + $this->table_prefix . 'posts' => array('post_approved'), + $this->table_prefix . 'topics' => array('topic_approved', 'topic_replies', 'topic_replies_real'), + ), + 'drop_keys' => array( + $this->table_prefix . 'posts' => array('post_approved'), + $this->table_prefix . 'topics' => array( + 'forum_appr_last', + 'topic_approved', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'forums' => array( + 'forum_posts' => array('UINT', 0), + 'forum_topics' => array('UINT', 0), + 'forum_topics_real' => array('UINT', 0), + ), + $this->table_prefix . 'posts' => array( + 'post_approved' => array('BOOL', 1), + ), + $this->table_prefix . 'topics' => array( + 'topic_approved' => array('BOOL', 1), + 'topic_replies' => array('UINT', 0), + 'topic_replies_real' => array('UINT', 0), + ), + ), + 'add_index' => array( + $this->table_prefix . 'posts' => array( + 'post_approved' => array('post_approved'), + ), + $this->table_prefix . 'topics' => array( + 'forum_appr_last' => array('forum_id', 'topic_approved', 'topic_last_post_id'), + 'topic_approved' => array('topic_approved'), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/sources/phpBB/phpbb/db/migration/data/v310/style_update_p1.php new file mode 100644 index 0000000..e8d3a3a --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/style_update_p1.php @@ -0,0 +1,191 @@ + +* @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 style_update_p1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_table_exists($this->table_prefix . 'styles_imageset'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'styles' => array( + 'style_path' => array('VCHAR:100', ''), + 'bbcode_bitfield' => array('VCHAR:255', 'kNg='), + 'style_parent_id' => array('UINT', 0), + 'style_parent_tree' => array('TEXT', ''), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'styles' => array( + 'style_path', + 'bbcode_bitfield', + 'style_parent_id', + 'style_parent_tree', + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'styles_update'))), + ); + } + + public function styles_update() + { + // Get list of valid 3.1 styles + $available_styles = array('prosilver'); + + $iterator = new \DirectoryIterator($this->phpbb_root_path . 'styles'); + $skip_dirs = array('.', '..', 'prosilver'); + foreach ($iterator as $fileinfo) + { + if ($fileinfo->isDir() && !in_array($fileinfo->getFilename(), $skip_dirs) && file_exists($fileinfo->getPathname() . '/style.cfg')) + { + $style_cfg = parse_cfg_file($fileinfo->getPathname() . '/style.cfg'); + if (isset($style_cfg['phpbb_version']) && version_compare($style_cfg['phpbb_version'], '3.1.0-dev', '>=')) + { + // 3.1 style + $available_styles[] = $fileinfo->getFilename(); + } + } + } + + // Get all installed styles + if ($this->db_tools->sql_table_exists($this->table_prefix . 'styles_imageset')) + { + $sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_id, i.imageset_path + FROM ' . STYLES_TABLE . ' s, ' . $this->table_prefix . 'styles_template t, ' . $this->table_prefix . 'styles_theme c, ' . $this->table_prefix . "styles_imageset i + WHERE t.template_id = s.template_id + AND c.theme_id = s.theme_id + AND i.imageset_id = s.imageset_id"; + } + else + { + $sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_id + FROM ' . STYLES_TABLE . ' s, ' . $this->table_prefix . 'styles_template t, ' . $this->table_prefix . "styles_theme c + WHERE t.template_id = s.template_id + AND c.theme_id = s.theme_id"; + } + $result = $this->db->sql_query($sql); + + $styles = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $styles[] = $row; + } + $this->db->sql_freeresult($result); + + // Decide which styles to keep, all others will be deleted + $valid_styles = array(); + foreach ($styles as $style_row) + { + if ( + // Delete styles with parent style (not supported yet) + $style_row['template_inherits_id'] == 0 && + // Check if components match + $style_row['template_path'] == $style_row['theme_path'] && (!isset($style_row['imageset_path']) || $style_row['template_path'] == $style_row['imageset_path']) && + // Check if components are valid + in_array($style_row['template_path'], $available_styles) + ) + { + // Valid style. Keep it + $sql_ary = array( + 'style_path' => $style_row['template_path'], + 'bbcode_bitfield' => $style_row['bbcode_bitfield'], + 'style_parent_id' => 0, + 'style_parent_tree' => '', + ); + $this->sql_query('UPDATE ' . STYLES_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE style_id = ' . $style_row['style_id']); + $valid_styles[] = (int) $style_row['style_id']; + } + } + + // Remove old entries from styles table + if (!sizeof($valid_styles)) + { + // No valid styles: remove everything and add prosilver + $this->sql_query('DELETE FROM ' . STYLES_TABLE, $errored, $error_ary); + + $sql_ary = array( + 'style_name' => 'prosilver', + 'style_copyright' => '© phpBB Limited', + 'style_active' => 1, + 'style_path' => 'prosilver', + 'bbcode_bitfield' => 'lNg=', + 'style_parent_id' => 0, + 'style_parent_tree' => '', + + // Will be removed in the next step + 'imageset_id' => 0, + 'template_id' => 0, + 'theme_id' => 0, + ); + + $sql = 'INSERT INTO ' . STYLES_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); + $this->sql_query($sql); + + $sql = 'SELECT style_id + FROM ' . $table . " + WHERE style_name = 'prosilver'"; + $result = $this->sql_query($sql); + $default_style = $this->db->sql_fetchfield($result); + $this->db->sql_freeresult($result); + + set_config('default_style', $default_style); + + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = 0'; + $this->sql_query($sql); + } + else + { + // There are valid styles in styles table. Remove styles that are outdated + $this->sql_query('DELETE FROM ' . STYLES_TABLE . ' + WHERE ' . $this->db->sql_in_set('style_id', $valid_styles, true)); + + // Change default style + if (!in_array($this->config['default_style'], $valid_styles)) + { + $this->sql_query('UPDATE ' . CONFIG_TABLE . " + SET config_value = '" . $valid_styles[0] . "' + WHERE config_name = 'default_style'"); + } + + // Reset styles for users + $this->sql_query('UPDATE ' . USERS_TABLE . ' + SET user_style = 0 + WHERE ' . $this->db->sql_in_set('user_style', $valid_styles, true)); + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/style_update_p2.php b/sources/phpBB/phpbb/db/migration/data/v310/style_update_p2.php new file mode 100644 index 0000000..52c8ffb --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/style_update_p2.php @@ -0,0 +1,151 @@ + +* @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 style_update_p2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_table_exists($this->table_prefix . 'styles_imageset'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\style_update_p1'); + } + + public function update_schema() + { + return array( + 'drop_keys' => array( + $this->table_prefix . 'styles' => array( + 'imageset_id', + 'template_id', + 'theme_id', + ), + ), + + 'drop_columns' => array( + $this->table_prefix . 'styles' => array( + 'imageset_id', + 'template_id', + 'theme_id', + ), + ), + + 'drop_tables' => array( + $this->table_prefix . 'styles_imageset', + $this->table_prefix . 'styles_imageset_data', + $this->table_prefix . 'styles_template', + $this->table_prefix . 'styles_template_data', + $this->table_prefix . 'styles_theme', + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'styles' => array( + 'imageset_id' => array('UINT', 0), + 'template_id' => array('UINT', 0), + 'theme_id' => array('UINT', 0), + ), + ), + + 'add_index' => array( + $this->table_prefix . 'styles' => array( + 'imageset_id' => array('imageset_id'), + 'template_id' => array('template_id'), + 'theme_id' => array('theme_id'), + ), + ), + + 'add_tables' => array( + $this->table_prefix . 'styles_imageset' => array( + 'COLUMNS' => array( + 'imageset_id' => array('UINT', null, 'auto_increment'), + 'imageset_name' => array('VCHAR_UNI:255', ''), + 'imageset_copyright' => array('VCHAR_UNI', ''), + 'imageset_path' => array('VCHAR:100', ''), + ), + 'PRIMARY_KEY' => 'imageset_id', + 'KEYS' => array( + 'imgset_nm' => array('UNIQUE', 'imageset_name'), + ), + ), + $this->table_prefix . 'styles_imageset_data' => array( + 'COLUMNS' => array( + 'image_id' => array('UINT', null, 'auto_increment'), + 'image_name' => array('VCHAR:200', ''), + 'image_filename' => array('VCHAR:200', ''), + 'image_lang' => array('VCHAR:30', ''), + 'image_height' => array('USINT', 0), + 'image_width' => array('USINT', 0), + 'imageset_id' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'image_id', + 'KEYS' => array( + 'i_d' => array('INDEX', 'imageset_id'), + ), + ), + $this->table_prefix . 'styles_template' => array( + 'COLUMNS' => array( + 'template_id' => array('UINT', null, 'auto_increment'), + 'template_name' => array('VCHAR_UNI:255', ''), + 'template_copyright' => array('VCHAR_UNI', ''), + 'template_path' => array('VCHAR:100', ''), + 'bbcode_bitfield' => array('VCHAR:255', 'kNg='), + 'template_storedb' => array('BOOL', 0), + 'template_inherits_id' => array('UINT:4', 0), + 'template_inherit_path' => array('VCHAR', ''), + ), + 'PRIMARY_KEY' => 'template_id', + 'KEYS' => array( + 'tmplte_nm' => array('UNIQUE', 'template_name'), + ), + ), + $this->table_prefix . 'styles_template_data' => array( + 'COLUMNS' => array( + 'template_id' => array('UINT', 0), + 'template_filename' => array('VCHAR:100', ''), + 'template_included' => array('TEXT', ''), + 'template_mtime' => array('TIMESTAMP', 0), + 'template_data' => array('MTEXT_UNI', ''), + ), + 'KEYS' => array( + 'tid' => array('INDEX', 'template_id'), + 'tfn' => array('INDEX', 'template_filename'), + ), + ), + $this->table_prefix . 'styles_theme' => array( + 'COLUMNS' => array( + 'theme_id' => array('UINT', null, 'auto_increment'), + 'theme_name' => array('VCHAR_UNI:255', ''), + 'theme_copyright' => array('VCHAR_UNI', ''), + 'theme_path' => array('VCHAR:100', ''), + 'theme_storedb' => array('BOOL', 0), + 'theme_mtime' => array('TIMESTAMP', 0), + 'theme_data' => array('MTEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'theme_id', + 'KEYS' => array( + 'theme_name' => array('UNIQUE', 'theme_name'), + ), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/teampage.php b/sources/phpBB/phpbb/db/migration/data/v310/teampage.php new file mode 100644 index 0000000..f8edbc3 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/teampage.php @@ -0,0 +1,110 @@ + +* @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 teampage extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_table_exists($this->table_prefix . 'teampage'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'teampage' => array( + 'COLUMNS' => array( + 'teampage_id' => array('UINT', null, 'auto_increment'), + 'group_id' => array('UINT', 0), + 'teampage_name' => array('VCHAR_UNI:255', ''), + 'teampage_position' => array('UINT', 0), + 'teampage_parent' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'teampage_id', + ), + ), + 'drop_columns' => array( + $this->table_prefix . 'groups' => array( + 'group_teampage', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'teampage', + ), + 'add_columns' => array( + $this->table_prefix . 'groups' => array( + 'group_teampage' => array('UINT', 0, 'after' => 'group_legend'), + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'add_groups_teampage'))), + ); + } + + public function add_groups_teampage() + { + $sql = 'SELECT teampage_id + FROM ' . TEAMPAGE_TABLE; + $result = $this->db->sql_query_limit($sql, 1); + $added_groups_teampage = (bool) $this->db->sql_fetchfield('teampage_id'); + $this->db->sql_freeresult($result); + + if (!$added_groups_teampage) + { + $sql = 'SELECT * + FROM ' . GROUPS_TABLE . ' + WHERE group_type = ' . GROUP_SPECIAL . " + AND (group_name = 'ADMINISTRATORS' + OR group_name = 'GLOBAL_MODERATORS') + ORDER BY group_name ASC"; + $result = $this->db->sql_query($sql); + + $teampage_entries = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $teampage_entries[] = array( + 'group_id' => (int) $row['group_id'], + 'teampage_name' => '', + 'teampage_position' => sizeof($teampage_entries) + 1, + 'teampage_parent' => 0, + ); + } + $this->db->sql_freeresult($result); + + if (sizeof($teampage_entries)) + { + $this->db->sql_multi_insert(TEAMPAGE_TABLE, $teampage_entries); + } + unset($teampage_entries); + } + + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/timezone.php b/sources/phpBB/phpbb/db/migration/data/v310/timezone.php new file mode 100644 index 0000000..1f6b47a --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/timezone.php @@ -0,0 +1,194 @@ + +* @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 timezone extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_dst'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_timezone' => array('VCHAR:100', ''), + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_timezones'))), + ); + } + + public function update_timezones($start) + { + $start = (int) $start; + $limit = 500; + $converted = 0; + + $update_blocks = array(); + + $sql = 'SELECT user_id, user_timezone, user_dst + FROM ' . $this->table_prefix . 'users + ORDER BY user_id ASC'; + $result = $this->db->sql_query_limit($sql, $limit, $start); + while ($row = $this->db->sql_fetchrow($result)) + { + $converted++; + + // In case this is somehow run twice on a row. + // Otherwise it would just end up as UTC on the second run + if (is_numeric($row['user_timezone'])) + { + $update_blocks[$row['user_timezone'] . ':' . $row['user_dst']][] = (int) $row['user_id']; + } + } + $this->db->sql_freeresult($result); + + // Update blocks of users who share the same timezone/dst + foreach ($update_blocks as $timezone => $user_ids) + { + $timezone = explode(':', $timezone); + $converted_timezone = $this->convert_phpbb30_timezone($timezone[0], $timezone[1]); + + $sql = 'UPDATE ' . $this->table_prefix . "users + SET user_timezone = '" . $this->db->sql_escape($converted_timezone) . "' + WHERE " . $this->db->sql_in_set('user_id', $user_ids); + $this->sql_query($sql); + } + + if ($converted == $limit) + { + // There are still more to convert + return $start + $limit; + } + + // Update board default timezone + $sql = 'UPDATE ' . $this->table_prefix . "config + SET config_value = '" . $this->convert_phpbb30_timezone($this->config['board_timezone'], $this->config['board_dst']) . "' + WHERE config_name = 'board_timezone'"; + $this->sql_query($sql); + } + + /** + * Determine the new timezone for a given phpBB 3.0 timezone and + * "Daylight Saving Time" option + * + * @param $timezone float Users timezone in 3.0 + * @param $dst int Users daylight saving time + * @return string Users new php Timezone which is used since 3.1 + */ + public function convert_phpbb30_timezone($timezone, $dst) + { + $offset = $timezone + $dst; + + switch ($timezone) + { + case '-12': + return 'Etc/GMT+' . abs($offset); //'[UTC - 12] Baker Island Time' + case '-11': + return 'Etc/GMT+' . abs($offset); //'[UTC - 11] Niue Time, Samoa Standard Time' + case '-10': + return 'Etc/GMT+' . abs($offset); //'[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time' + case '-9.5': + return 'Pacific/Marquesas'; //'[UTC - 9:30] Marquesas Islands Time' + case '-9': + return 'Etc/GMT+' . abs($offset); //'[UTC - 9] Alaska Standard Time, Gambier Island Time' + case '-8': + return 'Etc/GMT+' . abs($offset); //'[UTC - 8] Pacific Standard Time' + case '-7': + return 'Etc/GMT+' . abs($offset); //'[UTC - 7] Mountain Standard Time' + case '-6': + return 'Etc/GMT+' . abs($offset); //'[UTC - 6] Central Standard Time' + case '-5': + return 'Etc/GMT+' . abs($offset); //'[UTC - 5] Eastern Standard Time' + case '-4.5': + return 'America/Caracas'; //'[UTC - 4:30] Venezuelan Standard Time' + case '-4': + return 'Etc/GMT+' . abs($offset); //'[UTC - 4] Atlantic Standard Time' + case '-3.5': + return 'America/St_Johns'; //'[UTC - 3:30] Newfoundland Standard Time' + case '-3': + return 'Etc/GMT+' . abs($offset); //'[UTC - 3] Amazon Standard Time, Central Greenland Time' + case '-2': + return 'Etc/GMT+' . abs($offset); //'[UTC - 2] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time' + case '-1': + return 'Etc/GMT+' . abs($offset); //'[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time' + case '0': + return (!$dst) ? 'UTC' : 'Etc/GMT-1'; //'[UTC] Western European Time, Greenwich Mean Time' + case '1': + return 'Etc/GMT-' . $offset; //'[UTC + 1] Central European Time, West African Time' + case '2': + return 'Etc/GMT-' . $offset; //'[UTC + 2] Eastern European Time, Central African Time' + case '3': + return 'Etc/GMT-' . $offset; //'[UTC + 3] Moscow Standard Time, Eastern African Time' + case '3.5': + return 'Asia/Tehran'; //'[UTC + 3:30] Iran Standard Time' + case '4': + return 'Etc/GMT-' . $offset; //'[UTC + 4] Gulf Standard Time, Samara Standard Time' + case '4.5': + return 'Asia/Kabul'; //'[UTC + 4:30] Afghanistan Time' + case '5': + return 'Etc/GMT-' . $offset; //'[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time' + case '5.5': + return 'Asia/Kolkata'; //'[UTC + 5:30] Indian Standard Time, Sri Lanka Time' + case '5.75': + return 'Asia/Kathmandu'; //'[UTC + 5:45] Nepal Time' + case '6': + return 'Etc/GMT-' . $offset; //'[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time' + case '6.5': + return 'Indian/Cocos'; //'[UTC + 6:30] Cocos Islands Time, Myanmar Time' + case '7': + return 'Etc/GMT-' . $offset; //'[UTC + 7] Indochina Time, Krasnoyarsk Standard Time' + case '8': + return 'Etc/GMT-' . $offset; //'[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time' + case '8.75': + return 'Australia/Eucla'; //'[UTC + 8:45] Southeastern Western Australia Standard Time' + case '9': + return 'Etc/GMT-' . $offset; //'[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time' + case '9.5': + return 'Australia/ACT'; //'[UTC + 9:30] Australian Central Standard Time' + case '10': + return 'Etc/GMT-' . $offset; //'[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time' + case '10.5': + return 'Australia/Lord_Howe'; //'[UTC + 10:30] Lord Howe Standard Time' + case '11': + return 'Etc/GMT-' . $offset; //'[UTC + 11] Solomon Island Time, Magadan Standard Time' + case '11.5': + return 'Pacific/Norfolk'; //'[UTC + 11:30] Norfolk Island Time' + case '12': + return 'Etc/GMT-12'; //'[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time' + case '12.75': + return 'Pacific/Chatham'; //'[UTC + 12:45] Chatham Islands Time' + case '13': + return 'Pacific/Tongatapu'; //'[UTC + 13] Tonga Time, Phoenix Islands Time' + case '14': + return 'Pacific/Kiritimati'; //'[UTC + 14] Line Island Time' + default: + return 'UTC'; + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/timezone_p2.php b/sources/phpBB/phpbb/db/migration/data/v310/timezone_p2.php new file mode 100644 index 0000000..3ac7ab3 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/timezone_p2.php @@ -0,0 +1,49 @@ + +* @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 timezone_p2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_dst'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\timezone'); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'users' => array( + 'user_dst', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'users' => array( + 'user_dst' => array('BOOL', 0), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/topic_sort_username.php b/sources/phpBB/phpbb/db/migration/data/v310/topic_sort_username.php new file mode 100644 index 0000000..527da20 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/topic_sort_username.php @@ -0,0 +1,44 @@ + +* @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 topic_sort_username extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'topics' => array( + 'topic_first_poster_name' => array('VCHAR_UNI:255', '', 'true_sort'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'topics' => array( + 'topic_first_poster_name' => array('VCHAR_UNI:255', ''), + ), + ), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php b/sources/phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php new file mode 100644 index 0000000..8600f6e --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php @@ -0,0 +1,46 @@ + +* @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 ucp_popuppm_module extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'ucp' + AND module_langname = 'UCP_PM_POPUP_TITLE'"; + $result = $this->db->sql_query($sql); + $module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + return $module_id == false; + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_data() + { + return array( + array('module.remove', array( + 'ucp', + 'UCP_PM', + 'UCP_PM_POPUP_TITLE', + )), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v31x/m_softdelete_global.php b/sources/phpBB/phpbb/db/migration/data/v31x/m_softdelete_global.php new file mode 100644 index 0000000..dd7e20e --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v31x/m_softdelete_global.php @@ -0,0 +1,31 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v31x; + +class m_softdelete_global extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v31x\v311'); + } + + public function update_data() + { + return array( + // Make m_softdelete global. The add method will take care of updating + // it if it already exists. + array('permission.add', array('m_softdelete', true)), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php b/sources/phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php new file mode 100644 index 0000000..0783d70 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php @@ -0,0 +1,31 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v31x; + +class plupload_last_gc_dynamic extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v31x\v312'); + } + + public function update_data() + { + return array( + // Make plupload_last_gc dynamic. + array('config.remove', array('plupload_last_gc')), + array('config.add', array('plupload_last_gc', 0, 1)), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php b/sources/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php new file mode 100644 index 0000000..60491f8 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php @@ -0,0 +1,47 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v31x; + +class profilefield_remove_underscore_from_alpha extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v31x\v311'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'remove_underscore_from_alpha_validations'))), + ); + } + + public function remove_underscore_from_alpha_validations() + { + $this->update_validation_rule('[\w]+', '[a-zA-Z0-9]+'); + $this->update_validation_rule('[\w_]+', '[\w]+'); + $this->update_validation_rule('[\w.]+', '[a-zA-Z0-9.]+'); + $this->update_validation_rule('[\w\x20_+\-\[\]]+', '[\w\x20+\-\[\]]+'); + $this->update_validation_rule('[a-zA-Z][\w\.,\-_]+', '[a-zA-Z][\w\.,\-]+'); + } + + public function update_validation_rule($old_validation, $new_validation) + { + $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . " + SET field_validation = '" . $this->db->sql_escape($new_validation) . "' + WHERE field_validation = '" . $this->db->sql_escape($old_validation) . "'"; + $this->db->sql_query($sql); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php b/sources/phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php new file mode 100644 index 0000000..4df9083 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php @@ -0,0 +1,38 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v31x; + +class profilefield_yahoo_update_url extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v31x\v312'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_contact_url'))), + ); + } + + public function update_contact_url() + { + $sql = 'UPDATE ' . $this->table_prefix . "profile_fields + SET field_contact_url = 'ymsgr:sendim?%s' + WHERE field_name = 'phpbb_yahoo' + AND field_contact_url = 'http://edit.yahoo.com/config/send_webmesg?.target=%s&.src=pg'"; + $this->sql_query($sql); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v31x/style_update.php b/sources/phpBB/phpbb/db/migration/data/v31x/style_update.php new file mode 100644 index 0000000..bb030bb --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v31x/style_update.php @@ -0,0 +1,136 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v31x; + +class style_update extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\gold'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_installed_styles'))), + ); + } + + public function update_installed_styles() + { + // Get all currently available styles + $styles = $this->find_style_dirs(); + $style_paths = $style_ids = array(); + + $sql = 'SELECT style_path, style_id + FROM ' . $this->table_prefix . 'styles'; + $result = $this->db->sql_query($sql); + while ($styles_row = $this->db->sql_fetchrow()) + { + if (in_array($styles_row['style_path'], $styles)) + { + $style_paths[] = $styles_row['style_path']; + $style_ids[] = $styles_row['style_id']; + } + } + $this->db->sql_freeresult($result); + + // Install prosilver if no style is available and prosilver can be installed + if (empty($style_paths) && in_array('prosilver', $styles)) + { + // Try to parse config file + $cfg = parse_cfg_file($this->phpbb_root_path . 'styles/prosilver/style.cfg'); + + // Stop running this if prosilver cfg file can't be read + if (empty($cfg)) + { + throw new \RuntimeException('No styles available and could not fall back to prosilver.'); + } + + $style = array( + 'style_name' => 'prosilver', + 'style_copyright' => '© phpBB Limited', + 'style_active' => 1, + 'style_path' => 'prosilver', + 'bbcode_bitfield' => 'kNg=', + 'style_parent_id' => 0, + 'style_parent_tree' => '', + ); + + // Add to database + $this->db->sql_transaction('begin'); + + $sql = 'INSERT INTO ' . $this->table_prefix . 'styles + ' . $this->db->sql_build_array('INSERT', $style); + $this->db->sql_query($sql); + + $style_id = $this->db->sql_nextid(); + $style_ids[] = $style_id; + + $this->db->sql_transaction('commit'); + + // Set prosilver to default style + $this->config->set('default_style', $style_id); + } + else if (empty($styles) && empty($available_styles)) + { + throw new \RuntimeException('No valid styles available'); + } + + // Make sure default style is available + if (!in_array($this->config['default_style'], $style_ids)) + { + $this->config->set('default_style', array_pop($style_ids)); + } + + // Reset users to default style if their user_style is nonexistent + $sql = 'UPDATE ' . $this->table_prefix . "users + SET user_style = {$this->config['default_style']} + WHERE " . $this->db->sql_in_set('user_style', $style_ids, true, true); + $this->db->sql_query($sql); + } + + /** + * Find all directories that have styles + * Copied from acp_styles + * + * @return array Directory names + */ + protected function find_style_dirs() + { + $styles = array(); + $styles_path = $this->phpbb_root_path . 'styles/'; + + $dp = @opendir($styles_path); + if ($dp) + { + while (($file = readdir($dp)) !== false) + { + $dir = $styles_path . $file; + if ($file[0] == '.' || !is_dir($dir)) + { + continue; + } + + if (file_exists("{$dir}/style.cfg")) + { + $styles[] = $file; + } + } + closedir($dp); + } + + return $styles; + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php b/sources/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php new file mode 100644 index 0000000..854ed1f --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php @@ -0,0 +1,70 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v31x; + +class update_custom_bbcodes_with_idn extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v312', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_bbcodes_table'))), + ); + } + + public function update_bbcodes_table() + { + if (!class_exists('acp_bbcodes')) + { + include($this->phpbb_root_path . 'includes/acp/acp_bbcodes.' . $this->php_ext); + } + + $bbcodes = new \acp_bbcodes(); + + $sql = 'SELECT bbcode_id, bbcode_match, bbcode_tpl + FROM ' . BBCODES_TABLE; + $result = $this->sql_query($sql); + + $sql_ary = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $data = array(); + if (preg_match('/(URL|LOCAL_URL|RELATIVE_URL)/', $row['bbcode_match'])) + { + $data = $bbcodes->build_regexp($row['bbcode_match'], $row['bbcode_tpl']); + $sql_ary[$row['bbcode_id']] = array( + 'first_pass_match' => $data['first_pass_match'], + 'first_pass_replace' => $data['first_pass_replace'], + 'second_pass_match' => $data['second_pass_match'], + 'second_pass_replace' => $data['second_pass_replace'] + ); + } + } + $this->db->sql_freeresult($result); + + foreach ($sql_ary as $bbcode_id => $bbcode_data) + { + $sql = 'UPDATE ' . BBCODES_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $bbcode_data) . ' + WHERE bbcode_id = ' . (int) $bbcode_id; + $this->sql_query($sql); + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v31x/v311.php b/sources/phpBB/phpbb/db/migration/data/v31x/v311.php new file mode 100644 index 0000000..00844dd --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v31x/v311.php @@ -0,0 +1,32 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v31x; + +class v311 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\gold', + '\phpbb\db\migration\data\v31x\style_update', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.1')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v31x/v312.php b/sources/phpBB/phpbb/db/migration/data/v31x/v312.php new file mode 100644 index 0000000..bf49935 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v31x/v312.php @@ -0,0 +1,31 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v31x; + +class v312 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v312rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.2')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v31x/v312rc1.php b/sources/phpBB/phpbb/db/migration/data/v31x/v312rc1.php new file mode 100644 index 0000000..d4b133f --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v31x/v312rc1.php @@ -0,0 +1,32 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v31x; + +class v312rc1 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v311', + '\phpbb\db\migration\data\v31x\m_softdelete_global', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.2-RC1')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v31x/v313.php b/sources/phpBB/phpbb/db/migration/data/v31x/v313.php new file mode 100644 index 0000000..5a4e21a --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v31x/v313.php @@ -0,0 +1,31 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v31x; + +class v313 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v313rc2', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.3')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v31x/v313rc1.php b/sources/phpBB/phpbb/db/migration/data/v31x/v313rc1.php new file mode 100644 index 0000000..e50754f --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v31x/v313rc1.php @@ -0,0 +1,35 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v31x; + +class v313rc1 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v30x\release_3_0_13_rc1', + '\phpbb\db\migration\data\v31x\plupload_last_gc_dynamic', + '\phpbb\db\migration\data\v31x\profilefield_remove_underscore_from_alpha', + '\phpbb\db\migration\data\v31x\profilefield_yahoo_update_url', + '\phpbb\db\migration\data\v31x\update_custom_bbcodes_with_idn', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.3-RC1')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/data/v31x/v313rc2.php b/sources/phpBB/phpbb/db/migration/data/v31x/v313rc2.php new file mode 100644 index 0000000..d832d6f --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/data/v31x/v313rc2.php @@ -0,0 +1,32 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v31x; + +class v313rc2 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v30x\release_3_0_13_pl1', + '\phpbb\db\migration\data\v31x\v313rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.3-RC2')), + ); + } +} diff --git a/sources/phpBB/phpbb/db/migration/exception.php b/sources/phpBB/phpbb/db/migration/exception.php new file mode 100644 index 0000000..7990e85 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/exception.php @@ -0,0 +1,75 @@ + +* @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; + +/** +* The migrator is responsible for applying new migrations in the correct order. +*/ +class exception extends \Exception +{ + /** + * Extra parameters sent to exception to aid in debugging + * @var array + */ + protected $parameters; + + /** + * Throw an exception. + * + * First argument is the error message. + * Additional arguments will be output with the error message. + */ + public function __construct() + { + $parameters = func_get_args(); + $message = array_shift($parameters); + parent::__construct($message); + + $this->parameters = $parameters; + } + + /** + * Output the error as a string + * + * @return string + */ + public function __toString() + { + return $this->message . ': ' . var_export($this->parameters, true); + } + + /** + * Get the parameters + * + * @return array + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * Get localised message (with $user->lang()) + * + * @param \phpbb\user $user + * @return string + */ + public function getLocalisedMessage(\phpbb\user $user) + { + $parameters = $this->getParameters(); + array_unshift($parameters, $this->getMessage()); + + return call_user_func_array(array($user, 'lang'), $parameters); + } +} diff --git a/sources/phpBB/phpbb/db/migration/helper.php b/sources/phpBB/phpbb/db/migration/helper.php new file mode 100644 index 0000000..e40deeb --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/helper.php @@ -0,0 +1,84 @@ + +* @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; + +/** +* The migrator is responsible for applying new migrations in the correct order. +*/ +class helper +{ + /** + * Get the schema steps from an array of schema changes + * + * This splits up $schema_changes into individual changes so that the + * changes can be chunked + * + * @param array $schema_changes from migration + * @return array + */ + public function get_schema_steps($schema_changes) + { + $steps = array(); + + // Nested level of data (only supports 1/2 currently) + $nested_level = array( + 'drop_tables' => 1, + 'add_tables' => 1, + 'change_columns' => 2, + 'add_columns' => 2, + 'drop_keys' => 2, + 'drop_columns' => 2, + 'add_primary_keys' => 2, // perform_schema_changes only uses one level, but second is in the function + 'add_unique_index' => 2, + 'add_index' => 2, + ); + + foreach ($nested_level as $change_type => $data_depth) + { + if (!empty($schema_changes[$change_type])) + { + foreach ($schema_changes[$change_type] as $key => $value) + { + if ($data_depth === 1) + { + $steps[] = array( + 'dbtools.perform_schema_changes', array(array( + $change_type => array( + (!is_int($key)) ? $key : 0 => $value, + ), + )), + ); + } + else if ($data_depth === 2) + { + foreach ($value as $key2 => $value2) + { + $steps[] = array( + 'dbtools.perform_schema_changes', array(array( + $change_type => array( + $key => array( + $key2 => $value2, + ), + ), + )), + ); + } + } + } + } + } + + return $steps; + } +} diff --git a/sources/phpBB/phpbb/db/migration/migration.php b/sources/phpBB/phpbb/db/migration/migration.php new file mode 100644 index 0000000..5f12033 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/migration.php @@ -0,0 +1,186 @@ + +* @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; + +/** +* Abstract base class for database migrations +* +* Each migration consists of a set of schema and data changes to be implemented +* in a subclass. This class provides various utility methods to simplify editing +* a phpBB. +*/ +abstract class migration +{ + /** @var \phpbb\config\config */ + protected $config; + + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + /** @var \phpbb\db\tools */ + protected $db_tools; + + /** @var string */ + protected $table_prefix; + + /** @var string */ + protected $phpbb_root_path; + + /** @var string */ + protected $php_ext; + + /** @var array Errors, if any occurred */ + protected $errors; + + /** @var array List of queries executed through $this->sql_query() */ + protected $queries = array(); + + /** + * Constructor + * + * @param \phpbb\config\config $config + * @param \phpbb\db\driver\driver_interface $db + * @param \phpbb\db\tools $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) + { + $this->config = $config; + $this->db = $db; + $this->db_tools = $db_tools; + $this->table_prefix = $table_prefix; + + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + + $this->errors = array(); + } + + /** + * Defines other migrations to be applied first + * + * @return array An array of migration class names + */ + static public function depends_on() + { + return array(); + } + + /** + * Allows you to check if the migration is effectively installed (entirely optional) + * + * This is checked when a migration is installed. If true is returned, the migration will be set as + * installed without performing the database changes. + * This function is intended to help moving to migrations from a previous database updater, where some + * migrations may have been installed already even though they are not yet listed in the migrations table. + * + * @return bool True if this migration is installed, False if this migration is not installed (checked on install) + */ + public function effectively_installed() + { + return false; + } + + /** + * Updates the database schema by providing a set of change instructions + * + * @return array Array of schema changes (compatible with db_tools->perform_schema_changes()) + */ + public function update_schema() + { + return array(); + } + + /** + * Reverts the database schema by providing a set of change instructions + * + * @return array Array of schema changes (compatible with db_tools->perform_schema_changes()) + */ + public function revert_schema() + { + return array(); + } + + /** + * Updates data by returning a list of instructions to be executed + * + * @return array Array of data update instructions + */ + public function update_data() + { + return array(); + } + + /** + * Reverts data by returning a list of instructions to be executed + * + * @return array Array of data instructions that will be performed on revert + * NOTE: calls to tools (such as config.add) are automatically reverted when + * possible, so you should not attempt to revert those, this is mostly for + * otherwise unrevertable calls (custom functions for example) + */ + public function revert_data() + { + return array(); + } + + /** + * Wrapper for running queries to generate user feedback on updates + * + * @param string $sql SQL query to run on the database + * @return mixed Query result from db->sql_query() + */ + protected function sql_query($sql) + { + $this->queries[] = $sql; + + $this->db->sql_return_on_error(true); + + if ($sql === 'begin') + { + $result = $this->db->sql_transaction('begin'); + } + else if ($sql === 'commit') + { + $result = $this->db->sql_transaction('commit'); + } + else + { + $result = $this->db->sql_query($sql); + if ($this->db->get_sql_error_triggered()) + { + $this->errors[] = array( + 'sql' => $this->db->get_sql_error_sql(), + 'code' => $this->db->get_sql_error_returned(), + ); + } + } + + $this->db->sql_return_on_error(false); + + return $result; + } + + /** + * Get the list of queries run + * + * @return array + */ + public function get_queries() + { + return $this->queries; + } +} diff --git a/sources/phpBB/phpbb/db/migration/profilefield_base_migration.php b/sources/phpBB/phpbb/db/migration/profilefield_base_migration.php new file mode 100644 index 0000000..da1a38e --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/profilefield_base_migration.php @@ -0,0 +1,246 @@ + +* @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; + +abstract class profilefield_base_migration extends container_aware_migration +{ + protected $profilefield_name; + + protected $profilefield_database_type; + + protected $profilefield_data; + + /** + * Language data should be in array -> each language_data in separate key + * array( + * array( + * 'option_id' => value, + * 'field_type' => value, + * 'lang_value' => value, + * ), + * array( + * 'option_id' => value, + * 'field_type' => value, + * 'lang_value' => value, + * ), + * ) + */ + protected $profilefield_language_data; + + protected $user_column_name; + + public function effectively_installed() + { + return $this->db_tools->sql_column_exists($this->table_prefix . 'profile_fields_data', 'pf_' . $this->profilefield_name); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'profile_fields_data' => array( + 'pf_' . $this->profilefield_name => $this->profilefield_database_type, + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'profile_fields_data' => array( + 'pf_' . $this->profilefield_name, + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'create_custom_field'))), + array('custom', array(array($this, 'convert_user_field_to_custom_field'))), + ); + } + + public function revert_data() + { + return array( + array('custom', array(array($this, 'delete_custom_profile_field_data'))), + ); + } + + public function create_custom_field() + { + $sql = 'SELECT MAX(field_order) as max_field_order + FROM ' . PROFILE_FIELDS_TABLE; + $result = $this->db->sql_query($sql); + $max_field_order = (int) $this->db->sql_fetchfield('max_field_order'); + $this->db->sql_freeresult($result); + + $sql_ary = array_merge($this->profilefield_data, array( + 'field_order' => $max_field_order + 1, + )); + + $sql = 'INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); + $this->db->sql_query($sql); + $field_id = (int) $this->db->sql_nextid(); + + $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, PROFILE_LANG_TABLE); + + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE; + $result = $this->db->sql_query($sql); + $lang_name = (strpos($this->profilefield_name, 'phpbb_') === 0) ? strtoupper(substr($this->profilefield_name, 6)) : strtoupper($this->profilefield_name); + while ($lang_id = (int) $this->db->sql_fetchfield('lang_id')) + { + $insert_buffer->insert(array( + 'field_id' => (int) $field_id, + 'lang_id' => (int) $lang_id, + 'lang_name' => $lang_name, + 'lang_explain' => '', + 'lang_default_value' => '', + )); + } + $this->db->sql_freeresult($result); + + $insert_buffer->flush(); + } + + /** + * Create Custom profile fields languguage entries + */ + public function create_language_entries() + { + $field_id = $this->get_custom_profile_field_id(); + + $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, PROFILE_FIELDS_LANG_TABLE); + + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE; + $result = $this->db->sql_query($sql); + while ($lang_id = (int) $this->db->sql_fetchfield('lang_id')) + { + foreach ($this->profilefield_language_data as $language_data) + { + $insert_buffer->insert(array_merge(array( + 'field_id' => (int) $field_id, + 'lang_id' => (int) $lang_id, + ), $language_data)); + } + } + $this->db->sql_freeresult($result); + + $insert_buffer->flush(); + } + + /** + * Clean database when reverting the migration + */ + public function delete_custom_profile_field_data() + { + $field_id = $this->get_custom_profile_field_id(); + + $sql = 'DELETE FROM ' . PROFILE_FIELDS_TABLE . ' + WHERE field_id = ' . (int) $field_id; + $this->db->sql_query($sql); + + $sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . ' + WHERE field_id = ' . (int) $field_id; + $this->db->sql_query($sql); + + $sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . ' + WHERE field_id = ' . (int) $field_id; + $this->db->sql_query($sql); + } + + /** + * Get custom profile field id + * @return int custom profile filed id + */ + public function get_custom_profile_field_id() + { + $sql = 'SELECT field_id + FROM ' . PROFILE_FIELDS_TABLE . " + WHERE field_name = '" . $this->profilefield_name . "'"; + $result = $this->db->sql_query($sql); + $field_id = (int) $this->db->sql_fetchfield('field_id'); + $this->db->sql_freeresult($result); + + return $field_id; + } + + /** + * @param int $start Start of staggering step + * @return mixed int start of the next step, null if the end was reached + */ + public function convert_user_field_to_custom_field($start) + { + $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $this->table_prefix . 'profile_fields_data'); + $limit = 250; + $converted_users = 0; + + $sql = 'SELECT user_id, ' . $this->user_column_name . ' + FROM ' . $this->table_prefix . 'users + WHERE ' . $this->user_column_name . " <> '' + ORDER BY user_id"; + $result = $this->db->sql_query_limit($sql, $limit, $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $converted_users++; + + $cp_data = array( + 'pf_' . $this->profilefield_name => $row[$this->user_column_name], + ); + + $sql = 'UPDATE ' . $this->table_prefix . 'profile_fields_data + SET ' . $this->db->sql_build_array('UPDATE', $cp_data) . ' + WHERE user_id = ' . (int) $row['user_id']; + $this->db->sql_query($sql); + + if (!$this->db->sql_affectedrows()) + { + $cp_data['user_id'] = (int) $row['user_id']; + $cp_data = array_merge($this->get_insert_sql_array(), $cp_data); + $insert_buffer->insert($cp_data); + } + } + $this->db->sql_freeresult($result); + + $insert_buffer->flush(); + + if ($converted_users < $limit) + { + // No more users left, we are done... + return; + } + + return $start + $limit; + } + + protected function get_insert_sql_array() + { + static $profile_row; + + if ($profile_row === null) + { + $manager = $this->container->get('profilefields.manager'); + $profile_row = $manager->build_insert_sql_array(array()); + } + + return $profile_row; + } +} diff --git a/sources/phpBB/phpbb/db/migration/schema_generator.php b/sources/phpBB/phpbb/db/migration/schema_generator.php new file mode 100644 index 0000000..91d8307 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/schema_generator.php @@ -0,0 +1,235 @@ + +* @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; + +/** +* The schema generator generates the schema based on the existing migrations +*/ +class schema_generator +{ + /** @var \phpbb\config\config */ + protected $config; + + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + /** @var \phpbb\db\tools */ + protected $db_tools; + + /** @var array */ + protected $class_names; + + /** @var string */ + protected $table_prefix; + + /** @var string */ + protected $phpbb_root_path; + + /** @var string */ + protected $php_ext; + + /** @var array */ + protected $tables; + + /** @var array */ + protected $dependencies = array(); + + /** + * 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) + { + $this->config = $config; + $this->db = $db; + $this->db_tools = $db_tools; + $this->class_names = $class_names; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->table_prefix = $table_prefix; + } + + /** + * Loads all migrations and their application state from the database. + * + * @return array + */ + public function get_schema() + { + if (!empty($this->tables)) + { + return $this->tables; + } + + $migrations = $this->class_names; + + $tree = array(); + $check_dependencies = true; + while (!empty($migrations)) + { + foreach ($migrations as $migration_class) + { + $open_dependencies = array_diff($migration_class::depends_on(), $tree); + + if (empty($open_dependencies)) + { + $migration = new $migration_class($this->config, $this->db, $this->db_tools, $this->phpbb_root_path, $this->php_ext, $this->table_prefix); + $tree[] = $migration_class; + $migration_key = array_search($migration_class, $migrations); + + foreach ($migration->update_schema() as $change_type => $data) + { + if ($change_type === 'add_tables') + { + foreach ($data as $table => $table_data) + { + $this->tables[$table] = $table_data; + } + } + else if ($change_type === 'drop_tables') + { + foreach ($data as $table) + { + unset($this->tables[$table]); + } + } + else if ($change_type === 'add_columns') + { + foreach ($data as $table => $add_columns) + { + foreach ($add_columns as $column => $column_data) + { + if (isset($column_data['after'])) + { + $columns = $this->tables[$table]['COLUMNS']; + $offset = array_search($column_data['after'], array_keys($columns)); + unset($column_data['after']); + + if ($offset === false) + { + $this->tables[$table]['COLUMNS'][$column] = array_values($column_data); + } + else + { + $this->tables[$table]['COLUMNS'] = array_merge(array_slice($columns, 0, $offset + 1, true), array($column => array_values($column_data)), array_slice($columns, $offset)); + } + } + else + { + $this->tables[$table]['COLUMNS'][$column] = $column_data; + } + } + } + } + else if ($change_type === 'change_columns') + { + foreach ($data as $table => $change_columns) + { + foreach ($change_columns as $column => $column_data) + { + $this->tables[$table]['COLUMNS'][$column] = $column_data; + } + } + } + else if ($change_type === 'drop_columns') + { + foreach ($data as $table => $drop_columns) + { + if (is_array($drop_columns)) + { + foreach ($drop_columns as $column) + { + unset($this->tables[$table]['COLUMNS'][$column]); + } + } + else + { + unset($this->tables[$table]['COLUMNS'][$drop_columns]); + } + } + } + else if ($change_type === 'add_unique_index') + { + foreach ($data as $table => $add_index) + { + foreach ($add_index as $key => $index_data) + { + $this->tables[$table]['KEYS'][$key] = array('UNIQUE', $index_data); + } + } + } + else if ($change_type === 'add_index') + { + foreach ($data as $table => $add_index) + { + foreach ($add_index as $key => $index_data) + { + $this->tables[$table]['KEYS'][$key] = array('INDEX', $index_data); + } + } + } + else if ($change_type === 'drop_keys') + { + foreach ($data as $table => $drop_keys) + { + foreach ($drop_keys as $key) + { + unset($this->tables[$table]['KEYS'][$key]); + } + } + } + else + { + var_dump($change_type); + } + } + unset($migrations[$migration_key]); + } + else if ($check_dependencies) + { + $this->dependencies = array_merge($this->dependencies, $open_dependencies); + } + } + + // Only run this check after the first run + if ($check_dependencies) + { + $this->check_dependencies(); + $check_dependencies = false; + } + } + + ksort($this->tables); + return $this->tables; + } + + /** + * Check if one of the migrations files' dependencies can't be resolved + * by the supplied list of migrations + * + * @throws \UnexpectedValueException If a dependency can't be resolved + */ + protected function check_dependencies() + { + // Strip duplicate values from array + $this->dependencies = array_unique($this->dependencies); + + foreach ($this->dependencies as $dependency) + { + if (!in_array($dependency, $this->class_names)) + { + throw new \UnexpectedValueException("Unable to resolve the dependency '$dependency'"); + } + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/tool/config.php b/sources/phpBB/phpbb/db/migration/tool/config.php new file mode 100644 index 0000000..f93e711 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/tool/config.php @@ -0,0 +1,160 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\tool; + +/** +* Migration config tool +*/ +class config implements \phpbb\db\migration\tool\tool_interface +{ + /** @var \phpbb\config\config */ + protected $config; + + /** + * Constructor + * + * @param \phpbb\config\config $config + */ + public function __construct(\phpbb\config\config $config) + { + $this->config = $config; + } + + /** + * {@inheritdoc} + */ + public function get_name() + { + return 'config'; + } + + /** + * Add a config setting. + * + * @param string $config_name The name of the config setting + * you would like to add + * @param mixed $config_value The value of the config setting + * @param bool $is_dynamic True if it is dynamic (changes very often) + * and should not be stored in the cache, false if not. + * @return null + */ + public function add($config_name, $config_value, $is_dynamic = false) + { + if (isset($this->config[$config_name])) + { + return; + } + + $this->config->set($config_name, $config_value, !$is_dynamic); + } + + /** + * Update an existing config setting. + * + * @param string $config_name The name of the config setting you would + * like to update + * @param mixed $config_value The value of the config setting + * @return null + * @throws \phpbb\db\migration\exception + */ + public function update($config_name, $config_value) + { + if (!isset($this->config[$config_name])) + { + throw new \phpbb\db\migration\exception('CONFIG_NOT_EXIST', $config_name); + } + + $this->config->set($config_name, $config_value); + } + + /** + * Update a config setting if the first argument equal to the + * current config value + * + * @param string $compare If equal to the current config value, will be + * updated to the new config value, otherwise not + * @param string $config_name The name of the config setting you would + * like to update + * @param mixed $config_value The value of the config setting + * @return null + * @throws \phpbb\db\migration\exception + */ + public function update_if_equals($compare, $config_name, $config_value) + { + if (!isset($this->config[$config_name])) + { + throw new \phpbb\db\migration\exception('CONFIG_NOT_EXIST', $config_name); + } + + $this->config->set_atomic($config_name, $compare, $config_value); + } + + /** + * Remove an existing config setting. + * + * @param string $config_name The name of the config setting you would + * like to remove + * @return null + */ + public function remove($config_name) + { + if (!isset($this->config[$config_name])) + { + return; + } + + $this->config->delete($config_name); + } + + /** + * {@inheritdoc} + */ + public function reverse() + { + $arguments = func_get_args(); + $original_call = array_shift($arguments); + + $call = false; + switch ($original_call) + { + case 'add': + $call = 'remove'; + break; + + case 'remove': + $call = 'add'; + if (sizeof($arguments) == 1) + { + $arguments[] = ''; + } + break; + + case 'update_if_equals': + $call = 'update_if_equals'; + + // Set to the original value if the current value is what we compared to originally + $arguments = array( + $arguments[2], + $arguments[1], + $arguments[0], + ); + break; + } + + if ($call) + { + return call_user_func_array(array(&$this, $call), $arguments); + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/tool/config_text.php b/sources/phpBB/phpbb/db/migration/tool/config_text.php new file mode 100644 index 0000000..bf8ac55 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/tool/config_text.php @@ -0,0 +1,125 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\tool; + +/** +* Migration config_text tool +*/ +class config_text implements \phpbb\db\migration\tool\tool_interface +{ + /** @var \phpbb\config\db_text */ + protected $config_text; + + /** + * Constructor + * + * @param \phpbb\config\db_text $config_text + */ + public function __construct(\phpbb\config\db_text $config_text) + { + $this->config_text = $config_text; + } + + /** + * {@inheritdoc} + */ + public function get_name() + { + return 'config_text'; + } + + /** + * Add a config_text setting. + * + * @param string $config_name The name of the config_text setting + * you would like to add + * @param mixed $config_value The value of the config_text setting + * @return null + */ + public function add($config_name, $config_value) + { + if (!is_null($this->config_text->get($config_name))) + { + return; + } + + $this->config_text->set($config_name, $config_value); + } + + /** + * Update an existing config_text setting. + * + * @param string $config_name The name of the config_text setting you would + * like to update + * @param mixed $config_value The value of the config_text setting + * @return null + * @throws \phpbb\db\migration\exception + */ + public function update($config_name, $config_value) + { + if (is_null($this->config_text->get($config_name))) + { + throw new \phpbb\db\migration\exception('CONFIG_NOT_EXIST', $config_name); + } + + $this->config_text->set($config_name, $config_value); + } + + /** + * Remove an existing config_text setting. + * + * @param string $config_name The name of the config_text setting you would + * like to remove + * @return null + */ + public function remove($config_name) + { + if (is_null($this->config_text->get($config_name))) + { + return; + } + + $this->config_text->delete($config_name); + } + + /** + * {@inheritdoc} + */ + public function reverse() + { + $arguments = func_get_args(); + $original_call = array_shift($arguments); + + $call = false; + switch ($original_call) + { + case 'add': + $call = 'remove'; + break; + + case 'remove': + $call = 'add'; + if (sizeof($arguments) == 1) + { + $arguments[] = ''; + } + break; + } + + if ($call) + { + return call_user_func_array(array(&$this, $call), $arguments); + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/tool/module.php b/sources/phpBB/phpbb/db/migration/tool/module.php new file mode 100644 index 0000000..035625b --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/tool/module.php @@ -0,0 +1,490 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\tool; + +/** +* Migration module management tool +*/ +class module implements \phpbb\db\migration\tool\tool_interface +{ + /** @var \phpbb\cache\service */ + protected $cache; + + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + /** @var \phpbb\user */ + protected $user; + + /** @var string */ + protected $phpbb_root_path; + + /** @var string */ + protected $php_ext; + + /** @var string */ + protected $modules_table; + + /** + * Constructor + * + * @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 $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) + { + $this->db = $db; + $this->cache = $cache; + $this->user = $user; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->modules_table = $modules_table; + } + + /** + * {@inheritdoc} + */ + public function get_name() + { + return 'module'; + } + + /** + * Module Exists + * + * Check if a module exists + * + * @param string $class The module class(acp|mcp|ucp) + * @param int|string|bool $parent The parent module_id|module_langname (0 for no parent). + * Use false to ignore the parent check and check class wide. + * @param int|string $module The module_id|module_langname you would like to + * check for to see if it exists + * @return bool true/false if module exists + */ + public function exists($class, $parent, $module) + { + // the main root directory should return true + if (!$module) + { + return true; + } + + $parent_sql = ''; + if ($parent !== false) + { + // Allows '' to be sent as 0 + $parent = $parent ?: 0; + + if (!is_numeric($parent)) + { + $sql = 'SELECT module_id + FROM ' . $this->modules_table . " + WHERE module_langname = '" . $this->db->sql_escape($parent) . "' + AND module_class = '" . $this->db->sql_escape($class) . "'"; + $result = $this->db->sql_query($sql); + $module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + if (!$module_id) + { + return false; + } + + $parent_sql = 'AND parent_id = ' . (int) $module_id; + } + else + { + $parent_sql = 'AND parent_id = ' . (int) $parent; + } + } + + $sql = 'SELECT module_id + FROM ' . $this->modules_table . " + WHERE module_class = '" . $this->db->sql_escape($class) . "' + $parent_sql + AND " . ((is_numeric($module)) ? 'module_id = ' . (int) $module : "module_langname = '" . $this->db->sql_escape($module) . "'"); + $result = $this->db->sql_query($sql); + $module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + if ($module_id) + { + return true; + } + + return false; + } + + /** + * Module Add + * + * Add a new module + * + * @param string $class The module class(acp|mcp|ucp) + * @param int|string $parent The parent module_id|module_langname (0 for no parent) + * @param array $data an array of the data on the new \module. + * This can be setup in two different ways. + * 1. The "manual" way. For inserting a category or one at a time. + * It will be merged with the base array shown a bit below, + * but at the least requires 'module_langname' to be sent, and, + * if you want to create a module (instead of just a category) you must + * send module_basename and module_mode. + * array( + * 'module_enabled' => 1, + * 'module_display' => 1, + * 'module_basename' => '', + * 'module_class' => $class, + * 'parent_id' => (int) $parent, + * 'module_langname' => '', + * 'module_mode' => '', + * 'module_auth' => '', + * ) + * 2. The "automatic" way. For inserting multiple at a time based on the + * specs in the info file for the module(s). For this to work the + * modules must be correctly setup in the info file. + * An example follows (this would insert the settings, log, and flag + * modes from the includes/acp/info/acp_asacp.php file): + * array( + * 'module_basename' => 'asacp', + * 'modes' => array('settings', 'log', 'flag'), + * ) + * Optionally you may not send 'modes' and it will insert all of the + * modules in that info file. + * path, specify that here + * @return null + * @throws \phpbb\db\migration\exception + */ + public function add($class, $parent = 0, $data = array()) + { + // Allows '' to be sent as 0 + $parent = $parent ?: 0; + + // allow sending the name as a string in $data to create a category + if (!is_array($data)) + { + $data = array('module_langname' => $data); + } + + if (!isset($data['module_langname'])) + { + // The "automatic" way + $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'])) + { + $new_module = array( + 'module_basename' => $basename, + 'module_langname' => $module_info['title'], + 'module_mode' => $mode, + 'module_auth' => $module_info['auth'], + 'module_display' => (isset($module_info['display'])) ? $module_info['display'] : true, + 'before' => (isset($module_info['before'])) ? $module_info['before'] : false, + 'after' => (isset($module_info['after'])) ? $module_info['after'] : false, + ); + + // Run the "manual" way with the data we've collected. + $this->add($class, $parent, $new_module); + } + } + + return; + } + + // The "manual" way + if (!is_numeric($parent)) + { + $sql = 'SELECT module_id + FROM ' . $this->modules_table . " + WHERE module_langname = '" . $this->db->sql_escape($parent) . "' + AND module_class = '" . $this->db->sql_escape($class) . "'"; + $result = $this->db->sql_query($sql); + $module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + if (!$module_id) + { + throw new \phpbb\db\migration\exception('MODULE_NOT_EXIST', $parent); + } + + $parent = $data['parent_id'] = $module_id; + } + else if (!$this->exists($class, false, $parent)) + { + throw new \phpbb\db\migration\exception('MODULE_NOT_EXIST', $parent); + } + + if ($this->exists($class, $parent, $data['module_langname'])) + { + 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, + 'module_basename' => (isset($data['module_basename'])) ? $data['module_basename'] : '', + 'module_class' => $class, + 'parent_id' => (int) $parent, + 'module_langname' => (isset($data['module_langname'])) ? $data['module_langname'] : '', + '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 + { + // 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); + + // Move the module if requested above/below an existing one + if (isset($data['before']) && $data['before']) + { + $sql = 'SELECT left_id + FROM ' . $this->modules_table . " + WHERE module_class = '" . $this->db->sql_escape($class) . "' + AND parent_id = " . (int) $parent . " + AND module_langname = '" . $this->db->sql_escape($data['before']) . "'"; + $this->db->sql_query($sql); + $to_left = (int) $this->db->sql_fetchfield('left_id'); + + $sql = 'UPDATE ' . $this->modules_table . " + SET left_id = left_id + 2, right_id = right_id + 2 + WHERE module_class = '" . $this->db->sql_escape($class) . "' + AND left_id >= $to_left + AND left_id < {$module_data['left_id']}"; + $this->db->sql_query($sql); + + $sql = 'UPDATE ' . $this->modules_table . " + SET left_id = $to_left, right_id = " . ($to_left + 1) . " + WHERE module_class = '" . $this->db->sql_escape($class) . "' + AND module_id = {$module_data['module_id']}"; + $this->db->sql_query($sql); + } + else if (isset($data['after']) && $data['after']) + { + $sql = 'SELECT right_id + FROM ' . $this->modules_table . " + WHERE module_class = '" . $this->db->sql_escape($class) . "' + AND parent_id = " . (int) $parent . " + AND module_langname = '" . $this->db->sql_escape($data['after']) . "'"; + $this->db->sql_query($sql); + $to_right = (int) $this->db->sql_fetchfield('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($class) . "' + AND left_id >= $to_right + AND left_id < {$module_data['left_id']}"; + $this->db->sql_query($sql); + + $sql = 'UPDATE ' . $this->modules_table . ' + SET left_id = ' . ($to_right + 1) . ', right_id = ' . ($to_right + 2) . " + WHERE module_class = '" . $this->db->sql_escape($class) . "' + AND module_id = {$module_data['module_id']}"; + $this->db->sql_query($sql); + } + } + + // Clear the Modules Cache + $this->cache->destroy("_modules_$class"); + } + + /** + * Module Remove + * + * Remove a module + * + * @param string $class The module class(acp|mcp|ucp) + * @param int|string|bool $parent The parent module_id|module_langname(0 for no parent). + * Use false to ignore the parent check and check class wide. + * @param int|string $module The module id|module_langname + * specify that here + * @return null + * @throws \phpbb\db\migration\exception + */ + public function remove($class, $parent = 0, $module = '') + { + // Imitation of module_add's "automatic" and "manual" method so the uninstaller works from the same set of instructions for umil_auto + if (is_array($module)) + { + if (isset($module['module_langname'])) + { + // Manual Method + return $this->remove($class, $parent, $module['module_langname']); + } + + // Failed. + if (!isset($module['module_basename'])) + { + throw new \phpbb\db\migration\exception('MODULE_NOT_EXIST'); + } + + // Automatic method + $basename = $module['module_basename']; + $module_info = $this->get_module_info($class, $basename); + + foreach ($module_info['modes'] as $mode => $info) + { + if (!isset($module['modes']) || in_array($mode, $module['modes'])) + { + $this->remove($class, $parent, $info['title']); + } + } + } + else + { + if (!$this->exists($class, $parent, $module)) + { + return; + } + + $parent_sql = ''; + if ($parent !== false) + { + // Allows '' to be sent as 0 + $parent = ($parent) ?: 0; + + if (!is_numeric($parent)) + { + $sql = 'SELECT module_id + FROM ' . $this->modules_table . " + WHERE module_langname = '" . $this->db->sql_escape($parent) . "' + AND module_class = '" . $this->db->sql_escape($class) . "'"; + $result = $this->db->sql_query($sql); + $module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + // we know it exists from the module_exists check + $parent_sql = 'AND parent_id = ' . (int) $module_id; + } + else + { + $parent_sql = 'AND parent_id = ' . (int) $parent; + } + } + + $module_ids = array(); + if (!is_numeric($module)) + { + $sql = 'SELECT module_id + FROM ' . $this->modules_table . " + WHERE module_langname = '" . $this->db->sql_escape($module) . "' + AND module_class = '" . $this->db->sql_escape($class) . "' + $parent_sql"; + $result = $this->db->sql_query($sql); + while ($module_id = $this->db->sql_fetchfield('module_id')) + { + $module_ids[] = (int) $module_id; + } + $this->db->sql_freeresult($result); + } + else + { + $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->cache->destroy("_modules_$class"); + } + } + + /** + * {@inheritdoc} + */ + public function reverse() + { + $arguments = func_get_args(); + $original_call = array_shift($arguments); + + $call = false; + switch ($original_call) + { + case 'add': + $call = 'remove'; + break; + + case 'remove': + $call = 'add'; + break; + } + + if ($call) + { + return call_user_func_array(array(&$this, $call), $arguments); + } + } + + /** + * Wrapper for \acp_modules::get_module_infos() + * + * @param string $class Module Class + * @param string $basename Module Basename + * @return array Module Information + * @throws \phpbb\db\migration\exception + */ + 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); + + if (empty($module)) + { + throw new \phpbb\db\migration\exception('MODULE_INFO_FILE_NOT_EXIST', $class, $basename); + } + + return array_pop($module); + } +} diff --git a/sources/phpBB/phpbb/db/migration/tool/permission.php b/sources/phpBB/phpbb/db/migration/tool/permission.php new file mode 100644 index 0000000..1a91127 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/tool/permission.php @@ -0,0 +1,633 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\tool; + +/** +* Migration permission management tool +*/ +class permission implements \phpbb\db\migration\tool\tool_interface +{ + /** @var \phpbb\auth\auth */ + protected $auth; + + /** @var \phpbb\cache\service */ + protected $cache; + + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + /** @var string */ + protected $phpbb_root_path; + + /** @var string */ + protected $php_ext; + + /** + * Constructor + * + * @param \phpbb\db\driver\driver_interface $db + * @param \phpbb\cache\service $cache + * @param \phpbb\auth\auth $auth + * @param string $phpbb_root_path + * @param string $php_ext + */ + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\auth\auth $auth, $phpbb_root_path, $php_ext) + { + $this->db = $db; + $this->cache = $cache; + $this->auth = $auth; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + } + + /** + * {@inheritdoc} + */ + public function get_name() + { + return 'permission'; + } + + /** + * Permission Exists + * + * Check if a permission (auth) setting exists + * + * @param string $auth_option The name of the permission (auth) option + * @param bool $global True for checking a global permission setting, + * False for a local permission setting + * @return bool true if it exists, false if not + */ + public function exists($auth_option, $global = true) + { + if ($global) + { + $type_sql = ' AND is_global = 1'; + } + else + { + $type_sql = ' AND is_local = 1'; + } + + $sql = 'SELECT auth_option_id + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option = '" . $this->db->sql_escape($auth_option) . "'" + . $type_sql; + $result = $this->db->sql_query($sql); + + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if ($row) + { + return true; + } + + return false; + } + + /** + * Permission Add + * + * Add a permission (auth) option + * + * @param string $auth_option The name of the permission (auth) option + * @param bool $global True for checking a global permission setting, + * False for a local permission setting + * @param int|false $copy_from If set, contains the id of the permission from which to copy the new one. + * @return null + */ + public function add($auth_option, $global = true, $copy_from = false) + { + if ($this->exists($auth_option, $global)) + { + return; + } + + // We've added permissions, so set to true to notify the user. + $this->permissions_added = true; + + if (!class_exists('auth_admin')) + { + include($this->phpbb_root_path . 'includes/acp/auth.' . $this->php_ext); + } + $auth_admin = new \auth_admin(); + + // We have to add a check to see if the !$global (if global, local, and if local, global) permission already exists. If it does, acl_add_option currently has a bug which would break the ACL system, so we are having a work-around here. + if ($this->exists($auth_option, !$global)) + { + $sql_ary = array( + 'is_global' => 1, + 'is_local' => 1, + ); + $sql = 'UPDATE ' . ACL_OPTIONS_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . " + WHERE auth_option = '" . $this->db->sql_escape($auth_option) . "'"; + $this->db->sql_query($sql); + } + else + { + if ($global) + { + $auth_admin->acl_add_option(array('global' => array($auth_option))); + } + else + { + $auth_admin->acl_add_option(array('local' => array($auth_option))); + } + } + + // The permission has been added, now we can copy it if needed + if ($copy_from && isset($auth_admin->acl_options['id'][$copy_from])) + { + $old_id = $auth_admin->acl_options['id'][$copy_from]; + $new_id = $auth_admin->acl_options['id'][$auth_option]; + + $tables = array(ACL_GROUPS_TABLE, ACL_ROLES_DATA_TABLE, ACL_USERS_TABLE); + + foreach ($tables as $table) + { + $sql = 'SELECT * + FROM ' . $table . ' + WHERE auth_option_id = ' . $old_id; + $result = $this->db->sql_query($sql); + + $sql_ary = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $row['auth_option_id'] = $new_id; + $sql_ary[] = $row; + } + $this->db->sql_freeresult($result); + + if (!empty($sql_ary)) + { + $this->db->sql_multi_insert($table, $sql_ary); + } + } + + $auth_admin->acl_clear_prefetch(); + } + } + + /** + * Permission Remove + * + * Remove a permission (auth) option + * + * @param string $auth_option The name of the permission (auth) option + * @param bool $global True for checking a global permission setting, + * False for a local permission setting + * @return null + */ + public function remove($auth_option, $global = true) + { + if (!$this->exists($auth_option, $global)) + { + return; + } + + if ($global) + { + $type_sql = ' AND is_global = 1'; + } + else + { + $type_sql = ' AND is_local = 1'; + } + $sql = 'SELECT auth_option_id, is_global, is_local + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option = '" . $this->db->sql_escape($auth_option) . "'" . + $type_sql; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + $id = (int) $row['auth_option_id']; + + // If it is a local and global permission, do not remove the row! :P + if ($row['is_global'] && $row['is_local']) + { + $sql = 'UPDATE ' . ACL_OPTIONS_TABLE . ' + SET ' . (($global) ? 'is_global = 0' : 'is_local = 0') . ' + WHERE auth_option_id = ' . $id; + $this->db->sql_query($sql); + } + else + { + // Delete time + $tables = array(ACL_GROUPS_TABLE, ACL_ROLES_DATA_TABLE, ACL_USERS_TABLE, ACL_OPTIONS_TABLE); + foreach ($tables as $table) + { + $this->db->sql_query('DELETE FROM ' . $table . ' + WHERE auth_option_id = ' . $id); + } + } + + // Purge the auth cache + $this->cache->destroy('_acl_options'); + $this->auth->acl_clear_prefetch(); + } + + /** + * Add a new permission role + * + * @param string $role_name The new role name + * @param string $role_type The type (u_, m_, a_) + * @param string $role_description Description of the new role + * + * @return null + */ + public function role_add($role_name, $role_type, $role_description = '') + { + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_name = '" . $this->db->sql_escape($role_name) . "'"; + $this->db->sql_query($sql); + $role_id = (int) $this->db->sql_fetchfield('role_id'); + + if ($role_id) + { + return; + } + + $sql = 'SELECT MAX(role_order) AS max_role_order + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = '" . $this->db->sql_escape($role_type) . "'"; + $this->db->sql_query($sql); + $role_order = (int) $this->db->sql_fetchfield('max_role_order'); + $role_order = (!$role_order) ? 1 : $role_order + 1; + + $sql_ary = array( + 'role_name' => $role_name, + 'role_description' => $role_description, + 'role_type' => $role_type, + 'role_order' => $role_order, + ); + + $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); + $this->db->sql_query($sql); + } + + /** + * Update the name on a permission role + * + * @param string $old_role_name The old role name + * @param string $new_role_name The new role name + * @return null + * @throws \phpbb\db\migration\exception + */ + public function role_update($old_role_name, $new_role_name) + { + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_name = '" . $this->db->sql_escape($old_role_name) . "'"; + $this->db->sql_query($sql); + $role_id = (int) $this->db->sql_fetchfield('role_id'); + + if (!$role_id) + { + throw new \phpbb\db\migration\exception('ROLE_NOT_EXIST', $old_role_name); + } + + $sql = 'UPDATE ' . ACL_ROLES_TABLE . " + SET role_name = '" . $this->db->sql_escape($new_role_name) . "' + WHERE role_name = '" . $this->db->sql_escape($old_role_name) . "'"; + $this->db->sql_query($sql); + } + + /** + * Remove a permission role + * + * @param string $role_name The role name to remove + * @return null + */ + public function role_remove($role_name) + { + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_name = '" . $this->db->sql_escape($role_name) . "'"; + $this->db->sql_query($sql); + $role_id = (int) $this->db->sql_fetchfield('role_id'); + + if (!$role_id) + { + return; + } + + $sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . ' + WHERE role_id = ' . $role_id; + $this->db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_ROLES_TABLE . ' + WHERE role_id = ' . $role_id; + $this->db->sql_query($sql); + + $this->auth->acl_clear_prefetch(); + } + + /** + * Permission Set + * + * Allows you to set permissions for a certain group/role + * + * @param string $name The name of the role/group + * @param string|array $auth_option The auth_option or array of + * auth_options you would like to set + * @param string $type The type (role|group) + * @param bool $has_permission True if you want to give them permission, + * false if you want to deny them permission + * @return null + * @throws \phpbb\db\migration\exception + */ + public function permission_set($name, $auth_option, $type = 'role', $has_permission = true) + { + if (!is_array($auth_option)) + { + $auth_option = array($auth_option); + } + + $new_auth = array(); + $sql = 'SELECT auth_option_id + FROM ' . ACL_OPTIONS_TABLE . ' + WHERE ' . $this->db->sql_in_set('auth_option', $auth_option); + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $new_auth[] = (int) $row['auth_option_id']; + } + $this->db->sql_freeresult($result); + + if (empty($new_auth)) + { + return; + } + + $current_auth = array(); + + $type = (string) $type; // Prevent PHP bug. + + switch ($type) + { + case 'role': + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_name = '" . $this->db->sql_escape($name) . "'"; + $this->db->sql_query($sql); + $role_id = (int) $this->db->sql_fetchfield('role_id'); + + if (!$role_id) + { + throw new \phpbb\db\migration\exception('ROLE_NOT_EXIST', $name); + } + + $sql = 'SELECT auth_option_id, auth_setting + FROM ' . ACL_ROLES_DATA_TABLE . ' + WHERE role_id = ' . $role_id; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $current_auth[$row['auth_option_id']] = $row['auth_setting']; + } + $this->db->sql_freeresult($result); + break; + + case 'group': + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = '" . $this->db->sql_escape($name) . "'"; + $this->db->sql_query($sql); + $group_id = (int) $this->db->sql_fetchfield('group_id'); + + if (!$group_id) + { + throw new \phpbb\db\migration\exception('GROUP_NOT_EXIST', $name); + } + + // If the group has a role set for them we will add the requested permissions to that role. + $sql = 'SELECT auth_role_id + FROM ' . ACL_GROUPS_TABLE . ' + WHERE group_id = ' . $group_id . ' + AND auth_role_id <> 0 + AND forum_id = 0'; + $this->db->sql_query($sql); + $role_id = (int) $this->db->sql_fetchfield('auth_role_id'); + if ($role_id) + { + $sql = 'SELECT role_name + FROM ' . ACL_ROLES_TABLE . ' + WHERE role_id = ' . $role_id; + $this->db->sql_query($sql); + $role_name = $this->db->sql_fetchfield('role_name'); + + return $this->permission_set($role_name, $auth_option, 'role', $has_permission); + } + + $sql = 'SELECT auth_option_id, auth_setting + FROM ' . ACL_GROUPS_TABLE . ' + WHERE group_id = ' . $group_id; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $current_auth[$row['auth_option_id']] = $row['auth_setting']; + } + $this->db->sql_freeresult($result); + break; + } + + $sql_ary = array(); + switch ($type) + { + case 'role': + foreach ($new_auth as $auth_option_id) + { + if (!isset($current_auth[$auth_option_id])) + { + $sql_ary[] = array( + 'role_id' => $role_id, + 'auth_option_id' => $auth_option_id, + 'auth_setting' => $has_permission, + ); + } + } + + $this->db->sql_multi_insert(ACL_ROLES_DATA_TABLE, $sql_ary); + break; + + case 'group': + foreach ($new_auth as $auth_option_id) + { + if (!isset($current_auth[$auth_option_id])) + { + $sql_ary[] = array( + 'group_id' => $group_id, + 'auth_option_id' => $auth_option_id, + 'auth_setting' => $has_permission, + ); + } + } + + $this->db->sql_multi_insert(ACL_GROUPS_TABLE, $sql_ary); + break; + } + + $this->auth->acl_clear_prefetch(); + } + + /** + * Permission Unset + * + * Allows you to unset (remove) permissions for a certain group/role + * + * @param string $name The name of the role/group + * @param string|array $auth_option The auth_option or array of + * auth_options you would like to set + * @param string $type The type (role|group) + * @return null + * @throws \phpbb\db\migration\exception + */ + public function permission_unset($name, $auth_option, $type = 'role') + { + if (!is_array($auth_option)) + { + $auth_option = array($auth_option); + } + + $to_remove = array(); + $sql = 'SELECT auth_option_id + FROM ' . ACL_OPTIONS_TABLE . ' + WHERE ' . $this->db->sql_in_set('auth_option', $auth_option); + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $to_remove[] = (int) $row['auth_option_id']; + } + $this->db->sql_freeresult($result); + + if (empty($to_remove)) + { + return; + } + + $type = (string) $type; // Prevent PHP bug. + + switch ($type) + { + case 'role': + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_name = '" . $this->db->sql_escape($name) . "'"; + $this->db->sql_query($sql); + $role_id = (int) $this->db->sql_fetchfield('role_id'); + + if (!$role_id) + { + throw new \phpbb\db\migration\exception('ROLE_NOT_EXIST', $name); + } + + $sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . ' + WHERE ' . $this->db->sql_in_set('auth_option_id', $to_remove) . ' + AND role_id = ' . (int) $role_id; + $this->db->sql_query($sql); + break; + + case 'group': + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = '" . $this->db->sql_escape($name) . "'"; + $this->db->sql_query($sql); + $group_id = (int) $this->db->sql_fetchfield('group_id'); + + if (!$group_id) + { + throw new \phpbb\db\migration\exception('GROUP_NOT_EXIST', $name); + } + + // If the group has a role set for them we will remove the requested permissions from that role. + $sql = 'SELECT auth_role_id + FROM ' . ACL_GROUPS_TABLE . ' + WHERE group_id = ' . $group_id . ' + AND auth_role_id <> 0'; + $this->db->sql_query($sql); + $role_id = (int) $this->db->sql_fetchfield('auth_role_id'); + if ($role_id) + { + $sql = 'SELECT role_name + FROM ' . ACL_ROLES_TABLE . ' + WHERE role_id = ' . $role_id; + $this->db->sql_query($sql); + $role_name = $this->db->sql_fetchfield('role_name'); + + return $this->permission_unset($role_name, $auth_option, 'role'); + } + + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . ' + WHERE ' . $this->db->sql_in_set('auth_option_id', $to_remove); + $this->db->sql_query($sql); + break; + } + + $this->auth->acl_clear_prefetch(); + } + + /** + * {@inheritdoc} + */ + public function reverse() + { + $arguments = func_get_args(); + $original_call = array_shift($arguments); + + $call = false; + switch ($original_call) + { + case 'add': + $call = 'remove'; + break; + + case 'remove': + $call = 'add'; + break; + + case 'permission_set': + $call = 'permission_unset'; + break; + + case 'permission_unset': + $call = 'permission_set'; + break; + + case 'role_add': + $call = 'role_remove'; + break; + + case 'role_remove': + $call = 'role_add'; + break; + + case 'role_update': + // Set to the original value if the current value is what we compared to originally + $arguments = array( + $arguments[1], + $arguments[0], + ); + break; + } + + if ($call) + { + return call_user_func_array(array(&$this, $call), $arguments); + } + } +} diff --git a/sources/phpBB/phpbb/db/migration/tool/tool_interface.php b/sources/phpBB/phpbb/db/migration/tool/tool_interface.php new file mode 100644 index 0000000..07cd243 --- /dev/null +++ b/sources/phpBB/phpbb/db/migration/tool/tool_interface.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\tool; + +/** +* Migration tool interface +*/ +interface tool_interface +{ + /** + * Retrieve a short name used for commands in migrations. + * + * @return string short name + */ + public function get_name(); + + /** + * Reverse an original install action + * + * First argument is the original call to the class (e.g. add, remove) + * After the first argument, send the original arguments to the function in the original call + * + * @return null + */ + public function reverse(); +} diff --git a/sources/phpBB/phpbb/db/migrator.php b/sources/phpBB/phpbb/db/migrator.php new file mode 100644 index 0000000..7fc3e78 --- /dev/null +++ b/sources/phpBB/phpbb/db/migrator.php @@ -0,0 +1,839 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db; + +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** +* The migrator is responsible for applying new migrations in the correct order. +*/ +class migrator +{ + /** + * @var ContainerInterface + */ + protected $container; + + /** @var \phpbb\config\config */ + protected $config; + + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + /** @var \phpbb\db\tools */ + protected $db_tools; + + /** @var \phpbb\db\migration\helper */ + protected $helper; + + /** @var string */ + protected $table_prefix; + + /** @var string */ + protected $phpbb_root_path; + + /** @var string */ + protected $php_ext; + + /** @var string */ + protected $migrations_table; + + /** + * State of all migrations + * + * (SELECT * FROM migrations table) + * + * @var array + */ + protected $migration_state = array(); + + /** + * Array of all migrations available to be run + * + * @var array + */ + protected $migrations = array(); + + /** + * Array of migrations that have been determined to be fulfillable + * + * @var array + */ + protected $fulfillable_migrations = array(); + + /** + * 'name,' 'class,' and 'state' of the last migration run + * + * 'effectively_installed' set and set to true if the migration was effectively_installed + * + * @var array + */ + public $last_run_migration = false; + + /** + * The output handler. A null handler is configured by default. + * + * @var migrator_output_handler_interface + */ + public $output_handler; + + /** + * Constructor of the database migrator + */ + public function __construct(ContainerInterface $container, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools $db_tools, $migrations_table, $phpbb_root_path, $php_ext, $table_prefix, $tools, \phpbb\db\migration\helper $helper) + { + $this->container = $container; + $this->config = $config; + $this->db = $db; + $this->db_tools = $db_tools; + $this->helper = $helper; + + $this->migrations_table = $migrations_table; + + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + + $this->table_prefix = $table_prefix; + + $this->output_handler = new null_migrator_output_handler(); + + foreach ($tools as $tool) + { + $this->tools[$tool->get_name()] = $tool; + } + + $this->tools['dbtools'] = $this->db_tools; + + $this->load_migration_state(); + } + + /** + * Set the output handler. + * + * @param migrator_output_handler $handler The output handler + */ + public function set_output_handler(migrator_output_handler_interface $handler) + { + $this->output_handler = $handler; + } + + /** + * Loads all migrations and their application state from the database. + * + * @return null + */ + public function load_migration_state() + { + $this->migration_state = array(); + + // prevent errors in case the table does not exist yet + $this->db->sql_return_on_error(true); + + $sql = "SELECT * + FROM " . $this->migrations_table; + $result = $this->db->sql_query($sql); + + if (!$this->db->get_sql_error_triggered()) + { + while ($migration = $this->db->sql_fetchrow($result)) + { + $this->migration_state[$migration['migration_name']] = $migration; + + $this->migration_state[$migration['migration_name']]['migration_depends_on'] = unserialize($migration['migration_depends_on']); + } + } + + $this->db->sql_freeresult($result); + + $this->db->sql_return_on_error(false); + } + + /** + * Sets the list of available migration class names to the given array. + * + * @param array $class_names An array of migration class names + * @return null + */ + public function set_migrations($class_names) + { + $this->migrations = $class_names; + } + + /** + * Runs a single update step from the next migration to be applied. + * + * The update step can either be a schema or a (partial) data update. To + * check if update() needs to be called again use the finished() method. + * + * @return null + */ + public function update() + { + $this->container->get('dispatcher')->disable(); + $this->update_do(); + $this->container->get('dispatcher')->enable(); + } + + /** + * Effectively runs a single update step from the next migration to be applied. + * + * @return null + */ + protected function update_do() + { + foreach ($this->migrations as $name) + { + if (!isset($this->migration_state[$name]) || + !$this->migration_state[$name]['migration_schema_done'] || + !$this->migration_state[$name]['migration_data_done']) + { + if (!$this->try_apply($name)) + { + continue; + } + else + { + return; + } + } + else + { + $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler_interface::VERBOSITY_DEBUG); + } + } + } + + /** + * Attempts to apply a step of the given migration or one of its dependencies + * + * @param string $name The class name of the migration + * @return bool Whether any update step was successfully run + * @throws \phpbb\db\migration\exception + */ + protected function try_apply($name) + { + if (!class_exists($name)) + { + $this->output_handler->write(array('MIGRATION_NOT_VALID', $name), migrator_output_handler_interface::VERBOSITY_DEBUG); + return false; + } + + $migration = $this->get_migration($name); + + $state = (isset($this->migration_state[$name])) ? + $this->migration_state[$name] : + array( + 'migration_depends_on' => $migration->depends_on(), + 'migration_schema_done' => false, + 'migration_data_done' => false, + 'migration_data_state' => '', + 'migration_start_time' => 0, + 'migration_end_time' => 0, + ); + + if (!empty($state['migration_depends_on'])) + { + $this->output_handler->write(array('MIGRATION_APPLY_DEPENDENCIES', $name), migrator_output_handler_interface::VERBOSITY_DEBUG); + } + + foreach ($state['migration_depends_on'] as $depend) + { + if ($this->unfulfillable($depend) !== false) + { + throw new \phpbb\db\migration\exception('MIGRATION_NOT_FULFILLABLE', $name, $depend); + } + + if (!isset($this->migration_state[$depend]) || + !$this->migration_state[$depend]['migration_schema_done'] || + !$this->migration_state[$depend]['migration_data_done']) + { + return $this->try_apply($depend); + } + } + + $this->last_run_migration = array( + 'name' => $name, + 'class' => $migration, + 'state' => $state, + 'task' => '', + ); + + if (!isset($this->migration_state[$name])) + { + if ($state['migration_start_time'] == 0 && $migration->effectively_installed()) + { + $state = array( + 'migration_depends_on' => $migration->depends_on(), + 'migration_schema_done' => true, + 'migration_data_done' => true, + 'migration_data_state' => '', + 'migration_start_time' => 0, + 'migration_end_time' => 0, + ); + + $this->last_run_migration['effectively_installed'] = true; + + $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler_interface::VERBOSITY_VERBOSE); + } + else + { + $state['migration_start_time'] = time(); + } + } + + $this->set_migration_state($name, $state); + + if (!$state['migration_schema_done']) + { + $this->output_handler->write(array('MIGRATION_SCHEMA_RUNNING', $name), migrator_output_handler_interface::VERBOSITY_VERBOSE); + + $this->last_run_migration['task'] = 'process_schema_step'; + $elapsed_time = microtime(true); + $steps = $this->helper->get_schema_steps($migration->update_schema()); + $result = $this->process_data_step($steps, $state['migration_data_state']); + $elapsed_time = microtime(true) - $elapsed_time; + + $state['migration_data_state'] = ($result === true) ? '' : $result; + $state['migration_schema_done'] = ($result === true); + + $this->output_handler->write(array('MIGRATION_SCHEMA_DONE', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_NORMAL); + } + else if (!$state['migration_data_done']) + { + try + { + $this->output_handler->write(array('MIGRATION_DATA_RUNNING', $name), migrator_output_handler_interface::VERBOSITY_VERBOSE); + + $this->last_run_migration['task'] = 'process_data_step'; + + $elapsed_time = microtime(true); + $result = $this->process_data_step($migration->update_data(), $state['migration_data_state']); + $elapsed_time = microtime(true) - $elapsed_time; + + $state['migration_data_state'] = ($result === true) ? '' : $result; + $state['migration_data_done'] = ($result === true); + $state['migration_end_time'] = ($result === true) ? time() : 0; + + if ($state['migration_schema_done']) + { + $this->output_handler->write(array('MIGRATION_DATA_DONE', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_NORMAL); + } + else + { + $this->output_handler->write(array('MIGRATION_DATA_IN_PROGRESS', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_VERY_VERBOSE); + } + } + catch (\phpbb\db\migration\exception $e) + { + // Revert the schema changes + $this->revert_do($name); + + // Rethrow exception + throw $e; + } + } + + $this->set_migration_state($name, $state); + + return true; + } + + /** + * Runs a single revert step from the last migration installed + * + * YOU MUST ADD/SET ALL MIGRATIONS THAT COULD BE DEPENDENT ON THE MIGRATION TO REVERT TO BEFORE CALLING THIS METHOD! + * The revert step can either be a schema or a (partial) data revert. To + * check if revert() needs to be called again use the migration_state() method. + * + * @param string $migration String migration name to revert (including any that depend on this migration) + */ + public function revert($migration) + { + $this->container->get('dispatcher')->disable(); + $this->revert_do($migration); + $this->container->get('dispatcher')->enable(); + } + + /** + * Effectively runs a single revert step from the last migration installed + * + * @param string $migration String migration name to revert (including any that depend on this migration) + * @return null + */ + protected function revert_do($migration) + { + if (!isset($this->migration_state[$migration])) + { + // Not installed + return; + } + + foreach ($this->migration_state as $name => $state) + { + if (!empty($state['migration_depends_on']) && in_array($migration, $state['migration_depends_on'])) + { + $this->revert_do($name); + } + } + + $this->try_revert($migration); + } + + /** + * Attempts to revert a step of the given migration or one of its dependencies + * + * @param string $name The class name of the migration + * @return bool Whether any update step was successfully run + */ + protected function try_revert($name) + { + if (!class_exists($name)) + { + return false; + } + + $migration = $this->get_migration($name); + + $state = $this->migration_state[$name]; + + $this->last_run_migration = array( + 'name' => $name, + 'class' => $migration, + 'task' => '', + ); + + if ($state['migration_data_done']) + { + if ($state['migration_data_state'] !== 'revert_data') + { + $result = $this->process_data_step($migration->update_data(), $state['migration_data_state'], true); + + $state['migration_data_state'] = ($result === true) ? 'revert_data' : $result; + } + else + { + $result = $this->process_data_step($migration->revert_data(), '', false); + + $state['migration_data_state'] = ($result === true) ? '' : $result; + $state['migration_data_done'] = ($result === true) ? false : true; + } + + $this->set_migration_state($name, $state); + } + else if ($state['migration_schema_done']) + { + $steps = $this->helper->get_schema_steps($migration->revert_schema()); + $result = $this->process_data_step($steps, $state['migration_data_state']); + + $state['migration_data_state'] = ($result === true) ? '' : $result; + $state['migration_schema_done'] = ($result === true) ? false : true; + + if (!$state['migration_schema_done']) + { + $sql = 'DELETE FROM ' . $this->migrations_table . " + WHERE migration_name = '" . $this->db->sql_escape($name) . "'"; + $this->db->sql_query($sql); + + unset($this->migration_state[$name]); + } + } + + return true; + } + + /** + * Process the data step of the migration + * + * @param array $steps The steps to run + * @param bool|string $state Current state of the migration + * @param bool $revert true to revert a data step + * @return bool|string migration state. True if completed, serialized array if not finished + * @throws \phpbb\db\migration\exception + */ + protected function process_data_step($steps, $state, $revert = false) + { + $state = ($state) ? unserialize($state) : false; + + // reverse order of steps if reverting + if ($revert === true) + { + $steps = array_reverse($steps); + } + + foreach ($steps as $step_identifier => $step) + { + $last_result = 0; + if ($state) + { + // Continue until we reach the step that matches the last step called + if ($state['step'] != $step_identifier) + { + continue; + } + + // We send the result from last time to the callable function + $last_result = $state['result']; + + // Set state to false since we reached the point we were at + $state = false; + } + + try + { + // Result will be null or true if everything completed correctly + $result = $this->run_step($step, $last_result, $revert); + if ($result !== null && $result !== true) + { + return serialize(array( + 'result' => $result, + 'step' => $step_identifier, + )); + } + } + catch (\phpbb\db\migration\exception $e) + { + // We should try rolling back here + foreach ($steps as $reverse_step_identifier => $reverse_step) + { + // If we've reached the current step we can break because we reversed everything that was run + if ($reverse_step_identifier == $step_identifier) + { + break; + } + + // Reverse the step that was run + $result = $this->run_step($reverse_step, false, !$revert); + } + + // rethrow the exception + throw $e; + } + } + + return true; + } + + /** + * Run a single step + * + * An exception should be thrown if an error occurs + * + * @param mixed $step Data step from migration + * @param mixed $last_result Result to pass to the callable (only for 'custom' method) + * @param bool $reverse False to install, True to attempt uninstallation by reversing the call + * @return null + */ + protected function run_step($step, $last_result = 0, $reverse = false) + { + $callable_and_parameters = $this->get_callable_from_step($step, $last_result, $reverse); + + if ($callable_and_parameters === false) + { + return; + } + + $callable = $callable_and_parameters[0]; + $parameters = $callable_and_parameters[1]; + + return call_user_func_array($callable, $parameters); + } + + /** + * Get a callable statement from a data step + * + * @param array $step Data step from migration + * @param mixed $last_result Result to pass to the callable (only for 'custom' method) + * @param bool $reverse False to install, True to attempt uninstallation by reversing the call + * @return array Array with parameters for call_user_func_array(), 0 is the callable, 1 is parameters + * @throws \phpbb\db\migration\exception + */ + protected function get_callable_from_step(array $step, $last_result = 0, $reverse = false) + { + $type = $step[0]; + $parameters = $step[1]; + + $parts = explode('.', $type); + + $class = $parts[0]; + $method = false; + + if (isset($parts[1])) + { + $method = $parts[1]; + } + + switch ($class) + { + case 'if': + if (!isset($parameters[0])) + { + throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_MISSING_CONDITION', $step); + } + + if (!isset($parameters[1])) + { + throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_MISSING_STEP', $step); + } + + $condition = $parameters[0]; + + if (!$condition) + { + return false; + } + + $step = $parameters[1]; + + return $this->get_callable_from_step($step); + break; + + case 'custom': + if (!is_callable($parameters[0])) + { + throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_CUSTOM_NOT_CALLABLE', $step); + } + + if ($reverse) + { + return false; + } + else + { + return array( + $parameters[0], + array($last_result), + ); + } + break; + + default: + if (!$method) + { + throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_UNKNOWN_TYPE', $step); + } + + if (!isset($this->tools[$class])) + { + throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_UNDEFINED_TOOL', $step); + } + + if (!method_exists(get_class($this->tools[$class]), $method)) + { + throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_UNDEFINED_METHOD', $step); + } + + // Attempt to reverse operations + if ($reverse) + { + array_unshift($parameters, $method); + + return array( + array($this->tools[$class], 'reverse'), + $parameters, + ); + } + + return array( + array($this->tools[$class], $method), + $parameters, + ); + break; + } + } + + /** + * Insert/Update migration row into the database + * + * @param string $name Name of the migration + * @param array $state + * @return null + */ + protected function set_migration_state($name, $state) + { + $migration_row = $state; + $migration_row['migration_depends_on'] = serialize($state['migration_depends_on']); + + if (isset($this->migration_state[$name])) + { + $sql = 'UPDATE ' . $this->migrations_table . ' + SET ' . $this->db->sql_build_array('UPDATE', $migration_row) . " + WHERE migration_name = '" . $this->db->sql_escape($name) . "'"; + $this->db->sql_query($sql); + } + else + { + $migration_row['migration_name'] = $name; + $sql = 'INSERT INTO ' . $this->migrations_table . ' + ' . $this->db->sql_build_array('INSERT', $migration_row); + $this->db->sql_query($sql); + } + + $this->migration_state[$name] = $state; + + $this->last_run_migration['state'] = $state; + } + + /** + * Checks if a migration's dependencies can even theoretically be satisfied. + * + * @param string $name The class name of the migration + * @return bool|string False if fulfillable, string of missing migration name if unfulfillable + */ + public function unfulfillable($name) + { + if (isset($this->migration_state[$name]) || isset($this->fulfillable_migrations[$name])) + { + return false; + } + + if (!class_exists($name)) + { + return $name; + } + + $migration = $this->get_migration($name); + $depends = $migration->depends_on(); + + foreach ($depends as $depend) + { + $unfulfillable = $this->unfulfillable($depend); + if ($unfulfillable !== false) + { + return $unfulfillable; + } + } + $this->fulfillable_migrations[$name] = true; + + return false; + } + + /** + * Checks whether all available, fulfillable migrations have been applied. + * + * @return bool Whether the migrations have been applied + */ + public function finished() + { + foreach ($this->migrations as $name) + { + if (!isset($this->migration_state[$name])) + { + // skip unfulfillable migrations, but fulfillables mean we + // are not finished yet + if ($this->unfulfillable($name) !== false) + { + continue; + } + + return false; + } + + $migration = $this->migration_state[$name]; + + if (!$migration['migration_schema_done'] || !$migration['migration_data_done']) + { + return false; + } + } + + return true; + } + + /** + * Gets a migration state (whether it is installed and to what extent) + * + * @param string $migration String migration name to check if it is installed + * @return bool|array False if the migration has not at all been installed, array + */ + public function migration_state($migration) + { + if (!isset($this->migration_state[$migration])) + { + return false; + } + + return $this->migration_state[$migration]; + } + + /** + * Helper to get a migration + * + * @param string $name Name of the migration + * @return \phpbb\db\migration\migration + */ + protected function get_migration($name) + { + $migration = new $name($this->config, $this->db, $this->db_tools, $this->phpbb_root_path, $this->php_ext, $this->table_prefix); + + if ($migration instanceof ContainerAwareInterface) + { + $migration->setContainer($this->container); + } + + return $migration; + } + + /** + * This function adds all migrations sent to it to the migrations table + * + * THIS SHOULD NOT GENERALLY BE USED! THIS IS FOR THE PHPBB INSTALLER. + * THIS WILL THROW ERRORS IF MIGRATIONS ALREADY EXIST IN THE TABLE, DO NOT CALL MORE THAN ONCE! + * + * @param array $migrations Array of migrations (names) to add to the migrations table + * @return null + */ + public function populate_migrations($migrations) + { + foreach ($migrations as $name) + { + if ($this->migration_state($name) === false) + { + $state = array( + 'migration_depends_on' => $name::depends_on(), + 'migration_schema_done' => true, + 'migration_data_done' => true, + 'migration_data_state' => '', + 'migration_start_time' => time(), + 'migration_end_time' => time(), + ); + $this->set_migration_state($name, $state); + } + } + } + + /** + * Creates the migrations table if it does not exist. + * @return null + */ + public function create_migrations_table() + { + // Make sure migrations have been installed. + if (!$this->db_tools->sql_table_exists($this->table_prefix . 'migrations')) + { + $this->db_tools->sql_create_table($this->table_prefix . 'migrations', array( + 'COLUMNS' => array( + 'migration_name' => array('VCHAR', ''), + 'migration_depends_on' => array('TEXT', ''), + 'migration_schema_done' => array('BOOL', 0), + 'migration_data_done' => array('BOOL', 0), + 'migration_data_state' => array('TEXT', ''), + 'migration_start_time' => array('TIMESTAMP', 0), + 'migration_end_time' => array('TIMESTAMP', 0), + ), + 'PRIMARY_KEY' => 'migration_name', + )); + } + } +} diff --git a/sources/phpBB/phpbb/db/migrator_output_handler_interface.php b/sources/phpBB/phpbb/db/migrator_output_handler_interface.php new file mode 100644 index 0000000..a923af9 --- /dev/null +++ b/sources/phpBB/phpbb/db/migrator_output_handler_interface.php @@ -0,0 +1,31 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db; + +interface migrator_output_handler_interface +{ + const VERBOSITY_QUIET = 0; + const VERBOSITY_NORMAL = 1; + const VERBOSITY_VERBOSE = 2; + const VERBOSITY_VERY_VERBOSE = 3; + const VERBOSITY_DEBUG = 4; + + /** + * Write output using the configured closure. + * + * @param string|array $message The message to write or an array containing the language key and all of its parameters. + * @param int $verbosity The verbosity of the message. + */ + public function write($message, $verbosity); +} diff --git a/sources/phpBB/phpbb/db/null_migrator_output_handler.php b/sources/phpBB/phpbb/db/null_migrator_output_handler.php new file mode 100644 index 0000000..0e8cfbb --- /dev/null +++ b/sources/phpBB/phpbb/db/null_migrator_output_handler.php @@ -0,0 +1,24 @@ + +* @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; + +class null_migrator_output_handler implements migrator_output_handler_interface +{ + /** + * {@inheritdoc} + */ + public function write($message, $verbosity) + { + } +} diff --git a/sources/phpBB/phpbb/db/sql_insert_buffer.php b/sources/phpBB/phpbb/db/sql_insert_buffer.php new file mode 100644 index 0000000..14e3c54 --- /dev/null +++ b/sources/phpBB/phpbb/db/sql_insert_buffer.php @@ -0,0 +1,146 @@ + +* @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; + +/** +* Collects rows for insert into a database until the buffer size is reached. +* Then flushes the buffer to the database and starts over again. +* +* Benefits over collecting a (possibly huge) insert array and then using +* $db->sql_multi_insert() include: +* +* - Going over max packet size of the database connection is usually prevented +* because the data is submitted in batches. +* +* - Reaching database connection timeout is usually prevented because +* submission of batches talks to the database every now and then. +* +* - Usage of less PHP memory because data no longer needed is discarded on +* buffer flush. +* +* Attention: +* Please note that users of this class have to call flush() to flush the +* remaining rows to the database after their batch insert operation is +* finished. +* +* Usage: +* +* $buffer = new \phpbb\db\sql_insert_buffer($db, 'test_table', 1234); +* +* while (do_stuff()) +* { +* $buffer->insert(array( +* 'column1' => 'value1', +* 'column2' => 'value2', +* )); +* } +* +* $buffer->flush(); +* +*/ +class sql_insert_buffer +{ + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + /** @var string */ + protected $table_name; + + /** @var int */ + protected $max_buffered_rows; + + /** @var array */ + protected $buffer = array(); + + /** + * @param \phpbb\db\driver\driver_interface $db + * @param string $table_name + * @param int $max_buffered_rows + */ + public function __construct(\phpbb\db\driver\driver_interface $db, $table_name, $max_buffered_rows = 500) + { + $this->db = $db; + $this->table_name = $table_name; + $this->max_buffered_rows = $max_buffered_rows; + } + + /** + * Inserts a single row into the buffer if multi insert is supported by the + * database (otherwise an insert query is sent immediately). Then flushes + * the buffer if the number of rows in the buffer is now greater than or + * equal to $max_buffered_rows. + * + * @param array $row + * + * @return bool True when some data was flushed to the database. + * False otherwise. + */ + public function insert(array $row) + { + $this->buffer[] = $row; + + // Flush buffer if it is full or when DB does not support multi inserts. + // In the later case, the buffer will always only contain one row. + if (!$this->db->get_multi_insert() || sizeof($this->buffer) >= $this->max_buffered_rows) + { + return $this->flush(); + } + + return false; + } + + /** + * Inserts a row set, i.e. an array of rows, by calling insert(). + * + * Please note that it is in most cases better to use insert() instead of + * first building a huge rowset. Or at least sizeof($rows) should be kept + * small. + * + * @param array $rows + * + * @return bool True when some data was flushed to the database. + * False otherwise. + */ + public function insert_all(array $rows) + { + // Using bitwise |= because PHP does not have logical ||= + $result = 0; + + foreach ($rows as $row) + { + $result |= (int) $this->insert($row); + } + + return (bool) $result; + } + + /** + * Flushes the buffer content to the DB and clears the buffer. + * + * @return bool True when some data was flushed to the database. + * False otherwise. + */ + public function flush() + { + if (!empty($this->buffer)) + { + $this->db->sql_multi_insert($this->table_name, $this->buffer); + $this->buffer = array(); + + return true; + } + + return false; + } +} diff --git a/sources/phpBB/phpbb/db/tools.php b/sources/phpBB/phpbb/db/tools.php new file mode 100644 index 0000000..775decc --- /dev/null +++ b/sources/phpBB/phpbb/db/tools.php @@ -0,0 +1,2835 @@ + +* @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; + +/** +* Database Tools for handling cross-db actions such as altering columns, etc. +* Currently not supported is returning SQL for creating tables. +*/ +class tools +{ + /** + * Current sql layer + */ + var $sql_layer = ''; + + /** + * @var object DB object + */ + var $db = null; + + /** + * The Column types for every database we support + * @var array + */ + 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() + { + return array( + 'mysql_41' => array( + 'INT:' => 'int(%d)', + 'BINT' => 'bigint(20)', + 'UINT' => 'mediumint(8) UNSIGNED', + 'UINT:' => 'int(%d) UNSIGNED', + 'TINT:' => 'tinyint(%d)', + 'USINT' => 'smallint(4) UNSIGNED', + 'BOOL' => 'tinyint(1) UNSIGNED', + 'VCHAR' => 'varchar(255)', + 'VCHAR:' => 'varchar(%d)', + 'CHAR:' => 'char(%d)', + 'XSTEXT' => 'text', + 'XSTEXT_UNI'=> 'varchar(100)', + 'STEXT' => 'text', + 'STEXT_UNI' => 'varchar(255)', + 'TEXT' => 'text', + 'TEXT_UNI' => 'text', + 'MTEXT' => 'mediumtext', + 'MTEXT_UNI' => 'mediumtext', + 'TIMESTAMP' => 'int(11) 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(255)', + 'VARBINARY' => 'varbinary(255)', + ), + + 'mysql_40' => array( + 'INT:' => 'int(%d)', + 'BINT' => 'bigint(20)', + 'UINT' => 'mediumint(8) UNSIGNED', + 'UINT:' => 'int(%d) UNSIGNED', + 'TINT:' => 'tinyint(%d)', + 'USINT' => 'smallint(4) UNSIGNED', + 'BOOL' => 'tinyint(1) UNSIGNED', + 'VCHAR' => 'varbinary(255)', + 'VCHAR:' => 'varbinary(%d)', + 'CHAR:' => 'binary(%d)', + 'XSTEXT' => 'blob', + 'XSTEXT_UNI'=> 'blob', + 'STEXT' => 'blob', + 'STEXT_UNI' => 'blob', + 'TEXT' => 'blob', + 'TEXT_UNI' => 'blob', + 'MTEXT' => 'mediumblob', + 'MTEXT_UNI' => 'mediumblob', + 'TIMESTAMP' => 'int(11) UNSIGNED', + 'DECIMAL' => 'decimal(5,2)', + 'DECIMAL:' => 'decimal(%d,2)', + 'PDECIMAL' => 'decimal(6,3)', + 'PDECIMAL:' => 'decimal(%d,3)', + 'VCHAR_UNI' => 'blob', + 'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')), + 'VCHAR_CI' => 'blob', + '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)', + 'UINT' => 'number(8)', + 'UINT:' => 'number(%d)', + 'TINT:' => 'number(%d)', + 'USINT' => 'number(4)', + 'BOOL' => 'number(1)', + 'VCHAR' => 'varchar2(255)', + 'VCHAR:' => 'varchar2(%d)', + 'CHAR:' => 'char(%d)', + 'XSTEXT' => 'varchar2(1000)', + 'STEXT' => 'varchar2(3000)', + 'TEXT' => 'clob', + 'MTEXT' => 'clob', + 'XSTEXT_UNI'=> 'varchar2(300)', + 'STEXT_UNI' => 'varchar2(765)', + 'TEXT_UNI' => 'clob', + 'MTEXT_UNI' => 'clob', + 'TIMESTAMP' => 'number(11)', + 'DECIMAL' => 'number(5, 2)', + 'DECIMAL:' => 'number(%d, 2)', + 'PDECIMAL' => 'number(6, 3)', + 'PDECIMAL:' => 'number(%d, 3)', + 'VCHAR_UNI' => 'varchar2(765)', + 'VCHAR_UNI:'=> array('varchar2(%d)', 'limit' => array('mult', 3, 765, 'clob')), + 'VCHAR_CI' => 'varchar2(255)', + 'VARBINARY' => 'raw(255)', + ), + + 'sqlite' => array( + 'INT:' => 'int(%d)', + 'BINT' => 'bigint(20)', + 'UINT' => 'INTEGER UNSIGNED', //'mediumint(8) UNSIGNED', + 'UINT:' => 'INTEGER UNSIGNED', // 'int(%d) UNSIGNED', + 'TINT:' => 'tinyint(%d)', + 'USINT' => 'INTEGER UNSIGNED', //'mediumint(4) UNSIGNED', + 'BOOL' => 'INTEGER UNSIGNED', //'tinyint(1) UNSIGNED', + 'VCHAR' => 'varchar(255)', + 'VCHAR:' => 'varchar(%d)', + 'CHAR:' => 'char(%d)', + 'XSTEXT' => 'text(65535)', + 'STEXT' => 'text(65535)', + 'TEXT' => 'text(65535)', + 'MTEXT' => 'mediumtext(16777215)', + 'XSTEXT_UNI'=> 'text(65535)', + 'STEXT_UNI' => 'text(65535)', + 'TEXT_UNI' => 'text(65535)', + 'MTEXT_UNI' => 'mediumtext(16777215)', + 'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) 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(255)', + 'VARBINARY' => 'blob', + ), + + 'sqlite3' => array( + 'INT:' => 'INT(%d)', + 'BINT' => 'BIGINT(20)', + 'UINT' => 'INTEGER UNSIGNED', + 'UINT:' => 'INTEGER UNSIGNED', + 'TINT:' => 'TINYINT(%d)', + 'USINT' => 'INTEGER UNSIGNED', + 'BOOL' => 'INTEGER UNSIGNED', + 'VCHAR' => 'VARCHAR(255)', + 'VCHAR:' => 'VARCHAR(%d)', + 'CHAR:' => 'CHAR(%d)', + 'XSTEXT' => 'TEXT(65535)', + 'STEXT' => 'TEXT(65535)', + 'TEXT' => 'TEXT(65535)', + 'MTEXT' => 'MEDIUMTEXT(16777215)', + 'XSTEXT_UNI'=> 'TEXT(65535)', + 'STEXT_UNI' => 'TEXT(65535)', + 'TEXT_UNI' => 'TEXT(65535)', + 'MTEXT_UNI' => 'MEDIUMTEXT(16777215)', + 'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) 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(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', + ), + ); + } + + /** + * A list of types being unsigned for better reference in some db's + * @var array + */ + 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. + */ + var $return_statements = false; + + /** + * 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) + { + $this->db = $db; + $this->return_statements = $return_statements; + + $this->dbms_type_map = self::get_dbms_type_map(); + + // Determine mapping database type + switch ($this->db->get_sql_layer()) + { + case 'mysql': + $this->sql_layer = 'mysql_40'; + break; + + case 'mysql4': + if (version_compare($this->db->sql_server_info(true), '4.1.3', '>=')) + { + $this->sql_layer = 'mysql_41'; + } + else + { + $this->sql_layer = 'mysql_40'; + } + break; + + case 'mysqli': + $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; + } + } + + /** + * Setter for {@link $return_statements return_statements}. + * + * @param bool $return_statements True if SQL should not be executed but returned as strings + * @return null + */ + public function set_return_statements($return_statements) + { + $this->return_statements = $return_statements; + } + + /** + * Gets a list of tables in the database. + * + * @return array Array of table names (all lower case) + */ + function sql_list_tables() + { + switch ($this->db->get_sql_layer()) + { + case 'mysql': + case 'mysql4': + case 'mysqli': + $sql = 'SHOW TABLES'; + break; + + case 'sqlite': + $sql = 'SELECT name + FROM sqlite_master + WHERE type = "table"'; + break; + + case 'sqlite3': + $sql = 'SELECT name + FROM sqlite_master + WHERE type = "table" + 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'; + break; + } + + $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; + } + + /** + * Check if table exists + * + * + * @param string $table_name The table name to check for + * @return bool true if table exists, else false + */ + function sql_table_exists($table_name) + { + $this->db->sql_return_on_error(true); + $result = $this->db->sql_query_limit('SELECT * FROM ' . $table_name, 1); + $this->db->sql_return_on_error(false); + + if ($result) + { + $this->db->sql_freeresult($result); + return true; + } + + return false; + } + + /** + * 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. + */ + 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 + 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'; + } + } + + // 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 + 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; + } + + // 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 + 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) + { + // 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']); + } + + switch ($this->sql_layer) + { + 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; + } + } + } + + // close the table + switch ($this->sql_layer) + { + case 'mysql_41': + // make sure the table is in UTF-8 mode + $table_sql .= "\n) CHARACTER SET `utf8` COLLATE `utf8_bin`;"; + $statements[] = $table_sql; + break; + + case 'mysql_40': + case 'sqlite': + case 'sqlite3': + $table_sql .= "\n);"; + $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; + + // do we need to add a sequence and a tigger for auto incrementing columns? + if ($create_sequence) + { + // create the actual sequence + $statements[] = "CREATE SEQUENCE {$table_name}_seq"; + + // the trigger is the mechanism by which we increment the counter + $trigger = "CREATE OR REPLACE TRIGGER t_{$table_name}\n"; + $trigger .= "BEFORE INSERT ON {$table_name}\n"; + $trigger .= "FOR EACH ROW WHEN (\n"; + $trigger .= "\tnew.{$create_sequence} IS NULL OR new.{$create_sequence} = 0\n"; + $trigger .= ")\n"; + $trigger .= "BEGIN\n"; + $trigger .= "\tSELECT {$table_name}_seq.nextval\n"; + $trigger .= "\tINTO :new.{$create_sequence}\n"; + $trigger .= "\tFROM dual;\n"; + $trigger .= "END;"; + + $statements[] = $trigger; + } + break; + } + + // 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); + } + + /** + * 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) + */ + function perform_schema_changes($schema_changes) + { + if (empty($schema_changes)) + { + return; + } + + $statements = array(); + $sqlite = false; + + // For SQLite we need to perform the schema changes in a much more different way + if (($this->db->get_sql_layer() == 'sqlite' || $this->db->get_sql_layer() == 'sqlite3') && $this->return_statements) + { + $sqlite_data = array(); + $sqlite = true; + } + + // Drop tables? + if (!empty($schema_changes['drop_tables'])) + { + foreach ($schema_changes['drop_tables'] as $table) + { + // only drop table if it exists + if ($this->sql_table_exists($table)) + { + $result = $this->sql_table_drop($table); + if ($this->return_statements) + { + $statements = array_merge($statements, $result); + } + } + } + } + + // Add tables? + if (!empty($schema_changes['add_tables'])) + { + foreach ($schema_changes['add_tables'] as $table => $table_data) + { + $result = $this->sql_create_table($table, $table_data); + if ($this->return_statements) + { + $statements = array_merge($statements, $result); + } + } + } + + // Change columns? + if (!empty($schema_changes['change_columns'])) + { + foreach ($schema_changes['change_columns'] as $table => $columns) + { + foreach ($columns as $column_name => $column_data) + { + // If the column exists we change it, else we add it ;) + if ($column_exists = $this->sql_column_exists($table, $column_name)) + { + $result = $this->sql_column_change($table, $column_name, $column_data, true); + } + else + { + $result = $this->sql_column_add($table, $column_name, $column_data, true); + } + + if ($sqlite) + { + if ($column_exists) + { + $sqlite_data[$table]['change_columns'][] = $result; + } + else + { + $sqlite_data[$table]['add_columns'][] = $result; + } + } + else if ($this->return_statements) + { + $statements = array_merge($statements, $result); + } + } + } + } + + // Add columns? + if (!empty($schema_changes['add_columns'])) + { + foreach ($schema_changes['add_columns'] as $table => $columns) + { + foreach ($columns as $column_name => $column_data) + { + // Only add the column if it does not exist yet + if ($column_exists = $this->sql_column_exists($table, $column_name)) + { + continue; + // This is commented out here because it can take tremendous time on updates +// $result = $this->sql_column_change($table, $column_name, $column_data, true); + } + else + { + $result = $this->sql_column_add($table, $column_name, $column_data, true); + } + + if ($sqlite) + { + if ($column_exists) + { + continue; +// $sqlite_data[$table]['change_columns'][] = $result; + } + else + { + $sqlite_data[$table]['add_columns'][] = $result; + } + } + else if ($this->return_statements) + { + $statements = array_merge($statements, $result); + } + } + } + } + + // Remove keys? + if (!empty($schema_changes['drop_keys'])) + { + foreach ($schema_changes['drop_keys'] as $table => $indexes) + { + foreach ($indexes as $index_name) + { + if (!$this->sql_index_exists($table, $index_name)) + { + continue; + } + + $result = $this->sql_index_drop($table, $index_name); + + if ($this->return_statements) + { + $statements = array_merge($statements, $result); + } + } + } + } + + // Drop columns? + if (!empty($schema_changes['drop_columns'])) + { + foreach ($schema_changes['drop_columns'] as $table => $columns) + { + foreach ($columns as $column) + { + // Only remove the column if it exists... + if ($this->sql_column_exists($table, $column)) + { + $result = $this->sql_column_remove($table, $column, true); + + if ($sqlite) + { + $sqlite_data[$table]['drop_columns'][] = $result; + } + else if ($this->return_statements) + { + $statements = array_merge($statements, $result); + } + } + } + } + } + + // Add primary keys? + if (!empty($schema_changes['add_primary_keys'])) + { + foreach ($schema_changes['add_primary_keys'] as $table => $columns) + { + $result = $this->sql_create_primary_key($table, $columns, true); + + if ($sqlite) + { + $sqlite_data[$table]['primary_key'] = $result; + } + else if ($this->return_statements) + { + $statements = array_merge($statements, $result); + } + } + } + + // Add unique indexes? + if (!empty($schema_changes['add_unique_index'])) + { + foreach ($schema_changes['add_unique_index'] as $table => $index_array) + { + foreach ($index_array as $index_name => $column) + { + if ($this->sql_unique_index_exists($table, $index_name)) + { + continue; + } + + $result = $this->sql_create_unique_index($table, $index_name, $column); + + if ($this->return_statements) + { + $statements = array_merge($statements, $result); + } + } + } + } + + // Add indexes? + if (!empty($schema_changes['add_index'])) + { + foreach ($schema_changes['add_index'] as $table => $index_array) + { + foreach ($index_array as $index_name => $column) + { + if ($this->sql_index_exists($table, $index_name)) + { + continue; + } + + $result = $this->sql_create_index($table, $index_name, $column); + + if ($this->return_statements) + { + $statements = array_merge($statements, $result); + } + } + } + } + + if ($sqlite) + { + foreach ($sqlite_data as $table_name => $sql_schema_changes) + { + // Create temporary table with original data + $statements[] = 'begin'; + + $sql = "SELECT sql + FROM sqlite_master + WHERE type = 'table' + AND name = '{$table_name}' + ORDER BY type DESC, name;"; + $result = $this->db->sql_query($sql); + + if (!$result) + { + continue; + } + + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + // Create a backup table and populate it, destroy the existing one + $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql']); + $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name; + $statements[] = 'DROP TABLE ' . $table_name; + + // Get the columns... + preg_match('#\((.*)\)#s', $row['sql'], $matches); + + $plain_table_cols = trim($matches[1]); + $new_table_cols = preg_split('/,(?![\s\w]+\))/m', $plain_table_cols); + $column_list = array(); + + foreach ($new_table_cols as $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if ($entities[0] == 'PRIMARY') + { + continue; + } + $column_list[] = $entities[0]; + } + + // note down the primary key notation because sqlite only supports adding it to the end for the new table + $primary_key = false; + $_new_cols = array(); + + foreach ($new_table_cols as $key => $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if ($entities[0] == 'PRIMARY') + { + $primary_key = $declaration; + continue; + } + $_new_cols[] = $declaration; + } + + $new_table_cols = $_new_cols; + + // First of all... change columns + if (!empty($sql_schema_changes['change_columns'])) + { + foreach ($sql_schema_changes['change_columns'] as $column_sql) + { + foreach ($new_table_cols as $key => $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if (strpos($column_sql, $entities[0] . ' ') === 0) + { + $new_table_cols[$key] = $column_sql; + } + } + } + } + + if (!empty($sql_schema_changes['add_columns'])) + { + foreach ($sql_schema_changes['add_columns'] as $column_sql) + { + $new_table_cols[] = $column_sql; + } + } + + // Now drop them... + if (!empty($sql_schema_changes['drop_columns'])) + { + foreach ($sql_schema_changes['drop_columns'] as $column_name) + { + // Remove from column list... + $new_column_list = array(); + foreach ($column_list as $key => $value) + { + if ($value === $column_name) + { + continue; + } + + $new_column_list[] = $value; + } + + $column_list = $new_column_list; + + // Remove from table... + $_new_cols = array(); + foreach ($new_table_cols as $key => $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if (strpos($column_name . ' ', $entities[0] . ' ') === 0) + { + continue; + } + $_new_cols[] = $declaration; + } + $new_table_cols = $_new_cols; + } + } + + // Primary key... + if (!empty($sql_schema_changes['primary_key'])) + { + $new_table_cols[] = 'PRIMARY KEY (' . implode(', ', $sql_schema_changes['primary_key']) . ')'; + } + // Add a new one or the old primary key + else if ($primary_key !== false) + { + $new_table_cols[] = $primary_key; + } + + $columns = implode(',', $column_list); + + // create a new table and fill it up. destroy the temp one + $statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $new_table_cols) . ');'; + $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; + $statements[] = 'DROP TABLE ' . $table_name . '_temp'; + + $statements[] = 'commit'; + } + } + + if ($this->return_statements) + { + return $statements; + } + } + + /** + * 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) + { + $columns = array(); + + switch ($this->sql_layer) + { + 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}'"; + break; + + case 'oracle': + $sql = "SELECT column_name + FROM user_tab_columns + WHERE LOWER(table_name) = '" . strtolower($table) . "'"; + break; + + case 'sqlite': + case 'sqlite3': + $sql = "SELECT sql + FROM sqlite_master + WHERE type = 'table' + AND name = '{$table}'"; + + $result = $this->db->sql_query($sql); + + if (!$result) + { + return false; + } + + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + preg_match('#\((.*)\)#s', $row['sql'], $matches); + + $cols = trim($matches[1]); + $col_array = preg_split('/,(?![\s\w]+\))/m', $cols); + + foreach ($col_array as $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if ($entities[0] == 'PRIMARY') + { + continue; + } + + $column = strtolower($entities[0]); + $columns[$column] = $column; + } + + return $columns; + break; + } + + $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; + } + + /** + * 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) + { + $columns = $this->sql_list_columns($table); + + 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 + */ + 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 + FROM ' . $table_name; + $col = 'Key_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'; + break; + + case 'sqlite': + case 'sqlite3': + $sql = "PRAGMA index_list('" . $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; + } + + // These DBMS prefix index name with the table name + switch ($this->sql_layer) + { + case 'oracle': + case 'postgres': + case 'sqlite': + case 'sqlite3': + $row[$col] = substr($row[$col], strlen($table_name) + 1); + break; + } + + if (strtolower($row[$col]) == strtolower($index_name)) + { + $this->db->sql_freeresult($result); + return true; + } + } + $this->db->sql_freeresult($result); + + return false; + } + + /** + * 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 + */ + 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 + FROM ' . $table_name; + $col = 'Key_name'; + break; + + case 'oracle': + $sql = "SELECT index_name, table_owner + FROM user_indexes + WHERE table_name = '" . strtoupper($table_name) . "' + AND generated = 'N' + AND uniqueness = 'UNIQUE'"; + $col = 'index_name'; + break; + + case 'sqlite': + case 'sqlite3': + $sql = "PRAGMA index_list('" . $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'] || $row[$col] == 'PRIMARY')) + { + continue; + } + + if (($this->sql_layer == 'sqlite' || $this->sql_layer == 'sqlite3') && !$row['unique']) + { + continue; + } + + if ($this->sql_layer == 'postgres' && $row['indisunique'] != 't') + { + continue; + } + + // These DBMS prefix index name with the table name + switch ($this->sql_layer) + { + case 'oracle': + // Two cases here... prefixed with U_[table_owner] and not prefixed with table_name + if (strpos($row[$col], 'U_') === 0) + { + $row[$col] = substr($row[$col], strlen('U_' . $row['table_owner']) + 1); + } + else if (strpos($row[$col], strtoupper($table_name)) === 0) + { + $row[$col] = substr($row[$col], strlen($table_name) + 1); + } + break; + + case 'postgres': + case 'sqlite': + case 'sqlite3': + $row[$col] = substr($row[$col], strlen($table_name) + 1); + break; + } + + if (strtolower($row[$col]) == strtolower($index_name)) + { + $this->db->sql_freeresult($result); + return true; + } + } + $this->db->sql_freeresult($result); + + return false; + } + + /** + * Private method for performing sql statements (either execute them or return them) + * @access private + */ + function _sql_run_sql($statements) + { + if ($this->return_statements) + { + return $statements; + } + + // We could add error handling here... + foreach ($statements as $sql) + { + if ($sql === 'begin') + { + $this->db->sql_transaction('begin'); + } + else if ($sql === 'commit') + { + $this->db->sql_transaction('commit'); + } + else + { + $this->db->sql_query($sql); + } + } + + return true; + } + + /** + * 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 = ''; + + $return_array = array(); + + 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} "; + + // For hexadecimal values do not use single quotes + if (!is_null($column_data[1]) && substr($column_type, -4) !== 'text' && substr($column_type, -4) !== 'blob') + { + $sql .= (strpos($column_data[1], '0x') === 0) ? "DEFAULT {$column_data[1]} " : "DEFAULT '{$column_data[1]}' "; + } + + if (!is_null($column_data[1]) || (isset($column_data[2]) && $column_data[2] == 'auto_increment')) + { + $sql .= 'NOT NULL'; + } + else + { + $sql .= 'NULL'; + } + + if (isset($column_data[2])) + { + if ($column_data[2] == 'auto_increment') + { + $sql .= ' auto_increment'; + } + else if ($this->sql_layer === 'mysql_41' && $column_data[2] == 'true_sort') + { + $sql .= ' COLLATE utf8_unicode_ci'; + } + } + + break; + + case 'oracle': + $sql .= " {$column_type} "; + $sql .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}' " : ''; + + // In Oracle empty strings ('') are treated as NULL. + // Therefore in oracle we allow NULL's for all DEFAULT '' entries + // Oracle does not like setting NOT NULL on a column that is already NOT NULL (this happens only on number fields) + if (!preg_match('/number/i', $column_type)) + { + $sql .= ($column_data[1] === '' || $column_data[1] === null) ? '' : 'NOT NULL'; + } + + $return_array['auto_increment'] = false; + if (isset($column_data[2]) && $column_data[2] == 'auto_increment') + { + $return_array['auto_increment'] = true; + } + + 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; + if (isset($column_data[2]) && $column_data[2] == 'auto_increment') + { + $sql .= ' INTEGER PRIMARY KEY'; + $return_array['primary_key_set'] = true; + + if ($this->sql_layer === 'sqlite3') + { + $sql .= ' AUTOINCREMENT'; + } + } + else + { + $sql .= ' ' . $column_type; + } + + if (!is_null($column_data[1])) + { + $sql .= ' NOT NULL '; + $sql .= "DEFAULT '{$column_data[1]}'"; + } + + break; + } + + $return_array['column_type_sql'] = $sql; + + return $return_array; + } + + /** + * Get the column's database type from the type map + * + * @param string $column_map_type + * @return array column type for this database + * and map type without length + */ + function get_column_type($column_map_type) + { + if (strpos($column_map_type, ':') !== false) + { + list($orig_column_type, $column_length) = explode(':', $column_map_type); + if (!is_array($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'])) + { + $column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'], $column_length); + } + else + { + if (isset($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule'])) + { + switch ($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule'][0]) + { + case 'div': + $column_length /= $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule'][1]; + $column_length = ceil($column_length); + $column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'][0], $column_length); + break; + } + } + + if (isset($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'])) + { + switch ($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][0]) + { + case 'mult': + $column_length *= $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][1]; + if ($column_length > $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][2]) + { + $column_type = $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][3]; + } + else + { + $column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'][0], $column_length); + } + break; + } + } + } + $orig_column_type .= ':'; + } + else + { + $orig_column_type = $column_map_type; + $column_type = $this->dbms_type_map[$this->sql_layer][$column_map_type]; + } + + return array($column_type, $orig_column_type); + } + + /** + * Add new column + */ + 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(); + + 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'] : ''; + $statements[] = 'ALTER TABLE `' . $table_name . '` ADD COLUMN `' . $column_name . '` ' . $column_data['column_type_sql'] . $after; + break; + + case 'oracle': + // Does not support AFTER, only through temporary table + $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) + { + return $column_name . ' ' . $column_data['column_type_sql']; + } + + $recreate_queries = $this->sqlite_get_recreate_table_queries($table_name); + if (empty($recreate_queries)) + { + break; + } + + $statements[] = 'begin'; + + $sql_create_table = array_shift($recreate_queries); + + // Create a backup table and populate it, destroy the existing one + $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $sql_create_table); + $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name; + $statements[] = 'DROP TABLE ' . $table_name; + + preg_match('#\((.*)\)#s', $sql_create_table, $matches); + + $new_table_cols = trim($matches[1]); + $old_table_cols = preg_split('/,(?![\s\w]+\))/m', $new_table_cols); + $column_list = array(); + + foreach ($old_table_cols as $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if ($entities[0] == 'PRIMARY') + { + continue; + } + $column_list[] = $entities[0]; + } + + $columns = implode(',', $column_list); + + $new_table_cols = $column_name . ' ' . $column_data['column_type_sql'] . ',' . $new_table_cols; + + // create a new table and fill it up. destroy the temp one + $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');'; + $statements = array_merge($statements, $recreate_queries); + + $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; + $statements[] = 'DROP TABLE ' . $table_name . '_temp'; + + $statements[] = 'commit'; + break; + + case 'sqlite3': + if ($inline && $this->return_statements) + { + return $column_name . ' ' . $column_data['column_type_sql']; + } + + $statements[] = 'ALTER TABLE ' . $table_name . ' ADD ' . $column_name . ' ' . $column_data['column_type_sql']; + break; + } + + return $this->_sql_run_sql($statements); + } + + /** + * Drop column + */ + 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 . '`'; + break; + + case 'oracle': + $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': + + if ($inline && $this->return_statements) + { + return $column_name; + } + + $recreate_queries = $this->sqlite_get_recreate_table_queries($table_name, $column_name); + if (empty($recreate_queries)) + { + break; + } + + $statements[] = 'begin'; + + $sql_create_table = array_shift($recreate_queries); + + // Create a backup table and populate it, destroy the existing one + $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $sql_create_table); + $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name; + $statements[] = 'DROP TABLE ' . $table_name; + + preg_match('#\((.*)\)#s', $sql_create_table, $matches); + + $new_table_cols = trim($matches[1]); + $old_table_cols = preg_split('/,(?![\s\w]+\))/m', $new_table_cols); + $column_list = array(); + + foreach ($old_table_cols as $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if ($entities[0] == 'PRIMARY' || $entities[0] === $column_name) + { + continue; + } + $column_list[] = $entities[0]; + } + + $columns = implode(',', $column_list); + + $new_table_cols = trim(preg_replace('/' . $column_name . '\b[^,]+(?:,|$)/m', '', $new_table_cols)); + if (substr($new_table_cols, -1) === ',') + { + // Remove the comma from the last entry again + $new_table_cols = substr($new_table_cols, 0, -1); + } + + // create a new table and fill it up. destroy the temp one + $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');'; + $statements = array_merge($statements, $recreate_queries); + + $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; + $statements[] = 'DROP TABLE ' . $table_name . '_temp'; + + $statements[] = 'commit'; + break; + } + + return $this->_sql_run_sql($statements); + } + + /** + * Drop Index + */ + 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; + break; + } + + return $this->_sql_run_sql($statements); + } + + /** + * Drop Table + */ + 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; + + switch ($this->sql_layer) + { + case 'oracle': + $sql = 'SELECT A.REFERENCED_NAME + FROM USER_DEPENDENCIES A, USER_TRIGGERS B + WHERE A.REFERENCED_TYPE = \'SEQUENCE\' + AND A.NAME = B.TRIGGER_NAME + AND B.TABLE_NAME = \'' . strtoupper($table_name) . "'"; + $result = $this->db->sql_query($sql); + + // any sequences ref'd to this table's triggers? + while ($row = $this->db->sql_fetchrow($result)) + { + $statements[] = "DROP SEQUENCE {$row['referenced_name']}"; + } + $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 + */ + 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; + + case 'sqlite': + case 'sqlite3': + + if ($inline && $this->return_statements) + { + return $column; + } + + $recreate_queries = $this->sqlite_get_recreate_table_queries($table_name); + if (empty($recreate_queries)) + { + break; + } + + $statements[] = 'begin'; + + $sql_create_table = array_shift($recreate_queries); + + // Create a backup table and populate it, destroy the existing one + $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $sql_create_table); + $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name; + $statements[] = 'DROP TABLE ' . $table_name; + + preg_match('#\((.*)\)#s', $sql_create_table, $matches); + + $new_table_cols = trim($matches[1]); + $old_table_cols = preg_split('/,(?![\s\w]+\))/m', $new_table_cols); + $column_list = array(); + + foreach ($old_table_cols as $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if ($entities[0] == 'PRIMARY') + { + continue; + } + $column_list[] = $entities[0]; + } + + $columns = implode(',', $column_list); + + // create a new table and fill it up. destroy the temp one + $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ', PRIMARY KEY (' . implode(', ', $column) . '));'; + $statements = array_merge($statements, $recreate_queries); + + $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; + $statements[] = 'DROP TABLE ' . $table_name . '_temp'; + + $statements[] = 'commit'; + break; + } + + return $this->_sql_run_sql($statements); + } + + /** + * Add unique index + */ + 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); + } + + switch ($this->sql_layer) + { + case 'postgres': + case 'oracle': + case 'sqlite': + case 'sqlite3': + $statements[] = 'CREATE UNIQUE INDEX ' . $table_name . '_' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')'; + break; + + case 'mysql_40': + 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 + */ + 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); + } + + // remove index length unless MySQL4 + if ('mysql_40' != $this->sql_layer) + { + $column = preg_replace('#:.*$#', '', $column); + } + + switch ($this->sql_layer) + { + case 'postgres': + case 'oracle': + case 'sqlite': + case 'sqlite3': + $statements[] = 'CREATE INDEX ' . $table_name . '_' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')'; + break; + + case 'mysql_40': + // add index size to definition as required by MySQL4 + foreach ($column as $i => $col) + { + if (false !== strpos($col, ':')) + { + list($col, $index_size) = explode(':', $col); + $column[$i] = "$col($index_size)"; + } + } + // no break + 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 + */ + 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) + { + 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 + FROM ' . $table_name; + $col = 'Key_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'; + 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; + } + + switch ($this->sql_layer) + { + case 'oracle': + case 'postgres': + case 'sqlite': + case 'sqlite3': + $row[$col] = substr($row[$col], strlen($table_name) + 1); + break; + } + + $index_array[] = $row[$col]; + } + $this->db->sql_freeresult($result); + } + + return array_map('strtolower', $index_array); + } + + /** + * Removes table_name from the index_name if it is at the beginning + * + * @param $table_name + * @param $index_name + * @return string + */ + protected function strip_table_name_from_index_name($table_name, $index_name) + { + return (strpos(strtoupper($index_name), strtoupper($table_name)) === 0) ? substr($index_name, strlen($table_name) + 1) : $index_name; + } + + /** + * Change column type (not name!) + */ + function sql_column_change($table_name, $column_name, $column_data, $inline = false) + { + $original_column_data = $column_data; + $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data); + $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); + $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']; + break; + + case 'oracle': + // We need the data here + $old_return_statements = $this->return_statements; + $this->return_statements = true; + + // Get list of existing indexes + $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, $this->strip_table_name_from_index_name($table_name, $index_name)); + $statements = array_merge($statements, $result); + } + } + + $temp_column_name = 'temp_' . substr(md5($column_name), 0, 25); + // Add a temporary table with the new type + $result = $this->sql_column_add($table_name, $temp_column_name, $original_column_data); + $statements = array_merge($statements, $result); + + // Copy the data to the new column + $statements[] = 'UPDATE ' . $table_name . ' SET ' . $temp_column_name . ' = ' . $column_name; + + // Drop the original column + $result = $this->sql_column_remove($table_name, $column_name); + $statements = array_merge($statements, $result); + + // Recreate the original column with the new type + $result = $this->sql_column_add($table_name, $column_name, $original_column_data); + $statements = array_merge($statements, $result); + + if (!empty($indexes)) + { + // Recreate indexes after we changed the column + foreach ($indexes as $index_name => $index_data) + { + $result = $this->sql_create_index($table_name, $this->strip_table_name_from_index_name($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, $this->strip_table_name_from_index_name($table_name, $index_name), $index_data); + $statements = array_merge($statements, $result); + } + } + + // Copy the data to the original column + $statements[] = 'UPDATE ' . $table_name . ' SET ' . $column_name . ' = ' . $temp_column_name; + + // Drop the temporary column again + $result = $this->sql_column_remove($table_name, $temp_column_name); + $statements = array_merge($statements, $result); + + $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': + + if ($inline && $this->return_statements) + { + return $column_name . ' ' . $column_data['column_type_sql']; + } + + $recreate_queries = $this->sqlite_get_recreate_table_queries($table_name); + if (empty($recreate_queries)) + { + break; + } + + $statements[] = 'begin'; + + $sql_create_table = array_shift($recreate_queries); + + // Create a temp table and populate it, destroy the existing one + $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $sql_create_table); + $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name; + $statements[] = 'DROP TABLE ' . $table_name; + + preg_match('#\((.*)\)#s', $sql_create_table, $matches); + + $new_table_cols = trim($matches[1]); + $old_table_cols = preg_split('/,(?![\s\w]+\))/m', $new_table_cols); + $column_list = array(); + + foreach ($old_table_cols as $key => $declaration) + { + $declaration = trim($declaration); + + // Check for the beginning of the constraint section and stop + if (preg_match('/[^\(]*\s*PRIMARY KEY\s+\(/', $declaration) || + preg_match('/[^\(]*\s*UNIQUE\s+\(/', $declaration) || + preg_match('/[^\(]*\s*FOREIGN KEY\s+\(/', $declaration) || + preg_match('/[^\(]*\s*CHECK\s+\(/', $declaration)) + { + break; + } + + $entities = preg_split('#\s+#', $declaration); + $column_list[] = $entities[0]; + if ($entities[0] == $column_name) + { + $old_table_cols[$key] = $column_name . ' ' . $column_data['column_type_sql']; + } + } + + $columns = implode(',', $column_list); + + // Create a new table and fill it up. destroy the temp one + $statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $old_table_cols) . ');'; + $statements = array_merge($statements, $recreate_queries); + + $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; + $statements[] = 'DROP TABLE ' . $table_name . '_temp'; + + $statements[] = 'commit'; + + break; + } + + 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) + { + switch ($this->sql_layer) + { + case 'mysql_40': + case 'mysql_41': + case 'postgres': + case 'sqlite': + case 'sqlite3': + // Not supported + throw new \Exception('DBMS is not supported'); + break; + } + + $sql = ''; + $existing_indexes = array(); + + 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 + WHERE ix.index_name = ixc.index_name + AND ixc.table_name = '" . strtoupper($table_name) . "' + AND ixc.column_name = '" . strtoupper($column_name) . "'"; + break; + } + + $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(); + } + + 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 + WHERE table_name = '" . strtoupper($table_name) . "' + AND " . $this->db->sql_in_set('index_name', array_keys($existing_indexes)); + break; + } + + $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; + } + + /** + * Returns the Queries which are required to recreate a table including indexes + * + * @param string $table_name + * @param string $remove_column When we drop a column, we remove the column + * from all indexes. If the index has no other + * column, we drop it completly. + * @return array + */ + protected function sqlite_get_recreate_table_queries($table_name, $remove_column = '') + { + $queries = array(); + + $sql = "SELECT sql + FROM sqlite_master + WHERE type = 'table' + AND name = '{$table_name}'"; + $result = $this->db->sql_query($sql); + $sql_create_table = $this->db->sql_fetchfield('sql'); + $this->db->sql_freeresult($result); + + if (!$sql_create_table) + { + return array(); + } + $queries[] = $sql_create_table; + + $sql = "SELECT sql + FROM sqlite_master + WHERE type = 'index' + AND tbl_name = '{$table_name}'"; + $result = $this->db->sql_query($sql); + while ($sql_create_index = $this->db->sql_fetchfield('sql')) + { + if ($remove_column) + { + $match = array(); + preg_match('#(?:[\w ]+)\((.*)\)#', $sql_create_index, $match); + if (!isset($match[1])) + { + continue; + } + + // Find and remove $remove_column from the index + $columns = explode(', ', $match[1]); + $found_column = array_search($remove_column, $columns); + if ($found_column !== false) + { + unset($columns[$found_column]); + + // If the column list is not empty add the index to the list + if (!empty($columns)) + { + $queries[] = str_replace($match[1], implode(', ', $columns), $sql_create_index); + } + } + else + { + $queries[] = $sql_create_index; + } + } + else + { + $queries[] = $sql_create_index; + } + } + $this->db->sql_freeresult($result); + + return $queries; + } +} diff --git a/sources/phpBB/phpbb/di/container_builder.php b/sources/phpBB/phpbb/di/container_builder.php new file mode 100644 index 0000000..638c13e --- /dev/null +++ b/sources/phpBB/phpbb/di/container_builder.php @@ -0,0 +1,405 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\di; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Dumper\PhpDumper; +use Symfony\Component\HttpKernel\DependencyInjection\RegisterListenersPass; + +class container_builder +{ + /** @var string phpBB Root Path */ + protected $phpbb_root_path; + + /** @var string php file extension */ + protected $php_ext; + + /** + * The container under construction + * + * @var ContainerBuilder + */ + protected $container; + + /** + * @var \phpbb\db\driver\driver_interface + */ + protected $dbal_connection = null; + + /** + * @var array the installed extensions + */ + protected $installed_exts = null; + + /** + * Indicates whether the php config file should be injected into the container (default to true). + * + * @var bool + */ + protected $inject_config = true; + + /** + * Indicates whether extensions should be used (default to true). + * + * @var bool + */ + protected $use_extensions = true; + + /** + * Defines a custom path to find the configuration of the container (default to $this->phpbb_root_path . 'config') + * + * @var string + */ + protected $config_path = null; + + /** + * Indicates whether the phpBB compile pass should be used (default to true). + * + * @var bool + */ + protected $use_custom_pass = true; + + /** + * Indicates whether the kernel compile pass should be used (default to true). + * + * @var bool + */ + protected $use_kernel_pass = true; + + /** + * Indicates whether the container should be dumped to the filesystem (default to true). + * + * If DEBUG_CONTAINER is set this option is ignored and a new container is build. + * + * @var bool + */ + protected $dump_container = true; + + /** + * Indicates if the container should be compiled automatically (default to true). + * + * @var bool + */ + protected $compile_container = true; + + /** + * Custom parameters to inject into the container. + * + * Default to true: + * array( + * 'core.root_path', $this->phpbb_root_path, + * 'core.php_ext', $this->php_ext, + * ); + * + * @var array + */ + protected $custom_parameters = null; + + /** + * @var \phpbb\config_php_file + */ + protected $config_php_file; + + /** + * Constructor + * + * @param \phpbb\config_php_file $config_php_file + * @param string $phpbb_root_path Path to the phpbb includes directory. + * @param string $php_ext php file extension + */ + function __construct(\phpbb\config_php_file $config_php_file, $phpbb_root_path, $php_ext) + { + $this->config_php_file = $config_php_file; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + } + + /** + * Build and return a new Container respecting the current configuration + * + * @return \phpbb_cache_container|ContainerBuilder + */ + public function get_container() + { + $container_filename = $this->get_container_filename(); + if (!defined('DEBUG_CONTAINER') && $this->dump_container && file_exists($container_filename)) + { + require($container_filename); + $this->container = new \phpbb_cache_container(); + } + else + { + if ($this->config_path === null) + { + $this->config_path = $this->phpbb_root_path . 'config'; + } + $container_extensions = array(new \phpbb\di\extension\core($this->config_path)); + + if ($this->use_extensions) + { + $installed_exts = $this->get_installed_extensions(); + $container_extensions[] = new \phpbb\di\extension\ext($installed_exts); + } + + if ($this->inject_config) + { + $container_extensions[] = new \phpbb\di\extension\config($this->config_php_file); + } + + $this->container = $this->create_container($container_extensions); + + if ($this->use_custom_pass) + { + // Symfony Kernel Listeners + $this->container->addCompilerPass(new \phpbb\di\pass\collection_pass()); + $this->container->addCompilerPass(new RegisterListenersPass('dispatcher', 'event.listener_listener', 'event.listener')); + + if ($this->use_kernel_pass) + { + $this->container->addCompilerPass(new RegisterListenersPass('dispatcher')); + } + } + + $this->inject_custom_parameters(); + + if ($this->compile_container) + { + $this->container->compile(); + } + + if ($this->dump_container && !defined('DEBUG_CONTAINER')) + { + $this->dump_container($container_filename); + } + } + + $this->container->set('config.php', $this->config_php_file); + + if ($this->compile_container) + { + $this->inject_dbal(); + } + + return $this->container; + } + + /** + * Set if the extensions should be used. + * + * @param bool $use_extensions + */ + public function set_use_extensions($use_extensions) + { + $this->use_extensions = $use_extensions; + } + + /** + * Set if the phpBB compile pass have to be used. + * + * @param bool $use_custom_pass + */ + public function set_use_custom_pass($use_custom_pass) + { + $this->use_custom_pass = $use_custom_pass; + } + + /** + * Set if the kernel compile pass have to be used. + * + * @param bool $use_kernel_pass + */ + public function set_use_kernel_pass($use_kernel_pass) + { + $this->use_kernel_pass = $use_kernel_pass; + } + + /** + * Set if the php config file should be injecting into the container. + * + * @param bool $inject_config + */ + public function set_inject_config($inject_config) + { + $this->inject_config = $inject_config; + } + + /** + * Set if a dump container should be used. + * + * If DEBUG_CONTAINER is set this option is ignored and a new container is build. + * + * @var bool $dump_container + */ + public function set_dump_container($dump_container) + { + $this->dump_container = $dump_container; + } + + /** + * Set if the container should be compiled automatically (default to true). + * + * @var bool $dump_container + */ + public function set_compile_container($compile_container) + { + $this->compile_container = $compile_container; + } + + /** + * Set a custom path to find the configuration of the container + * + * @param string $config_path + */ + public function set_config_path($config_path) + { + $this->config_path = $config_path; + } + + /** + * Set custom parameters to inject into the container. + * + * @param array $custom_parameters + */ + public function set_custom_parameters($custom_parameters) + { + $this->custom_parameters = $custom_parameters; + } + + /** + * Dump the container to the disk. + * + * @param string $container_filename The name of the file. + */ + protected function dump_container($container_filename) + { + $dumper = new PhpDumper($this->container); + $cached_container_dump = $dumper->dump(array( + 'class' => 'phpbb_cache_container', + 'base_class' => 'Symfony\\Component\\DependencyInjection\\ContainerBuilder', + )); + + file_put_contents($container_filename, $cached_container_dump); + } + + /** + * Inject the connection into the container if one was opened. + */ + protected function inject_dbal() + { + if ($this->dbal_connection !== null) + { + $this->container->get('dbal.conn')->set_driver($this->dbal_connection); + } + } + + /** + * Get DB connection. + * + * @return \phpbb\db\driver\driver_interface + */ + protected function get_dbal_connection() + { + if ($this->dbal_connection === null) + { + $dbal_driver_class = $this->config_php_file->convert_30_dbms_to_31($this->config_php_file->get('dbms')); + $this->dbal_connection = new $dbal_driver_class(); + $this->dbal_connection->sql_connect( + $this->config_php_file->get('dbhost'), + $this->config_php_file->get('dbuser'), + $this->config_php_file->get('dbpasswd'), + $this->config_php_file->get('dbname'), + $this->config_php_file->get('dbport'), + defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK + ); + } + + return $this->dbal_connection; + } + + /** + * Get enabled extensions. + * + * @return array enabled extensions + */ + protected function get_installed_extensions() + { + $db = $this->get_dbal_connection(); + $extension_table = $this->config_php_file->get('table_prefix') . 'ext'; + + $sql = 'SELECT * + FROM ' . $extension_table . ' + WHERE ext_active = 1'; + + $result = $db->sql_query($sql); + $rows = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + $exts = array(); + foreach ($rows as $row) + { + $exts[$row['ext_name']] = $this->phpbb_root_path . 'ext/' . $row['ext_name'] . '/'; + } + + return $exts; + } + + /** + * Create the ContainerBuilder object + * + * @param array $extensions Array of Container extension objects + * @return ContainerBuilder object + */ + protected function create_container(array $extensions) + { + $container = new ContainerBuilder(); + + foreach ($extensions as $extension) + { + $container->registerExtension($extension); + $container->loadFromExtension($extension->getAlias()); + } + + return $container; + } + + /** + * Inject the customs parameters into the container + */ + protected function inject_custom_parameters() + { + if ($this->custom_parameters === null) + { + $this->custom_parameters = array( + 'core.root_path' => $this->phpbb_root_path, + 'core.php_ext' => $this->php_ext, + ); + } + + foreach ($this->custom_parameters as $key => $value) + { + $this->container->setParameter($key, $value); + } + } + + /** + * Get the filename under which the dumped container will be stored. + * + * @return string Path for dumped container + */ + protected function get_container_filename() + { + $filename = str_replace(array('/', '.'), array('slash', 'dot'), $this->phpbb_root_path); + return $this->phpbb_root_path . 'cache/container_' . $filename . '.' . $this->php_ext; + } +} diff --git a/sources/phpBB/phpbb/di/extension/config.php b/sources/phpBB/phpbb/di/extension/config.php new file mode 100644 index 0000000..7984a78 --- /dev/null +++ b/sources/phpBB/phpbb/di/extension/config.php @@ -0,0 +1,89 @@ + +* @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; + +/** +* Container config extension +*/ +class config extends Extension +{ + /** @var array */ + protected $config_php; + + public function __construct(\phpbb\config_php_file $config_php) + { + $this->config_php = $config_php; + } + + /** + * 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) + { + $parameters = array( + 'core.adm_relative_path' => $this->config_php->get('phpbb_adm_relative_path') ? $this->config_php->get('phpbb_adm_relative_path') : 'adm/', + 'core.table_prefix' => $this->config_php->get('table_prefix'), + 'cache.driver.class' => $this->convert_30_acm_type($this->config_php->get('acm_type')), + 'dbal.driver.class' => $this->config_php->convert_30_dbms_to_31($this->config_php->get('dbms')), + 'dbal.dbhost' => $this->config_php->get('dbhost'), + 'dbal.dbuser' => $this->config_php->get('dbuser'), + 'dbal.dbpasswd' => $this->config_php->get('dbpasswd'), + 'dbal.dbname' => $this->config_php->get('dbname'), + 'dbal.dbport' => $this->config_php->get('dbport'), + 'dbal.new_link' => defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK, + ); + $parameter_bag = $container->getParameterBag(); + + foreach ($parameters as $parameter => $value) + { + $container->setParameter($parameter, $parameter_bag->escapeValue($value)); + } + } + + /** + * 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 'config'; + } + + /** + * Convert 3.0 ACM type to 3.1 cache driver class name + * + * @param string $acm_type ACM type + * @return string cache driver class + */ + protected function convert_30_acm_type($acm_type) + { + if (preg_match('#^[a-z]+$#', $acm_type)) + { + return 'phpbb\\cache\\driver\\' . $acm_type; + } + + return $acm_type; + } +} diff --git a/sources/phpBB/phpbb/di/extension/core.php b/sources/phpBB/phpbb/di/extension/core.php new file mode 100644 index 0000000..ca4fa5c --- /dev/null +++ b/sources/phpBB/phpbb/di/extension/core.php @@ -0,0 +1,67 @@ + +* @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 core extension +*/ +class core extends Extension +{ + /** + * Config path + * @var string + */ + protected $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) + { + $loader = new YamlFileLoader($container, new FileLocator(phpbb_realpath($this->config_path))); + $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 'core'; + } +} diff --git a/sources/phpBB/phpbb/di/extension/ext.php b/sources/phpBB/phpbb/di/extension/ext.php new file mode 100644 index 0000000..718c992 --- /dev/null +++ b/sources/phpBB/phpbb/di/extension/ext.php @@ -0,0 +1,67 @@ + +* @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/sources/phpBB/phpbb/di/pass/collection_pass.php b/sources/phpBB/phpbb/di/pass/collection_pass.php new file mode 100644 index 0000000..a5c0546 --- /dev/null +++ b/sources/phpBB/phpbb/di/pass/collection_pass.php @@ -0,0 +1,44 @@ + +* @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\pass; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; + +/** +* Appends an add method call to the definition of each collection service for +* the services tagged with the appropriate name defined in the collection's +* service_collection tag. +*/ +class collection_pass implements CompilerPassInterface +{ + /** + * Modify the container before it is passed to the rest of the code + * + * @param ContainerBuilder $container ContainerBuilder object + * @return null + */ + public function process(ContainerBuilder $container) + { + foreach ($container->findTaggedServiceIds('service_collection') as $id => $data) + { + $definition = $container->getDefinition($id); + + foreach ($container->findTaggedServiceIds($data[0]['tag']) as $service_id => $service_data) + { + $definition->addMethodCall('add', array($service_id)); + } + } + } +} diff --git a/sources/phpBB/phpbb/di/service_collection.php b/sources/phpBB/phpbb/di/service_collection.php new file mode 100644 index 0000000..82ca9bf --- /dev/null +++ b/sources/phpBB/phpbb/di/service_collection.php @@ -0,0 +1,79 @@ + +* @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 to be configured at container compile time. +*/ +class service_collection extends \ArrayObject +{ + /** + * @var \Symfony\Component\DependencyInjection\ContainerInterface + */ + protected $container; + + /** + * Constructor + * + * @param ContainerInterface $container Container object + */ + public function __construct(ContainerInterface $container) + { + $this->container = $container; + } + + /** + * {@inheritdoc} + */ + public function getIterator() + { + return new service_collection_iterator($this); + } + + // Because of a PHP issue we have to redefine offsetExists + // (even with a call to the parent): + // https://bugs.php.net/bug.php?id=66834 + // https://bugs.php.net/bug.php?id=67067 + // But it triggers a sniffer issue that we have to skip + // @codingStandardsIgnoreStart + /** + * {@inheritdoc} + */ + public function offsetExists($index) + { + return parent::offsetExists($index); + } + // @codingStandardsIgnoreEnd + + /** + * {@inheritdoc} + */ + public function offsetGet($index) + { + return $this->container->get($index); + } + + /** + * Add a service to the collection + * + * @param string $name The service name + * @return null + */ + public function add($name) + { + $this->offsetSet($name, null); + } +} diff --git a/sources/phpBB/phpbb/di/service_collection_iterator.php b/sources/phpBB/phpbb/di/service_collection_iterator.php new file mode 100644 index 0000000..0d031ab --- /dev/null +++ b/sources/phpBB/phpbb/di/service_collection_iterator.php @@ -0,0 +1,46 @@ + +* @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; + +/** +* Iterator which loads the services when they are requested +*/ +class service_collection_iterator extends \ArrayIterator +{ + /** + * @var \phpbb\di\service_collection + */ + protected $collection; + + /** + * Construct an ArrayIterator for service_collection + * + * @param \phpbb\di\service_collection $collection The collection to iterate over + * @param int $flags Flags to control the behaviour of the ArrayObject object. + * @see ArrayObject::setFlags() + */ + public function __construct(service_collection $collection, $flags = 0) + { + parent::__construct($collection, $flags); + $this->collection = $collection; + } + + /** + * {@inheritdoc} + */ + public function current() + { + return $this->collection->offsetGet($this->key()); + } +} diff --git a/sources/phpBB/phpbb/error_collector.php b/sources/phpBB/phpbb/error_collector.php new file mode 100644 index 0000000..bf8efd1 --- /dev/null +++ b/sources/phpBB/phpbb/error_collector.php @@ -0,0 +1,73 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb; + +class error_collector +{ + var $errors; + var $error_types; + + /** + * Constructor. + * + * The variable $error_types may be set to a mask of PHP error types that + * the collector should keep, e.g. `E_ALL`. If unset, the current value of + * the error_reporting() function will be used to determine which errors + * the collector will keep. + * + * @see PHPBB3-13306 + * @param int|null $error_types + */ + function __construct($error_types = null) + { + $this->errors = array(); + $this->error_types = $error_types; + } + + function install() + { + set_error_handler(array(&$this, 'error_handler'), ($this->error_types !== null) ? $this->error_types : error_reporting()); + } + + function uninstall() + { + restore_error_handler(); + } + + function error_handler($errno, $msg_text, $errfile, $errline) + { + $this->errors[] = array($errno, $msg_text, $errfile, $errline); + } + + function format_errors() + { + $text = ''; + foreach ($this->errors as $error) + { + if (!empty($text)) + { + $text .= "
\n"; + } + + list($errno, $msg_text, $errfile, $errline) = $error; + + // Prevent leakage of local path to phpBB install + $errfile = phpbb_filter_root_path($errfile); + + $text .= "Errno $errno: $msg_text at $errfile line $errline"; + } + + return $text; + } +} diff --git a/sources/phpBB/phpbb/event/data.php b/sources/phpBB/phpbb/event/data.php new file mode 100644 index 0000000..c7365ae --- /dev/null +++ b/sources/phpBB/phpbb/event/data.php @@ -0,0 +1,66 @@ + +* @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\Event; + +class data extends Event implements \ArrayAccess +{ + private $data; + + public function __construct(array $data = array()) + { + $this->set_data($data); + } + + public function set_data(array $data = array()) + { + $this->data = $data; + } + + public function get_data() + { + return $this->data; + } + + /** + * Returns data filtered to only include specified keys. + * + * This effectively discards any keys added to data by hooks. + */ + public function get_data_filtered($keys) + { + return array_intersect_key($this->data, array_flip($keys)); + } + + public function offsetExists($offset) + { + return isset($this->data[$offset]); + } + + public function offsetGet($offset) + { + return isset($this->data[$offset]) ? $this->data[$offset] : null; + } + + public function offsetSet($offset, $value) + { + $this->data[$offset] = $value; + } + + public function offsetUnset($offset) + { + unset($this->data[$offset]); + } +} diff --git a/sources/phpBB/phpbb/event/dispatcher.php b/sources/phpBB/phpbb/event/dispatcher.php new file mode 100644 index 0000000..1c4abeb --- /dev/null +++ b/sources/phpBB/phpbb/event/dispatcher.php @@ -0,0 +1,78 @@ + +* @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\ContainerAwareEventDispatcher; +use Symfony\Component\EventDispatcher\Event; + +/** +* Extension of the Symfony2 EventDispatcher +* +* It provides an additional `trigger_event` method, which +* gives some syntactic sugar for dispatching events. Instead +* of creating the event object, the method will do that for +* you. +* +* Example: +* +* $vars = array('page_title'); +* extract($phpbb_dispatcher->trigger_event('core.index', compact($vars))); +* +*/ +class dispatcher extends ContainerAwareEventDispatcher implements dispatcher_interface +{ + /** + * @var bool + */ + protected $disabled = false; + + /** + * {@inheritdoc} + */ + public function trigger_event($eventName, $data = array()) + { + $event = new \phpbb\event\data($data); + $this->dispatch($eventName, $event); + return $event->get_data_filtered(array_keys($data)); + } + + /** + * {@inheritdoc} + */ + public function dispatch($eventName, Event $event = null) + { + if ($this->disabled) + { + return $event; + } + + return parent::dispatch($eventName, $event); + } + + /** + * {@inheritdoc} + */ + public function disable() + { + $this->disabled = true; + } + + /** + * {@inheritdoc} + */ + public function enable() + { + $this->disabled = false; + } +} diff --git a/sources/phpBB/phpbb/event/dispatcher_interface.php b/sources/phpBB/phpbb/event/dispatcher_interface.php new file mode 100644 index 0000000..c66aa98 --- /dev/null +++ b/sources/phpBB/phpbb/event/dispatcher_interface.php @@ -0,0 +1,50 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\event; + +/** +* Extension of the Symfony2 EventDispatcher +* +* It provides an additional `trigger_event` method, which +* gives some syntactic sugar for dispatching events. Instead +* of creating the event object, the method will do that for +* you. +* +* Example: +* +* $vars = array('page_title'); +* extract($phpbb_dispatcher->trigger_event('core.index', compact($vars))); +* +*/ +interface dispatcher_interface extends \Symfony\Component\EventDispatcher\EventDispatcherInterface +{ + /** + * Construct and dispatch an event + * + * @param string $eventName The event name + * @param array $data An array containing the variables sending with the event + * @return mixed + */ + public function trigger_event($eventName, $data = array()); + + /** + * Disable the event dispatcher. + */ + public function disable(); + + /** + * Enable the event dispatcher. + */ + public function enable(); +} diff --git a/sources/phpBB/phpbb/event/kernel_exception_subscriber.php b/sources/phpBB/phpbb/event/kernel_exception_subscriber.php new file mode 100644 index 0000000..eb7831a --- /dev/null +++ b/sources/phpBB/phpbb/event/kernel_exception_subscriber.php @@ -0,0 +1,115 @@ + +* @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\HttpFoundation\JsonResponse; +use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\HttpFoundation\Response; + +class kernel_exception_subscriber implements EventSubscriberInterface +{ + /** + * Template object + * @var \phpbb\template\template + */ + protected $template; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Construct method + * + * @param \phpbb\template\template $template Template object + * @param \phpbb\user $user User object + */ + public function __construct(\phpbb\template\template $template, \phpbb\user $user) + { + $this->template = $template; + $this->user = $user; + } + + /** + * This listener is run when the KernelEvents::EXCEPTION event is triggered + * + * @param GetResponseForExceptionEvent $event + * @return null + */ + public function on_kernel_exception(GetResponseForExceptionEvent $event) + { + $exception = $event->getException(); + + $message = $exception->getMessage(); + + if ($exception instanceof \phpbb\exception\exception_interface) + { + $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($message), $exception->get_parameters())); + } + + if (!$event->getRequest()->isXmlHttpRequest()) + { + page_header($this->user->lang('INFORMATION')); + + $this->template->assign_vars(array( + 'MESSAGE_TITLE' => $this->user->lang('INFORMATION'), + 'MESSAGE_TEXT' => $message, + )); + + $this->template->set_filenames(array( + 'body' => 'message_body.html', + )); + + page_footer(true, false, false); + + $response = new Response($this->template->assign_display('body'), 500); + } + else + { + $data = array(); + + if (!empty($message)) + { + $data['message'] = $message; + } + + if (defined('DEBUG')) + { + $data['trace'] = $exception->getTrace(); + } + + $response = new JsonResponse($data, 500); + } + + if ($exception instanceof HttpExceptionInterface) + { + $response->setStatusCode($exception->getStatusCode()); + $response->headers->add($exception->getHeaders()); + } + + $event->setResponse($response); + } + + public static function getSubscribedEvents() + { + return array( + KernelEvents::EXCEPTION => 'on_kernel_exception', + ); + } +} diff --git a/sources/phpBB/phpbb/event/kernel_request_subscriber.php b/sources/phpBB/phpbb/event/kernel_request_subscriber.php new file mode 100644 index 0000000..ee9f29a --- /dev/null +++ b/sources/phpBB/phpbb/event/kernel_request_subscriber.php @@ -0,0 +1,82 @@ + +* @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/sources/phpBB/phpbb/event/kernel_terminate_subscriber.php b/sources/phpBB/phpbb/event/kernel_terminate_subscriber.php new file mode 100644 index 0000000..57e4840 --- /dev/null +++ b/sources/phpBB/phpbb/event/kernel_terminate_subscriber.php @@ -0,0 +1,41 @@ + +* @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\PostResponseEvent; + +class kernel_terminate_subscriber implements EventSubscriberInterface +{ + /** + * This listener is run when the KernelEvents::TERMINATE event is triggered + * This comes after a Response has been sent to the server; this is + * primarily cleanup stuff. + * + * @param PostResponseEvent $event + * @return null + */ + public function on_kernel_terminate(PostResponseEvent $event) + { + exit_handler(); + } + + public static function getSubscribedEvents() + { + return array( + KernelEvents::TERMINATE => 'on_kernel_terminate', + ); + } +} diff --git a/sources/phpBB/phpbb/event/md_exporter.php b/sources/phpBB/phpbb/event/md_exporter.php new file mode 100644 index 0000000..f702187 --- /dev/null +++ b/sources/phpBB/phpbb/event/md_exporter.php @@ -0,0 +1,440 @@ + +* @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; + +/** +* Crawls through a markdown file and grabs all events +*/ +class md_exporter +{ + /** @var string Path where we look for files*/ + protected $path; + + /** @var string phpBB Root Path */ + protected $root_path; + + /** @var string */ + protected $filter; + + /** @var string */ + protected $current_event; + + /** @var array */ + protected $events; + + /** + * @param string $phpbb_root_path + * @param mixed $extension String 'vendor/ext' to filter, null for phpBB core + */ + public function __construct($phpbb_root_path, $extension = null) + { + $this->root_path = $phpbb_root_path; + $this->path = $this->root_path; + if ($extension) + { + $this->path .= 'ext/' . $extension . '/'; + } + + $this->events = array(); + $this->events_by_file = array(); + $this->filter = $this->current_event = ''; + } + + /** + * Get the list of all events + * + * @return array Array with events: name => details + */ + public function get_events() + { + return $this->events; + } + + /** + * @param string $md_file Relative from phpBB root + * @return int Number of events found + * @throws \LogicException + */ + public function crawl_phpbb_directory_adm($md_file) + { + $this->crawl_eventsmd($md_file, 'adm'); + + $file_list = $this->get_recursive_file_list($this->path . 'adm/style/'); + foreach ($file_list as $file) + { + $file_name = 'adm/style/' . $file; + $this->validate_events_from_file($file_name, $this->crawl_file_for_events($file_name)); + } + + return sizeof($this->events); + } + + /** + * @param string $md_file Relative from phpBB root + * @return int Number of events found + * @throws \LogicException + */ + public function crawl_phpbb_directory_styles($md_file) + { + $this->crawl_eventsmd($md_file, 'styles'); + + $styles = array('prosilver', 'subsilver2'); + foreach ($styles as $style) + { + $file_list = $this->get_recursive_file_list( + $this->path . 'styles/' . $style . '/template/' + ); + + foreach ($file_list as $file) + { + $file_name = 'styles/' . $style . '/template/' . $file; + $this->validate_events_from_file($file_name, $this->crawl_file_for_events($file_name)); + } + } + + return sizeof($this->events); + } + + /** + * @param string $md_file Relative from phpBB root + * @param string $filter Should be 'styles' or 'adm' + * @return int Number of events found + * @throws \LogicException + */ + public function crawl_eventsmd($md_file, $filter) + { + if (!file_exists($this->path . $md_file)) + { + throw new \LogicException("The event docs file '{$md_file}' could not be found"); + } + + $file_content = file_get_contents($this->path . $md_file); + $this->filter = $filter; + + $events = explode("\n\n", $file_content); + foreach ($events as $event) + { + // Last row of the file + if (strpos($event, "\n===\n") === false) + { + continue; + } + + list($event_name, $details) = explode("\n===\n", $event, 2); + $this->validate_event_name($event_name); + $this->current_event = $event_name; + + if (isset($this->events[$this->current_event])) + { + throw new \LogicException("The event '{$this->current_event}' is defined multiple times"); + } + + if (($this->filter == 'adm' && strpos($this->current_event, 'acp_') !== 0) + || ($this->filter == 'styles' && strpos($this->current_event, 'acp_') === 0)) + { + continue; + } + + list($file_details, $details) = explode("\n* Since: ", $details, 2); + list($since, $description) = explode("\n* Purpose: ", $details, 2); + + $files = $this->validate_file_list($file_details); + $since = $this->validate_since($since); + + $this->events[$event_name] = array( + 'event' => $this->current_event, + 'files' => $files, + 'since' => $since, + 'description' => $description, + ); + } + + return sizeof($this->events); + } + + /** + * Format the php events as a wiki table + * @return string Number of events found + */ + public function export_events_for_wiki() + { + if ($this->filter === 'adm') + { + $wiki_page = '= ACP Template Events =' . "\n"; + $wiki_page .= '{| class="zebra sortable" cellspacing="0" cellpadding="5"' . "\n"; + $wiki_page .= '! Identifier !! Placement !! Added in Release !! Explanation' . "\n"; + } + else + { + $wiki_page = '= Template Events =' . "\n"; + $wiki_page .= '{| class="zebra sortable" cellspacing="0" cellpadding="5"' . "\n"; + $wiki_page .= '! Identifier !! Prosilver Placement (If applicable) !! Subsilver Placement (If applicable) !! Added in Release !! Explanation' . "\n"; + } + + foreach ($this->events as $event_name => $event) + { + $wiki_page .= "|- id=\"{$event_name}\"\n"; + $wiki_page .= "| [[#{$event_name}|{$event_name}]] || "; + + if ($this->filter === 'adm') + { + $wiki_page .= implode(', ', $event['files']['adm']); + } + else + { + $wiki_page .= implode(', ', $event['files']['prosilver']) . ' || ' . implode(', ', $event['files']['subsilver2']); + } + + $wiki_page .= " || {$event['since']} || " . str_replace("\n", ' ', $event['description']) . "\n"; + } + $wiki_page .= '|}' . "\n"; + + return $wiki_page; + } + + /** + * Validates a template event name + * + * @param $event_name + * @return null + * @throws \LogicException + */ + public function validate_event_name($event_name) + { + if (!preg_match('#^([a-z][a-z0-9]*(?:_[a-z][a-z0-9]*)+)$#', $event_name)) + { + throw new \LogicException("Invalid event name '{$event_name}'"); + } + } + + /** + * Validate "Since" Information + * + * @param string $since + * @return string + * @throws \LogicException + */ + public function validate_since($since) + { + if (!preg_match('#^\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?$#', $since)) + { + throw new \LogicException("Invalid since information found for event '{$this->current_event}'"); + } + + return $since; + } + + /** + * Validate the files list + * + * @param string $file_details + * @return array + * @throws \LogicException + */ + public function validate_file_list($file_details) + { + $files_list = array( + 'prosilver' => array(), + 'subsilver2' => array(), + 'adm' => array(), + ); + + // Multi file list + if (strpos($file_details, "* Locations:\n + ") === 0) + { + $file_details = substr($file_details, strlen("* Locations:\n + ")); + $files = explode("\n + ", $file_details); + foreach ($files as $file) + { + if (!file_exists($this->path . $file) || substr($file, -5) !== '.html') + { + throw new \LogicException("Invalid file '{$file}' not found for event '{$this->current_event}'", 1); + } + + if (($this->filter !== 'adm') && strpos($file, 'styles/prosilver/template/') === 0) + { + $files_list['prosilver'][] = substr($file, strlen('styles/prosilver/template/')); + } + else if (($this->filter !== 'adm') && strpos($file, 'styles/subsilver2/template/') === 0) + { + $files_list['subsilver2'][] = substr($file, strlen('styles/subsilver2/template/')); + } + else if (($this->filter === 'adm') && strpos($file, 'adm/style/') === 0) + { + $files_list['adm'][] = substr($file, strlen('adm/style/')); + } + else + { + throw new \LogicException("Invalid file '{$file}' not found for event '{$this->current_event}'", 2); + } + + $this->events_by_file[$file][] = $this->current_event; + } + } + else if ($this->filter == 'adm') + { + $file = substr($file_details, strlen('* Location: ')); + if (!file_exists($this->path . $file) || substr($file, -5) !== '.html') + { + throw new \LogicException("Invalid file '{$file}' not found for event '{$this->current_event}'", 1); + } + + $files_list['adm'][] = substr($file, strlen('adm/style/')); + + $this->events_by_file[$file][] = $this->current_event; + } + else + { + throw new \LogicException("Invalid file list found for event '{$this->current_event}'", 2); + } + + return $files_list; + } + + /** + * Get all template events in a template file + * + * @param string $file + * @return array + * @throws \LogicException + */ + public function crawl_file_for_events($file) + { + if (!file_exists($this->path . $file)) + { + throw new \LogicException("File '{$file}' does not exist", 1); + } + + $event_list = array(); + $file_content = file_get_contents($this->path . $file); + + $events = explode('', $event, 2); + $event_list[] = array_shift($event); + } + + return $event_list; + } + + /** + * Validates whether all events from $file are in the md file and vice-versa + * + * @param string $file + * @param array $events + * @return true + * @throws \LogicException + */ + public function validate_events_from_file($file, array $events) + { + if (empty($this->events_by_file[$file]) && empty($events)) + { + return true; + } + else if (empty($this->events_by_file[$file])) + { + $event_list = implode("', '", $events); + throw new \LogicException("File '{$file}' should not contain events, but contains: " + . "'{$event_list}'", 1); + } + else if (empty($events)) + { + $event_list = implode("', '", $this->events_by_file[$file]); + throw new \LogicException("File '{$file}' contains no events, but should contain: " + . "'{$event_list}'", 1); + } + + $missing_events_from_file = array(); + foreach ($this->events_by_file[$file] as $event) + { + if (!in_array($event, $events)) + { + $missing_events_from_file[] = $event; + } + } + + if (!empty($missing_events_from_file)) + { + $event_list = implode("', '", $missing_events_from_file); + throw new \LogicException("File '{$file}' does not contain events: '{$event_list}'", 2); + } + + $missing_events_from_md = array(); + foreach ($events as $event) + { + if (!in_array($event, $this->events_by_file[$file])) + { + $missing_events_from_md[] = $event; + } + } + + if (!empty($missing_events_from_md)) + { + $event_list = implode("', '", $missing_events_from_md); + throw new \LogicException("File '{$file}' contains additional events: '{$event_list}'", 3); + } + + return true; + } + + /** + * Returns a list of files in $dir + * + * Works recursive with any depth + * + * @param string $dir Directory to go through + * @return array List of files (including directories) + */ + public function get_recursive_file_list($dir) + { + try + { + $iterator = new \RecursiveIteratorIterator( + new \phpbb\recursive_dot_prefix_filter_iterator( + new \RecursiveDirectoryIterator( + $dir, + \FilesystemIterator::SKIP_DOTS + ) + ), + \RecursiveIteratorIterator::SELF_FIRST + ); + } + catch (\Exception $e) + { + return array(); + } + + $files = array(); + foreach ($iterator as $file_info) + { + /** @var \RecursiveDirectoryIterator $file_info */ + if ($file_info->isDir()) + { + continue; + } + + $relative_path = $iterator->getInnerIterator()->getSubPathname(); + + if (substr($relative_path, -5) == '.html') + { + $files[] = str_replace(DIRECTORY_SEPARATOR, '/', $relative_path); + } + } + + return $files; + } +} diff --git a/sources/phpBB/phpbb/event/php_exporter.php b/sources/phpBB/phpbb/event/php_exporter.php new file mode 100644 index 0000000..35144ee --- /dev/null +++ b/sources/phpBB/phpbb/event/php_exporter.php @@ -0,0 +1,610 @@ + +* @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; + +/** +* Class php_exporter +* Crawls through a list of files and grabs all php-events +*/ +class php_exporter +{ + /** @var string Path where we look for files*/ + protected $path; + + /** @var string phpBB Root Path */ + protected $root_path; + + /** @var string */ + protected $current_file; + + /** @var string */ + protected $current_event; + + /** @var int */ + protected $current_event_line; + + /** @var array */ + protected $events; + + /** @var array */ + protected $file_lines; + + /** + * @param string $phpbb_root_path + * @param mixed $extension String 'vendor/ext' to filter, null for phpBB core + */ + public function __construct($phpbb_root_path, $extension = null) + { + $this->root_path = $phpbb_root_path; + $this->path = $phpbb_root_path; + $this->events = $this->file_lines = array(); + $this->current_file = $this->current_event = ''; + $this->current_event_line = 0; + + $this->path = $this->root_path; + if ($extension) + { + $this->path .= 'ext/' . $extension . '/'; + } + } + + /** + * Get the list of all events + * + * @return array Array with events: name => details + */ + public function get_events() + { + return $this->events; + } + + /** + * Set current event data + * + * @param string $name Name of the current event (used for error messages) + * @param int $line Line where the current event is placed in + * @return null + */ + public function set_current_event($name, $line) + { + $this->current_event = $name; + $this->current_event_line = $line; + } + + /** + * Set the content of this file + * + * @param array $content Array with the lines of the file + * @return null + */ + public function set_content($content) + { + $this->file_lines = $content; + } + + /** + * Crawl the phpBB/ directory for php events + * @return int The number of events found + */ + public function crawl_phpbb_directory_php() + { + $files = $this->get_recursive_file_list(); + $this->events = array(); + foreach ($files as $file) + { + $this->crawl_php_file($file); + } + ksort($this->events); + + return sizeof($this->events); + } + + /** + * Returns a list of files in $dir + * + * @return array List of files (including the path) + */ + public function get_recursive_file_list() + { + try + { + $iterator = new \RecursiveIteratorIterator( + new \phpbb\event\recursive_event_filter_iterator( + new \RecursiveDirectoryIterator( + $this->path, + \FilesystemIterator::SKIP_DOTS + ), + $this->path + ), + \RecursiveIteratorIterator::LEAVES_ONLY + ); + } + catch (\Exception $e) + { + return array(); + } + + $files = array(); + foreach ($iterator as $file_info) + { + /** @var \RecursiveDirectoryIterator $file_info */ + $relative_path = $iterator->getInnerIterator()->getSubPathname(); + $files[] = str_replace(DIRECTORY_SEPARATOR, '/', $relative_path); + } + + return $files; + } + + /** + * Format the php events as a wiki table + * @return string + */ + public function export_events_for_wiki() + { + $wiki_page = '= PHP Events (Hook Locations) =' . "\n"; + $wiki_page .= '{| class="sortable zebra" cellspacing="0" cellpadding="5"' . "\n"; + $wiki_page .= '! Identifier !! Placement !! Arguments !! Added in Release !! Explanation' . "\n"; + foreach ($this->events as $event) + { + $wiki_page .= '|- id="' . $event['event'] . '"' . "\n"; + $wiki_page .= '| [[#' . $event['event'] . '|' . $event['event'] . ']] || ' . $event['file'] . ' || ' . implode(', ', $event['arguments']) . ' || ' . $event['since'] . ' || ' . $event['description'] . "\n"; + } + $wiki_page .= '|}' . "\n"; + + return $wiki_page; + } + + /** + * @param string $file + * @return int Number of events found in this file + * @throws \LogicException + */ + public function crawl_php_file($file) + { + $this->current_file = $file; + $this->file_lines = array(); + $content = file_get_contents($this->path . $this->current_file); + $num_events_found = 0; + + if (strpos($content, "dispatcher->trigger_event('") || strpos($content, "dispatcher->dispatch('")) + { + $this->set_content(explode("\n", $content)); + for ($i = 0, $num_lines = sizeof($this->file_lines); $i < $num_lines; $i++) + { + $event_line = false; + $found_trigger_event = strpos($this->file_lines[$i], "dispatcher->trigger_event('"); + $arguments = array(); + if ($found_trigger_event !== false) + { + $event_line = $i; + $this->set_current_event($this->get_event_name($event_line, false), $event_line); + + // Find variables of the event + $arguments = $this->get_vars_from_array(); + $doc_vars = $this->get_vars_from_docblock(); + $this->validate_vars_docblock_array($arguments, $doc_vars); + } + else + { + $found_dispatch = strpos($this->file_lines[$i], "dispatcher->dispatch('"); + if ($found_dispatch !== false) + { + $event_line = $i; + $this->set_current_event($this->get_event_name($event_line, true), $event_line); + } + } + + if ($event_line) + { + // Validate @event + $event_line_num = $this->find_event(); + $this->validate_event($this->current_event, $this->file_lines[$event_line_num]); + + // Validate @since + $since_line_num = $this->find_since(); + $since = $this->validate_since($this->file_lines[$since_line_num]); + + // Find event description line + $description_line_num = $this->find_description(); + $description = substr(trim($this->file_lines[$description_line_num]), strlen('* ')); + + if (isset($this->events[$this->current_event])) + { + throw new \LogicException("The event '{$this->current_event}' from file " + . "'{$this->current_file}:{$event_line_num}' already exists in file " + . "'{$this->events[$this->current_event]['file']}'", 10); + } + + sort($arguments); + $this->events[$this->current_event] = array( + 'event' => $this->current_event, + 'file' => $this->current_file, + 'arguments' => $arguments, + 'since' => $since, + 'description' => $description, + ); + $num_events_found++; + } + } + } + + return $num_events_found; + } + + /** + * Find the name of the event inside the dispatch() line + * + * @param int $event_line + * @param bool $is_dispatch Do we look for dispatch() or trigger_event() ? + * @return string Name of the event + * @throws \LogicException + */ + public function get_event_name($event_line, $is_dispatch) + { + $event_text_line = $this->file_lines[$event_line]; + $event_text_line = ltrim($event_text_line, "\t "); + + if ($is_dispatch) + { + $regex = '#\$([a-z](?:[a-z0-9_]|->)*)'; + $regex .= '->dispatch\('; + $regex .= '\'' . $this->preg_match_event_name() . '\''; + $regex .= '\);#'; + } + else + { + $regex = '#extract\(\$([a-z](?:[a-z0-9_]|->)*)'; + $regex .= '->trigger_event\('; + $regex .= '\'' . $this->preg_match_event_name() . '\''; + $regex .= ', compact\(\$vars\)\)\);#'; + } + + $match = array(); + preg_match($regex, $event_text_line, $match); + if (!isset($match[2])) + { + throw new \LogicException("Can not find event name in line '{$event_text_line}' " + . "in file '{$this->current_file}:{$event_line}'", 1); + } + + return $match[2]; + } + + /** + * Returns a regex match for the event name + * + * @return string + */ + protected function preg_match_event_name() + { + return '([a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)+)'; + } + + /** + * Find the $vars array + * + * @return array List of variables + * @throws \LogicException + */ + public function get_vars_from_array() + { + $line = ltrim($this->file_lines[$this->current_event_line - 1], "\t"); + if ($line === ');') + { + $vars_array = $this->get_vars_from_multi_line_array(); + } + else + { + $vars_array = $this->get_vars_from_single_line_array($line); + } + + foreach ($vars_array as $var) + { + if (!preg_match('#^([a-zA-Z_][a-zA-Z0-9_]*)$#', $var)) + { + throw new \LogicException("Found invalid var '{$var}' in array for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 3); + } + } + + sort($vars_array); + return $vars_array; + } + + /** + * Find the variables in single line array + * + * @param string $line + * @param bool $throw_multiline Throw an exception when there are too + * many arguments in one line. + * @return array List of variables + * @throws \LogicException + */ + public function get_vars_from_single_line_array($line, $throw_multiline = true) + { + $match = array(); + preg_match('#^\$vars = array\(\'([a-zA-Z0-9_\' ,]+)\'\);$#', $line, $match); + + if (isset($match[1])) + { + $vars_array = explode("', '", $match[1]); + if ($throw_multiline && sizeof($vars_array) > 6) + { + throw new \LogicException('Should use multiple lines for $vars definition ' + . "for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2); + } + return $vars_array; + } + else + { + throw new \LogicException("Can not find '\$vars = array();'-line for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1); + } + } + + /** + * Find the variables in single line array + * + * @return array List of variables + * @throws \LogicException + */ + public function get_vars_from_multi_line_array() + { + $current_vars_line = 2; + $var_lines = array(); + while (ltrim($this->file_lines[$this->current_event_line - $current_vars_line], "\t") !== '$vars = array(') + { + $var_lines[] = substr(trim($this->file_lines[$this->current_event_line - $current_vars_line]), 0, -1); + + $current_vars_line++; + if ($current_vars_line > $this->current_event_line) + { + // Reached the start of the file + throw new \LogicException("Can not find end of \$vars array for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2); + } + } + + return $this->get_vars_from_single_line_array('$vars = array(' . implode(", ", $var_lines) . ');', false); + } + + /** + * Find the $vars array + * + * @return array List of variables + * @throws \LogicException + */ + public function get_vars_from_docblock() + { + $doc_vars = array(); + $current_doc_line = 1; + $found_comment_end = false; + while (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t") !== '/**') + { + if (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t ") === '*/') + { + $found_comment_end = true; + } + + if ($found_comment_end) + { + $var_line = trim($this->file_lines[$this->current_event_line - $current_doc_line]); + $var_line = preg_replace('!\s+!', ' ', $var_line); + if (strpos($var_line, '* @var ') === 0) + { + $doc_line = explode(' ', $var_line, 5); + if (sizeof($doc_line) !== 5) + { + throw new \LogicException("Found invalid line '{$this->file_lines[$this->current_event_line - $current_doc_line]}' " + . "for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1); + } + $doc_vars[] = $doc_line[3]; + } + } + + $current_doc_line++; + if ($current_doc_line > $this->current_event_line) + { + // Reached the start of the file + throw new \LogicException("Can not find end of docblock for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2); + } + } + + if (empty($doc_vars)) + { + // Reached the start of the file + throw new \LogicException("Can not find @var lines for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 3); + } + + foreach ($doc_vars as $var) + { + if (!preg_match('#^([a-zA-Z_][a-zA-Z0-9_]*)$#', $var)) + { + throw new \LogicException("Found invalid @var '{$var}' in docblock for event " + . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 4); + } + } + + sort($doc_vars); + return $doc_vars; + } + + /** + * Find the "@since" Information line + * + * @return int Absolute line number + * @throws \LogicException + */ + public function find_since() + { + return $this->find_tag('since', array('event', 'var')); + } + + /** + * Find the "@event" Information line + * + * @return int Absolute line number + */ + public function find_event() + { + return $this->find_tag('event', array()); + } + + /** + * Find a "@*" Information line + * + * @param string $find_tag Name of the tag we are trying to find + * @param array $disallowed_tags List of tags that must not appear between + * the tag and the actual event + * @return int Absolute line number + * @throws \LogicException + */ + public function find_tag($find_tag, $disallowed_tags) + { + $find_tag_line = 0; + $found_comment_end = false; + while (strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t "), '* @' . $find_tag . ' ') !== 0) + { + if ($found_comment_end && ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t") === '/**') + { + // Reached the start of this doc block + throw new \LogicException("Can not find '@{$find_tag}' information for event " + . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1); + } + + foreach ($disallowed_tags as $disallowed_tag) + { + if ($found_comment_end && strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t "), '* @' . $disallowed_tag) === 0) + { + // Found @var after the @since + throw new \LogicException("Found '@{$disallowed_tag}' information after '@{$find_tag}' for event " + . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 3); + } + } + + if (ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t ") === '*/') + { + $found_comment_end = true; + } + + $find_tag_line++; + if ($find_tag_line >= $this->current_event_line) + { + // Reached the start of the file + throw new \LogicException("Can not find '@{$find_tag}' information for event " + . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2); + } + } + + return $this->current_event_line - $find_tag_line; + } + + /** + * Find a "@*" Information line + * + * @return int Absolute line number + * @throws \LogicException + */ + public function find_description() + { + $find_desc_line = 0; + while (ltrim($this->file_lines[$this->current_event_line - $find_desc_line], "\t") !== '/**') + { + $find_desc_line++; + if ($find_desc_line > $this->current_event_line) + { + // Reached the start of the file + throw new \LogicException("Can not find a description for event " + . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1); + } + } + + $find_desc_line = $this->current_event_line - $find_desc_line + 1; + + $desc = trim($this->file_lines[$find_desc_line]); + if (strpos($desc, '* @') === 0 || $desc[0] !== '*' || substr($desc, 1) == '') + { + // First line of the doc block is a @-line, empty or only contains "*" + throw new \LogicException("Can not find a description for event " + . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2); + } + + return $find_desc_line; + } + + /** + * Validate "@since" Information + * + * @param string $line + * @return string + * @throws \LogicException + */ + public function validate_since($line) + { + $match = array(); + preg_match('#^\* @since (\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?)$#', ltrim($line, "\t "), $match); + if (!isset($match[1])) + { + throw new \LogicException("Invalid '@since' information for event " + . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'"); + } + + return $match[1]; + } + + /** + * Validate "@event" Information + * + * @param string $event_name + * @param string $line + * @return string + * @throws \LogicException + */ + public function validate_event($event_name, $line) + { + $event = substr(ltrim($line, "\t "), strlen('* @event ')); + + if ($event !== trim($event)) + { + throw new \LogicException("Invalid '@event' information for event " + . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1); + } + + if ($event !== $event_name) + { + throw new \LogicException("Event name does not match '@event' tag for event " + . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2); + } + + return $event; + } + + /** + * Validates that two arrays contain the same strings + * + * @param array $vars_array Variables found in the array line + * @param array $vars_docblock Variables found in the doc block + * @return null + * @throws \LogicException + */ + public function validate_vars_docblock_array($vars_array, $vars_docblock) + { + $vars_array = array_unique($vars_array); + $vars_docblock = array_unique($vars_docblock); + $sizeof_vars_array = sizeof($vars_array); + + if ($sizeof_vars_array !== sizeof($vars_docblock) || $sizeof_vars_array !== sizeof(array_intersect($vars_array, $vars_docblock))) + { + throw new \LogicException("\$vars array does not match the list of '@var' tags for event " + . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'"); + } + } +} diff --git a/sources/phpBB/phpbb/event/recursive_event_filter_iterator.php b/sources/phpBB/phpbb/event/recursive_event_filter_iterator.php new file mode 100644 index 0000000..64e2e56 --- /dev/null +++ b/sources/phpBB/phpbb/event/recursive_event_filter_iterator.php @@ -0,0 +1,71 @@ + +* @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; + +/** +* This filter ignores directories and files starting with a dot. +* It also skips some directories that do not contain events anyway, +* such as e.g. files/, store/ and vendor/ +*/ +class recursive_event_filter_iterator extends \RecursiveFilterIterator +{ + protected $root_path; + + /** + * Construct + * + * @param \RecursiveIterator $iterator + * @param string $root_path + */ + public function __construct(\RecursiveIterator $iterator, $root_path) + { + $this->root_path = str_replace(DIRECTORY_SEPARATOR, '/', $root_path); + parent::__construct($iterator); + } + + /** + * Return the inner iterator's children contained in a recursive_event_filter_iterator + * + * @return recursive_event_filter_iterator + */ + public function getChildren() + { + return new self($this->getInnerIterator()->getChildren(), $this->root_path); + } + + /** + * {@inheritDoc} + */ + public function accept() + { + $relative_path = str_replace(DIRECTORY_SEPARATOR, '/', $this->current()); + $filename = $this->current()->getFilename(); + + return (substr($relative_path, -4) === '.php' || $this->current()->isDir()) + && $filename[0] !== '.' + && strpos($relative_path, $this->root_path . 'cache/') !== 0 + && strpos($relative_path, $this->root_path . 'develop/') !== 0 + && strpos($relative_path, $this->root_path . 'docs/') !== 0 + && strpos($relative_path, $this->root_path . 'ext/') !== 0 + && strpos($relative_path, $this->root_path . 'files/') !== 0 + && strpos($relative_path, $this->root_path . 'includes/utf/') !== 0 + && strpos($relative_path, $this->root_path . 'language/') !== 0 + && strpos($relative_path, $this->root_path . 'phpbb/db/migration/data/') !== 0 + && strpos($relative_path, $this->root_path . 'phpbb/event/') !== 0 + && strpos($relative_path, $this->root_path . 'store/') !== 0 + && strpos($relative_path, $this->root_path . 'tests/') !== 0 + && strpos($relative_path, $this->root_path . 'vendor/') !== 0 + ; + } +} diff --git a/sources/phpBB/phpbb/exception/exception_interface.php b/sources/phpBB/phpbb/exception/exception_interface.php new file mode 100644 index 0000000..e8526a3 --- /dev/null +++ b/sources/phpBB/phpbb/exception/exception_interface.php @@ -0,0 +1,29 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\exception; + +/** + * Interface exception_interface + * + * Define an exception which support a language var as message. + */ +interface exception_interface +{ + /** + * Return the arguments associated with the message if it's a language var. + * + * @return array + */ + public function get_parameters(); +} diff --git a/sources/phpBB/phpbb/exception/http_exception.php b/sources/phpBB/phpbb/exception/http_exception.php new file mode 100644 index 0000000..0e6ffe4 --- /dev/null +++ b/sources/phpBB/phpbb/exception/http_exception.php @@ -0,0 +1,70 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\exception; + +use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; + +/** + * Class http_exception + */ +class http_exception extends runtime_exception implements HttpExceptionInterface +{ + /** + * Http status code. + * + * @var integer + */ + private $status_code; + + /** + * Additional headers to set in the response. + * + * @var array + */ + private $headers; + + /** + * Constructor + * + * @param integer $status_code The http status code. + * @param string $message The Exception message to throw (must be a language variable). + * @param array $parameters The parameters to use with the language var. + * @param \Exception $previous The previous exception used for the exception chaining. + * @param array $headers Additional headers to set in the response. + * @param integer $code The Exception code. + */ + public function __construct($status_code, $message = "", array $parameters = array(), \Exception $previous = null, array $headers = array(), $code = 0) + { + $this->status_code = $status_code; + $this->headers = $headers; + + parent::__construct($message, $parameters, $previous, $code); + } + + /** + * {@inheritdoc} + */ + public function getStatusCode() + { + return $this->status_code; + } + + /** + * {@inheritdoc} + */ + public function getHeaders() + { + return $this->headers; + } +} diff --git a/sources/phpBB/phpbb/exception/runtime_exception.php b/sources/phpBB/phpbb/exception/runtime_exception.php new file mode 100644 index 0000000..6568bbf --- /dev/null +++ b/sources/phpBB/phpbb/exception/runtime_exception.php @@ -0,0 +1,52 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\exception; + +/** + * Class runtime_exception + * + * Define an exception which support a language var as message. + */ +class runtime_exception extends \RuntimeException implements exception_interface +{ + /** + * Parameters to use with the language var. + * + * @var array + */ + private $parameters; + + /** + * Constructor + * + * @param string $message The Exception message to throw (must be a language variable). + * @param array $parameters The parameters to use with the language var. + * @param \Exception $previous The previous runtime_exception used for the runtime_exception chaining. + * @param integer $code The Exception code. + */ + public function __construct($message = "", array $parameters = array(), \Exception $previous = null, $code = 0) + { + $this->parameters = $parameters; + + parent::__construct($message, $code, $previous); + } + + /** + * {@inheritdoc} + */ + public function get_parameters() + { + return $this->parameters; + } +} diff --git a/sources/phpBB/phpbb/extension/base.php b/sources/phpBB/phpbb/extension/base.php new file mode 100644 index 0000000..5bb530b --- /dev/null +++ b/sources/phpBB/phpbb/extension/base.php @@ -0,0 +1,142 @@ + +* @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; + +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** +* A base class for extensions without custom enable/disable/purge code. +*/ +class base implements \phpbb\extension\extension_interface +{ + /** @var ContainerInterface */ + protected $container; + + /** @var \phpbb\finder */ + protected $finder; + + /** @var \phpbb\db\migrator */ + protected $migrator; + + /** @var string */ + protected $extension_name; + + /** @var string */ + protected $extension_path; + + /** @var string[] */ + private $migrations = false; + + /** + * Constructor + * + * @param ContainerInterface $container Container object + * @param \phpbb\finder $extension_finder + * @param \phpbb\db\migrator $migrator + * @param string $extension_name Name of this extension (from ext.manager) + * @param string $extension_path Relative path to this extension + */ + public function __construct(ContainerInterface $container, \phpbb\finder $extension_finder, \phpbb\db\migrator $migrator, $extension_name, $extension_path) + { + $this->container = $container; + $this->extension_finder = $extension_finder; + $this->migrator = $migrator; + + $this->extension_name = $extension_name; + $this->extension_path = $extension_path; + } + + /** + * {@inheritdoc} + */ + public function is_enableable() + { + return true; + } + + /** + * Single enable step that installs any included migrations + * + * @param mixed $old_state State returned by previous call of this method + * @return false Indicates no further steps are required + */ + public function enable_step($old_state) + { + $migrations = $this->get_migration_file_list(); + + $this->migrator->set_migrations($migrations); + + $this->migrator->update(); + + return !$this->migrator->finished(); + } + + /** + * Single disable step that does nothing + * + * @param mixed $old_state State returned by previous call of this method + * @return false Indicates no further steps are required + */ + public function disable_step($old_state) + { + return false; + } + + /** + * Single purge step that reverts any included and installed migrations + * + * @param mixed $old_state State returned by previous call of this method + * @return false Indicates no further steps are required + */ + public function purge_step($old_state) + { + $migrations = $this->get_migration_file_list(); + + $this->migrator->set_migrations($migrations); + + foreach ($migrations as $migration) + { + while ($this->migrator->migration_state($migration) !== false) + { + $this->migrator->revert($migration); + + return true; + } + } + + return false; + } + + /** + * Get the list of migration files from this extension + * + * @return array + */ + protected function get_migration_file_list() + { + if ($this->migrations !== false) + { + return $this->migrations; + } + + // Only have the finder search in this extension path directory + $migrations = $this->extension_finder + ->extension_directory('/migrations') + ->find_from_extension($this->extension_name, $this->extension_path); + + $migrations = $this->extension_finder->get_classes_from_files($migrations); + + return $migrations; + } +} diff --git a/sources/phpBB/phpbb/extension/exception.php b/sources/phpBB/phpbb/extension/exception.php new file mode 100644 index 0000000..3f7d251 --- /dev/null +++ b/sources/phpBB/phpbb/extension/exception.php @@ -0,0 +1,25 @@ + +* @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; + +/** + * Exception class for metadata + */ +class exception extends \UnexpectedValueException +{ + public function __toString() + { + return $this->getMessage(); + } +} diff --git a/sources/phpBB/phpbb/extension/extension_interface.php b/sources/phpBB/phpbb/extension/extension_interface.php new file mode 100644 index 0000000..6a6b6ad --- /dev/null +++ b/sources/phpBB/phpbb/extension/extension_interface.php @@ -0,0 +1,70 @@ + +* @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; + +/** +* The interface extension meta classes have to implement to run custom code +* on enable/disable/purge. +*/ +interface extension_interface +{ + /** + * Indicate whether or not the extension can be enabled. + * + * @return bool + */ + public function is_enableable(); + + /** + * enable_step is executed on enabling an extension until it returns false. + * + * Calls to this function can be made in subsequent requests, when the + * function is invoked through a webserver with a too low max_execution_time. + * + * @param mixed $old_state The return value of the previous call + * of this method, or false on the first call + * @return mixed Returns false after last step, otherwise + * temporary state which is passed as an + * argument to the next step + */ + public function enable_step($old_state); + + /** + * Disables the extension. + * + * Calls to this function can be made in subsequent requests, when the + * function is invoked through a webserver with a too low max_execution_time. + * + * @param mixed $old_state The return value of the previous call + * of this method, or false on the first call + * @return mixed Returns false after last step, otherwise + * temporary state which is passed as an + * argument to the next step + */ + public function disable_step($old_state); + + /** + * purge_step is executed on purging an extension until it returns false. + * + * Calls to this function can be made in subsequent requests, when the + * function is invoked through a webserver with a too low max_execution_time. + * + * @param mixed $old_state The return value of the previous call + * of this method, or false on the first call + * @return mixed Returns false after last step, otherwise + * temporary state which is passed as an + * argument to the next step + */ + public function purge_step($old_state); +} diff --git a/sources/phpBB/phpbb/extension/manager.php b/sources/phpBB/phpbb/extension/manager.php new file mode 100644 index 0000000..76f0e35 --- /dev/null +++ b/sources/phpBB/phpbb/extension/manager.php @@ -0,0 +1,598 @@ + +* @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; + +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** +* The extension manager provides means to activate/deactivate extensions. +*/ +class manager +{ + /** @var ContainerInterface */ + protected $container; + + protected $db; + protected $config; + protected $cache; + protected $user; + protected $php_ext; + protected $extensions; + protected $extension_table; + protected $phpbb_root_path; + protected $cache_name; + + /** + * Creates a manager and loads information from database + * + * @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 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') + { + $this->cache = $cache; + $this->cache_name = $cache_name; + $this->config = $config; + $this->container = $container; + $this->db = $db; + $this->extension_table = $extension_table; + $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; + + if ($this->extensions === false) + { + $this->load_extensions(); + } + } + + /** + * Loads all extension information from the database + * + * @return null + */ + public function load_extensions() + { + $this->extensions = array(); + + // Do not try to load any extensions if the extension table + // does not exist or when installing or updating. + // Note: database updater invokes this code, and in 3.0 + // there is no extension table therefore the rest of this function + // fails + if (defined('IN_INSTALL') || version_compare($this->config['version'], '3.1.0-dev', '<')) + { + return; + } + + $sql = 'SELECT * + FROM ' . $this->extension_table; + + $result = $this->db->sql_query($sql); + $extensions = $this->db->sql_fetchrowset($result); + $this->db->sql_freeresult($result); + + foreach ($extensions as $extension) + { + $extension['ext_path'] = $this->get_extension_path($extension['ext_name']); + $this->extensions[$extension['ext_name']] = $extension; + } + + ksort($this->extensions); + + if ($this->cache) + { + $this->cache->put($this->cache_name, $this->extensions); + } + } + + /** + * Generates the path to an extension + * + * @param string $name The name of the extension + * @param bool $phpbb_relative Whether the path should be relative to phpbb root + * @return string Path to an extension + */ + public function get_extension_path($name, $phpbb_relative = false) + { + $name = str_replace('.', '', $name); + + return (($phpbb_relative) ? $this->phpbb_root_path : '') . 'ext/' . $name . '/'; + } + + /** + * Instantiates the extension meta class for the extension with the given name + * + * @param string $name The extension name + * @return \phpbb\extension\extension_interface Instance of the extension meta class or + * \phpbb\extension\base if the class does not exist + */ + public function get_extension($name) + { + $extension_class_name = str_replace('/', '\\', $name) . '\\ext'; + + $migrator = $this->container->get('migrator'); + + if (class_exists($extension_class_name)) + { + return new $extension_class_name($this->container, $this->get_finder(), $migrator, $name, $this->get_extension_path($name, true)); + } + else + { + return new \phpbb\extension\base($this->container, $this->get_finder(), $migrator, $name, $this->get_extension_path($name, true)); + } + } + + /** + * Instantiates the metadata manager for the extension with the given name + * + * @param string $name The extension name + * @param \phpbb\template\template $template The template manager + * @return \phpbb\extension\metadata_manager Instance of the metadata 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); + } + + /** + * Runs a step of the extension enabling process. + * + * Allows the exentension to enable in a long running script that works + * in multiple steps across requests. State is kept for the extension + * in the extensions table. + * + * @param string $name The extension's name + * @return bool False if enabling is finished, true otherwise + */ + public function enable_step($name) + { + // ignore extensions that are already enabled + if (isset($this->extensions[$name]) && $this->extensions[$name]['ext_active']) + { + return false; + } + + $old_state = (isset($this->extensions[$name]['ext_state'])) ? unserialize($this->extensions[$name]['ext_state']) : false; + + $extension = $this->get_extension($name); + + if (!$extension->is_enableable()) + { + return false; + } + + $state = $extension->enable_step($old_state); + + $active = ($state === false); + + $extension_data = array( + 'ext_name' => $name, + 'ext_active' => $active, + 'ext_state' => serialize($state), + ); + + $this->extensions[$name] = $extension_data; + $this->extensions[$name]['ext_path'] = $this->get_extension_path($extension_data['ext_name']); + ksort($this->extensions); + + $sql = 'SELECT COUNT(ext_name) as row_count + FROM ' . $this->extension_table . " + WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; + $result = $this->db->sql_query($sql); + $count = $this->db->sql_fetchfield('row_count'); + $this->db->sql_freeresult($result); + + if ($count) + { + $sql = 'UPDATE ' . $this->extension_table . ' + SET ' . $this->db->sql_build_array('UPDATE', $extension_data) . " + WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; + $this->db->sql_query($sql); + } + else + { + $sql = 'INSERT INTO ' . $this->extension_table . ' + ' . $this->db->sql_build_array('INSERT', $extension_data); + $this->db->sql_query($sql); + } + + if ($this->cache) + { + $this->cache->purge(); + } + + if ($active) + { + $this->config->increment('assets_version', 1); + } + + return !$active; + } + + /** + * Enables an extension + * + * This method completely enables an extension. But it could be long running + * so never call this in a script that has a max_execution time. + * + * @param string $name The extension's name + * @return null + */ + public function enable($name) + { + // @codingStandardsIgnoreStart + while ($this->enable_step($name)); + // @codingStandardsIgnoreEnd + } + + /** + * Disables an extension + * + * Calls the disable method on the extension's meta class to allow it to + * process the event. + * + * @param string $name The extension's name + * @return bool False if disabling is finished, true otherwise + */ + public function disable_step($name) + { + // ignore extensions that are already disabled + if (!isset($this->extensions[$name]) || !$this->extensions[$name]['ext_active']) + { + return false; + } + + $old_state = unserialize($this->extensions[$name]['ext_state']); + + $extension = $this->get_extension($name); + $state = $extension->disable_step($old_state); + + // continue until the state is false + if ($state !== false) + { + $extension_data = array( + 'ext_state' => serialize($state), + ); + $this->extensions[$name]['ext_state'] = serialize($state); + + $sql = 'UPDATE ' . $this->extension_table . ' + SET ' . $this->db->sql_build_array('UPDATE', $extension_data) . " + WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; + $this->db->sql_query($sql); + + if ($this->cache) + { + $this->cache->purge(); + } + + return true; + } + + $extension_data = array( + 'ext_active' => false, + 'ext_state' => serialize(false), + ); + $this->extensions[$name]['ext_active'] = false; + $this->extensions[$name]['ext_state'] = serialize(false); + + $sql = 'UPDATE ' . $this->extension_table . ' + SET ' . $this->db->sql_build_array('UPDATE', $extension_data) . " + WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; + $this->db->sql_query($sql); + + if ($this->cache) + { + $this->cache->purge(); + } + + return false; + } + + /** + * Disables an extension + * + * Disables an extension completely at once. This process could run for a + * while so never call this in a script that has a max_execution time. + * + * @param string $name The extension's name + * @return null + */ + public function disable($name) + { + // @codingStandardsIgnoreStart + while ($this->disable_step($name)); + // @codingStandardsIgnoreEnd + } + + /** + * Purge an extension + * + * Disables the extension first if active, and then calls purge on the + * extension's meta class to delete the extension's database content. + * + * @param string $name The extension's name + * @return bool False if purging is finished, true otherwise + */ + public function purge_step($name) + { + // ignore extensions that do not exist + if (!isset($this->extensions[$name])) + { + return false; + } + + // disable first if necessary + if ($this->extensions[$name]['ext_active']) + { + $this->disable($name); + } + + $old_state = unserialize($this->extensions[$name]['ext_state']); + + $extension = $this->get_extension($name); + $state = $extension->purge_step($old_state); + + // continue until the state is false + if ($state !== false) + { + $extension_data = array( + 'ext_state' => serialize($state), + ); + $this->extensions[$name]['ext_state'] = serialize($state); + + $sql = 'UPDATE ' . $this->extension_table . ' + SET ' . $this->db->sql_build_array('UPDATE', $extension_data) . " + WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; + $this->db->sql_query($sql); + + if ($this->cache) + { + $this->cache->purge(); + } + + return true; + } + + unset($this->extensions[$name]); + + $sql = 'DELETE FROM ' . $this->extension_table . " + WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; + $this->db->sql_query($sql); + + if ($this->cache) + { + $this->cache->purge(); + } + + return false; + } + + /** + * Purge an extension + * + * Purges an extension completely at once. This process could run for a while + * so never call this in a script that has a max_execution time. + * + * @param string $name The extension's name + * @return null + */ + public function purge($name) + { + // @codingStandardsIgnoreStart + while ($this->purge_step($name)); + // @codingStandardsIgnoreEnd + } + + /** + * Retrieves a list of all available extensions on the filesystem + * + * @return array An array with extension names as keys and paths to the + * extension as values + */ + public function all_available() + { + $available = array(); + if (!is_dir($this->phpbb_root_path . 'ext/')) + { + return $available; + } + + $iterator = new \RecursiveIteratorIterator( + new \phpbb\recursive_dot_prefix_filter_iterator( + new \RecursiveDirectoryIterator($this->phpbb_root_path . 'ext/', \FilesystemIterator::NEW_CURRENT_AND_KEY | \FilesystemIterator::FOLLOW_SYMLINKS) + ), + \RecursiveIteratorIterator::SELF_FIRST + ); + $iterator->setMaxDepth(2); + + foreach ($iterator as $file_info) + { + if ($file_info->isFile() && $file_info->getFilename() == 'composer.json') + { + $ext_name = $iterator->getInnerIterator()->getSubPath(); + $composer_file = $iterator->getPath() . '/composer.json'; + + // Ignore the extension if there is no composer.json. + if (!is_readable($composer_file) || !($ext_info = file_get_contents($composer_file))) + { + continue; + } + + $ext_info = json_decode($ext_info, true); + $ext_name = str_replace(DIRECTORY_SEPARATOR, '/', $ext_name); + + // Ignore the extension if directory depth is not correct or if the directory structure + // does not match the name value specified in composer.json. + if (substr_count($ext_name, '/') !== 1 || !isset($ext_info['name']) || $ext_name != $ext_info['name']) + { + continue; + } + + $available[$ext_name] = $this->phpbb_root_path . 'ext/' . $ext_name . '/'; + } + } + ksort($available); + return $available; + } + + /** + * Retrieves all configured extensions. + * + * All enabled and disabled extensions are considered configured. A purged + * extension that is no longer in the database is not configured. + * + * @return array An array with extension names as keys and and the + * database stored extension information as values + */ + public function all_configured() + { + $configured = array(); + foreach ($this->extensions as $name => $data) + { + $data['ext_path'] = $this->phpbb_root_path . $data['ext_path']; + $configured[$name] = $data; + } + return $configured; + } + + /** + * Retrieves all enabled extensions. + * + * @return array An array with extension names as keys and and the + * database stored extension information as values + */ + public function all_enabled() + { + $enabled = array(); + foreach ($this->extensions as $name => $data) + { + if ($data['ext_active']) + { + $enabled[$name] = $this->phpbb_root_path . $data['ext_path']; + } + } + return $enabled; + } + + /** + * Retrieves all disabled extensions. + * + * @return array An array with extension names as keys and and the + * database stored extension information as values + */ + public function all_disabled() + { + $disabled = array(); + foreach ($this->extensions as $name => $data) + { + if (!$data['ext_active']) + { + $disabled[$name] = $this->phpbb_root_path . $data['ext_path']; + } + } + return $disabled; + } + + /** + * Check to see if a given extension is available on the filesystem + * + * @param string $name Extension name to check NOTE: Can be user input + * @return bool Depending on whether or not the extension is available + */ + public function is_available($name) + { + return file_exists($this->get_extension_path($name, true)); + } + + /** + * Check to see if a given extension is enabled + * + * @param string $name Extension name to check + * @return bool Depending on whether or not the extension is enabled + */ + public function is_enabled($name) + { + return isset($this->extensions[$name]) && $this->extensions[$name]['ext_active']; + } + + /** + * Check to see if a given extension is disabled + * + * @param string $name Extension name to check + * @return bool Depending on whether or not the extension is disabled + */ + public function is_disabled($name) + { + return isset($this->extensions[$name]) && !$this->extensions[$name]['ext_active']; + } + + /** + * Check to see if a given extension is configured + * + * All enabled and disabled extensions are considered configured. A purged + * extension that is no longer in the database is not configured. + * + * @param string $name Extension name to check + * @return bool Depending on whether or not the extension is configured + */ + public function is_configured($name) + { + return isset($this->extensions[$name]); + } + + /** + * Check to see if a given extension is purged + * + * An extension is purged if it is available, not enabled and not disabled. + * + * @param string $name Extension name to check + * @return bool Depending on whether or not the extension is purged + */ + public function is_purged($name) + { + return $this->is_available($name) && !$this->is_configured($name); + } + + /** + * Instantiates a \phpbb\finder. + * + * @param bool $use_all_available Should we load all extensions, or just enabled ones + * @return \phpbb\finder An extension finder instance + */ + public function get_finder($use_all_available = false) + { + $finder = new \phpbb\finder($this->filesystem, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder'); + if ($use_all_available) + { + $finder->set_extensions(array_keys($this->all_available())); + } + else + { + $finder->set_extensions(array_keys($this->all_enabled())); + } + return $finder; + } +} diff --git a/sources/phpBB/phpbb/extension/metadata_manager.php b/sources/phpBB/phpbb/extension/metadata_manager.php new file mode 100644 index 0000000..a64d88f --- /dev/null +++ b/sources/phpBB/phpbb/extension/metadata_manager.php @@ -0,0 +1,379 @@ + +* @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; + +/** +* The extension metadata manager validates and gets meta-data for extensions +*/ +class metadata_manager +{ + /** + * phpBB Config instance + * @var \phpbb\config\config + */ + protected $config; + + /** + * phpBB Extension Manager + * @var \phpbb\extension\manager + */ + protected $extension_manager; + + /** + * phpBB Template instance + * @var \phpbb\template\template + */ + protected $template; + + /** + * phpBB User instance + * @var \phpbb\user + */ + protected $user; + + /** + * phpBB root path + * @var string + */ + protected $phpbb_root_path; + + /** + * Name (including vendor) of the extension + * @var string + */ + protected $ext_name; + + /** + * Metadata from the composer.json file + * @var array + */ + protected $metadata; + + /** + * Link (including root path) to the metadata file + * @var string + */ + protected $metadata_file; + + /** + * Creates the metadata manager + * + * @param string $ext_name Name (including vendor) of the extension + * @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) + { + $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; + $this->metadata = array(); + $this->metadata_file = ''; + } + + /** + * Processes and gets the metadata requested + * + * @param string $element All for all metadata that it has and is valid, otherwise specify which section you want by its shorthand term. + * @return array Contains all of the requested metadata, throws an exception on failure + */ + public function get_metadata($element = 'all') + { + $this->set_metadata_file(); + + // Fetch the metadata + $this->fetch_metadata(); + + // Clean the metadata + $this->clean_metadata_array(); + + switch ($element) + { + case 'all': + default: + // Validate the metadata + if (!$this->validate()) + { + return false; + } + + return $this->metadata; + break; + + case 'name': + return ($this->validate('name')) ? $this->metadata['name'] : false; + break; + + case 'display-name': + if (isset($this->metadata['extra']['display-name'])) + { + return $this->metadata['extra']['display-name']; + } + else + { + return ($this->validate('name')) ? $this->metadata['name'] : false; + } + break; + } + } + + /** + * Sets the filepath of the metadata file + * + * @throws \phpbb\extension\exception + */ + private function set_metadata_file() + { + $ext_filepath = $this->extension_manager->get_extension_path($this->ext_name); + $metadata_filepath = $this->phpbb_root_path . $ext_filepath . 'composer.json'; + + $this->metadata_file = $metadata_filepath; + + if (!file_exists($this->metadata_file)) + { + throw new \phpbb\extension\exception($this->user->lang('FILE_NOT_FOUND', $this->metadata_file)); + } + } + + /** + * Gets the contents of the composer.json file + * + * @return bool True if success, throws an exception on failure + * @throws \phpbb\extension\exception + */ + private function fetch_metadata() + { + if (!file_exists($this->metadata_file)) + { + throw new \phpbb\extension\exception($this->user->lang('FILE_NOT_FOUND', $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)); + } + + if (($metadata = json_decode($file_contents, true)) === null) + { + throw new \phpbb\extension\exception($this->user->lang('FILE_JSON_DECODE_ERR', $this->metadata_file)); + } + + array_walk_recursive($metadata, array($this, 'sanitize_json')); + $this->metadata = $metadata; + + return true; + } + } + + /** + * Sanitize input from JSON array using htmlspecialchars() + * + * @param mixed $value Value of array row + * @param string $key Key of array row + */ + public function sanitize_json(&$value, $key) + { + $value = htmlspecialchars($value); + } + + /** + * This array handles the cleaning of the array + * + * @return array Contains the cleaned metadata array + */ + private function clean_metadata_array() + { + return $this->metadata; + } + + /** + * Validate fields + * + * @param string $name ("all" for display and enable validation + * "display" for name, type, and authors + * "name", "type") + * @return Bool True if valid, throws an exception if invalid + * @throws \phpbb\extension\exception + */ + public function validate($name = 'display') + { + // Basic fields + $fields = array( + 'name' => '#^[a-zA-Z0-9_\x7f-\xff]{2,}/[a-zA-Z0-9_\x7f-\xff]{2,}$#', + 'type' => '#^phpbb-extension$#', + 'license' => '#.+#', + 'version' => '#.+#', + ); + + switch ($name) + { + case 'all': + $this->validate('display'); + + $this->validate_enable(); + break; + + case 'display': + foreach ($fields as $field => $data) + { + $this->validate($field); + } + + $this->validate_authors(); + break; + + default: + if (isset($fields[$name])) + { + if (!isset($this->metadata[$name])) + { + throw new \phpbb\extension\exception($this->user->lang('META_FIELD_NOT_SET', $name)); + } + + if (!preg_match($fields[$name], $this->metadata[$name])) + { + throw new \phpbb\extension\exception($this->user->lang('META_FIELD_INVALID', $name)); + } + } + break; + } + + return true; + } + + /** + * Validates the contents of the authors field + * + * @return boolean True when passes validation, throws exception if invalid + * @throws \phpbb\extension\exception + */ + public function validate_authors() + { + if (empty($this->metadata['authors'])) + { + throw new \phpbb\extension\exception($this->user->lang('META_FIELD_NOT_SET', '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')); + } + } + + return true; + } + + /** + * This array handles the verification that this extension can be enabled on this board + * + * @return bool True if validation succeeded, False if failed + */ + public function validate_enable() + { + // Check for valid directory & phpBB, PHP versions + if (!$this->validate_dir() || !$this->validate_require_phpbb() || !$this->validate_require_php()) + { + return false; + } + + return true; + } + + /** + * Validates the most basic directory structure to ensure it follows / convention. + * + * @return boolean True when passes validation + */ + public function validate_dir() + { + return (substr_count($this->ext_name, '/') === 1 && $this->ext_name == $this->get_metadata('name')); + } + + + /** + * Validates the contents of the phpbb requirement field + * + * @return boolean True when passes validation + */ + public function validate_require_phpbb() + { + if (!isset($this->metadata['extra']['soft-require']['phpbb/phpbb'])) + { + return false; + } + + return true; + } + + /** + * Validates the contents of the php requirement field + * + * @return boolean True when passes validation + */ + public function validate_require_php() + { + if (!isset($this->metadata['require']['php'])) + { + return false; + } + + return true; + } + + /** + * Outputs the metadata into the template + * + * @return null + */ + public function output_template_data() + { + $this->template->assign_vars(array( + 'META_NAME' => $this->metadata['name'], + 'META_TYPE' => $this->metadata['type'], + 'META_DESCRIPTION' => (isset($this->metadata['description'])) ? $this->metadata['description'] : '', + 'META_HOMEPAGE' => (isset($this->metadata['homepage'])) ? $this->metadata['homepage'] : '', + 'META_VERSION' => (isset($this->metadata['version'])) ? $this->metadata['version'] : '', + 'META_TIME' => (isset($this->metadata['time'])) ? $this->metadata['time'] : '', + 'META_LICENSE' => $this->metadata['license'], + + 'META_REQUIRE_PHP' => (isset($this->metadata['require']['php'])) ? $this->metadata['require']['php'] : '', + 'META_REQUIRE_PHP_FAIL' => !$this->validate_require_php(), + + 'META_REQUIRE_PHPBB' => (isset($this->metadata['extra']['soft-require']['phpbb/phpbb'])) ? $this->metadata['extra']['soft-require']['phpbb/phpbb'] : '', + 'META_REQUIRE_PHPBB_FAIL' => !$this->validate_require_phpbb(), + + 'META_DISPLAY_NAME' => (isset($this->metadata['extra']['display-name'])) ? $this->metadata['extra']['display-name'] : '', + )); + + foreach ($this->metadata['authors'] as $author) + { + $this->template->assign_block_vars('meta_authors', array( + 'AUTHOR_NAME' => $author['name'], + 'AUTHOR_EMAIL' => (isset($author['email'])) ? $author['email'] : '', + 'AUTHOR_HOMEPAGE' => (isset($author['homepage'])) ? $author['homepage'] : '', + 'AUTHOR_ROLE' => (isset($author['role'])) ? $author['role'] : '', + )); + } + } +} diff --git a/sources/phpBB/phpbb/extension/provider.php b/sources/phpBB/phpbb/extension/provider.php new file mode 100644 index 0000000..1c42cf7 --- /dev/null +++ b/sources/phpBB/phpbb/extension/provider.php @@ -0,0 +1,72 @@ + +* @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; + +/** +* Provides a set of items found in extensions. +* +* This abstract class is essentially a wrapper around item-specific +* finding logic. It handles storing the extension manager via constructor +* for the finding logic to use to find the items, and provides an +* iterator interface over the items found by the finding logic. +* +* Items could be anything, for example template paths or cron task names. +* Derived classes completely define what the items are. +*/ +abstract class provider implements \IteratorAggregate +{ + /** + * Array holding all found items + * @var array|null + */ + protected $items = null; + + /** + * An extension manager to search for items in extensions + * @var \phpbb\extension\manager + */ + protected $extension_manager; + + /** + * Constructor. Loads all available items. + * + * @param \phpbb\extension\manager $extension_manager phpBB extension manager + */ + public function __construct(\phpbb\extension\manager $extension_manager) + { + $this->extension_manager = $extension_manager; + } + + /** + * Finds items using the extension manager. + * + * @return array List of task names + */ + abstract protected function find(); + + /** + * Retrieve an iterator over all items + * + * @return \ArrayIterator An iterator for the array of template paths + */ + public function getIterator() + { + if ($this->items === null) + { + $this->items = $this->find(); + } + + return new \ArrayIterator($this->items); + } +} diff --git a/sources/phpBB/phpbb/feed/attachments_base.php b/sources/phpBB/phpbb/feed/attachments_base.php new file mode 100644 index 0000000..04812f1 --- /dev/null +++ b/sources/phpBB/phpbb/feed/attachments_base.php @@ -0,0 +1,85 @@ + +* @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 feeds displaying attachments +*/ +abstract class attachments_base extends \phpbb\feed\base +{ + /** + * Attachments that may be displayed + */ + protected $attachments = array(); + + /** + * Retrieve the list of attachments that may be displayed + */ + protected function fetch_attachments() + { + $sql_array = array( + 'SELECT' => 'a.*', + 'FROM' => array( + ATTACHMENTS_TABLE => 'a' + ), + 'WHERE' => 'a.in_message = 0 ', + 'ORDER_BY' => 'a.filetime DESC, a.post_msg_id ASC', + ); + + if (isset($this->topic_id)) + { + $sql_array['WHERE'] .= 'AND a.topic_id = ' . (int) $this->topic_id; + } + else if (isset($this->forum_id)) + { + $sql_array['LEFT_JOIN'] = array( + array( + 'FROM' => array(TOPICS_TABLE => 't'), + 'ON' => 'a.topic_id = t.topic_id', + ) + ); + $sql_array['WHERE'] .= 'AND t.forum_id = ' . (int) $this->forum_id; + } + + $sql = $this->db->sql_build_query('SELECT', $sql_array); + $result = $this->db->sql_query($sql); + + // Set attachments in feed items + while ($row = $this->db->sql_fetchrow($result)) + { + $this->attachments[$row['post_msg_id']][] = $row; + } + $this->db->sql_freeresult($result); + } + + /** + * {@inheritDoc} + */ + public function open() + { + parent::open(); + $this->fetch_attachments(); + } + + /** + * Get attachments related to a given post + * + * @param $post_id int Post id + * @return mixed Attachments related to $post_id + */ + public function get_attachments($post_id) + { + return $this->attachments[$post_id]; + } +} diff --git a/sources/phpBB/phpbb/feed/base.php b/sources/phpBB/phpbb/feed/base.php new file mode 100644 index 0000000..e318541 --- /dev/null +++ b/sources/phpBB/phpbb/feed/base.php @@ -0,0 +1,262 @@ + +* @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 +{ + /** + * Feed helper object + * @var \phpbb\feed\helper + */ + protected $helper; + + /** @var \phpbb\config\config */ + protected $config; + + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + /** @var \phpbb\cache\driver\driver_interface */ + protected $cache; + + /** @var \phpbb\user */ + protected $user; + + /** @var \phpbb\auth\auth */ + protected $auth; + + /** @var string */ + protected $phpEx; + + /** + * SQL Query to be executed to get feed items + */ + var $sql = array(); + + /** + * Keys specified for retrieval of title, content, etc. + */ + var $keys = array(); + + /** + * Number of items to fetch. Usually overwritten by $config['feed_something'] + */ + var $num_items = 15; + + /** + * Separator for title elements to separate items (for example forum / topic) + */ + var $separator = "\xE2\x80\xA2"; // • + + /** + * Separator for the statistics row (Posted by, post date, replies, etc.) + */ + var $separator_stats = "\xE2\x80\x94"; // — + + /** + * 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) + { + $this->config = $config; + $this->helper = $helper; + $this->db = $db; + $this->cache = $cache; + $this->user = $user; + $this->auth = $auth; + $this->content_visibility = $content_visibility; + $this->phpEx = $phpEx; + + $this->set_keys(); + + // Allow num_items to be string + if (is_string($this->num_items)) + { + $this->num_items = (int) $this->config[$this->num_items]; + + // A precaution + if (!$this->num_items) + { + $this->num_items = 10; + } + } + } + + /** + * Set keys. + */ + function set_keys() + { + } + + /** + * Open feed + */ + function open() + { + } + + /** + * Close feed + */ + function close() + { + if (!empty($this->result)) + { + $this->db->sql_freeresult($this->result); + } + } + + /** + * Set key + * + * @param string $key Key + * @param mixed $value Value + */ + function set($key, $value) + { + $this->keys[$key] = $value; + } + + /** + * Get key + * + * @param string $key Key + * @return mixed + */ + function get($key) + { + return (isset($this->keys[$key])) ? $this->keys[$key] : null; + } + + function get_readable_forums() + { + static $forum_ids; + + if (!isset($forum_ids)) + { + $forum_ids = array_keys($this->auth->acl_getf('f_read', true)); + } + + return $forum_ids; + } + + function get_moderator_approve_forums() + { + static $forum_ids; + + if (!isset($forum_ids)) + { + $forum_ids = array_keys($this->auth->acl_getf('m_approve', true)); + } + + return $forum_ids; + } + + function is_moderator_approve_forum($forum_id) + { + static $forum_ids; + + if (!isset($forum_ids)) + { + $forum_ids = array_flip($this->get_moderator_approve_forums()); + } + + return (isset($forum_ids[$forum_id])) ? true : false; + } + + function get_excluded_forums() + { + static $forum_ids; + + // Matches acp/acp_board.php + $cache_name = 'feed_excluded_forum_ids'; + + if (!isset($forum_ids) && ($forum_ids = $this->cache->get('_' . $cache_name)) === false) + { + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + WHERE ' . $this->db->sql_bit_and('forum_options', FORUM_OPTION_FEED_EXCLUDE, '<> 0'); + $result = $this->db->sql_query($sql); + + $forum_ids = array(); + while ($forum_id = (int) $this->db->sql_fetchfield('forum_id')) + { + $forum_ids[$forum_id] = $forum_id; + } + $this->db->sql_freeresult($result); + + $this->cache->put('_' . $cache_name, $forum_ids); + } + + return $forum_ids; + } + + function is_excluded_forum($forum_id) + { + $forum_ids = $this->get_excluded_forums(); + + return isset($forum_ids[$forum_id]) ? true : false; + } + + function get_passworded_forums() + { + return $this->user->get_passworded_forums(); + } + + function get_item() + { + static $result; + + if (!isset($result)) + { + if (!$this->get_sql()) + { + return false; + } + + // Query database + $sql = $this->db->sql_build_query('SELECT', $this->sql); + $result = $this->db->sql_query_limit($sql, $this->num_items); + } + + return $this->db->sql_fetchrow($result); + } + + function user_viewprofile($row) + { + $author_id = (int) $row[$this->get('author_id')]; + + if ($author_id == ANONYMOUS) + { + // Since we cannot link to a profile, we just return GUEST + // instead of $row['username'] + return $this->user->lang['GUEST']; + } + + return '' . $row[$this->get('creator')] . ''; + } +} diff --git a/sources/phpBB/phpbb/feed/factory.php b/sources/phpBB/phpbb/feed/factory.php new file mode 100644 index 0000000..f364f06 --- /dev/null +++ b/sources/phpBB/phpbb/feed/factory.php @@ -0,0 +1,127 @@ + +* @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/sources/phpBB/phpbb/feed/forum.php b/sources/phpBB/phpbb/feed/forum.php new file mode 100644 index 0000000..7a2087c --- /dev/null +++ b/sources/phpBB/phpbb/feed/forum.php @@ -0,0 +1,144 @@ + +* @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; + +/** +* Forum feed +* +* This will give you the last {$this->num_items} posts made +* within a specific forum. +*/ +class forum extends \phpbb\feed\post_base +{ + var $forum_id = 0; + var $forum_data = array(); + + /** + * 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; + + return $this; + } + + function open() + { + // Check if forum exists + $sql = 'SELECT forum_id, forum_name, forum_password, forum_type, forum_options + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $this->forum_id; + $result = $this->db->sql_query($sql); + $this->forum_data = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (empty($this->forum_data)) + { + trigger_error('NO_FORUM'); + } + + // Forum needs to be postable + if ($this->forum_data['forum_type'] != FORUM_POST) + { + trigger_error('NO_FEED'); + } + + // Make sure forum is not excluded from feed + if (phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $this->forum_data['forum_options'])) + { + trigger_error('NO_FEED'); + } + + // Make sure we can read this forum + if (!$this->auth->acl_get('f_read', $this->forum_id)) + { + trigger_error('SORRY_AUTH_READ'); + } + + // Make sure forum is not passworded or user is authed + if ($this->forum_data['forum_password']) + { + $forum_ids_passworded = $this->get_passworded_forums(); + + if (isset($forum_ids_passworded[$this->forum_id])) + { + trigger_error('SORRY_AUTH_READ'); + } + + unset($forum_ids_passworded); + } + + parent::open(); + } + + function get_sql() + { + // Determine topics with recent activity + $sql = 'SELECT topic_id, topic_last_post_time + FROM ' . TOPICS_TABLE . ' + WHERE forum_id = ' . $this->forum_id . ' + AND topic_moved_id = 0 + AND ' . $this->content_visibility->get_visibility_sql('topic', $this->forum_id) . ' + ORDER BY topic_last_post_time DESC, topic_last_post_id DESC'; + $result = $this->db->sql_query_limit($sql, $this->num_items); + + $topic_ids = array(); + $min_post_time = 0; + while ($row = $this->db->sql_fetchrow()) + { + $topic_ids[] = (int) $row['topic_id']; + + $min_post_time = (int) $row['topic_last_post_time']; + } + $this->db->sql_freeresult($result); + + if (empty($topic_ids)) + { + return false; + } + + $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', + 'FROM' => array( + POSTS_TABLE => 'p', + USERS_TABLE => 'u', + ), + 'WHERE' => $this->db->sql_in_set('p.topic_id', $topic_ids) . ' + AND ' . $this->content_visibility->get_visibility_sql('post', $this->forum_id, 'p.') . ' + AND p.post_time >= ' . $min_post_time . ' + AND p.poster_id = u.user_id', + 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC', + ); + + return true; + } + + function adjust_item(&$item_row, &$row) + { + parent::adjust_item($item_row, $row); + + $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title']; + $item_row['forum_id'] = $this->forum_id; + } + + function get_item() + { + return ($row = parent::get_item()) ? array_merge($this->forum_data, $row) : $row; + } +} diff --git a/sources/phpBB/phpbb/feed/forums.php b/sources/phpBB/phpbb/feed/forums.php new file mode 100644 index 0000000..ee14a5b --- /dev/null +++ b/sources/phpBB/phpbb/feed/forums.php @@ -0,0 +1,68 @@ + +* @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 +{ + var $num_items = 0; + + function set_keys() + { + $this->set('title', 'forum_name'); + $this->set('text', 'forum_desc'); + $this->set('bitfield', 'forum_desc_bitfield'); + $this->set('bbcode_uid','forum_desc_uid'); + $this->set('updated', 'forum_last_post_time'); + $this->set('options', 'forum_desc_options'); + } + + function get_sql() + { + $in_fid_ary = array_diff($this->get_readable_forums(), $this->get_excluded_forums()); + if (empty($in_fid_ary)) + { + return false; + } + + // Build SQL Query + $this->sql = array( + 'SELECT' => 'f.forum_id, f.left_id, f.forum_name, f.forum_last_post_time, + f.forum_desc, f.forum_desc_bitfield, f.forum_desc_uid, f.forum_desc_options, + f.forum_topics_approved, f.forum_posts_approved', + 'FROM' => array(FORUMS_TABLE => 'f'), + 'WHERE' => 'f.forum_type = ' . FORUM_POST . ' + AND ' . $this->db->sql_in_set('f.forum_id', $in_fid_ary), + 'ORDER_BY' => 'f.left_id ASC', + ); + + return true; + } + + function adjust_item(&$item_row, &$row) + { + $item_row['link'] = $this->helper->append_sid('viewforum.' . $this->phpEx, 'f=' . $row['forum_id']); + + if ($this->config['feed_item_statistics']) + { + $item_row['statistics'] = $this->user->lang('TOTAL_TOPICS', (int) $row['forum_topics_approved']) + . ' ' . $this->separator_stats . ' ' . $this->user->lang('TOTAL_POSTS_COUNT', (int) $row['forum_posts_approved']); + } + } +} diff --git a/sources/phpBB/phpbb/feed/helper.php b/sources/phpBB/phpbb/feed/helper.php new file mode 100644 index 0000000..198134c --- /dev/null +++ b/sources/phpBB/phpbb/feed/helper.php @@ -0,0 +1,181 @@ + +* @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 helper +{ + /** @var \phpbb\config\config */ + protected $config; + + /** @var \phpbb\user */ + protected $user; + + /** @var string */ + protected $phpbb_root_path; + + /** @var string */ + 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 + */ + public function __construct(\phpbb\config\config $config, \phpbb\user $user, $phpbb_root_path, $phpEx) + { + $this->config = $config; + $this->user = $user; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpEx = $phpEx; + } + + /** + * Run links through append_sid(), prepend generate_board_url() and remove session id + */ + public function get_board_url() + { + static $board_url; + + if (empty($board_url)) + { + $board_url = generate_board_url(); + } + + return $board_url; + } + + /** + * 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) + */ + public function format_date($time) + { + static $zone_offset; + static $offset_string; + + if (empty($offset_string)) + { + $zone_offset = $this->user->create_datetime()->getOffset(); + $offset_string = phpbb_format_timezone_offset($zone_offset); + } + + return gmdate("Y-m-d\TH:i:s", $time + $zone_offset) . $offset_string; + } + + /** + * 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)) + { + return ''; + } + + // Prepare some bbcodes for better parsing + $content = preg_replace("#\[quote(=".*?")?:$uid\]\s*(.*?)\s*\[/quote:$uid\]#si", "[quote$1:$uid]
$2
[/quote:$uid]", $content); + + $content = generate_text_for_display($content, $uid, $bitfield, $options); + + // Add newlines + $content = str_replace('
', '
' . "\n", $content); + + // Convert smiley Relative paths to Absolute path, Windows style + $content = str_replace($this->phpbb_root_path . $this->config['smilies_path'], $this->get_board_url() . '/' . $this->config['smilies_path'], $content); + + // Remove "Select all" link and mouse events + $content = str_replace('' . $this->user->lang['SELECT_ALL_CODE'] . '', '', $content); + $content = preg_replace('#(onkeypress|onclick)="(.*?)"#si', '', $content); + + // Firefox does not support CSS for feeds, though + + // Remove font sizes + // $content = preg_replace('#([^>]+)#iU', '\1', $content); + + // Make text strong :P + // $content = preg_replace('#(.*?)#iU', '\1', $content); + + // Italic + // $content = preg_replace('#([^<]+)#iU', '\1', $content); + + // Underline + // $content = preg_replace('#([^<]+)#iU', '\1', $content); + + // Remove embed Windows Media Streams + $content = preg_replace( '#<\!--\[if \!IE\]>-->([^[]+)<\!--#si', '', $content); + + // Do not use < and >, because we want to retain code contained in [code][/code] + + // Remove embed and objects + $content = preg_replace( '#<(object|embed)(.*?) (value|src)=(.*?) ([^[]+)(object|embed)>#si',' $1 ',$content); + + // Remove some specials html tag, because somewhere there are a mod to allow html tags ;) + $content = preg_replace( '#<(script|iframe)([^[]+)\1>#siU', ' $1 ', $content); + + // Parse inline images to display with the feed + if (!empty($post_attachments)) + { + $update_count = array(); + parse_attachments($forum_id, $content, $post_attachments, $update_count); + $post_attachments = implode('
', $post_attachments); + + // Convert attachments' relative path to absolute path + $post_attachments = str_replace($this->phpbb_root_path . 'download/file.' . $this->phpEx, $this->get_board_url() . '/download/file.' . $this->phpEx, $post_attachments); + + $content .= $post_attachments; + } + + // Remove Comments from inline attachments [ia] + $content = preg_replace('#
(.*?)
#','',$content); + + // Replace some entities with their unicode counterpart + $entities = array( + ' ' => "\xC2\xA0", + '•' => "\xE2\x80\xA2", + '·' => "\xC2\xB7", + '©' => "\xC2\xA9", + ); + + $content = str_replace(array_keys($entities), array_values($entities), $content); + + // Remove CDATA blocks. ;) + $content = preg_replace('#\<\!\[CDATA\[(.*?)\]\]\>#s', '', $content); + + // Other control characters + $content = preg_replace('#(?:[\x00-\x1F\x7F]+|(?:\xC2[\x80-\x9F])+)#', '', $content); + + return $content; + } +} diff --git a/sources/phpBB/phpbb/feed/news.php b/sources/phpBB/phpbb/feed/news.php new file mode 100644 index 0000000..a02c199 --- /dev/null +++ b/sources/phpBB/phpbb/feed/news.php @@ -0,0 +1,107 @@ + +* @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 +{ + function get_news_forums() + { + static $forum_ids; + + // Matches acp/acp_board.php + $cache_name = 'feed_news_forum_ids'; + + if (!isset($forum_ids) && ($forum_ids = $this->cache->get('_' . $cache_name)) === false) + { + $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($sql); + + $forum_ids = array(); + while ($forum_id = (int) $this->db->sql_fetchfield('forum_id')) + { + $forum_ids[$forum_id] = $forum_id; + } + $this->db->sql_freeresult($result); + + $this->cache->put('_' . $cache_name, $forum_ids); + } + + return $forum_ids; + } + + function get_sql() + { + // Determine forum ids + $in_fid_ary = array_intersect($this->get_news_forums(), $this->get_readable_forums()); + if (empty($in_fid_ary)) + { + return false; + } + + $in_fid_ary = array_diff($in_fid_ary, $this->get_passworded_forums()); + if (empty($in_fid_ary)) + { + return false; + } + + // We really have to get the post ids first! + $sql = 'SELECT topic_first_post_id, topic_time + FROM ' . TOPICS_TABLE . ' + WHERE topic_moved_id = 0 + AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $in_fid_ary) . ' + ORDER BY topic_time DESC'; + $result = $this->db->sql_query_limit($sql, $this->num_items); + + $post_ids = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $post_ids[] = (int) $row['topic_first_post_id']; + } + $this->db->sql_freeresult($result); + + if (empty($post_ids)) + { + return false; + } + + $this->sql = array( + 'SELECT' => 'f.forum_id, f.forum_name, + t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_views, t.topic_time, t.topic_last_post_time, + p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, t.topic_visibility', + 'FROM' => array( + TOPICS_TABLE => 't', + POSTS_TABLE => 'p', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(FORUMS_TABLE => 'f'), + 'ON' => 'p.forum_id = f.forum_id', + ), + ), + 'WHERE' => 'p.topic_id = t.topic_id + AND ' . $this->db->sql_in_set('p.post_id', $post_ids), + 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC', + ); + + return true; + } +} diff --git a/sources/phpBB/phpbb/feed/overall.php b/sources/phpBB/phpbb/feed/overall.php new file mode 100644 index 0000000..ab452f5 --- /dev/null +++ b/sources/phpBB/phpbb/feed/overall.php @@ -0,0 +1,86 @@ + +* @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 +{ + function get_sql() + { + $forum_ids = array_diff($this->get_readable_forums(), $this->get_excluded_forums(), $this->get_passworded_forums()); + if (empty($forum_ids)) + { + return false; + } + + // Determine topics with recent activity + $sql = 'SELECT topic_id, topic_last_post_time + FROM ' . TOPICS_TABLE . ' + WHERE topic_moved_id = 0 + AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $forum_ids) . ' + ORDER BY topic_last_post_time DESC, topic_last_post_id DESC'; + $result = $this->db->sql_query_limit($sql, $this->num_items); + + $topic_ids = array(); + $min_post_time = 0; + while ($row = $this->db->sql_fetchrow()) + { + $topic_ids[] = (int) $row['topic_id']; + + $min_post_time = (int) $row['topic_last_post_time']; + } + $this->db->sql_freeresult($result); + + if (empty($topic_ids)) + { + return false; + } + + // 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', + 'FROM' => array( + USERS_TABLE => 'u', + POSTS_TABLE => 'p', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(FORUMS_TABLE => 'f'), + 'ON' => 'f.forum_id = p.forum_id', + ), + ), + 'WHERE' => $this->db->sql_in_set('p.topic_id', $topic_ids) . ' + AND ' . $this->content_visibility->get_forums_visibility_sql('post', $forum_ids, 'p.') . ' + AND p.post_time >= ' . $min_post_time . ' + AND u.user_id = p.poster_id', + 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC', + ); + + return true; + } + + function adjust_item(&$item_row, &$row) + { + parent::adjust_item($item_row, $row); + + $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title']; + } +} diff --git a/sources/phpBB/phpbb/feed/post_base.php b/sources/phpBB/phpbb/feed/post_base.php new file mode 100644 index 0000000..011775b --- /dev/null +++ b/sources/phpBB/phpbb/feed/post_base.php @@ -0,0 +1,55 @@ + +* @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 +{ + var $num_items = 'feed_limit_post'; + var $attachments = array(); + + function set_keys() + { + $this->set('title', 'post_subject'); + $this->set('title2', 'topic_title'); + + $this->set('author_id', 'user_id'); + $this->set('creator', 'username'); + $this->set('published', 'post_time'); + $this->set('updated', 'post_edit_time'); + $this->set('text', 'post_text'); + + $this->set('bitfield', 'bbcode_bitfield'); + $this->set('bbcode_uid','bbcode_uid'); + + $this->set('enable_bbcode', 'enable_bbcode'); + $this->set('enable_smilies', 'enable_smilies'); + $this->set('enable_magic_url', 'enable_magic_url'); + } + + function adjust_item(&$item_row, &$row) + { + $item_row['link'] = $this->helper->append_sid('viewtopic.' . $this->phpEx, "t={$row['topic_id']}&p={$row['post_id']}#p{$row['post_id']}"); + + if ($this->config['feed_item_statistics']) + { + $item_row['statistics'] = $this->user->lang['POSTED'] . ' ' . $this->user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row) + . ' ' . $this->separator_stats . ' ' . $this->user->format_date($row[$this->get('published')]) + . (($this->is_moderator_approve_forum($row['forum_id']) && (int) $row['post_visibility'] === ITEM_UNAPPROVED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_UNAPPROVED'] : '') + . (($this->is_moderator_approve_forum($row['forum_id']) && (int) $row['post_visibility'] === ITEM_DELETED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_DELETED'] : ''); + } + } +} diff --git a/sources/phpBB/phpbb/feed/topic.php b/sources/phpBB/phpbb/feed/topic.php new file mode 100644 index 0000000..66c49e5 --- /dev/null +++ b/sources/phpBB/phpbb/feed/topic.php @@ -0,0 +1,121 @@ + +* @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; + +/** +* 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 +{ + var $topic_id = 0; + var $forum_id = 0; + var $topic_data = array(); + + /** + * 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; + + return $this; + } + + 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 + LEFT JOIN ' . FORUMS_TABLE . ' f + ON (f.forum_id = t.forum_id) + WHERE t.topic_id = ' . $this->topic_id; + $result = $this->db->sql_query($sql); + $this->topic_data = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (empty($this->topic_data)) + { + trigger_error('NO_TOPIC'); + } + + $this->forum_id = (int) $this->topic_data['forum_id']; + + // 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'); + } + + // Make sure forum is not excluded from feed + if (phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $this->topic_data['forum_options'])) + { + trigger_error('NO_FEED'); + } + + // Make sure we can read this forum + if (!$this->auth->acl_get('f_read', $this->forum_id)) + { + trigger_error('SORRY_AUTH_READ'); + } + + // Make sure forum is not passworded or user is authed + if ($this->topic_data['forum_password']) + { + $forum_ids_passworded = $this->get_passworded_forums(); + + if (isset($forum_ids_passworded[$this->forum_id])) + { + trigger_error('SORRY_AUTH_READ'); + } + + unset($forum_ids_passworded); + } + + parent::open(); + } + + 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', + 'FROM' => array( + POSTS_TABLE => 'p', + USERS_TABLE => 'u', + ), + 'WHERE' => 'p.topic_id = ' . $this->topic_id . ' + AND ' . $this->content_visibility->get_visibility_sql('post', $this->forum_id, 'p.') . ' + AND p.poster_id = u.user_id', + 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC', + ); + + return true; + } + + function adjust_item(&$item_row, &$row) + { + parent::adjust_item($item_row, $row); + + $item_row['forum_id'] = $this->forum_id; + } + + function get_item() + { + return ($row = parent::get_item()) ? array_merge($this->topic_data, $row) : $row; + } +} diff --git a/sources/phpBB/phpbb/feed/topic_base.php b/sources/phpBB/phpbb/feed/topic_base.php new file mode 100644 index 0000000..f9ff368 --- /dev/null +++ b/sources/phpBB/phpbb/feed/topic_base.php @@ -0,0 +1,70 @@ + +* @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 +{ + var $num_items = 'feed_limit_topic'; + + function set_keys() + { + $this->set('title', 'topic_title'); + $this->set('title2', 'forum_name'); + + $this->set('author_id', 'topic_poster'); + $this->set('creator', 'topic_first_poster_name'); + $this->set('published', 'post_time'); + $this->set('updated', 'post_edit_time'); + $this->set('text', 'post_text'); + + $this->set('bitfield', 'bbcode_bitfield'); + $this->set('bbcode_uid','bbcode_uid'); + + $this->set('enable_bbcode', 'enable_bbcode'); + $this->set('enable_smilies', 'enable_smilies'); + $this->set('enable_magic_url', 'enable_magic_url'); + } + + function adjust_item(&$item_row, &$row) + { + $item_row['link'] = $this->helper->append_sid('viewtopic.' . $this->phpEx, 't=' . $row['topic_id'] . '&p=' . $row['post_id'] . '#p' . $row['post_id']); + + if ($this->config['feed_item_statistics']) + { + $item_row['statistics'] = $this->user->lang['POSTED'] . ' ' . $this->user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row) + . ' ' . $this->separator_stats . ' ' . $this->user->format_date($row[$this->get('published')]) + . ' ' . $this->separator_stats . ' ' . $this->user->lang['REPLIES'] . ' ' . ($this->content_visibility->get_count('topic_posts', $row, $row['forum_id']) - 1) + . ' ' . $this->separator_stats . ' ' . $this->user->lang['VIEWS'] . ' ' . $row['topic_views']; + + if ($this->is_moderator_approve_forum($row['forum_id'])) + { + if ((int) $row['topic_visibility'] === ITEM_DELETED) + { + $item_row['statistics'] .= ' ' . $this->separator_stats . ' ' . $this->user->lang['TOPIC_DELETED']; + } + else if ((int) $row['topic_visibility'] === ITEM_UNAPPROVED) + { + $item_row['statistics'] .= ' ' . $this->separator_stats . ' ' . $this->user->lang['TOPIC_UNAPPROVED']; + } + else if ($row['topic_posts_unapproved']) + { + $item_row['statistics'] .= ' ' . $this->separator_stats . ' ' . $this->user->lang['POSTS_UNAPPROVED']; + } + } + } + } +} diff --git a/sources/phpBB/phpbb/feed/topics.php b/sources/phpBB/phpbb/feed/topics.php new file mode 100644 index 0000000..2b9cb35 --- /dev/null +++ b/sources/phpBB/phpbb/feed/topics.php @@ -0,0 +1,86 @@ + +* @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 +{ + function get_sql() + { + $forum_ids_read = $this->get_readable_forums(); + if (empty($forum_ids_read)) + { + return false; + } + + $in_fid_ary = array_diff($forum_ids_read, $this->get_excluded_forums(), $this->get_passworded_forums()); + if (empty($in_fid_ary)) + { + return false; + } + + // We really have to get the post ids first! + $sql = 'SELECT topic_first_post_id, topic_time + FROM ' . TOPICS_TABLE . ' + WHERE topic_moved_id = 0 + AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $in_fid_ary) . ' + ORDER BY topic_time DESC'; + $result = $this->db->sql_query_limit($sql, $this->num_items); + + $post_ids = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $post_ids[] = (int) $row['topic_first_post_id']; + } + $this->db->sql_freeresult($result); + + if (empty($post_ids)) + { + return false; + } + + $this->sql = array( + 'SELECT' => 'f.forum_id, f.forum_name, + t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_views, t.topic_time, t.topic_last_post_time, + p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, t.topic_visibility', + 'FROM' => array( + TOPICS_TABLE => 't', + POSTS_TABLE => 'p', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(FORUMS_TABLE => 'f'), + 'ON' => 'p.forum_id = f.forum_id', + ), + ), + 'WHERE' => 'p.topic_id = t.topic_id + AND ' . $this->db->sql_in_set('p.post_id', $post_ids), + 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC', + ); + + return true; + } + + function adjust_item(&$item_row, &$row) + { + parent::adjust_item($item_row, $row); + + $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title']; + } +} diff --git a/sources/phpBB/phpbb/feed/topics_active.php b/sources/phpBB/phpbb/feed/topics_active.php new file mode 100644 index 0000000..6d5eddf --- /dev/null +++ b/sources/phpBB/phpbb/feed/topics_active.php @@ -0,0 +1,131 @@ + +* @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 +{ + var $sort_days = 7; + + function set_keys() + { + parent::set_keys(); + + $this->set('author_id', 'topic_last_poster_id'); + $this->set('creator', 'topic_last_poster_name'); + } + + function get_sql() + { + $forum_ids_read = $this->get_readable_forums(); + if (empty($forum_ids_read)) + { + return false; + } + + $in_fid_ary = array_intersect($forum_ids_read, $this->get_forum_ids()); + $in_fid_ary = array_diff($in_fid_ary, $this->get_passworded_forums()); + if (empty($in_fid_ary)) + { + return false; + } + + // Search for topics in last X days + $last_post_time_sql = ($this->sort_days) ? ' AND topic_last_post_time > ' . (time() - ($this->sort_days * 24 * 3600)) : ''; + + // We really have to get the post ids first! + $sql = 'SELECT topic_last_post_id, topic_last_post_time + FROM ' . TOPICS_TABLE . ' + WHERE topic_moved_id = 0 + AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $in_fid_ary) . ' + ' . $last_post_time_sql . ' + ORDER BY topic_last_post_time DESC, topic_last_post_id DESC'; + $result = $this->db->sql_query_limit($sql, $this->num_items); + + $post_ids = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $post_ids[] = (int) $row['topic_last_post_id']; + } + $this->db->sql_freeresult($result); + + if (empty($post_ids)) + { + return false; + } + + $this->sql = array( + 'SELECT' => 'f.forum_id, f.forum_name, + t.topic_id, t.topic_title, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_views, + t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_post_time, + p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, t.topic_visibility', + 'FROM' => array( + TOPICS_TABLE => 't', + POSTS_TABLE => 'p', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(FORUMS_TABLE => 'f'), + 'ON' => 'p.forum_id = f.forum_id', + ), + ), + 'WHERE' => 'p.topic_id = t.topic_id + AND ' . $this->db->sql_in_set('p.post_id', $post_ids), + 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC', + ); + + return true; + } + + function get_forum_ids() + { + static $forum_ids; + + $cache_name = 'feed_topic_active_forum_ids'; + + if (!isset($forum_ids) && ($forum_ids = $this->cache->get('_' . $cache_name)) === false) + { + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + WHERE forum_type = ' . FORUM_POST . ' + AND ' . $this->db->sql_bit_and('forum_options', FORUM_OPTION_FEED_EXCLUDE, '= 0') . ' + AND ' . $this->db->sql_bit_and('forum_flags', log(FORUM_FLAG_ACTIVE_TOPICS, 2), '<> 0'); + $result = $this->db->sql_query($sql); + + $forum_ids = array(); + while ($forum_id = (int) $this->db->sql_fetchfield('forum_id')) + { + $forum_ids[$forum_id] = $forum_id; + } + $this->db->sql_freeresult($result); + + $this->cache->put('_' . $cache_name, $forum_ids, 180); + } + + return $forum_ids; + } + + function adjust_item(&$item_row, &$row) + { + parent::adjust_item($item_row, $row); + + $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title']; + } +} diff --git a/sources/phpBB/phpbb/file_downloader.php b/sources/phpBB/phpbb/file_downloader.php new file mode 100644 index 0000000..ca8b1f4 --- /dev/null +++ b/sources/phpBB/phpbb/file_downloader.php @@ -0,0 +1,120 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb; + +class file_downloader +{ + /** @var string Error string */ + protected $error_string = ''; + + /** @var int Error number */ + protected $error_number = 0; + + /** + * Retrieve contents from remotely stored file + * + * @param string $host File host + * @param string $directory Directory file is in + * @param string $filename Filename of file to retrieve + * @param int $port Port to connect to; default: 80 + * @param int $timeout Connection timeout in seconds; default: 6 + * + * @return mixed File data as string if file can be read and there is no + * timeout, false if there were errors or the connection timed out + * + * @throws \phpbb\exception\runtime_exception If data can't be retrieved and no error + * message is returned + */ + public function get($host, $directory, $filename, $port = 80, $timeout = 6) + { + // Set default values for error variables + $this->error_number = 0; + $this->error_string = ''; + + if ($socket = @fsockopen($host, $port, $this->error_number, $this->error_string, $timeout)) + { + @fputs($socket, "GET $directory/$filename HTTP/1.0\r\n"); + @fputs($socket, "HOST: $host\r\n"); + @fputs($socket, "Connection: close\r\n\r\n"); + + $timer_stop = time() + $timeout; + stream_set_timeout($socket, $timeout); + + $file_info = ''; + $get_info = false; + + while (!@feof($socket)) + { + if ($get_info) + { + $file_info .= @fread($socket, 1024); + } + else + { + $line = @fgets($socket, 1024); + if ($line == "\r\n") + { + $get_info = true; + } + else if (stripos($line, '404 not found') !== false) + { + throw new \phpbb\exception\runtime_exception('FILE_NOT_FOUND', array($filename)); + } + } + + $stream_meta_data = stream_get_meta_data($socket); + + if (!empty($stream_meta_data['timed_out']) || time() >= $timer_stop) + { + throw new \phpbb\exception\runtime_exception('FSOCK_TIMEOUT'); + } + } + @fclose($socket); + } + else + { + if ($this->error_string) + { + $this->error_string = utf8_convert_message($this->error_string); + return false; + } + else + { + throw new \RuntimeException('FSOCK_DISABLED'); + } + } + + return $file_info; + } + + /** + * Get error string + * + * @return string Error string + */ + public function get_error_string() + { + return $this->error_string; + } + + /** + * Get error number + * + * @return int Error number + */ + public function get_error_number() + { + return $this->error_number; + } +} diff --git a/sources/phpBB/phpbb/filesystem.php b/sources/phpBB/phpbb/filesystem.php new file mode 100644 index 0000000..7751708 --- /dev/null +++ b/sources/phpBB/phpbb/filesystem.php @@ -0,0 +1,50 @@ + +* @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; + +/** +* A class with various functions that are related to paths, files and the filesystem +*/ +class 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/sources/phpBB/phpbb/finder.php b/sources/phpBB/phpbb/finder.php new file mode 100644 index 0000000..28f2882 --- /dev/null +++ b/sources/phpBB/phpbb/finder.php @@ -0,0 +1,547 @@ + +* @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; + +/** +* The finder provides a simple way to locate files in the core and a set of extensions +*/ +class finder +{ + protected $extensions; + protected $filesystem; + protected $phpbb_root_path; + protected $cache; + protected $php_ext; + + /** + * The cache variable name used to store $this->cached_queries in $this->cache. + * + * Allows the use of multiple differently configured finders with the same cache. + * @var string + */ + protected $cache_name; + + /** + * An associative array, containing all search parameters set in methods. + * @var array + */ + protected $query; + + /** + * A map from md5 hashes of serialized queries to their previously retrieved + * results. + * @var array + */ + protected $cached_queries; + + /** + * Creates a new finder instance with its dependencies + * + * @param \phpbb\filesystem $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') + { + $this->filesystem = $filesystem; + $this->phpbb_root_path = $phpbb_root_path; + $this->cache = $cache; + $this->php_ext = $php_ext; + $this->cache_name = $cache_name; + + $this->query = array( + 'core_path' => false, + 'core_suffix' => false, + 'core_prefix' => false, + 'core_directory' => false, + 'extension_suffix' => false, + 'extension_prefix' => false, + 'extension_directory' => false, + ); + $this->extensions = array(); + + $this->cached_queries = ($this->cache) ? $this->cache->get($this->cache_name) : false; + } + + /** + * Set the array of extensions + * + * @param array $extensions A list of extensions that should be searched aswell + * @param bool $replace_list Should the list be emptied before adding the extensions + * @return \phpbb\finder This object for chaining calls + */ + public function set_extensions(array $extensions, $replace_list = true) + { + if ($replace_list) + { + $this->extensions = array(); + } + + foreach ($extensions as $ext_name) + { + $this->extensions[$ext_name] = $this->phpbb_root_path . 'ext/' . $ext_name . '/'; + } + return $this; + } + + /** + * Sets a core path to be searched in addition to extensions + * + * @param string $core_path The path relative to phpbb_root_path + * @return \phpbb\finder This object for chaining calls + */ + public function core_path($core_path) + { + $this->query['core_path'] = $core_path; + return $this; + } + + /** + * Sets the suffix all files found in extensions and core must match. + * + * There is no default file extension, so to find PHP files only, you will + * have to specify .php as a suffix. However when using get_classes, the .php + * file extension is automatically added to suffixes. + * + * @param string $suffix A filename suffix + * @return \phpbb\finder This object for chaining calls + */ + public function suffix($suffix) + { + $this->core_suffix($suffix); + $this->extension_suffix($suffix); + return $this; + } + + /** + * Sets a suffix all files found in extensions must match + * + * There is no default file extension, so to find PHP files only, you will + * have to specify .php as a suffix. However when using get_classes, the .php + * file extension is automatically added to suffixes. + * + * @param string $extension_suffix A filename suffix + * @return \phpbb\finder This object for chaining calls + */ + public function extension_suffix($extension_suffix) + { + $this->query['extension_suffix'] = $extension_suffix; + return $this; + } + + /** + * Sets a suffix all files found in the core path must match + * + * There is no default file extension, so to find PHP files only, you will + * have to specify .php as a suffix. However when using get_classes, the .php + * file extension is automatically added to suffixes. + * + * @param string $core_suffix A filename suffix + * @return \phpbb\finder This object for chaining calls + */ + public function core_suffix($core_suffix) + { + $this->query['core_suffix'] = $core_suffix; + return $this; + } + + /** + * Sets the prefix all files found in extensions and core must match + * + * @param string $prefix A filename prefix + * @return \phpbb\finder This object for chaining calls + */ + public function prefix($prefix) + { + $this->core_prefix($prefix); + $this->extension_prefix($prefix); + return $this; + } + + /** + * Sets a prefix all files found in extensions must match + * + * @param string $extension_prefix A filename prefix + * @return \phpbb\finder This object for chaining calls + */ + public function extension_prefix($extension_prefix) + { + $this->query['extension_prefix'] = $extension_prefix; + return $this; + } + + /** + * Sets a prefix all files found in the core path must match + * + * @param string $core_prefix A filename prefix + * @return \phpbb\finder This object for chaining calls + */ + public function core_prefix($core_prefix) + { + $this->query['core_prefix'] = $core_prefix; + return $this; + } + + /** + * Sets a directory all files found in extensions and core must be contained in + * + * Automatically sets the core_directory if its value does not differ from + * the current directory. + * + * @param string $directory + * @return \phpbb\finder This object for chaining calls + */ + public function directory($directory) + { + $this->core_directory($directory); + $this->extension_directory($directory); + return $this; + } + + /** + * Sets a directory all files found in extensions must be contained in + * + * @param string $extension_directory + * @return \phpbb\finder This object for chaining calls + */ + public function extension_directory($extension_directory) + { + $this->query['extension_directory'] = $this->sanitise_directory($extension_directory); + return $this; + } + + /** + * Sets a directory all files found in the core path must be contained in + * + * @param string $core_directory + * @return \phpbb\finder This object for chaining calls + */ + public function core_directory($core_directory) + { + $this->query['core_directory'] = $this->sanitise_directory($core_directory); + return $this; + } + + /** + * Removes occurances of /./ and makes sure path ends without trailing slash + * + * @param string $directory A directory pattern + * @return string A cleaned up directory pattern + */ + protected function sanitise_directory($directory) + { + $directory = $this->filesystem->clean_path($directory); + $dir_len = strlen($directory); + + if ($dir_len > 1 && $directory[$dir_len - 1] === '/') + { + $directory = substr($directory, 0, -1); + } + + return $directory; + } + + /** + * Finds classes matching the configured options if they follow phpBB naming rules. + * + * The php file extension is automatically added to suffixes. + * + * Note: If a file is matched but contains a class name not following the + * phpBB naming rules an incorrect class name will be returned. + * + * @param bool $cache Whether the result should be cached + * @return array An array of found class names + */ + public function get_classes($cache = true) + { + $this->query['extension_suffix'] .= '.' . $this->php_ext; + $this->query['core_suffix'] .= '.' . $this->php_ext; + + $files = $this->find($cache, false); + + return $this->get_classes_from_files($files); + } + + /** + * Get class names from a list of files + * + * @param array $files Array of files (from find()) + * @return array Array of class names + */ + public function get_classes_from_files($files) + { + $classes = array(); + foreach ($files as $file => $ext_name) + { + $class = substr($file, 0, -strlen('.' . $this->php_ext)); + if ($ext_name === '/' && preg_match('#^includes/#', $file)) + { + $class = preg_replace('#^includes/#', '', $class); + $classes[] = 'phpbb_' . str_replace('/', '_', $class); + } + else + { + $class = preg_replace('#^ext/#', '', $class); + $classes[] = '\\' . str_replace('/', '\\', $class); + } + } + return $classes; + } + + /** + * Finds all directories matching the configured options + * + * @param bool $cache Whether the result should be cached + * @param bool $extension_keys Whether the result should have extension name as array key + * @return array An array of paths to found directories + */ + public function get_directories($cache = true, $extension_keys = false) + { + return $this->find_with_root_path($cache, true, $extension_keys); + } + + /** + * Finds all files matching the configured options. + * + * @param bool $cache Whether the result should be cached + * @return array An array of paths to found files + */ + public function get_files($cache = true) + { + return $this->find_with_root_path($cache, false); + } + + /** + * A wrapper around the general find which prepends a root path to results + * + * @param bool $cache Whether the result should be cached + * @param bool $is_dir Directories will be returned when true, only files + * otherwise + * @param bool $extension_keys If true, result will be associative array + * with extension name as key + * @return array An array of paths to found items + */ + protected function find_with_root_path($cache = true, $is_dir = false, $extension_keys = false) + { + $items = $this->find($cache, $is_dir); + + $result = array(); + foreach ($items as $item => $ext_name) + { + if ($extension_keys) + { + $result[$ext_name] = $this->phpbb_root_path . $item; + } + else + { + $result[] = $this->phpbb_root_path . $item; + } + } + + return $result; + } + + /** + * Finds all file system entries matching the configured options + * + * @param bool $cache Whether the result should be cached + * @param bool $is_dir Directories will be returned when true, only files + * otherwise + * @return array An array of paths to found items + */ + public function find($cache = true, $is_dir = false) + { + $extensions = $this->extensions; + if ($this->query['core_path']) + { + $extensions['/'] = $this->phpbb_root_path . $this->query['core_path']; + } + + $files = array(); + $file_list = $this->find_from_paths($extensions, $cache, $is_dir); + + foreach ($file_list as $file) + { + $files[$file['named_path']] = $file['ext_name']; + } + + return $files; + } + + /** + * Finds all file system entries matching the configured options for one + * specific extension + * + * @param string $extension_name Name of the extension + * @param string $extension_path Relative path to the extension root directory + * @param bool $cache Whether the result should be cached + * @param bool $is_dir Directories will be returned when true, only files + * otherwise + * @return array An array of paths to found items + */ + public function find_from_extension($extension_name, $extension_path, $cache = true, $is_dir = false) + { + $extensions = array( + $extension_name => $extension_path, + ); + + $files = array(); + $file_list = $this->find_from_paths($extensions, $cache, $is_dir); + + foreach ($file_list as $file) + { + $files[$file['named_path']] = $file['ext_name']; + } + + return $files; + } + + /** + * Finds all file system entries matching the configured options from + * an array of paths + * + * @param array $extensions Array of extensions (name => full relative path) + * @param bool $cache Whether the result should be cached + * @param bool $is_dir Directories will be returned when true, only files + * otherwise + * @return array An array of paths to found items + */ + public function find_from_paths($extensions, $cache = true, $is_dir = false) + { + $this->query['is_dir'] = $is_dir; + $query = md5(serialize($this->query) . serialize($extensions)); + + if (!defined('DEBUG') && $cache && isset($this->cached_queries[$query])) + { + return $this->cached_queries[$query]; + } + + $files = array(); + + foreach ($extensions as $name => $path) + { + $ext_name = $name; + + if (!file_exists($path)) + { + continue; + } + + if ($name === '/') + { + $location = $this->query['core_path']; + $name = ''; + $suffix = $this->query['core_suffix']; + $prefix = $this->query['core_prefix']; + $directory = $this->query['core_directory']; + } + else + { + $location = 'ext/'; + $name .= '/'; + $suffix = $this->query['extension_suffix']; + $prefix = $this->query['extension_prefix']; + $directory = $this->query['extension_directory']; + } + + // match only first directory if leading slash is given + if ($directory === '/') + { + $directory_pattern = '^' . preg_quote(DIRECTORY_SEPARATOR, '#'); + } + else if ($directory && $directory[0] === '/') + { + if (!$is_dir) + { + $path .= substr($directory, 1); + } + $directory_pattern = '^' . preg_quote(str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR, '#'); + } + else + { + $directory_pattern = preg_quote(DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR, '#'); + } + if ($is_dir) + { + $directory_pattern .= '$'; + } + $directory_pattern = '#' . $directory_pattern . '#'; + + if (is_dir($path)) + { + $iterator = new \RecursiveIteratorIterator( + new \phpbb\recursive_dot_prefix_filter_iterator( + new \RecursiveDirectoryIterator( + $path, + \FilesystemIterator::SKIP_DOTS + ) + ), + \RecursiveIteratorIterator::SELF_FIRST + ); + + foreach ($iterator as $file_info) + { + $filename = $file_info->getFilename(); + + if ($file_info->isDir() == $is_dir) + { + if ($is_dir) + { + $relative_path = $iterator->getInnerIterator()->getSubPath() . DIRECTORY_SEPARATOR . basename($filename) . DIRECTORY_SEPARATOR; + if ($relative_path[0] !== DIRECTORY_SEPARATOR) + { + $relative_path = DIRECTORY_SEPARATOR . $relative_path; + } + } + else + { + $relative_path = $iterator->getInnerIterator()->getSubPathname(); + if ($directory && $directory[0] === '/') + { + $relative_path = str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR . $relative_path; + } + else + { + $relative_path = DIRECTORY_SEPARATOR . $relative_path; + } + } + + if ((!$suffix || substr($relative_path, -strlen($suffix)) === $suffix) && + (!$prefix || substr($filename, 0, strlen($prefix)) === $prefix) && + (!$directory || preg_match($directory_pattern, $relative_path))) + { + $files[] = array( + 'named_path' => str_replace(DIRECTORY_SEPARATOR, '/', $location . $name . substr($relative_path, 1)), + 'ext_name' => $ext_name, + 'path' => str_replace(array(DIRECTORY_SEPARATOR, $this->phpbb_root_path), array('/', ''), $file_info->getPath()) . '/', + 'filename' => $filename, + ); + } + } + } + } + } + + if ($cache && $this->cache) + { + $this->cached_queries[$query] = $files; + $this->cache->put($this->cache_name, $this->cached_queries); + } + + return $files; + } +} diff --git a/sources/phpBB/phpbb/groupposition/exception.php b/sources/phpBB/phpbb/groupposition/exception.php new file mode 100644 index 0000000..956c723 --- /dev/null +++ b/sources/phpBB/phpbb/groupposition/exception.php @@ -0,0 +1,18 @@ + +* @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\groupposition; + +class exception extends \Exception +{ +} diff --git a/sources/phpBB/phpbb/groupposition/groupposition_interface.php b/sources/phpBB/phpbb/groupposition/groupposition_interface.php new file mode 100644 index 0000000..3bd3fcc --- /dev/null +++ b/sources/phpBB/phpbb/groupposition/groupposition_interface.php @@ -0,0 +1,80 @@ + +* @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\groupposition; + +/** +* Interface to manage group positions in various places of phpbb +* +* The interface provides simple methods to add, delete and move a group +*/ +interface groupposition_interface +{ + /** + * Returns the value for a given group, if the group exists. + * @param int $group_id group_id of the group to be selected + * @return int position of the group + */ + public function get_group_value($group_id); + + /** + * Get number of groups displayed + * + * @return int value of the last item displayed + */ + public function get_group_count(); + + /** + * Addes a group by group_id + * + * @param int $group_id group_id of the group to be added + * @return bool True if the group was added successfully + */ + public function add_group($group_id); + + /** + * Deletes a group by group_id + * + * @param int $group_id group_id of the group to be deleted + * @param bool $skip_group Skip setting the value for this group, to save the query, when you need to update it anyway. + * @return bool True if the group was deleted successfully + */ + public function delete_group($group_id, $skip_group = false); + + /** + * Moves a group up by group_id + * + * @param int $group_id group_id of the group to be moved + * @return bool True if the group was moved successfully + */ + public function move_up($group_id); + + /** + * Moves a group down by group_id + * + * @param int $group_id group_id of the group to be moved + * @return bool True if the group was moved successfully + */ + public function move_down($group_id); + + /** + * Moves a group up/down + * + * @param int $group_id group_id of the group to be moved + * @param int $delta number of steps: + * - positive = move up + * - negative = move down + * @return bool True if the group was moved successfully + */ + public function move($group_id, $delta); +} diff --git a/sources/phpBB/phpbb/groupposition/legend.php b/sources/phpBB/phpbb/groupposition/legend.php new file mode 100644 index 0000000..efea338 --- /dev/null +++ b/sources/phpBB/phpbb/groupposition/legend.php @@ -0,0 +1,243 @@ + +* @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\groupposition; + +/** +* Legend group position class +* +* group_legend is an ascending list 1, 2, ..., n for groups which are displayed. 1 is the first group, n the last. +* If the value is 0 (self::GROUP_DISABLED) the group is not displayed. +*/ +class legend implements \phpbb\groupposition\groupposition_interface +{ + /** + * Group is not displayed + */ + const GROUP_DISABLED = 0; + + /** + * Database object + * @var \phpbb\db\driver\driver_interface + */ + protected $db; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Constructor + * + * @param \phpbb\db\driver\driver_interface $db Database object + * @param \phpbb\user $user User object + */ + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user) + { + $this->db = $db; + $this->user = $user; + } + + /** + * Returns the group_legend for a given group, if the group exists. + * + * @param int $group_id group_id of the group to be selected + * @return int position of the group + * @throws \phpbb\groupposition\exception + */ + public function get_group_value($group_id) + { + $sql = 'SELECT group_legend + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . (int) $group_id; + $result = $this->db->sql_query($sql); + $current_value = $this->db->sql_fetchfield('group_legend'); + $this->db->sql_freeresult($result); + + if ($current_value === false) + { + // Group not found. + throw new \phpbb\groupposition\exception('NO_GROUP'); + } + + return (int) $current_value; + } + + /** + * Get number of groups, displayed on the legend + * + * @return int value of the last item displayed + */ + public function get_group_count() + { + $sql = 'SELECT group_legend + FROM ' . GROUPS_TABLE . ' + ORDER BY group_legend DESC'; + $result = $this->db->sql_query_limit($sql, 1); + $group_count = (int) $this->db->sql_fetchfield('group_legend'); + $this->db->sql_freeresult($result); + + return $group_count; + } + + /** + * {@inheritDoc} + */ + public function add_group($group_id) + { + $current_value = $this->get_group_value($group_id); + + if ($current_value == self::GROUP_DISABLED) + { + // Group is currently not displayed, add it at the end. + $next_value = 1 + $this->get_group_count(); + + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_legend = ' . $next_value . ' + WHERE group_legend = ' . self::GROUP_DISABLED . ' + AND group_id = ' . (int) $group_id; + $this->db->sql_query($sql); + return true; + } + + return false; + } + + /** + * Deletes a group by setting the field to self::GROUP_DISABLED and closing the gap in the list. + * + * @param int $group_id group_id of the group to be deleted + * @param bool $skip_group Skip setting the value for this group, to save the query, when you need to update it anyway. + * @return bool True if the group was deleted successfully + */ + public function delete_group($group_id, $skip_group = false) + { + $current_value = $this->get_group_value($group_id); + + if ($current_value != self::GROUP_DISABLED) + { + $this->db->sql_transaction('begin'); + + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_legend = group_legend - 1 + WHERE group_legend > ' . $current_value; + $this->db->sql_query($sql); + + if (!$skip_group) + { + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_legend = ' . self::GROUP_DISABLED . ' + WHERE group_id = ' . (int) $group_id; + $this->db->sql_query($sql); + } + + $this->db->sql_transaction('commit'); + + return true; + } + + return false; + } + + /** + * {@inheritDoc} + */ + public function move_up($group_id) + { + return $this->move($group_id, 1); + } + + /** + * {@inheritDoc} + */ + public function move_down($group_id) + { + return $this->move($group_id, -1); + } + + /** + * {@inheritDoc} + */ + public function move($group_id, $delta) + { + $delta = (int) $delta; + if (!$delta) + { + return false; + } + + $move_up = ($delta > 0) ? true : false; + $current_value = $this->get_group_value($group_id); + + if ($current_value != self::GROUP_DISABLED) + { + $this->db->sql_transaction('begin'); + + // First we move all groups between our current value and the target value up/down 1, + // so we have a gap for our group to move. + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_legend = group_legend' . (($move_up) ? ' + 1' : ' - 1') . ' + WHERE group_legend > ' . self::GROUP_DISABLED . ' + AND group_legend' . (($move_up) ? ' >= ' : ' <= ') . ($current_value - $delta) . ' + AND group_legend' . (($move_up) ? ' < ' : ' > ') . $current_value; + $this->db->sql_query($sql); + + // Because there might be fewer groups above/below the group than we wanted to move, + // we use the number of changed groups, to update the group. + $delta = (int) $this->db->sql_affectedrows(); + + if ($delta) + { + // And now finally, when we moved some other groups and built a gap, + // we can move the desired group to it. + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_legend = group_legend ' . (($move_up) ? ' - ' : ' + ') . $delta . ' + WHERE group_id = ' . (int) $group_id; + $this->db->sql_query($sql); + + $this->db->sql_transaction('commit'); + + return true; + } + + $this->db->sql_transaction('commit'); + } + + return false; + } + + /** + * Get group type language var + * + * @param int $group_type group_type from the groups-table + * @return string name of the language variable for the given group-type. + */ + static public function group_type_language($group_type) + { + switch ($group_type) + { + case GROUP_OPEN: + return 'GROUP_REQUEST'; + case GROUP_CLOSED: + return 'GROUP_CLOSED'; + case GROUP_HIDDEN: + return 'GROUP_HIDDEN'; + case GROUP_SPECIAL: + return 'GROUP_SPECIAL'; + case GROUP_FREE: + return 'GROUP_OPEN'; + } + } +} diff --git a/sources/phpBB/phpbb/groupposition/teampage.php b/sources/phpBB/phpbb/groupposition/teampage.php new file mode 100644 index 0000000..2985c51 --- /dev/null +++ b/sources/phpBB/phpbb/groupposition/teampage.php @@ -0,0 +1,597 @@ + +* @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\groupposition; + +/** +* Teampage group position class +* +* Teampage position is an ascending list 1, 2, ..., n for items which are displayed. 1 is the first item, n the last. +*/ +class teampage implements \phpbb\groupposition\groupposition_interface +{ + /** + * Group is not displayed + */ + const GROUP_DISABLED = 0; + + /** + * No parent item + */ + const NO_PARENT = 0; + + /** + * Database object + * @var \phpbb\db\driver\driver_interface + */ + protected $db; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Cache object + * @var \phpbb\cache\driver\driver_interface + */ + protected $cache; + + /** + * Constructor + * + * @param \phpbb\db\driver\driver_interface $db Database object + * @param \phpbb\user $user User object + * @param \phpbb\cache\driver\driver_interface $cache Cache object + */ + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, \phpbb\cache\driver\driver_interface $cache) + { + $this->db = $db; + $this->user = $user; + $this->cache = $cache; + } + + /** + * Returns the teampage position for a given group, if the group exists. + * + * @param int $group_id group_id of the group to be selected + * @return int position of the group + * @throws \phpbb\groupposition\exception + */ + public function get_group_value($group_id) + { + // The join is required to ensure that the group itself exists + $sql = 'SELECT g.group_id, t.teampage_position + FROM ' . GROUPS_TABLE . ' g + LEFT JOIN ' . TEAMPAGE_TABLE . ' t + ON (t.group_id = g.group_id) + WHERE g.group_id = ' . (int) $group_id; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if ($row === false) + { + // Group not found. + throw new \phpbb\groupposition\exception('NO_GROUP'); + } + + return (int) $row['teampage_position']; + } + + /** + * Returns the row for a given group, if the group exists. + * + * @param int $group_id group_id of the group to be selected + * @return array Data row of the group + * @throws \phpbb\groupposition\exception + */ + public function get_group_values($group_id) + { + // The join is required to ensure that the group itself exists + $sql = 'SELECT * + FROM ' . GROUPS_TABLE . ' g + LEFT JOIN ' . TEAMPAGE_TABLE . ' t + ON (t.group_id = g.group_id) + WHERE g.group_id = ' . (int) $group_id; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if ($row === false) + { + // Group not found. + throw new \phpbb\groupposition\exception('NO_GROUP'); + } + + return $row; + } + + /** + * Returns the teampage position for a given teampage item, if the item exists. + * + * @param int $teampage_id Teampage_id of the selected item + * @return int Teampage position of the item + * @throws \phpbb\groupposition\exception + */ + public function get_teampage_value($teampage_id) + { + $sql = 'SELECT teampage_position + FROM ' . TEAMPAGE_TABLE . ' + WHERE teampage_id = ' . (int) $teampage_id; + $result = $this->db->sql_query($sql); + $current_value = $this->db->sql_fetchfield('teampage_position'); + $this->db->sql_freeresult($result); + + if ($current_value === false) + { + // Group not found. + throw new \phpbb\groupposition\exception('NO_GROUP'); + } + + return (int) $current_value; + } + + /** + * Returns the teampage row for a given teampage item, if the item exists. + * + * @param int $teampage_id Teampage_id of the selected item + * @return array Teampage row of the item + * @throws \phpbb\groupposition\exception + */ + public function get_teampage_values($teampage_id) + { + $sql = 'SELECT teampage_position, teampage_parent + FROM ' . TEAMPAGE_TABLE . ' + WHERE teampage_id = ' . (int) $teampage_id; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if ($row === false) + { + // Group not found. + throw new \phpbb\groupposition\exception('NO_GROUP'); + } + + return $row; + } + + + /** + * {@inheritDoc} + */ + public function get_group_count() + { + $sql = 'SELECT teampage_position + FROM ' . TEAMPAGE_TABLE . ' + ORDER BY teampage_position DESC'; + $result = $this->db->sql_query_limit($sql, 1); + $group_count = (int) $this->db->sql_fetchfield('teampage_position'); + $this->db->sql_freeresult($result); + + return $group_count; + } + + /** + * {@inheritDoc} + */ + public function add_group($group_id) + { + return $this->add_group_teampage($group_id, self::NO_PARENT); + } + + /** + * Adds a group by group_id + * + * @param int $group_id group_id of the group to be added + * @param int $parent_id Teampage ID of the parent item + * @return bool True if the group was added successfully + */ + public function add_group_teampage($group_id, $parent_id) + { + $current_value = $this->get_group_value($group_id); + + if ($current_value == self::GROUP_DISABLED) + { + if ($parent_id != self::NO_PARENT) + { + // Check, whether the given parent is a category + $sql = 'SELECT teampage_id + FROM ' . TEAMPAGE_TABLE . ' + WHERE group_id = 0 + AND teampage_id = ' . (int) $parent_id; + $result = $this->db->sql_query_limit($sql, 1); + $parent_is_category = (bool) $this->db->sql_fetchfield('teampage_id'); + $this->db->sql_freeresult($result); + + if ($parent_is_category) + { + // Get value of last child from this parent and add group there + $sql = 'SELECT teampage_position + FROM ' . TEAMPAGE_TABLE . ' + WHERE teampage_parent = ' . (int) $parent_id . ' + OR teampage_id = ' . (int) $parent_id . ' + ORDER BY teampage_position DESC'; + $result = $this->db->sql_query_limit($sql, 1); + $new_position = (int) $this->db->sql_fetchfield('teampage_position'); + $this->db->sql_freeresult($result); + + $sql = 'UPDATE ' . TEAMPAGE_TABLE . ' + SET teampage_position = teampage_position + 1 + WHERE teampage_position > ' . $new_position; + $this->db->sql_query($sql); + } + } + else + { + // Add group at the end + $new_position = $this->get_group_count(); + } + + $sql_ary = array( + 'group_id' => $group_id, + 'teampage_position' => $new_position + 1, + 'teampage_parent' => $parent_id, + ); + + $sql = 'INSERT INTO ' . TEAMPAGE_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); + $this->db->sql_query($sql); + + $this->cache->destroy('sql', TEAMPAGE_TABLE); + return true; + } + + $this->cache->destroy('sql', TEAMPAGE_TABLE); + return false; + } + + /** + * Adds a new category + * + * @param string $category_name Name of the category to be added + * @return bool True if the category was added successfully + */ + public function add_category_teampage($category_name) + { + if ($category_name === '') + { + return false; + } + + $num_entries = $this->get_group_count(); + + $sql_ary = array( + 'group_id' => 0, + 'teampage_position' => $num_entries + 1, + 'teampage_parent' => 0, + 'teampage_name' => truncate_string($category_name, 255, 255), + ); + + $sql = 'INSERT INTO ' . TEAMPAGE_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); + $this->db->sql_query($sql); + + $this->cache->destroy('sql', TEAMPAGE_TABLE); + return true; + } + + /** + * Deletes a group from the list and closes the gap in the position list. + * + * @param int $group_id group_id of the group to be deleted + * @param bool $skip_group Skip setting the value for this group, to save the query, when you need to update it anyway. + * @return bool True if the group was deleted successfully + */ + public function delete_group($group_id, $skip_group = false) + { + $current_value = $this->get_group_value($group_id); + + if ($current_value != self::GROUP_DISABLED) + { + $sql = 'UPDATE ' . TEAMPAGE_TABLE . ' + SET teampage_position = teampage_position - 1 + WHERE teampage_position > ' . $current_value; + $this->db->sql_query($sql); + + $sql = 'DELETE FROM ' . TEAMPAGE_TABLE . ' + WHERE group_id = ' . $group_id; + $this->db->sql_query($sql); + + $this->cache->destroy('sql', TEAMPAGE_TABLE); + return true; + } + + $this->cache->destroy('sql', TEAMPAGE_TABLE); + return false; + } + + /** + * Deletes an item from the list and closes the gap in the position list. + * + * @param int $teampage_id teampage_id of the item to be deleted + * @param bool $skip_group Skip setting the group to GROUP_DISABLED, to save the query, when you need to update it anyway. + * @return bool True if the item was deleted successfully + */ + public function delete_teampage($teampage_id, $skip_group = false) + { + $current_value = $this->get_teampage_value($teampage_id); + + if ($current_value != self::GROUP_DISABLED) + { + $sql = 'DELETE FROM ' . TEAMPAGE_TABLE . ' + WHERE teampage_id = ' . $teampage_id . ' + OR teampage_parent = ' . $teampage_id; + $this->db->sql_query($sql); + + $delta = (int) $this->db->sql_affectedrows(); + + $sql = 'UPDATE ' . TEAMPAGE_TABLE . ' + SET teampage_position = teampage_position - ' . $delta . ' + WHERE teampage_position > ' . $current_value; + $this->db->sql_query($sql); + + $this->cache->destroy('sql', TEAMPAGE_TABLE); + return true; + } + + $this->cache->destroy('sql', TEAMPAGE_TABLE); + return false; + } + + /** + * {@inheritDoc} + */ + public function move_up($group_id) + { + return $this->move($group_id, 1); + } + + /** + * Moves an item up by teampage_id + * + * @param int $teampage_id teampage_id of the item to be move + * @return bool True if the group was moved successfully + */ + public function move_up_teampage($teampage_id) + { + return $this->move_teampage($teampage_id, 1); + } + + /** + * {@inheritDoc} + */ + public function move_down($group_id) + { + return $this->move($group_id, -1); + } + + /** + * Moves an item down by teampage_id + * + * @param int $teampage_id teampage_id of the item to be moved + * @return bool True if the group was moved successfully + */ + public function move_down_teampage($teampage_id) + { + return $this->move_teampage($teampage_id, -1); + } + + /** + * {@inheritDoc} + */ + public function move($group_id, $delta) + { + $delta = (int) $delta; + if (!$delta) + { + return false; + } + + $move_up = ($delta > 0) ? true : false; + $data = $this->get_group_values($group_id); + + $current_value = (int) $data['teampage_position']; + if ($current_value != self::GROUP_DISABLED) + { + $this->db->sql_transaction('begin'); + + if (!$move_up && $data['teampage_parent'] == self::NO_PARENT) + { + // If we move items down, we need to grab the one sibling more, + // so we do not ignore the children of the previous sibling. + // We will remove the additional sibling later on. + $delta = abs($delta) + 1; + } + + $sql = 'SELECT teampage_position + FROM ' . TEAMPAGE_TABLE . ' + WHERE teampage_parent = ' . (int) $data['teampage_parent'] . ' + AND teampage_position' . (($move_up) ? ' < ' : ' > ') . $current_value . ' + ORDER BY teampage_position' . (($move_up) ? ' DESC' : ' ASC'); + $result = $this->db->sql_query_limit($sql, $delta); + + $sibling_count = 0; + $sibling_limit = $delta; + + // Reset the delta, as we recalculate the new real delta + $delta = 0; + while ($row = $this->db->sql_fetchrow($result)) + { + $sibling_count++; + $delta = $current_value - $row['teampage_position']; + + if (!$move_up && $data['teampage_parent'] == self::NO_PARENT && $sibling_count == $sibling_limit) + { + // Remove the additional sibling we added previously + $delta++; + } + } + $this->db->sql_freeresult($result); + + if ($delta) + { + // First we move all items between our current value and the target value up/down 1, + // so we have a gap for our item to move. + $sql = 'UPDATE ' . TEAMPAGE_TABLE . ' + SET teampage_position = teampage_position' . (($move_up) ? ' + 1' : ' - 1') . ' + WHERE teampage_position' . (($move_up) ? ' >= ' : ' <= ') . ($current_value - $delta) . ' + AND teampage_position' . (($move_up) ? ' < ' : ' > ') . $current_value; + $this->db->sql_query($sql); + + // And now finally, when we moved some other items and built a gap, + // we can move the desired item to it. + $sql = 'UPDATE ' . TEAMPAGE_TABLE . ' + SET teampage_position = teampage_position ' . (($move_up) ? ' - ' : ' + ') . abs($delta) . ' + WHERE group_id = ' . (int) $group_id; + $this->db->sql_query($sql); + + $this->db->sql_transaction('commit'); + $this->cache->destroy('sql', TEAMPAGE_TABLE); + + return true; + } + + $this->db->sql_transaction('commit'); + } + + $this->cache->destroy('sql', TEAMPAGE_TABLE); + return false; + } + + /** + * Moves an item up/down + * + * @param int $teampage_id teampage_id of the item to be moved + * @param int $delta number of steps: + * - positive = move up + * - negative = move down + * @return bool True if the group was moved successfully + */ + public function move_teampage($teampage_id, $delta) + { + $delta = (int) $delta; + if (!$delta) + { + return false; + } + + $move_up = ($delta > 0) ? true : false; + $data = $this->get_teampage_values($teampage_id); + + $current_value = (int) $data['teampage_position']; + if ($current_value != self::GROUP_DISABLED) + { + $this->db->sql_transaction('begin'); + + if (!$move_up && $data['teampage_parent'] == self::NO_PARENT) + { + // If we move items down, we need to grab the one sibling more, + // so we do not ignore the children of the previous sibling. + // We will remove the additional sibling later on. + $delta = abs($delta) + 1; + } + + $sql = 'SELECT teampage_id, teampage_position + FROM ' . TEAMPAGE_TABLE . ' + WHERE teampage_parent = ' . (int) $data['teampage_parent'] . ' + AND teampage_position' . (($move_up) ? ' < ' : ' > ') . $current_value . ' + ORDER BY teampage_position' . (($move_up) ? ' DESC' : ' ASC'); + $result = $this->db->sql_query_limit($sql, $delta); + + $sibling_count = 0; + $sibling_limit = $delta; + + // Reset the delta, as we recalculate the new real delta + $delta = 0; + while ($row = $this->db->sql_fetchrow($result)) + { + $sibling_count++; + $delta = $current_value - $row['teampage_position']; + + // Remove the additional sibling we added previously + // But only, if we included it, this is not be the case + // when we reached the end of our list + if (!$move_up && $data['teampage_parent'] == self::NO_PARENT && $sibling_count == $sibling_limit) + { + $delta++; + } + } + $this->db->sql_freeresult($result); + + if ($delta) + { + $sql = 'SELECT COUNT(teampage_id) as num_items + FROM ' . TEAMPAGE_TABLE . ' + WHERE teampage_id = ' . (int) $teampage_id . ' + OR teampage_parent = ' . (int) $teampage_id; + $result = $this->db->sql_query($sql); + $num_items = (int) $this->db->sql_fetchfield('num_items'); + $this->db->sql_freeresult($result); + + // First we move all items between our current value and the target value up/down 1, + // so we have a gap for our item to move. + $sql = 'UPDATE ' . TEAMPAGE_TABLE . ' + SET teampage_position = teampage_position' . (($move_up) ? ' + ' : ' - ') . $num_items . ' + WHERE teampage_position' . (($move_up) ? ' >= ' : ' <= ') . ($current_value - $delta) . ' + AND teampage_position' . (($move_up) ? ' < ' : ' > ') . $current_value . ' + AND NOT (teampage_id = ' . (int) $teampage_id . ' + OR teampage_parent = ' . (int) $teampage_id . ')'; + $this->db->sql_query($sql); + + $delta = (!$move_up && $data['teampage_parent'] == self::NO_PARENT) ? (abs($delta) - ($num_items - 1)) : abs($delta); + + // And now finally, when we moved some other items and built a gap, + // we can move the desired item to it. + $sql = 'UPDATE ' . TEAMPAGE_TABLE . ' + SET teampage_position = teampage_position ' . (($move_up) ? ' - ' : ' + ') . $delta . ' + WHERE teampage_id = ' . (int) $teampage_id . ' + OR teampage_parent = ' . (int) $teampage_id; + $this->db->sql_query($sql); + + $this->db->sql_transaction('commit'); + $this->cache->destroy('sql', TEAMPAGE_TABLE); + + return true; + } + + $this->db->sql_transaction('commit'); + } + + $this->cache->destroy('sql', TEAMPAGE_TABLE); + return false; + } + + /** + * Get group type language var + * + * @param int $group_type group_type from the groups-table + * @return string name of the language variable for the given group-type. + */ + static public function group_type_language($group_type) + { + switch ($group_type) + { + case GROUP_OPEN: + return 'GROUP_REQUEST'; + case GROUP_CLOSED: + return 'GROUP_CLOSED'; + case GROUP_HIDDEN: + return 'GROUP_HIDDEN'; + case GROUP_SPECIAL: + return 'GROUP_SPECIAL'; + case GROUP_FREE: + return 'GROUP_OPEN'; + } + } +} diff --git a/sources/phpBB/phpbb/hook/finder.php b/sources/phpBB/phpbb/hook/finder.php new file mode 100644 index 0000000..a3d02d3 --- /dev/null +++ b/sources/phpBB/phpbb/hook/finder.php @@ -0,0 +1,80 @@ + +* @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\hook; + +/** +* The hook finder locates installed hooks. +*/ +class finder +{ + protected $phpbb_root_path; + protected $cache; + protected $php_ext; + + /** + * Creates a new finder instance. + * + * @param string $phpbb_root_path Path to the phpbb root directory + * @param string $php_ext php file extension + * @param \phpbb\cache\driver\driver_interface $cache A cache instance or null + */ + public function __construct($phpbb_root_path, $php_ext, \phpbb\cache\driver\driver_interface $cache = null) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->cache = $cache; + $this->php_ext = $php_ext; + } + + /** + * Finds all hook files. + * + * @param bool $cache Whether the result should be cached + * @return array An array of paths to found hook files + */ + public function find($cache = true) + { + if (!defined('DEBUG') && $cache && $this->cache) + { + $hook_files = $this->cache->get('_hooks'); + if ($hook_files !== false) + { + return $hook_files; + } + } + + $hook_files = array(); + + // Now search for hooks... + $dh = @opendir($this->phpbb_root_path . 'includes/hooks/'); + + if ($dh) + { + while (($file = readdir($dh)) !== false) + { + if (strpos($file, 'hook_') === 0 && substr($file, -strlen('.' . $this->php_ext)) === '.' . $this->php_ext) + { + $hook_files[] = substr($file, 0, -(strlen($this->php_ext) + 1)); + } + } + closedir($dh); + } + + if ($cache && $this->cache) + { + $this->cache->put('_hooks', $hook_files); + } + + return $hook_files; + } +} diff --git a/sources/phpBB/phpbb/json_response.php b/sources/phpBB/phpbb/json_response.php new file mode 100644 index 0000000..5219cd0 --- /dev/null +++ b/sources/phpBB/phpbb/json_response.php @@ -0,0 +1,38 @@ + +* @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; + +/** +* JSON class +*/ +class json_response +{ + /** + * Send the data to the client and exit the script. + * + * @param array $data Any additional data to send. + * @param bool $exit Will exit the script if true. + */ + public function send($data, $exit = true) + { + header('Content-Type: application/json'); + echo json_encode($data); + + if ($exit) + { + garbage_collection(); + exit_handler(); + } + } +} diff --git a/sources/phpBB/phpbb/lock/db.php b/sources/phpBB/phpbb/lock/db.php new file mode 100644 index 0000000..85ba9a7 --- /dev/null +++ b/sources/phpBB/phpbb/lock/db.php @@ -0,0 +1,146 @@ + +* @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\lock; + +/** +* Database locking class +*/ +class db +{ + /** + * Name of the config variable this lock uses + * @var string + */ + private $config_name; + + /** + * Unique identifier for this lock. + * + * @var string + */ + private $unique_id; + + /** + * Stores the state of this lock + * @var bool + */ + private $locked; + + /** + * The phpBB configuration + * @var \phpbb\config\config + */ + private $config; + + /** + * A database connection + * @var \phpbb\db\driver\driver_interface + */ + private $db; + + /** + * Creates a named released instance of the lock. + * + * You have to call acquire() to actually create the lock. + * + * @param string $config_name A config variable to be used for locking + * @param \phpbb\config\config $config The phpBB configuration + * @param \phpbb\db\driver\driver_interface $db A database connection + */ + public function __construct($config_name, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db) + { + $this->config_name = $config_name; + $this->config = $config; + $this->db = $db; + } + + /** + * Tries to acquire the lock by updating + * the configuration variable in the database. + * + * As a lock may only be held by one process at a time, lock + * acquisition may fail if another process is holding the lock + * or if another process obtained the lock but never released it. + * Locks are forcibly released after a timeout of 1 hour. + * + * @return bool true if lock was acquired + * false otherwise + */ + public function acquire() + { + if ($this->locked) + { + return false; + } + + if (!isset($this->config[$this->config_name])) + { + $this->config->set($this->config_name, '0', false); + } + $lock_value = $this->config[$this->config_name]; + + // make sure lock cannot be acquired by multiple processes + if ($lock_value) + { + // if the other process is running more than an hour already we have to assume it + // aborted without cleaning the lock + $time = explode(' ', $lock_value); + $time = $time[0]; + + if ($time + 3600 >= time()) + { + return false; + } + } + + $this->unique_id = time() . ' ' . unique_id(); + + // try to update the config value, if it was already modified by another + // process we failed to acquire the lock. + $this->locked = $this->config->set_atomic($this->config_name, $lock_value, $this->unique_id, false); + + return $this->locked; + } + + /** + * Does this process own the lock? + * + * @return bool true if lock is owned + * false otherwise + */ + public function owns_lock() + { + return (bool) $this->locked; + } + + /** + * Releases the lock. + * + * The lock must have been previously obtained, that is, acquire() call + * was issued and returned true. + * + * Note: Attempting to release a lock that is already released, + * that is, calling release() multiple times, is harmless. + * + * @return null + */ + public function release() + { + if ($this->locked) + { + $this->config->set_atomic($this->config_name, $this->unique_id, '0', false); + $this->locked = false; + } + } +} diff --git a/sources/phpBB/phpbb/lock/flock.php b/sources/phpBB/phpbb/lock/flock.php new file mode 100644 index 0000000..df88e14 --- /dev/null +++ b/sources/phpBB/phpbb/lock/flock.php @@ -0,0 +1,141 @@ + +* @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\lock; + +/** +* File locking class +*/ +class flock +{ + /** + * Path to the file to which access is controlled + * + * @var string + */ + private $path; + + /** + * File pointer for the lock file + * @var string + */ + private $lock_fp; + + /** + * Constructor. + * + * You have to call acquire() to actually acquire the lock. + * + * @param string $path Path to the file to which access is controlled + */ + public function __construct($path) + { + $this->path = $path; + $this->lock_fp = null; + } + + /** + * Tries to acquire the lock. + * + * If the lock is already held by another process, this call will block + * until the other process releases the lock. If a lock is acquired and + * is not released before script finishes but the process continues to + * live (apache/fastcgi) then subsequent processes trying to acquire + * the same lock will be blocked forever. + * + * If the lock is already held by the same process via another instance + * of this class, this call will block forever. + * + * If flock function is disabled in php or fails to work, lock + * acquisition will fail and false will be returned. + * + * @return bool true if lock was acquired + * false otherwise + */ + public function acquire() + { + if ($this->lock_fp) + { + return false; + } + + // For systems that can't have two processes opening + // one file for writing simultaneously + if (file_exists($this->path . '.lock')) + { + $mode = 'rb'; + } + else + { + $mode = 'wb'; + } + + $this->lock_fp = @fopen($this->path . '.lock', $mode); + + if ($mode == 'wb') + { + if (!$this->lock_fp) + { + // Two processes may attempt to create lock file at the same time. + // Have the losing process try opening the lock file again for reading + // on the assumption that the winning process created it + $mode = 'rb'; + $this->lock_fp = @fopen($this->path . '.lock', $mode); + } + else + { + // Only need to set mode when the lock file is written + @chmod($this->path . '.lock', 0666); + } + } + + if ($this->lock_fp) + { + @flock($this->lock_fp, LOCK_EX); + } + + return (bool) $this->lock_fp; + } + + /** + * Does this process own the lock? + * + * @return bool true if lock is owned + * false otherwise + */ + public function owns_lock() + { + return (bool) $this->lock_fp; + } + + /** + * Releases the lock. + * + * The lock must have been previously obtained, that is, acquire() call + * was issued and returned true. + * + * Note: Attempting to release a lock that is already released, + * that is, calling release() multiple times, is harmless. + * + * @return null + */ + public function release() + { + if ($this->lock_fp) + { + @flock($this->lock_fp, LOCK_UN); + fclose($this->lock_fp); + $this->lock_fp = null; + } + } +} diff --git a/sources/phpBB/phpbb/log/log.php b/sources/phpBB/phpbb/log/log.php new file mode 100644 index 0000000..0c52055 --- /dev/null +++ b/sources/phpBB/phpbb/log/log.php @@ -0,0 +1,907 @@ + +* @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\log; + +/** +* This class is used to add entries into the log table. +*/ +class log implements \phpbb\log\log_interface +{ + /** + * If set, administrative user profile links will be returned and messages + * will not be censored. + * @var bool + */ + protected $is_in_admin; + + /** + * An array with the disabled log types. Logs of such types will not be + * added when add_log() is called. + * @var array + */ + protected $disabled_types; + + /** + * Keeps the total log count of the last call to get_logs() + * @var int + */ + protected $entry_count; + + /** + * Keeps the offset of the last valid page of the last call to get_logs() + * @var int + */ + protected $last_page_offset; + + /** + * The table we use to store our logs. + * @var string + */ + protected $log_table; + + /** + * Database object + * @var \phpbb\db\driver\driver + */ + protected $db; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Auth object + * @var \phpbb\auth\auth + */ + protected $auth; + + /** + * Event dispatcher object + * @var \phpbb\event\dispatcher_interface + */ + protected $dispatcher; + + /** + * phpBB root path + * @var string + */ + protected $phpbb_root_path; + + /** + * Admin root path + * @var string + */ + protected $phpbb_admin_path; + + /** + * PHP Extension + * @var string + */ + protected $php_ext; + + /** + * Constructor + * + * @param \phpbb\db\driver\driver_interface $db Database object + * @param \phpbb\user $user User object + * @param \phpbb\auth\auth $auth Auth object + * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher + * @param string $phpbb_root_path Root path + * @param string $relative_admin_path Relative admin root path + * @param string $php_ext PHP Extension + * @param string $log_table Name of the table we use to store our logs + */ + public function __construct($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, $relative_admin_path, $php_ext, $log_table) + { + $this->db = $db; + $this->user = $user; + $this->auth = $auth; + $this->dispatcher = $phpbb_dispatcher; + $this->phpbb_root_path = $phpbb_root_path; + $this->phpbb_admin_path = $this->phpbb_root_path . $relative_admin_path; + $this->php_ext = $php_ext; + $this->log_table = $log_table; + + /* + * IN_ADMIN is set after the session is created, + * so we need to take ADMIN_START into account as well, otherwise + * it will not work for the \phpbb\log\log object we create in common.php + */ + $this->set_is_admin((defined('ADMIN_START') && ADMIN_START) || (defined('IN_ADMIN') && IN_ADMIN)); + $this->enable(); + } + + /** + * Set is_in_admin in order to return administrative user profile links + * in get_logs() + * + * @param bool $is_in_admin Are we called from within the acp? + * @return null + */ + public function set_is_admin($is_in_admin) + { + $this->is_in_admin = (bool) $is_in_admin; + } + + /** + * Returns the is_in_admin option + * + * @return bool + */ + public function get_is_admin() + { + return $this->is_in_admin; + } + + /** + * Set table name + * + * @param string $log_table Can overwrite the table to use for the logs + * @return null + */ + public function set_log_table($log_table) + { + $this->log_table = $log_table; + } + + /** + * {@inheritDoc} + */ + public function is_enabled($type = '') + { + if ($type == '' || $type == 'all') + { + return !isset($this->disabled_types['all']); + } + return !isset($this->disabled_types[$type]) && !isset($this->disabled_types['all']); + } + + /** + * {@inheritDoc} + */ + public function disable($type = '') + { + if (is_array($type)) + { + foreach ($type as $disable_type) + { + $this->disable($disable_type); + } + return; + } + + // Empty string is an equivalent for all types. + if ($type == '') + { + $type = 'all'; + } + $this->disabled_types[$type] = true; + } + + /** + * {@inheritDoc} + */ + public function enable($type = '') + { + if (is_array($type)) + { + foreach ($type as $enable_type) + { + $this->enable($enable_type); + } + return; + } + + if ($type == '' || $type == 'all') + { + $this->disabled_types = array(); + return; + } + unset($this->disabled_types[$type]); + } + + /** + * {@inheritDoc} + */ + public function add($mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = array()) + { + if (!$this->is_enabled($mode)) + { + return false; + } + + if ($log_time == false) + { + $log_time = time(); + } + + $sql_ary = array( + 'user_id' => $user_id, + 'log_ip' => $log_ip, + 'log_time' => $log_time, + 'log_operation' => $log_operation, + ); + + switch ($mode) + { + case 'admin': + $sql_ary += array( + 'log_type' => LOG_ADMIN, + 'log_data' => (!empty($additional_data)) ? serialize($additional_data) : '', + ); + break; + + case 'mod': + $forum_id = isset($additional_data['forum_id']) ? (int) $additional_data['forum_id'] : 0; + unset($additional_data['forum_id']); + $topic_id = isset($additional_data['topic_id']) ? (int) $additional_data['topic_id'] : 0; + unset($additional_data['topic_id']); + $sql_ary += array( + 'log_type' => LOG_MOD, + 'forum_id' => $forum_id, + 'topic_id' => $topic_id, + 'log_data' => (!empty($additional_data)) ? serialize($additional_data) : '', + ); + break; + + case 'user': + $reportee_id = (int) $additional_data['reportee_id']; + unset($additional_data['reportee_id']); + + $sql_ary += array( + 'log_type' => LOG_USERS, + 'reportee_id' => $reportee_id, + 'log_data' => (!empty($additional_data)) ? serialize($additional_data) : '', + ); + break; + + case 'critical': + $sql_ary += array( + 'log_type' => LOG_CRITICAL, + 'log_data' => (!empty($additional_data)) ? serialize($additional_data) : '', + ); + break; + } + + /** + * Allows to modify log data before we add it to the database + * + * NOTE: if sql_ary does not contain a log_type value, the entry will + * not be stored in the database. So ensure to set it, if needed. + * + * @event core.add_log + * @var string mode Mode of the entry we log + * @var int user_id ID of the user who triggered the log + * @var string log_ip IP of the user who triggered the log + * @var string log_operation Language key of the log operation + * @var int log_time Timestamp, when the log was added + * @var array additional_data Array with additional log data + * @var array sql_ary Array with log data we insert into the + * database. If sql_ary[log_type] is not set, + * we won't add the entry to the database. + * @since 3.1.0-a1 + */ + $vars = array( + 'mode', + 'user_id', + 'log_ip', + 'log_operation', + 'log_time', + 'additional_data', + 'sql_ary', + ); + extract($this->dispatcher->trigger_event('core.add_log', compact($vars))); + + // We didn't find a log_type, so we don't save it in the database. + if (!isset($sql_ary['log_type'])) + { + return false; + } + + $this->db->sql_query('INSERT INTO ' . $this->log_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary)); + + return $this->db->sql_nextid(); + } + + /** + * {@inheritDoc} + */ + public function delete($mode, $conditions = array()) + { + switch ($mode) + { + case 'admin': + $log_type = LOG_ADMIN; + break; + + case 'mod': + $log_type = LOG_MOD; + break; + + case 'user': + $log_type = LOG_USERS; + break; + + case 'users': + $log_type = LOG_USERS; + break; + + case 'critical': + $log_type = LOG_CRITICAL; + break; + + default: + $log_type = false; + } + + /** + * Allows to modify log data before we delete it from the database + * + * NOTE: if sql_ary does not contain a log_type value, the entry will + * not be deleted in the database. So ensure to set it, if needed. + * + * @event core.delete_log + * @var string mode Mode of the entry we log + * @var string log_type Type ID of the log (should be different than false) + * @var array conditions An array of conditions, 3 different forms are accepted + * 1) => transformed into 'AND = ' (value should be an integer) + * 2) => array(, ) transformed into 'AND ' (values can't be an array) + * 3) => array('IN' => array()) transformed into 'AND IN ' + * A special field, keywords, can also be defined. In this case only the log entries that have the keywords in log_operation or log_data will be deleted. + * @since 3.1.0-b4 + */ + $vars = array( + 'mode', + 'log_type', + 'conditions', + ); + extract($this->dispatcher->trigger_event('core.delete_log', compact($vars))); + + if ($log_type === false) + { + return; + } + + $sql_where = 'WHERE log_type = ' . $log_type; + + if (isset($conditions['keywords'])) + { + $sql_where .= $this->generate_sql_keyword($conditions['keywords'], ''); + + unset($conditions['keywords']); + } + + foreach ($conditions as $field => $field_value) + { + $sql_where .= ' AND '; + + if (is_array($field_value) && sizeof($field_value) == 2 && !is_array($field_value[1])) + { + $sql_where .= $field . ' ' . $field_value[0] . ' ' . $field_value[1]; + } + else if (is_array($field_value) && isset($field_value['IN']) && is_array($field_value['IN'])) + { + $sql_where .= $this->db->sql_in_set($field, $field_value['IN']); + } + else + { + $sql_where .= $field . ' = ' . $field_value; + } + } + + $sql = 'DELETE FROM ' . LOG_TABLE . " + $sql_where"; + $this->db->sql_query($sql); + + $this->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_CLEAR_' . strtoupper($mode)); + } + + /** + * {@inheritDoc} + */ + public function get_logs($mode, $count_logs = true, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $log_time = 0, $sort_by = 'l.log_time DESC', $keywords = '') + { + $this->entry_count = 0; + $this->last_page_offset = $offset; + + $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&mode=overview') : append_sid("{$this->phpbb_root_path}memberlist.{$this->php_ext}", 'mode=viewprofile'); + + switch ($mode) + { + case 'admin': + $log_type = LOG_ADMIN; + $sql_additional = ''; + break; + + case 'mod': + $log_type = LOG_MOD; + $sql_additional = ''; + + if ($topic_id) + { + $sql_additional = 'AND l.topic_id = ' . (int) $topic_id; + } + else if (is_array($forum_id)) + { + $sql_additional = 'AND ' . $this->db->sql_in_set('l.forum_id', array_map('intval', $forum_id)); + } + else if ($forum_id) + { + $sql_additional = 'AND l.forum_id = ' . (int) $forum_id; + } + break; + + case 'user': + $log_type = LOG_USERS; + $sql_additional = 'AND l.reportee_id = ' . (int) $user_id; + break; + + case 'users': + $log_type = LOG_USERS; + $sql_additional = ''; + break; + + case 'critical': + $log_type = LOG_CRITICAL; + $sql_additional = ''; + break; + + default: + $log_type = false; + $sql_additional = ''; + } + + /** + * Overwrite log type and limitations before we count and get the logs + * + * NOTE: if log_type is false, no entries will be returned. + * + * @event core.get_logs_modify_type + * @var string mode Mode of the entries we display + * @var bool count_logs Do we count all matching entries? + * @var int limit Limit the number of entries + * @var int offset Offset when fetching the entries + * @var mixed forum_id Limit entries to the forum_id, + * can also be an array of forum_ids + * @var int topic_id Limit entries to the topic_id + * @var int user_id Limit entries to the user_id + * @var int log_time Limit maximum age of log entries + * @var string sort_by SQL order option + * @var string keywords Will only return entries that have the + * keywords in log_operation or log_data + * @var string profile_url URL to the users profile + * @var int log_type Limit logs to a certain type. If log_type + * is false, no entries will be returned. + * @var string sql_additional Additional conditions for the entries, + * e.g.: 'AND l.forum_id = 1' + * @since 3.1.0-a1 + */ + $vars = array( + 'mode', + 'count_logs', + 'limit', + 'offset', + 'forum_id', + 'topic_id', + 'user_id', + 'log_time', + 'sort_by', + 'keywords', + 'profile_url', + 'log_type', + 'sql_additional', + ); + extract($this->dispatcher->trigger_event('core.get_logs_modify_type', compact($vars))); + + if ($log_type === false) + { + $this->last_page_offset = 0; + return array(); + } + + $sql_keywords = ''; + if (!empty($keywords)) + { + // Get the SQL condition for our keywords + $sql_keywords = $this->generate_sql_keyword($keywords); + } + + if ($count_logs) + { + $sql = 'SELECT COUNT(l.log_id) AS total_entries + FROM ' . $this->log_table . ' l, ' . USERS_TABLE . ' u + WHERE l.log_type = ' . (int) $log_type . ' + AND l.user_id = u.user_id + AND l.log_time >= ' . (int) $log_time . " + $sql_keywords + $sql_additional"; + $result = $this->db->sql_query($sql); + $this->entry_count = (int) $this->db->sql_fetchfield('total_entries'); + $this->db->sql_freeresult($result); + + if ($this->entry_count == 0) + { + // Save the queries, because there are no logs to display + $this->last_page_offset = 0; + return array(); + } + + // Return the user to the last page that is valid + while ($this->last_page_offset >= $this->entry_count) + { + $this->last_page_offset = max(0, $this->last_page_offset - $limit); + } + } + + $sql = 'SELECT l.*, u.username, u.username_clean, u.user_colour + FROM ' . $this->log_table . ' l, ' . USERS_TABLE . ' u + WHERE l.log_type = ' . (int) $log_type . ' + AND u.user_id = l.user_id + ' . (($log_time) ? 'AND l.log_time >= ' . (int) $log_time : '') . " + $sql_keywords + $sql_additional + ORDER BY $sort_by"; + $result = $this->db->sql_query_limit($sql, $limit, $this->last_page_offset); + + $i = 0; + $log = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $row['forum_id'] = (int) $row['forum_id']; + if ($row['topic_id']) + { + $topic_id_list[] = (int) $row['topic_id']; + } + + if ($row['reportee_id']) + { + $reportee_id_list[] = (int) $row['reportee_id']; + } + + $log_entry_data = array( + 'id' => (int) $row['log_id'], + + 'reportee_id' => (int) $row['reportee_id'], + 'reportee_username' => '', + 'reportee_username_full'=> '', + + 'user_id' => (int) $row['user_id'], + 'username' => $row['username'], + 'username_full' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, $profile_url), + + 'ip' => $row['log_ip'], + 'time' => (int) $row['log_time'], + 'forum_id' => (int) $row['forum_id'], + 'topic_id' => (int) $row['topic_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'])) . '}', + ); + + /** + * Modify the entry's data before it is returned + * + * @event core.get_logs_modify_entry_data + * @var array row Entry data from the database + * @var array log_entry_data Entry's data which is returned + * @since 3.1.0-a1 + */ + $vars = array('row', 'log_entry_data'); + extract($this->dispatcher->trigger_event('core.get_logs_modify_entry_data', compact($vars))); + + $log[$i] = $log_entry_data; + + if (!empty($row['log_data'])) + { + $log_data_ary = unserialize($row['log_data']); + $log_data_ary = ($log_data_ary !== false) ? $log_data_ary : array(); + + if (isset($this->user->lang[$row['log_operation']])) + { + // Check if there are more occurrences of % than + // arguments, if there are we fill out the arguments + // array. It doesn't matter if we add more arguments than + // placeholders. + $num_args = 0; + if (!is_array($this->user->lang[$row['log_operation']])) + { + $num_args = substr_count($this->user->lang[$row['log_operation']], '%'); + } + else + { + foreach ($this->user->lang[$row['log_operation']] as $case => $plural_string) + { + $num_args = max($num_args, substr_count($plural_string, '%')); + } + } + + if (($num_args - sizeof($log_data_ary)) > 0) + { + $log_data_ary = array_merge($log_data_ary, array_fill(0, $num_args - sizeof($log_data_ary), '')); + } + + $lang_arguments = array_merge(array($log[$i]['action']), $log_data_ary); + $log[$i]['action'] = call_user_func_array(array($this->user, 'lang'), $lang_arguments); + + // If within the admin panel we do not censor text out + if ($this->get_is_admin()) + { + $log[$i]['action'] = bbcode_nl2br($log[$i]['action']); + } + else + { + $log[$i]['action'] = bbcode_nl2br(censor_text($log[$i]['action'])); + } + } + else if (!empty($log_data_ary)) + { + $log[$i]['action'] .= '
' . implode('', $log_data_ary); + } + + /* Apply make_clickable... has to be seen if it is for good. :/ + // Seems to be not for the moment, reconsider later... + $log[$i]['action'] = make_clickable($log[$i]['action']); + */ + } + else + { + $log[$i]['action'] = $this->user->lang($log[$i]['action']); + } + + $i++; + } + $this->db->sql_freeresult($result); + + /** + * Get some additional data after we got all log entries + * + * @event core.get_logs_get_additional_data + * @var array log Array with all our log entries + * @var array topic_id_list Array of topic ids, for which we + * get the permission data + * @var array reportee_id_list Array of additional user IDs we + * get the username strings for + * @since 3.1.0-a1 + */ + $vars = array('log', 'topic_id_list', 'reportee_id_list'); + extract($this->dispatcher->trigger_event('core.get_logs_get_additional_data', compact($vars))); + + if (sizeof($topic_id_list)) + { + $topic_auth = $this->get_topic_auth($topic_id_list); + + 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']] . '&t=' . $row['topic_id']) : false; + $log[$key]['viewlogs'] = (isset($topic_auth['m_'][$row['topic_id']])) ? append_sid("{$this->phpbb_root_path}mcp.{$this->php_ext}", 'i=logs&mode=topic_logs&t=' . $row['topic_id'], true, $this->user->session_id) : false; + } + } + + if (sizeof($reportee_id_list)) + { + $reportee_data_list = $this->get_reportee_data($reportee_id_list); + + foreach ($log as $key => $row) + { + if (!isset($reportee_data_list[$row['reportee_id']])) + { + continue; + } + + $log[$key]['reportee_username'] = $reportee_data_list[$row['reportee_id']]['username']; + $log[$key]['reportee_username_full'] = get_username_string('full', $row['reportee_id'], $reportee_data_list[$row['reportee_id']]['username'], $reportee_data_list[$row['reportee_id']]['user_colour'], false, $profile_url); + } + } + + /** + * Allow modifying or execute extra final filter on log entries + * + * @event core.get_logs_after + * @var array log Array with all our log entries + * @var array topic_id_list Array of topic ids, for which we + * get the permission data + * @var array reportee_id_list Array of additional user IDs we + * get the username strings for + * @var string mode Mode of the entries we display + * @var bool count_logs Do we count all matching entries? + * @var int limit Limit the number of entries + * @var int offset Offset when fetching the entries + * @var mixed forum_id Limit entries to the forum_id, + * can also be an array of forum_ids + * @var int topic_id Limit entries to the topic_id + * @var int user_id Limit entries to the user_id + * @var int log_time Limit maximum age of log entries + * @var string sort_by SQL order option + * @var string keywords Will only return entries that have the + * keywords in log_operation or log_data + * @var string profile_url URL to the users profile + * @var int log_type The type of logs it was filtered + * @since 3.1.3-RC1 + */ + $vars = array( + 'log', + 'topic_id_list', + 'reportee_id_list', + 'mode', + 'count_logs', + 'limit', + 'offset', + 'forum_id', + 'topic_id', + 'user_id', + 'log_time', + 'sort_by', + 'keywords', + 'profile_url', + 'log_type', + ); + extract($this->dispatcher->trigger_event('core.get_logs_after', compact($vars))); + + return $log; + } + + /** + * Generates a sql condition for the specified keywords + * + * @param string $keywords The keywords the user specified to search for + * @param string $table_alias The alias of the logs' table ('l.' by default) + * @param string $statement_operator The operator used to prefix the statement ('AND' by default) + * + * @return string Returns the SQL condition searching for the keywords + */ + protected function generate_sql_keyword($keywords, $table_alias = 'l.', $statement_operator = 'AND') + { + // Use no preg_quote for $keywords because this would lead to sole + // backslashes being added. We also use an OR connection here for + // spaces and the | string. Currently, regex is not supported for + // searching (but may come later). + $keywords = preg_split('#[\s|]+#u', utf8_strtolower($keywords), 0, PREG_SPLIT_NO_EMPTY); + $sql_keywords = ''; + + if (!empty($keywords)) + { + $keywords_pattern = array(); + + // Build pattern and keywords... + for ($i = 0, $num_keywords = sizeof($keywords); $i < $num_keywords; $i++) + { + $keywords_pattern[] = preg_quote($keywords[$i], '#'); + $keywords[$i] = $this->db->sql_like_expression($this->db->get_any_char() . $keywords[$i] . $this->db->get_any_char()); + } + + $keywords_pattern = '#' . implode('|', $keywords_pattern) . '#ui'; + + $operations = array(); + foreach ($this->user->lang as $key => $value) + { + if (substr($key, 0, 4) == 'LOG_') + { + if (is_array($value)) + { + foreach ($value as $plural_value) + { + if (preg_match($keywords_pattern, $plural_value)) + { + $operations[] = $key; + break; + } + } + } + else if (preg_match($keywords_pattern, $value)) + { + $operations[] = $key; + } + } + } + + $sql_keywords = ' ' . $statement_operator . ' ('; + if (!empty($operations)) + { + $sql_keywords .= $this->db->sql_in_set($table_alias . 'log_operation', $operations) . ' OR '; + } + $sql_lower = $this->db->sql_lower_text($table_alias . 'log_data'); + $sql_keywords .= " $sql_lower " . implode(" OR $sql_lower ", $keywords) . ')'; + } + + return $sql_keywords; + } + + /** + * Determine whether the user is allowed to read and/or moderate the forum of the topic + * + * @param array $topic_ids Array with the topic ids + * + * @return array Returns an array with two keys 'm_' and 'read_f' which are also an array of topic_id => forum_id sets when the permissions are given. Sample: + * array( + * 'permission' => array( + * topic_id => forum_id + * ), + * ), + */ + protected function get_topic_auth(array $topic_ids) + { + $forum_auth = array('f_read' => array(), 'm_' => array()); + $topic_ids = array_unique($topic_ids); + + $sql = 'SELECT topic_id, forum_id + FROM ' . TOPICS_TABLE . ' + WHERE ' . $this->db->sql_in_set('topic_id', array_map('intval', $topic_ids)); + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $row['topic_id'] = (int) $row['topic_id']; + $row['forum_id'] = (int) $row['forum_id']; + + if ($this->auth->acl_get('f_read', $row['forum_id'])) + { + $forum_auth['f_read'][$row['topic_id']] = $row['forum_id']; + } + + if ($this->auth->acl_gets('a_', 'm_', $row['forum_id'])) + { + $forum_auth['m_'][$row['topic_id']] = $row['forum_id']; + } + } + $this->db->sql_freeresult($result); + + return $forum_auth; + } + + /** + * Get the data for all reportee from the database + * + * @param array $reportee_ids Array with the user ids of the reportees + * + * @return array Returns an array with the reportee data + */ + protected function get_reportee_data(array $reportee_ids) + { + $reportee_ids = array_unique($reportee_ids); + $reportee_data_list = array(); + + $sql = 'SELECT user_id, username, user_colour + FROM ' . USERS_TABLE . ' + WHERE ' . $this->db->sql_in_set('user_id', $reportee_ids); + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $reportee_data_list[$row['user_id']] = $row; + } + $this->db->sql_freeresult($result); + + return $reportee_data_list; + } + + /** + * {@inheritDoc} + */ + public function get_log_count() + { + return ($this->entry_count) ? $this->entry_count : 0; + } + + /** + * {@inheritDoc} + */ + public function get_valid_offset() + { + return ($this->last_page_offset) ? $this->last_page_offset : 0; + } +} diff --git a/sources/phpBB/phpbb/log/log_interface.php b/sources/phpBB/phpbb/log/log_interface.php new file mode 100644 index 0000000..5932f72 --- /dev/null +++ b/sources/phpBB/phpbb/log/log_interface.php @@ -0,0 +1,114 @@ + +* @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\log; + +/** +* The interface for the log-system. +*/ +interface log_interface +{ + /** + * This function returns the state of the log system. + * + * @param string $type The log type we want to check. Empty to get + * global log status. + * + * @return bool True if log for the type is enabled + */ + public function is_enabled($type = ''); + + /** + * 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. + * + * @param mixed $type The log type we want to disable. Empty to + * disable all logs. Can also be an array of types. + * + * @return null + */ + public function disable($type = ''); + + /** + * Enable log + * + * This function allows re-enabling the log system. + * + * @param mixed $type The log type we want to enable. Empty to + * enable all logs. Can also be an array of types. + * + * @return null + */ + public function enable($type = ''); + + /** + * 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 + * + * @return int|bool Returns the log_id, if the entry was added to the database, false otherwise. + */ + public function add($mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = array()); + + /** + * Delete entries in the logs + * + * @param string $mode The mode defines which log_type is used and from which log the entries are deleted + * @param array $conditions An array of conditions, 3 different forms are accepted + * 1) => transformed into 'AND = ' (value should be an integer) + * 2) => array(, ) transformed into 'AND ' (values can't be an array) + * 3) => array('IN' => array()) transformed into 'AND IN ' + * A special field, keywords, can also be defined. In this case only the log entries that have the keywords in log_operation or log_data will be deleted. + */ + public function delete($mode, $conditions = array()); + + /** + * Grab the logs from the database + * + * @param string $mode The mode defines which log_type is used and ifrom which log the entry is retrieved + * @param bool $count_logs Shall we count all matching log entries? + * @param int $limit Limit the number of entries that are returned + * @param int $offset Offset when fetching the log entries, f.e. when paginating + * @param mixed $forum_id Restrict the log entries to the given forum_id (can also be an array of forum_ids) + * @param int $topic_id Restrict the log entries to the given topic_id + * @param int $user_id Restrict the log entries to the given user_id + * @param int $log_time Only get log entries newer than the given timestamp + * @param string $sort_by SQL order option, e.g. 'l.log_time DESC' + * @param string $keywords Will only return log entries that have the keywords in log_operation or log_data + * + * @return array The result array with the logs + */ + public function get_logs($mode, $count_logs = true, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $log_time = 0, $sort_by = 'l.log_time DESC', $keywords = ''); + + /** + * Get total log count + * + * @return int Returns the number of matching logs from the last call to get_logs() + */ + public function get_log_count(); + + /** + * Get offset of the last valid page + * + * @return int Returns the offset of the last valid page from the last call to get_logs() + */ + public function get_valid_offset(); +} diff --git a/sources/phpBB/phpbb/log/null.php b/sources/phpBB/phpbb/log/null.php new file mode 100644 index 0000000..baa7889 --- /dev/null +++ b/sources/phpBB/phpbb/log/null.php @@ -0,0 +1,81 @@ + +* @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\log; + +/** +* Null logger +*/ +class null implements log_interface +{ + /** + * {@inheritdoc} + */ + public function is_enabled($type = '') + { + return false; + } + + /** + * {@inheritdoc} + */ + public function disable($type = '') + { + } + + /** + * {@inheritdoc} + */ + public function enable($type = '') + { + } + + /** + * {@inheritdoc} + */ + public function add($mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = array()) + { + return false; + } + + /** + * {@inheritdoc} + */ + public function delete($mode, $conditions = array()) + { + } + + /** + * {@inheritdoc} + */ + public function get_logs($mode, $count_logs = true, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $log_time = 0, $sort_by = 'l.log_time DESC', $keywords = '') + { + return array(); + } + + /** + * {@inheritdoc} + */ + public function get_log_count() + { + return 0; + } + + /** + * {@inheritdoc} + */ + public function get_valid_offset() + { + return 0; + } +} diff --git a/sources/phpBB/phpbb/message/admin_form.php b/sources/phpBB/phpbb/message/admin_form.php new file mode 100644 index 0000000..96b8d34 --- /dev/null +++ b/sources/phpBB/phpbb/message/admin_form.php @@ -0,0 +1,192 @@ + +* @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\message; + +/** +* Class admin_form +* Displays a message to the user and allows him to send an email +*/ +class admin_form extends form +{ + /** @var \phpbb\config\db_text */ + protected $config_text; + + /** @var string */ + protected $subject; + /** @var string */ + protected $sender_name; + /** @var string */ + protected $sender_address; + + /** + * Construct + * + * @param \phpbb\auth\auth $auth + * @param \phpbb\config\config $config + * @param \phpbb\config\db_text $config_text + * @param \phpbb\db\driver\driver_interface $db + * @param \phpbb\user $user + * @param string $phpbb_root_path + * @param string $phpEx + */ + public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\config\db_text $config_text, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $phpEx) + { + parent::__construct($auth, $config, $db, $user, $phpbb_root_path, $phpEx); + $this->config_text = $config_text; + } + + /** + * {inheritDoc} + */ + public function check_allow() + { + $error = parent::check_allow(); + if ($error) + { + return $error; + } + + if (!$this->config['contact_admin_form_enable']) + { + return 'NO_CONTACT_PAGE'; + } + + return false; + } + + /** + * {inheritDoc} + */ + public function bind(\phpbb\request\request_interface $request) + { + parent::bind($request); + + $this->subject = $request->variable('subject', '', true); + $this->sender_address = $request->variable('email', ''); + $this->sender_name = $request->variable('name', '', true); + } + + /** + * {inheritDoc} + */ + public function submit(\messenger $messenger) + { + if (!$this->subject) + { + $this->errors[] = $this->user->lang['EMPTY_SUBJECT_EMAIL']; + } + if (!$this->body) + { + $this->errors[] = $this->user->lang['EMPTY_MESSAGE_EMAIL']; + } + + if ($this->user->data['is_registered']) + { + $this->message->set_sender_from_user($this->user); + $this->sender_name = $this->user->data['username']; + $this->sender_address = $this->user->data['user_email']; + } + else + { + if (!$this->sender_name) + { + $this->errors[] = $this->user->lang['EMPTY_SENDER_NAME']; + } + + if (!function_exists('validate_data')) + { + require($this->phpbb_root_path . 'includes/functions_user.' . $this->phpEx); + } + + $validate_array = validate_data( + array( + 'email' => $this->sender_address, + ), + array( + 'email' => array( + array('string', false, 6, 60), + array('email'), + ), + ) + ); + + foreach ($validate_array as $error) + { + $this->errors[] = $this->user->lang[$error]; + } + + $this->message->set_sender($this->user->ip, $this->sender_name, $this->sender_address, $this->user->lang_name); + $this->message->set_sender_notify_type(NOTIFY_EMAIL); + } + + $this->message->set_template('contact_admin'); + $this->message->set_subject($this->subject); + $this->message->set_body($this->body); + $this->message->add_recipient( + $this->user->lang['ADMINISTRATOR'], + $this->config['board_contact'], + $this->config['default_lang'], + NOTIFY_EMAIL + ); + + $this->message->set_template_vars(array( + 'FROM_EMAIL_ADDRESS' => $this->sender_address, + 'FROM_IP_ADDRESS' => $this->user->ip, + 'S_IS_REGISTERED' => $this->user->data['is_registered'], + + 'U_FROM_PROFILE' => generate_board_url() . '/memberlist.' . $this->phpEx . '?mode=viewprofile&u=' . $this->user->data['user_id'], + )); + + parent::submit($messenger); + } + + /** + * {inheritDoc} + */ + public function render(\phpbb\template\template $template) + { + $l_admin_info = $this->config_text->get('contact_admin_info'); + if ($l_admin_info) + { + $contact_admin_data = $this->config_text->get_array(array( + 'contact_admin_info', + 'contact_admin_info_uid', + 'contact_admin_info_bitfield', + 'contact_admin_info_flags', + )); + + $l_admin_info = generate_text_for_display( + $contact_admin_data['contact_admin_info'], + $contact_admin_data['contact_admin_info_uid'], + $contact_admin_data['contact_admin_info_bitfield'], + $contact_admin_data['contact_admin_info_flags'] + ); + } + + $template->assign_vars(array( + 'S_CONTACT_ADMIN' => true, + 'S_CONTACT_FORM' => $this->config['contact_admin_form_enable'], + 'S_IS_REGISTERED' => $this->user->data['is_registered'], + 'S_POST_ACTION' => append_sid($this->phpbb_root_path . 'memberlist.' . $this->phpEx, 'mode=contactadmin'), + + 'CONTACT_INFO' => $l_admin_info, + 'MESSAGE' => $this->body, + 'SUBJECT' => $this->subject, + 'NAME' => $this->sender_name, + 'EMAIL' => $this->sender_address, + )); + + parent::render($template); + } +} diff --git a/sources/phpBB/phpbb/message/form.php b/sources/phpBB/phpbb/message/form.php new file mode 100644 index 0000000..21d4de0 --- /dev/null +++ b/sources/phpBB/phpbb/message/form.php @@ -0,0 +1,175 @@ + +* @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\message; + +/** +* Abstract class form +*/ +abstract class form +{ + /** @var \phpbb\auth\auth */ + protected $auth; + /** @var \phpbb\config\config */ + protected $config; + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + /** @var \phpbb\message\message */ + protected $message; + /** @var \phpbb\user */ + protected $user; + + /** @var string */ + protected $phpbb_root_path; + /** @var string */ + protected $phpEx; + + /** @var array */ + protected $errors = array(); + /** @var bool */ + protected $cc_sender; + /** @var string */ + protected $body; + + /** + * Construct + * + * @param \phpbb\auth\auth $auth + * @param \phpbb\config\config $config + * @param \phpbb\db\driver\driver_interface $db + * @param \phpbb\user $user + * @param string $phpbb_root_path + * @param string $phpEx + */ + public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $phpEx) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->phpEx = $phpEx; + $this->user = $user; + $this->auth = $auth; + $this->config = $config; + $this->db = $db; + + $this->message = new message($config['server_name']); + $this->message->set_sender_from_user($this->user); + } + + /** + * Returns the title for the email form page + * + * @return string + */ + public function get_page_title() + { + return $this->user->lang['SEND_EMAIL']; + } + + /** + * Returns the file name of the form template + * + * @return string + */ + public function get_template_file() + { + return 'memberlist_email.html'; + } + + /** + * Checks whether the user is allowed to use the form + * + * @return false|string Error string if not allowed, false otherwise + */ + public function check_allow() + { + if (!$this->config['email_enable']) + { + return 'EMAIL_DISABLED'; + } + + if (time() - $this->user->data['user_emailtime'] < $this->config['flood_interval']) + { + return 'FLOOD_EMAIL_LIMIT'; + } + + return false; + } + + /** + * Get the return link after the message has been sent + * + * @return string + */ + public function get_return_message() + { + return sprintf($this->user->lang['RETURN_INDEX'], '', ''); + } + + /** + * Bind the values of the request to the form + * + * @param \phpbb\request\request_interface $request + * @return null + */ + public function bind(\phpbb\request\request_interface $request) + { + $this->cc_sender = $request->is_set_post('cc_sender'); + $this->body = $request->variable('message', '', true); + } + + /** + * Submit form, generate the email and send it + * + * @param \messenger $messenger + * @return null + */ + public function submit(\messenger $messenger) + { + if (!check_form_key('memberlist_email')) + { + $this->errors[] = 'FORM_INVALID'; + } + + if (!sizeof($this->errors)) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_emailtime = ' . time() . ' + WHERE user_id = ' . $this->user->data['user_id']; + $this->db->sql_query($sql); + + if ($this->cc_sender && $this->user->data['is_registered']) + { + $this->message->cc_sender(); + } + + $this->message->send($messenger, phpbb_get_board_contact($this->config, $this->phpEx)); + + meta_refresh(3, append_sid($this->phpbb_root_path . 'index.' . $this->phpEx)); + trigger_error($this->user->lang['EMAIL_SENT'] . '

' . $this->get_return_message()); + } + } + + /** + * Render the template of the form + * + * @param \phpbb\template\template $template + * @return null + */ + public function render(\phpbb\template\template $template) + { + add_form_key('memberlist_email'); + + $template->assign_vars(array( + 'ERROR_MESSAGE' => (sizeof($this->errors)) ? implode('
', $this->errors) : '', + )); + } +} diff --git a/sources/phpBB/phpbb/message/message.php b/sources/phpBB/phpbb/message/message.php new file mode 100644 index 0000000..5fd24b5 --- /dev/null +++ b/sources/phpBB/phpbb/message/message.php @@ -0,0 +1,282 @@ + +* @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\message; + +/** +* Class message +* Holds all information for an email and sends it in the end +*/ +class message +{ + /** @var string */ + protected $server_name; + + /** @var string */ + protected $subject = ''; + /** @var string */ + protected $body = ''; + /** @var string */ + protected $template = ''; + /** @var array */ + protected $template_vars = array(); + + /** @var string */ + protected $sender_ip = ''; + /** @var string */ + protected $sender_name = ''; + /** @var string */ + protected $sender_address = ''; + /** @var string */ + protected $sender_lang = ''; + /** @var string */ + protected $sender_id = ''; + /** @var string */ + protected $sender_username = ''; + /** @var string */ + protected $sender_jabber = ''; + /** @var int */ + protected $sender_notify_type = NOTIFY_EMAIL; + + /** @var array */ + protected $recipients; + + /** + * Construct + * + * @param string $server_name Used for AntiAbuse header + */ + public function __construct($server_name) + { + $this->server_name = $server_name; + } + + /** + * Set the subject of the email + * + * @param string $subject + * @return null + */ + public function set_subject($subject) + { + $this->subject = $subject; + } + + /** + * Set the body of the email text + * + * @param string $body + * @return null + */ + public function set_body($body) + { + $this->body = $body; + } + + /** + * Set the name of the email template to use + * + * @param string $template + * @return null + */ + public function set_template($template) + { + $this->template = $template; + } + + /** + * Set the array with the "template" data for the email + * + * @param array $template_vars + * @return null + */ + public function set_template_vars($template_vars) + { + $this->template_vars = $template_vars; + } + + /** + * Add a recipient from \phpbb\user + * + * @param array $user + * @return null + */ + public function add_recipient_from_user_row(array $user) + { + $this->add_recipient( + $user['username'], + $user['user_email'], + $user['user_lang'], + $user['user_notify_type'], + $user['username'], + $user['user_jabber'] + ); + } + + /** + * Add a recipient + * + * @param string $recipient_name Displayed sender name + * @param string $recipient_address Email address + * @param string $recipient_lang + * @param int $recipient_notify_type Used notification methods (Jabber, Email, ...) + * @param string $recipient_username User Name (used for AntiAbuse header) + * @param string $recipient_jabber + * @return null + */ + public function add_recipient($recipient_name, $recipient_address, $recipient_lang, $recipient_notify_type = NOTIFY_EMAIL, $recipient_username = '', $recipient_jabber = '') + { + $this->recipients[] = array( + 'name' => $recipient_name, + 'address' => $recipient_address, + 'lang' => $recipient_lang, + 'username' => $recipient_username, + 'jabber' => $recipient_jabber, + 'notify_type' => $recipient_notify_type, + 'to_name' => $recipient_name, + ); + } + + /** + * Set the senders data from \phpbb\user object + * + * @param \phpbb\user $user + * @return null + */ + public function set_sender_from_user($user) + { + $this->set_sender( + $user->ip, + $user->data['username'], + $user->data['user_email'], + $user->lang_name, + $user->data['user_id'], + $user->data['username'], + $user->data['user_jabber'] + ); + + $this->set_sender_notify_type($user->data['user_notify_type']); + } + + /** + * Set the senders data + * + * @param string $sender_ip + * @param string $sender_name Displayed sender name + * @param string $sender_address Email address + * @param string $sender_lang + * @param int $sender_id User ID + * @param string $sender_username User Name (used for AntiAbuse header) + * @param string $sender_jabber + * @return null + */ + public function set_sender($sender_ip, $sender_name, $sender_address, $sender_lang = '', $sender_id = 0, $sender_username = '', $sender_jabber = '') + { + $this->sender_ip = $sender_ip; + $this->sender_name = $sender_name; + $this->sender_address = $sender_address; + $this->sender_lang = $sender_lang; + $this->sender_id = $sender_id; + $this->sender_username = $sender_username; + $this->sender_jabber = $sender_jabber; + } + + /** + * Which notification type should be used? Jabber, Email, ...? + * + * @param int $sender_notify_type + * @return null + */ + public function set_sender_notify_type($sender_notify_type) + { + $this->sender_notify_type = $sender_notify_type; + } + + /** + * Ok, now the same email if CC specified, but without exposing the user's email address + * + * @return null + */ + public function cc_sender() + { + if (!sizeof($this->recipients)) + { + trigger_error('No email recipients specified'); + } + if (!$this->sender_address) + { + trigger_error('No email sender specified'); + } + + $this->recipients[] = array( + 'lang' => $this->sender_lang, + 'address' => $this->sender_address, + 'name' => $this->sender_name, + 'username' => $this->sender_username, + 'jabber' => $this->sender_jabber, + 'notify_type' => $this->sender_notify_type, + 'to_name' => $this->recipients[0]['to_name'], + ); + } + + /** + * Send the email + * + * @param \messenger $messenger + * @param string $contact + * @return null + */ + public function send(\messenger $messenger, $contact) + { + if (!sizeof($this->recipients)) + { + return; + } + + foreach ($this->recipients as $recipient) + { + $messenger->template($this->template, $recipient['lang']); + $messenger->replyto($this->sender_address); + $messenger->to($recipient['address'], $recipient['name']); + $messenger->im($recipient['jabber'], $recipient['username']); + + $messenger->headers('X-AntiAbuse: Board servername - ' . $this->server_name); + $messenger->headers('X-AntiAbuse: User IP - ' . $this->sender_ip); + + if ($this->sender_id) + { + $messenger->headers('X-AntiAbuse: User_id - ' . $this->sender_id); + } + if ($this->sender_username) + { + $messenger->headers('X-AntiAbuse: Username - ' . $this->sender_username); + } + + $messenger->subject(htmlspecialchars_decode($this->subject)); + + $messenger->assign_vars(array( + 'BOARD_CONTACT' => $contact, + 'TO_USERNAME' => htmlspecialchars_decode($recipient['to_name']), + 'FROM_USERNAME' => htmlspecialchars_decode($this->sender_name), + 'MESSAGE' => htmlspecialchars_decode($this->body)) + ); + + if (sizeof($this->template_vars)) + { + $messenger->assign_vars($this->template_vars); + } + + $messenger->send($recipient['notify_type']); + } + } +} diff --git a/sources/phpBB/phpbb/message/topic_form.php b/sources/phpBB/phpbb/message/topic_form.php new file mode 100644 index 0000000..174643b --- /dev/null +++ b/sources/phpBB/phpbb/message/topic_form.php @@ -0,0 +1,158 @@ + +* @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\message; + +/** +* Class topic_form +* Form used to send topics as notification emails +*/ +class topic_form extends form +{ + /** @var int */ + protected $topic_id; + /** @var array */ + protected $topic_row; + /** @var string */ + protected $recipient_address; + /** @var string */ + protected $recipient_name; + /** @var string */ + protected $recipient_lang; + + /** + * Get the data of the topic + * + * @param int $topic_id + * @return false|array false if the topic does not exist, array otherwise + */ + protected function get_topic_row($topic_id) + { + $sql = 'SELECT forum_id, topic_title + FROM ' . TOPICS_TABLE . ' + WHERE topic_id = ' . (int) $topic_id; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + return $row; + } + + /** + * {inheritDoc} + */ + public function check_allow() + { + $error = parent::check_allow(); + if ($error) + { + return $error; + } + + if (!$this->auth->acl_get('u_sendemail')) + { + return 'NO_EMAIL'; + } + + if (!$this->topic_row) + { + return 'NO_TOPIC'; + } + + if (!$this->auth->acl_get('f_read', $this->topic_row['forum_id'])) + { + return 'SORRY_AUTH_READ'; + } + + if (!$this->auth->acl_get('f_email', $this->topic_row['forum_id'])) + { + return 'NO_EMAIL'; + } + + return false; + } + + /** + * {inheritDoc} + */ + public function bind(\phpbb\request\request_interface $request) + { + parent::bind($request); + + $this->topic_id = $request->variable('t', 0); + $this->recipient_address = $request->variable('email', ''); + $this->recipient_name = $request->variable('name', '', true); + $this->recipient_lang = $request->variable('lang', $this->config['default_lang']); + + $this->topic_row = $this->get_topic_row($this->topic_id); + } + + /** + * {inheritDoc} + */ + public function submit(\messenger $messenger) + { + if (!$this->recipient_address || !preg_match('/^' . get_preg_expression('email') . '$/i', $this->recipient_address)) + { + $this->errors[] = $this->user->lang['EMPTY_ADDRESS_EMAIL']; + } + + if (!$this->recipient_name) + { + $this->errors[] = $this->user->lang['EMPTY_NAME_EMAIL']; + } + + $this->message->set_template('email_notify'); + $this->message->set_template_vars(array( + 'TOPIC_NAME' => htmlspecialchars_decode($this->topic_row['topic_title']), + 'U_TOPIC' => generate_board_url() . '/viewtopic.' . $this->phpEx . '?f=' . $this->topic_row['forum_id'] . '&t=' . $this->topic_id, + )); + $this->message->set_body($this->body); + $this->message->add_recipient( + $this->recipient_name, + $this->recipient_address, + $this->recipient_lang, + NOTIFY_EMAIL + ); + $this->message->set_sender_notify_type(NOTIFY_EMAIL); + + parent::submit($messenger); + } + + /** + * {inheritDoc} + */ + public function get_return_message() + { + return sprintf($this->user->lang['RETURN_TOPIC'], '', ''); + } + + /** + * {inheritDoc} + */ + public function render(\phpbb\template\template $template) + { + parent::render($template); + + $this->user->add_lang('viewtopic'); + $template->assign_vars(array( + 'EMAIL' => $this->recipient_address, + 'NAME' => $this->recipient_name, + 'S_LANG_OPTIONS' => language_select($this->recipient_lang), + 'MESSAGE' => $this->body, + + 'L_EMAIL_BODY_EXPLAIN' => $this->user->lang['EMAIL_TOPIC_EXPLAIN'], + 'S_POST_ACTION' => append_sid($this->phpbb_root_path . 'memberlist.' . $this->phpEx, 'mode=email&t=' . $this->topic_id)) + ); + } +} diff --git a/sources/phpBB/phpbb/message/user_form.php b/sources/phpBB/phpbb/message/user_form.php new file mode 100644 index 0000000..007e575 --- /dev/null +++ b/sources/phpBB/phpbb/message/user_form.php @@ -0,0 +1,136 @@ + +* @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\message; + +/** +* Class user_form +* Allows users to send emails to other users +*/ +class user_form extends form +{ + /** @var int */ + protected $recipient_id; + /** @var array */ + protected $recipient_row; + /** @var string */ + protected $subject; + + /** + * Get the data of the recipient + * + * @param int $user_id + * @return false|array false if the user does not exist, array otherwise + */ + protected function get_user_row($user_id) + { + $sql = 'SELECT user_id, username, user_colour, user_email, user_allow_viewemail, user_lang, user_jabber, user_notify_type + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . (int) $user_id . ' + AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')'; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + return $row; + } + + /** + * {inheritDoc} + */ + public function check_allow() + { + $error = parent::check_allow(); + if ($error) + { + return $error; + } + + if (!$this->auth->acl_get('u_sendemail')) + { + return 'NO_EMAIL'; + } + + if ($this->recipient_id == ANONYMOUS || !$this->config['board_email_form']) + { + return 'NO_EMAIL'; + } + + if (!$this->recipient_row) + { + return 'NO_USER'; + } + + // Can we send email to this user? + if (!$this->recipient_row['user_allow_viewemail'] && !$this->auth->acl_get('a_user')) + { + return 'NO_EMAIL'; + } + + return false; + } + + /** + * {inheritDoc} + */ + public function bind(\phpbb\request\request_interface $request) + { + parent::bind($request); + + $this->recipient_id = $request->variable('u', 0); + $this->subject = $request->variable('subject', '', true); + + $this->recipient_row = $this->get_user_row($this->recipient_id); + } + + /** + * {inheritDoc} + */ + public function submit(\messenger $messenger) + { + if (!$this->subject) + { + $this->errors[] = $this->user->lang['EMPTY_SUBJECT_EMAIL']; + } + + if (!$this->body) + { + $this->errors[] = $this->user->lang['EMPTY_MESSAGE_EMAIL']; + } + + $this->message->set_template('profile_send_email'); + $this->message->set_subject($this->subject); + $this->message->set_body($this->body); + $this->message->add_recipient_from_user_row($this->recipient_row); + + parent::submit($messenger); + } + + /** + * {inheritDoc} + */ + public function render(\phpbb\template\template $template) + { + parent::render($template); + + $template->assign_vars(array( + 'S_SEND_USER' => true, + 'S_POST_ACTION' => append_sid($this->phpbb_root_path . 'memberlist.' . $this->phpEx, 'mode=email&u=' . $this->recipient_id), + + 'L_SEND_EMAIL_USER' => $this->user->lang('SEND_EMAIL_USER', $this->recipient_row['username']), + 'USERNAME_FULL' => get_username_string('full', $this->recipient_row['user_id'], $this->recipient_row['username'], $this->recipient_row['user_colour']), + 'SUBJECT' => $this->subject, + 'MESSAGE' => $this->body, + )); + } +} diff --git a/sources/phpBB/phpbb/mimetype/content_guesser.php b/sources/phpBB/phpbb/mimetype/content_guesser.php new file mode 100644 index 0000000..f3ad7f5 --- /dev/null +++ b/sources/phpBB/phpbb/mimetype/content_guesser.php @@ -0,0 +1,33 @@ + +* @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\mimetype; + +class content_guesser extends guesser_base +{ + /** + * {@inheritdoc} + */ + public function is_supported() + { + return function_exists('mime_content_type') && is_callable('mime_content_type'); + } + + /** + * {@inheritdoc} + */ + public function guess($file, $file_name = '') + { + return mime_content_type($file); + } +} diff --git a/sources/phpBB/phpbb/mimetype/extension_guesser.php b/sources/phpBB/phpbb/mimetype/extension_guesser.php new file mode 100644 index 0000000..9e36c07 --- /dev/null +++ b/sources/phpBB/phpbb/mimetype/extension_guesser.php @@ -0,0 +1,509 @@ + +* @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\mimetype; + +class extension_guesser extends guesser_base +{ + /** + * @var file extension map + */ + protected $extension_map = array( + '3dm' => 'x-world/x-3dmf', + '3dmf' => 'x-world/x-3dmf', + 'a' => 'application/octet-stream', + 'aab' => 'application/x-authorware-bin', + 'aam' => 'application/x-authorware-map', + 'aas' => 'application/x-authorware-seg', + 'abc' => 'text/vnd.abc', + 'acgi' => 'text/html', + 'afl' => 'video/animaflex', + 'ai' => 'application/postscript', + 'aif' => 'audio/aiff', + 'aifc' => 'audio/aiff', + 'aiff' => 'audio/aiff', + 'aim' => 'application/x-aim', + 'aip' => 'text/x-audiosoft-intra', + 'ani' => 'application/x-navi-animation', + 'aos' => 'application/x-nokia-9000-communicator-add-on-software', + 'aps' => 'application/mime', + 'arc' => 'application/octet-stream', + 'arj' => 'application/arj', + 'art' => 'image/x-jg', + 'asf' => 'video/x-ms-asf', + 'asm' => 'text/x-asm', + 'asp' => 'text/asp', + 'asx' => 'video/x-ms-asf', + 'au' => 'audio/x-au', + 'avi' => 'video/avi', + 'avs' => 'video/avs-video', + 'bcpio' => 'application/x-bcpio', + 'bin' => 'application/x-binary', + 'bm' => 'image/bmp', + 'bmp' => 'image/bmp', + 'boo' => 'application/book', + 'book' => 'application/book', + 'boz' => 'application/x-bzip2', + 'bsh' => 'application/x-bsh', + 'bz' => 'application/x-bzip', + 'bz2' => 'application/x-bzip2', + 'c' => 'text/x-c', + 'c++' => 'text/x-c', + 'cat' => 'application/vnd.ms-pki.seccat', + 'cc' => 'text/plain', + 'ccad' => 'application/clariscad', + 'cco' => 'application/x-cocoa', + 'cdf' => 'application/cdf', + 'cer' => 'application/x-x509-ca-cert', + 'cha' => 'application/x-chat', + 'chat' => 'application/x-chat', + 'class' => 'application/java', + 'com' => 'application/octet-stream', + 'conf' => 'text/plain', + 'cpio' => 'application/x-cpio', + 'cpp' => 'text/x-c', + 'cpt' => 'application/x-cpt', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'csh' => 'application/x-csh', + 'css' => 'text/css', + 'cxx' => 'text/plain', + 'dcr' => 'application/x-director', + 'deepv' => 'application/x-deepv', + 'def' => 'text/plain', + 'der' => 'application/x-x509-ca-cert', + 'dif' => 'video/x-dv', + 'dir' => 'application/x-director', + 'dl' => 'video/dl', + 'doc' => 'application/msword', + 'dot' => 'application/msword', + 'dp' => 'application/commonground', + 'drw' => 'application/drafting', + 'dump' => 'application/octet-stream', + 'dv' => 'video/x-dv', + 'dvi' => 'application/x-dvi', + 'dwf' => 'model/vnd.dwf', + 'dwg' => 'image/x-dwg', + 'dxf' => 'image/x-dwg', + 'dxr' => 'application/x-director', + 'el' => 'text/x-script.elisp', + 'elc' => 'application/x-elc', + 'env' => 'application/x-envoy', + 'eps' => 'application/postscript', + 'es' => 'application/x-esrehber', + 'etx' => 'text/x-setext', + 'evy' => 'application/x-envoy', + 'exe' => 'application/octet-stream', + 'f' => 'text/x-fortran', + 'f77' => 'text/x-fortran', + 'f90' => 'text/x-fortran', + 'fdf' => 'application/vnd.fdf', + 'fif' => 'image/fif', + 'fli' => 'video/x-fli', + 'flo' => 'image/florian', + 'flx' => 'text/vnd.fmi.flexstor', + 'fmf' => 'video/x-atomic3d-feature', + 'for' => 'text/x-fortran', + 'fpx' => 'image/vnd.fpx', + 'frl' => 'application/freeloader', + 'funk' => 'audio/make', + 'g' => 'text/plain', + 'g3' => 'image/g3fax', + 'gif' => 'image/gif', + 'gl' => 'video/x-gl', + 'gsd' => 'audio/x-gsm', + 'gsm' => 'audio/x-gsm', + 'gsp' => 'application/x-gsp', + 'gss' => 'application/x-gss', + 'gtar' => 'application/x-gtar', + 'gz' => 'application/x-gzip', + 'gzip' => 'application/x-gzip', + 'h' => 'text/x-h', + 'hdf' => 'application/x-hdf', + 'help' => 'application/x-helpfile', + 'hgl' => 'application/vnd.hp-hpgl', + 'hh' => 'text/x-h', + 'hlb' => 'text/x-script', + 'hlp' => 'application/hlp', + 'hpg' => 'application/vnd.hp-hpgl', + 'hpgl' => 'application/vnd.hp-hpgl', + 'hqx' => 'application/x-binhex40', + 'hta' => 'application/hta', + 'htc' => 'text/x-component', + 'htm' => 'text/html', + 'html' => 'text/html', + 'htmls' => 'text/html', + 'htt' => 'text/webviewhtml', + 'htx' => 'text/html', + 'ice' => 'x-conference/x-cooltalk', + 'ico' => 'image/x-icon', + 'idc' => 'text/plain', + 'ief' => 'image/ief', + 'iefs' => 'image/ief', + 'iges' => 'application/iges', + 'igs' => 'application/iges', + 'ima' => 'application/x-ima', + 'imap' => 'application/x-httpd-imap', + 'inf' => 'application/inf', + 'ins' => 'application/x-internett-signup', + 'ip' => 'application/x-ip2', + 'isu' => 'video/x-isvideo', + 'it' => 'audio/it', + 'iv' => 'application/x-inventor', + 'ivr' => 'i-world/i-vrml', + 'ivy' => 'application/x-livescreen', + 'jam' => 'audio/x-jam', + 'jav' => 'text/plain', + 'jav' => 'text/x-java-source', + 'java' => 'text/x-java-source', + 'jcm' => 'application/x-java-commerce', + 'jfif' => 'image/jpeg', + 'jfif-tbnl' => 'image/jpeg', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'jps' => 'image/x-jps', + 'js' => 'application/x-javascript', + 'jut' => 'image/jutvision', + 'kar' => 'audio/midi', + 'ksh' => 'text/x-script.ksh', + 'la' => 'audio/x-nspaudio', + 'lam' => 'audio/x-liveaudio', + 'latex' => 'application/x-latex', + 'lha' => 'application/x-lha', + 'lhx' => 'application/octet-stream', + 'list' => 'text/plain', + 'lma' => 'audio/x-nspaudio', + 'log' => 'text/plain', + 'lsp' => 'text/x-script.lisp', + 'lst' => 'text/plain', + 'lsx' => 'text/x-la-asf', + 'ltx' => 'application/x-latex', + 'lzh' => 'application/x-lzh', + 'lzx' => 'application/x-lzx', + 'm' => 'text/x-m', + 'm1v' => 'video/mpeg', + 'm2a' => 'audio/mpeg', + 'm2v' => 'video/mpeg', + 'm3u' => 'audio/x-mpequrl', + 'man' => 'application/x-troff-man', + 'map' => 'application/x-navimap', + 'mar' => 'text/plain', + 'mbd' => 'application/mbedlet', + 'mc$' => 'application/x-magic-cap-package-1.0', + 'mcd' => 'application/x-mathcad', + 'mcf' => 'text/mcf', + 'mcp' => 'application/netmc', + 'me' => 'application/x-troff-me', + 'mht' => 'message/rfc822', + 'mhtml' => 'message/rfc822', + 'mid' => 'audio/x-midi', + 'midi' => 'audio/x-midi', + 'mif' => 'application/x-mif', + 'mime' => 'www/mime', + 'mjf' => 'audio/x-vnd.audioexplosion.mjuicemediafile', + 'mjpg' => 'video/x-motion-jpeg', + 'mm' => 'application/x-meme', + 'mme' => 'application/base64', + 'mod' => 'audio/x-mod', + 'moov' => 'video/quicktime', + 'mov' => 'video/quicktime', + 'movie' => 'video/x-sgi-movie', + 'mp2' => 'audio/x-mpeg', + 'mp3' => 'audio/x-mpeg-3', + 'mpa' => 'audio/mpeg', + 'mpc' => 'application/x-project', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpga' => 'audio/mpeg', + 'mpp' => 'application/vnd.ms-project', + 'mpt' => 'application/x-project', + 'mpv' => 'application/x-project', + 'mpx' => 'application/x-project', + 'mrc' => 'application/marc', + 'ms' => 'application/x-troff-ms', + 'mv' => 'video/x-sgi-movie', + 'my' => 'audio/make', + 'mzz' => 'application/x-vnd.audioexplosion.mzz', + 'nap' => 'image/naplps', + 'naplps' => 'image/naplps', + 'nc' => 'application/x-netcdf', + 'ncm' => 'application/vnd.nokia.configuration-message', + 'nif' => 'image/x-niff', + 'niff' => 'image/x-niff', + 'nix' => 'application/x-mix-transfer', + 'nsc' => 'application/x-conference', + 'nvd' => 'application/x-navidoc', + 'o' => 'application/octet-stream', + 'oda' => 'application/oda', + 'omc' => 'application/x-omc', + 'omcd' => 'application/x-omcdatamaker', + 'omcr' => 'application/x-omcregerator', + 'p' => 'text/x-pascal', + 'p10' => 'application/x-pkcs10', + 'p12' => 'application/x-pkcs12', + 'p7a' => 'application/x-pkcs7-signature', + 'p7c' => 'application/x-pkcs7-mime', + 'p7m' => 'application/x-pkcs7-mime', + 'p7r' => 'application/x-pkcs7-certreqresp', + 'p7s' => 'application/pkcs7-signature', + 'part' => 'application/pro_eng', + 'pas' => 'text/pascal', + 'pbm' => 'image/x-portable-bitmap', + 'pcl' => 'application/x-pcl', + 'pct' => 'image/x-pict', + 'pcx' => 'image/x-pcx', + 'pdb' => 'chemical/x-pdb', + 'pdf' => 'application/pdf', + 'pfunk' => 'audio/make.my.funk', + 'pgm' => 'image/x-portable-greymap', + 'pic' => 'image/pict', + 'pict' => 'image/pict', + 'pkg' => 'application/x-newton-compatible-pkg', + 'pko' => 'application/vnd.ms-pki.pko', + 'pl' => 'text/x-script.perl', + 'plx' => 'application/x-pixclscript', + 'pm' => 'text/x-script.perl-module', + 'pm4' => 'application/x-pagemaker', + 'pm5' => 'application/x-pagemaker', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'pot' => 'application/mspowerpoint', + 'pov' => 'model/x-pov', + 'ppa' => 'application/vnd.ms-powerpoint', + 'ppm' => 'image/x-portable-pixmap', + 'pps' => 'application/mspowerpoint', + 'ppt' => 'application/mspowerpoint', + 'ppz' => 'application/mspowerpoint', + 'pre' => 'application/x-freelance', + 'prt' => 'application/pro_eng', + 'ps' => 'application/postscript', + 'psd' => 'application/octet-stream', + 'pvu' => 'paleovu/x-pv', + 'pwz' => 'application/vnd.ms-powerpoint', + 'py' => 'text/x-script.phyton', + 'pyc' => 'applicaiton/x-bytecode.python', + 'qcp' => 'audio/vnd.qcelp', + 'qd3' => 'x-world/x-3dmf', + 'qd3d' => 'x-world/x-3dmf', + 'qif' => 'image/x-quicktime', + 'qt' => 'video/quicktime', + 'qtc' => 'video/x-qtc', + 'qti' => 'image/x-quicktime', + 'qtif' => 'image/x-quicktime', + 'ra' => 'audio/x-realaudio', + 'ram' => 'audio/x-pn-realaudio', + 'ras' => 'image/x-cmu-raster', + 'rast' => 'image/cmu-raster', + 'rexx' => 'text/x-script.rexx', + 'rf' => 'image/vnd.rn-realflash', + 'rgb' => 'image/x-rgb', + 'rm' => 'audio/x-pn-realaudio', + 'rmi' => 'audio/mid', + 'rmm' => 'audio/x-pn-realaudio', + 'rmp' => 'audio/x-pn-realaudio', + 'rng' => 'application/vnd.nokia.ringing-tone', + 'rnx' => 'application/vnd.rn-realplayer', + 'roff' => 'application/x-troff', + 'rp' => 'image/vnd.rn-realpix', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'rt' => 'text/richtext', + 'rtf' => 'text/richtext', + 'rtx' => 'text/richtext', + 'rv' => 'video/vnd.rn-realvideo', + 's' => 'text/x-asm', + 's3m' => 'audio/s3m', + 'saveme' => 'application/octet-stream', + 'sbk' => 'application/x-tbook', + 'scm' => 'video/x-scm', + 'sdml' => 'text/plain', + 'sdp' => 'application/x-sdp', + 'sdr' => 'application/sounder', + 'sea' => 'application/x-sea', + 'set' => 'application/set', + 'sgm' => 'text/x-sgml', + 'sgml' => 'text/x-sgml', + 'sh' => 'text/x-script.sh', + 'shar' => 'application/x-shar', + 'shtml' => 'text/x-server-parsed-html', + 'sid' => 'audio/x-psid', + 'sit' => 'application/x-stuffit', + 'skd' => 'application/x-koan', + 'skm' => 'application/x-koan', + 'skp' => 'application/x-koan', + 'skt' => 'application/x-koan', + 'sl' => 'application/x-seelogo', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'snd' => 'audio/x-adpcm', + 'sol' => 'application/solids', + 'spc' => 'text/x-speech', + 'spl' => 'application/futuresplash', + 'spr' => 'application/x-sprite', + 'sprite' => 'application/x-sprite', + 'src' => 'application/x-wais-source', + 'ssi' => 'text/x-server-parsed-html', + 'ssm' => 'application/streamingmedia', + 'sst' => 'application/vnd.ms-pki.certstore', + 'step' => 'application/step', + 'stl' => 'application/vnd.ms-pki.stl', + 'stp' => 'application/step', + 'sv4cpio' => 'application/x-sv4cpio', + 'sv4crc' => 'application/x-sv4crc', + 'svf' => 'image/x-dwg', + 'svr' => 'application/x-world', + 'swf' => 'application/x-shockwave-flash', + 't' => 'application/x-troff', + 'talk' => 'text/x-speech', + 'tar' => 'application/x-tar', + 'tbk' => 'application/x-tbook', + 'tcl' => 'text/x-script.tcl', + 'tcsh' => 'text/x-script.tcsh', + 'tex' => 'application/x-tex', + 'texi' => 'application/x-texinfo', + 'texinfo' => 'application/x-texinfo', + 'text' => 'text/plain', + 'tgz' => 'application/x-compressed', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'tr' => 'application/x-troff', + 'tsi' => 'audio/tsp-audio', + 'tsp' => 'audio/tsplayer', + 'tsv' => 'text/tab-separated-values', + 'turbot' => 'image/florian', + 'txt' => 'text/plain', + 'uil' => 'text/x-uil', + 'uni' => 'text/uri-list', + 'unis' => 'text/uri-list', + 'unv' => 'application/i-deas', + 'uri' => 'text/uri-list', + 'uris' => 'text/uri-list', + 'ustar' => 'multipart/x-ustar', + 'uu' => 'text/x-uuencode', + 'uue' => 'text/x-uuencode', + 'vcd' => 'application/x-cdlink', + 'vcs' => 'text/x-vcalendar', + 'vda' => 'application/vda', + 'vdo' => 'video/vdo', + 'vew' => 'application/groupwise', + 'viv' => 'video/vivo', + 'vivo' => 'video/vivo', + 'vmd' => 'application/vocaltec-media-desc', + 'vmf' => 'application/vocaltec-media-file', + 'voc' => 'audio/voc', + 'vos' => 'video/vosaic', + 'vox' => 'audio/voxware', + 'vqe' => 'audio/x-twinvq-plugin', + 'vqf' => 'audio/x-twinvq', + 'vql' => 'audio/x-twinvq-plugin', + 'vrml' => 'application/x-vrml', + 'vrt' => 'x-world/x-vrt', + 'vsd' => 'application/x-visio', + 'vst' => 'application/x-visio', + 'vsw' => 'application/x-visio', + 'w60' => 'application/wordperfect6.0', + 'w61' => 'application/wordperfect6.1', + 'w6w' => 'application/msword', + 'wav' => 'audio/wav', + 'wb1' => 'application/x-qpro', + 'wbmp' => 'image/vnd.wap.wbmp', + 'web' => 'application/vnd.xara', + 'wiz' => 'application/msword', + 'wk1' => 'application/x-123', + 'wmf' => 'windows/metafile', + 'wml' => 'text/vnd.wap.wml', + 'wmlc' => 'application/vnd.wap.wmlc', + 'wmls' => 'text/vnd.wap.wmlscript', + 'wmlsc' => 'application/vnd.wap.wmlscriptc', + 'word' => 'application/msword', + 'wp' => 'application/wordperfect', + 'wp5' => 'application/wordperfect', + 'wp6' => 'application/wordperfect', + 'wpd' => 'application/wordperfect', + 'wq1' => 'application/x-lotus', + 'wri' => 'application/mswrite', + 'wrl' => 'model/vrml', + 'wrz' => 'model/vrml', + 'wsc' => 'text/scriplet', + 'wsrc' => 'application/x-wais-source', + 'wtk' => 'application/x-wintalk', + 'xbm' => 'image/xbm', + 'xdr' => 'video/x-amt-demorun', + 'xgz' => 'xgl/drawing', + 'xif' => 'image/vnd.xiff', + 'xl' => 'application/excel', + 'xla' => 'application/excel', + 'xlb' => 'application/excel', + 'xlc' => 'application/excel', + 'xld' => 'application/excel', + 'xlk' => 'application/excel', + 'xll' => 'application/excel', + 'xlm' => 'application/excel', + 'xls' => 'application/excel', + 'xlt' => 'application/excel', + 'xlv' => 'application/excel', + 'xlw' => 'application/excel', + 'xm' => 'audio/xm', + 'xml' => 'text/xml', + 'xmz' => 'xgl/movie', + 'xpix' => 'application/x-vnd.ls-xpix', + 'xpm' => 'image/xpm', + 'x-png' => 'image/png', + 'xsr' => 'video/x-amt-showrun', + 'xwd' => 'image/x-xwindowdump', + 'xyz' => 'chemical/x-pdb', + 'z' => 'application/x-compressed', + 'zip' => 'application/x-zip-compressed', + 'zoo' => 'application/octet-stream', + 'zsh' => 'text/x-script.zsh', + ); + + /** + * {@inheritdoc} + */ + public function is_supported() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function guess($file, $file_name = '') + { + $file_name = (empty($file_name)) ? $file : $file_name; + return $this->map_extension_to_type($file_name); + } + + /** + * Map extension of supplied file_name to mime type + * + * @param string $file_name Path to file or filename + * + * @return string|null Mimetype if known or null if not + */ + protected function map_extension_to_type($file_name) + { + $extension = pathinfo($file_name, PATHINFO_EXTENSION); + + if (isset($this->extension_map[$extension])) + { + return $this->extension_map[$extension]; + } + else + { + return null; + } + } +} diff --git a/sources/phpBB/phpbb/mimetype/guesser.php b/sources/phpBB/phpbb/mimetype/guesser.php new file mode 100644 index 0000000..8baa770 --- /dev/null +++ b/sources/phpBB/phpbb/mimetype/guesser.php @@ -0,0 +1,156 @@ + +* @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\mimetype; + +class guesser +{ + /** + * @const Default priority for mimetype guessers + */ + const PRIORITY_DEFAULT = 0; + + /** + * @var array guessers + */ + protected $guessers; + + /** + * Construct a mimetype guesser object + * + * @param array $mimetype_guessers Mimetype guesser service collection + */ + public function __construct($mimetype_guessers) + { + $this->register_guessers($mimetype_guessers); + } + + /** + * Register MimeTypeGuessers and sort them by priority + * + * @param array $mimetype_guessers Mimetype guesser service collection + * + * @throws \LogicException If incorrect or not mimetype guessers have + * been supplied to class + */ + protected function register_guessers($mimetype_guessers) + { + foreach ($mimetype_guessers as $guesser) + { + $is_supported = (method_exists($guesser, 'is_supported')) ? 'is_supported' : ''; + $is_supported = (method_exists($guesser, 'isSupported')) ? 'isSupported' : $is_supported; + + if (empty($is_supported)) + { + throw new \LogicException('Incorrect mimetype guesser supplied.'); + } + + if ($guesser->$is_supported()) + { + $this->guessers[] = $guesser; + } + } + + if (empty($this->guessers)) + { + throw new \LogicException('No mimetype guesser supplied.'); + } + + // Sort guessers by priority + usort($this->guessers, array($this, 'sort_priority')); + } + + /** + * Sort the priority of supplied guessers + * This is a compare function for usort. A guesser with higher priority + * should be used first and vice versa. usort() orders the array values + * from low to high depending on what the comparison function returns + * to it. Return value should be smaller than 0 if value a is smaller + * than value b. This has been reversed in the comparision function in + * order to sort the guessers from high to low. + * Method has been set to public in order to allow proper testing. + * + * @param object $guesser_a Mimetype guesser a + * @param object $guesser_b Mimetype guesser b + * + * @return int If both guessers have the same priority 0, bigger + * than 0 if first guesser has lower priority, and lower + * than 0 if first guesser has higher priority + */ + public function sort_priority($guesser_a, $guesser_b) + { + $priority_a = (int) (method_exists($guesser_a, 'get_priority')) ? $guesser_a->get_priority() : self::PRIORITY_DEFAULT; + $priority_b = (int) (method_exists($guesser_b, 'get_priority')) ? $guesser_b->get_priority() : self::PRIORITY_DEFAULT; + + return $priority_b - $priority_a; + } + + /** + * Guess mimetype of supplied file + * + * @param string $file Path to file + * @param string $file_name The real file name + * + * @return string Guess for mimetype of file + */ + public function guess($file, $file_name = '') + { + if (!is_file($file)) + { + return false; + } + + if (!is_readable($file)) + { + return false; + } + + $mimetype = 'application/octet-stream'; + + foreach ($this->guessers as $guesser) + { + $mimetype_guess = $guesser->guess($file, $file_name); + + $mimetype = $this->choose_mime_type($mimetype, $mimetype_guess); + } + // Return any mimetype if we got a result or the fallback value + return $mimetype; + } + + /** + * Choose the best mime type based on the current mime type and the guess + * If a guesser returns nulls or application/octet-stream, we will keep + * the current guess. Guesses with a slash inside them will be favored over + * already existing ones. However, any guess that will pass the first check + * will always overwrite the default application/octet-stream. + * + * @param string $mime_type The current mime type + * @param string $guess The current mime type guess + * + * @return string The best mime type based on current mime type and guess + */ + public function choose_mime_type($mime_type, $guess) + { + if ($guess === null || $guess == 'application/octet-stream') + { + return $mime_type; + } + + if ($mime_type == 'application/octet-stream' || strpos($guess, '/') !== false) + { + $mime_type = $guess; + } + + return $mime_type; + } +} diff --git a/sources/phpBB/phpbb/mimetype/guesser_base.php b/sources/phpBB/phpbb/mimetype/guesser_base.php new file mode 100644 index 0000000..225dfd5 --- /dev/null +++ b/sources/phpBB/phpbb/mimetype/guesser_base.php @@ -0,0 +1,38 @@ + +* @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\mimetype; + +abstract class guesser_base implements guesser_interface +{ + /** + * @var int Guesser Priority + */ + protected $priority; + + /** + * {@inheritdoc} + */ + public function get_priority() + { + return $this->priority; + } + + /** + * {@inheritdoc} + */ + public function set_priority($priority) + { + $this->priority = $priority; + } +} diff --git a/sources/phpBB/phpbb/mimetype/guesser_interface.php b/sources/phpBB/phpbb/mimetype/guesser_interface.php new file mode 100644 index 0000000..a400528 --- /dev/null +++ b/sources/phpBB/phpbb/mimetype/guesser_interface.php @@ -0,0 +1,50 @@ + +* @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\mimetype; + +interface guesser_interface +{ + /** + * Returns whether this guesser is supported on the current OS + * + * @return bool True if guesser is supported, false if not + */ + public function is_supported(); + + /** + * Guess mimetype of supplied file + * + * @param string $file Path to file + * @param string $file_name The real file name + * + * @return string Guess for mimetype of file + */ + public function guess($file, $file_name = ''); + + /** + * Get the guesser priority + * + * @return int Guesser priority + */ + public function get_priority(); + + /** + * Set the guesser priority + * + * @param int Guesser priority + * + * @return void + */ + public function set_priority($priority); +} diff --git a/sources/phpBB/phpbb/notification/exception.php b/sources/phpBB/phpbb/notification/exception.php new file mode 100644 index 0000000..83c4526 --- /dev/null +++ b/sources/phpBB/phpbb/notification/exception.php @@ -0,0 +1,26 @@ + +* @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; + +/** +* Notifications exception +*/ + +class exception extends \Exception +{ + public function __toString() + { + return $this->getMessage(); + } +} diff --git a/sources/phpBB/phpbb/notification/manager.php b/sources/phpBB/phpbb/notification/manager.php new file mode 100644 index 0000000..aa52eb6 --- /dev/null +++ b/sources/phpBB/phpbb/notification/manager.php @@ -0,0 +1,980 @@ + +* @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; + +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** +* Notifications service class +*/ +class manager +{ + /** @var array */ + protected $notification_types; + + /** @var array */ + protected $subscription_types; + + /** @var array */ + protected $notification_methods; + + /** @var ContainerInterface */ + protected $phpbb_container; + + /** @var \phpbb\user_loader */ + protected $user_loader; + + /** @var \phpbb\config\config */ + protected $config; + + /** @var \phpbb\event\dispatcher */ + protected $phpbb_dispatcher; + + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + /** @var \phpbb\cache\service */ + protected $cache; + + /** @var \phpbb\user */ + 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; + + /** + * Notification Constructor + * + * @param array $notification_types + * @param array $notification_methods + * @param ContainerInterface $phpbb_container + * @param \phpbb\user_loader $user_loader + * @param \phpbb\config\config $config + * @param \phpbb\event\dispatcher $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 $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table) + { + $this->notification_types = $notification_types; + $this->notification_methods = $notification_methods; + $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 + * + * @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()) + { + // 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->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); + } + } + + return array( + 'notifications' => $notifications, + 'unread_count' => $unread_count, + 'total_count' => $total_count, + ); + } + + /** + * 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) + { + $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); + } + + /** + * Mark notifications read from a parent identifier + * + * @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) + */ + 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)) : '') . + (($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); + } + + /** + * Mark notifications read + * + * @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) + */ + public function mark_notifications_read_by_id($notification_id, $time = false) + { + $time = ($time !== false) ? $time : time(); + + $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); + } + + /** + * Add a 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) + * Note: If you send an array of types, any user who could receive multiple notifications from this single item will only receive + * a single notification. If they MUST receive multiple notifications, call this function multiple times instead of sending an array + * @param array $data Data specific for this type that will be inserted + * @param array $options Optional options to control what notifications are loaded + * ignore_users array of data to specify which users should not receive certain types of notifications + * @return array Information about what users were notified and how they were notified + */ + public function add_notifications($notification_type_name, $data, array $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + ), $options); + + if (is_array($notification_type_name)) + { + $notified_users = array(); + $temp_options = $options; + + foreach ($notification_type_name as $type) + { + $temp_options['ignore_users'] = $options['ignore_users'] + $notified_users; + $notified_users += $this->add_notifications($type, $data, $temp_options); + } + + return $notified_users; + } + + $item_id = $this->get_item_type_class($notification_type_name)->get_item_id($data); + + // find out which users want to receive this type of notification + $notify_users = $this->get_item_type_class($notification_type_name)->find_users_for_notification($data, $options); + + /** + * Allow filtering the notify_users array for a notification that is about to be sent. + * Here, $notify_users is already filtered by f_read and the ignored list included in the options variable + * + * @event core.notification_manager_add_notifications + * @var string notification_type_name The forum id from where the topic belongs + * @var array data Data specific for the notification_type_name used will be inserted + * @var array notify_users The array of userid that are going to be notified for this notification. Set to array() to cancel. + * @var array options The options that were used when this method was called (read only) + * + * @since 3.1.3-RC1 + */ + $vars = array( + 'notification_type_name', + 'data', + 'notify_users', + 'options', + ); + extract($this->phpbb_dispatcher->trigger_event('core.notification_manager_add_notifications', compact($vars))); + + $this->add_notifications_for_users($notification_type_name, $data, $notify_users); + + return $notify_users; + } + + /** + * Add a notification for specific users + * + * @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 inserted + * @param array $notify_users User list to notify + */ + public function add_notifications_for_users($notification_type_name, $data, $notify_users) + { + if (is_array($notification_type_name)) + { + foreach ($notification_type_name as $type) + { + $this->add_notifications_for_users($type, $data, $notify_users); + } + + return; + } + + $notification_type_id = $this->get_notification_type_id($notification_type_name); + + $item_id = $this->get_item_type_class($notification_type_name)->get_item_id($data); + + $user_ids = array(); + $notification_objects = $notification_methods = array(); + + // Never send notifications to the anonymous user! + unset($notify_users[ANONYMOUS]); + + // 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)) + { + unset($notify_users[$row['user_id']]); + } + $this->db->sql_freeresult($result); + + if (!sizeof($notify_users)) + { + return; + } + + // Allow notifications to perform actions before creating the insert array (such as run a query to cache some data needed for all notifications) + $notification = $this->get_item_type_class($notification_type_name); + $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) + { + $notification = $this->get_item_type_class($notification_type_name); + + $notification->user_id = (int) $user; + + // Insert notification row using buffer. + $insert_buffer->insert($notification->create_insert_array($data, $pre_create_data)); + + // Users are needed to send notifications + $user_ids = array_merge($user_ids, $notification->users_to_query()); + + 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])) + { + $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); + + // run the queue for each method to send notifications + foreach ($notification_methods as $method) + { + $method->notify(); + } + } + + /** + * Update a 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 + */ + public function update_notifications($notification_type_name, $data) + { + if (is_array($notification_type_name)) + { + foreach ($notification_type_name as $type) + { + $this->update_notifications($type, $data); + } + + return; + } + + $notification = $this->get_item_type_class($notification_type_name); + + // 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->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); + } + + /** + * Delete a notification + * + * @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) + */ + public function delete_notifications($notification_type_name, $item_id, $parent_id = false) + { + if (is_array($notification_type_name)) + { + foreach ($notification_type_name as $type) + { + $this->delete_notifications($type, $item_id, $parent_id); + } + + return; + } + + $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); + } + + /** + * Get all of the subscription types + * + * @return array Array of item types + */ + public function get_subscription_types() + { + if ($this->subscription_types === null) + { + $this->subscription_types = array(); + + foreach ($this->notification_types as $type_name => $data) + { + $type = $this->get_item_type_class($type_name); + + if ($type instanceof \phpbb\notification\type\type_interface && $type->is_available()) + { + $options = array_merge(array( + 'id' => $type->get_type(), + 'lang' => 'NOTIFICATION_TYPE_' . strtoupper($type->get_type()), + 'group' => 'NOTIFICATION_GROUP_MISCELLANEOUS', + ), (($type::$notification_option !== false) ? $type::$notification_option : array())); + + $this->subscription_types[$options['group']][$options['id']] = $options; + } + } + + // Move Miscellaneous to the very last section + if (isset($this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS'])) + { + $miscellaneous = $this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']; + unset($this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']); + $this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS'] = $miscellaneous; + } + } + + return $this->subscription_types; + } + + /** + * Get all of the subscription methods + * + * @return array Array of methods + */ + public function get_subscription_methods() + { + $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()) + { + $subscription_methods[$method_name] = array( + 'id' => $method->get_type(), + 'lang' => str_replace('.', '_', strtoupper($method->get_type())), + ); + } + } + + return $subscription_methods; + } + + + /** + * Get user's notification data + * + * @param int $user_id The user_id of the user to get the notifications for + * + * @return array User's notification + */ + protected function get_user_notifications($user_id) + { + $sql = 'SELECT method, notify, item_type + FROM ' . $this->user_notifications_table . ' + WHERE user_id = ' . (int) $user_id . ' + AND item_id = 0'; + + $result = $this->db->sql_query($sql); + $user_notifications = array(); + + while ($row = $this->db->sql_fetchrow($result)) + { + $user_notifications[$row['item_type']][] = $row; + } + + $this->db->sql_freeresult($result); + + return $user_notifications; + } + + /** + * Get global subscriptions (item_id = 0) + * + * @param bool|int $user_id The user_id to add the subscription for (bool false for current user) + * + * @return array Subscriptions + */ + public function get_global_subscriptions($user_id = false) + { + $user_id = ($user_id === false) ? $this->user->data['user_id'] : $user_id; + + $subscriptions = array(); + + $user_notifications = $this->get_user_notifications($user_id); + + foreach ($this->get_subscription_types() as $types) + { + foreach ($types as $id => $type) + { + + if (empty($user_notifications[$id])) + { + // No rows at all, default to '' + $subscriptions[$id] = array(''); + } + else + { + foreach ($user_notifications[$id] as $user_notification) + { + if (!$user_notification['notify']) + { + continue; + } + + if (!isset($subscriptions[$id])) + { + $subscriptions[$id] = array(); + } + + $subscriptions[$id][] = $user_notification['method']; + } + } + } + } + + return $subscriptions; + } + + /** + * Add a subscription + * + * @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 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) + { + if ($method !== '') + { + // Make sure to subscribe them to the base subscription + $this->add_subscription($item_type, $item_id, '', $user_id); + } + + $user_id = ($user_id === false) ? $this->user->data['user_id'] : $user_id; + + $sql = 'SELECT notify + 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 = '" . $this->db->sql_escape($method) . "'"; + $this->db->sql_query($sql); + $current = $this->db->sql_fetchfield('notify'); + $this->db->sql_freeresult(); + + if ($current === false) + { + $sql = 'INSERT INTO ' . $this->user_notifications_table . ' ' . + $this->db->sql_build_array('INSERT', array( + 'item_type' => $item_type, + 'item_id' => (int) $item_id, + 'user_id' => (int) $user_id, + 'method' => $method, + 'notify' => 1, + )); + $this->db->sql_query($sql); + } + else if (!$current) + { + $sql = 'UPDATE ' . $this->user_notifications_table . " + SET notify = 1 + WHERE item_type = '" . $this->db->sql_escape($item_type) . "' + AND item_id = " . (int) $item_id . ' + AND user_id = ' .(int) $user_id . " + AND method = '" . $this->db->sql_escape($method) . "'"; + $this->db->sql_query($sql); + } + } + + /** + * Delete a subscription + * + * @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 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) + { + $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 === '') + { + $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) + { + return; + } + } + + $sql = 'UPDATE ' . $this->user_notifications_table . " + SET notify = 0 + WHERE item_type = '" . $this->db->sql_escape($item_type) . "' + AND item_id = " . (int) $item_id . ' + AND user_id = ' .(int) $user_id . " + AND method = '" . $this->db->sql_escape($method) . "'"; + $this->db->sql_query($sql); + + if (!$this->db->sql_affectedrows()) + { + $sql = 'INSERT INTO ' . $this->user_notifications_table . ' ' . + $this->db->sql_build_array('INSERT', array( + 'item_type' => $item_type, + 'item_id' => (int) $item_id, + 'user_id' => (int) $user_id, + 'method' => $method, + 'notify' => 0, + )); + $this->db->sql_query($sql); + } + } + + /** + * Disable all notifications of a certain type + * + * This should be called when an extension which has notification types + * is disabled so that all those notifications are hidden and do not + * cause errors + * + * @param string $notification_type_name Type identifier of the subscription + */ + public function disable_notifications($notification_type_name) + { + $sql = 'UPDATE ' . $this->notification_types_table . " + SET notification_type_enabled = 0 + WHERE notification_type_name = '" . $this->db->sql_escape($notification_type_name) . "'"; + $this->db->sql_query($sql); + } + + /** + * 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_name Type identifier of the subscription + */ + public function purge_notifications($notification_type_name) + { + // If a notification is never used, its type will not be added to the database + // nor its id cached. If this method is called by an extension during the + // purge step, and that extension never used its notifications, + // get_notification_type_id() will throw an exception. However, + // because no notification type was added to the database, + // there is nothing to delete, so we can silently drop the exception. + try + { + $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); + + $this->cache->destroy('notification_type_ids'); + } + catch (\phpbb\notification\exception $e) + { + // Continue + } + } + + /** + * Enable all notifications of a certain type + * + * This should be called when an extension which has notification types + * that was disabled is re-enabled so that all those notifications that + * were hidden are shown again + * + * @param string $notification_type_name Type identifier of the subscription + */ + public function enable_notifications($notification_type_name) + { + $sql = 'UPDATE ' . $this->notification_types_table . " + SET notification_type_enabled = 1 + WHERE notification_type_name = '" . $this->db->sql_escape($notification_type_name) . "'"; + $this->db->sql_query($sql); + } + + /** + * 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) + { + $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); + } + + /** + * Helper to get the notifications item type class and set it up + */ + public function get_item_type_class($notification_type_name, $data = array()) + { + $item = $this->load_object($notification_type_name); + + $item->set_initial_data($data); + + return $item; + } + + /** + * Helper to get the notifications method class and set it up + */ + public function get_method_class($method_name) + { + return $this->load_object($method_name); + } + + /** + * Helper to load objects (notification types/methods) + */ + protected function load_object($object_name) + { + $object = $this->phpbb_container->get($object_name); + + if (method_exists($object, 'set_notification_manager')) + { + $object->set_notification_manager($this); + } + + return $object; + } + + /** + * Get the notification type id from the name + * + * @param string $notification_type_name The name + * @return int the notification_type_id + * @throws \phpbb\notification\exception + */ + public function get_notification_type_id($notification_type_name) + { + $notification_type_ids = $this->cache->get('notification_type_ids'); + + if ($notification_type_ids === false) + { + $notification_type_ids = array(); + + $sql = 'SELECT notification_type_id, notification_type_name + FROM ' . $this->notification_types_table; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $notification_type_ids[$row['notification_type_name']] = (int) $row['notification_type_id']; + } + $this->db->sql_freeresult($result); + + $this->cache->put('notification_type_ids', $notification_type_ids); + } + + if (!isset($notification_type_ids[$notification_type_name])) + { + 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)); + } + + $sql = 'INSERT INTO ' . $this->notification_types_table . ' ' . $this->db->sql_build_array('INSERT', array( + 'notification_type_name' => $notification_type_name, + 'notification_type_enabled' => 1, + )); + $this->db->sql_query($sql); + + $notification_type_ids[$notification_type_name] = (int) $this->db->sql_nextid(); + + $this->cache->put('notification_type_ids', $notification_type_ids); + } + + return $notification_type_ids[$notification_type_name]; + } + + /** + * Get notification type ids (as an array) + * + * @param array $notification_type_names Array of strings + * @return array Array of integers + */ + public function get_notification_type_ids(array $notification_type_names) + { + $notification_type_ids = array(); + + foreach ($notification_type_names as $name) + { + $notification_type_ids[$name] = $this->get_notification_type_id($name); + } + + return $notification_type_ids; + } +} diff --git a/sources/phpBB/phpbb/notification/method/base.php b/sources/phpBB/phpbb/notification/method/base.php new file mode 100644 index 0000000..a0bbed6 --- /dev/null +++ b/sources/phpBB/phpbb/notification/method/base.php @@ -0,0 +1,113 @@ + +* @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; + +/** +* Base notifications method class +*/ +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 + * + * @var array + */ + protected $queue = array(); + + /** + * Notification Method 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 + * @return \phpbb\notification\method\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) + { + $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; + } + + /** + * Set notification manager (required) + * + * @param \phpbb\notification\manager $notification_manager + */ + public function set_notification_manager(\phpbb\notification\manager $notification_manager) + { + $this->notification_manager = $notification_manager; + } + + /** + * Add a notification to the queue + * + * @param \phpbb\notification\type\type_interface $notification + */ + public function add_to_queue(\phpbb\notification\type\type_interface $notification) + { + $this->queue[] = $notification; + } + + /** + * Empty the queue + */ + protected function empty_queue() + { + $this->queue = array(); + } +} diff --git a/sources/phpBB/phpbb/notification/method/email.php b/sources/phpBB/phpbb/notification/method/email.php new file mode 100644 index 0000000..a4b93bc --- /dev/null +++ b/sources/phpBB/phpbb/notification/method/email.php @@ -0,0 +1,49 @@ + +* @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; + +/** +* Email notification method class +* This class handles sending emails for notifications +*/ + +class email extends \phpbb\notification\method\messenger_base +{ + /** + * Get notification method name + * + * @return string + */ + public function get_type() + { + return 'notification.method.email'; + } + + /** + * Is this method available for the user? + * This is checked on the notifications options + */ + public function is_available() + { + return $this->config['email_enable'] && $this->user->data['user_email']; + } + + /** + * Parse the queue and notify the users + */ + public function notify() + { + return $this->notify_using_messenger(NOTIFY_EMAIL); + } +} diff --git a/sources/phpBB/phpbb/notification/method/jabber.php b/sources/phpBB/phpbb/notification/method/jabber.php new file mode 100644 index 0000000..09f186e --- /dev/null +++ b/sources/phpBB/phpbb/notification/method/jabber.php @@ -0,0 +1,66 @@ + +* @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; + +/** +* Jabber notification method class +* This class handles sending Jabber messages for notifications +*/ + +class jabber extends \phpbb\notification\method\messenger_base +{ + /** + * Get notification method name + * + * @return string + */ + public function get_type() + { + return 'notification.method.jabber'; + } + + /** + * Is this method available for the user? + * This is checked on the notifications options + */ + public function is_available() + { + return ($this->global_available() && $this->user->data['user_jabber']); + } + + /** + * Is this method available at all? + * This is checked before notifications are sent + */ + public function global_available() + { + return !( + empty($this->config['jab_enable']) || + empty($this->config['jab_host']) || + empty($this->config['jab_username']) || + empty($this->config['jab_password']) || + !@extension_loaded('xml') + ); + } + + public function notify() + { + if (!$this->global_available()) + { + return; + } + + return $this->notify_using_messenger(NOTIFY_IM, 'short/'); + } +} diff --git a/sources/phpBB/phpbb/notification/method/messenger_base.php b/sources/phpBB/phpbb/notification/method/messenger_base.php new file mode 100644 index 0000000..bde4573 --- /dev/null +++ b/sources/phpBB/phpbb/notification/method/messenger_base.php @@ -0,0 +1,96 @@ + +* @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; + +/** +* Abstract notification method handling email and jabber notifications +* using the phpBB messenger. +*/ +abstract class messenger_base extends \phpbb\notification\method\base +{ + /** + * Notify using phpBB messenger + * + * @param int $notify_method Notify method for messenger (e.g. NOTIFY_IM) + * @param string $template_dir_prefix Base directory to prepend to the email template name + * + * @return null + */ + protected function notify_using_messenger($notify_method, $template_dir_prefix = '') + { + if (empty($this->queue)) + { + return; + } + + // Load all users we want to notify (we need their email address) + $user_ids = $users = array(); + foreach ($this->queue as $notification) + { + $user_ids[] = $notification->user_id; + } + + // We do not send emails to banned users + if (!function_exists('phpbb_get_banned_user_ids')) + { + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + } + $banned_users = phpbb_get_banned_user_ids($user_ids); + + // Load all the users we need + $this->user_loader->load_users($user_ids); + + // Load the messenger + if (!class_exists('messenger')) + { + 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) + { + if ($notification->get_email_template() === false) + { + continue; + } + + $user = $this->user_loader->get_user($notification->user_id); + + if ($user['user_type'] == USER_IGNORE || in_array($notification->user_id, $banned_users)) + { + continue; + } + + $messenger->template($template_dir_prefix . $notification->get_email_template(), $user['user_lang']); + + $messenger->set_addresses($user); + + $messenger->assign_vars(array_merge(array( + 'USERNAME' => $user['username'], + + 'U_NOTIFICATION_SETTINGS' => generate_board_url() . '/ucp.' . $this->php_ext . '?i=ucp_notifications', + ), $notification->get_email_template_variables())); + + $messenger->send($notify_method); + } + + // Save the queue in the messenger class (has to be called or these emails could be lost?) + $messenger->save_queue(); + + // We're done, empty the queue + $this->empty_queue(); + } +} diff --git a/sources/phpBB/phpbb/notification/method/method_interface.php b/sources/phpBB/phpbb/notification/method/method_interface.php new file mode 100644 index 0000000..76b0de1 --- /dev/null +++ b/sources/phpBB/phpbb/notification/method/method_interface.php @@ -0,0 +1,45 @@ + +* @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; + +/** +* Base notifications method interface +*/ +interface method_interface +{ + /** + * Get notification method name + * + * @return string + */ + public function get_type(); + + /** + * Is this method available for the user? + * This is checked on the notifications options + */ + public function is_available(); + + /** + * Add a notification to the queue + * + * @param \phpbb\notification\type\type_interface $notification + */ + public function add_to_queue(\phpbb\notification\type\type_interface $notification); + + /** + * Parse the queue and notify the users + */ + public function notify(); +} diff --git a/sources/phpBB/phpbb/notification/type/admin_activate_user.php b/sources/phpBB/phpbb/notification/type/admin_activate_user.php new file mode 100644 index 0000000..dfc0157 --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/admin_activate_user.php @@ -0,0 +1,169 @@ + +* @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\type; + +/** +* Admin activation notifications class +* This class handles notifications for users requiring admin activation +*/ + +class admin_activate_user extends \phpbb\notification\type\base +{ + /** + * {@inheritdoc} + */ + public function get_type() + { + return 'notification.type.admin_activate_user'; + } + + /** + * {@inheritdoc} + */ + protected $language_key = 'NOTIFICATION_ADMIN_ACTIVATE_USER'; + + /** + * {@inheritdoc} + */ + public static $notification_option = array( + 'lang' => 'NOTIFICATION_TYPE_ADMIN_ACTIVATE_USER', + 'group' => 'NOTIFICATION_GROUP_ADMINISTRATION', + ); + + /** + * {@inheritdoc} + */ + public function is_available() + { + return ($this->auth->acl_get('a_user') && $this->config['require_activation'] == USER_ACTIVATION_ADMIN); + } + + /** + * {@inheritdoc} + */ + public static function get_item_id($user) + { + return (int) $user['user_id']; + } + + /** + * {@inheritdoc} + */ + public static function get_item_parent_id($post) + { + return 0; + } + + /** + * {@inheritdoc} + */ + public function find_users_for_notification($user, $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + ), $options); + + // Grab admins that have permission to administer users. + $admin_ary = $this->auth->acl_get_list(false, 'a_user', false); + $users = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array(); + + // Grab founders + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_FOUNDER; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $users[] = (int) $row['user_id']; + } + $this->db->sql_freeresult($result); + + if (empty($users)) + { + return array(); + } + $users = array_unique($users); + + return $this->check_user_notification_options($users, $options); + } + + /** + * {@inheritdoc} + */ + public function get_avatar() + { + return $this->user_loader->get_avatar($this->item_id); + } + + /** + * {@inheritdoc} + */ + public function get_title() + { + $username = $this->user_loader->get_username($this->item_id, 'no_profile'); + + return $this->user->lang($this->language_key, $username); + } + + /** + * {@inheritdoc} + */ + public function get_email_template() + { + return 'admin_activate'; + } + + /** + * {@inheritdoc} + */ + public function get_email_template_variables() + { + $board_url = generate_board_url(); + $username = $this->user_loader->get_username($this->item_id, 'username'); + + return array( + 'USERNAME' => htmlspecialchars_decode($username), + 'U_USER_DETAILS' => "{$board_url}/memberlist.{$this->php_ext}?mode=viewprofile&u={$this->item_id}", + 'U_ACTIVATE' => "{$board_url}/ucp.{$this->php_ext}?mode=activate&u={$this->item_id}&k={$this->get_data('user_actkey')}", + ); + } + + /** + * {@inheritdoc} + */ + public function get_url() + { + return $this->user_loader->get_username($this->item_id, 'profile'); + } + + /** + * {@inheritdoc} + */ + public function users_to_query() + { + return array($this->item_id); + } + + /** + * {@inheritdoc} + */ + public function create_insert_array($user, $pre_create_data) + { + $this->set_data('user_actkey', $user['user_actkey']); + $this->notification_time = $user['user_regdate']; + + return parent::create_insert_array($user, $pre_create_data); + } +} diff --git a/sources/phpBB/phpbb/notification/type/approve_post.php b/sources/phpBB/phpbb/notification/type/approve_post.php new file mode 100644 index 0000000..a9e635b --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/approve_post.php @@ -0,0 +1,146 @@ + +* @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\type; + +/** +* Post approved notifications class +* This class handles notifications for posts when they are approved (to their authors) +*/ + +class approve_post extends \phpbb\notification\type\post +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.approve_post'; + } + + /** + * Language key used to output the text + * + * @var string + */ + protected $language_key = 'NOTIFICATION_POST_APPROVED'; + + /** + * Inherit notification read status from post. + * + * @var bool + */ + protected $inherit_read_status = false; + + /** + * Notification option data (for outputting to the user) + * + * @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( + 'id' => 'moderation_queue', + 'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE', + 'group' => 'NOTIFICATION_GROUP_POSTING', + ); + + /** + * Is available + */ + public function is_available() + { + return !$this->auth->acl_get('m_approve'); + } + + /** + * Find the users who want to receive notifications + * + * @param array $post Data from submit_post + * @param array $options Options for finding users for notification + * + * @return array + */ + public function find_users_for_notification($post, $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + ), $options); + + $users = array(); + $users[$post['poster_id']] = array(''); + + return $this->get_authorised_recipients(array_keys($users), $post['forum_id'], array_merge($options, array( + 'item_type' => self::$notification_option['id'], + ))); + } + + /** + * Pre create insert array function + * This allows you to perform certain actions, like run a query + * and load data, before create_insert_array() is run. The data + * returned from this function will be sent to create_insert_array(). + * + * @param array $post Post data from submit_post + * @param array $notify_users Notify users list + * Formated from find_users_for_notification() + * @return array Whatever you want to send to create_insert_array(). + */ + public function pre_create_insert_array($post, $notify_users) + { + // In the parent class, this is used to check if the post is already + // read by a user and marks the notification read if it was marked read. + // Returning an empty array in effect, forces it to be marked as unread + // (and also saves a query) + return array(); + } + + /** + * 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 + */ + 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); + + $this->notification_time = $data['notification_time'] = time(); + + return $data; + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return 'post_approved'; + } + + /** + * {inheritDoc} + */ + public function get_redirect_url() + { + return $this->get_url(); + } +} diff --git a/sources/phpBB/phpbb/notification/type/approve_topic.php b/sources/phpBB/phpbb/notification/type/approve_topic.php new file mode 100644 index 0000000..2f46783 --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/approve_topic.php @@ -0,0 +1,136 @@ + +* @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\type; + +/** +* Topic approved notifications class +* This class handles notifications for topics when they are approved (for authors) +*/ + +class approve_topic extends \phpbb\notification\type\topic +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.approve_topic'; + } + + /** + * Language key used to output the text + * + * @var string + */ + protected $language_key = 'NOTIFICATION_TOPIC_APPROVED'; + + /** + * Inherit notification read status from topic. + * + * @var bool + */ + protected $inherit_read_status = false; + + /** + * Notification option data (for outputting to the user) + * + * @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( + 'id' => 'moderation_queue', + 'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE', + 'group' => 'NOTIFICATION_GROUP_POSTING', + ); + + /** + * Is available + */ + public function is_available() + { + return !$this->auth->acl_get('m_approve'); + } + + /** + * Find the users who want to receive notifications + * + * @param array $post Data from submit_post + * @param array $options Options for finding users for notification + * + * @return array + */ + public function find_users_for_notification($post, $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + ), $options); + + $users = array(); + $users[$post['poster_id']] = array(''); + + return $this->get_authorised_recipients(array_keys($users), $post['forum_id'], array_merge($options, array( + 'item_type' => self::$notification_option['id'], + ))); + } + + /** + * Pre create insert array function + * This allows you to perform certain actions, like run a query + * and load data, before create_insert_array() is run. The data + * returned from this function will be sent to create_insert_array(). + * + * @param array $post Post data from submit_post + * @param array $notify_users Notify users list + * Formated from find_users_for_notification() + * @return array Whatever you want to send to create_insert_array(). + */ + public function pre_create_insert_array($post, $notify_users) + { + // In the parent class, this is used to check if the post is already + // read by a user and marks the notification read if it was marked read. + // Returning an empty array in effect, forces it to be marked as unread + // (and also saves a query) + return array(); + } + + /** + * 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 + */ + 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(); + + return $data; + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return 'topic_approved'; + } +} diff --git a/sources/phpBB/phpbb/notification/type/base.php b/sources/phpBB/phpbb/notification/type/base.php new file mode 100644 index 0000000..4ead060 --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/base.php @@ -0,0 +1,569 @@ + +* @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\type; + +/** +* Base notifications class +*/ +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; + + /** @var string */ + protected $php_ext; + + /** @var string */ + protected $notification_types_table; + + /** @var string */ + protected $notifications_table; + + /** @var string */ + protected $user_notifications_table; + + /** + * Notification option data (for outputting to the user) + * + * @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; + + /** + * The notification_type_id, set upon creation of the class + * This is the notification_type_id from the notification_types table + * + * @var int + */ + protected $notification_type_id; + + /** + * Indentification data + * notification_type_id - ID of the item type (auto generated, from notification types table) + * item_id - ID of the item (e.g. post_id, msg_id) + * item_parent_id - Parent item id (ex: for topic => forum_id, for post => topic_id, etc) + * user_id + * notification_read + * notification_time + * notification_data (special serialized field that each notification type can use to store stuff) + * + * @var array $data Notification row from the database + * This must be private, all interaction should use __get(), __set(), get_data(), set_data() + */ + private $data = array(); + + /** + * 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) + { + $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; + } + + /** + * Set notification manager (required) + * + * @param \phpbb\notification\manager $notification_manager + */ + public function set_notification_manager(\phpbb\notification\manager $notification_manager) + { + $this->notification_manager = $notification_manager; + + $this->notification_type_id = $this->notification_manager->get_notification_type_id($this->get_type()); + } + + /** + * Set initial data from the database + * + * @param array $data Row directly from the database + */ + public function set_initial_data($data = array()) + { + // The row from the database (unless this is a new notification we're going to add) + $this->data = $data; + $this->data['notification_data'] = (isset($this->data['notification_data'])) ? unserialize($this->data['notification_data']) : array(); + } + + /** + * Magic method to get data from this notification + * + * @param mixed $name + * @return mixed + */ + public function __get($name) + { + return (!isset($this->data[$name])) ? null : $this->data[$name]; + } + + + /** + * Magic method to set data on this notification + * + * @param mixed $name + * @param mixed $value + * + * @return null + */ + public function __set($name, $value) + { + $this->data[$name] = $value; + } + + + /** + * Magic method to get a string of this notification + * + * Primarily for testing + * + * @return mixed + */ + public function __toString() + { + return (!empty($this->data)) ? var_export($this->data, true) : $this->get_type(); + } + + /** + * Get special data (only important for the classes that extend this) + * + * @param string $name Name of the variable to get + * @return mixed + */ + protected function get_data($name) + { + return ($name === false) ? $this->data['notification_data'] : ((isset($this->data['notification_data'][$name])) ? $this->data['notification_data'][$name] : null); + } + + /** + * Set special data (only important for the classes that extend this) + * + * @param string $name Name of the variable to set + * @param mixed $value Value to set to the variable + * @return mixed + */ + protected function set_data($name, $value) + { + $this->data['notification_data'][$name] = $value; + } + + /** + * 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 + */ + public function create_insert_array($type_data, $pre_create_data = array()) + { + // Defaults + $this->data = array_merge(array( + 'item_id' => static::get_item_id($type_data), + 'notification_type_id' => $this->notification_type_id, + 'item_parent_id' => static::get_item_parent_id($type_data), + + 'notification_time' => time(), + 'notification_read' => false, + + 'notification_data' => array(), + ), $this->data); + + $data = $this->data; + + $data['notification_data'] = serialize($data['notification_data']); + + return $data; + } + + /** + * Function for preparing the data for update in an SQL query + * (The service handles insertion) + * + * @param array $type_data Data unique to this notification type + * @return array Array of data ready to be updated in the database + */ + public function create_update_array($type_data) + { + $data = $this->create_insert_array($type_data); + + // Unset data unique to each row + unset( + $data['notification_time'], // Also unsetting time, since it always tries to change the time to current (if you actually need to change the time, over-ride this function) + $data['notification_id'], + $data['notification_read'], + $data['user_id'] + ); + + return $data; + } + + /** + * Mark this item read + * + * @param bool $return True to return a string containing the SQL code to update this item, False to execute it (Default: False) + * @return string|null If $return is False, nothing will be returned, else the sql code to update this item + */ + public function mark_read($return = false) + { + return $this->mark(false, $return); + } + + /** + * Mark this item unread + * + * @param bool $return True to return a string containing the SQL code to update this item, False to execute it (Default: False) + * @return string|null If $return is False, nothing will be returned, else the sql code to update this item + */ + public function mark_unread($return = false) + { + return $this->mark(true, $return); + } + + /** + * {inheritDoc} + */ + public function get_redirect_url() + { + return $this->get_url(); + } + + /** + * Prepare to output the notification to the template + * + * @return array Template variables + */ + public function prepare_for_display() + { + $mark_hash = generate_link_hash('mark_notification_read'); + + if ($this->get_url()) + { + $u_mark_read = append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'mark_notification=' . $this->notification_id . '&hash=' . $mark_hash); + } + else + { + $redirect = (($this->user->page['page_dir']) ? $this->user->page['page_dir'] . '/' : '') . $this->user->page['page_name'] . (($this->user->page['query_string']) ? '?' . $this->user->page['query_string'] : ''); + + $u_mark_read = append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'mark_notification=' . $this->notification_id . '&hash=' . $mark_hash . '&redirect=' . urlencode($redirect)); + } + + return array( + 'NOTIFICATION_ID' => $this->notification_id, + 'STYLING' => $this->get_style_class(), + 'AVATAR' => $this->get_avatar(), + 'FORMATTED_TITLE' => $this->get_title(), + 'REFERENCE' => $this->get_reference(), + 'FORUM' => $this->get_forum(), + 'REASON' => $this->get_reason(), + 'URL' => $this->get_url(), + 'TIME' => $this->user->format_date($this->notification_time), + 'UNREAD' => !$this->notification_read, + 'U_MARK_READ' => (!$this->notification_read) ? $u_mark_read : '', + ); + } + + /** + * -------------- Fall back functions ------------------- + */ + + /** + * URL to unsubscribe to this notification (fall back) + * + * @param string|bool $method Method name to unsubscribe from (email|jabber|etc), False to unsubscribe from all notifications for this item + */ + public function get_unsubscribe_url($method = false) + { + return false; + } + + /** + * Get the CSS style class of the notification (fall back) + * + * @return string + */ + public function get_style_class() + { + return ''; + } + + /** + * Get the user's avatar (fall back) + * + * @return string + */ + public function get_avatar() + { + return ''; + } + + /** + * Get the reference of the notifcation (fall back) + * + * @return string + */ + public function get_reference() + { + return ''; + } + + /** + * Get the forum of the notification reference (fall back) + * + * @return string + */ + public function get_forum() + { + return ''; + } + + /** + * Get the reason for the notifcation (fall back) + * + * @return string + */ + public function get_reason() + { + return ''; + } + + /** + * Get the special items to load (fall back) + * + * @return array + */ + public function get_load_special() + { + return array(); + } + + /** + * Load the special items (fall back) + */ + public function load_special($data, $notifications) + { + return; + } + + /** + * Is available (fall back) + * + * @return bool + */ + public function is_available() + { + return true; + } + + /** + * Pre create insert array function (fall back) + * + * @return array + */ + public function pre_create_insert_array($type_data, $notify_users) + { + return array(); + } + + /** + * -------------- Helper functions ------------------- + */ + + /** + * Find the users who want to receive notifications (helper) + * + * @param array $user_ids User IDs to check if they want to receive notifications + * (Bool False to check all users besides anonymous and bots (USER_IGNORE)) + * + * @return array + */ + protected function check_user_notification_options($user_ids = false, $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + 'item_type' => $this->get_type(), + 'item_id' => 0, // Global by default + ), $options); + + if ($user_ids === false) + { + $user_ids = array(); + + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . ' + WHERE user_id <> ' . ANONYMOUS . ' + AND user_type <> ' . USER_IGNORE; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $user_ids[] = $row['user_id']; + } + $this->db->sql_freeresult($result); + } + + if (empty($user_ids)) + { + return array(); + } + + $rowset = $resulting_user_ids = array(); + + $sql = 'SELECT user_id, method, notify + FROM ' . $this->user_notifications_table . ' + WHERE ' . $this->db->sql_in_set('user_id', $user_ids) . " + AND item_type = '" . $this->db->sql_escape($options['item_type']) . "' + AND item_id = " . (int) $options['item_id']; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $resulting_user_ids[] = $row['user_id']; + + if (!$row['notify'] || (isset($options['ignore_users'][$row['user_id']]) && in_array($row['method'], $options['ignore_users'][$row['user_id']]))) + { + continue; + } + + if (!isset($rowset[$row['user_id']])) + { + $rowset[$row['user_id']] = array(); + } + + $rowset[$row['user_id']][] = $row['method']; + } + + $this->db->sql_freeresult($result); + + foreach ($user_ids as $user_id) + { + 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(''); + } + } + + return $rowset; + } + + /** + * Mark this item read/unread helper + * + * @param bool $unread Unread (True/False) (Default: False) + * @param bool $return True to return a string containing the SQL code to update this item, False to execute it (Default: False) + * @return string|null If $return is False, nothing will be returned, else the sql code to update this item + */ + protected function mark($unread = true, $return = false) + { + $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) + { + return $where; + } + + $sql = 'UPDATE ' . $this->notifications_table . ' + SET notification_read = ' . (int) $this->notification_read . ' + WHERE ' . $where; + $this->db->sql_query($sql); + } + + /** + * Get a list of users that are authorised to receive notifications + * + * @param array $users Array of users that have subscribed to a notification + * @param int $forum_id Forum ID of the forum + * @param array $options Array of notification options + * @param bool $sort Whether the users array should be sorted. Default: false + * @return array Array of users that are authorised recipients + */ + protected function get_authorised_recipients($users, $forum_id, $options, $sort = false) + { + if (empty($users)) + { + return array(); + } + + $users = array_unique($users); + + if ($sort) + { + sort($users); + } + + $auth_read = $this->auth->acl_get_list($users, 'f_read', $forum_id); + + if (empty($auth_read)) + { + return array(); + } + + return $this->check_user_notification_options($auth_read[$forum_id]['f_read'], $options); + } +} diff --git a/sources/phpBB/phpbb/notification/type/bookmark.php b/sources/phpBB/phpbb/notification/type/bookmark.php new file mode 100644 index 0000000..4f2d34c --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/bookmark.php @@ -0,0 +1,132 @@ + +* @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\type; + +/** +* Bookmark updating notifications class +* This class handles notifications for replies to a bookmarked topic +*/ + +class bookmark extends \phpbb\notification\type\post +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.bookmark'; + } + + /** + * Language key used to output the text + * + * @var string + */ + protected $language_key = 'NOTIFICATION_BOOKMARK'; + + /** + * Notification option data (for outputting to the user) + * + * @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( + 'lang' => 'NOTIFICATION_TYPE_BOOKMARK', + 'group' => 'NOTIFICATION_GROUP_POSTING', + ); + + /** + * Is available + */ + public function is_available() + { + return $this->config['allow_bookmarks']; + } + + /** + * Find the users who want to receive notifications + * + * @param array $post Data from submit_post + * @param array $options Options for finding users for notification + * + * @return array + */ + public function find_users_for_notification($post, $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + ), $options); + + $users = array(); + + $sql = 'SELECT user_id + FROM ' . BOOKMARKS_TABLE . ' + WHERE ' . $this->db->sql_in_set('topic_id', $post['topic_id']) . ' + AND user_id <> ' . (int) $post['poster_id']; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $users[] = (int) $row['user_id']; + } + $this->db->sql_freeresult($result); + + $notify_users = $this->get_authorised_recipients($users, $post['forum_id'], $options, true); + + if (empty($notify_users)) + { + return array(); + } + + // Try to find the users who already have been notified about replies and have not read the topic since and just update their notifications + $update_notifications = array(); + $sql = 'SELECT n.* + FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt + WHERE n.notification_type_id = ' . (int) $this->notification_type_id . ' + AND n.item_parent_id = ' . (int) self::get_item_parent_id($post) . ' + AND n.notification_read = 0 + AND nt.notification_type_id = n.notification_type_id + AND nt.notification_type_enabled = 1'; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + // Do not create a new notification + unset($notify_users[$row['user_id']]); + + $notification = $this->notification_manager->get_item_type_class($this->get_type(), $row); + $update_responders = $notification->add_responders($post); + if (!empty($update_responders)) + { + $sql = 'UPDATE ' . $this->notifications_table . ' + SET ' . $this->db->sql_build_array('UPDATE', $update_responders) . ' + WHERE notification_id = ' . $row['notification_id']; + $this->db->sql_query($sql); + } + } + $this->db->sql_freeresult($result); + + return $notify_users; + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return 'bookmark'; + } +} diff --git a/sources/phpBB/phpbb/notification/type/disapprove_post.php b/sources/phpBB/phpbb/notification/type/disapprove_post.php new file mode 100644 index 0000000..6c7bcbc --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/disapprove_post.php @@ -0,0 +1,156 @@ + +* @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\type; + +/** +* Post disapproved notifications class +* This class handles notifications for posts when they are disapproved (for authors) +*/ + +class disapprove_post extends \phpbb\notification\type\approve_post +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.disapprove_post'; + } + + /** + * Get the CSS style class of the notification + * + * @return string + */ + public function get_style_class() + { + return 'notification-disapproved'; + } + + /** + * Language key used to output the text + * + * @var string + */ + protected $language_key = 'NOTIFICATION_POST_DISAPPROVED'; + + /** + * Inherit notification read status from post. + * + * @var bool + */ + protected $inherit_read_status = false; + + /** + * Notification option data (for outputting to the user) + * + * @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( + 'id' => 'moderation_queue', + 'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE', + 'group' => 'NOTIFICATION_GROUP_POSTING', + ); + + /** + * Get the HTML formatted title of this notification + * + * @return string + */ + public function get_title() + { + return $this->user->lang($this->language_key); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', + censor_text($this->get_data('topic_title')) + ); + } + + /** + * Get the reason for the disapproval notification + * + * @return string + */ + public function get_reason() + { + return $this->user->lang( + 'NOTIFICATION_REASON', + $this->get_data('disapprove_reason') + ); + } + + /** + * Get the url to this item + * + * @return string URL + */ + public function get_url() + { + return ''; + } + + /** + * Get email template variables + * + * @return array + */ + public function get_email_template_variables() + { + return array_merge(parent::get_email_template_variables(), array( + 'REASON' => htmlspecialchars_decode($this->get_data('disapprove_reason')), + )); + } + + /** + * 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 + */ + public function create_insert_array($post, $pre_create_data = array()) + { + $this->set_data('disapprove_reason', $post['disapprove_reason']); + + $data = parent::create_insert_array($post); + + $this->notification_time = $data['notification_time'] = time(); + + return $data; + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return 'post_disapproved'; + } +} diff --git a/sources/phpBB/phpbb/notification/type/disapprove_topic.php b/sources/phpBB/phpbb/notification/type/disapprove_topic.php new file mode 100644 index 0000000..efa5eb7 --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/disapprove_topic.php @@ -0,0 +1,156 @@ + +* @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\type; + +/** +* Topic disapproved notifications class +* This class handles notifications for topics when they are disapproved (for authors) +*/ + +class disapprove_topic extends \phpbb\notification\type\approve_topic +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.disapprove_topic'; + } + + /** + * Get the CSS style class of the notification + * + * @return string + */ + public function get_style_class() + { + return 'notification-disapproved'; + } + + /** + * Language key used to output the text + * + * @var string + */ + protected $language_key = 'NOTIFICATION_TOPIC_DISAPPROVED'; + + /** + * Inherit notification read status from topic. + * + * @var bool + */ + protected $inherit_read_status = false; + + /** + * Notification option data (for outputting to the user) + * + * @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( + 'id' => 'moderation_queue', + 'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE', + 'group' => 'NOTIFICATION_GROUP_POSTING', + ); + + /** + * Get the HTML formatted title of this notification + * + * @return string + */ + public function get_title() + { + return $this->user->lang($this->language_key); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', + censor_text($this->get_data('topic_title')) + ); + } + + /** + * Get the reason for the disapproval notification + * + * @return string + */ + public function get_reason() + { + return $this->user->lang( + 'NOTIFICATION_REASON', + $this->get_data('disapprove_reason') + ); + } + + /** + * Get the url to this item + * + * @return string URL + */ + public function get_url() + { + return ''; + } + + /** + * Get email template variables + * + * @return array + */ + public function get_email_template_variables() + { + return array_merge(parent::get_email_template_variables(), array( + 'REASON' => htmlspecialchars_decode($this->get_data('disapprove_reason')), + )); + } + + /** + * 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 + */ + 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); + + $this->notification_time = $data['notification_time'] = time(); + + return $data; + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return 'topic_disapproved'; + } +} diff --git a/sources/phpBB/phpbb/notification/type/group_request.php b/sources/phpBB/phpbb/notification/type/group_request.php new file mode 100644 index 0000000..4baf516 --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/group_request.php @@ -0,0 +1,161 @@ + +* @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\type; + +class group_request extends \phpbb\notification\type\base +{ + /** + * {@inheritdoc} + */ + public function get_type() + { + return 'notification.type.group_request'; + } + + /** + * {@inheritdoc} + */ + public static $notification_option = array( + 'lang' => 'NOTIFICATION_TYPE_GROUP_REQUEST', + ); + + /** + * {@inheritdoc} + */ + public function is_available() + { + // Leader of any groups? + $sql = 'SELECT group_id + FROM ' . USER_GROUP_TABLE . ' + WHERE user_id = ' . (int) $this->user->data['user_id'] . ' + AND group_leader = 1'; + $result = $this->db->sql_query_limit($sql, 1); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + return (!empty($row)) ? true : false; + } + + /** + * {@inheritdoc} + */ + public static function get_item_id($group) + { + return (int) $group['user_id']; + } + + /** + * {@inheritdoc} + */ + public static function get_item_parent_id($group) + { + // Group id is the parent + return (int) $group['group_id']; + } + + /** + * {@inheritdoc} + */ + public function find_users_for_notification($group, $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + ), $options); + + $sql = 'SELECT user_id + FROM ' . USER_GROUP_TABLE . ' + WHERE group_leader = 1 + AND group_id = ' . (int) $group['group_id']; + $result = $this->db->sql_query($sql); + + $user_ids = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $user_ids[] = (int) $row['user_id']; + } + $this->db->sql_freeresult($result); + + $this->user_loader->load_users($user_ids); + + return $this->check_user_notification_options($user_ids, $options); + } + + /** + * {@inheritdoc} + */ + public function get_avatar() + { + return $this->user_loader->get_avatar($this->item_id); + } + + /** + * {@inheritdoc} + */ + public function get_title() + { + $username = $this->user_loader->get_username($this->item_id, 'no_profile'); + + return $this->user->lang('NOTIFICATION_GROUP_REQUEST', $username, $this->get_data('group_name')); + } + + /** + * {@inheritdoc} + */ + public function get_email_template() + { + return 'group_request'; + } + + /** + * {@inheritdoc} + */ + public function get_email_template_variables() + { + $user_data = $this->user_loader->get_user($this->item_id); + + return array( + 'GROUP_NAME' => htmlspecialchars_decode($this->get_data('group_name')), + 'REQUEST_USERNAME' => htmlspecialchars_decode($user_data['username']), + + 'U_PENDING' => generate_board_url() . "/ucp.{$this->php_ext}?i=groups&mode=manage&action=list&g={$this->item_parent_id}", + 'U_GROUP' => generate_board_url() . "/memberlist.{$this->php_ext}?mode=group&g={$this->item_parent_id}", + ); + } + + /** + * {@inheritdoc} + */ + public function get_url() + { + return append_sid($this->phpbb_root_path . 'ucp.' . $this->php_ext, "i=groups&mode=manage&action=list&g={$this->item_parent_id}"); + } + + /** + * {@inheritdoc} + */ + public function users_to_query() + { + return array($this->item_id); + } + + /** + * {@inheritdoc} + */ + public function create_insert_array($group, $pre_create_data = array()) + { + $this->set_data('group_name', $group['group_name']); + + return parent::create_insert_array($group, $pre_create_data); + } +} diff --git a/sources/phpBB/phpbb/notification/type/group_request_approved.php b/sources/phpBB/phpbb/notification/type/group_request_approved.php new file mode 100644 index 0000000..d284046 --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/group_request_approved.php @@ -0,0 +1,116 @@ + +* @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\type; + +class group_request_approved extends \phpbb\notification\type\base +{ + /** + * {@inheritdoc} + */ + public function get_type() + { + return 'notification.type.group_request_approved'; + } + + /** + * {@inheritdoc} + */ + public function is_available() + { + return false; + } + + /** + * {@inheritdoc} + */ + public static function get_item_id($group) + { + return (int) $group['group_id']; + } + + /** + * {@inheritdoc} + */ + public static function get_item_parent_id($group) + { + return 0; + } + + /** + * {@inheritdoc} + */ + public function find_users_for_notification($group, $options = array()) + { + $users = array(); + + $group['user_ids'] = (!is_array($group['user_ids'])) ? array($group['user_ids']) : $group['user_ids']; + + foreach ($group['user_ids'] as $user_id) + { + $users[$user_id] = array(''); + } + + return $users; + } + + /** + * {@inheritdoc} + */ + public function get_title() + { + return $this->user->lang('NOTIFICATION_GROUP_REQUEST_APPROVED', $this->get_data('group_name')); + } + + /** + * {@inheritdoc} + */ + public function get_url() + { + return append_sid($this->phpbb_root_path . 'memberlist.' . $this->php_ext, "mode=group&g={$this->item_id}"); + } + + /** + * {@inheritdoc} + */ + public function create_insert_array($group, $pre_create_data = array()) + { + $this->set_data('group_name', $group['group_name']); + + return parent::create_insert_array($group, $pre_create_data); + } + + /** + * {@inheritdoc} + */ + public function users_to_query() + { + return array(); + } + + /** + * {@inheritdoc} + */ + public function get_email_template() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function get_email_template_variables() + { + return array(); + } +} diff --git a/sources/phpBB/phpbb/notification/type/pm.php b/sources/phpBB/phpbb/notification/type/pm.php new file mode 100644 index 0000000..330a70c --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/pm.php @@ -0,0 +1,195 @@ + +* @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\type; + +/** +* Private message notifications class +* This class handles notifications for private messages +*/ + +class pm extends \phpbb\notification\type\base +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.pm'; + } + + /** + * Notification option data (for outputting to the user) + * + * @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( + 'lang' => 'NOTIFICATION_TYPE_PM', + ); + + /** + * Is available + */ + public function is_available() + { + return ($this->config['allow_privmsg'] && $this->auth->acl_get('u_readpm')); + } + + /** + * Get the id of the + * + * @param array $pm The data from the private message + */ + public static function get_item_id($pm) + { + return (int) $pm['msg_id']; + } + + /** + * Get the id of the parent + * + * @param array $pm The data from the pm + */ + public static function get_item_parent_id($pm) + { + // No parent + return 0; + } + + /** + * Find the users who want to receive notifications + * + * @param array $pm Data from submit_pm + * @param array $options Options for finding users for notification + * + * @return array + */ + public function find_users_for_notification($pm, $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + ), $options); + + if (!sizeof($pm['recipients'])) + { + return array(); + } + + unset($pm['recipients'][$pm['from_user_id']]); + + $this->user_loader->load_users(array_keys($pm['recipients'])); + + return $this->check_user_notification_options(array_keys($pm['recipients']), $options); + } + + /** + * Get the user's avatar + */ + public function get_avatar() + { + return $this->user_loader->get_avatar($this->get_data('from_user_id')); + } + + /** + * Get the HTML formatted title of this notification + * + * @return string + */ + public function get_title() + { + $username = $this->user_loader->get_username($this->get_data('from_user_id'), 'no_profile'); + + return $this->user->lang('NOTIFICATION_PM', $username); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', + $this->get_data('message_subject') + ); + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return 'privmsg_notify'; + } + + /** + * Get email template variables + * + * @return array + */ + public function get_email_template_variables() + { + $user_data = $this->user_loader->get_user($this->get_data('from_user_id')); + + return array( + 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']), + 'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))), + + 'U_VIEW_MESSAGE' => generate_board_url() . '/ucp.' . $this->php_ext . "?i=pm&mode=view&p={$this->item_id}", + ); + } + + /** + * Get the url to this item + * + * @return string URL + */ + public function get_url() + { + return append_sid($this->phpbb_root_path . 'ucp.' . $this->php_ext, "i=pm&mode=view&p={$this->item_id}"); + } + + /** + * Users needed to query before this notification can be displayed + * + * @return array Array of user_ids + */ + public function users_to_query() + { + return array($this->get_data('from_user_id')); + } + + /** + * 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 + */ + public function create_insert_array($pm, $pre_create_data = array()) + { + $this->set_data('from_user_id', $pm['from_user_id']); + + $this->set_data('message_subject', $pm['message_subject']); + + return parent::create_insert_array($pm, $pre_create_data); + } +} diff --git a/sources/phpBB/phpbb/notification/type/post.php b/sources/phpBB/phpbb/notification/type/post.php new file mode 100644 index 0000000..d9e74f2 --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/post.php @@ -0,0 +1,451 @@ + +* @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\type; + +/** +* Post notifications class +* This class handles notifications for replies to a topic +*/ + +class post extends \phpbb\notification\type\base +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.post'; + } + + /** + * Language key used to output the text + * + * @var string + */ + protected $language_key = 'NOTIFICATION_POST'; + + /** + * Inherit notification read status from post. + * + * @var bool + */ + protected $inherit_read_status = true; + + /** + * Notification option data (for outputting to the user) + * + * @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( + 'lang' => 'NOTIFICATION_TYPE_POST', + 'group' => 'NOTIFICATION_GROUP_POSTING', + ); + + /** + * Is available + */ + public function is_available() + { + return $this->config['allow_topic_notify']; + } + + /** + * Get the id of the item + * + * @param array $post The data from the post + */ + public static function get_item_id($post) + { + return (int) $post['post_id']; + } + + /** + * Get the id of the parent + * + * @param array $post The data from the post + */ + public static function get_item_parent_id($post) + { + return (int) $post['topic_id']; + } + + /** + * Find the users who want to receive notifications + * + * @param array $post Data from submit_post + * @param array $options Options for finding users for notification + * + * @return array + */ + public function find_users_for_notification($post, $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + ), $options); + + $users = array(); + + $sql = 'SELECT user_id + FROM ' . TOPICS_WATCH_TABLE . ' + WHERE topic_id = ' . (int) $post['topic_id'] . ' + AND notify_status = ' . NOTIFY_YES . ' + AND user_id <> ' . (int) $post['poster_id']; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $users[] = (int) $row['user_id']; + } + $this->db->sql_freeresult($result); + + $sql = 'SELECT user_id + FROM ' . FORUMS_WATCH_TABLE . ' + WHERE forum_id = ' . (int) $post['forum_id'] . ' + AND notify_status = ' . NOTIFY_YES . ' + AND user_id <> ' . (int) $post['poster_id']; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $users[] = (int) $row['user_id']; + } + $this->db->sql_freeresult($result); + + $notify_users = $this->get_authorised_recipients($users, $post['forum_id'], $options, true); + + if (empty($notify_users)) + { + return array(); + } + + // Try to find the users who already have been notified about replies and have not read the topic since and just update their notifications + $update_notifications = array(); + $sql = 'SELECT n.* + FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt + WHERE n.notification_type_id = ' . (int) $this->notification_type_id . ' + AND n.item_parent_id = ' . (int) self::get_item_parent_id($post) . ' + AND n.notification_read = 0 + AND nt.notification_type_id = n.notification_type_id + AND nt.notification_type_enabled = 1'; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + // Do not create a new notification + unset($notify_users[$row['user_id']]); + + $notification = $this->notification_manager->get_item_type_class($this->get_type(), $row); + $update_responders = $notification->add_responders($post); + if (!empty($update_responders)) + { + $sql = 'UPDATE ' . $this->notifications_table . ' + SET ' . $this->db->sql_build_array('UPDATE', $update_responders) . ' + WHERE notification_id = ' . $row['notification_id']; + $this->db->sql_query($sql); + } + } + $this->db->sql_freeresult($result); + + return $notify_users; + } + + /** + * Get the user's avatar + */ + public function get_avatar() + { + return $this->user_loader->get_avatar($this->get_data('poster_id')); + } + + /** + * Get the HTML formatted title of this notification + * + * @return string + */ + public function get_title() + { + $responders = $this->get_data('responders'); + $usernames = array(); + + if (!is_array($responders)) + { + $responders = array(); + } + + $responders = array_merge(array(array( + 'poster_id' => $this->get_data('poster_id'), + 'username' => $this->get_data('post_username'), + )), $responders); + + $responders_cnt = sizeof($responders); + $responders = $this->trim_user_ary($responders); + $trimmed_responders_cnt = $responders_cnt - sizeof($responders); + + foreach ($responders as $responder) + { + if ($responder['username']) + { + $usernames[] = $responder['username']; + } + else + { + $usernames[] = $this->user_loader->get_username($responder['poster_id'], 'no_profile'); + } + } + + if ($trimmed_responders_cnt > 20) + { + $usernames[] = $this->user->lang('NOTIFICATION_MANY_OTHERS'); + } + else if ($trimmed_responders_cnt) + { + $usernames[] = $this->user->lang('NOTIFICATION_X_OTHERS', $trimmed_responders_cnt); + } + + return $this->user->lang( + $this->language_key, + phpbb_generate_string_list($usernames, $this->user), + $responders_cnt + ); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', + censor_text($this->get_data('topic_title')) + ); + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return 'topic_notify'; + } + + /** + * Get email template variables + * + * @return array + */ + public function get_email_template_variables() + { + if ($this->get_data('post_username')) + { + $username = $this->get_data('post_username'); + } + else + { + $username = $this->user_loader->get_username($this->get_data('poster_id'), 'username'); + } + + return array( + 'AUTHOR_NAME' => htmlspecialchars_decode($username), + 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject'))), + 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))), + + 'U_VIEW_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}", + 'U_NEWEST_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&e=1&view=unread#unread", + 'U_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}", + 'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}", + 'U_FORUM' => generate_board_url() . "/viewforum.{$this->php_ext}?f={$this->get_data('forum_id')}", + 'U_STOP_WATCHING_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?uid={$this->user_id}&f={$this->get_data('forum_id')}&t={$this->item_parent_id}&unwatch=topic", + ); + } + + /** + * Get the url to this item + * + * @return string URL + */ + public function get_url() + { + return append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "p={$this->item_id}#p{$this->item_id}"); + } + + /** + * {inheritDoc} + */ + public function get_redirect_url() + { + return append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "t={$this->item_parent_id}&view=unread#unread"); + } + + /** + * Users needed to query before this notification can be displayed + * + * @return array Array of user_ids + */ + public function users_to_query() + { + $responders = $this->get_data('responders'); + $users = array( + $this->get_data('poster_id'), + ); + + if (is_array($responders)) + { + foreach ($responders as $responder) + { + $users[] = $responder['poster_id']; + } + } + + return $this->trim_user_ary($users); + } + + /** + * Trim the user array passed down to 3 users if the array contains + * more than 4 users. + * + * @param array $users Array of users + * @return array Trimmed array of user_ids + */ + public function trim_user_ary($users) + { + if (sizeof($users) > 4) + { + array_splice($users, 3); + } + return $users; + } + + /** + * Pre create insert array function + * This allows you to perform certain actions, like run a query + * and load data, before create_insert_array() is run. The data + * returned from this function will be sent to create_insert_array(). + * + * @param array $post Post data from submit_post + * @param array $notify_users Notify users list + * Formated from find_users_for_notification() + * @return array Whatever you want to send to create_insert_array(). + */ + public function pre_create_insert_array($post, $notify_users) + { + if (!sizeof($notify_users) || !$this->inherit_read_status) + { + return array(); + } + + $tracking_data = array(); + $sql = 'SELECT user_id, mark_time FROM ' . TOPICS_TRACK_TABLE . ' + WHERE topic_id = ' . (int) $post['topic_id'] . ' + AND ' . $this->db->sql_in_set('user_id', array_keys($notify_users)); + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $tracking_data[$row['user_id']] = $row['mark_time']; + } + + return $tracking_data; + } + + /** + * 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 + */ + public function create_insert_array($post, $pre_create_data = array()) + { + $this->set_data('poster_id', $post['poster_id']); + + $this->set_data('topic_title', $post['topic_title']); + + $this->set_data('post_subject', $post['post_subject']); + + $this->set_data('post_username', (($post['poster_id'] == ANONYMOUS) ? $post['post_username'] : '')); + + $this->set_data('forum_id', $post['forum_id']); + + $this->set_data('forum_name', $post['forum_name']); + + $this->notification_time = $post['post_time']; + + // Topics can be "read" before they are public (while awaiting approval). + // Make sure that if the user has read the topic, it's marked as read in the notification + if ($this->inherit_read_status && isset($pre_create_data[$this->user_id]) && $pre_create_data[$this->user_id] >= $this->notification_time) + { + $this->notification_read = true; + } + + return parent::create_insert_array($post, $pre_create_data); + } + + /** + * Add responders to the notification + * + * @param mixed $post + */ + public function add_responders($post) + { + // Do not add them as a responder if they were the original poster that created the notification + if ($this->get_data('poster_id') == $post['poster_id']) + { + return array(); + } + + $responders = $this->get_data('responders'); + + $responders = ($responders === null) ? array() : $responders; + + // Do not add more than 25 responders, + // we trim the username list to "a, b, c and x others" anyway + // so there is no use to add all of them anyway. + if (sizeof($responders) > 25) + { + return array(); + } + + foreach ($responders as $responder) + { + // Do not add them as a responder multiple times + if ($responder['poster_id'] == $post['poster_id']) + { + return array(); + } + } + + $responders[] = array( + 'poster_id' => $post['poster_id'], + 'username' => (($post['poster_id'] == ANONYMOUS) ? $post['post_username'] : ''), + ); + + $this->set_data('responders', $responders); + + $serialized_data = serialize($this->get_data(false)); + + // If the data is longer then 4000 characters, it would cause a SQL error. + // We don't add the username to the list if this is the case. + if (utf8_strlen($serialized_data) >= 4000) + { + return array(); + } + + return array('notification_data' => $serialized_data); + } +} diff --git a/sources/phpBB/phpbb/notification/type/post_in_queue.php b/sources/phpBB/phpbb/notification/type/post_in_queue.php new file mode 100644 index 0000000..315b8b0 --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/post_in_queue.php @@ -0,0 +1,160 @@ + +* @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\type; + +/** +* Post in queue notifications class +* This class handles notifications for posts that are put in the moderation queue (for moderators) +*/ + +class post_in_queue extends \phpbb\notification\type\post +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.post_in_queue'; + } + + /** + * Language key used to output the text + * + * @var string + */ + protected $language_key = 'NOTIFICATION_POST_IN_QUEUE'; + + /** + * Notification option data (for outputting to the user) + * + * @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( + 'id' => 'notification.type.needs_approval', + 'lang' => 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE', + 'group' => 'NOTIFICATION_GROUP_MODERATION', + ); + + /** + * Permission to check for (in find_users_for_notification) + * + * @var string Permission name + */ + protected $permission = 'm_approve'; + + /** + * Is available + */ + public function is_available() + { + $has_permission = $this->auth->acl_getf($this->permission, true); + + return (!empty($has_permission)); + } + + /** + * Find the users who want to receive notifications + * + * @param array $post Data from the post + * @param array $options Options for finding users for notification + * + * @return array + */ + public function find_users_for_notification($post, $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + ), $options); + + // 0 is for global moderator permissions + $auth_approve = $this->auth->acl_get_list(false, $this->permission, array($post['forum_id'], 0)); + + if (empty($auth_approve)) + { + return array(); + } + + $has_permission = array(); + + if (isset($auth_approve[$post['forum_id']][$this->permission])) + { + $has_permission = $auth_approve[$post['forum_id']][$this->permission]; + } + + if (isset($auth_approve[0][$this->permission])) + { + $has_permission = array_unique(array_merge($has_permission, $auth_approve[0][$this->permission])); + } + sort($has_permission); + + $auth_read = $this->auth->acl_get_list($has_permission, 'f_read', $post['forum_id']); + if (empty($auth_read)) + { + return array(); + } + + return $this->check_user_notification_options($auth_read[$post['forum_id']]['f_read'], array_merge($options, array( + 'item_type' => self::$notification_option['id'], + ))); + } + + /** + * Get the url to this item + * + * @return string URL + */ + public function get_url() + { + return append_sid($this->phpbb_root_path . 'mcp.' . $this->php_ext, "i=queue&mode=approve_details&f={$this->get_data('forum_id')}&p={$this->item_id}"); + } + + /** + * {inheritDoc} + */ + public function get_redirect_url() + { + return parent::get_url(); + } + + /** + * Function for preparing the data for insertion in an SQL query + * (The service handles insertion) + * + * @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 + */ + 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(); + + return $data; + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return 'post_in_queue'; + } +} diff --git a/sources/phpBB/phpbb/notification/type/quote.php b/sources/phpBB/phpbb/notification/type/quote.php new file mode 100644 index 0000000..508ca92 --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/quote.php @@ -0,0 +1,190 @@ + +* @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\type; + +/** +* Post quoting notifications class +* This class handles notifying users when they have been quoted in a post +*/ + +class quote extends \phpbb\notification\type\post +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.quote'; + } + + /** + * regular expression to match to find usernames + * + * @var string + */ + protected static $regular_expression_match = '#\[quote="(.+?)"#'; + + /** + * Language key used to output the text + * + * @var string + */ + protected $language_key = 'NOTIFICATION_QUOTE'; + + /** + * Notification option data (for outputting to the user) + * + * @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( + 'lang' => 'NOTIFICATION_TYPE_QUOTE', + 'group' => 'NOTIFICATION_GROUP_POSTING', + ); + + /** + * Is available + */ + public function is_available() + { + return true; + } + + /** + * Find the users who want to receive notifications + * + * @param array $post Data from submit_post + * @param array $options Options for finding users for notification + * + * @return array + */ + public function find_users_for_notification($post, $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + ), $options); + + $usernames = false; + preg_match_all(self::$regular_expression_match, $post['post_text'], $usernames); + + if (empty($usernames[1])) + { + return array(); + } + + $usernames[1] = array_unique($usernames[1]); + + $usernames = array_map('utf8_clean_string', $usernames[1]); + + $users = array(); + + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . ' + WHERE ' . $this->db->sql_in_set('username_clean', $usernames) . ' + AND user_id <> ' . (int) $post['poster_id']; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $users[] = (int) $row['user_id']; + } + $this->db->sql_freeresult($result); + + return $this->get_authorised_recipients($users, $post['forum_id'], $options, true); + } + + /** + * Update a notification + * + * @param array $post Data specific for this type that will be updated + */ + 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); + + // Find the new users to notify + $notifications = $this->find_users_for_notification($post); + + // Find the notifications we must delete + $remove_notifications = array_diff($old_notifications, array_keys($notifications)); + + // Find the notifications we must add + $add_notifications = array(); + foreach (array_diff(array_keys($notifications), $old_notifications) as $user_id) + { + $add_notifications[$user_id] = $notifications[$user_id]; + } + + // Add the necessary notifications + $this->notification_manager->add_notifications_for_users($this->get_type(), $post, $add_notifications); + + // 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); + } + + // return true to continue with the update code in the notifications service (this will update the rest of the notifications) + return true; + } + + /** + * {inheritDoc} + */ + public function get_redirect_url() + { + return $this->get_url(); + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return 'quote'; + } + + /** + * Get email template variables + * + * @return array + */ + public function get_email_template_variables() + { + $user_data = $this->user_loader->get_user($this->get_data('poster_id')); + + return array_merge(parent::get_email_template_variables(), array( + 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']), + )); + } +} diff --git a/sources/phpBB/phpbb/notification/type/report_pm.php b/sources/phpBB/phpbb/notification/type/report_pm.php new file mode 100644 index 0000000..d39143f --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/report_pm.php @@ -0,0 +1,257 @@ + +* @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\type; + +/** +* Private message reported notifications class +* This class handles notifications for private messages when they are reported +*/ + +class report_pm extends \phpbb\notification\type\pm +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.report_pm'; + } + + /** + * Get the CSS style class of the notification + * + * @return string + */ + public function get_style_class() + { + return 'notification-reported'; + } + + /** + * Language key used to output the text + * + * @var string + */ + protected $language_key = 'NOTIFICATION_REPORT_PM'; + + /** + * Permission to check for (in find_users_for_notification) + * + * @var string Permission name + */ + protected $permission = 'm_report'; + + /** + * Notification option data (for outputting to the user) + * + * @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( + 'id' => 'notification.type.report', + 'lang' => 'NOTIFICATION_TYPE_REPORT', + 'group' => 'NOTIFICATION_GROUP_MODERATION', + ); + + /** + * Get the id of the parent + * + * @param array $pm The data from the pm + */ + public static function get_item_parent_id($pm) + { + return (int) $pm['report_id']; + } + + /** + * Is this type available to the current user (defines whether or not it will be shown in the UCP Edit notification options) + * + * @return bool True/False whether or not this is available to the user + */ + public function is_available() + { + $m_approve = $this->auth->acl_getf($this->permission, true); + + return (!empty($m_approve)); + } + + + /** + * Find the users who want to receive notifications + * (copied from post_in_queue) + * + * @param array $post Data from the post + * @param array $options Options for finding users for notification + * + * @return array + */ + public function find_users_for_notification($post, $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + ), $options); + + // Global + $post['forum_id'] = 0; + + $auth_approve = $this->auth->acl_get_list(false, $this->permission, $post['forum_id']); + + if (empty($auth_approve)) + { + return array(); + } + + if (($key = array_search($this->user->data['user_id'], $auth_approve[$post['forum_id']][$this->permission]))) + { + unset($auth_approve[$post['forum_id']][$this->permission][$key]); + } + + return $this->check_user_notification_options($auth_approve[$post['forum_id']][$this->permission], array_merge($options, array( + 'item_type' => self::$notification_option['id'], + ))); + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return 'report_pm'; + } + + /** + * Get email template variables + * + * @return array + */ + public function get_email_template_variables() + { + return array( + 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']), + 'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))), + + 'U_VIEW_REPORT' => generate_board_url() . "mcp.{$this->php_ext}?r={$this->item_parent_id}&i=pm_reports&mode=pm_report_details", + ); + } + + /** + * Get the url to this item + * + * @return string URL + */ + public function get_url() + { + return append_sid($this->phpbb_root_path . 'mcp.' . $this->php_ext, "r={$this->item_parent_id}&i=pm_reports&mode=pm_report_details"); + } + + /** + * Get the HTML formatted title of this notification + * + * @return string + */ + public function get_title() + { + $this->user->add_lang('mcp'); + + $username = $this->user_loader->get_username($this->get_data('reporter_id'), 'no_profile'); + + return $this->user->lang( + $this->language_key, + $username + ); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', + censor_text($this->get_data('message_subject')) + ); + } + + /** + * Get the reason for the notification + * + * @return string + */ + public function get_reason() + { + if ($this->get_data('report_text')) + { + return $this->user->lang( + 'NOTIFICATION_REASON', + $this->get_data('report_text') + ); + } + + if (isset($this->user->lang[$this->get_data('reason_title')])) + { + return $this->user->lang( + 'NOTIFICATION_REASON', + $this->user->lang[$this->get_data('reason_title')] + ); + } + + return $this->user->lang( + 'NOTIFICATION_REASON', + $this->get_data('reason_description') + ); + } + + /** + * Get the user's avatar + */ + public function get_avatar() + { + return $this->user_loader->get_avatar($this->get_data('reporter_id')); + } + + /** + * Users needed to query before this notification can be displayed + * + * @return array Array of user_ids + */ + public function users_to_query() + { + return array($this->get_data('reporter_id')); + } + + /** + * 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 + */ + public function create_insert_array($post, $pre_create_data = array()) + { + $this->set_data('reporter_id', $this->user->data['user_id']); + $this->set_data('reason_title', strtoupper($post['reason_title'])); + $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); + } +} diff --git a/sources/phpBB/phpbb/notification/type/report_pm_closed.php b/sources/phpBB/phpbb/notification/type/report_pm_closed.php new file mode 100644 index 0000000..9f301ee --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/report_pm_closed.php @@ -0,0 +1,165 @@ + +* @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\type; + +/** +* PM report closed notifications class +* This class handles notifications for when reports are closed on PMs (for the one who reported the PM) +*/ + +class report_pm_closed extends \phpbb\notification\type\pm +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.report_pm_closed'; + } + + /** + * Email template to use to send notifications + * + * @var string + */ + public $email_template = ''; + + /** + * Language key used to output the text + * + * @var string + */ + protected $language_key = 'NOTIFICATION_REPORT_CLOSED'; + + public function is_available() + { + return false; + } + + /** + * Find the users who want to receive notifications + * + * @param array $pm Data from submit_pm + * @param array $options Options for finding users for notification + * + * @return array + */ + public function find_users_for_notification($pm, $options = array()) + { + if ($pm['reporter'] == $this->user->data['user_id']) + { + return array(); + } + + return array($pm['reporter'] => array('')); + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return false; + } + + /** + * Get email template variables + * + * @return array + */ + public function get_email_template_variables() + { + return array(); + } + + /** + * Get the url to this item + * + * @return string URL + */ + public function get_url() + { + return ''; + } + + /** + * Get the HTML formatted title of this notification + * + * @return string + */ + public function get_title() + { + $username = $this->user_loader->get_username($this->get_data('closer_id'), 'no_profile'); + + return $this->user->lang( + $this->language_key, + $username + ); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', + censor_text($this->get_data('message_subject')) + ); + } + + /** + * Get the user's avatar + */ + public function get_avatar() + { + return $this->user_loader->get_avatar($this->get_data('closer_id')); + } + + /** + * Users needed to query before this notification can be displayed + * + * @return array Array of user_ids + */ + public function users_to_query() + { + return array($this->get_data('closer_id')); + } + + /** + * 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 + */ + 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); + + $this->notification_time = $data['notification_time'] = time(); + + return $data; + } +} diff --git a/sources/phpBB/phpbb/notification/type/report_post.php b/sources/phpBB/phpbb/notification/type/report_post.php new file mode 100644 index 0000000..027cca7 --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/report_post.php @@ -0,0 +1,230 @@ + +* @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\type; + +/** +* Reported post notifications class +* This class handles notifications for reported posts +*/ +class report_post extends \phpbb\notification\type\post_in_queue +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.report_post'; + } + + /** + * Get the CSS style class of the notification + * + * @return string + */ + public function get_style_class() + { + return 'notification-reported'; + } + + /** + * Language key used to output the text + * + * @var string + */ + protected $language_key = 'NOTIFICATION_REPORT_POST'; + + /** + * Inherit notification read status from post. + * + * @var bool + */ + protected $inherit_read_status = false; + + /** + * Permission to check for (in find_users_for_notification) + * + * @var string Permission name + */ + protected $permission = 'm_report'; + + /** + * Notification option data (for outputting to the user) + * + * @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( + 'id' => 'notification.type.report', + 'lang' => 'NOTIFICATION_TYPE_REPORT', + 'group' => 'NOTIFICATION_GROUP_MODERATION', + ); + + /** + * Find the users who want to receive notifications + * + * @param array $post Data from the post + * @param array $options Options for finding users for notification + * + * @return array + */ + public function find_users_for_notification($post, $options = array()) + { + $notify_users = parent::find_users_for_notification($post, $options); + + // never notify reporter + unset($notify_users[$this->user->data['user_id']]); + + return $notify_users; + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return 'report_post'; + } + + /** + * Get email template variables + * + * @return array + */ + public function get_email_template_variables() + { + $board_url = generate_board_url(); + + return array( + 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject'))), + 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))), + + 'U_VIEW_REPORT' => "{$board_url}/mcp.{$this->php_ext}?f={$this->get_data('forum_id')}&p={$this->item_id}&i=reports&mode=report_details#reports", + 'U_VIEW_POST' => "{$board_url}/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}", + 'U_NEWEST_POST' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&view=unread#unread", + 'U_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}", + 'U_VIEW_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}", + 'U_FORUM' => "{$board_url}/viewforum.{$this->php_ext}?f={$this->get_data('forum_id')}", + ); + } + + /** + * Get the url to this item + * + * @return string URL + */ + public function get_url() + { + return append_sid($this->phpbb_root_path . 'mcp.' . $this->php_ext, "f={$this->get_data('forum_id')}&p={$this->item_id}&i=reports&mode=report_details#reports"); + } + + /** + * Get the HTML formatted title of this notification + * + * @return string + */ + public function get_title() + { + $this->user->add_lang('mcp'); + + $username = $this->user_loader->get_username($this->get_data('reporter_id'), 'no_profile'); + + return $this->user->lang( + $this->language_key, + $username + ); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', + censor_text($this->get_data('post_subject')) + ); + } + + /** + * Get the reason for the notification + * + * @return string + */ + public function get_reason() + { + if ($this->get_data('report_text')) + { + return $this->user->lang( + 'NOTIFICATION_REASON', + $this->get_data('report_text') + ); + } + + if (isset($this->user->lang[$this->get_data('reason_title')])) + { + return $this->user->lang( + 'NOTIFICATION_REASON', + $this->user->lang[$this->get_data('reason_title')] + ); + } + + return $this->user->lang( + 'NOTIFICATION_REASON', + $this->get_data('reason_description') + ); + } + + /** + * Get the user's avatar + */ + public function get_avatar() + { + return $this->user_loader->get_avatar($this->get_data('reporter_id')); + } + + /** + * Users needed to query before this notification can be displayed + * + * @return array Array of user_ids + */ + public function users_to_query() + { + return array($this->get_data('reporter_id')); + } + + /** + * 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 + */ + public function create_insert_array($post, $pre_create_data = array()) + { + $this->set_data('reporter_id', $this->user->data['user_id']); + $this->set_data('reason_title', strtoupper($post['reason_title'])); + $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); + } +} diff --git a/sources/phpBB/phpbb/notification/type/report_post_closed.php b/sources/phpBB/phpbb/notification/type/report_post_closed.php new file mode 100644 index 0000000..a0bb187 --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/report_post_closed.php @@ -0,0 +1,172 @@ + +* @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\type; + +/** +* Post report closed notifications class +* This class handles notifications for when reports are closed on posts (for the one who reported the post) +*/ + +class report_post_closed extends \phpbb\notification\type\post +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.report_post_closed'; + } + + /** + * Email template to use to send notifications + * + * @var string + */ + public $email_template = ''; + + /** + * Language key used to output the text + * + * @var string + */ + protected $language_key = 'NOTIFICATION_REPORT_CLOSED'; + + /** + * Inherit notification read status from post. + * + * @var bool + */ + protected $inherit_read_status = false; + + public function is_available() + { + return false; + } + + /** + * Find the users who want to receive notifications + * + * @param array $post Data from submit_post + * @param array $options Options for finding users for notification + * + * @return array + */ + public function find_users_for_notification($post, $options = array()) + { + if ($post['reporter'] == $this->user->data['user_id']) + { + return array(); + } + + return array($post['reporter'] => array('')); + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return false; + } + + /** + * Get email template variables + * + * @return array + */ + public function get_email_template_variables() + { + return array(); + } + + /** + * Get the url to this item + * + * @return string URL + */ + public function get_url() + { + return ''; + } + + /** + * Get the HTML formatted title of this notification + * + * @return string + */ + public function get_title() + { + $username = $this->user_loader->get_username($this->get_data('closer_id'), 'no_profile'); + + return $this->user->lang( + $this->language_key, + $username + ); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', + censor_text($this->get_data('post_subject')) + ); + } + + /** + * Get the user's avatar + */ + public function get_avatar() + { + return $this->user_loader->get_avatar($this->get_data('closer_id')); + } + + /** + * Users needed to query before this notification can be displayed + * + * @return array Array of user_ids + */ + public function users_to_query() + { + return array($this->get_data('closer_id')); + } + + /** + * 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 + */ + 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); + + $this->notification_time = $data['notification_time'] = time(); + + return $data; + } +} diff --git a/sources/phpBB/phpbb/notification/type/topic.php b/sources/phpBB/phpbb/notification/type/topic.php new file mode 100644 index 0000000..cf0ec77 --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/topic.php @@ -0,0 +1,294 @@ + +* @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\type; + +/** +* Topic notifications class +* This class handles notifications for new topics +*/ + +class topic extends \phpbb\notification\type\base +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.topic'; + } + + /** + * Language key used to output the text + * + * @var string + */ + protected $language_key = 'NOTIFICATION_TOPIC'; + + /** + * Inherit notification read status from topic. + * + * @var bool + */ + protected $inherit_read_status = true; + + /** + * Notification option data (for outputting to the user) + * + * @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( + 'lang' => 'NOTIFICATION_TYPE_TOPIC', + 'group' => 'NOTIFICATION_GROUP_POSTING', + ); + + /** + * Is available + */ + public function is_available() + { + return $this->config['allow_forum_notify']; + } + + /** + * Get the id of the item + * + * @param array $post The data from the post + */ + public static function get_item_id($post) + { + return (int) $post['topic_id']; + } + + /** + * Get the id of the parent + * + * @param array $post The data from the post + */ + public static function get_item_parent_id($post) + { + return (int) $post['forum_id']; + } + + /** + * Find the users who want to receive notifications + * + * @param array $topic Data from the topic + * @param array $options Options for finding users for notification + * + * @return array + */ + public function find_users_for_notification($topic, $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + ), $options); + + $users = array(); + + $sql = 'SELECT user_id + FROM ' . FORUMS_WATCH_TABLE . ' + WHERE forum_id = ' . (int) $topic['forum_id'] . ' + AND notify_status = ' . NOTIFY_YES . ' + AND user_id <> ' . (int) $topic['poster_id']; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $users[] = (int) $row['user_id']; + } + $this->db->sql_freeresult($result); + + return $this->get_authorised_recipients($users, $topic['forum_id'], $options); + } + + /** + * Get the user's avatar + */ + public function get_avatar() + { + return $this->user_loader->get_avatar($this->get_data('poster_id')); + } + + /** + * Get the HTML formatted title of this notification + * + * @return string + */ + public function get_title() + { + if ($this->get_data('post_username')) + { + $username = $this->get_data('post_username'); + } + else + { + $username = $this->user_loader->get_username($this->get_data('poster_id'), 'no_profile'); + } + + return $this->user->lang( + $this->language_key, + $username + ); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', + censor_text($this->get_data('topic_title')) + ); + } + + /** + * Get the forum of the notification reference + * + * @return string + */ + public function get_forum() + { + return $this->user->lang( + 'NOTIFICATION_FORUM', + $this->get_data('forum_name') + ); + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return 'newtopic_notify'; + } + + /** + * Get email template variables + * + * @return array + */ + public function get_email_template_variables() + { + $board_url = generate_board_url(); + + if ($this->get_data('post_username')) + { + $username = $this->get_data('post_username'); + } + else + { + $username = $this->user_loader->get_username($this->get_data('poster_id'), 'username'); + } + + return array( + 'AUTHOR_NAME' => htmlspecialchars_decode($username), + 'FORUM_NAME' => htmlspecialchars_decode($this->get_data('forum_name')), + 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))), + + 'U_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->item_parent_id}&t={$this->item_id}", + 'U_VIEW_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->item_parent_id}&t={$this->item_id}", + 'U_FORUM' => "{$board_url}/viewforum.{$this->php_ext}?f={$this->item_parent_id}", + 'U_STOP_WATCHING_FORUM' => "{$board_url}/viewforum.{$this->php_ext}?uid={$this->user_id}&f={$this->item_parent_id}&unwatch=forum", + ); + } + + /** + * Get the url to this item + * + * @return string URL + */ + public function get_url() + { + return append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "f={$this->item_parent_id}&t={$this->item_id}"); + } + + /** + * Users needed to query before this notification can be displayed + * + * @return array Array of user_ids + */ + public function users_to_query() + { + return array($this->get_data('poster_id')); + } + + /** + * Pre create insert array function + * This allows you to perform certain actions, like run a query + * and load data, before create_insert_array() is run. The data + * returned from this function will be sent to create_insert_array(). + * + * @param array $post Post data from submit_post + * @param array $notify_users Notify users list + * Formated from find_users_for_notification() + * @return array Whatever you want to send to create_insert_array(). + */ + public function pre_create_insert_array($post, $notify_users) + { + if (!sizeof($notify_users) || !$this->inherit_read_status) + { + return array(); + } + + $tracking_data = array(); + $sql = 'SELECT user_id, mark_time FROM ' . TOPICS_TRACK_TABLE . ' + WHERE topic_id = ' . (int) $post['topic_id'] . ' + AND ' . $this->db->sql_in_set('user_id', array_keys($notify_users)); + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + $tracking_data[$row['user_id']] = $row['mark_time']; + } + + return $tracking_data; + } + + /** + * 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 + */ + public function create_insert_array($post, $pre_create_data = array()) + { + $this->set_data('poster_id', $post['poster_id']); + + $this->set_data('topic_title', $post['topic_title']); + + $this->set_data('post_username', (($post['poster_id'] == ANONYMOUS) ? $post['post_username'] : '')); + + $this->set_data('forum_name', $post['forum_name']); + + $this->notification_time = $post['post_time']; + + // Topics can be "read" before they are public (while awaiting approval). + // Make sure that if the user has read the topic, it's marked as read in the notification + if ($this->inherit_read_status && isset($pre_create_data[$this->user_id]) && $pre_create_data[$this->user_id] >= $this->notification_time) + { + $this->notification_read = true; + } + + return parent::create_insert_array($post, $pre_create_data); + } +} diff --git a/sources/phpBB/phpbb/notification/type/topic_in_queue.php b/sources/phpBB/phpbb/notification/type/topic_in_queue.php new file mode 100644 index 0000000..4c60c6b --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/topic_in_queue.php @@ -0,0 +1,152 @@ + +* @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\type; + +/** +* Topic in queue notifications class +* This class handles notifications for topics when they are put in the moderation queue (for moderators) +*/ + +class topic_in_queue extends \phpbb\notification\type\topic +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type() + { + return 'notification.type.topic_in_queue'; + } + + /** + * Language key used to output the text + * + * @var string + */ + protected $language_key = 'NOTIFICATION_TOPIC_IN_QUEUE'; + + /** + * Notification option data (for outputting to the user) + * + * @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( + 'id' => 'notification.type.needs_approval', + 'lang' => 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE', + 'group' => 'NOTIFICATION_GROUP_MODERATION', + ); + + /** + * Permission to check for (in find_users_for_notification) + * + * @var string Permission name + */ + protected $permission = 'm_approve'; + + /** + * Is available + */ + public function is_available() + { + $has_permission = $this->auth->acl_getf($this->permission, true); + + return (!empty($has_permission)); + } + + /** + * Find the users who want to receive notifications + * + * @param array $topic Data from the topic + * @param array $options Options for finding users for notification + * + * @return array + */ + public function find_users_for_notification($topic, $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + ), $options); + + // 0 is for global moderator permissions + $auth_approve = $this->auth->acl_get_list(false, 'm_approve', array($topic['forum_id'], 0)); + + if (empty($auth_approve)) + { + return array(); + } + + $has_permission = array(); + + if (isset($auth_approve[$topic['forum_id']][$this->permission])) + { + $has_permission = $auth_approve[$topic['forum_id']][$this->permission]; + } + + if (isset($auth_approve[0][$this->permission])) + { + $has_permission = array_unique(array_merge($has_permission, $auth_approve[0][$this->permission])); + } + sort($has_permission); + + $auth_read = $this->auth->acl_get_list($has_permission, 'f_read', $topic['forum_id']); + if (empty($auth_read)) + { + return array(); + } + + return $this->check_user_notification_options($auth_read[$topic['forum_id']]['f_read'], array_merge($options, array( + 'item_type' => self::$notification_option['id'], + ))); + } + + /** + * Get the url to this item + * + * @return string URL + */ + public function get_url() + { + return append_sid($this->phpbb_root_path . 'mcp.' . $this->php_ext, "i=queue&mode=approve_details&f={$this->item_parent_id}&t={$this->item_id}"); + } + + /** + * 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 + */ + public function create_insert_array($topic, $pre_create_data = array()) + { + $data = parent::create_insert_array($topic, $pre_create_data); + + $this->notification_time = $data['notification_time'] = time(); + + return $data; + } + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template() + { + return 'topic_in_queue'; + } +} diff --git a/sources/phpBB/phpbb/notification/type/type_interface.php b/sources/phpBB/phpbb/notification/type/type_interface.php new file mode 100644 index 0000000..5c5a110 --- /dev/null +++ b/sources/phpBB/phpbb/notification/type/type_interface.php @@ -0,0 +1,214 @@ + +* @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\type; + +/** +* Base notifications interface +*/ +interface type_interface +{ + /** + * Get notification type name + * + * @return string + */ + public function get_type(); + + /** + * Set initial data from the database + * + * @param array $data Row directly from the database + */ + public function set_initial_data($data); + + /** + * Get the id of the item + * + * @param array $type_data The type specific data + */ + public static 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); + + /** + * Is this type available to the current user (defines whether or not it will be shown in the UCP Edit notification options) + * + * @return bool True/False whether or not this is available to the user + */ + public function is_available(); + + /** + * Find the users who want to receive notifications + * + * @param array $type_data The type specific data + * @param array $options Options for finding users for notification + * ignore_users => array of users and user types that should not receive notifications from this type because they've already been notified + * e.g.: array(2 => array(''), 3 => array('', 'email'), ...) + * + * @return array + */ + public function find_users_for_notification($type_data, $options); + + /** + * Users needed to query before this notification can be displayed + * + * @return array Array of user_ids + */ + public function users_to_query(); + + /** + * Get the special items to load + * + * @return array Data will be combined sent to load_special() so you can run a single query and get data required for this notification type + */ + public function get_load_special(); + + /** + * Load the special items + * + * @param array $data Data from get_load_special() + * @param array $notifications Array of notifications (key is notification_id, value is the notification objects) + */ + public function load_special($data, $notifications); + + /** + * Get the CSS style class of the notification + * + * @return string + */ + public function get_style_class(); + + /** + * Get the HTML formatted title of this notification + * + * @return string + */ + public function get_title(); + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference(); + + /** + * Get the forum of the notification reference + * + * @return string + */ + public function get_forum(); + + /** + * Get the url to this item + * + * @return string URL + */ + public function get_url(); + + /** + * Get the url to redirect after the item has been marked as read + * + * @return string URL + */ + public function get_redirect_url(); + + /** + * URL to unsubscribe to this notification + * + * @param string|bool $method Method name to unsubscribe from (email|jabber|etc), False to unsubscribe from all notifications for this item + */ + public function get_unsubscribe_url($method); + + /** + * Get the user's avatar (the user who caused the notification typically) + * + * @return string + */ + public function get_avatar(); + + /** + * Prepare to output the notification to the template + */ + public function prepare_for_display(); + + /** + * Get email template + * + * @return string|bool + */ + public function get_email_template(); + + /** + * Get email template variables + * + * @return array + */ + public function get_email_template_variables(); + + /** + * Pre create insert array function + * This allows you to perform certain actions, like run a query + * and load data, before create_insert_array() is run. The data + * returned from this function will be sent to create_insert_array(). + * + * @param array $type_data The type specific data + * @param array $notify_users Notify users list + * Formated from find_users_for_notification() + * @return array Whatever you want to send to create_insert_array(). + */ + public function pre_create_insert_array($type_data, $notify_users); + + /** + * 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() + * + * @return array Array of data ready to be inserted into the database + */ + public function create_insert_array($type_data, $pre_create_data); + + /** + * Function for preparing the data for update in an SQL query + * (The service handles insertion) + * + * @param array $type_data Data unique to this notification type + * + * @return array Array of data ready to be updated in the database + */ + public function create_update_array($type_data); + + /** + * Mark this item read + * + * @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); + + /** + * Mark this item unread + * + * @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); +} diff --git a/sources/phpBB/phpbb/pagination.php b/sources/phpBB/phpbb/pagination.php new file mode 100644 index 0000000..7a81c25 --- /dev/null +++ b/sources/phpBB/phpbb/pagination.php @@ -0,0 +1,357 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb; + +class pagination +{ + /** @var \phpbb\template\template */ + protected $template; + + /** @var \phpbb\user */ + protected $user; + + /** @var \phpbb\controller\helper */ + protected $helper; + + /** @var \phpbb\event\dispatcher_interface */ + protected $phpbb_dispatcher; + + /** + * Constructor + * + * @param \phpbb\template\template $template + * @param \phpbb\user $user + * @param \phpbb\controller\helper $helper + * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher + */ + public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\event\dispatcher_interface $phpbb_dispatcher) + { + $this->template = $template; + $this->user = $user; + $this->helper = $helper; + $this->phpbb_dispatcher = $phpbb_dispatcher; + } + + /** + * Generate a pagination link based on the url and the page information + * + * @param string $base_url is url prepended to all links generated within the function + * If you use page numbers inside your controller route, base_url should contains a placeholder (%d) + * for the page. Also be sure to specify the pagination path information into the start_name argument + * @param string $on_page is the page for which we want to generate the link + * @param string $start_name is the name of the parameter containing the first item of the given page (example: start=20) + * If you use page numbers inside your controller route, start name should be the string + * that should be removed for the first page (example: /page/%d) + * @param int $per_page the number of items, posts, etc. to display per page, used to determine the number of pages to produce + * @return string URL for the requested page + */ + protected function generate_page_link($base_url, $on_page, $start_name, $per_page) + { + // A listener can set this variable to the new pagination URL + // to override the generate_page_link() function generated value + $generate_page_link_override = false; + + /** + * Execute code and/or override generate_page_link() + * + * To override the generate_page_link() function generated value + * set $generate_page_link_override to the new URL value + * + * @event core.pagination_generate_page_link + * @var string base_url is url prepended to all links generated within the function + * If you use page numbers inside your controller route, base_url should contains a placeholder (%d) + * for the page. Also be sure to specify the pagination path information into the start_name argument + * @var string on_page is the page for which we want to generate the link + * @var string start_name is the name of the parameter containing the first item of the given page (example: start=20) + * If you use page numbers inside your controller route, start name should be the string + * that should be removed for the first page (example: /page/%d) + * @var int per_page the number of items, posts, etc. to display per page, used to determine the number of pages to produce + * @var bool|string generate_page_link_override Shall we return custom pagination link (string URL) or not (false) + * @since 3.1.0-RC5 + */ + $vars = array('base_url', 'on_page', 'start_name', 'per_page', 'generate_page_link_override'); + extract($this->phpbb_dispatcher->trigger_event('core.pagination_generate_page_link', compact($vars))); + + if ($generate_page_link_override) + { + return $generate_page_link_override; + } + + if (!is_string($base_url)) + { + if (is_array($base_url['routes'])) + { + $route = ($on_page > 1) ? $base_url['routes'][1] : $base_url['routes'][0]; + } + else + { + $route = $base_url['routes']; + } + $params = (isset($base_url['params'])) ? $base_url['params'] : array(); + $is_amp = (isset($base_url['is_amp'])) ? $base_url['is_amp'] : true; + $session_id = (isset($base_url['session_id'])) ? $base_url['session_id'] : false; + + if ($on_page > 1 || !is_array($base_url['routes'])) + { + $params[$start_name] = (int) $on_page; + } + + return $this->helper->route($route, $params, $is_amp, $session_id); + } + else + { + $url_delim = (strpos($base_url, '?') === false) ? '?' : ((strpos($base_url, '?') === strlen($base_url) - 1) ? '' : '&'); + return ($on_page > 1) ? $base_url . $url_delim . $start_name . '=' . (($on_page - 1) * $per_page) : $base_url; + } + } + + /** + * Generate template rendered pagination + * Allows full control of rendering of pagination with the template + * + * @param string $base_url is url prepended to all links generated within the function + * If you use page numbers inside your controller route, base_url should contains a placeholder (%d) + * for the page. Also be sure to specify the pagination path information into the start_name argument + * @param string $block_var_name is the name assigned to the pagination data block within the template (example: ) + * @param string $start_name is the name of the parameter containing the first item of the given page (example: start=20) + * If you use page numbers inside your controller route, start name should be the string + * that should be removed for the first page (example: /page/%d) + * @param int $num_items the total number of items, posts, etc., used to determine the number of pages to produce + * @param int $per_page the number of items, posts, etc. to display per page, used to determine the number of pages to produce + * @param int $start the item which should be considered currently active, used to determine the page we're on + * @param bool $reverse_count determines whether we weight display of the list towards the start (false) or end (true) of the list + * @param bool $ignore_on_page decides whether we enable an active (unlinked) item, used primarily for embedded lists + * @return null + */ + public function generate_template_pagination($base_url, $block_var_name, $start_name, $num_items, $per_page, $start = 1, $reverse_count = false, $ignore_on_page = false) + { + $total_pages = ceil($num_items / $per_page); + $on_page = $this->get_on_page($per_page, $start); + $u_previous_page = $u_next_page = ''; + + if ($total_pages > 1) + { + if ($reverse_count) + { + $start_page = ($total_pages > 5) ? $total_pages - 4 : 1; + $end_page = $total_pages; + } + else + { + // What we're doing here is calculating what the "start" and "end" pages should be. We + // do this by assuming pagination is "centered" around the currently active page with + // the three previous and three next page links displayed. Anything more than that and + // we display the ellipsis, likewise anything less. + // + // $start_page is the page at which we start creating the list. When we have five or less + // pages we start at page 1 since there will be no ellipsis displayed. Anymore than that + // and we calculate the start based on the active page. This is the min/max calculation. + // First (max) would we end up starting on a page less than 1? Next (min) would we end + // up starting so close to the end that we'd not display our minimum number of pages. + // + // $end_page is the last page in the list to display. Like $start_page we use a min/max to + // determine this number. Again at most five pages? Then just display them all. More than + // five and we first (min) determine whether we'd end up listing more pages than exist. + // We then (max) ensure we're displaying the minimum number of pages. + $start_page = ($total_pages > 5) ? min(max(1, $on_page - 2), $total_pages - 4) : 1; + $end_page = ($total_pages > 5) ? max(min($total_pages, $on_page + 2), 5) : $total_pages; + } + + if ($on_page != 1) + { + $u_previous_page = $this->generate_page_link($base_url, $on_page - 1, $start_name, $per_page); + + $this->template->assign_block_vars($block_var_name, array( + 'PAGE_NUMBER' => '', + 'PAGE_URL' => $u_previous_page, + 'S_IS_CURRENT' => false, + 'S_IS_PREV' => true, + 'S_IS_NEXT' => false, + 'S_IS_ELLIPSIS' => false, + )); + } + + // This do...while exists purely to negate the need for start and end assign_block_vars, i.e. + // to display the first and last page in the list plus any ellipsis. We use this loop to jump + // around a little within the list depending on where we're starting (and ending). + $at_page = 1; + do + { + // We decide whether to display the ellipsis during the loop. The ellipsis is always + // displayed as either the second or penultimate item in the list. So are we at either + // of those points and of course do we even need to display it, i.e. is the list starting + // on at least page 3 and ending three pages before the final item. + $this->template->assign_block_vars($block_var_name, array( + 'PAGE_NUMBER' => $at_page, + 'PAGE_URL' => $this->generate_page_link($base_url, $at_page, $start_name, $per_page), + 'S_IS_CURRENT' => (!$ignore_on_page && $at_page == $on_page), + 'S_IS_NEXT' => false, + 'S_IS_PREV' => false, + 'S_IS_ELLIPSIS' => ($at_page == 2 && $start_page > 2) || ($at_page == $total_pages - 1 && $end_page < $total_pages - 1), + )); + + // We may need to jump around in the list depending on whether we have or need to display + // the ellipsis. Are we on page 2 and are we more than one page away from the start + // of the list? Yes? Then we jump to the start of the list. Likewise are we at the end of + // the list and are there more than two pages left in total? Yes? Then jump to the penultimate + // page (so we can display the ellipsis next pass). Else, increment the counter and keep + // going + if ($at_page == 2 && $at_page < $start_page - 1) + { + $at_page = $start_page; + } + else if ($at_page == $end_page && $end_page < $total_pages - 1) + { + $at_page = $total_pages - 1; + } + else + { + $at_page++; + } + } + while ($at_page <= $total_pages); + + if ($on_page != $total_pages) + { + $u_next_page = $this->generate_page_link($base_url, $on_page + 1, $start_name, $per_page); + + $this->template->assign_block_vars($block_var_name, array( + 'PAGE_NUMBER' => '', + 'PAGE_URL' => $u_next_page, + 'S_IS_CURRENT' => false, + 'S_IS_PREV' => false, + 'S_IS_NEXT' => true, + 'S_IS_ELLIPSIS' => false, + )); + } + } + + // If the block_var_name is a nested block, we will use the last (most + // inner) block as a prefix for the template variables. If the last block + // name is pagination, the prefix is empty. If the rest of the + // block_var_name is not empty, we will modify the last row of that block + // and add our pagination items. + $tpl_block_name = $tpl_prefix = ''; + if (strrpos($block_var_name, '.') !== false) + { + $tpl_block_name = substr($block_var_name, 0, strrpos($block_var_name, '.')); + $tpl_prefix = strtoupper(substr($block_var_name, strrpos($block_var_name, '.') + 1)); + } + else + { + $tpl_prefix = strtoupper($block_var_name); + } + $tpl_prefix = ($tpl_prefix == 'PAGINATION') ? '' : $tpl_prefix . '_'; + + $template_array = array( + $tpl_prefix . 'BASE_URL' => is_string($base_url) ? $base_url : '',//@todo: Fix this for routes + $tpl_prefix . 'START_NAME' => $start_name, + $tpl_prefix . 'PER_PAGE' => $per_page, + 'U_' . $tpl_prefix . 'PREVIOUS_PAGE' => ($on_page != 1) ? $u_previous_page : '', + 'U_' . $tpl_prefix . 'NEXT_PAGE' => ($on_page != $total_pages) ? $u_next_page : '', + $tpl_prefix . 'TOTAL_PAGES' => $total_pages, + $tpl_prefix . 'CURRENT_PAGE' => $on_page, + $tpl_prefix . 'PAGE_NUMBER' => $this->on_page($num_items, $per_page, $start), + ); + + if ($tpl_block_name) + { + $this->template->alter_block_array($tpl_block_name, $template_array, true, 'change'); + } + else + { + $this->template->assign_vars($template_array); + } + } + + /** + * Get current page number + * + * @param int $per_page the number of items, posts, etc. per page + * @param int $start the item which should be considered currently active, used to determine the page we're on + * @return int Current page number + */ + public function get_on_page($per_page, $start) + { + return floor($start / $per_page) + 1; + } + + /** + * Return current page + * + * @param int $num_items the total number of items, posts, topics, etc. + * @param int $per_page the number of items, posts, etc. per page + * @param int $start the item which should be considered currently active, used to determine the page we're on + * @return string Descriptive pagination string (e.g. "page 1 of 10") + */ + public function on_page($num_items, $per_page, $start) + { + $on_page = $this->get_on_page($per_page, $start); + return $this->user->lang('PAGE_OF', $on_page, max(ceil($num_items / $per_page), 1)); + } + + /** + * Get current page number + * + * @param int $start the item which should be considered currently active, used to determine the page we're on + * @param int $per_page the number of items, posts, etc. per page + * @param int $num_items the total number of items, posts, topics, etc. + * @return int Current page number + */ + public function validate_start($start, $per_page, $num_items) + { + if ($start < 0 || $start >= $num_items) + { + return ($start < 0 || $num_items <= 0) ? 0 : floor(($num_items - 1) / $per_page) * $per_page; + } + + return $start; + } + + /** + * Get new start when searching from the end + * + * If the user is trying to reach late pages, start searching from the end. + * + * @param int $start the item which should be considered currently active, used to determine the page we're on + * @param int $limit the number of items, posts, etc. to display + * @param int $num_items the total number of items, posts, topics, etc. + * @return int Current page number + */ + public function reverse_start($start, $limit, $num_items) + { + return max(0, $num_items - $limit - $start); + } + + /** + * Get new item limit when searching from the end + * + * If the user is trying to reach late pages, start searching from the end. + * In this case the items to display might be lower then the actual per_page setting. + * + * @param int $start the item which should be considered currently active, used to determine the page we're on + * @param int $per_page the number of items, posts, etc. per page + * @param int $num_items the total number of items, posts, topics, etc. + * @return int Current page number + */ + public function reverse_limit($start, $per_page, $num_items) + { + if ($start + $per_page > $num_items) + { + return min($per_page, max(1, $num_items - $start)); + } + + return $per_page; + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/base.php b/sources/phpBB/phpbb/passwords/driver/base.php new file mode 100644 index 0000000..fd07a61 --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/base.php @@ -0,0 +1,62 @@ + +* @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\passwords\driver; + +abstract class base implements driver_interface +{ + /** @var \phpbb\config\config */ + protected $config; + + /** @var \phpbb\passwords\driver\helper */ + protected $helper; + + /** @var driver name */ + protected $name; + + /** + * Constructor of passwords driver object + * + * @param \phpbb\config\config $config phpBB config + * @param \phpbb\passwords\driver\helper $helper Password driver helper + */ + public function __construct(\phpbb\config\config $config, helper $helper) + { + $this->config = $config; + $this->helper = $helper; + } + + /** + * {@inheritdoc} + */ + public function is_supported() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function is_legacy() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function get_settings_only($hash, $full = false) + { + return false; + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/bcrypt.php b/sources/phpBB/phpbb/passwords/driver/bcrypt.php new file mode 100644 index 0000000..eab1c3d --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/bcrypt.php @@ -0,0 +1,105 @@ + +* @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\passwords\driver; + +class bcrypt extends base +{ + const PREFIX = '$2a$'; + + /** + * {@inheritdoc} + */ + public function get_prefix() + { + return self::PREFIX; + } + + /** + * {@inheritdoc} + */ + public function hash($password, $salt = '') + { + // The 2x and 2y prefixes of bcrypt might not be supported + // Revert to 2a if this is the case + $prefix = (!$this->is_supported()) ? '$2a$' : $this->get_prefix(); + + // Do not support 8-bit characters with $2a$ bcrypt + // Also see http://www.php.net/security/crypt_blowfish.php + if ($prefix === self::PREFIX) + { + if (ord($password[strlen($password)-1]) & 128) + { + return false; + } + } + + if ($salt == '') + { + $salt = $prefix . '10$' . $this->get_random_salt(); + } + + $hash = crypt($password, $salt); + if (strlen($hash) < 60) + { + return false; + } + return $hash; + } + + /** + * {@inheritdoc} + */ + public function check($password, $hash, $user_row = array()) + { + $salt = substr($hash, 0, 29); + if (strlen($salt) != 29) + { + return false; + } + + if ($this->helper->string_compare($hash, $this->hash($password, $salt))) + { + return true; + } + return false; + } + + /** + * Get a random salt value with a length of 22 characters + * + * @return string Salt for password hashing + */ + protected function get_random_salt() + { + return $this->helper->hash_encode64($this->helper->get_random_salt(22), 22); + } + + /** + * {@inheritdoc} + */ + public function get_settings_only($hash, $full = false) + { + if ($full) + { + $pos = stripos($hash, '$', 1) + 1; + $length = 22 + (strripos($hash, '$') + 1 - $pos); + } + else + { + $pos = strripos($hash, '$') + 1; + $length = 22; + } + return substr($hash, $pos, $length); + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/bcrypt_2y.php b/sources/phpBB/phpbb/passwords/driver/bcrypt_2y.php new file mode 100644 index 0000000..c710e0d --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/bcrypt_2y.php @@ -0,0 +1,35 @@ + +* @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\passwords\driver; + +class bcrypt_2y extends bcrypt +{ + const PREFIX = '$2y$'; + + /** + * {@inheritdoc} + */ + public function get_prefix() + { + return self::PREFIX; + } + + /** + * {@inheritdoc} + */ + public function is_supported() + { + return (version_compare(PHP_VERSION, '5.3.7', '<')) ? false : true; + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php b/sources/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php new file mode 100644 index 0000000..0eee98d --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php @@ -0,0 +1,84 @@ + +* @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\passwords\driver; + +class bcrypt_wcf2 extends base +{ + const PREFIX = '$wcf2$'; + + /** @var \phpbb\passwords\driver\bcrypt */ + protected $bcrypt; + + /** @var \phpbb\passwords\driver\helper */ + protected $helper; + + /** + * Constructor of passwords driver object + * + * @param \phpbb\passwords\driver\bcrypt $bcrypt Salted md5 driver + * @param \phpbb\passwords\driver\helper $helper Password driver helper + */ + public function __construct(\phpbb\passwords\driver\bcrypt $bcrypt, helper $helper) + { + $this->bcrypt = $bcrypt; + $this->helper = $helper; + } + + /** + * {@inheritdoc} + */ + public function get_prefix() + { + return self::PREFIX; + } + + /** + * {@inheritdoc} + */ + public function is_legacy() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function hash($password, $user_row = '') + { + // Do not support hashing + return false; + } + + /** + * {@inheritdoc} + */ + public function check($password, $hash, $user_row = array()) + { + if (empty($hash) || strlen($hash) != 60) + { + return false; + } + else + { + $salt = substr($hash, 0, 29); + + if (strlen($salt) != 29) + { + return false; + } + // Works for standard WCF 2.x, i.e. WBB4 and similar + return $this->helper->string_compare($hash, $this->bcrypt->hash($this->bcrypt->hash($password, $salt), $salt)); + } + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/convert_password.php b/sources/phpBB/phpbb/passwords/driver/convert_password.php new file mode 100644 index 0000000..eb70434 --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/convert_password.php @@ -0,0 +1,43 @@ + +* @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\passwords\driver; + +class convert_password extends base +{ + const PREFIX = '$CP$'; + + /** + * {@inheritdoc} + */ + public function get_prefix() + { + return self::PREFIX; + } + + /** + * {@inheritdoc} + */ + public function hash($password, $user_row = '') + { + return false; + } + + /** + * {@inheritdoc} + */ + public function check($password, $hash, $user_row = array()) + { + return false; + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/driver_interface.php b/sources/phpBB/phpbb/passwords/driver/driver_interface.php new file mode 100644 index 0000000..3974484 --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/driver_interface.php @@ -0,0 +1,69 @@ + +* @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\passwords\driver; + +interface driver_interface +{ + /** + * Check if hash type is supported + * + * @return bool True if supported, false if not + */ + public function is_supported(); + + /** + * Check if hash type is a legacy hash type + * + * @return bool True if it's a legacy hash type, false if not + */ + public function is_legacy(); + + /** + * Returns the hash prefix + * + * @return string Hash prefix + */ + public function get_prefix(); + + /** + * Hash the password + * + * @param string $password The password that should be hashed + * + * @return bool|string Password hash or false if something went wrong + * during hashing + */ + public function hash($password); + + /** + * Check the password against the supplied hash + * + * @param string $password The password to check + * @param string $hash The password hash to check against + * @param array $user_row User's row in users table + * + * @return bool True if password is correct, else false + */ + public function check($password, $hash, $user_row = array()); + + /** + * Get only the settings of the specified hash + * + * @param string $hash Password hash + * @param bool $full Return full settings or only settings + * related to the salt + * @return string String containing the hash settings + */ + public function get_settings_only($hash, $full = false); +} diff --git a/sources/phpBB/phpbb/passwords/driver/helper.php b/sources/phpBB/phpbb/passwords/driver/helper.php new file mode 100644 index 0000000..caa6508 --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/helper.php @@ -0,0 +1,165 @@ + +* @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\passwords\driver; + +class helper +{ + /** + * @var \phpbb\config\config + */ + protected $config; + + /** + * base64 alphabet + * @var string + */ + public $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; + + /** + * Construct a driver helper object + * + * @param \phpbb\config\config $config phpBB configuration + */ + public function __construct(\phpbb\config\config $config) + { + $this->config = $config; + } + + /** + * Base64 encode hash + * + * @param string $input Input string + * @param int $count Input string length + * + * @return string base64 encoded string + */ + public function hash_encode64($input, $count) + { + $output = ''; + $i = 0; + + do + { + $value = ord($input[$i++]); + $output .= $this->itoa64[$value & 0x3f]; + + if ($i < $count) + { + $value |= ord($input[$i]) << 8; + } + + $output .= $this->itoa64[($value >> 6) & 0x3f]; + + if ($i++ >= $count) + { + break; + } + + if ($i < $count) + { + $value |= ord($input[$i]) << 16; + } + + $output .= $this->itoa64[($value >> 12) & 0x3f]; + + if ($i++ >= $count) + { + break; + } + + $output .= $this->itoa64[($value >> 18) & 0x3f]; + } + while ($i < $count); + + return $output; + } + + /** + * Return unique id + * + * @param string $extra Additional entropy + * + * @return string Unique id + */ + public function unique_id($extra = 'c') + { + static $dss_seeded = false; + + $val = $this->config['rand_seed'] . microtime(); + $val = md5($val); + $this->config['rand_seed'] = md5($this->config['rand_seed'] . $val . $extra); + + if ($dss_seeded !== true && ($this->config['rand_seed_last_update'] < time() - rand(1,10))) + { + $this->config->set('rand_seed_last_update', time(), true); + $this->config->set('rand_seed', $this->config['rand_seed'], true); + $dss_seeded = true; + } + + return substr($val, 4, 16); + } + + /** + * Get random salt with specified length + * + * @param int $length Salt length + * @param string $rand_seed Seed for random data (optional). For tests. + * + * @return string Random salt with specified length + */ + public function get_random_salt($length, $rand_seed = '/dev/urandom') + { + $random = ''; + + if (($fh = @fopen($rand_seed, 'rb'))) + { + $random = fread($fh, $length); + fclose($fh); + } + + if (strlen($random) < $length) + { + $random = ''; + $random_state = $this->unique_id(); + + for ($i = 0; $i < $length; $i += 16) + { + $random_state = md5($this->unique_id() . $random_state); + $random .= pack('H*', md5($random_state)); + } + $random = substr($random, 0, $length); + } + return $random; + } + + /** + * Compare two strings byte by byte + * + * @param string $string_a The first string + * @param string $string_b The second string + * + * @return bool True if strings are the same, false if not + */ + public function string_compare($string_a, $string_b) + { + $difference = strlen($string_a) != strlen($string_b); + + for ($i = 0; $i < strlen($string_a) && $i < strlen($string_b); $i++) + { + $difference |= $string_a[$i] != $string_b[$i]; + } + + return $difference === 0; + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/md5_mybb.php b/sources/phpBB/phpbb/passwords/driver/md5_mybb.php new file mode 100644 index 0000000..f631cea --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/md5_mybb.php @@ -0,0 +1,60 @@ + +* @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\passwords\driver; + +class md5_mybb extends base +{ + const PREFIX = '$md5_mybb$'; + + /** + * {@inheritdoc} + */ + public function get_prefix() + { + return self::PREFIX; + } + + /** + * {@inheritdoc} + */ + public function is_legacy() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function hash($password, $user_row = '') + { + // Do not support hashing + return false; + } + + /** + * {@inheritdoc} + */ + public function check($password, $hash, $user_row = array()) + { + if (empty($hash) || strlen($hash) != 32 || !isset($user_row['user_passwd_salt'])) + { + return false; + } + else + { + // Works for myBB 1.1.x, 1.2.x, 1.4.x, 1.6.x + return $this->helper->string_compare($hash, md5(md5($user_row['user_passwd_salt']) . md5($password))); + } + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/md5_phpbb2.php b/sources/phpBB/phpbb/passwords/driver/md5_phpbb2.php new file mode 100644 index 0000000..bd8cc51 --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/md5_phpbb2.php @@ -0,0 +1,123 @@ + +* @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\passwords\driver; + +class md5_phpbb2 extends base +{ + const PREFIX = '$md5_phpbb2$'; + + /** @var \phpbb\request\request phpBB request object */ + protected $request; + + /** @var \phpbb\passwords\driver\salted_md5 */ + protected $salted_md5; + + /** @var \phpbb\passwords\driver\helper */ + protected $helper; + + /** @var string phpBB root path */ + protected $phpbb_root_path; + + /** @var string php file extension */ + protected $php_ext; + + /** + * Constructor of passwords driver object + * + * @param \phpbb\request\request $request phpBB request object + * @param \phpbb\passwords\driver\salted_md5 $salted_md5 Salted md5 driver + * @param \phpbb\passwords\driver\helper $helper Driver helper + * @param string $phpbb_root_path phpBB root path + * @param string $php_ext PHP file extension + */ + public function __construct($request, salted_md5 $salted_md5, helper $helper, $phpbb_root_path, $php_ext) + { + $this->request = $request; + $this->salted_md5 = $salted_md5; + $this->helper = $helper; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + } + + /** + * {@inheritdoc} + */ + public function get_prefix() + { + return self::PREFIX; + } + + /** + * {@inheritdoc} + */ + public function is_legacy() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function hash($password, $user_row = '') + { + // Do not support hashing + return false; + } + + /** + * {@inheritdoc} + */ + public function check($password, $hash, $user_row = array()) + { + if (strlen($hash) != 32 && strlen($hash) != 34) + { + return false; + } + + // enable super globals to get literal value + // this is needed to prevent unicode normalization + $super_globals_disabled = $this->request->super_globals_disabled(); + if ($super_globals_disabled) + { + $this->request->enable_super_globals(); + } + + // in phpBB2 passwords were used exactly as they were sent, with addslashes applied + $password_old_format = isset($_REQUEST['password']) ? (string) $_REQUEST['password'] : ''; + $password_old_format = (!STRIP) ? addslashes($password_old_format) : $password_old_format; + $password_new_format = $this->request->variable('password', '', true); + + if ($super_globals_disabled) + { + $this->request->disable_super_globals(); + } + + if ($password == $password_new_format) + { + if (!function_exists('utf8_to_cp1252')) + { + include($this->phpbb_root_path . 'includes/utf/data/recode_basic.' . $this->php_ext); + } + + if ($this->helper->string_compare(md5($password_old_format), $hash) || $this->helper->string_compare(md5(\utf8_to_cp1252($password_old_format)), $hash) + || $this->salted_md5->check(md5($password_old_format), $hash) === true + || $this->salted_md5->check(md5(\utf8_to_cp1252($password_old_format)), $hash) === true) + { + return true; + } + } + + return false; + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/md5_vb.php b/sources/phpBB/phpbb/passwords/driver/md5_vb.php new file mode 100644 index 0000000..280b711 --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/md5_vb.php @@ -0,0 +1,60 @@ + +* @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\passwords\driver; + +class md5_vb extends base +{ + const PREFIX = '$md5_vb$'; + + /** + * {@inheritdoc} + */ + public function get_prefix() + { + return self::PREFIX; + } + + /** + * {@inheritdoc} + */ + public function is_legacy() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function hash($password, $user_row = '') + { + // Do not support hashing + return false; + } + + /** + * {@inheritdoc} + */ + public function check($password, $hash, $user_row = array()) + { + if (empty($hash) || strlen($hash) != 32 || !isset($user_row['user_passwd_salt'])) + { + return false; + } + else + { + // Works for vB 3.8.x, 4.x.x, 5.0.x + return $this->helper->string_compare($hash, md5(md5($password) . $user_row['user_passwd_salt'])); + } + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/phpass.php b/sources/phpBB/phpbb/passwords/driver/phpass.php new file mode 100644 index 0000000..bef8355 --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/phpass.php @@ -0,0 +1,27 @@ + +* @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\passwords\driver; + +class phpass extends salted_md5 +{ + const PREFIX = '$P$'; + + /** + * {@inheritdoc} + */ + public function get_prefix() + { + return self::PREFIX; + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/salted_md5.php b/sources/phpBB/phpbb/passwords/driver/salted_md5.php new file mode 100644 index 0000000..81ac010 --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/salted_md5.php @@ -0,0 +1,169 @@ + +* @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\passwords\driver; + +/** +* +* @version Version 0.1 / slightly modified for phpBB 3.1.x (using $H$ as hash type identifier) +* +* Portable PHP password hashing framework. +* +* Written by Solar Designer in 2004-2006 and placed in +* the public domain. +* +* There's absolutely no warranty. +* +* The homepage URL for this framework is: +* +* http://www.openwall.com/phpass/ +* +* Please be sure to update the Version line if you edit this file in any way. +* It is suggested that you leave the main version number intact, but indicate +* your project name (after the slash) and add your own revision information. +* +* Please do not change the "private" password hashing method implemented in +* here, thereby making your hashes incompatible. However, if you must, please +* change the hash type identifier (the "$P$") to something different. +* +* Obviously, since this code is in the public domain, the above are not +* requirements (there can be none), but merely suggestions. +* +*/ + +class salted_md5 extends base +{ + const PREFIX = '$H$'; + + /** + * {@inheritdoc} + */ + public function get_prefix() + { + return self::PREFIX; + } + + /** + * {@inheritdoc} + */ + public function is_legacy() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function hash($password, $setting = '') + { + if ($setting) + { + if (($settings = $this->get_hash_settings($setting)) === false) + { + // Return md5 of password if settings do not + // comply with our standards. This will only + // happen if pre-determined settings are + // directly passed to the driver. The manager + // will not do this. Same as the old hashing + // implementatio in phpBB 3.0 + return md5($password); + } + } + else + { + $settings = $this->get_hash_settings($this->generate_salt()); + } + + $hash = md5($settings['salt'] . $password, true); + do + { + $hash = md5($hash . $password, true); + } + while (--$settings['count']); + + $output = $settings['full']; + $output .= $this->helper->hash_encode64($hash, 16); + + return $output; + } + + /** + * {@inheritdoc} + */ + public function check($password, $hash, $user_row = array()) + { + if (strlen($hash) !== 34) + { + return md5($password) === $hash; + } + + return $this->helper->string_compare($hash, $this->hash($password, $hash)); + } + + /** + * Generate salt for hashing method + * + * @return string Salt for hashing method + */ + protected function generate_salt() + { + $count = 6; + + $random = $this->helper->get_random_salt($count); + + $salt = $this->get_prefix(); + $salt .= $this->helper->itoa64[min($count + 5, 30)]; + $salt .= $this->helper->hash_encode64($random, $count); + + return $salt; + } + + /** + * Get hash settings + * + * @param string $hash The hash that contains the settings + * + * @return bool|array Array containing the count_log2, salt, and full + * hash settings string or false if supplied hash is empty + * or contains incorrect settings + */ + public function get_hash_settings($hash) + { + if (empty($hash)) + { + return false; + } + + $count_log2 = strpos($this->helper->itoa64, $hash[3]); + $salt = substr($hash, 4, 8); + + if ($count_log2 < 7 || $count_log2 > 30 || strlen($salt) != 8) + { + return false; + } + + return array( + 'count' => 1 << $count_log2, + 'salt' => $salt, + 'full' => substr($hash, 0, 12), + ); + } + + /** + * {@inheritdoc} + */ + public function get_settings_only($hash, $full = false) + { + return substr($hash, 3, 9); + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/sha1.php b/sources/phpBB/phpbb/passwords/driver/sha1.php new file mode 100644 index 0000000..1abead4 --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/sha1.php @@ -0,0 +1,52 @@ + +* @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\passwords\driver; + +class sha1 extends base +{ + const PREFIX = '$sha1$'; + + /** + * {@inheritdoc} + */ + public function get_prefix() + { + return self::PREFIX; + } + + /** + * {@inheritdoc} + */ + public function is_legacy() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function hash($password, $user_row = '') + { + // Do not support hashing + return false; + } + + /** + * {@inheritdoc} + */ + public function check($password, $hash, $user_row = array()) + { + return (strlen($hash) == 40) ? $this->helper->string_compare($hash, sha1($password)) : false; + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/sha1_smf.php b/sources/phpBB/phpbb/passwords/driver/sha1_smf.php new file mode 100644 index 0000000..b30d872 --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/sha1_smf.php @@ -0,0 +1,51 @@ + +* @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\passwords\driver; + +class sha1_smf extends base +{ + const PREFIX = '$smf$'; + + /** + * {@inheritdoc} + */ + public function get_prefix() + { + return self::PREFIX; + } + + /** + * {@inheritdoc} + */ + public function is_legacy() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function hash($password, $user_row = '') + { + return (isset($user_row['login_name'])) ? sha1(strtolower($user_row['login_name']) . $password) : false; + } + + /** + * {@inheritdoc} + */ + public function check($password, $hash, $user_row = array()) + { + return (strlen($hash) == 40) ? $this->helper->string_compare($hash, $this->hash($password, $user_row)) : false; + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/sha1_wcf1.php b/sources/phpBB/phpbb/passwords/driver/sha1_wcf1.php new file mode 100644 index 0000000..6800648 --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/sha1_wcf1.php @@ -0,0 +1,60 @@ + +* @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\passwords\driver; + +class sha1_wcf1 extends base +{ + const PREFIX = '$wcf1$'; + + /** + * {@inheritdoc} + */ + public function get_prefix() + { + return self::PREFIX; + } + + /** + * {@inheritdoc} + */ + public function is_legacy() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function hash($password, $user_row = '') + { + // Do not support hashing + return false; + } + + /** + * {@inheritdoc} + */ + public function check($password, $hash, $user_row = array()) + { + if (empty($hash) || strlen($hash) != 40 || !isset($user_row['user_passwd_salt'])) + { + return false; + } + else + { + // Works for standard WCF 1.x, i.e. WBB3 and similar + return $this->helper->string_compare($hash, sha1($user_row['user_passwd_salt'] . sha1($user_row['user_passwd_salt'] . sha1($password)))); + } + } +} diff --git a/sources/phpBB/phpbb/passwords/driver/sha_xf1.php b/sources/phpBB/phpbb/passwords/driver/sha_xf1.php new file mode 100644 index 0000000..9d8f017 --- /dev/null +++ b/sources/phpBB/phpbb/passwords/driver/sha_xf1.php @@ -0,0 +1,68 @@ + +* @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\passwords\driver; + +class sha_xf1 extends base +{ + const PREFIX = '$xf1$'; + + /** + * {@inheritdoc} + */ + public function get_prefix() + { + return self::PREFIX; + } + + /** + * {@inheritdoc} + */ + public function is_legacy() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function hash($password, $user_row = '') + { + // Do not support hashing + return false; + } + + /** + * {@inheritdoc} + */ + public function check($password, $hash, $user_row = array()) + { + if (empty($hash) || (strlen($hash) != 40 && strlen($hash) != 64) || !isset($user_row['user_passwd_salt'])) + { + return false; + } + else + { + // Works for xenforo 1.0, 1.1 + if ($this->helper->string_compare($hash, sha1(sha1($password) . $user_row['user_passwd_salt'])) + || $this->helper->string_compare($hash, hash('sha256', hash('sha256', $password) . $user_row['user_passwd_salt']))) + { + return true; + } + else + { + return false; + } + } + } +} diff --git a/sources/phpBB/phpbb/passwords/helper.php b/sources/phpBB/phpbb/passwords/helper.php new file mode 100644 index 0000000..c2a4920 --- /dev/null +++ b/sources/phpBB/phpbb/passwords/helper.php @@ -0,0 +1,104 @@ + +* @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\passwords; + +class helper +{ + /** + * Get hash settings from combined hash + * + * @param string $hash Password hash of combined hash + * + * @return array An array containing the hash settings for the hash + * types in successive order as described by the combined + * password hash or an empty array if hash does not + * properly fit the combined hash format + */ + public function get_combined_hash_settings($hash) + { + $output = array(); + + preg_match('#^\$([a-zA-Z0-9\\\]*?)\$#', $hash, $match); + $hash_settings = substr($hash, strpos($hash, $match[1]) + strlen($match[1]) + 1); + $matches = explode('\\', $match[1]); + foreach ($matches as $cur_type) + { + $dollar_position = strpos($hash_settings, '$'); + $output[] = substr($hash_settings, 0, ($dollar_position != false) ? $dollar_position : strlen($hash_settings)); + $hash_settings = substr($hash_settings, $dollar_position + 1); + } + + return $output; + } + + /** + * Combine hash prefixes, settings, and actual hash + * + * @param array $data Array containing the keys 'prefix' and 'settings'. + * It will hold the prefixes and settings + * @param string $type Data type of the supplied value + * @param string $value Value that should be put into the data array + * + * @return string|null Return complete combined hash if type is neither + * 'prefix' nor 'settings', nothing if it is + */ + public function combine_hash_output(&$data, $type, $value) + { + if ($type == 'prefix') + { + $data[$type] .= ($data[$type] !== '$') ? '\\' : ''; + $data[$type] .= str_replace('$', '', $value); + } + else if ($type == 'settings') + { + $data[$type] .= ($data[$type] !== '$') ? '$' : ''; + $data[$type] .= $value; + } + else + { + // Return full hash + return $data['prefix'] . $data['settings'] . '$' . $value; + } + } + + /** + * Rebuild hash for hashing functions + * + * @param string $prefix Hash prefix + * @param string $settings Hash settings + * + * @return string Rebuilt hash for hashing functions + */ + public function rebuild_hash($prefix, $settings) + { + $rebuilt_hash = $prefix; + if (strpos($settings, '\\') !== false) + { + $settings = str_replace('\\', '$', $settings); + } + $rebuilt_hash .= $settings; + return $rebuilt_hash; + } + + /** + * Obtain only the actual hash after the prefixes + * + * @param string $hash The full password hash + * @return string Actual hash (incl. settings) + */ + public function obtain_hash_only($hash) + { + return substr($hash, strripos($hash, '$') + 1); + } +} diff --git a/sources/phpBB/phpbb/passwords/manager.php b/sources/phpBB/phpbb/passwords/manager.php new file mode 100644 index 0000000..fbb49d8 --- /dev/null +++ b/sources/phpBB/phpbb/passwords/manager.php @@ -0,0 +1,366 @@ + +* @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\passwords; + +class manager +{ + /** + * Default hashing method + */ + protected $type = false; + + /** + * Hashing algorithm type map + * Will be used to map hash prefix to type + */ + protected $type_map = false; + + /** + * Service collection of hashing algorithms + * Needs to be public for passwords helper + */ + public $algorithms = false; + + /** + * Password convert flag. Signals that password should be converted + */ + public $convert_flag = false; + + /** + * Passwords helper + * @var \phpbb\passwords\helper + */ + protected $helper; + + /** + * phpBB configuration + * @var \phpbb\config\config + */ + protected $config; + + /** + * Construct a passwords object + * + * @param \phpbb\config\config $config phpBB configuration + * @param array $hashing_algorithms Hashing driver + * service collection + * @param \phpbb\passwords\helper $helper Passwords helper object + * @param string $defaults List of default driver types + */ + public function __construct(\phpbb\config\config $config, $hashing_algorithms, helper $helper, $defaults) + { + $this->config = $config; + $this->helper = $helper; + + $this->fill_type_map($hashing_algorithms); + $this->register_default_type($defaults); + } + + /** + * Register default type + * Will register the first supported type from the list of default types + * + * @param array $defaults List of default types in order from first to + * use to last to use + */ + protected function register_default_type($defaults) + { + foreach ($defaults as $type) + { + if ($this->algorithms[$type]->is_supported()) + { + $this->type = $this->algorithms[$type]->get_prefix(); + break; + } + } + } + + /** + * Fill algorithm type map + * + * @param \phpbb\di\service_collection $hashing_algorithms + */ + protected function fill_type_map($hashing_algorithms) + { + foreach ($hashing_algorithms as $algorithm) + { + if (!isset($this->type_map[$algorithm->get_prefix()])) + { + $this->type_map[$algorithm->get_prefix()] = $algorithm; + } + } + $this->algorithms = $hashing_algorithms; + } + + /** + * Get the algorithm specified by a specific prefix + * + * @param string $prefix Password hash prefix + * + * @return object|bool The hash type object or false if prefix is not + * supported + */ + protected function get_algorithm($prefix) + { + if (isset($this->type_map[$prefix])) + { + return $this->type_map[$prefix]; + } + else + { + return false; + } + } + + /** + * Detect the hash type of the supplied hash + * + * @param string $hash Password hash that should be checked + * + * @return object|bool The hash type object or false if the specified + * type is not supported + */ + public function detect_algorithm($hash) + { + /* + * preg_match() will also show hashing algos like $2a\H$, which + * is a combination of bcrypt and phpass. Legacy algorithms + * like md5 will not be matched by this and need to be treated + * differently. + */ + if (!preg_match('#^\$([a-zA-Z0-9\\\]*?)\$#', $hash, $match)) + { + return false; + } + + // Be on the lookout for multiple hashing algorithms + // 2 is correct: H\2a > 2, H\P > 2 + if (strlen($match[1]) > 2) + { + $hash_types = explode('\\', $match[1]); + $return_ary = array(); + foreach ($hash_types as $type) + { + // we do not support the same hashing + // algorithm more than once + if (isset($return_ary[$type])) + { + return false; + } + + $return_ary[$type] = $this->get_algorithm('$' . $type . '$'); + + if (empty($return_ary[$type])) + { + return false; + } + } + return $return_ary; + } + + // get_algorithm() will automatically return false if prefix + // is not supported + return $this->get_algorithm($match[0]); + } + + /** + * Hash supplied password + * + * @param string $password Password that should be hashed + * @param string $type Hash type. Will default to standard hash type if + * none is supplied + * @return string|bool Password hash of supplied password or false if + * if something went wrong during hashing + */ + public function hash($password, $type = '') + { + if (strlen($password) > 4096) + { + // If the password is too huge, we will simply reject it + // and not let the server try to hash it. + return false; + } + + // Try to retrieve algorithm by service name if type doesn't + // start with dollar sign + if (!is_array($type) && strpos($type, '$') !== 0 && isset($this->algorithms[$type])) + { + $type = $this->algorithms[$type]->get_prefix(); + } + + $type = ($type === '') ? $this->type : $type; + + if (is_array($type)) + { + return $this->combined_hash_password($password, $type); + } + + if (isset($this->type_map[$type])) + { + $hashing_algorithm = $this->type_map[$type]; + } + else + { + return false; + } + + return $hashing_algorithm->hash($password); + } + + /** + * Check supplied password against hash and set convert_flag if password + * needs to be converted to different format (preferrably newer one) + * + * @param string $password Password that should be checked + * @param string $hash Stored hash + * @param array $user_row User's row in users table + * @return string|bool True if password is correct, false if not + */ + public function check($password, $hash, $user_row = array()) + { + if (strlen($password) > 4096) + { + // If the password is too huge, we will simply reject it + // and not let the server try to hash it. + return false; + } + + // Empty hashes can't be checked + if (empty($hash)) + { + return false; + } + + // First find out what kind of hash we're dealing with + $stored_hash_type = $this->detect_algorithm($hash); + if ($stored_hash_type == false) + { + // Still check MD5 hashes as that is what the installer + // will default to for the admin user + return $this->get_algorithm('$H$')->check($password, $hash); + } + + // Multiple hash passes needed + if (is_array($stored_hash_type)) + { + $correct = $this->check_combined_hash($password, $stored_hash_type, $hash); + $this->convert_flag = ($correct === true) ? true : false; + return $correct; + } + + if ($stored_hash_type->get_prefix() !== $this->type) + { + $this->convert_flag = true; + } + else + { + $this->convert_flag = false; + } + + // Check all legacy hash types if prefix is $CP$ + if ($stored_hash_type->get_prefix() === '$CP$') + { + // Remove $CP$ prefix for proper checking + $hash = substr($hash, 4); + + foreach ($this->type_map as $algorithm) + { + if ($algorithm->is_legacy() && $algorithm->check($password, $hash, $user_row) === true) + { + return true; + } + } + } + + return $stored_hash_type->check($password, $hash); + } + + /** + * Create combined hash from already hashed password + * + * @param string $password_hash Complete current password hash + * @param string $type Type of the hashing algorithm the password hash + * should be combined with + * @return string|bool Combined password hash if combined hashing was + * successful, else false + */ + public function combined_hash_password($password_hash, $type) + { + $data = array( + 'prefix' => '$', + 'settings' => '$', + ); + $hash_settings = $this->helper->get_combined_hash_settings($password_hash); + $hash = $hash_settings[0]; + + // Put settings of current hash into data array + $stored_hash_type = $this->detect_algorithm($password_hash); + $this->helper->combine_hash_output($data, 'prefix', $stored_hash_type->get_prefix()); + $this->helper->combine_hash_output($data, 'settings', $stored_hash_type->get_settings_only($password_hash)); + + // Hash current hash with the defined types + foreach ($type as $cur_type) + { + if (isset($this->algorithms[$cur_type])) + { + $new_hash_type = $this->algorithms[$cur_type]; + } + else + { + $new_hash_type = $this->get_algorithm($cur_type); + } + + if (!$new_hash_type) + { + return false; + } + + $new_hash = $new_hash_type->hash(str_replace($stored_hash_type->get_settings_only($password_hash), '', $hash)); + $this->helper->combine_hash_output($data, 'prefix', $new_hash_type->get_prefix()); + $this->helper->combine_hash_output($data, 'settings', substr(str_replace('$', '\\', $new_hash_type->get_settings_only($new_hash, true)), 0)); + $hash = str_replace($new_hash_type->get_settings_only($new_hash), '', $this->helper->obtain_hash_only($new_hash)); + } + return $this->helper->combine_hash_output($data, 'hash', $hash); + } + + /** + * Check combined password hash against the supplied password + * + * @param string $password Password entered by user + * @param array $stored_hash_type An array containing the hash types + * as described by stored password hash + * @param string $hash Stored password hash + * + * @return bool True if password is correct, false if not + */ + public function check_combined_hash($password, $stored_hash_type, $hash) + { + $i = 0; + $data = array( + 'prefix' => '$', + 'settings' => '$', + ); + $hash_settings = $this->helper->get_combined_hash_settings($hash); + foreach ($stored_hash_type as $key => $hash_type) + { + $rebuilt_hash = $this->helper->rebuild_hash($hash_type->get_prefix(), $hash_settings[$i]); + $this->helper->combine_hash_output($data, 'prefix', $key); + $this->helper->combine_hash_output($data, 'settings', $hash_settings[$i]); + $cur_hash = $hash_type->hash($password, $rebuilt_hash); + $password = str_replace($rebuilt_hash, '', $cur_hash); + $i++; + } + return ($hash === $this->helper->combine_hash_output($data, 'hash', $password)); + } +} diff --git a/sources/phpBB/phpbb/path_helper.php b/sources/phpBB/phpbb/path_helper.php new file mode 100644 index 0000000..5400c1c --- /dev/null +++ b/sources/phpBB/phpbb/path_helper.php @@ -0,0 +1,492 @@ + +* @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; + +/** +* A class with various functions that are related to paths, files and the filesystem +*/ +class path_helper +{ + /** @var \phpbb\symfony_request */ + protected $symfony_request; + + /** @var \phpbb\filesystem */ + protected $filesystem; + + /** @var \phpbb\request\request_interface */ + protected $request; + + /** @var string */ + protected $phpbb_root_path; + + /** @var string */ + protected $adm_relative_path; + + /** @var string */ + protected $php_ext; + + /** @var string */ + protected $web_root_path; + + /** + * Constructor + * + * @param \phpbb\symfony_request $symfony_request + * @param \phpbb\filesystem $filesystem + * @param \phpbb\request\request_interface $request + * @param string $phpbb_root_path Relative path to phpBB root + * @param string $php_ext PHP 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) + { + $this->symfony_request = $symfony_request; + $this->filesystem = $filesystem; + $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->adm_relative_path = $adm_relative_path; + } + + /** + * Get the phpBB root path + * + * @return string + */ + public function get_phpbb_root_path() + { + return $this->phpbb_root_path; + } + + /** + * Get the adm root path + * + * @return string + */ + public function get_adm_relative_path() + { + return $this->adm_relative_path; + } + + /** + * Get the php extension + * + * @return string + */ + public function get_php_ext() + { + return $this->php_ext; + } + + /** + * Update a web path to the correct relative root path + * + * This replaces $phpbb_root_path . some_url with + * get_web_root_path() . some_url + * + * @param string $path The path to be updated + * @return string + */ + public function update_web_root_path($path) + { + if (strpos($path, $this->phpbb_root_path) === 0) + { + $path = substr($path, strlen($this->phpbb_root_path)); + + $web_root_path = $this->get_web_root_path(); + if (substr($web_root_path, -8) === 'app.php/' && substr($path, 0, 7) === 'app.php') + { + $path = substr($path, 8); + } + + return $this->filesystem->clean_path($web_root_path . $path); + } + + return $path; + } + + /** + * Strips away the web root path and prepends the normal root path + * + * This replaces get_web_root_path() . some_url with + * $phpbb_root_path . some_url + * + * @param string $path The path to be updated + * @return string + */ + public function remove_web_root_path($path) + { + if (strpos($path, $this->get_web_root_path()) === 0) + { + $path = substr($path, strlen($this->get_web_root_path())); + + return $this->phpbb_root_path . $path; + } + + return $path; + } + + /** + * Get a relative root path from the current URL + * + * @return string + */ + public function get_web_root_path() + { + if ($this->symfony_request === null) + { + return $this->phpbb_root_path; + } + + if (null !== $this->web_root_path) + { + return $this->web_root_path; + } + + // We do not need to escape $path_info, $request_uri and $script_name because we can not find their content in the result. + // Path info (e.g. /foo/bar) + $path_info = $this->filesystem->clean_path($this->symfony_request->getPathInfo()); + + // Full request URI (e.g. phpBB/app.php/foo/bar) + $request_uri = $this->symfony_request->getRequestUri(); + + // Script name URI (e.g. phpBB/app.php) + $script_name = $this->symfony_request->getScriptName(); + + /* + * If the path info is empty but we're using app.php, then we + * might be using an empty route like app.php/ which is + * supported by symfony's routing + */ + if ($path_info === '/' && preg_match('/app\.' . $this->php_ext . '\/$/', $request_uri)) + { + return $this->web_root_path = $this->filesystem->clean_path('./../' . $this->phpbb_root_path); + } + + /* + * If the path info is empty (single /), then we're not using + * a route like app.php/foo/bar + */ + if ($path_info === '/') + { + return $this->web_root_path = $this->phpbb_root_path; + } + + /* + * Check AJAX request: + * If the current request is a AJAX we need to fix the paths. + * We need to get the root path based on the Referer, so we can use + * the generated URLs in the template of the Referer. If we do not + * generate the relative path based on the Referer, but based on the + * currently requested URL, the generated URLs will not point to the + * intended locations: + * Referer desired URL desired relative root path + * memberlist.php faq.php ./ + * memberlist.php app.php/foo/bar ./ + * app.php/foo memberlist.php ../ + * app.php/foo app.php/fox ../ + * app.php/foo/bar memberlist.php ../../ + * ../page.php memberlist.php ./phpBB/ + * ../sub/page.php memberlist.php ./../phpBB/ + * + * The referer must be specified as a parameter in the query. + */ + if ($this->request->is_ajax() && $this->symfony_request->get('_referer')) + { + // We need to escape $absolute_board_url because it can be partially concatenated to the result. + $absolute_board_url = $this->request->escape($this->symfony_request->getSchemeAndHttpHost() . $this->symfony_request->getBasePath(), true); + + $referer_web_root_path = $this->get_web_root_path_from_ajax_referer( + $this->symfony_request->get('_referer'), + $absolute_board_url + ); + return $this->web_root_path = $this->phpbb_root_path . $referer_web_root_path; + } + + // How many corrections might we need? + $corrections = substr_count($path_info, '/'); + + /* + * If the script name (e.g. phpBB/app.php) does not exists in the + * requestUri (e.g. phpBB/app.php/foo/template), then we are rewriting + * the URL. So we must reduce the slash count by 1. + */ + if (strpos($request_uri, $script_name) !== 0) + { + $corrections--; + } + + // Prepend ../ to the phpbb_root_path as many times as / exists in path_info + $this->web_root_path = $this->filesystem->clean_path( + './' . str_repeat('../', $corrections) . $this->phpbb_root_path + ); + return $this->web_root_path; + } + + /** + * Get the web root path of the referer form an ajax request + * + * @param string $absolute_referer_url + * @param string $absolute_board_url + * @return string + */ + public function get_web_root_path_from_ajax_referer($absolute_referer_url, $absolute_board_url) + { + // If the board URL is in the beginning of the referer, this means + // we the referer is in the board URL or a subdirectory of it. + // So we just need to count the / (slashes) in the left over part of + // the referer and prepend ../ the the current root_path, to get the + // web root path of the referer. + if (strpos($absolute_referer_url, $absolute_board_url) === 0) + { + $relative_referer_path = substr($absolute_referer_url, strlen($absolute_board_url)); + $has_params = strpos($relative_referer_path, '?'); + if ($has_params !== false) + { + $relative_referer_path = substr($relative_referer_path, 0, $has_params); + } + $corrections = substr_count($relative_referer_path, '/'); + return $this->phpbb_root_path . str_repeat('../', $corrections - 1); + } + + // If not, it's a bit more complicated. We go to the parent directory + // of the referer until we find the remaining referer in the board URL. + // Foreach directory we need to add a ../ to the fixed root_path. + // When we finally found it, we need to remove the remaining referer + // from the board URL, to get the boards root path. + // If the then append these two strings, we get our fixed web root path. + $fixed_root_path = ''; + $referer_dir = $absolute_referer_url; + $has_params = strpos($referer_dir, '?'); + if ($has_params !== false) + { + $referer_dir = substr($referer_dir, 0, $has_params); + } + + // If we do not find a slash at the end of the referer, we come + // from a file. So the first dirname() does not need a traversal + // path correction. + if (substr($referer_dir, -1) !== '/') + { + $referer_dir = dirname($referer_dir); + } + + while (($dir_position = strpos($absolute_board_url, $referer_dir)) !== 0) + { + $fixed_root_path .= '../'; + $referer_dir = dirname($referer_dir); + + // Just return phpbb_root_path if we reach the top directory + if ($referer_dir === '.') + { + return $this->phpbb_root_path; + } + } + + $fixed_root_path .= substr($absolute_board_url, strlen($referer_dir) + 1); + // Add trailing slash + return $this->phpbb_root_path . $fixed_root_path . '/'; + } + + /** + * Eliminates useless . and .. components from specified URL + * + * @param string $url URL to clean + * + * @return string Cleaned URL + */ + public function clean_url($url) + { + $delimiter_position = strpos($url, '://'); + // URL should contain :// but it shouldn't start with it. + // Do not clean URLs that do not fit these constraints. + if (empty($delimiter_position)) + { + return $url; + } + $scheme = substr($url, 0, $delimiter_position) . '://'; + // Add length of URL delimiter to position + $path = substr($url, $delimiter_position + 3); + + return $scheme . $this->filesystem->clean_path($path); + } + + /** + * Glue URL parameters together + * + * @param array $params URL parameters in the form of array(name => value) + * @return string Returns the glued string, e.g. name1=value1&name2&name3=value3 + */ + public function glue_url_params($params) + { + $_params = array(); + + foreach ($params as $key => $value) + { + // some parameters do not have value + if ($value !== null) + { + $_params[] = $key . '=' . $value; + } + else + { + $_params[] = $key; + } + } + return implode('&', $_params); + } + + /** + * Get the base and parameters of a URL + * + * @param string $url URL to break apart + * @param bool $is_amp Is the parameter separator &. Defaults to true. + * @return array Returns the base and parameters in the form of array('base' => string, 'params' => array(name => value)) + */ + public function get_url_parts($url, $is_amp = true) + { + $separator = ($is_amp) ? '&' : '&'; + $params = array(); + + if (strpos($url, '?') !== false) + { + $base = substr($url, 0, strpos($url, '?')); + $args = substr($url, strlen($base) + 1); + $args = ($args) ? explode($separator, $args) : array(); + + foreach ($args as $argument) + { + if (empty($argument)) + { + continue; + } + + // some parameters don't have value + if (strpos($argument, '=') !== false) + { + list($key, $value) = explode('=', $argument, 2); + } + else + { + $key = $argument; + $value = null; + } + + if ($key === '') + { + continue; + } + + $params[$key] = $value; + } + } + else + { + $base = $url; + } + + return array( + 'base' => $base, + 'params' => $params, + ); + } + + /** + * Strip parameters from an already built URL. + * + * @param string $url URL to strip parameters from + * @param array|string $strip Parameters to strip. + * @param bool $is_amp Is the parameter separator &. Defaults to true. + * @return string Returns the new URL. + */ + public function strip_url_params($url, $strip, $is_amp = true) + { + $url_parts = $this->get_url_parts($url, $is_amp); + $params = $url_parts['params']; + + if (!is_array($strip)) + { + $strip = array($strip); + } + + if (!empty($params)) + { + // Strip the parameters off + foreach ($strip as $param) + { + unset($params[$param]); + } + } + + return $url_parts['base'] . (($params) ? '?' . $this->glue_url_params($params) : ''); + } + + /** + * Append parameters to an already built URL. + * + * @param string $url URL to append parameters to + * @param array $new_params Parameters to add in the form of array(name => value) + * @param bool $is_amp Is the parameter separator &. Defaults to true. + * @return string Returns the new URL. + */ + public function append_url_params($url, $new_params, $is_amp = true) + { + $url_parts = $this->get_url_parts($url, $is_amp); + $params = array_merge($url_parts['params'], $new_params); + + // Move the sid to the end if it's set + if (isset($params['sid'])) + { + $sid = $params['sid']; + unset($params['sid']); + $params['sid'] = $sid; + } + + return $url_parts['base'] . (($params) ? '?' . $this->glue_url_params($params) : ''); + } + + /** + * Get a valid page + * + * @param string $page The page to verify + * @param bool $mod_rewrite Whether mod_rewrite is enabled, default: false + * + * @return string A valid page based on given page and mod_rewrite + */ + public function get_valid_page($page, $mod_rewrite = false) + { + // We need to be cautious here. + // On some situations, the redirect path is an absolute URL, sometimes a relative path + // For a relative path, let's prefix it with $phpbb_root_path to point to the correct location, + // else we use the URL directly. + $url_parts = parse_url($page); + + // URL + if ($url_parts === false || empty($url_parts['scheme']) || empty($url_parts['host'])) + { + // Remove 'app.php/' from the page, when rewrite is enabled. + // Treat app.php as a reserved file name and remove on mod rewrite + // even if it might not be in the phpBB root. + if ($mod_rewrite && ($app_position = strpos($page, 'app.' . $this->php_ext . '/')) !== false) + { + $page = substr($page, 0, $app_position) . substr($page, $app_position + strlen('app.' . $this->php_ext . '/')); + } + + // Remove preceding slashes from page name and prepend root path + $page = $this->get_phpbb_root_path() . ltrim($page, '/\\'); + } + + return $page; + } +} diff --git a/sources/phpBB/phpbb/permissions.php b/sources/phpBB/phpbb/permissions.php new file mode 100644 index 0000000..9b3dcad --- /dev/null +++ b/sources/phpBB/phpbb/permissions.php @@ -0,0 +1,338 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb; + +class permissions +{ + /** + * Event dispatcher object + * @var \phpbb\event\dispatcher_interface + */ + protected $dispatcher; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Constructor + * + * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher + * @param \phpbb\user $user User Object + */ + public function __construct(\phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\user $user) + { + $this->dispatcher = $phpbb_dispatcher; + $this->user = $user; + + $categories = $this->categories; + $types = $this->types; + $permissions = $this->permissions; + + /** + * Allows to specify additional permission categories, types and permissions + * + * @event core.permissions + * @var array types Array with permission types (a_, u_, m_, etc.) + * @var array categories Array with permission categories (pm, post, settings, misc, etc.) + * @var array permissions Array with permissions. Each Permission has the following layout: + * '' => array( + * 'lang' => 'Language Key with a Short description', // Optional, if not set, + * // the permissions identifier '' is used with + * // all uppercase. + * 'cat' => 'Identifier of the category, the permission should be displayed in', + * ), + * Example: + * 'u_viewprofile' => array( + * 'lang' => 'ACL_U_VIEWPROFILE', + * 'cat' => 'profile', + * ), + * @since 3.1.0-a1 + */ + $vars = array('types', 'categories', 'permissions'); + extract($phpbb_dispatcher->trigger_event('core.permissions', compact($vars))); + + $this->categories = $categories; + $this->types = $types; + $this->permissions = $permissions; + } + + /** + * Returns an array with all the permission categories (pm, post, settings, misc, etc.) + * + * @return array Layout: cat-identifier => Language key + */ + public function get_categories() + { + return $this->categories; + } + + /** + * Returns the language string of a permission category + * + * @param string $category Identifier of the category + * @return string Language string + */ + public function get_category_lang($category) + { + return $this->user->lang($this->categories[$category]); + } + + /** + * Returns an array with all the permission types (a_, u_, m_, etc.) + * + * @return array Layout: type-identifier => Language key + */ + public function get_types() + { + return $this->types; + } + + /** + * Returns the language string of a permission type + * + * @param string $type Identifier of the type + * @param mixed $scope Scope of the type (should be 'global', 'local' or false) + * @return string Language string + */ + public function get_type_lang($type, $scope = false) + { + if ($scope && isset($this->types[$scope][$type])) + { + $lang_key = $this->types[$scope][$type]; + } + else if (isset($this->types[$type])) + { + $lang_key = $this->types[$type]; + } + else + { + $lang_key = 'ACL_TYPE_' . strtoupper(($scope) ? $scope . '_' . $type : $type); + } + + return $this->user->lang($lang_key); + } + + /** + * Returns an array with all the permissions. + * Each Permission has the following layout: + * '' => array( + * 'lang' => 'Language Key with a Short description', // Optional, if not set, + * // the permissions identifier '' is used with + * // all uppercase. + * 'cat' => 'Identifier of the category, the permission should be displayed in', + * ), + * Example: + * 'u_viewprofile' => array( + * 'lang' => 'ACL_U_VIEWPROFILE', + * 'cat' => 'profile', + * ), + * + * @return array + */ + public function get_permissions() + { + return $this->permissions; + } + + /** + * Returns the category of a permission + * + * @param string $permission Identifier of the permission + * @return string Returns the category identifier of the permission + */ + public function get_permission_category($permission) + { + return (isset($this->permissions[$permission]['cat'])) ? $this->permissions[$permission]['cat'] : 'misc'; + } + + /** + * Returns the language string of a permission + * + * @param string $permission Identifier of the permission + * @return string Language string + */ + public function get_permission_lang($permission) + { + return (isset($this->permissions[$permission]['lang'])) ? $this->user->lang($this->permissions[$permission]['lang']) : $this->user->lang('ACL_' . strtoupper($permission)); + } + + protected $types = array( + 'u_' => 'ACL_TYPE_U_', + 'a_' => 'ACL_TYPE_A_', + 'm_' => 'ACL_TYPE_M_', + 'f_' => 'ACL_TYPE_F_', + 'global' => array( + 'm_' => 'ACL_TYPE_GLOBAL_M_', + ), + ); + + protected $categories = array( + 'actions' => 'ACL_CAT_ACTIONS', + 'content' => 'ACL_CAT_CONTENT', + 'forums' => 'ACL_CAT_FORUMS', + 'misc' => 'ACL_CAT_MISC', + 'permissions' => 'ACL_CAT_PERMISSIONS', + 'pm' => 'ACL_CAT_PM', + 'polls' => 'ACL_CAT_POLLS', + 'post' => 'ACL_CAT_POST', + 'post_actions' => 'ACL_CAT_POST_ACTIONS', + 'posting' => 'ACL_CAT_POSTING', + 'profile' => 'ACL_CAT_PROFILE', + 'settings' => 'ACL_CAT_SETTINGS', + 'topic_actions' => 'ACL_CAT_TOPIC_ACTIONS', + 'user_group' => 'ACL_CAT_USER_GROUP', + ); + + protected $permissions = array( + // User Permissions + 'u_viewprofile' => array('lang' => 'ACL_U_VIEWPROFILE', 'cat' => 'profile'), + 'u_chgname' => array('lang' => 'ACL_U_CHGNAME', 'cat' => 'profile'), + 'u_chgpasswd' => array('lang' => 'ACL_U_CHGPASSWD', 'cat' => 'profile'), + 'u_chgemail' => array('lang' => 'ACL_U_CHGEMAIL', 'cat' => 'profile'), + 'u_chgavatar' => array('lang' => 'ACL_U_CHGAVATAR', 'cat' => 'profile'), + 'u_chggrp' => array('lang' => 'ACL_U_CHGGRP', 'cat' => 'profile'), + 'u_chgprofileinfo' => array('lang' => 'ACL_U_CHGPROFILEINFO', 'cat' => 'profile'), + + 'u_attach' => array('lang' => 'ACL_U_ATTACH', 'cat' => 'post'), + 'u_download' => array('lang' => 'ACL_U_DOWNLOAD', 'cat' => 'post'), + 'u_savedrafts' => array('lang' => 'ACL_U_SAVEDRAFTS', 'cat' => 'post'), + 'u_chgcensors' => array('lang' => 'ACL_U_CHGCENSORS', 'cat' => 'post'), + 'u_sig' => array('lang' => 'ACL_U_SIG', 'cat' => 'post'), + + 'u_sendpm' => array('lang' => 'ACL_U_SENDPM', 'cat' => 'pm'), + 'u_masspm' => array('lang' => 'ACL_U_MASSPM', 'cat' => 'pm'), + 'u_masspm_group'=> array('lang' => 'ACL_U_MASSPM_GROUP', 'cat' => 'pm'), + 'u_readpm' => array('lang' => 'ACL_U_READPM', 'cat' => 'pm'), + 'u_pm_edit' => array('lang' => 'ACL_U_PM_EDIT', 'cat' => 'pm'), + 'u_pm_delete' => array('lang' => 'ACL_U_PM_DELETE', 'cat' => 'pm'), + 'u_pm_forward' => array('lang' => 'ACL_U_PM_FORWARD', 'cat' => 'pm'), + 'u_pm_emailpm' => array('lang' => 'ACL_U_PM_EMAILPM', 'cat' => 'pm'), + 'u_pm_printpm' => array('lang' => 'ACL_U_PM_PRINTPM', 'cat' => 'pm'), + 'u_pm_attach' => array('lang' => 'ACL_U_PM_ATTACH', 'cat' => 'pm'), + 'u_pm_download' => array('lang' => 'ACL_U_PM_DOWNLOAD', 'cat' => 'pm'), + 'u_pm_bbcode' => array('lang' => 'ACL_U_PM_BBCODE', 'cat' => 'pm'), + 'u_pm_smilies' => array('lang' => 'ACL_U_PM_SMILIES', 'cat' => 'pm'), + 'u_pm_img' => array('lang' => 'ACL_U_PM_IMG', 'cat' => 'pm'), + 'u_pm_flash' => array('lang' => 'ACL_U_PM_FLASH', 'cat' => 'pm'), + + 'u_sendemail' => array('lang' => 'ACL_U_SENDEMAIL', 'cat' => 'misc'), + 'u_sendim' => array('lang' => 'ACL_U_SENDIM', 'cat' => 'misc'), + 'u_ignoreflood' => array('lang' => 'ACL_U_IGNOREFLOOD', 'cat' => 'misc'), + 'u_hideonline' => array('lang' => 'ACL_U_HIDEONLINE', 'cat' => 'misc'), + 'u_viewonline' => array('lang' => 'ACL_U_VIEWONLINE', 'cat' => 'misc'), + 'u_search' => array('lang' => 'ACL_U_SEARCH', 'cat' => 'misc'), + + // Forum Permissions + 'f_list' => array('lang' => 'ACL_F_LIST', 'cat' => 'actions'), + 'f_read' => array('lang' => 'ACL_F_READ', 'cat' => 'actions'), + 'f_search' => array('lang' => 'ACL_F_SEARCH', 'cat' => 'actions'), + 'f_subscribe' => array('lang' => 'ACL_F_SUBSCRIBE', 'cat' => 'actions'), + 'f_print' => array('lang' => 'ACL_F_PRINT', 'cat' => 'actions'), + 'f_email' => array('lang' => 'ACL_F_EMAIL', 'cat' => 'actions'), + 'f_bump' => array('lang' => 'ACL_F_BUMP', 'cat' => 'actions'), + 'f_user_lock' => array('lang' => 'ACL_F_USER_LOCK', 'cat' => 'actions'), + 'f_download' => array('lang' => 'ACL_F_DOWNLOAD', 'cat' => 'actions'), + 'f_report' => array('lang' => 'ACL_F_REPORT', 'cat' => 'actions'), + + '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_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'), + 'f_softdelete' => array('lang' => 'ACL_F_SOFTDELETE', 'cat' => 'post'), + 'f_ignoreflood' => array('lang' => 'ACL_F_IGNOREFLOOD', 'cat' => 'post'), + 'f_postcount' => array('lang' => 'ACL_F_POSTCOUNT', 'cat' => 'post'), + 'f_noapprove' => array('lang' => 'ACL_F_NOAPPROVE', 'cat' => 'post'), + + 'f_attach' => array('lang' => 'ACL_F_ATTACH', 'cat' => 'content'), + 'f_icons' => array('lang' => 'ACL_F_ICONS', 'cat' => 'content'), + 'f_bbcode' => array('lang' => 'ACL_F_BBCODE', 'cat' => 'content'), + 'f_flash' => array('lang' => 'ACL_F_FLASH', 'cat' => 'content'), + 'f_img' => array('lang' => 'ACL_F_IMG', 'cat' => 'content'), + 'f_sigs' => array('lang' => 'ACL_F_SIGS', 'cat' => 'content'), + 'f_smilies' => array('lang' => 'ACL_F_SMILIES', 'cat' => 'content'), + + 'f_poll' => array('lang' => 'ACL_F_POLL', 'cat' => 'polls'), + 'f_vote' => array('lang' => 'ACL_F_VOTE', 'cat' => 'polls'), + 'f_votechg' => array('lang' => 'ACL_F_VOTECHG', 'cat' => 'polls'), + + // Moderator Permissions + 'm_edit' => array('lang' => 'ACL_M_EDIT', 'cat' => 'post_actions'), + 'm_delete' => array('lang' => 'ACL_M_DELETE', 'cat' => 'post_actions'), + 'm_approve' => array('lang' => 'ACL_M_APPROVE', 'cat' => 'post_actions'), + 'm_report' => array('lang' => 'ACL_M_REPORT', 'cat' => 'post_actions'), + 'm_chgposter' => array('lang' => 'ACL_M_CHGPOSTER', 'cat' => 'post_actions'), + + 'm_move' => array('lang' => 'ACL_M_MOVE', 'cat' => 'topic_actions'), + 'm_lock' => array('lang' => 'ACL_M_LOCK', 'cat' => 'topic_actions'), + 'm_split' => array('lang' => 'ACL_M_SPLIT', 'cat' => 'topic_actions'), + 'm_merge' => array('lang' => 'ACL_M_MERGE', 'cat' => 'topic_actions'), + + 'm_info' => array('lang' => 'ACL_M_INFO', 'cat' => 'misc'), + 'm_warn' => array('lang' => 'ACL_M_WARN', 'cat' => 'misc'), + 'm_ban' => array('lang' => 'ACL_M_BAN', 'cat' => 'misc'), + + // Admin Permissions + 'a_board' => array('lang' => 'ACL_A_BOARD', 'cat' => 'settings'), + 'a_server' => array('lang' => 'ACL_A_SERVER', 'cat' => 'settings'), + 'a_jabber' => array('lang' => 'ACL_A_JABBER', 'cat' => 'settings'), + 'a_phpinfo' => array('lang' => 'ACL_A_PHPINFO', 'cat' => 'settings'), + + 'a_forum' => array('lang' => 'ACL_A_FORUM', 'cat' => 'forums'), + 'a_forumadd' => array('lang' => 'ACL_A_FORUMADD', 'cat' => 'forums'), + 'a_forumdel' => array('lang' => 'ACL_A_FORUMDEL', 'cat' => 'forums'), + 'a_prune' => array('lang' => 'ACL_A_PRUNE', 'cat' => 'forums'), + + 'a_icons' => array('lang' => 'ACL_A_ICONS', 'cat' => 'posting'), + 'a_words' => array('lang' => 'ACL_A_WORDS', 'cat' => 'posting'), + 'a_bbcode' => array('lang' => 'ACL_A_BBCODE', 'cat' => 'posting'), + 'a_attach' => array('lang' => 'ACL_A_ATTACH', 'cat' => 'posting'), + + 'a_user' => array('lang' => 'ACL_A_USER', 'cat' => 'user_group'), + 'a_userdel' => array('lang' => 'ACL_A_USERDEL', 'cat' => 'user_group'), + 'a_group' => array('lang' => 'ACL_A_GROUP', 'cat' => 'user_group'), + 'a_groupadd' => array('lang' => 'ACL_A_GROUPADD', 'cat' => 'user_group'), + 'a_groupdel' => array('lang' => 'ACL_A_GROUPDEL', 'cat' => 'user_group'), + 'a_ranks' => array('lang' => 'ACL_A_RANKS', 'cat' => 'user_group'), + 'a_profile' => array('lang' => 'ACL_A_PROFILE', 'cat' => 'user_group'), + 'a_names' => array('lang' => 'ACL_A_NAMES', 'cat' => 'user_group'), + 'a_ban' => array('lang' => 'ACL_A_BAN', 'cat' => 'user_group'), + + 'a_viewauth' => array('lang' => 'ACL_A_VIEWAUTH', 'cat' => 'permissions'), + 'a_authgroups' => array('lang' => 'ACL_A_AUTHGROUPS', 'cat' => 'permissions'), + 'a_authusers' => array('lang' => 'ACL_A_AUTHUSERS', 'cat' => 'permissions'), + 'a_fauth' => array('lang' => 'ACL_A_FAUTH', 'cat' => 'permissions'), + 'a_mauth' => array('lang' => 'ACL_A_MAUTH', 'cat' => 'permissions'), + 'a_aauth' => array('lang' => 'ACL_A_AAUTH', 'cat' => 'permissions'), + 'a_uauth' => array('lang' => 'ACL_A_UAUTH', 'cat' => 'permissions'), + 'a_roles' => array('lang' => 'ACL_A_ROLES', 'cat' => 'permissions'), + 'a_switchperm' => array('lang' => 'ACL_A_SWITCHPERM', 'cat' => 'permissions'), + + 'a_styles' => array('lang' => 'ACL_A_STYLES', 'cat' => 'misc'), + 'a_extensions' => array('lang' => 'ACL_A_EXTENSIONS', 'cat' => 'misc'), + 'a_viewlogs' => array('lang' => 'ACL_A_VIEWLOGS', 'cat' => 'misc'), + 'a_clearlogs' => array('lang' => 'ACL_A_CLEARLOGS', 'cat' => 'misc'), + 'a_modules' => array('lang' => 'ACL_A_MODULES', 'cat' => 'misc'), + 'a_language' => array('lang' => 'ACL_A_LANGUAGE', 'cat' => 'misc'), + 'a_email' => array('lang' => 'ACL_A_EMAIL', 'cat' => 'misc'), + 'a_bots' => array('lang' => 'ACL_A_BOTS', 'cat' => 'misc'), + 'a_reasons' => array('lang' => 'ACL_A_REASONS', 'cat' => 'misc'), + 'a_backup' => array('lang' => 'ACL_A_BACKUP', 'cat' => 'misc'), + 'a_search' => array('lang' => 'ACL_A_SEARCH', 'cat' => 'misc'), + ); +} diff --git a/sources/phpBB/phpbb/php/ini.php b/sources/phpBB/phpbb/php/ini.php new file mode 100644 index 0000000..73a3065 --- /dev/null +++ b/sources/phpBB/phpbb/php/ini.php @@ -0,0 +1,171 @@ + +* @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\php; + +/** +* Wrapper class for ini_get function. +* +* Provides easier handling of the different interpretations of ini values. +*/ +class ini +{ + /** + * Simple wrapper for ini_get() + * See http://php.net/manual/en/function.ini-get.php + * + * @param string $varname The configuration option name. + * @return bool|string False if configuration option does not exist, + * the configuration option value (string) otherwise. + */ + public function get($varname) + { + return ini_get($varname); + } + + /** + * Gets the configuration option value as a trimmed string. + * + * @param string $varname The configuration option name. + * @return bool|string False if configuration option does not exist, + * the configuration option value (string) otherwise. + */ + public function get_string($varname) + { + $value = $this->get($varname); + + if ($value === false) + { + return false; + } + + return trim($value); + } + + /** + * Gets configuration option value as a boolean. + * Interprets the string value 'off' as false. + * + * @param string $varname The configuration option name. + * @return bool False if configuration option does not exist. + * False if configuration option is disabled. + * True otherwise. + */ + public function get_bool($varname) + { + $value = $this->get_string($varname); + + if (empty($value) || strtolower($value) == 'off') + { + return false; + } + + return true; + } + + /** + * Gets configuration option value as an integer. + * + * @param string $varname The configuration option name. + * @return bool|int False if configuration option does not exist, + * false if configuration option value is not numeric, + * the configuration option value (integer) otherwise. + */ + public function get_int($varname) + { + $value = $this->get_string($varname); + + if (!is_numeric($value)) + { + return false; + } + + return (int) $value; + } + + /** + * Gets configuration option value as a float. + * + * @param string $varname The configuration option name. + * @return bool|float False if configuration option does not exist, + * false if configuration option value is not numeric, + * the configuration option value (float) otherwise. + */ + public function get_float($varname) + { + $value = $this->get_string($varname); + + if (!is_numeric($value)) + { + return false; + } + + return (float) $value; + } + + /** + * Gets configuration option value in bytes. + * Converts strings like '128M' to bytes (integer or float). + * + * @param string $varname The configuration option name. + * @return bool|int|float False if configuration option does not exist, + * false if configuration option value is not well-formed, + * the configuration option value otherwise. + */ + public function get_bytes($varname) + { + $value = $this->get_string($varname); + + if ($value === false) + { + return false; + } + + if (is_numeric($value)) + { + // Already in bytes. + return phpbb_to_numeric($value); + } + else if (strlen($value) < 2) + { + // Single character. + return false; + } + else if (strlen($value) < 3 && $value[0] === '-') + { + // Two characters but the first one is a minus. + return false; + } + + $value_lower = strtolower($value); + $value_numeric = phpbb_to_numeric($value); + + switch ($value_lower[strlen($value_lower) - 1]) + { + case 'g': + $value_numeric *= 1024; + case 'm': + $value_numeric *= 1024; + case 'k': + $value_numeric *= 1024; + break; + + default: + // It's not already in bytes (and thus numeric) + // and does not carry a unit. + return false; + } + + return $value_numeric; + } +} diff --git a/sources/phpBB/phpbb/plupload/plupload.php b/sources/phpBB/phpbb/plupload/plupload.php new file mode 100644 index 0000000..3c686a5 --- /dev/null +++ b/sources/phpBB/phpbb/plupload/plupload.php @@ -0,0 +1,402 @@ + +* @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\plupload; + +/** +* This class handles all server-side plupload functions +*/ +class plupload +{ + /** + * @var string + */ + protected $phpbb_root_path; + + /** + * @var \phpbb\config\config + */ + protected $config; + + /** + * @var \phpbb\request\request_interface + */ + protected $request; + + /** + * @var \phpbb\user + */ + protected $user; + + /** + * @var \phpbb\php\ini + */ + protected $php_ini; + + /** + * @var \phpbb\mimetype\guesser + */ + protected $mimetype_guesser; + + /** + * Final destination for uploaded files, i.e. the "files" directory. + * @var string + */ + protected $upload_directory; + + /** + * Temporary upload directory for plupload uploads. + * @var string + */ + protected $temporary_directory; + + /** + * Constructor. + * + * @param string $phpbb_root_path + * @param \phpbb\config\config $config + * @param \phpbb\request\request_interface $request + * @param \phpbb\user $user + * @param \phpbb\php\ini $php_ini + * @param \phpbb\mimetype\guesser $mimetype_guesser + */ + public function __construct($phpbb_root_path, \phpbb\config\config $config, \phpbb\request\request_interface $request, \phpbb\user $user, \phpbb\php\ini $php_ini, \phpbb\mimetype\guesser $mimetype_guesser) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->config = $config; + $this->request = $request; + $this->user = $user; + $this->php_ini = $php_ini; + $this->mimetype_guesser = $mimetype_guesser; + + $this->set_default_directories(); + } + + /** + * Plupload allows for chunking so we must check for that and assemble + * the whole file first before performing any checks on it. + * + * @param string $form_name The name of the file element in the upload form + * + * @return array|null null if there are no chunks to piece together + * otherwise array containing the path to the + * pieced-together file and its size + */ + public function handle_upload($form_name) + { + $chunks_expected = $this->request->variable('chunks', 0); + + // If chunking is disabled or we are not using plupload, just return + // and handle the file as usual + if ($chunks_expected < 2) + { + return; + } + + $file_name = $this->request->variable('name', ''); + $chunk = $this->request->variable('chunk', 0); + + $this->user->add_lang('plupload'); + $this->prepare_temporary_directory(); + + $file_path = $this->temporary_filepath($file_name); + $this->integrate_uploaded_file($form_name, $chunk, $file_path); + + // If we are done with all the chunks, strip the .part suffix and then + // handle the resulting file as normal, otherwise die and await the + // next chunk. + if ($chunk == $chunks_expected - 1) + { + rename("{$file_path}.part", $file_path); + + // Reset upload directories to defaults once completed + $this->set_default_directories(); + + // Need to modify some of the $_FILES values to reflect the new file + return array( + 'tmp_name' => $file_path, + 'name' => $this->request->variable('real_filename', ''), + 'size' => filesize($file_path), + 'type' => $this->mimetype_guesser->guess($file_path, $file_name), + ); + } + else + { + $json_response = new \phpbb\json_response(); + $json_response->send(array( + 'jsonrpc' => '2.0', + 'id' => 'id', + 'result' => null, + )); + } + } + + /** + * Fill in the plupload configuration options in the template + * + * @param \phpbb\cache\service $cache + * @param \phpbb\template\template $template + * @param string $s_action The URL to submit the POST data to + * @param int $forum_id The ID of the forum + * @param int $max_files Maximum number of files allowed. 0 for unlimited. + * + * @return null + */ + public function configure(\phpbb\cache\service $cache, \phpbb\template\template $template, $s_action, $forum_id, $max_files) + { + $filters = $this->generate_filter_string($cache, $forum_id); + $chunk_size = $this->get_chunk_size(); + $resize = $this->generate_resize_string(); + + $template->assign_vars(array( + 'S_RESIZE' => $resize, + 'S_PLUPLOAD' => true, + 'FILTERS' => $filters, + 'CHUNK_SIZE' => $chunk_size, + 'S_PLUPLOAD_URL' => htmlspecialchars_decode($s_action), + 'MAX_ATTACHMENTS' => $max_files, + 'ATTACH_ORDER' => ($this->config['display_order']) ? 'asc' : 'desc', + 'L_TOO_MANY_ATTACHMENTS' => $this->user->lang('TOO_MANY_ATTACHMENTS', $max_files), + )); + + $this->user->add_lang('plupload'); + } + + /** + * Checks whether the page request was sent by plupload or not + * + * @return bool + */ + public function is_active() + { + return $this->request->header('X-PHPBB-USING-PLUPLOAD', false); + } + + /** + * Returns whether the current HTTP request is a multipart request. + * + * @return bool + */ + public function is_multipart() + { + $content_type = $this->request->server('CONTENT_TYPE'); + + return strpos($content_type, 'multipart') === 0; + } + + /** + * Sends an error message back to the client via JSON response + * + * @param int $code The error code + * @param string $msg The translation string of the message to be sent + * + * @return null + */ + public function emit_error($code, $msg) + { + $json_response = new \phpbb\json_response(); + $json_response->send(array( + 'jsonrpc' => '2.0', + 'id' => 'id', + 'error' => array( + 'code' => $code, + 'message' => $this->user->lang($msg), + ), + )); + } + + /** + * Looks at the list of allowed extensions and generates a string + * appropriate for use in configuring plupload with + * + * @param \phpbb\cache\service $cache + * @param string $forum_id The ID of the forum + * + * @return string + */ + public function generate_filter_string(\phpbb\cache\service $cache, $forum_id) + { + $attach_extensions = $cache->obtain_attach_extensions($forum_id); + unset($attach_extensions['_allowed_']); + $groups = array(); + + // Re-arrange the extension array to $groups[$group_name][] + foreach ($attach_extensions as $extension => $extension_info) + { + if (!isset($groups[$extension_info['group_name']])) + { + $groups[$extension_info['group_name']] = array(); + } + + $groups[$extension_info['group_name']][] = $extension; + } + + $filters = array(); + foreach ($groups as $group => $extensions) + { + $filters[] = sprintf( + "{title: '%s', extensions: '%s'}", + addslashes(ucfirst(strtolower($group))), + addslashes(implode(',', $extensions)) + ); + } + + return implode(',', $filters); + } + + /** + * Generates a string that is used to tell plupload to automatically resize + * files before uploading them. + * + * @return string + */ + public function generate_resize_string() + { + $resize = ''; + if ($this->config['img_max_height'] > 0 && $this->config['img_max_width'] > 0) + { + $resize = sprintf( + 'resize: {width: %d, height: %d, quality: 100},', + (int) $this->config['img_max_height'], + (int) $this->config['img_max_width'] + ); + } + + return $resize; + } + + /** + * Checks various php.ini values and the maximum file size to determine + * the maximum size chunks a file can be split up into for upload + * + * @return int + */ + public function get_chunk_size() + { + $max = min( + $this->php_ini->get_bytes('upload_max_filesize'), + $this->php_ini->get_bytes('post_max_size'), + max(1, $this->php_ini->get_bytes('memory_limit')), + $this->config['max_filesize'] + ); + + // Use half of the maximum possible to leave plenty of room for other + // POST data. + return floor($max / 2); + } + + protected function temporary_filepath($file_name) + { + // Must preserve the extension for plupload to work. + return sprintf( + '%s/%s_%s%s', + $this->temporary_directory, + $this->config['plupload_salt'], + md5($file_name), + \filespec::get_extension($file_name) + ); + } + + /** + * Checks whether the chunk we are about to deal with was actually uploaded + * by PHP and actually exists, if not, it generates an error + * + * @param string $form_name The name of the file in the form data + * + * @return null + */ + protected function integrate_uploaded_file($form_name, $chunk, $file_path) + { + $is_multipart = $this->is_multipart(); + $upload = $this->request->file($form_name); + if ($is_multipart && (!isset($upload['tmp_name']) || !is_uploaded_file($upload['tmp_name']))) + { + $this->emit_error(103, 'PLUPLOAD_ERR_MOVE_UPLOADED'); + } + + $tmp_file = $this->temporary_filepath($upload['tmp_name']); + + if (!move_uploaded_file($upload['tmp_name'], $tmp_file)) + { + $this->emit_error(103, 'PLUPLOAD_ERR_MOVE_UPLOADED'); + } + + $out = fopen("{$file_path}.part", $chunk == 0 ? 'wb' : 'ab'); + if (!$out) + { + $this->emit_error(102, 'PLUPLOAD_ERR_OUTPUT'); + } + + $in = fopen(($is_multipart) ? $tmp_file : 'php://input', 'rb'); + if (!$in) + { + $this->emit_error(101, 'PLUPLOAD_ERR_INPUT'); + } + + while ($buf = fread($in, 4096)) + { + fwrite($out, $buf); + } + + fclose($in); + fclose($out); + + if ($is_multipart) + { + unlink($tmp_file); + } + } + + /** + * Creates the temporary directory if it does not already exist. + * + * @return null + */ + protected function prepare_temporary_directory() + { + if (!file_exists($this->temporary_directory)) + { + mkdir($this->temporary_directory); + + copy( + $this->upload_directory . '/index.htm', + $this->temporary_directory . '/index.htm' + ); + } + } + + /** + * Sets the default directories for uploads + * + * @return null + */ + protected function set_default_directories() + { + $this->upload_directory = $this->phpbb_root_path . $this->config['upload_path']; + $this->temporary_directory = $this->upload_directory . '/plupload'; + } + + /** + * Sets the upload directories to the specified paths + * + * @param string $upload_directory Upload directory + * @param string $temporary_directory Temporary directory + * + * @return null + */ + public function set_upload_directories($upload_directory, $temporary_directory) + { + $this->upload_directory = $upload_directory; + $this->temporary_directory = $temporary_directory; + } +} diff --git a/sources/phpBB/phpbb/profilefields/lang_helper.php b/sources/phpBB/phpbb/profilefields/lang_helper.php new file mode 100644 index 0000000..2e35372 --- /dev/null +++ b/sources/phpBB/phpbb/profilefields/lang_helper.php @@ -0,0 +1,140 @@ + +* @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\profilefields; + +/** +* Custom Profile Fields +*/ +class lang_helper +{ + /** + * Array with the language option, grouped by field and language + * @var array + */ + protected $options_lang = array(); + + /** + * Database object + * @var \phpbb\db\driver\driver_interface + */ + protected $db; + + /** + * Table where the language strings are stored + * @var string + */ + protected $language_table; + + /** + * Construct + * + * @param \phpbb\db\driver\driver_interface $db Database object + * @param string $language_table Table where the language strings are stored + */ + public function __construct($db, $language_table) + { + $this->db = $db; + $this->language_table = $language_table; + } + + /** + * Loads preview options into language entries for options + * + * @param int $field_id + * @param int $lang_id + * @param mixed $preview_options + */ + public function load_preview_options($field_id, $lang_id, $preview_options) + { + $lang_options = (!is_array($preview_options)) ? explode("\n", $preview_options) : $preview_options; + + foreach ($lang_options as $num => $var) + { + if (!isset($this->options_lang[$field_id])) + { + $this->options_lang[$field_id] = array(); + } + if (!isset($this->options_lang[$field_id][$lang_id])) + { + $this->options_lang[$field_id][$lang_id] = array(); + } + $this->options_lang[$field_id][$lang_id][($num + 1)] = $var; + } + } + + /** + * Fetches language entries for options from DB + * + * @param int $lang_id + */ + public function load_option_lang($lang_id) + { + $sql = 'SELECT field_id, option_id, lang_value + FROM ' . $this->language_table . ' + WHERE lang_id = ' . (int) $lang_id . " + ORDER BY option_id"; + + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $this->options_lang[$row['field_id']][$lang_id][($row['option_id'] + 1)] = $row['lang_value']; + } + + $this->db->sql_freeresult($result); + } + + /** + * Are language options set for this field? + * + * @param int $field_id Database ID of the field + * @param int $lang_id ID of the language + * @param int $field_value Selected value of the field + * @return boolean + */ + public function is_set($field_id, $lang_id = null, $field_value = null) + { + $is_set = isset($this->options_lang[$field_id]); + + if ($is_set && (!is_null($lang_id) || !is_null($field_value))) + { + $is_set = isset($this->options_lang[$field_id][$lang_id]); + } + + if ($is_set && !is_null($field_value)) + { + $is_set = isset($this->options_lang[$field_id][$lang_id][$field_value]); + } + + return $is_set; + } + + /** + * Get the selected language string + * + * @param int $field_id Database ID of the field + * @param int $lang_id ID of the language + * @param int $field_value Selected value of the field + * @return string + */ + public function get($field_id, $lang_id, $field_value = null) + { + if (is_null($field_value)) + { + return $this->options_lang[$field_id][$lang_id]; + } + + return $this->options_lang[$field_id][$lang_id][$field_value]; + } +} diff --git a/sources/phpBB/phpbb/profilefields/manager.php b/sources/phpBB/phpbb/profilefields/manager.php new file mode 100644 index 0000000..4ad3214 --- /dev/null +++ b/sources/phpBB/phpbb/profilefields/manager.php @@ -0,0 +1,482 @@ + +* @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\profilefields; + +/** +* Custom Profile Fields +*/ +class manager +{ + /** + * Auth object + * @var \phpbb\auth\auth + */ + protected $auth; + + /** + * Database object + * @var \phpbb\db\driver\driver_interface + */ + protected $db; + + /** + * Event dispatcher object + * @var \phpbb\event\dispatcher_interface + */ + protected $dispatcher; + + /** + * Request object + * @var \phpbb\request\request + */ + protected $request; + + /** + * Template object + * @var \phpbb\template\template + */ + protected $template; + + /** + * Service Collection object + * @var \phpbb\di\service_collection + */ + protected $type_collection; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + protected $fields_table; + + protected $fields_language_table; + + protected $fields_data_table; + + protected $profile_cache = array(); + + /** + * Construct + * + * @param \phpbb\auth\auth $auth Auth object + * @param \phpbb\db\driver\driver_interface $db Database object + * @param \phpbb\event\dispatcher_interface $dispatcher Event dispatcher object + * @param \phpbb\request\request $request Request object + * @param \phpbb\template\template $template Template object + * @param \phpbb\di\service_collection $type_collection + * @param \phpbb\user $user User object + * @param string $fields_table + * @param string $fields_language_table + * @param string $fields_data_table + */ + public function __construct(\phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\di\service_collection $type_collection, \phpbb\user $user, $fields_table, $fields_language_table, $fields_data_table) + { + $this->auth = $auth; + $this->db = $db; + $this->dispatcher = $dispatcher; + $this->request = $request; + $this->template = $template; + $this->type_collection = $type_collection; + $this->user = $user; + + $this->fields_table = $fields_table; + $this->fields_language_table = $fields_language_table; + $this->fields_data_table = $fields_data_table; + } + + /** + * Assign editable fields to template, mode can be profile (for profile change) or register (for registration) + * Called by ucp_profile and ucp_register + */ + public function generate_profile_fields($mode, $lang_id) + { + $sql_where = ''; + switch ($mode) + { + case 'register': + // If the field is required we show it on the registration page + $sql_where .= ' AND f.field_show_on_reg = 1'; + break; + + case 'profile': + // Show hidden fields to moderators/admins + if (!$this->auth->acl_gets('a_', 'm_') && !$this->auth->acl_getf_global('m_')) + { + $sql_where .= ' AND f.field_show_profile = 1'; + } + break; + + default: + trigger_error('Wrong profile mode specified', E_USER_ERROR); + break; + } + + $sql = 'SELECT l.*, f.* + FROM ' . $this->fields_language_table . ' l, ' . $this->fields_table . " f + WHERE f.field_active = 1 + $sql_where + AND l.lang_id = " . (int) $lang_id . ' + AND l.field_id = f.field_id + ORDER BY f.field_order'; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + // Return templated field + $profile_field = $this->type_collection[$row['field_type']]; + $tpl_snippet = $profile_field->process_field_row('change', $row); + + $this->template->assign_block_vars('profile_fields', array( + 'LANG_NAME' => $this->user->lang($row['lang_name']), + 'LANG_EXPLAIN' => $this->user->lang($row['lang_explain']), + 'FIELD' => $tpl_snippet, + 'FIELD_ID' => $profile_field->get_field_ident($row), + 'S_REQUIRED' => ($row['field_required']) ? true : false, + )); + } + $this->db->sql_freeresult($result); + } + + /** + * Build profile cache, used for display + */ + protected function build_cache() + { + $this->profile_cache = array(); + + // Display hidden/no_view fields for admin/moderator + $sql = 'SELECT l.*, f.* + FROM ' . $this->fields_language_table . ' l, ' . $this->fields_table . ' f + WHERE l.lang_id = ' . $this->user->get_iso_lang_id() . ' + AND f.field_active = 1 ' . + ((!$this->auth->acl_gets('a_', 'm_') && !$this->auth->acl_getf_global('m_')) ? ' AND f.field_hide = 0 ' : '') . ' + AND f.field_no_view = 0 + AND l.field_id = f.field_id + ORDER BY f.field_order'; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $this->profile_cache[$row['field_ident']] = $row; + } + $this->db->sql_freeresult($result); + } + + /** + * Submit profile field for validation + */ + public function submit_cp_field($mode, $lang_id, &$cp_data, &$cp_error) + { + $sql_where = ''; + switch ($mode) + { + case 'register': + // If the field is required we show it on the registration page + $sql_where .= ' AND f.field_show_on_reg = 1'; + break; + + case 'profile': + // Show hidden fields to moderators/admins + if (!$this->auth->acl_gets('a_', 'm_') && !$this->auth->acl_getf_global('m_')) + { + $sql_where .= ' AND f.field_show_profile = 1'; + } + break; + + default: + trigger_error('Wrong profile mode specified', E_USER_ERROR); + break; + } + + $sql = 'SELECT l.*, f.* + FROM ' . $this->fields_language_table . ' l, ' . $this->fields_table . ' f + WHERE l.lang_id = ' . (int) $lang_id . " + AND f.field_active = 1 + $sql_where + AND l.field_id = f.field_id + ORDER BY f.field_order"; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $profile_field = $this->type_collection[$row['field_type']]; + $cp_data['pf_' . $row['field_ident']] = $profile_field->get_profile_field($row); + $check_value = $cp_data['pf_' . $row['field_ident']]; + + if (($cp_result = $profile_field->validate_profile_field($check_value, $row)) !== false) + { + // If the result is not false, it's an error message + $cp_error[] = $cp_result; + } + } + $this->db->sql_freeresult($result); + } + + /** + * Update profile field data directly + */ + public function update_profile_field_data($user_id, $cp_data) + { + if (!sizeof($cp_data)) + { + return; + } + + $sql = 'UPDATE ' . $this->fields_data_table . ' + SET ' . $this->db->sql_build_array('UPDATE', $cp_data) . ' + WHERE user_id = ' . (int) $user_id; + $this->db->sql_query($sql); + + if (!$this->db->sql_affectedrows()) + { + $cp_data = $this->build_insert_sql_array($cp_data); + $cp_data['user_id'] = (int) $user_id; + + $sql = 'INSERT INTO ' . $this->fields_data_table . ' ' . $this->db->sql_build_array('INSERT', $cp_data); + $this->db->sql_query($sql); + } + } + + /** + * Generate the template arrays in order to display the column names + * + * @param string $restrict_option Restrict the published fields to a certain profile field option + * @return array Returns an array with the template variables type, name and explain for the fields to display + */ + public function generate_profile_fields_template_headlines($restrict_option = '') + { + if (!sizeof($this->profile_cache)) + { + $this->build_cache(); + } + + $tpl_fields = array(); + + // Go through the fields in correct order + foreach ($this->profile_cache as $field_ident => $field_data) + { + if ($restrict_option && !$field_data[$restrict_option]) + { + continue; + } + + $profile_field = $this->type_collection[$field_data['field_type']]; + + $tpl_fields[] = array( + 'PROFILE_FIELD_TYPE' => $field_data['field_type'], + 'PROFILE_FIELD_NAME' => $profile_field->get_field_name($field_data['lang_name']), + 'PROFILE_FIELD_EXPLAIN' => $this->user->lang($field_data['lang_explain']), + ); + } + + return $tpl_fields; + } + + /** + * Grab the user specific profile fields data + * + * @param int|array $user_ids Single user id or an array of ids + * @return array Users profile fields data + */ + public function grab_profile_fields_data($user_ids = 0) + { + if (!is_array($user_ids)) + { + $user_ids = array($user_ids); + } + + if (!sizeof($this->profile_cache)) + { + $this->build_cache(); + } + + if (!sizeof($user_ids)) + { + return array(); + } + + $sql = 'SELECT * + FROM ' . $this->fields_data_table . ' + WHERE ' . $this->db->sql_in_set('user_id', array_map('intval', $user_ids)); + $result = $this->db->sql_query($sql); + + $field_data = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $field_data[$row['user_id']] = $row; + } + $this->db->sql_freeresult($result); + + /** + * Event to modify profile fields data retrieved from the database + * + * @event core.grab_profile_fields_data + * @var array user_ids Single user id or an array of ids + * @var array field_data Array with profile fields data + * @since 3.1.0-b3 + */ + $vars = array('user_ids', 'field_data'); + extract($this->dispatcher->trigger_event('core.grab_profile_fields_data', compact($vars))); + + $user_fields = array(); + + // Go through the fields in correct order + foreach (array_keys($this->profile_cache) as $used_ident) + { + foreach ($field_data as $user_id => $row) + { + $user_fields[$user_id][$used_ident]['value'] = $row['pf_' . $used_ident]; + $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident]; + } + + foreach ($user_ids as $user_id) + { + if (!isset($user_fields[$user_id][$used_ident]) && $this->profile_cache[$used_ident]['field_show_novalue']) + { + $user_fields[$user_id][$used_ident]['value'] = ''; + $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident]; + } + } + } + + return $user_fields; + } + + /** + * Assign the user's profile fields data to the template + * + * @param array $profile_row Array with users profile field data + * @param bool $use_contact_fields Should we display contact fields as such? + * This requires special treatments (links should not be parsed in the values, and more) + * @return array + */ + public function generate_profile_fields_template_data($profile_row, $use_contact_fields = true) + { + // $profile_row == $user_fields[$row['user_id']]; + $tpl_fields = array(); + $tpl_fields['row'] = $tpl_fields['blockrow'] = array(); + + /** + * Event to modify data of the generated profile fields, before the template assignment loop + * + * @event core.generate_profile_fields_template_data_before + * @var array profile_row Array with users profile field data + * @var array tpl_fields Array with template data fields + * @var bool use_contact_fields Should we display contact fields as such? + * @since 3.1.0-b3 + */ + $vars = array('profile_row', 'tpl_fields', 'use_contact_fields'); + extract($this->dispatcher->trigger_event('core.generate_profile_fields_template_data_before', compact($vars))); + + foreach ($profile_row as $ident => $ident_ary) + { + $profile_field = $this->type_collection[$ident_ary['data']['field_type']]; + $value = $profile_field->get_profile_value($ident_ary['value'], $ident_ary['data']); + $value_raw = $profile_field->get_profile_value_raw($ident_ary['value'], $ident_ary['data']); + + if ($value === null) + { + continue; + } + + $field_desc = $contact_url = ''; + if ($use_contact_fields && $ident_ary['data']['field_is_contact']) + { + $value = $profile_field->get_profile_contact_value($ident_ary['value'], $ident_ary['data']); + $field_desc = $this->user->lang($ident_ary['data']['field_contact_desc']); + if (strpos($field_desc, '%s') !== false) + { + $field_desc = sprintf($field_desc, $value); + } + $contact_url = ''; + if (strpos($ident_ary['data']['field_contact_url'], '%s') !== false) + { + $contact_url = sprintf($ident_ary['data']['field_contact_url'], $value); + } + } + + $tpl_fields['row'] += array( + 'PROFILE_' . strtoupper($ident) . '_IDENT' => $ident, + 'PROFILE_' . strtoupper($ident) . '_VALUE' => $value, + 'PROFILE_' . strtoupper($ident) . '_VALUE_RAW' => $value_raw, + 'PROFILE_' . strtoupper($ident) . '_CONTACT' => $contact_url, + 'PROFILE_' . strtoupper($ident) . '_DESC' => $field_desc, + 'PROFILE_' . strtoupper($ident) . '_TYPE' => $ident_ary['data']['field_type'], + 'PROFILE_' . strtoupper($ident) . '_NAME' => $this->user->lang($ident_ary['data']['lang_name']), + 'PROFILE_' . strtoupper($ident) . '_EXPLAIN' => $this->user->lang($ident_ary['data']['lang_explain']), + + 'S_PROFILE_' . strtoupper($ident) . '_CONTACT' => $ident_ary['data']['field_is_contact'], + 'S_PROFILE_' . strtoupper($ident) => true, + ); + + $tpl_fields['blockrow'][] = array( + 'PROFILE_FIELD_IDENT' => $ident, + 'PROFILE_FIELD_VALUE' => $value, + 'PROFILE_FIELD_VALUE_RAW' => $value_raw, + 'PROFILE_FIELD_CONTACT' => $contact_url, + 'PROFILE_FIELD_DESC' => $field_desc, + 'PROFILE_FIELD_TYPE' => $ident_ary['data']['field_type'], + 'PROFILE_FIELD_NAME' => $this->user->lang($ident_ary['data']['lang_name']), + 'PROFILE_FIELD_EXPLAIN' => $this->user->lang($ident_ary['data']['lang_explain']), + + 'S_PROFILE_CONTACT' => $ident_ary['data']['field_is_contact'], + 'S_PROFILE_' . strtoupper($ident) => true, + ); + } + + /** + * Event to modify template data of the generated profile fields + * + * @event core.generate_profile_fields_template_data + * @var array profile_row Array with users profile field data + * @var array tpl_fields Array with template data fields + * @var bool use_contact_fields Should we display contact fields as such? + * @since 3.1.0-b3 + */ + $vars = array('profile_row', 'tpl_fields', 'use_contact_fields'); + extract($this->dispatcher->trigger_event('core.generate_profile_fields_template_data', compact($vars))); + + return $tpl_fields; + } + + /** + * Build Array for user insertion into custom profile fields table + */ + public function build_insert_sql_array($cp_data) + { + $sql_not_in = array(); + foreach ($cp_data as $key => $null) + { + $sql_not_in[] = (strncmp($key, 'pf_', 3) === 0) ? substr($key, 3) : $key; + } + + $sql = 'SELECT f.field_type, f.field_ident, f.field_default_value, l.lang_default_value + FROM ' . $this->fields_language_table . ' l, ' . $this->fields_table . ' f + WHERE l.lang_id = ' . $this->user->get_iso_lang_id() . ' + ' . ((sizeof($sql_not_in)) ? ' AND ' . $this->db->sql_in_set('f.field_ident', $sql_not_in, true) : '') . ' + AND l.field_id = f.field_id'; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $profile_field = $this->type_collection[$row['field_type']]; + $cp_data['pf_' . $row['field_ident']] = $profile_field->get_default_field_value($row); + } + $this->db->sql_freeresult($result); + + return $cp_data; + } +} diff --git a/sources/phpBB/phpbb/profilefields/type/type_base.php b/sources/phpBB/phpbb/profilefields/type/type_base.php new file mode 100644 index 0000000..9b4bada --- /dev/null +++ b/sources/phpBB/phpbb/profilefields/type/type_base.php @@ -0,0 +1,206 @@ + +* @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\profilefields\type; + +abstract class type_base implements type_interface +{ + /** + * Request object + * @var \phpbb\request\request + */ + protected $request; + + /** + * Template object + * @var \phpbb\template\template + */ + protected $template; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Construct + * + * @param \phpbb\request\request $request Request object + * @param \phpbb\template\template $template Template object + * @param \phpbb\user $user User object + */ + public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) + { + $this->request = $request; + $this->template = $template; + $this->user = $user; + } + + /** + * {@inheritDoc} + */ + public function get_name() + { + return $this->user->lang('FIELD_' . strtoupper($this->get_name_short())); + } + + /** + * {@inheritDoc} + */ + public function get_service_name() + { + return 'profilefields.type.' . $this->get_name_short(); + } + + /** + * {@inheritDoc} + */ + public function get_template_filename() + { + return 'profilefields/' . $this->get_name_short() . '.html'; + } + + /** + * {@inheritDoc} + */ + public function get_field_ident($field_data) + { + return 'pf_' . $field_data['field_ident']; + } + + /** + * {@inheritDoc} + */ + public function get_field_name($field_name) + { + return isset($this->user->lang[$field_name]) ? $this->user->lang[$field_name] : $field_name; + } + + /** + * {@inheritDoc} + */ + public function get_profile_contact_value($field_value, $field_data) + { + return $this->get_profile_value($field_value, $field_data); + } + + /** + * {@inheritDoc} + */ + public function get_language_options_input($field_data) + { + $field_data['l_lang_name'] = $this->request->variable('l_lang_name', array(0 => ''), true); + $field_data['l_lang_explain'] = $this->request->variable('l_lang_explain', array(0 => ''), true); + $field_data['l_lang_default_value'] = $this->request->variable('l_lang_default_value', array(0 => ''), true); + $field_data['l_lang_options'] = $this->request->variable('l_lang_options', array(0 => ''), true); + + return $field_data; + } + + /** + * {@inheritDoc} + */ + public function prepare_options_form(&$exclude_options, &$visibility_options) + { + return $this->request->variable('lang_options', '', true); + } + + /** + * {@inheritDoc} + */ + public function validate_options_on_submit($error, $field_data) + { + return $error; + } + + /** + * {@inheritDoc} + */ + public function get_excluded_options($key, $action, $current_value, &$field_data, $step) + { + if ($step == 3 && ($field_data[$key] || $action != 'edit') && $key == 'l_lang_options' && is_array($field_data[$key])) + { + foreach ($field_data[$key] as $lang_id => $options) + { + $field_data[$key][$lang_id] = is_array($options) ? $options : explode("\n", $options); + } + + return $current_value; + } + + return $current_value; + } + + /** + * {@inheritDoc} + */ + public function prepare_hidden_fields($step, $key, $action, &$field_data) + { + if (!$this->request->is_set($key)) + { + // Do not set this variable, we will use the default value + return null; + } + else if ($key == 'field_ident' && isset($field_data[$key])) + { + return $field_data[$key]; + } + else + { + $default_value = ''; + $lang_fields = array( + 'l_lang_name', + 'l_lang_explain', + 'l_lang_default_value', + 'l_lang_options', + ); + + if (in_array($key, $lang_fields)) + { + $default_value = array(0 => ''); + } + return $this->request->variable($key, $default_value, true); + } + } + + /** + * {@inheritDoc} + */ + public function display_options(&$template_vars, &$field_data) + { + return; + } + + /** + * Return templated value/field. Possible values for $mode are: + * change == user is able to set/enter profile values; preview == just show the value + */ + public function process_field_row($mode, $profile_row) + { + $preview_options = ($mode == 'preview') ? $profile_row['lang_options'] : false; + + // set template filename + $this->template->set_filenames(array( + 'cp_body' => $this->get_template_filename(), + )); + + // empty previously filled blockvars + $this->template->destroy_block_vars($this->get_name_short()); + + // Assign template variables + $this->generate_field($profile_row, $preview_options); + + return $this->template->assign_display('cp_body'); + } +} diff --git a/sources/phpBB/phpbb/profilefields/type/type_bool.php b/sources/phpBB/phpbb/profilefields/type/type_bool.php new file mode 100644 index 0000000..f6f3f17 --- /dev/null +++ b/sources/phpBB/phpbb/profilefields/type/type_bool.php @@ -0,0 +1,415 @@ + +* @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\profilefields\type; + +class type_bool extends type_base +{ + /** + * Profile fields language helper + * @var \phpbb\profilefields\lang_helper + */ + protected $lang_helper; + + /** + * Request object + * @var \phpbb\request\request + */ + protected $request; + + /** + * Template object + * @var \phpbb\template\template + */ + protected $template; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Construct + * + * @param \phpbb\profilefields\lang_helper $lang_helper Profile fields language helper + * @param \phpbb\request\request $request Request object + * @param \phpbb\template\template $template Template object + * @param \phpbb\user $user User object + */ + public function __construct(\phpbb\profilefields\lang_helper $lang_helper, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) + { + $this->lang_helper = $lang_helper; + $this->request = $request; + $this->template = $template; + $this->user = $user; + } + + /** + * {@inheritDoc} + */ + public function get_name_short() + { + return 'bool'; + } + + /** + * {@inheritDoc} + */ + public function get_options($default_lang_id, $field_data) + { + $profile_row = array( + 'var_name' => 'field_default_value', + 'field_id' => 1, + 'lang_name' => $field_data['lang_name'], + 'lang_explain' => $field_data['lang_explain'], + 'lang_id' => $default_lang_id, + 'field_default_value' => $field_data['field_default_value'], + 'field_ident' => 'field_default_value', + 'field_type' => $this->get_service_name(), + 'field_length' => $field_data['field_length'], + 'lang_options' => $field_data['lang_options'], + ); + + $options = array( + 0 => array('TITLE' => $this->user->lang['FIELD_TYPE'], 'EXPLAIN' => $this->user->lang['BOOL_TYPE_EXPLAIN'], 'FIELD' => ''), + 1 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row)), + ); + + return $options; + } + + /** + * {@inheritDoc} + */ + public function get_default_option_values() + { + return array( + 'field_length' => 1, + 'field_minlen' => 0, + 'field_maxlen' => 0, + 'field_validation' => '', + 'field_novalue' => 0, + 'field_default_value' => 0, + ); + } + + /** + * {@inheritDoc} + */ + public function get_default_field_value($field_data) + { + return $field_data['field_default_value']; + } + + /** + * {@inheritDoc} + */ + public function get_profile_field($profile_row) + { + $var_name = 'pf_' . $profile_row['field_ident']; + + // Checkbox + if ($profile_row['field_length'] == 2) + { + return ($this->request->is_set($var_name)) ? 1 : 0; + } + else + { + return $this->request->variable($var_name, (int) $profile_row['field_default_value']); + } + } + + /** + * {@inheritDoc} + */ + public function validate_profile_field(&$field_value, $field_data) + { + $field_value = (bool) $field_value; + + if (!$field_value && $field_data['field_required']) + { + return $this->user->lang('FIELD_REQUIRED', $this->get_field_name($field_data['lang_name'])); + } + + return false; + } + + /** + * {@inheritDoc} + */ + public function get_profile_value($field_value, $field_data) + { + $field_id = $field_data['field_id']; + $lang_id = $field_data['lang_id']; + + if (!$this->lang_helper->is_set($field_id, $lang_id)) + { + $this->lang_helper->load_option_lang($lang_id); + } + + if (!$field_value && $field_data['field_show_novalue']) + { + $field_value = $field_data['field_default_value']; + } + + if ($field_data['field_length'] == 1) + { + return ($this->lang_helper->is_set($field_id, $lang_id, (int) $field_value)) ? $this->lang_helper->get($field_id, $lang_id, (int) $field_value) : null; + } + else if (!$field_value) + { + return null; + } + else + { + return $this->lang_helper->is_set($field_id, $lang_id, $field_value + 1) ? $this->lang_helper->get($field_id, $lang_id, $field_value + 1) : null; + } + } + + /** + * {@inheritDoc} + */ + public function get_profile_value_raw($field_value, $field_data) + { + if ($field_value == $field_data['field_novalue'] && !$field_data['field_show_novalue']) + { + return null; + } + + if (!$field_value && $field_data['field_show_novalue']) + { + $field_value = $field_data['field_novalue']; + } + + return $field_value; + } + + /** + * {@inheritDoc} + */ + public function generate_field($profile_row, $preview_options = false) + { + $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident']; + $field_ident = $profile_row['field_ident']; + $default_value = $profile_row['field_default_value']; + + // checkbox - set the value to "true" if it has been set to 1 + if ($profile_row['field_length'] == 2) + { + $value = ($this->request->is_set($field_ident) && $this->request->variable($field_ident, $default_value) == 1) ? true : ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $default_value : $this->user->profile_fields[$field_ident]); + } + else + { + $value = ($this->request->is_set($field_ident)) ? $this->request->variable($field_ident, $default_value) : ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $default_value : $this->user->profile_fields[$field_ident]); + } + + $profile_row['field_value'] = (int) $value; + $this->template->assign_block_vars('bool', array_change_key_case($profile_row, CASE_UPPER)); + + if ($profile_row['field_length'] == 1) + { + if (!$this->lang_helper->is_set($profile_row['field_id'], $profile_row['lang_id'], 1)) + { + if ($preview_options) + { + $this->lang_helper->load_preview_options($profile_row['field_id'], $profile_row['lang_id'], $preview_options); + } + else + { + $this->lang_helper->load_option_lang($profile_row['lang_id']); + } + } + + $options = $this->lang_helper->get($profile_row['field_id'], $profile_row['lang_id']); + foreach ($options as $option_id => $option_value) + { + $this->template->assign_block_vars('bool.options', array( + 'OPTION_ID' => $option_id, + 'CHECKED' => ($value == $option_id) ? ' checked="checked"' : '', + 'VALUE' => $option_value, + )); + } + } + } + + /** + * {@inheritDoc} + */ + public function get_field_ident($field_data) + { + return ($field_data['field_length'] == '1') ? '' : 'pf_' . $field_data['field_ident']; + } + + /** + * {@inheritDoc} + */ + public function get_database_column_type() + { + return 'TINT:2'; + } + + /** + * {@inheritDoc} + */ + public function get_language_options($field_data) + { + $options = array( + 'lang_name' => 'string', + 'lang_options' => 'two_options', + ); + + if ($field_data['lang_explain']) + { + $options['lang_explain'] = 'text'; + } + + return $options; + } + + /** + * {@inheritDoc} + */ + public function get_language_options_input($field_data) + { + $field_data['l_lang_name'] = $this->request->variable('l_lang_name', array(0 => ''), true); + $field_data['l_lang_explain'] = $this->request->variable('l_lang_explain', array(0 => ''), true); + $field_data['l_lang_default_value'] = $this->request->variable('l_lang_default_value', array(0 => ''), true); + + /** + * @todo check if this line is correct... + $field_data['l_lang_default_value'] = $this->request->variable('l_lang_default_value', array(0 => array('')), true); + */ + $field_data['l_lang_options'] = $this->request->variable('l_lang_options', array(0 => array('')), true); + + return $field_data; + } + + /** + * {@inheritDoc} + */ + public function prepare_options_form(&$exclude_options, &$visibility_options) + { + $exclude_options[1][] = 'lang_options'; + + return $this->request->variable('lang_options', array(''), true); + } + + /** + * {@inheritDoc} + */ + public function validate_options_on_submit($error, $field_data) + { + if (empty($field_data['lang_options'][0]) || empty($field_data['lang_options'][1])) + { + $error[] = $this->user->lang['NO_FIELD_ENTRIES']; + } + + return $error; + } + + /** + * {@inheritDoc} + */ + public function get_excluded_options($key, $action, $current_value, &$field_data, $step) + { + if ($step == 2 && $key == 'field_default_value') + { + // 'field_length' == 1 defines radio buttons. Possible values are 1 or 2 only. + // 'field_length' == 2 defines checkbox. Possible values are 0 or 1 only. + // If we switch the type on step 2, we have to adjust field value. + // 1 is a common value for the checkbox and radio buttons. + + // Adjust unchecked checkbox value. + // If we return or save settings from 2nd/3rd page + // and the checkbox is unchecked, set the value to 0. + if ($this->request->is_set('step') && !$this->request->is_set($key)) + { + return 0; + } + + // If we switch to the checkbox type but former radio buttons value was 2, + // which is not the case for the checkbox, set it to 0 (unchecked). + if ($field_data['field_length'] == 2 && $current_value == 2) + { + return 0; + } + // If we switch to the radio buttons but the former checkbox value was 0, + // which is not the case for the radio buttons, set it to 0. + else if ($field_data['field_length'] == 1 && $current_value == 0) + { + return 2; + } + } + + if ($key == 'l_lang_options' && $this->request->is_set($key)) + { + $field_data[$key] = $this->request->variable($key, array(0 => array('')), true); + + return $current_value; + } + + return parent::get_excluded_options($key, $action, $current_value, $field_data, $step); + } + + /** + * {@inheritDoc} + */ + public function prepare_hidden_fields($step, $key, $action, &$field_data) + { + if ($key == 'field_default_value') + { + $field_length = $this->request->variable('field_length', 0); + + // Do a simple is set check if using checkbox. + if ($field_length == 2) + { + return $this->request->is_set($key); + } + return $this->request->variable($key, $field_data[$key], true); + } + + $default_lang_options = array( + 'l_lang_options' => array(0 => array('')), + 'lang_options' => array(0 => ''), + ); + + if (isset($default_lang_options[$key]) && $this->request->is_set($key)) + { + return $this->request->variable($key, $default_lang_options[$key], true); + } + + return parent::prepare_hidden_fields($step, $key, $action, $field_data); + } + + /** + * {@inheritDoc} + */ + public function display_options(&$template_vars, &$field_data) + { + // Initialize these array elements if we are creating a new field + if (!sizeof($field_data['lang_options'])) + { + // No options have been defined for a boolean field. + $field_data['lang_options'][0] = ''; + $field_data['lang_options'][1] = ''; + } + + $template_vars = array_merge($template_vars, array( + 'S_BOOL' => true, + 'L_LANG_OPTIONS_EXPLAIN' => $this->user->lang['BOOL_ENTRIES_EXPLAIN'], + 'FIRST_LANG_OPTION' => $field_data['lang_options'][0], + 'SECOND_LANG_OPTION' => $field_data['lang_options'][1], + )); + } +} diff --git a/sources/phpBB/phpbb/profilefields/type/type_date.php b/sources/phpBB/phpbb/profilefields/type/type_date.php new file mode 100644 index 0000000..90ac9a6 --- /dev/null +++ b/sources/phpBB/phpbb/profilefields/type/type_date.php @@ -0,0 +1,374 @@ + +* @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\profilefields\type; + +class type_date extends type_base +{ + /** + * Request object + * @var \phpbb\request\request + */ + protected $request; + + /** + * Template object + * @var \phpbb\template\template + */ + protected $template; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Construct + * + * @param \phpbb\request\request $request Request object + * @param \phpbb\template\template $template Template object + * @param \phpbb\user $user User object + */ + public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) + { + $this->request = $request; + $this->template = $template; + $this->user = $user; + } + + /** + * {@inheritDoc} + */ + public function get_name_short() + { + return 'date'; + } + + /** + * {@inheritDoc} + */ + public function get_options($default_lang_id, $field_data) + { + $profile_row = array( + 'var_name' => 'field_default_value', + 'lang_name' => $field_data['lang_name'], + 'lang_explain' => $field_data['lang_explain'], + 'lang_id' => $default_lang_id, + 'field_default_value' => $field_data['field_default_value'], + 'field_ident' => 'field_default_value', + 'field_type' => $this->get_service_name(), + 'field_length' => $field_data['field_length'], + 'lang_options' => $field_data['lang_options'], + ); + + $always_now = request_var('always_now', -1); + if ($always_now == -1) + { + $s_checked = ($field_data['field_default_value'] == 'now') ? true : false; + } + else + { + $s_checked = ($always_now) ? true : false; + } + + $options = array( + 0 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row)), + 1 => array('TITLE' => $this->user->lang['ALWAYS_TODAY'], 'FIELD' => ''), + ); + + return $options; + } + + /** + * {@inheritDoc} + */ + public function get_default_option_values() + { + return array( + 'field_length' => 10, + 'field_minlen' => 10, + 'field_maxlen' => 10, + 'field_validation' => '', + 'field_novalue' => ' 0- 0- 0', + 'field_default_value' => ' 0- 0- 0', + ); + } + + /** + * {@inheritDoc} + */ + public function get_default_field_value($field_data) + { + if ($field_data['field_default_value'] == 'now') + { + $now = getdate(); + $field_data['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']); + } + + return $field_data['field_default_value']; + } + + /** + * {@inheritDoc} + */ + public function get_profile_field($profile_row) + { + $var_name = 'pf_' . $profile_row['field_ident']; + + if (!$this->request->is_set($var_name . '_day')) + { + if ($profile_row['field_default_value'] == 'now') + { + $now = getdate(); + $profile_row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']); + } + list($day, $month, $year) = explode('-', $profile_row['field_default_value']); + } + else + { + $day = $this->request->variable($var_name . '_day', 0); + $month = $this->request->variable($var_name . '_month', 0); + $year = $this->request->variable($var_name . '_year', 0); + } + + return sprintf('%2d-%2d-%4d', $day, $month, $year); + } + + /** + * {@inheritDoc} + */ + public function validate_profile_field(&$field_value, $field_data) + { + $field_validate = explode('-', $field_value); + + $day = (isset($field_validate[0])) ? (int) $field_validate[0] : 0; + $month = (isset($field_validate[1])) ? (int) $field_validate[1] : 0; + $year = (isset($field_validate[2])) ? (int) $field_validate[2] : 0; + + if ((!$day || !$month || !$year) && !$field_data['field_required']) + { + return false; + } + + if ((!$day || !$month || !$year) && $field_data['field_required']) + { + return $this->user->lang('FIELD_REQUIRED', $this->get_field_name($field_data['lang_name'])); + } + + if ($day < 0 || $day > 31 || $month < 0 || $month > 12 || ($year < 1901 && $year > 0) || $year > gmdate('Y', time()) + 50) + { + return $this->user->lang('FIELD_INVALID_DATE', $this->get_field_name($field_data['lang_name'])); + } + + if (checkdate($month, $day, $year) === false) + { + return $this->user->lang('FIELD_INVALID_DATE', $this->get_field_name($field_data['lang_name'])); + } + + return false; + } + + /** + * {@inheritDoc} + */ + public function get_profile_value($field_value, $field_data) + { + $date = explode('-', $field_value); + $day = (isset($date[0])) ? (int) $date[0] : 0; + $month = (isset($date[1])) ? (int) $date[1] : 0; + $year = (isset($date[2])) ? (int) $date[2] : 0; + + if (!$day && !$month && !$year && !$field_data['field_show_novalue']) + { + return null; + } + else if ($day && $month && $year) + { + // Date should display as the same date for every user regardless of timezone + return $this->user->create_datetime() + ->setDate($year, $month, $day) + ->setTime(0, 0, 0) + ->format($this->user->lang['DATE_FORMAT'], true); + } + + return $field_value; + } + + /** + * {@inheritDoc} + */ + public function get_profile_value_raw($field_value, $field_data) + { + if (($field_value === '' || $field_value === null) && !$field_data['field_show_novalue']) + { + return null; + } + + return $field_value; + } + + /** + * {@inheritDoc} + */ + public function generate_field($profile_row, $preview_options = false) + { + $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident']; + $field_ident = $profile_row['field_ident']; + + $now = getdate(); + + if (!$this->request->is_set($profile_row['field_ident'] . '_day')) + { + if ($profile_row['field_default_value'] == 'now') + { + $profile_row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']); + } + list($day, $month, $year) = explode('-', ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $profile_row['field_default_value'] : $this->user->profile_fields[$field_ident])); + } + else + { + if ($preview_options !== false && $profile_row['field_default_value'] == 'now') + { + $profile_row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']); + list($day, $month, $year) = explode('-', ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $profile_row['field_default_value'] : $this->user->profile_fields[$field_ident])); + } + else + { + $day = $this->request->variable($profile_row['field_ident'] . '_day', 0); + $month = $this->request->variable($profile_row['field_ident'] . '_month', 0); + $year = $this->request->variable($profile_row['field_ident'] . '_year', 0); + } + } + + $profile_row['s_day_options'] = ''; + for ($i = 1; $i < 32; $i++) + { + $profile_row['s_day_options'] .= '"; + } + + $profile_row['s_month_options'] = ''; + for ($i = 1; $i < 13; $i++) + { + $profile_row['s_month_options'] .= '"; + } + + $profile_row['s_year_options'] = ''; + for ($i = $now['year'] - 100; $i <= $now['year'] + 100; $i++) + { + $profile_row['s_year_options'] .= '"; + } + + $profile_row['field_value'] = 0; + $this->template->assign_block_vars('date', array_change_key_case($profile_row, CASE_UPPER)); + } + + /** + * {@inheritDoc} + */ + public function get_field_ident($field_data) + { + return ''; + } + + /** + * {@inheritDoc} + */ + public function get_database_column_type() + { + return 'VCHAR:10'; + } + + /** + * {@inheritDoc} + */ + public function get_language_options($field_data) + { + $options = array( + 'lang_name' => 'string', + ); + + if ($field_data['lang_explain']) + { + $options['lang_explain'] = 'text'; + } + + return $options; + } + + /** + * {@inheritDoc} + */ + public function get_excluded_options($key, $action, $current_value, &$field_data, $step) + { + if ($step == 2 && $key == 'field_default_value') + { + $always_now = $this->request->variable('always_now', -1); + + if ($always_now == 1 || ($always_now === -1 && $current_value == 'now')) + { + $now = getdate(); + + $field_data['field_default_value_day'] = $now['mday']; + $field_data['field_default_value_month'] = $now['mon']; + $field_data['field_default_value_year'] = $now['year']; + $current_value = 'now'; + $this->request->overwrite('field_default_value', $current_value, \phpbb\request\request_interface::POST); + } + else + { + if ($this->request->is_set('field_default_value_day')) + { + $field_data['field_default_value_day'] = $this->request->variable('field_default_value_day', 0); + $field_data['field_default_value_month'] = $this->request->variable('field_default_value_month', 0); + $field_data['field_default_value_year'] = $this->request->variable('field_default_value_year', 0); + $current_value = sprintf('%2d-%2d-%4d', $field_data['field_default_value_day'], $field_data['field_default_value_month'], $field_data['field_default_value_year']); + $this->request->overwrite('field_default_value', $current_value, \phpbb\request\request_interface::POST); + } + else + { + list($field_data['field_default_value_day'], $field_data['field_default_value_month'], $field_data['field_default_value_year']) = explode('-', $current_value); + } + } + + return $current_value; + } + + return parent::get_excluded_options($key, $action, $current_value, $field_data, $step); + } + + /** + * {@inheritDoc} + */ + public function prepare_hidden_fields($step, $key, $action, &$field_data) + { + if ($key == 'field_default_value') + { + $always_now = $this->request->variable('always_now', 0); + + if ($always_now) + { + return 'now'; + } + else if ($this->request->is_set('field_default_value_day')) + { + $field_data['field_default_value_day'] = $this->request->variable('field_default_value_day', 0); + $field_data['field_default_value_month'] = $this->request->variable('field_default_value_month', 0); + $field_data['field_default_value_year'] = $this->request->variable('field_default_value_year', 0); + return sprintf('%2d-%2d-%4d', $field_data['field_default_value_day'], $field_data['field_default_value_month'], $field_data['field_default_value_year']); + } + } + + return parent::prepare_hidden_fields($step, $key, $action, $field_data); + } +} diff --git a/sources/phpBB/phpbb/profilefields/type/type_dropdown.php b/sources/phpBB/phpbb/profilefields/type/type_dropdown.php new file mode 100644 index 0000000..17ae89e --- /dev/null +++ b/sources/phpBB/phpbb/profilefields/type/type_dropdown.php @@ -0,0 +1,325 @@ + +* @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\profilefields\type; + +class type_dropdown extends type_base +{ + /** + * Profile fields language helper + * @var \phpbb\profilefields\lang_helper + */ + protected $lang_helper; + + /** + * Request object + * @var \phpbb\request\request + */ + protected $request; + + /** + * Template object + * @var \phpbb\template\template + */ + protected $template; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Construct + * + * @param \phpbb\profilefields\lang_helper $lang_helper Profile fields language helper + * @param \phpbb\request\request $request Request object + * @param \phpbb\template\template $template Template object + * @param \phpbb\user $user User object + */ + public function __construct(\phpbb\profilefields\lang_helper $lang_helper, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) + { + $this->lang_helper = $lang_helper; + $this->request = $request; + $this->template = $template; + $this->user = $user; + } + + /** + * {@inheritDoc} + */ + public function get_name_short() + { + return 'dropdown'; + } + + /** + * {@inheritDoc} + */ + public function get_options($default_lang_id, $field_data) + { + $profile_row[0] = array( + 'var_name' => 'field_default_value', + 'field_id' => 1, + 'lang_name' => $field_data['lang_name'], + 'lang_explain' => $field_data['lang_explain'], + 'lang_id' => $default_lang_id, + 'field_default_value' => $field_data['field_default_value'], + 'field_ident' => 'field_default_value', + 'field_type' => $this->get_service_name(), + 'lang_options' => $field_data['lang_options'], + ); + + $profile_row[1] = $profile_row[0]; + $profile_row[1]['var_name'] = 'field_novalue'; + $profile_row[1]['field_ident'] = 'field_novalue'; + $profile_row[1]['field_default_value'] = $field_data['field_novalue']; + + $options = array( + 0 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row[0])), + 1 => array('TITLE' => $this->user->lang['NO_VALUE_OPTION'], 'EXPLAIN' => $this->user->lang['NO_VALUE_OPTION_EXPLAIN'], 'FIELD' => $this->process_field_row('preview', $profile_row[1])), + ); + + return $options; + } + + /** + * {@inheritDoc} + */ + public function get_default_option_values() + { + return array( + 'field_length' => 0, + 'field_minlen' => 0, + 'field_maxlen' => 5, + 'field_validation' => '', + 'field_novalue' => 0, + 'field_default_value' => 0, + ); + } + + /** + * {@inheritDoc} + */ + public function get_default_field_value($field_data) + { + return $field_data['field_default_value']; + } + + /** + * {@inheritDoc} + */ + public function get_profile_field($profile_row) + { + $var_name = 'pf_' . $profile_row['field_ident']; + return $this->request->variable($var_name, (int) $profile_row['field_default_value']); + } + + /** + * {@inheritDoc} + */ + public function validate_profile_field(&$field_value, $field_data) + { + $field_value = (int) $field_value; + + // retrieve option lang data if necessary + if (!$this->lang_helper->is_set($field_data['field_id'], $field_data['lang_id'], 1)) + { + $this->lang_helper->load_option_lang($field_data['lang_id']); + } + + if (!$this->lang_helper->is_set($field_data['field_id'], $field_data['lang_id'], $field_value)) + { + return $this->user->lang('FIELD_INVALID_VALUE', $this->get_field_name($field_data['lang_name'])); + } + + if ($field_value == $field_data['field_novalue'] && $field_data['field_required']) + { + return $this->user->lang('FIELD_REQUIRED', $this->get_field_name($field_data['lang_name'])); + } + + return false; + } + + /** + * {@inheritDoc} + */ + public function get_profile_value($field_value, $field_data) + { + $field_id = $field_data['field_id']; + $lang_id = $field_data['lang_id']; + if (!$this->lang_helper->is_set($field_id, $lang_id)) + { + $this->lang_helper->load_option_lang($lang_id); + } + + if ($field_value == $field_data['field_novalue'] && !$field_data['field_show_novalue']) + { + return null; + } + + $field_value = (int) $field_value; + + // User not having a value assigned + if (!$this->lang_helper->is_set($field_id, $lang_id, $field_value)) + { + if ($field_data['field_show_novalue']) + { + $field_value = $field_data['field_novalue']; + } + else + { + return null; + } + } + + return $this->lang_helper->get($field_id, $lang_id, $field_value); + } + + /** + * {@inheritDoc} + */ + public function get_profile_value_raw($field_value, $field_data) + { + if ($field_value == $field_data['field_novalue'] && !$field_data['field_show_novalue']) + { + return null; + } + + if (!$field_value && $field_data['field_show_novalue']) + { + $field_value = $field_data['field_novalue']; + } + + return $field_value; + } + + /** + * {@inheritDoc} + */ + public function generate_field($profile_row, $preview_options = false) + { + $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident']; + $field_ident = $profile_row['field_ident']; + $default_value = $profile_row['field_default_value']; + + $value = ($this->request->is_set($field_ident)) ? $this->request->variable($field_ident, $default_value) : ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $default_value : $this->user->profile_fields[$field_ident]); + + if (!$this->lang_helper->is_set($profile_row['field_id'], $profile_row['lang_id'], 1)) + { + if ($preview_options) + { + $this->lang_helper->load_preview_options($profile_row['field_id'], $profile_row['lang_id'], $preview_options); + } + else + { + $this->lang_helper->load_option_lang($profile_row['lang_id']); + } + } + + $profile_row['field_value'] = (int) $value; + $this->template->assign_block_vars('dropdown', array_change_key_case($profile_row, CASE_UPPER)); + + $options = $this->lang_helper->get($profile_row['field_id'], $profile_row['lang_id']); + foreach ($options as $option_id => $option_value) + { + $this->template->assign_block_vars('dropdown.options', array( + 'OPTION_ID' => $option_id, + 'SELECTED' => ($value == $option_id) ? ' selected="selected"' : '', + 'VALUE' => $option_value, + )); + } + } + + /** + * {@inheritDoc} + */ + public function get_database_column_type() + { + return 'UINT'; + } + + /** + * {@inheritDoc} + */ + public function get_language_options($field_data) + { + $options = array( + 'lang_name' => 'string', + 'lang_options' => 'optionfield', + ); + + if ($field_data['lang_explain']) + { + $options['lang_explain'] = 'text'; + } + + return $options; + } + + /** + * {@inheritDoc} + */ + public function prepare_options_form(&$exclude_options, &$visibility_options) + { + $exclude_options[1][] = 'lang_options'; + + return $this->request->variable('lang_options', '', true); + } + + /** + * {@inheritDoc} + */ + public function validate_options_on_submit($error, $field_data) + { + if (!sizeof($field_data['lang_options'])) + { + $error[] = $this->user->lang['NO_FIELD_ENTRIES']; + } + + return $error; + } + + /** + * {@inheritDoc} + */ + public function get_excluded_options($key, $action, $current_value, &$field_data, $step) + { + if ($step == 2 && $key == 'field_maxlen') + { + // Get the number of options if this key is 'field_maxlen' + return sizeof(explode("\n", $this->request->variable('lang_options', '', true))); + } + + return parent::get_excluded_options($key, $action, $current_value, $field_data, $step); + } + + /** + * {@inheritDoc} + */ + public function display_options(&$template_vars, &$field_data) + { + // Initialize these array elements if we are creating a new field + if (!sizeof($field_data['lang_options'])) + { + // No options have been defined for the dropdown menu + $field_data['lang_options'] = array(); + } + + $template_vars = array_merge($template_vars, array( + 'S_DROPDOWN' => true, + 'L_LANG_OPTIONS_EXPLAIN' => $this->user->lang['DROPDOWN_ENTRIES_EXPLAIN'], + 'LANG_OPTIONS' => implode("\n", $field_data['lang_options']), + )); + } +} diff --git a/sources/phpBB/phpbb/profilefields/type/type_googleplus.php b/sources/phpBB/phpbb/profilefields/type/type_googleplus.php new file mode 100644 index 0000000..e6729b1 --- /dev/null +++ b/sources/phpBB/phpbb/profilefields/type/type_googleplus.php @@ -0,0 +1,66 @@ + +* @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\profilefields\type; + +class type_googleplus extends type_string +{ + /** + * {@inheritDoc} + */ + public function get_name() + { + return $this->user->lang('FIELD_GOOGLEPLUS'); + } + + /** + * {@inheritDoc} + */ + public function get_service_name() + { + return 'profilefields.type.googleplus'; + } + + /** + * {@inheritDoc} + */ + public function get_default_option_values() + { + return array( + 'field_length' => 20, + 'field_minlen' => 3, + 'field_maxlen' => 255, + 'field_validation' => '(?:(?!\.{2,})([^<>=+]))+', + 'field_novalue' => '', + 'field_default_value' => '', + ); + } + + /** + * {@inheritDoc} + */ + public function get_profile_contact_value($field_value, $field_data) + { + if (!$field_value && !$field_data['field_show_novalue']) + { + return null; + } + + if (!is_numeric($field_value)) + { + $field_value = '+' . $field_value; + } + + return $field_value; + } +} diff --git a/sources/phpBB/phpbb/profilefields/type/type_int.php b/sources/phpBB/phpbb/profilefields/type/type_int.php new file mode 100644 index 0000000..dd08df9 --- /dev/null +++ b/sources/phpBB/phpbb/profilefields/type/type_int.php @@ -0,0 +1,249 @@ + +* @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\profilefields\type; + +class type_int extends type_base +{ + /** + * Request object + * @var \phpbb\request\request + */ + protected $request; + + /** + * Template object + * @var \phpbb\template\template + */ + protected $template; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Construct + * + * @param \phpbb\request\request $request Request object + * @param \phpbb\template\template $template Template object + * @param \phpbb\user $user User object + */ + public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) + { + $this->request = $request; + $this->template = $template; + $this->user = $user; + } + + /** + * {@inheritDoc} + */ + public function get_name_short() + { + return 'int'; + } + + /** + * {@inheritDoc} + */ + public function get_options($default_lang_id, $field_data) + { + $options = array( + 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => ''), + 1 => array('TITLE' => $this->user->lang['MIN_FIELD_NUMBER'], 'FIELD' => ''), + 2 => array('TITLE' => $this->user->lang['MAX_FIELD_NUMBER'], 'FIELD' => ''), + 3 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => ''), + ); + + return $options; + } + + /** + * {@inheritDoc} + */ + public function get_default_option_values() + { + return array( + 'field_length' => 5, + 'field_minlen' => 0, + 'field_maxlen' => 100, + 'field_validation' => '', + 'field_novalue' => 0, + 'field_default_value' => 0, + ); + } + + /** + * {@inheritDoc} + */ + public function get_default_field_value($field_data) + { + if ($field_data['field_default_value'] === '') + { + // We cannot insert an empty string into an integer column. + return null; + } + + return $field_data['field_default_value']; + } + + /** + * {@inheritDoc} + */ + public function get_profile_field($profile_row) + { + $var_name = 'pf_' . $profile_row['field_ident']; + if ($this->request->is_set($var_name) && $this->request->variable($var_name, '') === '') + { + return null; + } + else + { + return $this->request->variable($var_name, (int) $profile_row['field_default_value']); + } + } + + /** + * {@inheritDoc} + */ + public function validate_profile_field(&$field_value, $field_data) + { + if (trim($field_value) === '' && !$field_data['field_required']) + { + return false; + } + + $field_value = (int) $field_value; + + if ($field_value < $field_data['field_minlen']) + { + return $this->user->lang('FIELD_TOO_SMALL', (int) $field_data['field_minlen'], $this->get_field_name($field_data['lang_name'])); + } + else if ($field_value > $field_data['field_maxlen']) + { + return $this->user->lang('FIELD_TOO_LARGE', (int) $field_data['field_maxlen'], $this->get_field_name($field_data['lang_name'])); + } + + return false; + } + + /** + * {@inheritDoc} + */ + public function get_profile_value($field_value, $field_data) + { + if (($field_value === '' || $field_value === null) && !$field_data['field_show_novalue']) + { + return null; + } + return (int) $field_value; + } + + /** + * {@inheritDoc} + */ + public function get_profile_value_raw($field_value, $field_data) + { + if (($field_value === '' || $field_value === null) && !$field_data['field_show_novalue']) + { + return null; + } + return (int) $field_value; + } + + /** + * {@inheritDoc} + */ + public function generate_field($profile_row, $preview_options = false) + { + $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident']; + $field_ident = $profile_row['field_ident']; + $default_value = $profile_row['field_default_value']; + + if ($this->request->is_set($field_ident)) + { + $value = ($this->request->variable($field_ident, '') === '') ? null : $this->request->variable($field_ident, $default_value); + } + else + { + if ($preview_options === false && array_key_exists($field_ident, $this->user->profile_fields) && is_null($this->user->profile_fields[$field_ident])) + { + $value = null; + } + else if (!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) + { + $value = $default_value; + } + else + { + $value = $this->user->profile_fields[$field_ident]; + } + } + + $profile_row['field_value'] = (is_null($value) || $value === '') ? '' : (int) $value; + + $this->template->assign_block_vars('int', array_change_key_case($profile_row, CASE_UPPER)); + } + + /** + * {@inheritDoc} + */ + public function get_field_ident($field_data) + { + return 'pf_' . $field_data['field_ident']; + } + + /** + * {@inheritDoc} + */ + public function get_database_column_type() + { + return 'BINT'; + } + + /** + * {@inheritDoc} + */ + public function get_language_options($field_data) + { + $options = array( + 'lang_name' => 'string', + ); + + if ($field_data['lang_explain']) + { + $options['lang_explain'] = 'text'; + } + + return $options; + } + + /** + * {@inheritDoc} + */ + public function get_excluded_options($key, $action, $current_value, &$field_data, $step) + { + if ($step == 2 && $key == 'field_default_value') + { + // Permit an empty string + if ($action == 'create' && $this->request->variable('field_default_value', '') === '') + { + return ''; + } + } + + return parent::get_excluded_options($key, $action, $current_value, $field_data, $step); + } +} diff --git a/sources/phpBB/phpbb/profilefields/type/type_interface.php b/sources/phpBB/phpbb/profilefields/type/type_interface.php new file mode 100644 index 0000000..ec770f9 --- /dev/null +++ b/sources/phpBB/phpbb/profilefields/type/type_interface.php @@ -0,0 +1,218 @@ + +* @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\profilefields\type; + +interface type_interface +{ + /** + * Get the translated name of the type + * + * @return string Translated name of the field type + */ + public function get_name(); + + /** + * Get the short name of the type, used for error messages and template loops + * + * @return string lowercase version of the fields type + */ + public function get_name_short(); + + /** + * Get the name of service representing the type + * + * @return string lowercase version of the fields type + */ + public function get_service_name(); + + /** + * Get the name of template file for this type + * + * @return string Returns the name of the template file + */ + public function get_template_filename(); + + /** + * Get dropdown options for second step in ACP + * + * @param string $default_lang_id ID of the default language + * @param array $field_data Array with data for this field + * @return array with the acp options + */ + public function get_options($default_lang_id, $field_data); + + /** + * Get default values for the options of this type + * + * @return array with values like default field size and more + */ + public function get_default_option_values(); + + /** + * Get default value for this type + * + * @param array $field_data Array with data for this field + * @return mixed default value for new users when no value is given + */ + public function get_default_field_value($field_data); + + /** + * Get profile field value on submit + * + * @param array $profile_row Array with data for this field + * @return mixed Submitted value of the profile field + */ + public function get_profile_field($profile_row); + + /** + * Validate entered profile field data + * + * @param mixed $field_value Field value to validate + * @param array $field_data Array with requirements of the field + * @return mixed String with the error message + */ + public function validate_profile_field(&$field_value, $field_data); + + /** + * Get Profile Value for display + * + * @param mixed $field_value Field value as stored in the database + * @param array $field_data Array with requirements of the field + * @return mixed Field value to display + */ + public function get_profile_value($field_value, $field_data); + + /** + * Get Profile Value ID for display (the raw, unprocessed user data) + * + * @param mixed $field_value Field value as stored in the database + * @param array $field_data Array with requirements of the field + * @return mixed Field value ID to display + */ + public function get_profile_value_raw($field_value, $field_data); + + /** + * Get Profile Value for display + * + * When displaying a contact field, we don't want to have links already parsed and more + * + * @param mixed $field_value Field value as stored in the database + * @param array $field_data Array with requirements of the field + * @return mixed Field value to display + */ + public function get_profile_contact_value($field_value, $field_data); + + /** + * Generate the input field for display + * + * @param array $profile_row Array with data for this field + * @param mixed $preview_options When previewing we use different data + * @return null + */ + public function generate_field($profile_row, $preview_options = false); + + /** + * Get the ident of the field + * + * Some types are multivalue, we can't give them a field_id + * as we would not know which to pick. + * + * @param array $field_data Array with data for this field + * @return string ident of the field + */ + public function get_field_ident($field_data); + + /** + * Get the column type for the database + * + * @return string Returns the database column type + */ + public function get_database_column_type(); + + /** + * Get the options we need to display for the language input fields in the ACP + * + * @param array $field_data Array with data for this field + * @return array Returns the language options we need to generate + */ + public function get_language_options($field_data); + + /** + * Get the input for the supplied language options + * + * @param array $field_data Array with data for this field + * @return array Returns the language options we need to generate + */ + public function get_language_options_input($field_data); + + /** + * Allows exclusion of options in single steps of the creation process + * + * @param array $exclude_options Array with options that should be excluded in the steps + * @param array $visibility_options Array with options responsible for the fields visibility + * @return mixed Returns the provided language options + */ + public function prepare_options_form(&$exclude_options, &$visibility_options); + + /** + * Allows exclusion of options in single steps of the creation process + * + * @param array $error Array with error messages + * @param array $field_data Array with data for this field + * @return array Array with error messages + */ + public function validate_options_on_submit($error, $field_data); + + /** + * Allows manipulating the intended variables if needed + * + * @param string $key Name of the option + * @param string $action Currently performed action (create|edit) + * @param mixed $current_value Currently value of the option + * @param array $field_data Array with data for this field + * @param int $step Step on which the option is excluded + * @return mixed Final value of the option + */ + public function get_excluded_options($key, $action, $current_value, &$field_data, $step); + + /** + * Allows manipulating the intended variables if needed + * + * @param int $step Step on which the option is hidden + * @param string $key Name of the option + * @param string $action Currently performed action (create|edit) + * @param array $field_data Array with data for this field + * @return mixed Final value of the option + */ + public function prepare_hidden_fields($step, $key, $action, &$field_data); + + /** + * Allows assigning of additional template variables + * + * @param array $template_vars Template variables we are going to assign + * @param array $field_data Array with data for this field + * @return null + */ + public function display_options(&$template_vars, &$field_data); + + /** + * Return templated value/field. Possible values for $mode are: + * change == user is able to set/enter profile values; preview == just show the value + * + * @param string $mode Mode for displaying the field (preview|change) + * @param array $profile_row Array with data for this field + * @return null + */ + public function process_field_row($mode, $profile_row); +} diff --git a/sources/phpBB/phpbb/profilefields/type/type_string.php b/sources/phpBB/phpbb/profilefields/type/type_string.php new file mode 100644 index 0000000..67befc4 --- /dev/null +++ b/sources/phpBB/phpbb/profilefields/type/type_string.php @@ -0,0 +1,159 @@ + +* @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\profilefields\type; + +class type_string extends type_string_common +{ + /** + * Request object + * @var \phpbb\request\request + */ + protected $request; + + /** + * Template object + * @var \phpbb\template\template + */ + protected $template; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Construct + * + * @param \phpbb\request\request $request Request object + * @param \phpbb\template\template $template Template object + * @param \phpbb\user $user User object + */ + public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) + { + $this->request = $request; + $this->template = $template; + $this->user = $user; + } + + /** + * {@inheritDoc} + */ + public function get_name_short() + { + return 'string'; + } + + /** + * {@inheritDoc} + */ + public function get_options($default_lang_id, $field_data) + { + $options = array( + 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => ''), + 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => ''), + 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => ''), + 3 => array('TITLE' => $this->user->lang['FIELD_VALIDATION'], 'FIELD' => ''), + ); + + return $options; + } + + /** + * {@inheritDoc} + */ + public function get_default_option_values() + { + return array( + 'field_length' => 10, + 'field_minlen' => 0, + 'field_maxlen' => 20, + 'field_validation' => '.*', + 'field_novalue' => '', + 'field_default_value' => '', + ); + } + + /** + * {@inheritDoc} + */ + public function get_profile_field($profile_row) + { + $var_name = 'pf_' . $profile_row['field_ident']; + return $this->request->variable($var_name, (string) $profile_row['field_default_value'], true); + } + + /** + * {@inheritDoc} + */ + public function validate_profile_field(&$field_value, $field_data) + { + return $this->validate_string_profile_field('string', $field_value, $field_data); + } + + /** + * {@inheritDoc} + */ + public function generate_field($profile_row, $preview_options = false) + { + $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident']; + $field_ident = $profile_row['field_ident']; + $default_value = $profile_row['lang_default_value']; + $profile_row['field_value'] = ($this->request->is_set($field_ident)) ? $this->request->variable($field_ident, $default_value, true) : ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $default_value : $this->user->profile_fields[$field_ident]); + + $this->template->assign_block_vars($this->get_name_short(), array_change_key_case($profile_row, CASE_UPPER)); + } + + /** + * {@inheritDoc} + */ + public function get_database_column_type() + { + return 'VCHAR'; + } + + /** + * {@inheritDoc} + */ + public function get_language_options($field_data) + { + $options = array( + 'lang_name' => 'string', + ); + + if ($field_data['lang_explain']) + { + $options['lang_explain'] = 'text'; + } + + if (strlen($field_data['lang_default_value'])) + { + $options['lang_default_value'] = 'string'; + } + + return $options; + } + + /** + * {@inheritDoc} + */ + public function display_options(&$template_vars, &$field_data) + { + $template_vars = array_merge($template_vars, array( + 'S_STRING' => true, + 'L_DEFAULT_VALUE_EXPLAIN' => $this->user->lang['STRING_DEFAULT_VALUE_EXPLAIN'], + 'LANG_DEFAULT_VALUE' => $field_data['lang_default_value'], + )); + } +} diff --git a/sources/phpBB/phpbb/profilefields/type/type_string_common.php b/sources/phpBB/phpbb/profilefields/type/type_string_common.php new file mode 100644 index 0000000..f5e1992 --- /dev/null +++ b/sources/phpBB/phpbb/profilefields/type/type_string_common.php @@ -0,0 +1,147 @@ + +* @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\profilefields\type; + +abstract class type_string_common extends type_base +{ + protected $validation_options = array( + 'CHARS_ANY' => '.*', + 'NUMBERS_ONLY' => '[0-9]+', + 'ALPHA_ONLY' => '[a-zA-Z0-9]+', + 'ALPHA_UNDERSCORE' => '[\w]+', + 'ALPHA_DOTS' => '[a-zA-Z0-9.]+', + 'ALPHA_SPACERS' => '[\w\x20+\-\[\]]+', + 'ALPHA_PUNCTUATION' => '[a-zA-Z][\w\.,\-]+', + 'LETTER_NUM_ONLY' => '[\p{Lu}\p{Ll}0-9]+', + 'LETTER_NUM_UNDERSCORE' => '[\p{Lu}\p{Ll}0-9_]+', + 'LETTER_NUM_DOTS' => '[\p{Lu}\p{Ll}0-9.]+', + 'LETTER_NUM_SPACERS' => '[\p{Lu}\p{Ll}0-9\x20_+\-\[\]]+', + 'LETTER_NUM_PUNCTUATION' => '[\p{Lu}\p{Ll}][\p{Lu}\p{Ll}0-9.,\-_]+', + ); + + /** + * Return possible validation options + */ + public function validate_options($field_data) + { + $validate_options = ''; + foreach ($this->validation_options as $lang => $value) + { + $selected = ($field_data['field_validation'] == $value) ? ' selected="selected"' : ''; + $validate_options .= ''; + } + + return $validate_options; + } + + /** + * {@inheritDoc} + */ + public function get_default_field_value($field_data) + { + return $field_data['lang_default_value']; + } + + /** + * Validate entered profile field data + * + * @param string $field_type Field type (string or text) + * @param mixed $field_value Field value to validate + * @param array $field_data Array with requirements of the field + * @return mixed String with key of the error language string, false otherwise + */ + public function validate_string_profile_field($field_type, &$field_value, $field_data) + { + if (trim($field_value) === '' && !$field_data['field_required']) + { + return false; + } + else if (trim($field_value) === '' && $field_data['field_required']) + { + return $this->user->lang('FIELD_REQUIRED', $this->get_field_name($field_data['lang_name'])); + } + + if ($field_data['field_minlen'] && utf8_strlen($field_value) < $field_data['field_minlen']) + { + return $this->user->lang('FIELD_TOO_SHORT', (int) $field_data['field_minlen'], $this->get_field_name($field_data['lang_name'])); + } + else if ($field_data['field_maxlen'] && utf8_strlen(html_entity_decode($field_value)) > $field_data['field_maxlen']) + { + return $this->user->lang('FIELD_TOO_LONG', (int) $field_data['field_maxlen'], $this->get_field_name($field_data['lang_name'])); + } + + if (!empty($field_data['field_validation']) && $field_data['field_validation'] != '.*') + { + $field_validate = ($field_type != 'text') ? $field_value : bbcode_nl2br($field_value); + if (!preg_match('#^' . str_replace('\\\\', '\\', $field_data['field_validation']) . '$#iu', $field_validate)) + { + $validation = array_search($field_data['field_validation'], $this->validation_options); + if ($validation) + { + return $this->user->lang('FIELD_INVALID_CHARS_' . $validation, $this->get_field_name($field_data['lang_name'])); + } + return $this->user->lang('FIELD_INVALID_CHARS_INVALID', $this->get_field_name($field_data['lang_name'])); + } + } + + return false; + } + + /** + * {@inheritDoc} + */ + public function get_profile_value($field_value, $field_data) + { + if (($field_value === null || $field_value === '') && !$field_data['field_show_novalue']) + { + return null; + } + + $field_value = make_clickable($field_value); + $field_value = censor_text($field_value); + $field_value = bbcode_nl2br($field_value); + return $field_value; + } + + /** + * {@inheritDoc} + */ + public function get_profile_value_raw($field_value, $field_data) + { + if (($field_value === null || $field_value === '') && !$field_data['field_show_novalue']) + { + return null; + } + + return $field_value; + } + + /** + * {@inheritDoc} + */ + public function get_profile_contact_value($field_value, $field_data) + { + return $this->get_profile_value_raw($field_value, $field_data); + } + + /** + * {@inheritDoc} + */ + public function prepare_options_form(&$exclude_options, &$visibility_options) + { + $exclude_options[1][] = 'lang_default_value'; + + return $this->request->variable('lang_options', '', true); + } +} diff --git a/sources/phpBB/phpbb/profilefields/type/type_text.php b/sources/phpBB/phpbb/profilefields/type/type_text.php new file mode 100644 index 0000000..bacf60a --- /dev/null +++ b/sources/phpBB/phpbb/profilefields/type/type_text.php @@ -0,0 +1,204 @@ + +* @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\profilefields\type; + +class type_text extends type_string_common +{ + /** + * Request object + * @var \phpbb\request\request + */ + protected $request; + + /** + * Template object + * @var \phpbb\template\template + */ + protected $template; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Construct + * + * @param \phpbb\request\request $request Request object + * @param \phpbb\template\template $template Template object + * @param \phpbb\user $user User object + */ + public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) + { + $this->request = $request; + $this->template = $template; + $this->user = $user; + } + + /** + * {@inheritDoc} + */ + public function get_name_short() + { + return 'text'; + } + + /** + * {@inheritDoc} + */ + public function get_options($default_lang_id, $field_data) + { + $options = array( + 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => ' ' . $this->user->lang['ROWS'] . '
' . $this->user->lang['COLUMNS'] . ' '), + 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => ''), + 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => ''), + 3 => array('TITLE' => $this->user->lang['FIELD_VALIDATION'], 'FIELD' => ''), + ); + + return $options; + } + + /** + * {@inheritDoc} + */ + public function get_default_option_values() + { + return array( + 'field_length' => '5|80', + 'field_minlen' => 0, + 'field_maxlen' => 1000, + 'field_validation' => '.*', + 'field_novalue' => '', + 'field_default_value' => '', + ); + } + + /** + * {@inheritDoc} + */ + public function get_profile_field($profile_row) + { + $var_name = 'pf_' . $profile_row['field_ident']; + return $this->request->variable($var_name, (string) $profile_row['field_default_value'], true); + } + + /** + * {@inheritDoc} + */ + public function validate_profile_field(&$field_value, $field_data) + { + return $this->validate_string_profile_field('text', $field_value, $field_data); + } + + /** + * {@inheritDoc} + */ + public function generate_field($profile_row, $preview_options = false) + { + $field_length = explode('|', $profile_row['field_length']); + $profile_row['field_rows'] = $field_length[0]; + $profile_row['field_cols'] = $field_length[1]; + $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident']; + $field_ident = $profile_row['field_ident']; + $default_value = $profile_row['lang_default_value']; + + $profile_row['field_value'] = ($this->request->is_set($field_ident)) ? $this->request->variable($field_ident, $default_value, true) : ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $default_value : $this->user->profile_fields[$field_ident]); + + $this->template->assign_block_vars('text', array_change_key_case($profile_row, CASE_UPPER)); + } + + /** + * {@inheritDoc} + */ + public function get_database_column_type() + { + return 'MTEXT'; + } + + /** + * {@inheritDoc} + */ + public function get_language_options($field_data) + { + $options = array( + 'lang_name' => 'string', + ); + + if ($field_data['lang_explain']) + { + $options['lang_explain'] = 'text'; + } + + if (strlen($field_data['lang_default_value'])) + { + $options['lang_default_value'] = 'text'; + } + + return $options; + } + + /** + * {@inheritDoc} + */ + public function get_excluded_options($key, $action, $current_value, &$field_data, $step) + { + if ($step == 2 && $key == 'field_length') + { + if ($this->request->is_set('rows')) + { + $field_data['rows'] = $this->request->variable('rows', 0); + $field_data['columns'] = $this->request->variable('columns', 0); + $current_value = $field_data['rows'] . '|' . $field_data['columns']; + } + else + { + $row_col = explode('|', $current_value); + $field_data['rows'] = $row_col[0]; + $field_data['columns'] = $row_col[1]; + } + + return $current_value; + } + + return parent::get_excluded_options($key, $action, $current_value, $field_data, $step); + } + + /** + * {@inheritDoc} + */ + public function prepare_hidden_fields($step, $key, $action, &$field_data) + { + if ($key == 'field_length' && $this->request->is_set('rows')) + { + $field_data['rows'] = $this->request->variable('rows', 0); + $field_data['columns'] = $this->request->variable('columns', 0); + return $field_data['rows'] . '|' . $field_data['columns']; + } + + return parent::prepare_hidden_fields($step, $key, $action, $field_data); + } + + /** + * {@inheritDoc} + */ + public function display_options(&$template_vars, &$field_data) + { + $template_vars = array_merge($template_vars, array( + 'S_TEXT' => true, + 'L_DEFAULT_VALUE_EXPLAIN' => $this->user->lang['TEXT_DEFAULT_VALUE_EXPLAIN'], + 'LANG_DEFAULT_VALUE' => $field_data['lang_default_value'], + )); + } +} diff --git a/sources/phpBB/phpbb/profilefields/type/type_url.php b/sources/phpBB/phpbb/profilefields/type/type_url.php new file mode 100644 index 0000000..fe0bffd --- /dev/null +++ b/sources/phpBB/phpbb/profilefields/type/type_url.php @@ -0,0 +1,74 @@ + +* @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\profilefields\type; + +class type_url extends type_string +{ + /** + * {@inheritDoc} + */ + public function get_name_short() + { + return 'url'; + } + + /** + * {@inheritDoc} + */ + public function get_options($default_lang_id, $field_data) + { + $options = array( + 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => ''), + 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => ''), + 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => ''), + ); + + return $options; + } + + /** + * {@inheritDoc} + */ + public function get_default_option_values() + { + return array( + 'field_length' => 40, + 'field_minlen' => 0, + 'field_maxlen' => 200, + 'field_validation' => '', + 'field_novalue' => '', + 'field_default_value' => '', + ); + } + + /** + * {@inheritDoc} + */ + public function validate_profile_field(&$field_value, $field_data) + { + $field_value = trim($field_value); + + if ($field_value === '' && !$field_data['field_required']) + { + return false; + } + + if (!preg_match('#^' . get_preg_expression('url') . '$#iu', $field_value)) + { + return $this->user->lang('FIELD_INVALID_URL', $this->get_field_name($field_data['lang_name'])); + } + + return false; + } +} diff --git a/sources/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php b/sources/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php new file mode 100644 index 0000000..2500ba0 --- /dev/null +++ b/sources/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php @@ -0,0 +1,30 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb; + +/** +* Class recursive_dot_prefix_filter_iterator +* +* This filter ignores directories starting with a dot. +* When searching for php classes and template files of extensions +* we don't need to look inside these directories. +*/ +class recursive_dot_prefix_filter_iterator extends \RecursiveFilterIterator +{ + public function accept() + { + $filename = $this->current()->getFilename(); + return !$this->current()->isDir() || $filename[0] !== '.'; + } +} diff --git a/sources/phpBB/phpbb/request/deactivated_super_global.php b/sources/phpBB/phpbb/request/deactivated_super_global.php new file mode 100644 index 0000000..b6cad59 --- /dev/null +++ b/sources/phpBB/phpbb/request/deactivated_super_global.php @@ -0,0 +1,116 @@ + +* @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\request; + +/** +* Replacement for a superglobal (like $_GET or $_POST) which calls +* trigger_error on all operations but isset, overloads the [] operator with SPL. +*/ +class deactivated_super_global implements \ArrayAccess, \Countable, \IteratorAggregate +{ + /** + * @var string Holds the name of the superglobal this is replacing. + */ + private $name; + + /** + * @var \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE Super global constant. + */ + private $super_global; + + /** + * @var \phpbb\request\request_interface The request class instance holding the actual request data. + */ + private $request; + + /** + * Constructor generates an error message fitting the super global to be used within the other functions. + * + * @param \phpbb\request\request_interface $request A request class instance holding the real super global data. + * @param string $name Name of the super global this is a replacement for - e.g. '_GET'. + * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global The variable's super global constant. + */ + public function __construct(\phpbb\request\request_interface $request, $name, $super_global) + { + $this->request = $request; + $this->name = $name; + $this->super_global = $super_global; + } + + /** + * Calls trigger_error with the file and line number the super global was used in. + */ + private function error() + { + $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.'; + + $backtrace = debug_backtrace(); + if (isset($backtrace[1])) + { + $file = $backtrace[1]['file']; + $line = $backtrace[1]['line']; + } + trigger_error(sprintf($message, $file, $line), E_USER_ERROR); + } + + /** + * Redirects isset to the correct request class call. + * + * @param string $offset The key of the super global being accessed. + * + * @return bool Whether the key on the super global exists. + */ + public function offsetExists($offset) + { + return $this->request->is_set($offset, $this->super_global); + } + + /**#@+ + * Part of the \ArrayAccess implementation, will always result in a FATAL error. + */ + public function offsetGet($offset) + { + $this->error(); + } + + public function offsetSet($offset, $value) + { + $this->error(); + } + + public function offsetUnset($offset) + { + $this->error(); + } + /**#@-*/ + + /** + * Part of the \Countable implementation, will always result in a FATAL error + */ + public function count() + { + $this->error(); + } + + /** + * Part of the Traversable/IteratorAggregate implementation, will always result in a FATAL error + */ + public function getIterator() + { + $this->error(); + } +} diff --git a/sources/phpBB/phpbb/request/request.php b/sources/phpBB/phpbb/request/request.php new file mode 100644 index 0000000..56ce399 --- /dev/null +++ b/sources/phpBB/phpbb/request/request.php @@ -0,0 +1,442 @@ + +* @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\request; + +/** +* All application input is accessed through this class. +* +* It provides a method to disable access to input data through super globals. +* This should force MOD authors to read about data validation. +*/ +class request implements \phpbb\request\request_interface +{ + /** + * @var array The names of super global variables that this class should protect if super globals are disabled. + */ + protected $super_globals = array( + \phpbb\request\request_interface::POST => '_POST', + \phpbb\request\request_interface::GET => '_GET', + \phpbb\request\request_interface::REQUEST => '_REQUEST', + \phpbb\request\request_interface::COOKIE => '_COOKIE', + \phpbb\request\request_interface::SERVER => '_SERVER', + \phpbb\request\request_interface::FILES => '_FILES', + ); + + /** + * @var array Stores original contents of $_REQUEST array. + */ + protected $original_request = null; + + /** + * @var + */ + protected $super_globals_disabled = false; + + /** + * @var array An associative array that has the value of super global constants as keys and holds their data as values. + */ + protected $input; + + /** + * @var \phpbb\request\type_cast_helper_interface An instance of a type cast helper providing convenience methods for type conversions. + */ + protected $type_cast_helper; + + /** + * Initialises the request class, that means it stores all input data in {@link $input input} + * and then calls {@link \phpbb\request\deactivated_super_global \phpbb\request\deactivated_super_global} + */ + public function __construct(\phpbb\request\type_cast_helper_interface $type_cast_helper = null, $disable_super_globals = true) + { + if ($type_cast_helper) + { + $this->type_cast_helper = $type_cast_helper; + } + else + { + $this->type_cast_helper = new \phpbb\request\type_cast_helper(); + } + + foreach ($this->super_globals as $const => $super_global) + { + $this->input[$const] = isset($GLOBALS[$super_global]) ? $GLOBALS[$super_global] : array(); + } + + // simulate request_order = GP + $this->original_request = $this->input[\phpbb\request\request_interface::REQUEST]; + $this->input[\phpbb\request\request_interface::REQUEST] = $this->input[\phpbb\request\request_interface::POST] + $this->input[\phpbb\request\request_interface::GET]; + + if ($disable_super_globals) + { + $this->disable_super_globals(); + } + } + + /** + * Getter for $super_globals_disabled + * + * @return bool Whether super globals are disabled or not. + */ + public function super_globals_disabled() + { + return $this->super_globals_disabled; + } + + /** + * Disables access of super globals specified in $super_globals. + * This is achieved by overwriting the super globals with instances of {@link \phpbb\request\deactivated_super_global \phpbb\request\deactivated_super_global} + */ + public function disable_super_globals() + { + if (!$this->super_globals_disabled) + { + foreach ($this->super_globals as $const => $super_global) + { + unset($GLOBALS[$super_global]); + $GLOBALS[$super_global] = new \phpbb\request\deactivated_super_global($this, $super_global, $const); + } + + $this->super_globals_disabled = true; + } + } + + /** + * Enables access of super globals specified in $super_globals if they were disabled by {@link disable_super_globals disable_super_globals}. + * This is achieved by making the super globals point to the data stored within this class in {@link $input input}. + */ + public function enable_super_globals() + { + if ($this->super_globals_disabled) + { + foreach ($this->super_globals as $const => $super_global) + { + $GLOBALS[$super_global] = $this->input[$const]; + } + + $GLOBALS['_REQUEST'] = $this->original_request; + + $this->super_globals_disabled = false; + } + } + + /** + * This function allows overwriting or setting a value in one of the super global arrays. + * + * Changes which are performed on the super globals directly will not have any effect on the results of + * other methods this class provides. Using this function should be avoided if possible! It will + * consume twice the the amount of memory of the value + * + * @param string $var_name The name of the variable that shall be overwritten + * @param mixed $value The value which the variable shall contain. + * If this is null the variable will be unset. + * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global + * Specifies which super global shall be changed + */ + public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST) + { + if (!isset($this->super_globals[$super_global])) + { + return; + } + + $this->type_cast_helper->add_magic_quotes($value); + + // setting to null means unsetting + if ($value === null) + { + unset($this->input[$super_global][$var_name]); + if (!$this->super_globals_disabled()) + { + unset($GLOBALS[$this->super_globals[$super_global]][$var_name]); + } + } + else + { + $this->input[$super_global][$var_name] = $value; + if (!$this->super_globals_disabled()) + { + $GLOBALS[$this->super_globals[$super_global]][$var_name] = $value; + } + } + + if (!$this->super_globals_disabled()) + { + unset($GLOBALS[$this->super_globals[$super_global]][$var_name]); + $GLOBALS[$this->super_globals[$super_global]][$var_name] = $value; + } + } + + /** + * Central type safe input handling function. + * All variables in GET or POST requests should be retrieved through this function to maximise security. + * + * @param string|array $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". + * @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 \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global + * Specifies which super global should be used + * + * @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. + */ + public function variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST) + { + return $this->_variable($var_name, $default, $multibyte, $super_global, true); + } + + /** + * Get a variable, but without trimming strings. + * Same functionality as variable(), except does not run trim() on strings. + * This method should be used when handling passwords. + * + * @param string|array $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". + * @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 \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global + * Specifies which super global should be used + * + * @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. + */ + public function untrimmed_variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST) + { + return $this->_variable($var_name, $default, $multibyte, $super_global, false); + } + + /** + * Shortcut method to retrieve SERVER variables. + * + * Also fall back to getenv(), some CGI setups may need it (probably not, but + * whatever). + * + * @param string|array $var_name See \phpbb\request\request_interface::variable + * @param mixed $Default See \phpbb\request\request_interface::variable + * + * @return mixed The server variable value. + */ + public function server($var_name, $default = '') + { + $multibyte = true; + + if ($this->is_set($var_name, \phpbb\request\request_interface::SERVER)) + { + return $this->variable($var_name, $default, $multibyte, \phpbb\request\request_interface::SERVER); + } + else + { + $var = getenv($var_name); + $this->type_cast_helper->recursive_set_var($var, $default, $multibyte); + return $var; + } + } + + /** + * Shortcut method to retrieve the value of client HTTP headers. + * + * @param string|array $header_name The name of the header to retrieve. + * @param mixed $default See \phpbb\request\request_interface::variable + * + * @return mixed The header value. + */ + public function header($header_name, $default = '') + { + $var_name = 'HTTP_' . str_replace('-', '_', strtoupper($header_name)); + return $this->server($var_name, $default); + } + + /** + * Shortcut method to retrieve $_FILES variables + * + * @param string $form_name The name of the file input form element + * + * @return array The uploaded file's information or an empty array if the + * variable does not exist in _FILES. + */ + public function file($form_name) + { + return $this->variable($form_name, array('name' => 'none'), true, \phpbb\request\request_interface::FILES); + } + + /** + * Checks whether a certain variable was sent via POST. + * To make sure that a request was sent using POST you should call this function + * on at least one variable. + * + * @param string $name The name of the form variable which should have a + * _p suffix to indicate the check in the code that creates the form too. + * + * @return bool True if the variable was set in a POST request, false otherwise. + */ + public function is_set_post($name) + { + return $this->is_set($name, \phpbb\request\request_interface::POST); + } + + /** + * Checks whether a certain variable is set in one of the super global + * arrays. + * + * @param string $var Name of the variable + * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global + * Specifies the super global which shall be checked + * + * @return bool True if the variable was sent as input + */ + public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST) + { + return isset($this->input[$super_global][$var]); + } + + /** + * Checks whether the current request is an AJAX request (XMLHttpRequest) + * + * @return bool True if the current request is an ajax request + */ + public function is_ajax() + { + return $this->header('X-Requested-With') == 'XMLHttpRequest'; + } + + /** + * Checks if the current request is happening over HTTPS. + * + * @return bool True if the request is secure. + */ + public function is_secure() + { + return $this->server('HTTPS') == 'on'; + } + + /** + * Returns all variable names for a given super global + * + * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global + * The super global from which names shall be taken + * + * @return array All variable names that are set for the super global. + * Pay attention when using these, they are unsanitised! + */ + public function variable_names($super_global = \phpbb\request\request_interface::REQUEST) + { + if (!isset($this->input[$super_global])) + { + return array(); + } + + return array_keys($this->input[$super_global]); + } + + /** + * Helper function used by variable() and untrimmed_variable(). + * + * @param string|array $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". + * @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 \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global + * Specifies which super global should be used + * @param bool $trim Indicates whether trim() should be applied to string values. + * + * @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. + */ + protected function _variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST, $trim = true) + { + $path = false; + + // deep direct access to multi dimensional arrays + if (is_array($var_name)) + { + $path = $var_name; + // make sure at least the variable name is specified + if (empty($path)) + { + return (is_array($default)) ? array() : $default; + } + // the variable name is the first element on the path + $var_name = array_shift($path); + } + + if (!isset($this->input[$super_global][$var_name])) + { + return (is_array($default)) ? array() : $default; + } + $var = $this->input[$super_global][$var_name]; + + if ($path) + { + // walk through the array structure and find the element we are looking for + foreach ($path as $key) + { + if (is_array($var) && isset($var[$key])) + { + $var = $var[$key]; + } + else + { + return (is_array($default)) ? array() : $default; + } + } + } + + $this->type_cast_helper->recursive_set_var($var, $default, $multibyte, $trim); + + return $var; + } + + /** + * {@inheritdoc} + */ + public function get_super_global($super_global = \phpbb\request\request_interface::REQUEST) + { + return $this->input[$super_global]; + } + + /** + * {@inheritdoc} + */ + public function escape($var, $multibyte) + { + if (is_array($var)) + { + $result = array(); + foreach ($var as $key => $value) + { + $this->type_cast_helper->set_var($key, $key, gettype($key), $multibyte); + $result[$key] = $this->escape($value, $multibyte); + } + $var = $result; + } + else + { + $this->type_cast_helper->set_var($var, $var, 'string', $multibyte); + } + + return $var; + } +} diff --git a/sources/phpBB/phpbb/request/request_interface.php b/sources/phpBB/phpbb/request/request_interface.php new file mode 100644 index 0000000..47b3b3a --- /dev/null +++ b/sources/phpBB/phpbb/request/request_interface.php @@ -0,0 +1,155 @@ + +* @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\request; + +/** +* An interface through which all application input can be accessed. +*/ +interface request_interface +{ + /**#@+ + * Constant identifying the super global with the same name. + */ + const POST = 0; + const GET = 1; + const REQUEST = 2; + const COOKIE = 3; + const SERVER = 4; + const FILES = 5; + /**#@-*/ + + /** + * This function allows overwriting or setting a value in one of the super global arrays. + * + * Changes which are performed on the super globals directly will not have any effect on the results of + * other methods this class provides. Using this function should be avoided if possible! It will + * consume twice the the amount of memory of the value + * + * @param string $var_name The name of the variable that shall be overwritten + * @param mixed $value The value which the variable shall contain. + * If this is null the variable will be unset. + * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global + * Specifies which super global shall be changed + */ + public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST); + + /** + * Central type safe input handling function. + * All variables in GET or POST requests should be retrieved through this function to maximise security. + * + * @param string|array $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". + * @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 \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global + * Specifies which super global should be used + * + * @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. + */ + public function variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST); + + /** + * Shortcut method to retrieve SERVER variables. + * + * @param string|array $var_name See \phpbb\request\request_interface::variable + * @param mixed $default See \phpbb\request\request_interface::variable + * + * @return mixed The server variable value. + */ + public function server($var_name, $default = ''); + + /** + * Shortcut method to retrieve the value of client HTTP headers. + * + * @param string|array $header_name The name of the header to retrieve. + * @param mixed $default See \phpbb\request\request_interface::variable + * + * @return mixed The header value. + */ + public function header($var_name, $default = ''); + + /** + * Checks whether a certain variable was sent via POST. + * To make sure that a request was sent using POST you should call this function + * on at least one variable. + * + * @param string $name The name of the form variable which should have a + * _p suffix to indicate the check in the code that creates the form too. + * + * @return bool True if the variable was set in a POST request, false otherwise. + */ + public function is_set_post($name); + + /** + * Checks whether a certain variable is set in one of the super global + * arrays. + * + * @param string $var Name of the variable + * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global + * Specifies the super global which shall be checked + * + * @return bool True if the variable was sent as input + */ + public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST); + + /** + * Checks whether the current request is an AJAX request (XMLHttpRequest) + * + * @return bool True if the current request is an ajax request + */ + public function is_ajax(); + + /** + * Checks if the current request is happening over HTTPS. + * + * @return bool True if the request is secure. + */ + public function is_secure(); + + /** + * Returns all variable names for a given super global + * + * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global + * The super global from which names shall be taken + * + * @return array All variable names that are set for the super global. + * Pay attention when using these, they are unsanitised! + */ + public function variable_names($super_global = \phpbb\request\request_interface::REQUEST); + + /** + * Returns the original array of the requested super global + * + * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global + * The super global which will be returned + * + * @return array The original array of the requested super global. + */ + public function get_super_global($super_global = \phpbb\request\request_interface::REQUEST); + + /** + * Escape a string variable. + * + * @param mixed $value The contents to fill with + * @param bool $multibyte Indicates whether string values may contain UTF-8 characters. + * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks. + * @return string|array + */ + public function escape($value, $multibyte); +} diff --git a/sources/phpBB/phpbb/request/type_cast_helper.php b/sources/phpBB/phpbb/request/type_cast_helper.php new file mode 100644 index 0000000..bc654e6 --- /dev/null +++ b/sources/phpBB/phpbb/request/type_cast_helper.php @@ -0,0 +1,190 @@ + +* @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\request; + +/** +* A helper class that provides convenience methods for type casting. +*/ +class type_cast_helper implements \phpbb\request\type_cast_helper_interface +{ + + /** + * @var string Whether slashes need to be stripped from input + */ + protected $strip; + + /** + * Initialises the type cast helper class. + * All it does is find out whether magic quotes are turned on. + */ + public function __construct() + { + if (version_compare(PHP_VERSION, '5.4.0-dev', '>=')) + { + $this->strip = false; + } + else + { + $this->strip = (@get_magic_quotes_gpc()) ? true : false; + } + } + + /** + * Recursively applies addslashes to a variable. + * + * @param mixed &$var Variable passed by reference to which slashes will be added. + */ + public function addslashes_recursively(&$var) + { + if (is_string($var)) + { + $var = addslashes($var); + } + else if (is_array($var)) + { + $var_copy = $var; + $var = array(); + foreach ($var_copy as $key => $value) + { + if (is_string($key)) + { + $key = addslashes($key); + } + $var[$key] = $value; + + $this->addslashes_recursively($var[$key]); + } + } + } + + /** + * Recursively applies addslashes to a variable if magic quotes are turned on. + * + * @param mixed &$var Variable passed by reference to which slashes will be added. + */ + public function add_magic_quotes(&$var) + { + if ($this->strip) + { + $this->addslashes_recursively($var); + } + } + + /** + * Set variable $result to a particular type. + * + * @param mixed &$result The variable to fill + * @param mixed $var The contents to fill with + * @param mixed $type The variable type. Will be used with {@link settype()} + * @param bool $multibyte Indicates whether string values may contain UTF-8 characters. + * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks. + * @param bool $trim Indicates whether trim() should be applied to string values. + * Default is true. + */ + public function set_var(&$result, $var, $type, $multibyte = false, $trim = true) + { + settype($var, $type); + $result = $var; + + if ($type == 'string') + { + $result = str_replace(array("\r\n", "\r", "\0"), array("\n", "\n", ''), $result); + + if ($trim) + { + $result = trim($result); + } + + $result = htmlspecialchars($result, ENT_COMPAT, 'UTF-8'); + + if ($multibyte) + { + $result = utf8_normalize_nfc($result); + } + + if (!empty($result)) + { + // Make sure multibyte characters are wellformed + if ($multibyte) + { + if (!preg_match('/^./u', $result)) + { + $result = ''; + } + } + else + { + // no multibyte, allow only ASCII (0-127) + $result = preg_replace('/[\x80-\xFF]/', '?', $result); + } + } + + $result = ($this->strip) ? stripslashes($result) : $result; + } + } + + /** + * Recursively sets a variable to a given type using {@link set_var set_var} + * + * @param string $var The value which shall be sanitised (passed by reference). + * @param mixed $default Specifies the type $var shall have. + * If it is an array and $var is not one, then an empty array is returned. + * Otherwise var is cast to the same type, and if $default is an array all + * keys and values are cast recursively using this function too. + * @param bool $multibyte Indicates whether string keys and values may contain UTF-8 characters. + * Default is false, causing all bytes outside the ASCII range (0-127) to + * be replaced with question marks. + * @param bool $trim Indicates whether trim() should be applied to string values. + * Default is true. + */ + public function recursive_set_var(&$var, $default, $multibyte, $trim = true) + { + if (is_array($var) !== is_array($default)) + { + $var = (is_array($default)) ? array() : $default; + return; + } + + if (!is_array($default)) + { + $type = gettype($default); + $this->set_var($var, $var, $type, $multibyte, $trim); + } + else + { + // make sure there is at least one key/value pair to use get the + // types from + if (empty($default)) + { + $var = array(); + return; + } + + list($default_key, $default_value) = each($default); + $value_type = gettype($default_value); + $key_type = gettype($default_key); + + $_var = $var; + $var = array(); + + foreach ($_var as $k => $v) + { + $this->set_var($k, $k, $key_type, $multibyte); + + $this->recursive_set_var($v, $default_value, $multibyte, $trim); + $var[$k] = $v; + } + } + } +} diff --git a/sources/phpBB/phpbb/request/type_cast_helper_interface.php b/sources/phpBB/phpbb/request/type_cast_helper_interface.php new file mode 100644 index 0000000..2cb28d0 --- /dev/null +++ b/sources/phpBB/phpbb/request/type_cast_helper_interface.php @@ -0,0 +1,59 @@ + +* @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\request; + +/** +* An interface for type cast operations. +*/ +interface type_cast_helper_interface +{ + /** + * Recursively applies addslashes to a variable. + * + * @param mixed &$var Variable passed by reference to which slashes will be added. + */ + public function addslashes_recursively(&$var); + + /** + * Recursively applies addslashes to a variable if magic quotes are turned on. + * + * @param mixed &$var Variable passed by reference to which slashes will be added. + */ + public function add_magic_quotes(&$var); + + /** + * Set variable $result to a particular type. + * + * @param mixed &$result The variable to fill + * @param mixed $var The contents to fill with + * @param mixed $type The variable type. Will be used with {@link settype()} + * @param bool $multibyte Indicates whether string values may contain UTF-8 characters. + * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks. + */ + public function set_var(&$result, $var, $type, $multibyte = false); + + /** + * Recursively sets a variable to a given type using {@link set_var set_var}. + * + * @param string $var The value which shall be sanitised (passed by reference). + * @param mixed $default Specifies the type $var shall have. + * If it is an array and $var is not one, then an empty array is returned. + * Otherwise var is cast to the same type, and if $default is an array all + * keys and values are cast recursively using this function too. + * @param bool $multibyte Indicates whether string keys and values may contain UTF-8 characters. + * Default is false, causing all bytes outside the ASCII range (0-127) to + * be replaced with question marks. + */ + public function recursive_set_var(&$var, $default, $multibyte); +} diff --git a/sources/phpBB/phpbb/search/base.php b/sources/phpBB/phpbb/search/base.php new file mode 100644 index 0000000..3078197 --- /dev/null +++ b/sources/phpBB/phpbb/search/base.php @@ -0,0 +1,338 @@ + +* @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\search; + +/** +* @ignore +*/ +define('SEARCH_RESULT_NOT_IN_CACHE', 0); +define('SEARCH_RESULT_IN_CACHE', 1); +define('SEARCH_RESULT_INCOMPLETE', 2); + +/** +* optional base class for search plugins providing simple caching based on ACM +* and functions to retrieve ignore_words and synonyms +*/ +class base +{ + var $ignore_words = array(); + var $match_synonym = array(); + var $replace_synonym = array(); + + function search_backend(&$error) + { + // This class cannot be used as a search plugin + $error = true; + } + + /** + * Retrieves a language dependend list of words that should be ignored by the search + */ + function get_ignore_words() + { + if (!sizeof($this->ignore_words)) + { + global $user, $phpEx; + + $words = array(); + + if (file_exists("{$user->lang_path}{$user->lang_name}/search_ignore_words.$phpEx")) + { + // include the file containing ignore words + include("{$user->lang_path}{$user->lang_name}/search_ignore_words.$phpEx"); + } + + $this->ignore_words = $words; + unset($words); + } + } + + /** + * Stores a list of synonyms that should be replaced in $this->match_synonym and $this->replace_synonym and caches them + */ + function get_synonyms() + { + if (!sizeof($this->match_synonym)) + { + global $user, $phpEx; + + $synonyms = array(); + + if (file_exists("{$user->lang_path}{$user->lang_name}/search_synonyms.$phpEx")) + { + // include the file containing synonyms + include("{$user->lang_path}{$user->lang_name}/search_synonyms.$phpEx"); + } + + $this->match_synonym = array_keys($synonyms); + $this->replace_synonym = array_values($synonyms); + + unset($synonyms); + } + } + + /** + * Retrieves cached search results + * + * @param string $search_key an md5 string generated from all the passed search options to identify the results + * @param int &$result_count will contain the number of all results for the search (not only for the current page) + * @param array &$id_ary is filled with the ids belonging to the requested page that are stored in the cache + * @param int &$start indicates the first index of the page + * @param int $per_page number of ids each page is supposed to contain + * @param string $sort_dir is either a or d representing ASC and DESC + * + * @return int SEARCH_RESULT_NOT_IN_CACHE or SEARCH_RESULT_IN_CACHE or SEARCH_RESULT_INCOMPLETE + */ + function obtain_ids($search_key, &$result_count, &$id_ary, &$start, $per_page, $sort_dir) + { + global $cache; + + if (!($stored_ids = $cache->get('_search_results_' . $search_key))) + { + // no search results cached for this search_key + return SEARCH_RESULT_NOT_IN_CACHE; + } + else + { + $result_count = $stored_ids[-1]; + $reverse_ids = ($stored_ids[-2] != $sort_dir) ? true : false; + $complete = true; + + // Change start parameter in case out of bounds + if ($result_count) + { + if ($start < 0) + { + $start = 0; + } + else if ($start >= $result_count) + { + $start = floor(($result_count - 1) / $per_page) * $per_page; + } + } + + // change the start to the actual end of the current request if the sort direction differs + // from the dirction in the cache and reverse the ids later + if ($reverse_ids) + { + $start = $result_count - $start - $per_page; + + // the user requested a page past the last index + if ($start < 0) + { + return SEARCH_RESULT_NOT_IN_CACHE; + } + } + + for ($i = $start, $n = $start + $per_page; ($i < $n) && ($i < $result_count); $i++) + { + if (!isset($stored_ids[$i])) + { + $complete = false; + } + else + { + $id_ary[] = $stored_ids[$i]; + } + } + unset($stored_ids); + + if ($reverse_ids) + { + $id_ary = array_reverse($id_ary); + } + + if (!$complete) + { + return SEARCH_RESULT_INCOMPLETE; + } + return SEARCH_RESULT_IN_CACHE; + } + } + + /** + * Caches post/topic ids + * + * @param string $search_key an md5 string generated from all the passed search options to identify the results + * @param string $keywords contains the keywords as entered by the user + * @param array $author_ary an array of author ids, if the author should be ignored during the search the array is empty + * @param int $result_count contains the number of all results for the search (not only for the current page) + * @param array &$id_ary contains a list of post or topic ids that shall be cached, the first element + * must have the absolute index $start in the result set. + * @param int $start indicates the first index of the page + * @param string $sort_dir is either a or d representing ASC and DESC + * + * @return null + */ + function save_ids($search_key, $keywords, $author_ary, $result_count, &$id_ary, $start, $sort_dir) + { + global $cache, $config, $db, $user; + + $length = min(sizeof($id_ary), $config['search_block_size']); + + // nothing to cache so exit + if (!$length) + { + return; + } + + $store_ids = array_slice($id_ary, 0, $length); + + // create a new resultset if there is none for this search_key yet + // or add the ids to the existing resultset + if (!($store = $cache->get('_search_results_' . $search_key))) + { + // add the current keywords to the recent searches in the cache which are listed on the search page + if (!empty($keywords) || sizeof($author_ary)) + { + $sql = 'SELECT search_time + FROM ' . SEARCH_RESULTS_TABLE . ' + WHERE search_key = \'' . $db->sql_escape($search_key) . '\''; + $result = $db->sql_query($sql); + + if (!$db->sql_fetchrow($result)) + { + $sql_ary = array( + 'search_key' => $search_key, + 'search_time' => time(), + 'search_keywords' => $keywords, + 'search_authors' => ' ' . implode(' ', $author_ary) . ' ' + ); + + $sql = 'INSERT INTO ' . SEARCH_RESULTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + } + $db->sql_freeresult($result); + } + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_last_search = ' . time() . ' + WHERE user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + + $store = array(-1 => $result_count, -2 => $sort_dir); + $id_range = range($start, $start + $length - 1); + } + else + { + // we use one set of results for both sort directions so we have to calculate the indizes + // for the reversed array and we also have to reverse the ids themselves + if ($store[-2] != $sort_dir) + { + $store_ids = array_reverse($store_ids); + $id_range = range($store[-1] - $start - $length, $store[-1] - $start - 1); + } + else + { + $id_range = range($start, $start + $length - 1); + } + } + + $store_ids = array_combine($id_range, $store_ids); + + // append the ids + if (is_array($store_ids)) + { + $store += $store_ids; + + // if the cache is too big + if (sizeof($store) - 2 > 20 * $config['search_block_size']) + { + // remove everything in front of two blocks in front of the current start index + for ($i = 0, $n = $id_range[0] - 2 * $config['search_block_size']; $i < $n; $i++) + { + if (isset($store[$i])) + { + unset($store[$i]); + } + } + + // remove everything after two blocks after the current stop index + end($id_range); + for ($i = $store[-1] - 1, $n = current($id_range) + 2 * $config['search_block_size']; $i > $n; $i--) + { + if (isset($store[$i])) + { + unset($store[$i]); + } + } + } + $cache->put('_search_results_' . $search_key, $store, $config['search_store_results']); + + $sql = 'UPDATE ' . SEARCH_RESULTS_TABLE . ' + SET search_time = ' . time() . ' + WHERE search_key = \'' . $db->sql_escape($search_key) . '\''; + $db->sql_query($sql); + } + + unset($store); + unset($store_ids); + unset($id_range); + } + + /** + * Removes old entries from the search results table and removes searches with keywords that contain a word in $words. + */ + function destroy_cache($words, $authors = false) + { + global $db, $cache, $config; + + // clear all searches that searched for the specified words + if (sizeof($words)) + { + $sql_where = ''; + foreach ($words as $word) + { + $sql_where .= " OR search_keywords " . $db->sql_like_expression($db->get_any_char() . $word . $db->get_any_char()); + } + + $sql = 'SELECT search_key + FROM ' . SEARCH_RESULTS_TABLE . " + WHERE search_keywords LIKE '%*%' $sql_where"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $cache->destroy('_search_results_' . $row['search_key']); + } + $db->sql_freeresult($result); + } + + // clear all searches that searched for the specified authors + if (is_array($authors) && sizeof($authors)) + { + $sql_where = ''; + foreach ($authors as $author) + { + $sql_where .= (($sql_where) ? ' OR ' : '') . 'search_authors ' . $db->sql_like_expression($db->get_any_char() . ' ' . (int) $author . ' ' . $db->get_any_char()); + } + + $sql = 'SELECT search_key + FROM ' . SEARCH_RESULTS_TABLE . " + WHERE $sql_where"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $cache->destroy('_search_results_' . $row['search_key']); + } + $db->sql_freeresult($result); + } + + $sql = 'DELETE + FROM ' . SEARCH_RESULTS_TABLE . ' + WHERE search_time < ' . (time() - $config['search_store_results']); + $db->sql_query($sql); + } +} diff --git a/sources/phpBB/phpbb/search/fulltext_mysql.php b/sources/phpBB/phpbb/search/fulltext_mysql.php new file mode 100644 index 0000000..1a0aba0 --- /dev/null +++ b/sources/phpBB/phpbb/search/fulltext_mysql.php @@ -0,0 +1,937 @@ + +* @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\search; + +/** +* Fulltext search for MySQL +*/ +class fulltext_mysql extends \phpbb\search\base +{ + /** + * Associative array holding index stats + * @var array + */ + protected $stats = array(); + + /** + * Holds the words entered by user, obtained by splitting the entered query on whitespace + * @var array + */ + protected $split_words = array(); + + /** + * Config object + * @var \phpbb\config\config + */ + protected $config; + + /** + * Database connection + * @var \phpbb\db\driver\driver_interface + */ + protected $db; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Associative array stores the min and max word length to be searched + * @var array + */ + protected $word_length = array(); + + /** + * Contains tidied search query. + * Operators are prefixed in search query and common words excluded + * @var string + */ + protected $search_query; + + /** + * Contains common words. + * Common words are words with length less/more than min/max length + * @var array + */ + protected $common_words = array(); + + /** + * Constructor + * Creates a new \phpbb\search\fulltext_mysql, which is used as a search backend + * + * @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false + * @param string $phpbb_root_path Relative path to phpBB root + * @param string $phpEx PHP file extension + * @param \phpbb\auth\auth $auth Auth object + * @param \phpbb\config\config $config Config object + * @param \phpbb\db\driver\driver_interface Database object + * @param \phpbb\user $user User object + */ + public function __construct(&$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user) + { + $this->config = $config; + $this->db = $db; + $this->user = $user; + + $this->word_length = array('min' => $this->config['fulltext_mysql_min_word_len'], 'max' => $this->config['fulltext_mysql_max_word_len']); + + /** + * Load the UTF tools + */ + if (!function_exists('utf8_strlen')) + { + include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); + } + + $error = false; + } + + /** + * Returns the name of this search backend to be displayed to administrators + * + * @return string Name + */ + public function get_name() + { + return 'MySQL Fulltext'; + } + + /** + * Returns the search_query + * + * @return string search query + */ + public function get_search_query() + { + return $this->search_query; + } + + /** + * Returns the common_words array + * + * @return array common words that are ignored by search backend + */ + public function get_common_words() + { + return $this->common_words; + } + + /** + * Returns the word_length array + * + * @return array min and max word length for searching + */ + public function get_word_length() + { + return $this->word_length; + } + + /** + * Checks for correct MySQL version and stores min/max word length in the config + * + * @return string|bool Language key of the error/incompatiblity occurred + */ + public function init() + { + if ($this->db->get_sql_layer() != 'mysql4' && $this->db->get_sql_layer() != 'mysqli') + { + return $this->user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_DATABASE']; + } + + $result = $this->db->sql_query('SHOW TABLE STATUS LIKE \'' . POSTS_TABLE . '\''); + $info = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + $engine = ''; + if (isset($info['Engine'])) + { + $engine = $info['Engine']; + } + else if (isset($info['Type'])) + { + $engine = $info['Type']; + } + + $fulltext_supported = + $engine === 'MyISAM' || + // FULLTEXT is supported on InnoDB since MySQL 5.6.4 according to + // http://dev.mysql.com/doc/refman/5.6/en/innodb-storage-engine.html + $engine === 'InnoDB' && + phpbb_version_compare($this->db->sql_server_info(true), '5.6.4', '>='); + + if (!$fulltext_supported) + { + return $this->user->lang['FULLTEXT_MYSQL_NOT_SUPPORTED']; + } + + $sql = 'SHOW VARIABLES + LIKE \'ft\_%\''; + $result = $this->db->sql_query($sql); + + $mysql_info = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $mysql_info[$row['Variable_name']] = $row['Value']; + } + $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']); + + return false; + } + + /** + * Splits keywords entered by a user into an array of words stored in $this->split_words + * Stores the tidied search query in $this->search_query + * + * @param string &$keywords Contains the keyword as entered by the user + * @param string $terms is either 'all' or 'any' + * @return bool false if no valid keywords were found and otherwise true + */ + public function split_keywords(&$keywords, $terms) + { + if ($terms == 'all') + { + $match = array('#\sand\s#iu', '#\sor\s#iu', '#\snot\s#iu', '#(^|\s)\+#', '#(^|\s)-#', '#(^|\s)\|#'); + $replace = array(' +', ' |', ' -', ' +', ' -', ' |'); + + $keywords = preg_replace($match, $replace, $keywords); + } + + // Filter out as above + $split_keywords = preg_replace("#[\n\r\t]+#", ' ', trim(htmlspecialchars_decode($keywords))); + + // Split words + $split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords))); + $matches = array(); + preg_match_all('#(?:[^\p{L}\p{N}*"()]|^)([+\-|]?(?:[\p{L}\p{N}*"()]+\'?)*[\p{L}\p{N}*"()])(?:[^\p{L}\p{N}*"()]|$)#u', $split_keywords, $matches); + $this->split_words = $matches[1]; + + // We limit the number of allowed keywords to minimize load on the database + if ($this->config['max_num_search_keywords'] && sizeof($this->split_words) > $this->config['max_num_search_keywords']) + { + trigger_error($this->user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', (int) $this->config['max_num_search_keywords'], sizeof($this->split_words))); + } + + // to allow phrase search, we need to concatenate quoted words + $tmp_split_words = array(); + $phrase = ''; + foreach ($this->split_words as $word) + { + if ($phrase) + { + $phrase .= ' ' . $word; + if (strpos($word, '"') !== false && substr_count($word, '"') % 2 == 1) + { + $tmp_split_words[] = $phrase; + $phrase = ''; + } + } + else if (strpos($word, '"') !== false && substr_count($word, '"') % 2 == 1) + { + $phrase = $word; + } + else + { + $tmp_split_words[] = $word; + } + } + if ($phrase) + { + $tmp_split_words[] = $phrase; + } + + $this->split_words = $tmp_split_words; + + unset($tmp_split_words); + unset($phrase); + + foreach ($this->split_words as $i => $word) + { + $clean_word = preg_replace('#^[+\-|"]#', '', $word); + + // check word length + $clean_len = utf8_strlen(str_replace('*', '', $clean_word)); + if (($clean_len < $this->config['fulltext_mysql_min_word_len']) || ($clean_len > $this->config['fulltext_mysql_max_word_len'])) + { + $this->common_words[] = $word; + unset($this->split_words[$i]); + } + } + + if ($terms == 'any') + { + $this->search_query = ''; + foreach ($this->split_words as $word) + { + if ((strpos($word, '+') === 0) || (strpos($word, '-') === 0) || (strpos($word, '|') === 0)) + { + $word = substr($word, 1); + } + $this->search_query .= $word . ' '; + } + } + else + { + $this->search_query = ''; + foreach ($this->split_words as $word) + { + if ((strpos($word, '+') === 0) || (strpos($word, '-') === 0)) + { + $this->search_query .= $word . ' '; + } + else if (strpos($word, '|') === 0) + { + $this->search_query .= substr($word, 1) . ' '; + } + else + { + $this->search_query .= '+' . $word . ' '; + } + } + } + + $this->search_query = utf8_htmlspecialchars($this->search_query); + + if ($this->search_query) + { + $this->split_words = array_values($this->split_words); + sort($this->split_words); + return true; + } + return false; + } + + /** + * Turns text into an array of words + * @param string $text contains post text/subject + */ + public function split_message($text) + { + // Split words + $text = preg_replace('#([^\p{L}\p{N}\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text))); + $matches = array(); + preg_match_all('#(?:[^\p{L}\p{N}*]|^)([+\-|]?(?:[\p{L}\p{N}*]+\'?)*[\p{L}\p{N}*])(?:[^\p{L}\p{N}*]|$)#u', $text, $matches); + $text = $matches[1]; + + // remove too short or too long words + $text = array_values($text); + for ($i = 0, $n = sizeof($text); $i < $n; $i++) + { + $text[$i] = trim($text[$i]); + if (utf8_strlen($text[$i]) < $this->config['fulltext_mysql_min_word_len'] || utf8_strlen($text[$i]) > $this->config['fulltext_mysql_max_word_len']) + { + unset($text[$i]); + } + } + + return array_values($text); + } + + /** + * Performs a search on keywords depending on display specific params. You have to run split_keywords() first + * + * @param string $type contains either posts or topics depending on what should be searched for + * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched) + * @param string $terms is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words) + * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query + * @param string $sort_key is the key of $sort_by_sql for the selected sorting + * @param string $sort_dir is either a or d representing ASC and DESC + * @param string $sort_days specifies the maximum amount of days a post may be old + * @param array $ex_fid_ary specifies an array of forum ids which should not be searched + * @param string $post_visibility specifies which types of posts the user can view in which forums + * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched + * @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty + * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match + * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered + * @param int $start indicates the first index of the page + * @param int $per_page number of ids each page is supposed to contain + * @return boolean|int total number of results + */ + 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) + { + // No keywords? No posts + if (!$this->search_query) + { + return false; + } + + // generate a search_key from all the options to identify the results + $search_key = md5(implode('#', array( + implode(', ', $this->split_words), + $type, + $fields, + $terms, + $sort_days, + $sort_key, + $topic_id, + implode(',', $ex_fid_ary), + $post_visibility, + implode(',', $author_ary) + ))); + + if ($start < 0) + { + $start = 0; + } + + // try reading the results from cache + $result_count = 0; + if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE) + { + return $result_count; + } + + $id_ary = array(); + + $join_topic = ($type == 'posts') ? false : true; + + // Build sql strings for sorting + $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); + $sql_sort_table = $sql_sort_join = ''; + + switch ($sql_sort[0]) + { + case 'u': + $sql_sort_table = USERS_TABLE . ' u, '; + $sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster '; + break; + + case 't': + $join_topic = true; + break; + + case 'f': + $sql_sort_table = FORUMS_TABLE . ' f, '; + $sql_sort_join = ' AND f.forum_id = p.forum_id '; + break; + } + + // Build some display specific sql strings + switch ($fields) + { + case 'titleonly': + $sql_match = 'p.post_subject'; + $sql_match_where = ' AND p.post_id = t.topic_first_post_id'; + $join_topic = true; + break; + + case 'msgonly': + $sql_match = 'p.post_text'; + $sql_match_where = ''; + break; + + case 'firstpost': + $sql_match = 'p.post_subject, p.post_text'; + $sql_match_where = ' AND p.post_id = t.topic_first_post_id'; + $join_topic = true; + break; + + default: + $sql_match = 'p.post_subject, p.post_text'; + $sql_match_where = ''; + break; + } + + $sql_select = (!$result_count) ? 'SQL_CALC_FOUND_ROWS ' : ''; + $sql_select = ($type == 'posts') ? $sql_select . 'p.post_id' : 'DISTINCT ' . $sql_select . 't.topic_id'; + $sql_from = ($join_topic) ? TOPICS_TABLE . ' t, ' : ''; + $field = ($type == 'posts') ? 'post_id' : 'topic_id'; + if (sizeof($author_ary) && $author_name) + { + // first one matches post of registered users, second one guests and deleted users + $sql_author = ' AND (' . $this->db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')'; + } + else if (sizeof($author_ary)) + { + $sql_author = ' AND ' . $this->db->sql_in_set('p.poster_id', $author_ary); + } + else + { + $sql_author = ''; + } + + $sql_where_options = $sql_sort_join; + $sql_where_options .= ($topic_id) ? ' AND p.topic_id = ' . $topic_id : ''; + $sql_where_options .= ($join_topic) ? ' AND t.topic_id = p.topic_id' : ''; + $sql_where_options .= (sizeof($ex_fid_ary)) ? ' AND ' . $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true) : ''; + $sql_where_options .= ' AND ' . $post_visibility; + $sql_where_options .= $sql_author; + $sql_where_options .= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : ''; + $sql_where_options .= $sql_match_where; + + $sql = "SELECT $sql_select + FROM $sql_from$sql_sort_table" . POSTS_TABLE . " p + WHERE MATCH ($sql_match) AGAINST ('" . $this->db->sql_escape(htmlspecialchars_decode($this->search_query)) . "' IN BOOLEAN MODE) + $sql_where_options + ORDER BY $sql_sort"; + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = (int) $row[$field]; + } + $this->db->sql_freeresult($result); + + $id_ary = array_unique($id_ary); + + // if the total result count is not cached yet, retrieve it from the db + if (!$result_count) + { + $sql_found_rows = 'SELECT FOUND_ROWS() as result_count'; + $result = $this->db->sql_query($sql_found_rows); + $result_count = (int) $this->db->sql_fetchfield('result_count'); + $this->db->sql_freeresult($result); + + if (!$result_count) + { + return false; + } + } + + if ($start >= $result_count) + { + $start = floor(($result_count - 1) / $per_page) * $per_page; + + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = (int) $row[$field]; + } + $this->db->sql_freeresult($result); + + $id_ary = array_unique($id_ary); + } + + // store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page + $this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir); + $id_ary = array_slice($id_ary, 0, (int) $per_page); + + return $result_count; + } + + /** + * Performs a search on an author's posts without caring about message contents. Depends on display specific params + * + * @param string $type contains either posts or topics depending on what should be searched for + * @param boolean $firstpost_only if true, only topic starting posts will be considered + * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query + * @param string $sort_key is the key of $sort_by_sql for the selected sorting + * @param string $sort_dir is either a or d representing ASC and DESC + * @param string $sort_days specifies the maximum amount of days a post may be old + * @param array $ex_fid_ary specifies an array of forum ids which should not be searched + * @param string $post_visibility specifies which types of posts the user can view in which forums + * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched + * @param array $author_ary an array of author ids + * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match + * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered + * @param int $start indicates the first index of the page + * @param int $per_page number of ids each page is supposed to contain + * @return boolean|int total number of results + */ + public function author_search($type, $firstpost_only, $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) + { + // No author? No posts + if (!sizeof($author_ary)) + { + return 0; + } + + // generate a search_key from all the options to identify the results + $search_key = md5(implode('#', array( + '', + $type, + ($firstpost_only) ? 'firstpost' : '', + '', + '', + $sort_days, + $sort_key, + $topic_id, + implode(',', $ex_fid_ary), + $post_visibility, + implode(',', $author_ary), + $author_name, + ))); + + if ($start < 0) + { + $start = 0; + } + + // try reading the results from cache + $result_count = 0; + if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE) + { + return $result_count; + } + + $id_ary = array(); + + // Create some display specific sql strings + if ($author_name) + { + // first one matches post of registered users, second one guests and deleted users + $sql_author = '(' . $this->db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')'; + } + else + { + $sql_author = $this->db->sql_in_set('p.poster_id', $author_ary); + } + $sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true) : ''; + $sql_topic_id = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : ''; + $sql_time = ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : ''; + $sql_firstpost = ($firstpost_only) ? ' AND p.post_id = t.topic_first_post_id' : ''; + + // Build sql strings for sorting + $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); + $sql_sort_table = $sql_sort_join = ''; + switch ($sql_sort[0]) + { + case 'u': + $sql_sort_table = USERS_TABLE . ' u, '; + $sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster '; + break; + + case 't': + $sql_sort_table = ($type == 'posts' && !$firstpost_only) ? TOPICS_TABLE . ' t, ' : ''; + $sql_sort_join = ($type == 'posts' && !$firstpost_only) ? ' AND t.topic_id = p.topic_id ' : ''; + break; + + case 'f': + $sql_sort_table = FORUMS_TABLE . ' f, '; + $sql_sort_join = ' AND f.forum_id = p.forum_id '; + break; + } + + $m_approve_fid_sql = ' AND ' . $post_visibility; + + // If the cache was completely empty count the results + $calc_results = ($result_count) ? '' : 'SQL_CALC_FOUND_ROWS '; + + // Build the query for really selecting the post_ids + if ($type == 'posts') + { + $sql = "SELECT {$calc_results}p.post_id + FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . " + WHERE $sql_author + $sql_topic_id + $sql_firstpost + $m_approve_fid_sql + $sql_fora + $sql_sort_join + $sql_time + ORDER BY $sql_sort"; + $field = 'post_id'; + } + else + { + $sql = "SELECT {$calc_results}t.topic_id + FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p + WHERE $sql_author + $sql_topic_id + $sql_firstpost + $m_approve_fid_sql + $sql_fora + AND t.topic_id = p.topic_id + $sql_sort_join + $sql_time + GROUP BY t.topic_id + ORDER BY $sql_sort"; + $field = 'topic_id'; + } + + // Only read one block of posts from the db and then cache it + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = (int) $row[$field]; + } + $this->db->sql_freeresult($result); + + // retrieve the total result count if needed + if (!$result_count) + { + $sql_found_rows = 'SELECT FOUND_ROWS() as result_count'; + $result = $this->db->sql_query($sql_found_rows); + $result_count = (int) $this->db->sql_fetchfield('result_count'); + $this->db->sql_freeresult($result); + + if (!$result_count) + { + return false; + } + } + + if ($start >= $result_count) + { + $start = floor(($result_count - 1) / $per_page) * $per_page; + + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = (int) $row[$field]; + } + $this->db->sql_freeresult($result); + + $id_ary = array_unique($id_ary); + } + + if (sizeof($id_ary)) + { + $this->save_ids($search_key, '', $author_ary, $result_count, $id_ary, $start, $sort_dir); + $id_ary = array_slice($id_ary, 0, $per_page); + + return $result_count; + } + return false; + } + + /** + * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated + * + * @param string $mode contains the post mode: edit, post, reply, quote ... + * @param int $post_id contains the post id of the post to index + * @param string $message contains the post text of the post + * @param string $subject contains the subject of the post to index + * @param int $poster_id contains the user id of the poster + * @param int $forum_id contains the forum id of parent forum of the post + */ + public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) + { + // Split old and new post/subject to obtain array of words + $split_text = $this->split_message($message); + $split_title = ($subject) ? $this->split_message($subject) : array(); + + $words = array_unique(array_merge($split_text, $split_title)); + + unset($split_text); + unset($split_title); + + // destroy cached search results containing any of the words removed or added + $this->destroy_cache($words, array($poster_id)); + + unset($words); + } + + /** + * Destroy cached results, that might be outdated after deleting a post + */ + public function index_remove($post_ids, $author_ids, $forum_ids) + { + $this->destroy_cache(array(), array_unique($author_ids)); + } + + /** + * Destroy old cache entries + */ + public function tidy() + { + // destroy too old cached search results + $this->destroy_cache(array()); + + set_config('search_last_gc', time(), true); + } + + /** + * Create fulltext index + * + * @return string|bool error string is returned incase of errors otherwise false + */ + public function create_index($acp_module, $u_action) + { + // Make sure we can actually use MySQL with fulltext indexes + if ($error = $this->init()) + { + return $error; + } + + if (empty($this->stats)) + { + $this->get_stats(); + } + + $alter = array(); + + if (!isset($this->stats['post_subject'])) + { + if ($this->db->get_sql_layer() == 'mysqli' || version_compare($this->db->sql_server_info(true), '4.1.3', '>=')) + { + $alter[] = 'MODIFY post_subject varchar(255) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL'; + } + else + { + $alter[] = 'MODIFY post_subject text NOT NULL'; + } + $alter[] = 'ADD FULLTEXT (post_subject)'; + } + + if (!isset($this->stats['post_content'])) + { + if ($this->db->get_sql_layer() == 'mysqli' || version_compare($this->db->sql_server_info(true), '4.1.3', '>=')) + { + $alter[] = 'MODIFY post_text mediumtext COLLATE utf8_unicode_ci NOT NULL'; + } + else + { + $alter[] = 'MODIFY post_text mediumtext NOT NULL'; + } + + $alter[] = 'ADD FULLTEXT post_content (post_text, post_subject)'; + } + + if (sizeof($alter)) + { + $this->db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter)); + } + + $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); + + return false; + } + + /** + * Drop fulltext index + * + * @return string|bool error string is returned incase of errors otherwise false + */ + public function delete_index($acp_module, $u_action) + { + // Make sure we can actually use MySQL with fulltext indexes + if ($error = $this->init()) + { + return $error; + } + + if (empty($this->stats)) + { + $this->get_stats(); + } + + $alter = array(); + + if (isset($this->stats['post_subject'])) + { + $alter[] = 'DROP INDEX post_subject'; + } + + if (isset($this->stats['post_content'])) + { + $alter[] = 'DROP INDEX post_content'; + } + + if (sizeof($alter)) + { + $this->db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter)); + } + + $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); + + return false; + } + + /** + * Returns true if both FULLTEXT indexes exist + */ + public function index_created() + { + if (empty($this->stats)) + { + $this->get_stats(); + } + + return isset($this->stats['post_subject']) && isset($this->stats['post_content']); + } + + /** + * Returns an associative array containing information about the indexes + */ + public function index_stats() + { + if (empty($this->stats)) + { + $this->get_stats(); + } + + return array( + $this->user->lang['FULLTEXT_MYSQL_TOTAL_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] : 0, + ); + } + + /** + * Computes the stats and store them in the $this->stats associative array + */ + protected function get_stats() + { + if (strpos($this->db->get_sql_layer(), 'mysql') === false) + { + $this->stats = array(); + return; + } + + $sql = 'SHOW INDEX + FROM ' . POSTS_TABLE; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + // deal with older MySQL versions which didn't use Index_type + $index_type = (isset($row['Index_type'])) ? $row['Index_type'] : $row['Comment']; + + if ($index_type == 'FULLTEXT') + { + if ($row['Key_name'] == 'post_subject') + { + $this->stats['post_subject'] = $row; + } + else if ($row['Key_name'] == 'post_content') + { + $this->stats['post_content'] = $row; + } + } + } + $this->db->sql_freeresult($result); + + $this->stats['total_posts'] = empty($this->stats) ? 0 : $this->db->get_estimated_row_count(POSTS_TABLE); + } + + /** + * Display a note, that UTF-8 support is not available with certain versions of PHP + * + * @return associative array containing template and config variables + */ + public function acp() + { + $tpl = ' +
+

' . $this->user->lang['FULLTEXT_MYSQL_MIN_SEARCH_CHARS_EXPLAIN'] . '
+
' . $this->config['fulltext_mysql_min_word_len'] . '
+
+
+

' . $this->user->lang['FULLTEXT_MYSQL_MAX_SEARCH_CHARS_EXPLAIN'] . '
+
' . $this->config['fulltext_mysql_max_word_len'] . '
+
+ '; + + // These are fields required in the config table + return array( + 'tpl' => $tpl, + 'config' => array() + ); + } +} diff --git a/sources/phpBB/phpbb/search/fulltext_native.php b/sources/phpBB/phpbb/search/fulltext_native.php new file mode 100644 index 0000000..93ea46c --- /dev/null +++ b/sources/phpBB/phpbb/search/fulltext_native.php @@ -0,0 +1,1810 @@ + +* @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\search; + +/** +* phpBB's own db driven fulltext search, version 2 +*/ +class fulltext_native extends \phpbb\search\base +{ + /** + * Associative array holding index stats + * @var array + */ + protected $stats = array(); + + /** + * Associative array stores the min and max word length to be searched + * @var array + */ + protected $word_length = array(); + + /** + * Contains tidied search query. + * Operators are prefixed in search query and common words excluded + * @var string + */ + protected $search_query; + + /** + * Contains common words. + * Common words are words with length less/more than min/max length + * @var array + */ + protected $common_words = array(); + + /** + * Post ids of posts containing words that are to be included + * @var array + */ + protected $must_contain_ids = array(); + + /** + * Post ids of posts containing words that should not be included + * @var array + */ + protected $must_not_contain_ids = array(); + + /** + * Post ids of posts containing atleast one word that needs to be excluded + * @var array + */ + protected $must_exclude_one_ids = array(); + + /** + * Relative path to board root + * @var string + */ + protected $phpbb_root_path; + + /** + * PHP Extension + * @var string + */ + protected $php_ext; + + /** + * Config object + * @var \phpbb\config\config + */ + protected $config; + + /** + * Database connection + * @var \phpbb\db\driver\driver_interface + */ + protected $db; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Initialises the fulltext_native search backend with min/max word length and makes sure the UTF-8 normalizer is loaded + * + * @param boolean|string &$error is passed by reference and should either be set to false on success or an error message on failure + */ + public function __construct(&$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $phpEx; + $this->config = $config; + $this->db = $db; + $this->user = $user; + + $this->word_length = array('min' => $this->config['fulltext_native_min_chars'], 'max' => $this->config['fulltext_native_max_chars']); + + /** + * 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); + } + + $error = false; + } + + /** + * Returns the name of this search backend to be displayed to administrators + * + * @return string Name + */ + public function get_name() + { + return 'phpBB Native Fulltext'; + } + + /** + * Returns the search_query + * + * @return string search query + */ + public function get_search_query() + { + return $this->search_query; + } + + /** + * Returns the common_words array + * + * @return array common words that are ignored by search backend + */ + public function get_common_words() + { + return $this->common_words; + } + + /** + * Returns the word_length array + * + * @return array min and max word length for searching + */ + public function get_word_length() + { + return $this->word_length; + } + + /** + * This function fills $this->search_query with the cleaned user search query + * + * If $terms is 'any' then the words will be extracted from the search query + * and combined with | inside brackets. They will afterwards be treated like + * an standard search query. + * + * Then it analyses the query and fills the internal arrays $must_not_contain_ids, + * $must_contain_ids and $must_exclude_one_ids which are later used by keyword_search() + * + * @param string $keywords contains the search query string as entered by the user + * @param string $terms is either 'all' (use search query as entered, default words to 'must be contained in post') + * or 'any' (find all posts containing at least one of the given words) + * @return boolean false if no valid keywords were found and otherwise true + */ + public function split_keywords($keywords, $terms) + { + $tokens = '+-|()*'; + + $keywords = trim($this->cleanup($keywords, $tokens)); + + // allow word|word|word without brackets + if ((strpos($keywords, ' ') === false) && (strpos($keywords, '|') !== false) && (strpos($keywords, '(') === false)) + { + $keywords = '(' . $keywords . ')'; + } + + $open_bracket = $space = false; + for ($i = 0, $n = strlen($keywords); $i < $n; $i++) + { + if ($open_bracket !== false) + { + switch ($keywords[$i]) + { + case ')': + if ($open_bracket + 1 == $i) + { + $keywords[$i - 1] = '|'; + $keywords[$i] = '|'; + } + $open_bracket = false; + break; + case '(': + $keywords[$i] = '|'; + break; + case '+': + case '-': + case ' ': + $keywords[$i] = '|'; + break; + case '*': + if ($i === 0 || ($keywords[$i - 1] !== '*' && strcspn($keywords[$i - 1], $tokens) === 0)) + { + if ($i === $n - 1 || ($keywords[$i + 1] !== '*' && strcspn($keywords[$i + 1], $tokens) === 0)) + { + $keywords = substr($keywords, 0, $i) . substr($keywords, $i + 1); + } + } + break; + } + } + else + { + switch ($keywords[$i]) + { + case ')': + $keywords[$i] = ' '; + break; + case '(': + $open_bracket = $i; + $space = false; + break; + case '|': + $keywords[$i] = ' '; + break; + case '-': + case '+': + $space = $keywords[$i]; + break; + case ' ': + if ($space !== false) + { + $keywords[$i] = $space; + } + break; + default: + $space = false; + } + } + } + + if ($open_bracket) + { + $keywords .= ')'; + } + + $match = array( + '# +#', + '#\|\|+#', + '#(\+|\-)(?:\+|\-)+#', + '#\(\|#', + '#\|\)#', + ); + $replace = array( + ' ', + '|', + '$1', + '(', + ')', + ); + + $keywords = preg_replace($match, $replace, $keywords); + $num_keywords = sizeof(explode(' ', $keywords)); + + // We limit the number of allowed keywords to minimize load on the database + if ($this->config['max_num_search_keywords'] && $num_keywords > $this->config['max_num_search_keywords']) + { + trigger_error($this->user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', (int) $this->config['max_num_search_keywords'], $num_keywords)); + } + + // $keywords input format: each word separated by a space, words in a bracket are not separated + + // the user wants to search for any word, convert the search query + if ($terms == 'any') + { + $words = array(); + + preg_match_all('#([^\\s+\\-|()]+)(?:$|[\\s+\\-|()])#u', $keywords, $words); + if (sizeof($words[1])) + { + $keywords = '(' . implode('|', $words[1]) . ')'; + } + } + + // set the search_query which is shown to the user + $this->search_query = $keywords; + + $exact_words = array(); + preg_match_all('#([^\\s+\\-|()]+)(?:$|[\\s+\\-|()])#u', $keywords, $exact_words); + $exact_words = $exact_words[1]; + + $common_ids = $words = array(); + + if (sizeof($exact_words)) + { + $sql = 'SELECT word_id, word_text, word_common + FROM ' . SEARCH_WORDLIST_TABLE . ' + WHERE ' . $this->db->sql_in_set('word_text', $exact_words) . ' + ORDER BY word_count ASC'; + $result = $this->db->sql_query($sql); + + // store an array of words and ids, remove common words + while ($row = $this->db->sql_fetchrow($result)) + { + if ($row['word_common']) + { + $this->common_words[] = $row['word_text']; + $common_ids[$row['word_text']] = (int) $row['word_id']; + continue; + } + + $words[$row['word_text']] = (int) $row['word_id']; + } + $this->db->sql_freeresult($result); + } + + // Handle +, - without preceeding whitespace character + $match = array('#(\S)\+#', '#(\S)-#'); + $replace = array('$1 +', '$1 +'); + + $keywords = preg_replace($match, $replace, $keywords); + + // now analyse the search query, first split it using the spaces + $query = explode(' ', $keywords); + + $this->must_contain_ids = array(); + $this->must_not_contain_ids = array(); + $this->must_exclude_one_ids = array(); + + $mode = ''; + $ignore_no_id = true; + + foreach ($query as $word) + { + if (empty($word)) + { + continue; + } + + // words which should not be included + if ($word[0] == '-') + { + $word = substr($word, 1); + + // a group of which at least one may not be in the resulting posts + if ($word[0] == '(') + { + $word = array_unique(explode('|', substr($word, 1, -1))); + $mode = 'must_exclude_one'; + } + // one word which should not be in the resulting posts + else + { + $mode = 'must_not_contain'; + } + $ignore_no_id = true; + } + // words which have to be included + else + { + // no prefix is the same as a +prefix + if ($word[0] == '+') + { + $word = substr($word, 1); + } + + // a group of words of which at least one word should be in every resulting post + if ($word[0] == '(') + { + $word = array_unique(explode('|', substr($word, 1, -1))); + } + $ignore_no_id = false; + $mode = 'must_contain'; + } + + if (empty($word)) + { + continue; + } + + // if this is an array of words then retrieve an id for each + if (is_array($word)) + { + $non_common_words = array(); + $id_words = array(); + foreach ($word as $i => $word_part) + { + if (strpos($word_part, '*') !== false) + { + $id_words[] = '\'' . $this->db->sql_escape(str_replace('*', '%', $word_part)) . '\''; + $non_common_words[] = $word_part; + } + else if (isset($words[$word_part])) + { + $id_words[] = $words[$word_part]; + $non_common_words[] = $word_part; + } + else + { + $len = utf8_strlen($word_part); + if ($len < $this->word_length['min'] || $len > $this->word_length['max']) + { + $this->common_words[] = $word_part; + } + } + } + if (sizeof($id_words)) + { + sort($id_words); + if (sizeof($id_words) > 1) + { + $this->{$mode . '_ids'}[] = $id_words; + } + else + { + $mode = ($mode == 'must_exclude_one') ? 'must_not_contain' : $mode; + $this->{$mode . '_ids'}[] = $id_words[0]; + } + } + // throw an error if we shall not ignore unexistant words + else if (!$ignore_no_id && sizeof($non_common_words)) + { + trigger_error(sprintf($this->user->lang['WORDS_IN_NO_POST'], implode($this->user->lang['COMMA_SEPARATOR'], $non_common_words))); + } + unset($non_common_words); + } + // else we only need one id + else if (($wildcard = strpos($word, '*') !== false) || isset($words[$word])) + { + if ($wildcard) + { + $len = utf8_strlen(str_replace('*', '', $word)); + if ($len >= $this->word_length['min'] && $len <= $this->word_length['max']) + { + $this->{$mode . '_ids'}[] = '\'' . $this->db->sql_escape(str_replace('*', '%', $word)) . '\''; + } + else + { + $this->common_words[] = $word; + } + } + else + { + $this->{$mode . '_ids'}[] = $words[$word]; + } + } + else + { + if (!isset($common_ids[$word])) + { + $len = utf8_strlen($word); + if ($len < $this->word_length['min'] || $len > $this->word_length['max']) + { + $this->common_words[] = $word; + } + } + } + } + + // Return true if all words are not common words + if (sizeof($exact_words) - sizeof($this->common_words) > 0) + { + return true; + } + return false; + } + + /** + * Performs a search on keywords depending on display specific params. You have to run split_keywords() first + * + * @param string $type contains either posts or topics depending on what should be searched for + * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched) + * @param string $terms is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words) + * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query + * @param string $sort_key is the key of $sort_by_sql for the selected sorting + * @param string $sort_dir is either a or d representing ASC and DESC + * @param string $sort_days specifies the maximum amount of days a post may be old + * @param array $ex_fid_ary specifies an array of forum ids which should not be searched + * @param string $post_visibility specifies which types of posts the user can view in which forums + * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched + * @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty + * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match + * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered + * @param int $start indicates the first index of the page + * @param int $per_page number of ids each page is supposed to contain + * @return boolean|int total number of results + */ + 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) + { + // No keywords? No posts. + if (empty($this->search_query)) + { + return false; + } + + // we can't search for negatives only + if (empty($this->must_contain_ids)) + { + return false; + } + + $must_contain_ids = $this->must_contain_ids; + $must_not_contain_ids = $this->must_not_contain_ids; + $must_exclude_one_ids = $this->must_exclude_one_ids; + + sort($must_contain_ids); + sort($must_not_contain_ids); + sort($must_exclude_one_ids); + + // generate a search_key from all the options to identify the results + $search_key = md5(implode('#', array( + serialize($must_contain_ids), + serialize($must_not_contain_ids), + serialize($must_exclude_one_ids), + $type, + $fields, + $terms, + $sort_days, + $sort_key, + $topic_id, + implode(',', $ex_fid_ary), + $post_visibility, + implode(',', $author_ary), + $author_name, + ))); + + // try reading the results from cache + $total_results = 0; + if ($this->obtain_ids($search_key, $total_results, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE) + { + return $total_results; + } + + $id_ary = array(); + + $sql_where = array(); + $group_by = false; + $m_num = 0; + $w_num = 0; + + $sql_array = array( + 'SELECT' => ($type == 'posts') ? 'p.post_id' : 'p.topic_id', + 'FROM' => array( + SEARCH_WORDMATCH_TABLE => array(), + SEARCH_WORDLIST_TABLE => array(), + ), + 'LEFT_JOIN' => array(array( + 'FROM' => array(POSTS_TABLE => 'p'), + 'ON' => 'm0.post_id = p.post_id', + )), + ); + + $title_match = ''; + $left_join_topics = false; + $group_by = true; + // Build some display specific sql strings + switch ($fields) + { + case 'titleonly': + $title_match = 'title_match = 1'; + $group_by = false; + // no break + case 'firstpost': + $left_join_topics = true; + $sql_where[] = 'p.post_id = t.topic_first_post_id'; + break; + + case 'msgonly': + $title_match = 'title_match = 0'; + $group_by = false; + break; + } + + if ($type == 'topics') + { + $left_join_topics = true; + $group_by = true; + } + + /** + * @todo Add a query optimizer (handle stuff like "+(4|3) +4") + */ + + foreach ($this->must_contain_ids as $subquery) + { + if (is_array($subquery)) + { + $group_by = true; + + $word_id_sql = array(); + $word_ids = array(); + foreach ($subquery as $id) + { + if (is_string($id)) + { + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(SEARCH_WORDLIST_TABLE => 'w' . $w_num), + 'ON' => "w$w_num.word_text LIKE $id" + ); + $word_ids[] = "w$w_num.word_id"; + + $w_num++; + } + else + { + $word_ids[] = $id; + } + } + + $sql_where[] = $this->db->sql_in_set("m$m_num.word_id", $word_ids); + + unset($word_id_sql); + unset($word_ids); + } + else if (is_string($subquery)) + { + $sql_array['FROM'][SEARCH_WORDLIST_TABLE][] = 'w' . $w_num; + + $sql_where[] = "w$w_num.word_text LIKE $subquery"; + $sql_where[] = "m$m_num.word_id = w$w_num.word_id"; + + $group_by = true; + $w_num++; + } + else + { + $sql_where[] = "m$m_num.word_id = $subquery"; + } + + $sql_array['FROM'][SEARCH_WORDMATCH_TABLE][] = 'm' . $m_num; + + if ($title_match) + { + $sql_where[] = "m$m_num.$title_match"; + } + + if ($m_num != 0) + { + $sql_where[] = "m$m_num.post_id = m0.post_id"; + } + $m_num++; + } + + foreach ($this->must_not_contain_ids as $key => $subquery) + { + if (is_string($subquery)) + { + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(SEARCH_WORDLIST_TABLE => 'w' . $w_num), + 'ON' => "w$w_num.word_text LIKE $subquery" + ); + + $this->must_not_contain_ids[$key] = "w$w_num.word_id"; + + $group_by = true; + $w_num++; + } + } + + if (sizeof($this->must_not_contain_ids)) + { + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(SEARCH_WORDMATCH_TABLE => 'm' . $m_num), + 'ON' => $this->db->sql_in_set("m$m_num.word_id", $this->must_not_contain_ids) . (($title_match) ? " AND m$m_num.$title_match" : '') . " AND m$m_num.post_id = m0.post_id" + ); + + $sql_where[] = "m$m_num.word_id IS NULL"; + $m_num++; + } + + foreach ($this->must_exclude_one_ids as $ids) + { + $is_null_joins = array(); + foreach ($ids as $id) + { + if (is_string($id)) + { + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(SEARCH_WORDLIST_TABLE => 'w' . $w_num), + 'ON' => "w$w_num.word_text LIKE $id" + ); + $id = "w$w_num.word_id"; + + $group_by = true; + $w_num++; + } + + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(SEARCH_WORDMATCH_TABLE => 'm' . $m_num), + 'ON' => "m$m_num.word_id = $id AND m$m_num.post_id = m0.post_id" . (($title_match) ? " AND m$m_num.$title_match" : '') + ); + $is_null_joins[] = "m$m_num.word_id IS NULL"; + + $m_num++; + } + $sql_where[] = '(' . implode(' OR ', $is_null_joins) . ')'; + } + + $sql_where[] = $post_visibility; + + if ($topic_id) + { + $sql_where[] = 'p.topic_id = ' . $topic_id; + } + + if (sizeof($author_ary)) + { + if ($author_name) + { + // first one matches post of registered users, second one guests and deleted users + $sql_author = '(' . $this->db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')'; + } + else + { + $sql_author = $this->db->sql_in_set('p.poster_id', $author_ary); + } + $sql_where[] = $sql_author; + } + + if (sizeof($ex_fid_ary)) + { + $sql_where[] = $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true); + } + + if ($sort_days) + { + $sql_where[] = 'p.post_time >= ' . (time() - ($sort_days * 86400)); + } + + $sql_array['WHERE'] = implode(' AND ', $sql_where); + + $is_mysql = false; + // if the total result count is not cached yet, retrieve it from the db + if (!$total_results) + { + $sql = ''; + $sql_array_count = $sql_array; + + if ($left_join_topics) + { + $sql_array_count['LEFT_JOIN'][] = array( + 'FROM' => array(TOPICS_TABLE => 't'), + 'ON' => 'p.topic_id = t.topic_id' + ); + } + + switch ($this->db->get_sql_layer()) + { + case 'mysql4': + case 'mysqli': + + // 3.x does not support SQL_CALC_FOUND_ROWS + // $sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT']; + $is_mysql = true; + + break; + + case 'sqlite': + case 'sqlite3': + $sql_array_count['SELECT'] = ($type == 'posts') ? 'DISTINCT p.post_id' : 'DISTINCT p.topic_id'; + $sql = 'SELECT COUNT(' . (($type == 'posts') ? 'post_id' : 'topic_id') . ') as total_results + FROM (' . $this->db->sql_build_query('SELECT', $sql_array_count) . ')'; + + // no break + + default: + $sql_array_count['SELECT'] = ($type == 'posts') ? 'COUNT(DISTINCT p.post_id) AS total_results' : 'COUNT(DISTINCT p.topic_id) AS total_results'; + $sql = (!$sql) ? $this->db->sql_build_query('SELECT', $sql_array_count) : $sql; + + $result = $this->db->sql_query($sql); + $total_results = (int) $this->db->sql_fetchfield('total_results'); + $this->db->sql_freeresult($result); + + if (!$total_results) + { + return false; + } + break; + } + + unset($sql_array_count, $sql); + } + + // Build sql strings for sorting + $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); + + switch ($sql_sort[0]) + { + case 'u': + $sql_array['FROM'][USERS_TABLE] = 'u'; + $sql_where[] = 'u.user_id = p.poster_id '; + break; + + case 't': + $left_join_topics = true; + break; + + case 'f': + $sql_array['FROM'][FORUMS_TABLE] = 'f'; + $sql_where[] = 'f.forum_id = p.forum_id'; + break; + } + + if ($left_join_topics) + { + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(TOPICS_TABLE => 't'), + 'ON' => 'p.topic_id = t.topic_id' + ); + } + + $sql_array['WHERE'] = implode(' AND ', $sql_where); + $sql_array['GROUP_BY'] = ($group_by) ? (($type == 'posts') ? 'p.post_id' : 'p.topic_id') . ', ' . $sort_by_sql[$sort_key] : ''; + $sql_array['ORDER_BY'] = $sql_sort; + + unset($sql_where, $sql_sort, $group_by); + + $sql = $this->db->sql_build_query('SELECT', $sql_array); + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = (int) $row[(($type == 'posts') ? 'post_id' : 'topic_id')]; + } + $this->db->sql_freeresult($result); + + // if we use mysql and the total result count is not cached yet, retrieve it from the db + if (!$total_results && $is_mysql) + { + // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it + $sql_array_copy = $sql_array; + $sql_array_copy['SELECT'] = 'SQL_CALC_FOUND_ROWS p.post_id '; + + $sql_calc = $this->db->sql_build_query('SELECT', $sql_array_copy); + unset($sql_array_copy); + + $this->db->sql_query($sql_calc); + $this->db->sql_freeresult($result); + + $sql_count = 'SELECT FOUND_ROWS() as total_results'; + $result = $this->db->sql_query($sql_count); + $total_results = (int) $this->db->sql_fetchfield('total_results'); + $this->db->sql_freeresult($result); + + if (!$total_results) + { + return false; + } + } + + if ($start >= $total_results) + { + $start = floor(($total_results - 1) / $per_page) * $per_page; + + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = (int) $row[(($type == 'posts') ? 'post_id' : 'topic_id')]; + } + $this->db->sql_freeresult($result); + + } + + // store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page + $this->save_ids($search_key, $this->search_query, $author_ary, $total_results, $id_ary, $start, $sort_dir); + $id_ary = array_slice($id_ary, 0, (int) $per_page); + + return $total_results; + } + + /** + * Performs a search on an author's posts without caring about message contents. Depends on display specific params + * + * @param string $type contains either posts or topics depending on what should be searched for + * @param boolean $firstpost_only if true, only topic starting posts will be considered + * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query + * @param string $sort_key is the key of $sort_by_sql for the selected sorting + * @param string $sort_dir is either a or d representing ASC and DESC + * @param string $sort_days specifies the maximum amount of days a post may be old + * @param array $ex_fid_ary specifies an array of forum ids which should not be searched + * @param string $post_visibility specifies which types of posts the user can view in which forums + * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched + * @param array $author_ary an array of author ids + * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match + * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered + * @param int $start indicates the first index of the page + * @param int $per_page number of ids each page is supposed to contain + * @return boolean|int total number of results + */ + public function author_search($type, $firstpost_only, $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) + { + // No author? No posts + if (!sizeof($author_ary)) + { + return 0; + } + + // generate a search_key from all the options to identify the results + $search_key = md5(implode('#', array( + '', + $type, + ($firstpost_only) ? 'firstpost' : '', + '', + '', + $sort_days, + $sort_key, + $topic_id, + implode(',', $ex_fid_ary), + $post_visibility, + implode(',', $author_ary), + $author_name, + ))); + + // try reading the results from cache + $total_results = 0; + if ($this->obtain_ids($search_key, $total_results, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE) + { + return $total_results; + } + + $id_ary = array(); + + // Create some display specific sql strings + if ($author_name) + { + // first one matches post of registered users, second one guests and deleted users + $sql_author = '(' . $this->db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')'; + } + else + { + $sql_author = $this->db->sql_in_set('p.poster_id', $author_ary); + } + $sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true) : ''; + $sql_time = ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : ''; + $sql_topic_id = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : ''; + $sql_firstpost = ($firstpost_only) ? ' AND p.post_id = t.topic_first_post_id' : ''; + $post_visibility = ($post_visibility) ? ' AND ' . $post_visibility : ''; + + // Build sql strings for sorting + $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); + $sql_sort_table = $sql_sort_join = ''; + switch ($sql_sort[0]) + { + case 'u': + $sql_sort_table = USERS_TABLE . ' u, '; + $sql_sort_join = ' AND u.user_id = p.poster_id '; + break; + + case 't': + $sql_sort_table = ($type == 'posts' && !$firstpost_only) ? TOPICS_TABLE . ' t, ' : ''; + $sql_sort_join = ($type == 'posts' && !$firstpost_only) ? ' AND t.topic_id = p.topic_id ' : ''; + break; + + case 'f': + $sql_sort_table = FORUMS_TABLE . ' f, '; + $sql_sort_join = ' AND f.forum_id = p.forum_id '; + break; + } + + $select = ($type == 'posts') ? 'p.post_id' : 't.topic_id'; + $is_mysql = false; + + // If the cache was completely empty count the results + if (!$total_results) + { + switch ($this->db->get_sql_layer()) + { + case 'mysql4': + case 'mysqli': +// $select = 'SQL_CALC_FOUND_ROWS ' . $select; + $is_mysql = true; + break; + + default: + if ($type == 'posts') + { + $sql = 'SELECT COUNT(p.post_id) as total_results + FROM ' . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . " + WHERE $sql_author + $sql_topic_id + $sql_firstpost + $post_visibility + $sql_fora + $sql_time"; + } + else + { + if ($this->db->get_sql_layer() == 'sqlite' || $this->db->get_sql_layer() == 'sqlite3') + { + $sql = 'SELECT COUNT(topic_id) as total_results + FROM (SELECT DISTINCT t.topic_id'; + } + else + { + $sql = 'SELECT COUNT(DISTINCT t.topic_id) as total_results'; + } + + $sql .= ' FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p + WHERE $sql_author + $sql_topic_id + $sql_firstpost + $post_visibility + $sql_fora + AND t.topic_id = p.topic_id + $sql_time" . (($this->db->get_sql_layer() == 'sqlite' || $this->db->get_sql_layer() == 'sqlite3') ? ')' : ''); + } + $result = $this->db->sql_query($sql); + + $total_results = (int) $this->db->sql_fetchfield('total_results'); + $this->db->sql_freeresult($result); + + if (!$total_results) + { + return false; + } + break; + } + } + + // Build the query for really selecting the post_ids + if ($type == 'posts') + { + $sql = "SELECT $select + FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t' : '') . " + WHERE $sql_author + $sql_topic_id + $sql_firstpost + $post_visibility + $sql_fora + $sql_sort_join + $sql_time + ORDER BY $sql_sort"; + $field = 'post_id'; + } + else + { + $sql = "SELECT $select + FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p + WHERE $sql_author + $sql_topic_id + $sql_firstpost + $post_visibility + $sql_fora + AND t.topic_id = p.topic_id + $sql_sort_join + $sql_time + GROUP BY t.topic_id, " . $sort_by_sql[$sort_key] . ' + ORDER BY ' . $sql_sort; + $field = 'topic_id'; + } + + // Only read one block of posts from the db and then cache it + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = (int) $row[$field]; + } + $this->db->sql_freeresult($result); + + if (!$total_results && $is_mysql) + { + // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it. + $sql_calc = str_replace('SELECT ' . $select, 'SELECT DISTINCT SQL_CALC_FOUND_ROWS p.post_id', $sql); + + $this->db->sql_query($sql_calc); + $this->db->sql_freeresult($result); + + $sql_count = 'SELECT FOUND_ROWS() as total_results'; + $result = $this->db->sql_query($sql_count); + $total_results = (int) $this->db->sql_fetchfield('total_results'); + $this->db->sql_freeresult($result); + + if (!$total_results) + { + return false; + } + } + + if ($start >= $total_results) + { + $start = floor(($total_results - 1) / $per_page) * $per_page; + + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = (int) $row[$field]; + } + $this->db->sql_freeresult($result); + } + + if (sizeof($id_ary)) + { + $this->save_ids($search_key, '', $author_ary, $total_results, $id_ary, $start, $sort_dir); + $id_ary = array_slice($id_ary, 0, $per_page); + + return $total_results; + } + return false; + } + + /** + * Split a text into words of a given length + * + * The text is converted to UTF-8, cleaned up, and split. Then, words that + * conform to the defined length range are returned in an array. + * + * NOTE: duplicates are NOT removed from the return array + * + * @param string $text Text to split, encoded in UTF-8 + * @return array Array of UTF-8 words + */ + public function split_message($text) + { + $match = $words = array(); + + /** + * Taken from the original code + */ + // Do not index code + $match[] = '#\[code(?:=.*?)?(\:?[0-9a-z]{5,})\].*?\[\/code(\:?[0-9a-z]{5,})\]#is'; + // BBcode + $match[] = '#\[\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?(\:?[0-9a-z]{5,})\]#'; + + $min = $this->word_length['min']; + $max = $this->word_length['max']; + + $isset_min = $min - 1; + + /** + * Clean up the string, remove HTML tags, remove BBCodes + */ + $word = strtok($this->cleanup(preg_replace($match, ' ', strip_tags($text)), -1), ' '); + + while (strlen($word)) + { + if (strlen($word) > 255 || strlen($word) <= $isset_min) + { + /** + * Words longer than 255 bytes are ignored. This will have to be + * changed whenever we change the length of search_wordlist.word_text + * + * Words shorter than $isset_min bytes are ignored, too + */ + $word = strtok(' '); + continue; + } + + $len = utf8_strlen($word); + + /** + * Test whether the word is too short to be indexed. + * + * Note that this limit does NOT apply to CJK and Hangul + */ + if ($len < $min) + { + /** + * 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)) + { + $word = strtok(' '); + continue; + } + } + + $words[] = $word; + $word = strtok(' '); + } + + return $words; + } + + /** + * Updates wordlist and wordmatch tables when a message is posted or changed + * + * @param string $mode Contains the post mode: edit, post, reply, quote + * @param int $post_id The id of the post which is modified/created + * @param string &$message New or updated post content + * @param string &$subject New or updated post subject + * @param int $poster_id Post author's user id + * @param int $forum_id The id of the forum in which the post is located + */ + public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) + { + if (!$this->config['fulltext_native_load_upd']) + { + /** + * The search indexer is disabled, return + */ + return; + } + + // Split old and new post/subject to obtain array of 'words' + $split_text = $this->split_message($message); + $split_title = $this->split_message($subject); + + $cur_words = array('post' => array(), 'title' => array()); + + $words = array(); + if ($mode == 'edit') + { + $words['add']['post'] = array(); + $words['add']['title'] = array(); + $words['del']['post'] = array(); + $words['del']['title'] = array(); + + $sql = 'SELECT w.word_id, w.word_text, m.title_match + FROM ' . SEARCH_WORDLIST_TABLE . ' w, ' . SEARCH_WORDMATCH_TABLE . " m + WHERE m.post_id = $post_id + AND w.word_id = m.word_id"; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $which = ($row['title_match']) ? 'title' : 'post'; + $cur_words[$which][$row['word_text']] = $row['word_id']; + } + $this->db->sql_freeresult($result); + + $words['add']['post'] = array_diff($split_text, array_keys($cur_words['post'])); + $words['add']['title'] = array_diff($split_title, array_keys($cur_words['title'])); + $words['del']['post'] = array_diff(array_keys($cur_words['post']), $split_text); + $words['del']['title'] = array_diff(array_keys($cur_words['title']), $split_title); + } + else + { + $words['add']['post'] = $split_text; + $words['add']['title'] = $split_title; + $words['del']['post'] = array(); + $words['del']['title'] = array(); + } + unset($split_text); + unset($split_title); + + // Get unique words from the above arrays + $unique_add_words = array_unique(array_merge($words['add']['post'], $words['add']['title'])); + + // We now have unique arrays of all words to be added and removed and + // individual arrays of added and removed words for text and title. What + // we need to do now is add the new words (if they don't already exist) + // and then add (or remove) matches between the words and this post + if (sizeof($unique_add_words)) + { + $sql = 'SELECT word_id, word_text + FROM ' . SEARCH_WORDLIST_TABLE . ' + WHERE ' . $this->db->sql_in_set('word_text', $unique_add_words); + $result = $this->db->sql_query($sql); + + $word_ids = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $word_ids[$row['word_text']] = $row['word_id']; + } + $this->db->sql_freeresult($result); + $new_words = array_diff($unique_add_words, array_keys($word_ids)); + + $this->db->sql_transaction('begin'); + if (sizeof($new_words)) + { + $sql_ary = array(); + + foreach ($new_words as $word) + { + $sql_ary[] = array('word_text' => (string) $word, 'word_count' => 0); + } + $this->db->sql_return_on_error(true); + $this->db->sql_multi_insert(SEARCH_WORDLIST_TABLE, $sql_ary); + $this->db->sql_return_on_error(false); + } + unset($new_words, $sql_ary); + } + else + { + $this->db->sql_transaction('begin'); + } + + // now update the search match table, remove links to removed words and add links to new words + foreach ($words['del'] as $word_in => $word_ary) + { + $title_match = ($word_in == 'title') ? 1 : 0; + + if (sizeof($word_ary)) + { + $sql_in = array(); + foreach ($word_ary as $word) + { + $sql_in[] = $cur_words[$word_in][$word]; + } + + $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . ' + WHERE ' . $this->db->sql_in_set('word_id', $sql_in) . ' + AND post_id = ' . intval($post_id) . " + AND title_match = $title_match"; + $this->db->sql_query($sql); + + $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' + SET word_count = word_count - 1 + WHERE ' . $this->db->sql_in_set('word_id', $sql_in) . ' + AND word_count > 0'; + $this->db->sql_query($sql); + + unset($sql_in); + } + } + + $this->db->sql_return_on_error(true); + foreach ($words['add'] as $word_in => $word_ary) + { + $title_match = ($word_in == 'title') ? 1 : 0; + + if (sizeof($word_ary)) + { + $sql = 'INSERT INTO ' . SEARCH_WORDMATCH_TABLE . ' (post_id, word_id, title_match) + SELECT ' . (int) $post_id . ', word_id, ' . (int) $title_match . ' + FROM ' . SEARCH_WORDLIST_TABLE . ' + WHERE ' . $this->db->sql_in_set('word_text', $word_ary); + $this->db->sql_query($sql); + + $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' + SET word_count = word_count + 1 + WHERE ' . $this->db->sql_in_set('word_text', $word_ary); + $this->db->sql_query($sql); + } + } + $this->db->sql_return_on_error(false); + + $this->db->sql_transaction('commit'); + + // destroy cached search results containing any of the words removed or added + $this->destroy_cache(array_unique(array_merge($words['add']['post'], $words['add']['title'], $words['del']['post'], $words['del']['title'])), array($poster_id)); + + unset($unique_add_words); + unset($words); + unset($cur_words); + } + + /** + * Removes entries from the wordmatch table for the specified post_ids + */ + public function index_remove($post_ids, $author_ids, $forum_ids) + { + if (sizeof($post_ids)) + { + $sql = 'SELECT w.word_id, w.word_text, m.title_match + FROM ' . SEARCH_WORDMATCH_TABLE . ' m, ' . SEARCH_WORDLIST_TABLE . ' w + WHERE ' . $this->db->sql_in_set('m.post_id', $post_ids) . ' + AND w.word_id = m.word_id'; + $result = $this->db->sql_query($sql); + + $message_word_ids = $title_word_ids = $word_texts = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + if ($row['title_match']) + { + $title_word_ids[] = $row['word_id']; + } + else + { + $message_word_ids[] = $row['word_id']; + } + $word_texts[] = $row['word_text']; + } + $this->db->sql_freeresult($result); + + if (sizeof($title_word_ids)) + { + $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' + SET word_count = word_count - 1 + WHERE ' . $this->db->sql_in_set('word_id', $title_word_ids) . ' + AND word_count > 0'; + $this->db->sql_query($sql); + } + + if (sizeof($message_word_ids)) + { + $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' + SET word_count = word_count - 1 + WHERE ' . $this->db->sql_in_set('word_id', $message_word_ids) . ' + AND word_count > 0'; + $this->db->sql_query($sql); + } + + unset($title_word_ids); + unset($message_word_ids); + + $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . ' + WHERE ' . $this->db->sql_in_set('post_id', $post_ids); + $this->db->sql_query($sql); + } + + $this->destroy_cache(array_unique($word_texts), array_unique($author_ids)); + } + + /** + * Tidy up indexes: Tag 'common words' and remove + * words no longer referenced in the match table + */ + public function tidy() + { + // Is the fulltext indexer disabled? If yes then we need not + // 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); + return; + } + + $destroy_cache_words = array(); + + // Remove common words + if ($this->config['num_posts'] >= 100 && $this->config['fulltext_native_common_thres']) + { + $common_threshold = ((double) $this->config['fulltext_native_common_thres']) / 100.0; + // First, get the IDs of common words + $sql = 'SELECT word_id, word_text + FROM ' . SEARCH_WORDLIST_TABLE . ' + WHERE word_count > ' . floor($this->config['num_posts'] * $common_threshold) . ' + OR word_common = 1'; + $result = $this->db->sql_query($sql); + + $sql_in = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $sql_in[] = $row['word_id']; + $destroy_cache_words[] = $row['word_text']; + } + $this->db->sql_freeresult($result); + + if (sizeof($sql_in)) + { + // Flag the words + $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' + SET word_common = 1 + WHERE ' . $this->db->sql_in_set('word_id', $sql_in); + $this->db->sql_query($sql); + + // 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); + + // Delete the matches + $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . ' + WHERE ' . $this->db->sql_in_set('word_id', $sql_in); + $this->db->sql_query($sql); + } + unset($sql_in); + } + + if (sizeof($destroy_cache_words)) + { + // destroy cached search results containing any of the words that are now common or were removed + $this->destroy_cache(array_unique($destroy_cache_words)); + } + + set_config('search_last_gc', time(), true); + } + + /** + * Deletes all words from the index + */ + public function delete_index($acp_module, $u_action) + { + switch ($this->db->get_sql_layer()) + { + case 'sqlite': + case 'sqlite3': + $this->db->sql_query('DELETE FROM ' . SEARCH_WORDLIST_TABLE); + $this->db->sql_query('DELETE FROM ' . SEARCH_WORDMATCH_TABLE); + $this->db->sql_query('DELETE FROM ' . SEARCH_RESULTS_TABLE); + break; + + default: + $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDLIST_TABLE); + $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDMATCH_TABLE); + $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); + break; + } + } + + /** + * Returns true if both FULLTEXT indexes exist + */ + public function index_created() + { + if (!sizeof($this->stats)) + { + $this->get_stats(); + } + + return ($this->stats['total_words'] && $this->stats['total_matches']) ? true : false; + } + + /** + * Returns an associative array containing information about the indexes + */ + public function index_stats() + { + if (!sizeof($this->stats)) + { + $this->get_stats(); + } + + return array( + $this->user->lang['TOTAL_WORDS'] => $this->stats['total_words'], + $this->user->lang['TOTAL_MATCHES'] => $this->stats['total_matches']); + } + + protected function get_stats() + { + $this->stats['total_words'] = $this->db->get_estimated_row_count(SEARCH_WORDLIST_TABLE); + $this->stats['total_matches'] = $this->db->get_estimated_row_count(SEARCH_WORDMATCH_TABLE); + } + + /** + * Clean up a text to remove non-alphanumeric characters + * + * This method receives a UTF-8 string, normalizes and validates it, replaces all + * non-alphanumeric characters with strings then returns the result. + * + * Any number of "allowed chars" can be passed as a UTF-8 string in NFC. + * + * @param string $text Text to split, in UTF-8 (not normalized or sanitized) + * @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') + { + static $conv = array(), $conv_loaded = array(); + $words = $allow = array(); + + // Convert the text to UTF-8 + $encoding = strtolower($encoding); + if ($encoding != 'utf-8') + { + $text = utf8_recode($text, $encoding); + } + + $utf_len_mask = array( + "\xC0" => 2, + "\xD0" => 2, + "\xE0" => 3, + "\xF0" => 4 + ); + + /** + * Replace HTML entities and NCRs + */ + $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 + */ + \utf_normalizer::nfc($text); + + /** + * The first thing we do is: + * + * - convert ASCII-7 letters to lowercase + * - remove the ASCII-7 non-alpha characters + * - remove the bytes that should not appear in a valid UTF-8 string: 0xC0, + * 0xC1 and 0xF5-0xFF + * + * @todo in theory, the third one is already taken care of during normalization and those chars should have been replaced by Unicode replacement chars + */ + $sb_match = "ISTCPAMELRDOJBNHFGVWUQKYXZ\r\n\t!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\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\xC0\xC1\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"; + $sb_replace = 'istcpamelrdojbnhfgvwuqkyxz '; + + /** + * This is the list of legal ASCII chars, it is automatically extended + * with ASCII chars from $allowed_chars + */ + $legal_ascii = ' eaisntroludcpmghbfvq10xy2j9kw354867z'; + + /** + * Prepare an array containing the extra chars to allow + */ + if (isset($allowed_chars[0])) + { + $pos = 0; + $len = strlen($allowed_chars); + do + { + $c = $allowed_chars[$pos]; + + if ($c < "\x80") + { + /** + * ASCII char + */ + $sb_pos = strpos($sb_match, $c); + if (is_int($sb_pos)) + { + /** + * Remove the char from $sb_match and its corresponding + * replacement in $sb_replace + */ + $sb_match = substr($sb_match, 0, $sb_pos) . substr($sb_match, $sb_pos + 1); + $sb_replace = substr($sb_replace, 0, $sb_pos) . substr($sb_replace, $sb_pos + 1); + $legal_ascii .= $c; + } + + ++$pos; + } + else + { + /** + * UTF-8 char + */ + $utf_len = $utf_len_mask[$c & "\xF0"]; + $allow[substr($allowed_chars, $pos, $utf_len)] = 1; + $pos += $utf_len; + } + } + while ($pos < $len); + } + + $text = strtr($text, $sb_match, $sb_replace); + $ret = ''; + + $pos = 0; + $len = strlen($text); + + do + { + /** + * Do all consecutive ASCII chars at once + */ + if ($spn = strspn($text, $legal_ascii, $pos)) + { + $ret .= substr($text, $pos, $spn); + $pos += $spn; + } + + if ($pos >= $len) + { + return $ret; + } + + /** + * Capture the UTF char + */ + $utf_len = $utf_len_mask[$text[$pos] & "\xF0"]; + $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)) + { + /** + * All characters within these ranges are valid + * + * We separate them with a space in order to index each character + * individually + */ + $ret .= ' ' . $utf_char . ' '; + continue; + } + + if (isset($allow[$utf_char])) + { + /** + * The char is explicitly allowed + */ + $ret .= $utf_char; + continue; + } + + if (isset($conv[$utf_char])) + { + /** + * The char is mapped to something, maybe to itself actually + */ + $ret .= $conv[$utf_char]; + continue; + } + + /** + * The char isn't mapped, but did we load its conversion table? + * + * The search indexer table is split into blocks. The block number of + * each char is equal to its codepoint right-shifted for 11 bits. It + * means that out of the 11, 16 or 21 meaningful bits of a 2-, 3- or + * 4- byte sequence we only keep the leftmost 0, 5 or 10 bits. Thus, + * all UTF chars encoded in 2 bytes are in the same first block. + */ + if (isset($utf_char[2])) + { + if (isset($utf_char[3])) + { + /** + * 1111 0nnn 10nn nnnn 10nx xxxx 10xx xxxx + * 0000 0111 0011 1111 0010 0000 + */ + $idx = ((ord($utf_char[0]) & 0x07) << 7) | ((ord($utf_char[1]) & 0x3F) << 1) | ((ord($utf_char[2]) & 0x20) >> 5); + } + else + { + /** + * 1110 nnnn 10nx xxxx 10xx xxxx + * 0000 0111 0010 0000 + */ + $idx = ((ord($utf_char[0]) & 0x07) << 1) | ((ord($utf_char[1]) & 0x20) >> 5); + } + } + else + { + /** + * 110x xxxx 10xx xxxx + * 0000 0000 0000 0000 + */ + $idx = 0; + } + + /** + * Check if the required conv table has been loaded already + */ + if (!isset($conv_loaded[$idx])) + { + $conv_loaded[$idx] = 1; + $file = $this->phpbb_root_path . 'includes/utf/data/search_indexer_' . $idx . '.' . $this->php_ext; + + if (file_exists($file)) + { + $conv += include($file); + } + } + + if (isset($conv[$utf_char])) + { + $ret .= $conv[$utf_char]; + } + else + { + /** + * We add an entry to the conversion table so that we + * don't have to convert to codepoint and perform the checks + * that are above this block + */ + $conv[$utf_char] = ' '; + $ret .= ' '; + } + } + while (1); + + return $ret; + } + + /** + * Returns a list of options for the ACP to display + */ + public function acp() + { + /** + * if we need any options, copied from fulltext_native for now, will have to be adjusted or removed + */ + + $tpl = ' +
+

' . $this->user->lang['YES_SEARCH_UPDATE_EXPLAIN'] . '
+
+
+
+

' . $this->user->lang['MIN_SEARCH_CHARS_EXPLAIN'] . '
+
+
+
+

' . $this->user->lang['MAX_SEARCH_CHARS_EXPLAIN'] . '
+
+
+
+

' . $this->user->lang['COMMON_WORD_THRESHOLD_EXPLAIN'] . '
+
%
+
+ '; + + // These are fields required in the config table + return array( + 'tpl' => $tpl, + 'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:255', 'fulltext_native_max_chars' => 'integer:0:255', 'fulltext_native_common_thres' => 'double:0:100') + ); + } +} diff --git a/sources/phpBB/phpbb/search/fulltext_postgres.php b/sources/phpBB/phpbb/search/fulltext_postgres.php new file mode 100644 index 0000000..b6af371 --- /dev/null +++ b/sources/phpBB/phpbb/search/fulltext_postgres.php @@ -0,0 +1,936 @@ + +* @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\search; + +/** +* Fulltext search for PostgreSQL +*/ +class fulltext_postgres extends \phpbb\search\base +{ + /** + * Associative array holding index stats + * @var array + */ + protected $stats = array(); + + /** + * Holds the words entered by user, obtained by splitting the entered query on whitespace + * @var array + */ + protected $split_words = array(); + + /** + * Stores the tsearch query + * @var string + */ + protected $tsearch_query; + + /** + * True if phrase search is supported. + * PostgreSQL fulltext currently doesn't support it + * @var boolean + */ + protected $phrase_search = false; + + /** + * Config object + * @var \phpbb\config\config + */ + protected $config; + + /** + * Database connection + * @var \phpbb\db\driver\driver_interface + */ + protected $db; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Contains tidied search query. + * Operators are prefixed in search query and common words excluded + * @var string + */ + protected $search_query; + + /** + * Contains common words. + * Common words are words with length less/more than min/max length + * @var array + */ + protected $common_words = array(); + + /** + * Associative array stores the min and max word length to be searched + * @var array + */ + protected $word_length = array(); + + /** + * Constructor + * Creates a new \phpbb\search\fulltext_postgres, which is used as a search backend + * + * @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false + * @param string $phpbb_root_path Relative path to phpBB root + * @param string $phpEx PHP file extension + * @param \phpbb\auth\auth $auth Auth object + * @param \phpbb\config\config $config Config object + * @param \phpbb\db\driver\driver_interface Database object + * @param \phpbb\user $user User object + */ + public function __construct(&$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user) + { + $this->config = $config; + $this->db = $db; + $this->user = $user; + + $this->word_length = array('min' => $this->config['fulltext_postgres_min_word_len'], 'max' => $this->config['fulltext_postgres_max_word_len']); + + /** + * Load the UTF tools + */ + if (!function_exists('utf8_strlen')) + { + include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); + } + + $error = false; + } + + /** + * Returns the name of this search backend to be displayed to administrators + * + * @return string Name + */ + public function get_name() + { + return 'PostgreSQL Fulltext'; + } + + /** + * Returns the search_query + * + * @return string search query + */ + public function get_search_query() + { + return $this->search_query; + } + + /** + * Returns the common_words array + * + * @return array common words that are ignored by search backend + */ + public function get_common_words() + { + return $this->common_words; + } + + /** + * Returns the word_length array + * + * @return array min and max word length for searching + */ + public function get_word_length() + { + return $this->word_length; + } + + /** + * Returns if phrase search is supported or not + * + * @return bool + */ + public function supports_phrase_search() + { + return $this->phrase_search; + } + + /** + * Checks for correct PostgreSQL version and stores min/max word length in the config + * + * @return string|bool Language key of the error/incompatiblity occurred + */ + public function init() + { + if ($this->db->get_sql_layer() != 'postgres') + { + return $this->user->lang['FULLTEXT_POSTGRES_INCOMPATIBLE_DATABASE']; + } + + return false; + } + + /** + * Splits keywords entered by a user into an array of words stored in $this->split_words + * Stores the tidied search query in $this->search_query + * + * @param string &$keywords Contains the keyword as entered by the user + * @param string $terms is either 'all' or 'any' + * @return bool false if no valid keywords were found and otherwise true + */ + public function split_keywords(&$keywords, $terms) + { + if ($terms == 'all') + { + $match = array('#\sand\s#iu', '#\sor\s#iu', '#\snot\s#iu', '#(^|\s)\+#', '#(^|\s)-#', '#(^|\s)\|#'); + $replace = array(' +', ' |', ' -', ' +', ' -', ' |'); + + $keywords = preg_replace($match, $replace, $keywords); + } + + // Filter out as above + $split_keywords = preg_replace("#[\"\n\r\t]+#", ' ', trim(htmlspecialchars_decode($keywords))); + + // Split words + $split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords))); + $matches = array(); + preg_match_all('#(?:[^\p{L}\p{N}*"()]|^)([+\-|]?(?:[\p{L}\p{N}*"()]+\'?)*[\p{L}\p{N}*"()])(?:[^\p{L}\p{N}*"()]|$)#u', $split_keywords, $matches); + $this->split_words = $matches[1]; + + foreach ($this->split_words as $i => $word) + { + $clean_word = preg_replace('#^[+\-|"]#', '', $word); + + // check word length + $clean_len = utf8_strlen(str_replace('*', '', $clean_word)); + if (($clean_len < $this->config['fulltext_postgres_min_word_len']) || ($clean_len > $this->config['fulltext_postgres_max_word_len'])) + { + $this->common_words[] = $word; + unset($this->split_words[$i]); + } + } + + if ($terms == 'any') + { + $this->search_query = ''; + $this->tsearch_query = ''; + foreach ($this->split_words as $word) + { + if ((strpos($word, '+') === 0) || (strpos($word, '-') === 0) || (strpos($word, '|') === 0)) + { + $word = substr($word, 1); + } + $this->search_query .= $word . ' '; + $this->tsearch_query .= '|' . $word . ' '; + } + } + else + { + $this->search_query = ''; + $this->tsearch_query = ''; + foreach ($this->split_words as $word) + { + if (strpos($word, '+') === 0) + { + $this->search_query .= $word . ' '; + $this->tsearch_query .= '&' . substr($word, 1) . ' '; + } + else if (strpos($word, '-') === 0) + { + $this->search_query .= $word . ' '; + $this->tsearch_query .= '&!' . substr($word, 1) . ' '; + } + else if (strpos($word, '|') === 0) + { + $this->search_query .= $word . ' '; + $this->tsearch_query .= '|' . substr($word, 1) . ' '; + } + else + { + $this->search_query .= '+' . $word . ' '; + $this->tsearch_query .= '&' . $word . ' '; + } + } + } + + $this->tsearch_query = substr($this->tsearch_query, 1); + $this->search_query = utf8_htmlspecialchars($this->search_query); + + if ($this->search_query) + { + $this->split_words = array_values($this->split_words); + sort($this->split_words); + return true; + } + return false; + } + + /** + * Turns text into an array of words + * @param string $text contains post text/subject + */ + public function split_message($text) + { + // Split words + $text = preg_replace('#([^\p{L}\p{N}\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text))); + $matches = array(); + preg_match_all('#(?:[^\p{L}\p{N}*]|^)([+\-|]?(?:[\p{L}\p{N}*]+\'?)*[\p{L}\p{N}*])(?:[^\p{L}\p{N}*]|$)#u', $text, $matches); + $text = $matches[1]; + + // remove too short or too long words + $text = array_values($text); + for ($i = 0, $n = sizeof($text); $i < $n; $i++) + { + $text[$i] = trim($text[$i]); + if (utf8_strlen($text[$i]) < $this->config['fulltext_postgres_min_word_len'] || utf8_strlen($text[$i]) > $this->config['fulltext_postgres_max_word_len']) + { + unset($text[$i]); + } + } + + return array_values($text); + } + + /** + * Performs a search on keywords depending on display specific params. You have to run split_keywords() first + * + * @param string $type contains either posts or topics depending on what should be searched for + * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched) + * @param string $terms is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words) + * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query + * @param string $sort_key is the key of $sort_by_sql for the selected sorting + * @param string $sort_dir is either a or d representing ASC and DESC + * @param string $sort_days specifies the maximum amount of days a post may be old + * @param array $ex_fid_ary specifies an array of forum ids which should not be searched + * @param string $post_visibility specifies which types of posts the user can view in which forums + * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched + * @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty + * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match + * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered + * @param int $start indicates the first index of the page + * @param int $per_page number of ids each page is supposed to contain + * @return boolean|int total number of results + */ + 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) + { + // No keywords? No posts + if (!$this->search_query) + { + return false; + } + + // When search query contains queries like -foo + if (strpos($this->search_query, '+') === false) + { + return false; + } + + // generate a search_key from all the options to identify the results + $search_key = md5(implode('#', array( + implode(', ', $this->split_words), + $type, + $fields, + $terms, + $sort_days, + $sort_key, + $topic_id, + implode(',', $ex_fid_ary), + $post_visibility, + implode(',', $author_ary) + ))); + + if ($start < 0) + { + $start = 0; + } + + // try reading the results from cache + $result_count = 0; + if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE) + { + return $result_count; + } + + $id_ary = array(); + + $join_topic = ($type == 'posts') ? false : true; + + // Build sql strings for sorting + $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); + $sql_sort_table = $sql_sort_join = ''; + + switch ($sql_sort[0]) + { + case 'u': + $sql_sort_table = USERS_TABLE . ' u, '; + $sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster '; + break; + + case 't': + $join_topic = true; + break; + + case 'f': + $sql_sort_table = FORUMS_TABLE . ' f, '; + $sql_sort_join = ' AND f.forum_id = p.forum_id '; + break; + } + + // Build some display specific sql strings + switch ($fields) + { + case 'titleonly': + $sql_match = 'p.post_subject'; + $sql_match_where = ' AND p.post_id = t.topic_first_post_id'; + $join_topic = true; + break; + + case 'msgonly': + $sql_match = 'p.post_text'; + $sql_match_where = ''; + break; + + case 'firstpost': + $sql_match = 'p.post_subject, p.post_text'; + $sql_match_where = ' AND p.post_id = t.topic_first_post_id'; + $join_topic = true; + break; + + default: + $sql_match = 'p.post_subject, p.post_text'; + $sql_match_where = ''; + break; + } + + $sql_select = ($type == 'posts') ? 'p.post_id' : 'DISTINCT t.topic_id'; + $sql_from = ($join_topic) ? TOPICS_TABLE . ' t, ' : ''; + $field = ($type == 'posts') ? 'post_id' : 'topic_id'; + $sql_author = (sizeof($author_ary) == 1) ? ' = ' . $author_ary[0] : 'IN (' . implode(', ', $author_ary) . ')'; + + if (sizeof($author_ary) && $author_name) + { + // first one matches post of registered users, second one guests and deleted users + $sql_author = '(' . $this->db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')'; + } + else if (sizeof($author_ary)) + { + $sql_author = ' AND ' . $this->db->sql_in_set('p.poster_id', $author_ary); + } + else + { + $sql_author = ''; + } + + $sql_where_options = $sql_sort_join; + $sql_where_options .= ($topic_id) ? ' AND p.topic_id = ' . $topic_id : ''; + $sql_where_options .= ($join_topic) ? ' AND t.topic_id = p.topic_id' : ''; + $sql_where_options .= (sizeof($ex_fid_ary)) ? ' AND ' . $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true) : ''; + $sql_where_options .= ' AND ' . $post_visibility; + $sql_where_options .= $sql_author; + $sql_where_options .= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : ''; + $sql_where_options .= $sql_match_where; + + $tmp_sql_match = array(); + $sql_match = str_replace(',', " || ' ' ||", $sql_match); + $tmp_sql_match = "to_tsvector ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', " . $sql_match . ") @@ to_tsquery ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', '" . $this->db->sql_escape($this->tsearch_query) . "')"; + + $this->db->sql_transaction('begin'); + + $sql_from = "FROM $sql_from$sql_sort_table" . POSTS_TABLE . " p"; + $sql_where = "WHERE (" . $tmp_sql_match . ") + $sql_where_options"; + $sql = "SELECT $sql_select + $sql_from + $sql_where + ORDER BY $sql_sort"; + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = $row[$field]; + } + $this->db->sql_freeresult($result); + + $id_ary = array_unique($id_ary); + + // if the total result count is not cached yet, retrieve it from the db + if (!$result_count) + { + $sql_count = "SELECT COUNT(*) as result_count + $sql_from + $sql_where"; + $result = $this->db->sql_query($sql_count); + $result_count = (int) $this->db->sql_fetchfield('result_count'); + $this->db->sql_freeresult($result); + + if (!$result_count) + { + return false; + } + } + + $this->db->sql_transaction('commit'); + + if ($start >= $result_count) + { + $start = floor(($result_count - 1) / $per_page) * $per_page; + + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = $row[$field]; + } + $this->db->sql_freeresult($result); + + $id_ary = array_unique($id_ary); + } + + // store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page + $this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir); + $id_ary = array_slice($id_ary, 0, (int) $per_page); + + return $result_count; + } + + /** + * Performs a search on an author's posts without caring about message contents. Depends on display specific params + * + * @param string $type contains either posts or topics depending on what should be searched for + * @param boolean $firstpost_only if true, only topic starting posts will be considered + * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query + * @param string $sort_key is the key of $sort_by_sql for the selected sorting + * @param string $sort_dir is either a or d representing ASC and DESC + * @param string $sort_days specifies the maximum amount of days a post may be old + * @param array $ex_fid_ary specifies an array of forum ids which should not be searched + * @param string $post_visibility specifies which types of posts the user can view in which forums + * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched + * @param array $author_ary an array of author ids + * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match + * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered + * @param int $start indicates the first index of the page + * @param int $per_page number of ids each page is supposed to contain + * @return boolean|int total number of results + */ + public function author_search($type, $firstpost_only, $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) + { + // No author? No posts + if (!sizeof($author_ary)) + { + return 0; + } + + // generate a search_key from all the options to identify the results + $search_key = md5(implode('#', array( + '', + $type, + ($firstpost_only) ? 'firstpost' : '', + '', + '', + $sort_days, + $sort_key, + $topic_id, + implode(',', $ex_fid_ary), + $post_visibility, + implode(',', $author_ary), + $author_name, + ))); + + if ($start < 0) + { + $start = 0; + } + + // try reading the results from cache + $result_count = 0; + if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE) + { + return $result_count; + } + + $id_ary = array(); + + // Create some display specific sql strings + if ($author_name) + { + // first one matches post of registered users, second one guests and deleted users + $sql_author = '(' . $this->db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')'; + } + else + { + $sql_author = $this->db->sql_in_set('p.poster_id', $author_ary); + } + $sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true) : ''; + $sql_topic_id = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : ''; + $sql_time = ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : ''; + $sql_firstpost = ($firstpost_only) ? ' AND p.post_id = t.topic_first_post_id' : ''; + + // Build sql strings for sorting + $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); + $sql_sort_table = $sql_sort_join = ''; + switch ($sql_sort[0]) + { + case 'u': + $sql_sort_table = USERS_TABLE . ' u, '; + $sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster '; + break; + + case 't': + $sql_sort_table = ($type == 'posts' && !$firstpost_only) ? TOPICS_TABLE . ' t, ' : ''; + $sql_sort_join = ($type == 'posts' && !$firstpost_only) ? ' AND t.topic_id = p.topic_id ' : ''; + break; + + case 'f': + $sql_sort_table = FORUMS_TABLE . ' f, '; + $sql_sort_join = ' AND f.forum_id = p.forum_id '; + break; + } + + $m_approve_fid_sql = ' AND ' . $post_visibility; + + // Build the query for really selecting the post_ids + if ($type == 'posts') + { + $sql = "SELECT p.post_id + FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . " + WHERE $sql_author + $sql_topic_id + $sql_firstpost + $m_approve_fid_sql + $sql_fora + $sql_sort_join + $sql_time + ORDER BY $sql_sort"; + $field = 'post_id'; + } + else + { + $sql = "SELECT t.topic_id + FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p + WHERE $sql_author + $sql_topic_id + $sql_firstpost + $m_approve_fid_sql + $sql_fora + AND t.topic_id = p.topic_id + $sql_sort_join + $sql_time + GROUP BY t.topic_id, $sort_by_sql[$sort_key] + ORDER BY $sql_sort"; + $field = 'topic_id'; + } + + $this->db->sql_transaction('begin'); + + // Only read one block of posts from the db and then cache it + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = $row[$field]; + } + $this->db->sql_freeresult($result); + + // retrieve the total result count if needed + if (!$result_count) + { + if ($type == 'posts') + { + $sql_count = "SELECT COUNT(*) as result_count + FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . " + WHERE $sql_author + $sql_topic_id + $sql_firstpost + $m_approve_fid_sql + $sql_fora + $sql_sort_join + $sql_time"; + } + else + { + $sql_count = "SELECT COUNT(*) as result_count + FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p + WHERE $sql_author + $sql_topic_id + $sql_firstpost + $m_approve_fid_sql + $sql_fora + AND t.topic_id = p.topic_id + $sql_sort_join + $sql_time + GROUP BY t.topic_id, $sort_by_sql[$sort_key]"; + } + + $result = $this->db->sql_query($sql_count); + $result_count = (int) $this->db->sql_fetchfield('result_count'); + + if (!$result_count) + { + return false; + } + } + + $this->db->sql_transaction('commit'); + + if ($start >= $result_count) + { + $start = floor(($result_count - 1) / $per_page) * $per_page; + + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = (int) $row[$field]; + } + $this->db->sql_freeresult($result); + + $id_ary = array_unique($id_ary); + } + + if (sizeof($id_ary)) + { + $this->save_ids($search_key, '', $author_ary, $result_count, $id_ary, $start, $sort_dir); + $id_ary = array_slice($id_ary, 0, $per_page); + + return $result_count; + } + return false; + } + + /** + * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated + * + * @param string $mode contains the post mode: edit, post, reply, quote ... + * @param int $post_id contains the post id of the post to index + * @param string $message contains the post text of the post + * @param string $subject contains the subject of the post to index + * @param int $poster_id contains the user id of the poster + * @param int $forum_id contains the forum id of parent forum of the post + */ + public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) + { + // Split old and new post/subject to obtain array of words + $split_text = $this->split_message($message); + $split_title = ($subject) ? $this->split_message($subject) : array(); + + $words = array_unique(array_merge($split_text, $split_title)); + + unset($split_text); + unset($split_title); + + // destroy cached search results containing any of the words removed or added + $this->destroy_cache($words, array($poster_id)); + + unset($words); + } + + /** + * Destroy cached results, that might be outdated after deleting a post + */ + public function index_remove($post_ids, $author_ids, $forum_ids) + { + $this->destroy_cache(array(), $author_ids); + } + + /** + * Destroy old cache entries + */ + public function tidy() + { + // destroy too old cached search results + $this->destroy_cache(array()); + + set_config('search_last_gc', time(), true); + } + + /** + * Create fulltext index + * + * @return string|bool error string is returned incase of errors otherwise false + */ + public function create_index($acp_module, $u_action) + { + // Make sure we can actually use PostgreSQL with fulltext indexes + if ($error = $this->init()) + { + return $error; + } + + if (empty($this->stats)) + { + $this->get_stats(); + } + + if (!isset($this->stats['post_subject'])) + { + $this->db->sql_query("CREATE INDEX " . POSTS_TABLE . "_" . $this->config['fulltext_postgres_ts_name'] . "_post_subject ON " . POSTS_TABLE . " USING gin (to_tsvector ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', post_subject))"); + } + + if (!isset($this->stats['post_content'])) + { + $this->db->sql_query("CREATE INDEX " . POSTS_TABLE . "_" . $this->config['fulltext_postgres_ts_name'] . "_post_content ON " . POSTS_TABLE . " USING gin (to_tsvector ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', post_text || ' ' || post_subject))"); + } + + $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); + + return false; + } + + /** + * Drop fulltext index + * + * @return string|bool error string is returned incase of errors otherwise false + */ + public function delete_index($acp_module, $u_action) + { + // Make sure we can actually use PostgreSQL with fulltext indexes + if ($error = $this->init()) + { + return $error; + } + + if (empty($this->stats)) + { + $this->get_stats(); + } + + if (isset($this->stats['post_subject'])) + { + $this->db->sql_query('DROP INDEX ' . $this->stats['post_subject']['relname']); + } + + if (isset($this->stats['post_content'])) + { + $this->db->sql_query('DROP INDEX ' . $this->stats['post_content']['relname']); + } + + $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); + + return false; + } + + /** + * Returns true if both FULLTEXT indexes exist + */ + public function index_created() + { + if (empty($this->stats)) + { + $this->get_stats(); + } + + return (isset($this->stats['post_subject']) && isset($this->stats['post_content'])) ? true : false; + } + + /** + * Returns an associative array containing information about the indexes + */ + public function index_stats() + { + if (empty($this->stats)) + { + $this->get_stats(); + } + + return array( + $this->user->lang['FULLTEXT_POSTGRES_TOTAL_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] : 0, + ); + } + + /** + * Computes the stats and store them in the $this->stats associative array + */ + protected function get_stats() + { + if ($this->db->get_sql_layer() != 'postgres') + { + $this->stats = array(); + return; + } + + $sql = "SELECT c2.relname, pg_catalog.pg_get_indexdef(i.indexrelid, 0, true) AS indexdef + FROM pg_catalog.pg_class c1, pg_catalog.pg_index i, pg_catalog.pg_class c2 + WHERE c1.relname = '" . POSTS_TABLE . "' + AND pg_catalog.pg_table_is_visible(c1.oid) + AND c1.oid = i.indrelid + AND i.indexrelid = c2.oid"; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + // deal with older PostgreSQL versions which didn't use Index_type + if (strpos($row['indexdef'], 'to_tsvector') !== false) + { + if ($row['relname'] == POSTS_TABLE . '_' . $this->config['fulltext_postgres_ts_name'] . '_post_subject' || $row['relname'] == POSTS_TABLE . '_post_subject') + { + $this->stats['post_subject'] = $row; + } + else if ($row['relname'] == POSTS_TABLE . '_' . $this->config['fulltext_postgres_ts_name'] . '_post_content' || $row['relname'] == POSTS_TABLE . '_post_content') + { + $this->stats['post_content'] = $row; + } + } + } + $this->db->sql_freeresult($result); + + $this->stats['total_posts'] = $this->config['num_posts']; + } + + /** + * Display various options that can be configured for the backend from the acp + * + * @return associative array containing template and config variables + */ + public function acp() + { + $tpl = ' +
+

' . $this->user->lang['FULLTEXT_POSTGRES_VERSION_CHECK_EXPLAIN'] . '
+
' . (($this->db->get_sql_layer() == 'postgres') ? $this->user->lang['YES'] : $this->user->lang['NO']) . '
+
+
+

' . $this->user->lang['FULLTEXT_POSTGRES_TS_NAME_EXPLAIN'] . '
+
+
+
+

' . $this->user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN_EXPLAIN'] . '
+
+
+
+

' . $this->user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN_EXPLAIN'] . '
+
+
+ '; + + // These are fields required in the config table + return array( + 'tpl' => $tpl, + 'config' => array('fulltext_postgres_ts_name' => 'string', 'fulltext_postgres_min_word_len' => 'integer:0:255', 'fulltext_postgres_max_word_len' => 'integer:0:255') + ); + } +} diff --git a/sources/phpBB/phpbb/search/fulltext_sphinx.php b/sources/phpBB/phpbb/search/fulltext_sphinx.php new file mode 100644 index 0000000..eb53ca6 --- /dev/null +++ b/sources/phpBB/phpbb/search/fulltext_sphinx.php @@ -0,0 +1,913 @@ + +* @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\search; + +define('SPHINX_MAX_MATCHES', 20000); +define('SPHINX_CONNECT_RETRIES', 3); +define('SPHINX_CONNECT_WAIT_TIME', 300); + +/** +* Fulltext search based on the sphinx search deamon +*/ +class fulltext_sphinx +{ + /** + * Associative array holding index stats + * @var array + */ + protected $stats = array(); + + /** + * Holds the words entered by user, obtained by splitting the entered query on whitespace + * @var array + */ + protected $split_words = array(); + + /** + * Holds unique sphinx id + * @var string + */ + protected $id; + + /** + * Stores the names of both main and delta sphinx indexes + * separated by a semicolon + * @var string + */ + protected $indexes; + + /** + * Sphinx searchd client object + * @var SphinxClient + */ + protected $sphinx; + + /** + * Relative path to board root + * @var string + */ + protected $phpbb_root_path; + + /** + * PHP Extension + * @var string + */ + protected $php_ext; + + /** + * Auth object + * @var \phpbb\auth\auth + */ + protected $auth; + + /** + * Config object + * @var \phpbb\config\config + */ + protected $config; + + /** + * Database connection + * @var \phpbb\db\driver\driver_interface + */ + protected $db; + + /** + * Database Tools object + * @var \phpbb\db\tools + */ + protected $db_tools; + + /** + * Stores the database type if supported by sphinx + * @var string + */ + protected $dbtype; + + /** + * User object + * @var \phpbb\user + */ + protected $user; + + /** + * Stores the generated content of the sphinx config file + * @var string + */ + protected $config_file_data = ''; + + /** + * Contains tidied search query. + * Operators are prefixed in search query and common words excluded + * @var string + */ + protected $search_query; + + /** + * Constructor + * Creates a new \phpbb\search\fulltext_postgres, which is used as a search backend + * + * @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false + * @param string $phpbb_root_path Relative path to phpBB root + * @param string $phpEx PHP file extension + * @param \phpbb\auth\auth $auth Auth object + * @param \phpbb\config\config $config Config object + * @param \phpbb\db\driver\driver_interface Database object + * @param \phpbb\user $user User object + */ + public function __construct(&$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $phpEx; + $this->config = $config; + $this->user = $user; + $this->db = $db; + $this->auth = $auth; + + // Initialize \phpbb\db\tools object + $this->db_tools = new \phpbb\db\tools($this->db); + + if(!$this->config['fulltext_sphinx_id']) + { + set_config('fulltext_sphinx_id', unique_id()); + } + $this->id = $this->config['fulltext_sphinx_id']; + $this->indexes = 'index_phpbb_' . $this->id . '_delta;index_phpbb_' . $this->id . '_main'; + + if (!class_exists('SphinxClient')) + { + require($this->phpbb_root_path . 'includes/sphinxapi.' . $this->php_ext); + } + + // Initialize sphinx client + $this->sphinx = new \SphinxClient(); + + $this->sphinx->SetServer(($this->config['fulltext_sphinx_host'] ? $this->config['fulltext_sphinx_host'] : 'localhost'), ($this->config['fulltext_sphinx_port'] ? (int) $this->config['fulltext_sphinx_port'] : 9312)); + + $error = false; + } + + /** + * Returns the name of this search backend to be displayed to administrators + * + * @return string Name + */ + public function get_name() + { + return 'Sphinx Fulltext'; + } + + /** + * Returns the search_query + * + * @return string search query + */ + public function get_search_query() + { + return $this->search_query; + } + + /** + * Returns false as there is no word_len array + * + * @return false + */ + public function get_word_length() + { + return false; + } + + /** + * Returns an empty array as there are no common_words + * + * @return array common words that are ignored by search backend + */ + public function get_common_words() + { + return array(); + } + + /** + * Checks permissions and paths, if everything is correct it generates the config file + * + * @return string|bool Language key of the error/incompatiblity encountered, or false if successful + */ + public function init() + { + if ($this->db->get_sql_layer() != 'mysql' && $this->db->get_sql_layer() != 'mysql4' && $this->db->get_sql_layer() != 'mysqli' && $this->db->get_sql_layer() != 'postgres') + { + return $this->user->lang['FULLTEXT_SPHINX_WRONG_DATABASE']; + } + + // Move delta to main index each hour + set_config('search_gc', 3600); + + return false; + } + + /** + * Generates content of sphinx.conf + * + * @return bool True if sphinx.conf content is correctly generated, false otherwise + */ + protected function config_generate() + { + // Check if Database is supported by Sphinx + if ($this->db->get_sql_layer() =='mysql' || $this->db->get_sql_layer() == 'mysql4' || $this->db->get_sql_layer() == 'mysqli') + { + $this->dbtype = 'mysql'; + } + else if ($this->db->get_sql_layer() == 'postgres') + { + $this->dbtype = 'pgsql'; + } + else + { + $this->config_file_data = $this->user->lang('FULLTEXT_SPHINX_WRONG_DATABASE'); + return false; + } + + // Check if directory paths have been filled + if (!$this->config['fulltext_sphinx_data_path']) + { + $this->config_file_data = $this->user->lang('FULLTEXT_SPHINX_NO_CONFIG_DATA'); + return false; + } + + include($this->phpbb_root_path . 'config.' . $this->php_ext); + + /* Now that we're sure everything was entered correctly, + generate a config for the index. We use a config value + fulltext_sphinx_id for this, as it should be unique. */ + $config_object = new \phpbb\search\sphinx\config($this->config_file_data); + $config_data = array( + 'source source_phpbb_' . $this->id . '_main' => array( + array('type', $this->dbtype . ' # mysql or pgsql'), + // This config value sql_host needs to be changed incase sphinx and sql are on different servers + array('sql_host', $dbhost . ' # SQL server host sphinx connects to'), + array('sql_user', '[dbuser]'), + array('sql_pass', '[dbpassword]'), + array('sql_db', $dbname), + array('sql_port', $dbport . ' # optional, default is 3306 for mysql and 5432 for pgsql'), + array('sql_query_pre', 'SET NAMES \'utf8\''), + array('sql_query_pre', 'UPDATE ' . SPHINX_TABLE . ' SET max_doc_id = (SELECT MAX(post_id) FROM ' . POSTS_TABLE . ') WHERE counter_id = 1'), + array('sql_query_range', 'SELECT MIN(post_id), MAX(post_id) FROM ' . POSTS_TABLE . ''), + array('sql_range_step', '5000'), + array('sql_query', 'SELECT + p.post_id AS id, + p.forum_id, + p.topic_id, + p.poster_id, + p.post_visibility, + CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, + p.post_time, + p.post_subject, + p.post_subject as title, + p.post_text as data, + t.topic_last_post_time, + 0 as deleted + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t + WHERE + p.topic_id = t.topic_id + AND p.post_id >= $start AND p.post_id <= $end'), + array('sql_query_post', ''), + array('sql_query_post_index', 'UPDATE ' . SPHINX_TABLE . ' SET max_doc_id = $maxid WHERE counter_id = 1'), + array('sql_query_info', 'SELECT * FROM ' . POSTS_TABLE . ' WHERE post_id = $id'), + array('sql_attr_uint', 'forum_id'), + array('sql_attr_uint', 'topic_id'), + array('sql_attr_uint', 'poster_id'), + array('sql_attr_uint', 'post_visibility'), + array('sql_attr_bool', 'topic_first_post'), + array('sql_attr_bool', 'deleted'), + array('sql_attr_timestamp', 'post_time'), + array('sql_attr_timestamp', 'topic_last_post_time'), + array('sql_attr_string', 'post_subject'), + ), + 'source source_phpbb_' . $this->id . '_delta : source_phpbb_' . $this->id . '_main' => array( + array('sql_query_pre', ''), + array('sql_query_range', ''), + array('sql_range_step', ''), + array('sql_query', 'SELECT + p.post_id AS id, + p.forum_id, + p.topic_id, + p.poster_id, + p.post_visibility, + CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, + p.post_time, + p.post_subject, + p.post_subject as title, + p.post_text as data, + t.topic_last_post_time, + 0 as deleted + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t + WHERE + p.topic_id = t.topic_id + AND p.post_id >= ( SELECT max_doc_id FROM ' . SPHINX_TABLE . ' WHERE counter_id=1 )'), + ), + 'index index_phpbb_' . $this->id . '_main' => array( + array('path', $this->config['fulltext_sphinx_data_path'] . 'index_phpbb_' . $this->id . '_main'), + array('source', 'source_phpbb_' . $this->id . '_main'), + array('docinfo', 'extern'), + array('morphology', 'none'), + array('stopwords', ''), + array('min_word_len', '2'), + array('charset_type', 'utf-8'), + array('charset_table', 'U+FF10..U+FF19->0..9, 0..9, U+FF41..U+FF5A->a..z, U+FF21..U+FF3A->a..z, A..Z->a..z, a..z, U+0149, U+017F, U+0138, U+00DF, U+00FF, U+00C0..U+00D6->U+00E0..U+00F6, U+00E0..U+00F6, U+00D8..U+00DE->U+00F8..U+00FE, U+00F8..U+00FE, U+0100->U+0101, U+0101, U+0102->U+0103, U+0103, U+0104->U+0105, U+0105, U+0106->U+0107, U+0107, U+0108->U+0109, U+0109, U+010A->U+010B, U+010B, U+010C->U+010D, U+010D, U+010E->U+010F, U+010F, U+0110->U+0111, U+0111, U+0112->U+0113, U+0113, U+0114->U+0115, U+0115, U+0116->U+0117, U+0117, U+0118->U+0119, U+0119, U+011A->U+011B, U+011B, U+011C->U+011D, U+011D, U+011E->U+011F, U+011F, U+0130->U+0131, U+0131, U+0132->U+0133, U+0133, U+0134->U+0135, U+0135, U+0136->U+0137, U+0137, U+0139->U+013A, U+013A, U+013B->U+013C, U+013C, U+013D->U+013E, U+013E, U+013F->U+0140, U+0140, U+0141->U+0142, U+0142, U+0143->U+0144, U+0144, U+0145->U+0146, U+0146, U+0147->U+0148, U+0148, U+014A->U+014B, U+014B, U+014C->U+014D, U+014D, U+014E->U+014F, U+014F, U+0150->U+0151, U+0151, U+0152->U+0153, U+0153, U+0154->U+0155, U+0155, U+0156->U+0157, U+0157, U+0158->U+0159, U+0159, U+015A->U+015B, U+015B, U+015C->U+015D, U+015D, U+015E->U+015F, U+015F, U+0160->U+0161, U+0161, U+0162->U+0163, U+0163, U+0164->U+0165, U+0165, U+0166->U+0167, U+0167, U+0168->U+0169, U+0169, U+016A->U+016B, U+016B, U+016C->U+016D, U+016D, U+016E->U+016F, U+016F, U+0170->U+0171, U+0171, U+0172->U+0173, U+0173, U+0174->U+0175, U+0175, U+0176->U+0177, U+0177, U+0178->U+00FF, U+00FF, U+0179->U+017A, U+017A, U+017B->U+017C, U+017C, U+017D->U+017E, U+017E, U+0410..U+042F->U+0430..U+044F, U+0430..U+044F, U+4E00..U+9FFF'), + array('min_prefix_len', '0'), + array('min_infix_len', '0'), + ), + 'index index_phpbb_' . $this->id . '_delta : index_phpbb_' . $this->id . '_main' => array( + array('path', $this->config['fulltext_sphinx_data_path'] . 'index_phpbb_' . $this->id . '_delta'), + array('source', 'source_phpbb_' . $this->id . '_delta'), + ), + 'indexer' => array( + array('mem_limit', $this->config['fulltext_sphinx_indexer_mem_limit'] . 'M'), + ), + 'searchd' => array( + array('compat_sphinxql_magics' , '0'), + array('listen' , ($this->config['fulltext_sphinx_host'] ? $this->config['fulltext_sphinx_host'] : 'localhost') . ':' . ($this->config['fulltext_sphinx_port'] ? $this->config['fulltext_sphinx_port'] : '9312')), + array('log', $this->config['fulltext_sphinx_data_path'] . 'log/searchd.log'), + array('query_log', $this->config['fulltext_sphinx_data_path'] . 'log/sphinx-query.log'), + array('read_timeout', '5'), + array('max_children', '30'), + array('pid_file', $this->config['fulltext_sphinx_data_path'] . 'searchd.pid'), + array('max_matches', (string) SPHINX_MAX_MATCHES), + array('binlog_path', $this->config['fulltext_sphinx_data_path']), + ), + ); + + $non_unique = array('sql_query_pre' => true, 'sql_attr_uint' => true, 'sql_attr_timestamp' => true, 'sql_attr_str2ordinal' => true, 'sql_attr_bool' => true); + $delete = array('sql_group_column' => true, 'sql_date_column' => true, 'sql_str2ordinal_column' => true); + foreach ($config_data as $section_name => $section_data) + { + $section = $config_object->get_section_by_name($section_name); + if (!$section) + { + $section = $config_object->add_section($section_name); + } + + foreach ($delete as $key => $void) + { + $section->delete_variables_by_name($key); + } + + foreach ($non_unique as $key => $void) + { + $section->delete_variables_by_name($key); + } + + foreach ($section_data as $entry) + { + $key = $entry[0]; + $value = $entry[1]; + + if (!isset($non_unique[$key])) + { + $variable = $section->get_variable_by_name($key); + if (!$variable) + { + $variable = $section->create_variable($key, $value); + } + else + { + $variable->set_value($value); + } + } + else + { + $variable = $section->create_variable($key, $value); + } + } + } + $this->config_file_data = $config_object->get_data(); + + return true; + } + + /** + * Splits keywords entered by a user into an array of words stored in $this->split_words + * Stores the tidied search query in $this->search_query + * + * @param string $keywords Contains the keyword as entered by the user + * @param string $terms is either 'all' or 'any' + * @return false if no valid keywords were found and otherwise true + */ + public function split_keywords(&$keywords, $terms) + { + if ($terms == 'all') + { + $match = array('#\sand\s#i', '#\sor\s#i', '#\snot\s#i', '#\+#', '#-#', '#\|#', '#@#'); + $replace = array(' & ', ' | ', ' - ', ' +', ' -', ' |', ''); + + $replacements = 0; + $keywords = preg_replace($match, $replace, $keywords); + $this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED); + } + else + { + $this->sphinx->SetMatchMode(SPH_MATCH_ANY); + } + + // Keep quotes and new lines + $keywords = str_replace(array('"', "\n"), array('"', ' '), trim($keywords)); + + if (strlen($keywords) > 0) + { + $this->search_query = str_replace('"', '"', $keywords); + return true; + } + + return false; + } + + /** + * Performs a search on keywords depending on display specific params. You have to run split_keywords() first + * + * @param string $type contains either posts or topics depending on what should be searched for + * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched) + * @param string $terms is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words) + * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query + * @param string $sort_key is the key of $sort_by_sql for the selected sorting + * @param string $sort_dir is either a or d representing ASC and DESC + * @param string $sort_days specifies the maximum amount of days a post may be old + * @param array $ex_fid_ary specifies an array of forum ids which should not be searched + * @param string $post_visibility specifies which types of posts the user can view in which forums + * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched + * @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty + * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match + * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered + * @param int $start indicates the first index of the page + * @param int $per_page number of ids each page is supposed to contain + * @return boolean|int total number of results + */ + 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) + { + // No keywords? No posts. + if (!strlen($this->search_query) && !sizeof($author_ary)) + { + return false; + } + + $id_ary = array(); + + $join_topic = ($type != 'posts'); + + // Sorting + + if ($type == 'topics') + { + switch ($sort_key) + { + case 'a': + $this->sphinx->SetGroupBy('topic_id', SPH_GROUPBY_ATTR, 'poster_id ' . (($sort_dir == 'a') ? 'ASC' : 'DESC')); + break; + + case 'f': + $this->sphinx->SetGroupBy('topic_id', SPH_GROUPBY_ATTR, 'forum_id ' . (($sort_dir == 'a') ? 'ASC' : 'DESC')); + break; + + case 'i': + + case 's': + $this->sphinx->SetGroupBy('topic_id', SPH_GROUPBY_ATTR, 'post_subject ' . (($sort_dir == 'a') ? 'ASC' : 'DESC')); + break; + + case 't': + + default: + $this->sphinx->SetGroupBy('topic_id', SPH_GROUPBY_ATTR, 'topic_last_post_time ' . (($sort_dir == 'a') ? 'ASC' : 'DESC')); + break; + } + } + else + { + switch ($sort_key) + { + case 'a': + $this->sphinx->SetSortMode(($sort_dir == 'a') ? SPH_SORT_ATTR_ASC : SPH_SORT_ATTR_DESC, 'poster_id'); + break; + + case 'f': + $this->sphinx->SetSortMode(($sort_dir == 'a') ? SPH_SORT_ATTR_ASC : SPH_SORT_ATTR_DESC, 'forum_id'); + break; + + case 'i': + + case 's': + $this->sphinx->SetSortMode(($sort_dir == 'a') ? SPH_SORT_ATTR_ASC : SPH_SORT_ATTR_DESC, 'post_subject'); + break; + + case 't': + + default: + $this->sphinx->SetSortMode(($sort_dir == 'a') ? SPH_SORT_ATTR_ASC : SPH_SORT_ATTR_DESC, 'post_time'); + break; + } + } + + // Most narrow filters first + if ($topic_id) + { + $this->sphinx->SetFilter('topic_id', array($topic_id)); + } + + $search_query_prefix = ''; + + switch ($fields) + { + case 'titleonly': + // Only search the title + if ($terms == 'all') + { + $search_query_prefix = '@title '; + } + // Weight for the title + $this->sphinx->SetFieldWeights(array("title" => 5, "data" => 1)); + // 1 is first_post, 0 is not first post + $this->sphinx->SetFilter('topic_first_post', array(1)); + break; + + case 'msgonly': + // Only search the body + if ($terms == 'all') + { + $search_query_prefix = '@data '; + } + // Weight for the body + $this->sphinx->SetFieldWeights(array("title" => 1, "data" => 5)); + break; + + case 'firstpost': + // More relative weight for the title, also search the body + $this->sphinx->SetFieldWeights(array("title" => 5, "data" => 1)); + // 1 is first_post, 0 is not first post + $this->sphinx->SetFilter('topic_first_post', array(1)); + break; + + default: + // More relative weight for the title, also search the body + $this->sphinx->SetFieldWeights(array("title" => 5, "data" => 1)); + break; + } + + if (sizeof($author_ary)) + { + $this->sphinx->SetFilter('poster_id', $author_ary); + } + + // As this is not simply possible at the moment, we limit the result to approved posts. + // This will make it impossible for moderators to search unapproved and softdeleted posts, + // but at least it will also cause the same for normal users. + $this->sphinx->SetFilter('post_visibility', array(ITEM_APPROVED)); + + if (sizeof($ex_fid_ary)) + { + // All forums that a user is allowed to access + $fid_ary = array_unique(array_intersect(array_keys($this->auth->acl_getf('f_read', true)), array_keys($this->auth->acl_getf('f_search', true)))); + // All forums that the user wants to and can search in + $search_forums = array_diff($fid_ary, $ex_fid_ary); + + if (sizeof($search_forums)) + { + $this->sphinx->SetFilter('forum_id', $search_forums); + } + } + + $this->sphinx->SetFilter('deleted', array(0)); + + $this->sphinx->SetLimits($start, (int) $per_page, SPHINX_MAX_MATCHES); + $result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes); + + // Could be connection to localhost:9312 failed (errno=111, + // msg=Connection refused) during rotate, retry if so + $retries = SPHINX_CONNECT_RETRIES; + while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--) + { + usleep(SPHINX_CONNECT_WAIT_TIME); + $result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes); + } + + if ($this->sphinx->GetLastError()) + { + add_log('critical', 'LOG_SPHINX_ERROR', $this->sphinx->GetLastError()); + if ($this->auth->acl_get('a_')) + { + trigger_error($this->user->lang('SPHINX_SEARCH_FAILED', $this->sphinx->GetLastError())); + } + else + { + trigger_error($this->user->lang('SPHINX_SEARCH_FAILED_LOG')); + } + } + + $result_count = $result['total_found']; + + if ($result_count && $start >= $result_count) + { + $start = floor(($result_count - 1) / $per_page) * $per_page; + + $this->sphinx->SetLimits((int) $start, (int) $per_page, SPHINX_MAX_MATCHES); + $result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes); + + // Could be connection to localhost:9312 failed (errno=111, + // msg=Connection refused) during rotate, retry if so + $retries = SPHINX_CONNECT_RETRIES; + while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--) + { + usleep(SPHINX_CONNECT_WAIT_TIME); + $result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes); + } + } + + $id_ary = array(); + if (isset($result['matches'])) + { + if ($type == 'posts') + { + $id_ary = array_keys($result['matches']); + } + else + { + foreach ($result['matches'] as $key => $value) + { + $id_ary[] = $value['attrs']['topic_id']; + } + } + } + else + { + return false; + } + + $id_ary = array_slice($id_ary, 0, (int) $per_page); + + return $result_count; + } + + /** + * Performs a search on an author's posts without caring about message contents. Depends on display specific params + * + * @param string $type contains either posts or topics depending on what should be searched for + * @param boolean $firstpost_only if true, only topic starting posts will be considered + * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query + * @param string $sort_key is the key of $sort_by_sql for the selected sorting + * @param string $sort_dir is either a or d representing ASC and DESC + * @param string $sort_days specifies the maximum amount of days a post may be old + * @param array $ex_fid_ary specifies an array of forum ids which should not be searched + * @param string $post_visibility specifies which types of posts the user can view in which forums + * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched + * @param array $author_ary an array of author ids + * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match + * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered + * @param int $start indicates the first index of the page + * @param int $per_page number of ids each page is supposed to contain + * @return boolean|int total number of results + */ + public function author_search($type, $firstpost_only, $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) + { + $this->search_query = ''; + + $this->sphinx->SetMatchMode(SPH_MATCH_FULLSCAN); + $fields = ($firstpost_only) ? 'firstpost' : 'all'; + $terms = 'all'; + return $this->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); + } + + /** + * Updates wordlist and wordmatch tables when a message is posted or changed + * + * @param string $mode Contains the post mode: edit, post, reply, quote + * @param int $post_id The id of the post which is modified/created + * @param string &$message New or updated post content + * @param string &$subject New or updated post subject + * @param int $poster_id Post author's user id + * @param int $forum_id The id of the forum in which the post is located + */ + public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) + { + if ($mode == 'edit') + { + $this->sphinx->UpdateAttributes($this->indexes, array('forum_id', 'poster_id'), array((int) $post_id => array((int) $forum_id, (int) $poster_id))); + } + else if ($mode != 'post' && $post_id) + { + // Update topic_last_post_time for full topic + $sql_array = array( + 'SELECT' => 'p1.post_id', + 'FROM' => array( + POSTS_TABLE => 'p1', + ), + 'LEFT_JOIN' => array(array( + 'FROM' => array( + POSTS_TABLE => 'p2' + ), + 'ON' => 'p1.topic_id = p2.topic_id', + )), + 'WHERE' => 'p2.post_id = ' . ((int) $post_id), + ); + + $sql = $this->db->sql_build_query('SELECT', $sql_array); + $result = $this->db->sql_query($sql); + + $post_updates = array(); + $post_time = time(); + while ($row = $this->db->sql_fetchrow($result)) + { + $post_updates[(int) $row['post_id']] = array($post_time); + } + $this->db->sql_freeresult($result); + + if (sizeof($post_updates)) + { + $this->sphinx->UpdateAttributes($this->indexes, array('topic_last_post_time'), $post_updates); + } + } + } + + /** + * Delete a post from the index after it was deleted + */ + public function index_remove($post_ids, $author_ids, $forum_ids) + { + $values = array(); + foreach ($post_ids as $post_id) + { + $values[$post_id] = array(1); + } + + $this->sphinx->UpdateAttributes($this->indexes, array('deleted'), $values); + } + + /** + * Nothing needs to be destroyed + */ + public function tidy($create = false) + { + set_config('search_last_gc', time(), true); + } + + /** + * Create sphinx table + * + * @return string|bool error string is returned incase of errors otherwise false + */ + public function create_index($acp_module, $u_action) + { + if (!$this->index_created()) + { + $table_data = array( + 'COLUMNS' => array( + 'counter_id' => array('UINT', 0), + 'max_doc_id' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'counter_id', + ); + $this->db_tools->sql_create_table(SPHINX_TABLE, $table_data); + + $sql = 'TRUNCATE TABLE ' . SPHINX_TABLE; + $this->db->sql_query($sql); + + $data = array( + 'counter_id' => '1', + 'max_doc_id' => '0', + ); + $sql = 'INSERT INTO ' . SPHINX_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data); + $this->db->sql_query($sql); + } + + return false; + } + + /** + * Drop sphinx table + * + * @return string|bool error string is returned incase of errors otherwise false + */ + public function delete_index($acp_module, $u_action) + { + if (!$this->index_created()) + { + return false; + } + + $this->db_tools->sql_table_drop(SPHINX_TABLE); + + return false; + } + + /** + * Returns true if the sphinx table was created + * + * @return bool true if sphinx table was created + */ + public function index_created($allow_new_files = true) + { + $created = false; + + if ($this->db_tools->sql_table_exists(SPHINX_TABLE)) + { + $created = true; + } + + return $created; + } + + /** + * Returns an associative array containing information about the indexes + * + * @return string|bool Language string of error false otherwise + */ + public function index_stats() + { + if (empty($this->stats)) + { + $this->get_stats(); + } + + return array( + $this->user->lang['FULLTEXT_SPHINX_MAIN_POSTS'] => ($this->index_created()) ? $this->stats['main_posts'] : 0, + $this->user->lang['FULLTEXT_SPHINX_DELTA_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] - $this->stats['main_posts'] : 0, + $this->user->lang['FULLTEXT_MYSQL_TOTAL_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] : 0, + ); + } + + /** + * Collects stats that can be displayed on the index maintenance page + */ + protected function get_stats() + { + if ($this->index_created()) + { + $sql = 'SELECT COUNT(post_id) as total_posts + FROM ' . POSTS_TABLE; + $result = $this->db->sql_query($sql); + $this->stats['total_posts'] = (int) $this->db->sql_fetchfield('total_posts'); + $this->db->sql_freeresult($result); + + $sql = 'SELECT COUNT(p.post_id) as main_posts + FROM ' . POSTS_TABLE . ' p, ' . SPHINX_TABLE . ' m + WHERE p.post_id <= m.max_doc_id + AND m.counter_id = 1'; + $result = $this->db->sql_query($sql); + $this->stats['main_posts'] = (int) $this->db->sql_fetchfield('main_posts'); + $this->db->sql_freeresult($result); + } + } + + /** + * Returns a list of options for the ACP to display + * + * @return associative array containing template and config variables + */ + public function acp() + { + $config_vars = array( + 'fulltext_sphinx_data_path' => 'string', + 'fulltext_sphinx_host' => 'string', + 'fulltext_sphinx_port' => 'string', + 'fulltext_sphinx_indexer_mem_limit' => 'int', + ); + + $tpl = ' + ' . $this->user->lang['FULLTEXT_SPHINX_CONFIGURE']. ' +
+

' . $this->user->lang['FULLTEXT_SPHINX_DATA_PATH_EXPLAIN'] . '
+
+
+
+

' . $this->user->lang['FULLTEXT_SPHINX_HOST_EXPLAIN'] . '
+
+
+
+

' . $this->user->lang['FULLTEXT_SPHINX_PORT_EXPLAIN'] . '
+
+
+
+

' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT_EXPLAIN'] . '
+
' . $this->user->lang['MIB'] . '
+
+
+

' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN'] . '
+
' . (($this->config_generate()) ? '' : $this->config_file_data) . '
+
+ '; + + // These are fields required in the config table + return array( + 'tpl' => $tpl, + 'config' => $config_vars + ); + } +} diff --git a/sources/phpBB/phpbb/search/index.htm b/sources/phpBB/phpbb/search/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/phpbb/search/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/phpbb/search/sphinx/config.php b/sources/phpBB/phpbb/search/sphinx/config.php new file mode 100644 index 0000000..675649b --- /dev/null +++ b/sources/phpBB/phpbb/search/sphinx/config.php @@ -0,0 +1,284 @@ + +* @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\search\sphinx; + +/** +* An object representing the sphinx configuration +* Can read it from file and write it back out after modification +*/ +class config +{ + private $sections = array(); + + /** + * Constructor which optionally loads data from a variable + * + * @param string $config_data Variable containing the sphinx configuration data + * + * @access public + */ + function __construct($config_data) + { + if ($config_data != '') + { + $this->read($config_data); + } + } + + /** + * Get a section object by its name + * + * @param string $name The name of the section that shall be returned + * @return \phpbb\search\sphinx\config_section The section object or null if none was found + * + * @access public + */ + function get_section_by_name($name) + { + for ($i = 0, $size = sizeof($this->sections); $i < $size; $i++) + { + // Make sure this is really a section object and not a comment + if (($this->sections[$i] instanceof \phpbb\search\sphinx\config_section) && $this->sections[$i]->get_name() == $name) + { + return $this->sections[$i]; + } + } + } + + /** + * Appends a new empty section to the end of the config + * + * @param string $name The name for the new section + * @return \phpbb\search\sphinx\config_section The newly created section object + * + * @access public + */ + function add_section($name) + { + $this->sections[] = new \phpbb\search\sphinx\config_section($name, ''); + return $this->sections[sizeof($this->sections) - 1]; + } + + /** + * Reads the config file data + * + * @param string $config_data The config file data + * + * @access private + */ + function read($config_data) + { + $this->sections = array(); + + $section = null; + $found_opening_bracket = false; + $in_value = false; + + foreach ($config_data as $i => $line) + { + // If the value of a variable continues to the next line because the line + // break was escaped then we don't trim leading space but treat it as a part of the value + if ($in_value) + { + $line = rtrim($line); + } + else + { + $line = trim($line); + } + + // If we're not inside a section look for one + if (!$section) + { + // Add empty lines and comments as comment objects to the section list + // that way they're not deleted when reassembling the file from the sections + if (!$line || $line[0] == '#') + { + $this->sections[] = new \phpbb\search\sphinx\config_comment($config_file[$i]); + continue; + } + else + { + // Otherwise we scan the line reading the section name until we find + // an opening curly bracket or a comment + $section_name = ''; + $section_name_comment = ''; + $found_opening_bracket = false; + for ($j = 0, $length = strlen($line); $j < $length; $j++) + { + if ($line[$j] == '#') + { + $section_name_comment = substr($line, $j); + break; + } + + if ($found_opening_bracket) + { + continue; + } + + if ($line[$j] == '{') + { + $found_opening_bracket = true; + continue; + } + + $section_name .= $line[$j]; + } + + // And then we create the new section object + $section_name = trim($section_name); + $section = new \phpbb\search\sphinx\config_section($section_name, $section_name_comment); + } + } + else + { + // If we're looking for variables inside a section + $skip_first = false; + + // If we're not in a value continuing over the line feed + if (!$in_value) + { + // Then add empty lines and comments as comment objects to the variable list + // of this section so they're not deleted on reassembly + if (!$line || $line[0] == '#') + { + $section->add_variable(new \phpbb\search\sphinx\config_comment($config_file[$i])); + continue; + } + + // As long as we haven't yet actually found an opening bracket for this section + // we treat everything as comments so it's not deleted either + if (!$found_opening_bracket) + { + if ($line[0] == '{') + { + $skip_first = true; + $line = substr($line, 1); + $found_opening_bracket = true; + } + else + { + $section->add_variable(new \phpbb\search\sphinx\config_comment($config_file[$i])); + continue; + } + } + } + + // If we did not find a comment in this line or still add to the previous + // line's value ... + if ($line || $in_value) + { + if (!$in_value) + { + $name = ''; + $value = ''; + $comment = ''; + $found_assignment = false; + } + $in_value = false; + $end_section = false; + + /* ... then we should prase this line char by char: + - first there's the variable name + - then an equal sign + - the variable value + - possibly a backslash before the linefeed in this case we need to continue + parsing the value in the next line + - a # indicating that the rest of the line is a comment + - a closing curly bracket indicating the end of this section*/ + for ($j = 0, $length = strlen($line); $j < $length; $j++) + { + if ($line[$j] == '#') + { + $comment = substr($line, $j); + break; + } + else if ($line[$j] == '}') + { + $comment = substr($line, $j + 1); + $end_section = true; + break; + } + else if (!$found_assignment) + { + if ($line[$j] == '=') + { + $found_assignment = true; + } + else + { + $name .= $line[$j]; + } + } + else + { + if ($line[$j] == '\\' && $j == $length - 1) + { + $value .= "\n"; + $in_value = true; + // Go to the next line and keep processing the value in there + continue 2; + } + $value .= $line[$j]; + } + } + + // If a name and an equal sign were found then we have append a + // new variable object to the section + if ($name && $found_assignment) + { + $section->add_variable(new \phpbb\search\sphinx\config_variable(trim($name), trim($value), ($end_section) ? '' : $comment)); + continue; + } + + /* If we found a closing curly bracket this section has been completed + and we can append it to the section list and continue with looking for + the next section */ + if ($end_section) + { + $section->set_end_comment($comment); + $this->sections[] = $section; + $section = null; + continue; + } + } + + // If we did not find anything meaningful up to here, then just treat it + // as a comment + $comment = ($skip_first) ? "\t" . substr(ltrim($config_file[$i]), 1) : $config_file[$i]; + $section->add_variable(new \phpbb\search\sphinx\config_comment($comment)); + } + } + + } + + /** + * Returns the config data + * + * @return string $data The config data that is generated + * + * @access public + */ + function get_data() + { + $data = ""; + foreach ($this->sections as $section) + { + $data .= $section->to_string(); + } + + return $data; + } +} diff --git a/sources/phpBB/phpbb/search/sphinx/config_comment.php b/sources/phpBB/phpbb/search/sphinx/config_comment.php new file mode 100644 index 0000000..b5cd0a3 --- /dev/null +++ b/sources/phpBB/phpbb/search/sphinx/config_comment.php @@ -0,0 +1,47 @@ + +* @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\search\sphinx; + +/** +* \phpbb\search\sphinx\config_comment +* Represents a comment inside the sphinx configuration +*/ +class config_comment +{ + private $exact_string; + + /** + * Create a new comment + * + * @param string $exact_string The content of the comment including newlines, leading whitespace, etc. + * + * @access public + */ + function __construct($exact_string) + { + $this->exact_string = $exact_string; + } + + /** + * Simply returns the comment as it was created + * + * @return string The exact string that was specified in the constructor + * + * @access public + */ + function to_string() + { + return $this->exact_string; + } +} diff --git a/sources/phpBB/phpbb/search/sphinx/config_section.php b/sources/phpBB/phpbb/search/sphinx/config_section.php new file mode 100644 index 0000000..14ab3a7 --- /dev/null +++ b/sources/phpBB/phpbb/search/sphinx/config_section.php @@ -0,0 +1,160 @@ + +* @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\search\sphinx; + +/** +* \phpbb\search\sphinx\config_section +* Represents a single section inside the sphinx configuration +*/ +class config_section +{ + private $name; + private $comment; + private $end_comment; + private $variables = array(); + + /** + * Construct a new section + * + * @param string $name Name of the section + * @param string $comment Comment that should be appended after the name in the + * textual format. + * + * @access public + */ + function __construct($name, $comment) + { + $this->name = $name; + $this->comment = $comment; + $this->end_comment = ''; + } + + /** + * Add a variable object to the list of variables in this section + * + * @param \phpbb\search\sphinx\config_variable $variable The variable object + * + * @access public + */ + function add_variable($variable) + { + $this->variables[] = $variable; + } + + /** + * Adds a comment after the closing bracket in the textual representation + * + * @param string $end_comment + * + * @access public + */ + function set_end_comment($end_comment) + { + $this->end_comment = $end_comment; + } + + /** + * Getter for the name of this section + * + * @return string Section's name + * + * @access public + */ + function get_name() + { + return $this->name; + } + + /** + * Get a variable object by its name + * + * @param string $name The name of the variable that shall be returned + * @return \phpbb\search\sphinx\config_section The first variable object from this section with the + * given name or null if none was found + * + * @access public + */ + function get_variable_by_name($name) + { + for ($i = 0, $size = sizeof($this->variables); $i < $size; $i++) + { + // Make sure this is a variable object and not a comment + if (($this->variables[$i] instanceof \phpbb\search\sphinx\config_variable) && $this->variables[$i]->get_name() == $name) + { + return $this->variables[$i]; + } + } + } + + /** + * Deletes all variables with the given name + * + * @param string $name The name of the variable objects that are supposed to be removed + * + * @access public + */ + function delete_variables_by_name($name) + { + for ($i = 0, $size = sizeof($this->variables); $i < $size; $i++) + { + // Make sure this is a variable object and not a comment + if (($this->variables[$i] instanceof \phpbb\search\sphinx\config_variable) && $this->variables[$i]->get_name() == $name) + { + array_splice($this->variables, $i, 1); + $i--; + } + } + } + + /** + * Create a new variable object and append it to the variable list of this section + * + * @param string $name The name for the new variable + * @param string $value The value for the new variable + * @return \phpbb\search\sphinx\config_variable Variable object that was created + * + * @access public + */ + function create_variable($name, $value) + { + $this->variables[] = new \phpbb\search\sphinx\config_variable($name, $value, ''); + return $this->variables[sizeof($this->variables) - 1]; + } + + /** + * Turns this object into a string which can be written to a config file + * + * @return string Config data in textual form, parsable for sphinx + * + * @access public + */ + function to_string() + { + $content = $this->name . ' ' . $this->comment . "\n{\n"; + + // Make sure we don't get too many newlines after the opening bracket + while (trim($this->variables[0]->to_string()) == '') + { + array_shift($this->variables); + } + + foreach ($this->variables as $variable) + { + $content .= $variable->to_string(); + } + $content .= '}' . $this->end_comment . "\n"; + + return $content; + } +} diff --git a/sources/phpBB/phpbb/search/sphinx/config_variable.php b/sources/phpBB/phpbb/search/sphinx/config_variable.php new file mode 100644 index 0000000..85cee20 --- /dev/null +++ b/sources/phpBB/phpbb/search/sphinx/config_variable.php @@ -0,0 +1,78 @@ + +* @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\search\sphinx; + +/** +* \phpbb\search\sphinx\config_variable +* Represents a single variable inside the sphinx configuration +*/ +class config_variable +{ + private $name; + private $value; + private $comment; + + /** + * Constructs a new variable object + * + * @param string $name Name of the variable + * @param string $value Value of the variable + * @param string $comment Optional comment after the variable in the + * config file + * + * @access public + */ + function __construct($name, $value, $comment) + { + $this->name = $name; + $this->value = $value; + $this->comment = $comment; + } + + /** + * Getter for the variable's name + * + * @return string The variable object's name + * + * @access public + */ + function get_name() + { + return $this->name; + } + + /** + * Allows changing the variable's value + * + * @param string $value New value for this variable + * + * @access public + */ + function set_value($value) + { + $this->value = $value; + } + + /** + * Turns this object into a string readable by sphinx + * + * @return string Config data in textual form + * + * @access public + */ + function to_string() + { + return "\t" . $this->name . ' = ' . str_replace("\n", " \\\n", $this->value) . ' ' . $this->comment . "\n"; + } +} diff --git a/sources/phpBB/phpbb/session.php b/sources/phpBB/phpbb/session.php new file mode 100644 index 0000000..0a6a18f --- /dev/null +++ b/sources/phpBB/phpbb/session.php @@ -0,0 +1,1548 @@ + +* @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; + +/** +* Session class +*/ +class session +{ + var $cookie_data = array(); + var $page = array(); + var $data = array(); + var $browser = ''; + var $forwarded_for = ''; + var $host = ''; + var $session_id = ''; + var $ip = ''; + var $load = 0; + var $time_now = 0; + var $update_session_page = true; + + /** + * Extract current session page + * + * @param string $root_path current root path (phpbb_root_path) + * @return array + */ + static function extract_current_page($root_path) + { + global $request, $symfony_request, $phpbb_filesystem; + + $page_array = array(); + + // First of all, get the request uri... + $script_name = $request->escape($symfony_request->getScriptName(), true); + $args = $request->escape(explode('&', $symfony_request->getQueryString()), true); + + // If we are unable to get the script name we use REQUEST_URI as a failover and note it within the page array for easier support... + if (!$script_name) + { + $script_name = htmlspecialchars_decode($request->server('REQUEST_URI')); + $script_name = (($pos = strpos($script_name, '?')) !== false) ? substr($script_name, 0, $pos) : $script_name; + $page_array['failover'] = 1; + } + + // Replace backslashes and doubled slashes (could happen on some proxy setups) + $script_name = str_replace(array('\\', '//'), '/', $script_name); + + // Now, remove the sid and let us get a clean query string... + $use_args = array(); + + // Since some browser do not encode correctly we need to do this with some "special" characters... + // " -> %22, ' => %27, < -> %3C, > -> %3E + $find = array('"', "'", '<', '>', '"', '<', '>'); + $replace = array('%22', '%27', '%3C', '%3E', '%22', '%3C', '%3E'); + + foreach ($args as $key => $argument) + { + if (strpos($argument, 'sid=') === 0) + { + continue; + } + + $use_args[] = str_replace($find, $replace, $argument); + } + unset($args); + + // The following examples given are for an request uri of {path to the phpbb directory}/adm/index.php?i=10&b=2 + + // The current query string + $query_string = trim(implode('&', $use_args)); + + // basenamed page name (for example: index.php) + $page_name = (substr($script_name, -1, 1) == '/') ? '' : basename($script_name); + $page_name = urlencode(htmlspecialchars($page_name)); + + $symfony_request_path = $phpbb_filesystem->clean_path($symfony_request->getPathInfo()); + if ($symfony_request_path !== '/') + { + $page_name .= str_replace('%2F', '/', urlencode($symfony_request_path)); + } + + // 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('./'))); + $intersection = array_intersect_assoc($root_dirs, $page_dirs); + + $root_dirs = array_diff_assoc($root_dirs, $intersection); + $page_dirs = array_diff_assoc($page_dirs, $intersection); + + $page_dir = str_repeat('../', sizeof($root_dirs)) . implode('/', $page_dirs); + + if ($page_dir && substr($page_dir, -1, 1) == '/') + { + $page_dir = substr($page_dir, 0, -1); + } + + // Current page from phpBB root (for example: adm/index.php?i=10&b=2) + $page = (($page_dir) ? $page_dir . '/' : '') . $page_name; + if ($query_string) + { + $page .= '?' . $query_string; + } + + // The script path from the webroot to the current directory (for example: /phpBB3/adm/) : always prefixed with / and ends in / + $script_path = $symfony_request->getBasePath(); + + // The script path from the webroot to the phpBB root (for example: /phpBB3/) + $script_dirs = explode('/', $script_path); + array_splice($script_dirs, -sizeof($page_dirs)); + $root_script_path = implode('/', $script_dirs) . (sizeof($root_dirs) ? '/' . implode('/', $root_dirs) : ''); + + // We are on the base level (phpBB root == webroot), lets adjust the variables a bit... + if (!$root_script_path) + { + $root_script_path = ($page_dir) ? str_replace($page_dir, '', $script_path) : $script_path; + } + + $script_path .= (substr($script_path, -1, 1) == '/') ? '' : '/'; + $root_script_path .= (substr($root_script_path, -1, 1) == '/') ? '' : '/'; + + $page_array += array( + 'page_name' => $page_name, + 'page_dir' => $page_dir, + + 'query_string' => $query_string, + 'script_path' => str_replace(' ', '%20', htmlspecialchars($script_path)), + 'root_script_path' => str_replace(' ', '%20', htmlspecialchars($root_script_path)), + + 'page' => $page, + 'forum' => request_var('f', 0), + ); + + return $page_array; + } + + /** + * Get valid hostname/port. HTTP_HOST is used, SERVER_NAME if HTTP_HOST not present. + */ + function extract_current_hostname() + { + global $config, $request; + + // Get hostname + $host = htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME'))); + + // Should be a string and lowered + $host = (string) strtolower($host); + + // If host is equal the cookie domain or the server name (if config is set), then we assume it is valid + if ((isset($config['cookie_domain']) && $host === $config['cookie_domain']) || (isset($config['server_name']) && $host === $config['server_name'])) + { + return $host; + } + + // Is the host actually a IP? If so, we use the IP... (IPv4) + if (long2ip(ip2long($host)) === $host) + { + return $host; + } + + // Now return the hostname (this also removes any port definition). The http:// is prepended to construct a valid URL, hosts never have a scheme assigned + $host = @parse_url('http://' . $host); + $host = (!empty($host['host'])) ? $host['host'] : ''; + + // Remove any portions not removed by parse_url (#) + $host = str_replace('#', '', $host); + + // If, by any means, the host is now empty, we will use a "best approach" way to guess one + if (empty($host)) + { + if (!empty($config['server_name'])) + { + $host = $config['server_name']; + } + else if (!empty($config['cookie_domain'])) + { + $host = (strpos($config['cookie_domain'], '.') === 0) ? substr($config['cookie_domain'], 1) : $config['cookie_domain']; + } + else + { + // Set to OS hostname or localhost + $host = (function_exists('php_uname')) ? php_uname('n') : 'localhost'; + } + } + + // It may be still no valid host, but for sure only a hostname (we may further expand on the cookie domain... if set) + return $host; + } + + /** + * Start session management + * + * This is where all session activity begins. We gather various pieces of + * information from the client and server. We test to see if a session already + * exists. If it does, fine and dandy. If it doesn't we'll go on to create a + * new one ... pretty logical heh? We also examine the system load (if we're + * running on a system which makes such information readily available) and + * halt if it's above an admin definable limit. + * + * @param bool $update_session_page if true the session page gets updated. + * This can be set to circumvent certain scripts to update the users last visited page. + */ + function session_begin($update_session_page = true) + { + global $phpEx, $SID, $_SID, $_EXTRA_URL, $db, $config, $phpbb_root_path; + global $request, $phpbb_container; + + // Give us some basic information + $this->time_now = time(); + $this->cookie_data = array('u' => 0, 'k' => ''); + $this->update_session_page = $update_session_page; + $this->browser = $request->header('User-Agent'); + $this->referer = $request->header('Referer'); + $this->forwarded_for = $request->header('X-Forwarded-For'); + + $this->host = $this->extract_current_hostname(); + $this->page = $this->extract_current_page($phpbb_root_path); + + // if the forwarded for header shall be checked we have to validate its contents + if ($config['forwarded_for_check']) + { + $this->forwarded_for = preg_replace('# {2,}#', ' ', str_replace(',', ' ', $this->forwarded_for)); + + // split the list of IPs + $ips = explode(' ', $this->forwarded_for); + foreach ($ips as $ip) + { + // check IPv4 first, the IPv6 is hopefully only going to be used very seldomly + if (!empty($ip) && !preg_match(get_preg_expression('ipv4'), $ip) && !preg_match(get_preg_expression('ipv6'), $ip)) + { + // contains invalid data, don't use the forwarded for header + $this->forwarded_for = ''; + break; + } + } + } + else + { + $this->forwarded_for = ''; + } + + 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); + + $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', ''); + $SID = '?sid=' . $this->session_id; + $this->cookie_data = array('u' => 0, 'k' => ''); + } + } + else + { + $this->session_id = $_SID = request_var('sid', ''); + $SID = '?sid=' . $this->session_id; + } + + $_EXTRA_URL = array(); + + // Why no forwarded_for et al? Well, too easily spoofed. With the results of my recent requests + // it's pretty clear that in the majority of cases you'll at least be left with a proxy/cache ip. + $this->ip = htmlspecialchars_decode($request->server('REMOTE_ADDR')); + $this->ip = preg_replace('# {2,}#', ' ', str_replace(',', ' ', $this->ip)); + + // split the list of IPs + $ips = explode(' ', trim($this->ip)); + + // Default IP if REMOTE_ADDR is invalid + $this->ip = '127.0.0.1'; + + foreach ($ips as $ip) + { + if (function_exists('phpbb_ip_normalise')) + { + // Normalise IP address + $ip = phpbb_ip_normalise($ip); + + if (empty($ip)) + { + // IP address is invalid. + break; + } + + // IP address is valid. + $this->ip = $ip; + + // Skip legacy code. + continue; + } + + if (preg_match(get_preg_expression('ipv4'), $ip)) + { + $this->ip = $ip; + } + else if (preg_match(get_preg_expression('ipv6'), $ip)) + { + // Quick check for IPv4-mapped address in IPv6 + if (stripos($ip, '::ffff:') === 0) + { + $ipv4 = substr($ip, 7); + + if (preg_match(get_preg_expression('ipv4'), $ipv4)) + { + $ip = $ipv4; + } + } + + $this->ip = $ip; + } + else + { + // We want to use the last valid address in the chain + // Leave foreach loop when address is invalid + break; + } + } + + $this->load = false; + + // Load limit check (if applicable) + if ($config['limit_load'] || $config['limit_search_load']) + { + if ((function_exists('sys_getloadavg') && $load = sys_getloadavg()) || ($load = explode(' ', @file_get_contents('/proc/loadavg')))) + { + $this->load = array_slice($load, 0, 1); + $this->load = floatval($this->load[0]); + } + else + { + set_config('limit_load', '0'); + set_config('limit_search_load', '0'); + } + } + + // if no session id is set, redirect to index.php + $session_id = $request->variable('sid', ''); + if (defined('NEED_SID') && (empty($session_id) || $this->session_id !== $session_id)) + { + send_status_line(401, 'Unauthorized'); + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); + } + + // if session id is set + if (!empty($this->session_id)) + { + $sql = 'SELECT u.*, s.* + FROM ' . SESSIONS_TABLE . ' s, ' . USERS_TABLE . " u + WHERE s.session_id = '" . $db->sql_escape($this->session_id) . "' + AND u.user_id = s.session_user_id"; + $result = $db->sql_query($sql); + $this->data = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + // Did the session exist in the DB? + if (isset($this->data['user_id'])) + { + // Validate IP length according to admin ... enforces an IP + // check on bots if admin requires this +// $quadcheck = ($config['ip_check_bot'] && $this->data['user_type'] & USER_BOT) ? 4 : $config['ip_check']; + + if (strpos($this->ip, ':') !== false && strpos($this->data['session_ip'], ':') !== false) + { + $s_ip = short_ipv6($this->data['session_ip'], $config['ip_check']); + $u_ip = short_ipv6($this->ip, $config['ip_check']); + } + else + { + $s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check'])); + $u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $config['ip_check'])); + } + + $s_browser = ($config['browser_check']) ? trim(strtolower(substr($this->data['session_browser'], 0, 149))) : ''; + $u_browser = ($config['browser_check']) ? trim(strtolower(substr($this->browser, 0, 149))) : ''; + + $s_forwarded_for = ($config['forwarded_for_check']) ? substr($this->data['session_forwarded_for'], 0, 254) : ''; + $u_forwarded_for = ($config['forwarded_for_check']) ? substr($this->forwarded_for, 0, 254) : ''; + + // referer checks + // The @ before $config['referer_validation'] suppresses notices present while running the updater + $check_referer_path = (@$config['referer_validation'] == REFERER_VALIDATE_PATH); + $referer_valid = true; + + // we assume HEAD and TRACE to be foul play and thus only whitelist GET + if (@$config['referer_validation'] && strtolower($request->server('REQUEST_METHOD')) !== 'get') + { + $referer_valid = $this->validate_referer($check_referer_path); + } + + if ($u_ip === $s_ip && $s_browser === $u_browser && $s_forwarded_for === $u_forwarded_for && $referer_valid) + { + $session_expired = false; + + // Check whether the session is still valid if we have one + $provider_collection = $phpbb_container->get('auth.provider_collection'); + $provider = $provider_collection->get_provider(); + + if (!($provider instanceof \phpbb\auth\provider\provider_interface)) + { + throw new \RuntimeException($provider . ' must implement \phpbb\auth\provider\provider_interface'); + } + + $ret = $provider->validate_session($this->data); + if ($ret !== null && !$ret) + { + $session_expired = true; + } + + if (!$session_expired) + { + // Check the session length timeframe if autologin is not enabled. + // Else check the autologin length... and also removing those having autologin enabled but no longer allowed board-wide. + if (!$this->data['session_autologin']) + { + if ($this->data['session_time'] < $this->time_now - ($config['session_length'] + 60)) + { + $session_expired = true; + } + } + else if (!$config['allow_autologin'] || ($config['max_autologin_time'] && $this->data['session_time'] < $this->time_now - (86400 * (int) $config['max_autologin_time']) + 60)) + { + $session_expired = true; + } + } + + if (!$session_expired) + { + // Only update session DB a minute or so after last update or if page changes + if ($this->time_now - $this->data['session_time'] > 60 || ($this->update_session_page && $this->data['session_page'] != $this->page['page'])) + { + $sql_ary = array('session_time' => $this->time_now); + + // Do not update the session page for ajax requests, so the view online still works as intended + if ($this->update_session_page && !$request->is_ajax()) + { + $sql_ary['session_page'] = substr($this->page['page'], 0, 199); + $sql_ary['session_forum_id'] = $this->page['forum']; + } + + $db->sql_return_on_error(true); + + $this->update_session($sql_ary); + + $db->sql_return_on_error(false); + + // If the database is not yet updated, there will be an error due to the session_forum_id + // @todo REMOVE for 3.0.2 + if ($result === false) + { + unset($sql_ary['session_forum_id']); + + $this->update_session($sql_ary); + } + + if ($this->data['user_id'] != ANONYMOUS && !empty($config['new_member_post_limit']) && $this->data['user_new'] && $config['new_member_post_limit'] <= $this->data['user_posts']) + { + $this->leave_newly_registered(); + } + } + + $this->data['is_registered'] = ($this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false; + $this->data['is_bot'] = (!$this->data['is_registered'] && $this->data['user_id'] != ANONYMOUS) ? true : false; + $this->data['user_lang'] = basename($this->data['user_lang']); + + return true; + } + } + else + { + // Added logging temporarly to help debug bugs... + if (defined('DEBUG') && $this->data['user_id'] != ANONYMOUS) + { + 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)); + } + else + { + add_log('critical', 'LOG_REFERER_INVALID', $this->referer); + } + } + } + } + } + + // If we reach here then no (valid) session exists. So we'll create a new one + return $this->session_create(); + } + + /** + * Create a new session + * + * If upon trying to start a session we discover there is nothing existing we + * jump here. Additionally this method is called directly during login to regenerate + * the session for the specific user. In this method we carry out a number of tasks; + * garbage collection, (search)bot checking, banned user comparison. Basically + * though this method will result in a new session for a specific user. + */ + function session_create($user_id = false, $set_admin = false, $persist_login = false, $viewonline = true) + { + global $SID, $_SID, $db, $config, $cache, $phpbb_root_path, $phpEx, $phpbb_container; + + $this->data = array(); + + /* Garbage collection ... remove old sessions updating user information + // if necessary. It means (potentially) 11 queries but only infrequently + if ($this->time_now > $config['session_last_gc'] + $config['session_gc']) + { + $this->session_gc(); + }*/ + + // Do we allow autologin on this board? No? Then override anything + // that may be requested here + if (!$config['allow_autologin']) + { + $this->cookie_data['k'] = $persist_login = false; + } + + /** + * Here we do a bot check, oh er saucy! No, not that kind of bot + * check. We loop through the list of bots defined by the admin and + * see if we have any useragent and/or IP matches. If we do, this is a + * bot, act accordingly + */ + $bot = false; + $active_bots = $cache->obtain_bots(); + + foreach ($active_bots as $row) + { + if ($row['bot_agent'] && preg_match('#' . str_replace('\*', '.*?', preg_quote($row['bot_agent'], '#')) . '#i', $this->browser)) + { + $bot = $row['user_id']; + } + + // If ip is supplied, we will make sure the ip is matching too... + if ($row['bot_ip'] && ($bot || !$row['bot_agent'])) + { + // Set bot to false, then we only have to set it to true if it is matching + $bot = false; + + foreach (explode(',', $row['bot_ip']) as $bot_ip) + { + $bot_ip = trim($bot_ip); + + if (!$bot_ip) + { + continue; + } + + if (strpos($this->ip, $bot_ip) === 0) + { + $bot = (int) $row['user_id']; + break; + } + } + } + + if ($bot) + { + break; + } + } + + $provider_collection = $phpbb_container->get('auth.provider_collection'); + $provider = $provider_collection->get_provider(); + $this->data = $provider->autologin(); + + if ($user_id !== false && sizeof($this->data) && $this->data['user_id'] != $user_id) + { + $this->data = array(); + } + + if (sizeof($this->data)) + { + $this->cookie_data['k'] = ''; + $this->cookie_data['u'] = $this->data['user_id']; + } + + // If we're presented with an autologin key we'll join against it. + // Else if we've been passed a user_id we'll grab data based on that + if (isset($this->cookie_data['k']) && $this->cookie_data['k'] && $this->cookie_data['u'] && !sizeof($this->data)) + { + $sql = 'SELECT u.* + FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k + WHERE u.user_id = ' . (int) $this->cookie_data['u'] . ' + AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ") + AND k.user_id = u.user_id + AND k.key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'"; + $result = $db->sql_query($sql); + $user_data = $db->sql_fetchrow($result); + + if ($user_id === false || (isset($user_data['user_id']) && $user_id == $user_data['user_id'])) + { + $this->data = $user_data; + $bot = false; + } + + $db->sql_freeresult($result); + } + + if ($user_id !== false && !sizeof($this->data)) + { + $this->cookie_data['k'] = ''; + $this->cookie_data['u'] = $user_id; + + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . (int) $this->cookie_data['u'] . ' + AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')'; + $result = $db->sql_query($sql); + $this->data = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + $bot = false; + } + + // Bot user, if they have a SID in the Request URI we need to get rid of it + // otherwise they'll index this page with the SID, duplicate content oh my! + if ($bot && isset($_GET['sid'])) + { + send_status_line(301, 'Moved Permanently'); + redirect(build_url(array('sid'))); + } + + // If no data was returned one or more of the following occurred: + // Key didn't match one in the DB + // User does not exist + // User is inactive + // User is bot + if (!sizeof($this->data) || !is_array($this->data)) + { + $this->cookie_data['k'] = ''; + $this->cookie_data['u'] = ($bot) ? $bot : ANONYMOUS; + + if (!$bot) + { + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . (int) $this->cookie_data['u']; + } + else + { + // We give bots always the same session if it is not yet expired. + $sql = 'SELECT u.*, s.* + FROM ' . USERS_TABLE . ' u + LEFT JOIN ' . SESSIONS_TABLE . ' s ON (s.session_user_id = u.user_id) + WHERE u.user_id = ' . (int) $bot; + } + + $result = $db->sql_query($sql); + $this->data = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + if ($this->data['user_id'] != ANONYMOUS && !$bot) + { + $this->data['session_last_visit'] = (isset($this->data['session_time']) && $this->data['session_time']) ? $this->data['session_time'] : (($this->data['user_lastvisit']) ? $this->data['user_lastvisit'] : time()); + } + else + { + $this->data['session_last_visit'] = $this->time_now; + } + + // Force user id to be integer... + $this->data['user_id'] = (int) $this->data['user_id']; + + // At this stage we should have a filled data array, defined cookie u and k data. + // data array should contain recent session info if we're a real user and a recent + // session exists in which case session_id will also be set + + // Is user banned? Are they excluded? Won't return on ban, exists within method + if ($this->data['user_type'] != USER_FOUNDER) + { + if (!$config['forwarded_for_check']) + { + $this->check_ban($this->data['user_id'], $this->ip); + } + else + { + $ips = explode(' ', $this->forwarded_for); + $ips[] = $this->ip; + $this->check_ban($this->data['user_id'], $ips); + } + } + + $this->data['is_registered'] = (!$bot && $this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false; + $this->data['is_bot'] = ($bot) ? true : false; + + // If our friend is a bot, we re-assign a previously assigned session + if ($this->data['is_bot'] && $bot == $this->data['user_id'] && $this->data['session_id']) + { + // Only assign the current session if the ip, browser and forwarded_for match... + if (strpos($this->ip, ':') !== false && strpos($this->data['session_ip'], ':') !== false) + { + $s_ip = short_ipv6($this->data['session_ip'], $config['ip_check']); + $u_ip = short_ipv6($this->ip, $config['ip_check']); + } + else + { + $s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check'])); + $u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $config['ip_check'])); + } + + $s_browser = ($config['browser_check']) ? trim(strtolower(substr($this->data['session_browser'], 0, 149))) : ''; + $u_browser = ($config['browser_check']) ? trim(strtolower(substr($this->browser, 0, 149))) : ''; + + $s_forwarded_for = ($config['forwarded_for_check']) ? substr($this->data['session_forwarded_for'], 0, 254) : ''; + $u_forwarded_for = ($config['forwarded_for_check']) ? substr($this->forwarded_for, 0, 254) : ''; + + if ($u_ip === $s_ip && $s_browser === $u_browser && $s_forwarded_for === $u_forwarded_for) + { + $this->session_id = $this->data['session_id']; + + // Only update session DB a minute or so after last update or if page changes + if ($this->time_now - $this->data['session_time'] > 60 || ($this->update_session_page && $this->data['session_page'] != $this->page['page'])) + { + $this->data['session_time'] = $this->data['session_last_visit'] = $this->time_now; + + $sql_ary = array('session_time' => $this->time_now, 'session_last_visit' => $this->time_now, 'session_admin' => 0); + + if ($this->update_session_page) + { + $sql_ary['session_page'] = substr($this->page['page'], 0, 199); + $sql_ary['session_forum_id'] = $this->page['forum']; + } + + $this->update_session($sql_ary); + + // Update the last visit time + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_lastvisit = ' . (int) $this->data['session_time'] . ' + WHERE user_id = ' . (int) $this->data['user_id']; + $db->sql_query($sql); + } + + $SID = '?sid='; + $_SID = ''; + return true; + } + else + { + // If the ip and browser does not match make sure we only have one bot assigned to one session + $db->sql_query('DELETE FROM ' . SESSIONS_TABLE . ' WHERE session_user_id = ' . $this->data['user_id']); + } + } + + $session_autologin = (($this->cookie_data['k'] || $persist_login) && $this->data['is_registered']) ? true : false; + $set_admin = ($set_admin && $this->data['is_registered']) ? true : false; + + // Create or update the session + $sql_ary = array( + 'session_user_id' => (int) $this->data['user_id'], + 'session_start' => (int) $this->time_now, + 'session_last_visit' => (int) $this->data['session_last_visit'], + 'session_time' => (int) $this->time_now, + 'session_browser' => (string) trim(substr($this->browser, 0, 149)), + 'session_forwarded_for' => (string) $this->forwarded_for, + 'session_ip' => (string) $this->ip, + 'session_autologin' => ($session_autologin) ? 1 : 0, + 'session_admin' => ($set_admin) ? 1 : 0, + 'session_viewonline' => ($viewonline) ? 1 : 0, + ); + + if ($this->update_session_page) + { + $sql_ary['session_page'] = (string) substr($this->page['page'], 0, 199); + $sql_ary['session_forum_id'] = $this->page['forum']; + } + + $db->sql_return_on_error(true); + + $sql = 'DELETE + FROM ' . SESSIONS_TABLE . ' + WHERE session_id = \'' . $db->sql_escape($this->session_id) . '\' + AND session_user_id = ' . ANONYMOUS; + + if (!defined('IN_ERROR_HANDLER') && (!$this->session_id || !$db->sql_query($sql) || !$db->sql_affectedrows())) + { + // Limit new sessions in 1 minute period (if required) + if (empty($this->data['session_time']) && $config['active_sessions']) + { +// $db->sql_return_on_error(false); + + $sql = 'SELECT COUNT(session_id) AS sessions + FROM ' . SESSIONS_TABLE . ' + WHERE session_time >= ' . ($this->time_now - 60); + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ((int) $row['sessions'] > (int) $config['active_sessions']) + { + send_status_line(503, 'Service Unavailable'); + trigger_error('BOARD_UNAVAILABLE'); + } + } + } + + // Since we re-create the session id here, the inserted row must be unique. Therefore, we display potential errors. + // Commented out because it will not allow forums to update correctly +// $db->sql_return_on_error(false); + + // Something quite important: session_page always holds the *last* page visited, except for the *first* visit. + // We are not able to simply have an empty session_page btw, therefore we need to tell phpBB how to detect this special case. + // If the session id is empty, we have a completely new one and will set an "identifier" here. This identifier is able to be checked later. + if (empty($this->data['session_id'])) + { + // This is a temporary variable, only set for the very first visit + $this->data['session_created'] = true; + } + + $this->session_id = $this->data['session_id'] = md5(unique_id()); + + $sql_ary['session_id'] = (string) $this->session_id; + $sql_ary['session_page'] = (string) substr($this->page['page'], 0, 199); + $sql_ary['session_forum_id'] = $this->page['forum']; + + $sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + + $db->sql_return_on_error(false); + + // Regenerate autologin/persistent login key + if ($session_autologin) + { + $this->set_login_key(); + } + + // refresh data + $SID = '?sid=' . $this->session_id; + $_SID = $this->session_id; + $this->data = array_merge($this->data, $sql_ary); + + if (!$bot) + { + $cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000); + + $this->set_cookie('u', $this->cookie_data['u'], $cookie_expire); + $this->set_cookie('k', $this->cookie_data['k'], $cookie_expire); + $this->set_cookie('sid', $this->session_id, $cookie_expire); + + unset($cookie_expire); + + $sql = 'SELECT COUNT(session_id) AS sessions + FROM ' . SESSIONS_TABLE . ' + WHERE session_user_id = ' . (int) $this->data['user_id'] . ' + AND session_time >= ' . (int) ($this->time_now - (max($config['session_length'], $config['form_token_lifetime']))); + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ((int) $row['sessions'] <= 1 || empty($this->data['user_form_salt'])) + { + $this->data['user_form_salt'] = unique_id(); + // Update the form key + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_form_salt = \'' . $db->sql_escape($this->data['user_form_salt']) . '\' + WHERE user_id = ' . (int) $this->data['user_id']; + $db->sql_query($sql); + } + } + else + { + $this->data['session_time'] = $this->data['session_last_visit'] = $this->time_now; + + // Update the last visit time + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_lastvisit = ' . (int) $this->data['session_time'] . ' + WHERE user_id = ' . (int) $this->data['user_id']; + $db->sql_query($sql); + + $SID = '?sid='; + $_SID = ''; + } + + return true; + } + + /** + * Kills a session + * + * This method does what it says on the tin. It will delete a pre-existing session. + * It resets cookie information (destroying any autologin key within that cookie data) + * and update the users information from the relevant session data. It will then + * grab guest user information. + */ + function session_kill($new_session = true) + { + global $SID, $_SID, $db, $config, $phpbb_root_path, $phpEx, $phpbb_container; + + $sql = 'DELETE FROM ' . SESSIONS_TABLE . " + WHERE session_id = '" . $db->sql_escape($this->session_id) . "' + AND session_user_id = " . (int) $this->data['user_id']; + $db->sql_query($sql); + + // Allow connecting logout with external auth method logout + $provider_collection = $phpbb_container->get('auth.provider_collection'); + $provider = $provider_collection->get_provider(); + $provider->logout($this->data, $new_session); + + if ($this->data['user_id'] != ANONYMOUS) + { + // Delete existing session, update last visit info first! + if (!isset($this->data['session_time'])) + { + $this->data['session_time'] = time(); + } + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_lastvisit = ' . (int) $this->data['session_time'] . ' + WHERE user_id = ' . (int) $this->data['user_id']; + $db->sql_query($sql); + + if ($this->cookie_data['k']) + { + $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' + WHERE user_id = ' . (int) $this->data['user_id'] . " + AND key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'"; + $db->sql_query($sql); + } + + // Reset the data array + $this->data = array(); + + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . ANONYMOUS; + $result = $db->sql_query($sql); + $this->data = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + $cookie_expire = $this->time_now - 31536000; + $this->set_cookie('u', '', $cookie_expire); + $this->set_cookie('k', '', $cookie_expire); + $this->set_cookie('sid', '', $cookie_expire); + unset($cookie_expire); + + $SID = '?sid='; + $this->session_id = $_SID = ''; + + // To make sure a valid session is created we create one for the anonymous user + if ($new_session) + { + $this->session_create(ANONYMOUS); + } + + return true; + } + + /** + * Session garbage collection + * + * This looks a lot more complex than it really is. Effectively we are + * deleting any sessions older than an admin definable limit. Due to the + * way in which we maintain session data we have to ensure we update user + * data before those sessions are destroyed. In addition this method + * removes autologin key information that is older than an admin defined + * limit. + */ + function session_gc() + { + global $db, $config, $phpbb_root_path, $phpEx, $phpbb_container; + + $batch_size = 10; + + if (!$this->time_now) + { + $this->time_now = time(); + } + + // Firstly, delete guest sessions + $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' + WHERE session_user_id = ' . ANONYMOUS . ' + AND session_time < ' . (int) ($this->time_now - $config['session_length']); + $db->sql_query($sql); + + // Get expired sessions, only most recent for each user + $sql = 'SELECT session_user_id, session_page, MAX(session_time) AS recent_time + FROM ' . SESSIONS_TABLE . ' + WHERE session_time < ' . ($this->time_now - $config['session_length']) . ' + GROUP BY session_user_id, session_page'; + $result = $db->sql_query_limit($sql, $batch_size); + + $del_user_id = array(); + $del_sessions = 0; + + while ($row = $db->sql_fetchrow($result)) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_lastvisit = ' . (int) $row['recent_time'] . ", user_lastpage = '" . $db->sql_escape($row['session_page']) . "' + WHERE user_id = " . (int) $row['session_user_id']; + $db->sql_query($sql); + + $del_user_id[] = (int) $row['session_user_id']; + $del_sessions++; + } + $db->sql_freeresult($result); + + if (sizeof($del_user_id)) + { + // Delete expired sessions + $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' + WHERE ' . $db->sql_in_set('session_user_id', $del_user_id) . ' + AND session_time < ' . ($this->time_now - $config['session_length']); + $db->sql_query($sql); + } + + if ($del_sessions < $batch_size) + { + // 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); + + if ($config['max_autologin_time']) + { + $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' + WHERE last_login < ' . (time() - (86400 * (int) $config['max_autologin_time'])); + $db->sql_query($sql); + } + + // only called from CRON; should be a safe workaround until the infrastructure gets going + $captcha_factory = $phpbb_container->get('captcha.factory'); + $captcha_factory->garbage_collect($config['captcha_plugin']); + + $sql = 'DELETE FROM ' . LOGIN_ATTEMPT_TABLE . ' + WHERE attempt_time < ' . (time() - (int) $config['ip_login_limit_time']); + $db->sql_query($sql); + } + + return; + } + + /** + * Sets a cookie + * + * Sets a cookie of the given name with the specified data for the given length of time. If no time is specified, a session cookie will be set. + * + * @param string $name Name of the cookie, will be automatically prefixed with the phpBB cookie name. track becomes [cookie_name]_track then. + * @param string $cookiedata The data to hold within the cookie + * @param int $cookietime The expiration time as UNIX timestamp. If 0 is provided, a session cookie is set. + * @param bool $httponly Use HttpOnly. Defaults to true. Use false to make cookie accessible by client-side scripts. + */ + function set_cookie($name, $cookiedata, $cookietime, $httponly = true) + { + global $config; + + $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']; + + header('Set-Cookie: ' . $name_data . (($cookietime) ? '; expires=' . $expire : '') . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . ';' . (($httponly) ? ' HttpOnly' : ''), false); + } + + /** + * Check for banned user + * + * Checks whether the supplied user is banned by id, ip or email. If no parameters + * are passed to the method pre-existing session data is used. + * + * @param int|false $user_id The user id + * @param mixed $user_ips Can contain a string with one IP or an array of multiple IPs + * @param string|false $user_email The user email + * @param bool $return If $return is false this routine does not return on finding a banned user, + * it outputs a relevant message and stops execution. + */ + function check_ban($user_id = false, $user_ips = false, $user_email = false, $return = false) + { + global $config, $db, $phpbb_dispatcher; + + if (defined('IN_CHECK_BAN') || defined('SKIP_CHECK_BAN')) + { + return; + } + + $banned = false; + $cache_ttl = 3600; + $where_sql = array(); + + $sql = 'SELECT ban_ip, ban_userid, ban_email, ban_exclude, ban_give_reason, ban_end + FROM ' . BANLIST_TABLE . ' + WHERE '; + + // Determine which entries to check, only return those + if ($user_email === false) + { + $where_sql[] = "ban_email = ''"; + } + + if ($user_ips === false) + { + $where_sql[] = "(ban_ip = '' OR ban_exclude = 1)"; + } + + if ($user_id === false) + { + $where_sql[] = '(ban_userid = 0 OR ban_exclude = 1)'; + } + else + { + $cache_ttl = ($user_id == ANONYMOUS) ? 3600 : 0; + $_sql = '(ban_userid = ' . $user_id; + + if ($user_email !== false) + { + $_sql .= " OR ban_email <> ''"; + } + + if ($user_ips !== false) + { + $_sql .= " OR ban_ip <> ''"; + } + + $_sql .= ')'; + + $where_sql[] = $_sql; + } + + $sql .= (sizeof($where_sql)) ? implode(' AND ', $where_sql) : ''; + $result = $db->sql_query($sql, $cache_ttl); + + $ban_triggered_by = 'user'; + while ($row = $db->sql_fetchrow($result)) + { + if ($row['ban_end'] && $row['ban_end'] < time()) + { + continue; + } + + $ip_banned = false; + if (!empty($row['ban_ip'])) + { + if (!is_array($user_ips)) + { + $ip_banned = preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_ip'], '#')) . '$#i', $user_ips); + } + else + { + foreach ($user_ips as $user_ip) + { + if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_ip'], '#')) . '$#i', $user_ip)) + { + $ip_banned = true; + break; + } + } + } + } + + if ((!empty($row['ban_userid']) && intval($row['ban_userid']) == $user_id) || + $ip_banned || + (!empty($row['ban_email']) && preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_email'], '#')) . '$#i', $user_email))) + { + if (!empty($row['ban_exclude'])) + { + $banned = false; + break; + } + else + { + $banned = true; + $ban_row = $row; + + if (!empty($row['ban_userid']) && intval($row['ban_userid']) == $user_id) + { + $ban_triggered_by = 'user'; + } + else if ($ip_banned) + { + $ban_triggered_by = 'ip'; + } + else + { + $ban_triggered_by = 'email'; + } + + // Don't break. Check if there is an exclude rule for this user + } + } + } + $db->sql_freeresult($result); + + /** + * Event to set custom ban type + * + * @event core.session_set_custom_ban + * @var bool return If $return is false this routine does not return on finding a banned user, it outputs a relevant message and stops execution + * @var bool banned Check if user already banned + * @var array|false ban_row Ban data + * @var string ban_triggered_by Method that caused ban, can be your custom method + * @since 3.1.3-RC1 + */ + $ban_row = isset($ban_row) ? $ban_row : false; + $vars = array('return', 'banned', 'ban_row', 'ban_triggered_by'); + extract($phpbb_dispatcher->trigger_event('core.session_set_custom_ban', compact($vars))); + + if ($banned && !$return) + { + global $template, $phpbb_root_path, $phpEx; + + // If the session is empty we need to create a valid one... + if (empty($this->session_id)) + { + // This seems to be no longer needed? - #14971 +// $this->session_create(ANONYMOUS); + } + + // Initiate environment ... since it won't be set at this stage + $this->setup(); + + // Logout the user, banned users are unable to use the normal 'logout' link + if ($this->data['user_id'] != ANONYMOUS) + { + $this->session_kill(); + } + + // We show a login box here to allow founders accessing the board if banned by IP + if (defined('IN_LOGIN') && $this->data['user_id'] == ANONYMOUS) + { + $this->setup('ucp'); + $this->data['is_registered'] = $this->data['is_bot'] = false; + + // Set as a precaution to allow login_box() handling this case correctly as well as this function not being executed again. + define('IN_CHECK_BAN', 1); + + login_box("index.$phpEx"); + + // The false here is needed, else the user is able to circumvent the ban. + $this->session_kill(false); + } + + // Ok, we catch the case of an empty session id for the anonymous user... + // This can happen if the user is logging in, banned by username and the login_box() being called "again". + if (empty($this->session_id) && defined('IN_CHECK_BAN')) + { + $this->session_create(ANONYMOUS); + } + + // Determine which message to output + $till_date = ($ban_row['ban_end']) ? $this->format_date($ban_row['ban_end']) : ''; + $message = ($ban_row['ban_end']) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM'; + + $contact_link = phpbb_get_board_contact_link($config, $phpbb_root_path, $phpEx); + $message = sprintf($this->lang[$message], $till_date, '', ''); + $message .= ($ban_row['ban_give_reason']) ? '

' . sprintf($this->lang['BOARD_BAN_REASON'], $ban_row['ban_give_reason']) : ''; + $message .= '

' . $this->lang['BAN_TRIGGERED_BY_' . strtoupper($ban_triggered_by)] . ''; + + // To circumvent session_begin returning a valid value and the check_ban() not called on second page view, we kill the session again + $this->session_kill(false); + + // A very special case... we are within the cron script which is not supposed to print out the ban message... show blank page + if (defined('IN_CRON')) + { + garbage_collection(); + exit_handler(); + exit; + } + + trigger_error($message); + } + + return ($banned && $ban_row['ban_give_reason']) ? $ban_row['ban_give_reason'] : $banned; + } + + /** + * Check if ip is blacklisted + * This should be called only where absolutely necessary + * + * Only IPv4 (rbldns does not support AAAA records/IPv6 lookups) + * + * @author satmd (from the php manual) + * @param string $mode register/post - spamcop for example is ommitted for posting + * @param string|false $ip the IPv4 address to check + * + * @return false if ip is not blacklisted, else an array([checked server], [lookup]) + */ + function check_dnsbl($mode, $ip = false) + { + if ($ip === false) + { + $ip = $this->ip; + } + + // Neither Spamhaus nor Spamcop supports IPv6 addresses. + if (strpos($ip, ':') !== false) + { + return false; + } + + $dnsbl_check = array( + 'sbl.spamhaus.org' => 'http://www.spamhaus.org/query/bl?ip=', + ); + + if ($mode == 'register') + { + $dnsbl_check['bl.spamcop.net'] = 'http://spamcop.net/bl.shtml?'; + } + + if ($ip) + { + $quads = explode('.', $ip); + $reverse_ip = $quads[3] . '.' . $quads[2] . '.' . $quads[1] . '.' . $quads[0]; + + // Need to be listed on all servers... + $listed = true; + $info = array(); + + foreach ($dnsbl_check as $dnsbl => $lookup) + { + if (phpbb_checkdnsrr($reverse_ip . '.' . $dnsbl . '.', 'A') === true) + { + $info = array($dnsbl, $lookup . $ip); + } + else + { + $listed = false; + } + } + + if ($listed) + { + return $info; + } + } + + return false; + } + + /** + * Check if URI is blacklisted + * This should be called only where absolutly necessary, for example on the submitted website field + * This function is not in use at the moment and is only included for testing purposes, it may not work at all! + * This means it is untested at the moment and therefore commented out + * + * @param string $uri URI to check + * @return true if uri is on blacklist, else false. Only blacklist is checked (~zero FP), no grey lists + function check_uribl($uri) + { + // Normally parse_url() is not intended to parse uris + // We need to get the top-level domain name anyway... change. + $uri = parse_url($uri); + + if ($uri === false || empty($uri['host'])) + { + return false; + } + + $uri = trim($uri['host']); + + if ($uri) + { + // One problem here... the return parameter for the "windows" method is different from what + // we expect... this may render this check useless... + if (phpbb_checkdnsrr($uri . '.multi.uribl.com.', 'A') === true) + { + return true; + } + } + + return false; + } + */ + + /** + * Set/Update a persistent login key + * + * This method creates or updates a persistent session key. When a user makes + * use of persistent (formerly auto-) logins a key is generated and stored in the + * DB. When they revisit with the same key it's automatically updated in both the + * DB and cookie. Multiple keys may exist for each user representing different + * browsers or locations. As with _any_ non-secure-socket no passphrase login this + * remains vulnerable to exploit. + */ + function set_login_key($user_id = false, $key = false, $user_ip = false) + { + global $config, $db; + + $user_id = ($user_id === false) ? $this->data['user_id'] : $user_id; + $user_ip = ($user_ip === false) ? $this->ip : $user_ip; + $key = ($key === false) ? (($this->cookie_data['k']) ? $this->cookie_data['k'] : false) : $key; + + $key_id = unique_id(hexdec(substr($this->session_id, 0, 8))); + + $sql_ary = array( + 'key_id' => (string) md5($key_id), + 'last_ip' => (string) $this->ip, + 'last_login' => (int) time() + ); + + if (!$key) + { + $sql_ary += array( + 'user_id' => (int) $user_id + ); + } + + if ($key) + { + $sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . (int) $user_id . " + AND key_id = '" . $db->sql_escape(md5($key)) . "'"; + } + else + { + $sql = 'INSERT INTO ' . SESSIONS_KEYS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + } + $db->sql_query($sql); + + $this->cookie_data['k'] = $key_id; + + return false; + } + + /** + * Reset all login keys for the specified user + * + * This method removes all current login keys for a specified (or the current) + * user. It will be called on password change to render old keys unusable + */ + function reset_login_keys($user_id = false) + { + global $config, $db; + + $user_id = ($user_id === false) ? (int) $this->data['user_id'] : (int) $user_id; + + $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' + WHERE user_id = ' . (int) $user_id; + $db->sql_query($sql); + + // If the user is logged in, update last visit info first before deleting sessions + $sql = 'SELECT session_time, session_page + FROM ' . SESSIONS_TABLE . ' + WHERE session_user_id = ' . (int) $user_id . ' + ORDER BY session_time DESC'; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_lastvisit = ' . (int) $row['session_time'] . ", user_lastpage = '" . $db->sql_escape($row['session_page']) . "' + WHERE user_id = " . (int) $user_id; + $db->sql_query($sql); + } + + // Let's also clear any current sessions for the specified user_id + // If it's the current user then we'll leave this session intact + $sql_where = 'session_user_id = ' . (int) $user_id; + $sql_where .= ($user_id === (int) $this->data['user_id']) ? " AND session_id <> '" . $db->sql_escape($this->session_id) . "'" : ''; + + $sql = 'DELETE FROM ' . SESSIONS_TABLE . " + WHERE $sql_where"; + $db->sql_query($sql); + + // We're changing the password of the current user and they have a key + // Lets regenerate it to be safe + if ($user_id === (int) $this->data['user_id'] && $this->cookie_data['k']) + { + $this->set_login_key($user_id); + } + } + + + /** + * Check if the request originated from the same page. + * @param bool $check_script_path If true, the path will be checked as well + */ + function validate_referer($check_script_path = false) + { + global $config, $request; + + // no referer - nothing to validate, user's fault for turning it off (we only check on POST; so meta can't be the reason) + if (empty($this->referer) || empty($this->host)) + { + return true; + } + + $host = htmlspecialchars($this->host); + $ref = substr($this->referer, strpos($this->referer, '://') + 3); + + if (!(stripos($ref, $host) === 0) && (!$config['force_server_vars'] || !(stripos($ref, $config['server_name']) === 0))) + { + return false; + } + else if ($check_script_path && rtrim($this->page['root_script_path'], '/') !== '') + { + $ref = substr($ref, strlen($host)); + $server_port = $request->server('SERVER_PORT', 0); + + if ($server_port !== 80 && $server_port !== 443 && stripos($ref, ":$server_port") === 0) + { + $ref = substr($ref, strlen(":$server_port")); + } + + if (!(stripos(rtrim($ref, '/'), rtrim($this->page['root_script_path'], '/')) === 0)) + { + return false; + } + } + + return true; + } + + + function unset_admin() + { + global $db; + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET session_admin = 0 + WHERE session_id = \'' . $db->sql_escape($this->session_id) . '\''; + $db->sql_query($sql); + } + + /** + * Update the session data + * + * @param array $session_data associative array of session keys to be updated + * @param string $session_id optional session_id, defaults to current user's session_id + */ + public function update_session($session_data, $session_id = null) + { + global $db; + + $session_id = ($session_id) ? $session_id : $this->session_id; + + $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $session_data) . " + WHERE session_id = '" . $db->sql_escape($session_id) . "'"; + $db->sql_query($sql); + } +} diff --git a/sources/phpBB/phpbb/symfony_request.php b/sources/phpBB/phpbb/symfony_request.php new file mode 100644 index 0000000..2931cae --- /dev/null +++ b/sources/phpBB/phpbb/symfony_request.php @@ -0,0 +1,39 @@ + +* @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; + +use Symfony\Component\HttpFoundation\Request; + +/** + * WARNING: The Symfony request does not escape the input and should be used very carefully + * prefer the phpbb request as possible + */ +class symfony_request extends Request +{ + /** + * Constructor + * + * @param \phpbb\request\request_interface $phpbb_request + */ + public function __construct(\phpbb\request\request_interface $phpbb_request) + { + $get_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::GET); + $post_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::POST); + $server_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::SERVER); + $files_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::FILES); + $cookie_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::COOKIE); + + parent::__construct($get_parameters, $post_parameters, array(), $cookie_parameters, $files_parameters, $server_parameters); + } +} diff --git a/sources/phpBB/phpbb/template/asset.php b/sources/phpBB/phpbb/template/asset.php new file mode 100644 index 0000000..67dbd7b --- /dev/null +++ b/sources/phpBB/phpbb/template/asset.php @@ -0,0 +1,186 @@ + +* @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; + +class asset +{ + protected $components = array(); + + /** @var \phpbb\path_helper **/ + protected $path_helper; + + /** + * Constructor + * + * @param string $url URL + * @param \phpbb\path_helper $path_helper Path helper object + */ + public function __construct($url, \phpbb\path_helper $path_helper) + { + $this->path_helper = $path_helper; + + $this->set_url($url); + } + + /** + * Set URL + * + * @param string $url URL + */ + public function set_url($url) + { + if (version_compare(PHP_VERSION, '5.4.7') < 0 && substr($url, 0, 2) === '//') + { + // Workaround for PHP 5.4.6 and older bug #62844 - add fake scheme and then remove it + $this->components = parse_url('http:' . $url); + $this->components['scheme'] = ''; + return; + } + $this->components = parse_url($url); + } + + /** + * Convert URL components into string + * + * @param array $components URL components + * @return string URL + */ + protected function join_url($components) + { + $path = ''; + if (isset($components['scheme'])) + { + $path = $components['scheme'] === '' ? '//' : $components['scheme'] . '://'; + } + + if (isset($components['user']) || isset($components['pass'])) + { + if ($path === '' && !isset($components['port'])) + { + $path = '//'; + } + $path .= $components['user']; + if (isset($components['pass'])) + { + $path .= ':' . $components['pass']; + } + $path .= '@'; + } + + if (isset($components['host'])) + { + if ($path === '' && !isset($components['port'])) + { + $path = '//'; + } + $path .= $components['host']; + if (isset($components['port'])) + { + $path .= ':' . $components['port']; + } + } + + if (isset($components['path'])) + { + $path .= $components['path']; + } + + if (isset($components['query'])) + { + $path .= '?' . $components['query']; + } + + if (isset($components['fragment'])) + { + $path .= '#' . $components['fragment']; + } + + return $path; + } + + /** + * Get URL + * + * @return string URL + */ + public function get_url() + { + return $this->path_helper->update_web_root_path($this->join_url($this->components)); + } + + /** + * Checks if URL is local and relative + * + * @return boolean True if URL is local and relative + */ + public function is_relative() + { + if (empty($this->components) || !isset($this->components['path'])) + { + // Invalid URL + return false; + } + return !isset($this->components['scheme']) && !isset($this->components['host']) && substr($this->components['path'], 0, 1) !== '/'; + } + + /** + * Get path component of current URL + * + * @return string Path + */ + public function get_path() + { + return isset($this->components['path']) ? $this->components['path'] : ''; + } + + /** + * Set path component + * + * @param string $path Path component + * @param boolean $urlencode If true, parts of path should be encoded with rawurlencode() + */ + public function set_path($path, $urlencode = false) + { + if ($urlencode) + { + $paths = explode('/', $path); + foreach ($paths as &$dir) + { + $dir = rawurlencode($dir); + } + $path = implode('/', $paths); + } + $this->components['path'] = $path; + } + + /** + * Add assets_version parameter to URL. + * Parameter will not be added if assets_version already exists in URL + * + * @param string $version Version + */ + public function add_assets_version($version) + { + if (!isset($this->components['query'])) + { + $this->components['query'] = 'assets_version=' . $version; + return; + } + $query = $this->components['query']; + if (!preg_match('/(^|[&;])assets_version=/', $query)) + { + $this->components['query'] = $query . '&assets_version=' . $version; + } + } +} diff --git a/sources/phpBB/phpbb/template/base.php b/sources/phpBB/phpbb/template/base.php new file mode 100644 index 0000000..9a40702 --- /dev/null +++ b/sources/phpBB/phpbb/template/base.php @@ -0,0 +1,156 @@ + +* @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; + +abstract class base implements template +{ + /** + * Template context. + * Stores template data used during template rendering. + * + * @var \phpbb\template\context + */ + protected $context; + + /** + * Array of filenames assigned to set_filenames + * + * @var array + */ + protected $filenames = array(); + + /** + * {@inheritdoc} + */ + public function set_filenames(array $filename_array) + { + $this->filenames = array_merge($this->filenames, $filename_array); + + return $this; + } + + /** + * Get a filename from the handle + * + * @param string $handle + * @return string + */ + protected function get_filename_from_handle($handle) + { + return (isset($this->filenames[$handle])) ? $this->filenames[$handle] : $handle; + } + + /** + * {@inheritdoc} + */ + public function destroy() + { + $this->context->clear(); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function destroy_block_vars($blockname) + { + $this->context->destroy_block_vars($blockname); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function assign_vars(array $vararray) + { + foreach ($vararray as $key => $val) + { + $this->assign_var($key, $val); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function assign_var($varname, $varval) + { + $this->context->assign_var($varname, $varval); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function append_var($varname, $varval) + { + $this->context->append_var($varname, $varval); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function assign_block_vars($blockname, array $vararray) + { + $this->context->assign_block_vars($blockname, $vararray); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function assign_block_vars_array($blockname, array $block_vars_array) + { + $this->context->assign_block_vars_array($blockname, $block_vars_array); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function alter_block_array($blockname, array $vararray, $key = false, $mode = 'insert') + { + return $this->context->alter_block_array($blockname, $vararray, $key, $mode); + } + + /** + * Calls hook if any is defined. + * + * @param string $handle Template handle being displayed. + * @param string $method Method name of the caller. + */ + protected function call_hook($handle, $method) + { + global $phpbb_hook; + + if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array('template', $method), $handle, $this)) + { + if ($phpbb_hook->hook_return(array('template', $method))) + { + $result = $phpbb_hook->hook_return_result(array('template', $method)); + return array($result); + } + } + + return false; + } +} diff --git a/sources/phpBB/phpbb/template/context.php b/sources/phpBB/phpbb/template/context.php new file mode 100644 index 0000000..4ee4820 --- /dev/null +++ b/sources/phpBB/phpbb/template/context.php @@ -0,0 +1,446 @@ + +* @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; + +/** +* Stores variables assigned to template. +*/ +class context +{ + /** + * variable that holds all the data we'll be substituting into + * the compiled templates. Takes form: + * --> $this->tpldata[block][iteration#][child][iteration#][child2][iteration#][variablename] == value + * if it's a root-level variable, it'll be like this: + * --> $this->tpldata[.][0][varname] == value + * + * @var array + */ + private $tpldata = array('.' => array(0 => array())); + + /** + * @var array Reference to template->tpldata['.'][0] + */ + private $rootref; + + /** + * @var bool + */ + private $num_rows_is_set; + + public function __construct() + { + $this->clear(); + } + + /** + * Clears template data set. + */ + public function clear() + { + $this->tpldata = array('.' => array(0 => array())); + $this->rootref = &$this->tpldata['.'][0]; + $this->num_rows_is_set = false; + } + + /** + * Assign a single scalar value to a single key. + * + * Value can be a string, an integer or a boolean. + * + * @param string $varname Variable name + * @param string $varval Value to assign to variable + * @return true + */ + public function assign_var($varname, $varval) + { + $this->rootref[$varname] = $varval; + + return true; + } + + /** + * Append text to the string value stored in a key. + * + * Text is appended using the string concatenation operator (.). + * + * @param string $varname Variable name + * @param string $varval Value to append to variable + * @return true + */ + public function append_var($varname, $varval) + { + $this->rootref[$varname] = (isset($this->rootref[$varname]) ? $this->rootref[$varname] : '') . $varval; + + return true; + } + + /** + * Returns a reference to template data array. + * + * This function is public so that template renderer may invoke it. + * Users should alter template variables via functions in \phpbb\template\template. + * + * Note: modifying returned array will affect data stored in the context. + * + * @return array template data + */ + public function &get_data_ref() + { + // returning a reference directly is not + // something php is capable of doing + $ref = &$this->tpldata; + + if (!$this->num_rows_is_set) + { + /* + * We do not set S_NUM_ROWS while adding a row, to reduce the complexity + * If we would set it on adding, each subsequent adding would cause + * n modifications, resulting in a O(n!) complexity, rather then O(n) + */ + foreach ($ref as $loop_name => &$loop_data) + { + if ($loop_name === '.') + { + continue; + } + + $this->set_num_rows($loop_data); + } + $this->num_rows_is_set = true; + } + + return $ref; + } + + /** + * Set S_NUM_ROWS for each row in this template block + * + * @param array $loop_data + */ + protected function set_num_rows(&$loop_data) + { + $s_num_rows = sizeof($loop_data); + foreach ($loop_data as &$mod_block) + { + foreach ($mod_block as $sub_block_name => &$sub_block) + { + // If the key name is lowercase and the data is an array, + // it could be a template loop. So we set the S_NUM_ROWS there + // aswell. + if ($sub_block_name === strtolower($sub_block_name) && is_array($sub_block)) + { + $this->set_num_rows($sub_block); + } + } + + // Check whether we are inside a block before setting the variable + if (isset($mod_block['S_BLOCK_NAME'])) + { + $mod_block['S_NUM_ROWS'] = $s_num_rows; + } + } + } + + /** + * Returns a reference to template root scope. + * + * This function is public so that template renderer may invoke it. + * Users should not need to invoke this function. + * + * Note: modifying returned array will affect data stored in the context. + * + * @return array template data + */ + public function &get_root_ref() + { + // rootref is already a reference + return $this->rootref; + } + + /** + * Assign key variable pairs from an array to a specified block + * + * @param string $blockname Name of block to assign $vararray to + * @param array $vararray A hash of variable name => value pairs + * @return true + */ + public function assign_block_vars($blockname, array $vararray) + { + $this->num_rows_is_set = false; + if (strpos($blockname, '.') !== false) + { + // Nested block. + $blocks = explode('.', $blockname); + $blockcount = sizeof($blocks) - 1; + + $str = &$this->tpldata; + for ($i = 0; $i < $blockcount; $i++) + { + $str = &$str[$blocks[$i]]; + $str = &$str[sizeof($str) - 1]; + } + + $s_row_count = isset($str[$blocks[$blockcount]]) ? sizeof($str[$blocks[$blockcount]]) : 0; + $vararray['S_ROW_COUNT'] = $vararray['S_ROW_NUM'] = $s_row_count; + + // Assign S_FIRST_ROW + if (!$s_row_count) + { + $vararray['S_FIRST_ROW'] = true; + } + + // Assign S_BLOCK_NAME + $vararray['S_BLOCK_NAME'] = $blocks[$blockcount]; + + // Now the tricky part, we always assign S_LAST_ROW and remove the entry before + // This is much more clever than going through the complete template data on display (phew) + $vararray['S_LAST_ROW'] = true; + if ($s_row_count > 0) + { + unset($str[$blocks[$blockcount]][($s_row_count - 1)]['S_LAST_ROW']); + } + + // Now we add the block that we're actually assigning to. + // We're adding a new iteration to this block with the given + // variable assignments. + $str[$blocks[$blockcount]][] = $vararray; + } + else + { + // Top-level block. + $s_row_count = (isset($this->tpldata[$blockname])) ? sizeof($this->tpldata[$blockname]) : 0; + $vararray['S_ROW_COUNT'] = $vararray['S_ROW_NUM'] = $s_row_count; + + // Assign S_FIRST_ROW + if (!$s_row_count) + { + $vararray['S_FIRST_ROW'] = true; + } + + // Assign S_BLOCK_NAME + $vararray['S_BLOCK_NAME'] = $blockname; + + // We always assign S_LAST_ROW and remove the entry before + $vararray['S_LAST_ROW'] = true; + if ($s_row_count > 0) + { + unset($this->tpldata[$blockname][($s_row_count - 1)]['S_LAST_ROW']); + } + + // Add a new iteration to this block with the variable assignments we were given. + $this->tpldata[$blockname][] = $vararray; + } + + return true; + } + + /** + * Assign key variable pairs from an array to a whole specified block loop + * + * @param string $blockname Name of block to assign $block_vars_array to + * @param array $block_vars_array An array of hashes of variable name => value pairs + * @return true + */ + public function assign_block_vars_array($blockname, array $block_vars_array) + { + foreach ($block_vars_array as $vararray) + { + $this->assign_block_vars($blockname, $vararray); + } + + return true; + } + + /** + * Change already assigned key variable pair (one-dimensional - single loop entry) + * + * An example of how to use this function: + * {@example alter_block_array.php} + * + * @param string $blockname the blockname, for example 'loop' + * @param array $vararray the var array to insert/add or merge + * @param mixed $key Key to search for + * + * array: KEY => VALUE [the key/value pair to search for within the loop to determine the correct position] + * + * int: Position [the position to change or insert at directly given] + * + * If key is false the position is set to 0 + * If key is true the position is set to the last entry + * + * @param string $mode Mode to execute (valid modes are 'insert' and 'change') + * + * If insert, the vararray is inserted at the given position (position counting from zero). + * If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be replaced by the new \value). + * + * Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array) + * and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars) + * + * @return bool false on error, true on success + */ + public function alter_block_array($blockname, array $vararray, $key = false, $mode = 'insert') + { + $this->num_rows_is_set = false; + if (strpos($blockname, '.') !== false) + { + // Nested block. + $blocks = explode('.', $blockname); + $blockcount = sizeof($blocks) - 1; + + $block = &$this->tpldata; + for ($i = 0; $i < $blockcount; $i++) + { + if (($pos = strpos($blocks[$i], '[')) !== false) + { + $name = substr($blocks[$i], 0, $pos); + + if (strpos($blocks[$i], '[]') === $pos) + { + $index = sizeof($block[$name]) - 1; + } + else + { + $index = min((int) substr($blocks[$i], $pos + 1, -1), sizeof($block[$name]) - 1); + } + } + else + { + $name = $blocks[$i]; + $index = sizeof($block[$name]) - 1; + } + $block = &$block[$name]; + $block = &$block[$index]; + } + + $block = &$block[$blocks[$i]]; // Traverse the last block + } + else + { + // Top-level block. + $block = &$this->tpldata[$blockname]; + } + + // Change key to zero (change first position) if false and to last position if true + if ($key === false || $key === true) + { + $key = ($key === false) ? 0 : sizeof($block); + } + + // Get correct position if array given + if (is_array($key)) + { + // Search array to get correct position + list($search_key, $search_value) = @each($key); + + $key = null; + foreach ($block as $i => $val_ary) + { + if ($val_ary[$search_key] === $search_value) + { + $key = $i; + break; + } + } + + // key/value pair not found + if ($key === null) + { + return false; + } + } + + // Insert Block + if ($mode == 'insert') + { + // Make sure we are not exceeding the last iteration + if ($key >= sizeof($this->tpldata[$blockname])) + { + $key = sizeof($this->tpldata[$blockname]); + unset($this->tpldata[$blockname][($key - 1)]['S_LAST_ROW']); + $vararray['S_LAST_ROW'] = true; + } + else if ($key === 0) + { + unset($this->tpldata[$blockname][0]['S_FIRST_ROW']); + $vararray['S_FIRST_ROW'] = true; + } + + // Assign S_BLOCK_NAME + $vararray['S_BLOCK_NAME'] = $blockname; + + // Re-position template blocks + for ($i = sizeof($block); $i > $key; $i--) + { + $block[$i] = $block[$i-1]; + + $block[$i]['S_ROW_COUNT'] = $block[$i]['S_ROW_NUM'] = $i; + } + + // Insert vararray at given position + $block[$key] = $vararray; + $block[$key]['S_ROW_COUNT'] = $block[$key]['S_ROW_NUM'] = $key; + + return true; + } + + // Which block to change? + if ($mode == 'change') + { + if ($key == sizeof($block)) + { + $key--; + } + + $block[$key] = array_merge($block[$key], $vararray); + + return true; + } + + return false; + } + + /** + * Reset/empty complete block + * + * @param string $blockname Name of block to destroy + * @return true + */ + public function destroy_block_vars($blockname) + { + $this->num_rows_is_set = false; + if (strpos($blockname, '.') !== false) + { + // Nested block. + $blocks = explode('.', $blockname); + $blockcount = sizeof($blocks) - 1; + + $str = &$this->tpldata; + for ($i = 0; $i < $blockcount; $i++) + { + $str = &$str[$blocks[$i]]; + $str = &$str[sizeof($str) - 1]; + } + + unset($str[$blocks[$blockcount]]); + } + else + { + // Top-level block. + unset($this->tpldata[$blockname]); + } + + return true; + } +} diff --git a/sources/phpBB/phpbb/template/template.php b/sources/phpBB/phpbb/template/template.php new file mode 100644 index 0000000..041ecb1 --- /dev/null +++ b/sources/phpBB/phpbb/template/template.php @@ -0,0 +1,182 @@ + +* @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; + +interface template +{ + + /** + * Clear the cache + * + * @return \phpbb\template\template + */ + public function clear_cache(); + + /** + * Sets the template filenames for handles. + * + * @param array $filename_array Should be a hash of handle => filename pairs. + * @return \phpbb\template\template $this + */ + public function set_filenames(array $filename_array); + + /** + * Get the style tree of the style preferred by the current user + * + * @return array Style tree, most specific first + */ + public function get_user_style(); + + /** + * Set style location based on (current) user's chosen style. + * + * @param array $style_directories The directories to add style paths for + * E.g. array('ext/foo/bar/styles', 'styles') + * Default: array('styles') (phpBB's style directory) + * @return \phpbb\template\template $this + */ + public function set_style($style_directories = array('styles')); + + /** + * Set custom style location (able to use directory outside of phpBB). + * + * Note: Templates are still compiled to phpBB's cache directory. + * + * @param string|array $names Array of names or string of name of template(s) in inheritance tree order, used by extensions. + * @param string|array or string $paths Array of style paths, relative to current root directory + * @return \phpbb\template\template $this + */ + public function set_custom_style($names, $paths); + + /** + * Clears all variables and blocks assigned to this template. + * + * @return \phpbb\template\template $this + */ + public function destroy(); + + /** + * Reset/empty complete block + * + * @param string $blockname Name of block to destroy + * @return \phpbb\template\template $this + */ + public function destroy_block_vars($blockname); + + /** + * Display a template for provided handle. + * + * The template will be loaded and compiled, if necessary, first. + * + * This function calls hooks. + * + * @param string $handle Handle to display + * @return \phpbb\template\template $this + */ + public function display($handle); + + /** + * Display the handle and assign the output to a template variable + * or return the compiled result. + * + * @param string $handle Handle to operate on + * @param string $template_var Template variable to assign compiled handle to + * @param bool $return_content If true return compiled handle, otherwise assign to $template_var + * @return \phpbb\template\template|string if $return_content is true return string of the compiled handle, otherwise return $this + */ + public function assign_display($handle, $template_var = '', $return_content = true); + + /** + * Assign key variable pairs from an array + * + * @param array $vararray A hash of variable name => value pairs + * @return \phpbb\template\template $this + */ + public function assign_vars(array $vararray); + + /** + * Assign a single scalar value to a single key. + * + * Value can be a string, an integer or a boolean. + * + * @param string $varname Variable name + * @param string $varval Value to assign to variable + * @return \phpbb\template\template $this + */ + public function assign_var($varname, $varval); + + /** + * Append text to the string value stored in a key. + * + * Text is appended using the string concatenation operator (.). + * + * @param string $varname Variable name + * @param string $varval Value to append to variable + * @return \phpbb\template\template $this + */ + public function append_var($varname, $varval); + + /** + * Assign key variable pairs from an array to a specified block + * @param string $blockname Name of block to assign $vararray to + * @param array $vararray A hash of variable name => value pairs + * @return \phpbb\template\template $this + */ + public function assign_block_vars($blockname, array $vararray); + + /** + * Assign key variable pairs from an array to a whole specified block loop + * @param string $blockname Name of block to assign $block_vars_array to + * @param array $block_vars_array An array of hashes of variable name => value pairs + * @return \phpbb\template\template $this + */ + public function assign_block_vars_array($blockname, array $block_vars_array); + + /** + * Change already assigned key variable pair (one-dimensional - single loop entry) + * + * An example of how to use this function: + * {@example alter_block_array.php} + * + * @param string $blockname the blockname, for example 'loop' + * @param array $vararray the var array to insert/add or merge + * @param mixed $key Key to search for + * + * array: KEY => VALUE [the key/value pair to search for within the loop to determine the correct position] + * + * int: Position [the position to change or insert at directly given] + * + * If key is false the position is set to 0 + * If key is true the position is set to the last entry + * + * @param string $mode Mode to execute (valid modes are 'insert' and 'change') + * + * If insert, the vararray is inserted at the given position (position counting from zero). + * If change, the current block gets merged with the vararray (resulting in new \key/value pairs be added and existing keys be replaced by the new \value). + * + * Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array) + * and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars) + * + * @return bool false on error, true on success + */ + public function alter_block_array($blockname, array $vararray, $key = false, $mode = 'insert'); + + /** + * Get path to template for handle (required for BBCode parser) + * + * @param string $handle Handle to retrieve the source file + * @return string + */ + public function get_source_file_for_handle($handle); +} diff --git a/sources/phpBB/phpbb/template/twig/definition.php b/sources/phpBB/phpbb/template/twig/definition.php new file mode 100644 index 0000000..cb3c953 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/definition.php @@ -0,0 +1,69 @@ + +* @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; + +/** +* This class holds all DEFINE variables from the current page load +*/ +class definition +{ + /** @var array **/ + protected $definitions = array(); + + /** + * Get a DEFINE'd variable + * + * @param string $name + * @param array $arguments + * + * @return mixed Null if not found + */ + public function __call($name, $arguments) + { + return (isset($this->definitions[$name])) ? $this->definitions[$name] : null; + } + + /** + * DEFINE a variable + * + * @param string $name + * @param mixed $value + * @return \phpbb\template\twig\definition + */ + public function set($name, $value) + { + $this->definitions[$name] = $value; + + return $this; + } + + /** + * Append to a variable + * + * @param string $name + * @param string $value + * @return \phpbb\template\twig\definition + */ + public function append($name, $value) + { + if (!isset($this->definitions[$name])) + { + $this->definitions[$name] = ''; + } + + $this->definitions[$name] .= $value; + + return $this; + } +} diff --git a/sources/phpBB/phpbb/template/twig/environment.php b/sources/phpBB/phpbb/template/twig/environment.php new file mode 100644 index 0000000..476ffd9 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/environment.php @@ -0,0 +1,205 @@ + +* @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; + +class environment extends \Twig_Environment +{ + /** @var \phpbb\config\config */ + protected $phpbb_config; + + /** @var \phpbb\path_helper */ + protected $phpbb_path_helper; + + /** @var \phpbb\extension\manager */ + protected $extension_manager; + + /** @var string */ + protected $phpbb_root_path; + + /** @var string */ + protected $web_root_path; + + /** @var array **/ + protected $namespace_look_up_order = array('__main__'); + + /** + * Constructor + * + * @param \phpbb\config\config $phpbb_config The phpBB configuration + * @param \phpbb\path_helper $path_helper phpBB path helper + * @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()) + { + $this->phpbb_config = $phpbb_config; + + $this->phpbb_path_helper = $path_helper; + $this->extension_manager = $extension_manager; + + $this->phpbb_root_path = $this->phpbb_path_helper->get_phpbb_root_path(); + $this->web_root_path = $this->phpbb_path_helper->get_web_root_path(); + + return parent::__construct($loader, $options); + } + + /** + * Get the list of enabled phpBB extensions + * + * Used in EVENT node + * + * @return array + */ + public function get_phpbb_extensions() + { + return ($this->extension_manager) ? $this->extension_manager->all_enabled() : array(); + } + + /** + * Get phpBB config + * + * @return \phpbb\config\config + */ + public function get_phpbb_config() + { + return $this->phpbb_config; + } + + /** + * Get the phpBB root path + * + * @return string + */ + public function get_phpbb_root_path() + { + return $this->phpbb_root_path; + } + + /** + * Get the web root path + * + * @return string + */ + public function get_web_root_path() + { + return $this->web_root_path; + } + + /** + * Get the phpbb path helper object + * + * @return \phpbb\path_helper + */ + public function get_path_helper() + { + return $this->phpbb_path_helper; + } + + /** + * Get the namespace look up order + * + * @return array + */ + public function getNamespaceLookUpOrder() + { + return $this->namespace_look_up_order; + } + + /** + * Set the namespace look up order to load templates from + * + * @param array $namespace + * @return \Twig_Environment + */ + public function setNamespaceLookUpOrder($namespace) + { + $this->namespace_look_up_order = $namespace; + + return $this; + } + + /** + * Loads a template by name. + * + * @param string $name The template name + * @param integer $index The index if it is an embedded template + * @return \Twig_TemplateInterface A template instance representing the given template name + * @throws \Twig_Error_Loader + */ + public function loadTemplate($name, $index = null) + { + if (strpos($name, '@') === false) + { + foreach ($this->getNamespaceLookUpOrder() as $namespace) + { + try + { + if ($namespace === '__main__') + { + return parent::loadTemplate($name, $index); + } + + return parent::loadTemplate('@' . $namespace . '/' . $name, $index); + } + catch (\Twig_Error_Loader $e) + { + } + } + + // We were unable to load any templates + throw $e; + } + else + { + return parent::loadTemplate($name, $index); + } + } + + /** + * Finds a template by name. + * + * @param string $name The template name + * @return string + * @throws \Twig_Error_Loader + */ + public function findTemplate($name) + { + if (strpos($name, '@') === false) + { + foreach ($this->getNamespaceLookUpOrder() as $namespace) + { + try + { + if ($namespace === '__main__') + { + return parent::getLoader()->getCacheKey($name); + } + + return parent::getLoader()->getCacheKey('@' . $namespace . '/' . $name); + } + catch (\Twig_Error_Loader $e) + { + } + } + + // We were unable to load any templates + throw $e; + } + else + { + return parent::getLoader()->getCacheKey($name); + } + } +} diff --git a/sources/phpBB/phpbb/template/twig/extension.php b/sources/phpBB/phpbb/template/twig/extension.php new file mode 100644 index 0000000..3a98349 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/extension.php @@ -0,0 +1,185 @@ + +* @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; + +class extension extends \Twig_Extension +{ + /** @var \phpbb\template\context */ + protected $context; + + /** @var \phpbb\user */ + protected $user; + + /** + * Constructor + * + * @param \phpbb\template\context $context + * @param \phpbb\user $user + * @return \phpbb\template\twig\extension + */ + public function __construct(\phpbb\template\context $context, $user) + { + $this->context = $context; + $this->user = $user; + } + + /** + * Get the name of this extension + * + * @return string + */ + public function getName() + { + return 'phpbb'; + } + + /** + * Returns the token parser instance to add to the existing list. + * + * @return array An array of Twig_TokenParser instances + */ + public function getTokenParsers() + { + return array( + new \phpbb\template\twig\tokenparser\defineparser, + new \phpbb\template\twig\tokenparser\includeparser, + new \phpbb\template\twig\tokenparser\includejs, + new \phpbb\template\twig\tokenparser\includecss, + new \phpbb\template\twig\tokenparser\event, + new \phpbb\template\twig\tokenparser\includephp, + new \phpbb\template\twig\tokenparser\php, + ); + } + + /** + * Returns a list of filters to add to the existing list. + * + * @return array An array of filters + */ + public function getFilters() + { + return array( + new \Twig_SimpleFilter('subset', array($this, 'loop_subset'), array('needs_environment' => true)), + new \Twig_SimpleFilter('addslashes', 'addslashes'), + ); + } + + /** + * Returns a list of global functions to add to the existing list. + * + * @return array An array of global functions + */ + public function getFunctions() + { + return array( + new \Twig_SimpleFunction('lang', array($this, 'lang')), + ); + } + + /** + * Returns a list of operators to add to the existing list. + * + * @return array An array of operators + */ + public function getOperators() + { + return array( + array( + '!' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'), + ), + array( + // precedence settings are copied from similar operators in Twig core extension + '||' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + '&&' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + + 'eq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Equal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + + 'ne' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + 'neq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + '<>' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + + '===' => array('precedence' => 20, 'class' => '\phpbb\template\twig\node\expression\binary\equalequal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + '!==' => array('precedence' => 20, 'class' => '\phpbb\template\twig\node\expression\binary\notequalequal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + + 'gt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Greater', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + 'gte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + 'ge' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + 'lt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Less', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + 'lte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + 'le' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + + 'mod' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + ), + ); + } + + /** + * Grabs a subset of a loop + * + * @param \Twig_Environment $env A Twig_Environment instance + * @param mixed $item A variable + * @param integer $start Start of the subset + * @param integer $end End of the subset + * @param Boolean $preserveKeys Whether to preserve key or not (when the input is an array) + * + * @return mixed The sliced variable + */ + function loop_subset(\Twig_Environment $env, $item, $start, $end = null, $preserveKeys = false) + { + // We do almost the same thing as Twig's slice (array_slice), except when $end is positive + if ($end >= 1) + { + // When end is > 1, subset will end on the last item in an array with the specified $end + // This is different from slice in that it is the number we end on rather than the number + // of items to grab (length) + + // Start must always be the actual starting number for this calculation (not negative) + $start = ($start < 0) ? sizeof($item) + $start : $start; + $end = $end - $start; + } + + // We always include the last element (this was the past design) + $end = ($end == -1 || $end === null) ? null : $end + 1; + + return twig_slice($env, $item, $start, $end, $preserveKeys); + } + + /** + * Get output for a language variable (L_FOO, LA_FOO) + * + * This function checks to see if the language var was outputted to $context + * (e.g. in the ACP, L_TITLE) + * If not, we return the result of $user->lang() + * + * @return string + */ + function lang() + { + $args = func_get_args(); + $key = $args[0]; + + $context = $this->context->get_data_ref(); + $context_vars = $context['.'][0]; + + if (isset($context_vars['L_' . $key])) + { + return $context_vars['L_' . $key]; + } + + // LA_ is transformed into lang(\'$1\')|addslashes, so we should not + // need to check for it + + return call_user_func_array(array($this->user, 'lang'), $args); + } +} diff --git a/sources/phpBB/phpbb/template/twig/lexer.php b/sources/phpBB/phpbb/template/twig/lexer.php new file mode 100644 index 0000000..c5dc727 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/lexer.php @@ -0,0 +1,354 @@ + +* @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; + +class lexer extends \Twig_Lexer +{ + public function tokenize($code, $filename = null) + { + // Our phpBB tags + // Commented out tokens are handled separately from the main replace + $phpbb_tags = array( + /*'BEGIN', + 'BEGINELSE', + 'END', + 'IF', + 'ELSE', + 'ELSEIF', + 'ENDIF', + 'DEFINE', + 'UNDEFINE',*/ + 'ENDDEFINE', + 'INCLUDE', + 'INCLUDEPHP', + 'INCLUDEJS', + 'INCLUDECSS', + 'PHP', + 'ENDPHP', + 'EVENT', + ); + + // Twig tag masks + $twig_tags = array( + 'autoescape', + 'endautoescape', + 'if', + 'elseif', + 'else', + 'endif', + 'block', + 'endblock', + 'use', + 'extends', + 'embed', + 'filter', + 'endfilter', + 'flush', + 'for', + 'endfor', + 'macro', + 'endmacro', + 'import', + 'from', + 'sandbox', + 'endsandbox', + 'set', + 'endset', + 'spaceless', + 'endspaceless', + 'verbatim', + 'endverbatim', + ); + + // Fix tokens that may have inline variables (e.g. with Twig style, {% TOKEN %} + // This also strips outer parenthesis, becomes + $code = preg_replace('##', '{% $1 $2 %}', $code); + + // Replace all of our twig masks with Twig code (e.g. with {% block $1 %}) + $code = $this->replace_twig_tag_masks($code, $twig_tags); + + // Replace all of our language variables, {L_VARNAME}, with Twig style, {{ lang('NAME') }} + // 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 variables, {VARNAME}, with Twig style, {{ VARNAME }} + // Appends any filters + $code = preg_replace('#{([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ $1$2 }}', $code); + + return parent::tokenize($code, $filename); + } + + /** + * Strip surrounding quotes + * + * First step to fix tokens that may have inline variables + * E.g. #', '', $code); + } + + /** + * Fix tokens that may have inline variables + * + * Second step to fix tokens that may have inline variables + * E.g. "; + }; + + return preg_replace_callback('##', $callback, $code); + } + + /** + * Add surrounding quotes + * + * Last step to fix tokens that may have inline variables + * E.g. #', '', $code); + } + + /** + * Fix begin tokens (convert our BEGIN to Twig for) + * + * Not meant to be used outside of this context, public because the anonymous function calls this + * + * @param string $code + * @param array $parent_nodes (used in recursion) + * @return string + */ + public function fix_begin_tokens($code, $parent_nodes = array()) + { + // PHP 5.3 cannot use $this in an anonymous function, so use this as a work-around + $parent_class = $this; + $callback = function ($matches) use ($parent_class, $parent_nodes) + { + $hard_parents = explode('.', $matches[1]); + array_pop($hard_parents); // ends with . + if ($hard_parents) + { + $parent_nodes = array_merge($hard_parents, $parent_nodes); + } + + $name = $matches[2]; + $subset = trim(substr($matches[3], 1, -1)); // Remove parenthesis + $body = $matches[4]; + + // Replace + $body = str_replace('', '{% else %}', $body); + + // Is the designer wanting to call another loop in a loop? + // + // + // + // + // 'loop2' is actually on the same nesting level as 'loop' you assign + // variables to it with template->assign_block_vars('loop2', array(...)) + if (strpos($name, '!') === 0) + { + // Count the number if ! occurrences + $count = substr_count($name, '!'); + for ($i = 0; $i < $count; $i++) + { + array_pop($parent_nodes); + $name = substr($name, 1); + } + } + + // Remove all parent nodes, e.g. foo, bar from foo.bar.foobar.VAR + foreach ($parent_nodes as $node) + { + $body = preg_replace('#([^a-zA-Z0-9_])' . $node . '\.([a-zA-Z0-9_]+)\.#', '$1$2.', $body); + } + + // Add current node to list of parent nodes for child nodes + $parent_nodes[] = $name; + + // Recursive...fix any child nodes + $body = $parent_class->fix_begin_tokens($body, $parent_nodes); + + // Need the parent variable name + array_pop($parent_nodes); + $parent = (!empty($parent_nodes)) ? end($parent_nodes) . '.' : ''; + + if ($subset !== '') + { + $subset = '|subset(' . $subset . ')'; + } + + $parent = ($parent) ?: 'loops.'; + // Turn into a Twig for loop + return "{% for {$name} in {$parent}{$name}{$subset} %}{$body}{% endfor %}"; + }; + + return preg_replace_callback('#(.+?)#s', $callback, $code); + } + + /** + * Fix IF statements + * + * @param string $code + * @return string + */ + protected function fix_if_tokens($code) + { + // Replace ELSE IF with ELSEIF + $code = preg_replace('##', '', $code); + + // Replace our "div by" with Twig's divisibleby (Twig does not like test names with spaces) + $code = preg_replace('# div by ([0-9]+)#', ' divisibleby($1)', $code); + + $callback = function($matches) + { + $inner = $matches[2]; + // Replace $TEST with definition.TEST + $inner = preg_replace('#(\s\(*!?)\$([a-zA-Z_0-9]+)#', '$1definition.$2', $inner); + + // Replace .foo with loops.foo|length + $inner = preg_replace('#(\s\(*!?)\.([a-zA-Z_0-9]+)([^a-zA-Z_0-9\.])#', '$1loops.$2|length$3', $inner); + + // Replace .foo.bar with foo.bar|length + $inner = preg_replace('#(\s\(*!?)\.([a-zA-Z_0-9\.]+)([^a-zA-Z_0-9\.])#', '$1$2|length$3', $inner); + + return ""; + }; + + return preg_replace_callback('##', $callback, $code); + } + + /** + * Fix DEFINE statements and {$VARNAME} variables + * + * @param string $code + * @return string + */ + protected function fix_define_tokens($code) + { + /** + * Changing $VARNAME to definition.varname because set is only local + * context (e.g. DEFINE $TEST will only make $TEST available in current + * template and any child templates, but not any parent templates). + * + * DEFINE handles setting it properly to definition in its node, but the + * variables reading FROM it need to be altered to definition.VARNAME + * + * Setting up definition as a class in the array passed to Twig + * ($context) makes set definition.TEST available in the global context + */ + + // Replace #', '{% DEFINE $1 %}', $code); + + // Changing UNDEFINE NAME to DEFINE NAME = null to save from creating an extra token parser/node + $code = preg_replace('##', '{% DEFINE $1= null %}', $code); + + // Replace all of our variables, {$VARNAME}, with Twig style, {{ definition.VARNAME }} + $code = preg_replace('#{\$([a-zA-Z0-9_\.]+)}#', '{{ definition.$1 }}', $code); + + // Replace all of our variables, ~ $VARNAME ~, with Twig style, ~ definition.VARNAME ~ + $code = preg_replace('#~ \$([a-zA-Z0-9_\.]+) ~#', '~ definition.$1 ~', $code); + + return $code; + } + + /** + * Replace Twig tag masks with Twig tag calls + * + * E.g. with {% block foo %} + * + * @param string $code + * @param array $twig_tags All tags we want to create a mask for + * @return string + */ + protected function replace_twig_tag_masks($code, $twig_tags) + { + $callback = function ($matches) + { + $matches[1] = strtolower($matches[1]); + + return "{% {$matches[1]}{$matches[2]}%}"; + }; + + foreach ($twig_tags as &$tag) + { + $tag = strtoupper($tag); + } + + // twig_tags is an array of the twig tags, which are all lowercase, but we use all uppercase tags + $code = preg_replace_callback('##',$callback, $code); + + return $code; + } +} diff --git a/sources/phpBB/phpbb/template/twig/loader.php b/sources/phpBB/phpbb/template/twig/loader.php new file mode 100644 index 0000000..2f8ffaa --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/loader.php @@ -0,0 +1,147 @@ + +* @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; + +/** +* Twig Template loader +*/ +class loader extends \Twig_Loader_Filesystem +{ + protected $safe_directories = array(); + + /** + * Set safe directories + * + * @param array $directories Array of directories that are safe (empty to clear) + * @return \Twig_Loader_Filesystem + */ + public function setSafeDirectories($directories = array()) + { + $this->safe_directories = array(); + + if (!empty($directories)) + { + foreach ($directories as $directory) + { + $this->addSafeDirectory($directory); + } + } + + return $this; + } + + /** + * Add safe directory + * + * @param string $directory Directory that should be added + * @return \Twig_Loader_Filesystem + */ + public function addSafeDirectory($directory) + { + $directory = phpbb_realpath($directory); + + if ($directory !== false) + { + $this->safe_directories[] = $directory; + } + + return $this; + } + + /** + * Get current safe directories + * + * @return array + */ + public function getSafeDirectories() + { + return $this->safe_directories; + } + + /** + * Override for parent::validateName() + * + * This is done because we added support for safe directories, and when Twig + * findTemplate() is called, validateName() is called first, which would + * always throw an exception if the file is outside of the configured + * template directories. + */ + protected function validateName($name) + { + return; + } + + /** + * Find the template + * + * Override for Twig_Loader_Filesystem::findTemplate to add support + * for loading from safe directories. + */ + protected function findTemplate($name) + { + $name = (string) $name; + + // normalize name + $name = preg_replace('#/{2,}#', '/', strtr($name, '\\', '/')); + + // If this is in the cache we can skip the entire process below + // as it should have already been validated + if (isset($this->cache[$name])) { + return $this->cache[$name]; + } + + // First, find the template name. The override above of validateName + // causes the validateName process to be skipped for this call + $file = parent::findTemplate($name); + + try + { + // Try validating the name (which may throw an exception) + parent::validateName($name); + } + catch (\Twig_Error_Loader $e) + { + if (strpos($e->getRawMessage(), 'Looks like you try to load a template outside configured directories') === 0) + { + // Ok, so outside of the configured template directories, we + // 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)); + + if ($directory === false) + { + // Some sort of error finding the actual path, must throw the exception + throw $e; + } + + foreach ($this->safe_directories as $safe_directory) + { + if (strpos($directory, $safe_directory) === 0) + { + // The directory being loaded is below a directory + // that is "safe". We're good to load it! + return $file; + } + } + } + + // Not within any safe directories + throw $e; + } + + // No exception from validateName, safe to load. + return $file; + } +} diff --git a/sources/phpBB/phpbb/template/twig/node/definenode.php b/sources/phpBB/phpbb/template/twig/node/definenode.php new file mode 100644 index 0000000..695ec42 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/node/definenode.php @@ -0,0 +1,57 @@ + +* @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher +* @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\node; + + +class definenode extends \Twig_Node +{ + public function __construct($capture, \Twig_NodeInterface $name, \Twig_NodeInterface $value, $lineno, $tag = null) + { + parent::__construct(array('name' => $name, 'value' => $value), array('capture' => $capture, 'safe' => false), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param \Twig_Compiler A Twig_Compiler instance + */ + public function compile(\Twig_Compiler $compiler) + { + $compiler->addDebugInfo($this); + + if ($this->getAttribute('capture')) { + $compiler + ->write("ob_start();\n") + ->subcompile($this->getNode('value')) + ; + + $compiler->write("\$value = ('' === \$value = ob_get_clean()) ? '' : new \Twig_Markup(\$value, \$this->env->getCharset());\n"); + } + else + { + $compiler + ->write("\$value = ") + ->subcompile($this->getNode('value')) + ->raw(";\n") + ; + } + + $compiler + ->write("\$context['definition']->set('") + ->raw($this->getNode('name')->getAttribute('name')) + ->raw("', \$value);\n") + ; + } +} diff --git a/sources/phpBB/phpbb/template/twig/node/event.php b/sources/phpBB/phpbb/template/twig/node/event.php new file mode 100644 index 0000000..8fc4ba4 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/node/event.php @@ -0,0 +1,83 @@ + +* @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\node; + + +class event extends \Twig_Node +{ + /** + * The subdirectory in which all template listener files must be placed + * @var string + */ + protected $listener_directory = 'event/'; + + /** @var \Twig_Environment */ + protected $environment; + + public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null) + { + $this->environment = $environment; + + parent::__construct(array('expr' => $expr), array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param \Twig_Compiler A Twig_Compiler instance + */ + public function compile(\Twig_Compiler $compiler) + { + $compiler->addDebugInfo($this); + + $location = $this->listener_directory . $this->getNode('expr')->getAttribute('name'); + + foreach ($this->environment->get_phpbb_extensions() as $ext_namespace => $ext_path) + { + $ext_namespace = str_replace('/', '_', $ext_namespace); + + if (defined('DEBUG')) + { + // If debug mode is enabled, lets check for new/removed EVENT + // templates on page load rather than at compile. This is + // slower, but makes developing extensions easier (no need to + // purge the cache when a new event template file is added) + $compiler + ->write("if (\$this->env->getLoader()->exists('@{$ext_namespace}/{$location}.html')) {\n") + ->indent() + ; + } + + if (defined('DEBUG') || $this->environment->getLoader()->exists('@' . $ext_namespace . '/' . $location . '.html')) + { + $compiler + ->write("\$previous_look_up_order = \$this->env->getNamespaceLookUpOrder();\n") + + // We set the namespace lookup order to be this extension first, then the main path + ->write("\$this->env->setNamespaceLookUpOrder(array('{$ext_namespace}', '__main__'));\n") + ->write("\$this->env->loadTemplate('@{$ext_namespace}/{$location}.html')->display(\$context);\n") + ->write("\$this->env->setNamespaceLookUpOrder(\$previous_look_up_order);\n") + ; + } + + if (defined('DEBUG')) + { + $compiler + ->outdent() + ->write("}\n\n") + ; + } + } + } +} diff --git a/sources/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php b/sources/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php new file mode 100644 index 0000000..8c7f7b3 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php @@ -0,0 +1,23 @@ + +* @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\node\expression\binary; + + +class equalequal extends \Twig_Node_Expression_Binary +{ + public function operator(\Twig_Compiler $compiler) + { + return $compiler->raw('==='); + } +} diff --git a/sources/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php b/sources/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php new file mode 100644 index 0000000..2e95c68 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php @@ -0,0 +1,23 @@ + +* @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\node\expression\binary; + + +class notequalequal extends \Twig_Node_Expression_Binary +{ + public function operator(\Twig_Compiler $compiler) + { + return $compiler->raw('!=='); + } +} diff --git a/sources/phpBB/phpbb/template/twig/node/includeasset.php b/sources/phpBB/phpbb/template/twig/node/includeasset.php new file mode 100644 index 0000000..15195a2 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/node/includeasset.php @@ -0,0 +1,81 @@ + +* @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\node; + +abstract class includeasset extends \Twig_Node +{ + /** @var \Twig_Environment */ + protected $environment; + + public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null) + { + $this->environment = $environment; + + parent::__construct(array('expr' => $expr), array(), $lineno, $tag); + } + /** + * Compiles the node to PHP. + * + * @param \Twig_Compiler A Twig_Compiler instance + */ + public function compile(\Twig_Compiler $compiler) + { + $compiler->addDebugInfo($this); + + $config = $this->environment->get_phpbb_config(); + + $compiler + ->write("\$asset_file = ") + ->subcompile($this->getNode('expr')) + ->raw(";\n") + ->write("\$asset = new \phpbb\\template\\asset(\$asset_file, \$this->getEnvironment()->get_path_helper());\n") + ->write("if (substr(\$asset_file, 0, 2) !== './' && \$asset->is_relative()) {\n") + ->indent() + ->write("\$asset_path = \$asset->get_path();") + ->write("\$local_file = \$this->getEnvironment()->get_phpbb_root_path() . \$asset_path;\n") + ->write("if (!file_exists(\$local_file)) {\n") + ->indent() + ->write("\$local_file = \$this->getEnvironment()->findTemplate(\$asset_path);\n") + ->write("\$asset->set_path(\$local_file, true);\n") + ->outdent() + ->write("\$asset->add_assets_version('{$config['assets_version']}');\n") + ->write("\$asset_file = \$asset->get_url();\n") + ->write("}\n") + ->outdent() + ->write("}\n") + ->write("\$context['definition']->append('{$this->get_definition_name()}', '") + ; + + $this->append_asset($compiler); + + $compiler + ->raw("\n');\n") + ; + } + + /** + * Get the definition name + * + * @return string (e.g. 'SCRIPTS') + */ + abstract public function get_definition_name(); + + /** + * Append the output code for the asset + * + * @param \Twig_Compiler A Twig_Compiler instance + * @return null + */ + abstract protected function append_asset(\Twig_Compiler $compiler); +} diff --git a/sources/phpBB/phpbb/template/twig/node/includecss.php b/sources/phpBB/phpbb/template/twig/node/includecss.php new file mode 100644 index 0000000..2ce6340 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/node/includecss.php @@ -0,0 +1,37 @@ + +* @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\node; + +class includecss extends \phpbb\template\twig\node\includeasset +{ + /** + * {@inheritdoc} + */ + public function get_definition_name() + { + return 'STYLESHEETS'; + } + + /** + * {@inheritdoc} + */ + public function append_asset(\Twig_Compiler $compiler) + { + $compiler + ->raw("raw("\$asset_file . '\"") + ->raw(' rel="stylesheet" type="text/css" media="screen, projection" />') + ; + } +} diff --git a/sources/phpBB/phpbb/template/twig/node/includejs.php b/sources/phpBB/phpbb/template/twig/node/includejs.php new file mode 100644 index 0000000..0f67f9f --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/node/includejs.php @@ -0,0 +1,39 @@ + +* @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\node; + +class includejs extends \phpbb\template\twig\node\includeasset +{ + /** + * {@inheritdoc} + */ + public function get_definition_name() + { + return 'SCRIPTS'; + } + + /** + * {@inheritdoc} + */ + protected function append_asset(\Twig_Compiler $compiler) + { + $config = $this->environment->get_phpbb_config(); + + $compiler + ->raw("\n") + ; + } +} diff --git a/sources/phpBB/phpbb/template/twig/node/includenode.php b/sources/phpBB/phpbb/template/twig/node/includenode.php new file mode 100644 index 0000000..42428b6 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/node/includenode.php @@ -0,0 +1,54 @@ + +* @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\node; + + +class includenode extends \Twig_Node_Include +{ + /** + * Compiles the node to PHP. + * + * @param \Twig_Compiler A Twig_Compiler instance + */ + public function compile(\Twig_Compiler $compiler) + { + $compiler->addDebugInfo($this); + + $compiler + ->write("\$location = ") + ->subcompile($this->getNode('expr')) + ->raw(";\n") + ->write("\$namespace = false;\n") + ->write("if (strpos(\$location, '@') === 0) {\n") + ->indent() + ->write("\$namespace = substr(\$location, 1, strpos(\$location, '/') - 1);\n") + ->write("\$previous_look_up_order = \$this->env->getNamespaceLookUpOrder();\n") + + // We set the namespace lookup order to be this namespace first, then the main path + ->write("\$this->env->setNamespaceLookUpOrder(array(\$namespace, '__main__'));\n") + ->outdent() + ->write("}\n") + ; + + parent::compile($compiler); + + $compiler + ->write("if (\$namespace) {\n") + ->indent() + ->write("\$this->env->setNamespaceLookUpOrder(\$previous_look_up_order);\n") + ->outdent() + ->write("}\n") + ; + } +} diff --git a/sources/phpBB/phpbb/template/twig/node/includephp.php b/sources/phpBB/phpbb/template/twig/node/includephp.php new file mode 100644 index 0000000..826617e --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/node/includephp.php @@ -0,0 +1,90 @@ + +* Sections (c) 2009 Fabien Potencier, Armin Ronacher +* @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\node; + + +class includephp extends \Twig_Node +{ + /** @var \Twig_Environment */ + protected $environment; + + public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $ignoreMissing = false, $tag = null) + { + $this->environment = $environment; + + parent::__construct(array('expr' => $expr), array('ignore_missing' => (Boolean) $ignoreMissing), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param \Twig_Compiler A Twig_Compiler instance + */ + public function compile(\Twig_Compiler $compiler) + { + $compiler->addDebugInfo($this); + + $config = $this->environment->get_phpbb_config(); + + if (!$config['tpl_allow_php']) + { + $compiler + ->write("// INCLUDEPHP Disabled\n") + ; + + return; + } + + if ($this->getAttribute('ignore_missing')) { + $compiler + ->write("try {\n") + ->indent() + ; + } + + $compiler + ->write("\$location = ") + ->subcompile($this->getNode('expr')) + ->raw(";\n") + ->write("if (phpbb_is_absolute(\$location)) {\n") + ->indent() + // Absolute path specified + ->write("require(\$location);\n") + ->outdent() + ->write("} else if (file_exists(\$this->getEnvironment()->get_phpbb_root_path() . \$location)) {\n") + ->indent() + // PHP file relative to phpbb_root_path + ->write("require(\$this->getEnvironment()->get_phpbb_root_path() . \$location);\n") + ->outdent() + ->write("} else {\n") + ->indent() + // Local path (behaves like INCLUDE) + ->write("require(\$this->getEnvironment()->getLoader()->getCacheKey(\$location));\n") + ->outdent() + ->write("}\n") + ; + + if ($this->getAttribute('ignore_missing')) { + $compiler + ->outdent() + ->write("} catch (\Twig_Error_Loader \$e) {\n") + ->indent() + ->write("// ignore missing template\n") + ->outdent() + ->write("}\n\n") + ; + } + } +} diff --git a/sources/phpBB/phpbb/template/twig/node/php.php b/sources/phpBB/phpbb/template/twig/node/php.php new file mode 100644 index 0000000..3a24513 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/node/php.php @@ -0,0 +1,53 @@ + +* @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\node; + + +class php extends \Twig_Node +{ + /** @var \Twig_Environment */ + protected $environment; + + public function __construct(\Twig_Node_Text $text, \phpbb\template\twig\environment $environment, $lineno, $tag = null) + { + $this->environment = $environment; + + parent::__construct(array('text' => $text), array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param \Twig_Compiler A Twig_Compiler instance + */ + public function compile(\Twig_Compiler $compiler) + { + $compiler->addDebugInfo($this); + + $config = $this->environment->get_phpbb_config(); + + if (!$config['tpl_allow_php']) + { + $compiler + ->write("// PHP Disabled\n") + ; + + return; + } + + $compiler + ->raw($this->getNode('text')->getAttribute('data')) + ; + } +} diff --git a/sources/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/sources/phpBB/phpbb/template/twig/tokenparser/defineparser.php new file mode 100644 index 0000000..cfee84a --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/tokenparser/defineparser.php @@ -0,0 +1,74 @@ + +* @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher +* @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\tokenparser; + + +class defineparser extends \Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param \Twig_Token $token A Twig_Token instance + * + * @return \Twig_NodeInterface A Twig_NodeInterface instance + * @throws \Twig_Error_Syntax + * @throws \phpbb\template\twig\node\definenode + */ + public function parse(\Twig_Token $token) + { + $lineno = $token->getLine(); + $stream = $this->parser->getStream(); + $name = $this->parser->getExpressionParser()->parseExpression(); + + $capture = false; + if ($stream->test(\Twig_Token::OPERATOR_TYPE, '=')) { + $stream->next(); + $value = $this->parser->getExpressionParser()->parseExpression(); + + if ($value instanceof \Twig_Node_Expression_Name) + { + // This would happen if someone improperly formed their DEFINE syntax + // e.g. + throw new \Twig_Error_Syntax('Invalid DEFINE', $token->getLine(), $this->parser->getFilename()); + } + + $stream->expect(\Twig_Token::BLOCK_END_TYPE); + } else { + $capture = true; + + $stream->expect(\Twig_Token::BLOCK_END_TYPE); + + $value = $this->parser->subparse(array($this, 'decideBlockEnd'), true); + $stream->expect(\Twig_Token::BLOCK_END_TYPE); + } + + return new \phpbb\template\twig\node\definenode($capture, $name, $value, $lineno, $this->getTag()); + } + + public function decideBlockEnd(\Twig_Token $token) + { + return $token->test('ENDDEFINE'); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'DEFINE'; + } +} diff --git a/sources/phpBB/phpbb/template/twig/tokenparser/event.php b/sources/phpBB/phpbb/template/twig/tokenparser/event.php new file mode 100644 index 0000000..4c7c8e0 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/tokenparser/event.php @@ -0,0 +1,45 @@ + +* @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\tokenparser; + + +class event extends \Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param \Twig_Token $token A Twig_Token instance + * + * @return \Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(\Twig_Token $token) + { + $expr = $this->parser->getExpressionParser()->parseExpression(); + + $stream = $this->parser->getStream(); + $stream->expect(\Twig_Token::BLOCK_END_TYPE); + + return new \phpbb\template\twig\node\event($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag()); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'EVENT'; + } +} diff --git a/sources/phpBB/phpbb/template/twig/tokenparser/includecss.php b/sources/phpBB/phpbb/template/twig/tokenparser/includecss.php new file mode 100644 index 0000000..1f30811 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/tokenparser/includecss.php @@ -0,0 +1,44 @@ + +* @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\tokenparser; + +class includecss extends \Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param \Twig_Token $token A Twig_Token instance + * + * @return \Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(\Twig_Token $token) + { + $expr = $this->parser->getExpressionParser()->parseExpression(); + + $stream = $this->parser->getStream(); + $stream->expect(\Twig_Token::BLOCK_END_TYPE); + + return new \phpbb\template\twig\node\includecss($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag()); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'INCLUDECSS'; + } +} diff --git a/sources/phpBB/phpbb/template/twig/tokenparser/includejs.php b/sources/phpBB/phpbb/template/twig/tokenparser/includejs.php new file mode 100644 index 0000000..4156048 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/tokenparser/includejs.php @@ -0,0 +1,45 @@ + +* @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\tokenparser; + + +class includejs extends \Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param \Twig_Token $token A Twig_Token instance + * + * @return \Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(\Twig_Token $token) + { + $expr = $this->parser->getExpressionParser()->parseExpression(); + + $stream = $this->parser->getStream(); + $stream->expect(\Twig_Token::BLOCK_END_TYPE); + + return new \phpbb\template\twig\node\includejs($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag()); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'INCLUDEJS'; + } +} diff --git a/sources/phpBB/phpbb/template/twig/tokenparser/includeparser.php b/sources/phpBB/phpbb/template/twig/tokenparser/includeparser.php new file mode 100644 index 0000000..6ee78e5 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/tokenparser/includeparser.php @@ -0,0 +1,45 @@ + +* @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher +* @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\tokenparser; + + +class includeparser extends \Twig_TokenParser_Include +{ + /** + * Parses a token and returns a node. + * + * @param \Twig_Token $token A Twig_Token instance + * + * @return \Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(\Twig_Token $token) + { + $expr = $this->parser->getExpressionParser()->parseExpression(); + + list($variables, $only, $ignoreMissing) = $this->parseArguments(); + + return new \phpbb\template\twig\node\includenode($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'INCLUDE'; + } +} diff --git a/sources/phpBB/phpbb/template/twig/tokenparser/includephp.php b/sources/phpBB/phpbb/template/twig/tokenparser/includephp.php new file mode 100644 index 0000000..38196c5 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/tokenparser/includephp.php @@ -0,0 +1,55 @@ + +* @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher +* @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\tokenparser; + + +class includephp extends \Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param \Twig_Token $token A Twig_Token instance + * + * @return \Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(\Twig_Token $token) + { + $expr = $this->parser->getExpressionParser()->parseExpression(); + + $stream = $this->parser->getStream(); + + $ignoreMissing = false; + if ($stream->test(\Twig_Token::NAME_TYPE, 'ignore')) { + $stream->next(); + $stream->expect(\Twig_Token::NAME_TYPE, 'missing'); + + $ignoreMissing = true; + } + + $stream->expect(\Twig_Token::BLOCK_END_TYPE); + + return new \phpbb\template\twig\node\includephp($expr, $this->parser->getEnvironment(), $token->getLine(), $ignoreMissing, $this->getTag()); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'INCLUDEPHP'; + } +} diff --git a/sources/phpBB/phpbb/template/twig/tokenparser/php.php b/sources/phpBB/phpbb/template/twig/tokenparser/php.php new file mode 100644 index 0000000..557a70c --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/tokenparser/php.php @@ -0,0 +1,53 @@ + +* @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\tokenparser; + + +class php extends \Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param \Twig_Token $token A Twig_Token instance + * + * @return \Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(\Twig_Token $token) + { + $stream = $this->parser->getStream(); + + $stream->expect(\Twig_Token::BLOCK_END_TYPE); + + $body = $this->parser->subparse(array($this, 'decideEnd'), true); + + $stream->expect(\Twig_Token::BLOCK_END_TYPE); + + return new \phpbb\template\twig\node\php($body, $this->parser->getEnvironment(), $token->getLine(), $this->getTag()); + } + + public function decideEnd(\Twig_Token $token) + { + return $token->test('ENDPHP'); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'PHP'; + } +} diff --git a/sources/phpBB/phpbb/template/twig/twig.php b/sources/phpBB/phpbb/template/twig/twig.php new file mode 100644 index 0000000..bd754d9 --- /dev/null +++ b/sources/phpBB/phpbb/template/twig/twig.php @@ -0,0 +1,389 @@ + +* @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; + +/** +* Twig Template class. +*/ +class twig extends \phpbb\template\base +{ + /** + * Path of the cache directory for the template + * + * Cannot be changed during runtime. + * + * @var string + */ + private $cachepath = ''; + + /** + * phpBB path helper + * @var \phpbb\path_helper + */ + protected $path_helper; + + /** + * phpBB root path + * @var string + */ + protected $phpbb_root_path; + + /** + * PHP file extension + * @var string + */ + protected $php_ext; + + /** + * phpBB config instance + * @var \phpbb\config\config + */ + protected $config; + + /** + * Current user + * @var \phpbb\user + */ + protected $user; + + /** + * Extension manager. + * + * @var \phpbb\extension\manager + */ + protected $extension_manager; + + /** + * Twig Environment + * + * @var \Twig_Environment + */ + protected $twig; + + /** + * Constructor. + * + * @param \phpbb\path_helper $path_helper + * @param \phpbb\config\config $config + * @param \phpbb\user $user + * @param \phpbb\template\context $context template context + * @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) + { + $this->path_helper = $path_helper; + $this->phpbb_root_path = $path_helper->get_phpbb_root_path(); + $this->php_ext = $path_helper->get_php_ext(); + $this->config = $config; + $this->user = $user; + $this->context = $context; + $this->extension_manager = $extension_manager; + + $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')) + { + $this->twig->addExtension(new \Twig_Extension_Debug()); + } + + $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/')) + { + $this->twig->getLoader()->setPaths($this->phpbb_root_path . $this->path_helper->get_adm_relative_path() . 'style/', 'admin'); + } + } + + /** + * Clear the cache + * + * @return \phpbb\template\template + */ + public function clear_cache() + { + if (is_dir($this->cachepath)) + { + $this->twig->clearCacheFiles(); + } + + return $this; + } + + /** + * Get the style tree of the style preferred by the current user + * + * @return array Style tree, most specific first + */ + public function get_user_style() + { + $style_list = array( + $this->user->style['style_path'], + ); + + if ($this->user->style['style_parent_id']) + { + $style_list = array_merge($style_list, array_reverse(explode('/', $this->user->style['style_parent_tree']))); + } + + return $style_list; + } + + /** + * Set style location based on (current) user's chosen style. + * + * @param array $style_directories The directories to add style paths for + * E.g. array('ext/foo/bar/styles', 'styles') + * Default: array('styles') (phpBB's style directory) + * @return \phpbb\template\template $this + */ + public function set_style($style_directories = array('styles')) + { + if ($style_directories !== array('styles') && $this->twig->getLoader()->getPaths('core') === array()) + { + // We should set up the core styles path since not already setup + $this->set_style(); + } + + $names = $this->get_user_style(); + // Add 'all' folder to $names array + // It allows extensions to load a template file from 'all' folder, + // if a style doesn't include it. + $names[] = 'all'; + + $paths = array(); + foreach ($style_directories as $directory) + { + foreach ($names as $name) + { + $path = $this->phpbb_root_path . trim($directory, '/') . "/{$name}/"; + $template_path = $path . 'template/'; + $theme_path = $path . 'theme/'; + + $is_valid_dir = false; + if (is_dir($template_path)) + { + $is_valid_dir = true; + $paths[] = $template_path; + } + if (is_dir($theme_path)) + { + $is_valid_dir = true; + $paths[] = $theme_path; + } + + if ($is_valid_dir) + { + // Add the base style directory as a safe directory + $this->twig->getLoader()->addSafeDirectory($path); + } + } + } + + // If we're setting up the main phpBB styles directory and the core + // namespace isn't setup yet, we will set it up now + if ($style_directories === array('styles') && $this->twig->getLoader()->getPaths('core') === array()) + { + // Set up the core style paths namespace + $this->twig->getLoader()->setPaths($paths, 'core'); + } + + $this->set_custom_style($names, $paths); + + return $this; + } + + /** + * Set custom style location (able to use directory outside of phpBB). + * + * Note: Templates are still compiled to phpBB's cache directory. + * + * @param string|array $names Array of names (or detailed names) or string of name of template(s) in inheritance tree order, used by extensions. + * E.g. array( + * 'name' => 'adm', + * 'ext_path' => 'adm/style/', + * ) + * @param string|array of string $paths Array of style paths, relative to current root directory + * @return \phpbb\template\template $this + */ + public function set_custom_style($names, $paths) + { + $paths = (is_string($paths)) ? array($paths) : $paths; + $names = (is_string($names)) ? array($names) : $names; + + // Set as __main__ namespace + $this->twig->getLoader()->setPaths($paths); + + // Add all namespaces for all extensions + if ($this->extension_manager instanceof \phpbb\extension\manager) + { + $names[] = 'all'; + + foreach ($this->extension_manager->all_enabled() as $ext_namespace => $ext_path) + { + // namespaces cannot contain / + $namespace = str_replace('/', '_', $ext_namespace); + $paths = array(); + + foreach ($names as $template_dir) + { + if (is_array($template_dir)) + { + if (isset($template_dir['ext_path'])) + { + $ext_style_template_path = $ext_path . $template_dir['ext_path']; + $ext_style_path = dirname($ext_style_template_path); + $ext_style_theme_path = $ext_style_path . 'theme/'; + } + else + { + $ext_style_path = $ext_path . 'styles/' . $template_dir['name'] . '/'; + $ext_style_template_path = $ext_style_path . 'template/'; + $ext_style_theme_path = $ext_style_path . 'theme/'; + } + } + else + { + $ext_style_path = $ext_path . 'styles/' . $template_dir . '/'; + $ext_style_template_path = $ext_style_path . 'template/'; + $ext_style_theme_path = $ext_style_path . 'theme/'; + } + + $is_valid_dir = false; + if (is_dir($ext_style_template_path)) + { + $is_valid_dir = true; + $paths[] = $ext_style_template_path; + } + if (is_dir($ext_style_theme_path)) + { + $is_valid_dir = true; + $paths[] = $ext_style_theme_path; + } + + if ($is_valid_dir) + { + // Add the base style directory as a safe directory + $this->twig->getLoader()->addSafeDirectory($ext_style_path); + } + } + + $this->twig->getLoader()->setPaths($paths, $namespace); + } + } + + return $this; + } + + /** + * Display a template for provided handle. + * + * The template will be loaded and compiled, if necessary, first. + * + * This function calls hooks. + * + * @param string $handle Handle to display + * @return \phpbb\template\template $this + */ + public function display($handle) + { + $result = $this->call_hook($handle, __FUNCTION__); + if ($result !== false) + { + return $result[0]; + } + + $this->twig->display($this->get_filename_from_handle($handle), $this->get_template_vars()); + + return $this; + } + + /** + * Display the handle and assign the output to a template variable + * or return the compiled result. + * + * @param string $handle Handle to operate on + * @param string $template_var Template variable to assign compiled handle to + * @param bool $return_content If true return compiled handle, otherwise assign to $template_var + * @return \phpbb\template\template|string if $return_content is true return string of the compiled handle, otherwise return $this + */ + public function assign_display($handle, $template_var = '', $return_content = true) + { + if ($return_content) + { + return $this->twig->render($this->get_filename_from_handle($handle), $this->get_template_vars()); + } + + $this->assign_var($template_var, $this->twig->render($this->get_filename_from_handle($handle, $this->get_template_vars()))); + + return $this; + } + + /** + * Get template vars in a format Twig will use (from the context) + * + * @return array + */ + protected function get_template_vars() + { + $context_vars = $this->context->get_data_ref(); + + $vars = array_merge( + $context_vars['.'][0], // To get normal vars + array( + 'definition' => new \phpbb\template\twig\definition(), + 'user' => $this->user, + 'loops' => $context_vars, // To get loops + ) + ); + + // cleanup + unset($vars['loops']['.']); + + return $vars; + } + + /** + * {@inheritdoc} + */ + public function get_source_file_for_handle($handle) + { + return $this->twig->getLoader()->getCacheKey($this->get_filename_from_handle($handle)); + } +} diff --git a/sources/phpBB/phpbb/tree/nestedset.php b/sources/phpBB/phpbb/tree/nestedset.php new file mode 100644 index 0000000..57d1096 --- /dev/null +++ b/sources/phpBB/phpbb/tree/nestedset.php @@ -0,0 +1,875 @@ + +* @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\tree; + +abstract class nestedset implements \phpbb\tree\tree_interface +{ + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + /** @var \phpbb\lock\db */ + protected $lock; + + /** @var string */ + protected $table_name; + + /** + * Prefix for the language keys returned by exceptions + * @var string + */ + protected $message_prefix = ''; + + /** + * Column names in the table + * @var string + */ + protected $column_item_id = 'item_id'; + protected $column_left_id = 'left_id'; + protected $column_right_id = 'right_id'; + protected $column_parent_id = 'parent_id'; + protected $column_item_parents = 'item_parents'; + + /** + * Additional SQL restrictions + * Allows to have multiple nested sets in one table + * @var string + */ + protected $sql_where = ''; + + /** + * List of item properties to be cached in the item_parents column + * @var array + */ + protected $item_basic_data = array('*'); + + /** + * Construct + * + * @param \phpbb\db\driver\driver_interface $db Database connection + * @param \phpbb\lock\db $lock Lock class used to lock the table when moving forums around + * @param string $table_name Table name + * @param string $message_prefix Prefix for the messages thrown by exceptions + * @param string $sql_where Additional SQL restrictions for the queries + * @param array $item_basic_data Array with basic item data that is stored in item_parents + * @param array $columns Array with column names to overwrite + */ + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\lock\db $lock, $table_name, $message_prefix = '', $sql_where = '', $item_basic_data = array(), $columns = array()) + { + $this->db = $db; + $this->lock = $lock; + + $this->table_name = $table_name; + $this->message_prefix = $message_prefix; + $this->sql_where = $sql_where; + $this->item_basic_data = (!empty($item_basic_data)) ? $item_basic_data : array('*'); + + if (!empty($columns)) + { + foreach ($columns as $column => $name) + { + $column_name = 'column_' . $column; + $this->$column_name = $name; + } + } + } + + /** + * Returns additional sql where restrictions + * + * @param string $operator SQL operator that needs to be prepended to sql_where, + * if it is not empty. + * @param string $column_prefix Prefix that needs to be prepended to column names + * @return string Returns additional where statements to narrow down the tree, + * prefixed with operator and prepended column_prefix to column names + */ + public function get_sql_where($operator = 'AND', $column_prefix = '') + { + return (!$this->sql_where) ? '' : $operator . ' ' . sprintf($this->sql_where, $column_prefix); + } + + /** + * Acquires a lock on the item table + * + * @return bool True if the lock was acquired, false if it has been acquired previously + * + * @throws \RuntimeException If the lock could not be acquired + */ + protected function acquire_lock() + { + if ($this->lock->owns_lock()) + { + return false; + } + + if (!$this->lock->acquire()) + { + throw new \RuntimeException($this->message_prefix . 'LOCK_FAILED_ACQUIRE'); + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function insert(array $additional_data) + { + $item_data = $this->reset_nestedset_values($additional_data); + + $sql = 'INSERT INTO ' . $this->table_name . ' ' . $this->db->sql_build_array('INSERT', $item_data); + $this->db->sql_query($sql); + + $item_data[$this->column_item_id] = (int) $this->db->sql_nextid(); + + return array_merge($item_data, $this->add_item_to_nestedset($item_data[$this->column_item_id])); + } + + /** + * Add an item which already has a database row at the end of the tree + * + * @param int $item_id The item to be added + * @return array Array with updated data, if the item was added successfully + * Empty array otherwise + */ + protected function add_item_to_nestedset($item_id) + { + $sql = 'SELECT MAX(' . $this->column_right_id . ') AS ' . $this->column_right_id . ' + FROM ' . $this->table_name . ' + ' . $this->get_sql_where('WHERE'); + $result = $this->db->sql_query($sql); + $current_max_right_id = (int) $this->db->sql_fetchfield($this->column_right_id); + $this->db->sql_freeresult($result); + + $update_item_data = array( + $this->column_parent_id => 0, + $this->column_left_id => $current_max_right_id + 1, + $this->column_right_id => $current_max_right_id + 2, + $this->column_item_parents => '', + ); + + $sql = 'UPDATE ' . $this->table_name . ' + SET ' . $this->db->sql_build_array('UPDATE', $update_item_data) . ' + WHERE ' . $this->column_item_id . ' = ' . (int) $item_id . ' + AND ' . $this->column_parent_id . ' = 0 + AND ' . $this->column_left_id . ' = 0 + AND ' . $this->column_right_id . ' = 0'; + $this->db->sql_query($sql); + + return ($this->db->sql_affectedrows() == 1) ? $update_item_data : array(); + } + + /** + * Remove an item from the tree without deleting it from the database + * + * Also removes all subitems from the tree without deleting them from the database either + * + * @param int $item_id The item to be deleted + * @return array Item ids that have been removed + * @throws \OutOfBoundsException + */ + protected function remove_item_from_nestedset($item_id) + { + $item_id = (int) $item_id; + if (!$item_id) + { + throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM'); + } + + $items = $this->get_subtree_data($item_id); + $item_ids = array_keys($items); + + if (empty($items) || !isset($items[$item_id])) + { + throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM'); + } + + $this->remove_subset($item_ids, $items[$item_id]); + + return $item_ids; + } + + /** + * {@inheritdoc} + */ + public function delete($item_id) + { + $removed_items = $this->remove_item_from_nestedset($item_id); + + $sql = 'DELETE FROM ' . $this->table_name . ' + WHERE ' . $this->db->sql_in_set($this->column_item_id, $removed_items) . ' + ' . $this->get_sql_where('AND'); + $this->db->sql_query($sql); + + return $removed_items; + } + + /** + * {@inheritdoc} + */ + public function move($item_id, $delta) + { + if ($delta == 0) + { + return false; + } + + $this->acquire_lock(); + + $action = ($delta > 0) ? 'move_up' : 'move_down'; + $delta = abs($delta); + + // Keep $this->get_sql_where() here, to ensure we are in the right tree. + $sql = 'SELECT * + FROM ' . $this->table_name . ' + WHERE ' . $this->column_item_id . ' = ' . (int) $item_id . ' + ' . $this->get_sql_where(); + $result = $this->db->sql_query_limit($sql, $delta); + $item = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (!$item) + { + $this->lock->release(); + throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM'); + } + + /** + * Fetch all the siblings between the item's current spot + * and where we want to move it to. If there are less than $delta + * siblings between the current spot and the target then the + * item will move as far as possible + */ + $sql = "SELECT {$this->column_item_id}, {$this->column_parent_id}, {$this->column_left_id}, {$this->column_right_id}, {$this->column_item_parents} + FROM " . $this->table_name . ' + WHERE ' . $this->column_parent_id . ' = ' . (int) $item[$this->column_parent_id] . ' + ' . $this->get_sql_where() . ' + AND '; + + if ($action == 'move_up') + { + $sql .= $this->column_right_id . ' < ' . (int) $item[$this->column_right_id] . ' ORDER BY ' . $this->column_right_id . ' DESC'; + } + else + { + $sql .= $this->column_left_id . ' > ' . (int) $item[$this->column_left_id] . ' ORDER BY ' . $this->column_left_id . ' ASC'; + } + + $result = $this->db->sql_query_limit($sql, $delta); + + $target = false; + while ($row = $this->db->sql_fetchrow($result)) + { + $target = $row; + } + $this->db->sql_freeresult($result); + + if (!$target) + { + $this->lock->release(); + // The item is already on top or bottom + return false; + } + + /** + * $left_id and $right_id define the scope of the items that are affected by the move. + * $diff_up and $diff_down are the values to substract or add to each item'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 items that are moving + * up. Other items in the scope of ($left_id, $right_id) are considered to move down. + */ + if ($action == 'move_up') + { + $left_id = (int) $target[$this->column_left_id]; + $right_id = (int) $item[$this->column_right_id]; + + $diff_up = (int) $item[$this->column_left_id] - (int) $target[$this->column_left_id]; + $diff_down = (int) $item[$this->column_right_id] + 1 - (int) $item[$this->column_left_id]; + + $move_up_left = (int) $item[$this->column_left_id]; + $move_up_right = (int) $item[$this->column_right_id]; + } + else + { + $left_id = (int) $item[$this->column_left_id]; + $right_id = (int) $target[$this->column_right_id]; + + $diff_up = (int) $item[$this->column_right_id] + 1 - (int) $item[$this->column_left_id]; + $diff_down = (int) $target[$this->column_right_id] - (int) $item[$this->column_right_id]; + + $move_up_left = (int) $item[$this->column_right_id] + 1; + $move_up_right = (int) $target[$this->column_right_id]; + } + + // Now do the dirty job + $sql = 'UPDATE ' . $this->table_name . ' + SET ' . $this->column_left_id . ' = ' . $this->column_left_id . ' + CASE + WHEN ' . $this->column_left_id . " BETWEEN {$move_up_left} AND {$move_up_right} THEN -{$diff_up} + ELSE {$diff_down} + END, + " . $this->column_right_id . ' = ' . $this->column_right_id . ' + CASE + WHEN ' . $this->column_right_id . " BETWEEN {$move_up_left} AND {$move_up_right} THEN -{$diff_up} + ELSE {$diff_down} + END + WHERE + " . $this->column_left_id . " BETWEEN {$left_id} AND {$right_id} + AND " . $this->column_right_id . " BETWEEN {$left_id} AND {$right_id} + " . $this->get_sql_where(); + $this->db->sql_query($sql); + + $this->lock->release(); + + return true; + } + + /** + * {@inheritdoc} + */ + public function move_down($item_id) + { + return $this->move($item_id, -1); + } + + /** + * {@inheritdoc} + */ + public function move_up($item_id) + { + return $this->move($item_id, 1); + } + + /** + * {@inheritdoc} + */ + public function move_children($current_parent_id, $new_parent_id) + { + $current_parent_id = (int) $current_parent_id; + $new_parent_id = (int) $new_parent_id; + + if ($current_parent_id == $new_parent_id) + { + return false; + } + + if (!$current_parent_id) + { + throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM'); + } + + $this->acquire_lock(); + + $item_data = $this->get_subtree_data($current_parent_id); + if (!isset($item_data[$current_parent_id])) + { + $this->lock->release(); + throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM'); + } + + $current_parent = $item_data[$current_parent_id]; + unset($item_data[$current_parent_id]); + $move_items = array_keys($item_data); + + if (($current_parent[$this->column_right_id] - $current_parent[$this->column_left_id]) <= 1) + { + $this->lock->release(); + return false; + } + + if (in_array($new_parent_id, $move_items)) + { + $this->lock->release(); + throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT'); + } + + $diff = sizeof($move_items) * 2; + $sql_exclude_moved_items = $this->db->sql_in_set($this->column_item_id, $move_items, true); + + $this->db->sql_transaction('begin'); + + $this->remove_subset($move_items, $current_parent, false, true); + + if ($new_parent_id) + { + // Retrieve new-parent again, it may have been changed... + $sql = 'SELECT * + FROM ' . $this->table_name . ' + WHERE ' . $this->column_item_id . ' = ' . $new_parent_id; + $result = $this->db->sql_query($sql); + $new_parent = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (!$new_parent) + { + $this->db->sql_transaction('rollback'); + $this->lock->release(); + throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT'); + } + + $new_right_id = $this->prepare_adding_subset($move_items, $new_parent, true); + + if ($new_right_id > $current_parent[$this->column_right_id]) + { + $diff = ' + ' . ($new_right_id - $current_parent[$this->column_right_id]); + } + else + { + $diff = ' - ' . abs($new_right_id - $current_parent[$this->column_right_id]); + } + } + else + { + $sql = 'SELECT MAX(' . $this->column_right_id . ') AS ' . $this->column_right_id . ' + FROM ' . $this->table_name . ' + WHERE ' . $sql_exclude_moved_items . ' + ' . $this->get_sql_where('AND'); + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + $diff = ' + ' . ($row[$this->column_right_id] - $current_parent[$this->column_left_id]); + } + + $sql = 'UPDATE ' . $this->table_name . ' + SET ' . $this->column_left_id . ' = ' . $this->column_left_id . $diff . ', + ' . $this->column_right_id . ' = ' . $this->column_right_id . $diff . ', + ' . $this->column_parent_id . ' = ' . $this->db->sql_case($this->column_parent_id . ' = ' . $current_parent_id, $new_parent_id, $this->column_parent_id) . ', + ' . $this->column_item_parents . " = '' + WHERE " . $this->db->sql_in_set($this->column_item_id, $move_items) . ' + ' . $this->get_sql_where('AND'); + $this->db->sql_query($sql); + + $this->db->sql_transaction('commit'); + $this->lock->release(); + + return true; + } + + /** + * {@inheritdoc} + */ + public function change_parent($item_id, $new_parent_id) + { + $item_id = (int) $item_id; + $new_parent_id = (int) $new_parent_id; + + if ($item_id == $new_parent_id) + { + return false; + } + + if (!$item_id) + { + throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM'); + } + + $this->acquire_lock(); + + $item_data = $this->get_subtree_data($item_id); + if (!isset($item_data[$item_id])) + { + $this->lock->release(); + throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM'); + } + + $item = $item_data[$item_id]; + $move_items = array_keys($item_data); + + if (in_array($new_parent_id, $move_items)) + { + $this->lock->release(); + throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT'); + } + + $diff = sizeof($move_items) * 2; + $sql_exclude_moved_items = $this->db->sql_in_set($this->column_item_id, $move_items, true); + + $this->db->sql_transaction('begin'); + + $this->remove_subset($move_items, $item, false, true); + + if ($new_parent_id) + { + // Retrieve new-parent again, it may have been changed... + $sql = 'SELECT * + FROM ' . $this->table_name . ' + WHERE ' . $this->column_item_id . ' = ' . $new_parent_id; + $result = $this->db->sql_query($sql); + $new_parent = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (!$new_parent) + { + $this->db->sql_transaction('rollback'); + $this->lock->release(); + throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT'); + } + + $new_right_id = $this->prepare_adding_subset($move_items, $new_parent, true); + + if ($new_right_id > (int) $item[$this->column_right_id]) + { + $diff = ' + ' . ($new_right_id - (int) $item[$this->column_right_id] - 1); + } + else + { + $diff = ' - ' . abs($new_right_id - (int) $item[$this->column_right_id] - 1); + } + } + else + { + $sql = 'SELECT MAX(' . $this->column_right_id . ') AS ' . $this->column_right_id . ' + FROM ' . $this->table_name . ' + WHERE ' . $sql_exclude_moved_items . ' + ' . $this->get_sql_where('AND'); + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + $diff = ' + ' . ($row[$this->column_right_id] - (int) $item[$this->column_left_id] + 1); + } + + $sql = 'UPDATE ' . $this->table_name . ' + SET ' . $this->column_left_id . ' = ' . $this->column_left_id . $diff . ', + ' . $this->column_right_id . ' = ' . $this->column_right_id . $diff . ', + ' . $this->column_parent_id . ' = ' . $this->db->sql_case($this->column_item_id . ' = ' . $item_id, $new_parent_id, $this->column_parent_id) . ', + ' . $this->column_item_parents . " = '' + WHERE " . $this->db->sql_in_set($this->column_item_id, $move_items) . ' + ' . $this->get_sql_where('AND'); + $this->db->sql_query($sql); + + $this->db->sql_transaction('commit'); + $this->lock->release(); + + return true; + } + + /** + * {@inheritdoc} + */ + public function get_path_and_subtree_data($item_id, $order_asc = true, $include_item = true) + { + $condition = 'i2.' . $this->column_left_id . ' BETWEEN i1.' . $this->column_left_id . ' AND i1.' . $this->column_right_id . ' + OR i1.' . $this->column_left_id . ' BETWEEN i2.' . $this->column_left_id . ' AND i2.' . $this->column_right_id; + + return $this->get_set_of_nodes_data($item_id, $condition, $order_asc, $include_item); + } + + /** + * {@inheritdoc} + */ + public function get_path_data($item_id, $order_asc = true, $include_item = true) + { + $condition = 'i1.' . $this->column_left_id . ' BETWEEN i2.' . $this->column_left_id . ' AND i2.' . $this->column_right_id . ''; + + return $this->get_set_of_nodes_data($item_id, $condition, $order_asc, $include_item); + } + + /** + * {@inheritdoc} + */ + public function get_subtree_data($item_id, $order_asc = true, $include_item = true) + { + $condition = 'i2.' . $this->column_left_id . ' BETWEEN i1.' . $this->column_left_id . ' AND i1.' . $this->column_right_id . ''; + + return $this->get_set_of_nodes_data($item_id, $condition, $order_asc, $include_item); + } + + /** + * Get items that are related to the given item by the condition + * + * @param int $item_id Id of the item to retrieve the node set from + * @param string $condition Query string restricting the item list + * @param bool $order_asc Order the items ascending by their left_id + * @param bool $include_item Should the item matching the given item id be included in the list as well + * @return array Array of items (containing all columns from the item table) + * ID => Item data + */ + protected function get_set_of_nodes_data($item_id, $condition, $order_asc = true, $include_item = true) + { + $rows = array(); + + $sql = 'SELECT i2.* + FROM ' . $this->table_name . ' i1 + LEFT JOIN ' . $this->table_name . " i2 + ON (($condition) " . $this->get_sql_where('AND', 'i2.') . ') + WHERE i1.' . $this->column_item_id . ' = ' . (int) $item_id . ' + ' . $this->get_sql_where('AND', 'i1.') . ' + ORDER BY i2.' . $this->column_left_id . ' ' . ($order_asc ? 'ASC' : 'DESC'); + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + if (!$include_item && $item_id == $row[$this->column_item_id]) + { + continue; + } + + $rows[(int) $row[$this->column_item_id]] = $row; + } + $this->db->sql_freeresult($result); + + return $rows; + } + + /** + * Get basic data of all parent items + * + * Basic data is defined in the $item_basic_data property. + * Data is cached in the item_parents column in the item table + * + * @param array $item The item to get the path from + * @return array Array of items (containing basic columns from the item table) + * ID => Item data + */ + public function get_path_basic_data(array $item) + { + $parents = array(); + if ($item[$this->column_parent_id]) + { + if (!$item[$this->column_item_parents]) + { + $sql = 'SELECT ' . implode(', ', $this->item_basic_data) . ' + FROM ' . $this->table_name . ' + WHERE ' . $this->column_left_id . ' < ' . (int) $item[$this->column_left_id] . ' + AND ' . $this->column_right_id . ' > ' . (int) $item[$this->column_right_id] . ' + ' . $this->get_sql_where('AND') . ' + ORDER BY ' . $this->column_left_id . ' ASC'; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $parents[$row[$this->column_item_id]] = $row; + } + $this->db->sql_freeresult($result); + + $item_parents = serialize($parents); + + $sql = 'UPDATE ' . $this->table_name . ' + SET ' . $this->column_item_parents . " = '" . $this->db->sql_escape($item_parents) . "' + WHERE " . $this->column_parent_id . ' = ' . (int) $item[$this->column_parent_id]; + $this->db->sql_query($sql); + } + else + { + $parents = unserialize($item[$this->column_item_parents]); + } + } + + return $parents; + } + + /** + * Get all items from the tree + * + * @param bool $order_asc Order the items ascending by their left_id + * @return array Array of items (containing all columns from the item table) + * ID => Item data + */ + public function get_all_tree_data($order_asc = true) + { + $rows = array(); + + $sql = 'SELECT * + FROM ' . $this->table_name . ' ' . + $this->get_sql_where('WHERE') . ' + ORDER BY ' . $this->column_left_id . ' ' . ($order_asc ? 'ASC' : 'DESC'); + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $rows[(int) $row[$this->column_item_id]] = $row; + } + $this->db->sql_freeresult($result); + + return $rows; + } + + /** + * Remove a subset from the nested set + * + * @param array $subset_items Subset of items to remove + * @param array $bounding_item Item containing the right bound of the subset + * @param bool $set_subset_zero Should the parent, left and right id of the items be set to 0, or kept unchanged? + * In case of removing an item from the tree, we should the values to 0 + * In case of moving an item, we shouldkeep the original values, in order to allow "+ diff" later + * @return null + */ + protected function remove_subset(array $subset_items, array $bounding_item, $set_subset_zero = true) + { + $acquired_new_lock = $this->acquire_lock(); + + $diff = sizeof($subset_items) * 2; + $sql_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items); + $sql_not_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items, true); + + $sql_is_parent = $this->column_left_id . ' <= ' . (int) $bounding_item[$this->column_right_id] . ' + AND ' . $this->column_right_id . ' >= ' . (int) $bounding_item[$this->column_right_id]; + + $sql_is_right = $this->column_left_id . ' > ' . (int) $bounding_item[$this->column_right_id]; + + $set_left_id = $this->db->sql_case($sql_is_right, $this->column_left_id . ' - ' . $diff, $this->column_left_id); + $set_right_id = $this->db->sql_case($sql_is_parent . ' OR ' . $sql_is_right, $this->column_right_id . ' - ' . $diff, $this->column_right_id); + + if ($set_subset_zero) + { + $set_left_id = $this->db->sql_case($sql_subset_items, 0, $set_left_id); + $set_right_id = $this->db->sql_case($sql_subset_items, 0, $set_right_id); + } + + $sql = 'UPDATE ' . $this->table_name . ' + SET ' . (($set_subset_zero) ? $this->column_parent_id . ' = ' . $this->db->sql_case($sql_subset_items, 0, $this->column_parent_id) . ',' : '') . ' + ' . $this->column_left_id . ' = ' . $set_left_id . ', + ' . $this->column_right_id . ' = ' . $set_right_id . ' + ' . ((!$set_subset_zero) ? ' WHERE ' . $sql_not_subset_items . ' ' . $this->get_sql_where('AND') : $this->get_sql_where('WHERE')); + $this->db->sql_query($sql); + + if ($acquired_new_lock) + { + $this->lock->release(); + } + } + + /** + * Prepare adding a subset to the nested set + * + * @param array $subset_items Subset of items to add + * @param array $new_parent Item containing the right bound of the new parent + * @return int New right id of the parent item + */ + protected function prepare_adding_subset(array $subset_items, array $new_parent) + { + $diff = sizeof($subset_items) * 2; + $sql_not_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items, true); + + $set_left_id = $this->db->sql_case($this->column_left_id . ' > ' . (int) $new_parent[$this->column_right_id], $this->column_left_id . ' + ' . $diff, $this->column_left_id); + $set_right_id = $this->db->sql_case($this->column_right_id . ' >= ' . (int) $new_parent[$this->column_right_id], $this->column_right_id . ' + ' . $diff, $this->column_right_id); + + $sql = 'UPDATE ' . $this->table_name . ' + SET ' . $this->column_left_id . ' = ' . $set_left_id . ', + ' . $this->column_right_id . ' = ' . $set_right_id . ' + WHERE ' . $sql_not_subset_items . ' + ' . $this->get_sql_where('AND'); + $this->db->sql_query($sql); + + return $new_parent[$this->column_right_id] + $diff; + } + + /** + * Resets values required for the nested set system + * + * @param array $item Original item data + * @return array Original item data + nested set defaults + */ + protected function reset_nestedset_values(array $item) + { + $item_data = array_merge($item, array( + $this->column_parent_id => 0, + $this->column_left_id => 0, + $this->column_right_id => 0, + $this->column_item_parents => '', + )); + + unset($item_data[$this->column_item_id]); + + return $item_data; + } + + /** + * Regenerate left/right ids from parent/child relationship + * + * This method regenerates the left/right ids for the tree based on + * the parent/child relations. This function executes three queries per + * item, so it should only be called, when the set has one of the following + * problems: + * - The set has a duplicated value inside the left/right id chain + * - The set has a missing value inside the left/right id chain + * - The set has items that do not have a left/right id set + * + * When regenerating the items, the items are sorted by parent id and their + * current left id, so the current child/parent relationships are kept + * and running the function on a working set will not change the order. + * + * @param int $new_id First left_id to be used (should start with 1) + * @param int $parent_id parent_id of the current set (default = 0) + * @param bool $reset_ids Should we reset all left_id/right_id on the first call? + * @return int $new_id The next left_id/right_id that should be used + */ + public function regenerate_left_right_ids($new_id, $parent_id = 0, $reset_ids = false) + { + if ($acquired_new_lock = $this->acquire_lock()) + { + $this->db->sql_transaction('begin'); + + if (!$reset_ids) + { + $sql = 'UPDATE ' . $this->table_name . ' + SET ' . $this->column_item_parents . " = '' + " . $this->get_sql_where('WHERE'); + $this->db->sql_query($sql); + } + } + + if ($reset_ids) + { + $sql = 'UPDATE ' . $this->table_name . ' + SET ' . $this->db->sql_build_array('UPDATE', array( + $this->column_left_id => 0, + $this->column_right_id => 0, + $this->column_item_parents => '', + )) . ' + ' . $this->get_sql_where('WHERE'); + $this->db->sql_query($sql); + } + + $sql = 'SELECT * + FROM ' . $this->table_name . ' + WHERE ' . $this->column_parent_id . ' = ' . (int) $parent_id . ' + ' . $this->get_sql_where('AND') . ' + ORDER BY ' . $this->column_left_id . ', ' . $this->column_item_id . ' ASC'; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + // First we update the left_id for this module + if ($row[$this->column_left_id] != $new_id) + { + $sql = 'UPDATE ' . $this->table_name . ' + SET ' . $this->db->sql_build_array('UPDATE', array($this->column_left_id => $new_id)) . ' + WHERE ' . $this->column_item_id . ' = ' . (int) $row[$this->column_item_id]; + $this->db->sql_query($sql); + } + $new_id++; + + // Then we go through any children and update their left/right id's + $new_id = $this->regenerate_left_right_ids($new_id, $row[$this->column_item_id]); + + // Then we come back and update the right_id for this module + if ($row[$this->column_right_id] != $new_id) + { + $sql = 'UPDATE ' . $this->table_name . ' + SET ' . $this->db->sql_build_array('UPDATE', array($this->column_right_id => $new_id)) . ' + WHERE ' . $this->column_item_id . ' = ' . (int) $row[$this->column_item_id]; + $this->db->sql_query($sql); + } + $new_id++; + } + $this->db->sql_freeresult($result); + + if ($acquired_new_lock) + { + $this->db->sql_transaction('commit'); + $this->lock->release(); + } + + return $new_id; + } +} diff --git a/sources/phpBB/phpbb/tree/nestedset_forum.php b/sources/phpBB/phpbb/tree/nestedset_forum.php new file mode 100644 index 0000000..890fc80 --- /dev/null +++ b/sources/phpBB/phpbb/tree/nestedset_forum.php @@ -0,0 +1,44 @@ + +* @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\tree; + +class nestedset_forum extends \phpbb\tree\nestedset +{ + /** + * Construct + * + * @param \phpbb\db\driver\driver_interface $db Database connection + * @param \phpbb\lock\db $lock Lock class used to lock the table when moving forums around + * @param string $table_name Table name + */ + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\lock\db $lock, $table_name) + { + parent::__construct( + $db, + $lock, + $table_name, + 'FORUM_NESTEDSET_', + '', + array( + 'forum_id', + 'forum_name', + 'forum_type', + ), + array( + 'item_id' => 'forum_id', + 'item_parents' => 'forum_parents', + ) + ); + } +} diff --git a/sources/phpBB/phpbb/tree/tree_interface.php b/sources/phpBB/phpbb/tree/tree_interface.php new file mode 100644 index 0000000..5df01a8 --- /dev/null +++ b/sources/phpBB/phpbb/tree/tree_interface.php @@ -0,0 +1,120 @@ + +* @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\tree; + +interface tree_interface +{ + /** + * Inserts an item into the database table and into the tree. + * + * @param array $additional_data The item to be added + * @return array Array with item data as set in the database + */ + public function insert(array $additional_data); + + /** + * Delete an item from the tree and from the database table + * + * Also deletes the subtree from the tree and from the database table + * + * @param int $item_id The item to be deleted + * @return array Item ids that have been deleted + */ + public function delete($item_id); + + /** + * Move an item by a given delta + * + * An item is only moved up/down within the same parent. If the delta is + * larger then the number of children, the item is moved to the top/bottom + * of the list of children within this parent. + * + * @param int $item_id The item to be moved + * @param int $delta Number of steps to move this item, < 0 => down, > 0 => up + * @return bool True if the item was moved + */ + public function move($item_id, $delta); + + /** + * Move an item down by 1 + * + * @param int $item_id The item to be moved + * @return bool True if the item was moved + */ + public function move_down($item_id); + + /** + * Move an item up by 1 + * + * @param int $item_id The item to be moved + * @return bool True if the item was moved + */ + public function move_up($item_id); + + /** + * Moves all children of one item to another item + * + * If the new parent already has children, the new children are appended + * to the list. + * + * @param int $current_parent_id The current parent item + * @param int $new_parent_id The new parent item + * @return bool True if any items where moved + */ + public function move_children($current_parent_id, $new_parent_id); + + /** + * Change parent item + * + * Moves the item to the bottom of the new \parent's list of children + * + * @param int $item_id The item to be moved + * @param int $new_parent_id The new parent item + * @return bool True if the parent was set successfully + */ + public function change_parent($item_id, $new_parent_id); + + /** + * Get all items that are either ancestors or descendants of the item + * + * @param int $item_id Id of the item to retrieve the ancestors/descendants from + * @param bool $order_asc Order the items ascendingly (most outer ancestor first) + * @param bool $include_item Should the item matching the given item id be included in the list as well + * @return array Array of items (containing all columns from the item table) + * ID => Item data + */ + public function get_path_and_subtree_data($item_id, $order_asc, $include_item); + + /** + * Get all of the item's ancestors + * + * @param int $item_id Id of the item to retrieve the ancestors from + * @param bool $order_asc Order the items ascendingly (most outer ancestor first) + * @param bool $include_item Should the item matching the given item id be included in the list as well + * @return array Array of items (containing all columns from the item table) + * ID => Item data + */ + public function get_path_data($item_id, $order_asc, $include_item); + + /** + * Get all of the item's descendants + * + * @param int $item_id Id of the item to retrieve the descendants from + * @param bool $order_asc Order the items ascendingly + * @param bool $include_item Should the item matching the given item id be included in the list as well + * @return array Array of items (containing all columns from the item table) + * ID => Item data + */ + public function get_subtree_data($item_id, $order_asc, $include_item); +} diff --git a/sources/phpBB/phpbb/user.php b/sources/phpBB/phpbb/user.php new file mode 100644 index 0000000..882e9ce --- /dev/null +++ b/sources/phpBB/phpbb/user.php @@ -0,0 +1,928 @@ + +* @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; + +/** +* Base user class +* +* This is the overarching class which contains (through session extend) +* all methods utilised for user functionality during a session. +*/ +class user extends \phpbb\session +{ + var $lang = array(); + var $help = array(); + var $style = array(); + var $date_format; + + /** + * DateTimeZone object holding the timezone of the user + */ + public $timezone; + + /** + * @var string Class name of datetime object + */ + protected $datetime; + + var $lang_name = false; + var $lang_id = false; + var $lang_path; + var $img_lang; + var $img_array = array(); + + // 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 + */ + function __construct($datetime_class) + { + global $phpbb_root_path; + + $this->lang_path = $phpbb_root_path . 'language/'; + $this->datetime = $datetime_class; + } + + /** + * 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) + { + $this->lang_path = $lang_path; + + if (substr($this->lang_path, -1) != '/') + { + $this->lang_path .= '/'; + } + } + + /** + * Setup basic user-specific items (style, language, ...) + */ + function setup($lang_set = false, $style_id = false) + { + global $db, $request, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache; + global $phpbb_dispatcher; + + 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']); + $user_date_format = $this->data['user_dateformat']; + $user_timezone = $this->data['user_timezone']; + } + else + { + $lang_override = $request->variable('language', ''); + if ($lang_override) + { + $this->set_cookie('lang', $lang_override, 0, false); + } + else + { + $lang_override = $request->variable($config['cookie_name'] . '_lang', '', true, \phpbb\request\request_interface::COOKIE); + } + if ($lang_override) + { + $use_lang = basename($lang_override); + $user_lang_name = (file_exists($this->lang_path . $use_lang . "/common.$phpEx")) ? $use_lang : basename($config['default_lang']); + $this->data['user_lang'] = $user_lang_name; + } + else + { + $user_lang_name = basename($config['default_lang']); + } + $user_date_format = $config['default_dateformat']; + $user_timezone = $config['board_timezone']; + + /** + * If a guest user is surfing, we try to guess his/her language first by obtaining the browser language + * If re-enabled we need to make sure only those languages installed are checked + * Commented out so we do not loose the code. + + if ($request->header('Accept-Language')) + { + $accept_lang_ary = explode(',', $request->header('Accept-Language')); + + foreach ($accept_lang_ary as $accept_lang) + { + // Set correct format ... guess full xx_YY form + $accept_lang = substr($accept_lang, 0, 2) . '_' . strtoupper(substr($accept_lang, 3, 2)); + $accept_lang = basename($accept_lang); + + if (file_exists($this->lang_path . $accept_lang . "/common.$phpEx")) + { + $user_lang_name = $config['default_lang'] = $accept_lang; + break; + } + else + { + // No match on xx_YY so try xx + $accept_lang = substr($accept_lang, 0, 2); + $accept_lang = basename($accept_lang); + + if (file_exists($this->lang_path . $accept_lang . "/common.$phpEx")) + { + $user_lang_name = $config['default_lang'] = $accept_lang; + break; + } + } + } + } + */ + } + + $user_data = $this->data; + $lang_set_ext = array(); + + /** + * Event to load language files and modify user data on every page + * + * @event core.user_setup + * @var array user_data Array with user's data row + * @var string user_lang_name Basename of the user's langauge + * @var string user_date_format User's date/time format + * @var string user_timezone User's timezone, should be one of + * http://www.php.net/manual/en/timezones.php + * @var mixed lang_set String or array of language files + * @var array lang_set_ext Array containing entries of format + * array( + * 'ext_name' => (string) [extension name], + * 'lang_set' => (string|array) [language files], + * ) + * For performance reasons, only load translations + * that are absolutely needed globally using this + * event. Use local events otherwise. + * @var mixed style_id Style we are going to display + * @since 3.1.0-a1 + */ + $vars = array( + 'user_data', + 'user_lang_name', + 'user_date_format', + 'user_timezone', + 'lang_set', + 'lang_set_ext', + 'style_id', + ); + extract($phpbb_dispatcher->trigger_event('core.user_setup', compact($vars))); + + $this->data = $user_data; + $this->lang_name = $user_lang_name; + $this->date_format = $user_date_format; + + try + { + $this->timezone = new \DateTimeZone($user_timezone); + } + catch (\Exception $e) + { + // If the timezone the user has selected is invalid, we fall back to UTC. + $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); + + foreach ($lang_set_ext as $ext_lang_pair) + { + $this->add_lang_ext($ext_lang_pair['ext_name'], $ext_lang_pair['lang_set']); + } + unset($lang_set_ext); + + $style_request = $request->variable('style', 0); + if ($style_request && (!$config['override_user_style'] || $auth->acl_get('a_styles')) && !defined('ADMIN_START')) + { + global $SID, $_EXTRA_URL; + + $style_id = $style_request; + $SID .= '&style=' . $style_id; + $_EXTRA_URL = array('style=' . $style_id); + } + else + { + // Set up style + $style_id = ($style_id) ? $style_id : ((!$config['override_user_style']) ? $this->data['user_style'] : $config['default_style']); + } + + $sql = 'SELECT * + FROM ' . STYLES_TABLE . " s + WHERE s.style_id = $style_id"; + $result = $db->sql_query($sql, 3600); + $this->style = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + // Fallback to user's standard style + if (!$this->style && $style_id != $this->data['user_style']) + { + $style_id = $this->data['user_style']; + + $sql = 'SELECT * + FROM ' . STYLES_TABLE . " s + WHERE s.style_id = $style_id"; + $result = $db->sql_query($sql, 3600); + $this->style = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + // User has wrong style + if (!$this->style && $style_id == $this->data['user_style']) + { + $style_id = $this->data['user_style'] = $config['default_style']; + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_style = $style_id + WHERE user_id = {$this->data['user_id']}"; + $db->sql_query($sql); + + $sql = 'SELECT * + FROM ' . STYLES_TABLE . " s + WHERE s.style_id = $style_id"; + $result = $db->sql_query($sql, 3600); + $this->style = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + if (!$this->style) + { + trigger_error('NO_STYLE_DATA', E_USER_ERROR); + } + + // Now parse the cfg file and cache it + $parsed_items = $cache->obtain_cfg_items($this->style); + + $check_for = array( + 'pagination_sep' => (string) ', ' + ); + + foreach ($check_for as $key => $default_value) + { + $this->style[$key] = (isset($parsed_items[$key])) ? $parsed_items[$key] : $default_value; + settype($this->style[$key], gettype($default_value)); + + if (is_string($default_value)) + { + $this->style[$key] = htmlspecialchars($this->style[$key]); + } + } + + $template->set_style(); + + $this->img_lang = $this->lang_name; + + // Call phpbb_user_session_handler() in case external application want to "bend" some variables or replace classes... + // After calling it we continue script execution... + phpbb_user_session_handler(); + + // If this function got called from the error handler we are finished here. + if (defined('IN_ERROR_HANDLER')) + { + return; + } + + // Disable board if the install/ directory is still present + // For the brave development army we do not care about this, else we need to comment out this everytime we develop locally + if (!defined('DEBUG') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install')) + { + // Adjust the message slightly according to the permissions + if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) + { + $message = 'REMOVE_INSTALL'; + } + else + { + $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; + } + trigger_error($message); + } + + // Is board disabled and user not an admin or moderator? + if ($config['board_disable'] && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) + { + if ($this->data['is_bot']) + { + send_status_line(503, 'Service Unavailable'); + } + + $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; + trigger_error($message); + } + + // Is load exceeded? + if ($config['limit_load'] && $this->load !== false) + { + if ($this->load > floatval($config['limit_load']) && !defined('IN_LOGIN') && !defined('IN_ADMIN')) + { + // Set board disabled to true to let the admins/mods get the proper notification + $config['board_disable'] = '1'; + + if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) + { + if ($this->data['is_bot']) + { + send_status_line(503, 'Service Unavailable'); + } + trigger_error('BOARD_UNAVAILABLE'); + } + } + } + + if (isset($this->data['session_viewonline'])) + { + // Make sure the user is able to hide his session + if (!$this->data['session_viewonline']) + { + // Reset online status if not allowed to hide the session... + if (!$auth->acl_get('u_hideonline')) + { + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET session_viewonline = 1 + WHERE session_user_id = ' . $this->data['user_id']; + $db->sql_query($sql); + $this->data['session_viewonline'] = 1; + } + } + else if (!$this->data['user_allow_viewonline']) + { + // the user wants to hide and is allowed to -> cloaking device on. + if ($auth->acl_get('u_hideonline')) + { + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET session_viewonline = 0 + WHERE session_user_id = ' . $this->data['user_id']; + $db->sql_query($sql); + $this->data['session_viewonline'] = 0; + } + } + } + + // Does the user need to change their password? If so, redirect to the + // ucp profile reg_details page ... of course do not redirect if we're already in the ucp + if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && !empty($this->data['is_registered']) && $auth->acl_get('u_chgpasswd') && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400)) + { + if (strpos($this->page['query_string'], 'mode=reg_details') === false && $this->page['page_name'] != "ucp.$phpEx") + { + redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&mode=reg_details')); + } + } + + return; + } + + /** + * More 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: $user->lang('NUM_POSTS_IN_QUEUE', 1); + * + * If the first parameter is an array, the elements are used as keys and subkeys to get the language entry: + * Example: $user->lang(array('datetime', 'AGO'), 1) uses $user->lang['datetime']['AGO'] as language entry. + */ + 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); + } + + /** + * Determine which plural form we should use. + * For some languages this is not as simple as for English. + * + * @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 + */ + 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); + } + + /** + * 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 string $ext_name The extension to load language from, or empty for core files + * + * Examples: + * + * $lang_set = array('posting', 'help' => 'faq'); + * $lang_set = array('posting', 'viewtopic', 'help' => array('bbcode', 'faq')) + * $lang_set = array(array('posting', 'viewtopic'), 'help' => array('bbcode', 'faq')) + * $lang_set = 'posting' + * $lang_set = array('help' => 'faq', 'db' => array('help:faq', 'posting')) + * + */ + 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) + { + // Please do not delete this line. + // We have to force the type here, else [array] language inclusion will not work + $key = (string) $key; + + if ($key == 'db') + { + $this->add_lang($lang_file, true, $use_help, $ext_name); + } + else if ($key == 'help') + { + $this->add_lang($lang_file, $use_db, true, $ext_name); + } + else if (!is_array($lang_file)) + { + $this->set_lang($this->lang, $this->help, $lang_file, $use_db, $use_help, $ext_name); + } + else + { + $this->add_lang($lang_file, $use_db, $use_help, $ext_name); + } + } + unset($lang_set); + } + else if ($lang_set) + { + $this->set_lang($this->lang, $this->help, $lang_set, $use_db, $use_help, $ext_name); + } + } + + /** + * Add Language Items from an extension - use_db and use_help are assigned where needed (only use them to force inclusion) + * + * @param string $ext_name The extension to load language from, or empty for core files + * @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 + */ + function add_lang_ext($ext_name, $lang_set, $use_db = false, $use_help = false) + { + if ($ext_name === '/') + { + $ext_name = ''; + } + + $this->add_lang($lang_set, $use_db, $use_help, $ext_name); + } + + /** + * 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 . $this->lang_name . '/') === 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 + * @param string $format date format in date() notation. | used to indicate relative dates, for example |d m Y|, h:i is translated to Today, h:i. + * @param bool $forcedate force non-relative date format. + * + * @return mixed translated date + */ + function format_date($gmepoch, $format = false, $forcedate = false) + { + static $utc; + + if (!isset($utc)) + { + $utc = new \DateTimeZone('UTC'); + } + + $time = new $this->datetime($this, "@$gmepoch", $utc); + $time->setTimezone($this->timezone); + + return $time->format($format, $forcedate); + } + + /** + * Create a \phpbb\datetime object in the context of the current user + * + * @since 3.1 + * @param string $time String in a format accepted by strtotime(). + * @param DateTimeZone $timezone Time zone of the time. + * @return \phpbb\datetime Date time object linked to the current users locale + */ + public function create_datetime($time = 'now', \DateTimeZone $timezone = null) + { + $timezone = $timezone ?: $this->timezone; + return new $this->datetime($this, $time, $timezone); + } + + /** + * Get the UNIX timestamp for a datetime in the users timezone, so we can store it in the database. + * + * @param string $format Format of the entered date/time + * @param string $time Date/time with the timezone applied + * @param DateTimeZone $timezone Timezone of the date/time, falls back to timezone of current user + * @return int Returns the unix timestamp + */ + public function get_timestamp_from_format($format, $time, \DateTimeZone $timezone = null) + { + $timezone = $timezone ?: $this->timezone; + $date = \DateTime::createFromFormat($format, $time, $timezone); + return ($date !== false) ? $date->format('U') : false; + } + + /** + * Get language id currently used by the user + */ + function get_iso_lang_id() + { + global $config, $db; + + if (!empty($this->lang_id)) + { + return $this->lang_id; + } + + if (!$this->lang_name) + { + $this->lang_name = $config['default_lang']; + } + + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE . " + WHERE lang_iso = '" . $db->sql_escape($this->lang_name) . "'"; + $result = $db->sql_query($sql); + $this->lang_id = (int) $db->sql_fetchfield('lang_id'); + $db->sql_freeresult($result); + + return $this->lang_id; + } + + /** + * Get users profile fields + */ + function get_profile_fields($user_id) + { + global $db; + + if (isset($this->profile_fields)) + { + return; + } + + $sql = 'SELECT * + FROM ' . PROFILE_FIELDS_DATA_TABLE . " + WHERE user_id = $user_id"; + $result = $db->sql_query_limit($sql, 1); + $this->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row; + $db->sql_freeresult($result); + } + + /** + * Specify/Get image + */ + function img($img, $alt = '') + { + $title = ''; + + if ($alt) + { + $alt = $this->lang($alt); + $title = ' title="' . $alt . '"'; + } + return '' . $alt . ''; + } + + /** + * Get option bit field from user options. + * + * @param int $key option key, as defined in $keyoptions property. + * @param int $data bit field value to use, or false to use $this->data['user_options'] + * @return bool true if the option is set in the bit field, false otherwise + */ + function optionget($key, $data = false) + { + $var = ($data !== false) ? $data : $this->data['user_options']; + return phpbb_optionget($this->keyoptions[$key], $var); + } + + /** + * Set option bit field for user options. + * + * @param int $key Option key, as defined in $keyoptions property. + * @param bool $value True to set the option, false to clear the option. + * @param int $data Current bit field value, or false to use $this->data['user_options'] + * @return int|bool If $data is false, the bit field is modified and + * written back to $this->data['user_options'], and + * return value is true if the bit field changed and + * false otherwise. If $data is not false, the new + * bitfield value is returned. + */ + function optionset($key, $value, $data = false) + { + $var = ($data !== false) ? $data : $this->data['user_options']; + + $new_var = phpbb_optionset($this->keyoptions[$key], $value, $var); + + if ($data === false) + { + if ($new_var != $var) + { + $this->data['user_options'] = $new_var; + return true; + } + else + { + return false; + } + } + else + { + return $new_var; + } + } + + /** + * Funtion to make the user leave the NEWLY_REGISTERED system group. + * @access public + */ + function leave_newly_registered() + { + global $db; + + if (empty($this->data['user_new'])) + { + return false; + } + + if (!function_exists('remove_newly_registered')) + { + global $phpbb_root_path, $phpEx; + + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + } + if ($group = remove_newly_registered($this->data['user_id'], $this->data)) + { + $this->data['group_id'] = $group; + + } + $this->data['user_permissions'] = ''; + $this->data['user_new'] = 0; + + return true; + } + + /** + * Returns all password protected forum ids the user is currently NOT authenticated for. + * + * @return array Array of forum ids + * @access public + */ + function get_passworded_forums() + { + global $db; + + $sql = 'SELECT f.forum_id, fa.user_id + FROM ' . FORUMS_TABLE . ' f + LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa + ON (fa.forum_id = f.forum_id + AND fa.session_id = '" . $db->sql_escape($this->session_id) . "') + WHERE f.forum_password <> ''"; + $result = $db->sql_query($sql); + + $forum_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_id = (int) $row['forum_id']; + + if ($row['user_id'] != $this->data['user_id']) + { + $forum_ids[$forum_id] = $forum_id; + } + } + $db->sql_freeresult($result); + + return $forum_ids; + } +} diff --git a/sources/phpBB/phpbb/user_loader.php b/sources/phpBB/phpbb/user_loader.php new file mode 100644 index 0000000..24e663b --- /dev/null +++ b/sources/phpBB/phpbb/user_loader.php @@ -0,0 +1,233 @@ + +* @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; + +/** +* User loader class +* +* This handles loading users from the database and +* storing in them in a temporary cache so we do not +* have to query the same user multiple times in +* different services. +*/ +class user_loader +{ + /** @var \phpbb\db\driver\driver_interface */ + protected $db = null; + + /** @var string */ + protected $phpbb_root_path = null; + + /** @var string */ + protected $php_ext = null; + + /** @var string */ + protected $users_table = null; + + /** + * Users loaded from the DB + * + * @var array Array of user data that we've loaded from the DB + */ + protected $users = array(); + + /** + * User loader constructor + * + * @param \phpbb\db\driver\driver_interface $db A database connection + * @param string $phpbb_root_path Path to the phpbb includes directory. + * @param string $php_ext php file extension + * @param string $users_table The name of the database table (phpbb_users) + */ + public function __construct(\phpbb\db\driver\driver_interface $db, $phpbb_root_path, $php_ext, $users_table) + { + $this->db = $db; + + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + + $this->users_table = $users_table; + } + + /** + * Load user helper + * + * @param array $user_ids + */ + public function load_users(array $user_ids) + { + $user_ids[] = ANONYMOUS; + + // Make user_ids unique and convert to integer. + $user_ids = array_map('intval', array_unique($user_ids)); + + // Do not load users we already have in $this->users + $user_ids = array_diff($user_ids, array_keys($this->users)); + + if (sizeof($user_ids)) + { + $sql = 'SELECT * + FROM ' . $this->users_table . ' + WHERE ' . $this->db->sql_in_set('user_id', $user_ids); + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $this->users[$row['user_id']] = $row; + } + $this->db->sql_freeresult($result); + } + } + + /** + * Load a user by username + * + * Stores the full data in the user cache so they do not need to be loaded again + * Returns the user id so you may use get_user() from the returned value + * + * @param string $username Raw username to load (will be cleaned) + * @return int User ID for the username + */ + public function load_user_by_username($username) + { + $sql = 'SELECT * + FROM ' . $this->users_table . " + WHERE username_clean = '" . $this->db->sql_escape(utf8_clean_string($username)) . "'"; + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if ($row) + { + $this->users[$row['user_id']] = $row; + + return $row['user_id']; + } + + return ANONYMOUS; + } + + /** + * Get a user row from our users cache + * + * @param int $user_id User ID of the user you want to retreive + * @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() + * @return array|bool Row from the database of the user or Anonymous if the user wasn't loaded/does not exist + * or bool False if the anonymous user was not loaded + */ + public function get_user($user_id, $query = false) + { + if (isset($this->users[$user_id])) + { + return $this->users[$user_id]; + } + // Query them if we must (if ANONYMOUS is sent as the user_id and we have not loaded Anonymous yet, we must load Anonymous as a last resort) + else if ($query || $user_id == ANONYMOUS) + { + $this->load_users(array($user_id)); + + return $this->get_user($user_id); + } + + return $this->get_user(ANONYMOUS); + } + + /** + * Get username + * + * @param int $user_id User ID of the user you want to retreive the username for + * @param string $mode The mode to load (same as get_username_string). One of the following: + * profile (for getting an url to the profile) + * username (for obtaining the username) + * colour (for obtaining the user colour) + * full (for obtaining a html string representing a coloured link to the users profile) + * no_profile (the same as full but forcing no profile link) + * @param string $guest_username Optional parameter to specify the guest username. It will be used in favor of the GUEST language variable then. + * @param string $custom_profile_url Optional parameter to specify a profile url. The user id get appended to this url as &u={user_id} + * @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() + * @return string + */ + public function get_username($user_id, $mode, $guest_username = false, $custom_profile_url = false, $query = false) + { + if (!($user = $this->get_user($user_id, $query))) + { + return ''; + } + + return get_username_string($mode, $user['user_id'], $user['username'], $user['user_colour'], $guest_username, $custom_profile_url); + } + + /** + * Get avatar + * + * @param int $user_id User ID of the user you want to retreive 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() + * @return string + */ + public function get_avatar($user_id, $query = false) + { + if (!($user = $this->get_user($user_id, $query))) + { + return ''; + } + + if (!function_exists('get_user_avatar')) + { + include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext); + } + + return get_user_avatar($user['user_avatar'], $user['user_avatar_type'], $user['user_avatar_width'], $user['user_avatar_height']); + } + + /** + * Get rank + * + * @param int $user_id User ID of the user you want to retreive the rank 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() + * @return array Array with keys 'rank_title', 'rank_img', and 'rank_img_src' + */ + public function get_rank($user_id, $query = false) + { + if (!($user = $this->get_user($user_id, $query))) + { + return ''; + } + + if (!function_exists('phpbb_get_user_rank')) + { + include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext); + } + + $rank = array( + 'rank_title', + 'rank_img', + 'rank_img_src', + ); + + $user_rank_data = phpbb_get_user_rank($user, (($user['user_id'] == ANONYMOUS) ? false : $user['user_posts'])); + $rank['rank_title'] = $user_rank_data['title']; + $rank['rank_img'] = $user_rank_data['img']; + $rank['rank_img_src'] = $user_rank_data['img_src']; + + return $rank; + } +} diff --git a/sources/phpBB/phpbb/version_helper.php b/sources/phpBB/phpbb/version_helper.php new file mode 100644 index 0000000..e4f68f5 --- /dev/null +++ b/sources/phpBB/phpbb/version_helper.php @@ -0,0 +1,299 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb; + +/** + * Class to handle version checking and comparison + */ +class version_helper +{ + /** + * @var string Host + */ + protected $host = 'version.phpbb.com'; + + /** + * @var string Path to file + */ + protected $path = '/phpbb'; + + /** + * @var string File name + */ + protected $file = 'versions.json'; + + /** + * @var string Current version installed + */ + protected $current_version; + + /** + * @var null|string Null to not force stability, 'unstable' or 'stable' to + * force the corresponding stability + */ + protected $force_stability; + + /** @var \phpbb\cache\service */ + protected $cache; + + /** @var \phpbb\config\config */ + protected $config; + + /** @var \phpbb\file_downloader */ + protected $file_downloader; + + /** @var \phpbb\user */ + protected $user; + + /** + * Constructor + * + * @param \phpbb\cache\service $cache + * @param \phpbb\config\config $config + * @param \phpbb\file_downloader $file_downloader + * @param \phpbb\user $user + */ + public function __construct(\phpbb\cache\service $cache, \phpbb\config\config $config, \phpbb\file_downloader $file_downloader, \phpbb\user $user) + { + $this->cache = $cache; + $this->config = $config; + $this->file_downloader = $file_downloader; + $this->user = $user; + + if (defined('PHPBB_QA')) + { + $this->force_stability = 'unstable'; + } + + $this->current_version = $this->config['version']; + } + + /** + * Set location to the file + * + * @param string $host Host (e.g. version.phpbb.com) + * @param string $path Path to file (e.g. /phpbb) + * @param string $file File name (Default: versions.json) + * @return version_helper + */ + public function set_file_location($host, $path, $file = 'versions.json') + { + $this->host = $host; + $this->path = $path; + $this->file = $file; + + return $this; + } + + /** + * Set current version + * + * @param string $version The current version + * @return version_helper + */ + public function set_current_version($version) + { + $this->current_version = $version; + + return $this; + } + + /** + * Over-ride the stability to force check to include unstable versions + * + * @param null|string Null to not force stability, 'unstable' or 'stable' to + * force the corresponding stability + * @return version_helper + */ + public function force_stability($stability) + { + $this->force_stability = $stability; + + return $this; + } + + /** + * Wrapper for version_compare() that allows using uppercase A and B + * for alpha and beta releases. + * + * See http://www.php.net/manual/en/function.version-compare.php + * + * @param string $version1 First version number + * @param string $version2 Second version number + * @param string $operator Comparison operator (optional) + * + * @return mixed Boolean (true, false) if comparison operator is specified. + * Integer (-1, 0, 1) otherwise. + */ + public function compare($version1, $version2, $operator = null) + { + return phpbb_version_compare($version1, $version2, $operator); + } + + /** + * Check whether or not a version is "stable" + * + * Stable means only numbers OR a pl release + * + * @param string $version + * @return bool Bool true or false + */ + public function is_stable($version) + { + $matches = false; + preg_match('/^[\d\.]+/', $version, $matches); + + if (empty($matches[0])) + { + return false; + } + + return $this->compare($version, $matches[0], '>='); + } + + /** + * Gets the latest version for the current branch the user is on + * + * @param bool $force_update Ignores cached data. Defaults to false. + * @param bool $force_cache Force the use of the cache. Override $force_update. + * @return string + * @throws \RuntimeException + */ + public function get_latest_on_current_branch($force_update = false, $force_cache = false) + { + $versions = $this->get_versions_matching_stability($force_update, $force_cache); + + $self = $this; + $current_version = $this->current_version; + + // Filter out any versions less than to the current version + $versions = array_filter($versions, function($data) use ($self, $current_version) { + return $self->compare($data['current'], $current_version, '>='); + }); + + // Get the lowest version from the previous list. + return array_reduce($versions, function($value, $data) use ($self) { + if ($value === null || $self->compare($data['current'], $value, '<')) + { + return $data['current']; + } + + return $value; + }); + } + + /** + * Obtains the latest version information + * + * @param bool $force_update Ignores cached data. Defaults to false. + * @param bool $force_cache Force the use of the cache. Override $force_update. + * @return string + * @throws \RuntimeException + */ + public function get_suggested_updates($force_update = false, $force_cache = false) + { + $versions = $this->get_versions_matching_stability($force_update, $force_cache); + + $self = $this; + $current_version = $this->current_version; + + // Filter out any versions less than or equal to the current version + return array_filter($versions, function($data) use ($self, $current_version) { + return $self->compare($data['current'], $current_version, '>'); + }); + } + + /** + * Obtains the latest version information matching the stability of the current install + * + * @param bool $force_update Ignores cached data. Defaults to false. + * @param bool $force_cache Force the use of the cache. Override $force_update. + * @return string Version info + * @throws \RuntimeException + */ + public function get_versions_matching_stability($force_update = false, $force_cache = false) + { + $info = $this->get_versions($force_update, $force_cache); + + if ($this->force_stability !== null) + { + return ($this->force_stability === 'unstable') ? $info['unstable'] : $info['stable']; + } + + return ($this->is_stable($this->current_version)) ? $info['stable'] : $info['unstable']; + } + + /** + * Obtains the latest version information + * + * @param bool $force_update Ignores cached data. Defaults to false. + * @param bool $force_cache Force the use of the cache. Override $force_update. + * @return string Version info, includes stable and unstable data + * @throws \RuntimeException + */ + public function get_versions($force_update = false, $force_cache = false) + { + $cache_file = '_versioncheck_' . $this->host . $this->path . $this->file; + + $info = $this->cache->get($cache_file); + + if ($info === false && $force_cache) + { + throw new \RuntimeException($this->user->lang('VERSIONCHECK_FAIL')); + } + else if ($info === false || $force_update) + { + try { + $info = $this->file_downloader->get($this->host, $this->path, $this->file); + } + catch (\phpbb\exception\runtime_exception $exception) + { + $prepare_parameters = array_merge(array($exception->getMessage()), $exception->get_parameters()); + throw new \RuntimeException(call_user_func_array(array($this->user, 'lang'), $prepare_parameters)); + } + $error_string = $this->file_downloader->get_error_string(); + + if (!empty($error_string)) + { + throw new \RuntimeException($error_string); + } + + $info = json_decode($info, true); + + // Sanitize any data we retrieve from a server + if (!empty($info)) + { + $json_sanitizer = function (&$value, $key) { + $type_cast_helper = new \phpbb\request\type_cast_helper(); + $type_cast_helper->set_var($value, $value, gettype($value), true); + }; + array_walk_recursive($info, $json_sanitizer); + } + + if (empty($info['stable']) && empty($info['unstable'])) + { + $this->user->add_lang('acp/common'); + + throw new \RuntimeException($this->user->lang('VERSIONCHECK_FAIL')); + } + + $info['stable'] = (empty($info['stable'])) ? array() : $info['stable']; + $info['unstable'] = (empty($info['unstable'])) ? $info['stable'] : $info['unstable']; + + $this->cache->put($cache_file, $info, 86400); // 24 hours + } + + return $info; + } +} diff --git a/sources/phpBB/phpbb/viewonline_helper.php b/sources/phpBB/phpbb/viewonline_helper.php new file mode 100644 index 0000000..b722f9d --- /dev/null +++ b/sources/phpBB/phpbb/viewonline_helper.php @@ -0,0 +1,54 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb; + +/** +* Class to handle viewonline related tasks +*/ +class viewonline_helper +{ + /** @var \phpbb\filesystem */ + protected $filesystem; + + /** + * @param \phpbb\filesystem $filesystem + */ + public function __construct(\phpbb\filesystem $filesystem) + { + $this->filesystem = $filesystem; + } + + /** + * Get user page + * + * @param string $session_page User's session page + * @return array Match array filled by preg_match() + */ + public function get_user_page($session_page) + { + $session_page = $this->filesystem->clean_path($session_page); + if (strpos($session_page, './') === 0) + { + $session_page = substr($session_page, 2); + } + + preg_match('#^((\.\./)*([a-z0-9/_-]+))#i', $session_page, $on_page); + if (empty($on_page)) + { + $on_page[1] = ''; + } + + return $on_page; + } +} diff --git a/sources/phpBB/posting.php b/sources/phpBB/posting.php new file mode 100644 index 0000000..ac412c0 --- /dev/null +++ b/sources/phpBB/posting.php @@ -0,0 +1,1906 @@ + +* @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); +$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_posting.' . $phpEx); +include($phpbb_root_path . 'includes/functions_display.' . $phpEx); +include($phpbb_root_path . 'includes/message_parser.' . $phpEx); + + +// Start session management +$user->session_begin(); +$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); + +$submit = (isset($_POST['post'])) ? true : false; +$preview = (isset($_POST['preview'])) ? true : false; +$save = (isset($_POST['save'])) ? true : false; +$load = (isset($_POST['load'])) ? true : false; +$confirm = $request->is_set_post('confirm'); +$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); +$mode = request_var('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))) +{ + $mode = 'soft_delete'; +} + +$error = $post_data = array(); +$current_time = time(); + +/** +* This event allows you to alter the above parameters, such as submit and mode +* +* Note: $refresh must be true to retain previously submitted form data. +* +* Note: The template class will not work properly until $user->setup() is +* called, and it has not been called yet. Extensions requiring template +* assignments should use an event that comes later in this file. +* +* @event core.modify_posting_parameters +* @var int post_id ID of the post +* @var int topic_id ID of the topic +* @var int forum_id ID of the forum +* @var int draft_id ID of the draft +* @var int lastclick Timestamp of when the form was last loaded +* @var bool submit Whether or not the form has been submitted +* @var bool preview Whether or not the post is being previewed +* @var bool save Whether or not a draft is being saved +* @var bool load Whether or not a draft is being loaded +* @var bool cancel Whether or not to cancel the form (returns to +* viewtopic or viewforum depending on if the user +* is posting a new topic or editing a post) +* @var bool refresh Whether or not to retain previously submitted data +* @var string mode What action to take if the form has been submitted +* post|reply|quote|edit|delete|bump|smilies|popup +* @var array error Any error strings; a non-empty array aborts +* form submission. +* NOTE: Should be actual language strings, NOT +* language keys. +* @since 3.1.0-a1 +* @change 3.1.2-RC1 Removed 'delete' var as it does not exist +*/ +$vars = array( + 'post_id', + 'topic_id', + 'forum_id', + 'draft_id', + 'lastclick', + 'submit', + 'preview', + 'save', + 'load', + 'cancel', + 'refresh', + 'mode', + 'error', +); +extract($phpbb_dispatcher->trigger_event('core.modify_posting_parameters', compact($vars))); + +// Was cancel pressed? If so then redirect to the appropriate page +if ($cancel || ($current_time - $lastclick < 2 && $submit)) +{ + $f = ($forum_id) ? 'f=' . $forum_id . '&' : ''; + $redirect = ($post_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $f . 'p=' . $post_id) . '#p' . $post_id : (($topic_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $f . 't=' . $topic_id) : (($forum_id) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) : append_sid("{$phpbb_root_path}index.$phpEx"))); + redirect($redirect); +} + +if (in_array($mode, array('post', 'reply', 'quote', 'edit', 'delete')) && !$forum_id) +{ + trigger_error('NO_FORUM'); +} + +$phpbb_content_visibility = $phpbb_container->get('content.visibility'); + +// We need to know some basic information in all cases before we do anything. +switch ($mode) +{ + case 'post': + $sql = 'SELECT * + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + break; + + case 'bump': + case 'reply': + if (!$topic_id) + { + trigger_error('NO_TOPIC'); + } + + // Force forum id + $sql = 'SELECT forum_id + FROM ' . TOPICS_TABLE . ' + WHERE topic_id = ' . $topic_id; + $result = $db->sql_query($sql); + $f_id = (int) $db->sql_fetchfield('forum_id'); + $db->sql_freeresult($result); + + $forum_id = (!$f_id) ? $forum_id : $f_id; + + $sql = 'SELECT f.*, t.* + FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f + WHERE t.topic_id = $topic_id + AND f.forum_id = t.forum_id + AND " . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.'); + break; + + case 'quote': + case 'edit': + case 'delete': + case 'soft_delete': + if (!$post_id) + { + $user->setup('posting'); + trigger_error('NO_POST'); + } + + // Force forum id + $sql = 'SELECT forum_id + FROM ' . POSTS_TABLE . ' + WHERE post_id = ' . $post_id; + $result = $db->sql_query($sql); + $f_id = (int) $db->sql_fetchfield('forum_id'); + $db->sql_freeresult($result); + + $forum_id = (!$f_id) ? $forum_id : $f_id; + + $sql = 'SELECT f.*, t.*, p.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f, ' . USERS_TABLE . " u + WHERE p.post_id = $post_id + AND t.topic_id = p.topic_id + AND u.user_id = p.poster_id + AND f.forum_id = t.forum_id + AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id, 'p.'); + break; + + case 'smilies': + $sql = ''; + generate_smilies('window', $forum_id); + break; + + case 'popup': + if ($forum_id) + { + $sql = 'SELECT forum_style + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $forum_id; + } + else + { + phpbb_upload_popup(); + return; + } + break; + + default: + $sql = ''; + break; +} + +if (!$sql) +{ + $user->setup('posting'); + trigger_error('NO_POST_MODE'); +} + +$result = $db->sql_query($sql); +$post_data = $db->sql_fetchrow($result); +$db->sql_freeresult($result); + +if (!$post_data) +{ + if (!($mode == 'post' || $mode == 'bump' || $mode == 'reply')) + { + $user->setup('posting'); + } + trigger_error(($mode == 'post' || $mode == 'bump' || $mode == 'reply') ? 'NO_TOPIC' : 'NO_POST'); +} + +// Not able to reply to unapproved posts/topics +// TODO: add more descriptive language key +if ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'bump') && $post_data['topic_visibility'] != ITEM_APPROVED) || ($mode == 'quote' && $post_data['post_visibility'] != ITEM_APPROVED))) +{ + trigger_error(($mode == 'reply' || $mode == 'bump') ? 'TOPIC_UNAPPROVED' : 'POST_UNAPPROVED'); +} + +if ($mode == 'popup') +{ + phpbb_upload_popup($post_data['forum_style']); + return; +} + +$user->setup(array('posting', 'mcp', 'viewtopic'), $post_data['forum_style']); + +if ($config['enable_post_confirm'] && !$user->data['is_registered']) +{ + $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']); + $captcha->init(CONFIRM_POST); +} + +// Use post_row values in favor of submitted ones... +$forum_id = (!empty($post_data['forum_id'])) ? (int) $post_data['forum_id'] : (int) $forum_id; +$topic_id = (!empty($post_data['topic_id'])) ? (int) $post_data['topic_id'] : (int) $topic_id; +$post_id = (!empty($post_data['post_id'])) ? (int) $post_data['post_id'] : (int) $post_id; + +// Need to login to passworded forum first? +if ($post_data['forum_password']) +{ + login_forum_box(array( + 'forum_id' => $forum_id, + 'forum_name' => $post_data['forum_name'], + 'forum_password' => $post_data['forum_password']) + ); +} + +// Check permissions +if ($user->data['is_bot']) +{ + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); +} + +// Is the user able to read within this forum? +if (!$auth->acl_get('f_read', $forum_id)) +{ + if ($user->data['user_id'] != ANONYMOUS) + { + trigger_error('USER_CANNOT_READ'); + } + $message = $user->lang['LOGIN_EXPLAIN_POST']; + + if ($request->is_ajax()) + { + $json = new phpbb\json_response(); + $json->send(array( + 'title' => $user->lang['INFORMATION'], + 'message' => $message, + )); + } + + login_box('', $message); +} + +// Permission to do the action asked? +$is_authed = false; + +switch ($mode) +{ + case 'post': + if ($auth->acl_get('f_post', $forum_id)) + { + $is_authed = true; + } + break; + + case 'bump': + if ($auth->acl_get('f_bump', $forum_id)) + { + $is_authed = true; + } + break; + + case 'quote': + + $post_data['post_edit_locked'] = 0; + + // no break; + + case 'reply': + if ($auth->acl_get('f_reply', $forum_id)) + { + $is_authed = true; + } + break; + + case 'edit': + if ($user->data['is_registered'] && $auth->acl_gets('f_edit', 'm_edit', $forum_id)) + { + $is_authed = true; + } + break; + + case 'delete': + if ($user->data['is_registered'] && ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)))) + { + $is_authed = true; + } + break; + + case 'soft_delete': + if ($user->data['is_registered'] && $phpbb_content_visibility->can_soft_delete($forum_id, $post_data['poster_id'], $post_data['post_edit_locked'])) + { + $is_authed = true; + } + else + { + // Display the same error message for softdelete we use for delete + $mode = 'delete'; + } + break; +} +/** +* This event allows you to do extra auth checks and verify if the user +* has the required permissions +* +* Extensions should only change the error and is_authed variables. +* +* @event core.modify_posting_auth +* @var int post_id ID of the post +* @var int topic_id ID of the topic +* @var int forum_id ID of the forum +* @var int draft_id ID of the draft +* @var int lastclick Timestamp of when the form was last loaded +* @var bool submit Whether or not the form has been submitted +* @var bool preview Whether or not the post is being previewed +* @var bool save Whether or not a draft is being saved +* @var bool load Whether or not a draft is being loaded +* @var bool refresh Whether or not to retain previously submitted data +* @var string mode What action to take if the form has been submitted +* post|reply|quote|edit|delete|bump|smilies|popup +* @var array error Any error strings; a non-empty array aborts +* form submission. +* NOTE: Should be actual language strings, NOT +* language keys. +* @var bool is_authed Does the user have the required permissions? +* @since 3.1.3-RC1 +*/ +$vars = array( + 'post_id', + 'topic_id', + 'forum_id', + 'draft_id', + 'lastclick', + 'submit', + 'preview', + 'save', + 'load', + 'refresh', + 'mode', + 'error', + 'is_authed', +); +extract($phpbb_dispatcher->trigger_event('core.modify_posting_auth', compact($vars))); + +if (!$is_authed) +{ + $check_auth = ($mode == 'quote') ? 'reply' : $mode; + + if ($user->data['is_registered']) + { + trigger_error('USER_CANNOT_' . strtoupper($check_auth)); + } + $message = $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)]; + + if ($request->is_ajax()) + { + $json = new phpbb\json_response(); + $json->send(array( + 'title' => $user->lang['INFORMATION'], + 'message' => $message, + )); + } + + login_box('', $message); +} + +// Is the user able to post within this forum? +if ($post_data['forum_type'] != FORUM_POST && in_array($mode, array('post', 'bump', 'quote', 'reply'))) +{ + trigger_error('USER_CANNOT_FORUM_POST'); +} + +// Forum/Topic locked? +if (($post_data['forum_status'] == ITEM_LOCKED || (isset($post_data['topic_status']) && $post_data['topic_status'] == ITEM_LOCKED)) && !$auth->acl_get('m_edit', $forum_id)) +{ + trigger_error(($post_data['forum_status'] == ITEM_LOCKED) ? 'FORUM_LOCKED' : 'TOPIC_LOCKED'); +} + +// Can we edit this post ... if we're a moderator with rights then always yes +// else it depends on editing times, lock status and if we're the correct user +if ($mode == 'edit' && !$auth->acl_get('m_edit', $forum_id)) +{ + $force_edit_allowed = false; + + $s_cannot_edit = $user->data['user_id'] != $post_data['poster_id']; + $s_cannot_edit_time = $config['edit_time'] && $post_data['post_time'] <= time() - ($config['edit_time'] * 60); + $s_cannot_edit_locked = $post_data['post_edit_locked']; + + /** + * This event allows you to modify the conditions for the "cannot edit post" checks + * + * @event core.posting_modify_cannot_edit_conditions + * @var array post_data Array with post data + * @var bool force_edit_allowed Allow the user to edit the post (all permissions and conditions are ignored) + * @var bool s_cannot_edit User can not edit the post because it's not his + * @var bool s_cannot_edit_locked User can not edit the post because it's locked + * @var bool s_cannot_edit_time User can not edit the post because edit_time has passed + * @since 3.1.0-b4 + */ + $vars = array( + 'post_data', + 'force_edit_allowed', + 's_cannot_edit', + 's_cannot_edit_locked', + 's_cannot_edit_time', + ); + extract($phpbb_dispatcher->trigger_event('core.posting_modify_cannot_edit_conditions', compact($vars))); + + if (!$force_edit_allowed) + { + if ($s_cannot_edit) + { + trigger_error('USER_CANNOT_EDIT'); + } + else if ($s_cannot_edit_time) + { + trigger_error('CANNOT_EDIT_TIME'); + } + else if ($s_cannot_edit_locked) + { + trigger_error('CANNOT_EDIT_POST_LOCKED'); + } + } +} + +// Handle delete mode... +if ($mode == 'delete' || $mode == 'soft_delete') +{ + if ($mode == 'soft_delete' && $post_data['post_visibility'] == ITEM_DELETED) + { + $user->setup('posting'); + trigger_error('NO_POST'); + } + + $delete_reason = $request->variable('delete_reason', '', true); + phpbb_handle_post_delete($forum_id, $topic_id, $post_id, $post_data, ($mode == 'soft_delete'), $delete_reason); + return; +} + +// Handle bump mode... +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']}")) + { + $meta_url = phpbb_bump_topic($forum_id, $topic_id, $post_data, $current_time); + meta_refresh(3, $meta_url); + $message = $user->lang['TOPIC_BUMPED']; + + if (!$request->is_ajax()) + { + $message .= '

' . $user->lang('VIEW_MESSAGE', '', ''); + $message .= '

' . $user->lang('RETURN_FORUM', '', ''); + } + + trigger_error($message); + } + + trigger_error('BUMP_ERROR'); +} + +// Subject length limiting to 60 characters if first post... +if ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_data['post_id'])) +{ + $template->assign_var('S_NEW_MESSAGE', true); +} + +// Determine some vars +if (isset($post_data['poster_id']) && $post_data['poster_id'] == ANONYMOUS) +{ + $post_data['quote_username'] = (!empty($post_data['post_username'])) ? $post_data['post_username'] : $user->lang['GUEST']; +} +else +{ + $post_data['quote_username'] = isset($post_data['username']) ? $post_data['username'] : ''; +} + +$post_data['post_edit_locked'] = (isset($post_data['post_edit_locked'])) ? (int) $post_data['post_edit_locked'] : 0; +$post_data['post_subject_md5'] = (isset($post_data['post_subject']) && $mode == 'edit') ? md5($post_data['post_subject']) : ''; +$post_data['post_subject'] = (in_array($mode, array('quote', 'edit'))) ? $post_data['post_subject'] : ((isset($post_data['topic_title'])) ? $post_data['topic_title'] : ''); +$post_data['topic_time_limit'] = (isset($post_data['topic_time_limit'])) ? (($post_data['topic_time_limit']) ? (int) $post_data['topic_time_limit'] / 86400 : (int) $post_data['topic_time_limit']) : 0; +$post_data['poll_length'] = (!empty($post_data['poll_length'])) ? (int) $post_data['poll_length'] / 86400 : 0; +$post_data['poll_start'] = (!empty($post_data['poll_start'])) ? (int) $post_data['poll_start'] : 0; +$post_data['icon_id'] = (!isset($post_data['icon_id']) || in_array($mode, array('quote', 'reply'))) ? 0 : (int) $post_data['icon_id']; +$post_data['poll_options'] = array(); + +// Get Poll Data +if ($post_data['poll_start']) +{ + $sql = 'SELECT poll_option_text + FROM ' . POLL_OPTIONS_TABLE . " + WHERE topic_id = $topic_id + ORDER BY poll_option_id"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $post_data['poll_options'][] = trim($row['poll_option_text']); + } + $db->sql_freeresult($result); +} + +if ($mode == 'edit') +{ + $original_poll_data = array( + 'poll_title' => $post_data['poll_title'], + 'poll_length' => $post_data['poll_length'], + 'poll_max_options' => $post_data['poll_max_options'], + 'poll_option_text' => implode("\n", $post_data['poll_options']), + 'poll_start' => $post_data['poll_start'], + 'poll_last_vote' => $post_data['poll_last_vote'], + 'poll_vote_change' => $post_data['poll_vote_change'], + ); +} + +$orig_poll_options_size = sizeof($post_data['poll_options']); + +$message_parser = new parse_message(); +$plupload = $phpbb_container->get('plupload'); +$mimetype_guesser = $phpbb_container->get('mimetype.guesser'); +$message_parser->set_plupload($plupload); +$message_parser->set_mimetype_guesser($mimetype_guesser); + +if (isset($post_data['post_text'])) +{ + $message_parser->message = &$post_data['post_text']; + unset($post_data['post_text']); +} + +// Set some default variables +$uninit = array('post_attachment' => 0, 'poster_id' => $user->data['user_id'], 'enable_magic_url' => 0, 'topic_status' => 0, 'topic_type' => POST_NORMAL, 'post_subject' => '', 'topic_title' => '', 'post_time' => 0, 'post_edit_reason' => '', 'notify_set' => 0); + +foreach ($uninit as $var_name => $default_value) +{ + if (!isset($post_data[$var_name])) + { + $post_data[$var_name] = $default_value; + } +} +unset($uninit); + +// Always check if the submitted attachment data is valid and belongs to the user. +// Further down (especially in submit_post()) we do not check this again. +$message_parser->get_submitted_attachment_data($post_data['poster_id']); + +if ($post_data['post_attachment'] && !$submit && !$refresh && !$preview && $mode == 'edit') +{ + // Do not change to SELECT * + $sql = 'SELECT attach_id, is_orphan, attach_comment, real_filename, filesize + FROM ' . ATTACHMENTS_TABLE . " + WHERE post_msg_id = $post_id + AND in_message = 0 + AND is_orphan = 0 + ORDER BY filetime DESC"; + $result = $db->sql_query($sql); + $message_parser->attachment_data = array_merge($message_parser->attachment_data, $db->sql_fetchrowset($result)); + $db->sql_freeresult($result); +} + +if ($post_data['poster_id'] == ANONYMOUS) +{ + $post_data['username'] = ($mode == 'quote' || $mode == 'edit') ? trim($post_data['post_username']) : ''; +} +else +{ + $post_data['username'] = ($mode == 'quote' || $mode == 'edit') ? trim($post_data['username']) : ''; +} + +$post_data['enable_urls'] = $post_data['enable_magic_url']; + +if ($mode != 'edit') +{ + $post_data['enable_sig'] = ($config['allow_sig'] && $user->optionget('attachsig')) ? true: false; + $post_data['enable_smilies'] = ($config['allow_smilies'] && $user->optionget('smilies')) ? true : false; + $post_data['enable_bbcode'] = ($config['allow_bbcode'] && $user->optionget('bbcode')) ? true : false; + $post_data['enable_urls'] = true; +} + +$post_data['enable_magic_url'] = $post_data['drafts'] = false; + +// User own some drafts? +if ($user->data['is_registered'] && $auth->acl_get('u_savedrafts') && ($mode == 'reply' || $mode == 'post' || $mode == 'quote')) +{ + $sql = 'SELECT draft_id + FROM ' . DRAFTS_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . + (($forum_id) ? ' AND forum_id = ' . (int) $forum_id : '') . + (($topic_id) ? ' AND topic_id = ' . (int) $topic_id : '') . + (($draft_id) ? " AND draft_id <> $draft_id" : ''); + $result = $db->sql_query_limit($sql, 1); + + if ($db->sql_fetchrow($result)) + { + $post_data['drafts'] = true; + } + $db->sql_freeresult($result); +} + +$check_value = (($post_data['enable_bbcode']+1) << 8) + (($post_data['enable_smilies']+1) << 4) + (($post_data['enable_urls']+1) << 2) + (($post_data['enable_sig']+1) << 1); + +// Check if user is watching this topic +if ($mode != 'post' && $config['allow_topic_notify'] && $user->data['is_registered']) +{ + $sql = 'SELECT topic_id + FROM ' . TOPICS_WATCH_TABLE . ' + WHERE topic_id = ' . $topic_id . ' + AND user_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + $post_data['notify_set'] = (int) $db->sql_fetchfield('topic_id'); + $db->sql_freeresult($result); +} + +// Do we want to edit our post ? +if ($mode == 'edit' && $post_data['bbcode_uid']) +{ + $message_parser->bbcode_uid = $post_data['bbcode_uid']; +} + +// HTML, BBCode, Smilies, Images and Flash status +$bbcode_status = ($config['allow_bbcode'] && $auth->acl_get('f_bbcode', $forum_id)) ? true : false; +$smilies_status = ($config['allow_smilies'] && $auth->acl_get('f_smilies', $forum_id)) ? true : false; +$img_status = ($bbcode_status && $auth->acl_get('f_img', $forum_id)) ? true : false; +$url_status = ($config['allow_post_links']) ? true : false; +$flash_status = ($bbcode_status && $auth->acl_get('f_flash', $forum_id) && $config['allow_post_flash']) ? true : false; +$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 = (!$subject && $mode != 'post') ? $post_data['topic_title'] : $subject; + $message = utf8_normalize_nfc(request_var('message', '', true)); + + if ($subject && $message) + { + if (confirm_box(true)) + { + $sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'user_id' => (int) $user->data['user_id'], + 'topic_id' => (int) $topic_id, + 'forum_id' => (int) $forum_id, + 'save_time' => (int) $current_time, + 'draft_subject' => (string) $subject, + 'draft_message' => (string) $message) + ); + $db->sql_query($sql); + + $meta_info = ($mode == 'post') ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) : append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"); + + meta_refresh(3, $meta_info); + + $message = $user->lang['DRAFT_SAVED'] . '

'; + $message .= ($mode != 'post') ? sprintf($user->lang['RETURN_TOPIC'], '', '') . '

' : ''; + $message .= sprintf($user->lang['RETURN_FORUM'], '', ''); + + trigger_error($message); + } + else + { + $s_hidden_fields = build_hidden_fields(array( + 'mode' => $mode, + 'save' => true, + 'f' => $forum_id, + 't' => $topic_id, + 'subject' => $subject, + 'message' => $message, + 'attachment_data' => $message_parser->attachment_data, + ) + ); + + $hidden_fields = array( + 'icon_id' => 0, + + 'disable_bbcode' => false, + 'disable_smilies' => false, + 'disable_magic_url' => false, + 'attach_sig' => true, + 'lock_topic' => false, + + 'topic_type' => POST_NORMAL, + 'topic_time_limit' => 0, + + 'poll_title' => '', + 'poll_option_text' => '', + 'poll_max_options' => 1, + 'poll_length' => 0, + 'poll_vote_change' => false, + ); + + foreach ($hidden_fields as $name => $default) + { + if (!isset($_POST[$name])) + { + // Don't include it, if its not available + unset($hidden_fields[$name]); + continue; + } + + if (is_bool($default)) + { + // Use the string representation + $hidden_fields[$name] = request_var($name, ''); + } + else + { + $hidden_fields[$name] = request_var($name, $default); + } + } + + $s_hidden_fields .= build_hidden_fields($hidden_fields); + + confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields); + } + } + else + { + if (utf8_clean_string($subject) === '') + { + $error[] = $user->lang['EMPTY_SUBJECT']; + } + + if (utf8_clean_string($message) === '') + { + $error[] = $user->lang['TOO_FEW_CHARS']; + } + } + unset($subject, $message); +} + +// Load requested Draft +if ($draft_id && ($mode == 'reply' || $mode == 'quote' || $mode == 'post') && $user->data['is_registered'] && $auth->acl_get('u_savedrafts')) +{ + $sql = 'SELECT draft_subject, draft_message + FROM ' . DRAFTS_TABLE . " + WHERE draft_id = $draft_id + AND user_id = " . $user->data['user_id']; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $post_data['post_subject'] = $row['draft_subject']; + $message_parser->message = $row['draft_message']; + + $template->assign_var('S_DRAFT_LOADED', true); + } + else + { + $draft_id = 0; + } +} + +// Load draft overview +if ($load && ($mode == 'reply' || $mode == 'quote' || $mode == 'post') && $post_data['drafts']) +{ + load_drafts($topic_id, $forum_id); +} + + +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['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['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)); + + 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['enable_bbcode'] = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true; + $post_data['enable_smilies'] = (!$smilies_status || isset($_POST['disable_smilies'])) ? false : true; + $post_data['enable_urls'] = (isset($_POST['disable_magic_url'])) ? 0 : 1; + $post_data['enable_sig'] = (!$config['allow_sig'] || !$auth->acl_get('f_sigs', $forum_id) || !$auth->acl_get('u_sig')) ? false : ((isset($_POST['attach_sig']) && $user->data['is_registered']) ? true : false); + + if ($config['allow_topic_notify'] && $user->data['is_registered']) + { + $notify = (isset($_POST['notify'])) ? true : false; + } + else + { + $notify = false; + } + + $topic_lock = (isset($_POST['lock_topic'])) ? true : false; + $post_lock = (isset($_POST['lock_post'])) ? true : false; + $poll_delete = (isset($_POST['poll_delete'])) ? true : false; + + if ($submit) + { + $status_switch = (($post_data['enable_bbcode']+1) << 8) + (($post_data['enable_smilies']+1) << 4) + (($post_data['enable_urls']+1) << 2) + (($post_data['enable_sig']+1) << 1); + $status_switch = ($status_switch != $check_value); + } + else + { + $status_switch = 1; + } + + // Delete Poll + if ($poll_delete && $mode == 'edit' && sizeof($post_data['poll_options']) && + ((!$post_data['poll_last_vote'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))) + { + if ($submit && check_form_key('posting')) + { + $sql = 'DELETE FROM ' . POLL_OPTIONS_TABLE . " + WHERE topic_id = $topic_id"; + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . POLL_VOTES_TABLE . " + WHERE topic_id = $topic_id"; + $db->sql_query($sql); + + $topic_sql = array( + 'poll_title' => '', + 'poll_start' => 0, + 'poll_length' => 0, + 'poll_last_vote' => 0, + 'poll_max_options' => 0, + 'poll_vote_change' => 0 + ); + + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $topic_sql) . " + WHERE topic_id = $topic_id"; + $db->sql_query($sql); + } + + $post_data['poll_title'] = $post_data['poll_option_text'] = ''; + $post_data['poll_vote_change'] = $post_data['poll_max_options'] = $post_data['poll_length'] = 0; + } + 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_vote_change'] = ($auth->acl_get('f_votechg', $forum_id) && $auth->acl_get('f_vote', $forum_id) && isset($_POST['poll_vote_change'])) ? 1 : 0; + } + + // If replying/quoting and last post id has changed + // give user option to continue submit or return to post + // notify and show user the post made between his request and the final submit + if (($mode == 'reply' || $mode == 'quote') && $post_data['topic_cur_post_id'] && $post_data['topic_cur_post_id'] != $post_data['topic_last_post_id']) + { + // Only do so if it is allowed forum-wide + if ($post_data['forum_flags'] & FORUM_FLAG_POST_REVIEW) + { + if (topic_review($topic_id, $forum_id, 'post_review', $post_data['topic_cur_post_id'])) + { + $template->assign_var('S_POST_REVIEW', true); + } + + $submit = false; + $refresh = true; + } + } + + // Parse Attachments - before checksum is calculated + $message_parser->parse_attachments('fileupload', $mode, $forum_id, $submit, $preview, $refresh); + + /** + * This event allows you to modify message text before parsing + * + * @event core.posting_modify_message_text + * @var array post_data Array with post data + * @var string mode What action to take if the form is submitted + * post|reply|quote|edit|delete|bump|smilies|popup + * @var int post_id ID of the post + * @var int topic_id ID of the topic + * @var int forum_id ID of the forum + * @var bool submit Whether or not the form has been submitted + * @var bool preview Whether or not the post is being previewed + * @var bool save Whether or not a draft is being saved + * @var bool load Whether or not a draft is being loaded + * @var bool cancel Whether or not to cancel the form (returns to + * viewtopic or viewforum depending on if the user + * is posting a new topic or editing a post) + * @var bool refresh Whether or not to retain previously submitted data + * @var object message_parser The message parser object + * @since 3.1.2-RC1 + */ + $vars = array( + 'post_data', + 'mode', + 'post_id', + 'topic_id', + 'forum_id', + 'submit', + 'preview', + 'save', + 'load', + 'cancel', + 'refresh', + 'message_parser', + ); + extract($phpbb_dispatcher->trigger_event('core.posting_modify_message_text', compact($vars))); + + // Grab md5 'checksum' of new message + $message_md5 = md5($message_parser->message); + + // If editing and checksum has changed we know the post was edited while we're editing + // 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', ''); + + // $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 + // $edit_post_message_checksum is the checksum of the post we're editing + // ... + + // We make sure nobody else made exactly the same change + // we're about to submit by also checking $message_md5 != $post_data['post_checksum'] + if ($edit_post_message_checksum !== '' && + $edit_post_message_checksum != $post_data['post_checksum'] && + $message_md5 != $post_data['post_checksum'] + || + $edit_post_subject_checksum !== '' && + $edit_post_subject_checksum != $post_data['post_subject_md5'] && + md5($post_data['post_subject']) != $post_data['post_subject_md5']) + { + if (topic_review($topic_id, $forum_id, 'post_review_edit', $post_id)) + { + $template->assign_vars(array( + 'S_POST_REVIEW' => true, + + 'L_POST_REVIEW' => $user->lang['POST_REVIEW_EDIT'], + 'L_POST_REVIEW_EXPLAIN' => $user->lang['POST_REVIEW_EDIT_EXPLAIN'], + )); + } + + $submit = false; + $refresh = true; + } + } + + // Check checksum ... don't re-parse message if the same + $update_message = ($mode != 'edit' || $message_md5 != $post_data['post_checksum'] || $status_switch || strlen($post_data['bbcode_uid']) < BBCODE_UID_LEN) ? true : false; + + // Also check if subject got updated... + $update_subject = $mode != 'edit' || ($post_data['post_subject_md5'] && $post_data['post_subject_md5'] != md5($post_data['post_subject'])); + + // Parse message + if ($update_message) + { + if (sizeof($message_parser->warn_msg)) + { + $error[] = implode('
', $message_parser->warn_msg); + $message_parser->warn_msg = array(); + } + + if (!$preview || !empty($message_parser->message)) + { + $message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $flash_status, $quote_status, $config['allow_post_links']); + } + + // On a refresh we do not care about message parsing errors + if (sizeof($message_parser->warn_msg) && $refresh && !$preview) + { + $message_parser->warn_msg = array(); + } + } + else + { + $message_parser->bbcode_bitfield = $post_data['bbcode_bitfield']; + } + + if ($mode != 'edit' && !$preview && !$refresh && $config['flood_interval'] && !$auth->acl_get('f_ignoreflood', $forum_id)) + { + // Flood check + $last_post_time = 0; + + if ($user->data['is_registered']) + { + $last_post_time = $user->data['user_lastpost_time']; + } + else + { + $sql = 'SELECT post_time AS last_post_time + FROM ' . POSTS_TABLE . " + WHERE poster_ip = '" . $user->ip . "' + AND post_time > " . ($current_time - $config['flood_interval']); + $result = $db->sql_query_limit($sql, 1); + if ($row = $db->sql_fetchrow($result)) + { + $last_post_time = $row['last_post_time']; + } + $db->sql_freeresult($result); + } + + if ($last_post_time && ($current_time - $last_post_time) < intval($config['flood_interval'])) + { + $error[] = $user->lang['FLOOD_ERROR']; + } + } + + // Validate username + if (($post_data['username'] && !$user->data['is_registered']) || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS && $post_data['username'] && $post_data['post_username'] && $post_data['post_username'] != $post_data['username'])) + { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + $user->add_lang('ucp'); + + if (($result = validate_username($post_data['username'], (!empty($post_data['post_username'])) ? $post_data['post_username'] : '')) !== false) + { + $error[] = $user->lang[$result . '_USERNAME']; + } + + if (($result = validate_string($post_data['username'], false, $config['min_name_chars'], $config['max_name_chars'])) !== false) + { + $min_max_amount = ($result == 'TOO_SHORT') ? $config['min_name_chars'] : $config['max_name_chars']; + $error[] = $user->lang('FIELD_' . $result, $min_max_amount, $user->lang['USERNAME']); + } + } + + 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)), + ); + $vc_response = $captcha->validate($captcha_data); + if ($vc_response) + { + $error[] = $vc_response; + } + } + + // check form + if (($submit || $preview) && !check_form_key('posting')) + { + $error[] = $user->lang['FORM_INVALID']; + } + + if ($submit && $mode == 'edit' && $post_data['post_visibility'] == ITEM_DELETED && !isset($_POST['soft_delete']) && $auth->acl_get('m_approve', $forum_id)) + { + $is_first_post = ($post_id == $post_data['topic_first_post_id'] || !$post_data['topic_posts_approved']); + $is_last_post = ($post_id == $post_data['topic_last_post_id'] || !$post_data['topic_posts_approved']); + $updated_post_data = $phpbb_content_visibility->set_post_visibility(ITEM_APPROVED, $post_id, $post_data['topic_id'], $post_data['forum_id'], $user->data['user_id'], time(), '', $is_first_post, $is_last_post); + + if (!empty($updated_post_data)) + { + // Update the post_data, so we don't need to refetch it. + $post_data = array_merge($post_data, $updated_post_data); + } + } + + // Parse subject + if (!$preview && !$refresh && utf8_clean_string($post_data['post_subject']) === '' && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id))) + { + $error[] = $user->lang['EMPTY_SUBJECT']; + } + + // 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', $post_data['post_subject'], $matches)) + { + $character_list = implode('
', $matches[0]); + $error[] = $user->lang('UNSUPPORTED_CHARACTERS_SUBJECT', $character_list); + } + + $post_data['poll_last_vote'] = (isset($post_data['poll_last_vote'])) ? $post_data['poll_last_vote'] : 0; + + if ($post_data['poll_option_text'] && + ($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id']/* && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id))*/)) + && $auth->acl_get('f_poll', $forum_id)) + { + $poll = array( + 'poll_title' => $post_data['poll_title'], + 'poll_length' => $post_data['poll_length'], + 'poll_max_options' => $post_data['poll_max_options'], + 'poll_option_text' => $post_data['poll_option_text'], + 'poll_start' => $post_data['poll_start'], + 'poll_last_vote' => $post_data['poll_last_vote'], + 'poll_vote_change' => $post_data['poll_vote_change'], + 'enable_bbcode' => $post_data['enable_bbcode'], + 'enable_urls' => $post_data['enable_urls'], + 'enable_smilies' => $post_data['enable_smilies'], + 'img_status' => $img_status + ); + + $message_parser->parse_poll($poll); + + $post_data['poll_options'] = (isset($poll['poll_options'])) ? $poll['poll_options'] : array(); + $post_data['poll_title'] = (isset($poll['poll_title'])) ? $poll['poll_title'] : ''; + + /* We reset votes, therefore also allow removing options + if ($post_data['poll_last_vote'] && ($poll['poll_options_size'] < $orig_poll_options_size)) + { + $message_parser->warn_msg[] = $user->lang['NO_DELETE_POLL_OPTIONS']; + }*/ + } + else if ($mode == 'edit' && $post_id == $post_data['topic_first_post_id'] && $auth->acl_get('f_poll', $forum_id)) + { + // The user removed all poll options, this is equal to deleting the poll. + $poll = array( + 'poll_title' => '', + 'poll_length' => 0, + 'poll_max_options' => 0, + 'poll_option_text' => '', + 'poll_start' => 0, + 'poll_last_vote' => 0, + 'poll_vote_change' => 0, + 'poll_options' => array(), + ); + + $post_data['poll_options'] = array(); + $post_data['poll_title'] = ''; + $post_data['poll_start'] = $post_data['poll_length'] = $post_data['poll_max_options'] = $post_data['poll_last_vote'] = $post_data['poll_vote_change'] = 0; + } + else if (!$auth->acl_get('f_poll', $forum_id) && ($mode == 'edit') && ($post_id == $post_data['topic_first_post_id']) && ($original_poll_data['poll_title'] != '')) + { + // We have a poll but the editing user is not permitted to create/edit it. + // So we just keep the original poll-data. + $poll = array_merge($original_poll_data, array( + 'enable_bbcode' => $post_data['enable_bbcode'], + 'enable_urls' => $post_data['enable_urls'], + 'enable_smilies' => $post_data['enable_smilies'], + 'img_status' => $img_status, + )); + + $message_parser->parse_poll($poll); + + $post_data['poll_options'] = (isset($poll['poll_options'])) ? $poll['poll_options'] : array(); + $post_data['poll_title'] = (isset($poll['poll_title'])) ? $poll['poll_title'] : ''; + } + else + { + $poll = array(); + } + + // Check topic type + if ($post_data['topic_type'] != POST_NORMAL && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id))) + { + switch ($post_data['topic_type']) + { + case POST_GLOBAL: + case POST_ANNOUNCE: + $auth_option = 'f_announce'; + break; + + case POST_STICKY: + $auth_option = 'f_sticky'; + break; + + default: + $auth_option = ''; + break; + } + + if ($auth_option != '' && !$auth->acl_get($auth_option, $forum_id)) + { + // There is a special case where a user edits his post whereby the topic type got changed by an admin/mod. + // Another case would be a mod not having sticky permissions for example but edit permissions. + if ($mode == 'edit') + { + // To prevent non-authed users messing around with the topic type we reset it to the original one. + $post_data['topic_type'] = $post_data['orig_topic_type']; + } + else + { + $error[] = $user->lang['CANNOT_POST_' . str_replace('F_', '', strtoupper($auth_option))]; + } + } + } + + if (sizeof($message_parser->warn_msg)) + { + $error[] = implode('
', $message_parser->warn_msg); + } + + // DNSBL check + if ($config['check_dnsbl'] && !$refresh) + { + if (($dnsbl = $user->check_dnsbl('post')) !== false) + { + $error[] = sprintf($user->lang['IP_BLACKLISTED'], $user->ip, $dnsbl[1]); + } + } + + /** + * This event allows you to define errors before the post action is performed + * + * @event core.posting_modify_submission_errors + * @var array post_data Array with post data + * @var string mode What action to take if the form is submitted + * post|reply|quote|edit|delete|bump|smilies|popup + * @var string page_title Title of the mode page + * @var int post_id ID of the post + * @var int topic_id ID of the topic + * @var int forum_id ID of the forum + * @var bool submit Whether or not the form has been submitted + * @var array error Any error strings; a non-empty array aborts form submission. + * NOTE: Should be actual language strings, NOT language keys. + * @since 3.1.0-RC5 + */ + $vars = array( + 'post_data', + 'mode', + 'page_title', + 'post_id', + 'topic_id', + 'forum_id', + 'submit', + 'error', + ); + extract($phpbb_dispatcher->trigger_event('core.posting_modify_submission_errors', compact($vars))); + + // Store message, sync counters + if (!sizeof($error) && $submit) + { + if ($submit) + { + // Lock/Unlock Topic + $change_topic_status = $post_data['topic_status']; + $perm_lock_unlock = ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && !empty($post_data['topic_poster']) && $user->data['user_id'] == $post_data['topic_poster'] && $post_data['topic_status'] == ITEM_UNLOCKED)) ? true : false; + + if ($post_data['topic_status'] == ITEM_LOCKED && !$topic_lock && $perm_lock_unlock) + { + $change_topic_status = ITEM_UNLOCKED; + } + else if ($post_data['topic_status'] == ITEM_UNLOCKED && $topic_lock && $perm_lock_unlock) + { + $change_topic_status = ITEM_LOCKED; + } + + if ($change_topic_status != $post_data['topic_status']) + { + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_status = $change_topic_status + WHERE topic_id = $topic_id + AND topic_moved_id = 0"; + $db->sql_query($sql); + + $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']); + } + + // Lock/Unlock Post Edit + if ($mode == 'edit' && $post_data['post_edit_locked'] == ITEM_LOCKED && !$post_lock && $auth->acl_get('m_edit', $forum_id)) + { + $post_data['post_edit_locked'] = ITEM_UNLOCKED; + } + else if ($mode == 'edit' && $post_data['post_edit_locked'] == ITEM_UNLOCKED && $post_lock && $auth->acl_get('m_edit', $forum_id)) + { + $post_data['post_edit_locked'] = ITEM_LOCKED; + } + + $data = array( + 'topic_title' => (empty($post_data['topic_title'])) ? $post_data['post_subject'] : $post_data['topic_title'], + 'topic_first_post_id' => (isset($post_data['topic_first_post_id'])) ? (int) $post_data['topic_first_post_id'] : 0, + 'topic_last_post_id' => (isset($post_data['topic_last_post_id'])) ? (int) $post_data['topic_last_post_id'] : 0, + 'topic_time_limit' => (int) $post_data['topic_time_limit'], + 'topic_attachment' => (isset($post_data['topic_attachment'])) ? (int) $post_data['topic_attachment'] : 0, + 'post_id' => (int) $post_id, + 'topic_id' => (int) $topic_id, + 'forum_id' => (int) $forum_id, + 'icon_id' => (int) $post_data['icon_id'], + 'poster_id' => (int) $post_data['poster_id'], + 'enable_sig' => (bool) $post_data['enable_sig'], + 'enable_bbcode' => (bool) $post_data['enable_bbcode'], + 'enable_smilies' => (bool) $post_data['enable_smilies'], + 'enable_urls' => (bool) $post_data['enable_urls'], + 'enable_indexing' => (bool) $post_data['enable_indexing'], + 'message_md5' => (string) $message_md5, + 'post_time' => (isset($post_data['post_time'])) ? (int) $post_data['post_time'] : $current_time, + 'post_checksum' => (isset($post_data['post_checksum'])) ? (string) $post_data['post_checksum'] : '', + 'post_edit_reason' => $post_data['post_edit_reason'], + 'post_edit_user' => ($mode == 'edit') ? $user->data['user_id'] : ((isset($post_data['post_edit_user'])) ? (int) $post_data['post_edit_user'] : 0), + 'forum_parents' => $post_data['forum_parents'], + 'forum_name' => $post_data['forum_name'], + 'notify' => $notify, + 'notify_set' => $post_data['notify_set'], + 'poster_ip' => (isset($post_data['poster_ip'])) ? $post_data['poster_ip'] : $user->ip, + 'post_edit_locked' => (int) $post_data['post_edit_locked'], + 'bbcode_bitfield' => $message_parser->bbcode_bitfield, + 'bbcode_uid' => $message_parser->bbcode_uid, + 'message' => $message_parser->message, + 'attachment_data' => $message_parser->attachment_data, + 'filename_data' => $message_parser->filename_data, + + 'topic_visibility' => (isset($post_data['topic_visibility'])) ? $post_data['topic_visibility'] : false, + 'post_visibility' => (isset($post_data['post_visibility'])) ? $post_data['post_visibility'] : false, + ); + + if ($mode == 'edit') + { + $data['topic_posts_approved'] = $post_data['topic_posts_approved']; + $data['topic_posts_unapproved'] = $post_data['topic_posts_unapproved']; + $data['topic_posts_softdeleted'] = $post_data['topic_posts_softdeleted']; + } + + // Only return the username when it is either a guest posting or we are editing a post and + // the username was supplied; otherwise post_data might hold the data of the post that is + // being quoted (which could result in the username being returned being that of the quoted + // post's poster, not the poster of the current post). See: PHPBB3-11769 for more information. + $post_author_name = ((!$user->data['is_registered'] || $mode == 'edit') && $post_data['username'] !== '') ? $post_data['username'] : ''; + + /** + * This event allows you to define errors before the post action is performed + * + * @event core.posting_modify_submit_post_before + * @var array post_data Array with post data + * @var array poll Array with poll data + * @var array data Array with post data going to be stored in the database + * @var string mode What action to take if the form is submitted + * post|reply|quote|edit|delete + * @var string page_title Title of the mode page + * @var int post_id ID of the post + * @var int topic_id ID of the topic + * @var int forum_id ID of the forum + * @var string post_author_name Author name for guest posts + * @var bool update_message Boolean if the post message was changed + * @var bool update_subject Boolean if the post subject was changed + * @var bool submit Whether or not the form has been submitted + * @var array error Any error strings; a non-empty array aborts form submission. + * NOTE: Should be actual language strings, NOT language keys. + * @since 3.1.0-RC5 + */ + $vars = array( + 'post_data', + 'poll', + 'data', + 'mode', + 'page_title', + 'post_id', + 'topic_id', + 'forum_id', + 'post_author_name', + 'update_message', + 'update_subject', + 'submit', + 'error', + ); + extract($phpbb_dispatcher->trigger_event('core.posting_modify_submit_post_before', compact($vars))); + + // The last parameter tells submit_post if search indexer has to be run + $redirect_url = submit_post($mode, $post_data['post_subject'], $post_author_name, $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false); + + /** + * This event allows you to define errors after the post action is performed + * + * @event core.posting_modify_submit_post_after + * @var array post_data Array with post data + * @var array poll Array with poll data + * @var array data Array with post data going to be stored in the database + * @var string mode What action to take if the form is submitted + * post|reply|quote|edit|delete + * @var string page_title Title of the mode page + * @var int post_id ID of the post + * @var int topic_id ID of the topic + * @var int forum_id ID of the forum + * @var string post_author_name Author name for guest posts + * @var bool update_message Boolean if the post message was changed + * @var bool update_subject Boolean if the post subject was changed + * @var string redirect_url URL the user is going to be redirected to + * @var bool submit Whether or not the form has been submitted + * @var array error Any error strings; a non-empty array aborts form submission. + * NOTE: Should be actual language strings, NOT language keys. + * @since 3.1.0-RC5 + */ + $vars = array( + 'post_data', + 'poll', + 'data', + 'mode', + 'page_title', + 'post_id', + 'topic_id', + 'forum_id', + 'post_author_name', + 'update_message', + 'update_subject', + 'redirect_url', + 'submit', + 'error', + ); + extract($phpbb_dispatcher->trigger_event('core.posting_modify_submit_post_after', compact($vars))); + + if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === true) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote')) + { + $captcha->reset(); + } + + // Handle delete mode... + if ($request->is_set_post('delete') || $request->is_set_post('delete_permanent')) + { + $delete_reason = $request->variable('delete_reason', '', true); + phpbb_handle_post_delete($forum_id, $topic_id, $post_id, $post_data, !$request->is_set_post('delete_permanent'), $delete_reason); + return; + } + + // Check the permissions for post approval. + // Moderators must go through post approval like ordinary users. + if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && empty($data['force_approved_state'])) || (isset($data['force_approved_state']) && !$data['force_approved_state'])) + { + meta_refresh(10, $redirect_url); + $message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD']; + $message .= (($user->data['user_id'] == ANONYMOUS) ? '' : ' '. $user->lang['POST_APPROVAL_NOTIFY']); + $message .= '

' . sprintf($user->lang['RETURN_FORUM'], '', ''); + trigger_error($message); + } + + redirect($redirect_url); + } + } +} + +// Preview +if (!sizeof($error) && $preview) +{ + $post_data['post_time'] = ($mode == 'edit') ? $post_data['post_time'] : $current_time; + + $preview_message = $message_parser->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies'], false); + + $preview_signature = ($mode == 'edit') ? $post_data['user_sig'] : $user->data['user_sig']; + $preview_signature_uid = ($mode == 'edit') ? $post_data['user_sig_bbcode_uid'] : $user->data['user_sig_bbcode_uid']; + $preview_signature_bitfield = ($mode == 'edit') ? $post_data['user_sig_bbcode_bitfield'] : $user->data['user_sig_bbcode_bitfield']; + + // 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); + } + else + { + $preview_signature = ''; + } + + $preview_subject = censor_text($post_data['post_subject']); + + // Poll Preview + if (!$poll_delete && ($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id']/* && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id))*/)) + && $auth->acl_get('f_poll', $forum_id)) + { + $parse_poll = new parse_message($post_data['poll_title']); + $parse_poll->bbcode_uid = $message_parser->bbcode_uid; + $parse_poll->bbcode_bitfield = $message_parser->bbcode_bitfield; + + $parse_poll->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies']); + + if ($post_data['poll_length']) + { + $poll_end = ($post_data['poll_length'] * 86400) + (($post_data['poll_start']) ? $post_data['poll_start'] : time()); + } + + $template->assign_vars(array( + 'S_HAS_POLL_OPTIONS' => (sizeof($post_data['poll_options'])), + 'S_IS_MULTI_CHOICE' => ($post_data['poll_max_options'] > 1) ? true : false, + + 'POLL_QUESTION' => $parse_poll->message, + + 'L_POLL_LENGTH' => ($post_data['poll_length']) ? sprintf($user->lang['POLL_RUN_TILL'], $user->format_date($poll_end)) : '', + 'L_MAX_VOTES' => $user->lang('MAX_OPTIONS_SELECT', (int) $post_data['poll_max_options']), + )); + + $parse_poll->message = implode("\n", $post_data['poll_options']); + $parse_poll->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies']); + $preview_poll_options = explode('
', $parse_poll->message); + unset($parse_poll); + + foreach ($preview_poll_options as $key => $option) + { + $template->assign_block_vars('poll_option', array( + 'POLL_OPTION_CAPTION' => $option, + 'POLL_OPTION_ID' => $key + 1) + ); + } + unset($preview_poll_options); + } + + // Attachment Preview + if (sizeof($message_parser->attachment_data)) + { + $template->assign_var('S_HAS_ATTACHMENTS', true); + + $update_count = array(); + $attachment_data = $message_parser->attachment_data; + + parse_attachments($forum_id, $preview_message, $attachment_data, $update_count, true); + + foreach ($attachment_data as $i => $attachment) + { + $template->assign_block_vars('attachment', array( + 'DISPLAY_ATTACHMENT' => $attachment) + ); + } + unset($attachment_data); + } + + if (!sizeof($error)) + { + $template->assign_vars(array( + 'PREVIEW_SUBJECT' => $preview_subject, + 'PREVIEW_MESSAGE' => $preview_message, + 'PREVIEW_SIGNATURE' => $preview_signature, + + 'S_DISPLAY_PREVIEW' => !empty($preview_message), + )); + } +} + +// Decode text for message display +$post_data['bbcode_uid'] = ($mode == 'quote' && !$preview && !$refresh && !sizeof($error)) ? $post_data['bbcode_uid'] : $message_parser->bbcode_uid; +$message_parser->decode_message($post_data['bbcode_uid']); + +if ($mode == 'quote' && !$submit && !$preview && !$refresh) +{ + if ($config['allow_bbcode']) + { + $message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n"; + } + else + { + $offset = 0; + $quote_string = "> "; + $message = censor_text(trim($message_parser->message)); + // see if we are nesting. It's easily tricked but should work for one level of nesting + if (strpos($message, ">") !== false) + { + $offset = 10; + } + $message = utf8_wordwrap($message, 75 + $offset, "\n"); + + $message = $quote_string . $message; + $message = str_replace("\n", "\n" . $quote_string, $message); + $message_parser->message = $post_data['quote_username'] . " " . $user->lang['WROTE'] . ":\n" . $message . "\n"; + } +} + +if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh) +{ + $post_data['post_subject'] = ((strpos($post_data['post_subject'], 'Re: ') !== 0) ? 'Re: ' : '') . censor_text($post_data['post_subject']); +} + +$attachment_data = $message_parser->attachment_data; +$filename_data = $message_parser->filename_data; +$post_data['post_text'] = $message_parser->message; + +if (sizeof($post_data['poll_options']) || !empty($post_data['poll_title'])) +{ + $message_parser->message = $post_data['poll_title']; + $message_parser->bbcode_uid = $post_data['bbcode_uid']; + + $message_parser->decode_message(); + $post_data['poll_title'] = $message_parser->message; + + $message_parser->message = implode("\n", $post_data['poll_options']); + $message_parser->decode_message(); + $post_data['poll_options'] = explode("\n", $message_parser->message); +} + +// MAIN POSTING PAGE BEGINS HERE + +// Forum moderators? +$moderators = array(); +if ($config['load_moderators']) +{ + get_moderators($moderators, $forum_id); +} + +// Generate smiley listing +generate_smilies('inline', $forum_id); + +// Generate inline attachment select box +posting_gen_inline_attachments($attachment_data); + +// Do show topic type selection only in first post. +$topic_type_toggle = false; + +if ($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id'])) +{ + $topic_type_toggle = posting_gen_topic_types($forum_id, $post_data['topic_type']); +} + +$s_topic_icons = false; +if ($post_data['enable_icons'] && $auth->acl_get('f_icons', $forum_id)) +{ + $s_topic_icons = posting_gen_topic_icons($mode, $post_data['icon_id']); +} + +$bbcode_checked = (isset($post_data['enable_bbcode'])) ? !$post_data['enable_bbcode'] : (($config['allow_bbcode']) ? !$user->optionget('bbcode') : 1); +$smilies_checked = (isset($post_data['enable_smilies'])) ? !$post_data['enable_smilies'] : (($config['allow_smilies']) ? !$user->optionget('smilies') : 1); +$urls_checked = (isset($post_data['enable_urls'])) ? !$post_data['enable_urls'] : 0; +$sig_checked = $post_data['enable_sig']; +$lock_topic_checked = (isset($topic_lock) && $topic_lock) ? $topic_lock : (($post_data['topic_status'] == ITEM_LOCKED) ? 1 : 0); +$lock_post_checked = (isset($post_lock)) ? $post_lock : $post_data['post_edit_locked']; + +// If the user is replying or posting and not already watching this topic but set to always being notified we need to overwrite this setting +$notify_set = ($mode != 'edit' && $config['allow_topic_notify'] && $user->data['is_registered'] && !$post_data['notify_set']) ? $user->data['user_notify'] : $post_data['notify_set']; +$notify_checked = (isset($notify)) ? $notify : (($mode == 'post') ? $user->data['user_notify'] : $notify_set); + +// Page title & action URL +$s_action = append_sid("{$phpbb_root_path}posting.$phpEx", "mode=$mode&f=$forum_id"); +$s_action .= ($topic_id) ? "&t=$topic_id" : ''; +$s_action .= ($post_id) ? "&p=$post_id" : ''; + +switch ($mode) +{ + case 'post': + $page_title = $user->lang['POST_TOPIC']; + break; + + case 'quote': + case 'reply': + $page_title = $user->lang['POST_REPLY']; + break; + + case 'delete': + case 'edit': + $page_title = $user->lang['EDIT_POST']; + break; +} + +// Build Navigation Links +generate_forum_nav($post_data); + +// Build Forum Rules +generate_forum_rules($post_data); + +// Posting uses is_solved for legacy reasons. Plugins have to use is_solved to force themselves to be displayed. +if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === false) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote')) +{ + + $template->assign_vars(array( + 'S_CONFIRM_CODE' => true, + 'CAPTCHA_TEMPLATE' => $captcha->get_template(), + )); +} + +$s_hidden_fields = ($mode == 'reply' || $mode == 'quote') ? '' : ''; +$s_hidden_fields .= ''; +$s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '' : ''; + +if ($mode == 'edit') +{ + $s_hidden_fields .= build_hidden_fields(array( + 'edit_post_message_checksum' => $post_data['post_checksum'], + 'edit_post_subject_checksum' => $post_data['post_subject_md5'], + )); +} + +// Add the confirm id/code pair to the hidden fields, else an error is displayed on next submit/preview +if (isset($captcha) && $captcha->is_solved() !== false) +{ + $s_hidden_fields .= build_hidden_fields($captcha->get_hidden_fields()); +} + +$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'); + + +// Build array of variables for main posting page +$page_data = array( + 'L_POST_A' => $page_title, + 'L_ICON' => ($mode == 'reply' || $mode == 'quote' || ($mode == 'edit' && $post_id != $post_data['topic_first_post_id'])) ? $user->lang['POST_ICON'] : $user->lang['TOPIC_ICON'], + 'L_MESSAGE_BODY_EXPLAIN' => $user->lang('MESSAGE_BODY_EXPLAIN', (int) $config['max_post_chars']), + + 'FORUM_NAME' => $post_data['forum_name'], + 'FORUM_DESC' => ($post_data['forum_desc']) ? generate_text_for_display($post_data['forum_desc'], $post_data['forum_desc_uid'], $post_data['forum_desc_bitfield'], $post_data['forum_desc_options']) : '', + 'TOPIC_TITLE' => censor_text($post_data['topic_title']), + 'MODERATORS' => (sizeof($moderators)) ? implode($user->lang['COMMA_SEPARATOR'], $moderators[$forum_id]) : '', + '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'], '', '') : sprintf($user->lang['BBCODE_IS_OFF'], '', ''), + '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'], + 'URL_STATUS' => ($bbcode_status && $url_status) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'], + 'MAX_FONT_SIZE' => (int) $config['max_post_font_size'], + 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']), + 'POST_DATE' => ($post_data['post_time']) ? $user->format_date($post_data['post_time']) : '', + 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', + 'TOPIC_TIME_LIMIT' => (int) $post_data['topic_time_limit'], + 'EDIT_REASON' => $request->variable('edit_reason', '', true), + 'SHOW_PANEL' => $request->variable('show_panel', ''), + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id"), + 'U_VIEW_TOPIC' => ($mode != 'post') ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id") : '', + 'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&mode=popup"), + 'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&mode=popup")), + + 'S_PRIVMSGS' => false, + 'S_CLOSE_PROGRESS_WINDOW' => (isset($_POST['add_file'])) ? true : false, + 'S_EDIT_POST' => ($mode == 'edit') ? true : false, + 'S_EDIT_REASON' => ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false, + 'S_DISPLAY_USERNAME' => (!$user->data['is_registered'] || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS)) ? true : false, + 'S_SHOW_TOPIC_ICONS' => $s_topic_icons, + 'S_DELETE_ALLOWED' => ($mode == 'edit' && (($post_id == $post_data['topic_last_post_id'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id) && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time'])) || $auth->acl_get('m_delete', $forum_id))) ? true : false, + 'S_BBCODE_ALLOWED' => ($bbcode_status) ? 1 : 0, + 'S_BBCODE_CHECKED' => ($bbcode_checked) ? ' checked="checked"' : '', + 'S_SMILIES_ALLOWED' => $smilies_status, + 'S_SMILIES_CHECKED' => ($smilies_checked) ? ' checked="checked"' : '', + 'S_SIG_ALLOWED' => ($auth->acl_get('f_sigs', $forum_id) && $config['allow_sig'] && $user->data['is_registered']) ? true : false, + 'S_SIGNATURE_CHECKED' => ($sig_checked) ? ' checked="checked"' : '', + 'S_NOTIFY_ALLOWED' => (!$user->data['is_registered'] || ($mode == 'edit' && $user->data['user_id'] != $post_data['poster_id']) || !$config['allow_topic_notify'] || !$config['email_enable']) ? false : true, + 'S_NOTIFY_CHECKED' => ($notify_checked) ? ' checked="checked"' : '', + 'S_LOCK_TOPIC_ALLOWED' => (($mode == 'edit' || $mode == 'reply' || $mode == 'quote') && ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && !empty($post_data['topic_poster']) && $user->data['user_id'] == $post_data['topic_poster'] && $post_data['topic_status'] == ITEM_UNLOCKED))) ? true : false, + 'S_LOCK_TOPIC_CHECKED' => ($lock_topic_checked) ? ' checked="checked"' : '', + 'S_LOCK_POST_ALLOWED' => ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false, + 'S_LOCK_POST_CHECKED' => ($lock_post_checked) ? ' checked="checked"' : '', + 'S_SOFTDELETE_CHECKED' => ($mode == 'edit' && $post_data['post_visibility'] == ITEM_DELETED) ? ' checked="checked"' : '', + 'S_SOFTDELETE_ALLOWED' => ($mode == 'edit' && $phpbb_content_visibility->can_soft_delete($forum_id, $post_data['poster_id'], $lock_post_checked)) ? true : false, + 'S_RESTORE_ALLOWED' => $auth->acl_get('m_approve', $forum_id), + 'S_IS_DELETED' => ($mode == 'edit' && $post_data['post_visibility'] == ITEM_DELETED) ? true : false, + 'S_LINKS_ALLOWED' => $url_status, + 'S_MAGIC_URL_CHECKED' => ($urls_checked) ? ' checked="checked"' : '', + 'S_TYPE_TOGGLE' => $topic_type_toggle, + 'S_SAVE_ALLOWED' => ($auth->acl_get('u_savedrafts') && $user->data['is_registered'] && $mode != 'edit') ? true : false, + 'S_HAS_DRAFTS' => ($auth->acl_get('u_savedrafts') && $user->data['is_registered'] && $post_data['drafts']) ? true : false, + 'S_FORM_ENCTYPE' => $form_enctype, + + 'S_BBCODE_IMG' => $img_status, + 'S_BBCODE_URL' => $url_status, + 'S_BBCODE_FLASH' => $flash_status, + 'S_BBCODE_QUOTE' => $quote_status, + + 'S_POST_ACTION' => $s_action, + 'S_HIDDEN_FIELDS' => $s_hidden_fields, + 'S_ATTACH_DATA' => json_encode($message_parser->attachment_data), + 'S_IN_POSTING' => true, +); + +/** +* This event allows you to modify template variables for the posting screen +* +* @event core.posting_modify_template_vars +* @var array post_data Array with post data +* @var array moderators Array with forum moderators +* @var string mode What action to take if the form is submitted +* post|reply|quote|edit|delete|bump|smilies|popup +* @var string page_title Title of the mode page +* @var bool s_topic_icons Whether or not to show the topic icons +* @var string form_enctype If attachments are allowed for this form +* "multipart/form-data" or empty string +* @var string s_action The URL to submit the POST data to +* @var string s_hidden_fields Concatenated hidden input tags of posting form +* @var int post_id ID of the post +* @var int topic_id ID of the topic +* @var int forum_id ID of the forum +* @var bool submit Whether or not the form has been submitted +* @var bool preview Whether or not the post is being previewed +* @var bool save Whether or not a draft is being saved +* @var bool load Whether or not a draft is being loaded +* @var bool cancel Whether or not to cancel the form (returns to +* viewtopic or viewforum depending on if the user +* is posting a new topic or editing a post) +* @var array error Any error strings; a non-empty array aborts +* form submission. +* NOTE: Should be actual language strings, NOT +* language keys. +* @var bool refresh Whether or not to retain previously submitted data +* @var array page_data Posting page data that should be passed to the +* posting page via $template->assign_vars() +* @var object message_parser The message parser object +* @since 3.1.0-a1 +* @change 3.1.0-b3 Added vars post_data, moderators, mode, page_title, +* s_topic_icons, form_enctype, s_action, s_hidden_fields, +* post_id, topic_id, forum_id, submit, preview, save, load, +* delete, cancel, refresh, error, page_data, message_parser +* @change 3.1.2-RC1 Removed 'delete' var as it does not exist +*/ +$vars = array( + 'post_data', + 'moderators', + 'mode', + 'page_title', + 's_topic_icons', + 'form_enctype', + 's_action', + 's_hidden_fields', + 'post_id', + 'topic_id', + 'forum_id', + 'submit', + 'preview', + 'save', + 'load', + 'cancel', + 'refresh', + 'error', + 'page_data', + 'message_parser', +); +extract($phpbb_dispatcher->trigger_event('core.posting_modify_template_vars', compact($vars))); + +// Start assigning vars for main posting page ... +$template->assign_vars($page_data); + +// Build custom bbcodes array +display_custom_bbcodes(); + +// Poll entry +if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id']/* && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id))*/)) + && $auth->acl_get('f_poll', $forum_id)) +{ + $template->assign_vars(array( + 'S_SHOW_POLL_BOX' => true, + 'S_POLL_VOTE_CHANGE' => ($auth->acl_get('f_votechg', $forum_id) && $auth->acl_get('f_vote', $forum_id)), + 'S_POLL_DELETE' => ($mode == 'edit' && sizeof($post_data['poll_options']) && ((!$post_data['poll_last_vote'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))), + 'S_POLL_DELETE_CHECKED' => (!empty($poll_delete)) ? true : false, + + 'L_POLL_OPTIONS_EXPLAIN' => $user->lang('POLL_OPTIONS_' . (($mode == 'edit') ? 'EDIT_' : '') . 'EXPLAIN', (int) $config['max_poll_options']), + + 'VOTE_CHANGE_CHECKED' => (!empty($post_data['poll_vote_change'])) ? ' checked="checked"' : '', + 'POLL_TITLE' => (isset($post_data['poll_title'])) ? $post_data['poll_title'] : '', + 'POLL_OPTIONS' => (!empty($post_data['poll_options'])) ? implode("\n", $post_data['poll_options']) : '', + 'POLL_MAX_OPTIONS' => (isset($post_data['poll_max_options'])) ? (int) $post_data['poll_max_options'] : 1, + 'POLL_LENGTH' => $post_data['poll_length']) + ); +} + +// Show attachment box for adding attachments if true +$allowed = ($auth->acl_get('f_attach', $forum_id) && $auth->acl_get('u_attach') && $config['allow_attachments'] && $form_enctype); + +if ($allowed) +{ + $max_files = ($auth->acl_get('a_') || $auth->acl_get('m_', $forum_id)) ? 0 : (int) $config['max_attachments']; + $plupload->configure($cache, $template, $s_action, $forum_id, $max_files); +} + +// Attachment entry +posting_gen_attachment_entry($attachment_data, $filename_data, $allowed); + +// Output page ... +page_header($page_title); + +$template->set_filenames(array( + 'body' => 'posting_body.html') +); + +make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); + +// Topic review +if ($mode == 'reply' || $mode == 'quote') +{ + if (topic_review($topic_id, $forum_id)) + { + $template->assign_var('S_DISPLAY_REVIEW', true); + } +} + +page_footer(); diff --git a/sources/phpBB/report.php b/sources/phpBB/report.php new file mode 100644 index 0000000..3ea6bb4 --- /dev/null +++ b/sources/phpBB/report.php @@ -0,0 +1,338 @@ + +* @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); +$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&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 .= '

' . sprintf($user->lang['RETURN_TOPIC'], '', ''); + $message .= '

' . sprintf($user->lang['RETURN_FORUM'], '', ''); + 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 .= '

' . sprintf($user->lang['RETURN_PM'], '', ''); + 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'); + } + + if (!sizeof($error)) + { + if (isset($captcha)) + { + $captcha->reset(); + } + + $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 . '

' . sprintf($lang_return, '', ''); + if ($return_forum_url) + { + $message .= '

' . sprintf($user->lang['RETURN_FORUM'], '', ''); + } + 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('
', $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 . '&p=' . $post_id . '&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') +); + +page_footer(); diff --git a/sources/phpBB/search.php b/sources/phpBB/search.php new file mode 100644 index 0000000..164d834 --- /dev/null +++ b/sources/phpBB/search.php @@ -0,0 +1,1383 @@ + +* @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); +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +include($phpbb_root_path . 'common.' . $phpEx); + +// Start session management +$user->session_begin(); +$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'); +$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); + +$sort_days = request_var('st', 0); +$sort_key = request_var('sk', 't'); +$sort_dir = request_var('sd', 'd'); + +$return_chars = request_var('ch', ($topic_id) ? -1 : 300); +$search_forum = request_var('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 + +switch ($search_id) +{ + // Egosearch is an author search + case 'egosearch': + $author_id = $user->data['user_id']; + if ($user->data['user_id'] == ANONYMOUS) + { + login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']); + } + break; + + // Search for unread posts needs to be allowed and user to be logged in if topics tracking for guests is disabled + case 'unreadposts': + if (!$config['load_unreads_search']) + { + $template->assign_var('S_NO_SEARCH', true); + trigger_error('NO_SEARCH_UNREADS'); + } + else if (!$config['load_anon_lastread'] && !$user->data['is_registered']) + { + login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']); + } + break; + + // The "new posts" search uses user_lastvisit which is user based, so it should require user to log in. + case 'newposts': + if ($user->data['user_id'] == ANONYMOUS) + { + login_box('', $user->lang['LOGIN_EXPLAIN_NEWPOSTS']); + } + break; + + default: + // There's nothing to do here for now ;) + break; +} + +// Is user able to search? Has search been disabled? +if (!$auth->acl_get('u_search') || !$auth->acl_getf_global('f_search') || !$config['load_search']) +{ + $template->assign_var('S_NO_SEARCH', true); + trigger_error('NO_SEARCH'); +} + +// Check search load limit +if ($user->load && $config['limit_search_load'] && ($user->load > doubleval($config['limit_search_load']))) +{ + $template->assign_var('S_NO_SEARCH', true); + trigger_error('NO_SEARCH_LOAD'); +} + +// It is applicable if the configuration setting is non-zero, and the user cannot +// ignore the flood setting, and the search is a keyword search. +$interval = ($user->data['user_id'] == ANONYMOUS) ? $config['search_anonymous_interval'] : $config['search_interval']; +if ($interval && !in_array($search_id, array('unreadposts', 'unanswered', 'active_topics', 'egosearch')) && !$auth->acl_get('u_ignoreflood')) +{ + if ($user->data['user_last_search'] > time() - $interval) + { + $template->assign_var('S_NO_SEARCH', true); + trigger_error($user->lang('NO_SEARCH_TIME', (int) ($user->data['user_last_search'] + $interval - time()))); + } +} + +// Define some vars +$limit_days = array(0 => $user->lang['ALL_RESULTS'], 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_AUTHOR'], 't' => $user->lang['SORT_TIME'], 'f' => $user->lang['SORT_FORUM'], 'i' => $user->lang['SORT_TOPIC_TITLE'], 's' => $user->lang['SORT_POST_SUBJECT']); + +$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); + +$phpbb_content_visibility = $phpbb_container->get('content.visibility'); +$pagination = $phpbb_container->get('pagination'); + +if ($keywords || $author || $author_id || $search_id || $submit) +{ + // clear arrays + $id_ary = array(); + + // If we are looking for authors get their ids + $author_id_ary = array(); + $sql_author_match = ''; + if ($author_id) + { + $author_id_ary[] = $author_id; + } + else if ($author) + { + if ((strpos($author, '*') !== false) && (utf8_strlen(str_replace(array('*', '%'), '', $author)) < $config['min_search_author_chars'])) + { + trigger_error($user->lang('TOO_FEW_AUTHOR_CHARS', (int) $config['min_search_author_chars'])); + } + + $sql_where = (strpos($author, '*') !== false) ? ' username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($author))) : " username_clean = '" . $db->sql_escape(utf8_clean_string($author)) . "'"; + + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . " + WHERE $sql_where + AND user_type <> " . USER_IGNORE; + $result = $db->sql_query_limit($sql, 100); + + while ($row = $db->sql_fetchrow($result)) + { + $author_id_ary[] = (int) $row['user_id']; + } + $db->sql_freeresult($result); + + $sql_where = (strpos($author, '*') !== false) ? ' post_username ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($author))) : " post_username = '" . $db->sql_escape(utf8_clean_string($author)) . "'"; + + $sql = 'SELECT 1 as guest_post + FROM ' . POSTS_TABLE . " + WHERE $sql_where + AND poster_id = " . ANONYMOUS; + $result = $db->sql_query_limit($sql, 1); + $found_guest_post = $db->sql_fetchfield('guest_post'); + $db->sql_freeresult($result); + + if ($found_guest_post) + { + $author_id_ary[] = ANONYMOUS; + $sql_author_match = (strpos($author, '*') !== false) ? ' ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($author))) : " = '" . $db->sql_escape(utf8_clean_string($author)) . "'"; + } + + if (!sizeof($author_id_ary)) + { + trigger_error('NO_SEARCH_RESULTS'); + } + } + + // if we search in an existing search result just add the additional keywords. But we need to use "all search terms"-mode + // so we can keep the old keywords in their old mode, but add the new ones as required words + if ($add_keywords) + { + if ($search_terms == 'all') + { + $keywords .= ' ' . $add_keywords; + } + else + { + $search_terms = 'all'; + $keywords = implode(' |', explode(' ', preg_replace('#\s+#u', ' ', $keywords))) . ' ' .$add_keywords; + } + } + + // Which forums should not be searched? Author searches are also carried out in unindexed forums + if (empty($keywords) && sizeof($author_id_ary)) + { + $ex_fid_ary = array_keys($auth->acl_getf('!f_read', true)); + } + else + { + $ex_fid_ary = array_unique(array_merge(array_keys($auth->acl_getf('!f_read', true)), array_keys($auth->acl_getf('!f_search', true)))); + } + + $not_in_fid = (sizeof($ex_fid_ary)) ? 'WHERE ' . $db->sql_in_set('f.forum_id', $ex_fid_ary, true) . " OR (f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')' : ""; + + $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, f.forum_flags, fa.user_id + FROM ' . FORUMS_TABLE . ' f + LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id + AND fa.session_id = '" . $db->sql_escape($user->session_id) . "') + $not_in_fid + ORDER BY f.left_id"; + $result = $db->sql_query($sql); + + $right_id = 0; + $reset_search_forum = true; + while ($row = $db->sql_fetchrow($result)) + { + if ($row['forum_password'] && $row['user_id'] != $user->data['user_id']) + { + $ex_fid_ary[] = (int) $row['forum_id']; + continue; + } + + // Exclude forums from active topics + if (!($row['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) && ($search_id == 'active_topics')) + { + $ex_fid_ary[] = (int) $row['forum_id']; + continue; + } + + if (sizeof($search_forum)) + { + if ($search_child) + { + if (in_array($row['forum_id'], $search_forum) && $row['right_id'] > $right_id) + { + $right_id = (int) $row['right_id']; + } + else if ($row['right_id'] < $right_id) + { + continue; + } + } + + if (!in_array($row['forum_id'], $search_forum)) + { + $ex_fid_ary[] = (int) $row['forum_id']; + $reset_search_forum = false; + } + } + } + $db->sql_freeresult($result); + + // find out in which forums the user is allowed to view posts + $m_approve_posts_fid_sql = $phpbb_content_visibility->get_global_visibility_sql('post', $ex_fid_ary, 'p.'); + $m_approve_topics_fid_sql = $phpbb_content_visibility->get_global_visibility_sql('topic', $ex_fid_ary, 't.'); + + if ($reset_search_forum) + { + $search_forum = array(); + } + + // Select which method we'll use to obtain the post_id or topic_id information + $search_type = $config['search_type']; + + if (!class_exists($search_type)) + { + trigger_error('NO_SUCH_SEARCH_MODULE'); + } + // We do some additional checks in the module to ensure it can actually be utilised + $error = false; + $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); + + if ($error) + { + trigger_error($error); + } + + // let the search module split up the keywords + if ($keywords) + { + $correct_query = $search->split_keywords($keywords, $search_terms); + $common_words = $search->get_common_words(); + if (!$correct_query || (!$search->get_search_query() && !sizeof($author_id_ary) && !$search_id)) + { + $ignored = (sizeof($common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], implode(' ', $common_words)) . '
' : ''; + $word_length = $search->get_word_length(); + if ($word_length) + { + trigger_error($ignored . $user->lang('NO_KEYWORDS', $user->lang('CHARACTERS', (int) $word_length['min']), $user->lang('CHARACTERS', (int) $word_length['max']))); + } + else + { + trigger_error($ignored); + } + } + } + + 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 = ($show_results == 'posts') ? 'posts' : 'topics'; + } + + // define some variables needed for retrieving post_id/topic_id information + $sort_by_sql = array('a' => 'u.username_clean', 't' => (($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time'), 'f' => 'f.forum_id', 'i' => 't.topic_title', 's' => (($show_results == 'posts') ? 'p.post_subject' : 't.topic_title')); + + /** + * Event to modify the SQL parameters before pre-made searches + * + * @event core.search_modify_param_before + * @var string keywords String of the specified keywords + * @var array sort_by_sql Array of SQL sorting instructions + * @var array ex_fid_ary Array of excluded forum ids + * @var array author_id_ary Array of exclusive author ids + * @var string search_id The id of the search request + * @since 3.1.3-RC1 + */ + $vars = array( + 'keywords', + 'sort_by_sql', + 'ex_fid_ary', + 'author_id_ary', + 'search_id', + ); + extract($phpbb_dispatcher->trigger_event('core.search_modify_param_before', compact($vars))); + + // pre-made searches + $sql = $field = $l_search_title = ''; + if ($search_id) + { + switch ($search_id) + { + // Oh holy Bob, bring us some activity... + case 'active_topics': + $l_search_title = $user->lang['SEARCH_ACTIVE_TOPICS']; + $show_results = 'topics'; + $sort_key = 't'; + $sort_dir = 'd'; + $sort_days = request_var('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); + $s_sort_key = $s_sort_dir = ''; + + $last_post_time_sql = ($sort_days) ? ' AND t.topic_last_post_time > ' . (time() - ($sort_days * 24 * 3600)) : ''; + + $sql = 'SELECT t.topic_last_post_time, t.topic_id + FROM ' . TOPICS_TABLE . " t + WHERE t.topic_moved_id = 0 + $last_post_time_sql + AND " . $m_approve_topics_fid_sql . ' + ' . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . ' + ORDER BY t.topic_last_post_time DESC'; + $field = 'topic_id'; + break; + + case 'unanswered': + $l_search_title = $user->lang['SEARCH_UNANSWERED']; + $show_results = request_var('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'; + $sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); + + $sort_join = ($sort_key == 'f') ? FORUMS_TABLE . ' f, ' : ''; + $sql_sort = ($sort_key == 'f') ? ' AND f.forum_id = p.forum_id ' . $sql_sort : $sql_sort; + + if ($sort_days) + { + $last_post_time = 'AND p.post_time > ' . (time() - ($sort_days * 24 * 3600)); + } + else + { + $last_post_time = ''; + } + + if ($sort_key == 'a') + { + $sort_join = USERS_TABLE . ' u, '; + $sql_sort = ' AND u.user_id = p.poster_id ' . $sql_sort; + } + if ($show_results == 'posts') + { + $sql = "SELECT p.post_id + FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t + WHERE t.topic_posts_approved = 1 + AND p.topic_id = t.topic_id + $last_post_time + AND $m_approve_posts_fid_sql + " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . " + $sql_sort"; + $field = 'post_id'; + } + else + { + $sql = 'SELECT DISTINCT ' . $sort_by_sql[$sort_key] . ", p.topic_id + FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t + WHERE t.topic_posts_approved = 1 + AND t.topic_moved_id = 0 + AND p.topic_id = t.topic_id + $last_post_time + AND $m_approve_topics_fid_sql + " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . " + $sql_sort"; + $field = 'topic_id'; + } + break; + + case 'unreadposts': + $l_search_title = $user->lang['SEARCH_UNREAD']; + // force sorting + $show_results = 'topics'; + $sort_key = 't'; + $sort_by_sql['t'] = 't.topic_last_post_time'; + $sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); + + $sql_where = 'AND t.topic_moved_id = 0 + AND ' . $m_approve_topics_fid_sql . ' + ' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : ''); + + 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); + $s_sort_key = $s_sort_dir = $u_sort_param = $s_limit_days = ''; + break; + + case 'newposts': + $l_search_title = $user->lang['SEARCH_NEW']; + // force sorting + $show_results = (request_var('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'; + $sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); + + 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); + $s_sort_key = $s_sort_dir = $u_sort_param = $s_limit_days = ''; + + if ($show_results == 'posts') + { + $sql = 'SELECT p.post_id + FROM ' . POSTS_TABLE . ' p + WHERE p.post_time > ' . $user->data['user_lastvisit'] . ' + AND ' . $m_approve_posts_fid_sql . ' + ' . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . " + $sql_sort"; + $field = 'post_id'; + } + else + { + $sql = 'SELECT t.topic_id + FROM ' . TOPICS_TABLE . ' t + WHERE t.topic_last_post_time > ' . $user->data['user_lastvisit'] . ' + AND t.topic_moved_id = 0 + AND ' . $m_approve_topics_fid_sql . ' + ' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . " + $sql_sort"; +/* + [Fix] queued replies missing from "view new posts" (Bug #42705 - Patch by Paul) + - Creates temporary table, query is far from optimized + + $sql = 'SELECT t.topic_id + FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p + WHERE p.post_time > ' . $user->data['user_lastvisit'] . ' + AND t.topic_id = p.topic_id + AND t.topic_moved_id = 0 + AND ' . $m_approve_topics_fid_sql . " + GROUP BY t.topic_id + $sql_sort"; +*/ + $field = 'topic_id'; + } + break; + + case 'egosearch': + $l_search_title = $user->lang['SEARCH_SELF']; + break; + } + } + + // show_results should not change after this + $per_page = ($show_results == 'posts') ? $config['posts_per_page'] : $config['topics_per_page']; + $total_match_count = 0; + + // Set limit for the $total_match_count to reduce server load + $total_matches_limit = 1000; + $found_more_search_matches = false; + + if ($search_id) + { + if ($sql) + { + // Only return up to $total_matches_limit+1 ids (the last one will be removed later) + $result = $db->sql_query_limit($sql, $total_matches_limit + 1); + + while ($row = $db->sql_fetchrow($result)) + { + $id_ary[] = (int) $row[$field]; + } + $db->sql_freeresult($result); + } + else if ($search_id == 'unreadposts') + { + // Only return up to $total_matches_limit+1 ids (the last one will be removed later) + $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, $total_matches_limit + 1)); + } + else + { + $search_id = ''; + } + + $total_match_count = sizeof($id_ary); + if ($total_match_count) + { + // Limit the number to $total_matches_limit for pre-made searches + if ($total_match_count > $total_matches_limit) + { + $found_more_search_matches = true; + $total_match_count = $total_matches_limit; + } + + // Make sure $start is set to the last page if it exceeds the amount + $start = $pagination->validate_start($start, $per_page, $total_match_count); + + $id_ary = array_slice($id_ary, $start, $per_page); + } + else + { + // Set $start to 0 if no matches were found + $start = 0; + } + } + + // make sure that some arrays are always in the same order + sort($ex_fid_ary); + sort($author_id_ary); + + if ($search->get_search_query()) + { + $total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_posts_fid_sql, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page); + } + else if (sizeof($author_id_ary)) + { + $firstpost_only = ($search_fields === 'firstpost' || $search_fields == 'titleonly') ? true : false; + $total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_posts_fid_sql, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page); + } + + $sql_where = ''; + + if (sizeof($id_ary)) + { + $sql_where .= $db->sql_in_set(($show_results == 'posts') ? 'p.post_id' : 't.topic_id', $id_ary); + $sql_where .= (sizeof($ex_fid_ary)) ? ' AND (' . $db->sql_in_set('f.forum_id', $ex_fid_ary, true) . ' OR f.forum_id IS NULL)' : ''; + $sql_where .= ' AND ' . (($show_results == 'posts') ? $m_approve_posts_fid_sql : $m_approve_topics_fid_sql); + } + + if ($show_results == 'posts') + { + include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + } + else + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } + + $user->add_lang('viewtopic'); + + // Grab icons + $icons = $cache->obtain_icons(); + + // define some vars for urls + // A single wildcard will make the search results look ugly + $hilit = phpbb_clean_search_string(str_replace(array('+', '-', '|', '(', ')', '"'), ' ', $keywords)); + $hilit = str_replace(' ', '|', $hilit); + + $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit))); + $u_show_results = '&sr=' . $show_results; + $u_search_forum = implode('&fid%5B%5D=', $search_forum); + + $u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results); + $u_search .= ($search_id) ? '&search_id=' . $search_id : ''; + $u_search .= ($u_hilit) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; + $u_search .= ($search_terms != 'all') ? '&terms=' . $search_terms : ''; + $u_search .= ($topic_id) ? '&t=' . $topic_id : ''; + $u_search .= ($author) ? '&author=' . urlencode(htmlspecialchars_decode($author)) : ''; + $u_search .= ($author_id) ? '&author_id=' . $author_id : ''; + $u_search .= ($u_search_forum) ? '&fid%5B%5D=' . $u_search_forum : ''; + $u_search .= (!$search_child) ? '&sc=0' : ''; + $u_search .= ($search_fields != 'all') ? '&sf=' . $search_fields : ''; + $u_search .= ($return_chars != 300) ? '&ch=' . $return_chars : ''; + + if ($sql_where) + { + if ($show_results == 'posts') + { + // @todo Joining this query to the one below? + $sql = 'SELECT zebra_id, friend, foe + FROM ' . ZEBRA_TABLE . ' + WHERE user_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + + $zebra = array(); + while ($row = $db->sql_fetchrow($result)) + { + $zebra[($row['friend']) ? 'friend' : 'foe'][] = $row['zebra_id']; + } + $db->sql_freeresult($result); + + $sql_array = array( + 'SELECT' => 'p.*, f.forum_id, f.forum_name, t.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_colour', + 'FROM' => array( + POSTS_TABLE => 'p', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(TOPICS_TABLE => 't'), + 'ON' => 'p.topic_id = t.topic_id', + ), + array( + 'FROM' => array(FORUMS_TABLE => 'f'), + 'ON' => 'p.forum_id = f.forum_id', + ), + array( + 'FROM' => array(USERS_TABLE => 'u'), + 'ON' => 'p.poster_id = u.user_id', + ), + ), + 'WHERE' => $sql_where, + 'ORDER_BY' => $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'), + ); + + /** + * Event to modify the SQL query before the posts data is retrieved + * + * @event core.search_get_posts_data + * @var array sql_array The SQL array + * @var array zebra Array of zebra data for the current user + * @var int total_match_count The total number of search matches + * @var string keywords String of the specified keywords + * @var array sort_by_sql Array of SQL sorting instructions + * @var string s_sort_dir The sort direction + * @var string s_sort_key The sort key + * @var string s_limit_days Limit the age of results + * @var array ex_fid_ary Array of excluded forum ids + * @var array author_id_ary Array of exclusive author ids + * @var string search_fields The data fields to search in + * @var int search_id The id of the search request + * @var int start The starting id of the results + * @since 3.1.0-b3 + */ + $vars = array( + 'sql_array', + 'zebra', + 'total_match_count', + 'keywords', + 'sort_by_sql', + 's_sort_dir', + 's_sort_key', + 's_limit_days', + 'ex_fid_ary', + 'author_id_ary', + 'search_fields', + 'search_id', + 'start', + ); + extract($phpbb_dispatcher->trigger_event('core.search_get_posts_data', compact($vars))); + + $sql = $db->sql_build_query('SELECT', $sql_array); + } + else + { + $sql_from = TOPICS_TABLE . ' t + LEFT JOIN ' . FORUMS_TABLE . ' f ON (f.forum_id = t.forum_id) + ' . (($sort_key == 'a') ? ' LEFT JOIN ' . USERS_TABLE . ' u ON (u.user_id = t.topic_poster) ' : ''); + $sql_select = 't.*, f.forum_id, f.forum_name'; + + if ($user->data['is_registered']) + { + if ($config['load_db_track'] && $author_id !== $user->data['user_id']) + { + $sql_from .= ' LEFT JOIN ' . TOPICS_POSTED_TABLE . ' tp ON (tp.user_id = ' . $user->data['user_id'] . ' + AND t.topic_id = tp.topic_id)'; + $sql_select .= ', tp.topic_posted'; + } + + if ($config['load_db_lastread']) + { + $sql_from .= ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.user_id = ' . $user->data['user_id'] . ' + AND t.topic_id = tt.topic_id) + LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' + AND ft.forum_id = f.forum_id)'; + $sql_select .= ', tt.mark_time, ft.mark_time as f_mark_time'; + } + } + + if ($config['load_anon_lastread'] || ($user->data['is_registered'] && !$config['load_db_lastread'])) + { + $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE); + $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array(); + } + + /** + * Event to modify the SQL query before the topic data is retrieved + * + * @event core.search_get_topic_data + * @var string sql_select The SQL SELECT string used by search to get topic data + * @var string sql_from The SQL FROM string used by search to get topic data + * @var string sql_where The SQL WHERE string used by search to get topic data + * @var int total_match_count The total number of search matches + * @since 3.1.0-a1 + * @changed 3.1.0-RC5 Added total_match_count + */ + $vars = array('sql_select', 'sql_from', 'sql_where', 'total_match_count'); + extract($phpbb_dispatcher->trigger_event('core.search_get_topic_data', compact($vars))); + + $sql = "SELECT $sql_select + FROM $sql_from + WHERE $sql_where"; + $sql .= ' ORDER BY ' . $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); + } + $result = $db->sql_query($sql); + $result_topic_id = 0; + + $rowset = array(); + + if ($show_results == 'topics') + { + $forums = $rowset = $shadow_topic_list = array(); + while ($row = $db->sql_fetchrow($result)) + { + $row['forum_id'] = (int) $row['forum_id']; + $row['topic_id'] = (int) $row['topic_id']; + + if ($row['topic_status'] == ITEM_MOVED) + { + $shadow_topic_list[$row['topic_moved_id']] = $row['topic_id']; + } + + $rowset[$row['topic_id']] = $row; + + if (!isset($forums[$row['forum_id']]) && $user->data['is_registered'] && $config['load_db_lastread']) + { + $forums[$row['forum_id']]['mark_time'] = $row['f_mark_time']; + } + $forums[$row['forum_id']]['topic_list'][] = $row['topic_id']; + $forums[$row['forum_id']]['rowset'][$row['topic_id']] = &$rowset[$row['topic_id']]; + } + $db->sql_freeresult($result); + + // If we have some shadow topics, update the rowset to reflect their topic information + if (sizeof($shadow_topic_list)) + { + $sql = 'SELECT * + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', array_keys($shadow_topic_list)); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $orig_topic_id = $shadow_topic_list[$row['topic_id']]; + + // We want to retain some values + $row = array_merge($row, array( + 'topic_moved_id' => $rowset[$orig_topic_id]['topic_moved_id'], + 'topic_status' => $rowset[$orig_topic_id]['topic_status'], + 'forum_name' => $rowset[$orig_topic_id]['forum_name']) + ); + + $rowset[$orig_topic_id] = $row; + } + $db->sql_freeresult($result); + } + unset($shadow_topic_list); + + foreach ($forums as $forum_id => $forum) + { + if ($user->data['is_registered'] && $config['load_db_lastread']) + { + $topic_tracking_info[$forum_id] = get_topic_tracking($forum_id, $forum['topic_list'], $forum['rowset'], array($forum_id => $forum['mark_time'])); + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + $topic_tracking_info[$forum_id] = get_complete_topic_tracking($forum_id, $forum['topic_list']); + + if (!$user->data['is_registered']) + { + $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0; + } + } + } + unset($forums); + } + else + { + $bbcode_bitfield = $text_only_message = ''; + $attach_list = array(); + + while ($row = $db->sql_fetchrow($result)) + { + // We pre-process some variables here for later usage + $row['post_text'] = censor_text($row['post_text']); + + $text_only_message = $row['post_text']; + // make list items visible as such + if ($row['bbcode_uid']) + { + $text_only_message = str_replace('[*:' . $row['bbcode_uid'] . ']', '⋅ ', $text_only_message); + // no BBCode in text only message + strip_bbcode($text_only_message, $row['bbcode_uid']); + } + + if ($return_chars == -1 || utf8_strlen($text_only_message) < ($return_chars + 3)) + { + $row['display_text_only'] = false; + $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']); + + // Does this post have an attachment? If so, add it to the list + if ($row['post_attachment'] && $config['allow_attachments']) + { + $attach_list[$row['forum_id']][] = $row['post_id']; + } + } + else + { + $row['post_text'] = $text_only_message; + $row['display_text_only'] = true; + } + + $rowset[] = $row; + } + $db->sql_freeresult($result); + + unset($text_only_message); + + // Instantiate BBCode if needed + if ($bbcode_bitfield !== '') + { + include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); + $bbcode = new bbcode(base64_encode($bbcode_bitfield)); + } + + // Pull attachment data + if (sizeof($attach_list)) + { + $use_attach_list = $attach_list; + $attach_list = array(); + + foreach ($use_attach_list as $forum_id => $_list) + { + if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id)) + { + $attach_list = array_merge($attach_list, $_list); + } + } + } + + if (sizeof($attach_list)) + { + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_msg_id', $attach_list) . ' + AND in_message = 0 + ORDER BY filetime DESC, post_msg_id ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $attachments[$row['post_msg_id']][] = $row; + } + $db->sql_freeresult($result); + } + } + + if ($hilit) + { + // Remove bad highlights + $hilit_array = array_filter(explode('|', $hilit), 'strlen'); + foreach ($hilit_array as $key => $value) + { + $hilit_array[$key] = phpbb_clean_search_string($value); + $hilit_array[$key] = str_replace('\*', '\w*?', preg_quote($hilit_array[$key], '#')); + $hilit_array[$key] = preg_replace('#(^|\s)\\\\w\*\?(\s|$)#', '$1\w+?$2', $hilit_array[$key]); + } + $hilit = implode('|', $hilit_array); + } + + /** + * Modify the rowset data + * + * @event core.search_modify_rowset + * @var array attachments Array with posts attachments data + * @var string hilit String to highlight + * @var array rowset Array with the search results data + * @var string show_results String indicating the show results mode + * @var array topic_tracking_info Array with the topics tracking data + * @var string u_hilit Highlight string to be injected into URL + * @var string view Search results view mode + * @var array zebra Array with zebra data for the current user + * @since 3.1.0-b4 + * @changed 3.1.0-b5 Added var show_results + */ + $vars = array( + 'attachments', + 'hilit', + 'rowset', + 'show_results', + 'topic_tracking_info', + 'u_hilit', + 'view', + 'zebra', + ); + extract($phpbb_dispatcher->trigger_event('core.search_modify_rowset', compact($vars))); + + foreach ($rowset as $row) + { + $forum_id = $row['forum_id']; + $result_topic_id = $row['topic_id']; + $topic_title = censor_text($row['topic_title']); + $replies = $phpbb_content_visibility->get_count('topic_posts', $row, $forum_id) - 1; + + $view_topic_url_params = "f=$forum_id&t=$result_topic_id" . (($u_hilit) ? "&hilit=$u_hilit" : ''); + $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params); + + if ($show_results == 'topics') + { + if ($config['load_db_track'] && $author_id === $user->data['user_id']) + { + $row['topic_posted'] = 1; + } + + $folder_img = $folder_alt = $topic_type = ''; + topic_status($row, $replies, (isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']]) ? true : false, $folder_img, $folder_alt, $topic_type); + + $unread_topic = (isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']]) ? true : false; + + $topic_unapproved = (($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $forum_id)) ? true : false; + $posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false; + $topic_deleted = $row['topic_visibility'] == ITEM_DELETED; + $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$result_topic_id", true, $user->session_id) : ''; + $u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&mode=deleted_topics&t=$result_topic_id", true, $user->session_id) : $u_mcp_queue; + + $row['topic_title'] = preg_replace('#(?!<.*)(?]*(?:)#is', '$1', $row['topic_title']); + + $tpl_ary = array( + 'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'TOPIC_AUTHOR_FULL' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), + 'LAST_POST_SUBJECT' => $row['topic_last_post_subject'], + 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), + 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), + 'LAST_POST_AUTHOR' => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + + 'TOPIC_TYPE' => $topic_type, + + 'TOPIC_IMG_STYLE' => $folder_img, + 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), + 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], + + 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', + 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', + 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '', + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + 'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '', + + 'S_TOPIC_TYPE' => $row['topic_type'], + 'S_USER_POSTED' => (!empty($row['topic_posted'])) ? true : false, + 'S_UNREAD_TOPIC' => $unread_topic, + + 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $forum_id)) ? true : false, + 'S_TOPIC_UNAPPROVED' => $topic_unapproved, + 'S_POSTS_UNAPPROVED' => $posts_unapproved, + 'S_TOPIC_DELETED' => $topic_deleted, + 'S_HAS_POLL' => ($row['poll_start']) ? true : false, + + 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], + 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&view=unread') . '#unread', + 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&t=' . $result_topic_id, true, $user->session_id), + 'U_MCP_QUEUE' => $u_mcp_queue, + ); + } + else + { + if ((isset($zebra['foe']) && in_array($row['poster_id'], $zebra['foe'])) && (!$view || $view != 'show' || $post_id != $row['post_id'])) + { + $template->assign_block_vars('searchresults', array( + 'S_IGNORE_POST' => true, + + 'L_IGNORE_POST' => sprintf($user->lang['POST_BY_FOE'], $row['username'], "', '')) + ); + + continue; + } + + // Replace naughty words such as farty pants + $row['post_subject'] = censor_text($row['post_subject']); + + if ($row['display_text_only']) + { + // now find context for the searched words + $row['post_text'] = get_context($row['post_text'], array_filter(explode('|', $hilit), 'strlen'), $return_chars); + $row['post_text'] = bbcode_nl2br($row['post_text']); + } + else + { + $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; + $row['post_text'] = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, false); + + if (!empty($attachments[$row['post_id']])) + { + parse_attachments($forum_id, $row['post_text'], $attachments[$row['post_id']], $update_count); + + // we only display inline attachments + unset($attachments[$row['post_id']]); + } + } + + if ($hilit) + { + // post highlighting + $row['post_text'] = preg_replace('#(?!<.*)(?]*(?:)#is', '$1', $row['post_text']); + $row['post_subject'] = preg_replace('#(?!<.*)(?]*(?:)#is', '$1', $row['post_subject']); + } + + $tpl_ary = array( + 'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + 'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + 'POST_AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + 'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), + + 'POST_SUBJECT' => $row['post_subject'], + 'POST_DATE' => (!empty($row['post_time'])) ? $user->format_date($row['post_time']) : '', + 'MESSAGE' => $row['post_text'] + ); + } + + $tpl_ary = array_merge($tpl_ary, array( + 'FORUM_ID' => $forum_id, + 'TOPIC_ID' => $result_topic_id, + 'POST_ID' => ($show_results == 'posts') ? $row['post_id'] : false, + + 'FORUM_TITLE' => $row['forum_name'], + 'TOPIC_TITLE' => $topic_title, + 'TOPIC_REPLIES' => $replies, + 'TOPIC_VIEWS' => $row['topic_views'], + + 'U_VIEW_TOPIC' => $view_topic_url, + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), + 'U_VIEW_POST' => (!empty($row['post_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=" . $row['topic_id'] . '&p=' . $row['post_id'] . (($u_hilit) ? '&hilit=' . $u_hilit : '')) . '#p' . $row['post_id'] : '', + )); + + /** + * Modify the topic data before it is assigned to the template + * + * @event core.search_modify_tpl_ary + * @var array row Array with topic data + * @var array tpl_ary Template block array with topic data + * @var string show_results Display topics or posts + * @var string topic_title Cleaned topic title + * @var int replies The number of topic replies + * @var string view_topic_url The URL to the topic + * @var string folder_img The folder image of the topic + * @var string folder_alt The alt attribute of the topic folder img + * @var int topic_type The topic type + * @var bool unread_topic Whether the topic has unread posts + * @var bool topic_unapproved Whether the topic is unapproved + * @var int posts_unapproved The number of unapproved posts + * @var bool topic_deleted Whether the topic has been deleted + * @var string u_mcp_queue The URL to the corresponding MCP queue page + * @var array zebra The zebra data of the current user + * @var array attachments All the attachments of the search results + * @since 3.1.0-a1 + * @changed 3.1.0-b3 Added vars show_results, topic_title, replies, + * view_topic_url, folder_img, folder_alt, topic_type, unread_topic, + * topic_unapproved, posts_unapproved, topic_deleted, u_mcp_queue, + * zebra, attachments + */ + $vars = array( + 'row', + 'tpl_ary', + 'show_results', + 'topic_title', + 'replies', + 'view_topic_url', + 'folder_img', + 'folder_alt', + 'topic_type', + 'unread_topic', + 'topic_unapproved', + 'posts_unapproved', + 'topic_deleted', + 'u_mcp_queue', + 'zebra', + 'attachments', + ); + extract($phpbb_dispatcher->trigger_event('core.search_modify_tpl_ary', compact($vars))); + + $template->assign_block_vars('searchresults', $tpl_ary); + + if ($show_results == 'topics') + { + $pagination->generate_template_pagination($view_topic_url, 'searchresults.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true); + } + } + + if ($topic_id && ($topic_id == $result_topic_id)) + { + $template->assign_vars(array( + 'SEARCH_TOPIC' => $topic_title, + 'L_RETURN_TO_TOPIC' => $user->lang('RETURN_TO', $topic_title), + 'U_SEARCH_TOPIC' => $view_topic_url + )); + } + } + unset($rowset); + + // Output header + if ($found_more_search_matches) + { + $l_search_matches = $user->lang('FOUND_MORE_SEARCH_MATCHES', (int) $total_match_count); + } + else + { + $l_search_matches = $user->lang('FOUND_SEARCH_MATCHES', (int) $total_match_count); + } + + // Check if search backend supports phrase search or not + $phrase_search_disabled = ''; + if (strpos(html_entity_decode($keywords), '"') !== false && method_exists($search, 'supports_phrase_search')) + { + $phrase_search_disabled = $search->supports_phrase_search() ? false : true; + } + + $pagination->generate_template_pagination($u_search, 'pagination', 'start', $total_match_count, $per_page, $start); + + $template->assign_vars(array( + 'SEARCH_TITLE' => $l_search_title, + 'SEARCH_MATCHES' => $l_search_matches, + 'SEARCH_WORDS' => $keywords, + 'SEARCHED_QUERY' => $search->get_search_query(), + 'IGNORED_WORDS' => (!empty($common_words)) ? implode(' ', $common_words) : '', + + 'PHRASE_SEARCH_DISABLED' => $phrase_search_disabled, + + 'TOTAL_MATCHES' => $total_match_count, + 'SEARCH_IN_RESULTS' => ($search_id) ? false : true, + + 'S_SELECT_SORT_DIR' => $s_sort_dir, + 'S_SELECT_SORT_KEY' => $s_sort_key, + 'S_SELECT_SORT_DAYS' => $s_limit_days, + 'S_SEARCH_ACTION' => $u_search, + 'S_SHOW_TOPICS' => ($show_results == 'posts') ? false : true, + + 'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'), + 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'), + 'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'), + 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'), + 'DELETED_IMG' => $user->img('icon_topic_deleted', 'TOPIC_DELETED'), + 'POLL_IMG' => $user->img('icon_topic_poll', 'TOPIC_POLL'), + 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), + + 'U_SEARCH_WORDS' => $u_search, + )); + + /** + * Modify the title and/or load data for the search results page + * + * @event core.search_results_modify_search_title + * @var int author_id ID of the author to search by + * @var string l_search_title The title of the search page + * @var string search_id Predefined search type name + * @var string show_results Search results output mode - topics or posts + * @var int start The starting id of the results + * @since 3.1.0-RC4 + */ + $vars = array('author_id', 'l_search_title', 'search_id', 'show_results', 'start'); + extract($phpbb_dispatcher->trigger_event('core.search_results_modify_search_title', compact($vars))); + + page_header(($l_search_title) ? $l_search_title : $user->lang['SEARCH']); + + $template->set_filenames(array( + 'body' => 'search_results.html') + ); + make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); + + page_footer(); +} + +// Search forum +$s_forums = ''; +$sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.left_id, f.right_id, f.forum_password, f.enable_indexing, fa.user_id + FROM ' . FORUMS_TABLE . ' f + LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id + AND fa.session_id = '" . $db->sql_escape($user->session_id) . "') + ORDER BY f.left_id ASC"; +$result = $db->sql_query($sql); + +$right = $cat_right = $padding_inc = 0; +$padding = $forum_list = $holding = ''; +$pad_store = array('0' => ''); + +while ($row = $db->sql_fetchrow($result)) +{ + if ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id'])) + { + // Non-postable forum with no subforums, don't display + continue; + } + + if ($row['forum_type'] == FORUM_POST && ($row['left_id'] + 1 == $row['right_id']) && !$row['enable_indexing']) + { + // Postable forum with no subforums and indexing disabled, don't display + continue; + } + + if ($row['forum_type'] == FORUM_LINK || ($row['forum_password'] && !$row['user_id'])) + { + // if this forum is a link or password protected (user has not entered the password yet) then skip to the next branch + continue; + } + + if ($row['left_id'] < $right) + { + $padding .= '   '; + $pad_store[$row['parent_id']] = $padding; + } + else if ($row['left_id'] > $right + 1) + { + if (isset($pad_store[$row['parent_id']])) + { + $padding = $pad_store[$row['parent_id']]; + } + else + { + continue; + } + } + + $right = $row['right_id']; + + if ($auth->acl_gets('!f_search', '!f_list', $row['forum_id'])) + { + // if the user does not have permissions to search or see this forum skip only this forum/category + continue; + } + + $selected = (in_array($row['forum_id'], $search_forum)) ? ' selected="selected"' : ''; + + if ($row['left_id'] > $cat_right) + { + // make sure we don't forget anything + $s_forums .= $holding; + $holding = ''; + } + + if ($row['right_id'] - $row['left_id'] > 1) + { + $cat_right = max($cat_right, $row['right_id']); + + $holding .= ''; + } + else + { + $s_forums .= $holding . ''; + $holding = ''; + } +} + +if ($holding) +{ + $s_forums .= $holding; +} + +$db->sql_freeresult($result); +unset($pad_store); + +if (!$s_forums) +{ + trigger_error('NO_SEARCH'); +} + +// Number of chars returned +$s_characters = ''; +$s_characters .= ''; +$s_characters .= ''; +$s_characters .= ''; + +for ($i = 100; $i <= 1000; $i += 100) +{ + $selected = ($i == 300) ? ' selected="selected"' : ''; + $s_characters .= ''; +} + +$s_hidden_fields = array('t' => $topic_id); + +if ($_SID) +{ + $s_hidden_fields['sid'] = $_SID; +} + +if (!empty($_EXTRA_URL)) +{ + foreach ($_EXTRA_URL as $url_param) + { + $url_param = explode('=', $url_param, 2); + $s_hidden_fields[$url_param[0]] = $url_param[1]; + } +} + +$template->assign_vars(array( + 'S_SEARCH_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", false, true, 0), // We force no ?sid= appending by using 0 + 'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields), + 'S_CHARACTER_OPTIONS' => $s_characters, + 'S_FORUM_OPTIONS' => $s_forums, + 'S_SELECT_SORT_DIR' => $s_sort_dir, + 'S_SELECT_SORT_KEY' => $s_sort_key, + 'S_SELECT_SORT_DAYS' => $s_limit_days, + 'S_IN_SEARCH' => true, +)); + +// only show recent searches to search administrators +if ($auth->acl_get('a_search')) +{ + // Handle large objects differently for Oracle and MSSQL + switch ($db->get_sql_layer()) + { + case 'oracle': + $sql = 'SELECT search_time, search_keywords + FROM ' . SEARCH_RESULTS_TABLE . ' + WHERE dbms_lob.getlength(search_keywords) > 0 + ORDER BY search_time DESC'; + break; + + case 'mssql': + case 'mssql_odbc': + case 'mssqlnative': + $sql = 'SELECT search_time, search_keywords + FROM ' . SEARCH_RESULTS_TABLE . ' + WHERE DATALENGTH(search_keywords) > 0 + ORDER BY search_time DESC'; + break; + + default: + $sql = 'SELECT search_time, search_keywords + FROM ' . SEARCH_RESULTS_TABLE . ' + WHERE search_keywords <> \'\' + ORDER BY search_time DESC'; + break; + } + $result = $db->sql_query_limit($sql, 5); + + while ($row = $db->sql_fetchrow($result)) + { + $keywords = $row['search_keywords']; + + $template->assign_block_vars('recentsearch', array( + 'KEYWORDS' => $keywords, + 'TIME' => $user->format_date($row['search_time']), + + 'U_KEYWORDS' => append_sid("{$phpbb_root_path}search.$phpEx", 'keywords=' . urlencode(htmlspecialchars_decode($keywords))) + )); + } + $db->sql_freeresult($result); +} + +// Output the basic page +page_header($user->lang['SEARCH']); + +$template->set_filenames(array( + 'body' => 'search_body.html') +); +make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); + +page_footer(); diff --git a/sources/phpBB/store/.htaccess b/sources/phpBB/store/.htaccess new file mode 100644 index 0000000..aa5afc1 --- /dev/null +++ b/sources/phpBB/store/.htaccess @@ -0,0 +1,4 @@ + + Order Allow,Deny + Deny from All + \ No newline at end of file diff --git a/sources/phpBB/store/index.htm b/sources/phpBB/store/index.htm new file mode 100644 index 0000000..ee1f723 --- /dev/null +++ b/sources/phpBB/store/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sources/phpBB/styles/prosilver/style.cfg b/sources/phpBB/styles/prosilver/style.cfg new file mode 100644 index 0000000..34a7618 --- /dev/null +++ b/sources/phpBB/styles/prosilver/style.cfg @@ -0,0 +1,32 @@ +# +# phpBB Style Configuration File +# +# This file is part of the phpBB Forum Software package. +# +# @copyright (c) phpBB Limited +# @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 = prosilver +copyright = © phpBB Limited, 2007 +style_version = 3.1.3 +phpbb_version = 3.1.3 + +# 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 = prosilver diff --git a/sources/phpBB/styles/prosilver/template/ajax.js b/sources/phpBB/styles/prosilver/template/ajax.js new file mode 100644 index 0000000..168efff --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ajax.js @@ -0,0 +1,385 @@ +/* global phpbb */ + +(function($) { // Avoid conflicts with other libraries + +'use strict'; + +// This callback will mark all forum icons read +phpbb.addAjaxCallback('mark_forums_read', function(res) { + var readTitle = res.NO_UNREAD_POSTS; + var unreadTitle = res.UNREAD_POSTS; + var iconsArray = { + 'forum_unread': 'forum_read', + 'forum_unread_subforum': 'forum_read_subforum', + 'forum_unread_locked': 'forum_read_locked' + }; + + $('li.row').find('dl[class*="forum_unread"]').each(function() { + var $this = $(this); + + $.each(iconsArray, function(unreadClass, readClass) { + if ($this.hasClass(unreadClass)) { + $this.removeClass(unreadClass).addClass(readClass); + } + }); + $this.children('dt[title="' + unreadTitle + '"]').attr('title', readTitle); + }); + + // Mark subforums read + $('a.subforum[class*="unread"]').removeClass('unread').addClass('read'); + + // Mark topics read if we are watching a category and showing active topics + if ($('#active_topics').length) { + phpbb.ajaxCallbacks.mark_topics_read.call(this, res, false); + } + + // Update mark forums read links + $('[data-ajax="mark_forums_read"]').attr('href', res.U_MARK_FORUMS); + + phpbb.closeDarkenWrapper(3000); +}); + +/** +* This callback will mark all topic icons read +* +* @param update_topic_links bool Whether "Mark topics read" links should be +* updated. Defaults to true. +*/ +phpbb.addAjaxCallback('mark_topics_read', function(res, updateTopicLinks) { + var readTitle = res.NO_UNREAD_POSTS; + var unreadTitle = res.UNREAD_POSTS; + var iconsArray = { + 'global_unread': 'global_read', + 'announce_unread': 'announce_read', + 'sticky_unread': 'sticky_read', + 'topic_unread': 'topic_read' + }; + var iconsState = ['', '_hot', '_hot_mine', '_locked', '_locked_mine', '_mine']; + var unreadClassSelectors; + var classMap = {}; + var classNames = []; + + if (typeof updateTopicLinks === 'undefined') { + updateTopicLinks = true; + } + + $.each(iconsArray, function(unreadClass, readClass) { + $.each(iconsState, function(key, value) { + // Only topics can be hot + if ((value === '_hot' || value === '_hot_mine') && unreadClass !== 'topic_unread') { + return true; + } + classMap[unreadClass + value] = readClass + value; + classNames.push(unreadClass + value); + }); + }); + + unreadClassSelectors = '.' + classNames.join(',.'); + + $('li.row').find(unreadClassSelectors).each(function() { + var $this = $(this); + $.each(classMap, function(unreadClass, readClass) { + if ($this.hasClass(unreadClass)) { + $this.removeClass(unreadClass).addClass(readClass); + } + }); + $this.children('dt[title="' + unreadTitle + '"]').attr('title', readTitle); + }); + + // Remove link to first unread post + $('a').has('span.icon_topic_newest').remove(); + + // Update mark topics read links + if (updateTopicLinks) { + $('[data-ajax="mark_topics_read"]').attr('href', res.U_MARK_TOPICS); + } + + phpbb.closeDarkenWrapper(3000); +}); + +// This callback will mark all notifications read +phpbb.addAjaxCallback('notification.mark_all_read', function(res) { + if (typeof res.success !== 'undefined') { + phpbb.markNotifications($('#notification_list li.bg2'), 0); + phpbb.closeDarkenWrapper(3000); + } +}); + +// This callback will mark a notification read +phpbb.addAjaxCallback('notification.mark_read', function(res) { + if (typeof res.success !== 'undefined') { + var unreadCount = Number($('#notification_list_button strong').html()) - 1; + phpbb.markNotifications($(this).parent('li.bg2'), unreadCount); + } +}); + +/** + * Mark notification popup rows as read. + * + * @param {jQuery} $popup jQuery object(s) to mark read. + * @param {int} unreadCount The new unread notifications count. + */ +phpbb.markNotifications = function($popup, unreadCount) { + // Remove the unread status. + $popup.removeClass('bg2'); + $popup.find('a.mark_read').remove(); + + // Update the notification link to the real URL. + $popup.each(function() { + var link = $(this).find('a'); + link.attr('href', link.attr('data-real-url')); + }); + + // Update the unread count. + $('strong', '#notification_list_button').html(unreadCount); + // Remove the Mark all read link if there are no unread notifications. + if (!unreadCount) { + $('#mark_all_notifications').remove(); + } + + // Update page title + $('title').text( + (unreadCount ? '(' + unreadCount + ')' : '') + $('title').text().replace(/(\(([0-9])\))/, '') + ); +}; + +// This callback finds the post from the delete link, and removes it. +phpbb.addAjaxCallback('post_delete', function() { + var $this = $(this), + postId; + + if ($this.attr('data-refresh') === undefined) { + postId = $this[0].href.split('&p=')[1]; + var post = $this.parents('#p' + postId).css('pointer-events', 'none'); + if (post.hasClass('bg1') || post.hasClass('bg2')) { + var posts1 = post.nextAll('.bg1'); + post.nextAll('.bg2').removeClass('bg2').addClass('bg1'); + posts1.removeClass('bg1').addClass('bg2'); + } + post.fadeOut(function() { + $(this).remove(); + }); + } +}); + +// This callback removes the approve / disapprove div or link. +phpbb.addAjaxCallback('post_visibility', function(res) { + var remove = (res.visible) ? $(this) : $(this).parents('.post'); + $(remove).css('pointer-events', 'none').fadeOut(function() { + $(this).remove(); + }); + + if (res.visible) { + // Remove the "Deleted by" message from the post on restoring. + remove.parents('.post').find('.post_deleted_msg').css('pointer-events', 'none').fadeOut(function() { + $(this).remove(); + }); + } +}); + +// This removes the parent row of the link or form that fired the callback. +phpbb.addAjaxCallback('row_delete', function() { + $(this).parents('tr').remove(); +}); + +// This handles friend / foe additions removals. +phpbb.addAjaxCallback('zebra', function(res) { + var zebra; + + if (res.success) { + zebra = $('.zebra'); + zebra.first().html(res.MESSAGE_TEXT); + zebra.not(':first').html(' ').prev().html(' '); + } +}); + +/** + * This callback updates the poll results after voting. + */ +phpbb.addAjaxCallback('vote_poll', function(res) { + if (typeof res.success !== 'undefined') { + var poll = $('.topic_poll'); + var panel = poll.find('.panel'); + var resultsVisible = poll.find('dl:first-child .resultbar').is(':visible'); + var mostVotes = 0; + + // Set min-height to prevent the page from jumping when the content changes + var updatePanelHeight = function (height) { + var height = (typeof height === 'undefined') ? panel.find('.inner').outerHeight() : height; + panel.css('min-height', height); + }; + updatePanelHeight(); + + // Remove the View results link + if (!resultsVisible) { + poll.find('.poll_view_results').hide(500); + } + + if (!res.can_vote) { + poll.find('.polls, .poll_max_votes, .poll_vote, .poll_option_select').fadeOut(500, function () { + poll.find('.resultbar, .poll_option_percent, .poll_total_votes').show(); + }); + } else { + // If the user can still vote, simply slide down the results + poll.find('.resultbar, .poll_option_percent, .poll_total_votes').show(500); + } + + // Get the votes count of the highest poll option + poll.find('[data-poll-option-id]').each(function() { + var option = $(this); + var optionId = option.attr('data-poll-option-id'); + mostVotes = (res.vote_counts[optionId] >= mostVotes) ? res.vote_counts[optionId] : mostVotes; + }); + + // Update the total votes count + poll.find('.poll_total_vote_cnt').html(res.total_votes); + + // Update each option + poll.find('[data-poll-option-id]').each(function() { + var $this = $(this); + var optionId = $this.attr('data-poll-option-id'); + var voted = (typeof res.user_votes[optionId] !== 'undefined'); + var mostVoted = (res.vote_counts[optionId] === mostVotes); + var percent = (!res.total_votes) ? 0 : Math.round((res.vote_counts[optionId] / res.total_votes) * 100); + var percentRel = (mostVotes === 0) ? 0 : Math.round((res.vote_counts[optionId] / mostVotes) * 100); + + $this.toggleClass('voted', voted); + $this.toggleClass('most-votes', mostVoted); + + // Update the bars + var bar = $this.find('.resultbar div'); + var barTimeLapse = (res.can_vote) ? 500 : 1500; + var newBarClass = (percent === 100) ? 'pollbar5' : 'pollbar' + (Math.floor(percent / 20) + 1); + + setTimeout(function () { + bar.animate({width: percentRel + '%'}, 500) + .removeClass('pollbar1 pollbar2 pollbar3 pollbar4 pollbar5') + .addClass(newBarClass) + .html(res.vote_counts[optionId]); + + var percentText = percent ? percent + '%' : res.NO_VOTES; + $this.find('.poll_option_percent').html(percentText); + }, barTimeLapse); + }); + + if (!res.can_vote) { + poll.find('.polls').delay(400).fadeIn(500); + } + + // Display "Your vote has been cast." message. Disappears after 5 seconds. + var confirmationDelay = (res.can_vote) ? 300 : 900; + poll.find('.vote-submitted').delay(confirmationDelay).slideDown(200, function() { + if (resultsVisible) { + updatePanelHeight(); + } + + $(this).delay(5000).fadeOut(500, function() { + resizePanel(300); + }); + }); + + // Remove the gap resulting from removing options + setTimeout(function() { + resizePanel(500); + }, 1500); + + var resizePanel = function (time) { + var panelHeight = panel.height(); + var innerHeight = panel.find('.inner').outerHeight(); + + if (panelHeight != innerHeight) { + panel.css({'min-height': '', 'height': panelHeight}) + .animate({height: innerHeight}, time, function () { + panel.css({'min-height': innerHeight, 'height': ''}); + }); + } + }; + } +}); + +/** + * Show poll results when clicking View results link. + */ +$('.poll_view_results a').click(function(e) { + // Do not follow the link + e.preventDefault(); + + var $poll = $(this).parents('.topic_poll'); + + $poll.find('.resultbar, .poll_option_percent, .poll_total_votes').show(500); + $poll.find('.poll_view_results').hide(500); +}); + +$('[data-ajax]').each(function() { + var $this = $(this); + var ajax = $this.attr('data-ajax'); + var filter = $this.attr('data-filter'); + + if (ajax !== 'false') { + var fn = (ajax !== 'true') ? ajax : null; + filter = (filter !== undefined) ? phpbb.getFunctionByName(filter) : null; + + phpbb.ajaxify({ + selector: this, + refresh: $this.attr('data-refresh') !== undefined, + filter: filter, + callback: fn + }); + } +}); + + +/** + * This simply appends #preview to the action of the + * QR action when you click the Full Editor & Preview button + */ +$('#qr_full_editor').click(function() { + $('#qr_postform').attr('action', function(i, val) { + return val + '#preview'; + }); +}); + + +/** + * Make the display post links to use JS + */ +$('.display_post').click(function(e) { + // Do not follow the link + e.preventDefault(); + + var postId = $(this).attr('data-post-id'); + $('#post_content' + postId).show(); + $('#profile' + postId).show(); + $('#post_hidden' + postId).hide(); +}); + +/** +* Toggle the member search panel in memberlist.php. +* +* If user returns to search page after viewing results the search panel is automatically displayed. +* In any case the link will toggle the display status of the search panel and link text will be +* appropriately changed based on the status of the search panel. +*/ +$('#member_search').click(function () { + var $memberlistSearch = $('#memberlist_search'); + + $memberlistSearch.slideToggle('fast'); + phpbb.ajaxCallbacks.alt_text.call(this); + + // Focus on the username textbox if it's available and displayed + if ($memberlistSearch.is(':visible')) { + $('#username').focus(); + } + return false; +}); + +/** +* Automatically resize textarea +*/ +$(function() { + phpbb.resizeTextArea($('textarea:not(#message-box textarea, .no-auto-resize)'), {minHeight: 75, maxHeight: 250}); + phpbb.resizeTextArea($('#message-box textarea')); +}); + + +})(jQuery); // Avoid conflicts with other libraries diff --git a/sources/phpBB/styles/prosilver/template/attachment.html b/sources/phpBB/styles/prosilver/template/attachment.html new file mode 100644 index 0000000..c227e71 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/attachment.html @@ -0,0 +1,122 @@ + + + +

[{_file.DENIED_MESSAGE}]

+ + + +
+
{_file.DOWNLOAD_NAME}
+
{_file.COMMENT}
+
+ + + + +
+
{_file.DOWNLOAD_NAME}
+
{_file.COMMENT}
+
{_file.DOWNLOAD_NAME} ({_file.FILESIZE} {_file.SIZE_LANG}) {_file.L_DOWNLOAD_COUNT}
+
+ + + +
+
{_file.UPLOAD_ICON} {_file.DOWNLOAD_NAME}
+
{_file.COMMENT}
+
({_file.FILESIZE} {_file.SIZE_LANG}) {_file.L_DOWNLOAD_COUNT}
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +

+ [ {L_PLAY_QUICKTIME_FILE} ] + {_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOAD_COUNT} ]

+ + + + diff --git a/sources/phpBB/styles/prosilver/template/bbcode.html b/sources/phpBB/styles/prosilver/template/bbcode.html new file mode 100644 index 0000000..3e38d13 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/bbcode.html @@ -0,0 +1,40 @@ +
    +
      +
    + +
      +
    + +
  • +
  • + +
    {USERNAME} {L_WROTE}{L_COLON} +
    +
    + +

    {L_CODE}{L_COLON} {L_SELECT_ALL_CODE}

    +
    + +
    +
    + + + + + + + + + + +{TEXT} + +{TEXT} + +{L_IMAGE} + +{DESCRIPTION} + +{DESCRIPTION} + + diff --git a/sources/phpBB/styles/prosilver/template/captcha_default.html b/sources/phpBB/styles/prosilver/template/captcha_default.html new file mode 100644 index 0000000..02899bc --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/captcha_default.html @@ -0,0 +1,24 @@ + +
    +
    + +

    {L_CONFIRMATION}

    +

    {L_CONFIRM_EXPLAIN}

    + +
    + + +
    +
    +
    {L_CONFIRM_CODE}
    +
    + +
    +
    {L_CONFIRM_CODE_EXPLAIN}
    +
    + + +
    +
    +
    + diff --git a/sources/phpBB/styles/prosilver/template/captcha_qa.html b/sources/phpBB/styles/prosilver/template/captcha_qa.html new file mode 100644 index 0000000..b8c6678 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/captcha_qa.html @@ -0,0 +1,21 @@ + +
    +
    + +

    {L_CONFIRMATION}

    +
    + + +
    +

    {L_CONFIRM_QUESTION_EXPLAIN}
    +
    + + +
    +
    + + +
    +
    +
    + diff --git a/sources/phpBB/styles/prosilver/template/captcha_recaptcha.html b/sources/phpBB/styles/prosilver/template/captcha_recaptcha.html new file mode 100644 index 0000000..fee0f74 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/captcha_recaptcha.html @@ -0,0 +1,43 @@ + +
    +
    + +

    {L_CONFIRMATION}

    +

    {L_CONFIRM_EXPLAIN}

    + +
    + + + +
    +

    {L_RECAPTCHA_EXPLAIN}
    +
    + + + + + + +
    +
    + +{L_RECAPTCHA_NOT_AVAILABLE} + + + +
    +
    +
    + diff --git a/sources/phpBB/styles/prosilver/template/confirm_body.html b/sources/phpBB/styles/prosilver/template/confirm_body.html new file mode 100644 index 0000000..aaea5cf --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/confirm_body.html @@ -0,0 +1,35 @@ + +
    +

    {MESSAGE_TITLE}

    +

    {MESSAGE_TEXT}

    + +
    +   + +
    +
    + + + + + +
    +
    +
    + +

    {MESSAGE_TITLE}

    +

    {MESSAGE_TEXT}

    + +
    + {S_HIDDEN_FIELDS} +   + +
    + +
    +
    +
    + + + + diff --git a/sources/phpBB/styles/prosilver/template/confirm_delete_body.html b/sources/phpBB/styles/prosilver/template/confirm_delete_body.html new file mode 100644 index 0000000..f0a7ab2 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/confirm_delete_body.html @@ -0,0 +1,70 @@ + +
    +

    {MESSAGE_TEXT}

    + + + + + + + + + +
    +   + +
    +
    + + + + + +
    +
    +
    + +

    {MESSAGE_TITLE}

    + +

    {MESSAGE_TEXT}

    + + +
    + +
    +
    +
    + +
    +
    + + +
    +

    {L_DELETE_REASON_EXPLAIN}
    +
    +
    +
    + + +
    + {S_HIDDEN_FIELDS} +   + +
    + +
    +
    +
    + + + diff --git a/sources/phpBB/styles/prosilver/template/drafts.html b/sources/phpBB/styles/prosilver/template/drafts.html new file mode 100644 index 0000000..ea2849a --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/drafts.html @@ -0,0 +1,49 @@ + + + +
    +
    + +

    {L_LOAD_DRAFT}

    +

    {L_LOAD_DRAFT_EXPLAIN}

    + +
    +
    + +
    +
    + +
      +
    • +
      +
      {L_LOAD_DRAFT}
      +
      {L_SAVE_DATE}
      +
      +
    • +
    + + +
    +
    + diff --git a/sources/phpBB/styles/prosilver/template/faq_body.html b/sources/phpBB/styles/prosilver/template/faq_body.html new file mode 100644 index 0000000..53205d1 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/faq_body.html @@ -0,0 +1,48 @@ + + +

    {L_FAQ_TITLE}

    + + + + + +
    +
    + +
    +

    {faq_block.BLOCK_TITLE}

    + +
    +
    {faq_block.faq_row.FAQ_QUESTION}
    +
    {faq_block.faq_row.FAQ_ANSWER}
    +
    {L_BACK_TO_TOP}
    +
    +
    + +
    + +
    +
    + + + + diff --git a/sources/phpBB/styles/prosilver/template/forum_fn.js b/sources/phpBB/styles/prosilver/template/forum_fn.js new file mode 100644 index 0000000..aabc567 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/forum_fn.js @@ -0,0 +1,936 @@ +/** +* phpBB3 forum functions +*/ + +/** +* Find a member +*/ +function find_username(url) { + 'use strict'; + + popup(url, 760, 570, '_usersearch'); + return false; +} + +/** +* Window popup +*/ +function popup(url, width, height, name) { + 'use strict'; + + if (!name) { + name = '_popup'; + } + + window.open(url.replace(/&/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes, width=' + width); + return false; +} + +/** +* Jump to page +*/ +function pageJump(item) { + 'use strict'; + + var page = item.val(), + perPage = item.attr('data-per-page'), + baseUrl = item.attr('data-base-url'), + startName = item.attr('data-start-name'); + + if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) { + if (baseUrl.indexOf('?') === -1) { + document.location.href = baseUrl + '?' + startName + '=' + ((page - 1) * perPage); + } else { + document.location.href = baseUrl.replace(/&/g, '&') + '&' + startName + '=' + ((page - 1) * perPage); + } + } +} + +/** +* Mark/unmark checklist +* id = ID of parent container, name = name prefix, state = state [true/false] +*/ +function marklist(id, name, state) { + 'use strict'; + + jQuery('#' + id + ' input[type=checkbox][name]').each(function() { + var $this = jQuery(this); + if ($this.attr('name').substr(0, name.length) === name) { + $this.prop('checked', state); + } + }); +} + +/** +* Resize viewable area for attached image or topic review panel (possibly others to come) +* e = element +*/ +function viewableArea(e, itself) { + 'use strict'; + + if (!e) { + return; + } + + if (!itself) { + e = e.parentNode; + } + + if (!e.vaHeight) { + // Store viewable area height before changing style to auto + e.vaHeight = e.offsetHeight; + e.vaMaxHeight = e.style.maxHeight; + e.style.height = 'auto'; + e.style.maxHeight = 'none'; + e.style.overflow = 'visible'; + } else { + // Restore viewable area height to the default + e.style.height = e.vaHeight + 'px'; + e.style.overflow = 'auto'; + e.style.maxHeight = e.vaMaxHeight; + e.vaHeight = false; + } +} + +/** +* Alternate display of subPanels +*/ +jQuery(function($) { + 'use strict'; + + $('.sub-panels').each(function() { + + var $childNodes = $('a[data-subpanel]', this), + panels = $childNodes.map(function () { + return this.getAttribute('data-subpanel'); + }), + showPanel = this.getAttribute('data-show-panel'); + + if (panels.length) { + activateSubPanel(showPanel, panels); + $childNodes.click(function () { + activateSubPanel(this.getAttribute('data-subpanel'), panels); + return false; + }); + } + }); +}); + +/** +* Activate specific subPanel +*/ +function activateSubPanel(p, panels) { + 'use strict'; + + var i, showPanel; + + if (typeof(p) === 'string') { + showPanel = p; + } + $('input[name="show_panel"]').val(showPanel); + + if (typeof panels === 'undefined') { + panels = jQuery('.sub-panels a[data-subpanel]').map(function() { + return this.getAttribute('data-subpanel'); + }); + } + + for (i = 0; i < panels.length; i++) { + jQuery('#' + panels[i]).css('display', panels[i] === showPanel ? 'block' : 'none'); + jQuery('#' + panels[i] + '-tab').toggleClass('activetab', panels[i] === showPanel); + } +} + +function selectCode(a) { + 'use strict'; + + // Get ID of code block + var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0]; + var s, r; + + // Not IE and IE9+ + if (window.getSelection) { + s = window.getSelection(); + // Safari and Chrome + if (s.setBaseAndExtent) { + var l = (e.innerText.length > 1) ? e.innerText.length - 1 : 1; + s.setBaseAndExtent(e, 0, e, l); + } + // Firefox and Opera + else { + // workaround for bug # 42885 + if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) === '
    ') { + e.innerHTML = e.innerHTML + ' '; + } + + r = document.createRange(); + r.selectNodeContents(e); + s.removeAllRanges(); + s.addRange(r); + } + } + // Some older browsers + else if (document.getSelection) { + s = document.getSelection(); + r = document.createRange(); + r.selectNodeContents(e); + s.removeAllRanges(); + s.addRange(r); + } + // IE + else if (document.selection) { + r = document.body.createTextRange(); + r.moveToElementText(e); + r.select(); + } +} + +/** +* Play quicktime file by determining it's width/height +* from the displayed rectangle area +*/ +function play_qt_file(obj) { + 'use strict'; + + var rectangle = obj.GetRectangle(); + var width, height; + + if (rectangle) { + rectangle = rectangle.split(','); + var x1 = parseInt(rectangle[0], 10); + var x2 = parseInt(rectangle[2], 10); + var y1 = parseInt(rectangle[1], 10); + var y2 = parseInt(rectangle[3], 10); + + width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1; + height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1; + } else { + width = 200; + height = 0; + } + + obj.width = width; + obj.height = height + 16; + + obj.SetControllerVisible(true); + obj.Play(); +} + +var inAutocomplete = false; +var lastKeyEntered = ''; + +/** +* Check event key +*/ +function phpbbCheckKey(event) { + 'use strict'; + + // Keycode is array down or up? + if (event.keyCode && (event.keyCode === 40 || event.keyCode === 38)) { + inAutocomplete = true; + } + + // Make sure we are not within an "autocompletion" field + if (inAutocomplete) { + // If return pressed and key changed we reset the autocompletion + if (!lastKeyEntered || lastKeyEntered === event.which) { + inAutocomplete = false; + return true; + } + } + + // Keycode is not return, then return. ;) + if (event.which !== 13) { + lastKeyEntered = event.which; + return true; + } + + return false; +} + +/** +* Apply onkeypress event for forcing default submit button on ENTER key press +*/ +jQuery(function($) { + 'use strict'; + + $('form input[type=text], form input[type=password]').on('keypress', function (e) { + var defaultButton = $(this).parents('form').find('input[type=submit].default-submit-action'); + + if (!defaultButton || defaultButton.length <= 0) { + return true; + } + + if (phpbbCheckKey(e)) { + return true; + } + + if ((e.which && e.which === 13) || (e.keyCode && e.keyCode === 13)) { + defaultButton.click(); + return false; + } + + return true; + }); +}); + +/** +* Functions for user search popup +*/ +function insertUser(formId, value) +{ + 'use strict'; + + var $form = jQuery(formId), + formName = $form.attr('data-form-name'), + fieldName = $form.attr('data-field-name'), + item = opener.document.forms[formName][fieldName]; + + if (item.value.length && item.type == 'textarea') { + value = item.value + '\n' + value; + } + + item.value = value; +} + +function insert_marked_users(formId, users) { + 'use strict'; + + for (var i = 0; i < users.length; i++) { + if (users[i].checked) { + insertUser(formId, users[i].value); + } + } + + window.close(); +} + +function insert_single_user(formId, user) { + 'use strict'; + + insertUser(formId, user); + window.close(); +} + +/** +* Parse document block +*/ +function parseDocument($container) { + 'use strict'; + + var test = document.createElement('div'), + oldBrowser = (typeof test.style.borderRadius == 'undefined'), + $body = $('body'); + + /** + * Reset avatar dimensions when changing URL or EMAIL + */ + $container.find('input[data-reset-on-edit]').on('keyup', function() { + $(this.getAttribute('data-reset-on-edit')).val(''); + }); + + /** + * Pagination + */ + $container.find('.pagination .page-jump-form :button').click(function() { + var $input = $(this).siblings('input.inputbox'); + pageJump($input); + }); + + $container.find('.pagination .page-jump-form input.inputbox').on('keypress', function(event) { + if (event.which === 13 || event.keyCode === 13) { + event.preventDefault(); + pageJump($(this)); + } + }); + + $container.find('.pagination .dropdown-trigger').click(function() { + var $dropdownContainer = $(this).parent(); + // Wait a little bit to make sure the dropdown has activated + setTimeout(function() { + if ($dropdownContainer.hasClass('dropdown-visible')) { + $dropdownContainer.find('input.inputbox').focus(); + } + }, 100); + }); + + /** + * Adjust HTML code for IE8 and older versions + */ + if (oldBrowser) { + // Fix .linklist.bulletin lists + $container.find('ul.linklist.bulletin > li:first-child, ul.linklist.bulletin > li.rightside:last-child').addClass('no-bulletin'); + } + + /** + * Resize navigation (breadcrumbs) block to keep all links on same line + */ + $container.find('.navlinks').each(function() { + var $this = $(this), + $left = $this.children().not('.rightside'), + $right = $this.children('.rightside'); + + if ($left.length !== 1 || !$right.length) { + return; + } + + function resize() { + var width = 0, + diff = $left.outerWidth(true) - $left.width(); + + $right.each(function() { + width += $(this).outerWidth(true); + }); + $left.css('max-width', Math.floor($this.width() - width - diff) + 'px'); + } + + resize(); + $(window).resize(resize); + }); + + /** + * Makes breadcrumbs responsive + */ + $container.find('.breadcrumbs:not([data-skip-responsive])').each(function() { + var $this = $(this), + $links = $this.find('.crumb'), + length = $links.length, + classes = ['wrapped-max', 'wrapped-wide', 'wrapped-medium', 'wrapped-small', 'wrapped-tiny'], + classesLength = classes.length, + maxHeight = 0, + lastWidth = false, + wrapped = false; + + // Set tooltips + $this.find('a').each(function() { + var $link = $(this); + $link.attr('title', $link.text()); + }); + + // Function that checks breadcrumbs + function check() { + var height = $this.height(), + width = $body.width(); + + maxHeight = parseInt($this.css('line-height')); + $links.each(function() { + if ($(this).height() > 0) { + maxHeight = Math.max(maxHeight, $(this).outerHeight(true)); + } + }); + + if (height <= maxHeight) { + if (!wrapped || lastWidth === false || lastWidth >= width) { + return; + } + } + lastWidth = width; + + if (wrapped) { + $this.removeClass('wrapped').find('.crumb.wrapped').removeClass('wrapped ' + classes.join(' ')); + if ($this.height() <= maxHeight) { + return; + } + } + + wrapped = true; + $this.addClass('wrapped'); + if ($this.height() <= maxHeight) { + return; + } + + for (var i = 0; i < classesLength; i ++) { + for (var j = length - 1; j >= 0; j --) { + $links.eq(j).addClass('wrapped ' + classes[i]); + if ($this.height() <= maxHeight) { + return; + } + } + } + } + + // Run function and set event + check(); + $(window).resize(check); + }); + + /** + * Responsive link lists + */ + $container.find('.linklist:not(.navlinks, [data-skip-responsive]), .postbody .post-buttons:not([data-skip-responsive])').each(function() { + var $this = $(this), + filterSkip = '.breadcrumbs, [data-skip-responsive]', + filterLast = '.edit-icon, .quote-icon, [data-last-responsive]', + $linksAll = $this.children(), + $linksNotSkip = $linksAll.not(filterSkip), // All items that can potentially be hidden + $linksFirst = $linksNotSkip.not(filterLast), // The items that will be hidden first + $linksLast = $linksNotSkip.filter(filterLast), // The items that will be hidden last + persistent = $this.attr('id') == 'nav-main', // Does this list already have a menu (such as quick-links)? + html = '', + slack = 3; // Vertical slack space (in pixels). Determines how sensitive the script is in determining whether a line-break has occured. + + // Add a hidden drop-down menu to each links list (except those that already have one) + if (!persistent) { + if ($linksNotSkip.is('.rightside')) { + $linksNotSkip.filter('.rightside:first').before(html); + $this.children('.responsive-menu').addClass('rightside'); + } else { + $this.append(html); + } + } + + // Set some object references and initial states + var $menu = $this.children('.responsive-menu'), + $menuContents = $menu.find('.dropdown-contents'), + persistentContent = $menuContents.find('li:not(.separator)').length, + lastWidth = false, + compact = false, + responsive1 = false, + responsive2 = false, + copied1 = false, + copied2 = false, + maxHeight = 0; + + // Find the tallest element in the list (we assume that all elements are roughly the same height) + $linksAll.each(function() { + if (!$(this).height()) { + return; + } + maxHeight = Math.max(maxHeight, $(this).outerHeight(true)); + }); + if (maxHeight < 1) { + return; // Shouldn't be possible, but just in case, abort + } else { + maxHeight = maxHeight + slack; + } + + function check() { + var width = $body.width(); + // We can't make it any smaller than this, so just skip + if (responsive2 && compact && (width <= lastWidth)) { + return; + } + lastWidth = width; + + // Reset responsive and compact layout + if (responsive1 || responsive2) { + $linksNotSkip.removeClass('hidden'); + $menuContents.children('.clone').addClass('hidden'); + responsive1 = responsive2 = false; + } + if (compact) { + $this.removeClass('compact'); + compact = false; + } + + // Unhide the quick-links menu if it has "persistent" content + if (persistent && persistentContent) { + $menu.removeClass('hidden'); + } else { + $menu.addClass('hidden'); + } + + // Nothing to resize if block's height is not bigger than tallest element's height + if ($this.height() <= maxHeight) { + return; + } + + // STEP 1: Compact + if (!compact) { + $this.addClass('compact'); + compact = true; + } + if ($this.height() <= maxHeight) { + return; + } + + // STEP 2: First responsive set - compact + if (compact) { + $this.removeClass('compact'); + compact = false; + } + // Copy the list items to the dropdown + if (!copied1) { + var $clones1 = $linksFirst.clone(); + $menuContents.prepend($clones1.addClass('clone clone-first').removeClass('leftside rightside')); + + if ($this.hasClass('post-buttons')) { + $('.button', $menuContents).removeClass('button icon-button'); + $('.responsive-menu-link', $menu).addClass('button icon-button').prepend(''); + } + copied1 = true; + } + if (!responsive1) { + $linksFirst.addClass('hidden'); + responsive1 = true; + $menuContents.children('.clone-first').removeClass('hidden'); + $menu.removeClass('hidden'); + } + if ($this.height() <= maxHeight) { + return; + } + + // STEP 3: First responsive set + compact + if (!compact) { + $this.addClass('compact'); + compact = true; + } + if ($this.height() <= maxHeight) { + return; + } + + // STEP 4: Last responsive set - compact + if (!$linksLast.length) { + return; // No other links to hide, can't do more + } + if (compact) { + $this.removeClass('compact'); + compact = false; + } + // Copy the list items to the dropdown + if (!copied2) { + var $clones2 = $linksLast.clone(); + $menuContents.prepend($clones2.addClass('clone clone-last').removeClass('leftside rightside')); + copied2 = true; + } + if (!responsive2) { + $linksLast.addClass('hidden'); + responsive2 = true; + $menuContents.children('.clone-last').removeClass('hidden'); + } + if ($this.height() <= maxHeight) { + return; + } + + // STEP 5: Last responsive set + compact + if (!compact) { + $this.addClass('compact'); + compact = true; + } + } + + if (!persistent) { + phpbb.registerDropdown($menu.find('a.responsive-menu-link'), $menu.find('.dropdown'), false); + } + + // If there are any images in the links list, run the check again after they have loaded + $linksAll.find('img').each(function() { + $(this).load(function() { + check(); + }); + }); + + check(); + $(window).resize(check); + }); + + /** + * Do not run functions below for old browsers + */ + if (oldBrowser) { + return; + } + + /** + * Adjust topiclist lists with check boxes + */ + $container.find('ul.topiclist dd.mark').siblings('dt').children('.list-inner').addClass('with-mark'); + + /** + * Appends contents of all extra columns to first column in + * .topiclist lists for mobile devices. Copies contents as is. + * + * To add that functionality to .topiclist list simply add + * responsive-show-all to list of classes + */ + $container.find('.topiclist.responsive-show-all > li > dl').each(function() { + var $this = $(this), + $block = $this.find('dt .responsive-show:last-child'), + first = true; + + // Create block that is visible only on mobile devices + if (!$block.length) { + $this.find('dt > .list-inner').append('
+ +
+ + + + + +
+
+ +
    + + + + + +
  • + +
    +
    + +
    + + + {forumrow.FORUM_IMAGE} + {forumrow.FORUM_NAME} +
    {forumrow.FORUM_DESC} + +
    {forumrow.L_MODERATOR_STR}{L_COLON} {forumrow.MODERATORS} + + + +
    {forumrow.L_SUBFORUM_STR}{L_COLON} + + {forumrow.subforum.SUBFORUM_NAME}{L_COMMA_SEPARATOR} + + + + + + + +
    +
    + +
    {L_REDIRECTS}{L_COLON} {forumrow.CLICKS}
    + +
    {forumrow.TOPICS} {L_TOPICS}
    +
    {forumrow.POSTS} {L_POSTS}
    +
    + + {UNAPPROVED_IMG} + + {UNAPPROVED_POST_IMG} + + {L_LAST_POST} + + + {forumrow.LAST_POST_SUBJECT_TRUNCATED}
    + + {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} + {LAST_POST_IMG}
    {forumrow.LAST_POST_TIME}{L_NO_POSTS}
     
    +
    + +
     
    + +
    + +
  • + + + + +
+ +
+
+ + + + +
+
+ {L_NO_FORUMS} +
+
+ diff --git a/sources/phpBB/styles/prosilver/template/index.htm b/sources/phpBB/styles/prosilver/template/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/sources/phpBB/styles/prosilver/template/index_body.html b/sources/phpBB/styles/prosilver/template/index_body.html new file mode 100644 index 0000000..f620b6e --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/index_body.html @@ -0,0 +1,74 @@ + + +

{LAST_VISIT_DATE}{CURRENT_TIME}

+

{CURRENT_TIME}

+ + + + + + + + + + + + +
+

{L_LOGIN_LOGOUT}  •  {L_REGISTER}

+ +
+ + + + + +
+

{L_WHO_IS_ONLINE}

{L_WHO_IS_ONLINE}

+

+ + {TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})
{RECORD_USERS}

{LOGGED_IN_USER_LIST} +
{L_LEGEND}{L_COLON} {LEGEND} + +

+
+ + + +
+

{L_BIRTHDAYS}

+

+ + {L_CONGRATULATIONS}{L_COLON} {birthdays.USERNAME} ({birthdays.AGE}), {L_NO_BIRTHDAYS} + +

+
+ + + +
+

{L_STATISTICS}

+

+ + {TOTAL_POSTS} • {TOTAL_TOPICS} • {TOTAL_USERS} • {NEWEST_USER} + +

+
+ + + + + diff --git a/sources/phpBB/styles/prosilver/template/jumpbox.html b/sources/phpBB/styles/prosilver/template/jumpbox.html new file mode 100644 index 0000000..3096d08 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/jumpbox.html @@ -0,0 +1,32 @@ + + +

{L_RETURN_TO_FORUM}

+ +

{L_RETURN_TO_INDEX}

+ +

{L_RETURN_TO_TOPIC}

+ +

{L_GO_TO_SEARCH_ADV}

+ + + + + + + +

+ diff --git a/sources/phpBB/styles/prosilver/template/login_body.html b/sources/phpBB/styles/prosilver/template/login_body.html new file mode 100644 index 0000000..c852ffd --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/login_body.html @@ -0,0 +1,68 @@ + + +
+
+
+ +
+ + +
class="fields1"class="fields2"> +
{LOGIN_ERROR}
+
+
+
+
+
+
+
+ +
{L_FORGOT_PASS}
+
{L_RESEND_ACTIVATION}
+ +
+ + + + + +
+
+
+
+ + + {S_LOGIN_REDIRECT} +
+
 
+
{S_HIDDEN_FIELDS}
+
+
+
+ + + + +
+
+ + + +
+
+ +
+

{L_REGISTER}

+

{L_LOGIN_INFO}

+

{L_TERMS_USE} | {L_PRIVACY}

+
+

{L_REGISTER}

+
+ +
+
+ + +
+ + diff --git a/sources/phpBB/styles/prosilver/template/login_body_oauth.html b/sources/phpBB/styles/prosilver/template/login_body_oauth.html new file mode 100644 index 0000000..156485d --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/login_body_oauth.html @@ -0,0 +1,8 @@ +
+ +
+
 
+
{oauth.SERVICE_NAME}
+
+ +
diff --git a/sources/phpBB/styles/prosilver/template/login_forum.html b/sources/phpBB/styles/prosilver/template/login_forum.html new file mode 100644 index 0000000..18a95c0 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/login_forum.html @@ -0,0 +1,41 @@ + + +

{FORUM_NAME}

+ +
+{S_FORM_TOKEN} +
+
+ +
+ + +

{L_LOGIN_FORUM}

+ +
+ +
+
 
+
{LOGIN_ERROR}
+
+ + +
+
+
+
+ {S_LOGIN_REDIRECT} +
+
 
+
{S_HIDDEN_FIELDS}
+
+
+
+ +
+
+ +
+ + + diff --git a/sources/phpBB/styles/prosilver/template/mcp_approve.html b/sources/phpBB/styles/prosilver/template/mcp_approve.html new file mode 100644 index 0000000..14472bc --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_approve.html @@ -0,0 +1,81 @@ + + +

{MESSAGE_TITLE}

+

{MESSAGE_TEXT}

+ + + + + + + + + + + +
+   + +
+ + + + + +
+
+ {S_FORM_TOKEN} +
+ +
+ +

{MESSAGE_TITLE}

+

{ADDITIONAL_MSG}

+ +
+ +
+
 
+
+
+ + + +
+
+
+
+
+
+

{L_CAN_LEAVE_BLANK}
+
+
+ + +
+
 
+
{MESSAGE_TEXT}
+
+
+ +
+ {S_HIDDEN_FIELDS}  + +
+ +
+ +
+
+ +
+ + + diff --git a/sources/phpBB/styles/prosilver/template/mcp_ban.html b/sources/phpBB/styles/prosilver/template/mcp_ban.html new file mode 100644 index 0000000..5a7eaa7 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_ban.html @@ -0,0 +1,139 @@ + + + + +
+ +

{L_TITLE}

+ +
+
+ +

{L_TITLE}

+

{L_EXPLAIN}

+ +
+ +
+
+
+
{L_FIND_USERNAME}
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+ +
+

{L_BAN_EXCLUDE_EXPLAIN}
+
+ + +
+
+ +
+ +
+
+ +
+ {S_HIDDEN_FIELDS}  + + {S_FORM_TOKEN} +
+ +
+
+ +

{L_UNBAN_TITLE}

+

{L_UNBAN_EXPLAIN}

+ + +
+ +
+
+
+
+
+
{L_BAN_LENGTH}{L_COLON}
+
+
+
+
{L_BAN_REASON}{L_COLON}
+
+
+
+
{L_BAN_GIVE_REASON}{L_COLON}
+
+
+ +
+ +
+
+ +
+ {S_HIDDEN_FIELDS}  + +
+ + + +

{L_NO_BAN_CELL}

+ + + + + +
+ + diff --git a/sources/phpBB/styles/prosilver/template/mcp_footer.html b/sources/phpBB/styles/prosilver/template/mcp_footer.html new file mode 100644 index 0000000..89ce7c3 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_footer.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sources/phpBB/styles/prosilver/template/mcp_forum.html b/sources/phpBB/styles/prosilver/template/mcp_forum.html new file mode 100644 index 0000000..8fdec01 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_forum.html @@ -0,0 +1,146 @@ + + + + + +

{L_FORUM}{L_COLON} {FORUM_NAME}

+ +
+ +
+
+ +
+ +
+ + +
    +
  • +
    +
    {L_TOPICS}
    +
    {L_REPLIES}
    +
    {L_LAST_POST}
    +
    {L_MARK}
    +
    +
  • +
+
    + + +
  • +
    +
    style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"> + +
    + + [ {L_SELECT_MERGE} ]   + {topicrow.TOPIC_TITLE} + {topicrow.UNAPPROVED_IMG} + {topicrow.DELETED_IMG} + {REPORTED_IMG} +  [ {L_DELETE_SHADOW_TOPIC} ] +
    + + + + + + + + +
    + {topicrow.ATTACH_ICON_IMG} + {L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} » {topicrow.FIRST_POST_TIME} +
    + +
    +
    +
    {topicrow.REPLIES} {L_REPLIES}
    +
    {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}
    {topicrow.LAST_POST_TIME}
    +
    + +
    + checked="checked" />  +
    + +
    +
  • + +
+ +
    +
  • {L_NO_TOPICS}

  • +
+ + +
+ + + + +
+ +
+ +
+ +
+ +
+
+ +
+ + + + + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/mcp_front.html b/sources/phpBB/styles/prosilver/template/mcp_front.html new file mode 100644 index 0000000..8fe7dfd --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_front.html @@ -0,0 +1,193 @@ + + +

{PAGE_TITLE}

+ + + + + +
+ +
+
+ +

{L_LATEST_UNAPPROVED}

+

{L_UNAPPROVED_TOTAL}

+ + +
    +
  • +
    +
    {L_VIEW_DETAILS}
    +
    {L_TOPIC} & {L_FORUM}
    +
    +
  • +
+ + + +
+ {S_FORM_TOKEN} +
+ + +
+ {S_HIDDEN_FIELDS} +   + + +
+ +
+ + + + + +
+
+ +

{L_LATEST_REPORTED}

+

{L_REPORTS_TOTAL}

+ + +
    +
  • +
    +
    {L_VIEW_DETAILS}
    +
    {L_REPORTER} & {L_FORUM}
    +
    +
  • +
+
    + + +
  • +
    +
    +
    + {report.SUBJECT} {report.ATTACH_ICON_IMG}
    + {L_POSTED} {L_POST_BY_AUTHOR} {report.AUTHOR_FULL} » {report.POST_TIME} +
    +
    +
    + {L_REPORTED} {L_POST_BY_AUTHOR} {report.REPORTER_FULL} {L_REPORTED_ON_DATE} {report.REPORT_TIME}
    + {L_FORUM}{L_COLON} {report.FORUM_NAME}
    +
    +
    +
  • + +
+ + +
+
+ + + + + +
+
+ +

{L_LATEST_REPORTED_PMS}

+

{L_PM_REPORTS_TOTAL}

+ + +
    +
  • +
    +
    {L_VIEW_DETAILS}
    +
    {L_REPORTER}
    +
    +
  • +
+
    + + +
  • +
    +
    +
    + {pm_report.PM_SUBJECT} {pm_report.ATTACH_ICON_IMG}
    + {L_MESSAGE_BY_AUTHOR} {pm_report.PM_AUTHOR_FULL} » {pm_report.PM_TIME}
    + {L_MESSAGE_TO} {pm_report.RECIPIENTS} +
    +
    +
    + {L_REPORTED} {L_POST_BY_AUTHOR} {pm_report.REPORTER_FULL} {L_REPORTED_ON_DATE} {pm_report.REPORT_TIME} +
    +
    +
  • + +
+ + +
+
+ + + + + +
+
+ +

{L_LATEST_LOGS}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_ACTION}{L_USERNAME}{L_IP}{L_VIEW_TOPIC}{L_VIEW_TOPIC_LOGS}{L_TIME}
{log.ACTION}{log.USERNAME}{log.IP}{L_VIEW_TOPIC} {L_VIEW_TOPIC_LOGS} {log.TIME}
{L_NO_ENTRIES}
+ +
+
+ + + + + diff --git a/sources/phpBB/styles/prosilver/template/mcp_header.html b/sources/phpBB/styles/prosilver/template/mcp_header.html new file mode 100644 index 0000000..6923988 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_header.html @@ -0,0 +1,49 @@ + + +

{L_MCP}

+ + +

+ [ {L_ACP} | {L_MCP} | {L_MODERATE_FORUM} | {L_MODERATE_TOPIC} | {L_MODERATE_POST} ] +

+ + +
+ +
+ +
+
+ +
+ + + +
+ +
+

{L_MESSAGE}

+

{MESSAGE}

+

{return_links.MESSAGE_LINK}

+
+ diff --git a/sources/phpBB/styles/prosilver/template/mcp_logs.html b/sources/phpBB/styles/prosilver/template/mcp_logs.html new file mode 100644 index 0000000..eaa3838 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_logs.html @@ -0,0 +1,95 @@ + + +

{L_TITLE}

+ +
+ +
+
+ +
+ {L_SEARCH_KEYWORDS}{L_COLON}   + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_USERNAME}{L_IP}{L_TIME}{L_ACTION}{L_MARK}
{log.USERNAME}{log.IP}{log.DATE}{log.ACTION}
+ {log.DATA} +
{L_NO_ENTRIES}
+ + +
+ + + + +
+ +
+ +
+ +
+ + {S_FORM_TOKEN} +
+
+ + +
+ +   + + +
+ + + {S_FORM_TOKEN} +
+
+ + + +
+ + diff --git a/sources/phpBB/styles/prosilver/template/mcp_message.html b/sources/phpBB/styles/prosilver/template/mcp_message.html new file mode 100644 index 0000000..062103b --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_message.html @@ -0,0 +1,8 @@ + + +
+

{MESSAGE_TITLE}

+

{MESSAGE_TEXT}

+
+ + diff --git a/sources/phpBB/styles/prosilver/template/mcp_move.html b/sources/phpBB/styles/prosilver/template/mcp_move.html new file mode 100644 index 0000000..d028fff --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_move.html @@ -0,0 +1,69 @@ + + +

{MESSAGE_TITLE}

+

{MESSAGE_TEXT}

+ +

{ADDITIONAL_MSG}

+ + + + + + + + + + + +
+   + +
+ + + + + +
+ +
+
+ +
+

{MESSAGE_TITLE}

+

{ADDITIONAL_MSG}

+ +
+
+
+
+
+
+
+
+
 
+
{MESSAGE_TEXT}
+
+
+ +
+ {S_HIDDEN_FIELDS}  + + {S_FORM_TOKEN} +
+ +
+ +
+
+
+ + + diff --git a/sources/phpBB/styles/prosilver/template/mcp_notes_front.html b/sources/phpBB/styles/prosilver/template/mcp_notes_front.html new file mode 100644 index 0000000..db10284 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_notes_front.html @@ -0,0 +1,28 @@ + + +
+ +

{L_TITLE}

+ +
+
+ +
+
+
+
+
{L_FIND_USERNAME}
+
+
+ +
+
+ +
+   + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/mcp_notes_user.html b/sources/phpBB/styles/prosilver/template/mcp_notes_user.html new file mode 100644 index 0000000..ec317b1 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_notes_user.html @@ -0,0 +1,129 @@ + + +
+ +

{L_TITLE}

+ +
+
+ +

{USERNAME_FULL}

+ +
+
+
{AVATAR_IMG}
+
+ +
+
+
{L_RANK}{L_COLON}
{RANK_TITLE}
+
 {L_RANK}{L_COLON}
{RANK_IMG}
+
{L_JOINED}{L_COLON}
{JOINED}
+
{L_TOTAL_POSTS}{L_COLON}
{POSTS}
+
{L_WARNINGS}{L_COLON}
{WARNINGS}
+
+
+
+ +
+
+ +
+
+ +

{L_ADD_FEEDBACK}

+

{L_ADD_FEEDBACK_EXPLAIN}

+ +
+ +
+ +
+
+ +
+ {S_HIDDEN_FIELDS}  + + {S_FORM_TOKEN} +
+ +
+
+ +
+ {L_SEARCH_KEYWORDS}{L_COLON}   + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_REPORT_BY}{L_IP}{L_TIME}{L_ACTION_NOTE}{L_MARK}
{usernotes.REPORT_BY}{usernotes.IP}{usernotes.REPORT_AT}{usernotes.ACTION}
{L_NO_ENTRIES}
+ +
+ +
+ + + +
+ +
+ +
+ +
+ +
+
+ + +
+ +   +
+ +
+ +
+ +
+ + diff --git a/sources/phpBB/styles/prosilver/template/mcp_post.html b/sources/phpBB/styles/prosilver/template/mcp_post.html new file mode 100644 index 0000000..10ec6f3 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_post.html @@ -0,0 +1,326 @@ + + + + +

{L_PM_REPORT_DETAILS}

+ +

{L_REPORT_DETAILS}

+ + +
+
+ +
+

{L_REPORT_REASON}{L_COLON} {REPORT_REASON_TITLE}

+

{L_REPORTED} {L_POST_BY_AUTHOR} {REPORTER_FULL} « {REPORT_DATE}

+ +

{L_REPORT_CLOSED}

+ +
+ + {REPORT_TEXT} + + {REPORT_REASON_DESCRIPTION} + +
+
+ +
+
+ +
+ +
+ +   + + + + {S_FORM_TOKEN} +
+
+ + +

{L_POST_DETAILS}

+ + +
+
+ +
+

{POST_SUBJECT}

+ + + + +

+ {L_SENT_AT}{L_COLON} {POST_DATE} +
{L_PM_FROM}{L_COLON} {POST_AUTHOR_FULL} +
{L_TO}{L_COLON} {to_recipient.NAME_FULL}{to_recipient.NAME}  +
{L_BCC}{L_COLON} {bcc_recipient.NAME_FULL}{bcc_recipient.NAME}  +

+ +

{MINI_POST_IMG} {L_POSTED} {L_POST_BY_AUTHOR} {POST_AUTHOR_FULL} » {POST_DATE}

+ + + +
+ +

+   + + + + {S_FORM_TOKEN} +

+
+ +
+ +

+   + + + + {S_FORM_TOKEN} +

+
+ + + +

+ {REPORTED_IMG} {L_MESSAGE_REPORTED} +

+ + +
+ {POST_PREVIEW} +
+ + +
+
{L_ATTACHMENTS}
+ +
{attachment.DISPLAY_ATTACHMENT}
+ +
+ + + +
+ {DELETED_MESSAGE} +
{L_REASON}{L_COLON} {DELETE_REASON} +
+ + + +
{SIGNATURE}
+ + + +
+
{L_THIS_PM_IP}{L_THIS_POST_IP}{L_COLON} + {POST_IPADDR}{POST_IP} ({POST_IP}{L_LOOKUP_IP}) + + {POST_IPADDR} ({POST_IP}){POST_IP} ({L_LOOKUP_IP}) +
+ + +
+ +
+
+ + +
+
+ +

{L_MOD_OPTIONS}

+ +
+ +
+
+
+
+
+ + +
+ [ {L_FIND_USERNAME} ] +
+
+ {S_FORM_TOKEN} +
+
+ + + +
+ +
+
+
+
+
+
+ {S_FORM_TOKEN} +
+
+ + +
+
+ + + + +
+
+ +

{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}{RETURN_REPORTS} | {L_VIEW_POST} | {L_VIEW_TOPIC} | {L_VIEW_FORUM}{RETURN_TOPIC}

+ +
+
+ + + + + + +
+
+ +
+ + +

{L_FEEDBACK}

+ + + {L_REPORTED_BY}{L_COLON} {usernotes.REPORT_BY} « {usernotes.REPORT_AT} +
+
{usernotes.ACTION}
+ +
+ + + +
+   + +
+ + + +

{L_ADD_FEEDBACK}

+

{L_ADD_FEEDBACK_EXPLAIN}

+ +
+ +
+ +
+   + + {S_FORM_TOKEN} +
+
+ +
+
+ + + +
+
+ +

{L_MCP_POST_REPORTS}

+ + + {L_REPORTED_BY}{L_COLON} {reports.REPORTER}{reports.REPORTER} « {reports.REPORT_TIME} +

{reports.REASON_TITLE}{L_COLON} {reports.REASON_DESC}
{reports.REPORT_TEXT}

+ + +
+
+ + + +
+
+ +

{L_THIS_POST_IP}{L_COLON} + {POST_IPADDR}{POST_IP} ({POST_IP}{L_LOOKUP_IP}) + + {POST_IPADDR} ({POST_IP}){POST_IP} ({L_LOOKUP_IP}) +

+ + + + + + + + + + + + + + + + + + + + +
{L_OTHER_USERS}{L_POSTS}
{userrow.USERNAME}{userrow.USERNAME}{userrow.NUM_POSTS}
{L_NO_MATCHES_FOUND}
+ + + + + + + + + + + + + + + + + + + + +
{L_IPS_POSTED_FROM}{L_POSTS}
{iprow.HOSTNAME} ({iprow.IP}){iprow.IP} ({L_LOOKUP_IP}){iprow.NUM_POSTS}
{L_NO_MATCHES_FOUND}
+ +

{L_LOOKUP_ALL}

+ +
+
+ + + + + + + diff --git a/sources/phpBB/styles/prosilver/template/mcp_queue.html b/sources/phpBB/styles/prosilver/template/mcp_queue.html new file mode 100644 index 0000000..864b231 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_queue.html @@ -0,0 +1,129 @@ + + +
+ +
+ + + {S_FORM_TOKEN} +
+ +

{L_TITLE}

+ +
+
+ +

{L_EXPLAIN}

+ + +
+ +
+ +
    +
  • +
    +
    {L_TOPIC}{L_POST}
    +
    {L_TOPIC} & {L_FORUM}
    +
    {L_MARK}
    +
    +
  • +
+ + +
+ + + + +
+ +
+ +
+ +
+ + +

+ + {L_NO_TOPICS_DELETED}{L_NO_POSTS_DELETED} + + {L_NO_TOPICS_QUEUE}{L_NO_POSTS_QUEUE} + +

+ + +
+
+ + +
+ +   + + +   + + + +
+ +
+ + diff --git a/sources/phpBB/styles/prosilver/template/mcp_reports.html b/sources/phpBB/styles/prosilver/template/mcp_reports.html new file mode 100644 index 0000000..24c0479 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_reports.html @@ -0,0 +1,118 @@ + + +
+ + +
+ + + {S_FORM_TOKEN} +
+ + +

{L_TITLE}

+ +
+
+ +

{L_EXPLAIN}

+ + +
+ +
+ +
    +
  • +
    +
    {L_VIEW_DETAILS}
    +
    {L_REPORTER} & {L_FORUM}
    +
    {L_MARK}
    +
    +
  • +
+
    + + +
  • +
    + +
    +
    + {postrow.PM_SUBJECT} {postrow.ATTACH_ICON_IMG}
    + {L_MESSAGE_BY_AUTHOR} {postrow.PM_AUTHOR_FULL} » {postrow.PM_TIME}
    + {L_MESSAGE_TO} {postrow.RECIPIENTS} + +
    +
    +
    + {postrow.REPORTER_FULL} « {postrow.REPORT_TIME} +
    + +
    +
    + {postrow.POST_SUBJECT} {postrow.ATTACH_ICON_IMG}
    + {L_POSTED} {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} » {postrow.POST_TIME} + +
    +
    +
    + {postrow.REPORTER_FULL} « {postrow.REPORT_TIME}
    + {L_FORUM}{L_COLON} {postrow.FORUM_NAME}{postrow.FORUM_NAME}
    +
    + +
    +
    +
  • + +
+ +
+ + + + +
+ +
+ +
+ +
+ + +

{L_NO_REPORTS}

+ + +
+
+ + +
+ +   + +
+ +
+ + diff --git a/sources/phpBB/styles/prosilver/template/mcp_topic.html b/sources/phpBB/styles/prosilver/template/mcp_topic.html new file mode 100644 index 0000000..082bea2 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_topic.html @@ -0,0 +1,186 @@ + + + + +
+ +
+
+ +
+
+

{L_POSTS_PER_PAGE_EXPLAIN}
+
+
+
+
+
{S_SELECT_SORT_DAYS}  
+
+
+ + +
+

{L_SPLIT_TOPIC_EXPLAIN}

+ + +
+
+
+
+
+ + +
+
+
+
+
+
+
+
+
+ + + +
+

{L_MERGE_TOPIC_EXPLAIN}

+
+
+
+ + {L_SELECT_TOPIC} +
+
{TO_TOPIC_INFO}
+
+
+ + +
+
+ +
+
+ +

+ {L_EXPAND_VIEW} + {L_TOPIC_REVIEW}{L_COLON} {TOPIC_TITLE} +

+ +
+ +
+
+ +
+ + +

{postrow.POST_SUBJECT}

+

{postrow.MINI_POST_IMG} {L_POSTED} {postrow.POST_DATE} {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} [ {L_POST_DETAILS} ]

+ + +

+ {L_POST_UNAPPROVED} +

+ + + +

+ {L_POST_DELETED} +

+ + + +

+ {L_POST_REPORTED} +

+ + +
{postrow.MESSAGE}
+ + +
+
{L_ATTACHMENTS}
+ +
{postrow.attachment.DISPLAY_ATTACHMENT}
+ +
+ + +
+ +
+
+ +
+ +
+ +
+ +
+ +
+
+ +
+   + + +{S_HIDDEN_FIELDS} +{S_FORM_TOKEN} +
+ +
+ + diff --git a/sources/phpBB/styles/prosilver/template/mcp_warn_front.html b/sources/phpBB/styles/prosilver/template/mcp_warn_front.html new file mode 100644 index 0000000..668a0d8 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_warn_front.html @@ -0,0 +1,97 @@ + + +
+ +

{L_WARN_USER}

+ +
+
+ +

{L_SELECT_USER}

+ +
+
+
+
+
{L_FIND_USERNAME}
+
+
+ +
+
+ +
+   + + {S_FORM_TOKEN} +
+
+ +
+
+ +

{L_MOST_WARNINGS}

+ + + + + + + + + + + + + + + + + + + + + + +
{L_USERNAME}{L_WARNINGS}{L_LATEST_WARNING_TIME}
{highest.USERNAME_FULL}{highest.WARNINGS}{highest.WARNING_TIME}{L_VIEW_NOTES}
+ +

{L_NO_WARNINGS}

+ + +
+
+ +
+
+ +

{L_LATEST_WARNINGS}

+ + + + + + + + + + + + + + + + + + + + + +
{L_USERNAME}{L_TIME}{L_TOTAL_WARNINGS}
{latest.USERNAME_FULL}{latest.WARNING_TIME}{latest.WARNINGS}{L_VIEW_NOTES}
+ +

{L_NO_WARNINGS}

+ + +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/mcp_warn_list.html b/sources/phpBB/styles/prosilver/template/mcp_warn_list.html new file mode 100644 index 0000000..d0e80a1 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_warn_list.html @@ -0,0 +1,76 @@ + + +
+ +

{L_WARNED_USERS}

+ +
+
+ +

{L_WARNED_USERS_EXPLAIN}

+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + +
{L_USERNAME}{L_WARNINGS}{L_LATEST_WARNING_TIME}
{user.USERNAME_FULL}{user.WARNINGS}{user.WARNING_TIME}{L_VIEW_NOTES}
+ +
+ + + +
+ +
+ +
+ +
+ + +

{L_NO_WARNINGS}

+ + +
+ +{S_FORM_TOKEN} +
+ +
+ + diff --git a/sources/phpBB/styles/prosilver/template/mcp_warn_post.html b/sources/phpBB/styles/prosilver/template/mcp_warn_post.html new file mode 100644 index 0000000..59c7d0d --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_warn_post.html @@ -0,0 +1,78 @@ + + +
+ +

{L_MCP_WARN_POST}

+ +
+
+ +

{USERNAME}{USERNAME}

+ +
+
+
{AVATAR_IMG}
+
+ +
+
+
{L_RANK}{L_COLON}
{RANK_TITLE}
+
 {L_RANK}{L_COLON}
{RANK_IMG}
+
{L_JOINED}{L_COLON}
{JOINED}
+
{L_TOTAL_POSTS}{L_COLON}
{POSTS}
+
{L_WARNINGS}{L_COLON}
{WARNINGS}
+
+
+
+ +
+
+ +
+
+ +

{L_POST_DETAILS}

+ +
+ +
+ {POST} +
+ +
+ +
+
+ + + +
+
+ +

{L_ADD_WARNING}

+

{L_ADD_WARNING_EXPLAIN}

+ +
+ + +

+
+
 
+
+
+ +
+ +
+
+ + + +
+   + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/mcp_warn_user.html b/sources/phpBB/styles/prosilver/template/mcp_warn_user.html new file mode 100644 index 0000000..1ad6df7 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_warn_user.html @@ -0,0 +1,62 @@ + + +
+ +

{L_WARN_USER}

+ +
+
+ +

{USERNAME_FULL}

+ +
+
+
{AVATAR_IMG}
+
+ +
+
+
{L_RANK}{L_COLON}
{RANK_TITLE}
+
 {L_RANK}{L_COLON}
{RANK_IMG}
+
{L_JOINED}{L_COLON}
{JOINED}
+
{L_TOTAL_POSTS}{L_COLON}
{POSTS}
+
{L_WARNINGS}{L_COLON}
{WARNINGS}
+
+
+
+ +
+
+ + + +
+
+ +

{L_ADD_WARNING}

+

{L_ADD_WARNING_EXPLAIN}

+ +
+ + +

+
+
 
+
+
+ +
+ +
+
+ + + +
+   + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/mcp_whois.html b/sources/phpBB/styles/prosilver/template/mcp_whois.html new file mode 100644 index 0000000..41a8254 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/mcp_whois.html @@ -0,0 +1,16 @@ + +

{L_WHOIS}

+ +
+
+ +

{L_RETURN_POST}

+
+
{WHOIS}
+
+

{L_RETURN_POST}

+ +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/memberlist_body.html b/sources/phpBB/styles/prosilver/template/memberlist_body.html new file mode 100644 index 0000000..512df7b --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/memberlist_body.html @@ -0,0 +1,160 @@ + + + +
+ + + + + + + + + +

style="color:#{GROUP_COLOR};">{GROUP_NAME}

+

{GROUP_DESC} {GROUP_TYPE}

+

+ {AVATAR_IMG} + {RANK_IMG} + {GROUP_RANK} +

+ +

{PAGE_TITLE}{L_COLON} {SEARCH_WORDS}

+ +
+ + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK}{L_GROUP_LEADER}{L_USERNAME}{L_POSTS}{L_COMMA_SEPARATOR} {custom_fields.PROFILE_FIELD_NAME}{L_JOINED}{L_LAST_ACTIVE}
 
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK}{L_GROUP_MEMBERS}{L_USERNAME}{L_POSTS}{L_COMMA_SEPARATOR} {custom_fields.PROFILE_FIELD_NAME}{L_JOINED}{L_LAST_ACTIVE}{L_GROUP_MEMBERS}{L_POSTS}{L_COMMA_SEPARATOR} {custom_fields.PROFILE_FIELD_NAME}{L_JOINED}{L_LAST_ACTIVE}
{memberrow.RANK_IMG}{memberrow.RANK_TITLE} {memberrow.USERNAME_FULL}
{L_SELECT} ]
{memberrow.POSTS}{memberrow.POSTS}
{memberrow.custom_fields.PROFILE_FIELD_VALUE}
 
{memberrow.JOINED}{memberrow.LAST_ACTIVE} 
{L_NO_MEMBERS}
+ +
+
+ + +
+ + +
+ + + +
+
+ + + +
+ + + +
+ + +
+ +
+ +
+ + + + + + + diff --git a/sources/phpBB/styles/prosilver/template/memberlist_email.html b/sources/phpBB/styles/prosilver/template/memberlist_email.html new file mode 100644 index 0000000..1bfd83e --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/memberlist_email.html @@ -0,0 +1,105 @@ + + + +

{L_CONTACT_ADMIN}

+ +

{L_SEND_EMAIL_USER}

+ +

{L_EMAIL_TOPIC}

+ + +
+ + +
+
+
+
+ {CONTACT_INFO} +
+
+
+
+
+ + +
+
+
+ +

{ERROR_MESSAGE}

+
+ +
+
+
{USERNAME_FULL}
+
+
+
+
+
+ +
+
+
{L_ADMINISTRATOR}
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ {L_DEST_LANG_EXPLAIN}
+
+
+ +
+

+ {L_EMAIL_BODY_EXPLAIN}
+
+
+ +
+
 
+
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+
+{S_FORM_TOKEN} +
+ +
+ + diff --git a/sources/phpBB/styles/prosilver/template/memberlist_im.html b/sources/phpBB/styles/prosilver/template/memberlist_im.html new file mode 100644 index 0000000..bc71aa0 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/memberlist_im.html @@ -0,0 +1,46 @@ + + +

{L_SEND_IM}

+ +
+ +
+
+ +

{L_SEND_IM_EXPLAIN}

+ +
+
+
+
{USERNAME} [ {IM_CONTACT} ] {PRESENCE_IMG}
+
+ + +
+
+
+
+
+
 
+
+
+
+
 
+
{L_IM_SENT_JABBER}
+
+ +
+
 
+
{L_IM_NO_JABBER}
+
+ + {S_FORM_TOKEN} +
+ +
+
+
+ +{L_CLOSE_WINDOW} + + diff --git a/sources/phpBB/styles/prosilver/template/memberlist_search.html b/sources/phpBB/styles/prosilver/template/memberlist_search.html new file mode 100644 index 0000000..ef5d29a --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/memberlist_search.html @@ -0,0 +1,87 @@ +

{L_FIND_USERNAME}

+ +
+
+
+ +

{L_FIND_USERNAME_EXPLAIN}

+ + +
+
+
+
+ + +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ + +
+ +
+ +
+ +
+   + + {S_FORM_TOKEN} +
+ +
+
+ +
diff --git a/sources/phpBB/styles/prosilver/template/memberlist_team.html b/sources/phpBB/styles/prosilver/template/memberlist_team.html new file mode 100644 index 0000000..fd2ba56 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/memberlist_team.html @@ -0,0 +1,47 @@ + + +

{PAGE_TITLE}

+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
{L_RANK} {group.GROUP_NAME}{group.GROUP_NAME}{L_PRIMARY_GROUP}{L_MODERATOR}
{group.user.RANK_IMG}{group.user.RANK_TITLE}{group.user.USERNAME_FULL} + style="font-weight: bold; color: #{group.user.GROUP_COLOR}" href="{group.user.U_GROUP}">{group.user.GROUP_NAME} + + {group.user.GROUP_NAME} + {group.user.FORUMS}-
{L_NO_MEMBERS}
+ +
+
+ + +
+ + + diff --git a/sources/phpBB/styles/prosilver/template/memberlist_view.html b/sources/phpBB/styles/prosilver/template/memberlist_view.html new file mode 100644 index 0000000..5d8e6ec --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/memberlist_view.html @@ -0,0 +1,132 @@ + + +

{PAGE_TITLE}

+ + + +
+
+
+ + +
+
{AVATAR_IMG}
+
{RANK_TITLE}
+
{RANK_IMG}
+
+ + +
+
{L_USERNAME}{L_COLON}
+
+ {USERNAME} + [ {L_EDIT_PROFILE} ] + [ {L_USER_ADMIN} ] + [ {L_USER_BAN} ] + [ {L_USE_PERMISSIONS} ] +
+ +
{L_RANK}{L_COLON}
{RANK_TITLE}
+
 {L_RANK}{L_COLON}
{RANK_IMG}
+ +
{L_USER_IS_INACTIVE}{L_COLON}
{USER_INACTIVE_REASON}
+
{L_AGE}{L_COLON}
{AGE}
+
{L_USERGROUPS}{L_COLON}
+ + +
{custom_fields.PROFILE_FIELD_NAME}{L_COLON}
{custom_fields.PROFILE_FIELD_VALUE}
+ + + + +
 
{L_REMOVE_FRIEND}
+ +
 
{L_REMOVE_FOE}
+ + +
 
{L_ADD_FRIEND}
+ + +
 
{L_ADD_FOE}
+ + + +
+ +
+
+ + +
+
+ +
+

{L_CONTACT_USER}

+ +
+
{L_EMAIL_ADDRESS}{L_COLON}
{L_SEND_EMAIL_USER}
+
{L_PM}{L_COLON}
{L_SEND_PRIVATE_MESSAGE}
+
{L_JABBER}{L_COLON}
{L_SEND_JABBER_MESSAGE}
{L_JABBER}{L_COLON}
{USER_JABBER}
+ + +
{custom_fields.PROFILE_FIELD_NAME}{L_COLON}
+ +
{custom_fields.PROFILE_FIELD_DESC}
+ +
{custom_fields.PROFILE_FIELD_VALUE}
+ + + + + +
{PROFILE_FIELD1_NAME}{L_COLON}
{PROFILE_FIELD1_VALUE}
+ +
+
+ +
+

{L_USER_FORUM}

+
+ +
{L_JOINED}{L_COLON}
{JOINED}
+
{L_LAST_ACTIVE}{L_COLON}
{LAST_ACTIVE}
+ +
{L_WARNINGS}{L_COLON}
+
{WARNINGS} [ {L_VIEW_NOTES} | {L_WARN_USER} ]
+ +
{L_TOTAL_POSTS}{L_COLON}
+
{POSTS} | {L_SEARCH_USER_POSTS} +
({POSTS_PCT} / {POSTS_DAY}) +
({L_POSTS_IN_QUEUE})
({L_POSTS_IN_QUEUE}) +
+ +
{L_ACTIVE_IN_FORUM}{L_COLON}
{ACTIVE_FORUM}
({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT}) -
+
{L_ACTIVE_IN_TOPIC}{L_COLON}
{ACTIVE_TOPIC}
({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT}) -
+ + +
+
+ +
+
+ + + +
+
+ +

{L_SIGNATURE}

+ +
{SIGNATURE}
+ +
+
+ + +
+ + + + + + diff --git a/sources/phpBB/styles/prosilver/template/message_body.html b/sources/phpBB/styles/prosilver/template/message_body.html new file mode 100644 index 0000000..71eca20 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/message_body.html @@ -0,0 +1,19 @@ + + + + + + +
+
+

{MESSAGE_TITLE}

+

{MESSAGE_TEXT}

+

{L_GO_TO_SEARCH_ADV}

+
+
+ + + + + + diff --git a/sources/phpBB/styles/prosilver/template/navbar_footer.html b/sources/phpBB/styles/prosilver/template/navbar_footer.html new file mode 100644 index 0000000..4a9275c --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/navbar_footer.html @@ -0,0 +1,27 @@ + diff --git a/sources/phpBB/styles/prosilver/template/navbar_header.html b/sources/phpBB/styles/prosilver/template/navbar_header.html new file mode 100644 index 0000000..41c5793 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/navbar_header.html @@ -0,0 +1,114 @@ + diff --git a/sources/phpBB/styles/prosilver/template/notification_dropdown.html b/sources/phpBB/styles/prosilver/template/notification_dropdown.html new file mode 100644 index 0000000..13d90a9 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/notification_dropdown.html @@ -0,0 +1,45 @@ + diff --git a/sources/phpBB/styles/prosilver/template/overall_footer.html b/sources/phpBB/styles/prosilver/template/overall_footer.html new file mode 100644 index 0000000..6f35d0e --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/overall_footer.html @@ -0,0 +1,54 @@ + +
+ + + + + +
+ +
+ + {RUN_CRON_TASK} +
+ + + + + + + + + + +{$SCRIPTS} + + + + + diff --git a/sources/phpBB/styles/prosilver/template/overall_header.html b/sources/phpBB/styles/prosilver/template/overall_header.html new file mode 100644 index 0000000..121094f --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/overall_header.html @@ -0,0 +1,103 @@ + + + + + +{META} +<!-- 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 --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{$STYLESHEETS} + + + + + + + + +
+ + + + + + +
+ +
+
+ {L_INFORMATION}{L_COLON} {L_BOARD_DISABLED} +
+
+ + + diff --git a/sources/phpBB/styles/prosilver/template/pagination.html b/sources/phpBB/styles/prosilver/template/pagination.html new file mode 100644 index 0000000..4680eaa --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/pagination.html @@ -0,0 +1,30 @@ + diff --git a/sources/phpBB/styles/prosilver/template/plupload.html b/sources/phpBB/styles/prosilver/template/plupload.html new file mode 100644 index 0000000..fc66311 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/plupload.html @@ -0,0 +1,69 @@ + + + diff --git a/sources/phpBB/styles/prosilver/template/posting_attach_body.html b/sources/phpBB/styles/prosilver/template/posting_attach_body.html new file mode 100644 index 0000000..81b2c2b --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/posting_attach_body.html @@ -0,0 +1,85 @@ +
+
+ +

{L_ADD_ATTACHMENT_EXPLAIN}

+ +
+
+
+
+ + +
+
+
+
+
+
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_PLUPLOAD_FILENAME}{L_FILE_COMMENT}{L_PLUPLOAD_SIZE}{L_PLUPLOAD_STATUS}
+ + +   + + + + + + + + + + + + +
+ {attach_row.FILENAME} + +   + + + + + + {attach_row.S_HIDDEN} + + {attach_row.FILESIZE} + + +
+
+
+
+
diff --git a/sources/phpBB/styles/prosilver/template/posting_body.html b/sources/phpBB/styles/prosilver/template/posting_body.html new file mode 100644 index 0000000..73b8270 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/posting_body.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/sources/phpBB/styles/prosilver/template/posting_buttons.html b/sources/phpBB/styles/prosilver/template/posting_buttons.html new file mode 100644 index 0000000..1555b12 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/posting_buttons.html @@ -0,0 +1,103 @@ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/sources/phpBB/styles/prosilver/template/posting_editor.html b/sources/phpBB/styles/prosilver/template/posting_editor.html new file mode 100644 index 0000000..e68e6a9 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/posting_editor.html @@ -0,0 +1,188 @@ +
+

{ERROR}

+ + +
+
+
+ + +
+
+ + + +
+
+
+
+ + + + + +
+
+
+
+ + + + + + + + + + +
+ + {L_SMILIES}
+ + {smiley.SMILEY_CODE} + + + +
{L_MORE_SMILIES} + + + +
+
+ {BBCODE_STATUS}
+ + {IMG_STATUS}
+ {FLASH_STATUS}
+ {URL_STATUS}
+ + {SMILIES_STATUS} +
+ + +
+ {L_BACK_TO_DRAFTS} + {L_TOPIC_REVIEW} + +
+ + + +
+ +
+ + +
+ + + + +
+
+ + + +
+
+
+ {S_HIDDEN_ADDRESS_FIELD} + {S_HIDDEN_FIELDS} +   +   + onclick="document.getElementById('postform').action += '#preview';" />  +   + +
+ +
+
+ + + +
+ +
+ + + +
+
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + + +
+ + + +
+
+
+
+ + + +
+
+
+
{L_STICK_TOPIC_FOR_EXPLAIN}
+
+ + + +
+
+
+
+ +
+ +
+ + + +
+
+
+
+ +
+ + + diff --git a/sources/phpBB/styles/prosilver/template/posting_layout.html b/sources/phpBB/styles/prosilver/template/posting_layout.html new file mode 100644 index 0000000..630afdb --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/posting_layout.html @@ -0,0 +1,84 @@ + + + +

{TOPIC_TITLE}

+ +

{FORUM_NAME}

+ + + +
+
+ + + {L_FORUM_RULES} + + {L_FORUM_RULES}
+ {FORUM_RULES} + + +
+
+ + +
+ + +
+
+ +

{L_INFORMATION}

+

{L_DRAFT_LOADED}

+ +
+
+ + + + + + + +
+
+
+

{L_SELECT_DESTINATION_FORUM}

+

{L_UNGLOBALISE_EXPLAIN}

+
+
+
+
+ +
+
 
+
+
+
+ +
+
+ + + + +
+
+ +

{L_POST_A}

+ + + + + {S_FORM_TOKEN} +
+
+ + + + + + + +
+ + diff --git a/sources/phpBB/styles/prosilver/template/posting_pm_header.html b/sources/phpBB/styles/prosilver/template/posting_pm_header.html new file mode 100644 index 0000000..032d8c6 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/posting_pm_header.html @@ -0,0 +1,83 @@ +
+ + + +
+
+
+
+ + +
+ +
+
+
+ + + + {L_FIND_USERNAME} + +
+
+ +
+
+
+ +
+
+
+ +
+
+ +
+ +
+
+
+
+ +
+
+
+ + +
+
+

{L_FIND_USERNAME}
+ +
+ + +
+
+ +
+
+ + + +
diff --git a/sources/phpBB/styles/prosilver/template/posting_pm_layout.html b/sources/phpBB/styles/prosilver/template/posting_pm_layout.html new file mode 100644 index 0000000..3bdadd0 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/posting_pm_layout.html @@ -0,0 +1,41 @@ + + + +
+
+ +

{L_INFORMATION}

+

{L_DRAFT_LOADED_PM}

+ +
+
+ + + + + + +

{L_TITLE}

+ +
+
+ +
+
+ +
+
+ + + + +
+
+ + + + + + + + diff --git a/sources/phpBB/styles/prosilver/template/posting_poll_body.html b/sources/phpBB/styles/prosilver/template/posting_poll_body.html new file mode 100644 index 0000000..a131c10 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/posting_poll_body.html @@ -0,0 +1,56 @@ +
+
+ + +

{L_ADD_POLL_EXPLAIN}

+ + +
+ + +
+
+
+
+ +
+
+
+
+
+

{L_POLL_OPTIONS_EXPLAIN}
+
+
+ +
+ +
+
+
+
{L_POLL_MAX_OPTIONS_EXPLAIN}
+
+
+
+
+
{L_POLL_FOR_EXPLAIN}
+
+ + +
+ +
+
+
+
+ + + +
+
+
+
+ +
+ +
+
diff --git a/sources/phpBB/styles/prosilver/template/posting_preview.html b/sources/phpBB/styles/prosilver/template/posting_preview.html new file mode 100644 index 0000000..a5aae8c --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/posting_preview.html @@ -0,0 +1,47 @@ +
+
+ + +
+

{L_PREVIEW}{L_COLON} {POLL_QUESTION}

+

{L_POLL_LENGTH}
{L_MAX_VOTES}

+ +
+ +
+
+
checked="checked" /> checked="checked" />
+
+ +
+
+ +
+
+ +
+
+ + + +
+

{L_PREVIEW}{L_COLON} {PREVIEW_SUBJECT}

+ +
{PREVIEW_MESSAGE}
+ + +
+
{L_ATTACHMENTS}
+ +
{attachment.DISPLAY_ATTACHMENT}
+ +
+ + +
{PREVIEW_SIGNATURE}
+
+ +
+
+ +
diff --git a/sources/phpBB/styles/prosilver/template/posting_review.html b/sources/phpBB/styles/prosilver/template/posting_review.html new file mode 100644 index 0000000..25b7194 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/posting_review.html @@ -0,0 +1,35 @@ +

{L_POST_REVIEW}

+ +

{L_POST_REVIEW_EXPLAIN}

+ + + +
+
+ {post_review_row.L_IGNORE_POST} + +
+
+ + +
+

{post_review_row.POST_SUBJECT}

+

{post_review_row.MINI_POST_IMG}{post_review_row.MINI_POST_IMG} {L_POST_BY_AUTHOR} {post_review_row.POST_AUTHOR_FULL} » {post_review_row.POST_DATE}

+
{post_review_row.MESSAGE}
+ + +
+
{L_ATTACHMENTS}
+ +
{post_review_row.attachment.DISPLAY_ATTACHMENT}
+ +
+ + +
+ +
+
+ + +
diff --git a/sources/phpBB/styles/prosilver/template/posting_smilies.html b/sources/phpBB/styles/prosilver/template/posting_smilies.html new file mode 100644 index 0000000..3bd5127 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/posting_smilies.html @@ -0,0 +1,27 @@ + + + + + +

{L_SMILIES}

+
+
+ + {smiley.SMILEY_CODE} + + +
+
+ + + +{L_CLOSE_WINDOW} + + diff --git a/sources/phpBB/styles/prosilver/template/posting_topic_review.html b/sources/phpBB/styles/prosilver/template/posting_topic_review.html new file mode 100644 index 0000000..6909877 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/posting_topic_review.html @@ -0,0 +1,73 @@ + +

+ {L_EXPAND_VIEW} + {L_TOPIC_REVIEW}{L_COLON} {TOPIC_TITLE} +

+ +
+ + + + +
+
+ {topic_review_row.L_IGNORE_POST} + +
+
+ + +
+

{topic_review_row.POST_SUBJECT}

+ + + + + +

{topic_review_row.MINI_POST_IMG}{topic_review_row.MINI_POST_IMG} {L_POST_BY_AUTHOR} {topic_review_row.POST_AUTHOR_FULL} » {topic_review_row.POST_DATE}

+
{topic_review_row.MESSAGE}
+ + +
+
{L_ATTACHMENTS}
+ +
{topic_review_row.attachment.DISPLAY_ATTACHMENT}
+ +
+ + + + + +
+
+
+ +
+ +
+ + +

{L_BACK_TO_TOP}

+ +

{L_BACK_TO_TOP}

+ diff --git a/sources/phpBB/styles/prosilver/template/profilefields/bool.html b/sources/phpBB/styles/prosilver/template/profilefields/bool.html new file mode 100644 index 0000000..f1d7ba7 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/profilefields/bool.html @@ -0,0 +1,7 @@ + + + + + checked="checked" /> + + diff --git a/sources/phpBB/styles/prosilver/template/profilefields/date.html b/sources/phpBB/styles/prosilver/template/profilefields/date.html new file mode 100644 index 0000000..5d5bc04 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/profilefields/date.html @@ -0,0 +1,5 @@ + + + + + diff --git a/sources/phpBB/styles/prosilver/template/profilefields/dropdown.html b/sources/phpBB/styles/prosilver/template/profilefields/dropdown.html new file mode 100644 index 0000000..243b703 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/profilefields/dropdown.html @@ -0,0 +1,5 @@ + + + diff --git a/sources/phpBB/styles/prosilver/template/profilefields/int.html b/sources/phpBB/styles/prosilver/template/profilefields/int.html new file mode 100644 index 0000000..a6f9a0a --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/profilefields/int.html @@ -0,0 +1,3 @@ + + + diff --git a/sources/phpBB/styles/prosilver/template/profilefields/string.html b/sources/phpBB/styles/prosilver/template/profilefields/string.html new file mode 100644 index 0000000..cf457d3 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/profilefields/string.html @@ -0,0 +1,3 @@ + + + diff --git a/sources/phpBB/styles/prosilver/template/profilefields/text.html b/sources/phpBB/styles/prosilver/template/profilefields/text.html new file mode 100644 index 0000000..f54c639 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/profilefields/text.html @@ -0,0 +1,3 @@ + + + diff --git a/sources/phpBB/styles/prosilver/template/profilefields/url.html b/sources/phpBB/styles/prosilver/template/profilefields/url.html new file mode 100644 index 0000000..8dd3a90 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/profilefields/url.html @@ -0,0 +1,3 @@ + + + diff --git a/sources/phpBB/styles/prosilver/template/quickreply_editor.html b/sources/phpBB/styles/prosilver/template/quickreply_editor.html new file mode 100644 index 0000000..6a88466 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/quickreply_editor.html @@ -0,0 +1,26 @@ +
+ +
+
+

{L_QUICKREPLY}

+
+
+
+
+
+ +
+ +
+ +
+
+ {S_FORM_TOKEN} + {QR_HIDDEN_FIELDS} +   +   +
+
+
+ +
diff --git a/sources/phpBB/styles/prosilver/template/report_body.html b/sources/phpBB/styles/prosilver/template/report_body.html new file mode 100644 index 0000000..2a5e6c9 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/report_body.html @@ -0,0 +1,55 @@ + + +

{L_REPORT_POST}{L_REPORT_MESSAGE}

+ +
+
+
+ +
+

{L_REPORT_POST_EXPLAIN}{L_REPORT_MESSAGE_EXPLAIN}

+ +
+
{ERROR}
+
+
+
+
+ +
+

{L_REPORT_NOTIFY_EXPLAIN}
+
+ + +
+
+ +
+

{L_CAN_LEAVE_BLANK}
+
+
+ + + +
+
+ +
+
+ +
+
+ +
+
+   + + {S_FORM_TOKEN} +
+
+ +
+
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/search_body.html b/sources/phpBB/styles/prosilver/template/search_body.html new file mode 100644 index 0000000..2f15830 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/search_body.html @@ -0,0 +1,122 @@ + + +

{L_SEARCH}

+ +
+ +
+
+

{L_SEARCH_QUERY}

+ +
+
+

{L_SEARCH_KEYWORDS_EXPLAIN}
+
+
+
+
+
+

{L_SEARCH_AUTHOR_EXPLAIN}
+
+
+
+ +
+
+ +
+
+ +

{L_SEARCH_OPTIONS}

+ +
+
+

{L_SEARCH_FORUMS_EXPLAIN}
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+ + +
+
+
+
+
{S_SELECT_SORT_KEY}  + + +
+
+
+
+
{S_SELECT_SORT_DAYS}
+
+
+
+
{L_POST_CHARACTERS}
+
+
+ +
+
+ +
+
+ +
+ {S_HIDDEN_FIELDS}  + +
+ +
+
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + +
{L_RECENT_SEARCHES}
{recentsearch.KEYWORDS}{recentsearch.TIME}
{L_NO_RECENT_SEARCHES}
+ +
+
+ + + diff --git a/sources/phpBB/styles/prosilver/template/search_results.html b/sources/phpBB/styles/prosilver/template/search_results.html new file mode 100644 index 0000000..970a7bc --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/search_results.html @@ -0,0 +1,192 @@ + + +

{SEARCH_TITLE}{SEARCH_MATCHES}{L_COLON} {SEARCH_WORDS}

+

{L_SEARCHED_QUERY}{L_COLON} {SEARCHED_QUERY}

+

{L_IGNORED_TERMS}{L_COLON} {IGNORED_WORDS}

+

{L_PHRASE_SEARCH_DISABLED}

+ + +

{L_RETURN_TO_TOPIC}

+ +

{L_GO_TO_SEARCH_ADV}

+ + + +
+ + + + + + +
+ + + + + +
+ +
+
    +
  • +
    +
    {L_TOPICS}
    +
    {L_REPLIES}
    +
    {L_VIEWS}
    +
    {L_LAST_POST}
    +
    +
  • +
+ + +
+
+ +
+
+ {L_NO_SEARCH_RESULTS} +
+
+ + + + + + +
+
+ + +
+ {searchresults.L_IGNORE_POST} +
+ +
+ +
{L_POST_BY_AUTHOR} {searchresults.POST_AUTHOR_FULL}
+
{searchresults.POST_DATE}
+
{L_FORUM}{L_COLON} {searchresults.FORUM_TITLE}
+
{L_TOPIC}{L_COLON} {searchresults.TOPIC_TITLE}
+
{L_REPLIES}{L_COLON} {searchresults.TOPIC_REPLIES}
+
{L_VIEWS}{L_COLON} {searchresults.TOPIC_VIEWS}
+ +
+ +
+

{searchresults.POST_SUBJECT}

+
{searchresults.MESSAGE}
+
+ + + + + + +
+
+ + +
+
+ {L_NO_SEARCH_RESULTS} +
+
+ + + + +
+ +
+ + + + + +
+ +
+ +
+ + + +
+ +
+ + + + + diff --git a/sources/phpBB/styles/prosilver/template/simple_footer.html b/sources/phpBB/styles/prosilver/template/simple_footer.html new file mode 100644 index 0000000..d5d0f45 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/simple_footer.html @@ -0,0 +1,34 @@ +
+ + + +
+
 
+
+
+ +
+ +

+
+
+ +
+
+
+ + + + + + + + + +{$SCRIPTS} + + + diff --git a/sources/phpBB/styles/prosilver/template/simple_header.html b/sources/phpBB/styles/prosilver/template/simple_header.html new file mode 100644 index 0000000..a0c7bc6 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/simple_header.html @@ -0,0 +1,39 @@ + + + + + +{META} +{SITENAME} • <!-- IF S_IN_MCP -->{L_MCP} • <!-- ELSEIF S_IN_UCP -->{L_UCP} • <!-- ENDIF -->{PAGE_TITLE} + + + + + + + + + + + + + + + + + +{$STYLESHEETS} + + + + + + + + + +
+ +
diff --git a/sources/phpBB/styles/prosilver/template/timezone.js b/sources/phpBB/styles/prosilver/template/timezone.js new file mode 100644 index 0000000..44ec1b0 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/timezone.js @@ -0,0 +1,20 @@ +/* global phpbb */ + +(function($) { // Avoid conflicts with other libraries + +'use strict'; + +$('#tz_date').change(function() { + phpbb.timezoneSwitchDate(false); +}); + +$('#tz_select_date_suggest').click(function(){ + phpbb.timezonePreselectSelect(true); +}); + +$(function () { + phpbb.timezoneEnableDateSelection(); + phpbb.timezonePreselectSelect($('#tz_select_date_suggest').attr('timezone-preselect') === 'true'); +}); + +})(jQuery); // Avoid conflicts with other libraries diff --git a/sources/phpBB/styles/prosilver/template/timezone_option.html b/sources/phpBB/styles/prosilver/template/timezone_option.html new file mode 100644 index 0000000..b8be456 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/timezone_option.html @@ -0,0 +1,28 @@ +
+
+ + + +
+ + + +
+
diff --git a/sources/phpBB/styles/prosilver/template/ucp_agreement.html b/sources/phpBB/styles/prosilver/template/ucp_agreement.html new file mode 100644 index 0000000..943774c --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_agreement.html @@ -0,0 +1,76 @@ + + + + + + + +
+

+ + {S_HIDDEN_FIELDS} +

+
+ +
+ + + +
+ +
+
+
+

{SITENAME} - {L_REGISTRATION}

+ +

{L_COPPA_BIRTHDAY}{L_TERMS_OF_USE}

+ +
+
+
+ +
+
+
+ + {L_COPPA_NO}  {L_COPPA_YES} + +   + + + {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} +
+
+
+
+ + + +
+
+
+

{SITENAME} - {AGREEMENT_TITLE}

+

{AGREEMENT_TEXT}

+
+

{L_BACK}

+
+
+
+ + + + diff --git a/sources/phpBB/styles/prosilver/template/ucp_attachments.html b/sources/phpBB/styles/prosilver/template/ucp_attachments.html new file mode 100644 index 0000000..1d49632 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_attachments.html @@ -0,0 +1,89 @@ + + +
+ +

{L_TITLE}

+ +
+
+ +

{L_ATTACHMENTS_EXPLAIN}

+ + +
+ +
+ + + + +
+ + + + {S_FORM_TOKEN} +
+ +
+ +
+ +
+ + +

{L_UCP_NO_ATTACHMENTS}

+ + +
+
+ + +
+ + + {S_FORM_TOKEN} +
+ +
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_auth_link.html b/sources/phpBB/styles/prosilver/template/ucp_auth_link.html new file mode 100644 index 0000000..078da58 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_auth_link.html @@ -0,0 +1,15 @@ + + +

{L_UCP_AUTH_LINK_TITLE}

+ +
+
+
{ERROR}
+ + + + +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_auth_link_oauth.html b/sources/phpBB/styles/prosilver/template/ucp_auth_link_oauth.html new file mode 100644 index 0000000..1831661 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_auth_link_oauth.html @@ -0,0 +1,29 @@ + +
+

{oauth.SERVICE_NAME}

+ +
+ +
+
{L_UCP_AUTH_LINK_ID}{L_COLON}
+
{oauth.UNIQUE_ID}
+
+
+
 
+
+
+ +
+
{L_UCP_AUTH_LINK_ASK}
+
+
+
 
+
+
+ +
+ {oauth.HIDDEN_FIELDS} + {S_HIDDEN_FIELDS} + {S_FORM_TOKEN} +
+ diff --git a/sources/phpBB/styles/prosilver/template/ucp_avatar_options.html b/sources/phpBB/styles/prosilver/template/ucp_avatar_options.html new file mode 100644 index 0000000..2cf9488 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_avatar_options.html @@ -0,0 +1,47 @@ +
+
+ +

{L_AVATAR_FEATURES_DISABLED}

+ + +
+

{ERROR}

+
+

{L_AVATAR_EXPLAIN}
+
{AVATAR}
+
+
+
+

{L_AVATAR_SELECT}

+
+
+
+
+
+
+
+ +
+ +

{avatar_drivers.L_EXPLAIN}

+ +
+ {avatar_drivers.OUTPUT} +
+
+ +
+ +
+   + +
+ +
+
diff --git a/sources/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html b/sources/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html new file mode 100644 index 0000000..b1076c2 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html @@ -0,0 +1,11 @@ +
+

{L_GRAVATAR_AVATAR_EMAIL_EXPLAIN}
+
+
+
+

{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}
+
+ ×  + +
+
diff --git a/sources/phpBB/styles/prosilver/template/ucp_avatar_options_local.html b/sources/phpBB/styles/prosilver/template/ucp_avatar_options_local.html new file mode 100644 index 0000000..2a0f403 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_avatar_options_local.html @@ -0,0 +1,19 @@ + + + + + + +

{L_NO_AVATARS}

+ diff --git a/sources/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html b/sources/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html new file mode 100644 index 0000000..a8f6135 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html @@ -0,0 +1,11 @@ +
+

{L_LINK_REMOTE_AVATAR_EXPLAIN}
+
+
+
+

{L_LINK_REMOTE_SIZE_EXPLAIN}
+
+ ×  + +
+
diff --git a/sources/phpBB/styles/prosilver/template/ucp_avatar_options_upload.html b/sources/phpBB/styles/prosilver/template/ucp_avatar_options_upload.html new file mode 100644 index 0000000..63a734e --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_avatar_options_upload.html @@ -0,0 +1,11 @@ +
+
+
+
+ + +
+

{L_UPLOAD_AVATAR_URL_EXPLAIN}
+
+
+ diff --git a/sources/phpBB/styles/prosilver/template/ucp_footer.html b/sources/phpBB/styles/prosilver/template/ucp_footer.html new file mode 100644 index 0000000..f2f1a68 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_footer.html @@ -0,0 +1,14 @@ + +
+ +
+
+
+ +
{S_FORM_TOKEN}
+ + + + + + diff --git a/sources/phpBB/styles/prosilver/template/ucp_groups_manage.html b/sources/phpBB/styles/prosilver/template/ucp_groups_manage.html new file mode 100644 index 0000000..3b805c4 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_groups_manage.html @@ -0,0 +1,247 @@ + + + style="color:#{GROUP_COLOR};">{L_USERGROUPS} :: {GROUP_NAME} + +
+ +
+
+ + +
+

{ERROR_MSG}

+
+ + +

{L_GROUPS_EXPLAIN}

+ + +

{L_GROUP_DETAILS}

+ +
+
+
+
style="color: #{GROUP_COLOUR};">{GROUP_NAME} +
+
+
+
+
+
  
+
+ +
+

{L_GROUP_TYPE_EXPLAIN}
+
+ + + + +
+
+ + + +
+ +
+
+ +
+
+

{L_GROUP_SETTINGS_SAVE}

+ +
+
+

{L_GROUP_COLOR_EXPLAIN}
+
+ +     + [ {L_COLOUR_SWATCH} ] + +
+
+
+
+
+
+
+ +
+
+ + + +
+ {S_HIDDEN_FIELDS} +   + + {S_FORM_TOKEN} +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_GROUP_LEAD}{L_GROUP_DEFAULT}{L_POSTS}{L_JOINED}{L_MARK}
{leader.USERNAME_FULL}{L_YES}{L_NO}{leader.USER_POSTS}{leader.JOINED} 
+ + + + + + + + + + + + + + + + + + +
{L_GROUP_PENDING}{L_GROUP_DEFAULT}{L_POSTS}{L_JOINED}{L_MARK}
+ + + + + + + + + + + + + + + + + + + + + + +
{L_GROUP_APPROVED}{L_GROUP_DEFAULT}{L_POSTS}{L_JOINED}{L_MARK}
{member.USERNAME_FULL}{L_YES}{L_NO}{member.USER_POSTS}{member.JOINED}
+ + + + + + + + + + + +
{L_MEMBERS}
{L_GROUPS_NO_MEMBERS}
+ + +
+ +
+ + +
+
+ +
+ + + +
+ +
+
+ +

{L_ADD_USERS}

+ +

{L_ADD_USERS_UCP_EXPLAIN}

+ +
+
+

{L_USER_GROUP_DEFAULT_EXPLAIN}
+
+ + +
+
+
+

{L_USERNAMES_EXPLAIN}
+
+
{L_FIND_USERNAME}
+
+
+ +
+
+ +
+ + {S_FORM_TOKEN} +
+ + + + +
    +
  • +
    +
    {L_GROUP_LEADER}
    +
    {L_OPTIONS}
    +
    +
  • +
+ + +

{L_NO_LEADERS}

+ + + + + + + + + diff --git a/sources/phpBB/styles/prosilver/template/ucp_groups_membership.html b/sources/phpBB/styles/prosilver/template/ucp_groups_membership.html new file mode 100644 index 0000000..d7df3b0 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_groups_membership.html @@ -0,0 +1,174 @@ + + +

{L_USERGROUPS}

+ +
+ +
+
+ +

{L_GROUPS_EXPLAIN}

+ + +
    +
  • +
    +
    {L_GROUP_LEADER}
    +
    {L_SELECT}
    +
    +
  • +
+ + + + +
    +
  • +
    +
    {L_GROUP_MEMBER}
    +
    {L_SELECT}
    +
    +
  • +
+ + +
+
+ + +
+
+
    +
  • +
    +
    {L_GROUP_PENDING}
    +
    {L_SELECT}
    +
    +
  • +
+ +
+
+ + +
+
+
    +
  • +
    +
    {L_GROUP_NONMEMBER}
    +
    {L_SELECT}
    +
    +
  • +
+ +
+
+ + + + +
+ +
+ + {S_FORM_TOKEN} +
+ + + +
+ +   + + {S_FORM_TOKEN} +
+ +
+ + +
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_header.html b/sources/phpBB/styles/prosilver/template/ucp_header.html new file mode 100644 index 0000000..a17f145 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_header.html @@ -0,0 +1,101 @@ + + +

{L_UCP}

+ +
+ +
+ + +
+ + +
+
+ +
+ +
+ + + +
+
+ +
+
{L_FRIENDS}
+ + +
{friends_online.USERNAME_FULL}
+ + + +
{friends_offline.USERNAME_FULL}
+ +
+ +
+
+ + + +
+
+ +
+
{L_MESSAGE_COLOURS}
+ +
{pm_colour_info.IMG} {pm_colour_info.LANG}
+ +
+ +
+
+ + +
+ +
diff --git a/sources/phpBB/styles/prosilver/template/ucp_login_link.html b/sources/phpBB/styles/prosilver/template/ucp_login_link.html new file mode 100644 index 0000000..d3c6931 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_login_link.html @@ -0,0 +1,58 @@ + + +
+
+ +

{SITENAME} - {L_LOGIN_LINK}

+ +

{L_LOGIN_LINK_EXPLAIN}

+ +
+
{LOGIN_LINK_ERROR}
+
+ +
+

{L_REGISTER}

+ + +
+
+
 
+
{S_HIDDEN_FIELDS}
+
+
+ +
+ +
+

{L_LOGIN}

+ +
+
+
{LOGIN_ERROR}
+
+
+
+
+
+
+
+
+ + + + + + {S_LOGIN_REDIRECT} +
+
 
+
{S_HIDDEN_FIELDS}
+
+
+
+
+ +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_main_bookmarks.html b/sources/phpBB/styles/prosilver/template/ucp_main_bookmarks.html new file mode 100644 index 0000000..f74728b --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_main_bookmarks.html @@ -0,0 +1,108 @@ + + +
+ +

{L_TITLE}

+ +
+
+ +

{L_BOOKMARKS_EXPLAIN}

+ + +

{L_BOOKMARKS_DISABLED}

+ + + +
    +
  • +
    +
    {L_BOOKMARKS}
    +
    {L_LAST_POST}
    +
    {L_MARK}
    +
    +
  • +
+
    + + +
  • + +
    +
    {L_DELETED_TOPIC}
    +
     
    +
    +
    + +
    + style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;" title="{topicrow.TOPIC_FOLDER_IMG_ALT}"> + +
    + {NEWEST_POST_IMG} {topicrow.TOPIC_TITLE} + {topicrow.UNAPPROVED_IMG} + {REPORTED_IMG}
    + + + +
    + {topicrow.ATTACH_ICON_IMG} + {L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} » {topicrow.FIRST_POST_TIME} +
    + +
    + +
    {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} + {LAST_POST_IMG}
    {topicrow.LAST_POST_TIME}
    +
    +
    +
    + +
  • + +
+ +
+ +
+ + +

{L_NO_BOOKMARKS}

+ + + + +
+
+ + +
+ + + {S_FORM_TOKEN} +
+ +
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_main_drafts.html b/sources/phpBB/styles/prosilver/template/ucp_main_drafts.html new file mode 100644 index 0000000..52ad5b5 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_main_drafts.html @@ -0,0 +1,79 @@ + + +
+ +

{L_TITLE}

+ +
+
+ +

{L_DRAFTS_EXPLAIN}

+ + + + +
+
+ +
+ {S_HIDDEN_FIELDS}  + + {S_FORM_TOKEN} +
+ + + + +
    +
  • +
    +
    {L_DRAFT_TITLE}
    +
    {L_SAVE_DATE}
    +
    {L_MARK}
    +
    +
  • +
+ + +

{L_NO_SAVED_DRAFTS}

+ + +
+
+ + +
+ + + {S_FORM_TOKEN} +
+ + + + + + + diff --git a/sources/phpBB/styles/prosilver/template/ucp_main_front.html b/sources/phpBB/styles/prosilver/template/ucp_main_front.html new file mode 100644 index 0000000..942d26e --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_main_front.html @@ -0,0 +1,68 @@ + + +

{L_TITLE}

+ +
+
+ +

{L_UCP_WELCOME}

+ + +

{L_IMPORTANT_NEWS}

+ +
    + +
  • +
    +
    style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"> + +
    + {NEWEST_POST_IMG} {topicrow.TOPIC_TITLE}
    + + + +
    + {topicrow.ATTACH_ICON_IMG} + {L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} » {topicrow.FIRST_POST_TIME} +
    + +
    +
    +
    {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} + {LAST_POST_IMG}
    {topicrow.LAST_POST_TIME}
    +
    +
    +
  • + +
+ + +

{L_YOUR_DETAILS}

+ +
+
{L_JOINED}{L_COLON}
{JOINED}
+
{L_LAST_ACTIVE}{L_COLON}
{LAST_VISIT_YOU}
+
{L_TOTAL_POSTS}{L_COLON}
{POSTS} | {L_SEARCH_YOUR_POSTS}
({POSTS_DAY} / {POSTS_PCT}){POSTS}
+
{L_ACTIVE_IN_FORUM}{L_COLON}
{ACTIVE_FORUM}
({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})
+
{L_ACTIVE_IN_TOPIC}{L_COLON}
{ACTIVE_TOPIC}
({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})
+
{L_YOUR_WARNINGS}{L_COLON}
{WARNING_IMG} [{WARNINGS}]
+
+ +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_main_subscribed.html b/sources/phpBB/styles/prosilver/template/ucp_main_subscribed.html new file mode 100644 index 0000000..ef03317 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_main_subscribed.html @@ -0,0 +1,147 @@ + + +
+ +

{L_TITLE}

+
+
+ +

{L_WATCHED_EXPLAIN}

+ + +
    +
  • +
    +
    {L_WATCHED_FORUMS}
    +
    {L_LAST_POST}
    +
    {L_MARK}
    +
    +
  • +
+
    + + +
  • +
    +
    + +
    + {forumrow.FORUM_NAME}
    + {forumrow.FORUM_DESC} + + + +
    +
    +
    {L_LAST_POST} {L_POST_BY_AUTHOR} {forumrow.LAST_POST_AUTHOR_FULL} + {LAST_POST_IMG}
    {forumrow.LAST_POST_TIME}
    + {L_NO_POSTS}
      +
    +
    +
    +
  • + +
+ +
    +
  • +
    +
    {L_WATCHED_FORUMS}
    +
    +
  • +
+

{L_NO_WATCHED_FORUMS}

+ +
+ + +
    +
  • +
    +
    {L_WATCHED_TOPICS}
    +
    {L_LAST_POST}
    +
    {L_MARK}
    +
    +
  • +
+ + +
+ +
+ + +
    +
  • +
    +
    {L_WATCHED_TOPICS}
    +
    +
  • +
+

{L_NO_WATCHED_TOPICS}

+ + +
+
+ + +
+ + + {S_FORM_TOKEN} +
+ +
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_notifications.html b/sources/phpBB/styles/prosilver/template/ucp_notifications.html new file mode 100644 index 0000000..500bae0 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_notifications.html @@ -0,0 +1,122 @@ + + +
+ +

{TITLE}

+
+
+ +

{TITLE_EXPLAIN}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_NOTIFICATION_TYPE}{notification_methods.NAME}{L_NOTIFICATIONS}
{notification_types.GROUP_NAME}
+ {notification_types.NAME} +
   {notification_types.EXPLAIN} +
checked="checked" /> checked="checked" />
+ + +
+ +
+ +
+
    +
  • +
    +
    {L_NOTIFICATIONS}
    +
    {L_MARK_READ}
    +
    +
  • +
+ +
+ +
+ +
+ + +

{L_NO_NOTIFICATIONS}

+ + + +
+
+ + +
+ + {S_HIDDEN_FIELDS} + + + {S_FORM_TOKEN} +
+ + +
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_pm_history.html b/sources/phpBB/styles/prosilver/template/ucp_pm_history.html new file mode 100644 index 0000000..0e9c384 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_pm_history.html @@ -0,0 +1,42 @@ + +

+ {L_EXPAND_VIEW} + {L_MESSAGE_HISTORY}{L_COLON} +

+ +
+ + +
+
+ +
+

class="current">{history_row.SUBJECT}

+ + + + + +

{history_row.MINI_POST_IMG} {L_SENT_AT}{L_COLON} {history_row.SENT_DATE}
+ {L_MESSAGE_BY_AUTHOR} {history_row.MESSAGE_AUTHOR_FULL}

+
{history_row.MESSAGE}{L_MESSAGE_REMOVED_FROM_OUTBOX}
+ +
+ +
+
+ +
+ +
+

{L_BACK_TO_TOP}

diff --git a/sources/phpBB/styles/prosilver/template/ucp_pm_message_footer.html b/sources/phpBB/styles/prosilver/template/ucp_pm_message_footer.html new file mode 100644 index 0000000..acf6f24 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_pm_message_footer.html @@ -0,0 +1,2 @@ +
{S_FORM_TOKEN}
+ diff --git a/sources/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/sources/phpBB/styles/prosilver/template/ucp_pm_message_header.html new file mode 100644 index 0000000..7be51e0 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_pm_message_header.html @@ -0,0 +1,61 @@ +

{L_TITLE}{L_COLON} {CUR_FOLDER_NAME}

+ +
+ +
+
+

{FOLDER_STATUS}

+ +
+ + + + + + + + + + + +
diff --git a/sources/phpBB/styles/prosilver/template/ucp_pm_options.html b/sources/phpBB/styles/prosilver/template/ucp_pm_options.html new file mode 100644 index 0000000..247be8b --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_pm_options.html @@ -0,0 +1,131 @@ + + +

{L_TITLE}

+ + + +
+
+ +

{ERROR_MESSAGE}

+

{NOTIFICATION_MESSAGE}

+ +

{L_DEFINED_RULES}

+ +
    + +
  1. {L_IF} {rule.CHECK} {rule.RULE} {rule.STRING} | {rule.ACTION}{L_COLON} {rule.FOLDER}
  2. + +
  3. {L_NO_RULES_DEFINED}
  4. + +
+ +

{L_ADD_NEW_RULE}

+ +
+ + +
+
for="check_option">{L_IF}{L_COLON}
+
+ {CHECK_CURRENT} +
+
+ + + +
+
+
{RULE_CURRENT}
+
+ + + + +
+
+
+ + + + +  [ {L_FIND_USERNAME} ] + + {L_NO_GROUPS} + + + + {COND_CURRENT} + +
+
+ + + + + + + + +
+
+
{ACTION_CURRENT}
+
+ + +
+ +

{L_FOLDER_OPTIONS}

+ +
+ + +
+
+
{L_MAX_FOLDER_REACHED}
+
+
+ + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + +
+ +
+
+
+
+
+
+ + +
+

{L_DEFAULT_ACTION_EXPLAIN}
+
{DEFAULT_ACTION}
+
+
+
+ +
+ {S_FORM_TOKEN} +
+ + + diff --git a/sources/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html b/sources/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html new file mode 100644 index 0000000..d93a622 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html @@ -0,0 +1,134 @@ + + + + + + + +

{L_EXPORT_AS_CSV}

+
+
+
+

{L_OPTIONS}

+
+
+
+
+
+
+
+
+
+
+
+
+
+ +   +   + {S_FORM_TOKEN} +
+
+ + + + +
+

{RULE_REMOVED_MESSAGES}

+
+ + + +
+

{NOT_MOVED_MESSAGES}
{RELEASE_MESSAGE_INFO}

+
+ + + +
    +
  • +
    +
    {L_MESSAGE}
    +
    {L_MARK}
    +
    +
  • +
+
    + + +
  • +
    + style="background-image: url({messagerow.PM_ICON_URL}); background-repeat: no-repeat;"> + +
    + + + {L_DELETE_MESSAGE}
    + {L_MESSAGE_REMOVED_FROM_OUTBOX} + + {messagerow.SUBJECT} + + +
    {L_PM_FROM_REMOVED_AUTHOR} + + + {REPORTED_IMG} {messagerow.ATTACH_ICON_IMG}
    + {L_MESSAGE_TO} {messagerow.RECIPIENTS}{L_MESSAGE_BY_AUTHOR} {messagerow.MESSAGE_AUTHOR_FULL} » {messagerow.SENT_TIME} + +
    + +
    {L_SENT_AT}{L_COLON} {messagerow.SENT_TIME}
    +
    {messagerow.FOLDER}{L_UNKNOWN_FOLDER}
    +
    +
    +
  • + + +
+ +

+ + {L_USER_NEW_PERMISSION_DISALLOWED}{L_NO_AUTH_SEND_MESSAGE} + + {L_NO_MESSAGES} + +

+ + + +
+

+ + +
+ +
+ +
+ +
+ + +
+
+ + +
+ + + + + +
+ + + + + diff --git a/sources/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/sources/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html new file mode 100644 index 0000000..02c5f5b --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html @@ -0,0 +1,161 @@ + + + + +
+
+ + + +
+ {L_VIEW_PREVIOUS_HISTORY} + {L_VIEW_NEXT_HISTORY} +
+ + + +
+
+ +
+
+
+ + {AUTHOR_AVATAR} + +
+ {MESSAGE_AUTHOR_FULL} +
+ +
{RANK_TITLE}
{RANK_IMG}
+ +
{L_POSTS}{L_COLON} {AUTHOR_POSTS}{AUTHOR_POSTS}
+
{L_JOINED}{L_COLON} {AUTHOR_JOINED}
+ + + + +
{custom_fields.PROFILE_FIELD_NAME}{L_COLON} {custom_fields.PROFILE_FIELD_VALUE}
+ + + + + + +
+ {L_CONTACT}{L_COLON} + +
+ + +
+ +
+

{SUBJECT}

+ + + + + +

+ {L_SENT_AT}{L_COLON} {SENT_DATE} +
{L_PM_FROM}{L_COLON} {MESSAGE_AUTHOR_FULL} +
{L_TO}{L_COLON} {to_recipient.NAME_FULL}{to_recipient.NAME}  +
{L_BCC}{L_COLON} {bcc_recipient.NAME_FULL}{bcc_recipient.NAME}  +

+ + +
{MESSAGE}
+ + +
+
+ {L_ATTACHMENTS} +
+ +
{attachment.DISPLAY_ATTACHMENT}
+ +
+ + + +
{L_DOWNLOAD_NOTICE}
+ + + +
{EDITED_MESSAGE} +
{L_REASON}{L_COLON} {EDIT_REASON} +
+ + + +
{SIGNATURE}
+ +
+ + + +
+
+ + +
+ {L_VIEW_PREVIOUS_PM} + {L_VIEW_NEXT_PM} + +   + + + + +
+ + + + + + + diff --git a/sources/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html b/sources/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html new file mode 100644 index 0000000..7fe0d67 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html @@ -0,0 +1,48 @@ + + + + + +{META} +{SITENAME} • {PAGE_TITLE} + + + + + +
+ + + + +
+
{PAGE_NUMBER}
+
+

{SUBJECT}

+
{L_SENT_AT} {SENT_DATE}
+
{L_PM_FROM} {MESSAGE_AUTHOR}
+ +
{L_TO} {to_recipient.NAME} 
+ + +
{L_BCC} {bcc_recipient.NAME} 
+ +
+
{MESSAGE}
+
+
+
+ + +
+ + + diff --git a/sources/phpBB/styles/prosilver/template/ucp_prefs_personal.html b/sources/phpBB/styles/prosilver/template/ucp_prefs_personal.html new file mode 100644 index 0000000..c8b028f --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_prefs_personal.html @@ -0,0 +1,124 @@ + + +
+ +

{L_TITLE}

+ +
+
+ +
+

{ERROR}

+ +
+
+
+ + +
+
+
+
+
+ + +
+
+
+

{L_ALLOW_PM_EXPLAIN}
+
+ + +
+
+ +
+

{L_HIDE_ONLINE_EXPLAIN}
+
+ + +
+
+ + +
+
+
+ + + +
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+

{L_BOARD_DATE_FORMAT_EXPLAIN}
+
+ +
+ +
+ +
+ +
+
+ +
+ {S_HIDDEN_FIELDS}  + + {S_FORM_TOKEN} +
+
+ + + + diff --git a/sources/phpBB/styles/prosilver/template/ucp_prefs_post.html b/sources/phpBB/styles/prosilver/template/ucp_prefs_post.html new file mode 100644 index 0000000..891e49a --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_prefs_post.html @@ -0,0 +1,53 @@ + + +
+ +

{L_TITLE}

+
+
+ +
+

{ERROR}

+ +
+
+
+ + +
+
+
+
+
+ + +
+
+
+
+
+ + +
+
+
+
+
+ + +
+
+ +
+ +
+
+ +
+ {S_HIDDEN_FIELDS}  + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_prefs_view.html b/sources/phpBB/styles/prosilver/template/ucp_prefs_view.html new file mode 100644 index 0000000..7f8d0a3 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_prefs_view.html @@ -0,0 +1,98 @@ + + +
+ +

{L_TITLE}

+ +
+
+ +
+

{ERROR}

+ +
+
+
+ + +
+
+
+
+
+ + +
+
+
+
+
+ + +
+
+
+
+
+ + +
+
+
+
+
+ + +
+
+ +
+
+
+ + +
+
+ + +
+ +
+
+
{S_TOPIC_SORT_DAYS}
+
+
+
+
{S_TOPIC_SORT_KEY}
+
+
+
+
{S_TOPIC_SORT_DIR}
+
+
+
+
+
{S_POST_SORT_DAYS}
+
+
+
+
{S_POST_SORT_KEY}
+
+
+
+
{S_POST_SORT_DIR}
+
+ +
+ +
+
+ +
+ {S_HIDDEN_FIELDS}  + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html b/sources/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html new file mode 100644 index 0000000..6fec0b8 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html @@ -0,0 +1,45 @@ + + +
+ +

{L_TITLE}

+
+
+

{L_PROFILE_AUTOLOGIN_KEYS}

+

{ERROR}

+ + + + + + + + + + + + + + + + + + + + + +
{L_LOGIN_KEY}{L_IP}{L_LOGIN_TIME}{L_MARK}
{sessions.IP}{sessions.LOGIN_TIME}
{L_PROFILE_NO_AUTOLOGIN_KEYS}
+
+
+ + +
+ {S_HIDDEN_FIELDS} + + {S_FORM_TOKEN} +
+ + +
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_profile_avatar.html b/sources/phpBB/styles/prosilver/template/ucp_profile_avatar.html new file mode 100644 index 0000000..8157d8c --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_profile_avatar.html @@ -0,0 +1,13 @@ + + +
+ +

{L_TITLE}

+ + + +{S_HIDDEN_FIELDS} +{S_FORM_TOKEN} +
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_profile_profile_info.html b/sources/phpBB/styles/prosilver/template/ucp_profile_profile_info.html new file mode 100644 index 0000000..e8e2aed --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_profile_profile_info.html @@ -0,0 +1,49 @@ + + +
+ +

{L_TITLE} [ {L_VIEW_PROFILE} ]

+ +
+
+

{L_PROFILE_INFO_NOTICE}

+ +
+

{ERROR}

+ +
+

{L_BIRTHDAY_EXPLAIN}
+
+ + + +
+
+ + +
+
+
+
+ + +
+
for="{profile_fields.FIELD_ID}">{profile_fields.LANG_NAME}{L_COLON} * +
{profile_fields.LANG_EXPLAIN}
+
{profile_fields.ERROR}
+
{profile_fields.FIELD}
+
+ +
+ +
+
+ +
+ {S_HIDDEN_FIELDS}  + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_profile_reg_details.html b/sources/phpBB/styles/prosilver/template/ucp_profile_reg_details.html new file mode 100644 index 0000000..4b26bc2 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_profile_reg_details.html @@ -0,0 +1,57 @@ + + +
+ +

{L_TITLE}

+
+
+ + +

{L_FORCE_PASSWORD_EXPLAIN}

+ + +
+

{ERROR}

+
+

{L_USERNAME_EXPLAIN}
+
{USERNAME}
+
+
+
+
{EMAIL}
+
+ +
+

{L_CHANGE_PASSWORD_EXPLAIN}
+
+
+
+

{L_CONFIRM_PASSWORD_EXPLAIN}
+
+
+ +
+
+
+ +
+
+ +
+
+

{L_CURRENT_CHANGE_PASSWORD_EXPLAIN}{L_CURRENT_PASSWORD_EXPLAIN}
+
+
+
+ +
+
+ +
+ {S_HIDDEN_FIELDS}  + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_profile_signature.html b/sources/phpBB/styles/prosilver/template/ucp_profile_signature.html new file mode 100644 index 0000000..614f6f4 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_profile_signature.html @@ -0,0 +1,51 @@ + + +
+ +

{L_TITLE}

+ + +
+
+

{L_SIGNATURE_PREVIEW}

+
+
{SIGNATURE_PREVIEW}
+
+
+
+ + +
+
+ +

{L_SIGNATURE_EXPLAIN}

+ + + +

{L_OPTIONS}

+
+ +
+ + +
+ + +
+ + +
+ +
+
+ +
+ {S_HIDDEN_FIELDS} +   +   + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_register.html b/sources/phpBB/styles/prosilver/template/ucp_register.html new file mode 100644 index 0000000..020f69c --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_register.html @@ -0,0 +1,108 @@ + + + + +
+ +
+
+ +

{SITENAME} - {L_REGISTRATION}

+ +
+
{ERROR}
+ +
{L_REG_COND}
+ + +
+

{L_USERNAME_EXPLAIN}
+
+
+
+
+
+
+
+

{L_PASSWORD_EXPLAIN}
+
+
+
+
+
+
+ + +
+ + +
+
+
+
+ + + + + +
{L_ITEMS_REQUIRED}
+ + +
+
for="{profile_fields.FIELD_ID}">{profile_fields.LANG_NAME}{L_COLON} * +
{profile_fields.LANG_EXPLAIN} +
{profile_fields.ERROR}
+
{profile_fields.FIELD}
+
+ + + + +
+
+
+ + + + + + + + +
+
+ +

{L_COPPA_COMPLIANCE}

+ +

{L_COPPA_EXPLAIN}

+
+
+ + +
+
+ +
+ {S_HIDDEN_FIELDS} +   + + {S_FORM_TOKEN} +
+ +
+
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_remind.html b/sources/phpBB/styles/prosilver/template/ucp_remind.html new file mode 100644 index 0000000..0ab1251 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_remind.html @@ -0,0 +1,32 @@ + + +
+ +
+
+ +
+

{L_SEND_PASSWORD}

+ +
+
+
+
+
+
+

{L_EMAIL_REMIND}
+
+
+
+
 
+
{S_HIDDEN_FIELDS} 
+
+ {S_FORM_TOKEN} +
+
+ +
+
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_resend.html b/sources/phpBB/styles/prosilver/template/ucp_resend.html new file mode 100644 index 0000000..7713efe --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_resend.html @@ -0,0 +1,32 @@ + + + +
+ +
+
+ +
+

{L_UCP_RESEND}

+ +
+
+
+
+
+
+

{L_EMAIL_REMIND}
+
+
+
+
 
+
{S_HIDDEN_FIELDS}{S_FORM_TOKEN} 
+
+
+
+ +
+
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_zebra_foes.html b/sources/phpBB/styles/prosilver/template/ucp_zebra_foes.html new file mode 100644 index 0000000..712479d --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_zebra_foes.html @@ -0,0 +1,41 @@ + + +
+ +

{L_TITLE}

+ +
+
+ +

{L_FOES_EXPLAIN}

+ +
+

{ERROR}

+
+

{L_YOUR_FOES_EXPLAIN}
+
+ + + + {L_NO_FOES} + +
+
+
+

{L_ADD_FOES_EXPLAIN}
+
+
{L_FIND_USERNAME}
+
+
+ +
+
+ +
+ {S_HIDDEN_FIELDS}  + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/ucp_zebra_friends.html b/sources/phpBB/styles/prosilver/template/ucp_zebra_friends.html new file mode 100644 index 0000000..fac0a18 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/ucp_zebra_friends.html @@ -0,0 +1,43 @@ + + +
+ +

{L_TITLE}

+ +
+
+ +

{L_FRIENDS_EXPLAIN}

+ +
+

{ERROR}

+ +
+

{L_YOUR_FRIENDS_EXPLAIN}
+
+ + + + {L_NO_FRIENDS} + +
+
+ +
+

{L_ADD_FRIENDS_EXPLAIN}
+
+
{L_FIND_USERNAME}
+
+
+ +
+
+ +
+ {S_HIDDEN_FIELDS}  + + {S_FORM_TOKEN} +
+
+ + diff --git a/sources/phpBB/styles/prosilver/template/viewforum_body.html b/sources/phpBB/styles/prosilver/template/viewforum_body.html new file mode 100644 index 0000000..43e994f --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/viewforum_body.html @@ -0,0 +1,272 @@ + + +

{FORUM_NAME}

+ + +
+ +
{FORUM_DESC}
+

{L_MODERATOR}{L_MODERATORS}{L_COLON} {MODERATORS}

+
+ + + +
+
+ + + {L_FORUM_RULES} + + {L_FORUM_RULES}
+ {FORUM_RULES} + + +
+
+ + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + +
+
+ {L_NO_READ_ACCESS} +
+
+ + + +
+ +
+
+ +
+

{L_LOGIN_LOGOUT}  •  {L_REGISTER}

+ +
+
+
+
+
+
+
+
+
+
+
+
+
 
+
+
+ {S_LOGIN_REDIRECT} +
+
+ +
+
+ +
+ + + + + + + + + + + + + + +
+
+
    +
  • +
    + id="active_topics">
    {L_ACTIVE_TOPICS}{L_ANNOUNCEMENTS}{L_TOPICS}
    +
    {L_REPLIES}
    +
    {L_VIEWS}
    +
    {L_LAST_POST}
    +
    +
  • +
+ +
+
+ + + + +
+
+ {L_NO_TOPICS} +
+
+ + + + +
+
+ + + + + + +
+
+
+ + + +
+ + + + + +
+ + + + + +
+

{L_WHO_IS_ONLINE}{L_WHO_IS_ONLINE}

+

{LOGGED_IN_USER_LIST}

+
+ + + +
+

{L_FORUM_PERMISSIONS}

+

{rules.RULE}

+
+ + + diff --git a/sources/phpBB/styles/prosilver/template/viewonline_body.html b/sources/phpBB/styles/prosilver/template/viewonline_body.html new file mode 100644 index 0000000..ee1672c --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/viewonline_body.html @@ -0,0 +1,63 @@ + + +

{TOTAL_REGISTERED_USERS_ONLINE}

+

{TOTAL_GUEST_USERS_ONLINE}{L_SWITCH_GUEST_DISPLAY}

+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_USERNAME}{L_FORUM_LOCATION}{L_LAST_UPDATED}
{user_row.USERNAME_FULL} {L_IP}{L_COLON} {user_row.USER_IP} » {L_WHOIS} +
{user_row.USER_BROWSER}
{user_row.FORUM_LOCATION}{user_row.LASTUPDATE}
{L_NO_ONLINE_USERS}{L_SWITCH_GUEST_DISPLAY}
+ +
+
+ +

{L_LEGEND}{L_COLON} {LEGEND}

+ +
+ +
+ + + diff --git a/sources/phpBB/styles/prosilver/template/viewonline_whois.html b/sources/phpBB/styles/prosilver/template/viewonline_whois.html new file mode 100644 index 0000000..5d78049 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/viewonline_whois.html @@ -0,0 +1,12 @@ + + +

{L_WHOIS}

+ +
+
+
{WHOIS}
+
+
+{L_CLOSE_WINDOW} + + diff --git a/sources/phpBB/styles/prosilver/template/viewtopic_body.html b/sources/phpBB/styles/prosilver/template/viewtopic_body.html new file mode 100644 index 0000000..7850412 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/viewtopic_body.html @@ -0,0 +1,398 @@ + + +

{TOPIC_TITLE}

+ +
{FORUM_DESC}
+ + +

+ {L_MODERATOR}{L_MODERATORS}{L_COLON} {MODERATORS} +

+ + + +
+
+ + + {L_FORUM_RULES} + + {L_FORUM_RULES}
+ {FORUM_RULES} + + +
+
+ + +
+ + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+

{POLL_QUESTION}

+

{L_POLL_LENGTH}
{L_MAX_VOTES}

+ +
+ + +
title="{L_POLL_VOTED_OPTION}" data-poll-option-id="{poll_option.POLL_OPTION_ID}"> +
{poll_option.POLL_OPTION_CAPTION}
+
checked="checked" /> checked="checked" />
+
{poll_option.POLL_OPTION_RESULT}
+
{L_NO_VOTES}{poll_option.POLL_OPTION_PERCENT}
+
+ + + +
+
 
+
{L_TOTAL_VOTES}{L_COLON} {TOTAL_VOTES}
+
+ + +
+
 
+
+
+ + + +
+
 
+
{L_VIEW_RESULTS}
+
+ +
+ +
+ +
+ {S_FORM_TOKEN} + {S_HIDDEN_FIELDS} +
+ +
+
+ + + + + + data-url="{postrow.U_MINI_POST}"> + +
+
+ +
style="display: none;"> +
+
+ + + {postrow.POSTER_AVATAR}{postrow.POSTER_AVATAR} + + +
+ + {postrow.POST_AUTHOR_FULL}{postrow.POST_AUTHOR_FULL} + +
+ +
{postrow.RANK_TITLE}
{postrow.RANK_IMG}
+ +
{L_POSTS}{L_COLON} {postrow.POSTER_POSTS}
+
{L_JOINED}{L_COLON} {postrow.POSTER_JOINED}
+
{L_WARNINGS}{L_COLON} {postrow.POSTER_WARNINGS}
+ + + +
{postrow.PROFILE_FIELD1_NAME}{L_COLON} {postrow.PROFILE_FIELD1_VALUE}
+ + + + + +
{postrow.custom_fields.PROFILE_FIELD_NAME}{L_COLON} {postrow.custom_fields.PROFILE_FIELD_VALUE}
+ + + + + + +
+ {L_CONTACT}{L_COLON} + +
+ + + +
+ +
+ + +
+ {postrow.L_POST_DELETED_MESSAGE}
+ {postrow.L_POST_DISPLAY} +
+ +
+ {postrow.L_IGNORE_POST}
+ {postrow.L_POST_DISPLAY} +
+ + +
style="display: none;"> + +

class="first"> {postrow.POST_SUBJECT}

+ + + + + + + +

{postrow.MINI_POST_IMG}{postrow.MINI_POST_IMG}{L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} » {postrow.POST_DATE}

+ + +
+

+ {L_POST_UNAPPROVED_ACTION} + + + + {S_FORM_TOKEN} +

+
+ +
+

+ {L_POST_DELETED_ACTION} + + + + {S_FORM_TOKEN} +

+
+ + + +

+ {L_POST_REPORTED} +

+ + +
{postrow.MESSAGE}
+ + +
+
+ {L_ATTACHMENTS} +
+ +
{postrow.attachment.DISPLAY_ATTACHMENT}
+ +
+ + + +
{L_DOWNLOAD_NOTICE}
+ +
+ {postrow.DELETED_MESSAGE} +
{L_REASON}{L_COLON} {postrow.DELETE_REASON} +
+ +
+ {postrow.EDITED_MESSAGE} +
{L_REASON}{L_COLON} {postrow.EDIT_REASON} +
+ + +


{postrow.BUMPED_MESSAGE}
+ +
{postrow.SIGNATURE}
+ + +
+ +
+ + + +
+
+ +
+ + + + + + + + +
+
+ + + + + +
+
+
+ + + +
+ + + + + + + + + + + +
+
+ + + + + +
+

{L_WHO_IS_ONLINE}{L_WHO_IS_ONLINE}

+

{LOGGED_IN_USER_LIST}

+
+ + + diff --git a/sources/phpBB/styles/prosilver/template/viewtopic_print.html b/sources/phpBB/styles/prosilver/template/viewtopic_print.html new file mode 100644 index 0000000..6619929 --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/viewtopic_print.html @@ -0,0 +1,44 @@ + + + + + +{META} +{SITENAME} • {PAGE_TITLE} + + + + + +
+ + + + +
+
{PAGE_NUMBER}
+ +
+

{postrow.POST_SUBJECT}

+
{L_POSTED}{L_COLON} {postrow.POST_DATE}
+
{L_POST_BY_AUTHOR} {postrow.POST_AUTHOR}
+
{postrow.MESSAGE}
+
+
+ +
+ + +
+ + + diff --git a/sources/phpBB/styles/prosilver/template/viewtopic_topic_tools.html b/sources/phpBB/styles/prosilver/template/viewtopic_topic_tools.html new file mode 100644 index 0000000..8378e3b --- /dev/null +++ b/sources/phpBB/styles/prosilver/template/viewtopic_topic_tools.html @@ -0,0 +1,25 @@ + + + diff --git a/sources/phpBB/styles/prosilver/theme/bidi.css b/sources/phpBB/styles/prosilver/theme/bidi.css new file mode 100644 index 0000000..889110e --- /dev/null +++ b/sources/phpBB/styles/prosilver/theme/bidi.css @@ -0,0 +1,1140 @@ +/* RTL definitions +---------------------------------------- */ + +/** +* common.css +*/ +.rtl h1 { + margin-right: 0; + margin-left: 200px; +} + +.rtl p.right { + text-align: left; +} + +.rtl div.rules ul { + margin-left: 0; + margin-right: 20px; +} + +/* Main blocks +---------------------------------------- */ +.rtl .logo { + float: right; + padding: 10px 10px 0 13px; +} + +/* Site Description +--------------------------------------------- */ +.rtl #site-description { + float: right; +} + +.rtl #site-description h1 { + margin-left: 0; +} + +/* Round cornered boxes and backgrounds +---------------------------------------- */ +.rtl .post { + background-position: 0 0; +} + +/* Horizontal lists +----------------------------------------*/ +.rtl ul.linklist > li { + float: right; + margin-right: 0; + margin-left: 7px; +} + +.rtl ul.linklist > li.rightside, .rtl p.rightside, .rtl a.rightside { + float: left; + margin-right: 7px; + margin-left: 0; + text-align: left; +} + +.rtl ul.leftside > li, .rtl ul.rightside > li { + float: left; +} + +.rtl ul.leftside { + float: right; + margin-left: 5px; + margin-right: 0; + text-align: right; +} + +.rtl ul.rightside { + float: left; + margin-left: -5px; + margin-right: 5px; + text-align: left; +} + +/* Bulletin icons for list items +----------------------------------------*/ +.rtl ul.linklist.bulletin > li:before { + padding-left: 4px; + padding-right: 0; +} + +.rtl ul.linklist li.responsive-menu a.responsive-menu-link:before { + left: auto; + right: 0; +} + +/* Dropdown menu +---------------------------------------- */ +.rtl .dropdown-container.topic-tools { + float: right; +} + +.rtl .dropdown li { + text-align: right; +} + +.rtl .dropdown-contents > li { + padding-left: 15px; + padding-right: 0; +} + +.rtl .dropdown-nonscroll > li { + padding-left: 0; +} + +.rtl .dropdown li li { + padding-left: 0; + padding-right: 18px; +} + +.rtl .dropdown-extended .header { + text-align: right; +} + +.rtl .dropdown-extended .header .header_settings { + float: left; +} + +/* Notifications +----------------------------------------*/ +.rtl .notification_list ul li img { + float: right; + margin-left: 5px; + margin-right: 0; +} + +.rtl .notification_list div.notifications { + margin-left: 0; + margin-right: 50px; +} + +.rtl .notification_text { + margin-left: 0; + margin-right: 58px; +} + +.rtl .notification_list p.notification-time { + text-align: left; +} + +/* Responsive breadcrumbs +----------------------------------------*/ +.rtl .breadcrumbs .crumb { + float: right; +} + +/* Table styles +----------------------------------------*/ +.rtl table.table1 thead th { + padding: 0 3px 4px 0; +} + +.rtl table.table1 thead th span { + padding-left: 0; + padding-right: 7px; +} + +.rtl table.table1 tbody th { + text-align: right; +} + +/* Specific column styles */ +.rtl table.table1 .name { text-align: right; } +.rtl table.table1 .joined { text-align: right; } +.rtl table.table1 .active { text-align: right; } +.rtl table.table1 .info { text-align: right; } +.rtl table.table1 thead .autocol { padding-left: 0; padding-right: 1em; } + +.rtl table.table1 span.rank-img { + float: left; +} + +.rtl table.info tbody th { + text-align: left; +} + +.rtl .forumbg table.table1 { + margin: 0 -1px -1px -2px; +} + +/* Misc layout styles +---------------------------------------- */ +/* column[1-2] styles are containers for two column layouts + Also see tweaks.css */ +.rtl .column1 { + float: right; + clear: right; +} + +.rtl .column2 { + float: left; + clear: left; +} + +/* General classes for placing floating blocks */ +.rtl .left-box { + float: right; + text-align: right; +} + +.rtl .right-box { + float: left; + text-align: left; +} + +.rtl dl.details dt { + float: right; + clear: right; + text-align: left; +} + +.rtl dl.details dd { + margin-right: 0; + margin-left: 0; + padding-right: 5px; + padding-left: 0; + float: right; +} + +*:first-child+html dl.details dd { + margin-right: 30%; + float: none; +} + +* html dl.details dd { + margin-right: 30%; + float: none; +} + +/* Pagination +---------------------------------------- */ +.rtl .pagination { + text-align: left; + float: left; +} + +.rtl .pagination > ul { + margin-left: 0; + margin-right: 5px; +} + +/* Pagination in viewforum for multipage topics */ +.rtl .row .pagination { + background-position: 100% 50%; + float: left; + padding-left: 0; + padding-right: 15px; +} + +.rtl .row .pagination > ul { + margin: 0; +} + +.rtl .pagination span { + direction: ltr; +} + +.pagination li.page-jump { + margin-left: 5px; + margin-right: 0; +} + +.pagination li.previous a { background-position: -50px 2px; } +.pagination li.next a { background-position: -30px 2px; } +.pagination li.previous a:hover { background-position: -50px -18px; } +.pagination li.next a:hover { background-position: -30px -18px; } + +/* Miscellaneous styles +---------------------------------------- */ +.rtl #forum-permissions { + float: left; + padding-right: 5px; + padding-left: 0; + margin-right: 5px; + margin-left: 0; + text-align: left; +} + +.rtl #quick-links { + margin-left: 7px; + margin-right: 0; +} + +.rtl .header-avatar span:after { + float: left; + padding-left: 0; + padding-right: 2px; +} + +.rtl .member-search { + float: right; +} + +/** +* links.css +*/ + +/* Back to top of page */ +.rtl .back2top { + text-align: left; +} + +/* Links adjustment to correctly display an order of rtl/ltr mixed content */ +.rtl a { + direction: rtl; + unicode-bidi: embed; +} + +li.breadcrumbs span:first-child > a { + padding-left: 0; + padding-right: 19px; +} + +.rtl a.top { + float: left; +} + +.rtl a.top2 { + background-position: 100% 50%; + padding-left: 0; + padding-right: 15px; +} + +.rtl .skiplink { + /* invisible skip link, used for accessibility */ + left: 0; + right: -999px; +} + +.rtl a.feed-icon-forum { + float: left; +} + +/** +* content.css +*/ +.rtl ul.topiclist dt, .rtl li.header dt { + float: right; + margin-right: 0; + margin-left: -440px; +} + +.rtl ul.topiclist.missing-column dt { + margin-right: 0; + margin-left: -345px; +} + +.rtl ul.topiclist.two-long-columns dt { + margin-right: 0; + margin-left: -250px; +} + +.rtl ul.topiclist.two-columns dt { + margin-right: 0; + margin-left: -80px; +} + +.rtl ul.topiclist dt .list-inner { + margin-right: 0; + margin-left: 440px; +} + +.rtl ul.topiclist.missing-column dt .list-inner { + margin-right: 0; + margin-left: 330px; +} + +.rtl ul.topiclist.two-long-columns dt .list-inner { + margin-right: 0; + margin-left: 250px; +} + +.rtl ul.topiclist.two-columns dt .list-inner { + margin-right: 0; + margin-left: 80px; +} + +.rtl ul.topiclist dd { + float: right; + border-right-width: 1px; + border-right-style: solid; + border-left: none; +} + +.rtl ul.topiclist dfn { + left: auto; + right: -999px; +} + +.rtl ul.topiclist li.row dt a.subforum { + padding-right: 12px; + background-position: right; + position: static; +} + +.rtl .forum-image { + float: right; + margin-right: 0; + margin-left: 5px; +} + +.rtl li.header dt, .rtl li.header dd { + border-right-width: 0; +} + +.rtl li.header dd { + padding-left: 0; + padding-right: 1px; +} + +.rtl dl.icon { + background-position: 99.5% 50%; +} + +.rtl li.header dl.icon dt .list-inner { + /* Tweak for headers alignment when folder icon used */ + padding-right: 0; + padding-left: 50px; +} + +.rtl dl.icon dt { + background-position: 99.5% 95%; /* Position of topic icon */ +} + +.rtl dl.icon dt .list-inner { + padding-left: 5px; + padding-right: 45px; /* Space for folder icon */ +} + +.rtl dl a.icon-link { /* topic row icon links */ + display: inline-block; + left: auto; + right: 0; + margin-left: 0; + margin-right: 2px; +} + +.rtl dd.lastpost > span, .rtl ul.topiclist dd.info > span, .rtl ul.topiclist dd.time > span, .rtl dd.redirect > span, .rtl dd.moderation > span { + padding-left: 0; + padding-right: 5px; +} + +/* Post body styles +----------------------------------------*/ +.rtl .postbody, .rtl .postbody h3 { + float: right; +} + +.rtl .has-profile .postbody h3 { + margin-right: 0; + margin-left: 180px; +} + +.rtl p.post-notice { + padding-left: 5px; + padding-right: 26px; +} + +.rtl p.post-notice:before { + left: auto; + right: 0; +} + +/* Topic review panel +----------------------------------------*/ +.rtl #topicreview { + padding-right: 0; + padding-left: 5px; +} + +/* Content container styles +----------------------------------------*/ +.rtl .content ul, .rtl .content ol { + margin-right: 3em; + margin-left: 0; +} + +.rtl .signature { + clear: right; +} + +.rtl .notice { + clear: right; +} + +/* Jump to post link for now */ +.rtl ul.searchresults { + text-align: left; +} + +/* BB Code styles +----------------------------------------*/ +/* Quote block */ +.rtl blockquote { + margin: 0.5em 25px 0 1px; + background-position: 99% 8px; +} + +.rtl blockquote blockquote { + /* Nested quotes */ + margin: 0.5em 15px 0 1px; +} + +.rtl blockquote cite { + /* Username/source of quoter */ + margin-right: 20px; + margin-left: 0; +} + +.rtl blockquote .codebox { + margin-right: 0; +} + +.rtl code { + direction: ltr; +} + +/* Attachments +----------------------------------------*/ +.rtl .attachbox { + float: right; + margin: 5px 0 5px 5px; + clear: right; +} + +.rtl .attachbox dd { + clear: right; +} + +.rtl .attachbox p { + clear: right; +} + +.rtl .attachbox p.stats { + clear: right; +} + +/* Post poll styles +----------------------------------------*/ +.rtl fieldset.polls dt { + text-align: right; + float: right; + border-left: none; +} + +.rtl fieldset.polls dd { + float: right; + border-right: none; + margin-right: 0; +} + +.rtl fieldset.polls dd div { + text-align: left; +} + +.rtl .pollbar1, .rtl .pollbar2, .rtl .pollbar3, .rtl .pollbar4, .rtl .pollbar5 { + border-left-width: 1px; + border-left-style: solid; + border-right: none; +} + +/* Poster profile block +----------------------------------------*/ +.rtl .postprofile { + border-width: 0 1px 0 0; + float: left; +/* text-align: right; */ +} + +.rtl .pm .postprofile { + border-right-width: 1px; + border-right-style: solid; + border-left: none; +} + +.rtl .postprofile dd, .rtl .postprofile dt { + margin-left: 0; + margin-right: 8px; +} + +.rtl .postprofile .avatar { + float: right; +} + +.rtl .online { + background-position: 0 0; +} + +.rtl dl.pmlist dd { + margin-right: 61% !important; + margin-left: 0 !important; +} + +/** +* buttons.css +*/ +/* Rollover buttons + Based on: http://wellstyled.com/css-nopreload-rollovers.html +----------------------------------------*/ +.rtl .dropdown-select { + padding-left: 24px; + padding-right: 8px; +} + +.rtl .icon-button:before { + float: left; + margin-left: 0; + margin-right: 2px; +} + +.rtl .dropdown-select.icon-button:before { + margin-left: 4px; + margin-right: 0; +} + +.rtl .dropdown-select:after { + border-left: 0; + border-right-style: solid; + border-right-width: 1px; + left: 0; + right: auto; +} + +.rtl .buttons, .rtl .buttons .button { + float: right; +} + +.rtl .buttons .button, .rtl .dropdown-select { + margin-left: 5px; + margin-right: 0; +} + +/* Icon images +---------------------------------------- */ +.rtl .small-icon { + background-position: 100% 50%; +} + +.rtl .small-icon > a { + padding-left: 0; + padding-right: 19px; +} + +/* Post control buttons +--------------------------------------------- */ +.rtl .post-buttons { + float: left; +} + +.rtl .has-profile .post-buttons { + left: 0; + right: auto; +} + +.rtl .post-buttons li { + float: right; +} + +.post-buttons .icon-button:before { + margin-right: 0; +} + +/* Poster contact icons + ----------------------------------------*/ +.rtl .contact-icons a { + border-left-width: 1px; + border-left-style: dotted; + border-right: none; + float: right; +} + +.rtl .contact-icons .last-cell { + border-left: none; +} + +/** +* cp.css +*/ +/* Control Panel Styles +---------------------------------------- */ + + +/* Main CP box +----------------------------------------*/ +.rtl #cp-menu { + float: right; +} + +.rtl #cp-main { + float: right; +} + +.rtl #cp-main .panel ol { + margin-right: 2em; + margin-left: 0; +} + +.rtl #cp-main .buttons { + margin-right: 0; + margin-left: 0; +} + +.tabs-container h2 { + float: right; +} + +/* CP tabbed menu +----------------------------------------*/ +.rtl #tabs { + margin-left: 0; + margin-right: 7px; +} + +.rtl #tabs .tab { + float: right; +} + +.rtl #tabs .tab > a { + margin-left: 1px; + margin-right: 0; +} + +/* Mini tabbed menu used in MCP +----------------------------------------*/ +.rtl #minitabs { + float: left; + margin-right: 0; + margin-left: 7px; +} + +.rtl #minitabs .tab { + float: left; +} + +.rtl #minitabs .tab > a { + margin-right: 2px; + margin-left: 0; +} + +/* Responsive tabs +----------------------------------------*/ +.rtl #tabs .dropdown { + margin-left: -2px; +} + +.rtl #tabs .dropdown li { + text-align: left; +} + +.rtl #minitabs .dropdown { + margin-left: -4px; +} + +.rtl #minitabs .dropdown li { + text-align: right; +} + +/* Responsive *CP navigation +----------------------------------------*/ +@media only screen and (max-width: 900px), only screen and (max-device-width: 900px) +{ + .rtl #cp-menu, .rtl #navigation, .rtl #cp-main { + float: none; + } +} + +/* UCP navigation menu +----------------------------------------*/ + +/* Preferences pane layout +----------------------------------------*/ +.rtl #cp-main h2 { + margin-left: 0; + margin-right: 10px; +} + +/* Friends list */ +.rtl .cp-mini { + margin: 10px 5px 10px 15px; +} + +/* PM Styles +----------------------------------------*/ + +/* PM panel adjustments */ +.rtl .reply-all a.right { + background-position: 5% 60%; +} + +.rtl .reply-all a.right:hover { + background-position: 3% 60%; +} + +.rtl .reply-all { + padding-left: 5px; +} + +/* Defined rules list for PM options */ +.rtl ol.def-rules { + padding-right: 0; +} + +/* PM marking colours */ +.rtl .pm-legend { + border-right-width: 10px; + border-right-style: solid; + border-left-width: 0; + padding-left: 0; + padding-right: 3px; +} + +/* Avatar gallery */ +.rtl #gallery label { + float: right; +} + +/* Responsive *CP navigation +----------------------------------------*/ +@media only screen and (max-width: 900px), only screen and (max-device-width: 900px) +{ + .rtl #cp-menu, .rtl #navigation, .rtl #cp-main { + float: none; + } +} + +/** +* forms.css +*/ + +/* General form styles +----------------------------------------*/ + +.rtl option { + padding-right: 0; + padding-left: 1em; +} + +.rtl label { + padding-right: 0; + padding-left: 5px; +} + +/* Definition list layout for forms +---------------------------------------- */ +.rtl fieldset dt { + float: right; + text-align: right; +} + +.rtl fieldset dd { + margin-left: 0; + margin-right: 41%; +} + +/* Specific layout 1 */ +.rtl fieldset.fields1 dt { + border-left-width: 0; + border-right-width: 1px; +} + +.rtl fieldset.fields1 dd { + margin-right: 15em; + margin-left: 0; + border-right-width: 0; + border-left-width: 1px; +} + +/* Specific layout 2 */ +.rtl fieldset.fields2 dt { + border-right-width: 1px; + border-left-width: 0; +} + +.rtl fieldset.fields2 dd { + margin-right: 16em; + margin-left: 0; + border-left-width: 1px; + border-right-width: 0; +} + +/* Form elements */ +.rtl dt label { + text-align: right; +} + +.rtl dd input, .rtl dd textarea { + margin-left: 3px; + margin-right: 0; +} + +/* Quick-login on index page */ +.rtl fieldset.quick-login input.inputbox { + margin-left: 5px; + margin-right: 0; +} + +.rtl fieldset.quick-login label { + padding-left: 2px; + padding-right: 0; +} + +/* Display options on viewtopic/viewforum pages */ +.rtl fieldset.display-options label { + padding-left: 2px; + padding-right: 0; +} + +/* Display actions for ucp and mcp pages */ +.rtl fieldset.display-actions { + text-align: left; + padding-left: 1em; + padding-right: 0; +} + +.rtl fieldset.display-actions label { + padding-left: 2px; + padding-right: 0; +} + +/* MCP forum selection*/ +.rtl fieldset.forum-selection { + float: left; +} + +.rtl fieldset.forum-selection2 { + float: left; +} + +/* Posting page styles +----------------------------------------*/ + +/* Emoticons panel */ +.rtl #smiley-box { + float: left; +} + +/* Search box +---------------------------------------- */ + +/* Topic and forum Search */ +.rtl .search-box { + float: right; +} + +.rtl .search-box .inputbox { + border-left-width: 0; + border-right-width: 1px; + border-radius: 0 4px 4px 0; + float: right; + padding: 3px; +} + +.rtl .search-box .button { + float: right; +} + +.rtl .search-box a.button { + border-left-width: 1px; + border-right-width: 0; + border-radius: 4px 0 0 4px; + padding-left: 5px; + padding-right: 3px; +} + +.rtl .search-header { + float: left; + margin-right: 0; + margin-left: 5px; +} + +.rtl input.search { + background-position: right 1px; + padding-right: 17px; + padding-left: 0; +} + +/** +* tweaks.css +*/ + + +/* Form button styles +---------------------------------------- */ + +/** Reference: Bug #27155 */ +.rtl #wrap, .rtl .headerbar, .rtl #site-description, .rtl .navbar { + position: relative; +} + +/* Former imageset */ +.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, .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 { + padding-right: 27px; + padding-left: 0; +} +.rtl .imageset.subforum_read, .rtl .imageset.subforum_unread, .rtl .imageset.icon_post_target, .rtl .imageset.icon_post_target_unread, .rtl .imageset.icon_topic_latest, .rtl .imageset.icon_topic_newest { + padding-right: 11px; + padding-left: 0; +} +.rtl .imageset.icon_back_top { + padding-right: 11px; + padding-left: 0; +} +.rtl .imageset.icon_contact_aim, .rtl .imageset.phpbb_aol-icon, .rtl .imageset.icon_contact_email, .rtl .imageset.icon_contact_icq, .rtl .imageset.phpbb_icq-icon, .rtl .imageset.icon_contact_jabber, .rtl .imageset.icon_contact_msnm, .rtl .imageset.phpbb_wlm-icon, .rtl .imageset.icon_contact_www, .rtl .imageset.phpbb_website-icon, .rtl .imageset.icon_contact_yahoo, .rtl .imageset.phpbb_yahoo-icon, .rtl .imageset.icon_post_delete, .rtl .imageset.icon_post_info, .rtl .imageset.icon_post_report, .rtl .imageset.icon_user_warn { + padding-right: 20px; + padding-left: 0; +} +.rtl .imageset.icon_topic_attach { + padding-right: 7px; + padding-left: 0; +} +.rtl .imageset.icon_topic_reported, .rtl .imageset.icon_topic_unapproved { + padding-right: 16px; + padding-left: 0; +} + +/** +* plupload.css +*/ + +.rtl .attach-controls { + float: left; +} + +/** +* responsive.css +*/ +@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) +{ + /* .topiclist lists + ----------------------------------------*/ + .rtl ul.topiclist li.header dt, .rtl ul.topiclist li.header dt .list-inner { + margin-left: 0 !important; + padding-left: 0; + } + + .rtl ul.topiclist dt, .rtl ul.topiclist dt .list-inner, + .rtl ul.topiclist.missing-column dt, .rtl ul.topiclist.missing-column dt .list-inner, + .rtl ul.topiclist.two-long-columns dt, .rtl ul.topiclist.two-long-columns dt .list-inner, + .rtl ul.topiclist.two-columns dt, .rtl ul.topiclist.two-columns dt .list-inner { + margin-left: 0; + } + + .rtl ul.topiclist dt .list-inner.with-mark { + padding-left: 34px; + } + + /* Forums and topics lists + ----------------------------------------*/ + .rtl ul.topiclist.forums dt { + margin-left: -250px; + } + .rtl ul.topiclist.forums dt .list-inner { + margin-left: 250px; + } + + .rtl ul.topiclist dd.mark { + left: 5px; + right: auto; + text-align: right; + } + + .rtl table.responsive.show-header thead, .rtl table.responsive.show-header th:first-child { + text-align: right !important; + } + + .rtl table.responsive td { + text-align: right !important; + } + + /* User profile + ----------------------------------------*/ + .rtl .column1, .rtl .column2, .rtl .left-box.profile-details { + float: none; + } + + /* Post + ----------------------------------------*/ + .rtl .postprofile, .rtl .postbody, .rtl .search .postbody { + float: none; + } + + .rtl .post .postprofile { + border-width: 0 0 1px 0; + } + + .rtl .postprofile dt, .rtl .postprofile dd.profile-rank, .rtl .search .postprofile dd { + margin: 0; + } + + .rtl .postprofile .avatar { + margin-left: 5px; + margin-right: 0; + } + + .rtl .has-profile .post-buttons { + left: 20px; + } + + /* Forms + ----------------------------------------*/ + .rtl fieldset dt, .rtl fieldset.fields1 dt, .rtl fieldset.fields2 dt { + float: none; + } + + .rtl fieldset dd, .rtl fieldset.fields1 dd, .rtl fieldset.fields2 dd { + margin-right: 20px; + } +} + +@media only screen and (max-width: 550px), only screen and (max-device-width: 550px) +{ + /* .topiclist lists + ----------------------------------------*/ + .rtl ul.topiclist.forums dt { + margin-left: 0; + } + + .rtl ul.topiclist.forums dt .list-inner { + margin-left: 0; + } +} + +@media only screen and (max-width: 500px), only screen and (max-device-width: 500px) +{ + .rtl dl.details dt, .rtl dl.details dd { + float: none; + text-align: right; + } + + .rtl dl.details dd { + margin-left: 0; + margin-right: 20px; + } + + .captcha-panel dd.captcha { + margin-right: 0; + } +} diff --git a/sources/phpBB/styles/prosilver/theme/buttons.css b/sources/phpBB/styles/prosilver/theme/buttons.css new file mode 100644 index 0000000..d600e76 --- /dev/null +++ b/sources/phpBB/styles/prosilver/theme/buttons.css @@ -0,0 +1,253 @@ +/* Button Styles +---------------------------------------- */ + +/* Rollover buttons + Based on: http://wellstyled.com/css-nopreload-rollovers.html +----------------------------------------*/ +.button { + cursor: pointer; + display: inline-block; + height: 18px; + font-size: 13px; + white-space: nowrap; + border: 1px solid transparent; + border-radius: 4px; + background: transparent none 0 0 repeat-x; + padding: 2px 8px; + font-family: "Open Sans", "Droid Sans", Verdana, Arial, Helvetica; + position: relative; + text-decoration: none !important; + outline-style: none !important; + vertical-align: bottom; +} + +.dropdown-select { + padding-right: 24px; +} + +.icon-button:before { + background: transparent 0 0 no-repeat; + content: ''; + display: inline-block; + float: right; + height: 12px; + margin: 3px 0 0 2px; + width: 12px; +} + +.dropdown-select.icon-button:before { + margin-right: 4px; +} + +.dropdown-select:after { + background-position: -103px 10px; + border-left: 1px solid; + content: ''; + position: absolute; + top: 0; + right: 0; + height: 22px; + width: 16px; +} + +.dropdown-visible .dropdown-select:after, .nojs .dropdown-container:hover .dropdown-select:after { + background-position: -103px -10px; +} + +.buttons, .buttons .button { + float: left; +} + +.buttons .button, .dropdown-select { + margin-right: 5px; +} + +#jumpbox .dropdown-select { + margin: 0; +} + +/* Big button images */ +.reply-icon:before, .pmreply-icon:before { background-position: -20px 0; } +.reply-icon:hover:before, .pmreply-icon:hover:before { background-position: -20px -20px; } + +.post-icon:before, .newpm-icon:before, .reply-all:before { background-position: 0 0; } +.post-icon:hover:before, +.newpm-icon:hover:before, +.reply-all:hover:before { background-position: 0 -20px; } + +.locked-icon:before { background-position: -60px 0; } +.locked-icon:hover:before { background-position: -60px -20px; } + +.forwardpm-icon:before { background-position: -40px 0; } +.forwardpm-icon:hover:before { background-position: -40px -20px; } + +.modtools-icon { + font-size: 0; +} + +.tools-icon:before, .modtools-icon:before, .search-icon:before, .search-adv-icon:before { + background-position: -80px 0; + height: 16px; + margin-top: 2px; + width: 16px; +} + +.dropdown-visible .tools-icon:before, +.nojs .dropdown-container:hover .tools-icon:before { background-position: -80px -20px; } + +.search-icon:before { background-position: -245px 0; } +.search-icon:hover:before { background-position: -245px -20px; } + +.search-adv-icon:before { background-position: -265px 0; } +.search-adv-icon:hover:before { background-position: -265px -20px; } + +.modtools-icon:before { background-position: -225px 0; } +.dropdown-visible .modtools-icon:before, +.nojs .dropdown-container:hover .modtools-icon:before { background-position: -225px -20px; } + +/* Icon images +---------------------------------------- */ +.small-icon { + background-position: 0 50%; + background-repeat: no-repeat; + background-image: none; +} + +.small-icon > a { + display: inline-block; + padding: 0 0 0 18px; +} + +ul.linklist.bulletin > li.small-icon:before { + display: none; +} + +.dropdown .small-icon > a { + display: block; +} + +/* Poster contact icons +----------------------------------------*/ +.contact-icons.dropdown-contents { + min-width: 0; + padding: 0; + font-size: 0; +} + +.contact-icon { + background-repeat: no-repeat; + display: block; + height: 16px; + width: 16px; +} +.contact-icons a { + border-bottom: 1px dotted; + border-right: 1px dotted; + display: block; + float: left; + padding: 8px; +} + +.contact-icons .last-cell { + border-right: none; +} + +.contact-icons div:last-child a { + border-bottom: none; +} + +.contact-icons div { + clear: left; +} + +/* Profile icons */ +.pm-icon { background-position: 0 0; } +.email-icon { background-position: -21px 0; } +.jabber-icon { background-position: -80px 0; } +.phpbb_icq-icon { background-position: -61px 0 ; } +.phpbb_wlm-icon { background-position: -182px 0; } +.phpbb_aol-icon { background-position: -244px 0; } +.phpbb_website-icon { background-position: -40px 0; } +.phpbb_youtube-icon { background-position: -98px 0; } +.phpbb_facebook-icon { background-position: -119px 0; } +.phpbb_googleplus-icon { background-position: -140px 0; } +.phpbb_skype-icon { background-position: -161px 0; } +.phpbb_twitter-icon { background-position: -203px 0; } +.phpbb_yahoo-icon { background-position: -224px 0; } + +/* Post control buttons +--------------------------------------------- */ +.post-buttons { + float: right; + list-style: none; + margin-top: 2px; +} + +.has-profile .post-buttons { + float: none; + position: absolute; + margin: 0; + right: 0; + top: 5px; +} + +.post-buttons > li { + float: left; + margin-right: 3px; +} + +.post-buttons .icon-button { + padding: 0 5px; +} + +.hastouch .post-buttons .icon-button { + padding: 2px 8px; +} + +.post-buttons .icon-button span { + display: block; + height: 0; + overflow: hidden; + position: absolute; + width: 1px; +} + +.post-buttons .icon-button:before { + margin-left: 0; +} + +.quote-icon:before { background-position: -122px 0; } +.quote-icon:hover:before { background-position: -122px -21px; } +.edit-icon:before { background-position: -137px 0; } +.edit-icon:hover:before { background-position: -137px -21px; } +.warn-icon:before { background-position: -208px 0; } +.warn-icon:hover:before { background-position: -208px -21px; } +.delete-icon:before { background-position: -152px 0; } +.delete-icon:hover:before { background-position: -152px -21px; } +.report-icon:before { background-position: -165px 0; } +.report-icon:hover:before { background-position: -165px -21px; } +.info-icon:before { background-position: -175px 0; } +.info-icon:hover:before { background-position: -175px -21px; } +.button.responsive-menu-link:before { background-position: -191px 0; } +.button.responsive-menu-link:hover:before { background-position: -191px -21px; } + +/* Responsive buttons in post body */ +.post-buttons .dropdown { + top: 18px; +} + +.post-buttons .dropdown a { + display: block; + font-size: 1.2em; + text-align: right; +} + +.hasjs .postbody .post-buttons { + max-width: 40%; +} + +/* Browser-specific tweaks */ +button::-moz-focus-inner { + padding: 0; + border: 0 +} diff --git a/sources/phpBB/styles/prosilver/theme/colours.css b/sources/phpBB/styles/prosilver/theme/colours.css new file mode 100644 index 0000000..505b182 --- /dev/null +++ b/sources/phpBB/styles/prosilver/theme/colours.css @@ -0,0 +1,1154 @@ +/* +-------------------------------------------------------------- +Colours and backgrounds for common.css +-------------------------------------------------------------- */ + +html, body { + color: #536482; + background-color: #F5F7FA; +} + +h1 { + color: #FFFFFF; +} + +h2 { + color: #28313F; +} + +h3 { + border-bottom-color: #CCCCCC; + color: #115098; +} + +hr { + border-color: #FFFFFF; + border-top-color: #CCCCCC; +} + +/* Search box +--------------------------------------------- */ + +.search-box .inputbox, +.search-box .inputbox:hover, +.search-box .inputbox:focus, +.search-box .button:hover { + border-color: #C7C3BF; +} + +.search-header { + box-shadow: 0 0 10px #0075B0; +} + +/* Round cornered boxes and backgrounds +---------------------------------------- */ +#wrap { + background-color: #FFF; + border-color: #E6E9ED; +} + +.headerbar { + background-color: #12A3EB; + background-image: url("./images/bg_header.gif"); + color: #FFFFFF; +} + +.navbar { + background-color: #cadceb; +} + +.forabg { + background-color: #0076b1; + background-image: url("./images/bg_list.gif"); +} + +.forumbg { + background-color: #12A3EB; + background-image: url("./images/bg_header.gif"); +} + +.panel { + background-color: #ECF1F3; + color: #28313F; +} + +.post:target .content { + color: #000000; +} + +.post:target h3 a { + color: #000000; +} + +.bg1 { + background-color: #ECF3F7; +} + +table.zebra-list tr:nth-child(odd) td, ul.zebra-list li:nth-child(odd) { + background-color: #ECF3F7; +} + +.bg2 { + background-color: #e1ebf2; +} + +table.zebra-list tr:nth-child(even) td, ul.zebra-list li:nth-child(even) { + background-color: #e1ebf2; +} + +.bg3 { background-color: #cadceb; } + +.ucprowbg { + background-color: #DCDEE2; +} + +.fieldsbg { + background-color: #E7E8EA; +} + +/* Horizontal lists +----------------------------------------*/ + +ul.navlinks { + border-top-color: #FFFFFF; +} + +/* Table styles +----------------------------------------*/ +table.table1 thead th { + color: #FFFFFF; +} + +table.table1 tbody tr { + border-color: #BFC1CF; +} + +table.table1 tbody tr:hover, table.table1 tbody tr.hover { + background-color: #CFE1F6; + color: #000; +} + +table.table1 td { + color: #536482; +} + +table.table1 tbody td { + border-top-color: #FAFAFA; +} + +table.table1 tbody th { + border-bottom-color: #000000; + color: #333333; + background-color: #FFFFFF; +} + +table.info tbody th { + color: #000000; +} + +/* Misc layout styles +---------------------------------------- */ +dl.details dt { + color: #000000; +} + +dl.details dd { + color: #536482; +} + +.sep { + color: #1198D9; +} + +/* Pagination +---------------------------------------- */ + +.pagination li a { + color: #5C758C; + background-color: #ECEDEE; + border-color: #B4BAC0; +} + +.pagination li.ellipsis span { + background-color: transparent; + color: #000000; +} + +.pagination li.active span { + color: #FFFFFF; + background-color: #4692BF; + border-color: #4692BF; +} + +.pagination li a:hover, .pagination .dropdown-visible a.dropdown-trigger, .nojs .pagination .dropdown-container:hover a.dropdown-trigger { + border-color: #368AD2; + background-color: #368AD2; + color: #FFFFFF; +} + +.pagination li.next a, .pagination li.previous a, .pagination li.page-jump a { + background-image: url("./images/icons_pagination.png"); +} + +/* Pagination in viewforum for multipage topics */ +.row .pagination { + background-image: url("./images/icon_pages.gif"); +} + +/* Miscellaneous styles +---------------------------------------- */ + +.copyright { + color: #555555; +} + +.error { + color: #BC2A4D; +} + +.reported { + background-color: #F7ECEF; +} + +li.reported:hover { + background-color: #ECD5D8 !important; +} +.sticky, .announce { + /* you can add a background for stickies and announcements*/ +} + +div.rules { + background-color: #ECD5D8; + color: #BC2A4D; +} + +p.post-notice { + background-color: #ECD5D8; + background-image: none; +} + +p.post-notice.deleted:before { + background-image: url("./images/icon_topic_deleted.png"); +} + +p.post-notice.unapproved:before { + background-image: url("./images/icon_topic_unapproved.gif"); +} + +p.post-notice.reported:before, p.post-notice.error:before { + background-image: url("./images/icon_topic_reported.gif"); +} + +/* +-------------------------------------------------------------- +Colours and backgrounds for links.css +-------------------------------------------------------------- */ + +a { color: #105289; } +a:hover { color: #D31141; } + +/* Links on gradient backgrounds */ +.forumbg .header a, .forabg .header a, th a { + color: #FFFFFF; +} + +.forumbg .header a:hover, .forabg .header a:hover, th a:hover { + color: #A8D8FF; +} + +/* Notification mark read link */ +.dropdown-extended a.mark_read { + background-color: #FFFFFF; +} + +/* Post body links */ +.postlink { + color: #368AD2; + border-bottom-color: #368AD2; +} + +.postlink:visited { + color: #5D8FBD; + border-bottom-color: #5D8FBD; +} + +.postlink:hover { + background-color: #D0E4F6; + color: #0D4473; +} + +.signature a, .signature a:hover { + background-color: transparent; +} + +/* Back to top of page */ +a.top { + background-image: url("./images/icon_back_top.gif"); +} + +a.top2 { + background-image: url("./images/icon_back_top.gif"); +} + +/* Arrow links */ +a.arrow-up { background-image: url("./images/arrow_up.gif"); } +a.arrow-down { background-image: url("./images/arrow_down.gif"); } +a.arrow-left { background-image: url("./images/arrow_left.gif"); } +a.arrow-right { background-image: url("./images/arrow_right.gif"); } + +a.arrow-up:hover { + background-color: transparent; +} + +a.arrow-left:hover { + color: #368AD2; +} + +a.arrow-right:hover { + color: #368AD2; +} + +/* +-------------------------------------------------------------- +Colours and backgrounds for content.css +-------------------------------------------------------------- */ + +ul.forums { + background-color: #eef5f9; + background-image: url("./images/gradient.gif"); +} + +ul.topiclist li { + color: #4C5D77; +} + +ul.topiclist dd { + border-left-color: #FFFFFF; +} + +.rtl ul.topiclist dd { + border-right-color: #fff; + border-left-color: transparent; +} + +ul.topiclist li.row dt a.subforum.read { + background-image: url("./images/subforum_read.gif"); +} + +ul.topiclist li.row dt a.subforum.unread { + background-image: url("./images/subforum_unread.gif"); +} + +li.row { + border-top-color: #FFFFFF; + border-bottom-color: #00608F; +} + +li.row strong { + color: #000000; +} + +li.row:hover { + background-color: #F6F4D0; +} + +li.row:hover dd { + border-left-color: #CCCCCC; +} + +.rtl li.row:hover dd { + border-right-color: #CCCCCC; + border-left-color: transparent; +} + +li.header dt, li.header dd { + color: #FFFFFF; +} + +/* Post body styles +----------------------------------------*/ +.postbody { + color: #333333; +} + +/* Content container styles +----------------------------------------*/ +.content { + color: #333333; +} + +.content h2, .panel h2 { + color: #115098; + border-bottom-color: #CCCCCC; +} + +dl.faq dt { + color: #333333; +} + +.posthilit { + background-color: #F3BFCC; + color: #BC2A4D; +} + +.announce, .unreadpost { + /* Highlight the announcements & unread posts box */ +} + +/* Post signature */ +.signature { + border-top-color: #CCCCCC; +} + +/* Post noticies */ +.notice { + border-top-color: #CCCCCC; +} + +/* BB Code styles +----------------------------------------*/ +/* Quote block */ +blockquote { + background-color: #EBEADD; + background-image: url("./images/quote.gif"); + border-color:#DBDBCE; +} + +.rtl blockquote { + background-image: url("./images/quote_rtl.gif"); +} + +blockquote blockquote { + /* Nested quotes */ + background-color:#EFEED9; +} + +blockquote blockquote blockquote { + /* Nested quotes */ + background-color: #EBEADD; +} + +/* Code block */ +.codebox { + background-color: #FFFFFF; + border-color: #C9D2D8; +} + +.codebox p { + border-bottom-color: #CCCCCC; +} + +.codebox code { + color: #2E8B57; +} + +.syntaxbg { color: #FFFFFF; } +.syntaxcomment { color: #FF8000; } +.syntaxdefault { color: #0000BB; } +.syntaxhtml { color: #000000; } +.syntaxkeyword { color: #007700; } +.syntaxstring { color: #DD0000; } + +/* Attachments +----------------------------------------*/ +.attachbox { + background-color: #FFFFFF; + border-color: #C9D2D8; +} + +.pm-message .attachbox { + background-color: #F2F3F3; +} + +.attachbox dd { + border-top-color: #C9D2D8; +} + +.attachbox p { + color: #666666; +} + +.attachbox p.stats { + color: #666666; +} + +.attach-image img { + border-color: #999999; +} + +/* Inline image thumbnails */ + +dl.file dd { + color: #666666; +} + +dl.thumbnail img { + border-color: #666666; + background-color: #FFFFFF; +} + +dl.thumbnail dd { + color: #666666; +} + +dl.thumbnail dt a:hover { + background-color: #EEEEEE; +} + +dl.thumbnail dt a:hover img { + border-color: #368AD2; +} + +/* Post poll styles +----------------------------------------*/ + +fieldset.polls dl { + border-top-color: #DCDEE2; + color: #666666; +} + +fieldset.polls dl.voted { + color: #000000; +} + +fieldset.polls dd div { + color: #FFFFFF; +} + +.rtl .pollbar1, .rtl .pollbar2, .rtl .pollbar3, .rtl .pollbar4, .rtl .pollbar5 { + border-right-color: transparent; +} + +.pollbar1 { + background-color: #AA2346; + border-bottom-color: #74162C; + border-right-color: #74162C; +} + +.rtl .pollbar1 { + border-left-color: #74162C; +} + +.pollbar2 { + background-color: #BE1E4A; + border-bottom-color: #8C1C38; + border-right-color: #8C1C38; +} + +.rtl .pollbar2 { + border-left-color: #8C1C38; +} + +.pollbar3 { + background-color: #D11A4E; + border-bottom-color: #AA2346; + border-right-color: #AA2346; +} + +.rtl .pollbar3 { + border-left-color: #AA2346; +} + +.pollbar4 { + background-color: #E41653; + border-bottom-color: #BE1E4A; + border-right-color: #BE1E4A; +} + +.rtl .pollbar4 { + border-left-color: #BE1E4A; +} + +.pollbar5 { + background-color: #F81157; + border-bottom-color: #D11A4E; + border-right-color: #D11A4E; +} + +.rtl .pollbar5 { + border-left-color: #D11A4E; +} + +/* Poster profile block +----------------------------------------*/ +.postprofile { + color: #666666; + border-color: #FFFFFF; +} + +.pm .postprofile { + border-color: #DDDDDD; +} + +.postprofile strong { + color: #000000; +} + +.online { + background-image: url("./en/icon_user_online.gif"); +} + +dd.profile-warnings { + color: #BC2A4D; +} + +/* +-------------------------------------------------------------- +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')"; + box-shadow: 0 0 0 1px #FFFFFF inset; + -webkit-box-shadow: 0 0 0 1px #FFFFFF inset; + color: #D31141; +} + +.dropdown-select { + color: #536482; +} + +.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')"; + text-shadow: 1px 1px 0 #FFFFFF, -1px -1px 0 #FFFFFF, -1px -1px 0 rgba(188, 42, 77, 0.2); +} + +.dropdown-select:after { border-color: #DADADA; } +.dropdown-select:hover { border-color: #C7C3BF; } + +.dropdown-visible .dropdown-select, .dropdown-visible .dropdown-select:hover, .nojs .dropdown-container:hover .dropdown-select { + border-color: #A6B2BA; + color: #105289; +} + +.contact-icons a { border-color: #DCDCDC; } +.contact-icons a:hover { background-color: #F2F6F9; } + +/* 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-advanced { background-image: url("./images/icon_search_adv.gif"); } +.icon-search-new { background-image: url("./images/subforum_unread.gif"); } +.icon-search-self { background-image: url("./images/icon_topic_latest.gif"); } +.icon-search-unanswered { background-image: url("./images/icon_post_target.gif"); } +.icon-search-unread { background-image: url("./images/subforum_unread.gif"); } +.icon-sendemail { background-image: url("./images/icon_sendemail.gif"); } +.icon-subscribe { background-image: url("./images/icon_subscribe.gif"); } +.icon-team { background-image: url("./images/icon_team.gif"); } +.icon-ucp { background-image: url("./images/icon_ucp.gif"); } +.icon-unsubscribe { background-image: url("./images/icon_unsubscribe.gif"); } + +/* Profile & navigation icons */ +.contact-icon { background-image: url("./images/icons_contact.png"); } +.icon-button:before, .dropdown-select:after { background-image: url("./images/icons_button.png"); } + +/* Forum icons & Topic icons */ +.global_read { background-image: url("./images/announce_read.gif"); } +.global_read_mine { background-image: url("./images/announce_read_mine.gif"); } +.global_read_locked { background-image: url("./images/announce_read_locked.gif"); } +.global_read_locked_mine { background-image: url("./images/announce_read_locked_mine.gif"); } +.global_unread { background-image: url("./images/announce_unread.gif"); } +.global_unread_mine { background-image: url("./images/announce_unread_mine.gif"); } +.global_unread_locked { background-image: url("./images/announce_unread_locked.gif"); } +.global_unread_locked_mine { background-image: url("./images/announce_unread_locked_mine.gif"); } + +.announce_read { background-image: url("./images/announce_read.gif"); } +.announce_read_mine { background-image: url("./images/announce_read_mine.gif"); } +.announce_read_locked { background-image: url("./images/announce_read_locked.gif"); } +.announce_read_locked_mine { background-image: url("./images/announce_read_locked_mine.gif"); } +.announce_unread { background-image: url("./images/announce_unread.gif"); } +.announce_unread_mine { background-image: url("./images/announce_unread_mine.gif"); } +.announce_unread_locked { background-image: url("./images/announce_unread_locked.gif"); } +.announce_unread_locked_mine { background-image: url("./images/announce_unread_locked_mine.gif"); } + +.forum_link { background-image: url("./images/forum_link.gif"); } +.forum_read { background-image: url("./images/forum_read.gif"); } +.forum_read_locked { background-image: url("./images/forum_read_locked.gif"); } +.forum_read_subforum { background-image: url("./images/forum_read_subforum.gif"); } +.forum_unread { background-image: url("./images/forum_unread.gif"); } +.forum_unread_locked { background-image: url("./images/forum_unread_locked.gif"); } +.forum_unread_subforum { background-image: url("./images/forum_unread_subforum.gif"); } + +.sticky_read { background-image: url("./images/sticky_read.gif"); } +.sticky_read_mine { background-image: url("./images/sticky_read_mine.gif"); } +.sticky_read_locked { background-image: url("./images/sticky_read_locked.gif"); } +.sticky_read_locked_mine { background-image: url("./images/sticky_read_locked_mine.gif"); } +.sticky_unread { background-image: url("./images/sticky_unread.gif"); } +.sticky_unread_mine { background-image: url("./images/sticky_unread_mine.gif"); } +.sticky_unread_locked { background-image: url("./images/sticky_unread_locked.gif"); } +.sticky_unread_locked_mine { background-image: url("./images/sticky_unread_locked_mine.gif"); } + +.topic_moved { background-image: url("./images/topic_moved.gif"); } +.topic_read { background-image: url("./images/topic_read.gif"); } +.topic_read_mine { background-image: url("./images/topic_read_mine.gif"); } +.topic_read_hot { background-image: url("./images/topic_read_hot.gif"); } +.topic_read_hot_mine { background-image: url("./images/topic_read_hot_mine.gif"); } +.topic_read_locked { background-image: url("./images/topic_read_locked.gif"); } +.topic_read_locked_mine { background-image: url("./images/topic_read_locked_mine.gif"); } +.topic_unread { background-image: url("./images/topic_unread.gif"); } +.topic_unread_mine { background-image: url("./images/topic_unread_mine.gif"); } +.topic_unread_hot { background-image: url("./images/topic_unread_hot.gif"); } +.topic_unread_hot_mine { background-image: url("./images/topic_unread_hot_mine.gif"); } +.topic_unread_locked { background-image: url("./images/topic_unread_locked.gif"); } +.topic_unread_locked_mine { background-image: url("./images/topic_unread_locked_mine.gif"); } + +.pm_read { background-image: url("./images/topic_read.gif"); } +.pm_unread { background-image: url("./images/topic_unread.gif"); } + +/* +-------------------------------------------------------------- +Colours and backgrounds for cp.css +-------------------------------------------------------------- */ + +/* Main CP box +----------------------------------------*/ + +.panel-container h3, .panel-container hr, #cp-menu hr { + border-color: #A4B3BF; +} + +.panel-container .panel li.row { + border-bottom-color: #B5C1CB; + border-top-color: #F9F9F9; +} + +ul.cplist { + border-top-color: #B5C1CB; +} + +.panel-container .panel li.header dd, .panel-container .panel li.header dt { + color: #000000; +} + +.panel-container table.table1 thead th { + color: #333333; + border-bottom-color: #333333; +} + +#cp-main .pm-message { + border-color: #DBDEE2; + background-color: #FFFFFF; +} + +/* CP tabbed menu +----------------------------------------*/ +#tabs .tab > a { + background: #BACCD9; + color: #536482; +} + +#tabs .tab > a:hover { + background: #DDEDFB; + color: #D31141; +} + +#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 ); + border-color: #CADCEB; + box-shadow: 0 1px 1px #F2F9FF inset; + color: #333333; +} + +#tabs .activetab > a:hover { + color: #000000; +} + +/* Mini tabbed menu used in MCP +----------------------------------------*/ +#minitabs .tab > a { + background-color: #E1EBF2; +} + +#minitabs .activetab > a, +#minitabs .activetab > a:hover { + background-color: #F9F9F9; + color: #333333; +} + +/* Responsive tabs +----------------------------------------*/ +.responsive-tab .responsive-tab-link:before { + border-color: #536482; +} + +.responsive-tab .responsive-tab-link:hover:before { + border-color: #D31141; +} + +/* UCP navigation menu +----------------------------------------*/ + +/* 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: -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 ); +} + +.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 ); +} + +#navigation a:hover { + background: #AABAC6; + color: #BC2A4D; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} + +#navigation #active-subsection a { + background: #F9F9F9; + color: #D31141; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} + +#navigation #active-subsection a:hover { + color: #D31141; +} + +@media only screen and (max-width: 900px), only screen and (max-device-width: 900px) +{ + #navigation a, .rtl #navigation a { + background: #B2C2CF; + } +} + +/* Preferences pane layout +----------------------------------------*/ +.panel-container h2 { + color: #333333; +} + +.panel-container .panel { + background-color: #F9F9F9; +} + +#cp-main .pm { + background-color: #FFFFFF; +} + +/* Friends list */ +.cp-mini { + background-color: #eef5f9; +} + +dl.mini dt { + color: #425067; +} + +/* PM Styles +----------------------------------------*/ +/* PM Message history */ +.current { + color: #000000 !important; +} + +/* PM marking colours */ +.pmlist li.pm_message_reported_colour, .pm_message_reported_colour { + border-left-color: #BC2A4D; + border-right-color: #BC2A4D; +} + +.pmlist li.pm_marked_colour, .pm_marked_colour { + border-color: #FF6600; +} + +.pmlist li.pm_replied_colour, .pm_replied_colour { + border-color: #A9B8C2; +} + +.pmlist li.pm_friend_colour, .pm_friend_colour { + border-color: #5D8FBD; +} + +.pmlist li.pm_foe_colour, .pm_foe_colour { + border-color: #000000; +} + +/* Avatar gallery */ +#gallery label { + background: #FFFFFF; + border-color: #CCC; +} + +#gallery label:hover { + background-color: #EEE; +} + +/* +-------------------------------------------------------------- +Colours and backgrounds for forms.css +-------------------------------------------------------------- */ + +/* General form styles +----------------------------------------*/ +select { + border-color: #666666; + background-color: #FAFAFA; + color: #000; +} + +label { + color: #425067; +} + +option.disabled-option { + color: graytext; +} + +/* Definition list layout for forms +---------------------------------------- */ +dd label { + color: #333; +} + +fieldset.fields1 { + background-color: transparent; +} + +/* Hover effects */ +fieldset dl:hover dt label { + color: #000000; +} + +fieldset.fields2 dl:hover dt label { + color: inherit; +} + +/* Quick-login on index page */ +fieldset.quick-login input.inputbox { + background-color: #F2F3F3; +} + +/* Posting page styles +----------------------------------------*/ + +#message-box textarea { + color: #333333; +} + +/* Input field styles +---------------------------------------- */ +.inputbox { + background-color: #FFFFFF; + border-color: #B4BAC0; + color: #333333; +} + +.inputbox:-moz-placeholder { + color: #333333; +} + +.inputbox::-webkit-input-placeholder { + color: #333333; +} + +.inputbox:hover { + border-color: #11A3EA; +} + +.inputbox:focus { + border-color: #11A3EA; + color: #0F4987; +} + +.inputbox:focus:-moz-placeholder { + color: transparent; +} + +.inputbox:focus::-webkit-input-placeholder { + color: transparent; +} + + +/* Form button styles +---------------------------------------- */ + +a.button1, input.button1, input.button3, a.button2, input.button2 { + color: #000; + background-color: #FAFAFA; + background-image: url("./images/bg_button.gif"); +} + +a.button1, input.button1 { + border-color: #666666; +} + +input.button3 { + background-image: none; +} + +/* Alternative button */ +a.button2, input.button2, input.button3 { + border-color: #666666; +} + +/* button in the style of the form buttons */ +a.button1, a.button2 { + color: #000000; +} + +/* Hover states */ +a.button1:hover, input.button1:hover, a.button2:hover, input.button2:hover, input.button3:hover { + border-color: #BC2A4D; + color: #BC2A4D; +} + +/* Focus states */ +input.button1:focus, input.button2:focus, input.button3:focus { + border-color: #11A3EA; + color: #0F4987; +} + +input.search { + background-image: url("./images/icon_textbox_search.gif"); +} + +input.disabled { + color: #666666; +} + +/* jQuery popups +---------------------------------------- */ +.phpbb_alert { + background-color: #FFFFFF; + border-color: #999999; +} +.phpbb_alert .alert_close { + background-image: url("./images/alert_close.png"); +} +#darken { + background-color: #000000; +} + +#loading_indicator { + background-color: #000000; + background-image: url("./images/loading.gif"); +} + +.dropdown-extended ul li { + border-top-color: #B9B9B9; +} + +.dropdown-extended ul li:hover { + background-color: #CFE1F6; + color: #000000; +} + +.dropdown-extended .header, .dropdown-extended .footer { + border-color: #B9B9B9; + color: #000000; +} + +.dropdown-extended .footer { + border-top-style: solid; + border-top-width: 1px; +} + +.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%); +} + +.dropdown .pointer { + border-color: #B9B9B9 transparent; +} + +.dropdown .pointer-inner { + border-color: #FFF transparent; +} + +.dropdown-extended .pointer-inner { + border-color: #F1F8FF transparent; +} + +ul.linklist li.responsive-menu a.responsive-menu-link:before { + border-color: #105289; +} + +ul.linklist li.responsive-menu a.responsive-menu-link:hover:before, ul.linklist li.responsive-menu.visible a.responsive-menu-link:before { + border-color: #D31141; +} + +.dropdown .dropdown-contents { + background: #fff; + border-color: #b9b9b9; + box-shadow: 1px 3px 5px rgba(0, 0, 0, 0.2); +} + +.dropdown-up .dropdown-contents { + box-shadow: 1px 0 5px rgba(0, 0, 0, 0.2); +} + +.dropdown li, .dropdown li li { + border-color: #DCDCDC; +} + +.dropdown li.separator { + border-color: #DCDCDC; +} + +/* Notifications +---------------------------------------- */ + +.notification_list p.notification-time { + color: #4C5D77; +} + +li.notification-reported strong, li.notification-disapproved strong { + color: #D31141; +} diff --git a/sources/phpBB/styles/prosilver/theme/common.css b/sources/phpBB/styles/prosilver/theme/common.css new file mode 100644 index 0000000..9da24b6 --- /dev/null +++ b/sources/phpBB/styles/prosilver/theme/common.css @@ -0,0 +1,1298 @@ +/* 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; +} + +/* General Markup Styles +---------------------------------------- */ +html { + font-size: 100%; + /* Always show a scrollbar for short pages - stops the jump when the scrollbar appears. non-IE browsers */ + height: 101%; +} + +body { + /* Text-Sizing with ems: http://www.clagnut.com/blog/348/ */ + font-family: Verdana, Helvetica, Arial, sans-serif; + /*font-size: 62.5%; This sets the default font size to be equivalent to 10px */ + font-size: 10px; + line-height: normal; + margin: 0; + padding: 12px 0; + word-wrap: break-word; +} + +h1 { + /* Forum name */ + font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; + margin-right: 200px; + margin-top: 15px; + font-weight: bold; + font-size: 2em; +} + +h2 { + /* Forum header titles */ + font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; + font-weight: normal; + font-size: 2em; + margin: 0.8em 0 0.2em 0; +} + +h2.solo { + margin-bottom: 1em; +} + +h3 { + /* Sub-headers (also used as post headers, but defined later) */ + font-family: Arial, Helvetica, sans-serif; + font-weight: bold; + text-transform: uppercase; + border-bottom: 1px solid transparent; + margin-bottom: 3px; + padding-bottom: 2px; + font-size: 1.05em; + margin-top: 20px; +} + +h4 { + /* Forum and topic list titles */ + font-family: "Trebuchet MS", Verdana, Helvetica, Arial, Sans-serif; + font-size: 1.3em; +} + +p { + line-height: 1.3em; + font-size: 1.1em; + margin-bottom: 1.5em; +} + +img { + border-width: 0; +} + +hr { + /* Also see tweaks.css */ + border: 0 solid transparent; + border-top-width: 1px; + height: 1px; + margin: 5px 0; + display: block; + clear: both; +} + +hr.dashed { + border-top-style: dashed; + margin: 10px 0; +} + +hr.divider { + display: none; +} + +p.right { + text-align: right; +} + +p.jumpbox-return { + margin-top: 1em; +} + +b, strong { + font-weight: bold; +} + +i, em { + font-style: italic; +} + +u { + text-decoration: underline; +} + +ul { + list-style-type: disc; +} + +ol { + list-style-type: decimal; +} + +li { + display: list-item; +} + +ul ul, ol ul { + list-style-type: circle; +} + +ol ol ul, ol ul ul, ul ol ul, ul ul ul { + list-style-type: square; +} + + +/* Main blocks +---------------------------------------- */ +#wrap { + border: 1px solid transparent; + border-radius: 8px; + margin: 0 auto; + max-width: 1152px; + min-width: 625px; + padding: 15px; +} + +@media only screen and (max-width: 1220px), only screen and (max-device-width: 1220px) { + #wrap { + margin: 0 12px; + } +} + +#page-body { + margin: 4px 0; + clear: both; +} + +#page-footer { + clear: both; +} + +#page-footer h3 { + margin-top: 20px; +} + +.logo { + float: left; + width: auto; + padding: 10px 13px 0 10px; +} + +.logo:hover { + text-decoration: none; +} + +/* Site description and logo */ +#site-description { + float: left; + width: 65%; +} + +#site-description h1 { + margin-right: 0; +} + +/* Round cornered boxes and backgrounds +---------------------------------------- */ +.headerbar { + background: transparent none repeat-x 0 0; + margin-bottom: 4px; + padding: 5px; + border-radius: 7px; +} + +.navbar { + padding: 3px 10px; + border-radius: 7px; +} + +.forabg { + background: transparent none repeat-x 0 0; + margin-bottom: 4px; + padding: 5px; + clear: both; + border-radius: 7px; +} + +.forumbg { + background: transparent none repeat-x 0 0; + margin-bottom: 4px; + padding: 5px; + clear: both; + border-radius: 7px; +} + +.panel { + margin-bottom: 4px; + padding: 5px 10px; + border-radius: 7px; +} + +.post { + padding: 5px 10px; + margin-bottom: 4px; + background-repeat: no-repeat; + background-position: 100% 0; + border-radius: 7px; + position: relative; +} + +.rowbg { + margin: 5px 5px 2px 5px; +} + +/* Horizontal lists +----------------------------------------*/ +.navbar ul.linklist { + padding: 2px 0; +} + +ul.linklist { + display: block; + margin: 0; +} + +#cp-main .panel { + padding: 5px 10px; +} + +ul.linklist > li { + float: left; + font-size: 1.1em; + line-height: 2.2em; + list-style-type: none; + margin-right: 7px; + padding-top: 1px; + width: auto; +} + +ul.linklist > li.rightside, p.rightside, a.rightside { + float: right; + margin-right: 0; + margin-left: 7px; + text-align: right; +} + +ul.navlinks { + border-top: 1px solid transparent; +} + +ul.leftside { + float: left; + margin-left: 0; + margin-right: 5px; + text-align: left; +} + +ul.rightside { + float: right; + margin-left: 5px; + margin-right: -5px; + text-align: right; +} + +ul.linklist li.responsive-menu { + position: relative; + margin: 0 5px; +} + +ul.linklist li.responsive-menu a.responsive-menu-link { + display: inline-block; + margin: 0 5px; + font-size: 16px; + position: relative; + width: 16px; + line-height: 20px; + text-decoration: none; +} + +ul.linklist li.responsive-menu a.responsive-menu-link:before { + content: ''; + position: absolute; + left: 0; + top: 7px; + height: .125em; + width: 14px; + border-bottom: 0.125em solid transparent; + border-top: 0.375em double transparent; +} + +.hasjs ul.linklist.leftside, .hasjs ul.linklist.rightside { + max-width: 48%; +} + +.hasjs ul.linklist.fullwidth { + max-width: none; +} + +li.responsive-menu.dropdown-right .dropdown { + left: -9px; +} + +li.responsive-menu.dropdown-left .dropdown { + right: -6px; +} + +ul.linklist .dropdown { + top: 22px; +} + +ul.linklist .dropdown-up .dropdown { + bottom: 18px; + top: auto; +} + +/* Bulletin icons for list items +----------------------------------------*/ +ul.linklist.bulletin > li:before { + display: inline-block; + content: "\2022"; + font-size: inherit; + line-height: inherit; + padding-right: 4px; +} + +ul.linklist.bulletin > li:first-child:before, +ul.linklist.bulletin > li.rightside:last-child:before { + content: none; +} + +ul.linklist.bulletin > li.no-bulletin:before { + content: none; +} + +.responsive-menu:before { + display: none !important; +} + +/* Profile in overall_header.html */ +.header-profile { + display: inline-block; + vertical-align: top; +} + +.header-avatar:hover { + text-decoration: none; +} + +.header-avatar img { + margin-bottom: 2px; + max-height: 20px; + vertical-align: middle; + width: auto; +} + +.header-avatar span:after { + content: '\25BC'; + display: inline-block; + font-size: 9px; + float: right; + padding-left: 2px; + opacity: 0.7; +} + +/* Dropdown menu +----------------------------------------*/ +.dropdown-container { + position: relative; +} + +.dropdown-container-right { + float: right; +} + +.dropdown-container-left { + float: left; +} + +.nojs .dropdown-container:hover .dropdown { + display: block !important; +} + +.dropdown { + position: absolute; + left: 0; + top: 1.2em; + z-index: 2; + border: 1px solid transparent; + border-radius: 5px; + padding: 9px 0 0; + margin-right: -500px; +} + +.dropdown.live-search { + top: auto; +} + +.dropdown-container.topic-tools { + float: left; +} + +.dropdown-up .dropdown { + top: auto; + bottom: 1.2em; + padding: 0 0 9px; +} + +.dropdown-left .dropdown, .nojs .rightside .dropdown { + left: auto; + right: 0; + margin-left: -500px; + margin-right: 0; +} + +.dropdown-button-control .dropdown { + top: 24px; +} + +.dropdown-button-control.dropdown-up .dropdown { + top: auto; + bottom: 24px; +} + +.dropdown .pointer, .dropdown .pointer-inner { + position: absolute; + width: 0; + height: 0; + border-top-width: 0; + border-bottom: 10px solid transparent; + border-left: 10px dashed transparent; + border-right: 10px dashed transparent; + -webkit-transform: rotate(360deg); /* better anti-aliasing in webkit */ + display: block; +} + +.dropdown-up .pointer, .dropdown-up .pointer-inner { + border-bottom-width: 0; + border-top: 10px solid transparent; +} + +.dropdown .pointer { + right: auto; + left: 10px; + top: 0; + z-index: 3; +} + +.dropdown-up .pointer { + bottom: 0; + top: auto; +} + +.dropdown-left .dropdown .pointer, .nojs .rightside .dropdown .pointer { + left: auto; + right: 10px; +} + +.dropdown .pointer-inner { + top: auto; + bottom: -11px; + left: -10px; +} + +.dropdown-up .pointer-inner { + bottom: auto; + top: -11px; +} + +.dropdown .dropdown-contents { + z-index: 2; + overflow: hidden; + overflow-y: auto; + border: 1px solid transparent; + border-radius: 5px; + padding: 5px; + position: relative; + min-width: 40px; + max-height: 300px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.dropdown li { + border-top: 1px dotted transparent; + float: none !important; + line-height: normal !important; + font-size: 1em !important; + list-style: none; + margin: 0; + padding-top: 4px; + padding-bottom: 4px; + white-space: nowrap; + text-align: left; +} + +.dropdown-contents > li { + padding-right: 15px; +} + +.dropdown-nonscroll > li { + padding-right: 0; +} + +.dropdown li:first-child, .dropdown li.separator + li, .dropdown li li { + border-top: 0; +} + +.dropdown li li:first-child { + margin-top: 4px; +} + +.dropdown li li:last-child { + padding-bottom: 0; +} + +.dropdown li li { + border-top: 1px dotted transparent; + padding-left: 18px; +} + +.wrap .dropdown li, .dropdown.wrap li, .dropdown-extended li { + white-space: normal; +} + +.dropdown li.separator { + border-top: 1px solid transparent; + margin: 4px 0; + padding: 0; +} + +.dropdown li.separator:first-child, .dropdown li.separator:last-child { + display: none !important; +} + +/* Responsive breadcrumbs +----------------------------------------*/ +.breadcrumbs .crumb { + float: left; + font-weight: bold; + word-wrap: normal; +} + +.breadcrumbs .crumb:before { + content: '\2039'; + font-weight: bold; + padding: 0 0.5em; +} + +.breadcrumbs .crumb:first-child:before { + content: none; +} + +.breadcrumbs .crumb a { + display: inline-block; + white-space: nowrap; + text-overflow: ellipsis; + vertical-align: bottom; + overflow: hidden; +} + +.breadcrumbs.wrapped .crumb a { letter-spacing: -.3px; } +.breadcrumbs.wrapped .crumb.wrapped-medium a { letter-spacing: -.4px; } +.breadcrumbs.wrapped .crumb.wrapped-tiny a { letter-spacing: -.5px; } + +.breadcrumbs .crumb.wrapped-max a { max-width: 120px; } +.breadcrumbs .crumb.wrapped-wide a { max-width: 100px; } +.breadcrumbs .crumb.wrapped-medium a { max-width: 80px; } +.breadcrumbs .crumb.wrapped-small a { max-width: 60px; } +.breadcrumbs .crumb.wrapped-tiny a { max-width: 40px; } + +/* Table styles +----------------------------------------*/ +table.table1 { + width: 100%; +} + +#ucp-main table.table1 { + padding: 2px; +} + +table.table1 thead th { + font-weight: normal; + text-transform: uppercase; + line-height: 1.3em; + font-size: 1em; + padding: 0 0 4px 3px; +} + +table.table1 thead th span { + padding-left: 7px; +} + +table.table1 tbody tr { + border: 1px solid transparent; +} + +table.table1 td { + font-size: 1.1em; +} + +table.table1 tbody td { + padding: 5px; + border-top: 1px solid transparent; +} + +table.table1 tbody th { + padding: 5px; + border-bottom: 1px solid transparent; + text-align: left; +} + +/* Specific column styles */ +table.table1 .name { text-align: left; } +table.table1 .posts { text-align: center; width: 7%; } +table.table1 .joined { text-align: left; width: 15%; } +table.table1 .active { text-align: left; width: 15%; } +table.table1 .mark { text-align: center; width: 7%; } +table.table1 .info { text-align: left; width: 30%; } +table.table1 .info div { width: 100%; white-space: normal; overflow: hidden; } +table.table1 .autocol { line-height: 2em; white-space: nowrap; } +table.table1 thead .autocol { padding-left: 1em; } + +table.table1 span.rank-img { + float: right; + width: auto; +} + +table.info td { + padding: 3px; +} + +table.info tbody th { + padding: 3px; + text-align: right; + vertical-align: top; + font-weight: normal; +} + +.forumbg table.table1 { + margin: 0; +} + +.forumbg-table > .inner { + margin: 0 -1px; +} + +#color_palette_placeholder table { + border-collapse: separate; + border-spacing: 1px; +} + +/* Misc layout styles +---------------------------------------- */ +/* column[1-2] styles are containers for two column layouts + Also see tweaks.css */ +.column1 { + float: left; + clear: left; + width: 49%; +} + +.column2 { + float: right; + clear: right; + width: 49%; +} + +/* General classes for placing floating blocks */ +.left-box { + float: left; + width: auto; + text-align: left; + max-width: 100%; +} + +.left-box.profile-details { + width: 80%; +} + +.right-box { + float: right; + width: auto; + text-align: right; + max-width: 100%; +} + +dl.details { + /*font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;*/ + font-size: 1.1em; +} + +dl.details dt { + float: left; + clear: left; + width: 30%; + text-align: right; + display: block; +} + +dl.details dd { + margin-left: 0; + padding-left: 5px; + margin-bottom: 5px; + float: left; + width: 65%; + overflow: hidden; + text-overflow: ellipsis; +} + +.clearfix, fieldset dl, ul.topiclist dl, dl.polls { + overflow: hidden; +} + +fieldset.fields1 ul.recipients { + list-style-type: none; + line-height: 1.8; + max-height: 150px; + overflow-y: auto; +} + +fieldset.fields1 dd.recipients { + clear: left; + margin-left: 1em; +} + +fieldset.fields1 ul.recipients input.button2{ + font-size: 0.8em; + margin-right: 0; + padding: 0; +} + +fieldset.fields1 dl.pmlist > dt { + width: auto !important; +} + +fieldset.fields1 dl.pmlist dd.recipients { + margin-left: 0 !important; +} + +/* Action-bars (container for post/reply buttons, pagination, etc.) +---------------------------------------- */ +.action-bar { + font-size: 11px; + margin: 4px 0; +} + +.forabg + .action-bar { + margin-top: 2em; +} + +/* Pagination +---------------------------------------- */ +.pagination { + float: right; + font-size: 11px; + margin-top: 3px; + text-align: right; + width: auto; +} + +.action-bar.bottom .pagination { + margin-top: 0; +} + +.pagination > ul { + display: inline-block; + list-style: none !important; + margin-left: 5px; +} + +.pagination > ul > li { + display: inline-block !important; + padding: 0; + font-size: 100%; + line-height: normal; + vertical-align: middle; +} + +.pagination li a, .pagination li span { + border: 1px solid transparent; + border-radius: 2px; + display: block; + font-size: 0.9em; + font-weight: normal; + line-height: 13px; + min-width: 10px; + padding: 3px; + text-align: center; + text-decoration: none; +} + +.pagination li.ellipsis span { + border: none; + padding: 0; +} + +.pagination li.page-jump { + margin-right: 5px; +} + +.pagination li.page-jump a, .pagination li.next a, .pagination li.previous a { + background-repeat: no-repeat; + font-size: 0; + height: 13px; + width: 11px; +} + +.pagination li.page-jump a { + background-position: 0 2px; + width: 24px; +} + +.pagination li.next a { + background-position: -50px 2px; +} + +.pagination li.previous a { + background-position: -30px 2px; +} + +.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 in viewforum for multipage topics */ +.row .pagination { + display: block; + margin-top: 0; + padding: 1px 0 1px 15px; + font-size: 0.9em; + background: none 0 50% no-repeat; +} + +.row .pagination > ul { + margin: 0; +} + +.row .pagination li a, .row .pagination li span { + border-radius: 1px; + padding: 1px; +} + +/* jQuery popups +---------------------------------------- */ +.phpbb_alert { + border: 1px solid transparent; + display: none; + left: 0; + padding: 0 25px 20px 25px; + position: fixed; + right: 0; + top: 150px; + z-index: 50; + width: 620px; + margin: 0 auto; +} + +@media only screen and (max-height: 500px), only screen and (max-device-width: 500px) +{ + .phpbb_alert { + top: 25px; + } +} + +.phpbb_alert .alert_close { + display: block; + float: right; + width: 16px; + height: 16px; + overflow: hidden; + text-decoration: none !important; + background: transparent none 0 0 no-repeat; + margin-top: -7px; + margin-right: -31px; +} +.phpbb_alert .alert_close:hover { + background-position: 0 -16px; +} + +.phpbb_alert p { + margin: 8px 0; + padding-bottom: 8px; +} + +.phpbb_alert label { + display: block; + margin: 8px 0; + padding-bottom: 8px; +} + +.phpbb_alert div.alert_text > p, +.phpbb_alert div.alert_text > label, +.phpbb_alert div.alert_text > select, +.phpbb_alert div.alert_text > textarea, +.phpbb_alert div.alert_text > input { + font-size: 1.1em; +} + +#darkenwrapper { + display: none; + position: relative; + z-index: 44; +} + +#darken { + position: fixed; + left: 0; + top: 0; + width: 100%; + height: 100%; + opacity: 0.5; + z-index: 45; +} + +#loading_indicator { + background: center center no-repeat; + border-radius: 5px; + display: none; + opacity: 0.8; + margin-top: -50px; + margin-left: -50px; + height: 50px; + width: 50px; + position: fixed; + left: 50%; + top: 50%; + z-index: 51; +} + +/* Miscellaneous styles +---------------------------------------- */ +#forum-permissions { + float: right; + width: auto; + padding-left: 5px; + margin-left: 5px; + margin-top: 10px; + text-align: right; +} + +.copyright { + padding: 5px; + text-align: center; +} + +.small { + font-size: 0.9em !important; +} + +.titlespace { + margin-bottom: 15px; +} + +.headerspace { + margin-top: 20px; +} + +.error { + font-weight: bold; + font-size: 1em; +} + +div.rules { + margin: 10px 0; + font-size: 1.1em; + padding: 5px 10px; + border-radius: 7px; +} + +div.rules ul, div.rules ol { + margin-left: 20px; +} + +p.post-notice { + position: relative; + padding: 5px; + padding-left: 26px; + min-height: 14px; + margin-bottom: 1em; +} + +p.post-notice:before { + content: ''; + display: block; + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 28px; + background: transparent none 50% 50% no-repeat; + pointer-events: none; +} + +form > p.post-notice strong { + line-height: 20px; +} + +#jumpbox { + margin: 5px 0; +} + +.stat-block { + clear: both; +} + +#top { + position: absolute; + top: -20px; +} + +.clear { + display: block; + clear: both; + font-size: 1px; + line-height: 1px; + background: transparent; +} + +/* Inner box-model clearing */ +.inner:after, +ul.linklist:after, +.action-bar:after, +.notification_text:after, +.tabs-container:after, +#tabs > ul:after, +#minitabs > ul:after, +.postprofile .avatar-container:after { + clear: both; + content: ''; + display: block; +} + +.hidden { + display: none; +} + +.smilies { + vertical-align: text-bottom; +} + +.icon-notification { + position: relative; +} + +.member-search { + float: left; + margin: 0; + padding: 6px 10px; +} + +.member-search strong { + font-size: 0.95em; +} + +.dropdown-extended { + display: none; + z-index: 1; +} + +.dropdown-extended ul { + max-height: 350px; + overflow-y: auto; + overflow-x: hidden; + clear: both; +} + +.dropdown-extended ul li { + padding: 0; + margin: 0 !important; + float: none; + border-top: 1px solid; + list-style-type: none; + font-size: 0.95em; + clear: both; + position: relative; +} + +.dropdown-extended ul li:first-child { + border-top: none; +} + +.dropdown-extended ul li.no_notifications { + padding: 10px; +} + +.dropdown-extended .dropdown-contents { + max-height: none; + padding: 0; + position: absolute; + width: 340px; +} + +.nojs .dropdown-extended .dropdown-contents { + position: relative; +} + +.dropdown-extended .header { + padding: 0 10px; + font-family: Arial, "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 11px; + font-weight: bold; + text-align: left; + text-shadow: 1px 1px 1px white; + text-transform: uppercase; + line-height: 30px; + border-bottom: 1px solid; + border-radius: 5px 5px 0 0; +} + +.dropdown-extended .header .header_settings { + float: right; + font-weight: normal; + text-transform: none; +} + +.dropdown-extended .footer { + text-align: center; + font-size: 1.1em; +} + +.dropdown-extended ul li a, .dropdown-extended ul li.no-url { + padding: 8px; +} + +.dropdown-extended .footer > a { + padding: 5px 0; +} + +.dropdown-extended ul li a, .notification_list dt > a, .dropdown-extended .footer > a { + display: block; + text-decoration: none; +} + +.notification_list ul li img { + float: left; + max-height: 50px; + max-width: 50px; + width: auto !important; + height: auto !important; + margin-right: 5px; +} + +.notification_list ul li p { + margin-bottom: 4px; + font-size: 1em; +} + +.notification_list p.notification-reference, +.notification_list p.notification-location, +.notification_list li a p.notification-reason { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.notification_list p.notification-time { + font-size: 10px; + margin: 0; + text-align: right; +} + +.notification_list div.notifications { + margin-left: 50px; + padding: 5px; +} + +.notification_list div.notifications a { + display: block; +} + +.notification_list p.notifications_title { + font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; + font-size: 13px !important; +} + +.notification_list p.notifications_title strong { + font-weight: bold; +} + +.notification_list p.notifications_time { + font-size: 10px !important; +} + +.notification_text { + margin-left: 58px; +} + +/* Navbar specific list items +----------------------------------------*/ + +#quick-links { + margin: 0 7px 0 0; +} + +#quick-links a.responsive-menu-link { + display: block; + font-size: inherit; + line-height: inherit; + margin: 0; + width: auto; +} + +#quick-links a.responsive-menu-link:before { + font-size: 16px; + line-height: 16.5px; +} + +.compact #quick-links a.responsive-menu-link { + font-size: 0; +} + +.compact .icon-notification > a > span, .compact .icon-pm > a > span { + display: none; +} + +.compact .icon-notification > a > strong, .compact .icon-pm > a > strong { + padding-left: 2px; +} + +.dropdown-page-jump .dropdown { + top: 20px; +} + +.dropdown-page-jump.dropdown-up .dropdown { + bottom: 20px; +} + +.dropdown-page-jump input.tiny { + width: 50px; +} + +.dropdown .clone.hidden + li.separator { + display: none; +} + +.dropdown .clone.hidden + li { + border-top: none; +} diff --git a/sources/phpBB/styles/prosilver/theme/content.css b/sources/phpBB/styles/prosilver/theme/content.css new file mode 100644 index 0000000..e73f8c9 --- /dev/null +++ b/sources/phpBB/styles/prosilver/theme/content.css @@ -0,0 +1,847 @@ +/* Content Styles +---------------------------------------- */ + +ul.topiclist { + display: block; + list-style-type: none; + margin: 0; +} + +ul.forums { + background: transparent none repeat-x 0 0; +} + +ul.topiclist li { + display: block; + list-style-type: none; + margin: 0; +} + +ul.topiclist dl { + position: relative; +} + +ul.topiclist li.row dl { + padding: 2px 0; +} + +ul.topiclist dt, ul.topiclist dd { + display: block; + float: left; +} + +ul.topiclist dt { + width: 100%; + margin-right: -440px; + font-size: 1.1em; +} + +ul.topiclist.missing-column dt { + margin-right: -345px; +} + +ul.topiclist.two-long-columns dt { + margin-right: -250px; +} + +ul.topiclist.two-columns dt { + margin-right: -80px; +} + +ul.topiclist dt .list-inner { + margin-right: 440px; + padding-left: 5px; + padding-right: 5px; +} + +ul.topiclist.missing-column dt .list-inner { + margin-right: 345px; +} + +ul.topiclist.two-long-columns dt .list-inner { + margin-right: 250px; +} + +ul.topiclist.two-columns dt .list-inner { + margin-right: 80px; +} + +ul.topiclist dd { + border-left: 1px solid transparent; + padding: 4px 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +ul.topiclist dfn { + /* Labels for post/view counts */ + position: absolute; + left: -999px; + width: 990px; +} + +ul.topiclist li.row dt a.subforum { + background-image: none; + background-position: 0 50%; + background-repeat: no-repeat; + position: relative; + white-space: nowrap; + padding: 0 0 0 12px; +} + +.forum-image { + float: left; + padding-top: 5px; + margin-right: 5px; +} + +li.row { + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; +} + +li.row strong { + font-weight: normal; +} + +li.header dt, li.header dd { + line-height: 1em; + border-left-width: 0; + margin: 2px 0 4px 0; + padding-top: 2px; + padding-bottom: 2px; + font-size: 1em; + font-family: Arial, Helvetica, sans-serif; + text-transform: uppercase; +} + +li.header dt { + font-weight: bold; + width: 100%; + margin-right: -440px; +} + +li.header dt .list-inner { + margin-right: 440px; +} + +li.header dd { + padding-left: 1px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +li.header dl.icon dt, li.header dl.icon dd { + min-height: 0; +} + +li.header dl.icon dt .list-inner { + /* Tweak for headers alignment when folder icon used */ + padding-left: 0; + padding-right: 50px; +} + +/* Forum list column styles */ +dl.icon { + background-position: 10px 50%; /* Position of folder icon */ + background-repeat: no-repeat; +} + +dl.icon dt { + background-repeat: no-repeat; + background-position: 5px 95%; /* Position of topic icon */ +} + +dl.icon dt .list-inner { + padding-left: 45px; /* Space for folder icon */ +} + +dl.icon dt, dl.icon dd { + min-height: 35px; +} + +dl a.icon-link { /* topic row icon links */ + display: block; + width: 30px; + height: 30px; + padding: 0; + position: absolute; + top: 50%; + left: 0; + margin-top: -15px; + margin-left: 9px; +} + +dd.posts, dd.topics, dd.views, dd.extra, dd.mark { + width: 80px; + text-align: center; + line-height: 2.2em; + font-size: 1.2em; +} + +dd.posts, dd.topics, dd.views { + width: 95px; +} + +/* List in forum description */ +dl.icon dt ol, +dl.icon dt ul { + list-style-position: inside; + margin-left: 1em; +} + +dl.icon dt li { + display: list-item; + list-style-type: inherit; +} + +dd.lastpost, dd.redirect, dd.moderation, dd.time, dd.info { + width: 250px; + font-size: 1.1em; +} + +dd.redirect { + line-height: 2.5em; +} + +dd.time { + line-height: 200%; +} + +dd.lastpost > span, ul.topiclist dd.info > span, ul.topiclist dd.time > span, dd.redirect > span, dd.moderation > span { + display: block; + padding-left: 5px; +} + +dd.extra, dd.mark { + line-height: 200%; +} + +dd.option { + width: 125px; + line-height: 200%; + text-align: center; + font-size: 1.1em; +} + +/* Post body styles +----------------------------------------*/ +.postbody { + padding: 0; + line-height: 1.48em; + width: 76%; + float: left; + position: relative; +} + +.postbody .ignore { + font-size: 1.1em; +} + +.postbody h3.first { + /* The first post on the page uses this */ + font-size: 1.7em; +} + +.postbody h3 { + /* Postbody requires a different h3 format - so change it here */ + float: left; + font-size: 1.5em; + padding: 2px 0 0 0; + margin-top: 0 !important; + margin-bottom: 0.3em !important; + text-transform: none; + border: none; + font-family: "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif; + line-height: 125%; +} + +.postbody h3 img { + /* Also see tweaks.css */ + vertical-align: bottom; +} + +.has-profile .postbody h3 { + /* If there is a post-profile, we position the post-buttons differently */ + float: none !important; + margin-right: 180px; +} + +.postbody .content { + font-size: 1.3em; + overflow-x: auto; +} + +.postbody img.postimage { + max-width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.search .postbody { + width: 68% +} + +/* Topic review panel +----------------------------------------*/ +#review { + margin-top: 2em; +} + +#topicreview { + padding-right: 5px; + overflow: auto; + height: 300px; +} + +#topicreview .postbody { + width: auto; + float: none; + margin: 0; + height: auto; +} + +#topicreview .post { + height: auto; +} + +#topicreview h2 { + border-bottom-width: 0; +} + +.post-ignore .postbody { + display: none; +} + +/* MCP Post details +----------------------------------------*/ +#post_details { + /* This will only work in IE7+, plus the others */ + overflow: auto; + max-height: 300px; +} + +/* Content container styles +----------------------------------------*/ +.content { + clear: both; + min-height: 3em; + overflow: hidden; + line-height: 1.4em; + font-family: "Lucida Grande", "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif; + font-size: 1em; + padding-bottom: 1px; +} + +.content h2, .panel h2 { + font-weight: normal; + border-bottom: 1px solid transparent; + font-size: 1.6em; + margin-top: 0.5em; + margin-bottom: 0.5em; + padding-bottom: 0.5em; +} + +.panel h3 { + margin: 0.5em 0; +} + +.panel p { + font-size: 1.2em; + margin-bottom: 1em; + line-height: 1.4em; +} + +.content p { + font-family: "Lucida Grande", "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif; + font-size: 1.2em; + margin-bottom: 1em; + line-height: 1.4em; +} + +dl.faq { + font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; + font-size: 1.1em; + margin-top: 1em; + margin-bottom: 2em; + line-height: 1.4em; +} + +dl.faq dt { + font-weight: bold; +} + +.content dl.faq { + font-size: 1.2em; + margin-bottom: 0.5em; +} + +.content li { + list-style-type: inherit; +} + +.content ul, .content ol { + margin-bottom: 1em; + margin-left: 3em; +} + +.posthilit { + padding: 0 2px 1px 2px; +} + +/* Post author */ +p.author { + margin-bottom: 0.6em; + padding: 0 0 5px 0; + font-family: Verdana, Helvetica, Arial, sans-serif; + font-size: 1em; + line-height: 1.2em; + clear: both; +} + +/* Post signature */ +.signature { + margin-top: 1.5em; + padding-top: 0.2em; + font-size: 1.1em; + border-top: 1px solid transparent; + clear: left; + line-height: 140%; + overflow: hidden; + width: 100%; +} + +.signature.standalone { + border-top-width: 0; + margin-top: 0; +} + +dd .signature { + margin: 0; + padding: 0; + clear: none; + border: none; +} + +.signature li { + list-style-type: inherit; +} + +.signature ul, .signature ol { + margin-bottom: 1em; + margin-left: 3em; +} + +/* Post noticies */ +.notice { + font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; + width: auto; + margin-top: 1.5em; + padding-top: 0.2em; + font-size: 1em; + border-top: 1px dashed transparent; + clear: left; + line-height: 130%; +} + +/* Jump to post link for now */ +ul.searchresults { + list-style: none; + text-align: right; + clear: both; +} + +/* BB Code styles +----------------------------------------*/ +/* Quote block */ +blockquote { + background: transparent none 6px 8px no-repeat; + border: 1px solid transparent; + font-size: 0.95em; + margin: 0.5em 1px 0 25px; + overflow: hidden; + padding: 5px; +} + +blockquote blockquote { + /* Nested quotes */ + font-size: 1em; + margin: 0.5em 1px 0 15px; +} + +blockquote cite { + /* Username/source of quoter */ + font-style: normal; + font-weight: bold; + margin-left: 20px; + display: block; + font-size: 0.9em; +} + +blockquote cite cite { + font-size: 1em; +} + +blockquote.uncited { + padding-top: 25px; +} + +/* Code block */ +.codebox { + padding: 3px; + border: 1px solid transparent; + font-size: 1em; +} + +.codebox p { + text-transform: uppercase; + border-bottom: 1px solid transparent; + margin-bottom: 3px; + font-size: 0.8em !important; + font-weight: bold; + display: block; +} + +blockquote .codebox { + margin-left: 0; +} + +.codebox code { + /* Also see tweaks.css */ + overflow: auto; + 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; + margin: 2px 0; +} + +/* Attachments +----------------------------------------*/ +.attachbox { + float: left; + width: auto; + max-width: 100%; + margin: 5px 5px 5px 0; + padding: 6px; + border: 1px dashed transparent; + clear: left; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.attachbox dt { + font-family: Arial, Helvetica, sans-serif; + text-transform: uppercase; +} + +.attachbox dd { + margin-top: 4px; + padding-top: 4px; + clear: left; + border-top: 1px solid transparent; + overflow-x: auto; +} + +.attachbox dd dd { + border: none; +} + +.attachbox p { + line-height: 110%; + font-weight: normal; + clear: left; +} + +.attachbox p.stats +{ + line-height: 110%; + font-weight: normal; + clear: left; +} + +.attach-image { + margin: 3px 0; + max-width: 100%; +} + +.attach-image img { + border: 1px solid transparent; +/* cursor: move; */ + cursor: default; +} + +/* Inline image thumbnails */ +div.inline-attachment dl.thumbnail, div.inline-attachment dl.file { + display: block; + margin-bottom: 4px; +} + +div.inline-attachment p { + font-size: 100%; +} + +dl.file { + font-family: Verdana, Arial, Helvetica, sans-serif; + display: block; +} + +dl.file dt { + text-transform: none; + margin: 0; + padding: 0; + font-weight: bold; + font-family: Verdana, Arial, Helvetica, sans-serif; +} + +dl.file dd { + margin: 0; + padding: 0; +} + +dl.thumbnail img { + padding: 3px; + border: 1px solid transparent; + box-sizing: border-box; +} + +dl.thumbnail dd { + font-style: italic; + font-family: Verdana, Arial, Helvetica, sans-serif; +} + +.attachbox dl.thumbnail dd { + font-size: 100%; +} + +dl.thumbnail dt a:hover img { + border: 1px solid transparent; +} + +/* Post poll styles +----------------------------------------*/ +fieldset.polls { + font-family: "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif; +} + +fieldset.polls dl { + margin-top: 5px; + border-top: 1px solid transparent; + padding: 5px 0 0 0; + line-height: 120%; +} + +fieldset.polls dl.voted { + font-weight: bold; +} + +fieldset.polls dt { + text-align: left; + float: left; + display: block; + width: 30%; + border-right: none; + padding: 0; + margin: 0; + font-size: 1.1em; +} + +fieldset.polls dd { + float: left; + width: 10%; + border-left: none; + padding: 0 5px; + margin-left: 0; + font-size: 1.1em; +} + +fieldset.polls dd.resultbar { + width: 50%; +} + +fieldset.polls dd input { + margin: 2px 0; +} + +fieldset.polls dd div { + text-align: right; + font-family: Arial, Helvetica, sans-serif; + font-weight: bold; + padding: 0 2px; + overflow: visible; + min-width: 8px; +} + +.pollbar1, .pollbar2, .pollbar3, .pollbar4, .pollbar5 { + border-bottom: 1px solid transparent; + border-right: 1px solid transparent; +} + +.vote-submitted { + font-size: 1.2em; + font-weight: bold; + text-align: center; +} + +/* Poster profile block +----------------------------------------*/ +.postprofile { + /* Also see tweaks.css */ + margin: 5px 0 10px 0; + min-height: 80px; + border: 1px solid transparent; + border-width: 0 0 0 1px; + width: 22%; + float: right; + display: inline; +} + +.postprofile dd, .postprofile dt { + line-height: 1.2em; + margin-left: 8px; +} + +.postprofile dd { + overflow: hidden; + text-overflow: ellipsis; +} + +.postprofile strong { + font-weight: normal; +} + +.postprofile dt.no-profile-rank, .postprofile dd.profile-rank, .postprofile .search-result-date { + margin-bottom: 10px; +} + +/* Post-profile avatars */ +.postprofile .has-avatar .avatar-container { + margin-bottom: 3px; + overflow: hidden; +} + +.postprofile .avatar { + display: block; + float: left; + max-width: 100%; +} + +.postprofile .avatar img { + display: block; + height: auto !important; + max-width: 100%; +} + +.postprofile .profile-posts a { + font-weight: normal; +} + +dd.profile-warnings { + font-weight: bold; +} + +dd.profile-contact { + overflow: visible; +} + +.profile-contact .dropdown-container { + display: inline-block; +} + +.profile-contact .icon_contact { + vertical-align: middle; +} + +.profile-contact .dropdown { + margin-right: -14px; +} + +.online { + background-image: none; + background-position: 100% 0; + background-repeat: no-repeat; +} + +/* Poster profile used by search*/ +.search .postprofile { + width: 30%; +} + +/* Profile used on view-profile */ +.profile-avatar img { + max-width: 100%; +} + +/* pm list in compose message if mass pm is enabled */ +dl.pmlist dt { + width: 60% !important; +} + +dl.pmlist dt textarea { + width: 95%; +} + +dl.pmlist dd { + margin-left: 61% !important; + margin-bottom: 2px; +} + +.action-bar div.dl_links { + padding: 10px 0 0 10px; +} + +div.dl_links { + display: inline-block; + text-transform: none; +} + +.dl_links strong { + font-weight: bold; +} + +.dl_links ul { + list-style-type: none; + margin: 0; + display: inline-block; +} + +.dl_links li { + display: inline-block; +} + +.attachment-filename { + width: 100%; +} + +.ellipsis-text { + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +table.fixed-width-table { + table-layout: fixed; +} + +/* Show scrollbars for items with overflow on iOS devices +----------------------------------------*/ +.postbody .content::-webkit-scrollbar, #topicreview::-webkit-scrollbar, #post_details::-webkit-scrollbar, .codebox code::-webkit-scrollbar, .attachbox dd::-webkit-scrollbar, .attach-image::-webkit-scrollbar, .dropdown-extended ul::-webkit-scrollbar { + width: 8px; + height: 8px; + -webkit-appearance: none; + background: rgba(0, 0, 0, .1); + border-radius: 3px; +} + +.postbody .content::-webkit-scrollbar-thumb, #topicreview::-webkit-scrollbar-thumb, #post_details::-webkit-scrollbar-thumb, .codebox code::-webkit-scrollbar-thumb, .attachbox dd::-webkit-scrollbar-thumb, .attach-image::-webkit-scrollbar-thumb, .dropdown-extended ul::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, .3); + border-radius: 3px; +} diff --git a/sources/phpBB/styles/prosilver/theme/cp.css b/sources/phpBB/styles/prosilver/theme/cp.css new file mode 100644 index 0000000..81b6d9b --- /dev/null +++ b/sources/phpBB/styles/prosilver/theme/cp.css @@ -0,0 +1,376 @@ +/* Control Panel Styles +---------------------------------------- */ + + +/* Main CP box +----------------------------------------*/ +#cp-menu { + float:left; + width: 19%; + margin-top: 1em; + margin-bottom: 5px; +} + +#cp-main { + float: left; + width: 81%; +} + +#cp-main .content { + padding: 0; +} + +.panel-container .panel p { + font-size: 1.1em; +} + +.panel-container .panel ol { + margin-left: 2em; + font-size: 1.1em; +} + +.panel-container .panel li.row { + border-bottom: 1px solid transparent; + border-top: 1px solid transparent; +} + +ul.cplist { + margin-bottom: 5px; + border-top: 1px solid transparent; +} + +.panel-container .panel li.header dd, .panel-container .panel li.header dt { + margin-bottom: 2px; +} + +.panel-container table.table1 { + margin-bottom: 1em; +} + +.panel-container table.table1 thead th { + font-weight: bold; + border-bottom: 1px solid transparent; + padding: 5px; +} + +.panel-container table.table1 tbody th { + font-style: italic; + background-color: transparent !important; + border-bottom: none; +} + +#cp-main .pm-message { + border: 1px solid transparent; + margin: 10px 0; + width: auto; + float: none; +} + +.pm-message h2 { + padding-bottom: 5px; +} + +#cp-main .postbody h3, #cp-main .box2 h3 { + margin-top: 0; +} + +.panel-container .postbody p.author { + font-size: 1.1em; +} + +#cp-main .buttons { + margin-left: 0; +} + +#cp-main ul.linklist { + margin: 0; +} + +/* MCP Specific tweaks */ +.mcp-main .postbody { + width: 100%; +} + +.tabs-container h2 { + float: left; + margin-bottom: 0px; +} + +/* CP tabs shared +----------------------------------------*/ +#tabs, #minitabs { + line-height: normal; +} + +#tabs > ul, #minitabs > ul { + list-style: none; + margin: 0; + padding: 0; + position: relative; +} + +#tabs .tab, #minitabs .tab { + display: block; + float: left; + font-size: 1em; + font-weight: bold; + line-height: 14px; +} + +#tabs .tab > a, #minitabs .tab > a { + display: block; + padding: 5px 9px; + position: relative; + text-decoration: none; + white-space: nowrap; + cursor: pointer; +} + +/* CP tabbed menu +----------------------------------------*/ +#tabs { + margin: 20px 0 0 7px; +} + +#tabs .tab > a { + border: 1px solid transparent; + border-radius: 4px 4px 0 0; + margin: 1px 1px 0 0; +} + +#tabs .activetab > a { + margin-top: 0; + padding-bottom: 7px; +} + +/* Mini tabbed menu used in MCP +----------------------------------------*/ +#minitabs { + float: right; + margin: 15px 7px 0 0; + max-width: 50%; +} + +#minitabs .tab { + float: right; +} + +#minitabs .tab > a { + border-radius: 5px 5px 0 0; + margin-left: 2px; +} + +#minitabs .tab > a:hover { + text-decoration: none; +} + +/* Responsive tabs +----------------------------------------*/ +.responsive-tab { + position: relative; +} + +.responsive-tab > a.responsive-tab-link { + display: block; + font-size: 16px; + position: relative; + width: 16px; + line-height: 14px; + text-decoration: none; +} + +.responsive-tab .responsive-tab-link:before { + content: ''; + position: absolute; + left: 10px; + top: 7px; + height: .125em; + width: 14px; + border-bottom: 0.125em solid transparent; + border-top: 0.375em double transparent; +} + +#tabs .dropdown, #minitabs .dropdown { + top: 20px; + margin-right: -2px; + font-size: 1.1em; + font-weight: normal; +} + +#minitabs .dropdown { + margin-right: -4px; +} + +#tabs .dropdown-up .dropdown, #minitabs .dropdown-up .dropdown { + bottom: 20px; + top: auto; +} + +#tabs .dropdown li { + text-align: right; +} + +#minitabs .dropdown li { + text-align: left; +} + +/* UCP navigation menu +----------------------------------------*/ +/* Container for sub-navigation list */ +#navigation { + width: 100%; + padding-top: 36px; +} + +#navigation ul { + list-style: none; +} + +/* Default list state */ +#navigation li { + display: inline; + font-weight: bold; + margin: 1px 0; + padding: 0; +} + +/* Link styles for the sub-section links */ +#navigation a { + display: block; + padding: 5px; + margin: 1px 0; + text-decoration: none; +} + +#navigation a:hover { + text-decoration: none; +} + +/* Preferences pane layout +----------------------------------------*/ +#cp-main h2 { + border-bottom: none; + padding: 0; + margin-left: 10px; +} + +/* Friends list */ +.cp-mini { + margin: 10px 15px 10px 5px; + max-height: 200px; + overflow-y: auto; + padding: 5px 10px; + border-radius: 7px; +} + +dl.mini dt { + font-weight: bold; +} + +dl.mini dd { + padding-top: 4px; +} + +.friend-online { + font-weight: bold; +} + +.friend-offline { + font-style: italic; +} + +/* PM Styles +----------------------------------------*/ +#pm-menu { + line-height: 2.5em; +} + +/* Defined rules list for PM options */ +ol.def-rules { + padding-left: 0; +} + +ol.def-rules li { + line-height: 180%; + padding: 1px; +} + +/* PM marking colours */ +.pmlist li.bg1 { + padding: 0 3px; +} + +.pmlist li.bg2 { + padding: 0 3px; +} + +.pmlist li.pm_message_reported_colour, .pm_message_reported_colour { + border-left-color: transparent; + border-right-color: transparent; +} + +.pmlist li.pm_marked_colour, .pm_marked_colour, +.pmlist li.pm_replied_colour, .pm_replied_colour, +.pmlist li.pm_friend_colour, .pm_friend_colour, +.pmlist li.pm_foe_colour, .pm_foe_colour { + padding: 0; + border: solid 3px transparent; + border-width: 0 3px; +} + +.pm-legend { + border-left-width: 10px; + border-left-style: solid; + border-right-width: 0; + margin-bottom: 3px; + padding-left: 3px; +} + +/* Avatar gallery */ +#gallery label { + position: relative; + float: left; + margin: 10px; + padding: 5px; + width: auto; + border: 1px solid transparent; + text-align: center; +} + +/* Responsive *CP navigation +----------------------------------------*/ +@media only screen and (max-width: 900px), only screen and (max-device-width: 900px) +{ + .nojs #tabs a span, .nojs #minitabs a span { + max-width: 40px; + overflow: hidden; + text-overflow: ellipsis; + letter-spacing: -.5px; + } + + #cp-menu, #navigation, #cp-main { + float: none; + width: auto; + margin: 0; + } + + #navigation { + padding: 0; + margin: 0 auto; + max-width: 320px; + } + + #navigation a { + background-image: none; + } + + #navigation li:first-child a { + border-top-left-radius: 5px; + border-top-right-radius: 5px; + } + + #navigation li:last-child a { + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; + } +} diff --git a/sources/phpBB/styles/prosilver/theme/en/icon_user_online.gif b/sources/phpBB/styles/prosilver/theme/en/icon_user_online.gif new file mode 100644 index 0000000000000000000000000000000000000000..6b571ffce0d515170d728074029583feeb3f08da GIT binary patch literal 423 zcmV;Y0a*S=Nk%w1VLAXh0J9GOzS!%9$Llq&>k^~uAE)c5(d$>Z>p-#VZNTfC&g)FI z>$BDCkjm?M!|Tf2>i_@%A^8LW000jFEC2ui06G9V000F4(8)<_eK_mQyU$h_eq{NH z=wz;JnzAtIqH)d5qOD{2xZ6F;4;Z8jYenM`mQ*cUD8OMbKwO?H5kMedFa%a5wiId* z01^g4I3`yRhe=?~Zl5S~bb)}77Or+46$S)T23rFSb%8e&2?z;W1OtC)VvHLWTLN button in the style of the form buttons */ +a.button1, a.button1:link, a.button1:visited, a.button1:active, a.button2, a.button2:link, a.button2:visited, a.button2:active { + text-decoration: none; + padding: 2px 8px; + line-height: 250%; + vertical-align: text-bottom; + background-position: 0 1px; +} + +/* 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 { + font-weight: normal; +} + +/* Focus states */ +input.button1:focus, input.button2:focus, input.button3:focus { + outline-style: none; +} + +/* Topic and forum Search */ +.search-box { + float: left; +} + +.search-box .inputbox { + background-image: none; + border-right-width: 0; + border-radius: 4px 0 0 4px; + float: left; + height: 24px; + padding: 3px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.search-box button { + float: left; +} + +.search-box button.search-icon { + border-radius: 0; + font-size: 0; + height: 24px; + margin: 0; + padding: 3px 5px; +} + +.search-box a.button { + border-left-width: 0; + border-radius: 0 4px 4px 0; + font-size: 0; + margin: 0; + padding: 2px 5px 2px 3px; +} + +/* Search box (header) +--------------------------------------------- */ +.search-header { + border-radius: 4px; + display: block; + float: right; + margin-right: 5px; + margin-top: 30px; +} + +.search-header .inputbox { border: 0; } + +.search-header button { + border-top: 0; + border-bottom: 0; +} + +.search-header a.button { + border: 0; + border-left: 1px; + padding: 3px 5px 3px 4px; +} + +input.search { + background-image: none; + background-repeat: no-repeat; + background-position: left 1px; + padding-left: 17px; +} + +.full { width: 95%; } +.medium { width: 50%;} +.narrow { width: 25%;} +.tiny { width: 10%;} diff --git a/sources/phpBB/styles/prosilver/theme/images/alert_close.png b/sources/phpBB/styles/prosilver/theme/images/alert_close.png new file mode 100644 index 0000000000000000000000000000000000000000..79750a013c5db627a14bf3d57edc8f8e3a477046 GIT binary patch literal 2097 zcmaJ?YgAKL7LJ0*E65`_OVRcktP$(m;m=}RWa0BUlnFI$KFgT?|u4kiA3~!|za!^XLV766|9vif#KejaL{7)!6A}_|31pm15rZevXf%TciR7k7xWS211XQ|7 zVaFu}76kJZVmTs~Ndbc*7%e-9FtPed|G0ug{y|m>zi*SiVR$7d#}jb`!`M;+DD?ERrEISR|7J zeqkN}7vzhjhWH(x%cXOqFak>X5QoLY>J@Nev4GC@B#`|*{mC94R5FpsCi<{wRDTMY z!ydg(~-9>ey7ZS}zi<3m!t+ZB3SKgt9WQ7Gdw4$Ft9d~}4j zFW?e{Nv?m9pHdj_97b)G@1|0l9`^7s(F1|DU%OVV^zp?&GlP5Zhxvso<-*BtV`j90+^+Kq+rZ^rVgVBNYDp_VD1tDjYM!MYi*vF#7t(PL0l z)DyZYi6cAnqoAfJ+sj$iJv7vitlLk2akMevXSk}Y?AyJOkta(^u++rfgKD3$rw7cKB`MuM-owP8{DYdB?iOn(y5+F}JX2vgz#XG`}8n#b{t^MpOj~ zg+kWF*_X97H56K5&}Lh+f9sl>d^#RHFta*$?i_(mKY8nxM|XGkwh+v4o5;OgTKnnc z(t&~Y_IBgXf1jGN&Iw?#NDM}n-5HHWV`FJ@v3LC2uj}dxI1;{9<)g_%Ez!i`;!Br| znM`Ij^a@jO_Uv(;ZhyqJ-C%Rg;?5DqCY$?$XqHO_x$=jU7ObcxOv{#IgZ&VT-z={VJW37mK0GC+~Yb-~OSGgC|l zZr!!dj?z>Fuz&h~MEzxs&zgQg<3&zW3AgzLh1+4IKqzYtm@Vp3jR!(7oD}PFIVLjH zzWr@oYYbJz;Z3@9K1=N#x1V{!$2%>0ev*Z*jE<<-YCWq=PgvMqn?3dB6pvt;H{Up{ zd7_DioBR6uGJWm)QpUF(*kVuz0!+ph1Beywao>^UFx1wac`1|_6gs6iqg>D5F;_n_sqUFU+rFJp-wFwhQkVD7JgIw13D@SeKaZ>)ZJd4< z+yAO-gF4Z=JHFzfN8W7Hfby#=Ocj}k59M^l>lQ38kK?L8?&YOrwf8gR`5pnzrJk07 z9h>HqX7}&L$Wx~68AZB`wWs)RGd{E4H?(8tzjDos27za(tedB`w-v2!Ti0L7i8%Kg z{pab)fVr32!GH^D*`%P6vmxhA_uiJxkAp>NlObLf(dO&-mrdKxoIaINP)J#o)3)m4 zP&-o_>eMz2#Z3YgxgTUO}hquind8 z6ZFON6Q7E3^pnjtJ7$l0Z`TYmj0WTG-oDUjK}#HF0P-Ihb32c&Kw&oWB|A*ZcNl)+ N9Ci?^(l_eZe*jUwWY7Qr literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/announce_read.gif b/sources/phpBB/styles/prosilver/theme/images/announce_read.gif new file mode 100644 index 0000000000000000000000000000000000000000..9457870e6fa17727d43a132160be3076b8ea1eb9 GIT binary patch literal 728 zcmV;}0w?`PNk%w1VH*G&0M!5h?ezKW?(xXn?ZU#sc6N63_4bmw+-jc7_4fDj^7N#n zq~YS`b)(Cv$m6rKv*+mSii(P}$Jx`<(`994SCh!U*6QNr>HPfsM~TAe>+Uptyq%q$ z$<*KE=IZeA^QXYq`1tv;&E}GllKT4kI)T3G?C<{m{w;aB?(Xj2-{1ZH{rLI$f`Wo7 zcey@x|x6$YG^!8DX#QOXD=;-L;QGo8+6$9XIFfjl{fw~3M z?E7)eM+^i7BAZYkLWF|>5>`Zxj37q2b5e%+Sb?B)%E}v3fGEv+MW1S`Lda0Df(MTq zDKPUGVY_z>6&FH~Ai|-sj2kOf+yEXUx$_$)PQg$W%!L3MJ}%sd!M%Ho8y5@-AW?}3 zgBKyp7y^Fbf(jL905pJ6KFpX30I;LUzQzU#>Tob{f(r*25JCkFY(at-a71B*e=U%} KgcD!{0RTIW+)Vla literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/announce_read_locked.gif b/sources/phpBB/styles/prosilver/theme/images/announce_read_locked.gif new file mode 100644 index 0000000000000000000000000000000000000000..76ead8a02c04b60f1031ec691ab7a4f00dececc3 GIT binary patch literal 738 zcmV<80v-KFNk%w1VH*G&0M$PL)6>)a{rwOfDD3Up{W?DP5H;^y@B z_w@Dl^78b!xVXR8>gMR{!`bVKii)Vn`ckgvi|O=<4lytJIyHouZ_s zS(eJ<=IikB^Y{1ol9H18`uefW=1q>q@9^Fe(J z`T0hQ#LeLFfsvnHY^h_WS$$=jZ3*g?|`Gc*7H z|NsC0A^8LW002J#EC2ui02=@s000L6z@Kn9yks~fLWz@k5uecCgrLgQXb@U$r6NqC zPu>!O@R`p6gae5HO9`~{%`?E*2aKB!A@W8iE-yX-Bo8?Wh=@54Bmn^zDqln$C4wIq zhlv#)0XBvhA3hfZZ9^qAJ|7PiIjyZW2NW6$ITaW!0U{+s6C4NuJQc#j7&8>d467YH zX&jOS7d{>j9o5#1#}O^p9zG5PKQto>H#`sL=!_o<2`z=_%m^+J85uqc80ilK9|jr` z0H&qGpdi4C3@#-2V8EhbLk}M|L@;3j#0`fI8Ti;Sf`EgCJVJ&HpaDmN0tGg-5Ghh4 zjU*5j4wyNB1Opr)ESxw2fB{Yani?Sx@aV$^iK9n7EC8@G0wJV5qDFl=Vuud}NRi&y zV8KEIcSpM(7;B-xhzu(Nv|zxNtql|r;^JswgRO-FAqN~VkwIL+1#KC$Fc4Qm00Srh z_rS|TuK)-?p!txYV1eZT8$f_K&;URS%RMYK9&kc{kX~h4C|FHWvxXUz6<_J9BZ z2ZWRm;i$!j4>x8Q@OiGU+k=;i3jqe*kU_q@ zj2p;L#4vHUJ1+tv$_#QuKm20tI%>Ngf*=J42fv(QMjE9FAXQWr{6WPEHHZL#1Y4v~ Uf+TJ{@xl=)P{D)~U<3gGJIzN)cK`qY literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/announce_read_locked_mine.gif b/sources/phpBB/styles/prosilver/theme/images/announce_read_locked_mine.gif new file mode 100644 index 0000000000000000000000000000000000000000..2105d21f108f39e1f35041be98fd69de8428db63 GIT binary patch literal 753 zcmVFe$g9Vofe z=;7n%bar^nR&v9`!>p{WEO@*2_xJ4c`SkVohO*f5^7NE9O?j%+xVX5Bi;Jkp$o~EOwsGq{%>g?|`Gc*7H z|NsC0A^8LW002J#EC2ui02=@s000L6z@Kn9bX`U($ZB+P4Si4_aY})tE;U6!QDdbb zwV%%-f=++DWk3>*9wdQ^?_de}Zqi{@!KQrx2!Q|wAts&;B{)I^E0GZh3#q9D9|tp(tsVTDAA#E0zh!-V@8atS3gWB zur$K~tTB3s75me`j$B}`(g4w+0|tRt+di1vfq{VwEDi{$z?bg~02u-k5HN#phX*kM zJUDT|-h=}a`c@F&ATWpn4q`;^ftZKl1Oa}C^8s&y=>s|j40wQ{fB@4yI(P j1~XQ$P=g8qXwXFpD^M^F;fFsMF~S!JQsBggK>z?d>^4k` literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/announce_read_mine.gif b/sources/phpBB/styles/prosilver/theme/images/announce_read_mine.gif new file mode 100644 index 0000000000000000000000000000000000000000..2c88cacca0e10cc12a91767ab704a5c3fa41ece2 GIT binary patch literal 724 zcmV;_0xSJTNk%w1VH*G&0M!5hn3$OT{r%I^)4J2>?CtQa#MpME%qe%d;Ns@T-0g{p ziITb7!^6XPczE>n_VV-eYM#sW_V=Wur0w(huP{!j$m6uMwCCvTWo2dI<>{nRWk-p^ z>Fe(B@$=3(TvwCGGkv_2BR=Kk>dDjJv(4o9_xSqy`Z|HW-{0Wl#LMdJ@9ysI`1$$q z$I;x5p+1Db_0`?^`uh6&`}6enQI5pl!^-E<*ZA=A_we$czuV&D==kI4*I0M&@bdrv z|J&ZYw64>dMEDKI2L2a+8k=;X1$4LN*7*eX?q1e6wHkd+$2ffjS%o@bkH{j1H2Lf zFjzsDt^FA_{w9;3VW7}6&t08yKY z6%uYH;a)#oc7+4wsr*p$!B6`*69&*YVO>6-D-bL|LIM?daRPb%`Des_2b@5I0Z#ZA G1OPkTAWkX( literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/announce_unread.gif b/sources/phpBB/styles/prosilver/theme/images/announce_unread.gif new file mode 100644 index 0000000000000000000000000000000000000000..33e10b2ccceb8af430e80c2e35e885b26a674dc9 GIT binary patch literal 730 zcmV<00ww)NNk%w1VH*G&0M!5h>AJ<~>+aO3we9Zlt6FXA#LeWYxUgk*@$&Tb_V@0~ z)br`<$Xs{0dy3}h?D_8T$99X=x5DD(>H72ah&D;cn4|ps{K|oqzcp6r*W1f}lfpw{ z*v-}C=IYI3eZ);^+`q@bJY1GUSNQn(yoQta_xS$){`&j-;Ns`*-r@fI{rLI$##C_A za*6Qq^ZEMv{{8;n;pX3(tMl~s`}_R;{r#d(W8&lJ*MXMs&)4zN*}*_x!bfHA@bdrv z|J&Z(1rnt5TDSW2J^wm00n@o^$BUB zPtL}pc=*m})uZ6qaKO?KVB$Nu27&wlLGwKT7#C3*EIB?k0}eMajEpx9JvA^2AA&?6 z8#+EE0XHb0C=xC;Gl~HtJ_;CbLmL2_4iY!BvojSG4GA|A4kIuC8$%i%4<-Q;$jJd2 z6wQee9RVf}9+nsiJ}wR&+}#cfA`}NJ-UvPgAwL2P6Ep!1@bQo(GZ`yA@&OhPECLWX zK4!d=H(*4B1_wZB%a;H~3kV+!_&|`SqKgS64u}wO;6%lW<_xe1QDEZ705uw3SZOpM zK%l}2tY8!P5DB3Lj1>sdrk$~XD}fX%W~f!WLdC;%6I3LayF$PL0uX8lSRhwzf*Sk; z{GjG#ofkK?aDpk7p!!ac+l@VP;k&7;OT=0S^!qh#oz9g`aAz0KllRqC|-o zIs|~2@xr$66*W`<;6a1~O%o?ptTdA!<3SjuKaN>pc?=P79P@#Z_ zCF>Xfm^oCVxrG`v&O9&>2o47x9tu3rj%NHC1|P5jM;srta76(IZ1KSk=M7lI5j=$O M0RtL10Y(r2J0i_cNB{r; literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/announce_unread_locked.gif b/sources/phpBB/styles/prosilver/theme/images/announce_unread_locked.gif new file mode 100644 index 0000000000000000000000000000000000000000..76dcc6ca715a0e29111b59b0cd49e5e24b87a038 GIT binary patch literal 745 zcmVkZ ziR;DA!8=>ngqZZ_>gnt5@$&S$eT(Pl?Bl4m`R(v}V`;gmyG@zL4%`1$wu_}II`fOdG`;^+GN`}q0!@bUBN zy~ytG^7;Du+>fH);pY7O{PXnoqEBPUP;BDk==}Nl_xSnk&eq_-$Els5>g?|`Gc*7H z|NsC0A^8LW002J#EC2ui02=@s000L6z@Kn9%r!s*#sJhH5ueZ>j8SVKT8kD!QDeZO zPsj2=@tMy7$^uDw`i9e%#;0Nx9{2)8<)d)CL~l|xBt8KyAvQ6Ki#8!H0Raa!Uqm7U zg(eR+DV-@8ECDkTHV-&H2MldP11&x#5*RkKvojqd5f?TX5+wl~18^W30X!JT$PXVI z%oHIQAv|dyl?(?yEFs$4ArcfL8wo4i5IzeGKP?s-Dm)VJ@DeU28Xqez@jNmV77Gmx zJ}x|nC!v6e6A==eU_tP~g#Zc~)R^D{0-lR3G$b4`B7usF7t2ksz+gc|9w<=;h#=w? zt`aFzmTQsZ8iWEk3%H>0;f4YK8Z;K%%!#vHs**ltxLCTB#RVNe4IE^Gd`Ka$vpypz2x4 z1ONybz#-BK6DCxA$gqGNa1)Qqrmaw02nEXlRIFH`BKq{}kI(K9aJC1W8V3USkfGv* z`SUMSBu7yJg<0=#7;q?KD1eOnk$gPfzT-ChArvgJ00rWmVF(4M5nxqS9z-!k4GJK@ b!2%p?QNsY0fB^*wM|4pJ0~1bw5d;7`f8tL7 literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/announce_unread_locked_mine.gif b/sources/phpBB/styles/prosilver/theme/images/announce_unread_locked_mine.gif new file mode 100644 index 0000000000000000000000000000000000000000..53782fc3dccc219027d15bbe4c36d2787a595b40 GIT binary patch literal 755 zcmV=jyDhtNHo*qKc5}yT<+f{jp_t#YSZ*6Bz96 z@X>OJt6FXD%hcYMr`Us->&4Hyd5H4z^}#$_>Fe&~s<_Nqb@SBQ=jiPD@$>Zc_IhJ! z`0en>m!sn4>4SuX>DSxOWq$D8;pFD(!iJRg_xRPNv6Vqp;G3-6y~Tibc*reM$53qG z;^&DTIPmfF@9^^6kD=e;=JWLS`}_RYw7jBEW8&lJ^5W(E`T6kA*VkBf>g?|`Gc*7H z|NsC0A^8LW002J#EC2ui02=@s000L6z@Kn9)ICCo2_p2+4Si4_aT=Sj9;gDOfLgF7 zj-T%oflhycWrGuq8aR-Q&v1J9aMEG5Ag8?)6oCp7G(I&h2LKiC>KH^2p2vj6gMraEgmlhGZ;6o3!W%uKL`b<7#=sjzcU?V8nYcPC_5{7 zKQSR020R|q)D$29*c>AYH3xSgrau!6J})EZ=pz^$CjbWn=L!QQJ{b=`1r`}JJQ)7} z7+{ph0Ac_PfIMhqumItK9Ssx!Vo*?`MuY%!N7tCEGqbr5UAvf3?vSmIB|eR z$&wO$RIo4s!bl!CaTvw7PTN!gW0Y$A~0ak!C==99|Y+Apu)m~1qKF47(94JfVm7r z445%EFHQvlHay4&O#@*G156w^5W#?n0G4|Qcq||R1aagBXjt7b<$(?+QmEF@;{%VR zDiR2B#%6ZMi<}$G7Jyc7=>!6V=rRzvLFe&~s<^Oa zcJ=1z^7Hle_4nx1*ze8N`t$Y3Tz9y8itotMh%!dUc8lle?D*~Q)wjap<>}qQ$jF$Z z{QUgv!_D2AtCvDonIb>r=IY9Sli1DG?%d$w#mw{6+s|Zv`1tv}hLiXA_}}5?`uqFf z;^+SU{{H;^`1$$AP;Jw4iSY6B+>W97`uhI;{`>p<^Yr%p{r#a%V)*d#;^XM=@bdrv z|J&ZarzS#Vgyg8Gw{e_ z1y4u=(u6Y9QQ$PW_}=i>h2+?gCp!m%XdUc)EHefOga!;ZJ~|)(ASWO?C_^GK4?a0P zAv`Oan>-;64m1S<1vDmmKNbGdVaGJPjoRyb}gP0RycT89c^3v>P81 z4IvC59}8DID^({uHV7Hp+z1X7;Ft_06Fwa#1406oGa>HpAr=N76bdlz1_n?M1wRK7 z5N;r_K(L^N9x8BCRM}vU|4WPgvK>>yt1}z|HU_(ZQ7zunZAjEP8 zgcJ%sd{DrGB})cA5`gKT(k6oc91=(<(~$y(PXssz1Sn9BLB4!FE;wKTK!=VJIG#Sm zIUxy896iE@ozXypRRAu;s>R_$DN2iK!`_ep0KkSoaeFk#8KZ&>8!#9M7K~#-T>uMl z3?2;Qg~@*qUNl$?=O{FnMr;91#!vSm&cggVUcyC{VD$g9aF=PuDQl&zc+9 zr(IM~z+?mq6|rIXxNt%QumLu5z)+!rg@XenAaGz#9Y&59N{Ngh?Scgi7&mfw|4yET z3m*>zjF>X%fejxVSk#zLzXl5qK3+TsK!C~*0s;)+h9x<0U|3R!L=eMz4@zln-?Cj_0=;r6<;o#x!?(XE| z<gwv++S>pB|L^bbA^8LV00000EC2ui00aOS000FupeK4-sVxFUNfH2ba934PwB4Iy kAy$z63IYUzDIOk-hJnN66fV%gBr*9|uh^`1%MAelJFawYMF0Q* literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/bg_header.gif b/sources/phpBB/styles/prosilver/theme/images/bg_header.gif new file mode 100644 index 0000000000000000000000000000000000000000..351de9f46ac2941ac16afc674c99f8ac66767091 GIT binary patch literal 690 zcmZ?wbhEHbWMzn9c*elMRI`(*dIxLMLEh zKjWEtlc{<;@3dQNZAY1^wlS1#6qxr^VD4j{DL1$$UgnwrM3)$=wy`wqWv<`DKkET! z_ZjXmwYqtvo;-I?>Na+vxBquyukctd^7KH^Zjh~o_K|` z=PX<6QMT42jOCjJ<~`w^aYtb86PAX3+>@^{*X|Nr@SL%7EB~BFj1^n>XFp`F+by{8 z1w;8Jp+&D41{qNN$pUtf4u}NB2?P882D7Fn!PZv4j?S)bhu&Vf2@|{~Pnqg5ea1|Q z*|P=a&C^-9kax)v#^uY^R;^-KyVh;P#!Wt3wr-Q!vBPlpZpnT7Tn--OIC4bs_;Hm} zr+)sJYuD^=-n6@OhyVV4`A3f|o<3!H@j~_WYtwh{j6Qxe{_=(O`*)dN zzij{hWn*BRCt(rL?%1p)q;}@ugomx|{JI`fA{HjO%1IcO-Pp0Q!@b|csjbFwl1l4j zb;%VWI~S*Vvl}F?n_*ep;5*x?=$Xxd$?0A5?cF&Vx zD(whe?YJpz>Vc`NyVu7Dc8Km?kaJTx^2u* Gum%8ywf-3Z literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/bg_list.gif b/sources/phpBB/styles/prosilver/theme/images/bg_list.gif new file mode 100644 index 0000000000000000000000000000000000000000..89f8963fde57e8227f4ef1677724e16d1c664151 GIT binary patch literal 664 zcmZ?wbhEHbWMzn9c*elM+I)zqdOLI79=5h)oZV*x7rx}5{gA8wB4^(PrkWkB%?Ej> z-C}Jzz}9+%z2hYB^gA4#rx?pOv$Y)Io_vjO#$ADVPZ`QKGS}?no_K|^Y8z|IVYZgT zJX5Z7_MT&JJH|ij0bAQqrkb5>tw%Y!PVr2=$v@{2*M!T=^?L;7KH=y-!`gU&rD1Q@ zx&H$5pYhGSFSPhIN9Rew1)bABq^oqG| zH)qdTrs^H+9Vgh^k26+mVXoc9Shu6*;Rz@0k=_wVyPdSw6f*>i`N zuU^Z&earmegTm*}O5eWm{`@KQ=a2ON|0WzF919j4Y~~VDn{sf1VskrxsK=Cy#fy%1 zn;T`_*|8|uT~@)l%f@lil7`9Zl`CRS26ddCZjc-|!_v6LcQ$9yvo8lXFF()V(9E^g xam$K}JRTGIB2R5ud08@GA=^x^t*b(1A~t9B9+;{Oh@Lzo32v_NU0?YLfBP#8*Zas)OB8Z_9k5d#ARx%wza z=>e2tDUfva7{_oj$-?HcJVx9hgSbhFFc&H9E3fpX$7>(7UEDvh&tLHU<$E^w44rW~ z1PB4JHNZ2<(D$)5ZJ?t+#nn&L3t0%n+#65R-;7h=0?{7Ub}w_Q1w^_)T(j!vPxeTO z*118)0M%Me6r+|P@6nKV7x^CuX zQ-&8=G5jF6^nGCDlCcNZ@ezvi*RR}9WX=Ja&uPTIYxb_s;iC+Mf59cC>3B?!@+@*A z-YreqD2ddzp4$~9I>lt9osK>3#a3o884dj+9u*g;>*+ROs`Hl#*C0(-L(qLrFmuVS zVVYH%VI9hF%jkxdq#ZGPN5t}))u^Npd+`+Q&U60p$kY~()I|9_F3Z!oZ9Ws}1ht)@ zcW2G{cwq14!mgs+K9uoyX*f2TiPlD0p=fOl(T`cQ9pIjN$U)zvs`khJkhEXrr1qVujHic3oOEQ04DXUe~S$Vw%UU z8I?^h%cISUlU|F)Eo1B}(v9#P$84**^8M{rrdyusnJmNaXf9I+K86lzumX!%n*6KD14j8GPYCv{{j9#k)FT+09XTvuM=KB0R;PjnRH5h z-cd!+@lf}l1r=|JF0J96vvAOWpo;KO?%S#*egb{?K{YJ7#tV*)`H5P~4uX5$R5ThF zie{p}iAfCp@eOOFNPhSPM;rD$r+E2bdc+BK%4T7E=Bm6dC+pL~NlsQ-T@y?k8Oan;R5PZ7=!wyJRGpev1CCXa;T!-8lqHd7LqmYne*wqU8j%11 literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/forum_link.gif b/sources/phpBB/styles/prosilver/theme/images/forum_link.gif new file mode 100644 index 0000000000000000000000000000000000000000..efeaf0a11f3b7f52f574a03f90a3065bd4eef879 GIT binary patch literal 708 zcmV;#0z3UjNk%w1VH*G&0M!5h%G>HmiNW;s_vYy9{r>*;_xR1$;P3GAcB9LUvC>+V z$&2-B=_WAqx`1$AQ?A+<|z0u?;ce?EE@ygWS9B;PK-Raol?$g@g z!q@2~bh!Ha`{n2B*X8l>^7Q!m`d5<1Uzf;IkHlr3&O?X5Xq?Dqn#g0B$KmAY?CtRG z@AB^N@$>ZdAaS?*{QU6o^WWj-0001)nVIqO^!fVw>g@0G^Y!HB>Ly^5Hj2{e>+WV| zX4~H5A^8LW002J#EC2ui02=@s000L6z@Km^G$cwDOtMl+7>H1)fz(kfI3Nayvru$M z&nOWAGfg0bbSzDPOiVC@SeQBi*0FrdqhEUfCn#blBNGIBH;Iahd;}mPf@3Ejh$134 z9+{dRiF_a@azYyz03IR{1qC7vJFTue4FwS*e;6A=DkKm$1p>YztvtfRBEAJT5F{!; z1|1-=zQz&L5yLzY(FF}49R>&_0tGKQGU=NA`1Z> z93t2_K#*V#0l|Fj;31&k0UHrGbbz6ufD9KHF}?`)!p24(FEYB2Q9uKX3K|5oV8N25 zj2t|2$Y7CUhs>5NS_sfkfuaE63pj!beRv=!QK3OC?1a&QLIDdsqDq}gb*fSd72v(F zAfanl8Z;h=ec-jM1Pd?xAy7b2!hp8}eAJjb7p`3i1Qj5-P$5H(9y$UG9!xlJj~p2) zT=~B0RTJRokGz7 literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/forum_read.gif b/sources/phpBB/styles/prosilver/theme/images/forum_read.gif new file mode 100644 index 0000000000000000000000000000000000000000..845618c1a266a23aa575c2f12db1d75830e2c1f9 GIT binary patch literal 662 zcmV;H0%`q6Nk%w1VH*G&0M!5h>hboKy4$_d@kWTj>Fe%RlgH%d z>NI`4$<*Isn#!cY-TM0b_V)Pn_4hl0zWDk1#M$et#oM60*yri&^7Hj=p2^(g?EC!u zEO@$5jl;0Y;qdYE`TF`Pce%^n?RBTp;pFJ#>+!eE;IYl+CUm&=`1!Wb<{@&o;Ns`s z;pTO9b>ZXa;OFj%u+*o(*FS~8@9^^D<>}_=>-6>Z?CtRG@A2yF@A2~V0001)nVDv0 zX4~H5A^8LW002J#EC2ui02=@s000L6z@Kn9tYkV1&Z3hc5TDRrAv7BWR1{U9G2;}X zPsSoa0SwOQ0YH#gFu+od$~@TE@0&B=g!)1YGa_{l4i z6CjHyZ$k?w8xIo@5Ij6Cs4k?d6NM)WLj?%{533M9J-NBIs}BGPekc^RH^s)s$i)y3 z0vtaU2LKZ{7}Xf2KH1tl))+Sv00%M|BNGuj=;`X~>JTXn88Z$k7&P|wJlgs__x2bm z0S?H4up@`Tg9sBM+yTMEf)D~A(7-{lqQ#3AX+RJVf`bVNIdq5|NwOr#91Ry72mlg+ zOPAQRy_|_4M}&YG8eqtAp=VFCT)KMr99k0tJZL3$Ah5x-sne%S5$q@-?gt717?!2k^n w7FMJVv&4f20||9#@X$d5W;g{nNN5nlfd>mQ8c6U0CklZh(_dg%Ixj%$H>gP(dBh@b#*(t3legF1G1aU_W0Y~;q>+Q&(YP>)!0mixcK?`>g@0D@bdEW_51w%UteE>f`U+u!$U+w>+<;6 z+ur&5`tb4dT0g1-0o`MbTrqP*1e^!7i6z>bcOz{14z_4e`d^zQHRnVFepW@Z2Y z0NdW`2Bij}s4|2L6GI0Z92y<79X&j^x3sz%92;Lh3=W_<#Kp$P#Hs}h zKQtFCGBqaCCZj#q*gn)IH8LC*3IYcsA3Eme=;`PmG6Gx*GA1SS^FG-3JoNJ>G7uMX zGIZ=1NU)&6f;wcd0$5^z!-o(_ka$p`;sc2#IxJ(bpu-M{AVX3Nkimn=3;`Yt$ieCY zjSo8>$dtKa1rG$bJcIx-s^@^l5B}Vlh&l5?g9J#Cf*^1W*EJpPoWamRv7*(A0a_5i zVQVIj9x%WGD`0{|g#c)4HfV68Edn1ry!zlHY_e8TMxO@ZpP-f)YE> zW>~SdaRVNsaE)p}1c00u14w4rtdjuXuh&qZNa5qjffxk_p5+|kFWj3q8l)f%Wr~6b zh$&_WvDF6x(H4RmC=Er7iUkn{#N185$J*JZi2Gp>LjVK_6d+(g(X;ysI6{mdQ6d5Z P4G`!-glOSGNDu%!s{lm(^`qKhKY^J)Ze_({r&#i-O} z_V)Pt`uoh?>-F{b>G1aW`S~n)x|*`c#o6oZ^Z5Jx{LatQDR;T~`ug|y`Q_~M@A30c zj>IByw7 z&jMvb0x`~L6R6gT6~I!_qjWae@1}F8(@qWkzoPxdmdy!!E|64(S{2)EU-WfE>Pe?3;-xF HL=XTw3P?}z literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/forum_unread.gif b/sources/phpBB/styles/prosilver/theme/images/forum_unread.gif new file mode 100644 index 0000000000000000000000000000000000000000..1a397cb21697b8e1cf170c79895099c149422eb0 GIT binary patch literal 667 zcmV;M0%ZM1Nk%w1VH*G&0M!5h*_NlqTz2j5@yvjg{r>*x>+ZfaR^;aD_U!NM%hTe* z%gTI_*v-|!Lt?~CY2v%a_4fDNpRfA*`|85X^!4}6Zie{z`N?;U=jrV7^YzPPedV^o z@bUA&JY4JH=G?Bj+^Dwc-s9A^!o^Z=@8;>@g@0F^7Oqt zTif2_A^8LW002J#EC2ui02=@s000L6z@Kn96kP(1P9ty;5uecCz%Uv_PLmU$;^+*b zPewzNKoHJo0%D?RFu>Bz$xLY3@2xXpWB5WBBMEgg5-f&?ED|#j8HvRo7 z;sU1d*DnK%2qWac=&_@r!-o(b_JA?Vzyt_3bZFeju_H$t5GEMt@BqRN9w<|)T&Z#g z1QQKLM4+&vfK8j=#NFIkU#6Xm2uU{#OD(%_h9*q$sdKADxwW`&tR15SV zq3(wP1sQnYI6yXMKow*U;NX$rfi)=sJoLbDqpsb%cro2FxDq2!pR2bR4L$qOxVnH4fcjX;UoA0Ct!jA06RN% BL<|4` literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/forum_unread_locked.gif b/sources/phpBB/styles/prosilver/theme/images/forum_unread_locked.gif new file mode 100644 index 0000000000000000000000000000000000000000..34f1d46ad76d7826d739a5bbb7d772e1d2bb488c GIT binary patch literal 677 zcmV;W0$Tk?Nk%w1VH*G&0M$PLs5Mc@OKIrp?fLoo)79A3tGMO4#KgwR*qf{4=IK>c zRqt+%h=_>h!p!UK@OgQ8#awp%{{GK^mgeZ|)V09%>+bB!)8XUiMMXu}&DHhx_uAdy z^!4}4V||sCmC1LF^7Hl1(bmgE`o6flXR z&&;f2p+(MU7p>8mWx!IC!R)Hr>t~w58x^4}5iT!-goSkj7ARjtHZy>N1Cf%G121(J zJ8wfX29Pl^EiD0~0iULoF$Ob3A{`YkF&eTv3$?Yeva&HR6&;H^7O*(O#5l6W#k&nA zKLsci127=dAfY?g*e%o`Fas4R1s@Uv969Fa=;`PhF(V(~134`7^DWr-3-t3KF$fTH zF>>e_NU)&6f;m#n*wH`(3kMJ*N^~GVz=Vqx9k9^QV22zHIwnf2m_WsblPVGjZ~#LU z3Irf4%Cv@U1A!Voa^`fv0Rf7_4>+En0S-V64y zseQ|qX-)=2GMH#U!olGSdI=op+f`|a5)6Di5fPxlzzLX5@@?#af$ImNNADFe&}<>}?s z+p@E^r&MXjTzA*i+ULQ`sF*BE?(gyD=42)e9@tkduro!U zm(T`tlE@@x^Xah(UB1!}plp`e@8=WX;Dwq{7-lg9goTAMb{HsqLn$GFgNBlaG8hMM zLm>b%geodNJ^`Wuo}~nX03kyr8z(U;8nHVtw6w6Xu_`eF8+`{DuROxT#Kpq843|;)L99%Wz-NRA5D9z=B}zk#5j#>yX)uCB1-c1Z z+`s{0#|Q#FX4UGUfkp!ZLIMovK!NTG5keX4V8Mez#ezL(Oei4a0z?uz=(c2hz`_h2 z)U5RoaCudL2LUT6#<5_>01!IJChTG15|JqbMoe5$;%oy8V#y*P!D7M$C>H`W0AQg4 zbsQ)rC?G+C0=yA>9DFgcBfx3{1~P;Q@j`+B0Tb+i2^;_%5yB23Fu*_v2kdY_2p-5M HL=XTwA2m*W literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/gradient.gif b/sources/phpBB/styles/prosilver/theme/images/gradient.gif new file mode 100644 index 0000000000000000000000000000000000000000..21dc11f13b1545706dfeaa4dd2b09a308b072ac7 GIT binary patch literal 549 zcmV+=0^0pYNk%w1VFduk0M!5hhk05 z^xNm~>GAf};_c<`^xNj|=kWIE@%HKQ_u=dE-|6w??)Ba1@#OCG*5d8i+{#-?(6dR>+|>L@Acs8^5gCE-sth%=+|C5^X>Hb*W>Nn z=kVU?@zvt&?DP2A=I_?y?e6vY*yQf!@AcB)>+16N)8OmW;p_ka000000000000000 z00000A^8LV00000EC2ui00jWY000L6K$~z#EE=S@^tu&)0kYfPplFgoTEOh=V7Kivo_1kdcuYl$Dko zn3w-q@|_{sHv)}Ev>Gvu(7Wtw6qAfxVgF(yuH38z`!oU#Kp$P#T3fR z%*_eU(9zNa)YaD4*CN{6+!Nm4;NczPb8pFo2O75bs5(W4-eDqR|&sne%Wp~9F-wW`&tRSjs} n%C&3P6=1`P9ZOd1fwO4Ss#U9@t=qRV;>w*%x31l|K>z?d!+=+H literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_acp.gif b/sources/phpBB/styles/prosilver/theme/images/icon_acp.gif new file mode 100644 index 0000000000000000000000000000000000000000..3afa98ee8fff4783ccb1619138cdc4e5d842c0ed GIT binary patch literal 389 zcmZ?wbhEHb6kyQRZrGka~ zb&F>1yz){axi@9Tj+y(e2lcEwdH++!?A;L)HmyAQ;KGw{3{(Y*KUo+V7*rW_K&FEH z#K5-bz@!3;9sxZT-oO);1})-^2Lvj(>_t5k7cla&h&U@6YWfOwur_!JGH@_DZ2h9a z@b1TZ#tjWqELgIbSeSWvnT7aRnYl{J82AKB%lRbvdsQX*@)$*>nb z{^;3DK%osg_C9<2@%H2APv3l4y?Mvo2ancl+4=wf|CJlJz5Du;0XICMAjY5r zQUbD*fz@+CswH=jVvlmv`H;Quzw|JzInX40fZ6mw<1uZg1p-Rz*)}CDu;6u8RCu^V lg<Do>+gcbHtO1Z@Tm=9C literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_bookmark.gif b/sources/phpBB/styles/prosilver/theme/images/icon_bookmark.gif new file mode 100644 index 0000000000000000000000000000000000000000..2644293f7dee5ddb7b0b81562a3ef1d4b8eb9f4f GIT binary patch literal 218 zcmV<0044uNNk%w1VGsZg0K^{vE_}}a|Nk;;rrq7$nz`8S;pFl0@#5m*!j+)y?d{*+ z-?hx*62*95b^hN#wV} z_VDq^RdJ0vPRiWtA^8LW0018VEC2ui01yBU000G7;3tk`NfJP+0)+Vi!*C=@EV%Gd zAjUD=CV-)Ekpv0>U@20_JS-4T5@)D%G?TzIm_Rr-l*YCMP;eLlj8;j41r~tC8W%u) U1cY(hF2b`%EF}VeE`=cgJDT-mF8}}l literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_bump.gif b/sources/phpBB/styles/prosilver/theme/images/icon_bump.gif new file mode 100644 index 0000000000000000000000000000000000000000..014cd9bd1513f818426238b66e0547b0b6e273dc GIT binary patch literal 148 zcmZ?wbhEHb6ky#m4PIOH p)|@br?lU%!s4$N&4D){0cjBRYp~h6dd7b{%CrdU(N3bwh0|16~9k_kmG z{`96gLc#{UO5v)gX_#~JPU`9X3SONtYh1B2ne|NrGz^A=xw zZ^#_9`%G!b563@~!{61g1kKZI)H^=$DkF=4AM*s>#-h6ov-}sXX5=tni27}MGN#ju Q6X+`jPgg&ebxsLQ0QSyyp8x;= literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_delete_cookies.gif b/sources/phpBB/styles/prosilver/theme/images/icon_delete_cookies.gif new file mode 100644 index 0000000000000000000000000000000000000000..f7665ebff815efd2a9a2ff18422e40c056c88580 GIT binary patch literal 108 zcmZ?wbhEHb6ky#M_N~b}yMg!NR-fk*{2B_gax5mRC^9lw F0{}O=ClUYv literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_download.gif b/sources/phpBB/styles/prosilver/theme/images/icon_download.gif new file mode 100644 index 0000000000000000000000000000000000000000..70cd61caf2dbe1af64969b183e7ce9c31a37ba15 GIT binary patch literal 198 zcmZ?wbhEHbz6NIK7IQ1_U+qe&z{}8ckk}qyEks!c=P!?ST_Me@h1x-1A{Pw4oDryP6k%z2PV8u znOw~pT#m2VnyfYk#vV4(ers(vjj4=f)A4IGvN14{@6k}C!Z5^w?(og)bk3Id!V F06RZWY-j)g literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_home.gif b/sources/phpBB/styles/prosilver/theme/images/icon_home.gif new file mode 100644 index 0000000000000000000000000000000000000000..8ae9004534d5f4244ae54be08d0a64c62f928325 GIT binary patch literal 306 zcmZ?wbhEHbC>k_fBt;<@ZsCHZ(qNDee>qcj~_o?ym;~U?c49)zyJLC z^WMFCpFe+o`0(MCD_35c%6~9&4aAPkhI8jp}T#j!i9x} z+}qZLtJ44f|H|C!A^8LW0018VEC2ui01yBU000G8;3tk`X#!lga3<*l>BccdOH^LW zc}7h}h=<41*$g280O^t$5{<)wfTUY8_&SS`tBWT{xw`pwszCmNXTi6Jj8= VUIPkdKx>Hr0uvJ!euX6=06Qy~X43!w literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_mark.gif b/sources/phpBB/styles/prosilver/theme/images/icon_mark.gif new file mode 100644 index 0000000000000000000000000000000000000000..1a33fc3264ae3ea5d1b65c7220790f929d357f50 GIT binary patch literal 360 zcmZ?wbhEHbJt7h50 z={wIXJAC>1rymSu8~JNCi#BYPXx<^&yi=}imt6BU#g5&^6A!vi+@87aV$Oz3rCYD2 zOy5+u>qgt|Yx7S(T6pHsu?O#t-F6&PvqGQo}X~C5TIvl<%&H^vWSbLg1 zb|h4sXAEX_(kj^T;>**I9U4-FmVX;Pr|i;{R%cW$E|GI*X4DYj7vmGEmS^^;S8NlW z#Hi|7!Kfu!%`YFz>y;lTTe5_aNya-hT}mO2hueuIsvs_bBVvbtU~p)-kCUsrr?;~s GgEatzZ-_+z literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_mcp.gif b/sources/phpBB/styles/prosilver/theme/images/icon_mcp.gif new file mode 100644 index 0000000000000000000000000000000000000000..80de2e53f7a2e5cd86de2eecb7b9570661c0d6b8 GIT binary patch literal 342 zcmZ?wbhEHb6kysz_^;qy0!C9~tZmY=?MKX&q#KY#vw z`uzF*`}h0L-SnxO@7%cb+Wlu%RSOm!xxM@9Dw{s5Mc=qhs+qZ8YKYpy3IVrAl+3WY8?>&9h zy?oD;Cr@tPx}}*vEpyK9uI0NcXKj4>^5x?vPj272bMxlS`;VVrc=C+_2T=UU!pOj2 z&Y%O52lP*8w@wKGtHPl2CFNLf|H|C!A^8LW0018VEC2ui01yBU000Gr;3s|&ML8ehNMmaONg`ARz*t2a z0bcJx4o)XxX*Cc&PhcTb7!V^$BDrinM-HA3A`re>pH~dBU>r0HL2F=;WH1LqK}awh zM3)EBmv}TcMIT&AJpvjX3UwcO0fZh24IKm;PZA7{Jq8a34J-!>5eSVK2?r1l6JQ4d O4GWtU3=pX;Apko~i)nKJ literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_notification.gif b/sources/phpBB/styles/prosilver/theme/images/icon_notification.gif new file mode 100644 index 0000000000000000000000000000000000000000..11092f4dceb3ddac154bc6d27159efb78d6a437e GIT binary patch literal 551 zcmZ?wbhEHb6ky;7K4Xh_>oVWAWh)L|c>DIPTJ98|=0$;BE2r-~v+}^1y5;+( z?Kr*n{H+;Vj?^sMr+juc;A|H_nzBS&p&wSj#ull?p3=(JC=U_{Q2L%f4_hK{`2S0e=uMe3PABE3nK%A z2ZIjCv7k6%U~g&gXlfQ?)v;{u>{QhfaI_KX>g01WWntkJ6q)3qq$cC+>gue_Z#&6= z)7j0%WwEg2BvCV0_igLU878swxNY0!Cbz3gR)61qH|E2g4tmEAoa)kLHFnwW?q;vj vX<{wzdTqapvxcHV6FZwalZB=gmoy`jJR9R232qMUIbBjlc7`gfObpflkrlpG literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_offline.gif b/sources/phpBB/styles/prosilver/theme/images/icon_offline.gif new file mode 100644 index 0000000000000000000000000000000000000000..5dc4212e9fb77a3cc786423aff56e74adf20d00d GIT binary patch literal 322 zcmZ?wbhEHb0t+TYO%FO?Ak4xy;bKFn0540!^&=klT6(mYBm*W`^lWZfPjE#xcj)cxMZ>MtgNhEmBm|^$)BH}c6N4m!T)2f?N^Mr zfW`k>caP7{&t!v~U#R7e%>Rwb{npmjhRFYm!ts87ers!MkB^UMwfC09?4zTjf}y%* zsNh~+UVOs*hrH=|!vAQu`dD*``T6-^s_2=r$Dg*!dU|?rwC&8y%x#aYaFeiQvGR4m z|M2keA^8LW002J#EC2ui01E&M000JPz~9di02l)f;g1j)F)kEcfbbIp7B`g$#<~my z0FNz1;=~%fg>hBlWEzP`3t}w1d^N>)Yy0Rlon06Q-Cq-+2H literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_pages.gif b/sources/phpBB/styles/prosilver/theme/images/icon_pages.gif new file mode 100644 index 0000000000000000000000000000000000000000..20b2fe9f81188990aa2c46a12592e41c8d1e56a2 GIT binary patch literal 105 zcmZ?wbhEHbU1BV4(Pug^_`QjX?**1F2 literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_pm.gif b/sources/phpBB/styles/prosilver/theme/images/icon_pm.gif new file mode 100644 index 0000000000000000000000000000000000000000..103421a26fad88883a29117380670edbe7b28094 GIT binary patch literal 576 zcmZ?wbhEHb6kyn>lu9MiYy@rzeBd6N&HyY%b#pX$YXT`J~& z`1JYD-@k{>Ui|s%*NZnF7H&SgX!C*BZ{EHC{Pq5`*Y7@kX_>M7(TkU-uikk3@$0L% zAI{&nf9}S^`5X2=ef9ds&)+96U;pvr=eHlfj58-Zc>3bkpFbYei#%!o=2@@BZ-l>)$_rkDR~!@$;8I|Ngyt^Zxy( zPwV%d@~dBR|LOBruiyXp^?U1~lNzyh@jnCM z5YC_jvL6&D4D53o!kd~~THD%NI77R8dV4s-S;8hynL33foQc6`+EhOVrf>sG5gDFo z9QIoBcH!PUCKlSxQ}_h}h20Iq)xtO=WyNg6Ow9yERm0T7xhCuSd)Zh!nQJ&s<_c#F zb7L3Rln&5QV&(M=V+?2Gb7c+V_VAVBwvuC4WD7Tz@Nv-(Vqo-Qa9}#pq3y6jBj!ZG V!ftKmWgc@p3LiCSH!?6-0|3dy{xSdn literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_post_target.gif b/sources/phpBB/styles/prosilver/theme/images/icon_post_target.gif new file mode 100644 index 0000000000000000000000000000000000000000..a2bc2a2c4755690afcb6ce9ede9d80a966f58ac0 GIT binary patch literal 124 zcmZ?wbhEHb+Ab}ZrT5Ei(kR!3`junCkrD30}F!=NDQQwfmzOj<;*W_ g5B5f$wf7Vno;fXVJ@mjf%wk69&P^GU1vwe40j6vhn*aa+ literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_print.gif b/sources/phpBB/styles/prosilver/theme/images/icon_print.gif new file mode 100644 index 0000000000000000000000000000000000000000..e464e304ea03cc82f159ad64ea9eeeda9e5f49be GIT binary patch literal 204 zcmZ?wbhEHbf%moH!5y?giM$&(EY4M5Yt zra}qDpDc_F4AKlbAU?=W23F4pYJDl0^D=e`=0wkNQ8>-gbGO{r$@{hbgo{Z=+J0in xhf+_byb7Dy+#gzLq|wE}ce%pAO^EGa%Cf)p92WYXB?J|NsBHFW#Mc@Y%R*Zpw@u@);AiUVJW@(tG^g$C{PLPTqRr z+_>z@qgUOV&o!++c=pkk{CPV0ku_pSN;_wR{YPpqpK zPThS)I(WM73Wzza5Zaul-)D5@hDSs^G`7nTR202w_CzM;WUG$Znug0Wd;parY<&FM-hE< YVMaxnyWMQ!&T<{9 literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_rate_bad.gif b/sources/phpBB/styles/prosilver/theme/images/icon_rate_bad.gif new file mode 100644 index 0000000000000000000000000000000000000000..790188940877c1c9cc92c67b41b0ca989588e711 GIT binary patch literal 465 zcmV;?0WSVWNk%w1VH5x;0M!5h1_1)*dz9;dncIPu&xV)2jhM2Wp(_Ck9svmAV1N2@ zlJa$v)MkPBdYJEblpqik>v@#oeU-&-gZPc7-+z|gVU@kB5FC`^9O+z{+BqpAvKRGHSTC6`eDI_?uKQ$(|xV*T(z`?@6GBh7F9!xXG z6$;J`2ul;r&Ivv~A<_v83l8280zOI;-w+TC2iHm$3;_WV5fl^y7UD=3@bd!_AwDDP z0|HvWfPp{;4fc+J@KG>>4*=J)DFLvdV!|dq3KZb*kChJ&9HPlW(7`}QRu4p6EVXjj Hk01a$`g+4M literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_rate_good.gif b/sources/phpBB/styles/prosilver/theme/images/icon_rate_good.gif new file mode 100644 index 0000000000000000000000000000000000000000..6d23034d71c11a1266960200abe623da0a7e37b1 GIT binary patch literal 462 zcmV;<0WtnZNk%w1VH5x;0M!5hX=-fA%FHe?H30<*Q(R{O5+wl*8h5htfxG#Iy7P^= z=99MEn6=fKwbG=s!@R`J0R#tSrRaUT{cWS$fV1g`x$bwN&5F6|o5%H!xZ{ww;E%Q4 zmA2WW#O9r}%&f!OY;bg(s<*ht(?&>1dV72O`}_Cz_wn)Z?d|R9>FMR=<>27p-rnBa z+}zmM*wob2iHV7BZf9}w>-7(cq%)COm-9v;V61T`KF4LkxfGb2nN3=A9`3kw<<8`nl3=^E=613vCX9To}-7Z(*3 z2`Jnn(xKnK1QQC_V}fBqf&>U6N;oi(2nLA~BG?-c#Ya5}ASW{8Vh@5xUMN$l{1F5I EJK2rEx&QzG literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_register.gif b/sources/phpBB/styles/prosilver/theme/images/icon_register.gif new file mode 100644 index 0000000000000000000000000000000000000000..9ecf126c4f04b813850d8db04112aaf01d32bf86 GIT binary patch literal 231 zcmVi_@%A^8LW0015UEC2ui01yBU000GKpeK%GX_mj=LD8Lzb0343wfYc~Oi!1=cVPrDVuO~syItZDACAst{ hvK#)#b$4=*ZjZ*4*G|nYV78x^kescB8+<(b*Vd zjT&T*9A=LqY?diA!(2-aFi@>lRbKwO^T^;oU_5p(7?*i%+}lG@ATl}`uX|!_xJbp_4V`f^YQWV?Ck98>+9<3>gVU@<>lq$5In8Cg?6vQ}K;AF0rOQvExA*NdF6|i_@% literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_sendemail.gif b/sources/phpBB/styles/prosilver/theme/images/icon_sendemail.gif new file mode 100644 index 0000000000000000000000000000000000000000..92a39c8af918c93126bbabcb02c42102ccae86c5 GIT binary patch literal 303 zcmZ?wbhEHbOOq36UirWD5r8>9SZ g#~OEN7|1d)7l9smFU literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_subscribe.gif b/sources/phpBB/styles/prosilver/theme/images/icon_subscribe.gif new file mode 100644 index 0000000000000000000000000000000000000000..5ca18af80aec21b021bf355d98d3319a3c62838c GIT binary patch literal 216 zcmZ?wbhEHb6kyV8>dAmZISC`J-J$>_Ov;6tIfn7P%b_oV|w=F+BWy|@L{>@&M z3s2p7%>V<6KUo+V7-Sf9Kms5;8CXLV)caC0=ZU$BIlkWJKXoEwqOe09Pe9~t%Z9WC z96uT?&m=G#T;k|Dc*r0@fuSimdBP3fqDU!*Ldk;Whk**}hSnGM$(RZqIab`gtM;kT NkN>RdO)82E)&S0UST_Iw literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_team.gif b/sources/phpBB/styles/prosilver/theme/images/icon_team.gif new file mode 100644 index 0000000000000000000000000000000000000000..613158257b40323dc781440710a06da689ac23d7 GIT binary patch literal 1009 zcmZ?wbhEHb6kyBA(WwWYw_bd1Q8DMrqgOra56NdtluGH-%%8gF+N*{&Cw~9_ef<0t ztEzb+z3V@J|2cQpsrac|^Ji^3e(z)J`qPJRzyJFEhh6QWzKuusUVCj^Hs|GsFMH12 zc=+PYvVEryUcTGDVpqe;{lyD+eg5+0&b|AO-+YYdUERL%j6%jlpZ3*DcOP?WUS7Iz z*SuY)3g+!do3_!Yc&2n}-~JnKgF2Rf{qZYf_HLcR>6vqOTURfQUy!ia%uT@L;7BAQp-nT|EYtpIvpJr`8rjj$IX63P|+fU1+_OCj0 ze#*v!3wEF0ars5{vVGTY->qMH;NaDVNmJGv7SG605aB$}@MLtvdB^%b8o39=ue`nLKOv*%P;(n3m7J@Z=lAD4=f$DE?$&WMF7v&;eNs z$`cG6=NLFSdoC|<=oNA^n4|H-Wr2f*ch!%MA{VB~tV!QOUMLH2Ocb>iVUXZFaG-@D z+Kyw-r=$anEGmo~9RdqD7YMevyeQzD{NxOS5l4%H%TYIOew(COJ`7Dg2h4LaR&X#q z?q@OJKC?kW**#&R3G)^KjwS9Ka@;XYI~*4;JFOsOSl7~dQr(-0U9auJ!AS>Orq56o z4JllZ$jfZ)rFDjZ$6>-`eG875galWvWQKH&DLVrl6k2$5pDl5?ld-m*^GG)r6dk=T+-1+$N;~O__ zeE$6T>({RnCrVB`}y-{MMXt#Z||#D zuYUaaF>BVWnKNgeIdi6}s_M;~H(R!BdGzSf>eZ|J`}=q8+BJLj?B~y)U%h(u>C>mz zu3cNZcJ1=z%g>%Y`|H=Q^78WkV8B2$Q2fcl$iQI8paaqY@)HAF&Vd;P9y&s?9cQ{j z7$jQzjybbBZ{%5*p24DYU?2aH$w`V9`&v#N;5fKMOm9ZE;x8L^UCzgcE>v7|V^!ng zROjT9(f4OylVufDWz?7Ma$^wY)o0V!*4LZr@2tl3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|81#=KlDb#X~hD#E>34K5C;EJ)Q4 zN-fSWElLJPT$(b-ssbzLqSVBa{GyQj{2W*)24v)y2=9ZF3nBND}m`vLFhHZsTY(KatnYqyQCInmZhe+73JqDfW2&$iQ6s4IL(9V zO~LIJ6P$YWfsWA!MJ!T8!-RmT2gHOYTObFX@Kf`Esl5o8tao{eq%$xuYI?djhE&{| zb7{Z!(LjmgAFK5*stQfc^K@IyQ*_$?gRIN-j2*j}H%g>@P`+z4Bj-t4pwX=}lXOy& zgf9E4*{cV|zc2o6^VMRe&DT}G=Ty)8Jm*bnd*rR5XENMDB zWc?LsVVz$an$4a**H|PS9hD>AtNSeG;Wq86Ln7~{lrKEqWfZ0A(*AG5jKi~cl`V?B z8}%`>_3x`a9gMZNH;QTO?hEBfG$}dv^0@7~Ex&?F8WPR7&p6JZ_Ex$(?~>G~z=!O8 zF>zZDh4b!F4s4GPZ!5LY_`mIt^PERK%@WR>duLfJj?H-_#9n4$ZuQJXN2vGuou~DQ zckVwvCBJ?ZEBD14c5<~3Ti?Ar%6UH5`McPs>@~;u6^^VqV%Rvj;)8nwBg4bxHh#xh R+HQaf5>Hn@mvv4FO#no9rK$h` literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_topic_latest.gif b/sources/phpBB/styles/prosilver/theme/images/icon_topic_latest.gif new file mode 100644 index 0000000000000000000000000000000000000000..815b26927a6ee77ec6b43c5ee3900e6ce24b8897 GIT binary patch literal 124 zcmZ?wbhEHb-+!z|DQj9{`>du*s)_@zkYr4+Ab}Zke&M@&9m(U%}?bjvZqF1I3>#j0_BH3_2hlNG$`i qQU=?dUkVo3ikxA4v9?_hZpLh&aH zBLf2`gAPa(WCjC^s=>*Wj+qt{=RQ}P`$g5gFd=#2qB&W!qF%3i8FOTT^_z|d%DWv| G7_0&8Whh$! literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icon_topic_reported.gif b/sources/phpBB/styles/prosilver/theme/images/icon_topic_reported.gif new file mode 100644 index 0000000000000000000000000000000000000000..006b1e2291a6bbcdcd87161f4bbb41b5384b102e GIT binary patch literal 246 zcmVeSulxXa!D|Nq?S^m(b%QIN=`zt*bB zAYetR4NJjr(P{}7Pr;KYvMvd;cA;P~ zCf$HWt`#^|0|5mR83cS}kd8EC<*5Sq3>1mm@J9?f%f1`1dvnFV(VU@J+^!Lcy>fh<_ZJoKk)8F0Q-F&Rv zE_}}W`}_a@|H|C!A^8LW0018VEC2ui01yBU000Gh;3s}b6eVMtQqM3Hl%tNx_RfliP+l7G+hoM&h5%-)%~bMJfKbMBdY^%#bMGSU%M#BEDaZ^6Gz-n@Ck z{&w%)z1+iJzI<7aerwdIp-t9i`}gmk5Ed3T!ra{a>cD{mPqk^&W(TI{SM;9OtXX4( zKPOQg${f0e+HdmY$ypz%IPFj+X=!O=>esLDkJ~@|1=nzms!E!3=ZaD3erA8* z^5~PDoqdKjYS*sa7k|!HATJA4OVk9^M4^B7^71mqpZTcY=;`S-#I`QOZK{upeSLj% zD*B)kCQPuAE8iLG*ROvf@c(o_fd6Y!Hcgq(xq1pfYv}m#<3nh}&CPA$kRe0-a5Ghl zXX3$69{3cc3C&NLXq;z$em<;RxsrYGPd@piB>n#V`|R)Z>C^QL3=D)mZ!^@VbdLyJ z;)f3({#37Cy?x`xjaxujS4L}409@JtRvoTU+i{Kh9G5aX8yjW7#b4KjyT*PFSj1|s>71UPe)f+){s2cuN3gZE^-%*vzWes=n;9G&41Ruo zU}|b=#np|n;>X>OBB==Y1}|B%#J#Af2WeSF*kW&Q zABt%)0s-qn=gyrwphAllEkG)j!i^g@ASx>ACLZgl4R9f-P`<-C@EeYu`)us2=+IZG zsj1O#-@cuQ+v^ZqvNQp$R;^kA*54*&)07FFTb0|c%l*FO4^m?`Gc)6N4Y_lYga8aS z*pQ7IH-5>1N!c_I09+;iRd#~hb<_$E)bxzKdiO1LjDSl4kgF4`-+%x8f1^i_{tdUE z4<0=D`l3aPV(|rb$9?n40xf)DIS5<>aPv576)gaZ%2Bd=_ih4Jm^*haaGY(#Q$@+Y~uxkT5hR;KO2 zfz$vkO+raPK!Eu0;lt3labupHPJi_1k@woQYfCD(24asoF)%Q241oy(9?OEh{q|en zdfl=V-yl{;I&&%F3#oR>UmK$;p|AAPz=GMyyhqBIwLh(ymlVI|M(sd-v`QL@)kG?ur!L6)RwT^XAP@@dvTDuv)rw>8htspLWNB z%lYoR?=A?TsB&OZ3UsiseW|AMm8-aN>0L4i5gKZ3gM>PD>KI|~*sEW^eo+Fe1EqXgw9g-RcX!tlkYxfn-LcV7Id#V#-T*5I)wU|P zZrz$ez1x5O^B<^8;L--Pu3o*$_O!?dN&pB=5D|7*tU03rSeFAV*4F6M2|PVLsX=t* z{A>!_Qvd$_TVcoG!gmg2#vx!q8Q)r2i6mA?=W?cvGC&P`=bs@VApu&q zZf&OmU=Qqom6vSM?wsjR>|JiwEFM`y zgpG~O<(4g5MhFEgo)J|5uoRk@e16(6E@Y1|d-iOWS@8{sWXO;qEQrx@1T7(1=F=!4 zYB<+}RV9XnmDmfntD^}thoBS1&15KwcIvUQEtwi4v!{ zBkEX1fF%}-)d3dUmW~`b;v!$(GMS7_Me=b;)YOa2TD5AK;5}!8>d`|x>}biH;{CCz z*t}AomOvj@FWxL9p#cM4wr$%6Uw-)|YbIhj%|p;3U_P(x{qXDx1sXPNSPHPPQ<#sW z;+_BtWk+OW+EFn}qVY+O!rq zzyi*fC3FO_qY@JnVq#*nVqDboAjl{+9kq~r&f(6sN;G?9#A>8csTWdpdEg>YE9AgG z0V*LJLWm#}WLXO_00b>NKAjo~`KFSSlkKqLiOMvNaaiF45p+OHz+!z`{+ z%t9KSb8~ZJ6Y-t1%#aw#vuDp(zunxqb0sQ3OX}$8xCP69A`ez1$dpnG3JT27qWMyTQL!&v^gV@}=cW*pa==k>S+vjQv zT0G+-fZ;{RXrBt7n5ZHTFW>9)B5y8MP@;)h5m52Kh17o*R+LQa`SQsJR+({JnlwCY zP~J4qKt1{ApMTDpR0tj(1Yl`tX<%<}PY(Li3VL%d^3OOpH~{%rh@A-ltWrKL>gDnM z(KQ}YgGW=G{A;R!L2}~62??2eefsoqL90NSugV3>*@QZZu3ftlJE3d5t0>b#U;`B_ z%Mn4~E9~rxE2*e_btC{H;6js+0N)eKEkKEXE9RSTzS$fS5<(z1QJ!I;*=T>}%$bD< z@a@n9OC3CT@NRW&2f-*8>sn8$bEv~GsVT>LT9R*Y(V|5xv(^;2@cmOg-GS|R0u+zl z8Y3v}nKWtAdJ6AA@s^8ioPqCnM`if56frLzv_y!S6OlSvk@p_~Dgf>2_RLaeFTPM*a{A412dLXrcWm;`~n0Kk&>X+1$LiPLg& za=L}e$7v~Rgd#F&$k9)xpNfu3N~R03NCL*t&`=k=S9-4H6=YhfSXMZ)nAPjnt)qO@ z1@;y210SkmQ-EUbbx6&&bf7`9ZR#O`EPG zfYZ`HTmoEOx^#qw4K091kjIZ7ucw9u(boo{6zZVni;*m}(z?x=Gbc+Ot125@s)@)) z#J3;-NKH+(Ff%iw;6?Jx&hWdThYi0M^ev`iVQ8Ujkf5jvN_fVPO&D>guYsdH8n_9=Mc!d#KE8)PdFq1THB4VxNyh{wN_2I{C+o z31|MMfxsB3e~aiqOD8(fi4L@Mq7$9yL~vG^k3SPi@rVp7`mO!=%qLLRam$&L++iJA#?1kpp)u z2-MGMFVpK+e0k<1%|FU^@Fi)=gw9pOv?O}{7X#_(n+g1!-r5L(AH)5sN)wu&GSxUw z`U2l<*f}P#^+Yfq<6EM%Pw8}A3;7Q9l&h`ihsC4&!IDdFA@JN|N*7l~D?m`9NwE5% zM*PhHi)M=0l$4&6sO5XrM4Y)stI2%pGz-M33e>ZTN}v3!>jlrTJ--pE8xZj#{M;JoR0J8Ha@t%#|lE zOO*C0osJ8*H`0mQPT!{M|A^YE2)TF3!Ey-M3!6D+3hW}md{rfd$#>Oj5`m1~f0j$)+O$&%%7VU@>k{_vYPTm{Y*ItKY;I>)T zXZk6b^*1|Z;CVoXSRu2Xc}-?LGK4)gVa*j8p1(&;ell-ydN<6yw=14r5+E7`=cDTQVGVDoNB+I$F(OkJc&y%F6nXa-Q-5T2*8-%5*A z)hR_Pux`rB!o(9{?geLVz=LCFNogj@g<9m}gY0V7!au^X_B4P;g+}1ICKevcGG=MW zxQ2yXN`Mir)=;ggK2)#z-k{2U{T7Bfw}b=2h-2yq5x04=N`ovB4k&WST6D@%en6LJyon~ z@dg7AU-1Y&eGN=Z>VZekw(3?wDJ}28q!j2d>m7K1nWo~;9GP0GB5}Z{mGGc+Ej$VI zN40%#YvI1R+;IUC?9ua+`I8SmhsoO_0bV`@sBaCjd;u>i#RK2FA`LNS2kNy4T$jy=Y;B3u+bGHuAy_G36 zF=a8j+`<-*k6(}^uiXg=uU`TISEoV!U7jrtfHd4cKFb$|__5RDD4KFvTED3Uw5U-V zQrlYb_pGqCq0S_b+BLB)JbGFmy4$b|TLf!RKi|s}t?N~vH(A;95|#u)y{a`>4V|+B zS~zx@XJA~L)>b&HVW;9rfaN+p2p;8BLHKXR9(a@sEO0$s;Xvi2Y89QTh3}Y#8L#re zsAe^wnyjy1T%X^*D`NMJYgL2fj6B{Csj0LxGc^iZGNO}{=Ye9Muyws!Fr!Z+$jU2( zX{Vm!g^DLH9O=}Md}cJ`BiVD|0>tr&s#_S=ge*fL{K3vNQ?&yb&_5-i4%FPry*W8gz5+1wH+is$AH@tVidW zcbNbX_3TFb%4TnnY(8*BGByZry@nC&9n%58rs)%v9pQQh1&m5?hgx#|`}5a9K}Hr> z{xA#?l!5&}{|3jrmcdYeA59jvVA)mtvsCzg?QssUkj&~APkHBVWe9f7*bd>KntTeY zR?$nYZ*0)`VNw>fYhl86!bR*H@eIqf?mv48=JjbF1dZp3cZ!aEzA143Z8#N;cu-Uu zJLQIO{KvK+YHUc2#<-hRt>KOviu;ol$CDsD>dByqLq8eBIp>9aZluW1C6CJVg5rZF zc?aLhgwwIv2uzq__I?^-yG|XzqmwCk*qVZ~WYQXklO(jS??}4ShV?~YEWCb;z_m4rrrP}2 zz$Fg6isn*I3P4_o#cCfMnJSWI6au`6!|u#pBZf6<)6EjVVtdw32C#T&8>phMa>^R7 z=3~BWl@W2v#W>J}0kpMdnU*p@^&c~&o9M}FQ;)?* zqu@?_3cUzBEz3&q!WLu}rk{#{q=H=NJ7E}`X!&bUiJ92uvp(t;wvd#tD}%ZSSk|Qg zE9i%IP|KjoRt*7lhi6Z#pSGNcg-L@y1rwthtch4qSOgi_Z(#Sic)0hH?YCQU?MhvH zw26J34(qRG0GKqw`>P3Gw=yEYisoHL-P<=D4$qNLHfjoIlk?&1(*khsQvhbB>>|dR zf>sd6sFaz9tdOxg+r-GAp14Qj@xB8ag9(#S>dcw0<}kCLxeo%C6=)m&@E)-E3L$i4 z$4`lgSrIzV0#sS8fRIVF0E*Y8YmO%2+CwAFp?VbtULz(DaE0D{I+c5YG4SEzxJ1&l zVxS2OjfUV$aqJp_()9PU5PA9@QRUBZd=FUpr2uQw=#J_Di}h*6ZQSdU!2uS@gJM&W zzh*}j|II9FTo+n)?W}5H3o2K;aA^+f&uVYg5Y#Y6r9LfzKCWK8Sx7Sc{)v(U?lH$o z%*6aGcKyTNs+iw~9|sh(E3>vGfYqy!0o+P?1F0`x({8ecb;f_jR~;ZJJr7og+<{AX zlOZ}G11{c4hE*ZaaO74BJlik`^v0g#pG{p`%&KEp9T{v*fLcbZ85s3EpZr!dFFYZ% zMEVSIBU{dEQLQ={)nX?Ktmw#gi7!i@X_3$*YhusEdm!^^7MQel0J|1-;q-$n7{5yj zcIMT*(QJ@{7E>CRVq9_n!}+K*1wmy#F-b*A<63z6@F{!8O2d)K#HPNniO1UX2j$I`M}7etgJXLjRnnoY(WHC;L*eSJrikQ4Uv!Tfb@Bmov4wq!i6nX zgeHKNfW`W>o~h6k6flTXWKz%nnD3tJ2c2~fAN1)V3NULKI` z^s-}FS+Ed4sj72T)y)Ts{8+Q_T23llwdzq^->EJcnSo`E+HgA~9gchZ!jSb#RV{4c z-M3rYx~Hp1B`#Z2N-?a6`)T01>JF?NU^J_dsUdW=5vgN-3AJie9d~qz+eQMd^?%-j zq_kYHXkf@Ptf6jpP=CsK$n|q!fs5JHPa@}rQOMl-_h{9Q>CtLL@Ff{|?s~#H-pBgK zz@*+L4+!bD`R3xw9JouFVL-r`CknYCBQWh0gK$A z6FvKYJ(lhIbI;f~E;1=O*7aA5|4i2=-mIUpmMMtc*u_%<(d_pK3{M4V8i0#kOF+O< zy0Ary?%zVQdfD(a@i{YcV-!>Pu85NDwTKTB8mATT zz<)av(z-trFn9#R-K)Zwv3OYy1K(d{W3=Y_h4S@S+d8UgU0sFxT7!Jvpsvxht|ugA z@Yl9R-Lh=caR!F(W8)`DPhX3#P&&8?7iQ$LfoOct;nMi$S(*g& z=~T7Gv>ofuoR7`q%hvh)?Z-^pi90_eXjMcRCnqN+C@6?Idh{ssu1GLoRYW@ya7hoH zU?|9x16idFl7MUPIVqzcc=n&B9p$#|bMx{U_a$daK#TNBaWL=TiUJq?Y6#F?@y{}3 zU$43)!*Z7WazI)FRG~LgWVfYRvObHW*kg3A%AitSd9cH6O#q8sqd>v8hxFZ){5Mmg ziukg0!pedL+b_(&msbxa^r#2$t`OEAz5#8mn!D$M<5tnaGKs6RijChyad`zEope_S^;%?FVt zvh?gE@?ix>r2=H9fQMsC*00p0uEB?O#8*so3tRjRfa}*kz@;j(q!3lK=n!AY({UO#lFTa{vHh!is!8JT1m7?}JR82)Yh|Nq~8W=0l676$hE z|4jch82&M={=@jQ?ccwD-|?C8dEdUE*E46vykEQ4{_o$voQw<%e}VWHuf6?c$*QVF zd~R<0fXaRV@fRqjIk1VCmkgwOftZ~{tv`Xd_{fT+xwsVk`~Hpj%l@5Leq6pF`ThI} zhCgp#GcXH_F);J;G4Q$h{^Adf6(iNX6=y&GpML!t!>2$07}%K^8Qi4U8Ms&&8NLGf zN<1tKPLk|f-KE+6IhdLLB1az(53NLu1S}Y9{xdQ#-ulDvZw)IG!zBhr=DR=tvOZ&F zVEpl);q#Z1|2u!d)S7W-^D_V8mSOtCt?`fXcM#C)0muI}^OBa<855<%7^56>#ovGb8UFo) zg!O+=m;=TB|NF=A=kMP;fB*c+UfdqBi(UbjSig3XhJjhGxP~ml_pb~LUq5|eUkVc!h)+yhFnnB&8(M+f&VE5o0C`6N?0g2-9j2hd(y24>Di){g$PNiR({` zLh>I45pxEHd-E9?UhQUS|MTxx6+UxLGc!MC;^r0;jfvUGsj2ypftB^gzi;2Tz8*cQ z{bBQFBhjp^6|xg1bb`taAbv%s!T=ab3|xfN{Q+jSztA{l1BNFs!GM_GfQ11!)`H;c z7q(X&wLiJctiSO2hVcG+aM$)lL-C>izkV@D)OE+OYiKVe)vX~1-u+*D3s^=1Gd}|p zBP4tO`46GN+5JB#vKTDH*cj>zd6#)gb4HV5e&N1Y;lFSH{+krK?0xi%JOcG zA{nP|z5I6S$lFpAh21b{Wg8(`jJWBASRiQzxvUj}9dHlWv882$ofSpV|^>!p7TEdRL} zn1DwAWO&E$2Pl5*e*+^41%bVv6T^Wy?FvoL@P17;v*VP=A4d}thi5(=yZ@gG_k{QV0o%YOfPJ-;OcqXq~om^2ee zrD0SzKYv0K-ybjytU-~bXYH6*la9+H$xR!lYN#t@iRkKs(+eliGtVD>W9Tc%XLxr1 zK7)XWDA>I3Ks%zdvKjvW{*^bo+GjGM0J1i*PkSVOWTxxZe+(CZb?Ai>76z5{KMdA0 zAZhT`bq0nLp1ijtxfHZ6U%T`dmpPYYWe+MYT)2$a$>|VO=sy&*e!p@>`(9{holsod z2Fc3GDWHUbuK(-TFaLkcn9A^b?`~jj`^UiW=@TT(LE-)TH`pU#kFQ{?Ffk8RVt-8AJrRz`5?u!*>ine*Oj}oS(qL zfCHPpck`$H|FUm8gWTfHa63Qm-1Ou{OSv?UtqX%>+hj&kGV1gjUv_03dhg1>$_NQ` za3c8!tR$JhEd!9y7a*VE4VW`HEy zzu-UxW=2jOozu$e*O%Q54Q&$&4c*PIqJmKv{Mx;X;oDST*~J319OyR&CMM(}9h!T8 zBFY(1K>;i@eqFi*tgD0>cea^tn z#*9<%k4tBO1rsZZ7^k6`Ig5zclV6YSG5q`SotcS)^DnW9wD;OqS8%Ao8vHVoj-rPyZGTJ6T|y=Um4zf{>kv~&wrL5zyDi;8h8Yp3TheX0r5Uy#xDYu zGr$b~A6gKofEqYh^ne0N2wEs$W>9eb&&$BUC;%+A|1t1z2{M!}(`C4O_$b52SHFPS zjFEv?jFq8$g(btL?k5bqj9-BH?hgawe^8(E18L1KMqm%@4h>7G{Qj(Dcdx z5P%Y^32hn-!%xySNt?D%w_3XDCWumh5b=jy#*pqdEAFTVJqs!b!rXBOg@K43MRq9z zcTkH5H;{=84?+*4>ljrO99o6VwX<8(=C4hBlXOy9JM{1plJI?eU%uyke&ROm6CffW zl{wfOvhwpE9NFh$I9APULW`kQXcRP7zLj92Gbvd_@ak;_{b$c09B@&rFj3PSe3h#X zs3l24I-N!$k+8_1<6PZ-X1Z9^p($U`9o>i5&!5p|$j*{V?ukTES7dCgt$`!E5I@yV zgeHI`gnd?+Br4bzB^Z`(9Rbo9wsa!mbJ<1|Tozpnl4q z=MNv9v7ZHktJbbPksh=Xfl;e+rN)+cK1=3A){7G2G~5l${2@*y?Y1xas& zW()G5hh@xUFK?WS3UY{Ny^oe8=oBHw7q^nbF@g2E8Kcu$f8@(p5VJZTWbw1`3t?Ya zXO%|o#k-G}c&{6(tU%dVHrK@A{m=4lA9FkE}{3o=#!M8OK2paE8%%Cnysr=0o-3`s^tQyC8C5s+$dCpo~ZrxjZ?2U7~-9#aNzJ{OQfBg$E^_!UF7&^}|YnFk8q(nI5 z-#`DKJ$^Lx#>O5*0e#zpnL%|2ww4XZ{TqNd71k4j;$P5)H?Dwtj&mRum_+_D{soT_ z{0D|V2e8bao^XdDZ@C(SrUNfH1M0Z&Gfa-T#lXn{%3FVc-3FkZ|9?np6fiPsn`krC zR^~7;l(aH1T)WG_@Zc%9U|R!}%K*}%00G1TYI3oF+6q8gMvNC&F#kuiM4>Iz$1lHt z`z`;#Z3sx=!OF_S@Z$&WS_IS$02K(Jf?&sv9SjZ*4h%dzJn({G<;s-|zP`Q;-@bjr z>j@4v7Mm}hUo(9A_!d|?{$;rN@Girxi)R@mWaSv#Lt+_z19R=w^A{N|oj%L(;mu11 zegQ6qH(y^faB(s*u<>FaXk}yJD3*!+%phX|$*qoyfbs9iz;F!MQIVHpVBiNv>rO{d z`<{Wp<2VC@usX0%cmb?sfcYgVIttfJ0Jzn~@adv1!~Z|*3_MzofH?tF1bl!M4s0?q zFMr&)A&yP+uQ%_2aR8cwKvZ)7fMLU7VaXtvn8fgQ%VvfT3+6NYxqJnph7nQRGk*C_ za;xC`&p+@?fA#h&h8J(YF!1xRGqABTgX0$;;PVO;24?>MpSG=I_}5nTpF>^y@3%9@ znZ=6gmT{R{g9rA0KYnQNY5V%~|ADPG(7@vRMKeA#vU7YCPAd>VH!nkt`(57aUqY}V z_1(|^oFHZju&clhOn^sU|71A#_BVstnwQ|N4S3K9+K=1+;%5!M!r;=?P~VK`h$uEz z9>&M7pEF%~d@{>#(ktEoza%YDK^9;|@}2Rftc16A{Ip$H7iMi?c;v#(@b#YqQ0rDK z#%Tg^EVd+t)G9;=pd@x5cP<4D3;tyI%lH%AJqLEZ84j#?!VuOX%aAf%8Jr1U-TT3C zVCiE94h|NeJg}<{EO-8cx(bX;B=is%TKX#)glvH6+QAUm9|9($+YcDTe*9uszz@tO zz4I9U0R-U0>|UD&qcHxYX|^_L(PsUCDL6j|qSJlR3bO@WofmFb8w%bymTR0_bx8{$Cu2i5c2urIad_@_gUHxlL@4YzF1tH^ zWf+lc7OVFkz+711w&7PYuygxI9+6H$K;T^aSMez;*n`qDX-<^VQt3VtVn1c#3G@T(T8s(p+O-bO-ax z2BtpfSTo!PMSQoKIE0Uv`#r?&cEtO}jw_+C>D90r2n(WhtXB?=^bU1*pq)ferg2jV z^@w5UGw-ykqg|=cAVm9plULR1mSA`f;jPfN_&0X3`!D0JQ|l@t-rZ@5ej-Kc=Mp9hoXX{ zIopC15rfhQt+Z$>RE3zXvF$dAv)Nt0nT_Jlmg>O3!tMrfFc59n$Hvc*hw5 zmkpd9aKGSB3Go}O+Dg07{QoHdP(6#-RDQyScgF%vhl@2YkM=I9bwEb6d;rC zZfXg^u6QHo!_4H+^=t9_qbEj>Qio`y5L6nGfg3d(KH`3p=m&}>M2Dn`Az52%`!qIot~Hf<>U;i$nQZ*Rtq2!>N z8;DeOBvcC@q(!K;Ht3bT$Ss%fcC~=+*#155jrgtJ*vp%!NmE{3lJ2*Y50(e(hTG|S zBHXDwqIR3xgEN7FQ>9Am+~*T>$@gb|x{QxY2DoT{^<c2H zhM*jB9js?L0^A9pyMq!P{n?upSh?4D{#^h{ttYf;C=P#V(xh39tXrX)`6mYz)RQPE z>d~Dxy!0rFGCb*dH}SBOf*^>fsEBwH?KXGNli)!;coB5UpgZ(XyZ%{c+cjxllfL+S zNp&FYrVm2$LU=rW@8$b_-|u@0=iP$sFjH2#M4uG`gRr0>vcA`&tio;-^pO)lh|Sa? zEz6ionc6LERRs593u%`oOysu8Dg!*;Iur9#)ug(2bwkzWWF}q%{vDr{qY6bC};FIKG+QR?^UtO zq+ruhKYI!sy+wNV{6-NV`?95dz8t$MY|uVq%1{$^SQp=6_}DUv^Cw`YKL$Whsf=YO zCT^;!RB7k*bYBnNH@3qqRUj!FKPi`^Xny;S`lTsUXXl6wsG>L*!tZY|;5-1o|7rPR z14dkWxL7*q)7a5CwaehD_Ho+)fxz%OxvVoIH8+)7#u>upFS`te+7l#iV!l%Mm z_Uz=$>=xmx3!?UqKp<)b54QTK3rehTAp63}BRKF05ELIji%!7GeVM`Y1sHg=?3|w6 zAWpo$LGd>$II`cu%oVYZdy3rJO_G;n@AKDqLEYQEd9M5tfKjUnZ6XMxFG+Vd613YU zk|+&&h*&Ry9%`kBUc}OhS_GvP@!;R3SWxkxf`=mNLA;5A2P*|Bip4?|Jk&scgrb5} z549lnpshwLo2J>#Zen(Qlb`mIRTmz+!|V*qH{ZPPdwk=ytlTLxYiWkg&D2szY0F5b zRv2}4ScXnbl@W&?X4a&>&mzsXuA3rCYmQwwU5yMxyn2nSd17YGul5JBY; zM36`%To?1;O2<+j(p;^-RH;)GiKHb%rhZyjNW&pvNpzMKI`X$bVg%u38#?H96>IHqd(;(3{E5eYDW{nhx4>2&jumk*ejk+1W8~(y z8tr5tWo9t`C4h&EyD^PUWa&G50uwkHoj_cE4OO20aiq=>uf+9` zf0+9c|DXRWvC{hrqB`IhOi~T*DPbGP**atfL7D5f_-!Fw?l+4hkQXQ0<@PWMAV_Q{ z`dgbY_UtYq;cz*k5u543F9v{}aT)?w*w8~ zXJ-Xf!;GIKgt>j^wT7O7=7;}SXsj+ONrSWkF5LSF?oxdJ{vBLMz!n<83J6da0aPHI zK8<^d_s!@3(F(#WXFmS~Hj;q(jDrJWC8)K`$n=Nd>zCgQPoDo~U}Ixq;NS#yDS)M_ zAh0|9{wGH)E;E~2T5h&hRx?ch^^xJ&`_KQG9RD)9tz=-hIu+QD1UkiT83V)d6b6Pv zLBNtU6NrJ{xj2o1L6$+|HP%e>=MT@5l9J+|_wTET<>qex|5x)1!{^T;4|B3}gp-oC zO4iiOfX*sl4KF@VH-^`%*D^2y3uQ*oI16;T2|QK4h806-z5oQ(^g%8TGDX1J4uWX5Vk{iF|*Ztel zq_~HljpOh&6-(!(}h=pUDux7u;60mWO()dB`_WGf(Pkd{#Rgl^jnnS;Y%q7 z#jKCWI zJ1{dbLRtjC^bLxIKR|D>f(k&;7~NlBn)t^IjQ4+#>EHjLZUSib0eiEEo0H*$j{}2> zpCbc9IIz3R%+CN`2w&L+3~OGX!?J*Cfc3}HZU!E+P=-06)&sCG_y7<+u9R1jbV%*@QQT!Yi#D-eHx=E~8V|GzLwbezkF z7u2|)&FtDaM^2bA<>BkU3_lrxy?oFDDVARhpFVzPc=M5&fs301*p*=c)*^oyB>Da` zy#2&cTUf?;7tf4_Jk^Sre+nwgjPBa4K@YYr8ar@(?> z8g%;UH?}br5D@hAV32LBV|cf9JHwxkpBVoA`~@svfc?VXe}Ju@zmQr0SYtCXGcz!Q zrXV>u7?^=A2VoN<28rA(26};y8&)u|N=h>@ar0n=Et{g+3Kn7UB`iWBB%52N!^5-p z`HwGGUjAe_{QMV#{q{EukxHBlIs(9!ATZ-U{PK-q?Smf-r-1VC*#uxJ6veTqjX`bq zdtjINu~Ra=iQdHTTEg-wZ#2Vf*|W55vWW@(jn{aWRPh zW8O5?>)cWSj=%qLtUv^nx}e(B5IUtOh(+05P+bTt2sRKmpbKpL{|9FF|4iUD2h6}s z4_XNf>=-cc33Gr8>Yt#kEdN*_s}cW0rtU$l30&KXxHuVpECyzLRw)MXE|}ZEqOH6W z*lpj#09qmW^T`W_jLG%D?wK~Q6&%T+&^nU=H1InWAb>DB)%zD@opMZ=>IN!rmvzUS zf-a=^hp$#c2U}-XrsG;oNG_OO=AN3-we!1-2y^bc&%YVI{9*=Xe0E^-?;nF89~&@W z{s3D9-x-8~{ovPMS<+@zxXdPCc!0G!8xuG8AJB5nUymOPv#Y5+ zfieMZidHz5ITm3?Ei4WO%=F;UA&+3=}n=cW?Q?A|lGb z>+Ua1s%27K%wLz=3CZ~Hef#9zyWb3tKmB3oI`;`aYXBZ20kM(BR6qj;PLlYyUYN@o zodRJPKj+j2#>=lRi}7>(xBvg|ALp;n@BXv@`|{=H^@rzge*0K1P_+%;JS}KtoE8x4 zLl+;x^1~a@3@rm>F9K-5kc5RFpsB*2V3Qz&hs+F2|A2)8>wg9}={B%D7qDgc8=U$7 zf(DYnt%AS*e*;xx9}|21j^W1IT?{(kfOYVm<3L9pWVrtEGs8q+VKNiijd&|A!cbjX z4h#=qF))1vLncsc20#E|HEsWb>{CdKXMQ6srWsH$qs%=ozIo>iV1}Q=%KX#v&4)h> ze|~)i4=l2?Ffnj)3vGJ#nI(B)t=k)7&D1m0W!ZP-I(T>(RL4Bt&%h8C82RAg*6R{m z)?MHT)QY^$#Qtx0Q&aOZeCE7gv&QJp%a>xpadF3fJ$=gm@AGFCW-hMR%z}dNp$k%e zLr0;R=on;wsjXKyy+{yP(0zWtZ0?`$r;mMLQ`G-R~(P)pqgAv!(aGF?{*{2Wiq8Y2N}U3;z1Ypd`%3P^ZtwMT#9$asxoRBgk`t(Nbur>jN-H9Z z!D$XOMGETTp8^&H$Z=BFGM&NN$Bx0_4Y1e(HmKD>raLSodFDnT9OR2R-R>;y5ux?b^*3735ZLNtVo(Y zQ1N^1;~(3dPkwB@`{ge$Y`k#a^B)ZNfGq~lDnu7ac7_^5URiB^)+Y=@7+5mZeE!4m zc|WjMewdYo@eU))|Le!UPq=|itrcgX`kz04wf_BKQekBLZ_CWU<9Om_KJLTc^v=%002ovPDHLkV1nvOJNf_s literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/icons_pagination.png b/sources/phpBB/styles/prosilver/theme/images/icons_pagination.png new file mode 100644 index 0000000000000000000000000000000000000000..872b7308c20338ff97e9341e6c77c982ff75b957 GIT binary patch literal 1043 zcmV+u1nm2XP)OlW_qRK{4YsrHyyPa#10SAwoSC1`e&_rAX683sJRWCy`@3)O1HZ7`WfG46ps#)Ezz3kQ5G8jUdQ zCkHtp+BvvrPtrj#I4ZG9WecOVC`!f2mSdW+SZbXW)g;OY#+R1Eq4DX7Q8qg@!F&r| zhGoP2i*pPP`8DkL;9)*!pI5|X5*B}HUU|HyC{01CnqM9$2DnNtE`DtZm z`EkfGt56J{#B*zdU<>FL#*I0|mqOgwTE|&!DY?K~_NUq(680=p!RtpfcS9MqUcr>KgXEyr|#eW~&RI0&Q)+f;J< zl$R?j@1~J^&XG{81o#AXCxL4fg}Wtk&boDsQ9`d%qC9a0{LG?l1(*Wu8TNfucxB_F zE1Q=bBb9t9xgG}eJ%lRaOA04M$@eKs7R7f9$$PDrm7+LOj;R;=0TrT9JIRt?5eTaw zv|Q(K8srw)ari8^X=-CCC-oT6=Y`K8pfX`<)jMP);L zm|QM*NnEn6Bh6&Z3@cmf9>f+l?VPUcL23mN9Qag_IhEqWZ^A%@so#rp-u?p*?x%ad zzMt3k{kg&9K)h=#1R+>KaPya6%@&KPzTRfHJ6*KX>2lzgb~l*K1W6hU1|vlojg(%m zKUg}tW9P2-u6%Ui@?vHBjGqs_oKg})!y7mCpzWiFN|TqDKGo@Tk*4M^Zmck@Cm4>n z8TPTU#~Id3yII!b<@kWd>q}+xucQ=@kMnUn=MU_C>D2?p*S(y7`G=p!kCb=p9P8=r zYmct}`1)7H$;u1+Qti=LynFMd#ZN9?UFuvP=luMh7xxV&1+R|_g(K0}nx~)J+tj?O ztEYD$IduMmtNFvF-OoJVxglPjn(+sMU*7zYb~EsQeS&|PhWj5L-P*Uke{D2YtHYkb z-}Q9>2-;O=bxlC5h)7DysG**$ts{uKTC%=DDNaa6onDwMAJglMr4pq(Ha#Qgs43ZG zcyqRFFrD?(%*~f;Jf(LpEYwVx7On~BWa{k&jtkBk&ZJLX^I6Rn$DA&0{7`@!VBb7< z99^H`L(^WD)7H7+>&(&F@N8nsygvKQZ6WvP#YQS2*shG_&427VX?^5GX5QB)-+J=9 zw!~cTw{7f3p z0QNq$f_xwjC9u0uf3+wnjEhTi8rTR<46BN*BI3J|qVQV>{28>Z3mCc(V8P~ec@?)E zDv)tl%vN6^)2P8ojjRv6NRqJ)GJ_LYz(zalz#uoPl_i0Kx~eRPD_P4+Zgw!F<~meB zB_(`7-q zS`7*zS?2gnS&45iNNwXqZIlGZo!%MI4C@6&u?*dxQCj`Ic_lnvoG9fr0&2^()g@8? d2uOVTp3nbwY83?`yc#5-wJ)159KZv+{{|9CDcS%4 literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/no_avatar.gif b/sources/phpBB/styles/prosilver/theme/images/no_avatar.gif new file mode 100644 index 0000000000000000000000000000000000000000..ad73330e713ec9a21f97366b326a8c66afe5e9bb GIT binary patch literal 930 zcmV;T16}+_Nk%w1VPpVg0M!5h!_3s-=IPqth19I^!oe!#m?2-;pXx4 z_2lU6!_Cz8_xS1U@6p)a$I#d1>FxCP_uJv+;pOS&>FnoQ6%sUqgoT9?6&QSdUl0ifhLMtk1_=<1 zTL1zIlbw)hY95S;PU3YWDB_uL7! z03h|FX24w^3i*en7j3nYtKz;q!c zu?v_ExZHIB)3%wg2-w6KOD7}$nLJU|WYjX~DVU5<8uhf2(a5EpOfvEaby7%18LLX- zxJIH@Ll#Fh{7MMoD1>AOEsQAeYr%bK|IxEoHD5A#TIT^&x3nELaZAmCo1rbJx4}ZD z@w|q3#xk7G8VeET@|ffyw{9lv1?}<>R}N=+K2mC+s?kU^(X9sRB5ERz+7hdz?==z@ zEdscJQ4EHQ04-S9E`q>A0S)&w6!3uTb%+2XG>!-m!t;XyKuI1b@Bnd!0xN>9D3BqV z2?`>rilAVk775u^4UoVD0!4|mgG!(PvF5=C{Dyqc9U2>?0AM63Y;eX2DjX<@3MY`! z0S69x!a)aNbU;Ccr%-^u;TIHgcnSw!oFF1B5puCXgD0M%f`VE+U|@@=q%hzWApA!o zEFbW91qwUrg2ELf+!rJ)CCo>K3Gf~1i2?0Rv7wW?P%uRX=}{Sr2<1glfR?)y5XA%G zff>sRH#YI5nYxJSL$AcLo<$N*>&8ITG~mqx^(Dk?D`f$6J~Y#Iar EJ3isPuK)l5 literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/plupload/done.gif b/sources/phpBB/styles/prosilver/theme/images/plupload/done.gif new file mode 100644 index 0000000000000000000000000000000000000000..29f3ed7c97eb2e5bd17a7e6bab98d696377cfda0 GIT binary patch literal 1024 zcmZ?wbhEHb6krfw_&%Ru-JPX#Z%mqSuD<9*M)SGyKYxF3f4F|@!*x|>a`TQPIW08y z+@NmXYwfboIA>eftmEx7PPc8lxOLj;wk@}o)$U1Kdw+KQj?7u7+G7q_7aUKWu%~bR zon_CzK797&@#5>#ChqKCeR=lWbKTo6Y;8YOwD9`W!0mdKC$n$9xnkdKU4N?J%dby0 zyHXy!eqg;&z4BnntSh~RJEP0@B-9|3oj-CkkZZ+PIz&iq4(r6)4xUz)J}=GOefiTPV2bGL_Yxw$lNYefFmh~ndE zIY+&>-d_`Q*w(b(@Zp<>wcFFSKin|$Y?u8^o3fLc-6tyEet(^I)N{&-{-V>Nn&qme z-|XLbclqX#$!XmLDils2^$_i=Vfo6|K!7s z$3S&5b~>3_CysS9Ff(!pa1CI4JIO94&@9fw!C(yl Dux)$+ literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/plupload/error.gif b/sources/phpBB/styles/prosilver/theme/images/plupload/error.gif new file mode 100644 index 0000000000000000000000000000000000000000..4682b63007c89fae09f6640e1a968a073d98b90d GIT binary patch literal 994 zcmZ?wbhEHb6krfw_};*9b)oIQ-*5l@e)sRs`)iBszTS%X_xshqKVQDwin+ST?*G5P zzrQ^G_xt_f9Jc2NYJa}F{`Gdu&zDm^T?_qix&OnZo-emz|NVaR_t)1i*Zuzedh_v0 z>zAA1pKtV@Ea!c=%JBE6!+*Zrczrtj)3uOqx1+w?ivDyh;``H`|9*XZd!q2y`>j8o zPq{fm`Na;auQ!6uw~GD$_w&u+sDHnnzd8{2bbrVDb8TPluY7%O^{INT7l+$F-w1!O zT=&{!g-_QbzC1qg{l($GKi~d(fA!P#uus>+|9rjj_t&$3f4+Tvyzkqcn7=>n{r&m; z>&=i$lU?pF(SEVZ_4lV+Z%tCF$iDo6LW`p7(5<$N&HT8Aidtg@EEu7Dfh!1_m9F6F_-_fnz@dBd3hV zh6RoeTpun37Hm*p=S}!xB2%GsN>(9zl@H4iweC3*!Wlj#haUN`*h|{jWN<7##?Qpk zmawqs0!x>8vXF{_aD)HsCf8Xtia|ir6_cteb~+gFu`;I!>|qpOVG?4uVAFdM{QR&W zONNt2z@nss^K_X~eLR`cSvVIfMeSfTbmmr&58_**5um`{FC={>;XzVD=Tv()J_7-T ogaZvn8JQwxBtJeTEbH?rX5;20cPa5$D~HSgwKHzbjEoG{0NEsHRR910 literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/plupload/throbber.gif b/sources/phpBB/styles/prosilver/theme/images/plupload/throbber.gif new file mode 100644 index 0000000000000000000000000000000000000000..4ae8b16a5a474c3da1e426afc20d2167ebd360f1 GIT binary patch literal 1922 zcma)-eM}Q~9LBG`Uf-_0UZFJTFt*nsTO5ueC8MQCX?YP5d8q^!#7gUiuF(Vv0y0uv zMJsO=7zu_gofyX-W+{m?E;Ac+grVzRB*kTp0b7W13o~jO6PL#Adz^qwjJtm>_sjk9 z`#jI{eZINdbKXqbPa-7ZMiBKT^}xA-;P=6WKNl)0E2eKxhaZKneR-`QzrcOMJvKfT zx)lmP4A1{QA9)h7lvsMZdqb029JH3~(nv`^VO`dQxDnc;-1oz!sEu0QJXhB~$nrssc=;5d6bWb>~J{i+O9hUE>s zy$3K&J8PlS3s zuf&l@@FJcg=@u`pfhDq)R}nk`!N({wk0c0{S65>YWU5;9TUls-qL>gRi_rR);{wgY zMVdw2=B8#K29K9L3s zc2K-aUfk?E&kByZwEo`KQU%&(ulDp;Rd2jF$4C4_mBa4FtT?M{W386p329VQR0mG+mdz;^%6}=b+X&!0PAJghY6b|U<(&T>?OpL^EQ|Dg8v(US+(!5}gNN>68C zjIJsuuSa13hEay{0=HqHA>PcGLdSs$kl{5DmyWOoKy3@Be5XpZZB{~bv-Rt+_KBtg z?I&+!J&28PB^xhXaT!{!c-ZpmN=~tqb8%>d`}1|A?BGOz>Q{U7drQo%qk+Jq)wF|Bjbw4$i)(?^O-2qNn1c<7SK zeh64nT!z?PU-wbRweq{O<*Cxk-%v+|o7P1Kr$(&P;`Dngu`P{NC&`fTITT02B_YRx zMm@NDi25Ks=~!vhsbn#_65^=UAs+Z>fLS&$h+rtQa@x?&qIF}sS{QcM$9 zyj8I_JtbX`?QWmL>a)qPxTV4W0{AhtaEw8J%zHgmpSG<=!@1xzkcC#tDkpClZTQ9T{9{ XMrH}sh*f7CD@Dcca7lI@6tMnZ`e4## literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/quote.gif b/sources/phpBB/styles/prosilver/theme/images/quote.gif new file mode 100644 index 0000000000000000000000000000000000000000..d1992273e6d8ae066d8adc58760cf46d33e67acf GIT binary patch literal 153 zcmV;K0A~M3Nk%w1VGjTd0J9GOaByxvKR>OksiB~qh=_*X-Pl-HR(yPVOG`_|#ld7` zV!61r($UP7l#w$tGwSK&A^8LW000jFEC2ui01p5R000C=@X1LlU4~Jn5*3c4OiAD% zg_MMd_Aq9!Oi1WHN;pdcONI^#04R_&fQ?BGs5t-~yJcwbAUulW9q2h+ literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/quote_rtl.gif b/sources/phpBB/styles/prosilver/theme/images/quote_rtl.gif new file mode 100644 index 0000000000000000000000000000000000000000..ac719cf280fba68810d89e25246a5eda18411f7c GIT binary patch literal 154 zcmV;L0A>G2Nk%w1VGjTd0J8u9aByxvKR>OksiB~qh=_*X-Pl-HR(yPVOG`_|#ld7` zV!61r($UP7l#w$tGwSK&A^8LW000jFEC2ui01p5R000C>@X1N*ONvou7A=SqB$MJe z0<{F9_AsGCPRprG%!yQ|JjH`aqt}oKdH_kScX;(2x5uzYcnqG==_$256(s=ggm6k) I&XWiLJOAfD!vFvP literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/site_logo.gif b/sources/phpBB/styles/prosilver/theme/images/site_logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..2517fbedd691d93bebf31860a8b75b8de8b450f1 GIT binary patch literal 5070 zcmd^A`6HC;+ka+b7|W0>X?ZM(h%wd?HG^cWN!IFQ1|t$Pjj>jYv5l5vWbKH?Qb(Z} zgluEWphAemX*gxg)+*_}zfL97YFP)lSZ0+oZP_p}9yoAt-2Zl$_6n8Iv{`$E4>G;CO z`K6U7eFJaj-U;8%06~Riyz1um&ic{0uBUy!&&>A?4nG?hiYVy_e>gNe_Ih%9?m<<} z>o?OcUj61;)FTsJ{q>JOfPg%xcgEn$F~B97_plB)b@~10)rOY#_a8r1)iu-)OeuwrTK{}L;F)l*|E*tHpL$fWY;fL<)?r5BBVN~_8nfIrFe|w!O+XGuCX^VK37Lxjmw7Ln_FBd=^T19J@a;Y_Q~Yp@aXu^?{jDFbdJBB zpPHSo>3uaZyFe-6my}mpr`OjHPeBPJtAsnGw6bID!rc0v-oYWmxDpv=&BWB~=-c_x z-)F0b-oBc8XYg~wy$8HPelM};nE|Jn5S3Nh_j_r}ldgf6u(Ns4W05zS`;T7Afcj;> zoScS*+$-xEfnBI+85r{_d5-b9gr{Gre=-!DT^3!|L9KWmoKq2fyUvSqH#oi6i=C%` zrB3$T4VhD{(vIiU{Ce3$K8D7@1hQo>JjiVs(9h_sfAJV3Uu>}_sc zXK70h^>(X@UvgRJ3u@&MjC$Mams%jKe0_Z#7Sjm)KNu?OC=VwhXia92H}2*KBWPrw zKner&rkn`~woqNFZ&n2Zd@WSnjhrw}G%JdKfNd0=ay;sYi%(Rb56)Nh-~rG)!Ym?) z7DQo?!HA%9!69Z57OG@lsyD@KW4^hqrwaZBVFX&J5;h-zn=!4ZbP8ysi`nOcF~)$# z`nviCh9)K^Iv^IKkI}4k@f>xLWXQt4;(^l>=crUn+fZv(L}Br=#mj@TC*qV_|bW0pk?2olP(%EwG|=j}5$GNe>`M&~ z`3vpjWM&r}!XO9xQ0%NNR5$p#0Rg^dCN{=Kh6aal1Y?|mzWyPMsR_aQkfE_D&eYNh zV~IWVgKJIo2@RqIGk$P=|HCExD|gcfL9~s?))aa`7{%9yP7MP8D%dRG-*YkfSG~Wv zzW<(!>A!OIHj>fXZ0rAM^N+0!?`%&0G400UAKO!cH@r^YFg0ZT`?o*;So^yA<@2YH zAKtGlFD)*-o1dGVnVx$4=J&}7;p^YV$6k%T92tHwG&u0QzpwY%(>yIcJ0o!do)1^L`tdAT=pez}pIm6?&Ac0HAo z^7FN;S1u>BlM)l+<5;oGnCMFvFGNK~golMPLg?pd)Zn0VfoB8!&-hV%eZ0veuhT!B zI(fp=!`;o*<+$@P;?W~cjt=&AwufyFSzB2W@COfAnC~~knVM{N9J_I#boc3K@72=W zqp@3EO;rWlwR6XI8& zr*K!=*-{3&hNgBOS|xU?%Rh?ON}ICFF_p&NGf0-qu`fPVp`+=LlBaOq*Hx>Wp~ewC zQ0bSOIv{i{BWct3d32`U<>Vh2nsssImWl^Vp6!d}F0^0X-Qb^0!yig$W)5s;mhkAzfgv~55WgBx&f1x{VTSWy-oTFY(g*0;x@$XxE8tyDP{mtE>qaA*%GH-mX zn(unouSHDER_3-Xmw;3_GRm;_Y)jMjl4?CHz2m2G?5(^p+(*xHr5j}c4-!jq>B0Lsb_N|r;XIF zu*AM|pj)+FJjn9LtAGiVwIQBxN!i{uKS7&RtP;N?Iznt`5y(QSM|c$2TB>Wx3^?-4 zIo6{6$I{zU4*sHGC2KlbUT7~h6j69+|L0;w4$c~YK`UGWC=j_pA&@RFP(6H!Xm58r z!`1ul?yS?#ylqvI$wFyfrNlwI7+!JUMK0a+ol9 z;zHm<>Dj#w=mQ?y#YgjN=yq~7w&OlRm$bFL;T@DHQz3feif+?F(<^*KMMX($6%s;# z*Q5RCGh2|miZE@Krtxi#z;^D+r$Im#CD>r z&v7Inw1zgxSEubOpCTqoKS)YJ?Bij!dlurP?M$5Fb(}CAi~(gsi_ihvK%n|IOzB!R z%pqohKX9xw?9*1fv|OBynBhJVNM<)ZY!q5H9`@Y3w6AZJKw1~pytY|QwG=n0U5S^D z@mWsLIoqBYF?p~d-%i}KVFfms++2?!Ts*jQRhY0VZ*}t8a8|8+AkC={DOt%WJ;t29WDN6El<5#HH?ME;5fhMc(EQcpb8n}yYDkkPuyWfsbTq=b($ z0+z^dv%%4Z6@j*1;U_Tl``SYDQuLo&pXy!w)>oLS11*n* z26Ln3xV<{}iU8T|txRPkQ^##8(-cpGd2lVEv&Zj1T_#v)|JI}vSUggd7%Ra5;k#{H z96ZaJ?#Lb~03c}lw!kYQCq%rFnMyB~6D5@hV(W%@YsrffBCl0#GtAJ5s%N?I*CAK7 z7;zJ{)Q=^rfvhc!0Brj+OZE}-$*l-pyN0~X#!)R-t;ejCIV32;zCSte zoSO3M8Ef40{-4EXnG&*i0lZ-$45|f4!HEKRJT3lQpgKGl)9Un;%t?^I!KIo{(nMbGlRnxGe>JMLpgzN7%62q|vhqJ$3&g*a4>-{vsbGkh2;XDO6{;CbaUfQ@r!gCf7K!Fb-o^j zxTBddYk#ObPL5M-XBc>ly7;8~(bf0dpYA0*JnMFYm0{@1yAG8jCft{=W@JTaLngcNk47`jJ0qAR zh!84O918Bpo**4J^JsZE2r4XF`Y7!mY2E1tCg+wqDwpV0?A4c7MM1z1I;!n4aym@@#*TAA!;Zi?E_?%sCOf2xfHw;Y%9Fg6EhoGK3*0dMq~HJY2wuag|{x$F?<U)I$4Mrn~$)9Ga*5ZNhnE+bBloeOAe?o$~+NO5ke1f1A0HtvP1RvTa zD1c+v(RGk#w7Ae`laRf=;oVkw&KXHJ-)J1J>-KDV_WO9t6ut)6bCip}CHid!+_jdh zg=O9`X%s(_@@P;Lh}B}B1Pz$@!K{6PvL2T?;;ps8lITyKa)7uux_&gLiLIRe?OlLZ z{m84+VQEO=B9sFWy#vA;{@AhPOKTH{Mtp{>T0BRLK;@z7{n2K|C@Zw9tN(V#nRw#r$zNN5N)Qg60zEtuPe!0m67?lO z6f{5aF&QSwhepmMBJ$zVG#M{-6cdYzUIp+V+HM(W`b=+=O&nh@V(-A9Oi3_l4BJ05 z>4IWHLWE1q`y@AknF29+B?O||4`9!$6^$fhc_*aQvd!dS1`sTn4a1UQ$@6F$jr z_)7CkqLT5|jtGb=6R-qPrkErL{8dr6ghk}FCCwC}$F(fhwNX=4NHNf7yL&YPvgQxV zqLU7zy|?589(<@oS5mDSYS_mj#1?|!`owr7h=Xvi3HcZP*L*N2AAFMJa;g#VGlI*J z5WBjoz(?jTz*|n$#X&<>HCH{Z8Q{_?)=6n!W>P`Bq!2;M{zxq|E}Jm|m*l`D_%Y~} zi+p$b5h1;jcsW3CNUa@W>7;-RSW7y}6MEDxvl0zcXQpI1 z!(2VnB$m_84fuzflK;Bba9s`Mp8OeMqmMdMp(Zj_4uK+W0r#LfXR{>!6 z@D{S~)*j}D+o8Lhx!>#dy)Zz1$D!=d2qYiE>p}x-D!oY=uby)&%egNGxZBQJ^oB!` zkMfnw_De>^xbV1N_7u24xX8YXR1aCB0a4y}t4C^svq59B;Mm@AA#o;QIXj@$vKG zBGFUgz-m(BbjU-|+kU{6U4lr>CdL-0lDW z|J&ZeA$J{}cbBs(`gg&Hw2FR3pY8Uiaa3y@AT4|5%?4lcU7tQ{sk0RvDK9zH1@$jQpc z1wH^MP$&RC1rpY$4%yk(1qKZj7fut>#@6QN=G`|HT|@~zJ}h>2B{nuL^8zV84GAhw zl6=sax50)38zbiZ@&pCJ3=ld}6qrarn}&%gFc^5y=gBx6J{Y8s7-GW)2qRN4>K6`* zhy@Konn+>6WQY_j7%7-B!_R__2QhVIFhSsj1sNE8D0r}Af*%z%7EHq+BLo2xNgK@A z@z0Nt85J5BU{Hbw0|PfAEO6>|NQD!F7%;fOiaz909I@&jx&aNDx`bdqa` literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/sticky_read_locked.gif b/sources/phpBB/styles/prosilver/theme/images/sticky_read_locked.gif new file mode 100644 index 0000000000000000000000000000000000000000..79f581be79318432809028e06cdb23a165c9e13e GIT binary patch literal 646 zcmV;10(t#MNk%w1VH*G&0M$PLFe%trqb^3@$BvJ=IQM1^ZAIg z*_gfF{r&#*_W0D~@nvOYl9G}~io~YI;;E{u-{I!h*Vv1gqh_7Xxzp%uY-~M*!T9<5 z_4)kt_4eT6=fc?Qq?FEGp9?A++|#m2{sjEuz8(=wpy0THh;g) z;PCJ8@?may3K=F>l*)B=b(ol$0002;^!HGZ$A7NY@$&TO@b_L`US@H7t*xyyGc*7H z|NsC0A^8LW002J#EC2ui02=@s000L6z@Kn994S^B*6P+GI-kNsigj6_FpG=EHiAMG zDh24|EBhF^1?%P|Dl{U7uX7*}4z+U2#%|{XB0d`g02GE49s~_O4jKw=HVc9X9+j4r z2pv8cEM6iJIX;8{G&C}&G5`Ps3<)uhPX!kY9SEuqGr75{060DiHc%`WJ_fwU$Onun zP%0xn2ME%o57pJu2MizrAWkRF#nR&A;vqdDFd73>iw4bkSn~ z0uuxVcyw}O1qhKiTvR|Azy*$@jv*{q=-7kDlN1+jZs>qxfQ$+?HuRXVc5g8UY4G^%2y<1RiKRdMUt-L4yDj8lZup?<&?dEKmq)&|m|D7BJEZ&g!I54h9uU zlnB6}#tU;jB1c{b1w(`y3}!&sY=FZG32mMj_EBLo2_Fd}d}>Fe(7?eOR6?36c6a;DPr_4ob${_64g$Cjd(z22tA;)t`^sj90;i^cW$`QPE@ z*Vou&oXyjPn2njE`1$(4bcW;Z_P1quz0>C4;^!?dFg%06`~3aloUO&i$H*;Gj*gD7 z&E|<7I5mF0VsCm1876aca{vGU*R;HVuGaJ7=JnOxU|?X+-|p|>Wr#*fA2q1_2$};FaInQg!2p;hK74@LgU6H(9gc#C zFd%^p4iP}~zyJdV!h}PKXgF{n+}4g^eMJ3$frnj~WPU(!CqaV&3>qX%i1FbpLcDoT zv~Uz5tb`mf?n+K8rND^^5;(A6VSpG6d_6*k_DF_Ah6oY}Y-R!IfQ7tdEW_fEOvRoI w0AQ0*%mxJtJpcmej{PEsnkP9jTo`UAKnDvJY6PgkJZ}UD88SeaFgyqVJ1cA_#{d8T literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/sticky_read_mine.gif b/sources/phpBB/styles/prosilver/theme/images/sticky_read_mine.gif new file mode 100644 index 0000000000000000000000000000000000000000..8f5f28fe5e3f88713baad319c16301c27cb4825b GIT binary patch literal 633 zcmV-<0*3uZNk%w1VH*G&0M!5hxXRng-tK2-XLX~@mX?;Xva{Ic^N_gNWt_|G?eOE~ z>FMk4hK7c(Fit0Sx&8kBNsGf+lgIY=_~PyMq)}yab93nN_|H6F=jrUy+2N?g-}w3Z z*VouMfWF1i-jpLgGkm=C_4eT6=koLP_xk+7!o%I*<+su2Edc`?=oD;Y!Q(-fGV#PoV8O8f zItDCRNbq669i9OZCisvrf(3_`S_MY9m}%i8o*xkq=;RT?1%nD4LTvC+vl_((LfrSncu9h9rA%&w5BSJg~;9#y4039qm;J|=E2_G~* z`5jUN0*wdA7`Px2;lN@cfM0PqR^mZoXqSJ~bpvCK55A!>ci_Y3fdL2uQVSWd0)Yk% T13(~}F@x8kL=+S1sFHA%E)c>VqU>AJ=2?eOXA z?#zRi$60jp*4)|4)9lOB$!~|$yv6wG?Z=y^%YBlL+j^E+t0002YOKS7<_Q613@Xy!w>T&K7#=;Ffpbv7y$|gC>M@T5FZB{76AbyF1fk30Vh5K3{VvaJ}JD%$O(%8 zPyiu52^P|%B-Pc@31=i+L@Lh3(&6Ia2|5xL+(ZBmJ}q=~0tE#&?+PhCH2?%pkUnyA z3FOI(@Xi;43SL;O(2*j6LmUDzI8348z=u6gyfyGKB8A5Z1wa_^m_ktq5)QhExX^*) zi4+b%fS8ctgdzznAn>{Hp{0h44JR^yARt474+$SksNh3@0gGoEWK6)Z!DtN@Cid|W z0)a$_10w`17;)g-g{51E4D*p=!v;k(n57*Op#rEL88Qf9#X!JZAp#hnIAEZ#ff_3= zO!)hwE~p2E1^7T=!Y^YE2zVUWj7Kixx-@o_X~19&V<8j(d>Amm0|3*fg%A*7f&+w< Ie1ZS~JLA_Pb^rhX literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/sticky_unread_locked.gif b/sources/phpBB/styles/prosilver/theme/images/sticky_unread_locked.gif new file mode 100644 index 0000000000000000000000000000000000000000..5792b8649a4e4e0a97c44a359d88b6326938ff64 GIT binary patch literal 626 zcmV-&0*(DgNk%w1VH*G&0M$PLh&4&HW_aJ3s_n|t<+{ZE{r>Fj@XT9x(5kfP>h0Et zn!Y+&=IHC;;^+0=i6a9_v!7zJzddjgT$Pt z&t-m;LRQ2?WBTs#({hO3&(!Md@Amij$4qJS+26e_PyF`y<*d5#@$=&2=*d%W#z(^b literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/sticky_unread_locked_mine.gif b/sources/phpBB/styles/prosilver/theme/images/sticky_unread_locked_mine.gif new file mode 100644 index 0000000000000000000000000000000000000000..93495770c8cfac457a7b60575bfe0f8a9a2a8763 GIT binary patch literal 682 zcmV;b0#*G-Nk%w1VH*G&0M$PL=(xkuu(`fASBNu5%q~>5W_Z+yn#V|I<*d5o=IZUr z)BXMa`1$$l?eN}~r}Ng`&RTZo>FoRR^ycX6;o|44U2w&kru5z7=)ubL_4fDW>hSUN z>gwvyY=igd?ayU?vU-T&ovp}JZ<9Y$({hOU@AB&F?%vPT@9^=79ys#z^!E4o{Py_$ z`}^>3j^E+t+>oNze3J9@_Wu0*@Xy!x`1$hUSqIyN7jQwJD6D9PH}34kg-EF@$E7d{OW=(qyw>*x&&8V4FuEdu2z5&8Q2`MCZ= z3xo(z;A4XyKLG{|0C8}~4jvF43dtb^)SfKV(*lYOJa9qG z8uP~uib6V&c$y=FiV7o6$Y2oDq1&uKIFJ;=;zNgWIb>MCvDQb-ty^hws39eW01XRP zSX!~bLtD2G1rwHX0D!0r8EPz`@fR>$xl$e+@UQ?wg$e-{NI2@xpGXv7hhTspVL^f0 z1w7P6K<0<$(4&1QxE;Vp2@wiDtoRv}Sm$U2pyU z{^`2KzB*dsrnT_M(#TnK&VrZe>+aUU%h}7*?akH6Z->;p#mAec(rbg~>FmpWlKJ`i z;Ns_+L|OCH+{$Eql_5R!_4fPl^WT}O(s79L^Yq}v%k|&n-QeZLP;9&`PwwyX%5{tO z_xSMf^V^J{+S%Xz_xbQ|jsO4v=hD~n^!E7h@~nG^zlfIj>+YgiYxwy2&P!_j`~3g^ z|J&ZpMa13We;QxznAV+IT|$jBuo z4lyPk4P^ogJ}br7#RS?uCn{wsCq4uji?;ML^w^z#HgIRX+>3=U9$ zfC3aKa06h36+YM<0M($6wm<_1S^!wW#{vOmAYh2mV}&*XIwEq=wqk<<5-iHV^WdY! z3Xc~$6hQEDMGJ22?r8WBt3`>R6%#sixUj;-%^Vmi+!6ADM63-VT^ literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/subforum_read.gif b/sources/phpBB/styles/prosilver/theme/images/subforum_read.gif new file mode 100644 index 0000000000000000000000000000000000000000..595595c296b9f5ee56bef5cfcbca9a8d6f50d614 GIT binary patch literal 124 zcmZ?wbhEHb|NsB~{rmg(@6Vq&HJ;oW`jcTFl9ETMcWETo?RWY^} Y%5-WovMn&HJ;oW`jcTFl9ETMcWETo?RWY^} Y%5-WovMn<{9 literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/topic_moved.gif b/sources/phpBB/styles/prosilver/theme/images/topic_moved.gif new file mode 100644 index 0000000000000000000000000000000000000000..3dafa46ed7c8a72ae11663f5792bdddc58475d75 GIT binary patch literal 667 zcmV;M0%ZM1Nk%w1VH*G&0M!5hzt-x++3ZJ&!Zdxn>Fe&v)ZhI4{N(29r@+_k^!dr% z?QEUNvd-t=;^+AI`S$ntI)T3D>FlG$;p64$Qg@0I_4e`d^zQHRHj2__W@i8Y z|J&Z5TDQ=s`H_}R)N(^^U0v1 z&%%HcNchfZlLtT<6u{EV%FNQ;2>6@M=1VX@Dp4T<3O*YF&GIP zUq2v)IwJ=MBs|vF)7b|jIz9jyKNkWsHaH{a)z;_h>?1J-2?7WUG(I^55&7xX`ThO` z4@_uS@IitP9eD6mBXA8*kB12fbgLmC1Av1#GUBL~@tVeuIJ#Zx5a8gAlP7tgRC(iJ z50rX*1n6MV-j16%bLz~Q!^b7K0X0^o7@ESRQKLjtJn%trfd&&WbV!{_wJKE@0vCwu zm1FABuTyhuh=;&gp%XdMs$I)A?Fnz-q);#eHhxyEqS_Up3eRK{#ljD zDtEc+^7uZ4z$SFKaiPlQ>FgnLx8daI{r>*>`udrfnRRt_b)w7f@bY)0%liBK-{I!B z(B_i5+)<9h`1$$!`~2(d@8aX=puE+cz~6VN)AaTB=IHC^>Fn|H^zQHR>g@0T|NmxY zX4~H5A^8LW002J#EC2ui02=@s000L6z@Kn9tT0{!&fvwU5TDQ=isP}lT7i};@5WrGQ%e>MZ4ETdC)>AY-Dp4Q;3q2Y;I5RAZi!(So8YBxIfkZ6> zg%Aca4xOH!GX@Vm3mRAu(2Z+IS&^N14Aeq3K~2X7AL~P!oa`?G8YOP zUq2s(IyeXjCe_x})7dyWJpdR#Gy)JYJUHg(=;`J%1quQQ3^qMC208Zk`1$q*5F{B4 z9whY8fd`L|g9sD)C}@CN4FMPc4CFzvqQ#3Axn1HAVBmp|2Na3~si#K(4iV?=Sjn=b z%a%8KToO=YRf?M_L@LCY0z!|fhYT{1fT5$P(W6L@!tlo+90UzFjOt8i^o9m^37i!w zaigo(uVA~D==M#@1T!!oKoF_6ty&m;n4xMwLPJ`&c-z9z5Tii^A_SiGAh805;lqew zthhi*#Hk@FJS-s5qri$1m@}7HQNYlG2$i0w_|U+NAq@pmYtV3}0|gPGp%92L0YC@J nXbi2H5aBT#6c{{Ya6useg)I><#D-JkNCXZMUVv}{CI|pKUwA;1 literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/topic_read_hot.gif b/sources/phpBB/styles/prosilver/theme/images/topic_read_hot.gif new file mode 100644 index 0000000000000000000000000000000000000000..dcb6f3bd60fa0397eb22bf686f5a9fbca112bc05 GIT binary patch literal 1469 zcmZvadpMH|9LHbQyNxlo?O4$<d13MjBIjC?u4d; zT#`y0omzEb&bl}uQWzD(+=sdBIO{oooSx_O-|xTg_w)JwoSYpkt^73r4WJJKg34Yx zF`tT-S3ZqTJs%W`#cKut z^_Jh$)0=VUFTvEz(fmJI>FLumbF*`cQ`56T;oRs)!Q8^4P&mK3D%OgAz#Eq#Pf~AtjBX7qS-7}xfFDwNI2XAd{y&wLly@fjL;N?lPb8|2wl3+3b0BEmm z1LXk-Fp=I;NDTmhZ*j__40jcs-|5IR?ry<(ipML z6E!}PkzFZ}Nl#ZXYffvr!|u#bB6SHWMmZ?#ZeI>PE&C=FOY*9TjkcvBSSxtJhpxK@ zj5h544RW@MaxV*U@VLI$fU?mWFI8A?J14m_{T98>?=!T0eW6%ztYl0T_S+u+lXHIpuDaIC))%%!LAR z{PpgMY-)o?0x>v%7paQiN4XD#i(Uy*FLeFA%*Yr$!ew>O%q+SM&ED>U;Etx&5z$mQ zlNnEw&CH5dm(8GpU>-y!)8yUVARHRf)R33Q{7RwPeJePMqZPugaKo_r<~qlsc3r(G znn?1keB;ONoY~vbGv8dNcNQVIx5Iz<%;W0TUoPsj|8D%F3&@+;I346qP)bo^5Ex3< zo>w5a3;b$sK%R$IVNs!nV_BKHC)pG9K!epaRUi)1lQ+_`(K3?PgT5+(kkTsv7%6=y zXJk&+N*kW0W{+cwu6O&fom6~pKV>u-M9|9zn&@GXvCjn~qLS~*6Y7zKzr!V7t925@ zFxbSG01j=J;Up3-WzrOG-<8)GI10Alajy?jGSdTmTOJzwj^W z8Jv;R?1S-f<<|n12sQB1nrpdfn{o6A-S?rJ$CwP13B0}WL;cFW(Do6S=sdw5KeqC4 zm?+$kn3$*}sU&+-jpKJi>5y^ymvBg#ijf+C2uf7bcx$M_^ai}Truw4I(XjfMggc?W zjW$1kAi1@zoq`E#pkt^AbVnx|@wF8s07`#COP|T1kAmm{5)t+`_JMZ*u zfcP=BAji;u=m#ys|9=^-joXW%U_9-m0=d~-zO3jPt{jpn z6i&r;(QuU!LQgns9H%S|^HiK$_j=vydfk2h`u_KMe;(X+@7lVJO$3O*Ybqe0m^_@< z;+NIj|6W;IR<`u#pE-2{6}Fyk$&F(lK0fW0D`#fs7d}r;DThYJ=H?e}F^{OOeVhO2 z*!YBE>dWHN?A&~&DJAk|Yhz=RbZ9g;H+Nb&Gyi$<{rJT2=!b}iA7vkB`F#Gms7Hoj z4_aRjnn%=jc6JTOM!I`t?Qf*RzqVef>YRMu`CDq?r^)G=*Zs2LF}ZxgIJ~BHU}CVT z<&UnnZ%3!*6;sUAra8sbTi+Yvvbf-+g-_KfQ?FB*he|IoO7;MPH;tg9Jpc^euLvTn9ZEcdIg+$QNZ{OYlhw#>zCu8-D zjfwpO#FY-#y6U>twpr$D3?N2NV-=IJhU-UkHyEOE5Cg;t3Tn1lFNYMDdeqiTE^cT@ zg22qN^CCv&K>@{MZBWyIY%$L`82F5xvV2w$Gd2@B$G7^!+WX^6E|%Q ziQFJck~{iHMGqm2y9Co$BMi3jMO{-}C+UvbN?B8)u@8Ycr2e2DkGFb9@cHS81g|M? zQm$jcwL~s_{M`<9lx{ix8B?!h@8`Bj+W{6sdrj91u0z7$ll3K4iI!3M+pm3j zGjXS=Q8dJS21A5%+O9c-`AHV+ZntDv?SJG0sXphffk$LpIE!zD=aByGRvmx=IsjJH zZJ4+~KG&@yXf_R!_?rvzN+L3%b&cMYC$N{!)l1Q$KEAR&2%NL5PD{ResAzV7IWI$F zWacJAc*G48?&1;^#c^{=qLRsOWE(-e8!9{da)?&mbrw1*GN8ci#0hsC%!5ufVi8ut zV8klQUgvKapa2HIsTg?TL3EZ$r~@qiq{RQ(rna$93$J_&yAIfNjYn?j30))aKi`yb z-?6SayNwj!;9SwY4J22;m`QP^k^!1M58zz{5>lvGKaM{e#Aaq?r>5I5$#j&kAll=2 zx(6O4m6Vp;rn%j_R|Hnk@ee>Wx`qzN86lsD)7QdQlblGaVQZQHBm0_8uz0XT&7GdA zQRsE7M=5;y!>uSk>&>k>uY2`&J(O1ZS{miGbyxR(#>EWSXc_=%OJmeu0u~;1FNeg@ z$gxxu^&CjzU*;##3_)T>W=5b^PHs*hK3|wmL({yNdokX~{iW0!<>))K|H$k79Za%# z@RO@fTnq^#GYh4V?J^@$PWfJI6tak&DXzZkP-pCsiG?=`6Cwr0Agb(6Sr9KeI3&RH zc35y|F!ehSU008%SuPjD1gQ4B)2z4)d=^=dMn7QUpkjOG#V1)?ieyFjAR$e$nKf{>3@wzvNU-_xu zsi~^*@$;adq3G!8>g(>Y&E_yLFxlJQI)T1_fPnAt@yg52+}+@gkB|NR{qywo*Vx+r z{{H6X=RSnM*4Nqh_xSz({CewhQR;- z|J&Z}IS-18IT|J^G6pYSL^BzL zF$9T=oDVq!F+K(XZ$lX~J~0{!tgWuCpe-R8LkklLDj*oU7z&#bj0(FTEeR8p0fZeI zyciE6(9k0iIlCGiJ`@2zI2RQ)AR6M#B_$l^XH#2|u$J`pGUDTLsoTL20^5GvFqqJ+H?5JzB8h|N;677%Qxv;l$x zv~w;+6kwqMgi4B|F8WwuqNfS(5Dm+f8&E)mg$E#duJB>$0uCP)eEw|6frkeV1&Ug@ zk<>(miWdgTU;v?mS)e>h3|QMBg;A~@ATW?Iuv@?g5c1j(aW!j-zeXSEiJ$_WlVm;^ zL|ANMK(xmVV7M?5fkC!yQf?)#Pyyi$78YPw2n_=Thz^#GQTmY~gbWo7Vnjgr!G&$x zA5O_}=hCWJkl1TQ=H=Xf3#F9uNzI5EV5(8Xt)~iakRJ8woxKC?EhA zmzf|dG%g$x94;|?KOrWPJqrMG(IOWAwmI?9=p*bN3xy~nGG-J&VgN%DDIjXB-~(O&Tpl!TBtZZn z0gxpGj66^viKGe;azYp}fSkVYo+KKukeQQYyOTavpje7xL`Qu17&IV}0laPtZ)J|FPWPQereFcM5pKB2q!2{pDSFkzdD zl@M+w>0UqGM+6E1%2WBFrh}jMaUv9u0mJ%yK36>8KnMv?-~|}+{WpaXNL;~$6aNJP F06Tz_Q6m5V literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/topic_read_mine.gif b/sources/phpBB/styles/prosilver/theme/images/topic_read_mine.gif new file mode 100644 index 0000000000000000000000000000000000000000..18a1245b93a053cd2f84f8ea088dcd592c71deca GIT binary patch literal 669 zcmV;O0%H9~Nk%w1VH*G&0M!5h`1$$v_xQ)$?c(I$At%SCh!U*6O5DWk-p^;o|4dJYO_@yvfwx{QUfsBR;3V*Xrr*?CtQe&E`6RzT?Ep zEqS{B{{GS7@bB>Q{r&y%$I&Wxxjuxz+kloPbhz^K_4U==A#%6<{{ESnnRRt_-{I!B z(dSW)#NWfp@bUBK(%1U?`}_U=_we#}snego+xYPEyu7^X?C5-pet1Ff#DJTWw(AvZA|5<>_K1|2!AE5X7m5Dpc_B*!ug zfhC17tO_dA)G9bJBoPM@Bqu!$96vS>0WvuX=;`VTIvd*&AvzQW4;BSAJvtZb>lZY~ zCn7|+5g5)#)cCCO!OGXp@G7NAVcQ(03!#C4>@-9XpyAQ z4h%3cM4b6BCI*cHM0Cu@qo>chpFn@=SSjIw4NM=BexNy1>4yLt9~?{pz{HNLShH%q zY65`40^Fe&lHCF8H z@Xcd=#7$}B=IZ+H@zuD*z&%~bca8h;^Wfs=`1twu_xQpi@66TT;pY1L``?QJ@A&!o?#a^o z`~25|mh0^A;^XM(x5DSKy~S2>@5|Kj(b&RAW%Tv-=IHC^>Fn|H^zQHR>g?~mJX`<& z|J&ZOEj&2q=;`X`F9!}81`#ekHwZcR`1$(x2o)Y0 z5g5pbmM2e-g9sD$D2Sk&fEf?~MB_oRqQ#3Ay9FSSfJHO~AQdPa8FG&g76~HK+rhG> z%a<;1_}G|104otVMT}IKQ$z)+9}gpF@UTLM(W6L{B3f;e9{j_yo&^ahG|27WyA z@!^KouVBM^{ooCplm!latf)|7B-^)aSNLf*#6}DcDAvN=`*sD24KZvGDUg7K4-6(& zC|=BXg$WF$PCXgHfP@Dh2TXj}%=v?f13os;uwiL(f*5HJp*X-A1&T8&WCVg!z{Uaq mDlVf5y(R?%RB+-j&~PFK02y1lln!3xh>ac$m^c9w1OPh(-aZTf literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/topic_unread_hot.gif b/sources/phpBB/styles/prosilver/theme/images/topic_unread_hot.gif new file mode 100644 index 0000000000000000000000000000000000000000..e712f6e827d99a120f3a9d44cf9d7dc9875b69b4 GIT binary patch literal 1431 zcmZvZeK^wz0LOouu@^6!8Rlgw&)luqdClwC&r3`al4l{K(RI?*BKKSoF{!nQC5+BB zFBhX!CwK9jm#Ks#>gv2D7hx>3@-}aCp8Mx|p6kEwf1mH?`=#&kb#`Hy04Bg|5SW#J zY;|Cay_de9oKY%Q=GZw)V^beLEi5c9P0QqyQdzTW_~P5~p4im!qMB!W%Z zWde6useBT0vbUgeV|hiTQYk*p%Vy^~k7cZ`t~F7DKFrR&8=q42_DftMRO{=iwe=S3 zkiowGF7~CN{*k^DSsNRwf#cyb>|trbKj#1S|gPS4N$aZ3Z`(6sI5OY-Or8HKu?udP%msO^gCt zlB{N_M!xleF!9c|BQ#`sm2@7!((G(3jAM+owP-MXD1MtjfQRbCXj+h=bAv+B9i1KR-EJ^@XGhQh!o#Wc zs}Bwh_K%=&LWqN|nbD)vR5ht|M%H6wrmJT_gUgncGC0jZ4`MY9UL=+o|Uto z0N$VtiNkw%mU(ed2DVX;J8j2(P$aEBE^B)!?;06v9D2D=-Cv*)<98cgTG{iHGh42= zf;Pyi7vaLpb~j*1>YY$?9L?q~RlL4Mz+x?14BhLGgYN=qFG&$s3>|y z64~7hK5+Z+;f+Ou=6h!#^6Nd#;}4B#3~cMNH3UrQk8etird8(dOkpO&v$8l$1dq>U zAedMp3`@TT56&u%(}Zfc+tpkv3h=XidORolWEY+(~6qv)dvxE!6b5Zf~@(fA28 zuR5aQZZ!LaEZH!!I&5a7@DEV^Ku^^1?l)G-j$6ZXO%K+al+`M-RXT^vj%3B)c>HW! zY%ct2UT(fWT393up_i1zVu@a*SsN(=*QybLjp7VZ|#7!&`m3qGrX0Mr1@f9(%S zL@>z#EnJhx?$vSE6uysiIV9q4>y1R#iI~s@>zZQoBXEFxPhS{`mrbR-gzCQM#r1O|Pv5 z2DoQtY6gIW_?7*L~rDf&VOF=}CSVg74YVW`(RFD)$iL3VnsQ&8 literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/topic_unread_hot_mine.gif b/sources/phpBB/styles/prosilver/theme/images/topic_unread_hot_mine.gif new file mode 100644 index 0000000000000000000000000000000000000000..fa8b167c644fcf6e3dde78236fb2bf8b7a38daf4 GIT binary patch literal 1364 zcmZ?wbhEHblxC1-xN6UE^UAFc=dQhZ_u=u8)8}mB&t^6K`}gnLqv!k0!oPg|_CCMw z$B&g}1vX&*m*IpdvmCZ+cAj8(fVBfj2yyd*I7_O#{iK74xe?A4d+_ny6Y zeJrZ<)th&hvs{4OJ>G~=6A3Z-7ly`pG z^1nZRe*f`vr?&6=kDqV#F8KBP_ru389?oC4Uq9&irR)Fx{JDSl)b|gceth_J^Zd0x zfByFCx_tQfd9O|M|NsAQ-+Qe1pWDwhB-q(8z|~04fSHkjfkE*n3o93cJ%bLA4fLcm z0|VRt1M>?sSXP+r4coLmkg+2`V?jfQhuci&G?h*TuALfROpIm2_H9vo8!hXzd2)n? z7i*T?gar#C57*qRm8h-bWPW0-%*n07$|ucZ$Nz+L%Jl^Ydu4_B1R5HY zTlgiV1rF>A*pSfQEunvEgQ3!q1|G$V9~=z{#~7K#Emp*wELz$<#U?1u-~#tSMtMD! z0s#eu#pm~RYgO)A5c%mD^E{8qTA{xjuJUwl)brT;;qvn<+jqiZo@m{3azlQoyg_hQq zP`^$eG=q7-VOnTUJYxI2hQ>NJ1^Ut0$dun)L zRBM?1l7)+OR<6?FUS-d>+?LOW&C1GPhk+Fvs#92i!7Kvwqa!fKS{&KXA-t&bL=K<5 z!E)inE5nxd&R5gUb=vpfeSo9hWJ~+LgtKw{`X4N6Zmhojes6ro&iB8Bof_(zTl}n? z(L4w-H4GYZOc&l?$u_IMz^@_Zyl_>RFY~FlMfMLil)q`6aXxKb(%HDlJ7p}={rY#u soU8eF_Ui9S8$JGpmWH}2#m=s7#r8^t2@@wN)WrcKZ00QP>5dH60HaAu3jhEB literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/topic_unread_locked.gif b/sources/phpBB/styles/prosilver/theme/images/topic_unread_locked.gif new file mode 100644 index 0000000000000000000000000000000000000000..0a9768ba7d2d0587c03dc6c432418c22a4b26f6c GIT binary patch literal 719 zcmV;=0xFVwI`ugGI z=;r9`$Xs{v^7QY^)XK}u?8D9E<>~eH_we!a;Ns@l+T6>2lfpz}*v-|`tGT~5R?^ef z&0~Gu;N-+iY5MN*p?ZVWxWwJw;Ogw}z&u>Zca8h;^MhAm!o$Y%^!3J6aMN;$;^O1> z_xRS>+Nyzy_xSnn=j-qA^52@P;^gP~?C<*f`{?ND(uGk95uebXMdK;V0+7IL8tE9 z01cdYP=N+I1QGzODB(eXj|O=nM(AMxUU^T@q3V9?>H#hyjT2 zN*$3RVZ98^o+Xe#c>;lJmjh73{4nEf~fplu7S zH*m1ny&H$?7PV^;!9Wv$4HzxnHkiPCg5Fu9N)0LC!GR>>39@TXVB@-j3$lq6&=A1P zq1xyr`KTcv5F9ZaAkl9Z@V1JS>Fe$J`ufg+mdIRp@6FZm^7Q8D>-F{b@bUBS$kN}#%Gui7 z)2q4P;pLblKhV+B`tbA1f0V0RZrIJ$p?ZV)?eO!|+s|Zv)V9Li-r?%(@5*J`QC6tDMz!BGd3E8Xib28H5d*Mgbo!oJ~|#E9w#0;5kny^6g~zs z76Kicn*tUWGztd=VJ3S&8aO6CFc1Q-u(1FaWTP1YLpTYn7H7V{z84+`0S7!b9aSeF z1}eas9Vwjv6&e{n2qpJp#lrwBOrnGkvx1NR1WB${Sho(s19JP0_8{>=0EBfbGaNYZvc-(6Ga!u2 zm#+Z{lPMrvT?v$9LabRw?vp{HEm*NLF0gd5;)Q_-Eh^~M8nJ=j1`OU-Xb~afig?T} zv{t<8 literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/images/topic_unread_mine.gif b/sources/phpBB/styles/prosilver/theme/images/topic_unread_mine.gif new file mode 100644 index 0000000000000000000000000000000000000000..4ca8492e74d51a5b2b74a43c1ecfc286ebb9a418 GIT binary patch literal 678 zcmV;X0$Ke>Nk%w1VH*G&0M!5h`1$$iyT;<==-!s7&ViQGtGU2DT*zE^_~Yp2=x|{r&y$ z@$=`>*ZTYW`0(=QvAxbbU-qZE)JkjGW`e;$U&2Rak1a&%?Cs4k}7~$PmNFjy!pKNSr7Uf(QmWL{QLi!UqHr1{OHXL9(RDk}X=~XfYzk z4j%y|NOS0+rU!~RCEE1RQGtWQko$ND9ZIw)Q5`TPkbt0Rgwqi@aXuZE2=+Gf2;lqR@ zZFr_CfC?6a5lcP{fQ5+wH;7D_8R7+i&!9sCcoD*f&s0MQWKf{OM+MKKM_2G+LctAa zPY5^&VCE2u3cy*gII|&!1Kd!=U|6uBH5%G$4rD+LCxU?tB?iP`5MxUQ8_3}lIdY>% Mh653tfC&NsJ8&sL3IG5A literal 0 HcmV?d00001 diff --git a/sources/phpBB/styles/prosilver/theme/imageset.css b/sources/phpBB/styles/prosilver/theme/imageset.css new file mode 100644 index 0000000..5cd9134 --- /dev/null +++ b/sources/phpBB/styles/prosilver/theme/imageset.css @@ -0,0 +1,376 @@ +/* Former imageset */ +span.imageset { + display: inline-block !important; + background: transparent none 0 0 no-repeat; + margin: 0; + padding: 0; + width: 0; + height: 0; + overflow: hidden; +} + +/* Global imageset items */ +.imageset.site_logo { + background-image: url("./images/site_logo.gif"); + padding-left: 149px; + padding-top: 52px; +} +.imageset.forum_link { + background-image: url("./images/forum_link.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.forum_read { + background-image: url("./images/forum_read.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.forum_read_locked { + background-image: url("./images/forum_read_locked.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.forum_read_subforum { + background-image: url("./images/forum_read_subforum.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.forum_unread { + background-image: url("./images/forum_unread.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.forum_unread_locked { + background-image: url("./images/forum_unread_locked.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.forum_unread_subforum { + background-image: url("./images/forum_unread_subforum.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.topic_moved { + background-image: url("./images/topic_moved.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.topic_read { + background-image: url("./images/topic_read.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.topic_read_mine { + background-image: url("./images/topic_read_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.topic_read_hot { + background-image: url("./images/topic_read_hot.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.topic_read_hot_mine { + background-image: url("./images/topic_read_hot_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.topic_read_locked { + background-image: url("./images/topic_read_locked.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.topic_read_locked_mine { + background-image: url("./images/topic_read_locked_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.topic_unread { + background-image: url("./images/topic_unread.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.topic_unread_mine { + background-image: url("./images/topic_unread_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.topic_unread_hot { + background-image: url("./images/topic_unread_hot.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.topic_unread_hot_mine { + background-image: url("./images/topic_unread_hot_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.topic_unread_locked { + background-image: url("./images/topic_unread_locked.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.topic_unread_locked_mine { + background-image: url("./images/topic_unread_locked_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.sticky_read { + background-image: url("./images/sticky_read.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.sticky_read_mine { + background-image: url("./images/sticky_read_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.sticky_read_locked { + background-image: url("./images/sticky_read_locked.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.sticky_read_locked_mine { + background-image: url("./images/sticky_read_locked_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.sticky_unread { + background-image: url("./images/sticky_unread.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.sticky_unread_mine { + background-image: url("./images/sticky_unread_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.sticky_unread_locked { + background-image: url("./images/sticky_unread_locked.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.sticky_unread_locked_mine { + background-image: url("./images/sticky_unread_locked_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.announce_read { + background-image: url("./images/announce_read.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.announce_read_mine { + background-image: url("./images/announce_read_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.announce_read_locked { + background-image: url("./images/announce_read_locked.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.announce_read_locked_mine { + background-image: url("./images/announce_read_locked_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.announce_unread { + background-image: url("./images/announce_unread.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.announce_unread_mine { + background-image: url("./images/announce_unread_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.announce_unread_locked { + background-image: url("./images/announce_unread_locked.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.announce_unread_locked_mine { + background-image: url("./images/announce_unread_locked_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.global_read { + background-image: url("./images/announce_read.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.global_read_mine { + background-image: url("./images/announce_read_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.global_read_locked { + background-image: url("./images/announce_read_locked.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.global_read_locked_mine { + background-image: url("./images/announce_read_locked_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.global_unread { + background-image: url("./images/announce_unread.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.global_unread_mine { + background-image: url("./images/announce_unread_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.global_unread_locked { + background-image: url("./images/announce_unread_locked.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.global_unread_locked_mine { + background-image: url("./images/announce_unread_locked_mine.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.subforum_read { + background-image: url("./images/subforum_read.gif"); + padding-left: 11px; + padding-top: 9px; +} +.imageset.subforum_unread { + background-image: url("./images/subforum_unread.gif"); + padding-left: 11px; + padding-top: 9px; +} +.imageset.pm_read { + background-image: url("./images/topic_read.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.pm_unread { + background-image: url("./images/topic_unread.gif"); + padding-left: 27px; + padding-top: 27px; +} +.imageset.icon_back_top { + background-image: url("./images/icon_back_top.gif"); + padding-left: 11px; + padding-top: 11px; +} +.imageset.phpbb_aol-icon, .imageset.icon_contact_aim { + background-image: url("./images/icon_contact_aim.gif"); + padding-left: 20px; + padding-top: 20px; +} +.imageset.icon_contact_email { + background-image: url("./images/icon_contact_email.gif"); + padding-left: 20px; + padding-top: 20px; +} +.imageset.icon_contact_icq, .imageset.phpbb_icq-icon { + background-image: url("./images/icon_contact_icq.gif"); + padding-left: 20px; + padding-top: 20px; +} +.imageset.icon_contact_jabber { + background-image: url("./images/icon_contact_jabber.gif"); + padding-left: 20px; + padding-top: 20px; +} +.imageset.phpbb_wlm-icon, .imageset.icon_contact_msnm { + background-image: url("./images/icon_contact_msnm.gif"); + padding-left: 20px; + padding-top: 20px; +} +.imageset.icon_contact_www, .imageset.phpbb_website-icon { + background-image: url("./images/icon_contact_www.gif"); + padding-left: 20px; + padding-top: 20px; +} +.imageset.icon_contact_yahoo, .imageset.phpbb_yahoo-icon { + background-image: url("./images/icon_contact_yahoo.gif"); + padding-left: 20px; + padding-top: 20px; +} +.imageset.icon_post_delete { + background-image: url("./images/icon_post_delete.gif"); + padding-left: 20px; + padding-top: 20px; +} +.imageset.icon_post_info { + background-image: url("./images/icon_post_info.gif"); + padding-left: 20px; + padding-top: 20px; +} +.imageset.icon_post_report { + background-image: url("./images/icon_post_report.gif"); + padding-left: 20px; + padding-top: 20px; +} +.imageset.icon_post_target { + background-image: url("./images/icon_post_target.gif"); + padding-left: 11px; + padding-top: 9px; +} +.imageset.icon_post_target_unread { + background-image: url("./images/icon_post_target_unread.gif"); + padding-left: 11px; + padding-top: 9px; +} +.imageset.icon_topic_attach { + background-image: url("./images/icon_topic_attach.gif"); + padding-left: 7px; + padding-top: 10px; +} +.imageset.icon_topic_latest { + background-image: url("./images/icon_topic_latest.gif"); + padding-left: 11px; + padding-top: 9px; +} +.imageset.icon_topic_newest { + background-image: url("./images/icon_topic_newest.gif"); + padding-left: 11px; + padding-top: 9px; +} +.imageset.icon_topic_reported { + background-image: url("./images/icon_topic_reported.gif"); + padding-left: 16px; + padding-top: 14px; +} +.imageset.icon_topic_deleted { + background-image: url("./images/icon_topic_deleted.png"); + padding-left: 16px; + padding-top: 14px; +} +.imageset.icon_topic_unapproved { + background-image: url("./images/icon_topic_unapproved.gif"); + padding-left: 16px; + padding-top: 14px; +} +.imageset.icon_topic_poll { + background-image: url("./images/icon_topic_poll.gif"); + padding-left: 11px; + padding-top: 10px; +} +.imageset.icon_user_warn { + background-image: url("./images/icon_user_warn.gif"); + padding-left: 20px; + padding-top: 20px; +} + +.imageset.icon_contact { + background-image: url("./images/icon_contact.png"); + padding-left: 16px; + padding-top: 12px; +} + + +/* English images for fallback */ +.imageset.icon_user_online { + background-image: url("./en/icon_user_online.gif"); + padding-left: 58px; + padding-top: 58px; +} diff --git a/sources/phpBB/styles/prosilver/theme/index.htm b/sources/phpBB/styles/prosilver/theme/index.htm new file mode 100644 index 0000000..e69de29 diff --git a/sources/phpBB/styles/prosilver/theme/links.css b/sources/phpBB/styles/prosilver/theme/links.css new file mode 100644 index 0000000..a2f5124 --- /dev/null +++ b/sources/phpBB/styles/prosilver/theme/links.css @@ -0,0 +1,212 @@ +/* Link Styles +---------------------------------------- */ + +/* Links adjustment to correctly display an order of rtl/ltr mixed content */ +a { + direction: ltr; + unicode-bidi: embed; + text-decoration: none; +} + +a:hover { text-decoration: underline; } + +/* Coloured usernames */ +.username-coloured { + font-weight: bold; + display: inline !important; + padding: 0 !important; +} + +/* Links on gradient backgrounds */ +.forumbg .header a, .forabg .header a, th a { + text-decoration: none; +} + +.forumbg .header a:hover, .forabg .header a:hover, th a:hover { + text-decoration: underline; +} + +/* Navigation bar links */ +li.breadcrumbs span:first-child > a { + display: inline-block; + padding-left: 17px; +} + +/* Notification mark read link */ +.dropdown-extended a.mark_read { + background-position: center center; + background-repeat: no-repeat; + border-radius: 3px 0 0 3px; + display: none; + margin-top: -20px; + position: absolute; + z-index: 2; + right: 0; + top: 50%; + width: 30px; + height: 40px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.dropdown-extended li:hover a.mark_read { + display: block; +} + +.dropdown-extended a.mark_read:hover { + width: 40px; +} + +/* Links for forum/topic lists */ +a.forumtitle { + font-family: "Trebuchet MS", Helvetica, Arial, Sans-serif; + font-size: 1.2em; + font-weight: bold; + text-decoration: none; +} + +a.forumtitle:hover { + text-decoration: underline; +} + +a.topictitle { + font-family: "Trebuchet MS", Helvetica, Arial, Sans-serif; + font-size: 1.2em; + font-weight: bold; + text-decoration: none; +} + +a.topictitle:hover { + text-decoration: underline; +} + +a.lastsubject { + font-weight: bold; + text-decoration: none; +} + +a.lastsubject:hover { + text-decoration: underline; +} + +/* Post body links */ +.postlink { + text-decoration: none; + border-bottom: 1px solid transparent; + padding-bottom: 0; +} + +.postlink:hover { + text-decoration: none; +} + +.signature a, .signature a:hover { + border: none; + text-decoration: underline; +} + +/* Profile links */ +.postprofile a, .postprofile dt.author a { + font-weight: bold; + text-decoration: none; +} + +.postprofile a:hover, .postprofile dt.author a:hover { + text-decoration: underline; +} + +/* Profile searchresults */ +.search .postprofile a { + text-decoration: none; + font-weight: normal; +} + +.search .postprofile a:hover { + text-decoration: underline; +} + +/* Back to top of page */ +.back2top { + clear: both; + height: 11px; + text-align: right; +} + +a.top { + background: none no-repeat top left; + text-decoration: none; + width: 11px; + height: 11px; + display: block; + float: right; + overflow: hidden; + letter-spacing: 1000px; + text-indent: 11px; +} + +a.top2 { + background: none no-repeat 0 50%; + text-decoration: none; + padding-left: 15px; +} + +/* Arrow links */ +a.arrow-up { background: none no-repeat left center; } +a.arrow-down { background: none no-repeat right center; } +a.arrow-left { background: none no-repeat 3px 60%; } +a.arrow-right { background: none no-repeat 95% 60%; } + +a.arrow-up { + padding-left: 10px; + text-decoration: none; + border-bottom-width: 0; +} + +a.arrow-up:hover { + background-position: left top; +} + +a.arrow-down { + padding-right: 10px; +} + +a.arrow-down:hover { + background-position: right bottom; + text-decoration: none; +} + +a.arrow-left { + padding-left: 12px; +} + +a.arrow-left:hover { + text-decoration: none; + background-position: 0 60%; +} + +a.arrow-right { + padding-right: 12px; +} + +a.arrow-right:hover { + text-decoration: none; + background-position: 100% 60%; +} + +/* invisible skip link, used for accessibility */ +.skiplink { + position: absolute; + left: -999px; + width: 990px; +} + +/* Feed icon in forumlist_body.html */ +a.feed-icon-forum { + float: right; + margin: 3px; +} + +a.anchor { + display: block; +} diff --git a/sources/phpBB/styles/prosilver/theme/plupload.css b/sources/phpBB/styles/prosilver/theme/plupload.css new file mode 100644 index 0000000..7d4092c --- /dev/null +++ b/sources/phpBB/styles/prosilver/theme/plupload.css @@ -0,0 +1,81 @@ +#attach-panel-multi { + display: none; + margin-bottom: 1em; +} + +#file-list td { + vertical-align: middle; +} + +.attach-name { + width: 50%; +} + +.attach-comment { + width: 30%; +} + +.attach-filesize { + width: 15%; +} + +.attach-status { + width: 5%; +} + +.attach-filesize, .attach-status { + text-align: center; +} + +.attach-controls { + display: inline-block; + float: right; +} + +#attach-row-tpl, .nojs .file-inline-bbcode { + display: none; +} + +#file-total-progress { + height: 2px; + display: block; + position: relative; + margin: 4px -10px -6px -10px; +} + +.file-progress { + background-color: #CCCCCC; + display:inline-block; + height: 8px; + width: 50px; +} + +.file-progress-bar, #file-total-progress-bar { + background-color: green; + display: block; + height: 100%; + width: 0; +} + +.file-status.file-working { + background: url('./images/plupload/throbber.gif'); +} + +.file-status.file-uploaded { + background: url('./images/plupload/done.gif'); +} + +.file-status.file-error { + background: url('./images/plupload/error.gif'); +} + +.file-status { + display: inline-block; + height: 16px; + width: 16px; +} + +.file-name { + max-width: 65%; + vertical-align: bottom; +} diff --git a/sources/phpBB/styles/prosilver/theme/print.css b/sources/phpBB/styles/prosilver/theme/print.css new file mode 100644 index 0000000..34129c9 --- /dev/null +++ b/sources/phpBB/styles/prosilver/theme/print.css @@ -0,0 +1,139 @@ +/* Print Style Sheet +---------------------------------------- */ + + +/* Lots still TODO here! */ + +/* General markup styles */ +* { + padding: 0; + margin: 0; +} + +body { + font: 11pt Verdana, Arial, Helvetica, sans-serif; + color:#000000; +} + +a:link { color: #000000; text-decoration: none; } +a:visited { color: #000000; text-decoration: none; } +a:active { color: #000000; text-decoration: none; } + +img, .noprint, #sub-header, #sub-footer, .navbar, .box1, .divider, .signature { display: none; } +/* Display smilies (Bug #47265) */ +.content img { + display: inline; +} + +/* Container for the main body */ +#wrap { + margin: 0 2em; +} + +p { font-size: 85%; } +.copyright { font-size: 75%; } +.page-number { float:right; width: auto; text-align: right; font-size: 75%; } + +h1, h2, h3, h1 a, h2 a, h3 a { + font-family: "Trebuchet MS",georgia,Verdana,Sans-serif; + color: #000000; + background: none; + text-decoration: none; + font-weight: bold; +} + +h1 { font-size: 20pt; } +h2 { font-size: 16pt; margin-top: 1em; } +h3 { font-size: 14pt; margin-top: 1em; } + +.content { + font-size: 11pt; + line-height: 14pt; + margin-bottom: 1em; + font-family: "Lucida Grande", "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; + overflow: hidden; +} + +/* CSS2 Print tip from: http://www.alistapart.com/articles/goingtoprint/ */ +.postbody a:link, .postbody a:visited, .postbody a:hover, .postbody a:active { + text-decoration: underline; + padding: 0.1em 0.2em; + margin: -0.1em -0.2em; + color: #666; + background: none; + font-size: 100%; +} + +html>body .postbody a:link:after, html>body .postbody a:visited:after { + content: " (" attr(href) ") "; + font-size: 90%; + text-decoration: none; +} + +hr { + height: 1px; + background-color: #999999; + border-width: 0; +} + +.author { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 75%; + margin-bottom: 0.6em; +} + +.date { + font-family: Verdana, Arial, Helvetica, sans-serif; + float: right; + position: relative; + text-align: right; + font-size: 75%; +} + +/* Dont want to print url for names or titles in content area */ +.postbody .author a:link, .postbody .author a:visited, +html>body .postbody .author a:link:after, +html>body .postbody .author a:visited:after, +.postquote .quote-by a:link, .postquote .quote-by a:visited, +html>body .postquote .quote-by a:link:after, +html>body .postquote .quote-by a:visited:after, +html>body .postbody h1 a:link:after, html>body .postbody h2 a:link:after { + text-decoration: none; + content: ""; +} + +/* Poster profile */ +.postprofile { display: none; } +.grip-show { display:none; } + +/* Quote */ +.postquote, blockquote { + font-size: 85%; + margin: 1em 18% 1em 4%; + padding: 0.5em; + position: relative; + line-height: 1.5em; + border: 1px #999999 solid; +} + +.postquote img { display: none; } +.postquote span { display: block; } +.postquote span .postquote { font-size: 100%; } +.quote-by, blockquote cite { + color: black; + display : block; + font-weight: bold; +} + +/* List */ +ol, ul { + margin-left: 15pt +} + +/* Misc page elements */ +div.spacer { clear: both; } + +/* Accessibility tweaks: Mozilla.org */ +.skip_link { display: none; } + +.codebox p { display: none; } diff --git a/sources/phpBB/styles/prosilver/theme/responsive.css b/sources/phpBB/styles/prosilver/theme/responsive.css new file mode 100644 index 0000000..8653042 --- /dev/null +++ b/sources/phpBB/styles/prosilver/theme/responsive.css @@ -0,0 +1,574 @@ +/* Responsive Design +---------------------------------------- */ + +.responsive-hide { display: none !important; } +.responsive-show { display: block !important; } +.responsive-show-inline { display: inline !important; } +.responsive-show-inline-block { display: inline-block !important; } + +/* Content wrappers +----------------------------------------*/ +html { + height: auto; +} + +body { + padding: 0; +} + +#wrap { + border: none; + border-radius: 0; + margin: 0; + min-width: 290px; + padding: 0 5px; +} + +/* Common block wrappers +----------------------------------------*/ +.headerbar, .navbar, .forabg, .forumbg, .post, .panel { + border-radius: 0; + margin-left: -5px; + margin-right: -5px; +} + +#cp-main .forabg, #cp-main .forumdb, #cp-main .post, #cp-main .panel { + border-radius: 7px; +} + +/* Logo block +----------------------------------------*/ +#site-description { + float: none; + width: auto; + text-align: center; +} + +.logo { + /* change display value to inline-block to show logo */ + display: none; + float: none; + padding: 10px; +} + +#site-description h1, #site-description p { + text-align: inherit; + float: none; + margin: 5px; + line-height: 1.2em; + overflow: hidden; + text-overflow: ellipsis; +} + +#site-description p, .search-header { + display: none; +} + +/* Navigation +----------------------------------------*/ +.headerbar + .navbar { + margin-top: -5px; +} + +/* Search +----------------------------------------*/ +.responsive-search { display: block !important; } +.responsive-search a { + display: block; + width: 16px; + height: 22px; + text-indent: 99px; + overflow: hidden; + background-position: 50% 50%; + background-repeat: no-repeat; + text-decoration: none; +} + +/* .topiclist lists +----------------------------------------*/ +li.header dt { + text-align: center; + text-transform: none; + line-height: 1em; + font-size: 1.2em; + padding-bottom: 4px; +} + +ul.topiclist li.header dt, ul.topiclist li.header dt .list-inner { + margin-right: 0 !important; + padding-right: 0; +} + +ul.topiclist li.header dd { + display: none !important; +} + +ul.topiclist dt, ul.topiclist dt .list-inner, +ul.topiclist.missing-column dt, ul.topiclist.missing-column dt .list-inner, +ul.topiclist.two-long-columns dt, ul.topiclist.two-long-columns dt .list-inner, +ul.topiclist.two-columns dt, ul.topiclist.two-columns dt .list-inner { + margin-right: 0; +} + +ul.topiclist dt .list-inner.with-mark { + padding-right: 34px; +} + +ul.topiclist dt .list-inner { + min-height: 28px; +} + +ul.topiclist li.header dt .list-inner { + min-height: 0; +} + +ul.topiclist dd { + display: none; +} +ul.topiclist dd.mark { + display: block; +} + +/* Forums and topics lists +----------------------------------------*/ +ul.topiclist.forums dt { + margin-right: -250px; +} +ul.topiclist.forums dt .list-inner { + margin-right: 250px; +} + +ul.topiclist.forums dd.lastpost { + display: block; +} + +ul.topiclist dd.mark { + display: block; + position: absolute; + right: 5px; + top: 0; + margin: 0; + width: auto; + min-width: 0; + text-align: left; +} + +ul.topiclist.forums dd.topics dfn, ul.topiclist.topics dd.posts dfn { + position: relative; + left: 0; + width: auto; + display: inline; + font-weight: normal; +} + +@media only screen and (max-width: 550px), only screen and (max-device-width: 550px) { + ul.topiclist.forums dt { + margin-right: 0; + } + + ul.topiclist.forums dt .list-inner { + margin-right: 0; + } + + ul.topiclist.forums dd.lastpost { + display: none; + } +} + +li.row .responsive-show strong { + font-weight: bold; + color: inherit; +} + +ul.topiclist li.row dt a.subforum { + display: inline-block; + vertical-align: bottom; + overflow: hidden; + text-overflow: ellipsis; + max-width: 100px; +} + +/* Notifications list +----------------------------------------*/ +@media only screen and (max-width: 350px), only screen and (max-device-width: 350px) { + .dropdown-extended .dropdown-contents { + width: auto; + } +} + +/* Pagination +----------------------------------------*/ +.pagination > ul { + margin: 5px 0 0; +} + +.row .pagination .ellipsis + li { + display: none !important; +} + +/* Responsive tables +----------------------------------------*/ +table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { + display: block; +} + +table.responsive thead, table.responsive th { + display: none; +} + +table.responsive.show-header thead, table.responsive.show-header th:first-child { + display: block; + width: auto !important; + text-align: left !important; +} + +table.responsive.show-header th:first-child span.rank-img { + display: none; +} + +table.responsive tr { + margin: 2px 0; +} + +table.responsive td { + width: auto !important; + text-align: left !important; + padding: 4px; +} + +table.responsive td.empty { + display: none !important; +} + +table.responsive td > dfn { + display: inline-block !important; +} + +table.responsive td > dfn:after { + content: ':'; + padding-right: 5px; +} + +table.responsive span.rank-img { + float: none; + padding-right: 5px; +} + +table.responsive#memberlist td:first-child input[type="checkbox"] { + float: right; +} + +/* Forms +----------------------------------------*/ +fieldset dt, fieldset.fields1 dt, fieldset.fields2 dt { + width: auto; + float: none; +} + +fieldset dd, fieldset.fields1 dd, fieldset.fields2 dd { + margin-left: 20px; +} + +textarea, dd textarea, #message-box textarea { + width: 100%; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +dl.pmlist dt { + width: auto !important; + margin-bottom: 5px; +} + +dl.pmlist dd { + display: inline-block; + margin-left: 0 !important; +} + +dl.pmlist dd:first-of-type { + padding-left: 20px; +} + +#smiley-box, #message-box { + float: none; + width: auto; +} + +#smiley-box { + margin-top: 5px; +} + +.bbcode-status { + display: none; +} + +.colour-palette, .colour-palette tbody, .colour-palette tr { + display: block; +} + +.colour-palette td { + display: inline-block; + margin-right: 2px; +} + +.horizontal-palette td:nth-child(2n), .vertical-palette tr:nth-child(2n) { + display: none; +} + +.colour-palette a { + display: inline-block !important; +} + +fieldset.quick-login label { + display: block; + margin-bottom: 5px; + white-space: normal; +} + +fieldset.quick-login label > span { + display: inline-block; + min-width: 100px; +} + +fieldset.quick-login input.inputbox { + width: 85%; + max-width: 300px; + margin-left: 20px; +} + +fieldset.quick-login label[for="autologin"] { + display: inline-block; + text-align: right; + min-width: 50%; +} + +@media only screen and (max-width: 500px), only screen and (max-device-width: 500px) { + dd label { + white-space: normal; + } + + select, .inputbox { + max-width: 260px; + } + + .captcha-panel dd.captcha { + margin-left: 0; + } + + .captcha-panel dd.captcha-image img { + width: 100%; + } + + #recaptcha_challenge_image, + #recaptcha_response_field, + .recaptchatable #recaptcha_image { + width: 100% !important; + height: auto !important; + } + + .recaptchatable tr td:last-child { + display: none; + } + + .captcha-panel .recaptcha-responsive { + display: inline-block !important; + margin-top: 10px; + vertical-align: middle; + } +} + +@media only screen and (max-width: 430px), only screen and (max-device-width: 430px) { + .section-viewtopic .search-box .inputbox { + width: 110px; + } +} + +@media only screen and (max-width: 320px), only screen and (max-device-width: 320px) { + select, .inputbox { + max-width: 240px; + } +} + +/* User profile +----------------------------------------*/ +.column1, .column2, .left-box.profile-details { + float: none; + width: auto; +} + +@media only screen and (max-width: 500px), only screen and (max-device-width: 500px) { + dl.details dt, dl.details dd { + width: auto; + float: none; + text-align: left; + } + + dl.details dd { + margin-left: 20px; + } +} + +/* Polls +----------------------------------------*/ +fieldset.polls dt { + width: 90%; +} + +fieldset.polls dd.resultbar { + padding-left: 20px; +} + +fieldset.polls dd.poll_option_percent { + width: 20%; +} + +fieldset.polls dd.resultbar, fieldset.polls dd.poll_option_percent { + margin-top: 5px; +} + +/* Post +----------------------------------------*/ +.postbody { + position: inherit; +} + +.postprofile, .postbody, .search .postbody { + display: block; + width: auto; + float: none; + padding: 0; + min-height: 0; +} + +.post .postprofile { + width: auto; + border-width: 0 0 1px 0; + padding-bottom: 5px; + margin: 0; + margin-bottom: 5px; + min-height: 40px; + overflow: hidden; +} + +.postprofile dd { + display: none; +} + +.postprofile dt, .postprofile dd.profile-rank, .search .postprofile dd { + display: block; + margin: 0; +} + +.postprofile .has-avatar .avatar-container { + margin: 0; + overflow: inherit; +} + +.postprofile .avatar-container:after { + clear: none; +} + +.postprofile .avatar { + margin-right: 5px; +} + +.postprofile .avatar img { + width: auto !important; + height: auto !important; + max-height: 32px; +} + +.has-profile .postbody h3 { + margin-left: 0 !important; + margin-right: 0 !important; +} + +.has-profile .post-buttons { + right: 20px; + top: 15px; +} + +.online { + background-size: 40px; +} + +/* Misc stuff +----------------------------------------*/ +h2 { + margin-top: .5em; +} + +p { + margin-bottom: .5em; + overflow: hidden; +} + +p.rightside { + margin-bottom: 0; +} + +fieldset.display-options label { + display: block; + clear: both; + margin-bottom: 5px; +} + +dl.mini dd.pm-legend { + float: left; + min-width: 200px; +} + +#topicreview { + margin: 0 -5px; + padding: 0 5px; +} + +fieldset.display-actions { + white-space: normal; +} + +.phpbb_alert { + width: auto; + margin: 0 5px; +} + +.attach-comment dfn { + width: 100%; +} + +@media only screen and (max-width: 500px), only screen and (max-device-width: 500px) { + p.responsive-center { + float: none; + text-align: center; + margin-bottom: 5px; + } + + .action-bar > div { + margin-bottom: 5px; + } + + .action-bar > .pagination { + float: none; + clear: both; + padding-bottom: 1px; + text-align: center; + } + + .action-bar > .pagination li.page-jump { + margin: 0 2px; + } + + p.jumpbox-return { + display: none; + } + + .display-options > label:nth-child(1) { + display: block; + margin-bottom: 5px; + } + + .attach-controls { + margin-top: 5px; + width: 100%; + } +} diff --git a/sources/phpBB/styles/prosilver/theme/stylesheet.css b/sources/phpBB/styles/prosilver/theme/stylesheet.css new file mode 100644 index 0000000..77c7c88 --- /dev/null +++ b/sources/phpBB/styles/prosilver/theme/stylesheet.css @@ -0,0 +1,17 @@ +/* phpBB3 Style Sheet + -------------------------------------------------------------- + Style name: prosilver (the default phpBB 3.1.x style) + Based on style: + Original author: Tom Beddard ( http://www.subblue.com/ ) + Modified by: phpBB Limited ( https://www.phpbb.com/ ) + -------------------------------------------------------------- +*/ + +@import url("common.css"); +@import url("links.css"); +@import url("content.css"); +@import url("buttons.css"); +@import url("cp.css"); +@import url("forms.css"); +@import url("colours.css"); +@import url("imageset.css"); diff --git a/sources/phpBB/styles/prosilver/theme/tweaks.css b/sources/phpBB/styles/prosilver/theme/tweaks.css new file mode 100644 index 0000000..d2dad9e --- /dev/null +++ b/sources/phpBB/styles/prosilver/theme/tweaks.css @@ -0,0 +1,29 @@ +/* Style Sheet Tweaks + +These style definitions are IE 8 & 9 only. +They are required due to the poor CSS support in IE browsers. +------------------------------------------------------------------------------*/ + +/* IE 8 Tweaks (value)\9 equates to IE <= 8 +------------------------------------------------------------------------------*/ + +/* Clear float fix */ +.inner, ul.linklist { zoom: 1\9; } + +/* Align checkboxes/radio buttons nicely */ +dd label input { vertical-align: text-bottom\9; } + +/* Fixes header-avatar aspect-ratio */ +.header-avatar img { height: 20px\9; } + +/* IE8 often can't handle max-width in %, so we use px instead */ +.postprofile .avatar img { max-width: 150px\9; } + + +/* IE 9 Tweaks +------------------------------------------------------------------------------*/ + +/* Border-radius bleed fix in IE9 */ +.search-header, .search-header .inputbox, .search-header a.button { + border-radius: 0; +} diff --git a/sources/phpBB/ucp.php b/sources/phpBB/ucp.php new file mode 100644 index 0000000..8c74ca1 --- /dev/null +++ b/sources/phpBB/ucp.php @@ -0,0 +1,375 @@ + +* @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); +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +require($phpbb_root_path . 'common.' . $phpEx); +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', ''); + +if (in_array($mode, array('login', 'login_link', 'logout', 'confirm', 'sendpassword', 'activate'))) +{ + define('IN_LOGIN', true); +} + +// Start session management +$user->session_begin(); +$auth->acl($user->data); +$user->setup('ucp'); + +// Setting a variable to let the style designer know where he is... +$template->assign_var('S_IN_UCP', true); + +$module = new p_master(); +$default = false; + +// Basic "global" modes +switch ($mode) +{ + case 'activate': + $module->load('ucp', 'activate'); + $module->display($user->lang['UCP_ACTIVATE']); + + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); + break; + + case 'resend_act': + $module->load('ucp', 'resend'); + $module->display($user->lang['UCP_RESEND']); + break; + + case 'sendpassword': + $module->load('ucp', 'remind'); + $module->display($user->lang['UCP_REMIND']); + break; + + case 'register': + if ($user->data['is_registered'] || isset($_REQUEST['not_agreed'])) + { + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); + } + + $module->load('ucp', 'register'); + $module->display($user->lang['REGISTER']); + break; + + case 'confirm': + $module->load('ucp', 'confirm'); + break; + + case 'login': + if ($user->data['is_registered']) + { + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); + } + + login_box(request_var('redirect', "index.$phpEx")); + break; + + case 'login_link': + if ($user->data['is_registered']) + { + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); + } + + $module->load('ucp', 'login_link'); + $module->display($user->lang['UCP_LOGIN_LINK']); + break; + + case 'logout': + if ($user->data['user_id'] != ANONYMOUS && $request->is_set('sid') && $request->variable('sid', '') === $user->session_id) + { + $user->session_kill(); + } + else if ($user->data['user_id'] != ANONYMOUS) + { + meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); + + $message = $user->lang['LOGOUT_FAILED'] . '

' . sprintf($user->lang['RETURN_INDEX'], '
', ' '); + trigger_error($message); + } + + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); + break; + + case 'terms': + case 'privacy': + + $message = ($mode == 'terms') ? 'TERMS_OF_USE_CONTENT' : 'PRIVACY_POLICY'; + $title = ($mode == 'terms') ? 'TERMS_USE' : 'PRIVACY'; + + if (empty($user->lang[$message])) + { + if ($user->data['is_registered']) + { + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); + } + + login_box(); + } + + $template->set_filenames(array( + 'body' => 'ucp_agreement.html') + ); + + // Disable online list + page_header($user->lang[$title]); + + $template->assign_vars(array( + 'S_AGREEMENT' => true, + 'AGREEMENT_TITLE' => $user->lang[$title], + 'AGREEMENT_TEXT' => sprintf($user->lang[$message], $config['sitename'], generate_board_url()), + 'U_BACK' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), + 'L_BACK' => $user->lang['BACK_TO_LOGIN'], + )); + + page_footer(); + + break; + + case 'delete_cookies': + + // Delete Cookies with dynamic names (do NOT delete poll cookies) + if (confirm_box(true)) + { + $set_time = time() - 31536000; + + foreach ($request->variable_names(\phpbb\request\request_interface::COOKIE) as $cookie_name) + { + $cookie_data = $request->variable($cookie_name, '', true, \phpbb\request\request_interface::COOKIE); + + // Only delete board cookies, no other ones... + if (strpos($cookie_name, $config['cookie_name'] . '_') !== 0) + { + continue; + } + + $cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name); + + /** + * Event to save custom cookies from deletion + * + * @event core.ucp_delete_cookies + * @var string cookie_name Cookie name to checking + * @var bool retain_cookie Do we retain our cookie or not, true if retain + * @since 3.1.3-RC1 + */ + $retain_cookie = false; + $vars = array('cookie_name', 'retain_cookie'); + extract($phpbb_dispatcher->trigger_event('core.ucp_delete_cookies', compact($vars))); + if ($retain_cookie) + { + continue; + } + + // Polls are stored as {cookie_name}_poll_{topic_id}, cookie_name_ got removed, therefore checking for poll_ + if (strpos($cookie_name, 'poll_') !== 0) + { + $user->set_cookie($cookie_name, '', $set_time); + } + } + + $user->set_cookie('track', '', $set_time); + $user->set_cookie('u', '', $set_time); + $user->set_cookie('k', '', $set_time); + $user->set_cookie('sid', '', $set_time); + + // We destroy the session here, the user will be logged out nevertheless + $user->session_kill(); + $user->session_begin(); + + meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); + + $message = $user->lang['COOKIES_DELETED'] . '

' . sprintf($user->lang['RETURN_INDEX'], '', ''); + trigger_error($message); + } + else + { + confirm_box(false, 'DELETE_COOKIES', ''); + } + + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); + + break; + + case 'switch_perm': + + $user_id = request_var('u', 0); + + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . (int) $user_id; + $result = $db->sql_query($sql); + $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')) + { + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); + } + + include($phpbb_root_path . 'includes/acp/auth.' . $phpEx); + + $auth_admin = new auth_admin(); + if (!$auth_admin->ghost_permissions($user_id, $user->data['user_id'])) + { + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); + } + + add_log('admin', 'LOG_ACL_TRANSFER_PERMISSIONS', $user_row['username']); + + $message = sprintf($user->lang['PERMISSIONS_TRANSFERRED'], $user_row['username']) . '

' . sprintf($user->lang['RETURN_INDEX'], '', ''); + trigger_error($message); + + break; + + case 'restore_perm': + + if (!$user->data['user_perm_from'] || !$auth->acl_get('a_switchperm')) + { + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); + } + + $auth->acl_cache($user->data); + + $sql = 'SELECT username + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . $user->data['user_perm_from']; + $result = $db->sql_query($sql); + $username = $db->sql_fetchfield('username'); + $db->sql_freeresult($result); + + add_log('admin', 'LOG_ACL_RESTORE_PERMISSIONS', $username); + + $message = $user->lang['PERMISSIONS_RESTORED'] . '

' . sprintf($user->lang['RETURN_INDEX'], '', ''); + trigger_error($message); + + break; + + default: + $default = true; + break; +} + +// We use this approach because it does not impose large code changes +if (!$default) +{ + return true; +} + +// Only registered users can go beyond this point +if (!$user->data['is_registered']) +{ + if ($user->data['is_bot']) + { + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); + } + + if ($id == 'pm' && $mode == 'view' && isset($_GET['p'])) + { + $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx?i=pm&p=" . request_var('p', 0)); + login_box($redirect_url, $user->lang['LOGIN_EXPLAIN_UCP']); + } + + login_box('', $user->lang['LOGIN_EXPLAIN_UCP']); +} + +// Instantiate module system and generate list of available modules +$module->list_modules('ucp'); + +// Check if the zebra module is set +if ($module->is_active('zebra', 'friends')) +{ + // Output listing of friends online + $update_time = $config['load_online_time'] * 60; + + $sql_ary = array( + 'SELECT' => 'u.user_id, u.username, u.username_clean, u.user_colour, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline', + + 'FROM' => array( + USERS_TABLE => 'u', + ZEBRA_TABLE => 'z', + ), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(SESSIONS_TABLE => 's'), + 'ON' => 's.session_user_id = z.zebra_id', + ), + ), + + 'WHERE' => 'z.user_id = ' . $user->data['user_id'] . ' + AND z.friend = 1 + AND u.user_id = z.zebra_id', + + 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username_clean, u.user_colour, u.username', + + 'ORDER_BY' => 'u.username_clean ASC', + ); + + $sql = $db->sql_build_query('SELECT_DISTINCT', $sql_ary); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $which = (time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline'))) ? 'online' : 'offline'; + + $template->assign_block_vars("friends_{$which}", array( + 'USER_ID' => $row['user_id'], + + 'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), + 'USER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), + 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'])) + ); + } + $db->sql_freeresult($result); +} + +// Do not display subscribed topics/forums if not allowed +if (!$config['allow_topic_notify'] && !$config['allow_forum_notify']) +{ + $module->set_display('main', 'subscribed', false); +} + +/** +* Use this event to enable and disable additional UCP modules +* +* @event core.ucp_display_module_before +* @var p_master module Object holding all modules and their status +* @var mixed id Active module category (can be the int or string) +* @var string mode Active module +* @since 3.1.0-a1 +*/ +$vars = array('module', 'id', 'mode'); +extract($phpbb_dispatcher->trigger_event('core.ucp_display_module_before', compact($vars))); + +// Select the active module +$module->set_active($id, $mode); + +// Load and execute the relevant module +$module->load_active(); + +// Assign data to the template engine for the list of modules +$module->assign_tpl_vars(append_sid("{$phpbb_root_path}ucp.$phpEx")); + +// Generate the page, do not display/query online list +$module->display($module->get_page_title()); diff --git a/sources/phpBB/vendor/autoload.php b/sources/phpBB/vendor/autoload.php new file mode 100644 index 0000000..b8122ae --- /dev/null +++ b/sources/phpBB/vendor/autoload.php @@ -0,0 +1,7 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0 class loader + * + * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + */ +class ClassLoader +{ + // PSR-4 + private $prefixLengthsPsr4 = array(); + private $prefixDirsPsr4 = array(); + private $fallbackDirsPsr4 = array(); + + // PSR-0 + private $prefixesPsr0 = array(); + private $fallbackDirsPsr0 = array(); + + private $useIncludePath = false; + private $classMap = array(); + + public function getPrefixes() + { + return call_user_func_array('array_merge', $this->prefixesPsr0); + } + + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-0 base directories + * @param bool $prepend Whether to prepend the directories + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + */ + public function setPsr4($prefix, $paths) { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + } + + /** + * Unregisters this instance as an autoloader. + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return bool|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + include $file; + + return true; + } + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 + if ('\\' == $class[0]) { + $class = substr($class, 1); + } + + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . '.php'; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { + if (0 === strpos($class, $prefix)) { + foreach ($this->prefixDirsPsr4[$prefix] as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . '.php'; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + // Remember that this class does not exist. + return $this->classMap[$class] = false; + } +} diff --git a/sources/phpBB/vendor/composer/autoload_classmap.php b/sources/phpBB/vendor/composer/autoload_classmap.php new file mode 100644 index 0000000..db53299 --- /dev/null +++ b/sources/phpBB/vendor/composer/autoload_classmap.php @@ -0,0 +1,677 @@ + $vendorDir . '/lusitanian/oauth/src/OAuth/Common/AutoLoader.php', + 'OAuth\\Common\\Consumer\\Credentials' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Consumer/Credentials.php', + 'OAuth\\Common\\Exception\\Exception' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Exception/Exception.php', + 'OAuth\\Common\\Http\\Client\\AbstractClient' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Http/Client/AbstractClient.php', + 'OAuth\\Common\\Http\\Client\\ClientInterface' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Http/Client/ClientInterface.php', + 'OAuth\\Common\\Http\\Client\\CurlClient' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Http/Client/CurlClient.php', + 'OAuth\\Common\\Http\\Client\\StreamClient' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Http/Client/StreamClient.php', + 'OAuth\\Common\\Http\\Exception\\TokenResponseException' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Http/Exception/TokenResponseException.php', + 'OAuth\\Common\\Http\\Uri\\Uri' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Http/Uri/Uri.php', + 'OAuth\\Common\\Http\\Uri\\UriFactory' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Http/Uri/UriFactory.php', + 'OAuth\\Common\\Http\\Uri\\UriFactoryInterface' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Http/Uri/UriFactoryInterface.php', + 'OAuth\\Common\\Http\\Uri\\UriInterface' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Http/Uri/UriInterface.php', + 'OAuth\\Common\\Service\\AbstractService' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Service/AbstractService.php', + 'OAuth\\Common\\Service\\ServiceInterface' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Service/ServiceInterface.php', + 'OAuth\\Common\\Storage\\Exception\\StorageException' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Storage/Exception/StorageException.php', + 'OAuth\\Common\\Storage\\Exception\\TokenNotFoundException' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Storage/Exception/TokenNotFoundException.php', + 'OAuth\\Common\\Storage\\Memory' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Storage/Memory.php', + 'OAuth\\Common\\Storage\\Redis' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Storage/Redis.php', + 'OAuth\\Common\\Storage\\Session' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Storage/Session.php', + 'OAuth\\Common\\Storage\\SymfonySession' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Storage/SymfonySession.php', + 'OAuth\\Common\\Storage\\TokenStorageInterface' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Storage/TokenStorageInterface.php', + 'OAuth\\Common\\Token\\AbstractToken' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Token/AbstractToken.php', + 'OAuth\\Common\\Token\\Exception\\ExpiredTokenException' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Token/Exception/ExpiredTokenException.php', + 'OAuth\\Common\\Token\\TokenInterface' => $vendorDir . '/lusitanian/oauth/src/OAuth/Common/Token/TokenInterface.php', + 'OAuth\\OAuth1\\Service\\AbstractService' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth1/Service/AbstractService.php', + 'OAuth\\OAuth1\\Service\\BitBucket' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth1/Service/BitBucket.php', + 'OAuth\\OAuth1\\Service\\Etsy' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth1/Service/Etsy.php', + 'OAuth\\OAuth1\\Service\\FitBit' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth1/Service/FitBit.php', + 'OAuth\\OAuth1\\Service\\ServiceInterface' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth1/Service/ServiceInterface.php', + 'OAuth\\OAuth1\\Service\\Tumblr' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth1/Service/Tumblr.php', + 'OAuth\\OAuth1\\Service\\Twitter' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth1/Service/Twitter.php', + 'OAuth\\OAuth1\\Signature\\Exception\\UnsupportedHashAlgorithmException' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth1/Signature/Exception/UnsupportedHashAlgorithmException.php', + 'OAuth\\OAuth1\\Signature\\Signature' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth1/Signature/Signature.php', + 'OAuth\\OAuth1\\Signature\\SignatureInterface' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth1/Signature/SignatureInterface.php', + 'OAuth\\OAuth1\\Token\\StdOAuth1Token' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth1/Token/StdOAuth1Token.php', + 'OAuth\\OAuth1\\Token\\TokenInterface' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth1/Token/TokenInterface.php', + 'OAuth\\OAuth2\\Service\\AbstractService' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/AbstractService.php', + 'OAuth\\OAuth2\\Service\\Amazon' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Amazon.php', + 'OAuth\\OAuth2\\Service\\Bitly' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Bitly.php', + 'OAuth\\OAuth2\\Service\\Box' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Box.php', + 'OAuth\\OAuth2\\Service\\Dropbox' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Dropbox.php', + 'OAuth\\OAuth2\\Service\\Exception\\InvalidScopeException' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Exception/InvalidScopeException.php', + 'OAuth\\OAuth2\\Service\\Exception\\MissingRefreshTokenException' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Exception/MissingRefreshTokenException.php', + 'OAuth\\OAuth2\\Service\\Facebook' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Facebook.php', + 'OAuth\\OAuth2\\Service\\Foursquare' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Foursquare.php', + 'OAuth\\OAuth2\\Service\\GitHub' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/GitHub.php', + 'OAuth\\OAuth2\\Service\\Google' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Google.php', + 'OAuth\\OAuth2\\Service\\Instagram' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Instagram.php', + 'OAuth\\OAuth2\\Service\\Linkedin' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Linkedin.php', + 'OAuth\\OAuth2\\Service\\Microsoft' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Microsoft.php', + 'OAuth\\OAuth2\\Service\\Paypal' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Paypal.php', + 'OAuth\\OAuth2\\Service\\ServiceInterface' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/ServiceInterface.php', + 'OAuth\\OAuth2\\Service\\SoundCloud' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/SoundCloud.php', + 'OAuth\\OAuth2\\Service\\Vkontakte' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Vkontakte.php', + 'OAuth\\OAuth2\\Service\\Yammer' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Service/Yammer.php', + 'OAuth\\OAuth2\\Token\\StdOAuth2Token' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Token/StdOAuth2Token.php', + 'OAuth\\OAuth2\\Token\\TokenInterface' => $vendorDir . '/lusitanian/oauth/src/OAuth/OAuth2/Token/TokenInterface.php', + 'OAuth\\ServiceFactory' => $vendorDir . '/lusitanian/oauth/src/OAuth/ServiceFactory.php', + 'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php', + 'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php', + 'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php', + 'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php', + 'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php', + 'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php', + 'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php', + 'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php', + 'SessionHandlerInterface' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php', + 'Symfony\\Component\\Config\\ConfigCache' => $vendorDir . '/symfony/config/Symfony/Component/Config/ConfigCache.php', + 'Symfony\\Component\\Config\\Definition\\ArrayNode' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php', + 'Symfony\\Component\\Config\\Definition\\BaseNode' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/BaseNode.php', + 'Symfony\\Component\\Config\\Definition\\BooleanNode' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/BooleanNode.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\ArrayNodeDefinition' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\BooleanNodeDefinition' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\EnumNodeDefinition' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\ExprBuilder' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/ExprBuilder.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\FloatNodeDefinition' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/FloatNodeDefinition.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\IntegerNodeDefinition' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/IntegerNodeDefinition.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\MergeBuilder' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/MergeBuilder.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\NodeBuilder' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/NodeBuilder.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/NodeDefinition.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\NormalizationBuilder' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\NumericNodeDefinition' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\ParentNodeDefinitionInterface' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\ScalarNodeDefinition' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/ScalarNodeDefinition.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\TreeBuilder' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/TreeBuilder.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\ValidationBuilder' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php', + 'Symfony\\Component\\Config\\Definition\\Builder\\VariableNodeDefinition' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php', + 'Symfony\\Component\\Config\\Definition\\ConfigurationInterface' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/ConfigurationInterface.php', + 'Symfony\\Component\\Config\\Definition\\EnumNode' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/EnumNode.php', + 'Symfony\\Component\\Config\\Definition\\Exception\\DuplicateKeyException' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Exception/DuplicateKeyException.php', + 'Symfony\\Component\\Config\\Definition\\Exception\\Exception' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Exception/Exception.php', + 'Symfony\\Component\\Config\\Definition\\Exception\\ForbiddenOverwriteException' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Exception/ForbiddenOverwriteException.php', + 'Symfony\\Component\\Config\\Definition\\Exception\\InvalidConfigurationException' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidConfigurationException.php', + 'Symfony\\Component\\Config\\Definition\\Exception\\InvalidDefinitionException' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidDefinitionException.php', + 'Symfony\\Component\\Config\\Definition\\Exception\\InvalidTypeException' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidTypeException.php', + 'Symfony\\Component\\Config\\Definition\\Exception\\UnsetKeyException' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Exception/UnsetKeyException.php', + 'Symfony\\Component\\Config\\Definition\\FloatNode' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/FloatNode.php', + 'Symfony\\Component\\Config\\Definition\\IntegerNode' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/IntegerNode.php', + 'Symfony\\Component\\Config\\Definition\\NodeInterface' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/NodeInterface.php', + 'Symfony\\Component\\Config\\Definition\\NumericNode' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/NumericNode.php', + 'Symfony\\Component\\Config\\Definition\\Processor' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/Processor.php', + 'Symfony\\Component\\Config\\Definition\\PrototypeNodeInterface' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/PrototypeNodeInterface.php', + 'Symfony\\Component\\Config\\Definition\\PrototypedArrayNode' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/PrototypedArrayNode.php', + 'Symfony\\Component\\Config\\Definition\\ReferenceDumper' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/ReferenceDumper.php', + 'Symfony\\Component\\Config\\Definition\\ScalarNode' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/ScalarNode.php', + 'Symfony\\Component\\Config\\Definition\\VariableNode' => $vendorDir . '/symfony/config/Symfony/Component/Config/Definition/VariableNode.php', + 'Symfony\\Component\\Config\\Exception\\FileLoaderImportCircularReferenceException' => $vendorDir . '/symfony/config/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php', + 'Symfony\\Component\\Config\\Exception\\FileLoaderLoadException' => $vendorDir . '/symfony/config/Symfony/Component/Config/Exception/FileLoaderLoadException.php', + 'Symfony\\Component\\Config\\FileLocator' => $vendorDir . '/symfony/config/Symfony/Component/Config/FileLocator.php', + 'Symfony\\Component\\Config\\FileLocatorInterface' => $vendorDir . '/symfony/config/Symfony/Component/Config/FileLocatorInterface.php', + 'Symfony\\Component\\Config\\Loader\\DelegatingLoader' => $vendorDir . '/symfony/config/Symfony/Component/Config/Loader/DelegatingLoader.php', + 'Symfony\\Component\\Config\\Loader\\FileLoader' => $vendorDir . '/symfony/config/Symfony/Component/Config/Loader/FileLoader.php', + 'Symfony\\Component\\Config\\Loader\\Loader' => $vendorDir . '/symfony/config/Symfony/Component/Config/Loader/Loader.php', + 'Symfony\\Component\\Config\\Loader\\LoaderInterface' => $vendorDir . '/symfony/config/Symfony/Component/Config/Loader/LoaderInterface.php', + 'Symfony\\Component\\Config\\Loader\\LoaderResolver' => $vendorDir . '/symfony/config/Symfony/Component/Config/Loader/LoaderResolver.php', + 'Symfony\\Component\\Config\\Loader\\LoaderResolverInterface' => $vendorDir . '/symfony/config/Symfony/Component/Config/Loader/LoaderResolverInterface.php', + 'Symfony\\Component\\Config\\Resource\\DirectoryResource' => $vendorDir . '/symfony/config/Symfony/Component/Config/Resource/DirectoryResource.php', + 'Symfony\\Component\\Config\\Resource\\FileResource' => $vendorDir . '/symfony/config/Symfony/Component/Config/Resource/FileResource.php', + 'Symfony\\Component\\Config\\Resource\\ResourceInterface' => $vendorDir . '/symfony/config/Symfony/Component/Config/Resource/ResourceInterface.php', + 'Symfony\\Component\\Config\\Tests\\Definition\\Builder\\BarNodeDefinition' => $vendorDir . '/symfony/config/Symfony/Component/Config/Tests/Fixtures/Builder/BarNodeDefinition.php', + 'Symfony\\Component\\Config\\Tests\\Definition\\Builder\\NodeBuilder' => $vendorDir . '/symfony/config/Symfony/Component/Config/Tests/Fixtures/Builder/NodeBuilder.php', + 'Symfony\\Component\\Config\\Tests\\Definition\\Builder\\VariableNodeDefinition' => $vendorDir . '/symfony/config/Symfony/Component/Config/Tests/Fixtures/Builder/VariableNodeDefinition.php', + 'Symfony\\Component\\Config\\Tests\\Fixtures\\Configuration\\ExampleConfiguration' => $vendorDir . '/symfony/config/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php', + 'Symfony\\Component\\Config\\Util\\XmlUtils' => $vendorDir . '/symfony/config/Symfony/Component/Config/Util/XmlUtils.php', + 'Symfony\\Component\\Console\\Application' => $vendorDir . '/symfony/console/Symfony/Component/Console/Application.php', + 'Symfony\\Component\\Console\\Command\\Command' => $vendorDir . '/symfony/console/Symfony/Component/Console/Command/Command.php', + 'Symfony\\Component\\Console\\Command\\HelpCommand' => $vendorDir . '/symfony/console/Symfony/Component/Console/Command/HelpCommand.php', + 'Symfony\\Component\\Console\\Command\\ListCommand' => $vendorDir . '/symfony/console/Symfony/Component/Console/Command/ListCommand.php', + 'Symfony\\Component\\Console\\ConsoleEvents' => $vendorDir . '/symfony/console/Symfony/Component/Console/ConsoleEvents.php', + 'Symfony\\Component\\Console\\Descriptor\\ApplicationDescription' => $vendorDir . '/symfony/console/Symfony/Component/Console/Descriptor/ApplicationDescription.php', + 'Symfony\\Component\\Console\\Descriptor\\Descriptor' => $vendorDir . '/symfony/console/Symfony/Component/Console/Descriptor/Descriptor.php', + 'Symfony\\Component\\Console\\Descriptor\\DescriptorInterface' => $vendorDir . '/symfony/console/Symfony/Component/Console/Descriptor/DescriptorInterface.php', + 'Symfony\\Component\\Console\\Descriptor\\JsonDescriptor' => $vendorDir . '/symfony/console/Symfony/Component/Console/Descriptor/JsonDescriptor.php', + 'Symfony\\Component\\Console\\Descriptor\\MarkdownDescriptor' => $vendorDir . '/symfony/console/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php', + 'Symfony\\Component\\Console\\Descriptor\\TextDescriptor' => $vendorDir . '/symfony/console/Symfony/Component/Console/Descriptor/TextDescriptor.php', + 'Symfony\\Component\\Console\\Descriptor\\XmlDescriptor' => $vendorDir . '/symfony/console/Symfony/Component/Console/Descriptor/XmlDescriptor.php', + 'Symfony\\Component\\Console\\Event\\ConsoleCommandEvent' => $vendorDir . '/symfony/console/Symfony/Component/Console/Event/ConsoleCommandEvent.php', + 'Symfony\\Component\\Console\\Event\\ConsoleEvent' => $vendorDir . '/symfony/console/Symfony/Component/Console/Event/ConsoleEvent.php', + 'Symfony\\Component\\Console\\Event\\ConsoleExceptionEvent' => $vendorDir . '/symfony/console/Symfony/Component/Console/Event/ConsoleExceptionEvent.php', + 'Symfony\\Component\\Console\\Event\\ConsoleTerminateEvent' => $vendorDir . '/symfony/console/Symfony/Component/Console/Event/ConsoleTerminateEvent.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatter' => $vendorDir . '/symfony/console/Symfony/Component/Console/Formatter/OutputFormatter.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface' => $vendorDir . '/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterInterface.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyle' => $vendorDir . '/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyle.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleInterface' => $vendorDir . '/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleStack' => $vendorDir . '/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php', + 'Symfony\\Component\\Console\\Helper\\DescriptorHelper' => $vendorDir . '/symfony/console/Symfony/Component/Console/Helper/DescriptorHelper.php', + 'Symfony\\Component\\Console\\Helper\\DialogHelper' => $vendorDir . '/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php', + 'Symfony\\Component\\Console\\Helper\\FormatterHelper' => $vendorDir . '/symfony/console/Symfony/Component/Console/Helper/FormatterHelper.php', + 'Symfony\\Component\\Console\\Helper\\Helper' => $vendorDir . '/symfony/console/Symfony/Component/Console/Helper/Helper.php', + 'Symfony\\Component\\Console\\Helper\\HelperInterface' => $vendorDir . '/symfony/console/Symfony/Component/Console/Helper/HelperInterface.php', + 'Symfony\\Component\\Console\\Helper\\HelperSet' => $vendorDir . '/symfony/console/Symfony/Component/Console/Helper/HelperSet.php', + 'Symfony\\Component\\Console\\Helper\\ProgressHelper' => $vendorDir . '/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php', + 'Symfony\\Component\\Console\\Helper\\TableHelper' => $vendorDir . '/symfony/console/Symfony/Component/Console/Helper/TableHelper.php', + 'Symfony\\Component\\Console\\Input\\ArgvInput' => $vendorDir . '/symfony/console/Symfony/Component/Console/Input/ArgvInput.php', + 'Symfony\\Component\\Console\\Input\\ArrayInput' => $vendorDir . '/symfony/console/Symfony/Component/Console/Input/ArrayInput.php', + 'Symfony\\Component\\Console\\Input\\Input' => $vendorDir . '/symfony/console/Symfony/Component/Console/Input/Input.php', + 'Symfony\\Component\\Console\\Input\\InputArgument' => $vendorDir . '/symfony/console/Symfony/Component/Console/Input/InputArgument.php', + 'Symfony\\Component\\Console\\Input\\InputDefinition' => $vendorDir . '/symfony/console/Symfony/Component/Console/Input/InputDefinition.php', + 'Symfony\\Component\\Console\\Input\\InputInterface' => $vendorDir . '/symfony/console/Symfony/Component/Console/Input/InputInterface.php', + 'Symfony\\Component\\Console\\Input\\InputOption' => $vendorDir . '/symfony/console/Symfony/Component/Console/Input/InputOption.php', + 'Symfony\\Component\\Console\\Input\\StringInput' => $vendorDir . '/symfony/console/Symfony/Component/Console/Input/StringInput.php', + 'Symfony\\Component\\Console\\Output\\ConsoleOutput' => $vendorDir . '/symfony/console/Symfony/Component/Console/Output/ConsoleOutput.php', + 'Symfony\\Component\\Console\\Output\\ConsoleOutputInterface' => $vendorDir . '/symfony/console/Symfony/Component/Console/Output/ConsoleOutputInterface.php', + 'Symfony\\Component\\Console\\Output\\NullOutput' => $vendorDir . '/symfony/console/Symfony/Component/Console/Output/NullOutput.php', + 'Symfony\\Component\\Console\\Output\\Output' => $vendorDir . '/symfony/console/Symfony/Component/Console/Output/Output.php', + 'Symfony\\Component\\Console\\Output\\OutputInterface' => $vendorDir . '/symfony/console/Symfony/Component/Console/Output/OutputInterface.php', + 'Symfony\\Component\\Console\\Output\\StreamOutput' => $vendorDir . '/symfony/console/Symfony/Component/Console/Output/StreamOutput.php', + 'Symfony\\Component\\Console\\Shell' => $vendorDir . '/symfony/console/Symfony/Component/Console/Shell.php', + 'Symfony\\Component\\Console\\Tester\\ApplicationTester' => $vendorDir . '/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php', + 'Symfony\\Component\\Console\\Tester\\CommandTester' => $vendorDir . '/symfony/console/Symfony/Component/Console/Tester/CommandTester.php', + 'Symfony\\Component\\Console\\Tests\\Descriptor\\ObjectsProvider' => $vendorDir . '/symfony/console/Symfony/Component/Console/Tests/Descriptor/ObjectsProvider.php', + 'Symfony\\Component\\Console\\Tests\\Fixtures\\DescriptorApplication1' => $vendorDir . '/symfony/console/Symfony/Component/Console/Tests/Fixtures/DescriptorApplication1.php', + 'Symfony\\Component\\Console\\Tests\\Fixtures\\DescriptorApplication2' => $vendorDir . '/symfony/console/Symfony/Component/Console/Tests/Fixtures/DescriptorApplication2.php', + 'Symfony\\Component\\Console\\Tests\\Fixtures\\DescriptorCommand1' => $vendorDir . '/symfony/console/Symfony/Component/Console/Tests/Fixtures/DescriptorCommand1.php', + 'Symfony\\Component\\Console\\Tests\\Fixtures\\DescriptorCommand2' => $vendorDir . '/symfony/console/Symfony/Component/Console/Tests/Fixtures/DescriptorCommand2.php', + 'Symfony\\Component\\Debug\\Debug' => $vendorDir . '/symfony/debug/Symfony/Component/Debug/Debug.php', + 'Symfony\\Component\\Debug\\ErrorHandler' => $vendorDir . '/symfony/debug/Symfony/Component/Debug/ErrorHandler.php', + 'Symfony\\Component\\Debug\\ExceptionHandler' => $vendorDir . '/symfony/debug/Symfony/Component/Debug/ExceptionHandler.php', + 'Symfony\\Component\\Debug\\Exception\\ContextErrorException' => $vendorDir . '/symfony/debug/Symfony/Component/Debug/Exception/ContextErrorException.php', + 'Symfony\\Component\\Debug\\Exception\\DummyException' => $vendorDir . '/symfony/debug/Symfony/Component/Debug/Exception/DummyException.php', + 'Symfony\\Component\\Debug\\Exception\\FatalErrorException' => $vendorDir . '/symfony/debug/Symfony/Component/Debug/Exception/FatalErrorException.php', + 'Symfony\\Component\\Debug\\Exception\\FlattenException' => $vendorDir . '/symfony/debug/Symfony/Component/Debug/Exception/FlattenException.php', + 'Symfony\\Component\\DependencyInjection\\Alias' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Alias.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\AnalyzeServiceReferencesPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\CheckCircularReferencesPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\CheckDefinitionValidityPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\CheckReferenceValidityPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\Compiler' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\InlineServiceDefinitionsPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\LoggingFormatter' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\MergeExtensionConfigurationPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\PassConfig' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\RemoveAbstractDefinitionsPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\RemovePrivateAliasesPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\RemoveUnusedDefinitionsPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\RepeatablePassInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\RepeatedPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\ReplaceAliasByActualDefinitionPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\ResolveDefinitionTemplatesPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\ResolveInvalidReferencesPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\ResolveParameterPlaceHoldersPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\ResolveReferencesToAliasesPass' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\ServiceReferenceGraph' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\ServiceReferenceGraphEdge' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php', + 'Symfony\\Component\\DependencyInjection\\Compiler\\ServiceReferenceGraphNode' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php', + 'Symfony\\Component\\DependencyInjection\\Container' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php', + 'Symfony\\Component\\DependencyInjection\\ContainerAware' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAware.php', + 'Symfony\\Component\\DependencyInjection\\ContainerAwareInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAwareInterface.php', + 'Symfony\\Component\\DependencyInjection\\ContainerBuilder' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php', + 'Symfony\\Component\\DependencyInjection\\ContainerInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerInterface.php', + 'Symfony\\Component\\DependencyInjection\\Definition' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php', + 'Symfony\\Component\\DependencyInjection\\DefinitionDecorator' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php', + 'Symfony\\Component\\DependencyInjection\\Dumper\\Dumper' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/Dumper.php', + 'Symfony\\Component\\DependencyInjection\\Dumper\\DumperInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php', + 'Symfony\\Component\\DependencyInjection\\Dumper\\GraphvizDumper' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php', + 'Symfony\\Component\\DependencyInjection\\Dumper\\PhpDumper' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php', + 'Symfony\\Component\\DependencyInjection\\Dumper\\XmlDumper' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php', + 'Symfony\\Component\\DependencyInjection\\Dumper\\YamlDumper' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php', + 'Symfony\\Component\\DependencyInjection\\Exception\\BadMethodCallException' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php', + 'Symfony\\Component\\DependencyInjection\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php', + 'Symfony\\Component\\DependencyInjection\\Exception\\InactiveScopeException' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php', + 'Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php', + 'Symfony\\Component\\DependencyInjection\\Exception\\LogicException' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/LogicException.php', + 'Symfony\\Component\\DependencyInjection\\Exception\\OutOfBoundsException' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php', + 'Symfony\\Component\\DependencyInjection\\Exception\\ParameterCircularReferenceException' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php', + 'Symfony\\Component\\DependencyInjection\\Exception\\ParameterNotFoundException' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php', + 'Symfony\\Component\\DependencyInjection\\Exception\\RuntimeException' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/RuntimeException.php', + 'Symfony\\Component\\DependencyInjection\\Exception\\ScopeCrossingInjectionException' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php', + 'Symfony\\Component\\DependencyInjection\\Exception\\ScopeWideningInjectionException' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php', + 'Symfony\\Component\\DependencyInjection\\Exception\\ServiceCircularReferenceException' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php', + 'Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php', + 'Symfony\\Component\\DependencyInjection\\Extension\\ConfigurationExtensionInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php', + 'Symfony\\Component\\DependencyInjection\\Extension\\Extension' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/Extension.php', + 'Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php', + 'Symfony\\Component\\DependencyInjection\\Extension\\PrependExtensionInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/PrependExtensionInterface.php', + 'Symfony\\Component\\DependencyInjection\\IntrospectableContainerInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php', + 'Symfony\\Component\\DependencyInjection\\LazyProxy\\Instantiator\\InstantiatorInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/InstantiatorInterface.php', + 'Symfony\\Component\\DependencyInjection\\LazyProxy\\Instantiator\\RealServiceInstantiator' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/RealServiceInstantiator.php', + 'Symfony\\Component\\DependencyInjection\\LazyProxy\\PhpDumper\\DumperInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php', + 'Symfony\\Component\\DependencyInjection\\LazyProxy\\PhpDumper\\NullDumper' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/NullDumper.php', + 'Symfony\\Component\\DependencyInjection\\Loader\\ClosureLoader' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php', + 'Symfony\\Component\\DependencyInjection\\Loader\\FileLoader' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/FileLoader.php', + 'Symfony\\Component\\DependencyInjection\\Loader\\IniFileLoader' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php', + 'Symfony\\Component\\DependencyInjection\\Loader\\PhpFileLoader' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php', + 'Symfony\\Component\\DependencyInjection\\Loader\\XmlFileLoader' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php', + 'Symfony\\Component\\DependencyInjection\\Loader\\YamlFileLoader' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php', + 'Symfony\\Component\\DependencyInjection\\Parameter' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Parameter.php', + 'Symfony\\Component\\DependencyInjection\\ParameterBag\\FrozenParameterBag' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php', + 'Symfony\\Component\\DependencyInjection\\ParameterBag\\ParameterBag' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php', + 'Symfony\\Component\\DependencyInjection\\ParameterBag\\ParameterBagInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php', + 'Symfony\\Component\\DependencyInjection\\Reference' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Reference.php', + 'Symfony\\Component\\DependencyInjection\\Scope' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Scope.php', + 'Symfony\\Component\\DependencyInjection\\ScopeInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/ScopeInterface.php', + 'Symfony\\Component\\DependencyInjection\\SimpleXMLElement' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/SimpleXMLElement.php', + 'Symfony\\Component\\DependencyInjection\\TaggedContainerInterface' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/TaggedContainerInterface.php', + 'Symfony\\Component\\DependencyInjection\\Variable' => $vendorDir . '/symfony/dependency-injection/Symfony/Component/DependencyInjection/Variable.php', + 'Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher' => $vendorDir . '/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php', + 'Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcherInterface' => $vendorDir . '/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php', + 'Symfony\\Component\\EventDispatcher\\Event' => $vendorDir . '/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php', + 'Symfony\\Component\\EventDispatcher\\EventDispatcher' => $vendorDir . '/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php', + 'Symfony\\Component\\EventDispatcher\\EventDispatcherInterface' => $vendorDir . '/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php', + 'Symfony\\Component\\EventDispatcher\\EventSubscriberInterface' => $vendorDir . '/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventSubscriberInterface.php', + 'Symfony\\Component\\EventDispatcher\\GenericEvent' => $vendorDir . '/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php', + 'Symfony\\Component\\EventDispatcher\\ImmutableEventDispatcher' => $vendorDir . '/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php', + 'Symfony\\Component\\Filesystem\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/filesystem/Symfony/Component/Filesystem/Exception/ExceptionInterface.php', + 'Symfony\\Component\\Filesystem\\Exception\\IOException' => $vendorDir . '/symfony/filesystem/Symfony/Component/Filesystem/Exception/IOException.php', + 'Symfony\\Component\\Filesystem\\Filesystem' => $vendorDir . '/symfony/filesystem/Symfony/Component/Filesystem/Filesystem.php', + 'Symfony\\Component\\HttpFoundation\\AcceptHeader' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeader.php', + 'Symfony\\Component\\HttpFoundation\\AcceptHeaderItem' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeaderItem.php', + 'Symfony\\Component\\HttpFoundation\\ApacheRequest' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/ApacheRequest.php', + 'Symfony\\Component\\HttpFoundation\\BinaryFileResponse' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/BinaryFileResponse.php', + 'Symfony\\Component\\HttpFoundation\\Cookie' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Cookie.php', + 'Symfony\\Component\\HttpFoundation\\FileBag' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php', + 'Symfony\\Component\\HttpFoundation\\File\\Exception\\AccessDeniedException' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php', + 'Symfony\\Component\\HttpFoundation\\File\\Exception\\FileException' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileException.php', + 'Symfony\\Component\\HttpFoundation\\File\\Exception\\FileNotFoundException' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php', + 'Symfony\\Component\\HttpFoundation\\File\\Exception\\UnexpectedTypeException' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UnexpectedTypeException.php', + 'Symfony\\Component\\HttpFoundation\\File\\Exception\\UploadException' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UploadException.php', + 'Symfony\\Component\\HttpFoundation\\File\\File' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php', + 'Symfony\\Component\\HttpFoundation\\File\\MimeType\\ExtensionGuesser' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php', + 'Symfony\\Component\\HttpFoundation\\File\\MimeType\\ExtensionGuesserInterface' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php', + 'Symfony\\Component\\HttpFoundation\\File\\MimeType\\FileBinaryMimeTypeGuesser' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php', + 'Symfony\\Component\\HttpFoundation\\File\\MimeType\\FileinfoMimeTypeGuesser' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php', + 'Symfony\\Component\\HttpFoundation\\File\\MimeType\\MimeTypeExtensionGuesser' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php', + 'Symfony\\Component\\HttpFoundation\\File\\MimeType\\MimeTypeGuesser' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php', + 'Symfony\\Component\\HttpFoundation\\File\\MimeType\\MimeTypeGuesserInterface' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php', + 'Symfony\\Component\\HttpFoundation\\File\\UploadedFile' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php', + 'Symfony\\Component\\HttpFoundation\\HeaderBag' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php', + 'Symfony\\Component\\HttpFoundation\\IpUtils' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/IpUtils.php', + 'Symfony\\Component\\HttpFoundation\\JsonResponse' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php', + 'Symfony\\Component\\HttpFoundation\\ParameterBag' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php', + 'Symfony\\Component\\HttpFoundation\\RedirectResponse' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/RedirectResponse.php', + 'Symfony\\Component\\HttpFoundation\\Request' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php', + 'Symfony\\Component\\HttpFoundation\\RequestMatcher' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcher.php', + 'Symfony\\Component\\HttpFoundation\\RequestMatcherInterface' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcherInterface.php', + 'Symfony\\Component\\HttpFoundation\\Resources\\stubs\\FakeFile' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/FakeFile.php', + 'Symfony\\Component\\HttpFoundation\\Response' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php', + 'Symfony\\Component\\HttpFoundation\\ResponseHeaderBag' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/ResponseHeaderBag.php', + 'Symfony\\Component\\HttpFoundation\\ServerBag' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBag' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Attribute\\NamespacedAttributeBag' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Flash\\AutoExpireFlashBag' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBag' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Session' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php', + 'Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php', + 'Symfony\\Component\\HttpFoundation\\Session\\SessionInterface' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionInterface.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\MemcacheSessionHandler' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\MemcachedSessionHandler' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\MongoDbSessionHandler' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeSessionHandler' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NullSessionHandler' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\PdoSessionHandler' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\MetadataBag' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\MockArraySessionStorage' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\MockFileSessionStorage' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorage' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\AbstractProxy' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\NativeProxy' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\SessionStorageInterface' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php', + 'Symfony\\Component\\HttpFoundation\\StreamedResponse' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/StreamedResponse.php', + 'Symfony\\Component\\HttpFoundation\\Tests\\ResponseTestCase' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseTestCase.php', + 'Symfony\\Component\\HttpKernel\\Bundle\\Bundle' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php', + 'Symfony\\Component\\HttpKernel\\Bundle\\BundleInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/BundleInterface.php', + 'Symfony\\Component\\HttpKernel\\CacheClearer\\CacheClearerInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/CacheClearerInterface.php', + 'Symfony\\Component\\HttpKernel\\CacheClearer\\ChainCacheClearer' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php', + 'Symfony\\Component\\HttpKernel\\CacheWarmer\\CacheWarmer' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php', + 'Symfony\\Component\\HttpKernel\\CacheWarmer\\CacheWarmerAggregate' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php', + 'Symfony\\Component\\HttpKernel\\CacheWarmer\\CacheWarmerInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerInterface.php', + 'Symfony\\Component\\HttpKernel\\CacheWarmer\\WarmableInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/WarmableInterface.php', + 'Symfony\\Component\\HttpKernel\\Client' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php', + 'Symfony\\Component\\HttpKernel\\Config\\FileLocator' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Config/FileLocator.php', + 'Symfony\\Component\\HttpKernel\\Controller\\ControllerReference' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerReference.php', + 'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php', + 'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php', + 'Symfony\\Component\\HttpKernel\\Controller\\TraceableControllerResolver' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/TraceableControllerResolver.php', + 'Symfony\\Component\\HttpKernel\\DataCollector\\ConfigDataCollector' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php', + 'Symfony\\Component\\HttpKernel\\DataCollector\\DataCollector' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollector.php', + 'Symfony\\Component\\HttpKernel\\DataCollector\\DataCollectorInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php', + 'Symfony\\Component\\HttpKernel\\DataCollector\\EventDataCollector' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php', + 'Symfony\\Component\\HttpKernel\\DataCollector\\ExceptionDataCollector' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php', + 'Symfony\\Component\\HttpKernel\\DataCollector\\LoggerDataCollector' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php', + 'Symfony\\Component\\HttpKernel\\DataCollector\\MemoryDataCollector' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php', + 'Symfony\\Component\\HttpKernel\\DataCollector\\RequestDataCollector' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php', + 'Symfony\\Component\\HttpKernel\\DataCollector\\RouterDataCollector' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php', + 'Symfony\\Component\\HttpKernel\\DataCollector\\TimeDataCollector' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php', + 'Symfony\\Component\\HttpKernel\\Debug\\ErrorHandler' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php', + 'Symfony\\Component\\HttpKernel\\Debug\\ExceptionHandler' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php', + 'Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php', + 'Symfony\\Component\\HttpKernel\\DependencyInjection\\AddClassesToCachePass' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php', + 'Symfony\\Component\\HttpKernel\\DependencyInjection\\ConfigurableExtension' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php', + 'Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php', + 'Symfony\\Component\\HttpKernel\\DependencyInjection\\Extension' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/Extension.php', + 'Symfony\\Component\\HttpKernel\\DependencyInjection\\MergeExtensionConfigurationPass' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php', + 'Symfony\\Component\\HttpKernel\\DependencyInjection\\RegisterListenersPass' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php', + 'Symfony\\Component\\HttpKernel\\EventListener\\ErrorsLoggerListener' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ErrorsLoggerListener.php', + 'Symfony\\Component\\HttpKernel\\EventListener\\EsiListener' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/EsiListener.php', + 'Symfony\\Component\\HttpKernel\\EventListener\\ExceptionListener' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php', + 'Symfony\\Component\\HttpKernel\\EventListener\\FragmentListener' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/FragmentListener.php', + 'Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php', + 'Symfony\\Component\\HttpKernel\\EventListener\\ProfilerListener' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php', + 'Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ResponseListener.php', + 'Symfony\\Component\\HttpKernel\\EventListener\\RouterListener' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php', + 'Symfony\\Component\\HttpKernel\\EventListener\\StreamedResponseListener' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php', + 'Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php', + 'Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php', + 'Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseEvent.php', + 'Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php', + 'Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php', + 'Symfony\\Component\\HttpKernel\\Event\\KernelEvent' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php', + 'Symfony\\Component\\HttpKernel\\Event\\PostResponseEvent' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Event/PostResponseEvent.php', + 'Symfony\\Component\\HttpKernel\\Exception\\AccessDeniedHttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/AccessDeniedHttpException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/BadRequestHttpException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\ConflictHttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/ConflictHttpException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\FatalErrorException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FatalErrorException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\FlattenException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FlattenException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\GoneHttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/GoneHttpException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\HttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\HttpExceptionInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpExceptionInterface.php', + 'Symfony\\Component\\HttpKernel\\Exception\\LengthRequiredHttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/LengthRequiredHttpException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\MethodNotAllowedHttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\NotAcceptableHttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/NotAcceptableHttpException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/NotFoundHttpException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\PreconditionFailedHttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/PreconditionFailedHttpException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\PreconditionRequiredHttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/PreconditionRequiredHttpException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\ServiceUnavailableHttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/ServiceUnavailableHttpException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\TooManyRequestsHttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/TooManyRequestsHttpException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\UnauthorizedHttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/UnauthorizedHttpException.php', + 'Symfony\\Component\\HttpKernel\\Exception\\UnsupportedMediaTypeHttpException' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/UnsupportedMediaTypeHttpException.php', + 'Symfony\\Component\\HttpKernel\\Fragment\\EsiFragmentRenderer' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/EsiFragmentRenderer.php', + 'Symfony\\Component\\HttpKernel\\Fragment\\FragmentHandler' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php', + 'Symfony\\Component\\HttpKernel\\Fragment\\FragmentRendererInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentRendererInterface.php', + 'Symfony\\Component\\HttpKernel\\Fragment\\HIncludeFragmentRenderer' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php', + 'Symfony\\Component\\HttpKernel\\Fragment\\InlineFragmentRenderer' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php', + 'Symfony\\Component\\HttpKernel\\Fragment\\RoutableFragmentRenderer' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php', + 'Symfony\\Component\\HttpKernel\\HttpCache\\Esi' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Esi.php', + 'Symfony\\Component\\HttpKernel\\HttpCache\\EsiResponseCacheStrategy' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php', + 'Symfony\\Component\\HttpKernel\\HttpCache\\EsiResponseCacheStrategyInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategyInterface.php', + 'Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php', + 'Symfony\\Component\\HttpKernel\\HttpCache\\Store' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php', + 'Symfony\\Component\\HttpKernel\\HttpCache\\StoreInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php', + 'Symfony\\Component\\HttpKernel\\HttpKernel' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php', + 'Symfony\\Component\\HttpKernel\\HttpKernelInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernelInterface.php', + 'Symfony\\Component\\HttpKernel\\Kernel' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php', + 'Symfony\\Component\\HttpKernel\\KernelEvents' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php', + 'Symfony\\Component\\HttpKernel\\KernelInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php', + 'Symfony\\Component\\HttpKernel\\Log\\DebugLoggerInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php', + 'Symfony\\Component\\HttpKernel\\Log\\LoggerInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Log/LoggerInterface.php', + 'Symfony\\Component\\HttpKernel\\Log\\NullLogger' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Log/NullLogger.php', + 'Symfony\\Component\\HttpKernel\\Profiler\\BaseMemcacheProfilerStorage' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php', + 'Symfony\\Component\\HttpKernel\\Profiler\\FileProfilerStorage' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php', + 'Symfony\\Component\\HttpKernel\\Profiler\\MemcacheProfilerStorage' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php', + 'Symfony\\Component\\HttpKernel\\Profiler\\MemcachedProfilerStorage' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php', + 'Symfony\\Component\\HttpKernel\\Profiler\\MongoDbProfilerStorage' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php', + 'Symfony\\Component\\HttpKernel\\Profiler\\MysqlProfilerStorage' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MysqlProfilerStorage.php', + 'Symfony\\Component\\HttpKernel\\Profiler\\PdoProfilerStorage' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php', + 'Symfony\\Component\\HttpKernel\\Profiler\\Profile' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profile.php', + 'Symfony\\Component\\HttpKernel\\Profiler\\Profiler' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php', + 'Symfony\\Component\\HttpKernel\\Profiler\\ProfilerStorageInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php', + 'Symfony\\Component\\HttpKernel\\Profiler\\RedisProfilerStorage' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php', + 'Symfony\\Component\\HttpKernel\\Profiler\\SqliteProfilerStorage' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php', + 'Symfony\\Component\\HttpKernel\\TerminableInterface' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/TerminableInterface.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Fixtures\\ExtensionAbsentBundle\\ExtensionAbsentBundle' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionAbsentBundle/ExtensionAbsentBundle.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Fixtures\\ExtensionLoadedBundle\\DependencyInjection\\ExtensionLoadedExtension' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/DependencyInjection/ExtensionLoadedExtension.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Fixtures\\ExtensionLoadedBundle\\ExtensionLoadedBundle' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/ExtensionLoadedBundle.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Fixtures\\ExtensionPresentBundle\\Command\\BarCommand' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/BarCommand.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Fixtures\\ExtensionPresentBundle\\Command\\FooCommand' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/FooCommand.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Fixtures\\ExtensionPresentBundle\\DependencyInjection\\ExtensionPresentExtension' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/DependencyInjection/ExtensionPresentExtension.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Fixtures\\ExtensionPresentBundle\\ExtensionPresentBundle' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/ExtensionPresentBundle.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Fixtures\\FooBarBundle' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Fixtures\\KernelForOverrideName' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForOverrideName.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Fixtures\\TestClient' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/TestClient.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Fixtures\\TestEventDispatcher' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/TestEventDispatcher.php', + 'Symfony\\Component\\HttpKernel\\Tests\\HttpCache\\HttpCacheTestCase' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php', + 'Symfony\\Component\\HttpKernel\\Tests\\HttpCache\\TestHttpKernel' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php', + 'Symfony\\Component\\HttpKernel\\Tests\\HttpCache\\TestMultipleHttpKernel' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Logger' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Logger.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Profiler\\Mock\\MemcacheMock' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcacheMock.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Profiler\\Mock\\MemcachedMock' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcachedMock.php', + 'Symfony\\Component\\HttpKernel\\Tests\\Profiler\\Mock\\RedisMock' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php', + 'Symfony\\Component\\HttpKernel\\Tests\\TestHttpKernel' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/TestHttpKernel.php', + 'Symfony\\Component\\HttpKernel\\UriSigner' => $vendorDir . '/symfony/http-kernel/Symfony/Component/HttpKernel/UriSigner.php', + 'Symfony\\Component\\Routing\\Annotation\\Route' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Annotation/Route.php', + 'Symfony\\Component\\Routing\\CompiledRoute' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/CompiledRoute.php', + 'Symfony\\Component\\Routing\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Exception/ExceptionInterface.php', + 'Symfony\\Component\\Routing\\Exception\\InvalidParameterException' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Exception/InvalidParameterException.php', + 'Symfony\\Component\\Routing\\Exception\\MethodNotAllowedException' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Exception/MethodNotAllowedException.php', + 'Symfony\\Component\\Routing\\Exception\\MissingMandatoryParametersException' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Exception/MissingMandatoryParametersException.php', + 'Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Exception/ResourceNotFoundException.php', + 'Symfony\\Component\\Routing\\Exception\\RouteNotFoundException' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Exception/RouteNotFoundException.php', + 'Symfony\\Component\\Routing\\Generator\\ConfigurableRequirementsInterface' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Generator/ConfigurableRequirementsInterface.php', + 'Symfony\\Component\\Routing\\Generator\\Dumper\\GeneratorDumper' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumper.php', + 'Symfony\\Component\\Routing\\Generator\\Dumper\\GeneratorDumperInterface' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumperInterface.php', + 'Symfony\\Component\\Routing\\Generator\\Dumper\\PhpGeneratorDumper' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php', + 'Symfony\\Component\\Routing\\Generator\\UrlGenerator' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php', + 'Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php', + 'Symfony\\Component\\Routing\\Loader\\AnnotationClassLoader' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Loader/AnnotationClassLoader.php', + 'Symfony\\Component\\Routing\\Loader\\AnnotationDirectoryLoader' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php', + 'Symfony\\Component\\Routing\\Loader\\AnnotationFileLoader' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Loader/AnnotationFileLoader.php', + 'Symfony\\Component\\Routing\\Loader\\ClosureLoader' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Loader/ClosureLoader.php', + 'Symfony\\Component\\Routing\\Loader\\PhpFileLoader' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Loader/PhpFileLoader.php', + 'Symfony\\Component\\Routing\\Loader\\XmlFileLoader' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Loader/XmlFileLoader.php', + 'Symfony\\Component\\Routing\\Loader\\YamlFileLoader' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Loader/YamlFileLoader.php', + 'Symfony\\Component\\Routing\\Matcher\\ApacheUrlMatcher' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php', + 'Symfony\\Component\\Routing\\Matcher\\Dumper\\ApacheMatcherDumper' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php', + 'Symfony\\Component\\Routing\\Matcher\\Dumper\\DumperCollection' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php', + 'Symfony\\Component\\Routing\\Matcher\\Dumper\\DumperPrefixCollection' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php', + 'Symfony\\Component\\Routing\\Matcher\\Dumper\\DumperRoute' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php', + 'Symfony\\Component\\Routing\\Matcher\\Dumper\\MatcherDumper' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumper.php', + 'Symfony\\Component\\Routing\\Matcher\\Dumper\\MatcherDumperInterface' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php', + 'Symfony\\Component\\Routing\\Matcher\\Dumper\\PhpMatcherDumper' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php', + 'Symfony\\Component\\Routing\\Matcher\\RedirectableUrlMatcher' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php', + 'Symfony\\Component\\Routing\\Matcher\\RedirectableUrlMatcherInterface' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcherInterface.php', + 'Symfony\\Component\\Routing\\Matcher\\RequestMatcherInterface' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Matcher/RequestMatcherInterface.php', + 'Symfony\\Component\\Routing\\Matcher\\TraceableUrlMatcher' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php', + 'Symfony\\Component\\Routing\\Matcher\\UrlMatcher' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php', + 'Symfony\\Component\\Routing\\Matcher\\UrlMatcherInterface' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcherInterface.php', + 'Symfony\\Component\\Routing\\RequestContext' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/RequestContext.php', + 'Symfony\\Component\\Routing\\RequestContextAwareInterface' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/RequestContextAwareInterface.php', + 'Symfony\\Component\\Routing\\Route' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Route.php', + 'Symfony\\Component\\Routing\\RouteCollection' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/RouteCollection.php', + 'Symfony\\Component\\Routing\\RouteCompiler' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/RouteCompiler.php', + 'Symfony\\Component\\Routing\\RouteCompilerInterface' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/RouteCompilerInterface.php', + 'Symfony\\Component\\Routing\\Router' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Router.php', + 'Symfony\\Component\\Routing\\RouterInterface' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/RouterInterface.php', + 'Symfony\\Component\\Routing\\Tests\\Fixtures\\AnnotatedClasses\\AbstractClass' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/AbstractClass.php', + 'Symfony\\Component\\Routing\\Tests\\Fixtures\\AnnotatedClasses\\BarClass' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/BarClass.php', + 'Symfony\\Component\\Routing\\Tests\\Fixtures\\AnnotatedClasses\\FooClass' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/AnnotatedClasses/FooClass.php', + 'Symfony\\Component\\Routing\\Tests\\Fixtures\\CustomXmlFileLoader' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/CustomXmlFileLoader.php', + 'Symfony\\Component\\Routing\\Tests\\Fixtures\\RedirectableUrlMatcher' => $vendorDir . '/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/RedirectableUrlMatcher.php', + 'Symfony\\Component\\Yaml\\Dumper' => $vendorDir . '/symfony/yaml/Symfony/Component/Yaml/Dumper.php', + 'Symfony\\Component\\Yaml\\Escaper' => $vendorDir . '/symfony/yaml/Symfony/Component/Yaml/Escaper.php', + 'Symfony\\Component\\Yaml\\Exception\\DumpException' => $vendorDir . '/symfony/yaml/Symfony/Component/Yaml/Exception/DumpException.php', + 'Symfony\\Component\\Yaml\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/yaml/Symfony/Component/Yaml/Exception/ExceptionInterface.php', + 'Symfony\\Component\\Yaml\\Exception\\ParseException' => $vendorDir . '/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php', + 'Symfony\\Component\\Yaml\\Exception\\RuntimeException' => $vendorDir . '/symfony/yaml/Symfony/Component/Yaml/Exception/RuntimeException.php', + 'Symfony\\Component\\Yaml\\Inline' => $vendorDir . '/symfony/yaml/Symfony/Component/Yaml/Inline.php', + 'Symfony\\Component\\Yaml\\Parser' => $vendorDir . '/symfony/yaml/Symfony/Component/Yaml/Parser.php', + 'Symfony\\Component\\Yaml\\Unescaper' => $vendorDir . '/symfony/yaml/Symfony/Component/Yaml/Unescaper.php', + 'Symfony\\Component\\Yaml\\Yaml' => $vendorDir . '/symfony/yaml/Symfony/Component/Yaml/Yaml.php', + 'Twig_Autoloader' => $vendorDir . '/twig/twig/lib/Twig/Autoloader.php', + 'Twig_Compiler' => $vendorDir . '/twig/twig/lib/Twig/Compiler.php', + 'Twig_CompilerInterface' => $vendorDir . '/twig/twig/lib/Twig/CompilerInterface.php', + 'Twig_Environment' => $vendorDir . '/twig/twig/lib/Twig/Environment.php', + 'Twig_Error' => $vendorDir . '/twig/twig/lib/Twig/Error.php', + 'Twig_Error_Loader' => $vendorDir . '/twig/twig/lib/Twig/Error/Loader.php', + 'Twig_Error_Runtime' => $vendorDir . '/twig/twig/lib/Twig/Error/Runtime.php', + 'Twig_Error_Syntax' => $vendorDir . '/twig/twig/lib/Twig/Error/Syntax.php', + 'Twig_ExistsLoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/ExistsLoaderInterface.php', + 'Twig_ExpressionParser' => $vendorDir . '/twig/twig/lib/Twig/ExpressionParser.php', + 'Twig_Extension' => $vendorDir . '/twig/twig/lib/Twig/Extension.php', + 'Twig_ExtensionInterface' => $vendorDir . '/twig/twig/lib/Twig/ExtensionInterface.php', + 'Twig_Extension_Core' => $vendorDir . '/twig/twig/lib/Twig/Extension/Core.php', + 'Twig_Extension_Debug' => $vendorDir . '/twig/twig/lib/Twig/Extension/Debug.php', + 'Twig_Extension_Escaper' => $vendorDir . '/twig/twig/lib/Twig/Extension/Escaper.php', + 'Twig_Extension_Optimizer' => $vendorDir . '/twig/twig/lib/Twig/Extension/Optimizer.php', + 'Twig_Extension_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/Extension/Sandbox.php', + 'Twig_Extension_Staging' => $vendorDir . '/twig/twig/lib/Twig/Extension/Staging.php', + 'Twig_Extension_StringLoader' => $vendorDir . '/twig/twig/lib/Twig/Extension/StringLoader.php', + 'Twig_Filter' => $vendorDir . '/twig/twig/lib/Twig/Filter.php', + 'Twig_FilterCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/FilterCallableInterface.php', + 'Twig_FilterInterface' => $vendorDir . '/twig/twig/lib/Twig/FilterInterface.php', + 'Twig_Filter_Function' => $vendorDir . '/twig/twig/lib/Twig/Filter/Function.php', + 'Twig_Filter_Method' => $vendorDir . '/twig/twig/lib/Twig/Filter/Method.php', + 'Twig_Filter_Node' => $vendorDir . '/twig/twig/lib/Twig/Filter/Node.php', + 'Twig_Function' => $vendorDir . '/twig/twig/lib/Twig/Function.php', + 'Twig_FunctionCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/FunctionCallableInterface.php', + 'Twig_FunctionInterface' => $vendorDir . '/twig/twig/lib/Twig/FunctionInterface.php', + 'Twig_Function_Function' => $vendorDir . '/twig/twig/lib/Twig/Function/Function.php', + 'Twig_Function_Method' => $vendorDir . '/twig/twig/lib/Twig/Function/Method.php', + 'Twig_Function_Node' => $vendorDir . '/twig/twig/lib/Twig/Function/Node.php', + 'Twig_Lexer' => $vendorDir . '/twig/twig/lib/Twig/Lexer.php', + 'Twig_LexerInterface' => $vendorDir . '/twig/twig/lib/Twig/LexerInterface.php', + 'Twig_LoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/LoaderInterface.php', + 'Twig_Loader_Array' => $vendorDir . '/twig/twig/lib/Twig/Loader/Array.php', + 'Twig_Loader_Chain' => $vendorDir . '/twig/twig/lib/Twig/Loader/Chain.php', + 'Twig_Loader_Filesystem' => $vendorDir . '/twig/twig/lib/Twig/Loader/Filesystem.php', + 'Twig_Loader_String' => $vendorDir . '/twig/twig/lib/Twig/Loader/String.php', + 'Twig_Markup' => $vendorDir . '/twig/twig/lib/Twig/Markup.php', + 'Twig_Node' => $vendorDir . '/twig/twig/lib/Twig/Node.php', + 'Twig_NodeInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeInterface.php', + 'Twig_NodeOutputInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeOutputInterface.php', + 'Twig_NodeTraverser' => $vendorDir . '/twig/twig/lib/Twig/NodeTraverser.php', + 'Twig_NodeVisitorInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitorInterface.php', + 'Twig_NodeVisitor_Escaper' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/Escaper.php', + 'Twig_NodeVisitor_Optimizer' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/Optimizer.php', + 'Twig_NodeVisitor_SafeAnalysis' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php', + 'Twig_NodeVisitor_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/Sandbox.php', + 'Twig_Node_AutoEscape' => $vendorDir . '/twig/twig/lib/Twig/Node/AutoEscape.php', + 'Twig_Node_Block' => $vendorDir . '/twig/twig/lib/Twig/Node/Block.php', + 'Twig_Node_BlockReference' => $vendorDir . '/twig/twig/lib/Twig/Node/BlockReference.php', + 'Twig_Node_Body' => $vendorDir . '/twig/twig/lib/Twig/Node/Body.php', + 'Twig_Node_Do' => $vendorDir . '/twig/twig/lib/Twig/Node/Do.php', + 'Twig_Node_Embed' => $vendorDir . '/twig/twig/lib/Twig/Node/Embed.php', + 'Twig_Node_Expression' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression.php', + 'Twig_Node_Expression_Array' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Array.php', + 'Twig_Node_Expression_AssignName' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/AssignName.php', + 'Twig_Node_Expression_Binary' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary.php', + 'Twig_Node_Expression_Binary_Add' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Add.php', + 'Twig_Node_Expression_Binary_And' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/And.php', + 'Twig_Node_Expression_Binary_BitwiseAnd' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php', + 'Twig_Node_Expression_Binary_BitwiseOr' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php', + 'Twig_Node_Expression_Binary_BitwiseXor' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php', + 'Twig_Node_Expression_Binary_Concat' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php', + 'Twig_Node_Expression_Binary_Div' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Div.php', + 'Twig_Node_Expression_Binary_Equal' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php', + 'Twig_Node_Expression_Binary_FloorDiv' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php', + 'Twig_Node_Expression_Binary_Greater' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php', + 'Twig_Node_Expression_Binary_GreaterEqual' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php', + 'Twig_Node_Expression_Binary_In' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/In.php', + 'Twig_Node_Expression_Binary_Less' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Less.php', + 'Twig_Node_Expression_Binary_LessEqual' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php', + 'Twig_Node_Expression_Binary_Mod' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php', + 'Twig_Node_Expression_Binary_Mul' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php', + 'Twig_Node_Expression_Binary_NotEqual' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php', + 'Twig_Node_Expression_Binary_NotIn' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php', + 'Twig_Node_Expression_Binary_Or' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Or.php', + 'Twig_Node_Expression_Binary_Power' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Power.php', + 'Twig_Node_Expression_Binary_Range' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Range.php', + 'Twig_Node_Expression_Binary_Sub' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php', + 'Twig_Node_Expression_BlockReference' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/BlockReference.php', + 'Twig_Node_Expression_Call' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Call.php', + 'Twig_Node_Expression_Conditional' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Conditional.php', + 'Twig_Node_Expression_Constant' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Constant.php', + 'Twig_Node_Expression_ExtensionReference' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php', + 'Twig_Node_Expression_Filter' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Filter.php', + 'Twig_Node_Expression_Filter_Default' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Filter/Default.php', + 'Twig_Node_Expression_Function' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Function.php', + 'Twig_Node_Expression_GetAttr' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/GetAttr.php', + 'Twig_Node_Expression_MethodCall' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/MethodCall.php', + 'Twig_Node_Expression_Name' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Name.php', + 'Twig_Node_Expression_Parent' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Parent.php', + 'Twig_Node_Expression_TempName' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/TempName.php', + 'Twig_Node_Expression_Test' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test.php', + 'Twig_Node_Expression_Test_Constant' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Constant.php', + 'Twig_Node_Expression_Test_Defined' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Defined.php', + 'Twig_Node_Expression_Test_Divisibleby' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php', + 'Twig_Node_Expression_Test_Even' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Even.php', + 'Twig_Node_Expression_Test_Null' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Null.php', + 'Twig_Node_Expression_Test_Odd' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Odd.php', + 'Twig_Node_Expression_Test_Sameas' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php', + 'Twig_Node_Expression_Unary' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary.php', + 'Twig_Node_Expression_Unary_Neg' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php', + 'Twig_Node_Expression_Unary_Not' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary/Not.php', + 'Twig_Node_Expression_Unary_Pos' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php', + 'Twig_Node_Flush' => $vendorDir . '/twig/twig/lib/Twig/Node/Flush.php', + 'Twig_Node_For' => $vendorDir . '/twig/twig/lib/Twig/Node/For.php', + 'Twig_Node_ForLoop' => $vendorDir . '/twig/twig/lib/Twig/Node/ForLoop.php', + 'Twig_Node_If' => $vendorDir . '/twig/twig/lib/Twig/Node/If.php', + 'Twig_Node_Import' => $vendorDir . '/twig/twig/lib/Twig/Node/Import.php', + 'Twig_Node_Include' => $vendorDir . '/twig/twig/lib/Twig/Node/Include.php', + 'Twig_Node_Macro' => $vendorDir . '/twig/twig/lib/Twig/Node/Macro.php', + 'Twig_Node_Module' => $vendorDir . '/twig/twig/lib/Twig/Node/Module.php', + 'Twig_Node_Print' => $vendorDir . '/twig/twig/lib/Twig/Node/Print.php', + 'Twig_Node_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/Node/Sandbox.php', + 'Twig_Node_SandboxedModule' => $vendorDir . '/twig/twig/lib/Twig/Node/SandboxedModule.php', + 'Twig_Node_SandboxedPrint' => $vendorDir . '/twig/twig/lib/Twig/Node/SandboxedPrint.php', + 'Twig_Node_Set' => $vendorDir . '/twig/twig/lib/Twig/Node/Set.php', + 'Twig_Node_SetTemp' => $vendorDir . '/twig/twig/lib/Twig/Node/SetTemp.php', + 'Twig_Node_Spaceless' => $vendorDir . '/twig/twig/lib/Twig/Node/Spaceless.php', + 'Twig_Node_Text' => $vendorDir . '/twig/twig/lib/Twig/Node/Text.php', + 'Twig_Parser' => $vendorDir . '/twig/twig/lib/Twig/Parser.php', + 'Twig_ParserInterface' => $vendorDir . '/twig/twig/lib/Twig/ParserInterface.php', + 'Twig_Sandbox_SecurityError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityError.php', + 'Twig_Sandbox_SecurityPolicy' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php', + 'Twig_Sandbox_SecurityPolicyInterface' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php', + 'Twig_SimpleFilter' => $vendorDir . '/twig/twig/lib/Twig/SimpleFilter.php', + 'Twig_SimpleFunction' => $vendorDir . '/twig/twig/lib/Twig/SimpleFunction.php', + 'Twig_Template' => $vendorDir . '/twig/twig/lib/Twig/Template.php', + 'Twig_TemplateInterface' => $vendorDir . '/twig/twig/lib/Twig/TemplateInterface.php', + 'Twig_Test' => $vendorDir . '/twig/twig/lib/Twig/Test.php', + 'Twig_TestCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/TestCallableInterface.php', + 'Twig_TestInterface' => $vendorDir . '/twig/twig/lib/Twig/TestInterface.php', + 'Twig_Test_Function' => $vendorDir . '/twig/twig/lib/Twig/Test/Function.php', + 'Twig_Test_IntegrationTestCase' => $vendorDir . '/twig/twig/lib/Twig/Test/IntegrationTestCase.php', + 'Twig_Test_Method' => $vendorDir . '/twig/twig/lib/Twig/Test/Method.php', + 'Twig_Test_Node' => $vendorDir . '/twig/twig/lib/Twig/Test/Node.php', + 'Twig_Test_NodeTestCase' => $vendorDir . '/twig/twig/lib/Twig/Test/NodeTestCase.php', + 'Twig_Token' => $vendorDir . '/twig/twig/lib/Twig/Token.php', + 'Twig_TokenParser' => $vendorDir . '/twig/twig/lib/Twig/TokenParser.php', + 'Twig_TokenParserBroker' => $vendorDir . '/twig/twig/lib/Twig/TokenParserBroker.php', + 'Twig_TokenParserBrokerInterface' => $vendorDir . '/twig/twig/lib/Twig/TokenParserBrokerInterface.php', + 'Twig_TokenParserInterface' => $vendorDir . '/twig/twig/lib/Twig/TokenParserInterface.php', + 'Twig_TokenParser_AutoEscape' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/AutoEscape.php', + 'Twig_TokenParser_Block' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Block.php', + 'Twig_TokenParser_Do' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Do.php', + 'Twig_TokenParser_Embed' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Embed.php', + 'Twig_TokenParser_Extends' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Extends.php', + 'Twig_TokenParser_Filter' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Filter.php', + 'Twig_TokenParser_Flush' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Flush.php', + 'Twig_TokenParser_For' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/For.php', + 'Twig_TokenParser_From' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/From.php', + 'Twig_TokenParser_If' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/If.php', + 'Twig_TokenParser_Import' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Import.php', + 'Twig_TokenParser_Include' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Include.php', + 'Twig_TokenParser_Macro' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Macro.php', + 'Twig_TokenParser_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Sandbox.php', + 'Twig_TokenParser_Set' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Set.php', + 'Twig_TokenParser_Spaceless' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Spaceless.php', + 'Twig_TokenParser_Use' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Use.php', + 'Twig_TokenStream' => $vendorDir . '/twig/twig/lib/Twig/TokenStream.php', +); diff --git a/sources/phpBB/vendor/composer/autoload_namespaces.php b/sources/phpBB/vendor/composer/autoload_namespaces.php new file mode 100644 index 0000000..f360b2f --- /dev/null +++ b/sources/phpBB/vendor/composer/autoload_namespaces.php @@ -0,0 +1,23 @@ + array($vendorDir . '/twig/twig/lib'), + 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), + 'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'), + 'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'), + 'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'), + 'Symfony\\Component\\Filesystem\\' => array($vendorDir . '/symfony/filesystem'), + 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'), + 'Symfony\\Component\\DependencyInjection\\' => array($vendorDir . '/symfony/dependency-injection'), + 'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'), + 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), + 'Symfony\\Component\\Config\\' => array($vendorDir . '/symfony/config'), + 'Psr\\Log\\' => array($vendorDir . '/psr/log'), + 'OAuth\\Unit' => array($vendorDir . '/lusitanian/oauth/tests'), + 'OAuth' => array($vendorDir . '/lusitanian/oauth/src'), +); diff --git a/sources/phpBB/vendor/composer/autoload_psr4.php b/sources/phpBB/vendor/composer/autoload_psr4.php new file mode 100644 index 0000000..b265c64 --- /dev/null +++ b/sources/phpBB/vendor/composer/autoload_psr4.php @@ -0,0 +1,9 @@ + $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + + $loader->register(true); + + return $loader; + } +} diff --git a/sources/phpBB/vendor/composer/installed.json b/sources/phpBB/vendor/composer/installed.json new file mode 100644 index 0000000..966d520 --- /dev/null +++ b/sources/phpBB/vendor/composer/installed.json @@ -0,0 +1,722 @@ +[ + { + "name": "lusitanian/oauth", + "version": "v0.2.1", + "version_normalized": "0.2.1.0", + "source": { + "type": "git", + "url": "https://github.com/Lusitanian/PHPoAuthLib.git", + "reference": "00c667d93058e983fc1b7d3d1cebdb1bc03fb043" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Lusitanian/PHPoAuthLib/zipball/00c667d93058e983fc1b7d3d1cebdb1bc03fb043", + "reference": "00c667d93058e983fc1b7d3d1cebdb1bc03fb043", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*", + "predis/predis": "0.8.*@dev", + "symfony/http-foundation": "~2.1" + }, + "suggest": { + "predis/predis": "Allows using the Redis storage backend.", + "symfony/http-foundation": "Allows using the Symfony Session storage backend." + }, + "time": "2013-08-29 21:40:04", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "OAuth": "src", + "OAuth\\Unit": "tests" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "David Desberg", + "email": "david@daviddesberg.com" + }, + { + "name": "Pieter Hordijk", + "email": "info@pieterhordijk.com", + "homepage": "https://pieterhordijk.com", + "role": "developer" + } + ], + "description": "PHP 5.3+ oAuth 1/2 Library", + "keywords": [ + "Authentication", + "authorization", + "oauth", + "security" + ] + }, + { + "name": "symfony/filesystem", + "version": "v2.3.21", + "version_normalized": "2.3.21.0", + "target-dir": "Symfony/Component/Filesystem", + "source": { + "type": "git", + "url": "https://github.com/symfony/Filesystem.git", + "reference": "1c3a5fab445d1d4a5d57f8fbf1379696c9785942" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/1c3a5fab445d1d4a5d57f8fbf1379696c9785942", + "reference": "1c3a5fab445d1d4a5d57f8fbf1379696c9785942", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2014-09-22 08:32:35", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/config", + "version": "v2.3.21", + "version_normalized": "2.3.21.0", + "target-dir": "Symfony/Component/Config", + "source": { + "type": "git", + "url": "https://github.com/symfony/Config.git", + "reference": "f9fac999dbc2c6aabd749c034d938b5f9aa5fb7d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Config/zipball/f9fac999dbc2c6aabd749c034d938b5f9aa5fb7d", + "reference": "f9fac999dbc2c6aabd749c034d938b5f9aa5fb7d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/filesystem": "~2.3" + }, + "time": "2014-09-23 05:15:05", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Config\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Config Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/console", + "version": "v2.3.21", + "version_normalized": "2.3.21.0", + "target-dir": "Symfony/Component/Console", + "source": { + "type": "git", + "url": "https://github.com/symfony/Console.git", + "reference": "aa12ac573c583a74c2cb26ad9be478e119f04ad1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Console/zipball/aa12ac573c583a74c2cb26ad9be478e119f04ad1", + "reference": "aa12ac573c583a74c2cb26ad9be478e119f04ad1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/event-dispatcher": "~2.1" + }, + "suggest": { + "symfony/event-dispatcher": "" + }, + "time": "2014-10-05 13:45:10", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Console\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Console Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/dependency-injection", + "version": "v2.3.21", + "version_normalized": "2.3.21.0", + "target-dir": "Symfony/Component/DependencyInjection", + "source": { + "type": "git", + "url": "https://github.com/symfony/DependencyInjection.git", + "reference": "e2324e1c8c39faa5f27e6170b278d7f631574141" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/e2324e1c8c39faa5f27e6170b278d7f631574141", + "reference": "e2324e1c8c39faa5f27e6170b278d7f631574141", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/config": "~2.2", + "symfony/yaml": "~2.0" + }, + "suggest": { + "symfony/config": "", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "time": "2014-10-01 05:38:33", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\DependencyInjection\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/http-foundation", + "version": "v2.3.21", + "version_normalized": "2.3.21.0", + "target-dir": "Symfony/Component/HttpFoundation", + "source": { + "type": "git", + "url": "https://github.com/symfony/HttpFoundation.git", + "reference": "30c90f08f948dd43e7310beae7a85c02ad2b655d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/30c90f08f948dd43e7310beae7a85c02ad2b655d", + "reference": "30c90f08f948dd43e7310beae7a85c02ad2b655d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2014-10-23 13:11:04", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "classmap": [ + "Symfony/Component/HttpFoundation/Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.3.21", + "version_normalized": "2.3.21.0", + "target-dir": "Symfony/Component/EventDispatcher", + "source": { + "type": "git", + "url": "https://github.com/symfony/EventDispatcher.git", + "reference": "3e0b837811fadd73c833c7c06a92201d953df59d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/3e0b837811fadd73c833c7c06a92201d953df59d", + "reference": "3e0b837811fadd73c833c7c06a92201d953df59d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/dependency-injection": "~2.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "time": "2014-10-01 05:39:06", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/debug", + "version": "v2.3.21", + "version_normalized": "2.3.21.0", + "target-dir": "Symfony/Component/Debug", + "source": { + "type": "git", + "url": "https://github.com/symfony/Debug.git", + "reference": "883f847ad179e92549a8cea372b08e5ef47ffe40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Debug/zipball/883f847ad179e92549a8cea372b08e5ef47ffe40", + "reference": "883f847ad179e92549a8cea372b08e5ef47ffe40", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/http-foundation": "~2.1", + "symfony/http-kernel": "~2.1" + }, + "suggest": { + "symfony/class-loader": "", + "symfony/http-foundation": "", + "symfony/http-kernel": "" + }, + "time": "2014-10-09 16:42:17", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Debug\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Debug Component", + "homepage": "http://symfony.com" + }, + { + "name": "psr/log", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "shasum": "" + }, + "time": "2012-12-21 11:40:51", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Psr\\Log\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "keywords": [ + "log", + "psr", + "psr-3" + ] + }, + { + "name": "symfony/http-kernel", + "version": "v2.3.21", + "version_normalized": "2.3.21.0", + "target-dir": "Symfony/Component/HttpKernel", + "source": { + "type": "git", + "url": "https://github.com/symfony/HttpKernel.git", + "reference": "0154ff659004d4148e8da0f2bdb672efe55e6ee5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/0154ff659004d4148e8da0f2bdb672efe55e6ee5", + "reference": "0154ff659004d4148e8da0f2bdb672efe55e6ee5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "psr/log": "~1.0", + "symfony/debug": "~2.3", + "symfony/event-dispatcher": "~2.1", + "symfony/http-foundation": "~2.2" + }, + "require-dev": { + "symfony/browser-kit": "~2.2", + "symfony/class-loader": "~2.1", + "symfony/config": "~2.0", + "symfony/console": "~2.2", + "symfony/dependency-injection": "~2.0", + "symfony/finder": "~2.0", + "symfony/process": "~2.0", + "symfony/routing": "~2.2", + "symfony/stopwatch": "~2.2", + "symfony/templating": "~2.2" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/class-loader": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "", + "symfony/finder": "" + }, + "time": "2014-10-24 05:54:08", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\HttpKernel\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony HttpKernel Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/routing", + "version": "v2.3.21", + "version_normalized": "2.3.21.0", + "target-dir": "Symfony/Component/Routing", + "source": { + "type": "git", + "url": "https://github.com/symfony/Routing.git", + "reference": "f7f8ebf9c99e5ebfdb908c3558a818c2883eab1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Routing/zipball/f7f8ebf9c99e5ebfdb908c3558a818c2883eab1f", + "reference": "f7f8ebf9c99e5ebfdb908c3558a818c2883eab1f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "doctrine/common": "~2.2", + "psr/log": "~1.0", + "symfony/config": "~2.2", + "symfony/http-foundation": "~2.3", + "symfony/yaml": "~2.0" + }, + "suggest": { + "doctrine/common": "", + "symfony/config": "", + "symfony/yaml": "" + }, + "time": "2014-10-13 12:38:27", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Routing\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Routing Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/yaml", + "version": "v2.3.21", + "version_normalized": "2.3.21.0", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "34687c6236f1dfcebc874fbebd8da74d90f9f64f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/34687c6236f1dfcebc874fbebd8da74d90f9f64f", + "reference": "34687c6236f1dfcebc874fbebd8da74d90f9f64f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2014-10-01 05:38:33", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com" + }, + { + "name": "twig/twig", + "version": "v1.13.2", + "version_normalized": "1.13.2.0", + "source": { + "type": "git", + "url": "https://github.com/fabpot/Twig.git", + "reference": "6d6a1009427d1f398c9d40904147bf9f723d5755" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fabpot/Twig/zipball/6d6a1009427d1f398c9d40904147bf9f723d5755", + "reference": "6d6a1009427d1f398c9d40904147bf9f723d5755", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "time": "2013-08-03 15:35:31", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.13-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Twig_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ] + } +] diff --git a/sources/phpBB/vendor/lusitanian/oauth/LICENSE b/sources/phpBB/vendor/lusitanian/oauth/LICENSE new file mode 100644 index 0000000..cea529b --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/LICENSE @@ -0,0 +1,20 @@ +(c) 2013 David Desberg +Contributions (c) 2013 Pieter Hordijk + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sources/phpBB/vendor/lusitanian/oauth/composer.json b/sources/phpBB/vendor/lusitanian/oauth/composer.json new file mode 100644 index 0000000..2ed12ad --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/composer.json @@ -0,0 +1,39 @@ +{ + "name": "lusitanian/oauth", + "description": "PHP 5.3+ oAuth 1/2 Library", + "keywords": ["oauth", "authentication", "authorization", "security"], + "license": "MIT", + "authors": [ + { + "name": "David Desberg", + "email": "david@daviddesberg.com" + }, + { + "name": "Pieter Hordijk", + "email": "info@pieterhordijk.com" + } + ], + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "symfony/http-foundation": "~2.1", + "predis/predis": "0.8.*@dev", + "phpunit/phpunit": "3.7.*" + }, + "suggest": { + "symfony/http-foundation": "Allows using the Symfony Session storage backend.", + "predis/predis": "Allows using the Redis storage backend." + }, + "autoload": { + "psr-0": { + "OAuth": "src", + "OAuth\\Unit": "tests" + } + }, + "extra": { + "branch-alias": { + "dev-master": "0.1-dev" + } + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/AutoLoader.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/AutoLoader.php new file mode 100644 index 0000000..3a43049 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/AutoLoader.php @@ -0,0 +1,77 @@ + + */ +class AutoLoader +{ + /** + * @var string The namespace prefix for this instance. + */ + protected $namespace = ''; + + /** + * @var string The filesystem prefix to use for this instance + */ + protected $path = ''; + + /** + * Build the instance of the autoloader + * + * @param string $namespace The prefixed namespace this instance will load + * @param string $path The filesystem path to the root of the namespace + */ + public function __construct($namespace, $path) + { + $this->namespace = ltrim($namespace, '\\'); + $this->path = rtrim($path, '/\\') . DIRECTORY_SEPARATOR; + } + + /** + * Try to load a class + * + * @param string $class The class name to load + * + * @return boolean If the loading was successful + */ + public function load($class) + { + $class = ltrim($class, '\\'); + + if (strpos($class, $this->namespace) === 0) { + $nsparts = explode('\\', $class); + $class = array_pop($nsparts); + $nsparts[] = ''; + $path = $this->path . implode(DIRECTORY_SEPARATOR, $nsparts); + $path .= str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php'; + + if (file_exists($path)) { + require $path; + return true; + } + } + return false; + } + + /** + * Register the autoloader to PHP + * + * @return boolean The status of the registration + */ + public function register() + { + return spl_autoload_register(array($this, 'load')); + } + + /** + * Unregister the autoloader to PHP + * + * @return boolean The status of the unregistration + */ + public function unregister() + { + return spl_autoload_unregister(array($this, 'load')); + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Consumer/Credentials.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Consumer/Credentials.php new file mode 100644 index 0000000..ba23386 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Consumer/Credentials.php @@ -0,0 +1,60 @@ +consumerId = $consumerId; + $this->consumerSecret = $consumerSecret; + $this->callbackUrl = $callbackUrl; + } + + /** + * @return string + */ + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + /** + * @return string + */ + public function getConsumerId() + { + return $this->consumerId; + } + + /** + * @return string + */ + public function getConsumerSecret() + { + return $this->consumerSecret; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Exception/Exception.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Exception/Exception.php new file mode 100644 index 0000000..b8d7f46 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Exception/Exception.php @@ -0,0 +1,10 @@ +maxRedirects = $redirects; + return $this; + } + + /** + * @param int $timeout Request timeout time for client in seconds + * @return ClientInterface + */ + public function setTimeout($timeout) + { + $this->timeout = $timeout; + return $this; + } + + /** + * @param array $headers + * @return void + */ + public function normalizeHeaders(&$headers) + { + // Normalize headers + array_walk( $headers, + function(&$val, &$key) + { + $key = ucfirst( strtolower($key) ); + $val = ucfirst( strtolower($key) ) . ': ' . $val; + } + ); + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Client/ClientInterface.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Client/ClientInterface.php new file mode 100644 index 0000000..7fc1b74 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Client/ClientInterface.php @@ -0,0 +1,25 @@ +forceSSL3 = $force; + return $this; + } + + /** + * Any implementing HTTP providers should send a request to the provided endpoint with the parameters. + * They should return, in string form, the response body and throw an exception on error. + * + * @param UriInterface $endpoint + * @param mixed $requestBody + * @param array $extraHeaders + * @param string $method + * @return string + * @throws TokenResponseException + * @throws \InvalidArgumentException + */ + public function retrieveResponse(UriInterface $endpoint, $requestBody, array $extraHeaders = array(), $method = 'POST') + { + // Normalize method name + $method = strtoupper($method); + + $this->normalizeHeaders($extraHeaders); + + if( $method === 'GET' && !empty($requestBody) ) { + throw new \InvalidArgumentException('No body expected for "GET" request.'); + } + + if( !isset($extraHeaders['Content-type'] ) && $method === 'POST' && is_array($requestBody) ) { + $extraHeaders['Content-type'] = 'Content-type: application/x-www-form-urlencoded'; + } + + $extraHeaders['Host'] = 'Host: '.$endpoint->getHost(); + $extraHeaders['Connection'] = 'Connection: close'; + + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, $endpoint->getAbsoluteUri()); + + if( $method === 'POST' || $method === 'PUT' ) { + if( $requestBody && is_array($requestBody) ) { + $requestBody = http_build_query($requestBody, null, '&'); + } + + if( $method === 'PUT' ) { + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); + } else { + curl_setopt($ch, CURLOPT_POST, true); + } + + curl_setopt($ch, CURLOPT_POSTFIELDS, $requestBody); + } else { + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); + } + + if( $this->maxRedirects > 0 ) { + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($ch, CURLOPT_MAXREDIRS, $this->maxRedirects); + } + + curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_HEADER, false); + curl_setopt($ch, CURLOPT_HTTPHEADER, $extraHeaders); + + if( $this->forceSSL3 ) { + curl_setopt($ch, CURLOPT_SSLVERSION, 3); + } + + $response = curl_exec($ch); + $responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + + if( false === $response ) { + $errNo = curl_errno($ch); + $errStr = curl_error($ch); + curl_close($ch); + if (empty($errStr)) { + throw new TokenResponseException( 'Failed to request resource.', $responseCode ); + } + throw new TokenResponseException( 'cURL Error # '.$errNo.': '.$errStr, $responseCode ); + } + + curl_close($ch); + + return $response; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Client/StreamClient.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Client/StreamClient.php new file mode 100644 index 0000000..d01d375 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Client/StreamClient.php @@ -0,0 +1,75 @@ +normalizeHeaders($extraHeaders); + + if( $method === 'GET' && !empty($requestBody) ) { + throw new \InvalidArgumentException('No body expected for "GET" request.'); + } + + if( !isset($extraHeaders['Content-type'] ) && $method === 'POST' && is_array($requestBody) ) { + $extraHeaders['Content-type'] = 'Content-type: application/x-www-form-urlencoded'; + } + + $extraHeaders['Host'] = 'Host: '.$endpoint->getHost(); + $extraHeaders['Connection'] = 'Connection: close'; + + if( is_array($requestBody) ) { + $requestBody = http_build_query($requestBody, null, '&'); + } + + $context = $this->generateStreamContext($requestBody, $extraHeaders, $method); + + $level = error_reporting(0); + $response = file_get_contents($endpoint->getAbsoluteUri(), false, $context); + error_reporting($level); + if( false === $response ) { + $lastError = error_get_last(); + if (is_null($lastError)) + throw new TokenResponseException( 'Failed to request resource.' ); + throw new TokenResponseException( $lastError['message'] ); + } + + return $response; + } + + private function generateStreamContext($body, $headers, $method) + { + return stream_context_create(array( + 'http' => array( + 'method' => $method, + 'header' => array_values($headers), + 'content' => $body, + 'protocol_version' => '1.1', + 'user_agent' => 'Lusitanian OAuth Client', + 'max_redirects' => $this->maxRedirects, + 'timeout' => $this->timeout + ), + )); + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Exception/TokenResponseException.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Exception/TokenResponseException.php new file mode 100644 index 0000000..290b442 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Exception/TokenResponseException.php @@ -0,0 +1,12 @@ +parseUri($uri); + } + } + + /** + * @param string $uri + * @throws \InvalidArgumentException + */ + protected function parseUri($uri) { + if( false === ( $uriParts = parse_url($uri) ) ) { + // congratulations if you've managed to get parse_url to fail, it seems to always return some semblance of a parsed url no matter what + throw new InvalidArgumentException( + "Invalid URI: $uri" + ); + } + + if (!isset($uriParts['scheme'])) { + throw new InvalidArgumentException( + 'Invalid URI: http|https scheme required' + ); + } + + $this->scheme = $uriParts['scheme']; + $this->host = $uriParts['host']; + + if (isset($uriParts['port'])) { + $this->port = $uriParts['port']; + $this->explicitPortSpecified = true; + } else { + $this->port = strcmp('https', $uriParts['scheme']) ? 80 : 443; + $this->explicitPortSpecified = false; + } + + if (isset($uriParts['path'])) { + $this->path = $uriParts['path']; + if ('/' == $uriParts['path']) { + $this->explicitTrailingHostSlash = true; + } + } else { + $this->path = '/'; + } + + $this->query = isset($uriParts['query']) ? $uriParts['query'] : ''; + $this->fragment = isset($uriParts['fragment']) ? $uriParts['fragment'] : ''; + + $userInfo = ''; + if (!empty($uriParts['user'])) { + $userInfo .= $uriParts['user']; + } + if ($userInfo && !empty($uriParts['pass'])) { + $userInfo .= ':' . $uriParts['pass']; + } + + $this->setUserInfo($userInfo); + } + + /** + * @param string $rawUserInfo + * @return string + */ + protected function protectUserInfo($rawUserInfo) { + $colonPos = strpos($rawUserInfo, ':'); + + // rfc3986-3.2.1 | http://tools.ietf.org/html/rfc3986#section-3.2 + // "Applications should not render as clear text any data + // after the first colon (":") character found within a userinfo + // subcomponent unless the data after the colon is the empty string + // (indicating no password)" + if ($colonPos !== FALSE && strlen($rawUserInfo)-1 > $colonPos) { + return substr($rawUserInfo, 0, $colonPos) . ':********'; + } else { + return $rawUserInfo; + } + } + + /** + * @return string + */ + public function getScheme() { + return $this->scheme; + } + + /** + * @return string + */ + public function getUserInfo() { + return $this->userInfo; + } + + /** + * @return string + */ + public function getRawUserInfo() { + return $this->rawUserInfo; + } + + /** + * @return string + */ + public function getHost() { + return $this->host; + } + + /** + * @return int + */ + public function getPort() { + return $this->port; + } + + /** + * @return string + */ + public function getPath() { + return $this->path; + } + + /** + * @return string + */ + public function getQuery() { + return $this->query; + } + + /** + * @return string + */ + public function getFragment() { + return $this->fragment; + } + + /** + * Uses protected user info by default as per rfc3986-3.2.1 + * Uri::getRawAuthority() is available if plain-text password information is desirable. + * + * @return string + */ + public function getAuthority() { + $authority = $this->userInfo ? $this->userInfo.'@' : ''; + $authority .= $this->host; + + if ($this->explicitPortSpecified) { + $authority .= ":{$this->port}"; + } + + return $authority; + } + + /** + * @return string + */ + public function getRawAuthority() { + $authority = $this->rawUserInfo ? $this->rawUserInfo.'@' : ''; + $authority .= $this->host; + + if ($this->explicitPortSpecified) { + $authority .= ":{$this->port}"; + } + + return $authority; + } + + /** + * @return string + */ + public function getAbsoluteUri() { + $uri = $this->scheme . '://' . $this->getRawAuthority(); + + if ('/' == $this->path) { + $uri .= $this->explicitTrailingHostSlash ? '/' : ''; + } else { + $uri .= $this->path; + } + + if (!empty($this->query)) { + $uri .= "?{$this->query}"; + } + + if (!empty($this->fragment)) { + $uri .= "#{$this->fragment}"; + } + + return $uri; + } + + /** + * @return string + */ + public function getRelativeUri() { + $uri = ''; + + if ('/' == $this->path) { + $uri .= $this->explicitTrailingHostSlash ? '/' : ''; + } else { + $uri .= $this->path; + } + + return $uri; + } + + /** + * Uses protected user info by default as per rfc3986-3.2.1 + * Uri::getAbsoluteUri() is available if plain-text password information is desirable. + * + * @return string + */ + public function __toString() { + $uri = $this->scheme . '://' . $this->getAuthority(); + + if ('/' == $this->path) { + $uri .= $this->explicitTrailingHostSlash ? '/' : ''; + } else { + $uri .= $this->path; + } + + if (!empty($this->query)) { + $uri .= "?{$this->query}"; + } + + if (!empty($this->fragment)) { + $uri .= "#{$this->fragment}"; + } + + return $uri; + } + + /** + * @param $path + */ + public function setPath($path) + { + if( empty($path) ) { + $this->path = '/'; + $this->explicitTrailingHostSlash = false; + } else { + $this->path = $path; + if( '/' === $this->path ) { + $this->explicitTrailingHostSlash = true; + } + } + } + + /** + * @param string $query + */ + public function setQuery($query) + { + $this->query = $query; + } + + /** + * @param string $var + * @param string $val + */ + public function addToQuery($var, $val) { + if( strlen($this->query) > 0 ) { + $this->query .= '&'; + } + $this->query .= http_build_query( array($var => $val) ); + } + + /** + * @param string $fragment + */ + public function setFragment($fragment) + { + $this->fragment = $fragment; + } + + /** + * @param string $scheme + */ + public function setScheme($scheme) + { + $this->scheme = $scheme; + } + + + /** + * @param string $userInfo + */ + public function setUserInfo($userInfo) { + $this->userInfo = $userInfo ? $this->protectUserInfo($userInfo) : ''; + $this->rawUserInfo = $userInfo; + } + + + /** + * @param int $port + */ + public function setPort($port) { + $this->port = intval($port); + + if( ( 'https' === $this->scheme && $this->port === 443 ) || ( 'http' === $this->scheme && $this->port === 80 ) ) { + $this->explicitPortSpecified = false; + } else { + $this->explicitPortSpecified = true; + } + } + + + /** + * @param string $host + */ + public function setHost($host) { + $this->host = $host; + } + + /** + * @return bool + */ + public function hasExplicitTrailingHostSlash() + { + return $this->explicitTrailingHostSlash; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Uri/UriFactory.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Uri/UriFactory.php new file mode 100644 index 0000000..dca9682 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Uri/UriFactory.php @@ -0,0 +1,154 @@ +attemptProxyStyleParse($_server)) { + return $uri; + } + + $scheme = $this->detectScheme($_server); + $host = $this->detectHost($_server); + $port = $this->detectPort($_server); + $path = $this->detectPath($_server); + $query = $this->detectQuery($_server); + + return $this->createFromParts($scheme, '', $host, $port, $path, $query); + } + + /** + * @param string $absoluteUri + * @return UriInterface + */ + public function createFromAbsolute($absoluteUri) + { + return new Uri($absoluteUri); + } + + /** + * Factory method to build a URI from parts + * + * @param string $scheme + * @param string $userInfo + * @param string $host + * @param string $port + * @param string $path + * @param string $query + * @param string $fragment + * @return UriInterface + */ + public function createFromParts($scheme, $userInfo, $host, $port, $path = '', $query = '', $fragment = '') + { + $uri = new Uri(); + $uri->setScheme($scheme); + $uri->setUserInfo($userInfo); + $uri->setHost($host); + $uri->setPort($port); + $uri->setPath($path); + $uri->setQuery($query); + $uri->setFragment($fragment); + + return $uri; + } + + /** + * @param array $_server + * @return UriInterface|null + */ + private function attemptProxyStyleParse($_server) + { + // If the raw HTTP request message arrives with a proxy-style absolute URI in the + // initial request line, the absolute URI is stored in $_SERVER['REQUEST_URI'] and + // we only need to parse that. + if (isset($_server['REQUEST_URI']) && parse_url($_server['REQUEST_URI'], PHP_URL_SCHEME)) { + return new Uri($_server['REQUEST_URI']); + } + + return null; + } + + /** + * @param array $_server + * @return string + * @throws RuntimeException + */ + private function detectPath($_server) { + if (isset($_server['REQUEST_URI'])) { + $uri = $_server['REQUEST_URI']; + } elseif (isset($_server['REDIRECT_URL'])) { + $uri = $_server['REDIRECT_URL']; + } else { + throw new RuntimeException("Could not detect URI path from superglobal"); + } + + $queryStr = strpos($uri, '?'); + if ($queryStr !== false) { + $uri = substr($uri, 0, $queryStr); + } + + return $uri; + } + + /** + * @param array $_server + * @return string + */ + private function detectHost(array $_server) { + $host = isset($_server['HTTP_HOST']) ? $_server['HTTP_HOST'] : ''; + + if (strstr($host, ':')) { + $host = parse_url($host, PHP_URL_HOST); + } + + return $host; + } + + /** + * @param array $_server + * @return string + */ + private function detectPort(array $_server) { + return isset($_server['SERVER_PORT']) ? $_server['SERVER_PORT'] : 80; + } + + /** + * @param array $_server + * @return string + */ + private function detectQuery(array $_server) { + return isset($_server['QUERY_STRING']) ? $_server['QUERY_STRING'] : ''; + } + + /** + * Determine URI scheme component from superglobal array + * + * When using ISAPI with IIS, the value will be "off" if the request was + * not made through the HTTPS protocol. As a result, we filter the + * value to a bool. + * + * @param array $_server A super-global $_SERVER array + * + * @return string Returns http or https depending on the URI scheme + */ + private function detectScheme(array $_server) { + if (isset($_server['HTTPS']) + && filter_var($_server['HTTPS'], FILTER_VALIDATE_BOOLEAN) + ) { + return 'https'; + } else { + return 'http'; + } + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Uri/UriFactoryInterface.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Uri/UriFactoryInterface.php new file mode 100644 index 0000000..a5a15cc --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Http/Uri/UriFactoryInterface.php @@ -0,0 +1,41 @@ +credentials = $credentials; + $this->httpClient = $httpClient; + $this->storage = $storage; + } + + protected function determineRequestUriFromPath($path, UriInterface $baseApiUri = null) + { + if( $path instanceof UriInterface ) { + $uri = $path; + } elseif( stripos($path, 'http://') === 0 || stripos($path, 'https://') === 0 ) { + $uri = new Uri($path); + } else { + if( null === $baseApiUri ) { + throw new Exception('An absolute URI must be passed to ServiceInterface::request as no baseApiUri is set.'); + } + + $uri = clone $baseApiUri; + if( false !== strpos($path, '?') ) { + $parts = explode('?', $path, 2); + $path = $parts[0]; + $query = $parts[1]; + $uri->setQuery($query); + } + + if( $path[0] === '/' ) { + $path = substr($path, 1); + } + + $uri->setPath($uri->getPath() . $path); + } + + return $uri; + } + + /** + * Accessor to the storage adapter to be able to retrieve tokens + * + */ + public function getStorage() { + return $this->storage; + } + + /** + * @return string + */ + public function service() + { + // get class name without backslashes + $classname = get_class($this); + return preg_replace('/^.*\\\\/', '', $classname); + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Service/ServiceInterface.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Service/ServiceInterface.php new file mode 100644 index 0000000..57bdeaa --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Service/ServiceInterface.php @@ -0,0 +1,48 @@ +tokens = array(); + } + + /** + * @return \OAuth\Common\Token\TokenInterface + * @throws TokenNotFoundException + */ + public function retrieveAccessToken($service) + { + if ($this->hasAccessToken($service)) + { + return $this->tokens[$service]; + } + + throw new TokenNotFoundException('Token not stored'); + } + + /** + * @param \OAuth\Common\Token\TokenInterface $token + */ + public function storeAccessToken($service, TokenInterface $token) + { + $this->tokens[$service] = $token; + + // allow chaining + return $this; + } + + /** + * @return bool + */ + public function hasAccessToken($service) + { + return isset($this->tokens[$service]) && + $this->tokens[$service] instanceOf TokenInterface; + } + + /** + * Delete the user's token. Aka, log out. + */ + public function clearToken($service) + { + if (array_key_exists($service, $this->tokens)) { + unset($this->tokens[$service]); + } + + // allow chaining + return $this; + } + + /** + * Delete *ALL* user tokens. Use with care. Most of the time you will likely + * want to use clearToken() instead. + */ + public function clearAllTokens() + { + $this->tokens = array(); + + // allow chaining + return $this; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/Redis.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/Redis.php new file mode 100644 index 0000000..0d9af1e --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/Redis.php @@ -0,0 +1,144 @@ +redis = $redis; + $this->key = $key; + $this->cachedTokens = array(); + } + + /** + * @return \OAuth\Common\Token\TokenInterface + * @throws TokenNotFoundException + */ + public function retrieveAccessToken($service) + { + if (!$this->hasAccessToken($service)) + { + throw new TokenNotFoundException('Token not found in redis'); + } + + if (isset($this->cachedTokens[$service])) + { + return $this->cachedTokens[$service]; + } + + $val = $this->redis->hget($this->key, $service); + + return $this->cachedTokens[$service] = unserialize($val); + } + + /** + * @param \OAuth\Common\Token\TokenInterface $token + * @throws StorageException + */ + public function storeAccessToken($service, TokenInterface $token) + { + // (over)write the token + $this->redis->hset($this->key, $service, serialize($token)); + $this->cachedTokens[$service] = $token; + + // allow chaining + return $this; + } + + /** + * @return bool + */ + public function hasAccessToken($service) + { + if (isset($this->cachedTokens[$service]) && + $this->cachedTokens[$service] instanceof TokenInterface) + { + return true; + } + + return $this->redis->hexists($this->key, $service); + } + + /** + * Delete the user's token. Aka, log out. + */ + public function clearToken($service) + { + $this->redis->hdel($this->key, $service); + unset($this->cachedTokens[$service]); + + // allow chaining + return $this; + } + + /** + * Delete *ALL* user tokens. Use with care. Most of the time you will likely + * want to use clearToken() instead. + */ + public function clearAllTokens() + { + // memory + $this->cachedTokens = array(); + + // redis + $keys = $this->redis->hkeys($this->key); + $me = $this; // 5.3 compat + + // pipeline for performance + $this->redis->pipeline(function($pipe) use($keys, $me) { + + foreach ($keys as $k) { + + $pipe->hdel($me->getKey(), $k); + + } + + }); + + // allow chaining + return $this; + } + + /** + * @return Predis $redis + */ + public function getRedis() + { + return $this->redis; + } + + /** + * @return string $key + */ + public function getKey() + { + return $this->key; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/Session.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/Session.php new file mode 100644 index 0000000..5f0ec85 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/Session.php @@ -0,0 +1,106 @@ +sessionVariableName = $sessionVariableName; + if (!isset($_SESSION[$sessionVariableName])) + { + $_SESSION[$sessionVariableName] = array(); + } + } + + /** + * @return \OAuth\Common\Token\TokenInterface + * @throws TokenNotFoundException + */ + public function retrieveAccessToken($service) + { + if ($this->hasAccessToken($service)) + { + return $_SESSION[$this->sessionVariableName][$service]; + } + + throw new TokenNotFoundException('Token not found in session, are you sure you stored it?'); + } + + /** + * @param \OAuth\Common\Token\TokenInterface $token + */ + public function storeAccessToken($service, TokenInterface $token) + { + if (isset($_SESSION[$this->sessionVariableName]) && + is_array($_SESSION[$this->sessionVariableName])) + { + $_SESSION[$this->sessionVariableName][$service] = $token; + } + else + { + $_SESSION[$this->sessionVariableName] = array( + $service => $token, + ); + } + + // allow chaining + return $this; + } + + /** + * @return bool + */ + public function hasAccessToken($service) + { + return isset($_SESSION[$this->sessionVariableName], $_SESSION[$this->sessionVariableName][$service]); + } + + /** + * Delete the user's token. Aka, log out. + */ + public function clearToken($service) + { + if (array_key_exists($service, $_SESSION[$this->sessionVariableName])) { + unset($_SESSION[$this->sessionVariableName][$service]); + } + + // allow chaining + return $this; + } + + /** + * Delete *ALL* user tokens. Use with care. Most of the time you will likely + * want to use clearToken() instead. + */ + public function clearAllTokens() + { + unset($_SESSION[$this->sessionVariableName]); + + // allow chaining + return $this; + } + + public function __destruct() + { + session_write_close(); + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/SymfonySession.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/SymfonySession.php new file mode 100644 index 0000000..b28d401 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/SymfonySession.php @@ -0,0 +1,117 @@ +session = $session; + $this->sessionVariableName = $sessionVariableName; + + if (!$this->session->has($sessionVariableName)) + { + $this->session->set($sessionVariableName, array()); + } + } + + /** + * @return \OAuth\Common\Token\TokenInterface + * @throws TokenNotFoundException + */ + public function retrieveAccessToken($service) + { + if ($this->hasAccessToken($service)) { + // get from session + $tokens = $this->session->get($this->sessionVariableName); + + // one item + return $tokens[$service]; + } + + throw new TokenNotFoundException('Token not found in session, are you sure you stored it?'); + } + + public function storeAccessToken($service, TokenInterface $token) + { + // get previously saved tokens + $tokens = $this->session->get($this->sessionVariableName); + + if (is_array($tokens)) + { + // add to array + $tokens[$service] = $token; + } + else + { + // new array + $tokens = array( + $service => $token, + ); + } + + // save + $this->session->set($this->sessionVariableName, $tokens); + + // allow chaining + return $this; + } + + /** + * @return bool + */ + public function hasAccessToken($service) + { + // get from session + $tokens = $this->session->get($this->sessionVariableName); + + return is_array($tokens) && + isset($tokens[$service]) && + $tokens[$service] instanceof TokenInterface; + } + + /** + * Delete the user's token. Aka, log out. + */ + public function clearToken($service) + { + // get previously saved tokens + $tokens = $this->session->get($this->sessionVariableName); + + if (array_key_exists($service, $tokens)) { + unset($tokens[$service]); + } + + // Replace the stored tokens array + $this->session->set($this->sessionVariableName, $tokens); + + // allow chaining + return $this; + } + + /** + * Delete *ALL* user tokens. Use with care. Most of the time you will likely + * want to use clearToken() instead. + */ + public function clearAllTokens() + { + $this->session->remove($this->sessionVariableName); + + // allow chaining + return $this; + } + + /** + * @return Session + */ + public function getSession() + { + return $this->session; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/TokenStorageInterface.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/TokenStorageInterface.php new file mode 100644 index 0000000..54beef9 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Storage/TokenStorageInterface.php @@ -0,0 +1,44 @@ +accessToken = $accessToken; + $this->refreshToken = $refreshToken; + $this->setLifetime($lifetime); + $this->extraParams = $extraParams; + } + + /** + * @return string + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * @return string + */ + public function getRefreshToken() + { + return $this->refreshToken; + } + + /** + * @return int + */ + public function getEndOfLife() + { + return $this->endOfLife; + } + + /** + * @param array $extraParams + */ + public function setExtraParams(array $extraParams) + { + $this->extraParams = $extraParams; + } + + /** + * @return array + */ + public function getExtraParams() + { + return $this->extraParams; + } + + /** + * @param string $accessToken + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + } + + /** + * @param int $endOfLife + */ + public function setEndOfLife($endOfLife) + { + $this->endOfLife = $endOfLife; + } + + /** + * @param $lifetime + */ + public function setLifetime($lifetime) + { + if( 0 === $lifetime || static::EOL_NEVER_EXPIRES === $lifetime ) { + $this->endOfLife = static::EOL_NEVER_EXPIRES; + } elseif ( null !== $lifetime ) { + $this->endOfLife = intval($lifetime) + time(); + } else { + $this->endOfLife = static::EOL_UNKNOWN; + } + } + + /** + * @param string $refreshToken + */ + public function setRefreshToken($refreshToken) + { + $this->refreshToken = $refreshToken; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Token/Exception/ExpiredTokenException.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Token/Exception/ExpiredTokenException.php new file mode 100644 index 0000000..28efc68 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/Common/Token/Exception/ExpiredTokenException.php @@ -0,0 +1,12 @@ +signature = $signature; + $this->baseApiUri = $baseApiUri; + + $this->signature->setHashingAlgorithm($this->getSignatureMethod()); + } + + /** + * Retrieves and stores the OAuth1 request token obtained from the service. + * + * @return TokenInterface $token + * @throws TokenResponseException + */ + public function requestRequestToken() + { + $authorizationHeader = array('Authorization' => $this->buildAuthorizationHeaderForTokenRequest()); + $headers = array_merge($authorizationHeader, $this->getExtraOAuthHeaders()); + + $responseBody = $this->httpClient->retrieveResponse($this->getRequestTokenEndpoint(), array(), $headers); + + $token = $this->parseRequestTokenResponse($responseBody); + $this->storage->storeAccessToken($this->service(), $token); + + return $token; + } + + /** + * Returns the url to redirect to for authorization purposes. + * + * @param array $additionalParameters + * @return string + */ + public function getAuthorizationUri( array $additionalParameters = array() ) + { + // Build the url + $url = clone $this->getAuthorizationEndpoint(); + foreach($additionalParameters as $key => $val) + { + $url->addToQuery($key, $val); + } + + return $url; + } + + /** + * Retrieves and stores/returns the OAuth1 access token after a successful authorization. + * + * @abstract + * @param string $token The request token from the callback. + * @param string $verifier + * @param string $tokenSecret + * @return TokenInterface $token + * @throws TokenResponseException + */ + public function requestAccessToken($token, $verifier, $tokenSecret = null) + { + if(is_null($tokenSecret)) { + $storedRequestToken = $this->storage->retrieveAccessToken($this->service()); + $tokenSecret = $storedRequestToken->getRequestTokenSecret(); + } + $this->signature->setTokenSecret($tokenSecret); + + $extraAuthenticationHeaders = array( + 'oauth_token' => $token, + ); + + $bodyParams = array( + 'oauth_verifier' => $verifier, + ); + + $authorizationHeader = array( + 'Authorization' => + $this->buildAuthorizationHeaderForAPIRequest( + 'POST', + $this->getAccessTokenEndpoint(), + $this->storage->retrieveAccessToken($this->service()), + $bodyParams + ) + ); + + $headers = array_merge($authorizationHeader, $this->getExtraOAuthHeaders()); + + $responseBody = $this->httpClient->retrieveResponse($this->getAccessTokenEndpoint(), $bodyParams, $headers); + + $token = $this->parseAccessTokenResponse($responseBody); + $this->storage->storeAccessToken($this->service(), $token); + + return $token; + } + + /** + * Sends an authenticated API request to the path provided. + * If the path provided is not an absolute URI, the base API Uri (must be passed into constructor) will be used. + * @param $path string|UriInterface + * @param string $method HTTP method + * @param array $body Request body if applicable (key/value pairs) + * @param array $extraHeaders Extra headers if applicable. These will override service-specific any defaults. + * @return string + */ + public function request($path, $method = 'GET', $body = null, array $extraHeaders = array()) + { + $uri = $this->determineRequestUriFromPath($path, $this->baseApiUri); + + /** @var $token \OAuth\OAuth1\Token\StdOAuth1Token */ + $token = $this->storage->retrieveAccessToken($this->service()); + $extraHeaders = array_merge( $this->getExtraApiHeaders(), $extraHeaders ); + $authorizationHeader = array('Authorization' => $this->buildAuthorizationHeaderForAPIRequest($method, $uri, $token, $body)); + $headers = array_merge($authorizationHeader, $extraHeaders); + + return $this->httpClient->retrieveResponse($uri, $body, $headers, $method); + } + + /** + * Return any additional headers always needed for this service implementation's OAuth calls. + * + * @return array + */ + protected function getExtraOAuthHeaders() + { + return array(); + } + + /** + * Return any additional headers always needed for this service implementation's API calls. + * + * @return array + */ + protected function getExtraApiHeaders() + { + return array(); + } + + /** + * Builds the authorization header for getting an access or request token. + * + * @param array $extraParameters + * @return string + */ + protected function buildAuthorizationHeaderForTokenRequest(array $extraParameters = array()) + { + $parameters = $this->getBasicAuthorizationHeaderInfo(); + $parameters = array_merge($parameters, $extraParameters); + $parameters['oauth_signature'] = $this->signature->getSignature($this->getRequestTokenEndpoint(), $parameters, 'POST'); + + $authorizationHeader = 'OAuth '; + $delimiter = ''; + foreach($parameters as $key => $value) { + $authorizationHeader .= $delimiter . rawurlencode($key) . '="' . rawurlencode($value) . '"'; + + $delimiter = ', '; + } + + return $authorizationHeader; + } + + /** + * Builds the authorization header for an authenticated API request + * @param string $method + * @param UriInterface $uri the uri the request is headed + * @param \OAuth\OAuth1\Token\TokenInterface $token + * @param $bodyParams Request body if applicable (key/value pairs) + * @return string + */ + protected function buildAuthorizationHeaderForAPIRequest($method, UriInterface $uri, TokenInterface $token, $bodyParams = null) + { + $this->signature->setTokenSecret($token->getAccessTokenSecret()); + $parameters = $this->getBasicAuthorizationHeaderInfo(); + if( isset($parameters['oauth_callback'] ) ){ + unset($parameters['oauth_callback']); + } + + $parameters = array_merge($parameters, array('oauth_token' => $token->getAccessToken()) ); + + $mergedParams = (is_array($bodyParams)) ? array_merge($parameters, $bodyParams) : $parameters; + + $parameters['oauth_signature'] = $this->signature->getSignature($uri, $mergedParams, $method); + + $authorizationHeader = 'OAuth '; + $delimiter = ''; + + foreach($parameters as $key => $value) { + $authorizationHeader .= $delimiter . rawurlencode($key) . '="' . rawurlencode($value) . '"'; + $delimiter = ', '; + } + + return $authorizationHeader; + } + + /** + * Builds the authorization header array. + * + * @return array + */ + protected function getBasicAuthorizationHeaderInfo() + { + $dateTime = new \DateTime(); + $headerParameters = array( + 'oauth_callback' => $this->credentials->getCallbackUrl(), + 'oauth_consumer_key' => $this->credentials->getConsumerId(), + 'oauth_nonce' => $this->generateNonce(), + 'oauth_signature_method' => $this->getSignatureMethod(), + 'oauth_timestamp' => $dateTime->format('U'), + 'oauth_version' => $this->getVersion(), + ); + + return $headerParameters; + } + + /** + * Pseudo random string generator used to build a unique string to sign each request + * + * @param int $length + * @return string + */ + protected function generateNonce($length = 32) + { + $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; + + $nonce = ''; + $maxRand = strlen($characters)-1; + for($i = 0; $i < $length; $i++) { + $nonce.= $characters[rand(0, $maxRand)]; + } + + return $nonce; + } + + /** + * @return string + */ + protected function getSignatureMethod() + { + return 'HMAC-SHA1'; + } + + /** + * This returns the version used in the authorization header of the requests + * + * @return string + */ + protected function getVersion() + { + return '1.0'; + } + + + /** + * Parses the request token response and returns a TokenInterface. + * + * @abstract + * @return \OAuth\OAuth1\Token\TokenInterface + * @param string $responseBody + */ + abstract protected function parseRequestTokenResponse($responseBody); + + /** + * Parses the access token response and returns a TokenInterface. + * + * @abstract + * @return \OAuth\OAuth1\Token\TokenInterface + * @param string $responseBody + */ + abstract protected function parseAccessTokenResponse($responseBody); +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/BitBucket.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/BitBucket.php new file mode 100644 index 0000000..350fc45 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/BitBucket.php @@ -0,0 +1,97 @@ +baseApiUri = new Uri('https://bitbucket.org/api/1.0/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getRequestTokenEndpoint() + { + return new Uri('https://bitbucket.org/!api/1.0/oauth/request_token'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://bitbucket.org/!api/1.0/oauth/authenticate'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://bitbucket.org/!api/1.0/oauth/access_token'); + } + + /** + * We need a separate request token parser only to verify the `oauth_callback_confirmed` parameter. For the actual + * parsing we can just use the default access token parser. + * + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth1\Token\StdOAuth1Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseRequestTokenResponse($responseBody) + { + parse_str($responseBody, $data); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif (!isset($data['oauth_callback_confirmed']) || $data['oauth_callback_confirmed'] != 'true') { + throw new TokenResponseException('Error in retrieving token.'); + } + + return $this->parseAccessTokenResponse($responseBody); + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth1\Token\StdOAuth1Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + + parse_str($responseBody, $data); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth1Token(); + + $token->setRequestToken( $data['oauth_token'] ); + $token->setRequestTokenSecret( $data['oauth_token_secret'] ); + $token->setAccessToken( $data['oauth_token'] ); + $token->setAccessTokenSecret( $data['oauth_token_secret'] ); + + $token->setEndOfLife(StdOAuth1Token::EOL_NEVER_EXPIRES); + unset( $data['oauth_token'], $data['oauth_token_secret'] ); + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/Etsy.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/Etsy.php new file mode 100644 index 0000000..c072584 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/Etsy.php @@ -0,0 +1,97 @@ +baseApiUri = new Uri('http://openapi.etsy.com/v2/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getRequestTokenEndpoint() + { + return new Uri($this->baseApiUri . 'oauth/request_token'); + } + + /** + * Not required method! + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri($this->baseApiUri); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri($this->baseApiUri . 'oauth/access_token'); + } + + /** + * We need a separate request token parser only to verify the `oauth_callback_confirmed` parameter. For the actual + * parsing we can just use the default access token parser. + * + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth1\Token\StdOAuth1Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseRequestTokenResponse($responseBody) + { + parse_str($responseBody, $data); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif (!isset($data['oauth_callback_confirmed']) || $data['oauth_callback_confirmed'] != 'true') { + throw new TokenResponseException('Error in retrieving token.'); + } + + return $this->parseAccessTokenResponse($responseBody); + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth1\Token\StdOAuth1Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + parse_str($responseBody, $data); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth1Token(); + + $token->setRequestToken( $data['oauth_token'] ); + $token->setRequestTokenSecret( $data['oauth_token_secret'] ); + $token->setAccessToken( $data['oauth_token'] ); + $token->setAccessTokenSecret( $data['oauth_token_secret'] ); + + $token->setEndOfLife(StdOAuth1Token::EOL_NEVER_EXPIRES); + unset( $data['oauth_token'], $data['oauth_token_secret'] ); + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/FitBit.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/FitBit.php new file mode 100644 index 0000000..50b23b7 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/FitBit.php @@ -0,0 +1,96 @@ +baseApiUri = new Uri('https://api.fitbit.com/1/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getRequestTokenEndpoint() + { + return new Uri('https://api.fitbit.com/oauth/request_token'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://www.fitbit.com/oauth/authorize'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://api.fitbit.com/oauth/access_token'); + } + + /** + * We need a separate request token parser only to verify the `oauth_callback_confirmed` parameter. For the actual + * parsing we can just use the default access token parser. + * + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth1\Token\StdOAuth1Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseRequestTokenResponse($responseBody) + { + parse_str($responseBody, $data); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif (!isset($data['oauth_callback_confirmed']) || $data['oauth_callback_confirmed'] != 'true') { + throw new TokenResponseException('Error in retrieving token.'); + } + + return $this->parseAccessTokenResponse($responseBody); + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth1\Token\StdOAuth1Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + parse_str($responseBody, $data); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth1Token(); + + $token->setRequestToken( $data['oauth_token'] ); + $token->setRequestTokenSecret( $data['oauth_token_secret'] ); + $token->setAccessToken( $data['oauth_token'] ); + $token->setAccessTokenSecret( $data['oauth_token_secret'] ); + + $token->setEndOfLife(StdOAuth1Token::EOL_NEVER_EXPIRES); + unset( $data['oauth_token'], $data['oauth_token_secret'] ); + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/ServiceInterface.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/ServiceInterface.php new file mode 100644 index 0000000..67a8518 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/ServiceInterface.php @@ -0,0 +1,54 @@ +baseApiUri = new Uri('https://api.tumblr.com/v2/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getRequestTokenEndpoint() + { + return new Uri('https://www.tumblr.com/oauth/request_token'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + // @todo if the app will post tweets, authorize must be used instead. + // figure something out re: that but it's late and i don't want to now + return new Uri('https://www.tumblr.com/oauth/authorize'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://www.tumblr.com/oauth/access_token'); + } + + /** + * We need a separate request token parser only to verify the `oauth_callback_confirmed` parameter. For the actual + * parsing we can just use the default access token parser. + * + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth1\Token\StdOAuth1Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseRequestTokenResponse($responseBody) + { + parse_str($responseBody, $data); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif (!isset($data['oauth_callback_confirmed']) || $data['oauth_callback_confirmed'] != 'true') { + throw new TokenResponseException('Error in retrieving token.'); + } + + return $this->parseAccessTokenResponse($responseBody); + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth1\Token\StdOAuth1Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + parse_str($responseBody, $data); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth1Token(); + + $token->setRequestToken( $data['oauth_token'] ); + $token->setRequestTokenSecret( $data['oauth_token_secret'] ); + $token->setAccessToken( $data['oauth_token'] ); + $token->setAccessTokenSecret( $data['oauth_token_secret'] ); + + $token->setEndOfLife(StdOAuth1Token::EOL_NEVER_EXPIRES); + unset( $data['oauth_token'], $data['oauth_token_secret'] ); + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/Twitter.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/Twitter.php new file mode 100644 index 0000000..fdac379 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/Twitter.php @@ -0,0 +1,98 @@ +baseApiUri = new Uri('https://api.twitter.com/1.1/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getRequestTokenEndpoint() + { + return new Uri('https://api.twitter.com/oauth/request_token'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + // @todo if the app will post tweets, authorize must be used instead. + // figure something out re: that but it's late and i don't want to now + return new Uri('https://api.twitter.com/oauth/authenticate'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://api.twitter.com/oauth/access_token'); + } + + /** + * We need a separate request token parser only to verify the `oauth_callback_confirmed` parameter. For the actual + * parsing we can just use the default access token parser. + * + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth1\Token\StdOAuth1Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseRequestTokenResponse($responseBody) + { + parse_str($responseBody, $data); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif (!isset($data['oauth_callback_confirmed']) || $data['oauth_callback_confirmed'] != 'true') { + throw new TokenResponseException('Error in retrieving token.'); + } + + return $this->parseAccessTokenResponse($responseBody); + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth1\Token\StdOAuth1Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + parse_str($responseBody, $data); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth1Token(); + + $token->setRequestToken( $data['oauth_token'] ); + $token->setRequestTokenSecret( $data['oauth_token_secret'] ); + $token->setAccessToken( $data['oauth_token'] ); + $token->setAccessTokenSecret( $data['oauth_token_secret'] ); + + $token->setEndOfLife(StdOAuth1Token::EOL_NEVER_EXPIRES); + unset( $data['oauth_token'], $data['oauth_token_secret'] ); + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Signature/Exception/UnsupportedHashAlgorithmException.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Signature/Exception/UnsupportedHashAlgorithmException.php new file mode 100644 index 0000000..fe40e80 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Signature/Exception/UnsupportedHashAlgorithmException.php @@ -0,0 +1,12 @@ +credentials = $credentials; + } + + /** + * @param string $algorithm + */ + public function setHashingAlgorithm($algorithm) + { + $this->algorithm = $algorithm; + } + + /** + * @param string $token + */ + public function setTokenSecret($token) + { + $this->tokenSecret = $token; + } + + /** + * @param \OAuth\Common\Http\Uri\UriInterface $uri + * @param array $params + * @param string $method + * @return string + */ + public function getSignature(UriInterface $uri, array $params, $method = 'POST') + { + parse_str($uri->getQuery(), $queryStringData); + + foreach(array_merge($queryStringData, $params) as $key => $value) { + $signatureData[rawurlencode($key)] = rawurlencode($value); + } + + ksort($signatureData); + + // determine base uri + $baseUri = $uri->getScheme() . '://' . $uri->getRawAuthority(); + + if ('/' == $uri->getPath()) { + $baseUri.= $uri->hasExplicitTrailingHostSlash() ? '/' : ''; + } else { + $baseUri .= $uri->getPath(); + } + + $baseString = strtoupper($method) . '&'; + $baseString.= rawurlencode($baseUri) . '&'; + $baseString.= rawurlencode($this->buildSignatureDataString($signatureData)); + + return base64_encode($this->hash($baseString)); + } + + + /** + * @param array $signatureData + * @return string + */ + protected function buildSignatureDataString(array $signatureData) + { + $signatureString = ''; + $delimiter = ''; + foreach($signatureData as $key => $value) { + $signatureString .= $delimiter . $key . '=' . $value; + + $delimiter = '&'; + } + + return $signatureString; + } + + /** + * @return string + */ + protected function getSigningKey() + { + $signingKey = rawurlencode($this->credentials->getConsumerSecret()) . '&'; + if ($this->tokenSecret !== null) { + $signingKey .= rawurlencode($this->tokenSecret); + } + + return $signingKey; + } + + /** + * @param string $data + * @return string + * @throws UnsupportedHashAlgorithmException + */ + protected function hash($data) + { + switch(strtoupper($this->algorithm)) { + case 'HMAC-SHA1': + return hash_hmac('sha1', $data, $this->getSigningKey(), true); + + default: + throw new UnsupportedHashAlgorithmException('Unsupported hashing algorithm (' . $this->algorithm . ') used.'); + } + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Signature/SignatureInterface.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Signature/SignatureInterface.php new file mode 100644 index 0000000..14ae84e --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Signature/SignatureInterface.php @@ -0,0 +1,34 @@ +requestToken = $requestToken; + } + + /** + * @return string + */ + public function getRequestToken() + { + return $this->requestToken; + } + + /** + * @param string $requestTokenSecret + */ + public function setRequestTokenSecret($requestTokenSecret) + { + $this->requestTokenSecret = $requestTokenSecret; + } + + /** + * @return string + */ + public function getRequestTokenSecret() + { + return $this->requestTokenSecret; + } + + /** + * @param string $accessTokenSecret + */ + public function setAccessTokenSecret($accessTokenSecret) + { + $this->accessTokenSecret = $accessTokenSecret; + } + + /** + * @return string + */ + public function getAccessTokenSecret() + { + return $this->accessTokenSecret; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Token/TokenInterface.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Token/TokenInterface.php new file mode 100644 index 0000000..3bc6a8d --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth1/Token/TokenInterface.php @@ -0,0 +1,40 @@ +isValidScope($scope) ) { + throw new InvalidScopeException('Scope ' . $scope . ' is not valid for service ' . get_class($this) ); + } + } + + $this->scopes = $scopes; + + $this->baseApiUri = $baseApiUri; + } + + /** + * Returns the url to redirect to for authorization purposes. + * + * @param array $additionalParameters + * @return string + */ + public function getAuthorizationUri( array $additionalParameters = array() ) + { + $parameters = array_merge($additionalParameters, array( + 'type' => 'web_server', + 'client_id' => $this->credentials->getConsumerId(), + 'redirect_uri' => $this->credentials->getCallbackUrl(), + 'response_type' => 'code', + )); + + $parameters['scope'] = implode(' ', $this->scopes); + + // Build the url + $url = clone $this->getAuthorizationEndpoint(); + foreach($parameters as $key => $val) + { + $url->addToQuery($key, $val); + } + + return $url; + } + + + /** + * Retrieves and stores the OAuth2 access token after a successful authorization. + * + * @param string $code The access code from the callback. + * @return TokenInterface $token + * @throws TokenResponseException + */ + public function requestAccessToken($code) + { + $bodyParams = array( + 'code' => $code, + 'client_id' => $this->credentials->getConsumerId(), + 'client_secret' => $this->credentials->getConsumerSecret(), + 'redirect_uri' => $this->credentials->getCallbackUrl(), + 'grant_type' => 'authorization_code', + ); + + $responseBody = $this->httpClient->retrieveResponse($this->getAccessTokenEndpoint(), $bodyParams, $this->getExtraOAuthHeaders()); + $token = $this->parseAccessTokenResponse( $responseBody ); + $this->storage->storeAccessToken($this->service(), $token ); + + return $token; + } + + /** + * Sends an authenticated API request to the path provided. + * If the path provided is not an absolute URI, the base API Uri (must be passed into constructor) will be used. + * + * @param $path string|UriInterface + * @param string $method HTTP method + * @param array $body Request body if applicable. + * @param array $extraHeaders Extra headers if applicable. These will override service-specific any defaults. + * @return string + * @throws ExpiredTokenException + * @throws Exception + */ + public function request($path, $method = 'GET', $body = null, array $extraHeaders = array()) + { + $uri = $this->determineRequestUriFromPath($path, $this->baseApiUri); + $token = $this->storage->retrieveAccessToken($this->service()); + + if( ( $token->getEndOfLife() !== TokenInterface::EOL_NEVER_EXPIRES ) && + ( $token->getEndOfLife() !== TokenInterface::EOL_UNKNOWN ) && + ( time() > $token->getEndOfLife() ) ) { + + throw new ExpiredTokenException('Token expired on ' . date('m/d/Y', $token->getEndOfLife()) . ' at ' . date('h:i:s A', $token->getEndOfLife()) ); + } + + // add the token where it may be needed + if( static::AUTHORIZATION_METHOD_HEADER_OAUTH === $this->getAuthorizationMethod() ) { + $extraHeaders = array_merge( array('Authorization' => 'OAuth ' . $token->getAccessToken()), $extraHeaders ); + } elseif( static::AUTHORIZATION_METHOD_QUERY_STRING === $this->getAuthorizationMethod() ) { + $uri->addToQuery( 'access_token', $token->getAccessToken() ); + } elseif( static::AUTHORIZATION_METHOD_QUERY_STRING_V2 === $this->getAuthorizationMethod() ) { + $uri->addToQuery( 'oauth2_access_token', $token->getAccessToken() ); + } elseif( static::AUTHORIZATION_METHOD_HEADER_BEARER === $this->getAuthorizationMethod() ) { + $extraHeaders = array_merge( array('Authorization' => 'Bearer ' . $token->getAccessToken()), $extraHeaders ); + } + + $extraHeaders = array_merge( $this->getExtraApiHeaders(), $extraHeaders ); + + return $this->httpClient->retrieveResponse($uri, $body, $extraHeaders, $method); + } + + /** + * Accessor to the storage adapter to be able to retrieve tokens + * + * @return OAuth\Common\Storage\TokenStorageInterface + */ + public function getStorage() + { + return $this->storage; + } + + /** + * Refreshes an OAuth2 access token. + * + * @param \OAuth\Common\Token\TokenInterface $token + * @return \OAuth\Common\Token\TokenInterface $token + * @throws \OAuth\OAuth2\Service\Exception\MissingRefreshTokenException + */ + public function refreshAccessToken(TokenInterface $token) + { + $refreshToken = $token->getRefreshToken(); + + if ( empty( $refreshToken ) ) { + throw new MissingRefreshTokenException(); + } + + $parameters = array( + 'grant_type' => 'refresh_token', + 'type' => 'web_server', + 'client_id' => $this->credentials->getConsumerId(), + 'client_secret' => $this->credentials->getConsumerSecret(), + 'refresh_token' => $refreshToken, + ); + + $responseBody = $this->httpClient->retrieveResponse($this->getAccessTokenEndpoint(), $parameters, $this->getExtraOAuthHeaders()); + $token = $this->parseAccessTokenResponse($responseBody); + $this->storage->storeAccessToken($this->service(), $token); + + return $token; + } + + /** + * Return whether or not the passed scope value is valid. + * + * @param $scope + * @return bool + */ + public function isValidScope($scope) + { + $reflectionClass = new \ReflectionClass(get_class($this)); + return in_array( $scope, $reflectionClass->getConstants() ); + } + + /** + * Return any additional headers always needed for this service implementation's OAuth calls. + * + * @return array + */ + protected function getExtraOAuthHeaders() + { + return array(); + } + + /** + * Return any additional headers always needed for this service implementation's API calls. + * + * @return array + */ + protected function getExtraApiHeaders() + { + return array(); + } + + /** + * Parses the access token response and returns a TokenInterface. + * + * @abstract + * @return \OAuth\Common\Token\TokenInterface + * @param string $responseBody + */ + abstract protected function parseAccessTokenResponse($responseBody); + + /** + * Returns a class constant from ServiceInterface defining the authorization method used for the API + * Header is the sane default. + * + * @return int + */ + protected function getAuthorizationMethod() + { + return static::AUTHORIZATION_METHOD_HEADER_OAUTH; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Amazon.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Amazon.php new file mode 100644 index 0000000..9ca6479 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Amazon.php @@ -0,0 +1,96 @@ + + * @link https://images-na.ssl-images-amazon.com/images/G/01/lwa/dev/docs/website-developer-guide._TTH_.pdf + */ +class Amazon extends AbstractService +{ + /** + * Defined scopes + * @link https://images-na.ssl-images-amazon.com/images/G/01/lwa/dev/docs/website-developer-guide._TTH_.pdf + */ + + const SCOPE_PROFILE = 'profile'; + const SCOPE_POSTAL_CODE = 'postal_code'; + + public function __construct(Credentials $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null) + { + parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri); + if( null === $baseApiUri ) { + $this->baseApiUri = new Uri('https://api.amazon.com/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://www.amazon.com/ap/oa'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://www.amazon.com/ap/oatoken'); + } + + /** + * Returns a class constant from ServiceInterface defining the authorization method used for the API + * Header is the sane default. + * + * @return int + */ + protected function getAuthorizationMethod() + { + return static::AUTHORIZATION_METHOD_HEADER_BEARER; + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth2\Token\StdOAuth2Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + $data = json_decode( $responseBody, true ); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error_description'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error_description'] . '"'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth2Token(); + + $token->setAccessToken( $data['access_token'] ); + $token->setLifeTime( $data['expires_in'] ); + + if( isset($data['refresh_token'] ) ) { + $token->setRefreshToken( $data['refresh_token'] ); + unset($data['refresh_token']); + } + + unset( $data['access_token'] ); + unset( $data['expires_in'] ); + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Bitly.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Bitly.php new file mode 100644 index 0000000..80d9fde --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Bitly.php @@ -0,0 +1,102 @@ +baseApiUri = new Uri('https://api-ssl.bitly.com/v3/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://bitly.com/oauth/authorize'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://api-ssl.bitly.com/oauth/access_token'); + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth2\Token\StdOAuth2Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + $data = json_decode( $responseBody, true ); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth2Token(); + + + $token->setAccessToken( $data['access_token'] ); + // I'm invincible!!! + $token->setEndOfLife(StdOAuth2Token::EOL_NEVER_EXPIRES); + unset( $data['access_token'] ); + $token->setExtraParams( $data ); + + return $token; + } + + /** + * Retrieves and stores the OAuth2 access token after a successful authorization. + * + * @param string $code The access code from the callback. + * @return \OAuth\OAuth2\Token\TokenInterface $token + * @throws TokenResponseException + */ + public function requestAccessToken($code) + { + $bodyParams = array( + 'code' => $code, + 'client_id' => $this->credentials->getConsumerId(), + 'client_secret' => $this->credentials->getConsumerSecret(), + 'redirect_uri' => $this->credentials->getCallbackUrl(), + 'grant_type' => 'authorization_code', + ); + + $responseBody = $this->httpClient->retrieveResponse($this->getAccessTokenEndpoint(), $bodyParams, $this->getExtraOAuthHeaders()); + + // we can scream what we want that we want bitly to return a json encoded string (format=json), but the + // WOAH WATCH YOUR LANGUAGE ;) service doesn't seem to like screaming, hence we need to manually parse the result + $parsedResult = array(); + parse_str($responseBody, $parsedResult); + + $token = $this->parseAccessTokenResponse( json_encode($parsedResult) ); + $this->storage->storeAccessToken( $this->service(), $token ); + + return $token; + } + + /** + * @return int + */ + protected function getAuthorizationMethod() + { + return static::AUTHORIZATION_METHOD_QUERY_STRING; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Box.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Box.php new file mode 100644 index 0000000..0cd694e --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Box.php @@ -0,0 +1,86 @@ + + * @link https://developers.box.com/oauth/ + */ +class Box extends AbstractService +{ + public function __construct(Credentials $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null) + { + parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri); + if( null === $baseApiUri ) { + $this->baseApiUri = new Uri('https://api.box.com/2.0/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://www.box.com/api/oauth2/authorize'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://www.box.com/api/oauth2/token'); + } + + /** + * Returns a class constant from ServiceInterface defining the authorization method used for the API + * Header is the sane default. + * + * @return int + */ + protected function getAuthorizationMethod() + { + return static::AUTHORIZATION_METHOD_HEADER_BEARER; + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth2\Token\StdOAuth2Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + $data = json_decode( $responseBody, true ); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth2Token(); + + $token->setAccessToken( $data['access_token'] ); + $token->setLifeTime( $data['expires_in'] ); + + if( isset($data['refresh_token'] ) ) { + $token->setRefreshToken( $data['refresh_token'] ); + unset($data['refresh_token']); + } + + unset( $data['access_token'] ); + unset( $data['expires_in'] ); + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Dropbox.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Dropbox.php new file mode 100644 index 0000000..afdf772 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Dropbox.php @@ -0,0 +1,111 @@ + + * @link https://www.dropbox.com/developers/core/docs + */ +class Dropbox extends AbstractService +{ + + public function __construct(Credentials $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null) + { + parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri); + if( null === $baseApiUri ) { + $this->baseApiUri = new Uri('https://api.dropbox.com/1/'); + } + } + + /** + * Returns the url to redirect to for authorization purposes. + * + * @param array $additionalParameters + * @return string + */ + public function getAuthorizationUri( array $additionalParameters = array() ) + { + $parameters = array_merge($additionalParameters, array( + 'client_id' => $this->credentials->getConsumerId(), + 'redirect_uri' => $this->credentials->getCallbackUrl(), + 'response_type' => 'code', + )); + + $parameters['scope'] = implode(' ', $this->scopes); + + // Build the url + $url = clone $this->getAuthorizationEndpoint(); + foreach($parameters as $key => $val) + { + $url->addToQuery($key, $val); + } + + return $url; + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://www.dropbox.com/1/oauth2/authorize'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://api.dropbox.com/1/oauth2/token'); + } + + /** + * Returns a class constant from ServiceInterface defining the authorization method used for the API + * Header is the sane default. + * + * @return int + */ + protected function getAuthorizationMethod() + { + return static::AUTHORIZATION_METHOD_QUERY_STRING_V2; + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth2\Token\StdOAuth2Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + $data = json_decode( $responseBody, true ); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth2Token(); + + $token->setAccessToken( $data['access_token'] ); + + if( isset($data['refresh_token'] ) ) { + $token->setRefreshToken( $data['refresh_token'] ); + unset($data['refresh_token']); + } + + unset( $data['access_token'] ); + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Exception/InvalidScopeException.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Exception/InvalidScopeException.php new file mode 100644 index 0000000..634019f --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Exception/InvalidScopeException.php @@ -0,0 +1,15 @@ + + * Released under the MIT license. + */ +namespace OAuth\OAuth2\Service\Exception; +use OAuth\Common\Exception\Exception; + +/** + * Exception thrown when a scope provided to a service is invalid. + */ +class InvalidScopeException extends Exception +{ + +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Exception/MissingRefreshTokenException.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Exception/MissingRefreshTokenException.php new file mode 100644 index 0000000..cabe766 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Exception/MissingRefreshTokenException.php @@ -0,0 +1,15 @@ + + * Released under the MIT license. + */ +namespace OAuth\OAuth2\Service\Exception; +use OAuth\Common\Exception\Exception; + +/** + * Exception thrown when service is requested to refresh the access token but no refresh token can be found. + */ +class MissingRefreshTokenException extends Exception +{ + +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Facebook.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Facebook.php new file mode 100644 index 0000000..fed55eb --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Facebook.php @@ -0,0 +1,70 @@ +baseApiUri = new Uri('https://graph.facebook.com/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://www.facebook.com/dialog/oauth'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://graph.facebook.com/oauth/access_token'); + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth2\Token\StdOAuth2Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + // Facebook gives us a query string ... Oh wait. JSON is too simple, understand ? + parse_str($responseBody, $data); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth2Token(); + + $token->setAccessToken( $data['access_token'] ); + $token->setLifeTime( $data['expires'] ); + + if( isset($data['refresh_token'] ) ) { + $token->setRefreshToken( $data['refresh_token'] ); + unset($data['refresh_token']); + } + + unset( $data['access_token'] ); + unset( $data['expires'] ); + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Foursquare.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Foursquare.php new file mode 100644 index 0000000..4978e0a --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Foursquare.php @@ -0,0 +1,74 @@ +baseApiUri = new Uri('https://api.foursquare.com/v2/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://foursquare.com/oauth2/authenticate'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://foursquare.com/oauth2/access_token'); + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth2\Token\StdOAuth2Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + $data = json_decode( $responseBody, true ); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth2Token(); + + + $token->setAccessToken( $data['access_token'] ); + // Foursquare tokens evidently never expire... + $token->setEndOfLife(StdOAuth2Token::EOL_NEVER_EXPIRES); + unset( $data['access_token'] ); + $token->setExtraParams( $data ); + + return $token; + } + + public function request($path, $method = 'GET', $body = null, array $extraHeaders = array()){ + $uri = new Uri($this->baseApiUri . $path); + $uri->addToQuery('v', $this->apiVersionDate); + + return parent::request($uri, $method = 'GET', $body, $extraHeaders); + } + +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/GitHub.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/GitHub.php new file mode 100644 index 0000000..f95917a --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/GitHub.php @@ -0,0 +1,101 @@ +baseApiUri = new Uri('https://api.github.com/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://github.com/login/oauth/authorize'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://github.com/login/oauth/access_token'); + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth2\Token\StdOAuth2Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + $data = json_decode( $responseBody, true ); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth2Token(); + + + $token->setAccessToken( $data['access_token'] ); + // Github tokens evidently never expire... + $token->setEndOfLife(StdOAuth2Token::EOL_NEVER_EXPIRES); + unset( $data['access_token'] ); + $token->setExtraParams( $data ); + + return $token; + } + + /** + * Used to configure response type -- we want JSON from github, default is query string format + * + * @return array + */ + protected function getExtraOAuthHeaders() + { + return array('Accept' => 'application/json'); + } + + /** + * Required for GitHub API calls. + * + * @return array + */ + protected function getExtraApiHeaders() + { + return array('Accept' => 'application/vnd.github.beta+json'); + } + + /** + * @return int + */ + protected function getAuthorizationMethod() + { + return static::AUTHORIZATION_METHOD_QUERY_STRING; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Google.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Google.php new file mode 100644 index 0000000..d90937b --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Google.php @@ -0,0 +1,92 @@ +setAccessToken( $data['access_token'] ); + $token->setLifetime( $data['expires_in'] ); + + if( isset($data['refresh_token'] ) ) { + $token->setRefreshToken( $data['refresh_token'] ); + unset($data['refresh_token']); + } + + unset( $data['access_token'] ); + unset( $data['expires_in'] ); + + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Instagram.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Instagram.php new file mode 100644 index 0000000..66131dc --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Instagram.php @@ -0,0 +1,83 @@ +baseApiUri = new Uri('https://api.instagram.com/v1/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://api.instagram.com/oauth/authorize/'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://api.instagram.com/oauth/access_token'); + } + + /** + * Returns a class constant from ServiceInterface defining the authorization method used for the API + * Header is the sane default. + * + * @return int + */ + protected function getAuthorizationMethod() + { + return static::AUTHORIZATION_METHOD_QUERY_STRING; + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth2\Token\StdOAuth2Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + $data = json_decode( $responseBody, true ); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth2Token(); + + $token->setAccessToken( $data['access_token'] ); + // Instagram tokens evidently never expire... + $token->setEndOfLife(StdOAuth2Token::EOL_NEVER_EXPIRES); + unset( $data['access_token'] ); + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Linkedin.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Linkedin.php new file mode 100644 index 0000000..71caf0b --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Linkedin.php @@ -0,0 +1,99 @@ + + * @link http://developer.linkedin.com/documents/authentication + */ +class Linkedin extends AbstractService +{ + /** + * Defined scopes + * @link http://developer.linkedin.com/documents/authentication#granting + */ + const SCOPE_R_BASICPROFILE = 'r_basicprofile'; + const SCOPE_R_FULLPROFILE = 'r_fullprofile'; + const SCOPE_R_EMAILADDRESS = 'r_emailaddress'; + const SCOPE_R_NETWORK = 'r_network'; + const SCOPE_R_CONTACTINFO = 'r_contactinfo'; + const SCOPE_RW_NUS = 'rw_nus'; + const SCOPE_RW_GROUPS = 'rw_groups'; + const SCOPE_W_MESSAGES = 'w_messages'; + + public function __construct(Credentials $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null) + { + parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri); + if( null === $baseApiUri ) { + $this->baseApiUri = new Uri('https://api.linkedin.com/v1/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://www.linkedin.com/uas/oauth2/authorization'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://www.linkedin.com/uas/oauth2/accessToken'); + } + + /** + * Returns a class constant from ServiceInterface defining the authorization method used for the API + * Header is the sane default. + * + * @return int + */ + protected function getAuthorizationMethod() + { + return static::AUTHORIZATION_METHOD_QUERY_STRING_V2; + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth2\Token\StdOAuth2Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + $data = json_decode( $responseBody, true ); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth2Token(); + + $token->setAccessToken( $data['access_token'] ); + $token->setLifeTime( $data['expires_in'] ); + + if( isset($data['refresh_token'] ) ) { + $token->setRefreshToken( $data['refresh_token'] ); + unset($data['refresh_token']); + } + + unset( $data['access_token'] ); + unset( $data['expires_in'] ); + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Microsoft.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Microsoft.php new file mode 100644 index 0000000..227f243 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Microsoft.php @@ -0,0 +1,101 @@ +baseApiUri = new Uri('https://apis.live.net/v5.0/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://login.live.com/oauth20_authorize.srf'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://login.live.com/oauth20_token.srf'); + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth2\Token\StdOAuth2Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + $data = json_decode( $responseBody, true ); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth2Token(); + $token->setAccessToken( $data['access_token'] ); + $token->setLifetime( $data['expires_in'] ); + + if( isset($data['refresh_token'] ) ) { + $token->setRefreshToken( $data['refresh_token'] ); + unset($data['refresh_token']); + } + + unset( $data['access_token'] ); + unset( $data['expires_in'] ); + + $token->setExtraParams( $data ); + + return $token; + } + + /** + * @return int + */ + public function getAuthorizationMethod() + { + return static::AUTHORIZATION_METHOD_QUERY_STRING; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Paypal.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Paypal.php new file mode 100644 index 0000000..1f88af6 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Paypal.php @@ -0,0 +1,101 @@ + + * @link https://developer.paypal.com/webapps/developer/docs/integration/direct/log-in-with-paypal/detailed/ + */ +class Paypal extends AbstractService +{ + /** + * Defined scopes + * @link https://developer.paypal.com/webapps/developer/docs/integration/direct/log-in-with-paypal/detailed/#attributes + */ + + const SCOPE_OPENID = 'openid'; + const SCOPE_PROFILE = 'profile'; + const SCOPE_PAYPALATTRIBUTES = 'https://uri.paypal.com/services/paypalattributes'; + const SCOPE_EMAIL = 'email'; + const SCOPE_ADDRESS = 'address'; + const SCOPE_PHONE = 'phone'; + const SCOPE_EXPRESSCHECKOUT = 'https://uri.paypal.com/services/expresscheckout'; + + public function __construct(Credentials $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null) + { + parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri); + if( null === $baseApiUri ) { + $this->baseApiUri = new Uri('https://api.paypal.com/v1/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://api.paypal.com/v1/identity/openidconnect/tokenservice'); + } + + /** + * Returns a class constant from ServiceInterface defining the authorization method used for the API + * Header is the sane default. + * + * @return int + */ + protected function getAuthorizationMethod() + { + return static::AUTHORIZATION_METHOD_HEADER_BEARER; + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth2\Token\StdOAuth2Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + $data = json_decode( $responseBody, true ); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['message'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['message'] . '"'); + } elseif( isset($data['name'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['name'] . '"'); + } + + $token = new StdOAuth2Token(); + + $token->setAccessToken( $data['access_token'] ); + $token->setLifeTime( $data['expires_in'] ); + + if( isset($data['refresh_token'] ) ) { + $token->setRefreshToken( $data['refresh_token'] ); + unset($data['refresh_token']); + } + + unset( $data['access_token'] ); + unset( $data['expires_in'] ); + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/ServiceInterface.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/ServiceInterface.php new file mode 100644 index 0000000..303ef6b --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/ServiceInterface.php @@ -0,0 +1,44 @@ +baseApiUri = new Uri('https://api.soundcloud.com/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://soundcloud.com/connect'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://api.soundcloud.com/oauth2/token'); + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth2\Token\StdOAuth2Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + $data = json_decode( $responseBody, true ); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth2Token(); + $token->setAccessToken( $data['access_token'] ); + + if( isset( $data['expires_in'] ) ) { + $token->setLifetime( $data['expires_in'] ); + unset( $data['expires_in'] ); + } + + if( isset($data['refresh_token'] ) ) { + $token->setRefreshToken( $data['refresh_token'] ); + unset($data['refresh_token']); + } + + unset( $data['access_token'] ); + + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Vkontakte.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Vkontakte.php new file mode 100644 index 0000000..3bae054 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Vkontakte.php @@ -0,0 +1,69 @@ +baseApiUri = new Uri('https://api.vk.com/method/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://oauth.vk.com/authorize'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://oauth.vk.com/access_token'); + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth2\Token\StdOAuth2Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + $data = json_decode($responseBody, true); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth2Token(); + + $token->setAccessToken( $data['access_token'] ); + $token->setLifeTime( $data['expires_in'] ); + + if( isset($data['refresh_token'] ) ) { + $token->setRefreshToken( $data['refresh_token'] ); + unset($data['refresh_token']); + } + + unset( $data['access_token'] ); + unset( $data['expires_in'] ); + $token->setExtraParams( $data ); + + return $token; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Yammer.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Yammer.php new file mode 100644 index 0000000..374bfa2 --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Yammer.php @@ -0,0 +1,77 @@ +baseApiUri = new Uri('https://www.yammer.com/api/v1/'); + } + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAuthorizationEndpoint() + { + return new Uri('https://www.yammer.com/dialog/oauth'); + } + + /** + * @return \OAuth\Common\Http\Uri\UriInterface + */ + public function getAccessTokenEndpoint() + { + return new Uri('https://www.yammer.com/oauth2/access_token.json'); + } + + /** + * @param string $responseBody + * @return \OAuth\Common\Token\TokenInterface|\OAuth\OAuth2\Token\StdOAuth2Token + * @throws \OAuth\Common\Http\Exception\TokenResponseException + */ + protected function parseAccessTokenResponse($responseBody) + { + $data = json_decode( $responseBody, true ); + + if( null === $data || !is_array($data) ) { + throw new TokenResponseException('Unable to parse response.'); + } elseif( isset($data['error'] ) ) { + throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); + } + + $token = new StdOAuth2Token(); + $token->setAccessToken( $data['access_token'] ); + $token->setLifetime( $data['expires_in'] ); + + if( isset($data['refresh_token'] ) ) { + $token->setRefreshToken( $data['refresh_token'] ); + unset($data['refresh_token']); + } + + unset( $data['access_token'] ); + unset( $data['expires_in'] ); + + $token->setExtraParams( $data ); + + return $token; + } + + /** + * @return int + */ + public function getAuthorizationMethod() + { + return static::AUTHORIZATION_METHOD_HEADER_BEARER; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Token/StdOAuth2Token.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Token/StdOAuth2Token.php new file mode 100644 index 0000000..5e5c78d --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/OAuth2/Token/StdOAuth2Token.php @@ -0,0 +1,12 @@ + + * @copyright Copyright (c) 2013 The authors + * @license http://www.opensource.org/licenses/mit-license.html MIT License + */ +namespace OAuth; +use OAuth\Common\Service\ServiceInterface; +use OAuth\Common\Http\Client\ClientInterface; + +class ServiceFactory +{ + /** @var Common\Http\Client\ClientInterface */ + private $httpClient; + + /** + * @param Common\Http\Client\ClientInterface $httpClient + * @return ServiceFactory + */ + public function setHttpClient(ClientInterface $httpClient) + { + $this->httpClient = $httpClient; + return $this; + } + + /** + * @param $serviceName string name of service to create + * @param Common\Consumer\Credentials $credentials + * @param Common\Storage\TokenStorageInterface $storage + * @param array|null $scopes If creating an oauth2 service, array of scopes + * @return ServiceInterface + * @throws Common\Exception\Exception + */ + public function createService($serviceName, Common\Consumer\Credentials $credentials, Common\Storage\TokenStorageInterface $storage, $scopes = array()) + { + if( !$this->httpClient ) { + // for backwards compatibility. + $this->httpClient = new \OAuth\Common\Http\Client\StreamClient(); + } + + $serviceName = ucfirst($serviceName); + $v2ClassName = "\\OAuth\\OAuth2\\Service\\$serviceName"; + $v1ClassName = "\\OAuth\\OAuth1\\Service\\$serviceName"; + + // if an oauth2 version exists, prefer it + if( class_exists($v2ClassName) ) { + // resolve scopes + $resolvedScopes = array(); + $reflClass = new \ReflectionClass($v2ClassName); + $constants = $reflClass->getConstants(); + + foreach($scopes as $scope) + { + $key = strtoupper('SCOPE_' . $scope); + // try to find a class constant with this name + if( array_key_exists( $key, $constants ) ) { + $resolvedScopes[] = $constants[$key]; + } else { + $resolvedScopes[] = $scope; + } + } + + return new $v2ClassName($credentials, $this->httpClient, $storage, $resolvedScopes); + } + + if( class_exists($v1ClassName) ) { + if(!empty($scopes)) { + throw new Common\Exception\Exception('Scopes passed to ServiceFactory::createService but an OAuth1 service was requested.'); + } + $signature = new OAuth1\Signature\Signature($credentials); + return new $v1ClassName($credentials, $this->httpClient, $storage, $signature); + } + + return null; + } +} diff --git a/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/bootstrap.php b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/bootstrap.php new file mode 100644 index 0000000..2ab9f6a --- /dev/null +++ b/sources/phpBB/vendor/lusitanian/oauth/src/OAuth/bootstrap.php @@ -0,0 +1,11 @@ +register(); diff --git a/sources/phpBB/vendor/psr/log/LICENSE b/sources/phpBB/vendor/psr/log/LICENSE new file mode 100644 index 0000000..474c952 --- /dev/null +++ b/sources/phpBB/vendor/psr/log/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 PHP Framework Interoperability Group + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sources/phpBB/vendor/psr/log/Psr/Log/AbstractLogger.php b/sources/phpBB/vendor/psr/log/Psr/Log/AbstractLogger.php new file mode 100644 index 0000000..00f9034 --- /dev/null +++ b/sources/phpBB/vendor/psr/log/Psr/Log/AbstractLogger.php @@ -0,0 +1,120 @@ +log(LogLevel::EMERGENCY, $message, $context); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * @return null + */ + public function alert($message, array $context = array()) + { + $this->log(LogLevel::ALERT, $message, $context); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * @return null + */ + public function critical($message, array $context = array()) + { + $this->log(LogLevel::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * @return null + */ + public function error($message, array $context = array()) + { + $this->log(LogLevel::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * @return null + */ + public function warning($message, array $context = array()) + { + $this->log(LogLevel::WARNING, $message, $context); + } + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * @return null + */ + public function notice($message, array $context = array()) + { + $this->log(LogLevel::NOTICE, $message, $context); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * @return null + */ + public function info($message, array $context = array()) + { + $this->log(LogLevel::INFO, $message, $context); + } + + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * @return null + */ + public function debug($message, array $context = array()) + { + $this->log(LogLevel::DEBUG, $message, $context); + } +} diff --git a/sources/phpBB/vendor/psr/log/Psr/Log/InvalidArgumentException.php b/sources/phpBB/vendor/psr/log/Psr/Log/InvalidArgumentException.php new file mode 100644 index 0000000..67f852d --- /dev/null +++ b/sources/phpBB/vendor/psr/log/Psr/Log/InvalidArgumentException.php @@ -0,0 +1,7 @@ +logger = $logger; + } +} diff --git a/sources/phpBB/vendor/psr/log/Psr/Log/LoggerInterface.php b/sources/phpBB/vendor/psr/log/Psr/Log/LoggerInterface.php new file mode 100644 index 0000000..476bb96 --- /dev/null +++ b/sources/phpBB/vendor/psr/log/Psr/Log/LoggerInterface.php @@ -0,0 +1,114 @@ +log(LogLevel::EMERGENCY, $message, $context); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * @return null + */ + public function alert($message, array $context = array()) + { + $this->log(LogLevel::ALERT, $message, $context); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * @return null + */ + public function critical($message, array $context = array()) + { + $this->log(LogLevel::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * @return null + */ + public function error($message, array $context = array()) + { + $this->log(LogLevel::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * @return null + */ + public function warning($message, array $context = array()) + { + $this->log(LogLevel::WARNING, $message, $context); + } + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * @return null + */ + public function notice($message, array $context = array()) + { + $this->log(LogLevel::NOTICE, $message, $context); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * @return null + */ + public function info($message, array $context = array()) + { + $this->log(LogLevel::INFO, $message, $context); + } + + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * @return null + */ + public function debug($message, array $context = array()) + { + $this->log(LogLevel::DEBUG, $message, $context); + } + + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * @return null + */ + abstract public function log($level, $message, array $context = array()); +} diff --git a/sources/phpBB/vendor/psr/log/Psr/Log/NullLogger.php b/sources/phpBB/vendor/psr/log/Psr/Log/NullLogger.php new file mode 100644 index 0000000..553a3c5 --- /dev/null +++ b/sources/phpBB/vendor/psr/log/Psr/Log/NullLogger.php @@ -0,0 +1,27 @@ +logger) { }` + * blocks. + */ +class NullLogger extends AbstractLogger +{ + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * @return null + */ + public function log($level, $message, array $context = array()) + { + // noop + } +} diff --git a/sources/phpBB/vendor/psr/log/composer.json b/sources/phpBB/vendor/psr/log/composer.json new file mode 100644 index 0000000..6bdcc21 --- /dev/null +++ b/sources/phpBB/vendor/psr/log/composer.json @@ -0,0 +1,17 @@ +{ + "name": "psr/log", + "description": "Common interface for logging libraries", + "keywords": ["psr", "psr-3", "log"], + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "autoload": { + "psr-0": { + "Psr\\Log\\": "" + } + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/ConfigCache.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/ConfigCache.php new file mode 100644 index 0000000..4b58e73 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/ConfigCache.php @@ -0,0 +1,126 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config; + +use Symfony\Component\Config\Resource\ResourceInterface; +use Symfony\Component\Filesystem\Exception\IOException; +use Symfony\Component\Filesystem\Filesystem; + +/** + * ConfigCache manages PHP cache files. + * + * When debug is enabled, it knows when to flush the cache + * thanks to an array of ResourceInterface instances. + * + * @author Fabien Potencier + */ +class ConfigCache +{ + private $debug; + private $file; + + /** + * Constructor. + * + * @param string $file The absolute cache path + * @param bool $debug Whether debugging is enabled or not + */ + public function __construct($file, $debug) + { + $this->file = $file; + $this->debug = (bool) $debug; + } + + /** + * Gets the cache file path. + * + * @return string The cache file path + */ + public function __toString() + { + return $this->file; + } + + /** + * Checks if the cache is still fresh. + * + * This method always returns true when debug is off and the + * cache file exists. + * + * @return bool true if the cache is fresh, false otherwise + */ + public function isFresh() + { + if (!is_file($this->file)) { + return false; + } + + if (!$this->debug) { + return true; + } + + $metadata = $this->getMetaFile(); + if (!is_file($metadata)) { + return false; + } + + $time = filemtime($this->file); + $meta = unserialize(file_get_contents($metadata)); + foreach ($meta as $resource) { + if (!$resource->isFresh($time)) { + return false; + } + } + + return true; + } + + /** + * Writes cache. + * + * @param string $content The content to write in the cache + * @param ResourceInterface[] $metadata An array of ResourceInterface instances + * + * @throws \RuntimeException When cache file can't be wrote + */ + public function write($content, array $metadata = null) + { + $mode = 0666; + $umask = umask(); + $filesystem = new Filesystem(); + $filesystem->dumpFile($this->file, $content, null); + try { + $filesystem->chmod($this->file, $mode, $umask); + } catch (IOException $e) { + // discard chmod failure (some filesystem may not support it) + } + + if (null !== $metadata && true === $this->debug) { + $filesystem->dumpFile($this->getMetaFile(), serialize($metadata), null); + try { + $filesystem->chmod($this->getMetaFile(), $mode, $umask); + } catch (IOException $e) { + // discard chmod failure (some filesystem may not support it) + } + } + } + + /** + * Gets the meta file path. + * + * @return string The meta file path + */ + private function getMetaFile() + { + return $this->file.'.meta'; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php new file mode 100644 index 0000000..2736187 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php @@ -0,0 +1,400 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; +use Symfony\Component\Config\Definition\Exception\InvalidTypeException; +use Symfony\Component\Config\Definition\Exception\UnsetKeyException; + +/** + * Represents an Array node in the config tree. + * + * @author Johannes M. Schmitt + */ +class ArrayNode extends BaseNode implements PrototypeNodeInterface +{ + protected $xmlRemappings; + protected $children; + protected $allowFalse; + protected $allowNewKeys; + protected $addIfNotSet; + protected $performDeepMerging; + protected $ignoreExtraKeys; + protected $normalizeKeys; + + /** + * Constructor. + * + * @param string $name The Node's name + * @param NodeInterface $parent The node parent + */ + public function __construct($name, NodeInterface $parent = null) + { + parent::__construct($name, $parent); + + $this->children = array(); + $this->xmlRemappings = array(); + $this->removeKeyAttribute = true; + $this->allowFalse = false; + $this->addIfNotSet = false; + $this->allowNewKeys = true; + $this->performDeepMerging = true; + $this->normalizeKeys = true; + } + + public function setNormalizeKeys($normalizeKeys) + { + $this->normalizeKeys = (bool) $normalizeKeys; + } + + /** + * Normalizes keys between the different configuration formats. + * + * Namely, you mostly have foo_bar in YAML while you have foo-bar in XML. + * After running this method, all keys are normalized to foo_bar. + * + * If you have a mixed key like foo-bar_moo, it will not be altered. + * The key will also not be altered if the target key already exists. + * + * @param mixed $value + * + * @return array The value with normalized keys + */ + protected function preNormalize($value) + { + if (!$this->normalizeKeys || !is_array($value)) { + return $value; + } + + foreach ($value as $k => $v) { + if (false !== strpos($k, '-') && false === strpos($k, '_') && !array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) { + $value[$normalizedKey] = $v; + unset($value[$k]); + } + } + + return $value; + } + + /** + * Retrieves the children of this node. + * + * @return array The children + */ + public function getChildren() + { + return $this->children; + } + + /** + * Sets the xml remappings that should be performed. + * + * @param array $remappings an array of the form array(array(string, string)) + */ + public function setXmlRemappings(array $remappings) + { + $this->xmlRemappings = $remappings; + } + + /** + * Sets whether to add default values for this array if it has not been + * defined in any of the configuration files. + * + * @param bool $boolean + */ + public function setAddIfNotSet($boolean) + { + $this->addIfNotSet = (bool) $boolean; + } + + /** + * Sets whether false is allowed as value indicating that the array should be unset. + * + * @param bool $allow + */ + public function setAllowFalse($allow) + { + $this->allowFalse = (bool) $allow; + } + + /** + * Sets whether new keys can be defined in subsequent configurations. + * + * @param bool $allow + */ + public function setAllowNewKeys($allow) + { + $this->allowNewKeys = (bool) $allow; + } + + /** + * Sets if deep merging should occur. + * + * @param bool $boolean + */ + public function setPerformDeepMerging($boolean) + { + $this->performDeepMerging = (bool) $boolean; + } + + /** + * Whether extra keys should just be ignore without an exception. + * + * @param bool $boolean To allow extra keys + */ + public function setIgnoreExtraKeys($boolean) + { + $this->ignoreExtraKeys = (bool) $boolean; + } + + /** + * Sets the node Name. + * + * @param string $name The node's name + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * Checks if the node has a default value. + * + * @return bool + */ + public function hasDefaultValue() + { + return $this->addIfNotSet; + } + + /** + * Retrieves the default value. + * + * @return array The default value + * + * @throws \RuntimeException if the node has no default value + */ + public function getDefaultValue() + { + if (!$this->hasDefaultValue()) { + throw new \RuntimeException(sprintf('The node at path "%s" has no default value.', $this->getPath())); + } + + $defaults = array(); + foreach ($this->children as $name => $child) { + if ($child->hasDefaultValue()) { + $defaults[$name] = $child->getDefaultValue(); + } + } + + return $defaults; + } + + /** + * Adds a child node. + * + * @param NodeInterface $node The child node to add + * + * @throws \InvalidArgumentException when the child node has no name + * @throws \InvalidArgumentException when the child node's name is not unique + */ + public function addChild(NodeInterface $node) + { + $name = $node->getName(); + if (!strlen($name)) { + throw new \InvalidArgumentException('Child nodes must be named.'); + } + if (isset($this->children[$name])) { + throw new \InvalidArgumentException(sprintf('A child node named "%s" already exists.', $name)); + } + + $this->children[$name] = $node; + } + + /** + * Finalizes the value of this node. + * + * @param mixed $value + * + * @return mixed The finalised value + * + * @throws UnsetKeyException + * @throws InvalidConfigurationException if the node doesn't have enough children + */ + protected function finalizeValue($value) + { + if (false === $value) { + $msg = sprintf('Unsetting key for path "%s", value: %s', $this->getPath(), json_encode($value)); + throw new UnsetKeyException($msg); + } + + foreach ($this->children as $name => $child) { + if (!array_key_exists($name, $value)) { + if ($child->isRequired()) { + $msg = sprintf('The child node "%s" at path "%s" must be configured.', $name, $this->getPath()); + $ex = new InvalidConfigurationException($msg); + $ex->setPath($this->getPath()); + + throw $ex; + } + + if ($child->hasDefaultValue()) { + $value[$name] = $child->getDefaultValue(); + } + + continue; + } + + try { + $value[$name] = $child->finalize($value[$name]); + } catch (UnsetKeyException $unset) { + unset($value[$name]); + } + } + + return $value; + } + + /** + * Validates the type of the value. + * + * @param mixed $value + * + * @throws InvalidTypeException + */ + protected function validateType($value) + { + if (!is_array($value) && (!$this->allowFalse || false !== $value)) { + $ex = new InvalidTypeException(sprintf( + 'Invalid type for path "%s". Expected array, but got %s', + $this->getPath(), + gettype($value) + )); + $ex->setPath($this->getPath()); + + throw $ex; + } + } + + /** + * Normalizes the value. + * + * @param mixed $value The value to normalize + * + * @return mixed The normalized value + * + * @throws InvalidConfigurationException + */ + protected function normalizeValue($value) + { + if (false === $value) { + return $value; + } + + $value = $this->remapXml($value); + + $normalized = array(); + foreach ($value as $name => $val) { + if (isset($this->children[$name])) { + $normalized[$name] = $this->children[$name]->normalize($val); + unset($value[$name]); + } + } + + // if extra fields are present, throw exception + if (count($value) && !$this->ignoreExtraKeys) { + $msg = sprintf('Unrecognized options "%s" under "%s"', implode(', ', array_keys($value)), $this->getPath()); + $ex = new InvalidConfigurationException($msg); + $ex->setPath($this->getPath()); + + throw $ex; + } + + return $normalized; + } + + /** + * Remaps multiple singular values to a single plural value. + * + * @param array $value The source values + * + * @return array The remapped values + */ + protected function remapXml($value) + { + foreach ($this->xmlRemappings as $transformation) { + list($singular, $plural) = $transformation; + + if (!isset($value[$singular])) { + continue; + } + + $value[$plural] = Processor::normalizeConfig($value, $singular, $plural); + unset($value[$singular]); + } + + return $value; + } + + /** + * Merges values together. + * + * @param mixed $leftSide The left side to merge. + * @param mixed $rightSide The right side to merge. + * + * @return mixed The merged values + * + * @throws InvalidConfigurationException + * @throws \RuntimeException + */ + protected function mergeValues($leftSide, $rightSide) + { + if (false === $rightSide) { + // if this is still false after the last config has been merged the + // finalization pass will take care of removing this key entirely + return false; + } + + if (false === $leftSide || !$this->performDeepMerging) { + return $rightSide; + } + + foreach ($rightSide as $k => $v) { + // no conflict + if (!array_key_exists($k, $leftSide)) { + if (!$this->allowNewKeys) { + $ex = new InvalidConfigurationException(sprintf( + 'You are not allowed to define new elements for path "%s". ' + .'Please define all elements for this path in one config file. ' + .'If you are trying to overwrite an element, make sure you redefine it ' + .'with the same name.', + $this->getPath() + )); + $ex->setPath($this->getPath()); + + throw $ex; + } + + $leftSide[$k] = $v; + continue; + } + + if (!isset($this->children[$k])) { + throw new \RuntimeException('merge() expects a normalized config array.'); + } + + $leftSide[$k] = $this->children[$k]->merge($leftSide[$k], $v); + } + + return $leftSide; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php new file mode 100644 index 0000000..9e250c1 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php @@ -0,0 +1,354 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +use Symfony\Component\Config\Definition\Exception\Exception; +use Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException; +use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; + +/** + * The base node class + * + * @author Johannes M. Schmitt + */ +abstract class BaseNode implements NodeInterface +{ + protected $name; + protected $parent; + protected $normalizationClosures; + protected $finalValidationClosures; + protected $allowOverwrite; + protected $required; + protected $equivalentValues; + protected $attributes = array(); + + /** + * Constructor. + * + * @param string $name The name of the node + * @param NodeInterface $parent The parent of this node + * + * @throws \InvalidArgumentException if the name contains a period. + */ + public function __construct($name, NodeInterface $parent = null) + { + if (false !== strpos($name, '.')) { + throw new \InvalidArgumentException('The name must not contain ".".'); + } + + $this->name = $name; + $this->parent = $parent; + $this->normalizationClosures = array(); + $this->finalValidationClosures = array(); + $this->allowOverwrite = true; + $this->required = false; + $this->equivalentValues = array(); + } + + public function setAttribute($key, $value) + { + $this->attributes[$key] = $value; + } + + public function getAttribute($key, $default = null) + { + return isset($this->attributes[$key]) ? $this->attributes[$key] : $default; + } + + public function hasAttribute($key) + { + return isset($this->attributes[$key]); + } + + public function getAttributes() + { + return $this->attributes; + } + + public function setAttributes(array $attributes) + { + $this->attributes = $attributes; + } + + public function removeAttribute($key) + { + unset($this->attributes[$key]); + } + + /** + * Sets an info message. + * + * @param string $info + */ + public function setInfo($info) + { + $this->setAttribute('info', $info); + } + + /** + * Returns info message. + * + * @return string The info text + */ + public function getInfo() + { + return $this->getAttribute('info'); + } + + /** + * Sets the example configuration for this node. + * + * @param string|array $example + */ + public function setExample($example) + { + $this->setAttribute('example', $example); + } + + /** + * Retrieves the example configuration for this node. + * + * @return string|array The example + */ + public function getExample() + { + return $this->getAttribute('example'); + } + + /** + * Adds an equivalent value. + * + * @param mixed $originalValue + * @param mixed $equivalentValue + */ + public function addEquivalentValue($originalValue, $equivalentValue) + { + $this->equivalentValues[] = array($originalValue, $equivalentValue); + } + + /** + * Set this node as required. + * + * @param bool $boolean Required node + */ + public function setRequired($boolean) + { + $this->required = (bool) $boolean; + } + + /** + * Sets if this node can be overridden. + * + * @param bool $allow + */ + public function setAllowOverwrite($allow) + { + $this->allowOverwrite = (bool) $allow; + } + + /** + * Sets the closures used for normalization. + * + * @param \Closure[] $closures An array of Closures used for normalization + */ + public function setNormalizationClosures(array $closures) + { + $this->normalizationClosures = $closures; + } + + /** + * Sets the closures used for final validation. + * + * @param \Closure[] $closures An array of Closures used for final validation + */ + public function setFinalValidationClosures(array $closures) + { + $this->finalValidationClosures = $closures; + } + + /** + * Checks if this node is required. + * + * @return bool + */ + public function isRequired() + { + return $this->required; + } + + /** + * Returns the name of this node + * + * @return string The Node's name. + */ + public function getName() + { + return $this->name; + } + + /** + * Retrieves the path of this node. + * + * @return string The Node's path + */ + public function getPath() + { + $path = $this->name; + + if (null !== $this->parent) { + $path = $this->parent->getPath().'.'.$path; + } + + return $path; + } + + /** + * Merges two values together. + * + * @param mixed $leftSide + * @param mixed $rightSide + * + * @return mixed The merged value + * + * @throws ForbiddenOverwriteException + */ + final public function merge($leftSide, $rightSide) + { + if (!$this->allowOverwrite) { + throw new ForbiddenOverwriteException(sprintf( + 'Configuration path "%s" cannot be overwritten. You have to ' + .'define all options for this path, and any of its sub-paths in ' + .'one configuration section.', + $this->getPath() + )); + } + + $this->validateType($leftSide); + $this->validateType($rightSide); + + return $this->mergeValues($leftSide, $rightSide); + } + + /** + * Normalizes a value, applying all normalization closures. + * + * @param mixed $value Value to normalize. + * + * @return mixed The normalized value. + */ + final public function normalize($value) + { + $value = $this->preNormalize($value); + + // run custom normalization closures + foreach ($this->normalizationClosures as $closure) { + $value = $closure($value); + } + + // replace value with their equivalent + foreach ($this->equivalentValues as $data) { + if ($data[0] === $value) { + $value = $data[1]; + } + } + + // validate type + $this->validateType($value); + + // normalize value + return $this->normalizeValue($value); + } + + /** + * Normalizes the value before any other normalization is applied. + * + * @param $value + * + * @return $value The normalized array value + */ + protected function preNormalize($value) + { + return $value; + } + + /** + * Finalizes a value, applying all finalization closures. + * + * @param mixed $value The value to finalize + * + * @return mixed The finalized value + * + * @throws Exception + * @throws InvalidConfigurationException + */ + final public function finalize($value) + { + $this->validateType($value); + + $value = $this->finalizeValue($value); + + // Perform validation on the final value if a closure has been set. + // The closure is also allowed to return another value. + foreach ($this->finalValidationClosures as $closure) { + try { + $value = $closure($value); + } catch (Exception $correctEx) { + throw $correctEx; + } catch (\Exception $invalid) { + throw new InvalidConfigurationException(sprintf( + 'Invalid configuration for path "%s": %s', + $this->getPath(), + $invalid->getMessage() + ), $invalid->getCode(), $invalid); + } + } + + return $value; + } + + /** + * Validates the type of a Node. + * + * @param mixed $value The value to validate + * + * @throws InvalidTypeException when the value is invalid + */ + abstract protected function validateType($value); + + /** + * Normalizes the value. + * + * @param mixed $value The value to normalize. + * + * @return mixed The normalized value + */ + abstract protected function normalizeValue($value); + + /** + * Merges two values together. + * + * @param mixed $leftSide + * @param mixed $rightSide + * + * @return mixed The merged value + */ + abstract protected function mergeValues($leftSide, $rightSide); + + /** + * Finalizes a value. + * + * @param mixed $value The value to finalize + * + * @return mixed The finalized value + */ + abstract protected function finalizeValue($value); +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/BooleanNode.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/BooleanNode.php new file mode 100644 index 0000000..939e86f --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/BooleanNode.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +use Symfony\Component\Config\Definition\Exception\InvalidTypeException; + +/** + * This node represents a Boolean value in the config tree. + * + * @author Johannes M. Schmitt + */ +class BooleanNode extends ScalarNode +{ + /** + * {@inheritdoc} + */ + protected function validateType($value) + { + if (!is_bool($value)) { + $ex = new InvalidTypeException(sprintf( + 'Invalid type for path "%s". Expected boolean, but got %s.', + $this->getPath(), + gettype($value) + )); + $ex->setPath($this->getPath()); + + throw $ex; + } + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php new file mode 100644 index 0000000..c14e301 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php @@ -0,0 +1,496 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +use Symfony\Component\Config\Definition\ArrayNode; +use Symfony\Component\Config\Definition\PrototypedArrayNode; +use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException; + +/** + * This class provides a fluent interface for defining an array node. + * + * @author Johannes M. Schmitt + */ +class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinitionInterface +{ + protected $performDeepMerging; + protected $ignoreExtraKeys; + protected $children; + protected $prototype; + protected $atLeastOne; + protected $allowNewKeys; + protected $key; + protected $removeKeyItem; + protected $addDefaults; + protected $addDefaultChildren; + protected $nodeBuilder; + protected $normalizeKeys; + + /** + * {@inheritdoc} + */ + public function __construct($name, NodeParentInterface $parent = null) + { + parent::__construct($name, $parent); + + $this->children = array(); + $this->addDefaults = false; + $this->addDefaultChildren = false; + $this->allowNewKeys = true; + $this->atLeastOne = false; + $this->allowEmptyValue = true; + $this->performDeepMerging = true; + $this->nullEquivalent = array(); + $this->trueEquivalent = array(); + $this->normalizeKeys = true; + } + + /** + * Sets a custom children builder. + * + * @param NodeBuilder $builder A custom NodeBuilder + */ + public function setBuilder(NodeBuilder $builder) + { + $this->nodeBuilder = $builder; + } + + /** + * Returns a builder to add children nodes. + * + * @return NodeBuilder + */ + public function children() + { + return $this->getNodeBuilder(); + } + + /** + * Sets a prototype for child nodes. + * + * @param string $type the type of node + * + * @return NodeDefinition + */ + public function prototype($type) + { + return $this->prototype = $this->getNodeBuilder()->node(null, $type)->setParent($this); + } + + /** + * Adds the default value if the node is not set in the configuration. + * + * This method is applicable to concrete nodes only (not to prototype nodes). + * If this function has been called and the node is not set during the finalization + * phase, it's default value will be derived from its children default values. + * + * @return ArrayNodeDefinition + */ + public function addDefaultsIfNotSet() + { + $this->addDefaults = true; + + return $this; + } + + /** + * Adds children with a default value when none are defined. + * + * @param int|string|array|null $children The number of children|The child name|The children names to be added + * + * This method is applicable to prototype nodes only. + * + * @return ArrayNodeDefinition + */ + public function addDefaultChildrenIfNoneSet($children = null) + { + $this->addDefaultChildren = $children; + + return $this; + } + + /** + * Requires the node to have at least one element. + * + * This method is applicable to prototype nodes only. + * + * @return ArrayNodeDefinition + */ + public function requiresAtLeastOneElement() + { + $this->atLeastOne = true; + + return $this; + } + + /** + * Disallows adding news keys in a subsequent configuration. + * + * If used all keys have to be defined in the same configuration file. + * + * @return ArrayNodeDefinition + */ + public function disallowNewKeysInSubsequentConfigs() + { + $this->allowNewKeys = false; + + return $this; + } + + /** + * Sets a normalization rule for XML configurations. + * + * @param string $singular The key to remap + * @param string $plural The plural of the key for irregular plurals + * + * @return ArrayNodeDefinition + */ + public function fixXmlConfig($singular, $plural = null) + { + $this->normalization()->remap($singular, $plural); + + return $this; + } + + /** + * Sets the attribute which value is to be used as key. + * + * This is useful when you have an indexed array that should be an + * associative array. You can select an item from within the array + * to be the key of the particular item. For example, if "id" is the + * "key", then: + * + * array( + * array('id' => 'my_name', 'foo' => 'bar'), + * ); + * + * becomes + * + * array( + * 'my_name' => array('foo' => 'bar'), + * ); + * + * If you'd like "'id' => 'my_name'" to still be present in the resulting + * array, then you can set the second argument of this method to false. + * + * This method is applicable to prototype nodes only. + * + * @param string $name The name of the key + * @param bool $removeKeyItem Whether or not the key item should be removed. + * + * @return ArrayNodeDefinition + */ + public function useAttributeAsKey($name, $removeKeyItem = true) + { + $this->key = $name; + $this->removeKeyItem = $removeKeyItem; + + return $this; + } + + /** + * Sets whether the node can be unset. + * + * @param bool $allow + * + * @return ArrayNodeDefinition + */ + public function canBeUnset($allow = true) + { + $this->merge()->allowUnset($allow); + + return $this; + } + + /** + * Adds an "enabled" boolean to enable the current section. + * + * By default, the section is disabled. If any configuration is specified then + * the node will be automatically enabled: + * + * enableableArrayNode: {enabled: true, ...} # The config is enabled & default values get overridden + * enableableArrayNode: ~ # The config is enabled & use the default values + * enableableArrayNode: true # The config is enabled & use the default values + * enableableArrayNode: {other: value, ...} # The config is enabled & default values get overridden + * enableableArrayNode: {enabled: false, ...} # The config is disabled + * enableableArrayNode: false # The config is disabled + * + * @return ArrayNodeDefinition + */ + public function canBeEnabled() + { + $this + ->addDefaultsIfNotSet() + ->treatFalseLike(array('enabled' => false)) + ->treatTrueLike(array('enabled' => true)) + ->treatNullLike(array('enabled' => true)) + ->beforeNormalization() + ->ifArray() + ->then(function ($v) { + $v['enabled'] = isset($v['enabled']) ? $v['enabled'] : true; + + return $v; + }) + ->end() + ->children() + ->booleanNode('enabled') + ->defaultFalse() + ; + + return $this; + } + + /** + * Adds an "enabled" boolean to enable the current section. + * + * By default, the section is enabled. + * + * @return ArrayNodeDefinition + */ + public function canBeDisabled() + { + $this + ->addDefaultsIfNotSet() + ->treatFalseLike(array('enabled' => false)) + ->treatTrueLike(array('enabled' => true)) + ->treatNullLike(array('enabled' => true)) + ->children() + ->booleanNode('enabled') + ->defaultTrue() + ; + + return $this; + } + + /** + * Disables the deep merging of the node. + * + * @return ArrayNodeDefinition + */ + public function performNoDeepMerging() + { + $this->performDeepMerging = false; + + return $this; + } + + /** + * Allows extra config keys to be specified under an array without + * throwing an exception. + * + * Those config values are simply ignored. This should be used only + * in special cases where you want to send an entire configuration + * array through a special tree that processes only part of the array. + * + * @return ArrayNodeDefinition + */ + public function ignoreExtraKeys() + { + $this->ignoreExtraKeys = true; + + return $this; + } + + /** + * Sets key normalization. + * + * @param bool $bool Whether to enable key normalization + * + * @return ArrayNodeDefinition + */ + public function normalizeKeys($bool) + { + $this->normalizeKeys = (bool) $bool; + + return $this; + } + + /** + * Appends a node definition. + * + * $node = new ArrayNodeDefinition() + * ->children() + * ->scalarNode('foo')->end() + * ->scalarNode('baz')->end() + * ->end() + * ->append($this->getBarNodeDefinition()) + * ; + * + * @param NodeDefinition $node A NodeDefinition instance + * + * @return ArrayNodeDefinition This node + */ + public function append(NodeDefinition $node) + { + $this->children[$node->name] = $node->setParent($this); + + return $this; + } + + /** + * Returns a node builder to be used to add children and prototype + * + * @return NodeBuilder The node builder + */ + protected function getNodeBuilder() + { + if (null === $this->nodeBuilder) { + $this->nodeBuilder = new NodeBuilder(); + } + + return $this->nodeBuilder->setParent($this); + } + + /** + * {@inheritdoc} + */ + protected function createNode() + { + if (null === $this->prototype) { + $node = new ArrayNode($this->name, $this->parent); + + $this->validateConcreteNode($node); + + $node->setAddIfNotSet($this->addDefaults); + + foreach ($this->children as $child) { + $child->parent = $node; + $node->addChild($child->getNode()); + } + } else { + $node = new PrototypedArrayNode($this->name, $this->parent); + + $this->validatePrototypeNode($node); + + if (null !== $this->key) { + $node->setKeyAttribute($this->key, $this->removeKeyItem); + } + + if (true === $this->atLeastOne) { + $node->setMinNumberOfElements(1); + } + + if ($this->default) { + $node->setDefaultValue($this->defaultValue); + } + + if (false !== $this->addDefaultChildren) { + $node->setAddChildrenIfNoneSet($this->addDefaultChildren); + if ($this->prototype instanceof static && null === $this->prototype->prototype) { + $this->prototype->addDefaultsIfNotSet(); + } + } + + $this->prototype->parent = $node; + $node->setPrototype($this->prototype->getNode()); + } + + $node->setAllowNewKeys($this->allowNewKeys); + $node->addEquivalentValue(null, $this->nullEquivalent); + $node->addEquivalentValue(true, $this->trueEquivalent); + $node->addEquivalentValue(false, $this->falseEquivalent); + $node->setPerformDeepMerging($this->performDeepMerging); + $node->setRequired($this->required); + $node->setIgnoreExtraKeys($this->ignoreExtraKeys); + $node->setNormalizeKeys($this->normalizeKeys); + + if (null !== $this->normalization) { + $node->setNormalizationClosures($this->normalization->before); + $node->setXmlRemappings($this->normalization->remappings); + } + + if (null !== $this->merge) { + $node->setAllowOverwrite($this->merge->allowOverwrite); + $node->setAllowFalse($this->merge->allowFalse); + } + + if (null !== $this->validation) { + $node->setFinalValidationClosures($this->validation->rules); + } + + return $node; + } + + /** + * Validate the configuration of a concrete node. + * + * @param ArrayNode $node The related node + * + * @throws InvalidDefinitionException + */ + protected function validateConcreteNode(ArrayNode $node) + { + $path = $node->getPath(); + + if (null !== $this->key) { + throw new InvalidDefinitionException( + sprintf('->useAttributeAsKey() is not applicable to concrete nodes at path "%s"', $path) + ); + } + + if (true === $this->atLeastOne) { + throw new InvalidDefinitionException( + sprintf('->requiresAtLeastOneElement() is not applicable to concrete nodes at path "%s"', $path) + ); + } + + if ($this->default) { + throw new InvalidDefinitionException( + sprintf('->defaultValue() is not applicable to concrete nodes at path "%s"', $path) + ); + } + + if (false !== $this->addDefaultChildren) { + throw new InvalidDefinitionException( + sprintf('->addDefaultChildrenIfNoneSet() is not applicable to concrete nodes at path "%s"', $path) + ); + } + } + + /** + * Validate the configuration of a prototype node. + * + * @param PrototypedArrayNode $node The related node + * + * @throws InvalidDefinitionException + */ + protected function validatePrototypeNode(PrototypedArrayNode $node) + { + $path = $node->getPath(); + + if ($this->addDefaults) { + throw new InvalidDefinitionException( + sprintf('->addDefaultsIfNotSet() is not applicable to prototype nodes at path "%s"', $path) + ); + } + + if (false !== $this->addDefaultChildren) { + if ($this->default) { + throw new InvalidDefinitionException( + sprintf('A default value and default children might not be used together at path "%s"', $path) + ); + } + + if (null !== $this->key && (null === $this->addDefaultChildren || is_integer($this->addDefaultChildren) && $this->addDefaultChildren > 0)) { + throw new InvalidDefinitionException( + sprintf('->addDefaultChildrenIfNoneSet() should set default children names as ->useAttributeAsKey() is used at path "%s"', $path) + ); + } + + if (null === $this->key && (is_string($this->addDefaultChildren) || is_array($this->addDefaultChildren))) { + throw new InvalidDefinitionException( + sprintf('->addDefaultChildrenIfNoneSet() might not set default children names as ->useAttributeAsKey() is not used at path "%s"', $path) + ); + } + } + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php new file mode 100644 index 0000000..979f9ba --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +use Symfony\Component\Config\Definition\BooleanNode; + +/** + * This class provides a fluent interface for defining a node. + * + * @author Johannes M. Schmitt + */ +class BooleanNodeDefinition extends ScalarNodeDefinition +{ + /** + * {@inheritdoc} + */ + public function __construct($name, NodeParentInterface $parent = null) + { + parent::__construct($name, $parent); + + $this->nullEquivalent = true; + } + + /** + * Instantiate a Node + * + * @return BooleanNode The node + */ + protected function instantiateNode() + { + return new BooleanNode($this->name, $this->parent); + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php new file mode 100644 index 0000000..d3ef35b --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php @@ -0,0 +1,53 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +use Symfony\Component\Config\Definition\EnumNode; + +/** + * Enum Node Definition. + * + * @author Johannes M. Schmitt + */ +class EnumNodeDefinition extends ScalarNodeDefinition +{ + private $values; + + public function values(array $values) + { + $values = array_unique($values); + + if (count($values) <= 1) { + throw new \InvalidArgumentException('->values() must be called with at least two distinct values.'); + } + + $this->values = $values; + + return $this; + } + + /** + * Instantiate a Node + * + * @return EnumNode The node + * + * @throws \RuntimeException + */ + protected function instantiateNode() + { + if (null === $this->values) { + throw new \RuntimeException('You must call ->values() on enum nodes.'); + } + + return new EnumNode($this->name, $this->parent, $this->values); + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ExprBuilder.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ExprBuilder.php new file mode 100644 index 0000000..7cbddc6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ExprBuilder.php @@ -0,0 +1,236 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +use Symfony\Component\Config\Definition\Exception\UnsetKeyException; + +/** + * This class builds an if expression. + * + * @author Johannes M. Schmitt + * @author Christophe Coevoet + */ +class ExprBuilder +{ + protected $node; + public $ifPart; + public $thenPart; + + /** + * Constructor + * + * @param NodeDefinition $node The related node + */ + public function __construct(NodeDefinition $node) + { + $this->node = $node; + } + + /** + * Marks the expression as being always used. + * + * @param \Closure $then + * + * @return ExprBuilder + */ + public function always(\Closure $then = null) + { + $this->ifPart = function ($v) { return true; }; + + if (null !== $then) { + $this->thenPart = $then; + } + + return $this; + } + + /** + * Sets a closure to use as tests. + * + * The default one tests if the value is true. + * + * @param \Closure $closure + * + * @return ExprBuilder + */ + public function ifTrue(\Closure $closure = null) + { + if (null === $closure) { + $closure = function ($v) { return true === $v; }; + } + + $this->ifPart = $closure; + + return $this; + } + + /** + * Tests if the value is a string. + * + * @return ExprBuilder + */ + public function ifString() + { + $this->ifPart = function ($v) { return is_string($v); }; + + return $this; + } + + /** + * Tests if the value is null. + * + * @return ExprBuilder + */ + public function ifNull() + { + $this->ifPart = function ($v) { return null === $v; }; + + return $this; + } + + /** + * Tests if the value is an array. + * + * @return ExprBuilder + */ + public function ifArray() + { + $this->ifPart = function ($v) { return is_array($v); }; + + return $this; + } + + /** + * Tests if the value is in an array. + * + * @param array $array + * + * @return ExprBuilder + */ + public function ifInArray(array $array) + { + $this->ifPart = function ($v) use ($array) { return in_array($v, $array, true); }; + + return $this; + } + + /** + * Tests if the value is not in an array. + * + * @param array $array + * + * @return ExprBuilder + */ + public function ifNotInArray(array $array) + { + $this->ifPart = function ($v) use ($array) { return !in_array($v, $array, true); }; + + return $this; + } + + /** + * Sets the closure to run if the test pass. + * + * @param \Closure $closure + * + * @return ExprBuilder + */ + public function then(\Closure $closure) + { + $this->thenPart = $closure; + + return $this; + } + + /** + * Sets a closure returning an empty array. + * + * @return ExprBuilder + */ + public function thenEmptyArray() + { + $this->thenPart = function ($v) { return array(); }; + + return $this; + } + + /** + * Sets a closure marking the value as invalid at validation time. + * + * if you want to add the value of the node in your message just use a %s placeholder. + * + * @param string $message + * + * @return ExprBuilder + * + * @throws \InvalidArgumentException + */ + public function thenInvalid($message) + { + $this->thenPart = function ($v) use ($message) {throw new \InvalidArgumentException(sprintf($message, json_encode($v))); }; + + return $this; + } + + /** + * Sets a closure unsetting this key of the array at validation time. + * + * @return ExprBuilder + * + * @throws UnsetKeyException + */ + public function thenUnset() + { + $this->thenPart = function ($v) { throw new UnsetKeyException('Unsetting key'); }; + + return $this; + } + + /** + * Returns the related node + * + * @return NodeDefinition + * + * @throws \RuntimeException + */ + public function end() + { + if (null === $this->ifPart) { + throw new \RuntimeException('You must specify an if part.'); + } + if (null === $this->thenPart) { + throw new \RuntimeException('You must specify a then part.'); + } + + return $this->node; + } + + /** + * Builds the expressions. + * + * @param ExprBuilder[] $expressions An array of ExprBuilder instances to build + * + * @return array + */ + public static function buildExpressions(array $expressions) + { + foreach ($expressions as $k => $expr) { + if ($expr instanceof ExprBuilder) { + $expressions[$k] = function ($v) use ($expr) { + return call_user_func($expr->ifPart, $v) ? call_user_func($expr->thenPart, $v) : $v; + }; + } + } + + return $expressions; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/FloatNodeDefinition.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/FloatNodeDefinition.php new file mode 100644 index 0000000..c0bed46 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/FloatNodeDefinition.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +use Symfony\Component\Config\Definition\FloatNode; + +/** + * This class provides a fluent interface for defining a float node. + * + * @author Jeanmonod David + */ +class FloatNodeDefinition extends NumericNodeDefinition +{ + /** + * Instantiates a Node. + * + * @return FloatNode The node + */ + protected function instantiateNode() + { + return new FloatNode($this->name, $this->parent, $this->min, $this->max); + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/IntegerNodeDefinition.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/IntegerNodeDefinition.php new file mode 100644 index 0000000..f6c3c14 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/IntegerNodeDefinition.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +use Symfony\Component\Config\Definition\IntegerNode; + +/** + * This class provides a fluent interface for defining an integer node. + * + * @author Jeanmonod David + */ +class IntegerNodeDefinition extends NumericNodeDefinition +{ + /** + * Instantiates a Node. + * + * @return IntegerNode The node + */ + protected function instantiateNode() + { + return new IntegerNode($this->name, $this->parent, $this->min, $this->max); + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/MergeBuilder.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/MergeBuilder.php new file mode 100644 index 0000000..6114206 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/MergeBuilder.php @@ -0,0 +1,74 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +/** + * This class builds merge conditions. + * + * @author Johannes M. Schmitt + */ +class MergeBuilder +{ + protected $node; + public $allowFalse; + public $allowOverwrite; + + /** + * Constructor + * + * @param NodeDefinition $node The related node + */ + public function __construct(NodeDefinition $node) + { + $this->node = $node; + $this->allowFalse = false; + $this->allowOverwrite = true; + } + + /** + * Sets whether the node can be unset. + * + * @param bool $allow + * + * @return MergeBuilder + */ + public function allowUnset($allow = true) + { + $this->allowFalse = $allow; + + return $this; + } + + /** + * Sets whether the node can be overwritten. + * + * @param bool $deny Whether the overwriting is forbidden or not + * + * @return MergeBuilder + */ + public function denyOverwrite($deny = true) + { + $this->allowOverwrite = !$deny; + + return $this; + } + + /** + * Returns the related node. + * + * @return NodeDefinition + */ + public function end() + { + return $this->node; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeBuilder.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeBuilder.php new file mode 100644 index 0000000..e140df7 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeBuilder.php @@ -0,0 +1,246 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +/** + * This class provides a fluent interface for building a node. + * + * @author Johannes M. Schmitt + */ +class NodeBuilder implements NodeParentInterface +{ + protected $parent; + protected $nodeMapping; + + /** + * Constructor + * + */ + public function __construct() + { + $this->nodeMapping = array( + 'variable' => __NAMESPACE__.'\\VariableNodeDefinition', + 'scalar' => __NAMESPACE__.'\\ScalarNodeDefinition', + 'boolean' => __NAMESPACE__.'\\BooleanNodeDefinition', + 'integer' => __NAMESPACE__.'\\IntegerNodeDefinition', + 'float' => __NAMESPACE__.'\\FloatNodeDefinition', + 'array' => __NAMESPACE__.'\\ArrayNodeDefinition', + 'enum' => __NAMESPACE__.'\\EnumNodeDefinition', + ); + } + + /** + * Set the parent node. + * + * @param ParentNodeDefinitionInterface $parent The parent node + * + * @return NodeBuilder This node builder + */ + public function setParent(ParentNodeDefinitionInterface $parent = null) + { + $this->parent = $parent; + + return $this; + } + + /** + * Creates a child array node. + * + * @param string $name The name of the node + * + * @return ArrayNodeDefinition The child node + */ + public function arrayNode($name) + { + return $this->node($name, 'array'); + } + + /** + * Creates a child scalar node. + * + * @param string $name the name of the node + * + * @return ScalarNodeDefinition The child node + */ + public function scalarNode($name) + { + return $this->node($name, 'scalar'); + } + + /** + * Creates a child Boolean node. + * + * @param string $name The name of the node + * + * @return BooleanNodeDefinition The child node + */ + public function booleanNode($name) + { + return $this->node($name, 'boolean'); + } + + /** + * Creates a child integer node. + * + * @param string $name the name of the node + * + * @return IntegerNodeDefinition The child node + */ + public function integerNode($name) + { + return $this->node($name, 'integer'); + } + + /** + * Creates a child float node. + * + * @param string $name the name of the node + * + * @return FloatNodeDefinition The child node + */ + public function floatNode($name) + { + return $this->node($name, 'float'); + } + + /** + * Creates a child EnumNode. + * + * @param string $name + * + * @return EnumNodeDefinition + */ + public function enumNode($name) + { + return $this->node($name, 'enum'); + } + + /** + * Creates a child variable node. + * + * @param string $name The name of the node + * + * @return VariableNodeDefinition The builder of the child node + */ + public function variableNode($name) + { + return $this->node($name, 'variable'); + } + + /** + * Returns the parent node. + * + * @return ParentNodeDefinitionInterface The parent node + */ + public function end() + { + return $this->parent; + } + + /** + * Creates a child node. + * + * @param string $name The name of the node + * @param string $type The type of the node + * + * @return NodeDefinition The child node + * + * @throws \RuntimeException When the node type is not registered + * @throws \RuntimeException When the node class is not found + */ + public function node($name, $type) + { + $class = $this->getNodeClass($type); + + $node = new $class($name); + + $this->append($node); + + return $node; + } + + /** + * Appends a node definition. + * + * Usage: + * + * $node = new ArrayNodeDefinition('name') + * ->children() + * ->scalarNode('foo')->end() + * ->scalarNode('baz')->end() + * ->append($this->getBarNodeDefinition()) + * ->end() + * ; + * + * @param NodeDefinition $node + * + * @return NodeBuilder This node builder + */ + public function append(NodeDefinition $node) + { + if ($node instanceof ParentNodeDefinitionInterface) { + $builder = clone $this; + $builder->setParent(null); + $node->setBuilder($builder); + } + + if (null !== $this->parent) { + $this->parent->append($node); + // Make this builder the node parent to allow for a fluid interface + $node->setParent($this); + } + + return $this; + } + + /** + * Adds or overrides a node Type. + * + * @param string $type The name of the type + * @param string $class The fully qualified name the node definition class + * + * @return NodeBuilder This node builder + */ + public function setNodeClass($type, $class) + { + $this->nodeMapping[strtolower($type)] = $class; + + return $this; + } + + /** + * Returns the class name of the node definition. + * + * @param string $type The node type + * + * @return string The node definition class name + * + * @throws \RuntimeException When the node type is not registered + * @throws \RuntimeException When the node class is not found + */ + protected function getNodeClass($type) + { + $type = strtolower($type); + + if (!isset($this->nodeMapping[$type])) { + throw new \RuntimeException(sprintf('The node type "%s" is not registered.', $type)); + } + + $class = $this->nodeMapping[$type]; + + if (!class_exists($class)) { + throw new \RuntimeException(sprintf('The node class "%s" does not exist.', $class)); + } + + return $class; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeDefinition.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeDefinition.php new file mode 100644 index 0000000..2efcd05 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeDefinition.php @@ -0,0 +1,346 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +use Symfony\Component\Config\Definition\NodeInterface; +use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException; + +/** + * This class provides a fluent interface for defining a node. + * + * @author Johannes M. Schmitt + */ +abstract class NodeDefinition implements NodeParentInterface +{ + protected $name; + protected $normalization; + protected $validation; + protected $defaultValue; + protected $default; + protected $required; + protected $merge; + protected $allowEmptyValue; + protected $nullEquivalent; + protected $trueEquivalent; + protected $falseEquivalent; + /** + * @var NodeParentInterface|NodeInterface + */ + protected $parent; + protected $attributes = array(); + + /** + * Constructor + * + * @param string $name The name of the node + * @param NodeParentInterface $parent The parent + */ + public function __construct($name, NodeParentInterface $parent = null) + { + $this->parent = $parent; + $this->name = $name; + $this->default = false; + $this->required = false; + $this->trueEquivalent = true; + $this->falseEquivalent = false; + } + + /** + * Sets the parent node. + * + * @param NodeParentInterface $parent The parent + * + * @return NodeDefinition + */ + public function setParent(NodeParentInterface $parent) + { + $this->parent = $parent; + + return $this; + } + + /** + * Sets info message. + * + * @param string $info The info text + * + * @return NodeDefinition + */ + public function info($info) + { + return $this->attribute('info', $info); + } + + /** + * Sets example configuration. + * + * @param string|array $example + * + * @return NodeDefinition + */ + public function example($example) + { + return $this->attribute('example', $example); + } + + /** + * Sets an attribute on the node. + * + * @param string $key + * @param mixed $value + * + * @return NodeDefinition + */ + public function attribute($key, $value) + { + $this->attributes[$key] = $value; + + return $this; + } + + /** + * Returns the parent node. + * + * @return NodeParentInterface The builder of the parent node + */ + public function end() + { + return $this->parent; + } + + /** + * Creates the node. + * + * @param bool $forceRootNode Whether to force this node as the root node + * + * @return NodeInterface + */ + public function getNode($forceRootNode = false) + { + if ($forceRootNode) { + $this->parent = null; + } + + if (null !== $this->normalization) { + $this->normalization->before = ExprBuilder::buildExpressions($this->normalization->before); + } + + if (null !== $this->validation) { + $this->validation->rules = ExprBuilder::buildExpressions($this->validation->rules); + } + + $node = $this->createNode(); + $node->setAttributes($this->attributes); + + return $node; + } + + /** + * Sets the default value. + * + * @param mixed $value The default value + * + * @return NodeDefinition + */ + public function defaultValue($value) + { + $this->default = true; + $this->defaultValue = $value; + + return $this; + } + + /** + * Sets the node as required. + * + * @return NodeDefinition + */ + public function isRequired() + { + $this->required = true; + + return $this; + } + + /** + * Sets the equivalent value used when the node contains null. + * + * @param mixed $value + * + * @return NodeDefinition + */ + public function treatNullLike($value) + { + $this->nullEquivalent = $value; + + return $this; + } + + /** + * Sets the equivalent value used when the node contains true. + * + * @param mixed $value + * + * @return NodeDefinition + */ + public function treatTrueLike($value) + { + $this->trueEquivalent = $value; + + return $this; + } + + /** + * Sets the equivalent value used when the node contains false. + * + * @param mixed $value + * + * @return NodeDefinition + */ + public function treatFalseLike($value) + { + $this->falseEquivalent = $value; + + return $this; + } + + /** + * Sets null as the default value. + * + * @return NodeDefinition + */ + public function defaultNull() + { + return $this->defaultValue(null); + } + + /** + * Sets true as the default value. + * + * @return NodeDefinition + */ + public function defaultTrue() + { + return $this->defaultValue(true); + } + + /** + * Sets false as the default value. + * + * @return NodeDefinition + */ + public function defaultFalse() + { + return $this->defaultValue(false); + } + + /** + * Sets an expression to run before the normalization. + * + * @return ExprBuilder + */ + public function beforeNormalization() + { + return $this->normalization()->before(); + } + + /** + * Denies the node value being empty. + * + * @return NodeDefinition + */ + public function cannotBeEmpty() + { + $this->allowEmptyValue = false; + + return $this; + } + + /** + * Sets an expression to run for the validation. + * + * The expression receives the value of the node and must return it. It can + * modify it. + * An exception should be thrown when the node is not valid. + * + * @return ExprBuilder + */ + public function validate() + { + return $this->validation()->rule(); + } + + /** + * Sets whether the node can be overwritten. + * + * @param bool $deny Whether the overwriting is forbidden or not + * + * @return NodeDefinition + */ + public function cannotBeOverwritten($deny = true) + { + $this->merge()->denyOverwrite($deny); + + return $this; + } + + /** + * Gets the builder for validation rules. + * + * @return ValidationBuilder + */ + protected function validation() + { + if (null === $this->validation) { + $this->validation = new ValidationBuilder($this); + } + + return $this->validation; + } + + /** + * Gets the builder for merging rules. + * + * @return MergeBuilder + */ + protected function merge() + { + if (null === $this->merge) { + $this->merge = new MergeBuilder($this); + } + + return $this->merge; + } + + /** + * Gets the builder for normalization rules. + * + * @return NormalizationBuilder + */ + protected function normalization() + { + if (null === $this->normalization) { + $this->normalization = new NormalizationBuilder($this); + } + + return $this->normalization; + } + + /** + * Instantiate and configure the node according to this definition + * + * @return NodeInterface $node The node instance + * + * @throws InvalidDefinitionException When the definition is invalid + */ + abstract protected function createNode(); +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php new file mode 100644 index 0000000..24f3971 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +/** + * An interface that must be implemented by all node parents + * + * @author Victor Berchet + */ +interface NodeParentInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php new file mode 100644 index 0000000..87f25b7 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +/** + * This class builds normalization conditions. + * + * @author Johannes M. Schmitt + */ +class NormalizationBuilder +{ + protected $node; + public $before; + public $remappings; + + /** + * Constructor + * + * @param NodeDefinition $node The related node + */ + public function __construct(NodeDefinition $node) + { + $this->node = $node; + $this->keys = false; + $this->remappings = array(); + $this->before = array(); + } + + /** + * Registers a key to remap to its plural form. + * + * @param string $key The key to remap + * @param string $plural The plural of the key in case of irregular plural + * + * @return NormalizationBuilder + */ + public function remap($key, $plural = null) + { + $this->remappings[] = array($key, null === $plural ? $key.'s' : $plural); + + return $this; + } + + /** + * Registers a closure to run before the normalization or an expression builder to build it if null is provided. + * + * @param \Closure $closure + * + * @return ExprBuilder|NormalizationBuilder + */ + public function before(\Closure $closure = null) + { + if (null !== $closure) { + $this->before[] = $closure; + + return $this; + } + + return $this->before[] = new ExprBuilder($this->node); + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php new file mode 100644 index 0000000..5b6e955 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +/** + * Abstract class that contain common code of integer and float node definition. + * + * @author David Jeanmonod + */ +abstract class NumericNodeDefinition extends ScalarNodeDefinition +{ + protected $min; + protected $max; + + /** + * Ensures that the value is smaller than the given reference. + * + * @param mixed $max + * + * @return NumericNodeDefinition + * + * @throws \InvalidArgumentException when the constraint is inconsistent + */ + public function max($max) + { + if (isset($this->min) && $this->min > $max) { + throw new \InvalidArgumentException(sprintf('You cannot define a max(%s) as you already have a min(%s)', $max, $this->min)); + } + $this->max = $max; + + return $this; + } + + /** + * Ensures that the value is bigger than the given reference. + * + * @param mixed $min + * + * @return NumericNodeDefinition + * + * @throws \InvalidArgumentException when the constraint is inconsistent + */ + public function min($min) + { + if (isset($this->max) && $this->max < $min) { + throw new \InvalidArgumentException(sprintf('You cannot define a min(%s) as you already have a max(%s)', $min, $this->max)); + } + $this->min = $min; + + return $this; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php new file mode 100644 index 0000000..005c26b --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +/** + * An interface that must be implemented by nodes which can have children + * + * @author Victor Berchet + */ +interface ParentNodeDefinitionInterface +{ + public function children(); + + public function append(NodeDefinition $node); + + public function setBuilder(NodeBuilder $builder); +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ScalarNodeDefinition.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ScalarNodeDefinition.php new file mode 100644 index 0000000..6a115fe --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ScalarNodeDefinition.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +use Symfony\Component\Config\Definition\ScalarNode; + +/** + * This class provides a fluent interface for defining a node. + * + * @author Johannes M. Schmitt + */ +class ScalarNodeDefinition extends VariableNodeDefinition +{ + /** + * Instantiate a Node + * + * @return ScalarNode The node + */ + protected function instantiateNode() + { + return new ScalarNode($this->name, $this->parent); + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/TreeBuilder.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/TreeBuilder.php new file mode 100644 index 0000000..5d02848 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/TreeBuilder.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +use Symfony\Component\Config\Definition\NodeInterface; + +/** + * This is the entry class for building a config tree. + * + * @author Johannes M. Schmitt + */ +class TreeBuilder implements NodeParentInterface +{ + protected $tree; + protected $root; + protected $builder; + + /** + * Creates the root node. + * + * @param string $name The name of the root node + * @param string $type The type of the root node + * @param NodeBuilder $builder A custom node builder instance + * + * @return ArrayNodeDefinition|NodeDefinition The root node (as an ArrayNodeDefinition when the type is 'array') + * + * @throws \RuntimeException When the node type is not supported + */ + public function root($name, $type = 'array', NodeBuilder $builder = null) + { + $builder = $builder ?: new NodeBuilder(); + + return $this->root = $builder->node($name, $type)->setParent($this); + } + + /** + * Builds the tree. + * + * @return NodeInterface + * + * @throws \RuntimeException + */ + public function buildTree() + { + if (null === $this->root) { + throw new \RuntimeException('The configuration tree has no root node.'); + } + if (null !== $this->tree) { + return $this->tree; + } + + return $this->tree = $this->root->getNode(true); + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php new file mode 100644 index 0000000..22f54a1 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php @@ -0,0 +1,53 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +/** + * This class builds validation conditions. + * + * @author Christophe Coevoet + */ +class ValidationBuilder +{ + protected $node; + public $rules; + + /** + * Constructor + * + * @param NodeDefinition $node The related node + */ + public function __construct(NodeDefinition $node) + { + $this->node = $node; + + $this->rules = array(); + } + + /** + * Registers a closure to run as normalization or an expression builder to build it if null is provided. + * + * @param \Closure $closure + * + * @return ExprBuilder|ValidationBuilder + */ + public function rule(\Closure $closure = null) + { + if (null !== $closure) { + $this->rules[] = $closure; + + return $this; + } + + return $this->rules[] = new ExprBuilder($this->node); + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php new file mode 100644 index 0000000..26196c8 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +use Symfony\Component\Config\Definition\VariableNode; + +/** + * This class provides a fluent interface for defining a node. + * + * @author Johannes M. Schmitt + */ +class VariableNodeDefinition extends NodeDefinition +{ + /** + * Instantiate a Node + * + * @return VariableNode The node + */ + protected function instantiateNode() + { + return new VariableNode($this->name, $this->parent); + } + + /** + * {@inheritdoc} + */ + protected function createNode() + { + $node = $this->instantiateNode(); + + if (null !== $this->normalization) { + $node->setNormalizationClosures($this->normalization->before); + } + + if (null !== $this->merge) { + $node->setAllowOverwrite($this->merge->allowOverwrite); + } + + if (true === $this->default) { + $node->setDefaultValue($this->defaultValue); + } + + if (false === $this->allowEmptyValue) { + $node->setAllowEmptyValue($this->allowEmptyValue); + } + + $node->addEquivalentValue(null, $this->nullEquivalent); + $node->addEquivalentValue(true, $this->trueEquivalent); + $node->addEquivalentValue(false, $this->falseEquivalent); + $node->setRequired($this->required); + + if (null !== $this->validation) { + $node->setFinalValidationClosures($this->validation->rules); + } + + return $node; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ConfigurationInterface.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ConfigurationInterface.php new file mode 100644 index 0000000..336cb00 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ConfigurationInterface.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +/** + * Configuration interface + * + * @author Victor Berchet + */ +interface ConfigurationInterface +{ + /** + * Generates the configuration tree builder. + * + * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder + */ + public function getConfigTreeBuilder(); +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/EnumNode.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/EnumNode.php new file mode 100644 index 0000000..224871a --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/EnumNode.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; + +/** + * Node which only allows a finite set of values. + * + * @author Johannes M. Schmitt + */ +class EnumNode extends ScalarNode +{ + private $values; + + public function __construct($name, NodeInterface $parent = null, array $values = array()) + { + $values = array_unique($values); + if (count($values) <= 1) { + throw new \InvalidArgumentException('$values must contain at least two distinct elements.'); + } + + parent::__construct($name, $parent); + $this->values = $values; + } + + public function getValues() + { + return $this->values; + } + + protected function finalizeValue($value) + { + $value = parent::finalizeValue($value); + + if (!in_array($value, $this->values, true)) { + $ex = new InvalidConfigurationException(sprintf( + 'The value %s is not allowed for path "%s". Permissible values: %s', + json_encode($value), + $this->getPath(), + implode(', ', array_map('json_encode', $this->values)))); + $ex->setPath($this->getPath()); + + throw $ex; + } + + return $value; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/DuplicateKeyException.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/DuplicateKeyException.php new file mode 100644 index 0000000..48dd932 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/DuplicateKeyException.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Exception; + +/** + * This exception is thrown whenever the key of an array is not unique. This can + * only be the case if the configuration is coming from an XML file. + * + * @author Johannes M. Schmitt + */ +class DuplicateKeyException extends InvalidConfigurationException +{ +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/Exception.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/Exception.php new file mode 100644 index 0000000..1fda6c2 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/Exception.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Exception; + +/** + * Base exception for all configuration exceptions + * + * @author Johannes M. Schmitt + */ +class Exception extends \RuntimeException +{ +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/ForbiddenOverwriteException.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/ForbiddenOverwriteException.php new file mode 100644 index 0000000..726c07f --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/ForbiddenOverwriteException.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Exception; + +/** + * This exception is thrown when a configuration path is overwritten from a + * subsequent configuration file, but the entry node specifically forbids this. + * + * @author Johannes M. Schmitt + */ +class ForbiddenOverwriteException extends InvalidConfigurationException +{ +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidConfigurationException.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidConfigurationException.php new file mode 100644 index 0000000..840e3f3 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidConfigurationException.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Exception; + +/** + * A very general exception which can be thrown whenever non of the more specific + * exceptions is suitable. + * + * @author Johannes M. Schmitt + */ +class InvalidConfigurationException extends Exception +{ + private $path; + + public function setPath($path) + { + $this->path = $path; + } + + public function getPath() + { + return $this->path; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidDefinitionException.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidDefinitionException.php new file mode 100644 index 0000000..98310da --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidDefinitionException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Exception; + +/** + * Thrown when an error is detected in a node Definition. + * + * @author Victor Berchet + */ +class InvalidDefinitionException extends Exception +{ +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidTypeException.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidTypeException.php new file mode 100644 index 0000000..d7ca8c9 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidTypeException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Exception; + +/** + * This exception is thrown if an invalid type is encountered. + * + * @author Johannes M. Schmitt + */ +class InvalidTypeException extends InvalidConfigurationException +{ +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/UnsetKeyException.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/UnsetKeyException.php new file mode 100644 index 0000000..863181a --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/UnsetKeyException.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Exception; + +/** + * This exception is usually not encountered by the end-user, but only used + * internally to signal the parent scope to unset a key. + * + * @author Johannes M. Schmitt + */ +class UnsetKeyException extends Exception +{ +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/FloatNode.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/FloatNode.php new file mode 100644 index 0000000..0fe0e34 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/FloatNode.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +use Symfony\Component\Config\Definition\Exception\InvalidTypeException; + +/** + * This node represents a float value in the config tree. + * + * @author Jeanmonod David + */ +class FloatNode extends NumericNode +{ + /** + * {@inheritdoc} + */ + protected function validateType($value) + { + // Integers are also accepted, we just cast them + if (is_int($value)) { + $value = (float) $value; + } + + if (!is_float($value)) { + $ex = new InvalidTypeException(sprintf('Invalid type for path "%s". Expected float, but got %s.', $this->getPath(), gettype($value))); + $ex->setPath($this->getPath()); + + throw $ex; + } + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/IntegerNode.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/IntegerNode.php new file mode 100644 index 0000000..f76efe6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/IntegerNode.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +use Symfony\Component\Config\Definition\Exception\InvalidTypeException; + +/** + * This node represents an integer value in the config tree. + * + * @author Jeanmonod David + */ +class IntegerNode extends NumericNode +{ + /** + * {@inheritdoc} + */ + protected function validateType($value) + { + if (!is_int($value)) { + $ex = new InvalidTypeException(sprintf('Invalid type for path "%s". Expected int, but got %s.', $this->getPath(), gettype($value))); + $ex->setPath($this->getPath()); + + throw $ex; + } + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/NodeInterface.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/NodeInterface.php new file mode 100644 index 0000000..67353e8 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/NodeInterface.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +/** + * Common Interface among all nodes. + * + * In most cases, it is better to inherit from BaseNode instead of implementing + * this interface yourself. + * + * @author Johannes M. Schmitt + */ +interface NodeInterface +{ + /** + * Returns the name of the node. + * + * @return string The name of the node + */ + public function getName(); + + /** + * Returns the path of the node. + * + * @return string The node path + */ + public function getPath(); + + /** + * Returns true when the node is required. + * + * @return bool If the node is required + */ + public function isRequired(); + + /** + * Returns true when the node has a default value. + * + * @return bool If the node has a default value + */ + public function hasDefaultValue(); + + /** + * Returns the default value of the node. + * + * @return mixed The default value + * @throws \RuntimeException if the node has no default value + */ + public function getDefaultValue(); + + /** + * Normalizes the supplied value. + * + * @param mixed $value The value to normalize + * + * @return mixed The normalized value + */ + public function normalize($value); + + /** + * Merges two values together. + * + * @param mixed $leftSide + * @param mixed $rightSide + * + * @return mixed The merged values + */ + public function merge($leftSide, $rightSide); + + /** + * Finalizes a value. + * + * @param mixed $value The value to finalize + * + * @return mixed The finalized value + */ + public function finalize($value); +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/NumericNode.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/NumericNode.php new file mode 100644 index 0000000..39b96d6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/NumericNode.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; + +/** + * This node represents a numeric value in the config tree + * + * @author David Jeanmonod + */ +class NumericNode extends ScalarNode +{ + protected $min; + protected $max; + + public function __construct($name, NodeInterface $parent = null, $min = null, $max = null) + { + parent::__construct($name, $parent); + $this->min = $min; + $this->max = $max; + } + + /** + * {@inheritdoc} + */ + protected function finalizeValue($value) + { + $value = parent::finalizeValue($value); + + $errorMsg = null; + if (isset($this->min) && $value < $this->min) { + $errorMsg = sprintf('The value %s is too small for path "%s". Should be greater than or equal to %s', $value, $this->getPath(), $this->min); + } + if (isset($this->max) && $value > $this->max) { + $errorMsg = sprintf('The value %s is too big for path "%s". Should be less than or equal to %s', $value, $this->getPath(), $this->max); + } + if (isset($errorMsg)) { + $ex = new InvalidConfigurationException($errorMsg); + $ex->setPath($this->getPath()); + throw $ex; + } + + return $value; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php new file mode 100644 index 0000000..025e693 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +/** + * This class is the entry point for config normalization/merging/finalization. + * + * @author Johannes M. Schmitt + */ +class Processor +{ + /** + * Processes an array of configurations. + * + * @param NodeInterface $configTree The node tree describing the configuration + * @param array $configs An array of configuration items to process + * + * @return array The processed configuration + */ + public function process(NodeInterface $configTree, array $configs) + { + $currentConfig = array(); + foreach ($configs as $config) { + $config = $configTree->normalize($config); + $currentConfig = $configTree->merge($currentConfig, $config); + } + + return $configTree->finalize($currentConfig); + } + + /** + * Processes an array of configurations. + * + * @param ConfigurationInterface $configuration The configuration class + * @param array $configs An array of configuration items to process + * + * @return array The processed configuration + */ + public function processConfiguration(ConfigurationInterface $configuration, array $configs) + { + return $this->process($configuration->getConfigTreeBuilder()->buildTree(), $configs); + } + + /** + * Normalizes a configuration entry. + * + * This method returns a normalize configuration array for a given key + * to remove the differences due to the original format (YAML and XML mainly). + * + * Here is an example. + * + * The configuration in XML: + * + * twig.extension.foo + * twig.extension.bar + * + * And the same configuration in YAML: + * + * extensions: ['twig.extension.foo', 'twig.extension.bar'] + * + * @param array $config A config array + * @param string $key The key to normalize + * @param string $plural The plural form of the key if it is irregular + * + * @return array + */ + public static function normalizeConfig($config, $key, $plural = null) + { + if (null === $plural) { + $plural = $key.'s'; + } + + if (isset($config[$plural])) { + return $config[$plural]; + } + + if (isset($config[$key])) { + if (is_string($config[$key]) || !is_int(key($config[$key]))) { + // only one + return array($config[$key]); + } + + return $config[$key]; + } + + return array(); + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/PrototypeNodeInterface.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/PrototypeNodeInterface.php new file mode 100644 index 0000000..8bbb84d --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/PrototypeNodeInterface.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +/** + * This interface must be implemented by nodes which can be used as prototypes. + * + * @author Johannes M. Schmitt + */ +interface PrototypeNodeInterface extends NodeInterface +{ + /** + * Sets the name of the node. + * + * @param string $name The name of the node + */ + public function setName($name); +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/PrototypedArrayNode.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/PrototypedArrayNode.php new file mode 100644 index 0000000..a05faec --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/PrototypedArrayNode.php @@ -0,0 +1,345 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; +use Symfony\Component\Config\Definition\Exception\DuplicateKeyException; +use Symfony\Component\Config\Definition\Exception\UnsetKeyException; +use Symfony\Component\Config\Definition\Exception\Exception; + +/** + * Represents a prototyped Array node in the config tree. + * + * @author Johannes M. Schmitt + */ +class PrototypedArrayNode extends ArrayNode +{ + protected $prototype; + protected $keyAttribute; + protected $removeKeyAttribute; + protected $minNumberOfElements; + protected $defaultValue; + protected $defaultChildren; + + /** + * Constructor. + * + * @param string $name The Node's name + * @param NodeInterface $parent The node parent + */ + public function __construct($name, NodeInterface $parent = null) + { + parent::__construct($name, $parent); + + $this->minNumberOfElements = 0; + $this->defaultValue = array(); + } + + /** + * Sets the minimum number of elements that a prototype based node must + * contain. By default this is zero, meaning no elements. + * + * @param int $number + */ + public function setMinNumberOfElements($number) + { + $this->minNumberOfElements = $number; + } + + /** + * Sets the attribute which value is to be used as key. + * + * This is useful when you have an indexed array that should be an + * associative array. You can select an item from within the array + * to be the key of the particular item. For example, if "id" is the + * "key", then: + * + * array( + * array('id' => 'my_name', 'foo' => 'bar'), + * ); + * + * becomes + * + * array( + * 'my_name' => array('foo' => 'bar'), + * ); + * + * If you'd like "'id' => 'my_name'" to still be present in the resulting + * array, then you can set the second argument of this method to false. + * + * @param string $attribute The name of the attribute which value is to be used as a key + * @param bool $remove Whether or not to remove the key + */ + public function setKeyAttribute($attribute, $remove = true) + { + $this->keyAttribute = $attribute; + $this->removeKeyAttribute = $remove; + } + + /** + * Retrieves the name of the attribute which value should be used as key. + * + * @return string The name of the attribute + */ + public function getKeyAttribute() + { + return $this->keyAttribute; + } + + /** + * Sets the default value of this node. + * + * @param string $value + * + * @throws \InvalidArgumentException if the default value is not an array + */ + public function setDefaultValue($value) + { + if (!is_array($value)) { + throw new \InvalidArgumentException($this->getPath().': the default value of an array node has to be an array.'); + } + + $this->defaultValue = $value; + } + + /** + * Checks if the node has a default value. + * + * @return bool + */ + public function hasDefaultValue() + { + return true; + } + + /** + * Adds default children when none are set. + * + * @param int|string|array|null $children The number of children|The child name|The children names to be added + */ + public function setAddChildrenIfNoneSet($children = array('defaults')) + { + if (null === $children) { + $this->defaultChildren = array('defaults'); + } else { + $this->defaultChildren = is_integer($children) && $children > 0 ? range(1, $children) : (array) $children; + } + } + + /** + * Retrieves the default value. + * + * The default value could be either explicited or derived from the prototype + * default value. + * + * @return array The default value + */ + public function getDefaultValue() + { + if (null !== $this->defaultChildren) { + $default = $this->prototype->hasDefaultValue() ? $this->prototype->getDefaultValue() : array(); + $defaults = array(); + foreach (array_values($this->defaultChildren) as $i => $name) { + $defaults[null === $this->keyAttribute ? $i : $name] = $default; + } + + return $defaults; + } + + return $this->defaultValue; + } + + /** + * Sets the node prototype. + * + * @param PrototypeNodeInterface $node + */ + public function setPrototype(PrototypeNodeInterface $node) + { + $this->prototype = $node; + } + + /** + * Retrieves the prototype + * + * @return PrototypeNodeInterface The prototype + */ + public function getPrototype() + { + return $this->prototype; + } + + /** + * Disable adding concrete children for prototyped nodes. + * + * @param NodeInterface $node The child node to add + * + * @throws Exception + */ + public function addChild(NodeInterface $node) + { + throw new Exception('A prototyped array node can not have concrete children.'); + } + + /** + * Finalizes the value of this node. + * + * @param mixed $value + * + * @return mixed The finalized value + * + * @throws UnsetKeyException + * @throws InvalidConfigurationException if the node doesn't have enough children + */ + protected function finalizeValue($value) + { + if (false === $value) { + $msg = sprintf('Unsetting key for path "%s", value: %s', $this->getPath(), json_encode($value)); + throw new UnsetKeyException($msg); + } + + foreach ($value as $k => $v) { + $this->prototype->setName($k); + try { + $value[$k] = $this->prototype->finalize($v); + } catch (UnsetKeyException $unset) { + unset($value[$k]); + } + } + + if (count($value) < $this->minNumberOfElements) { + $msg = sprintf('The path "%s" should have at least %d element(s) defined.', $this->getPath(), $this->minNumberOfElements); + $ex = new InvalidConfigurationException($msg); + $ex->setPath($this->getPath()); + + throw $ex; + } + + return $value; + } + + /** + * Normalizes the value. + * + * @param mixed $value The value to normalize + * + * @return mixed The normalized value + * + * @throws InvalidConfigurationException + * @throws DuplicateKeyException + */ + protected function normalizeValue($value) + { + if (false === $value) { + return $value; + } + + $value = $this->remapXml($value); + + $isAssoc = array_keys($value) !== range(0, count($value) -1); + $normalized = array(); + foreach ($value as $k => $v) { + if (null !== $this->keyAttribute && is_array($v)) { + if (!isset($v[$this->keyAttribute]) && is_int($k) && !$isAssoc) { + $msg = sprintf('The attribute "%s" must be set for path "%s".', $this->keyAttribute, $this->getPath()); + $ex = new InvalidConfigurationException($msg); + $ex->setPath($this->getPath()); + + throw $ex; + } elseif (isset($v[$this->keyAttribute])) { + $k = $v[$this->keyAttribute]; + + // remove the key attribute when required + if ($this->removeKeyAttribute) { + unset($v[$this->keyAttribute]); + } + + // if only "value" is left + if (1 == count($v) && isset($v['value'])) { + $v = $v['value']; + } + } + + if (array_key_exists($k, $normalized)) { + $msg = sprintf('Duplicate key "%s" for path "%s".', $k, $this->getPath()); + $ex = new DuplicateKeyException($msg); + $ex->setPath($this->getPath()); + + throw $ex; + } + } + + $this->prototype->setName($k); + if (null !== $this->keyAttribute || $isAssoc) { + $normalized[$k] = $this->prototype->normalize($v); + } else { + $normalized[] = $this->prototype->normalize($v); + } + } + + return $normalized; + } + + /** + * Merges values together. + * + * @param mixed $leftSide The left side to merge. + * @param mixed $rightSide The right side to merge. + * + * @return mixed The merged values + * + * @throws InvalidConfigurationException + * @throws \RuntimeException + */ + protected function mergeValues($leftSide, $rightSide) + { + if (false === $rightSide) { + // if this is still false after the last config has been merged the + // finalization pass will take care of removing this key entirely + return false; + } + + if (false === $leftSide || !$this->performDeepMerging) { + return $rightSide; + } + + foreach ($rightSide as $k => $v) { + // prototype, and key is irrelevant, so simply append the element + if (null === $this->keyAttribute) { + $leftSide[] = $v; + continue; + } + + // no conflict + if (!array_key_exists($k, $leftSide)) { + if (!$this->allowNewKeys) { + $ex = new InvalidConfigurationException(sprintf( + 'You are not allowed to define new elements for path "%s". '. + 'Please define all elements for this path in one config file.', + $this->getPath() + )); + $ex->setPath($this->getPath()); + + throw $ex; + } + + $leftSide[$k] = $v; + continue; + } + + $this->prototype->setName($k); + $leftSide[$k] = $this->prototype->merge($leftSide[$k], $v); + } + + return $leftSide; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ReferenceDumper.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ReferenceDumper.php new file mode 100644 index 0000000..f1a0a7b --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ReferenceDumper.php @@ -0,0 +1,193 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +/** + * Dumps a reference configuration for the given configuration/node instance. + * + * Currently, only YML format is supported. + * + * @author Kevin Bond + */ +class ReferenceDumper +{ + private $reference; + + public function dump(ConfigurationInterface $configuration) + { + return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree()); + } + + public function dumpNode(NodeInterface $node) + { + $this->reference = ''; + $this->writeNode($node); + $ref = $this->reference; + $this->reference = null; + + return $ref; + } + + /** + * @param NodeInterface $node + * @param int $depth + */ + private function writeNode(NodeInterface $node, $depth = 0) + { + $comments = array(); + $default = ''; + $defaultArray = null; + $children = null; + $example = $node->getExample(); + + // defaults + if ($node instanceof ArrayNode) { + $children = $node->getChildren(); + + if ($node instanceof PrototypedArrayNode) { + $prototype = $node->getPrototype(); + + if ($prototype instanceof ArrayNode) { + $children = $prototype->getChildren(); + } + + // check for attribute as key + if ($key = $node->getKeyAttribute()) { + $keyNode = new ArrayNode($key, $node); + $keyNode->setInfo('Prototype'); + + // add children + foreach ($children as $childNode) { + $keyNode->addChild($childNode); + } + $children = array($key => $keyNode); + } + } + + if (!$children) { + if ($node->hasDefaultValue() && count($defaultArray = $node->getDefaultValue())) { + $default = ''; + } elseif (!is_array($example)) { + $default = '[]'; + } + } + } else { + $default = '~'; + + if ($node->hasDefaultValue()) { + $default = $node->getDefaultValue(); + + if (true === $default) { + $default = 'true'; + } elseif (false === $default) { + $default = 'false'; + } elseif (null === $default) { + $default = '~'; + } elseif (is_array($default)) { + if ($node->hasDefaultValue() && count($defaultArray = $node->getDefaultValue())) { + $default = ''; + } elseif (!is_array($example)) { + $default = '[]'; + } + } + } + } + + // required? + if ($node->isRequired()) { + $comments[] = 'Required'; + } + + // example + if ($example && !is_array($example)) { + $comments[] = 'Example: '.$example; + } + + $default = (string) $default != '' ? ' '.$default : ''; + $comments = count($comments) ? '# '.implode(', ', $comments) : ''; + + $text = rtrim(sprintf('%-20s %s %s', $node->getName().':', $default, $comments), ' '); + + if ($info = $node->getInfo()) { + $this->writeLine(''); + // indenting multi-line info + $info = str_replace("\n", sprintf("\n%".($depth * 4)."s# ", ' '), $info); + $this->writeLine('# '.$info, $depth * 4); + } + + $this->writeLine($text, $depth * 4); + + // output defaults + if ($defaultArray) { + $this->writeLine(''); + + $message = count($defaultArray) > 1 ? 'Defaults' : 'Default'; + + $this->writeLine('# '.$message.':', $depth * 4 + 4); + + $this->writeArray($defaultArray, $depth + 1); + } + + if (is_array($example)) { + $this->writeLine(''); + + $message = count($example) > 1 ? 'Examples' : 'Example'; + + $this->writeLine('# '.$message.':', $depth * 4 + 4); + + $this->writeArray($example, $depth + 1); + } + + if ($children) { + foreach ($children as $childNode) { + $this->writeNode($childNode, $depth + 1); + } + } + } + + /** + * Outputs a single config reference line + * + * @param string $text + * @param int $indent + */ + private function writeLine($text, $indent = 0) + { + $indent = strlen($text) + $indent; + $format = '%'.$indent.'s'; + + $this->reference .= sprintf($format, $text)."\n"; + } + + private function writeArray(array $array, $depth) + { + $isIndexed = array_values($array) === $array; + + foreach ($array as $key => $value) { + if (is_array($value)) { + $val = ''; + } else { + $val = $value; + } + + if ($isIndexed) { + $this->writeLine('- '.$val, $depth * 4); + } else { + $this->writeLine(sprintf('%-20s %s', $key.':', $val), $depth * 4); + } + + if (is_array($value)) { + $this->writeArray($value, $depth + 1); + } + } + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ScalarNode.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ScalarNode.php new file mode 100644 index 0000000..44ccfc5 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/ScalarNode.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +use Symfony\Component\Config\Definition\Exception\InvalidTypeException; + +/** + * This node represents a scalar value in the config tree. + * + * The following values are considered scalars: + * * booleans + * * strings + * * null + * * integers + * * floats + * + * @author Johannes M. Schmitt + */ +class ScalarNode extends VariableNode +{ + /** + * {@inheritdoc} + */ + protected function validateType($value) + { + if (!is_scalar($value) && null !== $value) { + $ex = new InvalidTypeException(sprintf( + 'Invalid type for path "%s". Expected scalar, but got %s.', + $this->getPath(), + gettype($value) + )); + $ex->setPath($this->getPath()); + + throw $ex; + } + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/VariableNode.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/VariableNode.php new file mode 100644 index 0000000..6d89e49 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Definition/VariableNode.php @@ -0,0 +1,114 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; + +/** + * This node represents a value of variable type in the config tree. + * + * This node is intended for values of arbitrary type. + * Any PHP type is accepted as a value. + * + * @author Jeremy Mikola + */ +class VariableNode extends BaseNode implements PrototypeNodeInterface +{ + protected $defaultValueSet = false; + protected $defaultValue; + protected $allowEmptyValue = true; + + /** + * {@inheritdoc} + */ + public function setDefaultValue($value) + { + $this->defaultValueSet = true; + $this->defaultValue = $value; + } + + /** + * {@inheritdoc} + */ + public function hasDefaultValue() + { + return $this->defaultValueSet; + } + + /** + * {@inheritdoc} + */ + public function getDefaultValue() + { + return $this->defaultValue instanceof \Closure ? call_user_func($this->defaultValue) : $this->defaultValue; + } + + /** + * Sets if this node is allowed to have an empty value. + * + * @param bool $boolean True if this entity will accept empty values. + */ + public function setAllowEmptyValue($boolean) + { + $this->allowEmptyValue = (bool) $boolean; + } + + /** + * {@inheritdoc} + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * {@inheritdoc} + */ + protected function validateType($value) + { + } + + /** + * {@inheritdoc} + */ + protected function finalizeValue($value) + { + if (!$this->allowEmptyValue && empty($value)) { + $ex = new InvalidConfigurationException(sprintf( + 'The path "%s" cannot contain an empty value, but got %s.', + $this->getPath(), + json_encode($value) + )); + $ex->setPath($this->getPath()); + + throw $ex; + } + + return $value; + } + + /** + * {@inheritdoc} + */ + protected function normalizeValue($value) + { + return $value; + } + + /** + * {@inheritdoc} + */ + protected function mergeValues($leftSide, $rightSide) + { + return $rightSide; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php new file mode 100644 index 0000000..b1ad442 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Exception; + +/** + * Exception class for when a circular reference is detected when importing resources. + * + * @author Fabien Potencier + */ +class FileLoaderImportCircularReferenceException extends FileLoaderLoadException +{ + public function __construct(array $resources, $code = null, $previous = null) + { + $message = sprintf('Circular reference detected in "%s" ("%s" > "%s").', $this->varToString($resources[0]), implode('" > "', $resources), $resources[0]); + + call_user_func('Exception::__construct', $message, $code, $previous); + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Exception/FileLoaderLoadException.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Exception/FileLoaderLoadException.php new file mode 100644 index 0000000..d05cf8f --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Exception/FileLoaderLoadException.php @@ -0,0 +1,81 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Exception; + +/** + * Exception class for when a resource cannot be loaded or imported. + * + * @author Ryan Weaver + */ +class FileLoaderLoadException extends \Exception +{ + /** + * @param string $resource The resource that could not be imported + * @param string $sourceResource The original resource importing the new resource + * @param int $code The error code + * @param \Exception $previous A previous exception + */ + public function __construct($resource, $sourceResource = null, $code = null, $previous = null) + { + if (null === $sourceResource) { + $message = sprintf('Cannot load resource "%s".', $this->varToString($resource)); + } else { + $message = sprintf('Cannot import resource "%s" from "%s".', $this->varToString($resource), $this->varToString($sourceResource)); + } + + // Is the resource located inside a bundle? + if ('@' === $resource[0]) { + $parts = explode(DIRECTORY_SEPARATOR, $resource); + $bundle = substr($parts[0], 1); + $message .= ' '.sprintf('Make sure the "%s" bundle is correctly registered and loaded in the application kernel class.', $bundle); + } elseif ($previous) { + // include the previous exception, to help the user see what might be the underlying cause + $message .= ' '.sprintf('(%s)', $previous->getMessage()); + } + + parent::__construct($message, $code, $previous); + } + + protected function varToString($var) + { + if (is_object($var)) { + return sprintf('Object(%s)', get_class($var)); + } + + if (is_array($var)) { + $a = array(); + foreach ($var as $k => $v) { + $a[] = sprintf('%s => %s', $k, $this->varToString($v)); + } + + return sprintf("Array(%s)", implode(', ', $a)); + } + + if (is_resource($var)) { + return sprintf('Resource(%s)', get_resource_type($var)); + } + + if (null === $var) { + return 'null'; + } + + if (false === $var) { + return 'false'; + } + + if (true === $var) { + return 'true'; + } + + return (string) $var; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/FileLocator.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/FileLocator.php new file mode 100644 index 0000000..0da2ad6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/FileLocator.php @@ -0,0 +1,99 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config; + +/** + * FileLocator uses an array of pre-defined paths to find files. + * + * @author Fabien Potencier + */ +class FileLocator implements FileLocatorInterface +{ + protected $paths; + + /** + * Constructor. + * + * @param string|array $paths A path or an array of paths where to look for resources + */ + public function __construct($paths = array()) + { + $this->paths = (array) $paths; + } + + /** + * Returns a full path for a given file name. + * + * @param mixed $name The file name to locate + * @param string $currentPath The current path + * @param bool $first Whether to return the first occurrence or an array of filenames + * + * @return string|array The full path to the file|An array of file paths + * + * @throws \InvalidArgumentException When file is not found + */ + public function locate($name, $currentPath = null, $first = true) + { + if ($this->isAbsolutePath($name)) { + if (!file_exists($name)) { + throw new \InvalidArgumentException(sprintf('The file "%s" does not exist.', $name)); + } + + return $name; + } + + $filepaths = array(); + if (null !== $currentPath && file_exists($file = $currentPath.DIRECTORY_SEPARATOR.$name)) { + if (true === $first) { + return $file; + } + $filepaths[] = $file; + } + + foreach ($this->paths as $path) { + if (file_exists($file = $path.DIRECTORY_SEPARATOR.$name)) { + if (true === $first) { + return $file; + } + $filepaths[] = $file; + } + } + + if (!$filepaths) { + throw new \InvalidArgumentException(sprintf('The file "%s" does not exist (in: %s%s).', $name, null !== $currentPath ? $currentPath.', ' : '', implode(', ', $this->paths))); + } + + return array_values(array_unique($filepaths)); + } + + /** + * Returns whether the file path is an absolute path. + * + * @param string $file A file path + * + * @return bool + */ + private function isAbsolutePath($file) + { + if ($file[0] == '/' || $file[0] == '\\' + || (strlen($file) > 3 && ctype_alpha($file[0]) + && $file[1] == ':' + && ($file[2] == '\\' || $file[2] == '/') + ) + || null !== parse_url($file, PHP_URL_SCHEME) + ) { + return true; + } + + return false; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/FileLocatorInterface.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/FileLocatorInterface.php new file mode 100644 index 0000000..4287e3d --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/FileLocatorInterface.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config; + +/** + * @author Fabien Potencier + */ +interface FileLocatorInterface +{ + /** + * Returns a full path for a given file name. + * + * @param mixed $name The file name to locate + * @param string $currentPath The current path + * @param bool $first Whether to return the first occurrence or an array of filenames + * + * @return string|array The full path to the file|An array of file paths + * + * @throws \InvalidArgumentException When file is not found + */ + public function locate($name, $currentPath = null, $first = true); +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/LICENSE b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/LICENSE new file mode 100644 index 0000000..0b3292c --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2014 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/DelegatingLoader.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/DelegatingLoader.php new file mode 100644 index 0000000..fa81311 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/DelegatingLoader.php @@ -0,0 +1,62 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Loader; + +use Symfony\Component\Config\Exception\FileLoaderLoadException; + +/** + * DelegatingLoader delegates loading to other loaders using a loader resolver. + * + * This loader acts as an array of LoaderInterface objects - each having + * a chance to load a given resource (handled by the resolver) + * + * @author Fabien Potencier + */ +class DelegatingLoader extends Loader +{ + /** + * Constructor. + * + * @param LoaderResolverInterface $resolver A LoaderResolverInterface instance + */ + public function __construct(LoaderResolverInterface $resolver) + { + $this->resolver = $resolver; + } + + /** + * Loads a resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return mixed + * + * @throws FileLoaderLoadException if no loader is found. + */ + public function load($resource, $type = null) + { + if (false === $loader = $this->resolver->resolve($resource, $type)) { + throw new FileLoaderLoadException($resource); + } + + return $loader->load($resource, $type); + } + + /** + * {@inheritdoc} + */ + public function supports($resource, $type = null) + { + return false !== $this->resolver->resolve($resource, $type); + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/FileLoader.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/FileLoader.php new file mode 100644 index 0000000..981d16f --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/FileLoader.php @@ -0,0 +1,108 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Loader; + +use Symfony\Component\Config\FileLocatorInterface; +use Symfony\Component\Config\Exception\FileLoaderLoadException; +use Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException; + +/** + * FileLoader is the abstract class used by all built-in loaders that are file based. + * + * @author Fabien Potencier + */ +abstract class FileLoader extends Loader +{ + protected static $loading = array(); + + protected $locator; + + private $currentDir; + + /** + * Constructor. + * + * @param FileLocatorInterface $locator A FileLocatorInterface instance + */ + public function __construct(FileLocatorInterface $locator) + { + $this->locator = $locator; + } + + public function setCurrentDir($dir) + { + $this->currentDir = $dir; + } + + public function getLocator() + { + return $this->locator; + } + + /** + * Imports a resource. + * + * @param mixed $resource A Resource + * @param string $type The resource type + * @param bool $ignoreErrors Whether to ignore import errors or not + * @param string $sourceResource The original resource importing the new resource + * + * @return mixed + * + * @throws FileLoaderLoadException + * @throws FileLoaderImportCircularReferenceException + */ + public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null) + { + try { + $loader = $this->resolve($resource, $type); + + if ($loader instanceof FileLoader && null !== $this->currentDir) { + // we fallback to the current locator to keep BC + // as some some loaders do not call the parent __construct() + // @deprecated should be removed in 3.0 + $locator = $loader->getLocator() ?: $this->locator; + $resource = $locator->locate($resource, $this->currentDir, false); + } + + $resources = is_array($resource) ? $resource : array($resource); + for ($i = 0; $i < $resourcesCount = count($resources); $i++ ) { + if (isset(self::$loading[$resources[$i]])) { + if ($i == $resourcesCount-1) { + throw new FileLoaderImportCircularReferenceException(array_keys(self::$loading)); + } + } else { + $resource = $resources[$i]; + break; + } + } + self::$loading[$resource] = true; + + $ret = $loader->load($resource, $type); + + unset(self::$loading[$resource]); + + return $ret; + } catch (FileLoaderImportCircularReferenceException $e) { + throw $e; + } catch (\Exception $e) { + if (!$ignoreErrors) { + // prevent embedded imports from nesting multiple exceptions + if ($e instanceof FileLoaderLoadException) { + throw $e; + } + + throw new FileLoaderLoadException($resource, $sourceResource, null, $e); + } + } + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/Loader.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/Loader.php new file mode 100644 index 0000000..705a6a7 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/Loader.php @@ -0,0 +1,82 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Loader; + +use Symfony\Component\Config\Exception\FileLoaderLoadException; + +/** + * Loader is the abstract class used by all built-in loaders. + * + * @author Fabien Potencier + */ +abstract class Loader implements LoaderInterface +{ + protected $resolver; + + /** + * Gets the loader resolver. + * + * @return LoaderResolverInterface A LoaderResolverInterface instance + */ + public function getResolver() + { + return $this->resolver; + } + + /** + * Sets the loader resolver. + * + * @param LoaderResolverInterface $resolver A LoaderResolverInterface instance + */ + public function setResolver(LoaderResolverInterface $resolver) + { + $this->resolver = $resolver; + } + + /** + * Imports a resource. + * + * @param mixed $resource A Resource + * @param string $type The resource type + * + * @return mixed + */ + public function import($resource, $type = null) + { + return $this->resolve($resource, $type)->load($resource, $type); + } + + /** + * Finds a loader able to load an imported resource. + * + * @param mixed $resource A Resource + * @param string $type The resource type + * + * @return LoaderInterface A LoaderInterface instance + * + * @throws FileLoaderLoadException if no loader is found + */ + public function resolve($resource, $type = null) + { + if ($this->supports($resource, $type)) { + return $this; + } + + $loader = null === $this->resolver ? false : $this->resolver->resolve($resource, $type); + + if (false === $loader) { + throw new FileLoaderLoadException($resource); + } + + return $loader; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderInterface.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderInterface.php new file mode 100644 index 0000000..52d5981 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderInterface.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Loader; + +/** + * LoaderInterface is the interface implemented by all loader classes. + * + * @author Fabien Potencier + */ +interface LoaderInterface +{ + /** + * Loads a resource. + * + * @param mixed $resource The resource + * @param string $type The resource type + */ + public function load($resource, $type = null); + + /** + * Returns true if this class supports the given resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return bool true if this class supports the given resource, false otherwise + */ + public function supports($resource, $type = null); + + /** + * Gets the loader resolver. + * + * @return LoaderResolverInterface A LoaderResolverInterface instance + */ + public function getResolver(); + + /** + * Sets the loader resolver. + * + * @param LoaderResolverInterface $resolver A LoaderResolverInterface instance + */ + public function setResolver(LoaderResolverInterface $resolver); +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderResolver.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderResolver.php new file mode 100644 index 0000000..2340fe0 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderResolver.php @@ -0,0 +1,81 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Loader; + +/** + * LoaderResolver selects a loader for a given resource. + * + * A resource can be anything (e.g. a full path to a config file or a Closure). + * Each loader determines whether it can load a resource and how. + * + * @author Fabien Potencier + */ +class LoaderResolver implements LoaderResolverInterface +{ + /** + * @var LoaderInterface[] An array of LoaderInterface objects + */ + private $loaders; + + /** + * Constructor. + * + * @param LoaderInterface[] $loaders An array of loaders + */ + public function __construct(array $loaders = array()) + { + $this->loaders = array(); + foreach ($loaders as $loader) { + $this->addLoader($loader); + } + } + + /** + * Returns a loader able to load the resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return LoaderInterface|false A LoaderInterface instance + */ + public function resolve($resource, $type = null) + { + foreach ($this->loaders as $loader) { + if ($loader->supports($resource, $type)) { + return $loader; + } + } + + return false; + } + + /** + * Adds a loader. + * + * @param LoaderInterface $loader A LoaderInterface instance + */ + public function addLoader(LoaderInterface $loader) + { + $this->loaders[] = $loader; + $loader->setResolver($this); + } + + /** + * Returns the registered loaders. + * + * @return LoaderInterface[] An array of LoaderInterface instances + */ + public function getLoaders() + { + return $this->loaders; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderResolverInterface.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderResolverInterface.php new file mode 100644 index 0000000..57d8781 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderResolverInterface.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Loader; + +/** + * LoaderResolverInterface selects a loader for a given resource. + * + * @author Fabien Potencier + */ +interface LoaderResolverInterface +{ + /** + * Returns a loader able to load the resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return LoaderInterface A LoaderInterface instance + */ + public function resolve($resource, $type = null); +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Resource/DirectoryResource.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Resource/DirectoryResource.php new file mode 100644 index 0000000..a9e4d76 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Resource/DirectoryResource.php @@ -0,0 +1,102 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Resource; + +/** + * DirectoryResource represents a resources stored in a subdirectory tree. + * + * @author Fabien Potencier + */ +class DirectoryResource implements ResourceInterface, \Serializable +{ + private $resource; + private $pattern; + + /** + * Constructor. + * + * @param string $resource The file path to the resource + * @param string $pattern A pattern to restrict monitored files + */ + public function __construct($resource, $pattern = null) + { + $this->resource = $resource; + $this->pattern = $pattern; + } + + /** + * Returns a string representation of the Resource. + * + * @return string A string representation of the Resource + */ + public function __toString() + { + return (string) $this->resource; + } + + /** + * Returns the resource tied to this Resource. + * + * @return mixed The resource + */ + public function getResource() + { + return $this->resource; + } + + public function getPattern() + { + return $this->pattern; + } + + /** + * Returns true if the resource has not been updated since the given timestamp. + * + * @param int $timestamp The last time the resource was loaded + * + * @return bool true if the resource has not been updated, false otherwise + */ + public function isFresh($timestamp) + { + if (!is_dir($this->resource)) { + return false; + } + + $newestMTime = filemtime($this->resource); + foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->resource), \RecursiveIteratorIterator::SELF_FIRST) as $file) { + // if regex filtering is enabled only check matching files + if ($this->pattern && $file->isFile() && !preg_match($this->pattern, $file->getBasename())) { + continue; + } + + // always monitor directories for changes, except the .. entries + // (otherwise deleted files wouldn't get detected) + if ($file->isDir() && '/..' === substr($file, -3)) { + continue; + } + + $newestMTime = max($file->getMTime(), $newestMTime); + } + + return $newestMTime < $timestamp; + } + + public function serialize() + { + return serialize(array($this->resource, $this->pattern)); + } + + public function unserialize($serialized) + { + list($this->resource, $this->pattern) = unserialize($serialized); + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Resource/FileResource.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Resource/FileResource.php new file mode 100644 index 0000000..5cb4bc7 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Resource/FileResource.php @@ -0,0 +1,80 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Resource; + +/** + * FileResource represents a resource stored on the filesystem. + * + * The resource can be a file or a directory. + * + * @author Fabien Potencier + */ +class FileResource implements ResourceInterface, \Serializable +{ + private $resource; + + /** + * Constructor. + * + * @param string $resource The file path to the resource + */ + public function __construct($resource) + { + $this->resource = realpath($resource); + } + + /** + * Returns a string representation of the Resource. + * + * @return string A string representation of the Resource + */ + public function __toString() + { + return (string) $this->resource; + } + + /** + * Returns the resource tied to this Resource. + * + * @return mixed The resource + */ + public function getResource() + { + return $this->resource; + } + + /** + * Returns true if the resource has not been updated since the given timestamp. + * + * @param int $timestamp The last time the resource was loaded + * + * @return bool true if the resource has not been updated, false otherwise + */ + public function isFresh($timestamp) + { + if (!file_exists($this->resource)) { + return false; + } + + return filemtime($this->resource) < $timestamp; + } + + public function serialize() + { + return serialize($this->resource); + } + + public function unserialize($serialized) + { + $this->resource = unserialize($serialized); + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Resource/ResourceInterface.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Resource/ResourceInterface.php new file mode 100644 index 0000000..c0ea9ed --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Resource/ResourceInterface.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Resource; + +/** + * ResourceInterface is the interface that must be implemented by all Resource classes. + * + * @author Fabien Potencier + */ +interface ResourceInterface +{ + /** + * Returns a string representation of the Resource. + * + * @return string A string representation of the Resource + */ + public function __toString(); + + /** + * Returns true if the resource has not been updated since the given timestamp. + * + * @param int $timestamp The last time the resource was loaded + * + * @return bool true if the resource has not been updated, false otherwise + */ + public function isFresh($timestamp); + + /** + * Returns the resource tied to this Resource. + * + * @return mixed The resource + */ + public function getResource(); +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Util/XmlUtils.php b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Util/XmlUtils.php new file mode 100644 index 0000000..0123417 --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/Util/XmlUtils.php @@ -0,0 +1,229 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Util; + +/** + * XMLUtils is a bunch of utility methods to XML operations. + * + * This class contains static methods only and is not meant to be instantiated. + * + * @author Fabien Potencier + * @author Martin Hasoň + */ +class XmlUtils +{ + /** + * This class should not be instantiated + */ + private function __construct() + { + } + + /** + * Loads an XML file. + * + * @param string $file An XML file path + * @param string|callable $schemaOrCallable An XSD schema file path or callable + * + * @return \DOMDocument + * + * @throws \InvalidArgumentException When loading of XML file returns error + */ + public static function loadFile($file, $schemaOrCallable = null) + { + $content = @file_get_contents($file); + if ('' === trim($content)) { + throw new \InvalidArgumentException(sprintf('File %s does not contain valid XML, it is empty.', $file)); + } + + $internalErrors = libxml_use_internal_errors(true); + $disableEntities = libxml_disable_entity_loader(true); + libxml_clear_errors(); + + $dom = new \DOMDocument(); + $dom->validateOnParse = true; + if (!$dom->loadXML($content, LIBXML_NONET | (defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) { + libxml_disable_entity_loader($disableEntities); + + throw new \InvalidArgumentException(implode("\n", static::getXmlErrors($internalErrors))); + } + + $dom->normalizeDocument(); + + libxml_use_internal_errors($internalErrors); + libxml_disable_entity_loader($disableEntities); + + foreach ($dom->childNodes as $child) { + if ($child->nodeType === XML_DOCUMENT_TYPE_NODE) { + throw new \InvalidArgumentException('Document types are not allowed.'); + } + } + + if (null !== $schemaOrCallable) { + $internalErrors = libxml_use_internal_errors(true); + libxml_clear_errors(); + + $e = null; + if (is_callable($schemaOrCallable)) { + try { + $valid = call_user_func($schemaOrCallable, $dom, $internalErrors); + } catch (\Exception $e) { + $valid = false; + } + } elseif (!is_array($schemaOrCallable) && is_file((string) $schemaOrCallable)) { + $schemaSource = file_get_contents((string) $schemaOrCallable); + $valid = @$dom->schemaValidateSource($schemaSource); + } else { + libxml_use_internal_errors($internalErrors); + + throw new \InvalidArgumentException('The schemaOrCallable argument has to be a valid path to XSD file or callable.'); + } + + if (!$valid) { + $messages = static::getXmlErrors($internalErrors); + if (empty($messages)) { + $messages = array(sprintf('The XML file "%s" is not valid.', $file)); + } + throw new \InvalidArgumentException(implode("\n", $messages), 0, $e); + } + } + + libxml_clear_errors(); + libxml_use_internal_errors($internalErrors); + + return $dom; + } + + /** + * Converts a \DomElement object to a PHP array. + * + * The following rules applies during the conversion: + * + * * Each tag is converted to a key value or an array + * if there is more than one "value" + * + * * The content of a tag is set under a "value" key (bar) + * if the tag also has some nested tags + * + * * The attributes are converted to keys () + * + * * The nested-tags are converted to keys (bar) + * + * @param \DomElement $element A \DomElement instance + * @param bool $checkPrefix Check prefix in an element or an attribute name + * + * @return array A PHP array + */ + public static function convertDomElementToArray(\DomElement $element, $checkPrefix = true) + { + $prefix = (string) $element->prefix; + $empty = true; + $config = array(); + foreach ($element->attributes as $name => $node) { + if ($checkPrefix && !in_array((string) $node->prefix, array('', $prefix), true)) { + continue; + } + $config[$name] = static::phpize($node->value); + $empty = false; + } + + $nodeValue = false; + foreach ($element->childNodes as $node) { + if ($node instanceof \DOMText) { + if ('' !== trim($node->nodeValue)) { + $nodeValue = trim($node->nodeValue); + $empty = false; + } + } elseif ($checkPrefix && $prefix != (string) $node->prefix) { + continue; + } elseif (!$node instanceof \DOMComment) { + $value = static::convertDomElementToArray($node, $checkPrefix); + + $key = $node->localName; + if (isset($config[$key])) { + if (!is_array($config[$key]) || !is_int(key($config[$key]))) { + $config[$key] = array($config[$key]); + } + $config[$key][] = $value; + } else { + $config[$key] = $value; + } + + $empty = false; + } + } + + if (false !== $nodeValue) { + $value = static::phpize($nodeValue); + if (count($config)) { + $config['value'] = $value; + } else { + $config = $value; + } + } + + return !$empty ? $config : null; + } + + /** + * Converts an xml value to a PHP type. + * + * @param mixed $value + * + * @return mixed + */ + public static function phpize($value) + { + $value = (string) $value; + $lowercaseValue = strtolower($value); + + switch (true) { + case 'null' === $lowercaseValue: + return; + case ctype_digit($value): + $raw = $value; + $cast = intval($value); + + return '0' == $value[0] ? octdec($value) : (((string) $raw == (string) $cast) ? $cast : $raw); + case 'true' === $lowercaseValue: + return true; + case 'false' === $lowercaseValue: + return false; + case is_numeric($value): + return '0x' == $value[0].$value[1] ? hexdec($value) : floatval($value); + case preg_match('/^(-|\+)?[0-9]+(\.[0-9]+)?$/', $value): + return floatval($value); + default: + return $value; + } + } + + protected static function getXmlErrors($internalErrors) + { + $errors = array(); + foreach (libxml_get_errors() as $error) { + $errors[] = sprintf('[%s %s] %s (in %s - line %d, column %d)', + LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR', + $error->code, + trim($error->message), + $error->file ? $error->file : 'n/a', + $error->line, + $error->column + ); + } + + libxml_clear_errors(); + libxml_use_internal_errors($internalErrors); + + return $errors; + } +} diff --git a/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/composer.json b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/composer.json new file mode 100644 index 0000000..6e8967c --- /dev/null +++ b/sources/phpBB/vendor/symfony/config/Symfony/Component/Config/composer.json @@ -0,0 +1,32 @@ +{ + "name": "symfony/config", + "type": "library", + "description": "Symfony Config Component", + "keywords": [], + "homepage": "http://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3", + "symfony/filesystem": "~2.3" + }, + "autoload": { + "psr-0": { "Symfony\\Component\\Config\\": "" } + }, + "target-dir": "Symfony/Component/Config", + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Application.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Application.php new file mode 100644 index 0000000..456a100 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Application.php @@ -0,0 +1,1172 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console; + +use Symfony\Component\Console\Descriptor\TextDescriptor; +use Symfony\Component\Console\Descriptor\XmlDescriptor; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Console\Input\ArrayInput; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Output\ConsoleOutput; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Command\HelpCommand; +use Symfony\Component\Console\Command\ListCommand; +use Symfony\Component\Console\Helper\HelperSet; +use Symfony\Component\Console\Helper\FormatterHelper; +use Symfony\Component\Console\Helper\DialogHelper; +use Symfony\Component\Console\Helper\ProgressHelper; +use Symfony\Component\Console\Helper\TableHelper; +use Symfony\Component\Console\Event\ConsoleCommandEvent; +use Symfony\Component\Console\Event\ConsoleExceptionEvent; +use Symfony\Component\Console\Event\ConsoleTerminateEvent; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; + +/** + * An Application is the container for a collection of commands. + * + * It is the main entry point of a Console application. + * + * This class is optimized for a standard CLI environment. + * + * Usage: + * + * $app = new Application('myapp', '1.0 (stable)'); + * $app->add(new SimpleCommand()); + * $app->run(); + * + * @author Fabien Potencier + * + * @api + */ +class Application +{ + private $commands; + private $wantHelps = false; + private $runningCommand; + private $name; + private $version; + private $catchExceptions; + private $autoExit; + private $definition; + private $helperSet; + private $dispatcher; + + /** + * Constructor. + * + * @param string $name The name of the application + * @param string $version The version of the application + * + * @api + */ + public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN') + { + $this->name = $name; + $this->version = $version; + $this->catchExceptions = true; + $this->autoExit = true; + $this->commands = array(); + $this->helperSet = $this->getDefaultHelperSet(); + $this->definition = $this->getDefaultInputDefinition(); + + foreach ($this->getDefaultCommands() as $command) { + $this->add($command); + } + } + + public function setDispatcher(EventDispatcherInterface $dispatcher) + { + $this->dispatcher = $dispatcher; + } + + /** + * Runs the current application. + * + * @param InputInterface $input An Input instance + * @param OutputInterface $output An Output instance + * + * @return int 0 if everything went fine, or an error code + * + * @throws \Exception When doRun returns Exception + * + * @api + */ + public function run(InputInterface $input = null, OutputInterface $output = null) + { + if (null === $input) { + $input = new ArgvInput(); + } + + if (null === $output) { + $output = new ConsoleOutput(); + } + + $this->configureIO($input, $output); + + try { + $exitCode = $this->doRun($input, $output); + } catch (\Exception $e) { + if (!$this->catchExceptions) { + throw $e; + } + + if ($output instanceof ConsoleOutputInterface) { + $this->renderException($e, $output->getErrorOutput()); + } else { + $this->renderException($e, $output); + } + + $exitCode = $e->getCode(); + if (is_numeric($exitCode)) { + $exitCode = (int) $exitCode; + if (0 === $exitCode) { + $exitCode = 1; + } + } else { + $exitCode = 1; + } + } + + if ($this->autoExit) { + if ($exitCode > 255) { + $exitCode = 255; + } + // @codeCoverageIgnoreStart + exit($exitCode); + // @codeCoverageIgnoreEnd + } + + return $exitCode; + } + + /** + * Runs the current application. + * + * @param InputInterface $input An Input instance + * @param OutputInterface $output An Output instance + * + * @return int 0 if everything went fine, or an error code + */ + public function doRun(InputInterface $input, OutputInterface $output) + { + if (true === $input->hasParameterOption(array('--version', '-V'))) { + $output->writeln($this->getLongVersion()); + + return 0; + } + + $name = $this->getCommandName($input); + if (true === $input->hasParameterOption(array('--help', '-h'))) { + if (!$name) { + $name = 'help'; + $input = new ArrayInput(array('command' => 'help')); + } else { + $this->wantHelps = true; + } + } + + if (!$name) { + $name = 'list'; + $input = new ArrayInput(array('command' => 'list')); + } + + // the command name MUST be the first element of the input + $command = $this->find($name); + + $this->runningCommand = $command; + $exitCode = $this->doRunCommand($command, $input, $output); + $this->runningCommand = null; + + return $exitCode; + } + + /** + * Set a helper set to be used with the command. + * + * @param HelperSet $helperSet The helper set + * + * @api + */ + public function setHelperSet(HelperSet $helperSet) + { + $this->helperSet = $helperSet; + } + + /** + * Get the helper set associated with the command. + * + * @return HelperSet The HelperSet instance associated with this command + * + * @api + */ + public function getHelperSet() + { + return $this->helperSet; + } + + /** + * Set an input definition set to be used with this application + * + * @param InputDefinition $definition The input definition + * + * @api + */ + public function setDefinition(InputDefinition $definition) + { + $this->definition = $definition; + } + + /** + * Gets the InputDefinition related to this Application. + * + * @return InputDefinition The InputDefinition instance + */ + public function getDefinition() + { + return $this->definition; + } + + /** + * Gets the help message. + * + * @return string A help message. + */ + public function getHelp() + { + $messages = array( + $this->getLongVersion(), + '', + 'Usage:', + ' [options] command [arguments]', + '', + 'Options:', + ); + + foreach ($this->getDefinition()->getOptions() as $option) { + $messages[] = sprintf(' %-29s %s %s', + '--'.$option->getName().'', + $option->getShortcut() ? '-'.$option->getShortcut().'' : ' ', + $option->getDescription() + ); + } + + return implode(PHP_EOL, $messages); + } + + /** + * Sets whether to catch exceptions or not during commands execution. + * + * @param bool $boolean Whether to catch exceptions or not during commands execution + * + * @api + */ + public function setCatchExceptions($boolean) + { + $this->catchExceptions = (bool) $boolean; + } + + /** + * Sets whether to automatically exit after a command execution or not. + * + * @param bool $boolean Whether to automatically exit after a command execution or not + * + * @api + */ + public function setAutoExit($boolean) + { + $this->autoExit = (bool) $boolean; + } + + /** + * Gets the name of the application. + * + * @return string The application name + * + * @api + */ + public function getName() + { + return $this->name; + } + + /** + * Sets the application name. + * + * @param string $name The application name + * + * @api + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * Gets the application version. + * + * @return string The application version + * + * @api + */ + public function getVersion() + { + return $this->version; + } + + /** + * Sets the application version. + * + * @param string $version The application version + * + * @api + */ + public function setVersion($version) + { + $this->version = $version; + } + + /** + * Returns the long version of the application. + * + * @return string The long application version + * + * @api + */ + public function getLongVersion() + { + if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) { + return sprintf('%s version %s', $this->getName(), $this->getVersion()); + } + + return 'Console Tool'; + } + + /** + * Registers a new command. + * + * @param string $name The command name + * + * @return Command The newly created command + * + * @api + */ + public function register($name) + { + return $this->add(new Command($name)); + } + + /** + * Adds an array of command objects. + * + * @param Command[] $commands An array of commands + * + * @api + */ + public function addCommands(array $commands) + { + foreach ($commands as $command) { + $this->add($command); + } + } + + /** + * Adds a command object. + * + * If a command with the same name already exists, it will be overridden. + * + * @param Command $command A Command object + * + * @return Command The registered command + * + * @api + */ + public function add(Command $command) + { + $command->setApplication($this); + + if (!$command->isEnabled()) { + $command->setApplication(null); + + return; + } + + $this->commands[$command->getName()] = $command; + + foreach ($command->getAliases() as $alias) { + $this->commands[$alias] = $command; + } + + return $command; + } + + /** + * Returns a registered command by name or alias. + * + * @param string $name The command name or alias + * + * @return Command A Command object + * + * @throws \InvalidArgumentException When command name given does not exist + * + * @api + */ + public function get($name) + { + if (!isset($this->commands[$name])) { + throw new \InvalidArgumentException(sprintf('The command "%s" does not exist.', $name)); + } + + $command = $this->commands[$name]; + + if ($this->wantHelps) { + $this->wantHelps = false; + + $helpCommand = $this->get('help'); + $helpCommand->setCommand($command); + + return $helpCommand; + } + + return $command; + } + + /** + * Returns true if the command exists, false otherwise. + * + * @param string $name The command name or alias + * + * @return bool true if the command exists, false otherwise + * + * @api + */ + public function has($name) + { + return isset($this->commands[$name]); + } + + /** + * Returns an array of all unique namespaces used by currently registered commands. + * + * It does not returns the global namespace which always exists. + * + * @return array An array of namespaces + */ + public function getNamespaces() + { + $namespaces = array(); + foreach ($this->commands as $command) { + $namespaces[] = $this->extractNamespace($command->getName()); + + foreach ($command->getAliases() as $alias) { + $namespaces[] = $this->extractNamespace($alias); + } + } + + return array_values(array_unique(array_filter($namespaces))); + } + + /** + * Finds a registered namespace by a name or an abbreviation. + * + * @param string $namespace A namespace or abbreviation to search for + * + * @return string A registered namespace + * + * @throws \InvalidArgumentException When namespace is incorrect or ambiguous + */ + public function findNamespace($namespace) + { + $allNamespaces = $this->getNamespaces(); + $found = ''; + foreach (explode(':', $namespace) as $i => $part) { + // select sub-namespaces matching the current namespace we found + $namespaces = array(); + foreach ($allNamespaces as $n) { + if ('' === $found || 0 === strpos($n, $found)) { + $namespaces[$n] = explode(':', $n); + } + } + + $abbrevs = static::getAbbreviations(array_unique(array_values(array_filter(array_map(function ($p) use ($i) { return isset($p[$i]) ? $p[$i] : ''; }, $namespaces))))); + + if (!isset($abbrevs[$part])) { + $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace); + + if (1 <= $i) { + $part = $found.':'.$part; + } + + if ($alternatives = $this->findAlternativeNamespace($part, $abbrevs)) { + if (1 == count($alternatives)) { + $message .= "\n\nDid you mean this?\n "; + } else { + $message .= "\n\nDid you mean one of these?\n "; + } + + $message .= implode("\n ", $alternatives); + } + + throw new \InvalidArgumentException($message); + } + + // there are multiple matches, but $part is an exact match of one of them so we select it + if (in_array($part, $abbrevs[$part])) { + $abbrevs[$part] = array($part); + } + + if (count($abbrevs[$part]) > 1) { + throw new \InvalidArgumentException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions($abbrevs[$part]))); + } + + $found .= $found ? ':'.$abbrevs[$part][0] : $abbrevs[$part][0]; + } + + return $found; + } + + /** + * Finds a command by name or alias. + * + * Contrary to get, this command tries to find the best + * match if you give it an abbreviation of a name or alias. + * + * @param string $name A command name or a command alias + * + * @return Command A Command instance + * + * @throws \InvalidArgumentException When command name is incorrect or ambiguous + * + * @api + */ + public function find($name) + { + // namespace + $namespace = ''; + $searchName = $name; + if (false !== $pos = strrpos($name, ':')) { + $namespace = $this->findNamespace(substr($name, 0, $pos)); + $searchName = $namespace.substr($name, $pos); + } + + // name + $commands = array(); + foreach ($this->commands as $command) { + $extractedNamespace = $this->extractNamespace($command->getName()); + if ($extractedNamespace === $namespace + || !empty($namespace) && 0 === strpos($extractedNamespace, $namespace) + ) { + $commands[] = $command->getName(); + } + } + + $abbrevs = static::getAbbreviations(array_unique($commands)); + if (isset($abbrevs[$searchName]) && 1 == count($abbrevs[$searchName])) { + return $this->get($abbrevs[$searchName][0]); + } + + if (isset($abbrevs[$searchName]) && in_array($searchName, $abbrevs[$searchName])) { + return $this->get($searchName); + } + + if (isset($abbrevs[$searchName]) && count($abbrevs[$searchName]) > 1) { + $suggestions = $this->getAbbreviationSuggestions($abbrevs[$searchName]); + + throw new \InvalidArgumentException(sprintf('Command "%s" is ambiguous (%s).', $name, $suggestions)); + } + + // aliases + $aliases = array(); + foreach ($this->commands as $command) { + foreach ($command->getAliases() as $alias) { + $extractedNamespace = $this->extractNamespace($alias); + if ($extractedNamespace === $namespace + || !empty($namespace) && 0 === strpos($extractedNamespace, $namespace) + ) { + $aliases[] = $alias; + } + } + } + + $aliases = static::getAbbreviations(array_unique($aliases)); + if (!isset($aliases[$searchName])) { + $message = sprintf('Command "%s" is not defined.', $name); + + if ($alternatives = $this->findAlternativeCommands($searchName, $abbrevs)) { + if (1 == count($alternatives)) { + $message .= "\n\nDid you mean this?\n "; + } else { + $message .= "\n\nDid you mean one of these?\n "; + } + $message .= implode("\n ", $alternatives); + } + + throw new \InvalidArgumentException($message); + } + + if (count($aliases[$searchName]) > 1) { + throw new \InvalidArgumentException(sprintf('Command "%s" is ambiguous (%s).', $name, $this->getAbbreviationSuggestions($aliases[$searchName]))); + } + + return $this->get($aliases[$searchName][0]); + } + + /** + * Gets the commands (registered in the given namespace if provided). + * + * The array keys are the full names and the values the command instances. + * + * @param string $namespace A namespace name + * + * @return Command[] An array of Command instances + * + * @api + */ + public function all($namespace = null) + { + if (null === $namespace) { + return $this->commands; + } + + $commands = array(); + foreach ($this->commands as $name => $command) { + if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) { + $commands[$name] = $command; + } + } + + return $commands; + } + + /** + * Returns an array of possible abbreviations given a set of names. + * + * @param array $names An array of names + * + * @return array An array of abbreviations + */ + public static function getAbbreviations($names) + { + $abbrevs = array(); + foreach ($names as $name) { + for ($len = strlen($name); $len > 0; --$len) { + $abbrev = substr($name, 0, $len); + $abbrevs[$abbrev][] = $name; + } + } + + return $abbrevs; + } + + /** + * Returns a text representation of the Application. + * + * @param string $namespace An optional namespace name + * @param bool $raw Whether to return raw command list + * + * @return string A string representing the Application + * + * @deprecated Deprecated since version 2.3, to be removed in 3.0. + */ + public function asText($namespace = null, $raw = false) + { + $descriptor = new TextDescriptor(); + + return $descriptor->describe($this, array('namespace' => $namespace, 'raw_text' => $raw)); + } + + /** + * Returns an XML representation of the Application. + * + * @param string $namespace An optional namespace name + * @param bool $asDom Whether to return a DOM or an XML string + * + * @return string|\DOMDocument An XML string representing the Application + * + * @deprecated Deprecated since version 2.3, to be removed in 3.0. + */ + public function asXml($namespace = null, $asDom = false) + { + $descriptor = new XmlDescriptor(); + + return $descriptor->describe($this, array('namespace' => $namespace, 'as_dom' => $asDom)); + } + + /** + * Renders a caught exception. + * + * @param \Exception $e An exception instance + * @param OutputInterface $output An OutputInterface instance + */ + public function renderException($e, $output) + { + do { + $title = sprintf(' [%s] ', get_class($e)); + + $len = $this->stringWidth($title); + + $width = $this->getTerminalWidth() ? $this->getTerminalWidth() - 1 : PHP_INT_MAX; + // HHVM only accepts 32 bits integer in str_split, even when PHP_INT_MAX is a 64 bit integer: https://github.com/facebook/hhvm/issues/1327 + if (defined('HHVM_VERSION') && $width > 1 << 31) { + $width = 1 << 31; + } + $formatter = $output->getFormatter(); + $lines = array(); + foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) { + foreach ($this->splitStringByWidth($line, $width - 4) as $line) { + // pre-format lines to get the right string length + $lineLength = $this->stringWidth(preg_replace('/\[[^m]*m/', '', $formatter->format($line))) + 4; + $lines[] = array($line, $lineLength); + + $len = max($lineLength, $len); + } + } + + $messages = array('', ''); + $messages[] = $emptyLine = $formatter->format(sprintf('%s', str_repeat(' ', $len))); + $messages[] = $formatter->format(sprintf('%s%s', $title, str_repeat(' ', max(0, $len - $this->stringWidth($title))))); + foreach ($lines as $line) { + $messages[] = $formatter->format(sprintf(' %s %s', $line[0], str_repeat(' ', $len - $line[1]))); + } + $messages[] = $emptyLine; + $messages[] = ''; + $messages[] = ''; + + $output->writeln($messages, OutputInterface::OUTPUT_RAW); + + if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { + $output->writeln('Exception trace:'); + + // exception related properties + $trace = $e->getTrace(); + array_unshift($trace, array( + 'function' => '', + 'file' => $e->getFile() != null ? $e->getFile() : 'n/a', + 'line' => $e->getLine() != null ? $e->getLine() : 'n/a', + 'args' => array(), + )); + + for ($i = 0, $count = count($trace); $i < $count; $i++) { + $class = isset($trace[$i]['class']) ? $trace[$i]['class'] : ''; + $type = isset($trace[$i]['type']) ? $trace[$i]['type'] : ''; + $function = $trace[$i]['function']; + $file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a'; + $line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a'; + + $output->writeln(sprintf(' %s%s%s() at %s:%s', $class, $type, $function, $file, $line)); + } + + $output->writeln(""); + $output->writeln(""); + } + } while ($e = $e->getPrevious()); + + if (null !== $this->runningCommand) { + $output->writeln(sprintf('%s', sprintf($this->runningCommand->getSynopsis(), $this->getName()))); + $output->writeln(""); + $output->writeln(""); + } + } + + /** + * Tries to figure out the terminal width in which this application runs + * + * @return int|null + */ + protected function getTerminalWidth() + { + $dimensions = $this->getTerminalDimensions(); + + return $dimensions[0]; + } + + /** + * Tries to figure out the terminal height in which this application runs + * + * @return int|null + */ + protected function getTerminalHeight() + { + $dimensions = $this->getTerminalDimensions(); + + return $dimensions[1]; + } + + /** + * Tries to figure out the terminal dimensions based on the current environment + * + * @return array Array containing width and height + */ + public function getTerminalDimensions() + { + if (defined('PHP_WINDOWS_VERSION_BUILD')) { + // extract [w, H] from "wxh (WxH)" + if (preg_match('/^(\d+)x\d+ \(\d+x(\d+)\)$/', trim(getenv('ANSICON')), $matches)) { + return array((int) $matches[1], (int) $matches[2]); + } + // extract [w, h] from "wxh" + if (preg_match('/^(\d+)x(\d+)$/', $this->getConsoleMode(), $matches)) { + return array((int) $matches[1], (int) $matches[2]); + } + } + + if ($sttyString = $this->getSttyColumns()) { + // extract [w, h] from "rows h; columns w;" + if (preg_match('/rows.(\d+);.columns.(\d+);/i', $sttyString, $matches)) { + return array((int) $matches[2], (int) $matches[1]); + } + // extract [w, h] from "; h rows; w columns" + if (preg_match('/;.(\d+).rows;.(\d+).columns/i', $sttyString, $matches)) { + return array((int) $matches[2], (int) $matches[1]); + } + } + + return array(null, null); + } + + /** + * Configures the input and output instances based on the user arguments and options. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + */ + protected function configureIO(InputInterface $input, OutputInterface $output) + { + if (true === $input->hasParameterOption(array('--ansi'))) { + $output->setDecorated(true); + } elseif (true === $input->hasParameterOption(array('--no-ansi'))) { + $output->setDecorated(false); + } + + if (true === $input->hasParameterOption(array('--no-interaction', '-n'))) { + $input->setInteractive(false); + } elseif (function_exists('posix_isatty') && $this->getHelperSet()->has('dialog')) { + $inputStream = $this->getHelperSet()->get('dialog')->getInputStream(); + if (!@posix_isatty($inputStream)) { + $input->setInteractive(false); + } + } + + if (true === $input->hasParameterOption(array('--quiet', '-q'))) { + $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); + } else { + if ($input->hasParameterOption('-vvv') || $input->hasParameterOption('--verbose=3') || $input->getParameterOption('--verbose') === 3) { + $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); + } elseif ($input->hasParameterOption('-vv') || $input->hasParameterOption('--verbose=2') || $input->getParameterOption('--verbose') === 2) { + $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); + } elseif ($input->hasParameterOption('-v') || $input->hasParameterOption('--verbose=1') || $input->hasParameterOption('--verbose') || $input->getParameterOption('--verbose')) { + $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); + } + } + } + + /** + * Runs the current command. + * + * If an event dispatcher has been attached to the application, + * events are also dispatched during the life-cycle of the command. + * + * @param Command $command A Command instance + * @param InputInterface $input An Input instance + * @param OutputInterface $output An Output instance + * + * @return int 0 if everything went fine, or an error code + * + * @throws \Exception when the command being run threw an exception + */ + protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output) + { + if (null === $this->dispatcher) { + return $command->run($input, $output); + } + + $event = new ConsoleCommandEvent($command, $input, $output); + $this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event); + + try { + $exitCode = $command->run($input, $output); + } catch (\Exception $e) { + $event = new ConsoleTerminateEvent($command, $input, $output, $e->getCode()); + $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event); + + $event = new ConsoleExceptionEvent($command, $input, $output, $e, $event->getExitCode()); + $this->dispatcher->dispatch(ConsoleEvents::EXCEPTION, $event); + + throw $event->getException(); + } + + $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode); + $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event); + + return $event->getExitCode(); + } + + /** + * Gets the name of the command based on input. + * + * @param InputInterface $input The input interface + * + * @return string The command name + */ + protected function getCommandName(InputInterface $input) + { + return $input->getFirstArgument(); + } + + /** + * Gets the default input definition. + * + * @return InputDefinition An InputDefinition instance + */ + protected function getDefaultInputDefinition() + { + return new InputDefinition(array( + new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), + + new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.'), + new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message.'), + new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.'), + new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version.'), + new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output.'), + new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output.'), + new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question.'), + )); + } + + /** + * Gets the default commands that should always be available. + * + * @return Command[] An array of default Command instances + */ + protected function getDefaultCommands() + { + return array(new HelpCommand(), new ListCommand()); + } + + /** + * Gets the default helper set with the helpers that should always be available. + * + * @return HelperSet A HelperSet instance + */ + protected function getDefaultHelperSet() + { + return new HelperSet(array( + new FormatterHelper(), + new DialogHelper(), + new ProgressHelper(), + new TableHelper(), + )); + } + + /** + * Runs and parses stty -a if it's available, suppressing any error output + * + * @return string + */ + private function getSttyColumns() + { + if (!function_exists('proc_open')) { + return; + } + + $descriptorspec = array(1 => array('pipe', 'w'), 2 => array('pipe', 'w')); + $process = proc_open('stty -a | grep columns', $descriptorspec, $pipes, null, null, array('suppress_errors' => true)); + if (is_resource($process)) { + $info = stream_get_contents($pipes[1]); + fclose($pipes[1]); + fclose($pipes[2]); + proc_close($process); + + return $info; + } + } + + /** + * Runs and parses mode CON if it's available, suppressing any error output + * + * @return string x or null if it could not be parsed + */ + private function getConsoleMode() + { + if (!function_exists('proc_open')) { + return; + } + + $descriptorspec = array(1 => array('pipe', 'w'), 2 => array('pipe', 'w')); + $process = proc_open('mode CON', $descriptorspec, $pipes, null, null, array('suppress_errors' => true)); + if (is_resource($process)) { + $info = stream_get_contents($pipes[1]); + fclose($pipes[1]); + fclose($pipes[2]); + proc_close($process); + + if (preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) { + return $matches[2].'x'.$matches[1]; + } + } + } + + /** + * Returns abbreviated suggestions in string format. + * + * @param array $abbrevs Abbreviated suggestions to convert + * + * @return string A formatted string of abbreviated suggestions + */ + private function getAbbreviationSuggestions($abbrevs) + { + return sprintf('%s, %s%s', $abbrevs[0], $abbrevs[1], count($abbrevs) > 2 ? sprintf(' and %d more', count($abbrevs) - 2) : ''); + } + + /** + * Returns the namespace part of the command name. + * + * This method is not part of public API and should not be used directly. + * + * @param string $name The full name of the command + * @param string $limit The maximum number of parts of the namespace + * + * @return string The namespace of the command + */ + public function extractNamespace($name, $limit = null) + { + $parts = explode(':', $name); + array_pop($parts); + + return implode(':', null === $limit ? $parts : array_slice($parts, 0, $limit)); + } + + /** + * Finds alternative commands of $name + * + * @param string $name The full name of the command + * @param array $abbrevs The abbreviations + * + * @return array A sorted array of similar commands + */ + private function findAlternativeCommands($name, $abbrevs) + { + $callback = function ($item) { + return $item->getName(); + }; + + return $this->findAlternatives($name, $this->commands, $abbrevs, $callback); + } + + /** + * Finds alternative namespace of $name + * + * @param string $name The full name of the namespace + * @param array $abbrevs The abbreviations + * + * @return array A sorted array of similar namespace + */ + private function findAlternativeNamespace($name, $abbrevs) + { + return $this->findAlternatives($name, $this->getNamespaces(), $abbrevs); + } + + /** + * Finds alternative of $name among $collection, + * if nothing is found in $collection, try in $abbrevs + * + * @param string $name The string + * @param array|\Traversable $collection The collection + * @param array $abbrevs The abbreviations + * @param Closure|string|array $callback The callable to transform collection item before comparison + * + * @return array A sorted array of similar string + */ + private function findAlternatives($name, $collection, $abbrevs, $callback = null) + { + $alternatives = array(); + + foreach ($collection as $item) { + if (null !== $callback) { + $item = call_user_func($callback, $item); + } + + $lev = levenshtein($name, $item); + if ($lev <= strlen($name) / 3 || false !== strpos($item, $name)) { + $alternatives[$item] = $lev; + } + } + + if (!$alternatives) { + foreach ($abbrevs as $key => $values) { + $lev = levenshtein($name, $key); + if ($lev <= strlen($name) / 3 || false !== strpos($key, $name)) { + foreach ($values as $value) { + $alternatives[$value] = $lev; + } + } + } + } + + asort($alternatives); + + return array_keys($alternatives); + } + + private function stringWidth($string) + { + if (!function_exists('mb_strwidth')) { + return strlen($string); + } + + if (false === $encoding = mb_detect_encoding($string)) { + return strlen($string); + } + + return mb_strwidth($string, $encoding); + } + + private function splitStringByWidth($string, $width) + { + // str_split is not suitable for multi-byte characters, we should use preg_split to get char array properly. + // additionally, array_slice() is not enough as some character has doubled width. + // we need a function to split string not by character count but by string width + + if (!function_exists('mb_strwidth')) { + return str_split($string, $width); + } + + if (false === $encoding = mb_detect_encoding($string)) { + return str_split($string, $width); + } + + $utf8String = mb_convert_encoding($string, 'utf8', $encoding); + $lines = array(); + $line = ''; + foreach (preg_split('//u', $utf8String) as $char) { + // test if $char could be appended to current line + if (mb_strwidth($line.$char, 'utf8') <= $width) { + $line .= $char; + continue; + } + // if not, push current line to array and make new line + $lines[] = str_pad($line, $width); + $line = $char; + } + if (strlen($line)) { + $lines[] = count($lines) ? str_pad($line, $width) : $line; + } + + mb_convert_variables($encoding, 'utf8', $lines); + + return $lines; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Command/Command.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Command/Command.php new file mode 100644 index 0000000..41f1bb3 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Command/Command.php @@ -0,0 +1,609 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Command; + +use Symfony\Component\Console\Descriptor\TextDescriptor; +use Symfony\Component\Console\Descriptor\XmlDescriptor; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Helper\HelperSet; + +/** + * Base class for all commands. + * + * @author Fabien Potencier + * + * @api + */ +class Command +{ + private $application; + private $name; + private $aliases; + private $definition; + private $help; + private $description; + private $ignoreValidationErrors; + private $applicationDefinitionMerged; + private $applicationDefinitionMergedWithArgs; + private $code; + private $synopsis; + private $helperSet; + + /** + * Constructor. + * + * @param string $name The name of the command + * + * @throws \LogicException When the command name is empty + * + * @api + */ + public function __construct($name = null) + { + $this->definition = new InputDefinition(); + $this->ignoreValidationErrors = false; + $this->applicationDefinitionMerged = false; + $this->applicationDefinitionMergedWithArgs = false; + $this->aliases = array(); + + if (null !== $name) { + $this->setName($name); + } + + $this->configure(); + + if (!$this->name) { + throw new \LogicException('The command name cannot be empty.'); + } + } + + /** + * Ignores validation errors. + * + * This is mainly useful for the help command. + */ + public function ignoreValidationErrors() + { + $this->ignoreValidationErrors = true; + } + + /** + * Sets the application instance for this command. + * + * @param Application $application An Application instance + * + * @api + */ + public function setApplication(Application $application = null) + { + $this->application = $application; + if ($application) { + $this->setHelperSet($application->getHelperSet()); + } else { + $this->helperSet = null; + } + } + + /** + * Sets the helper set. + * + * @param HelperSet $helperSet A HelperSet instance + */ + public function setHelperSet(HelperSet $helperSet) + { + $this->helperSet = $helperSet; + } + + /** + * Gets the helper set. + * + * @return HelperSet A HelperSet instance + */ + public function getHelperSet() + { + return $this->helperSet; + } + + /** + * Gets the application instance for this command. + * + * @return Application An Application instance + * + * @api + */ + public function getApplication() + { + return $this->application; + } + + /** + * Checks whether the command is enabled or not in the current environment + * + * Override this to check for x or y and return false if the command can not + * run properly under the current conditions. + * + * @return bool + */ + public function isEnabled() + { + return true; + } + + /** + * Configures the current command. + */ + protected function configure() + { + } + + /** + * Executes the current command. + * + * This method is not abstract because you can use this class + * as a concrete class. In this case, instead of defining the + * execute() method, you set the code to execute by passing + * a Closure to the setCode() method. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null|int null or 0 if everything went fine, or an error code + * + * @throws \LogicException When this abstract method is not implemented + * @see setCode() + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + throw new \LogicException('You must override the execute() method in the concrete command class.'); + } + + /** + * Interacts with the user. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + */ + protected function interact(InputInterface $input, OutputInterface $output) + { + } + + /** + * Initializes the command just after the input has been validated. + * + * This is mainly useful when a lot of commands extends one main command + * where some things need to be initialized based on the input arguments and options. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + */ + protected function initialize(InputInterface $input, OutputInterface $output) + { + } + + /** + * Runs the command. + * + * The code to execute is either defined directly with the + * setCode() method or by overriding the execute() method + * in a sub-class. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return int The command exit code + * + * @throws \Exception + * + * @see setCode() + * @see execute() + * + * @api + */ + public function run(InputInterface $input, OutputInterface $output) + { + // force the creation of the synopsis before the merge with the app definition + $this->getSynopsis(); + + // add the application arguments and options + $this->mergeApplicationDefinition(); + + // bind the input against the command specific arguments/options + try { + $input->bind($this->definition); + } catch (\Exception $e) { + if (!$this->ignoreValidationErrors) { + throw $e; + } + } + + $this->initialize($input, $output); + + if ($input->isInteractive()) { + $this->interact($input, $output); + } + + $input->validate(); + + if ($this->code) { + $statusCode = call_user_func($this->code, $input, $output); + } else { + $statusCode = $this->execute($input, $output); + } + + return is_numeric($statusCode) ? (int) $statusCode : 0; + } + + /** + * Sets the code to execute when running this command. + * + * If this method is used, it overrides the code defined + * in the execute() method. + * + * @param callable $code A callable(InputInterface $input, OutputInterface $output) + * + * @return Command The current instance + * + * @throws \InvalidArgumentException + * + * @see execute() + * + * @api + */ + public function setCode($code) + { + if (!is_callable($code)) { + throw new \InvalidArgumentException('Invalid callable provided to Command::setCode.'); + } + + $this->code = $code; + + return $this; + } + + /** + * Merges the application definition with the command definition. + * + * This method is not part of public API and should not be used directly. + * + * @param bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments + */ + public function mergeApplicationDefinition($mergeArgs = true) + { + if (null === $this->application || (true === $this->applicationDefinitionMerged && ($this->applicationDefinitionMergedWithArgs || !$mergeArgs))) { + return; + } + + if ($mergeArgs) { + $currentArguments = $this->definition->getArguments(); + $this->definition->setArguments($this->application->getDefinition()->getArguments()); + $this->definition->addArguments($currentArguments); + } + + $this->definition->addOptions($this->application->getDefinition()->getOptions()); + + $this->applicationDefinitionMerged = true; + if ($mergeArgs) { + $this->applicationDefinitionMergedWithArgs = true; + } + } + + /** + * Sets an array of argument and option instances. + * + * @param array|InputDefinition $definition An array of argument and option instances or a definition instance + * + * @return Command The current instance + * + * @api + */ + public function setDefinition($definition) + { + if ($definition instanceof InputDefinition) { + $this->definition = $definition; + } else { + $this->definition->setDefinition($definition); + } + + $this->applicationDefinitionMerged = false; + + return $this; + } + + /** + * Gets the InputDefinition attached to this Command. + * + * @return InputDefinition An InputDefinition instance + * + * @api + */ + public function getDefinition() + { + return $this->definition; + } + + /** + * Gets the InputDefinition to be used to create XML and Text representations of this Command. + * + * Can be overridden to provide the original command representation when it would otherwise + * be changed by merging with the application InputDefinition. + * + * This method is not part of public API and should not be used directly. + * + * @return InputDefinition An InputDefinition instance + */ + public function getNativeDefinition() + { + return $this->getDefinition(); + } + + /** + * Adds an argument. + * + * @param string $name The argument name + * @param int $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL + * @param string $description A description text + * @param mixed $default The default value (for InputArgument::OPTIONAL mode only) + * + * @return Command The current instance + * + * @api + */ + public function addArgument($name, $mode = null, $description = '', $default = null) + { + $this->definition->addArgument(new InputArgument($name, $mode, $description, $default)); + + return $this; + } + + /** + * Adds an option. + * + * @param string $name The option name + * @param string $shortcut The shortcut (can be null) + * @param int $mode The option mode: One of the InputOption::VALUE_* constants + * @param string $description A description text + * @param mixed $default The default value (must be null for InputOption::VALUE_REQUIRED or InputOption::VALUE_NONE) + * + * @return Command The current instance + * + * @api + */ + public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null) + { + $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default)); + + return $this; + } + + /** + * Sets the name of the command. + * + * This method can set both the namespace and the name if + * you separate them by a colon (:) + * + * $command->setName('foo:bar'); + * + * @param string $name The command name + * + * @return Command The current instance + * + * @throws \InvalidArgumentException When command name given is empty + * + * @api + */ + public function setName($name) + { + $this->validateName($name); + + $this->name = $name; + + return $this; + } + + /** + * Returns the command name. + * + * @return string The command name + * + * @api + */ + public function getName() + { + return $this->name; + } + + /** + * Sets the description for the command. + * + * @param string $description The description for the command + * + * @return Command The current instance + * + * @api + */ + public function setDescription($description) + { + $this->description = $description; + + return $this; + } + + /** + * Returns the description for the command. + * + * @return string The description for the command + * + * @api + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the help for the command. + * + * @param string $help The help for the command + * + * @return Command The current instance + * + * @api + */ + public function setHelp($help) + { + $this->help = $help; + + return $this; + } + + /** + * Returns the help for the command. + * + * @return string The help for the command + * + * @api + */ + public function getHelp() + { + return $this->help; + } + + /** + * Returns the processed help for the command replacing the %command.name% and + * %command.full_name% patterns with the real values dynamically. + * + * @return string The processed help for the command + */ + public function getProcessedHelp() + { + $name = $this->name; + + $placeholders = array( + '%command.name%', + '%command.full_name%', + ); + $replacements = array( + $name, + $_SERVER['PHP_SELF'].' '.$name, + ); + + return str_replace($placeholders, $replacements, $this->getHelp()); + } + + /** + * Sets the aliases for the command. + * + * @param string[] $aliases An array of aliases for the command + * + * @return Command The current instance + * + * @api + */ + public function setAliases($aliases) + { + if (!is_array($aliases) && !$aliases instanceof \Traversable) { + throw new \InvalidArgumentException('$aliases must be an array or an instance of \Traversable'); + } + + foreach ($aliases as $alias) { + $this->validateName($alias); + } + + $this->aliases = $aliases; + + return $this; + } + + /** + * Returns the aliases for the command. + * + * @return array An array of aliases for the command + * + * @api + */ + public function getAliases() + { + return $this->aliases; + } + + /** + * Returns the synopsis for the command. + * + * @return string The synopsis + */ + public function getSynopsis() + { + if (null === $this->synopsis) { + $this->synopsis = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis())); + } + + return $this->synopsis; + } + + /** + * Gets a helper instance by name. + * + * @param string $name The helper name + * + * @return mixed The helper value + * + * @throws \InvalidArgumentException if the helper is not defined + * + * @api + */ + public function getHelper($name) + { + return $this->helperSet->get($name); + } + + /** + * Returns a text representation of the command. + * + * @return string A string representing the command + * + * @deprecated Deprecated since version 2.3, to be removed in 3.0. + */ + public function asText() + { + $descriptor = new TextDescriptor(); + + return $descriptor->describe($this); + } + + /** + * Returns an XML representation of the command. + * + * @param bool $asDom Whether to return a DOM or an XML string + * + * @return string|\DOMDocument An XML string representing the command + * + * @deprecated Deprecated since version 2.3, to be removed in 3.0. + */ + public function asXml($asDom = false) + { + $descriptor = new XmlDescriptor(); + + return $descriptor->describe($this, array('as_dom' => $asDom)); + } + + private function validateName($name) + { + if (!preg_match('/^[^\:]+(\:[^\:]+)*$/', $name)) { + throw new \InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name)); + } + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php new file mode 100644 index 0000000..2aa933e --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Command; + +use Symfony\Component\Console\Helper\DescriptorHelper; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * HelpCommand displays the help for a given command. + * + * @author Fabien Potencier + */ +class HelpCommand extends Command +{ + private $command; + + /** + * {@inheritdoc} + */ + protected function configure() + { + $this->ignoreValidationErrors(); + + $this + ->setName('help') + ->setDefinition(array( + new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), + new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'), + new InputOption('format', null, InputOption::VALUE_REQUIRED, 'To output help in other formats'), + new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), + )) + ->setDescription('Displays help for a command') + ->setHelp(<<%command.name% command displays help for a given command: + + php %command.full_name% list + +You can also output the help in other formats by using the --format option: + + php %command.full_name% --format=xml list + +To display the list of available commands, please use the list command. +EOF + ) + ; + } + + /** + * Sets the command + * + * @param Command $command The command to set + */ + public function setCommand(Command $command) + { + $this->command = $command; + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + if (null === $this->command) { + $this->command = $this->getApplication()->find($input->getArgument('command_name')); + } + + if ($input->getOption('xml')) { + $input->setOption('format', 'xml'); + } + + $helper = new DescriptorHelper(); + $helper->describe($output, $this->command, $input->getOption('format'), $input->getOption('raw')); + $this->command = null; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Command/ListCommand.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Command/ListCommand.php new file mode 100644 index 0000000..f3d7438 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Command/ListCommand.php @@ -0,0 +1,91 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Command; + +use Symfony\Component\Console\Helper\DescriptorHelper; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Input\InputDefinition; + +/** + * ListCommand displays the list of all available commands for the application. + * + * @author Fabien Potencier + */ +class ListCommand extends Command +{ + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('list') + ->setDefinition($this->createDefinition()) + ->setDescription('Lists commands') + ->setHelp(<<%command.name% command lists all commands: + + php %command.full_name% + +You can also display the commands for a specific namespace: + + php %command.full_name% test + +You can also output the information in other formats by using the --format option: + + php %command.full_name% --format=xml + +It's also possible to get raw list of commands (useful for embedding command runner): + + php %command.full_name% --raw +EOF + ) + ; + } + + /** + * {@inheritdoc} + */ + public function getNativeDefinition() + { + return $this->createDefinition(); + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + if ($input->getOption('xml')) { + $input->setOption('format', 'xml'); + } + + $helper = new DescriptorHelper(); + $helper->describe($output, $this->getApplication(), $input->getOption('format'), $input->getOption('raw'), $input->getArgument('namespace')); + } + + /** + * {@inheritdoc} + */ + private function createDefinition() + { + return new InputDefinition(array( + new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), + new InputOption('xml', null, InputOption::VALUE_NONE, 'To output list as XML'), + new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), + new InputOption('format', null, InputOption::VALUE_REQUIRED, 'To output list in other formats'), + )); + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/ConsoleEvents.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/ConsoleEvents.php new file mode 100644 index 0000000..12ede2d --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/ConsoleEvents.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console; + +/** + * Contains all events dispatched by an Application. + * + * @author Francesco Levorato + */ +final class ConsoleEvents +{ + /** + * The COMMAND event allows you to attach listeners before any command is + * executed by the console. It also allows you to modify the command, input and output + * before they are handled to the command. + * + * The event listener method receives a Symfony\Component\Console\Event\ConsoleCommandEvent + * instance. + * + * @var string + */ + const COMMAND = 'console.command'; + + /** + * The TERMINATE event allows you to attach listeners after a command is + * executed by the console. + * + * The event listener method receives a Symfony\Component\Console\Event\ConsoleTerminateEvent + * instance. + * + * @var string + */ + const TERMINATE = 'console.terminate'; + + /** + * The EXCEPTION event occurs when an uncaught exception appears. + * + * This event allows you to deal with the exception or + * to modify the thrown exception. The event listener method receives + * a Symfony\Component\Console\Event\ConsoleExceptionEvent + * instance. + * + * @var string + */ + const EXCEPTION = 'console.exception'; +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/ApplicationDescription.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/ApplicationDescription.php new file mode 100644 index 0000000..cdf1493 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/ApplicationDescription.php @@ -0,0 +1,153 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; + +/** + * @author Jean-François Simon + */ +class ApplicationDescription +{ + const GLOBAL_NAMESPACE = '_global'; + + /** + * @var Application + */ + private $application; + + /** + * @var null|string + */ + private $namespace; + + /** + * @var array + */ + private $namespaces; + + /** + * @var Command[] + */ + private $commands; + + /** + * @var Command[] + */ + private $aliases; + + /** + * Constructor. + * + * @param Application $application + * @param string|null $namespace + */ + public function __construct(Application $application, $namespace = null) + { + $this->application = $application; + $this->namespace = $namespace; + } + + /** + * @return array + */ + public function getNamespaces() + { + if (null === $this->namespaces) { + $this->inspectApplication(); + } + + return $this->namespaces; + } + + /** + * @return Command[] + */ + public function getCommands() + { + if (null === $this->commands) { + $this->inspectApplication(); + } + + return $this->commands; + } + + /** + * @param string $name + * + * @return Command + * + * @throws \InvalidArgumentException + */ + public function getCommand($name) + { + if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) { + throw new \InvalidArgumentException(sprintf('Command %s does not exist.', $name)); + } + + return isset($this->commands[$name]) ? $this->commands[$name] : $this->aliases[$name]; + } + + private function inspectApplication() + { + $this->commands = array(); + $this->namespaces = array(); + + $all = $this->application->all($this->namespace ? $this->application->findNamespace($this->namespace) : null); + foreach ($this->sortCommands($all) as $namespace => $commands) { + $names = array(); + + /** @var Command $command */ + foreach ($commands as $name => $command) { + if (!$command->getName()) { + continue; + } + + if ($command->getName() === $name) { + $this->commands[$name] = $command; + } else { + $this->aliases[$name] = $command; + } + + $names[] = $name; + } + + $this->namespaces[$namespace] = array('id' => $namespace, 'commands' => $names); + } + } + + /** + * @param array $commands + * + * @return array + */ + private function sortCommands(array $commands) + { + $namespacedCommands = array(); + foreach ($commands as $name => $command) { + $key = $this->application->extractNamespace($name, 1); + if (!$key) { + $key = '_global'; + } + + $namespacedCommands[$key][$name] = $command; + } + ksort($namespacedCommands); + + foreach ($namespacedCommands as &$commands) { + ksort($commands); + } + + return $namespacedCommands; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/Descriptor.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/Descriptor.php new file mode 100644 index 0000000..659b8f4 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/Descriptor.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; + +/** + * @author Jean-François Simon + */ +abstract class Descriptor implements DescriptorInterface +{ + public function describe($object, array $options = array()) + { + switch (true) { + case $object instanceof InputArgument: + return $this->describeInputArgument($object, $options); + case $object instanceof InputOption: + return $this->describeInputOption($object, $options); + case $object instanceof InputDefinition: + return $this->describeInputDefinition($object, $options); + case $object instanceof Command: + return $this->describeCommand($object, $options); + case $object instanceof Application: + return $this->describeApplication($object, $options); + } + + throw new \InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_class($object))); + } + + /** + * Describes an InputArgument instance. + * + * @param InputArgument $argument + * @param array $options + * + * @return string|mixed + */ + abstract protected function describeInputArgument(InputArgument $argument, array $options = array()); + + /** + * Describes an InputOption instance. + * + * @param InputOption $option + * @param array $options + * + * @return string|mixed + */ + abstract protected function describeInputOption(InputOption $option, array $options = array()); + + /** + * Describes an InputDefinition instance. + * + * @param InputDefinition $definition + * @param array $options + * + * @return string|mixed + */ + abstract protected function describeInputDefinition(InputDefinition $definition, array $options = array()); + + /** + * Describes a Command instance. + * + * @param Command $command + * @param array $options + * + * @return string|mixed + */ + abstract protected function describeCommand(Command $command, array $options = array()); + + /** + * Describes an Application instance. + * + * @param Application $application + * @param array $options + * + * @return string|mixed + */ + abstract protected function describeApplication(Application $application, array $options = array()); +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/DescriptorInterface.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/DescriptorInterface.php new file mode 100644 index 0000000..a4e8633 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/DescriptorInterface.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +/** + * Descriptor interface. + * + * @author Jean-François Simon + */ +interface DescriptorInterface +{ + /** + * Describes an InputArgument instance. + * + * @param object $object + * @param array $options + * + * @return string|mixed + */ + public function describe($object, array $options = array()); +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/JsonDescriptor.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/JsonDescriptor.php new file mode 100644 index 0000000..c2b2a53 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/JsonDescriptor.php @@ -0,0 +1,129 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; + +/** + * JSON descriptor. + * + * @author Jean-François Simon + */ +class JsonDescriptor extends Descriptor +{ + /** + * {@inheritdoc} + */ + protected function describeInputArgument(InputArgument $argument, array $options = array()) + { + return $this->output(array( + 'name' => $argument->getName(), + 'is_required' => $argument->isRequired(), + 'is_array' => $argument->isArray(), + 'description' => $argument->getDescription(), + 'default' => $argument->getDefault(), + ), $options); + } + + /** + * {@inheritdoc} + */ + protected function describeInputOption(InputOption $option, array $options = array()) + { + return $this->output(array( + 'name' => '--'.$option->getName(), + 'shortcut' => $option->getShortcut() ? '-'.implode('|-', explode('|', $option->getShortcut())) : '', + 'accept_value' => $option->acceptValue(), + 'is_value_required' => $option->isValueRequired(), + 'is_multiple' => $option->isArray(), + 'description' => $option->getDescription(), + 'default' => $option->getDefault(), + ), $options); + } + + /** + * {@inheritdoc} + */ + protected function describeInputDefinition(InputDefinition $definition, array $options = array()) + { + $inputArguments = array(); + foreach ($definition->getArguments() as $name => $argument) { + $inputArguments[$name] = $this->describeInputArgument($argument, array('as_array' => true)); + } + + $inputOptions = array(); + foreach ($definition->getOptions() as $name => $option) { + $inputOptions[$name] = $this->describeInputOption($option, array('as_array' => true)); + } + + return $this->output(array('arguments' => $inputArguments, 'options' => $inputOptions), $options); + } + + /** + * {@inheritdoc} + */ + protected function describeCommand(Command $command, array $options = array()) + { + $command->getSynopsis(); + $command->mergeApplicationDefinition(false); + + return $this->output(array( + 'name' => $command->getName(), + 'usage' => $command->getSynopsis(), + 'description' => $command->getDescription(), + 'help' => $command->getProcessedHelp(), + 'aliases' => $command->getAliases(), + 'definition' => $this->describeInputDefinition($command->getNativeDefinition(), array('as_array' => true)), + ), $options); + } + + /** + * {@inheritdoc} + */ + protected function describeApplication(Application $application, array $options = array()) + { + $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null; + $description = new ApplicationDescription($application, $describedNamespace); + $commands = array(); + + foreach ($description->getCommands() as $command) { + $commands[] = $this->describeCommand($command, array('as_array' => true)); + } + + $data = $describedNamespace + ? array('commands' => $commands, 'namespace' => $describedNamespace) + : array('commands' => $commands, 'namespaces' => array_values($description->getNamespaces())); + + return $this->output($data, $options); + } + + /** + * Outputs data as array or string according to options. + * + * @param array $data + * @param array $options + * + * @return array|string + */ + private function output(array $data, array $options) + { + if (isset($options['as_array']) && $options['as_array']) { + return $data; + } + + return json_encode($data, isset($options['json_encoding']) ? $options['json_encoding'] : 0); + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php new file mode 100644 index 0000000..770af38 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php @@ -0,0 +1,129 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; + +/** + * Markdown descriptor. + * + * @author Jean-François Simon + */ +class MarkdownDescriptor extends Descriptor +{ + /** + * {@inheritdoc} + */ + protected function describeInputArgument(InputArgument $argument, array $options = array()) + { + return '**'.$argument->getName().':**'."\n\n" + .'* Name: '.($argument->getName() ?: '')."\n" + .'* Is required: '.($argument->isRequired() ? 'yes' : 'no')."\n" + .'* Is array: '.($argument->isArray() ? 'yes' : 'no')."\n" + .'* Description: '.($argument->getDescription() ?: '')."\n" + .'* Default: `'.str_replace("\n", '', var_export($argument->getDefault(), true)).'`'; + } + + /** + * {@inheritdoc} + */ + protected function describeInputOption(InputOption $option, array $options = array()) + { + return '**'.$option->getName().':**'."\n\n" + .'* Name: `--'.$option->getName().'`'."\n" + .'* Shortcut: '.($option->getShortcut() ? '`-'.implode('|-', explode('|', $option->getShortcut())).'`' : '')."\n" + .'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n" + .'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n" + .'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n" + .'* Description: '.($option->getDescription() ?: '')."\n" + .'* Default: `'.str_replace("\n", '', var_export($option->getDefault(), true)).'`'; + } + + /** + * {@inheritdoc} + */ + protected function describeInputDefinition(InputDefinition $definition, array $options = array()) + { + $blocks = array(); + + if (count($definition->getArguments()) > 0) { + $blocks[] = '### Arguments:'; + foreach ($definition->getArguments() as $argument) { + $blocks[] = $this->describeInputArgument($argument); + } + } + + if (count($definition->getOptions()) > 0) { + $blocks[] = '### Options:'; + foreach ($definition->getOptions() as $option) { + $blocks[] = $this->describeInputOption($option); + } + } + + return implode("\n\n", $blocks); + } + + /** + * {@inheritdoc} + */ + protected function describeCommand(Command $command, array $options = array()) + { + $command->getSynopsis(); + $command->mergeApplicationDefinition(false); + + $markdown = $command->getName()."\n" + .str_repeat('-', strlen($command->getName()))."\n\n" + .'* Description: '.($command->getDescription() ?: '')."\n" + .'* Usage: `'.$command->getSynopsis().'`'."\n" + .'* Aliases: '.(count($command->getAliases()) ? '`'.implode('`, `', $command->getAliases()).'`' : ''); + + if ($help = $command->getProcessedHelp()) { + $markdown .= "\n\n".$help; + } + + if ($definitionMarkdown = $this->describeInputDefinition($command->getNativeDefinition())) { + $markdown .= "\n\n".$definitionMarkdown; + } + + return $markdown; + } + + /** + * {@inheritdoc} + */ + protected function describeApplication(Application $application, array $options = array()) + { + $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null; + $description = new ApplicationDescription($application, $describedNamespace); + $blocks = array($application->getName()."\n".str_repeat('=', strlen($application->getName()))); + + foreach ($description->getNamespaces() as $namespace) { + if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { + $blocks[] = '**'.$namespace['id'].':**'; + } + + $blocks[] = implode("\n", array_map(function ($commandName) { + return '* '.$commandName; + } , $namespace['commands'])); + } + + foreach ($description->getCommands() as $command) { + $blocks[] = $this->describeCommand($command); + } + + return implode("\n\n", $blocks); + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/TextDescriptor.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/TextDescriptor.php new file mode 100644 index 0000000..2003237 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/TextDescriptor.php @@ -0,0 +1,210 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; + +/** + * Text descriptor. + * + * @author Jean-François Simon + */ +class TextDescriptor extends Descriptor +{ + /** + * {@inheritdoc} + */ + protected function describeInputArgument(InputArgument $argument, array $options = array()) + { + if (null !== $argument->getDefault() && (!is_array($argument->getDefault()) || count($argument->getDefault()))) { + $default = sprintf(' (default: %s)', $this->formatDefaultValue($argument->getDefault())); + } else { + $default = ''; + } + + $nameWidth = isset($options['name_width']) ? $options['name_width'] : strlen($argument->getName()); + $output = str_replace("\n", "\n".str_repeat(' ', $nameWidth + 2), $argument->getDescription()); + $output = sprintf(" %-${nameWidth}s %s%s", $argument->getName(), $output, $default); + + return isset($options['raw_text']) && $options['raw_text'] ? strip_tags($output) : $output; + } + + /** + * {@inheritdoc} + */ + protected function describeInputOption(InputOption $option, array $options = array()) + { + if ($option->acceptValue() && null !== $option->getDefault() && (!is_array($option->getDefault()) || count($option->getDefault()))) { + $default = sprintf(' (default: %s)', $this->formatDefaultValue($option->getDefault())); + } else { + $default = ''; + } + + $nameWidth = isset($options['name_width']) ? $options['name_width'] : strlen($option->getName()); + $nameWithShortcutWidth = $nameWidth - strlen($option->getName()) - 2; + + $output = sprintf(" %s %-${nameWithShortcutWidth}s%s%s%s", + '--'.$option->getName(), + $option->getShortcut() ? sprintf('(-%s) ', $option->getShortcut()) : '', + str_replace("\n", "\n".str_repeat(' ', $nameWidth + 2), $option->getDescription()), + $default, + $option->isArray() ? ' (multiple values allowed)' : '' + ); + + return isset($options['raw_text']) && $options['raw_text'] ? strip_tags($output) : $output; + } + + /** + * {@inheritdoc} + */ + protected function describeInputDefinition(InputDefinition $definition, array $options = array()) + { + $nameWidth = 0; + foreach ($definition->getOptions() as $option) { + $nameLength = strlen($option->getName()) + 2; + if ($option->getShortcut()) { + $nameLength += strlen($option->getShortcut()) + 3; + } + $nameWidth = max($nameWidth, $nameLength); + } + foreach ($definition->getArguments() as $argument) { + $nameWidth = max($nameWidth, strlen($argument->getName())); + } + ++$nameWidth; + + $messages = array(); + + if ($definition->getArguments()) { + $messages[] = 'Arguments:'; + foreach ($definition->getArguments() as $argument) { + $messages[] = $this->describeInputArgument($argument, array('name_width' => $nameWidth)); + } + $messages[] = ''; + } + + if ($definition->getOptions()) { + $messages[] = 'Options:'; + foreach ($definition->getOptions() as $option) { + $messages[] = $this->describeInputOption($option, array('name_width' => $nameWidth)); + } + $messages[] = ''; + } + + $output = implode("\n", $messages); + + return isset($options['raw_text']) && $options['raw_text'] ? strip_tags($output) : $output; + } + + /** + * {@inheritdoc} + */ + protected function describeCommand(Command $command, array $options = array()) + { + $command->getSynopsis(); + $command->mergeApplicationDefinition(false); + $messages = array('Usage:', ' '.$command->getSynopsis(), ''); + + if ($command->getAliases()) { + $messages[] = 'Aliases: '.implode(', ', $command->getAliases()).''; + } + + $messages[] = $this->describeInputDefinition($command->getNativeDefinition()); + + if ($help = $command->getProcessedHelp()) { + $messages[] = 'Help:'; + $messages[] = ' '.str_replace("\n", "\n ", $help)."\n"; + } + + $output = implode("\n", $messages); + + return isset($options['raw_text']) && $options['raw_text'] ? strip_tags($output) : $output; + } + + /** + * {@inheritdoc} + */ + protected function describeApplication(Application $application, array $options = array()) + { + $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null; + $description = new ApplicationDescription($application, $describedNamespace); + $messages = array(); + + if (isset($options['raw_text']) && $options['raw_text']) { + $width = $this->getColumnWidth($description->getCommands()); + + foreach ($description->getCommands() as $command) { + $messages[] = sprintf("%-${width}s %s", $command->getName(), $command->getDescription()); + } + } else { + $width = $this->getColumnWidth($description->getCommands()); + + $messages[] = $application->getHelp(); + $messages[] = ''; + + if ($describedNamespace) { + $messages[] = sprintf("Available commands for the \"%s\" namespace:", $describedNamespace); + } else { + $messages[] = 'Available commands:'; + } + + // add commands by namespace + foreach ($description->getNamespaces() as $namespace) { + if (!$describedNamespace && ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { + $messages[] = ''.$namespace['id'].''; + } + + foreach ($namespace['commands'] as $name) { + $messages[] = sprintf(" %-${width}s %s", $name, $description->getCommand($name)->getDescription()); + } + } + } + + $output = implode("\n", $messages); + + return isset($options['raw_text']) && $options['raw_text'] ? strip_tags($output) : $output; + } + + /** + * Formats input option/argument default value. + * + * @param mixed $default + * + * @return string + */ + private function formatDefaultValue($default) + { + if (version_compare(PHP_VERSION, '5.4', '<')) { + return str_replace('\/', '/', json_encode($default)); + } + + return json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); + } + + /** + * @param Command[] $commands + * + * @return int + */ + private function getColumnWidth(array $commands) + { + $width = 0; + foreach ($commands as $command) { + $width = strlen($command->getName()) > $width ? strlen($command->getName()) : $width; + } + + return $width + 2; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/XmlDescriptor.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/XmlDescriptor.php new file mode 100644 index 0000000..c828a9c --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Descriptor/XmlDescriptor.php @@ -0,0 +1,212 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; + +/** + * XML descriptor. + * + * @author Jean-François Simon + */ +class XmlDescriptor extends Descriptor +{ + /** + * {@inheritdoc} + */ + protected function describeInputArgument(InputArgument $argument, array $options = array()) + { + $dom = new \DOMDocument('1.0', 'UTF-8'); + + $dom->appendChild($objectXML = $dom->createElement('argument')); + $objectXML->setAttribute('name', $argument->getName()); + $objectXML->setAttribute('is_required', $argument->isRequired() ? 1 : 0); + $objectXML->setAttribute('is_array', $argument->isArray() ? 1 : 0); + $objectXML->appendChild($descriptionXML = $dom->createElement('description')); + $descriptionXML->appendChild($dom->createTextNode($argument->getDescription())); + + $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); + $defaults = is_array($argument->getDefault()) ? $argument->getDefault() : (is_bool($argument->getDefault()) ? array(var_export($argument->getDefault(), true)) : ($argument->getDefault() ? array($argument->getDefault()) : array())); + foreach ($defaults as $default) { + $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); + $defaultXML->appendChild($dom->createTextNode($default)); + } + + return $this->output($dom, $options); + } + + /** + * {@inheritdoc} + */ + protected function describeInputOption(InputOption $option, array $options = array()) + { + $dom = new \DOMDocument('1.0', 'UTF-8'); + + $dom->appendChild($objectXML = $dom->createElement('option')); + $objectXML->setAttribute('name', '--'.$option->getName()); + $pos = strpos($option->getShortcut(), '|'); + if (false !== $pos) { + $objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos)); + $objectXML->setAttribute('shortcuts', '-'.implode('|-', explode('|', $option->getShortcut()))); + } else { + $objectXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : ''); + } + $objectXML->setAttribute('accept_value', $option->acceptValue() ? 1 : 0); + $objectXML->setAttribute('is_value_required', $option->isValueRequired() ? 1 : 0); + $objectXML->setAttribute('is_multiple', $option->isArray() ? 1 : 0); + $objectXML->appendChild($descriptionXML = $dom->createElement('description')); + $descriptionXML->appendChild($dom->createTextNode($option->getDescription())); + + if ($option->acceptValue()) { + $defaults = is_array($option->getDefault()) ? $option->getDefault() : (is_bool($option->getDefault()) ? array(var_export($option->getDefault(), true)) : ($option->getDefault() ? array($option->getDefault()) : array())); + $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); + + if (!empty($defaults)) { + foreach ($defaults as $default) { + $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); + $defaultXML->appendChild($dom->createTextNode($default)); + } + } + } + + return $this->output($dom, $options); + } + + /** + * {@inheritdoc} + */ + protected function describeInputDefinition(InputDefinition $definition, array $options = array()) + { + $dom = new \DOMDocument('1.0', 'UTF-8'); + $dom->appendChild($definitionXML = $dom->createElement('definition')); + + $definitionXML->appendChild($argumentsXML = $dom->createElement('arguments')); + foreach ($definition->getArguments() as $argument) { + $this->appendDocument($argumentsXML, $this->describeInputArgument($argument, array('as_dom' => true))); + } + + $definitionXML->appendChild($optionsXML = $dom->createElement('options')); + foreach ($definition->getOptions() as $option) { + $this->appendDocument($optionsXML, $this->describeInputOption($option, array('as_dom' => true))); + } + + return $this->output($dom, $options); + } + + /** + * {@inheritdoc} + */ + protected function describeCommand(Command $command, array $options = array()) + { + $dom = new \DOMDocument('1.0', 'UTF-8'); + $dom->appendChild($commandXML = $dom->createElement('command')); + + $command->getSynopsis(); + $command->mergeApplicationDefinition(false); + + $commandXML->setAttribute('id', $command->getName()); + $commandXML->setAttribute('name', $command->getName()); + + $commandXML->appendChild($usageXML = $dom->createElement('usage')); + $usageXML->appendChild($dom->createTextNode(sprintf($command->getSynopsis(), ''))); + + $commandXML->appendChild($descriptionXML = $dom->createElement('description')); + $descriptionXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getDescription()))); + + $commandXML->appendChild($helpXML = $dom->createElement('help')); + $helpXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getProcessedHelp()))); + + $commandXML->appendChild($aliasesXML = $dom->createElement('aliases')); + foreach ($command->getAliases() as $alias) { + $aliasesXML->appendChild($aliasXML = $dom->createElement('alias')); + $aliasXML->appendChild($dom->createTextNode($alias)); + } + + $definitionXML = $this->describeInputDefinition($command->getNativeDefinition(), array('as_dom' => true)); + $this->appendDocument($commandXML, $definitionXML->getElementsByTagName('definition')->item(0)); + + return $this->output($dom, $options); + } + + /** + * {@inheritdoc} + */ + protected function describeApplication(Application $application, array $options = array()) + { + $dom = new \DOMDocument('1.0', 'UTF-8'); + $dom->appendChild($rootXml = $dom->createElement('symfony')); + $rootXml->appendChild($commandsXML = $dom->createElement('commands')); + + $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null; + $description = new ApplicationDescription($application, $describedNamespace); + + if ($describedNamespace) { + $commandsXML->setAttribute('namespace', $describedNamespace); + } + + foreach ($description->getCommands() as $command) { + $this->appendDocument($commandsXML, $this->describeCommand($command, array('as_dom' => true))); + } + + if (!$describedNamespace) { + $rootXml->appendChild($namespacesXML = $dom->createElement('namespaces')); + + foreach ($description->getNamespaces() as $namespace) { + $namespacesXML->appendChild($namespaceArrayXML = $dom->createElement('namespace')); + $namespaceArrayXML->setAttribute('id', $namespace['id']); + + foreach ($namespace['commands'] as $name) { + $namespaceArrayXML->appendChild($commandXML = $dom->createElement('command')); + $commandXML->appendChild($dom->createTextNode($name)); + } + } + } + + return $this->output($dom, $options); + } + + /** + * Appends document children to parent node. + * + * @param \DOMNode $parentNode + * @param \DOMNode $importedParent + */ + private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent) + { + foreach ($importedParent->childNodes as $childNode) { + $parentNode->appendChild($parentNode->ownerDocument->importNode($childNode, true)); + } + } + + /** + * Outputs document as DOMDocument or string according to options. + * + * @param \DOMDocument $dom + * @param array $options + * + * @return \DOMDocument|string + */ + private function output(\DOMDocument $dom, array $options) + { + if (isset($options['as_dom']) && $options['as_dom']) { + return $dom; + } + + $dom->formatOutput = true; + + return $dom->saveXML(); + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleCommandEvent.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleCommandEvent.php new file mode 100644 index 0000000..47ac68b --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleCommandEvent.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Event; + +/** + * Allows to do things before the command is executed. + * + * @author Fabien Potencier + */ +class ConsoleCommandEvent extends ConsoleEvent +{ +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleEvent.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleEvent.php new file mode 100644 index 0000000..ab620c4 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleEvent.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Event; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\EventDispatcher\Event; + +/** + * Allows to inspect input and output of a command. + * + * @author Francesco Levorato + */ +class ConsoleEvent extends Event +{ + protected $command; + + private $input; + private $output; + + public function __construct(Command $command, InputInterface $input, OutputInterface $output) + { + $this->command = $command; + $this->input = $input; + $this->output = $output; + } + + /** + * Gets the command that is executed. + * + * @return Command A Command instance + */ + public function getCommand() + { + return $this->command; + } + + /** + * Gets the input instance. + * + * @return InputInterface An InputInterface instance + */ + public function getInput() + { + return $this->input; + } + + /** + * Gets the output instance. + * + * @return OutputInterface An OutputInterface instance + */ + public function getOutput() + { + return $this->output; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleExceptionEvent.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleExceptionEvent.php new file mode 100644 index 0000000..a2c6b74 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleExceptionEvent.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Event; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Allows to handle exception thrown in a command. + * + * @author Fabien Potencier + */ +class ConsoleExceptionEvent extends ConsoleEvent +{ + private $exception; + private $exitCode; + + public function __construct(Command $command, InputInterface $input, OutputInterface $output, \Exception $exception, $exitCode) + { + parent::__construct($command, $input, $output); + + $this->setException($exception); + $this->exitCode = $exitCode; + } + + /** + * Returns the thrown exception. + * + * @return \Exception The thrown exception + */ + public function getException() + { + return $this->exception; + } + + /** + * Replaces the thrown exception. + * + * This exception will be thrown if no response is set in the event. + * + * @param \Exception $exception The thrown exception + */ + public function setException(\Exception $exception) + { + $this->exception = $exception; + } + + /** + * Gets the exit code. + * + * @return int The command exit code + */ + public function getExitCode() + { + return $this->exitCode; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleTerminateEvent.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleTerminateEvent.php new file mode 100644 index 0000000..476cbac --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleTerminateEvent.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Event; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Allows to manipulate the exit code of a command after its execution. + * + * @author Francesco Levorato + */ +class ConsoleTerminateEvent extends ConsoleEvent +{ + /** + * The exit code of the command. + * + * @var int + */ + private $exitCode; + + public function __construct(Command $command, InputInterface $input, OutputInterface $output, $exitCode) + { + parent::__construct($command, $input, $output); + + $this->setExitCode($exitCode); + } + + /** + * Sets the exit code. + * + * @param int $exitCode The command exit code + */ + public function setExitCode($exitCode) + { + $this->exitCode = $exitCode; + } + + /** + * Gets the exit code. + * + * @return int The command exit code + */ + public function getExitCode() + { + return $this->exitCode; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatter.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatter.php new file mode 100644 index 0000000..3813b54 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatter.php @@ -0,0 +1,240 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Formatter; + +/** + * Formatter class for console output. + * + * @author Konstantin Kudryashov + * + * @api + */ +class OutputFormatter implements OutputFormatterInterface +{ + private $decorated; + private $styles = array(); + private $styleStack; + + /** + * Escapes "<" special char in given text. + * + * @param string $text Text to escape + * + * @return string Escaped text + */ + public static function escape($text) + { + return preg_replace('/([^\\\\]?) FormatterStyle" instances + * + * @api + */ + public function __construct($decorated = false, array $styles = array()) + { + $this->decorated = (bool) $decorated; + + $this->setStyle('error', new OutputFormatterStyle('white', 'red')); + $this->setStyle('info', new OutputFormatterStyle('green')); + $this->setStyle('comment', new OutputFormatterStyle('yellow')); + $this->setStyle('question', new OutputFormatterStyle('black', 'cyan')); + + foreach ($styles as $name => $style) { + $this->setStyle($name, $style); + } + + $this->styleStack = new OutputFormatterStyleStack(); + } + + /** + * Sets the decorated flag. + * + * @param bool $decorated Whether to decorate the messages or not + * + * @api + */ + public function setDecorated($decorated) + { + $this->decorated = (bool) $decorated; + } + + /** + * Gets the decorated flag. + * + * @return bool true if the output will decorate messages, false otherwise + * + * @api + */ + public function isDecorated() + { + return $this->decorated; + } + + /** + * Sets a new style. + * + * @param string $name The style name + * @param OutputFormatterStyleInterface $style The style instance + * + * @api + */ + public function setStyle($name, OutputFormatterStyleInterface $style) + { + $this->styles[strtolower($name)] = $style; + } + + /** + * Checks if output formatter has style with specified name. + * + * @param string $name + * + * @return bool + * + * @api + */ + public function hasStyle($name) + { + return isset($this->styles[strtolower($name)]); + } + + /** + * Gets style options from style with specified name. + * + * @param string $name + * + * @return OutputFormatterStyleInterface + * + * @throws \InvalidArgumentException When style isn't defined + * + * @api + */ + public function getStyle($name) + { + if (!$this->hasStyle($name)) { + throw new \InvalidArgumentException(sprintf('Undefined style: %s', $name)); + } + + return $this->styles[strtolower($name)]; + } + + /** + * Formats a message according to the given styles. + * + * @param string $message The message to style + * + * @return string The styled message + * + * @api + */ + public function format($message) + { + $offset = 0; + $output = ''; + $tagRegex = '[a-z][a-z0-9_=;-]*'; + preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#isx", $message, $matches, PREG_OFFSET_CAPTURE); + foreach ($matches[0] as $i => $match) { + $pos = $match[1]; + $text = $match[0]; + + // add the text up to the next tag + $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset)); + $offset = $pos + strlen($text); + + // opening tag? + if ($open = '/' != $text[1]) { + $tag = $matches[1][$i][0]; + } else { + $tag = isset($matches[3][$i][0]) ? $matches[3][$i][0] : ''; + } + + if (!$open && !$tag) { + // + $this->styleStack->pop(); + } elseif ($pos && '\\' == $message[$pos - 1]) { + // escaped tag + $output .= $this->applyCurrentStyle($text); + } elseif (false === $style = $this->createStyleFromString(strtolower($tag))) { + $output .= $this->applyCurrentStyle($text); + } elseif ($open) { + $this->styleStack->push($style); + } else { + $this->styleStack->pop($style); + } + } + + $output .= $this->applyCurrentStyle(substr($message, $offset)); + + return str_replace('\\<', '<', $output); + } + + /** + * @return OutputFormatterStyleStack + */ + public function getStyleStack() + { + return $this->styleStack; + } + + /** + * Tries to create new style instance from string. + * + * @param string $string + * + * @return OutputFormatterStyle|bool false if string is not format string + */ + private function createStyleFromString($string) + { + if (isset($this->styles[$string])) { + return $this->styles[$string]; + } + + if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', strtolower($string), $matches, PREG_SET_ORDER)) { + return false; + } + + $style = new OutputFormatterStyle(); + foreach ($matches as $match) { + array_shift($match); + + if ('fg' == $match[0]) { + $style->setForeground($match[1]); + } elseif ('bg' == $match[0]) { + $style->setBackground($match[1]); + } else { + try { + $style->setOption($match[1]); + } catch (\InvalidArgumentException $e) { + return false; + } + } + } + + return $style; + } + + /** + * Applies current style from stack to text, if must be applied. + * + * @param string $text Input text + * + * @return string Styled text + */ + private function applyCurrentStyle($text) + { + return $this->isDecorated() && strlen($text) > 0 ? $this->styleStack->getCurrent()->apply($text) : $text; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterInterface.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterInterface.php new file mode 100644 index 0000000..151adcd --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterInterface.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Formatter; + +/** + * Formatter interface for console output. + * + * @author Konstantin Kudryashov + * + * @api + */ +interface OutputFormatterInterface +{ + /** + * Sets the decorated flag. + * + * @param bool $decorated Whether to decorate the messages or not + * + * @api + */ + public function setDecorated($decorated); + + /** + * Gets the decorated flag. + * + * @return bool true if the output will decorate messages, false otherwise + * + * @api + */ + public function isDecorated(); + + /** + * Sets a new style. + * + * @param string $name The style name + * @param OutputFormatterStyleInterface $style The style instance + * + * @api + */ + public function setStyle($name, OutputFormatterStyleInterface $style); + + /** + * Checks if output formatter has style with specified name. + * + * @param string $name + * + * @return bool + * + * @api + */ + public function hasStyle($name); + + /** + * Gets style options from style with specified name. + * + * @param string $name + * + * @return OutputFormatterStyleInterface + * + * @api + */ + public function getStyle($name); + + /** + * Formats a message according to the given styles. + * + * @param string $message The message to style + * + * @return string The styled message + * + * @api + */ + public function format($message); +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyle.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyle.php new file mode 100644 index 0000000..0a3e69e --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyle.php @@ -0,0 +1,222 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Formatter; + +/** + * Formatter style class for defining styles. + * + * @author Konstantin Kudryashov + * + * @api + */ +class OutputFormatterStyle implements OutputFormatterStyleInterface +{ + private static $availableForegroundColors = array( + 'black' => 30, + 'red' => 31, + 'green' => 32, + 'yellow' => 33, + 'blue' => 34, + 'magenta' => 35, + 'cyan' => 36, + 'white' => 37, + ); + private static $availableBackgroundColors = array( + 'black' => 40, + 'red' => 41, + 'green' => 42, + 'yellow' => 43, + 'blue' => 44, + 'magenta' => 45, + 'cyan' => 46, + 'white' => 47, + ); + private static $availableOptions = array( + 'bold' => 1, + 'underscore' => 4, + 'blink' => 5, + 'reverse' => 7, + 'conceal' => 8, + ); + + private $foreground; + private $background; + private $options = array(); + + /** + * Initializes output formatter style. + * + * @param string|null $foreground The style foreground color name + * @param string|null $background The style background color name + * @param array $options The style options + * + * @api + */ + public function __construct($foreground = null, $background = null, array $options = array()) + { + if (null !== $foreground) { + $this->setForeground($foreground); + } + if (null !== $background) { + $this->setBackground($background); + } + if (count($options)) { + $this->setOptions($options); + } + } + + /** + * Sets style foreground color. + * + * @param string|null $color The color name + * + * @throws \InvalidArgumentException When the color name isn't defined + * + * @api + */ + public function setForeground($color = null) + { + if (null === $color) { + $this->foreground = null; + + return; + } + + if (!isset(static::$availableForegroundColors[$color])) { + throw new \InvalidArgumentException(sprintf( + 'Invalid foreground color specified: "%s". Expected one of (%s)', + $color, + implode(', ', array_keys(static::$availableForegroundColors)) + )); + } + + $this->foreground = static::$availableForegroundColors[$color]; + } + + /** + * Sets style background color. + * + * @param string|null $color The color name + * + * @throws \InvalidArgumentException When the color name isn't defined + * + * @api + */ + public function setBackground($color = null) + { + if (null === $color) { + $this->background = null; + + return; + } + + if (!isset(static::$availableBackgroundColors[$color])) { + throw new \InvalidArgumentException(sprintf( + 'Invalid background color specified: "%s". Expected one of (%s)', + $color, + implode(', ', array_keys(static::$availableBackgroundColors)) + )); + } + + $this->background = static::$availableBackgroundColors[$color]; + } + + /** + * Sets some specific style option. + * + * @param string $option The option name + * + * @throws \InvalidArgumentException When the option name isn't defined + * + * @api + */ + public function setOption($option) + { + if (!isset(static::$availableOptions[$option])) { + throw new \InvalidArgumentException(sprintf( + 'Invalid option specified: "%s". Expected one of (%s)', + $option, + implode(', ', array_keys(static::$availableOptions)) + )); + } + + if (false === array_search(static::$availableOptions[$option], $this->options)) { + $this->options[] = static::$availableOptions[$option]; + } + } + + /** + * Unsets some specific style option. + * + * @param string $option The option name + * + * @throws \InvalidArgumentException When the option name isn't defined + * + */ + public function unsetOption($option) + { + if (!isset(static::$availableOptions[$option])) { + throw new \InvalidArgumentException(sprintf( + 'Invalid option specified: "%s". Expected one of (%s)', + $option, + implode(', ', array_keys(static::$availableOptions)) + )); + } + + $pos = array_search(static::$availableOptions[$option], $this->options); + if (false !== $pos) { + unset($this->options[$pos]); + } + } + + /** + * Sets multiple style options at once. + * + * @param array $options + */ + public function setOptions(array $options) + { + $this->options = array(); + + foreach ($options as $option) { + $this->setOption($option); + } + } + + /** + * Applies the style to a given text. + * + * @param string $text The text to style + * + * @return string + */ + public function apply($text) + { + $codes = array(); + + if (null !== $this->foreground) { + $codes[] = $this->foreground; + } + if (null !== $this->background) { + $codes[] = $this->background; + } + if (count($this->options)) { + $codes = array_merge($codes, $this->options); + } + + if (0 === count($codes)) { + return $text; + } + + return sprintf("\033[%sm%s\033[0m", implode(';', $codes), $text); + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php new file mode 100644 index 0000000..e8642b3 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Formatter; + +/** + * Formatter style interface for defining styles. + * + * @author Konstantin Kudryashov + * + * @api + */ +interface OutputFormatterStyleInterface +{ + /** + * Sets style foreground color. + * + * @param string $color The color name + * + * @api + */ + public function setForeground($color = null); + + /** + * Sets style background color. + * + * @param string $color The color name + * + * @api + */ + public function setBackground($color = null); + + /** + * Sets some specific style option. + * + * @param string $option The option name + * + * @api + */ + public function setOption($option); + + /** + * Unsets some specific style option. + * + * @param string $option The option name + */ + public function unsetOption($option); + + /** + * Sets multiple style options at once. + * + * @param array $options + */ + public function setOptions(array $options); + + /** + * Applies the style to a given text. + * + * @param string $text The text to style + * + * @return string + */ + public function apply($text); +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php new file mode 100644 index 0000000..e63912c --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php @@ -0,0 +1,121 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Formatter; + +/** + * @author Jean-François Simon + */ +class OutputFormatterStyleStack +{ + /** + * @var OutputFormatterStyleInterface[] + */ + private $styles; + + /** + * @var OutputFormatterStyleInterface + */ + private $emptyStyle; + + /** + * Constructor. + * + * @param OutputFormatterStyleInterface|null $emptyStyle + */ + public function __construct(OutputFormatterStyleInterface $emptyStyle = null) + { + $this->emptyStyle = $emptyStyle ?: new OutputFormatterStyle(); + $this->reset(); + } + + /** + * Resets stack (ie. empty internal arrays). + */ + public function reset() + { + $this->styles = array(); + } + + /** + * Pushes a style in the stack. + * + * @param OutputFormatterStyleInterface $style + */ + public function push(OutputFormatterStyleInterface $style) + { + $this->styles[] = $style; + } + + /** + * Pops a style from the stack. + * + * @param OutputFormatterStyleInterface|null $style + * + * @return OutputFormatterStyleInterface + * + * @throws \InvalidArgumentException When style tags incorrectly nested + */ + public function pop(OutputFormatterStyleInterface $style = null) + { + if (empty($this->styles)) { + return $this->emptyStyle; + } + + if (null === $style) { + return array_pop($this->styles); + } + + foreach (array_reverse($this->styles, true) as $index => $stackedStyle) { + if ($style->apply('') === $stackedStyle->apply('')) { + $this->styles = array_slice($this->styles, 0, $index); + + return $stackedStyle; + } + } + + throw new \InvalidArgumentException('Incorrectly nested style tag found.'); + } + + /** + * Computes current style with stacks top codes. + * + * @return OutputFormatterStyle + */ + public function getCurrent() + { + if (empty($this->styles)) { + return $this->emptyStyle; + } + + return $this->styles[count($this->styles)-1]; + } + + /** + * @param OutputFormatterStyleInterface $emptyStyle + * + * @return OutputFormatterStyleStack + */ + public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle) + { + $this->emptyStyle = $emptyStyle; + + return $this; + } + + /** + * @return OutputFormatterStyleInterface + */ + public function getEmptyStyle() + { + return $this->emptyStyle; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/DescriptorHelper.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/DescriptorHelper.php new file mode 100644 index 0000000..9072efe --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/DescriptorHelper.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Descriptor\DescriptorInterface; +use Symfony\Component\Console\Descriptor\JsonDescriptor; +use Symfony\Component\Console\Descriptor\MarkdownDescriptor; +use Symfony\Component\Console\Descriptor\TextDescriptor; +use Symfony\Component\Console\Descriptor\XmlDescriptor; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * This class adds helper method to describe objects in various formats. + * + * @author Jean-François Simon + */ +class DescriptorHelper extends Helper +{ + /** + * @var DescriptorInterface[] + */ + private $descriptors = array(); + + /** + * Constructor. + */ + public function __construct() + { + $this + ->register('txt', new TextDescriptor()) + ->register('xml', new XmlDescriptor()) + ->register('json', new JsonDescriptor()) + ->register('md', new MarkdownDescriptor()) + ; + } + + /** + * Describes an object if supported. + * + * @param OutputInterface $output + * @param object $object + * @param string|null $format + * @param bool $raw + * @param string|null $namespace + * + * @throws \InvalidArgumentException when the given format is not supported + */ + public function describe(OutputInterface $output, $object, $format = null, $raw = false, $namespace = null) + { + $options = array('raw_text' => $raw, 'format' => $format ?: 'txt', 'namespace' => $namespace); + $type = !$raw && 'txt' === $options['format'] ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW; + + if (!isset($this->descriptors[$options['format']])) { + throw new \InvalidArgumentException(sprintf('Unsupported format "%s".', $options['format'])); + } + + $descriptor = $this->descriptors[$options['format']]; + + $output->writeln($descriptor->describe($object, $options), $type); + } + + /** + * Registers a descriptor. + * + * @param string $format + * @param DescriptorInterface $descriptor + * + * @return DescriptorHelper + */ + public function register($format, DescriptorInterface $descriptor) + { + $this->descriptors[$format] = $descriptor; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'descriptor'; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php new file mode 100644 index 0000000..89c1587 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php @@ -0,0 +1,470 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Formatter\OutputFormatterStyle; + +/** + * The Dialog class provides helpers to interact with the user. + * + * @author Fabien Potencier + */ +class DialogHelper extends Helper +{ + private $inputStream; + private static $shell; + private static $stty; + + /** + * Asks the user to select a value. + * + * @param OutputInterface $output An Output instance + * @param string|array $question The question to ask + * @param array $choices List of choices to pick from + * @param bool|string $default The default answer if the user enters nothing + * @param bool|int $attempts Max number of times to ask before giving up (false by default, which means infinite) + * @param string $errorMessage Message which will be shown if invalid value from choice list would be picked + * @param bool $multiselect Select more than one value separated by comma + * + * @return int|string|array The selected value or values (the key of the choices array) + * + * @throws \InvalidArgumentException + */ + public function select(OutputInterface $output, $question, $choices, $default = null, $attempts = false, $errorMessage = 'Value "%s" is invalid', $multiselect = false) + { + $width = max(array_map('strlen', array_keys($choices))); + + $messages = (array) $question; + foreach ($choices as $key => $value) { + $messages[] = sprintf(" [%-${width}s] %s", $key, $value); + } + + $output->writeln($messages); + + $result = $this->askAndValidate($output, '> ', function ($picked) use ($choices, $errorMessage, $multiselect) { + // Collapse all spaces. + $selectedChoices = str_replace(" ", "", $picked); + + if ($multiselect) { + // Check for a separated comma values + if (!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices, $matches)) { + throw new \InvalidArgumentException(sprintf($errorMessage, $picked)); + } + $selectedChoices = explode(",", $selectedChoices); + } else { + $selectedChoices = array($picked); + } + + $multiselectChoices = array(); + + foreach ($selectedChoices as $value) { + if (empty($choices[$value])) { + throw new \InvalidArgumentException(sprintf($errorMessage, $value)); + } + array_push($multiselectChoices, $value); + } + + if ($multiselect) { + return $multiselectChoices; + } + + return $picked; + }, $attempts, $default); + + return $result; + } + + /** + * Asks a question to the user. + * + * @param OutputInterface $output An Output instance + * @param string|array $question The question to ask + * @param string $default The default answer if none is given by the user + * @param array $autocomplete List of values to autocomplete + * + * @return string The user answer + * + * @throws \RuntimeException If there is no data to read in the input stream + */ + public function ask(OutputInterface $output, $question, $default = null, array $autocomplete = null) + { + $output->write($question); + + $inputStream = $this->inputStream ?: STDIN; + + if (null === $autocomplete || !$this->hasSttyAvailable()) { + $ret = fgets($inputStream, 4096); + if (false === $ret) { + throw new \RuntimeException('Aborted'); + } + $ret = trim($ret); + } else { + $ret = ''; + + $i = 0; + $ofs = -1; + $matches = $autocomplete; + $numMatches = count($matches); + + $sttyMode = shell_exec('stty -g'); + + // Disable icanon (so we can fread each keypress) and echo (we'll do echoing here instead) + shell_exec('stty -icanon -echo'); + + // Add highlighted text style + $output->getFormatter()->setStyle('hl', new OutputFormatterStyle('black', 'white')); + + // Read a keypress + while (!feof($inputStream)) { + $c = fread($inputStream, 1); + + // Backspace Character + if ("\177" === $c) { + if (0 === $numMatches && 0 !== $i) { + $i--; + // Move cursor backwards + $output->write("\033[1D"); + } + + if ($i === 0) { + $ofs = -1; + $matches = $autocomplete; + $numMatches = count($matches); + } else { + $numMatches = 0; + } + + // Pop the last character off the end of our string + $ret = substr($ret, 0, $i); + } elseif ("\033" === $c) { + // Did we read an escape sequence? + $c .= fread($inputStream, 2); + + // A = Up Arrow. B = Down Arrow + if (isset($c[2]) && ('A' === $c[2] || 'B' === $c[2])) { + if ('A' === $c[2] && -1 === $ofs) { + $ofs = 0; + } + + if (0 === $numMatches) { + continue; + } + + $ofs += ('A' === $c[2]) ? -1 : 1; + $ofs = ($numMatches + $ofs) % $numMatches; + } + } elseif (ord($c) < 32) { + if ("\t" === $c || "\n" === $c) { + if ($numMatches > 0 && -1 !== $ofs) { + $ret = $matches[$ofs]; + // Echo out remaining chars for current match + $output->write(substr($ret, $i)); + $i = strlen($ret); + } + + if ("\n" === $c) { + $output->write($c); + break; + } + + $numMatches = 0; + } + + continue; + } else { + $output->write($c); + $ret .= $c; + $i++; + + $numMatches = 0; + $ofs = 0; + + foreach ($autocomplete as $value) { + // If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle) + if (0 === strpos($value, $ret) && $i !== strlen($value)) { + $matches[$numMatches++] = $value; + } + } + } + + // Erase characters from cursor to end of line + $output->write("\033[K"); + + if ($numMatches > 0 && -1 !== $ofs) { + // Save cursor position + $output->write("\0337"); + // Write highlighted text + $output->write(''.substr($matches[$ofs], $i).''); + // Restore cursor position + $output->write("\0338"); + } + } + + // Reset stty so it behaves normally again + shell_exec(sprintf('stty %s', $sttyMode)); + } + + return strlen($ret) > 0 ? $ret : $default; + } + + /** + * Asks a confirmation to the user. + * + * The question will be asked until the user answers by nothing, yes, or no. + * + * @param OutputInterface $output An Output instance + * @param string|array $question The question to ask + * @param bool $default The default answer if the user enters nothing + * + * @return bool true if the user has confirmed, false otherwise + */ + public function askConfirmation(OutputInterface $output, $question, $default = true) + { + $answer = 'z'; + while ($answer && !in_array(strtolower($answer[0]), array('y', 'n'))) { + $answer = $this->ask($output, $question); + } + + if (false === $default) { + return $answer && 'y' == strtolower($answer[0]); + } + + return !$answer || 'y' == strtolower($answer[0]); + } + + /** + * Asks a question to the user, the response is hidden + * + * @param OutputInterface $output An Output instance + * @param string|array $question The question + * @param bool $fallback In case the response can not be hidden, whether to fallback on non-hidden question or not + * + * @return string The answer + * + * @throws \RuntimeException In case the fallback is deactivated and the response can not be hidden + */ + public function askHiddenResponse(OutputInterface $output, $question, $fallback = true) + { + if (defined('PHP_WINDOWS_VERSION_BUILD')) { + $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; + + // handle code running from a phar + if ('phar:' === substr(__FILE__, 0, 5)) { + $tmpExe = sys_get_temp_dir().'/hiddeninput.exe'; + copy($exe, $tmpExe); + $exe = $tmpExe; + } + + $output->write($question); + $value = rtrim(shell_exec($exe)); + $output->writeln(''); + + if (isset($tmpExe)) { + unlink($tmpExe); + } + + return $value; + } + + if ($this->hasSttyAvailable()) { + $output->write($question); + + $sttyMode = shell_exec('stty -g'); + + shell_exec('stty -echo'); + $value = fgets($this->inputStream ?: STDIN, 4096); + shell_exec(sprintf('stty %s', $sttyMode)); + + if (false === $value) { + throw new \RuntimeException('Aborted'); + } + + $value = trim($value); + $output->writeln(''); + + return $value; + } + + if (false !== $shell = $this->getShell()) { + $output->write($question); + $readCmd = $shell === 'csh' ? 'set mypassword = $<' : 'read -r mypassword'; + $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd); + $value = rtrim(shell_exec($command)); + $output->writeln(''); + + return $value; + } + + if ($fallback) { + return $this->ask($output, $question); + } + + throw new \RuntimeException('Unable to hide the response'); + } + + /** + * Asks for a value and validates the response. + * + * The validator receives the data to validate. It must return the + * validated data when the data is valid and throw an exception + * otherwise. + * + * @param OutputInterface $output An Output instance + * @param string|array $question The question to ask + * @param callable $validator A PHP callback + * @param int|false $attempts Max number of times to ask before giving up (false by default, which means infinite) + * @param string $default The default answer if none is given by the user + * @param array $autocomplete List of values to autocomplete + * + * @return mixed + * + * @throws \Exception When any of the validators return an error + */ + public function askAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $default = null, array $autocomplete = null) + { + $that = $this; + + $interviewer = function () use ($output, $question, $default, $autocomplete, $that) { + return $that->ask($output, $question, $default, $autocomplete); + }; + + return $this->validateAttempts($interviewer, $output, $validator, $attempts); + } + + /** + * Asks for a value, hide and validates the response. + * + * The validator receives the data to validate. It must return the + * validated data when the data is valid and throw an exception + * otherwise. + * + * @param OutputInterface $output An Output instance + * @param string|array $question The question to ask + * @param callable $validator A PHP callback + * @param int|false $attempts Max number of times to ask before giving up (false by default, which means infinite) + * @param bool $fallback In case the response can not be hidden, whether to fallback on non-hidden question or not + * + * @return string The response + * + * @throws \Exception When any of the validators return an error + * @throws \RuntimeException In case the fallback is deactivated and the response can not be hidden + * + */ + public function askHiddenResponseAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $fallback = true) + { + $that = $this; + + $interviewer = function () use ($output, $question, $fallback, $that) { + return $that->askHiddenResponse($output, $question, $fallback); + }; + + return $this->validateAttempts($interviewer, $output, $validator, $attempts); + } + + /** + * Sets the input stream to read from when interacting with the user. + * + * This is mainly useful for testing purpose. + * + * @param resource $stream The input stream + */ + public function setInputStream($stream) + { + $this->inputStream = $stream; + } + + /** + * Returns the helper's input stream + * + * @return string + */ + public function getInputStream() + { + return $this->inputStream; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'dialog'; + } + + /** + * Return a valid Unix shell + * + * @return string|bool The valid shell name, false in case no valid shell is found + */ + private function getShell() + { + if (null !== self::$shell) { + return self::$shell; + } + + self::$shell = false; + + if (file_exists('/usr/bin/env')) { + // handle other OSs with bash/zsh/ksh/csh if available to hide the answer + $test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null"; + foreach (array('bash', 'zsh', 'ksh', 'csh') as $sh) { + if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) { + self::$shell = $sh; + break; + } + } + } + + return self::$shell; + } + + private function hasSttyAvailable() + { + if (null !== self::$stty) { + return self::$stty; + } + + exec('stty 2>&1', $output, $exitcode); + + return self::$stty = $exitcode === 0; + } + + /** + * Validate an attempt + * + * @param callable $interviewer A callable that will ask for a question and return the result + * @param OutputInterface $output An Output instance + * @param callable $validator A PHP callback + * @param int|false $attempts Max number of times to ask before giving up ; false will ask infinitely + * + * @return string The validated response + * + * @throws \Exception In case the max number of attempts has been reached and no valid response has been given + */ + private function validateAttempts($interviewer, OutputInterface $output, $validator, $attempts) + { + $error = null; + while (false === $attempts || $attempts--) { + if (null !== $error) { + $output->writeln($this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error')); + } + + try { + return call_user_func($validator, $interviewer()); + } catch (\Exception $error) { + } + } + + throw $error; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/FormatterHelper.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/FormatterHelper.php new file mode 100644 index 0000000..b942943 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/FormatterHelper.php @@ -0,0 +1,80 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Formatter\OutputFormatter; + +/** + * The Formatter class provides helpers to format messages. + * + * @author Fabien Potencier + */ +class FormatterHelper extends Helper +{ + /** + * Formats a message within a section. + * + * @param string $section The section name + * @param string $message The message + * @param string $style The style to apply to the section + * + * @return string The format section + */ + public function formatSection($section, $message, $style = 'info') + { + return sprintf('<%s>[%s] %s', $style, $section, $style, $message); + } + + /** + * Formats a message as a block of text. + * + * @param string|array $messages The message to write in the block + * @param string $style The style to apply to the whole block + * @param bool $large Whether to return a large block + * + * @return string The formatter message + */ + public function formatBlock($messages, $style, $large = false) + { + $messages = (array) $messages; + + $len = 0; + $lines = array(); + foreach ($messages as $message) { + $message = OutputFormatter::escape($message); + $lines[] = sprintf($large ? ' %s ' : ' %s ', $message); + $len = max($this->strlen($message) + ($large ? 4 : 2), $len); + } + + $messages = $large ? array(str_repeat(' ', $len)) : array(); + foreach ($lines as $line) { + $messages[] = $line.str_repeat(' ', $len - $this->strlen($line)); + } + if ($large) { + $messages[] = str_repeat(' ', $len); + } + + foreach ($messages as &$message) { + $message = sprintf('<%s>%s', $style, $message, $style); + } + + return implode("\n", $messages); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'formatter'; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/Helper.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/Helper.php new file mode 100644 index 0000000..b2a8389 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/Helper.php @@ -0,0 +1,62 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +/** + * Helper is the base class for all helper classes. + * + * @author Fabien Potencier + */ +abstract class Helper implements HelperInterface +{ + protected $helperSet = null; + + /** + * Sets the helper set associated with this helper. + * + * @param HelperSet $helperSet A HelperSet instance + */ + public function setHelperSet(HelperSet $helperSet = null) + { + $this->helperSet = $helperSet; + } + + /** + * Gets the helper set associated with this helper. + * + * @return HelperSet A HelperSet instance + */ + public function getHelperSet() + { + return $this->helperSet; + } + + /** + * Returns the length of a string, using mb_strlen if it is available. + * + * @param string $string The string to check its length + * + * @return int The length of the string + */ + protected function strlen($string) + { + if (!function_exists('mb_strwidth')) { + return strlen($string); + } + + if (false === $encoding = mb_detect_encoding($string)) { + return strlen($string); + } + + return mb_strwidth($string, $encoding); + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/HelperInterface.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/HelperInterface.php new file mode 100644 index 0000000..6d39449 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/HelperInterface.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +/** + * HelperInterface is the interface all helpers must implement. + * + * @author Fabien Potencier + * + * @api + */ +interface HelperInterface +{ + /** + * Sets the helper set associated with this helper. + * + * @param HelperSet $helperSet A HelperSet instance + * + * @api + */ + public function setHelperSet(HelperSet $helperSet = null); + + /** + * Gets the helper set associated with this helper. + * + * @return HelperSet A HelperSet instance + * + * @api + */ + public function getHelperSet(); + + /** + * Returns the canonical name of this helper. + * + * @return string The canonical name + * + * @api + */ + public function getName(); +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/HelperSet.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/HelperSet.php new file mode 100644 index 0000000..498a1a4 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/HelperSet.php @@ -0,0 +1,104 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Command\Command; + +/** + * HelperSet represents a set of helpers to be used with a command. + * + * @author Fabien Potencier + */ +class HelperSet +{ + private $helpers; + private $command; + + /** + * Constructor. + * + * @param Helper[] $helpers An array of helper. + */ + public function __construct(array $helpers = array()) + { + $this->helpers = array(); + foreach ($helpers as $alias => $helper) { + $this->set($helper, is_int($alias) ? null : $alias); + } + } + + /** + * Sets a helper. + * + * @param HelperInterface $helper The helper instance + * @param string $alias An alias + */ + public function set(HelperInterface $helper, $alias = null) + { + $this->helpers[$helper->getName()] = $helper; + if (null !== $alias) { + $this->helpers[$alias] = $helper; + } + + $helper->setHelperSet($this); + } + + /** + * Returns true if the helper if defined. + * + * @param string $name The helper name + * + * @return bool true if the helper is defined, false otherwise + */ + public function has($name) + { + return isset($this->helpers[$name]); + } + + /** + * Gets a helper value. + * + * @param string $name The helper name + * + * @return HelperInterface The helper instance + * + * @throws \InvalidArgumentException if the helper is not defined + */ + public function get($name) + { + if (!$this->has($name)) { + throw new \InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); + } + + return $this->helpers[$name]; + } + + /** + * Sets the command associated with this helper set. + * + * @param Command $command A Command instance + */ + public function setCommand(Command $command = null) + { + $this->command = $command; + } + + /** + * Gets the command associated with this helper set. + * + * @return Command A Command instance + */ + public function getCommand() + { + return $this->command; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php new file mode 100644 index 0000000..96f10f6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php @@ -0,0 +1,455 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Output\OutputInterface; + +/** + * The Progress class provides helpers to display progress output. + * + * @author Chris Jones + * @author Fabien Potencier + */ +class ProgressHelper extends Helper +{ + const FORMAT_QUIET = ' %percent%%'; + const FORMAT_NORMAL = ' %current%/%max% [%bar%] %percent%%'; + const FORMAT_VERBOSE = ' %current%/%max% [%bar%] %percent%% Elapsed: %elapsed%'; + const FORMAT_QUIET_NOMAX = ' %current%'; + const FORMAT_NORMAL_NOMAX = ' %current% [%bar%]'; + const FORMAT_VERBOSE_NOMAX = ' %current% [%bar%] Elapsed: %elapsed%'; + + // options + private $barWidth = 28; + private $barChar = '='; + private $emptyBarChar = '-'; + private $progressChar = '>'; + private $format = null; + private $redrawFreq = 1; + + private $lastMessagesLength; + private $barCharOriginal; + + /** + * @var OutputInterface + */ + private $output; + + /** + * Current step + * + * @var int + */ + private $current; + + /** + * Maximum number of steps + * + * @var int + */ + private $max; + + /** + * Start time of the progress bar + * + * @var int + */ + private $startTime; + + /** + * List of formatting variables + * + * @var array + */ + private $defaultFormatVars = array( + 'current', + 'max', + 'bar', + 'percent', + 'elapsed', + ); + + /** + * Available formatting variables + * + * @var array + */ + private $formatVars; + + /** + * Stored format part widths (used for padding) + * + * @var array + */ + private $widths = array( + 'current' => 4, + 'max' => 4, + 'percent' => 3, + 'elapsed' => 6, + ); + + /** + * Various time formats + * + * @var array + */ + private $timeFormats = array( + array(0, '???'), + array(2, '1 sec'), + array(59, 'secs', 1), + array(60, '1 min'), + array(3600, 'mins', 60), + array(5400, '1 hr'), + array(86400, 'hrs', 3600), + array(129600, '1 day'), + array(604800, 'days', 86400), + ); + + /** + * Sets the progress bar width. + * + * @param int $size The progress bar size + */ + public function setBarWidth($size) + { + $this->barWidth = (int) $size; + } + + /** + * Sets the bar character. + * + * @param string $char A character + */ + public function setBarCharacter($char) + { + $this->barChar = $char; + } + + /** + * Sets the empty bar character. + * + * @param string $char A character + */ + public function setEmptyBarCharacter($char) + { + $this->emptyBarChar = $char; + } + + /** + * Sets the progress bar character. + * + * @param string $char A character + */ + public function setProgressCharacter($char) + { + $this->progressChar = $char; + } + + /** + * Sets the progress bar format. + * + * @param string $format The format + */ + public function setFormat($format) + { + $this->format = $format; + } + + /** + * Sets the redraw frequency. + * + * @param int $freq The frequency in steps + */ + public function setRedrawFrequency($freq) + { + $this->redrawFreq = (int) $freq; + } + + /** + * Starts the progress output. + * + * @param OutputInterface $output An Output instance + * @param int|null $max Maximum steps + */ + public function start(OutputInterface $output, $max = null) + { + $this->startTime = time(); + $this->current = 0; + $this->max = (int) $max; + $this->output = $output; + $this->lastMessagesLength = 0; + $this->barCharOriginal = ''; + + if (null === $this->format) { + switch ($output->getVerbosity()) { + case OutputInterface::VERBOSITY_QUIET: + $this->format = self::FORMAT_QUIET_NOMAX; + if ($this->max > 0) { + $this->format = self::FORMAT_QUIET; + } + break; + case OutputInterface::VERBOSITY_VERBOSE: + case OutputInterface::VERBOSITY_VERY_VERBOSE: + case OutputInterface::VERBOSITY_DEBUG: + $this->format = self::FORMAT_VERBOSE_NOMAX; + if ($this->max > 0) { + $this->format = self::FORMAT_VERBOSE; + } + break; + default: + $this->format = self::FORMAT_NORMAL_NOMAX; + if ($this->max > 0) { + $this->format = self::FORMAT_NORMAL; + } + break; + } + } + + $this->initialize(); + } + + /** + * Advances the progress output X steps. + * + * @param int $step Number of steps to advance + * @param bool $redraw Whether to redraw or not + * + * @throws \LogicException + */ + public function advance($step = 1, $redraw = false) + { + if (null === $this->startTime) { + throw new \LogicException('You must start the progress bar before calling advance().'); + } + + if (0 === $this->current) { + $redraw = true; + } + + $prevPeriod = intval($this->current / $this->redrawFreq); + + $this->current += $step; + + $currPeriod = intval($this->current / $this->redrawFreq); + if ($redraw || $prevPeriod !== $currPeriod || $this->max === $this->current) { + $this->display(); + } + } + + /** + * Sets the current progress. + * + * @param int $current The current progress + * @param bool $redraw Whether to redraw or not + * + * @throws \LogicException + */ + public function setCurrent($current, $redraw = false) + { + if (null === $this->startTime) { + throw new \LogicException('You must start the progress bar before calling setCurrent().'); + } + + $current = (int) $current; + + if ($current < $this->current) { + throw new \LogicException('You can\'t regress the progress bar'); + } + + if (0 === $this->current) { + $redraw = true; + } + + $prevPeriod = intval($this->current / $this->redrawFreq); + + $this->current = $current; + + $currPeriod = intval($this->current / $this->redrawFreq); + if ($redraw || $prevPeriod !== $currPeriod || $this->max === $this->current) { + $this->display(); + } + } + + /** + * Outputs the current progress string. + * + * @param bool $finish Forces the end result + * + * @throws \LogicException + */ + public function display($finish = false) + { + if (null === $this->startTime) { + throw new \LogicException('You must start the progress bar before calling display().'); + } + + $message = $this->format; + foreach ($this->generate($finish) as $name => $value) { + $message = str_replace("%{$name}%", $value, $message); + } + $this->overwrite($this->output, $message); + } + + /** + * Finishes the progress output. + */ + public function finish() + { + if (null === $this->startTime) { + throw new \LogicException('You must start the progress bar before calling finish().'); + } + + if (null !== $this->startTime) { + if (!$this->max) { + $this->barChar = $this->barCharOriginal; + $this->display(true); + } + $this->startTime = null; + $this->output->writeln(''); + $this->output = null; + } + } + + /** + * Initializes the progress helper. + */ + private function initialize() + { + $this->formatVars = array(); + foreach ($this->defaultFormatVars as $var) { + if (false !== strpos($this->format, "%{$var}%")) { + $this->formatVars[$var] = true; + } + } + + if ($this->max > 0) { + $this->widths['max'] = $this->strlen($this->max); + $this->widths['current'] = $this->widths['max']; + } else { + $this->barCharOriginal = $this->barChar; + $this->barChar = $this->emptyBarChar; + } + } + + /** + * Generates the array map of format variables to values. + * + * @param bool $finish Forces the end result + * + * @return array Array of format vars and values + */ + private function generate($finish = false) + { + $vars = array(); + $percent = 0; + if ($this->max > 0) { + $percent = (float) $this->current / $this->max; + } + + if (isset($this->formatVars['bar'])) { + $completeBars = 0; + + if ($this->max > 0) { + $completeBars = floor($percent * $this->barWidth); + } else { + if (!$finish) { + $completeBars = floor($this->current % $this->barWidth); + } else { + $completeBars = $this->barWidth; + } + } + + $emptyBars = $this->barWidth - $completeBars - $this->strlen($this->progressChar); + $bar = str_repeat($this->barChar, $completeBars); + if ($completeBars < $this->barWidth) { + $bar .= $this->progressChar; + $bar .= str_repeat($this->emptyBarChar, $emptyBars); + } + + $vars['bar'] = $bar; + } + + if (isset($this->formatVars['elapsed'])) { + $elapsed = time() - $this->startTime; + $vars['elapsed'] = str_pad($this->humaneTime($elapsed), $this->widths['elapsed'], ' ', STR_PAD_LEFT); + } + + if (isset($this->formatVars['current'])) { + $vars['current'] = str_pad($this->current, $this->widths['current'], ' ', STR_PAD_LEFT); + } + + if (isset($this->formatVars['max'])) { + $vars['max'] = $this->max; + } + + if (isset($this->formatVars['percent'])) { + $vars['percent'] = str_pad(floor($percent * 100), $this->widths['percent'], ' ', STR_PAD_LEFT); + } + + return $vars; + } + + /** + * Converts seconds into human-readable format. + * + * @param int $secs Number of seconds + * + * @return string Time in readable format + */ + private function humaneTime($secs) + { + $text = ''; + foreach ($this->timeFormats as $format) { + if ($secs < $format[0]) { + if (count($format) == 2) { + $text = $format[1]; + break; + } else { + $text = ceil($secs / $format[2]).' '.$format[1]; + break; + } + } + } + + return $text; + } + + /** + * Overwrites a previous message to the output. + * + * @param OutputInterface $output An Output instance + * @param string $message The message + */ + private function overwrite(OutputInterface $output, $message) + { + $length = $this->strlen($message); + + // append whitespace to match the last line's length + if (null !== $this->lastMessagesLength && $this->lastMessagesLength > $length) { + $message = str_pad($message, $this->lastMessagesLength, "\x20", STR_PAD_RIGHT); + } + + // carriage return + $output->write("\x0D"); + $output->write($message); + + $this->lastMessagesLength = $this->strlen($message); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'progress'; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php new file mode 100644 index 0000000..285162d --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php @@ -0,0 +1,490 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Output\OutputInterface; +use InvalidArgumentException; + +/** + * Provides helpers to display table output. + * + * @author Саша Стаменковић + */ +class TableHelper extends Helper +{ + const LAYOUT_DEFAULT = 0; + const LAYOUT_BORDERLESS = 1; + + /** + * Table headers. + * + * @var array + */ + private $headers = array(); + + /** + * Table rows. + * + * @var array + */ + private $rows = array(); + + // Rendering options + private $paddingChar; + private $horizontalBorderChar; + private $verticalBorderChar; + private $crossingChar; + private $cellHeaderFormat; + private $cellRowFormat; + private $borderFormat; + private $padType; + + /** + * Column widths cache. + * + * @var array + */ + private $columnWidths = array(); + + /** + * Number of columns cache. + * + * @var array + */ + private $numberOfColumns; + + /** + * @var OutputInterface + */ + private $output; + + public function __construct() + { + $this->setLayout(self::LAYOUT_DEFAULT); + } + + /** + * Sets table layout type. + * + * @param int $layout self::LAYOUT_* + * + * @return TableHelper + * + * @throws InvalidArgumentException when the table layout is not known + */ + public function setLayout($layout) + { + switch ($layout) { + case self::LAYOUT_BORDERLESS: + $this + ->setPaddingChar(' ') + ->setHorizontalBorderChar('=') + ->setVerticalBorderChar(' ') + ->setCrossingChar(' ') + ->setCellHeaderFormat('%s') + ->setCellRowFormat('%s') + ->setBorderFormat('%s') + ->setPadType(STR_PAD_RIGHT) + ; + break; + + case self::LAYOUT_DEFAULT: + $this + ->setPaddingChar(' ') + ->setHorizontalBorderChar('-') + ->setVerticalBorderChar('|') + ->setCrossingChar('+') + ->setCellHeaderFormat('%s') + ->setCellRowFormat('%s') + ->setBorderFormat('%s') + ->setPadType(STR_PAD_RIGHT) + ; + break; + + default: + throw new InvalidArgumentException(sprintf('Invalid table layout "%s".', $layout)); + break; + }; + + return $this; + } + + public function setHeaders(array $headers) + { + $this->headers = array_values($headers); + + return $this; + } + + public function setRows(array $rows) + { + $this->rows = array(); + + return $this->addRows($rows); + } + + public function addRows(array $rows) + { + foreach ($rows as $row) { + $this->addRow($row); + } + + return $this; + } + + public function addRow(array $row) + { + $this->rows[] = array_values($row); + + $keys = array_keys($this->rows); + $rowKey = array_pop($keys); + + foreach ($row as $key => $cellValue) { + if (!strstr($cellValue, "\n")) { + continue; + } + + $lines = explode("\n", $cellValue); + $this->rows[$rowKey][$key] = $lines[0]; + unset($lines[0]); + + foreach ($lines as $lineKey => $line) { + $nextRowKey = $rowKey + $lineKey + 1; + + if (isset($this->rows[$nextRowKey])) { + $this->rows[$nextRowKey][$key] = $line; + } else { + $this->rows[$nextRowKey] = array($key => $line); + } + } + } + + return $this; + } + + public function setRow($column, array $row) + { + $this->rows[$column] = $row; + + return $this; + } + + /** + * Sets padding character, used for cell padding. + * + * @param string $paddingChar + * + * @return TableHelper + */ + public function setPaddingChar($paddingChar) + { + $this->paddingChar = $paddingChar; + + return $this; + } + + /** + * Sets horizontal border character. + * + * @param string $horizontalBorderChar + * + * @return TableHelper + */ + public function setHorizontalBorderChar($horizontalBorderChar) + { + $this->horizontalBorderChar = $horizontalBorderChar; + + return $this; + } + + /** + * Sets vertical border character. + * + * @param string $verticalBorderChar + * + * @return TableHelper + */ + public function setVerticalBorderChar($verticalBorderChar) + { + $this->verticalBorderChar = $verticalBorderChar; + + return $this; + } + + /** + * Sets crossing character. + * + * @param string $crossingChar + * + * @return TableHelper + */ + public function setCrossingChar($crossingChar) + { + $this->crossingChar = $crossingChar; + + return $this; + } + + /** + * Sets header cell format. + * + * @param string $cellHeaderFormat + * + * @return TableHelper + */ + public function setCellHeaderFormat($cellHeaderFormat) + { + $this->cellHeaderFormat = $cellHeaderFormat; + + return $this; + } + + /** + * Sets row cell format. + * + * @param string $cellRowFormat + * + * @return TableHelper + */ + public function setCellRowFormat($cellRowFormat) + { + $this->cellRowFormat = $cellRowFormat; + + return $this; + } + + /** + * Sets table border format. + * + * @param string $borderFormat + * + * @return TableHelper + */ + public function setBorderFormat($borderFormat) + { + $this->borderFormat = $borderFormat; + + return $this; + } + + /** + * Sets cell padding type. + * + * @param int $padType STR_PAD_* + * + * @return TableHelper + */ + public function setPadType($padType) + { + $this->padType = $padType; + + return $this; + } + + /** + * Renders table to output. + * + * Example: + * +---------------+-----------------------+------------------+ + * | ISBN | Title | Author | + * +---------------+-----------------------+------------------+ + * | 99921-58-10-7 | Divine Comedy | Dante Alighieri | + * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | + * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | + * +---------------+-----------------------+------------------+ + * + * @param OutputInterface $output + */ + public function render(OutputInterface $output) + { + $this->output = $output; + + $this->renderRowSeparator(); + $this->renderRow($this->headers, $this->cellHeaderFormat); + if (!empty($this->headers)) { + $this->renderRowSeparator(); + } + foreach ($this->rows as $row) { + $this->renderRow($row, $this->cellRowFormat); + } + if (!empty($this->rows)) { + $this->renderRowSeparator(); + } + + $this->cleanup(); + } + + /** + * Renders horizontal header separator. + * + * Example: +-----+-----------+-------+ + */ + private function renderRowSeparator() + { + if (0 === $count = $this->getNumberOfColumns()) { + return; + } + + $markup = $this->crossingChar; + for ($column = 0; $column < $count; $column++) { + $markup .= str_repeat($this->horizontalBorderChar, $this->getColumnWidth($column)) + .$this->crossingChar + ; + } + + $this->output->writeln(sprintf($this->borderFormat, $markup)); + } + + /** + * Renders vertical column separator. + */ + private function renderColumnSeparator() + { + $this->output->write(sprintf($this->borderFormat, $this->verticalBorderChar)); + } + + /** + * Renders table row. + * + * Example: | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | + * + * @param array $row + * @param string $cellFormat + */ + private function renderRow(array $row, $cellFormat) + { + if (empty($row)) { + return; + } + + $this->renderColumnSeparator(); + for ($column = 0, $count = $this->getNumberOfColumns(); $column < $count; $column++) { + $this->renderCell($row, $column, $cellFormat); + $this->renderColumnSeparator(); + } + $this->output->writeln(''); + } + + /** + * Renders table cell with padding. + * + * @param array $row + * @param int $column + * @param string $cellFormat + */ + private function renderCell(array $row, $column, $cellFormat) + { + $cell = isset($row[$column]) ? $row[$column] : ''; + $width = $this->getColumnWidth($column); + + // str_pad won't work properly with multi-byte strings, we need to fix the padding + if (function_exists('mb_strlen') && false !== $encoding = mb_detect_encoding($cell)) { + $width += strlen($cell) - mb_strlen($cell, $encoding); + } + + $width += $this->strlen($cell) - $this->computeLengthWithoutDecoration($cell); + + $this->output->write(sprintf( + $cellFormat, + str_pad( + $this->paddingChar.$cell.$this->paddingChar, + $width, + $this->paddingChar, + $this->padType + ) + )); + } + + /** + * Gets number of columns for this table. + * + * @return int + */ + private function getNumberOfColumns() + { + if (null !== $this->numberOfColumns) { + return $this->numberOfColumns; + } + + $columns = array(0); + $columns[] = count($this->headers); + foreach ($this->rows as $row) { + $columns[] = count($row); + } + + return $this->numberOfColumns = max($columns); + } + + /** + * Gets column width. + * + * @param int $column + * + * @return int + */ + private function getColumnWidth($column) + { + if (isset($this->columnWidths[$column])) { + return $this->columnWidths[$column]; + } + + $lengths = array(0); + $lengths[] = $this->getCellWidth($this->headers, $column); + foreach ($this->rows as $row) { + $lengths[] = $this->getCellWidth($row, $column); + } + + return $this->columnWidths[$column] = max($lengths) + 2; + } + + /** + * Gets cell width. + * + * @param array $row + * @param int $column + * + * @return int + */ + private function getCellWidth(array $row, $column) + { + return isset($row[$column]) ? $this->computeLengthWithoutDecoration($row[$column]) : 0; + } + + /** + * Called after rendering to cleanup cache data. + */ + private function cleanup() + { + $this->columnWidths = array(); + $this->numberOfColumns = null; + } + + private function computeLengthWithoutDecoration($string) + { + $formatter = $this->output->getFormatter(); + $isDecorated = $formatter->isDecorated(); + $formatter->setDecorated(false); + + $string = $formatter->format($string); + $formatter->setDecorated($isDecorated); + + return $this->strlen($string); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'table'; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php new file mode 100644 index 0000000..1e02a1c --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php @@ -0,0 +1,351 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +/** + * ArgvInput represents an input coming from the CLI arguments. + * + * Usage: + * + * $input = new ArgvInput(); + * + * By default, the `$_SERVER['argv']` array is used for the input values. + * + * This can be overridden by explicitly passing the input values in the constructor: + * + * $input = new ArgvInput($_SERVER['argv']); + * + * If you pass it yourself, don't forget that the first element of the array + * is the name of the running application. + * + * When passing an argument to the constructor, be sure that it respects + * the same rules as the argv one. It's almost always better to use the + * `StringInput` when you want to provide your own input. + * + * @author Fabien Potencier + * + * @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html + * @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02 + * + * @api + */ +class ArgvInput extends Input +{ + private $tokens; + private $parsed; + + /** + * Constructor. + * + * @param array $argv An array of parameters from the CLI (in the argv format) + * @param InputDefinition $definition A InputDefinition instance + * + * @api + */ + public function __construct(array $argv = null, InputDefinition $definition = null) + { + if (null === $argv) { + $argv = $_SERVER['argv']; + } + + // strip the application name + array_shift($argv); + + $this->tokens = $argv; + + parent::__construct($definition); + } + + protected function setTokens(array $tokens) + { + $this->tokens = $tokens; + } + + /** + * Processes command line arguments. + */ + protected function parse() + { + $parseOptions = true; + $this->parsed = $this->tokens; + while (null !== $token = array_shift($this->parsed)) { + if ($parseOptions && '' == $token) { + $this->parseArgument($token); + } elseif ($parseOptions && '--' == $token) { + $parseOptions = false; + } elseif ($parseOptions && 0 === strpos($token, '--')) { + $this->parseLongOption($token); + } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) { + $this->parseShortOption($token); + } else { + $this->parseArgument($token); + } + } + } + + /** + * Parses a short option. + * + * @param string $token The current token. + */ + private function parseShortOption($token) + { + $name = substr($token, 1); + + if (strlen($name) > 1) { + if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) { + // an option with a value (with no space) + $this->addShortOption($name[0], substr($name, 1)); + } else { + $this->parseShortOptionSet($name); + } + } else { + $this->addShortOption($name, null); + } + } + + /** + * Parses a short option set. + * + * @param string $name The current token + * + * @throws \RuntimeException When option given doesn't exist + */ + private function parseShortOptionSet($name) + { + $len = strlen($name); + for ($i = 0; $i < $len; $i++) { + if (!$this->definition->hasShortcut($name[$i])) { + throw new \RuntimeException(sprintf('The "-%s" option does not exist.', $name[$i])); + } + + $option = $this->definition->getOptionForShortcut($name[$i]); + if ($option->acceptValue()) { + $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1)); + + break; + } else { + $this->addLongOption($option->getName(), null); + } + } + } + + /** + * Parses a long option. + * + * @param string $token The current token + */ + private function parseLongOption($token) + { + $name = substr($token, 2); + + if (false !== $pos = strpos($name, '=')) { + $this->addLongOption(substr($name, 0, $pos), substr($name, $pos + 1)); + } else { + $this->addLongOption($name, null); + } + } + + /** + * Parses an argument. + * + * @param string $token The current token + * + * @throws \RuntimeException When too many arguments are given + */ + private function parseArgument($token) + { + $c = count($this->arguments); + + // if input is expecting another argument, add it + if ($this->definition->hasArgument($c)) { + $arg = $this->definition->getArgument($c); + $this->arguments[$arg->getName()] = $arg->isArray() ? array($token) : $token; + + // if last argument isArray(), append token to last argument + } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { + $arg = $this->definition->getArgument($c - 1); + $this->arguments[$arg->getName()][] = $token; + + // unexpected argument + } else { + throw new \RuntimeException('Too many arguments.'); + } + } + + /** + * Adds a short option value. + * + * @param string $shortcut The short option key + * @param mixed $value The value for the option + * + * @throws \RuntimeException When option given doesn't exist + */ + private function addShortOption($shortcut, $value) + { + if (!$this->definition->hasShortcut($shortcut)) { + throw new \RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); + } + + $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); + } + + /** + * Adds a long option value. + * + * @param string $name The long option key + * @param mixed $value The value for the option + * + * @throws \RuntimeException When option given doesn't exist + */ + private function addLongOption($name, $value) + { + if (!$this->definition->hasOption($name)) { + throw new \RuntimeException(sprintf('The "--%s" option does not exist.', $name)); + } + + $option = $this->definition->getOption($name); + + // Convert false values (from a previous call to substr()) to null + if (false === $value) { + $value = null; + } + + if (null !== $value && !$option->acceptValue()) { + throw new \RuntimeException(sprintf('The "--%s" option does not accept a value.', $name, $value)); + } + + if (null === $value && $option->acceptValue() && count($this->parsed)) { + // if option accepts an optional or mandatory argument + // let's see if there is one provided + $next = array_shift($this->parsed); + if (isset($next[0]) && '-' !== $next[0]) { + $value = $next; + } elseif (empty($next)) { + $value = ''; + } else { + array_unshift($this->parsed, $next); + } + } + + if (null === $value) { + if ($option->isValueRequired()) { + throw new \RuntimeException(sprintf('The "--%s" option requires a value.', $name)); + } + + if (!$option->isArray()) { + $value = $option->isValueOptional() ? $option->getDefault() : true; + } + } + + if ($option->isArray()) { + $this->options[$name][] = $value; + } else { + $this->options[$name] = $value; + } + } + + /** + * Returns the first argument from the raw parameters (not parsed). + * + * @return string The value of the first argument or null otherwise + */ + public function getFirstArgument() + { + foreach ($this->tokens as $token) { + if ($token && '-' === $token[0]) { + continue; + } + + return $token; + } + } + + /** + * Returns true if the raw parameters (not parsed) contain a value. + * + * This method is to be used to introspect the input parameters + * before they have been validated. It must be used carefully. + * + * @param string|array $values The value(s) to look for in the raw parameters (can be an array) + * + * @return bool true if the value is contained in the raw parameters + */ + public function hasParameterOption($values) + { + $values = (array) $values; + + foreach ($this->tokens as $token) { + foreach ($values as $value) { + if ($token === $value || 0 === strpos($token, $value.'=')) { + return true; + } + } + } + + return false; + } + + /** + * Returns the value of a raw option (not parsed). + * + * This method is to be used to introspect the input parameters + * before they have been validated. It must be used carefully. + * + * @param string|array $values The value(s) to look for in the raw parameters (can be an array) + * @param mixed $default The default value to return if no result is found + * + * @return mixed The option value + */ + public function getParameterOption($values, $default = false) + { + $values = (array) $values; + + $tokens = $this->tokens; + while ($token = array_shift($tokens)) { + foreach ($values as $value) { + if ($token === $value || 0 === strpos($token, $value.'=')) { + if (false !== $pos = strpos($token, '=')) { + return substr($token, $pos + 1); + } + + return array_shift($tokens); + } + } + } + + return $default; + } + + /** + * Returns a stringified representation of the args passed to the command + * + * @return string + */ + public function __toString() + { + $self = $this; + $tokens = array_map(function ($token) use ($self) { + if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { + return $match[1].$self->escapeToken($match[2]); + } + + if ($token && $token[0] !== '-') { + return $self->escapeToken($token); + } + + return $token; + }, $this->tokens); + + return implode(' ', $tokens); + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/ArrayInput.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/ArrayInput.php new file mode 100644 index 0000000..e723f75 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/ArrayInput.php @@ -0,0 +1,209 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +/** + * ArrayInput represents an input provided as an array. + * + * Usage: + * + * $input = new ArrayInput(array('name' => 'foo', '--bar' => 'foobar')); + * + * @author Fabien Potencier + * + * @api + */ +class ArrayInput extends Input +{ + private $parameters; + + /** + * Constructor. + * + * @param array $parameters An array of parameters + * @param InputDefinition $definition A InputDefinition instance + * + * @api + */ + public function __construct(array $parameters, InputDefinition $definition = null) + { + $this->parameters = $parameters; + + parent::__construct($definition); + } + + /** + * Returns the first argument from the raw parameters (not parsed). + * + * @return string The value of the first argument or null otherwise + */ + public function getFirstArgument() + { + foreach ($this->parameters as $key => $value) { + if ($key && '-' === $key[0]) { + continue; + } + + return $value; + } + } + + /** + * Returns true if the raw parameters (not parsed) contain a value. + * + * This method is to be used to introspect the input parameters + * before they have been validated. It must be used carefully. + * + * @param string|array $values The values to look for in the raw parameters (can be an array) + * + * @return bool true if the value is contained in the raw parameters + */ + public function hasParameterOption($values) + { + $values = (array) $values; + + foreach ($this->parameters as $k => $v) { + if (!is_int($k)) { + $v = $k; + } + + if (in_array($v, $values)) { + return true; + } + } + + return false; + } + + /** + * Returns the value of a raw option (not parsed). + * + * This method is to be used to introspect the input parameters + * before they have been validated. It must be used carefully. + * + * @param string|array $values The value(s) to look for in the raw parameters (can be an array) + * @param mixed $default The default value to return if no result is found + * + * @return mixed The option value + */ + public function getParameterOption($values, $default = false) + { + $values = (array) $values; + + foreach ($this->parameters as $k => $v) { + if (is_int($k) && in_array($v, $values)) { + return true; + } elseif (in_array($k, $values)) { + return $v; + } + } + + return $default; + } + + /** + * Returns a stringified representation of the args passed to the command + * + * @return string + */ + public function __toString() + { + $params = array(); + foreach ($this->parameters as $param => $val) { + if ($param && '-' === $param[0]) { + $params[] = $param.('' != $val ? '='.$this->escapeToken($val) : ''); + } else { + $params[] = $this->escapeToken($val); + } + } + + return implode(' ', $params); + } + + /** + * Processes command line arguments. + */ + protected function parse() + { + foreach ($this->parameters as $key => $value) { + if (0 === strpos($key, '--')) { + $this->addLongOption(substr($key, 2), $value); + } elseif ('-' === $key[0]) { + $this->addShortOption(substr($key, 1), $value); + } else { + $this->addArgument($key, $value); + } + } + } + + /** + * Adds a short option value. + * + * @param string $shortcut The short option key + * @param mixed $value The value for the option + * + * @throws \InvalidArgumentException When option given doesn't exist + */ + private function addShortOption($shortcut, $value) + { + if (!$this->definition->hasShortcut($shortcut)) { + throw new \InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); + } + + $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); + } + + /** + * Adds a long option value. + * + * @param string $name The long option key + * @param mixed $value The value for the option + * + * @throws \InvalidArgumentException When option given doesn't exist + * @throws \InvalidArgumentException When a required value is missing + */ + private function addLongOption($name, $value) + { + if (!$this->definition->hasOption($name)) { + throw new \InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); + } + + $option = $this->definition->getOption($name); + + if (null === $value) { + if ($option->isValueRequired()) { + throw new \InvalidArgumentException(sprintf('The "--%s" option requires a value.', $name)); + } + + $value = $option->isValueOptional() ? $option->getDefault() : true; + } + + $this->options[$name] = $value; + } + + /** + * Adds an argument value. + * + * @param string $name The argument name + * @param mixed $value The value for the argument + * + * @throws \InvalidArgumentException When argument given doesn't exist + */ + private function addArgument($name, $value) + { + if (!$this->definition->hasArgument($name)) { + throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + } + + $this->arguments[$name] = $value; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/Input.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/Input.php new file mode 100644 index 0000000..7d078c3 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/Input.php @@ -0,0 +1,225 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +/** + * Input is the base class for all concrete Input classes. + * + * Three concrete classes are provided by default: + * + * * `ArgvInput`: The input comes from the CLI arguments (argv) + * * `StringInput`: The input is provided as a string + * * `ArrayInput`: The input is provided as an array + * + * @author Fabien Potencier + */ +abstract class Input implements InputInterface +{ + protected $definition; + protected $options; + protected $arguments; + protected $interactive = true; + + /** + * Constructor. + * + * @param InputDefinition $definition A InputDefinition instance + */ + public function __construct(InputDefinition $definition = null) + { + if (null === $definition) { + $this->arguments = array(); + $this->options = array(); + $this->definition = new InputDefinition(); + } else { + $this->bind($definition); + $this->validate(); + } + } + + /** + * Binds the current Input instance with the given arguments and options. + * + * @param InputDefinition $definition A InputDefinition instance + */ + public function bind(InputDefinition $definition) + { + $this->arguments = array(); + $this->options = array(); + $this->definition = $definition; + + $this->parse(); + } + + /** + * Processes command line arguments. + */ + abstract protected function parse(); + + /** + * Validates the input. + * + * @throws \RuntimeException When not enough arguments are given + */ + public function validate() + { + if (count($this->arguments) < $this->definition->getArgumentRequiredCount()) { + throw new \RuntimeException('Not enough arguments.'); + } + } + + /** + * Checks if the input is interactive. + * + * @return bool Returns true if the input is interactive + */ + public function isInteractive() + { + return $this->interactive; + } + + /** + * Sets the input interactivity. + * + * @param bool $interactive If the input should be interactive + */ + public function setInteractive($interactive) + { + $this->interactive = (bool) $interactive; + } + + /** + * Returns the argument values. + * + * @return array An array of argument values + */ + public function getArguments() + { + return array_merge($this->definition->getArgumentDefaults(), $this->arguments); + } + + /** + * Returns the argument value for a given argument name. + * + * @param string $name The argument name + * + * @return mixed The argument value + * + * @throws \InvalidArgumentException When argument given doesn't exist + */ + public function getArgument($name) + { + if (!$this->definition->hasArgument($name)) { + throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + } + + return isset($this->arguments[$name]) ? $this->arguments[$name] : $this->definition->getArgument($name)->getDefault(); + } + + /** + * Sets an argument value by name. + * + * @param string $name The argument name + * @param string $value The argument value + * + * @throws \InvalidArgumentException When argument given doesn't exist + */ + public function setArgument($name, $value) + { + if (!$this->definition->hasArgument($name)) { + throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + } + + $this->arguments[$name] = $value; + } + + /** + * Returns true if an InputArgument object exists by name or position. + * + * @param string|int $name The InputArgument name or position + * + * @return bool true if the InputArgument object exists, false otherwise + */ + public function hasArgument($name) + { + return $this->definition->hasArgument($name); + } + + /** + * Returns the options values. + * + * @return array An array of option values + */ + public function getOptions() + { + return array_merge($this->definition->getOptionDefaults(), $this->options); + } + + /** + * Returns the option value for a given option name. + * + * @param string $name The option name + * + * @return mixed The option value + * + * @throws \InvalidArgumentException When option given doesn't exist + */ + public function getOption($name) + { + if (!$this->definition->hasOption($name)) { + throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); + } + + return isset($this->options[$name]) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); + } + + /** + * Sets an option value by name. + * + * @param string $name The option name + * @param string|bool $value The option value + * + * @throws \InvalidArgumentException When option given doesn't exist + */ + public function setOption($name, $value) + { + if (!$this->definition->hasOption($name)) { + throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); + } + + $this->options[$name] = $value; + } + + /** + * Returns true if an InputOption object exists by name. + * + * @param string $name The InputOption name + * + * @return bool true if the InputOption object exists, false otherwise + */ + public function hasOption($name) + { + return $this->definition->hasOption($name); + } + + /** + * Escapes a token through escapeshellarg if it contains unsafe chars + * + * @param string $token + * + * @return string + */ + public function escapeToken($token) + { + return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputArgument.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputArgument.php new file mode 100644 index 0000000..bf9c99e --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputArgument.php @@ -0,0 +1,132 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +/** + * Represents a command line argument. + * + * @author Fabien Potencier + * + * @api + */ +class InputArgument +{ + const REQUIRED = 1; + const OPTIONAL = 2; + const IS_ARRAY = 4; + + private $name; + private $mode; + private $default; + private $description; + + /** + * Constructor. + * + * @param string $name The argument name + * @param int $mode The argument mode: self::REQUIRED or self::OPTIONAL + * @param string $description A description text + * @param mixed $default The default value (for self::OPTIONAL mode only) + * + * @throws \InvalidArgumentException When argument mode is not valid + * + * @api + */ + public function __construct($name, $mode = null, $description = '', $default = null) + { + if (null === $mode) { + $mode = self::OPTIONAL; + } elseif (!is_int($mode) || $mode > 7 || $mode < 1) { + throw new \InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode)); + } + + $this->name = $name; + $this->mode = $mode; + $this->description = $description; + + $this->setDefault($default); + } + + /** + * Returns the argument name. + * + * @return string The argument name + */ + public function getName() + { + return $this->name; + } + + /** + * Returns true if the argument is required. + * + * @return bool true if parameter mode is self::REQUIRED, false otherwise + */ + public function isRequired() + { + return self::REQUIRED === (self::REQUIRED & $this->mode); + } + + /** + * Returns true if the argument can take multiple values. + * + * @return bool true if mode is self::IS_ARRAY, false otherwise + */ + public function isArray() + { + return self::IS_ARRAY === (self::IS_ARRAY & $this->mode); + } + + /** + * Sets the default value. + * + * @param mixed $default The default value + * + * @throws \LogicException When incorrect default value is given + */ + public function setDefault($default = null) + { + if (self::REQUIRED === $this->mode && null !== $default) { + throw new \LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.'); + } + + if ($this->isArray()) { + if (null === $default) { + $default = array(); + } elseif (!is_array($default)) { + throw new \LogicException('A default value for an array argument must be an array.'); + } + } + + $this->default = $default; + } + + /** + * Returns the default value. + * + * @return mixed The default value + */ + public function getDefault() + { + return $this->default; + } + + /** + * Returns the description text. + * + * @return string The description text + */ + public function getDescription() + { + return $this->description; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputDefinition.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputDefinition.php new file mode 100644 index 0000000..d45835c --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputDefinition.php @@ -0,0 +1,448 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +if (!defined('JSON_UNESCAPED_UNICODE')) { + define('JSON_UNESCAPED_SLASHES', 64); + define('JSON_UNESCAPED_UNICODE', 256); +} + +use Symfony\Component\Console\Descriptor\TextDescriptor; +use Symfony\Component\Console\Descriptor\XmlDescriptor; + +/** + * A InputDefinition represents a set of valid command line arguments and options. + * + * Usage: + * + * $definition = new InputDefinition(array( + * new InputArgument('name', InputArgument::REQUIRED), + * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED), + * )); + * + * @author Fabien Potencier + * + * @api + */ +class InputDefinition +{ + private $arguments; + private $requiredCount; + private $hasAnArrayArgument = false; + private $hasOptional; + private $options; + private $shortcuts; + + /** + * Constructor. + * + * @param array $definition An array of InputArgument and InputOption instance + * + * @api + */ + public function __construct(array $definition = array()) + { + $this->setDefinition($definition); + } + + /** + * Sets the definition of the input. + * + * @param array $definition The definition array + * + * @api + */ + public function setDefinition(array $definition) + { + $arguments = array(); + $options = array(); + foreach ($definition as $item) { + if ($item instanceof InputOption) { + $options[] = $item; + } else { + $arguments[] = $item; + } + } + + $this->setArguments($arguments); + $this->setOptions($options); + } + + /** + * Sets the InputArgument objects. + * + * @param InputArgument[] $arguments An array of InputArgument objects + * + * @api + */ + public function setArguments($arguments = array()) + { + $this->arguments = array(); + $this->requiredCount = 0; + $this->hasOptional = false; + $this->hasAnArrayArgument = false; + $this->addArguments($arguments); + } + + /** + * Adds an array of InputArgument objects. + * + * @param InputArgument[] $arguments An array of InputArgument objects + * + * @api + */ + public function addArguments($arguments = array()) + { + if (null !== $arguments) { + foreach ($arguments as $argument) { + $this->addArgument($argument); + } + } + } + + /** + * Adds an InputArgument object. + * + * @param InputArgument $argument An InputArgument object + * + * @throws \LogicException When incorrect argument is given + * + * @api + */ + public function addArgument(InputArgument $argument) + { + if (isset($this->arguments[$argument->getName()])) { + throw new \LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName())); + } + + if ($this->hasAnArrayArgument) { + throw new \LogicException('Cannot add an argument after an array argument.'); + } + + if ($argument->isRequired() && $this->hasOptional) { + throw new \LogicException('Cannot add a required argument after an optional one.'); + } + + if ($argument->isArray()) { + $this->hasAnArrayArgument = true; + } + + if ($argument->isRequired()) { + ++$this->requiredCount; + } else { + $this->hasOptional = true; + } + + $this->arguments[$argument->getName()] = $argument; + } + + /** + * Returns an InputArgument by name or by position. + * + * @param string|int $name The InputArgument name or position + * + * @return InputArgument An InputArgument object + * + * @throws \InvalidArgumentException When argument given doesn't exist + * + * @api + */ + public function getArgument($name) + { + if (!$this->hasArgument($name)) { + throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + } + + $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments; + + return $arguments[$name]; + } + + /** + * Returns true if an InputArgument object exists by name or position. + * + * @param string|int $name The InputArgument name or position + * + * @return bool true if the InputArgument object exists, false otherwise + * + * @api + */ + public function hasArgument($name) + { + $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments; + + return isset($arguments[$name]); + } + + /** + * Gets the array of InputArgument objects. + * + * @return InputArgument[] An array of InputArgument objects + * + * @api + */ + public function getArguments() + { + return $this->arguments; + } + + /** + * Returns the number of InputArguments. + * + * @return int The number of InputArguments + */ + public function getArgumentCount() + { + return $this->hasAnArrayArgument ? PHP_INT_MAX : count($this->arguments); + } + + /** + * Returns the number of required InputArguments. + * + * @return int The number of required InputArguments + */ + public function getArgumentRequiredCount() + { + return $this->requiredCount; + } + + /** + * Gets the default values. + * + * @return array An array of default values + */ + public function getArgumentDefaults() + { + $values = array(); + foreach ($this->arguments as $argument) { + $values[$argument->getName()] = $argument->getDefault(); + } + + return $values; + } + + /** + * Sets the InputOption objects. + * + * @param InputOption[] $options An array of InputOption objects + * + * @api + */ + public function setOptions($options = array()) + { + $this->options = array(); + $this->shortcuts = array(); + $this->addOptions($options); + } + + /** + * Adds an array of InputOption objects. + * + * @param InputOption[] $options An array of InputOption objects + * + * @api + */ + public function addOptions($options = array()) + { + foreach ($options as $option) { + $this->addOption($option); + } + } + + /** + * Adds an InputOption object. + * + * @param InputOption $option An InputOption object + * + * @throws \LogicException When option given already exist + * + * @api + */ + public function addOption(InputOption $option) + { + if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) { + throw new \LogicException(sprintf('An option named "%s" already exists.', $option->getName())); + } + + if ($option->getShortcut()) { + foreach (explode('|', $option->getShortcut()) as $shortcut) { + if (isset($this->shortcuts[$shortcut]) && !$option->equals($this->options[$this->shortcuts[$shortcut]])) { + throw new \LogicException(sprintf('An option with shortcut "%s" already exists.', $shortcut)); + } + } + } + + $this->options[$option->getName()] = $option; + if ($option->getShortcut()) { + foreach (explode('|', $option->getShortcut()) as $shortcut) { + $this->shortcuts[$shortcut] = $option->getName(); + } + } + } + + /** + * Returns an InputOption by name. + * + * @param string $name The InputOption name + * + * @return InputOption A InputOption object + * + * @throws \InvalidArgumentException When option given doesn't exist + * + * @api + */ + public function getOption($name) + { + if (!$this->hasOption($name)) { + throw new \InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); + } + + return $this->options[$name]; + } + + /** + * Returns true if an InputOption object exists by name. + * + * @param string $name The InputOption name + * + * @return bool true if the InputOption object exists, false otherwise + * + * @api + */ + public function hasOption($name) + { + return isset($this->options[$name]); + } + + /** + * Gets the array of InputOption objects. + * + * @return InputOption[] An array of InputOption objects + * + * @api + */ + public function getOptions() + { + return $this->options; + } + + /** + * Returns true if an InputOption object exists by shortcut. + * + * @param string $name The InputOption shortcut + * + * @return bool true if the InputOption object exists, false otherwise + */ + public function hasShortcut($name) + { + return isset($this->shortcuts[$name]); + } + + /** + * Gets an InputOption by shortcut. + * + * @param string $shortcut the Shortcut name + * + * @return InputOption An InputOption object + */ + public function getOptionForShortcut($shortcut) + { + return $this->getOption($this->shortcutToName($shortcut)); + } + + /** + * Gets an array of default values. + * + * @return array An array of all default values + */ + public function getOptionDefaults() + { + $values = array(); + foreach ($this->options as $option) { + $values[$option->getName()] = $option->getDefault(); + } + + return $values; + } + + /** + * Returns the InputOption name given a shortcut. + * + * @param string $shortcut The shortcut + * + * @return string The InputOption name + * + * @throws \InvalidArgumentException When option given does not exist + */ + private function shortcutToName($shortcut) + { + if (!isset($this->shortcuts[$shortcut])) { + throw new \InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); + } + + return $this->shortcuts[$shortcut]; + } + + /** + * Gets the synopsis. + * + * @return string The synopsis + */ + public function getSynopsis() + { + $elements = array(); + foreach ($this->getOptions() as $option) { + $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; + $elements[] = sprintf('['.($option->isValueRequired() ? '%s--%s="..."' : ($option->isValueOptional() ? '%s--%s[="..."]' : '%s--%s')).']', $shortcut, $option->getName()); + } + + foreach ($this->getArguments() as $argument) { + $elements[] = sprintf($argument->isRequired() ? '%s' : '[%s]', $argument->getName().($argument->isArray() ? '1' : '')); + + if ($argument->isArray()) { + $elements[] = sprintf('... [%sN]', $argument->getName()); + } + } + + return implode(' ', $elements); + } + + /** + * Returns a textual representation of the InputDefinition. + * + * @return string A string representing the InputDefinition + * + * @deprecated Deprecated since version 2.3, to be removed in 3.0. + */ + public function asText() + { + $descriptor = new TextDescriptor(); + + return $descriptor->describe($this); + } + + /** + * Returns an XML representation of the InputDefinition. + * + * @param bool $asDom Whether to return a DOM or an XML string + * + * @return string|\DOMDocument An XML string representing the InputDefinition + * + * @deprecated Deprecated since version 2.3, to be removed in 3.0. + */ + public function asXml($asDom = false) + { + $descriptor = new XmlDescriptor(); + + return $descriptor->describe($this, array('as_dom' => $asDom)); + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputInterface.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputInterface.php new file mode 100644 index 0000000..befa272 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputInterface.php @@ -0,0 +1,152 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +/** + * InputInterface is the interface implemented by all input classes. + * + * @author Fabien Potencier + */ +interface InputInterface +{ + /** + * Returns the first argument from the raw parameters (not parsed). + * + * @return string The value of the first argument or null otherwise + */ + public function getFirstArgument(); + + /** + * Returns true if the raw parameters (not parsed) contain a value. + * + * This method is to be used to introspect the input parameters + * before they have been validated. It must be used carefully. + * + * @param string|array $values The values to look for in the raw parameters (can be an array) + * + * @return bool true if the value is contained in the raw parameters + */ + public function hasParameterOption($values); + + /** + * Returns the value of a raw option (not parsed). + * + * This method is to be used to introspect the input parameters + * before they have been validated. It must be used carefully. + * + * @param string|array $values The value(s) to look for in the raw parameters (can be an array) + * @param mixed $default The default value to return if no result is found + * + * @return mixed The option value + */ + public function getParameterOption($values, $default = false); + + /** + * Binds the current Input instance with the given arguments and options. + * + * @param InputDefinition $definition A InputDefinition instance + */ + public function bind(InputDefinition $definition); + + /** + * Validates if arguments given are correct. + * + * Throws an exception when not enough arguments are given. + * + * @throws \RuntimeException + */ + public function validate(); + + /** + * Returns all the given arguments merged with the default values. + * + * @return array + */ + public function getArguments(); + + /** + * Gets argument by name. + * + * @param string $name The name of the argument + * + * @return mixed + */ + public function getArgument($name); + + /** + * Sets an argument value by name. + * + * @param string $name The argument name + * @param string $value The argument value + * + * @throws \InvalidArgumentException When argument given doesn't exist + */ + public function setArgument($name, $value); + + /** + * Returns true if an InputArgument object exists by name or position. + * + * @param string|int $name The InputArgument name or position + * + * @return bool true if the InputArgument object exists, false otherwise + */ + public function hasArgument($name); + + /** + * Returns all the given options merged with the default values. + * + * @return array + */ + public function getOptions(); + + /** + * Gets an option by name. + * + * @param string $name The name of the option + * + * @return mixed + */ + public function getOption($name); + + /** + * Sets an option value by name. + * + * @param string $name The option name + * @param string|bool $value The option value + * + * @throws \InvalidArgumentException When option given doesn't exist + */ + public function setOption($name, $value); + + /** + * Returns true if an InputOption object exists by name. + * + * @param string $name The InputOption name + * + * @return bool true if the InputOption object exists, false otherwise + */ + public function hasOption($name); + + /** + * Is this input means interactive? + * + * @return bool + */ + public function isInteractive(); + + /** + * Sets the input interactivity. + * + * @param bool $interactive If the input should be interactive + */ + public function setInteractive($interactive); +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputOption.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputOption.php new file mode 100644 index 0000000..18d05e9 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/InputOption.php @@ -0,0 +1,212 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +/** + * Represents a command line option. + * + * @author Fabien Potencier + * + * @api + */ +class InputOption +{ + const VALUE_NONE = 1; + const VALUE_REQUIRED = 2; + const VALUE_OPTIONAL = 4; + const VALUE_IS_ARRAY = 8; + + private $name; + private $shortcut; + private $mode; + private $default; + private $description; + + /** + * Constructor. + * + * @param string $name The option name + * @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts + * @param int $mode The option mode: One of the VALUE_* constants + * @param string $description A description text + * @param mixed $default The default value (must be null for self::VALUE_REQUIRED or self::VALUE_NONE) + * + * @throws \InvalidArgumentException If option mode is invalid or incompatible + * + * @api + */ + public function __construct($name, $shortcut = null, $mode = null, $description = '', $default = null) + { + if (0 === strpos($name, '--')) { + $name = substr($name, 2); + } + + if (empty($name)) { + throw new \InvalidArgumentException('An option name cannot be empty.'); + } + + if (empty($shortcut)) { + $shortcut = null; + } + + if (null !== $shortcut) { + if (is_array($shortcut)) { + $shortcut = implode('|', $shortcut); + } + $shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-')); + $shortcuts = array_filter($shortcuts); + $shortcut = implode('|', $shortcuts); + + if (empty($shortcut)) { + throw new \InvalidArgumentException('An option shortcut cannot be empty.'); + } + } + + if (null === $mode) { + $mode = self::VALUE_NONE; + } elseif (!is_int($mode) || $mode > 15 || $mode < 1) { + throw new \InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); + } + + $this->name = $name; + $this->shortcut = $shortcut; + $this->mode = $mode; + $this->description = $description; + + if ($this->isArray() && !$this->acceptValue()) { + throw new \InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.'); + } + + $this->setDefault($default); + } + + /** + * Returns the option shortcut. + * + * @return string The shortcut + */ + public function getShortcut() + { + return $this->shortcut; + } + + /** + * Returns the option name. + * + * @return string The name + */ + public function getName() + { + return $this->name; + } + + /** + * Returns true if the option accepts a value. + * + * @return bool true if value mode is not self::VALUE_NONE, false otherwise + */ + public function acceptValue() + { + return $this->isValueRequired() || $this->isValueOptional(); + } + + /** + * Returns true if the option requires a value. + * + * @return bool true if value mode is self::VALUE_REQUIRED, false otherwise + */ + public function isValueRequired() + { + return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode); + } + + /** + * Returns true if the option takes an optional value. + * + * @return bool true if value mode is self::VALUE_OPTIONAL, false otherwise + */ + public function isValueOptional() + { + return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode); + } + + /** + * Returns true if the option can take multiple values. + * + * @return bool true if mode is self::VALUE_IS_ARRAY, false otherwise + */ + public function isArray() + { + return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode); + } + + /** + * Sets the default value. + * + * @param mixed $default The default value + * + * @throws \LogicException When incorrect default value is given + */ + public function setDefault($default = null) + { + if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) { + throw new \LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.'); + } + + if ($this->isArray()) { + if (null === $default) { + $default = array(); + } elseif (!is_array($default)) { + throw new \LogicException('A default value for an array option must be an array.'); + } + } + + $this->default = $this->acceptValue() ? $default : false; + } + + /** + * Returns the default value. + * + * @return mixed The default value + */ + public function getDefault() + { + return $this->default; + } + + /** + * Returns the description text. + * + * @return string The description text + */ + public function getDescription() + { + return $this->description; + } + + /** + * Checks whether the given option equals this one + * + * @param InputOption $option option to compare + * @return bool + */ + public function equals(InputOption $option) + { + return $option->getName() === $this->getName() + && $option->getShortcut() === $this->getShortcut() + && $option->getDefault() === $this->getDefault() + && $option->isArray() === $this->isArray() + && $option->isValueRequired() === $this->isValueRequired() + && $option->isValueOptional() === $this->isValueOptional() + ; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/StringInput.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/StringInput.php new file mode 100644 index 0000000..7f87f71 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Input/StringInput.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +/** + * StringInput represents an input provided as a string. + * + * Usage: + * + * $input = new StringInput('foo --bar="foobar"'); + * + * @author Fabien Potencier + * + * @api + */ +class StringInput extends ArgvInput +{ + const REGEX_STRING = '([^\s]+?)(?:\s|(?setTokens($this->tokenize($input)); + + if (null !== $definition) { + $this->bind($definition); + } + } + + /** + * Tokenizes a string. + * + * @param string $input The input to tokenize + * + * @return array An array of tokens + * + * @throws \InvalidArgumentException When unable to parse input (should never happen) + */ + private function tokenize($input) + { + $tokens = array(); + $length = strlen($input); + $cursor = 0; + while ($cursor < $length) { + if (preg_match('/\s+/A', $input, $match, null, $cursor)) { + } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, null, $cursor)) { + $tokens[] = $match[1].$match[2].stripcslashes(str_replace(array('"\'', '\'"', '\'\'', '""'), '', substr($match[3], 1, strlen($match[3]) - 2))); + } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, null, $cursor)) { + $tokens[] = stripcslashes(substr($match[0], 1, strlen($match[0]) - 2)); + } elseif (preg_match('/'.self::REGEX_STRING.'/A', $input, $match, null, $cursor)) { + $tokens[] = stripcslashes($match[1]); + } else { + // should never happen + // @codeCoverageIgnoreStart + throw new \InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10))); + // @codeCoverageIgnoreEnd + } + + $cursor += strlen($match[0]); + } + + return $tokens; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/LICENSE b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/LICENSE new file mode 100644 index 0000000..0b3292c --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2014 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutput.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutput.php new file mode 100644 index 0000000..3560f1c --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutput.php @@ -0,0 +1,113 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +use Symfony\Component\Console\Formatter\OutputFormatterInterface; + +/** + * ConsoleOutput is the default class for all CLI output. It uses STDOUT. + * + * This class is a convenient wrapper around `StreamOutput`. + * + * $output = new ConsoleOutput(); + * + * This is equivalent to: + * + * $output = new StreamOutput(fopen('php://stdout', 'w')); + * + * @author Fabien Potencier + * + * @api + */ +class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface +{ + private $stderr; + + /** + * Constructor. + * + * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) + * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) + * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) + * + * @api + */ + public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null) + { + $outputStream = 'php://stdout'; + if (!$this->hasStdoutSupport()) { + $outputStream = 'php://output'; + } + + parent::__construct(fopen($outputStream, 'w'), $verbosity, $decorated, $formatter); + + $this->stderr = new StreamOutput(fopen('php://stderr', 'w'), $verbosity, $decorated, $this->getFormatter()); + } + + /** + * {@inheritdoc} + */ + public function setDecorated($decorated) + { + parent::setDecorated($decorated); + $this->stderr->setDecorated($decorated); + } + + /** + * {@inheritdoc} + */ + public function setFormatter(OutputFormatterInterface $formatter) + { + parent::setFormatter($formatter); + $this->stderr->setFormatter($formatter); + } + + /** + * {@inheritdoc} + */ + public function setVerbosity($level) + { + parent::setVerbosity($level); + $this->stderr->setVerbosity($level); + } + + /** + * {@inheritdoc} + */ + public function getErrorOutput() + { + return $this->stderr; + } + + /** + * {@inheritdoc} + */ + public function setErrorOutput(OutputInterface $error) + { + $this->stderr = $error; + } + + /** + * Returns true if current environment supports writing console output to + * STDOUT. + * + * IBM iSeries (OS400) exhibits character-encoding issues when writing to + * STDOUT and doesn't properly convert ASCII to EBCDIC, resulting in garbage + * output. + * + * @return bool + */ + protected function hasStdoutSupport() + { + return ('OS400' != php_uname('s')); + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutputInterface.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutputInterface.php new file mode 100644 index 0000000..5eb4fc7 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutputInterface.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +/** + * ConsoleOutputInterface is the interface implemented by ConsoleOutput class. + * This adds information about stderr output stream. + * + * @author Dariusz Górecki + */ +interface ConsoleOutputInterface extends OutputInterface +{ + /** + * Gets the OutputInterface for errors. + * + * @return OutputInterface + */ + public function getErrorOutput(); + + /** + * Sets the OutputInterface used for errors. + * + * @param OutputInterface $error + */ + public function setErrorOutput(OutputInterface $error); +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/NullOutput.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/NullOutput.php new file mode 100644 index 0000000..c75cfca --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/NullOutput.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +use Symfony\Component\Console\Formatter\OutputFormatter; +use Symfony\Component\Console\Formatter\OutputFormatterInterface; + +/** + * NullOutput suppresses all output. + * + * $output = new NullOutput(); + * + * @author Fabien Potencier + * @author Tobias Schultze + * + * @api + */ +class NullOutput implements OutputInterface +{ + /** + * {@inheritdoc} + */ + public function setFormatter(OutputFormatterInterface $formatter) + { + // do nothing + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + // to comply with the interface we must return a OutputFormatterInterface + return new OutputFormatter(); + } + + /** + * {@inheritdoc} + */ + public function setDecorated($decorated) + { + // do nothing + } + + /** + * {@inheritdoc} + */ + public function isDecorated() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function setVerbosity($level) + { + // do nothing + } + + /** + * {@inheritdoc} + */ + public function getVerbosity() + { + return self::VERBOSITY_QUIET; + } + + /** + * {@inheritdoc} + */ + public function writeln($messages, $type = self::OUTPUT_NORMAL) + { + // do nothing + } + + /** + * {@inheritdoc} + */ + public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL) + { + // do nothing + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/Output.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/Output.php new file mode 100644 index 0000000..ae62ea0 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/Output.php @@ -0,0 +1,145 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +use Symfony\Component\Console\Formatter\OutputFormatterInterface; +use Symfony\Component\Console\Formatter\OutputFormatter; + +/** + * Base class for output classes. + * + * There are five levels of verbosity: + * + * * normal: no option passed (normal output) + * * verbose: -v (more output) + * * very verbose: -vv (highly extended output) + * * debug: -vvv (all debug output) + * * quiet: -q (no output) + * + * @author Fabien Potencier + * + * @api + */ +abstract class Output implements OutputInterface +{ + private $verbosity; + private $formatter; + + /** + * Constructor. + * + * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) + * @param bool $decorated Whether to decorate messages + * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) + * + * @api + */ + public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = false, OutputFormatterInterface $formatter = null) + { + $this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity; + $this->formatter = null === $formatter ? new OutputFormatter() : $formatter; + $this->formatter->setDecorated($decorated); + } + + /** + * {@inheritdoc} + */ + public function setFormatter(OutputFormatterInterface $formatter) + { + $this->formatter = $formatter; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + return $this->formatter; + } + + /** + * {@inheritdoc} + */ + public function setDecorated($decorated) + { + $this->formatter->setDecorated($decorated); + } + + /** + * {@inheritdoc} + */ + public function isDecorated() + { + return $this->formatter->isDecorated(); + } + + /** + * {@inheritdoc} + */ + public function setVerbosity($level) + { + $this->verbosity = (int) $level; + } + + /** + * {@inheritdoc} + */ + public function getVerbosity() + { + return $this->verbosity; + } + + /** + * {@inheritdoc} + */ + public function writeln($messages, $type = self::OUTPUT_NORMAL) + { + $this->write($messages, true, $type); + } + + /** + * {@inheritdoc} + */ + public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL) + { + if (self::VERBOSITY_QUIET === $this->verbosity) { + return; + } + + $messages = (array) $messages; + + foreach ($messages as $message) { + switch ($type) { + case OutputInterface::OUTPUT_NORMAL: + $message = $this->formatter->format($message); + break; + case OutputInterface::OUTPUT_RAW: + break; + case OutputInterface::OUTPUT_PLAIN: + $message = strip_tags($this->formatter->format($message)); + break; + default: + throw new \InvalidArgumentException(sprintf('Unknown output type given (%s)', $type)); + } + + $this->doWrite($message, $newline); + } + } + + /** + * Writes a message to the output. + * + * @param string $message A message to write to the output + * @param bool $newline Whether to add a newline or not + */ + abstract protected function doWrite($message, $newline); +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/OutputInterface.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/OutputInterface.php new file mode 100644 index 0000000..ad128c6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/OutputInterface.php @@ -0,0 +1,113 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +use Symfony\Component\Console\Formatter\OutputFormatterInterface; + +/** + * OutputInterface is the interface implemented by all Output classes. + * + * @author Fabien Potencier + * + * @api + */ +interface OutputInterface +{ + const VERBOSITY_QUIET = 0; + const VERBOSITY_NORMAL = 1; + const VERBOSITY_VERBOSE = 2; + const VERBOSITY_VERY_VERBOSE = 3; + const VERBOSITY_DEBUG = 4; + + const OUTPUT_NORMAL = 0; + const OUTPUT_RAW = 1; + const OUTPUT_PLAIN = 2; + + /** + * Writes a message to the output. + * + * @param string|array $messages The message as an array of lines or a single string + * @param bool $newline Whether to add a newline + * @param int $type The type of output (one of the OUTPUT constants) + * + * @throws \InvalidArgumentException When unknown output type is given + * + * @api + */ + public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL); + + /** + * Writes a message to the output and adds a newline at the end. + * + * @param string|array $messages The message as an array of lines of a single string + * @param int $type The type of output (one of the OUTPUT constants) + * + * @throws \InvalidArgumentException When unknown output type is given + * + * @api + */ + public function writeln($messages, $type = self::OUTPUT_NORMAL); + + /** + * Sets the verbosity of the output. + * + * @param int $level The level of verbosity (one of the VERBOSITY constants) + * + * @api + */ + public function setVerbosity($level); + + /** + * Gets the current verbosity of the output. + * + * @return int The current level of verbosity (one of the VERBOSITY constants) + * + * @api + */ + public function getVerbosity(); + + /** + * Sets the decorated flag. + * + * @param bool $decorated Whether to decorate the messages + * + * @api + */ + public function setDecorated($decorated); + + /** + * Gets the decorated flag. + * + * @return bool true if the output will decorate messages, false otherwise + * + * @api + */ + public function isDecorated(); + + /** + * Sets output formatter. + * + * @param OutputFormatterInterface $formatter + * + * @api + */ + public function setFormatter(OutputFormatterInterface $formatter); + + /** + * Returns current output formatter instance. + * + * @return OutputFormatterInterface + * + * @api + */ + public function getFormatter(); +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php new file mode 100644 index 0000000..6415fa2 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +use Symfony\Component\Console\Formatter\OutputFormatterInterface; + +/** + * StreamOutput writes the output to a given stream. + * + * Usage: + * + * $output = new StreamOutput(fopen('php://stdout', 'w')); + * + * As `StreamOutput` can use any stream, you can also use a file: + * + * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false)); + * + * @author Fabien Potencier + * + * @api + */ +class StreamOutput extends Output +{ + private $stream; + + /** + * Constructor. + * + * @param mixed $stream A stream resource + * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) + * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) + * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) + * + * @throws \InvalidArgumentException When first argument is not a real stream + * + * @api + */ + public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null) + { + if (!is_resource($stream) || 'stream' !== get_resource_type($stream)) { + throw new \InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); + } + + $this->stream = $stream; + + if (null === $decorated) { + $decorated = $this->hasColorSupport(); + } + + parent::__construct($verbosity, $decorated, $formatter); + } + + /** + * Gets the stream attached to this StreamOutput instance. + * + * @return resource A stream resource + */ + public function getStream() + { + return $this->stream; + } + + /** + * {@inheritdoc} + */ + protected function doWrite($message, $newline) + { + if (false === @fwrite($this->stream, $message.($newline ? PHP_EOL : ''))) { + // @codeCoverageIgnoreStart + // should never happen + throw new \RuntimeException('Unable to write output.'); + // @codeCoverageIgnoreEnd + } + + fflush($this->stream); + } + + /** + * Returns true if the stream supports colorization. + * + * Colorization is disabled if not supported by the stream: + * + * - Windows without Ansicon and ConEmu + * - non tty consoles + * + * @return bool true if the stream supports colorization, false otherwise + */ + protected function hasColorSupport() + { + // @codeCoverageIgnoreStart + if (DIRECTORY_SEPARATOR == '\\') { + return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI'); + } + + return function_exists('posix_isatty') && @posix_isatty($this->stream); + // @codeCoverageIgnoreEnd + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Resources/bin/hiddeninput.exe b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Resources/bin/hiddeninput.exe new file mode 100644 index 0000000000000000000000000000000000000000..c8cf65e8d819e6e525121cf6b21f1c2429746038 GIT binary patch literal 9216 zcmeHNe{@sVeZR8hV88~S)=Hp|Mpn({rC^@)BwNOI{ERJXCYlx+k1K6PLHo z_e!z_fhOzeA3JTX&-Z@s{rFOgjEwBlqjr!)9f zjyHz`A+ni`!0Taby{Uj5Y>jQq(k5A+X})PLWAi|{IZbtc8n^^trM{GI=P_15U6d?l zJJ3PW8XjfHpR}6`k{&5@JcEeH_SqQoQbU62o2YS30W)p_t&Fjy*RXQCZt$gCf|ao| zx&3R}m6|-Lfi@pua=$26n(UlnWo$>K67*|+#(qL_An=?l0M02AhOSJDv3;~?1ORfw z76EdK#MpSHqACHLcnJLIYlCSiX4eS@Pr8rN)Xwz0dk7O*y^0_C(Yks2Kvg! z-d-fJ)F9@k?>)m(XqDKIe2OKfhCQde9fpO0ko24yn*4xzX7q+ze`Z*=aJgwV?D?73 zaJ8UkSk|NN>@-|mB*f`EIK7$ElgAB<7p&p`^Vuq$58#;?B^*Bz7&d$B#+AYUC z(^m|`7{lqx&b^5$;i`j|S!+u|lcaQplp_&Nb)!>r>vGh3wb!tW zLq6%bkSt8jO|(vWH>LiPV(Xkp%BiGhl1q!PXXNKVKE!>Y5cHc2%cJOJA{-&ZsSn`T z#8~TA#(HWH4m>uCd+kCMTFgMI*s*n3!iCOwEI`{vGcVhzDu!Lw%-Ea^JATtrF`q3`+#KvvYJ0vM~A}D#LOD zlw`4ncB0U*Jji=--Wz#>I&5?hy;MgYW2u91d8ob=7MWfY`u;7Xe-J{Qsb0=0p|SM2 zG|=~mERIj4?gi)Ew|{LIN#oAsh20k_khIYjJBBN6rrIJ=eQO=nE;rTnPSiaQS$1$# z+|JRh0!IbQIa*f1(TZ}QM;|WO0+jTy(e)ggN4>zqp2E>C>hGPLHjHBh--2%@{EZNE zbUk{<3MABX&20QwK{MxK8`1Vk>^%dO5i@VTfu>NG3$K4NC=hSPsj9UYy`rNO}sBnB9QdKdIk7G+2_amnWstdTYVg z7HgLJGC~XLZG`63GwH8PdO_+G(k6~?J8Wj5mQos#21kC4W#2)guQXI)!z^{@F)U)5 z*re+r(2dib3D4P~%Z6TL=$PIkpmm<_#isu%t=%DcIwNkJhMeJ|bpahHO%8h|y~Ccf zUg#xVk+dyu>Q1O7JZ~8KS>tqi0qK**X*y6yHM71`bT=kFZ=@E%oe2!Km1^2sa>v+onZ%x_>aOJF+N0{i~z|<(IzgT*{0PpQq}E zQpU35@bm;qI?t_znGI&5&4sZV>+%m}w$(4hSDvLk)l<{5XyMlnCl7C%AjM3XnWvVz z{NoFsX)JB)SoqABZxUa*Yq+^^(cbq4mL%^lO12c${z{pf+)|kTTI~nQywyYF6}6|8 zlsN9&{-vwTrTyu<5^90_AsIU-ID#ZG@6d%poU44<**%xVe?`uxf}_Mr$SLHLS|K_N zQnw>(Lr2U=%$-<2D~RSzbG)2W2u^KMDnFFE?GmmbQ)V)fty957F`4OvQ_25E68ITr z5?`suu`|v?r!y=gFOGj$%9IJ zuTP=&2GcnoZZ0qSe6YL-*-lg>Q#>?Ew`a=GDc4vI#<1sNdKn?n7iSj0Orl$-#FMFi zykr>X-Xvi>sVr;92+8*H!r|3L$#o~hXa0z>AmF=z z?|@FF;*S|S0yqsw0j>Z(3mX-HD!|{N-vYc9paC8Ld=|6?00!6(_%lERupO`&um*4k z0b~W>e*uhTe4;V;mq>(ox$9FB`wLt!*DKj~!aOh|fL&#Pg*b??tm%5~_6M#02wqeC zS~wO>TWGnSp^r<0&8f2V6W->w=C+p~daC5e5wNQM*(* z66^}b0(!q3)zq$mu&VnbR#nr3;h5DS*o7{y66=!#;Dy4$pd1ZH<6WEOi0oJ8SxRL* z*v-9@Z^2w%^S(w5dO{_9Duby%2RT~;ppxaE$l()x6&}>7Wcg=u_&>f`Vs8OJGTy{X z2HpG=ThJz<{%|4Qq-~ad0qcrc87n88DHpM(nypwXIkZn<{zIT$ul&BQ?{ApCAZtyr zs2YpNt@x(G*faTU*HCKnAk(G=Tl~>r1QK8LY~J8mFFGoN5iIkYSwlm4Lsj#g4dsE5 zU-4;*Kdh-zv!rT4N$O}Q&n)?v0-9Y)lRFz58^P-KtKonzrfQ1p@0V_10^0||cGRn9 zRG<-#_TEV2nn4{BOh{YVBR4e!V!D?0K%BAlQN!D%M#k1bHypiIHT)5tlj>p0Pp_;+ z!cqC-JIs@JRhB+#teGs$Cib_=(yjRo4OJg^YPg%58aJVsC(LQ?W6%pn!-#aMZwoPcopo^Rn6BE z3=c5&W5~pP(C(-2r;PnH-S0{F`runM0ERCf3rESX$+S(MKOXmKJL9zXF}9-lf^xUs z+bb)+P%L&gV@<4q{6w^xEJ>Y>TQFUeoz0o-yq)jUqww=?wjUO8Y{a5G;DJ0Jr!LL+ zWhgsLuzi&eDrGDn$2DJwpFfH-?SGWbr>qRb?v{P`_%)So)CQgzO^HQ%;y#tJ=knH4 z95jX;^bF#BiuTH^%-j}{9VrZD=R%Q%wselH^p>5 z7d>gWB-st&3Fj%Mt*|tR5iK3J=`xhs&G)I7E>`FO@o7L z@S$B!pYMuzz5DN@X!O4DPm5n@raPJn-Q#o*m*e^5lk$g?0esg%$;>g5QW-|;c=H2GM}bo2tW^D924wmOkrUbWxcQ# z#v6bP%Tdfe~jtCRzAL;-OahZ=#yvUixu2-9fD2j$*|YY`F?0wF-{a# ztr<&kZjZ+81}6ZESqtgW)8kP#s@VLTSUR{}6?U^R*x7RE3Rl&n=VnFFqg9Uqz1n@N9N|=9<4} zuJfy^+}|D9X&vm3MAdqmu0&UMd^=K>b1hLAm_E!$rZC2b;;T~Dl zI`Eo_yRY76uM})|6wk9->of(=9&4jLv5#p@OzS~Yl>@pG)^>6`R+KtL{<4ly4o9WiM!%p_pfROU354)e8PIeE z1_s?#;OX6waNvvb&UQRN(WLbR+}&b#jo&WY-LlwCX}Q*$jGuKYuOGoIoyR(>e}}ix z+t}Q^cEcC8Y{@h}>HmJ^gD!l@gzwHmiBKl26x_lZVZG2UY!`w;RJd122;US&geQdW z3Qq}R!gIo5;ka;0I4c-Jq5X6A6?VzK&c4y!ZXdAUYu{r}*!SBXw?Aor+J4-A(*COb zb^CwV-?3k`zi-cX*c`VzL`RLI(b4MgIrGN z%ojf`E*6)Gg1A9!7q^N##2zsss^V9~-Qt7d!{UDNZ^XY9pA^3@9ui*?e=7c5d`nD; z?}~R(p>y1Kw!>|X4ycYEAkcZa*n-R%y! zqi)Up756UpqwfE7=hfigw$k~G@25gaxF9UGTkV>C(7x1Rbx4jb#|}rxq0vQ!n-c#f J0sQ~1{4brj`U(I5 literal 0 HcmV?d00001 diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Shell.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Shell.php new file mode 100644 index 0000000..7f78e95 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Shell.php @@ -0,0 +1,229 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console; + +use Symfony\Component\Console\Input\StringInput; +use Symfony\Component\Console\Output\ConsoleOutput; +use Symfony\Component\Process\ProcessBuilder; +use Symfony\Component\Process\PhpExecutableFinder; + +/** + * A Shell wraps an Application to add shell capabilities to it. + * + * Support for history and completion only works with a PHP compiled + * with readline support (either --with-readline or --with-libedit) + * + * @author Fabien Potencier + * @author Martin Hasoň + */ +class Shell +{ + private $application; + private $history; + private $output; + private $hasReadline; + private $processIsolation; + + /** + * Constructor. + * + * If there is no readline support for the current PHP executable + * a \RuntimeException exception is thrown. + * + * @param Application $application An application instance + */ + public function __construct(Application $application) + { + $this->hasReadline = function_exists('readline'); + $this->application = $application; + $this->history = getenv('HOME').'/.history_'.$application->getName(); + $this->output = new ConsoleOutput(); + $this->processIsolation = false; + } + + /** + * Runs the shell. + */ + public function run() + { + $this->application->setAutoExit(false); + $this->application->setCatchExceptions(true); + + if ($this->hasReadline) { + readline_read_history($this->history); + readline_completion_function(array($this, 'autocompleter')); + } + + $this->output->writeln($this->getHeader()); + $php = null; + if ($this->processIsolation) { + $finder = new PhpExecutableFinder(); + $php = $finder->find(); + $this->output->writeln(<<Running with process isolation, you should consider this: + * each command is executed as separate process, + * commands don't support interactivity, all params must be passed explicitly, + * commands output is not colorized. + +EOF + ); + } + + while (true) { + $command = $this->readline(); + + if (false === $command) { + $this->output->writeln("\n"); + + break; + } + + if ($this->hasReadline) { + readline_add_history($command); + readline_write_history($this->history); + } + + if ($this->processIsolation) { + $pb = new ProcessBuilder(); + + $process = $pb + ->add($php) + ->add($_SERVER['argv'][0]) + ->add($command) + ->inheritEnvironmentVariables(true) + ->getProcess() + ; + + $output = $this->output; + $process->run(function ($type, $data) use ($output) { + $output->writeln($data); + }); + + $ret = $process->getExitCode(); + } else { + $ret = $this->application->run(new StringInput($command), $this->output); + } + + if (0 !== $ret) { + $this->output->writeln(sprintf('The command terminated with an error status (%s)', $ret)); + } + } + } + + /** + * Returns the shell header. + * + * @return string The header string + */ + protected function getHeader() + { + return <<{$this->application->getName()} shell ({$this->application->getVersion()}). + +At the prompt, type help for some help, +or list to get a list of available commands. + +To exit the shell, type ^D. + +EOF; + } + + /** + * Renders a prompt. + * + * @return string The prompt + */ + protected function getPrompt() + { + // using the formatter here is required when using readline + return $this->output->getFormatter()->format($this->application->getName().' > '); + } + + protected function getOutput() + { + return $this->output; + } + + protected function getApplication() + { + return $this->application; + } + + /** + * Tries to return autocompletion for the current entered text. + * + * @param string $text The last segment of the entered text + * + * @return bool|array A list of guessed strings or true + */ + private function autocompleter($text) + { + $info = readline_info(); + $text = substr($info['line_buffer'], 0, $info['end']); + + if ($info['point'] !== $info['end']) { + return true; + } + + // task name? + if (false === strpos($text, ' ') || !$text) { + return array_keys($this->application->all()); + } + + // options and arguments? + try { + $command = $this->application->find(substr($text, 0, strpos($text, ' '))); + } catch (\Exception $e) { + return true; + } + + $list = array('--help'); + foreach ($command->getDefinition()->getOptions() as $option) { + $list[] = '--'.$option->getName(); + } + + return $list; + } + + /** + * Reads a single line from standard input. + * + * @return string The single line from standard input + */ + private function readline() + { + if ($this->hasReadline) { + $line = readline($this->getPrompt()); + } else { + $this->output->write($this->getPrompt()); + $line = fgets(STDIN, 1024); + $line = (!$line && strlen($line) == 0) ? false : rtrim($line); + } + + return $line; + } + + public function getProcessIsolation() + { + return $this->processIsolation; + } + + public function setProcessIsolation($processIsolation) + { + $this->processIsolation = (bool) $processIsolation; + + if ($this->processIsolation && !class_exists('Symfony\\Component\\Process\\Process')) { + throw new \RuntimeException('Unable to isolate processes as the Symfony Process Component is not installed.'); + } + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php new file mode 100644 index 0000000..711e5f1 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php @@ -0,0 +1,117 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Tester; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Input\ArrayInput; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Output\StreamOutput; + +/** + * Eases the testing of console applications. + * + * When testing an application, don't forget to disable the auto exit flag: + * + * $application = new Application(); + * $application->setAutoExit(false); + * + * @author Fabien Potencier + */ +class ApplicationTester +{ + private $application; + private $input; + private $output; + + /** + * Constructor. + * + * @param Application $application An Application instance to test. + */ + public function __construct(Application $application) + { + $this->application = $application; + } + + /** + * Executes the application. + * + * Available options: + * + * * interactive: Sets the input interactive flag + * * decorated: Sets the output decorated flag + * * verbosity: Sets the output verbosity flag + * + * @param array $input An array of arguments and options + * @param array $options An array of options + * + * @return int The command exit code + */ + public function run(array $input, $options = array()) + { + $this->input = new ArrayInput($input); + if (isset($options['interactive'])) { + $this->input->setInteractive($options['interactive']); + } + + $this->output = new StreamOutput(fopen('php://memory', 'w', false)); + if (isset($options['decorated'])) { + $this->output->setDecorated($options['decorated']); + } + if (isset($options['verbosity'])) { + $this->output->setVerbosity($options['verbosity']); + } + + return $this->application->run($this->input, $this->output); + } + + /** + * Gets the display returned by the last execution of the application. + * + * @param bool $normalize Whether to normalize end of lines to \n or not + * + * @return string The display + */ + public function getDisplay($normalize = false) + { + rewind($this->output->getStream()); + + $display = stream_get_contents($this->output->getStream()); + + if ($normalize) { + $display = str_replace(PHP_EOL, "\n", $display); + } + + return $display; + } + + /** + * Gets the input instance used by the last execution of the application. + * + * @return InputInterface The current input instance + */ + public function getInput() + { + return $this->input; + } + + /** + * Gets the output instance used by the last execution of the application. + * + * @return OutputInterface The current output instance + */ + public function getOutput() + { + return $this->output; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Tester/CommandTester.php b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Tester/CommandTester.php new file mode 100644 index 0000000..abc1fd8 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/Tester/CommandTester.php @@ -0,0 +1,112 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Tester; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\ArrayInput; +use Symfony\Component\Console\Output\StreamOutput; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Eases the testing of console commands. + * + * @author Fabien Potencier + */ +class CommandTester +{ + private $command; + private $input; + private $output; + + /** + * Constructor. + * + * @param Command $command A Command instance to test. + */ + public function __construct(Command $command) + { + $this->command = $command; + } + + /** + * Executes the command. + * + * Available options: + * + * * interactive: Sets the input interactive flag + * * decorated: Sets the output decorated flag + * * verbosity: Sets the output verbosity flag + * + * @param array $input An array of arguments and options + * @param array $options An array of options + * + * @return int The command exit code + */ + public function execute(array $input, array $options = array()) + { + $this->input = new ArrayInput($input); + if (isset($options['interactive'])) { + $this->input->setInteractive($options['interactive']); + } + + $this->output = new StreamOutput(fopen('php://memory', 'w', false)); + if (isset($options['decorated'])) { + $this->output->setDecorated($options['decorated']); + } + if (isset($options['verbosity'])) { + $this->output->setVerbosity($options['verbosity']); + } + + return $this->command->run($this->input, $this->output); + } + + /** + * Gets the display returned by the last execution of the command. + * + * @param bool $normalize Whether to normalize end of lines to \n or not + * + * @return string The display + */ + public function getDisplay($normalize = false) + { + rewind($this->output->getStream()); + + $display = stream_get_contents($this->output->getStream()); + + if ($normalize) { + $display = str_replace(PHP_EOL, "\n", $display); + } + + return $display; + } + + /** + * Gets the input instance used by the last execution of the command. + * + * @return InputInterface The current input instance + */ + public function getInput() + { + return $this->input; + } + + /** + * Gets the output instance used by the last execution of the command. + * + * @return OutputInterface The current output instance + */ + public function getOutput() + { + return $this->output; + } +} diff --git a/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/composer.json b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/composer.json new file mode 100644 index 0000000..472b4f2 --- /dev/null +++ b/sources/phpBB/vendor/symfony/console/Symfony/Component/Console/composer.json @@ -0,0 +1,37 @@ +{ + "name": "symfony/console", + "type": "library", + "description": "Symfony Console Component", + "keywords": [], + "homepage": "http://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/event-dispatcher": "~2.1" + }, + "suggest": { + "symfony/event-dispatcher": "" + }, + "autoload": { + "psr-0": { "Symfony\\Component\\Console\\": "" } + }, + "target-dir": "Symfony/Component/Console", + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + } +} diff --git a/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Debug.php b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Debug.php new file mode 100644 index 0000000..7c6d928 --- /dev/null +++ b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Debug.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Debug; + +use Symfony\Component\ClassLoader\DebugClassLoader; + +/** + * Registers all the debug tools. + * + * @author Fabien Potencier + */ +class Debug +{ + private static $enabled = false; + + /** + * Enables the debug tools. + * + * This method registers an error handler and an exception handler. + * + * If the Symfony ClassLoader component is available, a special + * class loader is also registered. + * + * @param int $errorReportingLevel The level of error reporting you want + * @param bool $displayErrors Whether to display errors (for development) or just log them (for production) + */ + public static function enable($errorReportingLevel = null, $displayErrors = true) + { + if (static::$enabled) { + return; + } + + static::$enabled = true; + + error_reporting(-1); + + ErrorHandler::register($errorReportingLevel, $displayErrors); + if ('cli' !== php_sapi_name()) { + ExceptionHandler::register(); + // CLI - display errors only if they're not already logged to STDERR + } elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) { + ini_set('display_errors', 1); + } + + if (class_exists('Symfony\Component\ClassLoader\DebugClassLoader')) { + DebugClassLoader::enable(); + } + } +} diff --git a/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/ErrorHandler.php b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/ErrorHandler.php new file mode 100644 index 0000000..d0566ae --- /dev/null +++ b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/ErrorHandler.php @@ -0,0 +1,206 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Debug; + +use Symfony\Component\Debug\Exception\FatalErrorException; +use Symfony\Component\Debug\Exception\ContextErrorException; +use Symfony\Component\Debug\Exception\DummyException; +use Psr\Log\LoggerInterface; + +/** + * ErrorHandler. + * + * @author Fabien Potencier + * @author Konstantin Myakshin + */ +class ErrorHandler +{ + const TYPE_DEPRECATION = -100; + + private $levels = array( + E_WARNING => 'Warning', + E_NOTICE => 'Notice', + E_USER_ERROR => 'User Error', + E_USER_WARNING => 'User Warning', + E_USER_NOTICE => 'User Notice', + E_STRICT => 'Runtime Notice', + E_RECOVERABLE_ERROR => 'Catchable Fatal Error', + E_DEPRECATED => 'Deprecated', + E_USER_DEPRECATED => 'User Deprecated', + E_ERROR => 'Error', + E_CORE_ERROR => 'Core Error', + E_COMPILE_ERROR => 'Compile Error', + E_PARSE => 'Parse', + ); + + private $level; + + private $reservedMemory; + + private $displayErrors; + + /** + * @var LoggerInterface[] Loggers for channels + */ + private static $loggers = array(); + + /** + * Registers the error handler. + * + * @param int $level The level at which the conversion to Exception is done (null to use the error_reporting() value and 0 to disable) + * @param bool $displayErrors Display errors (for dev environment) or just log they (production usage) + * + * @return ErrorHandler The registered error handler + */ + public static function register($level = null, $displayErrors = true) + { + $handler = new static(); + $handler->setLevel($level); + $handler->setDisplayErrors($displayErrors); + + ini_set('display_errors', 0); + set_error_handler(array($handler, 'handle')); + register_shutdown_function(array($handler, 'handleFatal')); + $handler->reservedMemory = str_repeat('x', 10240); + + return $handler; + } + + public function setLevel($level) + { + $this->level = null === $level ? error_reporting() : $level; + } + + public function setDisplayErrors($displayErrors) + { + $this->displayErrors = $displayErrors; + } + + public static function setLogger(LoggerInterface $logger, $channel = 'deprecation') + { + self::$loggers[$channel] = $logger; + } + + /** + * @throws ContextErrorException When error_reporting returns error + */ + public function handle($level, $message, $file = 'unknown', $line = 0, $context = array()) + { + if (0 === $this->level) { + return false; + } + + if ($level & (E_USER_DEPRECATED | E_DEPRECATED)) { + if (isset(self::$loggers['deprecation'])) { + if (version_compare(PHP_VERSION, '5.4', '<')) { + $stack = array_map( + function ($row) { + unset($row['args']); + + return $row; + }, + array_slice(debug_backtrace(false), 0, 10) + ); + } else { + $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10); + } + + self::$loggers['deprecation']->warning($message, array('type' => self::TYPE_DEPRECATION, 'stack' => $stack)); + } + + return true; + } + + if ($this->displayErrors && error_reporting() & $level && $this->level & $level) { + // make sure the ContextErrorException class is loaded (https://bugs.php.net/bug.php?id=65322) + if (!class_exists('Symfony\Component\Debug\Exception\ContextErrorException')) { + require __DIR__.'/Exception/ContextErrorException.php'; + } + if (!class_exists('Symfony\Component\Debug\Exception\FlattenException')) { + require __DIR__.'/Exception/FlattenException.php'; + } + + if (PHP_VERSION_ID < 50400 && isset($context['GLOBALS']) && is_array($context)) { + unset($context['GLOBALS']); + } + + $exception = new ContextErrorException(sprintf('%s: %s in %s line %d', isset($this->levels[$level]) ? $this->levels[$level] : $level, $message, $file, $line), 0, $level, $file, $line, $context); + + // Exceptions thrown from error handlers are sometimes not caught by the exception + // handler, so we invoke it directly (https://bugs.php.net/bug.php?id=54275) + $exceptionHandler = set_exception_handler(function () {}); + restore_exception_handler(); + + if (is_array($exceptionHandler) && $exceptionHandler[0] instanceof ExceptionHandler) { + $exceptionHandler[0]->handle($exception); + + if (!class_exists('Symfony\Component\Debug\Exception\DummyException')) { + require __DIR__.'/Exception/DummyException.php'; + } + + // we must stop the PHP script execution, as the exception has + // already been dealt with, so, let's throw an exception that + // will be caught by a dummy exception handler + set_exception_handler(function (\Exception $e) use ($exceptionHandler) { + if (!$e instanceof DummyException) { + // happens if our dummy exception is caught by a + // catch-all from user code, in which case, let's the + // current handler handle this "new" exception + call_user_func($exceptionHandler, $e); + } + }); + + throw new DummyException(); + } + } + + return false; + } + + public function handleFatal() + { + if (null === $error = error_get_last()) { + return; + } + + $this->reservedMemory = ''; + $type = $error['type']; + if (0 === $this->level || !in_array($type, array(E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE))) { + return; + } + + if (isset(self::$loggers['emergency'])) { + $fatal = array( + 'type' => $type, + 'file' => $error['file'], + 'line' => $error['line'], + ); + + self::$loggers['emergency']->emerg($error['message'], $fatal); + } + + if (!$this->displayErrors) { + return; + } + + // get current exception handler + $exceptionHandler = set_exception_handler(function () {}); + restore_exception_handler(); + + if (is_array($exceptionHandler) && $exceptionHandler[0] instanceof ExceptionHandler) { + $level = isset($this->levels[$type]) ? $this->levels[$type] : $type; + $message = sprintf('%s: %s in %s line %d', $level, $error['message'], $error['file'], $error['line']); + $exception = new FatalErrorException($message, 0, $type, $error['file'], $error['line']); + $exceptionHandler[0]->handle($exception); + } + } +} diff --git a/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/ContextErrorException.php b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/ContextErrorException.php new file mode 100644 index 0000000..54f0198 --- /dev/null +++ b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/ContextErrorException.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Debug\Exception; + +/** + * Error Exception with Variable Context. + * + * @author Christian Sciberras + */ +class ContextErrorException extends \ErrorException +{ + private $context = array(); + + public function __construct($message, $code, $severity, $filename, $lineno, $context = array()) + { + parent::__construct($message, $code, $severity, $filename, $lineno); + $this->context = $context; + } + + /** + * @return array Array of variables that existed when the exception occurred + */ + public function getContext() + { + return $this->context; + } +} diff --git a/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/DummyException.php b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/DummyException.php new file mode 100644 index 0000000..8891f2f --- /dev/null +++ b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/DummyException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Debug\Exception; + +/** + * Used to stop execution of a PHP script after handling a fatal error. + * + * @author Fabien Potencier + */ +class DummyException extends \ErrorException +{ +} diff --git a/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/FatalErrorException.php b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/FatalErrorException.php new file mode 100644 index 0000000..bf37ef8 --- /dev/null +++ b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/FatalErrorException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Debug\Exception; + +/** + * Fatal Error Exception. + * + * @author Konstanton Myakshin + */ +class FatalErrorException extends \ErrorException +{ +} diff --git a/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/FlattenException.php b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/FlattenException.php new file mode 100644 index 0000000..878ac4d --- /dev/null +++ b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/Exception/FlattenException.php @@ -0,0 +1,277 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Debug\Exception; + +use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; + +/** + * FlattenException wraps a PHP Exception to be able to serialize it. + * + * Basically, this class removes all objects from the trace. + * + * @author Fabien Potencier + */ +class FlattenException +{ + private $message; + private $code; + private $previous; + private $trace; + private $class; + private $statusCode; + private $headers; + private $file; + private $line; + + public static function create(\Exception $exception, $statusCode = null, array $headers = array()) + { + $e = new static(); + $e->setMessage($exception->getMessage()); + $e->setCode($exception->getCode()); + + if ($exception instanceof HttpExceptionInterface) { + $statusCode = $exception->getStatusCode(); + $headers = array_merge($headers, $exception->getHeaders()); + } + + if (null === $statusCode) { + $statusCode = 500; + } + + $e->setStatusCode($statusCode); + $e->setHeaders($headers); + $e->setTraceFromException($exception); + $e->setClass(get_class($exception)); + $e->setFile($exception->getFile()); + $e->setLine($exception->getLine()); + if ($exception->getPrevious()) { + $e->setPrevious(static::create($exception->getPrevious())); + } + + return $e; + } + + public function toArray() + { + $exceptions = array(); + foreach (array_merge(array($this), $this->getAllPrevious()) as $exception) { + $exceptions[] = array( + 'message' => $exception->getMessage(), + 'class' => $exception->getClass(), + 'trace' => $exception->getTrace(), + ); + } + + return $exceptions; + } + + public function getStatusCode() + { + return $this->statusCode; + } + + public function setStatusCode($code) + { + $this->statusCode = $code; + } + + public function getHeaders() + { + return $this->headers; + } + + public function setHeaders(array $headers) + { + $this->headers = $headers; + } + + public function getClass() + { + return $this->class; + } + + public function setClass($class) + { + $this->class = $class; + } + + public function getFile() + { + return $this->file; + } + + public function setFile($file) + { + $this->file = $file; + } + + public function getLine() + { + return $this->line; + } + + public function setLine($line) + { + $this->line = $line; + } + + public function getMessage() + { + return $this->message; + } + + public function setMessage($message) + { + $this->message = $message; + } + + public function getCode() + { + return $this->code; + } + + public function setCode($code) + { + $this->code = $code; + } + + public function getPrevious() + { + return $this->previous; + } + + public function setPrevious(FlattenException $previous) + { + $this->previous = $previous; + } + + public function getAllPrevious() + { + $exceptions = array(); + $e = $this; + while ($e = $e->getPrevious()) { + $exceptions[] = $e; + } + + return $exceptions; + } + + public function getTrace() + { + return $this->trace; + } + + public function setTraceFromException(\Exception $exception) + { + $trace = $exception->getTrace(); + + if ($exception instanceof FatalErrorException) { + if (function_exists('xdebug_get_function_stack')) { + $trace = array_slice(array_reverse(xdebug_get_function_stack()), 4); + + foreach ($trace as $i => $frame) { + // XDebug pre 2.1.1 doesn't currently set the call type key http://bugs.xdebug.org/view.php?id=695 + if (!isset($frame['type'])) { + $trace[$i]['type'] = '??'; + } + + if ('dynamic' === $trace[$i]['type']) { + $trace[$i]['type'] = '->'; + } elseif ('static' === $trace[$i]['type']) { + $trace[$i]['type'] = '::'; + } + + // XDebug also has a different name for the parameters array + if (isset($frame['params']) && !isset($frame['args'])) { + $trace[$i]['args'] = $frame['params']; + unset($trace[$i]['params']); + } + } + } else { + $trace = array_slice(array_reverse($trace), 1); + } + } + + $this->setTrace($trace, $exception->getFile(), $exception->getLine()); + } + + public function setTrace($trace, $file, $line) + { + $this->trace = array(); + $this->trace[] = array( + 'namespace' => '', + 'short_class' => '', + 'class' => '', + 'type' => '', + 'function' => '', + 'file' => $file, + 'line' => $line, + 'args' => array(), + ); + foreach ($trace as $entry) { + $class = ''; + $namespace = ''; + if (isset($entry['class'])) { + $parts = explode('\\', $entry['class']); + $class = array_pop($parts); + $namespace = implode('\\', $parts); + } + + $this->trace[] = array( + 'namespace' => $namespace, + 'short_class' => $class, + 'class' => isset($entry['class']) ? $entry['class'] : '', + 'type' => isset($entry['type']) ? $entry['type'] : '', + 'function' => isset($entry['function']) ? $entry['function'] : null, + 'file' => isset($entry['file']) ? $entry['file'] : null, + 'line' => isset($entry['line']) ? $entry['line'] : null, + 'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : array(), + ); + } + } + + private function flattenArgs($args, $level = 0) + { + $result = array(); + foreach ($args as $key => $value) { + if (is_object($value)) { + $result[$key] = array('object', get_class($value)); + } elseif (is_array($value)) { + if ($level > 10) { + $result[$key] = array('array', '*DEEP NESTED ARRAY*'); + } else { + $result[$key] = array('array', $this->flattenArgs($value, $level + 1)); + } + } elseif (null === $value) { + $result[$key] = array('null', null); + } elseif (is_bool($value)) { + $result[$key] = array('boolean', $value); + } elseif (is_resource($value)) { + $result[$key] = array('resource', get_resource_type($value)); + } elseif ($value instanceof \__PHP_Incomplete_Class) { + // Special case of object, is_object will return false + $result[$key] = array('incomplete-object', $this->getClassNameFromIncomplete($value)); + } else { + $result[$key] = array('string', (string) $value); + } + } + + return $result; + } + + private function getClassNameFromIncomplete(\__PHP_Incomplete_Class $value) + { + $array = new \ArrayObject($value); + + return $array['__PHP_Incomplete_Class_Name']; + } +} diff --git a/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/ExceptionHandler.php b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/ExceptionHandler.php new file mode 100644 index 0000000..b83c13b --- /dev/null +++ b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/ExceptionHandler.php @@ -0,0 +1,318 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Debug; + +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Debug\Exception\FlattenException; + +if (!defined('ENT_SUBSTITUTE')) { + define('ENT_SUBSTITUTE', 8); +} + +/** + * ExceptionHandler converts an exception to a Response object. + * + * It is mostly useful in debug mode to replace the default PHP/XDebug + * output with something prettier and more useful. + * + * As this class is mainly used during Kernel boot, where nothing is yet + * available, the Response content is always HTML. + * + * @author Fabien Potencier + */ +class ExceptionHandler +{ + private $debug; + private $charset; + + public function __construct($debug = true, $charset = 'UTF-8') + { + $this->debug = $debug; + $this->charset = $charset; + } + + /** + * Registers the exception handler. + * + * @param bool $debug + * + * @return ExceptionHandler The registered exception handler + */ + public static function register($debug = true) + { + $handler = new static($debug); + + set_exception_handler(array($handler, 'handle')); + + return $handler; + } + + /** + * Sends a response for the given Exception. + * + * If you have the Symfony HttpFoundation component installed, + * this method will use it to create and send the response. If not, + * it will fallback to plain PHP functions. + * + * @param \Exception $exception An \Exception instance + * + * @see sendPhpResponse + * @see createResponse + */ + public function handle(\Exception $exception) + { + if (class_exists('Symfony\Component\HttpFoundation\Response')) { + $this->createResponse($exception)->send(); + } else { + $this->sendPhpResponse($exception); + } + } + + /** + * Sends the error associated with the given Exception as a plain PHP response. + * + * This method uses plain PHP functions like header() and echo to output + * the response. + * + * @param \Exception|FlattenException $exception An \Exception instance + */ + public function sendPhpResponse($exception) + { + if (!$exception instanceof FlattenException) { + $exception = FlattenException::create($exception); + } + + if (!headers_sent()) { + header(sprintf('HTTP/1.0 %s', $exception->getStatusCode())); + foreach ($exception->getHeaders() as $name => $value) { + header($name.': '.$value, false); + } + } + + echo $this->decorate($this->getContent($exception), $this->getStylesheet($exception)); + } + + /** + * Creates the error Response associated with the given Exception. + * + * @param \Exception|FlattenException $exception An \Exception instance + * + * @return Response A Response instance + */ + public function createResponse($exception) + { + if (!$exception instanceof FlattenException) { + $exception = FlattenException::create($exception); + } + + return new Response($this->decorate($this->getContent($exception), $this->getStylesheet($exception)), $exception->getStatusCode(), $exception->getHeaders()); + } + + /** + * Gets the HTML content associated with the given exception. + * + * @param FlattenException $exception A FlattenException instance + * + * @return string The content as a string + */ + public function getContent(FlattenException $exception) + { + switch ($exception->getStatusCode()) { + case 404: + $title = 'Sorry, the page you are looking for could not be found.'; + break; + default: + $title = 'Whoops, looks like something went wrong.'; + } + + $content = ''; + if ($this->debug) { + try { + $count = count($exception->getAllPrevious()); + $total = $count + 1; + foreach ($exception->toArray() as $position => $e) { + $ind = $count - $position + 1; + $class = $this->abbrClass($e['class']); + $message = nl2br($e['message']); + $content .= sprintf(<< +

%d/%d %s: %s

+ +
+
    + +EOF + , $ind, $total, $class, $message); + foreach ($e['trace'] as $trace) { + $content .= '
  1. '; + if ($trace['function']) { + $content .= sprintf('at %s%s%s(%s)', $this->abbrClass($trace['class']), $trace['type'], $trace['function'], $this->formatArgs($trace['args'])); + } + if (isset($trace['file']) && isset($trace['line'])) { + if ($linkFormat = ini_get('xdebug.file_link_format')) { + $link = str_replace(array('%f', '%l'), array($trace['file'], $trace['line']), $linkFormat); + $content .= sprintf(' in %s line %s', $link, $trace['file'], $trace['line']); + } else { + $content .= sprintf(' in %s line %s', $trace['file'], $trace['line']); + } + } + $content .= "
  2. \n"; + } + + $content .= "
\n
\n"; + } + } catch (\Exception $e) { + // something nasty happened and we cannot throw an exception anymore + if ($this->debug) { + $title = sprintf('Exception thrown when handling an exception (%s: %s)', get_class($exception), $exception->getMessage()); + } else { + $title = 'Whoops, looks like something went wrong.'; + } + } + } + + return << +

$title

+ $content + +EOF; + } + + /** + * Gets the stylesheet associated with the given exception. + * + * @param FlattenException $exception A FlattenException instance + * + * @return string The stylesheet as a string + */ + public function getStylesheet(FlattenException $exception) + { + return << + + + + + + + + $content + + +EOF; + } + + private function abbrClass($class) + { + $parts = explode('\\', $class); + + return sprintf("%s", $class, array_pop($parts)); + } + + /** + * Formats an array as a string. + * + * @param array $args The argument array + * + * @return string + */ + private function formatArgs(array $args) + { + $result = array(); + foreach ($args as $key => $item) { + if ('object' === $item[0]) { + $formattedValue = sprintf("object(%s)", $this->abbrClass($item[1])); + } elseif ('array' === $item[0]) { + $formattedValue = sprintf("array(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); + } elseif ('string' === $item[0]) { + $formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES | ENT_SUBSTITUTE, $this->charset)); + } elseif ('null' === $item[0]) { + $formattedValue = 'null'; + } elseif ('boolean' === $item[0]) { + $formattedValue = ''.strtolower(var_export($item[1], true)).''; + } elseif ('resource' === $item[0]) { + $formattedValue = 'resource'; + } else { + $formattedValue = str_replace("\n", '', var_export(htmlspecialchars((string) $item[1], ENT_QUOTES | ENT_SUBSTITUTE, $this->charset), true)); + } + + $result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue); + } + + return implode(', ', $result); + } +} diff --git a/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/LICENSE b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/LICENSE new file mode 100644 index 0000000..0b3292c --- /dev/null +++ b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2014 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/composer.json b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/composer.json new file mode 100644 index 0000000..35b170a --- /dev/null +++ b/sources/phpBB/vendor/symfony/debug/Symfony/Component/Debug/composer.json @@ -0,0 +1,40 @@ +{ + "name": "symfony/debug", + "type": "library", + "description": "Symfony Debug Component", + "keywords": [], + "homepage": "http://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/http-kernel": "~2.1", + "symfony/http-foundation": "~2.1" + }, + "suggest": { + "symfony/http-foundation": "", + "symfony/http-kernel": "", + "symfony/class-loader": "" + }, + "autoload": { + "psr-0": { "Symfony\\Component\\Debug\\": "" } + }, + "target-dir": "Symfony/Component/Debug", + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Alias.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Alias.php new file mode 100644 index 0000000..021b0c6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Alias.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * @api + */ +class Alias +{ + private $id; + private $public; + + /** + * Constructor. + * + * @param string $id Alias identifier + * @param bool $public If this alias is public + * + * @api + */ + public function __construct($id, $public = true) + { + $this->id = strtolower($id); + $this->public = $public; + } + + /** + * Checks if this DI Alias should be public or not. + * + * @return bool + * + * @api + */ + public function isPublic() + { + return $this->public; + } + + /** + * Sets if this Alias is public. + * + * @param bool $boolean If this Alias should be public + * + * @api + */ + public function setPublic($boolean) + { + $this->public = (bool) $boolean; + } + + /** + * Returns the Id of this alias. + * + * @return string The alias id + * + * @api + */ + public function __toString() + { + return $this->id; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php new file mode 100644 index 0000000..f488052 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php @@ -0,0 +1,144 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Run this pass before passes that need to know more about the relation of + * your services. + * + * This class will populate the ServiceReferenceGraph with information. You can + * retrieve the graph in other passes from the compiler. + * + * @author Johannes M. Schmitt + */ +class AnalyzeServiceReferencesPass implements RepeatablePassInterface +{ + private $graph; + private $container; + private $currentId; + private $currentDefinition; + private $repeatedPass; + private $onlyConstructorArguments; + + /** + * Constructor. + * + * @param bool $onlyConstructorArguments Sets this Service Reference pass to ignore method calls + */ + public function __construct($onlyConstructorArguments = false) + { + $this->onlyConstructorArguments = (bool) $onlyConstructorArguments; + } + + /** + * {@inheritdoc} + */ + public function setRepeatedPass(RepeatedPass $repeatedPass) + { + $this->repeatedPass = $repeatedPass; + } + + /** + * Processes a ContainerBuilder object to populate the service reference graph. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->container = $container; + $this->graph = $container->getCompiler()->getServiceReferenceGraph(); + $this->graph->clear(); + + foreach ($container->getDefinitions() as $id => $definition) { + if ($definition->isSynthetic() || $definition->isAbstract()) { + continue; + } + + $this->currentId = $id; + $this->currentDefinition = $definition; + + $this->processArguments($definition->getArguments()); + if ($definition->getFactoryService()) { + $this->processArguments(array(new Reference($definition->getFactoryService()))); + } + + if (!$this->onlyConstructorArguments) { + $this->processArguments($definition->getMethodCalls()); + $this->processArguments($definition->getProperties()); + if ($definition->getConfigurator()) { + $this->processArguments(array($definition->getConfigurator())); + } + } + } + + foreach ($container->getAliases() as $id => $alias) { + $this->graph->connect($id, $alias, (string) $alias, $this->getDefinition((string) $alias), null); + } + } + + /** + * Processes service definitions for arguments to find relationships for the service graph. + * + * @param array $arguments An array of Reference or Definition objects relating to service definitions + */ + private function processArguments(array $arguments) + { + foreach ($arguments as $argument) { + if (is_array($argument)) { + $this->processArguments($argument); + } elseif ($argument instanceof Reference) { + $this->graph->connect( + $this->currentId, + $this->currentDefinition, + $this->getDefinitionId((string) $argument), + $this->getDefinition((string) $argument), + $argument + ); + } elseif ($argument instanceof Definition) { + $this->processArguments($argument->getArguments()); + $this->processArguments($argument->getMethodCalls()); + $this->processArguments($argument->getProperties()); + } + } + } + + /** + * Returns a service definition given the full name or an alias. + * + * @param string $id A full id or alias for a service definition. + * + * @return Definition|null The definition related to the supplied id + */ + private function getDefinition($id) + { + $id = $this->getDefinitionId($id); + + return null === $id ? null : $this->container->getDefinition($id); + } + + private function getDefinitionId($id) + { + while ($this->container->hasAlias($id)) { + $id = (string) $this->container->getAlias($id); + } + + if (!$this->container->hasDefinition($id)) { + return; + } + + return $id; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php new file mode 100644 index 0000000..e81110d --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Checks your services for circular references + * + * References from method calls are ignored since we might be able to resolve + * these references depending on the order in which services are called. + * + * Circular reference from method calls will only be detected at run-time. + * + * @author Johannes M. Schmitt + */ +class CheckCircularReferencesPass implements CompilerPassInterface +{ + private $currentId; + private $currentPath; + private $checkedNodes; + + /** + * Checks the ContainerBuilder object for circular references. + * + * @param ContainerBuilder $container The ContainerBuilder instances + */ + public function process(ContainerBuilder $container) + { + $graph = $container->getCompiler()->getServiceReferenceGraph(); + + $this->checkedNodes = array(); + foreach ($graph->getNodes() as $id => $node) { + $this->currentId = $id; + $this->currentPath = array($id); + + $this->checkOutEdges($node->getOutEdges()); + } + } + + /** + * Checks for circular references. + * + * @param ServiceReferenceGraphEdge[] $edges An array of Edges + * + * @throws ServiceCircularReferenceException When a circular reference is found. + */ + private function checkOutEdges(array $edges) + { + foreach ($edges as $edge) { + $node = $edge->getDestNode(); + $id = $node->getId(); + + if (empty($this->checkedNodes[$id])) { + $searchKey = array_search($id, $this->currentPath); + $this->currentPath[] = $id; + + if (false !== $searchKey) { + throw new ServiceCircularReferenceException($id, array_slice($this->currentPath, $searchKey)); + } + + $this->checkOutEdges($node->getOutEdges()); + + $this->checkedNodes[$id] = true; + array_pop($this->currentPath); + } + } + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php new file mode 100644 index 0000000..e536331 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; + +/** + * This pass validates each definition individually only taking the information + * into account which is contained in the definition itself. + * + * Later passes can rely on the following, and specifically do not need to + * perform these checks themselves: + * + * - non synthetic, non abstract services always have a class set + * - synthetic services are always public + * - synthetic services are always of non-prototype scope + * + * @author Johannes M. Schmitt + */ +class CheckDefinitionValidityPass implements CompilerPassInterface +{ + /** + * Processes the ContainerBuilder to validate the Definition. + * + * @param ContainerBuilder $container + * + * @throws RuntimeException When the Definition is invalid + */ + public function process(ContainerBuilder $container) + { + foreach ($container->getDefinitions() as $id => $definition) { + // synthetic service is public + if ($definition->isSynthetic() && !$definition->isPublic()) { + throw new RuntimeException(sprintf( + 'A synthetic service ("%s") must be public.', + $id + )); + } + + // synthetic service has non-prototype scope + if ($definition->isSynthetic() && ContainerInterface::SCOPE_PROTOTYPE === $definition->getScope()) { + throw new RuntimeException(sprintf( + 'A synthetic service ("%s") cannot be of scope "prototype".', + $id + )); + } + + // non-synthetic, non-abstract service has class + if (!$definition->isAbstract() && !$definition->isSynthetic() && !$definition->getClass()) { + if ($definition->getFactoryClass() || $definition->getFactoryService()) { + throw new RuntimeException(sprintf( + 'Please add the class to service "%s" even if it is constructed by a factory ' + .'since we might need to add method calls based on compile-time checks.', + $id + )); + } + + throw new RuntimeException(sprintf( + 'The definition for "%s" has no class. If you intend to inject ' + .'this service dynamically at runtime, please mark it as synthetic=true. ' + .'If this is an abstract definition solely used by child definitions, ' + .'please add abstract=true, otherwise specify a class to get rid of this error.', + $id + )); + } + } + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php new file mode 100644 index 0000000..2cd5480 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Definition; + +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Checks that all references are pointing to a valid service. + * + * @author Johannes M. Schmitt + */ +class CheckExceptionOnInvalidReferenceBehaviorPass implements CompilerPassInterface +{ + private $container; + private $sourceId; + + public function process(ContainerBuilder $container) + { + $this->container = $container; + + foreach ($container->getDefinitions() as $id => $definition) { + $this->sourceId = $id; + $this->processDefinition($definition); + } + } + + private function processDefinition(Definition $definition) + { + $this->processReferences($definition->getArguments()); + $this->processReferences($definition->getMethodCalls()); + $this->processReferences($definition->getProperties()); + } + + private function processReferences(array $arguments) + { + foreach ($arguments as $argument) { + if (is_array($argument)) { + $this->processReferences($argument); + } elseif ($argument instanceof Definition) { + $this->processDefinition($argument); + } elseif ($argument instanceof Reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE === $argument->getInvalidBehavior()) { + $destId = (string) $argument; + + if (!$this->container->has($destId)) { + throw new ServiceNotFoundException($destId, $this->sourceId); + } + } + } + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php new file mode 100644 index 0000000..aa11d38 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php @@ -0,0 +1,167 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ScopeCrossingInjectionException; +use Symfony\Component\DependencyInjection\Exception\ScopeWideningInjectionException; + +/** + * Checks the validity of references + * + * The following checks are performed by this pass: + * - target definitions are not abstract + * - target definitions are of equal or wider scope + * - target definitions are in the same scope hierarchy + * + * @author Johannes M. Schmitt + */ +class CheckReferenceValidityPass implements CompilerPassInterface +{ + private $container; + private $currentId; + private $currentDefinition; + private $currentScope; + private $currentScopeAncestors; + private $currentScopeChildren; + + /** + * Processes the ContainerBuilder to validate References. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->container = $container; + + $children = $this->container->getScopeChildren(); + $ancestors = array(); + + $scopes = $this->container->getScopes(); + foreach ($scopes as $name => $parent) { + $ancestors[$name] = array($parent); + + while (isset($scopes[$parent])) { + $ancestors[$name][] = $parent = $scopes[$parent]; + } + } + + foreach ($container->getDefinitions() as $id => $definition) { + if ($definition->isSynthetic() || $definition->isAbstract()) { + continue; + } + + $this->currentId = $id; + $this->currentDefinition = $definition; + $this->currentScope = $scope = $definition->getScope(); + + if (ContainerInterface::SCOPE_CONTAINER === $scope) { + $this->currentScopeChildren = array_keys($scopes); + $this->currentScopeAncestors = array(); + } elseif (ContainerInterface::SCOPE_PROTOTYPE !== $scope) { + $this->currentScopeChildren = isset($children[$scope]) ? $children[$scope] : array(); + $this->currentScopeAncestors = isset($ancestors[$scope]) ? $ancestors[$scope] : array(); + } + + $this->validateReferences($definition->getArguments()); + $this->validateReferences($definition->getMethodCalls()); + $this->validateReferences($definition->getProperties()); + } + } + + /** + * Validates an array of References. + * + * @param array $arguments An array of Reference objects + * + * @throws RuntimeException when there is a reference to an abstract definition. + */ + private function validateReferences(array $arguments) + { + foreach ($arguments as $argument) { + if (is_array($argument)) { + $this->validateReferences($argument); + } elseif ($argument instanceof Reference) { + $targetDefinition = $this->getDefinition((string) $argument); + + if (null !== $targetDefinition && $targetDefinition->isAbstract()) { + throw new RuntimeException(sprintf( + 'The definition "%s" has a reference to an abstract definition "%s". ' + .'Abstract definitions cannot be the target of references.', + $this->currentId, + $argument + )); + } + + $this->validateScope($argument, $targetDefinition); + } + } + } + + /** + * Validates the scope of a single Reference. + * + * @param Reference $reference + * @param Definition $definition + * + * @throws ScopeWideningInjectionException when the definition references a service of a narrower scope + * @throws ScopeCrossingInjectionException when the definition references a service of another scope hierarchy + */ + private function validateScope(Reference $reference, Definition $definition = null) + { + if (ContainerInterface::SCOPE_PROTOTYPE === $this->currentScope) { + return; + } + + if (!$reference->isStrict()) { + return; + } + + if (null === $definition) { + return; + } + + if ($this->currentScope === $scope = $definition->getScope()) { + return; + } + + $id = (string) $reference; + + if (in_array($scope, $this->currentScopeChildren, true)) { + throw new ScopeWideningInjectionException($this->currentId, $this->currentScope, $id, $scope); + } + + if (!in_array($scope, $this->currentScopeAncestors, true)) { + throw new ScopeCrossingInjectionException($this->currentId, $this->currentScope, $id, $scope); + } + } + + /** + * Returns the Definition given an id. + * + * @param string $id Definition identifier + * + * @return Definition + */ + private function getDefinition($id) + { + if (!$this->container->hasDefinition($id)) { + return; + } + + return $this->container->getDefinition($id); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php new file mode 100644 index 0000000..36d0604 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php @@ -0,0 +1,121 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * This class is used to remove circular dependencies between individual passes. + * + * @author Johannes M. Schmitt + * + * @api + */ +class Compiler +{ + private $passConfig; + private $log; + private $loggingFormatter; + private $serviceReferenceGraph; + + /** + * Constructor. + */ + public function __construct() + { + $this->passConfig = new PassConfig(); + $this->serviceReferenceGraph = new ServiceReferenceGraph(); + $this->loggingFormatter = new LoggingFormatter(); + $this->log = array(); + } + + /** + * Returns the PassConfig. + * + * @return PassConfig The PassConfig instance + * + * @api + */ + public function getPassConfig() + { + return $this->passConfig; + } + + /** + * Returns the ServiceReferenceGraph. + * + * @return ServiceReferenceGraph The ServiceReferenceGraph instance + * + * @api + */ + public function getServiceReferenceGraph() + { + return $this->serviceReferenceGraph; + } + + /** + * Returns the logging formatter which can be used by compilation passes. + * + * @return LoggingFormatter + */ + public function getLoggingFormatter() + { + return $this->loggingFormatter; + } + + /** + * Adds a pass to the PassConfig. + * + * @param CompilerPassInterface $pass A compiler pass + * @param string $type The type of the pass + * + * @api + */ + public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION) + { + $this->passConfig->addPass($pass, $type); + } + + /** + * Adds a log message. + * + * @param string $string The log message + */ + public function addLogMessage($string) + { + $this->log[] = $string; + } + + /** + * Returns the log. + * + * @return array Log array + */ + public function getLog() + { + return $this->log; + } + + /** + * Run the Compiler and process all Passes. + * + * @param ContainerBuilder $container + * + * @api + */ + public function compile(ContainerBuilder $container) + { + foreach ($this->passConfig->getPasses() as $pass) { + $pass->process($container); + } + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php new file mode 100644 index 0000000..beacda9 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Interface that must be implemented by compilation passes + * + * @author Johannes M. Schmitt + * + * @api + */ +interface CompilerPassInterface +{ + /** + * You can modify the container here before it is dumped to PHP code. + * + * @param ContainerBuilder $container + * + * @api + */ + public function process(ContainerBuilder $container); +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php new file mode 100644 index 0000000..5d4f2bf --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php @@ -0,0 +1,143 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Inline service definitions where this is possible. + * + * @author Johannes M. Schmitt + */ +class InlineServiceDefinitionsPass implements RepeatablePassInterface +{ + private $repeatedPass; + private $graph; + private $compiler; + private $formatter; + private $currentId; + + /** + * {@inheritdoc} + */ + public function setRepeatedPass(RepeatedPass $repeatedPass) + { + $this->repeatedPass = $repeatedPass; + } + + /** + * Processes the ContainerBuilder for inline service definitions. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->compiler = $container->getCompiler(); + $this->formatter = $this->compiler->getLoggingFormatter(); + $this->graph = $this->compiler->getServiceReferenceGraph(); + + foreach ($container->getDefinitions() as $id => $definition) { + $this->currentId = $id; + + $definition->setArguments( + $this->inlineArguments($container, $definition->getArguments()) + ); + + $definition->setMethodCalls( + $this->inlineArguments($container, $definition->getMethodCalls()) + ); + + $definition->setProperties( + $this->inlineArguments($container, $definition->getProperties()) + ); + } + } + + /** + * Processes inline arguments. + * + * @param ContainerBuilder $container The ContainerBuilder + * @param array $arguments An array of arguments + * + * @return array + */ + private function inlineArguments(ContainerBuilder $container, array $arguments) + { + foreach ($arguments as $k => $argument) { + if (is_array($argument)) { + $arguments[$k] = $this->inlineArguments($container, $argument); + } elseif ($argument instanceof Reference) { + if (!$container->hasDefinition($id = (string) $argument)) { + continue; + } + + if ($this->isInlineableDefinition($container, $id, $definition = $container->getDefinition($id))) { + $this->compiler->addLogMessage($this->formatter->formatInlineService($this, $id, $this->currentId)); + + if (ContainerInterface::SCOPE_PROTOTYPE !== $definition->getScope()) { + $arguments[$k] = $definition; + } else { + $arguments[$k] = clone $definition; + } + } + } elseif ($argument instanceof Definition) { + $argument->setArguments($this->inlineArguments($container, $argument->getArguments())); + $argument->setMethodCalls($this->inlineArguments($container, $argument->getMethodCalls())); + $argument->setProperties($this->inlineArguments($container, $argument->getProperties())); + } + } + + return $arguments; + } + + /** + * Checks if the definition is inlineable. + * + * @param ContainerBuilder $container + * @param string $id + * @param Definition $definition + * + * @return bool If the definition is inlineable + */ + private function isInlineableDefinition(ContainerBuilder $container, $id, Definition $definition) + { + if (ContainerInterface::SCOPE_PROTOTYPE === $definition->getScope()) { + return true; + } + + if ($definition->isPublic() || $definition->isLazy()) { + return false; + } + + if (!$this->graph->hasNode($id)) { + return true; + } + + if ($this->currentId == $id) { + return false; + } + + $ids = array(); + foreach ($this->graph->getNode($id)->getInEdges() as $edge) { + $ids[] = $edge->getSourceNode()->getId(); + } + + if (count(array_unique($ids)) > 1) { + return false; + } + + return $container->getDefinition(reset($ids))->getScope() === $definition->getScope(); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php new file mode 100644 index 0000000..6bd6161 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +/** + * Used to format logging messages during the compilation. + * + * @author Johannes M. Schmitt + */ +class LoggingFormatter +{ + public function formatRemoveService(CompilerPassInterface $pass, $id, $reason) + { + return $this->format($pass, sprintf('Removed service "%s"; reason: %s', $id, $reason)); + } + + public function formatInlineService(CompilerPassInterface $pass, $id, $target) + { + return $this->format($pass, sprintf('Inlined service "%s" to "%s".', $id, $target)); + } + + public function formatUpdateReference(CompilerPassInterface $pass, $serviceId, $oldDestId, $newDestId) + { + return $this->format($pass, sprintf('Changed reference of service "%s" previously pointing to "%s" to "%s".', $serviceId, $oldDestId, $newDestId)); + } + + public function formatResolveInheritance(CompilerPassInterface $pass, $childId, $parentId) + { + return $this->format($pass, sprintf('Resolving inheritance for "%s" (parent: %s).', $childId, $parentId)); + } + + public function format(CompilerPassInterface $pass, $message) + { + return sprintf('%s: %s', get_class($pass), $message); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php new file mode 100644 index 0000000..92a9887 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; + +/** + * Merges extension configs into the container builder + * + * @author Fabien Potencier + */ +class MergeExtensionConfigurationPass implements CompilerPassInterface +{ + /** + * {@inheritdoc} + */ + public function process(ContainerBuilder $container) + { + $parameters = $container->getParameterBag()->all(); + $definitions = $container->getDefinitions(); + $aliases = $container->getAliases(); + + foreach ($container->getExtensions() as $extension) { + if ($extension instanceof PrependExtensionInterface) { + $extension->prepend($container); + } + } + + foreach ($container->getExtensions() as $name => $extension) { + if (!$config = $container->getExtensionConfig($name)) { + // this extension was not called + continue; + } + $config = $container->getParameterBag()->resolveValue($config); + + $tmpContainer = new ContainerBuilder($container->getParameterBag()); + $tmpContainer->setResourceTracking($container->isTrackingResources()); + $tmpContainer->addObjectResource($extension); + + $extension->load($config, $tmpContainer); + + $container->merge($tmpContainer); + } + + $container->addDefinitions($definitions); + $container->addAliases($aliases); + $container->getParameterBag()->add($parameters); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php new file mode 100644 index 0000000..e863f75 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php @@ -0,0 +1,259 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; + +/** + * Compiler Pass Configuration + * + * This class has a default configuration embedded. + * + * @author Johannes M. Schmitt + * + * @api + */ +class PassConfig +{ + const TYPE_AFTER_REMOVING = 'afterRemoving'; + const TYPE_BEFORE_OPTIMIZATION = 'beforeOptimization'; + const TYPE_BEFORE_REMOVING = 'beforeRemoving'; + const TYPE_OPTIMIZE = 'optimization'; + const TYPE_REMOVE = 'removing'; + + private $mergePass; + private $afterRemovingPasses; + private $beforeOptimizationPasses; + private $beforeRemovingPasses; + private $optimizationPasses; + private $removingPasses; + + /** + * Constructor. + */ + public function __construct() + { + $this->mergePass = new MergeExtensionConfigurationPass(); + + $this->afterRemovingPasses = array(); + $this->beforeOptimizationPasses = array(); + $this->beforeRemovingPasses = array(); + + $this->optimizationPasses = array( + new ResolveDefinitionTemplatesPass(), + new ResolveParameterPlaceHoldersPass(), + new CheckDefinitionValidityPass(), + new ResolveReferencesToAliasesPass(), + new ResolveInvalidReferencesPass(), + new AnalyzeServiceReferencesPass(true), + new CheckCircularReferencesPass(), + new CheckReferenceValidityPass(), + ); + + $this->removingPasses = array( + new RemovePrivateAliasesPass(), + new RemoveAbstractDefinitionsPass(), + new ReplaceAliasByActualDefinitionPass(), + new RepeatedPass(array( + new AnalyzeServiceReferencesPass(), + new InlineServiceDefinitionsPass(), + new AnalyzeServiceReferencesPass(), + new RemoveUnusedDefinitionsPass(), + )), + new CheckExceptionOnInvalidReferenceBehaviorPass(), + ); + } + + /** + * Returns all passes in order to be processed. + * + * @return array An array of all passes to process + * + * @api + */ + public function getPasses() + { + return array_merge( + array($this->mergePass), + $this->beforeOptimizationPasses, + $this->optimizationPasses, + $this->beforeRemovingPasses, + $this->removingPasses, + $this->afterRemovingPasses + ); + } + + /** + * Adds a pass. + * + * @param CompilerPassInterface $pass A Compiler pass + * @param string $type The pass type + * + * @throws InvalidArgumentException when a pass type doesn't exist + * + * @api + */ + public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION) + { + $property = $type.'Passes'; + if (!isset($this->$property)) { + throw new InvalidArgumentException(sprintf('Invalid type "%s".', $type)); + } + + $passes = &$this->$property; + $passes[] = $pass; + } + + /** + * Gets all passes for the AfterRemoving pass. + * + * @return array An array of passes + * + * @api + */ + public function getAfterRemovingPasses() + { + return $this->afterRemovingPasses; + } + + /** + * Gets all passes for the BeforeOptimization pass. + * + * @return array An array of passes + * + * @api + */ + public function getBeforeOptimizationPasses() + { + return $this->beforeOptimizationPasses; + } + + /** + * Gets all passes for the BeforeRemoving pass. + * + * @return array An array of passes + * + * @api + */ + public function getBeforeRemovingPasses() + { + return $this->beforeRemovingPasses; + } + + /** + * Gets all passes for the Optimization pass. + * + * @return array An array of passes + * + * @api + */ + public function getOptimizationPasses() + { + return $this->optimizationPasses; + } + + /** + * Gets all passes for the Removing pass. + * + * @return array An array of passes + * + * @api + */ + public function getRemovingPasses() + { + return $this->removingPasses; + } + + /** + * Gets all passes for the Merge pass. + * + * @return array An array of passes + * + * @api + */ + public function getMergePass() + { + return $this->mergePass; + } + + /** + * Sets the Merge Pass. + * + * @param CompilerPassInterface $pass The merge pass + * + * @api + */ + public function setMergePass(CompilerPassInterface $pass) + { + $this->mergePass = $pass; + } + + /** + * Sets the AfterRemoving passes. + * + * @param array $passes An array of passes + * + * @api + */ + public function setAfterRemovingPasses(array $passes) + { + $this->afterRemovingPasses = $passes; + } + + /** + * Sets the BeforeOptimization passes. + * + * @param array $passes An array of passes + * + * @api + */ + public function setBeforeOptimizationPasses(array $passes) + { + $this->beforeOptimizationPasses = $passes; + } + + /** + * Sets the BeforeRemoving passes. + * + * @param array $passes An array of passes + * + * @api + */ + public function setBeforeRemovingPasses(array $passes) + { + $this->beforeRemovingPasses = $passes; + } + + /** + * Sets the Optimization passes. + * + * @param array $passes An array of passes + * + * @api + */ + public function setOptimizationPasses(array $passes) + { + $this->optimizationPasses = $passes; + } + + /** + * Sets the Removing passes. + * + * @param array $passes An array of passes + * + * @api + */ + public function setRemovingPasses(array $passes) + { + $this->removingPasses = $passes; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php new file mode 100644 index 0000000..d97d923 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Removes abstract Definitions + * + */ +class RemoveAbstractDefinitionsPass implements CompilerPassInterface +{ + /** + * Removes abstract definitions from the ContainerBuilder + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $compiler = $container->getCompiler(); + $formatter = $compiler->getLoggingFormatter(); + + foreach ($container->getDefinitions() as $id => $definition) { + if ($definition->isAbstract()) { + $container->removeDefinition($id); + $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'abstract')); + } + } + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php new file mode 100644 index 0000000..4842337 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Remove private aliases from the container. They were only used to establish + * dependencies between services, and these dependencies have been resolved in + * one of the previous passes. + * + * @author Johannes M. Schmitt + */ +class RemovePrivateAliasesPass implements CompilerPassInterface +{ + /** + * Removes private aliases from the ContainerBuilder + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $compiler = $container->getCompiler(); + $formatter = $compiler->getLoggingFormatter(); + + foreach ($container->getAliases() as $id => $alias) { + if ($alias->isPublic()) { + continue; + } + + $container->removeAlias($id); + $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'private alias')); + } + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php new file mode 100644 index 0000000..9e18a9e --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php @@ -0,0 +1,84 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Removes unused service definitions from the container. + * + * @author Johannes M. Schmitt + */ +class RemoveUnusedDefinitionsPass implements RepeatablePassInterface +{ + private $repeatedPass; + + /** + * {@inheritdoc} + */ + public function setRepeatedPass(RepeatedPass $repeatedPass) + { + $this->repeatedPass = $repeatedPass; + } + + /** + * Processes the ContainerBuilder to remove unused definitions. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $compiler = $container->getCompiler(); + $formatter = $compiler->getLoggingFormatter(); + $graph = $compiler->getServiceReferenceGraph(); + + $hasChanged = false; + foreach ($container->getDefinitions() as $id => $definition) { + if ($definition->isPublic()) { + continue; + } + + if ($graph->hasNode($id)) { + $edges = $graph->getNode($id)->getInEdges(); + $referencingAliases = array(); + $sourceIds = array(); + foreach ($edges as $edge) { + $node = $edge->getSourceNode(); + $sourceIds[] = $node->getId(); + + if ($node->isAlias()) { + $referencingAliases[] = $node->getValue(); + } + } + $isReferenced = (count(array_unique($sourceIds)) - count($referencingAliases)) > 0; + } else { + $referencingAliases = array(); + $isReferenced = false; + } + + if (1 === count($referencingAliases) && false === $isReferenced) { + $container->setDefinition((string) reset($referencingAliases), $definition); + $definition->setPublic(true); + $container->removeDefinition($id); + $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'replaces alias '.reset($referencingAliases))); + } elseif (0 === count($referencingAliases) && false === $isReferenced) { + $container->removeDefinition($id); + $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'unused')); + $hasChanged = true; + } + } + + if ($hasChanged) { + $this->repeatedPass->setRepeat(); + } + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php new file mode 100644 index 0000000..d60ae35 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +/** + * Interface that must be implemented by passes that are run as part of an + * RepeatedPass. + * + * @author Johannes M. Schmitt + */ +interface RepeatablePassInterface extends CompilerPassInterface +{ + /** + * Sets the RepeatedPass interface. + * + * @param RepeatedPass $repeatedPass + */ + public function setRepeatedPass(RepeatedPass $repeatedPass); +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php new file mode 100644 index 0000000..9b7db40 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php @@ -0,0 +1,88 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; + +/** + * A pass that might be run repeatedly. + * + * @author Johannes M. Schmitt + */ +class RepeatedPass implements CompilerPassInterface +{ + /** + * @var bool + */ + private $repeat = false; + + /** + * @var RepeatablePassInterface[] + */ + private $passes; + + /** + * Constructor. + * + * @param RepeatablePassInterface[] $passes An array of RepeatablePassInterface objects + * + * @throws InvalidArgumentException when the passes don't implement RepeatablePassInterface + */ + public function __construct(array $passes) + { + foreach ($passes as $pass) { + if (!$pass instanceof RepeatablePassInterface) { + throw new InvalidArgumentException('$passes must be an array of RepeatablePassInterface.'); + } + + $pass->setRepeatedPass($this); + } + + $this->passes = $passes; + } + + /** + * Process the repeatable passes that run more than once. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->repeat = false; + foreach ($this->passes as $pass) { + $pass->process($container); + } + + if ($this->repeat) { + $this->process($container); + } + } + + /** + * Sets if the pass should repeat + */ + public function setRepeat() + { + $this->repeat = true; + } + + /** + * Returns the passes + * + * @return RepeatablePassInterface[] An array of RepeatablePassInterface objects + */ + public function getPasses() + { + return $this->passes; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php new file mode 100644 index 0000000..972d708 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php @@ -0,0 +1,125 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Reference; + +/** + * Replaces aliases with actual service definitions, effectively removing these + * aliases. + * + * @author Johannes M. Schmitt + */ +class ReplaceAliasByActualDefinitionPass implements CompilerPassInterface +{ + private $compiler; + private $formatter; + private $sourceId; + + /** + * Process the Container to replace aliases with service definitions. + * + * @param ContainerBuilder $container + * + * @throws InvalidArgumentException if the service definition does not exist + */ + public function process(ContainerBuilder $container) + { + $this->compiler = $container->getCompiler(); + $this->formatter = $this->compiler->getLoggingFormatter(); + + foreach ($container->getAliases() as $id => $alias) { + $aliasId = (string) $alias; + + try { + $definition = $container->getDefinition($aliasId); + } catch (InvalidArgumentException $e) { + throw new InvalidArgumentException(sprintf('Unable to replace alias "%s" with "%s".', $alias, $id), null, $e); + } + + if ($definition->isPublic()) { + continue; + } + + $definition->setPublic(true); + $container->setDefinition($id, $definition); + $container->removeDefinition($aliasId); + + $this->updateReferences($container, $aliasId, $id); + + // we have to restart the process due to concurrent modification of + // the container + $this->process($container); + + break; + } + } + + /** + * Updates references to remove aliases. + * + * @param ContainerBuilder $container The container + * @param string $currentId The alias identifier being replaced + * @param string $newId The id of the service the alias points to + */ + private function updateReferences($container, $currentId, $newId) + { + foreach ($container->getAliases() as $id => $alias) { + if ($currentId === (string) $alias) { + $container->setAlias($id, $newId); + } + } + + foreach ($container->getDefinitions() as $id => $definition) { + $this->sourceId = $id; + + $definition->setArguments( + $this->updateArgumentReferences($definition->getArguments(), $currentId, $newId) + ); + + $definition->setMethodCalls( + $this->updateArgumentReferences($definition->getMethodCalls(), $currentId, $newId) + ); + + $definition->setProperties( + $this->updateArgumentReferences($definition->getProperties(), $currentId, $newId) + ); + } + } + + /** + * Updates argument references. + * + * @param array $arguments An array of Arguments + * @param string $currentId The alias identifier + * @param string $newId The identifier the alias points to + * + * @return array + */ + private function updateArgumentReferences(array $arguments, $currentId, $newId) + { + foreach ($arguments as $k => $argument) { + if (is_array($argument)) { + $arguments[$k] = $this->updateArgumentReferences($argument, $currentId, $newId); + } elseif ($argument instanceof Reference) { + if ($currentId === (string) $argument) { + $arguments[$k] = new Reference($newId, $argument->getInvalidBehavior()); + $this->compiler->addLogMessage($this->formatter->formatUpdateReference($this, $this->sourceId, $currentId, $newId)); + } + } + } + + return $arguments; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php new file mode 100644 index 0000000..4527840 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php @@ -0,0 +1,154 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\DefinitionDecorator; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; + +/** + * This replaces all DefinitionDecorator instances with their equivalent fully + * merged Definition instance. + * + * @author Johannes M. Schmitt + */ +class ResolveDefinitionTemplatesPass implements CompilerPassInterface +{ + private $container; + private $compiler; + private $formatter; + + /** + * Process the ContainerBuilder to replace DefinitionDecorator instances with their real Definition instances. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->container = $container; + $this->compiler = $container->getCompiler(); + $this->formatter = $this->compiler->getLoggingFormatter(); + + foreach (array_keys($container->getDefinitions()) as $id) { + // yes, we are specifically fetching the definition from the + // container to ensure we are not operating on stale data + $definition = $container->getDefinition($id); + if (!$definition instanceof DefinitionDecorator || $definition->isAbstract()) { + continue; + } + + $this->resolveDefinition($id, $definition); + } + } + + /** + * Resolves the definition + * + * @param string $id The definition identifier + * @param DefinitionDecorator $definition + * + * @return Definition + * + * @throws \RuntimeException When the definition is invalid + */ + private function resolveDefinition($id, DefinitionDecorator $definition) + { + if (!$this->container->hasDefinition($parent = $definition->getParent())) { + throw new RuntimeException(sprintf('The parent definition "%s" defined for definition "%s" does not exist.', $parent, $id)); + } + + $parentDef = $this->container->getDefinition($parent); + if ($parentDef instanceof DefinitionDecorator) { + $parentDef = $this->resolveDefinition($parent, $parentDef); + } + + $this->compiler->addLogMessage($this->formatter->formatResolveInheritance($this, $id, $parent)); + $def = new Definition(); + + // merge in parent definition + // purposely ignored attributes: scope, abstract, tags + $def->setClass($parentDef->getClass()); + $def->setArguments($parentDef->getArguments()); + $def->setMethodCalls($parentDef->getMethodCalls()); + $def->setProperties($parentDef->getProperties()); + $def->setFactoryClass($parentDef->getFactoryClass()); + $def->setFactoryMethod($parentDef->getFactoryMethod()); + $def->setFactoryService($parentDef->getFactoryService()); + $def->setConfigurator($parentDef->getConfigurator()); + $def->setFile($parentDef->getFile()); + $def->setPublic($parentDef->isPublic()); + $def->setLazy($parentDef->isLazy()); + + // overwrite with values specified in the decorator + $changes = $definition->getChanges(); + if (isset($changes['class'])) { + $def->setClass($definition->getClass()); + } + if (isset($changes['factory_class'])) { + $def->setFactoryClass($definition->getFactoryClass()); + } + if (isset($changes['factory_method'])) { + $def->setFactoryMethod($definition->getFactoryMethod()); + } + if (isset($changes['factory_service'])) { + $def->setFactoryService($definition->getFactoryService()); + } + if (isset($changes['configurator'])) { + $def->setConfigurator($definition->getConfigurator()); + } + if (isset($changes['file'])) { + $def->setFile($definition->getFile()); + } + if (isset($changes['public'])) { + $def->setPublic($definition->isPublic()); + } + if (isset($changes['lazy'])) { + $def->setLazy($definition->isLazy()); + } + + // merge arguments + foreach ($definition->getArguments() as $k => $v) { + if (is_numeric($k)) { + $def->addArgument($v); + continue; + } + + if (0 !== strpos($k, 'index_')) { + throw new RuntimeException(sprintf('Invalid argument key "%s" found.', $k)); + } + + $index = (int) substr($k, strlen('index_')); + $def->replaceArgument($index, $v); + } + + // merge properties + foreach ($definition->getProperties() as $k => $v) { + $def->setProperty($k, $v); + } + + // append method calls + if (count($calls = $definition->getMethodCalls()) > 0) { + $def->setMethodCalls(array_merge($def->getMethodCalls(), $calls)); + } + + // these attributes are always taken from the child + $def->setAbstract($definition->isAbstract()); + $def->setScope($definition->getScope()); + $def->setTags($definition->getTags()); + + // set new definition on container + $this->container->setDefinition($id, $def); + + return $def; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php new file mode 100644 index 0000000..83aef9b --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php @@ -0,0 +1,105 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; + +/** + * Emulates the invalid behavior if the reference is not found within the + * container. + * + * @author Johannes M. Schmitt + */ +class ResolveInvalidReferencesPass implements CompilerPassInterface +{ + private $container; + + /** + * Process the ContainerBuilder to resolve invalid references. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->container = $container; + foreach ($container->getDefinitions() as $definition) { + if ($definition->isSynthetic() || $definition->isAbstract()) { + continue; + } + + $definition->setArguments( + $this->processArguments($definition->getArguments()) + ); + + $calls = array(); + foreach ($definition->getMethodCalls() as $call) { + try { + $calls[] = array($call[0], $this->processArguments($call[1], true)); + } catch (RuntimeException $ignore) { + // this call is simply removed + } + } + $definition->setMethodCalls($calls); + + $properties = array(); + foreach ($definition->getProperties() as $name => $value) { + try { + $value = $this->processArguments(array($value), true); + $properties[$name] = reset($value); + } catch (RuntimeException $ignore) { + // ignore property + } + } + $definition->setProperties($properties); + } + } + + /** + * Processes arguments to determine invalid references. + * + * @param array $arguments An array of Reference objects + * @param bool $inMethodCall + * + * @return array + * + * @throws RuntimeException When the config is invalid + */ + private function processArguments(array $arguments, $inMethodCall = false) + { + foreach ($arguments as $k => $argument) { + if (is_array($argument)) { + $arguments[$k] = $this->processArguments($argument, $inMethodCall); + } elseif ($argument instanceof Reference) { + $id = (string) $argument; + + $invalidBehavior = $argument->getInvalidBehavior(); + $exists = $this->container->has($id); + + // resolve invalid behavior + if (!$exists && ContainerInterface::NULL_ON_INVALID_REFERENCE === $invalidBehavior) { + $arguments[$k] = null; + } elseif (!$exists && ContainerInterface::IGNORE_ON_INVALID_REFERENCE === $invalidBehavior) { + if ($inMethodCall) { + throw new RuntimeException('Method shouldn\'t be called.'); + } + + $arguments[$k] = null; + } + } + } + + return $arguments; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php new file mode 100644 index 0000000..6fc0a87 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; + +/** + * Resolves all parameter placeholders "%somevalue%" to their real values. + * + * @author Johannes M. Schmitt + */ +class ResolveParameterPlaceHoldersPass implements CompilerPassInterface +{ + /** + * Processes the ContainerBuilder to resolve parameter placeholders. + * + * @param ContainerBuilder $container + * + * @throws ParameterNotFoundException + */ + public function process(ContainerBuilder $container) + { + $parameterBag = $container->getParameterBag(); + + foreach ($container->getDefinitions() as $id => $definition) { + try { + $definition->setClass($parameterBag->resolveValue($definition->getClass())); + $definition->setFile($parameterBag->resolveValue($definition->getFile())); + $definition->setArguments($parameterBag->resolveValue($definition->getArguments())); + + $calls = array(); + foreach ($definition->getMethodCalls() as $name => $arguments) { + $calls[$parameterBag->resolveValue($name)] = $parameterBag->resolveValue($arguments); + } + $definition->setMethodCalls($calls); + + $definition->setProperties($parameterBag->resolveValue($definition->getProperties())); + } catch (ParameterNotFoundException $e) { + $e->setSourceId($id); + + throw $e; + } + } + + $aliases = array(); + foreach ($container->getAliases() as $name => $target) { + $aliases[$parameterBag->resolveValue($name)] = $parameterBag->resolveValue($target); + } + $container->setAliases($aliases); + + $parameterBag->resolve(); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php new file mode 100644 index 0000000..015bdeb --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Alias; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Replaces all references to aliases with references to the actual service. + * + * @author Johannes M. Schmitt + */ +class ResolveReferencesToAliasesPass implements CompilerPassInterface +{ + private $container; + + /** + * Processes the ContainerBuilder to replace references to aliases with actual service references. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->container = $container; + + foreach ($container->getDefinitions() as $definition) { + if ($definition->isSynthetic() || $definition->isAbstract()) { + continue; + } + + $definition->setArguments($this->processArguments($definition->getArguments())); + $definition->setMethodCalls($this->processArguments($definition->getMethodCalls())); + $definition->setProperties($this->processArguments($definition->getProperties())); + } + + foreach ($container->getAliases() as $id => $alias) { + $aliasId = (string) $alias; + if ($aliasId !== $defId = $this->getDefinitionId($aliasId)) { + $container->setAlias($id, new Alias($defId, $alias->isPublic())); + } + } + } + + /** + * Processes the arguments to replace aliases. + * + * @param array $arguments An array of References + * + * @return array An array of References + */ + private function processArguments(array $arguments) + { + foreach ($arguments as $k => $argument) { + if (is_array($argument)) { + $arguments[$k] = $this->processArguments($argument); + } elseif ($argument instanceof Reference) { + $defId = $this->getDefinitionId($id = (string) $argument); + + if ($defId !== $id) { + $arguments[$k] = new Reference($defId, $argument->getInvalidBehavior(), $argument->isStrict()); + } + } + } + + return $arguments; + } + + /** + * Resolves an alias into a definition id. + * + * @param string $id The definition or alias id to resolve + * + * @return string The definition id with aliases resolved + */ + private function getDefinitionId($id) + { + while ($this->container->hasAlias($id)) { + $id = (string) $this->container->getAlias($id); + } + + return $id; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php new file mode 100644 index 0000000..ffea22f --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php @@ -0,0 +1,122 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; + +/** + * This is a directed graph of your services. + * + * This information can be used by your compiler passes instead of collecting + * it themselves which improves performance quite a lot. + * + * @author Johannes M. Schmitt + */ +class ServiceReferenceGraph +{ + /** + * @var ServiceReferenceGraphNode[] + */ + private $nodes; + + /** + * Constructor. + */ + public function __construct() + { + $this->nodes = array(); + } + + /** + * Checks if the graph has a specific node. + * + * @param string $id Id to check + * + * @return bool + */ + public function hasNode($id) + { + return isset($this->nodes[$id]); + } + + /** + * Gets a node by identifier. + * + * @param string $id The id to retrieve + * + * @return ServiceReferenceGraphNode The node matching the supplied identifier + * + * @throws InvalidArgumentException if no node matches the supplied identifier + */ + public function getNode($id) + { + if (!isset($this->nodes[$id])) { + throw new InvalidArgumentException(sprintf('There is no node with id "%s".', $id)); + } + + return $this->nodes[$id]; + } + + /** + * Returns all nodes. + * + * @return ServiceReferenceGraphNode[] An array of all ServiceReferenceGraphNode objects + */ + public function getNodes() + { + return $this->nodes; + } + + /** + * Clears all nodes. + */ + public function clear() + { + $this->nodes = array(); + } + + /** + * Connects 2 nodes together in the Graph. + * + * @param string $sourceId + * @param string $sourceValue + * @param string $destId + * @param string $destValue + * @param string $reference + */ + public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null) + { + $sourceNode = $this->createNode($sourceId, $sourceValue); + $destNode = $this->createNode($destId, $destValue); + $edge = new ServiceReferenceGraphEdge($sourceNode, $destNode, $reference); + + $sourceNode->addOutEdge($edge); + $destNode->addInEdge($edge); + } + + /** + * Creates a graph node. + * + * @param string $id + * @param string $value + * + * @return ServiceReferenceGraphNode + */ + private function createNode($id, $value) + { + if (isset($this->nodes[$id]) && $this->nodes[$id]->getValue() === $value) { + return $this->nodes[$id]; + } + + return $this->nodes[$id] = new ServiceReferenceGraphNode($id, $value); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php new file mode 100644 index 0000000..19da234 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +/** + * Represents an edge in your service graph. + * + * Value is typically a reference. + * + * @author Johannes M. Schmitt + */ +class ServiceReferenceGraphEdge +{ + private $sourceNode; + private $destNode; + private $value; + + /** + * Constructor. + * + * @param ServiceReferenceGraphNode $sourceNode + * @param ServiceReferenceGraphNode $destNode + * @param string $value + */ + public function __construct(ServiceReferenceGraphNode $sourceNode, ServiceReferenceGraphNode $destNode, $value = null) + { + $this->sourceNode = $sourceNode; + $this->destNode = $destNode; + $this->value = $value; + } + + /** + * Returns the value of the edge + * + * @return ServiceReferenceGraphNode + */ + public function getValue() + { + return $this->value; + } + + /** + * Returns the source node + * + * @return ServiceReferenceGraphNode + */ + public function getSourceNode() + { + return $this->sourceNode; + } + + /** + * Returns the destination node + * + * @return ServiceReferenceGraphNode + */ + public function getDestNode() + { + return $this->destNode; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php new file mode 100644 index 0000000..8f15bd4 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php @@ -0,0 +1,124 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Alias; + +/** + * Represents a node in your service graph. + * + * Value is typically a definition, or an alias. + * + * @author Johannes M. Schmitt + */ +class ServiceReferenceGraphNode +{ + private $id; + private $inEdges; + private $outEdges; + private $value; + + /** + * Constructor. + * + * @param string $id The node identifier + * @param mixed $value The node value + */ + public function __construct($id, $value) + { + $this->id = $id; + $this->value = $value; + $this->inEdges = array(); + $this->outEdges = array(); + } + + /** + * Adds an in edge to this node. + * + * @param ServiceReferenceGraphEdge $edge + */ + public function addInEdge(ServiceReferenceGraphEdge $edge) + { + $this->inEdges[] = $edge; + } + + /** + * Adds an out edge to this node. + * + * @param ServiceReferenceGraphEdge $edge + */ + public function addOutEdge(ServiceReferenceGraphEdge $edge) + { + $this->outEdges[] = $edge; + } + + /** + * Checks if the value of this node is an Alias. + * + * @return bool True if the value is an Alias instance + */ + public function isAlias() + { + return $this->value instanceof Alias; + } + + /** + * Checks if the value of this node is a Definition. + * + * @return bool True if the value is a Definition instance + */ + public function isDefinition() + { + return $this->value instanceof Definition; + } + + /** + * Returns the identifier. + * + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Returns the in edges. + * + * @return array The in ServiceReferenceGraphEdge array + */ + public function getInEdges() + { + return $this->inEdges; + } + + /** + * Returns the out edges. + * + * @return array The out ServiceReferenceGraphEdge array + */ + public function getOutEdges() + { + return $this->outEdges; + } + + /** + * Returns the value of this Node + * + * @return mixed The value + */ + public function getValue() + { + return $this->value; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php new file mode 100644 index 0000000..f105a6d --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php @@ -0,0 +1,568 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +use Symfony\Component\DependencyInjection\Exception\InactiveScopeException; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; +use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; + +/** + * Container is a dependency injection container. + * + * It gives access to object instances (services). + * + * Services and parameters are simple key/pair stores. + * + * Parameter and service keys are case insensitive. + * + * A service id can contain lowercased letters, digits, underscores, and dots. + * Underscores are used to separate words, and dots to group services + * under namespaces: + * + *
    + *
  • request
  • + *
  • mysql_session_storage
  • + *
  • symfony.mysql_session_storage
  • + *
+ * + * A service can also be defined by creating a method named + * getXXXService(), where XXX is the camelized version of the id: + * + *
    + *
  • request -> getRequestService()
  • + *
  • mysql_session_storage -> getMysqlSessionStorageService()
  • + *
  • symfony.mysql_session_storage -> getSymfony_MysqlSessionStorageService()
  • + *
+ * + * The container can have three possible behaviors when a service does not exist: + * + * * EXCEPTION_ON_INVALID_REFERENCE: Throws an exception (the default) + * * NULL_ON_INVALID_REFERENCE: Returns null + * * IGNORE_ON_INVALID_REFERENCE: Ignores the wrapping command asking for the reference + * (for instance, ignore a setter if the service does not exist) + * + * @author Fabien Potencier + * @author Johannes M. Schmitt + * + * @api + */ +class Container implements IntrospectableContainerInterface +{ + /** + * @var ParameterBagInterface + */ + protected $parameterBag; + + protected $services; + protected $methodMap; + protected $aliases; + protected $scopes; + protected $scopeChildren; + protected $scopedServices; + protected $scopeStacks; + protected $loading = array(); + + /** + * Constructor. + * + * @param ParameterBagInterface $parameterBag A ParameterBagInterface instance + * + * @api + */ + public function __construct(ParameterBagInterface $parameterBag = null) + { + $this->parameterBag = null === $parameterBag ? new ParameterBag() : $parameterBag; + + $this->services = array(); + $this->aliases = array(); + $this->scopes = array(); + $this->scopeChildren = array(); + $this->scopedServices = array(); + $this->scopeStacks = array(); + } + + /** + * Compiles the container. + * + * This method does two things: + * + * * Parameter values are resolved; + * * The parameter bag is frozen. + * + * @api + */ + public function compile() + { + $this->parameterBag->resolve(); + + $this->parameterBag = new FrozenParameterBag($this->parameterBag->all()); + } + + /** + * Returns true if the container parameter bag are frozen. + * + * @return bool true if the container parameter bag are frozen, false otherwise + * + * @api + */ + public function isFrozen() + { + return $this->parameterBag instanceof FrozenParameterBag; + } + + /** + * Gets the service container parameter bag. + * + * @return ParameterBagInterface A ParameterBagInterface instance + * + * @api + */ + public function getParameterBag() + { + return $this->parameterBag; + } + + /** + * Gets a parameter. + * + * @param string $name The parameter name + * + * @return mixed The parameter value + * + * @throws InvalidArgumentException if the parameter is not defined + * + * @api + */ + public function getParameter($name) + { + return $this->parameterBag->get($name); + } + + /** + * Checks if a parameter exists. + * + * @param string $name The parameter name + * + * @return bool The presence of parameter in container + * + * @api + */ + public function hasParameter($name) + { + return $this->parameterBag->has($name); + } + + /** + * Sets a parameter. + * + * @param string $name The parameter name + * @param mixed $value The parameter value + * + * @api + */ + public function setParameter($name, $value) + { + $this->parameterBag->set($name, $value); + } + + /** + * Sets a service. + * + * Setting a service to null resets the service: has() returns false and get() + * behaves in the same way as if the service was never created. + * + * @param string $id The service identifier + * @param object $service The service instance + * @param string $scope The scope of the service + * + * @throws RuntimeException When trying to set a service in an inactive scope + * @throws InvalidArgumentException When trying to set a service in the prototype scope + * + * @api + */ + public function set($id, $service, $scope = self::SCOPE_CONTAINER) + { + if (self::SCOPE_PROTOTYPE === $scope) { + throw new InvalidArgumentException(sprintf('You cannot set service "%s" of scope "prototype".', $id)); + } + + $id = strtolower($id); + + if ('service_container' === $id) { + // BC: 'service_container' is no longer a self-reference but always + // $this, so ignore this call. + // @todo Throw InvalidArgumentException in next major release. + return; + } + if (self::SCOPE_CONTAINER !== $scope) { + if (!isset($this->scopedServices[$scope])) { + throw new RuntimeException(sprintf('You cannot set service "%s" of inactive scope.', $id)); + } + + $this->scopedServices[$scope][$id] = $service; + } + + $this->services[$id] = $service; + + if (method_exists($this, $method = 'synchronize'.strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service')) { + $this->$method(); + } + + if (self::SCOPE_CONTAINER !== $scope && null === $service) { + unset($this->scopedServices[$scope][$id]); + } + + if (null === $service) { + unset($this->services[$id]); + } + } + + /** + * Returns true if the given service is defined. + * + * @param string $id The service identifier + * + * @return bool true if the service is defined, false otherwise + * + * @api + */ + public function has($id) + { + $id = strtolower($id); + + if ('service_container' === $id) { + return true; + } + + return isset($this->services[$id]) + || array_key_exists($id, $this->services) + || isset($this->aliases[$id]) + || method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service') + ; + } + + /** + * Gets a service. + * + * If a service is defined both through a set() method and + * with a get{$id}Service() method, the former has always precedence. + * + * @param string $id The service identifier + * @param int $invalidBehavior The behavior when the service does not exist + * + * @return object The associated service + * + * @throws InvalidArgumentException if the service is not defined + * @throws ServiceCircularReferenceException When a circular reference is detected + * @throws ServiceNotFoundException When the service is not defined + * @throws \Exception if an exception has been thrown when the service has been resolved + * + * @see Reference + * + * @api + */ + public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) + { + // Attempt to retrieve the service by checking first aliases then + // available services. Service IDs are case insensitive, however since + // this method can be called thousands of times during a request, avoid + // calling strtolower() unless necessary. + foreach (array(false, true) as $strtolower) { + if ($strtolower) { + $id = strtolower($id); + } + if ('service_container' === $id) { + return $this; + } + if (isset($this->aliases[$id])) { + $id = $this->aliases[$id]; + } + // Re-use shared service instance if it exists. + if (isset($this->services[$id]) || array_key_exists($id, $this->services)) { + return $this->services[$id]; + } + } + + if (isset($this->loading[$id])) { + throw new ServiceCircularReferenceException($id, array_keys($this->loading)); + } + + if (isset($this->methodMap[$id])) { + $method = $this->methodMap[$id]; + } elseif (method_exists($this, $method = 'get'.strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service')) { + // $method is set to the right value, proceed + } else { + if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) { + if (!$id) { + throw new ServiceNotFoundException($id); + } + + $alternatives = array(); + foreach (array_keys($this->services) as $key) { + $lev = levenshtein($id, $key); + if ($lev <= strlen($id) / 3 || false !== strpos($key, $id)) { + $alternatives[] = $key; + } + } + + throw new ServiceNotFoundException($id, null, null, $alternatives); + } + + return; + } + + $this->loading[$id] = true; + + try { + $service = $this->$method(); + } catch (\Exception $e) { + unset($this->loading[$id]); + + if (array_key_exists($id, $this->services)) { + unset($this->services[$id]); + } + + if ($e instanceof InactiveScopeException && self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) { + return; + } + + throw $e; + } + + unset($this->loading[$id]); + + return $service; + } + + /** + * Returns true if the given service has actually been initialized + * + * @param string $id The service identifier + * + * @return bool true if service has already been initialized, false otherwise + */ + public function initialized($id) + { + $id = strtolower($id); + + if ('service_container' === $id) { + // BC: 'service_container' was a synthetic service previously. + // @todo Change to false in next major release. + return true; + } + + return isset($this->services[$id]) || array_key_exists($id, $this->services); + } + + /** + * Gets all service ids. + * + * @return array An array of all defined service ids + */ + public function getServiceIds() + { + $ids = array(); + $r = new \ReflectionClass($this); + foreach ($r->getMethods() as $method) { + if (preg_match('/^get(.+)Service$/', $method->name, $match)) { + $ids[] = self::underscore($match[1]); + } + } + $ids[] = 'service_container'; + + return array_unique(array_merge($ids, array_keys($this->services))); + } + + /** + * This is called when you enter a scope + * + * @param string $name + * + * @throws RuntimeException When the parent scope is inactive + * @throws InvalidArgumentException When the scope does not exist + * + * @api + */ + public function enterScope($name) + { + if (!isset($this->scopes[$name])) { + throw new InvalidArgumentException(sprintf('The scope "%s" does not exist.', $name)); + } + + if (self::SCOPE_CONTAINER !== $this->scopes[$name] && !isset($this->scopedServices[$this->scopes[$name]])) { + throw new RuntimeException(sprintf('The parent scope "%s" must be active when entering this scope.', $this->scopes[$name])); + } + + // check if a scope of this name is already active, if so we need to + // remove all services of this scope, and those of any of its child + // scopes from the global services map + if (isset($this->scopedServices[$name])) { + $services = array($this->services, $name => $this->scopedServices[$name]); + unset($this->scopedServices[$name]); + + foreach ($this->scopeChildren[$name] as $child) { + if (isset($this->scopedServices[$child])) { + $services[$child] = $this->scopedServices[$child]; + unset($this->scopedServices[$child]); + } + } + + // update global map + $this->services = call_user_func_array('array_diff_key', $services); + array_shift($services); + + // add stack entry for this scope so we can restore the removed services later + if (!isset($this->scopeStacks[$name])) { + $this->scopeStacks[$name] = new \SplStack(); + } + $this->scopeStacks[$name]->push($services); + } + + $this->scopedServices[$name] = array(); + } + + /** + * This is called to leave the current scope, and move back to the parent + * scope. + * + * @param string $name The name of the scope to leave + * + * @throws InvalidArgumentException if the scope is not active + * + * @api + */ + public function leaveScope($name) + { + if (!isset($this->scopedServices[$name])) { + throw new InvalidArgumentException(sprintf('The scope "%s" is not active.', $name)); + } + + // remove all services of this scope, or any of its child scopes from + // the global service map + $services = array($this->services, $this->scopedServices[$name]); + unset($this->scopedServices[$name]); + foreach ($this->scopeChildren[$name] as $child) { + if (!isset($this->scopedServices[$child])) { + continue; + } + + $services[] = $this->scopedServices[$child]; + unset($this->scopedServices[$child]); + } + $this->services = call_user_func_array('array_diff_key', $services); + + // check if we need to restore services of a previous scope of this type + if (isset($this->scopeStacks[$name]) && count($this->scopeStacks[$name]) > 0) { + $services = $this->scopeStacks[$name]->pop(); + $this->scopedServices += $services; + + foreach ($services as $array) { + foreach ($array as $id => $service) { + $this->set($id, $service, $name); + } + } + } + } + + /** + * Adds a scope to the container. + * + * @param ScopeInterface $scope + * + * @throws InvalidArgumentException + * + * @api + */ + public function addScope(ScopeInterface $scope) + { + $name = $scope->getName(); + $parentScope = $scope->getParentName(); + + if (self::SCOPE_CONTAINER === $name || self::SCOPE_PROTOTYPE === $name) { + throw new InvalidArgumentException(sprintf('The scope "%s" is reserved.', $name)); + } + if (isset($this->scopes[$name])) { + throw new InvalidArgumentException(sprintf('A scope with name "%s" already exists.', $name)); + } + if (self::SCOPE_CONTAINER !== $parentScope && !isset($this->scopes[$parentScope])) { + throw new InvalidArgumentException(sprintf('The parent scope "%s" does not exist, or is invalid.', $parentScope)); + } + + $this->scopes[$name] = $parentScope; + $this->scopeChildren[$name] = array(); + + // normalize the child relations + while ($parentScope !== self::SCOPE_CONTAINER) { + $this->scopeChildren[$parentScope][] = $name; + $parentScope = $this->scopes[$parentScope]; + } + } + + /** + * Returns whether this container has a certain scope + * + * @param string $name The name of the scope + * + * @return bool + * + * @api + */ + public function hasScope($name) + { + return isset($this->scopes[$name]); + } + + /** + * Returns whether this scope is currently active + * + * This does not actually check if the passed scope actually exists. + * + * @param string $name + * + * @return bool + * + * @api + */ + public function isScopeActive($name) + { + return isset($this->scopedServices[$name]); + } + + /** + * Camelizes a string. + * + * @param string $id A string to camelize + * + * @return string The camelized string + */ + public static function camelize($id) + { + return strtr(ucwords(strtr($id, array('_' => ' ', '.' => '_ ', '\\' => '_ '))), array(' ' => '')); + } + + /** + * A string to underscore. + * + * @param string $id The string to underscore + * + * @return string The underscored string + */ + public static function underscore($id) + { + return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), array('\\1_\\2', '\\1_\\2'), strtr($id, '_', '.'))); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAware.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAware.php new file mode 100644 index 0000000..4096915 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAware.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * A simple implementation of ContainerAwareInterface. + * + * @author Fabien Potencier + * + * @api + */ +abstract class ContainerAware implements ContainerAwareInterface +{ + /** + * @var ContainerInterface + * + * @api + */ + protected $container; + + /** + * Sets the Container associated with this Controller. + * + * @param ContainerInterface $container A ContainerInterface instance + * + * @api + */ + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAwareInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAwareInterface.php new file mode 100644 index 0000000..e85bb53 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAwareInterface.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * ContainerAwareInterface should be implemented by classes that depends on a Container. + * + * @author Fabien Potencier + * + * @api + */ +interface ContainerAwareInterface +{ + /** + * Sets the Container. + * + * @param ContainerInterface|null $container A ContainerInterface instance or null + * + * @api + */ + public function setContainer(ContainerInterface $container = null); +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php new file mode 100644 index 0000000..e394d98 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -0,0 +1,1158 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +use Symfony\Component\DependencyInjection\Compiler\Compiler; +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\Compiler\PassConfig; +use Symfony\Component\DependencyInjection\Exception\BadMethodCallException; +use Symfony\Component\DependencyInjection\Exception\InactiveScopeException; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\LogicException; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Config\Resource\ResourceInterface; +use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface; +use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator; + +/** + * ContainerBuilder is a DI container that provides an API to easily describe services. + * + * @author Fabien Potencier + * + * @api + */ +class ContainerBuilder extends Container implements TaggedContainerInterface +{ + /** + * @var ExtensionInterface[] + */ + private $extensions = array(); + + /** + * @var ExtensionInterface[] + */ + private $extensionsByNs = array(); + + /** + * @var Definition[] + */ + private $definitions = array(); + + /** + * @var Definition[] + */ + private $obsoleteDefinitions = array(); + + /** + * @var Alias[] + */ + private $aliasDefinitions = array(); + + /** + * @var ResourceInterface[] + */ + private $resources = array(); + + private $extensionConfigs = array(); + + /** + * @var Compiler + */ + private $compiler; + + private $trackResources = true; + + /** + * @var InstantiatorInterface|null + */ + private $proxyInstantiator; + + /** + * Sets the track resources flag. + * + * If you are not using the loaders and therefore don't want + * to depend on the Config component, set this flag to false. + * + * @param bool $track true if you want to track resources, false otherwise + */ + public function setResourceTracking($track) + { + $this->trackResources = (bool) $track; + } + + /** + * Checks if resources are tracked. + * + * @return bool true if resources are tracked, false otherwise + */ + public function isTrackingResources() + { + return $this->trackResources; + } + + /** + * Sets the instantiator to be used when fetching proxies. + * + * @param InstantiatorInterface $proxyInstantiator + */ + public function setProxyInstantiator(InstantiatorInterface $proxyInstantiator) + { + $this->proxyInstantiator = $proxyInstantiator; + } + + /** + * Registers an extension. + * + * @param ExtensionInterface $extension An extension instance + * + * @api + */ + public function registerExtension(ExtensionInterface $extension) + { + $this->extensions[$extension->getAlias()] = $extension; + + if (false !== $extension->getNamespace()) { + $this->extensionsByNs[$extension->getNamespace()] = $extension; + } + } + + /** + * Returns an extension by alias or namespace. + * + * @param string $name An alias or a namespace + * + * @return ExtensionInterface An extension instance + * + * @throws LogicException if the extension is not registered + * + * @api + */ + public function getExtension($name) + { + if (isset($this->extensions[$name])) { + return $this->extensions[$name]; + } + + if (isset($this->extensionsByNs[$name])) { + return $this->extensionsByNs[$name]; + } + + throw new LogicException(sprintf('Container extension "%s" is not registered', $name)); + } + + /** + * Returns all registered extensions. + * + * @return ExtensionInterface[] An array of ExtensionInterface + * + * @api + */ + public function getExtensions() + { + return $this->extensions; + } + + /** + * Checks if we have an extension. + * + * @param string $name The name of the extension + * + * @return bool If the extension exists + * + * @api + */ + public function hasExtension($name) + { + return isset($this->extensions[$name]) || isset($this->extensionsByNs[$name]); + } + + /** + * Returns an array of resources loaded to build this configuration. + * + * @return ResourceInterface[] An array of resources + * + * @api + */ + public function getResources() + { + return array_unique($this->resources); + } + + /** + * Adds a resource for this configuration. + * + * @param ResourceInterface $resource A resource instance + * + * @return ContainerBuilder The current instance + * + * @api + */ + public function addResource(ResourceInterface $resource) + { + if (!$this->trackResources) { + return $this; + } + + $this->resources[] = $resource; + + return $this; + } + + /** + * Sets the resources for this configuration. + * + * @param ResourceInterface[] $resources An array of resources + * + * @return ContainerBuilder The current instance + * + * @api + */ + public function setResources(array $resources) + { + if (!$this->trackResources) { + return $this; + } + + $this->resources = $resources; + + return $this; + } + + /** + * Adds the object class hierarchy as resources. + * + * @param object $object An object instance + * + * @return ContainerBuilder The current instance + * + * @api + */ + public function addObjectResource($object) + { + if ($this->trackResources) { + $this->addClassResource(new \ReflectionClass($object)); + } + + return $this; + } + + /** + * Adds the given class hierarchy as resources. + * + * @param \ReflectionClass $class + * + * @return ContainerBuilder The current instance + */ + public function addClassResource(\ReflectionClass $class) + { + if (!$this->trackResources) { + return $this; + } + + do { + $this->addResource(new FileResource($class->getFileName())); + } while ($class = $class->getParentClass()); + + return $this; + } + + /** + * Loads the configuration for an extension. + * + * @param string $extension The extension alias or namespace + * @param array $values An array of values that customizes the extension + * + * @return ContainerBuilder The current instance + * @throws BadMethodCallException When this ContainerBuilder is frozen + * + * @throws \LogicException if the container is frozen + * + * @api + */ + public function loadFromExtension($extension, array $values = array()) + { + if ($this->isFrozen()) { + throw new BadMethodCallException('Cannot load from an extension on a frozen container.'); + } + + $namespace = $this->getExtension($extension)->getAlias(); + + $this->extensionConfigs[$namespace][] = $values; + + return $this; + } + + /** + * Adds a compiler pass. + * + * @param CompilerPassInterface $pass A compiler pass + * @param string $type The type of compiler pass + * + * @return ContainerBuilder The current instance + * + * @api + */ + public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION) + { + if (null === $this->compiler) { + $this->compiler = new Compiler(); + } + + $this->compiler->addPass($pass, $type); + + $this->addObjectResource($pass); + + return $this; + } + + /** + * Returns the compiler pass config which can then be modified. + * + * @return PassConfig The compiler pass config + * + * @api + */ + public function getCompilerPassConfig() + { + if (null === $this->compiler) { + $this->compiler = new Compiler(); + } + + return $this->compiler->getPassConfig(); + } + + /** + * Returns the compiler. + * + * @return Compiler The compiler + * + * @api + */ + public function getCompiler() + { + if (null === $this->compiler) { + $this->compiler = new Compiler(); + } + + return $this->compiler; + } + + /** + * Returns all Scopes. + * + * @return array An array of scopes + * + * @api + */ + public function getScopes() + { + return $this->scopes; + } + + /** + * Returns all Scope children. + * + * @return array An array of scope children. + * + * @api + */ + public function getScopeChildren() + { + return $this->scopeChildren; + } + + /** + * Sets a service. + * + * @param string $id The service identifier + * @param object $service The service instance + * @param string $scope The scope + * + * @throws BadMethodCallException When this ContainerBuilder is frozen + * + * @api + */ + public function set($id, $service, $scope = self::SCOPE_CONTAINER) + { + $id = strtolower($id); + + if ($this->isFrozen()) { + // setting a synthetic service on a frozen container is alright + if ( + (!isset($this->definitions[$id]) && !isset($this->obsoleteDefinitions[$id])) + || + (isset($this->definitions[$id]) && !$this->definitions[$id]->isSynthetic()) + || + (isset($this->obsoleteDefinitions[$id]) && !$this->obsoleteDefinitions[$id]->isSynthetic()) + ) { + throw new BadMethodCallException(sprintf('Setting service "%s" on a frozen container is not allowed.', $id)); + } + } + + if (isset($this->definitions[$id])) { + $this->obsoleteDefinitions[$id] = $this->definitions[$id]; + } + + unset($this->definitions[$id], $this->aliasDefinitions[$id]); + + parent::set($id, $service, $scope); + + if (isset($this->obsoleteDefinitions[$id]) && $this->obsoleteDefinitions[$id]->isSynchronized()) { + $this->synchronize($id); + } + } + + /** + * Removes a service definition. + * + * @param string $id The service identifier + * + * @api + */ + public function removeDefinition($id) + { + unset($this->definitions[strtolower($id)]); + } + + /** + * Returns true if the given service is defined. + * + * @param string $id The service identifier + * + * @return bool true if the service is defined, false otherwise + * + * @api + */ + public function has($id) + { + $id = strtolower($id); + + return isset($this->definitions[$id]) || isset($this->aliasDefinitions[$id]) || parent::has($id); + } + + /** + * Gets a service. + * + * @param string $id The service identifier + * @param int $invalidBehavior The behavior when the service does not exist + * + * @return object The associated service + * + * @throws InvalidArgumentException when no definitions are available + * @throws InactiveScopeException when the current scope is not active + * @throws LogicException when a circular dependency is detected + * @throws \Exception + * + * @see Reference + * + * @api + */ + public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) + { + $id = strtolower($id); + + if ($service = parent::get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)) { + return $service; + } + + if (isset($this->loading[$id])) { + throw new LogicException(sprintf('The service "%s" has a circular reference to itself.', $id)); + } + + if (!$this->hasDefinition($id) && isset($this->aliasDefinitions[$id])) { + return $this->get($this->aliasDefinitions[$id]); + } + + try { + $definition = $this->getDefinition($id); + } catch (InvalidArgumentException $e) { + if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) { + return; + } + + throw $e; + } + + $this->loading[$id] = true; + + try { + $service = $this->createService($definition, $id); + } catch (\Exception $e) { + unset($this->loading[$id]); + + if ($e instanceof InactiveScopeException && self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) { + return; + } + + throw $e; + } + + unset($this->loading[$id]); + + return $service; + } + + /** + * Merges a ContainerBuilder with the current ContainerBuilder configuration. + * + * Service definitions overrides the current defined ones. + * + * But for parameters, they are overridden by the current ones. It allows + * the parameters passed to the container constructor to have precedence + * over the loaded ones. + * + * $container = new ContainerBuilder(array('foo' => 'bar')); + * $loader = new LoaderXXX($container); + * $loader->load('resource_name'); + * $container->register('foo', new stdClass()); + * + * In the above example, even if the loaded resource defines a foo + * parameter, the value will still be 'bar' as defined in the ContainerBuilder + * constructor. + * + * @param ContainerBuilder $container The ContainerBuilder instance to merge. + * + * + * @throws BadMethodCallException When this ContainerBuilder is frozen + * + * @api + */ + public function merge(ContainerBuilder $container) + { + if ($this->isFrozen()) { + throw new BadMethodCallException('Cannot merge on a frozen container.'); + } + + $this->addDefinitions($container->getDefinitions()); + $this->addAliases($container->getAliases()); + $this->getParameterBag()->add($container->getParameterBag()->all()); + + if ($this->trackResources) { + foreach ($container->getResources() as $resource) { + $this->addResource($resource); + } + } + + foreach ($this->extensions as $name => $extension) { + if (!isset($this->extensionConfigs[$name])) { + $this->extensionConfigs[$name] = array(); + } + + $this->extensionConfigs[$name] = array_merge($this->extensionConfigs[$name], $container->getExtensionConfig($name)); + } + } + + /** + * Returns the configuration array for the given extension. + * + * @param string $name The name of the extension + * + * @return array An array of configuration + * + * @api + */ + public function getExtensionConfig($name) + { + if (!isset($this->extensionConfigs[$name])) { + $this->extensionConfigs[$name] = array(); + } + + return $this->extensionConfigs[$name]; + } + + /** + * Prepends a config array to the configs of the given extension. + * + * @param string $name The name of the extension + * @param array $config The config to set + */ + public function prependExtensionConfig($name, array $config) + { + if (!isset($this->extensionConfigs[$name])) { + $this->extensionConfigs[$name] = array(); + } + + array_unshift($this->extensionConfigs[$name], $config); + } + + /** + * Compiles the container. + * + * This method passes the container to compiler + * passes whose job is to manipulate and optimize + * the container. + * + * The main compiler passes roughly do four things: + * + * * The extension configurations are merged; + * * Parameter values are resolved; + * * The parameter bag is frozen; + * * Extension loading is disabled. + * + * @api + */ + public function compile() + { + if (null === $this->compiler) { + $this->compiler = new Compiler(); + } + + if ($this->trackResources) { + foreach ($this->compiler->getPassConfig()->getPasses() as $pass) { + $this->addObjectResource($pass); + } + } + + $this->compiler->compile($this); + + if ($this->trackResources) { + foreach ($this->definitions as $definition) { + if ($definition->isLazy() && ($class = $definition->getClass()) && class_exists($class)) { + $this->addClassResource(new \ReflectionClass($class)); + } + } + } + + $this->extensionConfigs = array(); + + parent::compile(); + } + + /** + * Gets all service ids. + * + * @return array An array of all defined service ids + */ + public function getServiceIds() + { + return array_unique(array_merge(array_keys($this->getDefinitions()), array_keys($this->aliasDefinitions), parent::getServiceIds())); + } + + /** + * Adds the service aliases. + * + * @param array $aliases An array of aliases + * + * @api + */ + public function addAliases(array $aliases) + { + foreach ($aliases as $alias => $id) { + $this->setAlias($alias, $id); + } + } + + /** + * Sets the service aliases. + * + * @param array $aliases An array of aliases + * + * @api + */ + public function setAliases(array $aliases) + { + $this->aliasDefinitions = array(); + $this->addAliases($aliases); + } + + /** + * Sets an alias for an existing service. + * + * @param string $alias The alias to create + * @param string|Alias $id The service to alias + * + * @throws InvalidArgumentException if the id is not a string or an Alias + * @throws InvalidArgumentException if the alias is for itself + * + * @api + */ + public function setAlias($alias, $id) + { + $alias = strtolower($alias); + + if (is_string($id)) { + $id = new Alias($id); + } elseif (!$id instanceof Alias) { + throw new InvalidArgumentException('$id must be a string, or an Alias object.'); + } + + if ($alias === strtolower($id)) { + throw new InvalidArgumentException(sprintf('An alias can not reference itself, got a circular reference on "%s".', $alias)); + } + + unset($this->definitions[$alias]); + + $this->aliasDefinitions[$alias] = $id; + } + + /** + * Removes an alias. + * + * @param string $alias The alias to remove + * + * @api + */ + public function removeAlias($alias) + { + unset($this->aliasDefinitions[strtolower($alias)]); + } + + /** + * Returns true if an alias exists under the given identifier. + * + * @param string $id The service identifier + * + * @return bool true if the alias exists, false otherwise + * + * @api + */ + public function hasAlias($id) + { + return isset($this->aliasDefinitions[strtolower($id)]); + } + + /** + * Gets all defined aliases. + * + * @return Alias[] An array of aliases + * + * @api + */ + public function getAliases() + { + return $this->aliasDefinitions; + } + + /** + * Gets an alias. + * + * @param string $id The service identifier + * + * @return Alias An Alias instance + * + * @throws InvalidArgumentException if the alias does not exist + * + * @api + */ + public function getAlias($id) + { + $id = strtolower($id); + + if (!$this->hasAlias($id)) { + throw new InvalidArgumentException(sprintf('The service alias "%s" does not exist.', $id)); + } + + return $this->aliasDefinitions[$id]; + } + + /** + * Registers a service definition. + * + * This methods allows for simple registration of service definition + * with a fluid interface. + * + * @param string $id The service identifier + * @param string $class The service class + * + * @return Definition A Definition instance + * + * @api + */ + public function register($id, $class = null) + { + return $this->setDefinition(strtolower($id), new Definition($class)); + } + + /** + * Adds the service definitions. + * + * @param Definition[] $definitions An array of service definitions + * + * @api + */ + public function addDefinitions(array $definitions) + { + foreach ($definitions as $id => $definition) { + $this->setDefinition($id, $definition); + } + } + + /** + * Sets the service definitions. + * + * @param Definition[] $definitions An array of service definitions + * + * @api + */ + public function setDefinitions(array $definitions) + { + $this->definitions = array(); + $this->addDefinitions($definitions); + } + + /** + * Gets all service definitions. + * + * @return Definition[] An array of Definition instances + * + * @api + */ + public function getDefinitions() + { + return $this->definitions; + } + + /** + * Sets a service definition. + * + * @param string $id The service identifier + * @param Definition $definition A Definition instance + * + * @return Definition the service definition + * + * @throws BadMethodCallException When this ContainerBuilder is frozen + * + * @api + */ + public function setDefinition($id, Definition $definition) + { + if ($this->isFrozen()) { + throw new BadMethodCallException('Adding definition to a frozen container is not allowed'); + } + + $id = strtolower($id); + + unset($this->aliasDefinitions[$id]); + + return $this->definitions[$id] = $definition; + } + + /** + * Returns true if a service definition exists under the given identifier. + * + * @param string $id The service identifier + * + * @return bool true if the service definition exists, false otherwise + * + * @api + */ + public function hasDefinition($id) + { + return array_key_exists(strtolower($id), $this->definitions); + } + + /** + * Gets a service definition. + * + * @param string $id The service identifier + * + * @return Definition A Definition instance + * + * @throws InvalidArgumentException if the service definition does not exist + * + * @api + */ + public function getDefinition($id) + { + $id = strtolower($id); + + if (!$this->hasDefinition($id)) { + throw new InvalidArgumentException(sprintf('The service definition "%s" does not exist.', $id)); + } + + return $this->definitions[$id]; + } + + /** + * Gets a service definition by id or alias. + * + * The method "unaliases" recursively to return a Definition instance. + * + * @param string $id The service identifier or alias + * + * @return Definition A Definition instance + * + * @throws InvalidArgumentException if the service definition does not exist + * + * @api + */ + public function findDefinition($id) + { + while ($this->hasAlias($id)) { + $id = (string) $this->getAlias($id); + } + + return $this->getDefinition($id); + } + + /** + * Creates a service for a service definition. + * + * @param Definition $definition A service definition instance + * @param string $id The service identifier + * @param bool $tryProxy Whether to try proxying the service with a lazy proxy + * + * @return object The service described by the service definition + * + * @throws RuntimeException When the scope is inactive + * @throws RuntimeException When the factory definition is incomplete + * @throws RuntimeException When the service is a synthetic service + * @throws InvalidArgumentException When configure callable is not callable + * + * @internal this method is public because of PHP 5.3 limitations, do not use it explicitly in your code + */ + public function createService(Definition $definition, $id, $tryProxy = true) + { + if ($definition->isSynthetic()) { + throw new RuntimeException(sprintf('You have requested a synthetic service ("%s"). The DIC does not know how to construct this service.', $id)); + } + + if ($tryProxy && $definition->isLazy()) { + $container = $this; + + $proxy = $this + ->getProxyInstantiator() + ->instantiateProxy( + $container, + $definition, + $id, function () use ($definition, $id, $container) { + return $container->createService($definition, $id, false); + } + ); + $this->shareService($definition, $proxy, $id); + + return $proxy; + } + + $parameterBag = $this->getParameterBag(); + + if (null !== $definition->getFile()) { + require_once $parameterBag->resolveValue($definition->getFile()); + } + + $arguments = $this->resolveServices($parameterBag->unescapeValue($parameterBag->resolveValue($definition->getArguments()))); + + if (null !== $definition->getFactoryMethod()) { + if (null !== $definition->getFactoryClass()) { + $factory = $parameterBag->resolveValue($definition->getFactoryClass()); + } elseif (null !== $definition->getFactoryService()) { + $factory = $this->get($parameterBag->resolveValue($definition->getFactoryService())); + } else { + throw new RuntimeException(sprintf('Cannot create service "%s" from factory method without a factory service or factory class.', $id)); + } + + $service = call_user_func_array(array($factory, $definition->getFactoryMethod()), $arguments); + } else { + $r = new \ReflectionClass($parameterBag->resolveValue($definition->getClass())); + + $service = null === $r->getConstructor() ? $r->newInstance() : $r->newInstanceArgs($arguments); + } + + if ($tryProxy || !$definition->isLazy()) { + // share only if proxying failed, or if not a proxy + $this->shareService($definition, $service, $id); + } + + foreach ($definition->getMethodCalls() as $call) { + $this->callMethod($service, $call); + } + + $properties = $this->resolveServices($parameterBag->resolveValue($definition->getProperties())); + foreach ($properties as $name => $value) { + $service->$name = $value; + } + + if ($callable = $definition->getConfigurator()) { + if (is_array($callable)) { + $callable[0] = $callable[0] instanceof Reference ? $this->get((string) $callable[0]) : $parameterBag->resolveValue($callable[0]); + } + + if (!is_callable($callable)) { + throw new InvalidArgumentException(sprintf('The configure callable for class "%s" is not a callable.', get_class($service))); + } + + call_user_func($callable, $service); + } + + return $service; + } + + /** + * Replaces service references by the real service instance. + * + * @param mixed $value A value + * + * @return mixed The same value with all service references replaced by the real service instances + */ + public function resolveServices($value) + { + if (is_array($value)) { + foreach ($value as &$v) { + $v = $this->resolveServices($v); + } + } elseif ($value instanceof Reference) { + $value = $this->get((string) $value, $value->getInvalidBehavior()); + } elseif ($value instanceof Definition) { + $value = $this->createService($value, null); + } + + return $value; + } + + /** + * Returns service ids for a given tag. + * + * Example: + * + * $container->register('foo')->addTag('my.tag', array('hello' => 'world')); + * + * $serviceIds = $container->findTaggedServiceIds('my.tag'); + * foreach ($serviceIds as $serviceId => $tags) { + * foreach ($tags as $tag) { + * echo $tag['hello']; + * } + * } + * + * @param string $name The tag name + * + * @return array An array of tags with the tagged service as key, holding a list of attribute arrays. + * + * @api + */ + public function findTaggedServiceIds($name) + { + $tags = array(); + foreach ($this->getDefinitions() as $id => $definition) { + if ($definition->hasTag($name)) { + $tags[$id] = $definition->getTag($name); + } + } + + return $tags; + } + + /** + * Returns all tags the defined services use. + * + * @return array An array of tags + */ + public function findTags() + { + $tags = array(); + foreach ($this->getDefinitions() as $id => $definition) { + $tags = array_merge(array_keys($definition->getTags()), $tags); + } + + return array_unique($tags); + } + + /** + * Returns the Service Conditionals. + * + * @param mixed $value An array of conditionals to return. + * + * @return array An array of Service conditionals + */ + public static function getServiceConditionals($value) + { + $services = array(); + + if (is_array($value)) { + foreach ($value as $v) { + $services = array_unique(array_merge($services, self::getServiceConditionals($v))); + } + } elseif ($value instanceof Reference && $value->getInvalidBehavior() === ContainerInterface::IGNORE_ON_INVALID_REFERENCE) { + $services[] = (string) $value; + } + + return $services; + } + + /** + * Retrieves the currently set proxy instantiator or instantiates one. + * + * @return InstantiatorInterface + */ + private function getProxyInstantiator() + { + if (!$this->proxyInstantiator) { + $this->proxyInstantiator = new RealServiceInstantiator(); + } + + return $this->proxyInstantiator; + } + + /** + * Synchronizes a service change. + * + * This method updates all services that depend on the given + * service by calling all methods referencing it. + * + * @param string $id A service id + */ + private function synchronize($id) + { + foreach ($this->definitions as $definitionId => $definition) { + // only check initialized services + if (!$this->initialized($definitionId)) { + continue; + } + + foreach ($definition->getMethodCalls() as $call) { + foreach ($call[1] as $argument) { + if ($argument instanceof Reference && $id == (string) $argument) { + $this->callMethod($this->get($definitionId), $call); + } + } + } + } + } + + private function callMethod($service, $call) + { + $services = self::getServiceConditionals($call[1]); + + foreach ($services as $s) { + if (!$this->has($s)) { + return; + } + } + + call_user_func_array(array($service, $call[0]), $this->resolveServices($this->getParameterBag()->resolveValue($call[1]))); + } + + /** + * Shares a given service in the container + * + * @param Definition $definition + * @param mixed $service + * @param string $id + * + * @throws InactiveScopeException + */ + private function shareService(Definition $definition, $service, $id) + { + if (self::SCOPE_PROTOTYPE !== $scope = $definition->getScope()) { + if (self::SCOPE_CONTAINER !== $scope && !isset($this->scopedServices[$scope])) { + throw new InactiveScopeException($id, $scope); + } + + $this->services[$lowerId = strtolower($id)] = $service; + + if (self::SCOPE_CONTAINER !== $scope) { + $this->scopedServices[$scope][$lowerId] = $service; + } + } + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerInterface.php new file mode 100644 index 0000000..77ee42b --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerInterface.php @@ -0,0 +1,158 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; + +/** + * ContainerInterface is the interface implemented by service container classes. + * + * @author Fabien Potencier + * @author Johannes M. Schmitt + * + * @api + */ +interface ContainerInterface +{ + const EXCEPTION_ON_INVALID_REFERENCE = 1; + const NULL_ON_INVALID_REFERENCE = 2; + const IGNORE_ON_INVALID_REFERENCE = 3; + const SCOPE_CONTAINER = 'container'; + const SCOPE_PROTOTYPE = 'prototype'; + + /** + * Sets a service. + * + * @param string $id The service identifier + * @param object $service The service instance + * @param string $scope The scope of the service + * + * @api + */ + public function set($id, $service, $scope = self::SCOPE_CONTAINER); + + /** + * Gets a service. + * + * @param string $id The service identifier + * @param int $invalidBehavior The behavior when the service does not exist + * + * @return object The associated service + * + * @throws InvalidArgumentException if the service is not defined + * @throws ServiceCircularReferenceException When a circular reference is detected + * @throws ServiceNotFoundException When the service is not defined + * + * @see Reference + * + * @api + */ + public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE); + + /** + * Returns true if the given service is defined. + * + * @param string $id The service identifier + * + * @return bool true if the service is defined, false otherwise + * + * @api + */ + public function has($id); + + /** + * Gets a parameter. + * + * @param string $name The parameter name + * + * @return mixed The parameter value + * + * @throws InvalidArgumentException if the parameter is not defined + * + * @api + */ + public function getParameter($name); + + /** + * Checks if a parameter exists. + * + * @param string $name The parameter name + * + * @return bool The presence of parameter in container + * + * @api + */ + public function hasParameter($name); + + /** + * Sets a parameter. + * + * @param string $name The parameter name + * @param mixed $value The parameter value + * + * @api + */ + public function setParameter($name, $value); + + /** + * Enters the given scope + * + * @param string $name + * + * @api + */ + public function enterScope($name); + + /** + * Leaves the current scope, and re-enters the parent scope + * + * @param string $name + * + * @api + */ + public function leaveScope($name); + + /** + * Adds a scope to the container + * + * @param ScopeInterface $scope + * + * @api + */ + public function addScope(ScopeInterface $scope); + + /** + * Whether this container has the given scope + * + * @param string $name + * + * @return bool + * + * @api + */ + public function hasScope($name); + + /** + * Determines whether the given scope is currently active. + * + * It does however not check if the scope actually exists. + * + * @param string $name + * + * @return bool + * + * @api + */ + public function isScopeActive($name); +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php new file mode 100644 index 0000000..8ac74ad --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php @@ -0,0 +1,715 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\OutOfBoundsException; + +/** + * Definition represents a service definition. + * + * @author Fabien Potencier + * + * @api + */ +class Definition +{ + private $class; + private $file; + private $factoryClass; + private $factoryMethod; + private $factoryService; + private $scope; + private $properties; + private $calls; + private $configurator; + private $tags; + private $public; + private $synthetic; + private $abstract; + private $synchronized; + private $lazy; + + protected $arguments; + + /** + * Constructor. + * + * @param string $class The service class + * @param array $arguments An array of arguments to pass to the service constructor + * + * @api + */ + public function __construct($class = null, array $arguments = array()) + { + $this->class = $class; + $this->arguments = $arguments; + $this->calls = array(); + $this->scope = ContainerInterface::SCOPE_CONTAINER; + $this->tags = array(); + $this->public = true; + $this->synthetic = false; + $this->synchronized = false; + $this->lazy = false; + $this->abstract = false; + $this->properties = array(); + } + + /** + * Sets the name of the class that acts as a factory using the factory method, + * which will be invoked statically. + * + * @param string $factoryClass The factory class name + * + * @return Definition The current instance + * + * @api + */ + public function setFactoryClass($factoryClass) + { + $this->factoryClass = $factoryClass; + + return $this; + } + + /** + * Gets the factory class. + * + * @return string The factory class name + * + * @api + */ + public function getFactoryClass() + { + return $this->factoryClass; + } + + /** + * Sets the factory method able to create an instance of this class. + * + * @param string $factoryMethod The factory method name + * + * @return Definition The current instance + * + * @api + */ + public function setFactoryMethod($factoryMethod) + { + $this->factoryMethod = $factoryMethod; + + return $this; + } + + /** + * Gets the factory method. + * + * @return string The factory method name + * + * @api + */ + public function getFactoryMethod() + { + return $this->factoryMethod; + } + + /** + * Sets the name of the service that acts as a factory using the factory method. + * + * @param string $factoryService The factory service id + * + * @return Definition The current instance + * + * @api + */ + public function setFactoryService($factoryService) + { + $this->factoryService = $factoryService; + + return $this; + } + + /** + * Gets the factory service id. + * + * @return string The factory service id + * + * @api + */ + public function getFactoryService() + { + return $this->factoryService; + } + + /** + * Sets the service class. + * + * @param string $class The service class + * + * @return Definition The current instance + * + * @api + */ + public function setClass($class) + { + $this->class = $class; + + return $this; + } + + /** + * Gets the service class. + * + * @return string The service class + * + * @api + */ + public function getClass() + { + return $this->class; + } + + /** + * Sets the arguments to pass to the service constructor/factory method. + * + * @param array $arguments An array of arguments + * + * @return Definition The current instance + * + * @api + */ + public function setArguments(array $arguments) + { + $this->arguments = $arguments; + + return $this; + } + + /** + * @api + */ + public function setProperties(array $properties) + { + $this->properties = $properties; + + return $this; + } + + /** + * @api + */ + public function getProperties() + { + return $this->properties; + } + + /** + * @api + */ + public function setProperty($name, $value) + { + $this->properties[$name] = $value; + + return $this; + } + + /** + * Adds an argument to pass to the service constructor/factory method. + * + * @param mixed $argument An argument + * + * @return Definition The current instance + * + * @api + */ + public function addArgument($argument) + { + $this->arguments[] = $argument; + + return $this; + } + + /** + * Sets a specific argument + * + * @param int $index + * @param mixed $argument + * + * @return Definition The current instance + * + * @throws OutOfBoundsException When the replaced argument does not exist + * + * @api + */ + public function replaceArgument($index, $argument) + { + if ($index < 0 || $index > count($this->arguments) - 1) { + throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, count($this->arguments) - 1)); + } + + $this->arguments[$index] = $argument; + + return $this; + } + + /** + * Gets the arguments to pass to the service constructor/factory method. + * + * @return array The array of arguments + * + * @api + */ + public function getArguments() + { + return $this->arguments; + } + + /** + * Gets an argument to pass to the service constructor/factory method. + * + * @param int $index + * + * @return mixed The argument value + * + * @throws OutOfBoundsException When the argument does not exist + * + * @api + */ + public function getArgument($index) + { + if ($index < 0 || $index > count($this->arguments) - 1) { + throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, count($this->arguments) - 1)); + } + + return $this->arguments[$index]; + } + + /** + * Sets the methods to call after service initialization. + * + * @param array $calls An array of method calls + * + * @return Definition The current instance + * + * @api + */ + public function setMethodCalls(array $calls = array()) + { + $this->calls = array(); + foreach ($calls as $call) { + $this->addMethodCall($call[0], $call[1]); + } + + return $this; + } + + /** + * Adds a method to call after service initialization. + * + * @param string $method The method name to call + * @param array $arguments An array of arguments to pass to the method call + * + * @return Definition The current instance + * + * @throws InvalidArgumentException on empty $method param + * + * @api + */ + public function addMethodCall($method, array $arguments = array()) + { + if (empty($method)) { + throw new InvalidArgumentException(sprintf('Method name cannot be empty.')); + } + $this->calls[] = array($method, $arguments); + + return $this; + } + + /** + * Removes a method to call after service initialization. + * + * @param string $method The method name to remove + * + * @return Definition The current instance + * + * @api + */ + public function removeMethodCall($method) + { + foreach ($this->calls as $i => $call) { + if ($call[0] === $method) { + unset($this->calls[$i]); + break; + } + } + + return $this; + } + + /** + * Check if the current definition has a given method to call after service initialization. + * + * @param string $method The method name to search for + * + * @return bool + * + * @api + */ + public function hasMethodCall($method) + { + foreach ($this->calls as $call) { + if ($call[0] === $method) { + return true; + } + } + + return false; + } + + /** + * Gets the methods to call after service initialization. + * + * @return array An array of method calls + * + * @api + */ + public function getMethodCalls() + { + return $this->calls; + } + + /** + * Sets tags for this definition + * + * @param array $tags + * + * @return Definition the current instance + * + * @api + */ + public function setTags(array $tags) + { + $this->tags = $tags; + + return $this; + } + + /** + * Returns all tags. + * + * @return array An array of tags + * + * @api + */ + public function getTags() + { + return $this->tags; + } + + /** + * Gets a tag by name. + * + * @param string $name The tag name + * + * @return array An array of attributes + * + * @api + */ + public function getTag($name) + { + return isset($this->tags[$name]) ? $this->tags[$name] : array(); + } + + /** + * Adds a tag for this definition. + * + * @param string $name The tag name + * @param array $attributes An array of attributes + * + * @return Definition The current instance + * + * @api + */ + public function addTag($name, array $attributes = array()) + { + $this->tags[$name][] = $attributes; + + return $this; + } + + /** + * Whether this definition has a tag with the given name + * + * @param string $name + * + * @return bool + * + * @api + */ + public function hasTag($name) + { + return isset($this->tags[$name]); + } + + /** + * Clears all tags for a given name. + * + * @param string $name The tag name + * + * @return Definition + */ + public function clearTag($name) + { + if (isset($this->tags[$name])) { + unset($this->tags[$name]); + } + + return $this; + } + + /** + * Clears the tags for this definition. + * + * @return Definition The current instance + * + * @api + */ + public function clearTags() + { + $this->tags = array(); + + return $this; + } + + /** + * Sets a file to require before creating the service. + * + * @param string $file A full pathname to include + * + * @return Definition The current instance + * + * @api + */ + public function setFile($file) + { + $this->file = $file; + + return $this; + } + + /** + * Gets the file to require before creating the service. + * + * @return string The full pathname to include + * + * @api + */ + public function getFile() + { + return $this->file; + } + + /** + * Sets the scope of the service + * + * @param string $scope Whether the service must be shared or not + * + * @return Definition The current instance + * + * @api + */ + public function setScope($scope) + { + $this->scope = $scope; + + return $this; + } + + /** + * Returns the scope of the service + * + * @return string + * + * @api + */ + public function getScope() + { + return $this->scope; + } + + /** + * Sets the visibility of this service. + * + * @param bool $boolean + * + * @return Definition The current instance + * + * @api + */ + public function setPublic($boolean) + { + $this->public = (bool) $boolean; + + return $this; + } + + /** + * Whether this service is public facing + * + * @return bool + * + * @api + */ + public function isPublic() + { + return $this->public; + } + + /** + * Sets the synchronized flag of this service. + * + * @param bool $boolean + * + * @return Definition The current instance + * + * @api + */ + public function setSynchronized($boolean) + { + $this->synchronized = (bool) $boolean; + + return $this; + } + + /** + * Whether this service is synchronized. + * + * @return bool + * + * @api + */ + public function isSynchronized() + { + return $this->synchronized; + } + + /** + * Sets the lazy flag of this service. + * + * @param bool $lazy + * + * @return Definition The current instance + */ + public function setLazy($lazy) + { + $this->lazy = (bool) $lazy; + + return $this; + } + + /** + * Whether this service is lazy. + * + * @return bool + */ + public function isLazy() + { + return $this->lazy; + } + + /** + * Sets whether this definition is synthetic, that is not constructed by the + * container, but dynamically injected. + * + * @param bool $boolean + * + * @return Definition the current instance + * + * @api + */ + public function setSynthetic($boolean) + { + $this->synthetic = (bool) $boolean; + + return $this; + } + + /** + * Whether this definition is synthetic, that is not constructed by the + * container, but dynamically injected. + * + * @return bool + * + * @api + */ + public function isSynthetic() + { + return $this->synthetic; + } + + /** + * Whether this definition is abstract, that means it merely serves as a + * template for other definitions. + * + * @param bool $boolean + * + * @return Definition the current instance + * + * @api + */ + public function setAbstract($boolean) + { + $this->abstract = (bool) $boolean; + + return $this; + } + + /** + * Whether this definition is abstract, that means it merely serves as a + * template for other definitions. + * + * @return bool + * + * @api + */ + public function isAbstract() + { + return $this->abstract; + } + + /** + * Sets a configurator to call after the service is fully initialized. + * + * @param callable $callable A PHP callable + * + * @return Definition The current instance + * + * @api + */ + public function setConfigurator($callable) + { + $this->configurator = $callable; + + return $this; + } + + /** + * Gets the configurator to call after the service is fully initialized. + * + * @return callable The PHP callable to call + * + * @api + */ + public function getConfigurator() + { + return $this->configurator; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php new file mode 100644 index 0000000..7d224aa --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php @@ -0,0 +1,219 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\OutOfBoundsException; + +/** + * This definition decorates another definition. + * + * @author Johannes M. Schmitt + * + * @api + */ +class DefinitionDecorator extends Definition +{ + private $parent; + private $changes; + + /** + * Constructor. + * + * @param string $parent The id of Definition instance to decorate. + * + * @api + */ + public function __construct($parent) + { + parent::__construct(); + + $this->parent = $parent; + $this->changes = array(); + } + + /** + * Returns the Definition being decorated. + * + * @return string + * + * @api + */ + public function getParent() + { + return $this->parent; + } + + /** + * Returns all changes tracked for the Definition object. + * + * @return array An array of changes for this Definition + * + * @api + */ + public function getChanges() + { + return $this->changes; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function setClass($class) + { + $this->changes['class'] = true; + + return parent::setClass($class); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function setFactoryClass($class) + { + $this->changes['factory_class'] = true; + + return parent::setFactoryClass($class); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function setFactoryMethod($method) + { + $this->changes['factory_method'] = true; + + return parent::setFactoryMethod($method); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function setFactoryService($service) + { + $this->changes['factory_service'] = true; + + return parent::setFactoryService($service); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function setConfigurator($callable) + { + $this->changes['configurator'] = true; + + return parent::setConfigurator($callable); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function setFile($file) + { + $this->changes['file'] = true; + + return parent::setFile($file); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function setPublic($boolean) + { + $this->changes['public'] = true; + + return parent::setPublic($boolean); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function setLazy($boolean) + { + $this->changes['lazy'] = true; + + return parent::setLazy($boolean); + } + + /** + * Gets an argument to pass to the service constructor/factory method. + * + * If replaceArgument() has been used to replace an argument, this method + * will return the replacement value. + * + * @param int $index + * + * @return mixed The argument value + * + * @throws OutOfBoundsException When the argument does not exist + * + * @api + */ + public function getArgument($index) + { + if (array_key_exists('index_'.$index, $this->arguments)) { + return $this->arguments['index_'.$index]; + } + + $lastIndex = count(array_filter(array_keys($this->arguments), 'is_int')) - 1; + + if ($index < 0 || $index > $lastIndex) { + throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, $lastIndex)); + } + + return $this->arguments[$index]; + } + + /** + * You should always use this method when overwriting existing arguments + * of the parent definition. + * + * If you directly call setArguments() keep in mind that you must follow + * certain conventions when you want to overwrite the arguments of the + * parent definition, otherwise your arguments will only be appended. + * + * @param int $index + * @param mixed $value + * + * @return DefinitionDecorator the current instance + * @throws InvalidArgumentException when $index isn't an integer + * + * @api + */ + public function replaceArgument($index, $value) + { + if (!is_int($index)) { + throw new InvalidArgumentException('$index must be an integer.'); + } + + $this->arguments['index_'.$index] = $value; + + return $this; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/Dumper.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/Dumper.php new file mode 100644 index 0000000..9892401 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/Dumper.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Dumper; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Dumper is the abstract class for all built-in dumpers. + * + * @author Fabien Potencier + * + * @api + */ +abstract class Dumper implements DumperInterface +{ + protected $container; + + /** + * Constructor. + * + * @param ContainerBuilder $container The service container to dump + * + * @api + */ + public function __construct(ContainerBuilder $container) + { + $this->container = $container; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php new file mode 100644 index 0000000..ba146f6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Dumper; + +/** + * DumperInterface is the interface implemented by service container dumper classes. + * + * @author Fabien Potencier + * + * @api + */ +interface DumperInterface +{ + /** + * Dumps the service container. + * + * @param array $options An array of options + * + * @return string The representation of the service container + * + * @api + */ + public function dump(array $options = array()); +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php new file mode 100644 index 0000000..1ffe142 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php @@ -0,0 +1,295 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Dumper; + +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Parameter; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; +use Symfony\Component\DependencyInjection\Scope; + +/** + * GraphvizDumper dumps a service container as a graphviz file. + * + * You can convert the generated dot file with the dot utility (http://www.graphviz.org/): + * + * dot -Tpng container.dot > foo.png + * + * @author Fabien Potencier + */ +class GraphvizDumper extends Dumper +{ + private $nodes; + private $edges; + private $options = array( + 'graph' => array('ratio' => 'compress'), + 'node' => array('fontsize' => 11, 'fontname' => 'Arial', 'shape' => 'record'), + 'edge' => array('fontsize' => 9, 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => 0.5), + 'node.instance' => array('fillcolor' => '#9999ff', 'style' => 'filled'), + 'node.definition' => array('fillcolor' => '#eeeeee'), + 'node.missing' => array('fillcolor' => '#ff9999', 'style' => 'filled'), + ); + + /** + * Dumps the service container as a graphviz graph. + * + * Available options: + * + * * graph: The default options for the whole graph + * * node: The default options for nodes + * * edge: The default options for edges + * * node.instance: The default options for services that are defined directly by object instances + * * node.definition: The default options for services that are defined via service definition instances + * * node.missing: The default options for missing services + * + * @param array $options An array of options + * + * @return string The dot representation of the service container + */ + public function dump(array $options = array()) + { + foreach (array('graph', 'node', 'edge', 'node.instance', 'node.definition', 'node.missing') as $key) { + if (isset($options[$key])) { + $this->options[$key] = array_merge($this->options[$key], $options[$key]); + } + } + + $this->nodes = $this->findNodes(); + + $this->edges = array(); + foreach ($this->container->getDefinitions() as $id => $definition) { + $this->edges[$id] = array_merge( + $this->findEdges($id, $definition->getArguments(), true, ''), + $this->findEdges($id, $definition->getProperties(), false, '') + ); + + foreach ($definition->getMethodCalls() as $call) { + $this->edges[$id] = array_merge( + $this->edges[$id], + $this->findEdges($id, $call[1], false, $call[0].'()') + ); + } + } + + return $this->startDot().$this->addNodes().$this->addEdges().$this->endDot(); + } + + /** + * Returns all nodes. + * + * @return string A string representation of all nodes + */ + private function addNodes() + { + $code = ''; + foreach ($this->nodes as $id => $node) { + $aliases = $this->getAliases($id); + + $code .= sprintf(" node_%s [label=\"%s\\n%s\\n\", shape=%s%s];\n", $this->dotize($id), $id.($aliases ? ' ('.implode(', ', $aliases).')' : ''), $node['class'], $this->options['node']['shape'], $this->addAttributes($node['attributes'])); + } + + return $code; + } + + /** + * Returns all edges. + * + * @return string A string representation of all edges + */ + private function addEdges() + { + $code = ''; + foreach ($this->edges as $id => $edges) { + foreach ($edges as $edge) { + $code .= sprintf(" node_%s -> node_%s [label=\"%s\" style=\"%s\"];\n", $this->dotize($id), $this->dotize($edge['to']), $edge['name'], $edge['required'] ? 'filled' : 'dashed'); + } + } + + return $code; + } + + /** + * Finds all edges belonging to a specific service id. + * + * @param string $id The service id used to find edges + * @param array $arguments An array of arguments + * @param bool $required + * @param string $name + * + * @return array An array of edges + */ + private function findEdges($id, $arguments, $required, $name) + { + $edges = array(); + foreach ($arguments as $argument) { + if ($argument instanceof Parameter) { + $argument = $this->container->hasParameter($argument) ? $this->container->getParameter($argument) : null; + } elseif (is_string($argument) && preg_match('/^%([^%]+)%$/', $argument, $match)) { + $argument = $this->container->hasParameter($match[1]) ? $this->container->getParameter($match[1]) : null; + } + + if ($argument instanceof Reference) { + if (!$this->container->has((string) $argument)) { + $this->nodes[(string) $argument] = array('name' => $name, 'required' => $required, 'class' => '', 'attributes' => $this->options['node.missing']); + } + + $edges[] = array('name' => $name, 'required' => $required, 'to' => $argument); + } elseif (is_array($argument)) { + $edges = array_merge($edges, $this->findEdges($id, $argument, $required, $name)); + } + } + + return $edges; + } + + /** + * Finds all nodes. + * + * @return array An array of all nodes + */ + private function findNodes() + { + $nodes = array(); + + $container = $this->cloneContainer(); + + foreach ($container->getDefinitions() as $id => $definition) { + $nodes[$id] = array('class' => str_replace('\\', '\\\\', $this->container->getParameterBag()->resolveValue($definition->getClass())), 'attributes' => array_merge($this->options['node.definition'], array('style' => ContainerInterface::SCOPE_PROTOTYPE !== $definition->getScope() ? 'filled' : 'dotted'))); + + $container->setDefinition($id, new Definition('stdClass')); + } + + foreach ($container->getServiceIds() as $id) { + $service = $container->get($id); + + if (in_array($id, array_keys($container->getAliases()))) { + continue; + } + + if (!$container->hasDefinition($id)) { + $class = ('service_container' === $id) ? get_class($this->container) : get_class($service); + $nodes[$id] = array('class' => str_replace('\\', '\\\\', $class), 'attributes' => $this->options['node.instance']); + } + } + + return $nodes; + } + + private function cloneContainer() + { + $parameterBag = new ParameterBag($this->container->getParameterBag()->all()); + + $container = new ContainerBuilder($parameterBag); + $container->setDefinitions($this->container->getDefinitions()); + $container->setAliases($this->container->getAliases()); + $container->setResources($this->container->getResources()); + foreach ($this->container->getScopes() as $scope => $parentScope) { + $container->addScope(new Scope($scope, $parentScope)); + } + foreach ($this->container->getExtensions() as $extension) { + $container->registerExtension($extension); + } + + return $container; + } + + /** + * Returns the start dot. + * + * @return string The string representation of a start dot + */ + private function startDot() + { + return sprintf("digraph sc {\n %s\n node [%s];\n edge [%s];\n\n", + $this->addOptions($this->options['graph']), + $this->addOptions($this->options['node']), + $this->addOptions($this->options['edge']) + ); + } + + /** + * Returns the end dot. + * + * @return string + */ + private function endDot() + { + return "}\n"; + } + + /** + * Adds attributes + * + * @param array $attributes An array of attributes + * + * @return string A comma separated list of attributes + */ + private function addAttributes($attributes) + { + $code = array(); + foreach ($attributes as $k => $v) { + $code[] = sprintf('%s="%s"', $k, $v); + } + + return $code ? ', '.implode(', ', $code) : ''; + } + + /** + * Adds options + * + * @param array $options An array of options + * + * @return string A space separated list of options + */ + private function addOptions($options) + { + $code = array(); + foreach ($options as $k => $v) { + $code[] = sprintf('%s="%s"', $k, $v); + } + + return implode(' ', $code); + } + + /** + * Dotizes an identifier. + * + * @param string $id The identifier to dotize + * + * @return string A dotized string + */ + private function dotize($id) + { + return strtolower(preg_replace('/[^\w]/i', '_', $id)); + } + + /** + * Compiles an array of aliases for a specified service id. + * + * @param string $id A service id + * + * @return array An array of aliases + */ + private function getAliases($id) + { + $aliases = array(); + foreach ($this->container->getAliases() as $alias => $origin) { + if ($id == $origin) { + $aliases[] = $alias; + } + } + + return $aliases; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php new file mode 100644 index 0000000..b8addc1 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -0,0 +1,1326 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Dumper; + +use Symfony\Component\DependencyInjection\Variable; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Parameter; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; +use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface as ProxyDumper; +use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\NullDumper; + +/** + * PhpDumper dumps a service container as a PHP class. + * + * @author Fabien Potencier + * @author Johannes M. Schmitt + * + * @api + */ +class PhpDumper extends Dumper +{ + /** + * Characters that might appear in the generated variable name as first character + * @var string + */ + const FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz'; + + /** + * Characters that might appear in the generated variable name as any but the first character + * @var string + */ + const NON_FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz0123456789_'; + + private $inlinedDefinitions; + private $definitionVariables; + private $referenceVariables; + private $variableCount; + private $reservedVariables = array('instance', 'class'); + + /** + * @var \Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface + */ + private $proxyDumper; + + /** + * {@inheritdoc} + * + * @api + */ + public function __construct(ContainerBuilder $container) + { + parent::__construct($container); + + $this->inlinedDefinitions = new \SplObjectStorage(); + } + + /** + * Sets the dumper to be used when dumping proxies in the generated container. + * + * @param ProxyDumper $proxyDumper + */ + public function setProxyDumper(ProxyDumper $proxyDumper) + { + $this->proxyDumper = $proxyDumper; + } + + /** + * Dumps the service container as a PHP class. + * + * Available options: + * + * * class: The class name + * * base_class: The base class name + * + * @param array $options An array of options + * + * @return string A PHP class representing of the service container + * + * @api + */ + public function dump(array $options = array()) + { + $options = array_merge(array( + 'class' => 'ProjectServiceContainer', + 'base_class' => 'Container', + ), $options); + + $code = $this->startClass($options['class'], $options['base_class']); + + if ($this->container->isFrozen()) { + $code .= $this->addFrozenConstructor(); + } else { + $code .= $this->addConstructor(); + } + + $code .= + $this->addServices(). + $this->addDefaultParametersMethod(). + $this->endClass(). + $this->addProxyClasses() + ; + + return $code; + } + + /** + * Retrieves the currently set proxy dumper or instantiates one. + * + * @return ProxyDumper + */ + private function getProxyDumper() + { + if (!$this->proxyDumper) { + $this->proxyDumper = new NullDumper(); + } + + return $this->proxyDumper; + } + + /** + * Generates Service local temp variables. + * + * @param string $cId + * @param string $definition + * + * @return string + */ + private function addServiceLocalTempVariables($cId, $definition) + { + static $template = " \$%s = %s;\n"; + + $localDefinitions = array_merge( + array($definition), + $this->getInlinedDefinitions($definition) + ); + + $calls = $behavior = array(); + foreach ($localDefinitions as $iDefinition) { + $this->getServiceCallsFromArguments($iDefinition->getArguments(), $calls, $behavior); + $this->getServiceCallsFromArguments($iDefinition->getMethodCalls(), $calls, $behavior); + $this->getServiceCallsFromArguments($iDefinition->getProperties(), $calls, $behavior); + } + + $code = ''; + foreach ($calls as $id => $callCount) { + if ('service_container' === $id || $id === $cId) { + continue; + } + + if ($callCount > 1) { + $name = $this->getNextVariableName(); + $this->referenceVariables[$id] = new Variable($name); + + if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE === $behavior[$id]) { + $code .= sprintf($template, $name, $this->getServiceCall($id)); + } else { + $code .= sprintf($template, $name, $this->getServiceCall($id, new Reference($id, ContainerInterface::NULL_ON_INVALID_REFERENCE))); + } + } + } + + if ('' !== $code) { + $code .= "\n"; + } + + return $code; + } + + /** + * Generates code for the proxies to be attached after the container class + * + * @return string + */ + private function addProxyClasses() + { + /* @var $definitions Definition[] */ + $definitions = array_filter( + $this->container->getDefinitions(), + array($this->getProxyDumper(), 'isProxyCandidate') + ); + $code = ''; + + foreach ($definitions as $definition) { + $code .= "\n".$this->getProxyDumper()->getProxyCode($definition); + } + + return $code; + } + + /** + * Generates the require_once statement for service includes. + * + * @param string $id The service id + * @param Definition $definition + * + * @return string + */ + private function addServiceInclude($id, $definition) + { + $template = " require_once %s;\n"; + $code = ''; + + if (null !== $file = $definition->getFile()) { + $code .= sprintf($template, $this->dumpValue($file)); + } + + foreach ($this->getInlinedDefinitions($definition) as $definition) { + if (null !== $file = $definition->getFile()) { + $code .= sprintf($template, $this->dumpValue($file)); + } + } + + if ('' !== $code) { + $code .= "\n"; + } + + return $code; + } + + /** + * Generates the inline definition of a service. + * + * @param string $id + * @param Definition $definition + * + * @return string + * + * @throws RuntimeException When the factory definition is incomplete + * @throws ServiceCircularReferenceException When a circular reference is detected + */ + private function addServiceInlinedDefinitions($id, $definition) + { + $code = ''; + $variableMap = $this->definitionVariables; + $nbOccurrences = new \SplObjectStorage(); + $processed = new \SplObjectStorage(); + $inlinedDefinitions = $this->getInlinedDefinitions($definition); + + foreach ($inlinedDefinitions as $definition) { + if (false === $nbOccurrences->contains($definition)) { + $nbOccurrences->offsetSet($definition, 1); + } else { + $i = $nbOccurrences->offsetGet($definition); + $nbOccurrences->offsetSet($definition, $i + 1); + } + } + + foreach ($inlinedDefinitions as $sDefinition) { + if ($processed->contains($sDefinition)) { + continue; + } + $processed->offsetSet($sDefinition); + + $class = $this->dumpValue($sDefinition->getClass()); + if ($nbOccurrences->offsetGet($sDefinition) > 1 || $sDefinition->getMethodCalls() || $sDefinition->getProperties() || null !== $sDefinition->getConfigurator() || false !== strpos($class, '$')) { + $name = $this->getNextVariableName(); + $variableMap->offsetSet($sDefinition, new Variable($name)); + + // a construct like: + // $a = new ServiceA(ServiceB $b); $b = new ServiceB(ServiceA $a); + // this is an indication for a wrong implementation, you can circumvent this problem + // by setting up your service structure like this: + // $b = new ServiceB(); + // $a = new ServiceA(ServiceB $b); + // $b->setServiceA(ServiceA $a); + if ($this->hasReference($id, $sDefinition->getArguments())) { + throw new ServiceCircularReferenceException($id, array($id)); + } + + $code .= $this->addNewInstance($id, $sDefinition, '$'.$name, ' = '); + + if (!$this->hasReference($id, $sDefinition->getMethodCalls(), true) && !$this->hasReference($id, $sDefinition->getProperties(), true)) { + $code .= $this->addServiceMethodCalls(null, $sDefinition, $name); + $code .= $this->addServiceProperties(null, $sDefinition, $name); + $code .= $this->addServiceConfigurator(null, $sDefinition, $name); + } + + $code .= "\n"; + } + } + + return $code; + } + + /** + * Adds the service return statement. + * + * @param string $id Service id + * @param Definition $definition + * + * @return string + */ + private function addServiceReturn($id, $definition) + { + if ($this->isSimpleInstance($id, $definition)) { + return " }\n"; + } + + return "\n return \$instance;\n }\n"; + } + + /** + * Generates the service instance. + * + * @param string $id + * @param Definition $definition + * + * @return string + * + * @throws InvalidArgumentException + * @throws RuntimeException + */ + private function addServiceInstance($id, $definition) + { + $class = $this->dumpValue($definition->getClass()); + + if (0 === strpos($class, "'") && !preg_match('/^\'[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\\\{2}[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*\'$/', $class)) { + throw new InvalidArgumentException(sprintf('"%s" is not a valid class name for the "%s" service.', $class, $id)); + } + + $simple = $this->isSimpleInstance($id, $definition); + $isProxyCandidate = $this->getProxyDumper()->isProxyCandidate($definition); + $instantiation = ''; + + if (!$isProxyCandidate && ContainerInterface::SCOPE_CONTAINER === $definition->getScope()) { + $instantiation = "\$this->services['$id'] = ".($simple ? '' : '$instance'); + } elseif (!$isProxyCandidate && ContainerInterface::SCOPE_PROTOTYPE !== $scope = $definition->getScope()) { + $instantiation = "\$this->services['$id'] = \$this->scopedServices['$scope']['$id'] = ".($simple ? '' : '$instance'); + } elseif (!$simple) { + $instantiation = '$instance'; + } + + $return = ''; + if ($simple) { + $return = 'return '; + } else { + $instantiation .= ' = '; + } + + $code = $this->addNewInstance($id, $definition, $return, $instantiation); + + if (!$simple) { + $code .= "\n"; + } + + return $code; + } + + /** + * Checks if the definition is a simple instance. + * + * @param string $id + * @param Definition $definition + * + * @return bool + */ + private function isSimpleInstance($id, $definition) + { + foreach (array_merge(array($definition), $this->getInlinedDefinitions($definition)) as $sDefinition) { + if ($definition !== $sDefinition && !$this->hasReference($id, $sDefinition->getMethodCalls())) { + continue; + } + + if ($sDefinition->getMethodCalls() || $sDefinition->getProperties() || $sDefinition->getConfigurator()) { + return false; + } + } + + return true; + } + + /** + * Adds method calls to a service definition. + * + * @param string $id + * @param Definition $definition + * @param string $variableName + * + * @return string + */ + private function addServiceMethodCalls($id, $definition, $variableName = 'instance') + { + $calls = ''; + foreach ($definition->getMethodCalls() as $call) { + $arguments = array(); + foreach ($call[1] as $value) { + $arguments[] = $this->dumpValue($value); + } + + $calls .= $this->wrapServiceConditionals($call[1], sprintf(" \$%s->%s(%s);\n", $variableName, $call[0], implode(', ', $arguments))); + } + + return $calls; + } + + private function addServiceProperties($id, $definition, $variableName = 'instance') + { + $code = ''; + foreach ($definition->getProperties() as $name => $value) { + $code .= sprintf(" \$%s->%s = %s;\n", $variableName, $name, $this->dumpValue($value)); + } + + return $code; + } + + /** + * Generates the inline definition setup. + * + * @param string $id + * @param Definition $definition + * + * @return string + * + * @throws ServiceCircularReferenceException when the container contains a circular reference + */ + private function addServiceInlinedDefinitionsSetup($id, $definition) + { + $this->referenceVariables[$id] = new Variable('instance'); + + $code = ''; + $processed = new \SplObjectStorage(); + foreach ($this->getInlinedDefinitions($definition) as $iDefinition) { + if ($processed->contains($iDefinition)) { + continue; + } + $processed->offsetSet($iDefinition); + + if (!$this->hasReference($id, $iDefinition->getMethodCalls(), true) && !$this->hasReference($id, $iDefinition->getProperties(), true)) { + continue; + } + + // if the instance is simple, the return statement has already been generated + // so, the only possible way to get there is because of a circular reference + if ($this->isSimpleInstance($id, $definition)) { + throw new ServiceCircularReferenceException($id, array($id)); + } + + $name = (string) $this->definitionVariables->offsetGet($iDefinition); + $code .= $this->addServiceMethodCalls(null, $iDefinition, $name); + $code .= $this->addServiceProperties(null, $iDefinition, $name); + $code .= $this->addServiceConfigurator(null, $iDefinition, $name); + } + + if ('' !== $code) { + $code .= "\n"; + } + + return $code; + } + + /** + * Adds configurator definition + * + * @param string $id + * @param Definition $definition + * @param string $variableName + * + * @return string + */ + private function addServiceConfigurator($id, $definition, $variableName = 'instance') + { + if (!$callable = $definition->getConfigurator()) { + return ''; + } + + if (is_array($callable)) { + if ($callable[0] instanceof Reference) { + return sprintf(" %s->%s(\$%s);\n", $this->getServiceCall((string) $callable[0]), $callable[1], $variableName); + } + + return sprintf(" call_user_func(array(%s, '%s'), \$%s);\n", $this->dumpValue($callable[0]), $callable[1], $variableName); + } + + return sprintf(" %s(\$%s);\n", $callable, $variableName); + } + + /** + * Adds a service + * + * @param string $id + * @param Definition $definition + * + * @return string + */ + private function addService($id, $definition) + { + $this->definitionVariables = new \SplObjectStorage(); + $this->referenceVariables = array(); + $this->variableCount = 0; + + $return = array(); + + if ($definition->isSynthetic()) { + $return[] = '@throws RuntimeException always since this service is expected to be injected dynamically'; + } elseif ($class = $definition->getClass()) { + $return[] = sprintf("@return %s A %s instance.", 0 === strpos($class, '%') ? 'object' : "\\".$class, $class); + } elseif ($definition->getFactoryClass()) { + $return[] = sprintf('@return object An instance returned by %s::%s().', $definition->getFactoryClass(), $definition->getFactoryMethod()); + } elseif ($definition->getFactoryService()) { + $return[] = sprintf('@return object An instance returned by %s::%s().', $definition->getFactoryService(), $definition->getFactoryMethod()); + } + + $scope = $definition->getScope(); + if (!in_array($scope, array(ContainerInterface::SCOPE_CONTAINER, ContainerInterface::SCOPE_PROTOTYPE))) { + if ($return && 0 === strpos($return[count($return) - 1], '@return')) { + $return[] = ''; + } + $return[] = sprintf("@throws InactiveScopeException when the '%s' service is requested while the '%s' scope is not active", $id, $scope); + } + + $return = implode("\n * ", $return); + + $doc = ''; + if (ContainerInterface::SCOPE_PROTOTYPE !== $scope) { + $doc .= <<isPublic()) { + $doc .= <<isLazy()) { + $lazyInitialization = '$lazyLoad = true'; + $lazyInitializationDoc = "\n * @param bool \$lazyLoad whether to try lazy-loading the service with a proxy\n *"; + } else { + $lazyInitialization = ''; + $lazyInitializationDoc = ''; + } + + // with proxies, for 5.3.3 compatibility, the getter must be public to be accessible to the initializer + $isProxyCandidate = $this->getProxyDumper()->isProxyCandidate($definition); + $visibility = $isProxyCandidate ? 'public' : 'protected'; + $code = <<camelize($id)}Service($lazyInitialization) + { + +EOF; + + $code .= $isProxyCandidate ? $this->getProxyDumper()->getProxyFactoryCode($definition, $id) : ''; + + if (!in_array($scope, array(ContainerInterface::SCOPE_CONTAINER, ContainerInterface::SCOPE_PROTOTYPE))) { + $code .= <<scopedServices['$scope'])) { + throw new InactiveScopeException('$id', '$scope'); + } + + +EOF; + } + + if ($definition->isSynthetic()) { + $code .= sprintf(" throw new RuntimeException('You have requested a synthetic service (\"%s\"). The DIC does not know how to construct this service.');\n }\n", $id); + } else { + $code .= + $this->addServiceInclude($id, $definition). + $this->addServiceLocalTempVariables($id, $definition). + $this->addServiceInlinedDefinitions($id, $definition). + $this->addServiceInstance($id, $definition). + $this->addServiceInlinedDefinitionsSetup($id, $definition). + $this->addServiceMethodCalls($id, $definition). + $this->addServiceProperties($id, $definition). + $this->addServiceConfigurator($id, $definition). + $this->addServiceReturn($id, $definition) + ; + } + + $this->definitionVariables = null; + $this->referenceVariables = null; + + return $code; + } + + /** + * Adds multiple services + * + * @return string + */ + private function addServices() + { + $publicServices = $privateServices = $synchronizers = ''; + $definitions = $this->container->getDefinitions(); + ksort($definitions); + foreach ($definitions as $id => $definition) { + if ($definition->isPublic()) { + $publicServices .= $this->addService($id, $definition); + } else { + $privateServices .= $this->addService($id, $definition); + } + + $synchronizers .= $this->addServiceSynchronizer($id, $definition); + } + + return $publicServices.$synchronizers.$privateServices; + } + + /** + * Adds synchronizer methods. + * + * @param string $id A service identifier + * @param Definition $definition A Definition instance + * + * @return string|null + */ + private function addServiceSynchronizer($id, Definition $definition) + { + if (!$definition->isSynchronized()) { + return; + } + + $code = ''; + foreach ($this->container->getDefinitions() as $definitionId => $definition) { + foreach ($definition->getMethodCalls() as $call) { + foreach ($call[1] as $argument) { + if ($argument instanceof Reference && $id == (string) $argument) { + $arguments = array(); + foreach ($call[1] as $value) { + $arguments[] = $this->dumpValue($value); + } + + $call = $this->wrapServiceConditionals($call[1], sprintf("\$this->get('%s')->%s(%s);", $definitionId, $call[0], implode(', ', $arguments))); + + $code .= <<initialized('$definitionId')) { + $call + } + +EOF; + } + } + } + } + + if (!$code) { + return; + } + + return <<camelize($id)}Service() + { +$code } + +EOF; + } + + private function addNewInstance($id, Definition $definition, $return, $instantiation) + { + $class = $this->dumpValue($definition->getClass()); + + $arguments = array(); + foreach ($definition->getArguments() as $value) { + $arguments[] = $this->dumpValue($value); + } + + if (null !== $definition->getFactoryMethod()) { + if (null !== $definition->getFactoryClass()) { + return sprintf(" $return{$instantiation}call_user_func(array(%s, '%s')%s);\n", $this->dumpValue($definition->getFactoryClass()), $definition->getFactoryMethod(), $arguments ? ', '.implode(', ', $arguments) : ''); + } + + if (null !== $definition->getFactoryService()) { + return sprintf(" $return{$instantiation}%s->%s(%s);\n", $this->getServiceCall($definition->getFactoryService()), $definition->getFactoryMethod(), implode(', ', $arguments)); + } + + throw new RuntimeException(sprintf('Factory method requires a factory service or factory class in service definition for %s', $id)); + } + + if (false !== strpos($class, '$')) { + return sprintf(" \$class = %s;\n\n $return{$instantiation}new \$class(%s);\n", $class, implode(', ', $arguments)); + } + + return sprintf(" $return{$instantiation}new \\%s(%s);\n", substr(str_replace('\\\\', '\\', $class), 1, -1), implode(', ', $arguments)); + } + + /** + * Adds the class headers. + * + * @param string $class Class name + * @param string $baseClass The name of the base class + * + * @return string + */ + private function startClass($class, $baseClass) + { + $bagClass = $this->container->isFrozen() ? 'use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;' : 'use Symfony\Component\DependencyInjection\ParameterBag\\ParameterBag;'; + + return <<container->getParameterBag()->all() ? 'new ParameterBag($this->getDefaultParameters())' : null; + + $code = <<container->getScopes()) > 0) { + $code .= "\n"; + $code .= " \$this->scopes = ".$this->dumpValue($scopes).";\n"; + $code .= " \$this->scopeChildren = ".$this->dumpValue($this->container->getScopeChildren()).";\n"; + } + + $code .= $this->addMethodMap(); + $code .= $this->addAliases(); + + $code .= <<container->getParameterBag()->all()) { + $code .= "\n \$this->parameters = \$this->getDefaultParameters();\n"; + } + + $code .= <<services = + \$this->scopedServices = + \$this->scopeStacks = array(); + + \$this->set('service_container', \$this); + +EOF; + + $code .= "\n"; + if (count($scopes = $this->container->getScopes()) > 0) { + $code .= " \$this->scopes = ".$this->dumpValue($scopes).";\n"; + $code .= " \$this->scopeChildren = ".$this->dumpValue($this->container->getScopeChildren()).";\n"; + } else { + $code .= " \$this->scopes = array();\n"; + $code .= " \$this->scopeChildren = array();\n"; + } + + $code .= $this->addMethodMap(); + $code .= $this->addAliases(); + + $code .= <<container->getDefinitions()) { + return ''; + } + + $code = " \$this->methodMap = array(\n"; + ksort($definitions); + foreach ($definitions as $id => $definition) { + $code .= ' '.var_export($id, true).' => '.var_export('get'.$this->camelize($id).'Service', true).",\n"; + } + + return $code." );\n"; + } + + /** + * Adds the aliases property definition + * + * @return string + */ + private function addAliases() + { + if (!$aliases = $this->container->getAliases()) { + if ($this->container->isFrozen()) { + return "\n \$this->aliases = array();\n"; + } else { + return ''; + } + } + + $code = " \$this->aliases = array(\n"; + ksort($aliases); + foreach ($aliases as $alias => $id) { + $id = (string) $id; + while (isset($aliases[$id])) { + $id = (string) $aliases[$id]; + } + $code .= ' '.var_export($alias, true).' => '.var_export($id, true).",\n"; + } + + return $code." );\n"; + } + + /** + * Adds default parameters method. + * + * @return string + */ + private function addDefaultParametersMethod() + { + if (!$this->container->getParameterBag()->all()) { + return ''; + } + + $parameters = $this->exportParameters($this->container->getParameterBag()->all()); + + $code = ''; + if ($this->container->isFrozen()) { + $code .= <<parameters[\$name]) || array_key_exists(\$name, \$this->parameters))) { + throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', \$name)); + } + + return \$this->parameters[\$name]; + } + + /** + * {@inheritdoc} + */ + public function hasParameter(\$name) + { + \$name = strtolower(\$name); + + return isset(\$this->parameters[\$name]) || array_key_exists(\$name, \$this->parameters); + } + + /** + * {@inheritdoc} + */ + public function setParameter(\$name, \$value) + { + throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); + } + + /** + * {@inheritdoc} + */ + public function getParameterBag() + { + if (null === \$this->parameterBag) { + \$this->parameterBag = new FrozenParameterBag(\$this->parameters); + } + + return \$this->parameterBag; + } +EOF; + } + + $code .= << $value) { + if (is_array($value)) { + $value = $this->exportParameters($value, $path.'/'.$key, $indent + 4); + } elseif ($value instanceof Variable) { + throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain variable references. Variable "%s" found in "%s".', $value, $path.'/'.$key)); + } elseif ($value instanceof Definition) { + throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain service definitions. Definition for "%s" found in "%s".', $value->getClass(), $path.'/'.$key)); + } elseif ($value instanceof Reference) { + throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain references to other services (reference to service "%s" found in "%s").', $value, $path.'/'.$key)); + } else { + $value = var_export($value, true); + } + + $php[] = sprintf('%s%s => %s,', str_repeat(' ', $indent), var_export($key, true), $value); + } + + return sprintf("array(\n%s\n%s)", implode("\n", $php), str_repeat(' ', $indent - 4)); + } + + /** + * Ends the class definition. + * + * @return string + */ + private function endClass() + { + return <<has('%s')", $service); + } + + // re-indent the wrapped code + $code = implode("\n", array_map(function ($line) { return $line ? ' '.$line : $line; }, explode("\n", $code))); + + return sprintf(" if (%s) {\n%s }\n", implode(' && ', $conditions), $code); + } + + /** + * Builds service calls from arguments. + * + * @param array $arguments + * @param array &$calls By reference + * @param array &$behavior By reference + */ + private function getServiceCallsFromArguments(array $arguments, array &$calls, array &$behavior) + { + foreach ($arguments as $argument) { + if (is_array($argument)) { + $this->getServiceCallsFromArguments($argument, $calls, $behavior); + } elseif ($argument instanceof Reference) { + $id = (string) $argument; + + if (!isset($calls[$id])) { + $calls[$id] = 0; + } + if (!isset($behavior[$id])) { + $behavior[$id] = $argument->getInvalidBehavior(); + } elseif (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $behavior[$id]) { + $behavior[$id] = $argument->getInvalidBehavior(); + } + + $calls[$id] += 1; + } + } + } + + /** + * Returns the inline definition. + * + * @param Definition $definition + * + * @return array + */ + private function getInlinedDefinitions(Definition $definition) + { + if (false === $this->inlinedDefinitions->contains($definition)) { + $definitions = array_merge( + $this->getDefinitionsFromArguments($definition->getArguments()), + $this->getDefinitionsFromArguments($definition->getMethodCalls()), + $this->getDefinitionsFromArguments($definition->getProperties()) + ); + + $this->inlinedDefinitions->offsetSet($definition, $definitions); + + return $definitions; + } + + return $this->inlinedDefinitions->offsetGet($definition); + } + + /** + * Gets the definition from arguments. + * + * @param array $arguments + * + * @return array + */ + private function getDefinitionsFromArguments(array $arguments) + { + $definitions = array(); + foreach ($arguments as $argument) { + if (is_array($argument)) { + $definitions = array_merge($definitions, $this->getDefinitionsFromArguments($argument)); + } elseif ($argument instanceof Definition) { + $definitions = array_merge( + $definitions, + $this->getInlinedDefinitions($argument), + array($argument) + ); + } + } + + return $definitions; + } + + /** + * Checks if a service id has a reference. + * + * @param string $id + * @param array $arguments + * @param bool $deep + * @param array $visited + * + * @return bool + */ + private function hasReference($id, array $arguments, $deep = false, $visited = array()) + { + foreach ($arguments as $argument) { + if (is_array($argument)) { + if ($this->hasReference($id, $argument, $deep, $visited)) { + return true; + } + } elseif ($argument instanceof Reference) { + if ($id === (string) $argument) { + return true; + } + + if ($deep && !isset($visited[(string) $argument])) { + $visited[(string) $argument] = true; + + $service = $this->container->getDefinition((string) $argument); + $arguments = array_merge($service->getMethodCalls(), $service->getArguments(), $service->getProperties()); + + if ($this->hasReference($id, $arguments, $deep, $visited)) { + return true; + } + } + } + } + + return false; + } + + /** + * Dumps values. + * + * @param array $value + * @param bool $interpolate + * + * @return string + * + * @throws RuntimeException + */ + private function dumpValue($value, $interpolate = true) + { + if (is_array($value)) { + $code = array(); + foreach ($value as $k => $v) { + $code[] = sprintf('%s => %s', $this->dumpValue($k, $interpolate), $this->dumpValue($v, $interpolate)); + } + + return sprintf('array(%s)', implode(', ', $code)); + } elseif ($value instanceof Definition) { + if (null !== $this->definitionVariables && $this->definitionVariables->contains($value)) { + return $this->dumpValue($this->definitionVariables->offsetGet($value), $interpolate); + } + if (count($value->getMethodCalls()) > 0) { + throw new RuntimeException('Cannot dump definitions which have method calls.'); + } + if (null !== $value->getConfigurator()) { + throw new RuntimeException('Cannot dump definitions which have a configurator.'); + } + + $arguments = array(); + foreach ($value->getArguments() as $argument) { + $arguments[] = $this->dumpValue($argument); + } + $class = $this->dumpValue($value->getClass()); + + if (false !== strpos($class, '$')) { + throw new RuntimeException('Cannot dump definitions which have a variable class name.'); + } + + if (null !== $value->getFactoryMethod()) { + if (null !== $value->getFactoryClass()) { + return sprintf("call_user_func(array(%s, '%s')%s)", $this->dumpValue($value->getFactoryClass()), $value->getFactoryMethod(), count($arguments) > 0 ? ', '.implode(', ', $arguments) : ''); + } elseif (null !== $value->getFactoryService()) { + return sprintf("%s->%s(%s)", $this->getServiceCall($value->getFactoryService()), $value->getFactoryMethod(), implode(', ', $arguments)); + } else { + throw new RuntimeException('Cannot dump definitions which have factory method without factory service or factory class.'); + } + } + + return sprintf("new \\%s(%s)", substr(str_replace('\\\\', '\\', $class), 1, -1), implode(', ', $arguments)); + } elseif ($value instanceof Variable) { + return '$'.$value; + } elseif ($value instanceof Reference) { + if (null !== $this->referenceVariables && isset($this->referenceVariables[$id = (string) $value])) { + return $this->dumpValue($this->referenceVariables[$id], $interpolate); + } + + return $this->getServiceCall((string) $value, $value); + } elseif ($value instanceof Parameter) { + return $this->dumpParameter($value); + } elseif (true === $interpolate && is_string($value)) { + if (preg_match('/^%([^%]+)%$/', $value, $match)) { + // we do this to deal with non string values (Boolean, integer, ...) + // the preg_replace_callback converts them to strings + return $this->dumpParameter(strtolower($match[1])); + } else { + $that = $this; + $replaceParameters = function ($match) use ($that) { + return "'.".$that->dumpParameter(strtolower($match[2])).".'"; + }; + + $code = str_replace('%%', '%', preg_replace_callback('/(?container->isFrozen() && $this->container->hasParameter($name)) { + return $this->dumpValue($this->container->getParameter($name), false); + } + + return sprintf("\$this->getParameter('%s')", strtolower($name)); + } + + /** + * Gets a service call + * + * @param string $id + * @param Reference $reference + * + * @return string + */ + private function getServiceCall($id, Reference $reference = null) + { + if ('service_container' === $id) { + return '$this'; + } + + if (null !== $reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) { + return sprintf('$this->get(\'%s\', ContainerInterface::NULL_ON_INVALID_REFERENCE)', $id); + } else { + if ($this->container->hasAlias($id)) { + $id = (string) $this->container->getAlias($id); + } + + return sprintf('$this->get(\'%s\')', $id); + } + } + + /** + * Convert a service id to a valid PHP method name. + * + * @param string $id + * + * @return string + * + * @throws InvalidArgumentException + */ + private function camelize($id) + { + $name = Container::camelize($id); + + if (!preg_match('/^[a-zA-Z0-9_\x7f-\xff]+$/', $name)) { + throw new InvalidArgumentException(sprintf('Service id "%s" cannot be converted to a valid PHP method name.', $id)); + } + + return $name; + } + + /** + * Returns the next name to use + * + * @return string + */ + private function getNextVariableName() + { + $firstChars = self::FIRST_CHARS; + $firstCharsLength = strlen($firstChars); + $nonFirstChars = self::NON_FIRST_CHARS; + $nonFirstCharsLength = strlen($nonFirstChars); + + while (true) { + $name = ''; + $i = $this->variableCount; + + if ('' === $name) { + $name .= $firstChars[$i%$firstCharsLength]; + $i = intval($i/$firstCharsLength); + } + + while ($i > 0) { + $i -= 1; + $name .= $nonFirstChars[$i%$nonFirstCharsLength]; + $i = intval($i/$nonFirstCharsLength); + } + + $this->variableCount += 1; + + // check that the name is not reserved + if (in_array($name, $this->reservedVariables, true)) { + continue; + } + + return $name; + } + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php new file mode 100644 index 0000000..6cdc68f --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php @@ -0,0 +1,325 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Dumper; + +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Parameter; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Alias; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; + +/** + * XmlDumper dumps a service container as an XML string. + * + * @author Fabien Potencier + * @author Martin Hasoň + * + * @api + */ +class XmlDumper extends Dumper +{ + /** + * @var \DOMDocument + */ + private $document; + + /** + * Dumps the service container as an XML string. + * + * @param array $options An array of options + * + * @return string An xml string representing of the service container + * + * @api + */ + public function dump(array $options = array()) + { + $this->document = new \DOMDocument('1.0', 'utf-8'); + $this->document->formatOutput = true; + + $container = $this->document->createElementNS('http://symfony.com/schema/dic/services', 'container'); + $container->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); + $container->setAttribute('xsi:schemaLocation', 'http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd'); + + $this->addParameters($container); + $this->addServices($container); + + $this->document->appendChild($container); + $xml = $this->document->saveXML(); + $this->document = null; + + return $xml; + } + + /** + * Adds parameters. + * + * @param \DOMElement $parent + */ + private function addParameters(\DOMElement $parent) + { + $data = $this->container->getParameterBag()->all(); + if (!$data) { + return; + } + + if ($this->container->isFrozen()) { + $data = $this->escape($data); + } + + $parameters = $this->document->createElement('parameters'); + $parent->appendChild($parameters); + $this->convertParameters($data, 'parameter', $parameters); + } + + /** + * Adds method calls. + * + * @param array $methodcalls + * @param \DOMElement $parent + */ + private function addMethodCalls(array $methodcalls, \DOMElement $parent) + { + foreach ($methodcalls as $methodcall) { + $call = $this->document->createElement('call'); + $call->setAttribute('method', $methodcall[0]); + if (count($methodcall[1])) { + $this->convertParameters($methodcall[1], 'argument', $call); + } + $parent->appendChild($call); + } + } + + /** + * Adds a service. + * + * @param Definition $definition + * @param string $id + * @param \DOMElement $parent + */ + private function addService($definition, $id, \DOMElement $parent) + { + $service = $this->document->createElement('service'); + if (null !== $id) { + $service->setAttribute('id', $id); + } + if ($definition->getClass()) { + $service->setAttribute('class', $definition->getClass()); + } + if ($definition->getFactoryMethod()) { + $service->setAttribute('factory-method', $definition->getFactoryMethod()); + } + if ($definition->getFactoryClass()) { + $service->setAttribute('factory-class', $definition->getFactoryClass()); + } + if ($definition->getFactoryService()) { + $service->setAttribute('factory-service', $definition->getFactoryService()); + } + if (ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope()) { + $service->setAttribute('scope', $scope); + } + if (!$definition->isPublic()) { + $service->setAttribute('public', 'false'); + } + if ($definition->isSynthetic()) { + $service->setAttribute('synthetic', 'true'); + } + if ($definition->isSynchronized()) { + $service->setAttribute('synchronized', 'true'); + } + if ($definition->isLazy()) { + $service->setAttribute('lazy', 'true'); + } + + foreach ($definition->getTags() as $name => $tags) { + foreach ($tags as $attributes) { + $tag = $this->document->createElement('tag'); + $tag->setAttribute('name', $name); + foreach ($attributes as $key => $value) { + $tag->setAttribute($key, $value); + } + $service->appendChild($tag); + } + } + + if ($definition->getFile()) { + $file = $this->document->createElement('file'); + $file->appendChild($this->document->createTextNode($definition->getFile())); + $service->appendChild($file); + } + + if ($parameters = $definition->getArguments()) { + $this->convertParameters($parameters, 'argument', $service); + } + + if ($parameters = $definition->getProperties()) { + $this->convertParameters($parameters, 'property', $service, 'name'); + } + + $this->addMethodCalls($definition->getMethodCalls(), $service); + + if ($callable = $definition->getConfigurator()) { + $configurator = $this->document->createElement('configurator'); + if (is_array($callable)) { + $configurator->setAttribute($callable[0] instanceof Reference ? 'service' : 'class', $callable[0]); + $configurator->setAttribute('method', $callable[1]); + } else { + $configurator->setAttribute('function', $callable); + } + $service->appendChild($configurator); + } + + $parent->appendChild($service); + } + + /** + * Adds a service alias. + * + * @param string $alias + * @param Alias $id + * @param \DOMElement $parent + */ + private function addServiceAlias($alias, Alias $id, \DOMElement $parent) + { + $service = $this->document->createElement('service'); + $service->setAttribute('id', $alias); + $service->setAttribute('alias', $id); + if (!$id->isPublic()) { + $service->setAttribute('public', 'false'); + } + $parent->appendChild($service); + } + + /** + * Adds services. + * + * @param \DOMElement $parent + */ + private function addServices(\DOMElement $parent) + { + $definitions = $this->container->getDefinitions(); + if (!$definitions) { + return; + } + + $services = $this->document->createElement('services'); + foreach ($definitions as $id => $definition) { + $this->addService($definition, $id, $services); + } + + $aliases = $this->container->getAliases(); + foreach ($aliases as $alias => $id) { + while (isset($aliases[(string) $id])) { + $id = $aliases[(string) $id]; + } + $this->addServiceAlias($alias, $id, $services); + } + $parent->appendChild($services); + } + + /** + * Converts parameters. + * + * @param array $parameters + * @param string $type + * @param \DOMElement $parent + * @param string $keyAttribute + */ + private function convertParameters($parameters, $type, \DOMElement $parent, $keyAttribute = 'key') + { + $withKeys = array_keys($parameters) !== range(0, count($parameters) - 1); + foreach ($parameters as $key => $value) { + $element = $this->document->createElement($type); + if ($withKeys) { + $element->setAttribute($keyAttribute, $key); + } + + if (is_array($value)) { + $element->setAttribute('type', 'collection'); + $this->convertParameters($value, $type, $element, 'key'); + } elseif ($value instanceof Reference) { + $element->setAttribute('type', 'service'); + $element->setAttribute('id', (string) $value); + $behaviour = $value->getInvalidBehavior(); + if ($behaviour == ContainerInterface::NULL_ON_INVALID_REFERENCE) { + $element->setAttribute('on-invalid', 'null'); + } elseif ($behaviour == ContainerInterface::IGNORE_ON_INVALID_REFERENCE) { + $element->setAttribute('on-invalid', 'ignore'); + } + if (!$value->isStrict()) { + $element->setAttribute('strict', 'false'); + } + } elseif ($value instanceof Definition) { + $element->setAttribute('type', 'service'); + $this->addService($value, null, $element); + } else { + if (in_array($value, array('null', 'true', 'false'), true)) { + $element->setAttribute('type', 'string'); + } + $text = $this->document->createTextNode(self::phpToXml($value)); + $element->appendChild($text); + } + $parent->appendChild($element); + } + } + + /** + * Escapes arguments + * + * @param array $arguments + * + * @return array + */ + private function escape($arguments) + { + $args = array(); + foreach ($arguments as $k => $v) { + if (is_array($v)) { + $args[$k] = $this->escape($v); + } elseif (is_string($v)) { + $args[$k] = str_replace('%', '%%', $v); + } else { + $args[$k] = $v; + } + } + + return $args; + } + + /** + * Converts php types to xml types. + * + * @param mixed $value Value to convert + * + * @return string + * + * @throws RuntimeException When trying to dump object or resource + */ + public static function phpToXml($value) + { + switch (true) { + case null === $value: + return 'null'; + case true === $value: + return 'true'; + case false === $value: + return 'false'; + case $value instanceof Parameter: + return '%'.$value.'%'; + case is_object($value) || is_resource($value): + throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.'); + default: + return (string) $value; + } + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php new file mode 100644 index 0000000..03f418e --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php @@ -0,0 +1,320 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Dumper; + +use Symfony\Component\Yaml\Dumper as YmlDumper; +use Symfony\Component\DependencyInjection\Alias; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Parameter; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * YamlDumper dumps a service container as a YAML string. + * + * @author Fabien Potencier + * + * @api + */ +class YamlDumper extends Dumper +{ + private $dumper; + + /** + * Constructor. + * + * @param ContainerBuilder $container The service container to dump + * + * @api + */ + public function __construct(ContainerBuilder $container) + { + parent::__construct($container); + + $this->dumper = new YmlDumper(); + } + + /** + * Dumps the service container as an YAML string. + * + * @param array $options An array of options + * + * @return string A YAML string representing of the service container + * + * @api + */ + public function dump(array $options = array()) + { + return $this->addParameters()."\n".$this->addServices(); + } + + /** + * Adds a service + * + * @param string $id + * @param Definition $definition + * + * @return string + */ + private function addService($id, $definition) + { + $code = " $id:\n"; + if ($definition->getClass()) { + $code .= sprintf(" class: %s\n", $definition->getClass()); + } + + if (!$definition->isPublic()) { + $code .= " public: false\n"; + } + + $tagsCode = ''; + foreach ($definition->getTags() as $name => $tags) { + foreach ($tags as $attributes) { + $att = array(); + foreach ($attributes as $key => $value) { + $att[] = sprintf('%s: %s', $this->dumper->dump($key), $this->dumper->dump($value)); + } + $att = $att ? ', '.implode(' ', $att) : ''; + + $tagsCode .= sprintf(" - { name: %s%s }\n", $this->dumper->dump($name), $att); + } + } + if ($tagsCode) { + $code .= " tags:\n".$tagsCode; + } + + if ($definition->getFile()) { + $code .= sprintf(" file: %s\n", $definition->getFile()); + } + + if ($definition->isSynthetic()) { + $code .= sprintf(" synthetic: true\n"); + } + + if ($definition->isSynchronized()) { + $code .= sprintf(" synchronized: true\n"); + } + + if ($definition->getFactoryClass()) { + $code .= sprintf(" factory_class: %s\n", $definition->getFactoryClass()); + } + + if ($definition->isLazy()) { + $code .= sprintf(" lazy: true\n"); + } + + if ($definition->getFactoryMethod()) { + $code .= sprintf(" factory_method: %s\n", $definition->getFactoryMethod()); + } + + if ($definition->getFactoryService()) { + $code .= sprintf(" factory_service: %s\n", $definition->getFactoryService()); + } + + if ($definition->getArguments()) { + $code .= sprintf(" arguments: %s\n", $this->dumper->dump($this->dumpValue($definition->getArguments()), 0)); + } + + if ($definition->getProperties()) { + $code .= sprintf(" properties: %s\n", $this->dumper->dump($this->dumpValue($definition->getProperties()), 0)); + } + + if ($definition->getMethodCalls()) { + $code .= sprintf(" calls:\n%s\n", $this->dumper->dump($this->dumpValue($definition->getMethodCalls()), 1, 12)); + } + + if (ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope()) { + $code .= sprintf(" scope: %s\n", $scope); + } + + if ($callable = $definition->getConfigurator()) { + if (is_array($callable)) { + if ($callable[0] instanceof Reference) { + $callable = array($this->getServiceCall((string) $callable[0], $callable[0]), $callable[1]); + } else { + $callable = array($callable[0], $callable[1]); + } + } + + $code .= sprintf(" configurator: %s\n", $this->dumper->dump($callable, 0)); + } + + return $code; + } + + /** + * Adds a service alias + * + * @param string $alias + * @param Alias $id + * + * @return string + */ + private function addServiceAlias($alias, $id) + { + if ($id->isPublic()) { + return sprintf(" %s: @%s\n", $alias, $id); + } else { + return sprintf(" %s:\n alias: %s\n public: false", $alias, $id); + } + } + + /** + * Adds services + * + * @return string + */ + private function addServices() + { + if (!$this->container->getDefinitions()) { + return ''; + } + + $code = "services:\n"; + foreach ($this->container->getDefinitions() as $id => $definition) { + $code .= $this->addService($id, $definition); + } + + $aliases = $this->container->getAliases(); + foreach ($aliases as $alias => $id) { + while (isset($aliases[(string) $id])) { + $id = $aliases[(string) $id]; + } + $code .= $this->addServiceAlias($alias, $id); + } + + return $code; + } + + /** + * Adds parameters + * + * @return string + */ + private function addParameters() + { + if (!$this->container->getParameterBag()->all()) { + return ''; + } + + $parameters = $this->prepareParameters($this->container->getParameterBag()->all(), $this->container->isFrozen()); + + return $this->dumper->dump(array('parameters' => $parameters), 2); + } + + /** + * Dumps the value to YAML format + * + * @param mixed $value + * + * @return mixed + * + * @throws RuntimeException When trying to dump object or resource + */ + private function dumpValue($value) + { + if (is_array($value)) { + $code = array(); + foreach ($value as $k => $v) { + $code[$k] = $this->dumpValue($v); + } + + return $code; + } elseif ($value instanceof Reference) { + return $this->getServiceCall((string) $value, $value); + } elseif ($value instanceof Parameter) { + return $this->getParameterCall((string) $value); + } elseif (is_object($value) || is_resource($value)) { + throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.'); + } + + return $value; + } + + /** + * Gets the service call. + * + * @param string $id + * @param Reference $reference + * + * @return string + */ + private function getServiceCall($id, Reference $reference = null) + { + if (null !== $reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) { + return sprintf('@?%s', $id); + } + + return sprintf('@%s', $id); + } + + /** + * Gets parameter call. + * + * @param string $id + * + * @return string + */ + private function getParameterCall($id) + { + return sprintf('%%%s%%', $id); + } + + /** + * Prepares parameters. + * + * @param array $parameters + * @param bool $escape + * + * @return array + */ + private function prepareParameters($parameters, $escape = true) + { + $filtered = array(); + foreach ($parameters as $key => $value) { + if (is_array($value)) { + $value = $this->prepareParameters($value, $escape); + } elseif ($value instanceof Reference || is_string($value) && 0 === strpos($value, '@')) { + $value = '@'.$value; + } + + $filtered[$key] = $value; + } + + return $escape ? $this->escape($filtered) : $filtered; + } + + /** + * Escapes arguments + * + * @param array $arguments + * + * @return array + */ + private function escape($arguments) + { + $args = array(); + foreach ($arguments as $k => $v) { + if (is_array($v)) { + $args[$k] = $this->escape($v); + } elseif (is_string($v)) { + $args[$k] = str_replace('%', '%%', $v); + } else { + $args[$k] = $v; + } + } + + return $args; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php new file mode 100644 index 0000000..959238e --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * Base BadMethodCallException for Dependency Injection component. + */ +class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php new file mode 100644 index 0000000..f5e9099 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * Base ExceptionInterface for Dependency Injection component. + * + * @author Fabien Potencier + * @author Bulat Shakirzyanov + */ +interface ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php new file mode 100644 index 0000000..6b3dd3e --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * This exception is thrown when you try to create a service of an inactive scope. + * + * @author Johannes M. Schmitt + */ +class InactiveScopeException extends RuntimeException +{ + private $serviceId; + private $scope; + + public function __construct($serviceId, $scope, \Exception $previous = null) + { + parent::__construct(sprintf('You cannot create a service ("%s") of an inactive scope ("%s").', $serviceId, $scope), 0, $previous); + + $this->serviceId = $serviceId; + $this->scope = $scope; + } + + public function getServiceId() + { + return $this->serviceId; + } + + public function getScope() + { + return $this->scope; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php new file mode 100644 index 0000000..119bb7d --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * Base InvalidArgumentException for Dependency Injection component. + * + * @author Bulat Shakirzyanov + */ +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/LogicException.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/LogicException.php new file mode 100644 index 0000000..17a070c --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/LogicException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * Base LogicException for Dependency Injection component. + */ +class LogicException extends \LogicException implements ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php new file mode 100644 index 0000000..a61f143 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * Base OutOfBoundsException for Dependency Injection component. + */ +class OutOfBoundsException extends \OutOfBoundsException implements ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php new file mode 100644 index 0000000..2915176 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * This exception is thrown when a circular reference in a parameter is detected. + * + * @author Fabien Potencier + */ +class ParameterCircularReferenceException extends RuntimeException +{ + private $parameters; + + public function __construct($parameters, \Exception $previous = null) + { + parent::__construct(sprintf('Circular reference detected for parameter "%s" ("%s" > "%s").', $parameters[0], implode('" > "', $parameters), $parameters[0]), 0, $previous); + + $this->parameters = $parameters; + } + + public function getParameters() + { + return $this->parameters; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php new file mode 100644 index 0000000..b529f0f --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php @@ -0,0 +1,95 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * This exception is thrown when a non-existent parameter is used. + * + * @author Fabien Potencier + */ +class ParameterNotFoundException extends InvalidArgumentException +{ + private $key; + private $sourceId; + private $sourceKey; + private $alternatives; + + /** + * Constructor. + * + * @param string $key The requested parameter key + * @param string $sourceId The service id that references the non-existent parameter + * @param string $sourceKey The parameter key that references the non-existent parameter + * @param \Exception $previous The previous exception + * @param string[] $alternatives Some parameter name alternatives + */ + public function __construct($key, $sourceId = null, $sourceKey = null, \Exception $previous = null, array $alternatives = array()) + { + $this->key = $key; + $this->sourceId = $sourceId; + $this->sourceKey = $sourceKey; + $this->alternatives = $alternatives; + + parent::__construct('', 0, $previous); + + $this->updateRepr(); + } + + public function updateRepr() + { + if (null !== $this->sourceId) { + $this->message = sprintf('The service "%s" has a dependency on a non-existent parameter "%s".', $this->sourceId, $this->key); + } elseif (null !== $this->sourceKey) { + $this->message = sprintf('The parameter "%s" has a dependency on a non-existent parameter "%s".', $this->sourceKey, $this->key); + } else { + $this->message = sprintf('You have requested a non-existent parameter "%s".', $this->key); + } + + if ($this->alternatives) { + if (1 == count($this->alternatives)) { + $this->message .= ' Did you mean this: "'; + } else { + $this->message .= ' Did you mean one of these: "'; + } + $this->message .= implode('", "', $this->alternatives).'"?'; + } + } + + public function getKey() + { + return $this->key; + } + + public function getSourceId() + { + return $this->sourceId; + } + + public function getSourceKey() + { + return $this->sourceKey; + } + + public function setSourceId($sourceId) + { + $this->sourceId = $sourceId; + + $this->updateRepr(); + } + + public function setSourceKey($sourceKey) + { + $this->sourceKey = $sourceKey; + + $this->updateRepr(); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/RuntimeException.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/RuntimeException.php new file mode 100644 index 0000000..5c24541 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/RuntimeException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * Base RuntimeException for Dependency Injection component. + * + * @author Johannes M. Schmitt + */ +class RuntimeException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php new file mode 100644 index 0000000..661fbab --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * This exception is thrown when the a scope crossing injection is detected. + * + * @author Johannes M. Schmitt + */ +class ScopeCrossingInjectionException extends RuntimeException +{ + private $sourceServiceId; + private $sourceScope; + private $destServiceId; + private $destScope; + + public function __construct($sourceServiceId, $sourceScope, $destServiceId, $destScope, \Exception $previous = null) + { + parent::__construct(sprintf( + 'Scope Crossing Injection detected: The definition "%s" references the service "%s" which belongs to another scope hierarchy. ' + .'This service might not be available consistently. Generally, it is safer to either move the definition "%s" to scope "%s", or ' + .'declare "%s" as a child scope of "%s". If you can be sure that the other scope is always active, you can set the reference to strict=false to get rid of this error.', + $sourceServiceId, + $destServiceId, + $sourceServiceId, + $destScope, + $sourceScope, + $destScope + ), 0, $previous); + + $this->sourceServiceId = $sourceServiceId; + $this->sourceScope = $sourceScope; + $this->destServiceId = $destServiceId; + $this->destScope = $destScope; + } + + public function getSourceServiceId() + { + return $this->sourceServiceId; + } + + public function getSourceScope() + { + return $this->sourceScope; + } + + public function getDestServiceId() + { + return $this->destServiceId; + } + + public function getDestScope() + { + return $this->destScope; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php new file mode 100644 index 0000000..86a6684 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * Thrown when a scope widening injection is detected. + * + * @author Johannes M. Schmitt + */ +class ScopeWideningInjectionException extends RuntimeException +{ + private $sourceServiceId; + private $sourceScope; + private $destServiceId; + private $destScope; + + public function __construct($sourceServiceId, $sourceScope, $destServiceId, $destScope, \Exception $previous = null) + { + parent::__construct(sprintf( + 'Scope Widening Injection detected: The definition "%s" references the service "%s" which belongs to a narrower scope. ' + .'Generally, it is safer to either move "%s" to scope "%s" or alternatively rely on the provider pattern by injecting the container itself, and requesting the service "%s" each time it is needed. ' + .'In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.', + $sourceServiceId, + $destServiceId, + $sourceServiceId, + $destScope, + $destServiceId + ), 0, $previous); + + $this->sourceServiceId = $sourceServiceId; + $this->sourceScope = $sourceScope; + $this->destServiceId = $destServiceId; + $this->destScope = $destScope; + } + + public function getSourceServiceId() + { + return $this->sourceServiceId; + } + + public function getSourceScope() + { + return $this->sourceScope; + } + + public function getDestServiceId() + { + return $this->destServiceId; + } + + public function getDestScope() + { + return $this->destScope; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php new file mode 100644 index 0000000..26e3fb3 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * This exception is thrown when a circular reference is detected. + * + * @author Johannes M. Schmitt + */ +class ServiceCircularReferenceException extends RuntimeException +{ + private $serviceId; + private $path; + + public function __construct($serviceId, array $path, \Exception $previous = null) + { + parent::__construct(sprintf('Circular reference detected for service "%s", path: "%s".', $serviceId, implode(' -> ', $path)), 0, $previous); + + $this->serviceId = $serviceId; + $this->path = $path; + } + + public function getServiceId() + { + return $this->serviceId; + } + + public function getPath() + { + return $this->path; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php new file mode 100644 index 0000000..e65da50 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * This exception is thrown when a non-existent service is requested. + * + * @author Johannes M. Schmitt + */ +class ServiceNotFoundException extends InvalidArgumentException +{ + private $id; + private $sourceId; + + public function __construct($id, $sourceId = null, \Exception $previous = null, array $alternatives = array()) + { + if (null === $sourceId) { + $msg = sprintf('You have requested a non-existent service "%s".', $id); + } else { + $msg = sprintf('The service "%s" has a dependency on a non-existent service "%s".', $sourceId, $id); + } + + if ($alternatives) { + if (1 == count($alternatives)) { + $msg .= ' Did you mean this: "'; + } else { + $msg .= ' Did you mean one of these: "'; + } + $msg .= implode('", "', $alternatives).'"?'; + } + + parent::__construct($msg, 0, $previous); + + $this->id = $id; + $this->sourceId = $sourceId; + } + + public function getId() + { + return $this->id; + } + + public function getSourceId() + { + return $this->sourceId; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php new file mode 100644 index 0000000..51bff08 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Extension; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\Config\Definition\ConfigurationInterface; + +/** + * ConfigurationExtensionInterface is the interface implemented by container extension classes. + * + * @author Kevin Bond + */ +interface ConfigurationExtensionInterface +{ + /** + * Returns extension configuration + * + * @param array $config An array of configuration values + * @param ContainerBuilder $container A ContainerBuilder instance + * + * @return ConfigurationInterface|null The configuration or null + */ + public function getConfiguration(array $config, ContainerBuilder $container); +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/Extension.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/Extension.php new file mode 100644 index 0000000..0ebe4e4 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/Extension.php @@ -0,0 +1,124 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Extension; + +use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\DependencyInjection\Exception\BadMethodCallException; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\Config\Definition\Processor; +use Symfony\Component\Config\Definition\ConfigurationInterface; + +/** + * Provides useful features shared by many extensions. + * + * @author Fabien Potencier + */ +abstract class Extension implements ExtensionInterface, ConfigurationExtensionInterface +{ + /** + * Returns the base path for the XSD files. + * + * @return string The XSD base path + */ + public function getXsdValidationBasePath() + { + return false; + } + + /** + * Returns the namespace to be used for this extension (XML namespace). + * + * @return string The XML namespace + */ + public function getNamespace() + { + return 'http://example.org/schema/dic/'.$this->getAlias(); + } + + /** + * Returns the recommended alias to use in XML. + * + * This alias is also the mandatory prefix to use when using YAML. + * + * This convention is to remove the "Extension" postfix from the class + * name and then lowercase and underscore the result. So: + * + * AcmeHelloExtension + * + * becomes + * + * acme_hello + * + * This can be overridden in a sub-class to specify the alias manually. + * + * @return string The alias + * + * @throws BadMethodCallException When the extension name does not follow conventions + */ + public function getAlias() + { + $className = get_class($this); + if (substr($className, -9) != 'Extension') { + throw new BadMethodCallException('This extension does not follow the naming convention; you must overwrite the getAlias() method.'); + } + $classBaseName = substr(strrchr($className, '\\'), 1, -9); + + return Container::underscore($classBaseName); + } + + /** + * {@inheritdoc} + */ + public function getConfiguration(array $config, ContainerBuilder $container) + { + $reflected = new \ReflectionClass($this); + $namespace = $reflected->getNamespaceName(); + + $class = $namespace.'\\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; + } + } + } + + final protected function processConfiguration(ConfigurationInterface $configuration, array $configs) + { + $processor = new Processor(); + + return $processor->processConfiguration($configuration, $configs); + } + + /** + * @param ContainerBuilder $container + * @param array $config + * + * @return bool Whether the configuration is enabled + * + * @throws InvalidArgumentException When the config is not enableable + */ + protected function isConfigEnabled(ContainerBuilder $container, array $config) + { + if (!array_key_exists('enabled', $config)) { + throw new InvalidArgumentException("The config array has no 'enabled' key."); + } + + return (bool) $container->getParameterBag()->resolveValue($config['enabled']); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php new file mode 100644 index 0000000..424f020 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Extension; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * ExtensionInterface is the interface implemented by container extension classes. + * + * @author Fabien Potencier + * + * @api + */ +interface ExtensionInterface +{ + /** + * 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 + * + * @api + */ + public function load(array $config, ContainerBuilder $container); + + /** + * Returns the namespace to be used for this extension (XML namespace). + * + * @return string The XML namespace + * + * @api + */ + public function getNamespace(); + + /** + * Returns the base path for the XSD files. + * + * @return string The XSD base path + * + * @api + */ + public function getXsdValidationBasePath(); + + /** + * Returns the recommended alias to use in XML. + * + * This alias is also the mandatory prefix to use when using YAML. + * + * @return string The alias + * + * @api + */ + public function getAlias(); +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/PrependExtensionInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/PrependExtensionInterface.php new file mode 100644 index 0000000..c666bdb --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/PrependExtensionInterface.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Extension; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +interface PrependExtensionInterface +{ + /** + * Allow an extension to prepend the extension configurations. + * + * @param ContainerBuilder $container + */ + public function prepend(ContainerBuilder $container); +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php new file mode 100644 index 0000000..f0853fe --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * IntrospectableContainerInterface defines additional introspection functionality + * for containers, allowing logic to be implemented based on a Container's state. + * + * @author Evan Villemez + * + */ +interface IntrospectableContainerInterface extends ContainerInterface +{ + /** + * Check for whether or not a service has been initialized. + * + * @param string $id + * + * @return bool true if the service has been initialized, false otherwise + * + */ + public function initialized($id); +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LICENSE b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LICENSE new file mode 100644 index 0000000..0b3292c --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2014 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/InstantiatorInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/InstantiatorInterface.php new file mode 100644 index 0000000..a8dd525 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/InstantiatorInterface.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\LazyProxy\Instantiator; + +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Definition; + +/** + * Lazy proxy instantiator, capable of instantiating a proxy given a container, the + * service definitions and a callback that produces the real service instance. + * + * @author Marco Pivetta + */ +interface InstantiatorInterface +{ + /** + * Instantiates a proxy object. + * + * @param ContainerInterface $container the container from which the service is being requested + * @param Definition $definition the definition of the requested service + * @param string $id identifier of the requested service + * @param callable $realInstantiator zero-argument callback that is capable of producing the real + * service instance + * + * @return object + */ + public function instantiateProxy(ContainerInterface $container, Definition $definition, $id, $realInstantiator); +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/RealServiceInstantiator.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/RealServiceInstantiator.php new file mode 100644 index 0000000..cad9320 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/RealServiceInstantiator.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\LazyProxy\Instantiator; + +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Definition; + +/** + * {@inheritdoc} + * + * Noop proxy instantiator - simply produces the real service instead of a proxy instance. + * + * @author Marco Pivetta + */ +class RealServiceInstantiator implements InstantiatorInterface +{ + /** + * {@inheritdoc} + */ + public function instantiateProxy(ContainerInterface $container, Definition $definition, $id, $realInstantiator) + { + return call_user_func($realInstantiator); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php new file mode 100644 index 0000000..878d965 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\LazyProxy\PhpDumper; + +use Symfony\Component\DependencyInjection\Definition; + +/** + * Lazy proxy dumper capable of generating the instantiation logic PHP code for proxied services. + * + * @author Marco Pivetta + */ +interface DumperInterface +{ + /** + * Inspects whether the given definitions should produce proxy instantiation logic in the dumped container. + * + * @param Definition $definition + * + * @return bool + */ + public function isProxyCandidate(Definition $definition); + + /** + * Generates the code to be used to instantiate a proxy in the dumped factory code. + * + * @param Definition $definition + * @param string $id service identifier + * + * @return string + */ + public function getProxyFactoryCode(Definition $definition, $id); + + /** + * Generates the code for the lazy proxy. + * + * @param Definition $definition + * + * @return string + */ + public function getProxyCode(Definition $definition); +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/NullDumper.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/NullDumper.php new file mode 100644 index 0000000..30911d3 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/NullDumper.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\LazyProxy\PhpDumper; + +use Symfony\Component\DependencyInjection\Definition; + +/** + * Null dumper, negates any proxy code generation for any given service definition. + * + * @author Marco Pivetta + */ +class NullDumper implements DumperInterface +{ + /** + * {@inheritdoc} + */ + public function isProxyCandidate(Definition $definition) + { + return false; + } + + /** + * {@inheritdoc} + */ + public function getProxyFactoryCode(Definition $definition, $id) + { + return ''; + } + + /** + * {@inheritdoc} + */ + public function getProxyCode(Definition $definition) + { + return ''; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php new file mode 100644 index 0000000..30cbe0e --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\Config\Loader\Loader; + +/** + * ClosureLoader loads service definitions from a PHP closure. + * + * The Closure has access to the container as its first argument. + * + * @author Fabien Potencier + */ +class ClosureLoader extends Loader +{ + private $container; + + /** + * Constructor. + * + * @param ContainerBuilder $container A ContainerBuilder instance + */ + public function __construct(ContainerBuilder $container) + { + $this->container = $container; + } + + /** + * Loads a Closure. + * + * @param \Closure $closure The resource + * @param string $type The resource type + */ + public function load($closure, $type = null) + { + call_user_func($closure, $this->container); + } + + /** + * Returns true if this class supports the given resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return bool true if this class supports the given resource, false otherwise + */ + public function supports($resource, $type = null) + { + return $resource instanceof \Closure; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/FileLoader.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/FileLoader.php new file mode 100644 index 0000000..ad437b5 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/FileLoader.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\Config\Loader\FileLoader as BaseFileLoader; +use Symfony\Component\Config\FileLocatorInterface; + +/** + * FileLoader is the abstract class used by all built-in loaders that are file based. + * + * @author Fabien Potencier + */ +abstract class FileLoader extends BaseFileLoader +{ + protected $container; + + /** + * Constructor. + * + * @param ContainerBuilder $container A ContainerBuilder instance + * @param FileLocatorInterface $locator A FileLocator instance + */ + public function __construct(ContainerBuilder $container, FileLocatorInterface $locator) + { + $this->container = $container; + + parent::__construct($locator); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php new file mode 100644 index 0000000..189eaa5 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php @@ -0,0 +1,62 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader; + +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; + +/** + * IniFileLoader loads parameters from INI files. + * + * @author Fabien Potencier + */ +class IniFileLoader extends FileLoader +{ + /** + * Loads a resource. + * + * @param mixed $file The resource + * @param string $type The resource type + * + * @throws InvalidArgumentException When ini file is not valid + */ + public function load($file, $type = null) + { + $path = $this->locator->locate($file); + + $this->container->addResource(new FileResource($path)); + + $result = parse_ini_file($path, true); + if (false === $result || array() === $result) { + throw new InvalidArgumentException(sprintf('The "%s" file is not valid.', $file)); + } + + if (isset($result['parameters']) && is_array($result['parameters'])) { + foreach ($result['parameters'] as $key => $value) { + $this->container->setParameter($key, $value); + } + } + } + + /** + * Returns true if this class supports the given resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return bool true if this class supports the given resource, false otherwise + */ + public function supports($resource, $type = null) + { + return is_string($resource) && 'ini' === pathinfo($resource, PATHINFO_EXTENSION); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php new file mode 100644 index 0000000..f3139ad --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader; + +use Symfony\Component\Config\Resource\FileResource; + +/** + * PhpFileLoader loads service definitions from a PHP file. + * + * The PHP file is required and the $container variable can be + * used within the file to change the container. + * + * @author Fabien Potencier + */ +class PhpFileLoader extends FileLoader +{ + /** + * Loads a PHP file. + * + * @param mixed $file The resource + * @param string $type The resource type + */ + public function load($file, $type = null) + { + // the container and loader variables are exposed to the included file below + $container = $this->container; + $loader = $this; + + $path = $this->locator->locate($file); + $this->setCurrentDir(dirname($path)); + $this->container->addResource(new FileResource($path)); + + include $path; + } + + /** + * Returns true if this class supports the given resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return bool true if this class supports the given resource, false otherwise + */ + public function supports($resource, $type = null) + { + return is_string($resource) && 'php' === pathinfo($resource, PATHINFO_EXTENSION); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php new file mode 100644 index 0000000..4147a40 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -0,0 +1,422 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader; + +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Config\Util\XmlUtils; +use Symfony\Component\DependencyInjection\DefinitionDecorator; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Alias; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\SimpleXMLElement; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; + +/** + * XmlFileLoader loads XML files service definitions. + * + * @author Fabien Potencier + */ +class XmlFileLoader extends FileLoader +{ + /** + * Loads an XML file. + * + * @param mixed $file The resource + * @param string $type The resource type + */ + public function load($file, $type = null) + { + $path = $this->locator->locate($file); + + $xml = $this->parseFile($path); + $xml->registerXPathNamespace('container', 'http://symfony.com/schema/dic/services'); + + $this->container->addResource(new FileResource($path)); + + // anonymous services + $this->processAnonymousServices($xml, $path); + + // imports + $this->parseImports($xml, $path); + + // parameters + $this->parseParameters($xml, $path); + + // extensions + $this->loadFromExtensions($xml); + + // services + $this->parseDefinitions($xml, $path); + } + + /** + * Returns true if this class supports the given resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return bool true if this class supports the given resource, false otherwise + */ + public function supports($resource, $type = null) + { + return is_string($resource) && 'xml' === pathinfo($resource, PATHINFO_EXTENSION); + } + + /** + * Parses parameters + * + * @param SimpleXMLElement $xml + * @param string $file + */ + private function parseParameters(SimpleXMLElement $xml, $file) + { + if (!$xml->parameters) { + return; + } + + $this->container->getParameterBag()->add($xml->parameters->getArgumentsAsPhp('parameter')); + } + + /** + * Parses imports + * + * @param SimpleXMLElement $xml + * @param string $file + */ + private function parseImports(SimpleXMLElement $xml, $file) + { + if (false === $imports = $xml->xpath('//container:imports/container:import')) { + return; + } + + foreach ($imports as $import) { + $this->setCurrentDir(dirname($file)); + $this->import((string) $import['resource'], null, (bool) $import->getAttributeAsPhp('ignore-errors'), $file); + } + } + + /** + * Parses multiple definitions + * + * @param SimpleXMLElement $xml + * @param string $file + */ + private function parseDefinitions(SimpleXMLElement $xml, $file) + { + if (false === $services = $xml->xpath('//container:services/container:service')) { + return; + } + + foreach ($services as $service) { + $this->parseDefinition((string) $service['id'], $service, $file); + } + } + + /** + * Parses an individual Definition + * + * @param string $id + * @param SimpleXMLElement $service + * @param string $file + */ + private function parseDefinition($id, $service, $file) + { + if ((string) $service['alias']) { + $public = true; + if (isset($service['public'])) { + $public = $service->getAttributeAsPhp('public'); + } + $this->container->setAlias($id, new Alias((string) $service['alias'], $public)); + + return; + } + + if (isset($service['parent'])) { + $definition = new DefinitionDecorator((string) $service['parent']); + } else { + $definition = new Definition(); + } + + foreach (array('class', 'scope', 'public', 'factory-class', 'factory-method', 'factory-service', 'synthetic', 'synchronized', 'lazy', 'abstract') as $key) { + if (isset($service[$key])) { + $method = 'set'.str_replace('-', '', $key); + $definition->$method((string) $service->getAttributeAsPhp($key)); + } + } + + if ($service->file) { + $definition->setFile((string) $service->file); + } + + $definition->setArguments($service->getArgumentsAsPhp('argument')); + $definition->setProperties($service->getArgumentsAsPhp('property')); + + if (isset($service->configurator)) { + if (isset($service->configurator['function'])) { + $definition->setConfigurator((string) $service->configurator['function']); + } else { + if (isset($service->configurator['service'])) { + $class = new Reference((string) $service->configurator['service'], ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false); + } else { + $class = (string) $service->configurator['class']; + } + + $definition->setConfigurator(array($class, (string) $service->configurator['method'])); + } + } + + foreach ($service->call as $call) { + $definition->addMethodCall((string) $call['method'], $call->getArgumentsAsPhp('argument')); + } + + foreach ($service->tag as $tag) { + $parameters = array(); + foreach ($tag->attributes() as $name => $value) { + if ('name' === $name) { + continue; + } + + if (false !== strpos($name, '-') && false === strpos($name, '_') && !array_key_exists($normalizedName = str_replace('-', '_', $name), $parameters)) { + $parameters[$normalizedName] = SimpleXMLElement::phpize($value); + } + // keep not normalized key for BC too + $parameters[$name] = SimpleXMLElement::phpize($value); + } + + $definition->addTag((string) $tag['name'], $parameters); + } + + $this->container->setDefinition($id, $definition); + } + + /** + * Parses a XML file. + * + * @param string $file Path to a file + * + * @return SimpleXMLElement + * + * @throws InvalidArgumentException When loading of XML file returns error + */ + protected function parseFile($file) + { + try { + $dom = XmlUtils::loadFile($file, array($this, 'validateSchema')); + } catch (\InvalidArgumentException $e) { + throw new InvalidArgumentException(sprintf('Unable to parse file "%s".', $file), $e->getCode(), $e); + } + + $this->validateExtensions($dom, $file); + + return simplexml_import_dom($dom, 'Symfony\\Component\\DependencyInjection\\SimpleXMLElement'); + } + + /** + * Processes anonymous services + * + * @param SimpleXMLElement $xml + * @param string $file + */ + private function processAnonymousServices(SimpleXMLElement $xml, $file) + { + $definitions = array(); + $count = 0; + + // anonymous services as arguments/properties + if (false !== $nodes = $xml->xpath('//container:argument[@type="service"][not(@id)]|//container:property[@type="service"][not(@id)]')) { + foreach ($nodes as $node) { + // give it a unique name + $node['id'] = sprintf('%s_%d', md5($file), ++$count); + + $definitions[(string) $node['id']] = array($node->service, $file, false); + $node->service['id'] = (string) $node['id']; + } + } + + // anonymous services "in the wild" + if (false !== $nodes = $xml->xpath('//container:services/container:service[not(@id)]')) { + foreach ($nodes as $node) { + // give it a unique name + $node['id'] = sprintf('%s_%d', md5($file), ++$count); + + $definitions[(string) $node['id']] = array($node, $file, true); + $node->service['id'] = (string) $node['id']; + } + } + + // resolve definitions + krsort($definitions); + foreach ($definitions as $id => $def) { + // anonymous services are always private + $def[0]['public'] = false; + + $this->parseDefinition($id, $def[0], $def[1]); + + $oNode = dom_import_simplexml($def[0]); + if (true === $def[2]) { + $nNode = new \DOMElement('_services'); + $oNode->parentNode->replaceChild($nNode, $oNode); + $nNode->setAttribute('id', $id); + } else { + $oNode->parentNode->removeChild($oNode); + } + } + } + + /** + * Validates a documents XML schema. + * + * @param \DOMDocument $dom + * + * @return bool + * + * @throws RuntimeException When extension references a non-existent XSD file + */ + public function validateSchema(\DOMDocument $dom) + { + $schemaLocations = array('http://symfony.com/schema/dic/services' => str_replace('\\', '/', __DIR__.'/schema/dic/services/services-1.0.xsd')); + + if ($element = $dom->documentElement->getAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'schemaLocation')) { + $items = preg_split('/\s+/', $element); + for ($i = 0, $nb = count($items); $i < $nb; $i += 2) { + if (!$this->container->hasExtension($items[$i])) { + continue; + } + + if (($extension = $this->container->getExtension($items[$i])) && false !== $extension->getXsdValidationBasePath()) { + $path = str_replace($extension->getNamespace(), str_replace('\\', '/', $extension->getXsdValidationBasePath()).'/', $items[$i + 1]); + + if (!is_file($path)) { + throw new RuntimeException(sprintf('Extension "%s" references a non-existent XSD file "%s"', get_class($extension), $path)); + } + + $schemaLocations[$items[$i]] = $path; + } + } + } + + $tmpfiles = array(); + $imports = ''; + foreach ($schemaLocations as $namespace => $location) { + $parts = explode('/', $location); + if (0 === stripos($location, 'phar://')) { + $tmpfile = tempnam(sys_get_temp_dir(), 'sf2'); + if ($tmpfile) { + copy($location, $tmpfile); + $tmpfiles[] = $tmpfile; + $parts = explode('/', str_replace('\\', '/', $tmpfile)); + } + } + $drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : ''; + $location = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts)); + + $imports .= sprintf(' '."\n", $namespace, $location); + } + + $source = << + + + +$imports + +EOF + ; + + $valid = @$dom->schemaValidateSource($source); + + foreach ($tmpfiles as $tmpfile) { + @unlink($tmpfile); + } + + return $valid; + } + + /** + * Validates an extension. + * + * @param \DOMDocument $dom + * @param string $file + * + * @throws InvalidArgumentException When no extension is found corresponding to a tag + */ + private function validateExtensions(\DOMDocument $dom, $file) + { + foreach ($dom->documentElement->childNodes as $node) { + if (!$node instanceof \DOMElement || 'http://symfony.com/schema/dic/services' === $node->namespaceURI) { + continue; + } + + // can it be handled by an extension? + if (!$this->container->hasExtension($node->namespaceURI)) { + $extensionNamespaces = array_filter(array_map(function ($ext) { return $ext->getNamespace(); }, $this->container->getExtensions())); + throw new InvalidArgumentException(sprintf( + 'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s', + $node->tagName, + $file, + $node->namespaceURI, + $extensionNamespaces ? sprintf('"%s"', implode('", "', $extensionNamespaces)) : 'none' + )); + } + } + } + + /** + * Loads from an extension. + * + * @param SimpleXMLElement $xml + */ + private function loadFromExtensions(SimpleXMLElement $xml) + { + foreach (dom_import_simplexml($xml)->childNodes as $node) { + if (!$node instanceof \DOMElement || $node->namespaceURI === 'http://symfony.com/schema/dic/services') { + continue; + } + + $values = static::convertDomElementToArray($node); + if (!is_array($values)) { + $values = array(); + } + + $this->container->loadFromExtension($node->namespaceURI, $values); + } + } + + /** + * Converts a \DomElement object to a PHP array. + * + * The following rules applies during the conversion: + * + * * Each tag is converted to a key value or an array + * if there is more than one "value" + * + * * The content of a tag is set under a "value" key (bar) + * if the tag also has some nested tags + * + * * The attributes are converted to keys () + * + * * The nested-tags are converted to keys (bar) + * + * @param \DomElement $element A \DomElement instance + * + * @return array A PHP array + */ + public static function convertDomElementToArray(\DomElement $element) + { + return XmlUtils::convertDomElementToArray($element); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php new file mode 100644 index 0000000..8fee1bf --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php @@ -0,0 +1,392 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader; + +use Symfony\Component\DependencyInjection\DefinitionDecorator; +use Symfony\Component\DependencyInjection\Alias; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Yaml\Parser as YamlParser; + +/** + * YamlFileLoader loads YAML files service definitions. + * + * The YAML format does not support anonymous services (cf. the XML loader). + * + * @author Fabien Potencier + */ +class YamlFileLoader extends FileLoader +{ + private $yamlParser; + + /** + * Loads a Yaml file. + * + * @param mixed $file The resource + * @param string $type The resource type + */ + public function load($file, $type = null) + { + $path = $this->locator->locate($file); + + $content = $this->loadFile($path); + + $this->container->addResource(new FileResource($path)); + + // empty file + if (null === $content) { + return; + } + + // imports + $this->parseImports($content, $path); + + // parameters + if (isset($content['parameters'])) { + if (!is_array($content['parameters'])) { + throw new InvalidArgumentException(sprintf('The "parameters" key should contain an array in %s. Check your YAML syntax.', $file)); + } + + foreach ($content['parameters'] as $key => $value) { + $this->container->setParameter($key, $this->resolveServices($value)); + } + } + + // extensions + $this->loadFromExtensions($content); + + // services + $this->parseDefinitions($content, $file); + } + + /** + * Returns true if this class supports the given resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return bool true if this class supports the given resource, false otherwise + */ + public function supports($resource, $type = null) + { + return is_string($resource) && 'yml' === pathinfo($resource, PATHINFO_EXTENSION); + } + + /** + * Parses all imports + * + * @param array $content + * @param string $file + */ + private function parseImports($content, $file) + { + if (!isset($content['imports'])) { + return; + } + + if (!is_array($content['imports'])) { + throw new InvalidArgumentException(sprintf('The "imports" key should contain an array in %s. Check your YAML syntax.', $file)); + } + + foreach ($content['imports'] as $import) { + if (!is_array($import)) { + throw new InvalidArgumentException(sprintf('The values in the "imports" key should be arrays in %s. Check your YAML syntax.', $file)); + } + + $this->setCurrentDir(dirname($file)); + $this->import($import['resource'], null, isset($import['ignore_errors']) ? (bool) $import['ignore_errors'] : false, $file); + } + } + + /** + * Parses definitions + * + * @param array $content + * @param string $file + */ + private function parseDefinitions($content, $file) + { + if (!isset($content['services'])) { + return; + } + + if (!is_array($content['services'])) { + throw new InvalidArgumentException(sprintf('The "services" key should contain an array in %s. Check your YAML syntax.', $file)); + } + + foreach ($content['services'] as $id => $service) { + $this->parseDefinition($id, $service, $file); + } + } + + /** + * Parses a definition. + * + * @param string $id + * @param array $service + * @param string $file + * + * @throws InvalidArgumentException When tags are invalid + */ + private function parseDefinition($id, $service, $file) + { + if (is_string($service) && 0 === strpos($service, '@')) { + $this->container->setAlias($id, substr($service, 1)); + + return; + } + + if (!is_array($service)) { + throw new InvalidArgumentException(sprintf('A service definition must be an array or a string starting with "@" but %s found for service "%s" in %s. Check your YAML syntax.', gettype($service), $id, $file)); + } + + if (isset($service['alias'])) { + $public = !array_key_exists('public', $service) || (bool) $service['public']; + $this->container->setAlias($id, new Alias($service['alias'], $public)); + + return; + } + + if (isset($service['parent'])) { + $definition = new DefinitionDecorator($service['parent']); + } else { + $definition = new Definition(); + } + + if (isset($service['class'])) { + $definition->setClass($service['class']); + } + + if (isset($service['scope'])) { + $definition->setScope($service['scope']); + } + + if (isset($service['synthetic'])) { + $definition->setSynthetic($service['synthetic']); + } + + if (isset($service['synchronized'])) { + $definition->setSynchronized($service['synchronized']); + } + + if (isset($service['lazy'])) { + $definition->setLazy($service['lazy']); + } + + if (isset($service['public'])) { + $definition->setPublic($service['public']); + } + + if (isset($service['abstract'])) { + $definition->setAbstract($service['abstract']); + } + + if (isset($service['factory_class'])) { + $definition->setFactoryClass($service['factory_class']); + } + + if (isset($service['factory_method'])) { + $definition->setFactoryMethod($service['factory_method']); + } + + if (isset($service['factory_service'])) { + $definition->setFactoryService($service['factory_service']); + } + + if (isset($service['file'])) { + $definition->setFile($service['file']); + } + + if (isset($service['arguments'])) { + $definition->setArguments($this->resolveServices($service['arguments'])); + } + + if (isset($service['properties'])) { + $definition->setProperties($this->resolveServices($service['properties'])); + } + + if (isset($service['configurator'])) { + if (is_string($service['configurator'])) { + $definition->setConfigurator($service['configurator']); + } else { + $definition->setConfigurator(array($this->resolveServices($service['configurator'][0]), $service['configurator'][1])); + } + } + + if (isset($service['calls'])) { + if (!is_array($service['calls'])) { + throw new InvalidArgumentException(sprintf('Parameter "calls" must be an array for service "%s" in %s. Check your YAML syntax.', $id, $file)); + } + + foreach ($service['calls'] as $call) { + $args = isset($call[1]) ? $this->resolveServices($call[1]) : array(); + $definition->addMethodCall($call[0], $args); + } + } + + if (isset($service['tags'])) { + if (!is_array($service['tags'])) { + throw new InvalidArgumentException(sprintf('Parameter "tags" must be an array for service "%s" in %s. Check your YAML syntax.', $id, $file)); + } + + foreach ($service['tags'] as $tag) { + if (!is_array($tag)) { + throw new InvalidArgumentException(sprintf('A "tags" entry must be an array for service "%s" in %s. Check your YAML syntax.', $id, $file)); + } + + if (!isset($tag['name'])) { + throw new InvalidArgumentException(sprintf('A "tags" entry is missing a "name" key for service "%s" in %s.', $id, $file)); + } + + $name = $tag['name']; + unset($tag['name']); + + foreach ($tag as $value) { + if (!is_scalar($value)) { + throw new InvalidArgumentException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s" in %s. Check your YAML syntax.', $id, $name, $file)); + } + } + + $definition->addTag($name, $tag); + } + } + + $this->container->setDefinition($id, $definition); + } + + /** + * Loads a YAML file. + * + * @param string $file + * + * @return array The file content + * + * @throws InvalidArgumentException when the given file is not a local file or when it does not exist + */ + protected function loadFile($file) + { + if (!stream_is_local($file)) { + throw new InvalidArgumentException(sprintf('This is not a local file "%s".', $file)); + } + + if (!file_exists($file)) { + throw new InvalidArgumentException(sprintf('The service file "%s" is not valid.', $file)); + } + + if (null === $this->yamlParser) { + $this->yamlParser = new YamlParser(); + } + + return $this->validate($this->yamlParser->parse(file_get_contents($file)), $file); + } + + /** + * Validates a YAML file. + * + * @param mixed $content + * @param string $file + * + * @return array + * + * @throws InvalidArgumentException When service file is not valid + */ + private function validate($content, $file) + { + if (null === $content) { + return $content; + } + + if (!is_array($content)) { + throw new InvalidArgumentException(sprintf('The service file "%s" is not valid. It should contain an array. Check your YAML syntax.', $file)); + } + + foreach (array_keys($content) as $namespace) { + if (in_array($namespace, array('imports', 'parameters', 'services'))) { + continue; + } + + if (!$this->container->hasExtension($namespace)) { + $extensionNamespaces = array_filter(array_map(function ($ext) { return $ext->getAlias(); }, $this->container->getExtensions())); + throw new InvalidArgumentException(sprintf( + 'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s', + $namespace, + $file, + $namespace, + $extensionNamespaces ? sprintf('"%s"', implode('", "', $extensionNamespaces)) : 'none' + )); + } + } + + return $content; + } + + /** + * Resolves services. + * + * @param string|array $value + * + * @return array|string|Reference + */ + private function resolveServices($value) + { + if (is_array($value)) { + $value = array_map(array($this, 'resolveServices'), $value); + } elseif (is_string($value) && 0 === strpos($value, '@')) { + if (0 === strpos($value, '@@')) { + $value = substr($value, 1); + $invalidBehavior = null; + } elseif (0 === strpos($value, '@?')) { + $value = substr($value, 2); + $invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE; + } else { + $value = substr($value, 1); + $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE; + } + + if ('=' === substr($value, -1)) { + $value = substr($value, 0, -1); + $strict = false; + } else { + $strict = true; + } + + if (null !== $invalidBehavior) { + $value = new Reference($value, $invalidBehavior, $strict); + } + } + + return $value; + } + + /** + * Loads from Extensions + * + * @param array $content + */ + private function loadFromExtensions($content) + { + foreach ($content as $namespace => $values) { + if (in_array($namespace, array('imports', 'parameters', 'services'))) { + continue; + } + + if (!is_array($values)) { + $values = array(); + } + + $this->container->loadFromExtension($namespace, $values); + } + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd new file mode 100644 index 0000000..e62b475 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Parameter.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Parameter.php new file mode 100644 index 0000000..7ba8c3a --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Parameter.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * Parameter represents a parameter reference. + * + * @author Fabien Potencier + * + * @api + */ +class Parameter +{ + private $id; + + /** + * Constructor. + * + * @param string $id The parameter key + */ + public function __construct($id) + { + $this->id = $id; + } + + /** + * __toString. + * + * @return string The parameter key + */ + public function __toString() + { + return (string) $this->id; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php new file mode 100644 index 0000000..dc936a0 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\ParameterBag; + +use Symfony\Component\DependencyInjection\Exception\LogicException; + +/** + * Holds read-only parameters. + * + * @author Fabien Potencier + * + * @api + */ +class FrozenParameterBag extends ParameterBag +{ + /** + * Constructor. + * + * For performance reasons, the constructor assumes that + * all keys are already lowercased. + * + * This is always the case when used internally. + * + * @param array $parameters An array of parameters + * + * @api + */ + public function __construct(array $parameters = array()) + { + $this->parameters = $parameters; + $this->resolved = true; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function clear() + { + throw new LogicException('Impossible to call clear() on a frozen ParameterBag.'); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function add(array $parameters) + { + throw new LogicException('Impossible to call add() on a frozen ParameterBag.'); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function set($name, $value) + { + throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php new file mode 100644 index 0000000..b6dd058 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php @@ -0,0 +1,306 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\ParameterBag; + +use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; +use Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; + +/** + * Holds parameters. + * + * @author Fabien Potencier + * + * @api + */ +class ParameterBag implements ParameterBagInterface +{ + protected $parameters; + protected $resolved; + + /** + * Constructor. + * + * @param array $parameters An array of parameters + * + * @api + */ + public function __construct(array $parameters = array()) + { + $this->parameters = array(); + $this->add($parameters); + $this->resolved = false; + } + + /** + * Clears all parameters. + * + * @api + */ + public function clear() + { + $this->parameters = array(); + } + + /** + * Adds parameters to the service container parameters. + * + * @param array $parameters An array of parameters + * + * @api + */ + public function add(array $parameters) + { + foreach ($parameters as $key => $value) { + $this->parameters[strtolower($key)] = $value; + } + } + + /** + * Gets the service container parameters. + * + * @return array An array of parameters + * + * @api + */ + public function all() + { + return $this->parameters; + } + + /** + * Gets a service container parameter. + * + * @param string $name The parameter name + * + * @return mixed The parameter value + * + * @throws ParameterNotFoundException if the parameter is not defined + * + * @api + */ + public function get($name) + { + $name = strtolower($name); + + if (!array_key_exists($name, $this->parameters)) { + if (!$name) { + throw new ParameterNotFoundException($name); + } + + $alternatives = array(); + foreach (array_keys($this->parameters) as $key) { + $lev = levenshtein($name, $key); + if ($lev <= strlen($name) / 3 || false !== strpos($key, $name)) { + $alternatives[] = $key; + } + } + + throw new ParameterNotFoundException($name, null, null, null, $alternatives); + } + + return $this->parameters[$name]; + } + + /** + * Sets a service container parameter. + * + * @param string $name The parameter name + * @param mixed $value The parameter value + * + * @api + */ + public function set($name, $value) + { + $this->parameters[strtolower($name)] = $value; + } + + /** + * Returns true if a parameter name is defined. + * + * @param string $name The parameter name + * + * @return bool true if the parameter name is defined, false otherwise + * + * @api + */ + public function has($name) + { + return array_key_exists(strtolower($name), $this->parameters); + } + + /** + * Removes a parameter. + * + * @param string $name The parameter name + * + * @api + */ + public function remove($name) + { + unset($this->parameters[strtolower($name)]); + } + + /** + * Replaces parameter placeholders (%name%) by their values for all parameters. + */ + public function resolve() + { + if ($this->resolved) { + return; + } + + $parameters = array(); + foreach ($this->parameters as $key => $value) { + try { + $value = $this->resolveValue($value); + $parameters[$key] = $this->unescapeValue($value); + } catch (ParameterNotFoundException $e) { + $e->setSourceKey($key); + + throw $e; + } + } + + $this->parameters = $parameters; + $this->resolved = true; + } + + /** + * Replaces parameter placeholders (%name%) by their values. + * + * @param mixed $value A value + * @param array $resolving An array of keys that are being resolved (used internally to detect circular references) + * + * @return mixed The resolved value + * + * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist + * @throws ParameterCircularReferenceException if a circular reference if detected + * @throws RuntimeException when a given parameter has a type problem. + */ + public function resolveValue($value, array $resolving = array()) + { + if (is_array($value)) { + $args = array(); + foreach ($value as $k => $v) { + $args[$this->resolveValue($k, $resolving)] = $this->resolveValue($v, $resolving); + } + + return $args; + } + + if (!is_string($value)) { + return $value; + } + + return $this->resolveString($value, $resolving); + } + + /** + * Resolves parameters inside a string + * + * @param string $value The string to resolve + * @param array $resolving An array of keys that are being resolved (used internally to detect circular references) + * + * @return string The resolved string + * + * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist + * @throws ParameterCircularReferenceException if a circular reference if detected + * @throws RuntimeException when a given parameter has a type problem. + */ + public function resolveString($value, array $resolving = array()) + { + // we do this to deal with non string values (Boolean, integer, ...) + // as the preg_replace_callback throw an exception when trying + // a non-string in a parameter value + if (preg_match('/^%([^%\s]+)%$/', $value, $match)) { + $key = strtolower($match[1]); + + if (isset($resolving[$key])) { + throw new ParameterCircularReferenceException(array_keys($resolving)); + } + + $resolving[$key] = true; + + return $this->resolved ? $this->get($key) : $this->resolveValue($this->get($key), $resolving); + } + + $self = $this; + + return preg_replace_callback('/%%|%([^%\s]+)%/', function ($match) use ($self, $resolving, $value) { + // skip %% + if (!isset($match[1])) { + return '%%'; + } + + $key = strtolower($match[1]); + if (isset($resolving[$key])) { + throw new ParameterCircularReferenceException(array_keys($resolving)); + } + + $resolved = $self->get($key); + + if (!is_string($resolved) && !is_numeric($resolved)) { + throw new RuntimeException(sprintf('A string value must be composed of strings and/or numbers, but found parameter "%s" of type %s inside string value "%s".', $key, gettype($resolved), $value)); + } + + $resolved = (string) $resolved; + $resolving[$key] = true; + + return $self->isResolved() ? $resolved : $self->resolveString($resolved, $resolving); + }, $value); + } + + public function isResolved() + { + return $this->resolved; + } + + /** + * {@inheritdoc} + */ + public function escapeValue($value) + { + if (is_string($value)) { + return str_replace('%', '%%', $value); + } + + if (is_array($value)) { + $result = array(); + foreach ($value as $k => $v) { + $result[$k] = $this->escapeValue($v); + } + + return $result; + } + + return $value; + } + + public function unescapeValue($value) + { + if (is_string($value)) { + return str_replace('%%', '%', $value); + } + + if (is_array($value)) { + $result = array(); + foreach ($value as $k => $v) { + $result[$k] = $this->unescapeValue($v); + } + + return $result; + } + + return $value; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php new file mode 100644 index 0000000..990f33a --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php @@ -0,0 +1,115 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\ParameterBag; + +use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; + +/** + * ParameterBagInterface. + * + * @author Fabien Potencier + * + * @api + */ +interface ParameterBagInterface +{ + /** + * Clears all parameters. + * + * @api + */ + public function clear(); + + /** + * Adds parameters to the service container parameters. + * + * @param array $parameters An array of parameters + * + * @api + */ + public function add(array $parameters); + + /** + * Gets the service container parameters. + * + * @return array An array of parameters + * + * @api + */ + public function all(); + + /** + * Gets a service container parameter. + * + * @param string $name The parameter name + * + * @return mixed The parameter value + * + * @throws ParameterNotFoundException if the parameter is not defined + * + * @api + */ + public function get($name); + + /** + * Sets a service container parameter. + * + * @param string $name The parameter name + * @param mixed $value The parameter value + * + * @api + */ + public function set($name, $value); + + /** + * Returns true if a parameter name is defined. + * + * @param string $name The parameter name + * + * @return bool true if the parameter name is defined, false otherwise + * + * @api + */ + public function has($name); + + /** + * Replaces parameter placeholders (%name%) by their values for all parameters. + */ + public function resolve(); + + /** + * Replaces parameter placeholders (%name%) by their values. + * + * @param mixed $value A value + * + * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist + */ + public function resolveValue($value); + + /** + * Escape parameter placeholders % + * + * @param mixed $value + * + * @return mixed + */ + public function escapeValue($value); + + /** + * Unescape parameter placeholders % + * + * @param mixed $value + * + * @return mixed + */ + public function unescapeValue($value); +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Reference.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Reference.php new file mode 100644 index 0000000..1fb7b13 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Reference.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * Reference represents a service reference. + * + * @author Fabien Potencier + * + * @api + */ +class Reference +{ + private $id; + private $invalidBehavior; + private $strict; + + /** + * Constructor. + * + * @param string $id The service identifier + * @param int $invalidBehavior The behavior when the service does not exist + * @param bool $strict Sets how this reference is validated + * + * @see Container + */ + public function __construct($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, $strict = true) + { + $this->id = strtolower($id); + $this->invalidBehavior = $invalidBehavior; + $this->strict = $strict; + } + + /** + * __toString. + * + * @return string The service identifier + */ + public function __toString() + { + return (string) $this->id; + } + + /** + * Returns the behavior to be used when the service does not exist. + * + * @return int + */ + public function getInvalidBehavior() + { + return $this->invalidBehavior; + } + + /** + * Returns true when this Reference is strict + * + * @return bool + */ + public function isStrict() + { + return $this->strict; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Scope.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Scope.php new file mode 100644 index 0000000..161229e --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Scope.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * Scope class. + * + * @author Johannes M. Schmitt + * + * @api + */ +class Scope implements ScopeInterface +{ + private $name; + private $parentName; + + /** + * @api + */ + public function __construct($name, $parentName = ContainerInterface::SCOPE_CONTAINER) + { + $this->name = $name; + $this->parentName = $parentName; + } + + /** + * @api + */ + public function getName() + { + return $this->name; + } + + /** + * @api + */ + public function getParentName() + { + return $this->parentName; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ScopeInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ScopeInterface.php new file mode 100644 index 0000000..81ac67c --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ScopeInterface.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * Scope Interface. + * + * @author Johannes M. Schmitt + * + * @api + */ +interface ScopeInterface +{ + /** + * @api + */ + public function getName(); + + /** + * @api + */ + public function getParentName(); +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/SimpleXMLElement.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/SimpleXMLElement.php new file mode 100644 index 0000000..a9af790 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/SimpleXMLElement.php @@ -0,0 +1,108 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +use Symfony\Component\Config\Util\XmlUtils; + +/** + * SimpleXMLElement class. + * + * @author Fabien Potencier + */ +class SimpleXMLElement extends \SimpleXMLElement +{ + /** + * Converts an attribute as a PHP type. + * + * @param string $name + * + * @return mixed + */ + public function getAttributeAsPhp($name) + { + return self::phpize($this[$name]); + } + + /** + * Returns arguments as valid PHP types. + * + * @param string $name + * @param bool $lowercase + * + * @return mixed + */ + public function getArgumentsAsPhp($name, $lowercase = true) + { + $arguments = array(); + foreach ($this->$name as $arg) { + if (isset($arg['name'])) { + $arg['key'] = (string) $arg['name']; + } + $key = isset($arg['key']) ? (string) $arg['key'] : (!$arguments ? 0 : max(array_keys($arguments)) + 1); + + // parameter keys are case insensitive + if ('parameter' == $name && $lowercase) { + $key = strtolower($key); + } + + // this is used by DefinitionDecorator to overwrite a specific + // argument of the parent definition + if (isset($arg['index'])) { + $key = 'index_'.$arg['index']; + } + + switch ($arg['type']) { + case 'service': + $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE; + if (isset($arg['on-invalid']) && 'ignore' == $arg['on-invalid']) { + $invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE; + } elseif (isset($arg['on-invalid']) && 'null' == $arg['on-invalid']) { + $invalidBehavior = ContainerInterface::NULL_ON_INVALID_REFERENCE; + } + + if (isset($arg['strict'])) { + $strict = self::phpize($arg['strict']); + } else { + $strict = true; + } + + $arguments[$key] = new Reference((string) $arg['id'], $invalidBehavior, $strict); + break; + case 'collection': + $arguments[$key] = $arg->getArgumentsAsPhp($name, false); + break; + case 'string': + $arguments[$key] = (string) $arg; + break; + case 'constant': + $arguments[$key] = constant((string) $arg); + break; + default: + $arguments[$key] = self::phpize($arg); + } + } + + return $arguments; + } + + /** + * Converts an xml value to a PHP type. + * + * @param mixed $value + * + * @return mixed + */ + public static function phpize($value) + { + return XmlUtils::phpize($value); + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/TaggedContainerInterface.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/TaggedContainerInterface.php new file mode 100644 index 0000000..3b48817 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/TaggedContainerInterface.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * TaggedContainerInterface is the interface implemented when a container knows how to deals with tags. + * + * @author Fabien Potencier + * + * @api + */ +interface TaggedContainerInterface extends ContainerInterface +{ + /** + * Returns service ids for a given tag. + * + * @param string $name The tag name + * + * @return array An array of tags + * + * @api + */ + public function findTaggedServiceIds($name); +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Variable.php b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Variable.php new file mode 100644 index 0000000..c84b8fd --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Variable.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * Represents a variable. + * + * $var = new Variable('a'); + * + * will be dumped as + * + * $a + * + * by the PHP dumper. + * + * @author Johannes M. Schmitt + */ +class Variable +{ + private $name; + + /** + * Constructor + * + * @param string $name + */ + public function __construct($name) + { + $this->name = $name; + } + + /** + * Converts the object to a string + * + * @return string + */ + public function __toString() + { + return $this->name; + } +} diff --git a/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/composer.json b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/composer.json new file mode 100644 index 0000000..2631da9 --- /dev/null +++ b/sources/phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/composer.json @@ -0,0 +1,40 @@ +{ + "name": "symfony/dependency-injection", + "type": "library", + "description": "Symfony DependencyInjection Component", + "keywords": [], + "homepage": "http://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/yaml": "~2.0", + "symfony/config": "~2.2" + }, + "suggest": { + "symfony/yaml": "", + "symfony/config": "", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them" + }, + "autoload": { + "psr-0": { "Symfony\\Component\\DependencyInjection\\": "" } + }, + "target-dir": "Symfony/Component/DependencyInjection", + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + } +} diff --git a/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php new file mode 100644 index 0000000..e97d427 --- /dev/null +++ b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php @@ -0,0 +1,202 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\EventDispatcher; + +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * Lazily loads listeners and subscribers from the dependency injection + * container + * + * @author Fabien Potencier + * @author Bernhard Schussek + * @author Jordan Alliot + */ +class ContainerAwareEventDispatcher extends EventDispatcher +{ + /** + * The container from where services are loaded + * @var ContainerInterface + */ + private $container; + + /** + * The service IDs of the event listeners and subscribers + * @var array + */ + private $listenerIds = array(); + + /** + * The services registered as listeners + * @var array + */ + private $listeners = array(); + + /** + * Constructor. + * + * @param ContainerInterface $container A ContainerInterface instance + */ + public function __construct(ContainerInterface $container) + { + $this->container = $container; + } + + /** + * Adds a service as event listener + * + * @param string $eventName Event for which the listener is added + * @param array $callback The service ID of the listener service & the method + * name that has to be called + * @param int $priority The higher this value, the earlier an event listener + * will be triggered in the chain. + * Defaults to 0. + * + * @throws \InvalidArgumentException + */ + public function addListenerService($eventName, $callback, $priority = 0) + { + if (!is_array($callback) || 2 !== count($callback)) { + throw new \InvalidArgumentException('Expected an array("service", "method") argument'); + } + + $this->listenerIds[$eventName][] = array($callback[0], $callback[1], $priority); + } + + public function removeListener($eventName, $listener) + { + $this->lazyLoad($eventName); + + if (isset($this->listeners[$eventName])) { + foreach ($this->listeners[$eventName] as $key => $l) { + foreach ($this->listenerIds[$eventName] as $i => $args) { + list($serviceId, $method, $priority) = $args; + if ($key === $serviceId.'.'.$method) { + if ($listener === array($l, $method)) { + unset($this->listeners[$eventName][$key]); + if (empty($this->listeners[$eventName])) { + unset($this->listeners[$eventName]); + } + unset($this->listenerIds[$eventName][$i]); + if (empty($this->listenerIds[$eventName])) { + unset($this->listenerIds[$eventName]); + } + } + } + } + } + } + + parent::removeListener($eventName, $listener); + } + + /** + * @see EventDispatcherInterface::hasListeners + */ + public function hasListeners($eventName = null) + { + if (null === $eventName) { + return (bool) count($this->listenerIds) || (bool) count($this->listeners); + } + + if (isset($this->listenerIds[$eventName])) { + return true; + } + + return parent::hasListeners($eventName); + } + + /** + * @see EventDispatcherInterface::getListeners + */ + public function getListeners($eventName = null) + { + if (null === $eventName) { + foreach (array_keys($this->listenerIds) as $serviceEventName) { + $this->lazyLoad($serviceEventName); + } + } else { + $this->lazyLoad($eventName); + } + + return parent::getListeners($eventName); + } + + /** + * Adds a service as event subscriber + * + * @param string $serviceId The service ID of the subscriber service + * @param string $class The service's class name (which must implement EventSubscriberInterface) + */ + public function addSubscriberService($serviceId, $class) + { + foreach ($class::getSubscribedEvents() as $eventName => $params) { + if (is_string($params)) { + $this->listenerIds[$eventName][] = array($serviceId, $params, 0); + } elseif (is_string($params[0])) { + $this->listenerIds[$eventName][] = array($serviceId, $params[0], isset($params[1]) ? $params[1] : 0); + } else { + foreach ($params as $listener) { + $this->listenerIds[$eventName][] = array($serviceId, $listener[0], isset($listener[1]) ? $listener[1] : 0); + } + } + } + } + + /** + * {@inheritdoc} + * + * Lazily loads listeners for this event from the dependency injection + * container. + * + * @throws \InvalidArgumentException if the service is not defined + */ + public function dispatch($eventName, Event $event = null) + { + $this->lazyLoad($eventName); + + return parent::dispatch($eventName, $event); + } + + public function getContainer() + { + return $this->container; + } + + /** + * Lazily loads listeners for this event from the dependency injection + * container. + * + * @param string $eventName The name of the event to dispatch. The name of + * the event is the name of the method that is + * invoked on listeners. + */ + protected function lazyLoad($eventName) + { + if (isset($this->listenerIds[$eventName])) { + foreach ($this->listenerIds[$eventName] as $args) { + list($serviceId, $method, $priority) = $args; + $listener = $this->container->get($serviceId); + + $key = $serviceId.'.'.$method; + if (!isset($this->listeners[$eventName][$key])) { + $this->addListener($eventName, array($listener, $method), $priority); + } elseif ($listener !== $this->listeners[$eventName][$key]) { + parent::removeListener($eventName, array($this->listeners[$eventName][$key], $method)); + $this->addListener($eventName, array($listener, $method), $priority); + } + + $this->listeners[$eventName][$key] = $listener; + } + } + } +} diff --git a/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php new file mode 100644 index 0000000..a67a979 --- /dev/null +++ b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\EventDispatcher\Debug; + +/** + * @author Fabien Potencier + */ +interface TraceableEventDispatcherInterface +{ + /** + * Gets the called listeners. + * + * @return array An array of called listeners + */ + public function getCalledListeners(); + + /** + * Gets the not called listeners. + * + * @return array An array of not called listeners + */ + public function getNotCalledListeners(); +} diff --git a/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php new file mode 100644 index 0000000..26ac1b6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php @@ -0,0 +1,121 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\EventDispatcher; + +/** + * Event is the base class for classes containing event data. + * + * This class contains no event data. It is used by events that do not pass + * state information to an event handler when an event is raised. + * + * You can call the method stopPropagation() to abort the execution of + * further listeners in your event listener. + * + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel + * @author Bernhard Schussek + * + * @api + */ +class Event +{ + /** + * @var bool Whether no further event listeners should be triggered + */ + private $propagationStopped = false; + + /** + * @var EventDispatcher Dispatcher that dispatched this event + */ + private $dispatcher; + + /** + * @var string This event's name + */ + private $name; + + /** + * Returns whether further event listeners should be triggered. + * + * @see Event::stopPropagation + * @return bool Whether propagation was already stopped for this event. + * + * @api + */ + public function isPropagationStopped() + { + return $this->propagationStopped; + } + + /** + * Stops the propagation of the event to further event listeners. + * + * If multiple event listeners are connected to the same event, no + * further event listener will be triggered once any trigger calls + * stopPropagation(). + * + * @api + */ + public function stopPropagation() + { + $this->propagationStopped = true; + } + + /** + * Stores the EventDispatcher that dispatches this Event + * + * @param EventDispatcherInterface $dispatcher + * + * @api + */ + public function setDispatcher(EventDispatcherInterface $dispatcher) + { + $this->dispatcher = $dispatcher; + } + + /** + * Returns the EventDispatcher that dispatches this Event + * + * @return EventDispatcherInterface + * + * @api + */ + public function getDispatcher() + { + return $this->dispatcher; + } + + /** + * Gets the event's name. + * + * @return string + * + * @api + */ + public function getName() + { + return $this->name; + } + + /** + * Sets the event's name property. + * + * @param string $name The event name. + * + * @api + */ + public function setName($name) + { + $this->name = $name; + } +} diff --git a/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php new file mode 100644 index 0000000..e189a57 --- /dev/null +++ b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php @@ -0,0 +1,185 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\EventDispatcher; + +/** + * The EventDispatcherInterface is the central point of Symfony's event listener system. + * + * Listeners are registered on the manager and events are dispatched through the + * manager. + * + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel + * @author Bernhard Schussek + * @author Fabien Potencier + * @author Jordi Boggiano + * @author Jordan Alliot + * + * @api + */ +class EventDispatcher implements EventDispatcherInterface +{ + private $listeners = array(); + private $sorted = array(); + + /** + * @see EventDispatcherInterface::dispatch + * + * @api + */ + public function dispatch($eventName, Event $event = null) + { + if (null === $event) { + $event = new Event(); + } + + $event->setDispatcher($this); + $event->setName($eventName); + + if (!isset($this->listeners[$eventName])) { + return $event; + } + + $this->doDispatch($this->getListeners($eventName), $eventName, $event); + + return $event; + } + + /** + * @see EventDispatcherInterface::getListeners + */ + public function getListeners($eventName = null) + { + if (null !== $eventName) { + if (!isset($this->sorted[$eventName])) { + $this->sortListeners($eventName); + } + + return $this->sorted[$eventName]; + } + + foreach (array_keys($this->listeners) as $eventName) { + if (!isset($this->sorted[$eventName])) { + $this->sortListeners($eventName); + } + } + + return array_filter($this->sorted); + } + + /** + * @see EventDispatcherInterface::hasListeners + */ + public function hasListeners($eventName = null) + { + return (bool) count($this->getListeners($eventName)); + } + + /** + * @see EventDispatcherInterface::addListener + * + * @api + */ + public function addListener($eventName, $listener, $priority = 0) + { + $this->listeners[$eventName][$priority][] = $listener; + unset($this->sorted[$eventName]); + } + + /** + * @see EventDispatcherInterface::removeListener + */ + public function removeListener($eventName, $listener) + { + if (!isset($this->listeners[$eventName])) { + return; + } + + foreach ($this->listeners[$eventName] as $priority => $listeners) { + if (false !== ($key = array_search($listener, $listeners, true))) { + unset($this->listeners[$eventName][$priority][$key], $this->sorted[$eventName]); + } + } + } + + /** + * @see EventDispatcherInterface::addSubscriber + * + * @api + */ + public function addSubscriber(EventSubscriberInterface $subscriber) + { + foreach ($subscriber->getSubscribedEvents() as $eventName => $params) { + if (is_string($params)) { + $this->addListener($eventName, array($subscriber, $params)); + } elseif (is_string($params[0])) { + $this->addListener($eventName, array($subscriber, $params[0]), isset($params[1]) ? $params[1] : 0); + } else { + foreach ($params as $listener) { + $this->addListener($eventName, array($subscriber, $listener[0]), isset($listener[1]) ? $listener[1] : 0); + } + } + } + } + + /** + * @see EventDispatcherInterface::removeSubscriber + */ + public function removeSubscriber(EventSubscriberInterface $subscriber) + { + foreach ($subscriber->getSubscribedEvents() as $eventName => $params) { + if (is_array($params) && is_array($params[0])) { + foreach ($params as $listener) { + $this->removeListener($eventName, array($subscriber, $listener[0])); + } + } else { + $this->removeListener($eventName, array($subscriber, is_string($params) ? $params : $params[0])); + } + } + } + + /** + * Triggers the listeners of an event. + * + * This method can be overridden to add functionality that is executed + * for each listener. + * + * @param array[callback] $listeners The event listeners. + * @param string $eventName The name of the event to dispatch. + * @param Event $event The event object to pass to the event handlers/listeners. + */ + protected function doDispatch($listeners, $eventName, Event $event) + { + foreach ($listeners as $listener) { + call_user_func($listener, $event); + if ($event->isPropagationStopped()) { + break; + } + } + } + + /** + * Sorts the internal list of listeners for the given event by priority. + * + * @param string $eventName The name of the event. + */ + private function sortListeners($eventName) + { + $this->sorted[$eventName] = array(); + + if (isset($this->listeners[$eventName])) { + krsort($this->listeners[$eventName]); + $this->sorted[$eventName] = call_user_func_array('array_merge', $this->listeners[$eventName]); + } + } +} diff --git a/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php new file mode 100644 index 0000000..c85ebda --- /dev/null +++ b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php @@ -0,0 +1,96 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\EventDispatcher; + +/** + * The EventDispatcherInterface is the central point of Symfony's event listener system. + * Listeners are registered on the manager and events are dispatched through the + * manager. + * + * @author Bernhard Schussek + * + * @api + */ +interface EventDispatcherInterface +{ + /** + * Dispatches an event to all registered listeners. + * + * @param string $eventName The name of the event to dispatch. The name of + * the event is the name of the method that is + * invoked on listeners. + * @param Event $event The event to pass to the event handlers/listeners. + * If not supplied, an empty Event instance is created. + * + * @return Event + * + * @api + */ + public function dispatch($eventName, Event $event = null); + + /** + * Adds an event listener that listens on the specified events. + * + * @param string $eventName The event to listen on + * @param callable $listener The listener + * @param int $priority The higher this value, the earlier an event + * listener will be triggered in the chain (defaults to 0) + * + * @api + */ + public function addListener($eventName, $listener, $priority = 0); + + /** + * Adds an event subscriber. + * + * The subscriber is asked for all the events he is + * interested in and added as a listener for these events. + * + * @param EventSubscriberInterface $subscriber The subscriber. + * + * @api + */ + public function addSubscriber(EventSubscriberInterface $subscriber); + + /** + * Removes an event listener from the specified events. + * + * @param string $eventName The event to remove a listener from + * @param callable $listener The listener to remove + */ + public function removeListener($eventName, $listener); + + /** + * Removes an event subscriber. + * + * @param EventSubscriberInterface $subscriber The subscriber + */ + public function removeSubscriber(EventSubscriberInterface $subscriber); + + /** + * Gets the listeners of a specific event or all listeners. + * + * @param string $eventName The name of the event + * + * @return array The event listeners for the specified event, or all event listeners by event name + */ + public function getListeners($eventName = null); + + /** + * Checks whether an event has any registered listeners. + * + * @param string $eventName The name of the event + * + * @return bool true if the specified event has any listeners, false otherwise + */ + public function hasListeners($eventName = null); +} diff --git a/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventSubscriberInterface.php b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventSubscriberInterface.php new file mode 100644 index 0000000..080f892 --- /dev/null +++ b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventSubscriberInterface.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\EventDispatcher; + +/** + * An EventSubscriber knows himself what events he is interested in. + * If an EventSubscriber is added to an EventDispatcherInterface, the manager invokes + * {@link getSubscribedEvents} and registers the subscriber as a listener for all + * returned events. + * + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel + * @author Bernhard Schussek + * + * @api + */ +interface EventSubscriberInterface +{ + /** + * Returns an array of event names this subscriber wants to listen to. + * + * The array keys are event names and the value can be: + * + * * The method name to call (priority defaults to 0) + * * An array composed of the method name to call and the priority + * * An array of arrays composed of the method names to call and respective + * priorities, or 0 if unset + * + * For instance: + * + * * array('eventName' => 'methodName') + * * array('eventName' => array('methodName', $priority)) + * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) + * + * @return array The event names to listen to + * + * @api + */ + public static function getSubscribedEvents(); +} diff --git a/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php new file mode 100644 index 0000000..1e8c44a --- /dev/null +++ b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php @@ -0,0 +1,186 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\EventDispatcher; + +/** + * Event encapsulation class. + * + * Encapsulates events thus decoupling the observer from the subject they encapsulate. + * + * @author Drak + */ +class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate +{ + /** + * Event subject. + * + * @var mixed usually object or callable + */ + protected $subject; + + /** + * Array of arguments. + * + * @var array + */ + protected $arguments; + + /** + * Encapsulate an event with $subject and $args. + * + * @param mixed $subject The subject of the event, usually an object. + * @param array $arguments Arguments to store in the event. + */ + public function __construct($subject = null, array $arguments = array()) + { + $this->subject = $subject; + $this->arguments = $arguments; + } + + /** + * Getter for subject property. + * + * @return mixed $subject The observer subject. + */ + public function getSubject() + { + return $this->subject; + } + + /** + * Get argument by key. + * + * @param string $key Key. + * + * @throws \InvalidArgumentException If key is not found. + * + * @return mixed Contents of array key. + */ + public function getArgument($key) + { + if ($this->hasArgument($key)) { + return $this->arguments[$key]; + } + + throw new \InvalidArgumentException(sprintf('%s not found in %s', $key, $this->getName())); + } + + /** + * Add argument to event. + * + * @param string $key Argument name. + * @param mixed $value Value. + * + * @return GenericEvent + */ + public function setArgument($key, $value) + { + $this->arguments[$key] = $value; + + return $this; + } + + /** + * Getter for all arguments. + * + * @return array + */ + public function getArguments() + { + return $this->arguments; + } + + /** + * Set args property. + * + * @param array $args Arguments. + * + * @return GenericEvent + */ + public function setArguments(array $args = array()) + { + $this->arguments = $args; + + return $this; + } + + /** + * Has argument. + * + * @param string $key Key of arguments array. + * + * @return bool + */ + public function hasArgument($key) + { + return array_key_exists($key, $this->arguments); + } + + /** + * ArrayAccess for argument getter. + * + * @param string $key Array key. + * + * @throws \InvalidArgumentException If key does not exist in $this->args. + * + * @return mixed + */ + public function offsetGet($key) + { + return $this->getArgument($key); + } + + /** + * ArrayAccess for argument setter. + * + * @param string $key Array key to set. + * @param mixed $value Value. + */ + public function offsetSet($key, $value) + { + $this->setArgument($key, $value); + } + + /** + * ArrayAccess for unset argument. + * + * @param string $key Array key. + */ + public function offsetUnset($key) + { + if ($this->hasArgument($key)) { + unset($this->arguments[$key]); + } + } + + /** + * ArrayAccess has argument. + * + * @param string $key Array key. + * + * @return bool + */ + public function offsetExists($key) + { + return $this->hasArgument($key); + } + + /** + * IteratorAggregate for iterating over the object like an array + * + * @return \ArrayIterator + */ + public function getIterator() + { + return new \ArrayIterator($this->arguments); + } +} diff --git a/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php new file mode 100644 index 0000000..b70b81a --- /dev/null +++ b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\EventDispatcher; + +/** + * A read-only proxy for an event dispatcher. + * + * @author Bernhard Schussek + */ +class ImmutableEventDispatcher implements EventDispatcherInterface +{ + /** + * The proxied dispatcher. + * @var EventDispatcherInterface + */ + private $dispatcher; + + /** + * Creates an unmodifiable proxy for an event dispatcher. + * + * @param EventDispatcherInterface $dispatcher The proxied event dispatcher. + */ + public function __construct(EventDispatcherInterface $dispatcher) + { + $this->dispatcher = $dispatcher; + } + + /** + * {@inheritdoc} + */ + public function dispatch($eventName, Event $event = null) + { + return $this->dispatcher->dispatch($eventName, $event); + } + + /** + * {@inheritdoc} + */ + public function addListener($eventName, $listener, $priority = 0) + { + throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); + } + + /** + * {@inheritdoc} + */ + public function addSubscriber(EventSubscriberInterface $subscriber) + { + throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); + } + + /** + * {@inheritdoc} + */ + public function removeListener($eventName, $listener) + { + throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); + } + + /** + * {@inheritdoc} + */ + public function removeSubscriber(EventSubscriberInterface $subscriber) + { + throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); + } + + /** + * {@inheritdoc} + */ + public function getListeners($eventName = null) + { + return $this->dispatcher->getListeners($eventName); + } + + /** + * {@inheritdoc} + */ + public function hasListeners($eventName = null) + { + return $this->dispatcher->hasListeners($eventName); + } +} diff --git a/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/LICENSE b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/LICENSE new file mode 100644 index 0000000..0b3292c --- /dev/null +++ b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2014 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json new file mode 100644 index 0000000..1db2ecf --- /dev/null +++ b/sources/phpBB/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json @@ -0,0 +1,38 @@ +{ + "name": "symfony/event-dispatcher", + "type": "library", + "description": "Symfony EventDispatcher Component", + "keywords": [], + "homepage": "http://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/dependency-injection": "~2.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "autoload": { + "psr-0": { "Symfony\\Component\\EventDispatcher\\": "" } + }, + "target-dir": "Symfony/Component/EventDispatcher", + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + } +} diff --git a/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/Exception/ExceptionInterface.php b/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/Exception/ExceptionInterface.php new file mode 100644 index 0000000..c212e66 --- /dev/null +++ b/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/Exception/ExceptionInterface.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Filesystem\Exception; + +/** + * Exception interface for all exceptions thrown by the component. + * + * @author Romain Neutron + * + * @api + */ +interface ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/Exception/IOException.php b/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/Exception/IOException.php new file mode 100644 index 0000000..ae7e6ff --- /dev/null +++ b/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/Exception/IOException.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Filesystem\Exception; + +/** + * Exception class thrown when a filesystem operation failure happens + * + * @author Romain Neutron + * + * @api + */ +class IOException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/Filesystem.php b/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/Filesystem.php new file mode 100644 index 0000000..7de9507 --- /dev/null +++ b/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/Filesystem.php @@ -0,0 +1,482 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Filesystem; + +use Symfony\Component\Filesystem\Exception\IOException; + +/** + * Provides basic utility to manipulate the file system. + * + * @author Fabien Potencier + */ +class Filesystem +{ + /** + * 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 $originFile The original filename + * @param string $targetFile The target filename + * @param bool $override Whether to override an existing file or not + * + * @throws IOException When copy fails + */ + public function copy($originFile, $targetFile, $override = false) + { + if (stream_is_local($originFile) && !is_file($originFile)) { + throw new IOException(sprintf('Failed to copy %s because file not exists', $originFile)); + } + + $this->mkdir(dirname($targetFile)); + + if (!$override && is_file($targetFile) && null === parse_url($originFile, PHP_URL_HOST)) { + $doCopy = filemtime($originFile) > filemtime($targetFile); + } else { + $doCopy = true; + } + + if ($doCopy) { + // https://bugs.php.net/bug.php?id=64634 + $source = fopen($originFile, 'r'); + // Stream context created to allow files overwrite when using FTP stream wrapper - disabled by default + $target = fopen($targetFile, 'w', null, stream_context_create(array('ftp' => array('overwrite' => true)))); + stream_copy_to_stream($source, $target); + fclose($source); + fclose($target); + unset($source, $target); + + if (!is_file($targetFile)) { + throw new IOException(sprintf('Failed to copy %s to %s', $originFile, $targetFile)); + } + } + } + + /** + * Creates a directory recursively. + * + * @param string|array|\Traversable $dirs The directory path + * @param int $mode The directory mode + * + * @throws IOException On any directory creation failure + */ + public function mkdir($dirs, $mode = 0777) + { + foreach ($this->toIterator($dirs) as $dir) { + if (is_dir($dir)) { + continue; + } + + if (true !== @mkdir($dir, $mode, true)) { + $error = error_get_last(); + if (!is_dir($dir)) { + // The directory was not created by a concurrent process. Let's throw an exception with a developer friendly error message if we have one + if ($error) { + throw new IOException(sprintf('Failed to create "%s": %s.', $dir, $error['message'])); + } + throw new IOException(sprintf('Failed to create "%s"', $dir)); + } + } + } + } + + /** + * Checks the existence of files or directories. + * + * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to check + * + * @return bool true if the file exists, false otherwise + */ + public function exists($files) + { + foreach ($this->toIterator($files) as $file) { + if (!file_exists($file)) { + return false; + } + } + + return true; + } + + /** + * 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 $atime The access time as a Unix timestamp + * + * @throws IOException When touch fails + */ + public function touch($files, $time = null, $atime = null) + { + foreach ($this->toIterator($files) as $file) { + $touch = $time ? @touch($file, $time, $atime) : @touch($file); + if (true !== $touch) { + throw new IOException(sprintf('Failed to touch %s', $file)); + } + } + } + + /** + * Removes files or directories. + * + * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to remove + * + * @throws IOException When removal fails + */ + public function remove($files) + { + $files = iterator_to_array($this->toIterator($files)); + $files = array_reverse($files); + foreach ($files as $file) { + if (!file_exists($file) && !is_link($file)) { + continue; + } + + if (is_dir($file) && !is_link($file)) { + $this->remove(new \FilesystemIterator($file)); + + if (true !== @rmdir($file)) { + throw new IOException(sprintf('Failed to remove directory %s', $file)); + } + } else { + // https://bugs.php.net/bug.php?id=52176 + if (defined('PHP_WINDOWS_VERSION_MAJOR') && is_dir($file)) { + if (true !== @rmdir($file)) { + throw new IOException(sprintf('Failed to remove file %s', $file)); + } + } else { + if (true !== @unlink($file)) { + throw new IOException(sprintf('Failed to remove file %s', $file)); + } + } + } + } + } + + /** + * Change mode for an array of files or directories. + * + * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change mode + * @param int $mode The new mode (octal) + * @param int $umask The mode mask (octal) + * @param bool $recursive Whether change the mod recursively or not + * + * @throws IOException When the change fail + */ + public function chmod($files, $mode, $umask = 0000, $recursive = false) + { + foreach ($this->toIterator($files) as $file) { + if ($recursive && is_dir($file) && !is_link($file)) { + $this->chmod(new \FilesystemIterator($file), $mode, $umask, true); + } + if (true !== @chmod($file, $mode & ~$umask)) { + throw new IOException(sprintf('Failed to chmod file %s', $file)); + } + } + } + + /** + * Change the owner of an array of files or directories + * + * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change owner + * @param string $user The new owner user name + * @param bool $recursive Whether change the owner recursively or not + * + * @throws IOException When the change fail + */ + public function chown($files, $user, $recursive = false) + { + foreach ($this->toIterator($files) as $file) { + if ($recursive && is_dir($file) && !is_link($file)) { + $this->chown(new \FilesystemIterator($file), $user, true); + } + if (is_link($file) && function_exists('lchown')) { + if (true !== @lchown($file, $user)) { + throw new IOException(sprintf('Failed to chown file %s', $file)); + } + } else { + if (true !== @chown($file, $user)) { + throw new IOException(sprintf('Failed to chown file %s', $file)); + } + } + } + } + + /** + * Change the group of an array of files or directories + * + * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change group + * @param string $group The group name + * @param bool $recursive Whether change the group recursively or not + * + * @throws IOException When the change fail + */ + public function chgrp($files, $group, $recursive = false) + { + foreach ($this->toIterator($files) as $file) { + if ($recursive && is_dir($file) && !is_link($file)) { + $this->chgrp(new \FilesystemIterator($file), $group, true); + } + if (is_link($file) && function_exists('lchgrp')) { + if (true !== @lchgrp($file, $group)) { + throw new IOException(sprintf('Failed to chgrp file %s', $file)); + } + } else { + if (true !== @chgrp($file, $group)) { + throw new IOException(sprintf('Failed to chgrp file %s', $file)); + } + } + } + } + + /** + * 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 IOException When target file or directory already exists + * @throws IOException When origin cannot be renamed + */ + public function rename($origin, $target, $overwrite = false) + { + // we check that target does not exist + if (!$overwrite && is_readable($target)) { + throw new IOException(sprintf('Cannot rename because the target "%s" already exist.', $target)); + } + + if (true !== @rename($origin, $target)) { + throw new IOException(sprintf('Cannot rename "%s" to "%s".', $origin, $target)); + } + } + + /** + * Creates a symbolic link or copy a directory. + * + * @param string $originDir The origin directory path + * @param string $targetDir The symbolic link name + * @param bool $copyOnWindows Whether to copy files if on Windows + * + * @throws IOException When symlink fails + */ + public function symlink($originDir, $targetDir, $copyOnWindows = false) + { + if (!function_exists('symlink') && $copyOnWindows) { + $this->mirror($originDir, $targetDir); + + return; + } + + $this->mkdir(dirname($targetDir)); + + $ok = false; + if (is_link($targetDir)) { + if (readlink($targetDir) != $originDir) { + $this->remove($targetDir); + } else { + $ok = true; + } + } + + if (!$ok) { + if (true !== @symlink($originDir, $targetDir)) { + $report = error_get_last(); + if (is_array($report)) { + if (defined('PHP_WINDOWS_VERSION_MAJOR') && false !== strpos($report['message'], 'error code(1314)')) { + throw new IOException('Unable to create symlink due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?'); + } + } + throw new IOException(sprintf('Failed to create symbolic link from %s to %s', $originDir, $targetDir)); + } + } + } + + /** + * Given an existing path, convert it to a path relative to a given starting path + * + * @param string $endPath Absolute path of target + * @param string $startPath Absolute path where traversal begins + * + * @return string Path of target relative to starting path + */ + public function makePathRelative($endPath, $startPath) + { + // Normalize separators on Windows + if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + $endPath = strtr($endPath, '\\', '/'); + $startPath = strtr($startPath, '\\', '/'); + } + + // Split the paths into arrays + $startPathArr = explode('/', trim($startPath, '/')); + $endPathArr = explode('/', trim($endPath, '/')); + + // Find for which directory the common path stops + $index = 0; + while (isset($startPathArr[$index]) && isset($endPathArr[$index]) && $startPathArr[$index] === $endPathArr[$index]) { + $index++; + } + + // Determine how deep the start path is relative to the common path (ie, "web/bundles" = 2 levels) + $depth = count($startPathArr) - $index; + + // Repeated "../" for each level need to reach the common path + $traverser = str_repeat('../', $depth); + + $endPathRemainder = implode('/', array_slice($endPathArr, $index)); + + // Construct $endPath from traversing to the common path, then to the remaining $endPath + $relativePath = $traverser.(strlen($endPathRemainder) > 0 ? $endPathRemainder.'/' : ''); + + return (strlen($relativePath) === 0) ? './' : $relativePath; + } + + /** + * Mirrors a directory to another. + * + * @param string $originDir The origin directory + * @param string $targetDir 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 IOException When file type is unknown + */ + public function mirror($originDir, $targetDir, \Traversable $iterator = null, $options = array()) + { + $targetDir = rtrim($targetDir, '/\\'); + $originDir = rtrim($originDir, '/\\'); + + // Iterate in destination folder to remove obsolete entries + if ($this->exists($targetDir) && isset($options['delete']) && $options['delete']) { + $deleteIterator = $iterator; + if (null === $deleteIterator) { + $flags = \FilesystemIterator::SKIP_DOTS; + $deleteIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($targetDir, $flags), \RecursiveIteratorIterator::CHILD_FIRST); + } + foreach ($deleteIterator as $file) { + $origin = str_replace($targetDir, $originDir, $file->getPathname()); + if (!$this->exists($origin)) { + $this->remove($file); + } + } + } + + $copyOnWindows = false; + if (isset($options['copy_on_windows']) && !function_exists('symlink')) { + $copyOnWindows = $options['copy_on_windows']; + } + + if (null === $iterator) { + $flags = $copyOnWindows ? \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS : \FilesystemIterator::SKIP_DOTS; + $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($originDir, $flags), \RecursiveIteratorIterator::SELF_FIRST); + } + + foreach ($iterator as $file) { + $target = str_replace($originDir, $targetDir, $file->getPathname()); + + if ($copyOnWindows) { + if (is_link($file) || is_file($file)) { + $this->copy($file, $target, isset($options['override']) ? $options['override'] : false); + } elseif (is_dir($file)) { + $this->mkdir($target); + } else { + throw new IOException(sprintf('Unable to guess "%s" file type.', $file)); + } + } else { + if (is_link($file)) { + $this->symlink($file->getLinkTarget(), $target); + } elseif (is_dir($file)) { + $this->mkdir($target); + } elseif (is_file($file)) { + $this->copy($file, $target, isset($options['override']) ? $options['override'] : false); + } else { + throw new IOException(sprintf('Unable to guess "%s" file type.', $file)); + } + } + } + } + + /** + * Returns whether the file path is an absolute path. + * + * @param string $file A file path + * + * @return bool + */ + public function isAbsolutePath($file) + { + if (strspn($file, '/\\', 0, 1) + || (strlen($file) > 3 && ctype_alpha($file[0]) + && substr($file, 1, 1) === ':' + && (strspn($file, '/\\', 2, 1)) + ) + || null !== parse_url($file, PHP_URL_SCHEME) + ) { + return true; + } + + return false; + } + + /** + * @param mixed $files + * + * @return \Traversable + */ + private function toIterator($files) + { + if (!$files instanceof \Traversable) { + $files = new \ArrayObject(is_array($files) ? $files : array($files)); + } + + return $files; + } + + /** + * 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. + * @param null|int $mode The file mode (octal). If null, file permissions are not modified + * Deprecated since version 2.3.12, to be removed in 3.0. + * @throws IOException If the file cannot be written to. + */ + public function dumpFile($filename, $content, $mode = 0666) + { + $dir = dirname($filename); + + if (!is_dir($dir)) { + $this->mkdir($dir); + } elseif (!is_writable($dir)) { + throw new IOException(sprintf('Unable to write in the %s directory.', $dir)); + } + + $tmpFile = tempnam($dir, basename($filename)); + + if (false === @file_put_contents($tmpFile, $content)) { + throw new IOException(sprintf('Failed to write file "%s".', $filename)); + } + + $this->rename($tmpFile, $filename, true); + if (null !== $mode) { + $this->chmod($filename, $mode); + } + } +} diff --git a/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/LICENSE b/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/LICENSE new file mode 100644 index 0000000..0b3292c --- /dev/null +++ b/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2014 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/composer.json b/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/composer.json new file mode 100644 index 0000000..167dd50 --- /dev/null +++ b/sources/phpBB/vendor/symfony/filesystem/Symfony/Component/Filesystem/composer.json @@ -0,0 +1,31 @@ +{ + "name": "symfony/filesystem", + "type": "library", + "description": "Symfony Filesystem Component", + "keywords": [], + "homepage": "http://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3" + }, + "autoload": { + "psr-0": { "Symfony\\Component\\Filesystem\\": "" } + }, + "target-dir": "Symfony/Component/Filesystem", + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeader.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeader.php new file mode 100644 index 0000000..2a89a86 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeader.php @@ -0,0 +1,172 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * Represents an Accept-* header. + * + * An accept header is compound with a list of items, + * sorted by descending quality. + * + * @author Jean-François Simon + */ +class AcceptHeader +{ + /** + * @var AcceptHeaderItem[] + */ + private $items = array(); + + /** + * @var bool + */ + private $sorted = true; + + /** + * Constructor. + * + * @param AcceptHeaderItem[] $items + */ + public function __construct(array $items) + { + foreach ($items as $item) { + $this->add($item); + } + } + + /** + * Builds an AcceptHeader instance from a string. + * + * @param string $headerValue + * + * @return AcceptHeader + */ + public static function fromString($headerValue) + { + $index = 0; + + return new self(array_map(function ($itemValue) use (&$index) { + $item = AcceptHeaderItem::fromString($itemValue); + $item->setIndex($index++); + + return $item; + }, preg_split('/\s*(?:,*("[^"]+"),*|,*(\'[^\']+\'),*|,+)\s*/', $headerValue, 0, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE))); + } + + /** + * Returns header value's string representation. + * + * @return string + */ + public function __toString() + { + return implode(',', $this->items); + } + + /** + * Tests if header has given value. + * + * @param string $value + * + * @return bool + */ + public function has($value) + { + return isset($this->items[$value]); + } + + /** + * Returns given value's item, if exists. + * + * @param string $value + * + * @return AcceptHeaderItem|null + */ + public function get($value) + { + return isset($this->items[$value]) ? $this->items[$value] : null; + } + + /** + * Adds an item. + * + * @param AcceptHeaderItem $item + * + * @return AcceptHeader + */ + public function add(AcceptHeaderItem $item) + { + $this->items[$item->getValue()] = $item; + $this->sorted = false; + + return $this; + } + + /** + * Returns all items. + * + * @return AcceptHeaderItem[] + */ + public function all() + { + $this->sort(); + + return $this->items; + } + + /** + * Filters items on their value using given regex. + * + * @param string $pattern + * + * @return AcceptHeader + */ + public function filter($pattern) + { + return new self(array_filter($this->items, function (AcceptHeaderItem $item) use ($pattern) { + return preg_match($pattern, $item->getValue()); + })); + } + + /** + * Returns first item. + * + * @return AcceptHeaderItem|null + */ + public function first() + { + $this->sort(); + + return !empty($this->items) ? reset($this->items) : null; + } + + /** + * Sorts items by descending quality + */ + private function sort() + { + if (!$this->sorted) { + uasort($this->items, function ($a, $b) { + $qA = $a->getQuality(); + $qB = $b->getQuality(); + + if ($qA === $qB) { + return $a->getIndex() > $b->getIndex() ? 1 : -1; + } + + return $qA > $qB ? -1 : 1; + }); + + $this->sorted = true; + } + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeaderItem.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeaderItem.php new file mode 100644 index 0000000..21a5d15 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeaderItem.php @@ -0,0 +1,226 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * Represents an Accept-* header item. + * + * @author Jean-François Simon + */ +class AcceptHeaderItem +{ + /** + * @var string + */ + private $value; + + /** + * @var float + */ + private $quality = 1.0; + + /** + * @var int + */ + private $index = 0; + + /** + * @var array + */ + private $attributes = array(); + + /** + * Constructor. + * + * @param string $value + * @param array $attributes + */ + public function __construct($value, array $attributes = array()) + { + $this->value = $value; + foreach ($attributes as $name => $value) { + $this->setAttribute($name, $value); + } + } + + /** + * Builds an AcceptHeaderInstance instance from a string. + * + * @param string $itemValue + * + * @return AcceptHeaderItem + */ + public static function fromString($itemValue) + { + $bits = preg_split('/\s*(?:;*("[^"]+");*|;*(\'[^\']+\');*|;+)\s*/', $itemValue, 0, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); + $value = array_shift($bits); + $attributes = array(); + + $lastNullAttribute = null; + foreach ($bits as $bit) { + if (($start = substr($bit, 0, 1)) === ($end = substr($bit, -1)) && ($start === '"' || $start === '\'')) { + $attributes[$lastNullAttribute] = substr($bit, 1, -1); + } elseif ('=' === $end) { + $lastNullAttribute = $bit = substr($bit, 0, -1); + $attributes[$bit] = null; + } else { + $parts = explode('=', $bit); + $attributes[$parts[0]] = isset($parts[1]) && strlen($parts[1]) > 0 ? $parts[1] : ''; + } + } + + return new self(($start = substr($value, 0, 1)) === ($end = substr($value, -1)) && ($start === '"' || $start === '\'') ? substr($value, 1, -1) : $value, $attributes); + } + + /** + * Returns header value's string representation. + * + * @return string + */ + public function __toString() + { + $string = $this->value.($this->quality < 1 ? ';q='.$this->quality : ''); + if (count($this->attributes) > 0) { + $string .= ';'.implode(';', array_map(function ($name, $value) { + return sprintf(preg_match('/[,;=]/', $value) ? '%s="%s"' : '%s=%s', $name, $value); + }, array_keys($this->attributes), $this->attributes)); + } + + return $string; + } + + /** + * Set the item value. + * + * @param string $value + * + * @return AcceptHeaderItem + */ + public function setValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * Returns the item value. + * + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Set the item quality. + * + * @param float $quality + * + * @return AcceptHeaderItem + */ + public function setQuality($quality) + { + $this->quality = $quality; + + return $this; + } + + /** + * Returns the item quality. + * + * @return float + */ + public function getQuality() + { + return $this->quality; + } + + /** + * Set the item index. + * + * @param int $index + * + * @return AcceptHeaderItem + */ + public function setIndex($index) + { + $this->index = $index; + + return $this; + } + + /** + * Returns the item index. + * + * @return int + */ + public function getIndex() + { + return $this->index; + } + + /** + * Tests if an attribute exists. + * + * @param string $name + * + * @return bool + */ + public function hasAttribute($name) + { + return isset($this->attributes[$name]); + } + + /** + * Returns an attribute by its name. + * + * @param string $name + * @param mixed $default + * + * @return mixed + */ + public function getAttribute($name, $default = null) + { + return isset($this->attributes[$name]) ? $this->attributes[$name] : $default; + } + + /** + * Returns all attributes. + * + * @return array + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Set an attribute. + * + * @param string $name + * @param string $value + * + * @return AcceptHeaderItem + */ + public function setAttribute($name, $value) + { + if ('q' === $name) { + $this->quality = (float) $value; + } else { + $this->attributes[$name] = (string) $value; + } + + return $this; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ApacheRequest.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ApacheRequest.php new file mode 100644 index 0000000..84803eb --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ApacheRequest.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * Request represents an HTTP request from an Apache server. + * + * @author Fabien Potencier + */ +class ApacheRequest extends Request +{ + /** + * {@inheritdoc} + */ + protected function prepareRequestUri() + { + return $this->server->get('REQUEST_URI'); + } + + /** + * {@inheritdoc} + */ + protected function prepareBaseUrl() + { + $baseUrl = $this->server->get('SCRIPT_NAME'); + + if (false === strpos($this->server->get('REQUEST_URI'), $baseUrl)) { + // assume mod_rewrite + return rtrim(dirname($baseUrl), '/\\'); + } + + return $baseUrl; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/BinaryFileResponse.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/BinaryFileResponse.php new file mode 100644 index 0000000..9998577 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/BinaryFileResponse.php @@ -0,0 +1,298 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +use Symfony\Component\HttpFoundation\File\File; +use Symfony\Component\HttpFoundation\File\Exception\FileException; + +/** + * BinaryFileResponse represents an HTTP response delivering a file. + * + * @author Niklas Fiekas + * @author stealth35 + * @author Igor Wiedler + * @author Jordan Alliot + * @author Sergey Linnik + */ +class BinaryFileResponse extends Response +{ + protected static $trustXSendfileTypeHeader = false; + + protected $file; + protected $offset; + protected $maxlen; + + /** + * Constructor. + * + * @param \SplFileInfo|string $file The file to stream + * @param int $status The response status code + * @param array $headers An array of response headers + * @param bool $public Files are public by default + * @param null|string $contentDisposition The type of Content-Disposition to set automatically with the filename + * @param bool $autoEtag Whether the ETag header should be automatically set + * @param bool $autoLastModified Whether the Last-Modified header should be automatically set + */ + public function __construct($file, $status = 200, $headers = array(), $public = true, $contentDisposition = null, $autoEtag = false, $autoLastModified = true) + { + parent::__construct(null, $status, $headers); + + $this->setFile($file, $contentDisposition, $autoEtag, $autoLastModified); + + if ($public) { + $this->setPublic(); + } + } + + /** + * @param \SplFileInfo|string $file The file to stream + * @param int $status The response status code + * @param array $headers An array of response headers + * @param bool $public Files are public by default + * @param null|string $contentDisposition The type of Content-Disposition to set automatically with the filename + * @param bool $autoEtag Whether the ETag header should be automatically set + * @param bool $autoLastModified Whether the Last-Modified header should be automatically set + * + * @return BinaryResponse The created response + */ + public static function create($file = null, $status = 200, $headers = array(), $public = true, $contentDisposition = null, $autoEtag = false, $autoLastModified = true) + { + return new static($file, $status, $headers, $public, $contentDisposition, $autoEtag, $autoLastModified); + } + + /** + * Sets the file to stream. + * + * @param \SplFileInfo|string $file The file to stream + * @param string $contentDisposition + * @param bool $autoEtag + * @param bool $autoLastModified + * + * @return BinaryFileResponse + * + * @throws FileException + */ + public function setFile($file, $contentDisposition = null, $autoEtag = false, $autoLastModified = true) + { + if (!$file instanceof File) { + if ($file instanceof \SplFileInfo) { + $file = new File($file->getPathname()); + } else { + $file = new File((string) $file); + } + } + + if (!$file->isReadable()) { + throw new FileException('File must be readable.'); + } + + $this->file = $file; + + if ($autoEtag) { + $this->setAutoEtag(); + } + + if ($autoLastModified) { + $this->setAutoLastModified(); + } + + if ($contentDisposition) { + $this->setContentDisposition($contentDisposition); + } + + return $this; + } + + /** + * Gets the file. + * + * @return File The file to stream + */ + public function getFile() + { + return $this->file; + } + + /** + * Automatically sets the Last-Modified header according the file modification date. + */ + public function setAutoLastModified() + { + $this->setLastModified(\DateTime::createFromFormat('U', $this->file->getMTime())); + + return $this; + } + + /** + * Automatically sets the ETag header according to the checksum of the file. + */ + public function setAutoEtag() + { + $this->setEtag(sha1_file($this->file->getPathname())); + + return $this; + } + + /** + * Sets the Content-Disposition header with the given filename. + * + * @param string $disposition ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT + * @param string $filename Optionally use this filename instead of the real name of the file + * @param string $filenameFallback A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename + * + * @return BinaryFileResponse + */ + public function setContentDisposition($disposition, $filename = '', $filenameFallback = '') + { + if ($filename === '') { + $filename = $this->file->getFilename(); + } + + $dispositionHeader = $this->headers->makeDisposition($disposition, $filename, $filenameFallback); + $this->headers->set('Content-Disposition', $dispositionHeader); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function prepare(Request $request) + { + $this->headers->set('Content-Length', $this->file->getSize()); + $this->headers->set('Accept-Ranges', 'bytes'); + $this->headers->set('Content-Transfer-Encoding', 'binary'); + + if (!$this->headers->has('Content-Type')) { + $this->headers->set('Content-Type', $this->file->getMimeType() ?: 'application/octet-stream'); + } + + if ('HTTP/1.0' != $request->server->get('SERVER_PROTOCOL')) { + $this->setProtocolVersion('1.1'); + } + + $this->ensureIEOverSSLCompatibility($request); + + $this->offset = 0; + $this->maxlen = -1; + + if (self::$trustXSendfileTypeHeader && $request->headers->has('X-Sendfile-Type')) { + // Use X-Sendfile, do not send any content. + $type = $request->headers->get('X-Sendfile-Type'); + $path = $this->file->getRealPath(); + if (strtolower($type) == 'x-accel-redirect') { + // Do X-Accel-Mapping substitutions. + foreach (explode(',', $request->headers->get('X-Accel-Mapping', '')) as $mapping) { + $mapping = explode('=', $mapping, 2); + + if (2 == count($mapping)) { + $location = trim($mapping[0]); + $pathPrefix = trim($mapping[1]); + + if (substr($path, 0, strlen($pathPrefix)) == $pathPrefix) { + $path = $location.substr($path, strlen($pathPrefix)); + break; + } + } + } + } + $this->headers->set($type, $path); + $this->maxlen = 0; + } elseif ($request->headers->has('Range')) { + // Process the range headers. + if (!$request->headers->has('If-Range') || $this->getEtag() == $request->headers->get('If-Range')) { + $range = $request->headers->get('Range'); + $fileSize = $this->file->getSize(); + + list($start, $end) = explode('-', substr($range, 6), 2) + array(0); + + $end = ('' === $end) ? $fileSize - 1 : (int) $end; + + if ('' === $start) { + $start = $fileSize - $end; + $end = $fileSize - 1; + } else { + $start = (int) $start; + } + + if ($start <= $end) { + if ($start < 0 || $end > $fileSize - 1) { + $this->setStatusCode(416); + } elseif ($start !== 0 || $end !== $fileSize - 1) { + $this->maxlen = $end < $fileSize ? $end - $start + 1 : -1; + $this->offset = $start; + + $this->setStatusCode(206); + $this->headers->set('Content-Range', sprintf('bytes %s-%s/%s', $start, $end, $fileSize)); + $this->headers->set('Content-Length', $end - $start + 1); + } + } + } + } + + return $this; + } + + /** + * Sends the file. + */ + public function sendContent() + { + if (!$this->isSuccessful()) { + parent::sendContent(); + + return; + } + + if (0 === $this->maxlen) { + return; + } + + $out = fopen('php://output', 'wb'); + $file = fopen($this->file->getPathname(), 'rb'); + + stream_copy_to_stream($file, $out, $this->maxlen, $this->offset); + + fclose($out); + fclose($file); + } + + /** + * {@inheritdoc} + * + * @throws \LogicException when the content is not null + */ + public function setContent($content) + { + if (null !== $content) { + throw new \LogicException('The content cannot be set on a BinaryFileResponse instance.'); + } + } + + /** + * {@inheritdoc} + * + * @return false + */ + public function getContent() + { + return false; + } + + /** + * Trust X-Sendfile-Type header. + */ + public static function trustXSendfileTypeHeader() + { + self::$trustXSendfileTypeHeader = true; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Cookie.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Cookie.php new file mode 100644 index 0000000..d112123 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Cookie.php @@ -0,0 +1,210 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * Represents a cookie + * + * @author Johannes M. Schmitt + * + * @api + */ +class Cookie +{ + protected $name; + protected $value; + protected $domain; + protected $expire; + protected $path; + protected $secure; + protected $httpOnly; + + /** + * Constructor. + * + * @param string $name The name of the cookie + * @param string $value The value of the cookie + * @param int|string|\DateTime $expire The time the cookie expires + * @param string $path The path on the server in which the cookie will be available on + * @param string $domain The domain that the cookie is available to + * @param bool $secure Whether the cookie should only be transmitted over a secure HTTPS connection from the client + * @param bool $httpOnly Whether the cookie will be made accessible only through the HTTP protocol + * + * @throws \InvalidArgumentException + * + * @api + */ + public function __construct($name, $value = null, $expire = 0, $path = '/', $domain = null, $secure = false, $httpOnly = true) + { + // from PHP source code + if (preg_match("/[=,; \t\r\n\013\014]/", $name)) { + throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $name)); + } + + if (empty($name)) { + throw new \InvalidArgumentException('The cookie name cannot be empty.'); + } + + // convert expiration time to a Unix timestamp + if ($expire instanceof \DateTime) { + $expire = $expire->format('U'); + } elseif (!is_numeric($expire)) { + $expire = strtotime($expire); + + if (false === $expire || -1 === $expire) { + throw new \InvalidArgumentException('The cookie expiration time is not valid.'); + } + } + + $this->name = $name; + $this->value = $value; + $this->domain = $domain; + $this->expire = $expire; + $this->path = empty($path) ? '/' : $path; + $this->secure = (bool) $secure; + $this->httpOnly = (bool) $httpOnly; + } + + /** + * Returns the cookie as a string. + * + * @return string The cookie + */ + public function __toString() + { + $str = urlencode($this->getName()).'='; + + if ('' === (string) $this->getValue()) { + $str .= 'deleted; expires='.gmdate("D, d-M-Y H:i:s T", time() - 31536001); + } else { + $str .= urlencode($this->getValue()); + + if ($this->getExpiresTime() !== 0) { + $str .= '; expires='.gmdate("D, d-M-Y H:i:s T", $this->getExpiresTime()); + } + } + + if ($this->path) { + $str .= '; path='.$this->path; + } + + if ($this->getDomain()) { + $str .= '; domain='.$this->getDomain(); + } + + if (true === $this->isSecure()) { + $str .= '; secure'; + } + + if (true === $this->isHttpOnly()) { + $str .= '; httponly'; + } + + return $str; + } + + /** + * Gets the name of the cookie. + * + * @return string + * + * @api + */ + public function getName() + { + return $this->name; + } + + /** + * Gets the value of the cookie. + * + * @return string + * + * @api + */ + public function getValue() + { + return $this->value; + } + + /** + * Gets the domain that the cookie is available to. + * + * @return string + * + * @api + */ + public function getDomain() + { + return $this->domain; + } + + /** + * Gets the time the cookie expires. + * + * @return int + * + * @api + */ + public function getExpiresTime() + { + return $this->expire; + } + + /** + * Gets the path on the server in which the cookie will be available on. + * + * @return string + * + * @api + */ + public function getPath() + { + return $this->path; + } + + /** + * Checks whether the cookie should only be transmitted over a secure HTTPS connection from the client. + * + * @return bool + * + * @api + */ + public function isSecure() + { + return $this->secure; + } + + /** + * Checks whether the cookie will be made accessible only through the HTTP protocol. + * + * @return bool + * + * @api + */ + public function isHttpOnly() + { + return $this->httpOnly; + } + + /** + * Whether this cookie is about to be cleared + * + * @return bool + * + * @api + */ + public function isCleared() + { + return $this->expire < time(); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php new file mode 100644 index 0000000..41f7a46 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when the access on a file was denied. + * + * @author Bernhard Schussek + */ +class AccessDeniedException extends FileException +{ + /** + * Constructor. + * + * @param string $path The path to the accessed file + */ + public function __construct($path) + { + parent::__construct(sprintf('The file %s could not be accessed', $path)); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileException.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileException.php new file mode 100644 index 0000000..68f827b --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when an error occurred in the component File + * + * @author Bernhard Schussek + */ +class FileException extends \RuntimeException +{ +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php new file mode 100644 index 0000000..bd70094 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when a file was not found + * + * @author Bernhard Schussek + */ +class FileNotFoundException extends FileException +{ + /** + * Constructor. + * + * @param string $path The path to the file that was not found + */ + public function __construct($path) + { + parent::__construct(sprintf('The file "%s" does not exist', $path)); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UnexpectedTypeException.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UnexpectedTypeException.php new file mode 100644 index 0000000..0444b87 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UnexpectedTypeException.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +class UnexpectedTypeException extends FileException +{ + public function __construct($value, $expectedType) + { + parent::__construct(sprintf('Expected argument of type %s, %s given', $expectedType, is_object($value) ? get_class($value) : gettype($value))); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UploadException.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UploadException.php new file mode 100644 index 0000000..382282e --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UploadException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when an error occurred during file upload + * + * @author Bernhard Schussek + */ +class UploadException extends FileException +{ +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php new file mode 100644 index 0000000..0fdf7b0 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php @@ -0,0 +1,160 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File; + +use Symfony\Component\HttpFoundation\File\Exception\FileException; +use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; +use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser; +use Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser; + +/** + * A file in the file system. + * + * @author Bernhard Schussek + * + * @api + */ +class File extends \SplFileInfo +{ + /** + * Constructs a new file from the given path. + * + * @param string $path The path to the file + * @param bool $checkPath Whether to check the path or not + * + * @throws FileNotFoundException If the given path is not a file + * + * @api + */ + public function __construct($path, $checkPath = true) + { + if ($checkPath && !is_file($path)) { + throw new FileNotFoundException($path); + } + + parent::__construct($path); + } + + /** + * Returns the extension based on the mime type. + * + * If the mime type is unknown, returns null. + * + * This method uses the mime type as guessed by getMimeType() + * to guess the file extension. + * + * @return string|null The guessed extension or null if it cannot be guessed + * + * @api + * + * @see ExtensionGuesser + * @see getMimeType() + */ + public function guessExtension() + { + $type = $this->getMimeType(); + $guesser = ExtensionGuesser::getInstance(); + + return $guesser->guess($type); + } + + /** + * Returns the mime type of the file. + * + * The mime type is guessed using a MimeTypeGuesser instance, which uses finfo(), + * mime_content_type() and the system binary "file" (in this order), depending on + * which of those are available. + * + * @return string|null The guessed mime type (i.e. "application/pdf") + * + * @see MimeTypeGuesser + * + * @api + */ + public function getMimeType() + { + $guesser = MimeTypeGuesser::getInstance(); + + return $guesser->guess($this->getPathname()); + } + + /** + * Returns the extension of the file. + * + * \SplFileInfo::getExtension() is not available before PHP 5.3.6 + * + * @return string The extension + * + * @api + */ + public function getExtension() + { + return pathinfo($this->getBasename(), PATHINFO_EXTENSION); + } + + /** + * Moves the file to a new location. + * + * @param string $directory The destination folder + * @param string $name The new file name + * + * @return File A File object representing the new file + * + * @throws FileException if the target file could not be created + * + * @api + */ + public function move($directory, $name = null) + { + $target = $this->getTargetFile($directory, $name); + + if (!@rename($this->getPathname(), $target)) { + $error = error_get_last(); + throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error['message']))); + } + + @chmod($target, 0666 & ~umask()); + + return $target; + } + + protected function getTargetFile($directory, $name = null) + { + if (!is_dir($directory)) { + if (false === @mkdir($directory, 0777, true)) { + throw new FileException(sprintf('Unable to create the "%s" directory', $directory)); + } + } elseif (!is_writable($directory)) { + throw new FileException(sprintf('Unable to write in the "%s" directory', $directory)); + } + + $target = rtrim($directory, '/\\').DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name)); + + return new File($target, false); + } + + /** + * Returns locale independent base name of the given path. + * + * @param string $name The new file name + * + * @return string containing + */ + protected function getName($name) + { + $originalName = str_replace('\\', '/', $name); + $pos = strrpos($originalName, '/'); + $originalName = false === $pos ? $originalName : substr($originalName, $pos + 1); + + return $originalName; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php new file mode 100644 index 0000000..fe66543 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php @@ -0,0 +1,96 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\MimeType; + +/** + * A singleton mime type to file extension guesser. + * + * A default guesser is provided. + * You can register custom guessers by calling the register() + * method on the singleton instance: + * + * $guesser = ExtensionGuesser::getInstance(); + * $guesser->register(new MyCustomExtensionGuesser()); + * + * The last registered guesser is preferred over previously registered ones. + */ +class ExtensionGuesser implements ExtensionGuesserInterface +{ + /** + * The singleton instance + * + * @var ExtensionGuesser + */ + private static $instance = null; + + /** + * All registered ExtensionGuesserInterface instances + * + * @var array + */ + protected $guessers = array(); + + /** + * Returns the singleton instance + * + * @return ExtensionGuesser + */ + public static function getInstance() + { + if (null === self::$instance) { + self::$instance = new self(); + } + + return self::$instance; + } + + /** + * Registers all natively provided extension guessers + */ + private function __construct() + { + $this->register(new MimeTypeExtensionGuesser()); + } + + /** + * Registers a new extension guesser + * + * When guessing, this guesser is preferred over previously registered ones. + * + * @param ExtensionGuesserInterface $guesser + */ + public function register(ExtensionGuesserInterface $guesser) + { + array_unshift($this->guessers, $guesser); + } + + /** + * Tries to guess the extension + * + * The mime type is passed to each registered mime type guesser in reverse order + * of their registration (last registered is queried first). Once a guesser + * returns a value that is not NULL, this method terminates and returns the + * value. + * + * @param string $mimeType The mime type + * + * @return string The guessed extension or NULL, if none could be guessed + */ + public function guess($mimeType) + { + foreach ($this->guessers as $guesser) { + if (null !== $extension = $guesser->guess($mimeType)) { + return $extension; + } + } + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php new file mode 100644 index 0000000..8373696 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\MimeType; + +/** + * Guesses the file extension corresponding to a given mime type + */ +interface ExtensionGuesserInterface +{ + /** + * Makes a best guess for a file extension, given a mime type + * + * @param string $mimeType The mime type + * @return string The guessed extension or NULL, if none could be guessed + */ + public function guess($mimeType); +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php new file mode 100644 index 0000000..f3c208d --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\MimeType; + +use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; +use Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException; + +/** + * Guesses the mime type with the binary "file" (only available on *nix) + * + * @author Bernhard Schussek + */ +class FileBinaryMimeTypeGuesser implements MimeTypeGuesserInterface +{ + private $cmd; + + /** + * Constructor. + * + * The $cmd pattern must contain a "%s" string that will be replaced + * with the file name to guess. + * + * The command output must start with the mime type of the file. + * + * @param string $cmd The command to run to get the mime type of a file + */ + public function __construct($cmd = 'file -b --mime %s 2>/dev/null') + { + $this->cmd = $cmd; + } + + /** + * Returns whether this guesser is supported on the current OS + * + * @return bool + */ + public static function isSupported() + { + return !defined('PHP_WINDOWS_VERSION_BUILD') && function_exists('passthru') && function_exists('escapeshellarg'); + } + + /** + * {@inheritdoc} + */ + public function guess($path) + { + if (!is_file($path)) { + throw new FileNotFoundException($path); + } + + if (!is_readable($path)) { + throw new AccessDeniedException($path); + } + + if (!self::isSupported()) { + return; + } + + ob_start(); + + // need to use --mime instead of -i. see #6641 + passthru(sprintf($this->cmd, escapeshellarg($path)), $return); + if ($return > 0) { + ob_end_clean(); + + return; + } + + $type = trim(ob_get_clean()); + + if (!preg_match('#^([a-z0-9\-]+/[a-z0-9\-\.]+)#i', $type, $match)) { + // it's not a type, but an error message + return; + } + + return $match[1]; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php new file mode 100644 index 0000000..3b348bd --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\MimeType; + +use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; +use Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException; + +/** + * Guesses the mime type using the PECL extension FileInfo. + * + * @author Bernhard Schussek + */ +class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface +{ + private $magicFile; + + /** + * Constructor. + * + * @param string $magicFile A magic file to use with the finfo instance + * + * @link http://www.php.net/manual/en/function.finfo-open.php + */ + public function __construct($magicFile = null) + { + $this->magicFile = $magicFile; + } + + /** + * Returns whether this guesser is supported on the current OS/PHP setup + * + * @return bool + */ + public static function isSupported() + { + return function_exists('finfo_open'); + } + + /** + * {@inheritdoc} + */ + public function guess($path) + { + if (!is_file($path)) { + throw new FileNotFoundException($path); + } + + if (!is_readable($path)) { + throw new AccessDeniedException($path); + } + + if (!self::isSupported()) { + return; + } + + if (!$finfo = new \finfo(FILEINFO_MIME_TYPE, $this->magicFile)) { + return; + } + + return $finfo->file($path); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php new file mode 100644 index 0000000..75eeefb --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php @@ -0,0 +1,807 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\MimeType; + +/** + * Provides a best-guess mapping of mime type to file extension. + */ +class MimeTypeExtensionGuesser implements ExtensionGuesserInterface +{ + /** + * A map of mime types and their default extensions. + * + * This list has been placed under the public domain by the Apache HTTPD project. + * This list has been updated from upstream on 2013-04-23. + * + * @see http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types + * + * @var array + */ + protected $defaultExtensions = array( + 'application/andrew-inset' => 'ez', + 'application/applixware' => 'aw', + 'application/atom+xml' => 'atom', + 'application/atomcat+xml' => 'atomcat', + 'application/atomsvc+xml' => 'atomsvc', + 'application/ccxml+xml' => 'ccxml', + 'application/cdmi-capability' => 'cdmia', + 'application/cdmi-container' => 'cdmic', + 'application/cdmi-domain' => 'cdmid', + 'application/cdmi-object' => 'cdmio', + 'application/cdmi-queue' => 'cdmiq', + 'application/cu-seeme' => 'cu', + 'application/davmount+xml' => 'davmount', + 'application/docbook+xml' => 'dbk', + 'application/dssc+der' => 'dssc', + 'application/dssc+xml' => 'xdssc', + 'application/ecmascript' => 'ecma', + 'application/emma+xml' => 'emma', + 'application/epub+zip' => 'epub', + 'application/exi' => 'exi', + 'application/font-tdpfr' => 'pfr', + 'application/gml+xml' => 'gml', + 'application/gpx+xml' => 'gpx', + 'application/gxf' => 'gxf', + 'application/hyperstudio' => 'stk', + 'application/inkml+xml' => 'ink', + 'application/ipfix' => 'ipfix', + 'application/java-archive' => 'jar', + 'application/java-serialized-object' => 'ser', + 'application/java-vm' => 'class', + 'application/javascript' => 'js', + 'application/json' => 'json', + 'application/jsonml+json' => 'jsonml', + 'application/lost+xml' => 'lostxml', + 'application/mac-binhex40' => 'hqx', + 'application/mac-compactpro' => 'cpt', + 'application/mads+xml' => 'mads', + 'application/marc' => 'mrc', + 'application/marcxml+xml' => 'mrcx', + 'application/mathematica' => 'ma', + 'application/mathml+xml' => 'mathml', + 'application/mbox' => 'mbox', + 'application/mediaservercontrol+xml' => 'mscml', + 'application/metalink+xml' => 'metalink', + 'application/metalink4+xml' => 'meta4', + 'application/mets+xml' => 'mets', + 'application/mods+xml' => 'mods', + 'application/mp21' => 'm21', + 'application/mp4' => 'mp4s', + 'application/msword' => 'doc', + 'application/mxf' => 'mxf', + 'application/octet-stream' => 'bin', + 'application/oda' => 'oda', + 'application/oebps-package+xml' => 'opf', + 'application/ogg' => 'ogx', + 'application/omdoc+xml' => 'omdoc', + 'application/onenote' => 'onetoc', + 'application/oxps' => 'oxps', + 'application/patch-ops-error+xml' => 'xer', + 'application/pdf' => 'pdf', + 'application/pgp-encrypted' => 'pgp', + 'application/pgp-signature' => 'asc', + 'application/pics-rules' => 'prf', + 'application/pkcs10' => 'p10', + 'application/pkcs7-mime' => 'p7m', + 'application/pkcs7-signature' => 'p7s', + 'application/pkcs8' => 'p8', + 'application/pkix-attr-cert' => 'ac', + 'application/pkix-cert' => 'cer', + 'application/pkix-crl' => 'crl', + 'application/pkix-pkipath' => 'pkipath', + 'application/pkixcmp' => 'pki', + 'application/pls+xml' => 'pls', + 'application/postscript' => 'ai', + 'application/prs.cww' => 'cww', + 'application/pskc+xml' => 'pskcxml', + 'application/rdf+xml' => 'rdf', + 'application/reginfo+xml' => 'rif', + 'application/relax-ng-compact-syntax' => 'rnc', + 'application/resource-lists+xml' => 'rl', + 'application/resource-lists-diff+xml' => 'rld', + 'application/rls-services+xml' => 'rs', + 'application/rpki-ghostbusters' => 'gbr', + 'application/rpki-manifest' => 'mft', + 'application/rpki-roa' => 'roa', + 'application/rsd+xml' => 'rsd', + 'application/rss+xml' => 'rss', + 'application/rtf' => 'rtf', + 'application/sbml+xml' => 'sbml', + 'application/scvp-cv-request' => 'scq', + 'application/scvp-cv-response' => 'scs', + 'application/scvp-vp-request' => 'spq', + 'application/scvp-vp-response' => 'spp', + 'application/sdp' => 'sdp', + 'application/set-payment-initiation' => 'setpay', + 'application/set-registration-initiation' => 'setreg', + 'application/shf+xml' => 'shf', + 'application/smil+xml' => 'smi', + 'application/sparql-query' => 'rq', + 'application/sparql-results+xml' => 'srx', + 'application/srgs' => 'gram', + 'application/srgs+xml' => 'grxml', + 'application/sru+xml' => 'sru', + 'application/ssdl+xml' => 'ssdl', + 'application/ssml+xml' => 'ssml', + 'application/tei+xml' => 'tei', + 'application/thraud+xml' => 'tfi', + 'application/timestamped-data' => 'tsd', + 'application/vnd.3gpp.pic-bw-large' => 'plb', + 'application/vnd.3gpp.pic-bw-small' => 'psb', + 'application/vnd.3gpp.pic-bw-var' => 'pvb', + 'application/vnd.3gpp2.tcap' => 'tcap', + 'application/vnd.3m.post-it-notes' => 'pwn', + 'application/vnd.accpac.simply.aso' => 'aso', + 'application/vnd.accpac.simply.imp' => 'imp', + 'application/vnd.acucobol' => 'acu', + 'application/vnd.acucorp' => 'atc', + 'application/vnd.adobe.air-application-installer-package+zip' => 'air', + 'application/vnd.adobe.formscentral.fcdt' => 'fcdt', + 'application/vnd.adobe.fxp' => 'fxp', + 'application/vnd.adobe.xdp+xml' => 'xdp', + 'application/vnd.adobe.xfdf' => 'xfdf', + 'application/vnd.ahead.space' => 'ahead', + 'application/vnd.airzip.filesecure.azf' => 'azf', + 'application/vnd.airzip.filesecure.azs' => 'azs', + 'application/vnd.amazon.ebook' => 'azw', + 'application/vnd.americandynamics.acc' => 'acc', + 'application/vnd.amiga.ami' => 'ami', + 'application/vnd.android.package-archive' => 'apk', + 'application/vnd.anser-web-certificate-issue-initiation' => 'cii', + 'application/vnd.anser-web-funds-transfer-initiation' => 'fti', + 'application/vnd.antix.game-component' => 'atx', + 'application/vnd.apple.installer+xml' => 'mpkg', + 'application/vnd.apple.mpegurl' => 'm3u8', + 'application/vnd.aristanetworks.swi' => 'swi', + 'application/vnd.astraea-software.iota' => 'iota', + 'application/vnd.audiograph' => 'aep', + 'application/vnd.blueice.multipass' => 'mpm', + 'application/vnd.bmi' => 'bmi', + 'application/vnd.businessobjects' => 'rep', + 'application/vnd.chemdraw+xml' => 'cdxml', + 'application/vnd.chipnuts.karaoke-mmd' => 'mmd', + 'application/vnd.cinderella' => 'cdy', + 'application/vnd.claymore' => 'cla', + 'application/vnd.cloanto.rp9' => 'rp9', + 'application/vnd.clonk.c4group' => 'c4g', + 'application/vnd.cluetrust.cartomobile-config' => 'c11amc', + 'application/vnd.cluetrust.cartomobile-config-pkg' => 'c11amz', + 'application/vnd.commonspace' => 'csp', + 'application/vnd.contact.cmsg' => 'cdbcmsg', + 'application/vnd.cosmocaller' => 'cmc', + 'application/vnd.crick.clicker' => 'clkx', + 'application/vnd.crick.clicker.keyboard' => 'clkk', + 'application/vnd.crick.clicker.palette' => 'clkp', + 'application/vnd.crick.clicker.template' => 'clkt', + 'application/vnd.crick.clicker.wordbank' => 'clkw', + 'application/vnd.criticaltools.wbs+xml' => 'wbs', + 'application/vnd.ctc-posml' => 'pml', + 'application/vnd.cups-ppd' => 'ppd', + 'application/vnd.curl.car' => 'car', + 'application/vnd.curl.pcurl' => 'pcurl', + 'application/vnd.dart' => 'dart', + 'application/vnd.data-vision.rdz' => 'rdz', + 'application/vnd.dece.data' => 'uvf', + 'application/vnd.dece.ttml+xml' => 'uvt', + 'application/vnd.dece.unspecified' => 'uvx', + 'application/vnd.dece.zip' => 'uvz', + 'application/vnd.denovo.fcselayout-link' => 'fe_launch', + 'application/vnd.dna' => 'dna', + 'application/vnd.dolby.mlp' => 'mlp', + 'application/vnd.dpgraph' => 'dpg', + 'application/vnd.dreamfactory' => 'dfac', + 'application/vnd.ds-keypoint' => 'kpxx', + 'application/vnd.dvb.ait' => 'ait', + 'application/vnd.dvb.service' => 'svc', + 'application/vnd.dynageo' => 'geo', + 'application/vnd.ecowin.chart' => 'mag', + 'application/vnd.enliven' => 'nml', + 'application/vnd.epson.esf' => 'esf', + 'application/vnd.epson.msf' => 'msf', + 'application/vnd.epson.quickanime' => 'qam', + 'application/vnd.epson.salt' => 'slt', + 'application/vnd.epson.ssf' => 'ssf', + 'application/vnd.eszigno3+xml' => 'es3', + 'application/vnd.ezpix-album' => 'ez2', + 'application/vnd.ezpix-package' => 'ez3', + 'application/vnd.fdf' => 'fdf', + 'application/vnd.fdsn.mseed' => 'mseed', + 'application/vnd.fdsn.seed' => 'seed', + 'application/vnd.flographit' => 'gph', + 'application/vnd.fluxtime.clip' => 'ftc', + 'application/vnd.framemaker' => 'fm', + 'application/vnd.frogans.fnc' => 'fnc', + 'application/vnd.frogans.ltf' => 'ltf', + 'application/vnd.fsc.weblaunch' => 'fsc', + 'application/vnd.fujitsu.oasys' => 'oas', + 'application/vnd.fujitsu.oasys2' => 'oa2', + 'application/vnd.fujitsu.oasys3' => 'oa3', + 'application/vnd.fujitsu.oasysgp' => 'fg5', + 'application/vnd.fujitsu.oasysprs' => 'bh2', + 'application/vnd.fujixerox.ddd' => 'ddd', + 'application/vnd.fujixerox.docuworks' => 'xdw', + 'application/vnd.fujixerox.docuworks.binder' => 'xbd', + 'application/vnd.fuzzysheet' => 'fzs', + 'application/vnd.genomatix.tuxedo' => 'txd', + 'application/vnd.geogebra.file' => 'ggb', + 'application/vnd.geogebra.tool' => 'ggt', + 'application/vnd.geometry-explorer' => 'gex', + 'application/vnd.geonext' => 'gxt', + 'application/vnd.geoplan' => 'g2w', + 'application/vnd.geospace' => 'g3w', + 'application/vnd.gmx' => 'gmx', + 'application/vnd.google-earth.kml+xml' => 'kml', + 'application/vnd.google-earth.kmz' => 'kmz', + 'application/vnd.grafeq' => 'gqf', + 'application/vnd.groove-account' => 'gac', + 'application/vnd.groove-help' => 'ghf', + 'application/vnd.groove-identity-message' => 'gim', + 'application/vnd.groove-injector' => 'grv', + 'application/vnd.groove-tool-message' => 'gtm', + 'application/vnd.groove-tool-template' => 'tpl', + 'application/vnd.groove-vcard' => 'vcg', + 'application/vnd.hal+xml' => 'hal', + 'application/vnd.handheld-entertainment+xml' => 'zmm', + 'application/vnd.hbci' => 'hbci', + 'application/vnd.hhe.lesson-player' => 'les', + 'application/vnd.hp-hpgl' => 'hpgl', + 'application/vnd.hp-hpid' => 'hpid', + 'application/vnd.hp-hps' => 'hps', + 'application/vnd.hp-jlyt' => 'jlt', + 'application/vnd.hp-pcl' => 'pcl', + 'application/vnd.hp-pclxl' => 'pclxl', + 'application/vnd.hydrostatix.sof-data' => 'sfd-hdstx', + 'application/vnd.ibm.minipay' => 'mpy', + 'application/vnd.ibm.modcap' => 'afp', + 'application/vnd.ibm.rights-management' => 'irm', + 'application/vnd.ibm.secure-container' => 'sc', + 'application/vnd.iccprofile' => 'icc', + 'application/vnd.igloader' => 'igl', + 'application/vnd.immervision-ivp' => 'ivp', + 'application/vnd.immervision-ivu' => 'ivu', + 'application/vnd.insors.igm' => 'igm', + 'application/vnd.intercon.formnet' => 'xpw', + 'application/vnd.intergeo' => 'i2g', + 'application/vnd.intu.qbo' => 'qbo', + 'application/vnd.intu.qfx' => 'qfx', + 'application/vnd.ipunplugged.rcprofile' => 'rcprofile', + 'application/vnd.irepository.package+xml' => 'irp', + 'application/vnd.is-xpr' => 'xpr', + 'application/vnd.isac.fcs' => 'fcs', + 'application/vnd.jam' => 'jam', + 'application/vnd.jcp.javame.midlet-rms' => 'rms', + 'application/vnd.jisp' => 'jisp', + 'application/vnd.joost.joda-archive' => 'joda', + 'application/vnd.kahootz' => 'ktz', + 'application/vnd.kde.karbon' => 'karbon', + 'application/vnd.kde.kchart' => 'chrt', + 'application/vnd.kde.kformula' => 'kfo', + 'application/vnd.kde.kivio' => 'flw', + 'application/vnd.kde.kontour' => 'kon', + 'application/vnd.kde.kpresenter' => 'kpr', + 'application/vnd.kde.kspread' => 'ksp', + 'application/vnd.kde.kword' => 'kwd', + 'application/vnd.kenameaapp' => 'htke', + 'application/vnd.kidspiration' => 'kia', + 'application/vnd.kinar' => 'kne', + 'application/vnd.koan' => 'skp', + 'application/vnd.kodak-descriptor' => 'sse', + 'application/vnd.las.las+xml' => 'lasxml', + 'application/vnd.llamagraphics.life-balance.desktop' => 'lbd', + 'application/vnd.llamagraphics.life-balance.exchange+xml' => 'lbe', + 'application/vnd.lotus-1-2-3' => '123', + 'application/vnd.lotus-approach' => 'apr', + 'application/vnd.lotus-freelance' => 'pre', + 'application/vnd.lotus-notes' => 'nsf', + 'application/vnd.lotus-organizer' => 'org', + 'application/vnd.lotus-screencam' => 'scm', + 'application/vnd.lotus-wordpro' => 'lwp', + 'application/vnd.macports.portpkg' => 'portpkg', + 'application/vnd.mcd' => 'mcd', + 'application/vnd.medcalcdata' => 'mc1', + 'application/vnd.mediastation.cdkey' => 'cdkey', + 'application/vnd.mfer' => 'mwf', + 'application/vnd.mfmp' => 'mfm', + 'application/vnd.micrografx.flo' => 'flo', + 'application/vnd.micrografx.igx' => 'igx', + 'application/vnd.mif' => 'mif', + 'application/vnd.mobius.daf' => 'daf', + 'application/vnd.mobius.dis' => 'dis', + 'application/vnd.mobius.mbk' => 'mbk', + 'application/vnd.mobius.mqy' => 'mqy', + 'application/vnd.mobius.msl' => 'msl', + 'application/vnd.mobius.plc' => 'plc', + 'application/vnd.mobius.txf' => 'txf', + 'application/vnd.mophun.application' => 'mpn', + 'application/vnd.mophun.certificate' => 'mpc', + 'application/vnd.mozilla.xul+xml' => 'xul', + 'application/vnd.ms-artgalry' => 'cil', + 'application/vnd.ms-cab-compressed' => 'cab', + 'application/vnd.ms-excel' => 'xls', + 'application/vnd.ms-excel.addin.macroenabled.12' => 'xlam', + 'application/vnd.ms-excel.sheet.binary.macroenabled.12' => 'xlsb', + 'application/vnd.ms-excel.sheet.macroenabled.12' => 'xlsm', + 'application/vnd.ms-excel.template.macroenabled.12' => 'xltm', + 'application/vnd.ms-fontobject' => 'eot', + 'application/vnd.ms-htmlhelp' => 'chm', + 'application/vnd.ms-ims' => 'ims', + 'application/vnd.ms-lrm' => 'lrm', + 'application/vnd.ms-officetheme' => 'thmx', + 'application/vnd.ms-pki.seccat' => 'cat', + 'application/vnd.ms-pki.stl' => 'stl', + 'application/vnd.ms-powerpoint' => 'ppt', + 'application/vnd.ms-powerpoint.addin.macroenabled.12' => 'ppam', + 'application/vnd.ms-powerpoint.presentation.macroenabled.12' => 'pptm', + 'application/vnd.ms-powerpoint.slide.macroenabled.12' => 'sldm', + 'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => 'ppsm', + 'application/vnd.ms-powerpoint.template.macroenabled.12' => 'potm', + 'application/vnd.ms-project' => 'mpp', + 'application/vnd.ms-word.document.macroenabled.12' => 'docm', + 'application/vnd.ms-word.template.macroenabled.12' => 'dotm', + 'application/vnd.ms-works' => 'wps', + 'application/vnd.ms-wpl' => 'wpl', + 'application/vnd.ms-xpsdocument' => 'xps', + 'application/vnd.mseq' => 'mseq', + 'application/vnd.musician' => 'mus', + 'application/vnd.muvee.style' => 'msty', + 'application/vnd.mynfc' => 'taglet', + 'application/vnd.neurolanguage.nlu' => 'nlu', + 'application/vnd.nitf' => 'ntf', + 'application/vnd.noblenet-directory' => 'nnd', + 'application/vnd.noblenet-sealer' => 'nns', + 'application/vnd.noblenet-web' => 'nnw', + 'application/vnd.nokia.n-gage.data' => 'ngdat', + 'application/vnd.nokia.n-gage.symbian.install' => 'n-gage', + 'application/vnd.nokia.radio-preset' => 'rpst', + 'application/vnd.nokia.radio-presets' => 'rpss', + 'application/vnd.novadigm.edm' => 'edm', + 'application/vnd.novadigm.edx' => 'edx', + 'application/vnd.novadigm.ext' => 'ext', + 'application/vnd.oasis.opendocument.chart' => 'odc', + 'application/vnd.oasis.opendocument.chart-template' => 'otc', + 'application/vnd.oasis.opendocument.database' => 'odb', + 'application/vnd.oasis.opendocument.formula' => 'odf', + 'application/vnd.oasis.opendocument.formula-template' => 'odft', + 'application/vnd.oasis.opendocument.graphics' => 'odg', + 'application/vnd.oasis.opendocument.graphics-template' => 'otg', + 'application/vnd.oasis.opendocument.image' => 'odi', + 'application/vnd.oasis.opendocument.image-template' => 'oti', + 'application/vnd.oasis.opendocument.presentation' => 'odp', + 'application/vnd.oasis.opendocument.presentation-template' => 'otp', + 'application/vnd.oasis.opendocument.spreadsheet' => 'ods', + 'application/vnd.oasis.opendocument.spreadsheet-template' => 'ots', + 'application/vnd.oasis.opendocument.text' => 'odt', + 'application/vnd.oasis.opendocument.text-master' => 'odm', + 'application/vnd.oasis.opendocument.text-template' => 'ott', + 'application/vnd.oasis.opendocument.text-web' => 'oth', + 'application/vnd.olpc-sugar' => 'xo', + 'application/vnd.oma.dd2+xml' => 'dd2', + 'application/vnd.openofficeorg.extension' => 'oxt', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx', + 'application/vnd.openxmlformats-officedocument.presentationml.slide' => 'sldx', + 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'ppsx', + 'application/vnd.openxmlformats-officedocument.presentationml.template' => 'potx', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => 'xltx', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => 'dotx', + 'application/vnd.osgeo.mapguide.package' => 'mgp', + 'application/vnd.osgi.dp' => 'dp', + 'application/vnd.osgi.subsystem' => 'esa', + 'application/vnd.palm' => 'pdb', + 'application/vnd.pawaafile' => 'paw', + 'application/vnd.pg.format' => 'str', + 'application/vnd.pg.osasli' => 'ei6', + 'application/vnd.picsel' => 'efif', + 'application/vnd.pmi.widget' => 'wg', + 'application/vnd.pocketlearn' => 'plf', + 'application/vnd.powerbuilder6' => 'pbd', + 'application/vnd.previewsystems.box' => 'box', + 'application/vnd.proteus.magazine' => 'mgz', + 'application/vnd.publishare-delta-tree' => 'qps', + 'application/vnd.pvi.ptid1' => 'ptid', + 'application/vnd.quark.quarkxpress' => 'qxd', + 'application/vnd.realvnc.bed' => 'bed', + 'application/vnd.recordare.musicxml' => 'mxl', + 'application/vnd.recordare.musicxml+xml' => 'musicxml', + 'application/vnd.rig.cryptonote' => 'cryptonote', + 'application/vnd.rim.cod' => 'cod', + 'application/vnd.rn-realmedia' => 'rm', + 'application/vnd.rn-realmedia-vbr' => 'rmvb', + 'application/vnd.route66.link66+xml' => 'link66', + 'application/vnd.sailingtracker.track' => 'st', + 'application/vnd.seemail' => 'see', + 'application/vnd.sema' => 'sema', + 'application/vnd.semd' => 'semd', + 'application/vnd.semf' => 'semf', + 'application/vnd.shana.informed.formdata' => 'ifm', + 'application/vnd.shana.informed.formtemplate' => 'itp', + 'application/vnd.shana.informed.interchange' => 'iif', + 'application/vnd.shana.informed.package' => 'ipk', + 'application/vnd.simtech-mindmapper' => 'twd', + 'application/vnd.smaf' => 'mmf', + 'application/vnd.smart.teacher' => 'teacher', + 'application/vnd.solent.sdkm+xml' => 'sdkm', + 'application/vnd.spotfire.dxp' => 'dxp', + 'application/vnd.spotfire.sfs' => 'sfs', + 'application/vnd.stardivision.calc' => 'sdc', + 'application/vnd.stardivision.draw' => 'sda', + 'application/vnd.stardivision.impress' => 'sdd', + 'application/vnd.stardivision.math' => 'smf', + 'application/vnd.stardivision.writer' => 'sdw', + 'application/vnd.stardivision.writer-global' => 'sgl', + 'application/vnd.stepmania.package' => 'smzip', + 'application/vnd.stepmania.stepchart' => 'sm', + 'application/vnd.sun.xml.calc' => 'sxc', + 'application/vnd.sun.xml.calc.template' => 'stc', + 'application/vnd.sun.xml.draw' => 'sxd', + 'application/vnd.sun.xml.draw.template' => 'std', + 'application/vnd.sun.xml.impress' => 'sxi', + 'application/vnd.sun.xml.impress.template' => 'sti', + 'application/vnd.sun.xml.math' => 'sxm', + 'application/vnd.sun.xml.writer' => 'sxw', + 'application/vnd.sun.xml.writer.global' => 'sxg', + 'application/vnd.sun.xml.writer.template' => 'stw', + 'application/vnd.sus-calendar' => 'sus', + 'application/vnd.svd' => 'svd', + 'application/vnd.symbian.install' => 'sis', + 'application/vnd.syncml+xml' => 'xsm', + 'application/vnd.syncml.dm+wbxml' => 'bdm', + 'application/vnd.syncml.dm+xml' => 'xdm', + 'application/vnd.tao.intent-module-archive' => 'tao', + 'application/vnd.tcpdump.pcap' => 'pcap', + 'application/vnd.tmobile-livetv' => 'tmo', + 'application/vnd.trid.tpt' => 'tpt', + 'application/vnd.triscape.mxs' => 'mxs', + 'application/vnd.trueapp' => 'tra', + 'application/vnd.ufdl' => 'ufd', + 'application/vnd.uiq.theme' => 'utz', + 'application/vnd.umajin' => 'umj', + 'application/vnd.unity' => 'unityweb', + 'application/vnd.uoml+xml' => 'uoml', + 'application/vnd.vcx' => 'vcx', + 'application/vnd.visio' => 'vsd', + 'application/vnd.visionary' => 'vis', + 'application/vnd.vsf' => 'vsf', + 'application/vnd.wap.wbxml' => 'wbxml', + 'application/vnd.wap.wmlc' => 'wmlc', + 'application/vnd.wap.wmlscriptc' => 'wmlsc', + 'application/vnd.webturbo' => 'wtb', + 'application/vnd.wolfram.player' => 'nbp', + 'application/vnd.wordperfect' => 'wpd', + 'application/vnd.wqd' => 'wqd', + 'application/vnd.wt.stf' => 'stf', + 'application/vnd.xara' => 'xar', + 'application/vnd.xfdl' => 'xfdl', + 'application/vnd.yamaha.hv-dic' => 'hvd', + 'application/vnd.yamaha.hv-script' => 'hvs', + 'application/vnd.yamaha.hv-voice' => 'hvp', + 'application/vnd.yamaha.openscoreformat' => 'osf', + 'application/vnd.yamaha.openscoreformat.osfpvg+xml' => 'osfpvg', + 'application/vnd.yamaha.smaf-audio' => 'saf', + 'application/vnd.yamaha.smaf-phrase' => 'spf', + 'application/vnd.yellowriver-custom-menu' => 'cmp', + 'application/vnd.zul' => 'zir', + 'application/vnd.zzazz.deck+xml' => 'zaz', + 'application/voicexml+xml' => 'vxml', + 'application/widget' => 'wgt', + 'application/winhlp' => 'hlp', + 'application/wsdl+xml' => 'wsdl', + 'application/wspolicy+xml' => 'wspolicy', + 'application/x-7z-compressed' => '7z', + 'application/x-abiword' => 'abw', + 'application/x-ace-compressed' => 'ace', + 'application/x-apple-diskimage' => 'dmg', + 'application/x-authorware-bin' => 'aab', + 'application/x-authorware-map' => 'aam', + 'application/x-authorware-seg' => 'aas', + 'application/x-bcpio' => 'bcpio', + 'application/x-bittorrent' => 'torrent', + 'application/x-blorb' => 'blb', + 'application/x-bzip' => 'bz', + 'application/x-bzip2' => 'bz2', + 'application/x-cbr' => 'cbr', + 'application/x-cdlink' => 'vcd', + 'application/x-cfs-compressed' => 'cfs', + 'application/x-chat' => 'chat', + 'application/x-chess-pgn' => 'pgn', + 'application/x-conference' => 'nsc', + 'application/x-cpio' => 'cpio', + 'application/x-csh' => 'csh', + 'application/x-debian-package' => 'deb', + 'application/x-dgc-compressed' => 'dgc', + 'application/x-director' => 'dir', + 'application/x-doom' => 'wad', + 'application/x-dtbncx+xml' => 'ncx', + 'application/x-dtbook+xml' => 'dtb', + 'application/x-dtbresource+xml' => 'res', + 'application/x-dvi' => 'dvi', + 'application/x-envoy' => 'evy', + 'application/x-eva' => 'eva', + 'application/x-font-bdf' => 'bdf', + 'application/x-font-ghostscript' => 'gsf', + 'application/x-font-linux-psf' => 'psf', + 'application/x-font-otf' => 'otf', + 'application/x-font-pcf' => 'pcf', + 'application/x-font-snf' => 'snf', + 'application/x-font-ttf' => 'ttf', + 'application/x-font-type1' => 'pfa', + 'application/x-font-woff' => 'woff', + 'application/x-freearc' => 'arc', + 'application/x-futuresplash' => 'spl', + 'application/x-gca-compressed' => 'gca', + 'application/x-glulx' => 'ulx', + 'application/x-gnumeric' => 'gnumeric', + 'application/x-gramps-xml' => 'gramps', + 'application/x-gtar' => 'gtar', + 'application/x-hdf' => 'hdf', + 'application/x-install-instructions' => 'install', + 'application/x-iso9660-image' => 'iso', + 'application/x-java-jnlp-file' => 'jnlp', + 'application/x-latex' => 'latex', + 'application/x-lzh-compressed' => 'lzh', + 'application/x-mie' => 'mie', + 'application/x-mobipocket-ebook' => 'prc', + 'application/x-ms-application' => 'application', + 'application/x-ms-shortcut' => 'lnk', + 'application/x-ms-wmd' => 'wmd', + 'application/x-ms-wmz' => 'wmz', + 'application/x-ms-xbap' => 'xbap', + 'application/x-msaccess' => 'mdb', + 'application/x-msbinder' => 'obd', + 'application/x-mscardfile' => 'crd', + 'application/x-msclip' => 'clp', + 'application/x-msdownload' => 'exe', + 'application/x-msmediaview' => 'mvb', + 'application/x-msmetafile' => 'wmf', + 'application/x-msmoney' => 'mny', + 'application/x-mspublisher' => 'pub', + 'application/x-msschedule' => 'scd', + 'application/x-msterminal' => 'trm', + 'application/x-mswrite' => 'wri', + 'application/x-netcdf' => 'nc', + 'application/x-nzb' => 'nzb', + 'application/x-pkcs12' => 'p12', + 'application/x-pkcs7-certificates' => 'p7b', + 'application/x-pkcs7-certreqresp' => 'p7r', + 'application/x-rar-compressed' => 'rar', + 'application/x-rar' => 'rar', + 'application/x-research-info-systems' => 'ris', + 'application/x-sh' => 'sh', + 'application/x-shar' => 'shar', + 'application/x-shockwave-flash' => 'swf', + 'application/x-silverlight-app' => 'xap', + 'application/x-sql' => 'sql', + 'application/x-stuffit' => 'sit', + 'application/x-stuffitx' => 'sitx', + 'application/x-subrip' => 'srt', + 'application/x-sv4cpio' => 'sv4cpio', + 'application/x-sv4crc' => 'sv4crc', + 'application/x-t3vm-image' => 't3', + 'application/x-tads' => 'gam', + 'application/x-tar' => 'tar', + 'application/x-tcl' => 'tcl', + 'application/x-tex' => 'tex', + 'application/x-tex-tfm' => 'tfm', + 'application/x-texinfo' => 'texinfo', + 'application/x-tgif' => 'obj', + 'application/x-ustar' => 'ustar', + 'application/x-wais-source' => 'src', + 'application/x-x509-ca-cert' => 'der', + 'application/x-xfig' => 'fig', + 'application/x-xliff+xml' => 'xlf', + 'application/x-xpinstall' => 'xpi', + 'application/x-xz' => 'xz', + 'application/x-zmachine' => 'z1', + 'application/xaml+xml' => 'xaml', + 'application/xcap-diff+xml' => 'xdf', + 'application/xenc+xml' => 'xenc', + 'application/xhtml+xml' => 'xhtml', + 'application/xml' => 'xml', + 'application/xml-dtd' => 'dtd', + 'application/xop+xml' => 'xop', + 'application/xproc+xml' => 'xpl', + 'application/xslt+xml' => 'xslt', + 'application/xspf+xml' => 'xspf', + 'application/xv+xml' => 'mxml', + 'application/yang' => 'yang', + 'application/yin+xml' => 'yin', + 'application/zip' => 'zip', + 'audio/adpcm' => 'adp', + 'audio/basic' => 'au', + 'audio/midi' => 'mid', + 'audio/mp4' => 'mp4a', + 'audio/mpeg' => 'mpga', + 'audio/ogg' => 'oga', + 'audio/s3m' => 's3m', + 'audio/silk' => 'sil', + 'audio/vnd.dece.audio' => 'uva', + 'audio/vnd.digital-winds' => 'eol', + 'audio/vnd.dra' => 'dra', + 'audio/vnd.dts' => 'dts', + 'audio/vnd.dts.hd' => 'dtshd', + 'audio/vnd.lucent.voice' => 'lvp', + 'audio/vnd.ms-playready.media.pya' => 'pya', + 'audio/vnd.nuera.ecelp4800' => 'ecelp4800', + 'audio/vnd.nuera.ecelp7470' => 'ecelp7470', + 'audio/vnd.nuera.ecelp9600' => 'ecelp9600', + 'audio/vnd.rip' => 'rip', + 'audio/webm' => 'weba', + 'audio/x-aac' => 'aac', + 'audio/x-aiff' => 'aif', + 'audio/x-caf' => 'caf', + 'audio/x-flac' => 'flac', + 'audio/x-matroska' => 'mka', + 'audio/x-mpegurl' => 'm3u', + 'audio/x-ms-wax' => 'wax', + 'audio/x-ms-wma' => 'wma', + 'audio/x-pn-realaudio' => 'ram', + 'audio/x-pn-realaudio-plugin' => 'rmp', + 'audio/x-wav' => 'wav', + 'audio/xm' => 'xm', + 'chemical/x-cdx' => 'cdx', + 'chemical/x-cif' => 'cif', + 'chemical/x-cmdf' => 'cmdf', + 'chemical/x-cml' => 'cml', + 'chemical/x-csml' => 'csml', + 'chemical/x-xyz' => 'xyz', + 'image/bmp' => 'bmp', + 'image/x-ms-bmp' => 'bmp', + 'image/cgm' => 'cgm', + 'image/g3fax' => 'g3', + 'image/gif' => 'gif', + 'image/ief' => 'ief', + 'image/jpeg' => 'jpeg', + 'image/ktx' => 'ktx', + 'image/png' => 'png', + 'image/prs.btif' => 'btif', + 'image/sgi' => 'sgi', + 'image/svg+xml' => 'svg', + 'image/tiff' => 'tiff', + 'image/vnd.adobe.photoshop' => 'psd', + 'image/vnd.dece.graphic' => 'uvi', + 'image/vnd.dvb.subtitle' => 'sub', + 'image/vnd.djvu' => 'djvu', + 'image/vnd.dwg' => 'dwg', + 'image/vnd.dxf' => 'dxf', + 'image/vnd.fastbidsheet' => 'fbs', + 'image/vnd.fpx' => 'fpx', + 'image/vnd.fst' => 'fst', + 'image/vnd.fujixerox.edmics-mmr' => 'mmr', + 'image/vnd.fujixerox.edmics-rlc' => 'rlc', + 'image/vnd.ms-modi' => 'mdi', + 'image/vnd.ms-photo' => 'wdp', + 'image/vnd.net-fpx' => 'npx', + 'image/vnd.wap.wbmp' => 'wbmp', + 'image/vnd.xiff' => 'xif', + 'image/webp' => 'webp', + 'image/x-3ds' => '3ds', + 'image/x-cmu-raster' => 'ras', + 'image/x-cmx' => 'cmx', + 'image/x-freehand' => 'fh', + 'image/x-icon' => 'ico', + 'image/x-mrsid-image' => 'sid', + 'image/x-pcx' => 'pcx', + 'image/x-pict' => 'pic', + 'image/x-portable-anymap' => 'pnm', + 'image/x-portable-bitmap' => 'pbm', + 'image/x-portable-graymap' => 'pgm', + 'image/x-portable-pixmap' => 'ppm', + 'image/x-rgb' => 'rgb', + 'image/x-tga' => 'tga', + 'image/x-xbitmap' => 'xbm', + 'image/x-xpixmap' => 'xpm', + 'image/x-xwindowdump' => 'xwd', + 'message/rfc822' => 'eml', + 'model/iges' => 'igs', + 'model/mesh' => 'msh', + 'model/vnd.collada+xml' => 'dae', + 'model/vnd.dwf' => 'dwf', + 'model/vnd.gdl' => 'gdl', + 'model/vnd.gtw' => 'gtw', + 'model/vnd.mts' => 'mts', + 'model/vnd.vtu' => 'vtu', + 'model/vrml' => 'wrl', + 'model/x3d+binary' => 'x3db', + 'model/x3d+vrml' => 'x3dv', + 'model/x3d+xml' => 'x3d', + 'text/cache-manifest' => 'appcache', + 'text/calendar' => 'ics', + 'text/css' => 'css', + 'text/csv' => 'csv', + 'text/html' => 'html', + 'text/n3' => 'n3', + 'text/plain' => 'txt', + 'text/prs.lines.tag' => 'dsc', + 'text/richtext' => 'rtx', + 'text/rtf' => 'rtf', + 'text/sgml' => 'sgml', + 'text/tab-separated-values' => 'tsv', + 'text/troff' => 't', + 'text/turtle' => 'ttl', + 'text/uri-list' => 'uri', + 'text/vcard' => 'vcard', + 'text/vnd.curl' => 'curl', + 'text/vnd.curl.dcurl' => 'dcurl', + 'text/vnd.curl.scurl' => 'scurl', + 'text/vnd.curl.mcurl' => 'mcurl', + 'text/vnd.dvb.subtitle' => 'sub', + 'text/vnd.fly' => 'fly', + 'text/vnd.fmi.flexstor' => 'flx', + 'text/vnd.graphviz' => 'gv', + 'text/vnd.in3d.3dml' => '3dml', + 'text/vnd.in3d.spot' => 'spot', + 'text/vnd.sun.j2me.app-descriptor' => 'jad', + 'text/vnd.wap.wml' => 'wml', + 'text/vnd.wap.wmlscript' => 'wmls', + 'text/x-asm' => 's', + 'text/x-c' => 'c', + 'text/x-fortran' => 'f', + 'text/x-pascal' => 'p', + 'text/x-java-source' => 'java', + 'text/x-opml' => 'opml', + 'text/x-nfo' => 'nfo', + 'text/x-setext' => 'etx', + 'text/x-sfv' => 'sfv', + 'text/x-uuencode' => 'uu', + 'text/x-vcalendar' => 'vcs', + 'text/x-vcard' => 'vcf', + 'video/3gpp' => '3gp', + 'video/3gpp2' => '3g2', + 'video/h261' => 'h261', + 'video/h263' => 'h263', + 'video/h264' => 'h264', + 'video/jpeg' => 'jpgv', + 'video/jpm' => 'jpm', + 'video/mj2' => 'mj2', + 'video/mp4' => 'mp4', + 'video/mpeg' => 'mpeg', + 'video/ogg' => 'ogv', + 'video/quicktime' => 'qt', + 'video/vnd.dece.hd' => 'uvh', + 'video/vnd.dece.mobile' => 'uvm', + 'video/vnd.dece.pd' => 'uvp', + 'video/vnd.dece.sd' => 'uvs', + 'video/vnd.dece.video' => 'uvv', + 'video/vnd.dvb.file' => 'dvb', + 'video/vnd.fvt' => 'fvt', + 'video/vnd.mpegurl' => 'mxu', + 'video/vnd.ms-playready.media.pyv' => 'pyv', + 'video/vnd.uvvu.mp4' => 'uvu', + 'video/vnd.vivo' => 'viv', + 'video/webm' => 'webm', + 'video/x-f4v' => 'f4v', + 'video/x-fli' => 'fli', + 'video/x-flv' => 'flv', + 'video/x-m4v' => 'm4v', + 'video/x-matroska' => 'mkv', + 'video/x-mng' => 'mng', + 'video/x-ms-asf' => 'asf', + 'video/x-ms-vob' => 'vob', + 'video/x-ms-wm' => 'wm', + 'video/x-ms-wmv' => 'wmv', + 'video/x-ms-wmx' => 'wmx', + 'video/x-ms-wvx' => 'wvx', + 'video/x-msvideo' => 'avi', + 'video/x-sgi-movie' => 'movie', + 'video/x-smv' => 'smv', + 'x-conference/x-cooltalk' => 'ice', + ); + + /** + * {@inheritdoc} + */ + public function guess($mimeType) + { + return isset($this->defaultExtensions[$mimeType]) ? $this->defaultExtensions[$mimeType] : null; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php new file mode 100644 index 0000000..f6bf2cd --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php @@ -0,0 +1,132 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\MimeType; + +use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; +use Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException; + +/** + * A singleton mime type guesser. + * + * By default, all mime type guessers provided by the framework are installed + * (if available on the current OS/PHP setup). + * + * You can register custom guessers by calling the register() method on the + * singleton instance. Custom guessers are always called before any default ones. + * + * $guesser = MimeTypeGuesser::getInstance(); + * $guesser->register(new MyCustomMimeTypeGuesser()); + * + * If you want to change the order of the default guessers, just re-register your + * preferred one as a custom one. The last registered guesser is preferred over + * previously registered ones. + * + * Re-registering a built-in guesser also allows you to configure it: + * + * $guesser = MimeTypeGuesser::getInstance(); + * $guesser->register(new FileinfoMimeTypeGuesser('/path/to/magic/file')); + * + * @author Bernhard Schussek + */ +class MimeTypeGuesser implements MimeTypeGuesserInterface +{ + /** + * The singleton instance + * + * @var MimeTypeGuesser + */ + private static $instance = null; + + /** + * All registered MimeTypeGuesserInterface instances + * + * @var array + */ + protected $guessers = array(); + + /** + * Returns the singleton instance + * + * @return MimeTypeGuesser + */ + public static function getInstance() + { + if (null === self::$instance) { + self::$instance = new self(); + } + + return self::$instance; + } + + /** + * Registers all natively provided mime type guessers + */ + private function __construct() + { + if (FileBinaryMimeTypeGuesser::isSupported()) { + $this->register(new FileBinaryMimeTypeGuesser()); + } + + if (FileinfoMimeTypeGuesser::isSupported()) { + $this->register(new FileinfoMimeTypeGuesser()); + } + } + + /** + * Registers a new mime type guesser + * + * When guessing, this guesser is preferred over previously registered ones. + * + * @param MimeTypeGuesserInterface $guesser + */ + public function register(MimeTypeGuesserInterface $guesser) + { + array_unshift($this->guessers, $guesser); + } + + /** + * Tries to guess the mime type of the given file + * + * The file is passed to each registered mime type guesser in reverse order + * of their registration (last registered is queried first). Once a guesser + * returns a value that is not NULL, this method terminates and returns the + * value. + * + * @param string $path The path to the file + * + * @return string The mime type or NULL, if none could be guessed + * + * @throws \LogicException + * @throws FileNotFoundException + * @throws AccessDeniedException + */ + public function guess($path) + { + if (!is_file($path)) { + throw new FileNotFoundException($path); + } + + if (!is_readable($path)) { + throw new AccessDeniedException($path); + } + + if (!$this->guessers) { + throw new \LogicException('Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?)'); + } + + foreach ($this->guessers as $guesser) { + if (null !== $mimeType = $guesser->guess($path)) { + return $mimeType; + } + } + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php new file mode 100644 index 0000000..87ea20f --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\MimeType; + +use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; +use Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException; + +/** + * Guesses the mime type of a file + * + * @author Bernhard Schussek + */ +interface MimeTypeGuesserInterface +{ + /** + * Guesses the mime type of the file with the given path. + * + * @param string $path The path to the file + * + * @return string The mime type or NULL, if none could be guessed + * + * @throws FileNotFoundException If the file does not exist + * @throws AccessDeniedException If the file could not be read + */ + public function guess($path); +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php new file mode 100644 index 0000000..d729546 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php @@ -0,0 +1,310 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File; + +use Symfony\Component\HttpFoundation\File\Exception\FileException; +use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; +use Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser; + +/** + * A file uploaded through a form. + * + * @author Bernhard Schussek + * @author Florian Eckerstorfer + * @author Fabien Potencier + * + * @api + */ +class UploadedFile extends File +{ + /** + * Whether the test mode is activated. + * + * Local files are used in test mode hence the code should not enforce HTTP uploads. + * + * @var bool + */ + private $test = false; + + /** + * The original name of the uploaded file. + * + * @var string + */ + private $originalName; + + /** + * The mime type provided by the uploader. + * + * @var string + */ + private $mimeType; + + /** + * The file size provided by the uploader. + * + * @var string + */ + private $size; + + /** + * The UPLOAD_ERR_XXX constant provided by the uploader. + * + * @var int + */ + private $error; + + /** + * Accepts the information of the uploaded file as provided by the PHP global $_FILES. + * + * The file object is only created when the uploaded file is valid (i.e. when the + * isValid() method returns true). Otherwise the only methods that could be called + * on an UploadedFile instance are: + * + * * getClientOriginalName, + * * getClientMimeType, + * * isValid, + * * getError. + * + * Calling any other method on an non-valid instance will cause an unpredictable result. + * + * @param string $path The full temporary path to the file + * @param string $originalName The original file name + * @param string $mimeType The type of the file as provided by PHP + * @param int $size The file size + * @param int $error The error constant of the upload (one of PHP's UPLOAD_ERR_XXX constants) + * @param bool $test Whether the test mode is active + * + * @throws FileException If file_uploads is disabled + * @throws FileNotFoundException If the file does not exist + * + * @api + */ + public function __construct($path, $originalName, $mimeType = null, $size = null, $error = null, $test = false) + { + $this->originalName = $this->getName($originalName); + $this->mimeType = $mimeType ?: 'application/octet-stream'; + $this->size = $size; + $this->error = $error ?: UPLOAD_ERR_OK; + $this->test = (bool) $test; + + parent::__construct($path, UPLOAD_ERR_OK === $this->error); + } + + /** + * Returns the original file name. + * + * It is extracted from the request from which the file has been uploaded. + * Then it should not be considered as a safe value. + * + * @return string|null The original name + * + * @api + */ + public function getClientOriginalName() + { + return $this->originalName; + } + + /** + * Returns the original file extension + * + * It is extracted from the original file name that was uploaded. + * Then it should not be considered as a safe value. + * + * @return string The extension + */ + public function getClientOriginalExtension() + { + return pathinfo($this->originalName, PATHINFO_EXTENSION); + } + + /** + * Returns the file mime type. + * + * The client mime type is extracted from the request from which the file + * was uploaded, so it should not be considered as a safe value. + * + * For a trusted mime type, use getMimeType() instead (which guesses the mime + * type based on the file content). + * + * @return string|null The mime type + * + * @see getMimeType + * + * @api + */ + public function getClientMimeType() + { + return $this->mimeType; + } + + /** + * Returns the extension based on the client mime type. + * + * If the mime type is unknown, returns null. + * + * This method uses the mime type as guessed by getClientMimeType() + * to guess the file extension. As such, the extension returned + * by this method cannot be trusted. + * + * For a trusted extension, use guessExtension() instead (which guesses + * the extension based on the guessed mime type for the file). + * + * @return string|null The guessed extension or null if it cannot be guessed + * + * @see guessExtension() + * @see getClientMimeType() + */ + public function guessClientExtension() + { + $type = $this->getClientMimeType(); + $guesser = ExtensionGuesser::getInstance(); + + return $guesser->guess($type); + } + + /** + * Returns the file size. + * + * It is extracted from the request from which the file has been uploaded. + * Then it should not be considered as a safe value. + * + * @return int|null The file size + * + * @api + */ + public function getClientSize() + { + return $this->size; + } + + /** + * Returns the upload error. + * + * If the upload was successful, the constant UPLOAD_ERR_OK is returned. + * Otherwise one of the other UPLOAD_ERR_XXX constants is returned. + * + * @return int The upload error + * + * @api + */ + public function getError() + { + return $this->error; + } + + /** + * Returns whether the file was uploaded successfully. + * + * @return bool True if the file has been uploaded with HTTP and no error occurred. + * + * @api + */ + public function isValid() + { + $isOk = $this->error === UPLOAD_ERR_OK; + + return $this->test ? $isOk : $isOk && is_uploaded_file($this->getPathname()); + } + + /** + * Moves the file to a new location. + * + * @param string $directory The destination folder + * @param string $name The new file name + * + * @return File A File object representing the new file + * + * @throws FileException if, for any reason, the file could not have been moved + * + * @api + */ + public function move($directory, $name = null) + { + if ($this->isValid()) { + if ($this->test) { + return parent::move($directory, $name); + } + + $target = $this->getTargetFile($directory, $name); + + if (!@move_uploaded_file($this->getPathname(), $target)) { + $error = error_get_last(); + throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error['message']))); + } + + @chmod($target, 0666 & ~umask()); + + return $target; + } + + throw new FileException($this->getErrorMessage($this->getError())); + } + + /** + * Returns the maximum size of an uploaded file as configured in php.ini + * + * @return int The maximum size of an uploaded file in bytes + */ + public static function getMaxFilesize() + { + $iniMax = strtolower(ini_get('upload_max_filesize')); + + if ('' === $iniMax) { + return PHP_INT_MAX; + } + + $max = ltrim($iniMax, '+'); + if (0 === strpos($max, '0x')) { + $max = intval($max, 16); + } elseif (0 === strpos($max, '0')) { + $max = intval($max, 8); + } else { + $max = intval($max); + } + + switch (substr($iniMax, -1)) { + case 't': $max *= 1024; + case 'g': $max *= 1024; + case 'm': $max *= 1024; + case 'k': $max *= 1024; + } + + return $max; + } + + /** + * Returns an informative upload error message. + * + * @param int $errorCode The error code returned by an upload attempt + * + * @return string The error message regarding the specified error code + */ + private function getErrorMessage($errorCode) + { + static $errors = array( + UPLOAD_ERR_INI_SIZE => 'The file "%s" exceeds your upload_max_filesize ini directive (limit is %d kb).', + UPLOAD_ERR_FORM_SIZE => 'The file "%s" exceeds the upload limit defined in your form.', + UPLOAD_ERR_PARTIAL => 'The file "%s" was only partially uploaded.', + UPLOAD_ERR_NO_FILE => 'No file was uploaded.', + UPLOAD_ERR_CANT_WRITE => 'The file "%s" could not be written on disk.', + UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.', + UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.', + ); + + $maxFilesize = $errorCode === UPLOAD_ERR_INI_SIZE ? self::getMaxFilesize() / 1024 : 0; + $message = isset($errors[$errorCode]) ? $errors[$errorCode] : 'The file "%s" was not uploaded due to an unknown error.'; + + return sprintf($message, $this->getClientOriginalName(), $maxFilesize); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php new file mode 100644 index 0000000..699e408 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php @@ -0,0 +1,155 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +use Symfony\Component\HttpFoundation\File\UploadedFile; + +/** + * FileBag is a container for uploaded files. + * + * @author Fabien Potencier + * @author Bulat Shakirzyanov + * + * @api + */ +class FileBag extends ParameterBag +{ + private static $fileKeys = array('error', 'name', 'size', 'tmp_name', 'type'); + + /** + * Constructor. + * + * @param array $parameters An array of HTTP files + * + * @api + */ + public function __construct(array $parameters = array()) + { + $this->replace($parameters); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function replace(array $files = array()) + { + $this->parameters = array(); + $this->add($files); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function set($key, $value) + { + if (!is_array($value) && !$value instanceof UploadedFile) { + throw new \InvalidArgumentException('An uploaded file must be an array or an instance of UploadedFile.'); + } + + parent::set($key, $this->convertFileInformation($value)); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function add(array $files = array()) + { + foreach ($files as $key => $file) { + $this->set($key, $file); + } + } + + /** + * Converts uploaded files to UploadedFile instances. + * + * @param array|UploadedFile $file A (multi-dimensional) array of uploaded file information + * + * @return array A (multi-dimensional) array of UploadedFile instances + */ + protected function convertFileInformation($file) + { + if ($file instanceof UploadedFile) { + return $file; + } + + $file = $this->fixPhpFilesArray($file); + if (is_array($file)) { + $keys = array_keys($file); + sort($keys); + + if ($keys == self::$fileKeys) { + if (UPLOAD_ERR_NO_FILE == $file['error']) { + $file = null; + } else { + $file = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['size'], $file['error']); + } + } else { + $file = array_map(array($this, 'convertFileInformation'), $file); + } + } + + return $file; + } + + /** + * Fixes a malformed PHP $_FILES array. + * + * PHP has a bug that the format of the $_FILES array differs, depending on + * whether the uploaded file fields had normal field names or array-like + * field names ("normal" vs. "parent[child]"). + * + * This method fixes the array to look like the "normal" $_FILES array. + * + * It's safe to pass an already converted array, in which case this method + * just returns the original array unmodified. + * + * @param array $data + * + * @return array + */ + protected function fixPhpFilesArray($data) + { + if (!is_array($data)) { + return $data; + } + + $keys = array_keys($data); + sort($keys); + + if (self::$fileKeys != $keys || !isset($data['name']) || !is_array($data['name'])) { + return $data; + } + + $files = $data; + foreach (self::$fileKeys as $k) { + unset($files[$k]); + } + + foreach (array_keys($data['name']) as $key) { + $files[$key] = $this->fixPhpFilesArray(array( + 'error' => $data['error'][$key], + 'name' => $data['name'][$key], + 'type' => $data['type'][$key], + 'tmp_name' => $data['tmp_name'][$key], + 'size' => $data['size'][$key], + )); + } + + return $files; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php new file mode 100644 index 0000000..354980d --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php @@ -0,0 +1,350 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * HeaderBag is a container for HTTP headers. + * + * @author Fabien Potencier + * + * @api + */ +class HeaderBag implements \IteratorAggregate, \Countable +{ + protected $headers; + protected $cacheControl; + + /** + * Constructor. + * + * @param array $headers An array of HTTP headers + * + * @api + */ + public function __construct(array $headers = array()) + { + $this->cacheControl = array(); + $this->headers = array(); + foreach ($headers as $key => $values) { + $this->set($key, $values); + } + } + + /** + * Returns the headers as a string. + * + * @return string The headers + */ + public function __toString() + { + if (!$this->headers) { + return ''; + } + + $max = max(array_map('strlen', array_keys($this->headers))) + 1; + $content = ''; + ksort($this->headers); + foreach ($this->headers as $name => $values) { + $name = implode('-', array_map('ucfirst', explode('-', $name))); + foreach ($values as $value) { + $content .= sprintf("%-{$max}s %s\r\n", $name.':', $value); + } + } + + return $content; + } + + /** + * Returns the headers. + * + * @return array An array of headers + * + * @api + */ + public function all() + { + return $this->headers; + } + + /** + * Returns the parameter keys. + * + * @return array An array of parameter keys + * + * @api + */ + public function keys() + { + return array_keys($this->headers); + } + + /** + * Replaces the current HTTP headers by a new set. + * + * @param array $headers An array of HTTP headers + * + * @api + */ + public function replace(array $headers = array()) + { + $this->headers = array(); + $this->add($headers); + } + + /** + * Adds new headers the current HTTP headers set. + * + * @param array $headers An array of HTTP headers + * + * @api + */ + public function add(array $headers) + { + foreach ($headers as $key => $values) { + $this->set($key, $values); + } + } + + /** + * Returns a header value by name. + * + * @param string $key The header name + * @param mixed $default The default value + * @param bool $first Whether to return the first value or all header values + * + * @return string|array The first header value if $first is true, an array of values otherwise + * + * @api + */ + public function get($key, $default = null, $first = true) + { + $key = strtr(strtolower($key), '_', '-'); + + if (!array_key_exists($key, $this->headers)) { + if (null === $default) { + return $first ? null : array(); + } + + return $first ? $default : array($default); + } + + if ($first) { + return count($this->headers[$key]) ? $this->headers[$key][0] : $default; + } + + return $this->headers[$key]; + } + + /** + * Sets a header by name. + * + * @param string $key The key + * @param string|array $values The value or an array of values + * @param bool $replace Whether to replace the actual value or not (true by default) + * + * @api + */ + public function set($key, $values, $replace = true) + { + $key = strtr(strtolower($key), '_', '-'); + + $values = array_values((array) $values); + + if (true === $replace || !isset($this->headers[$key])) { + $this->headers[$key] = $values; + } else { + $this->headers[$key] = array_merge($this->headers[$key], $values); + } + + if ('cache-control' === $key) { + $this->cacheControl = $this->parseCacheControl($values[0]); + } + } + + /** + * Returns true if the HTTP header is defined. + * + * @param string $key The HTTP header + * + * @return bool true if the parameter exists, false otherwise + * + * @api + */ + public function has($key) + { + return array_key_exists(strtr(strtolower($key), '_', '-'), $this->headers); + } + + /** + * Returns true if the given HTTP header contains the given value. + * + * @param string $key The HTTP header name + * @param string $value The HTTP value + * + * @return bool true if the value is contained in the header, false otherwise + * + * @api + */ + public function contains($key, $value) + { + return in_array($value, $this->get($key, null, false)); + } + + /** + * Removes a header. + * + * @param string $key The HTTP header name + * + * @api + */ + public function remove($key) + { + $key = strtr(strtolower($key), '_', '-'); + + unset($this->headers[$key]); + + if ('cache-control' === $key) { + $this->cacheControl = array(); + } + } + + /** + * Returns the HTTP header value converted to a date. + * + * @param string $key The parameter key + * @param \DateTime $default The default value + * + * @return null|\DateTime The parsed DateTime or the default value if the header does not exist + * + * @throws \RuntimeException When the HTTP header is not parseable + * + * @api + */ + public function getDate($key, \DateTime $default = null) + { + if (null === $value = $this->get($key)) { + return $default; + } + + if (false === $date = \DateTime::createFromFormat(DATE_RFC2822, $value)) { + throw new \RuntimeException(sprintf('The %s HTTP header is not parseable (%s).', $key, $value)); + } + + return $date; + } + + /** + * Adds a custom Cache-Control directive. + * + * @param string $key The Cache-Control directive name + * @param mixed $value The Cache-Control directive value + */ + public function addCacheControlDirective($key, $value = true) + { + $this->cacheControl[$key] = $value; + + $this->set('Cache-Control', $this->getCacheControlHeader()); + } + + /** + * Returns true if the Cache-Control directive is defined. + * + * @param string $key The Cache-Control directive + * + * @return bool true if the directive exists, false otherwise + */ + public function hasCacheControlDirective($key) + { + return array_key_exists($key, $this->cacheControl); + } + + /** + * Returns a Cache-Control directive value by name. + * + * @param string $key The directive name + * + * @return mixed|null The directive value if defined, null otherwise + */ + public function getCacheControlDirective($key) + { + return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null; + } + + /** + * Removes a Cache-Control directive. + * + * @param string $key The Cache-Control directive + */ + public function removeCacheControlDirective($key) + { + unset($this->cacheControl[$key]); + + $this->set('Cache-Control', $this->getCacheControlHeader()); + } + + /** + * Returns an iterator for headers. + * + * @return \ArrayIterator An \ArrayIterator instance + */ + public function getIterator() + { + return new \ArrayIterator($this->headers); + } + + /** + * Returns the number of headers. + * + * @return int The number of headers + */ + public function count() + { + return count($this->headers); + } + + protected function getCacheControlHeader() + { + $parts = array(); + ksort($this->cacheControl); + foreach ($this->cacheControl as $key => $value) { + if (true === $value) { + $parts[] = $key; + } else { + if (preg_match('#[^a-zA-Z0-9._-]#', $value)) { + $value = '"'.$value.'"'; + } + + $parts[] = "$key=$value"; + } + } + + return implode(', ', $parts); + } + + /** + * Parses a Cache-Control HTTP header. + * + * @param string $header The value of the Cache-Control HTTP header + * + * @return array An array representing the attribute values + */ + protected function parseCacheControl($header) + { + $cacheControl = array(); + preg_match_all('#([a-zA-Z][a-zA-Z_-]*)\s*(?:=(?:"([^"]*)"|([^ \t",;]*)))?#', $header, $matches, PREG_SET_ORDER); + foreach ($matches as $match) { + $cacheControl[strtolower($match[1])] = isset($match[3]) ? $match[3] : (isset($match[2]) ? $match[2] : true); + } + + return $cacheControl; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/IpUtils.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/IpUtils.php new file mode 100644 index 0000000..892503e --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/IpUtils.php @@ -0,0 +1,123 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * Http utility functions. + * + * @author Fabien Potencier + */ +class IpUtils +{ + /** + * This class should not be instantiated + */ + private function __construct() + { + } + + /** + * Checks if an IPv4 or IPv6 address is contained in the list of given IPs or subnets + * + * @param string $requestIp IP to check + * @param string|array $ips List of IPs or subnets (can be a string if only a single one) + * + * @return bool Whether the IP is valid + */ + public static function checkIp($requestIp, $ips) + { + if (!is_array($ips)) { + $ips = array($ips); + } + + $method = false !== strpos($requestIp, ':') ? 'checkIp6' : 'checkIp4'; + + foreach ($ips as $ip) { + if (self::$method($requestIp, $ip)) { + return true; + } + } + + return false; + } + + /** + * Compares two IPv4 addresses. + * In case a subnet is given, it checks if it contains the request IP. + * + * @param string $requestIp IPv4 address to check + * @param string $ip IPv4 address or subnet in CIDR notation + * + * @return bool Whether the IP is valid + */ + public static function checkIp4($requestIp, $ip) + { + if (false !== strpos($ip, '/')) { + list($address, $netmask) = explode('/', $ip, 2); + + if ($netmask < 1 || $netmask > 32) { + return false; + } + } else { + $address = $ip; + $netmask = 32; + } + + return 0 === substr_compare(sprintf('%032b', ip2long($requestIp)), sprintf('%032b', ip2long($address)), 0, $netmask); + } + + /** + * Compares two IPv6 addresses. + * In case a subnet is given, it checks if it contains the request IP. + * + * @author David Soria Parra + * @see https://github.com/dsp/v6tools + * + * @param string $requestIp IPv6 address to check + * @param string $ip IPv6 address or subnet in CIDR notation + * + * @return bool Whether the IP is valid + * + * @throws \RuntimeException When IPV6 support is not enabled + */ + public static function checkIp6($requestIp, $ip) + { + if (!((extension_loaded('sockets') && defined('AF_INET6')) || @inet_pton('::1'))) { + throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".'); + } + + if (false !== strpos($ip, '/')) { + list($address, $netmask) = explode('/', $ip, 2); + + if ($netmask < 1 || $netmask > 128) { + return false; + } + } else { + $address = $ip; + $netmask = 128; + } + + $bytesAddr = unpack("n*", inet_pton($address)); + $bytesTest = unpack("n*", inet_pton($requestIp)); + + for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; $i++) { + $left = $netmask - 16 * ($i-1); + $left = ($left <= 16) ? $left : 16; + $mask = ~(0xffff >> $left) & 0xffff; + if (($bytesAddr[$i] & $mask) != ($bytesTest[$i] & $mask)) { + return false; + } + } + + return true; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php new file mode 100644 index 0000000..83a607c --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php @@ -0,0 +1,152 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * Response represents an HTTP response in JSON format. + * + * Note that this class does not force the returned JSON content to be an + * object. It is however recommended that you do return an object as it + * protects yourself against XSSI and JSON-JavaScript Hijacking. + * + * @see https://www.owasp.org/index.php/OWASP_AJAX_Security_Guidelines#Always_return_JSON_with_an_Object_on_the_outside + * + * @author Igor Wiedler + */ +class JsonResponse extends Response +{ + protected $data; + protected $callback; + + /** + * Constructor. + * + * @param mixed $data The response data + * @param int $status The response status code + * @param array $headers An array of response headers + */ + public function __construct($data = null, $status = 200, $headers = array()) + { + parent::__construct('', $status, $headers); + + if (null === $data) { + $data = new \ArrayObject(); + } + $this->setData($data); + } + + /** + * {@inheritdoc} + */ + public static function create($data = null, $status = 200, $headers = array()) + { + return new static($data, $status, $headers); + } + + /** + * Sets the JSONP callback. + * + * @param string $callback + * + * @return JsonResponse + * + * @throws \InvalidArgumentException + */ + public function setCallback($callback = null) + { + if (null !== $callback) { + // taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/ + $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*+$/u'; + $parts = explode('.', $callback); + foreach ($parts as $part) { + if (!preg_match($pattern, $part)) { + throw new \InvalidArgumentException('The callback name is not valid.'); + } + } + } + + $this->callback = $callback; + + return $this->update(); + } + + /** + * Sets the data to be sent as json. + * + * @param mixed $data + * + * @return JsonResponse + * + * @throws \InvalidArgumentException + */ + public function setData($data = array()) + { + // Encode <, >, ', &, and " for RFC4627-compliant JSON, which may also be embedded into HTML. + $this->data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT); + + if (JSON_ERROR_NONE !== json_last_error()) { + throw new \InvalidArgumentException($this->transformJsonError()); + } + + return $this->update(); + } + + /** + * Updates the content and headers according to the json data and callback. + * + * @return JsonResponse + */ + protected function update() + { + if (null !== $this->callback) { + // Not using application/javascript for compatibility reasons with older browsers. + $this->headers->set('Content-Type', 'text/javascript'); + + return $this->setContent(sprintf('/**/%s(%s);', $this->callback, $this->data)); + } + + // Only set the header when there is none or when it equals 'text/javascript' (from a previous update with callback) + // in order to not overwrite a custom definition. + if (!$this->headers->has('Content-Type') || 'text/javascript' === $this->headers->get('Content-Type')) { + $this->headers->set('Content-Type', 'application/json'); + } + + return $this->setContent($this->data); + } + + private function transformJsonError() + { + if (function_exists('json_last_error_msg')) { + return json_last_error_msg(); + } + + switch (json_last_error()) { + case JSON_ERROR_DEPTH: + return 'Maximum stack depth exceeded.'; + + case JSON_ERROR_STATE_MISMATCH: + return 'Underflow or the modes mismatch.'; + + case JSON_ERROR_CTRL_CHAR: + return 'Unexpected control character found.'; + + case JSON_ERROR_SYNTAX: + return 'Syntax error, malformed JSON.'; + + case JSON_ERROR_UTF8: + return 'Malformed UTF-8 characters, possibly incorrectly encoded.'; + + default: + return 'Unknown error.'; + } + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/LICENSE b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/LICENSE new file mode 100644 index 0000000..0b3292c --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2014 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php new file mode 100644 index 0000000..8791275 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php @@ -0,0 +1,305 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * ParameterBag is a container for key/value pairs. + * + * @author Fabien Potencier + * + * @api + */ +class ParameterBag implements \IteratorAggregate, \Countable +{ + /** + * Parameter storage. + * + * @var array + */ + protected $parameters; + + /** + * Constructor. + * + * @param array $parameters An array of parameters + * + * @api + */ + public function __construct(array $parameters = array()) + { + $this->parameters = $parameters; + } + + /** + * Returns the parameters. + * + * @return array An array of parameters + * + * @api + */ + public function all() + { + return $this->parameters; + } + + /** + * Returns the parameter keys. + * + * @return array An array of parameter keys + * + * @api + */ + public function keys() + { + return array_keys($this->parameters); + } + + /** + * Replaces the current parameters by a new set. + * + * @param array $parameters An array of parameters + * + * @api + */ + public function replace(array $parameters = array()) + { + $this->parameters = $parameters; + } + + /** + * Adds parameters. + * + * @param array $parameters An array of parameters + * + * @api + */ + public function add(array $parameters = array()) + { + $this->parameters = array_replace($this->parameters, $parameters); + } + + /** + * Returns a parameter by name. + * + * @param string $path The key + * @param mixed $default The default value if the parameter key does not exist + * @param bool $deep If true, a path like foo[bar] will find deeper items + * + * @return mixed + * + * @throws \InvalidArgumentException + * + * @api + */ + public function get($path, $default = null, $deep = false) + { + if (!$deep || false === $pos = strpos($path, '[')) { + return array_key_exists($path, $this->parameters) ? $this->parameters[$path] : $default; + } + + $root = substr($path, 0, $pos); + if (!array_key_exists($root, $this->parameters)) { + return $default; + } + + $value = $this->parameters[$root]; + $currentKey = null; + for ($i = $pos, $c = strlen($path); $i < $c; $i++) { + $char = $path[$i]; + + if ('[' === $char) { + if (null !== $currentKey) { + throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "[" at position %d.', $i)); + } + + $currentKey = ''; + } elseif (']' === $char) { + if (null === $currentKey) { + throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "]" at position %d.', $i)); + } + + if (!is_array($value) || !array_key_exists($currentKey, $value)) { + return $default; + } + + $value = $value[$currentKey]; + $currentKey = null; + } else { + if (null === $currentKey) { + throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "%s" at position %d.', $char, $i)); + } + + $currentKey .= $char; + } + } + + if (null !== $currentKey) { + throw new \InvalidArgumentException(sprintf('Malformed path. Path must end with "]".')); + } + + return $value; + } + + /** + * Sets a parameter by name. + * + * @param string $key The key + * @param mixed $value The value + * + * @api + */ + public function set($key, $value) + { + $this->parameters[$key] = $value; + } + + /** + * Returns true if the parameter is defined. + * + * @param string $key The key + * + * @return bool true if the parameter exists, false otherwise + * + * @api + */ + public function has($key) + { + return array_key_exists($key, $this->parameters); + } + + /** + * Removes a parameter. + * + * @param string $key The key + * + * @api + */ + public function remove($key) + { + unset($this->parameters[$key]); + } + + /** + * Returns the alphabetic characters of the parameter value. + * + * @param string $key The parameter key + * @param mixed $default The default value if the parameter key does not exist + * @param bool $deep If true, a path like foo[bar] will find deeper items + * + * @return string The filtered value + * + * @api + */ + public function getAlpha($key, $default = '', $deep = false) + { + return preg_replace('/[^[:alpha:]]/', '', $this->get($key, $default, $deep)); + } + + /** + * Returns the alphabetic characters and digits of the parameter value. + * + * @param string $key The parameter key + * @param mixed $default The default value if the parameter key does not exist + * @param bool $deep If true, a path like foo[bar] will find deeper items + * + * @return string The filtered value + * + * @api + */ + public function getAlnum($key, $default = '', $deep = false) + { + return preg_replace('/[^[:alnum:]]/', '', $this->get($key, $default, $deep)); + } + + /** + * Returns the digits of the parameter value. + * + * @param string $key The parameter key + * @param mixed $default The default value if the parameter key does not exist + * @param bool $deep If true, a path like foo[bar] will find deeper items + * + * @return string The filtered value + * + * @api + */ + public function getDigits($key, $default = '', $deep = false) + { + // we need to remove - and + because they're allowed in the filter + return str_replace(array('-', '+'), '', $this->filter($key, $default, $deep, FILTER_SANITIZE_NUMBER_INT)); + } + + /** + * Returns the parameter value converted to integer. + * + * @param string $key The parameter key + * @param mixed $default The default value if the parameter key does not exist + * @param bool $deep If true, a path like foo[bar] will find deeper items + * + * @return int The filtered value + * + * @api + */ + public function getInt($key, $default = 0, $deep = false) + { + return (int) $this->get($key, $default, $deep); + } + + /** + * Filter key. + * + * @param string $key Key. + * @param mixed $default Default = null. + * @param bool $deep Default = false. + * @param int $filter FILTER_* constant. + * @param mixed $options Filter options. + * + * @see http://php.net/manual/en/function.filter-var.php + * + * @return mixed + */ + public function filter($key, $default = null, $deep = false, $filter = FILTER_DEFAULT, $options = array()) + { + $value = $this->get($key, $default, $deep); + + // Always turn $options into an array - this allows filter_var option shortcuts. + if (!is_array($options) && $options) { + $options = array('flags' => $options); + } + + // Add a convenience check for arrays. + if (is_array($value) && !isset($options['flags'])) { + $options['flags'] = FILTER_REQUIRE_ARRAY; + } + + return filter_var($value, $filter, $options); + } + + /** + * Returns an iterator for parameters. + * + * @return \ArrayIterator An \ArrayIterator instance + */ + public function getIterator() + { + return new \ArrayIterator($this->parameters); + } + + /** + * Returns the number of parameters. + * + * @return int The number of parameters + */ + public function count() + { + return count($this->parameters); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RedirectResponse.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RedirectResponse.php new file mode 100644 index 0000000..ccd50f7 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RedirectResponse.php @@ -0,0 +1,106 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * RedirectResponse represents an HTTP response doing a redirect. + * + * @author Fabien Potencier + * + * @api + */ +class RedirectResponse extends Response +{ + protected $targetUrl; + + /** + * Creates a redirect response so that it conforms to the rules defined for a redirect status code. + * + * @param string $url The URL to redirect to + * @param int $status The status code (302 by default) + * @param array $headers The headers (Location is always set to the given URL) + * + * @throws \InvalidArgumentException + * + * @see http://tools.ietf.org/html/rfc2616#section-10.3 + * + * @api + */ + public function __construct($url, $status = 302, $headers = array()) + { + if (empty($url)) { + throw new \InvalidArgumentException('Cannot redirect to an empty URL.'); + } + + parent::__construct('', $status, $headers); + + $this->setTargetUrl($url); + + if (!$this->isRedirect()) { + throw new \InvalidArgumentException(sprintf('The HTTP status code is not a redirect ("%s" given).', $status)); + } + } + + /** + * {@inheritdoc} + */ + public static function create($url = '', $status = 302, $headers = array()) + { + return new static($url, $status, $headers); + } + + /** + * Returns the target URL. + * + * @return string target URL + */ + public function getTargetUrl() + { + return $this->targetUrl; + } + + /** + * Sets the redirect target of this response. + * + * @param string $url The URL to redirect to + * + * @return RedirectResponse The current response. + * + * @throws \InvalidArgumentException + */ + public function setTargetUrl($url) + { + if (empty($url)) { + throw new \InvalidArgumentException('Cannot redirect to an empty URL.'); + } + + $this->targetUrl = $url; + + $this->setContent( + sprintf(' + + + + + + Redirecting to %1$s + + + Redirecting to %1$s. + +', htmlspecialchars($url, ENT_QUOTES, 'UTF-8'))); + + $this->headers->set('Location', $url); + + return $this; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php new file mode 100644 index 0000000..9fd02cc --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php @@ -0,0 +1,1822 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +use Symfony\Component\HttpFoundation\Session\SessionInterface; + +/** + * Request represents an HTTP request. + * + * The methods dealing with URL accept / return a raw path (% encoded): + * * getBasePath + * * getBaseUrl + * * getPathInfo + * * getRequestUri + * * getUri + * * getUriForPath + * + * @author Fabien Potencier + * + * @api + */ +class Request +{ + const HEADER_CLIENT_IP = 'client_ip'; + const HEADER_CLIENT_HOST = 'client_host'; + const HEADER_CLIENT_PROTO = 'client_proto'; + const HEADER_CLIENT_PORT = 'client_port'; + + protected static $trustedProxies = array(); + + /** + * @var string[] + */ + protected static $trustedHostPatterns = array(); + + /** + * @var string[] + */ + protected static $trustedHosts = array(); + + /** + * Names for headers that can be trusted when + * using trusted proxies. + * + * The default names are non-standard, but widely used + * by popular reverse proxies (like Apache mod_proxy or Amazon EC2). + */ + protected static $trustedHeaders = array( + self::HEADER_CLIENT_IP => 'X_FORWARDED_FOR', + self::HEADER_CLIENT_HOST => 'X_FORWARDED_HOST', + self::HEADER_CLIENT_PROTO => 'X_FORWARDED_PROTO', + self::HEADER_CLIENT_PORT => 'X_FORWARDED_PORT', + ); + + protected static $httpMethodParameterOverride = false; + + /** + * Custom parameters + * + * @var \Symfony\Component\HttpFoundation\ParameterBag + * + * @api + */ + public $attributes; + + /** + * Request body parameters ($_POST) + * + * @var \Symfony\Component\HttpFoundation\ParameterBag + * + * @api + */ + public $request; + + /** + * Query string parameters ($_GET) + * + * @var \Symfony\Component\HttpFoundation\ParameterBag + * + * @api + */ + public $query; + + /** + * Server and execution environment parameters ($_SERVER) + * + * @var \Symfony\Component\HttpFoundation\ServerBag + * + * @api + */ + public $server; + + /** + * Uploaded files ($_FILES) + * + * @var \Symfony\Component\HttpFoundation\FileBag + * + * @api + */ + public $files; + + /** + * Cookies ($_COOKIE) + * + * @var \Symfony\Component\HttpFoundation\ParameterBag + * + * @api + */ + public $cookies; + + /** + * Headers (taken from the $_SERVER) + * + * @var \Symfony\Component\HttpFoundation\HeaderBag + * + * @api + */ + public $headers; + + /** + * @var string + */ + protected $content; + + /** + * @var array + */ + protected $languages; + + /** + * @var array + */ + protected $charsets; + + /** + * @var array + */ + protected $acceptableContentTypes; + + /** + * @var string + */ + protected $pathInfo; + + /** + * @var string + */ + protected $requestUri; + + /** + * @var string + */ + protected $baseUrl; + + /** + * @var string + */ + protected $basePath; + + /** + * @var string + */ + protected $method; + + /** + * @var string + */ + protected $format; + + /** + * @var \Symfony\Component\HttpFoundation\Session\SessionInterface + */ + protected $session; + + /** + * @var string + */ + protected $locale; + + /** + * @var string + */ + protected $defaultLocale = 'en'; + + /** + * @var array + */ + protected static $formats; + + /** + * Constructor. + * + * @param array $query The GET parameters + * @param array $request The POST parameters + * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array $cookies The COOKIE parameters + * @param array $files The FILES parameters + * @param array $server The SERVER parameters + * @param string $content The raw body data + * + * @api + */ + public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) + { + $this->initialize($query, $request, $attributes, $cookies, $files, $server, $content); + } + + /** + * Sets the parameters for this request. + * + * This method also re-initializes all properties. + * + * @param array $query The GET parameters + * @param array $request The POST parameters + * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array $cookies The COOKIE parameters + * @param array $files The FILES parameters + * @param array $server The SERVER parameters + * @param string $content The raw body data + * + * @api + */ + public function initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) + { + $this->request = new ParameterBag($request); + $this->query = new ParameterBag($query); + $this->attributes = new ParameterBag($attributes); + $this->cookies = new ParameterBag($cookies); + $this->files = new FileBag($files); + $this->server = new ServerBag($server); + $this->headers = new HeaderBag($this->server->getHeaders()); + + $this->content = $content; + $this->languages = null; + $this->charsets = null; + $this->acceptableContentTypes = null; + $this->pathInfo = null; + $this->requestUri = null; + $this->baseUrl = null; + $this->basePath = null; + $this->method = null; + $this->format = null; + } + + /** + * Creates a new request with values from PHP's super globals. + * + * @return Request A new request + * + * @api + */ + public static function createFromGlobals() + { + $request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER); + + if (0 === strpos($request->headers->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded') + && in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), array('PUT', 'DELETE', 'PATCH')) + ) { + parse_str($request->getContent(), $data); + $request->request = new ParameterBag($data); + } + + return $request; + } + + /** + * Creates a Request based on a given URI and configuration. + * + * The information contained in the URI always take precedence + * over the other information (server and parameters). + * + * @param string $uri The URI + * @param string $method The HTTP method + * @param array $parameters The query (GET) or request (POST) parameters + * @param array $cookies The request cookies ($_COOKIE) + * @param array $files The request files ($_FILES) + * @param array $server The server parameters ($_SERVER) + * @param string $content The raw body data + * + * @return Request A Request instance + * + * @api + */ + public static function create($uri, $method = 'GET', $parameters = array(), $cookies = array(), $files = array(), $server = array(), $content = null) + { + $server = array_replace(array( + 'SERVER_NAME' => 'localhost', + 'SERVER_PORT' => 80, + 'HTTP_HOST' => 'localhost', + 'HTTP_USER_AGENT' => 'Symfony/2.X', + 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', + 'HTTP_ACCEPT_LANGUAGE' => 'en-us,en;q=0.5', + 'HTTP_ACCEPT_CHARSET' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', + 'REMOTE_ADDR' => '127.0.0.1', + 'SCRIPT_NAME' => '', + 'SCRIPT_FILENAME' => '', + 'SERVER_PROTOCOL' => 'HTTP/1.1', + 'REQUEST_TIME' => time(), + ), $server); + + $server['PATH_INFO'] = ''; + $server['REQUEST_METHOD'] = strtoupper($method); + + $components = parse_url($uri); + if (isset($components['host'])) { + $server['SERVER_NAME'] = $components['host']; + $server['HTTP_HOST'] = $components['host']; + } + + if (isset($components['scheme'])) { + if ('https' === $components['scheme']) { + $server['HTTPS'] = 'on'; + $server['SERVER_PORT'] = 443; + } else { + unset($server['HTTPS']); + $server['SERVER_PORT'] = 80; + } + } + + if (isset($components['port'])) { + $server['SERVER_PORT'] = $components['port']; + $server['HTTP_HOST'] = $server['HTTP_HOST'].':'.$components['port']; + } + + if (isset($components['user'])) { + $server['PHP_AUTH_USER'] = $components['user']; + } + + if (isset($components['pass'])) { + $server['PHP_AUTH_PW'] = $components['pass']; + } + + if (!isset($components['path'])) { + $components['path'] = '/'; + } + + switch (strtoupper($method)) { + case 'POST': + case 'PUT': + case 'DELETE': + if (!isset($server['CONTENT_TYPE'])) { + $server['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'; + } + // no break + case 'PATCH': + $request = $parameters; + $query = array(); + break; + default: + $request = array(); + $query = $parameters; + break; + } + + $queryString = ''; + if (isset($components['query'])) { + parse_str(html_entity_decode($components['query']), $qs); + + if ($query) { + $query = array_replace($qs, $query); + $queryString = http_build_query($query, '', '&'); + } else { + $query = $qs; + $queryString = $components['query']; + } + } elseif ($query) { + $queryString = http_build_query($query, '', '&'); + } + + $server['REQUEST_URI'] = $components['path'].('' !== $queryString ? '?'.$queryString : ''); + $server['QUERY_STRING'] = $queryString; + + return new static($query, $request, array(), $cookies, $files, $server, $content); + } + + /** + * Clones a request and overrides some of its parameters. + * + * @param array $query The GET parameters + * @param array $request The POST parameters + * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array $cookies The COOKIE parameters + * @param array $files The FILES parameters + * @param array $server The SERVER parameters + * + * @return Request The duplicated request + * + * @api + */ + public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) + { + $dup = clone $this; + if ($query !== null) { + $dup->query = new ParameterBag($query); + } + if ($request !== null) { + $dup->request = new ParameterBag($request); + } + if ($attributes !== null) { + $dup->attributes = new ParameterBag($attributes); + } + if ($cookies !== null) { + $dup->cookies = new ParameterBag($cookies); + } + if ($files !== null) { + $dup->files = new FileBag($files); + } + if ($server !== null) { + $dup->server = new ServerBag($server); + $dup->headers = new HeaderBag($dup->server->getHeaders()); + } + $dup->languages = null; + $dup->charsets = null; + $dup->acceptableContentTypes = null; + $dup->pathInfo = null; + $dup->requestUri = null; + $dup->baseUrl = null; + $dup->basePath = null; + $dup->method = null; + $dup->format = null; + + if (!$dup->get('_format') && $this->get('_format')) { + $dup->attributes->set('_format', $this->get('_format')); + } + + if (!$dup->getRequestFormat(null)) { + $dup->setRequestFormat($format = $this->getRequestFormat(null)); + } + + return $dup; + } + + /** + * Clones the current request. + * + * Note that the session is not cloned as duplicated requests + * are most of the time sub-requests of the main one. + */ + public function __clone() + { + $this->query = clone $this->query; + $this->request = clone $this->request; + $this->attributes = clone $this->attributes; + $this->cookies = clone $this->cookies; + $this->files = clone $this->files; + $this->server = clone $this->server; + $this->headers = clone $this->headers; + } + + /** + * Returns the request as a string. + * + * @return string The request + */ + public function __toString() + { + return + sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL'))."\r\n". + $this->headers."\r\n". + $this->getContent(); + } + + /** + * Overrides the PHP global variables according to this request instance. + * + * It overrides $_GET, $_POST, $_REQUEST, $_SERVER, $_COOKIE. + * $_FILES is never override, see rfc1867 + * + * @api + */ + public function overrideGlobals() + { + $this->server->set('QUERY_STRING', static::normalizeQueryString(http_build_query($this->query->all(), null, '&'))); + + $_GET = $this->query->all(); + $_POST = $this->request->all(); + $_SERVER = $this->server->all(); + $_COOKIE = $this->cookies->all(); + + foreach ($this->headers->all() as $key => $value) { + $key = strtoupper(str_replace('-', '_', $key)); + if (in_array($key, array('CONTENT_TYPE', 'CONTENT_LENGTH'))) { + $_SERVER[$key] = implode(', ', $value); + } else { + $_SERVER['HTTP_'.$key] = implode(', ', $value); + } + } + + $request = array('g' => $_GET, 'p' => $_POST, 'c' => $_COOKIE); + + $requestOrder = ini_get('request_order') ?: ini_get('variables_order'); + $requestOrder = preg_replace('#[^cgp]#', '', strtolower($requestOrder)) ?: 'gp'; + + $_REQUEST = array(); + foreach (str_split($requestOrder) as $order) { + $_REQUEST = array_merge($_REQUEST, $request[$order]); + } + } + + /** + * Sets a list of trusted proxies. + * + * You should only list the reverse proxies that you manage directly. + * + * @param array $proxies A list of trusted proxies + * + * @api + */ + public static function setTrustedProxies(array $proxies) + { + self::$trustedProxies = $proxies; + } + + /** + * Gets the list of trusted proxies. + * + * @return array An array of trusted proxies. + */ + public static function getTrustedProxies() + { + return self::$trustedProxies; + } + + /** + * Sets a list of trusted host patterns. + * + * You should only list the hosts you manage using regexs. + * + * @param array $hostPatterns A list of trusted host patterns + */ + public static function setTrustedHosts(array $hostPatterns) + { + self::$trustedHostPatterns = array_map(function ($hostPattern) { + return sprintf('{%s}i', str_replace('}', '\\}', $hostPattern)); + }, $hostPatterns); + // we need to reset trusted hosts on trusted host patterns change + self::$trustedHosts = array(); + } + + /** + * Gets the list of trusted host patterns. + * + * @return array An array of trusted host patterns. + */ + public static function getTrustedHosts() + { + return self::$trustedHostPatterns; + } + + /** + * Sets the name for trusted headers. + * + * The following header keys are supported: + * + * * Request::HEADER_CLIENT_IP: defaults to X-Forwarded-For (see getClientIp()) + * * Request::HEADER_CLIENT_HOST: defaults to X-Forwarded-Host (see getClientHost()) + * * Request::HEADER_CLIENT_PORT: defaults to X-Forwarded-Port (see getClientPort()) + * * Request::HEADER_CLIENT_PROTO: defaults to X-Forwarded-Proto (see getScheme() and isSecure()) + * + * Setting an empty value allows to disable the trusted header for the given key. + * + * @param string $key The header key + * @param string $value The header name + * + * @throws \InvalidArgumentException + */ + public static function setTrustedHeaderName($key, $value) + { + if (!array_key_exists($key, self::$trustedHeaders)) { + throw new \InvalidArgumentException(sprintf('Unable to set the trusted header name for key "%s".', $key)); + } + + self::$trustedHeaders[$key] = $value; + } + + /** + * Gets the trusted proxy header name. + * + * @param string $key The header key + * + * @return string The header name + * + * @throws \InvalidArgumentException + */ + public static function getTrustedHeaderName($key) + { + if (!array_key_exists($key, self::$trustedHeaders)) { + throw new \InvalidArgumentException(sprintf('Unable to get the trusted header name for key "%s".', $key)); + } + + return self::$trustedHeaders[$key]; + } + + /** + * Normalizes a query string. + * + * It builds a normalized query string, where keys/value pairs are alphabetized, + * have consistent escaping and unneeded delimiters are removed. + * + * @param string $qs Query string + * + * @return string A normalized query string for the Request + */ + public static function normalizeQueryString($qs) + { + if ('' == $qs) { + return ''; + } + + $parts = array(); + $order = array(); + + foreach (explode('&', $qs) as $param) { + if ('' === $param || '=' === $param[0]) { + // Ignore useless delimiters, e.g. "x=y&". + // Also ignore pairs with empty key, even if there was a value, e.g. "=value", as such nameless values cannot be retrieved anyway. + // PHP also does not include them when building _GET. + continue; + } + + $keyValuePair = explode('=', $param, 2); + + // GET parameters, that are submitted from a HTML form, encode spaces as "+" by default (as defined in enctype application/x-www-form-urlencoded). + // PHP also converts "+" to spaces when filling the global _GET or when using the function parse_str. This is why we use urldecode and then normalize to + // RFC 3986 with rawurlencode. + $parts[] = isset($keyValuePair[1]) ? + rawurlencode(urldecode($keyValuePair[0])).'='.rawurlencode(urldecode($keyValuePair[1])) : + rawurlencode(urldecode($keyValuePair[0])); + $order[] = urldecode($keyValuePair[0]); + } + + array_multisort($order, SORT_ASC, $parts); + + return implode('&', $parts); + } + + /** + * Enables support for the _method request parameter to determine the intended HTTP method. + * + * Be warned that enabling this feature might lead to CSRF issues in your code. + * Check that you are using CSRF tokens when required. + * + * The HTTP method can only be overridden when the real HTTP method is POST. + */ + public static function enableHttpMethodParameterOverride() + { + self::$httpMethodParameterOverride = true; + } + + /** + * Checks whether support for the _method request parameter is enabled. + * + * @return bool True when the _method request parameter is enabled, false otherwise + */ + public static function getHttpMethodParameterOverride() + { + return self::$httpMethodParameterOverride; + } + + /** + * Gets a "parameter" value. + * + * This method is mainly useful for libraries that want to provide some flexibility. + * + * Order of precedence: GET, PATH, POST + * + * Avoid using this method in controllers: + * + * * slow + * * prefer to get from a "named" source + * + * It is better to explicitly get request parameters from the appropriate + * public property instead (query, attributes, request). + * + * @param string $key the key + * @param mixed $default the default value + * @param bool $deep is parameter deep in multidimensional array + * + * @return mixed + */ + public function get($key, $default = null, $deep = false) + { + return $this->query->get($key, $this->attributes->get($key, $this->request->get($key, $default, $deep), $deep), $deep); + } + + /** + * Gets the Session. + * + * @return SessionInterface|null The session + * + * @api + */ + public function getSession() + { + return $this->session; + } + + /** + * Whether the request contains a Session which was started in one of the + * previous requests. + * + * @return bool + * + * @api + */ + public function hasPreviousSession() + { + // the check for $this->session avoids malicious users trying to fake a session cookie with proper name + return $this->hasSession() && $this->cookies->has($this->session->getName()); + } + + /** + * Whether the request contains a Session object. + * + * This method does not give any information about the state of the session object, + * like whether the session is started or not. It is just a way to check if this Request + * is associated with a Session instance. + * + * @return bool true when the Request contains a Session object, false otherwise + * + * @api + */ + public function hasSession() + { + return null !== $this->session; + } + + /** + * Sets the Session. + * + * @param SessionInterface $session The Session + * + * @api + */ + public function setSession(SessionInterface $session) + { + $this->session = $session; + } + + /** + * Returns the client IP addresses. + * + * In the returned array the most trusted IP address is first, and the + * least trusted one last. The "real" client IP address is the last one, + * but this is also the least trusted one. Trusted proxies are stripped. + * + * Use this method carefully; you should use getClientIp() instead. + * + * @return array The client IP addresses + * + * @see getClientIp() + */ + public function getClientIps() + { + $ip = $this->server->get('REMOTE_ADDR'); + + if (!self::$trustedProxies) { + return array($ip); + } + + if (!self::$trustedHeaders[self::HEADER_CLIENT_IP] || !$this->headers->has(self::$trustedHeaders[self::HEADER_CLIENT_IP])) { + return array($ip); + } + + $clientIps = array_map('trim', explode(',', $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_IP]))); + $clientIps[] = $ip; // Complete the IP chain with the IP the request actually came from + + $ip = $clientIps[0]; // Fallback to this when the client IP falls into the range of trusted proxies + + // Eliminate all IPs from the forwarded IP chain which are trusted proxies + foreach ($clientIps as $key => $clientIp) { + if (IpUtils::checkIp($clientIp, self::$trustedProxies)) { + unset($clientIps[$key]); + } + } + + // Now the IP chain contains only untrusted proxies and the client IP + return $clientIps ? array_reverse($clientIps) : array($ip); + } + + /** + * Returns the client IP address. + * + * This method can read the client IP address from the "X-Forwarded-For" header + * when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-For" + * header value is a comma+space separated list of IP addresses, the left-most + * being the original client, and each successive proxy that passed the request + * adding the IP address where it received the request from. + * + * If your reverse proxy uses a different header name than "X-Forwarded-For", + * ("Client-Ip" for instance), configure it via "setTrustedHeaderName()" with + * the "client-ip" key. + * + * @return string The client IP address + * + * @see getClientIps() + * @see http://en.wikipedia.org/wiki/X-Forwarded-For + * + * @api + */ + public function getClientIp() + { + $ipAddresses = $this->getClientIps(); + + return $ipAddresses[0]; + } + + /** + * Returns current script name. + * + * @return string + * + * @api + */ + public function getScriptName() + { + return $this->server->get('SCRIPT_NAME', $this->server->get('ORIG_SCRIPT_NAME', '')); + } + + /** + * Returns the path being requested relative to the executed script. + * + * The path info always starts with a /. + * + * Suppose this request is instantiated from /mysite on localhost: + * + * * http://localhost/mysite returns an empty string + * * http://localhost/mysite/about returns '/about' + * * http://localhost/mysite/enco%20ded returns '/enco%20ded' + * * http://localhost/mysite/about?var=1 returns '/about' + * + * @return string The raw path (i.e. not urldecoded) + * + * @api + */ + public function getPathInfo() + { + if (null === $this->pathInfo) { + $this->pathInfo = $this->preparePathInfo(); + } + + return $this->pathInfo; + } + + /** + * Returns the root path from which this request is executed. + * + * Suppose that an index.php file instantiates this request object: + * + * * http://localhost/index.php returns an empty string + * * http://localhost/index.php/page returns an empty string + * * http://localhost/web/index.php returns '/web' + * * http://localhost/we%20b/index.php returns '/we%20b' + * + * @return string The raw path (i.e. not urldecoded) + * + * @api + */ + public function getBasePath() + { + if (null === $this->basePath) { + $this->basePath = $this->prepareBasePath(); + } + + return $this->basePath; + } + + /** + * Returns the root URL from which this request is executed. + * + * The base URL never ends with a /. + * + * This is similar to getBasePath(), except that it also includes the + * script filename (e.g. index.php) if one exists. + * + * @return string The raw URL (i.e. not urldecoded) + * + * @api + */ + public function getBaseUrl() + { + if (null === $this->baseUrl) { + $this->baseUrl = $this->prepareBaseUrl(); + } + + return $this->baseUrl; + } + + /** + * Gets the request's scheme. + * + * @return string + * + * @api + */ + public function getScheme() + { + return $this->isSecure() ? 'https' : 'http'; + } + + /** + * Returns the port on which the request is made. + * + * This method can read the client port from the "X-Forwarded-Port" header + * when trusted proxies were set via "setTrustedProxies()". + * + * The "X-Forwarded-Port" header must contain the client port. + * + * If your reverse proxy uses a different header name than "X-Forwarded-Port", + * configure it via "setTrustedHeaderName()" with the "client-port" key. + * + * @return string + * + * @api + */ + public function getPort() + { + if (self::$trustedProxies) { + if (self::$trustedHeaders[self::HEADER_CLIENT_PORT] && $port = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PORT])) { + return $port; + } + + if (self::$trustedHeaders[self::HEADER_CLIENT_PROTO] && 'https' === $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO], 'http')) { + return 443; + } + } + + if ($host = $this->headers->get('HOST')) { + if ($host[0] === '[') { + $pos = strpos($host, ':', strrpos($host, ']')); + } else { + $pos = strrpos($host, ':'); + } + + if (false !== $pos) { + return intval(substr($host, $pos + 1)); + } + + return 'https' === $this->getScheme() ? 443 : 80; + } + + return $this->server->get('SERVER_PORT'); + } + + /** + * Returns the user. + * + * @return string|null + */ + public function getUser() + { + return $this->headers->get('PHP_AUTH_USER'); + } + + /** + * Returns the password. + * + * @return string|null + */ + public function getPassword() + { + return $this->headers->get('PHP_AUTH_PW'); + } + + /** + * Gets the user info. + * + * @return string A user name and, optionally, scheme-specific information about how to gain authorization to access the server + */ + public function getUserInfo() + { + $userinfo = $this->getUser(); + + $pass = $this->getPassword(); + if ('' != $pass) { + $userinfo .= ":$pass"; + } + + return $userinfo; + } + + /** + * Returns the HTTP host being requested. + * + * The port name will be appended to the host if it's non-standard. + * + * @return string + * + * @api + */ + public function getHttpHost() + { + $scheme = $this->getScheme(); + $port = $this->getPort(); + + if (('http' == $scheme && $port == 80) || ('https' == $scheme && $port == 443)) { + return $this->getHost(); + } + + return $this->getHost().':'.$port; + } + + /** + * Returns the requested URI (path and query string). + * + * @return string The raw URI (i.e. not URI decoded) + * + * @api + */ + public function getRequestUri() + { + if (null === $this->requestUri) { + $this->requestUri = $this->prepareRequestUri(); + } + + return $this->requestUri; + } + + /** + * Gets the scheme and HTTP host. + * + * If the URL was called with basic authentication, the user + * and the password are not added to the generated string. + * + * @return string The scheme and HTTP host + */ + public function getSchemeAndHttpHost() + { + return $this->getScheme().'://'.$this->getHttpHost(); + } + + /** + * Generates a normalized URI (URL) for the Request. + * + * @return string A normalized URI (URL) for the Request + * + * @see getQueryString() + * + * @api + */ + public function getUri() + { + if (null !== $qs = $this->getQueryString()) { + $qs = '?'.$qs; + } + + return $this->getSchemeAndHttpHost().$this->getBaseUrl().$this->getPathInfo().$qs; + } + + /** + * Generates a normalized URI for the given path. + * + * @param string $path A path to use instead of the current one + * + * @return string The normalized URI for the path + * + * @api + */ + public function getUriForPath($path) + { + return $this->getSchemeAndHttpHost().$this->getBaseUrl().$path; + } + + /** + * Generates the normalized query string for the Request. + * + * It builds a normalized query string, where keys/value pairs are alphabetized + * and have consistent escaping. + * + * @return string|null A normalized query string for the Request + * + * @api + */ + public function getQueryString() + { + $qs = static::normalizeQueryString($this->server->get('QUERY_STRING')); + + return '' === $qs ? null : $qs; + } + + /** + * Checks whether the request is secure or not. + * + * This method can read the client port from the "X-Forwarded-Proto" header + * when trusted proxies were set via "setTrustedProxies()". + * + * The "X-Forwarded-Proto" header must contain the protocol: "https" or "http". + * + * If your reverse proxy uses a different header name than "X-Forwarded-Proto" + * ("SSL_HTTPS" for instance), configure it via "setTrustedHeaderName()" with + * the "client-proto" key. + * + * @return bool + * + * @api + */ + public function isSecure() + { + if (self::$trustedProxies && self::$trustedHeaders[self::HEADER_CLIENT_PROTO] && $proto = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO])) { + return in_array(strtolower(current(explode(',', $proto))), array('https', 'on', 'ssl', '1')); + } + + $https = $this->server->get('HTTPS'); + + return !empty($https) && 'off' !== strtolower($https); + } + + /** + * Returns the host name. + * + * This method can read the client port from the "X-Forwarded-Host" header + * when trusted proxies were set via "setTrustedProxies()". + * + * The "X-Forwarded-Host" header must contain the client host name. + * + * If your reverse proxy uses a different header name than "X-Forwarded-Host", + * configure it via "setTrustedHeaderName()" with the "client-host" key. + * + * @return string + * + * @throws \UnexpectedValueException when the host name is invalid + * + * @api + */ + public function getHost() + { + if (self::$trustedProxies && self::$trustedHeaders[self::HEADER_CLIENT_HOST] && $host = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_HOST])) { + $elements = explode(',', $host); + + $host = $elements[count($elements) - 1]; + } elseif (!$host = $this->headers->get('HOST')) { + if (!$host = $this->server->get('SERVER_NAME')) { + $host = $this->server->get('SERVER_ADDR', ''); + } + } + + // trim and remove port number from host + // host is lowercase as per RFC 952/2181 + $host = strtolower(preg_replace('/:\d+$/', '', trim($host))); + + // as the host can come from the user (HTTP_HOST and depending on the configuration, SERVER_NAME too can come from the user) + // check that it does not contain forbidden characters (see RFC 952 and RFC 2181) + // use preg_replace() instead of preg_match() to prevent DoS attacks with long host names + if ($host && '' !== preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/', '', $host)) { + throw new \UnexpectedValueException('Invalid Host "'.$host.'"'); + } + + if (count(self::$trustedHostPatterns) > 0) { + // to avoid host header injection attacks, you should provide a list of trusted host patterns + + if (in_array($host, self::$trustedHosts)) { + return $host; + } + + foreach (self::$trustedHostPatterns as $pattern) { + if (preg_match($pattern, $host)) { + self::$trustedHosts[] = $host; + + return $host; + } + } + + throw new \UnexpectedValueException('Untrusted Host "'.$host.'"'); + } + + return $host; + } + + /** + * Sets the request method. + * + * @param string $method + * + * @api + */ + public function setMethod($method) + { + $this->method = null; + $this->server->set('REQUEST_METHOD', $method); + } + + /** + * Gets the request "intended" method. + * + * If the X-HTTP-Method-Override header is set, and if the method is a POST, + * then it is used to determine the "real" intended HTTP method. + * + * The _method request parameter can also be used to determine the HTTP method, + * but only if enableHttpMethodParameterOverride() has been called. + * + * The method is always an uppercased string. + * + * @return string The request method + * + * @api + * + * @see getRealMethod + */ + public function getMethod() + { + if (null === $this->method) { + $this->method = strtoupper($this->server->get('REQUEST_METHOD', 'GET')); + + if ('POST' === $this->method) { + if ($method = $this->headers->get('X-HTTP-METHOD-OVERRIDE')) { + $this->method = strtoupper($method); + } elseif (self::$httpMethodParameterOverride) { + $this->method = strtoupper($this->request->get('_method', $this->query->get('_method', 'POST'))); + } + } + } + + return $this->method; + } + + /** + * Gets the "real" request method. + * + * @return string The request method + * + * @see getMethod + */ + public function getRealMethod() + { + return strtoupper($this->server->get('REQUEST_METHOD', 'GET')); + } + + /** + * Gets the mime type associated with the format. + * + * @param string $format The format + * + * @return string The associated mime type (null if not found) + * + * @api + */ + public function getMimeType($format) + { + if (null === static::$formats) { + static::initializeFormats(); + } + + return isset(static::$formats[$format]) ? static::$formats[$format][0] : null; + } + + /** + * Gets the format associated with the mime type. + * + * @param string $mimeType The associated mime type + * + * @return string|null The format (null if not found) + * + * @api + */ + public function getFormat($mimeType) + { + if (false !== $pos = strpos($mimeType, ';')) { + $mimeType = substr($mimeType, 0, $pos); + } + + if (null === static::$formats) { + static::initializeFormats(); + } + + foreach (static::$formats as $format => $mimeTypes) { + if (in_array($mimeType, (array) $mimeTypes)) { + return $format; + } + } + } + + /** + * Associates a format with mime types. + * + * @param string $format The format + * @param string|array $mimeTypes The associated mime types (the preferred one must be the first as it will be used as the content type) + * + * @api + */ + public function setFormat($format, $mimeTypes) + { + if (null === static::$formats) { + static::initializeFormats(); + } + + static::$formats[$format] = is_array($mimeTypes) ? $mimeTypes : array($mimeTypes); + } + + /** + * Gets the request format. + * + * Here is the process to determine the format: + * + * * format defined by the user (with setRequestFormat()) + * * _format request parameter + * * $default + * + * @param string $default The default format + * + * @return string The request format + * + * @api + */ + public function getRequestFormat($default = 'html') + { + if (null === $this->format) { + $this->format = $this->get('_format', $default); + } + + return $this->format; + } + + /** + * Sets the request format. + * + * @param string $format The request format. + * + * @api + */ + public function setRequestFormat($format) + { + $this->format = $format; + } + + /** + * Gets the format associated with the request. + * + * @return string|null The format (null if no content type is present) + * + * @api + */ + public function getContentType() + { + return $this->getFormat($this->headers->get('CONTENT_TYPE')); + } + + /** + * Sets the default locale. + * + * @param string $locale + * + * @api + */ + public function setDefaultLocale($locale) + { + $this->defaultLocale = $locale; + + if (null === $this->locale) { + $this->setPhpDefaultLocale($locale); + } + } + + /** + * Get the default locale. + * + * @return string + */ + public function getDefaultLocale() + { + return $this->defaultLocale; + } + + /** + * Sets the locale. + * + * @param string $locale + * + * @api + */ + public function setLocale($locale) + { + $this->setPhpDefaultLocale($this->locale = $locale); + } + + /** + * Get the locale. + * + * @return string + */ + public function getLocale() + { + return null === $this->locale ? $this->defaultLocale : $this->locale; + } + + /** + * Checks if the request method is of specified type. + * + * @param string $method Uppercase request method (GET, POST etc). + * + * @return bool + */ + public function isMethod($method) + { + return $this->getMethod() === strtoupper($method); + } + + /** + * Checks whether the method is safe or not. + * + * @return bool + * + * @api + */ + public function isMethodSafe() + { + return in_array($this->getMethod(), array('GET', 'HEAD')); + } + + /** + * Returns the request body content. + * + * @param bool $asResource If true, a resource will be returned + * + * @return string|resource The request body content or a resource to read the body stream. + * + * @throws \LogicException + */ + public function getContent($asResource = false) + { + if (false === $this->content || (true === $asResource && null !== $this->content)) { + throw new \LogicException('getContent() can only be called once when using the resource return type.'); + } + + if (true === $asResource) { + $this->content = false; + + return fopen('php://input', 'rb'); + } + + if (null === $this->content) { + $this->content = file_get_contents('php://input'); + } + + return $this->content; + } + + /** + * Gets the Etags. + * + * @return array The entity tags + */ + public function getETags() + { + return preg_split('/\s*,\s*/', $this->headers->get('if_none_match'), null, PREG_SPLIT_NO_EMPTY); + } + + /** + * @return bool + */ + public function isNoCache() + { + return $this->headers->hasCacheControlDirective('no-cache') || 'no-cache' == $this->headers->get('Pragma'); + } + + /** + * Returns the preferred language. + * + * @param array $locales An array of ordered available locales + * + * @return string|null The preferred locale + * + * @api + */ + public function getPreferredLanguage(array $locales = null) + { + $preferredLanguages = $this->getLanguages(); + + if (empty($locales)) { + return isset($preferredLanguages[0]) ? $preferredLanguages[0] : null; + } + + if (!$preferredLanguages) { + return $locales[0]; + } + + $extendedPreferredLanguages = array(); + foreach ($preferredLanguages as $language) { + $extendedPreferredLanguages[] = $language; + if (false !== $position = strpos($language, '_')) { + $superLanguage = substr($language, 0, $position); + if (!in_array($superLanguage, $preferredLanguages)) { + $extendedPreferredLanguages[] = $superLanguage; + } + } + } + + $preferredLanguages = array_values(array_intersect($extendedPreferredLanguages, $locales)); + + return isset($preferredLanguages[0]) ? $preferredLanguages[0] : $locales[0]; + } + + /** + * Gets a list of languages acceptable by the client browser. + * + * @return array Languages ordered in the user browser preferences + * + * @api + */ + public function getLanguages() + { + if (null !== $this->languages) { + return $this->languages; + } + + $languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all(); + $this->languages = array(); + foreach (array_keys($languages) as $lang) { + if (strstr($lang, '-')) { + $codes = explode('-', $lang); + if ($codes[0] == 'i') { + // Language not listed in ISO 639 that are not variants + // of any listed language, which can be registered with the + // i-prefix, such as i-cherokee + if (count($codes) > 1) { + $lang = $codes[1]; + } + } else { + for ($i = 0, $max = count($codes); $i < $max; $i++) { + if ($i == 0) { + $lang = strtolower($codes[0]); + } else { + $lang .= '_'.strtoupper($codes[$i]); + } + } + } + } + + $this->languages[] = $lang; + } + + return $this->languages; + } + + /** + * Gets a list of charsets acceptable by the client browser. + * + * @return array List of charsets in preferable order + * + * @api + */ + public function getCharsets() + { + if (null !== $this->charsets) { + return $this->charsets; + } + + return $this->charsets = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all()); + } + + /** + * Gets a list of content types acceptable by the client browser + * + * @return array List of content types in preferable order + * + * @api + */ + public function getAcceptableContentTypes() + { + if (null !== $this->acceptableContentTypes) { + return $this->acceptableContentTypes; + } + + return $this->acceptableContentTypes = array_keys(AcceptHeader::fromString($this->headers->get('Accept'))->all()); + } + + /** + * Returns true if the request is a XMLHttpRequest. + * + * It works if your JavaScript library set an X-Requested-With HTTP header. + * It is known to work with common JavaScript frameworks: + * @link http://en.wikipedia.org/wiki/List_of_Ajax_frameworks#JavaScript + * + * @return bool true if the request is an XMLHttpRequest, false otherwise + * + * @api + */ + public function isXmlHttpRequest() + { + return 'XMLHttpRequest' == $this->headers->get('X-Requested-With'); + } + + /* + * The following methods are derived from code of the Zend Framework (1.10dev - 2010-01-24) + * + * Code subject to the new BSD license (http://framework.zend.com/license/new-bsd). + * + * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + */ + + protected function prepareRequestUri() + { + $requestUri = ''; + + if ($this->headers->has('X_ORIGINAL_URL')) { + // IIS with Microsoft Rewrite Module + $requestUri = $this->headers->get('X_ORIGINAL_URL'); + $this->headers->remove('X_ORIGINAL_URL'); + $this->server->remove('HTTP_X_ORIGINAL_URL'); + $this->server->remove('UNENCODED_URL'); + $this->server->remove('IIS_WasUrlRewritten'); + } elseif ($this->headers->has('X_REWRITE_URL')) { + // IIS with ISAPI_Rewrite + $requestUri = $this->headers->get('X_REWRITE_URL'); + $this->headers->remove('X_REWRITE_URL'); + } elseif ($this->server->get('IIS_WasUrlRewritten') == '1' && $this->server->get('UNENCODED_URL') != '') { + // IIS7 with URL Rewrite: make sure we get the unencoded URL (double slash problem) + $requestUri = $this->server->get('UNENCODED_URL'); + $this->server->remove('UNENCODED_URL'); + $this->server->remove('IIS_WasUrlRewritten'); + } elseif ($this->server->has('REQUEST_URI')) { + $requestUri = $this->server->get('REQUEST_URI'); + // HTTP proxy reqs setup request URI with scheme and host [and port] + the URL path, only use URL path + $schemeAndHttpHost = $this->getSchemeAndHttpHost(); + if (strpos($requestUri, $schemeAndHttpHost) === 0) { + $requestUri = substr($requestUri, strlen($schemeAndHttpHost)); + } + } elseif ($this->server->has('ORIG_PATH_INFO')) { + // IIS 5.0, PHP as CGI + $requestUri = $this->server->get('ORIG_PATH_INFO'); + if ('' != $this->server->get('QUERY_STRING')) { + $requestUri .= '?'.$this->server->get('QUERY_STRING'); + } + $this->server->remove('ORIG_PATH_INFO'); + } + + // normalize the request URI to ease creating sub-requests from this request + $this->server->set('REQUEST_URI', $requestUri); + + return $requestUri; + } + + /** + * Prepares the base URL. + * + * @return string + */ + protected function prepareBaseUrl() + { + $filename = basename($this->server->get('SCRIPT_FILENAME')); + + if (basename($this->server->get('SCRIPT_NAME')) === $filename) { + $baseUrl = $this->server->get('SCRIPT_NAME'); + } elseif (basename($this->server->get('PHP_SELF')) === $filename) { + $baseUrl = $this->server->get('PHP_SELF'); + } elseif (basename($this->server->get('ORIG_SCRIPT_NAME')) === $filename) { + $baseUrl = $this->server->get('ORIG_SCRIPT_NAME'); // 1and1 shared hosting compatibility + } else { + // Backtrack up the script_filename to find the portion matching + // php_self + $path = $this->server->get('PHP_SELF', ''); + $file = $this->server->get('SCRIPT_FILENAME', ''); + $segs = explode('/', trim($file, '/')); + $segs = array_reverse($segs); + $index = 0; + $last = count($segs); + $baseUrl = ''; + do { + $seg = $segs[$index]; + $baseUrl = '/'.$seg.$baseUrl; + ++$index; + } while ($last > $index && (false !== $pos = strpos($path, $baseUrl)) && 0 != $pos); + } + + // Does the baseUrl have anything in common with the request_uri? + $requestUri = $this->getRequestUri(); + + if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, $baseUrl)) { + // full $baseUrl matches + return $prefix; + } + + if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, dirname($baseUrl))) { + // directory portion of $baseUrl matches + return rtrim($prefix, '/'); + } + + $truncatedRequestUri = $requestUri; + if (false !== $pos = strpos($requestUri, '?')) { + $truncatedRequestUri = substr($requestUri, 0, $pos); + } + + $basename = basename($baseUrl); + if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri), $basename)) { + // no match whatsoever; set it blank + return ''; + } + + // If using mod_rewrite or ISAPI_Rewrite strip the script filename + // out of baseUrl. $pos !== 0 makes sure it is not matching a value + // from PATH_INFO or QUERY_STRING + if (strlen($requestUri) >= strlen($baseUrl) && (false !== $pos = strpos($requestUri, $baseUrl)) && $pos !== 0) { + $baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl)); + } + + return rtrim($baseUrl, '/'); + } + + /** + * Prepares the base path. + * + * @return string base path + */ + protected function prepareBasePath() + { + $filename = basename($this->server->get('SCRIPT_FILENAME')); + $baseUrl = $this->getBaseUrl(); + if (empty($baseUrl)) { + return ''; + } + + if (basename($baseUrl) === $filename) { + $basePath = dirname($baseUrl); + } else { + $basePath = $baseUrl; + } + + if ('\\' === DIRECTORY_SEPARATOR) { + $basePath = str_replace('\\', '/', $basePath); + } + + return rtrim($basePath, '/'); + } + + /** + * Prepares the path info. + * + * @return string path info + */ + protected function preparePathInfo() + { + $baseUrl = $this->getBaseUrl(); + + if (null === ($requestUri = $this->getRequestUri())) { + return '/'; + } + + $pathInfo = '/'; + + // Remove the query string from REQUEST_URI + if ($pos = strpos($requestUri, '?')) { + $requestUri = substr($requestUri, 0, $pos); + } + + if (null !== $baseUrl && false === $pathInfo = substr($requestUri, strlen($baseUrl))) { + // If substr() returns false then PATH_INFO is set to an empty string + return '/'; + } elseif (null === $baseUrl) { + return $requestUri; + } + + return (string) $pathInfo; + } + + /** + * Initializes HTTP request formats. + */ + protected static function initializeFormats() + { + static::$formats = array( + 'html' => array('text/html', 'application/xhtml+xml'), + 'txt' => array('text/plain'), + 'js' => array('application/javascript', 'application/x-javascript', 'text/javascript'), + 'css' => array('text/css'), + 'json' => array('application/json', 'application/x-json'), + 'xml' => array('text/xml', 'application/xml', 'application/x-xml'), + 'rdf' => array('application/rdf+xml'), + 'atom' => array('application/atom+xml'), + 'rss' => array('application/rss+xml'), + ); + } + + /** + * Sets the default PHP locale. + * + * @param string $locale + */ + private function setPhpDefaultLocale($locale) + { + // if either the class Locale doesn't exist, or an exception is thrown when + // setting the default locale, the intl module is not installed, and + // the call can be ignored: + try { + if (class_exists('Locale', false)) { + \Locale::setDefault($locale); + } + } catch (\Exception $e) { + } + } + + /* + * Returns the prefix as encoded in the string when the string starts with + * the given prefix, false otherwise. + * + * @param string $string The urlencoded string + * @param string $prefix The prefix not encoded + * + * @return string|false The prefix as it is encoded in $string, or false + */ + private function getUrlencodedPrefix($string, $prefix) + { + if (0 !== strpos(rawurldecode($string), $prefix)) { + return false; + } + + $len = strlen($prefix); + + if (preg_match("#^(%[[:xdigit:]]{2}|.){{$len}}#", $string, $match)) { + return $match[0]; + } + + return false; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcher.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcher.php new file mode 100644 index 0000000..da95c3a --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcher.php @@ -0,0 +1,160 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * RequestMatcher compares a pre-defined set of checks against a Request instance. + * + * @author Fabien Potencier + * + * @api + */ +class RequestMatcher implements RequestMatcherInterface +{ + /** + * @var string + */ + private $path; + + /** + * @var string + */ + private $host; + + /** + * @var array + */ + private $methods = array(); + + /** + * @var string + */ + private $ips = array(); + + /** + * @var array + */ + private $attributes = array(); + + /** + * @param string|null $path + * @param string|null $host + * @param string|string[]|null $methods + * @param string|string[]|null $ips + * @param array $attributes + */ + public function __construct($path = null, $host = null, $methods = null, $ips = null, array $attributes = array()) + { + $this->matchPath($path); + $this->matchHost($host); + $this->matchMethod($methods); + $this->matchIps($ips); + foreach ($attributes as $k => $v) { + $this->matchAttribute($k, $v); + } + } + + /** + * Adds a check for the URL host name. + * + * @param string $regexp A Regexp + */ + public function matchHost($regexp) + { + $this->host = $regexp; + } + + /** + * Adds a check for the URL path info. + * + * @param string $regexp A Regexp + */ + public function matchPath($regexp) + { + $this->path = $regexp; + } + + /** + * Adds a check for the client IP. + * + * @param string $ip A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 + */ + public function matchIp($ip) + { + $this->matchIps($ip); + } + + /** + * Adds a check for the client IP. + * + * @param string|string[] $ips A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 + */ + public function matchIps($ips) + { + $this->ips = (array) $ips; + } + + /** + * Adds a check for the HTTP method. + * + * @param string|string[]|null $method An HTTP method or an array of HTTP methods + */ + public function matchMethod($method) + { + $this->methods = array_map('strtoupper', (array) $method); + } + + /** + * Adds a check for request attribute. + * + * @param string $key The request attribute name + * @param string $regexp A Regexp + */ + public function matchAttribute($key, $regexp) + { + $this->attributes[$key] = $regexp; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function matches(Request $request) + { + if ($this->methods && !in_array($request->getMethod(), $this->methods)) { + return false; + } + + foreach ($this->attributes as $key => $pattern) { + if (!preg_match('{'.$pattern.'}', $request->attributes->get($key))) { + return false; + } + } + + if (null !== $this->path && !preg_match('{'.$this->path.'}', rawurldecode($request->getPathInfo()))) { + return false; + } + + if (null !== $this->host && !preg_match('{'.$this->host.'}i', $request->getHost())) { + return false; + } + + if (IpUtils::checkIp($request->getClientIp(), $this->ips)) { + return true; + } + + // Note to future implementors: add additional checks above the + // foreach above or else your check might not be run! + return count($this->ips) === 0; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcherInterface.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcherInterface.php new file mode 100644 index 0000000..20e14e3 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcherInterface.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * RequestMatcherInterface is an interface for strategies to match a Request. + * + * @author Fabien Potencier + * + * @api + */ +interface RequestMatcherInterface +{ + /** + * Decides whether the rule(s) implemented by the strategy matches the supplied request. + * + * @param Request $request The request to check for a match + * + * @return bool true if the request matches, false otherwise + * + * @api + */ + public function matches(Request $request); +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/FakeFile.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/FakeFile.php new file mode 100644 index 0000000..0aecc20 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/FakeFile.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Resources\stubs; + +use Symfony\Component\HttpFoundation\File\File as OrigFile; + +class FakeFile extends OrigFile +{ + private $realpath; + + public function __construct($realpath, $path) + { + $this->realpath = $realpath; + parent::__construct($path, false); + } + + public function isReadable() + { + return true; + } + + public function getRealpath() + { + return $this->realpath; + } + + public function getSize() + { + return 42; + } + + public function getMTime() + { + return time(); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php new file mode 100644 index 0000000..24280e3 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php @@ -0,0 +1,90 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * SessionHandlerInterface for PHP < 5.4 + * + * Extensive documentation can be found at php.net, see links: + * + * @see http://php.net/sessionhandlerinterface + * @see http://php.net/session.customhandler + * @see http://php.net/session-set-save-handler + * + * @author Drak + */ +interface SessionHandlerInterface +{ + /** + * Re-initializes existing session, or creates a new one. + * + * @see http://php.net/sessionhandlerinterface.open + * + * @param string $savePath Save path + * @param string $sessionName Session name, see http://php.net/function.session-name.php + * + * @return bool true on success, false on failure + */ + public function open($savePath, $sessionName); + + /** + * Closes the current session. + * + * @see http://php.net/sessionhandlerinterface.close + * + * @return bool true on success, false on failure + */ + public function close(); + + /** + * Reads the session data. + * + * @see http://php.net/sessionhandlerinterface.read + * + * @param string $sessionId Session ID, see http://php.net/function.session-id + * + * @return string Same session data as passed in write() or empty string when non-existent or on failure + */ + public function read($sessionId); + + /** + * Writes the session data to the storage. + * + * @see http://php.net/sessionhandlerinterface.write + * + * @param string $sessionId Session ID , see http://php.net/function.session-id + * @param string $data Serialized session data to save + * + * @return bool true on success, false on failure + */ + public function write($sessionId, $data); + + /** + * Destroys a session. + * + * @see http://php.net/sessionhandlerinterface.destroy + * + * @param string $sessionId Session ID, see http://php.net/function.session-id + * + * @return bool true on success, false on failure + */ + public function destroy($sessionId); + + /** + * Cleans up expired sessions (garbage collection). + * + * @see http://php.net/sessionhandlerinterface.gc + * + * @param string|int $maxlifetime Sessions that have not updated for the last maxlifetime seconds will be removed + * + * @return bool true on success, false on failure + */ + public function gc($maxlifetime); +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php new file mode 100644 index 0000000..cffe28f --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php @@ -0,0 +1,1203 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * Response represents an HTTP response. + * + * @author Fabien Potencier + * + * @api + */ +class Response +{ + /** + * @var \Symfony\Component\HttpFoundation\ResponseHeaderBag + */ + public $headers; + + /** + * @var string + */ + protected $content; + + /** + * @var string + */ + protected $version; + + /** + * @var int + */ + protected $statusCode; + + /** + * @var string + */ + protected $statusText; + + /** + * @var string + */ + protected $charset; + + /** + * Status codes translation table. + * + * The list of codes is complete according to the + * {@link http://www.iana.org/assignments/http-status-codes/ Hypertext Transfer Protocol (HTTP) Status Code Registry} + * (last updated 2012-02-13). + * + * Unless otherwise noted, the status code is defined in RFC2616. + * + * @var array + */ + public static $statusTexts = array( + 100 => 'Continue', + 101 => 'Switching Protocols', + 102 => 'Processing', // RFC2518 + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + 207 => 'Multi-Status', // RFC4918 + 208 => 'Already Reported', // RFC5842 + 226 => 'IM Used', // RFC3229 + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 306 => 'Reserved', + 307 => 'Temporary Redirect', + 308 => 'Permanent Redirect', // RFC7238 + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Timeout', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Long', + 415 => 'Unsupported Media Type', + 416 => 'Requested Range Not Satisfiable', + 417 => 'Expectation Failed', + 418 => 'I\'m a teapot', // RFC2324 + 422 => 'Unprocessable Entity', // RFC4918 + 423 => 'Locked', // RFC4918 + 424 => 'Failed Dependency', // RFC4918 + 425 => 'Reserved for WebDAV advanced collections expired proposal', // RFC2817 + 426 => 'Upgrade Required', // RFC2817 + 428 => 'Precondition Required', // RFC6585 + 429 => 'Too Many Requests', // RFC6585 + 431 => 'Request Header Fields Too Large', // RFC6585 + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Timeout', + 505 => 'HTTP Version Not Supported', + 506 => 'Variant Also Negotiates (Experimental)', // RFC2295 + 507 => 'Insufficient Storage', // RFC4918 + 508 => 'Loop Detected', // RFC5842 + 510 => 'Not Extended', // RFC2774 + 511 => 'Network Authentication Required', // RFC6585 + ); + + /** + * Constructor. + * + * @param string $content The response content + * @param int $status The response status code + * @param array $headers An array of response headers + * + * @throws \InvalidArgumentException When the HTTP status code is not valid + * + * @api + */ + public function __construct($content = '', $status = 200, $headers = array()) + { + $this->headers = new ResponseHeaderBag($headers); + $this->setContent($content); + $this->setStatusCode($status); + $this->setProtocolVersion('1.0'); + if (!$this->headers->has('Date')) { + $this->setDate(new \DateTime(null, new \DateTimeZone('UTC'))); + } + } + + /** + * Factory method for chainability + * + * Example: + * + * return Response::create($body, 200) + * ->setSharedMaxAge(300); + * + * @param string $content The response content + * @param int $status The response status code + * @param array $headers An array of response headers + * + * @return Response + */ + public static function create($content = '', $status = 200, $headers = array()) + { + return new static($content, $status, $headers); + } + + /** + * Returns the Response as an HTTP string. + * + * The string representation of the Response is the same as the + * one that will be sent to the client only if the prepare() method + * has been called before. + * + * @return string The Response as an HTTP string + * + * @see prepare() + */ + public function __toString() + { + return + sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)."\r\n". + $this->headers."\r\n". + $this->getContent(); + } + + /** + * Clones the current Response instance. + */ + public function __clone() + { + $this->headers = clone $this->headers; + } + + /** + * Prepares the Response before it is sent to the client. + * + * This method tweaks the Response to ensure that it is + * compliant with RFC 2616. Most of the changes are based on + * the Request that is "associated" with this Response. + * + * @param Request $request A Request instance + * + * @return Response The current response. + */ + public function prepare(Request $request) + { + $headers = $this->headers; + + if ($this->isInformational() || in_array($this->statusCode, array(204, 304))) { + $this->setContent(null); + $headers->remove('Content-Type'); + $headers->remove('Content-Length'); + } else { + // Content-type based on the Request + if (!$headers->has('Content-Type')) { + $format = $request->getRequestFormat(); + if (null !== $format && $mimeType = $request->getMimeType($format)) { + $headers->set('Content-Type', $mimeType); + } + } + + // Fix Content-Type + $charset = $this->charset ?: 'UTF-8'; + if (!$headers->has('Content-Type')) { + $headers->set('Content-Type', 'text/html; charset='.$charset); + } elseif (0 === stripos($headers->get('Content-Type'), 'text/') && false === stripos($headers->get('Content-Type'), 'charset')) { + // add the charset + $headers->set('Content-Type', $headers->get('Content-Type').'; charset='.$charset); + } + + // Fix Content-Length + if ($headers->has('Transfer-Encoding')) { + $headers->remove('Content-Length'); + } + + if ($request->isMethod('HEAD')) { + // cf. RFC2616 14.13 + $length = $headers->get('Content-Length'); + $this->setContent(null); + if ($length) { + $headers->set('Content-Length', $length); + } + } + } + + // Fix protocol + if ('HTTP/1.0' != $request->server->get('SERVER_PROTOCOL')) { + $this->setProtocolVersion('1.1'); + } + + // Check if we need to send extra expire info headers + if ('1.0' == $this->getProtocolVersion() && 'no-cache' == $this->headers->get('Cache-Control')) { + $this->headers->set('pragma', 'no-cache'); + $this->headers->set('expires', -1); + } + + $this->ensureIEOverSSLCompatibility($request); + + return $this; + } + + /** + * Sends HTTP headers. + * + * @return Response + */ + public function sendHeaders() + { + // headers have already been sent by the developer + if (headers_sent()) { + return $this; + } + + // status + header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)); + + // headers + foreach ($this->headers->allPreserveCase() as $name => $values) { + foreach ($values as $value) { + header($name.': '.$value, false); + } + } + + // cookies + foreach ($this->headers->getCookies() as $cookie) { + setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly()); + } + + return $this; + } + + /** + * Sends content for the current web response. + * + * @return Response + */ + public function sendContent() + { + echo $this->content; + + return $this; + } + + /** + * Sends HTTP headers and content. + * + * @return Response + * + * @api + */ + public function send() + { + $this->sendHeaders(); + $this->sendContent(); + + if (function_exists('fastcgi_finish_request')) { + fastcgi_finish_request(); + } elseif ('cli' !== PHP_SAPI) { + // ob_get_level() never returns 0 on some Windows configurations, so if + // the level is the same two times in a row, the loop should be stopped. + $previous = null; + $obStatus = ob_get_status(1); + while (($level = ob_get_level()) > 0 && $level !== $previous) { + $previous = $level; + if ($obStatus[$level - 1]) { + if (version_compare(PHP_VERSION, '5.4', '>=')) { + if (isset($obStatus[$level - 1]['flags']) && ($obStatus[$level - 1]['flags'] & PHP_OUTPUT_HANDLER_REMOVABLE)) { + ob_end_flush(); + } + } else { + if (isset($obStatus[$level - 1]['del']) && $obStatus[$level - 1]['del']) { + ob_end_flush(); + } + } + } + } + flush(); + } + + return $this; + } + + /** + * Sets the response content. + * + * Valid types are strings, numbers, and objects that implement a __toString() method. + * + * @param mixed $content + * + * @return Response + * + * @throws \UnexpectedValueException + * + * @api + */ + public function setContent($content) + { + if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable(array($content, '__toString'))) { + throw new \UnexpectedValueException(sprintf('The Response content must be a string or object implementing __toString(), "%s" given.', gettype($content))); + } + + $this->content = (string) $content; + + return $this; + } + + /** + * Gets the current response content. + * + * @return string Content + * + * @api + */ + public function getContent() + { + return $this->content; + } + + /** + * Sets the HTTP protocol version (1.0 or 1.1). + * + * @param string $version The HTTP protocol version + * + * @return Response + * + * @api + */ + public function setProtocolVersion($version) + { + $this->version = $version; + + return $this; + } + + /** + * Gets the HTTP protocol version. + * + * @return string The HTTP protocol version + * + * @api + */ + public function getProtocolVersion() + { + return $this->version; + } + + /** + * Sets the response status code. + * + * @param int $code HTTP status code + * @param mixed $text HTTP status text + * + * If the status text is null it will be automatically populated for the known + * status codes and left empty otherwise. + * + * @return Response + * + * @throws \InvalidArgumentException When the HTTP status code is not valid + * + * @api + */ + public function setStatusCode($code, $text = null) + { + $this->statusCode = $code = (int) $code; + if ($this->isInvalid()) { + throw new \InvalidArgumentException(sprintf('The HTTP status code "%s" is not valid.', $code)); + } + + if (null === $text) { + $this->statusText = isset(self::$statusTexts[$code]) ? self::$statusTexts[$code] : ''; + + return $this; + } + + if (false === $text) { + $this->statusText = ''; + + return $this; + } + + $this->statusText = $text; + + return $this; + } + + /** + * Retrieves the status code for the current web response. + * + * @return int Status code + * + * @api + */ + public function getStatusCode() + { + return $this->statusCode; + } + + /** + * Sets the response charset. + * + * @param string $charset Character set + * + * @return Response + * + * @api + */ + public function setCharset($charset) + { + $this->charset = $charset; + + return $this; + } + + /** + * Retrieves the response charset. + * + * @return string Character set + * + * @api + */ + public function getCharset() + { + return $this->charset; + } + + /** + * Returns true if the response is worth caching under any circumstance. + * + * Responses marked "private" with an explicit Cache-Control directive are + * considered uncacheable. + * + * Responses with neither a freshness lifetime (Expires, max-age) nor cache + * validator (Last-Modified, ETag) are considered uncacheable. + * + * @return bool true if the response is worth caching, false otherwise + * + * @api + */ + public function isCacheable() + { + if (!in_array($this->statusCode, array(200, 203, 300, 301, 302, 404, 410))) { + return false; + } + + if ($this->headers->hasCacheControlDirective('no-store') || $this->headers->getCacheControlDirective('private')) { + return false; + } + + return $this->isValidateable() || $this->isFresh(); + } + + /** + * Returns true if the response is "fresh". + * + * Fresh responses may be served from cache without any interaction with the + * origin. A response is considered fresh when it includes a Cache-Control/max-age + * indicator or Expires header and the calculated age is less than the freshness lifetime. + * + * @return bool true if the response is fresh, false otherwise + * + * @api + */ + public function isFresh() + { + return $this->getTtl() > 0; + } + + /** + * Returns true if the response includes headers that can be used to validate + * the response with the origin server using a conditional GET request. + * + * @return bool true if the response is validateable, false otherwise + * + * @api + */ + public function isValidateable() + { + return $this->headers->has('Last-Modified') || $this->headers->has('ETag'); + } + + /** + * Marks the response as "private". + * + * It makes the response ineligible for serving other clients. + * + * @return Response + * + * @api + */ + public function setPrivate() + { + $this->headers->removeCacheControlDirective('public'); + $this->headers->addCacheControlDirective('private'); + + return $this; + } + + /** + * Marks the response as "public". + * + * It makes the response eligible for serving other clients. + * + * @return Response + * + * @api + */ + public function setPublic() + { + $this->headers->addCacheControlDirective('public'); + $this->headers->removeCacheControlDirective('private'); + + return $this; + } + + /** + * Returns true if the response must be revalidated by caches. + * + * This method indicates that the response must not be served stale by a + * cache in any circumstance without first revalidating with the origin. + * When present, the TTL of the response should not be overridden to be + * greater than the value provided by the origin. + * + * @return bool true if the response must be revalidated by a cache, false otherwise + * + * @api + */ + public function mustRevalidate() + { + return $this->headers->hasCacheControlDirective('must-revalidate') || $this->headers->has('proxy-revalidate'); + } + + /** + * Returns the Date header as a DateTime instance. + * + * @return \DateTime A \DateTime instance + * + * @throws \RuntimeException When the header is not parseable + * + * @api + */ + public function getDate() + { + return $this->headers->getDate('Date', new \DateTime()); + } + + /** + * Sets the Date header. + * + * @param \DateTime $date A \DateTime instance + * + * @return Response + * + * @api + */ + public function setDate(\DateTime $date) + { + $date->setTimezone(new \DateTimeZone('UTC')); + $this->headers->set('Date', $date->format('D, d M Y H:i:s').' GMT'); + + return $this; + } + + /** + * Returns the age of the response. + * + * @return int The age of the response in seconds + */ + public function getAge() + { + if (null !== $age = $this->headers->get('Age')) { + return (int) $age; + } + + return max(time() - $this->getDate()->format('U'), 0); + } + + /** + * Marks the response stale by setting the Age header to be equal to the maximum age of the response. + * + * @return Response + * + * @api + */ + public function expire() + { + if ($this->isFresh()) { + $this->headers->set('Age', $this->getMaxAge()); + } + + return $this; + } + + /** + * Returns the value of the Expires header as a DateTime instance. + * + * @return \DateTime|null A DateTime instance or null if the header does not exist + * + * @api + */ + public function getExpires() + { + try { + return $this->headers->getDate('Expires'); + } catch (\RuntimeException $e) { + // according to RFC 2616 invalid date formats (e.g. "0" and "-1") must be treated as in the past + return \DateTime::createFromFormat(DATE_RFC2822, 'Sat, 01 Jan 00 00:00:00 +0000'); + } + } + + /** + * Sets the Expires HTTP header with a DateTime instance. + * + * Passing null as value will remove the header. + * + * @param \DateTime|null $date A \DateTime instance or null to remove the header + * + * @return Response + * + * @api + */ + public function setExpires(\DateTime $date = null) + { + if (null === $date) { + $this->headers->remove('Expires'); + } else { + $date = clone $date; + $date->setTimezone(new \DateTimeZone('UTC')); + $this->headers->set('Expires', $date->format('D, d M Y H:i:s').' GMT'); + } + + return $this; + } + + /** + * Returns the number of seconds after the time specified in the response's Date + * header when the response should no longer be considered fresh. + * + * First, it checks for a s-maxage directive, then a max-age directive, and then it falls + * back on an expires header. It returns null when no maximum age can be established. + * + * @return int|null Number of seconds + * + * @api + */ + public function getMaxAge() + { + if ($this->headers->hasCacheControlDirective('s-maxage')) { + return (int) $this->headers->getCacheControlDirective('s-maxage'); + } + + if ($this->headers->hasCacheControlDirective('max-age')) { + return (int) $this->headers->getCacheControlDirective('max-age'); + } + + if (null !== $this->getExpires()) { + return $this->getExpires()->format('U') - $this->getDate()->format('U'); + } + } + + /** + * Sets the number of seconds after which the response should no longer be considered fresh. + * + * This methods sets the Cache-Control max-age directive. + * + * @param int $value Number of seconds + * + * @return Response + * + * @api + */ + public function setMaxAge($value) + { + $this->headers->addCacheControlDirective('max-age', $value); + + return $this; + } + + /** + * Sets the number of seconds after which the response should no longer be considered fresh by shared caches. + * + * This methods sets the Cache-Control s-maxage directive. + * + * @param int $value Number of seconds + * + * @return Response + * + * @api + */ + public function setSharedMaxAge($value) + { + $this->setPublic(); + $this->headers->addCacheControlDirective('s-maxage', $value); + + return $this; + } + + /** + * Returns the response's time-to-live in seconds. + * + * It returns null when no freshness information is present in the response. + * + * When the responses TTL is <= 0, the response may not be served from cache without first + * revalidating with the origin. + * + * @return int|null The TTL in seconds + * + * @api + */ + public function getTtl() + { + if (null !== $maxAge = $this->getMaxAge()) { + return $maxAge - $this->getAge(); + } + } + + /** + * Sets the response's time-to-live for shared caches. + * + * This method adjusts the Cache-Control/s-maxage directive. + * + * @param int $seconds Number of seconds + * + * @return Response + * + * @api + */ + public function setTtl($seconds) + { + $this->setSharedMaxAge($this->getAge() + $seconds); + + return $this; + } + + /** + * Sets the response's time-to-live for private/client caches. + * + * This method adjusts the Cache-Control/max-age directive. + * + * @param int $seconds Number of seconds + * + * @return Response + * + * @api + */ + public function setClientTtl($seconds) + { + $this->setMaxAge($this->getAge() + $seconds); + + return $this; + } + + /** + * Returns the Last-Modified HTTP header as a DateTime instance. + * + * @return \DateTime|null A DateTime instance or null if the header does not exist + * + * @throws \RuntimeException When the HTTP header is not parseable + * + * @api + */ + public function getLastModified() + { + return $this->headers->getDate('Last-Modified'); + } + + /** + * Sets the Last-Modified HTTP header with a DateTime instance. + * + * Passing null as value will remove the header. + * + * @param \DateTime|null $date A \DateTime instance or null to remove the header + * + * @return Response + * + * @api + */ + public function setLastModified(\DateTime $date = null) + { + if (null === $date) { + $this->headers->remove('Last-Modified'); + } else { + $date = clone $date; + $date->setTimezone(new \DateTimeZone('UTC')); + $this->headers->set('Last-Modified', $date->format('D, d M Y H:i:s').' GMT'); + } + + return $this; + } + + /** + * Returns the literal value of the ETag HTTP header. + * + * @return string|null The ETag HTTP header or null if it does not exist + * + * @api + */ + public function getEtag() + { + return $this->headers->get('ETag'); + } + + /** + * Sets the ETag value. + * + * @param string|null $etag The ETag unique identifier or null to remove the header + * @param bool $weak Whether you want a weak ETag or not + * + * @return Response + * + * @api + */ + public function setEtag($etag = null, $weak = false) + { + if (null === $etag) { + $this->headers->remove('Etag'); + } else { + if (0 !== strpos($etag, '"')) { + $etag = '"'.$etag.'"'; + } + + $this->headers->set('ETag', (true === $weak ? 'W/' : '').$etag); + } + + return $this; + } + + /** + * Sets the response's cache headers (validation and/or expiration). + * + * Available options are: etag, last_modified, max_age, s_maxage, private, and public. + * + * @param array $options An array of cache options + * + * @return Response + * + * @throws \InvalidArgumentException + * + * @api + */ + public function setCache(array $options) + { + if ($diff = array_diff(array_keys($options), array('etag', 'last_modified', 'max_age', 's_maxage', 'private', 'public'))) { + throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', array_values($diff)))); + } + + if (isset($options['etag'])) { + $this->setEtag($options['etag']); + } + + if (isset($options['last_modified'])) { + $this->setLastModified($options['last_modified']); + } + + if (isset($options['max_age'])) { + $this->setMaxAge($options['max_age']); + } + + if (isset($options['s_maxage'])) { + $this->setSharedMaxAge($options['s_maxage']); + } + + if (isset($options['public'])) { + if ($options['public']) { + $this->setPublic(); + } else { + $this->setPrivate(); + } + } + + if (isset($options['private'])) { + if ($options['private']) { + $this->setPrivate(); + } else { + $this->setPublic(); + } + } + + return $this; + } + + /** + * Modifies the response so that it conforms to the rules defined for a 304 status code. + * + * This sets the status, removes the body, and discards any headers + * that MUST NOT be included in 304 responses. + * + * @return Response + * + * @see http://tools.ietf.org/html/rfc2616#section-10.3.5 + * + * @api + */ + public function setNotModified() + { + $this->setStatusCode(304); + $this->setContent(null); + + // remove headers that MUST NOT be included with 304 Not Modified responses + foreach (array('Allow', 'Content-Encoding', 'Content-Language', 'Content-Length', 'Content-MD5', 'Content-Type', 'Last-Modified') as $header) { + $this->headers->remove($header); + } + + return $this; + } + + /** + * Returns true if the response includes a Vary header. + * + * @return bool true if the response includes a Vary header, false otherwise + * + * @api + */ + public function hasVary() + { + return null !== $this->headers->get('Vary'); + } + + /** + * Returns an array of header names given in the Vary header. + * + * @return array An array of Vary names + * + * @api + */ + public function getVary() + { + if (!$vary = $this->headers->get('Vary', null, false)) { + return array(); + } + + $ret = array(); + foreach ($vary as $item) { + $ret = array_merge($ret, preg_split('/[\s,]+/', $item)); + } + + return $ret; + } + + /** + * Sets the Vary header. + * + * @param string|array $headers + * @param bool $replace Whether to replace the actual value of not (true by default) + * + * @return Response + * + * @api + */ + public function setVary($headers, $replace = true) + { + $this->headers->set('Vary', $headers, $replace); + + return $this; + } + + /** + * Determines if the Response validators (ETag, Last-Modified) match + * a conditional value specified in the Request. + * + * If the Response is not modified, it sets the status code to 304 and + * removes the actual content by calling the setNotModified() method. + * + * @param Request $request A Request instance + * + * @return bool true if the Response validators match the Request, false otherwise + * + * @api + */ + public function isNotModified(Request $request) + { + if (!$request->isMethodSafe()) { + return false; + } + + $notModified = false; + $lastModified = $this->headers->get('Last-Modified'); + $modifiedSince = $request->headers->get('If-Modified-Since'); + + if ($etags = $request->getEtags()) { + $notModified = in_array($this->getEtag(), $etags) || in_array('*', $etags); + } + + if ($modifiedSince && $lastModified) { + $notModified = strtotime($modifiedSince) >= strtotime($lastModified) && (!$etags || $notModified); + } + + if ($notModified) { + $this->setNotModified(); + } + + return $notModified; + } + + // http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html + /** + * Is response invalid? + * + * @return bool + * + * @api + */ + public function isInvalid() + { + return $this->statusCode < 100 || $this->statusCode >= 600; + } + + /** + * Is response informative? + * + * @return bool + * + * @api + */ + public function isInformational() + { + return $this->statusCode >= 100 && $this->statusCode < 200; + } + + /** + * Is response successful? + * + * @return bool + * + * @api + */ + public function isSuccessful() + { + return $this->statusCode >= 200 && $this->statusCode < 300; + } + + /** + * Is the response a redirect? + * + * @return bool + * + * @api + */ + public function isRedirection() + { + return $this->statusCode >= 300 && $this->statusCode < 400; + } + + /** + * Is there a client error? + * + * @return bool + * + * @api + */ + public function isClientError() + { + return $this->statusCode >= 400 && $this->statusCode < 500; + } + + /** + * Was there a server side error? + * + * @return bool + * + * @api + */ + public function isServerError() + { + return $this->statusCode >= 500 && $this->statusCode < 600; + } + + /** + * Is the response OK? + * + * @return bool + * + * @api + */ + public function isOk() + { + return 200 === $this->statusCode; + } + + /** + * Is the response forbidden? + * + * @return bool + * + * @api + */ + public function isForbidden() + { + return 403 === $this->statusCode; + } + + /** + * Is the response a not found error? + * + * @return bool + * + * @api + */ + public function isNotFound() + { + return 404 === $this->statusCode; + } + + /** + * Is the response a redirect of some form? + * + * @param string $location + * + * @return bool + * + * @api + */ + public function isRedirect($location = null) + { + return in_array($this->statusCode, array(201, 301, 302, 303, 307, 308)) && (null === $location ?: $location == $this->headers->get('Location')); + } + + /** + * Is the response empty? + * + * @return bool + * + * @api + */ + public function isEmpty() + { + return in_array($this->statusCode, array(204, 304)); + } + + /** + * Check if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9 + * + * @link http://support.microsoft.com/kb/323308 + */ + protected function ensureIEOverSSLCompatibility(Request $request) + { + if (false !== stripos($this->headers->get('Content-Disposition'), 'attachment') && preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) == 1 && true === $request->isSecure()) { + if (intval(preg_replace("/(MSIE )(.*?);/", "$2", $match[0])) < 9) { + $this->headers->remove('Cache-Control'); + } + } + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ResponseHeaderBag.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ResponseHeaderBag.php new file mode 100644 index 0000000..f52f048 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ResponseHeaderBag.php @@ -0,0 +1,319 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * ResponseHeaderBag is a container for Response HTTP headers. + * + * @author Fabien Potencier + * + * @api + */ +class ResponseHeaderBag extends HeaderBag +{ + const COOKIES_FLAT = 'flat'; + const COOKIES_ARRAY = 'array'; + + const DISPOSITION_ATTACHMENT = 'attachment'; + const DISPOSITION_INLINE = 'inline'; + + /** + * @var array + */ + protected $computedCacheControl = array(); + + /** + * @var array + */ + protected $cookies = array(); + + /** + * @var array + */ + protected $headerNames = array(); + + /** + * Constructor. + * + * @param array $headers An array of HTTP headers + * + * @api + */ + public function __construct(array $headers = array()) + { + parent::__construct($headers); + + if (!isset($this->headers['cache-control'])) { + $this->set('Cache-Control', ''); + } + } + + /** + * {@inheritdoc} + */ + public function __toString() + { + $cookies = ''; + foreach ($this->getCookies() as $cookie) { + $cookies .= 'Set-Cookie: '.$cookie."\r\n"; + } + + ksort($this->headerNames); + + return parent::__toString().$cookies; + } + + /** + * Returns the headers, with original capitalizations. + * + * @return array An array of headers + */ + public function allPreserveCase() + { + return array_combine($this->headerNames, $this->headers); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function replace(array $headers = array()) + { + $this->headerNames = array(); + + parent::replace($headers); + + if (!isset($this->headers['cache-control'])) { + $this->set('Cache-Control', ''); + } + } + + /** + * {@inheritdoc} + * + * @api + */ + public function set($key, $values, $replace = true) + { + parent::set($key, $values, $replace); + + $uniqueKey = strtr(strtolower($key), '_', '-'); + $this->headerNames[$uniqueKey] = $key; + + // ensure the cache-control header has sensible defaults + if (in_array($uniqueKey, array('cache-control', 'etag', 'last-modified', 'expires'))) { + $computed = $this->computeCacheControlValue(); + $this->headers['cache-control'] = array($computed); + $this->headerNames['cache-control'] = 'Cache-Control'; + $this->computedCacheControl = $this->parseCacheControl($computed); + } + } + + /** + * {@inheritdoc} + * + * @api + */ + public function remove($key) + { + parent::remove($key); + + $uniqueKey = strtr(strtolower($key), '_', '-'); + unset($this->headerNames[$uniqueKey]); + + if ('cache-control' === $uniqueKey) { + $this->computedCacheControl = array(); + } + } + + /** + * {@inheritdoc} + */ + public function hasCacheControlDirective($key) + { + return array_key_exists($key, $this->computedCacheControl); + } + + /** + * {@inheritdoc} + */ + public function getCacheControlDirective($key) + { + return array_key_exists($key, $this->computedCacheControl) ? $this->computedCacheControl[$key] : null; + } + + /** + * Sets a cookie. + * + * @param Cookie $cookie + * + * @api + */ + public function setCookie(Cookie $cookie) + { + $this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie; + } + + /** + * Removes a cookie from the array, but does not unset it in the browser + * + * @param string $name + * @param string $path + * @param string $domain + * + * @api + */ + public function removeCookie($name, $path = '/', $domain = null) + { + if (null === $path) { + $path = '/'; + } + + unset($this->cookies[$domain][$path][$name]); + + if (empty($this->cookies[$domain][$path])) { + unset($this->cookies[$domain][$path]); + + if (empty($this->cookies[$domain])) { + unset($this->cookies[$domain]); + } + } + } + + /** + * Returns an array with all cookies + * + * @param string $format + * + * @throws \InvalidArgumentException When the $format is invalid + * + * @return array + * + * @api + */ + public function getCookies($format = self::COOKIES_FLAT) + { + if (!in_array($format, array(self::COOKIES_FLAT, self::COOKIES_ARRAY))) { + throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', array(self::COOKIES_FLAT, self::COOKIES_ARRAY)))); + } + + if (self::COOKIES_ARRAY === $format) { + return $this->cookies; + } + + $flattenedCookies = array(); + foreach ($this->cookies as $path) { + foreach ($path as $cookies) { + foreach ($cookies as $cookie) { + $flattenedCookies[] = $cookie; + } + } + } + + return $flattenedCookies; + } + + /** + * Clears a cookie in the browser + * + * @param string $name + * @param string $path + * @param string $domain + * + * @api + */ + public function clearCookie($name, $path = '/', $domain = null) + { + $this->setCookie(new Cookie($name, null, 1, $path, $domain)); + } + + /** + * Generates a HTTP Content-Disposition field-value. + * + * @param string $disposition One of "inline" or "attachment" + * @param string $filename A unicode string + * @param string $filenameFallback A string containing only ASCII characters that + * is semantically equivalent to $filename. If the filename is already ASCII, + * it can be omitted, or just copied from $filename + * + * @return string A string suitable for use as a Content-Disposition field-value. + * + * @throws \InvalidArgumentException + * @see RFC 6266 + */ + public function makeDisposition($disposition, $filename, $filenameFallback = '') + { + if (!in_array($disposition, array(self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE))) { + throw new \InvalidArgumentException(sprintf('The disposition must be either "%s" or "%s".', self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE)); + } + + if ('' == $filenameFallback) { + $filenameFallback = $filename; + } + + // filenameFallback is not ASCII. + if (!preg_match('/^[\x20-\x7e]*$/', $filenameFallback)) { + throw new \InvalidArgumentException('The filename fallback must only contain ASCII characters.'); + } + + // percent characters aren't safe in fallback. + if (false !== strpos($filenameFallback, '%')) { + throw new \InvalidArgumentException('The filename fallback cannot contain the "%" character.'); + } + + // path separators aren't allowed in either. + if (false !== strpos($filename, '/') || false !== strpos($filename, '\\') || false !== strpos($filenameFallback, '/') || false !== strpos($filenameFallback, '\\')) { + throw new \InvalidArgumentException('The filename and the fallback cannot contain the "/" and "\\" characters.'); + } + + $output = sprintf('%s; filename="%s"', $disposition, str_replace('"', '\\"', $filenameFallback)); + + if ($filename !== $filenameFallback) { + $output .= sprintf("; filename*=utf-8''%s", rawurlencode($filename)); + } + + return $output; + } + + /** + * Returns the calculated value of the cache-control header. + * + * This considers several other headers and calculates or modifies the + * cache-control header to a sensible, conservative value. + * + * @return string + */ + protected function computeCacheControlValue() + { + if (!$this->cacheControl && !$this->has('ETag') && !$this->has('Last-Modified') && !$this->has('Expires')) { + return 'no-cache'; + } + + if (!$this->cacheControl) { + // conservative by default + return 'private, must-revalidate'; + } + + $header = $this->getCacheControlHeader(); + if (isset($this->cacheControl['public']) || isset($this->cacheControl['private'])) { + return $header; + } + + // public if s-maxage is defined, private otherwise + if (!isset($this->cacheControl['s-maxage'])) { + return $header.', private'; + } + + return $header; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php new file mode 100644 index 0000000..6a4f2c2 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php @@ -0,0 +1,91 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * ServerBag is a container for HTTP headers from the $_SERVER variable. + * + * @author Fabien Potencier + * @author Bulat Shakirzyanov + * @author Robert Kiss + */ +class ServerBag extends ParameterBag +{ + /** + * Gets the HTTP headers. + * + * @return array + */ + public function getHeaders() + { + $headers = array(); + $contentHeaders = array('CONTENT_LENGTH' => true, 'CONTENT_MD5' => true, 'CONTENT_TYPE' => true); + foreach ($this->parameters as $key => $value) { + if (0 === strpos($key, 'HTTP_')) { + $headers[substr($key, 5)] = $value; + } + // CONTENT_* are not prefixed with HTTP_ + elseif (isset($contentHeaders[$key])) { + $headers[$key] = $value; + } + } + + if (isset($this->parameters['PHP_AUTH_USER'])) { + $headers['PHP_AUTH_USER'] = $this->parameters['PHP_AUTH_USER']; + $headers['PHP_AUTH_PW'] = isset($this->parameters['PHP_AUTH_PW']) ? $this->parameters['PHP_AUTH_PW'] : ''; + } else { + /* + * php-cgi under Apache does not pass HTTP Basic user/pass to PHP by default + * For this workaround to work, add these lines to your .htaccess file: + * RewriteCond %{HTTP:Authorization} ^(.+)$ + * RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + * + * A sample .htaccess file: + * RewriteEngine On + * RewriteCond %{HTTP:Authorization} ^(.+)$ + * RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + * RewriteCond %{REQUEST_FILENAME} !-f + * RewriteRule ^(.*)$ app.php [QSA,L] + */ + + $authorizationHeader = null; + if (isset($this->parameters['HTTP_AUTHORIZATION'])) { + $authorizationHeader = $this->parameters['HTTP_AUTHORIZATION']; + } elseif (isset($this->parameters['REDIRECT_HTTP_AUTHORIZATION'])) { + $authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION']; + } + + if (null !== $authorizationHeader) { + if (0 === stripos($authorizationHeader, 'basic ')) { + // Decode AUTHORIZATION header into PHP_AUTH_USER and PHP_AUTH_PW when authorization header is basic + $exploded = explode(':', base64_decode(substr($authorizationHeader, 6)), 2); + if (count($exploded) == 2) { + list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded; + } + } elseif (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader, 'digest '))) { + // In some circumstances PHP_AUTH_DIGEST needs to be set + $headers['PHP_AUTH_DIGEST'] = $authorizationHeader; + $this->parameters['PHP_AUTH_DIGEST'] = $authorizationHeader; + } + } + } + + // PHP_AUTH_USER/PHP_AUTH_PW + if (isset($headers['PHP_AUTH_USER'])) { + $headers['AUTHORIZATION'] = 'Basic '.base64_encode($headers['PHP_AUTH_USER'].':'.$headers['PHP_AUTH_PW']); + } elseif (isset($headers['PHP_AUTH_DIGEST'])) { + $headers['AUTHORIZATION'] = $headers['PHP_AUTH_DIGEST']; + } + + return $headers; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php new file mode 100644 index 0000000..e9d0257 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php @@ -0,0 +1,157 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Attribute; + +/** + * This class relates to session attribute storage + */ +class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Countable +{ + private $name = 'attributes'; + + /** + * @var string + */ + private $storageKey; + + /** + * @var array + */ + protected $attributes = array(); + + /** + * Constructor. + * + * @param string $storageKey The key used to store attributes in the session. + */ + public function __construct($storageKey = '_sf2_attributes') + { + $this->storageKey = $storageKey; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return $this->name; + } + + public function setName($name) + { + $this->name = $name; + } + + /** + * {@inheritdoc} + */ + public function initialize(array &$attributes) + { + $this->attributes = &$attributes; + } + + /** + * {@inheritdoc} + */ + public function getStorageKey() + { + return $this->storageKey; + } + + /** + * {@inheritdoc} + */ + public function has($name) + { + return array_key_exists($name, $this->attributes); + } + + /** + * {@inheritdoc} + */ + public function get($name, $default = null) + { + return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default; + } + + /** + * {@inheritdoc} + */ + public function set($name, $value) + { + $this->attributes[$name] = $value; + } + + /** + * {@inheritdoc} + */ + public function all() + { + return $this->attributes; + } + + /** + * {@inheritdoc} + */ + public function replace(array $attributes) + { + $this->attributes = array(); + foreach ($attributes as $key => $value) { + $this->set($key, $value); + } + } + + /** + * {@inheritdoc} + */ + public function remove($name) + { + $retval = null; + if (array_key_exists($name, $this->attributes)) { + $retval = $this->attributes[$name]; + unset($this->attributes[$name]); + } + + return $retval; + } + + /** + * {@inheritdoc} + */ + public function clear() + { + $return = $this->attributes; + $this->attributes = array(); + + return $return; + } + + /** + * Returns an iterator for attributes. + * + * @return \ArrayIterator An \ArrayIterator instance + */ + public function getIterator() + { + return new \ArrayIterator($this->attributes); + } + + /** + * Returns the number of attributes. + * + * @return int The number of attributes + */ + public function count() + { + return count($this->attributes); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php new file mode 100644 index 0000000..21f8532 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Attribute; + +use Symfony\Component\HttpFoundation\Session\SessionBagInterface; + +/** + * Attributes store. + * + * @author Drak + */ +interface AttributeBagInterface extends SessionBagInterface +{ + /** + * Checks if an attribute is defined. + * + * @param string $name The attribute name + * + * @return bool true if the attribute is defined, false otherwise + */ + public function has($name); + + /** + * Returns an attribute. + * + * @param string $name The attribute name + * @param mixed $default The default value if not found. + * + * @return mixed + */ + public function get($name, $default = null); + + /** + * Sets an attribute. + * + * @param string $name + * @param mixed $value + */ + public function set($name, $value); + + /** + * Returns attributes. + * + * @return array Attributes + */ + public function all(); + + /** + * Sets attributes. + * + * @param array $attributes Attributes + */ + public function replace(array $attributes); + + /** + * Removes an attribute. + * + * @param string $name + * + * @return mixed The removed value + */ + public function remove($name); +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php new file mode 100644 index 0000000..cf02ea3 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php @@ -0,0 +1,158 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Attribute; + +/** + * This class provides structured storage of session attributes using + * a name spacing character in the key. + * + * @author Drak + */ +class NamespacedAttributeBag extends AttributeBag +{ + /** + * Namespace character. + * + * @var string + */ + private $namespaceCharacter; + + /** + * Constructor. + * + * @param string $storageKey Session storage key. + * @param string $namespaceCharacter Namespace character to use in keys. + */ + public function __construct($storageKey = '_sf2_attributes', $namespaceCharacter = '/') + { + $this->namespaceCharacter = $namespaceCharacter; + parent::__construct($storageKey); + } + + /** + * {@inheritdoc} + */ + public function has($name) + { + $attributes = $this->resolveAttributePath($name); + $name = $this->resolveKey($name); + + if (null === $attributes) { + return false; + } + + return array_key_exists($name, $attributes); + } + + /** + * {@inheritdoc} + */ + public function get($name, $default = null) + { + $attributes = $this->resolveAttributePath($name); + $name = $this->resolveKey($name); + + if (null === $attributes) { + return $default; + } + + return array_key_exists($name, $attributes) ? $attributes[$name] : $default; + } + + /** + * {@inheritdoc} + */ + public function set($name, $value) + { + $attributes = & $this->resolveAttributePath($name, true); + $name = $this->resolveKey($name); + $attributes[$name] = $value; + } + + /** + * {@inheritdoc} + */ + public function remove($name) + { + $retval = null; + $attributes = & $this->resolveAttributePath($name); + $name = $this->resolveKey($name); + if (null !== $attributes && array_key_exists($name, $attributes)) { + $retval = $attributes[$name]; + unset($attributes[$name]); + } + + return $retval; + } + + /** + * Resolves a path in attributes property and returns it as a reference. + * + * This method allows structured namespacing of session attributes. + * + * @param string $name Key name + * @param bool $writeContext Write context, default false + * + * @return array + */ + protected function &resolveAttributePath($name, $writeContext = false) + { + $array = & $this->attributes; + $name = (strpos($name, $this->namespaceCharacter) === 0) ? substr($name, 1) : $name; + + // Check if there is anything to do, else return + if (!$name) { + return $array; + } + + $parts = explode($this->namespaceCharacter, $name); + if (count($parts) < 2) { + if (!$writeContext) { + return $array; + } + + $array[$parts[0]] = array(); + + return $array; + } + + unset($parts[count($parts)-1]); + + foreach ($parts as $part) { + if (null !== $array && !array_key_exists($part, $array)) { + $array[$part] = $writeContext ? array() : null; + } + + $array = & $array[$part]; + } + + return $array; + } + + /** + * Resolves the key from the name. + * + * This is the last part in a dot separated string. + * + * @param string $name + * + * @return string + */ + protected function resolveKey($name) + { + if (strpos($name, $this->namespaceCharacter) !== false) { + $name = substr($name, strrpos($name, $this->namespaceCharacter)+1, strlen($name)); + } + + return $name; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php new file mode 100644 index 0000000..c6e41de --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php @@ -0,0 +1,176 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Flash; + +/** + * AutoExpireFlashBag flash message container. + * + * @author Drak + */ +class AutoExpireFlashBag implements FlashBagInterface +{ + private $name = 'flashes'; + + /** + * Flash messages. + * + * @var array + */ + private $flashes = array(); + + /** + * The storage key for flashes in the session + * + * @var string + */ + private $storageKey; + + /** + * Constructor. + * + * @param string $storageKey The key used to store flashes in the session. + */ + public function __construct($storageKey = '_sf2_flashes') + { + $this->storageKey = $storageKey; + $this->flashes = array('display' => array(), 'new' => array()); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return $this->name; + } + + public function setName($name) + { + $this->name = $name; + } + + /** + * {@inheritdoc} + */ + public function initialize(array &$flashes) + { + $this->flashes = &$flashes; + + // The logic: messages from the last request will be stored in new, so we move them to previous + // This request we will show what is in 'display'. What is placed into 'new' this time round will + // be moved to display next time round. + $this->flashes['display'] = array_key_exists('new', $this->flashes) ? $this->flashes['new'] : array(); + $this->flashes['new'] = array(); + } + + /** + * {@inheritdoc} + */ + public function add($type, $message) + { + $this->flashes['new'][$type][] = $message; + } + + /** + * {@inheritdoc} + */ + public function peek($type, array $default = array()) + { + return $this->has($type) ? $this->flashes['display'][$type] : $default; + } + + /** + * {@inheritdoc} + */ + public function peekAll() + { + return array_key_exists('display', $this->flashes) ? (array) $this->flashes['display'] : array(); + } + + /** + * {@inheritdoc} + */ + public function get($type, array $default = array()) + { + $return = $default; + + if (!$this->has($type)) { + return $return; + } + + if (isset($this->flashes['display'][$type])) { + $return = $this->flashes['display'][$type]; + unset($this->flashes['display'][$type]); + } + + return $return; + } + + /** + * {@inheritdoc} + */ + public function all() + { + $return = $this->flashes['display']; + $this->flashes = array('new' => array(), 'display' => array()); + + return $return; + } + + /** + * {@inheritdoc} + */ + public function setAll(array $messages) + { + $this->flashes['new'] = $messages; + } + + /** + * {@inheritdoc} + */ + public function set($type, $messages) + { + $this->flashes['new'][$type] = (array) $messages; + } + + /** + * {@inheritdoc} + */ + public function has($type) + { + return array_key_exists($type, $this->flashes['display']) && $this->flashes['display'][$type]; + } + + /** + * {@inheritdoc} + */ + public function keys() + { + return array_keys($this->flashes['display']); + } + + /** + * {@inheritdoc} + */ + public function getStorageKey() + { + return $this->storageKey; + } + + /** + * {@inheritdoc} + */ + public function clear() + { + return $this->all(); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php new file mode 100644 index 0000000..7d7e307 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php @@ -0,0 +1,176 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Flash; + +/** + * FlashBag flash message container. + * + * @author Drak + */ +class FlashBag implements FlashBagInterface, \IteratorAggregate +{ + private $name = 'flashes'; + + /** + * Flash messages. + * + * @var array + */ + private $flashes = array(); + + /** + * The storage key for flashes in the session + * + * @var string + */ + private $storageKey; + + /** + * Constructor. + * + * @param string $storageKey The key used to store flashes in the session. + */ + public function __construct($storageKey = '_sf2_flashes') + { + $this->storageKey = $storageKey; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return $this->name; + } + + public function setName($name) + { + $this->name = $name; + } + + /** + * {@inheritdoc} + */ + public function initialize(array &$flashes) + { + $this->flashes = &$flashes; + } + + /** + * {@inheritdoc} + */ + public function add($type, $message) + { + $this->flashes[$type][] = $message; + } + + /** + * {@inheritdoc} + */ + public function peek($type, array $default = array()) + { + return $this->has($type) ? $this->flashes[$type] : $default; + } + + /** + * {@inheritdoc} + */ + public function peekAll() + { + return $this->flashes; + } + + /** + * {@inheritdoc} + */ + public function get($type, array $default = array()) + { + if (!$this->has($type)) { + return $default; + } + + $return = $this->flashes[$type]; + + unset($this->flashes[$type]); + + return $return; + } + + /** + * {@inheritdoc} + */ + public function all() + { + $return = $this->peekAll(); + $this->flashes = array(); + + return $return; + } + + /** + * {@inheritdoc} + */ + public function set($type, $messages) + { + $this->flashes[$type] = (array) $messages; + } + + /** + * {@inheritdoc} + */ + public function setAll(array $messages) + { + $this->flashes = $messages; + } + + /** + * {@inheritdoc} + */ + public function has($type) + { + return array_key_exists($type, $this->flashes) && $this->flashes[$type]; + } + + /** + * {@inheritdoc} + */ + public function keys() + { + return array_keys($this->flashes); + } + + /** + * {@inheritdoc} + */ + public function getStorageKey() + { + return $this->storageKey; + } + + /** + * {@inheritdoc} + */ + public function clear() + { + return $this->all(); + } + + /** + * Returns an iterator for flashes. + * + * @return \ArrayIterator An \ArrayIterator instance + */ + public function getIterator() + { + return new \ArrayIterator($this->all()); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php new file mode 100644 index 0000000..be79d9d --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Flash; + +use Symfony\Component\HttpFoundation\Session\SessionBagInterface; + +/** + * FlashBagInterface. + * + * @author Drak + */ +interface FlashBagInterface extends SessionBagInterface +{ + /** + * Adds a flash message for type. + * + * @param string $type + * @param string $message + */ + public function add($type, $message); + + /** + * Registers a message for a given type. + * + * @param string $type + * @param string|array $message + */ + public function set($type, $message); + + /** + * Gets flash messages for a given type. + * + * @param string $type Message category type. + * @param array $default Default value if $type does not exist. + * + * @return array + */ + public function peek($type, array $default = array()); + + /** + * Gets all flash messages. + * + * @return array + */ + public function peekAll(); + + /** + * Gets and clears flash from the stack. + * + * @param string $type + * @param array $default Default value if $type does not exist. + * + * @return array + */ + public function get($type, array $default = array()); + + /** + * Gets and clears flashes from the stack. + * + * @return array + */ + public function all(); + + /** + * Sets all flash messages. + */ + public function setAll(array $messages); + + /** + * Has flash messages for a given type? + * + * @param string $type + * + * @return bool + */ + public function has($type); + + /** + * Returns a list of all defined types. + * + * @return array + */ + public function keys(); +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php new file mode 100644 index 0000000..ac626fd --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php @@ -0,0 +1,251 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session; + +use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface; +use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag; +use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface; +use Symfony\Component\HttpFoundation\Session\Flash\FlashBag; +use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; +use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; + +/** + * Session. + * + * @author Fabien Potencier + * @author Drak + * + * @api + */ +class Session implements SessionInterface, \IteratorAggregate, \Countable +{ + /** + * Storage driver. + * + * @var SessionStorageInterface + */ + protected $storage; + + /** + * @var string + */ + private $flashName; + + /** + * @var string + */ + private $attributeName; + + /** + * Constructor. + * + * @param SessionStorageInterface $storage A SessionStorageInterface instance. + * @param AttributeBagInterface $attributes An AttributeBagInterface instance, (defaults null for default AttributeBag) + * @param FlashBagInterface $flashes A FlashBagInterface instance (defaults null for default FlashBag) + */ + public function __construct(SessionStorageInterface $storage = null, AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null) + { + $this->storage = $storage ?: new NativeSessionStorage(); + + $attributes = $attributes ?: new AttributeBag(); + $this->attributeName = $attributes->getName(); + $this->registerBag($attributes); + + $flashes = $flashes ?: new FlashBag(); + $this->flashName = $flashes->getName(); + $this->registerBag($flashes); + } + + /** + * {@inheritdoc} + */ + public function start() + { + return $this->storage->start(); + } + + /** + * {@inheritdoc} + */ + public function has($name) + { + return $this->storage->getBag($this->attributeName)->has($name); + } + + /** + * {@inheritdoc} + */ + public function get($name, $default = null) + { + return $this->storage->getBag($this->attributeName)->get($name, $default); + } + + /** + * {@inheritdoc} + */ + public function set($name, $value) + { + $this->storage->getBag($this->attributeName)->set($name, $value); + } + + /** + * {@inheritdoc} + */ + public function all() + { + return $this->storage->getBag($this->attributeName)->all(); + } + + /** + * {@inheritdoc} + */ + public function replace(array $attributes) + { + $this->storage->getBag($this->attributeName)->replace($attributes); + } + + /** + * {@inheritdoc} + */ + public function remove($name) + { + return $this->storage->getBag($this->attributeName)->remove($name); + } + + /** + * {@inheritdoc} + */ + public function clear() + { + $this->storage->getBag($this->attributeName)->clear(); + } + + /** + * {@inheritdoc} + */ + public function isStarted() + { + return $this->storage->isStarted(); + } + + /** + * Returns an iterator for attributes. + * + * @return \ArrayIterator An \ArrayIterator instance + */ + public function getIterator() + { + return new \ArrayIterator($this->storage->getBag($this->attributeName)->all()); + } + + /** + * Returns the number of attributes. + * + * @return int The number of attributes + */ + public function count() + { + return count($this->storage->getBag($this->attributeName)->all()); + } + + /** + * {@inheritdoc} + */ + public function invalidate($lifetime = null) + { + $this->storage->clear(); + + return $this->migrate(true, $lifetime); + } + + /** + * {@inheritdoc} + */ + public function migrate($destroy = false, $lifetime = null) + { + return $this->storage->regenerate($destroy, $lifetime); + } + + /** + * {@inheritdoc} + */ + public function save() + { + $this->storage->save(); + } + + /** + * {@inheritdoc} + */ + public function getId() + { + return $this->storage->getId(); + } + + /** + * {@inheritdoc} + */ + public function setId($id) + { + $this->storage->setId($id); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return $this->storage->getName(); + } + + /** + * {@inheritdoc} + */ + public function setName($name) + { + $this->storage->setName($name); + } + + /** + * {@inheritdoc} + */ + public function getMetadataBag() + { + return $this->storage->getMetadataBag(); + } + + /** + * {@inheritdoc} + */ + public function registerBag(SessionBagInterface $bag) + { + $this->storage->registerBag($bag); + } + + /** + * {@inheritdoc} + */ + public function getBag($name) + { + return $this->storage->getBag($name); + } + + /** + * Gets the flashbag interface. + * + * @return FlashBagInterface + */ + public function getFlashBag() + { + return $this->getBag($this->flashName); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php new file mode 100644 index 0000000..f8d3d32 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session; + +/** + * Session Bag store. + * + * @author Drak + */ +interface SessionBagInterface +{ + /** + * Gets this bag's name + * + * @return string + */ + public function getName(); + + /** + * Initializes the Bag + * + * @param array $array + */ + public function initialize(array &$array); + + /** + * Gets the storage key for this bag. + * + * @return string + */ + public function getStorageKey(); + + /** + * Clears out data from bag. + * + * @return mixed Whatever data was contained. + */ + public function clear(); +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionInterface.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionInterface.php new file mode 100644 index 0000000..c4d5877 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionInterface.php @@ -0,0 +1,208 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session; + +use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag; + +/** + * Interface for the session. + * + * @author Drak + */ +interface SessionInterface +{ + /** + * Starts the session storage. + * + * @return bool True if session started. + * + * @throws \RuntimeException If session fails to start. + * + * @api + */ + public function start(); + + /** + * Returns the session ID. + * + * @return string The session ID. + * + * @api + */ + public function getId(); + + /** + * Sets the session ID + * + * @param string $id + * + * @api + */ + public function setId($id); + + /** + * Returns the session name. + * + * @return mixed The session name. + * + * @api + */ + public function getName(); + + /** + * Sets the session name. + * + * @param string $name + * + * @api + */ + public function setName($name); + + /** + * Invalidates the current session. + * + * Clears all session attributes and flashes and regenerates the + * session and deletes the old session from persistence. + * + * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value + * will leave the system settings unchanged, 0 sets the cookie + * to expire with browser session. Time is in seconds, and is + * not a Unix timestamp. + * + * @return bool True if session invalidated, false if error. + * + * @api + */ + public function invalidate($lifetime = null); + + /** + * Migrates the current session to a new session id while maintaining all + * session attributes. + * + * @param bool $destroy Whether to delete the old session or leave it to garbage collection. + * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value + * will leave the system settings unchanged, 0 sets the cookie + * to expire with browser session. Time is in seconds, and is + * not a Unix timestamp. + * + * @return bool True if session migrated, false if error. + * + * @api + */ + public function migrate($destroy = false, $lifetime = null); + + /** + * Force the session to be saved and closed. + * + * This method is generally not required for real sessions as + * the session will be automatically saved at the end of + * code execution. + */ + public function save(); + + /** + * Checks if an attribute is defined. + * + * @param string $name The attribute name + * + * @return bool true if the attribute is defined, false otherwise + * + * @api + */ + public function has($name); + + /** + * Returns an attribute. + * + * @param string $name The attribute name + * @param mixed $default The default value if not found. + * + * @return mixed + * + * @api + */ + public function get($name, $default = null); + + /** + * Sets an attribute. + * + * @param string $name + * @param mixed $value + * + * @api + */ + public function set($name, $value); + + /** + * Returns attributes. + * + * @return array Attributes + * + * @api + */ + public function all(); + + /** + * Sets attributes. + * + * @param array $attributes Attributes + */ + public function replace(array $attributes); + + /** + * Removes an attribute. + * + * @param string $name + * + * @return mixed The removed value + * + * @api + */ + public function remove($name); + + /** + * Clears all attributes. + * + * @api + */ + public function clear(); + + /** + * Checks if the session was started. + * + * @return bool + */ + public function isStarted(); + + /** + * Registers a SessionBagInterface with the session. + * + * @param SessionBagInterface $bag + */ + public function registerBag(SessionBagInterface $bag); + + /** + * Gets a bag instance by name. + * + * @param string $name + * + * @return SessionBagInterface + */ + public function getBag($name); + + /** + * Gets session meta. + * + * @return MetadataBag + */ + public function getMetadataBag(); +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php new file mode 100644 index 0000000..cec1d31 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php @@ -0,0 +1,109 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * MemcacheSessionHandler. + * + * @author Drak + */ +class MemcacheSessionHandler implements \SessionHandlerInterface +{ + /** + * @var \Memcache Memcache driver. + */ + private $memcache; + + /** + * @var int Time to live in seconds + */ + private $ttl; + + /** + * @var string Key prefix for shared environments. + */ + private $prefix; + + /** + * Constructor. + * + * List of available options: + * * prefix: The prefix to use for the memcache keys in order to avoid collision + * * expiretime: The time to live in seconds + * + * @param \Memcache $memcache A \Memcache instance + * @param array $options An associative array of Memcache options + * + * @throws \InvalidArgumentException When unsupported options are passed + */ + public function __construct(\Memcache $memcache, array $options = array()) + { + if ($diff = array_diff(array_keys($options), array('prefix', 'expiretime'))) { + throw new \InvalidArgumentException(sprintf( + 'The following options are not supported "%s"', implode(', ', $diff) + )); + } + + $this->memcache = $memcache; + $this->ttl = isset($options['expiretime']) ? (int) $options['expiretime'] : 86400; + $this->prefix = isset($options['prefix']) ? $options['prefix'] : 'sf2s'; + } + + /** + * {@inheritdoc} + */ + public function open($savePath, $sessionName) + { + return true; + } + + /** + * {@inheritdoc} + */ + public function close() + { + return $this->memcache->close(); + } + + /** + * {@inheritdoc} + */ + public function read($sessionId) + { + return $this->memcache->get($this->prefix.$sessionId) ?: ''; + } + + /** + * {@inheritdoc} + */ + public function write($sessionId, $data) + { + return $this->memcache->set($this->prefix.$sessionId, $data, 0, time() + $this->ttl); + } + + /** + * {@inheritdoc} + */ + public function destroy($sessionId) + { + return $this->memcache->delete($this->prefix.$sessionId); + } + + /** + * {@inheritdoc} + */ + public function gc($maxlifetime) + { + // not required here because memcache will auto expire the records anyhow. + return true; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php new file mode 100644 index 0000000..30da22d --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php @@ -0,0 +1,115 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * MemcachedSessionHandler. + * + * Memcached based session storage handler based on the Memcached class + * provided by the PHP memcached extension. + * + * @see http://php.net/memcached + * + * @author Drak + */ +class MemcachedSessionHandler implements \SessionHandlerInterface +{ + /** + * @var \Memcached Memcached driver. + */ + private $memcached; + + /** + * @var int Time to live in seconds + */ + private $ttl; + + /** + * @var string Key prefix for shared environments. + */ + private $prefix; + + /** + * Constructor. + * + * List of available options: + * * prefix: The prefix to use for the memcached keys in order to avoid collision + * * expiretime: The time to live in seconds + * + * @param \Memcached $memcached A \Memcached instance + * @param array $options An associative array of Memcached options + * + * @throws \InvalidArgumentException When unsupported options are passed + */ + public function __construct(\Memcached $memcached, array $options = array()) + { + $this->memcached = $memcached; + + if ($diff = array_diff(array_keys($options), array('prefix', 'expiretime'))) { + throw new \InvalidArgumentException(sprintf( + 'The following options are not supported "%s"', implode(', ', $diff) + )); + } + + $this->ttl = isset($options['expiretime']) ? (int) $options['expiretime'] : 86400; + $this->prefix = isset($options['prefix']) ? $options['prefix'] : 'sf2s'; + } + + /** + * {@inheritdoc} + */ + public function open($savePath, $sessionName) + { + return true; + } + + /** + * {@inheritdoc} + */ + public function close() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function read($sessionId) + { + return $this->memcached->get($this->prefix.$sessionId) ?: ''; + } + + /** + * {@inheritdoc} + */ + public function write($sessionId, $data) + { + return $this->memcached->set($this->prefix.$sessionId, $data, time() + $this->ttl); + } + + /** + * {@inheritdoc} + */ + public function destroy($sessionId) + { + return $this->memcached->delete($this->prefix.$sessionId); + } + + /** + * {@inheritdoc} + */ + public function gc($maxlifetime) + { + // not required here because memcached will auto expire the records anyhow. + return true; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php new file mode 100644 index 0000000..ca7920c --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php @@ -0,0 +1,163 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * MongoDB session handler + * + * @author Markus Bachmann + */ +class MongoDbSessionHandler implements \SessionHandlerInterface +{ + /** + * @var \Mongo + */ + private $mongo; + + /** + * @var \MongoCollection + */ + private $collection; + + /** + * @var array + */ + private $options; + + /** + * Constructor. + * + * List of available options: + * * database: The name of the database [required] + * * collection: The name of the collection [required] + * * id_field: The field name for storing the session id [default: _id] + * * data_field: The field name for storing the session data [default: data] + * * time_field: The field name for storing the timestamp [default: time] + * + * @param \Mongo|\MongoClient $mongo A MongoClient or Mongo instance + * @param array $options An associative array of field options + * + * @throws \InvalidArgumentException When MongoClient or Mongo instance not provided + * @throws \InvalidArgumentException When "database" or "collection" not provided + */ + public function __construct($mongo, array $options) + { + if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo)) { + throw new \InvalidArgumentException('MongoClient or Mongo instance required'); + } + + if (!isset($options['database']) || !isset($options['collection'])) { + throw new \InvalidArgumentException('You must provide the "database" and "collection" option for MongoDBSessionHandler'); + } + + $this->mongo = $mongo; + + $this->options = array_merge(array( + 'id_field' => '_id', + 'data_field' => 'data', + 'time_field' => 'time', + ), $options); + } + + /** + * {@inheritdoc} + */ + public function open($savePath, $sessionName) + { + return true; + } + + /** + * {@inheritdoc} + */ + public function close() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function destroy($sessionId) + { + $this->getCollection()->remove(array( + $this->options['id_field'] => $sessionId, + )); + + return true; + } + + /** + * {@inheritdoc} + */ + public function gc($maxlifetime) + { + /* Note: MongoDB 2.2+ supports TTL collections, which may be used in + * place of this method by indexing the "time_field" field with an + * "expireAfterSeconds" option. Regardless of whether TTL collections + * are used, consider indexing this field to make the remove query more + * efficient. + * + * See: http://docs.mongodb.org/manual/tutorial/expire-data/ + */ + $time = new \MongoDate(time() - $maxlifetime); + + $this->getCollection()->remove(array( + $this->options['time_field'] => array('$lt' => $time), + )); + + return true; + } + + /** + * {@inheritdoc} + */ + public function write($sessionId, $data) + { + $this->getCollection()->update( + array($this->options['id_field'] => $sessionId), + array('$set' => array( + $this->options['data_field'] => new \MongoBinData($data, \MongoBinData::BYTE_ARRAY), + $this->options['time_field'] => new \MongoDate(), + )), + array('upsert' => true, 'multiple' => false) + ); + + return true; + } + + /** + * {@inheritdoc} + */ + public function read($sessionId) + { + $dbData = $this->getCollection()->findOne(array( + $this->options['id_field'] => $sessionId, + )); + + return null === $dbData ? '' : $dbData[$this->options['data_field']]->bin; + } + + /** + * Return a "MongoCollection" instance + * + * @return \MongoCollection + */ + private function getCollection() + { + if (null === $this->collection) { + $this->collection = $this->mongo->selectCollection($this->options['database'], $this->options['collection']); + } + + return $this->collection; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php new file mode 100644 index 0000000..f39235c --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * NativeFileSessionHandler. + * + * Native session handler using PHP's built in file storage. + * + * @author Drak + */ +class NativeFileSessionHandler extends NativeSessionHandler +{ + /** + * Constructor. + * + * @param string $savePath Path of directory to save session files. + * Default null will leave setting as defined by PHP. + * '/path', 'N;/path', or 'N;octal-mode;/path + * + * @see http://php.net/session.configuration.php#ini.session.save-path for further details. + * + * @throws \InvalidArgumentException On invalid $savePath + */ + public function __construct($savePath = null) + { + if (null === $savePath) { + $savePath = ini_get('session.save_path'); + } + + $baseDir = $savePath; + + if ($count = substr_count($savePath, ';')) { + if ($count > 2) { + throw new \InvalidArgumentException(sprintf('Invalid argument $savePath \'%s\'', $savePath)); + } + + // characters after last ';' are the path + $baseDir = ltrim(strrchr($savePath, ';'), ';'); + } + + if ($baseDir && !is_dir($baseDir)) { + mkdir($baseDir, 0777, true); + } + + ini_set('session.save_path', $savePath); + ini_set('session.save_handler', 'files'); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php new file mode 100644 index 0000000..22acdec --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * Adds SessionHandler functionality if available. + * + * @see http://php.net/sessionhandler + */ + +if (version_compare(phpversion(), '5.4.0', '>=')) { + class NativeSessionHandler extends \SessionHandler + { + } +} else { + class NativeSessionHandler + { + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php new file mode 100644 index 0000000..d88ce89 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * NullSessionHandler. + * + * Can be used in unit testing or in a situations where persisted sessions are not desired. + * + * @author Drak + * + * @api + */ +class NullSessionHandler implements \SessionHandlerInterface +{ + /** + * {@inheritdoc} + */ + public function open($savePath, $sessionName) + { + return true; + } + + /** + * {@inheritdoc} + */ + public function close() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function read($sessionId) + { + return ''; + } + + /** + * {@inheritdoc} + */ + public function write($sessionId, $data) + { + return true; + } + + /** + * {@inheritdoc} + */ + public function destroy($sessionId) + { + return true; + } + + /** + * {@inheritdoc} + */ + public function gc($maxlifetime) + { + return true; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php new file mode 100644 index 0000000..569e089 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php @@ -0,0 +1,255 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * Session handler using a PDO connection to read and write data. + * + * Session data is a binary string that can contain non-printable characters like the null byte. + * For this reason this handler base64 encodes the data to be able to save it in a character column. + * + * This version of the PdoSessionHandler does NOT implement locking. So concurrent requests to the + * same session can result in data loss due to race conditions. + * + * @author Fabien Potencier + * @author Michael Williams + * @author Tobias Schultze + */ +class PdoSessionHandler implements \SessionHandlerInterface +{ + /** + * @var \PDO PDO instance + */ + private $pdo; + + /** + * @var string Table name + */ + private $table; + + /** + * @var string Column for session id + */ + private $idCol; + + /** + * @var string Column for session data + */ + private $dataCol; + + /** + * @var string Column for timestamp + */ + private $timeCol; + + /** + * Constructor. + * + * List of available options: + * * db_table: The name of the table [required] + * * db_id_col: The column where to store the session id [default: sess_id] + * * db_data_col: The column where to store the session data [default: sess_data] + * * db_time_col: The column where to store the timestamp [default: sess_time] + * + * @param \PDO $pdo A \PDO instance + * @param array $dbOptions An associative array of DB options + * + * @throws \InvalidArgumentException When "db_table" option is not provided + */ + public function __construct(\PDO $pdo, array $dbOptions = array()) + { + if (!array_key_exists('db_table', $dbOptions)) { + throw new \InvalidArgumentException('You must provide the "db_table" option for a PdoSessionStorage.'); + } + if (\PDO::ERRMODE_EXCEPTION !== $pdo->getAttribute(\PDO::ATTR_ERRMODE)) { + throw new \InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION))', __CLASS__)); + } + $this->pdo = $pdo; + $dbOptions = array_merge(array( + 'db_id_col' => 'sess_id', + 'db_data_col' => 'sess_data', + 'db_time_col' => 'sess_time', + ), $dbOptions); + + $this->table = $dbOptions['db_table']; + $this->idCol = $dbOptions['db_id_col']; + $this->dataCol = $dbOptions['db_data_col']; + $this->timeCol = $dbOptions['db_time_col']; + } + + /** + * {@inheritdoc} + */ + public function open($savePath, $sessionName) + { + return true; + } + + /** + * {@inheritdoc} + */ + public function close() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function destroy($sessionId) + { + // delete the record associated with this id + $sql = "DELETE FROM $this->table WHERE $this->idCol = :id"; + + try { + $stmt = $this->pdo->prepare($sql); + $stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); + $stmt->execute(); + } catch (\PDOException $e) { + throw new \RuntimeException(sprintf('PDOException was thrown when trying to delete a session: %s', $e->getMessage()), 0, $e); + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function gc($maxlifetime) + { + // delete the session records that have expired + $sql = "DELETE FROM $this->table WHERE $this->timeCol < :time"; + + try { + $stmt = $this->pdo->prepare($sql); + $stmt->bindValue(':time', time() - $maxlifetime, \PDO::PARAM_INT); + $stmt->execute(); + } catch (\PDOException $e) { + throw new \RuntimeException(sprintf('PDOException was thrown when trying to delete expired sessions: %s', $e->getMessage()), 0, $e); + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function read($sessionId) + { + $sql = "SELECT $this->dataCol FROM $this->table WHERE $this->idCol = :id"; + + try { + $stmt = $this->pdo->prepare($sql); + $stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); + $stmt->execute(); + + // We use fetchAll instead of fetchColumn to make sure the DB cursor gets closed + $sessionRows = $stmt->fetchAll(\PDO::FETCH_NUM); + + if ($sessionRows) { + return base64_decode($sessionRows[0][0]); + } + + return ''; + } catch (\PDOException $e) { + throw new \RuntimeException(sprintf('PDOException was thrown when trying to read the session data: %s', $e->getMessage()), 0, $e); + } + } + + /** + * {@inheritdoc} + */ + public function write($sessionId, $data) + { + $encoded = base64_encode($data); + + try { + // We use a single MERGE SQL query when supported by the database. + $mergeSql = $this->getMergeSql(); + + if (null !== $mergeSql) { + $mergeStmt = $this->pdo->prepare($mergeSql); + $mergeStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); + $mergeStmt->bindParam(':data', $encoded, \PDO::PARAM_STR); + $mergeStmt->bindValue(':time', time(), \PDO::PARAM_INT); + $mergeStmt->execute(); + + return true; + } + + $updateStmt = $this->pdo->prepare( + "UPDATE $this->table SET $this->dataCol = :data, $this->timeCol = :time WHERE $this->idCol = :id" + ); + $updateStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); + $updateStmt->bindParam(':data', $encoded, \PDO::PARAM_STR); + $updateStmt->bindValue(':time', time(), \PDO::PARAM_INT); + $updateStmt->execute(); + + // When MERGE is not supported, like in Postgres, we have to use this approach that can result in + // duplicate key errors when the same session is written simultaneously. We can just catch such an + // error and re-execute the update. This is similar to a serializable transaction with retry logic + // on serialization failures but without the overhead and without possible false positives due to + // longer gap locking. + if (!$updateStmt->rowCount()) { + try { + $insertStmt = $this->pdo->prepare( + "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time)" + ); + $insertStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); + $insertStmt->bindParam(':data', $encoded, \PDO::PARAM_STR); + $insertStmt->bindValue(':time', time(), \PDO::PARAM_INT); + $insertStmt->execute(); + } catch (\PDOException $e) { + // Handle integrity violation SQLSTATE 23000 (or a subclass like 23505 in Postgres) for duplicate keys + if (0 === strpos($e->getCode(), '23')) { + $updateStmt->execute(); + } else { + throw $e; + } + } + } + } catch (\PDOException $e) { + throw new \RuntimeException(sprintf('PDOException was thrown when trying to write the session data: %s', $e->getMessage()), 0, $e); + } + + return true; + } + + /** + * Returns a merge/upsert (i.e. insert or update) SQL query when supported by the database. + * + * @return string|null The SQL string or null when not supported + */ + private function getMergeSql() + { + $driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME); + + switch ($driver) { + case 'mysql': + return "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ". + "ON DUPLICATE KEY UPDATE $this->dataCol = VALUES($this->dataCol), $this->timeCol = VALUES($this->timeCol)"; + case 'oci': + // DUAL is Oracle specific dummy table + return "MERGE INTO $this->table USING DUAL ON ($this->idCol = :id) ". + "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ". + "WHEN MATCHED THEN UPDATE SET $this->dataCol = :data, $this->timeCol = :time"; + case 'sqlsrv' === $driver && version_compare($this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION), '10', '>='): + // MERGE is only available since SQL Server 2008 and must be terminated by semicolon + // It also requires HOLDLOCK according to http://weblogs.sqlteam.com/dang/archive/2009/01/31/UPSERT-Race-Condition-With-MERGE.aspx + return "MERGE INTO $this->table WITH (HOLDLOCK) USING (SELECT 1 AS dummy) AS src ON ($this->idCol = :id) ". + "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ". + "WHEN MATCHED THEN UPDATE SET $this->dataCol = :data, $this->timeCol = :time;"; + case 'sqlite': + return "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time)"; + } + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php new file mode 100644 index 0000000..1291ffd --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php @@ -0,0 +1,160 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Session\SessionBagInterface; + +/** + * Metadata container. + * + * Adds metadata to the session. + * + * @author Drak + */ +class MetadataBag implements SessionBagInterface +{ + const CREATED = 'c'; + const UPDATED = 'u'; + const LIFETIME = 'l'; + + /** + * @var string + */ + private $name = '__metadata'; + + /** + * @var string + */ + private $storageKey; + + /** + * @var array + */ + protected $meta = array(); + + /** + * Unix timestamp. + * + * @var int + */ + private $lastUsed; + + /** + * Constructor. + * + * @param string $storageKey The key used to store bag in the session. + */ + public function __construct($storageKey = '_sf2_meta') + { + $this->storageKey = $storageKey; + $this->meta = array(self::CREATED => 0, self::UPDATED => 0, self::LIFETIME => 0); + } + + /** + * {@inheritdoc} + */ + public function initialize(array &$array) + { + $this->meta = &$array; + + if (isset($array[self::CREATED])) { + $this->lastUsed = $this->meta[self::UPDATED]; + $this->meta[self::UPDATED] = time(); + } else { + $this->stampCreated(); + } + } + + /** + * Gets the lifetime that the session cookie was set with. + * + * @return int + */ + public function getLifetime() + { + return $this->meta[self::LIFETIME]; + } + + /** + * Stamps a new session's metadata. + * + * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value + * will leave the system settings unchanged, 0 sets the cookie + * to expire with browser session. Time is in seconds, and is + * not a Unix timestamp. + */ + public function stampNew($lifetime = null) + { + $this->stampCreated($lifetime); + } + + /** + * {@inheritdoc} + */ + public function getStorageKey() + { + return $this->storageKey; + } + + /** + * Gets the created timestamp metadata. + * + * @return int Unix timestamp + */ + public function getCreated() + { + return $this->meta[self::CREATED]; + } + + /** + * Gets the last used metadata. + * + * @return int Unix timestamp + */ + public function getLastUsed() + { + return $this->lastUsed; + } + + /** + * {@inheritdoc} + */ + public function clear() + { + // nothing to do + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return $this->name; + } + + /** + * Sets name. + * + * @param string $name + */ + public function setName($name) + { + $this->name = $name; + } + + private function stampCreated($lifetime = null) + { + $timeStamp = time(); + $this->meta[self::CREATED] = $this->meta[self::UPDATED] = $this->lastUsed = $timeStamp; + $this->meta[self::LIFETIME] = (null === $lifetime) ? ini_get('session.cookie_lifetime') : $lifetime; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php new file mode 100644 index 0000000..9187356 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php @@ -0,0 +1,268 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Session\SessionBagInterface; + +/** + * MockArraySessionStorage mocks the session for unit tests. + * + * No PHP session is actually started since a session can be initialized + * and shutdown only once per PHP execution cycle. + * + * When doing functional testing, you should use MockFileSessionStorage instead. + * + * @author Fabien Potencier + * @author Bulat Shakirzyanov + * @author Drak + */ +class MockArraySessionStorage implements SessionStorageInterface +{ + /** + * @var string + */ + protected $id = ''; + + /** + * @var string + */ + protected $name; + + /** + * @var bool + */ + protected $started = false; + + /** + * @var bool + */ + protected $closed = false; + + /** + * @var array + */ + protected $data = array(); + + /** + * @var MetadataBag + */ + protected $metadataBag; + + /** + * @var array + */ + protected $bags; + + /** + * Constructor. + * + * @param string $name Session name + * @param MetadataBag $metaBag MetadataBag instance. + */ + public function __construct($name = 'MOCKSESSID', MetadataBag $metaBag = null) + { + $this->name = $name; + $this->setMetadataBag($metaBag); + } + + /** + * Sets the session data. + * + * @param array $array + */ + public function setSessionData(array $array) + { + $this->data = $array; + } + + /** + * {@inheritdoc} + */ + public function start() + { + if ($this->started && !$this->closed) { + return true; + } + + if (empty($this->id)) { + $this->id = $this->generateId(); + } + + $this->loadSession(); + + return true; + } + + /** + * {@inheritdoc} + */ + public function regenerate($destroy = false, $lifetime = null) + { + if (!$this->started) { + $this->start(); + } + + $this->metadataBag->stampNew($lifetime); + $this->id = $this->generateId(); + + return true; + } + + /** + * {@inheritdoc} + */ + public function getId() + { + return $this->id; + } + + /** + * {@inheritdoc} + */ + public function setId($id) + { + if ($this->started) { + throw new \LogicException('Cannot set session ID after the session has started.'); + } + + $this->id = $id; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return $this->name; + } + + /** + * {@inheritdoc} + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * {@inheritdoc} + */ + public function save() + { + if (!$this->started || $this->closed) { + throw new \RuntimeException("Trying to save a session that was not started yet or was already closed"); + } + // nothing to do since we don't persist the session data + $this->closed = false; + $this->started = false; + } + + /** + * {@inheritdoc} + */ + public function clear() + { + // clear out the bags + foreach ($this->bags as $bag) { + $bag->clear(); + } + + // clear out the session + $this->data = array(); + + // reconnect the bags to the session + $this->loadSession(); + } + + /** + * {@inheritdoc} + */ + public function registerBag(SessionBagInterface $bag) + { + $this->bags[$bag->getName()] = $bag; + } + + /** + * {@inheritdoc} + */ + public function getBag($name) + { + if (!isset($this->bags[$name])) { + throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered.', $name)); + } + + if (!$this->started) { + $this->start(); + } + + return $this->bags[$name]; + } + + /** + * {@inheritdoc} + */ + public function isStarted() + { + return $this->started; + } + + /** + * Sets the MetadataBag. + * + * @param MetadataBag $bag + */ + public function setMetadataBag(MetadataBag $bag = null) + { + if (null === $bag) { + $bag = new MetadataBag(); + } + + $this->metadataBag = $bag; + } + + /** + * Gets the MetadataBag. + * + * @return MetadataBag + */ + public function getMetadataBag() + { + return $this->metadataBag; + } + + /** + * Generates a session ID. + * + * This doesn't need to be particularly cryptographically secure since this is just + * a mock. + * + * @return string + */ + protected function generateId() + { + return sha1(uniqid(mt_rand())); + } + + protected function loadSession() + { + $bags = array_merge($this->bags, array($this->metadataBag)); + + foreach ($bags as $bag) { + $key = $bag->getStorageKey(); + $this->data[$key] = isset($this->data[$key]) ? $this->data[$key] : array(); + $bag->initialize($this->data[$key]); + } + + $this->started = true; + $this->closed = false; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php new file mode 100644 index 0000000..f1a699b --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php @@ -0,0 +1,138 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +/** + * MockFileSessionStorage is used to mock sessions for + * functional testing when done in a single PHP process. + * + * No PHP session is actually started since a session can be initialized + * and shutdown only once per PHP execution cycle and this class does + * not pollute any session related globals, including session_*() functions + * or session.* PHP ini directives. + * + * @author Drak + */ +class MockFileSessionStorage extends MockArraySessionStorage +{ + /** + * @var string + */ + private $savePath; + + /** + * Constructor. + * + * @param string $savePath Path of directory to save session files. + * @param string $name Session name. + * @param MetadataBag $metaBag MetadataBag instance. + */ + public function __construct($savePath = null, $name = 'MOCKSESSID', MetadataBag $metaBag = null) + { + if (null === $savePath) { + $savePath = sys_get_temp_dir(); + } + + if (!is_dir($savePath)) { + mkdir($savePath, 0777, true); + } + + $this->savePath = $savePath; + + parent::__construct($name, $metaBag); + } + + /** + * {@inheritdoc} + */ + public function start() + { + if ($this->started) { + return true; + } + + if (!$this->id) { + $this->id = $this->generateId(); + } + + $this->read(); + + $this->started = true; + + return true; + } + + /** + * {@inheritdoc} + */ + public function regenerate($destroy = false, $lifetime = null) + { + if (!$this->started) { + $this->start(); + } + + if ($destroy) { + $this->destroy(); + } + + return parent::regenerate($destroy, $lifetime); + } + + /** + * {@inheritdoc} + */ + public function save() + { + if (!$this->started) { + throw new \RuntimeException("Trying to save a session that was not started yet or was already closed"); + } + + file_put_contents($this->getFilePath(), serialize($this->data)); + + // this is needed for Silex, where the session object is re-used across requests + // in functional tests. In Symfony, the container is rebooted, so we don't have + // this issue + $this->started = false; + } + + /** + * Deletes a session from persistent storage. + * Deliberately leaves session data in memory intact. + */ + private function destroy() + { + if (is_file($this->getFilePath())) { + unlink($this->getFilePath()); + } + } + + /** + * Calculate path to file. + * + * @return string File path + */ + private function getFilePath() + { + return $this->savePath.'/'.$this->id.'.mocksess'; + } + + /** + * Reads session from storage and loads session. + */ + private function read() + { + $filePath = $this->getFilePath(); + $this->data = is_readable($filePath) && is_file($filePath) ? unserialize(file_get_contents($filePath)) : array(); + + $this->loadSession(); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php new file mode 100644 index 0000000..31bf55c --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php @@ -0,0 +1,433 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Session\SessionBagInterface; +use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler; +use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy; +use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; +use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy; + +/** + * This provides a base class for session attribute storage. + * + * @author Drak + */ +class NativeSessionStorage implements SessionStorageInterface +{ + /** + * Array of SessionBagInterface + * + * @var SessionBagInterface[] + */ + protected $bags; + + /** + * @var bool + */ + protected $started = false; + + /** + * @var bool + */ + protected $closed = false; + + /** + * @var AbstractProxy + */ + protected $saveHandler; + + /** + * @var MetadataBag + */ + protected $metadataBag; + + /** + * Constructor. + * + * Depending on how you want the storage driver to behave you probably + * want to override this constructor entirely. + * + * List of options for $options array with their defaults. + * @see http://php.net/session.configuration for options + * but we omit 'session.' from the beginning of the keys for convenience. + * + * ("auto_start", is not supported as it tells PHP to start a session before + * PHP starts to execute user-land code. Setting during runtime has no effect). + * + * cache_limiter, "nocache" (use "0" to prevent headers from being sent entirely). + * cookie_domain, "" + * cookie_httponly, "" + * cookie_lifetime, "0" + * cookie_path, "/" + * cookie_secure, "" + * entropy_file, "" + * entropy_length, "0" + * gc_divisor, "100" + * gc_maxlifetime, "1440" + * gc_probability, "1" + * hash_bits_per_character, "4" + * hash_function, "0" + * name, "PHPSESSID" + * referer_check, "" + * serialize_handler, "php" + * use_cookies, "1" + * use_only_cookies, "1" + * use_trans_sid, "0" + * upload_progress.enabled, "1" + * upload_progress.cleanup, "1" + * upload_progress.prefix, "upload_progress_" + * upload_progress.name, "PHP_SESSION_UPLOAD_PROGRESS" + * upload_progress.freq, "1%" + * upload_progress.min-freq, "1" + * url_rewriter.tags, "a=href,area=href,frame=src,form=,fieldset=" + * + * @param array $options Session configuration options. + * @param AbstractProxy|NativeSessionHandler|\SessionHandlerInterface|null $handler + * @param MetadataBag $metaBag MetadataBag. + */ + public function __construct(array $options = array(), $handler = null, MetadataBag $metaBag = null) + { + session_cache_limiter(''); // disable by default because it's managed by HeaderBag (if used) + ini_set('session.use_cookies', 1); + + if (version_compare(phpversion(), '5.4.0', '>=')) { + session_register_shutdown(); + } else { + register_shutdown_function('session_write_close'); + } + + $this->setMetadataBag($metaBag); + $this->setOptions($options); + $this->setSaveHandler($handler); + } + + /** + * Gets the save handler instance. + * + * @return AbstractProxy + */ + public function getSaveHandler() + { + return $this->saveHandler; + } + + /** + * {@inheritdoc} + */ + public function start() + { + if ($this->started && !$this->closed) { + return true; + } + + if (version_compare(phpversion(), '5.4.0', '>=') && \PHP_SESSION_ACTIVE === session_status()) { + throw new \RuntimeException('Failed to start the session: already started by PHP.'); + } + + if (version_compare(phpversion(), '5.4.0', '<') && isset($_SESSION) && session_id()) { + // not 100% fool-proof, but is the most reliable way to determine if a session is active in PHP 5.3 + throw new \RuntimeException('Failed to start the session: already started by PHP ($_SESSION is set).'); + } + + if (ini_get('session.use_cookies') && headers_sent($file, $line)) { + throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line)); + } + + // ok to try and start the session + if (!session_start()) { + throw new \RuntimeException('Failed to start the session'); + } + + $this->loadSession(); + if (!$this->saveHandler->isWrapper() && !$this->saveHandler->isSessionHandlerInterface()) { + // This condition matches only PHP 5.3 with internal save handlers + $this->saveHandler->setActive(true); + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function getId() + { + if (!$this->started && !$this->closed) { + return ''; // returning empty is consistent with session_id() behaviour + } + + return $this->saveHandler->getId(); + } + + /** + * {@inheritdoc} + */ + public function setId($id) + { + $this->saveHandler->setId($id); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return $this->saveHandler->getName(); + } + + /** + * {@inheritdoc} + */ + public function setName($name) + { + $this->saveHandler->setName($name); + } + + /** + * {@inheritdoc} + */ + public function regenerate($destroy = false, $lifetime = null) + { + if (null !== $lifetime) { + ini_set('session.cookie_lifetime', $lifetime); + } + + if ($destroy) { + $this->metadataBag->stampNew(); + } + + $ret = session_regenerate_id($destroy); + + // workaround for https://bugs.php.net/bug.php?id=61470 as suggested by David Grudl + if ('files' === $this->getSaveHandler()->getSaveHandlerName()) { + session_write_close(); + if (isset($_SESSION)) { + $backup = $_SESSION; + session_start(); + $_SESSION = $backup; + } else { + session_start(); + } + + $this->loadSession(); + } + + return $ret; + } + + /** + * {@inheritdoc} + */ + public function save() + { + session_write_close(); + + if (!$this->saveHandler->isWrapper() && !$this->saveHandler->isSessionHandlerInterface()) { + // This condition matches only PHP 5.3 with internal save handlers + $this->saveHandler->setActive(false); + } + + $this->closed = true; + $this->started = false; + } + + /** + * {@inheritdoc} + */ + public function clear() + { + // clear out the bags + foreach ($this->bags as $bag) { + $bag->clear(); + } + + // clear out the session + $_SESSION = array(); + + // reconnect the bags to the session + $this->loadSession(); + } + + /** + * {@inheritdoc} + */ + public function registerBag(SessionBagInterface $bag) + { + $this->bags[$bag->getName()] = $bag; + } + + /** + * {@inheritdoc} + */ + public function getBag($name) + { + if (!isset($this->bags[$name])) { + throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered.', $name)); + } + + if ($this->saveHandler->isActive() && !$this->started) { + $this->loadSession(); + } elseif (!$this->started) { + $this->start(); + } + + return $this->bags[$name]; + } + + /** + * Sets the MetadataBag. + * + * @param MetadataBag $metaBag + */ + public function setMetadataBag(MetadataBag $metaBag = null) + { + if (null === $metaBag) { + $metaBag = new MetadataBag(); + } + + $this->metadataBag = $metaBag; + } + + /** + * Gets the MetadataBag. + * + * @return MetadataBag + */ + public function getMetadataBag() + { + return $this->metadataBag; + } + + /** + * {@inheritdoc} + */ + public function isStarted() + { + return $this->started; + } + + /** + * Sets session.* ini variables. + * + * For convenience we omit 'session.' from the beginning of the keys. + * Explicitly ignores other ini keys. + * + * @param array $options Session ini directives array(key => value). + * + * @see http://php.net/session.configuration + */ + public function setOptions(array $options) + { + $validOptions = array_flip(array( + 'cache_limiter', 'cookie_domain', 'cookie_httponly', + 'cookie_lifetime', 'cookie_path', 'cookie_secure', + 'entropy_file', 'entropy_length', 'gc_divisor', + 'gc_maxlifetime', 'gc_probability', 'hash_bits_per_character', + 'hash_function', 'name', 'referer_check', + 'serialize_handler', 'use_cookies', + 'use_only_cookies', 'use_trans_sid', 'upload_progress.enabled', + 'upload_progress.cleanup', 'upload_progress.prefix', 'upload_progress.name', + 'upload_progress.freq', 'upload_progress.min-freq', 'url_rewriter.tags', + )); + + foreach ($options as $key => $value) { + if (isset($validOptions[$key])) { + ini_set('session.'.$key, $value); + } + } + } + + /** + * Registers session save handler as a PHP session handler. + * + * To use internal PHP session save handlers, override this method using ini_set with + * session.save_handler and session.save_path e.g. + * + * ini_set('session.save_handler', 'files'); + * ini_set('session.save_path', /tmp'); + * + * or pass in a NativeSessionHandler instance which configures session.save_handler in the + * constructor, for a template see NativeFileSessionHandler or use handlers in + * composer package drak/native-session + * + * @see http://php.net/session-set-save-handler + * @see http://php.net/sessionhandlerinterface + * @see http://php.net/sessionhandler + * @see http://github.com/drak/NativeSession + * + * @param AbstractProxy|NativeSessionHandler|\SessionHandlerInterface|null $saveHandler + * + * @throws \InvalidArgumentException + */ + public function setSaveHandler($saveHandler = null) + { + if (!$saveHandler instanceof AbstractProxy && + !$saveHandler instanceof NativeSessionHandler && + !$saveHandler instanceof \SessionHandlerInterface && + null !== $saveHandler) { + throw new \InvalidArgumentException('Must be instance of AbstractProxy or NativeSessionHandler; implement \SessionHandlerInterface; or be null.'); + } + + // Wrap $saveHandler in proxy and prevent double wrapping of proxy + if (!$saveHandler instanceof AbstractProxy && $saveHandler instanceof \SessionHandlerInterface) { + $saveHandler = new SessionHandlerProxy($saveHandler); + } elseif (!$saveHandler instanceof AbstractProxy) { + $saveHandler = version_compare(phpversion(), '5.4.0', '>=') ? + new SessionHandlerProxy(new \SessionHandler()) : new NativeProxy(); + } + $this->saveHandler = $saveHandler; + + if ($this->saveHandler instanceof \SessionHandlerInterface) { + if (version_compare(phpversion(), '5.4.0', '>=')) { + session_set_save_handler($this->saveHandler, false); + } else { + session_set_save_handler( + array($this->saveHandler, 'open'), + array($this->saveHandler, 'close'), + array($this->saveHandler, 'read'), + array($this->saveHandler, 'write'), + array($this->saveHandler, 'destroy'), + array($this->saveHandler, 'gc') + ); + } + } + } + + /** + * Load the session with attributes. + * + * After starting the session, PHP retrieves the session from whatever handlers + * are set to (either PHP's internal, or a custom save handler set with session_set_save_handler()). + * PHP takes the return value from the read() handler, unserializes it + * and populates $_SESSION with the result automatically. + * + * @param array|null $session + */ + protected function loadSession(array &$session = null) + { + if (null === $session) { + $session = &$_SESSION; + } + + $bags = array_merge($this->bags, array($this->metadataBag)); + + foreach ($bags as $bag) { + $key = $bag->getStorageKey(); + $session[$key] = isset($session[$key]) ? $session[$key] : array(); + $bag->initialize($session[$key]); + } + + $this->started = true; + $this->closed = false; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php new file mode 100644 index 0000000..f70b5e6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php @@ -0,0 +1,68 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; +use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler; + +/** + * Allows session to be started by PHP and managed by Symfony2 + * + * @author Drak + */ +class PhpBridgeSessionStorage extends NativeSessionStorage +{ + /** + * Constructor. + * + * @param AbstractProxy|NativeSessionHandler|\SessionHandlerInterface|null $handler + * @param MetadataBag $metaBag MetadataBag + */ + public function __construct($handler = null, MetadataBag $metaBag = null) + { + $this->setMetadataBag($metaBag); + $this->setSaveHandler($handler); + } + + /** + * {@inheritdoc} + */ + public function start() + { + if ($this->started && !$this->closed) { + return true; + } + + $this->loadSession(); + if (!$this->saveHandler->isWrapper() && !$this->saveHandler->isSessionHandlerInterface()) { + // This condition matches only PHP 5.3 + internal save handlers + $this->saveHandler->setActive(true); + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function clear() + { + // clear out the bags and nothing else that may be set + // since the purpose of this driver is to share a handler + foreach ($this->bags as $bag) { + $bag->clear(); + } + + // reconnect the bags to the session + $this->loadSession(); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php new file mode 100644 index 0000000..0b7e564 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php @@ -0,0 +1,154 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy; + +/** + * AbstractProxy. + * + * @author Drak + */ +abstract class AbstractProxy +{ + /** + * Flag if handler wraps an internal PHP session handler (using \SessionHandler). + * + * @var bool + */ + protected $wrapper = false; + + /** + * @var bool + */ + protected $active = false; + + /** + * @var string + */ + protected $saveHandlerName; + + /** + * Gets the session.save_handler name. + * + * @return string + */ + public function getSaveHandlerName() + { + return $this->saveHandlerName; + } + + /** + * Is this proxy handler and instance of \SessionHandlerInterface. + * + * @return bool + */ + public function isSessionHandlerInterface() + { + return ($this instanceof \SessionHandlerInterface); + } + + /** + * Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. + * + * @return bool + */ + public function isWrapper() + { + return $this->wrapper; + } + + /** + * Has a session started? + * + * @return bool + */ + public function isActive() + { + if (version_compare(phpversion(), '5.4.0', '>=')) { + return $this->active = \PHP_SESSION_ACTIVE === session_status(); + } + + return $this->active; + } + + /** + * Sets the active flag. + * + * Has no effect under PHP 5.4+ as status is detected + * automatically in isActive() + * + * @internal + * + * @param bool $flag + * + * @throws \LogicException + */ + public function setActive($flag) + { + if (version_compare(phpversion(), '5.4.0', '>=')) { + throw new \LogicException('This method is disabled in PHP 5.4.0+'); + } + + $this->active = (bool) $flag; + } + + /** + * Gets the session ID. + * + * @return string + */ + public function getId() + { + return session_id(); + } + + /** + * Sets the session ID. + * + * @param string $id + * + * @throws \LogicException + */ + public function setId($id) + { + if ($this->isActive()) { + throw new \LogicException('Cannot change the ID of an active session'); + } + + session_id($id); + } + + /** + * Gets the session name. + * + * @return string + */ + public function getName() + { + return session_name(); + } + + /** + * Sets the session name. + * + * @param string $name + * + * @throws \LogicException + */ + public function setName($name) + { + if ($this->isActive()) { + throw new \LogicException('Cannot change the name of an active session'); + } + + session_name($name); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php new file mode 100644 index 0000000..d2362b2 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy; + +/** + * NativeProxy. + * + * This proxy is built-in session handlers in PHP 5.3.x + * + * @author Drak + */ +class NativeProxy extends AbstractProxy +{ + /** + * Constructor. + */ + public function __construct() + { + // this makes an educated guess as to what the handler is since it should already be set. + $this->saveHandlerName = ini_get('session.save_handler'); + } + + /** + * Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. + * + * @return bool False. + */ + public function isWrapper() + { + return false; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php new file mode 100644 index 0000000..81643c7 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php @@ -0,0 +1,95 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy; + +/** + * SessionHandler proxy. + * + * @author Drak + */ +class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface +{ + /** + * @var \SessionHandlerInterface + */ + protected $handler; + + /** + * Constructor. + * + * @param \SessionHandlerInterface $handler + */ + public function __construct(\SessionHandlerInterface $handler) + { + $this->handler = $handler; + $this->wrapper = ($handler instanceof \SessionHandler); + $this->saveHandlerName = $this->wrapper ? ini_get('session.save_handler') : 'user'; + } + + // \SessionHandlerInterface + + /** + * {@inheritdoc} + */ + public function open($savePath, $sessionName) + { + $return = (bool) $this->handler->open($savePath, $sessionName); + + if (true === $return) { + $this->active = true; + } + + return $return; + } + + /** + * {@inheritdoc} + */ + public function close() + { + $this->active = false; + + return (bool) $this->handler->close(); + } + + /** + * {@inheritdoc} + */ + public function read($sessionId) + { + return (string) $this->handler->read($sessionId); + } + + /** + * {@inheritdoc} + */ + public function write($sessionId, $data) + { + return (bool) $this->handler->write($sessionId, $data); + } + + /** + * {@inheritdoc} + */ + public function destroy($sessionId) + { + return (bool) $this->handler->destroy($sessionId); + } + + /** + * {@inheritdoc} + */ + public function gc($maxlifetime) + { + return (bool) $this->handler->gc($maxlifetime); + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php new file mode 100644 index 0000000..0fb2e2a --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php @@ -0,0 +1,145 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Session\SessionBagInterface; + +/** + * StorageInterface. + * + * @author Fabien Potencier + * @author Drak + * + * @api + */ +interface SessionStorageInterface +{ + /** + * Starts the session. + * + * @throws \RuntimeException If something goes wrong starting the session. + * + * @return bool True if started. + * + * @api + */ + public function start(); + + /** + * Checks if the session is started. + * + * @return bool True if started, false otherwise. + */ + public function isStarted(); + + /** + * Returns the session ID + * + * @return string The session ID or empty. + * + * @api + */ + public function getId(); + + /** + * Sets the session ID + * + * @param string $id + * + * @api + */ + public function setId($id); + + /** + * Returns the session name + * + * @return mixed The session name. + * + * @api + */ + public function getName(); + + /** + * Sets the session name + * + * @param string $name + * + * @api + */ + public function setName($name); + + /** + * Regenerates id that represents this storage. + * + * This method must invoke session_regenerate_id($destroy) unless + * this interface is used for a storage object designed for unit + * or functional testing where a real PHP session would interfere + * with testing. + * + * Note regenerate+destroy should not clear the session data in memory + * only delete the session data from persistent storage. + * + * @param bool $destroy Destroy session when regenerating? + * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value + * will leave the system settings unchanged, 0 sets the cookie + * to expire with browser session. Time is in seconds, and is + * not a Unix timestamp. + * + * @return bool True if session regenerated, false if error + * + * @throws \RuntimeException If an error occurs while regenerating this storage + * + * @api + */ + public function regenerate($destroy = false, $lifetime = null); + + /** + * Force the session to be saved and closed. + * + * This method must invoke session_write_close() unless this interface is + * used for a storage object design for unit or functional testing where + * a real PHP session would interfere with testing, in which case it + * it should actually persist the session data if required. + * + * @throws \RuntimeException If the session is saved without being started, or if the session + * is already closed. + */ + public function save(); + + /** + * Clear all session data in memory. + */ + public function clear(); + + /** + * Gets a SessionBagInterface by name. + * + * @param string $name + * + * @return SessionBagInterface + * + * @throws \InvalidArgumentException If the bag does not exist + */ + public function getBag($name); + + /** + * Registers a SessionBagInterface for use. + * + * @param SessionBagInterface $bag + */ + public function registerBag(SessionBagInterface $bag); + + /** + * @return MetadataBag + */ + public function getMetadataBag(); +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/StreamedResponse.php b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/StreamedResponse.php new file mode 100644 index 0000000..a4d44f2 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/StreamedResponse.php @@ -0,0 +1,127 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * StreamedResponse represents a streamed HTTP response. + * + * A StreamedResponse uses a callback for its content. + * + * The callback should use the standard PHP functions like echo + * to stream the response back to the client. The flush() method + * can also be used if needed. + * + * @see flush() + * + * @author Fabien Potencier + * + * @api + */ +class StreamedResponse extends Response +{ + protected $callback; + protected $streamed; + + /** + * Constructor. + * + * @param mixed $callback A valid PHP callback + * @param int $status The response status code + * @param array $headers An array of response headers + * + * @api + */ + public function __construct($callback = null, $status = 200, $headers = array()) + { + parent::__construct(null, $status, $headers); + + if (null !== $callback) { + $this->setCallback($callback); + } + $this->streamed = false; + } + + /** + * {@inheritdoc} + */ + public static function create($callback = null, $status = 200, $headers = array()) + { + return new static($callback, $status, $headers); + } + + /** + * Sets the PHP callback associated with this Response. + * + * @param mixed $callback A valid PHP callback + * + * @throws \LogicException + */ + public function setCallback($callback) + { + if (!is_callable($callback)) { + throw new \LogicException('The Response callback must be a valid PHP callable.'); + } + $this->callback = $callback; + } + + /** + * {@inheritdoc} + */ + public function prepare(Request $request) + { + $this->headers->set('Cache-Control', 'no-cache'); + + return parent::prepare($request); + } + + /** + * {@inheritdoc} + * + * This method only sends the content once. + */ + public function sendContent() + { + if ($this->streamed) { + return; + } + + $this->streamed = true; + + if (null === $this->callback) { + throw new \LogicException('The Response callback must not be null.'); + } + + call_user_func($this->callback); + } + + /** + * {@inheritdoc} + * + * @throws \LogicException when the content is not null + */ + public function setContent($content) + { + if (null !== $content) { + throw new \LogicException('The content cannot be set on a StreamedResponse instance.'); + } + } + + /** + * {@inheritdoc} + * + * @return false + */ + public function getContent() + { + return false; + } +} diff --git a/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json new file mode 100644 index 0000000..f77e08e --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json @@ -0,0 +1,32 @@ +{ + "name": "symfony/http-foundation", + "type": "library", + "description": "Symfony HttpFoundation Component", + "keywords": [], + "homepage": "http://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3" + }, + "autoload": { + "psr-0": { "Symfony\\Component\\HttpFoundation\\": "" }, + "classmap": [ "Symfony/Component/HttpFoundation/Resources/stubs" ] + }, + "target-dir": "Symfony/Component/HttpFoundation", + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php new file mode 100644 index 0000000..51070c5 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php @@ -0,0 +1,196 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Bundle; + +use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\Console\Application; +use Symfony\Component\Finder\Finder; +use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; + +/** + * An implementation of BundleInterface that adds a few conventions + * for DependencyInjection extensions and Console commands. + * + * @author Fabien Potencier + * + * @api + */ +abstract class Bundle extends ContainerAware implements BundleInterface +{ + protected $name; + protected $reflected; + protected $extension; + + /** + * Boots the Bundle. + */ + public function boot() + { + } + + /** + * Shutdowns the Bundle. + */ + public function shutdown() + { + } + + /** + * Builds the bundle. + * + * It is only ever called once when the cache is empty. + * + * This method can be overridden to register compilation passes, + * other extensions, ... + * + * @param ContainerBuilder $container A ContainerBuilder instance + */ + public function build(ContainerBuilder $container) + { + } + + /** + * Returns the bundle's container extension. + * + * @return ExtensionInterface|null The container extension + * + * @throws \LogicException + * + * @api + */ + public function getContainerExtension() + { + if (null === $this->extension) { + $basename = preg_replace('/Bundle$/', '', $this->getName()); + + $class = $this->getNamespace().'\\DependencyInjection\\'.$basename.'Extension'; + if (class_exists($class)) { + $extension = new $class(); + + // check naming convention + $expectedAlias = Container::underscore($basename); + if ($expectedAlias != $extension->getAlias()) { + throw new \LogicException(sprintf( + 'The extension alias for the default extension of a '. + 'bundle must be the underscored version of the '. + 'bundle name ("%s" instead of "%s")', + $expectedAlias, $extension->getAlias() + )); + } + + $this->extension = $extension; + } else { + $this->extension = false; + } + } + + if ($this->extension) { + return $this->extension; + } + } + + /** + * Gets the Bundle namespace. + * + * @return string The Bundle namespace + * + * @api + */ + public function getNamespace() + { + if (null === $this->reflected) { + $this->reflected = new \ReflectionObject($this); + } + + return $this->reflected->getNamespaceName(); + } + + /** + * Gets the Bundle directory path. + * + * @return string The Bundle absolute path + * + * @api + */ + public function getPath() + { + if (null === $this->reflected) { + $this->reflected = new \ReflectionObject($this); + } + + return dirname($this->reflected->getFileName()); + } + + /** + * Returns the bundle parent name. + * + * @return string The Bundle parent name it overrides or null if no parent + * + * @api + */ + public function getParent() + { + } + + /** + * Returns the bundle name (the class short name). + * + * @return string The Bundle name + * + * @api + */ + final public function getName() + { + if (null !== $this->name) { + return $this->name; + } + + $name = get_class($this); + $pos = strrpos($name, '\\'); + + return $this->name = false === $pos ? $name : substr($name, $pos + 1); + } + + /** + * Finds and registers Commands. + * + * Override this method if your bundle commands do not follow the conventions: + * + * * Commands are in the 'Command' sub-directory + * * Commands extend Symfony\Component\Console\Command\Command + * + * @param Application $application An Application instance + */ + public function registerCommands(Application $application) + { + if (!is_dir($dir = $this->getPath().'/Command')) { + return; + } + + $finder = new Finder(); + $finder->files()->name('*Command.php')->in($dir); + + $prefix = $this->getNamespace().'\\Command'; + foreach ($finder as $file) { + $ns = $prefix; + if ($relativePath = $file->getRelativePath()) { + $ns .= '\\'.strtr($relativePath, '/', '\\'); + } + $r = new \ReflectionClass($ns.'\\'.$file->getBasename('.php')); + if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract() && !$r->getConstructor()->getNumberOfRequiredParameters()) { + $application->add($r->newInstance()); + } + } + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/BundleInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/BundleInterface.php new file mode 100644 index 0000000..3203d84 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/BundleInterface.php @@ -0,0 +1,102 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Bundle; + +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; + +/** + * BundleInterface. + * + * @author Fabien Potencier + * + * @api + */ +interface BundleInterface extends ContainerAwareInterface +{ + /** + * Boots the Bundle. + * + * @api + */ + public function boot(); + + /** + * Shutdowns the Bundle. + * + * @api + */ + public function shutdown(); + + /** + * Builds the bundle. + * + * It is only ever called once when the cache is empty. + * + * @param ContainerBuilder $container A ContainerBuilder instance + * + * @api + */ + public function build(ContainerBuilder $container); + + /** + * Returns the container extension that should be implicitly loaded. + * + * @return ExtensionInterface|null The default extension or null if there is none + * + * @api + */ + public function getContainerExtension(); + + /** + * Returns the bundle name that this bundle overrides. + * + * Despite its name, this method does not imply any parent/child relationship + * between the bundles, just a way to extend and override an existing + * bundle. + * + * @return string The Bundle name it overrides or null if no parent + * + * @api + */ + public function getParent(); + + /** + * Returns the bundle name (the class short name). + * + * @return string The Bundle name + * + * @api + */ + public function getName(); + + /** + * Gets the Bundle namespace. + * + * @return string The Bundle namespace + * + * @api + */ + public function getNamespace(); + + /** + * Gets the Bundle directory path. + * + * The path should always be returned as a Unix path (with /). + * + * @return string The Bundle absolute path + * + * @api + */ + public function getPath(); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/CacheClearerInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/CacheClearerInterface.php new file mode 100644 index 0000000..d4a2db3 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/CacheClearerInterface.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\CacheClearer; + +/** + * CacheClearerInterface. + * + * @author Dustin Dobervich + */ +interface CacheClearerInterface +{ + /** + * Clears any caches necessary. + * + * @param string $cacheDir The cache directory. + */ + public function clear($cacheDir); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php new file mode 100644 index 0000000..199a4be --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\CacheClearer; + +/** + * ChainCacheClearer. + * + * @author Dustin Dobervich + */ +class ChainCacheClearer implements CacheClearerInterface +{ + /** + * @var array $clearers + */ + protected $clearers; + + /** + * Constructs a new instance of ChainCacheClearer. + * + * @param array $clearers The initial clearers. + */ + public function __construct(array $clearers = array()) + { + $this->clearers = $clearers; + } + + /** + * {@inheritdoc} + */ + public function clear($cacheDir) + { + foreach ($this->clearers as $clearer) { + $clearer->clear($cacheDir); + } + } + + /** + * Adds a cache clearer to the aggregate. + * + * @param CacheClearerInterface $clearer + */ + public function add(CacheClearerInterface $clearer) + { + $this->clearers[] = $clearer; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php new file mode 100644 index 0000000..948b3ff --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\CacheWarmer; + +/** + * Abstract cache warmer that knows how to write a file to the cache. + * + * @author Fabien Potencier + */ +abstract class CacheWarmer implements CacheWarmerInterface +{ + protected function writeCacheFile($file, $content) + { + $tmpFile = tempnam(dirname($file), basename($file)); + if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) { + @chmod($file, 0666 & ~umask()); + + return; + } + + throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $file)); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php new file mode 100644 index 0000000..e292a24 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\CacheWarmer; + +/** + * Aggregates several cache warmers into a single one. + * + * @author Fabien Potencier + */ +class CacheWarmerAggregate implements CacheWarmerInterface +{ + protected $warmers; + protected $optionalsEnabled; + + public function __construct(array $warmers = array()) + { + $this->setWarmers($warmers); + $this->optionalsEnabled = false; + } + + public function enableOptionalWarmers() + { + $this->optionalsEnabled = true; + } + + /** + * Warms up the cache. + * + * @param string $cacheDir The cache directory + */ + public function warmUp($cacheDir) + { + foreach ($this->warmers as $warmer) { + if (!$this->optionalsEnabled && $warmer->isOptional()) { + continue; + } + + $warmer->warmUp($cacheDir); + } + } + + /** + * Checks whether this warmer is optional or not. + * + * @return bool always false + */ + public function isOptional() + { + return false; + } + + public function setWarmers(array $warmers) + { + $this->warmers = array(); + foreach ($warmers as $warmer) { + $this->add($warmer); + } + } + + public function add(CacheWarmerInterface $warmer) + { + $this->warmers[] = $warmer; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerInterface.php new file mode 100644 index 0000000..902d8d6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerInterface.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\CacheWarmer; + +/** + * Interface for classes able to warm up the cache. + * + * @author Fabien Potencier + */ +interface CacheWarmerInterface extends WarmableInterface +{ + /** + * Checks whether this warmer is optional or not. + * + * Optional warmers can be ignored on certain conditions. + * + * A warmer should return true if the cache can be + * generated incrementally and on-demand. + * + * @return bool true if the warmer is optional, false otherwise + */ + public function isOptional(); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/WarmableInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/WarmableInterface.php new file mode 100644 index 0000000..25d8ee8 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/WarmableInterface.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\CacheWarmer; + +/** + * Interface for classes that support warming their cache. + * + * @author Fabien Potencier + */ +interface WarmableInterface +{ + /** + * Warms up the cache. + * + * @param string $cacheDir The cache directory + */ + public function warmUp($cacheDir); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php new file mode 100644 index 0000000..5ef739b --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php @@ -0,0 +1,225 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel; + +use Symfony\Component\BrowserKit\Client as BaseClient; +use Symfony\Component\BrowserKit\Request as DomRequest; +use Symfony\Component\BrowserKit\Response as DomResponse; +use Symfony\Component\BrowserKit\Cookie as DomCookie; +use Symfony\Component\BrowserKit\History; +use Symfony\Component\BrowserKit\CookieJar; +use Symfony\Component\HttpFoundation\File\UploadedFile; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * Client simulates a browser and makes requests to a Kernel object. + * + * @author Fabien Potencier + * + * @api + */ +class Client extends BaseClient +{ + protected $kernel; + + /** + * Constructor. + * + * @param HttpKernelInterface $kernel An HttpKernel instance + * @param array $server The server parameters (equivalent of $_SERVER) + * @param History $history A History instance to store the browser history + * @param CookieJar $cookieJar A CookieJar instance to store the cookies + */ + public function __construct(HttpKernelInterface $kernel, array $server = array(), History $history = null, CookieJar $cookieJar = null) + { + $this->kernel = $kernel; + + parent::__construct($server, $history, $cookieJar); + + $this->followRedirects = false; + } + + /** + * {@inheritdoc} + * + * @return Request|null A Request instance + */ + public function getRequest() + { + return parent::getRequest(); + } + + /** + * {@inheritdoc} + * + * @return Response|null A Response instance + */ + public function getResponse() + { + return parent::getResponse(); + } + + /** + * Makes a request. + * + * @param Request $request A Request instance + * + * @return Response A Response instance + */ + protected function doRequest($request) + { + $response = $this->kernel->handle($request); + + if ($this->kernel instanceof TerminableInterface) { + $this->kernel->terminate($request, $response); + } + + return $response; + } + + /** + * Returns the script to execute when the request must be insulated. + * + * @param Request $request A Request instance + * + * @return string + */ + protected function getScript($request) + { + $kernel = str_replace("'", "\\'", serialize($this->kernel)); + $request = str_replace("'", "\\'", serialize($request)); + + $r = new \ReflectionClass('\\Symfony\\Component\\ClassLoader\\ClassLoader'); + $requirePath = str_replace("'", "\\'", $r->getFileName()); + $symfonyPath = str_replace("'", "\\'", realpath(__DIR__.'/../../..')); + + $code = <<addPrefix('Symfony', '$symfonyPath'); +\$loader->register(); + +\$kernel = unserialize('$kernel'); +\$request = unserialize('$request'); +EOF; + + return $code.$this->getHandleScript(); + } + + protected function getHandleScript() + { + return <<<'EOF' +$response = $kernel->handle($request); + +if ($kernel instanceof Symfony\Component\HttpKernel\TerminableInterface) { + $kernel->terminate($request, $response); +} + +echo serialize($response); +EOF; + } + + /** + * Converts the BrowserKit request to a HttpKernel request. + * + * @param DomRequest $request A DomRequest instance + * + * @return Request A Request instance + */ + protected function filterRequest(DomRequest $request) + { + $httpRequest = Request::create($request->getUri(), $request->getMethod(), $request->getParameters(), $request->getCookies(), $request->getFiles(), $request->getServer(), $request->getContent()); + + foreach ($this->filterFiles($httpRequest->files->all()) as $key => $value) { + $httpRequest->files->set($key, $value); + } + + return $httpRequest; + } + + /** + * Filters an array of files. + * + * This method created test instances of UploadedFile so that the move() + * method can be called on those instances. + * + * If the size of a file is greater than the allowed size (from php.ini) then + * an invalid UploadedFile is returned with an error set to UPLOAD_ERR_INI_SIZE. + * + * @see Symfony\Component\HttpFoundation\File\UploadedFile + * + * @param array $files An array of files + * + * @return array An array with all uploaded files marked as already moved + */ + protected function filterFiles(array $files) + { + $filtered = array(); + foreach ($files as $key => $value) { + if (is_array($value)) { + $filtered[$key] = $this->filterFiles($value); + } elseif ($value instanceof UploadedFile) { + if ($value->isValid() && $value->getSize() > UploadedFile::getMaxFilesize()) { + $filtered[$key] = new UploadedFile( + '', + $value->getClientOriginalName(), + $value->getClientMimeType(), + 0, + UPLOAD_ERR_INI_SIZE, + true + ); + } else { + $filtered[$key] = new UploadedFile( + $value->getPathname(), + $value->getClientOriginalName(), + $value->getClientMimeType(), + $value->getClientSize(), + $value->getError(), + true + ); + } + } + } + + return $filtered; + } + + /** + * Converts the HttpKernel response to a BrowserKit response. + * + * @param Response $response A Response instance + * + * @return DomResponse A DomResponse instance + */ + protected function filterResponse($response) + { + $headers = $response->headers->all(); + if ($response->headers->getCookies()) { + $cookies = array(); + foreach ($response->headers->getCookies() as $cookie) { + $cookies[] = new DomCookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly()); + } + $headers['Set-Cookie'] = $cookies; + } + + // this is needed to support StreamedResponse + ob_start(); + $response->sendContent(); + $content = ob_get_clean(); + + return new DomResponse($content, $response->getStatusCode(), $headers); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Config/FileLocator.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Config/FileLocator.php new file mode 100644 index 0000000..47b543c --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Config/FileLocator.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Config; + +use Symfony\Component\Config\FileLocator as BaseFileLocator; +use Symfony\Component\HttpKernel\KernelInterface; + +/** + * FileLocator uses the KernelInterface to locate resources in bundles. + * + * @author Fabien Potencier + */ +class FileLocator extends BaseFileLocator +{ + private $kernel; + private $path; + + /** + * Constructor. + * + * @param KernelInterface $kernel A KernelInterface instance + * @param null|string $path The path the global resource directory + * @param array $paths An array of paths where to look for resources + */ + public function __construct(KernelInterface $kernel, $path = null, array $paths = array()) + { + $this->kernel = $kernel; + if (null !== $path) { + $this->path = $path; + $paths[] = $path; + } + + parent::__construct($paths); + } + + /** + * {@inheritdoc} + */ + public function locate($file, $currentPath = null, $first = true) + { + if ('@' === $file[0]) { + return $this->kernel->locateResource($file, $this->path, $first); + } + + return parent::locate($file, $currentPath, $first); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerReference.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerReference.php new file mode 100644 index 0000000..22d6cd3 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerReference.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Controller; + +/** + * Acts as a marker and a data holder for a Controller. + * + * Some methods in Symfony accept both a URI (as a string) or a controller as + * an argument. In the latter case, instead of passing an array representing + * the controller, you can use an instance of this class. + * + * @author Fabien Potencier + * + * @see Symfony\Component\HttpKernel\FragmentRenderer + * @see Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface + */ +class ControllerReference +{ + public $controller; + public $attributes = array(); + public $query = array(); + + /** + * Constructor. + * + * @param string $controller The controller name + * @param array $attributes An array of parameters to add to the Request attributes + * @param array $query An array of parameters to add to the Request query string + */ + public function __construct($controller, array $attributes = array(), array $query = array()) + { + $this->controller = $controller; + $this->attributes = $attributes; + $this->query = $query; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php new file mode 100644 index 0000000..e2e550e --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php @@ -0,0 +1,172 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Controller; + +use Psr\Log\LoggerInterface; +use Symfony\Component\HttpFoundation\Request; + +/** + * ControllerResolver. + * + * This implementation uses the '_controller' request attribute to determine + * the controller to execute and uses the request attributes to determine + * the controller method arguments. + * + * @author Fabien Potencier + * + * @api + */ +class ControllerResolver implements ControllerResolverInterface +{ + private $logger; + + /** + * Constructor. + * + * @param LoggerInterface $logger A LoggerInterface instance + */ + public function __construct(LoggerInterface $logger = null) + { + $this->logger = $logger; + } + + /** + * Returns the Controller instance associated with a Request. + * + * This method looks for a '_controller' request attribute that represents + * the controller name (a string like ClassName::MethodName). + * + * @param Request $request A Request instance + * + * @return mixed|bool A PHP callable representing the Controller, + * or false if this resolver is not able to determine the controller + * + * @throws \InvalidArgumentException|\LogicException If the controller can't be found + * + * @api + */ + public function getController(Request $request) + { + if (!$controller = $request->attributes->get('_controller')) { + if (null !== $this->logger) { + $this->logger->warning('Unable to look for the controller as the "_controller" parameter is missing'); + } + + return false; + } + + if (is_array($controller)) { + return $controller; + } + + if (is_object($controller)) { + if (method_exists($controller, '__invoke')) { + return $controller; + } + + throw new \InvalidArgumentException(sprintf('Controller "%s" for URI "%s" is not callable.', get_class($controller), $request->getPathInfo())); + } + + if (false === strpos($controller, ':')) { + if (method_exists($controller, '__invoke')) { + return new $controller(); + } elseif (function_exists($controller)) { + return $controller; + } + } + + $callable = $this->createController($controller); + + if (!is_callable($callable)) { + throw new \InvalidArgumentException(sprintf('Controller "%s" for URI "%s" is not callable.', $controller, $request->getPathInfo())); + } + + return $callable; + } + + /** + * Returns the arguments to pass to the controller. + * + * @param Request $request A Request instance + * @param mixed $controller A PHP callable + * + * @return array + * + * @throws \RuntimeException When value for argument given is not provided + * + * @api + */ + public function getArguments(Request $request, $controller) + { + if (is_array($controller)) { + $r = new \ReflectionMethod($controller[0], $controller[1]); + } elseif (is_object($controller) && !$controller instanceof \Closure) { + $r = new \ReflectionObject($controller); + $r = $r->getMethod('__invoke'); + } else { + $r = new \ReflectionFunction($controller); + } + + return $this->doGetArguments($request, $controller, $r->getParameters()); + } + + protected function doGetArguments(Request $request, $controller, array $parameters) + { + $attributes = $request->attributes->all(); + $arguments = array(); + foreach ($parameters as $param) { + if (array_key_exists($param->name, $attributes)) { + $arguments[] = $attributes[$param->name]; + } elseif ($param->getClass() && $param->getClass()->isInstance($request)) { + $arguments[] = $request; + } elseif ($param->isDefaultValueAvailable()) { + $arguments[] = $param->getDefaultValue(); + } else { + if (is_array($controller)) { + $repr = sprintf('%s::%s()', get_class($controller[0]), $controller[1]); + } elseif (is_object($controller)) { + $repr = get_class($controller); + } else { + $repr = $controller; + } + + throw new \RuntimeException(sprintf('Controller "%s" requires that you provide a value for the "$%s" argument (because there is no default value or because there is a non optional argument after this one).', $repr, $param->name)); + } + } + + return $arguments; + } + + /** + * Returns a callable for the given controller. + * + * @param string $controller A Controller string + * + * @return mixed A PHP callable + * + * @throws \InvalidArgumentException + */ + protected function createController($controller) + { + if (false === strpos($controller, '::')) { + throw new \InvalidArgumentException(sprintf('Unable to find controller "%s".', $controller)); + } + + list($class, $method) = explode('::', $controller, 2); + + if (!class_exists($class)) { + throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class)); + } + + return array(new $class(), $method); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php new file mode 100644 index 0000000..6ec079f --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Controller; + +use Symfony\Component\HttpFoundation\Request; + +/** + * A ControllerResolverInterface implementation knows how to determine the + * controller to execute based on a Request object. + * + * It can also determine the arguments to pass to the Controller. + * + * A Controller can be any valid PHP callable. + * + * @author Fabien Potencier + * + * @api + */ +interface ControllerResolverInterface +{ + /** + * Returns the Controller instance associated with a Request. + * + * As several resolvers can exist for a single application, a resolver must + * return false when it is not able to determine the controller. + * + * The resolver must only throw an exception when it should be able to load + * controller but cannot because of some errors made by the developer. + * + * @param Request $request A Request instance + * + * @return mixed|bool A PHP callable representing the Controller, + * or false if this resolver is not able to determine the controller + * + * @throws \InvalidArgumentException|\LogicException If the controller can't be found + * + * @api + */ + public function getController(Request $request); + + /** + * Returns the arguments to pass to the controller. + * + * @param Request $request A Request instance + * @param mixed $controller A PHP callable + * + * @return array An array of arguments to pass to the controller + * + * @throws \RuntimeException When value for argument given is not provided + * + * @api + */ + public function getArguments(Request $request, $controller); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/TraceableControllerResolver.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/TraceableControllerResolver.php new file mode 100644 index 0000000..f8de31c --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/TraceableControllerResolver.php @@ -0,0 +1,66 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Controller; + +use Symfony\Component\Stopwatch\Stopwatch; +use Symfony\Component\HttpFoundation\Request; + +/** + * TraceableControllerResolver. + * + * @author Fabien Potencier + */ +class TraceableControllerResolver implements ControllerResolverInterface +{ + private $resolver; + private $stopwatch; + + /** + * Constructor. + * + * @param ControllerResolverInterface $resolver A ControllerResolverInterface instance + * @param Stopwatch $stopwatch A Stopwatch instance + */ + public function __construct(ControllerResolverInterface $resolver, Stopwatch $stopwatch) + { + $this->resolver = $resolver; + $this->stopwatch = $stopwatch; + } + + /** + * {@inheritdoc} + */ + public function getController(Request $request) + { + $e = $this->stopwatch->start('controller.get_callable'); + + $ret = $this->resolver->getController($request); + + $e->stop(); + + return $ret; + } + + /** + * {@inheritdoc} + */ + public function getArguments(Request $request, $controller) + { + $e = $this->stopwatch->start('controller.get_arguments'); + + $ret = $this->resolver->getArguments($request, $controller); + + $e->stop(); + + return $ret; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php new file mode 100644 index 0000000..8a35ebc --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php @@ -0,0 +1,245 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DataCollector; + +use Symfony\Component\HttpKernel\KernelInterface; +use Symfony\Component\HttpKernel\Kernel; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * ConfigDataCollector. + * + * @author Fabien Potencier + */ +class ConfigDataCollector extends DataCollector +{ + private $kernel; + private $name; + private $version; + + /** + * Constructor. + * + * @param string $name The name of the application using the web profiler + * @param string $version The version of the application using the web profiler + */ + public function __construct($name = null, $version = null) + { + $this->name = $name; + $this->version = $version; + } + + /** + * Sets the Kernel associated with this Request. + * + * @param KernelInterface $kernel A KernelInterface instance + */ + public function setKernel(KernelInterface $kernel = null) + { + $this->kernel = $kernel; + } + + /** + * {@inheritdoc} + */ + public function collect(Request $request, Response $response, \Exception $exception = null) + { + $this->data = array( + 'app_name' => $this->name, + 'app_version' => $this->version, + 'token' => $response->headers->get('X-Debug-Token'), + 'symfony_version' => Kernel::VERSION, + 'name' => isset($this->kernel) ? $this->kernel->getName() : 'n/a', + 'env' => isset($this->kernel) ? $this->kernel->getEnvironment() : 'n/a', + 'debug' => isset($this->kernel) ? $this->kernel->isDebug() : 'n/a', + 'php_version' => PHP_VERSION, + 'xdebug_enabled' => extension_loaded('xdebug'), + 'eaccel_enabled' => extension_loaded('eaccelerator') && ini_get('eaccelerator.enable'), + 'apc_enabled' => extension_loaded('apc') && ini_get('apc.enabled'), + 'xcache_enabled' => extension_loaded('xcache') && ini_get('xcache.cacher'), + 'wincache_enabled' => extension_loaded('wincache') && ini_get('wincache.ocenabled'), + 'zend_opcache_enabled' => extension_loaded('Zend OPcache') && ini_get('opcache.enable'), + 'bundles' => array(), + 'sapi_name' => php_sapi_name(), + ); + + if (isset($this->kernel)) { + foreach ($this->kernel->getBundles() as $name => $bundle) { + $this->data['bundles'][$name] = $bundle->getPath(); + } + } + } + + public function getApplicationName() + { + return $this->data['app_name']; + } + + public function getApplicationVersion() + { + return $this->data['app_version']; + } + + /** + * Gets the token. + * + * @return string The token + */ + public function getToken() + { + return $this->data['token']; + } + + /** + * Gets the Symfony version. + * + * @return string The Symfony version + */ + public function getSymfonyVersion() + { + return $this->data['symfony_version']; + } + + /** + * Gets the PHP version. + * + * @return string The PHP version + */ + public function getPhpVersion() + { + return $this->data['php_version']; + } + + /** + * Gets the application name. + * + * @return string The application name + */ + public function getAppName() + { + return $this->data['name']; + } + + /** + * Gets the environment. + * + * @return string The environment + */ + public function getEnv() + { + return $this->data['env']; + } + + /** + * Returns true if the debug is enabled. + * + * @return bool true if debug is enabled, false otherwise + */ + public function isDebug() + { + return $this->data['debug']; + } + + /** + * Returns true if the XDebug is enabled. + * + * @return bool true if XDebug is enabled, false otherwise + */ + public function hasXDebug() + { + return $this->data['xdebug_enabled']; + } + + /** + * Returns true if EAccelerator is enabled. + * + * @return bool true if EAccelerator is enabled, false otherwise + */ + public function hasEAccelerator() + { + return $this->data['eaccel_enabled']; + } + + /** + * Returns true if APC is enabled. + * + * @return bool true if APC is enabled, false otherwise + */ + public function hasApc() + { + return $this->data['apc_enabled']; + } + + /** + * Returns true if Zend OPcache is enabled + * + * @return bool true if Zend OPcache is enabled, false otherwise + */ + public function hasZendOpcache() + { + return $this->data['zend_opcache_enabled']; + } + + /** + * Returns true if XCache is enabled. + * + * @return bool true if XCache is enabled, false otherwise + */ + public function hasXCache() + { + return $this->data['xcache_enabled']; + } + + /** + * Returns true if WinCache is enabled. + * + * @return bool true if WinCache is enabled, false otherwise + */ + public function hasWinCache() + { + return $this->data['wincache_enabled']; + } + + /** + * Returns true if any accelerator is enabled. + * + * @return bool true if any accelerator is enabled, false otherwise + */ + public function hasAccelerator() + { + return $this->hasApc() || $this->hasZendOpcache() || $this->hasEAccelerator() || $this->hasXCache() || $this->hasWinCache(); + } + + public function getBundles() + { + return $this->data['bundles']; + } + + /** + * Gets the PHP SAPI name. + * + * @return string The environment + */ + public function getSapiName() + { + return $this->data['sapi_name']; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'config'; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollector.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollector.php new file mode 100644 index 0000000..3b4ae42 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollector.php @@ -0,0 +1,75 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DataCollector; + +/** + * DataCollector. + * + * Children of this class must store the collected data in the data property. + * + * @author Fabien Potencier + */ +abstract class DataCollector implements DataCollectorInterface, \Serializable +{ + protected $data; + + public function serialize() + { + return serialize($this->data); + } + + public function unserialize($data) + { + $this->data = unserialize($data); + } + + /** + * Converts a PHP variable to a string. + * + * @param mixed $var A PHP variable + * + * @return string The string representation of the variable + */ + protected function varToString($var) + { + if (is_object($var)) { + return sprintf('Object(%s)', get_class($var)); + } + + if (is_array($var)) { + $a = array(); + foreach ($var as $k => $v) { + $a[] = sprintf('%s => %s', $k, $this->varToString($v)); + } + + return sprintf("Array(%s)", implode(', ', $a)); + } + + if (is_resource($var)) { + return sprintf('Resource(%s#%d)', get_resource_type($var), $var); + } + + if (null === $var) { + return 'null'; + } + + if (false === $var) { + return 'false'; + } + + if (true === $var) { + return 'true'; + } + + return (string) $var; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php new file mode 100644 index 0000000..cf4cdfd --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DataCollector; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * DataCollectorInterface. + * + * @author Fabien Potencier + * + * @api + */ +interface DataCollectorInterface +{ + /** + * Collects data for the given Request and Response. + * + * @param Request $request A Request instance + * @param Response $response A Response instance + * @param \Exception $exception An Exception instance + * + * @api + */ + public function collect(Request $request, Response $response, \Exception $exception = null); + + /** + * Returns the name of the collector. + * + * @return string The collector name + * + * @api + */ + public function getName(); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php new file mode 100644 index 0000000..cd7f787 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php @@ -0,0 +1,91 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DataCollector; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface; + +/** + * EventDataCollector. + * + * @author Fabien Potencier + */ +class EventDataCollector extends DataCollector +{ + /** + * {@inheritdoc} + */ + public function collect(Request $request, Response $response, \Exception $exception = null) + { + $this->data = array( + 'called_listeners' => array(), + 'not_called_listeners' => array(), + ); + } + + /** + * Sets the called listeners. + * + * @param array $listeners An array of called listeners + * + * @see TraceableEventDispatcherInterface + */ + public function setCalledListeners(array $listeners) + { + $this->data['called_listeners'] = $listeners; + } + + /** + * Gets the called listeners. + * + * @return array An array of called listeners + * + * @see TraceableEventDispatcherInterface + */ + public function getCalledListeners() + { + return $this->data['called_listeners']; + } + + /** + * Sets the not called listeners. + * + * @param array $listeners An array of not called listeners + * + * @see TraceableEventDispatcherInterface + */ + public function setNotCalledListeners(array $listeners) + { + $this->data['not_called_listeners'] = $listeners; + } + + /** + * Gets the not called listeners. + * + * @return array An array of not called listeners + * + * @see TraceableEventDispatcherInterface + */ + public function getNotCalledListeners() + { + return $this->data['not_called_listeners']; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'events'; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php new file mode 100644 index 0000000..476bfff --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php @@ -0,0 +1,104 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DataCollector; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Exception\FlattenException; + +/** + * ExceptionDataCollector. + * + * @author Fabien Potencier + */ +class ExceptionDataCollector extends DataCollector +{ + /** + * {@inheritdoc} + */ + public function collect(Request $request, Response $response, \Exception $exception = null) + { + if (null !== $exception) { + $this->data = array( + 'exception' => FlattenException::create($exception), + ); + } + } + + /** + * Checks if the exception is not null. + * + * @return bool true if the exception is not null, false otherwise + */ + public function hasException() + { + return isset($this->data['exception']); + } + + /** + * Gets the exception. + * + * @return \Exception The exception + */ + public function getException() + { + return $this->data['exception']; + } + + /** + * Gets the exception message. + * + * @return string The exception message + */ + public function getMessage() + { + return $this->data['exception']->getMessage(); + } + + /** + * Gets the exception code. + * + * @return int The exception code + */ + public function getCode() + { + return $this->data['exception']->getCode(); + } + + /** + * Gets the status code. + * + * @return int The status code + */ + public function getStatusCode() + { + return $this->data['exception']->getStatusCode(); + } + + /** + * Gets the exception trace. + * + * @return array The exception trace + */ + public function getTrace() + { + return $this->data['exception']->getTrace(); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'exception'; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php new file mode 100644 index 0000000..e8d9274 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php @@ -0,0 +1,125 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DataCollector; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpKernel\Debug\ErrorHandler; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; + +/** + * LogDataCollector. + * + * @author Fabien Potencier + */ +class LoggerDataCollector extends DataCollector +{ + private $logger; + + public function __construct($logger = null) + { + if (null !== $logger && $logger instanceof DebugLoggerInterface) { + $this->logger = $logger; + } + } + + /** + * {@inheritdoc} + */ + public function collect(Request $request, Response $response, \Exception $exception = null) + { + if (null !== $this->logger) { + $this->data = array( + 'error_count' => $this->logger->countErrors(), + 'logs' => $this->sanitizeLogs($this->logger->getLogs()), + 'deprecation_count' => $this->computeDeprecationCount(), + ); + } + } + + /** + * Gets the called events. + * + * @return array An array of called events + * + * @see TraceableEventDispatcherInterface + */ + public function countErrors() + { + return isset($this->data['error_count']) ? $this->data['error_count'] : 0; + } + + /** + * Gets the logs. + * + * @return array An array of logs + */ + public function getLogs() + { + return isset($this->data['logs']) ? $this->data['logs'] : array(); + } + + public function countDeprecations() + { + return isset($this->data['deprecation_count']) ? $this->data['deprecation_count'] : 0; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'logger'; + } + + private function sanitizeLogs($logs) + { + foreach ($logs as $i => $log) { + $logs[$i]['context'] = $this->sanitizeContext($log['context']); + } + + return $logs; + } + + private function sanitizeContext($context) + { + if (is_array($context)) { + foreach ($context as $key => $value) { + $context[$key] = $this->sanitizeContext($value); + } + + return $context; + } + + if (is_resource($context)) { + return sprintf('Resource(%s)', get_resource_type($context)); + } + + if (is_object($context)) { + return sprintf('Object(%s)', get_class($context)); + } + + return $context; + } + + private function computeDeprecationCount() + { + $count = 0; + foreach ($this->logger->getLogs() as $log) { + if (isset($log['context']['type']) && ErrorHandler::TYPE_DEPRECATION === $log['context']['type']) { + $count++; + } + } + + return $count; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php new file mode 100644 index 0000000..5021311 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php @@ -0,0 +1,101 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DataCollector; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * MemoryDataCollector. + * + * @author Fabien Potencier + */ +class MemoryDataCollector extends DataCollector +{ + public function __construct() + { + $this->data = array( + 'memory' => 0, + 'memory_limit' => $this->convertToBytes(ini_get('memory_limit')), + ); + } + + /** + * {@inheritdoc} + */ + public function collect(Request $request, Response $response, \Exception $exception = null) + { + $this->updateMemoryUsage(); + } + + /** + * Gets the memory. + * + * @return int The memory + */ + public function getMemory() + { + return $this->data['memory']; + } + + /** + * Gets the PHP memory limit. + * + * @return int The memory limit + */ + public function getMemoryLimit() + { + return $this->data['memory_limit']; + } + + /** + * Updates the memory usage data. + */ + public function updateMemoryUsage() + { + $this->data['memory'] = memory_get_peak_usage(true); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'memory'; + } + + private function convertToBytes($memoryLimit) + { + if ('-1' === $memoryLimit) { + return -1; + } + + $memoryLimit = strtolower($memoryLimit); + $max = strtolower(ltrim($memoryLimit, '+')); + if (0 === strpos($max, '0x')) { + $max = intval($max, 16); + } elseif (0 === strpos($max, '0')) { + $max = intval($max, 8); + } else { + $max = intval($max); + } + + switch (substr($memoryLimit, -1)) { + case 't': $max *= 1024; + case 'g': $max *= 1024; + case 'm': $max *= 1024; + case 'k': $max *= 1024; + } + + return $max; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php new file mode 100644 index 0000000..9371748 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php @@ -0,0 +1,327 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DataCollector; + +use Symfony\Component\HttpFoundation\ParameterBag; +use Symfony\Component\HttpFoundation\HeaderBag; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\ResponseHeaderBag; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\Event\FilterControllerEvent; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * RequestDataCollector. + * + * @author Fabien Potencier + */ +class RequestDataCollector extends DataCollector implements EventSubscriberInterface +{ + protected $controllers; + + public function __construct() + { + $this->controllers = new \SplObjectStorage(); + } + + /** + * {@inheritdoc} + */ + public function collect(Request $request, Response $response, \Exception $exception = null) + { + $responseHeaders = $response->headers->all(); + $cookies = array(); + foreach ($response->headers->getCookies() as $cookie) { + $cookies[] = $this->getCookieHeader($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly()); + } + if (count($cookies) > 0) { + $responseHeaders['Set-Cookie'] = $cookies; + } + + $attributes = array(); + foreach ($request->attributes->all() as $key => $value) { + if ('_route' === $key && is_object($value)) { + $attributes['_route'] = $this->varToString($value->getPath()); + } elseif ('_route_params' === $key) { + foreach ($value as $key => $v) { + $attributes['_route_params'][$key] = $this->varToString($v); + } + } else { + $attributes[$key] = $this->varToString($value); + } + } + + $content = null; + try { + $content = $request->getContent(); + } catch (\LogicException $e) { + // the user already got the request content as a resource + $content = false; + } + + $sessionMetadata = array(); + $sessionAttributes = array(); + $flashes = array(); + if ($request->hasSession()) { + $session = $request->getSession(); + if ($session->isStarted()) { + $sessionMetadata['Created'] = date(DATE_RFC822, $session->getMetadataBag()->getCreated()); + $sessionMetadata['Last used'] = date(DATE_RFC822, $session->getMetadataBag()->getLastUsed()); + $sessionMetadata['Lifetime'] = $session->getMetadataBag()->getLifetime(); + $sessionAttributes = $session->all(); + $flashes = $session->getFlashBag()->peekAll(); + } + } + + $statusCode = $response->getStatusCode(); + + $this->data = array( + 'format' => $request->getRequestFormat(), + 'content' => $content, + 'content_type' => $response->headers->get('Content-Type') ? $response->headers->get('Content-Type') : 'text/html', + 'status_text' => isset(Response::$statusTexts[$statusCode]) ? Response::$statusTexts[$statusCode] : '', + 'status_code' => $statusCode, + 'request_query' => $request->query->all(), + 'request_request' => $request->request->all(), + 'request_headers' => $request->headers->all(), + 'request_server' => $request->server->all(), + 'request_cookies' => $request->cookies->all(), + 'request_attributes' => $attributes, + 'response_headers' => $responseHeaders, + 'session_metadata' => $sessionMetadata, + 'session_attributes' => $sessionAttributes, + 'flashes' => $flashes, + 'path_info' => $request->getPathInfo(), + 'controller' => 'n/a', + 'locale' => $request->getLocale(), + ); + + if (isset($this->data['request_headers']['php-auth-pw'])) { + $this->data['request_headers']['php-auth-pw'] = '******'; + } + + if (isset($this->data['request_server']['PHP_AUTH_PW'])) { + $this->data['request_server']['PHP_AUTH_PW'] = '******'; + } + + if (isset($this->controllers[$request])) { + $controller = $this->controllers[$request]; + if (is_array($controller)) { + try { + $r = new \ReflectionMethod($controller[0], $controller[1]); + $this->data['controller'] = array( + 'class' => is_object($controller[0]) ? get_class($controller[0]) : $controller[0], + 'method' => $controller[1], + 'file' => $r->getFilename(), + 'line' => $r->getStartLine(), + ); + } catch (\ReflectionException $re) { + if (is_callable($controller)) { + // using __call or __callStatic + $this->data['controller'] = array( + 'class' => is_object($controller[0]) ? get_class($controller[0]) : $controller[0], + 'method' => $controller[1], + 'file' => 'n/a', + 'line' => 'n/a', + ); + } + } + } elseif ($controller instanceof \Closure) { + $r = new \ReflectionFunction($controller); + $this->data['controller'] = array( + 'class' => $r->getName(), + 'method' => null, + 'file' => $r->getFilename(), + 'line' => $r->getStartLine(), + ); + } else { + $this->data['controller'] = (string) $controller ?: 'n/a'; + } + unset($this->controllers[$request]); + } + } + + public function getPathInfo() + { + return $this->data['path_info']; + } + + public function getRequestRequest() + { + return new ParameterBag($this->data['request_request']); + } + + public function getRequestQuery() + { + return new ParameterBag($this->data['request_query']); + } + + public function getRequestHeaders() + { + return new HeaderBag($this->data['request_headers']); + } + + public function getRequestServer() + { + return new ParameterBag($this->data['request_server']); + } + + public function getRequestCookies() + { + return new ParameterBag($this->data['request_cookies']); + } + + public function getRequestAttributes() + { + return new ParameterBag($this->data['request_attributes']); + } + + public function getResponseHeaders() + { + return new ResponseHeaderBag($this->data['response_headers']); + } + + public function getSessionMetadata() + { + return $this->data['session_metadata']; + } + + public function getSessionAttributes() + { + return $this->data['session_attributes']; + } + + public function getFlashes() + { + return $this->data['flashes']; + } + + public function getContent() + { + return $this->data['content']; + } + + public function getContentType() + { + return $this->data['content_type']; + } + + public function getStatusText() + { + return $this->data['status_text']; + } + + public function getStatusCode() + { + return $this->data['status_code']; + } + + public function getFormat() + { + return $this->data['format']; + } + + public function getLocale() + { + return $this->data['locale']; + } + + /** + * Gets the route name. + * + * The _route request attributes is automatically set by the Router Matcher. + * + * @return string The route + */ + public function getRoute() + { + return isset($this->data['request_attributes']['_route']) ? $this->data['request_attributes']['_route'] : ''; + } + + /** + * Gets the route parameters. + * + * The _route_params request attributes is automatically set by the RouterListener. + * + * @return array The parameters + */ + public function getRouteParams() + { + return isset($this->data['request_attributes']['_route_params']) ? $this->data['request_attributes']['_route_params'] : array(); + } + + /** + * Gets the controller. + * + * @return string The controller as a string + */ + public function getController() + { + return $this->data['controller']; + } + + public function onKernelController(FilterControllerEvent $event) + { + $this->controllers[$event->getRequest()] = $event->getController(); + } + + public static function getSubscribedEvents() + { + return array(KernelEvents::CONTROLLER => 'onKernelController'); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'request'; + } + + private function getCookieHeader($name, $value, $expires, $path, $domain, $secure, $httponly) + { + $cookie = sprintf('%s=%s', $name, urlencode($value)); + + if (0 !== $expires) { + if (is_numeric($expires)) { + $expires = (int) $expires; + } elseif ($expires instanceof \DateTime) { + $expires = $expires->getTimestamp(); + } else { + $tmp = strtotime($expires); + if (false === $tmp || -1 == $tmp) { + throw new \InvalidArgumentException(sprintf('The "expires" cookie parameter is not valid (%s).', $expires)); + } + $expires = $tmp; + } + + $cookie .= '; expires='.str_replace('+0000', '', \DateTime::createFromFormat('U', $expires, new \DateTimeZone('GMT'))->format('D, d-M-Y H:i:s T')); + } + + if ($domain) { + $cookie .= '; domain='.$domain; + } + + $cookie .= '; path='.$path; + + if ($secure) { + $cookie .= '; secure'; + } + + if ($httponly) { + $cookie .= '; httponly'; + } + + return $cookie; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php new file mode 100644 index 0000000..a0fbac9 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php @@ -0,0 +1,102 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DataCollector; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\HttpKernel\Event\FilterControllerEvent; + +/** + * RouterDataCollector. + * + * @author Fabien Potencier + */ +class RouterDataCollector extends DataCollector +{ + protected $controllers; + + public function __construct() + { + $this->controllers = new \SplObjectStorage(); + + $this->data = array( + 'redirect' => false, + 'url' => null, + 'route' => null, + ); + } + + /** + * {@inheritdoc} + */ + public function collect(Request $request, Response $response, \Exception $exception = null) + { + if ($response instanceof RedirectResponse) { + $this->data['redirect'] = true; + $this->data['url'] = $response->getTargetUrl(); + + if ($this->controllers->contains($request)) { + $this->data['route'] = $this->guessRoute($request, $this->controllers[$request]); + } + } + + unset($this->controllers[$request]); + } + + protected function guessRoute(Request $request, $controller) + { + return 'n/a'; + } + + /** + * Remembers the controller associated to each request. + * + * @param FilterControllerEvent $event The filter controller event + */ + public function onKernelController(FilterControllerEvent $event) + { + $this->controllers[$event->getRequest()] = $event->getController(); + } + + /** + * @return bool Whether this request will result in a redirect + */ + public function getRedirect() + { + return $this->data['redirect']; + } + + /** + * @return string|null The target URL + */ + public function getTargetUrl() + { + return $this->data['url']; + } + + /** + * @return string|null The target route + */ + public function getTargetRoute() + { + return $this->data['route']; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'router'; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php new file mode 100644 index 0000000..a700b86 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php @@ -0,0 +1,122 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DataCollector; + +use Symfony\Component\HttpKernel\KernelInterface; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * TimeDataCollector. + * + * @author Fabien Potencier + */ +class TimeDataCollector extends DataCollector +{ + protected $kernel; + + public function __construct(KernelInterface $kernel = null) + { + $this->kernel = $kernel; + } + + /** + * {@inheritdoc} + */ + public function collect(Request $request, Response $response, \Exception $exception = null) + { + if (null !== $this->kernel) { + $startTime = $this->kernel->getStartTime(); + } else { + $startTime = $request->server->get('REQUEST_TIME_FLOAT', $request->server->get('REQUEST_TIME')); + } + + $this->data = array( + 'start_time' => $startTime * 1000, + 'events' => array(), + ); + } + + /** + * Sets the request events. + * + * @param array $events The request events + */ + public function setEvents(array $events) + { + foreach ($events as $event) { + $event->ensureStopped(); + } + + $this->data['events'] = $events; + } + + /** + * Gets the request events. + * + * @return array The request events + */ + public function getEvents() + { + return $this->data['events']; + } + + /** + * Gets the request elapsed time. + * + * @return float The elapsed time + */ + public function getDuration() + { + if (!isset($this->data['events']['__section__'])) { + return 0; + } + + $lastEvent = $this->data['events']['__section__']; + + return $lastEvent->getOrigin() + $lastEvent->getDuration() - $this->getStartTime(); + } + + /** + * Gets the initialization time. + * + * This is the time spent until the beginning of the request handling. + * + * @return float The elapsed time + */ + public function getInitTime() + { + if (!isset($this->data['events']['__section__'])) { + return 0; + } + + return $this->data['events']['__section__']->getOrigin() - $this->getStartTime(); + } + + /** + * Gets the request time. + * + * @return int The time + */ + public function getStartTime() + { + return $this->data['start_time']; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'time'; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php new file mode 100644 index 0000000..2718f89 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Debug; + +use Symfony\Component\Debug\ErrorHandler as DebugErrorHandler; + +/** + * ErrorHandler. + * + * @author Fabien Potencier + * + * @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead. + */ +class ErrorHandler extends DebugErrorHandler +{ +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php new file mode 100644 index 0000000..581e29c --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Debug; + +use Symfony\Component\Debug\ExceptionHandler as DebugExceptionHandler; + +/** + * ExceptionHandler converts an exception to a Response object. + * + * @author Fabien Potencier + * + * @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead. + */ +class ExceptionHandler extends DebugExceptionHandler +{ +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php new file mode 100644 index 0000000..baf96c0 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php @@ -0,0 +1,487 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Debug; + +use Symfony\Component\Stopwatch\Stopwatch; +use Symfony\Component\HttpKernel\KernelEvents; +use Psr\Log\LoggerInterface; +use Symfony\Component\HttpKernel\Profiler\Profile; +use Symfony\Component\HttpKernel\Profiler\Profiler; +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\EventDispatcher\Event; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface; + +/** + * Collects some data about event listeners. + * + * This event dispatcher delegates the dispatching to another one. + * + * @author Fabien Potencier + */ +class TraceableEventDispatcher implements EventDispatcherInterface, TraceableEventDispatcherInterface +{ + private $logger; + private $called; + private $stopwatch; + private $profiler; + private $dispatcher; + private $wrappedListeners; + private $firstCalledEvent; + private $lastEventId = 0; + + /** + * Constructor. + * + * @param EventDispatcherInterface $dispatcher An EventDispatcherInterface instance + * @param Stopwatch $stopwatch A Stopwatch instance + * @param LoggerInterface $logger A LoggerInterface instance + */ + public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, LoggerInterface $logger = null) + { + $this->dispatcher = $dispatcher; + $this->stopwatch = $stopwatch; + $this->logger = $logger; + $this->called = array(); + $this->wrappedListeners = array(); + $this->firstCalledEvent = array(); + } + + /** + * Sets the profiler. + * + * @param Profiler|null $profiler A Profiler instance + */ + public function setProfiler(Profiler $profiler = null) + { + $this->profiler = $profiler; + } + + /** + * {@inheritdoc} + */ + public function addListener($eventName, $listener, $priority = 0) + { + $this->dispatcher->addListener($eventName, $listener, $priority); + } + + /** + * {@inheritdoc} + */ + public function addSubscriber(EventSubscriberInterface $subscriber) + { + $this->dispatcher->addSubscriber($subscriber); + } + + /** + * {@inheritdoc} + */ + public function removeListener($eventName, $listener) + { + return $this->dispatcher->removeListener($eventName, $listener); + } + + /** + * {@inheritdoc} + */ + public function removeSubscriber(EventSubscriberInterface $subscriber) + { + return $this->dispatcher->removeSubscriber($subscriber); + } + + /** + * {@inheritdoc} + */ + public function getListeners($eventName = null) + { + return $this->dispatcher->getListeners($eventName); + } + + /** + * {@inheritdoc} + */ + public function hasListeners($eventName = null) + { + return $this->dispatcher->hasListeners($eventName); + } + + /** + * {@inheritdoc} + */ + public function dispatch($eventName, Event $event = null) + { + if (null === $event) { + $event = new Event(); + } + + $eventId = ++$this->lastEventId; + + $this->preDispatch($eventName, $eventId, $event); + + $e = $this->stopwatch->start($eventName, 'section'); + + $this->firstCalledEvent[$eventName] = $this->stopwatch->start($eventName.'.loading', 'event_listener_loading'); + + if (!$this->dispatcher->hasListeners($eventName)) { + $this->firstCalledEvent[$eventName]->stop(); + } + + $this->dispatcher->dispatch($eventName, $event); + + unset($this->firstCalledEvent[$eventName]); + + $e->stop(); + + $this->postDispatch($eventName, $eventId, $event); + + return $event; + } + + /** + * {@inheritdoc} + */ + public function getCalledListeners() + { + return $this->called; + } + + /** + * {@inheritdoc} + */ + public function getNotCalledListeners() + { + try { + $allListeners = $this->getListeners(); + } catch (\Exception $e) { + if (null !== $this->logger) { + $this->logger->info(sprintf('An exception was thrown while getting the uncalled listeners (%s)', $e->getMessage()), array('exception' => $e)); + } + + // unable to retrieve the uncalled listeners + return array(); + } + + $notCalled = array(); + foreach ($allListeners as $name => $listeners) { + foreach ($listeners as $listener) { + $info = $this->getListenerInfo($listener, null, $name); + if (!isset($this->called[$name.'.'.$info['pretty']])) { + $notCalled[$name.'.'.$info['pretty']] = $info; + } + } + } + + return $notCalled; + } + + /** + * Proxies all method calls to the original event dispatcher. + * + * @param string $method The method name + * @param array $arguments The method arguments + * + * @return mixed + */ + public function __call($method, $arguments) + { + return call_user_func_array(array($this->dispatcher, $method), $arguments); + } + + /** + * This is a private method and must not be used. + * + * This method is public because it is used in a closure. + * Whenever Symfony will require PHP 5.4, this could be changed + * to a proper private method. + */ + public function logSkippedListeners($eventName, $eventId, Event $event, $listener) + { + if (null === $this->logger) { + return; + } + + $info = $this->getListenerInfo($listener, $eventId, $eventName); + + $this->logger->debug(sprintf('Listener "%s" stopped propagation of the event "%s".', $info['pretty'], $eventName)); + + $skippedListeners = $this->getListeners($eventName); + $skipped = false; + + foreach ($skippedListeners as $skippedListener) { + $skippedListener = $this->unwrapListener($skippedListener, $eventId); + + if ($skipped) { + $info = $this->getListenerInfo($skippedListener, $eventId, $eventName); + $this->logger->debug(sprintf('Listener "%s" was not called for event "%s".', $info['pretty'], $eventName)); + } + + if ($skippedListener === $listener) { + $skipped = true; + } + } + } + + /** + * This is a private method. + * + * This method is public because it is used in a closure. + * Whenever Symfony will require PHP 5.4, this could be changed + * to a proper private method. + */ + public function preListenerCall($eventName, $eventId, $listener) + { + // is it the first called listener? + if (isset($this->firstCalledEvent[$eventName])) { + $this->firstCalledEvent[$eventName]->stop(); + + unset($this->firstCalledEvent[$eventName]); + } + + $info = $this->getListenerInfo($listener, $eventId, $eventName); + + if (null !== $this->logger) { + $this->logger->debug(sprintf('Notified event "%s" to listener "%s".', $eventName, $info['pretty'])); + } + + $this->called[$eventName.'.'.$info['pretty']] = $info; + + return $this->stopwatch->start(isset($info['class']) ? $info['class'] : $info['type'], 'event_listener'); + } + + /** + * Returns information about the listener + * + * @param object $listener The listener + * @param int|null $eventId The event id + * @param string $eventName The event name + * + * @return array Information about the listener + */ + private function getListenerInfo($listener, $eventId, $eventName) + { + $listener = $this->unwrapListener($listener, $eventId); + + $info = array( + 'event' => $eventName, + ); + if ($listener instanceof \Closure) { + $info += array( + 'type' => 'Closure', + 'pretty' => 'closure', + ); + } elseif (is_string($listener)) { + try { + $r = new \ReflectionFunction($listener); + $file = $r->getFileName(); + $line = $r->getStartLine(); + } catch (\ReflectionException $e) { + $file = null; + $line = null; + } + $info += array( + 'type' => 'Function', + 'function' => $listener, + 'file' => $file, + 'line' => $line, + 'pretty' => $listener, + ); + } elseif (is_array($listener) || (is_object($listener) && is_callable($listener))) { + if (!is_array($listener)) { + $listener = array($listener, '__invoke'); + } + $class = is_object($listener[0]) ? get_class($listener[0]) : $listener[0]; + try { + $r = new \ReflectionMethod($class, $listener[1]); + $file = $r->getFileName(); + $line = $r->getStartLine(); + } catch (\ReflectionException $e) { + $file = null; + $line = null; + } + $info += array( + 'type' => 'Method', + 'class' => $class, + 'method' => $listener[1], + 'file' => $file, + 'line' => $line, + 'pretty' => $class.'::'.$listener[1], + ); + } + + return $info; + } + + /** + * Updates the stopwatch data in the profile hierarchy. + * + * @param string $token Profile token + * @param bool $updateChildren Whether to update the children altogether + */ + private function updateProfiles($token, $updateChildren) + { + if (!$this->profiler || !$profile = $this->profiler->loadProfile($token)) { + return; + } + + $this->saveInfoInProfile($profile, $updateChildren); + } + + /** + * Update the profiles with the timing and events information and saves them. + * + * @param Profile $profile The root profile + * @param bool $updateChildren Whether to update the children altogether + */ + private function saveInfoInProfile(Profile $profile, $updateChildren) + { + try { + $collector = $profile->getCollector('memory'); + $collector->updateMemoryUsage(); + } catch (\InvalidArgumentException $e) { + } + + try { + $collector = $profile->getCollector('time'); + $collector->setEvents($this->stopwatch->getSectionEvents($profile->getToken())); + } catch (\InvalidArgumentException $e) { + } + + try { + $collector = $profile->getCollector('events'); + $collector->setCalledListeners($this->getCalledListeners()); + $collector->setNotCalledListeners($this->getNotCalledListeners()); + } catch (\InvalidArgumentException $e) { + } + + $this->profiler->saveProfile($profile); + + if ($updateChildren) { + foreach ($profile->getChildren() as $child) { + $this->saveInfoInProfile($child, true); + } + } + } + + private function preDispatch($eventName, $eventId, Event $event) + { + // wrap all listeners before they are called + $this->wrappedListeners[$eventId] = new \SplObjectStorage(); + + $listeners = $this->dispatcher->getListeners($eventName); + + foreach ($listeners as $listener) { + $this->dispatcher->removeListener($eventName, $listener); + $wrapped = $this->wrapListener($eventName, $eventId, $listener); + $this->wrappedListeners[$eventId][$wrapped] = $listener; + $this->dispatcher->addListener($eventName, $wrapped); + } + + switch ($eventName) { + case KernelEvents::REQUEST: + $this->stopwatch->openSection(); + break; + case KernelEvents::VIEW: + case KernelEvents::RESPONSE: + // stop only if a controller has been executed + if ($this->stopwatch->isStarted('controller')) { + $this->stopwatch->stop('controller'); + } + break; + case KernelEvents::TERMINATE: + $token = $event->getResponse()->headers->get('X-Debug-Token'); + // There is a very special case when using builtin AppCache class as kernel wrapper, in the case + // of an ESI request leading to a `stale` response [B] inside a `fresh` cached response [A]. + // In this case, `$token` contains the [B] debug token, but the open `stopwatch` section ID + // is equal to the [A] debug token. Trying to reopen section with the [B] token throws an exception + // which must be caught. + try { + $this->stopwatch->openSection($token); + } catch (\LogicException $e) { + } + break; + } + } + + private function postDispatch($eventName, $eventId, Event $event) + { + switch ($eventName) { + case KernelEvents::CONTROLLER: + $this->stopwatch->start('controller', 'section'); + break; + case KernelEvents::RESPONSE: + $token = $event->getResponse()->headers->get('X-Debug-Token'); + $this->stopwatch->stopSection($token); + if (HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) { + // The profiles can only be updated once they have been created + // that is after the 'kernel.response' event of the main request + $this->updateProfiles($token, true); + } + break; + case KernelEvents::TERMINATE: + $token = $event->getResponse()->headers->get('X-Debug-Token'); + // In the special case described in the `preDispatch` method above, the `$token` section + // does not exist, then closing it throws an exception which must be caught. + try { + $this->stopwatch->stopSection($token); + } catch (\LogicException $e) { + } + // The children profiles have been updated by the previous 'kernel.response' + // event. Only the root profile need to be updated with the 'kernel.terminate' + // timing information. + $this->updateProfiles($token, false); + break; + } + + foreach ($this->wrappedListeners[$eventId] as $wrapped) { + $this->dispatcher->removeListener($eventName, $wrapped); + $this->dispatcher->addListener($eventName, $this->wrappedListeners[$eventId][$wrapped]); + } + + unset($this->wrappedListeners[$eventId]); + } + + private function wrapListener($eventName, $eventId, $listener) + { + $self = $this; + + return function (Event $event) use ($self, $eventName, $eventId, $listener) { + $e = $self->preListenerCall($eventName, $eventId, $listener); + + call_user_func($listener, $event); + + $e->stop(); + + if ($event->isPropagationStopped()) { + $self->logSkippedListeners($eventName, $eventId, $event, $listener); + } + }; + } + + private function unwrapListener($listener, $eventId) + { + // get the original listener + if (is_object($listener)) { + if (null === $eventId) { + foreach (array_keys($this->wrappedListeners) as $eventId) { + if (isset($this->wrappedListeners[$eventId][$listener])) { + return $this->wrappedListeners[$eventId][$listener]; + } + } + } elseif (isset($this->wrappedListeners[$eventId][$listener])) { + return $this->wrappedListeners[$eventId][$listener]; + } + } + + return $listener; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php new file mode 100644 index 0000000..09af6bd --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DependencyInjection; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\HttpKernel\Kernel; + +/** + * Sets the classes to compile in the cache for the container. + * + * @author Fabien Potencier + */ +class AddClassesToCachePass implements CompilerPassInterface +{ + private $kernel; + + public function __construct(Kernel $kernel) + { + $this->kernel = $kernel; + } + + /** + * {@inheritdoc} + */ + public function process(ContainerBuilder $container) + { + $classes = array(); + foreach ($container->getExtensions() as $extension) { + if ($extension instanceof Extension) { + $classes = array_merge($classes, $extension->getClassesToCompile()); + } + } + + $this->kernel->setClassCache(array_unique($container->getParameterBag()->resolveValue($classes))); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php new file mode 100644 index 0000000..3ec454b --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DependencyInjection; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * This extension sub-class provides first-class integration with the + * Config/Definition Component. + * + * You can use this as base class if you + * + * a) use the Config/Definition component for configuration + * b) your configuration class is named "Configuration" and + * c) the configuration class resides in the DependencyInjection sub-folder + * + * @author Johannes M. Schmitt + */ +abstract class ConfigurableExtension extends Extension +{ + /** + * {@inheritdoc} + */ + final public function load(array $configs, ContainerBuilder $container) + { + $this->loadInternal($this->processConfiguration($this->getConfiguration($configs, $container), $configs), $container); + } + + /** + * Configures the passed container according to the merged configuration. + * + * @param array $mergedConfig + * @param ContainerBuilder $container + */ + abstract protected function loadInternal(array $mergedConfig, ContainerBuilder $container); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php new file mode 100644 index 0000000..c9b8a21 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php @@ -0,0 +1,75 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DependencyInjection; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpKernel\HttpKernel; +use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Scope; + +/** + * Adds a managed request scope. + * + * @author Fabien Potencier + * @author Johannes M. Schmitt + */ +class ContainerAwareHttpKernel extends HttpKernel +{ + protected $container; + + /** + * Constructor. + * + * @param EventDispatcherInterface $dispatcher An EventDispatcherInterface instance + * @param ContainerInterface $container A ContainerInterface instance + * @param ControllerResolverInterface $controllerResolver A ControllerResolverInterface instance + */ + public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver) + { + parent::__construct($dispatcher, $controllerResolver); + + $this->container = $container; + + // the request scope might have been created before (see FrameworkBundle) + if (!$container->hasScope('request')) { + $container->addScope(new Scope('request')); + } + } + + /** + * {@inheritdoc} + */ + public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) + { + $request->headers->set('X-Php-Ob-Level', ob_get_level()); + + $this->container->enterScope('request'); + $this->container->set('request', $request, 'request'); + + try { + $response = parent::handle($request, $type, $catch); + } catch (\Exception $e) { + $this->container->set('request', null, 'request'); + $this->container->leaveScope('request'); + + throw $e; + } + + $this->container->set('request', null, 'request'); + $this->container->leaveScope('request'); + + return $response; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/Extension.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/Extension.php new file mode 100644 index 0000000..2ca0f13 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/Extension.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DependencyInjection; + +use Symfony\Component\DependencyInjection\Extension\Extension as BaseExtension; + +/** + * Allow adding classes to the class cache. + * + * @author Fabien Potencier + */ +abstract class Extension extends BaseExtension +{ + private $classes = array(); + + /** + * Gets the classes to cache. + * + * @return array An array of classes + */ + public function getClassesToCompile() + { + return $this->classes; + } + + /** + * Adds classes to the class cache. + * + * @param array $classes An array of classes + */ + public function addClassesToCompile(array $classes) + { + $this->classes = array_merge($this->classes, $classes); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php new file mode 100644 index 0000000..dcd7382 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DependencyInjection; + +use Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass as BaseMergeExtensionConfigurationPass; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Ensures certain extensions are always loaded. + * + * @author Kris Wallsmith + */ +class MergeExtensionConfigurationPass extends BaseMergeExtensionConfigurationPass +{ + private $extensions; + + public function __construct(array $extensions) + { + $this->extensions = $extensions; + } + + public function process(ContainerBuilder $container) + { + foreach ($this->extensions as $extension) { + if (!count($container->getExtensionConfig($extension))) { + $container->loadFromExtension($extension, array()); + } + } + + parent::process($container); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php new file mode 100644 index 0000000..6c56634 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php @@ -0,0 +1,106 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\DependencyInjection; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; + +/** + * Compiler pass to register tagged services for an event dispatcher. + */ +class RegisterListenersPass implements CompilerPassInterface +{ + /** + * @var string + */ + protected $dispatcherService; + + /** + * @var string + */ + protected $listenerTag; + + /** + * @var string + */ + protected $subscriberTag; + + /** + * Constructor. + * + * @param string $dispatcherService Service name of the event dispatcher in processed container + * @param string $listenerTag Tag name used for listener + * @param string $subscriberTag Tag name used for subscribers + */ + public function __construct($dispatcherService = 'event_dispatcher', $listenerTag = 'kernel.event_listener', $subscriberTag = 'kernel.event_subscriber') + { + $this->dispatcherService = $dispatcherService; + $this->listenerTag = $listenerTag; + $this->subscriberTag = $subscriberTag; + } + + public function process(ContainerBuilder $container) + { + if (!$container->hasDefinition($this->dispatcherService)) { + return; + } + + $definition = $container->getDefinition($this->dispatcherService); + + foreach ($container->findTaggedServiceIds($this->listenerTag) as $id => $events) { + $def = $container->getDefinition($id); + if (!$def->isPublic()) { + throw new \InvalidArgumentException(sprintf('The service "%s" must be public as event listeners are lazy-loaded.', $id)); + } + + if ($def->isAbstract()) { + throw new \InvalidArgumentException(sprintf('The service "%s" must not be abstract as event listeners are lazy-loaded.', $id)); + } + + foreach ($events as $event) { + $priority = isset($event['priority']) ? $event['priority'] : 0; + + if (!isset($event['event'])) { + throw new \InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "%s" tags.', $id, $this->listenerTag)); + } + + if (!isset($event['method'])) { + $event['method'] = 'on'.preg_replace_callback(array( + '/(?<=\b)[a-z]/i', + '/[^a-z0-9]/i', + ), function ($matches) { return strtoupper($matches[0]); }, $event['event']); + $event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']); + } + + $definition->addMethodCall('addListenerService', array($event['event'], array($id, $event['method']), $priority)); + } + } + + foreach ($container->findTaggedServiceIds($this->subscriberTag) as $id => $attributes) { + $def = $container->getDefinition($id); + if (!$def->isPublic()) { + throw new \InvalidArgumentException(sprintf('The service "%s" must be public as event subscribers are lazy-loaded.', $id)); + } + + // We must assume that the class value has been correctly filled, even if the service is created by a factory + $class = $def->getClass(); + + $refClass = new \ReflectionClass($class); + $interface = 'Symfony\Component\EventDispatcher\EventSubscriberInterface'; + if (!$refClass->implementsInterface($interface)) { + throw new \InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, $interface)); + } + + $definition->addMethodCall('addSubscriberService', array($id, $class)); + } + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php new file mode 100644 index 0000000..2b4860c --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php @@ -0,0 +1,109 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Event; + +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpFoundation\Request; + +/** + * Allows filtering of a controller callable + * + * You can call getController() to retrieve the current controller. With + * setController() you can set a new controller that is used in the processing + * of the request. + * + * Controllers should be callables. + * + * @author Bernhard Schussek + * + * @api + */ +class FilterControllerEvent extends KernelEvent +{ + /** + * The current controller + * @var callable + */ + private $controller; + + public function __construct(HttpKernelInterface $kernel, $controller, Request $request, $requestType) + { + parent::__construct($kernel, $request, $requestType); + + $this->setController($controller); + } + + /** + * Returns the current controller + * + * @return callable + * + * @api + */ + public function getController() + { + return $this->controller; + } + + /** + * Sets a new controller + * + * @param callable $controller + * + * @throws \LogicException + * + * @api + */ + public function setController($controller) + { + // controller must be a callable + if (!is_callable($controller)) { + throw new \LogicException(sprintf('The controller must be a callable (%s given).', $this->varToString($controller))); + } + + $this->controller = $controller; + } + + private function varToString($var) + { + if (is_object($var)) { + return sprintf('Object(%s)', get_class($var)); + } + + if (is_array($var)) { + $a = array(); + foreach ($var as $k => $v) { + $a[] = sprintf('%s => %s', $k, $this->varToString($v)); + } + + return sprintf("Array(%s)", implode(', ', $a)); + } + + if (is_resource($var)) { + return sprintf('Resource(%s)', get_resource_type($var)); + } + + if (null === $var) { + return 'null'; + } + + if (false === $var) { + return 'false'; + } + + if (true === $var) { + return 'true'; + } + + return (string) $var; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php new file mode 100644 index 0000000..8de76a5 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Event; + +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * Allows to filter a Response object + * + * You can call getResponse() to retrieve the current response. With + * setResponse() you can set a new response that will be returned to the + * browser. + * + * @author Bernhard Schussek + * + * @api + */ +class FilterResponseEvent extends KernelEvent +{ + /** + * The current response object + * @var Response + */ + private $response; + + public function __construct(HttpKernelInterface $kernel, Request $request, $requestType, Response $response) + { + parent::__construct($kernel, $request, $requestType); + + $this->setResponse($response); + } + + /** + * Returns the current response object + * + * @return Response + * + * @api + */ + public function getResponse() + { + return $this->response; + } + + /** + * Sets a new response object + * + * @param Response $response + * + * @api + */ + public function setResponse(Response $response) + { + $this->response = $response; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseEvent.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseEvent.php new file mode 100644 index 0000000..5565f82 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseEvent.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Event; + +use Symfony\Component\HttpFoundation\Response; + +/** + * Allows to create a response for a request + * + * Call setResponse() to set the response that will be returned for the + * current request. The propagation of this event is stopped as soon as a + * response is set. + * + * @author Bernhard Schussek + * + * @api + */ +class GetResponseEvent extends KernelEvent +{ + /** + * The response object + * @var Response + */ + private $response; + + /** + * Returns the response object + * + * @return Response + * + * @api + */ + public function getResponse() + { + return $this->response; + } + + /** + * Sets a response and stops event propagation + * + * @param Response $response + * + * @api + */ + public function setResponse(Response $response) + { + $this->response = $response; + + $this->stopPropagation(); + } + + /** + * Returns whether a response was set + * + * @return bool Whether a response was set + * + * @api + */ + public function hasResponse() + { + return null !== $this->response; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php new file mode 100644 index 0000000..fcb38da --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Event; + +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpFoundation\Request; + +/** + * Allows to create a response for the return value of a controller + * + * Call setResponse() to set the response that will be returned for the + * current request. The propagation of this event is stopped as soon as a + * response is set. + * + * @author Bernhard Schussek + * + * @api + */ +class GetResponseForControllerResultEvent extends GetResponseEvent +{ + /** + * The return value of the controller + * + * @var mixed + */ + private $controllerResult; + + public function __construct(HttpKernelInterface $kernel, Request $request, $requestType, $controllerResult) + { + parent::__construct($kernel, $request, $requestType); + + $this->controllerResult = $controllerResult; + } + + /** + * Returns the return value of the controller. + * + * @return mixed The controller return value + * + * @api + */ + public function getControllerResult() + { + return $this->controllerResult; + } + + /** + * Assigns the return value of the controller. + * + * @param mixed $controllerResult The controller return value + * + * @api + */ + public function setControllerResult($controllerResult) + { + $this->controllerResult = $controllerResult; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php new file mode 100644 index 0000000..3787f62 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Event; + +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpFoundation\Request; + +/** + * Allows to create a response for a thrown exception + * + * Call setResponse() to set the response that will be returned for the + * current request. The propagation of this event is stopped as soon as a + * response is set. + * + * You can also call setException() to replace the thrown exception. This + * exception will be thrown if no response is set during processing of this + * event. + * + * @author Bernhard Schussek + * + * @api + */ +class GetResponseForExceptionEvent extends GetResponseEvent +{ + /** + * The exception object + * @var \Exception + */ + private $exception; + + public function __construct(HttpKernelInterface $kernel, Request $request, $requestType, \Exception $e) + { + parent::__construct($kernel, $request, $requestType); + + $this->setException($e); + } + + /** + * Returns the thrown exception + * + * @return \Exception The thrown exception + * + * @api + */ + public function getException() + { + return $this->exception; + } + + /** + * Replaces the thrown exception + * + * This exception will be thrown if no response is set in the event. + * + * @param \Exception $exception The thrown exception + * + * @api + */ + public function setException(\Exception $exception) + { + $this->exception = $exception; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php new file mode 100644 index 0000000..4194613 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Event; + +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\EventDispatcher\Event; + +/** + * Base class for events thrown in the HttpKernel component + * + * @author Bernhard Schussek + * + * @api + */ +class KernelEvent extends Event +{ + /** + * The kernel in which this event was thrown + * @var HttpKernelInterface + */ + private $kernel; + + /** + * The request the kernel is currently processing + * @var Request + */ + private $request; + + /** + * The request type the kernel is currently processing. One of + * HttpKernelInterface::MASTER_REQUEST and HttpKernelInterface::SUB_REQUEST + * @var int + */ + private $requestType; + + public function __construct(HttpKernelInterface $kernel, Request $request, $requestType) + { + $this->kernel = $kernel; + $this->request = $request; + $this->requestType = $requestType; + } + + /** + * Returns the kernel in which this event was thrown + * + * @return HttpKernelInterface + * + * @api + */ + public function getKernel() + { + return $this->kernel; + } + + /** + * Returns the request the kernel is currently processing + * + * @return Request + * + * @api + */ + public function getRequest() + { + return $this->request; + } + + /** + * Returns the request type the kernel is currently processing + * + * @return int One of HttpKernelInterface::MASTER_REQUEST and + * HttpKernelInterface::SUB_REQUEST + * + * @api + */ + public function getRequestType() + { + return $this->requestType; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/PostResponseEvent.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/PostResponseEvent.php new file mode 100644 index 0000000..caa7b9f --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/PostResponseEvent.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Event; + +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\EventDispatcher\Event; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * Allows to execute logic after a response was sent + * + * @author Jordi Boggiano + */ +class PostResponseEvent extends Event +{ + /** + * The kernel in which this event was thrown + * @var HttpKernelInterface + */ + private $kernel; + + private $request; + + private $response; + + public function __construct(HttpKernelInterface $kernel, Request $request, Response $response) + { + $this->kernel = $kernel; + $this->request = $request; + $this->response = $response; + } + + /** + * Returns the kernel in which this event was thrown. + * + * @return HttpKernelInterface + */ + public function getKernel() + { + return $this->kernel; + } + + /** + * Returns the request for which this event was thrown. + * + * @return Request + */ + public function getRequest() + { + return $this->request; + } + + /** + * Returns the response for which this event was thrown. + * + * @return Response + */ + public function getResponse() + { + return $this->response; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ErrorsLoggerListener.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ErrorsLoggerListener.php new file mode 100644 index 0000000..13940ab --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ErrorsLoggerListener.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\EventListener; + +use Psr\Log\LoggerInterface; +use Symfony\Component\HttpKernel\Debug\ErrorHandler; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpKernel\KernelEvents; + +/** + * Injects the logger into the ErrorHandler, so that it can log various errors. + * + * @author Colin Frei + * @author Konstantin Myakshin + */ +class ErrorsLoggerListener implements EventSubscriberInterface +{ + private $channel; + + private $logger; + + public function __construct($channel, LoggerInterface $logger = null) + { + $this->channel = $channel; + $this->logger = $logger; + } + + public function injectLogger() + { + if (null !== $this->logger) { + ErrorHandler::setLogger($this->logger, $this->channel); + } + } + + public static function getSubscribedEvents() + { + return array(KernelEvents::REQUEST => 'injectLogger'); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/EsiListener.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/EsiListener.php new file mode 100644 index 0000000..b90562b --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/EsiListener.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\EventListener; + +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpKernel\Event\FilterResponseEvent; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\HttpCache\Esi; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * EsiListener adds a Surrogate-Control HTTP header when the Response needs to be parsed for ESI. + * + * @author Fabien Potencier + */ +class EsiListener implements EventSubscriberInterface +{ + private $esi; + + /** + * Constructor. + * + * @param Esi $esi An ESI instance + */ + public function __construct(Esi $esi = null) + { + $this->esi = $esi; + } + + /** + * Filters the Response. + * + * @param FilterResponseEvent $event A FilterResponseEvent instance + */ + public function onKernelResponse(FilterResponseEvent $event) + { + if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType() || null === $this->esi) { + return; + } + + $this->esi->addSurrogateControl($event->getResponse()); + } + + public static function getSubscribedEvents() + { + return array( + KernelEvents::RESPONSE => 'onKernelResponse', + ); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php new file mode 100644 index 0000000..b438454 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php @@ -0,0 +1,112 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\EventListener; + +use Psr\Log\LoggerInterface; +use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; +use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpKernel\Exception\FlattenException; +use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * ExceptionListener. + * + * @author Fabien Potencier + */ +class ExceptionListener implements EventSubscriberInterface +{ + protected $controller; + protected $logger; + + public function __construct($controller, LoggerInterface $logger = null) + { + $this->controller = $controller; + $this->logger = $logger; + } + + public function onKernelException(GetResponseForExceptionEvent $event) + { + static $handling; + + if (true === $handling) { + return false; + } + + $handling = true; + + $exception = $event->getException(); + $request = $event->getRequest(); + + $this->logException($exception, sprintf('Uncaught PHP Exception %s: "%s" at %s line %s', get_class($exception), $exception->getMessage(), $exception->getFile(), $exception->getLine())); + + $attributes = array( + '_controller' => $this->controller, + 'exception' => FlattenException::create($exception), + 'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null, + // keep for BC -- as $format can be an argument of the controller callable + // see src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php + // @deprecated in 2.4, to be removed in 3.0 + 'format' => $request->getRequestFormat(), + ); + + $request = $request->duplicate(null, null, $attributes); + $request->setMethod('GET'); + + try { + $response = $event->getKernel()->handle($request, HttpKernelInterface::SUB_REQUEST, true); + } catch (\Exception $e) { + $this->logException($exception, sprintf('Exception thrown when handling an exception (%s: %s)', get_class($e), $e->getMessage()), false); + + // set handling to false otherwise it wont be able to handle further more + $handling = false; + + // re-throw the exception from within HttpKernel as this is a catch-all + return; + } + + $event->setResponse($response); + + $handling = false; + } + + public static function getSubscribedEvents() + { + return array( + KernelEvents::EXCEPTION => array('onKernelException', -128), + ); + } + + /** + * Logs an exception. + * + * @param \Exception $exception The original \Exception instance + * @param string $message The error message to log + * @param bool $original False when the handling of the exception thrown another exception + */ + protected function logException(\Exception $exception, $message, $original = true) + { + $isCritical = !$exception instanceof HttpExceptionInterface || $exception->getStatusCode() >= 500; + $context = array('exception' => $exception); + if (null !== $this->logger) { + if ($isCritical) { + $this->logger->critical($message, $context); + } else { + $this->logger->error($message, $context); + } + } elseif (!$original || $isCritical) { + error_log($message); + } + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/FragmentListener.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/FragmentListener.php new file mode 100644 index 0000000..6f45c3b --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/FragmentListener.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\EventListener; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; +use Symfony\Component\HttpKernel\UriSigner; +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * Handles content fragments represented by special URIs. + * + * All URL paths starting with /_fragment are handled as + * content fragments by this listener. + * + * If throws an AccessDeniedHttpException exception if the request + * is not signed or if it is not an internal sub-request. + * + * @author Fabien Potencier + */ +class FragmentListener implements EventSubscriberInterface +{ + private $signer; + private $fragmentPath; + + /** + * Constructor. + * + * @param UriSigner $signer A UriSigner instance + * @param string $fragmentPath The path that triggers this listener + */ + public function __construct(UriSigner $signer, $fragmentPath = '/_fragment') + { + $this->signer = $signer; + $this->fragmentPath = $fragmentPath; + } + + /** + * Fixes request attributes when the path is '/_fragment'. + * + * @param GetResponseEvent $event A GetResponseEvent instance + * + * @throws AccessDeniedHttpException if the request does not come from a trusted IP. + */ + public function onKernelRequest(GetResponseEvent $event) + { + $request = $event->getRequest(); + + if ($this->fragmentPath !== rawurldecode($request->getPathInfo())) { + return; + } + + if (HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) { + $this->validateRequest($request); + } + + parse_str($request->query->get('_path', ''), $attributes); + $request->attributes->add($attributes); + $request->attributes->set('_route_params', array_replace($request->attributes->get('_route_params', array()), $attributes)); + $request->query->remove('_path'); + } + + protected function validateRequest(Request $request) + { + // is the Request safe? + if (!$request->isMethodSafe()) { + throw new AccessDeniedHttpException(); + } + + // is the Request signed? + // we cannot use $request->getUri() here as we want to work with the original URI (no query string reordering) + if ($this->signer->check($request->getSchemeAndHttpHost().$request->getBaseUrl().$request->getPathInfo().(null !== ($qs = $request->server->get('QUERY_STRING')) ? '?'.$qs : ''))) { + return; + } + + throw new AccessDeniedHttpException(); + } + + /** + * @deprecated Deprecated since 2.3.19, to be removed in 3.0. + * + * @return string[] + */ + protected function getLocalIpAddresses() + { + return array('127.0.0.1', 'fe80::1', '::1'); + } + + public static function getSubscribedEvents() + { + return array( + KernelEvents::REQUEST => array(array('onKernelRequest', 48)), + ); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php new file mode 100644 index 0000000..0b864c0 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php @@ -0,0 +1,66 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\EventListener; + +use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\RequestContextAwareInterface; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * Initializes the locale based on the current request. + * + * @author Fabien Potencier + */ +class LocaleListener implements EventSubscriberInterface +{ + private $router; + private $defaultLocale; + + public function __construct($defaultLocale = 'en', RequestContextAwareInterface $router = null) + { + $this->defaultLocale = $defaultLocale; + $this->router = $router; + } + + public function setRequest(Request $request = null) + { + if (null === $request) { + return; + } + + if ($locale = $request->attributes->get('_locale')) { + $request->setLocale($locale); + } + + if (null !== $this->router) { + $this->router->getContext()->setParameter('_locale', $request->getLocale()); + } + } + + public function onKernelRequest(GetResponseEvent $event) + { + $request = $event->getRequest(); + $request->setDefaultLocale($this->defaultLocale); + + $this->setRequest($request); + } + + public static function getSubscribedEvents() + { + return array( + // must be registered after the Router to have access to the _locale + KernelEvents::REQUEST => array(array('onKernelRequest', 16)), + ); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php new file mode 100644 index 0000000..c981717 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php @@ -0,0 +1,166 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\EventListener; + +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\HttpKernel\Event\FilterResponseEvent; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\Profiler\Profile; +use Symfony\Component\HttpKernel\Profiler\Profiler; +use Symfony\Component\HttpFoundation\RequestMatcherInterface; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * ProfilerListener collects data for the current request by listening to the onKernelResponse event. + * + * @author Fabien Potencier + */ +class ProfilerListener implements EventSubscriberInterface +{ + protected $profiler; + protected $matcher; + protected $onlyException; + protected $onlyMasterRequests; + protected $exception; + protected $children; + protected $requests; + protected $profiles; + + /** + * Constructor. + * + * @param Profiler $profiler A Profiler instance + * @param RequestMatcherInterface $matcher A RequestMatcher instance + * @param bool $onlyException true if the profiler only collects data when an exception occurs, false otherwise + * @param bool $onlyMasterRequests true if the profiler only collects data when the request is a master request, false otherwise + */ + public function __construct(Profiler $profiler, RequestMatcherInterface $matcher = null, $onlyException = false, $onlyMasterRequests = false) + { + $this->profiler = $profiler; + $this->matcher = $matcher; + $this->onlyException = (bool) $onlyException; + $this->onlyMasterRequests = (bool) $onlyMasterRequests; + $this->children = new \SplObjectStorage(); + $this->profiles = array(); + } + + /** + * Handles the onKernelException event. + * + * @param GetResponseForExceptionEvent $event A GetResponseForExceptionEvent instance + */ + public function onKernelException(GetResponseForExceptionEvent $event) + { + if ($this->onlyMasterRequests && HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { + return; + } + + $this->exception = $event->getException(); + } + + public function onKernelRequest(GetResponseEvent $event) + { + $this->requests[] = $event->getRequest(); + } + + /** + * Handles the onKernelResponse event. + * + * @param FilterResponseEvent $event A FilterResponseEvent instance + */ + public function onKernelResponse(FilterResponseEvent $event) + { + $master = HttpKernelInterface::MASTER_REQUEST === $event->getRequestType(); + if ($this->onlyMasterRequests && !$master) { + return; + } + + if ($this->onlyException && null === $this->exception) { + return; + } + + $request = $event->getRequest(); + $exception = $this->exception; + $this->exception = null; + + if (null !== $this->matcher && !$this->matcher->matches($request)) { + return; + } + + if (!$profile = $this->profiler->collect($request, $event->getResponse(), $exception)) { + return; + } + + $this->profiles[] = $profile; + + if (null !== $exception) { + foreach ($this->profiles as $profile) { + $this->profiler->saveProfile($profile); + } + + return; + } + + // keep the profile as the child of its parent + if (!$master) { + array_pop($this->requests); + + $parent = end($this->requests); + + // when simulating requests, we might not have the parent + if ($parent) { + $profiles = isset($this->children[$parent]) ? $this->children[$parent] : array(); + $profiles[] = $profile; + $this->children[$parent] = $profiles; + } + } + + if (isset($this->children[$request])) { + foreach ($this->children[$request] as $child) { + $profile->addChild($child); + } + $this->children[$request] = array(); + } + + if ($master) { + $this->saveProfiles($profile); + + $this->children = new \SplObjectStorage(); + } + } + + public static function getSubscribedEvents() + { + return array( + // kernel.request must be registered as early as possible to not break + // when an exception is thrown in any other kernel.request listener + KernelEvents::REQUEST => array('onKernelRequest', 1024), + KernelEvents::RESPONSE => array('onKernelResponse', -100), + KernelEvents::EXCEPTION => 'onKernelException', + ); + } + + /** + * Saves the profile hierarchy. + * + * @param Profile $profile The root profile + */ + private function saveProfiles(Profile $profile) + { + $this->profiler->saveProfile($profile); + foreach ($profile->getChildren() as $profile) { + $this->saveProfiles($profile); + } + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ResponseListener.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ResponseListener.php new file mode 100644 index 0000000..669980c --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ResponseListener.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\EventListener; + +use Symfony\Component\HttpKernel\Event\FilterResponseEvent; +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * ResponseListener fixes the Response headers based on the Request. + * + * @author Fabien Potencier + */ +class ResponseListener implements EventSubscriberInterface +{ + private $charset; + + public function __construct($charset) + { + $this->charset = $charset; + } + + /** + * Filters the Response. + * + * @param FilterResponseEvent $event A FilterResponseEvent instance + */ + public function onKernelResponse(FilterResponseEvent $event) + { + if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { + return; + } + + $response = $event->getResponse(); + + if (null === $response->getCharset()) { + $response->setCharset($this->charset); + } + + $response->prepare($event->getRequest()); + } + + public static function getSubscribedEvents() + { + return array( + KernelEvents::RESPONSE => 'onKernelResponse', + ); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php new file mode 100644 index 0000000..33d340f --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php @@ -0,0 +1,140 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\EventListener; + +use Psr\Log\LoggerInterface; +use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Routing\Exception\MethodNotAllowedException; +use Symfony\Component\Routing\Exception\ResourceNotFoundException; +use Symfony\Component\Routing\Matcher\UrlMatcherInterface; +use Symfony\Component\Routing\Matcher\RequestMatcherInterface; +use Symfony\Component\Routing\RequestContext; +use Symfony\Component\Routing\RequestContextAwareInterface; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpFoundation\Request; + +/** + * Initializes the context from the request and sets request attributes based on a matching route. + * + * @author Fabien Potencier + */ +class RouterListener implements EventSubscriberInterface +{ + private $matcher; + private $context; + private $logger; + private $request; + + /** + * Constructor. + * + * @param UrlMatcherInterface|RequestMatcherInterface $matcher The Url or Request matcher + * @param RequestContext|null $context The RequestContext (can be null when $matcher implements RequestContextAwareInterface) + * @param LoggerInterface|null $logger The logger + * + * @throws \InvalidArgumentException + */ + public function __construct($matcher, RequestContext $context = null, LoggerInterface $logger = null) + { + if (!$matcher instanceof UrlMatcherInterface && !$matcher instanceof RequestMatcherInterface) { + throw new \InvalidArgumentException('Matcher must either implement UrlMatcherInterface or RequestMatcherInterface.'); + } + + if (null === $context && !$matcher instanceof RequestContextAwareInterface) { + throw new \InvalidArgumentException('You must either pass a RequestContext or the matcher must implement RequestContextAwareInterface.'); + } + + $this->matcher = $matcher; + $this->context = $context ?: $matcher->getContext(); + $this->logger = $logger; + } + + /** + * Sets the current Request. + * + * The application should call this method whenever the Request + * object changes (entering a Request scope for instance, but + * also when leaving a Request scope -- especially when they are + * nested). + * + * @param Request|null $request A Request instance + */ + public function setRequest(Request $request = null) + { + if (null !== $request && $this->request !== $request) { + $this->context->fromRequest($request); + } + $this->request = $request; + } + + public function onKernelRequest(GetResponseEvent $event) + { + $request = $event->getRequest(); + + // initialize the context that is also used by the generator (assuming matcher and generator share the same context instance) + // we call setRequest even if most of the time, it has already been done to keep compatibility + // with frameworks which do not use the Symfony service container + $this->setRequest($request); + + if ($request->attributes->has('_controller')) { + // routing is already done + return; + } + + // add attributes based on the request (routing) + try { + // matching a request is more powerful than matching a URL path + context, so try that first + if ($this->matcher instanceof RequestMatcherInterface) { + $parameters = $this->matcher->matchRequest($request); + } else { + $parameters = $this->matcher->match($request->getPathInfo()); + } + + if (null !== $this->logger) { + $this->logger->info(sprintf('Matched route "%s" (parameters: %s)', $parameters['_route'], $this->parametersToString($parameters))); + } + + $request->attributes->add($parameters); + unset($parameters['_route']); + unset($parameters['_controller']); + $request->attributes->set('_route_params', $parameters); + } catch (ResourceNotFoundException $e) { + $message = sprintf('No route found for "%s %s"', $request->getMethod(), $request->getPathInfo()); + + throw new NotFoundHttpException($message, $e); + } catch (MethodNotAllowedException $e) { + $message = sprintf('No route found for "%s %s": Method Not Allowed (Allow: %s)', $request->getMethod(), $request->getPathInfo(), implode(', ', $e->getAllowedMethods())); + + throw new MethodNotAllowedHttpException($e->getAllowedMethods(), $message, $e); + } + } + + private function parametersToString(array $parameters) + { + $pieces = array(); + foreach ($parameters as $key => $val) { + $pieces[] = sprintf('"%s": "%s"', $key, (is_string($val) ? $val : json_encode($val))); + } + + return implode(', ', $pieces); + } + + public static function getSubscribedEvents() + { + return array( + KernelEvents::REQUEST => array(array('onKernelRequest', 32)), + ); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php new file mode 100644 index 0000000..88505fa --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\EventListener; + +use Symfony\Component\HttpFoundation\StreamedResponse; +use Symfony\Component\HttpKernel\Event\FilterResponseEvent; +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * StreamedResponseListener is responsible for sending the Response + * to the client. + * + * @author Fabien Potencier + */ +class StreamedResponseListener implements EventSubscriberInterface +{ + /** + * Filters the Response. + * + * @param FilterResponseEvent $event A FilterResponseEvent instance + */ + public function onKernelResponse(FilterResponseEvent $event) + { + if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { + return; + } + + $response = $event->getResponse(); + + if ($response instanceof StreamedResponse) { + $response->send(); + } + } + + public static function getSubscribedEvents() + { + return array( + KernelEvents::RESPONSE => array('onKernelResponse', -1024), + ); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/AccessDeniedHttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/AccessDeniedHttpException.php new file mode 100644 index 0000000..79d8639 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/AccessDeniedHttpException.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * AccessDeniedHttpException. + * + * @author Fabien Potencier + * @author Christophe Coevoet + */ +class AccessDeniedHttpException extends HttpException +{ + /** + * Constructor. + * + * @param string $message The internal exception message + * @param \Exception $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct($message = null, \Exception $previous = null, $code = 0) + { + parent::__construct(403, $message, $previous, array(), $code); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/BadRequestHttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/BadRequestHttpException.php new file mode 100644 index 0000000..3f30a43 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/BadRequestHttpException.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * BadRequestHttpException. + * + * @author Ben Ramsey + */ +class BadRequestHttpException extends HttpException +{ + /** + * Constructor. + * + * @param string $message The internal exception message + * @param \Exception $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct($message = null, \Exception $previous = null, $code = 0) + { + parent::__construct(400, $message, $previous, array(), $code); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/ConflictHttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/ConflictHttpException.php new file mode 100644 index 0000000..35f0776 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/ConflictHttpException.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * ConflictHttpException. + * + * @author Ben Ramsey + */ +class ConflictHttpException extends HttpException +{ + /** + * Constructor. + * + * @param string $message The internal exception message + * @param \Exception $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct($message = null, \Exception $previous = null, $code = 0) + { + parent::__construct(409, $message, $previous, array(), $code); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FatalErrorException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FatalErrorException.php new file mode 100644 index 0000000..1f1ef1a --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FatalErrorException.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +use Symfony\Component\Debug\Exception\FatalErrorException as DebugFatalErrorException; + +/** + * Fatal Error Exception. + * + * @author Konstanton Myakshin + * + * @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead. + */ +class FatalErrorException extends DebugFatalErrorException +{ +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FlattenException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FlattenException.php new file mode 100644 index 0000000..0168afc --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FlattenException.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +use Symfony\Component\Debug\Exception\FlattenException as DebugFlattenException; + +/** + * FlattenException wraps a PHP Exception to be able to serialize it. + * + * Basically, this class removes all objects from the trace. + * + * @author Fabien Potencier + * + * @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead. + */ +class FlattenException extends DebugFlattenException +{ +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/GoneHttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/GoneHttpException.php new file mode 100644 index 0000000..219da32 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/GoneHttpException.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * GoneHttpException. + * + * @author Ben Ramsey + */ +class GoneHttpException extends HttpException +{ + /** + * Constructor. + * + * @param string $message The internal exception message + * @param \Exception $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct($message = null, \Exception $previous = null, $code = 0) + { + parent::__construct(410, $message, $previous, array(), $code); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpException.php new file mode 100644 index 0000000..4e1b526 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpException.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * HttpException. + * + * @author Kris Wallsmith + */ +class HttpException extends \RuntimeException implements HttpExceptionInterface +{ + private $statusCode; + private $headers; + + public function __construct($statusCode, $message = null, \Exception $previous = null, array $headers = array(), $code = 0) + { + $this->statusCode = $statusCode; + $this->headers = $headers; + + parent::__construct($message, $code, $previous); + } + + public function getStatusCode() + { + return $this->statusCode; + } + + public function getHeaders() + { + return $this->headers; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpExceptionInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpExceptionInterface.php new file mode 100644 index 0000000..67f0bae --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpExceptionInterface.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * Interface for HTTP error exceptions. + * + * @author Kris Wallsmith + */ +interface HttpExceptionInterface +{ + /** + * Returns the status code. + * + * @return int An HTTP response status code + */ + public function getStatusCode(); + + /** + * Returns response headers. + * + * @return array Response headers + */ + public function getHeaders(); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/LengthRequiredHttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/LengthRequiredHttpException.php new file mode 100644 index 0000000..878388a --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/LengthRequiredHttpException.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * LengthRequiredHttpException. + * + * @author Ben Ramsey + */ +class LengthRequiredHttpException extends HttpException +{ + /** + * Constructor. + * + * @param string $message The internal exception message + * @param \Exception $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct($message = null, \Exception $previous = null, $code = 0) + { + parent::__construct(411, $message, $previous, array(), $code); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php new file mode 100644 index 0000000..78dd26b --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * MethodNotAllowedHttpException. + * + * @author Kris Wallsmith + */ +class MethodNotAllowedHttpException extends HttpException +{ + /** + * Constructor. + * + * @param array $allow An array of allowed methods + * @param string $message The internal exception message + * @param \Exception $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct(array $allow, $message = null, \Exception $previous = null, $code = 0) + { + $headers = array('Allow' => strtoupper(implode(', ', $allow))); + + parent::__construct(405, $message, $previous, $headers, $code); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/NotAcceptableHttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/NotAcceptableHttpException.php new file mode 100644 index 0000000..0985d4a --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/NotAcceptableHttpException.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * NotAcceptableHttpException. + * + * @author Ben Ramsey + */ +class NotAcceptableHttpException extends HttpException +{ + /** + * Constructor. + * + * @param string $message The internal exception message + * @param \Exception $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct($message = null, \Exception $previous = null, $code = 0) + { + parent::__construct(406, $message, $previous, array(), $code); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/NotFoundHttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/NotFoundHttpException.php new file mode 100644 index 0000000..4639e37 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/NotFoundHttpException.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * NotFoundHttpException. + * + * @author Fabien Potencier + */ +class NotFoundHttpException extends HttpException +{ + /** + * Constructor. + * + * @param string $message The internal exception message + * @param \Exception $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct($message = null, \Exception $previous = null, $code = 0) + { + parent::__construct(404, $message, $previous, array(), $code); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/PreconditionFailedHttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/PreconditionFailedHttpException.php new file mode 100644 index 0000000..0dc2174 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/PreconditionFailedHttpException.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * PreconditionFailedHttpException. + * + * @author Ben Ramsey + */ +class PreconditionFailedHttpException extends HttpException +{ + /** + * Constructor. + * + * @param string $message The internal exception message + * @param \Exception $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct($message = null, \Exception $previous = null, $code = 0) + { + parent::__construct(412, $message, $previous, array(), $code); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/PreconditionRequiredHttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/PreconditionRequiredHttpException.php new file mode 100644 index 0000000..fb1494d --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/PreconditionRequiredHttpException.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * PreconditionRequiredHttpException. + * + * @author Ben Ramsey + * @see http://tools.ietf.org/html/rfc6585 + */ +class PreconditionRequiredHttpException extends HttpException +{ + /** + * Constructor. + * + * @param string $message The internal exception message + * @param \Exception $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct($message = null, \Exception $previous = null, $code = 0) + { + parent::__construct(428, $message, $previous, array(), $code); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/ServiceUnavailableHttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/ServiceUnavailableHttpException.php new file mode 100644 index 0000000..dcf4d74 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/ServiceUnavailableHttpException.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * ServiceUnavailableHttpException. + * + * @author Ben Ramsey + */ +class ServiceUnavailableHttpException extends HttpException +{ + /** + * Constructor. + * + * @param int|string $retryAfter The number of seconds or HTTP-date after which the request may be retried + * @param string $message The internal exception message + * @param \Exception $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct($retryAfter = null, $message = null, \Exception $previous = null, $code = 0) + { + $headers = array(); + if ($retryAfter) { + $headers = array('Retry-After' => $retryAfter); + } + + parent::__construct(503, $message, $previous, $headers, $code); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/TooManyRequestsHttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/TooManyRequestsHttpException.php new file mode 100644 index 0000000..22f6dd5 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/TooManyRequestsHttpException.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * TooManyRequestsHttpException. + * + * @author Ben Ramsey + * @see http://tools.ietf.org/html/rfc6585 + */ +class TooManyRequestsHttpException extends HttpException +{ + /** + * Constructor. + * + * @param int|string $retryAfter The number of seconds or HTTP-date after which the request may be retried + * @param string $message The internal exception message + * @param \Exception $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct($retryAfter = null, $message = null, \Exception $previous = null, $code = 0) + { + $headers = array(); + if ($retryAfter) { + $headers = array('Retry-After' => $retryAfter); + } + + parent::__construct(429, $message, $previous, $headers, $code); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/UnauthorizedHttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/UnauthorizedHttpException.php new file mode 100644 index 0000000..0dfe42d --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/UnauthorizedHttpException.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * UnauthorizedHttpException. + * + * @author Ben Ramsey + */ +class UnauthorizedHttpException extends HttpException +{ + /** + * Constructor. + * + * @param string $challenge WWW-Authenticate challenge string + * @param string $message The internal exception message + * @param \Exception $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct($challenge, $message = null, \Exception $previous = null, $code = 0) + { + $headers = array('WWW-Authenticate' => $challenge); + + parent::__construct(401, $message, $previous, $headers, $code); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/UnsupportedMediaTypeHttpException.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/UnsupportedMediaTypeHttpException.php new file mode 100644 index 0000000..b263470 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/UnsupportedMediaTypeHttpException.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * UnsupportedMediaTypeHttpException. + * + * @author Ben Ramsey + */ +class UnsupportedMediaTypeHttpException extends HttpException +{ + /** + * Constructor. + * + * @param string $message The internal exception message + * @param \Exception $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct($message = null, \Exception $previous = null, $code = 0) + { + parent::__construct(415, $message, $previous, array(), $code); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/EsiFragmentRenderer.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/EsiFragmentRenderer.php new file mode 100644 index 0000000..8ff0e6a --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/EsiFragmentRenderer.php @@ -0,0 +1,100 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Fragment; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Controller\ControllerReference; +use Symfony\Component\HttpKernel\HttpCache\Esi; +use Symfony\Component\HttpKernel\UriSigner; + +/** + * Implements the ESI rendering strategy. + * + * @author Fabien Potencier + */ +class EsiFragmentRenderer extends RoutableFragmentRenderer +{ + private $esi; + private $inlineStrategy; + private $signer; + + /** + * Constructor. + * + * The "fallback" strategy when ESI is not available should always be an + * instance of InlineFragmentRenderer. + * + * @param Esi $esi An Esi instance + * @param FragmentRendererInterface $inlineStrategy The inline strategy to use when ESI is not supported + * @param UriSigner $signer + */ + public function __construct(Esi $esi, FragmentRendererInterface $inlineStrategy, UriSigner $signer = null) + { + $this->esi = $esi; + $this->inlineStrategy = $inlineStrategy; + $this->signer = $signer; + } + + /** + * {@inheritdoc} + * + * Note that if the current Request has no ESI capability, this method + * falls back to use the inline rendering strategy. + * + * Additional available options: + * + * * alt: an alternative URI to render in case of an error + * * comment: a comment to add when returning an esi:include tag + * + * @see Symfony\Component\HttpKernel\HttpCache\ESI + */ + public function render($uri, Request $request, array $options = array()) + { + if (!$this->esi->hasSurrogateEsiCapability($request)) { + return $this->inlineStrategy->render($uri, $request, $options); + } + + if ($uri instanceof ControllerReference) { + $uri = $this->generateSignedFragmentUri($uri, $request); + } + + $alt = isset($options['alt']) ? $options['alt'] : null; + if ($alt instanceof ControllerReference) { + $alt = $this->generateSignedFragmentUri($alt, $request); + } + + $tag = $this->esi->renderIncludeTag($uri, $alt, isset($options['ignore_errors']) ? $options['ignore_errors'] : false, isset($options['comment']) ? $options['comment'] : ''); + + return new Response($tag); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'esi'; + } + + private function generateSignedFragmentUri($uri, Request $request) + { + if (null === $this->signer) { + throw new \LogicException('You must use a URI when using the ESI rendering strategy or set a URL signer.'); + } + + // we need to sign the absolute URI, but want to return the path only. + $fragmentUri = $this->signer->sign($this->generateFragmentUri($uri, $request, true)); + + return substr($fragmentUri, strlen($request->getSchemeAndHttpHost())); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php new file mode 100644 index 0000000..6a1654a --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php @@ -0,0 +1,128 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Fragment; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\StreamedResponse; +use Symfony\Component\HttpKernel\Controller\ControllerReference; + +/** + * Renders a URI that represents a resource fragment. + * + * This class handles the rendering of resource fragments that are included into + * a main resource. The handling of the rendering is managed by specialized renderers. + * + * @author Fabien Potencier + * + * @see FragmentRendererInterface + */ +class FragmentHandler +{ + private $debug; + private $renderers; + private $request; + + /** + * Constructor. + * + * @param FragmentRendererInterface[] $renderers An array of FragmentRendererInterface instances + * @param bool $debug Whether the debug mode is enabled or not + */ + public function __construct(array $renderers = array(), $debug = false) + { + $this->renderers = array(); + foreach ($renderers as $renderer) { + $this->addRenderer($renderer); + } + $this->debug = $debug; + } + + /** + * Adds a renderer. + * + * @param FragmentRendererInterface $renderer A FragmentRendererInterface instance + */ + public function addRenderer(FragmentRendererInterface $renderer) + { + $this->renderers[$renderer->getName()] = $renderer; + } + + /** + * Sets the current Request. + * + * @param Request $request The current Request + */ + public function setRequest(Request $request = null) + { + $this->request = $request; + } + + /** + * Renders a URI and returns the Response content. + * + * Available options: + * + * * ignore_errors: true to return an empty string in case of an error + * + * @param string|ControllerReference $uri A URI as a string or a ControllerReference instance + * @param string $renderer The renderer name + * @param array $options An array of options + * + * @return string|null The Response content or null when the Response is streamed + * + * @throws \InvalidArgumentException when the renderer does not exist + * @throws \LogicException when no master request is being handled + * @throws \RuntimeException when the Response is not successful + */ + public function render($uri, $renderer = 'inline', array $options = array()) + { + if (!isset($options['ignore_errors'])) { + $options['ignore_errors'] = !$this->debug; + } + + if (!isset($this->renderers[$renderer])) { + throw new \InvalidArgumentException(sprintf('The "%s" renderer does not exist.', $renderer)); + } + + if (null === $this->request) { + throw new \LogicException('Rendering a fragment can only be done when handling a master Request.'); + } + + return $this->deliver($this->renderers[$renderer]->render($uri, $this->request, $options)); + } + + /** + * Delivers the Response as a string. + * + * When the Response is a StreamedResponse, the content is streamed immediately + * instead of being returned. + * + * @param Response $response A Response instance + * + * @return string|null The Response content or null when the Response is streamed + * + * @throws \RuntimeException when the Response is not successful + */ + protected function deliver(Response $response) + { + if (!$response->isSuccessful()) { + throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $this->request->getUri(), $response->getStatusCode())); + } + + if (!$response instanceof StreamedResponse) { + return $response->getContent(); + } + + $response->sendContent(); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentRendererInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentRendererInterface.php new file mode 100644 index 0000000..ae172df --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentRendererInterface.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Fragment; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpKernel\Controller\ControllerReference; +use Symfony\Component\HttpFoundation\Response; + +/** + * Interface implemented by all rendering strategies. + * + * @author Fabien Potencier + * + * @see Symfony\Component\HttpKernel\FragmentRenderer + */ +interface FragmentRendererInterface +{ + /** + * Renders a URI and returns the Response content. + * + * @param string|ControllerReference $uri A URI as a string or a ControllerReference instance + * @param Request $request A Request instance + * @param array $options An array of options + * + * @return Response A Response instance + */ + public function render($uri, Request $request, array $options = array()); + + /** + * Gets the name of the strategy. + * + * @return string The strategy name + */ + public function getName(); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php new file mode 100644 index 0000000..e9bece0 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php @@ -0,0 +1,163 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Fragment; + +if (!defined('ENT_SUBSTITUTE')) { + define('ENT_SUBSTITUTE', 8); +} + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Templating\EngineInterface; +use Symfony\Component\HttpKernel\Controller\ControllerReference; +use Symfony\Component\HttpKernel\UriSigner; + +/** + * Implements the Hinclude rendering strategy. + * + * @author Fabien Potencier + */ +class HIncludeFragmentRenderer extends RoutableFragmentRenderer +{ + private $globalDefaultTemplate; + private $signer; + private $templating; + private $charset; + + /** + * Constructor. + * + * @param EngineInterface|\Twig_Environment $templating An EngineInterface or a \Twig_Environment instance + * @param UriSigner $signer A UriSigner instance + * @param string $globalDefaultTemplate The global default content (it can be a template name or the content) + * @param string $charset + */ + public function __construct($templating = null, UriSigner $signer = null, $globalDefaultTemplate = null, $charset = 'utf-8') + { + $this->setTemplating($templating); + $this->globalDefaultTemplate = $globalDefaultTemplate; + $this->signer = $signer; + $this->charset = $charset; + } + + /** + * Sets the templating engine to use to render the default content. + * + * @param EngineInterface|\Twig_Environment|null $templating An EngineInterface or a \Twig_Environment instance + * + * @throws \InvalidArgumentException + */ + public function setTemplating($templating) + { + if (null !== $templating && !$templating instanceof EngineInterface && !$templating instanceof \Twig_Environment) { + throw new \InvalidArgumentException('The hinclude rendering strategy needs an instance of \Twig_Environment or Symfony\Component\Templating\EngineInterface'); + } + + $this->templating = $templating; + } + + /** + * Checks if a templating engine has been set. + * + * @return bool true if the templating engine has been set, false otherwise + */ + public function hasTemplating() + { + return null !== $this->templating; + } + + /** + * {@inheritdoc} + * + * Additional available options: + * + * * default: The default content (it can be a template name or the content) + * * id: An optional hx:include tag id attribute + * * attributes: An optional array of hx:include tag attributes + */ + public function render($uri, Request $request, array $options = array()) + { + if ($uri instanceof ControllerReference) { + if (null === $this->signer) { + throw new \LogicException('You must use a proper URI when using the Hinclude rendering strategy or set a URL signer.'); + } + + // we need to sign the absolute URI, but want to return the path only. + $uri = substr($this->signer->sign($this->generateFragmentUri($uri, $request, true)), strlen($request->getSchemeAndHttpHost())); + } + + // We need to replace ampersands in the URI with the encoded form in order to return valid html/xml content. + $uri = str_replace('&', '&', $uri); + + $template = isset($options['default']) ? $options['default'] : $this->globalDefaultTemplate; + if (null !== $this->templating && $template && $this->templateExists($template)) { + $content = $this->templating->render($template); + } else { + $content = $template; + } + + $attributes = isset($options['attributes']) && is_array($options['attributes']) ? $options['attributes'] : array(); + if (isset($options['id']) && $options['id']) { + $attributes['id'] = $options['id']; + } + $renderedAttributes = ''; + if (count($attributes) > 0) { + foreach ($attributes as $attribute => $value) { + $renderedAttributes .= sprintf( + ' %s="%s"', + htmlspecialchars($attribute, ENT_QUOTES | ENT_SUBSTITUTE, $this->charset, false), + htmlspecialchars($value, ENT_QUOTES | ENT_SUBSTITUTE, $this->charset, false) + ); + } + } + + return new Response(sprintf('%s', $uri, $renderedAttributes, $content)); + } + + /** + * @param string $template + * + * @return bool + */ + private function templateExists($template) + { + if ($this->templating instanceof EngineInterface) { + try { + return $this->templating->exists($template); + } catch (\InvalidArgumentException $e) { + return false; + } + } + + $loader = $this->templating->getLoader(); + if ($loader instanceof \Twig_ExistsLoaderInterface) { + return $loader->exists($template); + } + + try { + $loader->getSource($template); + + return true; + } catch (\Twig_Error_Loader $e) { + } + + return false; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'hinclude'; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php new file mode 100644 index 0000000..be0e37d --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php @@ -0,0 +1,153 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Fragment; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpKernel\Controller\ControllerReference; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; + +/** + * Implements the inline rendering strategy where the Request is rendered by the current HTTP kernel. + * + * @author Fabien Potencier + */ +class InlineFragmentRenderer extends RoutableFragmentRenderer +{ + private $kernel; + private $dispatcher; + + /** + * Constructor. + * + * @param HttpKernelInterface $kernel A HttpKernelInterface instance + * @param EventDispatcherInterface|null $dispatcher A EventDispatcherInterface instance + */ + public function __construct(HttpKernelInterface $kernel, EventDispatcherInterface $dispatcher = null) + { + $this->kernel = $kernel; + $this->dispatcher = $dispatcher; + } + + /** + * {@inheritdoc} + * + * Additional available options: + * + * * alt: an alternative URI to render in case of an error + */ + public function render($uri, Request $request, array $options = array()) + { + $reference = null; + if ($uri instanceof ControllerReference) { + $reference = $uri; + + // Remove attributes from the generated URI because if not, the Symfony + // routing system will use them to populate the Request attributes. We don't + // want that as we want to preserve objects (so we manually set Request attributes + // below instead) + $attributes = $reference->attributes; + $reference->attributes = array(); + + // The request format and locale might have been overriden by the user + foreach (array('_format', '_locale') as $key) { + if (isset($attributes[$key])) { + $reference->attributes[$key] = $attributes[$key]; + } + } + + $uri = $this->generateFragmentUri($uri, $request); + $reference->attributes = array_merge($attributes, $reference->attributes); + } + + $subRequest = $this->createSubRequest($uri, $request); + + // override Request attributes as they can be objects (which are not supported by the generated URI) + if (null !== $reference) { + $subRequest->attributes->add($reference->attributes); + } + + $level = ob_get_level(); + try { + return $this->kernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST, false); + } catch (\Exception $e) { + // we dispatch the exception event to trigger the logging + // the response that comes back is simply ignored + if (isset($options['ignore_errors']) && $options['ignore_errors'] && $this->dispatcher) { + $event = new GetResponseForExceptionEvent($this->kernel, $request, HttpKernelInterface::SUB_REQUEST, $e); + + $this->dispatcher->dispatch(KernelEvents::EXCEPTION, $event); + } + + // let's clean up the output buffers that were created by the sub-request + while (ob_get_level() > $level) { + ob_get_clean(); + } + + if (isset($options['alt'])) { + $alt = $options['alt']; + unset($options['alt']); + + return $this->render($alt, $request, $options); + } + + if (!isset($options['ignore_errors']) || !$options['ignore_errors']) { + throw $e; + } + + return new Response(); + } + } + + protected function createSubRequest($uri, Request $request) + { + $cookies = $request->cookies->all(); + $server = $request->server->all(); + + // Override the arguments to emulate a sub-request. + // Sub-request object will point to localhost as client ip and real client ip + // will be included into trusted header for client ip + try { + if ($trustedHeaderName = Request::getTrustedHeaderName(Request::HEADER_CLIENT_IP)) { + $currentXForwardedFor = $request->headers->get($trustedHeaderName, ''); + + $server['HTTP_'.$trustedHeaderName] = ($currentXForwardedFor ? $currentXForwardedFor.', ' : '').$request->getClientIp(); + } + } catch (\InvalidArgumentException $e) { + // Do nothing + } + + $server['REMOTE_ADDR'] = '127.0.0.1'; + + $subRequest = $request::create($uri, 'get', array(), $cookies, array(), $server); + if ($request->headers->has('Surrogate-Capability')) { + $subRequest->headers->set('Surrogate-Capability', $request->headers->get('Surrogate-Capability')); + } + + if ($session = $request->getSession()) { + $subRequest->setSession($session); + } + + return $subRequest; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'inline'; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php new file mode 100644 index 0000000..f3163e1 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php @@ -0,0 +1,74 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Fragment; + +use Symfony\Component\HttpKernel\Controller\ControllerReference; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpKernel\EventListener\FragmentListener; + +/** + * Adds the possibility to generate a fragment URI for a given Controller. + * + * @author Fabien Potencier + */ +abstract class RoutableFragmentRenderer implements FragmentRendererInterface +{ + private $fragmentPath = '/_fragment'; + + /** + * Sets the fragment path that triggers the fragment listener. + * + * @param string $path The path + * + * @see FragmentListener + */ + public function setFragmentPath($path) + { + $this->fragmentPath = $path; + } + + /** + * Generates a fragment URI for a given controller. + * + * @param ControllerReference $reference A ControllerReference instance + * @param Request $request A Request instance + * @param bool $absolute Whether to generate an absolute URL or not + * + * @return string A fragment URI + */ + protected function generateFragmentUri(ControllerReference $reference, Request $request, $absolute = false) + { + // We need to forward the current _format and _locale values as we don't have + // a proper routing pattern to do the job for us. + // This makes things inconsistent if you switch from rendering a controller + // to rendering a route if the route pattern does not contain the special + // _format and _locale placeholders. + if (!isset($reference->attributes['_format'])) { + $reference->attributes['_format'] = $request->getRequestFormat(); + } + if (!isset($reference->attributes['_locale'])) { + $reference->attributes['_locale'] = $request->getLocale(); + } + + $reference->attributes['_controller'] = $reference->controller; + + $reference->query['_path'] = http_build_query($reference->attributes, '', '&'); + + $path = $this->fragmentPath.'?'.http_build_query($reference->query, '', '&'); + + if ($absolute) { + return $request->getUriForPath($path); + } + + return $request->getBaseUrl().$path; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Esi.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Esi.php new file mode 100644 index 0000000..9dd99d6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Esi.php @@ -0,0 +1,245 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\HttpCache; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\HttpKernelInterface; + +/** + * Esi implements the ESI capabilities to Request and Response instances. + * + * For more information, read the following W3C notes: + * + * * ESI Language Specification 1.0 (http://www.w3.org/TR/esi-lang) + * + * * Edge Architecture Specification (http://www.w3.org/TR/edge-arch) + * + * @author Fabien Potencier + */ +class Esi +{ + private $contentTypes; + + /** + * Constructor. + * + * @param array $contentTypes An array of content-type that should be parsed for ESI information. + * (default: text/html, text/xml, application/xhtml+xml, and application/xml) + */ + public function __construct(array $contentTypes = array('text/html', 'text/xml', 'application/xhtml+xml', 'application/xml')) + { + $this->contentTypes = $contentTypes; + } + + /** + * Returns a new cache strategy instance. + * + * @return EsiResponseCacheStrategyInterface A EsiResponseCacheStrategyInterface instance + */ + public function createCacheStrategy() + { + return new EsiResponseCacheStrategy(); + } + + /** + * Checks that at least one surrogate has ESI/1.0 capability. + * + * @param Request $request A Request instance + * + * @return bool true if one surrogate has ESI/1.0 capability, false otherwise + */ + public function hasSurrogateEsiCapability(Request $request) + { + if (null === $value = $request->headers->get('Surrogate-Capability')) { + return false; + } + + return false !== strpos($value, 'ESI/1.0'); + } + + /** + * Adds ESI/1.0 capability to the given Request. + * + * @param Request $request A Request instance + */ + public function addSurrogateEsiCapability(Request $request) + { + $current = $request->headers->get('Surrogate-Capability'); + $new = 'symfony2="ESI/1.0"'; + + $request->headers->set('Surrogate-Capability', $current ? $current.', '.$new : $new); + } + + /** + * Adds HTTP headers to specify that the Response needs to be parsed for ESI. + * + * This method only adds an ESI HTTP header if the Response has some ESI tags. + * + * @param Response $response A Response instance + */ + public function addSurrogateControl(Response $response) + { + if (false !== strpos($response->getContent(), 'headers->set('Surrogate-Control', 'content="ESI/1.0"'); + } + } + + /** + * Checks that the Response needs to be parsed for ESI tags. + * + * @param Response $response A Response instance + * + * @return bool true if the Response needs to be parsed, false otherwise + */ + public function needsEsiParsing(Response $response) + { + if (!$control = $response->headers->get('Surrogate-Control')) { + return false; + } + + return (bool) preg_match('#content="[^"]*ESI/1.0[^"]*"#', $control); + } + + /** + * Renders an ESI tag. + * + * @param string $uri A URI + * @param string $alt An alternate URI + * @param bool $ignoreErrors Whether to ignore errors or not + * @param string $comment A comment to add as an esi:include tag + * + * @return string + */ + public function renderIncludeTag($uri, $alt = null, $ignoreErrors = true, $comment = '') + { + $html = sprintf('', + $uri, + $ignoreErrors ? ' onerror="continue"' : '', + $alt ? sprintf(' alt="%s"', $alt) : '' + ); + + if (!empty($comment)) { + return sprintf("\n%s", $comment, $html); + } + + return $html; + } + + /** + * Replaces a Response ESI tags with the included resource content. + * + * @param Request $request A Request instance + * @param Response $response A Response instance + * + * @return Response + */ + public function process(Request $request, Response $response) + { + $this->request = $request; + $type = $response->headers->get('Content-Type'); + if (empty($type)) { + $type = 'text/html'; + } + + $parts = explode(';', $type); + if (!in_array($parts[0], $this->contentTypes)) { + return $response; + } + + // we don't use a proper XML parser here as we can have ESI tags in a plain text response + $content = $response->getContent(); + $content = str_replace(array('', ''), $content); + $content = preg_replace_callback('##', array($this, 'handleEsiIncludeTag'), $content); + $content = preg_replace('#]*(?:/|#', '', $content); + $content = preg_replace('#.*?#', '', $content); + + $response->setContent($content); + $response->headers->set('X-Body-Eval', 'ESI'); + + // remove ESI/1.0 from the Surrogate-Control header + if ($response->headers->has('Surrogate-Control')) { + $value = $response->headers->get('Surrogate-Control'); + if ('content="ESI/1.0"' == $value) { + $response->headers->remove('Surrogate-Control'); + } elseif (preg_match('#,\s*content="ESI/1.0"#', $value)) { + $response->headers->set('Surrogate-Control', preg_replace('#,\s*content="ESI/1.0"#', '', $value)); + } elseif (preg_match('#content="ESI/1.0",\s*#', $value)) { + $response->headers->set('Surrogate-Control', preg_replace('#content="ESI/1.0",\s*#', '', $value)); + } + } + } + + /** + * Handles an ESI from the cache. + * + * @param HttpCache $cache An HttpCache instance + * @param string $uri The main URI + * @param string $alt An alternative URI + * @param bool $ignoreErrors Whether to ignore errors or not + * + * @return string + * + * @throws \RuntimeException + * @throws \Exception + */ + public function handle(HttpCache $cache, $uri, $alt, $ignoreErrors) + { + $subRequest = Request::create($uri, 'get', array(), $cache->getRequest()->cookies->all(), array(), $cache->getRequest()->server->all()); + + try { + $response = $cache->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true); + + if (!$response->isSuccessful()) { + throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $subRequest->getUri(), $response->getStatusCode())); + } + + return $response->getContent(); + } catch (\Exception $e) { + if ($alt) { + return $this->handle($cache, $alt, '', $ignoreErrors); + } + + if (!$ignoreErrors) { + throw $e; + } + } + } + + /** + * Handles an ESI include tag (called internally). + * + * @param array $attributes An array containing the attributes. + * + * @return string The response content for the include. + * + * @throws \RuntimeException + */ + private function handleEsiIncludeTag($attributes) + { + $options = array(); + preg_match_all('/(src|onerror|alt)="([^"]*?)"/', $attributes[1], $matches, PREG_SET_ORDER); + foreach ($matches as $set) { + $options[$set[1]] = $set[2]; + } + + if (!isset($options['src'])) { + throw new \RuntimeException('Unable to process an ESI tag without a "src" attribute.'); + } + + return sprintf('esi->handle($this, %s, %s, %s) ?>'."\n", + var_export($options['src'], true), + var_export(isset($options['alt']) ? $options['alt'] : '', true), + isset($options['onerror']) && 'continue' == $options['onerror'] ? 'true' : 'false' + ); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php new file mode 100644 index 0000000..6384af9 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php @@ -0,0 +1,85 @@ + + * + * This code is partially based on the Rack-Cache library by Ryan Tomayko, + * which is released under the MIT license. + * (based on commit 02d2b48d75bcb63cf1c0c7149c077ad256542801) + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\HttpCache; + +use Symfony\Component\HttpFoundation\Response; + +/** + * EsiResponseCacheStrategy knows how to compute the Response cache HTTP header + * based on the different ESI response cache headers. + * + * This implementation changes the master response TTL to the smallest TTL received + * or force validation if one of the ESI has validation cache strategy. + * + * @author Fabien Potencier + */ +class EsiResponseCacheStrategy implements EsiResponseCacheStrategyInterface +{ + private $cacheable = true; + private $embeddedResponses = 0; + private $ttls = array(); + private $maxAges = array(); + + /** + * {@inheritdoc} + */ + public function add(Response $response) + { + if ($response->isValidateable()) { + $this->cacheable = false; + } else { + $this->ttls[] = $response->getTtl(); + $this->maxAges[] = $response->getMaxAge(); + } + + $this->embeddedResponses++; + } + + /** + * {@inheritdoc} + */ + public function update(Response $response) + { + // if we have no embedded Response, do nothing + if (0 === $this->embeddedResponses) { + return; + } + + // Remove validation related headers in order to avoid browsers using + // their own cache, because some of the response content comes from + // at least one embedded response (which likely has a different caching strategy). + if ($response->isValidateable()) { + $response->setEtag(null); + $response->setLastModified(null); + $this->cacheable = false; + } + + if (!$this->cacheable) { + $response->headers->set('Cache-Control', 'no-cache, must-revalidate'); + + return; + } + + $this->ttls[] = $response->getTtl(); + $this->maxAges[] = $response->getMaxAge(); + + if (null !== $maxAge = min($this->maxAges)) { + $response->setSharedMaxAge($maxAge); + $response->headers->set('Age', $maxAge - min($this->ttls)); + } + $response->setMaxAge(0); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategyInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategyInterface.php new file mode 100644 index 0000000..0fb8a12 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategyInterface.php @@ -0,0 +1,41 @@ + + * + * This code is partially based on the Rack-Cache library by Ryan Tomayko, + * which is released under the MIT license. + * (based on commit 02d2b48d75bcb63cf1c0c7149c077ad256542801) + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\HttpCache; + +use Symfony\Component\HttpFoundation\Response; + +/** + * EsiResponseCacheStrategyInterface implementations know how to compute the + * Response cache HTTP header based on the different ESI response cache headers. + * + * @author Fabien Potencier + */ +interface EsiResponseCacheStrategyInterface +{ + /** + * Adds a Response. + * + * @param Response $response + */ + public function add(Response $response); + + /** + * Updates the Response HTTP headers based on the embedded Responses. + * + * @param Response $response + */ + public function update(Response $response); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php new file mode 100644 index 0000000..dfdcb9c --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -0,0 +1,690 @@ + + * + * This code is partially based on the Rack-Cache library by Ryan Tomayko, + * which is released under the MIT license. + * (based on commit 02d2b48d75bcb63cf1c0c7149c077ad256542801) + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\HttpCache; + +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpKernel\TerminableInterface; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * Cache provides HTTP caching. + * + * @author Fabien Potencier + * + * @api + */ +class HttpCache implements HttpKernelInterface, TerminableInterface +{ + private $kernel; + private $store; + private $request; + private $esi; + private $esiCacheStrategy; + private $traces; + + /** + * Constructor. + * + * The available options are: + * + * * debug: If true, the traces are added as a HTTP header to ease debugging + * + * * default_ttl The number of seconds that a cache entry should be considered + * fresh when no explicit freshness information is provided in + * a response. Explicit Cache-Control or Expires headers + * override this value. (default: 0) + * + * * private_headers Set of request headers that trigger "private" cache-control behavior + * on responses that don't explicitly state whether the response is + * public or private via a Cache-Control directive. (default: Authorization and Cookie) + * + * * allow_reload Specifies whether the client can force a cache reload by including a + * Cache-Control "no-cache" directive in the request. Set it to ``true`` + * for compliance with RFC 2616. (default: false) + * + * * allow_revalidate Specifies whether the client can force a cache revalidate by including + * a Cache-Control "max-age=0" directive in the request. Set it to ``true`` + * for compliance with RFC 2616. (default: false) + * + * * stale_while_revalidate Specifies the default number of seconds (the granularity is the second as the + * Response TTL precision is a second) during which the cache can immediately return + * a stale response while it revalidates it in the background (default: 2). + * This setting is overridden by the stale-while-revalidate HTTP Cache-Control + * extension (see RFC 5861). + * + * * stale_if_error Specifies the default number of seconds (the granularity is the second) during which + * the cache can serve a stale response when an error is encountered (default: 60). + * This setting is overridden by the stale-if-error HTTP Cache-Control extension + * (see RFC 5861). + * + * @param HttpKernelInterface $kernel An HttpKernelInterface instance + * @param StoreInterface $store A Store instance + * @param Esi $esi An Esi instance + * @param array $options An array of options + */ + public function __construct(HttpKernelInterface $kernel, StoreInterface $store, Esi $esi = null, array $options = array()) + { + $this->store = $store; + $this->kernel = $kernel; + + // needed in case there is a fatal error because the backend is too slow to respond + register_shutdown_function(array($this->store, 'cleanup')); + + $this->options = array_merge(array( + 'debug' => false, + 'default_ttl' => 0, + 'private_headers' => array('Authorization', 'Cookie'), + 'allow_reload' => false, + 'allow_revalidate' => false, + 'stale_while_revalidate' => 2, + 'stale_if_error' => 60, + ), $options); + $this->esi = $esi; + $this->traces = array(); + } + + /** + * Gets the current store. + * + * @return StoreInterface $store A StoreInterface instance + */ + public function getStore() + { + return $this->store; + } + + /** + * Returns an array of events that took place during processing of the last request. + * + * @return array An array of events + */ + public function getTraces() + { + return $this->traces; + } + + /** + * Returns a log message for the events of the last request processing. + * + * @return string A log message + */ + public function getLog() + { + $log = array(); + foreach ($this->traces as $request => $traces) { + $log[] = sprintf('%s: %s', $request, implode(', ', $traces)); + } + + return implode('; ', $log); + } + + /** + * Gets the Request instance associated with the master request. + * + * @return Request A Request instance + */ + public function getRequest() + { + return $this->request; + } + + /** + * Gets the Kernel instance + * + * @return HttpKernelInterface An HttpKernelInterface instance + */ + public function getKernel() + { + return $this->kernel; + } + + /** + * Gets the Esi instance + * + * @return Esi An Esi instance + */ + public function getEsi() + { + return $this->esi; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) + { + // FIXME: catch exceptions and implement a 500 error page here? -> in Varnish, there is a built-in error page mechanism + if (HttpKernelInterface::MASTER_REQUEST === $type) { + $this->traces = array(); + $this->request = $request; + if (null !== $this->esi) { + $this->esiCacheStrategy = $this->esi->createCacheStrategy(); + } + } + + $path = $request->getPathInfo(); + if ($qs = $request->getQueryString()) { + $path .= '?'.$qs; + } + $this->traces[$request->getMethod().' '.$path] = array(); + + if (!$request->isMethodSafe()) { + $response = $this->invalidate($request, $catch); + } elseif ($request->headers->has('expect')) { + $response = $this->pass($request, $catch); + } else { + $response = $this->lookup($request, $catch); + } + + $this->restoreResponseBody($request, $response); + + $response->setDate(new \DateTime(null, new \DateTimeZone('UTC'))); + + if (HttpKernelInterface::MASTER_REQUEST === $type && $this->options['debug']) { + $response->headers->set('X-Symfony-Cache', $this->getLog()); + } + + if (null !== $this->esi) { + if (HttpKernelInterface::MASTER_REQUEST === $type) { + $this->esiCacheStrategy->update($response); + } else { + $this->esiCacheStrategy->add($response); + } + } + + $response->prepare($request); + + $response->isNotModified($request); + + return $response; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function terminate(Request $request, Response $response) + { + if ($this->getKernel() instanceof TerminableInterface) { + $this->getKernel()->terminate($request, $response); + } + } + + /** + * Forwards the Request to the backend without storing the Response in the cache. + * + * @param Request $request A Request instance + * @param bool $catch Whether to process exceptions + * + * @return Response A Response instance + */ + protected function pass(Request $request, $catch = false) + { + $this->record($request, 'pass'); + + return $this->forward($request, $catch); + } + + /** + * Invalidates non-safe methods (like POST, PUT, and DELETE). + * + * @param Request $request A Request instance + * @param bool $catch Whether to process exceptions + * + * @return Response A Response instance + * + * @throws \Exception + * + * @see RFC2616 13.10 + */ + protected function invalidate(Request $request, $catch = false) + { + $response = $this->pass($request, $catch); + + // invalidate only when the response is successful + if ($response->isSuccessful() || $response->isRedirect()) { + try { + $this->store->invalidate($request, $catch); + + // As per the RFC, invalidate Location and Content-Location URLs if present + foreach (array('Location', 'Content-Location') as $header) { + if ($uri = $response->headers->get($header)) { + $subRequest = $request::create($uri, 'get', array(), array(), array(), $request->server->all()); + + $this->store->invalidate($subRequest); + } + } + + $this->record($request, 'invalidate'); + } catch (\Exception $e) { + $this->record($request, 'invalidate-failed'); + + if ($this->options['debug']) { + throw $e; + } + } + } + + return $response; + } + + /** + * Lookups a Response from the cache for the given Request. + * + * When a matching cache entry is found and is fresh, it uses it as the + * response without forwarding any request to the backend. When a matching + * cache entry is found but is stale, it attempts to "validate" the entry with + * the backend using conditional GET. When no matching cache entry is found, + * it triggers "miss" processing. + * + * @param Request $request A Request instance + * @param bool $catch whether to process exceptions + * + * @return Response A Response instance + * + * @throws \Exception + */ + protected function lookup(Request $request, $catch = false) + { + // if allow_reload and no-cache Cache-Control, allow a cache reload + if ($this->options['allow_reload'] && $request->isNoCache()) { + $this->record($request, 'reload'); + + return $this->fetch($request, $catch); + } + + try { + $entry = $this->store->lookup($request); + } catch (\Exception $e) { + $this->record($request, 'lookup-failed'); + + if ($this->options['debug']) { + throw $e; + } + + return $this->pass($request, $catch); + } + + if (null === $entry) { + $this->record($request, 'miss'); + + return $this->fetch($request, $catch); + } + + if (!$this->isFreshEnough($request, $entry)) { + $this->record($request, 'stale'); + + return $this->validate($request, $entry, $catch); + } + + $this->record($request, 'fresh'); + + $entry->headers->set('Age', $entry->getAge()); + + return $entry; + } + + /** + * Validates that a cache entry is fresh. + * + * The original request is used as a template for a conditional + * GET request with the backend. + * + * @param Request $request A Request instance + * @param Response $entry A Response instance to validate + * @param bool $catch Whether to process exceptions + * + * @return Response A Response instance + */ + protected function validate(Request $request, Response $entry, $catch = false) + { + $subRequest = clone $request; + + // send no head requests because we want content + $subRequest->setMethod('GET'); + + // add our cached last-modified validator + $subRequest->headers->set('if_modified_since', $entry->headers->get('Last-Modified')); + + // Add our cached etag validator to the environment. + // We keep the etags from the client to handle the case when the client + // has a different private valid entry which is not cached here. + $cachedEtags = $entry->getEtag() ? array($entry->getEtag()) : array(); + $requestEtags = $request->getEtags(); + if ($etags = array_unique(array_merge($cachedEtags, $requestEtags))) { + $subRequest->headers->set('if_none_match', implode(', ', $etags)); + } + + $response = $this->forward($subRequest, $catch, $entry); + + if (304 == $response->getStatusCode()) { + $this->record($request, 'valid'); + + // return the response and not the cache entry if the response is valid but not cached + $etag = $response->getEtag(); + if ($etag && in_array($etag, $requestEtags) && !in_array($etag, $cachedEtags)) { + return $response; + } + + $entry = clone $entry; + $entry->headers->remove('Date'); + + foreach (array('Date', 'Expires', 'Cache-Control', 'ETag', 'Last-Modified') as $name) { + if ($response->headers->has($name)) { + $entry->headers->set($name, $response->headers->get($name)); + } + } + + $response = $entry; + } else { + $this->record($request, 'invalid'); + } + + if ($response->isCacheable()) { + $this->store($request, $response); + } + + return $response; + } + + /** + * Forwards the Request to the backend and determines whether the response should be stored. + * + * This methods is triggered when the cache missed or a reload is required. + * + * @param Request $request A Request instance + * @param bool $catch whether to process exceptions + * + * @return Response A Response instance + */ + protected function fetch(Request $request, $catch = false) + { + $subRequest = clone $request; + + // send no head requests because we want content + $subRequest->setMethod('GET'); + + // avoid that the backend sends no content + $subRequest->headers->remove('if_modified_since'); + $subRequest->headers->remove('if_none_match'); + + $response = $this->forward($subRequest, $catch); + + if ($response->isCacheable()) { + $this->store($request, $response); + } + + return $response; + } + + /** + * Forwards the Request to the backend and returns the Response. + * + * @param Request $request A Request instance + * @param bool $catch Whether to catch exceptions or not + * @param Response $entry A Response instance (the stale entry if present, null otherwise) + * + * @return Response A Response instance + */ + protected function forward(Request $request, $catch = false, Response $entry = null) + { + if ($this->esi) { + $this->esi->addSurrogateEsiCapability($request); + } + + // modify the X-Forwarded-For header if needed + $forwardedFor = $request->headers->get('X-Forwarded-For'); + if ($forwardedFor) { + $request->headers->set('X-Forwarded-For', $forwardedFor.', '.$request->server->get('REMOTE_ADDR')); + } else { + $request->headers->set('X-Forwarded-For', $request->server->get('REMOTE_ADDR')); + } + + // fix the client IP address by setting it to 127.0.0.1 as HttpCache + // is always called from the same process as the backend. + $request->server->set('REMOTE_ADDR', '127.0.0.1'); + + // make sure HttpCache is a trusted proxy + if (!in_array('127.0.0.1', $trustedProxies = Request::getTrustedProxies())) { + $trustedProxies[] = '127.0.0.1'; + Request::setTrustedProxies($trustedProxies); + } + + // always a "master" request (as the real master request can be in cache) + $response = $this->kernel->handle($request, HttpKernelInterface::MASTER_REQUEST, $catch); + // FIXME: we probably need to also catch exceptions if raw === true + + // we don't implement the stale-if-error on Requests, which is nonetheless part of the RFC + if (null !== $entry && in_array($response->getStatusCode(), array(500, 502, 503, 504))) { + if (null === $age = $entry->headers->getCacheControlDirective('stale-if-error')) { + $age = $this->options['stale_if_error']; + } + + if (abs($entry->getTtl()) < $age) { + $this->record($request, 'stale-if-error'); + + return $entry; + } + } + + $this->processResponseBody($request, $response); + + if ($this->isPrivateRequest($request) && !$response->headers->hasCacheControlDirective('public')) { + $response->setPrivate(true); + } elseif ($this->options['default_ttl'] > 0 && null === $response->getTtl() && !$response->headers->getCacheControlDirective('must-revalidate')) { + $response->setTtl($this->options['default_ttl']); + } + + return $response; + } + + /** + * Checks whether the cache entry is "fresh enough" to satisfy the Request. + * + * @param Request $request A Request instance + * @param Response $entry A Response instance + * + * @return bool true if the cache entry if fresh enough, false otherwise + */ + protected function isFreshEnough(Request $request, Response $entry) + { + if (!$entry->isFresh()) { + return $this->lock($request, $entry); + } + + if ($this->options['allow_revalidate'] && null !== $maxAge = $request->headers->getCacheControlDirective('max-age')) { + return $maxAge > 0 && $maxAge >= $entry->getAge(); + } + + return true; + } + + /** + * Locks a Request during the call to the backend. + * + * @param Request $request A Request instance + * @param Response $entry A Response instance + * + * @return bool true if the cache entry can be returned even if it is staled, false otherwise + */ + protected function lock(Request $request, Response $entry) + { + // try to acquire a lock to call the backend + $lock = $this->store->lock($request); + + // there is already another process calling the backend + if (true !== $lock) { + // check if we can serve the stale entry + if (null === $age = $entry->headers->getCacheControlDirective('stale-while-revalidate')) { + $age = $this->options['stale_while_revalidate']; + } + + if (abs($entry->getTtl()) < $age) { + $this->record($request, 'stale-while-revalidate'); + + // server the stale response while there is a revalidation + return true; + } + + // wait for the lock to be released + $wait = 0; + while ($this->store->isLocked($request) && $wait < 5000000) { + usleep(50000); + $wait += 50000; + } + + if ($wait < 2000000) { + // replace the current entry with the fresh one + $new = $this->lookup($request); + $entry->headers = $new->headers; + $entry->setContent($new->getContent()); + $entry->setStatusCode($new->getStatusCode()); + $entry->setProtocolVersion($new->getProtocolVersion()); + foreach ($new->headers->getCookies() as $cookie) { + $entry->headers->setCookie($cookie); + } + } else { + // backend is slow as hell, send a 503 response (to avoid the dog pile effect) + $entry->setStatusCode(503); + $entry->setContent('503 Service Unavailable'); + $entry->headers->set('Retry-After', 10); + } + + return true; + } + + // we have the lock, call the backend + return false; + } + + /** + * Writes the Response to the cache. + * + * @param Request $request A Request instance + * @param Response $response A Response instance + * + * @throws \Exception + */ + protected function store(Request $request, Response $response) + { + try { + $this->store->write($request, $response); + + $this->record($request, 'store'); + + $response->headers->set('Age', $response->getAge()); + } catch (\Exception $e) { + $this->record($request, 'store-failed'); + + if ($this->options['debug']) { + throw $e; + } + } + + // now that the response is cached, release the lock + $this->store->unlock($request); + } + + /** + * Restores the Response body. + * + * @param Request $request A Request instance + * @param Response $response A Response instance + */ + private function restoreResponseBody(Request $request, Response $response) + { + if ($request->isMethod('HEAD') || 304 === $response->getStatusCode()) { + $response->setContent(null); + $response->headers->remove('X-Body-Eval'); + $response->headers->remove('X-Body-File'); + + return; + } + + if ($response->headers->has('X-Body-Eval')) { + ob_start(); + + if ($response->headers->has('X-Body-File')) { + include $response->headers->get('X-Body-File'); + } else { + eval('; ?>'.$response->getContent().'setContent(ob_get_clean()); + $response->headers->remove('X-Body-Eval'); + if (!$response->headers->has('Transfer-Encoding')) { + $response->headers->set('Content-Length', strlen($response->getContent())); + } + } elseif ($response->headers->has('X-Body-File')) { + $response->setContent(file_get_contents($response->headers->get('X-Body-File'))); + } else { + return; + } + + $response->headers->remove('X-Body-File'); + } + + protected function processResponseBody(Request $request, Response $response) + { + if (null !== $this->esi && $this->esi->needsEsiParsing($response)) { + $this->esi->process($request, $response); + } + } + + /** + * Checks if the Request includes authorization or other sensitive information + * that should cause the Response to be considered private by default. + * + * @param Request $request A Request instance + * + * @return bool true if the Request is private, false otherwise + */ + private function isPrivateRequest(Request $request) + { + foreach ($this->options['private_headers'] as $key) { + $key = strtolower(str_replace('HTTP_', '', $key)); + + if ('cookie' === $key) { + if (count($request->cookies->all())) { + return true; + } + } elseif ($request->headers->has($key)) { + return true; + } + } + + return false; + } + + /** + * Records that an event took place. + * + * @param Request $request A Request instance + * @param string $event The event name + */ + private function record(Request $request, $event) + { + $path = $request->getPathInfo(); + if ($qs = $request->getQueryString()) { + $path .= '?'.$qs; + } + $this->traces[$request->getMethod().' '.$path][] = $event; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php new file mode 100644 index 0000000..c61ccd7 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php @@ -0,0 +1,430 @@ + + * + * This code is partially based on the Rack-Cache library by Ryan Tomayko, + * which is released under the MIT license. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\HttpCache; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * Store implements all the logic for storing cache metadata (Request and Response headers). + * + * @author Fabien Potencier + */ +class Store implements StoreInterface +{ + protected $root; + private $keyCache; + private $locks; + + /** + * Constructor. + * + * @param string $root The path to the cache directory + */ + public function __construct($root) + { + $this->root = $root; + if (!is_dir($this->root)) { + mkdir($this->root, 0777, true); + } + $this->keyCache = new \SplObjectStorage(); + $this->locks = array(); + } + + /** + * Cleanups storage. + */ + public function cleanup() + { + // unlock everything + foreach ($this->locks as $lock) { + if (file_exists($lock)) { + @unlink($lock); + } + } + + $error = error_get_last(); + if (1 === $error['type'] && false === headers_sent()) { + // send a 503 + header('HTTP/1.0 503 Service Unavailable'); + header('Retry-After: 10'); + echo '503 Service Unavailable'; + } + } + + /** + * Locks the cache for a given Request. + * + * @param Request $request A Request instance + * + * @return bool|string true if the lock is acquired, the path to the current lock otherwise + */ + public function lock(Request $request) + { + $path = $this->getPath($this->getCacheKey($request).'.lck'); + if (!is_dir(dirname($path)) && false === @mkdir(dirname($path), 0777, true)) { + return false; + } + + $lock = @fopen($path, 'x'); + if (false !== $lock) { + fclose($lock); + + $this->locks[] = $path; + + return true; + } + + return !file_exists($path) ?: $path; + } + + /** + * Releases the lock for the given Request. + * + * @param Request $request A Request instance + * + * @return bool False if the lock file does not exist or cannot be unlocked, true otherwise + */ + public function unlock(Request $request) + { + $file = $this->getPath($this->getCacheKey($request).'.lck'); + + return is_file($file) ? @unlink($file) : false; + } + + public function isLocked(Request $request) + { + return is_file($this->getPath($this->getCacheKey($request).'.lck')); + } + + /** + * Locates a cached Response for the Request provided. + * + * @param Request $request A Request instance + * + * @return Response|null A Response instance, or null if no cache entry was found + */ + public function lookup(Request $request) + { + $key = $this->getCacheKey($request); + + if (!$entries = $this->getMetadata($key)) { + return; + } + + // find a cached entry that matches the request. + $match = null; + foreach ($entries as $entry) { + if ($this->requestsMatch(isset($entry[1]['vary'][0]) ? $entry[1]['vary'][0] : '', $request->headers->all(), $entry[0])) { + $match = $entry; + + break; + } + } + + if (null === $match) { + return; + } + + list($req, $headers) = $match; + if (is_file($body = $this->getPath($headers['x-content-digest'][0]))) { + return $this->restoreResponse($headers, $body); + } + + // TODO the metaStore referenced an entity that doesn't exist in + // the entityStore. We definitely want to return nil but we should + // also purge the entry from the meta-store when this is detected. + } + + /** + * Writes a cache entry to the store for the given Request and Response. + * + * Existing entries are read and any that match the response are removed. This + * method calls write with the new list of cache entries. + * + * @param Request $request A Request instance + * @param Response $response A Response instance + * + * @return string The key under which the response is stored + * + * @throws \RuntimeException + */ + public function write(Request $request, Response $response) + { + $key = $this->getCacheKey($request); + $storedEnv = $this->persistRequest($request); + + // write the response body to the entity store if this is the original response + if (!$response->headers->has('X-Content-Digest')) { + $digest = $this->generateContentDigest($response); + + if (false === $this->save($digest, $response->getContent())) { + throw new \RuntimeException('Unable to store the entity.'); + } + + $response->headers->set('X-Content-Digest', $digest); + + if (!$response->headers->has('Transfer-Encoding')) { + $response->headers->set('Content-Length', strlen($response->getContent())); + } + } + + // read existing cache entries, remove non-varying, and add this one to the list + $entries = array(); + $vary = $response->headers->get('vary'); + foreach ($this->getMetadata($key) as $entry) { + if (!isset($entry[1]['vary'][0])) { + $entry[1]['vary'] = array(''); + } + + if ($vary != $entry[1]['vary'][0] || !$this->requestsMatch($vary, $entry[0], $storedEnv)) { + $entries[] = $entry; + } + } + + $headers = $this->persistResponse($response); + unset($headers['age']); + + array_unshift($entries, array($storedEnv, $headers)); + + if (false === $this->save($key, serialize($entries))) { + throw new \RuntimeException('Unable to store the metadata.'); + } + + return $key; + } + + /** + * Returns content digest for $response. + * + * @param Response $response + * + * @return string + */ + protected function generateContentDigest(Response $response) + { + return 'en'.sha1($response->getContent()); + } + + /** + * Invalidates all cache entries that match the request. + * + * @param Request $request A Request instance + * + * @throws \RuntimeException + */ + public function invalidate(Request $request) + { + $modified = false; + $key = $this->getCacheKey($request); + + $entries = array(); + foreach ($this->getMetadata($key) as $entry) { + $response = $this->restoreResponse($entry[1]); + if ($response->isFresh()) { + $response->expire(); + $modified = true; + $entries[] = array($entry[0], $this->persistResponse($response)); + } else { + $entries[] = $entry; + } + } + + if ($modified) { + if (false === $this->save($key, serialize($entries))) { + throw new \RuntimeException('Unable to store the metadata.'); + } + } + } + + /** + * Determines whether two Request HTTP header sets are non-varying based on + * the vary response header value provided. + * + * @param string $vary A Response vary header + * @param array $env1 A Request HTTP header array + * @param array $env2 A Request HTTP header array + * + * @return bool true if the two environments match, false otherwise + */ + private function requestsMatch($vary, $env1, $env2) + { + if (empty($vary)) { + return true; + } + + foreach (preg_split('/[\s,]+/', $vary) as $header) { + $key = strtr(strtolower($header), '_', '-'); + $v1 = isset($env1[$key]) ? $env1[$key] : null; + $v2 = isset($env2[$key]) ? $env2[$key] : null; + if ($v1 !== $v2) { + return false; + } + } + + return true; + } + + /** + * Gets all data associated with the given key. + * + * Use this method only if you know what you are doing. + * + * @param string $key The store key + * + * @return array An array of data associated with the key + */ + private function getMetadata($key) + { + if (false === $entries = $this->load($key)) { + return array(); + } + + return unserialize($entries); + } + + /** + * Purges data for the given URL. + * + * @param string $url A URL + * + * @return bool true if the URL exists and has been purged, false otherwise + */ + public function purge($url) + { + if (is_file($path = $this->getPath($this->getCacheKey(Request::create($url))))) { + unlink($path); + + return true; + } + + return false; + } + + /** + * Loads data for the given key. + * + * @param string $key The store key + * + * @return string The data associated with the key + */ + private function load($key) + { + $path = $this->getPath($key); + + return is_file($path) ? file_get_contents($path) : false; + } + + /** + * Save data for the given key. + * + * @param string $key The store key + * @param string $data The data to store + * + * @return bool + */ + private function save($key, $data) + { + $path = $this->getPath($key); + if (!is_dir(dirname($path)) && false === @mkdir(dirname($path), 0777, true)) { + return false; + } + + $tmpFile = tempnam(dirname($path), basename($path)); + if (false === $fp = @fopen($tmpFile, 'wb')) { + return false; + } + @fwrite($fp, $data); + @fclose($fp); + + if ($data != file_get_contents($tmpFile)) { + return false; + } + + if (false === @rename($tmpFile, $path)) { + return false; + } + + @chmod($path, 0666 & ~umask()); + } + + public function getPath($key) + { + return $this->root.DIRECTORY_SEPARATOR.substr($key, 0, 2).DIRECTORY_SEPARATOR.substr($key, 2, 2).DIRECTORY_SEPARATOR.substr($key, 4, 2).DIRECTORY_SEPARATOR.substr($key, 6); + } + + /** + * Returns a cache key for the given Request. + * + * @param Request $request A Request instance + * + * @return string A key for the given Request + */ + private function getCacheKey(Request $request) + { + if (isset($this->keyCache[$request])) { + return $this->keyCache[$request]; + } + + return $this->keyCache[$request] = 'md'.sha1($request->getUri()); + } + + /** + * Persists the Request HTTP headers. + * + * @param Request $request A Request instance + * + * @return array An array of HTTP headers + */ + private function persistRequest(Request $request) + { + return $request->headers->all(); + } + + /** + * Persists the Response HTTP headers. + * + * @param Response $response A Response instance + * + * @return array An array of HTTP headers + */ + private function persistResponse(Response $response) + { + $headers = $response->headers->all(); + $headers['X-Status'] = array($response->getStatusCode()); + + return $headers; + } + + /** + * Restores a Response from the HTTP headers and body. + * + * @param array $headers An array of HTTP headers for the Response + * @param string $body The Response body + * + * @return Response + */ + private function restoreResponse($headers, $body = null) + { + $status = $headers['X-Status'][0]; + unset($headers['X-Status']); + + if (null !== $body) { + $headers['X-Body-File'] = array($body); + } + + return new Response($body, $status, $headers); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php new file mode 100644 index 0000000..2f15877 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php @@ -0,0 +1,96 @@ + + * + * This code is partially based on the Rack-Cache library by Ryan Tomayko, + * which is released under the MIT license. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\HttpCache; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * Interface implemented by HTTP cache stores. + * + * @author Fabien Potencier + */ +interface StoreInterface +{ + /** + * Locates a cached Response for the Request provided. + * + * @param Request $request A Request instance + * + * @return Response|null A Response instance, or null if no cache entry was found + */ + public function lookup(Request $request); + + /** + * Writes a cache entry to the store for the given Request and Response. + * + * Existing entries are read and any that match the response are removed. This + * method calls write with the new list of cache entries. + * + * @param Request $request A Request instance + * @param Response $response A Response instance + * + * @return string The key under which the response is stored + */ + public function write(Request $request, Response $response); + + /** + * Invalidates all cache entries that match the request. + * + * @param Request $request A Request instance + */ + public function invalidate(Request $request); + + /** + * Locks the cache for a given Request. + * + * @param Request $request A Request instance + * + * @return bool|string true if the lock is acquired, the path to the current lock otherwise + */ + public function lock(Request $request); + + /** + * Releases the lock for the given Request. + * + * @param Request $request A Request instance + * + * @return bool False if the lock file does not exist or cannot be unlocked, true otherwise + */ + public function unlock(Request $request); + + /** + * Returns whether or not a lock exists. + * + * @param Request $request A Request instance + * + * @return bool true if lock exists, false otherwise + */ + public function isLocked(Request $request); + + /** + * Purges data for the given URL. + * + * @param string $url A URL + * + * @return bool true if the URL exists and has been purged, false otherwise + */ + public function purge($url); + + /** + * Cleanups storage. + */ + public function cleanup(); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php new file mode 100644 index 0000000..c1e0e61 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php @@ -0,0 +1,243 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel; + +use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; +use Symfony\Component\HttpKernel\Event\FilterControllerEvent; +use Symfony\Component\HttpKernel\Event\FilterResponseEvent; +use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; +use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\HttpKernel\Event\PostResponseEvent; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; + +/** + * HttpKernel notifies events to convert a Request object to a Response one. + * + * @author Fabien Potencier + * + * @api + */ +class HttpKernel implements HttpKernelInterface, TerminableInterface +{ + protected $dispatcher; + protected $resolver; + + /** + * Constructor + * + * @param EventDispatcherInterface $dispatcher An EventDispatcherInterface instance + * @param ControllerResolverInterface $resolver A ControllerResolverInterface instance + * + * @api + */ + public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver) + { + $this->dispatcher = $dispatcher; + $this->resolver = $resolver; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) + { + try { + return $this->handleRaw($request, $type); + } catch (\Exception $e) { + if (false === $catch) { + throw $e; + } + + return $this->handleException($e, $request, $type); + } + } + + /** + * {@inheritdoc} + * + * @api + */ + public function terminate(Request $request, Response $response) + { + $this->dispatcher->dispatch(KernelEvents::TERMINATE, new PostResponseEvent($this, $request, $response)); + } + + /** + * Handles a request to convert it to a response. + * + * Exceptions are not caught. + * + * @param Request $request A Request instance + * @param int $type The type of the request (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST) + * + * @return Response A Response instance + * + * @throws \LogicException If one of the listener does not behave as expected + * @throws NotFoundHttpException When controller cannot be found + */ + private function handleRaw(Request $request, $type = self::MASTER_REQUEST) + { + // request + $event = new GetResponseEvent($this, $request, $type); + $this->dispatcher->dispatch(KernelEvents::REQUEST, $event); + + if ($event->hasResponse()) { + return $this->filterResponse($event->getResponse(), $request, $type); + } + + // load controller + if (false === $controller = $this->resolver->getController($request)) { + throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". Maybe you forgot to add the matching route in your routing configuration?', $request->getPathInfo())); + } + + $event = new FilterControllerEvent($this, $controller, $request, $type); + $this->dispatcher->dispatch(KernelEvents::CONTROLLER, $event); + $controller = $event->getController(); + + // controller arguments + $arguments = $this->resolver->getArguments($request, $controller); + + // call controller + $response = call_user_func_array($controller, $arguments); + + // view + if (!$response instanceof Response) { + $event = new GetResponseForControllerResultEvent($this, $request, $type, $response); + $this->dispatcher->dispatch(KernelEvents::VIEW, $event); + + if ($event->hasResponse()) { + $response = $event->getResponse(); + } + + if (!$response instanceof Response) { + $msg = sprintf('The controller must return a response (%s given).', $this->varToString($response)); + + // the user may have forgotten to return something + if (null === $response) { + $msg .= ' Did you forget to add a return statement somewhere in your controller?'; + } + throw new \LogicException($msg); + } + } + + return $this->filterResponse($response, $request, $type); + } + + /** + * Filters a response object. + * + * @param Response $response A Response instance + * @param Request $request An error message in case the response is not a Response object + * @param int $type The type of the request (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST) + * + * @return Response The filtered Response instance + * + * @throws \RuntimeException if the passed object is not a Response instance + */ + private function filterResponse(Response $response, Request $request, $type) + { + $event = new FilterResponseEvent($this, $request, $type, $response); + + $this->dispatcher->dispatch(KernelEvents::RESPONSE, $event); + + return $event->getResponse(); + } + + /** + * Handles an exception by trying to convert it to a Response. + * + * @param \Exception $e An \Exception instance + * @param Request $request A Request instance + * @param int $type The type of the request + * + * @return Response A Response instance + * + * @throws \Exception + */ + private function handleException(\Exception $e, $request, $type) + { + $event = new GetResponseForExceptionEvent($this, $request, $type, $e); + $this->dispatcher->dispatch(KernelEvents::EXCEPTION, $event); + + // a listener might have replaced the exception + $e = $event->getException(); + + if (!$event->hasResponse()) { + throw $e; + } + + $response = $event->getResponse(); + + // the developer asked for a specific status code + if ($response->headers->has('X-Status-Code')) { + $response->setStatusCode($response->headers->get('X-Status-Code')); + + $response->headers->remove('X-Status-Code'); + } elseif (!$response->isClientError() && !$response->isServerError() && !$response->isRedirect()) { + // ensure that we actually have an error response + if ($e instanceof HttpExceptionInterface) { + // keep the HTTP status code and headers + $response->setStatusCode($e->getStatusCode()); + $response->headers->add($e->getHeaders()); + } else { + $response->setStatusCode(500); + } + } + + try { + return $this->filterResponse($response, $request, $type); + } catch (\Exception $e) { + return $response; + } + } + + private function varToString($var) + { + if (is_object($var)) { + return sprintf('Object(%s)', get_class($var)); + } + + if (is_array($var)) { + $a = array(); + foreach ($var as $k => $v) { + $a[] = sprintf('%s => %s', $k, $this->varToString($v)); + } + + return sprintf("Array(%s)", implode(', ', $a)); + } + + if (is_resource($var)) { + return sprintf('Resource(%s)', get_resource_type($var)); + } + + if (null === $var) { + return 'null'; + } + + if (false === $var) { + return 'false'; + } + + if (true === $var) { + return 'true'; + } + + return (string) $var; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernelInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernelInterface.php new file mode 100644 index 0000000..79d44f1 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernelInterface.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * HttpKernelInterface handles a Request to convert it to a Response. + * + * @author Fabien Potencier + * + * @api + */ +interface HttpKernelInterface +{ + const MASTER_REQUEST = 1; + const SUB_REQUEST = 2; + + /** + * Handles a Request to convert it to a Response. + * + * When $catch is true, the implementation must catch all exceptions + * and do its best to convert them to a Response instance. + * + * @param Request $request A Request instance + * @param int $type The type of the request + * (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST) + * @param bool $catch Whether to catch exceptions or not + * + * @return Response A Response instance + * + * @throws \Exception When an Exception occurs during processing + * + * @api + */ + public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php new file mode 100644 index 0000000..e7fcb77 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php @@ -0,0 +1,809 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel; + +use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator; +use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Dumper\PhpDumper; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; +use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; +use Symfony\Component\DependencyInjection\Loader\IniFileLoader; +use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; +use Symfony\Component\DependencyInjection\Loader\ClosureLoader; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Bundle\BundleInterface; +use Symfony\Component\HttpKernel\Config\FileLocator; +use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass; +use Symfony\Component\HttpKernel\DependencyInjection\AddClassesToCachePass; +use Symfony\Component\Config\Loader\LoaderResolver; +use Symfony\Component\Config\Loader\DelegatingLoader; +use Symfony\Component\Config\ConfigCache; +use Symfony\Component\ClassLoader\ClassCollectionLoader; + +/** + * The Kernel is the heart of the Symfony system. + * + * It manages an environment made of bundles. + * + * @author Fabien Potencier + * + * @api + */ +abstract class Kernel implements KernelInterface, TerminableInterface +{ + /** + * @var BundleInterface[] + */ + protected $bundles; + + protected $bundleMap; + protected $container; + protected $rootDir; + protected $environment; + protected $debug; + protected $booted; + protected $name; + protected $startTime; + protected $loadClassCache; + + const VERSION = '2.3.21'; + const VERSION_ID = '20321'; + const MAJOR_VERSION = '2'; + const MINOR_VERSION = '3'; + const RELEASE_VERSION = '21'; + const EXTRA_VERSION = ''; + + /** + * Constructor. + * + * @param string $environment The environment + * @param bool $debug Whether to enable debugging or not + * + * @api + */ + public function __construct($environment, $debug) + { + $this->environment = $environment; + $this->debug = (bool) $debug; + $this->booted = false; + $this->rootDir = $this->getRootDir(); + $this->name = $this->getName(); + $this->bundles = array(); + + if ($this->debug) { + $this->startTime = microtime(true); + } + + $this->init(); + } + + /** + * @deprecated Deprecated since version 2.3, to be removed in 3.0. Move your logic in the constructor instead. + */ + public function init() + { + } + + public function __clone() + { + if ($this->debug) { + $this->startTime = microtime(true); + } + + $this->booted = false; + $this->container = null; + } + + /** + * Boots the current kernel. + * + * @api + */ + public function boot() + { + if (true === $this->booted) { + return; + } + + if ($this->loadClassCache) { + $this->doLoadClassCache($this->loadClassCache[0], $this->loadClassCache[1]); + } + + // init bundles + $this->initializeBundles(); + + // init container + $this->initializeContainer(); + + foreach ($this->getBundles() as $bundle) { + $bundle->setContainer($this->container); + $bundle->boot(); + } + + $this->booted = true; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function terminate(Request $request, Response $response) + { + if (false === $this->booted) { + return; + } + + if ($this->getHttpKernel() instanceof TerminableInterface) { + $this->getHttpKernel()->terminate($request, $response); + } + } + + /** + * {@inheritdoc} + * + * @api + */ + public function shutdown() + { + if (false === $this->booted) { + return; + } + + $this->booted = false; + + foreach ($this->getBundles() as $bundle) { + $bundle->shutdown(); + $bundle->setContainer(null); + } + + $this->container = null; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) + { + if (false === $this->booted) { + $this->boot(); + } + + return $this->getHttpKernel()->handle($request, $type, $catch); + } + + /** + * Gets a HTTP kernel from the container + * + * @return HttpKernel + */ + protected function getHttpKernel() + { + return $this->container->get('http_kernel'); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function getBundles() + { + return $this->bundles; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function isClassInActiveBundle($class) + { + foreach ($this->getBundles() as $bundle) { + if (0 === strpos($class, $bundle->getNamespace())) { + return true; + } + } + + return false; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function getBundle($name, $first = true) + { + if (!isset($this->bundleMap[$name])) { + throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your %s.php file?', $name, get_class($this))); + } + + if (true === $first) { + return $this->bundleMap[$name][0]; + } + + return $this->bundleMap[$name]; + } + + /** + * Returns the file path for a given resource. + * + * A Resource can be a file or a directory. + * + * The resource name must follow the following pattern: + * + * @/path/to/a/file.something + * + * where BundleName is the name of the bundle + * and the remaining part is the relative path in the bundle. + * + * If $dir is passed, and the first segment of the path is "Resources", + * this method will look for a file named: + * + * $dir//path/without/Resources + * + * before looking in the bundle resource folder. + * + * @param string $name A resource name to locate + * @param string $dir A directory where to look for the resource first + * @param bool $first Whether to return the first path or paths for all matching bundles + * + * @return string|array The absolute path of the resource or an array if $first is false + * + * @throws \InvalidArgumentException if the file cannot be found or the name is not valid + * @throws \RuntimeException if the name contains invalid/unsafe + * @throws \RuntimeException if a custom resource is hidden by a resource in a derived bundle + * + * @api + */ + public function locateResource($name, $dir = null, $first = true) + { + if ('@' !== $name[0]) { + throw new \InvalidArgumentException(sprintf('A resource name must start with @ ("%s" given).', $name)); + } + + if (false !== strpos($name, '..')) { + throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $name)); + } + + $bundleName = substr($name, 1); + $path = ''; + if (false !== strpos($bundleName, '/')) { + list($bundleName, $path) = explode('/', $bundleName, 2); + } + + $isResource = 0 === strpos($path, 'Resources') && null !== $dir; + $overridePath = substr($path, 9); + $resourceBundle = null; + $bundles = $this->getBundle($bundleName, false); + $files = array(); + + foreach ($bundles as $bundle) { + if ($isResource && file_exists($file = $dir.'/'.$bundle->getName().$overridePath)) { + if (null !== $resourceBundle) { + throw new \RuntimeException(sprintf('"%s" resource is hidden by a resource from the "%s" derived bundle. Create a "%s" file to override the bundle resource.', + $file, + $resourceBundle, + $dir.'/'.$bundles[0]->getName().$overridePath + )); + } + + if ($first) { + return $file; + } + $files[] = $file; + } + + if (file_exists($file = $bundle->getPath().'/'.$path)) { + if ($first && !$isResource) { + return $file; + } + $files[] = $file; + $resourceBundle = $bundle->getName(); + } + } + + if (count($files) > 0) { + return $first && $isResource ? $files[0] : $files; + } + + throw new \InvalidArgumentException(sprintf('Unable to find file "%s".', $name)); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function getName() + { + if (null === $this->name) { + $this->name = preg_replace('/[^a-zA-Z0-9_]+/', '', basename($this->rootDir)); + } + + return $this->name; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function getEnvironment() + { + return $this->environment; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function isDebug() + { + return $this->debug; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function getRootDir() + { + if (null === $this->rootDir) { + $r = new \ReflectionObject($this); + $this->rootDir = str_replace('\\', '/', dirname($r->getFileName())); + } + + return $this->rootDir; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function getContainer() + { + return $this->container; + } + + /** + * Loads the PHP class cache. + * + * This methods only registers the fact that you want to load the cache classes. + * The cache will actually only be loaded when the Kernel is booted. + * + * That optimization is mainly useful when using the HttpCache class in which + * case the class cache is not loaded if the Response is in the cache. + * + * @param string $name The cache name prefix + * @param string $extension File extension of the resulting file + */ + public function loadClassCache($name = 'classes', $extension = '.php') + { + $this->loadClassCache = array($name, $extension); + } + + /** + * Used internally. + */ + public function setClassCache(array $classes) + { + file_put_contents($this->getCacheDir().'/classes.map', sprintf('debug ? $this->startTime : -INF; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function getCacheDir() + { + return $this->rootDir.'/cache/'.$this->environment; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function getLogDir() + { + return $this->rootDir.'/logs'; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function getCharset() + { + return 'UTF-8'; + } + + protected function doLoadClassCache($name, $extension) + { + if (!$this->booted && is_file($this->getCacheDir().'/classes.map')) { + ClassCollectionLoader::load(include($this->getCacheDir().'/classes.map'), $this->getCacheDir(), $name, $this->debug, false, $extension); + } + } + + /** + * Initializes the data structures related to the bundle management. + * + * - the bundles property maps a bundle name to the bundle instance, + * - the bundleMap property maps a bundle name to the bundle inheritance hierarchy (most derived bundle first). + * + * @throws \LogicException if two bundles share a common name + * @throws \LogicException if a bundle tries to extend a non-registered bundle + * @throws \LogicException if a bundle tries to extend itself + * @throws \LogicException if two bundles extend the same ancestor + */ + protected function initializeBundles() + { + // init bundles + $this->bundles = array(); + $topMostBundles = array(); + $directChildren = array(); + + foreach ($this->registerBundles() as $bundle) { + $name = $bundle->getName(); + if (isset($this->bundles[$name])) { + throw new \LogicException(sprintf('Trying to register two bundles with the same name "%s"', $name)); + } + $this->bundles[$name] = $bundle; + + if ($parentName = $bundle->getParent()) { + if (isset($directChildren[$parentName])) { + throw new \LogicException(sprintf('Bundle "%s" is directly extended by two bundles "%s" and "%s".', $parentName, $name, $directChildren[$parentName])); + } + if ($parentName == $name) { + throw new \LogicException(sprintf('Bundle "%s" can not extend itself.', $name)); + } + $directChildren[$parentName] = $name; + } else { + $topMostBundles[$name] = $bundle; + } + } + + // look for orphans + if (!empty($directChildren) && count($diff = array_diff_key($directChildren, $this->bundles))) { + $diff = array_keys($diff); + + throw new \LogicException(sprintf('Bundle "%s" extends bundle "%s", which is not registered.', $directChildren[$diff[0]], $diff[0])); + } + + // inheritance + $this->bundleMap = array(); + foreach ($topMostBundles as $name => $bundle) { + $bundleMap = array($bundle); + $hierarchy = array($name); + + while (isset($directChildren[$name])) { + $name = $directChildren[$name]; + array_unshift($bundleMap, $this->bundles[$name]); + $hierarchy[] = $name; + } + + foreach ($hierarchy as $bundle) { + $this->bundleMap[$bundle] = $bundleMap; + array_pop($bundleMap); + } + } + } + + /** + * Gets the container class. + * + * @return string The container class + */ + protected function getContainerClass() + { + return $this->name.ucfirst($this->environment).($this->debug ? 'Debug' : '').'ProjectContainer'; + } + + /** + * Gets the container's base class. + * + * All names except Container must be fully qualified. + * + * @return string + */ + protected function getContainerBaseClass() + { + return 'Container'; + } + + /** + * Initializes the service container. + * + * The cached version of the service container is used when fresh, otherwise the + * container is built. + */ + protected function initializeContainer() + { + $class = $this->getContainerClass(); + $cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug); + $fresh = true; + if (!$cache->isFresh()) { + $container = $this->buildContainer(); + $container->compile(); + $this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass()); + + $fresh = false; + } + + require_once $cache; + + $this->container = new $class(); + $this->container->set('kernel', $this); + + if (!$fresh && $this->container->has('cache_warmer')) { + $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir')); + } + } + + /** + * Returns the kernel parameters. + * + * @return array An array of kernel parameters + */ + protected function getKernelParameters() + { + $bundles = array(); + foreach ($this->bundles as $name => $bundle) { + $bundles[$name] = get_class($bundle); + } + + return array_merge( + array( + 'kernel.root_dir' => $this->rootDir, + 'kernel.environment' => $this->environment, + 'kernel.debug' => $this->debug, + 'kernel.name' => $this->name, + 'kernel.cache_dir' => $this->getCacheDir(), + 'kernel.logs_dir' => $this->getLogDir(), + 'kernel.bundles' => $bundles, + 'kernel.charset' => $this->getCharset(), + 'kernel.container_class' => $this->getContainerClass(), + ), + $this->getEnvParameters() + ); + } + + /** + * Gets the environment parameters. + * + * Only the parameters starting with "SYMFONY__" are considered. + * + * @return array An array of parameters + */ + protected function getEnvParameters() + { + $parameters = array(); + foreach ($_SERVER as $key => $value) { + if (0 === strpos($key, 'SYMFONY__')) { + $parameters[strtolower(str_replace('__', '.', substr($key, 9)))] = $value; + } + } + + return $parameters; + } + + /** + * Builds the service container. + * + * @return ContainerBuilder The compiled service container + * + * @throws \RuntimeException + */ + protected function buildContainer() + { + foreach (array('cache' => $this->getCacheDir(), 'logs' => $this->getLogDir()) as $name => $dir) { + if (!is_dir($dir)) { + if (false === @mkdir($dir, 0777, true)) { + throw new \RuntimeException(sprintf("Unable to create the %s directory (%s)\n", $name, $dir)); + } + } elseif (!is_writable($dir)) { + throw new \RuntimeException(sprintf("Unable to write in the %s directory (%s)\n", $name, $dir)); + } + } + + $container = $this->getContainerBuilder(); + $container->addObjectResource($this); + $this->prepareContainer($container); + + if (null !== $cont = $this->registerContainerConfiguration($this->getContainerLoader($container))) { + $container->merge($cont); + } + + $container->addCompilerPass(new AddClassesToCachePass($this)); + + return $container; + } + + /** + * Prepares the ContainerBuilder before it is compiled. + * + * @param ContainerBuilder $container A ContainerBuilder instance + */ + protected function prepareContainer(ContainerBuilder $container) + { + $extensions = array(); + foreach ($this->bundles as $bundle) { + if ($extension = $bundle->getContainerExtension()) { + $container->registerExtension($extension); + $extensions[] = $extension->getAlias(); + } + + if ($this->debug) { + $container->addObjectResource($bundle); + } + } + foreach ($this->bundles as $bundle) { + $bundle->build($container); + } + + // ensure these extensions are implicitly loaded + $container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass($extensions)); + } + + /** + * Gets a new ContainerBuilder instance used to build the service container. + * + * @return ContainerBuilder + */ + protected function getContainerBuilder() + { + $container = new ContainerBuilder(new ParameterBag($this->getKernelParameters())); + + if (class_exists('ProxyManager\Configuration')) { + $container->setProxyInstantiator(new RuntimeInstantiator()); + } + + return $container; + } + + /** + * Dumps the service container to PHP code in the cache. + * + * @param ConfigCache $cache The config cache + * @param ContainerBuilder $container The service container + * @param string $class The name of the class to generate + * @param string $baseClass The name of the container's base class + */ + protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, $class, $baseClass) + { + // cache the container + $dumper = new PhpDumper($container); + + if (class_exists('ProxyManager\Configuration')) { + $dumper->setProxyDumper(new ProxyDumper()); + } + + $content = $dumper->dump(array('class' => $class, 'base_class' => $baseClass)); + if (!$this->debug) { + $content = static::stripComments($content); + } + + $cache->write($content, $container->getResources()); + } + + /** + * Returns a loader for the container. + * + * @param ContainerInterface $container The service container + * + * @return DelegatingLoader The loader + */ + protected function getContainerLoader(ContainerInterface $container) + { + $locator = new FileLocator($this); + $resolver = new LoaderResolver(array( + new XmlFileLoader($container, $locator), + new YamlFileLoader($container, $locator), + new IniFileLoader($container, $locator), + new PhpFileLoader($container, $locator), + new ClosureLoader($container), + )); + + return new DelegatingLoader($resolver); + } + + /** + * Removes comments from a PHP source string. + * + * We don't use the PHP php_strip_whitespace() function + * as we want the content to be readable and well-formatted. + * + * @param string $source A PHP string + * + * @return string The PHP string with the comments removed + */ + public static function stripComments($source) + { + if (!function_exists('token_get_all')) { + return $source; + } + + $rawChunk = ''; + $output = ''; + $tokens = token_get_all($source); + $ignoreSpace = false; + for (reset($tokens); false !== $token = current($tokens); next($tokens)) { + if (is_string($token)) { + $rawChunk .= $token; + } elseif (T_START_HEREDOC === $token[0]) { + $output .= $rawChunk.$token[1]; + do { + $token = next($tokens); + $output .= $token[1]; + } while ($token[0] !== T_END_HEREDOC); + $rawChunk = ''; + } elseif (T_WHITESPACE === $token[0]) { + if ($ignoreSpace) { + $ignoreSpace = false; + + continue; + } + + // replace multiple new lines with a single newline + $rawChunk .= preg_replace(array('/\n{2,}/S'), "\n", $token[1]); + } elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) { + $ignoreSpace = true; + } else { + $rawChunk .= $token[1]; + + // The PHP-open tag already has a new-line + if (T_OPEN_TAG === $token[0]) { + $ignoreSpace = true; + } + } + } + + $output .= $rawChunk; + + return $output; + } + + public function serialize() + { + return serialize(array($this->environment, $this->debug)); + } + + public function unserialize($data) + { + list($environment, $debug) = unserialize($data); + + $this->__construct($environment, $debug); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php new file mode 100644 index 0000000..fce48ac --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php @@ -0,0 +1,105 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel; + +/** + * Contains all events thrown in the HttpKernel component + * + * @author Bernhard Schussek + * + * @api + */ +final class KernelEvents +{ + /** + * The REQUEST event occurs at the very beginning of request + * dispatching + * + * This event allows you to create a response for a request before any + * other code in the framework is executed. The event listener method + * receives a Symfony\Component\HttpKernel\Event\GetResponseEvent + * instance. + * + * @var string + * + * @api + */ + const REQUEST = 'kernel.request'; + + /** + * The EXCEPTION event occurs when an uncaught exception appears + * + * This event allows you to create a response for a thrown exception or + * to modify the thrown exception. The event listener method receives + * a Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent + * instance. + * + * @var string + * + * @api + */ + const EXCEPTION = 'kernel.exception'; + + /** + * The VIEW event occurs when the return value of a controller + * is not a Response instance + * + * This event allows you to create a response for the return value of the + * controller. The event listener method receives a + * Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent + * instance. + * + * @var string + * + * @api + */ + const VIEW = 'kernel.view'; + + /** + * The CONTROLLER event occurs once a controller was found for + * handling a request + * + * This event allows you to change the controller that will handle the + * request. The event listener method receives a + * Symfony\Component\HttpKernel\Event\FilterControllerEvent instance. + * + * @var string + * + * @api + */ + const CONTROLLER = 'kernel.controller'; + + /** + * The RESPONSE event occurs once a response was created for + * replying to a request + * + * This event allows you to modify or replace the response that will be + * replied. The event listener method receives a + * Symfony\Component\HttpKernel\Event\FilterResponseEvent instance. + * + * @var string + * + * @api + */ + const RESPONSE = 'kernel.response'; + + /** + * The TERMINATE event occurs once a response was sent + * + * This event allows you to run expensive post-response jobs. + * The event listener method receives a + * Symfony\Component\HttpKernel\Event\PostResponseEvent instance. + * + * @var string + */ + const TERMINATE = 'kernel.terminate'; +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php new file mode 100644 index 0000000..922f631 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php @@ -0,0 +1,207 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel; + +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\HttpKernel\Bundle\BundleInterface; +use Symfony\Component\Config\Loader\LoaderInterface; + +/** + * The Kernel is the heart of the Symfony system. + * + * It manages an environment made of bundles. + * + * @author Fabien Potencier + * + * @api + */ +interface KernelInterface extends HttpKernelInterface, \Serializable +{ + /** + * Returns an array of bundles to register. + * + * @return BundleInterface[] An array of bundle instances. + * + * @api + */ + public function registerBundles(); + + /** + * Loads the container configuration. + * + * @param LoaderInterface $loader A LoaderInterface instance + * + * @api + */ + public function registerContainerConfiguration(LoaderInterface $loader); + + /** + * Boots the current kernel. + * + * @api + */ + public function boot(); + + /** + * Shutdowns the kernel. + * + * This method is mainly useful when doing functional testing. + * + * @api + */ + public function shutdown(); + + /** + * Gets the registered bundle instances. + * + * @return BundleInterface[] An array of registered bundle instances + * + * @api + */ + public function getBundles(); + + /** + * Checks if a given class name belongs to an active bundle. + * + * @param string $class A class name + * + * @return bool true if the class belongs to an active bundle, false otherwise + * + * @api + */ + public function isClassInActiveBundle($class); + + /** + * Returns a bundle and optionally its descendants by its name. + * + * @param string $name Bundle name + * @param bool $first Whether to return the first bundle only or together with its descendants + * + * @return BundleInterface|BundleInterface[] A BundleInterface instance or an array of BundleInterface instances if $first is false + * + * @throws \InvalidArgumentException when the bundle is not enabled + * + * @api + */ + public function getBundle($name, $first = true); + + /** + * Returns the file path for a given resource. + * + * A Resource can be a file or a directory. + * + * The resource name must follow the following pattern: + * + * @BundleName/path/to/a/file.something + * + * where BundleName is the name of the bundle + * and the remaining part is the relative path in the bundle. + * + * If $dir is passed, and the first segment of the path is Resources, + * this method will look for a file named: + * + * $dir/BundleName/path/without/Resources + * + * @param string $name A resource name to locate + * @param string $dir A directory where to look for the resource first + * @param bool $first Whether to return the first path or paths for all matching bundles + * + * @return string|array The absolute path of the resource or an array if $first is false + * + * @throws \InvalidArgumentException if the file cannot be found or the name is not valid + * @throws \RuntimeException if the name contains invalid/unsafe characters + * + * @api + */ + public function locateResource($name, $dir = null, $first = true); + + /** + * Gets the name of the kernel. + * + * @return string The kernel name + * + * @api + */ + public function getName(); + + /** + * Gets the environment. + * + * @return string The current environment + * + * @api + */ + public function getEnvironment(); + + /** + * Checks if debug mode is enabled. + * + * @return bool true if debug mode is enabled, false otherwise + * + * @api + */ + public function isDebug(); + + /** + * Gets the application root dir. + * + * @return string The application root dir + * + * @api + */ + public function getRootDir(); + + /** + * Gets the current container. + * + * @return ContainerInterface A ContainerInterface instance + * + * @api + */ + public function getContainer(); + + /** + * Gets the request start time (not available if debug is disabled). + * + * @return int The request start timestamp + * + * @api + */ + public function getStartTime(); + + /** + * Gets the cache directory. + * + * @return string The cache directory + * + * @api + */ + public function getCacheDir(); + + /** + * Gets the log directory. + * + * @return string The log directory + * + * @api + */ + public function getLogDir(); + + /** + * Gets the charset of the application. + * + * @return string The charset + * + * @api + */ + public function getCharset(); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/LICENSE b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/LICENSE new file mode 100644 index 0000000..0b3292c --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2014 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php new file mode 100644 index 0000000..c015b0d --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Log; + +/** + * DebugLoggerInterface. + * + * @author Fabien Potencier + */ +interface DebugLoggerInterface +{ + /** + * Returns an array of logs. + * + * A log is an array with the following mandatory keys: + * timestamp, message, priority, and priorityName. + * It can also have an optional context key containing an array. + * + * @return array An array of logs + */ + public function getLogs(); + + /** + * Returns the number of errors. + * + * @return int The number of errors + */ + public function countErrors(); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/LoggerInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/LoggerInterface.php new file mode 100644 index 0000000..148c92c --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/LoggerInterface.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Log; + +use Psr\Log\LoggerInterface as PsrLogger; + +/** + * LoggerInterface. + * + * @author Fabien Potencier + * + * @deprecated since 2.2, to be removed in 3.0. Type-hint \Psr\Log\LoggerInterface instead. + * @api + */ +interface LoggerInterface extends PsrLogger +{ + /** + * @api + * @deprecated since 2.2, to be removed in 3.0. Use emergency() which is PSR-3 compatible. + */ + public function emerg($message, array $context = array()); + + /** + * @api + * @deprecated since 2.2, to be removed in 3.0. Use critical() which is PSR-3 compatible. + */ + public function crit($message, array $context = array()); + + /** + * @api + * @deprecated since 2.2, to be removed in 3.0. Use error() which is PSR-3 compatible. + */ + public function err($message, array $context = array()); + + /** + * @api + * @deprecated since 2.2, to be removed in 3.0. Use warning() which is PSR-3 compatible. + */ + public function warn($message, array $context = array()); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/NullLogger.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/NullLogger.php new file mode 100644 index 0000000..98f932a --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/NullLogger.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Log; + +use Psr\Log\NullLogger as PsrNullLogger; + +/** + * NullLogger. + * + * @author Fabien Potencier + * + * @api + */ +class NullLogger extends PsrNullLogger implements LoggerInterface +{ + /** + * @api + * @deprecated since 2.2, to be removed in 3.0. Use emergency() which is PSR-3 compatible. + */ + public function emerg($message, array $context = array()) + { + } + + /** + * @api + * @deprecated since 2.2, to be removed in 3.0. Use critical() which is PSR-3 compatible. + */ + public function crit($message, array $context = array()) + { + } + + /** + * @api + * @deprecated since 2.2, to be removed in 3.0. Use error() which is PSR-3 compatible. + */ + public function err($message, array $context = array()) + { + } + + /** + * @api + * @deprecated since 2.2, to be removed in 3.0. Use warning() which is PSR-3 compatible. + */ + public function warn($message, array $context = array()) + { + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php new file mode 100644 index 0000000..ba6f195 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php @@ -0,0 +1,305 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Profiler; + +/** + * Base Memcache storage for profiling information in a Memcache. + * + * @author Andrej Hudec + */ +abstract class BaseMemcacheProfilerStorage implements ProfilerStorageInterface +{ + const TOKEN_PREFIX = 'sf_profiler_'; + + protected $dsn; + protected $lifetime; + + /** + * Constructor. + * + * @param string $dsn A data source name + * @param string $username + * @param string $password + * @param int $lifetime The lifetime to use for the purge + */ + public function __construct($dsn, $username = '', $password = '', $lifetime = 86400) + { + $this->dsn = $dsn; + $this->lifetime = (int) $lifetime; + } + + /** + * {@inheritdoc} + */ + public function find($ip, $url, $limit, $method, $start = null, $end = null) + { + $indexName = $this->getIndexName(); + + $indexContent = $this->getValue($indexName); + if (!$indexContent) { + return array(); + } + + $profileList = explode("\n", $indexContent); + $result = array(); + + foreach ($profileList as $item) { + if ($limit === 0) { + break; + } + + if ($item == '') { + continue; + } + + list($itemToken, $itemIp, $itemMethod, $itemUrl, $itemTime, $itemParent) = explode("\t", $item, 6); + + $itemTime = (int) $itemTime; + + if ($ip && false === strpos($itemIp, $ip) || $url && false === strpos($itemUrl, $url) || $method && false === strpos($itemMethod, $method)) { + continue; + } + + if (!empty($start) && $itemTime < $start) { + continue; + } + + if (!empty($end) && $itemTime > $end) { + continue; + } + + $result[$itemToken] = array( + 'token' => $itemToken, + 'ip' => $itemIp, + 'method' => $itemMethod, + 'url' => $itemUrl, + 'time' => $itemTime, + 'parent' => $itemParent, + ); + --$limit; + } + + usort($result, function ($a, $b) { + if ($a['time'] === $b['time']) { + return 0; + } + + return $a['time'] > $b['time'] ? -1 : 1; + }); + + return $result; + } + + /** + * {@inheritdoc} + */ + public function purge() + { + // delete only items from index + $indexName = $this->getIndexName(); + + $indexContent = $this->getValue($indexName); + + if (!$indexContent) { + return false; + } + + $profileList = explode("\n", $indexContent); + + foreach ($profileList as $item) { + if ($item == '') { + continue; + } + + if (false !== $pos = strpos($item, "\t")) { + $this->delete($this->getItemName(substr($item, 0, $pos))); + } + } + + return $this->delete($indexName); + } + + /** + * {@inheritdoc} + */ + public function read($token) + { + if (empty($token)) { + return false; + } + + $profile = $this->getValue($this->getItemName($token)); + + if (false !== $profile) { + $profile = $this->createProfileFromData($token, $profile); + } + + return $profile; + } + + /** + * {@inheritdoc} + */ + public function write(Profile $profile) + { + $data = array( + 'token' => $profile->getToken(), + 'parent' => $profile->getParentToken(), + 'children' => array_map(function ($p) { return $p->getToken(); }, $profile->getChildren()), + 'data' => $profile->getCollectors(), + 'ip' => $profile->getIp(), + 'method' => $profile->getMethod(), + 'url' => $profile->getUrl(), + 'time' => $profile->getTime(), + ); + + $profileIndexed = false !== $this->getValue($this->getItemName($profile->getToken())); + + if ($this->setValue($this->getItemName($profile->getToken()), $data, $this->lifetime)) { + if (!$profileIndexed) { + // Add to index + $indexName = $this->getIndexName(); + + $indexRow = implode("\t", array( + $profile->getToken(), + $profile->getIp(), + $profile->getMethod(), + $profile->getUrl(), + $profile->getTime(), + $profile->getParentToken(), + ))."\n"; + + return $this->appendValue($indexName, $indexRow, $this->lifetime); + } + + return true; + } + + return false; + } + + /** + * Retrieve item from the memcache server + * + * @param string $key + * + * @return mixed + */ + abstract protected function getValue($key); + + /** + * Store an item on the memcache server under the specified key + * + * @param string $key + * @param mixed $value + * @param int $expiration + * + * @return bool + */ + abstract protected function setValue($key, $value, $expiration = 0); + + /** + * Delete item from the memcache server + * + * @param string $key + * + * @return bool + */ + abstract protected function delete($key); + + /** + * Append data to an existing item on the memcache server + * @param string $key + * @param string $value + * @param int $expiration + * + * @return bool + */ + abstract protected function appendValue($key, $value, $expiration = 0); + + private function createProfileFromData($token, $data, $parent = null) + { + $profile = new Profile($token); + $profile->setIp($data['ip']); + $profile->setMethod($data['method']); + $profile->setUrl($data['url']); + $profile->setTime($data['time']); + $profile->setCollectors($data['data']); + + if (!$parent && $data['parent']) { + $parent = $this->read($data['parent']); + } + + if ($parent) { + $profile->setParent($parent); + } + + foreach ($data['children'] as $token) { + if (!$token) { + continue; + } + + if (!$childProfileData = $this->getValue($this->getItemName($token))) { + continue; + } + + $profile->addChild($this->createProfileFromData($token, $childProfileData, $profile)); + } + + return $profile; + } + + /** + * Get item name + * + * @param string $token + * + * @return string + */ + private function getItemName($token) + { + $name = self::TOKEN_PREFIX.$token; + + if ($this->isItemNameValid($name)) { + return $name; + } + + return false; + } + + /** + * Get name of index + * + * @return string + */ + private function getIndexName() + { + $name = self::TOKEN_PREFIX.'index'; + + if ($this->isItemNameValid($name)) { + return $name; + } + + return false; + } + + private function isItemNameValid($name) + { + $length = strlen($name); + + if ($length > 250) { + throw new \RuntimeException(sprintf('The memcache item key "%s" is too long (%s bytes). Allowed maximum size is 250 bytes.', $name, $length)); + } + + return true; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php new file mode 100644 index 0000000..b7abad7 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php @@ -0,0 +1,277 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Profiler; + +/** + * Storage for profiler using files. + * + * @author Alexandre Salomé + */ +class FileProfilerStorage implements ProfilerStorageInterface +{ + /** + * Folder where profiler data are stored. + * + * @var string + */ + private $folder; + + /** + * Constructs the file storage using a "dsn-like" path. + * + * Example : "file:/path/to/the/storage/folder" + * + * @param string $dsn The DSN + * + * @throws \RuntimeException + */ + public function __construct($dsn) + { + if (0 !== strpos($dsn, 'file:')) { + throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use FileStorage with an invalid dsn "%s". The expected format is "file:/path/to/the/storage/folder".', $dsn)); + } + $this->folder = substr($dsn, 5); + + if (!is_dir($this->folder)) { + mkdir($this->folder, 0777, true); + } + } + + /** + * {@inheritdoc} + */ + public function find($ip, $url, $limit, $method, $start = null, $end = null) + { + $file = $this->getIndexFilename(); + + if (!file_exists($file)) { + return array(); + } + + $file = fopen($file, 'r'); + fseek($file, 0, SEEK_END); + + $result = array(); + while (count($result) < $limit && $line = $this->readLineFromFile($file)) { + list($csvToken, $csvIp, $csvMethod, $csvUrl, $csvTime, $csvParent) = str_getcsv($line); + + $csvTime = (int) $csvTime; + + if ($ip && false === strpos($csvIp, $ip) || $url && false === strpos($csvUrl, $url) || $method && false === strpos($csvMethod, $method)) { + continue; + } + + if (!empty($start) && $csvTime < $start) { + continue; + } + + if (!empty($end) && $csvTime > $end) { + continue; + } + + $result[$csvToken] = array( + 'token' => $csvToken, + 'ip' => $csvIp, + 'method' => $csvMethod, + 'url' => $csvUrl, + 'time' => $csvTime, + 'parent' => $csvParent, + ); + } + + fclose($file); + + return array_values($result); + } + + /** + * {@inheritdoc} + */ + public function purge() + { + $flags = \FilesystemIterator::SKIP_DOTS; + $iterator = new \RecursiveDirectoryIterator($this->folder, $flags); + $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::CHILD_FIRST); + + foreach ($iterator as $file) { + if (is_file($file)) { + unlink($file); + } else { + rmdir($file); + } + } + } + + /** + * {@inheritdoc} + */ + public function read($token) + { + if (!$token || !file_exists($file = $this->getFilename($token))) { + return; + } + + return $this->createProfileFromData($token, unserialize(file_get_contents($file))); + } + + /** + * {@inheritdoc} + */ + public function write(Profile $profile) + { + $file = $this->getFilename($profile->getToken()); + + $profileIndexed = is_file($file); + if (!$profileIndexed) { + // Create directory + $dir = dirname($file); + if (!is_dir($dir)) { + mkdir($dir, 0777, true); + } + } + + // Store profile + $data = array( + 'token' => $profile->getToken(), + 'parent' => $profile->getParentToken(), + 'children' => array_map(function ($p) { return $p->getToken(); }, $profile->getChildren()), + 'data' => $profile->getCollectors(), + 'ip' => $profile->getIp(), + 'method' => $profile->getMethod(), + 'url' => $profile->getUrl(), + 'time' => $profile->getTime(), + ); + + if (false === file_put_contents($file, serialize($data))) { + return false; + } + + if (!$profileIndexed) { + // Add to index + if (false === $file = fopen($this->getIndexFilename(), 'a')) { + return false; + } + + fputcsv($file, array( + $profile->getToken(), + $profile->getIp(), + $profile->getMethod(), + $profile->getUrl(), + $profile->getTime(), + $profile->getParentToken(), + )); + fclose($file); + } + + return true; + } + + /** + * Gets filename to store data, associated to the token. + * + * @param string $token + * + * @return string The profile filename + */ + protected function getFilename($token) + { + // Uses 4 last characters, because first are mostly the same. + $folderA = substr($token, -2, 2); + $folderB = substr($token, -4, 2); + + return $this->folder.'/'.$folderA.'/'.$folderB.'/'.$token; + } + + /** + * Gets the index filename. + * + * @return string The index filename + */ + protected function getIndexFilename() + { + return $this->folder.'/index.csv'; + } + + /** + * Reads a line in the file, backward. + * + * This function automatically skips the empty lines and do not include the line return in result value. + * + * @param resource $file The file resource, with the pointer placed at the end of the line to read + * + * @return mixed A string representing the line or null if beginning of file is reached + */ + protected function readLineFromFile($file) + { + $line = ''; + $position = ftell($file); + + if (0 === $position) { + return; + } + + while (true) { + $chunkSize = min($position, 1024); + $position -= $chunkSize; + fseek($file, $position); + + if (0 === $chunkSize) { + // bof reached + break; + } + + $buffer = fread($file, $chunkSize); + + if (false === ($upTo = strrpos($buffer, "\n"))) { + $line = $buffer.$line; + continue; + } + + $position += $upTo; + $line = substr($buffer, $upTo + 1).$line; + fseek($file, max(0, $position), SEEK_SET); + + if ('' !== $line) { + break; + } + } + + return '' === $line ? null : $line; + } + + protected function createProfileFromData($token, $data, $parent = null) + { + $profile = new Profile($token); + $profile->setIp($data['ip']); + $profile->setMethod($data['method']); + $profile->setUrl($data['url']); + $profile->setTime($data['time']); + $profile->setCollectors($data['data']); + + if (!$parent && $data['parent']) { + $parent = $this->read($data['parent']); + } + + if ($parent) { + $profile->setParent($parent); + } + + foreach ($data['children'] as $token) { + if (!$token || !file_exists($file = $this->getFilename($token))) { + continue; + } + + $profile->addChild($this->createProfileFromData($token, unserialize(file_get_contents($file)), $profile)); + } + + return $profile; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php new file mode 100644 index 0000000..31f11ef --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Profiler; + +/** + * Memcache Profiler Storage + * + * @author Andrej Hudec + */ +class MemcacheProfilerStorage extends BaseMemcacheProfilerStorage +{ + /** + * @var \Memcache + */ + private $memcache; + + /** + * Internal convenience method that returns the instance of the Memcache + * + * @return \Memcache + * + * @throws \RuntimeException + */ + protected function getMemcache() + { + if (null === $this->memcache) { + if (!preg_match('#^memcache://(?(?=\[.*\])\[(.*)\]|(.*)):(.*)$#', $this->dsn, $matches)) { + throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use Memcache with an invalid dsn "%s". The expected format is "memcache://[host]:port".', $this->dsn)); + } + + $host = $matches[1] ?: $matches[2]; + $port = $matches[3]; + + $memcache = new \Memcache(); + $memcache->addServer($host, $port); + + $this->memcache = $memcache; + } + + return $this->memcache; + } + + /** + * Set instance of the Memcache + * + * @param \Memcache $memcache + */ + public function setMemcache($memcache) + { + $this->memcache = $memcache; + } + + /** + * {@inheritdoc} + */ + protected function getValue($key) + { + return $this->getMemcache()->get($key); + } + + /** + * {@inheritdoc} + */ + protected function setValue($key, $value, $expiration = 0) + { + return $this->getMemcache()->set($key, $value, false, time() + $expiration); + } + + /** + * {@inheritdoc} + */ + protected function delete($key) + { + return $this->getMemcache()->delete($key); + } + + /** + * {@inheritdoc} + */ + protected function appendValue($key, $value, $expiration = 0) + { + $memcache = $this->getMemcache(); + + if (method_exists($memcache, 'append')) { + // Memcache v3.0 + if (!$result = $memcache->append($key, $value, false, $expiration)) { + return $memcache->set($key, $value, false, $expiration); + } + + return $result; + } + + // simulate append in Memcache <3.0 + $content = $memcache->get($key); + + return $memcache->set($key, $content.$value, false, $expiration); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php new file mode 100644 index 0000000..94a5626 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Profiler; + +/** + * Memcached Profiler Storage + * + * @author Andrej Hudec + */ +class MemcachedProfilerStorage extends BaseMemcacheProfilerStorage +{ + /** + * @var \Memcached + */ + private $memcached; + + /** + * Internal convenience method that returns the instance of the Memcached + * + * @return \Memcached + * + * @throws \RuntimeException + */ + protected function getMemcached() + { + if (null === $this->memcached) { + if (!preg_match('#^memcached://(?(?=\[.*\])\[(.*)\]|(.*)):(.*)$#', $this->dsn, $matches)) { + throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use Memcached with an invalid dsn "%s". The expected format is "memcached://[host]:port".', $this->dsn)); + } + + $host = $matches[1] ?: $matches[2]; + $port = $matches[3]; + + $memcached = new \Memcached(); + + // disable compression to allow appending + $memcached->setOption(\Memcached::OPT_COMPRESSION, false); + + $memcached->addServer($host, $port); + + $this->memcached = $memcached; + } + + return $this->memcached; + } + + /** + * Set instance of the Memcached + * + * @param \Memcached $memcached + */ + public function setMemcached($memcached) + { + $this->memcached = $memcached; + } + + /** + * {@inheritdoc} + */ + protected function getValue($key) + { + return $this->getMemcached()->get($key); + } + + /** + * {@inheritdoc} + */ + protected function setValue($key, $value, $expiration = 0) + { + return $this->getMemcached()->set($key, $value, time() + $expiration); + } + + /** + * {@inheritdoc} + */ + protected function delete($key) + { + return $this->getMemcached()->delete($key); + } + + /** + * {@inheritdoc} + */ + protected function appendValue($key, $value, $expiration = 0) + { + $memcached = $this->getMemcached(); + + if (!$result = $memcached->append($key, $value)) { + return $memcached->set($key, $value, $expiration); + } + + return $result; + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php new file mode 100644 index 0000000..c524280 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php @@ -0,0 +1,257 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Profiler; + +class MongoDbProfilerStorage implements ProfilerStorageInterface +{ + protected $dsn; + protected $lifetime; + private $mongo; + + /** + * Constructor. + * + * @param string $dsn A data source name + * @param string $username Not used + * @param string $password Not used + * @param int $lifetime The lifetime to use for the purge + */ + public function __construct($dsn, $username = '', $password = '', $lifetime = 86400) + { + $this->dsn = $dsn; + $this->lifetime = (int) $lifetime; + } + + /** + * {@inheritdoc} + */ + public function find($ip, $url, $limit, $method, $start = null, $end = null) + { + $cursor = $this->getMongo()->find($this->buildQuery($ip, $url, $method, $start, $end), array('_id', 'parent', 'ip', 'method', 'url', 'time'))->sort(array('time' => -1))->limit($limit); + + $tokens = array(); + foreach ($cursor as $profile) { + $tokens[] = $this->getData($profile); + } + + return $tokens; + } + + /** + * {@inheritdoc} + */ + public function purge() + { + $this->getMongo()->remove(array()); + } + + /** + * {@inheritdoc} + */ + public function read($token) + { + $profile = $this->getMongo()->findOne(array('_id' => $token, 'data' => array('$exists' => true))); + + if (null !== $profile) { + $profile = $this->createProfileFromData($this->getData($profile)); + } + + return $profile; + } + + /** + * {@inheritdoc} + */ + public function write(Profile $profile) + { + $this->cleanup(); + + $record = array( + '_id' => $profile->getToken(), + 'parent' => $profile->getParentToken(), + 'data' => base64_encode(serialize($profile->getCollectors())), + 'ip' => $profile->getIp(), + 'method' => $profile->getMethod(), + 'url' => $profile->getUrl(), + 'time' => $profile->getTime(), + ); + + $result = $this->getMongo()->update(array('_id' => $profile->getToken()), array_filter($record, function ($v) { return !empty($v); }), array('upsert' => true)); + + return (bool) (isset($result['ok']) ? $result['ok'] : $result); + } + + /** + * Internal convenience method that returns the instance of the MongoDB Collection + * + * @return \MongoCollection + * + * @throws \RuntimeException + */ + protected function getMongo() + { + if (null !== $this->mongo) { + return $this->mongo; + } + + if (!$parsedDsn = $this->parseDsn($this->dsn)) { + throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use MongoDB with an invalid dsn "%s". The expected format is "mongodb://[user:pass@]host/database/collection"', $this->dsn)); + } + + list($server, $database, $collection) = $parsedDsn; + $mongoClass = version_compare(phpversion('mongo'), '1.3.0', '<') ? '\Mongo' : '\MongoClient'; + $mongo = new $mongoClass($server); + + return $this->mongo = $mongo->selectCollection($database, $collection); + } + + /** + * @param array $data + * + * @return Profile + */ + protected function createProfileFromData(array $data) + { + $profile = $this->getProfile($data); + + if ($data['parent']) { + $parent = $this->getMongo()->findOne(array('_id' => $data['parent'], 'data' => array('$exists' => true))); + if ($parent) { + $profile->setParent($this->getProfile($this->getData($parent))); + } + } + + $profile->setChildren($this->readChildren($data['token'])); + + return $profile; + } + + /** + * @param string $token + * + * @return Profile[] An array of Profile instances + */ + protected function readChildren($token) + { + $profiles = array(); + + $cursor = $this->getMongo()->find(array('parent' => $token, 'data' => array('$exists' => true))); + foreach ($cursor as $d) { + $profiles[] = $this->getProfile($this->getData($d)); + } + + return $profiles; + } + + protected function cleanup() + { + $this->getMongo()->remove(array('time' => array('$lt' => time() - $this->lifetime))); + } + + /** + * @param string $ip + * @param string $url + * @param string $method + * @param int $start + * @param int $end + * + * @return array + */ + private function buildQuery($ip, $url, $method, $start, $end) + { + $query = array(); + + if (!empty($ip)) { + $query['ip'] = $ip; + } + + if (!empty($url)) { + $query['url'] = $url; + } + + if (!empty($method)) { + $query['method'] = $method; + } + + if (!empty($start) || !empty($end)) { + $query['time'] = array(); + } + + if (!empty($start)) { + $query['time']['$gte'] = $start; + } + + if (!empty($end)) { + $query['time']['$lte'] = $end; + } + + return $query; + } + + /** + * @param array $data + * + * @return array + */ + private function getData(array $data) + { + return array( + 'token' => $data['_id'], + 'parent' => isset($data['parent']) ? $data['parent'] : null, + 'ip' => isset($data['ip']) ? $data['ip'] : null, + 'method' => isset($data['method']) ? $data['method'] : null, + 'url' => isset($data['url']) ? $data['url'] : null, + 'time' => isset($data['time']) ? $data['time'] : null, + 'data' => isset($data['data']) ? $data['data'] : null, + ); + } + + /** + * @param array $data + * + * @return Profile + */ + private function getProfile(array $data) + { + $profile = new Profile($data['token']); + $profile->setIp($data['ip']); + $profile->setMethod($data['method']); + $profile->setUrl($data['url']); + $profile->setTime($data['time']); + $profile->setCollectors(unserialize(base64_decode($data['data']))); + + return $profile; + } + + /** + * @param string $dsn + * + * @return null|array Array($server, $database, $collection) + */ + private function parseDsn($dsn) + { + if (!preg_match('#^(mongodb://.*)/(.*)/(.*)$#', $dsn, $matches)) { + return; + } + + $server = $matches[1]; + $database = $matches[2]; + $collection = $matches[3]; + preg_match('#^mongodb://(([^:]+):?(.*)(?=@))?@?([^/]*)(.*)$#', $server, $matchesServer); + + if ('' == $matchesServer[5] && '' != $matches[2]) { + $server .= '/'.$matches[2]; + } + + return array($server, $database, $collection); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MysqlProfilerStorage.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MysqlProfilerStorage.php new file mode 100644 index 0000000..0aee1b5 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MysqlProfilerStorage.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Profiler; + +/** + * A ProfilerStorage for Mysql + * + * @author Jan Schumann + */ +class MysqlProfilerStorage extends PdoProfilerStorage +{ + /** + * {@inheritdoc} + */ + protected function initDb() + { + if (null === $this->db) { + if (0 !== strpos($this->dsn, 'mysql')) { + throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use Mysql with an invalid dsn "%s". The expected format is "mysql:dbname=database_name;host=host_name".', $this->dsn)); + } + + if (!class_exists('PDO') || !in_array('mysql', \PDO::getAvailableDrivers(), true)) { + throw new \RuntimeException('You need to enable PDO_Mysql extension for the profiler to run properly.'); + } + + $db = new \PDO($this->dsn, $this->username, $this->password); + $db->exec('CREATE TABLE IF NOT EXISTS sf_profiler_data (token VARCHAR(255) PRIMARY KEY, data LONGTEXT, ip VARCHAR(64), method VARCHAR(6), url VARCHAR(255), time INTEGER UNSIGNED, parent VARCHAR(255), created_at INTEGER UNSIGNED, KEY (created_at), KEY (ip), KEY (method), KEY (url), KEY (parent))'); + + $this->db = $db; + } + + return $this->db; + } + + /** + * {@inheritdoc} + */ + protected function buildCriteria($ip, $url, $start, $end, $limit, $method) + { + $criteria = array(); + $args = array(); + + if ($ip = preg_replace('/[^\d\.]/', '', $ip)) { + $criteria[] = 'ip LIKE :ip'; + $args[':ip'] = '%'.$ip.'%'; + } + + if ($url) { + $criteria[] = 'url LIKE :url'; + $args[':url'] = '%'.addcslashes($url, '%_\\').'%'; + } + + if ($method) { + $criteria[] = 'method = :method'; + $args[':method'] = $method; + } + + if (!empty($start)) { + $criteria[] = 'time >= :start'; + $args[':start'] = $start; + } + + if (!empty($end)) { + $criteria[] = 'time <= :end'; + $args[':end'] = $end; + } + + return array($criteria, $args); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php new file mode 100644 index 0000000..453a9a8 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php @@ -0,0 +1,262 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Profiler; + +/** + * Base PDO storage for profiling information in a PDO database. + * + * @author Fabien Potencier + * @author Jan Schumann + */ +abstract class PdoProfilerStorage implements ProfilerStorageInterface +{ + protected $dsn; + protected $username; + protected $password; + protected $lifetime; + protected $db; + + /** + * Constructor. + * + * @param string $dsn A data source name + * @param string $username The username for the database + * @param string $password The password for the database + * @param int $lifetime The lifetime to use for the purge + */ + public function __construct($dsn, $username = '', $password = '', $lifetime = 86400) + { + $this->dsn = $dsn; + $this->username = $username; + $this->password = $password; + $this->lifetime = (int) $lifetime; + } + + /** + * {@inheritdoc} + */ + public function find($ip, $url, $limit, $method, $start = null, $end = null) + { + if (null === $start) { + $start = 0; + } + + if (null === $end) { + $end = time(); + } + + list($criteria, $args) = $this->buildCriteria($ip, $url, $start, $end, $limit, $method); + + $criteria = $criteria ? 'WHERE '.implode(' AND ', $criteria) : ''; + + $db = $this->initDb(); + $tokens = $this->fetch($db, 'SELECT token, ip, method, url, time, parent FROM sf_profiler_data '.$criteria.' ORDER BY time DESC LIMIT '.((int) $limit), $args); + $this->close($db); + + return $tokens; + } + + /** + * {@inheritdoc} + */ + public function read($token) + { + $db = $this->initDb(); + $args = array(':token' => $token); + $data = $this->fetch($db, 'SELECT data, parent, ip, method, url, time FROM sf_profiler_data WHERE token = :token LIMIT 1', $args); + $this->close($db); + if (isset($data[0]['data'])) { + return $this->createProfileFromData($token, $data[0]); + } + } + + /** + * {@inheritdoc} + */ + public function write(Profile $profile) + { + $db = $this->initDb(); + $args = array( + ':token' => $profile->getToken(), + ':parent' => $profile->getParentToken(), + ':data' => base64_encode(serialize($profile->getCollectors())), + ':ip' => $profile->getIp(), + ':method' => $profile->getMethod(), + ':url' => $profile->getUrl(), + ':time' => $profile->getTime(), + ':created_at' => time(), + ); + + try { + if ($this->has($profile->getToken())) { + $this->exec($db, 'UPDATE sf_profiler_data SET parent = :parent, data = :data, ip = :ip, method = :method, url = :url, time = :time, created_at = :created_at WHERE token = :token', $args); + } else { + $this->exec($db, 'INSERT INTO sf_profiler_data (token, parent, data, ip, method, url, time, created_at) VALUES (:token, :parent, :data, :ip, :method, :url, :time, :created_at)', $args); + } + $this->cleanup(); + $status = true; + } catch (\Exception $e) { + $status = false; + } + + $this->close($db); + + return $status; + } + + /** + * {@inheritdoc} + */ + public function purge() + { + $db = $this->initDb(); + $this->exec($db, 'DELETE FROM sf_profiler_data'); + $this->close($db); + } + + /** + * Build SQL criteria to fetch records by ip and url + * + * @param string $ip The IP + * @param string $url The URL + * @param string $start The start period to search from + * @param string $end The end period to search to + * @param string $limit The maximum number of tokens to return + * @param string $method The request method + * + * @return array An array with (criteria, args) + */ + abstract protected function buildCriteria($ip, $url, $start, $end, $limit, $method); + + /** + * Initializes the database + * + * @throws \RuntimeException When the requested database driver is not installed + */ + abstract protected function initDb(); + + protected function cleanup() + { + $db = $this->initDb(); + $this->exec($db, 'DELETE FROM sf_profiler_data WHERE created_at < :time', array(':time' => time() - $this->lifetime)); + $this->close($db); + } + + protected function exec($db, $query, array $args = array()) + { + $stmt = $this->prepareStatement($db, $query); + + foreach ($args as $arg => $val) { + $stmt->bindValue($arg, $val, is_int($val) ? \PDO::PARAM_INT : \PDO::PARAM_STR); + } + $success = $stmt->execute(); + if (!$success) { + throw new \RuntimeException(sprintf('Error executing query "%s"', $query)); + } + } + + protected function prepareStatement($db, $query) + { + try { + $stmt = $db->prepare($query); + } catch (\Exception $e) { + $stmt = false; + } + + if (false === $stmt) { + throw new \RuntimeException('The database cannot successfully prepare the statement'); + } + + return $stmt; + } + + protected function fetch($db, $query, array $args = array()) + { + $stmt = $this->prepareStatement($db, $query); + + foreach ($args as $arg => $val) { + $stmt->bindValue($arg, $val, is_int($val) ? \PDO::PARAM_INT : \PDO::PARAM_STR); + } + $stmt->execute(); + $return = $stmt->fetchAll(\PDO::FETCH_ASSOC); + + return $return; + } + + protected function close($db) + { + } + + protected function createProfileFromData($token, $data, $parent = null) + { + $profile = new Profile($token); + $profile->setIp($data['ip']); + $profile->setMethod($data['method']); + $profile->setUrl($data['url']); + $profile->setTime($data['time']); + $profile->setCollectors(unserialize(base64_decode($data['data']))); + + if (!$parent && !empty($data['parent'])) { + $parent = $this->read($data['parent']); + } + + if ($parent) { + $profile->setParent($parent); + } + + $profile->setChildren($this->readChildren($token, $profile)); + + return $profile; + } + + /** + * Reads the child profiles for the given token. + * + * @param string $token The parent token + * @param string $parent The parent instance + * + * @return Profile[] An array of Profile instance + */ + protected function readChildren($token, $parent) + { + $db = $this->initDb(); + $data = $this->fetch($db, 'SELECT token, data, ip, method, url, time FROM sf_profiler_data WHERE parent = :token', array(':token' => $token)); + $this->close($db); + + if (!$data) { + return array(); + } + + $profiles = array(); + foreach ($data as $d) { + $profiles[] = $this->createProfileFromData($d['token'], $d, $parent); + } + + return $profiles; + } + + /** + * Returns whether data for the given token already exists in storage. + * + * @param string $token The profile token + * + * @return string + */ + protected function has($token) + { + $db = $this->initDb(); + $tokenExists = $this->fetch($db, 'SELECT 1 FROM sf_profiler_data WHERE token = :token LIMIT 1', array(':token' => $token)); + $this->close($db); + + return !empty($tokenExists); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profile.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profile.php new file mode 100644 index 0000000..a2c57f3 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profile.php @@ -0,0 +1,275 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Profiler; + +use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface; + +/** + * Profile. + * + * @author Fabien Potencier + */ +class Profile +{ + private $token; + + /** + * @var DataCollectorInterface[] + */ + private $collectors = array(); + + private $ip; + private $method; + private $url; + private $time; + + /** + * @var Profile + */ + private $parent; + + /** + * @var Profile[] + */ + private $children = array(); + + /** + * Constructor. + * + * @param string $token The token + */ + public function __construct($token) + { + $this->token = $token; + } + + /** + * Sets the token. + * + * @param string $token The token + */ + public function setToken($token) + { + $this->token = $token; + } + + /** + * Gets the token. + * + * @return string The token + */ + public function getToken() + { + return $this->token; + } + + /** + * Sets the parent token + * + * @param Profile $parent The parent Profile + */ + public function setParent(Profile $parent) + { + $this->parent = $parent; + } + + /** + * Returns the parent profile. + * + * @return Profile The parent profile + */ + public function getParent() + { + return $this->parent; + } + + /** + * Returns the parent token. + * + * @return null|string The parent token + */ + public function getParentToken() + { + return $this->parent ? $this->parent->getToken() : null; + } + + /** + * Returns the IP. + * + * @return string The IP + */ + public function getIp() + { + return $this->ip; + } + + /** + * Sets the IP. + * + * @param string $ip + */ + public function setIp($ip) + { + $this->ip = $ip; + } + + /** + * Returns the request method. + * + * @return string The request method + */ + public function getMethod() + { + return $this->method; + } + + public function setMethod($method) + { + $this->method = $method; + } + + /** + * Returns the URL. + * + * @return string The URL + */ + public function getUrl() + { + return $this->url; + } + + public function setUrl($url) + { + $this->url = $url; + } + + /** + * Returns the time. + * + * @return string The time + */ + public function getTime() + { + if (null === $this->time) { + return 0; + } + + return $this->time; + } + + public function setTime($time) + { + $this->time = $time; + } + + /** + * Finds children profilers. + * + * @return Profile[] An array of Profile + */ + public function getChildren() + { + return $this->children; + } + + /** + * Sets children profiler. + * + * @param Profile[] $children An array of Profile + */ + public function setChildren(array $children) + { + $this->children = array(); + foreach ($children as $child) { + $this->addChild($child); + } + } + + /** + * Adds the child token + * + * @param Profile $child The child Profile + */ + public function addChild(Profile $child) + { + $this->children[] = $child; + $child->setParent($this); + } + + /** + * Gets a Collector by name. + * + * @param string $name A collector name + * + * @return DataCollectorInterface A DataCollectorInterface instance + * + * @throws \InvalidArgumentException if the collector does not exist + */ + public function getCollector($name) + { + if (!isset($this->collectors[$name])) { + throw new \InvalidArgumentException(sprintf('Collector "%s" does not exist.', $name)); + } + + return $this->collectors[$name]; + } + + /** + * Gets the Collectors associated with this profile. + * + * @return DataCollectorInterface[] + */ + public function getCollectors() + { + return $this->collectors; + } + + /** + * Sets the Collectors associated with this profile. + * + * @param DataCollectorInterface[] $collectors + */ + public function setCollectors(array $collectors) + { + $this->collectors = array(); + foreach ($collectors as $collector) { + $this->addCollector($collector); + } + } + + /** + * Adds a Collector. + * + * @param DataCollectorInterface $collector A DataCollectorInterface instance + */ + public function addCollector(DataCollectorInterface $collector) + { + $this->collectors[$collector->getName()] = $collector; + } + + /** + * Returns true if a Collector for the given name exists. + * + * @param string $name A collector name + * + * @return bool + */ + public function hasCollector($name) + { + return isset($this->collectors[$name]); + } + + public function __sleep() + { + return array('token', 'parent', 'children', 'collectors', 'ip', 'method', 'url', 'time'); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php new file mode 100644 index 0000000..fc539bb --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php @@ -0,0 +1,287 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Profiler; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface; +use Psr\Log\LoggerInterface; + +/** + * Profiler. + * + * @author Fabien Potencier + */ +class Profiler +{ + /** + * @var ProfilerStorageInterface + */ + private $storage; + + /** + * @var DataCollectorInterface[] + */ + private $collectors = array(); + + /** + * @var LoggerInterface + */ + private $logger; + + /** + * @var bool + */ + private $enabled = true; + + /** + * Constructor. + * + * @param ProfilerStorageInterface $storage A ProfilerStorageInterface instance + * @param LoggerInterface $logger A LoggerInterface instance + */ + public function __construct(ProfilerStorageInterface $storage, LoggerInterface $logger = null) + { + $this->storage = $storage; + $this->logger = $logger; + } + + /** + * Disables the profiler. + */ + public function disable() + { + $this->enabled = false; + } + + /** + * Enables the profiler. + */ + public function enable() + { + $this->enabled = true; + } + + /** + * Loads the Profile for the given Response. + * + * @param Response $response A Response instance + * + * @return Profile A Profile instance + */ + public function loadProfileFromResponse(Response $response) + { + if (!$token = $response->headers->get('X-Debug-Token')) { + return false; + } + + return $this->loadProfile($token); + } + + /** + * Loads the Profile for the given token. + * + * @param string $token A token + * + * @return Profile A Profile instance + */ + public function loadProfile($token) + { + return $this->storage->read($token); + } + + /** + * Saves a Profile. + * + * @param Profile $profile A Profile instance + * + * @return bool + */ + public function saveProfile(Profile $profile) + { + if (!($ret = $this->storage->write($profile)) && null !== $this->logger) { + $this->logger->warning('Unable to store the profiler information.'); + } + + return $ret; + } + + /** + * Purges all data from the storage. + */ + public function purge() + { + $this->storage->purge(); + } + + /** + * Exports the current profiler data. + * + * @param Profile $profile A Profile instance + * + * @return string The exported data + */ + public function export(Profile $profile) + { + return base64_encode(serialize($profile)); + } + + /** + * Imports data into the profiler storage. + * + * @param string $data A data string as exported by the export() method + * + * @return Profile A Profile instance + */ + public function import($data) + { + $profile = unserialize(base64_decode($data)); + + if ($this->storage->read($profile->getToken())) { + return false; + } + + $this->saveProfile($profile); + + return $profile; + } + + /** + * Finds profiler tokens for the given criteria. + * + * @param string $ip The IP + * @param string $url The URL + * @param string $limit The maximum number of tokens to return + * @param string $method The request method + * @param string $start The start date to search from + * @param string $end The end date to search to + * + * @return array An array of tokens + * + * @see http://php.net/manual/en/datetime.formats.php for the supported date/time formats + */ + public function find($ip, $url, $limit, $method, $start, $end) + { + return $this->storage->find($ip, $url, $limit, $method, $this->getTimestamp($start), $this->getTimestamp($end)); + } + + /** + * Collects data for the given Response. + * + * @param Request $request A Request instance + * @param Response $response A Response instance + * @param \Exception $exception An exception instance if the request threw one + * + * @return Profile|null A Profile instance or null if the profiler is disabled + */ + public function collect(Request $request, Response $response, \Exception $exception = null) + { + if (false === $this->enabled) { + return; + } + + $profile = new Profile(substr(sha1(uniqid(mt_rand(), true)), 0, 6)); + $profile->setTime(time()); + $profile->setUrl($request->getUri()); + $profile->setIp($request->getClientIp()); + $profile->setMethod($request->getMethod()); + + $response->headers->set('X-Debug-Token', $profile->getToken()); + + foreach ($this->collectors as $collector) { + $collector->collect($request, $response, $exception); + + // forces collectors to become "read/only" (they loose their object dependencies) + $profile->addCollector(unserialize(serialize($collector))); + } + + return $profile; + } + + /** + * Gets the Collectors associated with this profiler. + * + * @return array An array of collectors + */ + public function all() + { + return $this->collectors; + } + + /** + * Sets the Collectors associated with this profiler. + * + * @param DataCollectorInterface[] $collectors An array of collectors + */ + public function set(array $collectors = array()) + { + $this->collectors = array(); + foreach ($collectors as $collector) { + $this->add($collector); + } + } + + /** + * Adds a Collector. + * + * @param DataCollectorInterface $collector A DataCollectorInterface instance + */ + public function add(DataCollectorInterface $collector) + { + $this->collectors[$collector->getName()] = $collector; + } + + /** + * Returns true if a Collector for the given name exists. + * + * @param string $name A collector name + * + * @return bool + */ + public function has($name) + { + return isset($this->collectors[$name]); + } + + /** + * Gets a Collector by name. + * + * @param string $name A collector name + * + * @return DataCollectorInterface A DataCollectorInterface instance + * + * @throws \InvalidArgumentException if the collector does not exist + */ + public function get($name) + { + if (!isset($this->collectors[$name])) { + throw new \InvalidArgumentException(sprintf('Collector "%s" does not exist.', $name)); + } + + return $this->collectors[$name]; + } + + private function getTimestamp($value) + { + if (null === $value || '' == $value) { + return; + } + + try { + $value = new \DateTime(is_numeric($value) ? '@'.$value : $value); + } catch (\Exception $e) { + return; + } + + return $value->getTimestamp(); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php new file mode 100644 index 0000000..2e16915 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Profiler; + +/** + * ProfilerStorageInterface. + * + * @author Fabien Potencier + */ +interface ProfilerStorageInterface +{ + /** + * Finds profiler tokens for the given criteria. + * + * @param string $ip The IP + * @param string $url The URL + * @param string $limit The maximum number of tokens to return + * @param string $method The request method + * @param int|null $start The start date to search from + * @param int|null $end The end date to search to + * + * @return array An array of tokens + */ + public function find($ip, $url, $limit, $method, $start = null, $end = null); + + /** + * Reads data associated with the given token. + * + * The method returns false if the token does not exist in the storage. + * + * @param string $token A token + * + * @return Profile The profile associated with token + */ + public function read($token); + + /** + * Saves a Profile. + * + * @param Profile $profile A Profile instance + * + * @return bool Write operation successful + */ + public function write(Profile $profile); + + /** + * Purges all data from the database. + */ + public function purge(); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php new file mode 100644 index 0000000..d56e49d --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php @@ -0,0 +1,390 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Profiler; + +/** + * RedisProfilerStorage stores profiling information in Redis. + * + * @author Andrej Hudec + * @author Stephane PY + */ +class RedisProfilerStorage implements ProfilerStorageInterface +{ + const TOKEN_PREFIX = 'sf_profiler_'; + + const REDIS_OPT_SERIALIZER = 1; + const REDIS_OPT_PREFIX = 2; + const REDIS_SERIALIZER_NONE = 0; + const REDIS_SERIALIZER_PHP = 1; + + protected $dsn; + protected $lifetime; + + /** + * @var \Redis + */ + private $redis; + + /** + * Constructor. + * + * @param string $dsn A data source name + * @param string $username Not used + * @param string $password Not used + * @param int $lifetime The lifetime to use for the purge + */ + public function __construct($dsn, $username = '', $password = '', $lifetime = 86400) + { + $this->dsn = $dsn; + $this->lifetime = (int) $lifetime; + } + + /** + * {@inheritdoc} + */ + public function find($ip, $url, $limit, $method, $start = null, $end = null) + { + $indexName = $this->getIndexName(); + + if (!$indexContent = $this->getValue($indexName, self::REDIS_SERIALIZER_NONE)) { + return array(); + } + + $profileList = array_reverse(explode("\n", $indexContent)); + $result = array(); + + foreach ($profileList as $item) { + if ($limit === 0) { + break; + } + + if ($item == '') { + continue; + } + + list($itemToken, $itemIp, $itemMethod, $itemUrl, $itemTime, $itemParent) = explode("\t", $item, 6); + + $itemTime = (int) $itemTime; + + if ($ip && false === strpos($itemIp, $ip) || $url && false === strpos($itemUrl, $url) || $method && false === strpos($itemMethod, $method)) { + continue; + } + + if (!empty($start) && $itemTime < $start) { + continue; + } + + if (!empty($end) && $itemTime > $end) { + continue; + } + + $result[] = array( + 'token' => $itemToken, + 'ip' => $itemIp, + 'method' => $itemMethod, + 'url' => $itemUrl, + 'time' => $itemTime, + 'parent' => $itemParent, + ); + --$limit; + } + + return $result; + } + + /** + * {@inheritdoc} + */ + public function purge() + { + // delete only items from index + $indexName = $this->getIndexName(); + + $indexContent = $this->getValue($indexName, self::REDIS_SERIALIZER_NONE); + + if (!$indexContent) { + return false; + } + + $profileList = explode("\n", $indexContent); + + $result = array(); + + foreach ($profileList as $item) { + if ($item == '') { + continue; + } + + if (false !== $pos = strpos($item, "\t")) { + $result[] = $this->getItemName(substr($item, 0, $pos)); + } + } + + $result[] = $indexName; + + return $this->delete($result); + } + + /** + * {@inheritdoc} + */ + public function read($token) + { + if (empty($token)) { + return false; + } + + $profile = $this->getValue($this->getItemName($token), self::REDIS_SERIALIZER_PHP); + + if (false !== $profile) { + $profile = $this->createProfileFromData($token, $profile); + } + + return $profile; + } + + /** + * {@inheritdoc} + */ + public function write(Profile $profile) + { + $data = array( + 'token' => $profile->getToken(), + 'parent' => $profile->getParentToken(), + 'children' => array_map(function ($p) { return $p->getToken(); }, $profile->getChildren()), + 'data' => $profile->getCollectors(), + 'ip' => $profile->getIp(), + 'method' => $profile->getMethod(), + 'url' => $profile->getUrl(), + 'time' => $profile->getTime(), + ); + + $profileIndexed = false !== $this->getValue($this->getItemName($profile->getToken())); + + if ($this->setValue($this->getItemName($profile->getToken()), $data, $this->lifetime, self::REDIS_SERIALIZER_PHP)) { + if (!$profileIndexed) { + // Add to index + $indexName = $this->getIndexName(); + + $indexRow = implode("\t", array( + $profile->getToken(), + $profile->getIp(), + $profile->getMethod(), + $profile->getUrl(), + $profile->getTime(), + $profile->getParentToken(), + ))."\n"; + + return $this->appendValue($indexName, $indexRow, $this->lifetime); + } + + return true; + } + + return false; + } + + /** + * Internal convenience method that returns the instance of Redis. + * + * @return \Redis + * + * @throws \RuntimeException + */ + protected function getRedis() + { + if (null === $this->redis) { + $data = parse_url($this->dsn); + + if (false === $data || !isset($data['scheme']) || $data['scheme'] !== 'redis' || !isset($data['host']) || !isset($data['port'])) { + throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use Redis with an invalid dsn "%s". The minimal expected format is "redis://[host]:port".', $this->dsn)); + } + + if (!extension_loaded('redis')) { + throw new \RuntimeException('RedisProfilerStorage requires that the redis extension is loaded.'); + } + + $redis = new \Redis(); + $redis->connect($data['host'], $data['port']); + + if (isset($data['path'])) { + $redis->select(substr($data['path'], 1)); + } + + if (isset($data['pass'])) { + $redis->auth($data['pass']); + } + + $redis->setOption(self::REDIS_OPT_PREFIX, self::TOKEN_PREFIX); + + $this->redis = $redis; + } + + return $this->redis; + } + + /** + * Set instance of the Redis + * + * @param \Redis $redis + */ + public function setRedis($redis) + { + $this->redis = $redis; + } + + private function createProfileFromData($token, $data, $parent = null) + { + $profile = new Profile($token); + $profile->setIp($data['ip']); + $profile->setMethod($data['method']); + $profile->setUrl($data['url']); + $profile->setTime($data['time']); + $profile->setCollectors($data['data']); + + if (!$parent && $data['parent']) { + $parent = $this->read($data['parent']); + } + + if ($parent) { + $profile->setParent($parent); + } + + foreach ($data['children'] as $token) { + if (!$token) { + continue; + } + + if (!$childProfileData = $this->getValue($this->getItemName($token), self::REDIS_SERIALIZER_PHP)) { + continue; + } + + $profile->addChild($this->createProfileFromData($token, $childProfileData, $profile)); + } + + return $profile; + } + + /** + * Gets the item name. + * + * @param string $token + * + * @return string + */ + private function getItemName($token) + { + $name = $token; + + if ($this->isItemNameValid($name)) { + return $name; + } + + return false; + } + + /** + * Gets the name of the index. + * + * @return string + */ + private function getIndexName() + { + $name = 'index'; + + if ($this->isItemNameValid($name)) { + return $name; + } + + return false; + } + + private function isItemNameValid($name) + { + $length = strlen($name); + + if ($length > 2147483648) { + throw new \RuntimeException(sprintf('The Redis item key "%s" is too long (%s bytes). Allowed maximum size is 2^31 bytes.', $name, $length)); + } + + return true; + } + + /** + * Retrieves an item from the Redis server. + * + * @param string $key + * @param int $serializer + * + * @return mixed + */ + private function getValue($key, $serializer = self::REDIS_SERIALIZER_NONE) + { + $redis = $this->getRedis(); + $redis->setOption(self::REDIS_OPT_SERIALIZER, $serializer); + + return $redis->get($key); + } + + /** + * Stores an item on the Redis server under the specified key. + * + * @param string $key + * @param mixed $value + * @param int $expiration + * @param int $serializer + * + * @return bool + */ + private function setValue($key, $value, $expiration = 0, $serializer = self::REDIS_SERIALIZER_NONE) + { + $redis = $this->getRedis(); + $redis->setOption(self::REDIS_OPT_SERIALIZER, $serializer); + + return $redis->setex($key, $expiration, $value); + } + + /** + * Appends data to an existing item on the Redis server. + * + * @param string $key + * @param string $value + * @param int $expiration + * + * @return bool + */ + private function appendValue($key, $value, $expiration = 0) + { + $redis = $this->getRedis(); + $redis->setOption(self::REDIS_OPT_SERIALIZER, self::REDIS_SERIALIZER_NONE); + + if ($redis->exists($key)) { + $redis->append($key, $value); + + return $redis->setTimeout($key, $expiration); + } + + return $redis->setex($key, $expiration, $value); + } + + /** + * Removes the specified keys. + * + * @param array $keys + * + * @return bool + */ + private function delete(array $keys) + { + return (bool) $this->getRedis()->delete($keys); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php new file mode 100644 index 0000000..0c25bc9 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php @@ -0,0 +1,139 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Profiler; + +/** + * SqliteProfilerStorage stores profiling information in a SQLite database. + * + * @author Fabien Potencier + */ +class SqliteProfilerStorage extends PdoProfilerStorage +{ + /** + * @throws \RuntimeException When neither of SQLite3 or PDO_SQLite extension is enabled + */ + protected function initDb() + { + if (null === $this->db || $this->db instanceof \SQLite3) { + if (0 !== strpos($this->dsn, 'sqlite')) { + throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use Sqlite with an invalid dsn "%s". The expected format is "sqlite:/path/to/the/db/file".', $this->dsn)); + } + if (class_exists('SQLite3')) { + $db = new \SQLite3(substr($this->dsn, 7, strlen($this->dsn)), \SQLITE3_OPEN_READWRITE | \SQLITE3_OPEN_CREATE); + if (method_exists($db, 'busyTimeout')) { + // busyTimeout only exists for PHP >= 5.3.3 + $db->busyTimeout(1000); + } + } elseif (class_exists('PDO') && in_array('sqlite', \PDO::getAvailableDrivers(), true)) { + $db = new \PDO($this->dsn); + } else { + throw new \RuntimeException('You need to enable either the SQLite3 or PDO_SQLite extension for the profiler to run properly.'); + } + + $db->exec('PRAGMA temp_store=MEMORY; PRAGMA journal_mode=MEMORY;'); + $db->exec('CREATE TABLE IF NOT EXISTS sf_profiler_data (token STRING, data STRING, ip STRING, method STRING, url STRING, time INTEGER, parent STRING, created_at INTEGER)'); + $db->exec('CREATE INDEX IF NOT EXISTS data_created_at ON sf_profiler_data (created_at)'); + $db->exec('CREATE INDEX IF NOT EXISTS data_ip ON sf_profiler_data (ip)'); + $db->exec('CREATE INDEX IF NOT EXISTS data_method ON sf_profiler_data (method)'); + $db->exec('CREATE INDEX IF NOT EXISTS data_url ON sf_profiler_data (url)'); + $db->exec('CREATE INDEX IF NOT EXISTS data_parent ON sf_profiler_data (parent)'); + $db->exec('CREATE UNIQUE INDEX IF NOT EXISTS data_token ON sf_profiler_data (token)'); + + $this->db = $db; + } + + return $this->db; + } + + protected function exec($db, $query, array $args = array()) + { + if ($db instanceof \SQLite3) { + $stmt = $this->prepareStatement($db, $query); + foreach ($args as $arg => $val) { + $stmt->bindValue($arg, $val, is_int($val) ? \SQLITE3_INTEGER : \SQLITE3_TEXT); + } + + $res = $stmt->execute(); + if (false === $res) { + throw new \RuntimeException(sprintf('Error executing SQLite query "%s"', $query)); + } + $res->finalize(); + } else { + parent::exec($db, $query, $args); + } + } + + protected function fetch($db, $query, array $args = array()) + { + $return = array(); + + if ($db instanceof \SQLite3) { + $stmt = $this->prepareStatement($db, $query, true); + foreach ($args as $arg => $val) { + $stmt->bindValue($arg, $val, is_int($val) ? \SQLITE3_INTEGER : \SQLITE3_TEXT); + } + $res = $stmt->execute(); + while ($row = $res->fetchArray(\SQLITE3_ASSOC)) { + $return[] = $row; + } + $res->finalize(); + $stmt->close(); + } else { + $return = parent::fetch($db, $query, $args); + } + + return $return; + } + + /** + * {@inheritdoc} + */ + protected function buildCriteria($ip, $url, $start, $end, $limit, $method) + { + $criteria = array(); + $args = array(); + + if ($ip = preg_replace('/[^\d\.]/', '', $ip)) { + $criteria[] = 'ip LIKE :ip'; + $args[':ip'] = '%'.$ip.'%'; + } + + if ($url) { + $criteria[] = 'url LIKE :url ESCAPE "\"'; + $args[':url'] = '%'.addcslashes($url, '%_\\').'%'; + } + + if ($method) { + $criteria[] = 'method = :method'; + $args[':method'] = $method; + } + + if (!empty($start)) { + $criteria[] = 'time >= :start'; + $args[':start'] = $start; + } + + if (!empty($end)) { + $criteria[] = 'time <= :end'; + $args[':end'] = $end; + } + + return array($criteria, $args); + } + + protected function close($db) + { + if ($db instanceof \SQLite3) { + $db->close(); + } + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/TerminableInterface.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/TerminableInterface.php new file mode 100644 index 0000000..fc0e580 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/TerminableInterface.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * Terminable extends the Kernel request/response cycle with dispatching a post + * response event after sending the response and before shutting down the kernel. + * + * @author Jordi Boggiano + * @author Pierre Minnieur + * + * @api + */ +interface TerminableInterface +{ + /** + * Terminates a request/response cycle. + * + * Should be called after sending the response and before shutting down the kernel. + * + * @param Request $request A Request instance + * @param Response $response A Response instance + * + * @api + */ + public function terminate(Request $request, Response $response); +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/UriSigner.php b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/UriSigner.php new file mode 100644 index 0000000..214a9f2 --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/UriSigner.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel; + +/** + * Signs URIs. + * + * @author Fabien Potencier + */ +class UriSigner +{ + private $secret; + + /** + * Constructor. + * + * @param string $secret A secret + */ + public function __construct($secret) + { + $this->secret = $secret; + } + + /** + * Signs a URI. + * + * The given URI is signed by adding a _hash query string parameter + * which value depends on the URI and the secret. + * + * @param string $uri A URI to sign + * + * @return string The signed URI + */ + public function sign($uri) + { + return $uri.(false === (strpos($uri, '?')) ? '?' : '&').'_hash='.$this->computeHash($uri); + } + + /** + * Checks that a URI contains the correct hash. + * + * The _hash query string parameter must be the last one + * (as it is generated that way by the sign() method, it should + * never be a problem). + * + * @param string $uri A signed URI + * + * @return bool True if the URI is signed correctly, false otherwise + */ + public function check($uri) + { + if (!preg_match('/^(.*)(?:\?|&)_hash=(.+?)$/', $uri, $matches)) { + return false; + } + + return $this->computeHash($matches[1]) === $matches[2]; + } + + private function computeHash($uri) + { + return urlencode(base64_encode(hash_hmac('sha1', $uri, $this->secret, true))); + } +} diff --git a/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json new file mode 100644 index 0000000..af659da --- /dev/null +++ b/sources/phpBB/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json @@ -0,0 +1,55 @@ +{ + "name": "symfony/http-kernel", + "type": "library", + "description": "Symfony HttpKernel Component", + "keywords": [], + "homepage": "http://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3", + "symfony/event-dispatcher": "~2.1", + "symfony/http-foundation": "~2.2", + "symfony/debug": "~2.3", + "psr/log": "~1.0" + }, + "require-dev": { + "symfony/browser-kit": "~2.2", + "symfony/class-loader": "~2.1", + "symfony/config": "~2.0", + "symfony/console": "~2.2", + "symfony/dependency-injection": "~2.0", + "symfony/finder": "~2.0", + "symfony/process": "~2.0", + "symfony/routing": "~2.2", + "symfony/stopwatch": "~2.2", + "symfony/templating": "~2.2" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/class-loader": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "", + "symfony/finder": "" + }, + "autoload": { + "psr-0": { "Symfony\\Component\\HttpKernel\\": "" } + }, + "target-dir": "Symfony/Component/HttpKernel", + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Annotation/Route.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Annotation/Route.php new file mode 100644 index 0000000..93569d6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Annotation/Route.php @@ -0,0 +1,157 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Annotation; + +/** + * Annotation class for @Route(). + * + * @Annotation + * @Target({"CLASS", "METHOD"}) + * + * @author Fabien Potencier + */ +class Route +{ + private $path; + private $name; + private $requirements; + private $options; + private $defaults; + private $host; + private $methods; + private $schemes; + + /** + * Constructor. + * + * @param array $data An array of key/value parameters. + * + * @throws \BadMethodCallException + */ + public function __construct(array $data) + { + $this->requirements = array(); + $this->options = array(); + $this->defaults = array(); + $this->methods = array(); + $this->schemes = array(); + + if (isset($data['value'])) { + $data['path'] = $data['value']; + unset($data['value']); + } + + foreach ($data as $key => $value) { + $method = 'set'.str_replace('_', '', $key); + if (!method_exists($this, $method)) { + throw new \BadMethodCallException(sprintf("Unknown property '%s' on annotation '%s'.", $key, get_class($this))); + } + $this->$method($value); + } + } + + /** + * @deprecated Deprecated in 2.2, to be removed in 3.0. Use setPath instead. + */ + public function setPattern($pattern) + { + $this->path = $pattern; + } + + /** + * @deprecated Deprecated in 2.2, to be removed in 3.0. Use getPath instead. + */ + public function getPattern() + { + return $this->path; + } + + public function setPath($path) + { + $this->path = $path; + } + + public function getPath() + { + return $this->path; + } + + public function setHost($pattern) + { + $this->host = $pattern; + } + + public function getHost() + { + return $this->host; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getName() + { + return $this->name; + } + + public function setRequirements($requirements) + { + $this->requirements = $requirements; + } + + public function getRequirements() + { + return $this->requirements; + } + + public function setOptions($options) + { + $this->options = $options; + } + + public function getOptions() + { + return $this->options; + } + + public function setDefaults($defaults) + { + $this->defaults = $defaults; + } + + public function getDefaults() + { + return $this->defaults; + } + + public function setSchemes($schemes) + { + $this->schemes = is_array($schemes) ? $schemes : array($schemes); + } + + public function getSchemes() + { + return $this->schemes; + } + + public function setMethods($methods) + { + $this->methods = is_array($methods) ? $methods : array($methods); + } + + public function getMethods() + { + return $this->methods; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/CompiledRoute.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/CompiledRoute.php new file mode 100644 index 0000000..5e4c960 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/CompiledRoute.php @@ -0,0 +1,133 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing; + +/** + * CompiledRoutes are returned by the RouteCompiler class. + * + * @author Fabien Potencier + */ +class CompiledRoute +{ + private $variables; + private $tokens; + private $staticPrefix; + private $regex; + private $pathVariables; + private $hostVariables; + private $hostRegex; + private $hostTokens; + + /** + * Constructor. + * + * @param string $staticPrefix The static prefix of the compiled route + * @param string $regex The regular expression to use to match this route + * @param array $tokens An array of tokens to use to generate URL for this route + * @param array $pathVariables An array of path variables + * @param string|null $hostRegex Host regex + * @param array $hostTokens Host tokens + * @param array $hostVariables An array of host variables + * @param array $variables An array of variables (variables defined in the path and in the host patterns) + */ + public function __construct($staticPrefix, $regex, array $tokens, array $pathVariables, $hostRegex = null, array $hostTokens = array(), array $hostVariables = array(), array $variables = array()) + { + $this->staticPrefix = (string) $staticPrefix; + $this->regex = $regex; + $this->tokens = $tokens; + $this->pathVariables = $pathVariables; + $this->hostRegex = $hostRegex; + $this->hostTokens = $hostTokens; + $this->hostVariables = $hostVariables; + $this->variables = $variables; + } + + /** + * Returns the static prefix. + * + * @return string The static prefix + */ + public function getStaticPrefix() + { + return $this->staticPrefix; + } + + /** + * Returns the regex. + * + * @return string The regex + */ + public function getRegex() + { + return $this->regex; + } + + /** + * Returns the host regex + * + * @return string|null The host regex or null + */ + public function getHostRegex() + { + return $this->hostRegex; + } + + /** + * Returns the tokens. + * + * @return array The tokens + */ + public function getTokens() + { + return $this->tokens; + } + + /** + * Returns the host tokens. + * + * @return array The tokens + */ + public function getHostTokens() + { + return $this->hostTokens; + } + + /** + * Returns the variables. + * + * @return array The variables + */ + public function getVariables() + { + return $this->variables; + } + + /** + * Returns the path variables. + * + * @return array The variables + */ + public function getPathVariables() + { + return $this->pathVariables; + } + + /** + * Returns the host variables. + * + * @return array The variables + */ + public function getHostVariables() + { + return $this->hostVariables; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/ExceptionInterface.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/ExceptionInterface.php new file mode 100644 index 0000000..5289f52 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/ExceptionInterface.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Exception; + +/** + * ExceptionInterface + * + * @author Alexandre Salomé + * + * @api + */ +interface ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/InvalidParameterException.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/InvalidParameterException.php new file mode 100644 index 0000000..4f12469 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/InvalidParameterException.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Exception; + +/** + * Exception thrown when a parameter is not valid + * + * @author Alexandre Salomé + * + * @api + */ +class InvalidParameterException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/MethodNotAllowedException.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/MethodNotAllowedException.php new file mode 100644 index 0000000..32f1091 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/MethodNotAllowedException.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Exception; + +/** + * The resource was found but the request method is not allowed. + * + * This exception should trigger an HTTP 405 response in your application code. + * + * @author Kris Wallsmith + * + * @api + */ +class MethodNotAllowedException extends \RuntimeException implements ExceptionInterface +{ + /** + * @var array + */ + protected $allowedMethods = array(); + + public function __construct(array $allowedMethods, $message = null, $code = 0, \Exception $previous = null) + { + $this->allowedMethods = array_map('strtoupper', $allowedMethods); + + parent::__construct($message, $code, $previous); + } + + /** + * Gets the allowed HTTP methods. + * + * @return array + */ + public function getAllowedMethods() + { + return $this->allowedMethods; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/MissingMandatoryParametersException.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/MissingMandatoryParametersException.php new file mode 100644 index 0000000..5a523fa --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/MissingMandatoryParametersException.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Exception; + +/** + * Exception thrown when a route cannot be generated because of missing + * mandatory parameters. + * + * @author Alexandre Salomé + * + * @api + */ +class MissingMandatoryParametersException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/ResourceNotFoundException.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/ResourceNotFoundException.php new file mode 100644 index 0000000..362a0d6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/ResourceNotFoundException.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Exception; + +/** + * The resource was not found. + * + * This exception should trigger an HTTP 404 response in your application code. + * + * @author Kris Wallsmith + * + * @api + */ +class ResourceNotFoundException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/RouteNotFoundException.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/RouteNotFoundException.php new file mode 100644 index 0000000..fd275be --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Exception/RouteNotFoundException.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Exception; + +/** + * Exception thrown when a route does not exist + * + * @author Alexandre Salomé + * + * @api + */ +class RouteNotFoundException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/ConfigurableRequirementsInterface.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/ConfigurableRequirementsInterface.php new file mode 100644 index 0000000..3cf7edf --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/ConfigurableRequirementsInterface.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Generator; + +/** + * ConfigurableRequirementsInterface must be implemented by URL generators that + * can be configured whether an exception should be generated when the parameters + * do not match the requirements. It is also possible to disable the requirements + * check for URL generation completely. + * + * The possible configurations and use-cases: + * - setStrictRequirements(true): Throw an exception for mismatching requirements. This + * is mostly useful in development environment. + * - setStrictRequirements(false): Don't throw an exception but return null as URL for + * mismatching requirements and log the problem. Useful when you cannot control all + * params because they come from third party libs but don't want to have a 404 in + * production environment. It should log the mismatch so one can review it. + * - setStrictRequirements(null): Return the URL with the given parameters without + * checking the requirements at all. When generating a URL you should either trust + * your params or you validated them beforehand because otherwise it would break your + * link anyway. So in production environment you should know that params always pass + * the requirements. Thus this option allows to disable the check on URL generation for + * performance reasons (saving a preg_match for each requirement every time a URL is + * generated). + * + * @author Fabien Potencier + * @author Tobias Schultze + */ +interface ConfigurableRequirementsInterface +{ + /** + * Enables or disables the exception on incorrect parameters. + * Passing null will deactivate the requirements check completely. + * + * @param bool|null $enabled + */ + public function setStrictRequirements($enabled); + + /** + * Returns whether to throw an exception on incorrect parameters. + * Null means the requirements check is deactivated completely. + * + * @return bool|null + */ + public function isStrictRequirements(); +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumper.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumper.php new file mode 100644 index 0000000..4739bd8 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumper.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Generator\Dumper; + +use Symfony\Component\Routing\RouteCollection; + +/** + * GeneratorDumper is the base class for all built-in generator dumpers. + * + * @author Fabien Potencier + */ +abstract class GeneratorDumper implements GeneratorDumperInterface +{ + /** + * @var RouteCollection + */ + private $routes; + + /** + * Constructor. + * + * @param RouteCollection $routes The RouteCollection to dump + */ + public function __construct(RouteCollection $routes) + { + $this->routes = $routes; + } + + /** + * {@inheritdoc} + */ + public function getRoutes() + { + return $this->routes; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumperInterface.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumperInterface.php new file mode 100644 index 0000000..deb0c0a --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/GeneratorDumperInterface.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Generator\Dumper; + +use Symfony\Component\Routing\RouteCollection; + +/** + * GeneratorDumperInterface is the interface that all generator dumper classes must implement. + * + * @author Fabien Potencier + * + * @api + */ +interface GeneratorDumperInterface +{ + /** + * Dumps a set of routes to a string representation of executable code + * that can then be used to generate a URL of such a route. + * + * @param array $options An array of options + * + * @return string Executable code + */ + public function dump(array $options = array()); + + /** + * Gets the routes to dump. + * + * @return RouteCollection A RouteCollection instance + */ + public function getRoutes(); +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php new file mode 100644 index 0000000..c52fab4 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php @@ -0,0 +1,123 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Generator\Dumper; + +/** + * PhpGeneratorDumper creates a PHP class able to generate URLs for a given set of routes. + * + * @author Fabien Potencier + * @author Tobias Schultze + * + * @api + */ +class PhpGeneratorDumper extends GeneratorDumper +{ + /** + * Dumps a set of routes to a PHP class. + * + * Available options: + * + * * class: The class name + * * base_class: The base class name + * + * @param array $options An array of options + * + * @return string A PHP class representing the generator class + * + * @api + */ + public function dump(array $options = array()) + { + $options = array_merge(array( + 'class' => 'ProjectUrlGenerator', + 'base_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', + ), $options); + + return <<generateDeclaredRoutes()}; + + /** + * Constructor. + */ + public function __construct(RequestContext \$context, LoggerInterface \$logger = null) + { + \$this->context = \$context; + \$this->logger = \$logger; + } + +{$this->generateGenerateMethod()} +} + +EOF; + } + + /** + * Generates PHP code representing an array of defined routes + * together with the routes properties (e.g. requirements). + * + * @return string PHP code + */ + private function generateDeclaredRoutes() + { + $routes = "array(\n"; + foreach ($this->getRoutes()->all() as $name => $route) { + $compiledRoute = $route->compile(); + + $properties = array(); + $properties[] = $compiledRoute->getVariables(); + $properties[] = $route->getDefaults(); + $properties[] = $route->getRequirements(); + $properties[] = $compiledRoute->getTokens(); + $properties[] = $compiledRoute->getHostTokens(); + + $routes .= sprintf(" '%s' => %s,\n", $name, str_replace("\n", '', var_export($properties, true))); + } + $routes .= ' )'; + + return $routes; + } + + /** + * Generates PHP code representing the `generate` method that implements the UrlGeneratorInterface. + * + * @return string PHP code + */ + private function generateGenerateMethod() + { + return <<doGenerate(\$variables, \$defaults, \$requirements, \$tokens, \$parameters, \$name, \$referenceType, \$hostTokens); + } +EOF; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php new file mode 100644 index 0000000..c827ca7 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php @@ -0,0 +1,322 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Generator; + +use Symfony\Component\Routing\RouteCollection; +use Symfony\Component\Routing\RequestContext; +use Symfony\Component\Routing\Exception\InvalidParameterException; +use Symfony\Component\Routing\Exception\RouteNotFoundException; +use Symfony\Component\Routing\Exception\MissingMandatoryParametersException; +use Psr\Log\LoggerInterface; + +/** + * UrlGenerator can generate a URL or a path for any route in the RouteCollection + * based on the passed parameters. + * + * @author Fabien Potencier + * @author Tobias Schultze + * + * @api + */ +class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInterface +{ + /** + * @var RouteCollection + */ + protected $routes; + + /** + * @var RequestContext + */ + protected $context; + + /** + * @var bool|null + */ + protected $strictRequirements = true; + + /** + * @var LoggerInterface|null + */ + protected $logger; + + /** + * This array defines the characters (besides alphanumeric ones) that will not be percent-encoded in the path segment of the generated URL. + * + * PHP's rawurlencode() encodes all chars except "a-zA-Z0-9-._~" according to RFC 3986. But we want to allow some chars + * to be used in their literal form (reasons below). Other chars inside the path must of course be encoded, e.g. + * "?" and "#" (would be interpreted wrongly as query and fragment identifier), + * "'" and """ (are used as delimiters in HTML). + */ + protected $decodedChars = array( + // the slash can be used to designate a hierarchical structure and we want allow using it with this meaning + // some webservers don't allow the slash in encoded form in the path for security reasons anyway + // see http://stackoverflow.com/questions/4069002/http-400-if-2f-part-of-get-url-in-jboss + '%2F' => '/', + // the following chars are general delimiters in the URI specification but have only special meaning in the authority component + // so they can safely be used in the path in unencoded form + '%40' => '@', + '%3A' => ':', + // these chars are only sub-delimiters that have no predefined meaning and can therefore be used literally + // so URI producing applications can use these chars to delimit subcomponents in a path segment without being encoded for better readability + '%3B' => ';', + '%2C' => ',', + '%3D' => '=', + '%2B' => '+', + '%21' => '!', + '%2A' => '*', + '%7C' => '|', + ); + + /** + * Constructor. + * + * @param RouteCollection $routes A RouteCollection instance + * @param RequestContext $context The context + * @param LoggerInterface|null $logger A logger instance + * + * @api + */ + public function __construct(RouteCollection $routes, RequestContext $context, LoggerInterface $logger = null) + { + $this->routes = $routes; + $this->context = $context; + $this->logger = $logger; + } + + /** + * {@inheritdoc} + */ + public function setContext(RequestContext $context) + { + $this->context = $context; + } + + /** + * {@inheritdoc} + */ + public function getContext() + { + return $this->context; + } + + /** + * {@inheritdoc} + */ + public function setStrictRequirements($enabled) + { + $this->strictRequirements = null === $enabled ? null : (bool) $enabled; + } + + /** + * {@inheritdoc} + */ + public function isStrictRequirements() + { + return $this->strictRequirements; + } + + /** + * {@inheritdoc} + */ + public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH) + { + if (null === $route = $this->routes->get($name)) { + throw new RouteNotFoundException(sprintf('Unable to generate a URL for the named route "%s" as such route does not exist.', $name)); + } + + // the Route has a cache of its own and is not recompiled as long as it does not get modified + $compiledRoute = $route->compile(); + + return $this->doGenerate($compiledRoute->getVariables(), $route->getDefaults(), $route->getRequirements(), $compiledRoute->getTokens(), $parameters, $name, $referenceType, $compiledRoute->getHostTokens()); + } + + /** + * @throws MissingMandatoryParametersException When some parameters are missing that are mandatory for the route + * @throws InvalidParameterException When a parameter value for a placeholder is not correct because + * it does not match the requirement + */ + protected function doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $referenceType, $hostTokens) + { + $variables = array_flip($variables); + $mergedParams = array_replace($defaults, $this->context->getParameters(), $parameters); + + // all params must be given + if ($diff = array_diff_key($variables, $mergedParams)) { + throw new MissingMandatoryParametersException(sprintf('Some mandatory parameters are missing ("%s") to generate a URL for route "%s".', implode('", "', array_keys($diff)), $name)); + } + + $url = ''; + $optional = true; + foreach ($tokens as $token) { + if ('variable' === $token[0]) { + if (!$optional || !array_key_exists($token[3], $defaults) || null !== $mergedParams[$token[3]] && (string) $mergedParams[$token[3]] !== (string) $defaults[$token[3]]) { + // check requirement + if (null !== $this->strictRequirements && !preg_match('#^'.$token[2].'$#', $mergedParams[$token[3]])) { + $message = sprintf('Parameter "%s" for route "%s" must match "%s" ("%s" given) to generate a corresponding URL.', $token[3], $name, $token[2], $mergedParams[$token[3]]); + if ($this->strictRequirements) { + throw new InvalidParameterException($message); + } + + if ($this->logger) { + $this->logger->error($message); + } + + return; + } + + $url = $token[1].$mergedParams[$token[3]].$url; + $optional = false; + } + } else { + // static text + $url = $token[1].$url; + $optional = false; + } + } + + if ('' === $url) { + $url = '/'; + } + + // the contexts base URL is already encoded (see Symfony\Component\HttpFoundation\Request) + $url = strtr(rawurlencode($url), $this->decodedChars); + + // the path segments "." and ".." are interpreted as relative reference when resolving a URI; see http://tools.ietf.org/html/rfc3986#section-3.3 + // so we need to encode them as they are not used for this purpose here + // otherwise we would generate a URI that, when followed by a user agent (e.g. browser), does not match this route + $url = strtr($url, array('/../' => '/%2E%2E/', '/./' => '/%2E/')); + if ('/..' === substr($url, -3)) { + $url = substr($url, 0, -2).'%2E%2E'; + } elseif ('/.' === substr($url, -2)) { + $url = substr($url, 0, -1).'%2E'; + } + + $schemeAuthority = ''; + if ($host = $this->context->getHost()) { + $scheme = $this->context->getScheme(); + if (isset($requirements['_scheme']) && ($req = strtolower($requirements['_scheme'])) && $scheme !== $req) { + $referenceType = self::ABSOLUTE_URL; + $scheme = $req; + } + + if ($hostTokens) { + $routeHost = ''; + foreach ($hostTokens as $token) { + if ('variable' === $token[0]) { + if (null !== $this->strictRequirements && !preg_match('#^'.$token[2].'$#', $mergedParams[$token[3]])) { + $message = sprintf('Parameter "%s" for route "%s" must match "%s" ("%s" given) to generate a corresponding URL.', $token[3], $name, $token[2], $mergedParams[$token[3]]); + + if ($this->strictRequirements) { + throw new InvalidParameterException($message); + } + + if ($this->logger) { + $this->logger->error($message); + } + + return; + } + + $routeHost = $token[1].$mergedParams[$token[3]].$routeHost; + } else { + $routeHost = $token[1].$routeHost; + } + } + + if ($routeHost !== $host) { + $host = $routeHost; + if (self::ABSOLUTE_URL !== $referenceType) { + $referenceType = self::NETWORK_PATH; + } + } + } + + if (self::ABSOLUTE_URL === $referenceType || self::NETWORK_PATH === $referenceType) { + $port = ''; + if ('http' === $scheme && 80 != $this->context->getHttpPort()) { + $port = ':'.$this->context->getHttpPort(); + } elseif ('https' === $scheme && 443 != $this->context->getHttpsPort()) { + $port = ':'.$this->context->getHttpsPort(); + } + + $schemeAuthority = self::NETWORK_PATH === $referenceType ? '//' : "$scheme://"; + $schemeAuthority .= $host.$port; + } + } + + if (self::RELATIVE_PATH === $referenceType) { + $url = self::getRelativePath($this->context->getPathInfo(), $url); + } else { + $url = $schemeAuthority.$this->context->getBaseUrl().$url; + } + + // add a query string if needed + $extra = array_diff_key($parameters, $variables, $defaults); + if ($extra && $query = http_build_query($extra, '', '&')) { + $url .= '?'.$query; + } + + return $url; + } + + /** + * Returns the target path as relative reference from the base path. + * + * Only the URIs path component (no schema, host etc.) is relevant and must be given, starting with a slash. + * Both paths must be absolute and not contain relative parts. + * Relative URLs from one resource to another are useful when generating self-contained downloadable document archives. + * Furthermore, they can be used to reduce the link size in documents. + * + * Example target paths, given a base path of "/a/b/c/d": + * - "/a/b/c/d" -> "" + * - "/a/b/c/" -> "./" + * - "/a/b/" -> "../" + * - "/a/b/c/other" -> "other" + * - "/a/x/y" -> "../../x/y" + * + * @param string $basePath The base path + * @param string $targetPath The target path + * + * @return string The relative target path + */ + public static function getRelativePath($basePath, $targetPath) + { + if ($basePath === $targetPath) { + return ''; + } + + $sourceDirs = explode('/', isset($basePath[0]) && '/' === $basePath[0] ? substr($basePath, 1) : $basePath); + $targetDirs = explode('/', isset($targetPath[0]) && '/' === $targetPath[0] ? substr($targetPath, 1) : $targetPath); + array_pop($sourceDirs); + $targetFile = array_pop($targetDirs); + + foreach ($sourceDirs as $i => $dir) { + if (isset($targetDirs[$i]) && $dir === $targetDirs[$i]) { + unset($sourceDirs[$i], $targetDirs[$i]); + } else { + break; + } + } + + $targetDirs[] = $targetFile; + $path = str_repeat('../', count($sourceDirs)).implode('/', $targetDirs); + + // A reference to the same base directory or an empty subdirectory must be prefixed with "./". + // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used + // as the first segment of a relative-path reference, as it would be mistaken for a scheme name + // (see http://tools.ietf.org/html/rfc3986#section-4.2). + return '' === $path || '/' === $path[0] + || false !== ($colonPos = strpos($path, ':')) && ($colonPos < ($slashPos = strpos($path, '/')) || false === $slashPos) + ? "./$path" : $path; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php new file mode 100644 index 0000000..b89966d --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Generator; + +use Symfony\Component\Routing\Exception\InvalidParameterException; +use Symfony\Component\Routing\Exception\MissingMandatoryParametersException; +use Symfony\Component\Routing\Exception\RouteNotFoundException; +use Symfony\Component\Routing\RequestContextAwareInterface; + +/** + * UrlGeneratorInterface is the interface that all URL generator classes must implement. + * + * The constants in this interface define the different types of resource references that + * are declared in RFC 3986: http://tools.ietf.org/html/rfc3986 + * We are using the term "URL" instead of "URI" as this is more common in web applications + * and we do not need to distinguish them as the difference is mostly semantical and + * less technical. Generating URIs, i.e. representation-independent resource identifiers, + * is also possible. + * + * @author Fabien Potencier + * @author Tobias Schultze + * + * @api + */ +interface UrlGeneratorInterface extends RequestContextAwareInterface +{ + /** + * Generates an absolute URL, e.g. "http://example.com/dir/file". + */ + const ABSOLUTE_URL = true; + + /** + * Generates an absolute path, e.g. "/dir/file". + */ + const ABSOLUTE_PATH = false; + + /** + * Generates a relative path based on the current request path, e.g. "../parent-file". + * @see UrlGenerator::getRelativePath() + */ + const RELATIVE_PATH = 'relative'; + + /** + * Generates a network path, e.g. "//example.com/dir/file". + * Such reference reuses the current scheme but specifies the host. + */ + const NETWORK_PATH = 'network'; + + /** + * Generates a URL or path for a specific route based on the given parameters. + * + * Parameters that reference placeholders in the route pattern will substitute them in the + * path or host. Extra params are added as query string to the URL. + * + * When the passed reference type cannot be generated for the route because it requires a different + * host or scheme than the current one, the method will return a more comprehensive reference + * that includes the required params. For example, when you call this method with $referenceType = ABSOLUTE_PATH + * but the route requires the https scheme whereas the current scheme is http, it will instead return an + * ABSOLUTE_URL with the https scheme and the current host. This makes sure the generated URL matches + * the route in any case. + * + * If there is no route with the given name, the generator must throw the RouteNotFoundException. + * + * @param string $name The name of the route + * @param mixed $parameters An array of parameters + * @param bool|string $referenceType The type of reference to be generated (one of the constants) + * + * @return string The generated URL + * + * @throws RouteNotFoundException If the named route doesn't exist + * @throws MissingMandatoryParametersException When some parameters are missing that are mandatory for the route + * @throws InvalidParameterException When a parameter value for a placeholder is not correct because + * it does not match the requirement + * + * @api + */ + public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH); +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/LICENSE b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/LICENSE new file mode 100644 index 0000000..0b3292c --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2014 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationClassLoader.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationClassLoader.php new file mode 100644 index 0000000..f0777a0 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationClassLoader.php @@ -0,0 +1,246 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Loader; + +use Doctrine\Common\Annotations\Reader; +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Routing\Route; +use Symfony\Component\Routing\RouteCollection; +use Symfony\Component\Config\Loader\LoaderInterface; +use Symfony\Component\Config\Loader\LoaderResolverInterface; + +/** + * AnnotationClassLoader loads routing information from a PHP class and its methods. + * + * You need to define an implementation for the getRouteDefaults() method. Most of the + * time, this method should define some PHP callable to be called for the route + * (a controller in MVC speak). + * + * The @Route annotation can be set on the class (for global parameters), + * and on each method. + * + * The @Route annotation main value is the route path. The annotation also + * recognizes several parameters: requirements, options, defaults, schemes, + * methods, host, and name. The name parameter is mandatory. + * Here is an example of how you should be able to use it: + * + * /** + * * @Route("/Blog") + * * / + * class Blog + * { + * /** + * * @Route("/", name="blog_index") + * * / + * public function index() + * { + * } + * + * /** + * * @Route("/{id}", name="blog_post", requirements = {"id" = "\d+"}) + * * / + * public function show() + * { + * } + * } + * + * @author Fabien Potencier + */ +abstract class AnnotationClassLoader implements LoaderInterface +{ + /** + * @var Reader + */ + protected $reader; + + /** + * @var string + */ + protected $routeAnnotationClass = 'Symfony\\Component\\Routing\\Annotation\\Route'; + + /** + * @var int + */ + protected $defaultRouteIndex = 0; + + /** + * Constructor. + * + * @param Reader $reader + */ + public function __construct(Reader $reader) + { + $this->reader = $reader; + } + + /** + * Sets the annotation class to read route properties from. + * + * @param string $class A fully-qualified class name + */ + public function setRouteAnnotationClass($class) + { + $this->routeAnnotationClass = $class; + } + + /** + * Loads from annotations from a class. + * + * @param string $class A class name + * @param string|null $type The resource type + * + * @return RouteCollection A RouteCollection instance + * + * @throws \InvalidArgumentException When route can't be parsed + */ + public function load($class, $type = null) + { + if (!class_exists($class)) { + throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class)); + } + + $globals = array( + 'path' => '', + 'requirements' => array(), + 'options' => array(), + 'defaults' => array(), + 'schemes' => array(), + 'methods' => array(), + 'host' => '', + ); + + $class = new \ReflectionClass($class); + if ($class->isAbstract()) { + throw new \InvalidArgumentException(sprintf('Annotations from class "%s" cannot be read as it is abstract.', $class)); + } + + if ($annot = $this->reader->getClassAnnotation($class, $this->routeAnnotationClass)) { + // for BC reasons + if (null !== $annot->getPath()) { + $globals['path'] = $annot->getPath(); + } elseif (null !== $annot->getPattern()) { + $globals['path'] = $annot->getPattern(); + } + + if (null !== $annot->getRequirements()) { + $globals['requirements'] = $annot->getRequirements(); + } + + if (null !== $annot->getOptions()) { + $globals['options'] = $annot->getOptions(); + } + + if (null !== $annot->getDefaults()) { + $globals['defaults'] = $annot->getDefaults(); + } + + if (null !== $annot->getSchemes()) { + $globals['schemes'] = $annot->getSchemes(); + } + + if (null !== $annot->getMethods()) { + $globals['methods'] = $annot->getMethods(); + } + + if (null !== $annot->getHost()) { + $globals['host'] = $annot->getHost(); + } + } + + $collection = new RouteCollection(); + $collection->addResource(new FileResource($class->getFileName())); + + foreach ($class->getMethods() as $method) { + $this->defaultRouteIndex = 0; + foreach ($this->reader->getMethodAnnotations($method) as $annot) { + if ($annot instanceof $this->routeAnnotationClass) { + $this->addRoute($collection, $annot, $globals, $class, $method); + } + } + } + + return $collection; + } + + protected function addRoute(RouteCollection $collection, $annot, $globals, \ReflectionClass $class, \ReflectionMethod $method) + { + $name = $annot->getName(); + if (null === $name) { + $name = $this->getDefaultRouteName($class, $method); + } + + $defaults = array_replace($globals['defaults'], $annot->getDefaults()); + foreach ($method->getParameters() as $param) { + if (!isset($defaults[$param->getName()]) && $param->isOptional()) { + $defaults[$param->getName()] = $param->getDefaultValue(); + } + } + $requirements = array_replace($globals['requirements'], $annot->getRequirements()); + $options = array_replace($globals['options'], $annot->getOptions()); + $schemes = array_replace($globals['schemes'], $annot->getSchemes()); + $methods = array_replace($globals['methods'], $annot->getMethods()); + + $host = $annot->getHost(); + if (null === $host) { + $host = $globals['host']; + } + + $route = new Route($globals['path'].$annot->getPath(), $defaults, $requirements, $options, $host, $schemes, $methods); + + $this->configureRoute($route, $class, $method, $annot); + + $collection->add($name, $route); + } + + /** + * {@inheritdoc} + */ + public function supports($resource, $type = null) + { + return is_string($resource) && preg_match('/^(?:\\\\?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)+$/', $resource) && (!$type || 'annotation' === $type); + } + + /** + * {@inheritdoc} + */ + public function setResolver(LoaderResolverInterface $resolver) + { + } + + /** + * {@inheritdoc} + */ + public function getResolver() + { + } + + /** + * Gets the default route name for a class method. + * + * @param \ReflectionClass $class + * @param \ReflectionMethod $method + * + * @return string + */ + protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) + { + $name = strtolower(str_replace('\\', '_', $class->name).'_'.$method->name); + if ($this->defaultRouteIndex > 0) { + $name .= '_'.$this->defaultRouteIndex; + } + $this->defaultRouteIndex++; + + return $name; + } + + abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot); +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php new file mode 100644 index 0000000..abd68ed --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Loader; + +use Symfony\Component\Routing\RouteCollection; +use Symfony\Component\Config\Resource\DirectoryResource; + +/** + * AnnotationDirectoryLoader loads routing information from annotations set + * on PHP classes and methods. + * + * @author Fabien Potencier + */ +class AnnotationDirectoryLoader extends AnnotationFileLoader +{ + /** + * Loads from annotations from a directory. + * + * @param string $path A directory path + * @param string|null $type The resource type + * + * @return RouteCollection A RouteCollection instance + * + * @throws \InvalidArgumentException When the directory does not exist or its routes cannot be parsed + */ + public function load($path, $type = null) + { + $dir = $this->locator->locate($path); + + $collection = new RouteCollection(); + $collection->addResource(new DirectoryResource($dir, '/\.php$/')); + $files = iterator_to_array(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir), \RecursiveIteratorIterator::LEAVES_ONLY)); + usort($files, function (\SplFileInfo $a, \SplFileInfo $b) { + return (string) $a > (string) $b ? 1 : -1; + }); + + foreach ($files as $file) { + if (!$file->isFile() || '.php' !== substr($file->getFilename(), -4)) { + continue; + } + + if ($class = $this->findClass($file)) { + $refl = new \ReflectionClass($class); + if ($refl->isAbstract()) { + continue; + } + + $collection->addCollection($this->loader->load($class, $type)); + } + } + + return $collection; + } + + /** + * {@inheritdoc} + */ + public function supports($resource, $type = null) + { + try { + $path = $this->locator->locate($resource); + } catch (\Exception $e) { + return false; + } + + return is_string($resource) && is_dir($path) && (!$type || 'annotation' === $type); + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationFileLoader.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationFileLoader.php new file mode 100644 index 0000000..e54a018 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationFileLoader.php @@ -0,0 +1,121 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Loader; + +use Symfony\Component\Routing\RouteCollection; +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Config\Loader\FileLoader; +use Symfony\Component\Config\FileLocatorInterface; + +/** + * AnnotationFileLoader loads routing information from annotations set + * on a PHP class and its methods. + * + * @author Fabien Potencier + */ +class AnnotationFileLoader extends FileLoader +{ + protected $loader; + + /** + * Constructor. + * + * @param FileLocatorInterface $locator A FileLocator instance + * @param AnnotationClassLoader $loader An AnnotationClassLoader instance + * + * @throws \RuntimeException + */ + public function __construct(FileLocatorInterface $locator, AnnotationClassLoader $loader) + { + if (!function_exists('token_get_all')) { + throw new \RuntimeException('The Tokenizer extension is required for the routing annotation loaders.'); + } + + parent::__construct($locator); + + $this->loader = $loader; + } + + /** + * Loads from annotations from a file. + * + * @param string $file A PHP file path + * @param string|null $type The resource type + * + * @return RouteCollection A RouteCollection instance + * + * @throws \InvalidArgumentException When the file does not exist or its routes cannot be parsed + */ + public function load($file, $type = null) + { + $path = $this->locator->locate($file); + + $collection = new RouteCollection(); + if ($class = $this->findClass($path)) { + $collection->addResource(new FileResource($path)); + $collection->addCollection($this->loader->load($class, $type)); + } + + return $collection; + } + + /** + * {@inheritdoc} + */ + public function supports($resource, $type = null) + { + return is_string($resource) && 'php' === pathinfo($resource, PATHINFO_EXTENSION) && (!$type || 'annotation' === $type); + } + + /** + * Returns the full class name for the first class in the file. + * + * @param string $file A PHP file path + * + * @return string|false Full class name if found, false otherwise + */ + protected function findClass($file) + { + $class = false; + $namespace = false; + $tokens = token_get_all(file_get_contents($file)); + for ($i = 0, $count = count($tokens); $i < $count; $i++) { + $token = $tokens[$i]; + + if (!is_array($token)) { + continue; + } + + if (true === $class && T_STRING === $token[0]) { + return $namespace.'\\'.$token[1]; + } + + if (true === $namespace && T_STRING === $token[0]) { + $namespace = ''; + do { + $namespace .= $token[1]; + $token = $tokens[++$i]; + } while ($i < $count && is_array($token) && in_array($token[0], array(T_NS_SEPARATOR, T_STRING))); + } + + if (T_CLASS === $token[0]) { + $class = true; + } + + if (T_NAMESPACE === $token[0]) { + $namespace = true; + } + } + + return false; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/ClosureLoader.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/ClosureLoader.php new file mode 100644 index 0000000..8212c29 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/ClosureLoader.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Loader; + +use Symfony\Component\Config\Loader\Loader; +use Symfony\Component\Routing\RouteCollection; + +/** + * ClosureLoader loads routes from a PHP closure. + * + * The Closure must return a RouteCollection instance. + * + * @author Fabien Potencier + * + * @api + */ +class ClosureLoader extends Loader +{ + /** + * Loads a Closure. + * + * @param \Closure $closure A Closure + * @param string|null $type The resource type + * + * @return RouteCollection A RouteCollection instance + * + * @api + */ + public function load($closure, $type = null) + { + return call_user_func($closure); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function supports($resource, $type = null) + { + return $resource instanceof \Closure && (!$type || 'closure' === $type); + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/PhpFileLoader.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/PhpFileLoader.php new file mode 100644 index 0000000..98b7efb --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/PhpFileLoader.php @@ -0,0 +1,62 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Loader; + +use Symfony\Component\Config\Loader\FileLoader; +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Routing\RouteCollection; + +/** + * PhpFileLoader loads routes from a PHP file. + * + * The file must return a RouteCollection instance. + * + * @author Fabien Potencier + * + * @api + */ +class PhpFileLoader extends FileLoader +{ + /** + * Loads a PHP file. + * + * @param string $file A PHP file path + * @param string|null $type The resource type + * + * @return RouteCollection A RouteCollection instance + * + * @api + */ + public function load($file, $type = null) + { + // the loader variable is exposed to the included file below + $loader = $this; + + $path = $this->locator->locate($file); + $this->setCurrentDir(dirname($path)); + + $collection = include $path; + $collection->addResource(new FileResource($path)); + + return $collection; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function supports($resource, $type = null) + { + return is_string($resource) && 'php' === pathinfo($resource, PATHINFO_EXTENSION) && (!$type || 'php' === $type); + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/XmlFileLoader.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/XmlFileLoader.php new file mode 100644 index 0000000..74593f3 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/XmlFileLoader.php @@ -0,0 +1,249 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Loader; + +use Symfony\Component\Routing\RouteCollection; +use Symfony\Component\Routing\Route; +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Config\Loader\FileLoader; +use Symfony\Component\Config\Util\XmlUtils; + +/** + * XmlFileLoader loads XML routing files. + * + * @author Fabien Potencier + * @author Tobias Schultze + * + * @api + */ +class XmlFileLoader extends FileLoader +{ + const NAMESPACE_URI = 'http://symfony.com/schema/routing'; + const SCHEME_PATH = '/schema/routing/routing-1.0.xsd'; + + /** + * Loads an XML file. + * + * @param string $file An XML file path + * @param string|null $type The resource type + * + * @return RouteCollection A RouteCollection instance + * + * @throws \InvalidArgumentException When the file cannot be loaded or when the XML cannot be + * parsed because it does not validate against the scheme. + * + * @api + */ + public function load($file, $type = null) + { + $path = $this->locator->locate($file); + + $xml = $this->loadFile($path); + + $collection = new RouteCollection(); + $collection->addResource(new FileResource($path)); + + // process routes and imports + foreach ($xml->documentElement->childNodes as $node) { + if (!$node instanceof \DOMElement) { + continue; + } + + $this->parseNode($collection, $node, $path, $file); + } + + return $collection; + } + + /** + * Parses a node from a loaded XML file. + * + * @param RouteCollection $collection Collection to associate with the node + * @param \DOMElement $node Element to parse + * @param string $path Full path of the XML file being processed + * @param string $file Loaded file name + * + * @throws \InvalidArgumentException When the XML is invalid + */ + protected function parseNode(RouteCollection $collection, \DOMElement $node, $path, $file) + { + if (self::NAMESPACE_URI !== $node->namespaceURI) { + return; + } + + switch ($node->localName) { + case 'route': + $this->parseRoute($collection, $node, $path); + break; + case 'import': + $this->parseImport($collection, $node, $path, $file); + break; + default: + throw new \InvalidArgumentException(sprintf('Unknown tag "%s" used in file "%s". Expected "route" or "import".', $node->localName, $path)); + } + } + + /** + * {@inheritdoc} + * + * @api + */ + public function supports($resource, $type = null) + { + return is_string($resource) && 'xml' === pathinfo($resource, PATHINFO_EXTENSION) && (!$type || 'xml' === $type); + } + + /** + * Parses a route and adds it to the RouteCollection. + * + * @param RouteCollection $collection RouteCollection instance + * @param \DOMElement $node Element to parse that represents a Route + * @param string $path Full path of the XML file being processed + * + * @throws \InvalidArgumentException When the XML is invalid + */ + protected function parseRoute(RouteCollection $collection, \DOMElement $node, $path) + { + if ('' === ($id = $node->getAttribute('id')) || (!$node->hasAttribute('pattern') && !$node->hasAttribute('path'))) { + throw new \InvalidArgumentException(sprintf('The element in file "%s" must have an "id" and a "path" attribute.', $path)); + } + + if ($node->hasAttribute('pattern')) { + if ($node->hasAttribute('path')) { + throw new \InvalidArgumentException(sprintf('The element in file "%s" cannot define both a "path" and a "pattern" attribute. Use only "path".', $path)); + } + + $node->setAttribute('path', $node->getAttribute('pattern')); + $node->removeAttribute('pattern'); + } + + $schemes = preg_split('/[\s,\|]++/', $node->getAttribute('schemes'), -1, PREG_SPLIT_NO_EMPTY); + $methods = preg_split('/[\s,\|]++/', $node->getAttribute('methods'), -1, PREG_SPLIT_NO_EMPTY); + + list($defaults, $requirements, $options) = $this->parseConfigs($node, $path); + + $route = new Route($node->getAttribute('path'), $defaults, $requirements, $options, $node->getAttribute('host'), $schemes, $methods); + $collection->add($id, $route); + } + + /** + * Parses an import and adds the routes in the resource to the RouteCollection. + * + * @param RouteCollection $collection RouteCollection instance + * @param \DOMElement $node Element to parse that represents a Route + * @param string $path Full path of the XML file being processed + * @param string $file Loaded file name + * + * @throws \InvalidArgumentException When the XML is invalid + */ + protected function parseImport(RouteCollection $collection, \DOMElement $node, $path, $file) + { + if ('' === $resource = $node->getAttribute('resource')) { + throw new \InvalidArgumentException(sprintf('The element in file "%s" must have a "resource" attribute.', $path)); + } + + $type = $node->getAttribute('type'); + $prefix = $node->getAttribute('prefix'); + $host = $node->hasAttribute('host') ? $node->getAttribute('host') : null; + $schemes = $node->hasAttribute('schemes') ? preg_split('/[\s,\|]++/', $node->getAttribute('schemes'), -1, PREG_SPLIT_NO_EMPTY) : null; + $methods = $node->hasAttribute('methods') ? preg_split('/[\s,\|]++/', $node->getAttribute('methods'), -1, PREG_SPLIT_NO_EMPTY) : null; + + list($defaults, $requirements, $options) = $this->parseConfigs($node, $path); + + $this->setCurrentDir(dirname($path)); + + $subCollection = $this->import($resource, ('' !== $type ? $type : null), false, $file); + /* @var $subCollection RouteCollection */ + $subCollection->addPrefix($prefix); + if (null !== $host) { + $subCollection->setHost($host); + } + if (null !== $schemes) { + $subCollection->setSchemes($schemes); + } + if (null !== $methods) { + $subCollection->setMethods($methods); + } + $subCollection->addDefaults($defaults); + $subCollection->addRequirements($requirements); + $subCollection->addOptions($options); + + $collection->addCollection($subCollection); + } + + /** + * Loads an XML file. + * + * @param string $file An XML file path + * + * @return \DOMDocument + * + * @throws \InvalidArgumentException When loading of XML file fails because of syntax errors + * or when the XML structure is not as expected by the scheme - + * see validate() + */ + protected function loadFile($file) + { + return XmlUtils::loadFile($file, __DIR__.static::SCHEME_PATH); + } + + /** + * Parses the config elements (default, requirement, option). + * + * @param \DOMElement $node Element to parse that contains the configs + * @param string $path Full path of the XML file being processed + * + * @return array An array with the defaults as first item, requirements as second and options as third. + * + * @throws \InvalidArgumentException When the XML is invalid + */ + private function parseConfigs(\DOMElement $node, $path) + { + $defaults = array(); + $requirements = array(); + $options = array(); + + foreach ($node->getElementsByTagNameNS(self::NAMESPACE_URI, '*') as $n) { + switch ($n->localName) { + case 'default': + if ($this->isElementValueNull($n)) { + $defaults[$n->getAttribute('key')] = null; + } else { + $defaults[$n->getAttribute('key')] = trim($n->textContent); + } + + break; + case 'requirement': + $requirements[$n->getAttribute('key')] = trim($n->textContent); + break; + case 'option': + $options[$n->getAttribute('key')] = trim($n->textContent); + break; + default: + throw new \InvalidArgumentException(sprintf('Unknown tag "%s" used in file "%s". Expected "default", "requirement" or "option".', $n->localName, $path)); + } + } + + return array($defaults, $requirements, $options); + } + + private function isElementValueNull(\DOMElement $element) + { + $namespaceUri = 'http://www.w3.org/2001/XMLSchema-instance'; + + if (!$element->hasAttributeNS($namespaceUri, 'nil')) { + return false; + } + + return 'true' === $element->getAttributeNS($namespaceUri, 'nil') || '1' === $element->getAttributeNS($namespaceUri, 'nil'); + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/YamlFileLoader.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/YamlFileLoader.php new file mode 100644 index 0000000..9deea7f --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/YamlFileLoader.php @@ -0,0 +1,212 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Loader; + +use Symfony\Component\Routing\RouteCollection; +use Symfony\Component\Routing\Route; +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Yaml\Parser as YamlParser; +use Symfony\Component\Config\Loader\FileLoader; + +/** + * YamlFileLoader loads Yaml routing files. + * + * @author Fabien Potencier + * @author Tobias Schultze + * + * @api + */ +class YamlFileLoader extends FileLoader +{ + private static $availableKeys = array( + 'resource', 'type', 'prefix', 'pattern', 'path', 'host', 'schemes', 'methods', 'defaults', 'requirements', 'options', + ); + private $yamlParser; + + /** + * Loads a Yaml file. + * + * @param string $file A Yaml file path + * @param string|null $type The resource type + * + * @return RouteCollection A RouteCollection instance + * + * @throws \InvalidArgumentException When a route can't be parsed because YAML is invalid + * + * @api + */ + public function load($file, $type = null) + { + $path = $this->locator->locate($file); + + if (!stream_is_local($path)) { + throw new \InvalidArgumentException(sprintf('This is not a local file "%s".', $path)); + } + + if (!file_exists($path)) { + throw new \InvalidArgumentException(sprintf('File "%s" not found.', $path)); + } + + if (null === $this->yamlParser) { + $this->yamlParser = new YamlParser(); + } + + $config = $this->yamlParser->parse(file_get_contents($path)); + + $collection = new RouteCollection(); + $collection->addResource(new FileResource($path)); + + // empty file + if (null === $config) { + return $collection; + } + + // not an array + if (!is_array($config)) { + throw new \InvalidArgumentException(sprintf('The file "%s" must contain a YAML array.', $path)); + } + + foreach ($config as $name => $config) { + if (isset($config['pattern'])) { + if (isset($config['path'])) { + throw new \InvalidArgumentException(sprintf('The file "%s" cannot define both a "path" and a "pattern" attribute. Use only "path".', $path)); + } + + $config['path'] = $config['pattern']; + unset($config['pattern']); + } + + $this->validate($config, $name, $path); + + if (isset($config['resource'])) { + $this->parseImport($collection, $config, $path, $file); + } else { + $this->parseRoute($collection, $name, $config, $path); + } + } + + return $collection; + } + + /** + * {@inheritdoc} + * + * @api + */ + public function supports($resource, $type = null) + { + return is_string($resource) && 'yml' === pathinfo($resource, PATHINFO_EXTENSION) && (!$type || 'yaml' === $type); + } + + /** + * Parses a route and adds it to the RouteCollection. + * + * @param RouteCollection $collection A RouteCollection instance + * @param string $name Route name + * @param array $config Route definition + * @param string $path Full path of the YAML file being processed + */ + protected function parseRoute(RouteCollection $collection, $name, array $config, $path) + { + $defaults = isset($config['defaults']) ? $config['defaults'] : array(); + $requirements = isset($config['requirements']) ? $config['requirements'] : array(); + $options = isset($config['options']) ? $config['options'] : array(); + $host = isset($config['host']) ? $config['host'] : ''; + $schemes = isset($config['schemes']) ? $config['schemes'] : array(); + $methods = isset($config['methods']) ? $config['methods'] : array(); + + $route = new Route($config['path'], $defaults, $requirements, $options, $host, $schemes, $methods); + + $collection->add($name, $route); + } + + /** + * Parses an import and adds the routes in the resource to the RouteCollection. + * + * @param RouteCollection $collection A RouteCollection instance + * @param array $config Route definition + * @param string $path Full path of the YAML file being processed + * @param string $file Loaded file name + */ + protected function parseImport(RouteCollection $collection, array $config, $path, $file) + { + $type = isset($config['type']) ? $config['type'] : null; + $prefix = isset($config['prefix']) ? $config['prefix'] : ''; + $defaults = isset($config['defaults']) ? $config['defaults'] : array(); + $requirements = isset($config['requirements']) ? $config['requirements'] : array(); + $options = isset($config['options']) ? $config['options'] : array(); + $host = isset($config['host']) ? $config['host'] : null; + $schemes = isset($config['schemes']) ? $config['schemes'] : null; + $methods = isset($config['methods']) ? $config['methods'] : null; + + $this->setCurrentDir(dirname($path)); + + $subCollection = $this->import($config['resource'], $type, false, $file); + /* @var $subCollection RouteCollection */ + $subCollection->addPrefix($prefix); + if (null !== $host) { + $subCollection->setHost($host); + } + if (null !== $schemes) { + $subCollection->setSchemes($schemes); + } + if (null !== $methods) { + $subCollection->setMethods($methods); + } + $subCollection->addDefaults($defaults); + $subCollection->addRequirements($requirements); + $subCollection->addOptions($options); + + $collection->addCollection($subCollection); + } + + /** + * Validates the route configuration. + * + * @param array $config A resource config + * @param string $name The config key + * @param string $path The loaded file path + * + * @throws \InvalidArgumentException If one of the provided config keys is not supported, + * something is missing or the combination is nonsense + */ + protected function validate($config, $name, $path) + { + if (!is_array($config)) { + throw new \InvalidArgumentException(sprintf('The definition of "%s" in "%s" must be a YAML array.', $name, $path)); + } + if ($extraKeys = array_diff(array_keys($config), self::$availableKeys)) { + throw new \InvalidArgumentException(sprintf( + 'The routing file "%s" contains unsupported keys for "%s": "%s". Expected one of: "%s".', + $path, $name, implode('", "', $extraKeys), implode('", "', self::$availableKeys) + )); + } + if (isset($config['resource']) && isset($config['path'])) { + throw new \InvalidArgumentException(sprintf( + 'The routing file "%s" must not specify both the "resource" key and the "path" key for "%s". Choose between an import and a route definition.', + $path, $name + )); + } + if (!isset($config['resource']) && isset($config['type'])) { + throw new \InvalidArgumentException(sprintf( + 'The "type" key for the route definition "%s" in "%s" is unsupported. It is only available for imports in combination with the "resource" key.', + $name, $path + )); + } + if (!isset($config['resource']) && !isset($config['path'])) { + throw new \InvalidArgumentException(sprintf( + 'You must define a "path" for the route "%s" in file "%s".', + $name, $path + )); + } + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd new file mode 100644 index 0000000..daea814 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php new file mode 100644 index 0000000..55aac6b --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php @@ -0,0 +1,118 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Matcher; + +use Symfony\Component\Routing\Exception\MethodNotAllowedException; + +/** + * ApacheUrlMatcher matches URL based on Apache mod_rewrite matching (see ApacheMatcherDumper). + * + * @author Fabien Potencier + * @author Arnaud Le Blanc + */ +class ApacheUrlMatcher extends UrlMatcher +{ + /** + * Tries to match a URL based on Apache mod_rewrite matching. + * + * Returns false if no route matches the URL. + * + * @param string $pathinfo The pathinfo to be parsed + * + * @return array An array of parameters + * + * @throws MethodNotAllowedException If the current method is not allowed + */ + public function match($pathinfo) + { + $parameters = array(); + $defaults = array(); + $allow = array(); + $route = null; + + foreach ($this->denormalizeValues($_SERVER) as $key => $value) { + $name = $key; + + // skip non-routing variables + // this improves performance when $_SERVER contains many usual + // variables like HTTP_*, DOCUMENT_ROOT, REQUEST_URI, ... + if (false === strpos($name, '_ROUTING_')) { + continue; + } + + while (0 === strpos($name, 'REDIRECT_')) { + $name = substr($name, 9); + } + + // expect _ROUTING__ + // or _ROUTING_ + + if (0 !== strpos($name, '_ROUTING_')) { + continue; + } + if (false !== $pos = strpos($name, '_', 9)) { + $type = substr($name, 9, $pos-9); + $name = substr($name, $pos+1); + } else { + $type = substr($name, 9); + } + + if ('param' === $type) { + if ('' !== $value) { + $parameters[$name] = $value; + } + } elseif ('default' === $type) { + $defaults[$name] = $value; + } elseif ('route' === $type) { + $route = $value; + } elseif ('allow' === $type) { + $allow[] = $name; + } + + unset($_SERVER[$key]); + } + + if (null !== $route) { + $parameters['_route'] = $route; + + return $this->mergeDefaults($parameters, $defaults); + } elseif (0 < count($allow)) { + throw new MethodNotAllowedException($allow); + } else { + return parent::match($pathinfo); + } + } + + /** + * Denormalizes an array of values. + * + * @param string[] $values + * + * @return array + */ + private function denormalizeValues(array $values) + { + $normalizedValues = array(); + foreach ($values as $key => $value) { + if (preg_match('~^(.*)\[(\d+)\]$~', $key, $matches)) { + if (!isset($normalizedValues[$matches[1]])) { + $normalizedValues[$matches[1]] = array(); + } + $normalizedValues[$matches[1]][(int) $matches[2]] = $value; + } else { + $normalizedValues[$key] = $value; + } + } + + return $normalizedValues; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php new file mode 100644 index 0000000..9ff7449 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php @@ -0,0 +1,273 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Matcher\Dumper; + +use Symfony\Component\Routing\Route; + +/** + * Dumps a set of Apache mod_rewrite rules. + * + * @author Fabien Potencier + * @author Kris Wallsmith + */ +class ApacheMatcherDumper extends MatcherDumper +{ + /** + * Dumps a set of Apache mod_rewrite rules. + * + * Available options: + * + * * script_name: The script name (app.php by default) + * * base_uri: The base URI ("" by default) + * + * @param array $options An array of options + * + * @return string A string to be used as Apache rewrite rules + * + * @throws \LogicException When the route regex is invalid + */ + public function dump(array $options = array()) + { + $options = array_merge(array( + 'script_name' => 'app.php', + 'base_uri' => '', + ), $options); + + $options['script_name'] = self::escape($options['script_name'], ' ', '\\'); + + $rules = array("# skip \"real\" requests\nRewriteCond %{REQUEST_FILENAME} -f\nRewriteRule .* - [QSA,L]"); + $methodVars = array(); + $hostRegexUnique = 0; + $prevHostRegex = ''; + + foreach ($this->getRoutes()->all() as $name => $route) { + $compiledRoute = $route->compile(); + $hostRegex = $compiledRoute->getHostRegex(); + + if (null !== $hostRegex && $prevHostRegex !== $hostRegex) { + $prevHostRegex = $hostRegex; + $hostRegexUnique++; + + $rule = array(); + + $regex = $this->regexToApacheRegex($hostRegex); + $regex = self::escape($regex, ' ', '\\'); + + $rule[] = sprintf('RewriteCond %%{HTTP:Host} %s', $regex); + + $variables = array(); + $variables[] = sprintf('E=__ROUTING_host_%s:1', $hostRegexUnique); + + foreach ($compiledRoute->getHostVariables() as $i => $variable) { + $variables[] = sprintf('E=__ROUTING_host_%s_%s:%%%d', $hostRegexUnique, $variable, $i+1); + } + + $variables = implode(',', $variables); + + $rule[] = sprintf('RewriteRule .? - [%s]', $variables); + + $rules[] = implode("\n", $rule); + } + + $rules[] = $this->dumpRoute($name, $route, $options, $hostRegexUnique); + + if ($req = $route->getRequirement('_method')) { + $methods = explode('|', strtoupper($req)); + $methodVars = array_merge($methodVars, $methods); + } + } + if (0 < count($methodVars)) { + $rule = array('# 405 Method Not Allowed'); + $methodVars = array_values(array_unique($methodVars)); + if (in_array('GET', $methodVars) && !in_array('HEAD', $methodVars)) { + $methodVars[] = 'HEAD'; + } + foreach ($methodVars as $i => $methodVar) { + $rule[] = sprintf('RewriteCond %%{ENV:_ROUTING__allow_%s} =1%s', $methodVar, isset($methodVars[$i + 1]) ? ' [OR]' : ''); + } + $rule[] = sprintf('RewriteRule .* %s [QSA,L]', $options['script_name']); + + $rules[] = implode("\n", $rule); + } + + return implode("\n\n", $rules)."\n"; + } + + /** + * Dumps a single route + * + * @param string $name Route name + * @param Route $route The route + * @param array $options Options + * @param bool $hostRegexUnique Unique identifier for the host regex + * + * @return string The compiled route + */ + private function dumpRoute($name, $route, array $options, $hostRegexUnique) + { + $compiledRoute = $route->compile(); + + // prepare the apache regex + $regex = $this->regexToApacheRegex($compiledRoute->getRegex()); + $regex = '^'.self::escape(preg_quote($options['base_uri']).substr($regex, 1), ' ', '\\'); + + $methods = $this->getRouteMethods($route); + + $hasTrailingSlash = (!$methods || in_array('HEAD', $methods)) && '/$' === substr($regex, -2) && '^/$' !== $regex; + + $variables = array('E=_ROUTING_route:'.$name); + foreach ($compiledRoute->getHostVariables() as $variable) { + $variables[] = sprintf('E=_ROUTING_param_%s:%%{ENV:__ROUTING_host_%s_%s}', $variable, $hostRegexUnique, $variable); + } + foreach ($compiledRoute->getPathVariables() as $i => $variable) { + $variables[] = 'E=_ROUTING_param_'.$variable.':%'.($i + 1); + } + foreach ($this->normalizeValues($route->getDefaults()) as $key => $value) { + $variables[] = 'E=_ROUTING_default_'.$key.':'.strtr($value, array( + ':' => '\\:', + '=' => '\\=', + '\\' => '\\\\', + ' ' => '\\ ', + )); + } + $variables = implode(',', $variables); + + $rule = array("# $name"); + + // method mismatch + if (0 < count($methods)) { + $allow = array(); + foreach ($methods as $method) { + $allow[] = 'E=_ROUTING_allow_'.$method.':1'; + } + + if ($compiledRoute->getHostRegex()) { + $rule[] = sprintf("RewriteCond %%{ENV:__ROUTING_host_%s} =1", $hostRegexUnique); + } + + $rule[] = "RewriteCond %{REQUEST_URI} $regex"; + $rule[] = sprintf("RewriteCond %%{REQUEST_METHOD} !^(%s)$ [NC]", implode('|', $methods)); + $rule[] = sprintf('RewriteRule .* - [S=%d,%s]', $hasTrailingSlash ? 2 : 1, implode(',', $allow)); + } + + // redirect with trailing slash appended + if ($hasTrailingSlash) { + if ($compiledRoute->getHostRegex()) { + $rule[] = sprintf("RewriteCond %%{ENV:__ROUTING_host_%s} =1", $hostRegexUnique); + } + + $rule[] = 'RewriteCond %{REQUEST_URI} '.substr($regex, 0, -2).'$'; + $rule[] = 'RewriteRule .* $0/ [QSA,L,R=301]'; + } + + // the main rule + + if ($compiledRoute->getHostRegex()) { + $rule[] = sprintf("RewriteCond %%{ENV:__ROUTING_host_%s} =1", $hostRegexUnique); + } + + $rule[] = "RewriteCond %{REQUEST_URI} $regex"; + $rule[] = "RewriteRule .* {$options['script_name']} [QSA,L,$variables]"; + + return implode("\n", $rule); + } + + /** + * Returns methods allowed for a route + * + * @param Route $route The route + * + * @return array The methods + */ + private function getRouteMethods(Route $route) + { + $methods = array(); + if ($req = $route->getRequirement('_method')) { + $methods = explode('|', strtoupper($req)); + // GET and HEAD are equivalent + if (in_array('GET', $methods) && !in_array('HEAD', $methods)) { + $methods[] = 'HEAD'; + } + } + + return $methods; + } + + /** + * Converts a regex to make it suitable for mod_rewrite + * + * @param string $regex The regex + * + * @return string The converted regex + */ + private function regexToApacheRegex($regex) + { + $regexPatternEnd = strrpos($regex, $regex[0]); + + return preg_replace('/\?P<.+?>/', '', substr($regex, 1, $regexPatternEnd - 1)); + } + + /** + * Escapes a string. + * + * @param string $string The string to be escaped + * @param string $char The character to be escaped + * @param string $with The character to be used for escaping + * + * @return string The escaped string + */ + private static function escape($string, $char, $with) + { + $escaped = false; + $output = ''; + foreach (str_split($string) as $symbol) { + if ($escaped) { + $output .= $symbol; + $escaped = false; + continue; + } + if ($symbol === $char) { + $output .= $with.$char; + continue; + } + if ($symbol === $with) { + $escaped = true; + } + $output .= $symbol; + } + + return $output; + } + + /** + * Normalizes an array of values. + * + * @param array $values + * + * @return string[] + */ + private function normalizeValues(array $values) + { + $normalizedValues = array(); + foreach ($values as $key => $value) { + if (is_array($value)) { + foreach ($value as $index => $bit) { + $normalizedValues[sprintf('%s[%s]', $key, $index)] = $bit; + } + } else { + $normalizedValues[$key] = (string) $value; + } + } + + return $normalizedValues; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php new file mode 100644 index 0000000..25e8e24 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php @@ -0,0 +1,159 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Matcher\Dumper; + +/** + * Collection of routes. + * + * @author Arnaud Le Blanc + */ +class DumperCollection implements \IteratorAggregate +{ + /** + * @var DumperCollection|null + */ + private $parent; + + /** + * @var (DumperCollection|DumperRoute)[] + */ + private $children = array(); + + /** + * @var array + */ + private $attributes = array(); + + /** + * Returns the children routes and collections. + * + * @return (DumperCollection|DumperRoute)[] Array of DumperCollection|DumperRoute + */ + public function all() + { + return $this->children; + } + + /** + * Adds a route or collection + * + * @param DumperRoute|DumperCollection The route or collection + */ + public function add($child) + { + if ($child instanceof DumperCollection) { + $child->setParent($this); + } + $this->children[] = $child; + } + + /** + * Sets children. + * + * @param array $children The children + */ + public function setAll(array $children) + { + foreach ($children as $child) { + if ($child instanceof DumperCollection) { + $child->setParent($this); + } + } + $this->children = $children; + } + + /** + * Returns an iterator over the children. + * + * @return \Iterator The iterator + */ + public function getIterator() + { + return new \ArrayIterator($this->children); + } + + /** + * Returns the root of the collection. + * + * @return DumperCollection The root collection + */ + public function getRoot() + { + return (null !== $this->parent) ? $this->parent->getRoot() : $this; + } + + /** + * Returns the parent collection. + * + * @return DumperCollection|null The parent collection or null if the collection has no parent + */ + protected function getParent() + { + return $this->parent; + } + + /** + * Sets the parent collection. + * + * @param DumperCollection $parent The parent collection + */ + protected function setParent(DumperCollection $parent) + { + $this->parent = $parent; + } + + /** + * Returns true if the attribute is defined. + * + * @param string $name The attribute name + * + * @return bool true if the attribute is defined, false otherwise + */ + public function hasAttribute($name) + { + return array_key_exists($name, $this->attributes); + } + + /** + * Returns an attribute by name. + * + * @param string $name The attribute name + * @param mixed $default Default value is the attribute doesn't exist + * + * @return mixed The attribute value + */ + public function getAttribute($name, $default = null) + { + return $this->hasAttribute($name) ? $this->attributes[$name] : $default; + } + + /** + * Sets an attribute by name. + * + * @param string $name The attribute name + * @param mixed $value The attribute value + */ + public function setAttribute($name, $value) + { + $this->attributes[$name] = $value; + } + + /** + * Sets multiple attributes. + * + * @param array $attributes The attributes + */ + public function setAttributes($attributes) + { + $this->attributes = $attributes; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php new file mode 100644 index 0000000..3563d51 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php @@ -0,0 +1,105 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Matcher\Dumper; + +/** + * Prefix tree of routes preserving routes order. + * + * @author Arnaud Le Blanc + */ +class DumperPrefixCollection extends DumperCollection +{ + /** + * @var string + */ + private $prefix = ''; + + /** + * Returns the prefix. + * + * @return string The prefix + */ + public function getPrefix() + { + return $this->prefix; + } + + /** + * Sets the prefix. + * + * @param string $prefix The prefix + */ + public function setPrefix($prefix) + { + $this->prefix = $prefix; + } + + /** + * Adds a route in the tree. + * + * @param DumperRoute $route The route + * + * @return DumperPrefixCollection The node the route was added to + * + * @throws \LogicException + */ + public function addPrefixRoute(DumperRoute $route) + { + $prefix = $route->getRoute()->compile()->getStaticPrefix(); + + for ($collection = $this; null !== $collection; $collection = $collection->getParent()) { + // Same prefix, add to current leave + if ($collection->prefix === $prefix) { + $collection->add($route); + + return $collection; + } + + // Prefix starts with route's prefix + if ('' === $collection->prefix || 0 === strpos($prefix, $collection->prefix)) { + $child = new DumperPrefixCollection(); + $child->setPrefix(substr($prefix, 0, strlen($collection->prefix)+1)); + $collection->add($child); + + return $child->addPrefixRoute($route); + } + } + + // Reached only if the root has a non empty prefix + throw new \LogicException("The collection root must not have a prefix"); + } + + /** + * Merges nodes whose prefix ends with a slash + * + * Children of a node whose prefix ends with a slash are moved to the parent node + */ + public function mergeSlashNodes() + { + $children = array(); + + foreach ($this as $child) { + if ($child instanceof self) { + $child->mergeSlashNodes(); + if ('/' === substr($child->prefix, -1)) { + $children = array_merge($children, $child->all()); + } else { + $children[] = $child; + } + } else { + $children[] = $child; + } + } + + $this->setAll($children); + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php new file mode 100644 index 0000000..2928cdc --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Matcher\Dumper; + +use Symfony\Component\Routing\Route; + +/** + * Container for a Route. + * + * @author Arnaud Le Blanc + */ +class DumperRoute +{ + /** + * @var string + */ + private $name; + + /** + * @var Route + */ + private $route; + + /** + * Constructor. + * + * @param string $name The route name + * @param Route $route The route + */ + public function __construct($name, Route $route) + { + $this->name = $name; + $this->route = $route; + } + + /** + * Returns the route name. + * + * @return string The route name + */ + public function getName() + { + return $this->name; + } + + /** + * Returns the route. + * + * @return Route The route + */ + public function getRoute() + { + return $this->route; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumper.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumper.php new file mode 100644 index 0000000..52edc01 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumper.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Matcher\Dumper; + +use Symfony\Component\Routing\RouteCollection; + +/** + * MatcherDumper is the abstract class for all built-in matcher dumpers. + * + * @author Fabien Potencier + */ +abstract class MatcherDumper implements MatcherDumperInterface +{ + /** + * @var RouteCollection + */ + private $routes; + + /** + * Constructor. + * + * @param RouteCollection $routes The RouteCollection to dump + */ + public function __construct(RouteCollection $routes) + { + $this->routes = $routes; + } + + /** + * {@inheritdoc} + */ + public function getRoutes() + { + return $this->routes; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php new file mode 100644 index 0000000..5e7c134 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Matcher\Dumper; + +use Symfony\Component\Routing\RouteCollection; + +/** + * MatcherDumperInterface is the interface that all matcher dumper classes must implement. + * + * @author Fabien Potencier + */ +interface MatcherDumperInterface +{ + /** + * Dumps a set of routes to a string representation of executable code + * that can then be used to match a request against these routes. + * + * @param array $options An array of options + * + * @return string Executable code + */ + public function dump(array $options = array()); + + /** + * Gets the routes to dump. + * + * @return RouteCollection A RouteCollection instance + */ + public function getRoutes(); +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php new file mode 100644 index 0000000..195c56e --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php @@ -0,0 +1,377 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Matcher\Dumper; + +use Symfony\Component\Routing\Route; +use Symfony\Component\Routing\RouteCollection; + +/** + * PhpMatcherDumper creates a PHP class able to match URLs for a given set of routes. + * + * @author Fabien Potencier + * @author Tobias Schultze + * @author Arnaud Le Blanc + */ +class PhpMatcherDumper extends MatcherDumper +{ + /** + * Dumps a set of routes to a PHP class. + * + * Available options: + * + * * class: The class name + * * base_class: The base class name + * + * @param array $options An array of options + * + * @return string A PHP class representing the matcher class + */ + public function dump(array $options = array()) + { + $options = array_replace(array( + 'class' => 'ProjectUrlMatcher', + 'base_class' => 'Symfony\\Component\\Routing\\Matcher\\UrlMatcher', + ), $options); + + // trailing slash support is only enabled if we know how to redirect the user + $interfaces = class_implements($options['base_class']); + $supportsRedirections = isset($interfaces['Symfony\\Component\\Routing\\Matcher\\RedirectableUrlMatcherInterface']); + + return <<context = \$context; + } + +{$this->generateMatchMethod($supportsRedirections)} +} + +EOF; + } + + /** + * Generates the code for the match method implementing UrlMatcherInterface. + * + * @param bool $supportsRedirections Whether redirections are supported by the base class + * + * @return string Match method as PHP code + */ + private function generateMatchMethod($supportsRedirections) + { + $code = rtrim($this->compileRoutes($this->getRoutes(), $supportsRedirections), "\n"); + + return <<groupRoutesByHostRegex($routes); + $code = ''; + + foreach ($groups as $collection) { + if (null !== $regex = $collection->getAttribute('host_regex')) { + if (!$fetchedHost) { + $code .= " \$host = \$this->context->getHost();\n\n"; + $fetchedHost = true; + } + + $code .= sprintf(" if (preg_match(%s, \$host, \$hostMatches)) {\n", var_export($regex, true)); + } + + $tree = $this->buildPrefixTree($collection); + $groupCode = $this->compilePrefixRoutes($tree, $supportsRedirections); + + if (null !== $regex) { + // apply extra indention at each line (except empty ones) + $groupCode = preg_replace('/^.{2,}$/m', ' $0', $groupCode); + $code .= $groupCode; + $code .= " }\n\n"; + } else { + $code .= $groupCode; + } + } + + return $code; + } + + /** + * Generates PHP code recursively to match a tree of routes + * + * @param DumperPrefixCollection $collection A DumperPrefixCollection instance + * @param bool $supportsRedirections Whether redirections are supported by the base class + * @param string $parentPrefix Prefix of the parent collection + * + * @return string PHP code + */ + private function compilePrefixRoutes(DumperPrefixCollection $collection, $supportsRedirections, $parentPrefix = '') + { + $code = ''; + $prefix = $collection->getPrefix(); + $optimizable = 1 < strlen($prefix) && 1 < count($collection->all()); + $optimizedPrefix = $parentPrefix; + + if ($optimizable) { + $optimizedPrefix = $prefix; + + $code .= sprintf(" if (0 === strpos(\$pathinfo, %s)) {\n", var_export($prefix, true)); + } + + foreach ($collection as $route) { + if ($route instanceof DumperCollection) { + $code .= $this->compilePrefixRoutes($route, $supportsRedirections, $optimizedPrefix); + } else { + $code .= $this->compileRoute($route->getRoute(), $route->getName(), $supportsRedirections, $optimizedPrefix)."\n"; + } + } + + if ($optimizable) { + $code .= " }\n\n"; + // apply extra indention at each line (except empty ones) + $code = preg_replace('/^.{2,}$/m', ' $0', $code); + } + + return $code; + } + + /** + * Compiles a single Route to PHP code used to match it against the path info. + * + * @param Route $route A Route instance + * @param string $name The name of the Route + * @param bool $supportsRedirections Whether redirections are supported by the base class + * @param string|null $parentPrefix The prefix of the parent collection used to optimize the code + * + * @return string PHP code + * + * @throws \LogicException + */ + private function compileRoute(Route $route, $name, $supportsRedirections, $parentPrefix = null) + { + $code = ''; + $compiledRoute = $route->compile(); + $conditions = array(); + $hasTrailingSlash = false; + $matches = false; + $hostMatches = false; + $methods = array(); + + if ($req = $route->getRequirement('_method')) { + $methods = explode('|', strtoupper($req)); + // GET and HEAD are equivalent + if (in_array('GET', $methods) && !in_array('HEAD', $methods)) { + $methods[] = 'HEAD'; + } + } + + $supportsTrailingSlash = $supportsRedirections && (!$methods || in_array('HEAD', $methods)); + + if (!count($compiledRoute->getPathVariables()) && false !== preg_match('#^(.)\^(?P.*?)\$\1#', $compiledRoute->getRegex(), $m)) { + if ($supportsTrailingSlash && substr($m['url'], -1) === '/') { + $conditions[] = sprintf("rtrim(\$pathinfo, '/') === %s", var_export(rtrim(str_replace('\\', '', $m['url']), '/'), true)); + $hasTrailingSlash = true; + } else { + $conditions[] = sprintf("\$pathinfo === %s", var_export(str_replace('\\', '', $m['url']), true)); + } + } else { + if ($compiledRoute->getStaticPrefix() && $compiledRoute->getStaticPrefix() !== $parentPrefix) { + $conditions[] = sprintf("0 === strpos(\$pathinfo, %s)", var_export($compiledRoute->getStaticPrefix(), true)); + } + + $regex = $compiledRoute->getRegex(); + if ($supportsTrailingSlash && $pos = strpos($regex, '/$')) { + $regex = substr($regex, 0, $pos).'/?$'.substr($regex, $pos + 2); + $hasTrailingSlash = true; + } + $conditions[] = sprintf("preg_match(%s, \$pathinfo, \$matches)", var_export($regex, true)); + + $matches = true; + } + + if ($compiledRoute->getHostVariables()) { + $hostMatches = true; + } + + $conditions = implode(' && ', $conditions); + + $code .= <<context->getMethod() != '$methods[0]') { + \$allow[] = '$methods[0]'; + goto $gotoname; + } + + +EOF; + } else { + $methods = implode("', '", $methods); + $code .= <<context->getMethod(), array('$methods'))) { + \$allow = array_merge(\$allow, array('$methods')); + goto $gotoname; + } + + +EOF; + } + } + + if ($hasTrailingSlash) { + $code .= <<redirect(\$pathinfo.'/', '$name'); + } + + +EOF; + } + + if ($scheme = $route->getRequirement('_scheme')) { + if (!$supportsRedirections) { + throw new \LogicException('The "_scheme" requirement is only supported for URL matchers that implement RedirectableUrlMatcherInterface.'); + } + + $code .= <<context->getScheme() !== '$scheme') { + return \$this->redirect(\$pathinfo, '$name', '$scheme'); + } + + +EOF; + } + + // optimize parameters array + if ($matches || $hostMatches) { + $vars = array(); + if ($hostMatches) { + $vars[] = '$hostMatches'; + } + if ($matches) { + $vars[] = '$matches'; + } + $vars[] = "array('_route' => '$name')"; + + $code .= sprintf(" return \$this->mergeDefaults(array_replace(%s), %s);\n" + , implode(', ', $vars), str_replace("\n", '', var_export($route->getDefaults(), true))); + } elseif ($route->getDefaults()) { + $code .= sprintf(" return %s;\n", str_replace("\n", '', var_export(array_replace($route->getDefaults(), array('_route' => $name)), true))); + } else { + $code .= sprintf(" return array('_route' => '%s');\n", $name); + } + $code .= " }\n"; + + if ($methods) { + $code .= " $gotoname:\n"; + } + + return $code; + } + + /** + * Groups consecutive routes having the same host regex. + * + * The result is a collection of collections of routes having the same host regex. + * + * @param RouteCollection $routes A flat RouteCollection + * + * @return DumperCollection A collection with routes grouped by host regex in sub-collections + */ + private function groupRoutesByHostRegex(RouteCollection $routes) + { + $groups = new DumperCollection(); + + $currentGroup = new DumperCollection(); + $currentGroup->setAttribute('host_regex', null); + $groups->add($currentGroup); + + foreach ($routes as $name => $route) { + $hostRegex = $route->compile()->getHostRegex(); + if ($currentGroup->getAttribute('host_regex') !== $hostRegex) { + $currentGroup = new DumperCollection(); + $currentGroup->setAttribute('host_regex', $hostRegex); + $groups->add($currentGroup); + } + $currentGroup->add(new DumperRoute($name, $route)); + } + + return $groups; + } + + /** + * Organizes the routes into a prefix tree. + * + * Routes order is preserved such that traversing the tree will traverse the + * routes in the origin order. + * + * @param DumperCollection $collection A collection of routes + * + * @return DumperPrefixCollection + */ + private function buildPrefixTree(DumperCollection $collection) + { + $tree = new DumperPrefixCollection(); + $current = $tree; + + foreach ($collection as $route) { + $current = $current->addPrefixRoute($route); + } + + $tree->mergeSlashNodes(); + + return $tree; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php new file mode 100644 index 0000000..ee1e58b --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Matcher; + +use Symfony\Component\Routing\Exception\ResourceNotFoundException; +use Symfony\Component\Routing\Route; + +/** + * @author Fabien Potencier + * + * @api + */ +abstract class RedirectableUrlMatcher extends UrlMatcher implements RedirectableUrlMatcherInterface +{ + /** + * {@inheritdoc} + */ + public function match($pathinfo) + { + try { + $parameters = parent::match($pathinfo); + } catch (ResourceNotFoundException $e) { + if ('/' === substr($pathinfo, -1) || !in_array($this->context->getMethod(), array('HEAD', 'GET'))) { + throw $e; + } + + try { + parent::match($pathinfo.'/'); + + return $this->redirect($pathinfo.'/', null); + } catch (ResourceNotFoundException $e2) { + throw $e; + } + } + + return $parameters; + } + + /** + * {@inheritdoc} + */ + protected function handleRouteRequirements($pathinfo, $name, Route $route) + { + // check HTTP scheme requirement + $scheme = $route->getRequirement('_scheme'); + if ($scheme && $this->context->getScheme() !== $scheme) { + return array(self::ROUTE_MATCH, $this->redirect($pathinfo, $name, $scheme)); + } + + return array(self::REQUIREMENT_MATCH, null); + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcherInterface.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcherInterface.php new file mode 100644 index 0000000..ea91e07 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcherInterface.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Matcher; + +/** + * RedirectableUrlMatcherInterface knows how to redirect the user. + * + * @author Fabien Potencier + * + * @api + */ +interface RedirectableUrlMatcherInterface +{ + /** + * Redirects the user to another URL. + * + * @param string $path The path info to redirect to. + * @param string $route The route name that matched + * @param string|null $scheme The URL scheme (null to keep the current one) + * + * @return array An array of parameters + * + * @api + */ + public function redirect($path, $route, $scheme = null); +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RequestMatcherInterface.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RequestMatcherInterface.php new file mode 100644 index 0000000..b5def3d --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RequestMatcherInterface.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Matcher; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Exception\ResourceNotFoundException; +use Symfony\Component\Routing\Exception\MethodNotAllowedException; + +/** + * RequestMatcherInterface is the interface that all request matcher classes must implement. + * + * @author Fabien Potencier + */ +interface RequestMatcherInterface +{ + /** + * Tries to match a request with a set of routes. + * + * If the matcher can not find information, it must throw one of the exceptions documented + * below. + * + * @param Request $request The request to match + * + * @return array An array of parameters + * + * @throws ResourceNotFoundException If no matching resource could be found + * @throws MethodNotAllowedException If a matching resource was found but the request method is not allowed + */ + public function matchRequest(Request $request); +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php new file mode 100644 index 0000000..ff560c7 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php @@ -0,0 +1,120 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Matcher; + +use Symfony\Component\Routing\Exception\ExceptionInterface; +use Symfony\Component\Routing\Route; +use Symfony\Component\Routing\RouteCollection; + +/** + * TraceableUrlMatcher helps debug path info matching by tracing the match. + * + * @author Fabien Potencier + */ +class TraceableUrlMatcher extends UrlMatcher +{ + const ROUTE_DOES_NOT_MATCH = 0; + const ROUTE_ALMOST_MATCHES = 1; + const ROUTE_MATCHES = 2; + + protected $traces; + + public function getTraces($pathinfo) + { + $this->traces = array(); + + try { + $this->match($pathinfo); + } catch (ExceptionInterface $e) { + } + + return $this->traces; + } + + protected function matchCollection($pathinfo, RouteCollection $routes) + { + foreach ($routes as $name => $route) { + $compiledRoute = $route->compile(); + + if (!preg_match($compiledRoute->getRegex(), $pathinfo, $matches)) { + // does it match without any requirements? + $r = new Route($route->getPath(), $route->getDefaults(), array(), $route->getOptions()); + $cr = $r->compile(); + if (!preg_match($cr->getRegex(), $pathinfo)) { + $this->addTrace(sprintf('Path "%s" does not match', $route->getPath()), self::ROUTE_DOES_NOT_MATCH, $name, $route); + + continue; + } + + foreach ($route->getRequirements() as $n => $regex) { + $r = new Route($route->getPath(), $route->getDefaults(), array($n => $regex), $route->getOptions()); + $cr = $r->compile(); + + if (in_array($n, $cr->getVariables()) && !preg_match($cr->getRegex(), $pathinfo)) { + $this->addTrace(sprintf('Requirement for "%s" does not match (%s)', $n, $regex), self::ROUTE_ALMOST_MATCHES, $name, $route); + + continue 2; + } + } + + continue; + } + + // check host requirement + $hostMatches = array(); + if ($compiledRoute->getHostRegex() && !preg_match($compiledRoute->getHostRegex(), $this->context->getHost(), $hostMatches)) { + $this->addTrace(sprintf('Host "%s" does not match the requirement ("%s")', $this->context->getHost(), $route->getHost()), self::ROUTE_ALMOST_MATCHES, $name, $route); + + continue; + } + + // check HTTP method requirement + if ($req = $route->getRequirement('_method')) { + // HEAD and GET are equivalent as per RFC + if ('HEAD' === $method = $this->context->getMethod()) { + $method = 'GET'; + } + + if (!in_array($method, $req = explode('|', strtoupper($req)))) { + $this->allow = array_merge($this->allow, $req); + + $this->addTrace(sprintf('Method "%s" does not match the requirement ("%s")', $this->context->getMethod(), implode(', ', $req)), self::ROUTE_ALMOST_MATCHES, $name, $route); + + continue; + } + } + + // check HTTP scheme requirement + if ($scheme = $route->getRequirement('_scheme')) { + if ($this->context->getScheme() !== $scheme) { + $this->addTrace(sprintf('Scheme "%s" does not match the requirement ("%s"); the user will be redirected', $this->context->getScheme(), $scheme), self::ROUTE_ALMOST_MATCHES, $name, $route); + + return true; + } + } + + $this->addTrace('Route matches!', self::ROUTE_MATCHES, $name, $route); + + return true; + } + } + + private function addTrace($log, $level = self::ROUTE_DOES_NOT_MATCH, $name = null, $route = null) + { + $this->traces[] = array( + 'log' => $log, + 'name' => $name, + 'level' => $level, + 'path' => null !== $route ? $route->getPath() : null, + ); + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php new file mode 100644 index 0000000..db18ec4 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php @@ -0,0 +1,208 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Matcher; + +use Symfony\Component\Routing\Exception\MethodNotAllowedException; +use Symfony\Component\Routing\Exception\ResourceNotFoundException; +use Symfony\Component\Routing\RouteCollection; +use Symfony\Component\Routing\RequestContext; +use Symfony\Component\Routing\Route; + +/** + * UrlMatcher matches URL based on a set of routes. + * + * @author Fabien Potencier + * + * @api + */ +class UrlMatcher implements UrlMatcherInterface +{ + const REQUIREMENT_MATCH = 0; + const REQUIREMENT_MISMATCH = 1; + const ROUTE_MATCH = 2; + + /** + * @var RequestContext + */ + protected $context; + + /** + * @var array + */ + protected $allow = array(); + + /** + * @var RouteCollection + */ + protected $routes; + + /** + * Constructor. + * + * @param RouteCollection $routes A RouteCollection instance + * @param RequestContext $context The context + * + * @api + */ + public function __construct(RouteCollection $routes, RequestContext $context) + { + $this->routes = $routes; + $this->context = $context; + } + + /** + * {@inheritdoc} + */ + public function setContext(RequestContext $context) + { + $this->context = $context; + } + + /** + * {@inheritdoc} + */ + public function getContext() + { + return $this->context; + } + + /** + * {@inheritdoc} + */ + public function match($pathinfo) + { + $this->allow = array(); + + if ($ret = $this->matchCollection(rawurldecode($pathinfo), $this->routes)) { + return $ret; + } + + throw 0 < count($this->allow) + ? new MethodNotAllowedException(array_unique(array_map('strtoupper', $this->allow))) + : new ResourceNotFoundException(); + } + + /** + * Tries to match a URL with a set of routes. + * + * @param string $pathinfo The path info to be parsed + * @param RouteCollection $routes The set of routes + * + * @return array An array of parameters + * + * @throws ResourceNotFoundException If the resource could not be found + * @throws MethodNotAllowedException If the resource was found but the request method is not allowed + */ + protected function matchCollection($pathinfo, RouteCollection $routes) + { + foreach ($routes as $name => $route) { + $compiledRoute = $route->compile(); + + // check the static prefix of the URL first. Only use the more expensive preg_match when it matches + if ('' !== $compiledRoute->getStaticPrefix() && 0 !== strpos($pathinfo, $compiledRoute->getStaticPrefix())) { + continue; + } + + if (!preg_match($compiledRoute->getRegex(), $pathinfo, $matches)) { + continue; + } + + $hostMatches = array(); + if ($compiledRoute->getHostRegex() && !preg_match($compiledRoute->getHostRegex(), $this->context->getHost(), $hostMatches)) { + continue; + } + + // check HTTP method requirement + if ($req = $route->getRequirement('_method')) { + // HEAD and GET are equivalent as per RFC + if ('HEAD' === $method = $this->context->getMethod()) { + $method = 'GET'; + } + + if (!in_array($method, $req = explode('|', strtoupper($req)))) { + $this->allow = array_merge($this->allow, $req); + + continue; + } + } + + $status = $this->handleRouteRequirements($pathinfo, $name, $route); + + if (self::ROUTE_MATCH === $status[0]) { + return $status[1]; + } + + if (self::REQUIREMENT_MISMATCH === $status[0]) { + continue; + } + + return $this->getAttributes($route, $name, array_replace($matches, $hostMatches)); + } + } + + /** + * Returns an array of values to use as request attributes. + * + * As this method requires the Route object, it is not available + * in matchers that do not have access to the matched Route instance + * (like the PHP and Apache matcher dumpers). + * + * @param Route $route The route we are matching against + * @param string $name The name of the route + * @param array $attributes An array of attributes from the matcher + * + * @return array An array of parameters + */ + protected function getAttributes(Route $route, $name, array $attributes) + { + $attributes['_route'] = $name; + + return $this->mergeDefaults($attributes, $route->getDefaults()); + } + + /** + * Handles specific route requirements. + * + * @param string $pathinfo The path + * @param string $name The route name + * @param Route $route The route + * + * @return array The first element represents the status, the second contains additional information + */ + protected function handleRouteRequirements($pathinfo, $name, Route $route) + { + // check HTTP scheme requirement + $scheme = $route->getRequirement('_scheme'); + $status = $scheme && $scheme !== $this->context->getScheme() ? self::REQUIREMENT_MISMATCH : self::REQUIREMENT_MATCH; + + return array($status, null); + } + + /** + * Get merged default parameters. + * + * @param array $params The parameters + * @param array $defaults The defaults + * + * @return array Merged default parameters + */ + protected function mergeDefaults($params, $defaults) + { + foreach ($params as $key => $value) { + if (!is_int($key)) { + $defaults[$key] = $value; + } + } + + return $defaults; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcherInterface.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcherInterface.php new file mode 100644 index 0000000..dd718b1 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcherInterface.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Matcher; + +use Symfony\Component\Routing\RequestContextAwareInterface; +use Symfony\Component\Routing\Exception\ResourceNotFoundException; +use Symfony\Component\Routing\Exception\MethodNotAllowedException; + +/** + * UrlMatcherInterface is the interface that all URL matcher classes must implement. + * + * @author Fabien Potencier + * + * @api + */ +interface UrlMatcherInterface extends RequestContextAwareInterface +{ + /** + * Tries to match a URL path with a set of routes. + * + * If the matcher can not find information, it must throw one of the exceptions documented + * below. + * + * @param string $pathinfo The path info to be parsed (raw format, i.e. not urldecoded) + * + * @return array An array of parameters + * + * @throws ResourceNotFoundException If the resource could not be found + * @throws MethodNotAllowedException If the resource was found but the request method is not allowed + * + * @api + */ + public function match($pathinfo); +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RequestContext.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RequestContext.php new file mode 100644 index 0000000..c8fcf44 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RequestContext.php @@ -0,0 +1,322 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing; + +use Symfony\Component\HttpFoundation\Request; + +/** + * Holds information about the current request. + * + * @author Fabien Potencier + * @author Tobias Schultze + * + * @api + */ +class RequestContext +{ + private $baseUrl; + private $pathInfo; + private $method; + private $host; + private $scheme; + private $httpPort; + private $httpsPort; + private $queryString; + + /** + * @var array + */ + private $parameters = array(); + + /** + * Constructor. + * + * @param string $baseUrl The base URL + * @param string $method The HTTP method + * @param string $host The HTTP host name + * @param string $scheme The HTTP scheme + * @param int $httpPort The HTTP port + * @param int $httpsPort The HTTPS port + * @param string $path The path + * @param string $queryString The query string + * + * @api + */ + public function __construct($baseUrl = '', $method = 'GET', $host = 'localhost', $scheme = 'http', $httpPort = 80, $httpsPort = 443, $path = '/', $queryString = '') + { + $this->setBaseUrl($baseUrl); + $this->setMethod($method); + $this->setHost($host); + $this->setScheme($scheme); + $this->setHttpPort($httpPort); + $this->setHttpsPort($httpsPort); + $this->setPathInfo($path); + $this->setQueryString($queryString); + } + + /** + * Updates the RequestContext information based on a HttpFoundation Request. + * + * @param Request $request A Request instance + */ + public function fromRequest(Request $request) + { + $this->setBaseUrl($request->getBaseUrl()); + $this->setPathInfo($request->getPathInfo()); + $this->setMethod($request->getMethod()); + $this->setHost($request->getHost()); + $this->setScheme($request->getScheme()); + $this->setHttpPort($request->isSecure() ? $this->httpPort : $request->getPort()); + $this->setHttpsPort($request->isSecure() ? $request->getPort() : $this->httpsPort); + $this->setQueryString($request->server->get('QUERY_STRING', '')); + } + + /** + * Gets the base URL. + * + * @return string The base URL + */ + public function getBaseUrl() + { + return $this->baseUrl; + } + + /** + * Sets the base URL. + * + * @param string $baseUrl The base URL + * + * @api + */ + public function setBaseUrl($baseUrl) + { + $this->baseUrl = $baseUrl; + } + + /** + * Gets the path info. + * + * @return string The path info + */ + public function getPathInfo() + { + return $this->pathInfo; + } + + /** + * Sets the path info. + * + * @param string $pathInfo The path info + */ + public function setPathInfo($pathInfo) + { + $this->pathInfo = $pathInfo; + } + + /** + * Gets the HTTP method. + * + * The method is always an uppercased string. + * + * @return string The HTTP method + */ + public function getMethod() + { + return $this->method; + } + + /** + * Sets the HTTP method. + * + * @param string $method The HTTP method + * + * @api + */ + public function setMethod($method) + { + $this->method = strtoupper($method); + } + + /** + * Gets the HTTP host. + * + * The host is always lowercased because it must be treated case-insensitive. + * + * @return string The HTTP host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the HTTP host. + * + * @param string $host The HTTP host + * + * @api + */ + public function setHost($host) + { + $this->host = strtolower($host); + } + + /** + * Gets the HTTP scheme. + * + * @return string The HTTP scheme + */ + public function getScheme() + { + return $this->scheme; + } + + /** + * Sets the HTTP scheme. + * + * @param string $scheme The HTTP scheme + * + * @api + */ + public function setScheme($scheme) + { + $this->scheme = strtolower($scheme); + } + + /** + * Gets the HTTP port. + * + * @return int The HTTP port + */ + public function getHttpPort() + { + return $this->httpPort; + } + + /** + * Sets the HTTP port. + * + * @param int $httpPort The HTTP port + * + * @api + */ + public function setHttpPort($httpPort) + { + $this->httpPort = (int) $httpPort; + } + + /** + * Gets the HTTPS port. + * + * @return int The HTTPS port + */ + public function getHttpsPort() + { + return $this->httpsPort; + } + + /** + * Sets the HTTPS port. + * + * @param int $httpsPort The HTTPS port + * + * @api + */ + public function setHttpsPort($httpsPort) + { + $this->httpsPort = (int) $httpsPort; + } + + /** + * Gets the query string. + * + * @return string The query string without the "?" + */ + public function getQueryString() + { + return $this->queryString; + } + + /** + * Sets the query string. + * + * @param string $queryString The query string (after "?") + * + * @api + */ + public function setQueryString($queryString) + { + // string cast to be fault-tolerant, accepting null + $this->queryString = (string) $queryString; + } + + /** + * Returns the parameters. + * + * @return array The parameters + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * Sets the parameters. + * + * @param array $parameters The parameters + * + * @return RequestContext The current instance, implementing a fluent interface + */ + public function setParameters(array $parameters) + { + $this->parameters = $parameters; + + return $this; + } + + /** + * Gets a parameter value. + * + * @param string $name A parameter name + * + * @return mixed The parameter value or null if nonexistent + */ + public function getParameter($name) + { + return isset($this->parameters[$name]) ? $this->parameters[$name] : null; + } + + /** + * Checks if a parameter value is set for the given parameter. + * + * @param string $name A parameter name + * + * @return bool True if the parameter value is set, false otherwise + */ + public function hasParameter($name) + { + return array_key_exists($name, $this->parameters); + } + + /** + * Sets a parameter value. + * + * @param string $name A parameter name + * @param mixed $parameter The parameter value + * + * @api + */ + public function setParameter($name, $parameter) + { + $this->parameters[$name] = $parameter; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RequestContextAwareInterface.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RequestContextAwareInterface.php new file mode 100644 index 0000000..daf5254 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RequestContextAwareInterface.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing; + +/** + * @api + */ +interface RequestContextAwareInterface +{ + /** + * Sets the request context. + * + * @param RequestContext $context The context + * + * @api + */ + public function setContext(RequestContext $context); + + /** + * Gets the request context. + * + * @return RequestContext The context + * + * @api + */ + public function getContext(); +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Route.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Route.php new file mode 100644 index 0000000..0adf704 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Route.php @@ -0,0 +1,594 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing; + +/** + * A Route describes a route and its parameters. + * + * @author Fabien Potencier + * @author Tobias Schultze + * + * @api + */ +class Route implements \Serializable +{ + /** + * @var string + */ + private $path = '/'; + + /** + * @var string + */ + private $host = ''; + + /** + * @var array + */ + private $schemes = array(); + + /** + * @var array + */ + private $methods = array(); + + /** + * @var array + */ + private $defaults = array(); + + /** + * @var array + */ + private $requirements = array(); + + /** + * @var array + */ + private $options = array(); + + /** + * @var null|CompiledRoute + */ + private $compiled; + + /** + * Constructor. + * + * Available options: + * + * * compiler_class: A class name able to compile this route instance (RouteCompiler by default) + * + * @param string $path The path pattern to match + * @param array $defaults An array of default parameter values + * @param array $requirements An array of requirements for parameters (regexes) + * @param array $options An array of options + * @param string $host The host pattern to match + * @param string|array $schemes A required URI scheme or an array of restricted schemes + * @param string|array $methods A required HTTP method or an array of restricted methods + * + * @api + */ + public function __construct($path, array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array()) + { + $this->setPath($path); + $this->setDefaults($defaults); + $this->setRequirements($requirements); + $this->setOptions($options); + $this->setHost($host); + // The conditions make sure that an initial empty $schemes/$methods does not override the corresponding requirement. + // They can be removed when the BC layer is removed. + if ($schemes) { + $this->setSchemes($schemes); + } + if ($methods) { + $this->setMethods($methods); + } + } + + public function serialize() + { + return serialize(array( + 'path' => $this->path, + 'host' => $this->host, + 'defaults' => $this->defaults, + 'requirements' => $this->requirements, + 'options' => $this->options, + 'schemes' => $this->schemes, + 'methods' => $this->methods, + )); + } + + public function unserialize($data) + { + $data = unserialize($data); + $this->path = $data['path']; + $this->host = $data['host']; + $this->defaults = $data['defaults']; + $this->requirements = $data['requirements']; + $this->options = $data['options']; + $this->schemes = $data['schemes']; + $this->methods = $data['methods']; + } + + /** + * Returns the pattern for the path. + * + * @return string The pattern + * + * @deprecated Deprecated in 2.2, to be removed in 3.0. Use getPath instead. + */ + public function getPattern() + { + return $this->path; + } + + /** + * Sets the pattern for the path. + * + * This method implements a fluent interface. + * + * @param string $pattern The path pattern + * + * @return Route The current Route instance + * + * @deprecated Deprecated in 2.2, to be removed in 3.0. Use setPath instead. + */ + public function setPattern($pattern) + { + return $this->setPath($pattern); + } + + /** + * Returns the pattern for the path. + * + * @return string The path pattern + */ + public function getPath() + { + return $this->path; + } + + /** + * Sets the pattern for the path. + * + * This method implements a fluent interface. + * + * @param string $pattern The path pattern + * + * @return Route The current Route instance + */ + public function setPath($pattern) + { + // A pattern must start with a slash and must not have multiple slashes at the beginning because the + // generated path for this route would be confused with a network path, e.g. '//domain.com/path'. + $this->path = '/'.ltrim(trim($pattern), '/'); + $this->compiled = null; + + return $this; + } + + /** + * Returns the pattern for the host. + * + * @return string The host pattern + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the pattern for the host. + * + * This method implements a fluent interface. + * + * @param string $pattern The host pattern + * + * @return Route The current Route instance + */ + public function setHost($pattern) + { + $this->host = (string) $pattern; + $this->compiled = null; + + return $this; + } + + /** + * Returns the lowercased schemes this route is restricted to. + * So an empty array means that any scheme is allowed. + * + * @return array The schemes + */ + public function getSchemes() + { + return $this->schemes; + } + + /** + * Sets the schemes (e.g. 'https') this route is restricted to. + * So an empty array means that any scheme is allowed. + * + * This method implements a fluent interface. + * + * @param string|array $schemes The scheme or an array of schemes + * + * @return Route The current Route instance + */ + public function setSchemes($schemes) + { + $this->schemes = array_map('strtolower', (array) $schemes); + + // this is to keep BC and will be removed in a future version + if ($this->schemes) { + $this->requirements['_scheme'] = implode('|', $this->schemes); + } else { + unset($this->requirements['_scheme']); + } + + $this->compiled = null; + + return $this; + } + + /** + * Returns the uppercased HTTP methods this route is restricted to. + * So an empty array means that any method is allowed. + * + * @return array The schemes + */ + public function getMethods() + { + return $this->methods; + } + + /** + * Sets the HTTP methods (e.g. 'POST') this route is restricted to. + * So an empty array means that any method is allowed. + * + * This method implements a fluent interface. + * + * @param string|array $methods The method or an array of methods + * + * @return Route The current Route instance + */ + public function setMethods($methods) + { + $this->methods = array_map('strtoupper', (array) $methods); + + // this is to keep BC and will be removed in a future version + if ($this->methods) { + $this->requirements['_method'] = implode('|', $this->methods); + } else { + unset($this->requirements['_method']); + } + + $this->compiled = null; + + return $this; + } + + /** + * Returns the options. + * + * @return array The options + */ + public function getOptions() + { + return $this->options; + } + + /** + * Sets the options. + * + * This method implements a fluent interface. + * + * @param array $options The options + * + * @return Route The current Route instance + */ + public function setOptions(array $options) + { + $this->options = array( + 'compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler', + ); + + return $this->addOptions($options); + } + + /** + * Adds options. + * + * This method implements a fluent interface. + * + * @param array $options The options + * + * @return Route The current Route instance + */ + public function addOptions(array $options) + { + foreach ($options as $name => $option) { + $this->options[$name] = $option; + } + $this->compiled = null; + + return $this; + } + + /** + * Sets an option value. + * + * This method implements a fluent interface. + * + * @param string $name An option name + * @param mixed $value The option value + * + * @return Route The current Route instance + * + * @api + */ + public function setOption($name, $value) + { + $this->options[$name] = $value; + $this->compiled = null; + + return $this; + } + + /** + * Get an option value. + * + * @param string $name An option name + * + * @return mixed The option value or null when not given + */ + public function getOption($name) + { + return isset($this->options[$name]) ? $this->options[$name] : null; + } + + /** + * Checks if an option has been set + * + * @param string $name An option name + * + * @return bool true if the option is set, false otherwise + */ + public function hasOption($name) + { + return array_key_exists($name, $this->options); + } + + /** + * Returns the defaults. + * + * @return array The defaults + */ + public function getDefaults() + { + return $this->defaults; + } + + /** + * Sets the defaults. + * + * This method implements a fluent interface. + * + * @param array $defaults The defaults + * + * @return Route The current Route instance + */ + public function setDefaults(array $defaults) + { + $this->defaults = array(); + + return $this->addDefaults($defaults); + } + + /** + * Adds defaults. + * + * This method implements a fluent interface. + * + * @param array $defaults The defaults + * + * @return Route The current Route instance + */ + public function addDefaults(array $defaults) + { + foreach ($defaults as $name => $default) { + $this->defaults[$name] = $default; + } + $this->compiled = null; + + return $this; + } + + /** + * Gets a default value. + * + * @param string $name A variable name + * + * @return mixed The default value or null when not given + */ + public function getDefault($name) + { + return isset($this->defaults[$name]) ? $this->defaults[$name] : null; + } + + /** + * Checks if a default value is set for the given variable. + * + * @param string $name A variable name + * + * @return bool true if the default value is set, false otherwise + */ + public function hasDefault($name) + { + return array_key_exists($name, $this->defaults); + } + + /** + * Sets a default value. + * + * @param string $name A variable name + * @param mixed $default The default value + * + * @return Route The current Route instance + * + * @api + */ + public function setDefault($name, $default) + { + $this->defaults[$name] = $default; + $this->compiled = null; + + return $this; + } + + /** + * Returns the requirements. + * + * @return array The requirements + */ + public function getRequirements() + { + return $this->requirements; + } + + /** + * Sets the requirements. + * + * This method implements a fluent interface. + * + * @param array $requirements The requirements + * + * @return Route The current Route instance + */ + public function setRequirements(array $requirements) + { + $this->requirements = array(); + + return $this->addRequirements($requirements); + } + + /** + * Adds requirements. + * + * This method implements a fluent interface. + * + * @param array $requirements The requirements + * + * @return Route The current Route instance + */ + public function addRequirements(array $requirements) + { + foreach ($requirements as $key => $regex) { + $this->requirements[$key] = $this->sanitizeRequirement($key, $regex); + } + $this->compiled = null; + + return $this; + } + + /** + * Returns the requirement for the given key. + * + * @param string $key The key + * + * @return string|null The regex or null when not given + */ + public function getRequirement($key) + { + return isset($this->requirements[$key]) ? $this->requirements[$key] : null; + } + + /** + * Checks if a requirement is set for the given key. + * + * @param string $key A variable name + * + * @return bool true if a requirement is specified, false otherwise + */ + public function hasRequirement($key) + { + return array_key_exists($key, $this->requirements); + } + + /** + * Sets a requirement for the given key. + * + * @param string $key The key + * @param string $regex The regex + * + * @return Route The current Route instance + * + * @api + */ + public function setRequirement($key, $regex) + { + $this->requirements[$key] = $this->sanitizeRequirement($key, $regex); + $this->compiled = null; + + return $this; + } + + /** + * Compiles the route. + * + * @return CompiledRoute A CompiledRoute instance + * + * @throws \LogicException If the Route cannot be compiled because the + * path or host pattern is invalid + * + * @see RouteCompiler which is responsible for the compilation process + */ + public function compile() + { + if (null !== $this->compiled) { + return $this->compiled; + } + + $class = $this->getOption('compiler_class'); + + return $this->compiled = $class::compile($this); + } + + private function sanitizeRequirement($key, $regex) + { + if (!is_string($regex)) { + throw new \InvalidArgumentException(sprintf('Routing requirement for "%s" must be a string.', $key)); + } + + if ('' !== $regex && '^' === $regex[0]) { + $regex = (string) substr($regex, 1); // returns false for a single character + } + + if ('$' === substr($regex, -1)) { + $regex = substr($regex, 0, -1); + } + + if ('' === $regex) { + throw new \InvalidArgumentException(sprintf('Routing requirement for "%s" cannot be empty.', $key)); + } + + // this is to keep BC and will be removed in a future version + if ('_scheme' === $key) { + $this->setSchemes(explode('|', $regex)); + } elseif ('_method' === $key) { + $this->setMethods(explode('|', $regex)); + } + + return $regex; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php new file mode 100644 index 0000000..499fe0f --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php @@ -0,0 +1,271 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing; + +use Symfony\Component\Config\Resource\ResourceInterface; + +/** + * A RouteCollection represents a set of Route instances. + * + * When adding a route at the end of the collection, an existing route + * with the same name is removed first. So there can only be one route + * with a given name. + * + * @author Fabien Potencier + * @author Tobias Schultze + * + * @api + */ +class RouteCollection implements \IteratorAggregate, \Countable +{ + /** + * @var Route[] + */ + private $routes = array(); + + /** + * @var array + */ + private $resources = array(); + + public function __clone() + { + foreach ($this->routes as $name => $route) { + $this->routes[$name] = clone $route; + } + } + + /** + * Gets the current RouteCollection as an Iterator that includes all routes. + * + * It implements \IteratorAggregate. + * + * @see all() + * + * @return \ArrayIterator An \ArrayIterator object for iterating over routes + */ + public function getIterator() + { + return new \ArrayIterator($this->routes); + } + + /** + * Gets the number of Routes in this collection. + * + * @return int The number of routes + */ + public function count() + { + return count($this->routes); + } + + /** + * Adds a route. + * + * @param string $name The route name + * @param Route $route A Route instance + * + * @api + */ + public function add($name, Route $route) + { + unset($this->routes[$name]); + + $this->routes[$name] = $route; + } + + /** + * Returns all routes in this collection. + * + * @return Route[] An array of routes + */ + public function all() + { + return $this->routes; + } + + /** + * Gets a route by name. + * + * @param string $name The route name + * + * @return Route|null A Route instance or null when not found + */ + public function get($name) + { + return isset($this->routes[$name]) ? $this->routes[$name] : null; + } + + /** + * Removes a route or an array of routes by name from the collection + * + * @param string|array $name The route name or an array of route names + */ + public function remove($name) + { + foreach ((array) $name as $n) { + unset($this->routes[$n]); + } + } + + /** + * Adds a route collection at the end of the current set by appending all + * routes of the added collection. + * + * @param RouteCollection $collection A RouteCollection instance + * + * @api + */ + public function addCollection(RouteCollection $collection) + { + // we need to remove all routes with the same names first because just replacing them + // would not place the new route at the end of the merged array + foreach ($collection->all() as $name => $route) { + unset($this->routes[$name]); + $this->routes[$name] = $route; + } + + $this->resources = array_merge($this->resources, $collection->getResources()); + } + + /** + * Adds a prefix to the path of all child routes. + * + * @param string $prefix An optional prefix to add before each pattern of the route collection + * @param array $defaults An array of default values + * @param array $requirements An array of requirements + * + * @api + */ + public function addPrefix($prefix, array $defaults = array(), array $requirements = array()) + { + $prefix = trim(trim($prefix), '/'); + + if ('' === $prefix) { + return; + } + + foreach ($this->routes as $route) { + $route->setPath('/'.$prefix.$route->getPath()); + $route->addDefaults($defaults); + $route->addRequirements($requirements); + } + } + + /** + * Sets the host pattern on all routes. + * + * @param string $pattern The pattern + * @param array $defaults An array of default values + * @param array $requirements An array of requirements + */ + public function setHost($pattern, array $defaults = array(), array $requirements = array()) + { + foreach ($this->routes as $route) { + $route->setHost($pattern); + $route->addDefaults($defaults); + $route->addRequirements($requirements); + } + } + + /** + * Adds defaults to all routes. + * + * An existing default value under the same name in a route will be overridden. + * + * @param array $defaults An array of default values + */ + public function addDefaults(array $defaults) + { + if ($defaults) { + foreach ($this->routes as $route) { + $route->addDefaults($defaults); + } + } + } + + /** + * Adds requirements to all routes. + * + * An existing requirement under the same name in a route will be overridden. + * + * @param array $requirements An array of requirements + */ + public function addRequirements(array $requirements) + { + if ($requirements) { + foreach ($this->routes as $route) { + $route->addRequirements($requirements); + } + } + } + + /** + * Adds options to all routes. + * + * An existing option value under the same name in a route will be overridden. + * + * @param array $options An array of options + */ + public function addOptions(array $options) + { + if ($options) { + foreach ($this->routes as $route) { + $route->addOptions($options); + } + } + } + + /** + * Sets the schemes (e.g. 'https') all child routes are restricted to. + * + * @param string|array $schemes The scheme or an array of schemes + */ + public function setSchemes($schemes) + { + foreach ($this->routes as $route) { + $route->setSchemes($schemes); + } + } + + /** + * Sets the HTTP methods (e.g. 'POST') all child routes are restricted to. + * + * @param string|array $methods The method or an array of methods + */ + public function setMethods($methods) + { + foreach ($this->routes as $route) { + $route->setMethods($methods); + } + } + + /** + * Returns an array of resources loaded to build this collection. + * + * @return ResourceInterface[] An array of resources + */ + public function getResources() + { + return array_unique($this->resources); + } + + /** + * Adds a resource for this collection. + * + * @param ResourceInterface $resource A resource instance + */ + public function addResource(ResourceInterface $resource) + { + $this->resources[] = $resource; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouteCompiler.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouteCompiler.php new file mode 100644 index 0000000..095145f --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouteCompiler.php @@ -0,0 +1,229 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing; + +/** + * RouteCompiler compiles Route instances to CompiledRoute instances. + * + * @author Fabien Potencier + * @author Tobias Schultze + */ +class RouteCompiler implements RouteCompilerInterface +{ + const REGEX_DELIMITER = '#'; + + /** + * This string defines the characters that are automatically considered separators in front of + * optional placeholders (with default and no static text following). Such a single separator + * can be left out together with the optional placeholder from matching and generating URLs. + */ + const SEPARATORS = '/,;.:-_~+*=@|'; + + /** + * {@inheritdoc} + * + * @throws \LogicException If a variable is referenced more than once + * @throws \DomainException If a variable name is numeric because PHP raises an error for such + * subpatterns in PCRE and thus would break matching, e.g. "(?P<123>.+)". + */ + public static function compile(Route $route) + { + $hostVariables = array(); + $variables = array(); + $hostRegex = null; + $hostTokens = array(); + + if ('' !== $host = $route->getHost()) { + $result = self::compilePattern($route, $host, true); + + $hostVariables = $result['variables']; + $variables = array_merge($variables, $hostVariables); + + $hostTokens = $result['tokens']; + $hostRegex = $result['regex']; + } + + $path = $route->getPath(); + + $result = self::compilePattern($route, $path, false); + + $staticPrefix = $result['staticPrefix']; + + $pathVariables = $result['variables']; + $variables = array_merge($variables, $pathVariables); + + $tokens = $result['tokens']; + $regex = $result['regex']; + + return new CompiledRoute( + $staticPrefix, + $regex, + $tokens, + $pathVariables, + $hostRegex, + $hostTokens, + $hostVariables, + array_unique($variables) + ); + } + + private static function compilePattern(Route $route, $pattern, $isHost) + { + $tokens = array(); + $variables = array(); + $matches = array(); + $pos = 0; + $defaultSeparator = $isHost ? '.' : '/'; + + // Match all variables enclosed in "{}" and iterate over them. But we only want to match the innermost variable + // in case of nested "{}", e.g. {foo{bar}}. This in ensured because \w does not match "{" or "}" itself. + preg_match_all('#\{\w+\}#', $pattern, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); + foreach ($matches as $match) { + $varName = substr($match[0][0], 1, -1); + // get all static text preceding the current variable + $precedingText = substr($pattern, $pos, $match[0][1] - $pos); + $pos = $match[0][1] + strlen($match[0][0]); + $precedingChar = strlen($precedingText) > 0 ? substr($precedingText, -1) : ''; + $isSeparator = '' !== $precedingChar && false !== strpos(static::SEPARATORS, $precedingChar); + + if (is_numeric($varName)) { + throw new \DomainException(sprintf('Variable name "%s" cannot be numeric in route pattern "%s". Please use a different name.', $varName, $pattern)); + } + if (in_array($varName, $variables)) { + throw new \LogicException(sprintf('Route pattern "%s" cannot reference variable name "%s" more than once.', $pattern, $varName)); + } + + if ($isSeparator && strlen($precedingText) > 1) { + $tokens[] = array('text', substr($precedingText, 0, -1)); + } elseif (!$isSeparator && strlen($precedingText) > 0) { + $tokens[] = array('text', $precedingText); + } + + $regexp = $route->getRequirement($varName); + if (null === $regexp) { + $followingPattern = (string) substr($pattern, $pos); + // Find the next static character after the variable that functions as a separator. By default, this separator and '/' + // are disallowed for the variable. This default requirement makes sure that optional variables can be matched at all + // and that the generating-matching-combination of URLs unambiguous, i.e. the params used for generating the URL are + // the same that will be matched. Example: new Route('/{page}.{_format}', array('_format' => 'html')) + // If {page} would also match the separating dot, {_format} would never match as {page} will eagerly consume everything. + // Also even if {_format} was not optional the requirement prevents that {page} matches something that was originally + // part of {_format} when generating the URL, e.g. _format = 'mobile.html'. + $nextSeparator = self::findNextSeparator($followingPattern); + $regexp = sprintf( + '[^%s%s]+', + preg_quote($defaultSeparator, self::REGEX_DELIMITER), + $defaultSeparator !== $nextSeparator && '' !== $nextSeparator ? preg_quote($nextSeparator, self::REGEX_DELIMITER) : '' + ); + if (('' !== $nextSeparator && !preg_match('#^\{\w+\}#', $followingPattern)) || '' === $followingPattern) { + // When we have a separator, which is disallowed for the variable, we can optimize the regex with a possessive + // quantifier. This prevents useless backtracking of PCRE and improves performance by 20% for matching those patterns. + // Given the above example, there is no point in backtracking into {page} (that forbids the dot) when a dot must follow + // after it. This optimization cannot be applied when the next char is no real separator or when the next variable is + // directly adjacent, e.g. '/{x}{y}'. + $regexp .= '+'; + } + } + + $tokens[] = array('variable', $isSeparator ? $precedingChar : '', $regexp, $varName); + $variables[] = $varName; + } + + if ($pos < strlen($pattern)) { + $tokens[] = array('text', substr($pattern, $pos)); + } + + // find the first optional token + $firstOptional = PHP_INT_MAX; + if (!$isHost) { + for ($i = count($tokens) - 1; $i >= 0; $i--) { + $token = $tokens[$i]; + if ('variable' === $token[0] && $route->hasDefault($token[3])) { + $firstOptional = $i; + } else { + break; + } + } + } + + // compute the matching regexp + $regexp = ''; + for ($i = 0, $nbToken = count($tokens); $i < $nbToken; $i++) { + $regexp .= self::computeRegexp($tokens, $i, $firstOptional); + } + + return array( + 'staticPrefix' => 'text' === $tokens[0][0] ? $tokens[0][1] : '', + 'regex' => self::REGEX_DELIMITER.'^'.$regexp.'$'.self::REGEX_DELIMITER.'s', + 'tokens' => array_reverse($tokens), + 'variables' => $variables, + ); + } + + /** + * Returns the next static character in the Route pattern that will serve as a separator. + * + * @param string $pattern The route pattern + * + * @return string The next static character that functions as separator (or empty string when none available) + */ + private static function findNextSeparator($pattern) + { + if ('' == $pattern) { + // return empty string if pattern is empty or false (false which can be returned by substr) + return ''; + } + // first remove all placeholders from the pattern so we can find the next real static character + $pattern = preg_replace('#\{\w+\}#', '', $pattern); + + return isset($pattern[0]) && false !== strpos(static::SEPARATORS, $pattern[0]) ? $pattern[0] : ''; + } + + /** + * Computes the regexp used to match a specific token. It can be static text or a subpattern. + * + * @param array $tokens The route tokens + * @param int $index The index of the current token + * @param int $firstOptional The index of the first optional token + * + * @return string The regexp pattern for a single token + */ + private static function computeRegexp(array $tokens, $index, $firstOptional) + { + $token = $tokens[$index]; + if ('text' === $token[0]) { + // Text tokens + return preg_quote($token[1], self::REGEX_DELIMITER); + } else { + // Variable tokens + if (0 === $index && 0 === $firstOptional) { + // When the only token is an optional variable token, the separator is required + return sprintf('%s(?P<%s>%s)?', preg_quote($token[1], self::REGEX_DELIMITER), $token[3], $token[2]); + } else { + $regexp = sprintf('%s(?P<%s>%s)', preg_quote($token[1], self::REGEX_DELIMITER), $token[3], $token[2]); + if ($index >= $firstOptional) { + // Enclose each optional token in a subpattern to make it optional. + // "?:" means it is non-capturing, i.e. the portion of the subject string that + // matched the optional subpattern is not passed back. + $regexp = "(?:$regexp"; + $nbTokens = count($tokens); + if ($nbTokens - 1 == $index) { + // Close the optional subpatterns + $regexp .= str_repeat(")?", $nbTokens - $firstOptional - (0 === $firstOptional ? 1 : 0)); + } + } + + return $regexp; + } + } + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouteCompilerInterface.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouteCompilerInterface.php new file mode 100644 index 0000000..e6f8ee6 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouteCompilerInterface.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing; + +/** + * RouteCompilerInterface is the interface that all RouteCompiler classes must implement. + * + * @author Fabien Potencier + */ +interface RouteCompilerInterface +{ + /** + * Compiles the current route instance. + * + * @param Route $route A Route instance + * + * @return CompiledRoute A CompiledRoute instance + * + * @throws \LogicException If the Route cannot be compiled because the + * path or host pattern is invalid + */ + public static function compile(Route $route); +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Router.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Router.php new file mode 100644 index 0000000..35b6e2a --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/Router.php @@ -0,0 +1,289 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing; + +use Symfony\Component\Config\Loader\LoaderInterface; +use Symfony\Component\Config\ConfigCache; +use Psr\Log\LoggerInterface; +use Symfony\Component\Routing\Generator\ConfigurableRequirementsInterface; +use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +use Symfony\Component\Routing\Matcher\UrlMatcherInterface; + +/** + * The Router class is an example of the integration of all pieces of the + * routing system for easier use. + * + * @author Fabien Potencier + */ +class Router implements RouterInterface +{ + /** + * @var UrlMatcherInterface|null + */ + protected $matcher; + + /** + * @var UrlGeneratorInterface|null + */ + protected $generator; + + /** + * @var RequestContext + */ + protected $context; + + /** + * @var LoaderInterface + */ + protected $loader; + + /** + * @var RouteCollection|null + */ + protected $collection; + + /** + * @var mixed + */ + protected $resource; + + /** + * @var array + */ + protected $options = array(); + + /** + * @var LoggerInterface|null + */ + protected $logger; + + /** + * Constructor. + * + * @param LoaderInterface $loader A LoaderInterface instance + * @param mixed $resource The main resource to load + * @param array $options An array of options + * @param RequestContext $context The context + * @param LoggerInterface $logger A logger instance + */ + public function __construct(LoaderInterface $loader, $resource, array $options = array(), RequestContext $context = null, LoggerInterface $logger = null) + { + $this->loader = $loader; + $this->resource = $resource; + $this->logger = $logger; + $this->context = null === $context ? new RequestContext() : $context; + $this->setOptions($options); + } + + /** + * Sets options. + * + * Available options: + * + * * cache_dir: The cache directory (or null to disable caching) + * * debug: Whether to enable debugging or not (false by default) + * * resource_type: Type hint for the main resource (optional) + * + * @param array $options An array of options + * + * @throws \InvalidArgumentException When unsupported option is provided + */ + public function setOptions(array $options) + { + $this->options = array( + 'cache_dir' => null, + 'debug' => false, + 'generator_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', + 'generator_base_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', + 'generator_dumper_class' => 'Symfony\\Component\\Routing\\Generator\\Dumper\\PhpGeneratorDumper', + 'generator_cache_class' => 'ProjectUrlGenerator', + 'matcher_class' => 'Symfony\\Component\\Routing\\Matcher\\UrlMatcher', + 'matcher_base_class' => 'Symfony\\Component\\Routing\\Matcher\\UrlMatcher', + 'matcher_dumper_class' => 'Symfony\\Component\\Routing\\Matcher\\Dumper\\PhpMatcherDumper', + 'matcher_cache_class' => 'ProjectUrlMatcher', + 'resource_type' => null, + 'strict_requirements' => true, + ); + + // check option names and live merge, if errors are encountered Exception will be thrown + $invalid = array(); + foreach ($options as $key => $value) { + if (array_key_exists($key, $this->options)) { + $this->options[$key] = $value; + } else { + $invalid[] = $key; + } + } + + if ($invalid) { + throw new \InvalidArgumentException(sprintf('The Router does not support the following options: "%s".', implode('", "', $invalid))); + } + } + + /** + * Sets an option. + * + * @param string $key The key + * @param mixed $value The value + * + * @throws \InvalidArgumentException + */ + public function setOption($key, $value) + { + if (!array_key_exists($key, $this->options)) { + throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key)); + } + + $this->options[$key] = $value; + } + + /** + * Gets an option value. + * + * @param string $key The key + * + * @return mixed The value + * + * @throws \InvalidArgumentException + */ + public function getOption($key) + { + if (!array_key_exists($key, $this->options)) { + throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key)); + } + + return $this->options[$key]; + } + + /** + * {@inheritdoc} + */ + public function getRouteCollection() + { + if (null === $this->collection) { + $this->collection = $this->loader->load($this->resource, $this->options['resource_type']); + } + + return $this->collection; + } + + /** + * {@inheritdoc} + */ + public function setContext(RequestContext $context) + { + $this->context = $context; + + if (null !== $this->matcher) { + $this->getMatcher()->setContext($context); + } + if (null !== $this->generator) { + $this->getGenerator()->setContext($context); + } + } + + /** + * {@inheritdoc} + */ + public function getContext() + { + return $this->context; + } + + /** + * {@inheritdoc} + */ + public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH) + { + return $this->getGenerator()->generate($name, $parameters, $referenceType); + } + + /** + * {@inheritdoc} + */ + public function match($pathinfo) + { + return $this->getMatcher()->match($pathinfo); + } + + /** + * Gets the UrlMatcher instance associated with this Router. + * + * @return UrlMatcherInterface A UrlMatcherInterface instance + */ + public function getMatcher() + { + if (null !== $this->matcher) { + return $this->matcher; + } + + if (null === $this->options['cache_dir'] || null === $this->options['matcher_cache_class']) { + return $this->matcher = new $this->options['matcher_class']($this->getRouteCollection(), $this->context); + } + + $class = $this->options['matcher_cache_class']; + $cache = new ConfigCache($this->options['cache_dir'].'/'.$class.'.php', $this->options['debug']); + if (!$cache->isFresh()) { + $dumper = new $this->options['matcher_dumper_class']($this->getRouteCollection()); + + $options = array( + 'class' => $class, + 'base_class' => $this->options['matcher_base_class'], + ); + + $cache->write($dumper->dump($options), $this->getRouteCollection()->getResources()); + } + + require_once $cache; + + return $this->matcher = new $class($this->context); + } + + /** + * Gets the UrlGenerator instance associated with this Router. + * + * @return UrlGeneratorInterface A UrlGeneratorInterface instance + */ + public function getGenerator() + { + if (null !== $this->generator) { + return $this->generator; + } + + if (null === $this->options['cache_dir'] || null === $this->options['generator_cache_class']) { + $this->generator = new $this->options['generator_class']($this->getRouteCollection(), $this->context, $this->logger); + } else { + $class = $this->options['generator_cache_class']; + $cache = new ConfigCache($this->options['cache_dir'].'/'.$class.'.php', $this->options['debug']); + if (!$cache->isFresh()) { + $dumper = new $this->options['generator_dumper_class']($this->getRouteCollection()); + + $options = array( + 'class' => $class, + 'base_class' => $this->options['generator_base_class'], + ); + + $cache->write($dumper->dump($options), $this->getRouteCollection()->getResources()); + } + + require_once $cache; + + $this->generator = new $class($this->context, $this->logger); + } + + if ($this->generator instanceof ConfigurableRequirementsInterface) { + $this->generator->setStrictRequirements($this->options['strict_requirements']); + } + + return $this->generator; + } +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouterInterface.php b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouterInterface.php new file mode 100644 index 0000000..a10ae34 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/RouterInterface.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing; + +use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +use Symfony\Component\Routing\Matcher\UrlMatcherInterface; + +/** + * RouterInterface is the interface that all Router classes must implement. + * + * This interface is the concatenation of UrlMatcherInterface and UrlGeneratorInterface. + * + * @author Fabien Potencier + */ +interface RouterInterface extends UrlMatcherInterface, UrlGeneratorInterface +{ + /** + * Gets the RouteCollection instance associated with this Router. + * + * @return RouteCollection A RouteCollection instance + */ + public function getRouteCollection(); +} diff --git a/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/composer.json b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/composer.json new file mode 100644 index 0000000..18c06d3 --- /dev/null +++ b/sources/phpBB/vendor/symfony/routing/Symfony/Component/Routing/composer.json @@ -0,0 +1,43 @@ +{ + "name": "symfony/routing", + "type": "library", + "description": "Symfony Routing Component", + "keywords": [], + "homepage": "http://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/config": "~2.2", + "symfony/http-foundation": "~2.3", + "symfony/yaml": "~2.0", + "doctrine/common": "~2.2", + "psr/log": "~1.0" + }, + "suggest": { + "symfony/config": "", + "symfony/yaml": "", + "doctrine/common": "" + }, + "autoload": { + "psr-0": { "Symfony\\Component\\Routing\\": "" } + }, + "target-dir": "Symfony/Component/Routing", + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + } +} diff --git a/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php new file mode 100644 index 0000000..26103c8 --- /dev/null +++ b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +/** + * Dumper dumps PHP variables to YAML strings. + * + * @author Fabien Potencier + */ +class Dumper +{ + /** + * The amount of spaces to use for indentation of nested nodes. + * + * @var int + */ + protected $indentation = 4; + + /** + * Sets the indentation. + * + * @param int $num The amount of spaces to use for indentation of nested nodes. + */ + public function setIndentation($num) + { + $this->indentation = (int) $num; + } + + /** + * Dumps a PHP value to YAML. + * + * @param mixed $input The PHP value + * @param int $inline The level where you switch to inline YAML + * @param int $indent The level of indentation (used internally) + * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport true if object support is enabled, false otherwise + * + * @return string The YAML representation of the PHP value + */ + public function dump($input, $inline = 0, $indent = 0, $exceptionOnInvalidType = false, $objectSupport = false) + { + $output = ''; + $prefix = $indent ? str_repeat(' ', $indent) : ''; + + if ($inline <= 0 || !is_array($input) || empty($input)) { + $output .= $prefix.Inline::dump($input, $exceptionOnInvalidType, $objectSupport); + } else { + $isAHash = array_keys($input) !== range(0, count($input) - 1); + + foreach ($input as $key => $value) { + $willBeInlined = $inline - 1 <= 0 || !is_array($value) || empty($value); + + $output .= sprintf('%s%s%s%s', + $prefix, + $isAHash ? Inline::dump($key, $exceptionOnInvalidType, $objectSupport).':' : '-', + $willBeInlined ? ' ' : "\n", + $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $exceptionOnInvalidType, $objectSupport) + ).($willBeInlined ? "\n" : ''); + } + } + + return $output; + } +} diff --git a/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php new file mode 100644 index 0000000..7f6ec2b --- /dev/null +++ b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +/** + * Escaper encapsulates escaping rules for single and double-quoted + * YAML strings. + * + * @author Matthew Lewinski + */ +class Escaper +{ + // Characters that would cause a dumped string to require double quoting. + const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9"; + + // Mapping arrays for escaping a double quoted string. The backslash is + // first to ensure proper escaping because str_replace operates iteratively + // on the input arrays. This ordering of the characters avoids the use of strtr, + // which performs more slowly. + private static $escapees = array('\\', '\\\\', '\\"', '"', + "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", + "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", + "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", + "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", + "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",); + private static $escaped = array('\\\\', '\\"', '\\\\', '\\"', + "\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", "\\x06", "\\a", + "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", + "\\x10", "\\x11", "\\x12", "\\x13", "\\x14", "\\x15", "\\x16", "\\x17", + "\\x18", "\\x19", "\\x1a", "\\e", "\\x1c", "\\x1d", "\\x1e", "\\x1f", + "\\N", "\\_", "\\L", "\\P",); + + /** + * Determines if a PHP value would require double quoting in YAML. + * + * @param string $value A PHP value + * + * @return bool True if the value would require double quotes. + */ + public static function requiresDoubleQuoting($value) + { + return preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value); + } + + /** + * Escapes and surrounds a PHP value with double quotes. + * + * @param string $value A PHP value + * + * @return string The quoted, escaped string + */ + public static function escapeWithDoubleQuotes($value) + { + return sprintf('"%s"', str_replace(self::$escapees, self::$escaped, $value)); + } + + /** + * Determines if a PHP value would require single quoting in YAML. + * + * @param string $value A PHP value + * + * @return bool True if the value would require single quotes. + */ + public static function requiresSingleQuoting($value) + { + return preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value); + } + + /** + * Escapes and surrounds a PHP value with single quotes. + * + * @param string $value A PHP value + * + * @return string The quoted, escaped string + */ + public static function escapeWithSingleQuotes($value) + { + return sprintf("'%s'", str_replace('\'', '\'\'', $value)); + } +} diff --git a/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/DumpException.php b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/DumpException.php new file mode 100644 index 0000000..9b3e6de --- /dev/null +++ b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/DumpException.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Exception; + +/** + * Exception class thrown when an error occurs during dumping. + * + * @author Fabien Potencier + * + * @api + */ +class DumpException extends RuntimeException +{ +} diff --git a/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ExceptionInterface.php b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ExceptionInterface.php new file mode 100644 index 0000000..92e5c2e --- /dev/null +++ b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ExceptionInterface.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Exception; + +/** + * Exception interface for all exceptions thrown by the component. + * + * @author Fabien Potencier + * + * @api + */ +interface ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php new file mode 100644 index 0000000..ff01d6b --- /dev/null +++ b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php @@ -0,0 +1,148 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Exception; + +if (!defined('JSON_UNESCAPED_UNICODE')) { + define('JSON_UNESCAPED_SLASHES', 64); + define('JSON_UNESCAPED_UNICODE', 256); +} + +/** + * Exception class thrown when an error occurs during parsing. + * + * @author Fabien Potencier + * + * @api + */ +class ParseException extends RuntimeException +{ + private $parsedFile; + private $parsedLine; + private $snippet; + private $rawMessage; + + /** + * Constructor. + * + * @param string $message The error message + * @param int $parsedLine The line where the error occurred + * @param int $snippet The snippet of code near the problem + * @param string $parsedFile The file name where the error occurred + * @param \Exception $previous The previous exception + */ + public function __construct($message, $parsedLine = -1, $snippet = null, $parsedFile = null, \Exception $previous = null) + { + $this->parsedFile = $parsedFile; + $this->parsedLine = $parsedLine; + $this->snippet = $snippet; + $this->rawMessage = $message; + + $this->updateRepr(); + + parent::__construct($this->message, 0, $previous); + } + + /** + * Gets the snippet of code near the error. + * + * @return string The snippet of code + */ + public function getSnippet() + { + return $this->snippet; + } + + /** + * Sets the snippet of code near the error. + * + * @param string $snippet The code snippet + */ + public function setSnippet($snippet) + { + $this->snippet = $snippet; + + $this->updateRepr(); + } + + /** + * Gets the filename where the error occurred. + * + * This method returns null if a string is parsed. + * + * @return string The filename + */ + public function getParsedFile() + { + return $this->parsedFile; + } + + /** + * Sets the filename where the error occurred. + * + * @param string $parsedFile The filename + */ + public function setParsedFile($parsedFile) + { + $this->parsedFile = $parsedFile; + + $this->updateRepr(); + } + + /** + * Gets the line where the error occurred. + * + * @return int The file line + */ + public function getParsedLine() + { + return $this->parsedLine; + } + + /** + * Sets the line where the error occurred. + * + * @param int $parsedLine The file line + */ + public function setParsedLine($parsedLine) + { + $this->parsedLine = $parsedLine; + + $this->updateRepr(); + } + + private function updateRepr() + { + $this->message = $this->rawMessage; + + $dot = false; + if ('.' === substr($this->message, -1)) { + $this->message = substr($this->message, 0, -1); + $dot = true; + } + + if (null !== $this->parsedFile) { + $this->message .= sprintf(' in %s', json_encode($this->parsedFile, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); + } + + if ($this->parsedLine >= 0) { + $this->message .= sprintf(' at line %d', $this->parsedLine); + } + + if ($this->snippet) { + $this->message .= sprintf(' (near "%s")', $this->snippet); + } + + if ($dot) { + $this->message .= '.'; + } + } +} diff --git a/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/RuntimeException.php b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/RuntimeException.php new file mode 100644 index 0000000..3573bf1 --- /dev/null +++ b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/RuntimeException.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Exception; + +/** + * Exception class thrown when an error occurs during parsing. + * + * @author Romain Neutron + * + * @api + */ +class RuntimeException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php new file mode 100644 index 0000000..fc00405 --- /dev/null +++ b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php @@ -0,0 +1,498 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +use Symfony\Component\Yaml\Exception\ParseException; +use Symfony\Component\Yaml\Exception\DumpException; + +/** + * Inline implements a YAML parser/dumper for the YAML inline syntax. + * + * @author Fabien Potencier + */ +class Inline +{ + const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\']*(?:\'\'[^\']*)*)\')'; + + private static $exceptionOnInvalidType = false; + private static $objectSupport = false; + + /** + * Converts a YAML string to a PHP array. + * + * @param string $value A YAML string + * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport true if object support is enabled, false otherwise + * @param array $references Mapping of variable names to values + * + * @return array A PHP array representing the YAML string + * + * @throws ParseException + */ + public static function parse($value, $exceptionOnInvalidType = false, $objectSupport = false, $references = array()) + { + self::$exceptionOnInvalidType = $exceptionOnInvalidType; + self::$objectSupport = $objectSupport; + + $value = trim($value); + + if (0 == strlen($value)) { + return ''; + } + + if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('ASCII'); + } + + $i = 0; + switch ($value[0]) { + case '[': + $result = self::parseSequence($value, $i, $references); + ++$i; + break; + case '{': + $result = self::parseMapping($value, $i, $references); + ++$i; + break; + default: + $result = self::parseScalar($value, null, array('"', "'"), $i, true, $references); + } + + // some comments are allowed at the end + if (preg_replace('/\s+#.*$/A', '', substr($value, $i))) { + throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i))); + } + + if (isset($mbEncoding)) { + mb_internal_encoding($mbEncoding); + } + + return $result; + } + + /** + * Dumps a given PHP variable to a YAML string. + * + * @param mixed $value The PHP variable to convert + * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport true if object support is enabled, false otherwise + * + * @return string The YAML string representing the PHP array + * + * @throws DumpException When trying to dump PHP resource + */ + public static function dump($value, $exceptionOnInvalidType = false, $objectSupport = false) + { + switch (true) { + case is_resource($value): + if ($exceptionOnInvalidType) { + throw new DumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value))); + } + + return 'null'; + case is_object($value): + if ($objectSupport) { + return '!!php/object:'.serialize($value); + } + + if ($exceptionOnInvalidType) { + throw new DumpException('Object support when dumping a YAML file has been disabled.'); + } + + return 'null'; + case is_array($value): + return self::dumpArray($value, $exceptionOnInvalidType, $objectSupport); + case null === $value: + return 'null'; + case true === $value: + return 'true'; + case false === $value: + return 'false'; + case ctype_digit($value): + return is_string($value) ? "'$value'" : (int) $value; + case is_numeric($value): + $locale = setlocale(LC_NUMERIC, 0); + if (false !== $locale) { + setlocale(LC_NUMERIC, 'C'); + } + $repr = is_string($value) ? "'$value'" : (is_infinite($value) ? str_ireplace('INF', '.Inf', strval($value)) : strval($value)); + + if (false !== $locale) { + setlocale(LC_NUMERIC, $locale); + } + + return $repr; + case Escaper::requiresDoubleQuoting($value): + return Escaper::escapeWithDoubleQuotes($value); + case Escaper::requiresSingleQuoting($value): + return Escaper::escapeWithSingleQuotes($value); + case '' == $value: + return "''"; + case preg_match(self::getTimestampRegex(), $value): + case in_array(strtolower($value), array('null', '~', 'true', 'false')): + return "'$value'"; + default: + return $value; + } + } + + /** + * Dumps a PHP array to a YAML string. + * + * @param array $value The PHP array to dump + * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport true if object support is enabled, false otherwise + * + * @return string The YAML string representing the PHP array + */ + private static function dumpArray($value, $exceptionOnInvalidType, $objectSupport) + { + // array + $keys = array_keys($value); + if ((1 == count($keys) && '0' == $keys[0]) + || (count($keys) > 1 && array_reduce($keys, function ($v, $w) { return (int) $v + $w; }, 0) == count($keys) * (count($keys) - 1) / 2) + ) { + $output = array(); + foreach ($value as $val) { + $output[] = self::dump($val, $exceptionOnInvalidType, $objectSupport); + } + + return sprintf('[%s]', implode(', ', $output)); + } + + // mapping + $output = array(); + foreach ($value as $key => $val) { + $output[] = sprintf('%s: %s', self::dump($key, $exceptionOnInvalidType, $objectSupport), self::dump($val, $exceptionOnInvalidType, $objectSupport)); + } + + return sprintf('{ %s }', implode(', ', $output)); + } + + /** + * Parses a scalar to a YAML string. + * + * @param scalar $scalar + * @param string $delimiters + * @param array $stringDelimiters + * @param int &$i + * @param bool $evaluate + * @param array $references + * + * @return string A YAML string + * + * @throws ParseException When malformed inline YAML string is parsed + */ + public static function parseScalar($scalar, $delimiters = null, $stringDelimiters = array('"', "'"), &$i = 0, $evaluate = true, $references = array()) + { + if (in_array($scalar[$i], $stringDelimiters)) { + // quoted scalar + $output = self::parseQuotedScalar($scalar, $i); + + if (null !== $delimiters) { + $tmp = ltrim(substr($scalar, $i), ' '); + if (!in_array($tmp[0], $delimiters)) { + throw new ParseException(sprintf('Unexpected characters (%s).', substr($scalar, $i))); + } + } + } else { + // "normal" string + if (!$delimiters) { + $output = substr($scalar, $i); + $i += strlen($output); + + // remove comments + if (false !== $strpos = strpos($output, ' #')) { + $output = rtrim(substr($output, 0, $strpos)); + } + } elseif (preg_match('/^(.+?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) { + $output = $match[1]; + $i += strlen($output); + } else { + throw new ParseException(sprintf('Malformed inline YAML string (%s).', $scalar)); + } + + if ($evaluate) { + $output = self::evaluateScalar($output, $references); + } + } + + return $output; + } + + /** + * Parses a quoted scalar to YAML. + * + * @param string $scalar + * @param int &$i + * + * @return string A YAML string + * + * @throws ParseException When malformed inline YAML string is parsed + */ + private static function parseQuotedScalar($scalar, &$i) + { + if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { + throw new ParseException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i))); + } + + $output = substr($match[0], 1, strlen($match[0]) - 2); + + $unescaper = new Unescaper(); + if ('"' == $scalar[$i]) { + $output = $unescaper->unescapeDoubleQuotedString($output); + } else { + $output = $unescaper->unescapeSingleQuotedString($output); + } + + $i += strlen($match[0]); + + return $output; + } + + /** + * Parses a sequence to a YAML string. + * + * @param string $sequence + * @param int &$i + * @param array $references + * + * @return string A YAML string + * + * @throws ParseException When malformed inline YAML string is parsed + */ + private static function parseSequence($sequence, &$i = 0, $references = array()) + { + $output = array(); + $len = strlen($sequence); + $i += 1; + + // [foo, bar, ...] + while ($i < $len) { + switch ($sequence[$i]) { + case '[': + // nested sequence + $output[] = self::parseSequence($sequence, $i, $references); + break; + case '{': + // nested mapping + $output[] = self::parseMapping($sequence, $i, $references); + break; + case ']': + return $output; + case ',': + case ' ': + break; + default: + $isQuoted = in_array($sequence[$i], array('"', "'")); + $value = self::parseScalar($sequence, array(',', ']'), array('"', "'"), $i, true, $references); + + // the value can be an array if a reference has been resolved to an array var + if (!is_array($value) && !$isQuoted && false !== strpos($value, ': ')) { + // embedded mapping? + try { + $pos = 0; + $value = self::parseMapping('{'.$value.'}', $pos, $references); + } catch (\InvalidArgumentException $e) { + // no, it's not + } + } + + $output[] = $value; + + --$i; + } + + ++$i; + } + + throw new ParseException(sprintf('Malformed inline YAML string %s', $sequence)); + } + + /** + * Parses a mapping to a YAML string. + * + * @param string $mapping + * @param int &$i + * @param array $references + * + * @return string A YAML string + * + * @throws ParseException When malformed inline YAML string is parsed + */ + private static function parseMapping($mapping, &$i = 0, $references = array()) + { + $output = array(); + $len = strlen($mapping); + $i += 1; + + // {foo: bar, bar:foo, ...} + while ($i < $len) { + switch ($mapping[$i]) { + case ' ': + case ',': + ++$i; + continue 2; + case '}': + return $output; + } + + // key + $key = self::parseScalar($mapping, array(':', ' '), array('"', "'"), $i, false); + + // value + $done = false; + while ($i < $len) { + switch ($mapping[$i]) { + case '[': + // nested sequence + $output[$key] = self::parseSequence($mapping, $i, $references); + $done = true; + break; + case '{': + // nested mapping + $output[$key] = self::parseMapping($mapping, $i, $references); + $done = true; + break; + case ':': + case ' ': + break; + default: + $output[$key] = self::parseScalar($mapping, array(',', '}'), array('"', "'"), $i, true, $references); + $done = true; + --$i; + } + + ++$i; + + if ($done) { + continue 2; + } + } + } + + throw new ParseException(sprintf('Malformed inline YAML string %s', $mapping)); + } + + /** + * Evaluates scalars and replaces magic values. + * + * @param string $scalar + * @param array $references + * + * @return string A YAML string + * + * @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved + */ + private static function evaluateScalar($scalar, $references = array()) + { + $scalar = trim($scalar); + $scalarLower = strtolower($scalar); + + if (0 === strpos($scalar, '*')) { + if (false !== $pos = strpos($scalar, '#')) { + $value = substr($scalar, 1, $pos - 2); + } else { + $value = substr($scalar, 1); + } + + // an unquoted * + if (false === $value || '' === $value) { + throw new ParseException('A reference must contain at least one character.'); + } + + if (!array_key_exists($value, $references)) { + throw new ParseException(sprintf('Reference "%s" does not exist.', $value)); + } + + return $references[$value]; + } + + switch (true) { + case 'null' === $scalarLower: + case '' === $scalar: + case '~' === $scalar: + return; + case 'true' === $scalarLower: + return true; + case 'false' === $scalarLower: + return false; + // Optimise for returning strings. + case $scalar[0] === '+' || $scalar[0] === '-' || $scalar[0] === '.' || $scalar[0] === '!' || is_numeric($scalar[0]): + switch (true) { + case 0 === strpos($scalar, '!str'): + return (string) substr($scalar, 5); + case 0 === strpos($scalar, '! '): + return intval(self::parseScalar(substr($scalar, 2))); + case 0 === strpos($scalar, '!!php/object:'): + if (self::$objectSupport) { + return unserialize(substr($scalar, 13)); + } + + if (self::$exceptionOnInvalidType) { + throw new ParseException('Object support when parsing a YAML file has been disabled.'); + } + + return; + case ctype_digit($scalar): + $raw = $scalar; + $cast = intval($scalar); + + return '0' == $scalar[0] ? octdec($scalar) : (((string) $raw == (string) $cast) ? $cast : $raw); + case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)): + $raw = $scalar; + $cast = intval($scalar); + + return '0' == $scalar[1] ? octdec($scalar) : (((string) $raw == (string) $cast) ? $cast : $raw); + case is_numeric($scalar): + return '0x' == $scalar[0].$scalar[1] ? hexdec($scalar) : floatval($scalar); + case '.inf' === $scalarLower: + case '.nan' === $scalarLower: + return -log(0); + case '-.inf' === $scalarLower: + return log(0); + case preg_match('/^(-|\+)?[0-9,]+(\.[0-9]+)?$/', $scalar): + return floatval(str_replace(',', '', $scalar)); + case preg_match(self::getTimestampRegex(), $scalar): + return strtotime($scalar); + } + default: + return (string) $scalar; + } + } + + /** + * Gets a regex that matches a YAML date. + * + * @return string The regular expression + * + * @see http://www.yaml.org/spec/1.2/spec.html#id2761573 + */ + private static function getTimestampRegex() + { + return <<[0-9][0-9][0-9][0-9]) + -(?P[0-9][0-9]?) + -(?P[0-9][0-9]?) + (?:(?:[Tt]|[ \t]+) + (?P[0-9][0-9]?) + :(?P[0-9][0-9]) + :(?P[0-9][0-9]) + (?:\.(?P[0-9]*))? + (?:[ \t]*(?PZ|(?P[-+])(?P[0-9][0-9]?) + (?::(?P[0-9][0-9]))?))?)? + $~x +EOF; + } +} diff --git a/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE new file mode 100644 index 0000000..0b3292c --- /dev/null +++ b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2014 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php new file mode 100644 index 0000000..910db80 --- /dev/null +++ b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php @@ -0,0 +1,650 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +use Symfony\Component\Yaml\Exception\ParseException; + +/** + * Parser parses YAML strings to convert them to PHP arrays. + * + * @author Fabien Potencier + */ +class Parser +{ + const FOLDED_SCALAR_PATTERN = '(?P\||>)(?P\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P +#.*)?'; + + private $offset = 0; + private $lines = array(); + private $currentLineNb = -1; + private $currentLine = ''; + private $refs = array(); + + /** + * Constructor + * + * @param int $offset The offset of YAML document (used for line numbers in error messages) + */ + public function __construct($offset = 0) + { + $this->offset = $offset; + } + + /** + * Parses a YAML string to a PHP value. + * + * @param string $value A YAML string + * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport true if object support is enabled, false otherwise + * + * @return mixed A PHP value + * + * @throws ParseException If the YAML is not valid + */ + public function parse($value, $exceptionOnInvalidType = false, $objectSupport = false) + { + $this->currentLineNb = -1; + $this->currentLine = ''; + $this->lines = explode("\n", $this->cleanup($value)); + + if (!preg_match('//u', $value)) { + throw new ParseException('The YAML value does not appear to be valid UTF-8.'); + } + + if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('UTF-8'); + } + + $data = array(); + $context = null; + while ($this->moveToNextLine()) { + if ($this->isCurrentLineEmpty()) { + continue; + } + + // tab? + if ("\t" === $this->currentLine[0]) { + throw new ParseException('A YAML file cannot contain tabs as indentation.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + + $isRef = $isInPlace = $isProcessed = false; + if (preg_match('#^\-((?P\s+)(?P.+?))?\s*$#u', $this->currentLine, $values)) { + if ($context && 'mapping' == $context) { + throw new ParseException('You cannot define a sequence item when in a mapping'); + } + $context = 'sequence'; + + if (isset($values['value']) && preg_match('#^&(?P[^ ]+) *(?P.*)#u', $values['value'], $matches)) { + $isRef = $matches['ref']; + $values['value'] = $matches['value']; + } + + // array + if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { + $c = $this->getRealCurrentLineNb() + 1; + $parser = new Parser($c); + $parser->refs = & $this->refs; + $data[] = $parser->parse($this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport); + } else { + if (isset($values['leadspaces']) + && ' ' == $values['leadspaces'] + && preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P.+?))?\s*$#u', $values['value'], $matches) + ) { + // this is a compact notation element, add to next block and parse + $c = $this->getRealCurrentLineNb(); + $parser = new Parser($c); + $parser->refs = & $this->refs; + + $block = $values['value']; + if ($this->isNextLineIndented()) { + $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + 2); + } + + $data[] = $parser->parse($block, $exceptionOnInvalidType, $objectSupport); + } else { + $data[] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport); + } + } + } elseif (preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P.+?))?\s*$#u', $this->currentLine, $values) && (false === strpos($values['key'],' #') || in_array($values['key'][0], array('"', "'")))) { + if ($context && 'sequence' == $context) { + throw new ParseException('You cannot define a mapping item when in a sequence'); + } + $context = 'mapping'; + + // force correct settings + Inline::parse(null, $exceptionOnInvalidType, $objectSupport, $this->refs); + try { + $key = Inline::parseScalar($values['key']); + } catch (ParseException $e) { + $e->setParsedLine($this->getRealCurrentLineNb() + 1); + $e->setSnippet($this->currentLine); + + throw $e; + } + + if ('<<' === $key) { + if (isset($values['value']) && 0 === strpos($values['value'], '*')) { + $isInPlace = substr($values['value'], 1); + if (!array_key_exists($isInPlace, $this->refs)) { + throw new ParseException(sprintf('Reference "%s" does not exist.', $isInPlace), $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + } else { + if (isset($values['value']) && $values['value'] !== '') { + $value = $values['value']; + } else { + $value = $this->getNextEmbedBlock(); + } + $c = $this->getRealCurrentLineNb() + 1; + $parser = new Parser($c); + $parser->refs = & $this->refs; + $parsed = $parser->parse($value, $exceptionOnInvalidType, $objectSupport); + + $merged = array(); + if (!is_array($parsed)) { + throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } elseif (isset($parsed[0])) { + // Numeric array, merge individual elements + foreach (array_reverse($parsed) as $parsedItem) { + if (!is_array($parsedItem)) { + throw new ParseException('Merge items must be arrays.', $this->getRealCurrentLineNb() + 1, $parsedItem); + } + $merged = array_merge($parsedItem, $merged); + } + } else { + // Associative array, merge + $merged = array_merge($merged, $parsed); + } + + $isProcessed = $merged; + } + } elseif (isset($values['value']) && preg_match('#^&(?P[^ ]+) *(?P.*)#u', $values['value'], $matches)) { + $isRef = $matches['ref']; + $values['value'] = $matches['value']; + } + + if ($isProcessed) { + // Merge keys + $data = $isProcessed; + // hash + } elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { + // if next line is less indented or equal, then it means that the current value is null + if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) { + $data[$key] = null; + } else { + $c = $this->getRealCurrentLineNb() + 1; + $parser = new Parser($c); + $parser->refs = & $this->refs; + $data[$key] = $parser->parse($this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport); + } + } else { + if ($isInPlace) { + $data = $this->refs[$isInPlace]; + } else { + $data[$key] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport); + } + } + } else { + // 1-liner optionally followed by newline + $lineCount = count($this->lines); + if (1 === $lineCount || (2 === $lineCount && empty($this->lines[1]))) { + try { + $value = Inline::parse($this->lines[0], $exceptionOnInvalidType, $objectSupport, $this->refs); + } catch (ParseException $e) { + $e->setParsedLine($this->getRealCurrentLineNb() + 1); + $e->setSnippet($this->currentLine); + + throw $e; + } + + if (is_array($value)) { + $first = reset($value); + if (is_string($first) && 0 === strpos($first, '*')) { + $data = array(); + foreach ($value as $alias) { + $data[] = $this->refs[substr($alias, 1)]; + } + $value = $data; + } + } + + if (isset($mbEncoding)) { + mb_internal_encoding($mbEncoding); + } + + return $value; + } + + switch (preg_last_error()) { + case PREG_INTERNAL_ERROR: + $error = 'Internal PCRE error.'; + break; + case PREG_BACKTRACK_LIMIT_ERROR: + $error = 'pcre.backtrack_limit reached.'; + break; + case PREG_RECURSION_LIMIT_ERROR: + $error = 'pcre.recursion_limit reached.'; + break; + case PREG_BAD_UTF8_ERROR: + $error = 'Malformed UTF-8 data.'; + break; + case PREG_BAD_UTF8_OFFSET_ERROR: + $error = 'Offset doesn\'t correspond to the begin of a valid UTF-8 code point.'; + break; + default: + $error = 'Unable to parse.'; + } + + throw new ParseException($error, $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + + if ($isRef) { + $this->refs[$isRef] = end($data); + } + } + + if (isset($mbEncoding)) { + mb_internal_encoding($mbEncoding); + } + + return empty($data) ? null : $data; + } + + /** + * Returns the current line number (takes the offset into account). + * + * @return int The current line number + */ + private function getRealCurrentLineNb() + { + return $this->currentLineNb + $this->offset; + } + + /** + * Returns the current line indentation. + * + * @return int The current line indentation + */ + private function getCurrentLineIndentation() + { + return strlen($this->currentLine) - strlen(ltrim($this->currentLine, ' ')); + } + + /** + * Returns the next embed block of YAML. + * + * @param int $indentation The indent level at which the block is to be read, or null for default + * @param bool $inSequence True if the enclosing data structure is a sequence + * + * @return string A YAML string + * + * @throws ParseException When indentation problem are detected + */ + private function getNextEmbedBlock($indentation = null, $inSequence = false) + { + $oldLineIndentation = $this->getCurrentLineIndentation(); + + if (!$this->moveToNextLine()) { + return; + } + + if (null === $indentation) { + $newIndent = $this->getCurrentLineIndentation(); + + $unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem($this->currentLine); + + if (!$this->isCurrentLineEmpty() && 0 === $newIndent && !$unindentedEmbedBlock) { + throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + } else { + $newIndent = $indentation; + } + + $data = array(substr($this->currentLine, $newIndent)); + + if ($inSequence && $oldLineIndentation === $newIndent && '-' === $data[0][0]) { + // the previous line contained a dash but no item content, this line is a sequence item with the same indentation + // and therefore no nested list or mapping + $this->moveToPreviousLine(); + + return; + } + + $isItUnindentedCollection = $this->isStringUnIndentedCollectionItem($this->currentLine); + + // Comments must not be removed inside a string block (ie. after a line ending with "|") + $removeCommentsPattern = '~'.self::FOLDED_SCALAR_PATTERN.'$~'; + $removeComments = !preg_match($removeCommentsPattern, $this->currentLine); + + while ($this->moveToNextLine()) { + $indent = $this->getCurrentLineIndentation(); + + if ($indent === $newIndent) { + $removeComments = !preg_match($removeCommentsPattern, $this->currentLine); + } + + if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem($this->currentLine)) { + $this->moveToPreviousLine(); + break; + } + + if ($this->isCurrentLineBlank()) { + $data[] = substr($this->currentLine, $newIndent); + continue; + } + + if ($removeComments && $this->isCurrentLineComment()) { + continue; + } + + if ($indent >= $newIndent) { + $data[] = substr($this->currentLine, $newIndent); + } elseif (0 == $indent) { + $this->moveToPreviousLine(); + + break; + } else { + throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + } + + return implode("\n", $data); + } + + /** + * Moves the parser to the next line. + * + * @return bool + */ + private function moveToNextLine() + { + if ($this->currentLineNb >= count($this->lines) - 1) { + return false; + } + + $this->currentLine = $this->lines[++$this->currentLineNb]; + + return true; + } + + /** + * Moves the parser to the previous line. + */ + private function moveToPreviousLine() + { + $this->currentLine = $this->lines[--$this->currentLineNb]; + } + + /** + * Parses a YAML value. + * + * @param string $value A YAML value + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise + * + * @return mixed A PHP value + * + * @throws ParseException When reference does not exist + */ + private function parseValue($value, $exceptionOnInvalidType, $objectSupport) + { + if (0 === strpos($value, '*')) { + if (false !== $pos = strpos($value, '#')) { + $value = substr($value, 1, $pos - 2); + } else { + $value = substr($value, 1); + } + + if (!array_key_exists($value, $this->refs)) { + throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLine); + } + + return $this->refs[$value]; + } + + if (preg_match('/^'.self::FOLDED_SCALAR_PATTERN.'$/', $value, $matches)) { + $modifiers = isset($matches['modifiers']) ? $matches['modifiers'] : ''; + + return $this->parseFoldedScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), intval(abs($modifiers))); + } + + try { + return Inline::parse($value, $exceptionOnInvalidType, $objectSupport, $this->refs); + } catch (ParseException $e) { + $e->setParsedLine($this->getRealCurrentLineNb() + 1); + $e->setSnippet($this->currentLine); + + throw $e; + } + } + + /** + * Parses a folded scalar. + * + * @param string $separator The separator that was used to begin this folded scalar (| or >) + * @param string $indicator The indicator that was used to begin this folded scalar (+ or -) + * @param int $indentation The indentation that was used to begin this folded scalar + * + * @return string The text value + */ + private function parseFoldedScalar($separator, $indicator = '', $indentation = 0) + { + $notEOF = $this->moveToNextLine(); + if (!$notEOF) { + return ''; + } + + $isCurrentLineBlank = $this->isCurrentLineBlank(); + $text = ''; + + // leading blank lines are consumed before determining indentation + while ($notEOF && $isCurrentLineBlank) { + // newline only if not EOF + if ($notEOF = $this->moveToNextLine()) { + $text .= "\n"; + $isCurrentLineBlank = $this->isCurrentLineBlank(); + } + } + + // determine indentation if not specified + if (0 === $indentation) { + if (preg_match('/^ +/', $this->currentLine, $matches)) { + $indentation = strlen($matches[0]); + } + } + + if ($indentation > 0) { + $pattern = sprintf('/^ {%d}(.*)$/', $indentation); + + while ( + $notEOF && ( + $isCurrentLineBlank || + preg_match($pattern, $this->currentLine, $matches) + ) + ) { + if ($isCurrentLineBlank) { + $text .= substr($this->currentLine, $indentation); + } else { + $text .= $matches[1]; + } + + // newline only if not EOF + if ($notEOF = $this->moveToNextLine()) { + $text .= "\n"; + $isCurrentLineBlank = $this->isCurrentLineBlank(); + } + } + } elseif ($notEOF) { + $text .= "\n"; + } + + if ($notEOF) { + $this->moveToPreviousLine(); + } + + // replace all non-trailing single newlines with spaces in folded blocks + if ('>' === $separator) { + preg_match('/(\n*)$/', $text, $matches); + $text = preg_replace('/(?getCurrentLineIndentation(); + $EOF = !$this->moveToNextLine(); + + while (!$EOF && $this->isCurrentLineEmpty()) { + $EOF = !$this->moveToNextLine(); + } + + if ($EOF) { + return false; + } + + $ret = false; + if ($this->getCurrentLineIndentation() > $currentIndentation) { + $ret = true; + } + + $this->moveToPreviousLine(); + + return $ret; + } + + /** + * Returns true if the current line is blank or if it is a comment line. + * + * @return bool Returns true if the current line is empty or if it is a comment line, false otherwise + */ + private function isCurrentLineEmpty() + { + return $this->isCurrentLineBlank() || $this->isCurrentLineComment(); + } + + /** + * Returns true if the current line is blank. + * + * @return bool Returns true if the current line is blank, false otherwise + */ + private function isCurrentLineBlank() + { + return '' == trim($this->currentLine, ' '); + } + + /** + * Returns true if the current line is a comment line. + * + * @return bool Returns true if the current line is a comment line, false otherwise + */ + private function isCurrentLineComment() + { + //checking explicitly the first char of the trim is faster than loops or strpos + $ltrimmedLine = ltrim($this->currentLine, ' '); + + return $ltrimmedLine[0] === '#'; + } + + /** + * Cleanups a YAML string to be parsed. + * + * @param string $value The input YAML string + * + * @return string A cleaned up YAML string + */ + private function cleanup($value) + { + $value = str_replace(array("\r\n", "\r"), "\n", $value); + + // strip YAML header + $count = 0; + $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#su', '', $value, -1, $count); + $this->offset += $count; + + // remove leading comments + $trimmedValue = preg_replace('#^(\#.*?\n)+#s', '', $value, -1, $count); + if ($count == 1) { + // items have been removed, update the offset + $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); + $value = $trimmedValue; + } + + // remove start of the document marker (---) + $trimmedValue = preg_replace('#^\-\-\-.*?\n#s', '', $value, -1, $count); + if ($count == 1) { + // items have been removed, update the offset + $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); + $value = $trimmedValue; + + // remove end of the document marker (...) + $value = preg_replace('#\.\.\.\s*$#s', '', $value); + } + + return $value; + } + + /** + * Returns true if the next line starts unindented collection + * + * @return bool Returns true if the next line starts unindented collection, false otherwise + */ + private function isNextLineUnIndentedCollection() + { + $currentIndentation = $this->getCurrentLineIndentation(); + $notEOF = $this->moveToNextLine(); + + while ($notEOF && $this->isCurrentLineEmpty()) { + $notEOF = $this->moveToNextLine(); + } + + if (false === $notEOF) { + return false; + } + + $ret = false; + if ( + $this->getCurrentLineIndentation() == $currentIndentation + && + $this->isStringUnIndentedCollectionItem($this->currentLine) + ) { + $ret = true; + } + + $this->moveToPreviousLine(); + + return $ret; + } + + /** + * Returns true if the string is un-indented collection item + * + * @return bool Returns true if the string is un-indented collection item, false otherwise + */ + private function isStringUnIndentedCollectionItem() + { + return (0 === strpos($this->currentLine, '- ')); + } +} diff --git a/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php new file mode 100644 index 0000000..50b1018 --- /dev/null +++ b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php @@ -0,0 +1,141 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +/** + * Unescaper encapsulates unescaping rules for single and double-quoted + * YAML strings. + * + * @author Matthew Lewinski + */ +class Unescaper +{ + // Parser and Inline assume UTF-8 encoding, so escaped Unicode characters + // must be converted to that encoding. + // @deprecated since 2.5, to be removed in 3.0 + const ENCODING = 'UTF-8'; + + // Regex fragment that matches an escaped character in a double quoted + // string. + const REGEX_ESCAPED_CHARACTER = "\\\\([0abt\tnvfre \\\"\\/\\\\N_LP]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})"; + + /** + * Unescapes a single quoted string. + * + * @param string $value A single quoted string. + * + * @return string The unescaped string. + */ + public function unescapeSingleQuotedString($value) + { + return str_replace('\'\'', '\'', $value); + } + + /** + * Unescapes a double quoted string. + * + * @param string $value A double quoted string. + * + * @return string The unescaped string. + */ + public function unescapeDoubleQuotedString($value) + { + $self = $this; + $callback = function ($match) use ($self) { + return $self->unescapeCharacter($match[0]); + }; + + // evaluate the string + return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value); + } + + /** + * Unescapes a character that was found in a double-quoted string + * + * @param string $value An escaped character + * + * @return string The unescaped character + */ + public function unescapeCharacter($value) + { + switch ($value{1}) { + case '0': + return "\x0"; + case 'a': + return "\x7"; + case 'b': + return "\x8"; + case 't': + return "\t"; + case "\t": + return "\t"; + case 'n': + return "\n"; + case 'v': + return "\xB"; + case 'f': + return "\xC"; + case 'r': + return "\r"; + case 'e': + return "\x1B"; + case ' ': + return ' '; + case '"': + return '"'; + case '/': + return '/'; + case '\\': + return '\\'; + case 'N': + // U+0085 NEXT LINE + return "\xC2\x85"; + case '_': + // U+00A0 NO-BREAK SPACE + return "\xC2\xA0"; + case 'L': + // U+2028 LINE SEPARATOR + return "\xE2\x80\xA8"; + case 'P': + // U+2029 PARAGRAPH SEPARATOR + return "\xE2\x80\xA9"; + case 'x': + return self::utf8chr(hexdec(substr($value, 2, 2))); + case 'u': + return self::utf8chr(hexdec(substr($value, 2, 4))); + case 'U': + return self::utf8chr(hexdec(substr($value, 2, 8))); + } + } + + /** + * Get the UTF-8 character for the given code point. + * + * @param int $c The unicode code point + * + * @return string The corresponding UTF-8 character + */ + private static function utf8chr($c) + { + if (0x80 > $c %= 0x200000) { + return chr($c); + } + if (0x800 > $c) { + return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F); + } + if (0x10000 > $c) { + return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); + } + + return chr(0xF0 | $c >> 18).chr(0x80 | $c >> 12 & 0x3F).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); + } +} diff --git a/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.php b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.php new file mode 100644 index 0000000..61793fb --- /dev/null +++ b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.php @@ -0,0 +1,100 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +use Symfony\Component\Yaml\Exception\ParseException; + +/** + * Yaml offers convenience methods to load and dump YAML. + * + * @author Fabien Potencier + * + * @api + */ +class Yaml +{ + /** + * Parses YAML into a PHP array. + * + * The parse method, when supplied with a YAML stream (string or file), + * will do its best to convert YAML in a file into a PHP array. + * + * Usage: + * + * $array = Yaml::parse('config.yml'); + * print_r($array); + * + * + * As this method accepts both plain strings and file names as an input, + * you must validate the input before calling this method. Passing a file + * as an input is a deprecated feature and will be removed in 3.0. + * + * @param string $input Path to a YAML file or a string containing YAML + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise + * + * @return array The YAML converted to a PHP array + * + * @throws ParseException If the YAML is not valid + * + * @api + */ + public static function parse($input, $exceptionOnInvalidType = false, $objectSupport = false) + { + // if input is a file, process it + $file = ''; + if (strpos($input, "\n") === false && is_file($input)) { + if (false === is_readable($input)) { + throw new ParseException(sprintf('Unable to parse "%s" as the file is not readable.', $input)); + } + + $file = $input; + $input = file_get_contents($file); + } + + $yaml = new Parser(); + + try { + return $yaml->parse($input, $exceptionOnInvalidType, $objectSupport); + } catch (ParseException $e) { + if ($file) { + $e->setParsedFile($file); + } + + throw $e; + } + } + + /** + * Dumps a PHP array to a YAML string. + * + * The dump method, when supplied with an array, will do its best + * to convert the array into friendly YAML. + * + * @param array $array PHP array + * @param int $inline The level where you switch to inline YAML + * @param int $indent The amount of spaces to use for indentation of nested nodes. + * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport true if object support is enabled, false otherwise + * + * @return string A YAML string representing the original PHP array + * + * @api + */ + public static function dump($array, $inline = 2, $indent = 4, $exceptionOnInvalidType = false, $objectSupport = false) + { + $yaml = new Dumper(); + $yaml->setIndentation($indent); + + return $yaml->dump($array, $inline, 0, $exceptionOnInvalidType, $objectSupport); + } +} diff --git a/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json new file mode 100644 index 0000000..1a009c1 --- /dev/null +++ b/sources/phpBB/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json @@ -0,0 +1,31 @@ +{ + "name": "symfony/yaml", + "type": "library", + "description": "Symfony Yaml Component", + "keywords": [], + "homepage": "http://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3" + }, + "autoload": { + "psr-0": { "Symfony\\Component\\Yaml\\": "" } + }, + "target-dir": "Symfony/Component/Yaml", + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + } +} diff --git a/sources/phpBB/vendor/twig/twig/LICENSE b/sources/phpBB/vendor/twig/twig/LICENSE new file mode 100644 index 0000000..3384cc5 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/LICENSE @@ -0,0 +1,31 @@ +Copyright (c) 2009-2013 by the Twig Team, see AUTHORS for more details. + +Some rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sources/phpBB/vendor/twig/twig/composer.json b/sources/phpBB/vendor/twig/twig/composer.json new file mode 100644 index 0000000..67a08aa --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/composer.json @@ -0,0 +1,31 @@ +{ + "name": "twig/twig", + "type": "library", + "description": "Twig, the flexible, fast, and secure template language for PHP", + "keywords": ["templating"], + "homepage": "http://twig.sensiolabs.org", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com" + } + ], + "require": { + "php": ">=5.2.4" + }, + "autoload": { + "psr-0" : { + "Twig_" : "lib/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.13-dev" + } + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Autoloader.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Autoloader.php new file mode 100644 index 0000000..7007d31 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Autoloader.php @@ -0,0 +1,48 @@ + + */ +class Twig_Autoloader +{ + /** + * Registers Twig_Autoloader as an SPL autoloader. + * + * @param Boolean $prepend Whether to prepend the autoloader or not. + */ + public static function register($prepend = false) + { + if (version_compare(phpversion(), '5.3.0', '>=')) { + spl_autoload_register(array(new self, 'autoload'), true, $prepend); + } else { + spl_autoload_register(array(new self, 'autoload')); + } + } + + /** + * Handles autoloading of classes. + * + * @param string $class A class name. + */ + public static function autoload($class) + { + if (0 !== strpos($class, 'Twig')) { + return; + } + + if (is_file($file = dirname(__FILE__).'/../'.str_replace(array('_', "\0"), array('/', ''), $class).'.php')) { + require $file; + } + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Compiler.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Compiler.php new file mode 100644 index 0000000..99aecbc --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Compiler.php @@ -0,0 +1,267 @@ + + */ +class Twig_Compiler implements Twig_CompilerInterface +{ + protected $lastLine; + protected $source; + protected $indentation; + protected $env; + protected $debugInfo; + protected $sourceOffset; + protected $sourceLine; + protected $filename; + + /** + * Constructor. + * + * @param Twig_Environment $env The twig environment instance + */ + public function __construct(Twig_Environment $env) + { + $this->env = $env; + $this->debugInfo = array(); + } + + public function getFilename() + { + return $this->filename; + } + + /** + * Returns the environment instance related to this compiler. + * + * @return Twig_Environment The environment instance + */ + public function getEnvironment() + { + return $this->env; + } + + /** + * Gets the current PHP code after compilation. + * + * @return string The PHP code + */ + public function getSource() + { + return $this->source; + } + + /** + * Compiles a node. + * + * @param Twig_NodeInterface $node The node to compile + * @param integer $indentation The current indentation + * + * @return Twig_Compiler The current compiler instance + */ + public function compile(Twig_NodeInterface $node, $indentation = 0) + { + $this->lastLine = null; + $this->source = ''; + $this->sourceOffset = 0; + // source code starts at 1 (as we then increment it when we encounter new lines) + $this->sourceLine = 1; + $this->indentation = $indentation; + + if ($node instanceof Twig_Node_Module) { + $this->filename = $node->getAttribute('filename'); + } + + $node->compile($this); + + return $this; + } + + public function subcompile(Twig_NodeInterface $node, $raw = true) + { + if (false === $raw) { + $this->addIndentation(); + } + + $node->compile($this); + + return $this; + } + + /** + * Adds a raw string to the compiled code. + * + * @param string $string The string + * + * @return Twig_Compiler The current compiler instance + */ + public function raw($string) + { + $this->source .= $string; + + return $this; + } + + /** + * Writes a string to the compiled code by adding indentation. + * + * @return Twig_Compiler The current compiler instance + */ + public function write() + { + $strings = func_get_args(); + foreach ($strings as $string) { + $this->addIndentation(); + $this->source .= $string; + } + + return $this; + } + + /** + * Appends an indentation to the current PHP code after compilation. + * + * @return Twig_Compiler The current compiler instance + */ + public function addIndentation() + { + $this->source .= str_repeat(' ', $this->indentation * 4); + + return $this; + } + + /** + * Adds a quoted string to the compiled code. + * + * @param string $value The string + * + * @return Twig_Compiler The current compiler instance + */ + public function string($value) + { + $this->source .= sprintf('"%s"', addcslashes($value, "\0\t\"\$\\")); + + return $this; + } + + /** + * Returns a PHP representation of a given value. + * + * @param mixed $value The value to convert + * + * @return Twig_Compiler The current compiler instance + */ + public function repr($value) + { + if (is_int($value) || is_float($value)) { + if (false !== $locale = setlocale(LC_NUMERIC, 0)) { + setlocale(LC_NUMERIC, 'C'); + } + + $this->raw($value); + + if (false !== $locale) { + setlocale(LC_NUMERIC, $locale); + } + } elseif (null === $value) { + $this->raw('null'); + } elseif (is_bool($value)) { + $this->raw($value ? 'true' : 'false'); + } elseif (is_array($value)) { + $this->raw('array('); + $i = 0; + foreach ($value as $key => $value) { + if ($i++) { + $this->raw(', '); + } + $this->repr($key); + $this->raw(' => '); + $this->repr($value); + } + $this->raw(')'); + } else { + $this->string($value); + } + + return $this; + } + + /** + * Adds debugging information. + * + * @param Twig_NodeInterface $node The related twig node + * + * @return Twig_Compiler The current compiler instance + */ + public function addDebugInfo(Twig_NodeInterface $node) + { + if ($node->getLine() != $this->lastLine) { + $this->write("// line {$node->getLine()}\n"); + + // when mbstring.func_overload is set to 2 + // mb_substr_count() replaces substr_count() + // but they have different signatures! + if (((int) ini_get('mbstring.func_overload')) & 2) { + // this is much slower than the "right" version + $this->sourceLine += mb_substr_count(mb_substr($this->source, $this->sourceOffset), "\n"); + } else { + $this->sourceLine += substr_count($this->source, "\n", $this->sourceOffset); + } + $this->sourceOffset = strlen($this->source); + $this->debugInfo[$this->sourceLine] = $node->getLine(); + + $this->lastLine = $node->getLine(); + } + + return $this; + } + + public function getDebugInfo() + { + return $this->debugInfo; + } + + /** + * Indents the generated code. + * + * @param integer $step The number of indentation to add + * + * @return Twig_Compiler The current compiler instance + */ + public function indent($step = 1) + { + $this->indentation += $step; + + return $this; + } + + /** + * Outdents the generated code. + * + * @param integer $step The number of indentation to remove + * + * @return Twig_Compiler The current compiler instance + */ + public function outdent($step = 1) + { + // can't outdent by more steps than the current indentation level + if ($this->indentation < $step) { + throw new LogicException('Unable to call outdent() as the indentation would become negative'); + } + + $this->indentation -= $step; + + return $this; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/CompilerInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/CompilerInterface.php new file mode 100644 index 0000000..e293ec9 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/CompilerInterface.php @@ -0,0 +1,35 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_CompilerInterface +{ + /** + * Compiles a node. + * + * @param Twig_NodeInterface $node The node to compile + * + * @return Twig_CompilerInterface The current compiler instance + */ + public function compile(Twig_NodeInterface $node); + + /** + * Gets the current PHP code after compilation. + * + * @return string The PHP code + */ + public function getSource(); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Environment.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Environment.php new file mode 100644 index 0000000..6d4c5c5 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Environment.php @@ -0,0 +1,1224 @@ + + */ +class Twig_Environment +{ + const VERSION = '1.13.2'; + + protected $charset; + protected $loader; + protected $debug; + protected $autoReload; + protected $cache; + protected $lexer; + protected $parser; + protected $compiler; + protected $baseTemplateClass; + protected $extensions; + protected $parsers; + protected $visitors; + protected $filters; + protected $tests; + protected $functions; + protected $globals; + protected $runtimeInitialized; + protected $extensionInitialized; + protected $loadedTemplates; + protected $strictVariables; + protected $unaryOperators; + protected $binaryOperators; + protected $templateClassPrefix = '__TwigTemplate_'; + protected $functionCallbacks; + protected $filterCallbacks; + protected $staging; + + /** + * Constructor. + * + * Available options: + * + * * debug: When set to true, it automatically set "auto_reload" to true as + * well (default to false). + * + * * charset: The charset used by the templates (default to UTF-8). + * + * * base_template_class: The base template class to use for generated + * templates (default to Twig_Template). + * + * * cache: An absolute path where to store the compiled templates, or + * false to disable compilation cache (default). + * + * * auto_reload: Whether to reload the template is the original source changed. + * If you don't provide the auto_reload option, it will be + * determined automatically base on the debug value. + * + * * strict_variables: Whether to ignore invalid variables in templates + * (default to false). + * + * * autoescape: Whether to enable auto-escaping (default to html): + * * false: disable auto-escaping + * * true: equivalent to html + * * html, js: set the autoescaping to one of the supported strategies + * * PHP callback: a PHP callback that returns an escaping strategy based on the template "filename" + * + * * optimizations: A flag that indicates which optimizations to apply + * (default to -1 which means that all optimizations are enabled; + * set it to 0 to disable). + * + * @param Twig_LoaderInterface $loader A Twig_LoaderInterface instance + * @param array $options An array of options + */ + public function __construct(Twig_LoaderInterface $loader = null, $options = array()) + { + if (null !== $loader) { + $this->setLoader($loader); + } + + $options = array_merge(array( + 'debug' => false, + 'charset' => 'UTF-8', + 'base_template_class' => 'Twig_Template', + 'strict_variables' => false, + 'autoescape' => 'html', + 'cache' => false, + 'auto_reload' => null, + 'optimizations' => -1, + ), $options); + + $this->debug = (bool) $options['debug']; + $this->charset = strtoupper($options['charset']); + $this->baseTemplateClass = $options['base_template_class']; + $this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload']; + $this->strictVariables = (bool) $options['strict_variables']; + $this->runtimeInitialized = false; + $this->setCache($options['cache']); + $this->functionCallbacks = array(); + $this->filterCallbacks = array(); + + $this->addExtension(new Twig_Extension_Core()); + $this->addExtension(new Twig_Extension_Escaper($options['autoescape'])); + $this->addExtension(new Twig_Extension_Optimizer($options['optimizations'])); + $this->extensionInitialized = false; + $this->staging = new Twig_Extension_Staging(); + } + + /** + * Gets the base template class for compiled templates. + * + * @return string The base template class name + */ + public function getBaseTemplateClass() + { + return $this->baseTemplateClass; + } + + /** + * Sets the base template class for compiled templates. + * + * @param string $class The base template class name + */ + public function setBaseTemplateClass($class) + { + $this->baseTemplateClass = $class; + } + + /** + * Enables debugging mode. + */ + public function enableDebug() + { + $this->debug = true; + } + + /** + * Disables debugging mode. + */ + public function disableDebug() + { + $this->debug = false; + } + + /** + * Checks if debug mode is enabled. + * + * @return Boolean true if debug mode is enabled, false otherwise + */ + public function isDebug() + { + return $this->debug; + } + + /** + * Enables the auto_reload option. + */ + public function enableAutoReload() + { + $this->autoReload = true; + } + + /** + * Disables the auto_reload option. + */ + public function disableAutoReload() + { + $this->autoReload = false; + } + + /** + * Checks if the auto_reload option is enabled. + * + * @return Boolean true if auto_reload is enabled, false otherwise + */ + public function isAutoReload() + { + return $this->autoReload; + } + + /** + * Enables the strict_variables option. + */ + public function enableStrictVariables() + { + $this->strictVariables = true; + } + + /** + * Disables the strict_variables option. + */ + public function disableStrictVariables() + { + $this->strictVariables = false; + } + + /** + * Checks if the strict_variables option is enabled. + * + * @return Boolean true if strict_variables is enabled, false otherwise + */ + public function isStrictVariables() + { + return $this->strictVariables; + } + + /** + * Gets the cache directory or false if cache is disabled. + * + * @return string|false + */ + public function getCache() + { + return $this->cache; + } + + /** + * Sets the cache directory or false if cache is disabled. + * + * @param string|false $cache The absolute path to the compiled templates, + * or false to disable cache + */ + public function setCache($cache) + { + $this->cache = $cache ? $cache : false; + } + + /** + * Gets the cache filename for a given template. + * + * @param string $name The template name + * + * @return string The cache file name + */ + public function getCacheFilename($name) + { + if (false === $this->cache) { + return false; + } + + $class = substr($this->getTemplateClass($name), strlen($this->templateClassPrefix)); + + return $this->getCache().'/'.substr($class, 0, 2).'/'.substr($class, 2, 2).'/'.substr($class, 4).'.php'; + } + + /** + * Gets the template class associated with the given string. + * + * @param string $name The name for which to calculate the template class name + * @param integer $index The index if it is an embedded template + * + * @return string The template class name + */ + public function getTemplateClass($name, $index = null) + { + return $this->templateClassPrefix.md5($this->getLoader()->getCacheKey($name)).(null === $index ? '' : '_'.$index); + } + + /** + * Gets the template class prefix. + * + * @return string The template class prefix + */ + public function getTemplateClassPrefix() + { + return $this->templateClassPrefix; + } + + /** + * Renders a template. + * + * @param string $name The template name + * @param array $context An array of parameters to pass to the template + * + * @return string The rendered template + */ + public function render($name, array $context = array()) + { + return $this->loadTemplate($name)->render($context); + } + + /** + * Displays a template. + * + * @param string $name The template name + * @param array $context An array of parameters to pass to the template + */ + public function display($name, array $context = array()) + { + $this->loadTemplate($name)->display($context); + } + + /** + * Loads a template by name. + * + * @param string $name The template name + * @param integer $index The index if it is an embedded template + * + * @return Twig_TemplateInterface A template instance representing the given template name + */ + public function loadTemplate($name, $index = null) + { + $cls = $this->getTemplateClass($name, $index); + + if (isset($this->loadedTemplates[$cls])) { + return $this->loadedTemplates[$cls]; + } + + if (!class_exists($cls, false)) { + if (false === $cache = $this->getCacheFilename($name)) { + eval('?>'.$this->compileSource($this->getLoader()->getSource($name), $name)); + } else { + if (!is_file($cache) || ($this->isAutoReload() && !$this->isTemplateFresh($name, filemtime($cache)))) { + $this->writeCacheFile($cache, $this->compileSource($this->getLoader()->getSource($name), $name)); + } + + require_once $cache; + } + } + + if (!$this->runtimeInitialized) { + $this->initRuntime(); + } + + return $this->loadedTemplates[$cls] = new $cls($this); + } + + /** + * Returns true if the template is still fresh. + * + * Besides checking the loader for freshness information, + * this method also checks if the enabled extensions have + * not changed. + * + * @param string $name The template name + * @param timestamp $time The last modification time of the cached template + * + * @return Boolean true if the template is fresh, false otherwise + */ + public function isTemplateFresh($name, $time) + { + foreach ($this->extensions as $extension) { + $r = new ReflectionObject($extension); + if (filemtime($r->getFileName()) > $time) { + return false; + } + } + + return $this->getLoader()->isFresh($name, $time); + } + + public function resolveTemplate($names) + { + if (!is_array($names)) { + $names = array($names); + } + + foreach ($names as $name) { + if ($name instanceof Twig_Template) { + return $name; + } + + try { + return $this->loadTemplate($name); + } catch (Twig_Error_Loader $e) { + } + } + + if (1 === count($names)) { + throw $e; + } + + throw new Twig_Error_Loader(sprintf('Unable to find one of the following templates: "%s".', implode('", "', $names))); + } + + /** + * Clears the internal template cache. + */ + public function clearTemplateCache() + { + $this->loadedTemplates = array(); + } + + /** + * Clears the template cache files on the filesystem. + */ + public function clearCacheFiles() + { + if (false === $this->cache) { + return; + } + + foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->cache), RecursiveIteratorIterator::LEAVES_ONLY) as $file) { + if ($file->isFile()) { + @unlink($file->getPathname()); + } + } + } + + /** + * Gets the Lexer instance. + * + * @return Twig_LexerInterface A Twig_LexerInterface instance + */ + public function getLexer() + { + if (null === $this->lexer) { + $this->lexer = new Twig_Lexer($this); + } + + return $this->lexer; + } + + /** + * Sets the Lexer instance. + * + * @param Twig_LexerInterface A Twig_LexerInterface instance + */ + public function setLexer(Twig_LexerInterface $lexer) + { + $this->lexer = $lexer; + } + + /** + * Tokenizes a source code. + * + * @param string $source The template source code + * @param string $name The template name + * + * @return Twig_TokenStream A Twig_TokenStream instance + */ + public function tokenize($source, $name = null) + { + return $this->getLexer()->tokenize($source, $name); + } + + /** + * Gets the Parser instance. + * + * @return Twig_ParserInterface A Twig_ParserInterface instance + */ + public function getParser() + { + if (null === $this->parser) { + $this->parser = new Twig_Parser($this); + } + + return $this->parser; + } + + /** + * Sets the Parser instance. + * + * @param Twig_ParserInterface A Twig_ParserInterface instance + */ + public function setParser(Twig_ParserInterface $parser) + { + $this->parser = $parser; + } + + /** + * Parses a token stream. + * + * @param Twig_TokenStream $tokens A Twig_TokenStream instance + * + * @return Twig_Node_Module A Node tree + */ + public function parse(Twig_TokenStream $tokens) + { + return $this->getParser()->parse($tokens); + } + + /** + * Gets the Compiler instance. + * + * @return Twig_CompilerInterface A Twig_CompilerInterface instance + */ + public function getCompiler() + { + if (null === $this->compiler) { + $this->compiler = new Twig_Compiler($this); + } + + return $this->compiler; + } + + /** + * Sets the Compiler instance. + * + * @param Twig_CompilerInterface $compiler A Twig_CompilerInterface instance + */ + public function setCompiler(Twig_CompilerInterface $compiler) + { + $this->compiler = $compiler; + } + + /** + * Compiles a Node. + * + * @param Twig_NodeInterface $node A Twig_NodeInterface instance + * + * @return string The compiled PHP source code + */ + public function compile(Twig_NodeInterface $node) + { + return $this->getCompiler()->compile($node)->getSource(); + } + + /** + * Compiles a template source code. + * + * @param string $source The template source code + * @param string $name The template name + * + * @return string The compiled PHP source code + */ + public function compileSource($source, $name = null) + { + try { + return $this->compile($this->parse($this->tokenize($source, $name))); + } catch (Twig_Error $e) { + $e->setTemplateFile($name); + throw $e; + } catch (Exception $e) { + throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the compilation of a template ("%s").', $e->getMessage()), -1, $name, $e); + } + } + + /** + * Sets the Loader instance. + * + * @param Twig_LoaderInterface $loader A Twig_LoaderInterface instance + */ + public function setLoader(Twig_LoaderInterface $loader) + { + $this->loader = $loader; + } + + /** + * Gets the Loader instance. + * + * @return Twig_LoaderInterface A Twig_LoaderInterface instance + */ + public function getLoader() + { + if (null === $this->loader) { + throw new LogicException('You must set a loader first.'); + } + + return $this->loader; + } + + /** + * Sets the default template charset. + * + * @param string $charset The default charset + */ + public function setCharset($charset) + { + $this->charset = strtoupper($charset); + } + + /** + * Gets the default template charset. + * + * @return string The default charset + */ + public function getCharset() + { + return $this->charset; + } + + /** + * Initializes the runtime environment. + */ + public function initRuntime() + { + $this->runtimeInitialized = true; + + foreach ($this->getExtensions() as $extension) { + $extension->initRuntime($this); + } + } + + /** + * Returns true if the given extension is registered. + * + * @param string $name The extension name + * + * @return Boolean Whether the extension is registered or not + */ + public function hasExtension($name) + { + return isset($this->extensions[$name]); + } + + /** + * Gets an extension by name. + * + * @param string $name The extension name + * + * @return Twig_ExtensionInterface A Twig_ExtensionInterface instance + */ + public function getExtension($name) + { + if (!isset($this->extensions[$name])) { + throw new Twig_Error_Runtime(sprintf('The "%s" extension is not enabled.', $name)); + } + + return $this->extensions[$name]; + } + + /** + * Registers an extension. + * + * @param Twig_ExtensionInterface $extension A Twig_ExtensionInterface instance + */ + public function addExtension(Twig_ExtensionInterface $extension) + { + if ($this->extensionInitialized) { + throw new LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $extension->getName())); + } + + $this->extensions[$extension->getName()] = $extension; + } + + /** + * Removes an extension by name. + * + * This method is deprecated and you should not use it. + * + * @param string $name The extension name + * + * @deprecated since 1.12 (to be removed in 2.0) + */ + public function removeExtension($name) + { + if ($this->extensionInitialized) { + throw new LogicException(sprintf('Unable to remove extension "%s" as extensions have already been initialized.', $name)); + } + + unset($this->extensions[$name]); + } + + /** + * Registers an array of extensions. + * + * @param array $extensions An array of extensions + */ + public function setExtensions(array $extensions) + { + foreach ($extensions as $extension) { + $this->addExtension($extension); + } + } + + /** + * Returns all registered extensions. + * + * @return array An array of extensions + */ + public function getExtensions() + { + return $this->extensions; + } + + /** + * Registers a Token Parser. + * + * @param Twig_TokenParserInterface $parser A Twig_TokenParserInterface instance + */ + public function addTokenParser(Twig_TokenParserInterface $parser) + { + if ($this->extensionInitialized) { + throw new LogicException('Unable to add a token parser as extensions have already been initialized.'); + } + + $this->staging->addTokenParser($parser); + } + + /** + * Gets the registered Token Parsers. + * + * @return Twig_TokenParserBrokerInterface A broker containing token parsers + */ + public function getTokenParsers() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->parsers; + } + + /** + * Gets registered tags. + * + * Be warned that this method cannot return tags defined by Twig_TokenParserBrokerInterface classes. + * + * @return Twig_TokenParserInterface[] An array of Twig_TokenParserInterface instances + */ + public function getTags() + { + $tags = array(); + foreach ($this->getTokenParsers()->getParsers() as $parser) { + if ($parser instanceof Twig_TokenParserInterface) { + $tags[$parser->getTag()] = $parser; + } + } + + return $tags; + } + + /** + * Registers a Node Visitor. + * + * @param Twig_NodeVisitorInterface $visitor A Twig_NodeVisitorInterface instance + */ + public function addNodeVisitor(Twig_NodeVisitorInterface $visitor) + { + if ($this->extensionInitialized) { + throw new LogicException('Unable to add a node visitor as extensions have already been initialized.'); + } + + $this->staging->addNodeVisitor($visitor); + } + + /** + * Gets the registered Node Visitors. + * + * @return Twig_NodeVisitorInterface[] An array of Twig_NodeVisitorInterface instances + */ + public function getNodeVisitors() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->visitors; + } + + /** + * Registers a Filter. + * + * @param string|Twig_SimpleFilter $name The filter name or a Twig_SimpleFilter instance + * @param Twig_FilterInterface|Twig_SimpleFilter $filter A Twig_FilterInterface instance or a Twig_SimpleFilter instance + */ + public function addFilter($name, $filter = null) + { + if (!$name instanceof Twig_SimpleFilter && !($filter instanceof Twig_SimpleFilter || $filter instanceof Twig_FilterInterface)) { + throw new LogicException('A filter must be an instance of Twig_FilterInterface or Twig_SimpleFilter'); + } + + if ($name instanceof Twig_SimpleFilter) { + $filter = $name; + $name = $filter->getName(); + } + + if ($this->extensionInitialized) { + throw new LogicException(sprintf('Unable to add filter "%s" as extensions have already been initialized.', $name)); + } + + $this->staging->addFilter($name, $filter); + } + + /** + * Get a filter by name. + * + * Subclasses may override this method and load filters differently; + * so no list of filters is available. + * + * @param string $name The filter name + * + * @return Twig_Filter|false A Twig_Filter instance or false if the filter does not exist + */ + public function getFilter($name) + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + if (isset($this->filters[$name])) { + return $this->filters[$name]; + } + + foreach ($this->filters as $pattern => $filter) { + $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count); + + if ($count) { + if (preg_match('#^'.$pattern.'$#', $name, $matches)) { + array_shift($matches); + $filter->setArguments($matches); + + return $filter; + } + } + } + + foreach ($this->filterCallbacks as $callback) { + if (false !== $filter = call_user_func($callback, $name)) { + return $filter; + } + } + + return false; + } + + public function registerUndefinedFilterCallback($callable) + { + $this->filterCallbacks[] = $callable; + } + + /** + * Gets the registered Filters. + * + * Be warned that this method cannot return filters defined with registerUndefinedFunctionCallback. + * + * @return Twig_FilterInterface[] An array of Twig_FilterInterface instances + * + * @see registerUndefinedFilterCallback + */ + public function getFilters() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->filters; + } + + /** + * Registers a Test. + * + * @param string|Twig_SimpleTest $name The test name or a Twig_SimpleTest instance + * @param Twig_TestInterface|Twig_SimpleTest $test A Twig_TestInterface instance or a Twig_SimpleTest instance + */ + public function addTest($name, $test = null) + { + if (!$name instanceof Twig_SimpleTest && !($test instanceof Twig_SimpleTest || $test instanceof Twig_TestInterface)) { + throw new LogicException('A test must be an instance of Twig_TestInterface or Twig_SimpleTest'); + } + + if ($name instanceof Twig_SimpleTest) { + $test = $name; + $name = $test->getName(); + } + + if ($this->extensionInitialized) { + throw new LogicException(sprintf('Unable to add test "%s" as extensions have already been initialized.', $name)); + } + + $this->staging->addTest($name, $test); + } + + /** + * Gets the registered Tests. + * + * @return Twig_TestInterface[] An array of Twig_TestInterface instances + */ + public function getTests() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->tests; + } + + /** + * Gets a test by name. + * + * @param string $name The test name + * + * @return Twig_Test|false A Twig_Test instance or false if the test does not exist + */ + public function getTest($name) + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + if (isset($this->tests[$name])) { + return $this->tests[$name]; + } + + return false; + } + + /** + * Registers a Function. + * + * @param string|Twig_SimpleFunction $name The function name or a Twig_SimpleFunction instance + * @param Twig_FunctionInterface|Twig_SimpleFunction $function A Twig_FunctionInterface instance or a Twig_SimpleFunction instance + */ + public function addFunction($name, $function = null) + { + if (!$name instanceof Twig_SimpleFunction && !($function instanceof Twig_SimpleFunction || $function instanceof Twig_FunctionInterface)) { + throw new LogicException('A function must be an instance of Twig_FunctionInterface or Twig_SimpleFunction'); + } + + if ($name instanceof Twig_SimpleFunction) { + $function = $name; + $name = $function->getName(); + } + + if ($this->extensionInitialized) { + throw new LogicException(sprintf('Unable to add function "%s" as extensions have already been initialized.', $name)); + } + + $this->staging->addFunction($name, $function); + } + + /** + * Get a function by name. + * + * Subclasses may override this method and load functions differently; + * so no list of functions is available. + * + * @param string $name function name + * + * @return Twig_Function|false A Twig_Function instance or false if the function does not exist + */ + public function getFunction($name) + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + if (isset($this->functions[$name])) { + return $this->functions[$name]; + } + + foreach ($this->functions as $pattern => $function) { + $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count); + + if ($count) { + if (preg_match('#^'.$pattern.'$#', $name, $matches)) { + array_shift($matches); + $function->setArguments($matches); + + return $function; + } + } + } + + foreach ($this->functionCallbacks as $callback) { + if (false !== $function = call_user_func($callback, $name)) { + return $function; + } + } + + return false; + } + + public function registerUndefinedFunctionCallback($callable) + { + $this->functionCallbacks[] = $callable; + } + + /** + * Gets registered functions. + * + * Be warned that this method cannot return functions defined with registerUndefinedFunctionCallback. + * + * @return Twig_FunctionInterface[] An array of Twig_FunctionInterface instances + * + * @see registerUndefinedFunctionCallback + */ + public function getFunctions() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->functions; + } + + /** + * Registers a Global. + * + * New globals can be added before compiling or rendering a template; + * but after, you can only update existing globals. + * + * @param string $name The global name + * @param mixed $value The global value + */ + public function addGlobal($name, $value) + { + if ($this->extensionInitialized || $this->runtimeInitialized) { + if (null === $this->globals) { + $this->globals = $this->initGlobals(); + } + + /* This condition must be uncommented in Twig 2.0 + if (!array_key_exists($name, $this->globals)) { + throw new LogicException(sprintf('Unable to add global "%s" as the runtime or the extensions have already been initialized.', $name)); + } + */ + } + + if ($this->extensionInitialized || $this->runtimeInitialized) { + // update the value + $this->globals[$name] = $value; + } else { + $this->staging->addGlobal($name, $value); + } + } + + /** + * Gets the registered Globals. + * + * @return array An array of globals + */ + public function getGlobals() + { + if (!$this->runtimeInitialized && !$this->extensionInitialized) { + return $this->initGlobals(); + } + + if (null === $this->globals) { + $this->globals = $this->initGlobals(); + } + + return $this->globals; + } + + /** + * Merges a context with the defined globals. + * + * @param array $context An array representing the context + * + * @return array The context merged with the globals + */ + public function mergeGlobals(array $context) + { + // we don't use array_merge as the context being generally + // bigger than globals, this code is faster. + foreach ($this->getGlobals() as $key => $value) { + if (!array_key_exists($key, $context)) { + $context[$key] = $value; + } + } + + return $context; + } + + /** + * Gets the registered unary Operators. + * + * @return array An array of unary operators + */ + public function getUnaryOperators() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->unaryOperators; + } + + /** + * Gets the registered binary Operators. + * + * @return array An array of binary operators + */ + public function getBinaryOperators() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->binaryOperators; + } + + public function computeAlternatives($name, $items) + { + $alternatives = array(); + foreach ($items as $item) { + $lev = levenshtein($name, $item); + if ($lev <= strlen($name) / 3 || false !== strpos($item, $name)) { + $alternatives[$item] = $lev; + } + } + asort($alternatives); + + return array_keys($alternatives); + } + + protected function initGlobals() + { + $globals = array(); + foreach ($this->extensions as $extension) { + $extGlob = $extension->getGlobals(); + if (!is_array($extGlob)) { + throw new UnexpectedValueException(sprintf('"%s::getGlobals()" must return an array of globals.', get_class($extension))); + } + + $globals[] = $extGlob; + } + + $globals[] = $this->staging->getGlobals(); + + return call_user_func_array('array_merge', $globals); + } + + protected function initExtensions() + { + if ($this->extensionInitialized) { + return; + } + + $this->extensionInitialized = true; + $this->parsers = new Twig_TokenParserBroker(); + $this->filters = array(); + $this->functions = array(); + $this->tests = array(); + $this->visitors = array(); + $this->unaryOperators = array(); + $this->binaryOperators = array(); + + foreach ($this->extensions as $extension) { + $this->initExtension($extension); + } + $this->initExtension($this->staging); + } + + protected function initExtension(Twig_ExtensionInterface $extension) + { + // filters + foreach ($extension->getFilters() as $name => $filter) { + if ($name instanceof Twig_SimpleFilter) { + $filter = $name; + $name = $filter->getName(); + } elseif ($filter instanceof Twig_SimpleFilter) { + $name = $filter->getName(); + } + + $this->filters[$name] = $filter; + } + + // functions + foreach ($extension->getFunctions() as $name => $function) { + if ($name instanceof Twig_SimpleFunction) { + $function = $name; + $name = $function->getName(); + } elseif ($function instanceof Twig_SimpleFunction) { + $name = $function->getName(); + } + + $this->functions[$name] = $function; + } + + // tests + foreach ($extension->getTests() as $name => $test) { + if ($name instanceof Twig_SimpleTest) { + $test = $name; + $name = $test->getName(); + } elseif ($test instanceof Twig_SimpleTest) { + $name = $test->getName(); + } + + $this->tests[$name] = $test; + } + + // token parsers + foreach ($extension->getTokenParsers() as $parser) { + if ($parser instanceof Twig_TokenParserInterface) { + $this->parsers->addTokenParser($parser); + } elseif ($parser instanceof Twig_TokenParserBrokerInterface) { + $this->parsers->addTokenParserBroker($parser); + } else { + throw new LogicException('getTokenParsers() must return an array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances'); + } + } + + // node visitors + foreach ($extension->getNodeVisitors() as $visitor) { + $this->visitors[] = $visitor; + } + + // operators + if ($operators = $extension->getOperators()) { + if (2 !== count($operators)) { + throw new InvalidArgumentException(sprintf('"%s::getOperators()" does not return a valid operators array.', get_class($extension))); + } + + $this->unaryOperators = array_merge($this->unaryOperators, $operators[0]); + $this->binaryOperators = array_merge($this->binaryOperators, $operators[1]); + } + } + + protected function writeCacheFile($file, $content) + { + $dir = dirname($file); + if (!is_dir($dir)) { + if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) { + throw new RuntimeException(sprintf("Unable to create the cache directory (%s).", $dir)); + } + } elseif (!is_writable($dir)) { + throw new RuntimeException(sprintf("Unable to write in the cache directory (%s).", $dir)); + } + + $tmpFile = tempnam(dirname($file), basename($file)); + if (false !== @file_put_contents($tmpFile, $content)) { + // rename does not work on Win32 before 5.2.6 + if (@rename($tmpFile, $file) || (@copy($tmpFile, $file) && unlink($tmpFile))) { + @chmod($file, 0666 & ~umask()); + + return; + } + } + + throw new RuntimeException(sprintf('Failed to write cache file "%s".', $file)); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Error.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Error.php new file mode 100644 index 0000000..61a4cfa --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Error.php @@ -0,0 +1,243 @@ + + */ +class Twig_Error extends Exception +{ + protected $lineno; + protected $filename; + protected $rawMessage; + protected $previous; + + /** + * Constructor. + * + * Set both the line number and the filename to false to + * disable automatic guessing of the original template name + * and line number. + * + * Set the line number to -1 to enable its automatic guessing. + * Set the filename to null to enable its automatic guessing. + * + * By default, automatic guessing is enabled. + * + * @param string $message The error message + * @param integer $lineno The template line where the error occurred + * @param string $filename The template file name where the error occurred + * @param Exception $previous The previous exception + */ + public function __construct($message, $lineno = -1, $filename = null, Exception $previous = null) + { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + $this->previous = $previous; + parent::__construct(''); + } else { + parent::__construct('', 0, $previous); + } + + $this->lineno = $lineno; + $this->filename = $filename; + + if (-1 === $this->lineno || null === $this->filename) { + $this->guessTemplateInfo(); + } + + $this->rawMessage = $message; + + $this->updateRepr(); + } + + /** + * Gets the raw message. + * + * @return string The raw message + */ + public function getRawMessage() + { + return $this->rawMessage; + } + + /** + * Gets the filename where the error occurred. + * + * @return string The filename + */ + public function getTemplateFile() + { + return $this->filename; + } + + /** + * Sets the filename where the error occurred. + * + * @param string $filename The filename + */ + public function setTemplateFile($filename) + { + $this->filename = $filename; + + $this->updateRepr(); + } + + /** + * Gets the template line where the error occurred. + * + * @return integer The template line + */ + public function getTemplateLine() + { + return $this->lineno; + } + + /** + * Sets the template line where the error occurred. + * + * @param integer $lineno The template line + */ + public function setTemplateLine($lineno) + { + $this->lineno = $lineno; + + $this->updateRepr(); + } + + public function guess() + { + $this->guessTemplateInfo(); + $this->updateRepr(); + } + + /** + * For PHP < 5.3.0, provides access to the getPrevious() method. + * + * @param string $method The method name + * @param array $arguments The parameters to be passed to the method + * + * @return Exception The previous exception or null + * + * @throws BadMethodCallException + */ + public function __call($method, $arguments) + { + if ('getprevious' == strtolower($method)) { + return $this->previous; + } + + throw new BadMethodCallException(sprintf('Method "Twig_Error::%s()" does not exist.', $method)); + } + + protected function updateRepr() + { + $this->message = $this->rawMessage; + + $dot = false; + if ('.' === substr($this->message, -1)) { + $this->message = substr($this->message, 0, -1); + $dot = true; + } + + if ($this->filename) { + if (is_string($this->filename) || (is_object($this->filename) && method_exists($this->filename, '__toString'))) { + $filename = sprintf('"%s"', $this->filename); + } else { + $filename = json_encode($this->filename); + } + $this->message .= sprintf(' in %s', $filename); + } + + if ($this->lineno && $this->lineno >= 0) { + $this->message .= sprintf(' at line %d', $this->lineno); + } + + if ($dot) { + $this->message .= '.'; + } + } + + protected function guessTemplateInfo() + { + $template = null; + $templateClass = null; + + if (version_compare(phpversion(), '5.3.6', '>=')) { + $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT); + } else { + $backtrace = debug_backtrace(); + } + + foreach ($backtrace as $trace) { + if (isset($trace['object']) && $trace['object'] instanceof Twig_Template && 'Twig_Template' !== get_class($trace['object'])) { + $currentClass = get_class($trace['object']); + $isEmbedContainer = 0 === strpos($templateClass, $currentClass); + if (null === $this->filename || ($this->filename == $trace['object']->getTemplateName() && !$isEmbedContainer)) { + $template = $trace['object']; + $templateClass = get_class($trace['object']); + } + } + } + + // update template filename + if (null !== $template && null === $this->filename) { + $this->filename = $template->getTemplateName(); + } + + if (null === $template || $this->lineno > -1) { + return; + } + + $r = new ReflectionObject($template); + $file = $r->getFileName(); + + $exceptions = array($e = $this); + while (($e instanceof self || method_exists($e, 'getPrevious')) && $e = $e->getPrevious()) { + $exceptions[] = $e; + } + + while ($e = array_pop($exceptions)) { + $traces = $e->getTrace(); + while ($trace = array_shift($traces)) { + if (!isset($trace['file']) || !isset($trace['line']) || $file != $trace['file']) { + continue; + } + + foreach ($template->getDebugInfo() as $codeLine => $templateLine) { + if ($codeLine <= $trace['line']) { + // update template line + $this->lineno = $templateLine; + + return; + } + } + } + } + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Error/Loader.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Error/Loader.php new file mode 100644 index 0000000..68efb57 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Error/Loader.php @@ -0,0 +1,31 @@ + + */ +class Twig_Error_Loader extends Twig_Error +{ + public function __construct($message, $lineno = -1, $filename = null, Exception $previous = null) + { + parent::__construct($message, false, false, $previous); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Error/Runtime.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Error/Runtime.php new file mode 100644 index 0000000..8b6cedd --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Error/Runtime.php @@ -0,0 +1,20 @@ + + */ +class Twig_Error_Runtime extends Twig_Error +{ +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Error/Syntax.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Error/Syntax.php new file mode 100644 index 0000000..0f5c579 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Error/Syntax.php @@ -0,0 +1,20 @@ + + */ +class Twig_Error_Syntax extends Twig_Error +{ +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php new file mode 100644 index 0000000..ce43476 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php @@ -0,0 +1,28 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_ExistsLoaderInterface +{ + /** + * Check if we have the source code of a template, given its name. + * + * @param string $name The name of the template to check if we can load + * + * @return boolean If the template source code is handled by this loader or not + */ + public function exists($name); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/ExpressionParser.php b/sources/phpBB/vendor/twig/twig/lib/Twig/ExpressionParser.php new file mode 100644 index 0000000..9cf1934 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/ExpressionParser.php @@ -0,0 +1,600 @@ + + */ +class Twig_ExpressionParser +{ + const OPERATOR_LEFT = 1; + const OPERATOR_RIGHT = 2; + + protected $parser; + protected $unaryOperators; + protected $binaryOperators; + + public function __construct(Twig_Parser $parser, array $unaryOperators, array $binaryOperators) + { + $this->parser = $parser; + $this->unaryOperators = $unaryOperators; + $this->binaryOperators = $binaryOperators; + } + + public function parseExpression($precedence = 0) + { + $expr = $this->getPrimary(); + $token = $this->parser->getCurrentToken(); + while ($this->isBinary($token) && $this->binaryOperators[$token->getValue()]['precedence'] >= $precedence) { + $op = $this->binaryOperators[$token->getValue()]; + $this->parser->getStream()->next(); + + if (isset($op['callable'])) { + $expr = call_user_func($op['callable'], $this->parser, $expr); + } else { + $expr1 = $this->parseExpression(self::OPERATOR_LEFT === $op['associativity'] ? $op['precedence'] + 1 : $op['precedence']); + $class = $op['class']; + $expr = new $class($expr, $expr1, $token->getLine()); + } + + $token = $this->parser->getCurrentToken(); + } + + if (0 === $precedence) { + return $this->parseConditionalExpression($expr); + } + + return $expr; + } + + protected function getPrimary() + { + $token = $this->parser->getCurrentToken(); + + if ($this->isUnary($token)) { + $operator = $this->unaryOperators[$token->getValue()]; + $this->parser->getStream()->next(); + $expr = $this->parseExpression($operator['precedence']); + $class = $operator['class']; + + return $this->parsePostfixExpression(new $class($expr, $token->getLine())); + } elseif ($token->test(Twig_Token::PUNCTUATION_TYPE, '(')) { + $this->parser->getStream()->next(); + $expr = $this->parseExpression(); + $this->parser->getStream()->expect(Twig_Token::PUNCTUATION_TYPE, ')', 'An opened parenthesis is not properly closed'); + + return $this->parsePostfixExpression($expr); + } + + return $this->parsePrimaryExpression(); + } + + protected function parseConditionalExpression($expr) + { + while ($this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, '?')) { + $this->parser->getStream()->next(); + if (!$this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, ':')) { + $expr2 = $this->parseExpression(); + if ($this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, ':')) { + $this->parser->getStream()->next(); + $expr3 = $this->parseExpression(); + } else { + $expr3 = new Twig_Node_Expression_Constant('', $this->parser->getCurrentToken()->getLine()); + } + } else { + $this->parser->getStream()->next(); + $expr2 = $expr; + $expr3 = $this->parseExpression(); + } + + $expr = new Twig_Node_Expression_Conditional($expr, $expr2, $expr3, $this->parser->getCurrentToken()->getLine()); + } + + return $expr; + } + + protected function isUnary(Twig_Token $token) + { + return $token->test(Twig_Token::OPERATOR_TYPE) && isset($this->unaryOperators[$token->getValue()]); + } + + protected function isBinary(Twig_Token $token) + { + return $token->test(Twig_Token::OPERATOR_TYPE) && isset($this->binaryOperators[$token->getValue()]); + } + + public function parsePrimaryExpression() + { + $token = $this->parser->getCurrentToken(); + switch ($token->getType()) { + case Twig_Token::NAME_TYPE: + $this->parser->getStream()->next(); + switch ($token->getValue()) { + case 'true': + case 'TRUE': + $node = new Twig_Node_Expression_Constant(true, $token->getLine()); + break; + + case 'false': + case 'FALSE': + $node = new Twig_Node_Expression_Constant(false, $token->getLine()); + break; + + case 'none': + case 'NONE': + case 'null': + case 'NULL': + $node = new Twig_Node_Expression_Constant(null, $token->getLine()); + break; + + default: + if ('(' === $this->parser->getCurrentToken()->getValue()) { + $node = $this->getFunctionNode($token->getValue(), $token->getLine()); + } else { + $node = new Twig_Node_Expression_Name($token->getValue(), $token->getLine()); + } + } + break; + + case Twig_Token::NUMBER_TYPE: + $this->parser->getStream()->next(); + $node = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine()); + break; + + case Twig_Token::STRING_TYPE: + case Twig_Token::INTERPOLATION_START_TYPE: + $node = $this->parseStringExpression(); + break; + + default: + if ($token->test(Twig_Token::PUNCTUATION_TYPE, '[')) { + $node = $this->parseArrayExpression(); + } elseif ($token->test(Twig_Token::PUNCTUATION_TYPE, '{')) { + $node = $this->parseHashExpression(); + } else { + throw new Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s"', Twig_Token::typeToEnglish($token->getType(), $token->getLine()), $token->getValue()), $token->getLine(), $this->parser->getFilename()); + } + } + + return $this->parsePostfixExpression($node); + } + + public function parseStringExpression() + { + $stream = $this->parser->getStream(); + + $nodes = array(); + // a string cannot be followed by another string in a single expression + $nextCanBeString = true; + while (true) { + if ($stream->test(Twig_Token::STRING_TYPE) && $nextCanBeString) { + $token = $stream->next(); + $nodes[] = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine()); + $nextCanBeString = false; + } elseif ($stream->test(Twig_Token::INTERPOLATION_START_TYPE)) { + $stream->next(); + $nodes[] = $this->parseExpression(); + $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); + $nextCanBeString = true; + } else { + break; + } + } + + $expr = array_shift($nodes); + foreach ($nodes as $node) { + $expr = new Twig_Node_Expression_Binary_Concat($expr, $node, $node->getLine()); + } + + return $expr; + } + + public function parseArrayExpression() + { + $stream = $this->parser->getStream(); + $stream->expect(Twig_Token::PUNCTUATION_TYPE, '[', 'An array element was expected'); + + $node = new Twig_Node_Expression_Array(array(), $stream->getCurrent()->getLine()); + $first = true; + while (!$stream->test(Twig_Token::PUNCTUATION_TYPE, ']')) { + if (!$first) { + $stream->expect(Twig_Token::PUNCTUATION_TYPE, ',', 'An array element must be followed by a comma'); + + // trailing ,? + if ($stream->test(Twig_Token::PUNCTUATION_TYPE, ']')) { + break; + } + } + $first = false; + + $node->addElement($this->parseExpression()); + } + $stream->expect(Twig_Token::PUNCTUATION_TYPE, ']', 'An opened array is not properly closed'); + + return $node; + } + + public function parseHashExpression() + { + $stream = $this->parser->getStream(); + $stream->expect(Twig_Token::PUNCTUATION_TYPE, '{', 'A hash element was expected'); + + $node = new Twig_Node_Expression_Array(array(), $stream->getCurrent()->getLine()); + $first = true; + while (!$stream->test(Twig_Token::PUNCTUATION_TYPE, '}')) { + if (!$first) { + $stream->expect(Twig_Token::PUNCTUATION_TYPE, ',', 'A hash value must be followed by a comma'); + + // trailing ,? + if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '}')) { + break; + } + } + $first = false; + + // a hash key can be: + // + // * a number -- 12 + // * a string -- 'a' + // * a name, which is equivalent to a string -- a + // * an expression, which must be enclosed in parentheses -- (1 + 2) + if ($stream->test(Twig_Token::STRING_TYPE) || $stream->test(Twig_Token::NAME_TYPE) || $stream->test(Twig_Token::NUMBER_TYPE)) { + $token = $stream->next(); + $key = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine()); + } elseif ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) { + $key = $this->parseExpression(); + } else { + $current = $stream->getCurrent(); + + throw new Twig_Error_Syntax(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s"', Twig_Token::typeToEnglish($current->getType(), $current->getLine()), $current->getValue()), $current->getLine(), $this->parser->getFilename()); + } + + $stream->expect(Twig_Token::PUNCTUATION_TYPE, ':', 'A hash key must be followed by a colon (:)'); + $value = $this->parseExpression(); + + $node->addElement($value, $key); + } + $stream->expect(Twig_Token::PUNCTUATION_TYPE, '}', 'An opened hash is not properly closed'); + + return $node; + } + + public function parsePostfixExpression($node) + { + while (true) { + $token = $this->parser->getCurrentToken(); + if ($token->getType() == Twig_Token::PUNCTUATION_TYPE) { + if ('.' == $token->getValue() || '[' == $token->getValue()) { + $node = $this->parseSubscriptExpression($node); + } elseif ('|' == $token->getValue()) { + $node = $this->parseFilterExpression($node); + } else { + break; + } + } else { + break; + } + } + + return $node; + } + + public function getFunctionNode($name, $line) + { + switch ($name) { + case 'parent': + $args = $this->parseArguments(); + if (!count($this->parser->getBlockStack())) { + throw new Twig_Error_Syntax('Calling "parent" outside a block is forbidden', $line, $this->parser->getFilename()); + } + + if (!$this->parser->getParent() && !$this->parser->hasTraits()) { + throw new Twig_Error_Syntax('Calling "parent" on a template that does not extend nor "use" another template is forbidden', $line, $this->parser->getFilename()); + } + + return new Twig_Node_Expression_Parent($this->parser->peekBlockStack(), $line); + case 'block': + return new Twig_Node_Expression_BlockReference($this->parseArguments()->getNode(0), false, $line); + case 'attribute': + $args = $this->parseArguments(); + if (count($args) < 2) { + throw new Twig_Error_Syntax('The "attribute" function takes at least two arguments (the variable and the attributes)', $line, $this->parser->getFilename()); + } + + return new Twig_Node_Expression_GetAttr($args->getNode(0), $args->getNode(1), count($args) > 2 ? $args->getNode(2) : new Twig_Node_Expression_Array(array(), $line), Twig_TemplateInterface::ANY_CALL, $line); + default: + if (null !== $alias = $this->parser->getImportedSymbol('function', $name)) { + $arguments = new Twig_Node_Expression_Array(array(), $line); + foreach ($this->parseArguments() as $n) { + $arguments->addElement($n); + } + + $node = new Twig_Node_Expression_MethodCall($alias['node'], $alias['name'], $arguments, $line); + $node->setAttribute('safe', true); + + return $node; + } + + $args = $this->parseArguments(true); + $class = $this->getFunctionNodeClass($name, $line); + + return new $class($name, $args, $line); + } + } + + public function parseSubscriptExpression($node) + { + $stream = $this->parser->getStream(); + $token = $stream->next(); + $lineno = $token->getLine(); + $arguments = new Twig_Node_Expression_Array(array(), $lineno); + $type = Twig_TemplateInterface::ANY_CALL; + if ($token->getValue() == '.') { + $token = $stream->next(); + if ( + $token->getType() == Twig_Token::NAME_TYPE + || + $token->getType() == Twig_Token::NUMBER_TYPE + || + ($token->getType() == Twig_Token::OPERATOR_TYPE && preg_match(Twig_Lexer::REGEX_NAME, $token->getValue())) + ) { + $arg = new Twig_Node_Expression_Constant($token->getValue(), $lineno); + + if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) { + $type = Twig_TemplateInterface::METHOD_CALL; + foreach ($this->parseArguments() as $n) { + $arguments->addElement($n); + } + } + } else { + throw new Twig_Error_Syntax('Expected name or number', $lineno, $this->parser->getFilename()); + } + + if ($node instanceof Twig_Node_Expression_Name && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) { + if (!$arg instanceof Twig_Node_Expression_Constant) { + throw new Twig_Error_Syntax(sprintf('Dynamic macro names are not supported (called on "%s")', $node->getAttribute('name')), $token->getLine(), $this->parser->getFilename()); + } + + $node = new Twig_Node_Expression_MethodCall($node, 'get'.$arg->getAttribute('value'), $arguments, $lineno); + $node->setAttribute('safe', true); + + return $node; + } + } else { + $type = Twig_TemplateInterface::ARRAY_CALL; + + // slice? + $slice = false; + if ($stream->test(Twig_Token::PUNCTUATION_TYPE, ':')) { + $slice = true; + $arg = new Twig_Node_Expression_Constant(0, $token->getLine()); + } else { + $arg = $this->parseExpression(); + } + + if ($stream->test(Twig_Token::PUNCTUATION_TYPE, ':')) { + $slice = true; + $stream->next(); + } + + if ($slice) { + if ($stream->test(Twig_Token::PUNCTUATION_TYPE, ']')) { + $length = new Twig_Node_Expression_Constant(null, $token->getLine()); + } else { + $length = $this->parseExpression(); + } + + $class = $this->getFilterNodeClass('slice', $token->getLine()); + $arguments = new Twig_Node(array($arg, $length)); + $filter = new $class($node, new Twig_Node_Expression_Constant('slice', $token->getLine()), $arguments, $token->getLine()); + + $stream->expect(Twig_Token::PUNCTUATION_TYPE, ']'); + + return $filter; + } + + $stream->expect(Twig_Token::PUNCTUATION_TYPE, ']'); + } + + return new Twig_Node_Expression_GetAttr($node, $arg, $arguments, $type, $lineno); + } + + public function parseFilterExpression($node) + { + $this->parser->getStream()->next(); + + return $this->parseFilterExpressionRaw($node); + } + + public function parseFilterExpressionRaw($node, $tag = null) + { + while (true) { + $token = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE); + + $name = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine()); + if (!$this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, '(')) { + $arguments = new Twig_Node(); + } else { + $arguments = $this->parseArguments(true); + } + + $class = $this->getFilterNodeClass($name->getAttribute('value'), $token->getLine()); + + $node = new $class($node, $name, $arguments, $token->getLine(), $tag); + + if (!$this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, '|')) { + break; + } + + $this->parser->getStream()->next(); + } + + return $node; + } + + /** + * Parses arguments. + * + * @param Boolean $namedArguments Whether to allow named arguments or not + * @param Boolean $definition Whether we are parsing arguments for a function definition + */ + public function parseArguments($namedArguments = false, $definition = false) + { + $args = array(); + $stream = $this->parser->getStream(); + + $stream->expect(Twig_Token::PUNCTUATION_TYPE, '(', 'A list of arguments must begin with an opening parenthesis'); + while (!$stream->test(Twig_Token::PUNCTUATION_TYPE, ')')) { + if (!empty($args)) { + $stream->expect(Twig_Token::PUNCTUATION_TYPE, ',', 'Arguments must be separated by a comma'); + } + + if ($definition) { + $token = $stream->expect(Twig_Token::NAME_TYPE, null, 'An argument must be a name'); + $value = new Twig_Node_Expression_Name($token->getValue(), $this->parser->getCurrentToken()->getLine()); + } else { + $value = $this->parseExpression(); + } + + $name = null; + if ($namedArguments && $stream->test(Twig_Token::OPERATOR_TYPE, '=')) { + $token = $stream->next(); + if (!$value instanceof Twig_Node_Expression_Name) { + throw new Twig_Error_Syntax(sprintf('A parameter name must be a string, "%s" given', get_class($value)), $token->getLine(), $this->parser->getFilename()); + } + $name = $value->getAttribute('name'); + + if ($definition) { + $value = $this->parsePrimaryExpression(); + + if (!$this->checkConstantExpression($value)) { + throw new Twig_Error_Syntax(sprintf('A default value for an argument must be a constant (a boolean, a string, a number, or an array).'), $token->getLine(), $this->parser->getFilename()); + } + } else { + $value = $this->parseExpression(); + } + } + + if ($definition) { + if (null === $name) { + $name = $value->getAttribute('name'); + $value = new Twig_Node_Expression_Constant(null, $this->parser->getCurrentToken()->getLine()); + } + $args[$name] = $value; + } else { + if (null === $name) { + $args[] = $value; + } else { + $args[$name] = $value; + } + } + } + $stream->expect(Twig_Token::PUNCTUATION_TYPE, ')', 'A list of arguments must be closed by a parenthesis'); + + return new Twig_Node($args); + } + + public function parseAssignmentExpression() + { + $targets = array(); + while (true) { + $token = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE, null, 'Only variables can be assigned to'); + if (in_array($token->getValue(), array('true', 'false', 'none'))) { + throw new Twig_Error_Syntax(sprintf('You cannot assign a value to "%s"', $token->getValue()), $token->getLine(), $this->parser->getFilename()); + } + $targets[] = new Twig_Node_Expression_AssignName($token->getValue(), $token->getLine()); + + if (!$this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, ',')) { + break; + } + $this->parser->getStream()->next(); + } + + return new Twig_Node($targets); + } + + public function parseMultitargetExpression() + { + $targets = array(); + while (true) { + $targets[] = $this->parseExpression(); + if (!$this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, ',')) { + break; + } + $this->parser->getStream()->next(); + } + + return new Twig_Node($targets); + } + + protected function getFunctionNodeClass($name, $line) + { + $env = $this->parser->getEnvironment(); + + if (false === $function = $env->getFunction($name)) { + $message = sprintf('The function "%s" does not exist', $name); + if ($alternatives = $env->computeAlternatives($name, array_keys($env->getFunctions()))) { + $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives)); + } + + throw new Twig_Error_Syntax($message, $line, $this->parser->getFilename()); + } + + if ($function instanceof Twig_SimpleFunction) { + return $function->getNodeClass(); + } + + return $function instanceof Twig_Function_Node ? $function->getClass() : 'Twig_Node_Expression_Function'; + } + + protected function getFilterNodeClass($name, $line) + { + $env = $this->parser->getEnvironment(); + + if (false === $filter = $env->getFilter($name)) { + $message = sprintf('The filter "%s" does not exist', $name); + if ($alternatives = $env->computeAlternatives($name, array_keys($env->getFilters()))) { + $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives)); + } + + throw new Twig_Error_Syntax($message, $line, $this->parser->getFilename()); + } + + if ($filter instanceof Twig_SimpleFilter) { + return $filter->getNodeClass(); + } + + return $filter instanceof Twig_Filter_Node ? $filter->getClass() : 'Twig_Node_Expression_Filter'; + } + + // checks that the node only contains "constant" elements + protected function checkConstantExpression(Twig_NodeInterface $node) + { + if (!($node instanceof Twig_Node_Expression_Constant || $node instanceof Twig_Node_Expression_Array)) { + return false; + } + + foreach ($node as $n) { + if (!$this->checkConstantExpression($n)) { + return false; + } + } + + return true; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Extension.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Extension.php new file mode 100644 index 0000000..931fc03 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Extension.php @@ -0,0 +1,93 @@ +dateFormats[0] = $format; + } + + if (null !== $dateIntervalFormat) { + $this->dateFormats[1] = $dateIntervalFormat; + } + } + + /** + * Gets the default format to be used by the date filter. + * + * @return array The default date format string and the default date interval format string + */ + public function getDateFormat() + { + return $this->dateFormats; + } + + /** + * Sets the default timezone to be used by the date filter. + * + * @param DateTimeZone|string $timezone The default timezone string or a DateTimeZone object + */ + public function setTimezone($timezone) + { + $this->timezone = $timezone instanceof DateTimeZone ? $timezone : new DateTimeZone($timezone); + } + + /** + * Gets the default timezone to be used by the date filter. + * + * @return DateTimeZone The default timezone currently in use + */ + public function getTimezone() + { + if (null === $this->timezone) { + $this->timezone = new DateTimeZone(date_default_timezone_get()); + } + + return $this->timezone; + } + + /** + * Sets the default format to be used by the number_format filter. + * + * @param integer $decimal The number of decimal places to use. + * @param string $decimalPoint The character(s) to use for the decimal point. + * @param string $thousandSep The character(s) to use for the thousands separator. + */ + public function setNumberFormat($decimal, $decimalPoint, $thousandSep) + { + $this->numberFormat = array($decimal, $decimalPoint, $thousandSep); + } + + /** + * Get the default format used by the number_format filter. + * + * @return array The arguments for number_format() + */ + public function getNumberFormat() + { + return $this->numberFormat; + } + + /** + * Returns the token parser instance to add to the existing list. + * + * @return array An array of Twig_TokenParser instances + */ + public function getTokenParsers() + { + return array( + new Twig_TokenParser_For(), + new Twig_TokenParser_If(), + new Twig_TokenParser_Extends(), + new Twig_TokenParser_Include(), + new Twig_TokenParser_Block(), + new Twig_TokenParser_Use(), + new Twig_TokenParser_Filter(), + new Twig_TokenParser_Macro(), + new Twig_TokenParser_Import(), + new Twig_TokenParser_From(), + new Twig_TokenParser_Set(), + new Twig_TokenParser_Spaceless(), + new Twig_TokenParser_Flush(), + new Twig_TokenParser_Do(), + new Twig_TokenParser_Embed(), + ); + } + + /** + * Returns a list of filters to add to the existing list. + * + * @return array An array of filters + */ + public function getFilters() + { + $filters = array( + // formatting filters + new Twig_SimpleFilter('date', 'twig_date_format_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('date_modify', 'twig_date_modify_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('format', 'sprintf'), + new Twig_SimpleFilter('replace', 'strtr'), + new Twig_SimpleFilter('number_format', 'twig_number_format_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('abs', 'abs'), + + // encoding + new Twig_SimpleFilter('url_encode', 'twig_urlencode_filter'), + new Twig_SimpleFilter('json_encode', 'twig_jsonencode_filter'), + new Twig_SimpleFilter('convert_encoding', 'twig_convert_encoding'), + + // string filters + new Twig_SimpleFilter('title', 'twig_title_string_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('capitalize', 'twig_capitalize_string_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('upper', 'strtoupper'), + new Twig_SimpleFilter('lower', 'strtolower'), + new Twig_SimpleFilter('striptags', 'strip_tags'), + new Twig_SimpleFilter('trim', 'trim'), + new Twig_SimpleFilter('nl2br', 'nl2br', array('pre_escape' => 'html', 'is_safe' => array('html'))), + + // array helpers + new Twig_SimpleFilter('join', 'twig_join_filter'), + new Twig_SimpleFilter('split', 'twig_split_filter'), + new Twig_SimpleFilter('sort', 'twig_sort_filter'), + new Twig_SimpleFilter('merge', 'twig_array_merge'), + new Twig_SimpleFilter('batch', 'twig_array_batch'), + + // string/array filters + new Twig_SimpleFilter('reverse', 'twig_reverse_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('length', 'twig_length_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('slice', 'twig_slice', array('needs_environment' => true)), + new Twig_SimpleFilter('first', 'twig_first', array('needs_environment' => true)), + new Twig_SimpleFilter('last', 'twig_last', array('needs_environment' => true)), + + // iteration and runtime + new Twig_SimpleFilter('default', '_twig_default_filter', array('node_class' => 'Twig_Node_Expression_Filter_Default')), + new Twig_SimpleFilter('keys', 'twig_get_array_keys_filter'), + + // escaping + new Twig_SimpleFilter('escape', 'twig_escape_filter', array('needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe')), + new Twig_SimpleFilter('e', 'twig_escape_filter', array('needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe')), + ); + + if (function_exists('mb_get_info')) { + $filters[] = new Twig_SimpleFilter('upper', 'twig_upper_filter', array('needs_environment' => true)); + $filters[] = new Twig_SimpleFilter('lower', 'twig_lower_filter', array('needs_environment' => true)); + } + + return $filters; + } + + /** + * Returns a list of global functions to add to the existing list. + * + * @return array An array of global functions + */ + public function getFunctions() + { + return array( + new Twig_SimpleFunction('range', 'range'), + new Twig_SimpleFunction('constant', 'twig_constant'), + new Twig_SimpleFunction('cycle', 'twig_cycle'), + new Twig_SimpleFunction('random', 'twig_random', array('needs_environment' => true)), + new Twig_SimpleFunction('date', 'twig_date_converter', array('needs_environment' => true)), + new Twig_SimpleFunction('include', 'twig_include', array('needs_environment' => true, 'needs_context' => true, 'is_safe' => array('all'))), + ); + } + + /** + * Returns a list of tests to add to the existing list. + * + * @return array An array of tests + */ + public function getTests() + { + return array( + new Twig_SimpleTest('even', null, array('node_class' => 'Twig_Node_Expression_Test_Even')), + new Twig_SimpleTest('odd', null, array('node_class' => 'Twig_Node_Expression_Test_Odd')), + new Twig_SimpleTest('defined', null, array('node_class' => 'Twig_Node_Expression_Test_Defined')), + new Twig_SimpleTest('sameas', null, array('node_class' => 'Twig_Node_Expression_Test_Sameas')), + new Twig_SimpleTest('none', null, array('node_class' => 'Twig_Node_Expression_Test_Null')), + new Twig_SimpleTest('null', null, array('node_class' => 'Twig_Node_Expression_Test_Null')), + new Twig_SimpleTest('divisibleby', null, array('node_class' => 'Twig_Node_Expression_Test_Divisibleby')), + new Twig_SimpleTest('constant', null, array('node_class' => 'Twig_Node_Expression_Test_Constant')), + new Twig_SimpleTest('empty', 'twig_test_empty'), + new Twig_SimpleTest('iterable', 'twig_test_iterable'), + ); + } + + /** + * Returns a list of operators to add to the existing list. + * + * @return array An array of operators + */ + public function getOperators() + { + return array( + array( + 'not' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'), + '-' => array('precedence' => 500, 'class' => 'Twig_Node_Expression_Unary_Neg'), + '+' => array('precedence' => 500, 'class' => 'Twig_Node_Expression_Unary_Pos'), + ), + array( + 'or' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + 'and' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + 'b-or' => array('precedence' => 16, 'class' => 'Twig_Node_Expression_Binary_BitwiseOr', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + 'b-xor' => array('precedence' => 17, 'class' => 'Twig_Node_Expression_Binary_BitwiseXor', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + 'b-and' => array('precedence' => 18, 'class' => 'Twig_Node_Expression_Binary_BitwiseAnd', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '==' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Equal', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '!=' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '<' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Less', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '>' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Greater', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '>=' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '<=' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + 'not in' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotIn', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + 'in' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_In', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '..' => array('precedence' => 25, 'class' => 'Twig_Node_Expression_Binary_Range', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '+' => array('precedence' => 30, 'class' => 'Twig_Node_Expression_Binary_Add', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '-' => array('precedence' => 30, 'class' => 'Twig_Node_Expression_Binary_Sub', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '~' => array('precedence' => 40, 'class' => 'Twig_Node_Expression_Binary_Concat', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '*' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mul', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '/' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Div', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '//' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_FloorDiv', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '%' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + 'is' => array('precedence' => 100, 'callable' => array($this, 'parseTestExpression'), 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + 'is not' => array('precedence' => 100, 'callable' => array($this, 'parseNotTestExpression'), 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '**' => array('precedence' => 200, 'class' => 'Twig_Node_Expression_Binary_Power', 'associativity' => Twig_ExpressionParser::OPERATOR_RIGHT), + ), + ); + } + + public function parseNotTestExpression(Twig_Parser $parser, $node) + { + return new Twig_Node_Expression_Unary_Not($this->parseTestExpression($parser, $node), $parser->getCurrentToken()->getLine()); + } + + public function parseTestExpression(Twig_Parser $parser, $node) + { + $stream = $parser->getStream(); + $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); + $arguments = null; + if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) { + $arguments = $parser->getExpressionParser()->parseArguments(true); + } + + $class = $this->getTestNodeClass($parser, $name, $node->getLine()); + + return new $class($node, $name, $arguments, $parser->getCurrentToken()->getLine()); + } + + protected function getTestNodeClass(Twig_Parser $parser, $name, $line) + { + $env = $parser->getEnvironment(); + $testMap = $env->getTests(); + if (!isset($testMap[$name])) { + $message = sprintf('The test "%s" does not exist', $name); + if ($alternatives = $env->computeAlternatives($name, array_keys($env->getTests()))) { + $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives)); + } + + throw new Twig_Error_Syntax($message, $line, $parser->getFilename()); + } + + if ($testMap[$name] instanceof Twig_SimpleTest) { + return $testMap[$name]->getNodeClass(); + } + + return $testMap[$name] instanceof Twig_Test_Node ? $testMap[$name]->getClass() : 'Twig_Node_Expression_Test'; + } + + /** + * Returns the name of the extension. + * + * @return string The extension name + */ + public function getName() + { + return 'core'; + } +} + +/** + * Cycles over a value. + * + * @param ArrayAccess|array $values An array or an ArrayAccess instance + * @param integer $position The cycle position + * + * @return string The next value in the cycle + */ +function twig_cycle($values, $position) +{ + if (!is_array($values) && !$values instanceof ArrayAccess) { + return $values; + } + + return $values[$position % count($values)]; +} + +/** + * Returns a random value depending on the supplied parameter type: + * - a random item from a Traversable or array + * - a random character from a string + * - a random integer between 0 and the integer parameter + * + * @param Twig_Environment $env A Twig_Environment instance + * @param Traversable|array|integer|string $values The values to pick a random item from + * + * @throws Twig_Error_Runtime When $values is an empty array (does not apply to an empty string which is returned as is). + * + * @return mixed A random value from the given sequence + */ +function twig_random(Twig_Environment $env, $values = null) +{ + if (null === $values) { + return mt_rand(); + } + + if (is_int($values) || is_float($values)) { + return $values < 0 ? mt_rand($values, 0) : mt_rand(0, $values); + } + + if ($values instanceof Traversable) { + $values = iterator_to_array($values); + } elseif (is_string($values)) { + if ('' === $values) { + return ''; + } + if (null !== $charset = $env->getCharset()) { + if ('UTF-8' != $charset) { + $values = twig_convert_encoding($values, 'UTF-8', $charset); + } + + // unicode version of str_split() + // split at all positions, but not after the start and not before the end + $values = preg_split('/(? $value) { + $values[$i] = twig_convert_encoding($value, $charset, 'UTF-8'); + } + } + } else { + return $values[mt_rand(0, strlen($values) - 1)]; + } + } + + if (!is_array($values)) { + return $values; + } + + if (0 === count($values)) { + throw new Twig_Error_Runtime('The random function cannot pick from an empty array.'); + } + + return $values[array_rand($values, 1)]; +} + +/** + * Converts a date to the given format. + * + *
+ *   {{ post.published_at|date("m/d/Y") }}
+ * 
+ * + * @param Twig_Environment $env A Twig_Environment instance + * @param DateTime|DateInterval|string $date A date + * @param string $format A format + * @param DateTimeZone|string $timezone A timezone + * + * @return string The formatted date + */ +function twig_date_format_filter(Twig_Environment $env, $date, $format = null, $timezone = null) +{ + if (null === $format) { + $formats = $env->getExtension('core')->getDateFormat(); + $format = $date instanceof DateInterval ? $formats[1] : $formats[0]; + } + + if ($date instanceof DateInterval) { + return $date->format($format); + } + + return twig_date_converter($env, $date, $timezone)->format($format); +} + +/** + * Returns a new date object modified + * + *
+ *   {{ post.published_at|date_modify("-1day")|date("m/d/Y") }}
+ * 
+ * + * @param Twig_Environment $env A Twig_Environment instance + * @param DateTime|string $date A date + * @param string $modifier A modifier string + * + * @return DateTime A new date object + */ +function twig_date_modify_filter(Twig_Environment $env, $date, $modifier) +{ + $date = twig_date_converter($env, $date, false); + $date->modify($modifier); + + return $date; +} + +/** + * Converts an input to a DateTime instance. + * + *
+ *    {% if date(user.created_at) < date('+2days') %}
+ *      {# do something #}
+ *    {% endif %}
+ * 
+ * + * @param Twig_Environment $env A Twig_Environment instance + * @param DateTime|string $date A date + * @param DateTimeZone|string $timezone A timezone + * + * @return DateTime A DateTime instance + */ +function twig_date_converter(Twig_Environment $env, $date = null, $timezone = null) +{ + // determine the timezone + if (!$timezone) { + $defaultTimezone = $env->getExtension('core')->getTimezone(); + } elseif (!$timezone instanceof DateTimeZone) { + $defaultTimezone = new DateTimeZone($timezone); + } else { + $defaultTimezone = $timezone; + } + + if ($date instanceof DateTime) { + $date = clone $date; + if (false !== $timezone) { + $date->setTimezone($defaultTimezone); + } + + return $date; + } + + $asString = (string) $date; + if (ctype_digit($asString) || (!empty($asString) && '-' === $asString[0] && ctype_digit(substr($asString, 1)))) { + $date = '@'.$date; + } + + $date = new DateTime($date, $defaultTimezone); + if (false !== $timezone) { + $date->setTimezone($defaultTimezone); + } + + return $date; +} + +/** + * Number format filter. + * + * All of the formatting options can be left null, in that case the defaults will + * be used. Supplying any of the parameters will override the defaults set in the + * environment object. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param mixed $number A float/int/string of the number to format + * @param integer $decimal The number of decimal points to display. + * @param string $decimalPoint The character(s) to use for the decimal point. + * @param string $thousandSep The character(s) to use for the thousands separator. + * + * @return string The formatted number + */ +function twig_number_format_filter(Twig_Environment $env, $number, $decimal = null, $decimalPoint = null, $thousandSep = null) +{ + $defaults = $env->getExtension('core')->getNumberFormat(); + if (null === $decimal) { + $decimal = $defaults[0]; + } + + if (null === $decimalPoint) { + $decimalPoint = $defaults[1]; + } + + if (null === $thousandSep) { + $thousandSep = $defaults[2]; + } + + return number_format((float) $number, $decimal, $decimalPoint, $thousandSep); +} + +/** + * URL encodes a string as a path segment or an array as a query string. + * + * @param string|array $url A URL or an array of query parameters + * @param bool $raw true to use rawurlencode() instead of urlencode + * + * @return string The URL encoded value + */ +function twig_urlencode_filter($url, $raw = false) +{ + if (is_array($url)) { + return http_build_query($url, '', '&'); + } + + if ($raw) { + return rawurlencode($url); + } + + return urlencode($url); +} + +if (version_compare(PHP_VERSION, '5.3.0', '<')) { + /** + * JSON encodes a variable. + * + * @param mixed $value The value to encode. + * @param integer $options Not used on PHP 5.2.x + * + * @return mixed The JSON encoded value + */ + function twig_jsonencode_filter($value, $options = 0) + { + if ($value instanceof Twig_Markup) { + $value = (string) $value; + } elseif (is_array($value)) { + array_walk_recursive($value, '_twig_markup2string'); + } + + return json_encode($value); + } +} else { + /** + * JSON encodes a variable. + * + * @param mixed $value The value to encode. + * @param integer $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT + * + * @return mixed The JSON encoded value + */ + function twig_jsonencode_filter($value, $options = 0) + { + if ($value instanceof Twig_Markup) { + $value = (string) $value; + } elseif (is_array($value)) { + array_walk_recursive($value, '_twig_markup2string'); + } + + return json_encode($value, $options); + } +} + +function _twig_markup2string(&$value) +{ + if ($value instanceof Twig_Markup) { + $value = (string) $value; + } +} + +/** + * Merges an array with another one. + * + *
+ *  {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %}
+ *
+ *  {% set items = items|merge({ 'peugeot': 'car' }) %}
+ *
+ *  {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car' } #}
+ * 
+ * + * @param array $arr1 An array + * @param array $arr2 An array + * + * @return array The merged array + */ +function twig_array_merge($arr1, $arr2) +{ + if (!is_array($arr1) || !is_array($arr2)) { + throw new Twig_Error_Runtime('The merge filter only works with arrays or hashes.'); + } + + return array_merge($arr1, $arr2); +} + +/** + * Slices a variable. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param mixed $item A variable + * @param integer $start Start of the slice + * @param integer $length Size of the slice + * @param Boolean $preserveKeys Whether to preserve key or not (when the input is an array) + * + * @return mixed The sliced variable + */ +function twig_slice(Twig_Environment $env, $item, $start, $length = null, $preserveKeys = false) +{ + if ($item instanceof Traversable) { + $item = iterator_to_array($item, false); + } + + if (is_array($item)) { + return array_slice($item, $start, $length, $preserveKeys); + } + + $item = (string) $item; + + if (function_exists('mb_get_info') && null !== $charset = $env->getCharset()) { + return mb_substr($item, $start, null === $length ? mb_strlen($item, $charset) - $start : $length, $charset); + } + + return null === $length ? substr($item, $start) : substr($item, $start, $length); +} + +/** + * Returns the first element of the item. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param mixed $item A variable + * + * @return mixed The first element of the item + */ +function twig_first(Twig_Environment $env, $item) +{ + $elements = twig_slice($env, $item, 0, 1, false); + + return is_string($elements) ? $elements[0] : current($elements); +} + +/** + * Returns the last element of the item. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param mixed $item A variable + * + * @return mixed The last element of the item + */ +function twig_last(Twig_Environment $env, $item) +{ + $elements = twig_slice($env, $item, -1, 1, false); + + return is_string($elements) ? $elements[0] : current($elements); +} + +/** + * Joins the values to a string. + * + * The separator between elements is an empty string per default, you can define it with the optional parameter. + * + *
+ *  {{ [1, 2, 3]|join('|') }}
+ *  {# returns 1|2|3 #}
+ *
+ *  {{ [1, 2, 3]|join }}
+ *  {# returns 123 #}
+ * 
+ * + * @param array $value An array + * @param string $glue The separator + * + * @return string The concatenated string + */ +function twig_join_filter($value, $glue = '') +{ + if ($value instanceof Traversable) { + $value = iterator_to_array($value, false); + } + + return implode($glue, (array) $value); +} + +/** + * Splits the string into an array. + * + *
+ *  {{ "one,two,three"|split(',') }}
+ *  {# returns [one, two, three] #}
+ *
+ *  {{ "one,two,three,four,five"|split(',', 3) }}
+ *  {# returns [one, two, "three,four,five"] #}
+ *
+ *  {{ "123"|split('') }}
+ *  {# returns [1, 2, 3] #}
+ *
+ *  {{ "aabbcc"|split('', 2) }}
+ *  {# returns [aa, bb, cc] #}
+ * 
+ * + * @param string $value A string + * @param string $delimiter The delimiter + * @param integer $limit The limit + * + * @return array The split string as an array + */ +function twig_split_filter($value, $delimiter, $limit = null) +{ + if (empty($delimiter)) { + return str_split($value, null === $limit ? 1 : $limit); + } + + return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit); +} + +// The '_default' filter is used internally to avoid using the ternary operator +// which costs a lot for big contexts (before PHP 5.4). So, on average, +// a function call is cheaper. +function _twig_default_filter($value, $default = '') +{ + if (twig_test_empty($value)) { + return $default; + } + + return $value; +} + +/** + * Returns the keys for the given array. + * + * It is useful when you want to iterate over the keys of an array: + * + *
+ *  {% for key in array|keys %}
+ *      {# ... #}
+ *  {% endfor %}
+ * 
+ * + * @param array $array An array + * + * @return array The keys + */ +function twig_get_array_keys_filter($array) +{ + if (is_object($array) && $array instanceof Traversable) { + return array_keys(iterator_to_array($array)); + } + + if (!is_array($array)) { + return array(); + } + + return array_keys($array); +} + +/** + * Reverses a variable. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param array|Traversable|string $item An array, a Traversable instance, or a string + * @param Boolean $preserveKeys Whether to preserve key or not + * + * @return mixed The reversed input + */ +function twig_reverse_filter(Twig_Environment $env, $item, $preserveKeys = false) +{ + if (is_object($item) && $item instanceof Traversable) { + return array_reverse(iterator_to_array($item), $preserveKeys); + } + + if (is_array($item)) { + return array_reverse($item, $preserveKeys); + } + + if (null !== $charset = $env->getCharset()) { + $string = (string) $item; + + if ('UTF-8' != $charset) { + $item = twig_convert_encoding($string, 'UTF-8', $charset); + } + + preg_match_all('/./us', $item, $matches); + + $string = implode('', array_reverse($matches[0])); + + if ('UTF-8' != $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + } + + return strrev((string) $item); +} + +/** + * Sorts an array. + * + * @param array $array An array + */ +function twig_sort_filter($array) +{ + asort($array); + + return $array; +} + +/* used internally */ +function twig_in_filter($value, $compare) +{ + if (is_array($compare)) { + return in_array($value, $compare, is_object($value)); + } elseif (is_string($compare)) { + if (!strlen($value)) { + return empty($compare); + } + + return false !== strpos($compare, (string) $value); + } elseif ($compare instanceof Traversable) { + return in_array($value, iterator_to_array($compare, false), is_object($value)); + } + + return false; +} + +/** + * Escapes a string. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param string $string The value to be escaped + * @param string $strategy The escaping strategy + * @param string $charset The charset + * @param Boolean $autoescape Whether the function is called by the auto-escaping feature (true) or by the developer (false) + */ +function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html', $charset = null, $autoescape = false) +{ + if ($autoescape && $string instanceof Twig_Markup) { + return $string; + } + + if (!is_string($string)) { + if (is_object($string) && method_exists($string, '__toString')) { + $string = (string) $string; + } else { + return $string; + } + } + + if (null === $charset) { + $charset = $env->getCharset(); + } + + switch ($strategy) { + case 'html': + // see http://php.net/htmlspecialchars + + // Using a static variable to avoid initializing the array + // each time the function is called. Moving the declaration on the + // top of the function slow downs other escaping strategies. + static $htmlspecialcharsCharsets = array( + 'ISO-8859-1' => true, 'ISO8859-1' => true, + 'ISO-8859-15' => true, 'ISO8859-15' => true, + 'utf-8' => true, 'UTF-8' => true, + 'CP866' => true, 'IBM866' => true, '866' => true, + 'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true, + '1251' => true, + 'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true, + 'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => true, + 'BIG5' => true, '950' => true, + 'GB2312' => true, '936' => true, + 'BIG5-HKSCS' => true, + 'SHIFT_JIS' => true, 'SJIS' => true, '932' => true, + 'EUC-JP' => true, 'EUCJP' => true, + 'ISO8859-5' => true, 'ISO-8859-5' => true, 'MACROMAN' => true, + ); + + if (isset($htmlspecialcharsCharsets[$charset])) { + return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); + } + + if (isset($htmlspecialcharsCharsets[strtoupper($charset)])) { + // cache the lowercase variant for future iterations + $htmlspecialcharsCharsets[$charset] = true; + + return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); + } + + $string = twig_convert_encoding($string, 'UTF-8', $charset); + $string = htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); + + return twig_convert_encoding($string, $charset, 'UTF-8'); + + case 'js': + // escape all non-alphanumeric characters + // into their \xHH or \uHHHH representations + if ('UTF-8' != $charset) { + $string = twig_convert_encoding($string, 'UTF-8', $charset); + } + + if (0 == strlen($string) ? false : (1 == preg_match('/^./su', $string) ? false : true)) { + throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.'); + } + + $string = preg_replace_callback('#[^a-zA-Z0-9,\._]#Su', '_twig_escape_js_callback', $string); + + if ('UTF-8' != $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + + case 'css': + if ('UTF-8' != $charset) { + $string = twig_convert_encoding($string, 'UTF-8', $charset); + } + + if (0 == strlen($string) ? false : (1 == preg_match('/^./su', $string) ? false : true)) { + throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.'); + } + + $string = preg_replace_callback('#[^a-zA-Z0-9]#Su', '_twig_escape_css_callback', $string); + + if ('UTF-8' != $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + + case 'html_attr': + if ('UTF-8' != $charset) { + $string = twig_convert_encoding($string, 'UTF-8', $charset); + } + + if (0 == strlen($string) ? false : (1 == preg_match('/^./su', $string) ? false : true)) { + throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.'); + } + + $string = preg_replace_callback('#[^a-zA-Z0-9,\.\-_]#Su', '_twig_escape_html_attr_callback', $string); + + if ('UTF-8' != $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + + case 'url': + // hackish test to avoid version_compare that is much slower, this works unless PHP releases a 5.10.* + // at that point however PHP 5.2.* support can be removed + if (PHP_VERSION < '5.3.0') { + return str_replace('%7E', '~', rawurlencode($string)); + } + + return rawurlencode($string); + + default: + throw new Twig_Error_Runtime(sprintf('Invalid escaping strategy "%s" (valid ones: html, js, url, css, and html_attr).', $strategy)); + } +} + +/* used internally */ +function twig_escape_filter_is_safe(Twig_Node $filterArgs) +{ + foreach ($filterArgs as $arg) { + if ($arg instanceof Twig_Node_Expression_Constant) { + return array($arg->getAttribute('value')); + } + + return array(); + } + + return array('html'); +} + +if (function_exists('mb_convert_encoding')) { + function twig_convert_encoding($string, $to, $from) + { + return mb_convert_encoding($string, $to, $from); + } +} elseif (function_exists('iconv')) { + function twig_convert_encoding($string, $to, $from) + { + return iconv($from, $to, $string); + } +} else { + function twig_convert_encoding($string, $to, $from) + { + throw new Twig_Error_Runtime('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).'); + } +} + +function _twig_escape_js_callback($matches) +{ + $char = $matches[0]; + + // \xHH + if (!isset($char[1])) { + return '\\x'.strtoupper(substr('00'.bin2hex($char), -2)); + } + + // \uHHHH + $char = twig_convert_encoding($char, 'UTF-16BE', 'UTF-8'); + + return '\\u'.strtoupper(substr('0000'.bin2hex($char), -4)); +} + +function _twig_escape_css_callback($matches) +{ + $char = $matches[0]; + + // \xHH + if (!isset($char[1])) { + $hex = ltrim(strtoupper(bin2hex($char)), '0'); + if (0 === strlen($hex)) { + $hex = '0'; + } + + return '\\'.$hex.' '; + } + + // \uHHHH + $char = twig_convert_encoding($char, 'UTF-16BE', 'UTF-8'); + + return '\\'.ltrim(strtoupper(bin2hex($char)), '0').' '; +} + +/** + * This function is adapted from code coming from Zend Framework. + * + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +function _twig_escape_html_attr_callback($matches) +{ + /* + * While HTML supports far more named entities, the lowest common denominator + * has become HTML5's XML Serialisation which is restricted to the those named + * entities that XML supports. Using HTML entities would result in this error: + * XML Parsing Error: undefined entity + */ + static $entityMap = array( + 34 => 'quot', /* quotation mark */ + 38 => 'amp', /* ampersand */ + 60 => 'lt', /* less-than sign */ + 62 => 'gt', /* greater-than sign */ + ); + + $chr = $matches[0]; + $ord = ord($chr); + + /** + * The following replaces characters undefined in HTML with the + * hex entity for the Unicode replacement character. + */ + if (($ord <= 0x1f && $chr != "\t" && $chr != "\n" && $chr != "\r") || ($ord >= 0x7f && $ord <= 0x9f)) { + return '�'; + } + + /** + * Check if the current character to escape has a name entity we should + * replace it with while grabbing the hex value of the character. + */ + if (strlen($chr) == 1) { + $hex = strtoupper(substr('00'.bin2hex($chr), -2)); + } else { + $chr = twig_convert_encoding($chr, 'UTF-16BE', 'UTF-8'); + $hex = strtoupper(substr('0000'.bin2hex($chr), -4)); + } + + $int = hexdec($hex); + if (array_key_exists($int, $entityMap)) { + return sprintf('&%s;', $entityMap[$int]); + } + + /** + * Per OWASP recommendations, we'll use hex entities for any other + * characters where a named entity does not exist. + */ + + return sprintf('&#x%s;', $hex); +} + +// add multibyte extensions if possible +if (function_exists('mb_get_info')) { + /** + * Returns the length of a variable. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param mixed $thing A variable + * + * @return integer The length of the value + */ + function twig_length_filter(Twig_Environment $env, $thing) + { + return is_scalar($thing) ? mb_strlen($thing, $env->getCharset()) : count($thing); + } + + /** + * Converts a string to uppercase. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param string $string A string + * + * @return string The uppercased string + */ + function twig_upper_filter(Twig_Environment $env, $string) + { + if (null !== ($charset = $env->getCharset())) { + return mb_strtoupper($string, $charset); + } + + return strtoupper($string); + } + + /** + * Converts a string to lowercase. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param string $string A string + * + * @return string The lowercased string + */ + function twig_lower_filter(Twig_Environment $env, $string) + { + if (null !== ($charset = $env->getCharset())) { + return mb_strtolower($string, $charset); + } + + return strtolower($string); + } + + /** + * Returns a titlecased string. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param string $string A string + * + * @return string The titlecased string + */ + function twig_title_string_filter(Twig_Environment $env, $string) + { + if (null !== ($charset = $env->getCharset())) { + return mb_convert_case($string, MB_CASE_TITLE, $charset); + } + + return ucwords(strtolower($string)); + } + + /** + * Returns a capitalized string. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param string $string A string + * + * @return string The capitalized string + */ + function twig_capitalize_string_filter(Twig_Environment $env, $string) + { + if (null !== ($charset = $env->getCharset())) { + return mb_strtoupper(mb_substr($string, 0, 1, $charset), $charset). + mb_strtolower(mb_substr($string, 1, mb_strlen($string, $charset), $charset), $charset); + } + + return ucfirst(strtolower($string)); + } +} +// and byte fallback +else { + /** + * Returns the length of a variable. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param mixed $thing A variable + * + * @return integer The length of the value + */ + function twig_length_filter(Twig_Environment $env, $thing) + { + return is_scalar($thing) ? strlen($thing) : count($thing); + } + + /** + * Returns a titlecased string. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param string $string A string + * + * @return string The titlecased string + */ + function twig_title_string_filter(Twig_Environment $env, $string) + { + return ucwords(strtolower($string)); + } + + /** + * Returns a capitalized string. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param string $string A string + * + * @return string The capitalized string + */ + function twig_capitalize_string_filter(Twig_Environment $env, $string) + { + return ucfirst(strtolower($string)); + } +} + +/* used internally */ +function twig_ensure_traversable($seq) +{ + if ($seq instanceof Traversable || is_array($seq)) { + return $seq; + } + + return array(); +} + +/** + * Checks if a variable is empty. + * + *
+ * {# evaluates to true if the foo variable is null, false, or the empty string #}
+ * {% if foo is empty %}
+ *     {# ... #}
+ * {% endif %}
+ * 
+ * + * @param mixed $value A variable + * + * @return Boolean true if the value is empty, false otherwise + */ +function twig_test_empty($value) +{ + if ($value instanceof Countable) { + return 0 == count($value); + } + + return '' === $value || false === $value || null === $value || array() === $value; +} + +/** + * Checks if a variable is traversable. + * + *
+ * {# evaluates to true if the foo variable is an array or a traversable object #}
+ * {% if foo is traversable %}
+ *     {# ... #}
+ * {% endif %}
+ * 
+ * + * @param mixed $value A variable + * + * @return Boolean true if the value is traversable + */ +function twig_test_iterable($value) +{ + return $value instanceof Traversable || is_array($value); +} + +/** + * Renders a template. + * + * @param string $template The template to render + * @param array $variables The variables to pass to the template + * @param Boolean $with_context Whether to pass the current context variables or not + * @param Boolean $ignore_missing Whether to ignore missing templates or not + * @param Boolean $sandboxed Whether to sandbox the template or not + * + * @return string The rendered template + */ +function twig_include(Twig_Environment $env, $context, $template, $variables = array(), $withContext = true, $ignoreMissing = false, $sandboxed = false) +{ + if ($withContext) { + $variables = array_merge($context, $variables); + } + + if ($isSandboxed = $sandboxed && $env->hasExtension('sandbox')) { + $sandbox = $env->getExtension('sandbox'); + if (!$alreadySandboxed = $sandbox->isSandboxed()) { + $sandbox->enableSandbox(); + } + } + + try { + return $env->resolveTemplate($template)->render($variables); + } catch (Twig_Error_Loader $e) { + if (!$ignoreMissing) { + throw $e; + } + } + + if ($isSandboxed && !$alreadySandboxed) { + $sandbox->disableSandbox(); + } +} + +/** + * Provides the ability to get constants from instances as well as class/global constants. + * + * @param string $constant The name of the constant + * @param null|object $object The object to get the constant from + * + * @return string + */ +function twig_constant($constant, $object = null) +{ + if (null !== $object) { + $constant = get_class($object).'::'.$constant; + } + + return constant($constant); +} + +/** + * Batches item. + * + * @param array $items An array of items + * @param integer $size The size of the batch + * @param string $fill A string to fill missing items + * + * @return array + */ +function twig_array_batch($items, $size, $fill = null) +{ + if ($items instanceof Traversable) { + $items = iterator_to_array($items, false); + } + + $size = ceil($size); + + $result = array_chunk($items, $size, true); + + if (null !== $fill) { + $last = count($result) - 1; + $result[$last] = array_merge( + $result[$last], + array_fill(0, $size - count($result[$last]), $fill) + ); + } + + return $result; +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Debug.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Debug.php new file mode 100644 index 0000000..e3a85bf --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Debug.php @@ -0,0 +1,71 @@ + $isDumpOutputHtmlSafe ? array('html') : array(), 'needs_context' => true, 'needs_environment' => true)), + ); + } + + /** + * Returns the name of the extension. + * + * @return string The extension name + */ + public function getName() + { + return 'debug'; + } +} + +function twig_var_dump(Twig_Environment $env, $context) +{ + if (!$env->isDebug()) { + return; + } + + ob_start(); + + $count = func_num_args(); + if (2 === $count) { + $vars = array(); + foreach ($context as $key => $value) { + if (!$value instanceof Twig_Template) { + $vars[$key] = $value; + } + } + + var_dump($vars); + } else { + for ($i = 2; $i < $count; $i++) { + var_dump(func_get_arg($i)); + } + } + + return ob_get_clean(); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Escaper.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Escaper.php new file mode 100644 index 0000000..c9a7f68 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Escaper.php @@ -0,0 +1,107 @@ +setDefaultStrategy($defaultStrategy); + } + + /** + * Returns the token parser instances to add to the existing list. + * + * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances + */ + public function getTokenParsers() + { + return array(new Twig_TokenParser_AutoEscape()); + } + + /** + * Returns the node visitor instances to add to the existing list. + * + * @return array An array of Twig_NodeVisitorInterface instances + */ + public function getNodeVisitors() + { + return array(new Twig_NodeVisitor_Escaper()); + } + + /** + * Returns a list of filters to add to the existing list. + * + * @return array An array of filters + */ + public function getFilters() + { + return array( + new Twig_SimpleFilter('raw', 'twig_raw_filter', array('is_safe' => array('all'))), + ); + } + + /** + * Sets the default strategy to use when not defined by the user. + * + * The strategy can be a valid PHP callback that takes the template + * "filename" as an argument and returns the strategy to use. + * + * @param mixed $defaultStrategy An escaping strategy + */ + public function setDefaultStrategy($defaultStrategy) + { + // for BC + if (true === $defaultStrategy) { + $defaultStrategy = 'html'; + } + + $this->defaultStrategy = $defaultStrategy; + } + + /** + * Gets the default strategy to use when not defined by the user. + * + * @param string $filename The template "filename" + * + * @return string The default strategy to use for the template + */ + public function getDefaultStrategy($filename) + { + // disable string callables to avoid calling a function named html or js, + // or any other upcoming escaping strategy + if (!is_string($this->defaultStrategy) && is_callable($this->defaultStrategy)) { + return call_user_func($this->defaultStrategy, $filename); + } + + return $this->defaultStrategy; + } + + /** + * Returns the name of the extension. + * + * @return string The extension name + */ + public function getName() + { + return 'escaper'; + } +} + +/** + * Marks a variable as being safe. + * + * @param string $string A PHP variable + */ +function twig_raw_filter($string) +{ + return $string; +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Optimizer.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Optimizer.php new file mode 100644 index 0000000..013fcb6 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Optimizer.php @@ -0,0 +1,35 @@ +optimizers = $optimizers; + } + + /** + * {@inheritdoc} + */ + public function getNodeVisitors() + { + return array(new Twig_NodeVisitor_Optimizer($this->optimizers)); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'optimizer'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Sandbox.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Sandbox.php new file mode 100644 index 0000000..bf76c11 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Sandbox.php @@ -0,0 +1,112 @@ +policy = $policy; + $this->sandboxedGlobally = $sandboxed; + } + + /** + * Returns the token parser instances to add to the existing list. + * + * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances + */ + public function getTokenParsers() + { + return array(new Twig_TokenParser_Sandbox()); + } + + /** + * Returns the node visitor instances to add to the existing list. + * + * @return array An array of Twig_NodeVisitorInterface instances + */ + public function getNodeVisitors() + { + return array(new Twig_NodeVisitor_Sandbox()); + } + + public function enableSandbox() + { + $this->sandboxed = true; + } + + public function disableSandbox() + { + $this->sandboxed = false; + } + + public function isSandboxed() + { + return $this->sandboxedGlobally || $this->sandboxed; + } + + public function isSandboxedGlobally() + { + return $this->sandboxedGlobally; + } + + public function setSecurityPolicy(Twig_Sandbox_SecurityPolicyInterface $policy) + { + $this->policy = $policy; + } + + public function getSecurityPolicy() + { + return $this->policy; + } + + public function checkSecurity($tags, $filters, $functions) + { + if ($this->isSandboxed()) { + $this->policy->checkSecurity($tags, $filters, $functions); + } + } + + public function checkMethodAllowed($obj, $method) + { + if ($this->isSandboxed()) { + $this->policy->checkMethodAllowed($obj, $method); + } + } + + public function checkPropertyAllowed($obj, $method) + { + if ($this->isSandboxed()) { + $this->policy->checkPropertyAllowed($obj, $method); + } + } + + public function ensureToStringAllowed($obj) + { + if (is_object($obj)) { + $this->policy->checkMethodAllowed($obj, '__toString'); + } + + return $obj; + } + + /** + * Returns the name of the extension. + * + * @return string The extension name + */ + public function getName() + { + return 'sandbox'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Staging.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Staging.php new file mode 100644 index 0000000..8ab0f45 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/Staging.php @@ -0,0 +1,113 @@ + + */ +class Twig_Extension_Staging extends Twig_Extension +{ + protected $functions = array(); + protected $filters = array(); + protected $visitors = array(); + protected $tokenParsers = array(); + protected $globals = array(); + protected $tests = array(); + + public function addFunction($name, $function) + { + $this->functions[$name] = $function; + } + + /** + * {@inheritdoc} + */ + public function getFunctions() + { + return $this->functions; + } + + public function addFilter($name, $filter) + { + $this->filters[$name] = $filter; + } + + /** + * {@inheritdoc} + */ + public function getFilters() + { + return $this->filters; + } + + public function addNodeVisitor(Twig_NodeVisitorInterface $visitor) + { + $this->visitors[] = $visitor; + } + + /** + * {@inheritdoc} + */ + public function getNodeVisitors() + { + return $this->visitors; + } + + public function addTokenParser(Twig_TokenParserInterface $parser) + { + $this->tokenParsers[] = $parser; + } + + /** + * {@inheritdoc} + */ + public function getTokenParsers() + { + return $this->tokenParsers; + } + + public function addGlobal($name, $value) + { + $this->globals[$name] = $value; + } + + /** + * {@inheritdoc} + */ + public function getGlobals() + { + return $this->globals; + } + + public function addTest($name, $test) + { + $this->tests[$name] = $test; + } + + /** + * {@inheritdoc} + */ + public function getTests() + { + return $this->tests; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'staging'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/StringLoader.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/StringLoader.php new file mode 100644 index 0000000..20f3f99 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Extension/StringLoader.php @@ -0,0 +1,64 @@ + true)), + ); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'string_loader'; + } +} + +/** + * Loads a template from a string. + * + *
+ * {{ include(template_from_string("Hello {{ name }}")) }}
+ * 
+ * + * @param Twig_Environment $env A Twig_Environment instance + * @param string $template A template as a string + * + * @return Twig_Template A Twig_Template instance + */ +function twig_template_from_string(Twig_Environment $env, $template) +{ + static $loader; + + if (null === $loader) { + $loader = new Twig_Loader_String(); + } + + $current = $env->getLoader(); + $env->setLoader($loader); + try { + $template = $env->loadTemplate($template); + } catch (Exception $e) { + $env->setLoader($current); + + throw $e; + } + $env->setLoader($current); + + return $template; +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/ExtensionInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/ExtensionInterface.php new file mode 100644 index 0000000..f189e9d --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/ExtensionInterface.php @@ -0,0 +1,83 @@ + + */ +interface Twig_ExtensionInterface +{ + /** + * Initializes the runtime environment. + * + * This is where you can load some file that contains filter functions for instance. + * + * @param Twig_Environment $environment The current Twig_Environment instance + */ + public function initRuntime(Twig_Environment $environment); + + /** + * Returns the token parser instances to add to the existing list. + * + * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances + */ + public function getTokenParsers(); + + /** + * Returns the node visitor instances to add to the existing list. + * + * @return array An array of Twig_NodeVisitorInterface instances + */ + public function getNodeVisitors(); + + /** + * Returns a list of filters to add to the existing list. + * + * @return array An array of filters + */ + public function getFilters(); + + /** + * Returns a list of tests to add to the existing list. + * + * @return array An array of tests + */ + public function getTests(); + + /** + * Returns a list of functions to add to the existing list. + * + * @return array An array of functions + */ + public function getFunctions(); + + /** + * Returns a list of operators to add to the existing list. + * + * @return array An array of operators + */ + public function getOperators(); + + /** + * Returns a list of global variables to add to the existing list. + * + * @return array An array of global variables + */ + public function getGlobals(); + + /** + * Returns the name of the extension. + * + * @return string The extension name + */ + public function getName(); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Filter.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Filter.php new file mode 100644 index 0000000..5cfbb66 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Filter.php @@ -0,0 +1,81 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +abstract class Twig_Filter implements Twig_FilterInterface, Twig_FilterCallableInterface +{ + protected $options; + protected $arguments = array(); + + public function __construct(array $options = array()) + { + $this->options = array_merge(array( + 'needs_environment' => false, + 'needs_context' => false, + 'pre_escape' => null, + 'preserves_safety' => null, + 'callable' => null, + ), $options); + } + + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + + public function needsEnvironment() + { + return $this->options['needs_environment']; + } + + public function needsContext() + { + return $this->options['needs_context']; + } + + public function getSafe(Twig_Node $filterArgs) + { + if (isset($this->options['is_safe'])) { + return $this->options['is_safe']; + } + + if (isset($this->options['is_safe_callback'])) { + return call_user_func($this->options['is_safe_callback'], $filterArgs); + } + } + + public function getPreservesSafety() + { + return $this->options['preserves_safety']; + } + + public function getPreEscape() + { + return $this->options['pre_escape']; + } + + public function getCallable() + { + return $this->options['callable']; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Filter/Function.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Filter/Function.php new file mode 100644 index 0000000..ad374a5 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Filter/Function.php @@ -0,0 +1,37 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Filter_Function extends Twig_Filter +{ + protected $function; + + public function __construct($function, array $options = array()) + { + $options['callable'] = $function; + + parent::__construct($options); + + $this->function = $function; + } + + public function compile() + { + return $this->function; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Filter/Method.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Filter/Method.php new file mode 100644 index 0000000..63c8c3b --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Filter/Method.php @@ -0,0 +1,39 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Filter_Method extends Twig_Filter +{ + protected $extension; + protected $method; + + public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array()) + { + $options['callable'] = array($extension, $method); + + parent::__construct($options); + + $this->extension = $extension; + $this->method = $method; + } + + public function compile() + { + return sprintf('$this->env->getExtension(\'%s\')->%s', $this->extension->getName(), $this->method); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Filter/Node.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Filter/Node.php new file mode 100644 index 0000000..8744c5e --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Filter/Node.php @@ -0,0 +1,39 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Filter_Node extends Twig_Filter +{ + protected $class; + + public function __construct($class, array $options = array()) + { + parent::__construct($options); + + $this->class = $class; + } + + public function getClass() + { + return $this->class; + } + + public function compile() + { + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/FilterCallableInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/FilterCallableInterface.php new file mode 100644 index 0000000..145534d --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/FilterCallableInterface.php @@ -0,0 +1,23 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_FilterCallableInterface +{ + public function getCallable(); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/FilterInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/FilterInterface.php new file mode 100644 index 0000000..5319ecc --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/FilterInterface.php @@ -0,0 +1,42 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_FilterInterface +{ + /** + * Compiles a filter. + * + * @return string The PHP code for the filter + */ + public function compile(); + + public function needsEnvironment(); + + public function needsContext(); + + public function getSafe(Twig_Node $filterArgs); + + public function getPreservesSafety(); + + public function getPreEscape(); + + public function setArguments($arguments); + + public function getArguments(); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Function.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Function.php new file mode 100644 index 0000000..b5ffb2b --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Function.php @@ -0,0 +1,71 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +abstract class Twig_Function implements Twig_FunctionInterface, Twig_FunctionCallableInterface +{ + protected $options; + protected $arguments = array(); + + public function __construct(array $options = array()) + { + $this->options = array_merge(array( + 'needs_environment' => false, + 'needs_context' => false, + 'callable' => null, + ), $options); + } + + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + + public function needsEnvironment() + { + return $this->options['needs_environment']; + } + + public function needsContext() + { + return $this->options['needs_context']; + } + + public function getSafe(Twig_Node $functionArgs) + { + if (isset($this->options['is_safe'])) { + return $this->options['is_safe']; + } + + if (isset($this->options['is_safe_callback'])) { + return call_user_func($this->options['is_safe_callback'], $functionArgs); + } + + return array(); + } + + public function getCallable() + { + return $this->options['callable']; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Function/Function.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Function/Function.php new file mode 100644 index 0000000..d1e1b96 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Function/Function.php @@ -0,0 +1,38 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Function_Function extends Twig_Function +{ + protected $function; + + public function __construct($function, array $options = array()) + { + $options['callable'] = $function; + + parent::__construct($options); + + $this->function = $function; + } + + public function compile() + { + return $this->function; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Function/Method.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Function/Method.php new file mode 100644 index 0000000..67039a9 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Function/Method.php @@ -0,0 +1,40 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Function_Method extends Twig_Function +{ + protected $extension; + protected $method; + + public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array()) + { + $options['callable'] = array($extension, $method); + + parent::__construct($options); + + $this->extension = $extension; + $this->method = $method; + } + + public function compile() + { + return sprintf('$this->env->getExtension(\'%s\')->%s', $this->extension->getName(), $this->method); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Function/Node.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Function/Node.php new file mode 100644 index 0000000..06a0d0d --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Function/Node.php @@ -0,0 +1,39 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Function_Node extends Twig_Function +{ + protected $class; + + public function __construct($class, array $options = array()) + { + parent::__construct($options); + + $this->class = $class; + } + + public function getClass() + { + return $this->class; + } + + public function compile() + { + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/FunctionCallableInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/FunctionCallableInterface.php new file mode 100644 index 0000000..0aab4f5 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/FunctionCallableInterface.php @@ -0,0 +1,23 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_FunctionCallableInterface +{ + public function getCallable(); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/FunctionInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/FunctionInterface.php new file mode 100644 index 0000000..67f4f89 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/FunctionInterface.php @@ -0,0 +1,39 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_FunctionInterface +{ + /** + * Compiles a function. + * + * @return string The PHP code for the function + */ + public function compile(); + + public function needsEnvironment(); + + public function needsContext(); + + public function getSafe(Twig_Node $filterArgs); + + public function setArguments($arguments); + + public function getArguments(); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Lexer.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Lexer.php new file mode 100644 index 0000000..000b038 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Lexer.php @@ -0,0 +1,408 @@ + + */ +class Twig_Lexer implements Twig_LexerInterface +{ + protected $tokens; + protected $code; + protected $cursor; + protected $lineno; + protected $end; + protected $state; + protected $states; + protected $brackets; + protected $env; + protected $filename; + protected $options; + protected $regexes; + protected $position; + protected $positions; + protected $currentVarBlockLine; + + const STATE_DATA = 0; + const STATE_BLOCK = 1; + const STATE_VAR = 2; + const STATE_STRING = 3; + const STATE_INTERPOLATION = 4; + + const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'; + const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?/A'; + const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'; + const REGEX_DQ_STRING_DELIM = '/"/A'; + const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As'; + const PUNCTUATION = '()[]{}?:.,|'; + + public function __construct(Twig_Environment $env, array $options = array()) + { + $this->env = $env; + + $this->options = array_merge(array( + 'tag_comment' => array('{#', '#}'), + 'tag_block' => array('{%', '%}'), + 'tag_variable' => array('{{', '}}'), + 'whitespace_trim' => '-', + 'interpolation' => array('#{', '}'), + ), $options); + + $this->regexes = array( + 'lex_var' => '/\s*'.preg_quote($this->options['whitespace_trim'].$this->options['tag_variable'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_variable'][1], '/').'/A', + 'lex_block' => '/\s*(?:'.preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_block'][1], '/').')\n?/A', + 'lex_raw_data' => '/('.preg_quote($this->options['tag_block'][0].$this->options['whitespace_trim'], '/').'|'.preg_quote($this->options['tag_block'][0], '/').')\s*(?:end%s)\s*(?:'.preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_block'][1], '/').')/s', + 'operator' => $this->getOperatorRegex(), + 'lex_comment' => '/(?:'.preg_quote($this->options['whitespace_trim'], '/').preg_quote($this->options['tag_comment'][1], '/').'\s*|'.preg_quote($this->options['tag_comment'][1], '/').')\n?/s', + 'lex_block_raw' => '/\s*(raw|verbatim)\s*(?:'.preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_block'][1], '/').')/As', + 'lex_block_line' => '/\s*line\s+(\d+)\s*'.preg_quote($this->options['tag_block'][1], '/').'/As', + 'lex_tokens_start' => '/('.preg_quote($this->options['tag_variable'][0], '/').'|'.preg_quote($this->options['tag_block'][0], '/').'|'.preg_quote($this->options['tag_comment'][0], '/').')('.preg_quote($this->options['whitespace_trim'], '/').')?/s', + 'interpolation_start' => '/'.preg_quote($this->options['interpolation'][0], '/').'\s*/A', + 'interpolation_end' => '/\s*'.preg_quote($this->options['interpolation'][1], '/').'/A', + ); + } + + /** + * Tokenizes a source code. + * + * @param string $code The source code + * @param string $filename A unique identifier for the source code + * + * @return Twig_TokenStream A token stream instance + */ + public function tokenize($code, $filename = null) + { + if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('ASCII'); + } + + $this->code = str_replace(array("\r\n", "\r"), "\n", $code); + $this->filename = $filename; + $this->cursor = 0; + $this->lineno = 1; + $this->end = strlen($this->code); + $this->tokens = array(); + $this->state = self::STATE_DATA; + $this->states = array(); + $this->brackets = array(); + $this->position = -1; + + // find all token starts in one go + preg_match_all($this->regexes['lex_tokens_start'], $this->code, $matches, PREG_OFFSET_CAPTURE); + $this->positions = $matches; + + while ($this->cursor < $this->end) { + // dispatch to the lexing functions depending + // on the current state + switch ($this->state) { + case self::STATE_DATA: + $this->lexData(); + break; + + case self::STATE_BLOCK: + $this->lexBlock(); + break; + + case self::STATE_VAR: + $this->lexVar(); + break; + + case self::STATE_STRING: + $this->lexString(); + break; + + case self::STATE_INTERPOLATION: + $this->lexInterpolation(); + break; + } + } + + $this->pushToken(Twig_Token::EOF_TYPE); + + if (!empty($this->brackets)) { + list($expect, $lineno) = array_pop($this->brackets); + throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $expect), $lineno, $this->filename); + } + + if (isset($mbEncoding)) { + mb_internal_encoding($mbEncoding); + } + + return new Twig_TokenStream($this->tokens, $this->filename); + } + + protected function lexData() + { + // if no matches are left we return the rest of the template as simple text token + if ($this->position == count($this->positions[0]) - 1) { + $this->pushToken(Twig_Token::TEXT_TYPE, substr($this->code, $this->cursor)); + $this->cursor = $this->end; + + return; + } + + // Find the first token after the current cursor + $position = $this->positions[0][++$this->position]; + while ($position[1] < $this->cursor) { + if ($this->position == count($this->positions[0]) - 1) { + return; + } + $position = $this->positions[0][++$this->position]; + } + + // push the template text first + $text = $textContent = substr($this->code, $this->cursor, $position[1] - $this->cursor); + if (isset($this->positions[2][$this->position][0])) { + $text = rtrim($text); + } + $this->pushToken(Twig_Token::TEXT_TYPE, $text); + $this->moveCursor($textContent.$position[0]); + + switch ($this->positions[1][$this->position][0]) { + case $this->options['tag_comment'][0]: + $this->lexComment(); + break; + + case $this->options['tag_block'][0]: + // raw data? + if (preg_match($this->regexes['lex_block_raw'], $this->code, $match, null, $this->cursor)) { + $this->moveCursor($match[0]); + $this->lexRawData($match[1]); + // {% line \d+ %} + } elseif (preg_match($this->regexes['lex_block_line'], $this->code, $match, null, $this->cursor)) { + $this->moveCursor($match[0]); + $this->lineno = (int) $match[1]; + } else { + $this->pushToken(Twig_Token::BLOCK_START_TYPE); + $this->pushState(self::STATE_BLOCK); + $this->currentVarBlockLine = $this->lineno; + } + break; + + case $this->options['tag_variable'][0]: + $this->pushToken(Twig_Token::VAR_START_TYPE); + $this->pushState(self::STATE_VAR); + $this->currentVarBlockLine = $this->lineno; + break; + } + } + + protected function lexBlock() + { + if (empty($this->brackets) && preg_match($this->regexes['lex_block'], $this->code, $match, null, $this->cursor)) { + $this->pushToken(Twig_Token::BLOCK_END_TYPE); + $this->moveCursor($match[0]); + $this->popState(); + } else { + $this->lexExpression(); + } + } + + protected function lexVar() + { + if (empty($this->brackets) && preg_match($this->regexes['lex_var'], $this->code, $match, null, $this->cursor)) { + $this->pushToken(Twig_Token::VAR_END_TYPE); + $this->moveCursor($match[0]); + $this->popState(); + } else { + $this->lexExpression(); + } + } + + protected function lexExpression() + { + // whitespace + if (preg_match('/\s+/A', $this->code, $match, null, $this->cursor)) { + $this->moveCursor($match[0]); + + if ($this->cursor >= $this->end) { + throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $this->state === self::STATE_BLOCK ? 'block' : 'variable'), $this->currentVarBlockLine, $this->filename); + } + } + + // operators + if (preg_match($this->regexes['operator'], $this->code, $match, null, $this->cursor)) { + $this->pushToken(Twig_Token::OPERATOR_TYPE, $match[0]); + $this->moveCursor($match[0]); + } + // names + elseif (preg_match(self::REGEX_NAME, $this->code, $match, null, $this->cursor)) { + $this->pushToken(Twig_Token::NAME_TYPE, $match[0]); + $this->moveCursor($match[0]); + } + // numbers + elseif (preg_match(self::REGEX_NUMBER, $this->code, $match, null, $this->cursor)) { + $number = (float) $match[0]; // floats + if (ctype_digit($match[0]) && $number <= PHP_INT_MAX) { + $number = (int) $match[0]; // integers lower than the maximum + } + $this->pushToken(Twig_Token::NUMBER_TYPE, $number); + $this->moveCursor($match[0]); + } + // punctuation + elseif (false !== strpos(self::PUNCTUATION, $this->code[$this->cursor])) { + // opening bracket + if (false !== strpos('([{', $this->code[$this->cursor])) { + $this->brackets[] = array($this->code[$this->cursor], $this->lineno); + } + // closing bracket + elseif (false !== strpos(')]}', $this->code[$this->cursor])) { + if (empty($this->brackets)) { + throw new Twig_Error_Syntax(sprintf('Unexpected "%s"', $this->code[$this->cursor]), $this->lineno, $this->filename); + } + + list($expect, $lineno) = array_pop($this->brackets); + if ($this->code[$this->cursor] != strtr($expect, '([{', ')]}')) { + throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $expect), $lineno, $this->filename); + } + } + + $this->pushToken(Twig_Token::PUNCTUATION_TYPE, $this->code[$this->cursor]); + ++$this->cursor; + } + // strings + elseif (preg_match(self::REGEX_STRING, $this->code, $match, null, $this->cursor)) { + $this->pushToken(Twig_Token::STRING_TYPE, stripcslashes(substr($match[0], 1, -1))); + $this->moveCursor($match[0]); + } + // opening double quoted string + elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) { + $this->brackets[] = array('"', $this->lineno); + $this->pushState(self::STATE_STRING); + $this->moveCursor($match[0]); + } + // unlexable + else { + throw new Twig_Error_Syntax(sprintf('Unexpected character "%s"', $this->code[$this->cursor]), $this->lineno, $this->filename); + } + } + + protected function lexRawData($tag) + { + if (!preg_match(str_replace('%s', $tag, $this->regexes['lex_raw_data']), $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { + throw new Twig_Error_Syntax(sprintf('Unexpected end of file: Unclosed "%s" block', $tag), $this->lineno, $this->filename); + } + + $text = substr($this->code, $this->cursor, $match[0][1] - $this->cursor); + $this->moveCursor($text.$match[0][0]); + + if (false !== strpos($match[1][0], $this->options['whitespace_trim'])) { + $text = rtrim($text); + } + + $this->pushToken(Twig_Token::TEXT_TYPE, $text); + } + + protected function lexComment() + { + if (!preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { + throw new Twig_Error_Syntax('Unclosed comment', $this->lineno, $this->filename); + } + + $this->moveCursor(substr($this->code, $this->cursor, $match[0][1] - $this->cursor).$match[0][0]); + } + + protected function lexString() + { + if (preg_match($this->regexes['interpolation_start'], $this->code, $match, null, $this->cursor)) { + $this->brackets[] = array($this->options['interpolation'][0], $this->lineno); + $this->pushToken(Twig_Token::INTERPOLATION_START_TYPE); + $this->moveCursor($match[0]); + $this->pushState(self::STATE_INTERPOLATION); + + } elseif (preg_match(self::REGEX_DQ_STRING_PART, $this->code, $match, null, $this->cursor) && strlen($match[0]) > 0) { + $this->pushToken(Twig_Token::STRING_TYPE, stripcslashes($match[0])); + $this->moveCursor($match[0]); + + } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) { + + list($expect, $lineno) = array_pop($this->brackets); + if ($this->code[$this->cursor] != '"') { + throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $expect), $lineno, $this->filename); + } + + $this->popState(); + ++$this->cursor; + } + } + + protected function lexInterpolation() + { + $bracket = end($this->brackets); + if ($this->options['interpolation'][0] === $bracket[0] && preg_match($this->regexes['interpolation_end'], $this->code, $match, null, $this->cursor)) { + array_pop($this->brackets); + $this->pushToken(Twig_Token::INTERPOLATION_END_TYPE); + $this->moveCursor($match[0]); + $this->popState(); + } else { + $this->lexExpression(); + } + } + + protected function pushToken($type, $value = '') + { + // do not push empty text tokens + if (Twig_Token::TEXT_TYPE === $type && '' === $value) { + return; + } + + $this->tokens[] = new Twig_Token($type, $value, $this->lineno); + } + + protected function moveCursor($text) + { + $this->cursor += strlen($text); + $this->lineno += substr_count($text, "\n"); + } + + protected function getOperatorRegex() + { + $operators = array_merge( + array('='), + array_keys($this->env->getUnaryOperators()), + array_keys($this->env->getBinaryOperators()) + ); + + $operators = array_combine($operators, array_map('strlen', $operators)); + arsort($operators); + + $regex = array(); + foreach ($operators as $operator => $length) { + // an operator that ends with a character must be followed by + // a whitespace or a parenthesis + if (ctype_alpha($operator[$length - 1])) { + $regex[] = preg_quote($operator, '/').'(?=[\s()])'; + } else { + $regex[] = preg_quote($operator, '/'); + } + } + + return '/'.implode('|', $regex).'/A'; + } + + protected function pushState($state) + { + $this->states[] = $this->state; + $this->state = $state; + } + + protected function popState() + { + if (0 === count($this->states)) { + throw new Exception('Cannot pop state without a previous state'); + } + + $this->state = array_pop($this->states); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/LexerInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/LexerInterface.php new file mode 100644 index 0000000..4b83f81 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/LexerInterface.php @@ -0,0 +1,29 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_LexerInterface +{ + /** + * Tokenizes a source code. + * + * @param string $code The source code + * @param string $filename A unique identifier for the source code + * + * @return Twig_TokenStream A token stream instance + */ + public function tokenize($code, $filename = null); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Loader/Array.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Loader/Array.php new file mode 100644 index 0000000..89087ae --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Loader/Array.php @@ -0,0 +1,98 @@ + + */ +class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterface +{ + protected $templates; + + /** + * Constructor. + * + * @param array $templates An array of templates (keys are the names, and values are the source code) + * + * @see Twig_Loader + */ + public function __construct(array $templates) + { + $this->templates = array(); + foreach ($templates as $name => $template) { + $this->templates[$name] = $template; + } + } + + /** + * Adds or overrides a template. + * + * @param string $name The template name + * @param string $template The template source + */ + public function setTemplate($name, $template) + { + $this->templates[(string) $name] = $template; + } + + /** + * {@inheritdoc} + */ + public function getSource($name) + { + $name = (string) $name; + if (!isset($this->templates[$name])) { + throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); + } + + return $this->templates[$name]; + } + + /** + * {@inheritdoc} + */ + public function exists($name) + { + return isset($this->templates[(string) $name]); + } + + /** + * {@inheritdoc} + */ + public function getCacheKey($name) + { + $name = (string) $name; + if (!isset($this->templates[$name])) { + throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); + } + + return $this->templates[$name]; + } + + /** + * {@inheritdoc} + */ + public function isFresh($name, $time) + { + $name = (string) $name; + if (!isset($this->templates[$name])) { + throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); + } + + return true; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Loader/Chain.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Loader/Chain.php new file mode 100644 index 0000000..1f1cf06 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Loader/Chain.php @@ -0,0 +1,139 @@ + + */ +class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterface +{ + private $hasSourceCache = array(); + protected $loaders; + + /** + * Constructor. + * + * @param Twig_LoaderInterface[] $loaders An array of loader instances + */ + public function __construct(array $loaders = array()) + { + $this->loaders = array(); + foreach ($loaders as $loader) { + $this->addLoader($loader); + } + } + + /** + * Adds a loader instance. + * + * @param Twig_LoaderInterface $loader A Loader instance + */ + public function addLoader(Twig_LoaderInterface $loader) + { + $this->loaders[] = $loader; + $this->hasSourceCache = array(); + } + + /** + * {@inheritdoc} + */ + public function getSource($name) + { + $exceptions = array(); + foreach ($this->loaders as $loader) { + if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) { + continue; + } + + try { + return $loader->getSource($name); + } catch (Twig_Error_Loader $e) { + $exceptions[] = $e->getMessage(); + } + } + + throw new Twig_Error_Loader(sprintf('Template "%s" is not defined (%s).', $name, implode(', ', $exceptions))); + } + + /** + * {@inheritdoc} + */ + public function exists($name) + { + $name = (string) $name; + + if (isset($this->hasSourceCache[$name])) { + return $this->hasSourceCache[$name]; + } + + foreach ($this->loaders as $loader) { + if ($loader instanceof Twig_ExistsLoaderInterface) { + if ($loader->exists($name)) { + return $this->hasSourceCache[$name] = true; + } + + continue; + } + + try { + $loader->getSource($name); + + return $this->hasSourceCache[$name] = true; + } catch (Twig_Error_Loader $e) { + } + } + + return $this->hasSourceCache[$name] = false; + } + + /** + * {@inheritdoc} + */ + public function getCacheKey($name) + { + $exceptions = array(); + foreach ($this->loaders as $loader) { + if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) { + continue; + } + + try { + return $loader->getCacheKey($name); + } catch (Twig_Error_Loader $e) { + $exceptions[] = get_class($loader).': '.$e->getMessage(); + } + } + + throw new Twig_Error_Loader(sprintf('Template "%s" is not defined (%s).', $name, implode(' ', $exceptions))); + } + + /** + * {@inheritdoc} + */ + public function isFresh($name, $time) + { + $exceptions = array(); + foreach ($this->loaders as $loader) { + if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) { + continue; + } + + try { + return $loader->isFresh($name, $time); + } catch (Twig_Error_Loader $e) { + $exceptions[] = get_class($loader).': '.$e->getMessage(); + } + } + + throw new Twig_Error_Loader(sprintf('Template "%s" is not defined (%s).', $name, implode(' ', $exceptions))); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Loader/Filesystem.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Loader/Filesystem.php new file mode 100644 index 0000000..d47781a --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Loader/Filesystem.php @@ -0,0 +1,226 @@ + + */ +class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderInterface +{ + /** Identifier of the main namespace. */ + const MAIN_NAMESPACE = '__main__'; + + protected $paths; + protected $cache; + + /** + * Constructor. + * + * @param string|array $paths A path or an array of paths where to look for templates + */ + public function __construct($paths = array()) + { + if ($paths) { + $this->setPaths($paths); + } + } + + /** + * Returns the paths to the templates. + * + * @param string $namespace A path namespace + * + * @return array The array of paths where to look for templates + */ + public function getPaths($namespace = self::MAIN_NAMESPACE) + { + return isset($this->paths[$namespace]) ? $this->paths[$namespace] : array(); + } + + /** + * Returns the path namespaces. + * + * The main namespace is always defined. + * + * @return array The array of defined namespaces + */ + public function getNamespaces() + { + return array_keys($this->paths); + } + + /** + * Sets the paths where templates are stored. + * + * @param string|array $paths A path or an array of paths where to look for templates + * @param string $namespace A path namespace + */ + public function setPaths($paths, $namespace = self::MAIN_NAMESPACE) + { + if (!is_array($paths)) { + $paths = array($paths); + } + + $this->paths[$namespace] = array(); + foreach ($paths as $path) { + $this->addPath($path, $namespace); + } + } + + /** + * Adds a path where templates are stored. + * + * @param string $path A path where to look for templates + * @param string $namespace A path name + * + * @throws Twig_Error_Loader + */ + public function addPath($path, $namespace = self::MAIN_NAMESPACE) + { + // invalidate the cache + $this->cache = array(); + + if (!is_dir($path)) { + throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path)); + } + + $this->paths[$namespace][] = rtrim($path, '/\\'); + } + + /** + * Prepends a path where templates are stored. + * + * @param string $path A path where to look for templates + * @param string $namespace A path name + * + * @throws Twig_Error_Loader + */ + public function prependPath($path, $namespace = self::MAIN_NAMESPACE) + { + // invalidate the cache + $this->cache = array(); + + if (!is_dir($path)) { + throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path)); + } + + $path = rtrim($path, '/\\'); + + if (!isset($this->paths[$namespace])) { + $this->paths[$namespace][] = $path; + } else { + array_unshift($this->paths[$namespace], $path); + } + } + + /** + * {@inheritdoc} + */ + public function getSource($name) + { + return file_get_contents($this->findTemplate($name)); + } + + /** + * {@inheritdoc} + */ + public function getCacheKey($name) + { + return $this->findTemplate($name); + } + + /** + * {@inheritdoc} + */ + public function exists($name) + { + $name = (string) $name; + if (isset($this->cache[$name])) { + return true; + } + + try { + $this->findTemplate($name); + + return true; + } catch (Twig_Error_Loader $exception) { + return false; + } + } + + /** + * {@inheritdoc} + */ + public function isFresh($name, $time) + { + return filemtime($this->findTemplate($name)) <= $time; + } + + protected function findTemplate($name) + { + $name = (string) $name; + + // normalize name + $name = preg_replace('#/{2,}#', '/', strtr($name, '\\', '/')); + + if (isset($this->cache[$name])) { + return $this->cache[$name]; + } + + $this->validateName($name); + + $namespace = self::MAIN_NAMESPACE; + if (isset($name[0]) && '@' == $name[0]) { + if (false === $pos = strpos($name, '/')) { + throw new Twig_Error_Loader(sprintf('Malformed namespaced template name "%s" (expecting "@namespace/template_name").', $name)); + } + + $namespace = substr($name, 1, $pos - 1); + + $name = substr($name, $pos + 1); + } + + if (!isset($this->paths[$namespace])) { + throw new Twig_Error_Loader(sprintf('There are no registered paths for namespace "%s".', $namespace)); + } + + foreach ($this->paths[$namespace] as $path) { + if (is_file($path.'/'.$name)) { + return $this->cache[$name] = $path.'/'.$name; + } + } + + throw new Twig_Error_Loader(sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths[$namespace]))); + } + + protected function validateName($name) + { + if (false !== strpos($name, "\0")) { + throw new Twig_Error_Loader('A template name cannot contain NUL bytes.'); + } + + $name = ltrim($name, '/'); + $parts = explode('/', $name); + $level = 0; + foreach ($parts as $part) { + if ('..' === $part) { + --$level; + } elseif ('.' !== $part) { + ++$level; + } + + if ($level < 0) { + throw new Twig_Error_Loader(sprintf('Looks like you try to load a template outside configured directories (%s).', $name)); + } + } + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Loader/String.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Loader/String.php new file mode 100644 index 0000000..8ad9856 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Loader/String.php @@ -0,0 +1,59 @@ + + */ +class Twig_Loader_String implements Twig_LoaderInterface, Twig_ExistsLoaderInterface +{ + /** + * {@inheritdoc} + */ + public function getSource($name) + { + return $name; + } + + /** + * {@inheritdoc} + */ + public function exists($name) + { + return true; + } + + /** + * {@inheritdoc} + */ + public function getCacheKey($name) + { + return $name; + } + + /** + * {@inheritdoc} + */ + public function isFresh($name, $time) + { + return true; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/LoaderInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/LoaderInterface.php new file mode 100644 index 0000000..927786d --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/LoaderInterface.php @@ -0,0 +1,52 @@ + + */ +interface Twig_LoaderInterface +{ + /** + * Gets the source code of a template, given its name. + * + * @param string $name The name of the template to load + * + * @return string The template source code + * + * @throws Twig_Error_Loader When $name is not found + */ + public function getSource($name); + + /** + * Gets the cache key to use for the cache for a given template name. + * + * @param string $name The name of the template to load + * + * @return string The cache key + * + * @throws Twig_Error_Loader When $name is not found + */ + public function getCacheKey($name); + + /** + * Returns true if the template is still fresh. + * + * @param string $name The template name + * @param timestamp $time The last modification time of the cached template + * + * @return Boolean true if the template is fresh, false otherwise + * + * @throws Twig_Error_Loader When $name is not found + */ + public function isFresh($name, $time); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Markup.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Markup.php new file mode 100644 index 0000000..69871fc --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Markup.php @@ -0,0 +1,37 @@ + + */ +class Twig_Markup implements Countable +{ + protected $content; + protected $charset; + + public function __construct($content, $charset) + { + $this->content = (string) $content; + $this->charset = $charset; + } + + public function __toString() + { + return $this->content; + } + + public function count() + { + return function_exists('mb_get_info') ? mb_strlen($this->content, $this->charset) : strlen($this->content); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node.php new file mode 100644 index 0000000..931b463 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node.php @@ -0,0 +1,226 @@ + + */ +class Twig_Node implements Twig_NodeInterface +{ + protected $nodes; + protected $attributes; + protected $lineno; + protected $tag; + + /** + * Constructor. + * + * The nodes are automatically made available as properties ($this->node). + * The attributes are automatically made available as array items ($this['name']). + * + * @param array $nodes An array of named nodes + * @param array $attributes An array of attributes (should not be nodes) + * @param integer $lineno The line number + * @param string $tag The tag name associated with the Node + */ + public function __construct(array $nodes = array(), array $attributes = array(), $lineno = 0, $tag = null) + { + $this->nodes = $nodes; + $this->attributes = $attributes; + $this->lineno = $lineno; + $this->tag = $tag; + } + + public function __toString() + { + $attributes = array(); + foreach ($this->attributes as $name => $value) { + $attributes[] = sprintf('%s: %s', $name, str_replace("\n", '', var_export($value, true))); + } + + $repr = array(get_class($this).'('.implode(', ', $attributes)); + + if (count($this->nodes)) { + foreach ($this->nodes as $name => $node) { + $len = strlen($name) + 4; + $noderepr = array(); + foreach (explode("\n", (string) $node) as $line) { + $noderepr[] = str_repeat(' ', $len).$line; + } + + $repr[] = sprintf(' %s: %s', $name, ltrim(implode("\n", $noderepr))); + } + + $repr[] = ')'; + } else { + $repr[0] .= ')'; + } + + return implode("\n", $repr); + } + + public function toXml($asDom = false) + { + $dom = new DOMDocument('1.0', 'UTF-8'); + $dom->formatOutput = true; + $dom->appendChild($xml = $dom->createElement('twig')); + + $xml->appendChild($node = $dom->createElement('node')); + $node->setAttribute('class', get_class($this)); + + foreach ($this->attributes as $name => $value) { + $node->appendChild($attribute = $dom->createElement('attribute')); + $attribute->setAttribute('name', $name); + $attribute->appendChild($dom->createTextNode($value)); + } + + foreach ($this->nodes as $name => $n) { + if (null === $n) { + continue; + } + + $child = $n->toXml(true)->getElementsByTagName('node')->item(0); + $child = $dom->importNode($child, true); + $child->setAttribute('name', $name); + + $node->appendChild($child); + } + + return $asDom ? $dom : $dom->saveXml(); + } + + public function compile(Twig_Compiler $compiler) + { + foreach ($this->nodes as $node) { + $node->compile($compiler); + } + } + + public function getLine() + { + return $this->lineno; + } + + public function getNodeTag() + { + return $this->tag; + } + + /** + * Returns true if the attribute is defined. + * + * @param string The attribute name + * + * @return Boolean true if the attribute is defined, false otherwise + */ + public function hasAttribute($name) + { + return array_key_exists($name, $this->attributes); + } + + /** + * Gets an attribute. + * + * @param string The attribute name + * + * @return mixed The attribute value + */ + public function getAttribute($name) + { + if (!array_key_exists($name, $this->attributes)) { + throw new LogicException(sprintf('Attribute "%s" does not exist for Node "%s".', $name, get_class($this))); + } + + return $this->attributes[$name]; + } + + /** + * Sets an attribute. + * + * @param string The attribute name + * @param mixed The attribute value + */ + public function setAttribute($name, $value) + { + $this->attributes[$name] = $value; + } + + /** + * Removes an attribute. + * + * @param string The attribute name + */ + public function removeAttribute($name) + { + unset($this->attributes[$name]); + } + + /** + * Returns true if the node with the given identifier exists. + * + * @param string The node name + * + * @return Boolean true if the node with the given name exists, false otherwise + */ + public function hasNode($name) + { + return array_key_exists($name, $this->nodes); + } + + /** + * Gets a node by name. + * + * @param string The node name + * + * @return Twig_Node A Twig_Node instance + */ + public function getNode($name) + { + if (!array_key_exists($name, $this->nodes)) { + throw new LogicException(sprintf('Node "%s" does not exist for Node "%s".', $name, get_class($this))); + } + + return $this->nodes[$name]; + } + + /** + * Sets a node. + * + * @param string The node name + * @param Twig_Node A Twig_Node instance + */ + public function setNode($name, $node = null) + { + $this->nodes[$name] = $node; + } + + /** + * Removes a node by name. + * + * @param string The node name + */ + public function removeNode($name) + { + unset($this->nodes[$name]); + } + + public function count() + { + return count($this->nodes); + } + + public function getIterator() + { + return new ArrayIterator($this->nodes); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/AutoEscape.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/AutoEscape.php new file mode 100644 index 0000000..8f190e0 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/AutoEscape.php @@ -0,0 +1,39 @@ + + */ +class Twig_Node_AutoEscape extends Twig_Node +{ + public function __construct($value, Twig_NodeInterface $body, $lineno, $tag = 'autoescape') + { + parent::__construct(array('body' => $body), array('value' => $value), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler->subcompile($this->getNode('body')); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Block.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Block.php new file mode 100644 index 0000000..50eb67e --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Block.php @@ -0,0 +1,44 @@ + + */ +class Twig_Node_Block extends Twig_Node +{ + public function __construct($name, Twig_NodeInterface $body, $lineno, $tag = null) + { + parent::__construct(array('body' => $body), array('name' => $name), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write(sprintf("public function block_%s(\$context, array \$blocks = array())\n", $this->getAttribute('name')), "{\n") + ->indent() + ; + + $compiler + ->subcompile($this->getNode('body')) + ->outdent() + ->write("}\n\n") + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/BlockReference.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/BlockReference.php new file mode 100644 index 0000000..013e369 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/BlockReference.php @@ -0,0 +1,37 @@ + + */ +class Twig_Node_BlockReference extends Twig_Node implements Twig_NodeOutputInterface +{ + public function __construct($name, $lineno, $tag = null) + { + parent::__construct(array(), array('name' => $name), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write(sprintf("\$this->displayBlock('%s', \$context, \$blocks);\n", $this->getAttribute('name'))) + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Body.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Body.php new file mode 100644 index 0000000..3ffb134 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Body.php @@ -0,0 +1,19 @@ + + */ +class Twig_Node_Body extends Twig_Node +{ +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Do.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Do.php new file mode 100644 index 0000000..c528066 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Do.php @@ -0,0 +1,38 @@ + + */ +class Twig_Node_Do extends Twig_Node +{ + public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) + { + parent::__construct(array('expr' => $expr), array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('') + ->subcompile($this->getNode('expr')) + ->raw(";\n") + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Embed.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Embed.php new file mode 100644 index 0000000..4c9456d --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Embed.php @@ -0,0 +1,38 @@ + + */ +class Twig_Node_Embed extends Twig_Node_Include +{ + // we don't inject the module to avoid node visitors to traverse it twice (as it will be already visited in the main module) + public function __construct($filename, $index, Twig_Node_Expression $variables = null, $only = false, $ignoreMissing = false, $lineno, $tag = null) + { + parent::__construct(new Twig_Node_Expression_Constant('not_used', $lineno), $variables, $only, $ignoreMissing, $lineno, $tag); + + $this->setAttribute('filename', $filename); + $this->setAttribute('index', $index); + } + + protected function addGetTemplate(Twig_Compiler $compiler) + { + $compiler + ->write("\$this->env->loadTemplate(") + ->string($this->getAttribute('filename')) + ->raw(', ') + ->string($this->getAttribute('index')) + ->raw(")") + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression.php new file mode 100644 index 0000000..a7382e7 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression.php @@ -0,0 +1,20 @@ + + */ +abstract class Twig_Node_Expression extends Twig_Node +{ +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Array.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Array.php new file mode 100644 index 0000000..1da785f --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Array.php @@ -0,0 +1,86 @@ +index = -1; + foreach ($this->getKeyValuePairs() as $pair) { + if ($pair['key'] instanceof Twig_Node_Expression_Constant && ctype_digit((string) $pair['key']->getAttribute('value')) && $pair['key']->getAttribute('value') > $this->index) { + $this->index = $pair['key']->getAttribute('value'); + } + } + } + + public function getKeyValuePairs() + { + $pairs = array(); + + foreach (array_chunk($this->nodes, 2) as $pair) { + $pairs[] = array( + 'key' => $pair[0], + 'value' => $pair[1], + ); + } + + return $pairs; + } + + public function hasElement(Twig_Node_Expression $key) + { + foreach ($this->getKeyValuePairs() as $pair) { + // we compare the string representation of the keys + // to avoid comparing the line numbers which are not relevant here. + if ((string) $key == (string) $pair['key']) { + return true; + } + } + + return false; + } + + public function addElement(Twig_Node_Expression $value, Twig_Node_Expression $key = null) + { + if (null === $key) { + $key = new Twig_Node_Expression_Constant(++$this->index, $value->getLine()); + } + + array_push($this->nodes, $key, $value); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler->raw('array('); + $first = true; + foreach ($this->getKeyValuePairs() as $pair) { + if (!$first) { + $compiler->raw(', '); + } + $first = false; + + $compiler + ->subcompile($pair['key']) + ->raw(' => ') + ->subcompile($pair['value']) + ; + } + $compiler->raw(')'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php new file mode 100644 index 0000000..2ddea78 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php @@ -0,0 +1,28 @@ +raw('$context[') + ->string($this->getAttribute('name')) + ->raw(']') + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php new file mode 100644 index 0000000..9dd5de2 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php @@ -0,0 +1,40 @@ + $left, 'right' => $right), array(), $lineno); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('left')) + ->raw(' ') + ; + $this->operator($compiler); + $compiler + ->raw(' ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + abstract public function operator(Twig_Compiler $compiler); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php new file mode 100644 index 0000000..0ef8e11 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php @@ -0,0 +1,18 @@ +raw('+'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php new file mode 100644 index 0000000..d5752eb --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php @@ -0,0 +1,18 @@ +raw('&&'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php new file mode 100644 index 0000000..9a46d84 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php @@ -0,0 +1,18 @@ +raw('&'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php new file mode 100644 index 0000000..058a20b --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php @@ -0,0 +1,18 @@ +raw('|'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php new file mode 100644 index 0000000..f4da73d --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php @@ -0,0 +1,18 @@ +raw('^'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php new file mode 100644 index 0000000..f9a6462 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php @@ -0,0 +1,18 @@ +raw('.'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php new file mode 100644 index 0000000..e0797a6 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php @@ -0,0 +1,18 @@ +raw('/'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php new file mode 100644 index 0000000..7b1236d --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php @@ -0,0 +1,17 @@ +raw('=='); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php new file mode 100644 index 0000000..7fbd055 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php @@ -0,0 +1,29 @@ +raw('intval(floor('); + parent::compile($compiler); + $compiler->raw('))'); + } + + public function operator(Twig_Compiler $compiler) + { + return $compiler->raw('/'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php new file mode 100644 index 0000000..a110bd9 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php @@ -0,0 +1,17 @@ +raw('>'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php new file mode 100644 index 0000000..3754fed --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php @@ -0,0 +1,17 @@ +raw('>='); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php new file mode 100644 index 0000000..788f937 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php @@ -0,0 +1,33 @@ +raw('twig_in_filter(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + public function operator(Twig_Compiler $compiler) + { + return $compiler->raw('in'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php new file mode 100644 index 0000000..45fd300 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php @@ -0,0 +1,17 @@ +raw('<'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php new file mode 100644 index 0000000..e38e257 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php @@ -0,0 +1,17 @@ +raw('<='); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php new file mode 100644 index 0000000..9924114 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php @@ -0,0 +1,18 @@ +raw('%'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php new file mode 100644 index 0000000..c91529c --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php @@ -0,0 +1,18 @@ +raw('*'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php new file mode 100644 index 0000000..26867ba --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php @@ -0,0 +1,17 @@ +raw('!='); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php new file mode 100644 index 0000000..f347b7b --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php @@ -0,0 +1,33 @@ +raw('!twig_in_filter(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + public function operator(Twig_Compiler $compiler) + { + return $compiler->raw('not in'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php new file mode 100644 index 0000000..adba49c --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php @@ -0,0 +1,18 @@ +raw('||'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php new file mode 100644 index 0000000..b2c5904 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php @@ -0,0 +1,33 @@ +raw('pow(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + public function operator(Twig_Compiler $compiler) + { + return $compiler->raw('**'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php new file mode 100644 index 0000000..bea4f2a --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php @@ -0,0 +1,33 @@ +raw('range(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + public function operator(Twig_Compiler $compiler) + { + return $compiler->raw('..'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php new file mode 100644 index 0000000..d446399 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php @@ -0,0 +1,18 @@ +raw('-'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php new file mode 100644 index 0000000..647196e --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php @@ -0,0 +1,51 @@ + + */ +class Twig_Node_Expression_BlockReference extends Twig_Node_Expression +{ + public function __construct(Twig_NodeInterface $name, $asString = false, $lineno, $tag = null) + { + parent::__construct(array('name' => $name), array('as_string' => $asString, 'output' => false), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + if ($this->getAttribute('as_string')) { + $compiler->raw('(string) '); + } + + if ($this->getAttribute('output')) { + $compiler + ->addDebugInfo($this) + ->write("\$this->displayBlock(") + ->subcompile($this->getNode('name')) + ->raw(", \$context, \$blocks);\n") + ; + } else { + $compiler + ->raw("\$this->renderBlock(") + ->subcompile($this->getNode('name')) + ->raw(", \$context, \$blocks)") + ; + } + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Call.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Call.php new file mode 100644 index 0000000..dba9b0e --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Call.php @@ -0,0 +1,178 @@ +getAttribute('callable'); + + $closingParenthesis = false; + if ($callable) { + if (is_string($callable)) { + $compiler->raw($callable); + } elseif (is_array($callable) && $callable[0] instanceof Twig_ExtensionInterface) { + $compiler->raw(sprintf('$this->env->getExtension(\'%s\')->%s', $callable[0]->getName(), $callable[1])); + } else { + $type = ucfirst($this->getAttribute('type')); + $compiler->raw(sprintf('call_user_func_array($this->env->get%s(\'%s\')->getCallable(), array', $type, $this->getAttribute('name'))); + $closingParenthesis = true; + } + } else { + $compiler->raw($this->getAttribute('thing')->compile()); + } + + $this->compileArguments($compiler); + + if ($closingParenthesis) { + $compiler->raw(')'); + } + } + + protected function compileArguments(Twig_Compiler $compiler) + { + $compiler->raw('('); + + $first = true; + + if ($this->hasAttribute('needs_environment') && $this->getAttribute('needs_environment')) { + $compiler->raw('$this->env'); + $first = false; + } + + if ($this->hasAttribute('needs_context') && $this->getAttribute('needs_context')) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->raw('$context'); + $first = false; + } + + if ($this->hasAttribute('arguments')) { + foreach ($this->getAttribute('arguments') as $argument) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->string($argument); + $first = false; + } + } + + if ($this->hasNode('node')) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->subcompile($this->getNode('node')); + $first = false; + } + + if ($this->hasNode('arguments') && null !== $this->getNode('arguments')) { + $callable = $this->hasAttribute('callable') ? $this->getAttribute('callable') : null; + + $arguments = $this->getArguments($callable, $this->getNode('arguments')); + + foreach ($arguments as $node) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->subcompile($node); + $first = false; + } + } + + $compiler->raw(')'); + } + + protected function getArguments($callable, $arguments) + { + $parameters = array(); + $named = false; + foreach ($arguments as $name => $node) { + if (!is_int($name)) { + $named = true; + $name = $this->normalizeName($name); + } elseif ($named) { + throw new Twig_Error_Syntax(sprintf('Positional arguments cannot be used after named arguments for %s "%s".', $this->getAttribute('type'), $this->getAttribute('name'))); + } + + $parameters[$name] = $node; + } + + if (!$named) { + return $parameters; + } + + if (!$callable) { + throw new LogicException(sprintf('Named arguments are not supported for %s "%s".', $this->getAttribute('type'), $this->getAttribute('name'))); + } + + // manage named arguments + if (is_array($callable)) { + $r = new ReflectionMethod($callable[0], $callable[1]); + } elseif (is_object($callable) && !$callable instanceof Closure) { + $r = new ReflectionObject($callable); + $r = $r->getMethod('__invoke'); + } else { + $r = new ReflectionFunction($callable); + } + + $definition = $r->getParameters(); + if ($this->hasNode('node')) { + array_shift($definition); + } + if ($this->hasAttribute('needs_environment') && $this->getAttribute('needs_environment')) { + array_shift($definition); + } + if ($this->hasAttribute('needs_context') && $this->getAttribute('needs_context')) { + array_shift($definition); + } + if ($this->hasAttribute('arguments') && null !== $this->getAttribute('arguments')) { + foreach ($this->getAttribute('arguments') as $argument) { + array_shift($definition); + } + } + + $arguments = array(); + $pos = 0; + foreach ($definition as $param) { + $name = $this->normalizeName($param->name); + + if (array_key_exists($name, $parameters)) { + if (array_key_exists($pos, $parameters)) { + throw new Twig_Error_Syntax(sprintf('Argument "%s" is defined twice for %s "%s".', $name, $this->getAttribute('type'), $this->getAttribute('name'))); + } + + $arguments[] = $parameters[$name]; + unset($parameters[$name]); + } elseif (array_key_exists($pos, $parameters)) { + $arguments[] = $parameters[$pos]; + unset($parameters[$pos]); + ++$pos; + } elseif ($param->isDefaultValueAvailable()) { + $arguments[] = new Twig_Node_Expression_Constant($param->getDefaultValue(), -1); + } elseif ($param->isOptional()) { + break; + } else { + throw new Twig_Error_Syntax(sprintf('Value for argument "%s" is required for %s "%s".', $name, $this->getAttribute('type'), $this->getAttribute('name'))); + } + } + + if (!empty($parameters)) { + throw new Twig_Error_Syntax(sprintf('Unknown argument%s "%s" for %s "%s".', count($parameters) > 1 ? 's' : '' , implode('", "', array_keys($parameters)), $this->getAttribute('type'), $this->getAttribute('name'))); + } + + return $arguments; + } + + protected function normalizeName($name) + { + return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), array('\\1_\\2', '\\1_\\2'), $name)); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php new file mode 100644 index 0000000..edcb1e2 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php @@ -0,0 +1,31 @@ + $expr1, 'expr2' => $expr2, 'expr3' => $expr3), array(), $lineno); + } + + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('((') + ->subcompile($this->getNode('expr1')) + ->raw(') ? (') + ->subcompile($this->getNode('expr2')) + ->raw(') : (') + ->subcompile($this->getNode('expr3')) + ->raw('))') + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Constant.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Constant.php new file mode 100644 index 0000000..a91dc69 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Constant.php @@ -0,0 +1,23 @@ + $value), $lineno); + } + + public function compile(Twig_Compiler $compiler) + { + $compiler->repr($this->getAttribute('value')); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php new file mode 100644 index 0000000..00ac670 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php @@ -0,0 +1,33 @@ + + */ +class Twig_Node_Expression_ExtensionReference extends Twig_Node_Expression +{ + public function __construct($name, $lineno, $tag = null) + { + parent::__construct(array(), array('name' => $name), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler->raw(sprintf("\$this->env->getExtension('%s')", $this->getAttribute('name'))); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php new file mode 100644 index 0000000..207b062 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php @@ -0,0 +1,36 @@ + $node, 'filter' => $filterName, 'arguments' => $arguments), array(), $lineno, $tag); + } + + public function compile(Twig_Compiler $compiler) + { + $name = $this->getNode('filter')->getAttribute('value'); + $filter = $compiler->getEnvironment()->getFilter($name); + + $this->setAttribute('name', $name); + $this->setAttribute('type', 'filter'); + $this->setAttribute('thing', $filter); + $this->setAttribute('needs_environment', $filter->needsEnvironment()); + $this->setAttribute('needs_context', $filter->needsContext()); + $this->setAttribute('arguments', $filter->getArguments()); + if ($filter instanceof Twig_FilterCallableInterface || $filter instanceof Twig_SimpleFilter) { + $this->setAttribute('callable', $filter->getCallable()); + } + + $this->compileCallable($compiler); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php new file mode 100644 index 0000000..1827c88 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php @@ -0,0 +1,43 @@ + + * {{ var.foo|default('foo item on var is not defined') }} + * + * + * @author Fabien Potencier + */ +class Twig_Node_Expression_Filter_Default extends Twig_Node_Expression_Filter +{ + public function __construct(Twig_NodeInterface $node, Twig_Node_Expression_Constant $filterName, Twig_NodeInterface $arguments, $lineno, $tag = null) + { + $default = new Twig_Node_Expression_Filter($node, new Twig_Node_Expression_Constant('default', $node->getLine()), $arguments, $node->getLine()); + + if ('default' === $filterName->getAttribute('value') && ($node instanceof Twig_Node_Expression_Name || $node instanceof Twig_Node_Expression_GetAttr)) { + $test = new Twig_Node_Expression_Test_Defined(clone $node, 'defined', new Twig_Node(), $node->getLine()); + $false = count($arguments) ? $arguments->getNode(0) : new Twig_Node_Expression_Constant('', $node->getLine()); + + $node = new Twig_Node_Expression_Conditional($test, $default, $false, $node->getLine()); + } else { + $node = $default; + } + + parent::__construct($node, $filterName, $arguments, $lineno, $tag); + } + + public function compile(Twig_Compiler $compiler) + { + $compiler->subcompile($this->getNode('node')); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Function.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Function.php new file mode 100644 index 0000000..3e1f6b5 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Function.php @@ -0,0 +1,35 @@ + $arguments), array('name' => $name), $lineno); + } + + public function compile(Twig_Compiler $compiler) + { + $name = $this->getAttribute('name'); + $function = $compiler->getEnvironment()->getFunction($name); + + $this->setAttribute('name', $name); + $this->setAttribute('type', 'function'); + $this->setAttribute('thing', $function); + $this->setAttribute('needs_environment', $function->needsEnvironment()); + $this->setAttribute('needs_context', $function->needsContext()); + $this->setAttribute('arguments', $function->getArguments()); + if ($function instanceof Twig_FunctionCallableInterface || $function instanceof Twig_SimpleFunction) { + $this->setAttribute('callable', $function->getCallable()); + } + + $this->compileCallable($compiler); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php new file mode 100644 index 0000000..81a9b13 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php @@ -0,0 +1,53 @@ + $node, 'attribute' => $attribute, 'arguments' => $arguments), array('type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false, 'disable_c_ext' => false), $lineno); + } + + public function compile(Twig_Compiler $compiler) + { + if (function_exists('twig_template_get_attributes') && !$this->getAttribute('disable_c_ext')) { + $compiler->raw('twig_template_get_attributes($this, '); + } else { + $compiler->raw('$this->getAttribute('); + } + + if ($this->getAttribute('ignore_strict_check')) { + $this->getNode('node')->setAttribute('ignore_strict_check', true); + } + + $compiler->subcompile($this->getNode('node')); + + $compiler->raw(', ')->subcompile($this->getNode('attribute')); + + if (count($this->getNode('arguments')) || Twig_TemplateInterface::ANY_CALL !== $this->getAttribute('type') || $this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) { + $compiler->raw(', ')->subcompile($this->getNode('arguments')); + + if (Twig_TemplateInterface::ANY_CALL !== $this->getAttribute('type') || $this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) { + $compiler->raw(', ')->repr($this->getAttribute('type')); + } + + if ($this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) { + $compiler->raw(', '.($this->getAttribute('is_defined_test') ? 'true' : 'false')); + } + + if ($this->getAttribute('ignore_strict_check')) { + $compiler->raw(', '.($this->getAttribute('ignore_strict_check') ? 'true' : 'false')); + } + } + + $compiler->raw(')'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php new file mode 100644 index 0000000..620b02b --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php @@ -0,0 +1,41 @@ + $node, 'arguments' => $arguments), array('method' => $method, 'safe' => false), $lineno); + + if ($node instanceof Twig_Node_Expression_Name) { + $node->setAttribute('always_defined', true); + } + } + + public function compile(Twig_Compiler $compiler) + { + $compiler + ->subcompile($this->getNode('node')) + ->raw('->') + ->raw($this->getAttribute('method')) + ->raw('(') + ; + $first = true; + foreach ($this->getNode('arguments')->getKeyValuePairs() as $pair) { + if (!$first) { + $compiler->raw(', '); + } + $first = false; + + $compiler->subcompile($pair['value']); + } + $compiler->raw(')'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Name.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Name.php new file mode 100644 index 0000000..3b8fae0 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Name.php @@ -0,0 +1,88 @@ + '$this', + '_context' => '$context', + '_charset' => '$this->env->getCharset()', + ); + + public function __construct($name, $lineno) + { + parent::__construct(array(), array('name' => $name, 'is_defined_test' => false, 'ignore_strict_check' => false, 'always_defined' => false), $lineno); + } + + public function compile(Twig_Compiler $compiler) + { + $name = $this->getAttribute('name'); + + if ($this->getAttribute('is_defined_test')) { + if ($this->isSpecial()) { + $compiler->repr(true); + } else { + $compiler->raw('array_key_exists(')->repr($name)->raw(', $context)'); + } + } elseif ($this->isSpecial()) { + $compiler->raw($this->specialVars[$name]); + } elseif ($this->getAttribute('always_defined')) { + $compiler + ->raw('$context[') + ->string($name) + ->raw(']') + ; + } else { + // remove the non-PHP 5.4 version when PHP 5.3 support is dropped + // as the non-optimized version is just a workaround for slow ternary operator + // when the context has a lot of variables + if (version_compare(phpversion(), '5.4.0RC1', '>=')) { + // PHP 5.4 ternary operator performance was optimized + $compiler + ->raw('(isset($context[') + ->string($name) + ->raw(']) ? $context[') + ->string($name) + ->raw('] : ') + ; + + if ($this->getAttribute('ignore_strict_check') || !$compiler->getEnvironment()->isStrictVariables()) { + $compiler->raw('null)'); + } else { + $compiler->raw('$this->getContext($context, ')->string($name)->raw('))'); + } + } else { + $compiler + ->raw('$this->getContext($context, ') + ->string($name) + ; + + if ($this->getAttribute('ignore_strict_check')) { + $compiler->raw(', true'); + } + + $compiler + ->raw(')') + ; + } + } + } + + public function isSpecial() + { + return isset($this->specialVars[$this->getAttribute('name')]); + } + + public function isSimple() + { + return !$this->isSpecial() && !$this->getAttribute('is_defined_test'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php new file mode 100644 index 0000000..dcf618c --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php @@ -0,0 +1,47 @@ + + */ +class Twig_Node_Expression_Parent extends Twig_Node_Expression +{ + public function __construct($name, $lineno, $tag = null) + { + parent::__construct(array(), array('output' => false, 'name' => $name), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + if ($this->getAttribute('output')) { + $compiler + ->addDebugInfo($this) + ->write("\$this->displayParentBlock(") + ->string($this->getAttribute('name')) + ->raw(", \$context, \$blocks);\n") + ; + } else { + $compiler + ->raw("\$this->renderParentBlock(") + ->string($this->getAttribute('name')) + ->raw(", \$context, \$blocks)") + ; + } + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/TempName.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/TempName.php new file mode 100644 index 0000000..e6b058e --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/TempName.php @@ -0,0 +1,26 @@ + $name), $lineno); + } + + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('$_') + ->raw($this->getAttribute('name')) + ->raw('_') + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test.php new file mode 100644 index 0000000..639f501 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test.php @@ -0,0 +1,32 @@ + $node, 'arguments' => $arguments), array('name' => $name), $lineno); + } + + public function compile(Twig_Compiler $compiler) + { + $name = $this->getAttribute('name'); + $test = $compiler->getEnvironment()->getTest($name); + + $this->setAttribute('name', $name); + $this->setAttribute('type', 'test'); + $this->setAttribute('thing', $test); + if ($test instanceof Twig_TestCallableInterface || $test instanceof Twig_SimpleTest) { + $this->setAttribute('callable', $test->getCallable()); + } + + $this->compileCallable($compiler); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php new file mode 100644 index 0000000..de55f5f --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php @@ -0,0 +1,46 @@ + + * {% if post.status is constant('Post::PUBLISHED') %} + * the status attribute is exactly the same as Post::PUBLISHED + * {% endif %} + * + * + * @author Fabien Potencier + */ +class Twig_Node_Expression_Test_Constant extends Twig_Node_Expression_Test +{ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' === constant(') + ; + + if ($this->getNode('arguments')->hasNode(1)) { + $compiler + ->raw('get_class(') + ->subcompile($this->getNode('arguments')->getNode(1)) + ->raw(')."::".') + ; + } + + $compiler + ->subcompile($this->getNode('arguments')->getNode(0)) + ->raw('))') + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php new file mode 100644 index 0000000..247b2e2 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php @@ -0,0 +1,54 @@ + + * {# defined works with variable names and variable attributes #} + * {% if foo is defined %} + * {# ... #} + * {% endif %} + * + * + * @author Fabien Potencier + */ +class Twig_Node_Expression_Test_Defined extends Twig_Node_Expression_Test +{ + public function __construct(Twig_NodeInterface $node, $name, Twig_NodeInterface $arguments = null, $lineno) + { + parent::__construct($node, $name, $arguments, $lineno); + + if ($node instanceof Twig_Node_Expression_Name) { + $node->setAttribute('is_defined_test', true); + } elseif ($node instanceof Twig_Node_Expression_GetAttr) { + $node->setAttribute('is_defined_test', true); + + $this->changeIgnoreStrictCheck($node); + } else { + throw new Twig_Error_Syntax('The "defined" test only works with simple variables', $this->getLine()); + } + } + + protected function changeIgnoreStrictCheck(Twig_Node_Expression_GetAttr $node) + { + $node->setAttribute('ignore_strict_check', true); + + if ($node->getNode('node') instanceof Twig_Node_Expression_GetAttr) { + $this->changeIgnoreStrictCheck($node->getNode('node')); + } + } + + public function compile(Twig_Compiler $compiler) + { + $compiler->subcompile($this->getNode('node')); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php new file mode 100644 index 0000000..0aceb53 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php @@ -0,0 +1,33 @@ + + * {% if loop.index is divisibleby(3) %} + * + * + * @author Fabien Potencier + */ +class Twig_Node_Expression_Test_Divisibleby extends Twig_Node_Expression_Test +{ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('(0 == ') + ->subcompile($this->getNode('node')) + ->raw(' % ') + ->subcompile($this->getNode('arguments')->getNode(0)) + ->raw(')') + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php new file mode 100644 index 0000000..d7853e8 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php @@ -0,0 +1,32 @@ + + * {{ var is even }} + * + * + * @author Fabien Potencier + */ +class Twig_Node_Expression_Test_Even extends Twig_Node_Expression_Test +{ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' % 2 == 0') + ->raw(')') + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php new file mode 100644 index 0000000..1c83825 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php @@ -0,0 +1,31 @@ + + * {{ var is none }} + * + * + * @author Fabien Potencier + */ +class Twig_Node_Expression_Test_Null extends Twig_Node_Expression_Test +{ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('(null === ') + ->subcompile($this->getNode('node')) + ->raw(')') + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php new file mode 100644 index 0000000..421c19e --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php @@ -0,0 +1,32 @@ + + * {{ var is odd }} + * + * + * @author Fabien Potencier + */ +class Twig_Node_Expression_Test_Odd extends Twig_Node_Expression_Test +{ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' % 2 == 1') + ->raw(')') + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php new file mode 100644 index 0000000..b48905e --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php @@ -0,0 +1,29 @@ + + */ +class Twig_Node_Expression_Test_Sameas extends Twig_Node_Expression_Test +{ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' === ') + ->subcompile($this->getNode('arguments')->getNode(0)) + ->raw(')') + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php new file mode 100644 index 0000000..c514388 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php @@ -0,0 +1,30 @@ + $node), array(), $lineno); + } + + public function compile(Twig_Compiler $compiler) + { + $compiler->raw('('); + $this->operator($compiler); + $compiler + ->subcompile($this->getNode('node')) + ->raw(')') + ; + } + + abstract public function operator(Twig_Compiler $compiler); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php new file mode 100644 index 0000000..2a3937e --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php @@ -0,0 +1,18 @@ +raw('-'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php new file mode 100644 index 0000000..f94073c --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php @@ -0,0 +1,18 @@ +raw('!'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php new file mode 100644 index 0000000..04edb52 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php @@ -0,0 +1,18 @@ +raw('+'); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Flush.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Flush.php new file mode 100644 index 0000000..0467ddc --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Flush.php @@ -0,0 +1,36 @@ + + */ +class Twig_Node_Flush extends Twig_Node +{ + public function __construct($lineno, $tag) + { + parent::__construct(array(), array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write("flush();\n") + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/For.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/For.php new file mode 100644 index 0000000..d1ff371 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/For.php @@ -0,0 +1,112 @@ + + */ +class Twig_Node_For extends Twig_Node +{ + protected $loop; + + public function __construct(Twig_Node_Expression_AssignName $keyTarget, Twig_Node_Expression_AssignName $valueTarget, Twig_Node_Expression $seq, Twig_Node_Expression $ifexpr = null, Twig_NodeInterface $body, Twig_NodeInterface $else = null, $lineno, $tag = null) + { + $body = new Twig_Node(array($body, $this->loop = new Twig_Node_ForLoop($lineno, $tag))); + + if (null !== $ifexpr) { + $body = new Twig_Node_If(new Twig_Node(array($ifexpr, $body)), null, $lineno, $tag); + } + + parent::__construct(array('key_target' => $keyTarget, 'value_target' => $valueTarget, 'seq' => $seq, 'body' => $body, 'else' => $else), array('with_loop' => true, 'ifexpr' => null !== $ifexpr), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + // the (array) cast bypasses a PHP 5.2.6 bug + ->write("\$context['_parent'] = (array) \$context;\n") + ->write("\$context['_seq'] = twig_ensure_traversable(") + ->subcompile($this->getNode('seq')) + ->raw(");\n") + ; + + if (null !== $this->getNode('else')) { + $compiler->write("\$context['_iterated'] = false;\n"); + } + + if ($this->getAttribute('with_loop')) { + $compiler + ->write("\$context['loop'] = array(\n") + ->write(" 'parent' => \$context['_parent'],\n") + ->write(" 'index0' => 0,\n") + ->write(" 'index' => 1,\n") + ->write(" 'first' => true,\n") + ->write(");\n") + ; + + if (!$this->getAttribute('ifexpr')) { + $compiler + ->write("if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof Countable)) {\n") + ->indent() + ->write("\$length = count(\$context['_seq']);\n") + ->write("\$context['loop']['revindex0'] = \$length - 1;\n") + ->write("\$context['loop']['revindex'] = \$length;\n") + ->write("\$context['loop']['length'] = \$length;\n") + ->write("\$context['loop']['last'] = 1 === \$length;\n") + ->outdent() + ->write("}\n") + ; + } + } + + $this->loop->setAttribute('else', null !== $this->getNode('else')); + $this->loop->setAttribute('with_loop', $this->getAttribute('with_loop')); + $this->loop->setAttribute('ifexpr', $this->getAttribute('ifexpr')); + + $compiler + ->write("foreach (\$context['_seq'] as ") + ->subcompile($this->getNode('key_target')) + ->raw(" => ") + ->subcompile($this->getNode('value_target')) + ->raw(") {\n") + ->indent() + ->subcompile($this->getNode('body')) + ->outdent() + ->write("}\n") + ; + + if (null !== $this->getNode('else')) { + $compiler + ->write("if (!\$context['_iterated']) {\n") + ->indent() + ->subcompile($this->getNode('else')) + ->outdent() + ->write("}\n") + ; + } + + $compiler->write("\$_parent = \$context['_parent'];\n"); + + // remove some "private" loop variables (needed for nested loops) + $compiler->write('unset($context[\'_seq\'], $context[\'_iterated\'], $context[\''.$this->getNode('key_target')->getAttribute('name').'\'], $context[\''.$this->getNode('value_target')->getAttribute('name').'\'], $context[\'_parent\'], $context[\'loop\']);'."\n"); + + // keep the values set in the inner context for variables defined in the outer context + $compiler->write("\$context = array_intersect_key(\$context, \$_parent) + \$_parent;\n"); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/ForLoop.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/ForLoop.php new file mode 100644 index 0000000..b884158 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/ForLoop.php @@ -0,0 +1,55 @@ + + */ +class Twig_Node_ForLoop extends Twig_Node +{ + public function __construct($lineno, $tag = null) + { + parent::__construct(array(), array('with_loop' => false, 'ifexpr' => false, 'else' => false), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + if ($this->getAttribute('else')) { + $compiler->write("\$context['_iterated'] = true;\n"); + } + + if ($this->getAttribute('with_loop')) { + $compiler + ->write("++\$context['loop']['index0'];\n") + ->write("++\$context['loop']['index'];\n") + ->write("\$context['loop']['first'] = false;\n") + ; + + if (!$this->getAttribute('ifexpr')) { + $compiler + ->write("if (isset(\$context['loop']['length'])) {\n") + ->indent() + ->write("--\$context['loop']['revindex0'];\n") + ->write("--\$context['loop']['revindex'];\n") + ->write("\$context['loop']['last'] = 0 === \$context['loop']['revindex0'];\n") + ->outdent() + ->write("}\n") + ; + } + } + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/If.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/If.php new file mode 100644 index 0000000..4296a8d --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/If.php @@ -0,0 +1,66 @@ + + */ +class Twig_Node_If extends Twig_Node +{ + public function __construct(Twig_NodeInterface $tests, Twig_NodeInterface $else = null, $lineno, $tag = null) + { + parent::__construct(array('tests' => $tests, 'else' => $else), array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler->addDebugInfo($this); + for ($i = 0; $i < count($this->getNode('tests')); $i += 2) { + if ($i > 0) { + $compiler + ->outdent() + ->write("} elseif (") + ; + } else { + $compiler + ->write('if (') + ; + } + + $compiler + ->subcompile($this->getNode('tests')->getNode($i)) + ->raw(") {\n") + ->indent() + ->subcompile($this->getNode('tests')->getNode($i + 1)) + ; + } + + if ($this->hasNode('else') && null !== $this->getNode('else')) { + $compiler + ->outdent() + ->write("} else {\n") + ->indent() + ->subcompile($this->getNode('else')) + ; + } + + $compiler + ->outdent() + ->write("}\n"); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Import.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Import.php new file mode 100644 index 0000000..99efc09 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Import.php @@ -0,0 +1,50 @@ + + */ +class Twig_Node_Import extends Twig_Node +{ + public function __construct(Twig_Node_Expression $expr, Twig_Node_Expression $var, $lineno, $tag = null) + { + parent::__construct(array('expr' => $expr, 'var' => $var), array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('') + ->subcompile($this->getNode('var')) + ->raw(' = ') + ; + + if ($this->getNode('expr') instanceof Twig_Node_Expression_Name && '_self' === $this->getNode('expr')->getAttribute('name')) { + $compiler->raw("\$this"); + } else { + $compiler + ->raw('$this->env->loadTemplate(') + ->subcompile($this->getNode('expr')) + ->raw(")") + ; + } + + $compiler->raw(";\n"); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Include.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Include.php new file mode 100644 index 0000000..ed4a375 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Include.php @@ -0,0 +1,99 @@ + + */ +class Twig_Node_Include extends Twig_Node implements Twig_NodeOutputInterface +{ + public function __construct(Twig_Node_Expression $expr, Twig_Node_Expression $variables = null, $only = false, $ignoreMissing = false, $lineno, $tag = null) + { + parent::__construct(array('expr' => $expr, 'variables' => $variables), array('only' => (Boolean) $only, 'ignore_missing' => (Boolean) $ignoreMissing), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler->addDebugInfo($this); + + if ($this->getAttribute('ignore_missing')) { + $compiler + ->write("try {\n") + ->indent() + ; + } + + $this->addGetTemplate($compiler); + + $compiler->raw('->display('); + + $this->addTemplateArguments($compiler); + + $compiler->raw(");\n"); + + if ($this->getAttribute('ignore_missing')) { + $compiler + ->outdent() + ->write("} catch (Twig_Error_Loader \$e) {\n") + ->indent() + ->write("// ignore missing template\n") + ->outdent() + ->write("}\n\n") + ; + } + } + + protected function addGetTemplate(Twig_Compiler $compiler) + { + if ($this->getNode('expr') instanceof Twig_Node_Expression_Constant) { + $compiler + ->write("\$this->env->loadTemplate(") + ->subcompile($this->getNode('expr')) + ->raw(")") + ; + } else { + $compiler + ->write("\$template = \$this->env->resolveTemplate(") + ->subcompile($this->getNode('expr')) + ->raw(");\n") + ->write('$template') + ; + } + } + + protected function addTemplateArguments(Twig_Compiler $compiler) + { + if (false === $this->getAttribute('only')) { + if (null === $this->getNode('variables')) { + $compiler->raw('$context'); + } else { + $compiler + ->raw('array_merge($context, ') + ->subcompile($this->getNode('variables')) + ->raw(')') + ; + } + } else { + if (null === $this->getNode('variables')) { + $compiler->raw('array()'); + } else { + $compiler->subcompile($this->getNode('variables')); + } + } + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Macro.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Macro.php new file mode 100644 index 0000000..8991061 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Macro.php @@ -0,0 +1,96 @@ + + */ +class Twig_Node_Macro extends Twig_Node +{ + public function __construct($name, Twig_NodeInterface $body, Twig_NodeInterface $arguments, $lineno, $tag = null) + { + parent::__construct(array('body' => $body, 'arguments' => $arguments), array('name' => $name), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write(sprintf("public function get%s(", $this->getAttribute('name'))) + ; + + $count = count($this->getNode('arguments')); + $pos = 0; + foreach ($this->getNode('arguments') as $name => $default) { + $compiler + ->raw('$_'.$name.' = ') + ->subcompile($default) + ; + + if (++$pos < $count) { + $compiler->raw(', '); + } + } + + $compiler + ->raw(")\n") + ->write("{\n") + ->indent() + ; + + if (!count($this->getNode('arguments'))) { + $compiler->write("\$context = \$this->env->getGlobals();\n\n"); + } else { + $compiler + ->write("\$context = \$this->env->mergeGlobals(array(\n") + ->indent() + ; + + foreach ($this->getNode('arguments') as $name => $default) { + $compiler + ->write('') + ->string($name) + ->raw(' => $_'.$name) + ->raw(",\n") + ; + } + + $compiler + ->outdent() + ->write("));\n\n") + ; + } + + $compiler + ->write("\$blocks = array();\n\n") + ->write("ob_start();\n") + ->write("try {\n") + ->indent() + ->subcompile($this->getNode('body')) + ->outdent() + ->write("} catch (Exception \$e) {\n") + ->indent() + ->write("ob_end_clean();\n\n") + ->write("throw \$e;\n") + ->outdent() + ->write("}\n\n") + ->write("return ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset());\n") + ->outdent() + ->write("}\n\n") + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Module.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Module.php new file mode 100644 index 0000000..585048b --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Module.php @@ -0,0 +1,371 @@ + + */ +class Twig_Node_Module extends Twig_Node +{ + public function __construct(Twig_NodeInterface $body, Twig_Node_Expression $parent = null, Twig_NodeInterface $blocks, Twig_NodeInterface $macros, Twig_NodeInterface $traits, $embeddedTemplates, $filename) + { + // embedded templates are set as attributes so that they are only visited once by the visitors + parent::__construct(array('parent' => $parent, 'body' => $body, 'blocks' => $blocks, 'macros' => $macros, 'traits' => $traits), array('filename' => $filename, 'index' => null, 'embedded_templates' => $embeddedTemplates), 1); + } + + public function setIndex($index) + { + $this->setAttribute('index', $index); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $this->compileTemplate($compiler); + + foreach ($this->getAttribute('embedded_templates') as $template) { + $compiler->subcompile($template); + } + } + + protected function compileTemplate(Twig_Compiler $compiler) + { + if (!$this->getAttribute('index')) { + $compiler->write('compileClassHeader($compiler); + + if (count($this->getNode('blocks')) || count($this->getNode('traits')) || null === $this->getNode('parent') || $this->getNode('parent') instanceof Twig_Node_Expression_Constant) { + $this->compileConstructor($compiler); + } + + $this->compileGetParent($compiler); + + $this->compileDisplayHeader($compiler); + + $this->compileDisplayBody($compiler); + + $this->compileDisplayFooter($compiler); + + $compiler->subcompile($this->getNode('blocks')); + + $this->compileMacros($compiler); + + $this->compileGetTemplateName($compiler); + + $this->compileIsTraitable($compiler); + + $this->compileDebugInfo($compiler); + + $this->compileClassFooter($compiler); + } + + protected function compileGetParent(Twig_Compiler $compiler) + { + if (null === $this->getNode('parent')) { + return; + } + + $compiler + ->write("protected function doGetParent(array \$context)\n", "{\n") + ->indent() + ->write("return ") + ; + + if ($this->getNode('parent') instanceof Twig_Node_Expression_Constant) { + $compiler->subcompile($this->getNode('parent')); + } else { + $compiler + ->raw("\$this->env->resolveTemplate(") + ->subcompile($this->getNode('parent')) + ->raw(")") + ; + } + + $compiler + ->raw(";\n") + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileDisplayBody(Twig_Compiler $compiler) + { + $compiler->subcompile($this->getNode('body')); + + if (null !== $this->getNode('parent')) { + if ($this->getNode('parent') instanceof Twig_Node_Expression_Constant) { + $compiler->write("\$this->parent"); + } else { + $compiler->write("\$this->getParent(\$context)"); + } + $compiler->raw("->display(\$context, array_merge(\$this->blocks, \$blocks));\n"); + } + } + + protected function compileClassHeader(Twig_Compiler $compiler) + { + $compiler + ->write("\n\n") + // if the filename contains */, add a blank to avoid a PHP parse error + ->write("/* ".str_replace('*/', '* /', $this->getAttribute('filename'))." */\n") + ->write('class '.$compiler->getEnvironment()->getTemplateClass($this->getAttribute('filename'), $this->getAttribute('index'))) + ->raw(sprintf(" extends %s\n", $compiler->getEnvironment()->getBaseTemplateClass())) + ->write("{\n") + ->indent() + ; + } + + protected function compileConstructor(Twig_Compiler $compiler) + { + $compiler + ->write("public function __construct(Twig_Environment \$env)\n", "{\n") + ->indent() + ->write("parent::__construct(\$env);\n\n") + ; + + // parent + if (null === $this->getNode('parent')) { + $compiler->write("\$this->parent = false;\n\n"); + } elseif ($this->getNode('parent') instanceof Twig_Node_Expression_Constant) { + $compiler + ->write("\$this->parent = \$this->env->loadTemplate(") + ->subcompile($this->getNode('parent')) + ->raw(");\n\n") + ; + } + + $countTraits = count($this->getNode('traits')); + if ($countTraits) { + // traits + foreach ($this->getNode('traits') as $i => $trait) { + $this->compileLoadTemplate($compiler, $trait->getNode('template'), sprintf('$_trait_%s', $i)); + + $compiler + ->addDebugInfo($trait->getNode('template')) + ->write(sprintf("if (!\$_trait_%s->isTraitable()) {\n", $i)) + ->indent() + ->write("throw new Twig_Error_Runtime('Template \"'.") + ->subcompile($trait->getNode('template')) + ->raw(".'\" cannot be used as a trait.');\n") + ->outdent() + ->write("}\n") + ->write(sprintf("\$_trait_%s_blocks = \$_trait_%s->getBlocks();\n\n", $i, $i)) + ; + + foreach ($trait->getNode('targets') as $key => $value) { + $compiler + ->write(sprintf("\$_trait_%s_blocks[", $i)) + ->subcompile($value) + ->raw(sprintf("] = \$_trait_%s_blocks[", $i)) + ->string($key) + ->raw(sprintf("]; unset(\$_trait_%s_blocks[", $i)) + ->string($key) + ->raw("]);\n\n") + ; + } + } + + if ($countTraits > 1) { + $compiler + ->write("\$this->traits = array_merge(\n") + ->indent() + ; + + for ($i = 0; $i < $countTraits; $i++) { + $compiler + ->write(sprintf("\$_trait_%s_blocks".($i == $countTraits - 1 ? '' : ',')."\n", $i)) + ; + } + + $compiler + ->outdent() + ->write(");\n\n") + ; + } else { + $compiler + ->write("\$this->traits = \$_trait_0_blocks;\n\n") + ; + } + + $compiler + ->write("\$this->blocks = array_merge(\n") + ->indent() + ->write("\$this->traits,\n") + ->write("array(\n") + ; + } else { + $compiler + ->write("\$this->blocks = array(\n") + ; + } + + // blocks + $compiler + ->indent() + ; + + foreach ($this->getNode('blocks') as $name => $node) { + $compiler + ->write(sprintf("'%s' => array(\$this, 'block_%s'),\n", $name, $name)) + ; + } + + if ($countTraits) { + $compiler + ->outdent() + ->write(")\n") + ; + } + + $compiler + ->outdent() + ->write(");\n") + ->outdent() + ->write("}\n\n"); + ; + } + + protected function compileDisplayHeader(Twig_Compiler $compiler) + { + $compiler + ->write("protected function doDisplay(array \$context, array \$blocks = array())\n", "{\n") + ->indent() + ; + } + + protected function compileDisplayFooter(Twig_Compiler $compiler) + { + $compiler + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileClassFooter(Twig_Compiler $compiler) + { + $compiler + ->outdent() + ->write("}\n") + ; + } + + protected function compileMacros(Twig_Compiler $compiler) + { + $compiler->subcompile($this->getNode('macros')); + } + + protected function compileGetTemplateName(Twig_Compiler $compiler) + { + $compiler + ->write("public function getTemplateName()\n", "{\n") + ->indent() + ->write('return ') + ->repr($this->getAttribute('filename')) + ->raw(";\n") + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileIsTraitable(Twig_Compiler $compiler) + { + // A template can be used as a trait if: + // * it has no parent + // * it has no macros + // * it has no body + // + // Put another way, a template can be used as a trait if it + // only contains blocks and use statements. + $traitable = null === $this->getNode('parent') && 0 === count($this->getNode('macros')); + if ($traitable) { + if ($this->getNode('body') instanceof Twig_Node_Body) { + $nodes = $this->getNode('body')->getNode(0); + } else { + $nodes = $this->getNode('body'); + } + + if (!count($nodes)) { + $nodes = new Twig_Node(array($nodes)); + } + + foreach ($nodes as $node) { + if (!count($node)) { + continue; + } + + if ($node instanceof Twig_Node_Text && ctype_space($node->getAttribute('data'))) { + continue; + } + + if ($node instanceof Twig_Node_BlockReference) { + continue; + } + + $traitable = false; + break; + } + } + + if ($traitable) { + return; + } + + $compiler + ->write("public function isTraitable()\n", "{\n") + ->indent() + ->write(sprintf("return %s;\n", $traitable ? 'true' : 'false')) + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileDebugInfo(Twig_Compiler $compiler) + { + $compiler + ->write("public function getDebugInfo()\n", "{\n") + ->indent() + ->write(sprintf("return %s;\n", str_replace("\n", '', var_export(array_reverse($compiler->getDebugInfo(), true), true)))) + ->outdent() + ->write("}\n") + ; + } + + protected function compileLoadTemplate(Twig_Compiler $compiler, $node, $var) + { + if ($node instanceof Twig_Node_Expression_Constant) { + $compiler + ->write(sprintf("%s = \$this->env->loadTemplate(", $var)) + ->subcompile($node) + ->raw(");\n") + ; + } else { + $compiler + ->write(sprintf("%s = ", $var)) + ->subcompile($node) + ->raw(";\n") + ->write(sprintf("if (!%s", $var)) + ->raw(" instanceof Twig_Template) {\n") + ->indent() + ->write(sprintf("%s = \$this->env->loadTemplate(%s);\n", $var, $var)) + ->outdent() + ->write("}\n") + ; + } + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Print.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Print.php new file mode 100644 index 0000000..b0c41d1 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Print.php @@ -0,0 +1,39 @@ + + */ +class Twig_Node_Print extends Twig_Node implements Twig_NodeOutputInterface +{ + public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) + { + parent::__construct(array('expr' => $expr), array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('echo ') + ->subcompile($this->getNode('expr')) + ->raw(";\n") + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Sandbox.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Sandbox.php new file mode 100644 index 0000000..8cf3ed4 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Sandbox.php @@ -0,0 +1,47 @@ + + */ +class Twig_Node_Sandbox extends Twig_Node +{ + public function __construct(Twig_NodeInterface $body, $lineno, $tag = null) + { + parent::__construct(array('body' => $body), array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write("\$sandbox = \$this->env->getExtension('sandbox');\n") + ->write("if (!\$alreadySandboxed = \$sandbox->isSandboxed()) {\n") + ->indent() + ->write("\$sandbox->enableSandbox();\n") + ->outdent() + ->write("}\n") + ->subcompile($this->getNode('body')) + ->write("if (!\$alreadySandboxed) {\n") + ->indent() + ->write("\$sandbox->disableSandbox();\n") + ->outdent() + ->write("}\n") + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php new file mode 100644 index 0000000..be1f5da --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php @@ -0,0 +1,60 @@ + + */ +class Twig_Node_SandboxedModule extends Twig_Node_Module +{ + protected $usedFilters; + protected $usedTags; + protected $usedFunctions; + + public function __construct(Twig_Node_Module $node, array $usedFilters, array $usedTags, array $usedFunctions) + { + parent::__construct($node->getNode('body'), $node->getNode('parent'), $node->getNode('blocks'), $node->getNode('macros'), $node->getNode('traits'), $node->getAttribute('embedded_templates'), $node->getAttribute('filename'), $node->getLine(), $node->getNodeTag()); + + $this->setAttribute('index', $node->getAttribute('index')); + + $this->usedFilters = $usedFilters; + $this->usedTags = $usedTags; + $this->usedFunctions = $usedFunctions; + } + + protected function compileDisplayBody(Twig_Compiler $compiler) + { + $compiler->write("\$this->checkSecurity();\n"); + + parent::compileDisplayBody($compiler); + } + + protected function compileDisplayFooter(Twig_Compiler $compiler) + { + parent::compileDisplayFooter($compiler); + + $compiler + ->write("protected function checkSecurity()\n", "{\n") + ->indent() + ->write("\$this->env->getExtension('sandbox')->checkSecurity(\n") + ->indent() + ->write(!$this->usedTags ? "array(),\n" : "array('".implode('\', \'', $this->usedTags)."'),\n") + ->write(!$this->usedFilters ? "array(),\n" : "array('".implode('\', \'', $this->usedFilters)."'),\n") + ->write(!$this->usedFunctions ? "array()\n" : "array('".implode('\', \'', $this->usedFunctions)."')\n") + ->outdent() + ->write(");\n") + ->outdent() + ->write("}\n\n") + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php new file mode 100644 index 0000000..73dfaa9 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php @@ -0,0 +1,59 @@ + + */ +class Twig_Node_SandboxedPrint extends Twig_Node_Print +{ + public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) + { + parent::__construct($expr, $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('echo $this->env->getExtension(\'sandbox\')->ensureToStringAllowed(') + ->subcompile($this->getNode('expr')) + ->raw(");\n") + ; + } + + /** + * Removes node filters. + * + * This is mostly needed when another visitor adds filters (like the escaper one). + * + * @param Twig_Node $node A Node + */ + protected function removeNodeFilter($node) + { + if ($node instanceof Twig_Node_Expression_Filter) { + return $this->removeNodeFilter($node->getNode('node')); + } + + return $node; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Set.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Set.php new file mode 100644 index 0000000..4c9c16c --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Set.php @@ -0,0 +1,101 @@ + + */ +class Twig_Node_Set extends Twig_Node +{ + public function __construct($capture, Twig_NodeInterface $names, Twig_NodeInterface $values, $lineno, $tag = null) + { + parent::__construct(array('names' => $names, 'values' => $values), array('capture' => $capture, 'safe' => false), $lineno, $tag); + + /* + * Optimizes the node when capture is used for a large block of text. + * + * {% set foo %}foo{% endset %} is compiled to $context['foo'] = new Twig_Markup("foo"); + */ + if ($this->getAttribute('capture')) { + $this->setAttribute('safe', true); + + $values = $this->getNode('values'); + if ($values instanceof Twig_Node_Text) { + $this->setNode('values', new Twig_Node_Expression_Constant($values->getAttribute('data'), $values->getLine())); + $this->setAttribute('capture', false); + } + } + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler->addDebugInfo($this); + + if (count($this->getNode('names')) > 1) { + $compiler->write('list('); + foreach ($this->getNode('names') as $idx => $node) { + if ($idx) { + $compiler->raw(', '); + } + + $compiler->subcompile($node); + } + $compiler->raw(')'); + } else { + if ($this->getAttribute('capture')) { + $compiler + ->write("ob_start();\n") + ->subcompile($this->getNode('values')) + ; + } + + $compiler->subcompile($this->getNode('names'), false); + + if ($this->getAttribute('capture')) { + $compiler->raw(" = ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset())"); + } + } + + if (!$this->getAttribute('capture')) { + $compiler->raw(' = '); + + if (count($this->getNode('names')) > 1) { + $compiler->write('array('); + foreach ($this->getNode('values') as $idx => $value) { + if ($idx) { + $compiler->raw(', '); + } + + $compiler->subcompile($value); + } + $compiler->raw(')'); + } else { + if ($this->getAttribute('safe')) { + $compiler + ->raw("('' === \$tmp = ") + ->subcompile($this->getNode('values')) + ->raw(") ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset())") + ; + } else { + $compiler->subcompile($this->getNode('values')); + } + } + } + + $compiler->raw(";\n"); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/SetTemp.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/SetTemp.php new file mode 100644 index 0000000..3bdd1cb --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/SetTemp.php @@ -0,0 +1,35 @@ + $name), $lineno); + } + + public function compile(Twig_Compiler $compiler) + { + $name = $this->getAttribute('name'); + $compiler + ->addDebugInfo($this) + ->write('if (isset($context[') + ->string($name) + ->raw('])) { $_') + ->raw($name) + ->raw('_ = $context[') + ->repr($name) + ->raw(']; } else { $_') + ->raw($name) + ->raw("_ = null; }\n") + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Spaceless.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Spaceless.php new file mode 100644 index 0000000..7555fa0 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Spaceless.php @@ -0,0 +1,40 @@ + + */ +class Twig_Node_Spaceless extends Twig_Node +{ + public function __construct(Twig_NodeInterface $body, $lineno, $tag = 'spaceless') + { + parent::__construct(array('body' => $body), array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write("ob_start();\n") + ->subcompile($this->getNode('body')) + ->write("echo trim(preg_replace('/>\s+<', ob_get_clean()));\n") + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Text.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Text.php new file mode 100644 index 0000000..21bdcea --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Node/Text.php @@ -0,0 +1,39 @@ + + */ +class Twig_Node_Text extends Twig_Node implements Twig_NodeOutputInterface +{ + public function __construct($data, $lineno) + { + parent::__construct(array(), array('data' => $data), $lineno); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('echo ') + ->string($this->getAttribute('data')) + ->raw(";\n") + ; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/NodeInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeInterface.php new file mode 100644 index 0000000..f0ef725 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeInterface.php @@ -0,0 +1,30 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_NodeInterface extends Countable, IteratorAggregate +{ + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler); + + public function getLine(); + + public function getNodeTag(); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/NodeOutputInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeOutputInterface.php new file mode 100644 index 0000000..22172c0 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeOutputInterface.php @@ -0,0 +1,19 @@ + + */ +interface Twig_NodeOutputInterface +{ +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/NodeTraverser.php b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeTraverser.php new file mode 100644 index 0000000..28cba1a --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeTraverser.php @@ -0,0 +1,88 @@ + + */ +class Twig_NodeTraverser +{ + protected $env; + protected $visitors; + + /** + * Constructor. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param array $visitors An array of Twig_NodeVisitorInterface instances + */ + public function __construct(Twig_Environment $env, array $visitors = array()) + { + $this->env = $env; + $this->visitors = array(); + foreach ($visitors as $visitor) { + $this->addVisitor($visitor); + } + } + + /** + * Adds a visitor. + * + * @param Twig_NodeVisitorInterface $visitor A Twig_NodeVisitorInterface instance + */ + public function addVisitor(Twig_NodeVisitorInterface $visitor) + { + if (!isset($this->visitors[$visitor->getPriority()])) { + $this->visitors[$visitor->getPriority()] = array(); + } + + $this->visitors[$visitor->getPriority()][] = $visitor; + } + + /** + * Traverses a node and calls the registered visitors. + * + * @param Twig_NodeInterface $node A Twig_NodeInterface instance + */ + public function traverse(Twig_NodeInterface $node) + { + ksort($this->visitors); + foreach ($this->visitors as $visitors) { + foreach ($visitors as $visitor) { + $node = $this->traverseForVisitor($visitor, $node); + } + } + + return $node; + } + + protected function traverseForVisitor(Twig_NodeVisitorInterface $visitor, Twig_NodeInterface $node = null) + { + if (null === $node) { + return null; + } + + $node = $visitor->enterNode($node, $this->env); + + foreach ($node as $k => $n) { + if (false !== $n = $this->traverseForVisitor($visitor, $n)) { + $node->setNode($k, $n); + } else { + $node->removeNode($k); + } + } + + return $visitor->leaveNode($node, $this->env); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php new file mode 100644 index 0000000..cc4b3d7 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php @@ -0,0 +1,167 @@ + + */ +class Twig_NodeVisitor_Escaper implements Twig_NodeVisitorInterface +{ + protected $statusStack = array(); + protected $blocks = array(); + protected $safeAnalysis; + protected $traverser; + protected $defaultStrategy = false; + protected $safeVars = array(); + + public function __construct() + { + $this->safeAnalysis = new Twig_NodeVisitor_SafeAnalysis(); + } + + /** + * Called before child nodes are visited. + * + * @param Twig_NodeInterface $node The node to visit + * @param Twig_Environment $env The Twig environment instance + * + * @return Twig_NodeInterface The modified node + */ + public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) + { + if ($node instanceof Twig_Node_Module) { + if ($env->hasExtension('escaper') && $defaultStrategy = $env->getExtension('escaper')->getDefaultStrategy($node->getAttribute('filename'))) { + $this->defaultStrategy = $defaultStrategy; + } + $this->safeVars = array(); + } elseif ($node instanceof Twig_Node_AutoEscape) { + $this->statusStack[] = $node->getAttribute('value'); + } elseif ($node instanceof Twig_Node_Block) { + $this->statusStack[] = isset($this->blocks[$node->getAttribute('name')]) ? $this->blocks[$node->getAttribute('name')] : $this->needEscaping($env); + } elseif ($node instanceof Twig_Node_Import) { + $this->safeVars[] = $node->getNode('var')->getAttribute('name'); + } + + return $node; + } + + /** + * Called after child nodes are visited. + * + * @param Twig_NodeInterface $node The node to visit + * @param Twig_Environment $env The Twig environment instance + * + * @return Twig_NodeInterface The modified node + */ + public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) + { + if ($node instanceof Twig_Node_Module) { + $this->defaultStrategy = false; + $this->safeVars = array(); + } elseif ($node instanceof Twig_Node_Expression_Filter) { + return $this->preEscapeFilterNode($node, $env); + } elseif ($node instanceof Twig_Node_Print) { + return $this->escapePrintNode($node, $env, $this->needEscaping($env)); + } + + if ($node instanceof Twig_Node_AutoEscape || $node instanceof Twig_Node_Block) { + array_pop($this->statusStack); + } elseif ($node instanceof Twig_Node_BlockReference) { + $this->blocks[$node->getAttribute('name')] = $this->needEscaping($env); + } + + return $node; + } + + protected function escapePrintNode(Twig_Node_Print $node, Twig_Environment $env, $type) + { + if (false === $type) { + return $node; + } + + $expression = $node->getNode('expr'); + + if ($this->isSafeFor($type, $expression, $env)) { + return $node; + } + + $class = get_class($node); + + return new $class( + $this->getEscaperFilter($type, $expression), + $node->getLine() + ); + } + + protected function preEscapeFilterNode(Twig_Node_Expression_Filter $filter, Twig_Environment $env) + { + $name = $filter->getNode('filter')->getAttribute('value'); + + $type = $env->getFilter($name)->getPreEscape(); + if (null === $type) { + return $filter; + } + + $node = $filter->getNode('node'); + if ($this->isSafeFor($type, $node, $env)) { + return $filter; + } + + $filter->setNode('node', $this->getEscaperFilter($type, $node)); + + return $filter; + } + + protected function isSafeFor($type, Twig_NodeInterface $expression, $env) + { + $safe = $this->safeAnalysis->getSafe($expression); + + if (null === $safe) { + if (null === $this->traverser) { + $this->traverser = new Twig_NodeTraverser($env, array($this->safeAnalysis)); + } + + $this->safeAnalysis->setSafeVars($this->safeVars); + + $this->traverser->traverse($expression); + $safe = $this->safeAnalysis->getSafe($expression); + } + + return in_array($type, $safe) || in_array('all', $safe); + } + + protected function needEscaping(Twig_Environment $env) + { + if (count($this->statusStack)) { + return $this->statusStack[count($this->statusStack) - 1]; + } + + return $this->defaultStrategy ? $this->defaultStrategy : false; + } + + protected function getEscaperFilter($type, Twig_NodeInterface $node) + { + $line = $node->getLine(); + $name = new Twig_Node_Expression_Constant('escape', $line); + $args = new Twig_Node(array(new Twig_Node_Expression_Constant((string) $type, $line), new Twig_Node_Expression_Constant(null, $line), new Twig_Node_Expression_Constant(true, $line))); + + return new Twig_Node_Expression_Filter($node, $name, $args, $line); + } + + /** + * {@inheritdoc} + */ + public function getPriority() + { + return 0; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php new file mode 100644 index 0000000..a254def --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php @@ -0,0 +1,246 @@ + + */ +class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface +{ + const OPTIMIZE_ALL = -1; + const OPTIMIZE_NONE = 0; + const OPTIMIZE_FOR = 2; + const OPTIMIZE_RAW_FILTER = 4; + const OPTIMIZE_VAR_ACCESS = 8; + + protected $loops = array(); + protected $optimizers; + protected $prependedNodes = array(); + protected $inABody = false; + + /** + * Constructor. + * + * @param integer $optimizers The optimizer mode + */ + public function __construct($optimizers = -1) + { + if (!is_int($optimizers) || $optimizers > 2) { + throw new InvalidArgumentException(sprintf('Optimizer mode "%s" is not valid.', $optimizers)); + } + + $this->optimizers = $optimizers; + } + + /** + * {@inheritdoc} + */ + public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) + { + if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { + $this->enterOptimizeFor($node, $env); + } + + if (!version_compare(phpversion(), '5.4.0RC1', '>=') && self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('sandbox')) { + if ($this->inABody) { + if (!$node instanceof Twig_Node_Expression) { + if (get_class($node) !== 'Twig_Node') { + array_unshift($this->prependedNodes, array()); + } + } else { + $node = $this->optimizeVariables($node, $env); + } + } elseif ($node instanceof Twig_Node_Body) { + $this->inABody = true; + } + } + + return $node; + } + + /** + * {@inheritdoc} + */ + public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) + { + $expression = $node instanceof Twig_Node_Expression; + + if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { + $this->leaveOptimizeFor($node, $env); + } + + if (self::OPTIMIZE_RAW_FILTER === (self::OPTIMIZE_RAW_FILTER & $this->optimizers)) { + $node = $this->optimizeRawFilter($node, $env); + } + + $node = $this->optimizePrintNode($node, $env); + + if (self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('sandbox')) { + if ($node instanceof Twig_Node_Body) { + $this->inABody = false; + } elseif ($this->inABody) { + if (!$expression && get_class($node) !== 'Twig_Node' && $prependedNodes = array_shift($this->prependedNodes)) { + $nodes = array(); + foreach (array_unique($prependedNodes) as $name) { + $nodes[] = new Twig_Node_SetTemp($name, $node->getLine()); + } + + $nodes[] = $node; + $node = new Twig_Node($nodes); + } + } + } + + return $node; + } + + protected function optimizeVariables($node, $env) + { + if ('Twig_Node_Expression_Name' === get_class($node) && $node->isSimple()) { + $this->prependedNodes[0][] = $node->getAttribute('name'); + + return new Twig_Node_Expression_TempName($node->getAttribute('name'), $node->getLine()); + } + + return $node; + } + + /** + * Optimizes print nodes. + * + * It replaces: + * + * * "echo $this->render(Parent)Block()" with "$this->display(Parent)Block()" + * + * @param Twig_NodeInterface $node A Node + * @param Twig_Environment $env The current Twig environment + */ + protected function optimizePrintNode($node, $env) + { + if (!$node instanceof Twig_Node_Print) { + return $node; + } + + if ( + $node->getNode('expr') instanceof Twig_Node_Expression_BlockReference || + $node->getNode('expr') instanceof Twig_Node_Expression_Parent + ) { + $node->getNode('expr')->setAttribute('output', true); + + return $node->getNode('expr'); + } + + return $node; + } + + /** + * Removes "raw" filters. + * + * @param Twig_NodeInterface $node A Node + * @param Twig_Environment $env The current Twig environment + */ + protected function optimizeRawFilter($node, $env) + { + if ($node instanceof Twig_Node_Expression_Filter && 'raw' == $node->getNode('filter')->getAttribute('value')) { + return $node->getNode('node'); + } + + return $node; + } + + /** + * Optimizes "for" tag by removing the "loop" variable creation whenever possible. + * + * @param Twig_NodeInterface $node A Node + * @param Twig_Environment $env The current Twig environment + */ + protected function enterOptimizeFor($node, $env) + { + if ($node instanceof Twig_Node_For) { + // disable the loop variable by default + $node->setAttribute('with_loop', false); + array_unshift($this->loops, $node); + } elseif (!$this->loops) { + // we are outside a loop + return; + } + + // when do we need to add the loop variable back? + + // the loop variable is referenced for the current loop + elseif ($node instanceof Twig_Node_Expression_Name && 'loop' === $node->getAttribute('name')) { + $this->addLoopToCurrent(); + } + + // block reference + elseif ($node instanceof Twig_Node_BlockReference || $node instanceof Twig_Node_Expression_BlockReference) { + $this->addLoopToCurrent(); + } + + // include without the only attribute + elseif ($node instanceof Twig_Node_Include && !$node->getAttribute('only')) { + $this->addLoopToAll(); + } + + // the loop variable is referenced via an attribute + elseif ($node instanceof Twig_Node_Expression_GetAttr + && (!$node->getNode('attribute') instanceof Twig_Node_Expression_Constant + || 'parent' === $node->getNode('attribute')->getAttribute('value') + ) + && (true === $this->loops[0]->getAttribute('with_loop') + || ($node->getNode('node') instanceof Twig_Node_Expression_Name + && 'loop' === $node->getNode('node')->getAttribute('name') + ) + ) + ) { + $this->addLoopToAll(); + } + } + + /** + * Optimizes "for" tag by removing the "loop" variable creation whenever possible. + * + * @param Twig_NodeInterface $node A Node + * @param Twig_Environment $env The current Twig environment + */ + protected function leaveOptimizeFor($node, $env) + { + if ($node instanceof Twig_Node_For) { + array_shift($this->loops); + } + } + + protected function addLoopToCurrent() + { + $this->loops[0]->setAttribute('with_loop', true); + } + + protected function addLoopToAll() + { + foreach ($this->loops as $loop) { + $loop->setAttribute('with_loop', true); + } + } + + /** + * {@inheritdoc} + */ + public function getPriority() + { + return 255; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php new file mode 100644 index 0000000..c4bbd81 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php @@ -0,0 +1,131 @@ +safeVars = $safeVars; + } + + public function getSafe(Twig_NodeInterface $node) + { + $hash = spl_object_hash($node); + if (isset($this->data[$hash])) { + foreach ($this->data[$hash] as $bucket) { + if ($bucket['key'] === $node) { + return $bucket['value']; + } + } + } + } + + protected function setSafe(Twig_NodeInterface $node, array $safe) + { + $hash = spl_object_hash($node); + if (isset($this->data[$hash])) { + foreach ($this->data[$hash] as &$bucket) { + if ($bucket['key'] === $node) { + $bucket['value'] = $safe; + + return; + } + } + } + $this->data[$hash][] = array( + 'key' => $node, + 'value' => $safe, + ); + } + + public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) + { + return $node; + } + + public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) + { + if ($node instanceof Twig_Node_Expression_Constant) { + // constants are marked safe for all + $this->setSafe($node, array('all')); + } elseif ($node instanceof Twig_Node_Expression_BlockReference) { + // blocks are safe by definition + $this->setSafe($node, array('all')); + } elseif ($node instanceof Twig_Node_Expression_Parent) { + // parent block is safe by definition + $this->setSafe($node, array('all')); + } elseif ($node instanceof Twig_Node_Expression_Conditional) { + // intersect safeness of both operands + $safe = $this->intersectSafe($this->getSafe($node->getNode('expr2')), $this->getSafe($node->getNode('expr3'))); + $this->setSafe($node, $safe); + } elseif ($node instanceof Twig_Node_Expression_Filter) { + // filter expression is safe when the filter is safe + $name = $node->getNode('filter')->getAttribute('value'); + $args = $node->getNode('arguments'); + if (false !== $filter = $env->getFilter($name)) { + $safe = $filter->getSafe($args); + if (null === $safe) { + $safe = $this->intersectSafe($this->getSafe($node->getNode('node')), $filter->getPreservesSafety()); + } + $this->setSafe($node, $safe); + } else { + $this->setSafe($node, array()); + } + } elseif ($node instanceof Twig_Node_Expression_Function) { + // function expression is safe when the function is safe + $name = $node->getAttribute('name'); + $args = $node->getNode('arguments'); + $function = $env->getFunction($name); + if (false !== $function) { + $this->setSafe($node, $function->getSafe($args)); + } else { + $this->setSafe($node, array()); + } + } elseif ($node instanceof Twig_Node_Expression_MethodCall) { + if ($node->getAttribute('safe')) { + $this->setSafe($node, array('all')); + } else { + $this->setSafe($node, array()); + } + } elseif ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name) { + $name = $node->getNode('node')->getAttribute('name'); + // attributes on template instances are safe + if ('_self' == $name || in_array($name, $this->safeVars)) { + $this->setSafe($node, array('all')); + } else { + $this->setSafe($node, array()); + } + } else { + $this->setSafe($node, array()); + } + + return $node; + } + + protected function intersectSafe(array $a = null, array $b = null) + { + if (null === $a || null === $b) { + return array(); + } + + if (in_array('all', $a)) { + return $b; + } + + if (in_array('all', $b)) { + return $a; + } + + return array_intersect($a, $b); + } + + /** + * {@inheritdoc} + */ + public function getPriority() + { + return 0; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php new file mode 100644 index 0000000..fb27045 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php @@ -0,0 +1,92 @@ + + */ +class Twig_NodeVisitor_Sandbox implements Twig_NodeVisitorInterface +{ + protected $inAModule = false; + protected $tags; + protected $filters; + protected $functions; + + /** + * Called before child nodes are visited. + * + * @param Twig_NodeInterface $node The node to visit + * @param Twig_Environment $env The Twig environment instance + * + * @return Twig_NodeInterface The modified node + */ + public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) + { + if ($node instanceof Twig_Node_Module) { + $this->inAModule = true; + $this->tags = array(); + $this->filters = array(); + $this->functions = array(); + + return $node; + } elseif ($this->inAModule) { + // look for tags + if ($node->getNodeTag()) { + $this->tags[] = $node->getNodeTag(); + } + + // look for filters + if ($node instanceof Twig_Node_Expression_Filter) { + $this->filters[] = $node->getNode('filter')->getAttribute('value'); + } + + // look for functions + if ($node instanceof Twig_Node_Expression_Function) { + $this->functions[] = $node->getAttribute('name'); + } + + // wrap print to check __toString() calls + if ($node instanceof Twig_Node_Print) { + return new Twig_Node_SandboxedPrint($node->getNode('expr'), $node->getLine(), $node->getNodeTag()); + } + } + + return $node; + } + + /** + * Called after child nodes are visited. + * + * @param Twig_NodeInterface $node The node to visit + * @param Twig_Environment $env The Twig environment instance + * + * @return Twig_NodeInterface The modified node + */ + public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) + { + if ($node instanceof Twig_Node_Module) { + $this->inAModule = false; + + return new Twig_Node_SandboxedModule($node, array_unique($this->filters), array_unique($this->tags), array_unique($this->functions)); + } + + return $node; + } + + /** + * {@inheritdoc} + */ + public function getPriority() + { + return 0; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php new file mode 100644 index 0000000..f33c13f --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php @@ -0,0 +1,47 @@ + + */ +interface Twig_NodeVisitorInterface +{ + /** + * Called before child nodes are visited. + * + * @param Twig_NodeInterface $node The node to visit + * @param Twig_Environment $env The Twig environment instance + * + * @return Twig_NodeInterface The modified node + */ + public function enterNode(Twig_NodeInterface $node, Twig_Environment $env); + + /** + * Called after child nodes are visited. + * + * @param Twig_NodeInterface $node The node to visit + * @param Twig_Environment $env The Twig environment instance + * + * @return Twig_NodeInterface|false The modified node or false if the node must be removed + */ + public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env); + + /** + * Returns the priority for this visitor. + * + * Priority should be between -10 and 10 (0 is the default). + * + * @return integer The priority level + */ + public function getPriority(); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Parser.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Parser.php new file mode 100644 index 0000000..958e46b --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Parser.php @@ -0,0 +1,394 @@ + + */ +class Twig_Parser implements Twig_ParserInterface +{ + protected $stack = array(); + protected $stream; + protected $parent; + protected $handlers; + protected $visitors; + protected $expressionParser; + protected $blocks; + protected $blockStack; + protected $macros; + protected $env; + protected $reservedMacroNames; + protected $importedSymbols; + protected $traits; + protected $embeddedTemplates = array(); + + /** + * Constructor. + * + * @param Twig_Environment $env A Twig_Environment instance + */ + public function __construct(Twig_Environment $env) + { + $this->env = $env; + } + + public function getEnvironment() + { + return $this->env; + } + + public function getVarName() + { + return sprintf('__internal_%s', hash('sha1', uniqid(mt_rand(), true), false)); + } + + public function getFilename() + { + return $this->stream->getFilename(); + } + + /** + * Converts a token stream to a node tree. + * + * @param Twig_TokenStream $stream A token stream instance + * + * @return Twig_Node_Module A node tree + */ + public function parse(Twig_TokenStream $stream, $test = null, $dropNeedle = false) + { + // push all variables into the stack to keep the current state of the parser + $vars = get_object_vars($this); + unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser']); + $this->stack[] = $vars; + + // tag handlers + if (null === $this->handlers) { + $this->handlers = $this->env->getTokenParsers(); + $this->handlers->setParser($this); + } + + // node visitors + if (null === $this->visitors) { + $this->visitors = $this->env->getNodeVisitors(); + } + + if (null === $this->expressionParser) { + $this->expressionParser = new Twig_ExpressionParser($this, $this->env->getUnaryOperators(), $this->env->getBinaryOperators()); + } + + $this->stream = $stream; + $this->parent = null; + $this->blocks = array(); + $this->macros = array(); + $this->traits = array(); + $this->blockStack = array(); + $this->importedSymbols = array(array()); + $this->embeddedTemplates = array(); + + try { + $body = $this->subparse($test, $dropNeedle); + + if (null !== $this->parent) { + if (null === $body = $this->filterBodyNodes($body)) { + $body = new Twig_Node(); + } + } + } catch (Twig_Error_Syntax $e) { + if (!$e->getTemplateFile()) { + $e->setTemplateFile($this->getFilename()); + } + + if (!$e->getTemplateLine()) { + $e->setTemplateLine($this->stream->getCurrent()->getLine()); + } + + throw $e; + } + + $node = new Twig_Node_Module(new Twig_Node_Body(array($body)), $this->parent, new Twig_Node($this->blocks), new Twig_Node($this->macros), new Twig_Node($this->traits), $this->embeddedTemplates, $this->getFilename()); + + $traverser = new Twig_NodeTraverser($this->env, $this->visitors); + + $node = $traverser->traverse($node); + + // restore previous stack so previous parse() call can resume working + foreach (array_pop($this->stack) as $key => $val) { + $this->$key = $val; + } + + return $node; + } + + public function subparse($test, $dropNeedle = false) + { + $lineno = $this->getCurrentToken()->getLine(); + $rv = array(); + while (!$this->stream->isEOF()) { + switch ($this->getCurrentToken()->getType()) { + case Twig_Token::TEXT_TYPE: + $token = $this->stream->next(); + $rv[] = new Twig_Node_Text($token->getValue(), $token->getLine()); + break; + + case Twig_Token::VAR_START_TYPE: + $token = $this->stream->next(); + $expr = $this->expressionParser->parseExpression(); + $this->stream->expect(Twig_Token::VAR_END_TYPE); + $rv[] = new Twig_Node_Print($expr, $token->getLine()); + break; + + case Twig_Token::BLOCK_START_TYPE: + $this->stream->next(); + $token = $this->getCurrentToken(); + + if ($token->getType() !== Twig_Token::NAME_TYPE) { + throw new Twig_Error_Syntax('A block must start with a tag name', $token->getLine(), $this->getFilename()); + } + + if (null !== $test && call_user_func($test, $token)) { + if ($dropNeedle) { + $this->stream->next(); + } + + if (1 === count($rv)) { + return $rv[0]; + } + + return new Twig_Node($rv, array(), $lineno); + } + + $subparser = $this->handlers->getTokenParser($token->getValue()); + if (null === $subparser) { + if (null !== $test) { + $error = sprintf('Unexpected tag name "%s"', $token->getValue()); + if (is_array($test) && isset($test[0]) && $test[0] instanceof Twig_TokenParserInterface) { + $error .= sprintf(' (expecting closing tag for the "%s" tag defined near line %s)', $test[0]->getTag(), $lineno); + } + + throw new Twig_Error_Syntax($error, $token->getLine(), $this->getFilename()); + } + + $message = sprintf('Unknown tag name "%s"', $token->getValue()); + if ($alternatives = $this->env->computeAlternatives($token->getValue(), array_keys($this->env->getTags()))) { + $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives)); + } + + throw new Twig_Error_Syntax($message, $token->getLine(), $this->getFilename()); + } + + $this->stream->next(); + + $node = $subparser->parse($token); + if (null !== $node) { + $rv[] = $node; + } + break; + + default: + throw new Twig_Error_Syntax('Lexer or parser ended up in unsupported state.', 0, $this->getFilename()); + } + } + + if (1 === count($rv)) { + return $rv[0]; + } + + return new Twig_Node($rv, array(), $lineno); + } + + public function addHandler($name, $class) + { + $this->handlers[$name] = $class; + } + + public function addNodeVisitor(Twig_NodeVisitorInterface $visitor) + { + $this->visitors[] = $visitor; + } + + public function getBlockStack() + { + return $this->blockStack; + } + + public function peekBlockStack() + { + return $this->blockStack[count($this->blockStack) - 1]; + } + + public function popBlockStack() + { + array_pop($this->blockStack); + } + + public function pushBlockStack($name) + { + $this->blockStack[] = $name; + } + + public function hasBlock($name) + { + return isset($this->blocks[$name]); + } + + public function getBlock($name) + { + return $this->blocks[$name]; + } + + public function setBlock($name, $value) + { + $this->blocks[$name] = new Twig_Node_Body(array($value), array(), $value->getLine()); + } + + public function hasMacro($name) + { + return isset($this->macros[$name]); + } + + public function setMacro($name, Twig_Node_Macro $node) + { + if (null === $this->reservedMacroNames) { + $this->reservedMacroNames = array(); + $r = new ReflectionClass($this->env->getBaseTemplateClass()); + foreach ($r->getMethods() as $method) { + $this->reservedMacroNames[] = $method->getName(); + } + } + + if (in_array($name, $this->reservedMacroNames)) { + throw new Twig_Error_Syntax(sprintf('"%s" cannot be used as a macro name as it is a reserved keyword', $name), $node->getLine(), $this->getFilename()); + } + + $this->macros[$name] = $node; + } + + public function addTrait($trait) + { + $this->traits[] = $trait; + } + + public function hasTraits() + { + return count($this->traits) > 0; + } + + public function embedTemplate(Twig_Node_Module $template) + { + $template->setIndex(mt_rand()); + + $this->embeddedTemplates[] = $template; + } + + public function addImportedSymbol($type, $alias, $name = null, Twig_Node_Expression $node = null) + { + $this->importedSymbols[0][$type][$alias] = array('name' => $name, 'node' => $node); + } + + public function getImportedSymbol($type, $alias) + { + foreach ($this->importedSymbols as $functions) { + if (isset($functions[$type][$alias])) { + return $functions[$type][$alias]; + } + } + } + + public function isMainScope() + { + return 1 === count($this->importedSymbols); + } + + public function pushLocalScope() + { + array_unshift($this->importedSymbols, array()); + } + + public function popLocalScope() + { + array_shift($this->importedSymbols); + } + + /** + * Gets the expression parser. + * + * @return Twig_ExpressionParser The expression parser + */ + public function getExpressionParser() + { + return $this->expressionParser; + } + + public function getParent() + { + return $this->parent; + } + + public function setParent($parent) + { + $this->parent = $parent; + } + + /** + * Gets the token stream. + * + * @return Twig_TokenStream The token stream + */ + public function getStream() + { + return $this->stream; + } + + /** + * Gets the current token. + * + * @return Twig_Token The current token + */ + public function getCurrentToken() + { + return $this->stream->getCurrent(); + } + + protected function filterBodyNodes(Twig_NodeInterface $node) + { + // check that the body does not contain non-empty output nodes + if ( + ($node instanceof Twig_Node_Text && !ctype_space($node->getAttribute('data'))) + || + (!$node instanceof Twig_Node_Text && !$node instanceof Twig_Node_BlockReference && $node instanceof Twig_NodeOutputInterface) + ) { + if (false !== strpos((string) $node, chr(0xEF).chr(0xBB).chr(0xBF))) { + throw new Twig_Error_Syntax('A template that extends another one cannot have a body but a byte order mark (BOM) has been detected; it must be removed.', $node->getLine(), $this->getFilename()); + } + + throw new Twig_Error_Syntax('A template that extends another one cannot have a body.', $node->getLine(), $this->getFilename()); + } + + // bypass "set" nodes as they "capture" the output + if ($node instanceof Twig_Node_Set) { + return $node; + } + + if ($node instanceof Twig_NodeOutputInterface) { + return; + } + + foreach ($node as $k => $n) { + if (null !== $n && null === $n = $this->filterBodyNodes($n)) { + $node->removeNode($k); + } + } + + return $node; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/ParserInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/ParserInterface.php new file mode 100644 index 0000000..f0d7900 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/ParserInterface.php @@ -0,0 +1,28 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_ParserInterface +{ + /** + * Converts a token stream to a node tree. + * + * @param Twig_TokenStream $stream A token stream instance + * + * @return Twig_Node_Module A node tree + */ + public function parse(Twig_TokenStream $stream); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php new file mode 100644 index 0000000..015bfae --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php @@ -0,0 +1,19 @@ + + */ +class Twig_Sandbox_SecurityError extends Twig_Error +{ +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php new file mode 100644 index 0000000..66ee233 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php @@ -0,0 +1,119 @@ + + */ +class Twig_Sandbox_SecurityPolicy implements Twig_Sandbox_SecurityPolicyInterface +{ + protected $allowedTags; + protected $allowedFilters; + protected $allowedMethods; + protected $allowedProperties; + protected $allowedFunctions; + + public function __construct(array $allowedTags = array(), array $allowedFilters = array(), array $allowedMethods = array(), array $allowedProperties = array(), array $allowedFunctions = array()) + { + $this->allowedTags = $allowedTags; + $this->allowedFilters = $allowedFilters; + $this->setAllowedMethods($allowedMethods); + $this->allowedProperties = $allowedProperties; + $this->allowedFunctions = $allowedFunctions; + } + + public function setAllowedTags(array $tags) + { + $this->allowedTags = $tags; + } + + public function setAllowedFilters(array $filters) + { + $this->allowedFilters = $filters; + } + + public function setAllowedMethods(array $methods) + { + $this->allowedMethods = array(); + foreach ($methods as $class => $m) { + $this->allowedMethods[$class] = array_map('strtolower', is_array($m) ? $m : array($m)); + } + } + + public function setAllowedProperties(array $properties) + { + $this->allowedProperties = $properties; + } + + public function setAllowedFunctions(array $functions) + { + $this->allowedFunctions = $functions; + } + + public function checkSecurity($tags, $filters, $functions) + { + foreach ($tags as $tag) { + if (!in_array($tag, $this->allowedTags)) { + throw new Twig_Sandbox_SecurityError(sprintf('Tag "%s" is not allowed.', $tag)); + } + } + + foreach ($filters as $filter) { + if (!in_array($filter, $this->allowedFilters)) { + throw new Twig_Sandbox_SecurityError(sprintf('Filter "%s" is not allowed.', $filter)); + } + } + + foreach ($functions as $function) { + if (!in_array($function, $this->allowedFunctions)) { + throw new Twig_Sandbox_SecurityError(sprintf('Function "%s" is not allowed.', $function)); + } + } + } + + public function checkMethodAllowed($obj, $method) + { + if ($obj instanceof Twig_TemplateInterface || $obj instanceof Twig_Markup) { + return true; + } + + $allowed = false; + $method = strtolower($method); + foreach ($this->allowedMethods as $class => $methods) { + if ($obj instanceof $class) { + $allowed = in_array($method, $methods); + + break; + } + } + + if (!$allowed) { + throw new Twig_Sandbox_SecurityError(sprintf('Calling "%s" method on a "%s" object is not allowed.', $method, get_class($obj))); + } + } + + public function checkPropertyAllowed($obj, $property) + { + $allowed = false; + foreach ($this->allowedProperties as $class => $properties) { + if ($obj instanceof $class) { + $allowed = in_array($property, is_array($properties) ? $properties : array($properties)); + + break; + } + } + + if (!$allowed) { + throw new Twig_Sandbox_SecurityError(sprintf('Calling "%s" property on a "%s" object is not allowed.', $property, get_class($obj))); + } + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php new file mode 100644 index 0000000..6ab48e3 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php @@ -0,0 +1,24 @@ + + */ +interface Twig_Sandbox_SecurityPolicyInterface +{ + public function checkSecurity($tags, $filters, $functions); + + public function checkMethodAllowed($obj, $method); + + public function checkPropertyAllowed($obj, $method); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/SimpleFilter.php b/sources/phpBB/vendor/twig/twig/lib/Twig/SimpleFilter.php new file mode 100644 index 0000000..d35c563 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/SimpleFilter.php @@ -0,0 +1,94 @@ + + */ +class Twig_SimpleFilter +{ + protected $name; + protected $callable; + protected $options; + protected $arguments = array(); + + public function __construct($name, $callable, array $options = array()) + { + $this->name = $name; + $this->callable = $callable; + $this->options = array_merge(array( + 'needs_environment' => false, + 'needs_context' => false, + 'is_safe' => null, + 'is_safe_callback' => null, + 'pre_escape' => null, + 'preserves_safety' => null, + 'node_class' => 'Twig_Node_Expression_Filter', + ), $options); + } + + public function getName() + { + return $this->name; + } + + public function getCallable() + { + return $this->callable; + } + + public function getNodeClass() + { + return $this->options['node_class']; + } + + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + + public function needsEnvironment() + { + return $this->options['needs_environment']; + } + + public function needsContext() + { + return $this->options['needs_context']; + } + + public function getSafe(Twig_Node $filterArgs) + { + if (null !== $this->options['is_safe']) { + return $this->options['is_safe']; + } + + if (null !== $this->options['is_safe_callback']) { + return call_user_func($this->options['is_safe_callback'], $filterArgs); + } + } + + public function getPreservesSafety() + { + return $this->options['preserves_safety']; + } + + public function getPreEscape() + { + return $this->options['pre_escape']; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/SimpleFunction.php b/sources/phpBB/vendor/twig/twig/lib/Twig/SimpleFunction.php new file mode 100644 index 0000000..8ef6aca --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/SimpleFunction.php @@ -0,0 +1,84 @@ + + */ +class Twig_SimpleFunction +{ + protected $name; + protected $callable; + protected $options; + protected $arguments = array(); + + public function __construct($name, $callable, array $options = array()) + { + $this->name = $name; + $this->callable = $callable; + $this->options = array_merge(array( + 'needs_environment' => false, + 'needs_context' => false, + 'is_safe' => null, + 'is_safe_callback' => null, + 'node_class' => 'Twig_Node_Expression_Function', + ), $options); + } + + public function getName() + { + return $this->name; + } + + public function getCallable() + { + return $this->callable; + } + + public function getNodeClass() + { + return $this->options['node_class']; + } + + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + + public function needsEnvironment() + { + return $this->options['needs_environment']; + } + + public function needsContext() + { + return $this->options['needs_context']; + } + + public function getSafe(Twig_Node $functionArgs) + { + if (null !== $this->options['is_safe']) { + return $this->options['is_safe']; + } + + if (null !== $this->options['is_safe_callback']) { + return call_user_func($this->options['is_safe_callback'], $functionArgs); + } + + return array(); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/SimpleTest.php b/sources/phpBB/vendor/twig/twig/lib/Twig/SimpleTest.php new file mode 100644 index 0000000..225459c --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/SimpleTest.php @@ -0,0 +1,46 @@ + + */ +class Twig_SimpleTest +{ + protected $name; + protected $callable; + protected $options; + + public function __construct($name, $callable, array $options = array()) + { + $this->name = $name; + $this->callable = $callable; + $this->options = array_merge(array( + 'node_class' => 'Twig_Node_Expression_Test', + ), $options); + } + + public function getName() + { + return $this->name; + } + + public function getCallable() + { + return $this->callable; + } + + public function getNodeClass() + { + return $this->options['node_class']; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Template.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Template.php new file mode 100644 index 0000000..a001ca0 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Template.php @@ -0,0 +1,455 @@ + + */ +abstract class Twig_Template implements Twig_TemplateInterface +{ + protected static $cache = array(); + + protected $parent; + protected $parents; + protected $env; + protected $blocks; + protected $traits; + + /** + * Constructor. + * + * @param Twig_Environment $env A Twig_Environment instance + */ + public function __construct(Twig_Environment $env) + { + $this->env = $env; + $this->blocks = array(); + $this->traits = array(); + } + + /** + * Returns the template name. + * + * @return string The template name + */ + abstract public function getTemplateName(); + + /** + * {@inheritdoc} + */ + public function getEnvironment() + { + return $this->env; + } + + /** + * Returns the parent template. + * + * This method is for internal use only and should never be called + * directly. + * + * @return Twig_TemplateInterface|false The parent template or false if there is no parent + */ + public function getParent(array $context) + { + if (null !== $this->parent) { + return $this->parent; + } + + $parent = $this->doGetParent($context); + if (false === $parent) { + return false; + } elseif ($parent instanceof Twig_Template) { + $name = $parent->getTemplateName(); + $this->parents[$name] = $parent; + $parent = $name; + } elseif (!isset($this->parents[$parent])) { + $this->parents[$parent] = $this->env->loadTemplate($parent); + } + + return $this->parents[$parent]; + } + + protected function doGetParent(array $context) + { + return false; + } + + public function isTraitable() + { + return true; + } + + /** + * Displays a parent block. + * + * This method is for internal use only and should never be called + * directly. + * + * @param string $name The block name to display from the parent + * @param array $context The context + * @param array $blocks The current set of blocks + */ + public function displayParentBlock($name, array $context, array $blocks = array()) + { + $name = (string) $name; + + if (isset($this->traits[$name])) { + $this->traits[$name][0]->displayBlock($name, $context, $blocks); + } elseif (false !== $parent = $this->getParent($context)) { + $parent->displayBlock($name, $context, $blocks); + } else { + throw new Twig_Error_Runtime(sprintf('The template has no parent and no traits defining the "%s" block', $name), -1, $this->getTemplateName()); + } + } + + /** + * Displays a block. + * + * This method is for internal use only and should never be called + * directly. + * + * @param string $name The block name to display + * @param array $context The context + * @param array $blocks The current set of blocks + */ + public function displayBlock($name, array $context, array $blocks = array()) + { + $name = (string) $name; + + if (isset($blocks[$name])) { + $b = $blocks; + unset($b[$name]); + call_user_func($blocks[$name], $context, $b); + } elseif (isset($this->blocks[$name])) { + call_user_func($this->blocks[$name], $context, $blocks); + } elseif (false !== $parent = $this->getParent($context)) { + $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks)); + } + } + + /** + * Renders a parent block. + * + * This method is for internal use only and should never be called + * directly. + * + * @param string $name The block name to render from the parent + * @param array $context The context + * @param array $blocks The current set of blocks + * + * @return string The rendered block + */ + public function renderParentBlock($name, array $context, array $blocks = array()) + { + ob_start(); + $this->displayParentBlock($name, $context, $blocks); + + return ob_get_clean(); + } + + /** + * Renders a block. + * + * This method is for internal use only and should never be called + * directly. + * + * @param string $name The block name to render + * @param array $context The context + * @param array $blocks The current set of blocks + * + * @return string The rendered block + */ + public function renderBlock($name, array $context, array $blocks = array()) + { + ob_start(); + $this->displayBlock($name, $context, $blocks); + + return ob_get_clean(); + } + + /** + * Returns whether a block exists or not. + * + * This method is for internal use only and should never be called + * directly. + * + * This method does only return blocks defined in the current template + * or defined in "used" traits. + * + * It does not return blocks from parent templates as the parent + * template name can be dynamic, which is only known based on the + * current context. + * + * @param string $name The block name + * + * @return Boolean true if the block exists, false otherwise + */ + public function hasBlock($name) + { + return isset($this->blocks[(string) $name]); + } + + /** + * Returns all block names. + * + * This method is for internal use only and should never be called + * directly. + * + * @return array An array of block names + * + * @see hasBlock + */ + public function getBlockNames() + { + return array_keys($this->blocks); + } + + /** + * Returns all blocks. + * + * This method is for internal use only and should never be called + * directly. + * + * @return array An array of blocks + * + * @see hasBlock + */ + public function getBlocks() + { + return $this->blocks; + } + + /** + * {@inheritdoc} + */ + public function display(array $context, array $blocks = array()) + { + $this->displayWithErrorHandling($this->env->mergeGlobals($context), $blocks); + } + + /** + * {@inheritdoc} + */ + public function render(array $context) + { + $level = ob_get_level(); + ob_start(); + try { + $this->display($context); + } catch (Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + + throw $e; + } + + return ob_get_clean(); + } + + protected function displayWithErrorHandling(array $context, array $blocks = array()) + { + try { + $this->doDisplay($context, $blocks); + } catch (Twig_Error $e) { + if (!$e->getTemplateFile()) { + $e->setTemplateFile($this->getTemplateName()); + } + + // this is mostly useful for Twig_Error_Loader exceptions + // see Twig_Error_Loader + if (false === $e->getTemplateLine()) { + $e->setTemplateLine(-1); + $e->guess(); + } + + throw $e; + } catch (Exception $e) { + throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, null, $e); + } + } + + /** + * Auto-generated method to display the template with the given context. + * + * @param array $context An array of parameters to pass to the template + * @param array $blocks An array of blocks to pass to the template + */ + abstract protected function doDisplay(array $context, array $blocks = array()); + + /** + * Returns a variable from the context. + * + * This method is for internal use only and should never be called + * directly. + * + * This method should not be overridden in a sub-class as this is an + * implementation detail that has been introduced to optimize variable + * access for versions of PHP before 5.4. This is not a way to override + * the way to get a variable value. + * + * @param array $context The context + * @param string $item The variable to return from the context + * @param Boolean $ignoreStrictCheck Whether to ignore the strict variable check or not + * + * @return The content of the context variable + * + * @throws Twig_Error_Runtime if the variable does not exist and Twig is running in strict mode + */ + final protected function getContext($context, $item, $ignoreStrictCheck = false) + { + if (!array_key_exists($item, $context)) { + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return null; + } + + throw new Twig_Error_Runtime(sprintf('Variable "%s" does not exist', $item), -1, $this->getTemplateName()); + } + + return $context[$item]; + } + + /** + * Returns the attribute value for a given array/object. + * + * @param mixed $object The object or array from where to get the item + * @param mixed $item The item to get from the array or object + * @param array $arguments An array of arguments to pass if the item is an object method + * @param string $type The type of attribute (@see Twig_TemplateInterface) + * @param Boolean $isDefinedTest Whether this is only a defined check + * @param Boolean $ignoreStrictCheck Whether to ignore the strict attribute check or not + * + * @return mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true + * + * @throws Twig_Error_Runtime if the attribute does not exist and Twig is running in strict mode and $isDefinedTest is false + */ + protected function getAttribute($object, $item, array $arguments = array(), $type = Twig_TemplateInterface::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false) + { + // array + if (Twig_TemplateInterface::METHOD_CALL !== $type) { + $arrayItem = is_bool($item) || is_float($item) ? (int) $item : $item; + + if ((is_array($object) && array_key_exists($arrayItem, $object)) + || ($object instanceof ArrayAccess && isset($object[$arrayItem])) + ) { + if ($isDefinedTest) { + return true; + } + + return $object[$arrayItem]; + } + + if (Twig_TemplateInterface::ARRAY_CALL === $type || !is_object($object)) { + if ($isDefinedTest) { + return false; + } + + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return null; + } + + if (is_object($object)) { + throw new Twig_Error_Runtime(sprintf('Key "%s" in object (with ArrayAccess) of type "%s" does not exist', $arrayItem, get_class($object)), -1, $this->getTemplateName()); + } elseif (is_array($object)) { + throw new Twig_Error_Runtime(sprintf('Key "%s" for array with keys "%s" does not exist', $arrayItem, implode(', ', array_keys($object))), -1, $this->getTemplateName()); + } elseif (Twig_TemplateInterface::ARRAY_CALL === $type) { + throw new Twig_Error_Runtime(sprintf('Impossible to access a key ("%s") on a %s variable ("%s")', $item, gettype($object), $object), -1, $this->getTemplateName()); + } else { + throw new Twig_Error_Runtime(sprintf('Impossible to access an attribute ("%s") on a %s variable ("%s")', $item, gettype($object), $object), -1, $this->getTemplateName()); + } + } + } + + if (!is_object($object)) { + if ($isDefinedTest) { + return false; + } + + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return null; + } + + throw new Twig_Error_Runtime(sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s")', $item, gettype($object), $object), -1, $this->getTemplateName()); + } + + $class = get_class($object); + + // object property + if (Twig_TemplateInterface::METHOD_CALL !== $type) { + if (isset($object->$item) || array_key_exists((string) $item, $object)) { + if ($isDefinedTest) { + return true; + } + + if ($this->env->hasExtension('sandbox')) { + $this->env->getExtension('sandbox')->checkPropertyAllowed($object, $item); + } + + return $object->$item; + } + } + + // object method + if (!isset(self::$cache[$class]['methods'])) { + self::$cache[$class]['methods'] = array_change_key_case(array_flip(get_class_methods($object))); + } + + $lcItem = strtolower($item); + if (isset(self::$cache[$class]['methods'][$lcItem])) { + $method = (string) $item; + } elseif (isset(self::$cache[$class]['methods']['get'.$lcItem])) { + $method = 'get'.$item; + } elseif (isset(self::$cache[$class]['methods']['is'.$lcItem])) { + $method = 'is'.$item; + } elseif (isset(self::$cache[$class]['methods']['__call'])) { + $method = (string) $item; + } else { + if ($isDefinedTest) { + return false; + } + + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return null; + } + + throw new Twig_Error_Runtime(sprintf('Method "%s" for object "%s" does not exist', $item, get_class($object)), -1, $this->getTemplateName()); + } + + if ($isDefinedTest) { + return true; + } + + if ($this->env->hasExtension('sandbox')) { + $this->env->getExtension('sandbox')->checkMethodAllowed($object, $method); + } + + $ret = call_user_func_array(array($object, $method), $arguments); + + // useful when calling a template method from a template + // this is not supported but unfortunately heavily used in the Symfony profiler + if ($object instanceof Twig_TemplateInterface) { + return $ret === '' ? '' : new Twig_Markup($ret, $this->env->getCharset()); + } + + return $ret; + } + + /** + * This method is only useful when testing Twig. Do not use it. + */ + public static function clearCache() + { + self::$cache = array(); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TemplateInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TemplateInterface.php new file mode 100644 index 0000000..879f503 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TemplateInterface.php @@ -0,0 +1,47 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_TemplateInterface +{ + const ANY_CALL = 'any'; + const ARRAY_CALL = 'array'; + const METHOD_CALL = 'method'; + + /** + * Renders the template with the given context and returns it as string. + * + * @param array $context An array of parameters to pass to the template + * + * @return string The rendered template + */ + public function render(array $context); + + /** + * Displays the template with the given context. + * + * @param array $context An array of parameters to pass to the template + * @param array $blocks An array of blocks to pass to the template + */ + public function display(array $context, array $blocks = array()); + + /** + * Returns the bound environment for this template. + * + * @return Twig_Environment The current environment + */ + public function getEnvironment(); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Test.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Test.php new file mode 100644 index 0000000..3baff88 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Test.php @@ -0,0 +1,34 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +abstract class Twig_Test implements Twig_TestInterface, Twig_TestCallableInterface +{ + protected $options; + protected $arguments = array(); + + public function __construct(array $options = array()) + { + $this->options = array_merge(array( + 'callable' => null, + ), $options); + } + + public function getCallable() + { + return $this->options['callable']; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Test/Function.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Test/Function.php new file mode 100644 index 0000000..4be6b9b --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Test/Function.php @@ -0,0 +1,35 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Test_Function extends Twig_Test +{ + protected $function; + + public function __construct($function, array $options = array()) + { + $options['callable'] = $function; + + parent::__construct($options); + + $this->function = $function; + } + + public function compile() + { + return $this->function; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php new file mode 100644 index 0000000..724f094 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php @@ -0,0 +1,154 @@ + + * @author Karma Dordrak + */ +abstract class Twig_Test_IntegrationTestCase extends PHPUnit_Framework_TestCase +{ + abstract protected function getExtensions(); + abstract protected function getFixturesDir(); + + /** + * @dataProvider getTests + */ + public function testIntegration($file, $message, $condition, $templates, $exception, $outputs) + { + $this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs); + } + + public function getTests() + { + $fixturesDir = realpath($this->getFixturesDir()); + $tests = array(); + + foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($fixturesDir), RecursiveIteratorIterator::LEAVES_ONLY) as $file) { + if (!preg_match('/\.test$/', $file)) { + continue; + } + + $test = file_get_contents($file->getRealpath()); + + if (preg_match('/ + --TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)\s*(?:--DATA--\s*(.*))?\s*--EXCEPTION--\s*(.*)/sx', $test, $match)) { + $message = $match[1]; + $condition = $match[2]; + $templates = $this->parseTemplates($match[3]); + $exception = $match[5]; + $outputs = array(array(null, $match[4], null, '')); + } elseif (preg_match('/--TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)--DATA--.*?--EXPECT--.*/s', $test, $match)) { + $message = $match[1]; + $condition = $match[2]; + $templates = $this->parseTemplates($match[3]); + $exception = false; + preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $outputs, PREG_SET_ORDER); + } else { + throw new InvalidArgumentException(sprintf('Test "%s" is not valid.', str_replace($fixturesDir.'/', '', $file))); + } + + $tests[] = array(str_replace($fixturesDir.'/', '', $file), $message, $condition, $templates, $exception, $outputs); + } + + return $tests; + } + + protected function doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs) + { + if ($condition) { + eval('$ret = '.$condition.';'); + if (!$ret) { + $this->markTestSkipped($condition); + } + } + + $loader = new Twig_Loader_Array($templates); + + foreach ($outputs as $match) { + $config = array_merge(array( + 'cache' => false, + 'strict_variables' => true, + ), $match[2] ? eval($match[2].';') : array()); + $twig = new Twig_Environment($loader, $config); + $twig->addGlobal('global', 'global'); + foreach ($this->getExtensions() as $extension) { + $twig->addExtension($extension); + } + + try { + $template = $twig->loadTemplate('index.twig'); + } catch (Exception $e) { + if (false !== $exception) { + $this->assertEquals(trim($exception), trim(sprintf('%s: %s', get_class($e), $e->getMessage()))); + + return; + } + + if ($e instanceof Twig_Error_Syntax) { + $e->setTemplateFile($file); + + throw $e; + } + + throw new Twig_Error(sprintf('%s: %s', get_class($e), $e->getMessage()), -1, $file, $e); + } + + try { + $output = trim($template->render(eval($match[1].';')), "\n "); + } catch (Exception $e) { + if (false !== $exception) { + $this->assertEquals(trim($exception), trim(sprintf('%s: %s', get_class($e), $e->getMessage()))); + + return; + } + + if ($e instanceof Twig_Error_Syntax) { + $e->setTemplateFile($file); + } else { + $e = new Twig_Error(sprintf('%s: %s', get_class($e), $e->getMessage()), -1, $file, $e); + } + + $output = trim(sprintf('%s: %s', get_class($e), $e->getMessage())); + } + + if (false !== $exception) { + list($class, ) = explode(':', $exception); + $this->assertThat(NULL, new PHPUnit_Framework_Constraint_Exception($class)); + } + + $expected = trim($match[3], "\n "); + + if ($expected != $output) { + echo 'Compiled template that failed:'; + + foreach (array_keys($templates) as $name) { + echo "Template: $name\n"; + $source = $loader->getSource($name); + echo $twig->compile($twig->parse($twig->tokenize($source, $name))); + } + } + $this->assertEquals($expected, $output, $message.' (in '.$file.')'); + } + } + + protected static function parseTemplates($test) + { + $templates = array(); + preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, PREG_SET_ORDER); + foreach ($matches as $match) { + $templates[($match[1] ? $match[1] : 'index.twig')] = $match[2]; + } + + return $templates; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Test/Method.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Test/Method.php new file mode 100644 index 0000000..17c6c04 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Test/Method.php @@ -0,0 +1,37 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Test_Method extends Twig_Test +{ + protected $extension; + protected $method; + + public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array()) + { + $options['callable'] = array($extension, $method); + + parent::__construct($options); + + $this->extension = $extension; + $this->method = $method; + } + + public function compile() + { + return sprintf('$this->env->getExtension(\'%s\')->%s', $this->extension->getName(), $this->method); + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Test/Node.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Test/Node.php new file mode 100644 index 0000000..c832a57 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Test/Node.php @@ -0,0 +1,37 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Test_Node extends Twig_Test +{ + protected $class; + + public function __construct($class, array $options = array()) + { + parent::__construct($options); + + $this->class = $class; + } + + public function getClass() + { + return $this->class; + } + + public function compile() + { + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php new file mode 100644 index 0000000..b15c85f --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php @@ -0,0 +1,58 @@ +assertNodeCompilation($source, $node, $environment); + } + + public function assertNodeCompilation($source, Twig_Node $node, Twig_Environment $environment = null) + { + $compiler = $this->getCompiler($environment); + $compiler->compile($node); + + $this->assertEquals($source, trim($compiler->getSource())); + } + + protected function getCompiler(Twig_Environment $environment = null) + { + return new Twig_Compiler(null === $environment ? $this->getEnvironment() : $environment); + } + + protected function getEnvironment() + { + return new Twig_Environment(); + } + + protected function getVariableGetter($name) + { + if (version_compare(phpversion(), '5.4.0RC1', '>=')) { + return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name); + } + + return sprintf('$this->getContext($context, "%s")', $name); + } + + protected function getAttributeGetter() + { + if (function_exists('twig_template_get_attributes')) { + return 'twig_template_get_attributes($this, '; + } + + return '$this->getAttribute('; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TestCallableInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TestCallableInterface.php new file mode 100644 index 0000000..0db4368 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TestCallableInterface.php @@ -0,0 +1,21 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_TestCallableInterface +{ + public function getCallable(); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TestInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TestInterface.php new file mode 100644 index 0000000..30d8a2c --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TestInterface.php @@ -0,0 +1,26 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_TestInterface +{ + /** + * Compiles a test. + * + * @return string The PHP code for the test + */ + public function compile(); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/Token.php b/sources/phpBB/vendor/twig/twig/lib/Twig/Token.php new file mode 100644 index 0000000..bbca90d --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/Token.php @@ -0,0 +1,218 @@ + + */ +class Twig_Token +{ + protected $value; + protected $type; + protected $lineno; + + const EOF_TYPE = -1; + const TEXT_TYPE = 0; + const BLOCK_START_TYPE = 1; + const VAR_START_TYPE = 2; + const BLOCK_END_TYPE = 3; + const VAR_END_TYPE = 4; + const NAME_TYPE = 5; + const NUMBER_TYPE = 6; + const STRING_TYPE = 7; + const OPERATOR_TYPE = 8; + const PUNCTUATION_TYPE = 9; + const INTERPOLATION_START_TYPE = 10; + const INTERPOLATION_END_TYPE = 11; + + /** + * Constructor. + * + * @param integer $type The type of the token + * @param string $value The token value + * @param integer $lineno The line position in the source + */ + public function __construct($type, $value, $lineno) + { + $this->type = $type; + $this->value = $value; + $this->lineno = $lineno; + } + + /** + * Returns a string representation of the token. + * + * @return string A string representation of the token + */ + public function __toString() + { + return sprintf('%s(%s)', self::typeToString($this->type, true, $this->lineno), $this->value); + } + + /** + * Tests the current token for a type and/or a value. + * + * Parameters may be: + * * just type + * * type and value (or array of possible values) + * * just value (or array of possible values) (NAME_TYPE is used as type) + * + * @param array|integer $type The type to test + * @param array|string|null $values The token value + * + * @return Boolean + */ + public function test($type, $values = null) + { + if (null === $values && !is_int($type)) { + $values = $type; + $type = self::NAME_TYPE; + } + + return ($this->type === $type) && ( + null === $values || + (is_array($values) && in_array($this->value, $values)) || + $this->value == $values + ); + } + + /** + * Gets the line. + * + * @return integer The source line + */ + public function getLine() + { + return $this->lineno; + } + + /** + * Gets the token type. + * + * @return integer The token type + */ + public function getType() + { + return $this->type; + } + + /** + * Gets the token value. + * + * @return string The token value + */ + public function getValue() + { + return $this->value; + } + + /** + * Returns the constant representation (internal) of a given type. + * + * @param integer $type The type as an integer + * @param Boolean $short Whether to return a short representation or not + * @param integer $line The code line + * + * @return string The string representation + */ + public static function typeToString($type, $short = false, $line = -1) + { + switch ($type) { + case self::EOF_TYPE: + $name = 'EOF_TYPE'; + break; + case self::TEXT_TYPE: + $name = 'TEXT_TYPE'; + break; + case self::BLOCK_START_TYPE: + $name = 'BLOCK_START_TYPE'; + break; + case self::VAR_START_TYPE: + $name = 'VAR_START_TYPE'; + break; + case self::BLOCK_END_TYPE: + $name = 'BLOCK_END_TYPE'; + break; + case self::VAR_END_TYPE: + $name = 'VAR_END_TYPE'; + break; + case self::NAME_TYPE: + $name = 'NAME_TYPE'; + break; + case self::NUMBER_TYPE: + $name = 'NUMBER_TYPE'; + break; + case self::STRING_TYPE: + $name = 'STRING_TYPE'; + break; + case self::OPERATOR_TYPE: + $name = 'OPERATOR_TYPE'; + break; + case self::PUNCTUATION_TYPE: + $name = 'PUNCTUATION_TYPE'; + break; + case self::INTERPOLATION_START_TYPE: + $name = 'INTERPOLATION_START_TYPE'; + break; + case self::INTERPOLATION_END_TYPE: + $name = 'INTERPOLATION_END_TYPE'; + break; + default: + throw new LogicException(sprintf('Token of type "%s" does not exist.', $type)); + } + + return $short ? $name : 'Twig_Token::'.$name; + } + + /** + * Returns the english representation of a given type. + * + * @param integer $type The type as an integer + * @param integer $line The code line + * + * @return string The string representation + */ + public static function typeToEnglish($type, $line = -1) + { + switch ($type) { + case self::EOF_TYPE: + return 'end of template'; + case self::TEXT_TYPE: + return 'text'; + case self::BLOCK_START_TYPE: + return 'begin of statement block'; + case self::VAR_START_TYPE: + return 'begin of print statement'; + case self::BLOCK_END_TYPE: + return 'end of statement block'; + case self::VAR_END_TYPE: + return 'end of print statement'; + case self::NAME_TYPE: + return 'name'; + case self::NUMBER_TYPE: + return 'number'; + case self::STRING_TYPE: + return 'string'; + case self::OPERATOR_TYPE: + return 'operator'; + case self::PUNCTUATION_TYPE: + return 'punctuation'; + case self::INTERPOLATION_START_TYPE: + return 'begin of string interpolation'; + case self::INTERPOLATION_END_TYPE: + return 'end of string interpolation'; + default: + throw new LogicException(sprintf('Token of type "%s" does not exist.', $type)); + } + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser.php new file mode 100644 index 0000000..decebd5 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser.php @@ -0,0 +1,33 @@ + + */ +abstract class Twig_TokenParser implements Twig_TokenParserInterface +{ + /** + * @var Twig_Parser + */ + protected $parser; + + /** + * Sets the parser associated with this token parser + * + * @param $parser A Twig_Parser instance + */ + public function setParser(Twig_Parser $parser) + { + $this->parser = $parser; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php new file mode 100644 index 0000000..2756028 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php @@ -0,0 +1,89 @@ + + * {% autoescape true %} + * Everything will be automatically escaped in this block + * {% endautoescape %} + * + * {% autoescape false %} + * Everything will be outputed as is in this block + * {% endautoescape %} + * + * {% autoescape true js %} + * Everything will be automatically escaped in this block + * using the js escaping strategy + * {% endautoescape %} + * + */ +class Twig_TokenParser_AutoEscape extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $lineno = $token->getLine(); + $stream = $this->parser->getStream(); + + if ($stream->test(Twig_Token::BLOCK_END_TYPE)) { + $value = 'html'; + } else { + $expr = $this->parser->getExpressionParser()->parseExpression(); + if (!$expr instanceof Twig_Node_Expression_Constant) { + throw new Twig_Error_Syntax('An escaping strategy must be a string or a Boolean.', $stream->getCurrent()->getLine(), $stream->getFilename()); + } + $value = $expr->getAttribute('value'); + + $compat = true === $value || false === $value; + + if (true === $value) { + $value = 'html'; + } + + if ($compat && $stream->test(Twig_Token::NAME_TYPE)) { + if (false === $value) { + throw new Twig_Error_Syntax('Unexpected escaping strategy as you set autoescaping to false.', $stream->getCurrent()->getLine(), $stream->getFilename()); + } + + $value = $stream->next()->getValue(); + } + } + + $stream->expect(Twig_Token::BLOCK_END_TYPE); + $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true); + $stream->expect(Twig_Token::BLOCK_END_TYPE); + + return new Twig_Node_AutoEscape($value, $body, $lineno, $this->getTag()); + } + + public function decideBlockEnd(Twig_Token $token) + { + return $token->test('endautoescape'); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'autoescape'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Block.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Block.php new file mode 100644 index 0000000..a2e017f --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Block.php @@ -0,0 +1,83 @@ + + * {% block head %} + * + * {% block title %}{% endblock %} - My Webpage + * {% endblock %} + * + */ +class Twig_TokenParser_Block extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $lineno = $token->getLine(); + $stream = $this->parser->getStream(); + $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); + if ($this->parser->hasBlock($name)) { + throw new Twig_Error_Syntax(sprintf("The block '$name' has already been defined line %d", $this->parser->getBlock($name)->getLine()), $stream->getCurrent()->getLine(), $stream->getFilename()); + } + $this->parser->setBlock($name, $block = new Twig_Node_Block($name, new Twig_Node(array()), $lineno)); + $this->parser->pushLocalScope(); + $this->parser->pushBlockStack($name); + + if ($stream->test(Twig_Token::BLOCK_END_TYPE)) { + $stream->next(); + + $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true); + if ($stream->test(Twig_Token::NAME_TYPE)) { + $value = $stream->next()->getValue(); + + if ($value != $name) { + throw new Twig_Error_Syntax(sprintf("Expected endblock for block '$name' (but %s given)", $value), $stream->getCurrent()->getLine(), $stream->getFilename()); + } + } + } else { + $body = new Twig_Node(array( + new Twig_Node_Print($this->parser->getExpressionParser()->parseExpression(), $lineno), + )); + } + $stream->expect(Twig_Token::BLOCK_END_TYPE); + + $block->setNode('body', $body); + $this->parser->popBlockStack(); + $this->parser->popLocalScope(); + + return new Twig_Node_BlockReference($name, $lineno, $this->getTag()); + } + + public function decideBlockEnd(Twig_Token $token) + { + return $token->test('endblock'); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'block'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Do.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Do.php new file mode 100644 index 0000000..f50939d --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Do.php @@ -0,0 +1,42 @@ +parser->getExpressionParser()->parseExpression(); + + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + + return new Twig_Node_Do($expr, $token->getLine(), $this->getTag()); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'do'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Embed.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Embed.php new file mode 100644 index 0000000..69cb5f3 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Embed.php @@ -0,0 +1,66 @@ +parser->getStream(); + + $parent = $this->parser->getExpressionParser()->parseExpression(); + + list($variables, $only, $ignoreMissing) = $this->parseArguments(); + + // inject a fake parent to make the parent() function work + $stream->injectTokens(array( + new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', $token->getLine()), + new Twig_Token(Twig_Token::NAME_TYPE, 'extends', $token->getLine()), + new Twig_Token(Twig_Token::STRING_TYPE, '__parent__', $token->getLine()), + new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', $token->getLine()), + )); + + $module = $this->parser->parse($stream, array($this, 'decideBlockEnd'), true); + + // override the parent with the correct one + $module->setNode('parent', $parent); + + $this->parser->embedTemplate($module); + + $stream->expect(Twig_Token::BLOCK_END_TYPE); + + return new Twig_Node_Embed($module->getAttribute('filename'), $module->getAttribute('index'), $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); + } + + public function decideBlockEnd(Twig_Token $token) + { + return $token->test('endembed'); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'embed'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Extends.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Extends.php new file mode 100644 index 0000000..f5ecee2 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Extends.php @@ -0,0 +1,52 @@ + + * {% extends "base.html" %} + * + */ +class Twig_TokenParser_Extends extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + if (!$this->parser->isMainScope()) { + throw new Twig_Error_Syntax('Cannot extend from a block', $token->getLine(), $this->parser->getFilename()); + } + + if (null !== $this->parser->getParent()) { + throw new Twig_Error_Syntax('Multiple extends tags are forbidden', $token->getLine(), $this->parser->getFilename()); + } + $this->parser->setParent($this->parser->getExpressionParser()->parseExpression()); + + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'extends'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Filter.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Filter.php new file mode 100644 index 0000000..2b97475 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Filter.php @@ -0,0 +1,61 @@ + + * {% filter upper %} + * This text becomes uppercase + * {% endfilter %} + * + */ +class Twig_TokenParser_Filter extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $name = $this->parser->getVarName(); + $ref = new Twig_Node_Expression_BlockReference(new Twig_Node_Expression_Constant($name, $token->getLine()), true, $token->getLine(), $this->getTag()); + + $filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag()); + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + + $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true); + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + + $block = new Twig_Node_Block($name, $body, $token->getLine()); + $this->parser->setBlock($name, $block); + + return new Twig_Node_Print($filter, $token->getLine(), $this->getTag()); + } + + public function decideBlockEnd(Twig_Token $token) + { + return $token->test('endfilter'); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'filter'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Flush.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Flush.php new file mode 100644 index 0000000..4e15e78 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Flush.php @@ -0,0 +1,42 @@ +parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + + return new Twig_Node_Flush($token->getLine(), $this->getTag()); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'flush'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/For.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/For.php new file mode 100644 index 0000000..98a6d07 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/For.php @@ -0,0 +1,136 @@ + + *
    + * {% for user in users %} + *
  • {{ user.username|e }}
  • + * {% endfor %} + *
+ * + */ +class Twig_TokenParser_For extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $lineno = $token->getLine(); + $stream = $this->parser->getStream(); + $targets = $this->parser->getExpressionParser()->parseAssignmentExpression(); + $stream->expect(Twig_Token::OPERATOR_TYPE, 'in'); + $seq = $this->parser->getExpressionParser()->parseExpression(); + + $ifexpr = null; + if ($stream->test(Twig_Token::NAME_TYPE, 'if')) { + $stream->next(); + $ifexpr = $this->parser->getExpressionParser()->parseExpression(); + } + + $stream->expect(Twig_Token::BLOCK_END_TYPE); + $body = $this->parser->subparse(array($this, 'decideForFork')); + if ($stream->next()->getValue() == 'else') { + $stream->expect(Twig_Token::BLOCK_END_TYPE); + $else = $this->parser->subparse(array($this, 'decideForEnd'), true); + } else { + $else = null; + } + $stream->expect(Twig_Token::BLOCK_END_TYPE); + + if (count($targets) > 1) { + $keyTarget = $targets->getNode(0); + $keyTarget = new Twig_Node_Expression_AssignName($keyTarget->getAttribute('name'), $keyTarget->getLine()); + $valueTarget = $targets->getNode(1); + $valueTarget = new Twig_Node_Expression_AssignName($valueTarget->getAttribute('name'), $valueTarget->getLine()); + } else { + $keyTarget = new Twig_Node_Expression_AssignName('_key', $lineno); + $valueTarget = $targets->getNode(0); + $valueTarget = new Twig_Node_Expression_AssignName($valueTarget->getAttribute('name'), $valueTarget->getLine()); + } + + if ($ifexpr) { + $this->checkLoopUsageCondition($stream, $ifexpr); + $this->checkLoopUsageBody($stream, $body); + } + + return new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, $lineno, $this->getTag()); + } + + public function decideForFork(Twig_Token $token) + { + return $token->test(array('else', 'endfor')); + } + + public function decideForEnd(Twig_Token $token) + { + return $token->test('endfor'); + } + + // the loop variable cannot be used in the condition + protected function checkLoopUsageCondition(Twig_TokenStream $stream, Twig_NodeInterface $node) + { + if ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name && 'loop' == $node->getNode('node')->getAttribute('name')) { + throw new Twig_Error_Syntax('The "loop" variable cannot be used in a looping condition', $node->getLine(), $stream->getFilename()); + } + + foreach ($node as $n) { + if (!$n) { + continue; + } + + $this->checkLoopUsageCondition($stream, $n); + } + } + + // check usage of non-defined loop-items + // it does not catch all problems (for instance when a for is included into another or when the variable is used in an include) + protected function checkLoopUsageBody(Twig_TokenStream $stream, Twig_NodeInterface $node) + { + if ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name && 'loop' == $node->getNode('node')->getAttribute('name')) { + $attribute = $node->getNode('attribute'); + if ($attribute instanceof Twig_Node_Expression_Constant && in_array($attribute->getAttribute('value'), array('length', 'revindex0', 'revindex', 'last'))) { + throw new Twig_Error_Syntax(sprintf('The "loop.%s" variable is not defined when looping with a condition', $attribute->getAttribute('value')), $node->getLine(), $stream->getFilename()); + } + } + + // should check for parent.loop.XXX usage + if ($node instanceof Twig_Node_For) { + return; + } + + foreach ($node as $n) { + if (!$n) { + continue; + } + + $this->checkLoopUsageBody($stream, $n); + } + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'for'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/From.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/From.php new file mode 100644 index 0000000..a54054d --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/From.php @@ -0,0 +1,74 @@ + + * {% from 'forms.html' import forms %} + * + */ +class Twig_TokenParser_From extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $macro = $this->parser->getExpressionParser()->parseExpression(); + $stream = $this->parser->getStream(); + $stream->expect('import'); + + $targets = array(); + do { + $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); + + $alias = $name; + if ($stream->test('as')) { + $stream->next(); + + $alias = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); + } + + $targets[$name] = $alias; + + if (!$stream->test(Twig_Token::PUNCTUATION_TYPE, ',')) { + break; + } + + $stream->next(); + } while (true); + + $stream->expect(Twig_Token::BLOCK_END_TYPE); + + $node = new Twig_Node_Import($macro, new Twig_Node_Expression_AssignName($this->parser->getVarName(), $token->getLine()), $token->getLine(), $this->getTag()); + + foreach ($targets as $name => $alias) { + $this->parser->addImportedSymbol('function', $alias, 'get'.$name, $node->getNode('var')); + } + + return $node; + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'from'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/If.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/If.php new file mode 100644 index 0000000..3d7d1f5 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/If.php @@ -0,0 +1,94 @@ + + * {% if users %} + *
    + * {% for user in users %} + *
  • {{ user.username|e }}
  • + * {% endfor %} + *
+ * {% endif %} + * + */ +class Twig_TokenParser_If extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $lineno = $token->getLine(); + $expr = $this->parser->getExpressionParser()->parseExpression(); + $stream = $this->parser->getStream(); + $stream->expect(Twig_Token::BLOCK_END_TYPE); + $body = $this->parser->subparse(array($this, 'decideIfFork')); + $tests = array($expr, $body); + $else = null; + + $end = false; + while (!$end) { + switch ($stream->next()->getValue()) { + case 'else': + $stream->expect(Twig_Token::BLOCK_END_TYPE); + $else = $this->parser->subparse(array($this, 'decideIfEnd')); + break; + + case 'elseif': + $expr = $this->parser->getExpressionParser()->parseExpression(); + $stream->expect(Twig_Token::BLOCK_END_TYPE); + $body = $this->parser->subparse(array($this, 'decideIfFork')); + $tests[] = $expr; + $tests[] = $body; + break; + + case 'endif': + $end = true; + break; + + default: + throw new Twig_Error_Syntax(sprintf('Unexpected end of template. Twig was looking for the following tags "else", "elseif", or "endif" to close the "if" block started at line %d)', $lineno), $stream->getCurrent()->getLine(), $stream->getFilename()); + } + } + + $stream->expect(Twig_Token::BLOCK_END_TYPE); + + return new Twig_Node_If(new Twig_Node($tests), $else, $lineno, $this->getTag()); + } + + public function decideIfFork(Twig_Token $token) + { + return $token->test(array('elseif', 'else', 'endif')); + } + + public function decideIfEnd(Twig_Token $token) + { + return $token->test(array('endif')); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'if'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Import.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Import.php new file mode 100644 index 0000000..e7050c7 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Import.php @@ -0,0 +1,49 @@ + + * {% import 'forms.html' as forms %} + * + */ +class Twig_TokenParser_Import extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $macro = $this->parser->getExpressionParser()->parseExpression(); + $this->parser->getStream()->expect('as'); + $var = new Twig_Node_Expression_AssignName($this->parser->getStream()->expect(Twig_Token::NAME_TYPE)->getValue(), $token->getLine()); + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + + $this->parser->addImportedSymbol('template', $var->getAttribute('name')); + + return new Twig_Node_Import($macro, $var, $token->getLine(), $this->getTag()); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'import'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Include.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Include.php new file mode 100644 index 0000000..4a31786 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Include.php @@ -0,0 +1,80 @@ + + * {% include 'header.html' %} + * Body + * {% include 'footer.html' %} + * + */ +class Twig_TokenParser_Include extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $expr = $this->parser->getExpressionParser()->parseExpression(); + + list($variables, $only, $ignoreMissing) = $this->parseArguments(); + + return new Twig_Node_Include($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); + } + + protected function parseArguments() + { + $stream = $this->parser->getStream(); + + $ignoreMissing = false; + if ($stream->test(Twig_Token::NAME_TYPE, 'ignore')) { + $stream->next(); + $stream->expect(Twig_Token::NAME_TYPE, 'missing'); + + $ignoreMissing = true; + } + + $variables = null; + if ($stream->test(Twig_Token::NAME_TYPE, 'with')) { + $stream->next(); + + $variables = $this->parser->getExpressionParser()->parseExpression(); + } + + $only = false; + if ($stream->test(Twig_Token::NAME_TYPE, 'only')) { + $stream->next(); + + $only = true; + } + + $stream->expect(Twig_Token::BLOCK_END_TYPE); + + return array($variables, $only, $ignoreMissing); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'include'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Macro.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Macro.php new file mode 100644 index 0000000..82b4fa6 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Macro.php @@ -0,0 +1,68 @@ + + * {% macro input(name, value, type, size) %} + * + * {% endmacro %} + * + */ +class Twig_TokenParser_Macro extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $lineno = $token->getLine(); + $stream = $this->parser->getStream(); + $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); + + $arguments = $this->parser->getExpressionParser()->parseArguments(true, true); + + $stream->expect(Twig_Token::BLOCK_END_TYPE); + $this->parser->pushLocalScope(); + $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true); + if ($stream->test(Twig_Token::NAME_TYPE)) { + $value = $stream->next()->getValue(); + + if ($value != $name) { + throw new Twig_Error_Syntax(sprintf("Expected endmacro for macro '$name' (but %s given)", $value), $stream->getCurrent()->getLine(), $stream->getFilename()); + } + } + $this->parser->popLocalScope(); + $stream->expect(Twig_Token::BLOCK_END_TYPE); + + $this->parser->setMacro($name, new Twig_Node_Macro($name, new Twig_Node_Body(array($body)), $arguments, $lineno, $this->getTag())); + } + + public function decideBlockEnd(Twig_Token $token) + { + return $token->test('endmacro'); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'macro'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php new file mode 100644 index 0000000..9457325 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php @@ -0,0 +1,68 @@ + + * {% sandbox %} + * {% include 'user.html' %} + * {% endsandbox %} + * + * + * @see http://www.twig-project.org/doc/api.html#sandbox-extension for details + */ +class Twig_TokenParser_Sandbox extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true); + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + + // in a sandbox tag, only include tags are allowed + if (!$body instanceof Twig_Node_Include) { + foreach ($body as $node) { + if ($node instanceof Twig_Node_Text && ctype_space($node->getAttribute('data'))) { + continue; + } + + if (!$node instanceof Twig_Node_Include) { + throw new Twig_Error_Syntax('Only "include" tags are allowed within a "sandbox" section', $node->getLine(), $this->parser->getFilename()); + } + } + } + + return new Twig_Node_Sandbox($body, $token->getLine(), $this->getTag()); + } + + public function decideBlockEnd(Twig_Token $token) + { + return $token->test('endsandbox'); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'sandbox'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Set.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Set.php new file mode 100644 index 0000000..70e0b41 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Set.php @@ -0,0 +1,84 @@ + + * {% set foo = 'foo' %} + * + * {% set foo = [1, 2] %} + * + * {% set foo = {'foo': 'bar'} %} + * + * {% set foo = 'foo' ~ 'bar' %} + * + * {% set foo, bar = 'foo', 'bar' %} + * + * {% set foo %}Some content{% endset %} + * + */ +class Twig_TokenParser_Set extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $lineno = $token->getLine(); + $stream = $this->parser->getStream(); + $names = $this->parser->getExpressionParser()->parseAssignmentExpression(); + + $capture = false; + if ($stream->test(Twig_Token::OPERATOR_TYPE, '=')) { + $stream->next(); + $values = $this->parser->getExpressionParser()->parseMultitargetExpression(); + + $stream->expect(Twig_Token::BLOCK_END_TYPE); + + if (count($names) !== count($values)) { + throw new Twig_Error_Syntax("When using set, you must have the same number of variables and assignments.", $stream->getCurrent()->getLine(), $stream->getFilename()); + } + } else { + $capture = true; + + if (count($names) > 1) { + throw new Twig_Error_Syntax("When using set with a block, you cannot have a multi-target.", $stream->getCurrent()->getLine(), $stream->getFilename()); + } + + $stream->expect(Twig_Token::BLOCK_END_TYPE); + + $values = $this->parser->subparse(array($this, 'decideBlockEnd'), true); + $stream->expect(Twig_Token::BLOCK_END_TYPE); + } + + return new Twig_Node_Set($capture, $names, $values, $lineno, $this->getTag()); + } + + public function decideBlockEnd(Twig_Token $token) + { + return $token->test('endset'); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'set'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php new file mode 100644 index 0000000..1e3fa8f --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php @@ -0,0 +1,59 @@ + + * {% spaceless %} + *
+ * foo + *
+ * {% endspaceless %} + * + * {# output will be
foo
#} + * + */ +class Twig_TokenParser_Spaceless extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $lineno = $token->getLine(); + + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $body = $this->parser->subparse(array($this, 'decideSpacelessEnd'), true); + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + + return new Twig_Node_Spaceless($body, $lineno, $this->getTag()); + } + + public function decideSpacelessEnd(Twig_Token $token) + { + return $token->test('endspaceless'); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'spaceless'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Use.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Use.php new file mode 100644 index 0000000..bc0e09e --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParser/Use.php @@ -0,0 +1,82 @@ + + * {% extends "base.html" %} + * + * {% use "blocks.html" %} + * + * {% block title %}{% endblock %} + * {% block content %}{% endblock %} + * + * + * @see http://www.twig-project.org/doc/templates.html#horizontal-reuse for details. + */ +class Twig_TokenParser_Use extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $template = $this->parser->getExpressionParser()->parseExpression(); + $stream = $this->parser->getStream(); + + if (!$template instanceof Twig_Node_Expression_Constant) { + throw new Twig_Error_Syntax('The template references in a "use" statement must be a string.', $stream->getCurrent()->getLine(), $stream->getFilename()); + } + + $targets = array(); + if ($stream->test('with')) { + $stream->next(); + + do { + $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); + + $alias = $name; + if ($stream->test('as')) { + $stream->next(); + + $alias = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); + } + + $targets[$name] = new Twig_Node_Expression_Constant($alias, -1); + + if (!$stream->test(Twig_Token::PUNCTUATION_TYPE, ',')) { + break; + } + + $stream->next(); + } while (true); + } + + $stream->expect(Twig_Token::BLOCK_END_TYPE); + + $this->parser->addTrait(new Twig_Node(array('template' => $template, 'targets' => new Twig_Node($targets)))); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'use'; + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParserBroker.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParserBroker.php new file mode 100644 index 0000000..ec3fba6 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParserBroker.php @@ -0,0 +1,136 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface +{ + protected $parser; + protected $parsers = array(); + protected $brokers = array(); + + /** + * Constructor. + * + * @param array|Traversable $parsers A Traversable of Twig_TokenParserInterface instances + * @param array|Traversable $brokers A Traversable of Twig_TokenParserBrokerInterface instances + */ + public function __construct($parsers = array(), $brokers = array()) + { + foreach ($parsers as $parser) { + if (!$parser instanceof Twig_TokenParserInterface) { + throw new LogicException('$parsers must a an array of Twig_TokenParserInterface'); + } + $this->parsers[$parser->getTag()] = $parser; + } + foreach ($brokers as $broker) { + if (!$broker instanceof Twig_TokenParserBrokerInterface) { + throw new LogicException('$brokers must a an array of Twig_TokenParserBrokerInterface'); + } + $this->brokers[] = $broker; + } + } + + /** + * Adds a TokenParser. + * + * @param Twig_TokenParserInterface $parser A Twig_TokenParserInterface instance + */ + public function addTokenParser(Twig_TokenParserInterface $parser) + { + $this->parsers[$parser->getTag()] = $parser; + } + + /** + * Removes a TokenParser. + * + * @param Twig_TokenParserInterface $parser A Twig_TokenParserInterface instance + */ + public function removeTokenParser(Twig_TokenParserInterface $parser) + { + $name = $parser->getTag(); + if (isset($this->parsers[$name]) && $parser === $this->parsers[$name]) { + unset($this->parsers[$name]); + } + } + + /** + * Adds a TokenParserBroker. + * + * @param Twig_TokenParserBroker $broker A Twig_TokenParserBroker instance + */ + public function addTokenParserBroker(Twig_TokenParserBroker $broker) + { + $this->brokers[] = $broker; + } + + /** + * Removes a TokenParserBroker. + * + * @param Twig_TokenParserBroker $broker A Twig_TokenParserBroker instance + */ + public function removeTokenParserBroker(Twig_TokenParserBroker $broker) + { + if (false !== $pos = array_search($broker, $this->brokers)) { + unset($this->brokers[$pos]); + } + } + + /** + * Gets a suitable TokenParser for a tag. + * + * First looks in parsers, then in brokers. + * + * @param string $tag A tag name + * + * @return null|Twig_TokenParserInterface A Twig_TokenParserInterface or null if no suitable TokenParser was found + */ + public function getTokenParser($tag) + { + if (isset($this->parsers[$tag])) { + return $this->parsers[$tag]; + } + $broker = end($this->brokers); + while (false !== $broker) { + $parser = $broker->getTokenParser($tag); + if (null !== $parser) { + return $parser; + } + $broker = prev($this->brokers); + } + } + + public function getParsers() + { + return $this->parsers; + } + + public function getParser() + { + return $this->parser; + } + + public function setParser(Twig_ParserInterface $parser) + { + $this->parser = $parser; + foreach ($this->parsers as $tokenParser) { + $tokenParser->setParser($parser); + } + foreach ($this->brokers as $broker) { + $broker->setParser($parser); + } + } +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php new file mode 100644 index 0000000..3f006e3 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php @@ -0,0 +1,45 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_TokenParserBrokerInterface +{ + /** + * Gets a TokenParser suitable for a tag. + * + * @param string $tag A tag name + * + * @return null|Twig_TokenParserInterface A Twig_TokenParserInterface or null if no suitable TokenParser was found + */ + public function getTokenParser($tag); + + /** + * Calls Twig_TokenParserInterface::setParser on all parsers the implementation knows of. + * + * @param Twig_ParserInterface $parser A Twig_ParserInterface interface + */ + public function setParser(Twig_ParserInterface $parser); + + /** + * Gets the Twig_ParserInterface. + * + * @return null|Twig_ParserInterface A Twig_ParserInterface instance or null + */ + public function getParser(); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParserInterface.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParserInterface.php new file mode 100644 index 0000000..bbde771 --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenParserInterface.php @@ -0,0 +1,41 @@ + + */ +interface Twig_TokenParserInterface +{ + /** + * Sets the parser associated with this token parser + * + * @param $parser A Twig_Parser instance + */ + public function setParser(Twig_Parser $parser); + + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token); + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag(); +} diff --git a/sources/phpBB/vendor/twig/twig/lib/Twig/TokenStream.php b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenStream.php new file mode 100644 index 0000000..a78189f --- /dev/null +++ b/sources/phpBB/vendor/twig/twig/lib/Twig/TokenStream.php @@ -0,0 +1,144 @@ + + */ +class Twig_TokenStream +{ + protected $tokens; + protected $current; + protected $filename; + + /** + * Constructor. + * + * @param array $tokens An array of tokens + * @param string $filename The name of the filename which tokens are associated with + */ + public function __construct(array $tokens, $filename = null) + { + $this->tokens = $tokens; + $this->current = 0; + $this->filename = $filename; + } + + /** + * Returns a string representation of the token stream. + * + * @return string + */ + public function __toString() + { + return implode("\n", $this->tokens); + } + + public function injectTokens(array $tokens) + { + $this->tokens = array_merge(array_slice($this->tokens, 0, $this->current), $tokens, array_slice($this->tokens, $this->current)); + } + + /** + * Sets the pointer to the next token and returns the old one. + * + * @return Twig_Token + */ + public function next() + { + if (!isset($this->tokens[++$this->current])) { + throw new Twig_Error_Syntax('Unexpected end of template', $this->tokens[$this->current - 1]->getLine(), $this->filename); + } + + return $this->tokens[$this->current - 1]; + } + + /** + * Tests a token and returns it or throws a syntax error. + * + * @return Twig_Token + */ + public function expect($type, $value = null, $message = null) + { + $token = $this->tokens[$this->current]; + if (!$token->test($type, $value)) { + $line = $token->getLine(); + throw new Twig_Error_Syntax(sprintf('%sUnexpected token "%s" of value "%s" ("%s" expected%s)', + $message ? $message.'. ' : '', + Twig_Token::typeToEnglish($token->getType(), $line), $token->getValue(), + Twig_Token::typeToEnglish($type, $line), $value ? sprintf(' with value "%s"', $value) : ''), + $line, + $this->filename + ); + } + $this->next(); + + return $token; + } + + /** + * Looks at the next token. + * + * @param integer $number + * + * @return Twig_Token + */ + public function look($number = 1) + { + if (!isset($this->tokens[$this->current + $number])) { + throw new Twig_Error_Syntax('Unexpected end of template', $this->tokens[$this->current + $number - 1]->getLine(), $this->filename); + } + + return $this->tokens[$this->current + $number]; + } + + /** + * Tests the current token + * + * @return bool + */ + public function test($primary, $secondary = null) + { + return $this->tokens[$this->current]->test($primary, $secondary); + } + + /** + * Checks if end of stream was reached + * + * @return bool + */ + public function isEOF() + { + return $this->tokens[$this->current]->getType() === Twig_Token::EOF_TYPE; + } + + /** + * Gets the current token + * + * @return Twig_Token + */ + public function getCurrent() + { + return $this->tokens[$this->current]; + } + + /** + * Gets the filename associated with this stream + * + * @return string + */ + public function getFilename() + { + return $this->filename; + } +} diff --git a/sources/phpBB/viewforum.php b/sources/phpBB/viewforum.php new file mode 100644 index 0000000..92ac917 --- /dev/null +++ b/sources/phpBB/viewforum.php @@ -0,0 +1,930 @@ + +* @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); +$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 +$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); + +$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); + +$pagination = $phpbb_container->get('pagination'); + +// Check if the user has actually sent a forum ID with his/her request +// If not give them a nice error page. +if (!$forum_id) +{ + trigger_error('NO_FORUM'); +} + +$sql_from = FORUMS_TABLE . ' f'; +$lastread_select = ''; + +// Grab appropriate forum data +if ($config['load_db_lastread'] && $user->data['is_registered']) +{ + $sql_from .= ' LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' + AND ft.forum_id = f.forum_id)'; + $lastread_select .= ', ft.mark_time'; +} + +if ($user->data['is_registered']) +{ + $sql_from .= ' LEFT JOIN ' . FORUMS_WATCH_TABLE . ' fw ON (fw.forum_id = f.forum_id AND fw.user_id = ' . $user->data['user_id'] . ')'; + $lastread_select .= ', fw.notify_status'; +} + +$sql = "SELECT f.* $lastread_select + FROM $sql_from + WHERE f.forum_id = $forum_id"; +$result = $db->sql_query($sql); +$forum_data = $db->sql_fetchrow($result); +$db->sql_freeresult($result); + +if (!$forum_data) +{ + trigger_error('NO_FORUM'); +} + + +// Configure style, language, etc. +$user->setup('viewforum', $forum_data['forum_style']); + +// Redirect to login upon emailed notification links +if (isset($_GET['e']) && !$user->data['is_registered']) +{ + login_box('', $user->lang['LOGIN_NOTIFY_FORUM']); +} + +// Permissions check +if (!$auth->acl_gets('f_list', 'f_read', $forum_id) || ($forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link'] && !$auth->acl_get('f_read', $forum_id))) +{ + if ($user->data['user_id'] != ANONYMOUS) + { + trigger_error('SORRY_AUTH_READ'); + } + + login_box('', $user->lang['LOGIN_VIEWFORUM']); +} + +// Forum is passworded ... check whether access has been granted to this +// user this session, if not show login box +if ($forum_data['forum_password']) +{ + login_forum_box($forum_data); +} + +// Is this forum a link? ... User got here either because the +// number of clicks is being tracked or they guessed the id +if ($forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link']) +{ + // Does it have click tracking enabled? + if ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) + { + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET forum_posts_approved = forum_posts_approved + 1 + WHERE forum_id = ' . $forum_id; + $db->sql_query($sql); + } + + // We redirect to the url. The third parameter indicates that external redirects are allowed. + redirect($forum_data['forum_link'], false, true); + return; +} + +// Build navigation links +generate_forum_nav($forum_data); + +// Forum Rules +if ($auth->acl_get('f_read', $forum_id)) +{ + generate_forum_rules($forum_data); +} + +// Do we have subforums? +$active_forum_ary = $moderators = array(); + +if ($forum_data['left_id'] != $forum_data['right_id'] - 1) +{ + list($active_forum_ary, $moderators) = display_forums($forum_data, $config['load_moderators'], $config['load_moderators']); +} +else +{ + $template->assign_var('S_HAS_SUBFORUM', false); + if ($config['load_moderators']) + { + get_moderators($moderators, $forum_id); + } +} + +$phpbb_content_visibility = $phpbb_container->get('content.visibility'); + +// Dump out the page header and load viewforum template +$topics_count = $phpbb_content_visibility->get_count('forum_topics', $forum_data, $forum_id); +$start = $pagination->validate_start($start, $config['topics_per_page'], $topics_count); + +page_header($forum_data['forum_name'] . ($start ? ' - ' . $user->lang('PAGE_TITLE_NUMBER', $pagination->get_on_page($config['topics_per_page'], $start)) : ''), true, $forum_id); + +$template->set_filenames(array( + 'body' => 'viewforum_body.html') +); + +make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"), $forum_id); + +$template->assign_vars(array( + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . (($start == 0) ? '' : "&start=$start")), +)); + +// Not postable forum or showing active topics? +if (!($forum_data['forum_type'] == FORUM_POST || (($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) && $forum_data['forum_type'] == FORUM_CAT))) +{ + page_footer(); +} + +// Ok, if someone has only list-access, we only display the forum list. +// We also make this circumstance available to the template in case we want to display a notice. ;) +if (!$auth->acl_get('f_read', $forum_id)) +{ + $template->assign_vars(array( + 'S_NO_READ_ACCESS' => true, + )); + + page_footer(); +} + +// Handle marking posts +if ($mark_read == 'topics') +{ + $token = request_var('hash', ''); + if (check_link_hash($token, 'global')) + { + markread('topics', array($forum_id), false, request_var('mark_time', 0)); + } + $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); + meta_refresh(3, $redirect_url); + + if ($request->is_ajax()) + { + // Tell the ajax script what language vars and URL need to be replaced + $data = array( + 'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'], + 'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'], + 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . "&f=$forum_id&mark=topics&mark_time=" . time()) : '', + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $user->lang['TOPICS_MARKED'] + ); + $json_response = new \phpbb\json_response(); + $json_response->send($data); + } + + trigger_error($user->lang['TOPICS_MARKED'] . '

' . sprintf($user->lang['RETURN_FORUM'], '', '')); +} + +// Is a forum specific topic count required? +if ($forum_data['forum_topics_per_page']) +{ + $config['topics_per_page'] = $forum_data['forum_topics_per_page']; +} + +// Do the forum Prune thang - cron type job ... +if (!$config['use_system_cron']) +{ + $cron = $phpbb_container->get('cron.manager'); + + $task = $cron->find_task('cron.task.core.prune_forum'); + $task->set_forum_data($forum_data); + + if ($task->is_ready()) + { + $url = $task->get_url(); + $template->assign_var('RUN_CRON_TASK', 'cron'); + } + else + { + // See if we should prune the shadow topics instead + $task = $cron->find_task('cron.task.core.prune_shadow_topics'); + $task->set_forum_data($forum_data); + + if ($task->is_ready()) + { + $url = $task->get_url(); + $template->assign_var('RUN_CRON_TASK', 'cron'); + } + } +} + +// Forum rules and subscription info +$s_watching_forum = array( + 'link' => '', + 'link_toggle' => '', + 'title' => '', + 'title_toggle' => '', + 'is_watching' => false, +); + +if ($config['allow_forum_notify'] && $forum_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_subscribe', $forum_id) || $user->data['user_id'] == ANONYMOUS)) +{ + $notify_status = (isset($forum_data['notify_status'])) ? $forum_data['notify_status'] : NULL; + watch_topic_forum('forum', $s_watching_forum, $user->data['user_id'], $forum_id, 0, $notify_status, $start, $forum_data['forum_name']); +} + +$s_forum_rules = ''; +gen_forum_auth_level('forum', $forum_id, $forum_data['forum_status']); + +// Topic ordering options +$limit_days = array(0 => $user->lang['ALL_TOPICS'], 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['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']); +$sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => array('t.topic_last_post_time', 't.topic_last_post_id'), 'r' => (($auth->acl_get('m_approve', $forum_id)) ? 't.topic_posts_approved + t.topic_posts_unapproved + t.topic_posts_softdeleted' : 't.topic_posts_approved'), 's' => 't.topic_title', 'v' => 't.topic_views'); + +$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, $default_sort_days, $default_sort_key, $default_sort_dir); + +// Limit topics to certain time frame, obtain correct topic count +if ($sort_days) +{ + $min_post_time = time() - ($sort_days * 86400); + + $sql = 'SELECT COUNT(topic_id) AS num_topics + FROM ' . TOPICS_TABLE . " + WHERE forum_id = $forum_id + AND (topic_last_post_time >= $min_post_time + OR topic_type = " . POST_ANNOUNCE . ' + OR topic_type = ' . POST_GLOBAL . ') + AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id); + $result = $db->sql_query($sql); + $topics_count = (int) $db->sql_fetchfield('num_topics'); + $db->sql_freeresult($result); + + if (isset($_POST['sort'])) + { + $start = 0; + } + $sql_limit_time = "AND t.topic_last_post_time >= $min_post_time"; + + // Make sure we have information about day selection ready + $template->assign_var('S_SORT_DAYS', true); +} +else +{ + $sql_limit_time = ''; +} + +// Basic pagewide vars +$post_alt = ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['FORUM_LOCKED'] : $user->lang['POST_NEW_TOPIC']; + +// Display active topics? +$s_display_active = ($forum_data['forum_type'] == FORUM_CAT && ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false; + +$s_search_hidden_fields = array('fid' => array($forum_id)); +if ($_SID) +{ + $s_search_hidden_fields['sid'] = $_SID; +} + +if (!empty($_EXTRA_URL)) +{ + foreach ($_EXTRA_URL as $url_param) + { + $url_param = explode('=', $url_param, 2); + $s_search_hidden_fields[$url_param[0]] = $url_param[1]; + } +} + +$template->assign_vars(array( + 'MODERATORS' => (!empty($moderators[$forum_id])) ? implode($user->lang['COMMA_SEPARATOR'], $moderators[$forum_id]) : '', + + 'POST_IMG' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', $post_alt) : $user->img('button_topic_new', $post_alt), + 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'), + 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), + 'FOLDER_IMG' => $user->img('topic_read', 'NO_UNREAD_POSTS'), + 'FOLDER_UNREAD_IMG' => $user->img('topic_unread', 'UNREAD_POSTS'), + 'FOLDER_HOT_IMG' => $user->img('topic_read_hot', 'NO_UNREAD_POSTS_HOT'), + 'FOLDER_HOT_UNREAD_IMG' => $user->img('topic_unread_hot', 'UNREAD_POSTS_HOT'), + 'FOLDER_LOCKED_IMG' => $user->img('topic_read_locked', 'NO_UNREAD_POSTS_LOCKED'), + 'FOLDER_LOCKED_UNREAD_IMG' => $user->img('topic_unread_locked', 'UNREAD_POSTS_LOCKED'), + 'FOLDER_STICKY_IMG' => $user->img('sticky_read', 'POST_STICKY'), + 'FOLDER_STICKY_UNREAD_IMG' => $user->img('sticky_unread', 'POST_STICKY'), + 'FOLDER_ANNOUNCE_IMG' => $user->img('announce_read', 'POST_ANNOUNCEMENT'), + 'FOLDER_ANNOUNCE_UNREAD_IMG'=> $user->img('announce_unread', 'POST_ANNOUNCEMENT'), + 'FOLDER_MOVED_IMG' => $user->img('topic_moved', 'TOPIC_MOVED'), + 'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'), + 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'), + 'DELETED_IMG' => $user->img('icon_topic_deleted', 'TOPIC_DELETED'), + 'POLL_IMG' => $user->img('icon_topic_poll', 'TOPIC_POLL'), + 'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'), + + 'L_NO_TOPICS' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['POST_FORUM_LOCKED'] : $user->lang['NO_TOPICS'], + + 'S_DISPLAY_POST_INFO' => ($forum_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false, + + 'S_IS_POSTABLE' => ($forum_data['forum_type'] == FORUM_POST) ? true : false, + 'S_USER_CAN_POST' => ($auth->acl_get('f_post', $forum_id)) ? true : false, + 'S_DISPLAY_ACTIVE' => $s_display_active, + 'S_SELECT_SORT_DIR' => $s_sort_dir, + 'S_SELECT_SORT_KEY' => $s_sort_key, + 'S_SELECT_SORT_DAYS' => $s_limit_days, + 'S_TOPIC_ICONS' => ($s_display_active && sizeof($active_forum_ary)) ? max($active_forum_ary['enable_icons']) : (($forum_data['enable_icons']) ? true : false), + 'U_WATCH_FORUM_LINK' => $s_watching_forum['link'], + 'U_WATCH_FORUM_TOGGLE' => $s_watching_forum['link_toggle'], + 'S_WATCH_FORUM_TITLE' => $s_watching_forum['title'], + 'S_WATCH_FORUM_TOGGLE' => $s_watching_forum['title_toggle'], + 'S_WATCHING_FORUM' => $s_watching_forum['is_watching'], + 'S_FORUM_ACTION' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . (($start == 0) ? '' : "&start=$start")), + 'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false, + 'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx"), + 'S_SEARCH_LOCAL_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields), + 'S_SINGLE_MODERATOR' => (!empty($moderators[$forum_id]) && sizeof($moderators[$forum_id]) > 1) ? false : true, + 'S_IS_LOCKED' => ($forum_data['forum_status'] == ITEM_LOCKED) ? true : false, + 'S_VIEWFORUM' => true, + + 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", true, $user->session_id) : '', + 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&f=' . $forum_id) : '', + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . (($start == 0) ? '' : "&start=$start")), + 'U_CANONICAL' => generate_board_url() . '/' . append_sid("viewforum.$phpEx", "f=$forum_id" . (($start) ? "&start=$start" : ''), true, ''), + 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . "&f=$forum_id&mark=topics&mark_time=" . time()) : '', +)); + +// Grab icons +$icons = $cache->obtain_icons(); + +// Grab all topic data +$rowset = $announcement_list = $topic_list = $global_announce_forums = array(); + +$sql_array = array( + 'SELECT' => 't.*', + 'FROM' => array( + TOPICS_TABLE => 't' + ), + 'LEFT_JOIN' => array(), +); + +/** +* Event to modify the SQL query before the topic data is retrieved +* +* @event core.viewforum_get_topic_data +* @var array forum_data Array with forum data +* @var array sql_array The SQL array to get the data of all topics +* @since 3.1.0-a1 +* @change 3.1.0-RC4 Added forum_data var +*/ +$vars = array( + 'forum_data', + 'sql_array', +); +extract($phpbb_dispatcher->trigger_event('core.viewforum_get_topic_data', compact($vars))); + +$sql_approved = ' AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.'); + +if ($user->data['is_registered']) +{ + if ($config['load_db_track']) + { + $sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_POSTED_TABLE => 'tp'), 'ON' => 'tp.topic_id = t.topic_id AND tp.user_id = ' . $user->data['user_id']); + $sql_array['SELECT'] .= ', tp.topic_posted'; + } + + if ($config['load_db_lastread']) + { + $sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_TRACK_TABLE => 'tt'), 'ON' => 'tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id']); + $sql_array['SELECT'] .= ', tt.mark_time'; + + if ($s_display_active && sizeof($active_forum_ary)) + { + $sql_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TRACK_TABLE => 'ft'), 'ON' => 'ft.forum_id = t.forum_id AND ft.user_id = ' . $user->data['user_id']); + $sql_array['SELECT'] .= ', ft.mark_time AS forum_mark_time'; + } + } +} + +if ($forum_data['forum_type'] == FORUM_POST) +{ + // Get global announcement forums + $g_forum_ary = $auth->acl_getf('f_read', true); + $g_forum_ary = array_unique(array_keys($g_forum_ary)); + + $sql_anounce_array['LEFT_JOIN'] = $sql_array['LEFT_JOIN']; + $sql_anounce_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TABLE => 'f'), 'ON' => 'f.forum_id = t.forum_id'); + $sql_anounce_array['SELECT'] = $sql_array['SELECT'] . ', f.forum_name'; + + // Obtain announcements ... removed sort ordering, sort by time in all cases + $sql_ary = array( + 'SELECT' => $sql_anounce_array['SELECT'], + 'FROM' => $sql_array['FROM'], + 'LEFT_JOIN' => $sql_anounce_array['LEFT_JOIN'], + + 'WHERE' => '(t.forum_id = ' . $forum_id . ' + AND t.topic_type = ' . POST_ANNOUNCE . ') OR + (' . $db->sql_in_set('t.forum_id', $g_forum_ary) . ' + AND t.topic_type = ' . POST_GLOBAL . ')', + + 'ORDER_BY' => 't.topic_time DESC', + ); + $sql = $db->sql_build_query('SELECT', $sql_ary); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['topic_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $row['forum_id'])) + { + // Do not display announcements that are waiting for approval or soft deleted. + continue; + } + + $rowset[$row['topic_id']] = $row; + $announcement_list[] = $row['topic_id']; + + if ($forum_id != $row['forum_id']) + { + $topics_count++; + $global_announce_forums[] = $row['forum_id']; + } + } + $db->sql_freeresult($result); +} + +$forum_tracking_info = array(); + +if ($user->data['is_registered'] && $config['load_db_lastread']) +{ + $forum_tracking_info[$forum_id] = $forum_data['mark_time']; + + if (!empty($global_announce_forums)) + { + $sql = 'SELECT forum_id, mark_time + FROM ' . FORUMS_TRACK_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $global_announce_forums) . ' + AND user_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_tracking_info[$row['forum_id']] = $row['mark_time']; + } + $db->sql_freeresult($result); + } +} + +// If the user is trying to reach late pages, start searching from the end +$store_reverse = false; +$sql_limit = $config['topics_per_page']; +if ($start > $topics_count / 2) +{ + $store_reverse = true; + + // Select the sort order + $direction = (($sort_dir == 'd') ? 'ASC' : 'DESC'); + + $sql_limit = $pagination->reverse_limit($start, $sql_limit, $topics_count - sizeof($announcement_list)); + $sql_start = $pagination->reverse_start($start, $sql_limit, $topics_count - sizeof($announcement_list)); +} +else +{ + // Select the sort order + $direction = (($sort_dir == 'd') ? 'DESC' : 'ASC'); + $sql_start = $start; +} + +if (is_array($sort_by_sql[$sort_key])) +{ + $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; +} +else +{ + $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; +} + +if ($forum_data['forum_type'] == FORUM_POST || !sizeof($active_forum_ary)) +{ + $sql_where = 't.forum_id = ' . $forum_id; +} +else if (empty($active_forum_ary['exclude_forum_id'])) +{ + $sql_where = $db->sql_in_set('t.forum_id', $active_forum_ary['forum_id']); +} +else +{ + $get_forum_ids = array_diff($active_forum_ary['forum_id'], $active_forum_ary['exclude_forum_id']); + $sql_where = (sizeof($get_forum_ids)) ? $db->sql_in_set('t.forum_id', $get_forum_ids) : 't.forum_id = ' . $forum_id; +} + +// Grab just the sorted topic ids +$sql_ary = array( + 'SELECT' => 't.topic_id', + 'FROM' => array( + TOPICS_TABLE => 't', + ), + 'WHERE' => "$sql_where + AND t.topic_type IN (" . POST_NORMAL . ', ' . POST_STICKY . ") + $sql_approved + $sql_limit_time", + 'ORDER_BY' => 't.topic_type ' . ((!$store_reverse) ? 'DESC' : 'ASC') . ', ' . $sql_sort_order, +); + +/** +* Event to modify the SQL query before the topic ids data is retrieved +* +* @event core.viewforum_get_topic_ids_data +* @var array forum_data Data about the forum +* @var array sql_ary SQL query array to get the topic ids data +* @var string sql_approved Topic visibility SQL string +* @var int sql_limit Number of records to select +* @var string sql_limit_time SQL string to limit topic_last_post_time data +* @var array sql_sort_order SQL sorting string +* @var int sql_start Offset point to start selection from +* @var string sql_where SQL WHERE clause string +* @var bool store_reverse Flag indicating if we select from the late pages +* +* @since 3.1.0-RC4 +* +* @changed 3.1.3 Added forum_data +*/ +$vars = array( + 'forum_data', + 'sql_ary', + 'sql_approved', + 'sql_limit', + 'sql_limit_time', + 'sql_sort_order', + 'sql_start', + 'sql_where', + 'store_reverse', +); +extract($phpbb_dispatcher->trigger_event('core.viewforum_get_topic_ids_data', compact($vars))); + +$sql = $db->sql_build_query('SELECT', $sql_ary); +$result = $db->sql_query_limit($sql, $sql_limit, $sql_start); + +while ($row = $db->sql_fetchrow($result)) +{ + $topic_list[] = (int) $row['topic_id']; +} +$db->sql_freeresult($result); + +// For storing shadow topics +$shadow_topic_list = array(); + +if (sizeof($topic_list)) +{ + // SQL array for obtaining topics/stickies + $sql_array = array( + 'SELECT' => $sql_array['SELECT'], + 'FROM' => $sql_array['FROM'], + 'LEFT_JOIN' => $sql_array['LEFT_JOIN'], + + 'WHERE' => $db->sql_in_set('t.topic_id', $topic_list), + ); + + // If store_reverse, then first obtain topics, then stickies, else the other way around... + // Funnily enough you typically save one query if going from the last page to the middle (store_reverse) because + // the number of stickies are not known + $sql = $db->sql_build_query('SELECT', $sql_array); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['topic_status'] == ITEM_MOVED) + { + $shadow_topic_list[$row['topic_moved_id']] = $row['topic_id']; + } + + $rowset[$row['topic_id']] = $row; + } + $db->sql_freeresult($result); +} + +// If we have some shadow topics, update the rowset to reflect their topic information +if (sizeof($shadow_topic_list)) +{ + // SQL array for obtaining shadow topics + $sql_array = array( + 'SELECT' => 't.*', + 'FROM' => array( + TOPICS_TABLE => 't' + ), + 'WHERE' => $db->sql_in_set('t.topic_id', array_keys($shadow_topic_list)), + ); + + /** + * Event to modify the SQL query before the shadowtopic data is retrieved + * + * @event core.viewforum_get_shadowtopic_data + * @var array sql_array SQL array to get the data of any shadowtopics + * @since 3.1.0-a1 + */ + $vars = array('sql_array'); + extract($phpbb_dispatcher->trigger_event('core.viewforum_get_shadowtopic_data', compact($vars))); + + $sql = $db->sql_build_query('SELECT', $sql_array); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $orig_topic_id = $shadow_topic_list[$row['topic_id']]; + + // If the shadow topic is already listed within the rowset (happens for active topics for example), then do not include it... + if (isset($rowset[$row['topic_id']])) + { + // We need to remove any trace regarding this topic. :) + unset($rowset[$orig_topic_id]); + unset($topic_list[array_search($orig_topic_id, $topic_list)]); + $topics_count--; + + continue; + } + + // Do not include those topics the user has no permission to access + if (!$auth->acl_get('f_read', $row['forum_id'])) + { + // We need to remove any trace regarding this topic. :) + unset($rowset[$orig_topic_id]); + unset($topic_list[array_search($orig_topic_id, $topic_list)]); + $topics_count--; + + continue; + } + + // We want to retain some values + $row = array_merge($row, array( + 'topic_moved_id' => $rowset[$orig_topic_id]['topic_moved_id'], + 'topic_status' => $rowset[$orig_topic_id]['topic_status'], + 'topic_type' => $rowset[$orig_topic_id]['topic_type'], + 'topic_title' => $rowset[$orig_topic_id]['topic_title'], + )); + + // Shadow topics are never reported + $row['topic_reported'] = 0; + + $rowset[$orig_topic_id] = $row; + } + $db->sql_freeresult($result); +} +unset($shadow_topic_list); + +// Ok, adjust topics count for active topics list +if ($s_display_active) +{ + $topics_count = 1; +} + +// We need to remove the global announcements from the forums total topic count, +// otherwise the number is different from the one on the forum list +$total_topic_count = $topics_count - sizeof($announcement_list); + +$base_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '')); +$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_topic_count, $config['topics_per_page'], $start); + +$template->assign_vars(array( + 'TOTAL_TOPICS' => ($s_display_active) ? false : $user->lang('VIEW_FORUM_TOPICS', (int) $total_topic_count), +)); + +$topic_list = ($store_reverse) ? array_merge($announcement_list, array_reverse($topic_list)) : array_merge($announcement_list, $topic_list); +$topic_tracking_info = $tracking_topics = array(); + +/** +* Modify topics data before we display the viewforum page +* +* @event core.viewforum_modify_topics_data +* @var array topic_list Array with current viewforum page topic ids +* @var array rowset Array with topics data (in topic_id => topic_data format) +* @var int total_topic_count Forum's total topic count +* @since 3.1.0-b3 +*/ +$vars = array('topic_list', 'rowset', 'total_topic_count'); +extract($phpbb_dispatcher->trigger_event('core.viewforum_modify_topics_data', compact($vars))); + +// Okay, lets dump out the page ... +if (sizeof($topic_list)) +{ + $mark_forum_read = true; + $mark_time_forum = 0; + + // Generate topic forum list... + $topic_forum_list = array(); + foreach ($rowset as $t_id => $row) + { + if (isset($forum_tracking_info[$row['forum_id']])) + { + $row['forum_mark_time'] = $forum_tracking_info[$row['forum_id']]; + } + + $topic_forum_list[$row['forum_id']]['forum_mark_time'] = ($config['load_db_lastread'] && $user->data['is_registered'] && isset($row['forum_mark_time'])) ? $row['forum_mark_time'] : 0; + $topic_forum_list[$row['forum_id']]['topics'][] = (int) $t_id; + } + + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + foreach ($topic_forum_list as $f_id => $topic_row) + { + $topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time'])); + } + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + foreach ($topic_forum_list as $f_id => $topic_row) + { + $topic_tracking_info += get_complete_topic_tracking($f_id, $topic_row['topics']); + } + } + + unset($topic_forum_list); + + if (!$s_display_active) + { + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + $mark_time_forum = (!empty($forum_data['mark_time'])) ? $forum_data['mark_time'] : $user->data['user_lastmark']; + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + if (!$user->data['is_registered']) + { + $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0; + } + $mark_time_forum = (isset($tracking_topics['f'][$forum_id])) ? (int) (base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate']) : $user->data['user_lastmark']; + } + } + + $s_type_switch = 0; + foreach ($topic_list as $topic_id) + { + $row = &$rowset[$topic_id]; + + $topic_forum_id = ($row['forum_id']) ? (int) $row['forum_id'] : $forum_id; + + // This will allow the style designer to output a different header + // or even separate the list of announcements from sticky and normal topics + $s_type_switch_test = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0; + + // Replies + $replies = $phpbb_content_visibility->get_count('topic_posts', $row, $topic_forum_id) - 1; + + if ($row['topic_status'] == ITEM_MOVED) + { + $topic_id = $row['topic_moved_id']; + $unread_topic = false; + } + else + { + $unread_topic = (isset($topic_tracking_info[$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false; + } + + // Get folder img, topic status/type related information + $folder_img = $folder_alt = $topic_type = ''; + topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type); + + // Generate all the URIs ... + $view_topic_url_params = 'f=' . $row['forum_id'] . '&t=' . $topic_id; + $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params); + + $topic_unapproved = (($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $row['forum_id'])); + $posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $row['forum_id'])); + $topic_deleted = $row['topic_visibility'] == ITEM_DELETED; + + $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$topic_id", true, $user->session_id) : ''; + $u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=deleted_topics&t=' . $topic_id, true, $user->session_id) : $u_mcp_queue; + + // Send vars to template + $topic_row = array( + 'FORUM_ID' => $row['forum_id'], + 'TOPIC_ID' => $topic_id, + 'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'TOPIC_AUTHOR_FULL' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), + 'LAST_POST_SUBJECT' => censor_text($row['topic_last_post_subject']), + 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), + 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), + 'LAST_POST_AUTHOR' => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + + 'REPLIES' => $replies, + 'VIEWS' => $row['topic_views'], + 'TOPIC_TITLE' => censor_text($row['topic_title']), + 'TOPIC_TYPE' => $topic_type, + 'FORUM_NAME' => (isset($row['forum_name'])) ? $row['forum_name'] : $forum_data['forum_name'], + + 'TOPIC_IMG_STYLE' => $folder_img, + 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), + 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], + + 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', + 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', + 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '', + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + 'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '', + + 'S_TOPIC_TYPE' => $row['topic_type'], + 'S_USER_POSTED' => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false, + 'S_UNREAD_TOPIC' => $unread_topic, + 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false, + 'S_TOPIC_UNAPPROVED' => $topic_unapproved, + 'S_POSTS_UNAPPROVED' => $posts_unapproved, + 'S_TOPIC_DELETED' => $topic_deleted, + 'S_HAS_POLL' => ($row['poll_start']) ? true : false, + 'S_POST_ANNOUNCE' => ($row['topic_type'] == POST_ANNOUNCE) ? true : false, + 'S_POST_GLOBAL' => ($row['topic_type'] == POST_GLOBAL) ? true : false, + 'S_POST_STICKY' => ($row['topic_type'] == POST_STICKY) ? true : false, + 'S_TOPIC_LOCKED' => ($row['topic_status'] == ITEM_LOCKED) ? true : false, + 'S_TOPIC_MOVED' => ($row['topic_status'] == ITEM_MOVED) ? true : false, + + 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&view=unread') . '#unread', + 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], + 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), + 'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), + 'U_VIEW_TOPIC' => $view_topic_url, + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']), + 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&f=' . $row['forum_id'] . '&t=' . $topic_id, true, $user->session_id), + 'U_MCP_QUEUE' => $u_mcp_queue, + + 'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test, + ); + + /** + * Modify the topic data before it is assigned to the template + * + * @event core.viewforum_modify_topicrow + * @var array row Array with topic data + * @var array topic_row Template array with topic data + * @since 3.1.0-a1 + */ + $vars = array('row', 'topic_row'); + extract($phpbb_dispatcher->trigger_event('core.viewforum_modify_topicrow', compact($vars))); + + $template->assign_block_vars('topicrow', $topic_row); + + $pagination->generate_template_pagination($view_topic_url, 'topicrow.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true); + + $s_type_switch = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0; + + /** + * Event after the topic data has been assigned to the template + * + * @event core.viewforum_topic_row_after + * @var array row Array with the topic data + * @var array rowset Array with topics data (in topic_id => topic_data format) + * @var bool s_type_switch Flag indicating if the topic type is [global] announcement + * @var int topic_id The topic ID + * @var array topic_list Array with current viewforum page topic ids + * @var array topic_row Template array with topic data + * @since 3.1.3-RC1 + */ + $vars = array( + 'row', + 'rowset', + 's_type_switch', + 'topic_id', + 'topic_list', + 'topic_row', + ); + extract($phpbb_dispatcher->trigger_event('core.viewforum_topic_row_after', compact($vars))); + + if ($unread_topic) + { + $mark_forum_read = false; + } + + unset($rowset[$topic_id]); + } +} + +// This is rather a fudge but it's the best I can think of without requiring information +// on all topics (as we do in 2.0.x). It looks for unread or new topics, if it doesn't find +// any it updates the forum last read cookie. This requires that the user visit the forum +// after reading a topic +if ($forum_data['forum_type'] == FORUM_POST && sizeof($topic_list) && $mark_forum_read) +{ + update_forum_tracking_info($forum_id, $forum_data['forum_last_post_time'], false, $mark_time_forum); +} + +page_footer(); diff --git a/sources/phpBB/viewonline.php b/sources/phpBB/viewonline.php new file mode 100644 index 0000000..9589fb5 --- /dev/null +++ b/sources/phpBB/viewonline.php @@ -0,0 +1,485 @@ + +* @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); +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +include($phpbb_root_path . 'common.' . $phpEx); + +// Start session management +$user->session_begin(); +$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; + +// Can this user view profiles/memberlist? +if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) +{ + if ($user->data['user_id'] != ANONYMOUS) + { + trigger_error('NO_VIEW_USERS'); + } + + login_box('', $user->lang['LOGIN_EXPLAIN_VIEWONLINE']); +} + +$pagination = $phpbb_container->get('pagination'); +$viewonline_helper = $phpbb_container->get('viewonline_helper'); + +$sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_JOINED'], 'c' => $user->lang['SORT_LOCATION']); +$sort_key_sql = array('a' => 'u.username_clean', 'b' => 's.session_time', 'c' => 's.session_page'); + +// Sorting and order +if (!isset($sort_key_text[$sort_key])) +{ + $sort_key = 'b'; +} + +$order_by = $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); + +// Whois requested +if ($mode == 'whois' && $auth->acl_get('a_') && $session_id) +{ + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + + $sql = 'SELECT u.user_id, u.username, u.user_type, s.session_ip + FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . " s + WHERE s.session_id = '" . $db->sql_escape($session_id) . "' + AND u.user_id = s.session_user_id"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + $template->assign_var('WHOIS', user_ipwhois($row['session_ip'])); + } + $db->sql_freeresult($result); + + // Output the page + page_header($user->lang['WHO_IS_ONLINE']); + + $template->set_filenames(array( + 'body' => 'viewonline_whois.html') + ); + make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); + + page_footer(); +} + +// Forum info +$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id + FROM ' . FORUMS_TABLE . ' + ORDER BY left_id ASC'; +$result = $db->sql_query($sql, 600); + +$forum_data = array(); +while ($row = $db->sql_fetchrow($result)) +{ + $forum_data[$row['forum_id']] = $row; +} +$db->sql_freeresult($result); + +$guest_counter = 0; + +// Get number of online guests (if we do not display them) +if (!$show_guests) +{ + switch ($db->get_sql_layer()) + { + case 'sqlite': + case 'sqlite3': + $sql = 'SELECT COUNT(session_ip) as num_guests + FROM ( + SELECT DISTINCT session_ip + FROM ' . SESSIONS_TABLE . ' + WHERE session_user_id = ' . ANONYMOUS . ' + AND session_time >= ' . (time() - ($config['load_online_time'] * 60)) . + ')'; + break; + + default: + $sql = 'SELECT COUNT(DISTINCT session_ip) as num_guests + FROM ' . SESSIONS_TABLE . ' + WHERE session_user_id = ' . ANONYMOUS . ' + AND session_time >= ' . (time() - ($config['load_online_time'] * 60)); + break; + } + $result = $db->sql_query($sql); + $guest_counter = (int) $db->sql_fetchfield('num_guests'); + $db->sql_freeresult($result); +} + +// Get user list +$sql_ary = array( + 'SELECT' => 'u.user_id, u.username, u.username_clean, u.user_type, u.user_colour, s.session_id, s.session_time, s.session_page, s.session_ip, s.session_browser, s.session_viewonline, s.session_forum_id', + 'FROM' => array( + USERS_TABLE => 'u', + SESSIONS_TABLE => 's', + ), + 'WHERE' => 'u.user_id = s.session_user_id + AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) . + ((!$show_guests) ? ' AND s.session_user_id <> ' . ANONYMOUS : ''), + 'ORDER_BY' => $order_by, +); + +/** +* Modify the SQL query for getting the user data to display viewonline list +* +* @event core.viewonline_modify_sql +* @var array sql_ary The SQL array +* @var bool show_guests Do we display guests in the list +* @var int guest_counter Number of guests displayed +* @var array forum_data Array with forum data +* @since 3.1.0-a1 +* @change 3.1.0-a2 Added vars guest_counter and forum_data +*/ +$vars = array('sql_ary', 'show_guests', 'guest_counter', 'forum_data'); +extract($phpbb_dispatcher->trigger_event('core.viewonline_modify_sql', compact($vars))); + +$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; + +while ($row = $db->sql_fetchrow($result)) +{ + if ($row['user_id'] != ANONYMOUS && !isset($prev_id[$row['user_id']])) + { + $view_online = $s_user_hidden = false; + $user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] . '" class="username-coloured"' : ''; + + $username_full = ($row['user_type'] != USER_IGNORE) ? get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) : '' . $row['username'] . ''; + + if (!$row['session_viewonline']) + { + $view_online = ($auth->acl_get('u_viewonline')) ? true : false; + $logged_hidden_online++; + + $username_full = '' . $username_full . ''; + $s_user_hidden = true; + } + else + { + $view_online = true; + $logged_visible_online++; + } + + $prev_id[$row['user_id']] = 1; + + if ($view_online) + { + $counter++; + } + + if (!$view_online || $counter > $start + $config['topics_per_page'] || $counter <= $start) + { + continue; + } + } + else if ($show_guests && $row['user_id'] == ANONYMOUS && !isset($prev_ip[$row['session_ip']])) + { + $prev_ip[$row['session_ip']] = 1; + $guest_counter++; + $counter++; + + if ($counter > $start + $config['topics_per_page'] || $counter <= $start) + { + continue; + } + + $s_user_hidden = false; + $username_full = get_username_string('full', $row['user_id'], $user->lang['GUEST']); + } + else + { + continue; + } + + $on_page = $viewonline_helper->get_user_page($row['session_page']); + + switch ($on_page[1]) + { + case 'index': + $location = $user->lang['INDEX']; + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); + break; + + case $phpbb_adm_relative_path . 'index': + $location = $user->lang['ACP']; + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); + break; + + case 'posting': + case 'viewforum': + case 'viewtopic': + $forum_id = $row['session_forum_id']; + + if ($forum_id && $auth->acl_get('f_list', $forum_id)) + { + $location = ''; + $location_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); + + if ($forum_data[$forum_id]['forum_type'] == FORUM_LINK) + { + $location = sprintf($user->lang['READING_LINK'], $forum_data[$forum_id]['forum_name']); + break; + } + + switch ($on_page[1]) + { + case 'posting': + preg_match('#mode=([a-z]+)#', $row['session_page'], $on_page); + $posting_mode = (!empty($on_page[1])) ? $on_page[1] : ''; + + switch ($posting_mode) + { + case 'reply': + case 'quote': + $location = sprintf($user->lang['REPLYING_MESSAGE'], $forum_data[$forum_id]['forum_name']); + break; + + default: + $location = sprintf($user->lang['POSTING_MESSAGE'], $forum_data[$forum_id]['forum_name']); + break; + } + break; + + case 'viewtopic': + $location = sprintf($user->lang['READING_TOPIC'], $forum_data[$forum_id]['forum_name']); + break; + + case 'viewforum': + $location = sprintf($user->lang['READING_FORUM'], $forum_data[$forum_id]['forum_name']); + break; + } + } + else + { + $location = $user->lang['INDEX']; + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); + } + break; + + case 'search': + $location = $user->lang['SEARCHING_FORUMS']; + $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"); + break; + + case 'memberlist': + $location_url = append_sid("{$phpbb_root_path}memberlist.$phpEx"); + + if (strpos($row['session_page'], 'mode=viewprofile') !== false) + { + $location = $user->lang['VIEWING_MEMBER_PROFILE']; + } + else if (strpos($row['session_page'], 'mode=contactadmin') !== false) + { + $location = $user->lang['VIEWING_CONTACT_ADMIN']; + $location_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin'); + } + else + { + $location = $user->lang['VIEWING_MEMBERS']; + } + break; + + case 'mcp': + $location = $user->lang['VIEWING_MCP']; + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); + break; + + case 'ucp': + $location = $user->lang['VIEWING_UCP']; + + // Grab some common modules + $url_params = array( + 'mode=register' => 'VIEWING_REGISTER', + 'i=pm&mode=compose' => 'POSTING_PRIVATE_MESSAGE', + 'i=pm&' => 'VIEWING_PRIVATE_MESSAGES', + 'i=profile&' => 'CHANGING_PROFILE', + 'i=prefs&' => 'CHANGING_PREFERENCES', + ); + + foreach ($url_params as $param => $lang) + { + if (strpos($row['session_page'], $param) !== false) + { + $location = $user->lang[$lang]; + break; + } + } + + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); + break; + + case 'download/file': + $location = $user->lang['DOWNLOADING_FILE']; + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); + break; + + case 'report': + $location = $user->lang['REPORTING_POST']; + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); + break; + + default: + $location = $user->lang['INDEX']; + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); + break; + } + + /** + * Overwrite the location's name and URL, which are displayed in the list + * + * @event core.viewonline_overwrite_location + * @var array on_page File name and query string + * @var array row Array with the users sql row + * @var string location Page name to displayed in the list + * @var string location_url Page url to displayed in the list + * @var array forum_data Array with forum data + * @since 3.1.0-a1 + * @change 3.1.0-a2 Added var forum_data + */ + $vars = array('on_page', 'row', 'location', 'location_url', 'forum_data'); + extract($phpbb_dispatcher->trigger_event('core.viewonline_overwrite_location', compact($vars))); + + $template_row = array( + 'USERNAME' => $row['username'], + 'USERNAME_COLOUR' => $row['user_colour'], + 'USERNAME_FULL' => $username_full, + 'LASTUPDATE' => $user->format_date($row['session_time']), + 'FORUM_LOCATION' => $location, + 'USER_IP' => ($auth->acl_get('a_')) ? (($mode == 'lookup' && $session_id == $row['session_id']) ? gethostbyaddr($row['session_ip']) : $row['session_ip']) : '', + 'USER_BROWSER' => ($auth->acl_get('a_user')) ? $row['session_browser'] : '', + + 'U_USER_PROFILE' => ($row['user_type'] != USER_IGNORE) ? get_username_string('profile', $row['user_id'], '') : '', + 'U_USER_IP' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=lookup' . (($mode != 'lookup' || $row['session_id'] != $session_id) ? '&s=' . $row['session_id'] : '') . "&sg=$show_guests&start=$start&sk=$sort_key&sd=$sort_dir"), + 'U_WHOIS' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=whois&s=' . $row['session_id']), + 'U_FORUM_LOCATION' => $location_url, + + 'S_USER_HIDDEN' => $s_user_hidden, + 'S_GUEST' => ($row['user_id'] == ANONYMOUS) ? true : false, + 'S_USER_TYPE' => $row['user_type'], + ); + + /** + * Modify viewonline template data before it is displayed in the list + * + * @event core.viewonline_modify_user_row + * @var array on_page File name and query string + * @var array row Array with the users sql row + * @var array forum_data Array with forum data + * @var array template_row Array with template variables for the user row + * @since 3.1.0-RC4 + */ + $vars = array('on_page', 'row', 'forum_data', 'template_row'); + extract($phpbb_dispatcher->trigger_event('core.viewonline_modify_user_row', compact($vars))); + + $template->assign_block_vars('user_row', $template_row); +} +$db->sql_freeresult($result); +unset($prev_id, $prev_ip); + +$order_legend = ($config['legend_sort_groupname']) ? 'group_name' : 'group_legend'; +// Grab group details for legend display +if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) +{ + $sql = 'SELECT group_id, group_name, group_colour, group_type, group_legend + FROM ' . GROUPS_TABLE . ' + WHERE group_legend > 0 + ORDER BY ' . $order_legend . ' ASC'; +} +else +{ + $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_legend + FROM ' . GROUPS_TABLE . ' g + LEFT JOIN ' . USER_GROUP_TABLE . ' ug + ON ( + g.group_id = ug.group_id + AND ug.user_id = ' . $user->data['user_id'] . ' + AND ug.user_pending = 0 + ) + WHERE g.group_legend > 0 + AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ') + ORDER BY g.' . $order_legend . ' ASC'; +} +$result = $db->sql_query($sql); + +$legend = ''; +while ($row = $db->sql_fetchrow($result)) +{ + if ($row['group_name'] == 'BOTS') + { + $legend .= (($legend != '') ? ', ' : '') . '' . $user->lang['G_BOTS'] . ''; + } + else + { + $legend .= (($legend != '') ? ', ' : '') . '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; + } +} +$db->sql_freeresult($result); + +// Refreshing the page every 60 seconds... +meta_refresh(60, append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir&start=$start")); + +$start = $pagination->validate_start($start, $config['topics_per_page'], $counter); +$base_url = append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir"); +$pagination->generate_template_pagination($base_url, 'pagination', 'start', $counter, $config['topics_per_page'], $start); + +// Send data to template +$template->assign_vars(array( + 'TOTAL_REGISTERED_USERS_ONLINE' => $user->lang('REG_USERS_ONLINE', (int) $logged_visible_online, $user->lang('HIDDEN_USERS_ONLINE', (int) $logged_hidden_online)), + 'TOTAL_GUEST_USERS_ONLINE' => $user->lang('GUEST_USERS_ONLINE', (int) $guest_counter), + 'LEGEND' => $legend, + + 'U_SORT_USERNAME' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)), + 'U_SORT_UPDATED' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)), + 'U_SORT_LOCATION' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)), + + 'U_SWITCH_GUEST_DISPLAY' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sg=' . ((int) !$show_guests)), + 'L_SWITCH_GUEST_DISPLAY' => ($show_guests) ? $user->lang['HIDE_GUESTS'] : $user->lang['DISPLAY_GUESTS'], + 'S_SWITCH_GUEST_DISPLAY' => ($config['load_online_guests']) ? true : false, + 'S_VIEWONLINE' => true, +)); + +// We do not need to load the who is online box here. ;) +$config['load_online'] = false; + +// Output the page +page_header($user->lang['WHO_IS_ONLINE']); + +$template->set_filenames(array( + 'body' => 'viewonline_body.html') +); +make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); + +page_footer(); diff --git a/sources/phpBB/viewtopic.php b/sources/phpBB/viewtopic.php new file mode 100644 index 0000000..981941c --- /dev/null +++ b/sources/phpBB/viewtopic.php @@ -0,0 +1,2177 @@ + +* @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); +$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); +include($phpbb_root_path . 'includes/bbcode.' . $phpEx); +include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + +// Start session management +$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)); + +$voted_id = (sizeof($voted_id) > 1) ? array_unique($voted_id) : $voted_id; + + +$start = request_var('start', 0); +$view = request_var('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); + +$update = request_var('update', false); + +$pagination = $phpbb_container->get('pagination'); + +$s_can_vote = false; +/** +* @todo normalize? +*/ +$hilit_words = request_var('hilit', '', true); + +// Do we have a topic or post id? +if (!$topic_id && !$post_id) +{ + trigger_error('NO_TOPIC'); +} + +$phpbb_content_visibility = $phpbb_container->get('content.visibility'); + +// Find topic id if user requested a newer or older topic +if ($view && !$post_id) +{ + if (!$forum_id) + { + $sql = 'SELECT forum_id + FROM ' . TOPICS_TABLE . " + WHERE topic_id = $topic_id"; + $result = $db->sql_query($sql); + $forum_id = (int) $db->sql_fetchfield('forum_id'); + $db->sql_freeresult($result); + + if (!$forum_id) + { + trigger_error('NO_TOPIC'); + } + } + + if ($view == 'unread') + { + // Get topic tracking info + $topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id); + $topic_last_read = (isset($topic_tracking_info[$topic_id])) ? $topic_tracking_info[$topic_id] : 0; + + $sql = 'SELECT post_id, topic_id, forum_id + FROM ' . POSTS_TABLE . " + WHERE topic_id = $topic_id + AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id) . " + AND post_time > $topic_last_read + AND forum_id = $forum_id + ORDER BY post_time ASC, post_id ASC"; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + $sql = 'SELECT topic_last_post_id as post_id, topic_id, forum_id + FROM ' . TOPICS_TABLE . ' + WHERE topic_id = ' . $topic_id; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + if (!$row) + { + // Setup user environment so we can process lang string + $user->setup('viewtopic'); + + trigger_error('NO_TOPIC'); + } + + $post_id = $row['post_id']; + $topic_id = $row['topic_id']; + } + else if ($view == 'next' || $view == 'previous') + { + $sql_condition = ($view == 'next') ? '>' : '<'; + $sql_ordering = ($view == 'next') ? 'ASC' : 'DESC'; + + $sql = 'SELECT forum_id, topic_last_post_time + FROM ' . TOPICS_TABLE . ' + WHERE topic_id = ' . $topic_id; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + $user->setup('viewtopic'); + // OK, the topic doesn't exist. This error message is not helpful, but technically correct. + trigger_error(($view == 'next') ? 'NO_NEWER_TOPICS' : 'NO_OLDER_TOPICS'); + } + else + { + $sql = 'SELECT topic_id, forum_id + FROM ' . TOPICS_TABLE . ' + WHERE forum_id = ' . $row['forum_id'] . " + AND topic_moved_id = 0 + AND topic_last_post_time $sql_condition {$row['topic_last_post_time']} + AND " . $phpbb_content_visibility->get_visibility_sql('topic', $row['forum_id']) . " + ORDER BY topic_last_post_time $sql_ordering, topic_last_post_id $sql_ordering"; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + $sql = 'SELECT forum_style + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $db->sql_query($sql); + $forum_style = (int) $db->sql_fetchfield('forum_style'); + $db->sql_freeresult($result); + + $user->setup('viewtopic', $forum_style); + trigger_error(($view == 'next') ? 'NO_NEWER_TOPICS' : 'NO_OLDER_TOPICS'); + } + else + { + $topic_id = $row['topic_id']; + $forum_id = $row['forum_id']; + } + } + } + + if (isset($row) && $row['forum_id']) + { + $forum_id = $row['forum_id']; + } +} + +// This rather complex gaggle of code handles querying for topics but +// also allows for direct linking to a post (and the calculation of which +// page the post is on and the correct display of viewtopic) +$sql_array = array( + 'SELECT' => 't.*, f.*', + + 'FROM' => array(FORUMS_TABLE => 'f'), +); + +// The FROM-Order is quite important here, else t.* columns can not be correctly bound. +if ($post_id) +{ + $sql_array['SELECT'] .= ', p.post_visibility, p.post_time, p.post_id'; + $sql_array['FROM'][POSTS_TABLE] = 'p'; +} + +// Topics table need to be the last in the chain +$sql_array['FROM'][TOPICS_TABLE] = 't'; + +if ($user->data['is_registered']) +{ + $sql_array['SELECT'] .= ', tw.notify_status'; + $sql_array['LEFT_JOIN'] = array(); + + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(TOPICS_WATCH_TABLE => 'tw'), + 'ON' => 'tw.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = tw.topic_id' + ); + + if ($config['allow_bookmarks']) + { + $sql_array['SELECT'] .= ', bm.topic_id as bookmarked'; + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(BOOKMARKS_TABLE => 'bm'), + 'ON' => 'bm.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = bm.topic_id' + ); + } + + if ($config['load_db_lastread']) + { + $sql_array['SELECT'] .= ', tt.mark_time, ft.mark_time as forum_mark_time'; + + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(TOPICS_TRACK_TABLE => 'tt'), + 'ON' => 'tt.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = tt.topic_id' + ); + + $sql_array['LEFT_JOIN'][] = array( + 'FROM' => array(FORUMS_TRACK_TABLE => 'ft'), + 'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND t.forum_id = ft.forum_id' + ); + } +} + +if (!$post_id) +{ + $sql_array['WHERE'] = "t.topic_id = $topic_id"; +} +else +{ + $sql_array['WHERE'] = "p.post_id = $post_id AND t.topic_id = p.topic_id"; +} + +$sql_array['WHERE'] .= ' AND f.forum_id = t.forum_id'; + +$sql = $db->sql_build_query('SELECT', $sql_array); +$result = $db->sql_query($sql); +$topic_data = $db->sql_fetchrow($result); +$db->sql_freeresult($result); + +// link to unapproved post or incorrect link +if (!$topic_data) +{ + // If post_id was submitted, we try at least to display the topic as a last resort... + if ($post_id && $topic_id) + { + redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=$topic_id" . (($forum_id) ? "&f=$forum_id" : ''))); + } + + trigger_error('NO_TOPIC'); +} + +$forum_id = (int) $topic_data['forum_id']; + +// Now we know the forum_id and can check the permissions +if ($topic_data['topic_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $forum_id)) +{ + trigger_error('NO_TOPIC'); +} + +// This is for determining where we are (page) +if ($post_id) +{ + // are we where we are supposed to be? + if (($topic_data['post_visibility'] == ITEM_UNAPPROVED || $topic_data['post_visibility'] == ITEM_REAPPROVE) && !$auth->acl_get('m_approve', $topic_data['forum_id'])) + { + // If post_id was submitted, we try at least to display the topic as a last resort... + if ($topic_id) + { + redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=$topic_id" . (($forum_id) ? "&f=$forum_id" : ''))); + } + + trigger_error('NO_TOPIC'); + } + if ($post_id == $topic_data['topic_first_post_id'] || $post_id == $topic_data['topic_last_post_id']) + { + $check_sort = ($post_id == $topic_data['topic_first_post_id']) ? 'd' : 'a'; + + if ($sort_dir == $check_sort) + { + $topic_data['prev_posts'] = $phpbb_content_visibility->get_count('topic_posts', $topic_data, $forum_id) - 1; + } + else + { + $topic_data['prev_posts'] = 0; + } + } + else + { + $sql = 'SELECT COUNT(p.post_id) AS prev_posts + FROM ' . POSTS_TABLE . " p + WHERE p.topic_id = {$topic_data['topic_id']} + AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id, 'p.'); + + if ($sort_dir == 'd') + { + $sql .= " AND (p.post_time > {$topic_data['post_time']} OR (p.post_time = {$topic_data['post_time']} AND p.post_id >= {$topic_data['post_id']}))"; + } + else + { + $sql .= " AND (p.post_time < {$topic_data['post_time']} OR (p.post_time = {$topic_data['post_time']} AND p.post_id <= {$topic_data['post_id']}))"; + } + + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $topic_data['prev_posts'] = $row['prev_posts'] - 1; + } +} + +$topic_id = (int) $topic_data['topic_id']; +$topic_replies = $phpbb_content_visibility->get_count('topic_posts', $topic_data, $forum_id) - 1; + +// Check sticky/announcement time limit +if (($topic_data['topic_type'] == POST_STICKY || $topic_data['topic_type'] == POST_ANNOUNCE) && $topic_data['topic_time_limit'] && ($topic_data['topic_time'] + $topic_data['topic_time_limit']) < time()) +{ + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_type = ' . POST_NORMAL . ', topic_time_limit = 0 + WHERE topic_id = ' . $topic_id; + $db->sql_query($sql); + + $topic_data['topic_type'] = POST_NORMAL; + $topic_data['topic_time_limit'] = 0; +} + +// Setup look and feel +$user->setup('viewtopic', $topic_data['forum_style']); + +$overrides_f_read_check = false; +$overrides_forum_password_check = false; +$topic_tracking_info = isset($topic_tracking_info) ? $topic_tracking_info : null; + +/** +* Event to apply extra permissions and to override original phpBB's f_read permission and forum password check +* on viewtopic access +* +* @event core.viewtopic_before_f_read_check +* @var int forum_id The forum id from where the topic belongs +* @var int topic_id The id of the topic the user tries to access +* @var int post_id The id of the post the user tries to start viewing at. +* It may be 0 for none given. +* @var array topic_data All the information from the topic and forum tables for this topic +* It includes posts information if post_id is not 0 +* @var bool overrides_f_read_check Set true to remove f_read check afterwards +* @var bool overrides_forum_password_check Set true to remove forum_password check afterwards +* @var array topic_tracking_info Information upon calling get_topic_tracking() +* Set it to NULL to allow auto-filling later. +* Set it to an array to override original data. +* @since 3.1.3-RC1 +*/ +$vars = array( + 'forum_id', + 'topic_id', + 'post_id', + 'topic_data', + 'overrides_f_read_check', + 'overrides_forum_password_check', + 'topic_tracking_info', +); +extract($phpbb_dispatcher->trigger_event('core.viewtopic_before_f_read_check', compact($vars))); + +// Start auth check +if (!$overrides_f_read_check && !$auth->acl_get('f_read', $forum_id)) +{ + if ($user->data['user_id'] != ANONYMOUS) + { + trigger_error('SORRY_AUTH_READ'); + } + + login_box('', $user->lang['LOGIN_VIEWFORUM']); +} + +// Forum is passworded ... check whether access has been granted to this +// user this session, if not show login box +if (!$overrides_forum_password_check && $topic_data['forum_password']) +{ + login_forum_box($topic_data); +} + +// Redirect to login upon emailed notification links if user is not logged in. +if (isset($_GET['e']) && $user->data['user_id'] == ANONYMOUS) +{ + login_box(build_url('e') . '#unread', $user->lang['LOGIN_NOTIFY_TOPIC']); +} + +// What is start equal to? +if ($post_id) +{ + $start = floor(($topic_data['prev_posts']) / $config['posts_per_page']) * $config['posts_per_page']; +} + +// Get topic tracking info +if (!isset($topic_tracking_info)) +{ + $topic_tracking_info = array(); + + // Get topic tracking info + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + $tmp_topic_data = array($topic_id => $topic_data); + $topic_tracking_info = get_topic_tracking($forum_id, $topic_id, $tmp_topic_data, array($forum_id => $topic_data['forum_mark_time'])); + unset($tmp_topic_data); + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + $topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id); + } +} + +// Post ordering options +$limit_days = array(0 => $user->lang['ALL_POSTS'], 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['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); +$sort_by_sql = array('a' => array('u.username_clean', 'p.post_id'), 't' => array('p.post_time', 'p.post_id'), 's' => array('p.post_subject', 'p.post_id')); +$join_user_sql = array('a' => true, 't' => false, 's' => false); + +$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, $default_sort_days, $default_sort_key, $default_sort_dir); + +// Obtain correct post count and ordering SQL if user has +// requested anything different +if ($sort_days) +{ + $min_post_time = time() - ($sort_days * 86400); + + $sql = 'SELECT COUNT(post_id) AS num_posts + FROM ' . POSTS_TABLE . " + WHERE topic_id = $topic_id + AND post_time >= $min_post_time + AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id); + $result = $db->sql_query($sql); + $total_posts = (int) $db->sql_fetchfield('num_posts'); + $db->sql_freeresult($result); + + $limit_posts_time = "AND p.post_time >= $min_post_time "; + + if (isset($_POST['sort'])) + { + $start = 0; + } +} +else +{ + $total_posts = $topic_replies + 1; + $limit_posts_time = ''; +} + +// Was a highlight request part of the URI? +$highlight_match = $highlight = ''; +if ($hilit_words) +{ + $highlight_match = phpbb_clean_search_string($hilit_words); + $highlight = urlencode($highlight_match); + $highlight_match = str_replace('\*', '\w+?', preg_quote($highlight_match, '#')); + $highlight_match = preg_replace('#(?<=^|\s)\\\\w\*\?(?=\s|$)#', '\w+?', $highlight_match); + $highlight_match = str_replace(' ', '|', $highlight_match); +} + +// Make sure $start is set to the last page if it exceeds the amount +$start = $pagination->validate_start($start, $config['posts_per_page'], $total_posts); + +// General Viewtopic URL for return links +$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start") . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . (($highlight_match) ? "&hilit=$highlight" : '')); + +// Are we watching this topic? +$s_watching_topic = array( + 'link' => '', + 'link_toggle' => '', + 'title' => '', + 'title_toggle' => '', + 'is_watching' => false, +); + +if ($config['allow_topic_notify']) +{ + $notify_status = (isset($topic_data['notify_status'])) ? $topic_data['notify_status'] : null; + watch_topic_forum('topic', $s_watching_topic, $user->data['user_id'], $forum_id, $topic_id, $notify_status, $start, $topic_data['topic_title']); + + // Reset forum notification if forum notify is set + if ($config['allow_forum_notify'] && $auth->acl_get('f_subscribe', $forum_id)) + { + $s_watching_forum = $s_watching_topic; + watch_topic_forum('forum', $s_watching_forum, $user->data['user_id'], $forum_id, 0); + } +} + +// Bookmarks +if ($config['allow_bookmarks'] && $user->data['is_registered'] && request_var('bookmark', 0)) +{ + if (check_link_hash(request_var('hash', ''), "topic_$topic_id")) + { + if (!$topic_data['bookmarked']) + { + $sql = 'INSERT INTO ' . BOOKMARKS_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'user_id' => $user->data['user_id'], + 'topic_id' => $topic_id, + )); + $db->sql_query($sql); + } + else + { + $sql = 'DELETE FROM ' . BOOKMARKS_TABLE . " + WHERE user_id = {$user->data['user_id']} + AND topic_id = $topic_id"; + $db->sql_query($sql); + } + $message = (($topic_data['bookmarked']) ? $user->lang['BOOKMARK_REMOVED'] : $user->lang['BOOKMARK_ADDED']); + + if (!$request->is_ajax()) + { + $message .= '

' . $user->lang('RETURN_TOPIC', '', ''); + } + } + else + { + $message = $user->lang['BOOKMARK_ERR']; + + if (!$request->is_ajax()) + { + $message .= '

' . $user->lang('RETURN_TOPIC', '', ''); + } + } + meta_refresh(3, $viewtopic_url); + + trigger_error($message); +} + +// Grab ranks +$ranks = $cache->obtain_ranks(); + +// Grab icons +$icons = $cache->obtain_icons(); + +// Grab extensions +$extensions = array(); +if ($topic_data['topic_attachment']) +{ + $extensions = $cache->obtain_attach_extensions($forum_id); +} + +// Forum rules listing +$s_forum_rules = ''; +gen_forum_auth_level('topic', $forum_id, $topic_data['forum_status']); + +// Quick mod tools +$allow_change_type = ($auth->acl_get('m_', $forum_id) || ($user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'])) ? true : false; + +$s_quickmod_action = append_sid( + "{$phpbb_root_path}mcp.$phpEx", + array( + 'f' => $forum_id, + 't' => $topic_id, + 'start' => $start, + 'quickmod' => 1, + 'redirect' => urlencode(str_replace('&', '&', $viewtopic_url)), + ), + true, + $user->session_id +); + +$quickmod_array = array( +// 'key' => array('LANG_KEY', $userHasPermissions), + + 'lock' => array('LOCK_TOPIC', ($topic_data['topic_status'] == ITEM_UNLOCKED) && ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster']))), + 'unlock' => array('UNLOCK_TOPIC', ($topic_data['topic_status'] != ITEM_UNLOCKED) && ($auth->acl_get('m_lock', $forum_id))), + 'delete_topic' => array('DELETE_TOPIC', ($auth->acl_get('m_delete', $forum_id) || (($topic_data['topic_visibility'] != ITEM_DELETED) && $auth->acl_get('m_softdelete', $forum_id)))), + 'restore_topic' => array('RESTORE_TOPIC', (($topic_data['topic_visibility'] == ITEM_DELETED) && $auth->acl_get('m_approve', $forum_id))), + 'move' => array('MOVE_TOPIC', $auth->acl_get('m_move', $forum_id) && $topic_data['topic_status'] != ITEM_MOVED), + 'split' => array('SPLIT_TOPIC', $auth->acl_get('m_split', $forum_id)), + '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_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)), + 'topic_logs' => array('VIEW_TOPIC_LOGS', $auth->acl_get('m_', $forum_id)), +); + +foreach($quickmod_array as $option => $qm_ary) +{ + if (!empty($qm_ary[1])) + { + phpbb_add_quickmod_option($s_quickmod_action, $option, $qm_ary[0]); + } +} + +// Navigation links +generate_forum_nav($topic_data); + +// Forum Rules +generate_forum_rules($topic_data); + +// Moderators +$forum_moderators = array(); +if ($config['load_moderators']) +{ + get_moderators($forum_moderators, $forum_id); +} + +// This is only used for print view so ... +$server_path = (!$view) ? $phpbb_root_path : generate_board_url() . '/'; + +// Replace naughty words in title +$topic_data['topic_title'] = censor_text($topic_data['topic_title']); + +$s_search_hidden_fields = array( + 't' => $topic_id, + 'sf' => 'msgonly', +); +if ($_SID) +{ + $s_search_hidden_fields['sid'] = $_SID; +} + +if (!empty($_EXTRA_URL)) +{ + foreach ($_EXTRA_URL as $url_param) + { + $url_param = explode('=', $url_param, 2); + $s_search_hidden_fields[$url_param[0]] = $url_param[1]; + } +} + +// If we've got a hightlight set pass it on to pagination. +$base_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . (($highlight_match) ? "&hilit=$highlight" : '')); + +/** +* Event to modify data before template variables are being assigned +* +* @event core.viewtopic_assign_template_vars_before +* @var string base_url URL to be passed to generate pagination +* @var int forum_id Forum ID +* @var int post_id Post ID +* @var array quickmod_array Array with quick moderation options data +* @var int start Pagination information +* @var array topic_data Array with topic data +* @var int topic_id Topic ID +* @var array topic_tracking_info Array with topic tracking data +* @var int total_posts Topic total posts count +* @var string viewtopic_url URL to the topic page +* @since 3.1.0-RC4 +* @change 3.1.2-RC1 Added viewtopic_url +*/ +$vars = array( + 'base_url', + 'forum_id', + 'post_id', + 'quickmod_array', + 'start', + 'topic_data', + 'topic_id', + 'topic_tracking_info', + 'total_posts', + 'viewtopic_url', +); +extract($phpbb_dispatcher->trigger_event('core.viewtopic_assign_template_vars_before', compact($vars))); + +$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_posts, $config['posts_per_page'], $start); + +// Send vars to template +$template->assign_vars(array( + 'FORUM_ID' => $forum_id, + 'FORUM_NAME' => $topic_data['forum_name'], + 'FORUM_DESC' => generate_text_for_display($topic_data['forum_desc'], $topic_data['forum_desc_uid'], $topic_data['forum_desc_bitfield'], $topic_data['forum_desc_options']), + 'TOPIC_ID' => $topic_id, + 'TOPIC_TITLE' => $topic_data['topic_title'], + 'TOPIC_POSTER' => $topic_data['topic_poster'], + + 'TOPIC_AUTHOR_FULL' => get_username_string('full', $topic_data['topic_poster'], $topic_data['topic_first_poster_name'], $topic_data['topic_first_poster_colour']), + 'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $topic_data['topic_poster'], $topic_data['topic_first_poster_name'], $topic_data['topic_first_poster_colour']), + 'TOPIC_AUTHOR' => get_username_string('username', $topic_data['topic_poster'], $topic_data['topic_first_poster_name'], $topic_data['topic_first_poster_colour']), + + 'TOTAL_POSTS' => $user->lang('VIEW_TOPIC_POSTS', (int) $total_posts), + 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=topic_view&f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start") . ((strlen($u_sort_param)) ? "&$u_sort_param" : ''), true, $user->session_id) : '', + 'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]) : '', + + 'POST_IMG' => ($topic_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', 'FORUM_LOCKED') : $user->img('button_topic_new', 'POST_NEW_TOPIC'), + 'QUOTE_IMG' => $user->img('icon_post_quote', 'REPLY_WITH_QUOTE'), + 'REPLY_IMG' => ($topic_data['forum_status'] == ITEM_LOCKED || $topic_data['topic_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', 'TOPIC_LOCKED') : $user->img('button_topic_reply', 'REPLY_TO_TOPIC'), + 'EDIT_IMG' => $user->img('icon_post_edit', 'EDIT_POST'), + 'DELETE_IMG' => $user->img('icon_post_delete', 'DELETE_POST'), + 'DELETED_IMG' => $user->img('icon_topic_deleted', 'POST_DELETED_RESTORE'), + 'INFO_IMG' => $user->img('icon_post_info', 'VIEW_INFO'), + 'PROFILE_IMG' => $user->img('icon_user_profile', 'READ_PROFILE'), + 'SEARCH_IMG' => $user->img('icon_user_search', 'SEARCH_USER_POSTS'), + 'PM_IMG' => $user->img('icon_contact_pm', 'SEND_PRIVATE_MESSAGE'), + 'EMAIL_IMG' => $user->img('icon_contact_email', 'SEND_EMAIL'), + 'JABBER_IMG' => $user->img('icon_contact_jabber', 'JABBER') , + 'REPORT_IMG' => $user->img('icon_post_report', 'REPORT_POST'), + 'REPORTED_IMG' => $user->img('icon_topic_reported', 'POST_REPORTED'), + 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'POST_UNAPPROVED'), + 'WARN_IMG' => $user->img('icon_user_warn', 'WARN_USER'), + + 'S_IS_LOCKED' => ($topic_data['topic_status'] == ITEM_UNLOCKED && $topic_data['forum_status'] == ITEM_UNLOCKED) ? false : true, + 'S_SELECT_SORT_DIR' => $s_sort_dir, + 'S_SELECT_SORT_KEY' => $s_sort_key, + 'S_SELECT_SORT_DAYS' => $s_limit_days, + 'S_SINGLE_MODERATOR' => (!empty($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id]) > 1) ? false : true, + 'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start")), + 'S_MOD_ACTION' => $s_quickmod_action, + + 'L_RETURN_TO_FORUM' => $user->lang('RETURN_TO', $topic_data['forum_name']), + 'S_VIEWTOPIC' => true, + 'S_UNREAD_VIEW' => $view == 'unread', + 'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false, + 'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx"), + 'S_SEARCH_LOCAL_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields), + + 'S_DISPLAY_POST_INFO' => ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false, + 'S_DISPLAY_REPLY_INFO' => ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_reply', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false, + 'S_ENABLE_FEEDS_TOPIC' => ($config['feed_topic'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $topic_data['forum_options'])) ? true : false, + + 'U_TOPIC' => "{$server_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id", + 'U_FORUM' => $server_path, + 'U_VIEW_TOPIC' => $viewtopic_url, + 'U_CANONICAL' => generate_board_url() . '/' . append_sid("viewtopic.$phpEx", "t=$topic_id" . (($start) ? "&start=$start" : ''), true, ''), + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), + 'U_VIEW_OLDER_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=previous"), + 'U_VIEW_NEWER_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=next"), + 'U_PRINT_TOPIC' => ($auth->acl_get('f_print', $forum_id)) ? $viewtopic_url . '&view=print' : '', + 'U_EMAIL_TOPIC' => ($auth->acl_get('f_email', $forum_id) && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&t=$topic_id") : '', + + 'U_WATCH_TOPIC' => $s_watching_topic['link'], + 'U_WATCH_TOPIC_TOGGLE' => $s_watching_topic['link_toggle'], + 'S_WATCH_TOPIC_TITLE' => $s_watching_topic['title'], + 'S_WATCH_TOPIC_TOGGLE' => $s_watching_topic['title_toggle'], + 'S_WATCHING_TOPIC' => $s_watching_topic['is_watching'], + + 'U_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks']) ? $viewtopic_url . '&bookmark=1&hash=' . generate_link_hash("topic_$topic_id") : '', + 'S_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'], + 'S_BOOKMARK_TOGGLE' => (!$user->data['is_registered'] || !$config['allow_bookmarks'] || !$topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'], + 'S_BOOKMARKED_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? true : false, + + 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=post&f=$forum_id") : '', + 'U_POST_REPLY_TOPIC' => ($auth->acl_get('f_reply', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&f=$forum_id&t=$topic_id") : '', + 'U_BUMP_TOPIC' => (bump_topic_allowed($forum_id, $topic_data['topic_bumped'], $topic_data['topic_last_post_time'], $topic_data['topic_poster'], $topic_data['topic_last_poster_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=bump&f=$forum_id&t=$topic_id&hash=" . generate_link_hash("topic_$topic_id")) : '') +); + +// Does this topic contain a poll? +if (!empty($topic_data['poll_start'])) +{ + $sql = 'SELECT o.*, p.bbcode_bitfield, p.bbcode_uid + FROM ' . POLL_OPTIONS_TABLE . ' o, ' . POSTS_TABLE . " p + WHERE o.topic_id = $topic_id + AND p.post_id = {$topic_data['topic_first_post_id']} + AND p.topic_id = o.topic_id + ORDER BY o.poll_option_id"; + $result = $db->sql_query($sql); + + $poll_info = $vote_counts = array(); + while ($row = $db->sql_fetchrow($result)) + { + $poll_info[] = $row; + $option_id = (int) $row['poll_option_id']; + $vote_counts[$option_id] = (int) $row['poll_option_total']; + } + $db->sql_freeresult($result); + + $cur_voted_id = array(); + if ($user->data['is_registered']) + { + $sql = 'SELECT poll_option_id + FROM ' . POLL_VOTES_TABLE . ' + WHERE topic_id = ' . $topic_id . ' + AND vote_user_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $cur_voted_id[] = $row['poll_option_id']; + } + $db->sql_freeresult($result); + } + else + { + // Cookie based guest tracking ... I don't like this but hum ho + // it's oft requested. This relies on "nice" users who don't feel + // the need to delete cookies to mess with results. + if ($request->is_set($config['cookie_name'] . '_poll_' . $topic_id, \phpbb\request\request_interface::COOKIE)) + { + $cur_voted_id = explode(',', $request->variable($config['cookie_name'] . '_poll_' . $topic_id, '', true, \phpbb\request\request_interface::COOKIE)); + $cur_voted_id = array_map('intval', $cur_voted_id); + } + } + + // Can not vote at all if no vote permission + $s_can_vote = ($auth->acl_get('f_vote', $forum_id) && + (($topic_data['poll_length'] != 0 && $topic_data['poll_start'] + $topic_data['poll_length'] > time()) || $topic_data['poll_length'] == 0) && + $topic_data['topic_status'] != ITEM_LOCKED && + $topic_data['forum_status'] != ITEM_LOCKED && + (!sizeof($cur_voted_id) || + ($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change']))) ? true : false; + $s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false; + + if ($update && $s_can_vote) + { + + if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id) || !check_form_key('posting')) + { + $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start")); + + meta_refresh(5, $redirect_url); + if (!sizeof($voted_id)) + { + $message = 'NO_VOTE_OPTION'; + } + else if (sizeof($voted_id) > $topic_data['poll_max_options']) + { + $message = 'TOO_MANY_VOTE_OPTIONS'; + } + else if (in_array(VOTE_CONVERTED, $cur_voted_id)) + { + $message = 'VOTE_CONVERTED'; + } + else + { + $message = 'FORM_INVALID'; + } + + $message = $user->lang[$message] . '

' . sprintf($user->lang['RETURN_TOPIC'], '', ''); + trigger_error($message); + } + + foreach ($voted_id as $option) + { + if (in_array($option, $cur_voted_id)) + { + continue; + } + + $sql = 'UPDATE ' . POLL_OPTIONS_TABLE . ' + SET poll_option_total = poll_option_total + 1 + WHERE poll_option_id = ' . (int) $option . ' + AND topic_id = ' . (int) $topic_id; + $db->sql_query($sql); + + $vote_counts[$option]++; + + if ($user->data['is_registered']) + { + $sql_ary = array( + 'topic_id' => (int) $topic_id, + 'poll_option_id' => (int) $option, + 'vote_user_id' => (int) $user->data['user_id'], + 'vote_user_ip' => (string) $user->ip, + ); + + $sql = 'INSERT INTO ' . POLL_VOTES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + } + } + + foreach ($cur_voted_id as $option) + { + if (!in_array($option, $voted_id)) + { + $sql = 'UPDATE ' . POLL_OPTIONS_TABLE . ' + SET poll_option_total = poll_option_total - 1 + WHERE poll_option_id = ' . (int) $option . ' + AND topic_id = ' . (int) $topic_id; + $db->sql_query($sql); + + $vote_counts[$option]--; + + if ($user->data['is_registered']) + { + $sql = 'DELETE FROM ' . POLL_VOTES_TABLE . ' + WHERE topic_id = ' . (int) $topic_id . ' + AND poll_option_id = ' . (int) $option . ' + AND vote_user_id = ' . (int) $user->data['user_id']; + $db->sql_query($sql); + } + } + } + + if ($user->data['user_id'] == ANONYMOUS && !$user->data['is_bot']) + { + $user->set_cookie('poll_' . $topic_id, implode(',', $voted_id), time() + 31536000); + } + + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET poll_last_vote = ' . time() . " + WHERE topic_id = $topic_id"; + //, topic_last_post_time = ' . time() . " -- for bumping topics with new votes, ignore for now + $db->sql_query($sql); + + $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start")); + $message = $user->lang['VOTE_SUBMITTED'] . '

' . sprintf($user->lang['RETURN_TOPIC'], '', ''); + + if ($request->is_ajax()) + { + // Filter out invalid options + $valid_user_votes = array_intersect(array_keys($vote_counts), $voted_id); + + $data = array( + 'NO_VOTES' => $user->lang['NO_VOTES'], + 'success' => true, + 'user_votes' => array_flip($valid_user_votes), + 'vote_counts' => $vote_counts, + 'total_votes' => array_sum($vote_counts), + 'can_vote' => !sizeof($valid_user_votes) || ($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change']), + ); + $json_response = new \phpbb\json_response(); + $json_response->send($data); + } + + meta_refresh(5, $redirect_url); + trigger_error($message); + } + + $poll_total = 0; + $poll_most = 0; + foreach ($poll_info as $poll_option) + { + $poll_total += $poll_option['poll_option_total']; + $poll_most = ($poll_option['poll_option_total'] >= $poll_most) ? $poll_option['poll_option_total'] : $poll_most; + } + + $parse_flags = ($poll_info[0]['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; + + for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++) + { + $poll_info[$i]['poll_option_text'] = generate_text_for_display($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield'], $parse_flags, true); + } + + $topic_data['poll_title'] = generate_text_for_display($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield'], $parse_flags, true); + + foreach ($poll_info as $poll_option) + { + $option_pct = ($poll_total > 0) ? $poll_option['poll_option_total'] / $poll_total : 0; + $option_pct_txt = sprintf("%.1d%%", round($option_pct * 100)); + $option_pct_rel = ($poll_most > 0) ? $poll_option['poll_option_total'] / $poll_most : 0; + $option_pct_rel_txt = sprintf("%.1d%%", round($option_pct_rel * 100)); + $option_most_votes = ($poll_option['poll_option_total'] > 0 && $poll_option['poll_option_total'] == $poll_most) ? true : false; + + $template->assign_block_vars('poll_option', array( + 'POLL_OPTION_ID' => $poll_option['poll_option_id'], + 'POLL_OPTION_CAPTION' => $poll_option['poll_option_text'], + 'POLL_OPTION_RESULT' => $poll_option['poll_option_total'], + 'POLL_OPTION_PERCENT' => $option_pct_txt, + 'POLL_OPTION_PERCENT_REL' => $option_pct_rel_txt, + 'POLL_OPTION_PCT' => round($option_pct * 100), + 'POLL_OPTION_WIDTH' => round($option_pct * 250), + 'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false, + 'POLL_OPTION_MOST_VOTES' => $option_most_votes, + )); + } + + $poll_end = $topic_data['poll_length'] + $topic_data['poll_start']; + + $template->assign_vars(array( + 'POLL_QUESTION' => $topic_data['poll_title'], + 'TOTAL_VOTES' => $poll_total, + 'POLL_LEFT_CAP_IMG' => $user->img('poll_left'), + 'POLL_RIGHT_CAP_IMG'=> $user->img('poll_right'), + + 'L_MAX_VOTES' => $user->lang('MAX_OPTIONS_SELECT', (int) $topic_data['poll_max_options']), + 'L_POLL_LENGTH' => ($topic_data['poll_length']) ? sprintf($user->lang[($poll_end > time()) ? 'POLL_RUN_TILL' : 'POLL_ENDED_AT'], $user->format_date($poll_end)) : '', + + 'S_HAS_POLL' => true, + 'S_CAN_VOTE' => $s_can_vote, + 'S_DISPLAY_RESULTS' => $s_display_results, + 'S_IS_MULTI_CHOICE' => ($topic_data['poll_max_options'] > 1) ? true : false, + 'S_POLL_ACTION' => $viewtopic_url, + + 'U_VIEW_RESULTS' => $viewtopic_url . '&view=viewpoll', + )); + + unset($poll_end, $poll_info, $voted_id); +} + +// If the user is trying to reach the second half of the topic, fetch it starting from the end +$store_reverse = false; +$sql_limit = $config['posts_per_page']; +$sql_sort_order = $direction = ''; + +if ($start > $total_posts / 2) +{ + $store_reverse = true; + + // Select the sort order + $direction = (($sort_dir == 'd') ? 'ASC' : 'DESC'); + + $sql_limit = $pagination->reverse_limit($start, $sql_limit, $total_posts); + $sql_start = $pagination->reverse_start($start, $sql_limit, $total_posts); +} +else +{ + // Select the sort order + $direction = (($sort_dir == 'd') ? 'DESC' : 'ASC'); + $sql_start = $start; +} + +if (is_array($sort_by_sql[$sort_key])) +{ + $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; +} +else +{ + $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; +} + +// Container for user details, only process once +$post_list = $user_cache = $id_cache = $attachments = $attach_list = $rowset = $update_count = $post_edit_list = $post_delete_list = array(); +$has_unapproved_attachments = $has_approved_attachments = $display_notice = false; +$bbcode_bitfield = ''; +$i = $i_total = 0; + +// Go ahead and pull all data for this topic +$sql = 'SELECT p.post_id + FROM ' . POSTS_TABLE . ' p' . (($join_user_sql[$sort_key]) ? ', ' . USERS_TABLE . ' u': '') . " + WHERE p.topic_id = $topic_id + AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id, 'p.') . " + " . (($join_user_sql[$sort_key]) ? 'AND u.user_id = p.poster_id': '') . " + $limit_posts_time + ORDER BY $sql_sort_order"; +$result = $db->sql_query_limit($sql, $sql_limit, $sql_start); + +$i = ($store_reverse) ? $sql_limit - 1 : 0; +while ($row = $db->sql_fetchrow($result)) +{ + $post_list[$i] = (int) $row['post_id']; + ($store_reverse) ? $i-- : $i++; +} +$db->sql_freeresult($result); + +if (!sizeof($post_list)) +{ + if ($sort_days) + { + trigger_error('NO_POSTS_TIME_FRAME'); + } + else + { + trigger_error('NO_TOPIC'); + } +} + +// Holding maximum post time for marking topic read +// We need to grab it because we do reverse ordering sometimes +$max_post_time = 0; + +$sql_ary = array( + 'SELECT' => 'u.*, z.friend, z.foe, p.*', + + 'FROM' => array( + USERS_TABLE => 'u', + POSTS_TABLE => 'p', + ), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(ZEBRA_TABLE => 'z'), + 'ON' => 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id', + ), + ), + + 'WHERE' => $db->sql_in_set('p.post_id', $post_list) . ' + AND u.user_id = p.poster_id', +); + +/** +* Event to modify the SQL query before the post and poster data is retrieved +* +* @event core.viewtopic_get_post_data +* @var int forum_id Forum ID +* @var int topic_id Topic ID +* @var array topic_data Array with topic data +* @var array post_list Array with post_ids we are going to retrieve +* @var int sort_days Display posts of previous x days +* @var string sort_key Key the posts are sorted by +* @var string sort_dir Direction the posts are sorted by +* @var int start Pagination information +* @var array sql_ary The SQL array to get the data of posts and posters +* @since 3.1.0-a1 +* @change 3.1.0-a2 Added vars forum_id, topic_id, topic_data, post_list, sort_days, sort_key, sort_dir, start +*/ +$vars = array( + 'forum_id', + 'topic_id', + 'topic_data', + 'post_list', + 'sort_days', + 'sort_key', + 'sort_dir', + 'start', + 'sql_ary', +); +extract($phpbb_dispatcher->trigger_event('core.viewtopic_get_post_data', compact($vars))); + +$sql = $db->sql_build_query('SELECT', $sql_ary); +$result = $db->sql_query($sql); + +$now = $user->create_datetime(); +$now = phpbb_gmgetdate($now->getTimestamp() + $now->getOffset()); + +// Posts are stored in the $rowset array while $attach_list, $user_cache +// and the global bbcode_bitfield are built +while ($row = $db->sql_fetchrow($result)) +{ + // Set max_post_time + if ($row['post_time'] > $max_post_time) + { + $max_post_time = $row['post_time']; + } + + $poster_id = (int) $row['poster_id']; + + // Does post have an attachment? If so, add it to the list + if ($row['post_attachment'] && $config['allow_attachments']) + { + $attach_list[] = (int) $row['post_id']; + + if ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) + { + $has_unapproved_attachments = true; + } + else if ($row['post_visibility'] == ITEM_APPROVED) + { + $has_approved_attachments = true; + } + } + + $rowset_data = array( + 'hide_post' => (($row['foe'] || $row['post_visibility'] == ITEM_DELETED) && ($view != 'show' || $post_id != $row['post_id'])) ? true : false, + + 'post_id' => $row['post_id'], + 'post_time' => $row['post_time'], + 'user_id' => $row['user_id'], + 'username' => $row['username'], + 'user_colour' => $row['user_colour'], + 'topic_id' => $row['topic_id'], + 'forum_id' => $row['forum_id'], + 'post_subject' => $row['post_subject'], + 'post_edit_count' => $row['post_edit_count'], + 'post_edit_time' => $row['post_edit_time'], + 'post_edit_reason' => $row['post_edit_reason'], + 'post_edit_user' => $row['post_edit_user'], + 'post_edit_locked' => $row['post_edit_locked'], + 'post_delete_time' => $row['post_delete_time'], + 'post_delete_reason'=> $row['post_delete_reason'], + 'post_delete_user' => $row['post_delete_user'], + + // Make sure the icon actually exists + 'icon_id' => (isset($icons[$row['icon_id']]['img'], $icons[$row['icon_id']]['height'], $icons[$row['icon_id']]['width'])) ? $row['icon_id'] : 0, + 'post_attachment' => $row['post_attachment'], + 'post_visibility' => $row['post_visibility'], + 'post_reported' => $row['post_reported'], + 'post_username' => $row['post_username'], + 'post_text' => $row['post_text'], + 'bbcode_uid' => $row['bbcode_uid'], + 'bbcode_bitfield' => $row['bbcode_bitfield'], + 'enable_smilies' => $row['enable_smilies'], + 'enable_sig' => $row['enable_sig'], + 'friend' => $row['friend'], + 'foe' => $row['foe'], + ); + + /** + * Modify the post rowset containing data to be displayed with posts + * + * @event core.viewtopic_post_rowset_data + * @var array rowset_data Array with the rowset data for this post + * @var array row Array with original user and post data + * @since 3.1.0-a1 + */ + $vars = array('rowset_data', 'row'); + extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_rowset_data', compact($vars))); + + $rowset[$row['post_id']] = $rowset_data; + + // Define the global bbcode bitfield, will be used to load bbcodes + $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']); + + // Is a signature attached? Are we going to display it? + if ($row['enable_sig'] && $config['allow_sig'] && $user->optionget('viewsigs')) + { + $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['user_sig_bbcode_bitfield']); + } + + // Cache various user specific data ... so we don't have to recompute + // this each time the same user appears on this page + if (!isset($user_cache[$poster_id])) + { + if ($poster_id == ANONYMOUS) + { + $user_cache_data = array( + 'user_type' => USER_IGNORE, + 'joined' => '', + 'posts' => '', + + 'sig' => '', + 'sig_bbcode_uid' => '', + 'sig_bbcode_bitfield' => '', + + 'online' => false, + 'avatar' => ($user->optionget('viewavatars')) ? phpbb_get_user_avatar($row) : '', + 'rank_title' => '', + 'rank_image' => '', + 'rank_image_src' => '', + 'sig' => '', + 'pm' => '', + 'email' => '', + 'jabber' => '', + 'search' => '', + 'age' => '', + + 'username' => $row['username'], + 'user_colour' => $row['user_colour'], + 'contact_user' => '', + + 'warnings' => 0, + 'allow_pm' => 0, + ); + + /** + * Modify the guest user's data displayed with the posts + * + * @event core.viewtopic_cache_guest_data + * @var array user_cache_data Array with the user's data + * @var int poster_id Poster's user id + * @var array row Array with original user and post data + * @since 3.1.0-a1 + */ + $vars = array('user_cache_data', 'poster_id', 'row'); + extract($phpbb_dispatcher->trigger_event('core.viewtopic_cache_guest_data', compact($vars))); + + $user_cache[$poster_id] = $user_cache_data; + + $user_rank_data = phpbb_get_user_rank($row, false); + $user_cache[$poster_id]['rank_title'] = $user_rank_data['title']; + $user_cache[$poster_id]['rank_image'] = $user_rank_data['img']; + $user_cache[$poster_id]['rank_image_src'] = $user_rank_data['img_src']; + } + else + { + $user_sig = ''; + + // We add the signature to every posters entry because enable_sig is post dependent + if ($row['user_sig'] && $config['allow_sig'] && $user->optionget('viewsigs')) + { + $user_sig = $row['user_sig']; + } + + $id_cache[] = $poster_id; + + $user_cache_data = array( + 'user_type' => $row['user_type'], + 'user_inactive_reason' => $row['user_inactive_reason'], + + 'joined' => $user->format_date($row['user_regdate']), + 'posts' => $row['user_posts'], + 'warnings' => (isset($row['user_warnings'])) ? $row['user_warnings'] : 0, + + 'sig' => $user_sig, + 'sig_bbcode_uid' => (!empty($row['user_sig_bbcode_uid'])) ? $row['user_sig_bbcode_uid'] : '', + 'sig_bbcode_bitfield' => (!empty($row['user_sig_bbcode_bitfield'])) ? $row['user_sig_bbcode_bitfield'] : '', + + 'viewonline' => $row['user_allow_viewonline'], + 'allow_pm' => $row['user_allow_pm'], + + 'avatar' => ($user->optionget('viewavatars')) ? phpbb_get_user_avatar($row) : '', + 'age' => '', + + 'rank_title' => '', + 'rank_image' => '', + 'rank_image_src' => '', + + 'username' => $row['username'], + 'user_colour' => $row['user_colour'], + 'contact_user' => $user->lang('CONTACT_USER', get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['username'])), + + 'online' => false, + 'jabber' => ($config['jab_enable'] && $row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=jabber&u=$poster_id") : '', + 'search' => ($config['load_search'] && $auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$poster_id&sr=posts") : '', + + 'author_full' => get_username_string('full', $poster_id, $row['username'], $row['user_colour']), + 'author_colour' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour']), + 'author_username' => get_username_string('username', $poster_id, $row['username'], $row['user_colour']), + 'author_profile' => get_username_string('profile', $poster_id, $row['username'], $row['user_colour']), + ); + + /** + * Modify the users' data displayed with their posts + * + * @event core.viewtopic_cache_user_data + * @var array user_cache_data Array with the user's data + * @var int poster_id Poster's user id + * @var array row Array with original user and post data + * @since 3.1.0-a1 + */ + $vars = array('user_cache_data', 'poster_id', 'row'); + extract($phpbb_dispatcher->trigger_event('core.viewtopic_cache_user_data', compact($vars))); + + $user_cache[$poster_id] = $user_cache_data; + + $user_rank_data = phpbb_get_user_rank($row, $row['user_posts']); + $user_cache[$poster_id]['rank_title'] = $user_rank_data['title']; + $user_cache[$poster_id]['rank_image'] = $user_rank_data['img']; + $user_cache[$poster_id]['rank_image_src'] = $user_rank_data['img_src']; + + if ((!empty($row['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_email')) + { + $user_cache[$poster_id]['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&u=$poster_id") : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $row['user_email']); + } + else + { + $user_cache[$poster_id]['email'] = ''; + } + + if ($config['allow_birthdays'] && !empty($row['user_birthday'])) + { + list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $row['user_birthday'])); + + if ($bday_year) + { + $diff = $now['mon'] - $bday_month; + if ($diff == 0) + { + $diff = ($now['mday'] - $bday_day < 0) ? 1 : 0; + } + else + { + $diff = ($diff < 0) ? 1 : 0; + } + + $user_cache[$poster_id]['age'] = (int) ($now['year'] - $bday_year - $diff); + } + } + } + } +} +$db->sql_freeresult($result); + +// Load custom profile fields +if ($config['load_cpf_viewtopic']) +{ + $cp = $phpbb_container->get('profilefields.manager'); + + // Grab all profile fields from users in id cache for later use - similar to the poster cache + $profile_fields_tmp = $cp->grab_profile_fields_data($id_cache); + + // filter out fields not to be displayed on viewtopic. Yes, it's a hack, but this shouldn't break any MODs. + $profile_fields_cache = array(); + foreach ($profile_fields_tmp as $profile_user_id => $profile_fields) + { + $profile_fields_cache[$profile_user_id] = array(); + foreach ($profile_fields as $used_ident => $profile_field) + { + if ($profile_field['data']['field_show_on_vt']) + { + $profile_fields_cache[$profile_user_id][$used_ident] = $profile_field; + } + } + } + unset($profile_fields_tmp); +} + +// Generate online information for user +if ($config['load_onlinetrack'] && sizeof($id_cache)) +{ + $sql = 'SELECT session_user_id, MAX(session_time) as online_time, MIN(session_viewonline) AS viewonline + FROM ' . SESSIONS_TABLE . ' + WHERE ' . $db->sql_in_set('session_user_id', $id_cache) . ' + GROUP BY session_user_id'; + $result = $db->sql_query($sql); + + $update_time = $config['load_online_time'] * 60; + while ($row = $db->sql_fetchrow($result)) + { + $user_cache[$row['session_user_id']]['online'] = (time() - $update_time < $row['online_time'] && (($row['viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false; + } + $db->sql_freeresult($result); +} +unset($id_cache); + +// Pull attachment data +if (sizeof($attach_list)) +{ + if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id)) + { + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_msg_id', $attach_list) . ' + AND in_message = 0 + ORDER BY filetime DESC, post_msg_id ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $attachments[$row['post_msg_id']][] = $row; + } + $db->sql_freeresult($result); + + // No attachments exist, but post table thinks they do so go ahead and reset post_attach flags + if (!sizeof($attachments)) + { + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET post_attachment = 0 + WHERE ' . $db->sql_in_set('post_id', $attach_list); + $db->sql_query($sql); + + // We need to update the topic indicator too if the complete topic is now without an attachment + if (sizeof($rowset) != $total_posts) + { + // Not all posts are displayed so we query the db to find if there's any attachment for this topic + $sql = 'SELECT a.post_msg_id as post_id + FROM ' . ATTACHMENTS_TABLE . ' a, ' . POSTS_TABLE . " p + WHERE p.topic_id = $topic_id + AND p.post_visibility = " . ITEM_APPROVED . ' + AND p.topic_id = a.topic_id'; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_attachment = 0 + WHERE topic_id = $topic_id"; + $db->sql_query($sql); + } + } + else + { + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_attachment = 0 + WHERE topic_id = $topic_id"; + $db->sql_query($sql); + } + } + else if ($has_approved_attachments && !$topic_data['topic_attachment']) + { + // Topic has approved attachments but its flag is wrong + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_attachment = 1 + WHERE topic_id = $topic_id"; + $db->sql_query($sql); + + $topic_data['topic_attachment'] = 1; + } + else if ($has_unapproved_attachments && !$topic_data['topic_attachment']) + { + // Topic has only unapproved attachments but we have the right to see and download them + $topic_data['topic_attachment'] = 1; + } + } + else + { + $display_notice = true; + } +} + +// Instantiate BBCode if need be +if ($bbcode_bitfield !== '') +{ + $bbcode = new bbcode(base64_encode($bbcode_bitfield)); +} + +// Get the list of users who can receive private messages +$can_receive_pm_list = $auth->acl_get_list(array_keys($user_cache), 'u_readpm'); +$can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_list[0]['u_readpm'])) ? array() : $can_receive_pm_list[0]['u_readpm']; + +// Get the list of permanently banned users +$permanently_banned_users = phpbb_get_banned_user_ids(array_keys($user_cache), false); + +$i_total = sizeof($rowset) - 1; +$prev_post_id = ''; + +$template->assign_vars(array( + 'S_HAS_ATTACHMENTS' => $topic_data['topic_attachment'], + 'S_NUM_POSTS' => sizeof($post_list)) +); + +/** +* Event to modify the post, poster and attachment data before assigning the posts +* +* @event core.viewtopic_modify_post_data +* @var int forum_id Forum ID +* @var int topic_id Topic ID +* @var array topic_data Array with topic data +* @var array post_list Array with post_ids we are going to display +* @var array rowset Array with post_id => post data +* @var array user_cache Array with prepared user data +* @var int start Pagination information +* @var int sort_days Display posts of previous x days +* @var string sort_key Key the posts are sorted by +* @var string sort_dir Direction the posts are sorted by +* @var bool display_notice Shall we display a notice instead of attachments +* @var bool has_approved_attachments Does the topic have approved attachments +* @var array attachments List of attachments post_id => array of attachments +* @var array permanently_banned_users List of permanently banned users +* @var array can_receive_pm_list Array with posters that can receive pms +* @since 3.1.0-RC3 +*/ +$vars = array( + 'forum_id', + 'topic_id', + 'topic_data', + 'post_list', + 'rowset', + 'user_cache', + 'sort_days', + 'sort_key', + 'sort_dir', + 'start', + 'permanently_banned_users', + 'can_receive_pm_list', + 'display_notice', + 'has_approved_attachments', + 'attachments', +); +extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_data', compact($vars))); + +// Output the posts +$first_unread = $post_unread = false; +for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) +{ + // A non-existing rowset only happens if there was no user present for the entered poster_id + // This could be a broken posts table. + if (!isset($rowset[$post_list[$i]])) + { + continue; + } + + $row = $rowset[$post_list[$i]]; + $poster_id = $row['user_id']; + + // End signature parsing, only if needed + if ($user_cache[$poster_id]['sig'] && $row['enable_sig'] && empty($user_cache[$poster_id]['sig_parsed'])) + { + $parse_flags = ($user_cache[$poster_id]['sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; + $user_cache[$poster_id]['sig'] = generate_text_for_display($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield'], $parse_flags, true); + } + + // Parse the message and subject + $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; + $message = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, true); + + if (!empty($attachments[$row['post_id']])) + { + parse_attachments($forum_id, $message, $attachments[$row['post_id']], $update_count); + } + + // Replace naughty words such as farty pants + $row['post_subject'] = censor_text($row['post_subject']); + + // Highlight active words (primarily for search) + if ($highlight_match) + { + $message = preg_replace('#(?!<.*)(?]*(?:)#is', '\1', $message); + $row['post_subject'] = preg_replace('#(?!<.*)(?]*(?:)#is', '\1', $row['post_subject']); + } + + // Editing information + if (($row['post_edit_count'] && $config['display_last_edited']) || $row['post_edit_reason']) + { + // Get usernames for all following posts if not already stored + if (!sizeof($post_edit_list) && ($row['post_edit_reason'] || ($row['post_edit_user'] && !isset($user_cache[$row['post_edit_user']])))) + { + // Remove all post_ids already parsed (we do not have to check them) + $post_storage_list = (!$store_reverse) ? array_slice($post_list, $i) : array_slice(array_reverse($post_list), $i); + + $sql = 'SELECT DISTINCT u.user_id, u.username, u.user_colour + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u + WHERE ' . $db->sql_in_set('p.post_id', $post_storage_list) . ' + AND p.post_edit_count <> 0 + AND p.post_edit_user <> 0 + AND p.post_edit_user = u.user_id'; + $result2 = $db->sql_query($sql); + while ($user_edit_row = $db->sql_fetchrow($result2)) + { + $post_edit_list[$user_edit_row['user_id']] = $user_edit_row; + } + $db->sql_freeresult($result2); + + unset($post_storage_list); + } + + if ($row['post_edit_reason']) + { + // User having edited the post also being the post author? + if (!$row['post_edit_user'] || $row['post_edit_user'] == $poster_id) + { + $display_username = get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']); + } + else + { + $display_username = get_username_string('full', $row['post_edit_user'], $post_edit_list[$row['post_edit_user']]['username'], $post_edit_list[$row['post_edit_user']]['user_colour']); + } + + $l_edited_by = $user->lang('EDITED_TIMES_TOTAL', (int) $row['post_edit_count'], $display_username, $user->format_date($row['post_edit_time'], false, true)); + } + else + { + if ($row['post_edit_user'] && !isset($user_cache[$row['post_edit_user']])) + { + $user_cache[$row['post_edit_user']] = $post_edit_list[$row['post_edit_user']]; + } + + // User having edited the post also being the post author? + if (!$row['post_edit_user'] || $row['post_edit_user'] == $poster_id) + { + $display_username = get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']); + } + else + { + $display_username = get_username_string('full', $row['post_edit_user'], $user_cache[$row['post_edit_user']]['username'], $user_cache[$row['post_edit_user']]['user_colour']); + } + + $l_edited_by = $user->lang('EDITED_TIMES_TOTAL', (int) $row['post_edit_count'], $display_username, $user->format_date($row['post_edit_time'], false, true)); + } + } + else + { + $l_edited_by = ''; + } + + // Deleting information + if ($row['post_visibility'] == ITEM_DELETED && $row['post_delete_user']) + { + // Get usernames for all following posts if not already stored + if (!sizeof($post_delete_list) && ($row['post_delete_reason'] || ($row['post_delete_user'] && !isset($user_cache[$row['post_delete_user']])))) + { + // Remove all post_ids already parsed (we do not have to check them) + $post_storage_list = (!$store_reverse) ? array_slice($post_list, $i) : array_slice(array_reverse($post_list), $i); + + $sql = 'SELECT DISTINCT u.user_id, u.username, u.user_colour + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u + WHERE ' . $db->sql_in_set('p.post_id', $post_storage_list) . ' + AND p.post_delete_user <> 0 + AND p.post_delete_user = u.user_id'; + $result2 = $db->sql_query($sql); + while ($user_delete_row = $db->sql_fetchrow($result2)) + { + $post_delete_list[$user_delete_row['user_id']] = $user_delete_row; + } + $db->sql_freeresult($result2); + + unset($post_storage_list); + } + + if ($row['post_delete_user'] && !isset($user_cache[$row['post_delete_user']])) + { + $user_cache[$row['post_delete_user']] = $post_delete_list[$row['post_delete_user']]; + } + + $display_postername = get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']); + + // User having deleted the post also being the post author? + if (!$row['post_delete_user'] || $row['post_delete_user'] == $poster_id) + { + $display_username = $display_postername; + } + else + { + $display_username = get_username_string('full', $row['post_delete_user'], $user_cache[$row['post_delete_user']]['username'], $user_cache[$row['post_delete_user']]['user_colour']); + } + + if ($row['post_delete_reason']) + { + $l_deleted_message = $user->lang('POST_DELETED_BY_REASON', $display_postername, $display_username, $user->format_date($row['post_delete_time'], false, true), $row['post_delete_reason']); + } + else + { + $l_deleted_message = $user->lang('POST_DELETED_BY', $display_postername, $display_username, $user->format_date($row['post_delete_time'], false, true)); + } + $l_deleted_by = $user->lang('DELETED_INFORMATION', $display_username, $user->format_date($row['post_delete_time'], false, true)); + } + else + { + $l_deleted_by = $l_deleted_message = ''; + } + + // Bump information + if ($topic_data['topic_bumped'] && $row['post_id'] == $topic_data['topic_last_post_id'] && isset($user_cache[$topic_data['topic_bumper']]) ) + { + // It is safe to grab the username from the user cache array, we are at the last + // post and only the topic poster and last poster are allowed to bump. + // Admins and mods are bound to the above rules too... + $l_bumped_by = sprintf($user->lang['BUMPED_BY'], $user_cache[$topic_data['topic_bumper']]['username'], $user->format_date($topic_data['topic_last_post_time'], false, true)); + } + else + { + $l_bumped_by = ''; + } + + $cp_row = array(); + + // + if ($config['load_cpf_viewtopic']) + { + $cp_row = (isset($profile_fields_cache[$poster_id])) ? $cp->generate_profile_fields_template_data($profile_fields_cache[$poster_id]) : array(); + } + + $post_unread = (isset($topic_tracking_info[$topic_id]) && $row['post_time'] > $topic_tracking_info[$topic_id]) ? true : false; + + $s_first_unread = false; + if (!$first_unread && $post_unread) + { + $s_first_unread = $first_unread = true; + } + + $force_edit_allowed = $force_delete_allowed = false; + + $s_cannot_edit = !$auth->acl_get('f_edit', $forum_id) || $user->data['user_id'] != $poster_id; + $s_cannot_edit_time = $config['edit_time'] && $row['post_time'] <= time() - ($config['edit_time'] * 60); + $s_cannot_edit_locked = $topic_data['topic_status'] == ITEM_LOCKED || $row['post_edit_locked']; + + $s_cannot_delete = $user->data['user_id'] != $poster_id || ( + !$auth->acl_get('f_delete', $forum_id) && + (!$auth->acl_get('f_softdelete', $forum_id) || $row['post_visibility'] == ITEM_DELETED) + ); + $s_cannot_delete_lastpost = $topic_data['topic_last_post_id'] != $row['post_id']; + $s_cannot_delete_time = $config['delete_time'] && $row['post_time'] <= time() - ($config['delete_time'] * 60); + // we do not want to allow removal of the last post if a moderator locked it! + $s_cannot_delete_locked = $topic_data['topic_status'] == ITEM_LOCKED || $row['post_edit_locked']; + + /** + * This event allows you to modify the conditions for the "can edit post" and "can delete post" checks + * + * @event core.viewtopic_modify_post_action_conditions + * @var array row Array with post data + * @var array topic_data Array with topic data + * @var bool force_edit_allowed Allow the user to edit the post (all permissions and conditions are ignored) + * @var bool s_cannot_edit User can not edit the post because it's not his + * @var bool s_cannot_edit_locked User can not edit the post because it's locked + * @var bool s_cannot_edit_time User can not edit the post because edit_time has passed + * @var bool force_delete_allowed Allow the user to delete the post (all permissions and conditions are ignored) + * @var bool s_cannot_delete User can not delete the post because it's not his + * @var bool s_cannot_delete_lastpost User can not delete the post because it's not the last post of the topic + * @var bool s_cannot_delete_locked User can not delete the post because it's locked + * @var bool s_cannot_delete_time User can not delete the post because edit_time has passed + * @since 3.1.0-b4 + */ + $vars = array( + 'row', + 'topic_data', + 'force_edit_allowed', + 's_cannot_edit', + 's_cannot_edit_locked', + 's_cannot_edit_time', + 'force_delete_allowed', + 's_cannot_delete', + 's_cannot_delete_lastpost', + 's_cannot_delete_locked', + 's_cannot_delete_time', + ); + extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_action_conditions', compact($vars))); + + $edit_allowed = $force_edit_allowed || ($user->data['is_registered'] && ($auth->acl_get('m_edit', $forum_id) || ( + !$s_cannot_edit && + !$s_cannot_edit_time && + !$s_cannot_edit_locked + ))); + + $quote_allowed = $auth->acl_get('m_edit', $forum_id) || ($topic_data['topic_status'] != ITEM_LOCKED && + ($user->data['user_id'] == ANONYMOUS || $auth->acl_get('f_reply', $forum_id)) + ); + + $delete_allowed = $force_delete_allowed || ($user->data['is_registered'] && ( + ($auth->acl_get('m_delete', $forum_id) || ($auth->acl_get('m_softdelete', $forum_id) && $row['post_visibility'] != ITEM_DELETED)) || + (!$s_cannot_delete && !$s_cannot_delete_lastpost && !$s_cannot_delete_time && !$s_cannot_delete_locked) + )); + + // Can this user receive a Private Message? + $can_receive_pm = ( + // They must be a "normal" user + $user_cache[$poster_id]['user_type'] != USER_IGNORE && + + // They must not be deactivated by the administrator + ($user_cache[$poster_id]['user_type'] != USER_INACTIVE || $user_cache[$poster_id]['user_inactive_reason'] != INACTIVE_MANUAL) && + + // They must be able to read PMs + in_array($poster_id, $can_receive_pm_list) && + + // They must not be permanently banned + !in_array($poster_id, $permanently_banned_users) && + + // They must allow users to contact via PM + (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $user_cache[$poster_id]['allow_pm']) + ); + + $u_pm = ''; + + if ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && $can_receive_pm) + { + $u_pm = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&action=quotepost&p=' . $row['post_id']); + } + + // + $post_row = array( + 'POST_AUTHOR_FULL' => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_full'] : get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), + 'POST_AUTHOR_COLOUR' => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_colour'] : get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), + 'POST_AUTHOR' => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_username'] : get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), + 'U_POST_AUTHOR' => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_profile'] : get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), + + 'RANK_TITLE' => $user_cache[$poster_id]['rank_title'], + 'RANK_IMG' => $user_cache[$poster_id]['rank_image'], + 'RANK_IMG_SRC' => $user_cache[$poster_id]['rank_image_src'], + 'POSTER_JOINED' => $user_cache[$poster_id]['joined'], + 'POSTER_POSTS' => $user_cache[$poster_id]['posts'], + 'POSTER_AVATAR' => $user_cache[$poster_id]['avatar'], + 'POSTER_WARNINGS' => $auth->acl_get('m_warn') ? $user_cache[$poster_id]['warnings'] : '', + 'POSTER_AGE' => $user_cache[$poster_id]['age'], + 'CONTACT_USER' => $user_cache[$poster_id]['contact_user'], + + 'POST_DATE' => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false), + 'POST_SUBJECT' => $row['post_subject'], + 'MESSAGE' => $message, + 'SIGNATURE' => ($row['enable_sig']) ? $user_cache[$poster_id]['sig'] : '', + 'EDITED_MESSAGE' => $l_edited_by, + 'EDIT_REASON' => $row['post_edit_reason'], + 'DELETED_MESSAGE' => $l_deleted_by, + 'DELETE_REASON' => $row['post_delete_reason'], + 'BUMPED_MESSAGE' => $l_bumped_by, + + 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'), + 'POST_ICON_IMG' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['img'] : '', + 'POST_ICON_IMG_WIDTH' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['width'] : '', + 'POST_ICON_IMG_HEIGHT' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['height'] : '', + 'ONLINE_IMG' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')), + 'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false), + + 'U_EDIT' => ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$row['post_id']}") : '', + 'U_QUOTE' => ($quote_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '', + 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&f=$forum_id&p=" . $row['post_id'], true, $user->session_id) : '', + 'U_DELETE' => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$forum_id&p={$row['post_id']}") : '', + + 'U_SEARCH' => $user_cache[$poster_id]['search'], + 'U_PM' => $u_pm, + 'U_EMAIL' => $user_cache[$poster_id]['email'], + 'U_JABBER' => $user_cache[$poster_id]['jabber'], + + 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p={$row['post_id']}&f=$forum_id&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url . '&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 . '&p=' . $row['post_id']) : '', + 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $forum_id . '&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&mode=approve_details&f=' . $forum_id . '&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&mode=' . (($topic_data['topic_visibility'] != ITEM_DELETED) ? 'deleted_posts' : 'deleted_topics') . '&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', + 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'], + 'U_NEXT_POST_ID' => ($i < $i_total && isset($rowset[$post_list[$i + 1]])) ? $rowset[$post_list[$i + 1]]['post_id'] : '', + 'U_PREV_POST_ID' => $prev_post_id, + 'U_NOTES' => ($auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $poster_id, true, $user->session_id) : '', + 'U_WARN' => ($auth->acl_get('m_warn') && $poster_id != $user->data['user_id'] && $poster_id != ANONYMOUS) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_post&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', + + 'POST_ID' => $row['post_id'], + 'POST_NUMBER' => $i + $start + 1, + 'POSTER_ID' => $poster_id, + + 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false, + 'S_MULTIPLE_ATTACHMENTS' => !empty($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']]) > 1, + 'S_POST_UNAPPROVED' => ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) ? true : false, + 'S_POST_DELETED' => ($row['post_visibility'] == ITEM_DELETED) ? true : false, + 'L_POST_DELETED_MESSAGE' => $l_deleted_message, + 'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $forum_id)) ? true : false, + 'S_DISPLAY_NOTICE' => $display_notice && $row['post_attachment'], + 'S_FRIEND' => ($row['friend']) ? true : false, + 'S_UNREAD_POST' => $post_unread, + 'S_FIRST_UNREAD' => $s_first_unread, + 'S_CUSTOM_FIELDS' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false, + 'S_TOPIC_POSTER' => ($topic_data['topic_poster'] == $poster_id) ? true : false, + + 'S_IGNORE_POST' => ($row['foe']) ? true : false, + 'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '', + 'S_POST_HIDDEN' => $row['hide_post'], + 'L_POST_DISPLAY' => ($row['hide_post']) ? $user->lang('POST_DISPLAY', '', '') : '', + ); + + $user_poster_data = $user_cache[$poster_id]; + + $current_row_number = $i; + + /** + * Modify the posts template block + * + * @event core.viewtopic_modify_post_row + * @var int start Start item of this page + * @var int current_row_number Number of the post on this page + * @var int end Number of posts on this page + * @var int total_posts Total posts count + * @var int poster_id Post author id + * @var array row Array with original post and user data + * @var array cp_row Custom profile field data of the poster + * @var array attachments List of attachments + * @var array user_poster_data Poster's data from user cache + * @var array post_row Template block array of the post + * @var array topic_data Array with topic data + * @since 3.1.0-a1 + * @change 3.1.0-a3 Added vars start, current_row_number, end, attachments + * @change 3.1.0-b3 Added topic_data array, total_posts + * @change 3.1.0-RC3 Added poster_id + */ + $vars = array( + 'start', + 'current_row_number', + 'end', + 'total_posts', + 'poster_id', + 'row', + 'cp_row', + 'attachments', + 'user_poster_data', + 'post_row', + 'topic_data', + ); + extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_row', compact($vars))); + + $i = $current_row_number; + + if (isset($cp_row['row']) && sizeof($cp_row['row'])) + { + $post_row = array_merge($post_row, $cp_row['row']); + } + + // Dump vars into template + $template->assign_block_vars('postrow', $post_row); + + $contact_fields = array( + array( + 'ID' => 'pm', + 'NAME' => $user->lang['SEND_PRIVATE_MESSAGE'], + 'U_CONTACT' => $u_pm, + ), + array( + 'ID' => 'email', + 'NAME' => $user->lang['SEND_EMAIL'], + 'U_CONTACT' => $user_cache[$poster_id]['email'], + ), + array( + 'ID' => 'jabber', + 'NAME' => $user->lang['JABBER'], + 'U_CONTACT' => $user_cache[$poster_id]['jabber'], + ), + ); + + foreach ($contact_fields as $field) + { + if ($field['U_CONTACT']) + { + $template->assign_block_vars('postrow.contact', $field); + } + } + + if (!empty($cp_row['blockrow'])) + { + foreach ($cp_row['blockrow'] as $field_data) + { + $template->assign_block_vars('postrow.custom_fields', $field_data); + + if ($field_data['S_PROFILE_CONTACT']) + { + $template->assign_block_vars('postrow.contact', array( + 'ID' => $field_data['PROFILE_FIELD_IDENT'], + 'NAME' => $field_data['PROFILE_FIELD_NAME'], + 'U_CONTACT' => $field_data['PROFILE_FIELD_CONTACT'], + )); + } + } + } + + // Display not already displayed Attachments for this post, we already parsed them. ;) + if (!empty($attachments[$row['post_id']])) + { + foreach ($attachments[$row['post_id']] as $attachment) + { + $template->assign_block_vars('postrow.attachment', array( + 'DISPLAY_ATTACHMENT' => $attachment) + ); + } + } + + $current_row_number = $i; + + /** + * Event after the post data has been assigned to the template + * + * @event core.viewtopic_post_row_after + * @var int start Start item of this page + * @var int current_row_number Number of the post on this page + * @var int end Number of posts on this page + * @var int total_posts Total posts count + * @var array row Array with original post and user data + * @var array cp_row Custom profile field data of the poster + * @var array attachments List of attachments + * @var array user_poster_data Poster's data from user cache + * @var array post_row Template block array of the post + * @var array topic_data Array with topic data + * @since 3.1.0-a3 + * @change 3.1.0-b3 Added topic_data array, total_posts + */ + $vars = array( + 'start', + 'current_row_number', + 'end', + 'total_posts', + 'row', + 'cp_row', + 'attachments', + 'user_poster_data', + 'post_row', + 'topic_data', + ); + extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_row_after', compact($vars))); + + $i = $current_row_number; + + $prev_post_id = $row['post_id']; + + unset($rowset[$post_list[$i]]); + unset($attachments[$row['post_id']]); +} +unset($rowset, $user_cache); + +// Update topic view and if necessary attachment view counters ... but only for humans and if this is the first 'page view' +if (isset($user->data['session_page']) && !$user->data['is_bot'] && (strpos($user->data['session_page'], '&t=' . $topic_id) === false || isset($user->data['session_created']))) +{ + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_views = topic_views + 1, topic_last_view_time = ' . time() . " + WHERE topic_id = $topic_id"; + $db->sql_query($sql); + + // Update the attachment download counts + if (sizeof($update_count)) + { + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' + SET download_count = download_count + 1 + WHERE ' . $db->sql_in_set('attach_id', array_unique($update_count)); + $db->sql_query($sql); + } +} + +// Only mark topic if it's currently unread. Also make sure we do not set topic tracking back if earlier pages are viewed. +if (isset($topic_tracking_info[$topic_id]) && $topic_data['topic_last_post_time'] > $topic_tracking_info[$topic_id] && $max_post_time > $topic_tracking_info[$topic_id]) +{ + markread('topic', $forum_id, $topic_id, $max_post_time); + + // Update forum info + $all_marked_read = update_forum_tracking_info($forum_id, $topic_data['forum_last_post_time'], (isset($topic_data['forum_mark_time'])) ? $topic_data['forum_mark_time'] : false, false); +} +else +{ + $all_marked_read = true; +} + +// If there are absolutely no more unread posts in this forum +// and unread posts shown, we can safely show the #unread link +if ($all_marked_read) +{ + if ($post_unread) + { + $template->assign_vars(array( + 'U_VIEW_UNREAD_POST' => '#unread', + )); + } + else if (isset($topic_tracking_info[$topic_id]) && $topic_data['topic_last_post_time'] > $topic_tracking_info[$topic_id]) + { + $template->assign_vars(array( + 'U_VIEW_UNREAD_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=unread") . '#unread', + )); + } +} +else if (!$all_marked_read) +{ + $last_page = ((floor($start / $config['posts_per_page']) + 1) == max(ceil($total_posts / $config['posts_per_page']), 1)) ? true : false; + + // What can happen is that we are at the last displayed page. If so, we also display the #unread link based in $post_unread + if ($last_page && $post_unread) + { + $template->assign_vars(array( + 'U_VIEW_UNREAD_POST' => '#unread', + )); + } + else if (!$last_page) + { + $template->assign_vars(array( + 'U_VIEW_UNREAD_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=unread") . '#unread', + )); + } +} + +// let's set up quick_reply +$s_quick_reply = false; +if ($user->data['is_registered'] && $config['allow_quick_reply'] && ($topic_data['forum_flags'] & FORUM_FLAG_QUICK_REPLY) && $auth->acl_get('f_reply', $forum_id)) +{ + // Quick reply enabled forum + $s_quick_reply = (($topic_data['forum_status'] == ITEM_UNLOCKED && $topic_data['topic_status'] == ITEM_UNLOCKED) || $auth->acl_get('m_edit', $forum_id)) ? true : false; +} + +if ($s_can_vote || $s_quick_reply) +{ + add_form_key('posting'); + + if ($s_quick_reply) + { + $s_attach_sig = $config['allow_sig'] && $user->optionget('attachsig') && $auth->acl_get('f_sigs', $forum_id) && $auth->acl_get('u_sig'); + $s_smilies = $config['allow_smilies'] && $user->optionget('smilies') && $auth->acl_get('f_smilies', $forum_id); + $s_bbcode = $config['allow_bbcode'] && $user->optionget('bbcode') && $auth->acl_get('f_bbcode', $forum_id); + $s_notify = $config['allow_topic_notify'] && ($user->data['user_notify'] || $s_watching_topic['is_watching']); + + $qr_hidden_fields = array( + 'topic_cur_post_id' => (int) $topic_data['topic_last_post_id'], + 'lastclick' => (int) time(), + 'topic_id' => (int) $topic_data['topic_id'], + 'forum_id' => (int) $forum_id, + ); + + // Originally we use checkboxes and check with isset(), so we only provide them if they would be checked + (!$s_bbcode) ? $qr_hidden_fields['disable_bbcode'] = 1 : true; + (!$s_smilies) ? $qr_hidden_fields['disable_smilies'] = 1 : true; + (!$config['allow_post_links']) ? $qr_hidden_fields['disable_magic_url'] = 1 : true; + ($s_attach_sig) ? $qr_hidden_fields['attach_sig'] = 1 : true; + ($s_notify) ? $qr_hidden_fields['notify'] = 1 : true; + ($topic_data['topic_status'] == ITEM_LOCKED) ? $qr_hidden_fields['lock_topic'] = 1 : true; + + $template->assign_vars(array( + 'S_QUICK_REPLY' => true, + 'U_QR_ACTION' => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&f=$forum_id&t=$topic_id"), + 'QR_HIDDEN_FIELDS' => build_hidden_fields($qr_hidden_fields), + 'SUBJECT' => 'Re: ' . censor_text($topic_data['topic_title']), + )); + } +} +// now I have the urge to wash my hands :( + + +// 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)) +{ + $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)) +{ + $request->overwrite('t', $topic_id); +} + +$page_title = $topic_data['topic_title'] . ($start ? ' - ' . sprintf($user->lang['PAGE_TITLE_NUMBER'], $pagination->get_on_page($config['posts_per_page'], $start)) : ''); + +/** +* You can use this event to modify the page title of the viewtopic page +* +* @event core.viewtopic_modify_page_title +* @var string page_title Title of the viewtopic page +* @var array topic_data Array with topic data +* @var int forum_id Forum ID of the topic +* @var int start Start offset used to calculate the page +* @var array post_list Array with post_ids we are going to display +* @since 3.1.0-a1 +* @change 3.1.0-RC4 Added post_list var +*/ +$vars = array('page_title', 'topic_data', 'forum_id', 'start', 'post_list'); +extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_page_title', compact($vars))); + +// Output the page +page_header($page_title, true, $forum_id); + +$template->set_filenames(array( + 'body' => ($view == 'print') ? 'viewtopic_print.html' : 'viewtopic_body.html') +); +make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"), $forum_id); + +page_footer(); diff --git a/sources/phpBB/web.config b/sources/phpBB/web.config new file mode 100644 index 0000000..a73c328 --- /dev/null +++ b/sources/phpBB/web.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +